From: Andrea Amorese Date: Thu, 16 Sep 2021 08:40:56 +0000 (+0200) Subject: Built motion from commit 3b49c2a4.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=41de53bd070a6eec304500912374dbde510d148e;p=motion2.git Built motion from commit 3b49c2a4.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f19522f..86949b3 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-16T08:15:04.211Z", + "time": "2021-09-16T08:35:05.636Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 9200ffe..c2794f0 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-16T08:15:04.211Z", + "time": "2021-09-16T08:35:05.636Z", "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 ad8a943..79467d2 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 _0x4c9c=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script'];(function(_0x3f81b3,_0x2719de){var _0x25099f=function(_0x11a23c){while(--_0x11a23c){_0x3f81b3['push'](_0x3f81b3['shift']());}};_0x25099f(++_0x2719de);}(_0x4c9c,0x1ac));var _0xc4c9=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0x4c9c[_0x3d18af];return _0x2ef919;};'use strict';var Sequelize=require(_0xc4c9('0x0'));module[_0xc4c9('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3a0b54){return this[_0xc4c9('0x2')](_0xc4c9('0x3'));}},'action':{'type':Sequelize[_0xc4c9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc4c9('0x5'),_0xc4c9('0x6'),_0xc4c9('0x7'),_0xc4c9('0x8'),_0xc4c9('0x9'),_0xc4c9('0xa'),_0xc4c9('0xb'),_0xc4c9('0xc')]],'msg':_0xc4c9('0xd')}},'comment':_0xc4c9('0xd')},'data1':{'type':Sequelize[_0xc4c9('0x4')](0x1000),'comment':_0xc4c9('0xe')},'data2':{'type':Sequelize[_0xc4c9('0x4')](0x1000),'comment':_0xc4c9('0xf')},'data3':{'type':Sequelize[_0xc4c9('0x4')](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[_0xc4c9('0x4')](0x1000),'comments':_0xc4c9('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xc4c9('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0xc4c9('0x12')},'data7':{'type':Sequelize[_0xc4c9('0x13')],'comments':_0xc4c9('0x14')}}; \ No newline at end of file +var _0x883b=['sequelize','exports','action','STRING','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x1d5856,_0x2aa3ed){var _0x474d0c=function(_0x4d8a1f){while(--_0x4d8a1f){_0x1d5856['push'](_0x1d5856['shift']());}};_0x474d0c(++_0x2aa3ed);}(_0x883b,0xc0));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xb883('0x0'));module[_0xb883('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x38c000){return this['getDataValue'](_0xb883('0x2'));}},'action':{'type':Sequelize[_0xb883('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb883('0x4'),_0xb883('0x5'),_0xb883('0x6'),_0xb883('0x7'),'urlForward','browser',_0xb883('0x8'),_0xb883('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb883('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xb883('0xb')},'data2':{'type':Sequelize[_0xb883('0x3')](0x1000),'comment':_0xb883('0xc')},'data3':{'type':Sequelize[_0xb883('0x3')](0x1000),'comment':_0xb883('0xd')},'data4':{'type':Sequelize[_0xb883('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xb883('0x3')](0x1000),'comments':_0xb883('0xe')},'data6':{'type':Sequelize[_0xb883('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xb883('0xf')],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 65bc6ea..124dc30 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 _0xd192=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','body','Action','find','params','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1912c9,_0x5e784e){var _0x1c966b=function(_0x3fcec4){while(--_0x3fcec4){_0x1912c9['push'](_0x1912c9['shift']());}};_0x1c966b(++_0x5e784e);}(_0xd192,0x116));var _0x2d19=function(_0x3b14d3,_0x24eb5a){_0x3b14d3=_0x3b14d3-0x0;var _0x124245=_0xd192[_0x3b14d3];return _0x124245;};'use strict';var emlformat=require(_0x2d19('0x0'));var rimraf=require(_0x2d19('0x1'));var zipdir=require(_0x2d19('0x2'));var jsonpatch=require(_0x2d19('0x3'));var rp=require(_0x2d19('0x4'));var moment=require(_0x2d19('0x5'));var BPromise=require(_0x2d19('0x6'));var Mustache=require(_0x2d19('0x7'));var util=require(_0x2d19('0x8'));var path=require(_0x2d19('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d19('0xa'));var fs=require('fs');var fs_extra=require(_0x2d19('0xb'));var _=require(_0x2d19('0xc'));var squel=require(_0x2d19('0xd'));var crypto=require('crypto');var jsforce=require(_0x2d19('0xe'));var deskjs=require(_0x2d19('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d19('0x10'));var Redis=require(_0x2d19('0x11'));var authService=require(_0x2d19('0x12'));var qs=require(_0x2d19('0x13'));var as=require(_0x2d19('0x14'));var hardwareService=require(_0x2d19('0x15'));var logger=require(_0x2d19('0x16'))(_0x2d19('0x17'));var utils=require(_0x2d19('0x18'));var config=require(_0x2d19('0x19'));var licenseUtil=require(_0x2d19('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3abbf1,_0x25fd72){_0x25fd72=_0x25fd72||0xcc;return function(_0x5b47c3){if(_0x5b47c3){return _0x3abbf1['sendStatus'](_0x25fd72);}return _0x3abbf1[_0x2d19('0x1b')](_0x25fd72)[_0x2d19('0x1c')]();};}function respondWithResult(_0x14fd62,_0x5e4728){_0x5e4728=_0x5e4728||0xc8;return function(_0x193046){if(_0x193046){return _0x14fd62[_0x2d19('0x1b')](_0x5e4728)[_0x2d19('0x1d')](_0x193046);}};}function respondWithFilteredResult(_0x591bbd,_0x25f50a){return function(_0x51df59){if(_0x51df59){var _0x188525=typeof _0x25f50a[_0x2d19('0x1e')]===_0x2d19('0x1f')&&typeof _0x25f50a[_0x2d19('0x20')]==='undefined';var _0x57b3b0=_0x51df59['count'];var _0x4f80b4=_0x188525?0x0:_0x25f50a['offset'];var _0x28cebd=_0x188525?_0x51df59['count']:_0x25f50a[_0x2d19('0x1e')]+_0x25f50a['limit'];var _0x569d8e;if(_0x28cebd>=_0x57b3b0){_0x28cebd=_0x57b3b0;_0x569d8e=0xc8;}else{_0x569d8e=0xce;}_0x591bbd[_0x2d19('0x1b')](_0x569d8e);return _0x591bbd[_0x2d19('0x21')](_0x2d19('0x22'),_0x4f80b4+'-'+_0x28cebd+'/'+_0x57b3b0)[_0x2d19('0x1d')](_0x51df59);}return null;};}function patchUpdates(_0x299076){return function(_0x54d01e){try{jsonpatch[_0x2d19('0x23')](_0x54d01e,_0x299076,!![]);}catch(_0x16bdba){return BPromise[_0x2d19('0x24')](_0x16bdba);}return _0x54d01e[_0x2d19('0x25')]();};}function saveUpdates(_0x15e034,_0x5ab99e){return function(_0x186077){if(_0x186077){return _0x186077[_0x2d19('0x26')](_0x15e034)[_0x2d19('0x27')](function(_0x4c3ad1){return _0x4c3ad1;});}return null;};}function removeEntity(_0x3c4a45,_0x1751c1){return function(_0x2a325a){if(_0x2a325a){return _0x2a325a['destroy']()[_0x2d19('0x27')](function(){_0x3c4a45[_0x2d19('0x1b')](0xcc)[_0x2d19('0x1c')]();});}};}function handleEntityNotFound(_0x113833,_0x5d9c96){return function(_0x45228d){if(!_0x45228d){_0x113833[_0x2d19('0x28')](0x194);}return _0x45228d;};}function handleError(_0x998ce0,_0x2ba56c){_0x2ba56c=_0x2ba56c||0x1f4;return function(_0x411e8e){logger[_0x2d19('0x29')](_0x411e8e[_0x2d19('0x2a')]);if(_0x411e8e[_0x2d19('0x2b')]){delete _0x411e8e['name'];}_0x998ce0[_0x2d19('0x1b')](_0x2ba56c)['send'](_0x411e8e);};}exports[_0x2d19('0x26')]=function(_0xe546dd,_0x139142){if(_0xe546dd[_0x2d19('0x2c')]['id']){delete _0xe546dd[_0x2d19('0x2c')]['id'];}return db[_0x2d19('0x2d')][_0x2d19('0x2e')]({'where':{'id':_0xe546dd[_0x2d19('0x2f')]['id']}})[_0x2d19('0x27')](handleEntityNotFound(_0x139142,null))[_0x2d19('0x27')](saveUpdates(_0xe546dd[_0x2d19('0x2c')],null))[_0x2d19('0x27')](respondWithResult(_0x139142,null))[_0x2d19('0x30')](handleError(_0x139142,null));};exports[_0x2d19('0x31')]=function(_0xdd692b,_0x4a60ea){return db['Action'][_0x2d19('0x2e')]({'where':{'id':_0xdd692b[_0x2d19('0x2f')]['id']}})[_0x2d19('0x27')](handleEntityNotFound(_0x4a60ea,null))[_0x2d19('0x27')](removeEntity(_0x4a60ea,null))['catch'](handleError(_0x4a60ea,null));}; \ No newline at end of file +var _0x9dc6=['request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','find','params','catch','Action','eml-format','rimraf','zip-dir'];(function(_0x4c1f9c,_0x49d2fc){var _0x2d3c4e=function(_0x1943fa){while(--_0x1943fa){_0x4c1f9c['push'](_0x4c1f9c['shift']());}};_0x2d3c4e(++_0x49d2fc);}(_0x9dc6,0xfc));var _0x69dc=function(_0xceff2d,_0x5dfea8){_0xceff2d=_0xceff2d-0x0;var _0x35def4=_0x9dc6[_0xceff2d];return _0x35def4;};'use strict';var emlformat=require(_0x69dc('0x0'));var rimraf=require(_0x69dc('0x1'));var zipdir=require(_0x69dc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x69dc('0x3'));var moment=require('moment');var BPromise=require(_0x69dc('0x4'));var Mustache=require(_0x69dc('0x5'));var util=require(_0x69dc('0x6'));var path=require(_0x69dc('0x7'));var sox=require(_0x69dc('0x8'));var csv=require(_0x69dc('0x9'));var ejs=require(_0x69dc('0xa'));var fs=require('fs');var fs_extra=require(_0x69dc('0xb'));var _=require(_0x69dc('0xc'));var squel=require(_0x69dc('0xd'));var crypto=require(_0x69dc('0xe'));var jsforce=require(_0x69dc('0xf'));var deskjs=require(_0x69dc('0x10'));var toCsv=require(_0x69dc('0x9'));var querystring=require('querystring');var Papa=require(_0x69dc('0x11'));var Redis=require(_0x69dc('0x12'));var authService=require(_0x69dc('0x13'));var qs=require(_0x69dc('0x14'));var as=require(_0x69dc('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69dc('0x16'))(_0x69dc('0x17'));var utils=require(_0x69dc('0x18'));var config=require(_0x69dc('0x19'));var licenseUtil=require(_0x69dc('0x1a'));var db=require(_0x69dc('0x1b'))['db'];function respondWithStatusCode(_0x51533c,_0x3554c1){_0x3554c1=_0x3554c1||0xcc;return function(_0x576e0e){if(_0x576e0e){return _0x51533c[_0x69dc('0x1c')](_0x3554c1);}return _0x51533c[_0x69dc('0x1d')](_0x3554c1)[_0x69dc('0x1e')]();};}function respondWithResult(_0x15098c,_0x2df69f){_0x2df69f=_0x2df69f||0xc8;return function(_0x38d010){if(_0x38d010){return _0x15098c[_0x69dc('0x1d')](_0x2df69f)[_0x69dc('0x1f')](_0x38d010);}};}function respondWithFilteredResult(_0x3bec5a,_0x470375){return function(_0x4baaaf){if(_0x4baaaf){var _0x5122d9=typeof _0x470375[_0x69dc('0x20')]==='undefined'&&typeof _0x470375['limit']===_0x69dc('0x21');var _0x30aed9=_0x4baaaf[_0x69dc('0x22')];var _0x5260d2=_0x5122d9?0x0:_0x470375['offset'];var _0x30c433=_0x5122d9?_0x4baaaf[_0x69dc('0x22')]:_0x470375['offset']+_0x470375[_0x69dc('0x23')];var _0x13b9a9;if(_0x30c433>=_0x30aed9){_0x30c433=_0x30aed9;_0x13b9a9=0xc8;}else{_0x13b9a9=0xce;}_0x3bec5a['status'](_0x13b9a9);return _0x3bec5a[_0x69dc('0x24')](_0x69dc('0x25'),_0x5260d2+'-'+_0x30c433+'/'+_0x30aed9)[_0x69dc('0x1f')](_0x4baaaf);}return null;};}function patchUpdates(_0x198986){return function(_0x417bea){try{jsonpatch[_0x69dc('0x26')](_0x417bea,_0x198986,!![]);}catch(_0x20eb13){return BPromise['reject'](_0x20eb13);}return _0x417bea[_0x69dc('0x27')]();};}function saveUpdates(_0x46f2f9,_0x5cafee){return function(_0x11bb10){if(_0x11bb10){return _0x11bb10[_0x69dc('0x28')](_0x46f2f9)[_0x69dc('0x29')](function(_0x419cc6){return _0x419cc6;});}return null;};}function removeEntity(_0x958429,_0x448c31){return function(_0x1c803b){if(_0x1c803b){return _0x1c803b[_0x69dc('0x2a')]()[_0x69dc('0x29')](function(){_0x958429[_0x69dc('0x1d')](0xcc)[_0x69dc('0x1e')]();});}};}function handleEntityNotFound(_0x443b92,_0xa34269){return function(_0x1b7a31){if(!_0x1b7a31){_0x443b92[_0x69dc('0x1c')](0x194);}return _0x1b7a31;};}function handleError(_0xef0f77,_0x4bfd25){_0x4bfd25=_0x4bfd25||0x1f4;return function(_0x5b71ea){logger[_0x69dc('0x2b')](_0x5b71ea[_0x69dc('0x2c')]);if(_0x5b71ea[_0x69dc('0x2d')]){delete _0x5b71ea['name'];}_0xef0f77[_0x69dc('0x1d')](_0x4bfd25)[_0x69dc('0x2e')](_0x5b71ea);};}exports[_0x69dc('0x28')]=function(_0x2d1f46,_0x229437){if(_0x2d1f46['body']['id']){delete _0x2d1f46['body']['id'];}return db['Action'][_0x69dc('0x2f')]({'where':{'id':_0x2d1f46[_0x69dc('0x30')]['id']}})[_0x69dc('0x29')](handleEntityNotFound(_0x229437,null))[_0x69dc('0x29')](saveUpdates(_0x2d1f46['body'],null))[_0x69dc('0x29')](respondWithResult(_0x229437,null))[_0x69dc('0x31')](handleError(_0x229437,null));};exports[_0x69dc('0x2a')]=function(_0x2cf879,_0x329cc5){return db[_0x69dc('0x32')]['find']({'where':{'id':_0x2cf879[_0x69dc('0x30')]['id']}})[_0x69dc('0x29')](handleEntityNotFound(_0x329cc5,null))[_0x69dc('0x29')](removeEntity(_0x329cc5,null))[_0x69dc('0x31')](handleError(_0x329cc5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index dff7266..56871d7 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 _0x0246=['util','../../config/logger','api','moment','path','../../config/environment','exports','tools_actions','lodash'];(function(_0x351a5c,_0x557317){var _0xae1dd7=function(_0x4312a5){while(--_0x4312a5){_0x351a5c['push'](_0x351a5c['shift']());}};_0xae1dd7(++_0x557317);}(_0x0246,0x1c1));var _0x6024=function(_0xbd7900,_0x54cd13){_0xbd7900=_0xbd7900-0x0;var _0x591548=_0x0246[_0xbd7900];return _0x591548;};'use strict';var _=require(_0x6024('0x0'));var util=require(_0x6024('0x1'));var logger=require(_0x6024('0x2'))(_0x6024('0x3'));var moment=require(_0x6024('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6024('0x5'));var rimraf=require('rimraf');var config=require(_0x6024('0x6'));var attributes=require('./action.attributes');module[_0x6024('0x7')]=function(_0x439efc,_0x41f141){return _0x439efc['define']('Action',attributes,{'tableName':_0x6024('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc302=['rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger','moment','bluebird','path'];(function(_0x4a1b12,_0x5aa3f8){var _0xa06c7a=function(_0x3378f3){while(--_0x3378f3){_0x4a1b12['push'](_0x4a1b12['shift']());}};_0xa06c7a(++_0x5aa3f8);}(_0xc302,0x187));var _0x2c30=function(_0x28cfe3,_0xade180){_0x28cfe3=_0x28cfe3-0x0;var _0x27fb8b=_0xc302[_0x28cfe3];return _0x27fb8b;};'use strict';var _=require('lodash');var util=require(_0x2c30('0x0'));var logger=require(_0x2c30('0x1'))('api');var moment=require(_0x2c30('0x2'));var BPromise=require(_0x2c30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c30('0x4'));var rimraf=require(_0x2c30('0x5'));var config=require(_0x2c30('0x6'));var attributes=require(_0x2c30('0x7'));module[_0x2c30('0x8')]=function(_0x704356,_0x15a0f3){return _0x704356[_0x2c30('0x9')](_0x2c30('0xa'),attributes,{'tableName':_0x2c30('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 e92fc58..3a449dc 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 _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\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(_0x7ddaad,_0x3e215b){var _0x3daa27=function(_0x1a6c9b){while(--_0x1a6c9b){_0x7ddaad['push'](_0x7ddaad['shift']());}};_0x3daa27(++_0x3e215b);}(_0x1261,0x144));var _0x1126=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x1261[_0xd27ded];return _0x5ef850;};'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')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3a014f,_0x5dc6c0){var _0x837811=function(_0x5343e4){while(--_0x5343e4){_0x3a014f['push'](_0x3a014f['shift']());}};_0x837811(++_0x5dc6c0);}(_0xabce,0x103));var _0xeabc=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xabce[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 149a782..7af6860 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 _0xbe54=['Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x34d61e,_0x4ac140){var _0x44b10e=function(_0x56984e){while(--_0x56984e){_0x34d61e['push'](_0x34d61e['shift']());}};_0x44b10e(++_0x4ac140);}(_0xbe54,0xcf));var _0x4be5=function(_0x50077d,_0x1d4cbc){_0x50077d=_0x50077d-0x0;var _0x3e44d2=_0xbe54[_0x50077d];return _0x3e44d2;};'use strict';var multer=require(_0x4be5('0x0'));var util=require('util');var path=require(_0x4be5('0x1'));var timeout=require(_0x4be5('0x2'));var express=require('express');var router=express[_0x4be5('0x3')]();var fs_extra=require(_0x4be5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4be5('0x5'));var config=require(_0x4be5('0x6'));var controller=require(_0x4be5('0x7'));router[_0x4be5('0x8')](_0x4be5('0x9'),auth[_0x4be5('0xa')](),controller['update']);router[_0x4be5('0xb')](_0x4be5('0x9'),auth[_0x4be5('0xa')](),controller[_0x4be5('0xc')]);module[_0x4be5('0xd')]=router; \ No newline at end of file +var _0xd1a6=['/:id','isAuthenticated','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x50274a,_0x4470fe){var _0x4dbd0f=function(_0x5833a3){while(--_0x5833a3){_0x50274a['push'](_0x50274a['shift']());}};_0x4dbd0f(++_0x4470fe);}(_0xd1a6,0x11d));var _0x6d1a=function(_0x3c4e48,_0x43a5eb){_0x3c4e48=_0x3c4e48-0x0;var _0x37fd7e=_0xd1a6[_0x3c4e48];return _0x37fd7e;};'use strict';var multer=require('multer');var util=require(_0x6d1a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6d1a('0x1'));var router=express[_0x6d1a('0x2')]();var fs_extra=require(_0x6d1a('0x3'));var auth=require(_0x6d1a('0x4'));var interaction=require(_0x6d1a('0x5'));var config=require(_0x6d1a('0x6'));var controller=require(_0x6d1a('0x7'));router[_0x6d1a('0x8')](_0x6d1a('0x9'),auth[_0x6d1a('0xa')](),controller['update']);router[_0x6d1a('0xb')](_0x6d1a('0x9'),auth[_0x6d1a('0xa')](),controller[_0x6d1a('0xc')]);module[_0x6d1a('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index a741d09..54b3ce9 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 _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x2882da,_0x467427){var _0x351813=function(_0x195616){while(--_0x195616){_0x2882da['push'](_0x2882da['shift']());}};_0x351813(++_0x467427);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0xf2ca[_0x31172e];return _0x414ada;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','TEXT'];(function(_0x337fa5,_0x12a30a){var _0x1cef95=function(_0x5c73fe){while(--_0x5c73fe){_0x337fa5['push'](_0x337fa5['shift']());}};_0x1cef95(++_0x12a30a);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'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 e2640fd..813bd66 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 _0x664b=['randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','left_join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','end','undefined','limit','offset','count','status','set','Content-Range','json','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','AnalyticCustomReport','includeAll','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','update','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','merge','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','format','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','HOUR(%s)','IS\x20NULL','value','metric','%s.%s\x20=\x20%s.%s','web','fullPath','%s-%s.%s'];(function(_0x331b85,_0x5f3e6e){var _0x1b97b2=function(_0x44d7c9){while(--_0x44d7c9){_0x331b85['push'](_0x331b85['shift']());}};_0x1b97b2(++_0x5f3e6e);}(_0x664b,0xc0));var _0xb664=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x664b[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xb664('0x0'));var rimraf=require(_0xb664('0x1'));var zipdir=require(_0xb664('0x2'));var jsonpatch=require(_0xb664('0x3'));var rp=require(_0xb664('0x4'));var moment=require(_0xb664('0x5'));var BPromise=require(_0xb664('0x6'));var Mustache=require('mustache');var util=require(_0xb664('0x7'));var path=require('path');var sox=require(_0xb664('0x8'));var csv=require(_0xb664('0x9'));var ejs=require(_0xb664('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb664('0xb'));var squel=require(_0xb664('0xc'));var crypto=require(_0xb664('0xd'));var jsforce=require(_0xb664('0xe'));var deskjs=require(_0xb664('0xf'));var toCsv=require(_0xb664('0x9'));var querystring=require(_0xb664('0x10'));var Papa=require(_0xb664('0x11'));var Redis=require(_0xb664('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb664('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb664('0x14'));var logger=require(_0xb664('0x15'))(_0xb664('0x16'));var utils=require(_0xb664('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb664('0x18'))['db'];var dbH=require(_0xb664('0x18'))[_0xb664('0x19')];function respondWithStatusCode(_0x270742,_0xf44b69){_0xf44b69=_0xf44b69||0xcc;return function(_0x18ab4e){if(_0x18ab4e){return _0x270742['sendStatus'](_0xf44b69);}return _0x270742['status'](_0xf44b69)[_0xb664('0x1a')]();};}function respondWithResult(_0x110a85,_0x2ac208){_0x2ac208=_0x2ac208||0xc8;return function(_0x6a25f2){if(_0x6a25f2){return _0x110a85['status'](_0x2ac208)['json'](_0x6a25f2);}};}function respondWithFilteredResult(_0x5f08c5,_0x1e5c6a){return function(_0x19fd43){if(_0x19fd43){var _0x182f84=typeof _0x1e5c6a['offset']===_0xb664('0x1b')&&typeof _0x1e5c6a[_0xb664('0x1c')]===_0xb664('0x1b');var _0x21c5ac=_0x19fd43['count'];var _0x159d4d=_0x182f84?0x0:_0x1e5c6a[_0xb664('0x1d')];var _0xd0d9a4=_0x182f84?_0x19fd43[_0xb664('0x1e')]:_0x1e5c6a['offset']+_0x1e5c6a['limit'];var _0x7cd4c0;if(_0xd0d9a4>=_0x21c5ac){_0xd0d9a4=_0x21c5ac;_0x7cd4c0=0xc8;}else{_0x7cd4c0=0xce;}_0x5f08c5[_0xb664('0x1f')](_0x7cd4c0);return _0x5f08c5[_0xb664('0x20')](_0xb664('0x21'),_0x159d4d+'-'+_0xd0d9a4+'/'+_0x21c5ac)[_0xb664('0x22')](_0x19fd43);}return null;};}function patchUpdates(_0x31741b){return function(_0x36d1db){try{jsonpatch[_0xb664('0x23')](_0x36d1db,_0x31741b,!![]);}catch(_0x3cde36){return BPromise[_0xb664('0x24')](_0x3cde36);}return _0x36d1db[_0xb664('0x25')]();};}function saveUpdates(_0x4c4c93,_0x93347c){return function(_0x268ed3){if(_0x268ed3){return _0x268ed3['update'](_0x4c4c93)[_0xb664('0x26')](function(_0x13403d){return _0x13403d;});}return null;};}function removeEntity(_0x3b7f91,_0x45fc05){return function(_0x434780){if(_0x434780){return _0x434780[_0xb664('0x27')]()[_0xb664('0x26')](function(){var _0x52b2d2=_0x434780[_0xb664('0x28')]({'plain':!![]});var _0x166adf=_0xb664('0x29');return db[_0xb664('0x2a')][_0xb664('0x27')]({'where':{'type':_0x166adf,'resourceId':_0x52b2d2['id']}})[_0xb664('0x26')](function(){return _0x434780;});})[_0xb664('0x26')](function(){_0x3b7f91[_0xb664('0x1f')](0xcc)[_0xb664('0x1a')]();});}};}function handleEntityNotFound(_0x48e4a3,_0x55189c){return function(_0x31f494){if(!_0x31f494){_0x48e4a3['sendStatus'](0x194);}return _0x31f494;};}function handleError(_0x31e068,_0xa14df1){_0xa14df1=_0xa14df1||0x1f4;return function(_0x3a6769){logger[_0xb664('0x2b')](_0x3a6769[_0xb664('0x2c')]);if(_0x3a6769[_0xb664('0x2d')]){delete _0x3a6769['name'];}_0x31e068[_0xb664('0x1f')](_0xa14df1)[_0xb664('0x2e')](_0x3a6769);};}exports[_0xb664('0x2f')]=function(_0x307511,_0x2b00ba){var _0x327144={},_0x21a71f={},_0x516ebb={'count':0x0,'rows':[]};var _0x19ae5f=_[_0xb664('0x30')](db['AnalyticCustomReport'][_0xb664('0x31')],function(_0x2c4086){return{'name':_0x2c4086[_0xb664('0x32')],'type':_0x2c4086[_0xb664('0x33')][_0xb664('0x34')]};});_0x21a71f[_0xb664('0x35')]=_[_0xb664('0x30')](_0x19ae5f,_0xb664('0x2d'));_0x21a71f[_0xb664('0x36')]=_[_0xb664('0x37')](_0x307511['query']);_0x21a71f[_0xb664('0x38')]=_[_0xb664('0x39')](_0x21a71f['model'],_0x21a71f[_0xb664('0x36')]);_0x327144[_0xb664('0x3a')]=_['intersection'](_0x21a71f[_0xb664('0x35')],qs[_0xb664('0x3b')](_0x307511[_0xb664('0x36')][_0xb664('0x3b')]));_0x327144['attributes']=_0x327144[_0xb664('0x3a')][_0xb664('0x3c')]?_0x327144['attributes']:_0x21a71f[_0xb664('0x35')];if(!_0x307511[_0xb664('0x36')][_0xb664('0x3d')](_0xb664('0x3e'))){_0x327144[_0xb664('0x1c')]=qs[_0xb664('0x1c')](_0x307511[_0xb664('0x36')]['limit']);_0x327144[_0xb664('0x1d')]=qs[_0xb664('0x1d')](_0x307511[_0xb664('0x36')][_0xb664('0x1d')]);}_0x327144['order']=qs[_0xb664('0x3f')](_0x307511[_0xb664('0x36')][_0xb664('0x3f')]);_0x327144[_0xb664('0x40')]=qs[_0xb664('0x38')](_[_0xb664('0x41')](_0x307511['query'],_0x21a71f['filters']),_0x19ae5f);if(_0x307511[_0xb664('0x36')][_0xb664('0x42')]){_0x327144[_0xb664('0x40')]=_['merge'](_0x327144[_0xb664('0x40')],{'$or':_[_0xb664('0x30')](_0x19ae5f,function(_0x19d5f6){if(_0x19d5f6[_0xb664('0x33')]!=='VIRTUAL'){var _0x3468f7={};_0x3468f7[_0x19d5f6['name']]={'$like':'%'+_0x307511[_0xb664('0x36')][_0xb664('0x42')]+'%'};return _0x3468f7;}})});}_0x327144=_['merge']({},_0x327144,_0x307511[_0xb664('0x43')]);var _0x39483d={'where':_0x327144[_0xb664('0x40')]};return db[_0xb664('0x44')][_0xb664('0x1e')](_0x39483d)[_0xb664('0x26')](function(_0x2fc441){_0x516ebb[_0xb664('0x1e')]=_0x2fc441;if(_0x307511['query'][_0xb664('0x45')]){_0x327144['include']=[{'all':!![]}];}return db[_0xb664('0x44')][_0xb664('0x46')](_0x327144);})[_0xb664('0x26')](function(_0x1c766c){_0x516ebb[_0xb664('0x47')]=_0x1c766c;return _0x516ebb;})[_0xb664('0x26')](respondWithFilteredResult(_0x2b00ba,_0x327144))[_0xb664('0x48')](handleError(_0x2b00ba,null));};exports['show']=function(_0x27a09e,_0x519680){var _0x246c1c={'raw':![],'where':{'id':_0x27a09e[_0xb664('0x49')]['id']}},_0x39ebc8={};_0x39ebc8['model']=_[_0xb664('0x37')](db[_0xb664('0x44')][_0xb664('0x31')]);_0x39ebc8[_0xb664('0x36')]=_[_0xb664('0x37')](_0x27a09e[_0xb664('0x36')]);_0x39ebc8['filters']=_['intersection'](_0x39ebc8['model'],_0x39ebc8[_0xb664('0x36')]);_0x246c1c[_0xb664('0x3a')]=_['intersection'](_0x39ebc8[_0xb664('0x35')],qs[_0xb664('0x3b')](_0x27a09e['query']['fields']));_0x246c1c['attributes']=_0x246c1c[_0xb664('0x3a')]['length']?_0x246c1c[_0xb664('0x3a')]:_0x39ebc8[_0xb664('0x35')];if(_0x27a09e[_0xb664('0x36')]['includeAll']){_0x246c1c['include']=[{'all':!![]}];}_0x246c1c=_['merge']({},_0x246c1c,_0x27a09e[_0xb664('0x43')]);return db[_0xb664('0x44')][_0xb664('0x4a')](_0x246c1c)['then'](handleEntityNotFound(_0x519680,null))[_0xb664('0x26')](respondWithResult(_0x519680,null))[_0xb664('0x48')](handleError(_0x519680,null));};exports[_0xb664('0x4b')]=function(_0x33455b,_0x55eca4){return db[_0xb664('0x44')]['create'](_0x33455b['body'],{})[_0xb664('0x26')](function(_0x4d45f9){var _0x1fd723=_0x33455b['user'][_0xb664('0x28')]({'plain':!![]});if(!_0x1fd723)throw new Error(_0xb664('0x4c'));if(_0x1fd723[_0xb664('0x4d')]===_0xb664('0x4e')){var _0x53a261=_0x4d45f9['get']({'plain':!![]});var _0x434182=_0xb664('0x4f');return db[_0xb664('0x50')][_0xb664('0x4a')]({'where':{'name':_0x434182,'userProfileId':_0x1fd723[_0xb664('0x51')]},'raw':!![]})[_0xb664('0x26')](function(_0x4e1391){if(_0x4e1391&&_0x4e1391[_0xb664('0x52')]===0x0){return db[_0xb664('0x2a')][_0xb664('0x4b')]({'name':_0x53a261[_0xb664('0x2d')],'resourceId':_0x53a261['id'],'type':_0xb664('0x29'),'sectionId':_0x4e1391['id']},{})[_0xb664('0x26')](function(){return _0x4d45f9;});}else{return _0x4d45f9;}})['catch'](function(_0x64504){logger[_0xb664('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x64504);throw _0x64504;});}return _0x4d45f9;})[_0xb664('0x26')](respondWithResult(_0x55eca4,0xc9))['catch'](handleError(_0x55eca4,null));};exports[_0xb664('0x53')]=function(_0x2b0dec,_0x23df3e){if(_0x2b0dec[_0xb664('0x54')]['id']){delete _0x2b0dec['body']['id'];}return db[_0xb664('0x44')][_0xb664('0x4a')]({'where':{'id':_0x2b0dec[_0xb664('0x49')]['id']}})[_0xb664('0x26')](handleEntityNotFound(_0x23df3e,null))[_0xb664('0x26')](saveUpdates(_0x2b0dec[_0xb664('0x54')],null))['then'](respondWithResult(_0x23df3e,null))[_0xb664('0x48')](handleError(_0x23df3e,null));};exports[_0xb664('0x27')]=function(_0x5bf433,_0x4b42b1){return db['AnalyticCustomReport'][_0xb664('0x4a')]({'where':{'id':_0x5bf433['params']['id']}})[_0xb664('0x26')](handleEntityNotFound(_0x4b42b1,null))[_0xb664('0x26')](removeEntity(_0x4b42b1,null))[_0xb664('0x48')](handleError(_0x4b42b1,null));};exports[_0xb664('0x55')]=function(_0x3bf26b,_0x1f5db5){var _0x26bab4=0xa;var _0x2720eb=[_0xb664('0x56'),'left_join',_0xb664('0x57'),_0xb664('0x58')];var _0x2cb2cd={'SUM':_0xb664('0x59'),'COUNT':_0xb664('0x5a'),'COUNT DISTINCT':_0xb664('0x5b'),'MAX':_0xb664('0x5c'),'MIN':_0xb664('0x5d'),'AVG':_0xb664('0x5e'),'GROUP_CONCAT':_0xb664('0x5f'),'GROUP_CONCAT ASC':_0xb664('0x60'),'GROUP_CONCAT DESC':_0xb664('0x61')};var _0x5e4a96={'SEC_TO_TIME':_0xb664('0x62'),'DATE':_0xb664('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xb664('0x64'),'UNIX_TIMESTAMP':_0xb664('0x65')};var _0x4acbcc=function(_0x1a4654){return!_[_0xb664('0x66')](['IS\x20NULL',_0xb664('0x67'),_0xb664('0x68'),_0xb664('0x69')],_0x1a4654);};var _0x58171d=function(_0x30b03e){if(!_0x30b03e||!_0x30b03e[_0xb664('0x6a')][_0xb664('0x3c')]){return'';}for(var _0x399006='(',_0x2137d8=0x0;_0x2137d8<_0x30b03e['rules'][_0xb664('0x3c')];_0x2137d8+=0x1){_0x2137d8>0x0&&(_0x399006+='\x20'+_0x30b03e[_0xb664('0x6b')]+'\x20');_0x399006+=_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6c')]?_0x58171d(_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6c')]):_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6d')]+'\x20'+_0x30b03e[_0xb664('0x6a')][_0x2137d8][_0xb664('0x6e')]+(_0x4acbcc(_0x30b03e[_0xb664('0x6a')][_0x2137d8]['condition'])?'\x20'+_0x30b03e[_0xb664('0x6a')][_0x2137d8]['value']:'');}return _0x399006+')';};var _0x577c70={'where':{'id':_0x3bf26b['params']['id']}},_0x13af63,_0x72d0c0,_0x5e8f10,_0x3d0068,_0x10e58e;_0x577c70=_[_0xb664('0x6f')]({},_0x577c70,_0x3bf26b[_0xb664('0x43')]);return db[_0xb664('0x44')]['find'](_0x577c70)[_0xb664('0x26')](function(_0x575528){if(_0x575528){_0x13af63=_0x575528;return _0x575528[_0xb664('0x70')]();}return null;})[_0xb664('0x26')](function(_0x1939df){if(_0x1939df){if(!_0x1939df[_0xb664('0x3c')]){throw new db[(_0xb664('0x71'))][(_0xb664('0x72'))](_0xb664('0x73'),0x193);}_0x72d0c0=_0x1939df;return db[_0xb664('0x74')][_0xb664('0x46')]({'raw':!![]});}return null;})['then'](function(_0x2e3b7b){if(_0x2e3b7b){_0x5e8f10=_[_0xb664('0x75')](_0x2e3b7b,'id');var _0x59dd34;var _0x19f7b0=squel[_0xb664('0x76')]();_0x19f7b0[_0xb664('0x77')](_0x13af63[_0xb664('0x78')]);for(var _0x8083ec=0x0;_0x8083ec<_0x72d0c0['length'];_0x8083ec+=0x1){_0x59dd34=_0x72d0c0[_0x8083ec][_0xb664('0x79')]?_0x5e8f10[_0x72d0c0[_0x8083ec]['MetricId']]['metric']:_0x72d0c0[_0x8083ec][_0xb664('0x6d')];_0x59dd34=_0x72d0c0[_0x8083ec][_0xb664('0x7a')]?_['replace'](_0x2cb2cd[_0x72d0c0[_0x8083ec][_0xb664('0x7a')]],'%s',_0x59dd34):_0x59dd34;_0x59dd34=_0x72d0c0[_0x8083ec][_0xb664('0x7b')]?_[_0xb664('0x7c')](_0x5e4a96[_0x72d0c0[_0x8083ec]['format']],'%s',_0x59dd34):_0x59dd34;if(_0x72d0c0[_0x8083ec][_0xb664('0x7d')]){_0x19f7b0['group'](_0x59dd34);}_0x72d0c0[_0x8083ec][_0xb664('0x7e')]&&_0x19f7b0[_0xb664('0x7f')](_0x59dd34,_0x72d0c0[_0x8083ec]['orderBy']===_0xb664('0x80')?![]:!![]);_0x19f7b0[_0xb664('0x6d')](_0x59dd34,_0x72d0c0[_0x8083ec][_0xb664('0x81')]||_0x59dd34);}if(_0x13af63['joins']){_0x13af63[_0xb664('0x82')]=JSON[_0xb664('0x83')](_0x13af63[_0xb664('0x82')]);for(var _0x56b107=0x0;_0x56b107<_0x13af63['joins'][_0xb664('0x3c')];_0x56b107+=0x1){if(_0x13af63['joins'][_0x56b107][_0xb664('0x33')]&&_[_0xb664('0x66')](_0x2720eb,_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x33')])&&_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x84')]&&_0x13af63['joins'][_0x56b107][_0xb664('0x85')]&&_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x86')]){_0x19f7b0[_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x33')]](_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x85')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x13af63[_0xb664('0x78')],_0x13af63[_0xb664('0x82')][_0x56b107][_0xb664('0x84')],_0x13af63[_0xb664('0x82')][_0x56b107]['foreignTable'],_0x13af63['joins'][_0x56b107][_0xb664('0x86')]));}}}if(_0x13af63[_0xb664('0x87')]){_0x13af63[_0xb664('0x87')]=JSON[_0xb664('0x83')](_0x13af63[_0xb664('0x87')]);_0x19f7b0[_0xb664('0x40')](_0x58171d(_0x13af63[_0xb664('0x87')][_0xb664('0x6c')]));}_0x10e58e=_0x19f7b0[_0xb664('0x88')]();_0x19f7b0[_0xb664('0x1c')](_0x26bab4);_0x19f7b0[_0xb664('0x1d')](0x0);logger[_0xb664('0x89')](_0xb664('0x8a'),_0x19f7b0[_0xb664('0x8b')]());return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x19f7b0[_0xb664('0x8b')](),{'type':dbH[_0xb664('0x8c')]['QueryTypes'][_0xb664('0x8d')]});}})[_0xb664('0x26')](respondWithResult(_0x1f5db5,null))['catch'](handleError(_0x1f5db5,null));};function runReport(_0x10c602,_0x14333b,_0x3108fb){var _0x2474f8=_0x14333b['name'];var _0x52c6fd=0xa;var _0x302234=[_0xb664('0x56'),'left_join',_0xb664('0x57'),_0xb664('0x58')];var _0x24668d={'SUM':_0xb664('0x59'),'COUNT':_0xb664('0x5a'),'COUNT DISTINCT':_0xb664('0x5b'),'MAX':'MAX(%s)','MIN':_0xb664('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb664('0x5f'),'GROUP_CONCAT ASC':_0xb664('0x60'),'GROUP_CONCAT DESC':_0xb664('0x61')};var _0x1d783f={'SEC_TO_TIME':_0xb664('0x62'),'DATE':_0xb664('0x63'),'HOUR':_0xb664('0x8e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb664('0x65')};var _0x331a50=function(_0x3efc87){return!_[_0xb664('0x66')]([_0xb664('0x8f'),_0xb664('0x67'),_0xb664('0x68'),'IS\x20NOT\x20EMPTY'],_0x3efc87);};var _0x3cf7f7=function(_0x3f7ecd){if(!_0x3f7ecd||!_0x3f7ecd[_0xb664('0x6a')][_0xb664('0x3c')]){return'';}for(var _0x5968dd='(',_0x4de53d=0x0;_0x4de53d<_0x3f7ecd[_0xb664('0x6a')][_0xb664('0x3c')];_0x4de53d+=0x1){_0x4de53d>0x0&&(_0x5968dd+='\x20'+_0x3f7ecd[_0xb664('0x6b')]+'\x20');_0x5968dd+=_0x3f7ecd[_0xb664('0x6a')][_0x4de53d]['group']?_0x3cf7f7(_0x3f7ecd['rules'][_0x4de53d][_0xb664('0x6c')]):_0x3f7ecd[_0xb664('0x6a')][_0x4de53d][_0xb664('0x6d')]+'\x20'+_0x3f7ecd[_0xb664('0x6a')][_0x4de53d]['condition']+(_0x331a50(_0x3f7ecd[_0xb664('0x6a')][_0x4de53d][_0xb664('0x6e')])?'\x20'+_0x3f7ecd['rules'][_0x4de53d][_0xb664('0x90')]:'');}return _0x5968dd+')';};var _0xbe0eeb={'where':{'id':_0x10c602['id']}},_0x4d198a,_0x5d4aa2,_0x36a606,_0x249bc5,_0x551c1d;_0xbe0eeb=_['merge']({},_0xbe0eeb,_0x3108fb);return db[_0xb664('0x44')][_0xb664('0x4a')](_0xbe0eeb)[_0xb664('0x26')](function(_0x35f944){if(_0x35f944){_0x4d198a=_0x35f944;return _0x35f944[_0xb664('0x70')]();}return null;})['then'](function(_0x50d0c7){if(_0x50d0c7){if(!_0x50d0c7[_0xb664('0x3c')]){throw new db['Sequelize'][(_0xb664('0x72'))](_0xb664('0x73'),0x193);}_0x5d4aa2=_0x50d0c7;return db[_0xb664('0x74')]['findAll']({'raw':!![]});}return null;})[_0xb664('0x26')](function(_0x4318a8){if(_0x4318a8){_0x36a606=_[_0xb664('0x75')](_0x4318a8,'id');var _0x3ba0f3;var _0x15835b=squel[_0xb664('0x76')]();_0x15835b[_0xb664('0x77')](_0x4d198a[_0xb664('0x78')]);for(var _0x58adc1=0x0;_0x58adc1<_0x5d4aa2[_0xb664('0x3c')];_0x58adc1+=0x1){_0x3ba0f3=_0x5d4aa2[_0x58adc1][_0xb664('0x79')]?_0x36a606[_0x5d4aa2[_0x58adc1][_0xb664('0x79')]][_0xb664('0x91')]:_0x5d4aa2[_0x58adc1][_0xb664('0x6d')];_0x3ba0f3=_0x5d4aa2[_0x58adc1][_0xb664('0x7a')]?_[_0xb664('0x7c')](_0x24668d[_0x5d4aa2[_0x58adc1]['function']],'%s',_0x3ba0f3):_0x3ba0f3;_0x3ba0f3=_0x5d4aa2[_0x58adc1][_0xb664('0x7b')]?_[_0xb664('0x7c')](_0x1d783f[_0x5d4aa2[_0x58adc1][_0xb664('0x7b')]],'%s',_0x3ba0f3):_0x3ba0f3;if(_0x5d4aa2[_0x58adc1]['groupBy']){_0x15835b['group'](_0x3ba0f3);}_0x5d4aa2[_0x58adc1][_0xb664('0x7e')]&&_0x15835b[_0xb664('0x7f')](_0x3ba0f3,_0x5d4aa2[_0x58adc1][_0xb664('0x7e')]===_0xb664('0x80')?![]:!![]);_0x15835b['field'](_0x3ba0f3,_0x5d4aa2[_0x58adc1]['alias']||_0x3ba0f3);}if(_0x4d198a[_0xb664('0x82')]){_0x4d198a[_0xb664('0x82')]=JSON[_0xb664('0x83')](_0x4d198a[_0xb664('0x82')]);for(var _0x4505a5=0x0;_0x4505a5<_0x4d198a[_0xb664('0x82')][_0xb664('0x3c')];_0x4505a5+=0x1){if(_0x4d198a['joins'][_0x4505a5][_0xb664('0x33')]&&_[_0xb664('0x66')](_0x302234,_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x33')])&&_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x84')]&&_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x85')]&&_0x4d198a['joins'][_0x4505a5][_0xb664('0x86')]){_0x15835b[_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x33')]](_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x85')],null,util[_0xb664('0x7b')](_0xb664('0x92'),_0x4d198a[_0xb664('0x78')],_0x4d198a[_0xb664('0x82')][_0x4505a5]['parentKey'],_0x4d198a[_0xb664('0x82')][_0x4505a5][_0xb664('0x85')],_0x4d198a['joins'][_0x4505a5][_0xb664('0x86')]));}}}if(_0x4d198a[_0xb664('0x87')]){_0x4d198a[_0xb664('0x87')]=JSON[_0xb664('0x83')](_0x4d198a[_0xb664('0x87')]);_0x15835b['where'](_0x3cf7f7(_0x4d198a[_0xb664('0x87')]['group']));}_0x551c1d=_0x15835b['clone']();_0x15835b[_0xb664('0x1c')](_0x52c6fd);_0x15835b[_0xb664('0x1d')](0x0);return;}})['then'](function(){if(_0x14333b['output']===_0xb664('0x93')){return null;}var _0x113a8e=_['merge'](_0x14333b,{'name':_0x14333b[_0xb664('0x94')]||_0x14333b[_0xb664('0x2d')]||_0x4d198a['name'],'basename':_0x2474f8,'savename':util['format'](_0xb664('0x95'),_0x14333b[_0xb664('0x2d')]||_0x4d198a[_0xb664('0x2d')],require(_0xb664('0x96'))[_0xb664('0x97')](0x4),_0x14333b['output']||_0xb664('0x98')),'reportId':_0x4d198a['id'],'reportType':_0xb664('0x99')});return db[_0xb664('0x9a')][_0xb664('0x4b')](_0x113a8e,{'raw':!![]});})[_0xb664('0x26')](function(_0x53c578){if(_0x4d198a[_0xb664('0x78')]==='cdr'){_0x551c1d[_0xb664('0x40')](_0x4d198a[_0xb664('0x78')]+_0xb664('0x9b'),_0x14333b['startDate'],_0x14333b[_0xb664('0x9c')]);}else{_0x551c1d[_0xb664('0x40')](_0x4d198a[_0xb664('0x78')]+_0xb664('0x9d'),_0x14333b[_0xb664('0x9e')],_0x14333b[_0xb664('0x9c')]);}if(_0x53c578){logger[_0xb664('0x9f')](_0xb664('0xa0'),_0x551c1d[_0xb664('0x8b')]());require('child_process')[_0xb664('0xa1')](path['join'](__dirname,_0xb664('0xa2'),_0x53c578['output']),[_0x53c578['id'],_0x551c1d['toString'](),path[_0xb664('0x56')](__dirname,_0xb664('0xa3'),_0x53c578[_0xb664('0xa4')]),_0x2474f8]);return _0x53c578;}else{var _0x39b85d=squel[_0xb664('0x76')]();_0x39b85d[_0xb664('0x77')]('('+_0x551c1d[_0xb664('0x8b')]()+')',_0xb664('0xa5'));_0x39b85d[_0xb664('0x6d')](_0xb664('0xa6'),_0xb664('0x1e'));_0x551c1d['limit'](_0x14333b[_0xb664('0x1c')]||_0x52c6fd);_0x551c1d[_0xb664('0x1d')](_0x14333b[_0xb664('0x1d')]||0x0);return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x39b85d['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xb664('0x8d')]})[_0xb664('0x26')](function(_0x2fd5c1){if(!_0x2fd5c1[_0xb664('0x3c')]){_0x249bc5=0x0;}else{_0x249bc5=_0x2fd5c1[0x0][_0xb664('0x1e')]||0x0;}return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x551c1d[_0xb664('0x8b')](),{'type':dbH['sequelize'][_0xb664('0xa7')][_0xb664('0x8d')]});})[_0xb664('0x26')](function(_0x2bbb17){return{'rows':_0x2bbb17||[],'count':_0x249bc5};});}});}exports[_0xb664('0xa8')]=function(_0xc33ab0,_0x227ae8){return runReport(_0xc33ab0['params'],_0xc33ab0['query'],_0xc33ab0[_0xb664('0x43')])['then'](respondWithResult(_0x227ae8,null))[_0xb664('0x48')](handleError(_0x227ae8,null));};exports[_0xb664('0xa9')]=runReport;exports[_0xb664('0x36')]=function(_0x1c1a12,_0x467713){var _0xb70bf3=0xa;var _0x464e49=['join',_0xb664('0xaa'),_0xb664('0x57'),'cross_join'];var _0x51421c={'SUM':_0xb664('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb664('0x5b'),'MAX':'MAX(%s)','MIN':_0xb664('0x5d'),'AVG':_0xb664('0x5e'),'GROUP_CONCAT':_0xb664('0x5f'),'GROUP_CONCAT ASC':_0xb664('0x60'),'GROUP_CONCAT DESC':_0xb664('0x61')};var _0x44c536={'SEC_TO_TIME':_0xb664('0x62'),'DATE':_0xb664('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xb664('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x35a9c2=function(_0x266cbc){return!_[_0xb664('0x66')](['IS\x20NULL',_0xb664('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x266cbc);};var _0xa71ddb=function(_0x553a7f){if(!_0x553a7f||!_0x553a7f[_0xb664('0x6a')][_0xb664('0x3c')]){return'';}for(var _0x38a269='(',_0x213d0b=0x0;_0x213d0b<_0x553a7f[_0xb664('0x6a')]['length'];_0x213d0b+=0x1){_0x213d0b>0x0&&(_0x38a269+='\x20'+_0x553a7f[_0xb664('0x6b')]+'\x20');_0x38a269+=_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x6c')]?_0xa71ddb(_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x6c')]):_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x6d')]+'\x20'+_0x553a7f['rules'][_0x213d0b][_0xb664('0x6e')]+(_0x35a9c2(_0x553a7f['rules'][_0x213d0b][_0xb664('0x6e')])?'\x20'+_0x553a7f[_0xb664('0x6a')][_0x213d0b][_0xb664('0x90')]:'');}return _0x38a269+')';};var _0x8447da={'where':{'id':_0x1c1a12['params']['id']}},_0x586956,_0x447112,_0x50bd74,_0x6190ec,_0x3fa873;_0x8447da=_['merge']({},_0x8447da,_0x1c1a12[_0xb664('0x43')]);return db['AnalyticCustomReport'][_0xb664('0x4a')](_0x8447da)[_0xb664('0x26')](function(_0x434c7e){if(_0x434c7e){_0x586956=_0x434c7e;return _0x434c7e[_0xb664('0x70')]();}return null;})['then'](function(_0x24448f){if(_0x24448f){if(!_0x24448f[_0xb664('0x3c')]){throw new db[(_0xb664('0x71'))][(_0xb664('0x72'))](_0xb664('0x73'),0x193);}_0x447112=_0x24448f;return db[_0xb664('0x74')][_0xb664('0x46')]({'raw':!![]});}return null;})[_0xb664('0x26')](function(_0x5c9547){if(_0x5c9547){_0x50bd74=_[_0xb664('0x75')](_0x5c9547,'id');var _0xc5a8a2;var _0x3b8b06=squel[_0xb664('0x76')]();_0x3b8b06[_0xb664('0x77')](_0x586956[_0xb664('0x78')]);for(var _0x3f6244=0x0;_0x3f6244<_0x447112[_0xb664('0x3c')];_0x3f6244+=0x1){_0xc5a8a2=_0x447112[_0x3f6244][_0xb664('0x79')]?_0x50bd74[_0x447112[_0x3f6244][_0xb664('0x79')]][_0xb664('0x91')]:_0x447112[_0x3f6244]['field'];_0xc5a8a2=_0x447112[_0x3f6244][_0xb664('0x7a')]?_['replace'](_0x51421c[_0x447112[_0x3f6244][_0xb664('0x7a')]],'%s',_0xc5a8a2):_0xc5a8a2;_0xc5a8a2=_0x447112[_0x3f6244]['format']?_[_0xb664('0x7c')](_0x44c536[_0x447112[_0x3f6244][_0xb664('0x7b')]],'%s',_0xc5a8a2):_0xc5a8a2;if(_0x447112[_0x3f6244]['groupBy']){_0x3b8b06['group'](_0xc5a8a2);}_0x447112[_0x3f6244][_0xb664('0x7e')]&&_0x3b8b06[_0xb664('0x7f')](_0xc5a8a2,_0x447112[_0x3f6244][_0xb664('0x7e')]===_0xb664('0x80')?![]:!![]);_0x3b8b06[_0xb664('0x6d')](_0xc5a8a2,_0x447112[_0x3f6244]['alias']||_0xc5a8a2);}if(_0x586956['joins']){_0x586956[_0xb664('0x82')]=JSON[_0xb664('0x83')](_0x586956[_0xb664('0x82')]);for(var _0x3f9ee5=0x0;_0x3f9ee5<_0x586956['joins']['length'];_0x3f9ee5+=0x1){if(_0x586956[_0xb664('0x82')][_0x3f9ee5]['type']&&_['includes'](_0x464e49,_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x33')])&&_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x84')]&&_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x85')]&&_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x86')]){_0x3b8b06[_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x33')]](_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x85')],null,util['format'](_0xb664('0x92'),_0x586956[_0xb664('0x78')],_0x586956[_0xb664('0x82')][_0x3f9ee5][_0xb664('0x84')],_0x586956['joins'][_0x3f9ee5][_0xb664('0x85')],_0x586956['joins'][_0x3f9ee5][_0xb664('0x86')]));}}}if(_0x586956[_0xb664('0x87')]){_0x586956[_0xb664('0x87')]=JSON['parse'](_0x586956['conditions']);_0x3b8b06[_0xb664('0x40')](_0xa71ddb(_0x586956[_0xb664('0x87')][_0xb664('0x6c')]));}_0x3fa873=_0x3b8b06['clone']();_0x3b8b06['limit'](_0xb70bf3);_0x3b8b06['offset'](0x0);logger['debug']('Limited\x20Query:',_0x3b8b06[_0xb664('0x8b')]());return dbH[_0xb664('0x8c')][_0xb664('0x36')](_0x3b8b06['toString'](),{'type':dbH['sequelize'][_0xb664('0xa7')][_0xb664('0x8d')]});}})[_0xb664('0x26')](function(){return{'sql':_0x3fa873[_0xb664('0x8b')]()};})['then'](respondWithResult(_0x467713,null))['catch'](handleError(_0x467713,null));}; \ No newline at end of file +var _0x1cca=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','error','stack','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','AnalyticCustomReport','includeAll','include','findAll','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','Sequelize','AnalyticMetric','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','order','clone','Limited\x20Query:','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined'];(function(_0x4497f9,_0x4304f4){var _0x2071e1=function(_0x292b2e){while(--_0x292b2e){_0x4497f9['push'](_0x4497f9['shift']());}};_0x2071e1(++_0x4304f4);}(_0x1cca,0x12d));var _0xa1cc=function(_0x1c3993,_0x472394){_0x1c3993=_0x1c3993-0x0;var _0x1f6407=_0x1cca[_0x1c3993];return _0x1f6407;};'use strict';var emlformat=require(_0xa1cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1cc('0x1'));var rp=require(_0xa1cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1cc('0x3'));var util=require(_0xa1cc('0x4'));var path=require(_0xa1cc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1cc('0x6'));var fs=require('fs');var fs_extra=require(_0xa1cc('0x7'));var _=require(_0xa1cc('0x8'));var squel=require(_0xa1cc('0x9'));var crypto=require(_0xa1cc('0xa'));var jsforce=require(_0xa1cc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa1cc('0xc'));var querystring=require(_0xa1cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xa1cc('0xe'));var authService=require(_0xa1cc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1cc('0x10'));var logger=require(_0xa1cc('0x11'))(_0xa1cc('0x12'));var utils=require(_0xa1cc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa1cc('0x14'));var db=require(_0xa1cc('0x15'))['db'];var dbH=require(_0xa1cc('0x15'))['dbH'];function respondWithStatusCode(_0x5863da,_0x1e01e6){_0x1e01e6=_0x1e01e6||0xcc;return function(_0x1bf356){if(_0x1bf356){return _0x5863da[_0xa1cc('0x16')](_0x1e01e6);}return _0x5863da['status'](_0x1e01e6)[_0xa1cc('0x17')]();};}function respondWithResult(_0x989c7e,_0x5f925c){_0x5f925c=_0x5f925c||0xc8;return function(_0x5558c3){if(_0x5558c3){return _0x989c7e[_0xa1cc('0x18')](_0x5f925c)[_0xa1cc('0x19')](_0x5558c3);}};}function respondWithFilteredResult(_0x1e8f73,_0x5e6764){return function(_0x46c553){if(_0x46c553){var _0x12dde8=typeof _0x5e6764[_0xa1cc('0x1a')]==='undefined'&&typeof _0x5e6764[_0xa1cc('0x1b')]===_0xa1cc('0x1c');var _0x992b0e=_0x46c553['count'];var _0x22a9ef=_0x12dde8?0x0:_0x5e6764[_0xa1cc('0x1a')];var _0x213d48=_0x12dde8?_0x46c553[_0xa1cc('0x1d')]:_0x5e6764['offset']+_0x5e6764[_0xa1cc('0x1b')];var _0x201183;if(_0x213d48>=_0x992b0e){_0x213d48=_0x992b0e;_0x201183=0xc8;}else{_0x201183=0xce;}_0x1e8f73['status'](_0x201183);return _0x1e8f73[_0xa1cc('0x1e')](_0xa1cc('0x1f'),_0x22a9ef+'-'+_0x213d48+'/'+_0x992b0e)['json'](_0x46c553);}return null;};}function patchUpdates(_0x13cdc2){return function(_0x44f054){try{jsonpatch[_0xa1cc('0x20')](_0x44f054,_0x13cdc2,!![]);}catch(_0x532c8d){return BPromise[_0xa1cc('0x21')](_0x532c8d);}return _0x44f054[_0xa1cc('0x22')]();};}function saveUpdates(_0xc7dd6c,_0x32fa32){return function(_0x318544){if(_0x318544){return _0x318544[_0xa1cc('0x23')](_0xc7dd6c)[_0xa1cc('0x24')](function(_0x56b0f5){return _0x56b0f5;});}return null;};}function removeEntity(_0x2d6997,_0x1b25bb){return function(_0x231116){if(_0x231116){return _0x231116[_0xa1cc('0x25')]()[_0xa1cc('0x24')](function(){var _0x1d716a=_0x231116[_0xa1cc('0x26')]({'plain':!![]});var _0x45c3a4=_0xa1cc('0x27');return db['UserProfileResource'][_0xa1cc('0x25')]({'where':{'type':_0x45c3a4,'resourceId':_0x1d716a['id']}})[_0xa1cc('0x24')](function(){return _0x231116;});})[_0xa1cc('0x24')](function(){_0x2d6997['status'](0xcc)[_0xa1cc('0x17')]();});}};}function handleEntityNotFound(_0x2641c6,_0x38e484){return function(_0x1be943){if(!_0x1be943){_0x2641c6[_0xa1cc('0x16')](0x194);}return _0x1be943;};}function handleError(_0x14826f,_0x938ca1){_0x938ca1=_0x938ca1||0x1f4;return function(_0x10f09c){logger[_0xa1cc('0x28')](_0x10f09c[_0xa1cc('0x29')]);if(_0x10f09c[_0xa1cc('0x2a')]){delete _0x10f09c['name'];}_0x14826f[_0xa1cc('0x18')](_0x938ca1)['send'](_0x10f09c);};}exports[_0xa1cc('0x2b')]=function(_0x13bd44,_0x2023f7){var _0x251bca={},_0x2b0da9={},_0x2d4b7e={'count':0x0,'rows':[]};var _0x5d3444=_[_0xa1cc('0x2c')](db['AnalyticCustomReport'][_0xa1cc('0x2d')],function(_0x5a464a){return{'name':_0x5a464a[_0xa1cc('0x2e')],'type':_0x5a464a['type'][_0xa1cc('0x2f')]};});_0x2b0da9['model']=_[_0xa1cc('0x2c')](_0x5d3444,_0xa1cc('0x2a'));_0x2b0da9[_0xa1cc('0x30')]=_[_0xa1cc('0x31')](_0x13bd44[_0xa1cc('0x30')]);_0x2b0da9[_0xa1cc('0x32')]=_[_0xa1cc('0x33')](_0x2b0da9[_0xa1cc('0x34')],_0x2b0da9[_0xa1cc('0x30')]);_0x251bca[_0xa1cc('0x35')]=_[_0xa1cc('0x33')](_0x2b0da9[_0xa1cc('0x34')],qs[_0xa1cc('0x36')](_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x36')]));_0x251bca[_0xa1cc('0x35')]=_0x251bca[_0xa1cc('0x35')][_0xa1cc('0x37')]?_0x251bca['attributes']:_0x2b0da9[_0xa1cc('0x34')];if(!_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x38')](_0xa1cc('0x39'))){_0x251bca[_0xa1cc('0x1b')]=qs['limit'](_0x13bd44['query']['limit']);_0x251bca[_0xa1cc('0x1a')]=qs[_0xa1cc('0x1a')](_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x1a')]);}_0x251bca['order']=qs[_0xa1cc('0x3a')](_0x13bd44['query'][_0xa1cc('0x3a')]);_0x251bca[_0xa1cc('0x3b')]=qs[_0xa1cc('0x32')](_['pick'](_0x13bd44[_0xa1cc('0x30')],_0x2b0da9[_0xa1cc('0x32')]),_0x5d3444);if(_0x13bd44[_0xa1cc('0x30')]['filter']){_0x251bca[_0xa1cc('0x3b')]=_[_0xa1cc('0x3c')](_0x251bca[_0xa1cc('0x3b')],{'$or':_[_0xa1cc('0x2c')](_0x5d3444,function(_0x34b7d6){if(_0x34b7d6['type']!==_0xa1cc('0x3d')){var _0x4a9ff7={};_0x4a9ff7[_0x34b7d6['name']]={'$like':'%'+_0x13bd44['query'][_0xa1cc('0x3e')]+'%'};return _0x4a9ff7;}})});}_0x251bca=_['merge']({},_0x251bca,_0x13bd44['options']);var _0x2f9584={'where':_0x251bca[_0xa1cc('0x3b')]};return db[_0xa1cc('0x3f')][_0xa1cc('0x1d')](_0x2f9584)[_0xa1cc('0x24')](function(_0x3025e6){_0x2d4b7e['count']=_0x3025e6;if(_0x13bd44[_0xa1cc('0x30')][_0xa1cc('0x40')]){_0x251bca[_0xa1cc('0x41')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xa1cc('0x42')](_0x251bca);})[_0xa1cc('0x24')](function(_0x44b5f5){_0x2d4b7e['rows']=_0x44b5f5;return _0x2d4b7e;})[_0xa1cc('0x24')](respondWithFilteredResult(_0x2023f7,_0x251bca))['catch'](handleError(_0x2023f7,null));};exports['show']=function(_0x1e6414,_0x289027){var _0x39fb28={'raw':![],'where':{'id':_0x1e6414[_0xa1cc('0x43')]['id']}},_0x1f319b={};_0x1f319b['model']=_[_0xa1cc('0x31')](db[_0xa1cc('0x3f')]['rawAttributes']);_0x1f319b[_0xa1cc('0x30')]=_[_0xa1cc('0x31')](_0x1e6414[_0xa1cc('0x30')]);_0x1f319b[_0xa1cc('0x32')]=_[_0xa1cc('0x33')](_0x1f319b['model'],_0x1f319b[_0xa1cc('0x30')]);_0x39fb28[_0xa1cc('0x35')]=_[_0xa1cc('0x33')](_0x1f319b[_0xa1cc('0x34')],qs[_0xa1cc('0x36')](_0x1e6414[_0xa1cc('0x30')][_0xa1cc('0x36')]));_0x39fb28[_0xa1cc('0x35')]=_0x39fb28[_0xa1cc('0x35')][_0xa1cc('0x37')]?_0x39fb28[_0xa1cc('0x35')]:_0x1f319b[_0xa1cc('0x34')];if(_0x1e6414[_0xa1cc('0x30')][_0xa1cc('0x40')]){_0x39fb28[_0xa1cc('0x41')]=[{'all':!![]}];}_0x39fb28=_[_0xa1cc('0x3c')]({},_0x39fb28,_0x1e6414[_0xa1cc('0x44')]);return db['AnalyticCustomReport'][_0xa1cc('0x45')](_0x39fb28)[_0xa1cc('0x24')](handleEntityNotFound(_0x289027,null))[_0xa1cc('0x24')](respondWithResult(_0x289027,null))[_0xa1cc('0x46')](handleError(_0x289027,null));};exports[_0xa1cc('0x47')]=function(_0x44527f,_0x1ab158){return db[_0xa1cc('0x3f')][_0xa1cc('0x47')](_0x44527f[_0xa1cc('0x48')],{})[_0xa1cc('0x24')](function(_0x31a622){var _0x333f8c=_0x44527f[_0xa1cc('0x49')][_0xa1cc('0x26')]({'plain':!![]});if(!_0x333f8c)throw new Error(_0xa1cc('0x4a'));if(_0x333f8c[_0xa1cc('0x4b')]===_0xa1cc('0x49')){var _0x270334=_0x31a622['get']({'plain':!![]});var _0x14cf94='Reports';return db['UserProfileSection'][_0xa1cc('0x45')]({'where':{'name':_0x14cf94,'userProfileId':_0x333f8c[_0xa1cc('0x4c')]},'raw':!![]})[_0xa1cc('0x24')](function(_0x513ec5){if(_0x513ec5&&_0x513ec5[_0xa1cc('0x4d')]===0x0){return db[_0xa1cc('0x4e')][_0xa1cc('0x47')]({'name':_0x270334['name'],'resourceId':_0x270334['id'],'type':'CustomReports','sectionId':_0x513ec5['id']},{})[_0xa1cc('0x24')](function(){return _0x31a622;});}else{return _0x31a622;}})[_0xa1cc('0x46')](function(_0x3b5a0c){logger[_0xa1cc('0x28')](_0xa1cc('0x4f'),_0x3b5a0c);throw _0x3b5a0c;});}return _0x31a622;})[_0xa1cc('0x24')](respondWithResult(_0x1ab158,0xc9))['catch'](handleError(_0x1ab158,null));};exports['update']=function(_0x27caba,_0x30dc43){if(_0x27caba['body']['id']){delete _0x27caba[_0xa1cc('0x48')]['id'];}return db['AnalyticCustomReport'][_0xa1cc('0x45')]({'where':{'id':_0x27caba['params']['id']}})[_0xa1cc('0x24')](handleEntityNotFound(_0x30dc43,null))[_0xa1cc('0x24')](saveUpdates(_0x27caba[_0xa1cc('0x48')],null))[_0xa1cc('0x24')](respondWithResult(_0x30dc43,null))[_0xa1cc('0x46')](handleError(_0x30dc43,null));};exports[_0xa1cc('0x25')]=function(_0x3000e6,_0x4b41b5){return db[_0xa1cc('0x3f')]['find']({'where':{'id':_0x3000e6[_0xa1cc('0x43')]['id']}})[_0xa1cc('0x24')](handleEntityNotFound(_0x4b41b5,null))[_0xa1cc('0x24')](removeEntity(_0x4b41b5,null))['catch'](handleError(_0x4b41b5,null));};exports[_0xa1cc('0x50')]=function(_0x4a366a,_0x2e721f){var _0x199525=0xa;var _0x1fff5d=[_0xa1cc('0x51'),'left_join',_0xa1cc('0x52'),_0xa1cc('0x53')];var _0xc56443={'SUM':_0xa1cc('0x54'),'COUNT':_0xa1cc('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xa1cc('0x56'),'AVG':_0xa1cc('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa1cc('0x58')};var _0x41a7f6={'SEC_TO_TIME':_0xa1cc('0x59'),'DATE':_0xa1cc('0x5a'),'HOUR':_0xa1cc('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa1cc('0x5c')};var _0x397087=function(_0x18b5f1){return!_[_0xa1cc('0x5d')]([_0xa1cc('0x5e'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x18b5f1);};var _0x2d9e2a=function(_0x36924c){if(!_0x36924c||!_0x36924c[_0xa1cc('0x5f')][_0xa1cc('0x37')]){return'';}for(var _0x3daa89='(',_0x25ad8a=0x0;_0x25ad8a<_0x36924c['rules'][_0xa1cc('0x37')];_0x25ad8a+=0x1){_0x25ad8a>0x0&&(_0x3daa89+='\x20'+_0x36924c[_0xa1cc('0x60')]+'\x20');_0x3daa89+=_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x61')]?_0x2d9e2a(_0x36924c['rules'][_0x25ad8a][_0xa1cc('0x61')]):_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x62')]+'\x20'+_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x63')]+(_0x397087(_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x63')])?'\x20'+_0x36924c[_0xa1cc('0x5f')][_0x25ad8a][_0xa1cc('0x64')]:'');}return _0x3daa89+')';};var _0x58d3bd={'where':{'id':_0x4a366a['params']['id']}},_0x3cb8b0,_0x564b49,_0x10147b,_0x97e7de,_0x55866a;_0x58d3bd=_[_0xa1cc('0x3c')]({},_0x58d3bd,_0x4a366a[_0xa1cc('0x44')]);return db[_0xa1cc('0x3f')][_0xa1cc('0x45')](_0x58d3bd)[_0xa1cc('0x24')](function(_0x451645){if(_0x451645){_0x3cb8b0=_0x451645;return _0x451645[_0xa1cc('0x65')]();}return null;})['then'](function(_0x552ccd){if(_0x552ccd){if(!_0x552ccd[_0xa1cc('0x37')]){throw new db['Sequelize'][(_0xa1cc('0x66'))](_0xa1cc('0x67'),0x193);}_0x564b49=_0x552ccd;return db['AnalyticMetric'][_0xa1cc('0x42')]({'raw':!![]});}return null;})[_0xa1cc('0x24')](function(_0x82c9c4){if(_0x82c9c4){_0x10147b=_[_0xa1cc('0x68')](_0x82c9c4,'id');var _0x5a0718;var _0x381d4b=squel[_0xa1cc('0x69')]();_0x381d4b[_0xa1cc('0x6a')](_0x3cb8b0[_0xa1cc('0x6b')]);for(var _0x1e6c42=0x0;_0x1e6c42<_0x564b49[_0xa1cc('0x37')];_0x1e6c42+=0x1){_0x5a0718=_0x564b49[_0x1e6c42]['MetricId']?_0x10147b[_0x564b49[_0x1e6c42][_0xa1cc('0x6c')]][_0xa1cc('0x6d')]:_0x564b49[_0x1e6c42][_0xa1cc('0x62')];_0x5a0718=_0x564b49[_0x1e6c42][_0xa1cc('0x6e')]?_[_0xa1cc('0x6f')](_0xc56443[_0x564b49[_0x1e6c42][_0xa1cc('0x6e')]],'%s',_0x5a0718):_0x5a0718;_0x5a0718=_0x564b49[_0x1e6c42][_0xa1cc('0x70')]?_[_0xa1cc('0x6f')](_0x41a7f6[_0x564b49[_0x1e6c42][_0xa1cc('0x70')]],'%s',_0x5a0718):_0x5a0718;if(_0x564b49[_0x1e6c42][_0xa1cc('0x71')]){_0x381d4b['group'](_0x5a0718);}_0x564b49[_0x1e6c42]['orderBy']&&_0x381d4b['order'](_0x5a0718,_0x564b49[_0x1e6c42][_0xa1cc('0x72')]===_0xa1cc('0x73')?![]:!![]);_0x381d4b['field'](_0x5a0718,_0x564b49[_0x1e6c42][_0xa1cc('0x74')]||_0x5a0718);}if(_0x3cb8b0[_0xa1cc('0x75')]){_0x3cb8b0[_0xa1cc('0x75')]=JSON[_0xa1cc('0x76')](_0x3cb8b0[_0xa1cc('0x75')]);for(var _0xea2cdc=0x0;_0xea2cdc<_0x3cb8b0[_0xa1cc('0x75')][_0xa1cc('0x37')];_0xea2cdc+=0x1){if(_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc]['type']&&_[_0xa1cc('0x5d')](_0x1fff5d,_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x77')])&&_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc]['parentKey']&&_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x78')]&&_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc]['foreignKey']){_0x381d4b[_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x77')]](_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x78')],null,util[_0xa1cc('0x70')](_0xa1cc('0x79'),_0x3cb8b0[_0xa1cc('0x6b')],_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x7a')],_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x78')],_0x3cb8b0[_0xa1cc('0x75')][_0xea2cdc][_0xa1cc('0x7b')]));}}}if(_0x3cb8b0[_0xa1cc('0x7c')]){_0x3cb8b0['conditions']=JSON[_0xa1cc('0x76')](_0x3cb8b0[_0xa1cc('0x7c')]);_0x381d4b['where'](_0x2d9e2a(_0x3cb8b0[_0xa1cc('0x7c')][_0xa1cc('0x61')]));}_0x55866a=_0x381d4b['clone']();_0x381d4b[_0xa1cc('0x1b')](_0x199525);_0x381d4b[_0xa1cc('0x1a')](0x0);logger[_0xa1cc('0x7d')]('Limited\x20Query:',_0x381d4b[_0xa1cc('0x7e')]());return dbH['sequelize'][_0xa1cc('0x30')](_0x381d4b['toString'](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]});}})[_0xa1cc('0x24')](respondWithResult(_0x2e721f,null))['catch'](handleError(_0x2e721f,null));};function runReport(_0xe41186,_0x530cd2,_0xc308a){var _0x305053=_0x530cd2[_0xa1cc('0x2a')];var _0x1f8440=0xa;var _0x563544=[_0xa1cc('0x51'),_0xa1cc('0x82'),'right_join','cross_join'];var _0x56718b={'SUM':_0xa1cc('0x54'),'COUNT':_0xa1cc('0x55'),'COUNT DISTINCT':_0xa1cc('0x83'),'MAX':_0xa1cc('0x84'),'MIN':_0xa1cc('0x56'),'AVG':_0xa1cc('0x57'),'GROUP_CONCAT':_0xa1cc('0x85'),'GROUP_CONCAT ASC':_0xa1cc('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x413f86={'SEC_TO_TIME':_0xa1cc('0x59'),'DATE':_0xa1cc('0x5a'),'HOUR':_0xa1cc('0x5b'),'ROUND':_0xa1cc('0x87'),'UNIX_TIMESTAMP':_0xa1cc('0x5c')};var _0x2c087c=function(_0x1cc406){return!_[_0xa1cc('0x5d')]([_0xa1cc('0x5e'),_0xa1cc('0x88'),_0xa1cc('0x89'),_0xa1cc('0x8a')],_0x1cc406);};var _0x5ef57e=function(_0x4d1abf){if(!_0x4d1abf||!_0x4d1abf[_0xa1cc('0x5f')][_0xa1cc('0x37')]){return'';}for(var _0xd2eefb='(',_0x3c118a=0x0;_0x3c118a<_0x4d1abf[_0xa1cc('0x5f')][_0xa1cc('0x37')];_0x3c118a+=0x1){_0x3c118a>0x0&&(_0xd2eefb+='\x20'+_0x4d1abf['operator']+'\x20');_0xd2eefb+=_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a]['group']?_0x5ef57e(_0x4d1abf['rules'][_0x3c118a][_0xa1cc('0x61')]):_0x4d1abf['rules'][_0x3c118a][_0xa1cc('0x62')]+'\x20'+_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a][_0xa1cc('0x63')]+(_0x2c087c(_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a][_0xa1cc('0x63')])?'\x20'+_0x4d1abf[_0xa1cc('0x5f')][_0x3c118a][_0xa1cc('0x64')]:'');}return _0xd2eefb+')';};var _0x3c465f={'where':{'id':_0xe41186['id']}},_0x5ad61f,_0x48705e,_0x32203d,_0x224c4b,_0x181578;_0x3c465f=_[_0xa1cc('0x3c')]({},_0x3c465f,_0xc308a);return db[_0xa1cc('0x3f')]['find'](_0x3c465f)['then'](function(_0x2292a9){if(_0x2292a9){_0x5ad61f=_0x2292a9;return _0x2292a9[_0xa1cc('0x65')]();}return null;})[_0xa1cc('0x24')](function(_0x3f18c8){if(_0x3f18c8){if(!_0x3f18c8['length']){throw new db[(_0xa1cc('0x8b'))]['ValidationErrorItem'](_0xa1cc('0x67'),0x193);}_0x48705e=_0x3f18c8;return db[_0xa1cc('0x8c')][_0xa1cc('0x42')]({'raw':!![]});}return null;})[_0xa1cc('0x24')](function(_0x183ab6){if(_0x183ab6){_0x32203d=_[_0xa1cc('0x68')](_0x183ab6,'id');var _0x467509;var _0x561e26=squel[_0xa1cc('0x69')]();_0x561e26[_0xa1cc('0x6a')](_0x5ad61f['table']);for(var _0x45a842=0x0;_0x45a842<_0x48705e[_0xa1cc('0x37')];_0x45a842+=0x1){_0x467509=_0x48705e[_0x45a842][_0xa1cc('0x6c')]?_0x32203d[_0x48705e[_0x45a842]['MetricId']]['metric']:_0x48705e[_0x45a842][_0xa1cc('0x62')];_0x467509=_0x48705e[_0x45a842][_0xa1cc('0x6e')]?_[_0xa1cc('0x6f')](_0x56718b[_0x48705e[_0x45a842][_0xa1cc('0x6e')]],'%s',_0x467509):_0x467509;_0x467509=_0x48705e[_0x45a842][_0xa1cc('0x70')]?_['replace'](_0x413f86[_0x48705e[_0x45a842]['format']],'%s',_0x467509):_0x467509;if(_0x48705e[_0x45a842][_0xa1cc('0x71')]){_0x561e26['group'](_0x467509);}_0x48705e[_0x45a842][_0xa1cc('0x72')]&&_0x561e26['order'](_0x467509,_0x48705e[_0x45a842][_0xa1cc('0x72')]===_0xa1cc('0x73')?![]:!![]);_0x561e26['field'](_0x467509,_0x48705e[_0x45a842][_0xa1cc('0x74')]||_0x467509);}if(_0x5ad61f['joins']){_0x5ad61f['joins']=JSON[_0xa1cc('0x76')](_0x5ad61f[_0xa1cc('0x75')]);for(var _0x58c382=0x0;_0x58c382<_0x5ad61f[_0xa1cc('0x75')][_0xa1cc('0x37')];_0x58c382+=0x1){if(_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x77')]&&_[_0xa1cc('0x5d')](_0x563544,_0x5ad61f['joins'][_0x58c382][_0xa1cc('0x77')])&&_0x5ad61f[_0xa1cc('0x75')][_0x58c382]['parentKey']&&_0x5ad61f['joins'][_0x58c382]['foreignTable']&&_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x7b')]){_0x561e26[_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x77')]](_0x5ad61f[_0xa1cc('0x75')][_0x58c382]['foreignTable'],null,util[_0xa1cc('0x70')](_0xa1cc('0x79'),_0x5ad61f[_0xa1cc('0x6b')],_0x5ad61f['joins'][_0x58c382][_0xa1cc('0x7a')],_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x78')],_0x5ad61f[_0xa1cc('0x75')][_0x58c382][_0xa1cc('0x7b')]));}}}if(_0x5ad61f[_0xa1cc('0x7c')]){_0x5ad61f[_0xa1cc('0x7c')]=JSON[_0xa1cc('0x76')](_0x5ad61f[_0xa1cc('0x7c')]);_0x561e26[_0xa1cc('0x3b')](_0x5ef57e(_0x5ad61f['conditions'][_0xa1cc('0x61')]));}_0x181578=_0x561e26['clone']();_0x561e26[_0xa1cc('0x1b')](_0x1f8440);_0x561e26[_0xa1cc('0x1a')](0x0);return;}})[_0xa1cc('0x24')](function(){if(_0x530cd2[_0xa1cc('0x8d')]===_0xa1cc('0x8e')){return null;}var _0x3d9c03=_[_0xa1cc('0x3c')](_0x530cd2,{'name':_0x530cd2[_0xa1cc('0x8f')]||_0x530cd2['name']||_0x5ad61f[_0xa1cc('0x2a')],'basename':_0x305053,'savename':util['format'](_0xa1cc('0x90'),_0x530cd2[_0xa1cc('0x2a')]||_0x5ad61f['name'],require(_0xa1cc('0x91'))[_0xa1cc('0x92')](0x4),_0x530cd2[_0xa1cc('0x8d')]||'csv'),'reportId':_0x5ad61f['id'],'reportType':_0xa1cc('0x93')});return db[_0xa1cc('0x94')][_0xa1cc('0x47')](_0x3d9c03,{'raw':!![]});})['then'](function(_0x28b350){if(_0x5ad61f['table']==='cdr'){_0x181578[_0xa1cc('0x3b')](_0x5ad61f[_0xa1cc('0x6b')]+_0xa1cc('0x95'),_0x530cd2[_0xa1cc('0x96')],_0x530cd2['endDate']);}else{_0x181578[_0xa1cc('0x3b')](_0x5ad61f[_0xa1cc('0x6b')]+_0xa1cc('0x97'),_0x530cd2[_0xa1cc('0x96')],_0x530cd2[_0xa1cc('0x98')]);}if(_0x28b350){logger[_0xa1cc('0x99')](_0xa1cc('0x9a'),_0x181578[_0xa1cc('0x7e')]());require(_0xa1cc('0x9b'))[_0xa1cc('0x9c')](path['join'](__dirname,_0xa1cc('0x9d'),_0x28b350[_0xa1cc('0x8d')]),[_0x28b350['id'],_0x181578[_0xa1cc('0x7e')](),path[_0xa1cc('0x51')](__dirname,_0xa1cc('0x9e'),_0x28b350['savename']),_0x305053]);return _0x28b350;}else{var _0x402f40=squel[_0xa1cc('0x69')]();_0x402f40[_0xa1cc('0x6a')]('('+_0x181578[_0xa1cc('0x7e')]()+')',_0xa1cc('0x9f'));_0x402f40['field'](_0xa1cc('0xa0'),_0xa1cc('0x1d'));_0x181578[_0xa1cc('0x1b')](_0x530cd2['limit']||_0x1f8440);_0x181578[_0xa1cc('0x1a')](_0x530cd2[_0xa1cc('0x1a')]||0x0);return dbH['sequelize']['query'](_0x402f40[_0xa1cc('0x7e')](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]})[_0xa1cc('0x24')](function(_0x3a0a65){if(!_0x3a0a65[_0xa1cc('0x37')]){_0x224c4b=0x0;}else{_0x224c4b=_0x3a0a65[0x0][_0xa1cc('0x1d')]||0x0;}return dbH[_0xa1cc('0x7f')][_0xa1cc('0x30')](_0x181578[_0xa1cc('0x7e')](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]});})[_0xa1cc('0x24')](function(_0x141f1f){return{'rows':_0x141f1f||[],'count':_0x224c4b};});}});}exports['run']=function(_0x112867,_0x238aea){return runReport(_0x112867[_0xa1cc('0x43')],_0x112867[_0xa1cc('0x30')],_0x112867['options'])[_0xa1cc('0x24')](respondWithResult(_0x238aea,null))['catch'](handleError(_0x238aea,null));};exports[_0xa1cc('0xa1')]=runReport;exports['query']=function(_0x4fea45,_0x4ba067){var _0x3213da=0xa;var _0x5bc29f=[_0xa1cc('0x51'),_0xa1cc('0x82'),_0xa1cc('0x52'),'cross_join'];var _0x530ad0={'SUM':_0xa1cc('0x54'),'COUNT':_0xa1cc('0x55'),'COUNT DISTINCT':_0xa1cc('0x83'),'MAX':_0xa1cc('0x84'),'MIN':_0xa1cc('0x56'),'AVG':_0xa1cc('0x57'),'GROUP_CONCAT':_0xa1cc('0x85'),'GROUP_CONCAT ASC':_0xa1cc('0x86'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x440a1e={'SEC_TO_TIME':_0xa1cc('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xa1cc('0x87'),'UNIX_TIMESTAMP':_0xa1cc('0x5c')};var _0x11b55b=function(_0x501fcf){return!_[_0xa1cc('0x5d')]([_0xa1cc('0x5e'),_0xa1cc('0x88'),_0xa1cc('0x89'),_0xa1cc('0x8a')],_0x501fcf);};var _0x3941fa=function(_0x497b33){if(!_0x497b33||!_0x497b33[_0xa1cc('0x5f')]['length']){return'';}for(var _0x15925a='(',_0x4a391f=0x0;_0x4a391f<_0x497b33[_0xa1cc('0x5f')][_0xa1cc('0x37')];_0x4a391f+=0x1){_0x4a391f>0x0&&(_0x15925a+='\x20'+_0x497b33[_0xa1cc('0x60')]+'\x20');_0x15925a+=_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x61')]?_0x3941fa(_0x497b33['rules'][_0x4a391f][_0xa1cc('0x61')]):_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x62')]+'\x20'+_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x63')]+(_0x11b55b(_0x497b33[_0xa1cc('0x5f')][_0x4a391f][_0xa1cc('0x63')])?'\x20'+_0x497b33[_0xa1cc('0x5f')][_0x4a391f]['value']:'');}return _0x15925a+')';};var _0x45b263={'where':{'id':_0x4fea45['params']['id']}},_0x21a18c,_0x2265be,_0x208df0,_0x9618fd,_0x19523e;_0x45b263=_[_0xa1cc('0x3c')]({},_0x45b263,_0x4fea45[_0xa1cc('0x44')]);return db['AnalyticCustomReport'][_0xa1cc('0x45')](_0x45b263)['then'](function(_0x43f34b){if(_0x43f34b){_0x21a18c=_0x43f34b;return _0x43f34b['getFields']();}return null;})[_0xa1cc('0x24')](function(_0x53aa00){if(_0x53aa00){if(!_0x53aa00[_0xa1cc('0x37')]){throw new db[(_0xa1cc('0x8b'))]['ValidationErrorItem'](_0xa1cc('0x67'),0x193);}_0x2265be=_0x53aa00;return db[_0xa1cc('0x8c')]['findAll']({'raw':!![]});}return null;})[_0xa1cc('0x24')](function(_0x141319){if(_0x141319){_0x208df0=_['keyBy'](_0x141319,'id');var _0x2b120a;var _0x320f46=squel[_0xa1cc('0x69')]();_0x320f46[_0xa1cc('0x6a')](_0x21a18c[_0xa1cc('0x6b')]);for(var _0x220566=0x0;_0x220566<_0x2265be['length'];_0x220566+=0x1){_0x2b120a=_0x2265be[_0x220566][_0xa1cc('0x6c')]?_0x208df0[_0x2265be[_0x220566][_0xa1cc('0x6c')]]['metric']:_0x2265be[_0x220566]['field'];_0x2b120a=_0x2265be[_0x220566][_0xa1cc('0x6e')]?_[_0xa1cc('0x6f')](_0x530ad0[_0x2265be[_0x220566]['function']],'%s',_0x2b120a):_0x2b120a;_0x2b120a=_0x2265be[_0x220566][_0xa1cc('0x70')]?_[_0xa1cc('0x6f')](_0x440a1e[_0x2265be[_0x220566][_0xa1cc('0x70')]],'%s',_0x2b120a):_0x2b120a;if(_0x2265be[_0x220566]['groupBy']){_0x320f46[_0xa1cc('0x61')](_0x2b120a);}_0x2265be[_0x220566][_0xa1cc('0x72')]&&_0x320f46[_0xa1cc('0xa2')](_0x2b120a,_0x2265be[_0x220566][_0xa1cc('0x72')]==='DESC'?![]:!![]);_0x320f46['field'](_0x2b120a,_0x2265be[_0x220566][_0xa1cc('0x74')]||_0x2b120a);}if(_0x21a18c['joins']){_0x21a18c[_0xa1cc('0x75')]=JSON[_0xa1cc('0x76')](_0x21a18c[_0xa1cc('0x75')]);for(var _0x31c120=0x0;_0x31c120<_0x21a18c[_0xa1cc('0x75')][_0xa1cc('0x37')];_0x31c120+=0x1){if(_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x77')]&&_[_0xa1cc('0x5d')](_0x5bc29f,_0x21a18c[_0xa1cc('0x75')][_0x31c120]['type'])&&_0x21a18c[_0xa1cc('0x75')][_0x31c120]['parentKey']&&_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x78')]&&_0x21a18c['joins'][_0x31c120]['foreignKey']){_0x320f46[_0x21a18c['joins'][_0x31c120][_0xa1cc('0x77')]](_0x21a18c[_0xa1cc('0x75')][_0x31c120]['foreignTable'],null,util[_0xa1cc('0x70')](_0xa1cc('0x79'),_0x21a18c[_0xa1cc('0x6b')],_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x7a')],_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x78')],_0x21a18c[_0xa1cc('0x75')][_0x31c120][_0xa1cc('0x7b')]));}}}if(_0x21a18c[_0xa1cc('0x7c')]){_0x21a18c['conditions']=JSON[_0xa1cc('0x76')](_0x21a18c[_0xa1cc('0x7c')]);_0x320f46[_0xa1cc('0x3b')](_0x3941fa(_0x21a18c[_0xa1cc('0x7c')]['group']));}_0x19523e=_0x320f46[_0xa1cc('0xa3')]();_0x320f46[_0xa1cc('0x1b')](_0x3213da);_0x320f46[_0xa1cc('0x1a')](0x0);logger[_0xa1cc('0x7d')](_0xa1cc('0xa4'),_0x320f46[_0xa1cc('0x7e')]());return dbH['sequelize'][_0xa1cc('0x30')](_0x320f46[_0xa1cc('0x7e')](),{'type':dbH[_0xa1cc('0x7f')][_0xa1cc('0x80')][_0xa1cc('0x81')]});}})[_0xa1cc('0x24')](function(){return{'sql':_0x19523e[_0xa1cc('0x7e')]()};})[_0xa1cc('0x24')](respondWithResult(_0x4ba067,null))[_0xa1cc('0x46')](handleError(_0x4ba067,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index f82c492..8fd9f81 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 _0x0095=['rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd021,_0x54467c){var _0x2819e0=function(_0x105c7a){while(--_0x105c7a){_0x3dd021['push'](_0x3dd021['shift']());}};_0x2819e0(++_0x54467c);}(_0x0095,0xc0));var _0x5009=function(_0x4fe525,_0xe793e9){_0x4fe525=_0x4fe525-0x0;var _0x453924=_0x0095[_0x4fe525];return _0x453924;};'use strict';var _=require(_0x5009('0x0'));var util=require('util');var logger=require(_0x5009('0x1'))('api');var moment=require(_0x5009('0x2'));var BPromise=require(_0x5009('0x3'));var rp=require(_0x5009('0x4'));var fs=require('fs');var path=require(_0x5009('0x5'));var rimraf=require(_0x5009('0x6'));var config=require(_0x5009('0x7'));var attributes=require(_0x5009('0x8'));module['exports']=function(_0x29699b,_0x458047){return _0x29699b['define'](_0x5009('0x9'),attributes,{'tableName':_0x5009('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e5b=['rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x20a4dc,_0x2bd7c7){var _0x49000f=function(_0x2246e7){while(--_0x2246e7){_0x20a4dc['push'](_0x20a4dc['shift']());}};_0x49000f(++_0x2bd7c7);}(_0x0e5b,0x170));var _0xb0e5=function(_0x37e717,_0x6207b2){_0x37e717=_0x37e717-0x0;var _0x421a12=_0x0e5b[_0x37e717];return _0x421a12;};'use strict';var _=require(_0xb0e5('0x0'));var util=require(_0xb0e5('0x1'));var logger=require(_0xb0e5('0x2'))('api');var moment=require(_0xb0e5('0x3'));var BPromise=require(_0xb0e5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0e5('0x5'));var rimraf=require(_0xb0e5('0x6'));var config=require('../../config/environment');var attributes=require(_0xb0e5('0x7'));module[_0xb0e5('0x8')]=function(_0x4951b8,_0x3159be){return _0x4951b8[_0xb0e5('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xb0e5('0xa'),'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 f38dcd1..505f3ba 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 _0x0e40=['error','AnalyticCustomReport,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b91e5,_0x344eb8){var _0x5d62fd=function(_0x152fad){while(--_0x152fad){_0x2b91e5['push'](_0x2b91e5['shift']());}};_0x5d62fd(++_0x344eb8);}(_0x0e40,0x1bc));var _0x00e4=function(_0x413e18,_0x538b10){_0x413e18=_0x413e18-0x0;var _0x2bbe3d=_0x0e40[_0x413e18];return _0x2bbe3d;};'use strict';var _=require('lodash');var util=require(_0x00e4('0x0'));var moment=require(_0x00e4('0x1'));var BPromise=require(_0x00e4('0x2'));var rs=require(_0x00e4('0x3'));var fs=require('fs');var Redis=require(_0x00e4('0x4'));var db=require(_0x00e4('0x5'))['db'];var utils=require(_0x00e4('0x6'));var logger=require(_0x00e4('0x7'))(_0x00e4('0x8'));var config=require('../../config/environment');var jayson=require(_0x00e4('0x9'));var client=jayson[_0x00e4('0xa')][_0x00e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x553c44,_0x1f976a,_0x902dc3){return new BPromise(function(_0x23859e,_0x9de447){return client[_0x00e4('0xc')](_0x553c44,_0x902dc3)[_0x00e4('0xd')](function(_0x595d03){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1f976a,_0x00e4('0xe'));logger[_0x00e4('0xf')](_0x00e4('0x10'),_0x1f976a,'request\x20sent',JSON[_0x00e4('0x11')](_0x595d03));if(_0x595d03[_0x00e4('0x12')]){if(_0x595d03[_0x00e4('0x12')]['code']===0x1f4){logger['error'](_0x00e4('0x13'),_0x1f976a,_0x595d03[_0x00e4('0x12')]['message']);return _0x9de447(_0x595d03['error'][_0x00e4('0x14')]);}logger[_0x00e4('0x12')](_0x00e4('0x13'),_0x1f976a,_0x595d03[_0x00e4('0x12')][_0x00e4('0x14')]);return _0x23859e(_0x595d03[_0x00e4('0x12')]['message']);}else{logger['info'](_0x00e4('0x13'),_0x1f976a,_0x00e4('0xe'));_0x23859e(_0x595d03['result'][_0x00e4('0x14')]);}})['catch'](function(_0xb6a180){logger[_0x00e4('0x12')](_0x00e4('0x13'),_0x1f976a,_0xb6a180);_0x9de447(_0xb6a180);});});} \ No newline at end of file +var _0xf3f7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf3f7,0x183));var _0x7f3f=function(_0x1e10f7,_0x2459cf){_0x1e10f7=_0x1e10f7-0x0;var _0x110166=_0xf3f7[_0x1e10f7];return _0x110166;};'use strict';var _=require(_0x7f3f('0x0'));var util=require('util');var moment=require(_0x7f3f('0x1'));var BPromise=require(_0x7f3f('0x2'));var rs=require(_0x7f3f('0x3'));var fs=require('fs');var Redis=require(_0x7f3f('0x4'));var db=require(_0x7f3f('0x5'))['db'];var utils=require(_0x7f3f('0x6'));var logger=require(_0x7f3f('0x7'))('rpc');var config=require(_0x7f3f('0x8'));var jayson=require(_0x7f3f('0x9'));var client=jayson[_0x7f3f('0xa')][_0x7f3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a29e7,_0x4d151d,_0x35c913){return new BPromise(function(_0x431b9d,_0x14b255){return client[_0x7f3f('0xc')](_0x2a29e7,_0x35c913)[_0x7f3f('0xd')](function(_0x38feea){logger[_0x7f3f('0xe')](_0x7f3f('0xf'),_0x4d151d,_0x7f3f('0x10'));logger['debug'](_0x7f3f('0x11'),_0x4d151d,_0x7f3f('0x10'),JSON['stringify'](_0x38feea));if(_0x38feea[_0x7f3f('0x12')]){if(_0x38feea['error'][_0x7f3f('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4d151d,_0x38feea[_0x7f3f('0x12')][_0x7f3f('0x14')]);return _0x14b255(_0x38feea[_0x7f3f('0x12')][_0x7f3f('0x14')]);}logger[_0x7f3f('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4d151d,_0x38feea[_0x7f3f('0x12')]['message']);return _0x431b9d(_0x38feea[_0x7f3f('0x12')][_0x7f3f('0x14')]);}else{logger['info'](_0x7f3f('0xf'),_0x4d151d,_0x7f3f('0x10'));_0x431b9d(_0x38feea[_0x7f3f('0x15')][_0x7f3f('0x14')]);}})[_0x7f3f('0x16')](function(_0x55fb15){logger[_0x7f3f('0x12')](_0x7f3f('0xf'),_0x4d151d,_0x55fb15);_0x14b255(_0x55fb15);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e3add77..8894bda 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 _0x3859=['preview','/:id/query','query','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3859,0x1d7));var _0x9385=function(_0x919825,_0x5cdd53){_0x919825=_0x919825-0x0;var _0x4a8294=_0x3859[_0x919825];return _0x4a8294;};'use strict';var multer=require(_0x9385('0x0'));var util=require('util');var path=require(_0x9385('0x1'));var timeout=require('connect-timeout');var express=require(_0x9385('0x2'));var router=express[_0x9385('0x3')]();var fs_extra=require(_0x9385('0x4'));var auth=require(_0x9385('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9385('0x6'));router[_0x9385('0x7')]('/',auth[_0x9385('0x8')](),controller[_0x9385('0x9')]);router[_0x9385('0x7')](_0x9385('0xa'),auth[_0x9385('0x8')](),controller['show']);router[_0x9385('0x7')](_0x9385('0xb'),auth[_0x9385('0x8')](),controller[_0x9385('0xc')]);router[_0x9385('0x7')]('/:id/run',auth[_0x9385('0x8')](),controller['run']);router[_0x9385('0x7')](_0x9385('0xd'),auth[_0x9385('0x8')](),controller[_0x9385('0xe')]);router[_0x9385('0xf')]('/',auth[_0x9385('0x8')](),controller[_0x9385('0x10')]);router[_0x9385('0x11')](_0x9385('0xa'),auth[_0x9385('0x8')](),controller[_0x9385('0x12')]);router[_0x9385('0x13')](_0x9385('0xa'),auth[_0x9385('0x8')](),controller[_0x9385('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf12a=['/:id/run','run','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/preview'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xf12a,0xaf));var _0xaf12=function(_0x29436c,_0x260a6a){_0x29436c=_0x29436c-0x0;var _0x3760a2=_0xf12a[_0x29436c];return _0x3760a2;};'use strict';var multer=require(_0xaf12('0x0'));var util=require(_0xaf12('0x1'));var path=require(_0xaf12('0x2'));var timeout=require(_0xaf12('0x3'));var express=require(_0xaf12('0x4'));var router=express[_0xaf12('0x5')]();var fs_extra=require(_0xaf12('0x6'));var auth=require(_0xaf12('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xaf12('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xaf12('0x9')](),controller['index']);router[_0xaf12('0xa')](_0xaf12('0xb'),auth[_0xaf12('0x9')](),controller[_0xaf12('0xc')]);router[_0xaf12('0xa')](_0xaf12('0xd'),auth['isAuthenticated'](),controller['preview']);router[_0xaf12('0xa')](_0xaf12('0xe'),auth[_0xaf12('0x9')](),controller[_0xaf12('0xf')]);router[_0xaf12('0xa')]('/:id/query',auth[_0xaf12('0x9')](),controller['query']);router['post']('/',auth[_0xaf12('0x9')](),controller['create']);router[_0xaf12('0x10')](_0xaf12('0xb'),auth[_0xaf12('0x9')](),controller[_0xaf12('0x11')]);router[_0xaf12('0x12')](_0xaf12('0xb'),auth[_0xaf12('0x9')](),controller[_0xaf12('0x13')]);module[_0xaf12('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 026a6cb..0b8b9ce 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 _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x21e23d,_0x749755){var _0x423baa=function(_0x175290){while(--_0x175290){_0x21e23d['push'](_0x21e23d['shift']());}};_0x423baa(++_0x749755);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file +var _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0xea1bcd,_0x465e08){var _0xfbe4c6=function(_0x4e20f1){while(--_0x4e20f1){_0xea1bcd['push'](_0xea1bcd['shift']());}};_0xfbe4c6(++_0x465e08);}(_0x687b,0x14a));var _0xb687=function(_0x192ac5,_0x308bad){_0x192ac5=_0x192ac5-0x0;var _0x2073f8=_0x687b[_0x192ac5];return _0x2073f8;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 6ee29de..85ef9b2 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x5125bd,_0x2777d4){var _0x1c8d87=function(_0x4979fd){while(--_0x4979fd){_0x5125bd['push'](_0x5125bd['shift']());}};_0x1c8d87(++_0x2777d4);}(_0x31f0,0xb7));var _0x031f=function(_0x527194,_0x5bf5b3){_0x527194=_0x527194-0x0;var _0x1c041e=_0x31f0[_0x527194];return _0x1c041e;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +var _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x14de25,_0x20c661){var _0x4740fd=function(_0x4b8dd3){while(--_0x4b8dd3){_0x14de25['push'](_0x14de25['shift']());}};_0x4740fd(++_0x20c661);}(_0x53ec,0x192));var _0xc53e=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x53ec[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index e5f2057..12a67d8 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 _0x85ec=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1bc309,_0x5876c2){var _0x2d9b53=function(_0x1e4af4){while(--_0x1e4af4){_0x1bc309['push'](_0x1bc309['shift']());}};_0x2d9b53(++_0x5876c2);}(_0x85ec,0xfb));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc85e('0x0'));var logger=require(_0xc85e('0x1'))(_0xc85e('0x2'));var moment=require(_0xc85e('0x3'));var BPromise=require(_0xc85e('0x4'));var rp=require(_0xc85e('0x5'));var fs=require('fs');var path=require(_0xc85e('0x6'));var rimraf=require(_0xc85e('0x7'));var config=require(_0xc85e('0x8'));var attributes=require(_0xc85e('0x9'));module['exports']=function(_0x2472b8,_0x32c2b4){return _0x2472b8[_0xc85e('0xa')](_0xc85e('0xb'),attributes,{'tableName':_0xc85e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc506=['bluebird','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc506,0x1b8));var _0x6c50=function(_0x1785a2,_0x15d901){_0x1785a2=_0x1785a2-0x0;var _0x58380c=_0xc506[_0x1785a2];return _0x58380c;};'use strict';var _=require(_0x6c50('0x0'));var util=require(_0x6c50('0x1'));var logger=require(_0x6c50('0x2'))('api');var moment=require(_0x6c50('0x3'));var BPromise=require(_0x6c50('0x4'));var rp=require(_0x6c50('0x5'));var fs=require('fs');var path=require(_0x6c50('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c50('0x7'));module[_0x6c50('0x8')]=function(_0x45e725,_0x15f58e){return _0x45e725[_0x6c50('0x9')](_0x6c50('0xa'),attributes,{'tableName':_0x6c50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index be9d4aa..a2492f0 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 _0xa522=['client','http','request','then','info','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x358e9a,_0x41a1f9){var _0xc715db=function(_0x261da5){while(--_0x261da5){_0x358e9a['push'](_0x358e9a['shift']());}};_0xc715db(++_0x41a1f9);}(_0xa522,0xc9));var _0x2a52=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xa522[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x2a52('0x0'));var util=require(_0x2a52('0x1'));var moment=require(_0x2a52('0x2'));var BPromise=require(_0x2a52('0x3'));var rs=require(_0x2a52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a52('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a52('0x6'))('rpc');var config=require(_0x2a52('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2a52('0x8')][_0x2a52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3abd79,_0x4addb0,_0x278c96){return new BPromise(function(_0x1e23af,_0x58308d){return client[_0x2a52('0xa')](_0x3abd79,_0x278c96)[_0x2a52('0xb')](function(_0x1ebf70){logger[_0x2a52('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,'request\x20sent');logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4addb0,'request\x20sent',JSON[_0x2a52('0xd')](_0x1ebf70));if(_0x1ebf70[_0x2a52('0xe')]){if(_0x1ebf70[_0x2a52('0xe')][_0x2a52('0xf')]===0x1f4){logger[_0x2a52('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,_0x1ebf70['error'][_0x2a52('0x10')]);return _0x58308d(_0x1ebf70[_0x2a52('0xe')][_0x2a52('0x10')]);}logger[_0x2a52('0xe')](_0x2a52('0x11'),_0x4addb0,_0x1ebf70['error'][_0x2a52('0x10')]);return _0x1e23af(_0x1ebf70['error'][_0x2a52('0x10')]);}else{logger[_0x2a52('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,'request\x20sent');_0x1e23af(_0x1ebf70['result']['message']);}})[_0x2a52('0x12')](function(_0x4dcaae){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4addb0,_0x4dcaae);_0x58308d(_0x4dcaae);});});} \ No newline at end of file +var _0x053f=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x5dba21,_0x542f0a){var _0x4516a7=function(_0x429d76){while(--_0x429d76){_0x5dba21['push'](_0x5dba21['shift']());}};_0x4516a7(++_0x542f0a);}(_0x053f,0x1cf));var _0xf053=function(_0x501384,_0x410cd8){_0x501384=_0x501384-0x0;var _0x2396d8=_0x053f[_0x501384];return _0x2396d8;};'use strict';var _=require(_0xf053('0x0'));var util=require(_0xf053('0x1'));var moment=require(_0xf053('0x2'));var BPromise=require(_0xf053('0x3'));var rs=require(_0xf053('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf053('0x5'))['db'];var utils=require(_0xf053('0x6'));var logger=require(_0xf053('0x7'))('rpc');var config=require(_0xf053('0x8'));var jayson=require(_0xf053('0x9'));var client=jayson[_0xf053('0xa')][_0xf053('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c401e,_0x1f5d8a,_0xbd00b4){return new BPromise(function(_0x3a9703,_0xa3649a){return client[_0xf053('0xc')](_0x5c401e,_0xbd00b4)[_0xf053('0xd')](function(_0x199964){logger[_0xf053('0xe')](_0xf053('0xf'),_0x1f5d8a,_0xf053('0x10'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1f5d8a,'request\x20sent',JSON[_0xf053('0x11')](_0x199964));if(_0x199964[_0xf053('0x12')]){if(_0x199964[_0xf053('0x12')]['code']===0x1f4){logger[_0xf053('0x12')](_0xf053('0xf'),_0x1f5d8a,_0x199964['error']['message']);return _0xa3649a(_0x199964[_0xf053('0x12')][_0xf053('0x13')]);}logger[_0xf053('0x12')](_0xf053('0xf'),_0x1f5d8a,_0x199964[_0xf053('0x12')][_0xf053('0x13')]);return _0x3a9703(_0x199964[_0xf053('0x12')]['message']);}else{logger[_0xf053('0xe')](_0xf053('0xf'),_0x1f5d8a,_0xf053('0x10'));_0x3a9703(_0x199964[_0xf053('0x14')]['message']);}})[_0xf053('0x15')](function(_0x5d7a0e){logger[_0xf053('0x12')](_0xf053('0xf'),_0x1f5d8a,_0x5d7a0e);_0xa3649a(_0x5d7a0e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3ee74b3..f892460 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 _0x3728=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','post','create','update','delete','exports','util'];(function(_0x465bbf,_0x5b5c19){var _0x589967=function(_0x23b66a){while(--_0x23b66a){_0x465bbf['push'](_0x465bbf['shift']());}};_0x589967(++_0x5b5c19);}(_0x3728,0x125));var _0x8372=function(_0xc43605,_0x4c6e00){_0xc43605=_0xc43605-0x0;var _0x345837=_0x3728[_0xc43605];return _0x345837;};'use strict';var multer=require('multer');var util=require(_0x8372('0x0'));var path=require('path');var timeout=require(_0x8372('0x1'));var express=require(_0x8372('0x2'));var router=express[_0x8372('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8372('0x4'));var interaction=require(_0x8372('0x5'));var config=require('../../config/environment');var controller=require(_0x8372('0x6'));router[_0x8372('0x7')]('/',auth[_0x8372('0x8')](),controller[_0x8372('0x9')]);router[_0x8372('0x7')](_0x8372('0xa'),auth[_0x8372('0x8')](),controller[_0x8372('0xb')]);router[_0x8372('0x7')](_0x8372('0xc'),auth[_0x8372('0x8')](),controller[_0x8372('0xd')]);router['get'](_0x8372('0xe'),auth[_0x8372('0x8')](),controller[_0x8372('0xf')]);router[_0x8372('0x7')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x8372('0x10')]('/',auth[_0x8372('0x8')](),controller[_0x8372('0x11')]);router['put'](_0x8372('0xa'),auth[_0x8372('0x8')](),controller[_0x8372('0x12')]);router[_0x8372('0x13')](_0x8372('0xa'),auth[_0x8372('0x8')](),controller['destroy']);module[_0x8372('0x14')]=router; \ No newline at end of file +var _0x4b24=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports'];(function(_0x650bf0,_0x2ed946){var _0x52fe3d=function(_0x211ed3){while(--_0x211ed3){_0x650bf0['push'](_0x650bf0['shift']());}};_0x52fe3d(++_0x2ed946);}(_0x4b24,0x8a));var _0x44b2=function(_0x27fc9f,_0x35e119){_0x27fc9f=_0x27fc9f-0x0;var _0x3f7ba9=_0x4b24[_0x27fc9f];return _0x3f7ba9;};'use strict';var multer=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var path=require(_0x44b2('0x2'));var timeout=require(_0x44b2('0x3'));var express=require(_0x44b2('0x4'));var router=express['Router']();var fs_extra=require(_0x44b2('0x5'));var auth=require(_0x44b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x44b2('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0x44b2('0x8')]('/',auth['isAuthenticated'](),controller[_0x44b2('0x9')]);router[_0x44b2('0x8')](_0x44b2('0xa'),auth[_0x44b2('0xb')](),controller['show']);router[_0x44b2('0x8')](_0x44b2('0xc'),auth['isAuthenticated'](),controller[_0x44b2('0xd')]);router[_0x44b2('0x8')](_0x44b2('0xe'),auth[_0x44b2('0xb')](),controller[_0x44b2('0xf')]);router[_0x44b2('0x8')](_0x44b2('0x10'),auth[_0x44b2('0xb')](),controller[_0x44b2('0x11')]);router[_0x44b2('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x44b2('0x13')]('/:id',auth[_0x44b2('0xb')](),controller[_0x44b2('0x14')]);router[_0x44b2('0x15')](_0x44b2('0xa'),auth[_0x44b2('0xb')](),controller['destroy']);module[_0x44b2('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index eefd045..9cfb54f 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 _0x5b1a=['INTEGER','UNSIGNED','exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual'];(function(_0x730192,_0x531aed){var _0x24bd5d=function(_0x53221c){while(--_0x53221c){_0x730192['push'](_0x730192['shift']());}};_0x24bd5d(++_0x531aed);}(_0x5b1a,0x1ba));var _0xa5b1=function(_0x40fbdc,_0x47d137){_0x40fbdc=_0x40fbdc-0x0;var _0x2fe001=_0x5b1a[_0x40fbdc];return _0x2fe001;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xa5b1('0x0')]={'name':{'type':Sequelize[_0xa5b1('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xa5b1('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa5b1('0x2'),_0xa5b1('0x3'),_0xa5b1('0x4')),'allowNull':![],'defaultValue':_0xa5b1('0x2')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xa5b1('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa5b1('0x6')](_0xa5b1('0x7'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa5b1('0x8')](0xb)[_0xa5b1('0x9')]},'reportType':{'type':Sequelize[_0xa5b1('0x1')]}}; \ No newline at end of file +var _0x7ec7=['sequelize','moment','ENUM','csv','pdf','xlsx','STRING','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7ec7,0x179));var _0x77ec=function(_0x3a984b,_0x5faa80){_0x3a984b=_0x3a984b-0x0;var _0x43c353=_0x7ec7[_0x3a984b];return _0x43c353;};'use strict';var Sequelize=require(_0x77ec('0x0'));var moment=require(_0x77ec('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x77ec('0x2')](_0x77ec('0x3'),_0x77ec('0x4'),_0x77ec('0x5')),'allowNull':![],'defaultValue':_0x77ec('0x3')},'savename':{'type':Sequelize[_0x77ec('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0x77ec('0x7')]},'endDate':{'type':Sequelize[_0x77ec('0x7')]},'status':{'type':Sequelize[_0x77ec('0x6')],'defaultValue':_0x77ec('0x8')},'type':{'type':Sequelize['ENUM'](_0x77ec('0x9'),_0x77ec('0xa')),'allowNull':![],'defaultValue':_0x77ec('0x9')},'reportId':{'type':Sequelize[_0x77ec('0xb')](0xb)[_0x77ec('0xc')]},'reportType':{'type':Sequelize[_0x77ec('0x6')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8c346c2..afefbe9 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 _0x1d93=['output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','get','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','merge','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','basename','savename','existsSync','root','Sequelize','exists','download','join','server/files/reports','%s.%s'];(function(_0xf4440d,_0x422b8e){var _0x3cba50=function(_0x23f117){while(--_0x23f117){_0xf4440d['push'](_0xf4440d['shift']());}};_0x3cba50(++_0x422b8e);}(_0x1d93,0x186));var _0x31d9=function(_0x5a4a1e,_0x5f014c){_0x5a4a1e=_0x5a4a1e-0x0;var _0x13b91d=_0x1d93[_0x5a4a1e];return _0x13b91d;};'use strict';var emlformat=require(_0x31d9('0x0'));var rimraf=require(_0x31d9('0x1'));var zipdir=require(_0x31d9('0x2'));var jsonpatch=require(_0x31d9('0x3'));var rp=require(_0x31d9('0x4'));var moment=require('moment');var BPromise=require(_0x31d9('0x5'));var Mustache=require(_0x31d9('0x6'));var util=require('util');var path=require(_0x31d9('0x7'));var sox=require(_0x31d9('0x8'));var csv=require(_0x31d9('0x9'));var ejs=require(_0x31d9('0xa'));var fs=require('fs');var fs_extra=require(_0x31d9('0xb'));var _=require(_0x31d9('0xc'));var squel=require(_0x31d9('0xd'));var crypto=require(_0x31d9('0xe'));var jsforce=require(_0x31d9('0xf'));var deskjs=require(_0x31d9('0x10'));var toCsv=require(_0x31d9('0x9'));var querystring=require(_0x31d9('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x31d9('0x12'));var qs=require(_0x31d9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d9('0x14'));var logger=require('../../config/logger')(_0x31d9('0x15'));var utils=require('../../config/utils');var config=require(_0x31d9('0x16'));var licenseUtil=require(_0x31d9('0x17'));var db=require(_0x31d9('0x18'))['db'];function respondWithStatusCode(_0x47c5c2,_0x219140){_0x219140=_0x219140||0xcc;return function(_0x287939){if(_0x287939){return _0x47c5c2[_0x31d9('0x19')](_0x219140);}return _0x47c5c2[_0x31d9('0x1a')](_0x219140)[_0x31d9('0x1b')]();};}function respondWithResult(_0x145bfa,_0x38b33f){_0x38b33f=_0x38b33f||0xc8;return function(_0x3fbf63){if(_0x3fbf63){return _0x145bfa['status'](_0x38b33f)['json'](_0x3fbf63);}};}function respondWithFilteredResult(_0x26449e,_0x20a4f8){return function(_0x4188bb){if(_0x4188bb){var _0x246552=typeof _0x20a4f8[_0x31d9('0x1c')]===_0x31d9('0x1d')&&typeof _0x20a4f8['limit']===_0x31d9('0x1d');var _0x1e70b5=_0x4188bb[_0x31d9('0x1e')];var _0x36debc=_0x246552?0x0:_0x20a4f8['offset'];var _0x2f5ee1=_0x246552?_0x4188bb[_0x31d9('0x1e')]:_0x20a4f8[_0x31d9('0x1c')]+_0x20a4f8[_0x31d9('0x1f')];var _0x8048ca;if(_0x2f5ee1>=_0x1e70b5){_0x2f5ee1=_0x1e70b5;_0x8048ca=0xc8;}else{_0x8048ca=0xce;}_0x26449e['status'](_0x8048ca);return _0x26449e[_0x31d9('0x20')](_0x31d9('0x21'),_0x36debc+'-'+_0x2f5ee1+'/'+_0x1e70b5)[_0x31d9('0x22')](_0x4188bb);}return null;};}function patchUpdates(_0x47fd63){return function(_0x10b802){try{jsonpatch[_0x31d9('0x23')](_0x10b802,_0x47fd63,!![]);}catch(_0x27c718){return BPromise['reject'](_0x27c718);}return _0x10b802[_0x31d9('0x24')]();};}function saveUpdates(_0x10c5d4,_0x646fe3){return function(_0x3886f1){if(_0x3886f1){return _0x3886f1[_0x31d9('0x25')](_0x10c5d4)[_0x31d9('0x26')](function(_0x196625){return _0x196625;});}return null;};}function removeEntity(_0x24f1c7,_0x32f01f){return function(_0x4270ee){if(_0x4270ee){return _0x4270ee[_0x31d9('0x27')]()['then'](function(){var _0x113fc5=_0x4270ee[_0x31d9('0x28')]({'plain':!![]});var _0x3e90cc=_0x31d9('0x29');return db['UserProfileResource'][_0x31d9('0x27')]({'where':{'type':_0x3e90cc,'resourceId':_0x113fc5['id']}})[_0x31d9('0x26')](function(){return _0x4270ee;});})[_0x31d9('0x26')](function(){_0x24f1c7[_0x31d9('0x1a')](0xcc)[_0x31d9('0x1b')]();});}};}function handleEntityNotFound(_0x3a1873,_0x165c1d){return function(_0x5de8d2){if(!_0x5de8d2){_0x3a1873[_0x31d9('0x19')](0x194);}return _0x5de8d2;};}function handleError(_0x1f7843,_0x45138a){_0x45138a=_0x45138a||0x1f4;return function(_0x16571b){logger[_0x31d9('0x2a')](_0x16571b[_0x31d9('0x2b')]);if(_0x16571b[_0x31d9('0x2c')]){delete _0x16571b['name'];}_0x1f7843[_0x31d9('0x1a')](_0x45138a)[_0x31d9('0x2d')](_0x16571b);};}exports[_0x31d9('0x2e')]=function(_0x3da8bf,_0x308981){var _0x591b26={},_0x24a71f={},_0x223aa9={'count':0x0,'rows':[]};var _0x208a0c=_[_0x31d9('0x2f')](db[_0x31d9('0x30')]['rawAttributes'],function(_0xd6d080){return{'name':_0xd6d080[_0x31d9('0x31')],'type':_0xd6d080[_0x31d9('0x32')][_0x31d9('0x33')]};});_0x24a71f[_0x31d9('0x34')]=_[_0x31d9('0x2f')](_0x208a0c,_0x31d9('0x2c'));_0x24a71f[_0x31d9('0x35')]=_[_0x31d9('0x36')](_0x3da8bf[_0x31d9('0x35')]);_0x24a71f[_0x31d9('0x37')]=_['intersection'](_0x24a71f[_0x31d9('0x34')],_0x24a71f[_0x31d9('0x35')]);_0x591b26[_0x31d9('0x38')]=_[_0x31d9('0x39')](_0x24a71f[_0x31d9('0x34')],qs['fields'](_0x3da8bf['query'][_0x31d9('0x3a')]));_0x591b26[_0x31d9('0x38')]=_0x591b26[_0x31d9('0x38')][_0x31d9('0x3b')]?_0x591b26['attributes']:_0x24a71f[_0x31d9('0x34')];if(!_0x3da8bf[_0x31d9('0x35')]['hasOwnProperty'](_0x31d9('0x3c'))){_0x591b26[_0x31d9('0x1f')]=qs[_0x31d9('0x1f')](_0x3da8bf[_0x31d9('0x35')][_0x31d9('0x1f')]);_0x591b26['offset']=qs[_0x31d9('0x1c')](_0x3da8bf['query']['offset']);}_0x591b26[_0x31d9('0x3d')]=qs[_0x31d9('0x3e')](_0x3da8bf[_0x31d9('0x35')][_0x31d9('0x3e')]);_0x591b26[_0x31d9('0x3f')]=qs[_0x31d9('0x37')](_[_0x31d9('0x40')](_0x3da8bf[_0x31d9('0x35')],_0x24a71f['filters']),_0x208a0c);if(_0x3da8bf['query'][_0x31d9('0x41')]){_0x591b26[_0x31d9('0x3f')]=_['merge'](_0x591b26['where'],{'$or':_[_0x31d9('0x2f')](_0x208a0c,function(_0x18216c){if(_0x18216c['type']!==_0x31d9('0x42')){var _0x266f86={};_0x266f86[_0x18216c[_0x31d9('0x2c')]]={'$like':'%'+_0x3da8bf['query'][_0x31d9('0x41')]+'%'};return _0x266f86;}})});}_0x591b26=_['merge']({},_0x591b26,_0x3da8bf[_0x31d9('0x43')]);var _0x357e89={'where':_0x591b26[_0x31d9('0x3f')]};return db['AnalyticExtractedReport'][_0x31d9('0x1e')](_0x357e89)[_0x31d9('0x26')](function(_0x48b4f6){_0x223aa9[_0x31d9('0x1e')]=_0x48b4f6;if(_0x3da8bf[_0x31d9('0x35')][_0x31d9('0x44')]){_0x591b26[_0x31d9('0x45')]=[{'all':!![]}];}return db[_0x31d9('0x30')][_0x31d9('0x46')](_0x591b26);})['then'](function(_0x20040a){_0x223aa9[_0x31d9('0x47')]=_0x20040a;return _0x223aa9;})[_0x31d9('0x26')](respondWithFilteredResult(_0x308981,_0x591b26))[_0x31d9('0x48')](handleError(_0x308981,null));};exports['show']=function(_0x16513b,_0x3a179f){var _0x8d2a7={'raw':!![],'where':{'id':_0x16513b['params']['id']}},_0x3a5e30={};_0x3a5e30[_0x31d9('0x34')]=_[_0x31d9('0x36')](db[_0x31d9('0x30')][_0x31d9('0x49')]);_0x3a5e30[_0x31d9('0x35')]=_[_0x31d9('0x36')](_0x16513b[_0x31d9('0x35')]);_0x3a5e30[_0x31d9('0x37')]=_[_0x31d9('0x39')](_0x3a5e30[_0x31d9('0x34')],_0x3a5e30[_0x31d9('0x35')]);_0x8d2a7['attributes']=_[_0x31d9('0x39')](_0x3a5e30[_0x31d9('0x34')],qs[_0x31d9('0x3a')](_0x16513b['query']['fields']));_0x8d2a7['attributes']=_0x8d2a7[_0x31d9('0x38')]['length']?_0x8d2a7['attributes']:_0x3a5e30[_0x31d9('0x34')];if(_0x16513b[_0x31d9('0x35')][_0x31d9('0x44')]){_0x8d2a7['include']=[{'all':!![]}];}_0x8d2a7=_[_0x31d9('0x4a')]({},_0x8d2a7,_0x16513b[_0x31d9('0x43')]);return db[_0x31d9('0x30')][_0x31d9('0x4b')](_0x8d2a7)[_0x31d9('0x26')](handleEntityNotFound(_0x3a179f,null))[_0x31d9('0x26')](respondWithResult(_0x3a179f,null))[_0x31d9('0x48')](handleError(_0x3a179f,null));};exports[_0x31d9('0x4c')]=function(_0x6d5bef,_0x1fc3d7){return db['AnalyticExtractedReport']['create'](_0x6d5bef[_0x31d9('0x4d')],{})['then'](function(_0x1068d6){var _0x7054b=_0x6d5bef[_0x31d9('0x4e')][_0x31d9('0x28')]({'plain':!![]});if(!_0x7054b)throw new Error(_0x31d9('0x4f'));if(_0x7054b['role']==='user'){var _0x4c75c4=_0x1068d6[_0x31d9('0x28')]({'plain':!![]});var _0xc9983a='ExtractedReports';return db[_0x31d9('0x50')]['find']({'where':{'name':_0xc9983a,'userProfileId':_0x7054b[_0x31d9('0x51')]},'raw':!![]})['then'](function(_0x57b422){if(_0x57b422&&_0x57b422[_0x31d9('0x52')]===0x0){return db['UserProfileResource'][_0x31d9('0x4c')]({'name':_0x4c75c4[_0x31d9('0x2c')],'resourceId':_0x4c75c4['id'],'type':_0x57b422[_0x31d9('0x2c')],'sectionId':_0x57b422['id']},{})[_0x31d9('0x26')](function(){return _0x1068d6;});}else{return _0x1068d6;}})['catch'](function(_0x1a802d){logger[_0x31d9('0x2a')](_0x31d9('0x53'),_0x1a802d);throw _0x1a802d;});}return _0x1068d6;})[_0x31d9('0x26')](respondWithResult(_0x1fc3d7,0xc9))['catch'](handleError(_0x1fc3d7,null));};exports['update']=function(_0x449485,_0x18d650){if(_0x449485[_0x31d9('0x4d')]['id']){delete _0x449485[_0x31d9('0x4d')]['id'];}return db[_0x31d9('0x30')][_0x31d9('0x4b')]({'where':{'id':_0x449485[_0x31d9('0x54')]['id']}})['then'](handleEntityNotFound(_0x18d650,null))['then'](saveUpdates(_0x449485[_0x31d9('0x4d')],null))[_0x31d9('0x26')](respondWithResult(_0x18d650,null))[_0x31d9('0x48')](handleError(_0x18d650,null));};exports[_0x31d9('0x27')]=function(_0x5e3fcb,_0x5f5132){return db[_0x31d9('0x30')][_0x31d9('0x4b')]({'where':{'id':_0x5e3fcb[_0x31d9('0x54')]['id']}})['then'](handleEntityNotFound(_0x5f5132,null))[_0x31d9('0x26')](removeEntity(_0x5f5132,null))[_0x31d9('0x48')](handleError(_0x5f5132,null));};exports['download']=function(_0x265bf8,_0x159947,_0x31f4d7){return db[_0x31d9('0x30')][_0x31d9('0x4b')]({'where':{'id':_0x265bf8[_0x31d9('0x54')]['id']},'attributes':['name',_0x31d9('0x55'),_0x31d9('0x56'),'output'],'raw':!![]})[_0x31d9('0x26')](handleEntityNotFound(_0x159947,null))[_0x31d9('0x26')](function(_0x24fb7f){if(_0x24fb7f){if(!fs[_0x31d9('0x57')](path['join'](config[_0x31d9('0x58')],'server/files/reports',_0x24fb7f[_0x31d9('0x56')]))){throw new db[(_0x31d9('0x59'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x265bf8['query'][_0x31d9('0x5a')]){return _0x159947[_0x31d9('0x19')](0xc8);}return _0x159947[_0x31d9('0x5b')](path[_0x31d9('0x5c')](config['root'],_0x31d9('0x5d'),_0x24fb7f[_0x31d9('0x56')]),util['format'](_0x31d9('0x5e'),_0x24fb7f[_0x31d9('0x55')]||_0x24fb7f[_0x31d9('0x2c')],_0x24fb7f[_0x31d9('0x5f')][_0x31d9('0x60')]()));}})[_0x31d9('0x48')](handleError(_0x159947,null));}; \ No newline at end of file +var _0x1d21=['%s.%s','output','toLowerCase','eml-format','rimraf','bluebird','mustache','util','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','params','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x1d21,0x183));var _0x11d2=function(_0x4fda88,_0x1a4d19){_0x4fda88=_0x4fda88-0x0;var _0xe37511=_0x1d21[_0x4fda88];return _0xe37511;};'use strict';var emlformat=require(_0x11d2('0x0'));var rimraf=require(_0x11d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x11d2('0x2'));var Mustache=require(_0x11d2('0x3'));var util=require(_0x11d2('0x4'));var path=require('path');var sox=require(_0x11d2('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11d2('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x11d2('0x7'));var deskjs=require(_0x11d2('0x8'));var toCsv=require(_0x11d2('0x9'));var querystring=require(_0x11d2('0xa'));var Papa=require(_0x11d2('0xb'));var Redis=require(_0x11d2('0xc'));var authService=require(_0x11d2('0xd'));var qs=require(_0x11d2('0xe'));var as=require(_0x11d2('0xf'));var hardwareService=require(_0x11d2('0x10'));var logger=require(_0x11d2('0x11'))(_0x11d2('0x12'));var utils=require(_0x11d2('0x13'));var config=require(_0x11d2('0x14'));var licenseUtil=require(_0x11d2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68a223,_0x58e7ca){_0x58e7ca=_0x58e7ca||0xcc;return function(_0x3a7be8){if(_0x3a7be8){return _0x68a223[_0x11d2('0x16')](_0x58e7ca);}return _0x68a223[_0x11d2('0x17')](_0x58e7ca)[_0x11d2('0x18')]();};}function respondWithResult(_0xb1b974,_0x517b97){_0x517b97=_0x517b97||0xc8;return function(_0x28051c){if(_0x28051c){return _0xb1b974['status'](_0x517b97)[_0x11d2('0x19')](_0x28051c);}};}function respondWithFilteredResult(_0x2db220,_0x2d0f03){return function(_0x12ea14){if(_0x12ea14){var _0x1a1718=typeof _0x2d0f03['offset']==='undefined'&&typeof _0x2d0f03[_0x11d2('0x1a')]===_0x11d2('0x1b');var _0x1c1a64=_0x12ea14[_0x11d2('0x1c')];var _0x3309e1=_0x1a1718?0x0:_0x2d0f03[_0x11d2('0x1d')];var _0xb5e312=_0x1a1718?_0x12ea14['count']:_0x2d0f03[_0x11d2('0x1d')]+_0x2d0f03[_0x11d2('0x1a')];var _0x567677;if(_0xb5e312>=_0x1c1a64){_0xb5e312=_0x1c1a64;_0x567677=0xc8;}else{_0x567677=0xce;}_0x2db220['status'](_0x567677);return _0x2db220[_0x11d2('0x1e')](_0x11d2('0x1f'),_0x3309e1+'-'+_0xb5e312+'/'+_0x1c1a64)[_0x11d2('0x19')](_0x12ea14);}return null;};}function patchUpdates(_0x45ddd1){return function(_0x3a7afc){try{jsonpatch[_0x11d2('0x20')](_0x3a7afc,_0x45ddd1,!![]);}catch(_0x1bfbbf){return BPromise[_0x11d2('0x21')](_0x1bfbbf);}return _0x3a7afc[_0x11d2('0x22')]();};}function saveUpdates(_0x59a623,_0x395e1e){return function(_0x2da4ee){if(_0x2da4ee){return _0x2da4ee['update'](_0x59a623)[_0x11d2('0x23')](function(_0x1a90ea){return _0x1a90ea;});}return null;};}function removeEntity(_0x928303,_0x3b0434){return function(_0x5dad9f){if(_0x5dad9f){return _0x5dad9f[_0x11d2('0x24')]()[_0x11d2('0x23')](function(){var _0x363179=_0x5dad9f[_0x11d2('0x25')]({'plain':!![]});var _0x99b72b=_0x11d2('0x26');return db[_0x11d2('0x27')]['destroy']({'where':{'type':_0x99b72b,'resourceId':_0x363179['id']}})[_0x11d2('0x23')](function(){return _0x5dad9f;});})['then'](function(){_0x928303['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e513,_0x1dedce){return function(_0x33ef1c){if(!_0x33ef1c){_0x48e513[_0x11d2('0x16')](0x194);}return _0x33ef1c;};}function handleError(_0x579ebc,_0x283ef2){_0x283ef2=_0x283ef2||0x1f4;return function(_0xf3f1ba){logger[_0x11d2('0x28')](_0xf3f1ba[_0x11d2('0x29')]);if(_0xf3f1ba[_0x11d2('0x2a')]){delete _0xf3f1ba[_0x11d2('0x2a')];}_0x579ebc[_0x11d2('0x17')](_0x283ef2)[_0x11d2('0x2b')](_0xf3f1ba);};}exports[_0x11d2('0x2c')]=function(_0x292fdd,_0x34a9b5){var _0x4004b1={},_0x3b5aa6={},_0x1b4917={'count':0x0,'rows':[]};var _0x56949b=_[_0x11d2('0x2d')](db[_0x11d2('0x2e')][_0x11d2('0x2f')],function(_0x86213c){return{'name':_0x86213c[_0x11d2('0x30')],'type':_0x86213c[_0x11d2('0x31')][_0x11d2('0x32')]};});_0x3b5aa6[_0x11d2('0x33')]=_['map'](_0x56949b,_0x11d2('0x2a'));_0x3b5aa6[_0x11d2('0x34')]=_['keys'](_0x292fdd[_0x11d2('0x34')]);_0x3b5aa6[_0x11d2('0x35')]=_['intersection'](_0x3b5aa6['model'],_0x3b5aa6[_0x11d2('0x34')]);_0x4004b1[_0x11d2('0x36')]=_[_0x11d2('0x37')](_0x3b5aa6[_0x11d2('0x33')],qs[_0x11d2('0x38')](_0x292fdd[_0x11d2('0x34')][_0x11d2('0x38')]));_0x4004b1[_0x11d2('0x36')]=_0x4004b1[_0x11d2('0x36')]['length']?_0x4004b1[_0x11d2('0x36')]:_0x3b5aa6[_0x11d2('0x33')];if(!_0x292fdd[_0x11d2('0x34')][_0x11d2('0x39')](_0x11d2('0x3a'))){_0x4004b1['limit']=qs[_0x11d2('0x1a')](_0x292fdd[_0x11d2('0x34')][_0x11d2('0x1a')]);_0x4004b1['offset']=qs[_0x11d2('0x1d')](_0x292fdd[_0x11d2('0x34')][_0x11d2('0x1d')]);}_0x4004b1['order']=qs['sort'](_0x292fdd[_0x11d2('0x34')]['sort']);_0x4004b1['where']=qs[_0x11d2('0x35')](_[_0x11d2('0x3b')](_0x292fdd[_0x11d2('0x34')],_0x3b5aa6['filters']),_0x56949b);if(_0x292fdd['query'][_0x11d2('0x3c')]){_0x4004b1[_0x11d2('0x3d')]=_[_0x11d2('0x3e')](_0x4004b1[_0x11d2('0x3d')],{'$or':_[_0x11d2('0x2d')](_0x56949b,function(_0x230bee){if(_0x230bee['type']!==_0x11d2('0x3f')){var _0x57b898={};_0x57b898[_0x230bee[_0x11d2('0x2a')]]={'$like':'%'+_0x292fdd['query'][_0x11d2('0x3c')]+'%'};return _0x57b898;}})});}_0x4004b1=_[_0x11d2('0x3e')]({},_0x4004b1,_0x292fdd['options']);var _0xe17eb1={'where':_0x4004b1['where']};return db[_0x11d2('0x2e')][_0x11d2('0x1c')](_0xe17eb1)[_0x11d2('0x23')](function(_0x97dc95){_0x1b4917[_0x11d2('0x1c')]=_0x97dc95;if(_0x292fdd['query']['includeAll']){_0x4004b1[_0x11d2('0x40')]=[{'all':!![]}];}return db[_0x11d2('0x2e')][_0x11d2('0x41')](_0x4004b1);})[_0x11d2('0x23')](function(_0x1d6aa1){_0x1b4917[_0x11d2('0x42')]=_0x1d6aa1;return _0x1b4917;})[_0x11d2('0x23')](respondWithFilteredResult(_0x34a9b5,_0x4004b1))[_0x11d2('0x43')](handleError(_0x34a9b5,null));};exports[_0x11d2('0x44')]=function(_0x46a0f6,_0x240cfa){var _0x2431f2={'raw':!![],'where':{'id':_0x46a0f6['params']['id']}},_0x28862c={};_0x28862c[_0x11d2('0x33')]=_[_0x11d2('0x45')](db[_0x11d2('0x2e')]['rawAttributes']);_0x28862c[_0x11d2('0x34')]=_[_0x11d2('0x45')](_0x46a0f6[_0x11d2('0x34')]);_0x28862c[_0x11d2('0x35')]=_[_0x11d2('0x37')](_0x28862c[_0x11d2('0x33')],_0x28862c[_0x11d2('0x34')]);_0x2431f2[_0x11d2('0x36')]=_[_0x11d2('0x37')](_0x28862c['model'],qs[_0x11d2('0x38')](_0x46a0f6[_0x11d2('0x34')]['fields']));_0x2431f2[_0x11d2('0x36')]=_0x2431f2[_0x11d2('0x36')][_0x11d2('0x46')]?_0x2431f2[_0x11d2('0x36')]:_0x28862c[_0x11d2('0x33')];if(_0x46a0f6[_0x11d2('0x34')]['includeAll']){_0x2431f2[_0x11d2('0x40')]=[{'all':!![]}];}_0x2431f2=_[_0x11d2('0x3e')]({},_0x2431f2,_0x46a0f6['options']);return db[_0x11d2('0x2e')][_0x11d2('0x47')](_0x2431f2)['then'](handleEntityNotFound(_0x240cfa,null))['then'](respondWithResult(_0x240cfa,null))['catch'](handleError(_0x240cfa,null));};exports[_0x11d2('0x48')]=function(_0x421609,_0x2ff2f0){return db[_0x11d2('0x2e')]['create'](_0x421609[_0x11d2('0x49')],{})[_0x11d2('0x23')](function(_0xea86a6){var _0x5e4b71=_0x421609[_0x11d2('0x4a')]['get']({'plain':!![]});if(!_0x5e4b71)throw new Error(_0x11d2('0x4b'));if(_0x5e4b71[_0x11d2('0x4c')]===_0x11d2('0x4a')){var _0x55fc34=_0xea86a6[_0x11d2('0x25')]({'plain':!![]});var _0x79f358=_0x11d2('0x26');return db[_0x11d2('0x4d')][_0x11d2('0x47')]({'where':{'name':_0x79f358,'userProfileId':_0x5e4b71[_0x11d2('0x4e')]},'raw':!![]})[_0x11d2('0x23')](function(_0x2d876f){if(_0x2d876f&&_0x2d876f['autoAssociation']===0x0){return db['UserProfileResource'][_0x11d2('0x48')]({'name':_0x55fc34['name'],'resourceId':_0x55fc34['id'],'type':_0x2d876f[_0x11d2('0x2a')],'sectionId':_0x2d876f['id']},{})[_0x11d2('0x23')](function(){return _0xea86a6;});}else{return _0xea86a6;}})['catch'](function(_0x1a74d){logger[_0x11d2('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a74d);throw _0x1a74d;});}return _0xea86a6;})['then'](respondWithResult(_0x2ff2f0,0xc9))['catch'](handleError(_0x2ff2f0,null));};exports[_0x11d2('0x4f')]=function(_0x11121b,_0x101b42){if(_0x11121b[_0x11d2('0x49')]['id']){delete _0x11121b[_0x11d2('0x49')]['id'];}return db['AnalyticExtractedReport'][_0x11d2('0x47')]({'where':{'id':_0x11121b['params']['id']}})['then'](handleEntityNotFound(_0x101b42,null))['then'](saveUpdates(_0x11121b['body'],null))[_0x11d2('0x23')](respondWithResult(_0x101b42,null))[_0x11d2('0x43')](handleError(_0x101b42,null));};exports[_0x11d2('0x24')]=function(_0x96809c,_0x10e658){return db[_0x11d2('0x2e')]['find']({'where':{'id':_0x96809c[_0x11d2('0x50')]['id']}})[_0x11d2('0x23')](handleEntityNotFound(_0x10e658,null))[_0x11d2('0x23')](removeEntity(_0x10e658,null))['catch'](handleError(_0x10e658,null));};exports[_0x11d2('0x51')]=function(_0x30bb28,_0x25d2c3,_0x57be51){return db[_0x11d2('0x2e')][_0x11d2('0x47')]({'where':{'id':_0x30bb28[_0x11d2('0x50')]['id']},'attributes':[_0x11d2('0x2a'),_0x11d2('0x52'),_0x11d2('0x53'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x25d2c3,null))[_0x11d2('0x23')](function(_0x5effad){if(_0x5effad){if(!fs[_0x11d2('0x54')](path[_0x11d2('0x55')](config[_0x11d2('0x56')],_0x11d2('0x57'),_0x5effad[_0x11d2('0x53')]))){throw new db[(_0x11d2('0x58'))][(_0x11d2('0x59'))](_0x11d2('0x5a'));}if(_0x30bb28['query'][_0x11d2('0x5b')]){return _0x25d2c3[_0x11d2('0x16')](0xc8);}return _0x25d2c3['download'](path['join'](config[_0x11d2('0x56')],'server/files/reports',_0x5effad[_0x11d2('0x53')]),util[_0x11d2('0x5c')](_0x11d2('0x5d'),_0x5effad[_0x11d2('0x52')]||_0x5effad[_0x11d2('0x2a')],_0x5effad[_0x11d2('0x5e')][_0x11d2('0x5f')]()));}})[_0x11d2('0x43')](handleError(_0x25d2c3,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2cd8795..7f9ac70 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 _0x6478=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6478,0x18d));var _0x8647=function(_0x385d89,_0x2fe099){_0x385d89=_0x385d89-0x0;var _0x1454e8=_0x6478[_0x385d89];return _0x1454e8;};'use strict';var _=require('lodash');var util=require(_0x8647('0x0'));var logger=require(_0x8647('0x1'))(_0x8647('0x2'));var moment=require(_0x8647('0x3'));var BPromise=require(_0x8647('0x4'));var rp=require(_0x8647('0x5'));var fs=require('fs');var path=require(_0x8647('0x6'));var rimraf=require(_0x8647('0x7'));var config=require(_0x8647('0x8'));var attributes=require(_0x8647('0x9'));module[_0x8647('0xa')]=function(_0x3c94d4,_0x31609e){return _0x3c94d4[_0x8647('0xb')](_0x8647('0xc'),attributes,{'tableName':_0x8647('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab0a=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xab0a,0x162));var _0xaab0=function(_0x13e315,_0x555f7a){_0x13e315=_0x13e315-0x0;var _0xd89be6=_0xab0a[_0x13e315];return _0xd89be6;};'use strict';var _=require(_0xaab0('0x0'));var util=require(_0xaab0('0x1'));var logger=require(_0xaab0('0x2'))(_0xaab0('0x3'));var moment=require(_0xaab0('0x4'));var BPromise=require(_0xaab0('0x5'));var rp=require(_0xaab0('0x6'));var fs=require('fs');var path=require(_0xaab0('0x7'));var rimraf=require('rimraf');var config=require(_0xaab0('0x8'));var attributes=require(_0xaab0('0x9'));module[_0xaab0('0xa')]=function(_0x25f2df,_0x49b881){return _0x25f2df[_0xaab0('0xb')](_0xaab0('0xc'),attributes,{'tableName':_0xaab0('0xd'),'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 affd4f3..43b9e24 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 _0x28b0=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x560af4,_0x2246e8){var _0x423b35=function(_0x72dd3e){while(--_0x72dd3e){_0x560af4['push'](_0x560af4['shift']());}};_0x423b35(++_0x2246e8);}(_0x28b0,0x174));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x028b('0x0'));var moment=require(_0x028b('0x1'));var BPromise=require(_0x028b('0x2'));var rs=require(_0x028b('0x3'));var fs=require('fs');var Redis=require(_0x028b('0x4'));var db=require(_0x028b('0x5'))['db'];var utils=require(_0x028b('0x6'));var logger=require(_0x028b('0x7'))(_0x028b('0x8'));var config=require(_0x028b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x028b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe6ffb9,_0x928f9e,_0x3b6c4c){return new BPromise(function(_0x17eabc,_0x502c72){return client['request'](_0xe6ffb9,_0x3b6c4c)[_0x028b('0xb')](function(_0x521b03){logger[_0x028b('0xc')](_0x028b('0xd'),_0x928f9e,_0x028b('0xe'));logger[_0x028b('0xf')](_0x028b('0x10'),_0x928f9e,_0x028b('0xe'),JSON[_0x028b('0x11')](_0x521b03));if(_0x521b03[_0x028b('0x12')]){if(_0x521b03['error'][_0x028b('0x13')]===0x1f4){logger[_0x028b('0x12')](_0x028b('0xd'),_0x928f9e,_0x521b03[_0x028b('0x12')]['message']);return _0x502c72(_0x521b03[_0x028b('0x12')][_0x028b('0x14')]);}logger[_0x028b('0x12')](_0x028b('0xd'),_0x928f9e,_0x521b03[_0x028b('0x12')][_0x028b('0x14')]);return _0x17eabc(_0x521b03[_0x028b('0x12')]['message']);}else{logger[_0x028b('0xc')](_0x028b('0xd'),_0x928f9e,'request\x20sent');_0x17eabc(_0x521b03[_0x028b('0x15')]['message']);}})[_0x028b('0x16')](function(_0x4ca9ff){logger['error'](_0x028b('0xd'),_0x928f9e,_0x4ca9ff);_0x502c72(_0x4ca9ff);});});} \ No newline at end of file +var _0x2c5d=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x259863,_0x186992){var _0x5de13a=function(_0x4b37b7){while(--_0x4b37b7){_0x259863['push'](_0x259863['shift']());}};_0x5de13a(++_0x186992);}(_0x2c5d,0x133));var _0xd2c5=function(_0x4073da,_0x25c58a){_0x4073da=_0x4073da-0x0;var _0x1a34f4=_0x2c5d[_0x4073da];return _0x1a34f4;};'use strict';var _=require(_0xd2c5('0x0'));var util=require('util');var moment=require(_0xd2c5('0x1'));var BPromise=require('bluebird');var rs=require(_0xd2c5('0x2'));var fs=require('fs');var Redis=require(_0xd2c5('0x3'));var db=require(_0xd2c5('0x4'))['db'];var utils=require(_0xd2c5('0x5'));var logger=require(_0xd2c5('0x6'))('rpc');var config=require(_0xd2c5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd2c5('0x8')][_0xd2c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20dd1b,_0xc266ce,_0x8f040d){return new BPromise(function(_0x5e1214,_0x116d29){return client['request'](_0x20dd1b,_0x8f040d)['then'](function(_0x1a74ce){logger[_0xd2c5('0xa')](_0xd2c5('0xb'),_0xc266ce,_0xd2c5('0xc'));logger[_0xd2c5('0xd')](_0xd2c5('0xe'),_0xc266ce,'request\x20sent',JSON[_0xd2c5('0xf')](_0x1a74ce));if(_0x1a74ce[_0xd2c5('0x10')]){if(_0x1a74ce[_0xd2c5('0x10')]['code']===0x1f4){logger['error'](_0xd2c5('0xb'),_0xc266ce,_0x1a74ce[_0xd2c5('0x10')][_0xd2c5('0x11')]);return _0x116d29(_0x1a74ce[_0xd2c5('0x10')][_0xd2c5('0x11')]);}logger['error'](_0xd2c5('0xb'),_0xc266ce,_0x1a74ce['error'][_0xd2c5('0x11')]);return _0x5e1214(_0x1a74ce[_0xd2c5('0x10')][_0xd2c5('0x11')]);}else{logger[_0xd2c5('0xa')](_0xd2c5('0xb'),_0xc266ce,'request\x20sent');_0x5e1214(_0x1a74ce[_0xd2c5('0x12')][_0xd2c5('0x11')]);}})[_0xd2c5('0x13')](function(_0x270577){logger[_0xd2c5('0x10')](_0xd2c5('0xb'),_0xc266ce,_0x270577);_0x116d29(_0x270577);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e7397b0..75e64ec 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 _0x3cb9=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','download','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x21964e,_0x3838a1){var _0x3ae92e=function(_0x61e7f4){while(--_0x61e7f4){_0x21964e['push'](_0x21964e['shift']());}};_0x3ae92e(++_0x3838a1);}(_0x3cb9,0x90));var _0x93cb=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x3cb9[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x93cb('0x0'));var util=require(_0x93cb('0x1'));var path=require(_0x93cb('0x2'));var timeout=require(_0x93cb('0x3'));var express=require(_0x93cb('0x4'));var router=express[_0x93cb('0x5')]();var fs_extra=require(_0x93cb('0x6'));var auth=require(_0x93cb('0x7'));var interaction=require(_0x93cb('0x8'));var config=require(_0x93cb('0x9'));var controller=require(_0x93cb('0xa'));router['get']('/',auth[_0x93cb('0xb')](),controller['index']);router['get']('/:id',auth[_0x93cb('0xb')](),controller['show']);router[_0x93cb('0xc')]('/:id/download',auth['isAuthenticated'](),controller[_0x93cb('0xd')]);router['post']('/',auth[_0x93cb('0xb')](),controller[_0x93cb('0xe')]);router[_0x93cb('0xf')](_0x93cb('0x10'),auth[_0x93cb('0xb')](),controller[_0x93cb('0x11')]);router['delete'](_0x93cb('0x10'),auth[_0x93cb('0xb')](),controller['destroy']);module[_0x93cb('0x12')]=router; \ No newline at end of file +var _0xa7b8=['index','show','get','download','post','put','/:id','update','delete','exports','multer','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated'];(function(_0x5b8f57,_0x251cc0){var _0x40f1a1=function(_0x5777c9){while(--_0x5777c9){_0x5b8f57['push'](_0x5b8f57['shift']());}};_0x40f1a1(++_0x251cc0);}(_0xa7b8,0x1ba));var _0x8a7b=function(_0x54116b,_0x47faff){_0x54116b=_0x54116b-0x0;var _0xdd4a9a=_0xa7b8[_0x54116b];return _0xdd4a9a;};'use strict';var multer=require(_0x8a7b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8a7b('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x8a7b('0x2'));var interaction=require(_0x8a7b('0x3'));var config=require('../../config/environment');var controller=require(_0x8a7b('0x4'));router['get']('/',auth[_0x8a7b('0x5')](),controller[_0x8a7b('0x6')]);router['get']('/:id',auth[_0x8a7b('0x5')](),controller[_0x8a7b('0x7')]);router[_0x8a7b('0x8')]('/:id/download',auth[_0x8a7b('0x5')](),controller[_0x8a7b('0x9')]);router[_0x8a7b('0xa')]('/',auth[_0x8a7b('0x5')](),controller['create']);router[_0x8a7b('0xb')](_0x8a7b('0xc'),auth['isAuthenticated'](),controller[_0x8a7b('0xd')]);router[_0x8a7b('0xe')](_0x8a7b('0xc'),auth[_0x8a7b('0x5')](),controller['destroy']);module[_0x8a7b('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index ede1656..db34c0b 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 _0x30fd=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1c2ad3,_0x1105eb){var _0x383430=function(_0xdb15f){while(--_0xdb15f){_0x1c2ad3['push'](_0x1c2ad3['shift']());}};_0x383430(++_0x1105eb);}(_0x30fd,0x7d));var _0xd30f=function(_0x10316b,_0x26e5f1){_0x10316b=_0x10316b-0x0;var _0x54a5c3=_0x30fd[_0x10316b];return _0x54a5c3;};'use strict';var Sequelize=require(_0xd30f('0x0'));module[_0xd30f('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd30f('0x2')]},'format':{'type':Sequelize[_0xd30f('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd30f('0x2')]},'custom':{'type':Sequelize[_0xd30f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc474=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x5bacc9,_0x44f9c3){var _0x3c7e9d=function(_0x671408){while(--_0x671408){_0x5bacc9['push'](_0x5bacc9['shift']());}};_0x3c7e9d(++_0x44f9c3);}(_0xc474,0x67));var _0x4c47=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xc474[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x4c47('0x0'));module['exports']={'field':{'type':Sequelize[_0x4c47('0x1')]},'alias':{'type':Sequelize[_0x4c47('0x2')]},'function':{'type':Sequelize[_0x4c47('0x2')]},'format':{'type':Sequelize[_0x4c47('0x2')]},'groupBy':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 868f69b..9dd3090 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 _0xce5a=['lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','save','destroy','then','error','stack','name','map','AnalyticFieldReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','bulkCreate','update','params','bulkDestroy','addFields','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x18c479,_0x4b3e34){var _0x17ac7f=function(_0x250f9c){while(--_0x250f9c){_0x18c479['push'](_0x18c479['shift']());}};_0x17ac7f(++_0x4b3e34);}(_0xce5a,0x93));var _0xace5=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0xce5a[_0x28014d];return _0x2572cc;};'use strict';var emlformat=require(_0xace5('0x0'));var rimraf=require(_0xace5('0x1'));var zipdir=require(_0xace5('0x2'));var jsonpatch=require(_0xace5('0x3'));var rp=require(_0xace5('0x4'));var moment=require('moment');var BPromise=require(_0xace5('0x5'));var Mustache=require(_0xace5('0x6'));var util=require(_0xace5('0x7'));var path=require(_0xace5('0x8'));var sox=require(_0xace5('0x9'));var csv=require(_0xace5('0xa'));var ejs=require(_0xace5('0xb'));var fs=require('fs');var fs_extra=require(_0xace5('0xc'));var _=require(_0xace5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xace5('0xe'));var deskjs=require(_0xace5('0xf'));var toCsv=require(_0xace5('0xa'));var querystring=require(_0xace5('0x10'));var Papa=require('papaparse');var Redis=require(_0xace5('0x11'));var authService=require(_0xace5('0x12'));var qs=require(_0xace5('0x13'));var as=require(_0xace5('0x14'));var hardwareService=require(_0xace5('0x15'));var logger=require(_0xace5('0x16'))(_0xace5('0x17'));var utils=require(_0xace5('0x18'));var config=require(_0xace5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xace5('0x1a'))['db'];function respondWithStatusCode(_0x3eaf7e,_0x1cf740){_0x1cf740=_0x1cf740||0xcc;return function(_0x510cac){if(_0x510cac){return _0x3eaf7e[_0xace5('0x1b')](_0x1cf740);}return _0x3eaf7e[_0xace5('0x1c')](_0x1cf740)[_0xace5('0x1d')]();};}function respondWithResult(_0x5a8d45,_0x2fffb0){_0x2fffb0=_0x2fffb0||0xc8;return function(_0x1f32a7){if(_0x1f32a7){return _0x5a8d45[_0xace5('0x1c')](_0x2fffb0)['json'](_0x1f32a7);}};}function respondWithFilteredResult(_0x3b02ed,_0x556c36){return function(_0x7fde19){if(_0x7fde19){var _0xf9198f=typeof _0x556c36['offset']===_0xace5('0x1e')&&typeof _0x556c36['limit']==='undefined';var _0x494e70=_0x7fde19['count'];var _0x39f7df=_0xf9198f?0x0:_0x556c36[_0xace5('0x1f')];var _0x5360cd=_0xf9198f?_0x7fde19[_0xace5('0x20')]:_0x556c36['offset']+_0x556c36[_0xace5('0x21')];var _0x480209;if(_0x5360cd>=_0x494e70){_0x5360cd=_0x494e70;_0x480209=0xc8;}else{_0x480209=0xce;}_0x3b02ed[_0xace5('0x1c')](_0x480209);return _0x3b02ed[_0xace5('0x22')](_0xace5('0x23'),_0x39f7df+'-'+_0x5360cd+'/'+_0x494e70)[_0xace5('0x24')](_0x7fde19);}return null;};}function patchUpdates(_0x4ace4d){return function(_0x12ca71){try{jsonpatch[_0xace5('0x25')](_0x12ca71,_0x4ace4d,!![]);}catch(_0x4a4a41){return BPromise['reject'](_0x4a4a41);}return _0x12ca71[_0xace5('0x26')]();};}function saveUpdates(_0x4b25f5,_0x419a3f){return function(_0x556171){if(_0x556171){return _0x556171['update'](_0x4b25f5)['then'](function(_0x3548bb){return _0x3548bb;});}return null;};}function removeEntity(_0xba7e24,_0x4d5ec5){return function(_0x2c29f8){if(_0x2c29f8){return _0x2c29f8[_0xace5('0x27')]()[_0xace5('0x28')](function(){_0xba7e24['status'](0xcc)[_0xace5('0x1d')]();});}};}function handleEntityNotFound(_0x1589c5,_0x446f5a){return function(_0x5acdc6){if(!_0x5acdc6){_0x1589c5[_0xace5('0x1b')](0x194);}return _0x5acdc6;};}function handleError(_0x5d26fa,_0x238631){_0x238631=_0x238631||0x1f4;return function(_0x2b83eb){logger[_0xace5('0x29')](_0x2b83eb[_0xace5('0x2a')]);if(_0x2b83eb[_0xace5('0x2b')]){delete _0x2b83eb[_0xace5('0x2b')];}_0x5d26fa[_0xace5('0x1c')](_0x238631)['send'](_0x2b83eb);};}exports['index']=function(_0x6eeb12,_0x319517){var _0x35b8cc={},_0x457f15={},_0x46bcd7={'count':0x0,'rows':[]};var _0x7f87f7=_[_0xace5('0x2c')](db[_0xace5('0x2d')]['rawAttributes'],function(_0x1d65ea){return{'name':_0x1d65ea[_0xace5('0x2e')],'type':_0x1d65ea['type'][_0xace5('0x2f')]};});_0x457f15[_0xace5('0x30')]=_[_0xace5('0x2c')](_0x7f87f7,_0xace5('0x2b'));_0x457f15[_0xace5('0x31')]=_[_0xace5('0x32')](_0x6eeb12[_0xace5('0x31')]);_0x457f15[_0xace5('0x33')]=_[_0xace5('0x34')](_0x457f15[_0xace5('0x30')],_0x457f15['query']);_0x35b8cc[_0xace5('0x35')]=_[_0xace5('0x34')](_0x457f15['model'],qs[_0xace5('0x36')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x36')]));_0x35b8cc[_0xace5('0x35')]=_0x35b8cc[_0xace5('0x35')][_0xace5('0x37')]?_0x35b8cc[_0xace5('0x35')]:_0x457f15['model'];if(!_0x6eeb12[_0xace5('0x31')][_0xace5('0x38')](_0xace5('0x39'))){_0x35b8cc[_0xace5('0x21')]=qs[_0xace5('0x21')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x21')]);_0x35b8cc[_0xace5('0x1f')]=qs[_0xace5('0x1f')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x1f')]);}_0x35b8cc[_0xace5('0x3a')]=qs[_0xace5('0x3b')](_0x6eeb12[_0xace5('0x31')][_0xace5('0x3b')]);_0x35b8cc[_0xace5('0x3c')]=qs[_0xace5('0x33')](_['pick'](_0x6eeb12[_0xace5('0x31')],_0x457f15[_0xace5('0x33')]),_0x7f87f7);if(_0x6eeb12[_0xace5('0x31')][_0xace5('0x3d')]){_0x35b8cc[_0xace5('0x3c')]=_[_0xace5('0x3e')](_0x35b8cc[_0xace5('0x3c')],{'$or':_[_0xace5('0x2c')](_0x7f87f7,function(_0x9f4eb0){if(_0x9f4eb0['type']!==_0xace5('0x3f')){var _0x221312={};_0x221312[_0x9f4eb0['name']]={'$like':'%'+_0x6eeb12[_0xace5('0x31')][_0xace5('0x3d')]+'%'};return _0x221312;}})});}_0x35b8cc=_['merge']({},_0x35b8cc,_0x6eeb12[_0xace5('0x40')]);var _0x4acff8={'where':_0x35b8cc[_0xace5('0x3c')]};return db[_0xace5('0x2d')][_0xace5('0x20')](_0x4acff8)['then'](function(_0xdefbc7){_0x46bcd7['count']=_0xdefbc7;if(_0x6eeb12['query'][_0xace5('0x41')]){_0x35b8cc[_0xace5('0x42')]=[{'all':!![]}];}return db[_0xace5('0x2d')][_0xace5('0x43')](_0x35b8cc);})[_0xace5('0x28')](function(_0x45c1f8){_0x46bcd7['rows']=_0x45c1f8;return _0x46bcd7;})[_0xace5('0x28')](respondWithFilteredResult(_0x319517,_0x35b8cc))[_0xace5('0x44')](handleError(_0x319517,null));};exports[_0xace5('0x45')]=function(_0x2fe410,_0x2f79a6){var _0x505c79={'raw':![],'where':{'id':_0x2fe410['params']['id']}},_0x3ca6fb={};_0x3ca6fb[_0xace5('0x30')]=_[_0xace5('0x32')](db[_0xace5('0x2d')][_0xace5('0x46')]);_0x3ca6fb[_0xace5('0x31')]=_[_0xace5('0x32')](_0x2fe410[_0xace5('0x31')]);_0x3ca6fb[_0xace5('0x33')]=_[_0xace5('0x34')](_0x3ca6fb['model'],_0x3ca6fb['query']);_0x505c79[_0xace5('0x35')]=_[_0xace5('0x34')](_0x3ca6fb[_0xace5('0x30')],qs[_0xace5('0x36')](_0x2fe410[_0xace5('0x31')][_0xace5('0x36')]));_0x505c79[_0xace5('0x35')]=_0x505c79[_0xace5('0x35')][_0xace5('0x37')]?_0x505c79['attributes']:_0x3ca6fb['model'];if(_0x2fe410[_0xace5('0x31')][_0xace5('0x41')]){_0x505c79[_0xace5('0x42')]=[{'all':!![]}];}_0x505c79=_[_0xace5('0x3e')]({},_0x505c79,_0x2fe410[_0xace5('0x40')]);return db[_0xace5('0x2d')][_0xace5('0x47')](_0x505c79)[_0xace5('0x28')](handleEntityNotFound(_0x2f79a6,null))[_0xace5('0x28')](respondWithResult(_0x2f79a6,null))[_0xace5('0x44')](handleError(_0x2f79a6,null));};exports[_0xace5('0x48')]=function(_0x359af9,_0x5c1269){return db[_0xace5('0x2d')][_0xace5('0x48')](_0x359af9[_0xace5('0x49')],{})[_0xace5('0x28')](respondWithResult(_0x5c1269,0xc9))[_0xace5('0x44')](handleError(_0x5c1269,null));};exports[_0xace5('0x4a')]=function(_0x16c7e4,_0x10d80b){return db[_0xace5('0x2d')]['bulkCreate'](_0x16c7e4['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x10d80b,0xc9))['catch'](handleError(_0x10d80b,null));};exports[_0xace5('0x4b')]=function(_0x135181,_0x29d9ba){if(_0x135181[_0xace5('0x49')]['id']){delete _0x135181['body']['id'];}return db[_0xace5('0x2d')][_0xace5('0x47')]({'where':{'id':_0x135181[_0xace5('0x4c')]['id']}})[_0xace5('0x28')](handleEntityNotFound(_0x29d9ba,null))[_0xace5('0x28')](saveUpdates(_0x135181['body'],null))[_0xace5('0x28')](respondWithResult(_0x29d9ba,null))[_0xace5('0x44')](handleError(_0x29d9ba,null));};exports[_0xace5('0x27')]=function(_0x2735a1,_0x5b11ba){return db[_0xace5('0x2d')]['find']({'where':{'id':_0x2735a1['params']['id']}})[_0xace5('0x28')](handleEntityNotFound(_0x5b11ba,null))[_0xace5('0x28')](removeEntity(_0x5b11ba,null))[_0xace5('0x44')](handleError(_0x5b11ba,null));};exports[_0xace5('0x4d')]=function(_0x9e620a,_0x2f8f4c){return db[_0xace5('0x2d')]['destroy']({'where':{'id':_0x9e620a[_0xace5('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xace5('0x28')](respondWithResult(_0x2f8f4c,0xcc))[_0xace5('0x44')](handleError(_0x2f8f4c,null));};exports[_0xace5('0x4e')]=function(_0x4a16ce,_0xa73424,_0x1812d5){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4a16ce[_0xace5('0x4c')]['id']}})[_0xace5('0x28')](handleEntityNotFound(_0xa73424,null))[_0xace5('0x28')](function(_0x4f2a91){if(_0x4f2a91){return db[_0xace5('0x4f')]['transaction'](function(_0x12bdbc){return db[_0xace5('0x2d')][_0xace5('0x27')]({'where':{'CustomReportId':_0x4a16ce[_0xace5('0x4c')]['id']},'transaction':_0x12bdbc})[_0xace5('0x28')](function(_0x40c2c0){var _0x1b2b17=_['map'](_0x4a16ce['body'],function(_0x18fd68){delete _0x18fd68['id'];_0x18fd68['CustomReportId']=_0x4a16ce[_0xace5('0x4c')]['id'];return _0x18fd68;});return db[_0xace5('0x2d')]['bulkCreate'](_0x1b2b17,{'transaction':_0x12bdbc});});})[_0xace5('0x28')](function(){return db[_0xace5('0x2d')][_0xace5('0x43')]({'where':{'CustomReportId':_0x4a16ce[_0xace5('0x4c')]['id']}});});}})[_0xace5('0x28')](respondWithResult(_0xa73424,null))[_0xace5('0x44')](handleError(_0xa73424,null));}; \ No newline at end of file +var _0xa644=['map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','fields','length','include','options','find','create','body','bulkCreate','params','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','reject','save','update','then','stack','name','send','index'];(function(_0x493b12,_0x24366c){var _0x395af5=function(_0x241ef0){while(--_0x241ef0){_0x493b12['push'](_0x493b12['shift']());}};_0x395af5(++_0x24366c);}(_0xa644,0x15b));var _0x4a64=function(_0x3c02ac,_0x9b1da0){_0x3c02ac=_0x3c02ac-0x0;var _0x5e9ee3=_0xa644[_0x3c02ac];return _0x5e9ee3;};'use strict';var emlformat=require(_0x4a64('0x0'));var rimraf=require(_0x4a64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a64('0x2'));var rp=require('request-promise');var moment=require(_0x4a64('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a64('0x4'));var util=require(_0x4a64('0x5'));var path=require(_0x4a64('0x6'));var sox=require(_0x4a64('0x7'));var csv=require(_0x4a64('0x8'));var ejs=require(_0x4a64('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a64('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a64('0xb'));var deskjs=require(_0x4a64('0xc'));var toCsv=require(_0x4a64('0x8'));var querystring=require('querystring');var Papa=require(_0x4a64('0xd'));var Redis=require('ioredis');var authService=require(_0x4a64('0xe'));var qs=require(_0x4a64('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a64('0x10'));var logger=require(_0x4a64('0x11'))('api');var utils=require(_0x4a64('0x12'));var config=require(_0x4a64('0x13'));var licenseUtil=require(_0x4a64('0x14'));var db=require(_0x4a64('0x15'))['db'];function respondWithStatusCode(_0x503279,_0x512689){_0x512689=_0x512689||0xcc;return function(_0x59b4ef){if(_0x59b4ef){return _0x503279[_0x4a64('0x16')](_0x512689);}return _0x503279[_0x4a64('0x17')](_0x512689)[_0x4a64('0x18')]();};}function respondWithResult(_0x517c9c,_0x5a1a92){_0x5a1a92=_0x5a1a92||0xc8;return function(_0x51a5bd){if(_0x51a5bd){return _0x517c9c[_0x4a64('0x17')](_0x5a1a92)['json'](_0x51a5bd);}};}function respondWithFilteredResult(_0x113fc8,_0x1da616){return function(_0x1d25a4){if(_0x1d25a4){var _0x2a14a3=typeof _0x1da616[_0x4a64('0x19')]===_0x4a64('0x1a')&&typeof _0x1da616[_0x4a64('0x1b')]===_0x4a64('0x1a');var _0x46998b=_0x1d25a4[_0x4a64('0x1c')];var _0x5bf736=_0x2a14a3?0x0:_0x1da616[_0x4a64('0x19')];var _0x4e41d8=_0x2a14a3?_0x1d25a4['count']:_0x1da616['offset']+_0x1da616[_0x4a64('0x1b')];var _0x16d8a5;if(_0x4e41d8>=_0x46998b){_0x4e41d8=_0x46998b;_0x16d8a5=0xc8;}else{_0x16d8a5=0xce;}_0x113fc8['status'](_0x16d8a5);return _0x113fc8['set']('Content-Range',_0x5bf736+'-'+_0x4e41d8+'/'+_0x46998b)[_0x4a64('0x1d')](_0x1d25a4);}return null;};}function patchUpdates(_0x1ee520){return function(_0x1075af){try{jsonpatch['apply'](_0x1075af,_0x1ee520,!![]);}catch(_0x247f1b){return BPromise[_0x4a64('0x1e')](_0x247f1b);}return _0x1075af[_0x4a64('0x1f')]();};}function saveUpdates(_0x53a3f5,_0x6b7da3){return function(_0x48e45d){if(_0x48e45d){return _0x48e45d[_0x4a64('0x20')](_0x53a3f5)[_0x4a64('0x21')](function(_0x563d43){return _0x563d43;});}return null;};}function removeEntity(_0x4dbe06,_0x14bc12){return function(_0x2a2ff0){if(_0x2a2ff0){return _0x2a2ff0['destroy']()[_0x4a64('0x21')](function(){_0x4dbe06['status'](0xcc)[_0x4a64('0x18')]();});}};}function handleEntityNotFound(_0xae5680,_0x20b0f6){return function(_0x113eed){if(!_0x113eed){_0xae5680[_0x4a64('0x16')](0x194);}return _0x113eed;};}function handleError(_0x79cf22,_0x25ae88){_0x25ae88=_0x25ae88||0x1f4;return function(_0x284b47){logger['error'](_0x284b47[_0x4a64('0x22')]);if(_0x284b47[_0x4a64('0x23')]){delete _0x284b47[_0x4a64('0x23')];}_0x79cf22[_0x4a64('0x17')](_0x25ae88)[_0x4a64('0x24')](_0x284b47);};}exports[_0x4a64('0x25')]=function(_0x1d828f,_0x4e437e){var _0x4aad10={},_0x55559a={},_0x384bd8={'count':0x0,'rows':[]};var _0x4ec644=_[_0x4a64('0x26')](db[_0x4a64('0x27')][_0x4a64('0x28')],function(_0x56a177){return{'name':_0x56a177[_0x4a64('0x29')],'type':_0x56a177[_0x4a64('0x2a')][_0x4a64('0x2b')]};});_0x55559a[_0x4a64('0x2c')]=_[_0x4a64('0x26')](_0x4ec644,_0x4a64('0x23'));_0x55559a[_0x4a64('0x2d')]=_[_0x4a64('0x2e')](_0x1d828f[_0x4a64('0x2d')]);_0x55559a[_0x4a64('0x2f')]=_[_0x4a64('0x30')](_0x55559a[_0x4a64('0x2c')],_0x55559a['query']);_0x4aad10[_0x4a64('0x31')]=_[_0x4a64('0x30')](_0x55559a[_0x4a64('0x2c')],qs['fields'](_0x1d828f[_0x4a64('0x2d')]['fields']));_0x4aad10[_0x4a64('0x31')]=_0x4aad10[_0x4a64('0x31')]['length']?_0x4aad10['attributes']:_0x55559a[_0x4a64('0x2c')];if(!_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x32')](_0x4a64('0x33'))){_0x4aad10[_0x4a64('0x1b')]=qs[_0x4a64('0x1b')](_0x1d828f['query']['limit']);_0x4aad10[_0x4a64('0x19')]=qs[_0x4a64('0x19')](_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x19')]);}_0x4aad10['order']=qs[_0x4a64('0x34')](_0x1d828f['query'][_0x4a64('0x34')]);_0x4aad10[_0x4a64('0x35')]=qs[_0x4a64('0x2f')](_[_0x4a64('0x36')](_0x1d828f['query'],_0x55559a['filters']),_0x4ec644);if(_0x1d828f['query'][_0x4a64('0x37')]){_0x4aad10[_0x4a64('0x35')]=_[_0x4a64('0x38')](_0x4aad10['where'],{'$or':_[_0x4a64('0x26')](_0x4ec644,function(_0x51caf7){if(_0x51caf7['type']!==_0x4a64('0x39')){var _0x11d7c5={};_0x11d7c5[_0x51caf7['name']]={'$like':'%'+_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x37')]+'%'};return _0x11d7c5;}})});}_0x4aad10=_[_0x4a64('0x38')]({},_0x4aad10,_0x1d828f['options']);var _0x1a18b2={'where':_0x4aad10[_0x4a64('0x35')]};return db['AnalyticFieldReport'][_0x4a64('0x1c')](_0x1a18b2)[_0x4a64('0x21')](function(_0x34a659){_0x384bd8[_0x4a64('0x1c')]=_0x34a659;if(_0x1d828f[_0x4a64('0x2d')][_0x4a64('0x3a')]){_0x4aad10['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4a64('0x3b')](_0x4aad10);})[_0x4a64('0x21')](function(_0x56bcd0){_0x384bd8['rows']=_0x56bcd0;return _0x384bd8;})[_0x4a64('0x21')](respondWithFilteredResult(_0x4e437e,_0x4aad10))[_0x4a64('0x3c')](handleError(_0x4e437e,null));};exports['show']=function(_0x24bae8,_0x5c532f){var _0x137269={'raw':![],'where':{'id':_0x24bae8['params']['id']}},_0x4c3d8f={};_0x4c3d8f[_0x4a64('0x2c')]=_['keys'](db['AnalyticFieldReport'][_0x4a64('0x28')]);_0x4c3d8f[_0x4a64('0x2d')]=_[_0x4a64('0x2e')](_0x24bae8[_0x4a64('0x2d')]);_0x4c3d8f[_0x4a64('0x2f')]=_[_0x4a64('0x30')](_0x4c3d8f['model'],_0x4c3d8f[_0x4a64('0x2d')]);_0x137269[_0x4a64('0x31')]=_[_0x4a64('0x30')](_0x4c3d8f[_0x4a64('0x2c')],qs[_0x4a64('0x3d')](_0x24bae8[_0x4a64('0x2d')][_0x4a64('0x3d')]));_0x137269[_0x4a64('0x31')]=_0x137269[_0x4a64('0x31')][_0x4a64('0x3e')]?_0x137269[_0x4a64('0x31')]:_0x4c3d8f['model'];if(_0x24bae8[_0x4a64('0x2d')][_0x4a64('0x3a')]){_0x137269[_0x4a64('0x3f')]=[{'all':!![]}];}_0x137269=_[_0x4a64('0x38')]({},_0x137269,_0x24bae8[_0x4a64('0x40')]);return db[_0x4a64('0x27')][_0x4a64('0x41')](_0x137269)[_0x4a64('0x21')](handleEntityNotFound(_0x5c532f,null))['then'](respondWithResult(_0x5c532f,null))[_0x4a64('0x3c')](handleError(_0x5c532f,null));};exports[_0x4a64('0x42')]=function(_0x5aa884,_0x2da946){return db['AnalyticFieldReport'][_0x4a64('0x42')](_0x5aa884[_0x4a64('0x43')],{})[_0x4a64('0x21')](respondWithResult(_0x2da946,0xc9))[_0x4a64('0x3c')](handleError(_0x2da946,null));};exports['bulkCreate']=function(_0x25d0e8,_0x592e0e){return db[_0x4a64('0x27')][_0x4a64('0x44')](_0x25d0e8[_0x4a64('0x43')],{'raw':![],'individualHooks':!![]})[_0x4a64('0x21')](respondWithResult(_0x592e0e,0xc9))['catch'](handleError(_0x592e0e,null));};exports[_0x4a64('0x20')]=function(_0x49b841,_0x552f0a){if(_0x49b841[_0x4a64('0x43')]['id']){delete _0x49b841[_0x4a64('0x43')]['id'];}return db[_0x4a64('0x27')]['find']({'where':{'id':_0x49b841[_0x4a64('0x45')]['id']}})['then'](handleEntityNotFound(_0x552f0a,null))[_0x4a64('0x21')](saveUpdates(_0x49b841['body'],null))['then'](respondWithResult(_0x552f0a,null))[_0x4a64('0x3c')](handleError(_0x552f0a,null));};exports[_0x4a64('0x46')]=function(_0x5cd731,_0x43dc37){return db[_0x4a64('0x27')][_0x4a64('0x41')]({'where':{'id':_0x5cd731['params']['id']}})['then'](handleEntityNotFound(_0x43dc37,null))['then'](removeEntity(_0x43dc37,null))[_0x4a64('0x3c')](handleError(_0x43dc37,null));};exports[_0x4a64('0x47')]=function(_0x4b857f,_0x17be14){return db[_0x4a64('0x27')]['destroy']({'where':{'id':_0x4b857f['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x4a64('0x21')](respondWithResult(_0x17be14,0xcc))[_0x4a64('0x3c')](handleError(_0x17be14,null));};exports[_0x4a64('0x48')]=function(_0xacfa75,_0x1f74a3,_0x2720c7){return db[_0x4a64('0x49')][_0x4a64('0x4a')]({'where':{'id':_0xacfa75[_0x4a64('0x45')]['id']}})[_0x4a64('0x21')](handleEntityNotFound(_0x1f74a3,null))[_0x4a64('0x21')](function(_0x2d7996){if(_0x2d7996){return db[_0x4a64('0x4b')][_0x4a64('0x4c')](function(_0x1a5557){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xacfa75['params']['id']},'transaction':_0x1a5557})[_0x4a64('0x21')](function(_0x58388d){var _0x10feff=_['map'](_0xacfa75[_0x4a64('0x43')],function(_0x2639e1){delete _0x2639e1['id'];_0x2639e1['CustomReportId']=_0xacfa75[_0x4a64('0x45')]['id'];return _0x2639e1;});return db[_0x4a64('0x27')][_0x4a64('0x44')](_0x10feff,{'transaction':_0x1a5557});});})[_0x4a64('0x21')](function(){return db['AnalyticFieldReport'][_0x4a64('0x3b')]({'where':{'CustomReportId':_0xacfa75[_0x4a64('0x45')]['id']}});});}})[_0x4a64('0x21')](respondWithResult(_0x1f74a3,null))['catch'](handleError(_0x1f74a3,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 38b4c4c..02ea5e5 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 _0x57f8=['../../config/logger','moment','request-promise','rimraf','exports','define','analytics_report_fields','lodash','util'];(function(_0x5315be,_0x3e05c3){var _0x16980e=function(_0x35886a){while(--_0x35886a){_0x5315be['push'](_0x5315be['shift']());}};_0x16980e(++_0x3e05c3);}(_0x57f8,0x10c));var _0x857f=function(_0xa05fd3,_0x4c6517){_0xa05fd3=_0xa05fd3-0x0;var _0x581738=_0x57f8[_0xa05fd3];return _0x581738;};'use strict';var _=require(_0x857f('0x0'));var util=require(_0x857f('0x1'));var logger=require(_0x857f('0x2'))('api');var moment=require(_0x857f('0x3'));var BPromise=require('bluebird');var rp=require(_0x857f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x857f('0x5'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x857f('0x6')]=function(_0x244336,_0x119287){return _0x244336[_0x857f('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0x857f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc15=['./analyticFieldReport.attributes','exports','define','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x284f24,_0xccd67c){var _0x2dc718=function(_0x16cca8){while(--_0x16cca8){_0x284f24['push'](_0x284f24['shift']());}};_0x2dc718(++_0xccd67c);}(_0xbc15,0x11a));var _0x5bc1=function(_0x574c76,_0x458b35){_0x574c76=_0x574c76-0x0;var _0x1ecadf=_0xbc15[_0x574c76];return _0x1ecadf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5bc1('0x0'))(_0x5bc1('0x1'));var moment=require(_0x5bc1('0x2'));var BPromise=require(_0x5bc1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5bc1('0x4'));var config=require(_0x5bc1('0x5'));var attributes=require(_0x5bc1('0x6'));module[_0x5bc1('0x7')]=function(_0x3f84c5,_0x2a18f0){return _0x3f84c5[_0x5bc1('0x8')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','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 11d2118..450bd2e 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 _0x8e97=['AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4472b6,_0x3768b6){var _0x153531=function(_0x517b02){while(--_0x517b02){_0x4472b6['push'](_0x4472b6['shift']());}};_0x153531(++_0x3768b6);}(_0x8e97,0xae));var _0x78e9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e97[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x78e9('0x0'));var moment=require(_0x78e9('0x1'));var BPromise=require(_0x78e9('0x2'));var rs=require(_0x78e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78e9('0x4'))['db'];var utils=require(_0x78e9('0x5'));var logger=require(_0x78e9('0x6'))(_0x78e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x78e9('0x8'));var client=jayson[_0x78e9('0x9')][_0x78e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55646b,_0x708e3c,_0x1474cd){return new BPromise(function(_0x19e4d2,_0x1a1125){return client[_0x78e9('0xb')](_0x55646b,_0x1474cd)[_0x78e9('0xc')](function(_0x35f8a6){logger['info'](_0x78e9('0xd'),_0x708e3c,_0x78e9('0xe'));logger['debug'](_0x78e9('0xf'),_0x708e3c,_0x78e9('0xe'),JSON['stringify'](_0x35f8a6));if(_0x35f8a6['error']){if(_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x11')]===0x1f4){logger[_0x78e9('0x10')](_0x78e9('0xd'),_0x708e3c,_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x12')]);return _0x1a1125(_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x12')]);}logger[_0x78e9('0x10')](_0x78e9('0xd'),_0x708e3c,_0x35f8a6[_0x78e9('0x10')]['message']);return _0x19e4d2(_0x35f8a6[_0x78e9('0x10')][_0x78e9('0x12')]);}else{logger['info'](_0x78e9('0xd'),_0x708e3c,'request\x20sent');_0x19e4d2(_0x35f8a6[_0x78e9('0x13')][_0x78e9('0x12')]);}})[_0x78e9('0x14')](function(_0x39f634){logger[_0x78e9('0x10')](_0x78e9('0xd'),_0x708e3c,_0x39f634);_0x1a1125(_0x39f634);});});} \ No newline at end of file +var _0x1ba0=['../../config/environment','jayson/promise','client','http','then','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','info','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ba0,0x159));var _0x01ba=function(_0x3b6d59,_0x30b8cf){_0x3b6d59=_0x3b6d59-0x0;var _0x3db027=_0x1ba0[_0x3b6d59];return _0x3db027;};'use strict';var _=require(_0x01ba('0x0'));var util=require('util');var moment=require(_0x01ba('0x1'));var BPromise=require(_0x01ba('0x2'));var rs=require(_0x01ba('0x3'));var fs=require('fs');var Redis=require(_0x01ba('0x4'));var db=require(_0x01ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01ba('0x6'))('rpc');var config=require(_0x01ba('0x7'));var jayson=require(_0x01ba('0x8'));var client=jayson[_0x01ba('0x9')][_0x01ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57cdaa,_0x15dc5c,_0xd70def){return new BPromise(function(_0x451628,_0x195064){return client['request'](_0x57cdaa,_0xd70def)[_0x01ba('0xb')](function(_0x5000a1){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x15dc5c,'request\x20sent');logger[_0x01ba('0xc')](_0x01ba('0xd'),_0x15dc5c,'request\x20sent',JSON[_0x01ba('0xe')](_0x5000a1));if(_0x5000a1[_0x01ba('0xf')]){if(_0x5000a1['error'][_0x01ba('0x10')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x15dc5c,_0x5000a1[_0x01ba('0xf')][_0x01ba('0x11')]);return _0x195064(_0x5000a1[_0x01ba('0xf')][_0x01ba('0x11')]);}logger[_0x01ba('0xf')](_0x01ba('0x12'),_0x15dc5c,_0x5000a1['error'][_0x01ba('0x11')]);return _0x451628(_0x5000a1[_0x01ba('0xf')][_0x01ba('0x11')]);}else{logger[_0x01ba('0x13')](_0x01ba('0x12'),_0x15dc5c,_0x01ba('0x14'));_0x451628(_0x5000a1[_0x01ba('0x15')][_0x01ba('0x11')]);}})['catch'](function(_0x43aa9c){logger[_0x01ba('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x15dc5c,_0x43aa9c);_0x195064(_0x43aa9c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 019960a..814fa87 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(_0x47147a,_0x590819){var _0x434409=function(_0x5220ca){while(--_0x5220ca){_0x47147a['push'](_0x47147a['shift']());}};_0x434409(++_0x590819);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x4fc577,_0x4bcd2b){var _0x443011=function(_0x1d4a35){while(--_0x1d4a35){_0x4fc577['push'](_0x4fc577['shift']());}};_0x443011(++_0x4bcd2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 e001db9..eccd2e0 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 _0x35ba=['sequelize','exports','STRING','name','TEXT'];(function(_0x325f6c,_0x308218){var _0x5732ef=function(_0x420edc){while(--_0x420edc){_0x325f6c['push'](_0x325f6c['shift']());}};_0x5732ef(++_0x308218);}(_0x35ba,0x8c));var _0xa35b=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0x35ba[_0x1979d8];return _0x1d5bb3;};'use strict';var Sequelize=require(_0xa35b('0x0'));module[_0xa35b('0x1')]={'name':{'type':Sequelize[_0xa35b('0x2')],'allowNull':![],'unique':_0xa35b('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xa35b('0x4')]},'description':{'type':Sequelize[_0xa35b('0x2')]}}; \ No newline at end of file +var _0x97a2=['TEXT','sequelize','STRING','name'];(function(_0x23535b,_0x495d9f){var _0x41d588=function(_0x57457a){while(--_0x57457a){_0x23535b['push'](_0x23535b['shift']());}};_0x41d588(++_0x495d9f);}(_0x97a2,0x1b1));var _0x297a=function(_0x582ebd,_0x3de350){_0x582ebd=_0x582ebd-0x0;var _0x504004=_0x97a2[_0x582ebd];return _0x504004;};'use strict';var Sequelize=require(_0x297a('0x0'));module['exports']={'name':{'type':Sequelize[_0x297a('0x1')],'allowNull':![],'unique':_0x297a('0x2')},'table':{'type':Sequelize[_0x297a('0x1')]},'metric':{'type':Sequelize[_0x297a('0x3')]},'description':{'type':Sequelize[_0x297a('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 67cd835..767359a 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x25f39c,_0x4f231a){var _0x19bb4a=function(_0x33feb5){while(--_0x33feb5){_0x25f39c['push'](_0x25f39c['shift']());}};_0x19bb4a(++_0x4f231a);}(_0x008c,0x188));var _0xc008=function(_0x34c98c,_0x5cfd45){_0x34c98c=_0x34c98c-0x0;var _0x41328f=_0x008c[_0x34c98c];return _0x41328f;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x439b67,_0x1e34c9){var _0x3b1241=function(_0x43702f){while(--_0x43702f){_0x439b67['push'](_0x439b67['shift']());}};_0x3b1241(++_0x1e34c9);}(_0xabce,0x103));var _0xeabc=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xabce[_0x28d18d];return _0x470640;};'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(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index b04d834..ff9b3c7 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 _0x9206=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','AnalyticMetric','analytics_metrics'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9206,0x176));var _0x6920=function(_0xd54e85,_0x543bfa){_0xd54e85=_0xd54e85-0x0;var _0x35a159=_0x9206[_0xd54e85];return _0x35a159;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var logger=require(_0x6920('0x2'))(_0x6920('0x3'));var moment=require(_0x6920('0x4'));var BPromise=require(_0x6920('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6920('0x6'));var config=require(_0x6920('0x7'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x41c8c4,_0x4d67d7){return _0x41c8c4[_0x6920('0x8')](_0x6920('0x9'),attributes,{'tableName':_0x6920('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5398=['request-promise','path','./analyticMetric.attributes','exports','define','AnalyticMetric','util','../../config/logger','api','moment','bluebird'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x5398,0xe2));var _0x8539=function(_0x1331b2,_0x3df22b){_0x1331b2=_0x1331b2-0x0;var _0x10f741=_0x5398[_0x1331b2];return _0x10f741;};'use strict';var _=require('lodash');var util=require(_0x8539('0x0'));var logger=require(_0x8539('0x1'))(_0x8539('0x2'));var moment=require(_0x8539('0x3'));var BPromise=require(_0x8539('0x4'));var rp=require(_0x8539('0x5'));var fs=require('fs');var path=require(_0x8539('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8539('0x7'));module[_0x8539('0x8')]=function(_0x14ddc9,_0xcca1c0){return _0x14ddc9[_0x8539('0x9')](_0x8539('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 86a9dd7..0ec6329 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 _0x3933=['request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3b57a8,_0x49bcd2){var _0x312a94=function(_0x4d170f){while(--_0x4d170f){_0x3b57a8['push'](_0x3b57a8['shift']());}};_0x312a94(++_0x49bcd2);}(_0x3933,0xdc));var _0x3393=function(_0x3fc21c,_0x490f02){_0x3fc21c=_0x3fc21c-0x0;var _0x488be7=_0x3933[_0x3fc21c];return _0x488be7;};'use strict';var _=require(_0x3393('0x0'));var util=require(_0x3393('0x1'));var moment=require(_0x3393('0x2'));var BPromise=require(_0x3393('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3393('0x4'));var db=require(_0x3393('0x5'))['db'];var utils=require(_0x3393('0x6'));var logger=require(_0x3393('0x7'))(_0x3393('0x8'));var config=require('../../config/environment');var jayson=require(_0x3393('0x9'));var client=jayson[_0x3393('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f36c9,_0x38c320,_0x5c16a3){return new BPromise(function(_0x45547c,_0x4b066a){return client[_0x3393('0xb')](_0x4f36c9,_0x5c16a3)[_0x3393('0xc')](function(_0xf417d6){logger[_0x3393('0xd')](_0x3393('0xe'),_0x38c320,'request\x20sent');logger[_0x3393('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x38c320,_0x3393('0x10'),JSON[_0x3393('0x11')](_0xf417d6));if(_0xf417d6[_0x3393('0x12')]){if(_0xf417d6['error'][_0x3393('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x38c320,_0xf417d6['error'][_0x3393('0x14')]);return _0x4b066a(_0xf417d6[_0x3393('0x12')][_0x3393('0x14')]);}logger[_0x3393('0x12')](_0x3393('0xe'),_0x38c320,_0xf417d6['error']['message']);return _0x45547c(_0xf417d6['error'][_0x3393('0x14')]);}else{logger[_0x3393('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x38c320,_0x3393('0x10'));_0x45547c(_0xf417d6['result']['message']);}})['catch'](function(_0x3c2dab){logger[_0x3393('0x12')](_0x3393('0xe'),_0x38c320,_0x3c2dab);_0x4b066a(_0x3c2dab);});});} \ No newline at end of file +var _0xb41b=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x14e9f0,_0x287f90){var _0xa63f7e=function(_0x4829d6){while(--_0x4829d6){_0x14e9f0['push'](_0x14e9f0['shift']());}};_0xa63f7e(++_0x287f90);}(_0xb41b,0xcb));var _0xbb41=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb41b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbb41('0x0'));var util=require(_0xbb41('0x1'));var moment=require(_0xbb41('0x2'));var BPromise=require(_0xbb41('0x3'));var rs=require(_0xbb41('0x4'));var fs=require('fs');var Redis=require(_0xbb41('0x5'));var db=require(_0xbb41('0x6'))['db'];var utils=require(_0xbb41('0x7'));var logger=require(_0xbb41('0x8'))(_0xbb41('0x9'));var config=require(_0xbb41('0xa'));var jayson=require(_0xbb41('0xb'));var client=jayson[_0xbb41('0xc')][_0xbb41('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x55ddff,_0x2946ae,_0x286477){return new BPromise(function(_0x337b43,_0x1ca596){return client[_0xbb41('0xe')](_0x55ddff,_0x286477)[_0xbb41('0xf')](function(_0x42adf3){logger[_0xbb41('0x10')](_0xbb41('0x11'),_0x2946ae,_0xbb41('0x12'));logger[_0xbb41('0x13')](_0xbb41('0x14'),_0x2946ae,_0xbb41('0x12'),JSON[_0xbb41('0x15')](_0x42adf3));if(_0x42adf3['error']){if(_0x42adf3[_0xbb41('0x16')]['code']===0x1f4){logger[_0xbb41('0x16')](_0xbb41('0x11'),_0x2946ae,_0x42adf3[_0xbb41('0x16')]['message']);return _0x1ca596(_0x42adf3[_0xbb41('0x16')][_0xbb41('0x17')]);}logger[_0xbb41('0x16')](_0xbb41('0x11'),_0x2946ae,_0x42adf3[_0xbb41('0x16')][_0xbb41('0x17')]);return _0x337b43(_0x42adf3[_0xbb41('0x16')][_0xbb41('0x17')]);}else{logger[_0xbb41('0x10')](_0xbb41('0x11'),_0x2946ae,'request\x20sent');_0x337b43(_0x42adf3['result'][_0xbb41('0x17')]);}})[_0xbb41('0x18')](function(_0x3b8927){logger[_0xbb41('0x16')](_0xbb41('0x11'),_0x2946ae,_0x3b8927);_0x1ca596(_0x3b8927);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d75eaf8..35bd78e 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 _0x0845=['./analyticMetric.controller','get','isAuthenticated','show','post','put','/:id','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x0845,0x125));var _0x5084=function(_0x29486b,_0x4d12de){_0x29486b=_0x29486b-0x0;var _0x48f479=_0x0845[_0x29486b];return _0x48f479;};'use strict';var multer=require(_0x5084('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5084('0x1'));var express=require(_0x5084('0x2'));var router=express[_0x5084('0x3')]();var fs_extra=require(_0x5084('0x4'));var auth=require(_0x5084('0x5'));var interaction=require(_0x5084('0x6'));var config=require('../../config/environment');var controller=require(_0x5084('0x7'));router[_0x5084('0x8')]('/',auth[_0x5084('0x9')](),controller['index']);router['get']('/:id',auth[_0x5084('0x9')](),controller[_0x5084('0xa')]);router[_0x5084('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5084('0xc')](_0x5084('0xd'),auth[_0x5084('0x9')](),controller['update']);router[_0x5084('0xe')](_0x5084('0xd'),auth[_0x5084('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd101=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5da107,_0x10357c){var _0x224f15=function(_0x2b7af8){while(--_0x2b7af8){_0x5da107['push'](_0x5da107['shift']());}};_0x224f15(++_0x10357c);}(_0xd101,0xc1));var _0x1d10=function(_0x3bb123,_0x17afbf){_0x3bb123=_0x3bb123-0x0;var _0x1583c3=_0xd101[_0x3bb123];return _0x1583c3;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./analyticMetric.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0xe')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x10')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x12')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller['destroy']);module[_0x1d10('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index a91df47..801fbb6 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 _0xd364=['sequelize','TEXT'];(function(_0x64f1b6,_0x19f5d0){var _0x47d83e=function(_0x202e77){while(--_0x202e77){_0x64f1b6['push'](_0x64f1b6['shift']());}};_0x47d83e(++_0x19f5d0);}(_0xd364,0x8a));var _0x4d36=function(_0x161c54,_0x182154){_0x161c54=_0x161c54-0x0;var _0x12118b=_0xd364[_0x161c54];return _0x12118b;};'use strict';var Sequelize=require(_0x4d36('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4d36('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x42d7=['sequelize','TEXT'];(function(_0x47879f,_0x5f927b){var _0x2fdb79=function(_0x4f14a1){while(--_0x4f14a1){_0x47879f['push'](_0x47879f['shift']());}};_0x2fdb79(++_0x5f927b);}(_0x42d7,0xa8));var _0x742d=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x42d7[_0x290fa6];return _0x47f1f3;};'use strict';var Sequelize=require(_0x742d('0x0'));module['exports']={'tree':{'type':Sequelize[_0x742d('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 9a97898..b44dddd 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 _0x74f9=['rows','params','find','create','body','catch','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','then','includeAll','include','findAll'];(function(_0x18d1f6,_0x1ec368){var _0x244a83=function(_0x1a78fe){while(--_0x1a78fe){_0x18d1f6['push'](_0x18d1f6['shift']());}};_0x244a83(++_0x1ec368);}(_0x74f9,0xf3));var _0x974f=function(_0x3aa616,_0x463b69){_0x3aa616=_0x3aa616-0x0;var _0x15eb62=_0x74f9[_0x3aa616];return _0x15eb62;};'use strict';var emlformat=require(_0x974f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x974f('0x1'));var jsonpatch=require(_0x974f('0x2'));var rp=require('request-promise');var moment=require(_0x974f('0x3'));var BPromise=require(_0x974f('0x4'));var Mustache=require(_0x974f('0x5'));var util=require(_0x974f('0x6'));var path=require(_0x974f('0x7'));var sox=require(_0x974f('0x8'));var csv=require(_0x974f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x974f('0xa'));var _=require(_0x974f('0xb'));var squel=require('squel');var crypto=require(_0x974f('0xc'));var jsforce=require(_0x974f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x974f('0x9'));var querystring=require(_0x974f('0xe'));var Papa=require(_0x974f('0xf'));var Redis=require(_0x974f('0x10'));var authService=require(_0x974f('0x11'));var qs=require(_0x974f('0x12'));var as=require(_0x974f('0x13'));var hardwareService=require(_0x974f('0x14'));var logger=require(_0x974f('0x15'))(_0x974f('0x16'));var utils=require(_0x974f('0x17'));var config=require(_0x974f('0x18'));var licenseUtil=require(_0x974f('0x19'));var db=require(_0x974f('0x1a'))['db'];function respondWithStatusCode(_0x2c0cad,_0xf8846e){_0xf8846e=_0xf8846e||0xcc;return function(_0x64e6a1){if(_0x64e6a1){return _0x2c0cad['sendStatus'](_0xf8846e);}return _0x2c0cad[_0x974f('0x1b')](_0xf8846e)['end']();};}function respondWithResult(_0x4ce158,_0x1a722d){_0x1a722d=_0x1a722d||0xc8;return function(_0x16468b){if(_0x16468b){return _0x4ce158[_0x974f('0x1b')](_0x1a722d)[_0x974f('0x1c')](_0x16468b);}};}function respondWithFilteredResult(_0x1652c1,_0x52be2a){return function(_0x26a673){if(_0x26a673){var _0x4f6e14=typeof _0x52be2a[_0x974f('0x1d')]===_0x974f('0x1e')&&typeof _0x52be2a['limit']===_0x974f('0x1e');var _0x201c99=_0x26a673['count'];var _0x528634=_0x4f6e14?0x0:_0x52be2a[_0x974f('0x1d')];var _0x3ee9af=_0x4f6e14?_0x26a673[_0x974f('0x1f')]:_0x52be2a[_0x974f('0x1d')]+_0x52be2a[_0x974f('0x20')];var _0x44b910;if(_0x3ee9af>=_0x201c99){_0x3ee9af=_0x201c99;_0x44b910=0xc8;}else{_0x44b910=0xce;}_0x1652c1[_0x974f('0x1b')](_0x44b910);return _0x1652c1['set'](_0x974f('0x21'),_0x528634+'-'+_0x3ee9af+'/'+_0x201c99)['json'](_0x26a673);}return null;};}function patchUpdates(_0x4b534d){return function(_0x42f448){try{jsonpatch[_0x974f('0x22')](_0x42f448,_0x4b534d,!![]);}catch(_0x1297ea){return BPromise['reject'](_0x1297ea);}return _0x42f448[_0x974f('0x23')]();};}function saveUpdates(_0x453fa7,_0x31d3e0){return function(_0x110b25){if(_0x110b25){return _0x110b25[_0x974f('0x24')](_0x453fa7)['then'](function(_0x1d52f6){return _0x1d52f6;});}return null;};}function removeEntity(_0x525358,_0x51309b){return function(_0x171145){if(_0x171145){return _0x171145[_0x974f('0x25')]()['then'](function(){_0x525358[_0x974f('0x1b')](0xcc)[_0x974f('0x26')]();});}};}function handleEntityNotFound(_0x547baa,_0x408a49){return function(_0xc652af){if(!_0xc652af){_0x547baa[_0x974f('0x27')](0x194);}return _0xc652af;};}function handleError(_0x1fde4f,_0x2d4b85){_0x2d4b85=_0x2d4b85||0x1f4;return function(_0x34c7e5){logger[_0x974f('0x28')](_0x34c7e5[_0x974f('0x29')]);if(_0x34c7e5[_0x974f('0x2a')]){delete _0x34c7e5[_0x974f('0x2a')];}_0x1fde4f['status'](_0x2d4b85)[_0x974f('0x2b')](_0x34c7e5);};}exports[_0x974f('0x2c')]=function(_0x446147,_0x129dc2){var _0x545ec4={},_0x287045={},_0x20b023={'count':0x0,'rows':[]};var _0x581c7b=_[_0x974f('0x2d')](db[_0x974f('0x2e')][_0x974f('0x2f')],function(_0x2b3bf1){return{'name':_0x2b3bf1[_0x974f('0x30')],'type':_0x2b3bf1[_0x974f('0x31')][_0x974f('0x32')]};});_0x287045[_0x974f('0x33')]=_[_0x974f('0x2d')](_0x581c7b,_0x974f('0x2a'));_0x287045[_0x974f('0x34')]=_[_0x974f('0x35')](_0x446147[_0x974f('0x34')]);_0x287045[_0x974f('0x36')]=_[_0x974f('0x37')](_0x287045[_0x974f('0x33')],_0x287045['query']);_0x545ec4['attributes']=_[_0x974f('0x37')](_0x287045[_0x974f('0x33')],qs[_0x974f('0x38')](_0x446147[_0x974f('0x34')]['fields']));_0x545ec4['attributes']=_0x545ec4['attributes'][_0x974f('0x39')]?_0x545ec4[_0x974f('0x3a')]:_0x287045['model'];if(!_0x446147[_0x974f('0x34')][_0x974f('0x3b')](_0x974f('0x3c'))){_0x545ec4[_0x974f('0x20')]=qs['limit'](_0x446147[_0x974f('0x34')][_0x974f('0x20')]);_0x545ec4[_0x974f('0x1d')]=qs[_0x974f('0x1d')](_0x446147['query'][_0x974f('0x1d')]);}_0x545ec4[_0x974f('0x3d')]=qs[_0x974f('0x3e')](_0x446147[_0x974f('0x34')][_0x974f('0x3e')]);_0x545ec4['where']=qs[_0x974f('0x36')](_[_0x974f('0x3f')](_0x446147[_0x974f('0x34')],_0x287045[_0x974f('0x36')]),_0x581c7b);if(_0x446147[_0x974f('0x34')][_0x974f('0x40')]){_0x545ec4['where']=_[_0x974f('0x41')](_0x545ec4[_0x974f('0x42')],{'$or':_['map'](_0x581c7b,function(_0x485614){if(_0x485614['type']!==_0x974f('0x43')){var _0x35dcbd={};_0x35dcbd[_0x485614[_0x974f('0x2a')]]={'$like':'%'+_0x446147[_0x974f('0x34')]['filter']+'%'};return _0x35dcbd;}})});}_0x545ec4=_[_0x974f('0x41')]({},_0x545ec4,_0x446147[_0x974f('0x44')]);var _0x3ac661={'where':_0x545ec4[_0x974f('0x42')]};return db[_0x974f('0x2e')][_0x974f('0x1f')](_0x3ac661)[_0x974f('0x45')](function(_0x2ed7e8){_0x20b023['count']=_0x2ed7e8;if(_0x446147[_0x974f('0x34')][_0x974f('0x46')]){_0x545ec4[_0x974f('0x47')]=[{'all':!![]}];}return db[_0x974f('0x2e')][_0x974f('0x48')](_0x545ec4);})[_0x974f('0x45')](function(_0xb1a4b2){_0x20b023[_0x974f('0x49')]=_0xb1a4b2;return _0x20b023;})[_0x974f('0x45')](respondWithFilteredResult(_0x129dc2,_0x545ec4))['catch'](handleError(_0x129dc2,null));};exports['show']=function(_0x1760f2,_0x5461ad){var _0x2cd192={'raw':!![],'where':{'id':_0x1760f2[_0x974f('0x4a')]['id']}},_0x26dc44={};_0x26dc44[_0x974f('0x33')]=_[_0x974f('0x35')](db[_0x974f('0x2e')][_0x974f('0x2f')]);_0x26dc44[_0x974f('0x34')]=_[_0x974f('0x35')](_0x1760f2[_0x974f('0x34')]);_0x26dc44[_0x974f('0x36')]=_[_0x974f('0x37')](_0x26dc44[_0x974f('0x33')],_0x26dc44['query']);_0x2cd192[_0x974f('0x3a')]=_[_0x974f('0x37')](_0x26dc44[_0x974f('0x33')],qs[_0x974f('0x38')](_0x1760f2['query'][_0x974f('0x38')]));_0x2cd192[_0x974f('0x3a')]=_0x2cd192[_0x974f('0x3a')][_0x974f('0x39')]?_0x2cd192[_0x974f('0x3a')]:_0x26dc44[_0x974f('0x33')];if(_0x1760f2[_0x974f('0x34')][_0x974f('0x46')]){_0x2cd192[_0x974f('0x47')]=[{'all':!![]}];}_0x2cd192=_['merge']({},_0x2cd192,_0x1760f2['options']);return db[_0x974f('0x2e')][_0x974f('0x4b')](_0x2cd192)[_0x974f('0x45')](handleEntityNotFound(_0x5461ad,null))[_0x974f('0x45')](respondWithResult(_0x5461ad,null))['catch'](handleError(_0x5461ad,null));};exports['create']=function(_0xf77a27,_0x41f352){return db['AnalyticTreeReport'][_0x974f('0x4c')](_0xf77a27[_0x974f('0x4d')],{})['then'](respondWithResult(_0x41f352,0xc9))['catch'](handleError(_0x41f352,null));};exports[_0x974f('0x24')]=function(_0x1f1cd6,_0x32d3ca){if(_0x1f1cd6[_0x974f('0x4d')]['id']){delete _0x1f1cd6[_0x974f('0x4d')]['id'];}return db[_0x974f('0x2e')]['find']({'where':{'id':_0x1f1cd6['params']['id']}})[_0x974f('0x45')](handleEntityNotFound(_0x32d3ca,null))[_0x974f('0x45')](saveUpdates(_0x1f1cd6[_0x974f('0x4d')],null))[_0x974f('0x45')](respondWithResult(_0x32d3ca,null))[_0x974f('0x4e')](handleError(_0x32d3ca,null));};exports[_0x974f('0x25')]=function(_0x273310,_0x2b0892){return db[_0x974f('0x2e')][_0x974f('0x4b')]({'where':{'id':_0x273310[_0x974f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2b0892,null))[_0x974f('0x45')](removeEntity(_0x2b0892,null))[_0x974f('0x4e')](handleError(_0x2b0892,null));}; \ No newline at end of file +var _0x5b9f=['VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','keys','length','include','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x3d87b8,_0x3bbc5f){var _0x5f564e=function(_0x36298a){while(--_0x36298a){_0x3d87b8['push'](_0x3d87b8['shift']());}};_0x5f564e(++_0x3bbc5f);}(_0x5b9f,0x13f));var _0xf5b9=function(_0x2bad69,_0x226e2f){_0x2bad69=_0x2bad69-0x0;var _0x1532c3=_0x5b9f[_0x2bad69];return _0x1532c3;};'use strict';var emlformat=require(_0xf5b9('0x0'));var rimraf=require(_0xf5b9('0x1'));var zipdir=require(_0xf5b9('0x2'));var jsonpatch=require(_0xf5b9('0x3'));var rp=require(_0xf5b9('0x4'));var moment=require('moment');var BPromise=require(_0xf5b9('0x5'));var Mustache=require(_0xf5b9('0x6'));var util=require('util');var path=require(_0xf5b9('0x7'));var sox=require('sox');var csv=require(_0xf5b9('0x8'));var ejs=require(_0xf5b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5b9('0xa'));var squel=require(_0xf5b9('0xb'));var crypto=require(_0xf5b9('0xc'));var jsforce=require(_0xf5b9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf5b9('0x8'));var querystring=require(_0xf5b9('0xe'));var Papa=require(_0xf5b9('0xf'));var Redis=require('ioredis');var authService=require(_0xf5b9('0x10'));var qs=require(_0xf5b9('0x11'));var as=require(_0xf5b9('0x12'));var hardwareService=require(_0xf5b9('0x13'));var logger=require(_0xf5b9('0x14'))(_0xf5b9('0x15'));var utils=require(_0xf5b9('0x16'));var config=require(_0xf5b9('0x17'));var licenseUtil=require(_0xf5b9('0x18'));var db=require(_0xf5b9('0x19'))['db'];function respondWithStatusCode(_0x5b6d17,_0x2811f4){_0x2811f4=_0x2811f4||0xcc;return function(_0x5059e8){if(_0x5059e8){return _0x5b6d17[_0xf5b9('0x1a')](_0x2811f4);}return _0x5b6d17[_0xf5b9('0x1b')](_0x2811f4)[_0xf5b9('0x1c')]();};}function respondWithResult(_0x569ba5,_0x1d38b8){_0x1d38b8=_0x1d38b8||0xc8;return function(_0x406963){if(_0x406963){return _0x569ba5[_0xf5b9('0x1b')](_0x1d38b8)[_0xf5b9('0x1d')](_0x406963);}};}function respondWithFilteredResult(_0x178ae,_0x422038){return function(_0x4c5b97){if(_0x4c5b97){var _0x5bbd00=typeof _0x422038[_0xf5b9('0x1e')]===_0xf5b9('0x1f')&&typeof _0x422038[_0xf5b9('0x20')]==='undefined';var _0x37e583=_0x4c5b97[_0xf5b9('0x21')];var _0x566cbb=_0x5bbd00?0x0:_0x422038[_0xf5b9('0x1e')];var _0x429626=_0x5bbd00?_0x4c5b97['count']:_0x422038[_0xf5b9('0x1e')]+_0x422038[_0xf5b9('0x20')];var _0x3a4e59;if(_0x429626>=_0x37e583){_0x429626=_0x37e583;_0x3a4e59=0xc8;}else{_0x3a4e59=0xce;}_0x178ae[_0xf5b9('0x1b')](_0x3a4e59);return _0x178ae[_0xf5b9('0x22')]('Content-Range',_0x566cbb+'-'+_0x429626+'/'+_0x37e583)[_0xf5b9('0x1d')](_0x4c5b97);}return null;};}function patchUpdates(_0x454585){return function(_0xd0e684){try{jsonpatch[_0xf5b9('0x23')](_0xd0e684,_0x454585,!![]);}catch(_0x547897){return BPromise['reject'](_0x547897);}return _0xd0e684[_0xf5b9('0x24')]();};}function saveUpdates(_0x3fa7ca,_0x2917bf){return function(_0x58a4a6){if(_0x58a4a6){return _0x58a4a6[_0xf5b9('0x25')](_0x3fa7ca)['then'](function(_0x463ede){return _0x463ede;});}return null;};}function removeEntity(_0xa01f78,_0x51b1a4){return function(_0x51453a){if(_0x51453a){return _0x51453a[_0xf5b9('0x26')]()[_0xf5b9('0x27')](function(){_0xa01f78[_0xf5b9('0x1b')](0xcc)[_0xf5b9('0x1c')]();});}};}function handleEntityNotFound(_0x48cf87,_0x15fe7a){return function(_0x5d37b3){if(!_0x5d37b3){_0x48cf87['sendStatus'](0x194);}return _0x5d37b3;};}function handleError(_0x7c3a58,_0x18a63e){_0x18a63e=_0x18a63e||0x1f4;return function(_0x4051ad){logger[_0xf5b9('0x28')](_0x4051ad[_0xf5b9('0x29')]);if(_0x4051ad[_0xf5b9('0x2a')]){delete _0x4051ad[_0xf5b9('0x2a')];}_0x7c3a58[_0xf5b9('0x1b')](_0x18a63e)['send'](_0x4051ad);};}exports['index']=function(_0xfa0f5f,_0x9a2a10){var _0x317ad9={},_0x2705f5={},_0x5a0ac6={'count':0x0,'rows':[]};var _0x54e3d3=_['map'](db['AnalyticTreeReport'][_0xf5b9('0x2b')],function(_0x782f50){return{'name':_0x782f50[_0xf5b9('0x2c')],'type':_0x782f50[_0xf5b9('0x2d')][_0xf5b9('0x2e')]};});_0x2705f5['model']=_[_0xf5b9('0x2f')](_0x54e3d3,_0xf5b9('0x2a'));_0x2705f5[_0xf5b9('0x30')]=_['keys'](_0xfa0f5f[_0xf5b9('0x30')]);_0x2705f5[_0xf5b9('0x31')]=_[_0xf5b9('0x32')](_0x2705f5[_0xf5b9('0x33')],_0x2705f5[_0xf5b9('0x30')]);_0x317ad9[_0xf5b9('0x34')]=_[_0xf5b9('0x32')](_0x2705f5[_0xf5b9('0x33')],qs[_0xf5b9('0x35')](_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x35')]));_0x317ad9[_0xf5b9('0x34')]=_0x317ad9[_0xf5b9('0x34')]['length']?_0x317ad9[_0xf5b9('0x34')]:_0x2705f5['model'];if(!_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x36')](_0xf5b9('0x37'))){_0x317ad9[_0xf5b9('0x20')]=qs[_0xf5b9('0x20')](_0xfa0f5f[_0xf5b9('0x30')]['limit']);_0x317ad9['offset']=qs[_0xf5b9('0x1e')](_0xfa0f5f[_0xf5b9('0x30')]['offset']);}_0x317ad9['order']=qs[_0xf5b9('0x38')](_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x38')]);_0x317ad9[_0xf5b9('0x39')]=qs[_0xf5b9('0x31')](_[_0xf5b9('0x3a')](_0xfa0f5f[_0xf5b9('0x30')],_0x2705f5['filters']),_0x54e3d3);if(_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x3b')]){_0x317ad9['where']=_[_0xf5b9('0x3c')](_0x317ad9[_0xf5b9('0x39')],{'$or':_[_0xf5b9('0x2f')](_0x54e3d3,function(_0x26f7bf){if(_0x26f7bf[_0xf5b9('0x2d')]!==_0xf5b9('0x3d')){var _0x1bdd43={};_0x1bdd43[_0x26f7bf[_0xf5b9('0x2a')]]={'$like':'%'+_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x3b')]+'%'};return _0x1bdd43;}})});}_0x317ad9=_[_0xf5b9('0x3c')]({},_0x317ad9,_0xfa0f5f[_0xf5b9('0x3e')]);var _0xfb0cf9={'where':_0x317ad9[_0xf5b9('0x39')]};return db[_0xf5b9('0x3f')][_0xf5b9('0x21')](_0xfb0cf9)['then'](function(_0x478377){_0x5a0ac6[_0xf5b9('0x21')]=_0x478377;if(_0xfa0f5f[_0xf5b9('0x30')][_0xf5b9('0x40')]){_0x317ad9['include']=[{'all':!![]}];}return db[_0xf5b9('0x3f')][_0xf5b9('0x41')](_0x317ad9);})[_0xf5b9('0x27')](function(_0x5340b1){_0x5a0ac6[_0xf5b9('0x42')]=_0x5340b1;return _0x5a0ac6;})['then'](respondWithFilteredResult(_0x9a2a10,_0x317ad9))[_0xf5b9('0x43')](handleError(_0x9a2a10,null));};exports[_0xf5b9('0x44')]=function(_0x1c557d,_0x475003){var _0x215688={'raw':!![],'where':{'id':_0x1c557d['params']['id']}},_0x375a2d={};_0x375a2d['model']=_[_0xf5b9('0x45')](db[_0xf5b9('0x3f')][_0xf5b9('0x2b')]);_0x375a2d[_0xf5b9('0x30')]=_[_0xf5b9('0x45')](_0x1c557d[_0xf5b9('0x30')]);_0x375a2d[_0xf5b9('0x31')]=_['intersection'](_0x375a2d[_0xf5b9('0x33')],_0x375a2d['query']);_0x215688[_0xf5b9('0x34')]=_['intersection'](_0x375a2d[_0xf5b9('0x33')],qs[_0xf5b9('0x35')](_0x1c557d[_0xf5b9('0x30')]['fields']));_0x215688[_0xf5b9('0x34')]=_0x215688[_0xf5b9('0x34')][_0xf5b9('0x46')]?_0x215688['attributes']:_0x375a2d[_0xf5b9('0x33')];if(_0x1c557d[_0xf5b9('0x30')]['includeAll']){_0x215688[_0xf5b9('0x47')]=[{'all':!![]}];}_0x215688=_['merge']({},_0x215688,_0x1c557d[_0xf5b9('0x3e')]);return db['AnalyticTreeReport'][_0xf5b9('0x48')](_0x215688)['then'](handleEntityNotFound(_0x475003,null))['then'](respondWithResult(_0x475003,null))[_0xf5b9('0x43')](handleError(_0x475003,null));};exports[_0xf5b9('0x49')]=function(_0x445671,_0x497ac4){return db[_0xf5b9('0x3f')][_0xf5b9('0x49')](_0x445671[_0xf5b9('0x4a')],{})['then'](respondWithResult(_0x497ac4,0xc9))['catch'](handleError(_0x497ac4,null));};exports[_0xf5b9('0x25')]=function(_0x579f8d,_0x512db5){if(_0x579f8d[_0xf5b9('0x4a')]['id']){delete _0x579f8d[_0xf5b9('0x4a')]['id'];}return db[_0xf5b9('0x3f')][_0xf5b9('0x48')]({'where':{'id':_0x579f8d['params']['id']}})['then'](handleEntityNotFound(_0x512db5,null))[_0xf5b9('0x27')](saveUpdates(_0x579f8d['body'],null))[_0xf5b9('0x27')](respondWithResult(_0x512db5,null))['catch'](handleError(_0x512db5,null));};exports[_0xf5b9('0x26')]=function(_0x552d3a,_0x489eb3){return db[_0xf5b9('0x3f')][_0xf5b9('0x48')]({'where':{'id':_0x552d3a[_0xf5b9('0x4b')]['id']}})[_0xf5b9('0x27')](handleEntityNotFound(_0x489eb3,null))[_0xf5b9('0x27')](removeEntity(_0x489eb3,null))['catch'](handleError(_0x489eb3,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 6ff9ff5..a217b5c 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 _0x5113=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36c87d,_0x2ab247){var _0x54dc55=function(_0x2b4112){while(--_0x2b4112){_0x36c87d['push'](_0x36c87d['shift']());}};_0x54dc55(++_0x2ab247);}(_0x5113,0xc7));var _0x3511=function(_0xefb4e,_0xe56689){_0xefb4e=_0xefb4e-0x0;var _0x36c78c=_0x5113[_0xefb4e];return _0x36c78c;};'use strict';var _=require(_0x3511('0x0'));var util=require(_0x3511('0x1'));var logger=require(_0x3511('0x2'))(_0x3511('0x3'));var moment=require('moment');var BPromise=require(_0x3511('0x4'));var rp=require(_0x3511('0x5'));var fs=require('fs');var path=require(_0x3511('0x6'));var rimraf=require(_0x3511('0x7'));var config=require(_0x3511('0x8'));var attributes=require(_0x3511('0x9'));module['exports']=function(_0x36e04f,_0x26aecb){return _0x36e04f[_0x3511('0xa')](_0x3511('0xb'),attributes,{'tableName':_0x3511('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69e8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api'];(function(_0x41337f,_0x5e8443){var _0x417d2a=function(_0x4f3d38){while(--_0x4f3d38){_0x41337f['push'](_0x41337f['shift']());}};_0x417d2a(++_0x5e8443);}(_0x69e8,0x128));var _0x869e=function(_0x88b8bb,_0x471e65){_0x88b8bb=_0x88b8bb-0x0;var _0x5b814d=_0x69e8[_0x88b8bb];return _0x5b814d;};'use strict';var _=require(_0x869e('0x0'));var util=require(_0x869e('0x1'));var logger=require('../../config/logger')(_0x869e('0x2'));var moment=require(_0x869e('0x3'));var BPromise=require(_0x869e('0x4'));var rp=require(_0x869e('0x5'));var fs=require('fs');var path=require(_0x869e('0x6'));var rimraf=require(_0x869e('0x7'));var config=require(_0x869e('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0x869e('0x9')]=function(_0x137e73,_0x1d9b1b){return _0x137e73[_0x869e('0xa')](_0x869e('0xb'),attributes,{'tableName':_0x869e('0xc'),'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 982e6ae..84960e3 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x4c66c5,_0x420cb4){var _0x30bcd1=function(_0x28c52a){while(--_0x28c52a){_0x4c66c5['push'](_0x4c66c5['shift']());}};_0x30bcd1(++_0x420cb4);}(_0x1261,0x144));var _0x1126=function(_0x3441d5,_0x1ba541){_0x3441d5=_0x3441d5-0x0;var _0x45fdeb=_0x1261[_0x3441d5];return _0x45fdeb;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1f9e79,_0x21501e){var _0x577372=function(_0x1a9214){while(--_0x1a9214){_0x1f9e79['push'](_0x1f9e79['shift']());}};_0x577372(++_0x21501e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xc4aa[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 97fa8e9..d5d9bd1 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 _0x90b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0xeb7786,_0x53a053){var _0x120bbc=function(_0x291f05){while(--_0x291f05){_0xeb7786['push'](_0xeb7786['shift']());}};_0x120bbc(++_0x53a053);}(_0x90b0,0x1c4));var _0x090b=function(_0x14c250,_0x3a7fee){_0x14c250=_0x14c250-0x0;var _0xcfd064=_0x90b0[_0x14c250];return _0xcfd064;};'use strict';var multer=require(_0x090b('0x0'));var util=require(_0x090b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x090b('0x2')]();var fs_extra=require(_0x090b('0x3'));var auth=require(_0x090b('0x4'));var interaction=require(_0x090b('0x5'));var config=require(_0x090b('0x6'));var controller=require(_0x090b('0x7'));router[_0x090b('0x8')]('/',auth[_0x090b('0x9')](),controller['index']);router[_0x090b('0x8')](_0x090b('0xa'),auth['isAuthenticated'](),controller[_0x090b('0xb')]);router[_0x090b('0xc')]('/',auth['isAuthenticated'](),controller[_0x090b('0xd')]);router[_0x090b('0xe')](_0x090b('0xa'),auth[_0x090b('0x9')](),controller['update']);router[_0x090b('0xf')](_0x090b('0xa'),auth[_0x090b('0x9')](),controller[_0x090b('0x10')]);module[_0x090b('0x11')]=router; \ No newline at end of file +var _0xabeb=['multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x398e93,_0x29f631){var _0x45e9d4=function(_0x5da3a8){while(--_0x5da3a8){_0x398e93['push'](_0x398e93['shift']());}};_0x45e9d4(++_0x29f631);}(_0xabeb,0x1dc));var _0xbabe=function(_0x5428f5,_0x363285){_0x5428f5=_0x5428f5-0x0;var _0xf745ce=_0xabeb[_0x5428f5];return _0xf745ce;};'use strict';var multer=require(_0xbabe('0x0'));var util=require(_0xbabe('0x1'));var path=require('path');var timeout=require(_0xbabe('0x2'));var express=require(_0xbabe('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbabe('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbabe('0x5'));var controller=require('./analyticTreeReport.controller');router[_0xbabe('0x6')]('/',auth['isAuthenticated'](),controller[_0xbabe('0x7')]);router['get'](_0xbabe('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xbabe('0x9')]('/',auth[_0xbabe('0xa')](),controller[_0xbabe('0xb')]);router[_0xbabe('0xc')](_0xbabe('0x8'),auth[_0xbabe('0xa')](),controller[_0xbabe('0xd')]);router[_0xbabe('0xe')](_0xbabe('0x8'),auth[_0xbabe('0xa')](),controller[_0xbabe('0xf')]);module[_0xbabe('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index ab2139d..729ea49 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 _0xe79f=['sequelize','STRING'];(function(_0x77798b,_0x366310){var _0x2056eb=function(_0x1d2e91){while(--_0x1d2e91){_0x77798b['push'](_0x77798b['shift']());}};_0x2056eb(++_0x366310);}(_0xe79f,0x13a));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe79('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe79('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfe79('0x1')]}}; \ No newline at end of file +var _0x0506=['sequelize','exports','STRING'];(function(_0x1a477e,_0x3919ec){var _0x445188=function(_0x4e67c0){while(--_0x4e67c0){_0x1a477e['push'](_0x1a477e['shift']());}};_0x445188(++_0x3919ec);}(_0x0506,0x1d1));var _0x6050=function(_0x4370bf,_0x276311){_0x4370bf=_0x4370bf-0x0;var _0x4a9b22=_0x0506[_0x4370bf];return _0x4a9b22;};'use strict';var Sequelize=require(_0x6050('0x0'));module[_0x6050('0x1')]={'name':{'type':Sequelize[_0x6050('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index ba47af0..4bc3358 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 _0xb940=['filename','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','intersection','attributes','query','fields','length','nolimit','order','sort','where','filters','pick','merge','options','include','findAll','rows','catch','params','keys','includeAll','clone','createdAt','omit','updatedAt','create','body','find','file','originalname','basename'];(function(_0x103277,_0x15a2a2){var _0x45c58f=function(_0xd91f6c){while(--_0xd91f6c){_0x103277['push'](_0x103277['shift']());}};_0x45c58f(++_0x15a2a2);}(_0xb940,0xf4));var _0x0b94=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0xb940[_0x1ae8ab];return _0x1ad705;};'use strict';var emlformat=require(_0x0b94('0x0'));var rimraf=require(_0x0b94('0x1'));var zipdir=require(_0x0b94('0x2'));var jsonpatch=require(_0x0b94('0x3'));var rp=require(_0x0b94('0x4'));var moment=require('moment');var BPromise=require(_0x0b94('0x5'));var Mustache=require(_0x0b94('0x6'));var util=require(_0x0b94('0x7'));var path=require(_0x0b94('0x8'));var sox=require('sox');var csv=require(_0x0b94('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0b94('0xa'));var _=require('lodash');var squel=require(_0x0b94('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0b94('0x9'));var querystring=require(_0x0b94('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0b94('0xd'));var as=require(_0x0b94('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0b94('0xf'));var utils=require(_0x0b94('0x10'));var config=require(_0x0b94('0x11'));var licenseUtil=require(_0x0b94('0x12'));var db=require(_0x0b94('0x13'))['db'];function respondWithStatusCode(_0x224403,_0x5e8809){_0x5e8809=_0x5e8809||0xcc;return function(_0xc6f13b){if(_0xc6f13b){return _0x224403[_0x0b94('0x14')](_0x5e8809);}return _0x224403[_0x0b94('0x15')](_0x5e8809)[_0x0b94('0x16')]();};}function respondWithResult(_0x194672,_0x1b8b7d){_0x1b8b7d=_0x1b8b7d||0xc8;return function(_0x24d9d9){if(_0x24d9d9){return _0x194672[_0x0b94('0x15')](_0x1b8b7d)['json'](_0x24d9d9);}};}function respondWithFilteredResult(_0x5a34be,_0x162397){return function(_0x337240){if(_0x337240){var _0x3b85c5=typeof _0x162397[_0x0b94('0x17')]===_0x0b94('0x18')&&typeof _0x162397[_0x0b94('0x19')]==='undefined';var _0x153b1d=_0x337240[_0x0b94('0x1a')];var _0xd485a=_0x3b85c5?0x0:_0x162397[_0x0b94('0x17')];var _0x17fab3=_0x3b85c5?_0x337240['count']:_0x162397[_0x0b94('0x17')]+_0x162397[_0x0b94('0x19')];var _0x146ab9;if(_0x17fab3>=_0x153b1d){_0x17fab3=_0x153b1d;_0x146ab9=0xc8;}else{_0x146ab9=0xce;}_0x5a34be[_0x0b94('0x15')](_0x146ab9);return _0x5a34be['set'](_0x0b94('0x1b'),_0xd485a+'-'+_0x17fab3+'/'+_0x153b1d)['json'](_0x337240);}return null;};}function patchUpdates(_0x4a9ae4){return function(_0x75b2ec){try{jsonpatch[_0x0b94('0x1c')](_0x75b2ec,_0x4a9ae4,!![]);}catch(_0x31e6d4){return BPromise[_0x0b94('0x1d')](_0x31e6d4);}return _0x75b2ec['save']();};}function saveUpdates(_0x10a404,_0x4225dd){return function(_0x5a1e68){if(_0x5a1e68){return _0x5a1e68[_0x0b94('0x1e')](_0x10a404)[_0x0b94('0x1f')](function(_0x69c3bf){return _0x69c3bf;});}return null;};}function removeEntity(_0x3520b2,_0x194e06){return function(_0x72c5ee){if(_0x72c5ee){return _0x72c5ee['destroy']()[_0x0b94('0x1f')](function(){_0x3520b2[_0x0b94('0x15')](0xcc)[_0x0b94('0x16')]();});}};}function handleEntityNotFound(_0x3660af,_0x24c2c4){return function(_0x55293d){if(!_0x55293d){_0x3660af[_0x0b94('0x14')](0x194);}return _0x55293d;};}function handleError(_0x57f02d,_0x2d5e11){_0x2d5e11=_0x2d5e11||0x1f4;return function(_0xc0303d){logger['error'](_0xc0303d[_0x0b94('0x20')]);if(_0xc0303d[_0x0b94('0x21')]){delete _0xc0303d[_0x0b94('0x21')];}_0x57f02d[_0x0b94('0x15')](_0x2d5e11)[_0x0b94('0x22')](_0xc0303d);};}exports[_0x0b94('0x23')]=function(_0x335379,_0x251fc2){var _0x49be9e={},_0x3a9845={},_0x3da7d4={'count':0x0,'rows':[]};var _0x5e6472=_[_0x0b94('0x24')](db[_0x0b94('0x25')][_0x0b94('0x26')],function(_0x5e0fc6){return{'name':_0x5e0fc6[_0x0b94('0x27')],'type':_0x5e0fc6['type'][_0x0b94('0x28')]};});_0x3a9845[_0x0b94('0x29')]=_[_0x0b94('0x24')](_0x5e6472,_0x0b94('0x21'));_0x3a9845['query']=_['keys'](_0x335379['query']);_0x3a9845['filters']=_[_0x0b94('0x2a')](_0x3a9845[_0x0b94('0x29')],_0x3a9845['query']);_0x49be9e[_0x0b94('0x2b')]=_['intersection'](_0x3a9845[_0x0b94('0x29')],qs['fields'](_0x335379[_0x0b94('0x2c')][_0x0b94('0x2d')]));_0x49be9e['attributes']=_0x49be9e[_0x0b94('0x2b')][_0x0b94('0x2e')]?_0x49be9e['attributes']:_0x3a9845[_0x0b94('0x29')];if(!_0x335379[_0x0b94('0x2c')]['hasOwnProperty'](_0x0b94('0x2f'))){_0x49be9e[_0x0b94('0x19')]=qs[_0x0b94('0x19')](_0x335379[_0x0b94('0x2c')][_0x0b94('0x19')]);_0x49be9e['offset']=qs[_0x0b94('0x17')](_0x335379['query'][_0x0b94('0x17')]);}_0x49be9e[_0x0b94('0x30')]=qs[_0x0b94('0x31')](_0x335379[_0x0b94('0x2c')]['sort']);_0x49be9e[_0x0b94('0x32')]=qs[_0x0b94('0x33')](_[_0x0b94('0x34')](_0x335379[_0x0b94('0x2c')],_0x3a9845[_0x0b94('0x33')]),_0x5e6472);if(_0x335379[_0x0b94('0x2c')]['filter']){_0x49be9e[_0x0b94('0x32')]=_[_0x0b94('0x35')](_0x49be9e[_0x0b94('0x32')],{'$or':_[_0x0b94('0x24')](_0x5e6472,function(_0x304aa0){if(_0x304aa0['type']!=='VIRTUAL'){var _0x54def0={};_0x54def0[_0x304aa0[_0x0b94('0x21')]]={'$like':'%'+_0x335379[_0x0b94('0x2c')]['filter']+'%'};return _0x54def0;}})});}_0x49be9e=_[_0x0b94('0x35')]({},_0x49be9e,_0x335379[_0x0b94('0x36')]);var _0x26627f={'where':_0x49be9e[_0x0b94('0x32')]};return db[_0x0b94('0x25')][_0x0b94('0x1a')](_0x26627f)[_0x0b94('0x1f')](function(_0x1fc02d){_0x3da7d4[_0x0b94('0x1a')]=_0x1fc02d;if(_0x335379[_0x0b94('0x2c')]['includeAll']){_0x49be9e[_0x0b94('0x37')]=[{'all':!![]}];}return db[_0x0b94('0x25')][_0x0b94('0x38')](_0x49be9e);})[_0x0b94('0x1f')](function(_0x1446e2){_0x3da7d4[_0x0b94('0x39')]=_0x1446e2;return _0x3da7d4;})[_0x0b94('0x1f')](respondWithFilteredResult(_0x251fc2,_0x49be9e))[_0x0b94('0x3a')](handleError(_0x251fc2,null));};exports['show']=function(_0x1e8805,_0xa44bd5){var _0x4edc2c={'raw':!![],'where':{'id':_0x1e8805[_0x0b94('0x3b')]['id']}},_0x1e0fbd={};_0x1e0fbd[_0x0b94('0x29')]=_[_0x0b94('0x3c')](db['Attachment'][_0x0b94('0x26')]);_0x1e0fbd['query']=_['keys'](_0x1e8805[_0x0b94('0x2c')]);_0x1e0fbd[_0x0b94('0x33')]=_[_0x0b94('0x2a')](_0x1e0fbd[_0x0b94('0x29')],_0x1e0fbd['query']);_0x4edc2c[_0x0b94('0x2b')]=_['intersection'](_0x1e0fbd[_0x0b94('0x29')],qs[_0x0b94('0x2d')](_0x1e8805[_0x0b94('0x2c')][_0x0b94('0x2d')]));_0x4edc2c[_0x0b94('0x2b')]=_0x4edc2c['attributes']['length']?_0x4edc2c[_0x0b94('0x2b')]:_0x1e0fbd[_0x0b94('0x29')];if(_0x1e8805[_0x0b94('0x2c')][_0x0b94('0x3d')]){_0x4edc2c['include']=[{'all':!![]}];}_0x4edc2c=_[_0x0b94('0x35')]({},_0x4edc2c,_0x1e8805[_0x0b94('0x36')]);return db[_0x0b94('0x25')]['find'](_0x4edc2c)[_0x0b94('0x1f')](handleEntityNotFound(_0xa44bd5,null))[_0x0b94('0x1f')](respondWithResult(_0xa44bd5,null))[_0x0b94('0x3a')](handleError(_0xa44bd5,null));};exports[_0x0b94('0x3e')]=function(_0x14bce5,_0x144291){var _0x27706d={'where':{'id':_0x14bce5[_0x0b94('0x3b')]['id']}},_0x647081={};_0x647081[_0x0b94('0x29')]=_[_0x0b94('0x3c')](db[_0x0b94('0x25')][_0x0b94('0x26')]);_0x27706d[_0x0b94('0x2b')]=_[_0x0b94('0x2a')](_0x647081[_0x0b94('0x29')],qs[_0x0b94('0x2d')](_0x14bce5[_0x0b94('0x2c')][_0x0b94('0x2d')]));_0x27706d['attributes']=_0x27706d[_0x0b94('0x2b')]['length']?_0x27706d[_0x0b94('0x2b')]:_0x647081['model'];if(_0x14bce5[_0x0b94('0x2c')][_0x0b94('0x3d')]){_0x27706d[_0x0b94('0x37')]=[{'all':!![]}];}_0x27706d=_[_0x0b94('0x35')]({},_0x27706d,_0x14bce5[_0x0b94('0x36')]);return db[_0x0b94('0x25')]['find'](_0x27706d)[_0x0b94('0x1f')](handleEntityNotFound(_0x144291,null))[_0x0b94('0x1f')](function(_0x55c1b5){if(_0x55c1b5){var _0x47f2ad=_0x55c1b5['get']({'plain':!![]});_0x47f2ad=qs['omit'](_0x47f2ad,['id',_0x0b94('0x3f'),'updatedAt']);_0x14bce5['body']=_[_0x0b94('0x40')](_0x14bce5['body'],['id',_0x0b94('0x3f'),_0x0b94('0x41')]);return db['Attachment'][_0x0b94('0x42')](_['merge'](_0x47f2ad,_0x14bce5[_0x0b94('0x43')]),{'include':_0x14bce5[_0x0b94('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x144291,0xc9))[_0x0b94('0x3a')](handleError(_0x144291,null));};exports[_0x0b94('0x1e')]=function(_0x161ca0,_0x4e12f2){if(_0x161ca0[_0x0b94('0x43')]['id']){delete _0x161ca0[_0x0b94('0x43')]['id'];}return db[_0x0b94('0x25')][_0x0b94('0x44')]({'where':{'id':_0x161ca0[_0x0b94('0x3b')]['id']}})[_0x0b94('0x1f')](handleEntityNotFound(_0x4e12f2,null))[_0x0b94('0x1f')](saveUpdates(_0x161ca0[_0x0b94('0x43')],null))[_0x0b94('0x1f')](respondWithResult(_0x4e12f2,null))['catch'](handleError(_0x4e12f2,null));};exports['destroy']=function(_0x3bd8d2,_0xf13e8d){return db['Attachment'][_0x0b94('0x44')]({'where':{'id':_0x3bd8d2[_0x0b94('0x3b')]['id']}})[_0x0b94('0x1f')](handleEntityNotFound(_0xf13e8d,null))[_0x0b94('0x1f')](removeEntity(_0xf13e8d,null))[_0x0b94('0x3a')](handleError(_0xf13e8d,null));};exports['create']=function(_0x53c3cc,_0x5b486c,_0xd585b1){_0x53c3cc['body'][_0x0b94('0x21')]=_0x53c3cc[_0x0b94('0x45')][_0x0b94('0x46')];_0x53c3cc[_0x0b94('0x43')][_0x0b94('0x47')]=_0x53c3cc[_0x0b94('0x45')][_0x0b94('0x48')];_0x53c3cc[_0x0b94('0x43')]['type']=_0x53c3cc[_0x0b94('0x45')]['mimetype'];return db[_0x0b94('0x25')][_0x0b94('0x42')](_0x53c3cc[_0x0b94('0x43')])[_0x0b94('0x1f')](respondWithResult(_0x5b486c,0xc9))[_0x0b94('0x3a')](handleError(_0x5b486c,null));};exports[_0x0b94('0x49')]=function(_0x4e3672,_0x519091,_0x25af88){return db['Attachment'][_0x0b94('0x4a')]({'where':{'id':_0x4e3672[_0x0b94('0x3b')]['id']},'raw':!![]})[_0x0b94('0x1f')](handleEntityNotFound(_0x519091,null))['then'](function(_0x28abe6){if(_0x28abe6){var _0x189a08=_0x28abe6['ChatOfflineMessageId']!==null;var _0xcd3b3a=path[_0x0b94('0x4b')](config[_0x0b94('0x4c')],_0x0b94('0x4d'));if(_0x189a08){_0xcd3b3a=path['join'](_0xcd3b3a,_0x0b94('0x4e'));}var _0x3c0d40=path[_0x0b94('0x4b')](_0xcd3b3a,_0x28abe6[_0x0b94('0x47')]);return _0x519091[_0x0b94('0x49')](_0x3c0d40);}})[_0x0b94('0x3a')](handleError(_0x519091,null));}; \ No newline at end of file +var _0xcc2f=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','Attachment','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','rows','show','params','options','find','catch','keys','body','omit','createdAt','updatedAt','create','file','originalname','basename','filename','type','mimetype','download','ChatOfflineMessageId','join','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json'];(function(_0xa15452,_0x340aa5){var _0x40c66a=function(_0x31cc23){while(--_0x31cc23){_0xa15452['push'](_0xa15452['shift']());}};_0x40c66a(++_0x340aa5);}(_0xcc2f,0xec));var _0xfcc2=function(_0x26cfd6,_0xccbaba){_0x26cfd6=_0x26cfd6-0x0;var _0x3baa29=_0xcc2f[_0x26cfd6];return _0x3baa29;};'use strict';var emlformat=require(_0xfcc2('0x0'));var rimraf=require(_0xfcc2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcc2('0x2'));var moment=require(_0xfcc2('0x3'));var BPromise=require(_0xfcc2('0x4'));var Mustache=require('mustache');var util=require(_0xfcc2('0x5'));var path=require(_0xfcc2('0x6'));var sox=require(_0xfcc2('0x7'));var csv=require(_0xfcc2('0x8'));var ejs=require(_0xfcc2('0x9'));var fs=require('fs');var fs_extra=require(_0xfcc2('0xa'));var _=require('lodash');var squel=require(_0xfcc2('0xb'));var crypto=require(_0xfcc2('0xc'));var jsforce=require(_0xfcc2('0xd'));var deskjs=require(_0xfcc2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfcc2('0xf'));var Redis=require(_0xfcc2('0x10'));var authService=require(_0xfcc2('0x11'));var qs=require(_0xfcc2('0x12'));var as=require(_0xfcc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfcc2('0x14'))(_0xfcc2('0x15'));var utils=require(_0xfcc2('0x16'));var config=require(_0xfcc2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcc2('0x18'))['db'];function respondWithStatusCode(_0x517453,_0x16f8ea){_0x16f8ea=_0x16f8ea||0xcc;return function(_0x5ceb32){if(_0x5ceb32){return _0x517453[_0xfcc2('0x19')](_0x16f8ea);}return _0x517453[_0xfcc2('0x1a')](_0x16f8ea)['end']();};}function respondWithResult(_0x404214,_0x2faf63){_0x2faf63=_0x2faf63||0xc8;return function(_0x3a9fc0){if(_0x3a9fc0){return _0x404214[_0xfcc2('0x1a')](_0x2faf63)[_0xfcc2('0x1b')](_0x3a9fc0);}};}function respondWithFilteredResult(_0x1353df,_0x138af9){return function(_0x124974){if(_0x124974){var _0x513e62=typeof _0x138af9[_0xfcc2('0x1c')]===_0xfcc2('0x1d')&&typeof _0x138af9[_0xfcc2('0x1e')]===_0xfcc2('0x1d');var _0xd89c54=_0x124974[_0xfcc2('0x1f')];var _0x1393de=_0x513e62?0x0:_0x138af9['offset'];var _0x277a44=_0x513e62?_0x124974[_0xfcc2('0x1f')]:_0x138af9[_0xfcc2('0x1c')]+_0x138af9[_0xfcc2('0x1e')];var _0x4ff707;if(_0x277a44>=_0xd89c54){_0x277a44=_0xd89c54;_0x4ff707=0xc8;}else{_0x4ff707=0xce;}_0x1353df[_0xfcc2('0x1a')](_0x4ff707);return _0x1353df['set'](_0xfcc2('0x20'),_0x1393de+'-'+_0x277a44+'/'+_0xd89c54)[_0xfcc2('0x1b')](_0x124974);}return null;};}function patchUpdates(_0x19287d){return function(_0x3bac3b){try{jsonpatch[_0xfcc2('0x21')](_0x3bac3b,_0x19287d,!![]);}catch(_0x18bddb){return BPromise[_0xfcc2('0x22')](_0x18bddb);}return _0x3bac3b[_0xfcc2('0x23')]();};}function saveUpdates(_0x558ea6,_0x59b928){return function(_0x33a701){if(_0x33a701){return _0x33a701[_0xfcc2('0x24')](_0x558ea6)[_0xfcc2('0x25')](function(_0x45a179){return _0x45a179;});}return null;};}function removeEntity(_0x162e8c,_0x463abb){return function(_0xebefe9){if(_0xebefe9){return _0xebefe9[_0xfcc2('0x26')]()[_0xfcc2('0x25')](function(){_0x162e8c['status'](0xcc)[_0xfcc2('0x27')]();});}};}function handleEntityNotFound(_0x42dc14,_0x399ae8){return function(_0x27e6c0){if(!_0x27e6c0){_0x42dc14['sendStatus'](0x194);}return _0x27e6c0;};}function handleError(_0x2fdcf8,_0x23ba82){_0x23ba82=_0x23ba82||0x1f4;return function(_0x3df6e6){logger[_0xfcc2('0x28')](_0x3df6e6[_0xfcc2('0x29')]);if(_0x3df6e6[_0xfcc2('0x2a')]){delete _0x3df6e6[_0xfcc2('0x2a')];}_0x2fdcf8[_0xfcc2('0x1a')](_0x23ba82)[_0xfcc2('0x2b')](_0x3df6e6);};}exports['index']=function(_0x3cc8a0,_0x10341c){var _0x9f6d8d={},_0x32dc6e={},_0xd4e549={'count':0x0,'rows':[]};var _0x4643da=_[_0xfcc2('0x2c')](db[_0xfcc2('0x2d')][_0xfcc2('0x2e')],function(_0x509eab){return{'name':_0x509eab[_0xfcc2('0x2f')],'type':_0x509eab['type'][_0xfcc2('0x30')]};});_0x32dc6e[_0xfcc2('0x31')]=_['map'](_0x4643da,_0xfcc2('0x2a'));_0x32dc6e[_0xfcc2('0x32')]=_['keys'](_0x3cc8a0['query']);_0x32dc6e[_0xfcc2('0x33')]=_[_0xfcc2('0x34')](_0x32dc6e[_0xfcc2('0x31')],_0x32dc6e[_0xfcc2('0x32')]);_0x9f6d8d[_0xfcc2('0x35')]=_['intersection'](_0x32dc6e[_0xfcc2('0x31')],qs[_0xfcc2('0x36')](_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x36')]));_0x9f6d8d[_0xfcc2('0x35')]=_0x9f6d8d[_0xfcc2('0x35')][_0xfcc2('0x37')]?_0x9f6d8d['attributes']:_0x32dc6e[_0xfcc2('0x31')];if(!_0x3cc8a0[_0xfcc2('0x32')]['hasOwnProperty'](_0xfcc2('0x38'))){_0x9f6d8d[_0xfcc2('0x1e')]=qs[_0xfcc2('0x1e')](_0x3cc8a0['query'][_0xfcc2('0x1e')]);_0x9f6d8d[_0xfcc2('0x1c')]=qs[_0xfcc2('0x1c')](_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x1c')]);}_0x9f6d8d[_0xfcc2('0x39')]=qs[_0xfcc2('0x3a')](_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x3a')]);_0x9f6d8d['where']=qs['filters'](_[_0xfcc2('0x3b')](_0x3cc8a0[_0xfcc2('0x32')],_0x32dc6e[_0xfcc2('0x33')]),_0x4643da);if(_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x3c')]){_0x9f6d8d[_0xfcc2('0x3d')]=_['merge'](_0x9f6d8d[_0xfcc2('0x3d')],{'$or':_[_0xfcc2('0x2c')](_0x4643da,function(_0x2ddf7b){if(_0x2ddf7b['type']!==_0xfcc2('0x3e')){var _0x36ba7e={};_0x36ba7e[_0x2ddf7b[_0xfcc2('0x2a')]]={'$like':'%'+_0x3cc8a0[_0xfcc2('0x32')][_0xfcc2('0x3c')]+'%'};return _0x36ba7e;}})});}_0x9f6d8d=_[_0xfcc2('0x3f')]({},_0x9f6d8d,_0x3cc8a0['options']);var _0x1b1ffd={'where':_0x9f6d8d[_0xfcc2('0x3d')]};return db[_0xfcc2('0x2d')][_0xfcc2('0x1f')](_0x1b1ffd)[_0xfcc2('0x25')](function(_0x27de27){_0xd4e549[_0xfcc2('0x1f')]=_0x27de27;if(_0x3cc8a0['query'][_0xfcc2('0x40')]){_0x9f6d8d[_0xfcc2('0x41')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x9f6d8d);})[_0xfcc2('0x25')](function(_0x2c0618){_0xd4e549[_0xfcc2('0x42')]=_0x2c0618;return _0xd4e549;})['then'](respondWithFilteredResult(_0x10341c,_0x9f6d8d))['catch'](handleError(_0x10341c,null));};exports[_0xfcc2('0x43')]=function(_0x415714,_0x35e598){var _0x54309f={'raw':!![],'where':{'id':_0x415714[_0xfcc2('0x44')]['id']}},_0x2c1db2={};_0x2c1db2[_0xfcc2('0x31')]=_['keys'](db[_0xfcc2('0x2d')]['rawAttributes']);_0x2c1db2[_0xfcc2('0x32')]=_['keys'](_0x415714[_0xfcc2('0x32')]);_0x2c1db2[_0xfcc2('0x33')]=_[_0xfcc2('0x34')](_0x2c1db2[_0xfcc2('0x31')],_0x2c1db2[_0xfcc2('0x32')]);_0x54309f[_0xfcc2('0x35')]=_['intersection'](_0x2c1db2['model'],qs['fields'](_0x415714[_0xfcc2('0x32')][_0xfcc2('0x36')]));_0x54309f[_0xfcc2('0x35')]=_0x54309f[_0xfcc2('0x35')][_0xfcc2('0x37')]?_0x54309f[_0xfcc2('0x35')]:_0x2c1db2[_0xfcc2('0x31')];if(_0x415714[_0xfcc2('0x32')][_0xfcc2('0x40')]){_0x54309f[_0xfcc2('0x41')]=[{'all':!![]}];}_0x54309f=_[_0xfcc2('0x3f')]({},_0x54309f,_0x415714[_0xfcc2('0x45')]);return db[_0xfcc2('0x2d')][_0xfcc2('0x46')](_0x54309f)[_0xfcc2('0x25')](handleEntityNotFound(_0x35e598,null))[_0xfcc2('0x25')](respondWithResult(_0x35e598,null))[_0xfcc2('0x47')](handleError(_0x35e598,null));};exports['clone']=function(_0x5eafb7,_0x29af4b){var _0x3063b0={'where':{'id':_0x5eafb7[_0xfcc2('0x44')]['id']}},_0x565ed4={};_0x565ed4[_0xfcc2('0x31')]=_[_0xfcc2('0x48')](db[_0xfcc2('0x2d')][_0xfcc2('0x2e')]);_0x3063b0[_0xfcc2('0x35')]=_[_0xfcc2('0x34')](_0x565ed4[_0xfcc2('0x31')],qs[_0xfcc2('0x36')](_0x5eafb7[_0xfcc2('0x32')][_0xfcc2('0x36')]));_0x3063b0['attributes']=_0x3063b0['attributes']['length']?_0x3063b0[_0xfcc2('0x35')]:_0x565ed4[_0xfcc2('0x31')];if(_0x5eafb7[_0xfcc2('0x32')][_0xfcc2('0x40')]){_0x3063b0[_0xfcc2('0x41')]=[{'all':!![]}];}_0x3063b0=_[_0xfcc2('0x3f')]({},_0x3063b0,_0x5eafb7['options']);return db[_0xfcc2('0x2d')][_0xfcc2('0x46')](_0x3063b0)[_0xfcc2('0x25')](handleEntityNotFound(_0x29af4b,null))[_0xfcc2('0x25')](function(_0xd1b9de){if(_0xd1b9de){var _0x3a8100=_0xd1b9de['get']({'plain':!![]});_0x3a8100=qs['omit'](_0x3a8100,['id','createdAt','updatedAt']);_0x5eafb7[_0xfcc2('0x49')]=_[_0xfcc2('0x4a')](_0x5eafb7[_0xfcc2('0x49')],['id',_0xfcc2('0x4b'),_0xfcc2('0x4c')]);return db[_0xfcc2('0x2d')][_0xfcc2('0x4d')](_[_0xfcc2('0x3f')](_0x3a8100,_0x5eafb7[_0xfcc2('0x49')]),{'include':_0x5eafb7[_0xfcc2('0x32')][_0xfcc2('0x40')]?[{'all':!![]}]:undefined});}})[_0xfcc2('0x25')](respondWithResult(_0x29af4b,0xc9))['catch'](handleError(_0x29af4b,null));};exports[_0xfcc2('0x24')]=function(_0x196a6a,_0x2b0ab3){if(_0x196a6a[_0xfcc2('0x49')]['id']){delete _0x196a6a[_0xfcc2('0x49')]['id'];}return db[_0xfcc2('0x2d')][_0xfcc2('0x46')]({'where':{'id':_0x196a6a['params']['id']}})[_0xfcc2('0x25')](handleEntityNotFound(_0x2b0ab3,null))[_0xfcc2('0x25')](saveUpdates(_0x196a6a['body'],null))['then'](respondWithResult(_0x2b0ab3,null))[_0xfcc2('0x47')](handleError(_0x2b0ab3,null));};exports[_0xfcc2('0x26')]=function(_0x2f558a,_0x3f6815){return db[_0xfcc2('0x2d')][_0xfcc2('0x46')]({'where':{'id':_0x2f558a['params']['id']}})[_0xfcc2('0x25')](handleEntityNotFound(_0x3f6815,null))['then'](removeEntity(_0x3f6815,null))[_0xfcc2('0x47')](handleError(_0x3f6815,null));};exports[_0xfcc2('0x4d')]=function(_0x59e77b,_0x3b9c17,_0x4fe69d){_0x59e77b[_0xfcc2('0x49')][_0xfcc2('0x2a')]=_0x59e77b[_0xfcc2('0x4e')][_0xfcc2('0x4f')];_0x59e77b[_0xfcc2('0x49')][_0xfcc2('0x50')]=_0x59e77b['file'][_0xfcc2('0x51')];_0x59e77b[_0xfcc2('0x49')][_0xfcc2('0x52')]=_0x59e77b[_0xfcc2('0x4e')][_0xfcc2('0x53')];return db[_0xfcc2('0x2d')][_0xfcc2('0x4d')](_0x59e77b[_0xfcc2('0x49')])['then'](respondWithResult(_0x3b9c17,0xc9))[_0xfcc2('0x47')](handleError(_0x3b9c17,null));};exports[_0xfcc2('0x54')]=function(_0x5d7b8c,_0x571e93,_0x113aef){return db[_0xfcc2('0x2d')]['findOne']({'where':{'id':_0x5d7b8c['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x571e93,null))[_0xfcc2('0x25')](function(_0x1eadd3){if(_0x1eadd3){var _0x2ceb2c=_0x1eadd3[_0xfcc2('0x55')]!==null;var _0x256758=path[_0xfcc2('0x56')](config['root'],'server/files/attachments/');if(_0x2ceb2c){_0x256758=path[_0xfcc2('0x56')](_0x256758,_0xfcc2('0x57'));}var _0x51791f=path['join'](_0x256758,_0x1eadd3[_0xfcc2('0x50')]);return _0x571e93['download'](_0x51791f);}})[_0xfcc2('0x47')](handleError(_0x571e93,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 4dc6bad..9500053 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 _0x9260=['../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x3d1bd5,_0x13dcdb){var _0x3f0d95=function(_0x4d5296){while(--_0x4d5296){_0x3d1bd5['push'](_0x3d1bd5['shift']());}};_0x3f0d95(++_0x13dcdb);}(_0x9260,0x1e5));var _0x0926=function(_0x3e2672,_0x115421){_0x3e2672=_0x3e2672-0x0;var _0x5ac536=_0x9260[_0x3e2672];return _0x5ac536;};'use strict';var _=require(_0x0926('0x0'));var util=require(_0x0926('0x1'));var logger=require(_0x0926('0x2'))(_0x0926('0x3'));var moment=require(_0x0926('0x4'));var BPromise=require(_0x0926('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0926('0x6'));var rimraf=require('rimraf');var config=require(_0x0926('0x7'));var attributes=require('./attachment.attributes');module[_0x0926('0x8')]=function(_0x54cdaa,_0x32275f){return _0x54cdaa[_0x0926('0x9')](_0x0926('0xa'),attributes,{'tableName':_0x0926('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa39d=['exports','Attachment','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0xa39d,0xe9));var _0xda39=function(_0xebe551,_0x5100ba){_0xebe551=_0xebe551-0x0;var _0xc8a29c=_0xa39d[_0xebe551];return _0xc8a29c;};'use strict';var _=require('lodash');var util=require(_0xda39('0x0'));var logger=require(_0xda39('0x1'))(_0xda39('0x2'));var moment=require(_0xda39('0x3'));var BPromise=require('bluebird');var rp=require(_0xda39('0x4'));var fs=require('fs');var path=require(_0xda39('0x5'));var rimraf=require(_0xda39('0x6'));var config=require(_0xda39('0x7'));var attributes=require(_0xda39('0x8'));module[_0xda39('0x9')]=function(_0x8800fa,_0x2dbc76){return _0x8800fa['define'](_0xda39('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index f0ae5e1..5607ab8 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 _0x85b5=['catch','CreateAttachment','Attachment','create','options','raw','stringify','lodash','util','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85b5,0x7f));var _0x585b=function(_0x48730c,_0x202cca){_0x48730c=_0x48730c-0x0;var _0x413620=_0x85b5[_0x48730c];return _0x413620;};'use strict';var _=require(_0x585b('0x0'));var util=require(_0x585b('0x1'));var moment=require('moment');var BPromise=require(_0x585b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x585b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x585b('0x4'))('rpc');var config=require(_0x585b('0x5'));var jayson=require(_0x585b('0x6'));var client=jayson[_0x585b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1605b5,_0x55ffb3,_0x432e2d){return new BPromise(function(_0x2f8895,_0x3c3c0b){return client[_0x585b('0x8')](_0x1605b5,_0x432e2d)['then'](function(_0x8b5f63){logger[_0x585b('0x9')](_0x585b('0xa'),_0x55ffb3,_0x585b('0xb'));logger[_0x585b('0xc')](_0x585b('0xd'),_0x55ffb3,_0x585b('0xb'),JSON['stringify'](_0x8b5f63));if(_0x8b5f63[_0x585b('0xe')]){if(_0x8b5f63['error'][_0x585b('0xf')]===0x1f4){logger['error'](_0x585b('0xa'),_0x55ffb3,_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);return _0x3c3c0b(_0x8b5f63['error'][_0x585b('0x10')]);}logger[_0x585b('0xe')](_0x585b('0xa'),_0x55ffb3,_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);return _0x2f8895(_0x8b5f63[_0x585b('0xe')][_0x585b('0x10')]);}else{logger['info'](_0x585b('0xa'),_0x55ffb3,_0x585b('0xb'));_0x2f8895(_0x8b5f63['result']['message']);}})[_0x585b('0x11')](function(_0x4f2224){logger['error'](_0x585b('0xa'),_0x55ffb3,_0x4f2224);_0x3c3c0b(_0x4f2224);});});}exports[_0x585b('0x12')]=function(_0x20c4ba){var _0x510921=this;return new Promise(function(_0x72fdc4,_0x14648f){return db[_0x585b('0x13')][_0x585b('0x14')](_0x20c4ba['body'],{'raw':_0x20c4ba[_0x585b('0x15')]?_0x20c4ba[_0x585b('0x15')][_0x585b('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5200ec){logger[_0x585b('0x9')]('CreateAttachment',_0x20c4ba);logger['debug'](_0x585b('0x12'),_0x20c4ba,JSON[_0x585b('0x17')](_0x5200ec));_0x72fdc4(_0x5200ec);})['catch'](function(_0x183308){logger[_0x585b('0xe')]('CreateAttachment',_0x183308[_0x585b('0x10')],_0x20c4ba);_0x14648f(_0x510921[_0x585b('0xe')](0x1f4,_0x183308[_0x585b('0x10')]));});});}; \ No newline at end of file +var _0xb377=['catch','CreateAttachment','Attachment','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb377,0x1b6));var _0x7b37=function(_0x47a644,_0x4090cf){_0x47a644=_0x47a644-0x0;var _0x2187e1=_0xb377[_0x47a644];return _0x2187e1;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var moment=require(_0x7b37('0x2'));var BPromise=require(_0x7b37('0x3'));var rs=require(_0x7b37('0x4'));var fs=require('fs');var Redis=require(_0x7b37('0x5'));var db=require(_0x7b37('0x6'))['db'];var utils=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var config=require(_0x7b37('0xa'));var jayson=require(_0x7b37('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x4cb89b,_0x5afdb8){return new BPromise(function(_0x3de992,_0x3df40f){return client[_0x7b37('0xc')](_0x409d34,_0x5afdb8)[_0x7b37('0xd')](function(_0x1d435b){logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));logger['debug'](_0x7b37('0x11'),_0x4cb89b,_0x7b37('0x10'),JSON['stringify'](_0x1d435b));if(_0x1d435b['error']){if(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x13')]===0x1f4){logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3df40f(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3de992(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}else{logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));_0x3de992(_0x1d435b['result']['message']);}})[_0x7b37('0x15')](function(_0x5b06f9){logger['error'](_0x7b37('0xf'),_0x4cb89b,_0x5b06f9);_0x3df40f(_0x5b06f9);});});}exports[_0x7b37('0x16')]=function(_0x1447aa){var _0x487f5c=this;return new Promise(function(_0x29a9dd,_0x46955a){return db[_0x7b37('0x17')]['create'](_0x1447aa['body'],{'raw':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x19')]===undefined?!![]:![]:!![]})[_0x7b37('0xd')](function(_0x30bf66){logger['info']('CreateAttachment',_0x1447aa);logger['debug'](_0x7b37('0x16'),_0x1447aa,JSON[_0x7b37('0x1a')](_0x30bf66));_0x29a9dd(_0x30bf66);})[_0x7b37('0x15')](function(_0x200f17){logger[_0x7b37('0x12')](_0x7b37('0x16'),_0x200f17[_0x7b37('0x14')],_0x1447aa);_0x46955a(_0x487f5c['error'](0x1f4,_0x200f17[_0x7b37('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 70c39f5..a922b05 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0xb69d50,_0x3cab06){var _0x697b4f=function(_0x4c49f5){while(--_0x4c49f5){_0xb69d50['push'](_0xb69d50['shift']());}};_0x697b4f(++_0x3cab06);}(_0xadb5,0xad));var _0x5adb=function(_0x584ab2,_0x1633cb){_0x584ab2=_0x584ab2-0x0;var _0x546908=_0xadb5[_0x584ab2];return _0x546908;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _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(_0x5e9f0f,_0x81d999){_0x5e9f0f=_0x5e9f0f-0x0;var _0x4393d0=_0xdb28[_0x5e9f0f];return _0x4393d0;};'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 c9438f6..8471453 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 _0x1151=['blockDuration','then','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../components/auth/service','signToken','authenticate','google','profile','email','/login','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0x411d8c,_0x22d9ff){var _0x34f6e5=function(_0x3bfa94){while(--_0x3bfa94){_0x411d8c['push'](_0x411d8c['shift']());}};_0x34f6e5(++_0x22d9ff);}(_0x1151,0x1ba));var _0x1115=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1151[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x1115('0x0'));var passport=require(_0x1115('0x1'));var GoogleStrategy=require(_0x1115('0x2'))[_0x1115('0x3')];var moment=require('moment');var db=require(_0x1115('0x4'))['db'];var config=require('../../config/environment');var signToken=require(_0x1115('0x5'))[_0x1115('0x6')];var utils=require('../../config/utils');exports['login']=passport[_0x1115('0x7')](_0x1115('0x8'),{'failureRedirect':'/login','scope':[_0x1115('0x9'),_0x1115('0xa')],'session':![]});exports['callback']=passport[_0x1115('0x7')]('google',{'failureRedirect':_0x1115('0xb'),'session':![]});passport[_0x1115('0xc')](new GoogleStrategy({'clientID':config[_0x1115('0x8')]?config[_0x1115('0x8')][_0x1115('0xd')]:'id','clientSecret':config[_0x1115('0x8')]?config[_0x1115('0x8')][_0x1115('0xe')]:_0x1115('0xf'),'callbackURL':config[_0x1115('0x8')]?config[_0x1115('0x8')][_0x1115('0x10')]:''},function(_0x1bae4b,_0x348626,_0x58f1c2,_0x575ee2){var _0x35c5e6,_0x59f0f1;return db[_0x1115('0x11')][_0x1115('0x12')]({'where':{'id':0x1},'attributes':[_0x1115('0x13'),_0x1115('0x14')],'raw':!![]})[_0x1115('0x15')](function(_0x450efe){_0x35c5e6=_0x450efe;return db['User']['find']({'where':{'email':_['map'](_0x58f1c2[_0x1115('0x16')],_0x1115('0x17')),'role':{'$or':['admin',_0x1115('0x18'),_0x1115('0x19')]}}});})['then'](function(_0xd3d7bc){_0x59f0f1=_0xd3d7bc;if(_0x59f0f1){if(_0x59f0f1[_0x1115('0x1a')]){return _0x575ee2(_0x1115('0x1b'));}else if(_0x35c5e6['blockDuration']>0x0){if(_0x59f0f1[_0x1115('0x1c')]){if(moment(_0x59f0f1[_0x1115('0x1d')])[_0x1115('0x1e')](_0x35c5e6[_0x1115('0x14')],'minutes')>moment()){return _0x575ee2(_0x1115('0x1b'));}else{return utils[_0x1115('0x1f')](_0x59f0f1,0x0,![],null)[_0x1115('0x15')](function(){return utils['getLicense'](_0x59f0f1);})[_0x1115('0x15')](function(){return _0x575ee2(null,_0x59f0f1);});}}else{return utils[_0x1115('0x20')](_0x59f0f1)[_0x1115('0x15')](function(){return _0x575ee2(null,_0x59f0f1);});}}else{return utils['getLicense'](_0x59f0f1)[_0x1115('0x15')](function(){return _0x575ee2(null,_0x59f0f1);});}}return _0x575ee2(_0x1115('0x1b'));})['catch'](function(_0x5f0f93){_0x575ee2(_0x5f0f93);});})); \ No newline at end of file +var _0x8815=['blockDuration','then','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts'];(function(_0xffcdb9,_0x381e5e){var _0x59d074=function(_0x13fd97){while(--_0x13fd97){_0xffcdb9['push'](_0xffcdb9['shift']());}};_0x59d074(++_0x381e5e);}(_0x8815,0x86));var _0x5881=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x8815[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0x5881('0x0'));var passport=require(_0x5881('0x1'));var GoogleStrategy=require(_0x5881('0x2'))[_0x5881('0x3')];var moment=require(_0x5881('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x5881('0x5'))[_0x5881('0x6')];var utils=require(_0x5881('0x7'));exports[_0x5881('0x8')]=passport[_0x5881('0x9')](_0x5881('0xa'),{'failureRedirect':'/login','scope':[_0x5881('0xb'),_0x5881('0xc')],'session':![]});exports[_0x5881('0xd')]=passport[_0x5881('0x9')](_0x5881('0xa'),{'failureRedirect':_0x5881('0xe'),'session':![]});passport[_0x5881('0xf')](new GoogleStrategy({'clientID':config['google']?config[_0x5881('0xa')][_0x5881('0x10')]:'id','clientSecret':config[_0x5881('0xa')]?config[_0x5881('0xa')][_0x5881('0x11')]:'secret','callbackURL':config[_0x5881('0xa')]?config[_0x5881('0xa')][_0x5881('0x12')]:''},function(_0x35e6fe,_0x49d027,_0x435a4b,_0xb6625b){var _0x3dc973,_0x19eb78;return db[_0x5881('0x13')][_0x5881('0x14')]({'where':{'id':0x1},'attributes':[_0x5881('0x15'),_0x5881('0x16')],'raw':!![]})[_0x5881('0x17')](function(_0x23450a){_0x3dc973=_0x23450a;return db['User'][_0x5881('0x18')]({'where':{'email':_[_0x5881('0x19')](_0x435a4b[_0x5881('0x1a')],_0x5881('0x1b')),'role':{'$or':[_0x5881('0x1c'),_0x5881('0x1d'),_0x5881('0x1e')]}}});})[_0x5881('0x17')](function(_0x428963){_0x19eb78=_0x428963;if(_0x19eb78){if(_0x19eb78[_0x5881('0x1f')]){return _0xb6625b(_0x5881('0x20'));}else if(_0x3dc973[_0x5881('0x16')]>0x0){if(_0x19eb78[_0x5881('0x21')]){if(moment(_0x19eb78[_0x5881('0x22')])[_0x5881('0x23')](_0x3dc973[_0x5881('0x16')],_0x5881('0x24'))>moment()){return _0xb6625b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x5881('0x25')](_0x19eb78,0x0,![],null)[_0x5881('0x17')](function(){return utils[_0x5881('0x26')](_0x19eb78);})[_0x5881('0x17')](function(){return _0xb6625b(null,_0x19eb78);});}}else{return utils[_0x5881('0x26')](_0x19eb78)[_0x5881('0x17')](function(){return _0xb6625b(null,_0x19eb78);});}}else{return utils['getLicense'](_0x19eb78)['then'](function(){return _0xb6625b(null,_0x19eb78);});}}return _0xb6625b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x41d5d6){_0xb6625b(_0x41d5d6);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 08dd62f..3826ba8 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 _0x3d4f=['Router','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x3fe9ee,_0x2b7d52){var _0x48c50e=function(_0x1e00fe){while(--_0x1e00fe){_0x3fe9ee['push'](_0x3fe9ee['shift']());}};_0x48c50e(++_0x2b7d52);}(_0x3d4f,0xef));var _0xf3d4=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0x3d4f[_0x53d172];return _0x1bd0a2;};'use strict';var express=require('express');var passport=require(_0xf3d4('0x0'));var router=express[_0xf3d4('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xf3d4('0x2'));var authService=require('../../components/auth/service');router[_0xf3d4('0x3')]('/',controller[_0xf3d4('0x4')]);router['get'](_0xf3d4('0x5'),controller[_0xf3d4('0x6')],authService[_0xf3d4('0x7')],userController[_0xf3d4('0x4')],authService[_0xf3d4('0x8')]);module[_0xf3d4('0x9')]=router; \ No newline at end of file +var _0x090e=['../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller'];(function(_0x13094b,_0x377aa9){var _0x15503c=function(_0x34f58a){while(--_0x34f58a){_0x13094b['push'](_0x13094b['shift']());}};_0x15503c(++_0x377aa9);}(_0x090e,0x104));var _0xe090=function(_0x597e38,_0x551ac2){_0x597e38=_0x597e38-0x0;var _0x5305d2=_0x090e[_0x597e38];return _0x5305d2;};'use strict';var express=require(_0xe090('0x0'));var passport=require(_0xe090('0x1'));var router=express[_0xe090('0x2')]();var controller=require(_0xe090('0x3'));var userController=require(_0xe090('0x4'));var authService=require(_0xe090('0x5'));router[_0xe090('0x6')]('/',controller['login']);router['get'](_0xe090('0x7'),controller['callback'],authService[_0xe090('0x8')],userController['login'],authService[_0xe090('0x9')]);module[_0xe090('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1ddbed5..6db3d1f 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 _0x20b4=['Setting','findOne','blockDuration','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','name','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','generate','body','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','use','util','passport','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0x20b4,0x146));var _0x420b=function(_0x24ae03,_0x334660){_0x24ae03=_0x24ae03-0x0;var _0x38a29e=_0x20b4[_0x24ae03];return _0x38a29e;};'use strict';var util=require(_0x420b('0x0'));var passport=require(_0x420b('0x1'));var LocalStrategy=require(_0x420b('0x2'))[_0x420b('0x3')];var jayson=require('jayson/promise');var _=require(_0x420b('0x4'));var rs=require(_0x420b('0x5'));var moment=require('moment');var db=require(_0x420b('0x6'))['db'];var authService=require(_0x420b('0x7'));var utils=require('../../config/utils');var client=jayson[_0x420b('0x8')][_0x420b('0x9')]({'port':0x232b});function localAuthenticate(_0x30fe9c,_0x226510,_0x2d4d4c,_0x2fe151){var _0x5e7b0d,_0x3d2241;return db[_0x420b('0xa')][_0x420b('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x420b('0xc')],'raw':!![]})[_0x420b('0xd')](function(_0x45bda0){_0x5e7b0d=_0x45bda0;return _0x30fe9c[_0x420b('0xb')]({'attributes':['id','name',_0x420b('0xe'),_0x420b('0xf'),_0x420b('0x10'),_0x420b('0x11'),_0x420b('0x12'),_0x420b('0x13'),_0x420b('0x14')],'where':{'name':_0x226510,'role':{'$or':[_0x420b('0x15'),_0x420b('0x16'),_0x420b('0x17')]}}});})[_0x420b('0xd')](function(_0x4527be){if(!_0x4527be||_0x4527be&&_0x4527be['name']!==_0x226510){throw new Error(_0x420b('0x18'));}else{_0x3d2241=_0x4527be;return _0x3d2241;}})[_0x420b('0xd')](function(){_0x3d2241[_0x420b('0x19')](_0x2d4d4c,function(_0xfc8c7c,_0x520cbb){var _0x975896=_0x3d2241['loginAttempts']+0x1;if(_0xfc8c7c){return _0x2fe151(_0xfc8c7c);}else if(!_0x520cbb){if(_0x3d2241['disabled']){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else if(_0x5e7b0d['allowedLoginAttempts']>0x0){if(_0x3d2241[_0x420b('0x12')]){if(_0x5e7b0d['blockDuration']>0x0){if(moment(_0x3d2241[_0x420b('0x13')])['add'](_0x5e7b0d[_0x420b('0xc')],_0x420b('0x1a'))>moment()){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else{return utils[_0x420b('0x1b')](_0x3d2241,_0x975896,![],null)[_0x420b('0xd')](function(){return _0x2fe151(null,![],{'message':_0x420b('0x18')});});}}else{return _0x2fe151(null,![],{'message':_0x420b('0x18')});}}else{if(_0x975896>=_0x5e7b0d['allowedLoginAttempts']){return utils['clearBlockUser'](_0x3d2241,0x0,!![],moment())[_0x420b('0xd')](function(){return _0x2fe151(null,![],{'message':_0x420b('0x18')});});}else{return utils[_0x420b('0x1b')](_0x3d2241,_0x975896,![],null)[_0x420b('0xd')](function(){return _0x2fe151(null,![],{'message':_0x420b('0x18')});});}}}else{return _0x2fe151(null,![],{'message':_0x420b('0x18')});}}else{if(_0x3d2241[_0x420b('0x11')]){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else if(_0x5e7b0d['allowedLoginAttempts']>0x0){if(_0x3d2241[_0x420b('0x12')]){if(_0x5e7b0d['blockDuration']>0x0){if(moment(_0x3d2241[_0x420b('0x13')])[_0x420b('0x1c')](_0x5e7b0d[_0x420b('0xc')],_0x420b('0x1a'))>moment()){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else{return utils[_0x420b('0x1b')](_0x3d2241,0x0,![],null)[_0x420b('0xd')](function(){return utils[_0x420b('0x1d')](_0x3d2241);})['then'](function(){return _0x2fe151(null,_0x3d2241);});}}else{return _0x2fe151(null,![],{'message':_0x420b('0x18')});}}else{return utils['clearBlockUser'](_0x3d2241,0x0,![],null)['then'](function(){return utils[_0x420b('0x1d')](_0x3d2241);})[_0x420b('0xd')](function(){return _0x2fe151(null,_0x3d2241);})[_0x420b('0x1e')](function(_0x3dd74e){return _0x2fe151(null,![],_0x3dd74e);});}}else{if(_0x3d2241[_0x420b('0x12')]){return _0x2fe151(null,![],{'message':_0x420b('0x18')});}else{return utils[_0x420b('0x1d')](_0x3d2241)[_0x420b('0xd')](function(){return _0x2fe151(null,_0x3d2241);});}}}});})[_0x420b('0x1e')](function(_0x4f1cef){return _0x2fe151(null,![],_0x4f1cef);});}function sendServiceMail(_0x29d689){return db[_0x420b('0x1f')][_0x420b('0x20')]({'where':{'service':!![]},'attributes':['id',_0x420b('0x21'),_0x420b('0x22')],'include':[{'model':db[_0x420b('0x23')],'as':'Smtp'}]})[_0x420b('0xd')](function(_0x517b56){if(!_0x517b56){throw new Error(_0x420b('0x24'));}var _0x2ddc2c={'tls':{'rejectUnauthorized':![]}};if(_0x517b56[_0x420b('0x25')]['service']){_0x2ddc2c['service']=_0x517b56['Smtp'][_0x420b('0x26')];}else{_0x2ddc2c[_0x420b('0x27')]=_0x517b56[_0x420b('0x25')][_0x420b('0x27')];_0x2ddc2c[_0x420b('0x28')]=_0x517b56[_0x420b('0x25')][_0x420b('0x28')];_0x2ddc2c[_0x420b('0x29')]=_0x517b56[_0x420b('0x25')][_0x420b('0x29')];}if(_0x517b56['Smtp'][_0x420b('0x2a')]){_0x2ddc2c[_0x420b('0x2b')]={'user':_0x517b56['Smtp'][_0x420b('0x16')],'pass':_0x517b56['Smtp'][_0x420b('0x2c')]};}var _0x32606a={'account':_0x2ddc2c,'message':_[_0x420b('0x2d')]({'from':util['format'](_0x420b('0x2e'),_0x517b56[_0x420b('0x21')],_0x517b56[_0x420b('0x22')]||_0x517b56[_0x420b('0x25')]['user'])},_0x29d689)};return client[_0x420b('0x2f')](_0x420b('0x30'),_0x32606a);})[_0x420b('0xd')](function(_0x2ddead){if(_0x2ddead['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2ddead[_0x420b('0x31')][_0x420b('0x32')]||JSON[_0x420b('0x33')](_0x2ddead[_0x420b('0x31')])));}return!![];});}function handleError(_0x47d62c,_0xdb3d67,_0x2d5939){return _0x47d62c[_0x420b('0x34')](_0xdb3d67||0x1f4)['send']({'message':_0x2d5939?_0x2d5939[_0x420b('0x32')]||_0x2d5939:''});}exports[_0x420b('0x35')]=function(_0x3d2a54,_0x1770ea,_0x2d3e01){passport[_0x420b('0x19')](_0x420b('0x36'),function(_0x12fe28,_0x4bb93c,_0x4c5649){var _0x240328=_0x12fe28||_0x4c5649;if(_0x240328){return handleError(_0x1770ea,0x191,_0x240328);}if(!_0x4bb93c){return handleError(_0x1770ea,0x194,{'message':_0x420b('0x37')});}else{var _0x59e9ab={'payload':{'id':_0x4bb93c['id'],'role':_0x4bb93c[_0x420b('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x59e9ab)[_0x420b('0xd')](function(_0x3d6356){_0x1770ea[_0x420b('0x38')]({'id':_0x4bb93c['id'],'token':_0x3d6356,'statusCall':'','isAlreadyLogged':_0x4bb93c['online']});});}})(_0x3d2a54,_0x1770ea,_0x2d3e01);};exports[_0x420b('0x39')]=function(_0x16b8ca,_0x59d7de,_0x465c05){if(!_0x16b8ca['body']['email']){return handleError(_0x59d7de,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x235a3e=rs[_0x420b('0x3a')]();_0x16b8ca[_0x420b('0x3b')][_0x420b('0x22')]=_0x16b8ca['body'][_0x420b('0x22')][_0x420b('0x3c')]()['toLowerCase']();var _0x219748;return db[_0x420b('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x420b('0xd')](function(_0x34daa5){_0x219748=_0x34daa5;return db[_0x420b('0x3d')]['find']({'where':{'email':_0x16b8ca[_0x420b('0x3b')][_0x420b('0x22')]}});})[_0x420b('0xd')](function(_0x3cc9dd){if(!_0x3cc9dd){throw new Error(_0x420b('0x3e'));}if(_0x3cc9dd[_0x420b('0x11')]){throw new Error(_0x420b('0x3f'));}if(_0x3cc9dd['blocked']){if(moment(_0x3cc9dd['blockedAt'])[_0x420b('0x1c')](_0x219748[_0x420b('0xc')],'minutes')>moment()){throw new Error(_0x420b('0x40'));}else{_0x3cc9dd[_0x420b('0x12')]=![];_0x3cc9dd[_0x420b('0x13')]=null;}}_0x3cc9dd[_0x420b('0x41')]=_0x235a3e;_0x3cc9dd[_0x420b('0x42')]=Date[_0x420b('0x43')]()+0x36ee80;return _0x3cc9dd[_0x420b('0x44')]();})[_0x420b('0xd')](function(){return sendServiceMail({'to':_0x16b8ca[_0x420b('0x3b')][_0x420b('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x420b('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x420b('0x46')+_0x16b8ca[_0x420b('0x47')][_0x420b('0x27')]+_0x420b('0x48')+_0x235a3e+'\x0a\x0a'+_0x420b('0x49')});})[_0x420b('0xd')](function(){_0x59d7de[_0x420b('0x34')](0xc8)[_0x420b('0x4a')]({'message':_0x420b('0x4b')});})['catch'](function(_0x46dbf8){return handleError(_0x59d7de,0x1f4,_0x46dbf8);});};exports[_0x420b('0x4c')]=function(_0x27331f,_0x63d13b,_0x16c2bf){return db[_0x420b('0x3d')][_0x420b('0x20')]({'where':{'resetPasswordToken':_0x27331f['params'][_0x420b('0x4d')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x420b('0xd')](function(_0x286b7b){if(!_0x286b7b){throw new Error(_0x420b('0x4e'));}return db['Setting'][_0x420b('0xb')]({'attributes':['id','securePassword',_0x420b('0x4f'),_0x420b('0x50')]})['then'](function(_0x2e01f0){if(_0x2e01f0['securePassword'])authService[_0x420b('0x51')](_0x27331f[_0x420b('0x3b')][_0x420b('0xe')]);if(!_0x2e01f0[_0x420b('0x4f')]||!_0x286b7b['previousPasswords'])return _0x286b7b;authService[_0x420b('0x52')](_0x27331f['body'][_0x420b('0xe')],_0x286b7b['previousPasswords'],_0x2e01f0[_0x420b('0x50')]);return _0x286b7b;})[_0x420b('0xd')](function(){_0x286b7b[_0x420b('0xe')]=_0x27331f[_0x420b('0x3b')][_0x420b('0xe')];_0x286b7b['resetPasswordToken']=null;_0x286b7b[_0x420b('0x42')]=null;return _0x286b7b[_0x420b('0x44')]();});})[_0x420b('0xd')](function(){_0x63d13b['status'](0xc8)['send']({'message':'Password\x20reset!'});})[_0x420b('0x1e')](function(_0x5c583e){return handleError(_0x63d13b,0x1f4,_0x5c583e);});};passport[_0x420b('0x53')](new LocalStrategy({'usernameField':_0x420b('0x21'),'passwordField':_0x420b('0xe')},function(_0x125161,_0x4da6a7,_0x2a10fb){return localAuthenticate(db[_0x420b('0x3d')],_0x125161,_0x4da6a7,_0x2a10fb);})); \ No newline at end of file +var _0x2ec2=['role','disabled','blocked','blockedAt','loginAttempts','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','auth','pass','merge','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt'];(function(_0x46c8dd,_0x237c4a){var _0x1b04af=function(_0x53baae){while(--_0x53baae){_0x46c8dd['push'](_0x46c8dd['shift']());}};_0x1b04af(++_0x237c4a);}(_0x2ec2,0x14b));var _0x22ec=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x2ec2[_0x3c5e54];return _0x3ae1f3;};'use strict';var util=require(_0x22ec('0x0'));var passport=require(_0x22ec('0x1'));var LocalStrategy=require(_0x22ec('0x2'))[_0x22ec('0x3')];var jayson=require(_0x22ec('0x4'));var _=require(_0x22ec('0x5'));var rs=require(_0x22ec('0x6'));var moment=require(_0x22ec('0x7'));var db=require(_0x22ec('0x8'))['db'];var authService=require(_0x22ec('0x9'));var utils=require(_0x22ec('0xa'));var client=jayson[_0x22ec('0xb')][_0x22ec('0xc')]({'port':0x232b});function localAuthenticate(_0x6e1a40,_0x4c591e,_0x216b5e,_0xc9ad71){var _0x59510b,_0x25cc57;return db[_0x22ec('0xd')][_0x22ec('0xe')]({'where':{'id':0x1},'attributes':[_0x22ec('0xf'),_0x22ec('0x10')],'raw':!![]})[_0x22ec('0x11')](function(_0x1e3f09){_0x59510b=_0x1e3f09;return _0x6e1a40['findOne']({'attributes':['id',_0x22ec('0x12'),_0x22ec('0x13'),_0x22ec('0x14'),_0x22ec('0x15'),_0x22ec('0x16'),_0x22ec('0x17'),_0x22ec('0x18'),_0x22ec('0x19')],'where':{'name':_0x4c591e,'role':{'$or':['admin',_0x22ec('0x1a'),'agent']}}});})[_0x22ec('0x11')](function(_0x5faae5){if(!_0x5faae5||_0x5faae5&&_0x5faae5[_0x22ec('0x12')]!==_0x4c591e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x25cc57=_0x5faae5;return _0x25cc57;}})[_0x22ec('0x11')](function(){_0x25cc57[_0x22ec('0x1b')](_0x216b5e,function(_0x118c6b,_0x3b7f51){var _0x15e58c=_0x25cc57[_0x22ec('0x19')]+0x1;if(_0x118c6b){return _0xc9ad71(_0x118c6b);}else if(!_0x3b7f51){if(_0x25cc57[_0x22ec('0x16')]){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else if(_0x59510b[_0x22ec('0xf')]>0x0){if(_0x25cc57[_0x22ec('0x17')]){if(_0x59510b['blockDuration']>0x0){if(moment(_0x25cc57['blockedAt'])[_0x22ec('0x1d')](_0x59510b[_0x22ec('0x10')],_0x22ec('0x1e'))>moment()){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else{return utils['clearBlockUser'](_0x25cc57,_0x15e58c,![],null)[_0x22ec('0x11')](function(){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});});}}else{return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}}else{if(_0x15e58c>=_0x59510b[_0x22ec('0xf')]){return utils['clearBlockUser'](_0x25cc57,0x0,!![],moment())[_0x22ec('0x11')](function(){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});});}else{return utils['clearBlockUser'](_0x25cc57,_0x15e58c,![],null)[_0x22ec('0x11')](function(){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});});}}}else{return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}}else{if(_0x25cc57[_0x22ec('0x16')]){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else if(_0x59510b[_0x22ec('0xf')]>0x0){if(_0x25cc57[_0x22ec('0x17')]){if(_0x59510b['blockDuration']>0x0){if(moment(_0x25cc57[_0x22ec('0x18')])['add'](_0x59510b[_0x22ec('0x10')],_0x22ec('0x1e'))>moment()){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else{return utils[_0x22ec('0x1f')](_0x25cc57,0x0,![],null)[_0x22ec('0x11')](function(){return utils[_0x22ec('0x20')](_0x25cc57);})[_0x22ec('0x11')](function(){return _0xc9ad71(null,_0x25cc57);});}}else{return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}}else{return utils[_0x22ec('0x1f')](_0x25cc57,0x0,![],null)[_0x22ec('0x11')](function(){return utils[_0x22ec('0x20')](_0x25cc57);})[_0x22ec('0x11')](function(){return _0xc9ad71(null,_0x25cc57);})['catch'](function(_0x33c4c7){return _0xc9ad71(null,![],_0x33c4c7);});}}else{if(_0x25cc57[_0x22ec('0x17')]){return _0xc9ad71(null,![],{'message':_0x22ec('0x1c')});}else{return utils[_0x22ec('0x20')](_0x25cc57)[_0x22ec('0x11')](function(){return _0xc9ad71(null,_0x25cc57);});}}}});})[_0x22ec('0x21')](function(_0x18d96b){return _0xc9ad71(null,![],_0x18d96b);});}function sendServiceMail(_0x5874d7){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x22ec('0x12'),'email'],'include':[{'model':db[_0x22ec('0x22')],'as':'Smtp'}]})['then'](function(_0x4fe767){if(!_0x4fe767){throw new Error(_0x22ec('0x23'));}var _0x4dcf96={'tls':{'rejectUnauthorized':![]}};if(_0x4fe767[_0x22ec('0x24')][_0x22ec('0x25')]){_0x4dcf96[_0x22ec('0x25')]=_0x4fe767[_0x22ec('0x24')][_0x22ec('0x25')];}else{_0x4dcf96[_0x22ec('0x26')]=_0x4fe767[_0x22ec('0x24')][_0x22ec('0x26')];_0x4dcf96['port']=_0x4fe767['Smtp'][_0x22ec('0x27')];_0x4dcf96[_0x22ec('0x28')]=_0x4fe767[_0x22ec('0x24')][_0x22ec('0x28')];}if(_0x4fe767[_0x22ec('0x24')]['authentication']){_0x4dcf96[_0x22ec('0x29')]={'user':_0x4fe767['Smtp'][_0x22ec('0x1a')],'pass':_0x4fe767[_0x22ec('0x24')][_0x22ec('0x2a')]};}var _0x33d55a={'account':_0x4dcf96,'message':_[_0x22ec('0x2b')]({'from':util[_0x22ec('0x2c')](_0x22ec('0x2d'),_0x4fe767[_0x22ec('0x12')],_0x4fe767[_0x22ec('0x2e')]||_0x4fe767[_0x22ec('0x24')][_0x22ec('0x1a')])},_0x5874d7)};return client[_0x22ec('0x2f')](_0x22ec('0x30'),_0x33d55a);})[_0x22ec('0x11')](function(_0x5e2660){if(_0x5e2660[_0x22ec('0x31')]){throw new Error(util[_0x22ec('0x2c')](_0x22ec('0x32'),_0x5e2660['error'][_0x22ec('0x33')]||JSON['stringify'](_0x5e2660['error'])));}return!![];});}function handleError(_0x31325e,_0x13744c,_0x4174ac){return _0x31325e[_0x22ec('0x34')](_0x13744c||0x1f4)[_0x22ec('0x35')]({'message':_0x4174ac?_0x4174ac[_0x22ec('0x33')]||_0x4174ac:''});}exports['login']=function(_0x3337fe,_0x54035a,_0x439fe8){passport['authenticate'](_0x22ec('0x36'),function(_0x5ed84d,_0x1aef29,_0x4cb274){var _0x5044d3=_0x5ed84d||_0x4cb274;if(_0x5044d3){return handleError(_0x54035a,0x191,_0x5044d3);}if(!_0x1aef29){return handleError(_0x54035a,0x194,{'message':_0x22ec('0x37')});}else{var _0x30c21c={'payload':{'id':_0x1aef29['id'],'role':_0x1aef29[_0x22ec('0x15')]},'options':{'expiresIn':0x15180}};return authService[_0x22ec('0x38')](_0x30c21c)[_0x22ec('0x11')](function(_0x5600a7){_0x54035a[_0x22ec('0x39')]({'id':_0x1aef29['id'],'token':_0x5600a7,'statusCall':'','isAlreadyLogged':_0x1aef29[_0x22ec('0x3a')]});});}})(_0x3337fe,_0x54035a,_0x439fe8);};exports['forgot']=function(_0x41ac0b,_0x107a28,_0x387346){if(!_0x41ac0b['body'][_0x22ec('0x2e')]){return handleError(_0x107a28,0x1f4,{'message':_0x22ec('0x3b')});}var _0x27d1c1=rs['generate']();_0x41ac0b['body'][_0x22ec('0x2e')]=_0x41ac0b[_0x22ec('0x3c')][_0x22ec('0x2e')][_0x22ec('0x3d')]()[_0x22ec('0x3e')]();var _0x1f8681;return db['Setting'][_0x22ec('0xe')]({'where':{'id':0x1},'attributes':[_0x22ec('0xf'),_0x22ec('0x10')],'raw':!![]})[_0x22ec('0x11')](function(_0x352959){_0x1f8681=_0x352959;return db[_0x22ec('0x3f')][_0x22ec('0x40')]({'where':{'email':_0x41ac0b[_0x22ec('0x3c')][_0x22ec('0x2e')]}});})[_0x22ec('0x11')](function(_0x1e53d9){if(!_0x1e53d9){throw new Error(_0x22ec('0x41'));}if(_0x1e53d9[_0x22ec('0x16')]){throw new Error(_0x22ec('0x42'));}if(_0x1e53d9['blocked']){if(moment(_0x1e53d9[_0x22ec('0x18')])[_0x22ec('0x1d')](_0x1f8681[_0x22ec('0x10')],_0x22ec('0x1e'))>moment()){throw new Error(_0x22ec('0x43'));}else{_0x1e53d9['blocked']=![];_0x1e53d9[_0x22ec('0x18')]=null;}}_0x1e53d9[_0x22ec('0x44')]=_0x27d1c1;_0x1e53d9['resetPasswordExpires']=Date[_0x22ec('0x45')]()+0x36ee80;return _0x1e53d9[_0x22ec('0x46')]();})[_0x22ec('0x11')](function(){return sendServiceMail({'to':_0x41ac0b[_0x22ec('0x3c')][_0x22ec('0x2e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x22ec('0x47')+_0x22ec('0x48')+_0x41ac0b[_0x22ec('0x49')][_0x22ec('0x26')]+_0x22ec('0x4a')+_0x27d1c1+'\x0a\x0a'+_0x22ec('0x4b')});})[_0x22ec('0x11')](function(){_0x107a28['status'](0xc8)[_0x22ec('0x35')]({'message':'Reset\x20Email\x20sent!'});})[_0x22ec('0x21')](function(_0x4eea7d){return handleError(_0x107a28,0x1f4,_0x4eea7d);});};exports[_0x22ec('0x4c')]=function(_0x117494,_0x45dc2d,_0x1df286){return db['User']['find']({'where':{'resetPasswordToken':_0x117494[_0x22ec('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0x22ec('0x45')]()}}})[_0x22ec('0x11')](function(_0x286ac2){if(!_0x286ac2){throw new Error(_0x22ec('0x4e'));}return db[_0x22ec('0xd')][_0x22ec('0xe')]({'attributes':['id',_0x22ec('0x4f'),_0x22ec('0x50'),_0x22ec('0x51')]})[_0x22ec('0x11')](function(_0xc2d0ce){if(_0xc2d0ce[_0x22ec('0x4f')])authService[_0x22ec('0x52')](_0x117494[_0x22ec('0x3c')][_0x22ec('0x13')]);if(!_0xc2d0ce[_0x22ec('0x50')]||!_0x286ac2[_0x22ec('0x53')])return _0x286ac2;authService[_0x22ec('0x54')](_0x117494[_0x22ec('0x3c')][_0x22ec('0x13')],_0x286ac2[_0x22ec('0x53')],_0xc2d0ce[_0x22ec('0x51')]);return _0x286ac2;})[_0x22ec('0x11')](function(){_0x286ac2['password']=_0x117494[_0x22ec('0x3c')][_0x22ec('0x13')];_0x286ac2['resetPasswordToken']=null;_0x286ac2[_0x22ec('0x55')]=null;return _0x286ac2[_0x22ec('0x46')]();});})[_0x22ec('0x11')](function(){_0x45dc2d[_0x22ec('0x34')](0xc8)[_0x22ec('0x35')]({'message':_0x22ec('0x56')});})[_0x22ec('0x21')](function(_0x80c041){return handleError(_0x45dc2d,0x1f4,_0x80c041);});};passport[_0x22ec('0x57')](new LocalStrategy({'usernameField':_0x22ec('0x12'),'passwordField':_0x22ec('0x13')},function(_0x519b08,_0x165f05,_0x171689){return localAuthenticate(db['User'],_0x519b08,_0x165f05,_0x171689);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c535557..f100016 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 _0x44f4=['./authLocal.controller','post','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x44f4,0x134));var _0x444f=function(_0x3c39cd,_0xb410c1){_0x3c39cd=_0x3c39cd-0x0;var _0x3ece5c=_0x44f4[_0x3c39cd];return _0x3ece5c;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x444f('0x0'));router[_0x444f('0x1')]('/',controller['login']);router[_0x444f('0x1')](_0x444f('0x2'),controller[_0x444f('0x3')]);router[_0x444f('0x1')](_0x444f('0x4'),controller[_0x444f('0x5')]);module[_0x444f('0x6')]=router; \ No newline at end of file +var _0xdf84=['post','/forgot','forgot','Router','./authLocal.controller'];(function(_0x57a352,_0xbd7532){var _0x5cd613=function(_0x2e51c4){while(--_0x2e51c4){_0x57a352['push'](_0x57a352['shift']());}};_0x5cd613(++_0xbd7532);}(_0xdf84,0xbc));var _0x4df8=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xdf84[_0x119d5a];return _0x15bff4;};'use strict';var express=require('express');var router=express[_0x4df8('0x0')]();var controller=require(_0x4df8('0x1'));router[_0x4df8('0x2')]('/',controller['login']);router[_0x4df8('0x2')](_0x4df8('0x3'),controller[_0x4df8('0x4')]);router['post']('/reset/:token',controller['reset']);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2adbed9..f4bcaa5 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 _0x53ef=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x435923,_0x144530){var _0x12273f=function(_0x572a56){while(--_0x572a56){_0x435923['push'](_0x435923['shift']());}};_0x12273f(++_0x144530);}(_0x53ef,0x152));var _0xf53e=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x53ef[_0x4327fe];return _0x138651;};'use strict';var Sequelize=require(_0xf53e('0x0'));module[_0xf53e('0x1')]={'name':{'type':Sequelize[_0xf53e('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf53e('0x2')]},'status':{'type':Sequelize[_0xf53e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf53e('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xbe4e=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe4e,0x145));var _0xebe4=function(_0xef2a14,_0x4c359a){_0xef2a14=_0xef2a14-0x0;var _0x242a4d=_0xbe4e[_0xef2a14];return _0x242a4d;};'use strict';var Sequelize=require(_0xebe4('0x0'));module[_0xebe4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xebe4('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xebe4('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xebe4('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 9e262b5..b78717a 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 _0xe135=['filter','merge','VIRTUAL','Automation','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','type','key','map','query','intersection','fields','attributes','length','model','nolimit','order','sort','where','filters','pick'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xe135,0x1b9));var _0x5e13=function(_0x7a8365,_0x563ade){_0x7a8365=_0x7a8365-0x0;var _0x55359f=_0xe135[_0x7a8365];return _0x55359f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e13('0x0'));var zipdir=require(_0x5e13('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e13('0x2'));var moment=require(_0x5e13('0x3'));var BPromise=require(_0x5e13('0x4'));var Mustache=require('mustache');var util=require(_0x5e13('0x5'));var path=require(_0x5e13('0x6'));var sox=require(_0x5e13('0x7'));var csv=require(_0x5e13('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e13('0x9'));var _=require('lodash');var squel=require(_0x5e13('0xa'));var crypto=require(_0x5e13('0xb'));var jsforce=require(_0x5e13('0xc'));var deskjs=require(_0x5e13('0xd'));var toCsv=require(_0x5e13('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e13('0xe'));var authService=require(_0x5e13('0xf'));var qs=require(_0x5e13('0x10'));var as=require(_0x5e13('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e13('0x12'))('api');var utils=require(_0x5e13('0x13'));var config=require(_0x5e13('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e13('0x15'))['db'];function respondWithStatusCode(_0x1119c8,_0x299567){_0x299567=_0x299567||0xcc;return function(_0x303324){if(_0x303324){return _0x1119c8[_0x5e13('0x16')](_0x299567);}return _0x1119c8[_0x5e13('0x17')](_0x299567)[_0x5e13('0x18')]();};}function respondWithResult(_0x32fc2f,_0x41a6e1){_0x41a6e1=_0x41a6e1||0xc8;return function(_0x3d05e6){if(_0x3d05e6){return _0x32fc2f[_0x5e13('0x17')](_0x41a6e1)[_0x5e13('0x19')](_0x3d05e6);}};}function respondWithFilteredResult(_0x2741ad,_0x29aefd){return function(_0x5b645e){if(_0x5b645e){var _0x3a14b2=typeof _0x29aefd[_0x5e13('0x1a')]===_0x5e13('0x1b')&&typeof _0x29aefd[_0x5e13('0x1c')]===_0x5e13('0x1b');var _0x584ebf=_0x5b645e['count'];var _0x42b46a=_0x3a14b2?0x0:_0x29aefd[_0x5e13('0x1a')];var _0x5ee251=_0x3a14b2?_0x5b645e[_0x5e13('0x1d')]:_0x29aefd[_0x5e13('0x1a')]+_0x29aefd[_0x5e13('0x1c')];var _0x220970;if(_0x5ee251>=_0x584ebf){_0x5ee251=_0x584ebf;_0x220970=0xc8;}else{_0x220970=0xce;}_0x2741ad[_0x5e13('0x17')](_0x220970);return _0x2741ad[_0x5e13('0x1e')]('Content-Range',_0x42b46a+'-'+_0x5ee251+'/'+_0x584ebf)[_0x5e13('0x19')](_0x5b645e);}return null;};}function patchUpdates(_0x20ebfe){return function(_0x47ed00){try{jsonpatch[_0x5e13('0x1f')](_0x47ed00,_0x20ebfe,!![]);}catch(_0x114a7a){return BPromise[_0x5e13('0x20')](_0x114a7a);}return _0x47ed00[_0x5e13('0x21')]();};}function saveUpdates(_0x1483f4,_0x403601){return function(_0xb45f14){if(_0xb45f14){return _0xb45f14[_0x5e13('0x22')](_0x1483f4)['then'](function(_0x2ffd2a){return _0x2ffd2a;});}return null;};}function removeEntity(_0x5378dd,_0x7fc733){return function(_0x5ca296){if(_0x5ca296){return _0x5ca296[_0x5e13('0x23')]()[_0x5e13('0x24')](function(){_0x5378dd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9ac2,_0x241afe){return function(_0x57838f){if(!_0x57838f){_0x2b9ac2[_0x5e13('0x16')](0x194);}return _0x57838f;};}function handleError(_0x159f54,_0x1c5774){_0x1c5774=_0x1c5774||0x1f4;return function(_0x523a65){logger[_0x5e13('0x25')](_0x523a65[_0x5e13('0x26')]);if(_0x523a65['name']){delete _0x523a65[_0x5e13('0x27')];}_0x159f54[_0x5e13('0x17')](_0x1c5774)[_0x5e13('0x28')](_0x523a65);};}exports[_0x5e13('0x29')]=function(_0x93171d,_0x4256e1){var _0x41b49c={},_0x4af707={},_0x20fa65={'count':0x0,'rows':[]};var _0x4cd951=_['map'](db['Automation']['rawAttributes'],function(_0x3ec30e){return{'name':_0x3ec30e['fieldName'],'type':_0x3ec30e[_0x5e13('0x2a')][_0x5e13('0x2b')]};});_0x4af707['model']=_[_0x5e13('0x2c')](_0x4cd951,_0x5e13('0x27'));_0x4af707[_0x5e13('0x2d')]=_['keys'](_0x93171d[_0x5e13('0x2d')]);_0x4af707['filters']=_['intersection'](_0x4af707['model'],_0x4af707[_0x5e13('0x2d')]);_0x41b49c['attributes']=_[_0x5e13('0x2e')](_0x4af707['model'],qs[_0x5e13('0x2f')](_0x93171d[_0x5e13('0x2d')]['fields']));_0x41b49c[_0x5e13('0x30')]=_0x41b49c[_0x5e13('0x30')][_0x5e13('0x31')]?_0x41b49c['attributes']:_0x4af707[_0x5e13('0x32')];if(!_0x93171d[_0x5e13('0x2d')]['hasOwnProperty'](_0x5e13('0x33'))){_0x41b49c[_0x5e13('0x1c')]=qs[_0x5e13('0x1c')](_0x93171d['query'][_0x5e13('0x1c')]);_0x41b49c[_0x5e13('0x1a')]=qs[_0x5e13('0x1a')](_0x93171d[_0x5e13('0x2d')]['offset']);}_0x41b49c[_0x5e13('0x34')]=qs[_0x5e13('0x35')](_0x93171d[_0x5e13('0x2d')][_0x5e13('0x35')]);_0x41b49c[_0x5e13('0x36')]=qs[_0x5e13('0x37')](_[_0x5e13('0x38')](_0x93171d[_0x5e13('0x2d')],_0x4af707['filters']),_0x4cd951);if(_0x93171d[_0x5e13('0x2d')][_0x5e13('0x39')]){_0x41b49c['where']=_[_0x5e13('0x3a')](_0x41b49c[_0x5e13('0x36')],{'$or':_['map'](_0x4cd951,function(_0x2c1e23){if(_0x2c1e23[_0x5e13('0x2a')]!==_0x5e13('0x3b')){var _0x3a6eb5={};_0x3a6eb5[_0x2c1e23[_0x5e13('0x27')]]={'$like':'%'+_0x93171d[_0x5e13('0x2d')]['filter']+'%'};return _0x3a6eb5;}})});}_0x41b49c=_[_0x5e13('0x3a')]({},_0x41b49c,_0x93171d['options']);var _0xb63412={'where':_0x41b49c[_0x5e13('0x36')]};return db[_0x5e13('0x3c')][_0x5e13('0x1d')](_0xb63412)['then'](function(_0x14cc82){_0x20fa65[_0x5e13('0x1d')]=_0x14cc82;if(_0x93171d['query'][_0x5e13('0x3d')]){_0x41b49c[_0x5e13('0x3e')]=[{'all':!![]}];}return db[_0x5e13('0x3c')][_0x5e13('0x3f')](_0x41b49c);})[_0x5e13('0x24')](function(_0x458d15){_0x20fa65[_0x5e13('0x40')]=_0x458d15;return _0x20fa65;})[_0x5e13('0x24')](respondWithFilteredResult(_0x4256e1,_0x41b49c))[_0x5e13('0x41')](handleError(_0x4256e1,null));};exports[_0x5e13('0x42')]=function(_0x3f1854,_0xe96be4){var _0x4ba1d6={'raw':![],'where':{'id':_0x3f1854[_0x5e13('0x43')]['id']}},_0x212f27={};_0x212f27[_0x5e13('0x32')]=_[_0x5e13('0x44')](db[_0x5e13('0x3c')][_0x5e13('0x45')]);_0x212f27[_0x5e13('0x2d')]=_[_0x5e13('0x44')](_0x3f1854[_0x5e13('0x2d')]);_0x212f27[_0x5e13('0x37')]=_['intersection'](_0x212f27[_0x5e13('0x32')],_0x212f27[_0x5e13('0x2d')]);_0x4ba1d6[_0x5e13('0x30')]=_['intersection'](_0x212f27[_0x5e13('0x32')],qs[_0x5e13('0x2f')](_0x3f1854[_0x5e13('0x2d')]['fields']));_0x4ba1d6[_0x5e13('0x30')]=_0x4ba1d6['attributes'][_0x5e13('0x31')]?_0x4ba1d6[_0x5e13('0x30')]:_0x212f27['model'];if(_0x3f1854[_0x5e13('0x2d')][_0x5e13('0x3d')]){_0x4ba1d6[_0x5e13('0x3e')]=[{'all':!![]}];}_0x4ba1d6=_['merge']({},_0x4ba1d6,_0x3f1854[_0x5e13('0x46')]);return db['Automation'][_0x5e13('0x47')](_0x4ba1d6)['then'](handleEntityNotFound(_0xe96be4,null))[_0x5e13('0x24')](respondWithResult(_0xe96be4,null))['catch'](handleError(_0xe96be4,null));};exports[_0x5e13('0x48')]=function(_0x1b4ae9,_0x42230e){return db[_0x5e13('0x3c')][_0x5e13('0x48')](_0x1b4ae9[_0x5e13('0x49')],{})[_0x5e13('0x24')](respondWithResult(_0x42230e,0xc9))[_0x5e13('0x41')](handleError(_0x42230e,null));};exports[_0x5e13('0x22')]=function(_0x320b56,_0x1551cb){if(_0x320b56[_0x5e13('0x49')]['id']){delete _0x320b56[_0x5e13('0x49')]['id'];}return db['Automation'][_0x5e13('0x47')]({'where':{'id':_0x320b56[_0x5e13('0x43')]['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x1551cb,null))[_0x5e13('0x24')](saveUpdates(_0x320b56[_0x5e13('0x49')],null))['then'](respondWithResult(_0x1551cb,null))['catch'](handleError(_0x1551cb,null));};exports[_0x5e13('0x23')]=function(_0x3698b7,_0x266e04){return db[_0x5e13('0x3c')][_0x5e13('0x47')]({'where':{'id':_0x3698b7[_0x5e13('0x43')]['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x266e04,null))[_0x5e13('0x24')](removeEntity(_0x266e04,null))[_0x5e13('0x41')](handleError(_0x266e04,null));};exports[_0x5e13('0x4a')]=function(_0xd49a7e,_0x537617,_0x955c39){return db[_0x5e13('0x4b')][_0x5e13('0x47')]({'where':{'id':_0xd49a7e[_0x5e13('0x43')]['id']}})['then'](handleEntityNotFound(_0x537617,null))[_0x5e13('0x24')](function(_0x56a2bd){if(_0x56a2bd){return _0x56a2bd['addConditions'](_0xd49a7e['body'][_0x5e13('0x4c')],_[_0x5e13('0x4d')](_0xd49a7e[_0x5e13('0x49')],[_0x5e13('0x4c'),'id'])||{});}})[_0x5e13('0x24')](respondWithResult(_0x537617,null))['catch'](handleError(_0x537617,null));};exports[_0x5e13('0x4e')]=function(_0x3bde7f,_0x1c8ea7,_0x11414e){var _0x45d528={};var _0x24913c={};var _0x5c0e88;var _0x464d32;return db[_0x5e13('0x3c')][_0x5e13('0x4f')]({'where':{'id':_0x3bde7f['params']['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x1c8ea7,null))[_0x5e13('0x24')](function(_0x161b58){if(_0x161b58){_0x5c0e88=_0x161b58;_0x24913c[_0x5e13('0x32')]=_[_0x5e13('0x44')](db[_0x5e13('0x4b')]['rawAttributes']);_0x24913c[_0x5e13('0x2d')]=_[_0x5e13('0x44')](_0x3bde7f[_0x5e13('0x2d')]);_0x24913c[_0x5e13('0x37')]=_[_0x5e13('0x2e')](_0x24913c['model'],_0x24913c['query']);_0x45d528[_0x5e13('0x30')]=_[_0x5e13('0x2e')](_0x24913c[_0x5e13('0x32')],qs['fields'](_0x3bde7f['query'][_0x5e13('0x2f')]));_0x45d528[_0x5e13('0x30')]=_0x45d528[_0x5e13('0x30')][_0x5e13('0x31')]?_0x45d528['attributes']:_0x24913c[_0x5e13('0x32')];_0x45d528[_0x5e13('0x34')]=qs[_0x5e13('0x35')](_0x3bde7f[_0x5e13('0x2d')]['sort']);_0x45d528['where']=qs[_0x5e13('0x37')](_[_0x5e13('0x38')](_0x3bde7f[_0x5e13('0x2d')],_0x24913c[_0x5e13('0x37')]));if(_0x3bde7f[_0x5e13('0x2d')][_0x5e13('0x39')]){_0x45d528[_0x5e13('0x36')]=_['merge'](_0x45d528[_0x5e13('0x36')],{'$or':_[_0x5e13('0x2c')](_0x45d528['attributes'],function(_0x5f4c88){var _0x3b4073={};_0x3b4073[_0x5f4c88]={'$like':'%'+_0x3bde7f[_0x5e13('0x2d')]['filter']+'%'};return _0x3b4073;})});}_0x45d528=_[_0x5e13('0x3a')]({},_0x45d528,_0x3bde7f[_0x5e13('0x46')]);return _0x5c0e88['getConditions'](_0x45d528);}})[_0x5e13('0x24')](function(_0x3831bb){if(_0x3831bb){_0x464d32=_0x3831bb[_0x5e13('0x31')];if(!_0x3bde7f['query'][_0x5e13('0x50')](_0x5e13('0x33'))){_0x45d528[_0x5e13('0x1c')]=qs[_0x5e13('0x1c')](_0x3bde7f['query']['limit']);_0x45d528[_0x5e13('0x1a')]=qs[_0x5e13('0x1a')](_0x3bde7f['query'][_0x5e13('0x1a')]);}return _0x5c0e88[_0x5e13('0x4e')](_0x45d528);}})[_0x5e13('0x24')](function(_0x23e88b){if(_0x23e88b){return _0x23e88b?{'count':_0x464d32,'rows':_0x23e88b}:null;}})[_0x5e13('0x24')](respondWithResult(_0x1c8ea7,null))[_0x5e13('0x41')](handleError(_0x1c8ea7,null));};exports['addActions']=function(_0x15a845,_0x50a32f,_0x8dbdd7){return db['Action'][_0x5e13('0x47')]({'where':{'id':_0x15a845[_0x5e13('0x43')]['id']}})['then'](handleEntityNotFound(_0x50a32f,null))['then'](function(_0x58ce0e){if(_0x58ce0e){return _0x58ce0e[_0x5e13('0x51')](_0x15a845['body'][_0x5e13('0x4c')],_[_0x5e13('0x4d')](_0x15a845[_0x5e13('0x49')],[_0x5e13('0x4c'),'id'])||{});}})[_0x5e13('0x24')](respondWithResult(_0x50a32f,null))['catch'](handleError(_0x50a32f,null));};exports[_0x5e13('0x52')]=function(_0x502c37,_0x400278,_0x227734){var _0x29a71a={};var _0xf2290f={};var _0x329d64;var _0x3dab09;return db[_0x5e13('0x3c')][_0x5e13('0x4f')]({'where':{'id':_0x502c37[_0x5e13('0x43')]['id']}})[_0x5e13('0x24')](handleEntityNotFound(_0x400278,null))[_0x5e13('0x24')](function(_0x2c57c7){if(_0x2c57c7){_0x329d64=_0x2c57c7;_0xf2290f['model']=_[_0x5e13('0x44')](db['Action']['rawAttributes']);_0xf2290f['query']=_[_0x5e13('0x44')](_0x502c37[_0x5e13('0x2d')]);_0xf2290f[_0x5e13('0x37')]=_['intersection'](_0xf2290f['model'],_0xf2290f[_0x5e13('0x2d')]);_0x29a71a[_0x5e13('0x30')]=_['intersection'](_0xf2290f[_0x5e13('0x32')],qs[_0x5e13('0x2f')](_0x502c37[_0x5e13('0x2d')]['fields']));_0x29a71a[_0x5e13('0x30')]=_0x29a71a[_0x5e13('0x30')][_0x5e13('0x31')]?_0x29a71a[_0x5e13('0x30')]:_0xf2290f[_0x5e13('0x32')];_0x29a71a[_0x5e13('0x34')]=qs[_0x5e13('0x35')](_0x502c37[_0x5e13('0x2d')][_0x5e13('0x35')]);_0x29a71a[_0x5e13('0x36')]=qs[_0x5e13('0x37')](_[_0x5e13('0x38')](_0x502c37[_0x5e13('0x2d')],_0xf2290f['filters']));if(_0x502c37['query']['filter']){_0x29a71a[_0x5e13('0x36')]=_[_0x5e13('0x3a')](_0x29a71a[_0x5e13('0x36')],{'$or':_[_0x5e13('0x2c')](_0x29a71a[_0x5e13('0x30')],function(_0x36ea7d){var _0x375d27={};_0x375d27[_0x36ea7d]={'$like':'%'+_0x502c37[_0x5e13('0x2d')][_0x5e13('0x39')]+'%'};return _0x375d27;})});}_0x29a71a=_[_0x5e13('0x3a')]({},_0x29a71a,_0x502c37[_0x5e13('0x46')]);return _0x329d64[_0x5e13('0x52')](_0x29a71a);}})[_0x5e13('0x24')](function(_0x17b02e){if(_0x17b02e){_0x3dab09=_0x17b02e[_0x5e13('0x31')];if(!_0x502c37['query']['hasOwnProperty'](_0x5e13('0x33'))){_0x29a71a[_0x5e13('0x1c')]=qs[_0x5e13('0x1c')](_0x502c37[_0x5e13('0x2d')][_0x5e13('0x1c')]);_0x29a71a[_0x5e13('0x1a')]=qs['offset'](_0x502c37[_0x5e13('0x2d')][_0x5e13('0x1a')]);}return _0x329d64[_0x5e13('0x52')](_0x29a71a);}})[_0x5e13('0x24')](function(_0x5aeb74){if(_0x5aeb74){return _0x5aeb74?{'count':_0x3dab09,'rows':_0x5aeb74}:null;}})[_0x5e13('0x24')](respondWithResult(_0x400278,null))['catch'](handleError(_0x400278,null));}; \ No newline at end of file +var _0xa30e=['then','destroy','stack','name','send','index','Automation','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','map','merge','include','findAll','catch','show','length','includeAll','options','body','params','find','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa30e,0x7d));var _0xea30=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xa30e[_0x2de0a7];return _0x429437;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea30('0x0'));var zipdir=require(_0xea30('0x1'));var jsonpatch=require(_0xea30('0x2'));var rp=require(_0xea30('0x3'));var moment=require(_0xea30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea30('0x5'));var util=require(_0xea30('0x6'));var path=require(_0xea30('0x7'));var sox=require('sox');var csv=require(_0xea30('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea30('0x9'));var _=require(_0xea30('0xa'));var squel=require(_0xea30('0xb'));var crypto=require(_0xea30('0xc'));var jsforce=require(_0xea30('0xd'));var deskjs=require(_0xea30('0xe'));var toCsv=require(_0xea30('0x8'));var querystring=require(_0xea30('0xf'));var Papa=require(_0xea30('0x10'));var Redis=require(_0xea30('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xea30('0x12'));var as=require(_0xea30('0x13'));var hardwareService=require(_0xea30('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xea30('0x15'));var config=require(_0xea30('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xea30('0x17'))['db'];function respondWithStatusCode(_0x18835d,_0x3bdc58){_0x3bdc58=_0x3bdc58||0xcc;return function(_0x5df268){if(_0x5df268){return _0x18835d[_0xea30('0x18')](_0x3bdc58);}return _0x18835d[_0xea30('0x19')](_0x3bdc58)[_0xea30('0x1a')]();};}function respondWithResult(_0xd7b96,_0x297218){_0x297218=_0x297218||0xc8;return function(_0x2d7a68){if(_0x2d7a68){return _0xd7b96[_0xea30('0x19')](_0x297218)[_0xea30('0x1b')](_0x2d7a68);}};}function respondWithFilteredResult(_0x244a9b,_0x32481d){return function(_0x3f6d25){if(_0x3f6d25){var _0x698eb1=typeof _0x32481d[_0xea30('0x1c')]===_0xea30('0x1d')&&typeof _0x32481d['limit']===_0xea30('0x1d');var _0x5312a7=_0x3f6d25[_0xea30('0x1e')];var _0x53c318=_0x698eb1?0x0:_0x32481d[_0xea30('0x1c')];var _0x14faf7=_0x698eb1?_0x3f6d25[_0xea30('0x1e')]:_0x32481d[_0xea30('0x1c')]+_0x32481d[_0xea30('0x1f')];var _0x205ec8;if(_0x14faf7>=_0x5312a7){_0x14faf7=_0x5312a7;_0x205ec8=0xc8;}else{_0x205ec8=0xce;}_0x244a9b[_0xea30('0x19')](_0x205ec8);return _0x244a9b[_0xea30('0x20')](_0xea30('0x21'),_0x53c318+'-'+_0x14faf7+'/'+_0x5312a7)[_0xea30('0x1b')](_0x3f6d25);}return null;};}function patchUpdates(_0x3d42f4){return function(_0x9a5846){try{jsonpatch['apply'](_0x9a5846,_0x3d42f4,!![]);}catch(_0x3d0ed8){return BPromise[_0xea30('0x22')](_0x3d0ed8);}return _0x9a5846[_0xea30('0x23')]();};}function saveUpdates(_0x57195b,_0xb63e00){return function(_0x574d76){if(_0x574d76){return _0x574d76[_0xea30('0x24')](_0x57195b)[_0xea30('0x25')](function(_0x3d57dd){return _0x3d57dd;});}return null;};}function removeEntity(_0x22c299,_0x4318ac){return function(_0x9aa408){if(_0x9aa408){return _0x9aa408[_0xea30('0x26')]()[_0xea30('0x25')](function(){_0x22c299['status'](0xcc)[_0xea30('0x1a')]();});}};}function handleEntityNotFound(_0x4b22b1,_0x4c2b88){return function(_0x13bacb){if(!_0x13bacb){_0x4b22b1[_0xea30('0x18')](0x194);}return _0x13bacb;};}function handleError(_0x1a6f5a,_0x1d5657){_0x1d5657=_0x1d5657||0x1f4;return function(_0xdedfdf){logger['error'](_0xdedfdf[_0xea30('0x27')]);if(_0xdedfdf[_0xea30('0x28')]){delete _0xdedfdf[_0xea30('0x28')];}_0x1a6f5a[_0xea30('0x19')](_0x1d5657)[_0xea30('0x29')](_0xdedfdf);};}exports[_0xea30('0x2a')]=function(_0x3b9490,_0x292538){var _0x2a6cc3={},_0x5d78f7={},_0x5ec46e={'count':0x0,'rows':[]};var _0x195fd7=_['map'](db[_0xea30('0x2b')][_0xea30('0x2c')],function(_0x6c9edb){return{'name':_0x6c9edb['fieldName'],'type':_0x6c9edb[_0xea30('0x2d')][_0xea30('0x2e')]};});_0x5d78f7[_0xea30('0x2f')]=_['map'](_0x195fd7,'name');_0x5d78f7[_0xea30('0x30')]=_[_0xea30('0x31')](_0x3b9490['query']);_0x5d78f7[_0xea30('0x32')]=_['intersection'](_0x5d78f7[_0xea30('0x2f')],_0x5d78f7['query']);_0x2a6cc3[_0xea30('0x33')]=_[_0xea30('0x34')](_0x5d78f7[_0xea30('0x2f')],qs['fields'](_0x3b9490['query'][_0xea30('0x35')]));_0x2a6cc3[_0xea30('0x33')]=_0x2a6cc3[_0xea30('0x33')]['length']?_0x2a6cc3[_0xea30('0x33')]:_0x5d78f7[_0xea30('0x2f')];if(!_0x3b9490[_0xea30('0x30')]['hasOwnProperty'](_0xea30('0x36'))){_0x2a6cc3[_0xea30('0x1f')]=qs[_0xea30('0x1f')](_0x3b9490[_0xea30('0x30')][_0xea30('0x1f')]);_0x2a6cc3[_0xea30('0x1c')]=qs['offset'](_0x3b9490['query']['offset']);}_0x2a6cc3[_0xea30('0x37')]=qs[_0xea30('0x38')](_0x3b9490[_0xea30('0x30')][_0xea30('0x38')]);_0x2a6cc3[_0xea30('0x39')]=qs['filters'](_[_0xea30('0x3a')](_0x3b9490[_0xea30('0x30')],_0x5d78f7[_0xea30('0x32')]),_0x195fd7);if(_0x3b9490[_0xea30('0x30')][_0xea30('0x3b')]){_0x2a6cc3[_0xea30('0x39')]=_['merge'](_0x2a6cc3['where'],{'$or':_[_0xea30('0x3c')](_0x195fd7,function(_0x3b0942){if(_0x3b0942[_0xea30('0x2d')]!=='VIRTUAL'){var _0x587382={};_0x587382[_0x3b0942[_0xea30('0x28')]]={'$like':'%'+_0x3b9490[_0xea30('0x30')][_0xea30('0x3b')]+'%'};return _0x587382;}})});}_0x2a6cc3=_[_0xea30('0x3d')]({},_0x2a6cc3,_0x3b9490['options']);var _0x17f554={'where':_0x2a6cc3[_0xea30('0x39')]};return db[_0xea30('0x2b')][_0xea30('0x1e')](_0x17f554)[_0xea30('0x25')](function(_0x10c0f5){_0x5ec46e[_0xea30('0x1e')]=_0x10c0f5;if(_0x3b9490[_0xea30('0x30')]['includeAll']){_0x2a6cc3[_0xea30('0x3e')]=[{'all':!![]}];}return db[_0xea30('0x2b')][_0xea30('0x3f')](_0x2a6cc3);})['then'](function(_0x470832){_0x5ec46e['rows']=_0x470832;return _0x5ec46e;})['then'](respondWithFilteredResult(_0x292538,_0x2a6cc3))[_0xea30('0x40')](handleError(_0x292538,null));};exports[_0xea30('0x41')]=function(_0x37941e,_0x6b8eb0){var _0x4e9ccb={'raw':![],'where':{'id':_0x37941e['params']['id']}},_0x14e6ba={};_0x14e6ba['model']=_[_0xea30('0x31')](db[_0xea30('0x2b')][_0xea30('0x2c')]);_0x14e6ba['query']=_['keys'](_0x37941e[_0xea30('0x30')]);_0x14e6ba['filters']=_[_0xea30('0x34')](_0x14e6ba[_0xea30('0x2f')],_0x14e6ba[_0xea30('0x30')]);_0x4e9ccb[_0xea30('0x33')]=_[_0xea30('0x34')](_0x14e6ba[_0xea30('0x2f')],qs[_0xea30('0x35')](_0x37941e[_0xea30('0x30')][_0xea30('0x35')]));_0x4e9ccb[_0xea30('0x33')]=_0x4e9ccb[_0xea30('0x33')][_0xea30('0x42')]?_0x4e9ccb[_0xea30('0x33')]:_0x14e6ba[_0xea30('0x2f')];if(_0x37941e[_0xea30('0x30')][_0xea30('0x43')]){_0x4e9ccb['include']=[{'all':!![]}];}_0x4e9ccb=_[_0xea30('0x3d')]({},_0x4e9ccb,_0x37941e[_0xea30('0x44')]);return db[_0xea30('0x2b')]['find'](_0x4e9ccb)[_0xea30('0x25')](handleEntityNotFound(_0x6b8eb0,null))['then'](respondWithResult(_0x6b8eb0,null))[_0xea30('0x40')](handleError(_0x6b8eb0,null));};exports['create']=function(_0x212c52,_0x57bc47){return db[_0xea30('0x2b')]['create'](_0x212c52[_0xea30('0x45')],{})[_0xea30('0x25')](respondWithResult(_0x57bc47,0xc9))[_0xea30('0x40')](handleError(_0x57bc47,null));};exports[_0xea30('0x24')]=function(_0x471234,_0x59050d){if(_0x471234['body']['id']){delete _0x471234[_0xea30('0x45')]['id'];}return db['Automation']['find']({'where':{'id':_0x471234[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x59050d,null))['then'](saveUpdates(_0x471234['body'],null))['then'](respondWithResult(_0x59050d,null))['catch'](handleError(_0x59050d,null));};exports[_0xea30('0x26')]=function(_0x19ea84,_0x22757f){return db[_0xea30('0x2b')][_0xea30('0x47')]({'where':{'id':_0x19ea84['params']['id']}})['then'](handleEntityNotFound(_0x22757f,null))['then'](removeEntity(_0x22757f,null))[_0xea30('0x40')](handleError(_0x22757f,null));};exports['addConditions']=function(_0x3eee4a,_0x8c87e8,_0x5b812a){return db[_0xea30('0x48')]['find']({'where':{'id':_0x3eee4a[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x8c87e8,null))['then'](function(_0x2a6e1a){if(_0x2a6e1a){return _0x2a6e1a['addConditions'](_0x3eee4a[_0xea30('0x45')][_0xea30('0x49')],_[_0xea30('0x4a')](_0x3eee4a[_0xea30('0x45')],['ids','id'])||{});}})[_0xea30('0x25')](respondWithResult(_0x8c87e8,null))[_0xea30('0x40')](handleError(_0x8c87e8,null));};exports[_0xea30('0x4b')]=function(_0x35c812,_0x20215c,_0x3f7f03){var _0x47b132={};var _0x41c9e1={};var _0x2c917c;var _0x350d17;return db[_0xea30('0x2b')][_0xea30('0x4c')]({'where':{'id':_0x35c812[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x20215c,null))[_0xea30('0x25')](function(_0x133369){if(_0x133369){_0x2c917c=_0x133369;_0x41c9e1[_0xea30('0x2f')]=_[_0xea30('0x31')](db['Condition']['rawAttributes']);_0x41c9e1[_0xea30('0x30')]=_[_0xea30('0x31')](_0x35c812[_0xea30('0x30')]);_0x41c9e1[_0xea30('0x32')]=_[_0xea30('0x34')](_0x41c9e1[_0xea30('0x2f')],_0x41c9e1['query']);_0x47b132[_0xea30('0x33')]=_[_0xea30('0x34')](_0x41c9e1[_0xea30('0x2f')],qs[_0xea30('0x35')](_0x35c812[_0xea30('0x30')][_0xea30('0x35')]));_0x47b132[_0xea30('0x33')]=_0x47b132[_0xea30('0x33')][_0xea30('0x42')]?_0x47b132[_0xea30('0x33')]:_0x41c9e1['model'];_0x47b132[_0xea30('0x37')]=qs[_0xea30('0x38')](_0x35c812['query'][_0xea30('0x38')]);_0x47b132[_0xea30('0x39')]=qs[_0xea30('0x32')](_['pick'](_0x35c812[_0xea30('0x30')],_0x41c9e1[_0xea30('0x32')]));if(_0x35c812[_0xea30('0x30')]['filter']){_0x47b132['where']=_[_0xea30('0x3d')](_0x47b132[_0xea30('0x39')],{'$or':_[_0xea30('0x3c')](_0x47b132[_0xea30('0x33')],function(_0x50c1b7){var _0x260734={};_0x260734[_0x50c1b7]={'$like':'%'+_0x35c812['query'][_0xea30('0x3b')]+'%'};return _0x260734;})});}_0x47b132=_[_0xea30('0x3d')]({},_0x47b132,_0x35c812['options']);return _0x2c917c[_0xea30('0x4b')](_0x47b132);}})['then'](function(_0x57e88b){if(_0x57e88b){_0x350d17=_0x57e88b[_0xea30('0x42')];if(!_0x35c812[_0xea30('0x30')]['hasOwnProperty'](_0xea30('0x36'))){_0x47b132[_0xea30('0x1f')]=qs[_0xea30('0x1f')](_0x35c812[_0xea30('0x30')]['limit']);_0x47b132[_0xea30('0x1c')]=qs['offset'](_0x35c812[_0xea30('0x30')][_0xea30('0x1c')]);}return _0x2c917c[_0xea30('0x4b')](_0x47b132);}})[_0xea30('0x25')](function(_0xbaa99a){if(_0xbaa99a){return _0xbaa99a?{'count':_0x350d17,'rows':_0xbaa99a}:null;}})[_0xea30('0x25')](respondWithResult(_0x20215c,null))[_0xea30('0x40')](handleError(_0x20215c,null));};exports[_0xea30('0x4d')]=function(_0x5b2a78,_0x240bf4,_0x14709e){return db[_0xea30('0x4e')]['find']({'where':{'id':_0x5b2a78[_0xea30('0x46')]['id']}})[_0xea30('0x25')](handleEntityNotFound(_0x240bf4,null))[_0xea30('0x25')](function(_0xbf387d){if(_0xbf387d){return _0xbf387d[_0xea30('0x4d')](_0x5b2a78[_0xea30('0x45')][_0xea30('0x49')],_[_0xea30('0x4a')](_0x5b2a78[_0xea30('0x45')],[_0xea30('0x49'),'id'])||{});}})[_0xea30('0x25')](respondWithResult(_0x240bf4,null))[_0xea30('0x40')](handleError(_0x240bf4,null));};exports[_0xea30('0x4f')]=function(_0x12a2b2,_0x3dd93a,_0x2adb87){var _0x5c5e58={};var _0x30966d={};var _0x468142;var _0x2f33c3;return db[_0xea30('0x2b')][_0xea30('0x4c')]({'where':{'id':_0x12a2b2['params']['id']}})['then'](handleEntityNotFound(_0x3dd93a,null))[_0xea30('0x25')](function(_0x54d60d){if(_0x54d60d){_0x468142=_0x54d60d;_0x30966d[_0xea30('0x2f')]=_[_0xea30('0x31')](db['Action'][_0xea30('0x2c')]);_0x30966d[_0xea30('0x30')]=_[_0xea30('0x31')](_0x12a2b2['query']);_0x30966d[_0xea30('0x32')]=_[_0xea30('0x34')](_0x30966d['model'],_0x30966d[_0xea30('0x30')]);_0x5c5e58['attributes']=_[_0xea30('0x34')](_0x30966d[_0xea30('0x2f')],qs[_0xea30('0x35')](_0x12a2b2[_0xea30('0x30')][_0xea30('0x35')]));_0x5c5e58[_0xea30('0x33')]=_0x5c5e58[_0xea30('0x33')]['length']?_0x5c5e58[_0xea30('0x33')]:_0x30966d[_0xea30('0x2f')];_0x5c5e58[_0xea30('0x37')]=qs[_0xea30('0x38')](_0x12a2b2[_0xea30('0x30')]['sort']);_0x5c5e58[_0xea30('0x39')]=qs[_0xea30('0x32')](_[_0xea30('0x3a')](_0x12a2b2['query'],_0x30966d['filters']));if(_0x12a2b2['query']['filter']){_0x5c5e58[_0xea30('0x39')]=_[_0xea30('0x3d')](_0x5c5e58[_0xea30('0x39')],{'$or':_[_0xea30('0x3c')](_0x5c5e58[_0xea30('0x33')],function(_0x473f80){var _0xfdb05b={};_0xfdb05b[_0x473f80]={'$like':'%'+_0x12a2b2['query'][_0xea30('0x3b')]+'%'};return _0xfdb05b;})});}_0x5c5e58=_['merge']({},_0x5c5e58,_0x12a2b2[_0xea30('0x44')]);return _0x468142[_0xea30('0x4f')](_0x5c5e58);}})[_0xea30('0x25')](function(_0x3f136d){if(_0x3f136d){_0x2f33c3=_0x3f136d[_0xea30('0x42')];if(!_0x12a2b2[_0xea30('0x30')][_0xea30('0x50')](_0xea30('0x36'))){_0x5c5e58[_0xea30('0x1f')]=qs[_0xea30('0x1f')](_0x12a2b2[_0xea30('0x30')][_0xea30('0x1f')]);_0x5c5e58[_0xea30('0x1c')]=qs['offset'](_0x12a2b2['query']['offset']);}return _0x468142[_0xea30('0x4f')](_0x5c5e58);}})['then'](function(_0x175170){if(_0x175170){return _0x175170?{'count':_0x2f33c3,'rows':_0x175170}:null;}})[_0xea30('0x25')](respondWithResult(_0x3dd93a,null))['catch'](handleError(_0x3dd93a,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index fc6fbc3..be888f3 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 _0x930a=['rimraf','../../config/environment','define','Automation','tools_automations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3a2749,_0x3c152c){var _0x3f18dd=function(_0x511cb8){while(--_0x511cb8){_0x3a2749['push'](_0x3a2749['shift']());}};_0x3f18dd(++_0x3c152c);}(_0x930a,0x1e5));var _0xa930=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x930a[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0xa930('0x0'));var util=require('util');var logger=require(_0xa930('0x1'))(_0xa930('0x2'));var moment=require(_0xa930('0x3'));var BPromise=require(_0xa930('0x4'));var rp=require(_0xa930('0x5'));var fs=require('fs');var path=require(_0xa930('0x6'));var rimraf=require(_0xa930('0x7'));var config=require(_0xa930('0x8'));var attributes=require('./automation.attributes');module['exports']=function(_0x1adaa7,_0x28aa12){return _0x1adaa7[_0xa930('0x9')](_0xa930('0xa'),attributes,{'tableName':_0xa930('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3a0=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./automation.attributes','define','Automation','tools_automations','lodash'];(function(_0x83855a,_0x1b630d){var _0x3cb1a1=function(_0x5bbee0){while(--_0x5bbee0){_0x83855a['push'](_0x83855a['shift']());}};_0x3cb1a1(++_0x1b630d);}(_0xd3a0,0x1ee));var _0x0d3a=function(_0x3be290,_0x54e769){_0x3be290=_0x3be290-0x0;var _0x57f423=_0xd3a0[_0x3be290];return _0x57f423;};'use strict';var _=require(_0x0d3a('0x0'));var util=require(_0x0d3a('0x1'));var logger=require(_0x0d3a('0x2'))('api');var moment=require(_0x0d3a('0x3'));var BPromise=require(_0x0d3a('0x4'));var rp=require(_0x0d3a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0d3a('0x6'));var attributes=require(_0x0d3a('0x7'));module['exports']=function(_0x745a32,_0x39d988){return _0x745a32[_0x0d3a('0x8')](_0x0d3a('0x9'),attributes,{'tableName':_0x0d3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index f96112e..ad14184 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 _0xa817=['../../config/environment','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x397d6d,_0x1d522e){var _0x107eba=function(_0x579d2c){while(--_0x579d2c){_0x397d6d['push'](_0x397d6d['shift']());}};_0x107eba(++_0x1d522e);}(_0xa817,0x7b));var _0x7a81=function(_0x29287f,_0x3d831d){_0x29287f=_0x29287f-0x0;var _0x40c827=_0xa817[_0x29287f];return _0x40c827;};'use strict';var _=require(_0x7a81('0x0'));var util=require(_0x7a81('0x1'));var moment=require(_0x7a81('0x2'));var BPromise=require(_0x7a81('0x3'));var rs=require(_0x7a81('0x4'));var fs=require('fs');var Redis=require(_0x7a81('0x5'));var db=require(_0x7a81('0x6'))['db'];var utils=require(_0x7a81('0x7'));var logger=require(_0x7a81('0x8'))('rpc');var config=require(_0x7a81('0x9'));var jayson=require(_0x7a81('0xa'));var client=jayson['client'][_0x7a81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35c35a,_0x3ab25c,_0x705d4e){return new BPromise(function(_0x1869fb,_0x18f6f6){return client['request'](_0x35c35a,_0x705d4e)[_0x7a81('0xc')](function(_0x5b3b66){logger['info'](_0x7a81('0xd'),_0x3ab25c,'request\x20sent');logger[_0x7a81('0xe')](_0x7a81('0xf'),_0x3ab25c,_0x7a81('0x10'),JSON[_0x7a81('0x11')](_0x5b3b66));if(_0x5b3b66[_0x7a81('0x12')]){if(_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x13')]===0x1f4){logger['error'](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x18f6f6(_0x5b3b66['error'][_0x7a81('0x14')]);}logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x5b3b66[_0x7a81('0x12')][_0x7a81('0x14')]);return _0x1869fb(_0x5b3b66[_0x7a81('0x12')]['message']);}else{logger['info'](_0x7a81('0xd'),_0x3ab25c,_0x7a81('0x10'));_0x1869fb(_0x5b3b66['result'][_0x7a81('0x14')]);}})[_0x7a81('0x15')](function(_0x179afd){logger[_0x7a81('0x12')](_0x7a81('0xd'),_0x3ab25c,_0x179afd);_0x18f6f6(_0x179afd);});});} \ No newline at end of file +var _0xd2f5=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code','Automation,\x20%s,\x20%s','message'];(function(_0x148c93,_0x3faa25){var _0x4c1abc=function(_0x12e8f4){while(--_0x12e8f4){_0x148c93['push'](_0x148c93['shift']());}};_0x4c1abc(++_0x3faa25);}(_0xd2f5,0x12e));var _0x5d2f=function(_0x19e2ce,_0x487cba){_0x19e2ce=_0x19e2ce-0x0;var _0x433167=_0xd2f5[_0x19e2ce];return _0x433167;};'use strict';var _=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var moment=require(_0x5d2f('0x2'));var BPromise=require(_0x5d2f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d2f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5d2f('0x5'))(_0x5d2f('0x6'));var config=require(_0x5d2f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d2f('0x8')][_0x5d2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbf53b,_0x57673f,_0x3062bf){return new BPromise(function(_0x72bf9f,_0x330195){return client['request'](_0xbf53b,_0x3062bf)['then'](function(_0x43293d){logger[_0x5d2f('0xa')]('Automation,\x20%s,\x20%s',_0x57673f,_0x5d2f('0xb'));logger[_0x5d2f('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x57673f,'request\x20sent',JSON[_0x5d2f('0xd')](_0x43293d));if(_0x43293d[_0x5d2f('0xe')]){if(_0x43293d['error'][_0x5d2f('0xf')]===0x1f4){logger[_0x5d2f('0xe')](_0x5d2f('0x10'),_0x57673f,_0x43293d[_0x5d2f('0xe')][_0x5d2f('0x11')]);return _0x330195(_0x43293d[_0x5d2f('0xe')][_0x5d2f('0x11')]);}logger['error']('Automation,\x20%s,\x20%s',_0x57673f,_0x43293d['error']['message']);return _0x72bf9f(_0x43293d[_0x5d2f('0xe')]['message']);}else{logger[_0x5d2f('0xa')](_0x5d2f('0x10'),_0x57673f,_0x5d2f('0xb'));_0x72bf9f(_0x43293d[_0x5d2f('0x12')]['message']);}})[_0x5d2f('0x13')](function(_0x875750){logger['error'](_0x5d2f('0x10'),_0x57673f,_0x875750);_0x330195(_0x875750);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 6aed3fe..ec739bd 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 _0x6548=['exports','multer','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','create','post','addConditions','addActions','destroy'];(function(_0x303b57,_0x371b6b){var _0x4b8f98=function(_0x27b48f){while(--_0x27b48f){_0x303b57['push'](_0x303b57['shift']());}};_0x4b8f98(++_0x371b6b);}(_0x6548,0x133));var _0x8654=function(_0x2573f7,_0x1200bc){_0x2573f7=_0x2573f7-0x0;var _0x57740d=_0x6548[_0x2573f7];return _0x57740d;};'use strict';var multer=require(_0x8654('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8654('0x1'));var express=require(_0x8654('0x2'));var router=express[_0x8654('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8654('0x4'));var controller=require('./automation.controller');router[_0x8654('0x5')]('/',auth[_0x8654('0x6')](),controller[_0x8654('0x7')]);router[_0x8654('0x5')](_0x8654('0x8'),auth[_0x8654('0x6')](),controller[_0x8654('0x9')]);router['get'](_0x8654('0xa'),auth[_0x8654('0x6')](),controller['getConditions']);router[_0x8654('0x5')](_0x8654('0xb'),auth[_0x8654('0x6')](),controller['getActions']);router['post']('/',auth[_0x8654('0x6')](),controller[_0x8654('0xc')]);router[_0x8654('0xd')](_0x8654('0xa'),auth['isAuthenticated'](),controller[_0x8654('0xe')]);router[_0x8654('0xd')](_0x8654('0xb'),auth['isAuthenticated'](),controller[_0x8654('0xf')]);router['put'](_0x8654('0x8'),auth[_0x8654('0x6')](),controller['update']);router['delete']('/:id',auth[_0x8654('0x6')](),controller[_0x8654('0x10')]);module[_0x8654('0x11')]=router; \ No newline at end of file +var _0x3c17=['Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','/:id/conditions','addConditions','addActions','destroy','multer','path','express'];(function(_0xd1bb48,_0x25dc4b){var _0x520e8b=function(_0x33d98c){while(--_0x33d98c){_0xd1bb48['push'](_0xd1bb48['shift']());}};_0x520e8b(++_0x25dc4b);}(_0x3c17,0x1a1));var _0x73c1=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x3c17[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0x73c1('0x0'));var util=require('util');var path=require(_0x73c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x73c1('0x2'));var router=express[_0x73c1('0x3')]();var fs_extra=require(_0x73c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var controller=require(_0x73c1('0x7'));router[_0x73c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x73c1('0x9')]);router['get'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xc')]);router['get']('/:id/conditions',auth[_0x73c1('0xb')](),controller[_0x73c1('0xd')]);router[_0x73c1('0x8')](_0x73c1('0xe'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xf')]);router[_0x73c1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x73c1('0x10')](_0x73c1('0x11'),auth[_0x73c1('0xb')](),controller[_0x73c1('0x12')]);router['post'](_0x73c1('0xe'),auth['isAuthenticated'](),controller[_0x73c1('0x13')]);router['put'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller['update']);router['delete'](_0x73c1('0xa'),auth['isAuthenticated'](),controller[_0x73c1('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 0d68cdc..ee68743 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 _0x2922=['#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)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x4d997f,_0xf69c69){var _0x36aba7=function(_0x81da52){while(--_0x81da52){_0x4d997f['push'](_0x4d997f['shift']());}};_0x36aba7(++_0xf69c69);}(_0x2922,0x107));var _0x2292=function(_0x772bf1,_0x576e68){_0x772bf1=_0x772bf1-0x0;var _0x330cdc=_0x2922[_0x772bf1];return _0x330cdc;};'use strict';var Sequelize=require(_0x2292('0x0'));module['exports']={'name':{'type':Sequelize[_0x2292('0x1')],'unique':_0x2292('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2292('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x2292('0x4')},'description':{'type':Sequelize[_0x2292('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2292('0x5')},'limitCalls':{'type':Sequelize[_0x2292('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2292('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2292('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2292('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'defaultValue':0x3,'comment':_0x2292('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2292('0xf')},'dialTimezone':{'type':Sequelize[_0x2292('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2292('0x1')],'defaultValue':_0x2292('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x2292('0x3')](_0x2292('0x11'),_0x2292('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x2292('0x13')],'defaultValue':0x0,'comment':_0x2292('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x2292('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2292('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2292('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2292('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2292('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2292('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2292('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2292('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2292('0x6')](0x9)[_0x2292('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2292('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2292('0x1b'),_0x2292('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2292('0x1d')},'dialCutDigit':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2292('0x6')](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2292('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2292('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2292('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2292('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2292('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2292('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 +var _0x814a=['ivr','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM'];(function(_0x44154a,_0x23cf24){var _0x5a965e=function(_0x1d10ef){while(--_0x1d10ef){_0x44154a['push'](_0x44154a['shift']());}};_0x5a965e(++_0x23cf24);}(_0x814a,0x8e));var _0xa814=function(_0x577ac1,_0x8108a6){_0x577ac1=_0x577ac1-0x0;var _0x5a038c=_0x814a[_0x577ac1];return _0x5a038c;};'use strict';var Sequelize=require('sequelize');module[_0xa814('0x0')]={'name':{'type':Sequelize[_0xa814('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa814('0x2')](_0xa814('0x3')),'allowNull':![],'defaultValue':_0xa814('0x3')},'description':{'type':Sequelize[_0xa814('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xa814('0x4')](0x4)[_0xa814('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa814('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa814('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x6')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x7')},'dialBusyMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa814('0x8')},'dialTimezone':{'type':Sequelize[_0xa814('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa814('0x1')],'defaultValue':_0xa814('0x9')},'dialCheckDuplicateType':{'type':Sequelize[_0xa814('0x2')]('always',_0xa814('0xa'),'onlyIfOpen'),'defaultValue':_0xa814('0xb')},'dialAMDActive':{'type':Sequelize[_0xa814('0xc')],'defaultValue':0x0,'comment':_0xa814('0xd')},'dialAMDInitialSilence':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa814('0xe')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa814('0xf')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa814('0x4')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa814('0x10')},'dialAMDMinWordLength':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa814('0x4')](0x9)[_0xa814('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa814('0x4')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa814('0x11')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xa814('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa814('0x12')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa814('0x2')](_0xa814('0x13'),_0xa814('0x14')),'defaultValue':_0xa814('0x13')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa814('0x15')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x16')},'dialDropMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x17')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x18')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x19')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x1a')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa814('0x4')](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa814('0x4')](0x3)[_0xa814('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa814('0x1b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa814('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa814('0x1c')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 09f6e4e..7c100be 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 _0xa805=['COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_hopper','fromQuery','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','error','stack','name','map','Campaign','type','model','keys','query','filters','attributes','fields','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','body','updatedAt','userProfileId','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','ContactId','select','NOW()','CmListId','toString','ListId','field','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)'];(function(_0x3c2a87,_0x15fc6c){var _0x32640e=function(_0x4c58ff){while(--_0x4c58ff){_0x3c2a87['push'](_0x3c2a87['shift']());}};_0x32640e(++_0x15fc6c);}(_0xa805,0x8b));var _0x5a80=function(_0x3660eb,_0x1c833f){_0x3660eb=_0x3660eb-0x0;var _0x4d9c5a=_0xa805[_0x3660eb];return _0x4d9c5a;};'use strict';var emlformat=require(_0x5a80('0x0'));var rimraf=require(_0x5a80('0x1'));var zipdir=require(_0x5a80('0x2'));var jsonpatch=require(_0x5a80('0x3'));var rp=require(_0x5a80('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a80('0x5'));var path=require(_0x5a80('0x6'));var sox=require('sox');var csv=require(_0x5a80('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a80('0x8'));var _=require('lodash');var squel=require(_0x5a80('0x9'));var crypto=require('crypto');var jsforce=require(_0x5a80('0xa'));var deskjs=require(_0x5a80('0xb'));var toCsv=require(_0x5a80('0x7'));var querystring=require(_0x5a80('0xc'));var Papa=require(_0x5a80('0xd'));var Redis=require('ioredis');var authService=require(_0x5a80('0xe'));var qs=require(_0x5a80('0xf'));var as=require(_0x5a80('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a80('0x11'));var utils=require(_0x5a80('0x12'));var config=require(_0x5a80('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1abb91,_0x1143fd){_0x1143fd=_0x1143fd||0xcc;return function(_0x18129e){if(_0x18129e){return _0x1abb91[_0x5a80('0x14')](_0x1143fd);}return _0x1abb91['status'](_0x1143fd)[_0x5a80('0x15')]();};}function respondWithResult(_0x592902,_0x4a7c6b){_0x4a7c6b=_0x4a7c6b||0xc8;return function(_0x2e68c6){if(_0x2e68c6){return _0x592902[_0x5a80('0x16')](_0x4a7c6b)[_0x5a80('0x17')](_0x2e68c6);}};}function respondWithFilteredResult(_0xc0ac60,_0x4db562){return function(_0x5cf015){if(_0x5cf015){var _0x5e4422=typeof _0x4db562[_0x5a80('0x18')]===_0x5a80('0x19')&&typeof _0x4db562['limit']===_0x5a80('0x19');var _0x4945e6=_0x5cf015['count'];var _0x5377c5=_0x5e4422?0x0:_0x4db562['offset'];var _0x57948a=_0x5e4422?_0x5cf015[_0x5a80('0x1a')]:_0x4db562[_0x5a80('0x18')]+_0x4db562['limit'];var _0x3ab9c8;if(_0x57948a>=_0x4945e6){_0x57948a=_0x4945e6;_0x3ab9c8=0xc8;}else{_0x3ab9c8=0xce;}_0xc0ac60[_0x5a80('0x16')](_0x3ab9c8);return _0xc0ac60[_0x5a80('0x1b')](_0x5a80('0x1c'),_0x5377c5+'-'+_0x57948a+'/'+_0x4945e6)['json'](_0x5cf015);}return null;};}function patchUpdates(_0x55ddd7){return function(_0x6414b){try{jsonpatch[_0x5a80('0x1d')](_0x6414b,_0x55ddd7,!![]);}catch(_0x287c4f){return BPromise['reject'](_0x287c4f);}return _0x6414b['save']();};}function saveUpdates(_0x478447,_0xc2f9aa){return function(_0x297847){if(_0x297847){return _0x297847[_0x5a80('0x1e')](_0x478447)[_0x5a80('0x1f')](function(_0x478d0f){return _0x478d0f;});}return null;};}function removeEntity(_0x30eef7,_0x20aaf8){return function(_0x5ba0e9){if(_0x5ba0e9){return _0x5ba0e9[_0x5a80('0x20')]()[_0x5a80('0x1f')](function(){var _0x5b7d4e=_0x5ba0e9[_0x5a80('0x21')]({'plain':!![]});var _0x3e675e='IvrCampaigns';return db[_0x5a80('0x22')]['destroy']({'where':{'type':_0x3e675e,'resourceId':_0x5b7d4e['id']}})['then'](function(){return _0x5ba0e9;});})[_0x5a80('0x1f')](function(){_0x30eef7[_0x5a80('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31019b,_0x187018){return function(_0x5564b4){if(!_0x5564b4){_0x31019b[_0x5a80('0x14')](0x194);}return _0x5564b4;};}function handleError(_0x4ecf66,_0x19da6b){_0x19da6b=_0x19da6b||0x1f4;return function(_0xa22468){logger[_0x5a80('0x23')](_0xa22468[_0x5a80('0x24')]);if(_0xa22468[_0x5a80('0x25')]){delete _0xa22468['name'];}_0x4ecf66[_0x5a80('0x16')](_0x19da6b)['send'](_0xa22468);};}exports['index']=function(_0x203cb1,_0x5cf233){var _0x17349f={},_0x4de5a2={},_0x485789={'count':0x0,'rows':[]};var _0xe828ae=_[_0x5a80('0x26')](db[_0x5a80('0x27')]['rawAttributes'],function(_0x1e565e){return{'name':_0x1e565e['fieldName'],'type':_0x1e565e[_0x5a80('0x28')]['key']};});_0x4de5a2[_0x5a80('0x29')]=_['map'](_0xe828ae,_0x5a80('0x25'));_0x4de5a2['query']=_[_0x5a80('0x2a')](_0x203cb1[_0x5a80('0x2b')]);_0x4de5a2[_0x5a80('0x2c')]=_['intersection'](_0x4de5a2[_0x5a80('0x29')],_0x4de5a2[_0x5a80('0x2b')]);_0x17349f[_0x5a80('0x2d')]=_['intersection'](_0x4de5a2['model'],qs[_0x5a80('0x2e')](_0x203cb1['query']['fields']));_0x17349f[_0x5a80('0x2d')]=_0x17349f[_0x5a80('0x2d')]['length']?_0x17349f['attributes']:_0x4de5a2[_0x5a80('0x29')];if(!_0x203cb1[_0x5a80('0x2b')]['hasOwnProperty'](_0x5a80('0x2f'))){_0x17349f[_0x5a80('0x30')]=qs['limit'](_0x203cb1['query'][_0x5a80('0x30')]);_0x17349f['offset']=qs['offset'](_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x17349f['order']=qs[_0x5a80('0x31')](_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x17349f[_0x5a80('0x32')]=qs['filters'](_[_0x5a80('0x33')](_0x203cb1[_0x5a80('0x2b')],_0x4de5a2[_0x5a80('0x2c')]),_0xe828ae);if(_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x34')]){_0x17349f[_0x5a80('0x32')]=_['merge'](_0x17349f['where'],{'$or':_['map'](_0xe828ae,function(_0xbc31ea){if(_0xbc31ea['type']!=='VIRTUAL'){var _0x442812={};_0x442812[_0xbc31ea[_0x5a80('0x25')]]={'$like':'%'+_0x203cb1[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x442812;}})});}_0x17349f=_[_0x5a80('0x35')]({},_0x17349f,_0x203cb1[_0x5a80('0x36')]);var _0x2ad7ce={'where':_0x17349f['where']};return db[_0x5a80('0x27')]['count'](_0x2ad7ce)[_0x5a80('0x1f')](function(_0x2c5000){_0x485789[_0x5a80('0x1a')]=_0x2c5000;if(_0x203cb1['query'][_0x5a80('0x37')]){_0x17349f[_0x5a80('0x38')]=[{'all':!![]}];}return db[_0x5a80('0x27')][_0x5a80('0x39')](_0x17349f);})[_0x5a80('0x1f')](function(_0x381c76){_0x485789[_0x5a80('0x3a')]=_0x381c76;return _0x485789;})[_0x5a80('0x1f')](respondWithFilteredResult(_0x5cf233,_0x17349f))[_0x5a80('0x3b')](handleError(_0x5cf233,null));};exports['show']=function(_0x2a393b,_0x581990){var _0x2e865b={'raw':![],'where':{'id':_0x2a393b[_0x5a80('0x3c')]['id']}},_0x1322f5={};_0x1322f5['model']=_[_0x5a80('0x2a')](db[_0x5a80('0x27')]['rawAttributes']);_0x1322f5[_0x5a80('0x2b')]=_['keys'](_0x2a393b[_0x5a80('0x2b')]);_0x1322f5[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x1322f5[_0x5a80('0x29')],_0x1322f5['query']);_0x2e865b[_0x5a80('0x2d')]=_['intersection'](_0x1322f5[_0x5a80('0x29')],qs['fields'](_0x2a393b[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x2e865b[_0x5a80('0x2d')]=_0x2e865b[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x2e865b['attributes']:_0x1322f5['model'];if(_0x2a393b['query'][_0x5a80('0x37')]){_0x2e865b[_0x5a80('0x38')]=[{'all':!![]}];}_0x2e865b=_['merge']({},_0x2e865b,_0x2a393b[_0x5a80('0x36')]);return db[_0x5a80('0x27')]['find'](_0x2e865b)[_0x5a80('0x1f')](handleEntityNotFound(_0x581990,null))[_0x5a80('0x1f')](respondWithResult(_0x581990,null))[_0x5a80('0x3b')](handleError(_0x581990,null));};exports[_0x5a80('0x3f')]=function(_0x3af1e8,_0x573dbf){return db['Campaign'][_0x5a80('0x3f')](_0x3af1e8['body'],{})[_0x5a80('0x1f')](function(_0x5985fb){var _0x310e2c=_0x3af1e8[_0x5a80('0x40')][_0x5a80('0x21')]({'plain':!![]});if(!_0x310e2c)throw new Error(_0x5a80('0x41'));if(_0x310e2c[_0x5a80('0x42')]===_0x5a80('0x40')){var _0x4840e8=_0x5985fb[_0x5a80('0x21')]({'plain':!![]});var _0x253e99=_0x5a80('0x43');return db[_0x5a80('0x44')][_0x5a80('0x45')]({'where':{'name':_0x253e99,'userProfileId':_0x310e2c['userProfileId']},'raw':!![]})[_0x5a80('0x1f')](function(_0x45290b){if(_0x45290b&&_0x45290b[_0x5a80('0x46')]===0x0){return db[_0x5a80('0x22')]['create']({'name':_0x4840e8[_0x5a80('0x25')],'resourceId':_0x4840e8['id'],'type':_0x45290b['name'],'sectionId':_0x45290b['id']},{})[_0x5a80('0x1f')](function(){return _0x5985fb;});}else{return _0x5985fb;}})[_0x5a80('0x3b')](function(_0x2e6c0d){logger['error'](_0x5a80('0x47'),_0x2e6c0d);throw _0x2e6c0d;});}return _0x5985fb;})[_0x5a80('0x1f')](respondWithResult(_0x573dbf,0xc9))[_0x5a80('0x3b')](handleError(_0x573dbf,null));};exports[_0x5a80('0x48')]=function(_0x430e43,_0x7eb977){var _0x5a4b82={'where':{'id':_0x430e43['params']['id']}},_0x447428={};_0x447428[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db[_0x5a80('0x27')][_0x5a80('0x49')]);_0x5a4b82['attributes']=_[_0x5a80('0x3d')](_0x447428[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x430e43[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x5a4b82[_0x5a80('0x2d')]=_0x5a4b82[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x5a4b82[_0x5a80('0x2d')]:_0x447428[_0x5a80('0x29')];if(_0x430e43[_0x5a80('0x2b')][_0x5a80('0x37')]){_0x5a4b82[_0x5a80('0x38')]=[{'all':!![]}];}_0x5a4b82=_[_0x5a80('0x35')]({},_0x5a4b82,_0x430e43[_0x5a80('0x36')]);return db[_0x5a80('0x27')][_0x5a80('0x45')](_0x5a4b82)[_0x5a80('0x1f')](handleEntityNotFound(_0x7eb977,null))[_0x5a80('0x1f')](function(_0x5b1df9){if(_0x5b1df9){var _0x3118d1=_0x5b1df9['get']({'plain':!![]});_0x3118d1=qs[_0x5a80('0x4a')](_0x3118d1,['id',_0x5a80('0x4b'),'updatedAt']);_0x430e43['body']=_[_0x5a80('0x4a')](_0x430e43[_0x5a80('0x4c')],['id',_0x5a80('0x4b'),_0x5a80('0x4d')]);return db['Campaign']['create'](_[_0x5a80('0x35')](_0x3118d1,_0x430e43[_0x5a80('0x4c')]),{'include':_0x430e43['query'][_0x5a80('0x37')]?[{'all':!![]}]:undefined})['then'](function(_0x11fde2){var _0x522492=_0x430e43[_0x5a80('0x40')][_0x5a80('0x21')]({'plain':!![]});if(!_0x522492)throw new Error(_0x5a80('0x41'));if(_0x522492['role']==='user'){var _0xce3c30=_0x11fde2[_0x5a80('0x21')]({'plain':!![]});var _0x598f25=_0x5a80('0x43');return db[_0x5a80('0x44')][_0x5a80('0x45')]({'where':{'name':_0x598f25,'userProfileId':_0x522492[_0x5a80('0x4e')]},'raw':!![]})['then'](function(_0x3d592a){if(_0x3d592a&&_0x3d592a[_0x5a80('0x46')]===0x0){return db[_0x5a80('0x22')][_0x5a80('0x3f')]({'name':_0xce3c30['name'],'resourceId':_0xce3c30['id'],'type':_0x3d592a[_0x5a80('0x25')],'sectionId':_0x3d592a['id']},{})[_0x5a80('0x1f')](function(){return _0x11fde2;});}else{return _0x11fde2;}})['catch'](function(_0x11c37e){logger[_0x5a80('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11c37e);throw _0x11c37e;});}return _0x11fde2;});}})[_0x5a80('0x1f')](respondWithResult(_0x7eb977,0xc9))['catch'](handleError(_0x7eb977,null));};exports[_0x5a80('0x1e')]=function(_0x4463b5,_0x35ff04){if(_0x4463b5[_0x5a80('0x4c')]['id']){delete _0x4463b5[_0x5a80('0x4c')]['id'];}return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x4463b5[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x35ff04,null))[_0x5a80('0x1f')](saveUpdates(_0x4463b5[_0x5a80('0x4c')],null))['then'](respondWithResult(_0x35ff04,null))[_0x5a80('0x3b')](handleError(_0x35ff04,null));};exports['destroy']=function(_0x23af63,_0x4b7eb2){return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x23af63[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x4b7eb2,null))[_0x5a80('0x1f')](removeEntity(_0x4b7eb2,null))[_0x5a80('0x3b')](handleError(_0x4b7eb2,null));};exports['getHoppers']=function(_0x553220,_0x15e977,_0xb4bf3){var _0xd1aa40={'raw':!![],'where':{}};var _0x1c647a={};var _0x1e1772={'count':0x0,'rows':[]};return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x553220['params']['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x15e977,null))[_0x5a80('0x1f')](function(_0x5d4af0){if(_0x5d4af0){_0x1c647a[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db[_0x5a80('0x50')][_0x5a80('0x49')]);_0x1c647a['query']=_['keys'](_0x553220[_0x5a80('0x2b')]);_0x1c647a[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x1c647a['model'],_0x1c647a['query']);_0xd1aa40['attributes']=_[_0x5a80('0x3d')](_0x1c647a['model'],qs[_0x5a80('0x2e')](_0x553220[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0xd1aa40[_0x5a80('0x2d')]=_0xd1aa40[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0xd1aa40[_0x5a80('0x2d')]:_0x1c647a[_0x5a80('0x29')];if(!_0x553220['query'][_0x5a80('0x51')](_0x5a80('0x2f'))){_0xd1aa40['limit']=qs['limit'](_0x553220['query'][_0x5a80('0x30')]);_0xd1aa40[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x553220[_0x5a80('0x2b')]['offset']);}_0xd1aa40[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x553220[_0x5a80('0x2b')][_0x5a80('0x31')]);_0xd1aa40[_0x5a80('0x32')]=qs[_0x5a80('0x2c')](_[_0x5a80('0x33')](_0x553220[_0x5a80('0x2b')],_0x1c647a[_0x5a80('0x2c')]));_0xd1aa40[_0x5a80('0x32')][_0x5a80('0x53')]=_0x5d4af0['id'];if(_0x553220['query'][_0x5a80('0x34')]){_0xd1aa40[_0x5a80('0x32')]=_['merge'](_0xd1aa40[_0x5a80('0x32')],{'$or':_['map'](_0xd1aa40[_0x5a80('0x2d')],function(_0x5e331e){var _0x517f85={};_0x517f85[_0x5e331e]={'$like':'%'+_0x553220[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x517f85;})});}_0xd1aa40=_[_0x5a80('0x35')]({},_0xd1aa40,_0x553220[_0x5a80('0x36')]);return db[_0x5a80('0x50')][_0x5a80('0x1a')]({'where':_0xd1aa40[_0x5a80('0x32')]})[_0x5a80('0x1f')](function(_0x31b531){_0x1e1772[_0x5a80('0x1a')]=_0x31b531;if(_0x553220[_0x5a80('0x2b')]['includeAll']){_0xd1aa40[_0x5a80('0x38')]=[{'all':!![]}];}return db[_0x5a80('0x50')][_0x5a80('0x39')](_0xd1aa40);})[_0x5a80('0x1f')](function(_0x2a6af7){_0x1e1772[_0x5a80('0x3a')]=_0x2a6af7;return _0x1e1772;});}})['then'](respondWithFilteredResult(_0x15e977,_0xd1aa40))[_0x5a80('0x3b')](handleError(_0x15e977,null));};exports[_0x5a80('0x54')]=function(_0x5c7120,_0x47dadb,_0x34e914){var _0x8f4a75={'raw':!![],'where':{}};var _0x1e33e6={};var _0x2dbd2e={'count':0x0,'rows':[]};return db[_0x5a80('0x27')][_0x5a80('0x4f')]({'where':{'id':_0x5c7120[_0x5a80('0x3c')]['id']}})['then'](handleEntityNotFound(_0x47dadb,null))['then'](function(_0x573339){if(_0x573339){_0x1e33e6['model']=_[_0x5a80('0x2a')](db[_0x5a80('0x55')][_0x5a80('0x49')]);_0x1e33e6[_0x5a80('0x2b')]=_[_0x5a80('0x2a')](_0x5c7120[_0x5a80('0x2b')]);_0x1e33e6['filters']=_[_0x5a80('0x3d')](_0x1e33e6[_0x5a80('0x29')],_0x1e33e6['query']);_0x8f4a75[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x1e33e6[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x8f4a75[_0x5a80('0x2d')]=_0x8f4a75[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x8f4a75[_0x5a80('0x2d')]:_0x1e33e6['model'];if(!_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x51')]('nolimit')){_0x8f4a75[_0x5a80('0x30')]=qs[_0x5a80('0x30')](_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x30')]);_0x8f4a75[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x8f4a75[_0x5a80('0x52')]=qs['sort'](_0x5c7120[_0x5a80('0x2b')]['sort']);_0x8f4a75['where']=qs[_0x5a80('0x2c')](_[_0x5a80('0x33')](_0x5c7120[_0x5a80('0x2b')],_0x1e33e6[_0x5a80('0x2c')]));_0x8f4a75['where']['CampaignId']=_0x573339['id'];if(_0x5c7120['query'][_0x5a80('0x34')]){_0x8f4a75[_0x5a80('0x32')]=_['merge'](_0x8f4a75[_0x5a80('0x32')],{'$or':_[_0x5a80('0x26')](_0x8f4a75[_0x5a80('0x2d')],function(_0x46ec41){var _0x112150={};_0x112150[_0x46ec41]={'$like':'%'+_0x5c7120[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x112150;})});}_0x8f4a75=_[_0x5a80('0x35')]({},_0x8f4a75,_0x5c7120[_0x5a80('0x36')]);return db[_0x5a80('0x55')][_0x5a80('0x1a')]({'where':_0x8f4a75[_0x5a80('0x32')]})[_0x5a80('0x1f')](function(_0x30a644){_0x2dbd2e['count']=_0x30a644;if(_0x5c7120[_0x5a80('0x2b')]['includeAll']){_0x8f4a75['include']=[{'all':!![]}];}return db[_0x5a80('0x55')][_0x5a80('0x39')](_0x8f4a75);})[_0x5a80('0x1f')](function(_0x5102ee){_0x2dbd2e[_0x5a80('0x3a')]=_0x5102ee;return _0x2dbd2e;});}})[_0x5a80('0x1f')](respondWithFilteredResult(_0x47dadb,_0x8f4a75))[_0x5a80('0x3b')](handleError(_0x47dadb,null));};exports[_0x5a80('0x56')]=function(_0x50f2a9,_0x46da80,_0x5f1d92){var _0x1a3067={'raw':!![],'where':{}};var _0x17b0df={};var _0x157722={'count':0x0,'rows':[]};return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x50f2a9[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x46da80,null))['then'](function(_0x3d9c39){if(_0x3d9c39){_0x17b0df[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db['CmHopperFinal'][_0x5a80('0x49')]);_0x17b0df['query']=_[_0x5a80('0x2a')](_0x50f2a9['query']);_0x17b0df[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x17b0df['model'],_0x17b0df[_0x5a80('0x2b')]);_0x1a3067[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x17b0df[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x50f2a9['query']['fields']));_0x1a3067[_0x5a80('0x2d')]=_0x1a3067[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x1a3067[_0x5a80('0x2d')]:_0x17b0df['model'];if(!_0x50f2a9['query'][_0x5a80('0x51')]('nolimit')){_0x1a3067[_0x5a80('0x30')]=qs[_0x5a80('0x30')](_0x50f2a9['query'][_0x5a80('0x30')]);_0x1a3067[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x50f2a9[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x1a3067[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x50f2a9[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x1a3067['where']=qs['filters'](_[_0x5a80('0x33')](_0x50f2a9['query'],_0x17b0df[_0x5a80('0x2c')]));_0x1a3067['where'][_0x5a80('0x53')]=_0x3d9c39['id'];if(_0x50f2a9['query'][_0x5a80('0x34')]){_0x1a3067['where']=_[_0x5a80('0x35')](_0x1a3067[_0x5a80('0x32')],{'$or':_[_0x5a80('0x26')](_0x1a3067[_0x5a80('0x2d')],function(_0x5daf94){var _0x58c4e6={};_0x58c4e6[_0x5daf94]={'$like':'%'+_0x50f2a9['query'][_0x5a80('0x34')]+'%'};return _0x58c4e6;})});}_0x1a3067=_[_0x5a80('0x35')]({},_0x1a3067,_0x50f2a9[_0x5a80('0x36')]);return db['CmHopperFinal']['count']({'where':_0x1a3067['where']})['then'](function(_0x5bf662){_0x157722[_0x5a80('0x1a')]=_0x5bf662;if(_0x50f2a9[_0x5a80('0x2b')][_0x5a80('0x37')]){_0x1a3067['include']=[{'all':!![]}];}return db[_0x5a80('0x57')]['findAll'](_0x1a3067);})['then'](function(_0xb2136e){_0x157722['rows']=_0xb2136e;return _0x157722;});}})['then'](respondWithFilteredResult(_0x46da80,_0x1a3067))[_0x5a80('0x3b')](handleError(_0x46da80,null));};exports[_0x5a80('0x58')]=function(_0x30f1b2,_0x5160d1,_0x592e62){var _0x420903={'raw':!![],'where':{}};var _0x4c6a0b={};var _0x47a7b2={'count':0x0,'rows':[]};return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x30f1b2['params']['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x5160d1,null))[_0x5a80('0x1f')](function(_0x5d007c){if(_0x5d007c){_0x4c6a0b[_0x5a80('0x29')]=_['keys'](db['CmHopperBlack'][_0x5a80('0x49')]);_0x4c6a0b[_0x5a80('0x2b')]=_[_0x5a80('0x2a')](_0x30f1b2[_0x5a80('0x2b')]);_0x4c6a0b[_0x5a80('0x2c')]=_['intersection'](_0x4c6a0b[_0x5a80('0x29')],_0x4c6a0b[_0x5a80('0x2b')]);_0x420903[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x4c6a0b[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x420903['attributes']=_0x420903['attributes'][_0x5a80('0x3e')]?_0x420903[_0x5a80('0x2d')]:_0x4c6a0b[_0x5a80('0x29')];if(!_0x30f1b2[_0x5a80('0x2b')]['hasOwnProperty']('nolimit')){_0x420903['limit']=qs[_0x5a80('0x30')](_0x30f1b2['query'][_0x5a80('0x30')]);_0x420903['offset']=qs[_0x5a80('0x18')](_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x18')]);}_0x420903[_0x5a80('0x52')]=qs['sort'](_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x420903[_0x5a80('0x32')]=qs[_0x5a80('0x2c')](_[_0x5a80('0x33')](_0x30f1b2[_0x5a80('0x2b')],_0x4c6a0b[_0x5a80('0x2c')]));_0x420903['where']['CampaignId']=_0x5d007c['id'];if(_0x30f1b2[_0x5a80('0x2b')]['filter']){_0x420903['where']=_[_0x5a80('0x35')](_0x420903[_0x5a80('0x32')],{'$or':_['map'](_0x420903[_0x5a80('0x2d')],function(_0x32c47f){var _0x5d1059={};_0x5d1059[_0x32c47f]={'$like':'%'+_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x5d1059;})});}_0x420903=_[_0x5a80('0x35')]({},_0x420903,_0x30f1b2[_0x5a80('0x36')]);return db['CmHopperBlack']['count']({'where':_0x420903['where']})[_0x5a80('0x1f')](function(_0x48a310){_0x47a7b2[_0x5a80('0x1a')]=_0x48a310;if(_0x30f1b2[_0x5a80('0x2b')][_0x5a80('0x37')]){_0x420903[_0x5a80('0x38')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5a80('0x39')](_0x420903);})['then'](function(_0x54fda1){_0x47a7b2[_0x5a80('0x3a')]=_0x54fda1;return _0x47a7b2;});}})['then'](respondWithFilteredResult(_0x5160d1,_0x420903))[_0x5a80('0x3b')](handleError(_0x5160d1,null));};exports[_0x5a80('0x59')]=function(_0x1c2da3,_0x492411,_0x461e43){var _0x35ca9d={};var _0x12edb8={};var _0x562340;var _0x3ec92f;return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x1c2da3['params']['id']}})['then'](handleEntityNotFound(_0x492411,null))[_0x5a80('0x1f')](function(_0x2dd54b){if(_0x2dd54b){_0x562340=_0x2dd54b;_0x12edb8[_0x5a80('0x29')]=_[_0x5a80('0x2a')](db['CmList'][_0x5a80('0x49')]);_0x12edb8[_0x5a80('0x2b')]=_['keys'](_0x1c2da3[_0x5a80('0x2b')]);_0x12edb8['filters']=_[_0x5a80('0x3d')](_0x12edb8[_0x5a80('0x29')],_0x12edb8[_0x5a80('0x2b')]);_0x35ca9d[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x12edb8['model'],qs[_0x5a80('0x2e')](_0x1c2da3[_0x5a80('0x2b')]['fields']));_0x35ca9d[_0x5a80('0x2d')]=_0x35ca9d[_0x5a80('0x2d')][_0x5a80('0x3e')]?_0x35ca9d[_0x5a80('0x2d')]:_0x12edb8[_0x5a80('0x29')];_0x35ca9d[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x35ca9d[_0x5a80('0x32')]=qs[_0x5a80('0x2c')](_['pick'](_0x1c2da3['query'],_0x12edb8[_0x5a80('0x2c')]));if(_0x1c2da3['query'][_0x5a80('0x34')]){_0x35ca9d[_0x5a80('0x32')]=_[_0x5a80('0x35')](_0x35ca9d['where'],{'$or':_[_0x5a80('0x26')](_0x35ca9d['attributes'],function(_0x128d15){var _0x1d0b6d={};_0x1d0b6d[_0x128d15]={'$like':'%'+_0x1c2da3['query']['filter']+'%'};return _0x1d0b6d;})});}_0x35ca9d=_[_0x5a80('0x35')]({},_0x35ca9d,_0x1c2da3['options']);return _0x562340[_0x5a80('0x59')](_0x35ca9d);}})['then'](function(_0x31f1d3){if(_0x31f1d3){_0x3ec92f=_0x31f1d3[_0x5a80('0x3e')];if(!_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x51')](_0x5a80('0x2f'))){_0x35ca9d['limit']=qs[_0x5a80('0x30')](_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x30')]);_0x35ca9d[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x1c2da3[_0x5a80('0x2b')][_0x5a80('0x18')]);}return _0x562340[_0x5a80('0x59')](_0x35ca9d);}})[_0x5a80('0x1f')](function(_0x4a1b1d){if(_0x4a1b1d){return _0x4a1b1d?{'count':_0x3ec92f,'rows':_0x4a1b1d}:null;}})[_0x5a80('0x1f')](respondWithResult(_0x492411,null))[_0x5a80('0x3b')](handleError(_0x492411,null));};exports['addLists']=function(_0x40c20b,_0x56c411,_0x5aee94){var _0x113ae5,_0x46841b;return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x40c20b[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x56c411,null))[_0x5a80('0x1f')](function(_0x22758a){if(_0x22758a){_0x46841b=_0x22758a;return _0x22758a[_0x5a80('0x5a')](_0x40c20b['body'][_0x5a80('0x5b')],_[_0x5a80('0x4a')](_0x40c20b[_0x5a80('0x4c')],[_0x5a80('0x5b'),'id'])||{});}return null;})[_0x5a80('0x5c')](function(_0x4ce1c4){var _0x296cff;_0x113ae5=_0x4ce1c4||[];var _0x73e156=[];if(_0x4ce1c4){for(var _0x4a1257=0x0;_0x4a1257<_0x4ce1c4[_0x5a80('0x3e')];_0x4a1257+=0x1){var _0x1d6149=_0x4ce1c4[_0x4a1257]['get']({'plain':!![]});_0x46841b[_0x5a80('0x5d')]=_0x40c20b[_0x5a80('0x4c')]['dialCheckDuplicateType']?_0x40c20b['body'][_0x5a80('0x5d')]:_0x46841b['dialCheckDuplicateType'];switch(_0x46841b[_0x5a80('0x5d')]){case _0x5a80('0x5e'):_0x296cff=squel[_0x5a80('0x5f')]()[_0x5a80('0x60')]('cm_hopper')['fromQuery']([_0x5a80('0x61'),_0x5a80('0x62'),_0x5a80('0x63'),'ListId','CampaignId','createdAt',_0x5a80('0x4d')],squel[_0x5a80('0x64')]()['field'](_0x5a80('0x61'),_0x5a80('0x61'))['field'](_0x5a80('0x65'),'scheduledAt')['field']('id',_0x5a80('0x63'))['field'](_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')](),_0x5a80('0x68'))[_0x5a80('0x69')](_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),_0x5a80('0x53'))[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4b'))['field'](_0x5a80('0x65'),_0x5a80('0x4d'))[_0x5a80('0x6a')](_0x5a80('0x6b'))[_0x5a80('0x32')](_0x5a80('0x6c'))[_0x5a80('0x32')](_0x5a80('0x6d'),_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')]())[_0x5a80('0x32')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x5a80('0x6e'),squel[_0x5a80('0x64')]()[_0x5a80('0x69')](_0x5a80('0x6f'))[_0x5a80('0x6a')]('cm_hopper_final')['where'](_0x5a80('0x70'),_0x40c20b[_0x5a80('0x3c')]['id']['toString']()))[_0x5a80('0x32')](_0x5a80('0x6e'),squel[_0x5a80('0x64')]()[_0x5a80('0x69')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x5a80('0x70'),_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')]())))[_0x5a80('0x67')]();break;case'onlyIfOpen':_0x296cff=squel[_0x5a80('0x5f')]()['into'](_0x5a80('0x71'))[_0x5a80('0x72')]([_0x5a80('0x61'),_0x5a80('0x62'),'ContactId',_0x5a80('0x68'),_0x5a80('0x53'),'createdAt',_0x5a80('0x4d')],squel[_0x5a80('0x64')]()['field'](_0x5a80('0x61'),_0x5a80('0x61'))[_0x5a80('0x69')]('NOW()',_0x5a80('0x62'))[_0x5a80('0x69')]('id','ContactId')[_0x5a80('0x69')](_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')](),'ListId')[_0x5a80('0x69')](_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),_0x5a80('0x53'))['field'](_0x5a80('0x65'),'createdAt')[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4d'))[_0x5a80('0x6a')]('cm_contacts')[_0x5a80('0x32')]('deletedAt\x20IS\x20NULL')[_0x5a80('0x32')]('ListId\x20=\x20?',_0x1d6149[_0x5a80('0x66')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x5a80('0x6e'),squel[_0x5a80('0x64')]()['field']('COALESCE(phone,\x27\x27)')[_0x5a80('0x6a')]('cm_hopper')[_0x5a80('0x32')](_0x5a80('0x70'),_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')]())))['toString']();break;default:_0x296cff=squel[_0x5a80('0x5f')]()['into'](_0x5a80('0x71'))[_0x5a80('0x72')](['phone',_0x5a80('0x62'),_0x5a80('0x63'),_0x5a80('0x68'),_0x5a80('0x53'),'createdAt','updatedAt'],squel[_0x5a80('0x64')]()[_0x5a80('0x69')](_0x5a80('0x61'),_0x5a80('0x61'))[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x62'))[_0x5a80('0x69')]('id',_0x5a80('0x63'))[_0x5a80('0x69')](_0x1d6149[_0x5a80('0x66')][_0x5a80('0x67')](),'ListId')[_0x5a80('0x69')](_0x40c20b[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),'CampaignId')[_0x5a80('0x69')]('NOW()','createdAt')[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4d'))[_0x5a80('0x6a')](_0x5a80('0x6b'))[_0x5a80('0x32')](_0x5a80('0x6c'))[_0x5a80('0x32')]('ListId\x20=\x20?',_0x1d6149['CmListId'][_0x5a80('0x67')]())[_0x5a80('0x32')](_0x5a80('0x73')))[_0x5a80('0x67')]();}_0x73e156[_0x5a80('0x74')](db[_0x5a80('0x75')][_0x5a80('0x2b')](_0x296cff));}return BPromise['all'](_0x73e156);}})[_0x5a80('0x1f')](function(){return _0x113ae5;})[_0x5a80('0x1f')](respondWithResult(_0x56c411,null))[_0x5a80('0x3b')](handleError(_0x56c411,null));};exports[_0x5a80('0x76')]=function(_0x2a2674,_0x2bb478,_0x31db46){return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x2a2674[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x2bb478,null))[_0x5a80('0x1f')](function(_0x23797a){if(_0x23797a){return _0x23797a['removeLists'](_0x2a2674[_0x5a80('0x2b')][_0x5a80('0x5b')]);}})[_0x5a80('0x1f')](function(_0x489d9a){if(_0x489d9a){return db[_0x5a80('0x50')][_0x5a80('0x20')]({'where':{'ListId':_0x2a2674[_0x5a80('0x2b')][_0x5a80('0x5b')],'CampaignId':_0x2a2674[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](function(){return _0x489d9a;});}})[_0x5a80('0x1f')](respondWithStatusCode(_0x2bb478,null))[_0x5a80('0x3b')](handleError(_0x2bb478,null));};exports[_0x5a80('0x77')]=function(_0x1a7dfc,_0x45bdd7,_0x496827){var _0x32b94e={};var _0x1d1408={};var _0x26214f;var _0x1671dd;return db['Campaign'][_0x5a80('0x4f')]({'where':{'id':_0x1a7dfc[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x45bdd7,null))[_0x5a80('0x1f')](function(_0x1ac862){if(_0x1ac862){_0x26214f=_0x1ac862;_0x1d1408['model']=_[_0x5a80('0x2a')](db[_0x5a80('0x78')]['rawAttributes']);_0x1d1408[_0x5a80('0x2b')]=_[_0x5a80('0x2a')](_0x1a7dfc['query']);_0x1d1408[_0x5a80('0x2c')]=_[_0x5a80('0x3d')](_0x1d1408[_0x5a80('0x29')],_0x1d1408[_0x5a80('0x2b')]);_0x32b94e[_0x5a80('0x2d')]=_[_0x5a80('0x3d')](_0x1d1408[_0x5a80('0x29')],qs[_0x5a80('0x2e')](_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x2e')]));_0x32b94e[_0x5a80('0x2d')]=_0x32b94e['attributes'][_0x5a80('0x3e')]?_0x32b94e['attributes']:_0x1d1408[_0x5a80('0x29')];_0x32b94e[_0x5a80('0x52')]=qs[_0x5a80('0x31')](_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x31')]);_0x32b94e[_0x5a80('0x32')]=qs['filters'](_[_0x5a80('0x33')](_0x1a7dfc[_0x5a80('0x2b')],_0x1d1408[_0x5a80('0x2c')]));if(_0x1a7dfc[_0x5a80('0x2b')]['filter']){_0x32b94e[_0x5a80('0x32')]=_[_0x5a80('0x35')](_0x32b94e['where'],{'$or':_[_0x5a80('0x26')](_0x32b94e[_0x5a80('0x2d')],function(_0x2a3484){var _0x4ca986={};_0x4ca986[_0x2a3484]={'$like':'%'+_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x34')]+'%'};return _0x4ca986;})});}_0x32b94e=_[_0x5a80('0x35')]({},_0x32b94e,_0x1a7dfc[_0x5a80('0x36')]);return _0x26214f['getBlackLists'](_0x32b94e);}})[_0x5a80('0x1f')](function(_0x1f1a33){if(_0x1f1a33){_0x1671dd=_0x1f1a33[_0x5a80('0x3e')];if(!_0x1a7dfc[_0x5a80('0x2b')][_0x5a80('0x51')](_0x5a80('0x2f'))){_0x32b94e['limit']=qs[_0x5a80('0x30')](_0x1a7dfc['query']['limit']);_0x32b94e[_0x5a80('0x18')]=qs[_0x5a80('0x18')](_0x1a7dfc['query'][_0x5a80('0x18')]);}return _0x26214f[_0x5a80('0x77')](_0x32b94e);}})[_0x5a80('0x1f')](function(_0x49ae87){if(_0x49ae87){return _0x49ae87?{'count':_0x1671dd,'rows':_0x49ae87}:null;}})['then'](respondWithResult(_0x45bdd7,null))['catch'](handleError(_0x45bdd7,null));};exports[_0x5a80('0x79')]=function(_0x1104a9,_0x5c0ad8,_0x2488f0){var _0x305171,_0x27473c;return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x1104a9[_0x5a80('0x3c')]['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x5c0ad8,null))['then'](function(_0x498190){if(_0x498190){_0x27473c=_0x498190;return _0x498190[_0x5a80('0x79')](_0x1104a9[_0x5a80('0x4c')][_0x5a80('0x5b')],_[_0x5a80('0x4a')](_0x1104a9[_0x5a80('0x4c')],['ids','id'])||{});}return null;})['spread'](function(_0x431e13){var _0x49de62;_0x305171=_0x431e13||[];var _0xe2a2e2=[];if(_0x431e13){for(var _0x3e6057=0x0;_0x3e6057<_0x431e13['length'];_0x3e6057+=0x1){var _0x54c330=_0x431e13[_0x3e6057][_0x5a80('0x21')]({'plain':!![]});_0x49de62=squel[_0x5a80('0x5f')]()[_0x5a80('0x60')](_0x5a80('0x7a'))[_0x5a80('0x72')]([_0x5a80('0x61'),'ContactId','ListId',_0x5a80('0x53'),_0x5a80('0x4b'),_0x5a80('0x4d')],squel[_0x5a80('0x64')]()['field']('phone',_0x5a80('0x61'))['field']('id',_0x5a80('0x63'))['field'](_0x54c330['CmListId'][_0x5a80('0x67')](),'ListId')[_0x5a80('0x69')](_0x1104a9[_0x5a80('0x3c')]['id'][_0x5a80('0x67')](),_0x5a80('0x53'))[_0x5a80('0x69')](_0x5a80('0x65'),_0x5a80('0x4b'))[_0x5a80('0x69')](_0x5a80('0x65'),'updatedAt')[_0x5a80('0x6a')](_0x5a80('0x6b'))['where']('deletedAt\x20IS\x20NULL')[_0x5a80('0x32')](_0x5a80('0x6d'),_0x54c330[_0x5a80('0x66')][_0x5a80('0x67')]())['where'](_0x5a80('0x73')))[_0x5a80('0x67')]();_0xe2a2e2[_0x5a80('0x74')](db[_0x5a80('0x75')][_0x5a80('0x2b')](_0x49de62));}return BPromise[_0x5a80('0x7b')](_0xe2a2e2);}})['then'](function(){return _0x305171;})[_0x5a80('0x1f')](respondWithResult(_0x5c0ad8,null))[_0x5a80('0x3b')](handleError(_0x5c0ad8,null));};exports['removeBlackLists']=function(_0x15f7cf,_0x3daf46,_0x28ccef){return db[_0x5a80('0x27')][_0x5a80('0x45')]({'where':{'id':_0x15f7cf['params']['id']}})[_0x5a80('0x1f')](handleEntityNotFound(_0x3daf46,null))[_0x5a80('0x1f')](function(_0x512a1e){if(_0x512a1e){return _0x512a1e[_0x5a80('0x7c')](_0x15f7cf['query'][_0x5a80('0x5b')]);}})[_0x5a80('0x1f')](function(_0x3b57be){if(_0x3b57be){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x15f7cf[_0x5a80('0x2b')][_0x5a80('0x5b')],'CampaignId':_0x15f7cf[_0x5a80('0x3c')]['id']}})['then'](function(){return _0x3b57be;});}})[_0x5a80('0x1f')](respondWithStatusCode(_0x3daf46,null))['catch'](handleError(_0x3daf46,null));}; \ No newline at end of file +var _0x66f2=['ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','error','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','type','merge','options','includeAll','include','Campaign','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','UserProfileResource','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','CmListId','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x66f2,0x114));var _0x266f=function(_0x312c87,_0x336076){_0x312c87=_0x312c87-0x0;var _0x3f4a1a=_0x66f2[_0x312c87];return _0x3f4a1a;};'use strict';var emlformat=require(_0x266f('0x0'));var rimraf=require(_0x266f('0x1'));var zipdir=require(_0x266f('0x2'));var jsonpatch=require(_0x266f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x266f('0x4'));var Mustache=require(_0x266f('0x5'));var util=require(_0x266f('0x6'));var path=require(_0x266f('0x7'));var sox=require(_0x266f('0x8'));var csv=require(_0x266f('0x9'));var ejs=require(_0x266f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x266f('0xb'));var squel=require(_0x266f('0xc'));var crypto=require(_0x266f('0xd'));var jsforce=require(_0x266f('0xe'));var deskjs=require(_0x266f('0xf'));var toCsv=require(_0x266f('0x9'));var querystring=require(_0x266f('0x10'));var Papa=require(_0x266f('0x11'));var Redis=require('ioredis');var authService=require(_0x266f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x266f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x266f('0x14'))(_0x266f('0x15'));var utils=require(_0x266f('0x16'));var config=require(_0x266f('0x17'));var licenseUtil=require(_0x266f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x343fd9,_0x1e0924){_0x1e0924=_0x1e0924||0xcc;return function(_0x56a4e5){if(_0x56a4e5){return _0x343fd9[_0x266f('0x19')](_0x1e0924);}return _0x343fd9[_0x266f('0x1a')](_0x1e0924)[_0x266f('0x1b')]();};}function respondWithResult(_0x5cec3f,_0xdb76c7){_0xdb76c7=_0xdb76c7||0xc8;return function(_0x383696){if(_0x383696){return _0x5cec3f[_0x266f('0x1a')](_0xdb76c7)[_0x266f('0x1c')](_0x383696);}};}function respondWithFilteredResult(_0x2278cc,_0x426807){return function(_0x560a05){if(_0x560a05){var _0x33e53c=typeof _0x426807[_0x266f('0x1d')]===_0x266f('0x1e')&&typeof _0x426807[_0x266f('0x1f')]===_0x266f('0x1e');var _0x41403f=_0x560a05['count'];var _0x3bc191=_0x33e53c?0x0:_0x426807[_0x266f('0x1d')];var _0xd84929=_0x33e53c?_0x560a05[_0x266f('0x20')]:_0x426807[_0x266f('0x1d')]+_0x426807[_0x266f('0x1f')];var _0x5ad85a;if(_0xd84929>=_0x41403f){_0xd84929=_0x41403f;_0x5ad85a=0xc8;}else{_0x5ad85a=0xce;}_0x2278cc[_0x266f('0x1a')](_0x5ad85a);return _0x2278cc['set'](_0x266f('0x21'),_0x3bc191+'-'+_0xd84929+'/'+_0x41403f)['json'](_0x560a05);}return null;};}function patchUpdates(_0x151986){return function(_0x2e8b43){try{jsonpatch[_0x266f('0x22')](_0x2e8b43,_0x151986,!![]);}catch(_0x3ff3aa){return BPromise['reject'](_0x3ff3aa);}return _0x2e8b43[_0x266f('0x23')]();};}function saveUpdates(_0x33037c,_0x1596cb){return function(_0x217dc5){if(_0x217dc5){return _0x217dc5[_0x266f('0x24')](_0x33037c)[_0x266f('0x25')](function(_0x4cf778){return _0x4cf778;});}return null;};}function removeEntity(_0x45ef00,_0x1ada9c){return function(_0x3096fc){if(_0x3096fc){return _0x3096fc[_0x266f('0x26')]()[_0x266f('0x25')](function(){var _0x6587db=_0x3096fc[_0x266f('0x27')]({'plain':!![]});var _0x120653='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x120653,'resourceId':_0x6587db['id']}})['then'](function(){return _0x3096fc;});})[_0x266f('0x25')](function(){_0x45ef00['status'](0xcc)[_0x266f('0x1b')]();});}};}function handleEntityNotFound(_0x2fa49a,_0x14ac01){return function(_0x3c4dd){if(!_0x3c4dd){_0x2fa49a[_0x266f('0x19')](0x194);}return _0x3c4dd;};}function handleError(_0x1fc017,_0x61ae2e){_0x61ae2e=_0x61ae2e||0x1f4;return function(_0x481a56){logger[_0x266f('0x28')](_0x481a56['stack']);if(_0x481a56[_0x266f('0x29')]){delete _0x481a56['name'];}_0x1fc017['status'](_0x61ae2e)['send'](_0x481a56);};}exports[_0x266f('0x2a')]=function(_0x5a6b85,_0x59ad48){var _0x23c6f0={},_0x1722c3={},_0x8c3b18={'count':0x0,'rows':[]};var _0x563f78=_[_0x266f('0x2b')](db['Campaign'][_0x266f('0x2c')],function(_0x4a40d0){return{'name':_0x4a40d0[_0x266f('0x2d')],'type':_0x4a40d0['type'][_0x266f('0x2e')]};});_0x1722c3[_0x266f('0x2f')]=_[_0x266f('0x2b')](_0x563f78,_0x266f('0x29'));_0x1722c3[_0x266f('0x30')]=_[_0x266f('0x31')](_0x5a6b85[_0x266f('0x30')]);_0x1722c3['filters']=_[_0x266f('0x32')](_0x1722c3[_0x266f('0x2f')],_0x1722c3['query']);_0x23c6f0['attributes']=_[_0x266f('0x32')](_0x1722c3['model'],qs[_0x266f('0x33')](_0x5a6b85[_0x266f('0x30')]['fields']));_0x23c6f0[_0x266f('0x34')]=_0x23c6f0[_0x266f('0x34')][_0x266f('0x35')]?_0x23c6f0[_0x266f('0x34')]:_0x1722c3[_0x266f('0x2f')];if(!_0x5a6b85[_0x266f('0x30')]['hasOwnProperty'](_0x266f('0x36'))){_0x23c6f0[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x5a6b85[_0x266f('0x30')][_0x266f('0x1f')]);_0x23c6f0['offset']=qs['offset'](_0x5a6b85[_0x266f('0x30')]['offset']);}_0x23c6f0[_0x266f('0x37')]=qs[_0x266f('0x38')](_0x5a6b85[_0x266f('0x30')][_0x266f('0x38')]);_0x23c6f0['where']=qs[_0x266f('0x39')](_['pick'](_0x5a6b85['query'],_0x1722c3['filters']),_0x563f78);if(_0x5a6b85[_0x266f('0x30')][_0x266f('0x3a')]){_0x23c6f0[_0x266f('0x3b')]=_['merge'](_0x23c6f0['where'],{'$or':_[_0x266f('0x2b')](_0x563f78,function(_0x4e5f82){if(_0x4e5f82[_0x266f('0x3c')]!=='VIRTUAL'){var _0xd155d9={};_0xd155d9[_0x4e5f82[_0x266f('0x29')]]={'$like':'%'+_0x5a6b85[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0xd155d9;}})});}_0x23c6f0=_[_0x266f('0x3d')]({},_0x23c6f0,_0x5a6b85[_0x266f('0x3e')]);var _0x5d74e4={'where':_0x23c6f0[_0x266f('0x3b')]};return db['Campaign'][_0x266f('0x20')](_0x5d74e4)['then'](function(_0x493cc9){_0x8c3b18[_0x266f('0x20')]=_0x493cc9;if(_0x5a6b85[_0x266f('0x30')][_0x266f('0x3f')]){_0x23c6f0[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x41')][_0x266f('0x42')](_0x23c6f0);})['then'](function(_0x355da8){_0x8c3b18[_0x266f('0x43')]=_0x355da8;return _0x8c3b18;})[_0x266f('0x25')](respondWithFilteredResult(_0x59ad48,_0x23c6f0))[_0x266f('0x44')](handleError(_0x59ad48,null));};exports[_0x266f('0x45')]=function(_0x344532,_0x26054a){var _0x64dee5={'raw':![],'where':{'id':_0x344532[_0x266f('0x46')]['id']}},_0x436a76={};_0x436a76[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x41')][_0x266f('0x2c')]);_0x436a76[_0x266f('0x30')]=_[_0x266f('0x31')](_0x344532['query']);_0x436a76[_0x266f('0x39')]=_['intersection'](_0x436a76[_0x266f('0x2f')],_0x436a76['query']);_0x64dee5[_0x266f('0x34')]=_[_0x266f('0x32')](_0x436a76[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x344532[_0x266f('0x30')][_0x266f('0x33')]));_0x64dee5[_0x266f('0x34')]=_0x64dee5['attributes'][_0x266f('0x35')]?_0x64dee5[_0x266f('0x34')]:_0x436a76['model'];if(_0x344532['query'][_0x266f('0x3f')]){_0x64dee5[_0x266f('0x40')]=[{'all':!![]}];}_0x64dee5=_[_0x266f('0x3d')]({},_0x64dee5,_0x344532[_0x266f('0x3e')]);return db[_0x266f('0x41')][_0x266f('0x47')](_0x64dee5)[_0x266f('0x25')](handleEntityNotFound(_0x26054a,null))[_0x266f('0x25')](respondWithResult(_0x26054a,null))[_0x266f('0x44')](handleError(_0x26054a,null));};exports[_0x266f('0x48')]=function(_0xb0c932,_0x3f9891){return db[_0x266f('0x41')][_0x266f('0x48')](_0xb0c932[_0x266f('0x49')],{})['then'](function(_0x140f52){var _0x2d1ff3=_0xb0c932[_0x266f('0x4a')][_0x266f('0x27')]({'plain':!![]});if(!_0x2d1ff3)throw new Error(_0x266f('0x4b'));if(_0x2d1ff3[_0x266f('0x4c')]==='user'){var _0x25361f=_0x140f52[_0x266f('0x27')]({'plain':!![]});var _0x13e6ae=_0x266f('0x4d');return db[_0x266f('0x4e')][_0x266f('0x47')]({'where':{'name':_0x13e6ae,'userProfileId':_0x2d1ff3['userProfileId']},'raw':!![]})['then'](function(_0x42b432){if(_0x42b432&&_0x42b432['autoAssociation']===0x0){return db[_0x266f('0x4f')][_0x266f('0x48')]({'name':_0x25361f['name'],'resourceId':_0x25361f['id'],'type':_0x42b432['name'],'sectionId':_0x42b432['id']},{})['then'](function(){return _0x140f52;});}else{return _0x140f52;}})['catch'](function(_0x3e3619){logger[_0x266f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e3619);throw _0x3e3619;});}return _0x140f52;})['then'](respondWithResult(_0x3f9891,0xc9))[_0x266f('0x44')](handleError(_0x3f9891,null));};exports['clone']=function(_0x36137d,_0x4c2200){var _0x28d208={'where':{'id':_0x36137d[_0x266f('0x46')]['id']}},_0x44a43e={};_0x44a43e[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x41')][_0x266f('0x2c')]);_0x28d208[_0x266f('0x34')]=_['intersection'](_0x44a43e['model'],qs['fields'](_0x36137d[_0x266f('0x30')][_0x266f('0x33')]));_0x28d208['attributes']=_0x28d208[_0x266f('0x34')][_0x266f('0x35')]?_0x28d208['attributes']:_0x44a43e[_0x266f('0x2f')];if(_0x36137d[_0x266f('0x30')][_0x266f('0x3f')]){_0x28d208[_0x266f('0x40')]=[{'all':!![]}];}_0x28d208=_['merge']({},_0x28d208,_0x36137d[_0x266f('0x3e')]);return db[_0x266f('0x41')][_0x266f('0x47')](_0x28d208)[_0x266f('0x25')](handleEntityNotFound(_0x4c2200,null))[_0x266f('0x25')](function(_0x13f711){if(_0x13f711){var _0x1438ef=_0x13f711[_0x266f('0x27')]({'plain':!![]});_0x1438ef=qs['omit'](_0x1438ef,['id','createdAt','updatedAt']);_0x36137d[_0x266f('0x49')]=_[_0x266f('0x50')](_0x36137d['body'],['id',_0x266f('0x51'),_0x266f('0x52')]);return db[_0x266f('0x41')][_0x266f('0x48')](_['merge'](_0x1438ef,_0x36137d[_0x266f('0x49')]),{'include':_0x36137d[_0x266f('0x30')][_0x266f('0x3f')]?[{'all':!![]}]:undefined})[_0x266f('0x25')](function(_0x2c313b){var _0x2e638d=_0x36137d[_0x266f('0x4a')][_0x266f('0x27')]({'plain':!![]});if(!_0x2e638d)throw new Error(_0x266f('0x4b'));if(_0x2e638d[_0x266f('0x4c')]===_0x266f('0x4a')){var _0x50dad4=_0x2c313b[_0x266f('0x27')]({'plain':!![]});var _0x200f2d=_0x266f('0x4d');return db[_0x266f('0x4e')][_0x266f('0x47')]({'where':{'name':_0x200f2d,'userProfileId':_0x2e638d[_0x266f('0x53')]},'raw':!![]})['then'](function(_0x5f5b0e){if(_0x5f5b0e&&_0x5f5b0e[_0x266f('0x54')]===0x0){return db[_0x266f('0x4f')][_0x266f('0x48')]({'name':_0x50dad4['name'],'resourceId':_0x50dad4['id'],'type':_0x5f5b0e[_0x266f('0x29')],'sectionId':_0x5f5b0e['id']},{})['then'](function(){return _0x2c313b;});}else{return _0x2c313b;}})[_0x266f('0x44')](function(_0x4a248b){logger[_0x266f('0x28')](_0x266f('0x55'),_0x4a248b);throw _0x4a248b;});}return _0x2c313b;});}})['then'](respondWithResult(_0x4c2200,0xc9))[_0x266f('0x44')](handleError(_0x4c2200,null));};exports['update']=function(_0x341117,_0x470fb0){if(_0x341117[_0x266f('0x49')]['id']){delete _0x341117[_0x266f('0x49')]['id'];}return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x341117['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x470fb0,null))[_0x266f('0x25')](saveUpdates(_0x341117[_0x266f('0x49')],null))[_0x266f('0x25')](respondWithResult(_0x470fb0,null))[_0x266f('0x44')](handleError(_0x470fb0,null));};exports['destroy']=function(_0x5ba15b,_0xcb86f0){return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x5ba15b[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0xcb86f0,null))[_0x266f('0x25')](removeEntity(_0xcb86f0,null))[_0x266f('0x44')](handleError(_0xcb86f0,null));};exports[_0x266f('0x56')]=function(_0xf0797d,_0x2ca1e2,_0x5b4490){var _0x30d1a2={'raw':!![],'where':{}};var _0x501fe1={};var _0xbe637b={'count':0x0,'rows':[]};return db[_0x266f('0x41')][_0x266f('0x57')]({'where':{'id':_0xf0797d[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x2ca1e2,null))[_0x266f('0x25')](function(_0x35ba98){if(_0x35ba98){_0x501fe1[_0x266f('0x2f')]=_['keys'](db[_0x266f('0x58')][_0x266f('0x2c')]);_0x501fe1[_0x266f('0x30')]=_[_0x266f('0x31')](_0xf0797d['query']);_0x501fe1[_0x266f('0x39')]=_[_0x266f('0x32')](_0x501fe1['model'],_0x501fe1[_0x266f('0x30')]);_0x30d1a2[_0x266f('0x34')]=_[_0x266f('0x32')](_0x501fe1[_0x266f('0x2f')],qs[_0x266f('0x33')](_0xf0797d[_0x266f('0x30')][_0x266f('0x33')]));_0x30d1a2[_0x266f('0x34')]=_0x30d1a2[_0x266f('0x34')][_0x266f('0x35')]?_0x30d1a2[_0x266f('0x34')]:_0x501fe1[_0x266f('0x2f')];if(!_0xf0797d['query']['hasOwnProperty'](_0x266f('0x36'))){_0x30d1a2[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0xf0797d[_0x266f('0x30')][_0x266f('0x1f')]);_0x30d1a2[_0x266f('0x1d')]=qs[_0x266f('0x1d')](_0xf0797d[_0x266f('0x30')][_0x266f('0x1d')]);}_0x30d1a2[_0x266f('0x37')]=qs['sort'](_0xf0797d['query'][_0x266f('0x38')]);_0x30d1a2[_0x266f('0x3b')]=qs[_0x266f('0x39')](_[_0x266f('0x59')](_0xf0797d['query'],_0x501fe1[_0x266f('0x39')]));_0x30d1a2[_0x266f('0x3b')][_0x266f('0x5a')]=_0x35ba98['id'];if(_0xf0797d['query'][_0x266f('0x3a')]){_0x30d1a2[_0x266f('0x3b')]=_['merge'](_0x30d1a2[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x30d1a2[_0x266f('0x34')],function(_0x51b045){var _0x10aa89={};_0x10aa89[_0x51b045]={'$like':'%'+_0xf0797d[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0x10aa89;})});}_0x30d1a2=_['merge']({},_0x30d1a2,_0xf0797d[_0x266f('0x3e')]);return db[_0x266f('0x58')]['count']({'where':_0x30d1a2[_0x266f('0x3b')]})['then'](function(_0x103f4f){_0xbe637b[_0x266f('0x20')]=_0x103f4f;if(_0xf0797d[_0x266f('0x30')][_0x266f('0x3f')]){_0x30d1a2['include']=[{'all':!![]}];}return db[_0x266f('0x58')]['findAll'](_0x30d1a2);})['then'](function(_0x556018){_0xbe637b['rows']=_0x556018;return _0xbe637b;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x2ca1e2,_0x30d1a2))[_0x266f('0x44')](handleError(_0x2ca1e2,null));};exports[_0x266f('0x5b')]=function(_0x36a525,_0x55e4ef,_0xc1a06a){var _0x362a68={'raw':!![],'where':{}};var _0xf0a1ec={};var _0x69369c={'count':0x0,'rows':[]};return db['Campaign'][_0x266f('0x57')]({'where':{'id':_0x36a525[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x55e4ef,null))[_0x266f('0x25')](function(_0x41f7ba){if(_0x41f7ba){_0xf0a1ec[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x5c')][_0x266f('0x2c')]);_0xf0a1ec[_0x266f('0x30')]=_[_0x266f('0x31')](_0x36a525['query']);_0xf0a1ec[_0x266f('0x39')]=_[_0x266f('0x32')](_0xf0a1ec[_0x266f('0x2f')],_0xf0a1ec[_0x266f('0x30')]);_0x362a68[_0x266f('0x34')]=_['intersection'](_0xf0a1ec[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x36a525[_0x266f('0x30')]['fields']));_0x362a68[_0x266f('0x34')]=_0x362a68['attributes'][_0x266f('0x35')]?_0x362a68[_0x266f('0x34')]:_0xf0a1ec['model'];if(!_0x36a525[_0x266f('0x30')]['hasOwnProperty']('nolimit')){_0x362a68[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x36a525[_0x266f('0x30')][_0x266f('0x1f')]);_0x362a68[_0x266f('0x1d')]=qs[_0x266f('0x1d')](_0x36a525[_0x266f('0x30')]['offset']);}_0x362a68[_0x266f('0x37')]=qs[_0x266f('0x38')](_0x36a525[_0x266f('0x30')]['sort']);_0x362a68['where']=qs[_0x266f('0x39')](_[_0x266f('0x59')](_0x36a525[_0x266f('0x30')],_0xf0a1ec[_0x266f('0x39')]));_0x362a68[_0x266f('0x3b')][_0x266f('0x5a')]=_0x41f7ba['id'];if(_0x36a525['query'][_0x266f('0x3a')]){_0x362a68[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x362a68[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x362a68[_0x266f('0x34')],function(_0x51a3da){var _0x5840bd={};_0x5840bd[_0x51a3da]={'$like':'%'+_0x36a525[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0x5840bd;})});}_0x362a68=_[_0x266f('0x3d')]({},_0x362a68,_0x36a525['options']);return db[_0x266f('0x5c')][_0x266f('0x20')]({'where':_0x362a68['where']})[_0x266f('0x25')](function(_0x2ae432){_0x69369c[_0x266f('0x20')]=_0x2ae432;if(_0x36a525['query'][_0x266f('0x3f')]){_0x362a68[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x5c')][_0x266f('0x42')](_0x362a68);})[_0x266f('0x25')](function(_0x3ab523){_0x69369c[_0x266f('0x43')]=_0x3ab523;return _0x69369c;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x55e4ef,_0x362a68))['catch'](handleError(_0x55e4ef,null));};exports['getHopperFinals']=function(_0x3d4909,_0x5540e6,_0x3de294){var _0x253a0e={'raw':!![],'where':{}};var _0x34d3f0={};var _0x1ae515={'count':0x0,'rows':[]};return db[_0x266f('0x41')]['findOne']({'where':{'id':_0x3d4909[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x5540e6,null))['then'](function(_0x4c371d){if(_0x4c371d){_0x34d3f0[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x5d')][_0x266f('0x2c')]);_0x34d3f0[_0x266f('0x30')]=_[_0x266f('0x31')](_0x3d4909[_0x266f('0x30')]);_0x34d3f0[_0x266f('0x39')]=_[_0x266f('0x32')](_0x34d3f0[_0x266f('0x2f')],_0x34d3f0[_0x266f('0x30')]);_0x253a0e[_0x266f('0x34')]=_['intersection'](_0x34d3f0[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x3d4909['query'][_0x266f('0x33')]));_0x253a0e[_0x266f('0x34')]=_0x253a0e[_0x266f('0x34')][_0x266f('0x35')]?_0x253a0e[_0x266f('0x34')]:_0x34d3f0['model'];if(!_0x3d4909[_0x266f('0x30')][_0x266f('0x5e')](_0x266f('0x36'))){_0x253a0e[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x3d4909[_0x266f('0x30')][_0x266f('0x1f')]);_0x253a0e[_0x266f('0x1d')]=qs['offset'](_0x3d4909['query'][_0x266f('0x1d')]);}_0x253a0e[_0x266f('0x37')]=qs[_0x266f('0x38')](_0x3d4909[_0x266f('0x30')][_0x266f('0x38')]);_0x253a0e[_0x266f('0x3b')]=qs[_0x266f('0x39')](_['pick'](_0x3d4909['query'],_0x34d3f0[_0x266f('0x39')]));_0x253a0e[_0x266f('0x3b')]['CampaignId']=_0x4c371d['id'];if(_0x3d4909['query'][_0x266f('0x3a')]){_0x253a0e[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x253a0e[_0x266f('0x3b')],{'$or':_['map'](_0x253a0e[_0x266f('0x34')],function(_0x72ba2b){var _0x3f5f09={};_0x3f5f09[_0x72ba2b]={'$like':'%'+_0x3d4909[_0x266f('0x30')]['filter']+'%'};return _0x3f5f09;})});}_0x253a0e=_[_0x266f('0x3d')]({},_0x253a0e,_0x3d4909[_0x266f('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x253a0e[_0x266f('0x3b')]})[_0x266f('0x25')](function(_0x5507f4){_0x1ae515[_0x266f('0x20')]=_0x5507f4;if(_0x3d4909[_0x266f('0x30')][_0x266f('0x3f')]){_0x253a0e[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x5d')]['findAll'](_0x253a0e);})[_0x266f('0x25')](function(_0x37b74b){_0x1ae515[_0x266f('0x43')]=_0x37b74b;return _0x1ae515;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x5540e6,_0x253a0e))[_0x266f('0x44')](handleError(_0x5540e6,null));};exports[_0x266f('0x5f')]=function(_0x4013a2,_0x234910,_0x4da820){var _0x4a3fb8={'raw':!![],'where':{}};var _0x289ec1={};var _0x39545f={'count':0x0,'rows':[]};return db['Campaign'][_0x266f('0x57')]({'where':{'id':_0x4013a2['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x234910,null))['then'](function(_0x3d5bc6){if(_0x3d5bc6){_0x289ec1['model']=_[_0x266f('0x31')](db[_0x266f('0x60')][_0x266f('0x2c')]);_0x289ec1['query']=_[_0x266f('0x31')](_0x4013a2[_0x266f('0x30')]);_0x289ec1[_0x266f('0x39')]=_[_0x266f('0x32')](_0x289ec1[_0x266f('0x2f')],_0x289ec1[_0x266f('0x30')]);_0x4a3fb8[_0x266f('0x34')]=_[_0x266f('0x32')](_0x289ec1['model'],qs[_0x266f('0x33')](_0x4013a2[_0x266f('0x30')][_0x266f('0x33')]));_0x4a3fb8[_0x266f('0x34')]=_0x4a3fb8['attributes'][_0x266f('0x35')]?_0x4a3fb8['attributes']:_0x289ec1[_0x266f('0x2f')];if(!_0x4013a2[_0x266f('0x30')]['hasOwnProperty'](_0x266f('0x36'))){_0x4a3fb8[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x4013a2['query'][_0x266f('0x1f')]);_0x4a3fb8[_0x266f('0x1d')]=qs['offset'](_0x4013a2['query'][_0x266f('0x1d')]);}_0x4a3fb8[_0x266f('0x37')]=qs['sort'](_0x4013a2[_0x266f('0x30')][_0x266f('0x38')]);_0x4a3fb8[_0x266f('0x3b')]=qs['filters'](_[_0x266f('0x59')](_0x4013a2['query'],_0x289ec1['filters']));_0x4a3fb8[_0x266f('0x3b')]['CampaignId']=_0x3d5bc6['id'];if(_0x4013a2[_0x266f('0x30')]['filter']){_0x4a3fb8[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x4a3fb8[_0x266f('0x3b')],{'$or':_['map'](_0x4a3fb8[_0x266f('0x34')],function(_0x4a9d62){var _0x3f077f={};_0x3f077f[_0x4a9d62]={'$like':'%'+_0x4013a2[_0x266f('0x30')]['filter']+'%'};return _0x3f077f;})});}_0x4a3fb8=_[_0x266f('0x3d')]({},_0x4a3fb8,_0x4013a2['options']);return db['CmHopperBlack']['count']({'where':_0x4a3fb8[_0x266f('0x3b')]})['then'](function(_0x14bb30){_0x39545f[_0x266f('0x20')]=_0x14bb30;if(_0x4013a2[_0x266f('0x30')]['includeAll']){_0x4a3fb8[_0x266f('0x40')]=[{'all':!![]}];}return db[_0x266f('0x60')][_0x266f('0x42')](_0x4a3fb8);})[_0x266f('0x25')](function(_0xa290eb){_0x39545f[_0x266f('0x43')]=_0xa290eb;return _0x39545f;});}})[_0x266f('0x25')](respondWithFilteredResult(_0x234910,_0x4a3fb8))['catch'](handleError(_0x234910,null));};exports[_0x266f('0x61')]=function(_0x506be9,_0x9d2448,_0x18a9e5){var _0x45974f={};var _0x4b5db8={};var _0x31953b;var _0x348491;return db['Campaign'][_0x266f('0x57')]({'where':{'id':_0x506be9[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x9d2448,null))[_0x266f('0x25')](function(_0x4cd025){if(_0x4cd025){_0x31953b=_0x4cd025;_0x4b5db8[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x62')][_0x266f('0x2c')]);_0x4b5db8[_0x266f('0x30')]=_[_0x266f('0x31')](_0x506be9[_0x266f('0x30')]);_0x4b5db8[_0x266f('0x39')]=_[_0x266f('0x32')](_0x4b5db8['model'],_0x4b5db8[_0x266f('0x30')]);_0x45974f['attributes']=_[_0x266f('0x32')](_0x4b5db8[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x506be9[_0x266f('0x30')]['fields']));_0x45974f['attributes']=_0x45974f[_0x266f('0x34')][_0x266f('0x35')]?_0x45974f[_0x266f('0x34')]:_0x4b5db8['model'];_0x45974f[_0x266f('0x37')]=qs['sort'](_0x506be9[_0x266f('0x30')]['sort']);_0x45974f[_0x266f('0x3b')]=qs[_0x266f('0x39')](_[_0x266f('0x59')](_0x506be9[_0x266f('0x30')],_0x4b5db8[_0x266f('0x39')]));if(_0x506be9[_0x266f('0x30')][_0x266f('0x3a')]){_0x45974f[_0x266f('0x3b')]=_[_0x266f('0x3d')](_0x45974f[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x45974f[_0x266f('0x34')],function(_0xce5864){var _0x224c80={};_0x224c80[_0xce5864]={'$like':'%'+_0x506be9[_0x266f('0x30')][_0x266f('0x3a')]+'%'};return _0x224c80;})});}_0x45974f=_['merge']({},_0x45974f,_0x506be9[_0x266f('0x3e')]);return _0x31953b['getLists'](_0x45974f);}})[_0x266f('0x25')](function(_0x47d187){if(_0x47d187){_0x348491=_0x47d187[_0x266f('0x35')];if(!_0x506be9['query'][_0x266f('0x5e')](_0x266f('0x36'))){_0x45974f[_0x266f('0x1f')]=qs['limit'](_0x506be9[_0x266f('0x30')][_0x266f('0x1f')]);_0x45974f['offset']=qs[_0x266f('0x1d')](_0x506be9[_0x266f('0x30')][_0x266f('0x1d')]);}return _0x31953b[_0x266f('0x61')](_0x45974f);}})[_0x266f('0x25')](function(_0x2e9cd1){if(_0x2e9cd1){return _0x2e9cd1?{'count':_0x348491,'rows':_0x2e9cd1}:null;}})['then'](respondWithResult(_0x9d2448,null))[_0x266f('0x44')](handleError(_0x9d2448,null));};exports[_0x266f('0x63')]=function(_0x544deb,_0x24401a,_0x4f751d){var _0x4c16e3,_0x34af68;return db['Campaign'][_0x266f('0x47')]({'where':{'id':_0x544deb[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x24401a,null))[_0x266f('0x25')](function(_0x384637){if(_0x384637){_0x34af68=_0x384637;return _0x384637['addLists'](_0x544deb[_0x266f('0x49')][_0x266f('0x64')],_['omit'](_0x544deb[_0x266f('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0x3d5b23){var _0x19b9fc;_0x4c16e3=_0x3d5b23||[];var _0x1452dc=[];if(_0x3d5b23){for(var _0x2cda69=0x0;_0x2cda69<_0x3d5b23[_0x266f('0x35')];_0x2cda69+=0x1){var _0x5c88ec=_0x3d5b23[_0x2cda69]['get']({'plain':!![]});_0x34af68[_0x266f('0x65')]=_0x544deb[_0x266f('0x49')][_0x266f('0x65')]?_0x544deb[_0x266f('0x49')][_0x266f('0x65')]:_0x34af68['dialCheckDuplicateType'];switch(_0x34af68['dialCheckDuplicateType']){case'always':_0x19b9fc=squel[_0x266f('0x66')]()[_0x266f('0x67')](_0x266f('0x68'))[_0x266f('0x69')](['phone',_0x266f('0x6a'),_0x266f('0x6b'),_0x266f('0x6c'),_0x266f('0x5a'),_0x266f('0x51'),_0x266f('0x52')],squel[_0x266f('0x6d')]()[_0x266f('0x6e')](_0x266f('0x6f'),_0x266f('0x6f'))[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x6a'))[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x5c88ec['CmListId'][_0x266f('0x71')](),'ListId')[_0x266f('0x6e')](_0x544deb['params']['id'][_0x266f('0x71')](),_0x266f('0x5a'))[_0x266f('0x6e')](_0x266f('0x70'),'createdAt')[_0x266f('0x6e')]('NOW()','updatedAt')[_0x266f('0x72')]('cm_contacts')[_0x266f('0x3b')]('deletedAt\x20IS\x20NULL')[_0x266f('0x3b')]('ListId\x20=\x20?',_0x5c88ec['CmListId'][_0x266f('0x71')]())[_0x266f('0x3b')](_0x266f('0x73'))[_0x266f('0x3b')](_0x266f('0x74'),squel[_0x266f('0x6d')]()[_0x266f('0x6e')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0x266f('0x3b')](_0x266f('0x75'),_0x544deb[_0x266f('0x46')]['id'][_0x266f('0x71')]()))['where'](_0x266f('0x74'),squel[_0x266f('0x6d')]()['field'](_0x266f('0x76'))[_0x266f('0x72')](_0x266f('0x68'))[_0x266f('0x3b')](_0x266f('0x75'),_0x544deb[_0x266f('0x46')]['id']['toString']())))[_0x266f('0x71')]();break;case _0x266f('0x77'):_0x19b9fc=squel[_0x266f('0x66')]()[_0x266f('0x67')]('cm_hopper')[_0x266f('0x69')]([_0x266f('0x6f'),'scheduledAt',_0x266f('0x6b'),_0x266f('0x6c'),'CampaignId',_0x266f('0x51'),_0x266f('0x52')],squel[_0x266f('0x6d')]()[_0x266f('0x6e')](_0x266f('0x6f'),'phone')[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x6a'))[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x5c88ec[_0x266f('0x78')][_0x266f('0x71')](),_0x266f('0x6c'))[_0x266f('0x6e')](_0x544deb['params']['id'][_0x266f('0x71')](),'CampaignId')[_0x266f('0x6e')]('NOW()','createdAt')[_0x266f('0x6e')]('NOW()','updatedAt')[_0x266f('0x72')](_0x266f('0x79'))[_0x266f('0x3b')](_0x266f('0x7a'))[_0x266f('0x3b')](_0x266f('0x7b'),_0x5c88ec[_0x266f('0x78')][_0x266f('0x71')]())[_0x266f('0x3b')](_0x266f('0x73'))[_0x266f('0x3b')](_0x266f('0x74'),squel[_0x266f('0x6d')]()[_0x266f('0x6e')]('COALESCE(phone,\x27\x27)')[_0x266f('0x72')](_0x266f('0x68'))[_0x266f('0x3b')]('CampaignId\x20=\x20?',_0x544deb[_0x266f('0x46')]['id'][_0x266f('0x71')]())))['toString']();break;default:_0x19b9fc=squel[_0x266f('0x66')]()[_0x266f('0x67')](_0x266f('0x68'))[_0x266f('0x69')]([_0x266f('0x6f'),_0x266f('0x6a'),_0x266f('0x6b'),_0x266f('0x6c'),_0x266f('0x5a'),_0x266f('0x51'),_0x266f('0x52')],squel[_0x266f('0x6d')]()[_0x266f('0x6e')](_0x266f('0x6f'),'phone')[_0x266f('0x6e')]('NOW()','scheduledAt')[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x5c88ec[_0x266f('0x78')]['toString'](),'ListId')[_0x266f('0x6e')](_0x544deb[_0x266f('0x46')]['id'][_0x266f('0x71')](),_0x266f('0x5a'))[_0x266f('0x6e')](_0x266f('0x70'),'createdAt')[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x52'))['from'](_0x266f('0x79'))[_0x266f('0x3b')]('deletedAt\x20IS\x20NULL')[_0x266f('0x3b')]('ListId\x20=\x20?',_0x5c88ec['CmListId']['toString']())[_0x266f('0x3b')](_0x266f('0x73')))[_0x266f('0x71')]();}_0x1452dc[_0x266f('0x7c')](db[_0x266f('0x7d')][_0x266f('0x30')](_0x19b9fc));}return BPromise[_0x266f('0x7e')](_0x1452dc);}})[_0x266f('0x25')](function(){return _0x4c16e3;})[_0x266f('0x25')](respondWithResult(_0x24401a,null))[_0x266f('0x44')](handleError(_0x24401a,null));};exports[_0x266f('0x7f')]=function(_0x725d90,_0xbe07b5,_0x555c58){return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x725d90['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0xbe07b5,null))[_0x266f('0x25')](function(_0x577819){if(_0x577819){return _0x577819[_0x266f('0x7f')](_0x725d90['query']['ids']);}})['then'](function(_0x2faf79){if(_0x2faf79){return db['CmHopper']['destroy']({'where':{'ListId':_0x725d90[_0x266f('0x30')][_0x266f('0x64')],'CampaignId':_0x725d90[_0x266f('0x46')]['id']}})[_0x266f('0x25')](function(){return _0x2faf79;});}})['then'](respondWithStatusCode(_0xbe07b5,null))[_0x266f('0x44')](handleError(_0xbe07b5,null));};exports['getBlackLists']=function(_0x325581,_0x479e15,_0x142f15){var _0x34a647={};var _0x470b9a={};var _0x3f4166;var _0xfada08;return db[_0x266f('0x41')][_0x266f('0x57')]({'where':{'id':_0x325581['params']['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x479e15,null))['then'](function(_0x2db14d){if(_0x2db14d){_0x3f4166=_0x2db14d;_0x470b9a[_0x266f('0x2f')]=_[_0x266f('0x31')](db[_0x266f('0x62')][_0x266f('0x2c')]);_0x470b9a[_0x266f('0x30')]=_['keys'](_0x325581[_0x266f('0x30')]);_0x470b9a['filters']=_['intersection'](_0x470b9a[_0x266f('0x2f')],_0x470b9a[_0x266f('0x30')]);_0x34a647[_0x266f('0x34')]=_['intersection'](_0x470b9a[_0x266f('0x2f')],qs[_0x266f('0x33')](_0x325581['query'][_0x266f('0x33')]));_0x34a647[_0x266f('0x34')]=_0x34a647['attributes'][_0x266f('0x35')]?_0x34a647['attributes']:_0x470b9a[_0x266f('0x2f')];_0x34a647['order']=qs[_0x266f('0x38')](_0x325581[_0x266f('0x30')][_0x266f('0x38')]);_0x34a647[_0x266f('0x3b')]=qs['filters'](_[_0x266f('0x59')](_0x325581[_0x266f('0x30')],_0x470b9a['filters']));if(_0x325581[_0x266f('0x30')][_0x266f('0x3a')]){_0x34a647['where']=_[_0x266f('0x3d')](_0x34a647[_0x266f('0x3b')],{'$or':_[_0x266f('0x2b')](_0x34a647[_0x266f('0x34')],function(_0x2af026){var _0x43a338={};_0x43a338[_0x2af026]={'$like':'%'+_0x325581['query'][_0x266f('0x3a')]+'%'};return _0x43a338;})});}_0x34a647=_['merge']({},_0x34a647,_0x325581[_0x266f('0x3e')]);return _0x3f4166[_0x266f('0x80')](_0x34a647);}})['then'](function(_0x4c79b0){if(_0x4c79b0){_0xfada08=_0x4c79b0[_0x266f('0x35')];if(!_0x325581[_0x266f('0x30')]['hasOwnProperty']('nolimit')){_0x34a647[_0x266f('0x1f')]=qs[_0x266f('0x1f')](_0x325581[_0x266f('0x30')][_0x266f('0x1f')]);_0x34a647[_0x266f('0x1d')]=qs[_0x266f('0x1d')](_0x325581['query'][_0x266f('0x1d')]);}return _0x3f4166[_0x266f('0x80')](_0x34a647);}})[_0x266f('0x25')](function(_0x21fae0){if(_0x21fae0){return _0x21fae0?{'count':_0xfada08,'rows':_0x21fae0}:null;}})[_0x266f('0x25')](respondWithResult(_0x479e15,null))[_0x266f('0x44')](handleError(_0x479e15,null));};exports[_0x266f('0x81')]=function(_0x20c26a,_0x319589,_0x4304e8){var _0x3762a0,_0x2acfe1;return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x20c26a[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x319589,null))[_0x266f('0x25')](function(_0x354a3b){if(_0x354a3b){_0x2acfe1=_0x354a3b;return _0x354a3b['addBlackLists'](_0x20c26a[_0x266f('0x49')][_0x266f('0x64')],_[_0x266f('0x50')](_0x20c26a[_0x266f('0x49')],['ids','id'])||{});}return null;})[_0x266f('0x82')](function(_0x126a7a){var _0x1fc4cd;_0x3762a0=_0x126a7a||[];var _0x3d8391=[];if(_0x126a7a){for(var _0x6b30ba=0x0;_0x6b30ba<_0x126a7a['length'];_0x6b30ba+=0x1){var _0x54a7b0=_0x126a7a[_0x6b30ba][_0x266f('0x27')]({'plain':!![]});_0x1fc4cd=squel[_0x266f('0x66')]()[_0x266f('0x67')](_0x266f('0x83'))['fromQuery']([_0x266f('0x6f'),_0x266f('0x6b'),_0x266f('0x6c'),_0x266f('0x5a'),_0x266f('0x51'),'updatedAt'],squel['select']()['field'](_0x266f('0x6f'),_0x266f('0x6f'))[_0x266f('0x6e')]('id',_0x266f('0x6b'))['field'](_0x54a7b0['CmListId']['toString'](),_0x266f('0x6c'))[_0x266f('0x6e')](_0x20c26a[_0x266f('0x46')]['id'][_0x266f('0x71')](),'CampaignId')[_0x266f('0x6e')](_0x266f('0x70'),_0x266f('0x51'))[_0x266f('0x6e')]('NOW()',_0x266f('0x52'))[_0x266f('0x72')](_0x266f('0x79'))[_0x266f('0x3b')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x54a7b0['CmListId'][_0x266f('0x71')]())[_0x266f('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x266f('0x71')]();_0x3d8391['push'](db[_0x266f('0x7d')][_0x266f('0x30')](_0x1fc4cd));}return BPromise[_0x266f('0x7e')](_0x3d8391);}})[_0x266f('0x25')](function(){return _0x3762a0;})[_0x266f('0x25')](respondWithResult(_0x319589,null))['catch'](handleError(_0x319589,null));};exports[_0x266f('0x84')]=function(_0x37c6ab,_0x7563d5,_0x5254a4){return db[_0x266f('0x41')][_0x266f('0x47')]({'where':{'id':_0x37c6ab[_0x266f('0x46')]['id']}})[_0x266f('0x25')](handleEntityNotFound(_0x7563d5,null))[_0x266f('0x25')](function(_0x805bd5){if(_0x805bd5){return _0x805bd5[_0x266f('0x84')](_0x37c6ab[_0x266f('0x30')]['ids']);}})['then'](function(_0xe99ec){if(_0xe99ec){return db[_0x266f('0x60')][_0x266f('0x26')]({'where':{'ListId':_0x37c6ab[_0x266f('0x30')][_0x266f('0x64')],'CampaignId':_0x37c6ab[_0x266f('0x46')]['id']}})[_0x266f('0x25')](function(){return _0xe99ec;});}})['then'](respondWithStatusCode(_0x7563d5,null))[_0x266f('0x44')](handleError(_0x7563d5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2c8fe20..35bbf5d 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 d9fffeb..5e32877 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 _0x8e94=['error','code','message','info','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','model','debug','lodash','util','bluebird','ioredis','../../config/utils','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xc2ec9,_0x53a1e4){var _0x5333ec=function(_0x4ae2de){while(--_0x4ae2de){_0xc2ec9['push'](_0xc2ec9['shift']());}};_0x5333ec(++_0x53a1e4);}(_0x8e94,0xf8));var _0x48e9=function(_0x446e61,_0x27e680){_0x446e61=_0x446e61-0x0;var _0x4160a8=_0x8e94[_0x446e61];return _0x4160a8;};'use strict';var _=require(_0x48e9('0x0'));var util=require(_0x48e9('0x1'));var moment=require('moment');var BPromise=require(_0x48e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x48e9('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x48e9('0x5'));var client=jayson[_0x48e9('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ac9d7,_0x58332f,_0x409f7b){return new BPromise(function(_0x50124c,_0x2e3df6){return client[_0x48e9('0x7')](_0x3ac9d7,_0x409f7b)[_0x48e9('0x8')](function(_0x371e53){logger['info'](_0x48e9('0x9'),_0x58332f,_0x48e9('0xa'));logger['debug'](_0x48e9('0xb'),_0x58332f,'request\x20sent',JSON[_0x48e9('0xc')](_0x371e53));if(_0x371e53[_0x48e9('0xd')]){if(_0x371e53[_0x48e9('0xd')][_0x48e9('0xe')]===0x1f4){logger[_0x48e9('0xd')](_0x48e9('0x9'),_0x58332f,_0x371e53['error'][_0x48e9('0xf')]);return _0x2e3df6(_0x371e53[_0x48e9('0xd')][_0x48e9('0xf')]);}logger['error'](_0x48e9('0x9'),_0x58332f,_0x371e53[_0x48e9('0xd')][_0x48e9('0xf')]);return _0x50124c(_0x371e53[_0x48e9('0xd')][_0x48e9('0xf')]);}else{logger[_0x48e9('0x10')](_0x48e9('0x9'),_0x58332f,_0x48e9('0xa'));_0x50124c(_0x371e53[_0x48e9('0x11')][_0x48e9('0xf')]);}})[_0x48e9('0x12')](function(_0x18135a){logger[_0x48e9('0xd')]('Campaign,\x20%s,\x20%s',_0x58332f,_0x18135a);_0x2e3df6(_0x18135a);});});}exports[_0x48e9('0x13')]=function(_0x421508){var _0x2c0c31=this;return new Promise(function(_0x51ab2d,_0xdb0db){return db[_0x48e9('0x14')][_0x48e9('0x15')]({'raw':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')][_0x48e9('0x17')]===undefined?!![]:![]:!![],'where':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')]['where']||null:null,'attributes':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')][_0x48e9('0x18')]||null:null,'limit':_0x421508['options']?_0x421508['options'][_0x48e9('0x19')]||null:null,'include':_0x421508[_0x48e9('0x16')]?_0x421508[_0x48e9('0x16')][_0x48e9('0x1a')]?_['map'](_0x421508[_0x48e9('0x16')][_0x48e9('0x1a')],function(_0x56f782){return{'model':db[_0x56f782[_0x48e9('0x1b')]],'as':_0x56f782['as'],'attributes':_0x56f782[_0x48e9('0x18')],'include':_0x56f782[_0x48e9('0x1a')]?_['map'](_0x56f782[_0x48e9('0x1a')],function(_0x361bff){return{'model':db[_0x361bff['model']],'as':_0x361bff['as'],'attributes':_0x361bff['attributes'],'include':_0x361bff['include']?_['map'](_0x361bff[_0x48e9('0x1a')],function(_0x1ac2e8){return{'model':db[_0x1ac2e8['model']],'as':_0x1ac2e8['as'],'attributes':_0x1ac2e8[_0x48e9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x48e9('0x8')](function(_0x4aa5f7){logger[_0x48e9('0x10')](_0x48e9('0x13'),_0x421508);logger[_0x48e9('0x1c')](_0x48e9('0x13'),_0x421508,JSON[_0x48e9('0xc')](_0x4aa5f7));_0x51ab2d(_0x4aa5f7);})['catch'](function(_0x64c551){logger[_0x48e9('0xd')]('GetCampaign',_0x64c551[_0x48e9('0xf')],_0x421508);_0xdb0db(_0x2c0c31[_0x48e9('0xd')](0x1f4,_0x64c551[_0x48e9('0xf')]));});});}; \ No newline at end of file +var _0x3b75=['error','code','message','result','catch','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','GetCampaign','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f89b6,_0x287e50){var _0x480a76=function(_0x1df41b){while(--_0x1df41b){_0x2f89b6['push'](_0x2f89b6['shift']());}};_0x480a76(++_0x287e50);}(_0x3b75,0xdc));var _0x53b7=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x3b75[_0x1abeb2];return _0x48da20;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});}exports['GetCampaign']=function(_0x4eaf6a){var _0x19b100=this;return new Promise(function(_0x45b608,_0x3a049f){return db[_0x53b7('0x17')][_0x53b7('0x18')]({'raw':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1a')]===undefined?!![]:![]:!![],'where':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a['options'][_0x53b7('0x1b')]||null:null,'attributes':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1c')]||null:null,'limit':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1d')]||null:null,'include':_0x4eaf6a[_0x53b7('0x19')]?_0x4eaf6a[_0x53b7('0x19')][_0x53b7('0x1e')]?_[_0x53b7('0x1f')](_0x4eaf6a[_0x53b7('0x19')]['include'],function(_0x41706f){return{'model':db[_0x41706f['model']],'as':_0x41706f['as'],'attributes':_0x41706f[_0x53b7('0x1c')],'include':_0x41706f[_0x53b7('0x1e')]?_['map'](_0x41706f['include'],function(_0x9f699d){return{'model':db[_0x9f699d[_0x53b7('0x20')]],'as':_0x9f699d['as'],'attributes':_0x9f699d[_0x53b7('0x1c')],'include':_0x9f699d[_0x53b7('0x1e')]?_['map'](_0x9f699d[_0x53b7('0x1e')],function(_0x465d87){return{'model':db[_0x465d87[_0x53b7('0x20')]],'as':_0x465d87['as'],'attributes':_0x465d87[_0x53b7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x53b7('0xb')](function(_0x39d382){logger['info'](_0x53b7('0x21'),_0x4eaf6a);logger[_0x53b7('0xf')](_0x53b7('0x21'),_0x4eaf6a,JSON[_0x53b7('0x11')](_0x39d382));_0x45b608(_0x39d382);})[_0x53b7('0x16')](function(_0x1024b5){logger[_0x53b7('0x12')](_0x53b7('0x21'),_0x1024b5[_0x53b7('0x14')],_0x4eaf6a);_0x3a049f(_0x19b100[_0x53b7('0x12')](0x1f4,_0x1024b5[_0x53b7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 3aca48b..6fdd47f 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 _0xd3c6=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','clone','addLists','addBlackLists','delete'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0xd3c6,0x121));var _0x6d3c=function(_0x5051f8,_0x12eefd){_0x5051f8=_0x5051f8-0x0;var _0x78413c=_0xd3c6[_0x5051f8];return _0x78413c;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require(_0x6d3c('0x1'));var path=require(_0x6d3c('0x2'));var timeout=require(_0x6d3c('0x3'));var express=require(_0x6d3c('0x4'));var router=express[_0x6d3c('0x5')]();var fs_extra=require(_0x6d3c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6d3c('0x7'));var config=require(_0x6d3c('0x8'));var controller=require('./campaign.controller');router[_0x6d3c('0x9')]('/',auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xb')]);router[_0x6d3c('0x9')](_0x6d3c('0xc'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xd')]);router[_0x6d3c('0x9')](_0x6d3c('0xe'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xf')]);router[_0x6d3c('0x9')](_0x6d3c('0x10'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x11')]);router['get'](_0x6d3c('0x12'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x13')]);router[_0x6d3c('0x9')](_0x6d3c('0x14'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x15')]);router[_0x6d3c('0x9')](_0x6d3c('0x16'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x17')]);router[_0x6d3c('0x9')](_0x6d3c('0x18'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x19')]);router[_0x6d3c('0x1a')]('/',auth[_0x6d3c('0xa')](),controller['create']);router[_0x6d3c('0x1a')]('/:id/clone',auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x1b')]);router[_0x6d3c('0x1a')](_0x6d3c('0x16'),auth['isAuthenticated'](),controller[_0x6d3c('0x1c')]);router[_0x6d3c('0x1a')](_0x6d3c('0x18'),auth['isAuthenticated'](),controller[_0x6d3c('0x1d')]);router['put']('/:id',auth[_0x6d3c('0xa')](),controller['update']);router[_0x6d3c('0x1e')](_0x6d3c('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x6d3c('0x1e')]('/:id/lists',auth[_0x6d3c('0xa')](),controller['removeLists']);router['delete'](_0x6d3c('0x18'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x6d3c('0x1f')]=router; \ No newline at end of file +var _0xf6a9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','exports','path','express','Router'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xf6a9,0x176));var _0x9f6a=function(_0x1583d4,_0x12ff2d){_0x1583d4=_0x1583d4-0x0;var _0xaabff1=_0xf6a9[_0x1583d4];return _0xaabff1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9f6a('0x0'));var timeout=require('connect-timeout');var express=require(_0x9f6a('0x1'));var router=express[_0x9f6a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9f6a('0x3'));var interaction=require(_0x9f6a('0x4'));var config=require(_0x9f6a('0x5'));var controller=require(_0x9f6a('0x6'));router[_0x9f6a('0x7')]('/',auth[_0x9f6a('0x8')](),controller['index']);router[_0x9f6a('0x7')](_0x9f6a('0x9'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0xa')]);router[_0x9f6a('0x7')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x9f6a('0xb')]);router[_0x9f6a('0x7')]('/:id/hopper_histories',auth[_0x9f6a('0x8')](),controller['getHopperHistories']);router['get'](_0x9f6a('0xc'),auth[_0x9f6a('0x8')](),controller['getHopperFinals']);router[_0x9f6a('0x7')]('/:id/hopper_black',auth[_0x9f6a('0x8')](),controller[_0x9f6a('0xd')]);router[_0x9f6a('0x7')](_0x9f6a('0xe'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0xf')]);router['get'](_0x9f6a('0x10'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9f6a('0x12')]);router[_0x9f6a('0x13')]('/:id/clone',auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x14')]);router[_0x9f6a('0x13')](_0x9f6a('0xe'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x15')]);router[_0x9f6a('0x13')](_0x9f6a('0x10'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x16')]);router[_0x9f6a('0x17')](_0x9f6a('0x9'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x18')]);router[_0x9f6a('0x19')](_0x9f6a('0x9'),auth[_0x9f6a('0x8')](),controller[_0x9f6a('0x1a')]);router[_0x9f6a('0x19')](_0x9f6a('0xe'),auth['isAuthenticated'](),controller[_0x9f6a('0x1b')]);router[_0x9f6a('0x19')](_0x9f6a('0x10'),auth[_0x9f6a('0x8')](),controller['removeBlackLists']);module[_0x9f6a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index cab075b..97bfbcd 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 _0xdcc9=['getDataValue','key','exports','TEXT','STRING','VIRTUAL'];(function(_0x291139,_0x7f30de){var _0x3c42c0=function(_0x5832e3){while(--_0x5832e3){_0x291139['push'](_0x291139['shift']());}};_0x3c42c0(++_0x7f30de);}(_0xdcc9,0x164));var _0x9dcc=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0xdcc9[_0x51e79c];return _0x2467be;};'use strict';var Sequelize=require('sequelize');module[_0x9dcc('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9dcc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9dcc('0x2')]},'name':{'type':Sequelize[_0x9dcc('0x3')],'get':function(){return this[_0x9dcc('0x4')](_0x9dcc('0x5'));}}}; \ No newline at end of file +var _0xe758=['STRING','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x1a014b,_0x48acae){var _0x462258=function(_0x1473be){while(--_0x1473be){_0x1a014b['push'](_0x1a014b['shift']());}};_0x462258(++_0x48acae);}(_0xe758,0xe8));var _0x8e75=function(_0x504357,_0x471702){_0x504357=_0x504357-0x0;var _0x5c549c=_0xe758[_0x504357];return _0x5c549c;};'use strict';var Sequelize=require(_0x8e75('0x0'));module[_0x8e75('0x1')]={'key':{'type':Sequelize[_0x8e75('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8e75('0x2')]},'name':{'type':Sequelize[_0x8e75('0x3')],'get':function(){return this[_0x8e75('0x4')](_0x8e75('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 3eecc10..fa58904 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 _0xe01d=['sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','CannedAnswers','destroy','error','stack','name','send','index','map','CannedAnswer','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','where','filters','pick','filter','merge','includeAll','include','rows','catch','show','rawAttributes','length','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x124448,_0x1d9eb0){var _0x3423b5=function(_0x11f82d){while(--_0x11f82d){_0x124448['push'](_0x124448['shift']());}};_0x3423b5(++_0x1d9eb0);}(_0xe01d,0x1ed));var _0xde01=function(_0x4f522f,_0x4ac9e0){_0x4f522f=_0x4f522f-0x0;var _0x5701b3=_0xe01d[_0x4f522f];return _0x5701b3;};'use strict';var emlformat=require(_0xde01('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde01('0x1'));var jsonpatch=require(_0xde01('0x2'));var rp=require(_0xde01('0x3'));var moment=require(_0xde01('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xde01('0x5'));var util=require(_0xde01('0x6'));var path=require(_0xde01('0x7'));var sox=require(_0xde01('0x8'));var csv=require(_0xde01('0x9'));var ejs=require(_0xde01('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde01('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xde01('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xde01('0x9'));var querystring=require(_0xde01('0xd'));var Papa=require(_0xde01('0xe'));var Redis=require(_0xde01('0xf'));var authService=require(_0xde01('0x10'));var qs=require(_0xde01('0x11'));var as=require(_0xde01('0x12'));var hardwareService=require(_0xde01('0x13'));var logger=require(_0xde01('0x14'))(_0xde01('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde01('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ccc1e,_0x33fd2f){_0x33fd2f=_0x33fd2f||0xcc;return function(_0x1db412){if(_0x1db412){return _0x2ccc1e[_0xde01('0x17')](_0x33fd2f);}return _0x2ccc1e[_0xde01('0x18')](_0x33fd2f)[_0xde01('0x19')]();};}function respondWithResult(_0x173d2a,_0x54d1da){_0x54d1da=_0x54d1da||0xc8;return function(_0x50abe9){if(_0x50abe9){return _0x173d2a[_0xde01('0x18')](_0x54d1da)[_0xde01('0x1a')](_0x50abe9);}};}function respondWithFilteredResult(_0x5c7750,_0x33f628){return function(_0x1ea194){if(_0x1ea194){var _0xdb4a0f=typeof _0x33f628[_0xde01('0x1b')]==='undefined'&&typeof _0x33f628[_0xde01('0x1c')]===_0xde01('0x1d');var _0x1394c4=_0x1ea194[_0xde01('0x1e')];var _0x50f9e5=_0xdb4a0f?0x0:_0x33f628[_0xde01('0x1b')];var _0x517afe=_0xdb4a0f?_0x1ea194[_0xde01('0x1e')]:_0x33f628[_0xde01('0x1b')]+_0x33f628[_0xde01('0x1c')];var _0xad5a43;if(_0x517afe>=_0x1394c4){_0x517afe=_0x1394c4;_0xad5a43=0xc8;}else{_0xad5a43=0xce;}_0x5c7750[_0xde01('0x18')](_0xad5a43);return _0x5c7750[_0xde01('0x1f')]('Content-Range',_0x50f9e5+'-'+_0x517afe+'/'+_0x1394c4)[_0xde01('0x1a')](_0x1ea194);}return null;};}function patchUpdates(_0x41d554){return function(_0x146d8b){try{jsonpatch[_0xde01('0x20')](_0x146d8b,_0x41d554,!![]);}catch(_0x227594){return BPromise[_0xde01('0x21')](_0x227594);}return _0x146d8b[_0xde01('0x22')]();};}function saveUpdates(_0x5c992d,_0x3bd856){return function(_0x50554d){if(_0x50554d){return _0x50554d[_0xde01('0x23')](_0x5c992d)[_0xde01('0x24')](function(_0x55fc11){return _0x55fc11;});}return null;};}function removeEntity(_0x4d1ad4,_0x3effb1){return function(_0x49f0ef){if(_0x49f0ef){return _0x49f0ef['destroy']()[_0xde01('0x24')](function(){var _0xa28ac2=_0x49f0ef[_0xde01('0x25')]({'plain':!![]});var _0x1c4654=_0xde01('0x26');return db['UserProfileResource'][_0xde01('0x27')]({'where':{'type':_0x1c4654,'resourceId':_0xa28ac2['id']}})['then'](function(){return _0x49f0ef;});})['then'](function(){_0x4d1ad4['status'](0xcc)[_0xde01('0x19')]();});}};}function handleEntityNotFound(_0x5062b8,_0x19165a){return function(_0x4474db){if(!_0x4474db){_0x5062b8['sendStatus'](0x194);}return _0x4474db;};}function handleError(_0x4cf442,_0x26161b){_0x26161b=_0x26161b||0x1f4;return function(_0x1c6fb0){logger[_0xde01('0x28')](_0x1c6fb0[_0xde01('0x29')]);if(_0x1c6fb0[_0xde01('0x2a')]){delete _0x1c6fb0[_0xde01('0x2a')];}_0x4cf442['status'](_0x26161b)[_0xde01('0x2b')](_0x1c6fb0);};}exports[_0xde01('0x2c')]=function(_0x404e41,_0x440a1){var _0x40a619={},_0x47e80b={},_0x3b56d9={'count':0x0,'rows':[]};var _0x30e7a0=_[_0xde01('0x2d')](db[_0xde01('0x2e')]['rawAttributes'],function(_0x217cfe){return{'name':_0x217cfe['fieldName'],'type':_0x217cfe[_0xde01('0x2f')][_0xde01('0x30')]};});_0x47e80b['model']=_[_0xde01('0x2d')](_0x30e7a0,'name');_0x47e80b[_0xde01('0x31')]=_[_0xde01('0x32')](_0x404e41[_0xde01('0x31')]);_0x47e80b['filters']=_[_0xde01('0x33')](_0x47e80b[_0xde01('0x34')],_0x47e80b[_0xde01('0x31')]);_0x40a619[_0xde01('0x35')]=_[_0xde01('0x33')](_0x47e80b['model'],qs['fields'](_0x404e41[_0xde01('0x31')][_0xde01('0x36')]));_0x40a619[_0xde01('0x35')]=_0x40a619['attributes']['length']?_0x40a619[_0xde01('0x35')]:_0x47e80b[_0xde01('0x34')];if(!_0x404e41['query'][_0xde01('0x37')](_0xde01('0x38'))){_0x40a619[_0xde01('0x1c')]=qs[_0xde01('0x1c')](_0x404e41[_0xde01('0x31')][_0xde01('0x1c')]);_0x40a619['offset']=qs['offset'](_0x404e41[_0xde01('0x31')][_0xde01('0x1b')]);}_0x40a619['order']=qs['sort'](_0x404e41['query']['sort']);_0x40a619[_0xde01('0x39')]=qs[_0xde01('0x3a')](_[_0xde01('0x3b')](_0x404e41[_0xde01('0x31')],_0x47e80b[_0xde01('0x3a')]),_0x30e7a0);if(_0x404e41[_0xde01('0x31')][_0xde01('0x3c')]){_0x40a619[_0xde01('0x39')]=_['merge'](_0x40a619[_0xde01('0x39')],{'$or':[{'key':{'$like':'%'+_0x404e41[_0xde01('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x404e41[_0xde01('0x31')][_0xde01('0x3c')]+'%'}}]});}_0x40a619=_[_0xde01('0x3d')]({},_0x40a619,_0x404e41['options']);var _0x17a6f5={'where':_0x40a619[_0xde01('0x39')]};return db['CannedAnswer']['count'](_0x17a6f5)[_0xde01('0x24')](function(_0x53cc13){_0x3b56d9[_0xde01('0x1e')]=_0x53cc13;if(_0x404e41[_0xde01('0x31')][_0xde01('0x3e')]){_0x40a619[_0xde01('0x3f')]=[{'all':!![]}];}return db[_0xde01('0x2e')]['findAll'](_0x40a619);})[_0xde01('0x24')](function(_0x232ef7){_0x3b56d9[_0xde01('0x40')]=_0x232ef7;return _0x3b56d9;})[_0xde01('0x24')](respondWithFilteredResult(_0x440a1,_0x40a619))[_0xde01('0x41')](handleError(_0x440a1,null));};exports[_0xde01('0x42')]=function(_0xd1db15,_0x3bee3b){var _0x2f8f9c={'raw':!![],'where':{'id':_0xd1db15['params']['id']}},_0x4ac29f={};_0x4ac29f[_0xde01('0x34')]=_[_0xde01('0x32')](db[_0xde01('0x2e')][_0xde01('0x43')]);_0x4ac29f[_0xde01('0x31')]=_[_0xde01('0x32')](_0xd1db15[_0xde01('0x31')]);_0x4ac29f[_0xde01('0x3a')]=_['intersection'](_0x4ac29f['model'],_0x4ac29f[_0xde01('0x31')]);_0x2f8f9c[_0xde01('0x35')]=_[_0xde01('0x33')](_0x4ac29f[_0xde01('0x34')],qs['fields'](_0xd1db15[_0xde01('0x31')][_0xde01('0x36')]));_0x2f8f9c[_0xde01('0x35')]=_0x2f8f9c[_0xde01('0x35')][_0xde01('0x44')]?_0x2f8f9c[_0xde01('0x35')]:_0x4ac29f[_0xde01('0x34')];if(_0xd1db15[_0xde01('0x31')][_0xde01('0x3e')]){_0x2f8f9c[_0xde01('0x3f')]=[{'all':!![]}];}_0x2f8f9c=_[_0xde01('0x3d')]({},_0x2f8f9c,_0xd1db15['options']);return db[_0xde01('0x2e')][_0xde01('0x45')](_0x2f8f9c)[_0xde01('0x24')](handleEntityNotFound(_0x3bee3b,null))[_0xde01('0x24')](respondWithResult(_0x3bee3b,null))[_0xde01('0x41')](handleError(_0x3bee3b,null));};exports[_0xde01('0x23')]=function(_0xef6fbe,_0x4e7b2a){if(_0xef6fbe[_0xde01('0x46')]['id']){delete _0xef6fbe['body']['id'];}return db[_0xde01('0x2e')]['find']({'where':{'id':_0xef6fbe['params']['id']}})[_0xde01('0x24')](handleEntityNotFound(_0x4e7b2a,null))[_0xde01('0x24')](saveUpdates(_0xef6fbe[_0xde01('0x46')],null))[_0xde01('0x24')](respondWithResult(_0x4e7b2a,null))[_0xde01('0x41')](handleError(_0x4e7b2a,null));};exports['destroy']=function(_0x2ce8d2,_0x45ddab){return db['CannedAnswer'][_0xde01('0x45')]({'where':{'id':_0x2ce8d2[_0xde01('0x47')]['id']}})['then'](handleEntityNotFound(_0x45ddab,null))['then'](removeEntity(_0x45ddab,null))[_0xde01('0x41')](handleError(_0x45ddab,null));};exports[_0xde01('0x48')]=function(_0x5c7a03,_0x544c3a){var _0x376b72={'key':_0x5c7a03[_0xde01('0x46')]['key']};if(_0x5c7a03[_0xde01('0x46')]['MailAccountId']){_0x376b72[_0xde01('0x49')]=_0x5c7a03[_0xde01('0x46')][_0xde01('0x49')];}else if(_0x5c7a03[_0xde01('0x46')][_0xde01('0x4a')]){_0x376b72['SmsAccountId']=_0x5c7a03[_0xde01('0x46')][_0xde01('0x4a')];}else if(_0x5c7a03[_0xde01('0x46')][_0xde01('0x4b')]){_0x376b72[_0xde01('0x4b')]=_0x5c7a03[_0xde01('0x46')][_0xde01('0x4b')];}else if(_0x5c7a03[_0xde01('0x46')][_0xde01('0x4c')]){_0x376b72['ChatWebsiteId']=_0x5c7a03[_0xde01('0x46')][_0xde01('0x4c')];}return db[_0xde01('0x2e')][_0xde01('0x45')]({'where':_0x376b72})[_0xde01('0x24')](function(_0x29457a){if(_0x29457a){throw new db[(_0xde01('0x4d'))][(_0xde01('0x4e'))](_0xde01('0x4f'));}return db[_0xde01('0x2e')][_0xde01('0x48')](_0x5c7a03[_0xde01('0x46')]);})[_0xde01('0x24')](function(_0x595bab){var _0x3603e6=_0x5c7a03[_0xde01('0x50')][_0xde01('0x25')]({'plain':!![]});if(!_0x3603e6)throw new Error(_0xde01('0x51'));if(_0x3603e6['role']===_0xde01('0x50')){var _0x410f02=_0x595bab['get']({'plain':!![]});return db[_0xde01('0x52')][_0xde01('0x45')]({'where':{'name':_0xde01('0x26'),'userProfileId':_0x3603e6[_0xde01('0x53')]},'raw':!![]})[_0xde01('0x24')](function(_0x18c7b0){if(_0x18c7b0&&_0x18c7b0[_0xde01('0x54')]===0x0){return db[_0xde01('0x55')][_0xde01('0x48')]({'name':_0x410f02[_0xde01('0x2a')],'resourceId':_0x410f02['id'],'type':_0x18c7b0['name'],'sectionId':_0x18c7b0['id']},{})[_0xde01('0x24')](function(){return _0x595bab;});}else{return _0x595bab;}})[_0xde01('0x41')](function(_0x401102){logger[_0xde01('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x401102);throw _0x401102;});}return _0x595bab;})['then'](respondWithResult(_0x544c3a,0xc9))['catch'](handleError(_0x544c3a,null));}; \ No newline at end of file +var _0xc39e=['show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','update','then','CannedAnswers','UserProfileResource','destroy','stack','name','send','CannedAnswer','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0xc39e,0x66));var _0xec39=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0xc39e[_0x15876a];return _0xbd900f;};'use strict';var emlformat=require(_0xec39('0x0'));var rimraf=require(_0xec39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec39('0x2'));var rp=require(_0xec39('0x3'));var moment=require(_0xec39('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec39('0x5'));var util=require('util');var path=require(_0xec39('0x6'));var sox=require('sox');var csv=require(_0xec39('0x7'));var ejs=require(_0xec39('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec39('0x9'));var squel=require('squel');var crypto=require(_0xec39('0xa'));var jsforce=require(_0xec39('0xb'));var deskjs=require(_0xec39('0xc'));var toCsv=require(_0xec39('0x7'));var querystring=require(_0xec39('0xd'));var Papa=require(_0xec39('0xe'));var Redis=require(_0xec39('0xf'));var authService=require(_0xec39('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec39('0x11'));var logger=require(_0xec39('0x12'))(_0xec39('0x13'));var utils=require(_0xec39('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xec39('0x15'))['db'];function respondWithStatusCode(_0x292768,_0x99c3a3){_0x99c3a3=_0x99c3a3||0xcc;return function(_0x249ff4){if(_0x249ff4){return _0x292768['sendStatus'](_0x99c3a3);}return _0x292768[_0xec39('0x16')](_0x99c3a3)[_0xec39('0x17')]();};}function respondWithResult(_0x5ef28b,_0x35690c){_0x35690c=_0x35690c||0xc8;return function(_0x4300e5){if(_0x4300e5){return _0x5ef28b[_0xec39('0x16')](_0x35690c)[_0xec39('0x18')](_0x4300e5);}};}function respondWithFilteredResult(_0x1f441d,_0x4e420f){return function(_0x548faf){if(_0x548faf){var _0xe22ff9=typeof _0x4e420f['offset']==='undefined'&&typeof _0x4e420f['limit']===_0xec39('0x19');var _0x4c5e54=_0x548faf['count'];var _0x373c43=_0xe22ff9?0x0:_0x4e420f[_0xec39('0x1a')];var _0x289d0e=_0xe22ff9?_0x548faf['count']:_0x4e420f[_0xec39('0x1a')]+_0x4e420f[_0xec39('0x1b')];var _0x37e669;if(_0x289d0e>=_0x4c5e54){_0x289d0e=_0x4c5e54;_0x37e669=0xc8;}else{_0x37e669=0xce;}_0x1f441d['status'](_0x37e669);return _0x1f441d[_0xec39('0x1c')](_0xec39('0x1d'),_0x373c43+'-'+_0x289d0e+'/'+_0x4c5e54)[_0xec39('0x18')](_0x548faf);}return null;};}function patchUpdates(_0x839f75){return function(_0x41de79){try{jsonpatch[_0xec39('0x1e')](_0x41de79,_0x839f75,!![]);}catch(_0x317147){return BPromise[_0xec39('0x1f')](_0x317147);}return _0x41de79[_0xec39('0x20')]();};}function saveUpdates(_0x179a3e,_0x1f9a3b){return function(_0xe38c3a){if(_0xe38c3a){return _0xe38c3a[_0xec39('0x21')](_0x179a3e)['then'](function(_0x498973){return _0x498973;});}return null;};}function removeEntity(_0x57a8a1,_0x592e3f){return function(_0x20a043){if(_0x20a043){return _0x20a043['destroy']()[_0xec39('0x22')](function(){var _0xd276f8=_0x20a043['get']({'plain':!![]});var _0x290e64=_0xec39('0x23');return db[_0xec39('0x24')][_0xec39('0x25')]({'where':{'type':_0x290e64,'resourceId':_0xd276f8['id']}})['then'](function(){return _0x20a043;});})[_0xec39('0x22')](function(){_0x57a8a1[_0xec39('0x16')](0xcc)[_0xec39('0x17')]();});}};}function handleEntityNotFound(_0x3e0758,_0x5850e9){return function(_0x40b31a){if(!_0x40b31a){_0x3e0758['sendStatus'](0x194);}return _0x40b31a;};}function handleError(_0x25c985,_0x388e05){_0x388e05=_0x388e05||0x1f4;return function(_0x5104bc){logger['error'](_0x5104bc[_0xec39('0x26')]);if(_0x5104bc[_0xec39('0x27')]){delete _0x5104bc[_0xec39('0x27')];}_0x25c985[_0xec39('0x16')](_0x388e05)[_0xec39('0x28')](_0x5104bc);};}exports['index']=function(_0x262b9a,_0x4da305){var _0x3e4270={},_0x261e64={},_0xd032de={'count':0x0,'rows':[]};var _0xe1b444=_['map'](db[_0xec39('0x29')][_0xec39('0x2a')],function(_0x2309b8){return{'name':_0x2309b8[_0xec39('0x2b')],'type':_0x2309b8[_0xec39('0x2c')][_0xec39('0x2d')]};});_0x261e64['model']=_[_0xec39('0x2e')](_0xe1b444,_0xec39('0x27'));_0x261e64['query']=_['keys'](_0x262b9a[_0xec39('0x2f')]);_0x261e64[_0xec39('0x30')]=_[_0xec39('0x31')](_0x261e64['model'],_0x261e64[_0xec39('0x2f')]);_0x3e4270['attributes']=_['intersection'](_0x261e64[_0xec39('0x32')],qs['fields'](_0x262b9a[_0xec39('0x2f')][_0xec39('0x33')]));_0x3e4270[_0xec39('0x34')]=_0x3e4270['attributes'][_0xec39('0x35')]?_0x3e4270[_0xec39('0x34')]:_0x261e64[_0xec39('0x32')];if(!_0x262b9a['query']['hasOwnProperty']('nolimit')){_0x3e4270['limit']=qs[_0xec39('0x1b')](_0x262b9a[_0xec39('0x2f')]['limit']);_0x3e4270[_0xec39('0x1a')]=qs['offset'](_0x262b9a[_0xec39('0x2f')][_0xec39('0x1a')]);}_0x3e4270[_0xec39('0x36')]=qs[_0xec39('0x37')](_0x262b9a[_0xec39('0x2f')][_0xec39('0x37')]);_0x3e4270[_0xec39('0x38')]=qs[_0xec39('0x30')](_[_0xec39('0x39')](_0x262b9a[_0xec39('0x2f')],_0x261e64[_0xec39('0x30')]),_0xe1b444);if(_0x262b9a[_0xec39('0x2f')][_0xec39('0x3a')]){_0x3e4270[_0xec39('0x38')]=_['merge'](_0x3e4270[_0xec39('0x38')],{'$or':[{'key':{'$like':'%'+_0x262b9a['query'][_0xec39('0x3a')]+'%'}},{'value':{'$like':'%'+_0x262b9a[_0xec39('0x2f')][_0xec39('0x3a')]+'%'}}]});}_0x3e4270=_[_0xec39('0x3b')]({},_0x3e4270,_0x262b9a[_0xec39('0x3c')]);var _0xe474f7={'where':_0x3e4270['where']};return db['CannedAnswer'][_0xec39('0x3d')](_0xe474f7)[_0xec39('0x22')](function(_0x59238d){_0xd032de[_0xec39('0x3d')]=_0x59238d;if(_0x262b9a[_0xec39('0x2f')][_0xec39('0x3e')]){_0x3e4270[_0xec39('0x3f')]=[{'all':!![]}];}return db[_0xec39('0x29')]['findAll'](_0x3e4270);})[_0xec39('0x22')](function(_0xc85751){_0xd032de[_0xec39('0x40')]=_0xc85751;return _0xd032de;})[_0xec39('0x22')](respondWithFilteredResult(_0x4da305,_0x3e4270))[_0xec39('0x41')](handleError(_0x4da305,null));};exports[_0xec39('0x42')]=function(_0x20c73b,_0x41aebe){var _0x5e3134={'raw':!![],'where':{'id':_0x20c73b[_0xec39('0x43')]['id']}},_0x172f1c={};_0x172f1c[_0xec39('0x32')]=_[_0xec39('0x44')](db[_0xec39('0x29')]['rawAttributes']);_0x172f1c[_0xec39('0x2f')]=_[_0xec39('0x44')](_0x20c73b[_0xec39('0x2f')]);_0x172f1c[_0xec39('0x30')]=_[_0xec39('0x31')](_0x172f1c['model'],_0x172f1c[_0xec39('0x2f')]);_0x5e3134['attributes']=_[_0xec39('0x31')](_0x172f1c[_0xec39('0x32')],qs['fields'](_0x20c73b[_0xec39('0x2f')][_0xec39('0x33')]));_0x5e3134[_0xec39('0x34')]=_0x5e3134[_0xec39('0x34')][_0xec39('0x35')]?_0x5e3134[_0xec39('0x34')]:_0x172f1c[_0xec39('0x32')];if(_0x20c73b[_0xec39('0x2f')][_0xec39('0x3e')]){_0x5e3134['include']=[{'all':!![]}];}_0x5e3134=_[_0xec39('0x3b')]({},_0x5e3134,_0x20c73b[_0xec39('0x3c')]);return db[_0xec39('0x29')][_0xec39('0x45')](_0x5e3134)[_0xec39('0x22')](handleEntityNotFound(_0x41aebe,null))['then'](respondWithResult(_0x41aebe,null))['catch'](handleError(_0x41aebe,null));};exports['update']=function(_0x45b25d,_0x2d1078){if(_0x45b25d[_0xec39('0x46')]['id']){delete _0x45b25d[_0xec39('0x46')]['id'];}return db[_0xec39('0x29')][_0xec39('0x45')]({'where':{'id':_0x45b25d[_0xec39('0x43')]['id']}})[_0xec39('0x22')](handleEntityNotFound(_0x2d1078,null))[_0xec39('0x22')](saveUpdates(_0x45b25d[_0xec39('0x46')],null))[_0xec39('0x22')](respondWithResult(_0x2d1078,null))[_0xec39('0x41')](handleError(_0x2d1078,null));};exports['destroy']=function(_0x51f6ec,_0x60543){return db[_0xec39('0x29')][_0xec39('0x45')]({'where':{'id':_0x51f6ec['params']['id']}})[_0xec39('0x22')](handleEntityNotFound(_0x60543,null))['then'](removeEntity(_0x60543,null))[_0xec39('0x41')](handleError(_0x60543,null));};exports[_0xec39('0x47')]=function(_0x30bbb2,_0x3e3f83){var _0x5c9e49={'key':_0x30bbb2['body'][_0xec39('0x2d')]};if(_0x30bbb2[_0xec39('0x46')]['MailAccountId']){_0x5c9e49[_0xec39('0x48')]=_0x30bbb2['body']['MailAccountId'];}else if(_0x30bbb2[_0xec39('0x46')][_0xec39('0x49')]){_0x5c9e49[_0xec39('0x49')]=_0x30bbb2[_0xec39('0x46')][_0xec39('0x49')];}else if(_0x30bbb2[_0xec39('0x46')][_0xec39('0x4a')]){_0x5c9e49['OpenchannelAccountId']=_0x30bbb2[_0xec39('0x46')][_0xec39('0x4a')];}else if(_0x30bbb2[_0xec39('0x46')][_0xec39('0x4b')]){_0x5c9e49[_0xec39('0x4b')]=_0x30bbb2[_0xec39('0x46')]['ChatWebsiteId'];}return db[_0xec39('0x29')]['find']({'where':_0x5c9e49})['then'](function(_0x46e17d){if(_0x46e17d){throw new db['Sequelize'][(_0xec39('0x4c'))](_0xec39('0x4d'));}return db['CannedAnswer'][_0xec39('0x47')](_0x30bbb2[_0xec39('0x46')]);})[_0xec39('0x22')](function(_0x2d4f19){var _0x405ed7=_0x30bbb2[_0xec39('0x4e')][_0xec39('0x4f')]({'plain':!![]});if(!_0x405ed7)throw new Error(_0xec39('0x50'));if(_0x405ed7['role']===_0xec39('0x4e')){var _0x509bba=_0x2d4f19[_0xec39('0x4f')]({'plain':!![]});return db[_0xec39('0x51')]['find']({'where':{'name':_0xec39('0x23'),'userProfileId':_0x405ed7['userProfileId']},'raw':!![]})[_0xec39('0x22')](function(_0x2c34f2){if(_0x2c34f2&&_0x2c34f2[_0xec39('0x52')]===0x0){return db[_0xec39('0x24')][_0xec39('0x47')]({'name':_0x509bba['name'],'resourceId':_0x509bba['id'],'type':_0x2c34f2['name'],'sectionId':_0x2c34f2['id']},{})[_0xec39('0x22')](function(){return _0x2d4f19;});}else{return _0x2d4f19;}})['catch'](function(_0x2da914){logger[_0xec39('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2da914);throw _0x2da914;});}return _0x2d4f19;})['then'](respondWithResult(_0x3e3f83,0xc9))[_0xec39('0x41')](handleError(_0x3e3f83,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index ff80635..26ce411 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 _0x3191=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','CannedAnswer'];(function(_0x5b2980,_0x31ad07){var _0x4c308e=function(_0x4f162d){while(--_0x4f162d){_0x5b2980['push'](_0x5b2980['shift']());}};_0x4c308e(++_0x31ad07);}(_0x3191,0x120));var _0x1319=function(_0x350a54,_0x404cec){_0x350a54=_0x350a54-0x0;var _0x33bcfd=_0x3191[_0x350a54];return _0x33bcfd;};'use strict';var _=require(_0x1319('0x0'));var util=require(_0x1319('0x1'));var logger=require(_0x1319('0x2'))(_0x1319('0x3'));var moment=require(_0x1319('0x4'));var BPromise=require(_0x1319('0x5'));var rp=require(_0x1319('0x6'));var fs=require('fs');var path=require(_0x1319('0x7'));var rimraf=require(_0x1319('0x8'));var config=require(_0x1319('0x9'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x2980cf,_0x2efbbe){return _0x2980cf['define'](_0x1319('0xa'),attributes,{'tableName':_0x1319('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1319('0xc')});}; \ No newline at end of file +var _0x38a5=['util','api','bluebird','path','rimraf','../../config/environment','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x123902,_0x4912bf){var _0x1464f1=function(_0x4d95db){while(--_0x4d95db){_0x123902['push'](_0x123902['shift']());}};_0x1464f1(++_0x4912bf);}(_0x38a5,0x1eb));var _0x538a=function(_0x15de9e,_0x36d10e){_0x15de9e=_0x15de9e-0x0;var _0x5bed6e=_0x38a5[_0x15de9e];return _0x5bed6e;};'use strict';var _=require(_0x538a('0x0'));var util=require(_0x538a('0x1'));var logger=require('../../config/logger')(_0x538a('0x2'));var moment=require('moment');var BPromise=require(_0x538a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x538a('0x4'));var rimraf=require(_0x538a('0x5'));var config=require(_0x538a('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x538a('0x7')]=function(_0x52aa3f,_0x4da8b6){return _0x52aa3f[_0x538a('0x8')]('CannedAnswer',attributes,{'tableName':_0x538a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x538a('0xa'),'collate':_0x538a('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index ec8a92c..32cd872 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(_0x519ba8,_0x392a0a){var _0x2daadb=function(_0x3f745a){while(--_0x3f745a){_0x519ba8['push'](_0x519ba8['shift']());}};_0x2daadb(++_0x392a0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x2ba724,_0x24751e){var _0x38ed11=function(_0x49d042){while(--_0x49d042){_0x2ba724['push'](_0x2ba724['shift']());}};_0x38ed11(++_0x24751e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 8b91e66..57c0560 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 _0x9505=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x592c14,_0x34cf86){var _0x1cc2eb=function(_0x28b4ec){while(--_0x28b4ec){_0x592c14['push'](_0x592c14['shift']());}};_0x1cc2eb(++_0x34cf86);}(_0x9505,0xaf));var _0x5950=function(_0xdc567c,_0x1e8345){_0xdc567c=_0xdc567c-0x0;var _0x40567c=_0x9505[_0xdc567c];return _0x40567c;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require(_0x5950('0x2'));var timeout=require(_0x5950('0x3'));var express=require('express');var router=express[_0x5950('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5950('0x5'));var interaction=require(_0x5950('0x6'));var config=require(_0x5950('0x7'));var controller=require(_0x5950('0x8'));router['get']('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get'](_0x5950('0xb'),auth[_0x5950('0x9')](),controller[_0x5950('0xc')]);router[_0x5950('0xd')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xe')]);router[_0x5950('0xf')]('/:id',auth[_0x5950('0x9')](),controller['update']);router[_0x5950('0x10')]('/:id',auth[_0x5950('0x9')](),controller['destroy']);module[_0x5950('0x11')]=router; \ No newline at end of file +var _0xb2fa=['put','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','isAuthenticated','get','post','create'];(function(_0xead382,_0x2b5667){var _0x415a65=function(_0x4163a4){while(--_0x4163a4){_0xead382['push'](_0xead382['shift']());}};_0x415a65(++_0x2b5667);}(_0xb2fa,0x85));var _0xab2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb2fa[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab2f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab2f('0x1'));var router=express[_0xab2f('0x2')]();var fs_extra=require(_0xab2f('0x3'));var auth=require(_0xab2f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab2f('0x5'));router['get']('/',auth[_0xab2f('0x6')](),controller['index']);router[_0xab2f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xab2f('0x8')]('/',auth['isAuthenticated'](),controller[_0xab2f('0x9')]);router[_0xab2f('0xa')]('/:id',auth[_0xab2f('0x6')](),controller['update']);router['delete']('/:id',auth[_0xab2f('0x6')](),controller[_0xab2f('0xb')]);module[_0xab2f('0xc')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b43789e..88b8e8f 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 _0x5d99=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3aab20,_0x36e7ed){var _0x3397b8=function(_0x1e1c64){while(--_0x1e1c64){_0x3aab20['push'](_0x3aab20['shift']());}};_0x3397b8(++_0x36e7ed);}(_0x5d99,0x150));var _0x95d9=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0x5d99[_0x3e8cae];return _0x45c4d6;};'use strict';var Sequelize=require('sequelize');module[_0x95d9('0x0')]={'calldate':{'type':Sequelize[_0x95d9('0x1')],'allowNull':![],'defaultValue':_0x95d9('0x2')},'clid':{'type':Sequelize[_0x95d9('0x3')]},'src':{'type':Sequelize[_0x95d9('0x3')]},'dst':{'type':Sequelize[_0x95d9('0x3')]},'dcontext':{'type':Sequelize[_0x95d9('0x3')]},'channel':{'type':Sequelize[_0x95d9('0x3')]},'dstchannel':{'type':Sequelize[_0x95d9('0x3')]},'lastapp':{'type':Sequelize[_0x95d9('0x3')]},'lastdata':{'type':Sequelize[_0x95d9('0x3')]},'duration':{'type':Sequelize[_0x95d9('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x95d9('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x95d9('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x95d9('0x3')]},'userfield':{'type':Sequelize[_0x95d9('0x3')]},'uniqueid':{'type':Sequelize[_0x95d9('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x95d9('0x3')]},'type':{'type':Sequelize[_0x95d9('0x3')]},'tag':{'type':Sequelize[_0x95d9('0x3')]}}; \ No newline at end of file +var _0xa870=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2175d2,_0x3ac4bd){var _0x5c8987=function(_0x4baa51){while(--_0x4baa51){_0x2175d2['push'](_0x2175d2['shift']());}};_0x5c8987(++_0x3ac4bd);}(_0xa870,0x143));var _0x0a87=function(_0x5c2bcc,_0x3eb555){_0x5c2bcc=_0x5c2bcc-0x0;var _0x5818a7=_0xa870[_0x5c2bcc];return _0x5818a7;};'use strict';var Sequelize=require(_0x0a87('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0a87('0x1')},'clid':{'type':Sequelize[_0x0a87('0x2')]},'src':{'type':Sequelize[_0x0a87('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0a87('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0a87('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0a87('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0a87('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0a87('0x2')]},'amaflags':{'type':Sequelize[_0x0a87('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0a87('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x0a87('0x2')]},'sequence':{'type':Sequelize[_0x0a87('0x2')]},'peeraccount':{'type':Sequelize[_0x0a87('0x2')]},'type':{'type':Sequelize[_0x0a87('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 09340ca..5c671bd 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 _0xdbf5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','Cdr'];(function(_0x50dd91,_0x50585c){var _0x45b43b=function(_0x26f8e6){while(--_0x26f8e6){_0x50dd91['push'](_0x50dd91['shift']());}};_0x45b43b(++_0x50585c);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x583369,_0xc8373b){_0x583369=_0x583369-0x0;var _0x56dd61=_0xdbf5[_0x583369];return _0x56dd61;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['map'](_0xc4748,'name');_0x2f71eb[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x471027[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x31')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],_0x2f71eb['query']);_0x5768b7[_0x5dbf('0x33')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],qs[_0x5dbf('0x34')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x5768b7[_0x5dbf('0x33')]=_0x5768b7[_0x5dbf('0x33')]['length']?_0x5768b7[_0x5dbf('0x33')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x5768b7['limit']=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x37')]);_0x5768b7[_0x5dbf('0x19')]=qs['offset'](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x31')](_[_0x5dbf('0x3b')](_0x471027[_0x5dbf('0x2f')],_0x2f71eb[_0x5dbf('0x31')]),_0xc4748);if(_0x471027['query'][_0x5dbf('0x3c')]){_0x5768b7[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x5768b7['where'],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x43954b){if(_0x43954b[_0x5dbf('0x2c')]!=='VIRTUAL'){var _0x444814={};_0x444814[_0x43954b[_0x5dbf('0x25')]]={'$like':'%'+_0x471027[_0x5dbf('0x2f')]['filter']+'%'};return _0x444814;}})});}_0x5768b7=_[_0x5dbf('0x3d')]({},_0x5768b7,_0x471027[_0x5dbf('0x3e')]);var _0x2ac162={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x2ac162)[_0x5dbf('0x20')](function(_0x2ed355){_0x24dc99['count']=_0x2ed355;if(_0x471027['query']['includeAll']){_0x5768b7['include']=[{'all':!![]}];}return db[_0x5dbf('0x29')][_0x5dbf('0x3f')](_0x5768b7);})['then'](function(_0x3ef0eb){_0x24dc99[_0x5dbf('0x40')]=_0x3ef0eb;return _0x24dc99;})['then'](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x41')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x42')]=function(_0x2ee717,_0x2ee6b9){var _0x21ae10={'raw':!![],'where':{'id':_0x2ee717[_0x5dbf('0x43')]['id']}},_0x7c390d={};_0x7c390d[_0x5dbf('0x2e')]=_[_0x5dbf('0x30')](db[_0x5dbf('0x29')]['rawAttributes']);_0x7c390d[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x2ee717[_0x5dbf('0x2f')]);_0x7c390d['filters']=_[_0x5dbf('0x32')](_0x7c390d[_0x5dbf('0x2e')],_0x7c390d[_0x5dbf('0x2f')]);_0x21ae10[_0x5dbf('0x33')]=_['intersection'](_0x7c390d[_0x5dbf('0x2e')],qs['fields'](_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x21ae10[_0x5dbf('0x33')]=_0x21ae10[_0x5dbf('0x33')]['length']?_0x21ae10['attributes']:_0x7c390d[_0x5dbf('0x2e')];if(_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x44')]){_0x21ae10['include']=[{'all':!![]}];}_0x21ae10=_[_0x5dbf('0x3d')]({},_0x21ae10,_0x2ee717['options']);return db['Cdr']['find'](_0x21ae10)['then'](handleEntityNotFound(_0x2ee6b9,null))[_0x5dbf('0x20')](respondWithResult(_0x2ee6b9,null))[_0x5dbf('0x41')](handleError(_0x2ee6b9,null));};exports['create']=function(_0x47063d,_0x3ba5cb){return db['Cdr'][_0x5dbf('0x45')](_0x47063d[_0x5dbf('0x46')],{})['then'](respondWithResult(_0x3ba5cb,0xc9))[_0x5dbf('0x41')](handleError(_0x3ba5cb,null));};exports['update']=function(_0x5ab862,_0x337897){if(_0x5ab862[_0x5dbf('0x46')]['id']){delete _0x5ab862[_0x5dbf('0x46')]['id'];}return db['Cdr']['find']({'where':{'id':_0x5ab862[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x337897,null))[_0x5dbf('0x20')](saveUpdates(_0x5ab862[_0x5dbf('0x46')],null))[_0x5dbf('0x20')](respondWithResult(_0x337897,null))[_0x5dbf('0x41')](handleError(_0x337897,null));};exports[_0x5dbf('0x21')]=function(_0x319906,_0x4bc7eb){return db[_0x5dbf('0x29')][_0x5dbf('0x47')]({'where':{'id':_0x319906[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x4bc7eb,null))[_0x5dbf('0x20')](removeEntity(_0x4bc7eb,null))[_0x5dbf('0x41')](handleError(_0x4bc7eb,null));};exports[_0x5dbf('0x48')]=function(_0x59f825,_0x1b0b13){return db['Cdr'][_0x5dbf('0x48')]()[_0x5dbf('0x20')](respondWithResult(_0x1b0b13,null))[_0x5dbf('0x41')](handleError(_0x1b0b13,null));}; \ No newline at end of file +var _0xe132=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xe132,0x162));var _0x2e13=function(_0x11967a,_0x47e5a8){_0x11967a=_0x11967a-0x0;var _0x5ab9f7=_0xe132[_0x11967a];return _0x5ab9f7;};'use strict';var emlformat=require(_0x2e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e13('0x1'));var jsonpatch=require(_0x2e13('0x2'));var rp=require(_0x2e13('0x3'));var moment=require(_0x2e13('0x4'));var BPromise=require(_0x2e13('0x5'));var Mustache=require('mustache');var util=require(_0x2e13('0x6'));var path=require(_0x2e13('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e13('0x8'));var fs=require('fs');var fs_extra=require(_0x2e13('0x9'));var _=require(_0x2e13('0xa'));var squel=require(_0x2e13('0xb'));var crypto=require(_0x2e13('0xc'));var jsforce=require(_0x2e13('0xd'));var deskjs=require(_0x2e13('0xe'));var toCsv=require(_0x2e13('0xf'));var querystring=require(_0x2e13('0x10'));var Papa=require(_0x2e13('0x11'));var Redis=require('ioredis');var authService=require(_0x2e13('0x12'));var qs=require(_0x2e13('0x13'));var as=require(_0x2e13('0x14'));var hardwareService=require(_0x2e13('0x15'));var logger=require(_0x2e13('0x16'))(_0x2e13('0x17'));var utils=require(_0x2e13('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2e13('0x19'));var db=require(_0x2e13('0x1a'))['db'];function respondWithStatusCode(_0x320303,_0x299dd3){_0x299dd3=_0x299dd3||0xcc;return function(_0x424e58){if(_0x424e58){return _0x320303[_0x2e13('0x1b')](_0x299dd3);}return _0x320303[_0x2e13('0x1c')](_0x299dd3)['end']();};}function respondWithResult(_0xb70eb8,_0xea6c20){_0xea6c20=_0xea6c20||0xc8;return function(_0xfaca18){if(_0xfaca18){return _0xb70eb8['status'](_0xea6c20)[_0x2e13('0x1d')](_0xfaca18);}};}function respondWithFilteredResult(_0x2a58e5,_0x433bbd){return function(_0x5e96a5){if(_0x5e96a5){var _0xd25628=typeof _0x433bbd[_0x2e13('0x1e')]===_0x2e13('0x1f')&&typeof _0x433bbd['limit']==='undefined';var _0x2a3007=_0x5e96a5[_0x2e13('0x20')];var _0x336a10=_0xd25628?0x0:_0x433bbd[_0x2e13('0x1e')];var _0x399ce2=_0xd25628?_0x5e96a5[_0x2e13('0x20')]:_0x433bbd[_0x2e13('0x1e')]+_0x433bbd[_0x2e13('0x21')];var _0x4ae5e5;if(_0x399ce2>=_0x2a3007){_0x399ce2=_0x2a3007;_0x4ae5e5=0xc8;}else{_0x4ae5e5=0xce;}_0x2a58e5[_0x2e13('0x1c')](_0x4ae5e5);return _0x2a58e5[_0x2e13('0x22')](_0x2e13('0x23'),_0x336a10+'-'+_0x399ce2+'/'+_0x2a3007)[_0x2e13('0x1d')](_0x5e96a5);}return null;};}function patchUpdates(_0x479013){return function(_0x5d6938){try{jsonpatch[_0x2e13('0x24')](_0x5d6938,_0x479013,!![]);}catch(_0x1a05a4){return BPromise['reject'](_0x1a05a4);}return _0x5d6938['save']();};}function saveUpdates(_0x584040,_0x30f744){return function(_0x2b55a7){if(_0x2b55a7){return _0x2b55a7[_0x2e13('0x25')](_0x584040)[_0x2e13('0x26')](function(_0x17b453){return _0x17b453;});}return null;};}function removeEntity(_0x2416b3,_0x5ce58b){return function(_0x1482fc){if(_0x1482fc){return _0x1482fc[_0x2e13('0x27')]()[_0x2e13('0x26')](function(){_0x2416b3[_0x2e13('0x1c')](0xcc)[_0x2e13('0x28')]();});}};}function handleEntityNotFound(_0x3e5c24,_0x5cad4b){return function(_0x341ae7){if(!_0x341ae7){_0x3e5c24[_0x2e13('0x1b')](0x194);}return _0x341ae7;};}function handleError(_0x57aab0,_0x538984){_0x538984=_0x538984||0x1f4;return function(_0x15c555){logger[_0x2e13('0x29')](_0x15c555[_0x2e13('0x2a')]);if(_0x15c555['name']){delete _0x15c555[_0x2e13('0x2b')];}_0x57aab0[_0x2e13('0x1c')](_0x538984)[_0x2e13('0x2c')](_0x15c555);};}exports[_0x2e13('0x2d')]=function(_0x2c6e04,_0x428289){var _0x103867={},_0x19ee97={},_0x31f448={'count':0x0,'rows':[]};var _0x6e09d9=_[_0x2e13('0x2e')](db[_0x2e13('0x2f')][_0x2e13('0x30')],function(_0x28e2bf){return{'name':_0x28e2bf[_0x2e13('0x31')],'type':_0x28e2bf['type'][_0x2e13('0x32')]};});_0x19ee97[_0x2e13('0x33')]=_[_0x2e13('0x2e')](_0x6e09d9,'name');_0x19ee97['query']=_[_0x2e13('0x34')](_0x2c6e04[_0x2e13('0x35')]);_0x19ee97[_0x2e13('0x36')]=_[_0x2e13('0x37')](_0x19ee97[_0x2e13('0x33')],_0x19ee97[_0x2e13('0x35')]);_0x103867['attributes']=_['intersection'](_0x19ee97[_0x2e13('0x33')],qs[_0x2e13('0x38')](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x38')]));_0x103867[_0x2e13('0x39')]=_0x103867[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x103867[_0x2e13('0x39')]:_0x19ee97['model'];if(!_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3b')](_0x2e13('0x3c'))){_0x103867[_0x2e13('0x21')]=qs[_0x2e13('0x21')](_0x2c6e04['query'][_0x2e13('0x21')]);_0x103867[_0x2e13('0x1e')]=qs['offset'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x1e')]);}_0x103867[_0x2e13('0x3d')]=qs['sort'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3e')]);_0x103867['where']=qs[_0x2e13('0x36')](_[_0x2e13('0x3f')](_0x2c6e04['query'],_0x19ee97[_0x2e13('0x36')]),_0x6e09d9);if(_0x2c6e04['query'][_0x2e13('0x40')]){_0x103867[_0x2e13('0x41')]=_['merge'](_0x103867[_0x2e13('0x41')],{'$or':_[_0x2e13('0x2e')](_0x6e09d9,function(_0x3839b9){if(_0x3839b9[_0x2e13('0x42')]!==_0x2e13('0x43')){var _0x778214={};_0x778214[_0x3839b9[_0x2e13('0x2b')]]={'$like':'%'+_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x40')]+'%'};return _0x778214;}})});}_0x103867=_[_0x2e13('0x44')]({},_0x103867,_0x2c6e04['options']);var _0x24ebb6={'where':_0x103867[_0x2e13('0x41')]};return db[_0x2e13('0x2f')][_0x2e13('0x20')](_0x24ebb6)[_0x2e13('0x26')](function(_0x4b23ca){_0x31f448[_0x2e13('0x20')]=_0x4b23ca;if(_0x2c6e04['query'][_0x2e13('0x45')]){_0x103867[_0x2e13('0x46')]=[{'all':!![]}];}return db['Cdr'][_0x2e13('0x47')](_0x103867);})['then'](function(_0x73f6a2){_0x31f448[_0x2e13('0x48')]=_0x73f6a2;return _0x31f448;})[_0x2e13('0x26')](respondWithFilteredResult(_0x428289,_0x103867))[_0x2e13('0x49')](handleError(_0x428289,null));};exports[_0x2e13('0x4a')]=function(_0x52b1a0,_0x425c97){var _0x499a56={'raw':!![],'where':{'id':_0x52b1a0[_0x2e13('0x4b')]['id']}},_0x10a1ab={};_0x10a1ab[_0x2e13('0x33')]=_[_0x2e13('0x34')](db[_0x2e13('0x2f')][_0x2e13('0x30')]);_0x10a1ab['query']=_['keys'](_0x52b1a0[_0x2e13('0x35')]);_0x10a1ab[_0x2e13('0x36')]=_['intersection'](_0x10a1ab[_0x2e13('0x33')],_0x10a1ab[_0x2e13('0x35')]);_0x499a56[_0x2e13('0x39')]=_['intersection'](_0x10a1ab['model'],qs[_0x2e13('0x38')](_0x52b1a0['query']['fields']));_0x499a56[_0x2e13('0x39')]=_0x499a56[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x499a56['attributes']:_0x10a1ab[_0x2e13('0x33')];if(_0x52b1a0[_0x2e13('0x35')][_0x2e13('0x45')]){_0x499a56[_0x2e13('0x46')]=[{'all':!![]}];}_0x499a56=_['merge']({},_0x499a56,_0x52b1a0[_0x2e13('0x4c')]);return db['Cdr'][_0x2e13('0x4d')](_0x499a56)[_0x2e13('0x26')](handleEntityNotFound(_0x425c97,null))[_0x2e13('0x26')](respondWithResult(_0x425c97,null))[_0x2e13('0x49')](handleError(_0x425c97,null));};exports[_0x2e13('0x4e')]=function(_0x3be877,_0x961af7){return db[_0x2e13('0x2f')][_0x2e13('0x4e')](_0x3be877[_0x2e13('0x4f')],{})['then'](respondWithResult(_0x961af7,0xc9))[_0x2e13('0x49')](handleError(_0x961af7,null));};exports[_0x2e13('0x25')]=function(_0x4780b7,_0x1d13ec){if(_0x4780b7[_0x2e13('0x4f')]['id']){delete _0x4780b7[_0x2e13('0x4f')]['id'];}return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x4780b7[_0x2e13('0x4b')]['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0x1d13ec,null))[_0x2e13('0x26')](saveUpdates(_0x4780b7[_0x2e13('0x4f')],null))['then'](respondWithResult(_0x1d13ec,null))[_0x2e13('0x49')](handleError(_0x1d13ec,null));};exports[_0x2e13('0x27')]=function(_0x39cef0,_0xf40f35){return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x39cef0['params']['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0xf40f35,null))[_0x2e13('0x26')](removeEntity(_0xf40f35,null))[_0x2e13('0x49')](handleError(_0xf40f35,null));};exports[_0x2e13('0x50')]=function(_0x2a9587,_0x13b4f4){return db[_0x2e13('0x2f')]['describe']()[_0x2e13('0x26')](respondWithResult(_0x13b4f4,null))[_0x2e13('0x49')](handleError(_0x13b4f4,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 0771757..714161f 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(_0x4750b3,_0x1cec5e){var _0xc3904=function(_0x57dda3){while(--_0x57dda3){_0x4750b3['push'](_0x4750b3['shift']());}};_0xc3904(++_0x1cec5e);}(_0x7a54,0x106));var _0x47a5=function(_0x53b004,_0x9758b3){_0x53b004=_0x53b004-0x0;var _0x543ca2=_0x7a54[_0x53b004];return _0x543ca2;};'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(_0xd66b4b,_0x10b3ae){var _0x48e1ba=function(_0x338051){while(--_0x338051){_0xd66b4b['push'](_0xd66b4b['shift']());}};_0x48e1ba(++_0x10b3ae);}(_0x7a54,0x106));var _0x47a5=function(_0x2d7686,_0x13fa4c){_0x2d7686=_0x2d7686-0x0;var _0x2f1dc4=_0x7a54[_0x2d7686];return _0x2f1dc4;};'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 8ff96fc..d143866 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 _0x91f1=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x91f1,0x1e8));var _0x191f=function(_0x4eb24c,_0x368427){_0x4eb24c=_0x4eb24c-0x0;var _0x2e1f70=_0x91f1[_0x4eb24c];return _0x2e1f70;};'use strict';var _=require(_0x191f('0x0'));var util=require(_0x191f('0x1'));var moment=require('moment');var BPromise=require(_0x191f('0x2'));var rs=require(_0x191f('0x3'));var fs=require('fs');var Redis=require(_0x191f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x191f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x191f('0x6'));var jayson=require(_0x191f('0x7'));var client=jayson[_0x191f('0x8')][_0x191f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52d1b0,_0x424725,_0x8967e0){return new BPromise(function(_0x3600f4,_0xffe12c){return client[_0x191f('0xa')](_0x52d1b0,_0x8967e0)[_0x191f('0xb')](function(_0x376a4c){logger[_0x191f('0xc')](_0x191f('0xd'),_0x424725,_0x191f('0xe'));logger['debug'](_0x191f('0xf'),_0x424725,_0x191f('0xe'),JSON['stringify'](_0x376a4c));if(_0x376a4c[_0x191f('0x10')]){if(_0x376a4c[_0x191f('0x10')][_0x191f('0x11')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x424725,_0x376a4c['error'][_0x191f('0x12')]);return _0xffe12c(_0x376a4c['error'][_0x191f('0x12')]);}logger[_0x191f('0x10')]('Cdr,\x20%s,\x20%s',_0x424725,_0x376a4c[_0x191f('0x10')]['message']);return _0x3600f4(_0x376a4c[_0x191f('0x10')][_0x191f('0x12')]);}else{logger['info'](_0x191f('0xd'),_0x424725,_0x191f('0xe'));_0x3600f4(_0x376a4c[_0x191f('0x13')][_0x191f('0x12')]);}})[_0x191f('0x14')](function(_0x9edf37){logger[_0x191f('0x10')](_0x191f('0xd'),_0x424725,_0x9edf37);_0xffe12c(_0x9edf37);});});} \ No newline at end of file +var _0x36f3=['info','Cdr,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5ca62a,_0x3dffb9){var _0xcabff4=function(_0x48766a){while(--_0x48766a){_0x5ca62a['push'](_0x5ca62a['shift']());}};_0xcabff4(++_0x3dffb9);}(_0x36f3,0xb2));var _0x336f=function(_0x310b79,_0x1aee61){_0x310b79=_0x310b79-0x0;var _0x512082=_0x36f3[_0x310b79];return _0x512082;};'use strict';var _=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var moment=require('moment');var BPromise=require(_0x336f('0x2'));var rs=require(_0x336f('0x3'));var fs=require('fs');var Redis=require(_0x336f('0x4'));var db=require(_0x336f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x336f('0x6'))(_0x336f('0x7'));var config=require(_0x336f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x336f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x328102,_0x16811a,_0x863600){return new BPromise(function(_0x59340c,_0x50a93a){return client[_0x336f('0xa')](_0x328102,_0x863600)['then'](function(_0x3e7c5d){logger[_0x336f('0xb')](_0x336f('0xc'),_0x16811a,'request\x20sent');logger[_0x336f('0xd')]('Cdr,\x20%s,\x20%s,\x20%s',_0x16811a,_0x336f('0xe'),JSON[_0x336f('0xf')](_0x3e7c5d));if(_0x3e7c5d[_0x336f('0x10')]){if(_0x3e7c5d[_0x336f('0x10')][_0x336f('0x11')]===0x1f4){logger[_0x336f('0x10')](_0x336f('0xc'),_0x16811a,_0x3e7c5d[_0x336f('0x10')]['message']);return _0x50a93a(_0x3e7c5d[_0x336f('0x10')][_0x336f('0x12')]);}logger[_0x336f('0x10')](_0x336f('0xc'),_0x16811a,_0x3e7c5d[_0x336f('0x10')]['message']);return _0x59340c(_0x3e7c5d[_0x336f('0x10')][_0x336f('0x12')]);}else{logger[_0x336f('0xb')](_0x336f('0xc'),_0x16811a,'request\x20sent');_0x59340c(_0x3e7c5d[_0x336f('0x13')][_0x336f('0x12')]);}})[_0x336f('0x14')](function(_0x28880a){logger[_0x336f('0x10')](_0x336f('0xc'),_0x16811a,_0x28880a);_0x50a93a(_0x28880a);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 0ad5e84..989e753 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x19b3f8,_0x150751){var _0x22c3a1=function(_0x16bf0a){while(--_0x16bf0a){_0x19b3f8['push'](_0x19b3f8['shift']());}};_0x22c3a1(++_0x150751);}(_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 bbaa359..1e3ff06 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 _0xc95c=['exports','INTEGER','STRING','noop','TEXT','sequelize'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xc95c,0x13d));var _0xcc95=function(_0x57ddec,_0x26ae0c){_0x57ddec=_0x57ddec-0x0;var _0x4d5d1d=_0xc95c[_0x57ddec];return _0x4d5d1d;};'use strict';var Sequelize=require(_0xcc95('0x0'));module[_0xcc95('0x1')]={'priority':{'type':Sequelize[_0xcc95('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcc95('0x3')],'allowNull':![],'defaultValue':_0xcc95('0x4')},'appdata':{'type':Sequelize[_0xcc95('0x5')]()},'description':{'type':Sequelize[_0xcc95('0x3')]},'interval':{'type':Sequelize[_0xcc95('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xbc72=['STRING','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc72,0x18e));var _0x2bc7=function(_0x3daf7d,_0x50795d){_0x3daf7d=_0x3daf7d-0x0;var _0x4646d0=_0xbc72[_0x3daf7d];return _0x4646d0;};'use strict';var Sequelize=require(_0x2bc7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2bc7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2bc7('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2bc7('0x3')]()},'description':{'type':Sequelize[_0x2bc7('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2bc7('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b2e1a3e..58130a8 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 _0xc2cc=['fields','attributes','length','merge','options','find','catch','body','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','params','model','keys','ChatApplication','rawAttributes','query','intersection'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0xc2cc,0x70));var _0xcc2c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc2cc[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc2c('0x0'));var zipdir=require(_0xcc2c('0x1'));var jsonpatch=require(_0xcc2c('0x2'));var rp=require('request-promise');var moment=require(_0xcc2c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcc2c('0x4'));var util=require('util');var path=require(_0xcc2c('0x5'));var sox=require('sox');var csv=require(_0xcc2c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc2c('0x7'));var squel=require('squel');var crypto=require(_0xcc2c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xcc2c('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc2c('0xa'));var Redis=require(_0xcc2c('0xb'));var authService=require(_0xcc2c('0xc'));var qs=require(_0xcc2c('0xd'));var as=require(_0xcc2c('0xe'));var hardwareService=require(_0xcc2c('0xf'));var logger=require(_0xcc2c('0x10'))(_0xcc2c('0x11'));var utils=require('../../config/utils');var config=require(_0xcc2c('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc2c('0x13'))['db'];function respondWithStatusCode(_0x42294d,_0x3900a4){_0x3900a4=_0x3900a4||0xcc;return function(_0x1f6f0f){if(_0x1f6f0f){return _0x42294d['sendStatus'](_0x3900a4);}return _0x42294d['status'](_0x3900a4)['end']();};}function respondWithResult(_0x2cab27,_0xc1cafd){_0xc1cafd=_0xc1cafd||0xc8;return function(_0x5086f2){if(_0x5086f2){return _0x2cab27['status'](_0xc1cafd)[_0xcc2c('0x14')](_0x5086f2);}};}function respondWithFilteredResult(_0x494f3d,_0x18a774){return function(_0x344caa){if(_0x344caa){var _0x10a651=typeof _0x18a774[_0xcc2c('0x15')]==='undefined'&&typeof _0x18a774['limit']===_0xcc2c('0x16');var _0xe04b56=_0x344caa['count'];var _0x31849a=_0x10a651?0x0:_0x18a774[_0xcc2c('0x15')];var _0x440458=_0x10a651?_0x344caa[_0xcc2c('0x17')]:_0x18a774[_0xcc2c('0x15')]+_0x18a774[_0xcc2c('0x18')];var _0x36969f;if(_0x440458>=_0xe04b56){_0x440458=_0xe04b56;_0x36969f=0xc8;}else{_0x36969f=0xce;}_0x494f3d['status'](_0x36969f);return _0x494f3d[_0xcc2c('0x19')](_0xcc2c('0x1a'),_0x31849a+'-'+_0x440458+'/'+_0xe04b56)['json'](_0x344caa);}return null;};}function patchUpdates(_0x4d22fe){return function(_0x4a67f4){try{jsonpatch[_0xcc2c('0x1b')](_0x4a67f4,_0x4d22fe,!![]);}catch(_0x58f3cb){return BPromise[_0xcc2c('0x1c')](_0x58f3cb);}return _0x4a67f4[_0xcc2c('0x1d')]();};}function saveUpdates(_0x5b8ade,_0x321279){return function(_0x831360){if(_0x831360){return _0x831360['update'](_0x5b8ade)[_0xcc2c('0x1e')](function(_0x510f36){return _0x510f36;});}return null;};}function removeEntity(_0x31788d,_0x5233e3){return function(_0x4d5132){if(_0x4d5132){return _0x4d5132[_0xcc2c('0x1f')]()[_0xcc2c('0x1e')](function(){_0x31788d['status'](0xcc)[_0xcc2c('0x20')]();});}};}function handleEntityNotFound(_0x1d3f8d,_0x3129d3){return function(_0x98ae06){if(!_0x98ae06){_0x1d3f8d[_0xcc2c('0x21')](0x194);}return _0x98ae06;};}function handleError(_0x1aa33c,_0x4aeb24){_0x4aeb24=_0x4aeb24||0x1f4;return function(_0xaab877){logger[_0xcc2c('0x22')](_0xaab877[_0xcc2c('0x23')]);if(_0xaab877[_0xcc2c('0x24')]){delete _0xaab877[_0xcc2c('0x24')];}_0x1aa33c['status'](_0x4aeb24)['send'](_0xaab877);};}exports['show']=function(_0x54ea89,_0x28bb05){var _0x168ef6={'raw':!![],'where':{'id':_0x54ea89[_0xcc2c('0x25')]['id']}},_0x406515={};_0x406515[_0xcc2c('0x26')]=_[_0xcc2c('0x27')](db[_0xcc2c('0x28')][_0xcc2c('0x29')]);_0x406515[_0xcc2c('0x2a')]=_[_0xcc2c('0x27')](_0x54ea89[_0xcc2c('0x2a')]);_0x406515['filters']=_[_0xcc2c('0x2b')](_0x406515['model'],_0x406515['query']);_0x168ef6['attributes']=_[_0xcc2c('0x2b')](_0x406515[_0xcc2c('0x26')],qs['fields'](_0x54ea89['query'][_0xcc2c('0x2c')]));_0x168ef6['attributes']=_0x168ef6[_0xcc2c('0x2d')][_0xcc2c('0x2e')]?_0x168ef6[_0xcc2c('0x2d')]:_0x406515[_0xcc2c('0x26')];if(_0x54ea89[_0xcc2c('0x2a')]['includeAll']){_0x168ef6['include']=[{'all':!![]}];}_0x168ef6=_[_0xcc2c('0x2f')]({},_0x168ef6,_0x54ea89[_0xcc2c('0x30')]);return db[_0xcc2c('0x28')][_0xcc2c('0x31')](_0x168ef6)[_0xcc2c('0x1e')](handleEntityNotFound(_0x28bb05,null))['then'](respondWithResult(_0x28bb05,null))[_0xcc2c('0x32')](handleError(_0x28bb05,null));};exports['update']=function(_0x3b0f1c,_0x206b7f){if(_0x3b0f1c['body']['id']){delete _0x3b0f1c[_0xcc2c('0x33')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x3b0f1c[_0xcc2c('0x25')]['id']}})['then'](handleEntityNotFound(_0x206b7f,null))[_0xcc2c('0x1e')](saveUpdates(_0x3b0f1c[_0xcc2c('0x33')],null))[_0xcc2c('0x1e')](respondWithResult(_0x206b7f,null))['catch'](handleError(_0x206b7f,null));};exports[_0xcc2c('0x1f')]=function(_0x37af66,_0x53ecf9){return db[_0xcc2c('0x28')]['find']({'where':{'id':_0x37af66[_0xcc2c('0x25')]['id']}})['then'](handleEntityNotFound(_0x53ecf9,null))[_0xcc2c('0x1e')](removeEntity(_0x53ecf9,null))[_0xcc2c('0x32')](handleError(_0x53ecf9,null));}; \ No newline at end of file +var _0xdb76=['Content-Range','apply','reject','save','then','destroy','end','error','stack','send','show','params','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','merge','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0xdb76,0x1be));var _0x6db7=function(_0x30dd0c,_0x413065){_0x30dd0c=_0x30dd0c-0x0;var _0x462603=_0xdb76[_0x30dd0c];return _0x462603;};'use strict';var emlformat=require(_0x6db7('0x0'));var rimraf=require(_0x6db7('0x1'));var zipdir=require(_0x6db7('0x2'));var jsonpatch=require(_0x6db7('0x3'));var rp=require(_0x6db7('0x4'));var moment=require('moment');var BPromise=require(_0x6db7('0x5'));var Mustache=require(_0x6db7('0x6'));var util=require(_0x6db7('0x7'));var path=require(_0x6db7('0x8'));var sox=require('sox');var csv=require(_0x6db7('0x9'));var ejs=require(_0x6db7('0xa'));var fs=require('fs');var fs_extra=require(_0x6db7('0xb'));var _=require(_0x6db7('0xc'));var squel=require(_0x6db7('0xd'));var crypto=require('crypto');var jsforce=require(_0x6db7('0xe'));var deskjs=require(_0x6db7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6db7('0x10'));var Papa=require(_0x6db7('0x11'));var Redis=require(_0x6db7('0x12'));var authService=require(_0x6db7('0x13'));var qs=require(_0x6db7('0x14'));var as=require(_0x6db7('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6db7('0x16'));var utils=require(_0x6db7('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6db7('0x18'));var db=require(_0x6db7('0x19'))['db'];function respondWithStatusCode(_0x421d28,_0x1658dd){_0x1658dd=_0x1658dd||0xcc;return function(_0x375f4a){if(_0x375f4a){return _0x421d28[_0x6db7('0x1a')](_0x1658dd);}return _0x421d28['status'](_0x1658dd)['end']();};}function respondWithResult(_0x426d31,_0x348ccf){_0x348ccf=_0x348ccf||0xc8;return function(_0x167384){if(_0x167384){return _0x426d31[_0x6db7('0x1b')](_0x348ccf)[_0x6db7('0x1c')](_0x167384);}};}function respondWithFilteredResult(_0x28dd67,_0x144684){return function(_0x43f66c){if(_0x43f66c){var _0x1432ac=typeof _0x144684[_0x6db7('0x1d')]===_0x6db7('0x1e')&&typeof _0x144684[_0x6db7('0x1f')]==='undefined';var _0x3c97b2=_0x43f66c[_0x6db7('0x20')];var _0x331e92=_0x1432ac?0x0:_0x144684[_0x6db7('0x1d')];var _0x37ffe3=_0x1432ac?_0x43f66c[_0x6db7('0x20')]:_0x144684[_0x6db7('0x1d')]+_0x144684[_0x6db7('0x1f')];var _0x3f8575;if(_0x37ffe3>=_0x3c97b2){_0x37ffe3=_0x3c97b2;_0x3f8575=0xc8;}else{_0x3f8575=0xce;}_0x28dd67[_0x6db7('0x1b')](_0x3f8575);return _0x28dd67[_0x6db7('0x21')](_0x6db7('0x22'),_0x331e92+'-'+_0x37ffe3+'/'+_0x3c97b2)['json'](_0x43f66c);}return null;};}function patchUpdates(_0x1cae66){return function(_0x206aa2){try{jsonpatch[_0x6db7('0x23')](_0x206aa2,_0x1cae66,!![]);}catch(_0x46a383){return BPromise[_0x6db7('0x24')](_0x46a383);}return _0x206aa2[_0x6db7('0x25')]();};}function saveUpdates(_0x4a78f7,_0x1b0f04){return function(_0x2795ab){if(_0x2795ab){return _0x2795ab['update'](_0x4a78f7)[_0x6db7('0x26')](function(_0x1ba956){return _0x1ba956;});}return null;};}function removeEntity(_0x7ca54f,_0x48e3af){return function(_0x24d818){if(_0x24d818){return _0x24d818[_0x6db7('0x27')]()['then'](function(){_0x7ca54f[_0x6db7('0x1b')](0xcc)[_0x6db7('0x28')]();});}};}function handleEntityNotFound(_0x2d6fca,_0x558d58){return function(_0x559e14){if(!_0x559e14){_0x2d6fca[_0x6db7('0x1a')](0x194);}return _0x559e14;};}function handleError(_0x105b81,_0xdbd9f1){_0xdbd9f1=_0xdbd9f1||0x1f4;return function(_0x4f28e9){logger[_0x6db7('0x29')](_0x4f28e9[_0x6db7('0x2a')]);if(_0x4f28e9['name']){delete _0x4f28e9['name'];}_0x105b81[_0x6db7('0x1b')](_0xdbd9f1)[_0x6db7('0x2b')](_0x4f28e9);};}exports[_0x6db7('0x2c')]=function(_0x3890f0,_0x11185d){var _0xc4f615={'raw':!![],'where':{'id':_0x3890f0[_0x6db7('0x2d')]['id']}},_0x4fb6dd={};_0x4fb6dd[_0x6db7('0x2e')]=_['keys'](db[_0x6db7('0x2f')]['rawAttributes']);_0x4fb6dd[_0x6db7('0x30')]=_[_0x6db7('0x31')](_0x3890f0[_0x6db7('0x30')]);_0x4fb6dd[_0x6db7('0x32')]=_['intersection'](_0x4fb6dd[_0x6db7('0x2e')],_0x4fb6dd[_0x6db7('0x30')]);_0xc4f615[_0x6db7('0x33')]=_[_0x6db7('0x34')](_0x4fb6dd[_0x6db7('0x2e')],qs['fields'](_0x3890f0[_0x6db7('0x30')][_0x6db7('0x35')]));_0xc4f615[_0x6db7('0x33')]=_0xc4f615['attributes'][_0x6db7('0x36')]?_0xc4f615[_0x6db7('0x33')]:_0x4fb6dd[_0x6db7('0x2e')];if(_0x3890f0['query'][_0x6db7('0x37')]){_0xc4f615['include']=[{'all':!![]}];}_0xc4f615=_[_0x6db7('0x38')]({},_0xc4f615,_0x3890f0['options']);return db['ChatApplication'][_0x6db7('0x39')](_0xc4f615)[_0x6db7('0x26')](handleEntityNotFound(_0x11185d,null))[_0x6db7('0x26')](respondWithResult(_0x11185d,null))[_0x6db7('0x3a')](handleError(_0x11185d,null));};exports['update']=function(_0x5cfca3,_0x3f7973){if(_0x5cfca3[_0x6db7('0x3b')]['id']){delete _0x5cfca3['body']['id'];}return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x5cfca3[_0x6db7('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3f7973,null))[_0x6db7('0x26')](saveUpdates(_0x5cfca3['body'],null))['then'](respondWithResult(_0x3f7973,null))[_0x6db7('0x3a')](handleError(_0x3f7973,null));};exports[_0x6db7('0x27')]=function(_0x384fbf,_0x20b875){return db[_0x6db7('0x2f')]['find']({'where':{'id':_0x384fbf[_0x6db7('0x2d')]['id']}})[_0x6db7('0x26')](handleEntityNotFound(_0x20b875,null))[_0x6db7('0x26')](removeEntity(_0x20b875,null))[_0x6db7('0x3a')](handleError(_0x20b875,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b3e7f1f..499df5f 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 _0x7a37=['util','../../config/logger','api','moment','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x2ca9cf,_0x50833b){var _0x56fc0f=function(_0x5bc7e9){while(--_0x5bc7e9){_0x2ca9cf['push'](_0x2ca9cf['shift']());}};_0x56fc0f(++_0x50833b);}(_0x7a37,0xdf));var _0x77a3=function(_0x29f9ec,_0x40e567){_0x29f9ec=_0x29f9ec-0x0;var _0x44d184=_0x7a37[_0x29f9ec];return _0x44d184;};'use strict';var _=require(_0x77a3('0x0'));var util=require(_0x77a3('0x1'));var logger=require(_0x77a3('0x2'))(_0x77a3('0x3'));var moment=require(_0x77a3('0x4'));var BPromise=require('bluebird');var rp=require(_0x77a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x77a3('0x6'));var attributes=require(_0x77a3('0x7'));module[_0x77a3('0x8')]=function(_0x33b1e2,_0x48a5ae){return _0x33b1e2[_0x77a3('0x9')](_0x77a3('0xa'),attributes,{'tableName':_0x77a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x77a3('0xc'),'collate':_0x77a3('0xd')});}; \ No newline at end of file +var _0x73a0=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4c3397,_0x1c899c){var _0x5065c9=function(_0x56776c){while(--_0x56776c){_0x4c3397['push'](_0x4c3397['shift']());}};_0x5065c9(++_0x1c899c);}(_0x73a0,0x1bb));var _0x073a=function(_0x34aacd,_0x2a2b79){_0x34aacd=_0x34aacd-0x0;var _0x57f210=_0x73a0[_0x34aacd];return _0x57f210;};'use strict';var _=require(_0x073a('0x0'));var util=require(_0x073a('0x1'));var logger=require(_0x073a('0x2'))(_0x073a('0x3'));var moment=require(_0x073a('0x4'));var BPromise=require(_0x073a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x073a('0x6'));var rimraf=require(_0x073a('0x7'));var config=require(_0x073a('0x8'));var attributes=require(_0x073a('0x9'));module[_0x073a('0xa')]=function(_0x5a54bb,_0x2d5233){return _0x5a54bb[_0x073a('0xb')]('ChatApplication',attributes,{'tableName':_0x073a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x073a('0xd'),'collate':_0x073a('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 0d32104..b0db660 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 _0xa427=['http','request','then','info','request\x20sent','debug','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x2448ef,_0x1be3dc){var _0x56ef83=function(_0xfb0ec9){while(--_0xfb0ec9){_0x2448ef['push'](_0x2448ef['shift']());}};_0x56ef83(++_0x1be3dc);}(_0xa427,0x75));var _0x7a42=function(_0x3c057d,_0x15604){_0x3c057d=_0x3c057d-0x0;var _0x3b87fe=_0xa427[_0x3c057d];return _0x3b87fe;};'use strict';var _=require(_0x7a42('0x0'));var util=require('util');var moment=require(_0x7a42('0x1'));var BPromise=require(_0x7a42('0x2'));var rs=require(_0x7a42('0x3'));var fs=require('fs');var Redis=require(_0x7a42('0x4'));var db=require(_0x7a42('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a42('0x6'));var config=require('../../config/environment');var jayson=require(_0x7a42('0x7'));var client=jayson[_0x7a42('0x8')][_0x7a42('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf204,_0x26dd18,_0x2ff7d5){return new BPromise(function(_0x54d4ca,_0x2fc69b){return client[_0x7a42('0xa')](_0x2bf204,_0x2ff7d5)[_0x7a42('0xb')](function(_0x52c719){logger[_0x7a42('0xc')]('ChatApplication,\x20%s,\x20%s',_0x26dd18,_0x7a42('0xd'));logger[_0x7a42('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x26dd18,_0x7a42('0xd'),JSON['stringify'](_0x52c719));if(_0x52c719['error']){if(_0x52c719[_0x7a42('0xf')][_0x7a42('0x10')]===0x1f4){logger[_0x7a42('0xf')](_0x7a42('0x11'),_0x26dd18,_0x52c719[_0x7a42('0xf')]['message']);return _0x2fc69b(_0x52c719[_0x7a42('0xf')][_0x7a42('0x12')]);}logger[_0x7a42('0xf')](_0x7a42('0x11'),_0x26dd18,_0x52c719[_0x7a42('0xf')][_0x7a42('0x12')]);return _0x54d4ca(_0x52c719[_0x7a42('0xf')][_0x7a42('0x12')]);}else{logger[_0x7a42('0xc')](_0x7a42('0x11'),_0x26dd18,_0x7a42('0xd'));_0x54d4ca(_0x52c719[_0x7a42('0x13')]['message']);}})[_0x7a42('0x14')](function(_0x4dde19){logger[_0x7a42('0xf')]('ChatApplication,\x20%s,\x20%s',_0x26dd18,_0x4dde19);_0x2fc69b(_0x4dde19);});});} \ No newline at end of file +var _0x2f36=['request\x20sent','stringify','error','code','message','info','result','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x69936b,_0x98c9f2){var _0x5c91c9=function(_0x22b883){while(--_0x22b883){_0x69936b['push'](_0x69936b['shift']());}};_0x5c91c9(++_0x98c9f2);}(_0x2f36,0x1d5));var _0x62f3=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x2f36[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x62f3('0x0'));var util=require(_0x62f3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62f3('0x2'));var db=require(_0x62f3('0x3'))['db'];var utils=require(_0x62f3('0x4'));var logger=require('../../config/logger')(_0x62f3('0x5'));var config=require(_0x62f3('0x6'));var jayson=require(_0x62f3('0x7'));var client=jayson[_0x62f3('0x8')][_0x62f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5713,_0x23cc1e,_0xebb41){return new BPromise(function(_0x5a9c18,_0x1ba96a){return client[_0x62f3('0xa')](_0x2b5713,_0xebb41)[_0x62f3('0xb')](function(_0xec1591){logger['info'](_0x62f3('0xc'),_0x23cc1e,'request\x20sent');logger[_0x62f3('0xd')](_0x62f3('0xe'),_0x23cc1e,_0x62f3('0xf'),JSON[_0x62f3('0x10')](_0xec1591));if(_0xec1591[_0x62f3('0x11')]){if(_0xec1591[_0x62f3('0x11')][_0x62f3('0x12')]===0x1f4){logger[_0x62f3('0x11')](_0x62f3('0xc'),_0x23cc1e,_0xec1591[_0x62f3('0x11')][_0x62f3('0x13')]);return _0x1ba96a(_0xec1591['error'][_0x62f3('0x13')]);}logger[_0x62f3('0x11')](_0x62f3('0xc'),_0x23cc1e,_0xec1591['error']['message']);return _0x5a9c18(_0xec1591[_0x62f3('0x11')][_0x62f3('0x13')]);}else{logger[_0x62f3('0x14')](_0x62f3('0xc'),_0x23cc1e,'request\x20sent');_0x5a9c18(_0xec1591[_0x62f3('0x15')][_0x62f3('0x13')]);}})['catch'](function(_0x4be932){logger[_0x62f3('0x11')](_0x62f3('0xc'),_0x23cc1e,_0x4be932);_0x1ba96a(_0x4be932);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 5c23566..580a3ce 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 _0xfe53=['Router','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','express'];(function(_0xd5e6d5,_0x349bc5){var _0x22c48b=function(_0x42fd59){while(--_0x42fd59){_0xd5e6d5['push'](_0xd5e6d5['shift']());}};_0x22c48b(++_0x349bc5);}(_0xfe53,0x123));var _0x3fe5=function(_0x26e0a4,_0x41c372){_0x26e0a4=_0x26e0a4-0x0;var _0x209666=_0xfe53[_0x26e0a4];return _0x209666;};'use strict';var multer=require('multer');var util=require(_0x3fe5('0x0'));var path=require(_0x3fe5('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fe5('0x2'));var router=express[_0x3fe5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fe5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3fe5('0x5'));router[_0x3fe5('0x6')](_0x3fe5('0x7'),auth[_0x3fe5('0x8')](),controller[_0x3fe5('0x9')]);router[_0x3fe5('0xa')]('/:id',auth[_0x3fe5('0x8')](),controller[_0x3fe5('0xb')]);router[_0x3fe5('0xc')](_0x3fe5('0x7'),auth[_0x3fe5('0x8')](),controller[_0x3fe5('0xd')]);module['exports']=router; \ No newline at end of file +var _0xc12e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','update','destroy','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0xc12e,0x86));var _0xec12=function(_0x4de259,_0x5d4033){_0x4de259=_0x4de259-0x0;var _0xdd1a3d=_0xc12e[_0x4de259];return _0xdd1a3d;};'use strict';var multer=require('multer');var util=require(_0xec12('0x0'));var path=require(_0xec12('0x1'));var timeout=require(_0xec12('0x2'));var express=require(_0xec12('0x3'));var router=express[_0xec12('0x4')]();var fs_extra=require(_0xec12('0x5'));var auth=require(_0xec12('0x6'));var interaction=require(_0xec12('0x7'));var config=require(_0xec12('0x8'));var controller=require('./chatApplication.controller');router[_0xec12('0x9')](_0xec12('0xa'),auth[_0xec12('0xb')](),controller['show']);router['put']('/:id',auth[_0xec12('0xb')](),controller[_0xec12('0xc')]);router['delete'](_0xec12('0xa'),auth['isAuthenticated'](),controller[_0xec12('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 817e484..8dab25f 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 _0x494e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x41456f,_0x53d926){var _0x2e6854=function(_0x63efd4){while(--_0x63efd4){_0x41456f['push'](_0x41456f['shift']());}};_0x2e6854(++_0x53d926);}(_0x494e,0x16d));var _0xe494=function(_0x44db5c,_0x1279c5){_0x44db5c=_0x44db5c-0x0;var _0xf32f4b=_0x494e[_0x44db5c];return _0xf32f4b;};'use strict';var Sequelize=require(_0xe494('0x0'));module[_0xe494('0x1')]={'name':{'type':Sequelize[_0xe494('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe494('0x2')]},'write':{'type':Sequelize[_0xe494('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2544=['exports','STRING','BOOLEAN'];(function(_0x4410cb,_0x7bb767){var _0x38b7b5=function(_0x4c4d5d){while(--_0x4c4d5d){_0x4410cb['push'](_0x4410cb['shift']());}};_0x38b7b5(++_0x7bb767);}(_0x2544,0x1ec));var _0x4254=function(_0x4bf1c6,_0x1860cf){_0x4bf1c6=_0x4bf1c6-0x0;var _0x408203=_0x2544[_0x4bf1c6];return _0x408203;};'use strict';var Sequelize=require('sequelize');module[_0x4254('0x0')]={'name':{'type':Sequelize[_0x4254('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4254('0x1')]},'write':{'type':Sequelize[_0x4254('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 54480cd..23a341a 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 _0x1101=['set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','include','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','User','getMembers','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','eml-format','rimraf','zip-dir','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','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x381005,_0x2b3564){var _0x7fb157=function(_0x1e1ae0){while(--_0x1e1ae0){_0x381005['push'](_0x381005['shift']());}};_0x7fb157(++_0x2b3564);}(_0x1101,0x1d1));var _0x1110=function(_0xa39d59,_0x1fd6a6){_0xa39d59=_0xa39d59-0x0;var _0x53b4e8=_0x1101[_0xa39d59];return _0x53b4e8;};'use strict';var emlformat=require(_0x1110('0x0'));var rimraf=require(_0x1110('0x1'));var zipdir=require(_0x1110('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1110('0x3'));var BPromise=require(_0x1110('0x4'));var Mustache=require(_0x1110('0x5'));var util=require(_0x1110('0x6'));var path=require('path');var sox=require(_0x1110('0x7'));var csv=require(_0x1110('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1110('0x9'));var _=require(_0x1110('0xa'));var squel=require(_0x1110('0xb'));var crypto=require(_0x1110('0xc'));var jsforce=require(_0x1110('0xd'));var deskjs=require(_0x1110('0xe'));var toCsv=require(_0x1110('0x8'));var querystring=require(_0x1110('0xf'));var Papa=require(_0x1110('0x10'));var Redis=require(_0x1110('0x11'));var authService=require(_0x1110('0x12'));var qs=require(_0x1110('0x13'));var as=require(_0x1110('0x14'));var hardwareService=require(_0x1110('0x15'));var logger=require(_0x1110('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1110('0x17'));var licenseUtil=require(_0x1110('0x18'));var db=require(_0x1110('0x19'))['db'];config['redis']=_[_0x1110('0x1a')](config[_0x1110('0x1b')],{'host':_0x1110('0x1c'),'port':0x18eb});var socket=require(_0x1110('0x1d'))(new Redis(config['redis']));require(_0x1110('0x1e'))[_0x1110('0x1f')](socket);function respondWithStatusCode(_0x2bc109,_0x1e4b4b){_0x1e4b4b=_0x1e4b4b||0xcc;return function(_0x3243f2){if(_0x3243f2){return _0x2bc109[_0x1110('0x20')](_0x1e4b4b);}return _0x2bc109[_0x1110('0x21')](_0x1e4b4b)[_0x1110('0x22')]();};}function respondWithResult(_0x3fa60d,_0x3af84d){_0x3af84d=_0x3af84d||0xc8;return function(_0x2dfc69){if(_0x2dfc69){return _0x3fa60d[_0x1110('0x21')](_0x3af84d)[_0x1110('0x23')](_0x2dfc69);}};}function respondWithFilteredResult(_0xaa612c,_0x94414a){return function(_0x2731be){if(_0x2731be){var _0x2e8988=typeof _0x94414a[_0x1110('0x24')]===_0x1110('0x25')&&typeof _0x94414a[_0x1110('0x26')]===_0x1110('0x25');var _0x53bcd1=_0x2731be[_0x1110('0x27')];var _0x47b7d0=_0x2e8988?0x0:_0x94414a['offset'];var _0x305c7c=_0x2e8988?_0x2731be[_0x1110('0x27')]:_0x94414a['offset']+_0x94414a[_0x1110('0x26')];var _0x274021;if(_0x305c7c>=_0x53bcd1){_0x305c7c=_0x53bcd1;_0x274021=0xc8;}else{_0x274021=0xce;}_0xaa612c[_0x1110('0x21')](_0x274021);return _0xaa612c[_0x1110('0x28')](_0x1110('0x29'),_0x47b7d0+'-'+_0x305c7c+'/'+_0x53bcd1)['json'](_0x2731be);}return null;};}function patchUpdates(_0x3bb96f){return function(_0x3cff52){try{jsonpatch[_0x1110('0x2a')](_0x3cff52,_0x3bb96f,!![]);}catch(_0x1e01aa){return BPromise[_0x1110('0x2b')](_0x1e01aa);}return _0x3cff52['save']();};}function saveUpdates(_0x5f2abe,_0x5e2b5a){return function(_0x157cea){if(_0x157cea){return _0x157cea[_0x1110('0x2c')](_0x5f2abe)[_0x1110('0x2d')](function(_0x2e1cee){return _0x2e1cee;});}return null;};}function removeEntity(_0x593ee4,_0x436325){return function(_0x53b7fc){if(_0x53b7fc){return _0x53b7fc[_0x1110('0x2e')]()['then'](function(){_0x593ee4[_0x1110('0x21')](0xcc)[_0x1110('0x22')]();});}};}function handleEntityNotFound(_0x5b0fc5,_0x335571){return function(_0x958383){if(!_0x958383){_0x5b0fc5['sendStatus'](0x194);}return _0x958383;};}function handleError(_0x13d6ea,_0x172a85){_0x172a85=_0x172a85||0x1f4;return function(_0x5a04d5){logger[_0x1110('0x2f')](_0x5a04d5[_0x1110('0x30')]);if(_0x5a04d5['name']){delete _0x5a04d5[_0x1110('0x31')];}_0x13d6ea['status'](_0x172a85)[_0x1110('0x32')](_0x5a04d5);};}exports[_0x1110('0x33')]=function(_0x3a685e,_0x58905e){var _0x339a7a={},_0x32511d={},_0x59d764={'count':0x0,'rows':[]};var _0x22ea91=_[_0x1110('0x34')](db[_0x1110('0x35')][_0x1110('0x36')],function(_0x1ab85b){return{'name':_0x1ab85b[_0x1110('0x37')],'type':_0x1ab85b[_0x1110('0x38')][_0x1110('0x39')]};});_0x32511d[_0x1110('0x3a')]=_['map'](_0x22ea91,_0x1110('0x31'));_0x32511d[_0x1110('0x3b')]=_[_0x1110('0x3c')](_0x3a685e[_0x1110('0x3b')]);_0x32511d[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x32511d[_0x1110('0x3a')],_0x32511d[_0x1110('0x3b')]);_0x339a7a[_0x1110('0x3f')]=_[_0x1110('0x3e')](_0x32511d[_0x1110('0x3a')],qs[_0x1110('0x40')](_0x3a685e[_0x1110('0x3b')]['fields']));_0x339a7a['attributes']=_0x339a7a[_0x1110('0x3f')][_0x1110('0x41')]?_0x339a7a['attributes']:_0x32511d[_0x1110('0x3a')];if(!_0x3a685e[_0x1110('0x3b')]['hasOwnProperty'](_0x1110('0x42'))){_0x339a7a[_0x1110('0x26')]=qs['limit'](_0x3a685e[_0x1110('0x3b')][_0x1110('0x26')]);_0x339a7a[_0x1110('0x24')]=qs[_0x1110('0x24')](_0x3a685e['query'][_0x1110('0x24')]);}_0x339a7a[_0x1110('0x43')]=qs[_0x1110('0x44')](_0x3a685e[_0x1110('0x3b')]['sort']);_0x339a7a[_0x1110('0x45')]=qs['filters'](_[_0x1110('0x46')](_0x3a685e[_0x1110('0x3b')],_0x32511d[_0x1110('0x3d')]),_0x22ea91);if(_0x3a685e['query']['filter']){_0x339a7a['where']=_[_0x1110('0x47')](_0x339a7a[_0x1110('0x45')],{'$or':_[_0x1110('0x34')](_0x22ea91,function(_0x1ca85f){if(_0x1ca85f[_0x1110('0x38')]!==_0x1110('0x48')){var _0x3e52c0={};_0x3e52c0[_0x1ca85f[_0x1110('0x31')]]={'$like':'%'+_0x3a685e[_0x1110('0x3b')][_0x1110('0x49')]+'%'};return _0x3e52c0;}})});}_0x339a7a=_[_0x1110('0x47')]({},_0x339a7a,_0x3a685e[_0x1110('0x4a')]);var _0x3fb5bc={'where':_0x339a7a[_0x1110('0x45')]};return db['ChatGroup'][_0x1110('0x27')](_0x3fb5bc)[_0x1110('0x2d')](function(_0x22c689){_0x59d764[_0x1110('0x27')]=_0x22c689;if(_0x3a685e['query'][_0x1110('0x4b')]){_0x339a7a['include']=[{'all':!![]}];}return db[_0x1110('0x35')]['findAll'](_0x339a7a);})[_0x1110('0x2d')](function(_0x212e09){_0x59d764[_0x1110('0x4c')]=_0x212e09;return _0x59d764;})[_0x1110('0x2d')](respondWithFilteredResult(_0x58905e,_0x339a7a))[_0x1110('0x4d')](handleError(_0x58905e,null));};exports[_0x1110('0x4e')]=function(_0x304f69,_0x554ec8){var _0x103d0e={'raw':!![],'where':{'id':_0x304f69[_0x1110('0x4f')]['id']}},_0x4e323e={};_0x4e323e[_0x1110('0x3a')]=_['keys'](db[_0x1110('0x35')][_0x1110('0x36')]);_0x4e323e[_0x1110('0x3b')]=_[_0x1110('0x3c')](_0x304f69[_0x1110('0x3b')]);_0x4e323e[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x4e323e[_0x1110('0x3a')],_0x4e323e[_0x1110('0x3b')]);_0x103d0e['attributes']=_['intersection'](_0x4e323e[_0x1110('0x3a')],qs[_0x1110('0x40')](_0x304f69[_0x1110('0x3b')][_0x1110('0x40')]));_0x103d0e[_0x1110('0x3f')]=_0x103d0e['attributes'][_0x1110('0x41')]?_0x103d0e['attributes']:_0x4e323e[_0x1110('0x3a')];if(_0x304f69[_0x1110('0x3b')][_0x1110('0x4b')]){_0x103d0e[_0x1110('0x50')]=[{'all':!![]}];}_0x103d0e=_[_0x1110('0x47')]({},_0x103d0e,_0x304f69[_0x1110('0x4a')]);return db[_0x1110('0x35')][_0x1110('0x51')](_0x103d0e)[_0x1110('0x2d')](handleEntityNotFound(_0x554ec8,null))[_0x1110('0x2d')](respondWithResult(_0x554ec8,null))['catch'](handleError(_0x554ec8,null));};exports[_0x1110('0x52')]=function(_0x1f2f5c,_0xfb064d){return db[_0x1110('0x35')][_0x1110('0x52')](_0x1f2f5c[_0x1110('0x53')],{})['then'](respondWithResult(_0xfb064d,0xc9))['catch'](handleError(_0xfb064d,null));};exports['update']=function(_0x409bbe,_0x2800c2){if(_0x409bbe[_0x1110('0x53')]['id']){delete _0x409bbe[_0x1110('0x53')]['id'];}return db[_0x1110('0x35')]['find']({'where':{'id':_0x409bbe[_0x1110('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2800c2,null))[_0x1110('0x2d')](saveUpdates(_0x409bbe[_0x1110('0x53')],null))[_0x1110('0x2d')](respondWithResult(_0x2800c2,null))[_0x1110('0x4d')](handleError(_0x2800c2,null));};exports['destroy']=function(_0x5d7d05,_0x348fcc){return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0x5d7d05[_0x1110('0x4f')]['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0x348fcc,null))['then'](removeEntity(_0x348fcc,null))[_0x1110('0x4d')](handleError(_0x348fcc,null));};exports[_0x1110('0x54')]=function(_0x13e27e,_0x4d7bc9){return db['ChatGroup']['describe']()[_0x1110('0x2d')](respondWithResult(_0x4d7bc9,null))[_0x1110('0x4d')](handleError(_0x4d7bc9,null));};exports[_0x1110('0x55')]=function(_0x3b7d54,_0x1af1c1,_0x218155){return db[_0x1110('0x56')][_0x1110('0x27')]({'where':{'ChatGroupId':_0x3b7d54[_0x1110('0x4f')]['id'],'ToId':_0x3b7d54[_0x1110('0x57')]['id'],'read':![]}})[_0x1110('0x2d')](function(_0x2b81d7){return{'id':_[_0x1110('0x58')](_0x3b7d54[_0x1110('0x4f')]['id']),'count':_0x2b81d7};})[_0x1110('0x2d')](respondWithResult(_0x1af1c1,null))[_0x1110('0x4d')](handleError(_0x1af1c1,null));};exports['addMembers']=function(_0x37f52c,_0x7e158e,_0x539b4e){return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0x37f52c['params']['id']}})['then'](handleEntityNotFound(_0x7e158e,null))[_0x1110('0x2d')](function(_0x38c254){if(_0x38c254){return _0x38c254[_0x1110('0x59')](_0x37f52c[_0x1110('0x53')][_0x1110('0x5a')],_[_0x1110('0x5b')](_0x37f52c[_0x1110('0x53')],[_0x1110('0x5a'),'id'])||{});}})[_0x1110('0x2d')](respondWithResult(_0x7e158e,null))[_0x1110('0x4d')](handleError(_0x7e158e,null));};exports['getMembers']=function(_0x4d28a2,_0x3752bf,_0x22cc6c){var _0x261953={};var _0x26cef2={};var _0x103e29;var _0x59aafc;return db['ChatGroup']['findOne']({'where':{'id':_0x4d28a2['params']['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0x3752bf,null))[_0x1110('0x2d')](function(_0x46cdf8){if(_0x46cdf8){_0x103e29=_0x46cdf8;_0x26cef2[_0x1110('0x3a')]=_[_0x1110('0x3c')](db[_0x1110('0x5c')][_0x1110('0x36')]);_0x26cef2['query']=_[_0x1110('0x3c')](_0x4d28a2[_0x1110('0x3b')]);_0x26cef2[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x26cef2[_0x1110('0x3a')],_0x26cef2[_0x1110('0x3b')]);_0x261953[_0x1110('0x3f')]=_[_0x1110('0x3e')](_0x26cef2[_0x1110('0x3a')],qs[_0x1110('0x40')](_0x4d28a2[_0x1110('0x3b')][_0x1110('0x40')]));_0x261953[_0x1110('0x3f')]=_0x261953['attributes']['length']?_0x261953[_0x1110('0x3f')]:_0x26cef2[_0x1110('0x3a')];_0x261953[_0x1110('0x43')]=qs[_0x1110('0x44')](_0x4d28a2[_0x1110('0x3b')][_0x1110('0x44')]);_0x261953[_0x1110('0x45')]=qs[_0x1110('0x3d')](_['pick'](_0x4d28a2[_0x1110('0x3b')],_0x26cef2['filters']));if(_0x4d28a2['query'][_0x1110('0x49')]){_0x261953[_0x1110('0x45')]=_[_0x1110('0x47')](_0x261953[_0x1110('0x45')],{'$or':_[_0x1110('0x34')](_0x261953[_0x1110('0x3f')],function(_0xe06448){var _0x5b041e={};_0x5b041e[_0xe06448]={'$like':'%'+_0x4d28a2[_0x1110('0x3b')]['filter']+'%'};return _0x5b041e;})});}_0x261953=_['merge']({},_0x261953,_0x4d28a2[_0x1110('0x4a')]);return _0x103e29[_0x1110('0x5d')](_0x261953);}})[_0x1110('0x2d')](function(_0x268f20){if(_0x268f20){_0x59aafc=_0x268f20[_0x1110('0x41')];if(!_0x4d28a2['query'][_0x1110('0x5e')](_0x1110('0x42'))){_0x261953[_0x1110('0x26')]=qs[_0x1110('0x26')](_0x4d28a2['query'][_0x1110('0x26')]);_0x261953[_0x1110('0x24')]=qs['offset'](_0x4d28a2[_0x1110('0x3b')][_0x1110('0x24')]);}return _0x103e29[_0x1110('0x5d')](_0x261953);}})[_0x1110('0x2d')](function(_0x1dc477){if(_0x1dc477){return _0x1dc477?{'count':_0x59aafc,'rows':_0x1dc477}:null;}})['then'](respondWithResult(_0x3752bf,null))[_0x1110('0x4d')](handleError(_0x3752bf,null));};exports['removeMembers']=function(_0xa8ef86,_0xe0c2eb,_0x2a29fc){return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0xa8ef86[_0x1110('0x4f')]['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0xe0c2eb,null))[_0x1110('0x2d')](function(_0x3f0c79){if(_0x3f0c79){return _0x3f0c79[_0x1110('0x5f')](_0xa8ef86['query'][_0x1110('0x5a')]);}})[_0x1110('0x2d')](respondWithStatusCode(_0xe0c2eb,null))[_0x1110('0x4d')](handleError(_0xe0c2eb,null));};exports[_0x1110('0x60')]=function(_0x27c9fb,_0x420911,_0x263d6c){if(_0x27c9fb[_0x1110('0x53')]['id']){delete _0x27c9fb[_0x1110('0x53')]['id'];}return db[_0x1110('0x35')][_0x1110('0x51')]({'where':{'id':_0x27c9fb[_0x1110('0x4f')]['id']}})['then'](handleEntityNotFound(_0x420911,null))['then'](function(_0x559bae){if(_0x559bae){_0x27c9fb[_0x1110('0x53')][_0x1110('0x61')]=_0x559bae['id'];return db[_0x1110('0x56')]['create'](_0x27c9fb[_0x1110('0x53')]);}})[_0x1110('0x2d')](respondWithResult(_0x420911,null))[_0x1110('0x4d')](handleError(_0x420911,null));};exports[_0x1110('0x62')]=function(_0x18690d,_0x358251,_0x1fff89){var _0x14ffd7={};var _0x16453b={};var _0x4fdd45;var _0x4198f1;return db['ChatGroup'][_0x1110('0x63')]({'where':{'id':_0x18690d[_0x1110('0x4f')]['id']}})[_0x1110('0x2d')](handleEntityNotFound(_0x358251,null))[_0x1110('0x2d')](function(_0x2256ed){if(_0x2256ed){_0x4fdd45=_0x2256ed;_0x16453b[_0x1110('0x3a')]=_[_0x1110('0x3c')](db['ChatInternalMessage']['rawAttributes']);_0x16453b[_0x1110('0x3b')]=_['keys'](_0x18690d[_0x1110('0x3b')]);_0x16453b[_0x1110('0x3d')]=_[_0x1110('0x3e')](_0x16453b['model'],_0x16453b['query']);_0x14ffd7[_0x1110('0x3f')]=_[_0x1110('0x3e')](_0x16453b[_0x1110('0x3a')],qs['fields'](_0x18690d[_0x1110('0x3b')][_0x1110('0x40')]));_0x14ffd7[_0x1110('0x3f')]=_0x14ffd7[_0x1110('0x3f')][_0x1110('0x41')]?_0x14ffd7['attributes']:_0x16453b[_0x1110('0x3a')];_0x14ffd7[_0x1110('0x43')]=qs[_0x1110('0x44')](_0x18690d[_0x1110('0x3b')][_0x1110('0x44')]);_0x14ffd7[_0x1110('0x45')]=qs['filters'](_['pick'](_0x18690d['query'],_0x16453b[_0x1110('0x3d')]));if(_0x18690d[_0x1110('0x3b')]['filter']){_0x14ffd7['where']=_[_0x1110('0x47')](_0x14ffd7['where'],{'$or':_[_0x1110('0x34')](_0x14ffd7['attributes'],function(_0x3c8183){var _0x20da42={};_0x20da42[_0x3c8183]={'$like':'%'+_0x18690d[_0x1110('0x3b')][_0x1110('0x49')]+'%'};return _0x20da42;})});}if(_0x18690d[_0x1110('0x3b')]['$gte']){var _0x4ea153=_0x18690d[_0x1110('0x3b')][_0x1110('0x64')]['split'](',');var _0x31ddd0={};_0x31ddd0[_0x4ea153[0x0]]={'$gte':moment(_0x4ea153[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x14ffd7[_0x1110('0x45')]=_['merge'](_0x14ffd7[_0x1110('0x45')],_0x31ddd0);}_0x14ffd7=_[_0x1110('0x47')]({},_0x14ffd7,_0x18690d['options']);return _0x4fdd45[_0x1110('0x62')](_0x14ffd7);}})[_0x1110('0x2d')](function(_0x5d474b){if(_0x5d474b){_0x4198f1=_0x5d474b['length'];if(!_0x18690d[_0x1110('0x3b')][_0x1110('0x5e')]('nolimit')){_0x14ffd7[_0x1110('0x26')]=qs[_0x1110('0x26')](_0x18690d[_0x1110('0x3b')][_0x1110('0x26')]);_0x14ffd7[_0x1110('0x24')]=qs[_0x1110('0x24')](_0x18690d[_0x1110('0x3b')]['offset']);}return _0x4fdd45[_0x1110('0x62')](_0x14ffd7);}})[_0x1110('0x2d')](function(_0x1620d8){if(_0x1620d8){return _0x1620d8?{'count':_0x4198f1,'rows':_0x1620d8}:null;}})[_0x1110('0x2d')](respondWithResult(_0x358251,null))[_0x1110('0x4d')](handleError(_0x358251,null));}; \ No newline at end of file +var _0xb280=['$gte','split','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','ChatGroup','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','catch','show','params','length','merge','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages'];(function(_0x44415f,_0x3a620d){var _0x4762d2=function(_0x362ffd){while(--_0x362ffd){_0x44415f['push'](_0x44415f['shift']());}};_0x4762d2(++_0x3a620d);}(_0xb280,0x66));var _0x0b28=function(_0x3012af,_0x4ce4f1){_0x3012af=_0x3012af-0x0;var _0x3c658d=_0xb280[_0x3012af];return _0x3c658d;};'use strict';var emlformat=require(_0x0b28('0x0'));var rimraf=require(_0x0b28('0x1'));var zipdir=require(_0x0b28('0x2'));var jsonpatch=require(_0x0b28('0x3'));var rp=require('request-promise');var moment=require(_0x0b28('0x4'));var BPromise=require(_0x0b28('0x5'));var Mustache=require('mustache');var util=require(_0x0b28('0x6'));var path=require(_0x0b28('0x7'));var sox=require(_0x0b28('0x8'));var csv=require('to-csv');var ejs=require(_0x0b28('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b28('0xa'));var squel=require(_0x0b28('0xb'));var crypto=require(_0x0b28('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0b28('0xd'));var toCsv=require(_0x0b28('0xe'));var querystring=require(_0x0b28('0xf'));var Papa=require(_0x0b28('0x10'));var Redis=require(_0x0b28('0x11'));var authService=require(_0x0b28('0x12'));var qs=require(_0x0b28('0x13'));var as=require(_0x0b28('0x14'));var hardwareService=require(_0x0b28('0x15'));var logger=require('../../config/logger')(_0x0b28('0x16'));var utils=require(_0x0b28('0x17'));var config=require(_0x0b28('0x18'));var licenseUtil=require(_0x0b28('0x19'));var db=require(_0x0b28('0x1a'))['db'];config[_0x0b28('0x1b')]=_[_0x0b28('0x1c')](config['redis'],{'host':_0x0b28('0x1d'),'port':0x18eb});var socket=require(_0x0b28('0x1e'))(new Redis(config[_0x0b28('0x1b')]));require(_0x0b28('0x1f'))[_0x0b28('0x20')](socket);function respondWithStatusCode(_0x53f22a,_0x5e9133){_0x5e9133=_0x5e9133||0xcc;return function(_0x2f464a){if(_0x2f464a){return _0x53f22a[_0x0b28('0x21')](_0x5e9133);}return _0x53f22a[_0x0b28('0x22')](_0x5e9133)['end']();};}function respondWithResult(_0x1e6ba2,_0x14a0b7){_0x14a0b7=_0x14a0b7||0xc8;return function(_0x1a9623){if(_0x1a9623){return _0x1e6ba2[_0x0b28('0x22')](_0x14a0b7)[_0x0b28('0x23')](_0x1a9623);}};}function respondWithFilteredResult(_0x4ed017,_0x40ce56){return function(_0x5079d6){if(_0x5079d6){var _0x319a22=typeof _0x40ce56[_0x0b28('0x24')]==='undefined'&&typeof _0x40ce56['limit']===_0x0b28('0x25');var _0x25a7f0=_0x5079d6['count'];var _0xcf2017=_0x319a22?0x0:_0x40ce56[_0x0b28('0x24')];var _0x32188d=_0x319a22?_0x5079d6['count']:_0x40ce56[_0x0b28('0x24')]+_0x40ce56[_0x0b28('0x26')];var _0x563025;if(_0x32188d>=_0x25a7f0){_0x32188d=_0x25a7f0;_0x563025=0xc8;}else{_0x563025=0xce;}_0x4ed017[_0x0b28('0x22')](_0x563025);return _0x4ed017[_0x0b28('0x27')](_0x0b28('0x28'),_0xcf2017+'-'+_0x32188d+'/'+_0x25a7f0)[_0x0b28('0x23')](_0x5079d6);}return null;};}function patchUpdates(_0x2c15ee){return function(_0x295363){try{jsonpatch[_0x0b28('0x29')](_0x295363,_0x2c15ee,!![]);}catch(_0x2163c9){return BPromise[_0x0b28('0x2a')](_0x2163c9);}return _0x295363[_0x0b28('0x2b')]();};}function saveUpdates(_0x132025,_0x494d99){return function(_0x95387b){if(_0x95387b){return _0x95387b[_0x0b28('0x2c')](_0x132025)[_0x0b28('0x2d')](function(_0x359083){return _0x359083;});}return null;};}function removeEntity(_0x8bdb98,_0x2f5db0){return function(_0x357c60){if(_0x357c60){return _0x357c60['destroy']()['then'](function(){_0x8bdb98['status'](0xcc)[_0x0b28('0x2e')]();});}};}function handleEntityNotFound(_0x16bff4,_0x478797){return function(_0x4af8d5){if(!_0x4af8d5){_0x16bff4['sendStatus'](0x194);}return _0x4af8d5;};}function handleError(_0x4a2464,_0x14d6c2){_0x14d6c2=_0x14d6c2||0x1f4;return function(_0x2fd92a){logger[_0x0b28('0x2f')](_0x2fd92a[_0x0b28('0x30')]);if(_0x2fd92a[_0x0b28('0x31')]){delete _0x2fd92a['name'];}_0x4a2464[_0x0b28('0x22')](_0x14d6c2)[_0x0b28('0x32')](_0x2fd92a);};}exports[_0x0b28('0x33')]=function(_0x1e9fbd,_0x492874){var _0x53df5f={},_0x3e9462={},_0x35bf1c={'count':0x0,'rows':[]};var _0x384cbe=_['map'](db[_0x0b28('0x34')][_0x0b28('0x35')],function(_0x47fded){return{'name':_0x47fded['fieldName'],'type':_0x47fded[_0x0b28('0x36')]['key']};});_0x3e9462[_0x0b28('0x37')]=_['map'](_0x384cbe,_0x0b28('0x31'));_0x3e9462[_0x0b28('0x38')]=_[_0x0b28('0x39')](_0x1e9fbd[_0x0b28('0x38')]);_0x3e9462[_0x0b28('0x3a')]=_['intersection'](_0x3e9462[_0x0b28('0x37')],_0x3e9462[_0x0b28('0x38')]);_0x53df5f['attributes']=_[_0x0b28('0x3b')](_0x3e9462['model'],qs[_0x0b28('0x3c')](_0x1e9fbd[_0x0b28('0x38')]['fields']));_0x53df5f['attributes']=_0x53df5f[_0x0b28('0x3d')]['length']?_0x53df5f['attributes']:_0x3e9462['model'];if(!_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x3e')](_0x0b28('0x3f'))){_0x53df5f[_0x0b28('0x26')]=qs[_0x0b28('0x26')](_0x1e9fbd['query']['limit']);_0x53df5f['offset']=qs[_0x0b28('0x24')](_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x24')]);}_0x53df5f[_0x0b28('0x40')]=qs[_0x0b28('0x41')](_0x1e9fbd[_0x0b28('0x38')]['sort']);_0x53df5f[_0x0b28('0x42')]=qs[_0x0b28('0x3a')](_[_0x0b28('0x43')](_0x1e9fbd['query'],_0x3e9462[_0x0b28('0x3a')]),_0x384cbe);if(_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x44')]){_0x53df5f['where']=_['merge'](_0x53df5f['where'],{'$or':_['map'](_0x384cbe,function(_0x1193d7){if(_0x1193d7[_0x0b28('0x36')]!==_0x0b28('0x45')){var _0x48ac34={};_0x48ac34[_0x1193d7[_0x0b28('0x31')]]={'$like':'%'+_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x44')]+'%'};return _0x48ac34;}})});}_0x53df5f=_['merge']({},_0x53df5f,_0x1e9fbd[_0x0b28('0x46')]);var _0x3cd713={'where':_0x53df5f[_0x0b28('0x42')]};return db['ChatGroup'][_0x0b28('0x47')](_0x3cd713)[_0x0b28('0x2d')](function(_0x32d526){_0x35bf1c['count']=_0x32d526;if(_0x1e9fbd[_0x0b28('0x38')][_0x0b28('0x48')]){_0x53df5f[_0x0b28('0x49')]=[{'all':!![]}];}return db[_0x0b28('0x34')]['findAll'](_0x53df5f);})[_0x0b28('0x2d')](function(_0x3a0ac0){_0x35bf1c['rows']=_0x3a0ac0;return _0x35bf1c;})['then'](respondWithFilteredResult(_0x492874,_0x53df5f))[_0x0b28('0x4a')](handleError(_0x492874,null));};exports[_0x0b28('0x4b')]=function(_0x1910d3,_0x55175e){var _0x5a1f04={'raw':!![],'where':{'id':_0x1910d3[_0x0b28('0x4c')]['id']}},_0x3cfbe6={};_0x3cfbe6[_0x0b28('0x37')]=_[_0x0b28('0x39')](db[_0x0b28('0x34')]['rawAttributes']);_0x3cfbe6['query']=_[_0x0b28('0x39')](_0x1910d3[_0x0b28('0x38')]);_0x3cfbe6[_0x0b28('0x3a')]=_[_0x0b28('0x3b')](_0x3cfbe6['model'],_0x3cfbe6[_0x0b28('0x38')]);_0x5a1f04['attributes']=_['intersection'](_0x3cfbe6[_0x0b28('0x37')],qs['fields'](_0x1910d3[_0x0b28('0x38')]['fields']));_0x5a1f04['attributes']=_0x5a1f04[_0x0b28('0x3d')][_0x0b28('0x4d')]?_0x5a1f04[_0x0b28('0x3d')]:_0x3cfbe6[_0x0b28('0x37')];if(_0x1910d3[_0x0b28('0x38')][_0x0b28('0x48')]){_0x5a1f04['include']=[{'all':!![]}];}_0x5a1f04=_[_0x0b28('0x4e')]({},_0x5a1f04,_0x1910d3[_0x0b28('0x46')]);return db[_0x0b28('0x34')][_0x0b28('0x4f')](_0x5a1f04)[_0x0b28('0x2d')](handleEntityNotFound(_0x55175e,null))[_0x0b28('0x2d')](respondWithResult(_0x55175e,null))[_0x0b28('0x4a')](handleError(_0x55175e,null));};exports[_0x0b28('0x50')]=function(_0x5d33b6,_0x1b62dc){return db[_0x0b28('0x34')][_0x0b28('0x50')](_0x5d33b6[_0x0b28('0x51')],{})[_0x0b28('0x2d')](respondWithResult(_0x1b62dc,0xc9))[_0x0b28('0x4a')](handleError(_0x1b62dc,null));};exports[_0x0b28('0x2c')]=function(_0x513132,_0x25c29d){if(_0x513132[_0x0b28('0x51')]['id']){delete _0x513132[_0x0b28('0x51')]['id'];}return db['ChatGroup'][_0x0b28('0x4f')]({'where':{'id':_0x513132[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x25c29d,null))['then'](saveUpdates(_0x513132['body'],null))[_0x0b28('0x2d')](respondWithResult(_0x25c29d,null))[_0x0b28('0x4a')](handleError(_0x25c29d,null));};exports['destroy']=function(_0x251e08,_0x4e762c){return db[_0x0b28('0x34')][_0x0b28('0x4f')]({'where':{'id':_0x251e08[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x4e762c,null))[_0x0b28('0x2d')](removeEntity(_0x4e762c,null))['catch'](handleError(_0x4e762c,null));};exports['describe']=function(_0x2296cb,_0x46c5e9){return db['ChatGroup'][_0x0b28('0x52')]()['then'](respondWithResult(_0x46c5e9,null))[_0x0b28('0x4a')](handleError(_0x46c5e9,null));};exports[_0x0b28('0x53')]=function(_0x3bf70a,_0x3f6dc3,_0xb99773){return db[_0x0b28('0x54')][_0x0b28('0x47')]({'where':{'ChatGroupId':_0x3bf70a['params']['id'],'ToId':_0x3bf70a[_0x0b28('0x55')]['id'],'read':![]}})[_0x0b28('0x2d')](function(_0x10a3e6){return{'id':_[_0x0b28('0x56')](_0x3bf70a[_0x0b28('0x4c')]['id']),'count':_0x10a3e6};})[_0x0b28('0x2d')](respondWithResult(_0x3f6dc3,null))[_0x0b28('0x4a')](handleError(_0x3f6dc3,null));};exports[_0x0b28('0x57')]=function(_0x4f6203,_0x1a3f11,_0xe97e1b){return db[_0x0b28('0x34')][_0x0b28('0x4f')]({'where':{'id':_0x4f6203[_0x0b28('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1a3f11,null))[_0x0b28('0x2d')](function(_0x4401cf){if(_0x4401cf){return _0x4401cf[_0x0b28('0x57')](_0x4f6203[_0x0b28('0x51')][_0x0b28('0x58')],_[_0x0b28('0x59')](_0x4f6203[_0x0b28('0x51')],[_0x0b28('0x58'),'id'])||{});}})[_0x0b28('0x2d')](respondWithResult(_0x1a3f11,null))[_0x0b28('0x4a')](handleError(_0x1a3f11,null));};exports['getMembers']=function(_0x37ce81,_0x469c66,_0x520274){var _0xda581d={};var _0x24d85a={};var _0x7fe16a;var _0x357743;return db[_0x0b28('0x34')][_0x0b28('0x5a')]({'where':{'id':_0x37ce81[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x469c66,null))[_0x0b28('0x2d')](function(_0x19ae64){if(_0x19ae64){_0x7fe16a=_0x19ae64;_0x24d85a['model']=_[_0x0b28('0x39')](db[_0x0b28('0x5b')][_0x0b28('0x35')]);_0x24d85a[_0x0b28('0x38')]=_[_0x0b28('0x39')](_0x37ce81[_0x0b28('0x38')]);_0x24d85a['filters']=_['intersection'](_0x24d85a['model'],_0x24d85a[_0x0b28('0x38')]);_0xda581d[_0x0b28('0x3d')]=_[_0x0b28('0x3b')](_0x24d85a[_0x0b28('0x37')],qs['fields'](_0x37ce81[_0x0b28('0x38')][_0x0b28('0x3c')]));_0xda581d[_0x0b28('0x3d')]=_0xda581d[_0x0b28('0x3d')][_0x0b28('0x4d')]?_0xda581d[_0x0b28('0x3d')]:_0x24d85a[_0x0b28('0x37')];_0xda581d[_0x0b28('0x40')]=qs[_0x0b28('0x41')](_0x37ce81[_0x0b28('0x38')][_0x0b28('0x41')]);_0xda581d[_0x0b28('0x42')]=qs[_0x0b28('0x3a')](_[_0x0b28('0x43')](_0x37ce81['query'],_0x24d85a['filters']));if(_0x37ce81['query'][_0x0b28('0x44')]){_0xda581d[_0x0b28('0x42')]=_[_0x0b28('0x4e')](_0xda581d[_0x0b28('0x42')],{'$or':_[_0x0b28('0x5c')](_0xda581d['attributes'],function(_0x19d8db){var _0x5a90fb={};_0x5a90fb[_0x19d8db]={'$like':'%'+_0x37ce81[_0x0b28('0x38')]['filter']+'%'};return _0x5a90fb;})});}_0xda581d=_['merge']({},_0xda581d,_0x37ce81[_0x0b28('0x46')]);return _0x7fe16a[_0x0b28('0x5d')](_0xda581d);}})[_0x0b28('0x2d')](function(_0x4f70b6){if(_0x4f70b6){_0x357743=_0x4f70b6['length'];if(!_0x37ce81[_0x0b28('0x38')][_0x0b28('0x3e')]('nolimit')){_0xda581d[_0x0b28('0x26')]=qs[_0x0b28('0x26')](_0x37ce81[_0x0b28('0x38')][_0x0b28('0x26')]);_0xda581d[_0x0b28('0x24')]=qs[_0x0b28('0x24')](_0x37ce81['query'][_0x0b28('0x24')]);}return _0x7fe16a[_0x0b28('0x5d')](_0xda581d);}})[_0x0b28('0x2d')](function(_0x36a35a){if(_0x36a35a){return _0x36a35a?{'count':_0x357743,'rows':_0x36a35a}:null;}})[_0x0b28('0x2d')](respondWithResult(_0x469c66,null))[_0x0b28('0x4a')](handleError(_0x469c66,null));};exports[_0x0b28('0x5e')]=function(_0x29f00c,_0x4c3d43,_0x4daeb7){return db[_0x0b28('0x34')][_0x0b28('0x4f')]({'where':{'id':_0x29f00c[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x4c3d43,null))[_0x0b28('0x2d')](function(_0x778f1c){if(_0x778f1c){return _0x778f1c[_0x0b28('0x5e')](_0x29f00c[_0x0b28('0x38')][_0x0b28('0x58')]);}})['then'](respondWithStatusCode(_0x4c3d43,null))[_0x0b28('0x4a')](handleError(_0x4c3d43,null));};exports[_0x0b28('0x5f')]=function(_0x172f26,_0x5b669b,_0x2beef5){if(_0x172f26[_0x0b28('0x51')]['id']){delete _0x172f26['body']['id'];}return db['ChatGroup'][_0x0b28('0x4f')]({'where':{'id':_0x172f26[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x5b669b,null))['then'](function(_0x1be6dc){if(_0x1be6dc){_0x172f26['body'][_0x0b28('0x60')]=_0x1be6dc['id'];return db[_0x0b28('0x54')][_0x0b28('0x50')](_0x172f26[_0x0b28('0x51')]);}})[_0x0b28('0x2d')](respondWithResult(_0x5b669b,null))[_0x0b28('0x4a')](handleError(_0x5b669b,null));};exports[_0x0b28('0x61')]=function(_0x4cfb2b,_0x4f1269,_0x4d565f){var _0x3481f4={};var _0x519b76={};var _0x562a2e;var _0xefc1e;return db[_0x0b28('0x34')][_0x0b28('0x5a')]({'where':{'id':_0x4cfb2b[_0x0b28('0x4c')]['id']}})[_0x0b28('0x2d')](handleEntityNotFound(_0x4f1269,null))[_0x0b28('0x2d')](function(_0x2dc23b){if(_0x2dc23b){_0x562a2e=_0x2dc23b;_0x519b76[_0x0b28('0x37')]=_['keys'](db['ChatInternalMessage'][_0x0b28('0x35')]);_0x519b76[_0x0b28('0x38')]=_[_0x0b28('0x39')](_0x4cfb2b['query']);_0x519b76[_0x0b28('0x3a')]=_[_0x0b28('0x3b')](_0x519b76['model'],_0x519b76['query']);_0x3481f4[_0x0b28('0x3d')]=_[_0x0b28('0x3b')](_0x519b76[_0x0b28('0x37')],qs['fields'](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x3c')]));_0x3481f4[_0x0b28('0x3d')]=_0x3481f4[_0x0b28('0x3d')][_0x0b28('0x4d')]?_0x3481f4[_0x0b28('0x3d')]:_0x519b76['model'];_0x3481f4[_0x0b28('0x40')]=qs[_0x0b28('0x41')](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x41')]);_0x3481f4[_0x0b28('0x42')]=qs[_0x0b28('0x3a')](_[_0x0b28('0x43')](_0x4cfb2b['query'],_0x519b76['filters']));if(_0x4cfb2b[_0x0b28('0x38')]['filter']){_0x3481f4[_0x0b28('0x42')]=_[_0x0b28('0x4e')](_0x3481f4[_0x0b28('0x42')],{'$or':_[_0x0b28('0x5c')](_0x3481f4[_0x0b28('0x3d')],function(_0x53ba84){var _0x53fc35={};_0x53fc35[_0x53ba84]={'$like':'%'+_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x44')]+'%'};return _0x53fc35;})});}if(_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x62')]){var _0x57d85b=_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x62')][_0x0b28('0x63')](',');var _0x4a5b10={};_0x4a5b10[_0x57d85b[0x0]]={'$gte':moment(_0x57d85b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3481f4[_0x0b28('0x42')]=_[_0x0b28('0x4e')](_0x3481f4[_0x0b28('0x42')],_0x4a5b10);}_0x3481f4=_['merge']({},_0x3481f4,_0x4cfb2b[_0x0b28('0x46')]);return _0x562a2e[_0x0b28('0x61')](_0x3481f4);}})[_0x0b28('0x2d')](function(_0x28871c){if(_0x28871c){_0xefc1e=_0x28871c[_0x0b28('0x4d')];if(!_0x4cfb2b[_0x0b28('0x38')]['hasOwnProperty'](_0x0b28('0x3f'))){_0x3481f4[_0x0b28('0x26')]=qs[_0x0b28('0x26')](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x26')]);_0x3481f4[_0x0b28('0x24')]=qs[_0x0b28('0x24')](_0x4cfb2b[_0x0b28('0x38')][_0x0b28('0x24')]);}return _0x562a2e[_0x0b28('0x61')](_0x3481f4);}})['then'](function(_0x4e924b){if(_0x4e924b){return _0x4e924b?{'count':_0xefc1e,'rows':_0x4e924b}:null;}})['then'](respondWithResult(_0x4f1269,null))['catch'](handleError(_0x4f1269,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 143ce30..45e2f3d 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 _0x002d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','update','remove'];(function(_0x3a26c7,_0x3da973){var _0x5e5b86=function(_0x34460c){while(--_0x34460c){_0x3a26c7['push'](_0x3a26c7['shift']());}};_0x5e5b86(++_0x3da973);}(_0x002d,0xca));var _0xd002=function(_0x41dfac,_0x4e1195){_0x41dfac=_0x41dfac-0x0;var _0x12666b=_0x002d[_0x41dfac];return _0x12666b;};'use strict';var EventEmitter=require(_0xd002('0x0'));var ChatGroup=require(_0xd002('0x1'))['db'][_0xd002('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd002('0x3'),'afterDestroy':_0xd002('0x4')};function emitEvent(_0x1c0d0a){return function(_0x24ff42,_0x1323f0,_0x179915){ChatGroupEvents[_0xd002('0x5')](_0x1c0d0a+':'+_0x24ff42['id'],_0x24ff42);ChatGroupEvents[_0xd002('0x5')](_0x1c0d0a,_0x24ff42);_0x179915(null);};}for(var e in events){if(events[_0xd002('0x6')](e)){var event=events[e];ChatGroup[_0xd002('0x7')](e,emitEvent(event));}}module[_0xd002('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x71a1=['emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x4e566c,_0x501b71){var _0x526ba4=function(_0x4b3d72){while(--_0x4b3d72){_0x4e566c['push'](_0x4e566c['shift']());}};_0x526ba4(++_0x501b71);}(_0x71a1,0x1eb));var _0x171a=function(_0x509a59,_0x33fef){_0x509a59=_0x509a59-0x0;var _0x1e93f6=_0x71a1[_0x509a59];return _0x1e93f6;};'use strict';var EventEmitter=require(_0x171a('0x0'));var ChatGroup=require(_0x171a('0x1'))['db'][_0x171a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x171a('0x3')](0x0);var events={'afterCreate':_0x171a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x219d24){return function(_0x199663,_0x48c50c,_0x52ad84){ChatGroupEvents[_0x171a('0x5')](_0x219d24+':'+_0x199663['id'],_0x199663);ChatGroupEvents[_0x171a('0x5')](_0x219d24,_0x199663);_0x52ad84(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x171a('0x6')](e,emitEvent(event));}}module[_0x171a('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 68f6370..c2652d0 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 _0x6009=['exports','define','ChatGroup','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x1071c6,_0xa49f0a){var _0x4edee4=function(_0x3788d4){while(--_0x3788d4){_0x1071c6['push'](_0x1071c6['shift']());}};_0x4edee4(++_0xa49f0a);}(_0x6009,0x123));var _0x9600=function(_0x4c6c9f,_0x25c8a9){_0x4c6c9f=_0x4c6c9f-0x0;var _0x31e332=_0x6009[_0x4c6c9f];return _0x31e332;};'use strict';var _=require('lodash');var util=require(_0x9600('0x0'));var logger=require(_0x9600('0x1'))(_0x9600('0x2'));var moment=require(_0x9600('0x3'));var BPromise=require(_0x9600('0x4'));var rp=require(_0x9600('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9600('0x6'));var config=require(_0x9600('0x7'));var attributes=require(_0x9600('0x8'));module[_0x9600('0x9')]=function(_0x282beb,_0x524619){return _0x282beb[_0x9600('0xa')](_0x9600('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ada=['exports','define','ChatGroup','chat_groups','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2fc4d3,_0x508e2e){var _0x35e9da=function(_0x3b9df1){while(--_0x3b9df1){_0x2fc4d3['push'](_0x2fc4d3['shift']());}};_0x35e9da(++_0x508e2e);}(_0x2ada,0xd0));var _0xa2ad=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x2ada[_0x4d7a70];return _0x3aafbb;};'use strict';var _=require(_0xa2ad('0x0'));var util=require(_0xa2ad('0x1'));var logger=require('../../config/logger')(_0xa2ad('0x2'));var moment=require(_0xa2ad('0x3'));var BPromise=require('bluebird');var rp=require(_0xa2ad('0x4'));var fs=require('fs');var path=require(_0xa2ad('0x5'));var rimraf=require(_0xa2ad('0x6'));var config=require(_0xa2ad('0x7'));var attributes=require('./chatGroup.attributes');module[_0xa2ad('0x8')]=function(_0x12477f,_0x15f3fe){return _0x12477f[_0xa2ad('0x9')](_0xa2ad('0xa'),attributes,{'tableName':_0xa2ad('0xb'),'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 2f82b42..72d3b59 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 _0xad9b=['../../mysqldb','../../config/utils','../../config/environment','client','defaults','redis','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad9b,0x10e));var _0xbad9=function(_0x26e5a7,_0x5b918f){_0x26e5a7=_0x26e5a7-0x0;var _0x3a2818=_0xad9b[_0x26e5a7];return _0x3a2818;};'use strict';var _=require(_0xbad9('0x0'));var util=require('util');var moment=require(_0xbad9('0x1'));var BPromise=require(_0xbad9('0x2'));var rs=require(_0xbad9('0x3'));var fs=require('fs');var Redis=require(_0xbad9('0x4'));var db=require(_0xbad9('0x5'))['db'];var utils=require(_0xbad9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xbad9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbad9('0x8')]['http']({'port':0x232a});config['redis']=_[_0xbad9('0x9')](config[_0xbad9('0xa')],{'host':_0xbad9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbad9('0xa')]));require(_0xbad9('0xc'))['register'](socket);function respondWithRpcPromise(_0x31b5a4,_0x2dc8e6,_0x1017f6){return new BPromise(function(_0xf508b6,_0x3d1f13){return client[_0xbad9('0xd')](_0x31b5a4,_0x1017f6)[_0xbad9('0xe')](function(_0x4ccf23){logger[_0xbad9('0xf')](_0xbad9('0x10'),_0x2dc8e6,_0xbad9('0x11'));logger[_0xbad9('0x12')](_0xbad9('0x13'),_0x2dc8e6,_0xbad9('0x11'),JSON[_0xbad9('0x14')](_0x4ccf23));if(_0x4ccf23[_0xbad9('0x15')]){if(_0x4ccf23[_0xbad9('0x15')]['code']===0x1f4){logger[_0xbad9('0x15')](_0xbad9('0x10'),_0x2dc8e6,_0x4ccf23[_0xbad9('0x15')][_0xbad9('0x16')]);return _0x3d1f13(_0x4ccf23[_0xbad9('0x15')][_0xbad9('0x16')]);}logger['error'](_0xbad9('0x10'),_0x2dc8e6,_0x4ccf23[_0xbad9('0x15')][_0xbad9('0x16')]);return _0xf508b6(_0x4ccf23[_0xbad9('0x15')]['message']);}else{logger['info'](_0xbad9('0x10'),_0x2dc8e6,_0xbad9('0x11'));_0xf508b6(_0x4ccf23[_0xbad9('0x17')][_0xbad9('0x16')]);}})[_0xbad9('0x18')](function(_0x47422d){logger[_0xbad9('0x15')](_0xbad9('0x10'),_0x2dc8e6,_0x47422d);_0x3d1f13(_0x47422d);});});} \ No newline at end of file +var _0x0f9f=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatGroup.socket','register'];(function(_0x16960e,_0x169c9f){var _0x1c24ce=function(_0x58c97){while(--_0x58c97){_0x16960e['push'](_0x16960e['shift']());}};_0x1c24ce(++_0x169c9f);}(_0x0f9f,0x1cc));var _0xf0f9=function(_0x4e6fb2,_0x3cf23e){_0x4e6fb2=_0x4e6fb2-0x0;var _0x2f1636=_0x0f9f[_0x4e6fb2];return _0x2f1636;};'use strict';var _=require('lodash');var util=require(_0xf0f9('0x0'));var moment=require(_0xf0f9('0x1'));var BPromise=require(_0xf0f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0f9('0x3'));var db=require(_0xf0f9('0x4'))['db'];var utils=require(_0xf0f9('0x5'));var logger=require(_0xf0f9('0x6'))(_0xf0f9('0x7'));var config=require(_0xf0f9('0x8'));var jayson=require(_0xf0f9('0x9'));var client=jayson[_0xf0f9('0xa')][_0xf0f9('0xb')]({'port':0x232a});config[_0xf0f9('0xc')]=_['defaults'](config[_0xf0f9('0xc')],{'host':_0xf0f9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0f9('0xc')]));require(_0xf0f9('0xe'))[_0xf0f9('0xf')](socket);function respondWithRpcPromise(_0x5ab12e,_0x196f21,_0xb9d09e){return new BPromise(function(_0x44e75c,_0x5157d5){return client['request'](_0x5ab12e,_0xb9d09e)[_0xf0f9('0x10')](function(_0xec4152){logger[_0xf0f9('0x11')](_0xf0f9('0x12'),_0x196f21,_0xf0f9('0x13'));logger[_0xf0f9('0x14')](_0xf0f9('0x15'),_0x196f21,'request\x20sent',JSON[_0xf0f9('0x16')](_0xec4152));if(_0xec4152[_0xf0f9('0x17')]){if(_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x18')]===0x1f4){logger[_0xf0f9('0x17')]('ChatGroup,\x20%s,\x20%s',_0x196f21,_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);return _0x5157d5(_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);}logger[_0xf0f9('0x17')](_0xf0f9('0x12'),_0x196f21,_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);return _0x44e75c(_0xec4152[_0xf0f9('0x17')][_0xf0f9('0x19')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x196f21,_0xf0f9('0x13'));_0x44e75c(_0xec4152[_0xf0f9('0x1a')]['message']);}})[_0xf0f9('0x1b')](function(_0x5dd012){logger['error'](_0xf0f9('0x12'),_0x196f21,_0x5dd012);_0x5157d5(_0x5dd012);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 08923a1..377ff43 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 _0xb7b1=['remove','update','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x3021b9,_0x2b2634){var _0x11a011=function(_0x11505f){while(--_0x11505f){_0x3021b9['push'](_0x3021b9['shift']());}};_0x11a011(++_0x2b2634);}(_0xb7b1,0x1e6));var _0x1b7b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb7b1[_0x27af45];return _0x18df21;};'use strict';var ChatGroupEvents=require(_0x1b7b('0x0'));var events=[_0x1b7b('0x1'),_0x1b7b('0x2'),_0x1b7b('0x3')];function createListener(_0xdd757f,_0x4734bb){return function(_0x381a3b){_0x4734bb['emit'](_0xdd757f,_0x381a3b);};}function removeListener(_0x2f106a,_0x1d4310){return function(){ChatGroupEvents[_0x1b7b('0x4')](_0x2f106a,_0x1d4310);};}exports[_0x1b7b('0x5')]=function(_0x5abc4a){for(var _0x2bcdc5=0x0,_0x19f86e=events[_0x1b7b('0x6')];_0x2bcdc5<_0x19f86e;_0x2bcdc5++){var _0x32886f=events[_0x2bcdc5];var _0x1a8655=createListener(_0x1b7b('0x7')+_0x32886f,_0x5abc4a);ChatGroupEvents['on'](_0x32886f,_0x1a8655);}}; \ No newline at end of file +var _0xe6d8=['removeListener','register','length','save','remove','update','emit'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0xe6d8,0x17d));var _0x8e6d=function(_0x155c27,_0x35a345){_0x155c27=_0x155c27-0x0;var _0x68387d=_0xe6d8[_0x155c27];return _0x68387d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x8e6d('0x0'),_0x8e6d('0x1'),_0x8e6d('0x2')];function createListener(_0xeda190,_0x40aadf){return function(_0x2a1424){_0x40aadf[_0x8e6d('0x3')](_0xeda190,_0x2a1424);};}function removeListener(_0x9e9583,_0x20ddf2){return function(){ChatGroupEvents[_0x8e6d('0x4')](_0x9e9583,_0x20ddf2);};}exports[_0x8e6d('0x5')]=function(_0x2079f6){for(var _0x671973=0x0,_0x5018de=events[_0x8e6d('0x6')];_0x671973<_0x5018de;_0x671973++){var _0x22d4ab=events[_0x671973];var _0x3b02b0=createListener('chatGroup:'+_0x22d4ab,_0x2079f6);ChatGroupEvents['on'](_0x22d4ab,_0x3b02b0);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 50ecb25..ef58228 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 _0x3f41=['addMessage','put','update','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','getMembers','/:id/messages','create','post','/:id/members'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x3f41,0xf8));var _0x13f4=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x3f41[_0x469a3c];return _0x968f4;};'use strict';var multer=require(_0x13f4('0x0'));var util=require(_0x13f4('0x1'));var path=require(_0x13f4('0x2'));var timeout=require(_0x13f4('0x3'));var express=require(_0x13f4('0x4'));var router=express[_0x13f4('0x5')]();var fs_extra=require(_0x13f4('0x6'));var auth=require(_0x13f4('0x7'));var interaction=require(_0x13f4('0x8'));var config=require(_0x13f4('0x9'));var controller=require(_0x13f4('0xa'));router[_0x13f4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x13f4('0xb')]('/describe',auth[_0x13f4('0xc')](),controller[_0x13f4('0xd')]);router['get'](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller[_0x13f4('0xf')]);router['get'](_0x13f4('0x10'),auth['isAuthenticated'](),controller['getUnread']);router['get']('/:id/members',auth[_0x13f4('0xc')](),controller[_0x13f4('0x11')]);router['get'](_0x13f4('0x12'),auth[_0x13f4('0xc')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x13f4('0x13')]);router[_0x13f4('0x14')](_0x13f4('0x15'),auth[_0x13f4('0xc')](),controller['addMembers']);router[_0x13f4('0x14')](_0x13f4('0x12'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x16')]);router[_0x13f4('0x17')](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller[_0x13f4('0x18')]);router[_0x13f4('0x19')](_0x13f4('0xe'),auth[_0x13f4('0xc')](),controller['destroy']);router[_0x13f4('0x19')](_0x13f4('0x15'),auth['isAuthenticated'](),controller[_0x13f4('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x5a75=['addMessage','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','getMessages','create','post','addMembers','/:id/messages'];(function(_0x4d216c,_0x363a80){var _0x36fe74=function(_0x460e09){while(--_0x460e09){_0x4d216c['push'](_0x4d216c['shift']());}};_0x36fe74(++_0x363a80);}(_0x5a75,0x1c5));var _0x55a7=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x5a75[_0x1bb47b];return _0x566418;};'use strict';var multer=require(_0x55a7('0x0'));var util=require(_0x55a7('0x1'));var path=require(_0x55a7('0x2'));var timeout=require(_0x55a7('0x3'));var express=require(_0x55a7('0x4'));var router=express[_0x55a7('0x5')]();var fs_extra=require(_0x55a7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x55a7('0x7'));var config=require(_0x55a7('0x8'));var controller=require(_0x55a7('0x9'));router[_0x55a7('0xa')]('/',auth[_0x55a7('0xb')](),controller[_0x55a7('0xc')]);router['get']('/describe',auth[_0x55a7('0xb')](),controller[_0x55a7('0xd')]);router['get'](_0x55a7('0xe'),auth[_0x55a7('0xb')](),controller[_0x55a7('0xf')]);router[_0x55a7('0xa')]('/:id/unread',auth[_0x55a7('0xb')](),controller['getUnread']);router[_0x55a7('0xa')](_0x55a7('0x10'),auth[_0x55a7('0xb')](),controller[_0x55a7('0x11')]);router['get']('/:id/messages',auth[_0x55a7('0xb')](),controller[_0x55a7('0x12')]);router['post']('/',auth[_0x55a7('0xb')](),controller[_0x55a7('0x13')]);router[_0x55a7('0x14')](_0x55a7('0x10'),auth[_0x55a7('0xb')](),controller[_0x55a7('0x15')]);router['post'](_0x55a7('0x16'),auth[_0x55a7('0xb')](),controller[_0x55a7('0x17')]);router[_0x55a7('0x18')](_0x55a7('0xe'),auth['isAuthenticated'](),controller[_0x55a7('0x19')]);router['delete']('/:id',auth[_0x55a7('0xb')](),controller[_0x55a7('0x1a')]);router['delete']('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module[_0x55a7('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1f73f24..172bf6c 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 _0x4213=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize'];(function(_0xb20baf,_0xb08831){var _0x4da040=function(_0x29355a){while(--_0x29355a){_0xb20baf['push'](_0xb20baf['shift']());}};_0x4da040(++_0xb08831);}(_0x4213,0x77));var _0x3421=function(_0x262b2d,_0xa4b1b6){_0x262b2d=_0x262b2d-0x0;var _0x4b8b23=_0x4213[_0x262b2d];return _0x4b8b23;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'closed':{'type':Sequelize[_0x3421('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3421('0x3')]},'ratingType':{'type':Sequelize[_0x3421('0x4')](_0x3421('0x5'),_0x3421('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x3421('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3421('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3421('0x9')]},'disposition':{'type':Sequelize[_0x3421('0x8')]},'secondDisposition':{'type':Sequelize[_0x3421('0x8')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3421('0x8')]},'browserName':{'type':Sequelize[_0x3421('0x8')]},'browserVersion':{'type':Sequelize[_0x3421('0x8')]},'osName':{'type':Sequelize[_0x3421('0x8')]},'osVersion':{'type':Sequelize[_0x3421('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x3421('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x3421('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x3421('0xa'))},'read1stAt':{'type':Sequelize[_0x3421('0x9')]},'lastMsgAt':{'type':Sequelize[_0x3421('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x3421('0x4')]('in',_0x3421('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3421('0x8')]},'customerPort':{'type':Sequelize[_0x3421('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x3421('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbe9d=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN'];(function(_0x1736a1,_0x5108f9){var _0x54b07c=function(_0x608ad8){while(--_0x608ad8){_0x1736a1['push'](_0x1736a1['shift']());}};_0x54b07c(++_0x5108f9);}(_0xbe9d,0x99));var _0xdbe9=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xbe9d[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0xdbe9('0x0'));module[_0xdbe9('0x1')]={'closed':{'type':Sequelize[_0xdbe9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xdbe9('0x3')]},'ratingType':{'type':Sequelize[_0xdbe9('0x4')](_0xdbe9('0x5'),_0xdbe9('0x6')),'defaultValue':_0xdbe9('0x5')},'ratingMessage':{'type':Sequelize[_0xdbe9('0x7')]},'pathTranscript':{'type':Sequelize[_0xdbe9('0x7')]},'mailTranscript':{'type':Sequelize[_0xdbe9('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xdbe9('0x9')]},'disposition':{'type':Sequelize[_0xdbe9('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xdbe9('0x8')]},'browserName':{'type':Sequelize[_0xdbe9('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xdbe9('0x8')]},'osVersion':{'type':Sequelize[_0xdbe9('0x8')]},'deviceModel':{'type':Sequelize[_0xdbe9('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xdbe9('0x7')]},'customerIp':{'type':Sequelize[_0xdbe9('0x8')]},'formData':{'type':Sequelize[_0xdbe9('0x7')](_0xdbe9('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xdbe9('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xdbe9('0x4')]('in',_0xdbe9('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xdbe9('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xdbe9('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index b16c438..b6b07fa 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 _0x9485=['CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','params','includeAll','include','options','create','destroy','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','originalname','basename','file','mimetype','Attachment','attachmentDownload','json','Unauthorized','root','offline-chat/','join','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','pick','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','addTags','setTags','spread','Tag','emit','removeTags','download','unix','tmp','files','transcript-%d-%s.zip','firstName','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','server','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','apply','reject','save','update','end','stack','name','send','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','waiting','talking','abandoned','total','UserId','closed','answered','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','ChatInteraction','a.key','Account.key','a.mandatoryDisposition'];(function(_0xafa3b3,_0x419820){var _0x25fa7f=function(_0x547df6){while(--_0x547df6){_0xafa3b3['push'](_0xafa3b3['shift']());}};_0x25fa7f(++_0x419820);}(_0x9485,0x8b));var _0x5948=function(_0x273aab,_0x1db224){_0x273aab=_0x273aab-0x0;var _0x58eff6=_0x9485[_0x273aab];return _0x58eff6;};'use strict';var emlformat=require(_0x5948('0x0'));var rimraf=require(_0x5948('0x1'));var zipdir=require(_0x5948('0x2'));var jsonpatch=require(_0x5948('0x3'));var rp=require('request-promise');var moment=require(_0x5948('0x4'));var BPromise=require(_0x5948('0x5'));var Mustache=require(_0x5948('0x6'));var util=require('util');var path=require(_0x5948('0x7'));var sox=require(_0x5948('0x8'));var csv=require(_0x5948('0x9'));var ejs=require(_0x5948('0xa'));var fs=require('fs');var fs_extra=require(_0x5948('0xb'));var _=require(_0x5948('0xc'));var squel=require('squel');var crypto=require(_0x5948('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5948('0xe'));var toCsv=require(_0x5948('0x9'));var querystring=require('querystring');var Papa=require(_0x5948('0xf'));var Redis=require(_0x5948('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5948('0x11'));var as=require(_0x5948('0x12'));var pdf=require(_0x5948('0x13'));var hardwareService=require(_0x5948('0x14'));var logger=require(_0x5948('0x15'))(_0x5948('0x16'));var utils=require(_0x5948('0x17'));var config=require(_0x5948('0x18'));var licenseUtil=require(_0x5948('0x19'));var db=require(_0x5948('0x1a'))['db'];config[_0x5948('0x1b')]=_['defaults'](config[_0x5948('0x1b')],{'host':_0x5948('0x1c'),'port':0x18eb});var socket=require(_0x5948('0x1d'))(new Redis(config[_0x5948('0x1b')]));require(_0x5948('0x1e'))[_0x5948('0x1f')](socket);var jayson=require(_0x5948('0x20'));var client=jayson[_0x5948('0x21')][_0x5948('0x22')]({'port':0x232b});var client9004=jayson[_0x5948('0x21')][_0x5948('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x203968,_0x1cc566,_0xf46ff8,_0xf2038b){return new BPromise(function(_0x4a1f4b,_0x4d711a){var _0x5f42db=_0xf2038b||client;return _0x5f42db[_0x5948('0x23')](_0x203968,_0xf46ff8)[_0x5948('0x24')](function(_0xd4331f){logger[_0x5948('0x25')](_0x5948('0x26'),_0x1cc566,_0x5948('0x27'));logger['debug'](_0x5948('0x28'),_0x1cc566,_0x5948('0x27'),JSON[_0x5948('0x29')](_0xd4331f));if(_0xd4331f[_0x5948('0x2a')]){if(_0xd4331f['error'][_0x5948('0x2b')]===0x1f4){logger[_0x5948('0x2a')](_0x5948('0x26'),_0x1cc566,_0xd4331f[_0x5948('0x2a')][_0x5948('0x2c')]);return _0x4d711a(_0xd4331f[_0x5948('0x2a')][_0x5948('0x2c')]);}logger[_0x5948('0x2a')](_0x5948('0x26'),_0x1cc566,_0xd4331f[_0x5948('0x2a')]['message']);return _0x4a1f4b(_0xd4331f[_0x5948('0x2a')]['message']);}else{logger[_0x5948('0x25')](_0x5948('0x26'),_0x1cc566,_0x5948('0x27'));_0x4a1f4b(_0xd4331f[_0x5948('0x2d')][_0x5948('0x2c')]);}})[_0x5948('0x2e')](function(_0x1db063){logger[_0x5948('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x1cc566,_0x1db063);_0x4d711a(_0x1db063);});});}function respondWithStatusCode(_0x570e2e,_0x4a3c1b){_0x4a3c1b=_0x4a3c1b||0xcc;return function(_0x2a20c7){if(_0x2a20c7){return _0x570e2e[_0x5948('0x2f')](_0x4a3c1b);}return _0x570e2e[_0x5948('0x30')](_0x4a3c1b)['end']();};}function respondWithResult(_0x4a9630,_0x45d99b){_0x45d99b=_0x45d99b||0xc8;return function(_0x47b55e){if(_0x47b55e){return _0x4a9630[_0x5948('0x30')](_0x45d99b)['json'](_0x47b55e);}};}function respondWithFilteredResult(_0x2d0a48,_0x2d1f6c){return function(_0x3c66e7){if(_0x3c66e7){var _0x1ad0af=typeof _0x2d1f6c[_0x5948('0x31')]===_0x5948('0x32')&&typeof _0x2d1f6c['limit']==='undefined';var _0x2c9219=_0x3c66e7[_0x5948('0x33')];var _0x4a6740=_0x1ad0af?0x0:_0x2d1f6c['offset'];var _0x5d9ca0=_0x1ad0af?_0x3c66e7[_0x5948('0x33')]:_0x2d1f6c[_0x5948('0x31')]+_0x2d1f6c[_0x5948('0x34')];var _0x1be3ea;if(_0x5d9ca0>=_0x2c9219){_0x5d9ca0=_0x2c9219;_0x1be3ea=0xc8;}else{_0x1be3ea=0xce;}_0x2d0a48['status'](_0x1be3ea);return _0x2d0a48['set'](_0x5948('0x35'),_0x4a6740+'-'+_0x5d9ca0+'/'+_0x2c9219)['json'](_0x3c66e7);}return null;};}function patchUpdates(_0x2b3d32){return function(_0x4bfc45){try{jsonpatch[_0x5948('0x36')](_0x4bfc45,_0x2b3d32,!![]);}catch(_0x326f50){return BPromise[_0x5948('0x37')](_0x326f50);}return _0x4bfc45[_0x5948('0x38')]();};}function saveUpdates(_0xe43646,_0x3ff1af){return function(_0x22a437){if(_0x22a437){return _0x22a437[_0x5948('0x39')](_0xe43646)[_0x5948('0x24')](function(_0xb3c0ad){return _0xb3c0ad;});}return null;};}function removeEntity(_0x528bed,_0x467f9e){return function(_0x15fd32){if(_0x15fd32){return _0x15fd32['destroy']()[_0x5948('0x24')](function(){_0x528bed['status'](0xcc)[_0x5948('0x3a')]();});}};}function handleEntityNotFound(_0x4240da,_0x5abeae){return function(_0x38b857){if(!_0x38b857){_0x4240da['sendStatus'](0x194);}return _0x38b857;};}function handleError(_0x2402fe,_0x4293dc){_0x4293dc=_0x4293dc||0x1f4;return function(_0x112a03){logger[_0x5948('0x2a')](_0x112a03[_0x5948('0x3b')]);if(_0x112a03[_0x5948('0x3c')]){delete _0x112a03[_0x5948('0x3c')];}_0x2402fe[_0x5948('0x30')](_0x4293dc)[_0x5948('0x3d')](_0x112a03);};}function getMustacheRender(_0x85f427,_0x44c85f){return Mustache['render'](_0x85f427,_['merge'](_0x44c85f['body'],{'contact':_0x44c85f['contact'],'message':_0x44c85f['message'],'agent':_0x44c85f[_0x5948('0x3e')],'interaction':_0x44c85f[_0x5948('0x3f')],'account':_0x44c85f[_0x5948('0x40')]}))||'';}function getInteractionUsers(_0x569bc3,_0xe2f17d){return new BPromise(function(_0x39ebc8,_0x54dd66){try{if(_0xe2f17d[_0x569bc3['id']]){_0x569bc3[_0x5948('0x41')]=_['map'](_0xe2f17d[_0x569bc3['id']],function(_0x1ae7a4){return{'id':_0x1ae7a4['id'],'fullname':_0x1ae7a4[_0x5948('0x42')]};});}}catch(_0x3f03a3){_0x54dd66(_0x3f03a3);}_0x39ebc8(_0x569bc3);});}function getInteractionTags(_0xafb7ce,_0x5b8667){return new BPromise(function(_0x2f1705,_0x4f75f5){try{if(_0xafb7ce[_0x5948('0x43')]){_0xafb7ce[_0x5948('0x44')]=[];_0xafb7ce[_0x5948('0x43')][_0x5948('0x45')](',')[_0x5948('0x46')](function(_0xba70a9){_0xafb7ce[_0x5948('0x44')][_0x5948('0x47')](_0x5b8667[_0xba70a9]);});}delete _0xafb7ce[_0x5948('0x43')];}catch(_0x4314d7){_0x4f75f5(_0x4314d7);}_0x2f1705(_0xafb7ce);});}function updateChatInteraction(_0x2ea45e,_0x517994,_0x437fa){return new BPromise(function(_0x17d5d3,_0x14b74e){return getInteractionUsers(_0x2ea45e,_0x437fa)[_0x5948('0x24')](function(_0x2e9d8f){return getInteractionTags(_0x2e9d8f,_0x517994);})[_0x5948('0x24')](function(_0x196e26){return getStateInteraction(_0x196e26);})[_0x5948('0x24')](function(_0x369c6d){_0x17d5d3(_0x369c6d);})[_0x5948('0x2e')](function(_0x220edf){_0x14b74e(_0x220edf);});});}function getStateInteraction(_0x566a2b){return new BPromise(function(_0x375d71,_0x27d43d){_0x566a2b[_0x5948('0x48')]=0x0;_0x566a2b[_0x5948('0x49')]=0x0;_0x566a2b['answered']=0x0;_0x566a2b['unmanaged']=0x0;_0x566a2b[_0x5948('0x4a')]=0x0;_0x566a2b[_0x5948('0x4b')]=0x0;if(!_0x566a2b['closed']&&!_0x566a2b[_0x5948('0x4c')])_0x566a2b['waiting']+=0x1;if(!_0x566a2b[_0x5948('0x4d')]&&_0x566a2b[_0x5948('0x4c')])_0x566a2b[_0x5948('0x49')]+=0x1;if(_0x566a2b[_0x5948('0x4d')]&&_0x566a2b['UserId'])_0x566a2b[_0x5948('0x4e')]+=0x1;if(_0x566a2b[_0x5948('0x4d')]&&!_0x566a2b[_0x5948('0x4c')])_0x566a2b['unmanaged']+=0x1;if(_0x566a2b[_0x5948('0x4d')]&&!_0x566a2b[_0x5948('0x4c')])_0x566a2b['abandoned']+=0x1;_0x566a2b[_0x5948('0x4b')]+=0x1;_0x375d71(_0x566a2b);});}exports[_0x5948('0x4f')]=function(_0x38c6ca,_0x128d84){var _0xef6d6d={},_0x527e2a={},_0x1fcc7c={'count':0x0,'rows':[]};var _0x5bc7af=_[_0x5948('0x50')](db['ChatInteraction'][_0x5948('0x51')],function(_0x17ee20){return{'name':_0x17ee20[_0x5948('0x52')],'type':_0x17ee20[_0x5948('0x53')][_0x5948('0x54')]};});_0x527e2a[_0x5948('0x55')]=_[_0x5948('0x50')](_0x5bc7af,_0x5948('0x3c'));_0x527e2a[_0x5948('0x56')]=_[_0x5948('0x57')](_0x38c6ca[_0x5948('0x56')]);_0x527e2a[_0x5948('0x58')]=_[_0x5948('0x59')](_0x527e2a[_0x5948('0x55')],_0x527e2a[_0x5948('0x56')]);_0xef6d6d[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x527e2a[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x38c6ca[_0x5948('0x56')][_0x5948('0x5b')]));_0xef6d6d[_0x5948('0x5a')]=_0xef6d6d[_0x5948('0x5a')][_0x5948('0x5c')]?_0xef6d6d['attributes']:_0x527e2a[_0x5948('0x55')];if(!_0x38c6ca[_0x5948('0x56')]['hasOwnProperty'](_0x5948('0x5d'))){_0xef6d6d['limit']=qs[_0x5948('0x34')](_0x38c6ca[_0x5948('0x56')]['limit']);_0xef6d6d[_0x5948('0x31')]=qs[_0x5948('0x31')](_0x38c6ca['query'][_0x5948('0x31')]);}_0xef6d6d[_0x5948('0x5e')]=qs[_0x5948('0x5f')](_0x38c6ca[_0x5948('0x56')][_0x5948('0x5f')]);_0xef6d6d[_0x5948('0x60')]=qs['filters'](_['pick'](_0x38c6ca[_0x5948('0x56')],_0x527e2a[_0x5948('0x58')]),_0x5bc7af);var _0x4cf0c8=[];var _0x2ac84d=squel[_0x5948('0x61')]()['field']('id')[_0x5948('0x62')](_0x5948('0x3c'))[_0x5948('0x62')](_0x5948('0x63'))['from'](_0x5948('0x64'));var _0x2360c0=squel[_0x5948('0x61')]()[_0x5948('0x62')](_0x5948('0x65'))['field'](_0x5948('0x66'))[_0x5948('0x62')](_0x5948('0x67'))[_0x5948('0x68')](_0x5948('0x69'),'ui')[_0x5948('0x6a')](_0x5948('0x6b'),'u',_0x5948('0x6c'));var _0x5af604=squel['select']()[_0x5948('0x68')]('chat_interactions','i')[_0x5948('0x6a')]('cm_contacts','c',_0x5948('0x6d'))[_0x5948('0x6a')](_0x5948('0x6b'),'o','o.id\x20=\x20i.UserId')[_0x5948('0x6a')](_0x5948('0x6e'),'a',_0x5948('0x6f'))['left_join'](_0x5948('0x70'),'me',_0x5948('0x71'))['left_join'](_0x5948('0x72'),'it',_0x5948('0x73'))['left_join'](_0x5948('0x64'),'t',_0x5948('0x74'));var _0xf8eac6=squel[_0x5948('0x75')]();var _0x1767bf=[];var _0x3419d8=squel['expr']();var _0x87a623;if(_0x38c6ca['query'][_0x5948('0x76')]){_0x87a623=as[_0x5948('0x77')](_0x38c6ca['query']['search']);var _0x50dfdf=_0x87a623['sqlOperator'];for(var _0x2f58c7=0x0;_0x2f58c7<_0x87a623[_0x5948('0x78')]['length'];_0x2f58c7++){var _0x80277f=_0x87a623['conditions'][_0x2f58c7];var _0x47a5de='i';var _0x2b9ace=_[_0x5948('0x79')](_0x5bc7af,[_0x5948('0x3c'),_0x80277f[_0x5948('0x62')]]);if(!_0x2b9ace){switch(_0x80277f[_0x5948('0x62')]){case _0x5948('0x7a'):if(_0x80277f[_0x5948('0x7b')]==0x1){_0x5af604[_0x5948('0x7c')]('`'+_0x80277f['field']+_0x5948('0x7d'));}else{_0x5af604[_0x5948('0x7c')]('`'+_0x80277f['field']+'`\x20>\x200');}break;case _0x5948('0x7e'):if(_0x80277f['operator']===_0x5948('0x7f')){if(_0x80277f[_0x5948('0x7b')][_0x5948('0x45')]('\x20')[_0x5948('0x5c')]>0x1){_0xf8eac6[_0x50dfdf]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x80277f['value']),null);}else{var _0xb2e60e='%'+_0x80277f[_0x5948('0x7b')]+'%';_0xf8eac6[_0x50dfdf](_0x5948('0x80'),_0xb2e60e,_0xb2e60e,_0xb2e60e);}}else{_0x2b9ace=_[_0x5948('0x79')](_0x5bc7af,[_0x5948('0x3c'),_0x5948('0x81')]);_0x80277f[_0x5948('0x62')]=_0x5948('0x81');_0x52dd2a=as[_0x5948('0x82')](_0x47a5de,_0x2b9ace['type'],_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a[_0x5948('0x83')],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x84')],_0x52dd2a['value'][_0x5948('0x3a')]);}break;case'Tag':var _0xd8ae8c=_0x80277f['value']['split'](',')['map'](function(_0x4bf250){return Number(_0x4bf250);});_0xd8ae8c['forEach'](function(_0x1f268a){_0x3419d8['or'](_0x5948('0x85'),'%,'+_0x1f268a+',%');});_0x1767bf=_[_0x5948('0x86')](_0x1767bf,_0xd8ae8c);break;case _0x5948('0x87'):if(_0x80277f[_0x5948('0x88')]===_0x5948('0x7f')){_0xf8eac6[_0x50dfdf](_0x5948('0x89'),'%'+_0x80277f['value']+'%',null);}else{_0x2b9ace=_[_0x5948('0x79')](_0x5bc7af,[_0x5948('0x3c'),'UserId']);_0x80277f[_0x5948('0x62')]=_0x5948('0x4c');_0x52dd2a=as[_0x5948('0x82')](_0x47a5de,_0x2b9ace[_0x5948('0x53')],_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a['text'],_0x52dd2a[_0x5948('0x7b')]['start'],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x3a')]);}break;case _0x5948('0x8a'):_0x52dd2a=as[_0x5948('0x82')]('me',null,_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a[_0x5948('0x83')],_0x52dd2a['value']['start'],_0x52dd2a[_0x5948('0x7b')]['end']);break;}}else{var _0x52dd2a=as[_0x5948('0x82')](_0x47a5de,_0x2b9ace[_0x5948('0x53')],_0x80277f);_0xf8eac6[_0x50dfdf](_0x52dd2a[_0x5948('0x83')],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x84')],_0x52dd2a[_0x5948('0x7b')][_0x5948('0x3a')]);}}}else{var _0x3e529d=_(_0x38c6ca[_0x5948('0x56')])['keys']()[_0x5948('0x50')](function(_0x2dc0b8){return _[_0x5948('0x8b')](_0x5bc7af,[_0x5948('0x3c'),_0x2dc0b8])?_0x2dc0b8:undefined;})[_0x5948('0x8c')]()[_0x5948('0x7b')]();if(!_[_0x5948('0x8d')](_0x3e529d)){_0x3e529d[_0x5948('0x46')](function(_0x1a5d35){if(_0x1a5d35==='ChatWebsiteId'){_0x5af604[_0x5948('0x60')](_0x5948('0x8e'),[]['concat'](_0x38c6ca[_0x5948('0x56')][_0x1a5d35]));}else if(_0x1a5d35===_0x5948('0x8f')){var _0x204bfa=JSON[_0x5948('0x90')](_0x38c6ca[_0x5948('0x56')][_0x1a5d35])['$gte'];var _0x3cd952=JSON[_0x5948('0x90')](_0x38c6ca[_0x5948('0x56')][_0x1a5d35])[_0x5948('0x91')];_0x5af604[_0x5948('0x60')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x204bfa,_0x3cd952);}else{if(_0x38c6ca[_0x5948('0x56')][_0x1a5d35]===_0x5948('0x92')){_0x5af604[_0x5948('0x60')]('i.'+_0x1a5d35+_0x5948('0x93'));}else{_0x5af604[_0x5948('0x60')]('i.'+_0x1a5d35+_0x5948('0x94'),_0x38c6ca['query'][_0x1a5d35]);}}});}if(_0x38c6ca[_0x5948('0x56')][_0x5948('0x95')]){if(_0x38c6ca[_0x5948('0x56')][_0x5948('0x95')]==0x1){_0x5af604[_0x5948('0x7c')](_0x5948('0x96'));}else{_0x5af604[_0x5948('0x7c')]('`unreadMessages`\x20>\x200');}}if(_0x38c6ca['query'][_0x5948('0x97')]){_0x1767bf=_[_0x5948('0x98')](_0x38c6ca[_0x5948('0x56')]['tag'])?_0x38c6ca[_0x5948('0x56')][_0x5948('0x97')]:new Array(_0x38c6ca['query'][_0x5948('0x97')]);_0x1767bf[_0x5948('0x46')](function(_0x4e18ad){_0x3419d8['or'](_0x5948('0x85'),'%,'+_0x4e18ad+',%');});}if(_0x38c6ca['query']['filter']){var _0x9a906=_0x38c6ca['query'][_0x5948('0x99')][_0x5948('0x9a')]('\x5c','\x5c\x5c')[_0x5948('0x9a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x9a906)){_0xf8eac6['or']('i.id\x20LIKE\x20?',_0x9a906+'%');}else{_0xf8eac6['or'](_0x5948('0x9b'),qs[_0x5948('0x9c')](_0x9a906))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9a906+'%');}}}_0x5af604[_0x5948('0x60')](_0xf8eac6);_0x5af604['group'](_0x5948('0x9d'));var _0x5640de={'type':db[_0x5948('0x9e')][_0x5948('0x9f')][_0x5948('0xa0')],'raw':!![]};var _0x556556=_0x5af604['clone']();_0x556556[_0x5948('0x62')](_0x5948('0x9d'));_0x556556['field'](_0x5948('0xa1'),_0x5948('0x7a'));if(_0xef6d6d[_0x5948('0x5e')]){_0xef6d6d[_0x5948('0x5e')][_0x5948('0x46')](function(_0x475bfe){var _0x2ebc67=_0x475bfe[0x0]===_0x5948('0xa2')?_0x475bfe[0x0]:'i.'+_0x475bfe[0x0];_0x5af604['order'](_0x2ebc67,_0x475bfe[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5948('0x8d')](_0x1767bf)){_0x5af604['having'](_0x3419d8);_0x556556[_0x5948('0x60')](_0x5948('0xa3'),_0x1767bf);}BPromise[_0x5948('0xa4')]()['then'](function(){if(!_0x87a623){if(_0x38c6ca['query'][_0x5948('0xa5')])return;_0x556556[_0x5948('0x60')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x5af604[_0x5948('0x60')](_0x5948('0xa6'));return;}if(_0x38c6ca[_0x5948('0xa7')][_0x5948('0xa8')]!==_0x5948('0x3e'))return;return _0x38c6ca[_0x5948('0xa7')][_0x5948('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x464fdc){if(_[_0x5948('0x8d')](_0x464fdc)){_0x556556[_0x5948('0x60')]('i.ChatWebsiteId\x20IS\x20NULL');_0x5af604[_0x5948('0x60')](_0x5948('0xaa'));}else{_0x556556[_0x5948('0x60')](_0x5948('0x8e'),_[_0x5948('0x50')](_0x464fdc,'id'));_0x5af604[_0x5948('0x60')](_0x5948('0x8e'),_['map'](_0x464fdc,'id'));}});})[_0x5948('0x24')](function(){if(_0x38c6ca[_0x5948('0xa7')][_0x5948('0xa8')]===_0x5948('0x3e')&&!_0x87a623&&!_0x38c6ca['query']['ChatWebsiteId'])return[];return db[_0x5948('0xab')][_0x5948('0x56')](_0x556556[_0x5948('0xac')](),_0x5640de);})[_0x5948('0x24')](function(_0x21a417){_0x1fcc7c[_0x5948('0x33')]=_0x21a417[_0x5948('0x5c')];if(_0x1fcc7c[_0x5948('0x33')]===0x0)return[];return db[_0x5948('0xab')][_0x5948('0x56')](_0x2ac84d[_0x5948('0xac')](),_0x5640de)[_0x5948('0x24')](function(_0x3ec12a){_0x4cf0c8=_[_0x5948('0xad')](_0x3ec12a,'id');_0x5640de=_[_0x5948('0xae')](_0x5640de,{'model':db[_0x5948('0xaf')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38c6ca[_0x5948('0x56')][_0x5948('0x5b')]){_0xef6d6d[_0x5948('0x5a')][_0x5948('0x46')](function(_0x40d28c){_0x5af604['field']('i.'+_0x40d28c);});}else{_0x5af604[_0x5948('0x62')](_0x5948('0xa1'),_0x5948('0x7a'));_0x5af604[_0x5948('0x62')](_0x5948('0xb0'),_0x5948('0xb1'));_0x5af604[_0x5948('0x62')](_0x5948('0xb2'),'Account.mandatoryDisposition');_0x5af604[_0x5948('0x62')](_0x5948('0xb3'),_0x5948('0xa2'));_0x5af604[_0x5948('0x62')](_0x5948('0xb4'));_0x5af604['field'](_0x5948('0xb5'),_0x5948('0xb6'));_0x5af604[_0x5948('0x62')]('c.lastName',_0x5948('0xb7'));_0x5af604[_0x5948('0x62')](_0x5948('0xb8'),_0x5948('0xb9'));_0x5af604[_0x5948('0x62')](_0x5948('0xba'),_0x5948('0xbb'));_0x5af604[_0x5948('0x62')]('c.mobile',_0x5948('0xbc'));_0x5af604[_0x5948('0x62')](_0x5948('0xbd'),_0x5948('0xbe'));_0x5af604[_0x5948('0x62')](_0x5948('0xbf'),'Owner.fullname');_0x5af604['field'](_0x5948('0xc0'),_0x5948('0xc1'));_0x5af604[_0x5948('0x62')](_0x5948('0xc2'),'TagIds');}if(_0xef6d6d[_0x5948('0x34')])_0x5af604[_0x5948('0x34')](_0xef6d6d[_0x5948('0x34')]);if(_0xef6d6d[_0x5948('0x31')])_0x5af604[_0x5948('0x31')](_0xef6d6d['offset']);return db['sequelize'][_0x5948('0x56')](_0x5af604[_0x5948('0xac')](),_0x5640de);})[_0x5948('0x24')](function(_0x17b6b9){if(_0x17b6b9[_0x5948('0x5c')]>0x0)_0x2360c0['where']('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x17b6b9,'id'));return db[_0x5948('0xab')][_0x5948('0x56')](_0x2360c0['toString'](),_0x5640de)[_0x5948('0x24')](function(_0x19f4ce){var _0x49ce55=_[_0x5948('0xc3')](_0x19f4ce,'ChatInteractionId');var _0x4cfc=[];_0x17b6b9['forEach'](function(_0x55c3d8){_0x4cfc['push'](updateChatInteraction(_0x55c3d8,_0x4cf0c8,_0x49ce55));});return BPromise[_0x5948('0xc4')](_0x4cfc);});});})[_0x5948('0x24')](function(_0x471ac7){_0x1fcc7c[_0x5948('0xc5')]=_0x471ac7;return _0x1fcc7c;})[_0x5948('0x24')](respondWithFilteredResult(_0x128d84,_0xef6d6d))[_0x5948('0x2e')](handleError(_0x128d84,null));};exports['show']=function(_0x4b27e5,_0xa4a6){var _0x1008aa={'raw':![],'where':{'id':_0x4b27e5[_0x5948('0xc6')]['id']}},_0x302033={};_0x302033[_0x5948('0x55')]=_[_0x5948('0x57')](db[_0x5948('0xaf')]['rawAttributes']);_0x302033[_0x5948('0x56')]=_[_0x5948('0x57')](_0x4b27e5[_0x5948('0x56')]);_0x302033[_0x5948('0x58')]=_[_0x5948('0x59')](_0x302033[_0x5948('0x55')],_0x302033[_0x5948('0x56')]);_0x1008aa[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x302033[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x4b27e5[_0x5948('0x56')][_0x5948('0x5b')]));_0x1008aa['attributes']=_0x1008aa['attributes'][_0x5948('0x5c')]?_0x1008aa['attributes']:_0x302033[_0x5948('0x55')];if(_0x4b27e5[_0x5948('0x56')][_0x5948('0xc7')]){_0x1008aa[_0x5948('0xc8')]=[{'all':!![]}];}_0x1008aa=_[_0x5948('0xae')]({},_0x1008aa,_0x4b27e5[_0x5948('0xc9')]);return db[_0x5948('0xaf')]['find'](_0x1008aa)['then'](handleEntityNotFound(_0xa4a6,null))[_0x5948('0x24')](respondWithResult(_0xa4a6,null))['catch'](handleError(_0xa4a6,null));};exports['create']=function(_0x2b3da7,_0x1f38ca){return db['ChatInteraction'][_0x5948('0xca')](_0x2b3da7[_0x5948('0x8a')],{})['then'](respondWithResult(_0x1f38ca,0xc9))[_0x5948('0x2e')](handleError(_0x1f38ca,null));};exports[_0x5948('0x39')]=function(_0x4b4b3c,_0x689419){if(_0x4b4b3c[_0x5948('0x8a')]['id']){delete _0x4b4b3c[_0x5948('0x8a')]['id'];}return db[_0x5948('0xaf')][_0x5948('0x79')]({'where':{'id':_0x4b4b3c['params']['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x689419,null))[_0x5948('0x24')](saveUpdates(_0x4b4b3c[_0x5948('0x8a')],null))[_0x5948('0x24')](respondWithResult(_0x689419,null))['catch'](handleError(_0x689419,null));};exports[_0x5948('0xcb')]=function(_0x462724,_0x56a0a4){return db[_0x5948('0xaf')]['find']({'where':{'id':_0x462724['params']['id']}})['then'](handleEntityNotFound(_0x56a0a4,null))[_0x5948('0x24')](removeEntity(_0x56a0a4,null))['catch'](handleError(_0x56a0a4,null));};exports[_0x5948('0xcc')]=function(_0x45611d,_0x128ffb){return db[_0x5948('0xaf')][_0x5948('0xcc')]()['then'](respondWithResult(_0x128ffb,null))[_0x5948('0x2e')](handleError(_0x128ffb,null));};exports[_0x5948('0xcd')]=function(_0x3d54cc,_0x1c7337){var _0x18d887=_0x3d54cc[_0x5948('0xc6')]['id'];var _0x52a926;var _0x7aa8a6;var _0x45c46f;return db[_0x5948('0xaf')][_0x5948('0xce')]({'where':{'id':_0x18d887}})[_0x5948('0x24')](function(_0x13ac8a){_0x52a926=_0x13ac8a;return db['ChatWebsite'][_0x5948('0xce')]({'where':{'id':_0x13ac8a[_0x5948('0xa5')]},'attributes':['id',_0x5948('0xcf'),_0x5948('0xd0'),_0x5948('0xd1'),_0x5948('0xd2'),_0x5948('0xd3')],'raw':!![]});})[_0x5948('0x24')](function(_0x39561b){if(_0x39561b&&_0x39561b[_0x5948('0xcf')]&&_0x39561b['vidaooEscalation']){_0x7aa8a6=_0x39561b;var _0x1cf4c6={'interaction':{'id':_0x18d887},'agent':{'id':_0x3d54cc[_0x5948('0xa7')]['id'],'name':_0x3d54cc[_0x5948('0xa7')]['name'],'fullname':_0x3d54cc['user'][_0x5948('0x42')],'email':_0x3d54cc['user']['email']},'contact':_0x3d54cc[_0x5948('0x8a')][_0x5948('0xd4')],'account':_0x3d54cc[_0x5948('0x8a')][_0x5948('0x40')]};var _0x5006f1={'rejectUnauthorized':![],'method':_0x5948('0xd5'),'url':_0x5948('0xd6'),'headers':{'X-APIKEY':_0x39561b[_0x5948('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3d54cc[_0x5948('0xa7')][_0x5948('0xd7')]],'buttons':null,'topic':_0x7aa8a6['vidaooTopic'],'note':_['isNull'](_0x7aa8a6[_0x5948('0xd2')])?null:getMustacheRender(_0x7aa8a6[_0x5948('0xd2')],_0x1cf4c6),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x7aa8a6['vidaooMetadata'])){var _0x538136=getMustacheRender(_0x7aa8a6['vidaooMetadata'],_0x1cf4c6);var _0x1dc4f5=JSON[_0x5948('0x90')](_0x538136);_0x5006f1['body'][_0x5948('0xd8')]=_0x1dc4f5;}}catch(_0xb32b44){throw new db[(_0x5948('0x9e'))]['ValidationError'](_0x5948('0xd9'));}return rp(_0x5006f1);}else{throw new db['Sequelize'][(_0x5948('0xda'))](_0x5948('0xdb'));}})[_0x5948('0x24')](function(_0x23ed08){_0x45c46f=_0x23ed08;if(_0x45c46f['id']){var _0x2815ce={'body':_0x45c46f[_0x5948('0xdc')],'ChatWebsiteId':_0x7aa8a6['id'],'ChatInteractionId':_0x52a926['id'],'direction':'out','UserId':_0x3d54cc['user']['id']};return db[_0x5948('0xdd')]['create'](_0x2815ce,{});}else{throw new db[(_0x5948('0x9e'))]['ValidationError'](_0x5948('0xde'));}})['then'](function(){return _0x52a926[_0x5948('0xdf')]({'vidaooSessionId':_0x45c46f['id']});})[_0x5948('0x24')](respondWithResult(_0x1c7337,null))['catch'](handleError(_0x1c7337,null));};exports[_0x5948('0xe0')]=function(_0x29e7c8,_0x4d033c){if(_0x29e7c8['body']['id']){delete _0x29e7c8[_0x5948('0x8a')]['id'];}return db['ChatInteraction'][_0x5948('0x79')]({'where':{'id':_0x29e7c8[_0x5948('0xc6')]['id']},'include':[{'model':db[_0x5948('0xe1')],'as':'Contact'}]})[_0x5948('0x24')](handleEntityNotFound(_0x4d033c,null))[_0x5948('0x24')](saveUpdates(_0x29e7c8[_0x5948('0x8a')],null))[_0x5948('0x24')](respondWithResult(_0x4d033c,null))['catch'](handleError(_0x4d033c,null));};exports[_0x5948('0xe2')]=function(_0x1e9e3b,_0x419e31,_0x1fd5be){if(_0x1e9e3b[_0x5948('0x8a')]['id']){delete _0x1e9e3b[_0x5948('0x8a')]['id'];}return db['ChatInteraction'][_0x5948('0x79')]({'where':{'id':_0x1e9e3b[_0x5948('0xc6')]['id']}})['then'](function(_0x288d48){if(!_0x288d48){logger[_0x5948('0x2a')](_0x5948('0xe3'),_0x5948('0xe2'),0x194,_0x5948('0xe4'));_0x419e31['sendStatus'](0x194);}else{if(_0x288d48[_0x5948('0x4c')]){throw new db[(_0x5948('0x9e'))]['ValidationError'](_0x5948('0xe5'));}}return _0x288d48;})[_0x5948('0x24')](function(_0x59e54d){if(_0x59e54d){return _0x59e54d[_0x5948('0x39')]({'closed':_0x1e9e3b[_0x5948('0x8a')][_0x5948('0x4d')],'disposition':_0x1e9e3b[_0x5948('0x8a')][_0x5948('0xe6')]})[_0x5948('0x24')](function(_0x31b17a){return _0x31b17a;});}})[_0x5948('0x24')](function(_0x5f1e65){return respondWithRpcPromise('AbandonInteraction','abandon',_0x1e9e3b[_0x5948('0x8a')],client9004);})[_0x5948('0x24')](respondWithResult(_0x419e31,null))['catch'](handleError(_0x419e31,null));};exports['attachmentUpload']=function(_0x1e2192,_0x17e02c,_0x117793){_0x1e2192['body'][_0x5948('0x3c')]=_0x1e2192['file'][_0x5948('0xe7')];_0x1e2192['body'][_0x5948('0xe8')]=_0x1e2192['file']['filename'];_0x1e2192[_0x5948('0x8a')][_0x5948('0x53')]=_0x1e2192[_0x5948('0xe9')][_0x5948('0xea')];return db[_0x5948('0xeb')][_0x5948('0xca')](_0x1e2192[_0x5948('0x8a')])[_0x5948('0x24')](respondWithResult(_0x17e02c,0xc9))[_0x5948('0x2e')](handleError(_0x17e02c,null));};exports[_0x5948('0xec')]=function(_0x2bff81,_0x519e3e,_0x23dc77){return db[_0x5948('0xaf')][_0x5948('0xce')]({'where':{'id':_0x2bff81[_0x5948('0xc6')]['id']},'raw':!![]})[_0x5948('0x24')](handleEntityNotFound(_0x519e3e,null))[_0x5948('0x24')](function(_0x3e7365){if(_0x3e7365){if(_0x3e7365[_0x5948('0x4d')]){return _0x519e3e['status'](0x193)[_0x5948('0xed')]({'status':0x193,'message':_0x5948('0xee')});}return db[_0x5948('0xeb')][_0x5948('0xce')]({'where':{'id':_0x2bff81[_0x5948('0x56')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x519e3e,null));}})[_0x5948('0x24')](function(_0x1d1bb4){if(_0x1d1bb4){var _0x18355c=_0x1d1bb4['ChatOfflineMessageId']!==null;var _0x3b1c7c=path['join'](config[_0x5948('0xef')],'server/files/attachments/');if(_0x18355c){_0x3b1c7c=path['join'](_0x3b1c7c,_0x5948('0xf0'));}var _0x6dd702=path[_0x5948('0xf1')](_0x3b1c7c,_0x1d1bb4[_0x5948('0xe8')]);return _0x519e3e['download'](_0x6dd702);}})[_0x5948('0x2e')](handleError(_0x519e3e,null));};exports[_0x5948('0xf2')]=function(_0x44aae8,_0x4b1de6){var _0x7a628f=null;var _0x5edfa4=null;var _0x2bf49b=null;var _0x3d2342=null;if(_0x44aae8['body']['id']){delete _0x44aae8[_0x5948('0x8a')]['id'];}if(_0x44aae8['body'][_0x5948('0xf3')]){_0x3d2342=path['join'](config[_0x5948('0xef')],_0x5948('0xf4'),util[_0x5948('0xf5')]('transcript-%s.txt',Date[_0x5948('0xf6')]()));_0x44aae8[_0x5948('0x8a')][_0x5948('0xf7')]=_0x3d2342;}return db[_0x5948('0xaf')]['find']({'where':{'id':_0x44aae8[_0x5948('0xc6')]['id']},'include':[{'model':db[_0x5948('0xdd')],'as':_0x5948('0xf8'),'include':[{'model':db[_0x5948('0x87')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x4b1de6,null))['then'](saveUpdates(_0x44aae8[_0x5948('0x8a')],null))[_0x5948('0x24')](function(_0x57315f){if(_0x57315f){_0x7a628f=_0x57315f;return db['ChatWebsite'][_0x5948('0x79')]({'where':{'id':_0x7a628f[_0x5948('0xa5')]}});}})[_0x5948('0x24')](function(_0x3127e2){if(_0x3127e2){_0x2bf49b=_0x3127e2;return db['CmContact'][_0x5948('0x79')]({'where':{'id':_0x7a628f[_0x5948('0x81')]}});}})[_0x5948('0x24')](function(_0x37c41c){if(_0x37c41c){_0x5edfa4=_0x37c41c;if(_0x3d2342){var _0x46ccea=null;for(var _0x3ab7d1=0x1;_0x3ab7d1<_0x7a628f['Messages'][_0x5948('0x5c')];++_0x3ab7d1){_0x46ccea=_0x7a628f[_0x5948('0xf8')][_0x3ab7d1];var _0x13e275=_0x46ccea['UserId']?util[_0x5948('0xf5')](_0x5948('0xf9'),_0x2bf49b[_0x5948('0xfa')],_0x46ccea['UserId']):_0x5948('0xfb');var _0x39128f=_0x44aae8[_0x5948('0x8a')][_0x5948('0xfc')]||util[_0x5948('0xf5')](_0x5948('0xf9'),_0x5948('0xfd'),_0x46ccea[_0x5948('0x81')]);switch(_0x2bf49b[_0x5948('0xfe')]){case'website_alias':_0x13e275=_0x46ccea[_0x5948('0x4c')]?util[_0x5948('0xf5')]('%s%d',_0x2bf49b['agentAlias'],_0x46ccea[_0x5948('0x4c')]):'System';break;case _0x5948('0xff'):_0x13e275=_0x46ccea[_0x5948('0x4c')]?_0x46ccea[_0x5948('0x87')][_0x5948('0x100')]||_0x46ccea['User'][_0x5948('0x42')]:_0x5948('0xfb');break;case'agent_fullname':_0x13e275=_0x46ccea['UserId']?_0x46ccea[_0x5948('0x87')]['fullname']:'System';break;default:_0x13e275=_0x46ccea[_0x5948('0x4c')]?util[_0x5948('0xf5')]('%s%d',_0x2bf49b['agentAlias'],_0x46ccea[_0x5948('0x4c')]):_0x5948('0xfb');}var _0x26a6fc=util[_0x5948('0xf5')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46ccea[_0x5948('0x8f')])[_0x5948('0xf5')](_0x5948('0x101')),_0x46ccea[_0x5948('0x102')]==='in'?_0x39128f:_0x13e275,_0x46ccea[_0x5948('0x8a')]);if(!_0x46ccea[_0x5948('0x103')]){fs[_0x5948('0x104')](_0x3d2342,_0x26a6fc);}}return db[_0x5948('0x105')][_0x5948('0xce')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5948('0x106'),'raw':!![]}]});}}})[_0x5948('0x24')](function(_0x2ab993){if(_0x2ab993&&_0x2ab993[_0x5948('0x106')]&&_0x44aae8[_0x5948('0x8a')]){var _0xfbe239={'tls':{'rejectUnauthorized':![]}};if(_0x2ab993['Smtp'][_0x5948('0x107')]){_0xfbe239[_0x5948('0x107')]=_0x2ab993[_0x5948('0x106')][_0x5948('0x107')];}else{_0xfbe239['host']=_0x2ab993[_0x5948('0x106')][_0x5948('0x108')];_0xfbe239[_0x5948('0x109')]=_0x2ab993[_0x5948('0x106')][_0x5948('0x109')];_0xfbe239['secure']=_0x2ab993[_0x5948('0x106')][_0x5948('0x10a')];}if(_0x2ab993['Smtp'][_0x5948('0x10b')]){_0xfbe239['auth']={'user':_0x2ab993[_0x5948('0x106')]['user'],'pass':_0x2ab993[_0x5948('0x106')][_0x5948('0x10c')]};}return respondWithRpcPromise(_0x5948('0x10d'),_0x5948('0x10e'),{'account':_0xfbe239,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2ab993[_0x5948('0x3c')],_0x2ab993[_0x5948('0xd7')]||_0x2ab993['Smtp'][_0x5948('0xa7')]),'to':_0x44aae8['body'][_0x5948('0xf3')],'subject':'Mail\x20Transcript','text':util['format'](_0x5948('0x10f'),_0x44aae8[_0x5948('0x8a')][_0x5948('0xf3')]),'attachments':[{'path':_0x3d2342}]}})[_0x5948('0x24')](function(){return _0x7a628f;})[_0x5948('0x2e')](function(_0x53e651){console[_0x5948('0x2a')](_0x53e651);});}else{return _0x7a628f;}})['then'](respondWithStatusCode(_0x4b1de6,0xc8))[_0x5948('0x2e')](handleError(_0x4b1de6,null));};exports[_0x5948('0x110')]=function(_0x42df8b,_0x2e95d2,_0x271f8c){return db[_0x5948('0xdd')][_0x5948('0x79')]({'where':{'id':_0x42df8b[_0x5948('0xc6')]['id']}})['then'](handleEntityNotFound(_0x2e95d2,null))[_0x5948('0x24')](function(_0x2f688a){if(_0x2f688a){return _0x2f688a[_0x5948('0x110')](_0x42df8b[_0x5948('0x8a')]['ids'],_[_0x5948('0x111')](_0x42df8b[_0x5948('0x8a')],[_0x5948('0x112'),'id'])||{});}})[_0x5948('0x24')](respondWithResult(_0x2e95d2,null))['catch'](handleError(_0x2e95d2,null));};exports[_0x5948('0x113')]=function(_0x4691fa,_0x42590e,_0x58f282){var _0x290fb5={'raw':![],'where':{}};var _0x3c7504={};var _0x48ef9d={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5948('0xce')]({'where':{'id':_0x4691fa[_0x5948('0xc6')]['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x42590e,null))[_0x5948('0x24')](function(_0x5c7756){if(_0x5c7756){_0x3c7504[_0x5948('0x55')]=_['keys'](db[_0x5948('0xdd')][_0x5948('0x51')]);_0x3c7504[_0x5948('0x56')]=_[_0x5948('0x57')](_0x4691fa[_0x5948('0x56')]);_0x3c7504[_0x5948('0x58')]=_[_0x5948('0x59')](_0x3c7504[_0x5948('0x55')],_0x3c7504[_0x5948('0x56')]);_0x290fb5[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x3c7504[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x4691fa[_0x5948('0x56')]['fields']));_0x290fb5[_0x5948('0x5a')]=_0x290fb5[_0x5948('0x5a')][_0x5948('0x5c')]?_0x290fb5[_0x5948('0x5a')]:_0x3c7504[_0x5948('0x55')];if(!_0x4691fa['query'][_0x5948('0x114')](_0x5948('0x5d'))){_0x290fb5['limit']=qs[_0x5948('0x34')](_0x4691fa[_0x5948('0x56')]['limit']);_0x290fb5[_0x5948('0x31')]=qs[_0x5948('0x31')](_0x4691fa['query'][_0x5948('0x31')]);}_0x290fb5[_0x5948('0x5e')]=qs[_0x5948('0x5f')](_0x4691fa[_0x5948('0x56')][_0x5948('0x5f')]);_0x290fb5[_0x5948('0x60')]=qs[_0x5948('0x58')](_[_0x5948('0x115')](_0x4691fa[_0x5948('0x56')],_0x3c7504[_0x5948('0x58')]));_0x290fb5[_0x5948('0x60')][_0x5948('0x116')]=_0x5c7756['id'];if(_0x4691fa[_0x5948('0x56')][_0x5948('0x99')]){_0x290fb5['where']=_[_0x5948('0xae')](_0x290fb5[_0x5948('0x60')],{'$or':_[_0x5948('0x50')](_0x290fb5[_0x5948('0x5a')],function(_0x158468){var _0x1d24ed={};_0x1d24ed[_0x158468]={'$like':'%'+_0x4691fa[_0x5948('0x56')][_0x5948('0x99')]+'%'};return _0x1d24ed;})});}if(_0x4691fa['query'][_0x5948('0x117')]){var _0x5dddb3=_0x4691fa[_0x5948('0x56')][_0x5948('0x117')][_0x5948('0x45')](',');var _0x534b2c={};_0x534b2c[_0x5dddb3[0x0]]={'$gte':moment(_0x5dddb3[0x1])[_0x5948('0xf5')](_0x5948('0x118'))};_0x290fb5['where']=_[_0x5948('0xae')](_0x290fb5['where'],_0x534b2c);}_0x290fb5=_[_0x5948('0xae')]({},_0x290fb5,_0x4691fa[_0x5948('0xc9')]);return db[_0x5948('0xdd')]['count']({'where':_0x290fb5['where']})[_0x5948('0x24')](function(_0x55211c){_0x48ef9d['count']=_0x55211c;if(_0x4691fa['query'][_0x5948('0xc7')]){_0x290fb5[_0x5948('0xc8')]=[{'all':!![]}];}return db[_0x5948('0xdd')][_0x5948('0x119')](_0x290fb5);})['then'](function(_0x3c6bef){_0x48ef9d['rows']=_0x3c6bef;return _0x48ef9d;});}})[_0x5948('0x24')](respondWithFilteredResult(_0x42590e,_0x290fb5))[_0x5948('0x2e')](handleError(_0x42590e,null));};exports[_0x5948('0x11a')]=function(_0x10cb7a,_0x2620ff,_0x20029a){var _0x317adf={'where':{}},_0x5adca7={},_0x3375f0={'count':0x0,'rows':[]};return db[_0x5948('0xaf')][_0x5948('0xce')]({'where':{'id':_0x10cb7a[_0x5948('0xc6')]['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x2620ff,null))[_0x5948('0x24')](function(_0x5af8e1){if(_0x5af8e1){_0x5adca7[_0x5948('0x55')]=_[_0x5948('0x57')](db[_0x5948('0xdd')]['rawAttributes']);_0x5adca7[_0x5948('0x56')]=_[_0x5948('0x57')](_0x10cb7a[_0x5948('0x56')]);_0x5adca7[_0x5948('0x58')]=_['intersection'](_0x5adca7[_0x5948('0x55')],_0x5adca7[_0x5948('0x56')]);_0x317adf[_0x5948('0x5a')]=_[_0x5948('0x59')](_0x5adca7[_0x5948('0x55')],qs[_0x5948('0x5b')](_0x10cb7a[_0x5948('0x56')][_0x5948('0x5b')]));_0x317adf[_0x5948('0x5a')]=_0x317adf['attributes']['length']?_0x317adf[_0x5948('0x5a')]:_0x5adca7[_0x5948('0x55')];if(!_0x10cb7a[_0x5948('0x56')][_0x5948('0x114')]('nolimit')){_0x317adf['limit']=qs[_0x5948('0x34')](_0x10cb7a[_0x5948('0x56')][_0x5948('0x34')]);_0x317adf[_0x5948('0x31')]=qs['offset'](_0x10cb7a[_0x5948('0x56')][_0x5948('0x31')]);}_0x317adf[_0x5948('0x5e')]=qs[_0x5948('0x5f')](_0x10cb7a[_0x5948('0x56')]['sort']);_0x317adf[_0x5948('0x60')]=qs[_0x5948('0x58')](_['pick'](_0x10cb7a[_0x5948('0x56')],_0x5adca7['filters']));_0x317adf['where'][_0x5948('0x116')]=_0x5af8e1['id'];if(_0x10cb7a['query'][_0x5948('0x99')]){_0x317adf['where']=_['merge'](_0x317adf[_0x5948('0x60')],{'$or':_[_0x5948('0x50')](_0x317adf[_0x5948('0x5a')],function(_0x49fd2f){var _0x22bd7e={};_0x22bd7e[_0x49fd2f]={'$like':'%'+_0x10cb7a[_0x5948('0x56')]['filter']+'%'};return _0x22bd7e;})});}_0x317adf[_0x5948('0x60')]['secret']=![];if(_0x10cb7a[_0x5948('0x56')]['id']){_0x317adf[_0x5948('0x60')]['id']={'$gt':_0x10cb7a[_0x5948('0x56')]['id']};}_0x317adf=_[_0x5948('0xae')]({},_0x317adf,_0x10cb7a[_0x5948('0xc9')]);return db[_0x5948('0xdd')][_0x5948('0x33')]({'where':_0x317adf[_0x5948('0x60')]})[_0x5948('0x24')](function(_0xe69cec){_0x3375f0[_0x5948('0x33')]=_0xe69cec;_0x317adf[_0x5948('0xc8')]=[];if(_0x10cb7a['query']['includeAgent']){_0x317adf[_0x5948('0xc8')][_0x5948('0x47')]({'model':db[_0x5948('0x87')],'as':_0x5948('0x87'),'attributes':['id',_0x5948('0x42'),_0x5948('0x100')]});}if(_0x10cb7a['query'][_0x5948('0xc7')]){_0x317adf[_0x5948('0xc8')]=[{'all':!![]}];}return db[_0x5948('0xdd')][_0x5948('0x119')](_0x317adf);})[_0x5948('0x24')](function(_0x4b4412){_0x3375f0[_0x5948('0xc5')]=_0x4b4412;return _0x3375f0;});}})[_0x5948('0x24')](respondWithFilteredResult(_0x2620ff,_0x317adf))[_0x5948('0x2e')](handleError(_0x2620ff,null));};exports[_0x5948('0x11b')]=function(_0x3e1b56,_0x2ae550,_0x15d759){return db[_0x5948('0xaf')][_0x5948('0x79')]({'where':{'id':_0x3e1b56['params']['id']}})['then'](handleEntityNotFound(_0x2ae550,null))[_0x5948('0x24')](function(_0x4d60ee){if(_0x4d60ee){return _0x4d60ee[_0x5948('0x11c')](_0x3e1b56['body'][_0x5948('0x112')],_[_0x5948('0x111')](_0x3e1b56['body'],['ids','id'])||{})[_0x5948('0x11d')](function(){return db[_0x5948('0x11e')]['findAll']({'attributes':['id',_0x5948('0x3c'),_0x5948('0x63')],'where':{'id':_0x3e1b56['body']['ids']}});})[_0x5948('0x24')](function(_0x2f53c2){socket[_0x5948('0x11f')]('chatInteractionTags:save',{'id':Number(_0x3e1b56[_0x5948('0xc6')]['id']),'tags':_0x2f53c2||[]});return{'id':Number(_0x3e1b56[_0x5948('0xc6')]['id']),'tags':_0x2f53c2||[]};});}})[_0x5948('0x24')](respondWithResult(_0x2ae550,null))[_0x5948('0x2e')](handleError(_0x2ae550,null));};exports[_0x5948('0x120')]=function(_0x13e59e,_0x1b8746,_0x42afb2){return db['ChatInteraction'][_0x5948('0x79')]({'where':{'id':_0x13e59e['params']['id']}})[_0x5948('0x24')](handleEntityNotFound(_0x1b8746,null))[_0x5948('0x24')](function(_0x4cda41){if(_0x4cda41){return _0x4cda41[_0x5948('0x120')](_0x13e59e[_0x5948('0x56')]['ids']);}})[_0x5948('0x24')](respondWithStatusCode(_0x1b8746,null))[_0x5948('0x2e')](handleError(_0x1b8746,null));};exports[_0x5948('0x121')]=function(_0x2d524d,_0x61a220){var _0x1130f7=moment()[_0x5948('0x122')]()[_0x5948('0xac')]();var _0x47afaf=path[_0x5948('0xf1')](config[_0x5948('0xef')],'server','files',_0x5948('0x123'));var _0x1ae370=path[_0x5948('0xf1')](config[_0x5948('0xef')],'server',_0x5948('0x124'),'attachments');var _0x294f73=path[_0x5948('0xf1')](_0x47afaf,_0x1130f7);var _0x2d876b=util[_0x5948('0xf5')](_0x5948('0x125'),_0x2d524d[_0x5948('0xc6')]['id'],_0x1130f7);var _0x1073fa=path[_0x5948('0xf1')](_0x47afaf,_0x2d876b);var _0xcfcae1=[];_0xcfcae1[_0x5948('0x47')]({'model':db[_0x5948('0x87')],'as':_0x5948('0x87'),'attributes':['id',_0x5948('0x42')],'raw':!![]});_0xcfcae1['push']({'model':db[_0x5948('0xe1')],'as':_0x5948('0x7e'),'attributes':['id',_0x5948('0x126'),'lastName'],'raw':!![]});if(_0x2d524d['query']['attachments']){_0xcfcae1[_0x5948('0x47')]({'model':db['Attachment'],'as':_0x5948('0xeb'),'raw':!![]});}var _0x1946d9=[{'model':db[_0x5948('0xdd')],'as':_0x5948('0xf8'),'attributes':['id','body',_0x5948('0x8f'),_0x5948('0x102'),_0x5948('0x103'),_0x5948('0x95')],'include':_0xcfcae1}];_0x1946d9[_0x5948('0x47')]({'model':db['ChatWebsite'],'as':_0x5948('0x127'),'attributes':['id',_0x5948('0x3c')]});_0x1946d9[_0x5948('0x47')]({'model':db['User'],'as':_0x5948('0x128'),'attributes':['id',_0x5948('0x42')]});return db[_0x5948('0xaf')]['find']({'where':{'id':_0x2d524d[_0x5948('0xc6')]['id']},'include':_0x1946d9})[_0x5948('0x24')](handleEntityNotFound(_0x61a220,null))['then'](function(_0x593a9c){if(_0x593a9c){var _0x16ee0f=_0x593a9c['get']({'plain':!![]});fs[_0x5948('0x129')](_0x294f73);var _0x5219f8={'channel':_0x5948('0x12a'),'account':_0x16ee0f['Account'][_0x5948('0x3c')],'agent':_0x16ee0f[_0x5948('0x128')]?_0x16ee0f[_0x5948('0x128')][_0x5948('0x42')]:_0x5948('0x12b'),'createdAt':moment(_0x16ee0f[_0x5948('0x8f')])[_0x5948('0xf5')](_0x5948('0x118'))[_0x5948('0xac')](),'closedAt':_0x16ee0f[_0x5948('0x4d')]?moment(_0x16ee0f[_0x5948('0x12c')])[_0x5948('0xf5')](_0x5948('0x118'))[_0x5948('0xac')]():'','disposition':_0x16ee0f[_0x5948('0xe6')],'chatInfo':{'browser':_0x16ee0f[_0x5948('0x12d')],'os':_0x16ee0f[_0x5948('0x12e')],'referer':_0x16ee0f['referer'],'customerIp':_0x16ee0f[_0x5948('0x12f')],'customerPort':_0x16ee0f[_0x5948('0x130')]?_0x16ee0f[_0x5948('0x130')]:_0x5948('0x12b')},'messages':_(_0x16ee0f['Messages'])['tail']()[_0x5948('0x99')]({'secret':![]})[_0x5948('0x50')](function(_0x4a48c4){if(_0x4a48c4[_0x5948('0xeb')]){var _0x4209d7=path[_0x5948('0xf1')](_0x1ae370,_0x4a48c4['Attachment']['basename']);if(fs[_0x5948('0x131')](_0x4209d7)){fs[_0x5948('0x132')](_0x4209d7)[_0x5948('0x133')](fs[_0x5948('0x134')](path['join'](_0x294f73,_0x4a48c4[_0x5948('0xeb')][_0x5948('0xe8')])));}}return{'date':moment(_0x4a48c4[_0x5948('0x8f')])[_0x5948('0xf5')](_0x5948('0x118'))[_0x5948('0xac')](),'sender':_0x4a48c4[_0x5948('0x102')]===_0x5948('0x135')?_0x4a48c4[_0x5948('0x87')]?_0x4a48c4['User']['fullname']:_0x5948('0xfb'):_0x4a48c4[_0x5948('0x7e')]['firstName']+(_0x4a48c4['Contact']['lastName']?'\x20'+_0x4a48c4[_0x5948('0x7e')]['lastName']:''),'body':_0x4a48c4['Attachment']?_0x4a48c4[_0x5948('0xeb')][_0x5948('0xe8')]:_0x4a48c4[_0x5948('0x8a')],'direction':_0x4a48c4[_0x5948('0x102')]==='out'?'A':'C','secret':_0x4a48c4[_0x5948('0x103')],'read':_0x4a48c4[_0x5948('0x95')],'attachment':_0x4a48c4['Attachment']};})[_0x5948('0x7b')]()};return ejs[_0x5948('0x136')](path[_0x5948('0xf1')](config[_0x5948('0xef')],_0x5948('0x137'),_0x5948('0x138'),'downloadInteraction.ejs'),{'interaction':_0x5219f8})[_0x5948('0x24')](function(_0x5a985e){var _0x424932=path['join'](_0x294f73,_0x5948('0x139')+_0x16ee0f['id']+'-'+_0x1130f7+_0x5948('0x13a'));var _0x1e8dc2={'path':_0x424932,'channel':_0x5948('0x12a'),'interactionId':_0x16ee0f['id']};return pdf[_0x5948('0x13b')](_0x5a985e,_0x1e8dc2);})[_0x5948('0x24')](function(){return new BPromise(function(_0x51ef54,_0x2c0b91){zipdir(_0x294f73,{'saveTo':_0x1073fa},function(_0xacab94,_0x4d1498){if(_0xacab94)return _0x2c0b91(_0xacab94);return _0x51ef54(_0x4d1498);});})['then'](function(){return new BPromise(function(_0x42f8cc,_0x2544c5){rimraf(_0x294f73,function(_0x355837){if(_0x355837)_0x2544c5(_0x355837);return _0x42f8cc();});});})[_0x5948('0x24')](function(){return _0x61a220[_0x5948('0x121')](_0x1073fa,_0x2d876b,function(_0x1da7c8){if(_0x1da7c8){console[_0x5948('0x13c')]('err',_0x1da7c8);}else{fs[_0x5948('0x13d')](_0x1073fa);}});});});}else{return _0x61a220[_0x5948('0x2f')](0xc8);}})[_0x5948('0x2e')](handleError(_0x61a220,null));}; \ No newline at end of file +var _0xe548=['alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','nolimit','ChatInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','includeAgent','addTags','setTags','omit','spread','color','emit','chatInteractionTags:save','removeTags','download','unix','tmp','files','attachments','transcript-%d-%s.zip','push','CmContact','firstName','direction','Account','Owner','get','mkdirSync','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','server','transcript-','.pdf','Chat','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','redis','defaults','socket.io-emitter','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','waiting','talking','answered','unmanaged','abandoned','closed','UserId','total','index','ChatInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','includeAll','include','options','create','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooNote','vidaooEscalation','email','POST','vidaooTopic','isNull','follow','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','originalname','basename','file','filename','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','mailTranscript','format','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agent_alias'];(function(_0x152992,_0x146a96){var _0x481f1c=function(_0x3f9b71){while(--_0x3f9b71){_0x152992['push'](_0x152992['shift']());}};_0x481f1c(++_0x146a96);}(_0xe548,0x184));var _0x8e54=function(_0x36888d,_0x22988e){_0x36888d=_0x36888d-0x0;var _0x14f524=_0xe548[_0x36888d];return _0x14f524;};'use strict';var emlformat=require(_0x8e54('0x0'));var rimraf=require(_0x8e54('0x1'));var zipdir=require(_0x8e54('0x2'));var jsonpatch=require(_0x8e54('0x3'));var rp=require(_0x8e54('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8e54('0x5'));var csv=require('to-csv');var ejs=require(_0x8e54('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8e54('0x7'));var squel=require(_0x8e54('0x8'));var crypto=require(_0x8e54('0x9'));var jsforce=require(_0x8e54('0xa'));var deskjs=require(_0x8e54('0xb'));var toCsv=require(_0x8e54('0xc'));var querystring=require(_0x8e54('0xd'));var Papa=require('papaparse');var Redis=require(_0x8e54('0xe'));var authService=require(_0x8e54('0xf'));var qs=require(_0x8e54('0x10'));var as=require(_0x8e54('0x11'));var pdf=require(_0x8e54('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e54('0x13'))(_0x8e54('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8e54('0x15')]=_[_0x8e54('0x16')](config[_0x8e54('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8e54('0x17'))(new Redis(config[_0x8e54('0x15')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x8e54('0x18'));var client=jayson['client'][_0x8e54('0x19')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x2c75d8,_0x861ebe,_0x5760a5,_0x45896b){return new BPromise(function(_0x400aa7,_0x20caac){var _0x5f3ed4=_0x45896b||client;return _0x5f3ed4[_0x8e54('0x1a')](_0x2c75d8,_0x5760a5)[_0x8e54('0x1b')](function(_0x48e32e){logger[_0x8e54('0x1c')](_0x8e54('0x1d'),_0x861ebe,_0x8e54('0x1e'));logger[_0x8e54('0x1f')](_0x8e54('0x20'),_0x861ebe,'request\x20sent',JSON[_0x8e54('0x21')](_0x48e32e));if(_0x48e32e[_0x8e54('0x22')]){if(_0x48e32e[_0x8e54('0x22')]['code']===0x1f4){logger[_0x8e54('0x22')](_0x8e54('0x1d'),_0x861ebe,_0x48e32e[_0x8e54('0x22')]['message']);return _0x20caac(_0x48e32e['error']['message']);}logger[_0x8e54('0x22')](_0x8e54('0x1d'),_0x861ebe,_0x48e32e['error'][_0x8e54('0x23')]);return _0x400aa7(_0x48e32e[_0x8e54('0x22')][_0x8e54('0x23')]);}else{logger[_0x8e54('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x861ebe,_0x8e54('0x1e'));_0x400aa7(_0x48e32e[_0x8e54('0x24')][_0x8e54('0x23')]);}})[_0x8e54('0x25')](function(_0x57893c){logger['error'](_0x8e54('0x1d'),_0x861ebe,_0x57893c);_0x20caac(_0x57893c);});});}function respondWithStatusCode(_0x3307a5,_0x591fe4){_0x591fe4=_0x591fe4||0xcc;return function(_0x36c4d3){if(_0x36c4d3){return _0x3307a5[_0x8e54('0x26')](_0x591fe4);}return _0x3307a5[_0x8e54('0x27')](_0x591fe4)[_0x8e54('0x28')]();};}function respondWithResult(_0x5f1f7b,_0x3a36a3){_0x3a36a3=_0x3a36a3||0xc8;return function(_0x43febd){if(_0x43febd){return _0x5f1f7b[_0x8e54('0x27')](_0x3a36a3)[_0x8e54('0x29')](_0x43febd);}};}function respondWithFilteredResult(_0x43eccc,_0x1996d0){return function(_0x44d18d){if(_0x44d18d){var _0x54483d=typeof _0x1996d0['offset']==='undefined'&&typeof _0x1996d0['limit']===_0x8e54('0x2a');var _0x4cebb7=_0x44d18d[_0x8e54('0x2b')];var _0x4f872f=_0x54483d?0x0:_0x1996d0[_0x8e54('0x2c')];var _0x2a4e17=_0x54483d?_0x44d18d[_0x8e54('0x2b')]:_0x1996d0[_0x8e54('0x2c')]+_0x1996d0['limit'];var _0xceb456;if(_0x2a4e17>=_0x4cebb7){_0x2a4e17=_0x4cebb7;_0xceb456=0xc8;}else{_0xceb456=0xce;}_0x43eccc[_0x8e54('0x27')](_0xceb456);return _0x43eccc[_0x8e54('0x2d')](_0x8e54('0x2e'),_0x4f872f+'-'+_0x2a4e17+'/'+_0x4cebb7)[_0x8e54('0x29')](_0x44d18d);}return null;};}function patchUpdates(_0x52b7be){return function(_0x616c57){try{jsonpatch[_0x8e54('0x2f')](_0x616c57,_0x52b7be,!![]);}catch(_0x3ba439){return BPromise['reject'](_0x3ba439);}return _0x616c57[_0x8e54('0x30')]();};}function saveUpdates(_0xdb85dc,_0x3fee9a){return function(_0x1907d8){if(_0x1907d8){return _0x1907d8[_0x8e54('0x31')](_0xdb85dc)['then'](function(_0x4d630d){return _0x4d630d;});}return null;};}function removeEntity(_0x380016,_0x110ef9){return function(_0x344765){if(_0x344765){return _0x344765[_0x8e54('0x32')]()[_0x8e54('0x1b')](function(){_0x380016[_0x8e54('0x27')](0xcc)[_0x8e54('0x28')]();});}};}function handleEntityNotFound(_0x37a235,_0x1416be){return function(_0x43abe4){if(!_0x43abe4){_0x37a235[_0x8e54('0x26')](0x194);}return _0x43abe4;};}function handleError(_0xc739eb,_0x30a3a3){_0x30a3a3=_0x30a3a3||0x1f4;return function(_0x42b37c){logger[_0x8e54('0x22')](_0x42b37c[_0x8e54('0x33')]);if(_0x42b37c[_0x8e54('0x34')]){delete _0x42b37c[_0x8e54('0x34')];}_0xc739eb[_0x8e54('0x27')](_0x30a3a3)[_0x8e54('0x35')](_0x42b37c);};}function getMustacheRender(_0x5adf56,_0x4ed4be){return Mustache['render'](_0x5adf56,_[_0x8e54('0x36')](_0x4ed4be[_0x8e54('0x37')],{'contact':_0x4ed4be[_0x8e54('0x38')],'message':_0x4ed4be[_0x8e54('0x23')],'agent':_0x4ed4be[_0x8e54('0x39')],'interaction':_0x4ed4be[_0x8e54('0x3a')],'account':_0x4ed4be[_0x8e54('0x3b')]}))||'';}function getInteractionUsers(_0x3ed1aa,_0x3a1503){return new BPromise(function(_0xfbda37,_0x16de18){try{if(_0x3a1503[_0x3ed1aa['id']]){_0x3ed1aa[_0x8e54('0x3c')]=_[_0x8e54('0x3d')](_0x3a1503[_0x3ed1aa['id']],function(_0xe740c4){return{'id':_0xe740c4['id'],'fullname':_0xe740c4[_0x8e54('0x3e')]};});}}catch(_0x1fcbae){_0x16de18(_0x1fcbae);}_0xfbda37(_0x3ed1aa);});}function getInteractionTags(_0x321f75,_0x9a78ac){return new BPromise(function(_0x482f39,_0x5c7a0){try{if(_0x321f75[_0x8e54('0x3f')]){_0x321f75[_0x8e54('0x40')]=[];_0x321f75['TagIds'][_0x8e54('0x41')](',')[_0x8e54('0x42')](function(_0x2075ea){_0x321f75[_0x8e54('0x40')]['push'](_0x9a78ac[_0x2075ea]);});}delete _0x321f75[_0x8e54('0x3f')];}catch(_0x56d950){_0x5c7a0(_0x56d950);}_0x482f39(_0x321f75);});}function updateChatInteraction(_0x765314,_0x5bff75,_0x12771f){return new BPromise(function(_0x26df0b,_0x479926){return getInteractionUsers(_0x765314,_0x12771f)['then'](function(_0x52852b){return getInteractionTags(_0x52852b,_0x5bff75);})[_0x8e54('0x1b')](function(_0x47782){return getStateInteraction(_0x47782);})[_0x8e54('0x1b')](function(_0x7a90c0){_0x26df0b(_0x7a90c0);})[_0x8e54('0x25')](function(_0x3ec2eb){_0x479926(_0x3ec2eb);});});}function getStateInteraction(_0x35ebdb){return new BPromise(function(_0xffc57d,_0x2eb16a){_0x35ebdb[_0x8e54('0x43')]=0x0;_0x35ebdb[_0x8e54('0x44')]=0x0;_0x35ebdb[_0x8e54('0x45')]=0x0;_0x35ebdb[_0x8e54('0x46')]=0x0;_0x35ebdb[_0x8e54('0x47')]=0x0;_0x35ebdb['total']=0x0;if(!_0x35ebdb[_0x8e54('0x48')]&&!_0x35ebdb['UserId'])_0x35ebdb[_0x8e54('0x43')]+=0x1;if(!_0x35ebdb[_0x8e54('0x48')]&&_0x35ebdb[_0x8e54('0x49')])_0x35ebdb[_0x8e54('0x44')]+=0x1;if(_0x35ebdb[_0x8e54('0x48')]&&_0x35ebdb['UserId'])_0x35ebdb[_0x8e54('0x45')]+=0x1;if(_0x35ebdb[_0x8e54('0x48')]&&!_0x35ebdb[_0x8e54('0x49')])_0x35ebdb[_0x8e54('0x46')]+=0x1;if(_0x35ebdb[_0x8e54('0x48')]&&!_0x35ebdb[_0x8e54('0x49')])_0x35ebdb['abandoned']+=0x1;_0x35ebdb[_0x8e54('0x4a')]+=0x1;_0xffc57d(_0x35ebdb);});}exports[_0x8e54('0x4b')]=function(_0x13ed9f,_0x2ec413){var _0x4547a1={},_0x17f161={},_0x356453={'count':0x0,'rows':[]};var _0x5dd53b=_[_0x8e54('0x3d')](db[_0x8e54('0x4c')][_0x8e54('0x4d')],function(_0x2ca5ad){return{'name':_0x2ca5ad[_0x8e54('0x4e')],'type':_0x2ca5ad[_0x8e54('0x4f')][_0x8e54('0x50')]};});_0x17f161['model']=_[_0x8e54('0x3d')](_0x5dd53b,_0x8e54('0x34'));_0x17f161['query']=_[_0x8e54('0x51')](_0x13ed9f[_0x8e54('0x52')]);_0x17f161[_0x8e54('0x53')]=_[_0x8e54('0x54')](_0x17f161[_0x8e54('0x55')],_0x17f161[_0x8e54('0x52')]);_0x4547a1[_0x8e54('0x56')]=_['intersection'](_0x17f161[_0x8e54('0x55')],qs['fields'](_0x13ed9f['query'][_0x8e54('0x57')]));_0x4547a1[_0x8e54('0x56')]=_0x4547a1[_0x8e54('0x56')][_0x8e54('0x58')]?_0x4547a1['attributes']:_0x17f161['model'];if(!_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x59')]('nolimit')){_0x4547a1[_0x8e54('0x5a')]=qs[_0x8e54('0x5a')](_0x13ed9f[_0x8e54('0x52')]['limit']);_0x4547a1[_0x8e54('0x2c')]=qs['offset'](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x2c')]);}_0x4547a1['order']=qs[_0x8e54('0x5b')](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x5b')]);_0x4547a1[_0x8e54('0x5c')]=qs[_0x8e54('0x53')](_[_0x8e54('0x5d')](_0x13ed9f[_0x8e54('0x52')],_0x17f161[_0x8e54('0x53')]),_0x5dd53b);var _0x4f11da=[];var _0x2ab246=squel['select']()[_0x8e54('0x5e')]('id')[_0x8e54('0x5e')](_0x8e54('0x34'))[_0x8e54('0x5e')]('color')[_0x8e54('0x5f')](_0x8e54('0x60'));var _0x2caff1=squel[_0x8e54('0x61')]()[_0x8e54('0x5e')](_0x8e54('0x62'))['field'](_0x8e54('0x63'))[_0x8e54('0x5e')]('ui.ChatInteractionId')[_0x8e54('0x5f')]('user_has_chat_interactions','ui')[_0x8e54('0x64')](_0x8e54('0x65'),'u','u.id\x20=\x20ui.UserId');var _0x1909a1=squel[_0x8e54('0x61')]()[_0x8e54('0x5f')](_0x8e54('0x66'),'i')[_0x8e54('0x64')](_0x8e54('0x67'),'c',_0x8e54('0x68'))['left_join'](_0x8e54('0x65'),'o',_0x8e54('0x69'))[_0x8e54('0x64')](_0x8e54('0x6a'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x8e54('0x64')](_0x8e54('0x6b'),'me',_0x8e54('0x6c'))[_0x8e54('0x64')]('chat_interaction_has_tags','it',_0x8e54('0x6d'))['left_join'](_0x8e54('0x60'),'t','t.id\x20=\x20it.TagId');var _0x13b1e2=squel[_0x8e54('0x6e')]();var _0x2983ff=[];var _0x4c62d8=squel[_0x8e54('0x6e')]();var _0x4b3c28;if(_0x13ed9f['query'][_0x8e54('0x6f')]){_0x4b3c28=as['parseSearch'](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x6f')]);var _0x161f55=_0x4b3c28[_0x8e54('0x70')];for(var _0x26ae8e=0x0;_0x26ae8e<_0x4b3c28[_0x8e54('0x71')][_0x8e54('0x58')];_0x26ae8e++){var _0x504022=_0x4b3c28[_0x8e54('0x71')][_0x26ae8e];var _0x92f2fe='i';var _0x179eb4=_[_0x8e54('0x72')](_0x5dd53b,[_0x8e54('0x34'),_0x504022[_0x8e54('0x5e')]]);if(!_0x179eb4){switch(_0x504022[_0x8e54('0x5e')]){case _0x8e54('0x73'):if(_0x504022[_0x8e54('0x74')]==0x1){_0x1909a1[_0x8e54('0x75')]('`'+_0x504022[_0x8e54('0x5e')]+_0x8e54('0x76'));}else{_0x1909a1['having']('`'+_0x504022[_0x8e54('0x5e')]+_0x8e54('0x77'));}break;case _0x8e54('0x78'):if(_0x504022[_0x8e54('0x79')]===_0x8e54('0x7a')){if(_0x504022['value'][_0x8e54('0x41')]('\x20')[_0x8e54('0x58')]>0x1){_0x13b1e2[_0x161f55]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8e54('0x7b')](_0x504022[_0x8e54('0x74')]),null);}else{var _0x440cc1='%'+_0x504022[_0x8e54('0x74')]+'%';_0x13b1e2[_0x161f55](_0x8e54('0x7c'),_0x440cc1,_0x440cc1,_0x440cc1);}}else{_0x179eb4=_[_0x8e54('0x72')](_0x5dd53b,[_0x8e54('0x34'),'ContactId']);_0x504022[_0x8e54('0x5e')]=_0x8e54('0x7d');_0x5a3a0b=as[_0x8e54('0x7e')](_0x92f2fe,_0x179eb4[_0x8e54('0x4f')],_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b['text'],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x7f')],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x28')]);}break;case _0x8e54('0x80'):var _0x3ff10d=_0x504022[_0x8e54('0x74')][_0x8e54('0x41')](',')[_0x8e54('0x3d')](function(_0x2d0eb8){return Number(_0x2d0eb8);});_0x3ff10d[_0x8e54('0x42')](function(_0x2942ac){_0x4c62d8['or'](_0x8e54('0x81'),'%,'+_0x2942ac+',%');});_0x2983ff=_[_0x8e54('0x82')](_0x2983ff,_0x3ff10d);break;case _0x8e54('0x83'):if(_0x504022[_0x8e54('0x79')]===_0x8e54('0x7a')){_0x13b1e2[_0x161f55](_0x8e54('0x84'),'%'+_0x504022[_0x8e54('0x74')]+'%',null);}else{_0x179eb4=_['find'](_0x5dd53b,[_0x8e54('0x34'),_0x8e54('0x49')]);_0x504022[_0x8e54('0x5e')]=_0x8e54('0x49');_0x5a3a0b=as[_0x8e54('0x7e')](_0x92f2fe,_0x179eb4[_0x8e54('0x4f')],_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b[_0x8e54('0x85')],_0x5a3a0b['value'][_0x8e54('0x7f')],_0x5a3a0b[_0x8e54('0x74')]['end']);}break;case _0x8e54('0x37'):_0x5a3a0b=as[_0x8e54('0x7e')]('me',null,_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b[_0x8e54('0x85')],_0x5a3a0b['value'][_0x8e54('0x7f')],_0x5a3a0b['value'][_0x8e54('0x28')]);break;}}else{var _0x5a3a0b=as['buildExpression'](_0x92f2fe,_0x179eb4[_0x8e54('0x4f')],_0x504022);_0x13b1e2[_0x161f55](_0x5a3a0b[_0x8e54('0x85')],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x7f')],_0x5a3a0b[_0x8e54('0x74')][_0x8e54('0x28')]);}}}else{var _0x68ccca=_(_0x13ed9f[_0x8e54('0x52')])[_0x8e54('0x51')]()[_0x8e54('0x3d')](function(_0x3e05da){return _[_0x8e54('0x86')](_0x5dd53b,[_0x8e54('0x34'),_0x3e05da])?_0x3e05da:undefined;})[_0x8e54('0x87')]()[_0x8e54('0x74')]();if(!_['isEmpty'](_0x68ccca)){_0x68ccca['forEach'](function(_0x43d783){if(_0x43d783===_0x8e54('0x88')){_0x1909a1[_0x8e54('0x5c')](_0x8e54('0x89'),[]['concat'](_0x13ed9f['query'][_0x43d783]));}else if(_0x43d783===_0x8e54('0x8a')){var _0x5a82f3=JSON[_0x8e54('0x8b')](_0x13ed9f[_0x8e54('0x52')][_0x43d783])['$gte'];var _0x31cc88=JSON[_0x8e54('0x8b')](_0x13ed9f[_0x8e54('0x52')][_0x43d783])[_0x8e54('0x8c')];_0x1909a1[_0x8e54('0x5c')](_0x8e54('0x8d'),_0x5a82f3,_0x31cc88);}else{if(_0x13ed9f[_0x8e54('0x52')][_0x43d783]===_0x8e54('0x8e')){_0x1909a1['where']('i.'+_0x43d783+_0x8e54('0x8f'));}else{_0x1909a1['where']('i.'+_0x43d783+_0x8e54('0x90'),_0x13ed9f[_0x8e54('0x52')][_0x43d783]);}}});}if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x91')]){if(_0x13ed9f['query'][_0x8e54('0x91')]==0x1){_0x1909a1[_0x8e54('0x75')]('`unreadMessages`\x20=\x200');}else{_0x1909a1[_0x8e54('0x75')](_0x8e54('0x92'));}}if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')]){_0x2983ff=_[_0x8e54('0x94')](_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')])?_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')]:new Array(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x93')]);_0x2983ff[_0x8e54('0x42')](function(_0x507350){_0x4c62d8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x507350+',%');});}if(_0x13ed9f['query'][_0x8e54('0x95')]){var _0x2c7d3a=_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x95')][_0x8e54('0x96')]('\x5c','\x5c\x5c')[_0x8e54('0x96')](/'/g,'\x27\x27');if(qs[_0x8e54('0x97')](_0x2c7d3a)){_0x13b1e2['or'](_0x8e54('0x98'),_0x2c7d3a+'%');}else{_0x13b1e2['or'](_0x8e54('0x99'),qs['getFullTextValue'](_0x2c7d3a))['or'](_0x8e54('0x9a'),_0x2c7d3a+'%');}}}_0x1909a1[_0x8e54('0x5c')](_0x13b1e2);_0x1909a1['group'](_0x8e54('0x9b'));var _0x36b506={'type':db['Sequelize']['QueryTypes'][_0x8e54('0x9c')],'raw':!![]};var _0x376edb=_0x1909a1[_0x8e54('0x9d')]();_0x376edb[_0x8e54('0x5e')](_0x8e54('0x9b'));_0x376edb['field'](_0x8e54('0x9e'),_0x8e54('0x73'));if(_0x4547a1[_0x8e54('0x9f')]){_0x4547a1['order'][_0x8e54('0x42')](function(_0x466d0d){var _0x3abffd=_0x466d0d[0x0]==='contactName'?_0x466d0d[0x0]:'i.'+_0x466d0d[0x0];_0x1909a1[_0x8e54('0x9f')](_0x3abffd,_0x466d0d[0x1]===_0x8e54('0xa0')?![]:!![]);});}if(!_[_0x8e54('0xa1')](_0x2983ff)){_0x1909a1['having'](_0x4c62d8);_0x376edb[_0x8e54('0x5c')](_0x8e54('0xa2'),_0x2983ff);}BPromise['resolve']()[_0x8e54('0x1b')](function(){if(!_0x4b3c28){if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x88')])return;_0x376edb[_0x8e54('0x5c')](_0x8e54('0xa3'));_0x1909a1[_0x8e54('0x5c')](_0x8e54('0xa3'));return;}if(_0x13ed9f[_0x8e54('0xa4')][_0x8e54('0xa5')]!==_0x8e54('0x39'))return;return _0x13ed9f['user'][_0x8e54('0xa6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x7e8960){if(_[_0x8e54('0xa1')](_0x7e8960)){_0x376edb[_0x8e54('0x5c')](_0x8e54('0xa7'));_0x1909a1[_0x8e54('0x5c')](_0x8e54('0xa7'));}else{_0x376edb[_0x8e54('0x5c')](_0x8e54('0x89'),_[_0x8e54('0x3d')](_0x7e8960,'id'));_0x1909a1['where'](_0x8e54('0x89'),_[_0x8e54('0x3d')](_0x7e8960,'id'));}});})[_0x8e54('0x1b')](function(){if(_0x13ed9f[_0x8e54('0xa4')][_0x8e54('0xa5')]===_0x8e54('0x39')&&!_0x4b3c28&&!_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x88')])return[];return db[_0x8e54('0xa8')][_0x8e54('0x52')](_0x376edb['toString'](),_0x36b506);})[_0x8e54('0x1b')](function(_0xd74d34){_0x356453[_0x8e54('0x2b')]=_0xd74d34[_0x8e54('0x58')];if(_0x356453[_0x8e54('0x2b')]===0x0)return[];return db[_0x8e54('0xa8')][_0x8e54('0x52')](_0x2ab246['toString'](),_0x36b506)[_0x8e54('0x1b')](function(_0x57e733){_0x4f11da=_[_0x8e54('0xa9')](_0x57e733,'id');_0x36b506=_[_0x8e54('0x36')](_0x36b506,{'model':db[_0x8e54('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13ed9f[_0x8e54('0x52')][_0x8e54('0x57')]){_0x4547a1[_0x8e54('0x56')][_0x8e54('0x42')](function(_0x136cc1){_0x1909a1[_0x8e54('0x5e')]('i.'+_0x136cc1);});}else{_0x1909a1[_0x8e54('0x5e')](_0x8e54('0x9e'),_0x8e54('0x73'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xaa'),_0x8e54('0xab'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xac'),'Account.mandatoryDisposition');_0x1909a1['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xad'));_0x1909a1[_0x8e54('0x5e')]('c.firstName',_0x8e54('0xae'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xaf'),_0x8e54('0xb0'));_0x1909a1['field'](_0x8e54('0xb1'),'Contact.email');_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb2'),'Contact.phone');_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb3'),_0x8e54('0xb4'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb5'),_0x8e54('0xb6'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xb7'),_0x8e54('0xb8'));_0x1909a1['field']('o.internal',_0x8e54('0xb9'));_0x1909a1[_0x8e54('0x5e')](_0x8e54('0xba'),_0x8e54('0x3f'));}if(_0x4547a1[_0x8e54('0x5a')])_0x1909a1[_0x8e54('0x5a')](_0x4547a1[_0x8e54('0x5a')]);if(_0x4547a1[_0x8e54('0x2c')])_0x1909a1[_0x8e54('0x2c')](_0x4547a1[_0x8e54('0x2c')]);return db[_0x8e54('0xa8')][_0x8e54('0x52')](_0x1909a1[_0x8e54('0xbb')](),_0x36b506);})[_0x8e54('0x1b')](function(_0x466f4c){if(_0x466f4c['length']>0x0)_0x2caff1[_0x8e54('0x5c')](_0x8e54('0xbc'),_[_0x8e54('0x3d')](_0x466f4c,'id'));return db['sequelize'][_0x8e54('0x52')](_0x2caff1[_0x8e54('0xbb')](),_0x36b506)[_0x8e54('0x1b')](function(_0x569530){var _0xdb3aa3=_[_0x8e54('0xbd')](_0x569530,'ChatInteractionId');var _0x17d258=[];_0x466f4c['forEach'](function(_0x444c57){_0x17d258['push'](updateChatInteraction(_0x444c57,_0x4f11da,_0xdb3aa3));});return BPromise[_0x8e54('0xbe')](_0x17d258);});});})['then'](function(_0x21f19b){_0x356453['rows']=_0x21f19b;return _0x356453;})['then'](respondWithFilteredResult(_0x2ec413,_0x4547a1))[_0x8e54('0x25')](handleError(_0x2ec413,null));};exports[_0x8e54('0xbf')]=function(_0x56d82b,_0x25261f){var _0x291f2b={'raw':![],'where':{'id':_0x56d82b['params']['id']}},_0x22468e={};_0x22468e[_0x8e54('0x55')]=_['keys'](db['ChatInteraction'][_0x8e54('0x4d')]);_0x22468e[_0x8e54('0x52')]=_[_0x8e54('0x51')](_0x56d82b['query']);_0x22468e['filters']=_['intersection'](_0x22468e[_0x8e54('0x55')],_0x22468e[_0x8e54('0x52')]);_0x291f2b[_0x8e54('0x56')]=_[_0x8e54('0x54')](_0x22468e[_0x8e54('0x55')],qs[_0x8e54('0x57')](_0x56d82b[_0x8e54('0x52')][_0x8e54('0x57')]));_0x291f2b[_0x8e54('0x56')]=_0x291f2b[_0x8e54('0x56')]['length']?_0x291f2b[_0x8e54('0x56')]:_0x22468e[_0x8e54('0x55')];if(_0x56d82b[_0x8e54('0x52')][_0x8e54('0xc0')]){_0x291f2b[_0x8e54('0xc1')]=[{'all':!![]}];}_0x291f2b=_[_0x8e54('0x36')]({},_0x291f2b,_0x56d82b[_0x8e54('0xc2')]);return db[_0x8e54('0x4c')][_0x8e54('0x72')](_0x291f2b)[_0x8e54('0x1b')](handleEntityNotFound(_0x25261f,null))[_0x8e54('0x1b')](respondWithResult(_0x25261f,null))[_0x8e54('0x25')](handleError(_0x25261f,null));};exports[_0x8e54('0xc3')]=function(_0x222fd,_0x4043db){return db[_0x8e54('0x4c')][_0x8e54('0xc3')](_0x222fd[_0x8e54('0x37')],{})['then'](respondWithResult(_0x4043db,0xc9))['catch'](handleError(_0x4043db,null));};exports['update']=function(_0x4ca1ff,_0x3d3279){if(_0x4ca1ff[_0x8e54('0x37')]['id']){delete _0x4ca1ff[_0x8e54('0x37')]['id'];}return db['ChatInteraction'][_0x8e54('0x72')]({'where':{'id':_0x4ca1ff[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x3d3279,null))['then'](saveUpdates(_0x4ca1ff[_0x8e54('0x37')],null))[_0x8e54('0x1b')](respondWithResult(_0x3d3279,null))[_0x8e54('0x25')](handleError(_0x3d3279,null));};exports[_0x8e54('0x32')]=function(_0x15cadf,_0x17b2da){return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x15cadf[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x17b2da,null))[_0x8e54('0x1b')](removeEntity(_0x17b2da,null))[_0x8e54('0x25')](handleError(_0x17b2da,null));};exports['describe']=function(_0x597e4f,_0xe76e35){return db['ChatInteraction'][_0x8e54('0xc5')]()[_0x8e54('0x1b')](respondWithResult(_0xe76e35,null))['catch'](handleError(_0xe76e35,null));};exports[_0x8e54('0xc6')]=function(_0x4bb181,_0x45ec3b){var _0x446f51=_0x4bb181[_0x8e54('0xc4')]['id'];var _0x240933;var _0x48a8eb;var _0x20f17d;return db[_0x8e54('0x4c')][_0x8e54('0xc7')]({'where':{'id':_0x446f51}})['then'](function(_0x1188ae){_0x240933=_0x1188ae;return db[_0x8e54('0xc8')][_0x8e54('0xc7')]({'where':{'id':_0x1188ae[_0x8e54('0x88')]},'attributes':['id',_0x8e54('0xc9'),'vidaooEscalation','vidaooTopic',_0x8e54('0xca'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x3c2582){if(_0x3c2582&&_0x3c2582[_0x8e54('0xc9')]&&_0x3c2582[_0x8e54('0xcb')]){_0x48a8eb=_0x3c2582;var _0x2091f4={'interaction':{'id':_0x446f51},'agent':{'id':_0x4bb181['user']['id'],'name':_0x4bb181['user'][_0x8e54('0x34')],'fullname':_0x4bb181[_0x8e54('0xa4')][_0x8e54('0x3e')],'email':_0x4bb181['user'][_0x8e54('0xcc')]},'contact':_0x4bb181[_0x8e54('0x37')][_0x8e54('0x38')],'account':_0x4bb181['body'][_0x8e54('0x3b')]};var _0x4a6f80={'rejectUnauthorized':![],'method':_0x8e54('0xcd'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3c2582['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4bb181[_0x8e54('0xa4')]['email']],'buttons':null,'topic':_0x48a8eb[_0x8e54('0xce')],'note':_[_0x8e54('0xcf')](_0x48a8eb[_0x8e54('0xca')])?null:getMustacheRender(_0x48a8eb[_0x8e54('0xca')],_0x2091f4),'metadata':null},'redirect':_0x8e54('0xd0'),'json':!![]};try{if(!_['isNull'](_0x48a8eb['vidaooMetadata'])){var _0x362edd=getMustacheRender(_0x48a8eb[_0x8e54('0xd1')],_0x2091f4);var _0x27bdb4=JSON[_0x8e54('0x8b')](_0x362edd);_0x4a6f80[_0x8e54('0x37')][_0x8e54('0xd2')]=_0x27bdb4;}}catch(_0x3c58aa){throw new db[(_0x8e54('0xd3'))][(_0x8e54('0xd4'))](_0x8e54('0xd5'));}return rp(_0x4a6f80);}else{throw new db[(_0x8e54('0xd3'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x8e54('0x1b')](function(_0x2a2bf){_0x20f17d=_0x2a2bf;if(_0x20f17d['id']){var _0x30ce5c={'body':_0x20f17d[_0x8e54('0xd6')],'ChatWebsiteId':_0x48a8eb['id'],'ChatInteractionId':_0x240933['id'],'direction':_0x8e54('0xd7'),'UserId':_0x4bb181[_0x8e54('0xa4')]['id']};return db[_0x8e54('0xd8')][_0x8e54('0xc3')](_0x30ce5c,{});}else{throw new db['Sequelize'][(_0x8e54('0xd4'))](_0x8e54('0xd9'));}})[_0x8e54('0x1b')](function(){return _0x240933[_0x8e54('0xda')]({'vidaooSessionId':_0x20f17d['id']});})[_0x8e54('0x1b')](respondWithResult(_0x45ec3b,null))[_0x8e54('0x25')](handleError(_0x45ec3b,null));};exports[_0x8e54('0xdb')]=function(_0x3a057d,_0x17089f){if(_0x3a057d[_0x8e54('0x37')]['id']){delete _0x3a057d['body']['id'];}return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x3a057d[_0x8e54('0xc4')]['id']},'include':[{'model':db['CmContact'],'as':_0x8e54('0x78')}]})[_0x8e54('0x1b')](handleEntityNotFound(_0x17089f,null))[_0x8e54('0x1b')](saveUpdates(_0x3a057d[_0x8e54('0x37')],null))['then'](respondWithResult(_0x17089f,null))[_0x8e54('0x25')](handleError(_0x17089f,null));};exports['abandon']=function(_0x43e4c8,_0x4789f3,_0x3671cc){if(_0x43e4c8['body']['id']){delete _0x43e4c8[_0x8e54('0x37')]['id'];}return db['ChatInteraction'][_0x8e54('0x72')]({'where':{'id':_0x43e4c8[_0x8e54('0xc4')]['id']}})['then'](function(_0x1946e8){if(!_0x1946e8){logger[_0x8e54('0x22')](_0x8e54('0xdc'),'abandon',0x194,_0x8e54('0xdd'));_0x4789f3[_0x8e54('0x26')](0x194);}else{if(_0x1946e8['UserId']){throw new db[(_0x8e54('0xd3'))][(_0x8e54('0xd4'))](_0x8e54('0xde'));}}return _0x1946e8;})[_0x8e54('0x1b')](function(_0x2cff9c){if(_0x2cff9c){return _0x2cff9c['update']({'closed':_0x43e4c8[_0x8e54('0x37')][_0x8e54('0x48')],'disposition':_0x43e4c8['body'][_0x8e54('0xdf')]})['then'](function(_0x447b73){return _0x447b73;});}})[_0x8e54('0x1b')](function(_0x23ce80){return respondWithRpcPromise(_0x8e54('0xe0'),_0x8e54('0xe1'),_0x43e4c8[_0x8e54('0x37')],client9004);})[_0x8e54('0x1b')](respondWithResult(_0x4789f3,null))[_0x8e54('0x25')](handleError(_0x4789f3,null));};exports['attachmentUpload']=function(_0x134fc2,_0x32ce95,_0x53905e){_0x134fc2[_0x8e54('0x37')][_0x8e54('0x34')]=_0x134fc2['file'][_0x8e54('0xe2')];_0x134fc2[_0x8e54('0x37')][_0x8e54('0xe3')]=_0x134fc2[_0x8e54('0xe4')][_0x8e54('0xe5')];_0x134fc2[_0x8e54('0x37')][_0x8e54('0x4f')]=_0x134fc2[_0x8e54('0xe4')]['mimetype'];return db[_0x8e54('0xe6')][_0x8e54('0xc3')](_0x134fc2[_0x8e54('0x37')])[_0x8e54('0x1b')](respondWithResult(_0x32ce95,0xc9))[_0x8e54('0x25')](handleError(_0x32ce95,null));};exports[_0x8e54('0xe7')]=function(_0x1a7071,_0x226979,_0x26a1b3){return db[_0x8e54('0x4c')][_0x8e54('0xc7')]({'where':{'id':_0x1a7071['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x226979,null))[_0x8e54('0x1b')](function(_0x30a5d2){if(_0x30a5d2){if(_0x30a5d2[_0x8e54('0x48')]){return _0x226979[_0x8e54('0x27')](0x193)['json']({'status':0x193,'message':_0x8e54('0xe8')});}return db[_0x8e54('0xe6')][_0x8e54('0xc7')]({'where':{'id':_0x1a7071[_0x8e54('0x52')]['attachId']},'raw':!![]})[_0x8e54('0x1b')](handleEntityNotFound(_0x226979,null));}})[_0x8e54('0x1b')](function(_0x244801){if(_0x244801){var _0x52f037=_0x244801[_0x8e54('0xe9')]!==null;var _0x59238d=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server/files/attachments/');if(_0x52f037){_0x59238d=path[_0x8e54('0xea')](_0x59238d,_0x8e54('0xec'));}var _0x340251=path[_0x8e54('0xea')](_0x59238d,_0x244801['basename']);return _0x226979['download'](_0x340251);}})[_0x8e54('0x25')](handleError(_0x226979,null));};exports['close']=function(_0x50bb33,_0x3e84b0){var _0x4cb5a9=null;var _0x243b25=null;var _0x3eea2d=null;var _0x4f4adb=null;if(_0x50bb33[_0x8e54('0x37')]['id']){delete _0x50bb33[_0x8e54('0x37')]['id'];}if(_0x50bb33[_0x8e54('0x37')][_0x8e54('0xed')]){_0x4f4adb=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server/files/chat/upload/',util[_0x8e54('0xee')]('transcript-%s.txt',Date[_0x8e54('0xef')]()));_0x50bb33[_0x8e54('0x37')][_0x8e54('0xf0')]=_0x4f4adb;}return db[_0x8e54('0x4c')]['find']({'where':{'id':_0x50bb33[_0x8e54('0xc4')]['id']},'include':[{'model':db[_0x8e54('0xd8')],'as':_0x8e54('0xf1'),'include':[{'model':db['User'],'as':_0x8e54('0x83')}]}]})[_0x8e54('0x1b')](handleEntityNotFound(_0x3e84b0,null))[_0x8e54('0x1b')](saveUpdates(_0x50bb33[_0x8e54('0x37')],null))[_0x8e54('0x1b')](function(_0x36ef1a){if(_0x36ef1a){_0x4cb5a9=_0x36ef1a;return db[_0x8e54('0xc8')][_0x8e54('0x72')]({'where':{'id':_0x4cb5a9['ChatWebsiteId']}});}})[_0x8e54('0x1b')](function(_0x59c4cb){if(_0x59c4cb){_0x3eea2d=_0x59c4cb;return db['CmContact']['find']({'where':{'id':_0x4cb5a9['ContactId']}});}})[_0x8e54('0x1b')](function(_0x43d997){if(_0x43d997){_0x243b25=_0x43d997;if(_0x4f4adb){var _0x26362f=null;for(var _0x3de25d=0x1;_0x3de25d<_0x4cb5a9[_0x8e54('0xf1')]['length'];++_0x3de25d){_0x26362f=_0x4cb5a9['Messages'][_0x3de25d];var _0x166278=_0x26362f[_0x8e54('0x49')]?util[_0x8e54('0xee')](_0x8e54('0xf2'),_0x3eea2d[_0x8e54('0xf3')],_0x26362f['UserId']):_0x8e54('0xf4');var _0x400226=_0x50bb33['body'][_0x8e54('0xf5')]||util[_0x8e54('0xee')]('%s%d',_0x8e54('0xf6'),_0x26362f[_0x8e54('0x7d')]);switch(_0x3eea2d['agentIdentifier']){case'website_alias':_0x166278=_0x26362f[_0x8e54('0x49')]?util[_0x8e54('0xee')](_0x8e54('0xf2'),_0x3eea2d[_0x8e54('0xf3')],_0x26362f['UserId']):_0x8e54('0xf4');break;case _0x8e54('0xf7'):_0x166278=_0x26362f[_0x8e54('0x49')]?_0x26362f[_0x8e54('0x83')][_0x8e54('0xf8')]||_0x26362f[_0x8e54('0x83')]['fullname']:_0x8e54('0xf4');break;case _0x8e54('0xf9'):_0x166278=_0x26362f['UserId']?_0x26362f[_0x8e54('0x83')][_0x8e54('0x3e')]:'System';break;default:_0x166278=_0x26362f[_0x8e54('0x49')]?util[_0x8e54('0xee')]('%s%d',_0x3eea2d[_0x8e54('0xf3')],_0x26362f[_0x8e54('0x49')]):_0x8e54('0xf4');}var _0x25d47a=util[_0x8e54('0xee')](_0x8e54('0xfa'),moment(_0x26362f['createdAt'])[_0x8e54('0xee')](_0x8e54('0xfb')),_0x26362f['direction']==='in'?_0x400226:_0x166278,_0x26362f['body']);if(!_0x26362f[_0x8e54('0xfc')]){fs['appendFileSync'](_0x4f4adb,_0x25d47a);}}return db[_0x8e54('0xfd')][_0x8e54('0xc7')]({'where':{'service':!![]},'include':[{'model':db[_0x8e54('0xfe')],'as':_0x8e54('0xff'),'raw':!![]}]});}}})[_0x8e54('0x1b')](function(_0x246f84){if(_0x246f84&&_0x246f84[_0x8e54('0xff')]&&_0x50bb33[_0x8e54('0x37')]){var _0x30390a={'tls':{'rejectUnauthorized':![]}};if(_0x246f84[_0x8e54('0xff')][_0x8e54('0x100')]){_0x30390a[_0x8e54('0x100')]=_0x246f84[_0x8e54('0xff')]['service'];}else{_0x30390a[_0x8e54('0x101')]=_0x246f84[_0x8e54('0xff')][_0x8e54('0x101')];_0x30390a[_0x8e54('0x102')]=_0x246f84[_0x8e54('0xff')][_0x8e54('0x102')];_0x30390a[_0x8e54('0x103')]=_0x246f84[_0x8e54('0xff')][_0x8e54('0x103')];}if(_0x246f84['Smtp'][_0x8e54('0x104')]){_0x30390a[_0x8e54('0x105')]={'user':_0x246f84[_0x8e54('0xff')][_0x8e54('0xa4')],'pass':_0x246f84[_0x8e54('0xff')]['pass']};}return respondWithRpcPromise(_0x8e54('0x106'),'sendMail',{'account':_0x30390a,'message':{'from':util[_0x8e54('0xee')](_0x8e54('0x107'),_0x246f84['name'],_0x246f84[_0x8e54('0xcc')]||_0x246f84[_0x8e54('0xff')]['user']),'to':_0x50bb33[_0x8e54('0x37')][_0x8e54('0xed')],'subject':'Mail\x20Transcript','text':util[_0x8e54('0xee')](_0x8e54('0x108'),_0x50bb33[_0x8e54('0x37')]['mailTranscript']),'attachments':[{'path':_0x4f4adb}]}})['then'](function(){return _0x4cb5a9;})[_0x8e54('0x25')](function(_0x55552d){console[_0x8e54('0x22')](_0x55552d);});}else{return _0x4cb5a9;}})['then'](respondWithStatusCode(_0x3e84b0,0xc8))[_0x8e54('0x25')](handleError(_0x3e84b0,null));};exports[_0x8e54('0x109')]=function(_0x1f485d,_0x2f596d,_0x4dde7a){return db[_0x8e54('0xd8')]['find']({'where':{'id':_0x1f485d['params']['id']}})['then'](handleEntityNotFound(_0x2f596d,null))[_0x8e54('0x1b')](function(_0x5bae5a){if(_0x5bae5a){return _0x5bae5a[_0x8e54('0x109')](_0x1f485d[_0x8e54('0x37')]['ids'],_['omit'](_0x1f485d[_0x8e54('0x37')],[_0x8e54('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x2f596d,null))['catch'](handleError(_0x2f596d,null));};exports[_0x8e54('0x10b')]=function(_0x31658a,_0x1ccf19,_0x1d0bd8){var _0x56972b={'raw':![],'where':{}};var _0x2b6229={};var _0x16a03c={'count':0x0,'rows':[]};return db[_0x8e54('0x4c')]['findOne']({'where':{'id':_0x31658a[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x1ccf19,null))[_0x8e54('0x1b')](function(_0x2ff21f){if(_0x2ff21f){_0x2b6229['model']=_['keys'](db['ChatMessage'][_0x8e54('0x4d')]);_0x2b6229[_0x8e54('0x52')]=_[_0x8e54('0x51')](_0x31658a[_0x8e54('0x52')]);_0x2b6229['filters']=_[_0x8e54('0x54')](_0x2b6229['model'],_0x2b6229['query']);_0x56972b['attributes']=_[_0x8e54('0x54')](_0x2b6229['model'],qs['fields'](_0x31658a[_0x8e54('0x52')][_0x8e54('0x57')]));_0x56972b['attributes']=_0x56972b[_0x8e54('0x56')][_0x8e54('0x58')]?_0x56972b[_0x8e54('0x56')]:_0x2b6229[_0x8e54('0x55')];if(!_0x31658a[_0x8e54('0x52')][_0x8e54('0x59')](_0x8e54('0x10c'))){_0x56972b[_0x8e54('0x5a')]=qs[_0x8e54('0x5a')](_0x31658a[_0x8e54('0x52')][_0x8e54('0x5a')]);_0x56972b[_0x8e54('0x2c')]=qs['offset'](_0x31658a[_0x8e54('0x52')][_0x8e54('0x2c')]);}_0x56972b['order']=qs[_0x8e54('0x5b')](_0x31658a[_0x8e54('0x52')][_0x8e54('0x5b')]);_0x56972b[_0x8e54('0x5c')]=qs[_0x8e54('0x53')](_['pick'](_0x31658a[_0x8e54('0x52')],_0x2b6229[_0x8e54('0x53')]));_0x56972b[_0x8e54('0x5c')][_0x8e54('0x10d')]=_0x2ff21f['id'];if(_0x31658a['query']['filter']){_0x56972b['where']=_[_0x8e54('0x36')](_0x56972b[_0x8e54('0x5c')],{'$or':_['map'](_0x56972b[_0x8e54('0x56')],function(_0xe1930c){var _0x1b5e6c={};_0x1b5e6c[_0xe1930c]={'$like':'%'+_0x31658a[_0x8e54('0x52')]['filter']+'%'};return _0x1b5e6c;})});}if(_0x31658a['query'][_0x8e54('0x10e')]){var _0x3bf973=_0x31658a[_0x8e54('0x52')][_0x8e54('0x10e')][_0x8e54('0x41')](',');var _0x553267={};_0x553267[_0x3bf973[0x0]]={'$gte':moment(_0x3bf973[0x1])[_0x8e54('0xee')](_0x8e54('0x10f'))};_0x56972b[_0x8e54('0x5c')]=_['merge'](_0x56972b[_0x8e54('0x5c')],_0x553267);}_0x56972b=_[_0x8e54('0x36')]({},_0x56972b,_0x31658a[_0x8e54('0xc2')]);return db[_0x8e54('0xd8')][_0x8e54('0x2b')]({'where':_0x56972b[_0x8e54('0x5c')]})[_0x8e54('0x1b')](function(_0x363998){_0x16a03c[_0x8e54('0x2b')]=_0x363998;if(_0x31658a['query'][_0x8e54('0xc0')]){_0x56972b['include']=[{'all':!![]}];}return db[_0x8e54('0xd8')][_0x8e54('0x110')](_0x56972b);})[_0x8e54('0x1b')](function(_0x27e69c){_0x16a03c[_0x8e54('0x111')]=_0x27e69c;return _0x16a03c;});}})[_0x8e54('0x1b')](respondWithFilteredResult(_0x1ccf19,_0x56972b))['catch'](handleError(_0x1ccf19,null));};exports[_0x8e54('0x112')]=function(_0x14f171,_0x4400e2,_0x59c35d){var _0x48f370={'where':{}},_0x529d70={},_0x1441d9={'count':0x0,'rows':[]};return db[_0x8e54('0x4c')][_0x8e54('0xc7')]({'where':{'id':_0x14f171[_0x8e54('0xc4')]['id']}})['then'](handleEntityNotFound(_0x4400e2,null))[_0x8e54('0x1b')](function(_0x9a8635){if(_0x9a8635){_0x529d70[_0x8e54('0x55')]=_['keys'](db[_0x8e54('0xd8')][_0x8e54('0x4d')]);_0x529d70['query']=_[_0x8e54('0x51')](_0x14f171[_0x8e54('0x52')]);_0x529d70[_0x8e54('0x53')]=_[_0x8e54('0x54')](_0x529d70[_0x8e54('0x55')],_0x529d70[_0x8e54('0x52')]);_0x48f370['attributes']=_[_0x8e54('0x54')](_0x529d70[_0x8e54('0x55')],qs[_0x8e54('0x57')](_0x14f171[_0x8e54('0x52')][_0x8e54('0x57')]));_0x48f370[_0x8e54('0x56')]=_0x48f370['attributes'][_0x8e54('0x58')]?_0x48f370[_0x8e54('0x56')]:_0x529d70[_0x8e54('0x55')];if(!_0x14f171[_0x8e54('0x52')]['hasOwnProperty']('nolimit')){_0x48f370[_0x8e54('0x5a')]=qs[_0x8e54('0x5a')](_0x14f171['query'][_0x8e54('0x5a')]);_0x48f370[_0x8e54('0x2c')]=qs['offset'](_0x14f171[_0x8e54('0x52')]['offset']);}_0x48f370[_0x8e54('0x9f')]=qs[_0x8e54('0x5b')](_0x14f171[_0x8e54('0x52')][_0x8e54('0x5b')]);_0x48f370[_0x8e54('0x5c')]=qs['filters'](_[_0x8e54('0x5d')](_0x14f171['query'],_0x529d70[_0x8e54('0x53')]));_0x48f370[_0x8e54('0x5c')][_0x8e54('0x10d')]=_0x9a8635['id'];if(_0x14f171[_0x8e54('0x52')][_0x8e54('0x95')]){_0x48f370[_0x8e54('0x5c')]=_[_0x8e54('0x36')](_0x48f370[_0x8e54('0x5c')],{'$or':_['map'](_0x48f370[_0x8e54('0x56')],function(_0x54f3f4){var _0x4d1652={};_0x4d1652[_0x54f3f4]={'$like':'%'+_0x14f171[_0x8e54('0x52')][_0x8e54('0x95')]+'%'};return _0x4d1652;})});}_0x48f370['where'][_0x8e54('0xfc')]=![];if(_0x14f171[_0x8e54('0x52')]['id']){_0x48f370[_0x8e54('0x5c')]['id']={'$gt':_0x14f171[_0x8e54('0x52')]['id']};}_0x48f370=_[_0x8e54('0x36')]({},_0x48f370,_0x14f171[_0x8e54('0xc2')]);return db[_0x8e54('0xd8')][_0x8e54('0x2b')]({'where':_0x48f370[_0x8e54('0x5c')]})[_0x8e54('0x1b')](function(_0x49df41){_0x1441d9[_0x8e54('0x2b')]=_0x49df41;_0x48f370[_0x8e54('0xc1')]=[];if(_0x14f171[_0x8e54('0x52')][_0x8e54('0x113')]){_0x48f370['include']['push']({'model':db[_0x8e54('0x83')],'as':_0x8e54('0x83'),'attributes':['id',_0x8e54('0x3e'),_0x8e54('0xf8')]});}if(_0x14f171[_0x8e54('0x52')][_0x8e54('0xc0')]){_0x48f370['include']=[{'all':!![]}];}return db[_0x8e54('0xd8')][_0x8e54('0x110')](_0x48f370);})[_0x8e54('0x1b')](function(_0x4b8dc0){_0x1441d9[_0x8e54('0x111')]=_0x4b8dc0;return _0x1441d9;});}})[_0x8e54('0x1b')](respondWithFilteredResult(_0x4400e2,_0x48f370))[_0x8e54('0x25')](handleError(_0x4400e2,null));};exports[_0x8e54('0x114')]=function(_0x4aeaaa,_0x443245,_0x592130){return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x4aeaaa[_0x8e54('0xc4')]['id']}})['then'](handleEntityNotFound(_0x443245,null))[_0x8e54('0x1b')](function(_0x4a4b40){if(_0x4a4b40){return _0x4a4b40[_0x8e54('0x115')](_0x4aeaaa[_0x8e54('0x37')]['ids'],_[_0x8e54('0x116')](_0x4aeaaa[_0x8e54('0x37')],[_0x8e54('0x10a'),'id'])||{})[_0x8e54('0x117')](function(){return db[_0x8e54('0x80')][_0x8e54('0x110')]({'attributes':['id',_0x8e54('0x34'),_0x8e54('0x118')],'where':{'id':_0x4aeaaa[_0x8e54('0x37')][_0x8e54('0x10a')]}});})[_0x8e54('0x1b')](function(_0x35f1ae){socket[_0x8e54('0x119')](_0x8e54('0x11a'),{'id':Number(_0x4aeaaa[_0x8e54('0xc4')]['id']),'tags':_0x35f1ae||[]});return{'id':Number(_0x4aeaaa[_0x8e54('0xc4')]['id']),'tags':_0x35f1ae||[]};});}})[_0x8e54('0x1b')](respondWithResult(_0x443245,null))['catch'](handleError(_0x443245,null));};exports[_0x8e54('0x11b')]=function(_0x4c1e5d,_0x2f0902,_0x16e904){return db[_0x8e54('0x4c')][_0x8e54('0x72')]({'where':{'id':_0x4c1e5d[_0x8e54('0xc4')]['id']}})[_0x8e54('0x1b')](handleEntityNotFound(_0x2f0902,null))[_0x8e54('0x1b')](function(_0x31201f){if(_0x31201f){return _0x31201f[_0x8e54('0x11b')](_0x4c1e5d[_0x8e54('0x52')][_0x8e54('0x10a')]);}})[_0x8e54('0x1b')](respondWithStatusCode(_0x2f0902,null))[_0x8e54('0x25')](handleError(_0x2f0902,null));};exports[_0x8e54('0x11c')]=function(_0x41fbb3,_0x9fd6e7){var _0x545fd2=moment()[_0x8e54('0x11d')]()['toString']();var _0x5f1e63=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server','files',_0x8e54('0x11e'));var _0x26cb92=path[_0x8e54('0xea')](config[_0x8e54('0xeb')],'server',_0x8e54('0x11f'),_0x8e54('0x120'));var _0x452f19=path['join'](_0x5f1e63,_0x545fd2);var _0x42d030=util[_0x8e54('0xee')](_0x8e54('0x121'),_0x41fbb3[_0x8e54('0xc4')]['id'],_0x545fd2);var _0x22c50d=path[_0x8e54('0xea')](_0x5f1e63,_0x42d030);var _0x4d4e0b=[];_0x4d4e0b[_0x8e54('0x122')]({'model':db[_0x8e54('0x83')],'as':'User','attributes':['id',_0x8e54('0x3e')],'raw':!![]});_0x4d4e0b[_0x8e54('0x122')]({'model':db[_0x8e54('0x123')],'as':_0x8e54('0x78'),'attributes':['id',_0x8e54('0x124'),'lastName'],'raw':!![]});if(_0x41fbb3[_0x8e54('0x52')][_0x8e54('0x120')]){_0x4d4e0b['push']({'model':db['Attachment'],'as':_0x8e54('0xe6'),'raw':!![]});}var _0x3b4825=[{'model':db['ChatMessage'],'as':_0x8e54('0xf1'),'attributes':['id',_0x8e54('0x37'),_0x8e54('0x8a'),_0x8e54('0x125'),_0x8e54('0xfc'),_0x8e54('0x91')],'include':_0x4d4e0b}];_0x3b4825['push']({'model':db[_0x8e54('0xc8')],'as':_0x8e54('0x126'),'attributes':['id',_0x8e54('0x34')]});_0x3b4825[_0x8e54('0x122')]({'model':db[_0x8e54('0x83')],'as':_0x8e54('0x127'),'attributes':['id',_0x8e54('0x3e')]});return db[_0x8e54('0x4c')]['find']({'where':{'id':_0x41fbb3[_0x8e54('0xc4')]['id']},'include':_0x3b4825})[_0x8e54('0x1b')](handleEntityNotFound(_0x9fd6e7,null))['then'](function(_0x27ad0d){if(_0x27ad0d){var _0x1b5d08=_0x27ad0d[_0x8e54('0x128')]({'plain':!![]});fs[_0x8e54('0x129')](_0x452f19);var _0x38e134={'channel':'Chat','account':_0x1b5d08[_0x8e54('0x126')][_0x8e54('0x34')],'agent':_0x1b5d08[_0x8e54('0x127')]?_0x1b5d08[_0x8e54('0x127')][_0x8e54('0x3e')]:_0x8e54('0x12a'),'createdAt':moment(_0x1b5d08['createdAt'])[_0x8e54('0xee')](_0x8e54('0x10f'))[_0x8e54('0xbb')](),'closedAt':_0x1b5d08['closed']?moment(_0x1b5d08[_0x8e54('0x12b')])[_0x8e54('0xee')](_0x8e54('0x10f'))[_0x8e54('0xbb')]():'','disposition':_0x1b5d08[_0x8e54('0xdf')],'chatInfo':{'browser':_0x1b5d08[_0x8e54('0x12c')],'os':_0x1b5d08[_0x8e54('0x12d')],'referer':_0x1b5d08[_0x8e54('0x12e')],'customerIp':_0x1b5d08['customerIp'],'customerPort':_0x1b5d08[_0x8e54('0x12f')]?_0x1b5d08['customerPort']:_0x8e54('0x12a')},'messages':_(_0x1b5d08[_0x8e54('0xf1')])[_0x8e54('0x130')]()['filter']({'secret':![]})['map'](function(_0x160b7a){if(_0x160b7a[_0x8e54('0xe6')]){var _0x593fea=path[_0x8e54('0xea')](_0x26cb92,_0x160b7a[_0x8e54('0xe6')][_0x8e54('0xe3')]);if(fs[_0x8e54('0x131')](_0x593fea)){fs[_0x8e54('0x132')](_0x593fea)[_0x8e54('0x133')](fs[_0x8e54('0x134')](path[_0x8e54('0xea')](_0x452f19,_0x160b7a['Attachment'][_0x8e54('0xe3')])));}}return{'date':moment(_0x160b7a[_0x8e54('0x8a')])[_0x8e54('0xee')](_0x8e54('0x10f'))[_0x8e54('0xbb')](),'sender':_0x160b7a[_0x8e54('0x125')]==='out'?_0x160b7a['User']?_0x160b7a[_0x8e54('0x83')]['fullname']:_0x8e54('0xf4'):_0x160b7a[_0x8e54('0x78')][_0x8e54('0x124')]+(_0x160b7a[_0x8e54('0x78')][_0x8e54('0x135')]?'\x20'+_0x160b7a[_0x8e54('0x78')][_0x8e54('0x135')]:''),'body':_0x160b7a[_0x8e54('0xe6')]?_0x160b7a[_0x8e54('0xe6')][_0x8e54('0xe3')]:_0x160b7a['body'],'direction':_0x160b7a[_0x8e54('0x125')]==='out'?'A':'C','secret':_0x160b7a['secret'],'read':_0x160b7a[_0x8e54('0x91')],'attachment':_0x160b7a[_0x8e54('0xe6')]};})[_0x8e54('0x74')]()};return ejs['renderFile'](path[_0x8e54('0xea')](config[_0x8e54('0xeb')],_0x8e54('0x136'),'views','downloadInteraction.ejs'),{'interaction':_0x38e134})[_0x8e54('0x1b')](function(_0x47595f){var _0x544760=path['join'](_0x452f19,_0x8e54('0x137')+_0x1b5d08['id']+'-'+_0x545fd2+_0x8e54('0x138'));var _0x133caa={'path':_0x544760,'channel':_0x8e54('0x139'),'interactionId':_0x1b5d08['id']};return pdf[_0x8e54('0x13a')](_0x47595f,_0x133caa);})[_0x8e54('0x1b')](function(){return new BPromise(function(_0x5d1047,_0xbf01c3){zipdir(_0x452f19,{'saveTo':_0x22c50d},function(_0x364f83,_0x33222c){if(_0x364f83)return _0xbf01c3(_0x364f83);return _0x5d1047(_0x33222c);});})[_0x8e54('0x1b')](function(){return new BPromise(function(_0x880965,_0xfa0fc5){rimraf(_0x452f19,function(_0x32c5ae){if(_0x32c5ae)_0xfa0fc5(_0x32c5ae);return _0x880965();});});})[_0x8e54('0x1b')](function(){return _0x9fd6e7[_0x8e54('0x11c')](_0x22c50d,_0x42d030,function(_0x5c595f){if(_0x5c595f){console[_0x8e54('0x13b')](_0x8e54('0x13c'),_0x5c595f);}else{fs[_0x8e54('0x13d')](_0x22c50d);}});});});}else{return _0x9fd6e7[_0x8e54('0x26')](0xc8);}})[_0x8e54('0x25')](handleError(_0x9fd6e7,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 78cd852..3240f76 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 _0x24f6=['then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','ChatMessage','update','getUsers'];(function(_0xabbba3,_0x5a3f85){var _0x592f33=function(_0x274818){while(--_0x274818){_0xabbba3['push'](_0xabbba3['shift']());}};_0x592f33(++_0x5a3f85);}(_0x24f6,0x14c));var _0x624f=function(_0x327352,_0x2dbf17){_0x327352=_0x327352-0x0;var _0x58e9ba=_0x24f6[_0x327352];return _0x58e9ba;};'use strict';var EventEmitter=require(_0x624f('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x624f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x624f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x6c9577){return function(_0x4c3005,_0x5170cd,_0x424f64){_0x4c3005[_0x624f('0x3')]({'attributes':['id'],'raw':!![]})[_0x624f('0x4')](function(_0x142069){_0x4c3005[_0x624f('0x5')](_0x624f('0x6'),_0x142069[_0x624f('0x7')](function(_0x4c12e0){return{'id':_0x4c12e0['id']};}));return ChatMessage[_0x624f('0x8')]({'where':{'ChatInteractionId':_0x4c3005['id'],'direction':'in','read':![]},'raw':!![]});})[_0x624f('0x4')](function(_0x5b7b27){_0x4c3005[_0x624f('0x5')]('unreadMessages',_0x5b7b27['length']);ChatInteractionEvents[_0x624f('0x9')](_0x6c9577+':'+_0x4c3005['id'],_0x4c3005);ChatInteractionEvents[_0x624f('0x9')](_0x6c9577,_0x4c3005);_0x424f64(null);})[_0x624f('0xa')](_0x424f64(null));};}for(var e in events){if(events[_0x624f('0xb')](e)){var event=events[e];ChatInteraction[_0x624f('0xc')](e,emitEvent(event));}}module[_0x624f('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xec7a=['exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1b2ea4,_0x6bdeda){var _0x22c566=function(_0x527414){while(--_0x527414){_0x1b2ea4['push'](_0x1b2ea4['shift']());}};_0x22c566(++_0x6bdeda);}(_0xec7a,0x91));var _0xaec7=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xec7a[_0xbec8e6];return _0x4aa6f2;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xaec7('0x0'))['db'][_0xaec7('0x1')];var ChatMessage=require(_0xaec7('0x0'))['db'][_0xaec7('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xaec7('0x3')](0x0);var events={'afterCreate':_0xaec7('0x4'),'afterUpdate':'update','afterDestroy':_0xaec7('0x5')};function emitEvent(_0x50e962){return function(_0x3bcae4,_0x41f570,_0xb5cadf){_0x3bcae4['getUsers']({'attributes':['id'],'raw':!![]})[_0xaec7('0x6')](function(_0x128189){_0x3bcae4[_0xaec7('0x7')]('Users',_0x128189[_0xaec7('0x8')](function(_0x250a97){return{'id':_0x250a97['id']};}));return ChatMessage[_0xaec7('0x9')]({'where':{'ChatInteractionId':_0x3bcae4['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaec7('0x6')](function(_0x107eb2){_0x3bcae4[_0xaec7('0x7')](_0xaec7('0xa'),_0x107eb2[_0xaec7('0xb')]);ChatInteractionEvents[_0xaec7('0xc')](_0x50e962+':'+_0x3bcae4['id'],_0x3bcae4);ChatInteractionEvents['emit'](_0x50e962,_0x3bcae4);_0xb5cadf(null);})[_0xaec7('0xd')](_0xb5cadf(null));};}for(var e in events){if(events[_0xaec7('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xaec7('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 7e40776..4d1a7d8 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 _0xb0d8=['path','rimraf','../../config/environment','exports','define','chat_interactions','changed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20b1e0,_0x5371f9){var _0x25ebd7=function(_0x36383c){while(--_0x36383c){_0x20b1e0['push'](_0x20b1e0['shift']());}};_0x25ebd7(++_0x5371f9);}(_0xb0d8,0x1e6));var _0x8b0d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb0d8[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x8b0d('0x0'));var util=require(_0x8b0d('0x1'));var logger=require(_0x8b0d('0x2'))(_0x8b0d('0x3'));var moment=require(_0x8b0d('0x4'));var BPromise=require(_0x8b0d('0x5'));var rp=require(_0x8b0d('0x6'));var fs=require('fs');var path=require(_0x8b0d('0x7'));var rimraf=require(_0x8b0d('0x8'));var config=require(_0x8b0d('0x9'));var attributes=require('./chatInteraction.attributes');module[_0x8b0d('0xa')]=function(_0x454cba,_0x87ba0e){return _0x454cba[_0x8b0d('0xb')]('ChatInteraction',attributes,{'tableName':_0x8b0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f0bc8,_0x267d3c,_0x14df61){if(_0x4f0bc8[_0x8b0d('0xd')]('closed')){_0x4f0bc8['closedAt']=moment()[_0x8b0d('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14df61(null,_0x4f0bc8);}},'charset':_0x8b0d('0xf'),'collate':_0x8b0d('0x10')});}; \ No newline at end of file +var _0xed47=['rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0xed47,0x139));var _0x7ed4=function(_0x22aabe,_0x1667d4){_0x22aabe=_0x22aabe-0x0;var _0x7ae05=_0xed47[_0x22aabe];return _0x7ae05;};'use strict';var _=require(_0x7ed4('0x0'));var util=require(_0x7ed4('0x1'));var logger=require(_0x7ed4('0x2'))('api');var moment=require(_0x7ed4('0x3'));var BPromise=require(_0x7ed4('0x4'));var rp=require(_0x7ed4('0x5'));var fs=require('fs');var path=require(_0x7ed4('0x6'));var rimraf=require(_0x7ed4('0x7'));var config=require(_0x7ed4('0x8'));var attributes=require(_0x7ed4('0x9'));module['exports']=function(_0x303d21,_0x14020f){return _0x303d21['define'](_0x7ed4('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5856ed,_0x18db16,_0x4b3211){if(_0x5856ed[_0x7ed4('0xb')]('closed')){_0x5856ed[_0x7ed4('0xc')]=moment()[_0x7ed4('0xd')](_0x7ed4('0xe'));}_0x4b3211(null,_0x5856ed);}},'charset':'utf8mb4','collate':_0x7ed4('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 37eee35..8233c7c 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 _0xfb97=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','catch'];(function(_0x5e4cb5,_0x14d95e){var _0x326030=function(_0x3d136e){while(--_0x3d136e){_0x5e4cb5['push'](_0x5e4cb5['shift']());}};_0x326030(++_0x14d95e);}(_0xfb97,0x10e));var _0x7fb9=function(_0x44e7b9,_0xf7f5cc){_0x44e7b9=_0x44e7b9-0x0;var _0x1de7ac=_0xfb97[_0x44e7b9];return _0x1de7ac;};'use strict';var _=require(_0x7fb9('0x0'));var util=require(_0x7fb9('0x1'));var moment=require('moment');var BPromise=require(_0x7fb9('0x2'));var rs=require(_0x7fb9('0x3'));var fs=require('fs');var Redis=require(_0x7fb9('0x4'));var db=require(_0x7fb9('0x5'))['db'];var utils=require(_0x7fb9('0x6'));var logger=require(_0x7fb9('0x7'))('rpc');var config=require(_0x7fb9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7fb9('0x9')][_0x7fb9('0xa')]({'port':0x232a});config[_0x7fb9('0xb')]=_[_0x7fb9('0xc')](config[_0x7fb9('0xb')],{'host':_0x7fb9('0xd'),'port':0x18eb});var socket=require(_0x7fb9('0xe'))(new Redis(config['redis']));require(_0x7fb9('0xf'))[_0x7fb9('0x10')](socket);function respondWithRpcPromise(_0x53db26,_0x4faaf4,_0x3aa2a1){return new BPromise(function(_0x1f03e8,_0x24feea){return client[_0x7fb9('0x11')](_0x53db26,_0x3aa2a1)[_0x7fb9('0x12')](function(_0x10e777){logger[_0x7fb9('0x13')](_0x7fb9('0x14'),_0x4faaf4,_0x7fb9('0x15'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4faaf4,_0x7fb9('0x15'),JSON[_0x7fb9('0x16')](_0x10e777));if(_0x10e777[_0x7fb9('0x17')]){if(_0x10e777[_0x7fb9('0x17')][_0x7fb9('0x18')]===0x1f4){logger[_0x7fb9('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x4faaf4,_0x10e777['error'][_0x7fb9('0x19')]);return _0x24feea(_0x10e777['error']['message']);}logger['error'](_0x7fb9('0x14'),_0x4faaf4,_0x10e777[_0x7fb9('0x17')][_0x7fb9('0x19')]);return _0x1f03e8(_0x10e777[_0x7fb9('0x17')][_0x7fb9('0x19')]);}else{logger[_0x7fb9('0x13')](_0x7fb9('0x14'),_0x4faaf4,_0x7fb9('0x15'));_0x1f03e8(_0x10e777[_0x7fb9('0x1a')][_0x7fb9('0x19')]);}})['catch'](function(_0x2cd83a){logger[_0x7fb9('0x17')](_0x7fb9('0x14'),_0x4faaf4,_0x2cd83a);_0x24feea(_0x2cd83a);});});}exports[_0x7fb9('0x1b')]=function(_0x154d35){var _0x45b8f1=this;return new Promise(function(_0x3f05f4,_0x44806c){return db[_0x7fb9('0x1c')][_0x7fb9('0x1d')](_0x154d35[_0x7fb9('0x1e')],{'raw':_0x154d35[_0x7fb9('0x1f')]?_0x154d35[_0x7fb9('0x1f')][_0x7fb9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x154d35[_0x7fb9('0x1f')]?_0x154d35['options'][_0x7fb9('0x21')]||null:null,'attributes':_0x154d35[_0x7fb9('0x1f')]?_0x154d35[_0x7fb9('0x1f')][_0x7fb9('0x22')]||null:null,'limit':_0x154d35[_0x7fb9('0x1f')]?_0x154d35[_0x7fb9('0x1f')][_0x7fb9('0x23')]||null:null})['then'](function(_0x250c9d){logger[_0x7fb9('0x13')](_0x7fb9('0x1b'),_0x154d35);logger[_0x7fb9('0x24')](_0x7fb9('0x1b'),_0x154d35,JSON[_0x7fb9('0x16')](_0x250c9d));_0x3f05f4(_0x250c9d);})['catch'](function(_0x4ee381){logger['error'](_0x7fb9('0x1b'),_0x4ee381[_0x7fb9('0x19')],_0x154d35);_0x44806c(_0x45b8f1['error'](0x1f4,_0x4ee381[_0x7fb9('0x19')]));});});};exports[_0x7fb9('0x25')]=function(_0x4a51cf){return new Promise(function(_0x4013a8,_0x16985f){return db['ChatInteraction'][_0x7fb9('0x26')]({'where':_0x4a51cf[_0x7fb9('0x1f')]?_0x4a51cf['options'][_0x7fb9('0x21')]||null:null})[_0x7fb9('0x12')](function(_0x1e33cd){if(_0x1e33cd){return _0x1e33cd[_0x7fb9('0x27')](_0x4a51cf['body'][_0x7fb9('0x28')],_[_0x7fb9('0x29')](_0x4a51cf[_0x7fb9('0x1e')],[_0x7fb9('0x28'),'id'])||{});}})[_0x7fb9('0x2a')](function(_0x6c8b51){logger['info'](_0x7fb9('0x2b'),_0x4a51cf);logger[_0x7fb9('0x24')]('AddTags',_0x4a51cf,JSON[_0x7fb9('0x16')](_0x6c8b51));_0x4013a8(_0x6c8b51);})[_0x7fb9('0x2c')](function(_0x1a7fd5){logger['error'](_0x7fb9('0x2b'),_0x1a7fd5[_0x7fb9('0x19')],_0x4a51cf);_0x16985f(_this[_0x7fb9('0x17')](0x1f4,_0x1a7fd5[_0x7fb9('0x19')]));});});}; \ No newline at end of file +var _0xdf0a=['error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','catch','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a3fe2,_0x553b71){var _0x490ee2=function(_0xc569b4){while(--_0xc569b4){_0x1a3fe2['push'](_0x1a3fe2['shift']());}};_0x490ee2(++_0x553b71);}(_0xdf0a,0xb6));var _0xadf0=function(_0x43ee2f,_0x6aadb1){_0x43ee2f=_0x43ee2f-0x0;var _0x2bf6eb=_0xdf0a[_0x43ee2f];return _0x2bf6eb;};'use strict';var _=require(_0xadf0('0x0'));var util=require(_0xadf0('0x1'));var moment=require(_0xadf0('0x2'));var BPromise=require(_0xadf0('0x3'));var rs=require(_0xadf0('0x4'));var fs=require('fs');var Redis=require(_0xadf0('0x5'));var db=require(_0xadf0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xadf0('0x7'))(_0xadf0('0x8'));var config=require(_0xadf0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xadf0('0xa')]['http']({'port':0x232a});config[_0xadf0('0xb')]=_[_0xadf0('0xc')](config[_0xadf0('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xadf0('0xd'))(new Redis(config[_0xadf0('0xb')]));require(_0xadf0('0xe'))['register'](socket);function respondWithRpcPromise(_0x373997,_0x6f6fad,_0x483c0f){return new BPromise(function(_0x536a16,_0x91a88a){return client[_0xadf0('0xf')](_0x373997,_0x483c0f)[_0xadf0('0x10')](function(_0x2c9df8){logger[_0xadf0('0x11')](_0xadf0('0x12'),_0x6f6fad,_0xadf0('0x13'));logger[_0xadf0('0x14')](_0xadf0('0x15'),_0x6f6fad,_0xadf0('0x13'),JSON[_0xadf0('0x16')](_0x2c9df8));if(_0x2c9df8['error']){if(_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x18')]===0x1f4){logger[_0xadf0('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x6f6fad,_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x19')]);return _0x91a88a(_0x2c9df8['error'][_0xadf0('0x19')]);}logger['error'](_0xadf0('0x12'),_0x6f6fad,_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x19')]);return _0x536a16(_0x2c9df8[_0xadf0('0x17')][_0xadf0('0x19')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x6f6fad,_0xadf0('0x13'));_0x536a16(_0x2c9df8[_0xadf0('0x1a')]['message']);}})['catch'](function(_0x4d65f0){logger[_0xadf0('0x17')](_0xadf0('0x12'),_0x6f6fad,_0x4d65f0);_0x91a88a(_0x4d65f0);});});}exports[_0xadf0('0x1b')]=function(_0x282ce0){var _0x5421c9=this;return new Promise(function(_0x4958f4,_0xe3708b){return db[_0xadf0('0x1c')][_0xadf0('0x1d')](_0x282ce0[_0xadf0('0x1e')],{'raw':_0x282ce0[_0xadf0('0x1f')]?_0x282ce0[_0xadf0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x282ce0[_0xadf0('0x1f')]?_0x282ce0[_0xadf0('0x1f')][_0xadf0('0x20')]||null:null,'attributes':_0x282ce0['options']?_0x282ce0[_0xadf0('0x1f')][_0xadf0('0x21')]||null:null,'limit':_0x282ce0[_0xadf0('0x1f')]?_0x282ce0[_0xadf0('0x1f')][_0xadf0('0x22')]||null:null})['then'](function(_0x20e90e){logger[_0xadf0('0x11')](_0xadf0('0x1b'),_0x282ce0);logger[_0xadf0('0x14')](_0xadf0('0x1b'),_0x282ce0,JSON['stringify'](_0x20e90e));_0x4958f4(_0x20e90e);})[_0xadf0('0x23')](function(_0xd1102c){logger[_0xadf0('0x17')](_0xadf0('0x1b'),_0xd1102c[_0xadf0('0x19')],_0x282ce0);_0xe3708b(_0x5421c9['error'](0x1f4,_0xd1102c[_0xadf0('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x543dca){return new Promise(function(_0x1cac12,_0x3859c5){return db['ChatInteraction']['find']({'where':_0x543dca[_0xadf0('0x1f')]?_0x543dca['options'][_0xadf0('0x20')]||null:null})['then'](function(_0x4a86c2){if(_0x4a86c2){return _0x4a86c2[_0xadf0('0x24')](_0x543dca['body'][_0xadf0('0x25')],_[_0xadf0('0x26')](_0x543dca[_0xadf0('0x1e')],[_0xadf0('0x25'),'id'])||{});}})[_0xadf0('0x27')](function(_0x51e5fa){logger[_0xadf0('0x11')](_0xadf0('0x28'),_0x543dca);logger[_0xadf0('0x14')]('AddTags',_0x543dca,JSON[_0xadf0('0x16')](_0x51e5fa));_0x1cac12(_0x51e5fa);})['catch'](function(_0x346349){logger['error'](_0xadf0('0x28'),_0x346349[_0xadf0('0x19')],_0x543dca);_0x3859c5(_this[_0xadf0('0x17')](0x1f4,_0x346349[_0xadf0('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 65f4ce8..3b2bcc7 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 _0xa3c4=['./chatInteraction.events','remove','update','emit','removeListener','chatInteraction:'];(function(_0x311788,_0x40476e){var _0xafa7b0=function(_0x33532b){while(--_0x33532b){_0x311788['push'](_0x311788['shift']());}};_0xafa7b0(++_0x40476e);}(_0xa3c4,0x114));var _0x4a3c=function(_0x3fec31,_0x3a9690){_0x3fec31=_0x3fec31-0x0;var _0x4ba701=_0xa3c4[_0x3fec31];return _0x4ba701;};'use strict';var ChatInteractionEvents=require(_0x4a3c('0x0'));var events=['save',_0x4a3c('0x1'),_0x4a3c('0x2')];function createListener(_0x83ac0d,_0x59951b){return function(_0x4c978d){_0x59951b[_0x4a3c('0x3')](_0x83ac0d,_0x4c978d);};}function removeListener(_0x51b36f,_0x550386){return function(){ChatInteractionEvents[_0x4a3c('0x4')](_0x51b36f,_0x550386);};}exports['register']=function(_0x5234c6){for(var _0x426931=0x0,_0x379809=events['length'];_0x426931<_0x379809;_0x426931++){var _0x2877d4=events[_0x426931];var _0x159948=createListener(_0x4a3c('0x5')+_0x2877d4,_0x5234c6);ChatInteractionEvents['on'](_0x2877d4,_0x159948);}}; \ No newline at end of file +var _0xf7fd=['length','chatInteraction:','./chatInteraction.events','remove','emit','removeListener','register'];(function(_0x3517c8,_0x291291){var _0x5357bf=function(_0x3249c5){while(--_0x3249c5){_0x3517c8['push'](_0x3517c8['shift']());}};_0x5357bf(++_0x291291);}(_0xf7fd,0xe2));var _0xdf7f=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xf7fd[_0xa6cc5c];return _0x44803d;};'use strict';var ChatInteractionEvents=require(_0xdf7f('0x0'));var events=['save',_0xdf7f('0x1'),'update'];function createListener(_0x1802bf,_0x529a82){return function(_0x195150){_0x529a82[_0xdf7f('0x2')](_0x1802bf,_0x195150);};}function removeListener(_0x539ca4,_0x472b5a){return function(){ChatInteractionEvents[_0xdf7f('0x3')](_0x539ca4,_0x472b5a);};}exports[_0xdf7f('0x4')]=function(_0x33e8f5){for(var _0x1e3955=0x0,_0x5e81dd=events[_0xdf7f('0x5')];_0x1e3955<_0x5e81dd;_0x1e3955++){var _0x141609=events[_0x1e3955];var _0x19a633=createListener(_0xdf7f('0x6')+_0x141609,_0x33e8f5);ChatInteractionEvents['on'](_0x141609,_0x19a633);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c7a320a..38ba229 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 _0xc722=['customUpdate','/:id/abandon','abandon','/:id/close','close','destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','createVidaooSession','diskStorage','join','root','format','%s-%s','now','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update'];(function(_0x2b6482,_0x95e8a8){var _0x53e68f=function(_0x544be1){while(--_0x544be1){_0x2b6482['push'](_0x2b6482['shift']());}};_0x53e68f(++_0x95e8a8);}(_0xc722,0xf8));var _0x2c72=function(_0x19f00d,_0x146baa){_0x19f00d=_0x19f00d-0x0;var _0x59ccef=_0xc722[_0x19f00d];return _0x59ccef;};'use strict';var multer=require(_0x2c72('0x0'));var util=require(_0x2c72('0x1'));var path=require('path');var timeout=require(_0x2c72('0x2'));var express=require(_0x2c72('0x3'));var router=express[_0x2c72('0x4')]();var fs_extra=require(_0x2c72('0x5'));var auth=require(_0x2c72('0x6'));var interaction=require(_0x2c72('0x7'));var config=require(_0x2c72('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x2c72('0x9')](),controller[_0x2c72('0xa')]);router[_0x2c72('0xb')](_0x2c72('0xc'),auth[_0x2c72('0x9')](),controller[_0x2c72('0xd')]);router[_0x2c72('0xb')](_0x2c72('0xe'),auth[_0x2c72('0xf')](),controller['show']);router['get'](_0x2c72('0x10'),auth[_0x2c72('0xf')](),controller['attachmentDownload']);router[_0x2c72('0xb')](_0x2c72('0x11'),auth['isAuthenticated'](),controller[_0x2c72('0x12')]);router[_0x2c72('0xb')](_0x2c72('0x13'),auth[_0x2c72('0xf')](),controller[_0x2c72('0x14')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x2c72('0x15')]);router[_0x2c72('0x16')]('/',auth[_0x2c72('0x9')](),controller['create']);router[_0x2c72('0x16')]('/:id/vidaoo',auth[_0x2c72('0x9')](),controller[_0x2c72('0x17')]);var upload=multer({'storage':multer[_0x2c72('0x18')]({'destination':function(_0x1a1ec9,_0x301aeb,_0x511758){_0x511758(null,path[_0x2c72('0x19')](config[_0x2c72('0x1a')],'server/files/attachments/'));},'filename':function(_0x554c9c,_0x166838,_0x2c1573){_0x2c1573(null,util[_0x2c72('0x1b')](_0x2c72('0x1c'),Date[_0x2c72('0x1d')](),_0x166838['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2c72('0x16')](_0x2c72('0x1e'),upload[_0x2c72('0x1f')]('file'),controller[_0x2c72('0x20')]);router[_0x2c72('0x16')](_0x2c72('0x11'),auth[_0x2c72('0xf')](),controller[_0x2c72('0x21')]);router[_0x2c72('0x16')](_0x2c72('0x22'),auth[_0x2c72('0x9')](),interaction[_0x2c72('0x23')](_0x2c72('0x24'),'chatinteraction:addtags'),controller[_0x2c72('0x25')]);router[_0x2c72('0x26')](_0x2c72('0xe'),auth[_0x2c72('0x9')](),interaction['tracked'](_0x2c72('0x24'),_0x2c72('0x27')),controller['update']);router[_0x2c72('0x26')]('/:id/custom_update',controller[_0x2c72('0x28')]);router[_0x2c72('0x26')](_0x2c72('0x29'),auth[_0x2c72('0xf')](),controller[_0x2c72('0x2a')]);router[_0x2c72('0x26')](_0x2c72('0x2b'),controller[_0x2c72('0x2c')]);router['delete'](_0x2c72('0xe'),auth[_0x2c72('0x9')](),interaction['tracked']('chat','chatinteraction:destroy'),controller[_0x2c72('0x2d')]);router[_0x2c72('0x2e')](_0x2c72('0x22'),auth[_0x2c72('0x9')](),controller[_0x2c72('0x2f')]);module['exports']=router; \ No newline at end of file +var _0x4ac8=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','update','put','/:id/custom_update','customUpdate','close','/:id','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','isChatInteractionAuthorized','/:id/attachment_download'];(function(_0x2dac96,_0x20180c){var _0x17f8e3=function(_0x2d46fb){while(--_0x2d46fb){_0x2dac96['push'](_0x2dac96['shift']());}};_0x17f8e3(++_0x20180c);}(_0x4ac8,0x85));var _0x84ac=function(_0x30c466,_0x592e6f){_0x30c466=_0x30c466-0x0;var _0x4d0fb7=_0x4ac8[_0x30c466];return _0x4d0fb7;};'use strict';var multer=require(_0x84ac('0x0'));var util=require(_0x84ac('0x1'));var path=require(_0x84ac('0x2'));var timeout=require(_0x84ac('0x3'));var express=require(_0x84ac('0x4'));var router=express[_0x84ac('0x5')]();var fs_extra=require(_0x84ac('0x6'));var auth=require(_0x84ac('0x7'));var interaction=require(_0x84ac('0x8'));var config=require('../../config/environment');var controller=require(_0x84ac('0x9'));router[_0x84ac('0xa')]('/',auth['isAuthenticated'](),controller[_0x84ac('0xb')]);router[_0x84ac('0xa')](_0x84ac('0xc'),auth[_0x84ac('0xd')](),controller[_0x84ac('0xe')]);router[_0x84ac('0xa')]('/:id',auth[_0x84ac('0xf')](),controller['show']);router[_0x84ac('0xa')](_0x84ac('0x10'),auth[_0x84ac('0xf')](),controller[_0x84ac('0x11')]);router[_0x84ac('0xa')](_0x84ac('0x12'),auth[_0x84ac('0xd')](),controller[_0x84ac('0x13')]);router[_0x84ac('0xa')](_0x84ac('0x14'),auth[_0x84ac('0xf')](),controller[_0x84ac('0x15')]);router[_0x84ac('0xa')](_0x84ac('0x16'),auth[_0x84ac('0xd')](),controller[_0x84ac('0x17')]);router[_0x84ac('0x18')]('/',auth['isAuthenticated'](),controller['create']);router[_0x84ac('0x18')](_0x84ac('0x19'),auth[_0x84ac('0xd')](),controller[_0x84ac('0x1a')]);var upload=multer({'storage':multer[_0x84ac('0x1b')]({'destination':function(_0x486d62,_0x21795d,_0x4bd3bd){_0x4bd3bd(null,path[_0x84ac('0x1c')](config[_0x84ac('0x1d')],_0x84ac('0x1e')));},'filename':function(_0x16cdb6,_0x3c590d,_0x1f89e1){_0x1f89e1(null,util['format'](_0x84ac('0x1f'),Date['now'](),_0x3c590d['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x84ac('0x18')](_0x84ac('0x20'),upload[_0x84ac('0x21')]('file'),controller[_0x84ac('0x22')]);router[_0x84ac('0x18')](_0x84ac('0x12'),auth[_0x84ac('0xf')](),controller[_0x84ac('0x23')]);router[_0x84ac('0x18')](_0x84ac('0x24'),auth[_0x84ac('0xd')](),interaction[_0x84ac('0x25')](_0x84ac('0x26'),_0x84ac('0x27')),controller[_0x84ac('0x28')]);router['put']('/:id',auth[_0x84ac('0xd')](),interaction[_0x84ac('0x25')](_0x84ac('0x26'),'chatinteraction:update'),controller[_0x84ac('0x29')]);router[_0x84ac('0x2a')](_0x84ac('0x2b'),controller[_0x84ac('0x2c')]);router[_0x84ac('0x2a')]('/:id/abandon',auth[_0x84ac('0xf')](),controller['abandon']);router['put']('/:id/close',controller[_0x84ac('0x2d')]);router['delete'](_0x84ac('0x2e'),auth[_0x84ac('0xd')](),interaction['tracked'](_0x84ac('0x26'),'chatinteraction:destroy'),controller['destroy']);router[_0x84ac('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x84ac('0x30')]);module[_0x84ac('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 f91bcd2..03be9dd 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 _0x99bd=['INTEGER','sequelize','exports','TEXT','medium'];(function(_0x2728e8,_0x2cfb6c){var _0x235b11=function(_0x4c4290){while(--_0x4c4290){_0x2728e8['push'](_0x2728e8['shift']());}};_0x235b11(++_0x2cfb6c);}(_0x99bd,0x1d2));var _0xd99b=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x99bd[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require(_0xd99b('0x0'));module[_0xd99b('0x1')]={'body':{'type':Sequelize[_0xd99b('0x2')](_0xd99b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xd99b('0x4')]}}; \ No newline at end of file +var _0x40e7=['sequelize','exports'];(function(_0x556cc7,_0x18ad4a){var _0x4e387b=function(_0x2a118e){while(--_0x2a118e){_0x556cc7['push'](_0x556cc7['shift']());}};_0x4e387b(++_0x18ad4a);}(_0x40e7,0x6c));var _0x740e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x40e7[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require(_0x740e('0x0'));module[_0x740e('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c02ae5b..8ce796d 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 _0x2991=['getUsers','findAll','agent','admin','fullname','role','-online','VoiceQueue','VoiceQueues','type','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','fieldName','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','ChatInternalMessage','includeAll','include','rows','catch','show','options','create','body','find','params','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage'];(function(_0x514c58,_0x1e9a1d){var _0x406483=function(_0x24be87){while(--_0x24be87){_0x514c58['push'](_0x514c58['shift']());}};_0x406483(++_0x1e9a1d);}(_0x2991,0x139));var _0x1299=function(_0x41a675,_0x1c0320){_0x41a675=_0x41a675-0x0;var _0x3efdb4=_0x2991[_0x41a675];return _0x3efdb4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1299('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1299('0x1'));var moment=require(_0x1299('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1299('0x3'));var util=require(_0x1299('0x4'));var path=require(_0x1299('0x5'));var sox=require(_0x1299('0x6'));var csv=require(_0x1299('0x7'));var ejs=require(_0x1299('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1299('0x9'));var squel=require(_0x1299('0xa'));var crypto=require('crypto');var jsforce=require(_0x1299('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1299('0x7'));var querystring=require('querystring');var Papa=require(_0x1299('0xc'));var Redis=require(_0x1299('0xd'));var authService=require(_0x1299('0xe'));var qs=require(_0x1299('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1299('0x10'));var config=require(_0x1299('0x11'));var licenseUtil=require(_0x1299('0x12'));var db=require(_0x1299('0x13'))['db'];config['redis']=_[_0x1299('0x14')](config[_0x1299('0x15')],{'host':_0x1299('0x16'),'port':0x18eb});var socket=require(_0x1299('0x17'))(new Redis(config['redis']));require(_0x1299('0x18'))[_0x1299('0x19')](socket);function respondWithStatusCode(_0x4fe0ac,_0x32c925){_0x32c925=_0x32c925||0xcc;return function(_0x2e2215){if(_0x2e2215){return _0x4fe0ac[_0x1299('0x1a')](_0x32c925);}return _0x4fe0ac['status'](_0x32c925)['end']();};}function respondWithResult(_0x44e38c,_0xf34ad2){_0xf34ad2=_0xf34ad2||0xc8;return function(_0x4b5208){if(_0x4b5208){return _0x44e38c[_0x1299('0x1b')](_0xf34ad2)['json'](_0x4b5208);}};}function respondWithFilteredResult(_0x5cc153,_0x15cf4b){return function(_0x33a570){if(_0x33a570){var _0x4db0b9=typeof _0x15cf4b[_0x1299('0x1c')]==='undefined'&&typeof _0x15cf4b[_0x1299('0x1d')]==='undefined';var _0x1d0ff3=_0x33a570[_0x1299('0x1e')];var _0x27c1f8=_0x4db0b9?0x0:_0x15cf4b[_0x1299('0x1c')];var _0x23cb6c=_0x4db0b9?_0x33a570[_0x1299('0x1e')]:_0x15cf4b[_0x1299('0x1c')]+_0x15cf4b['limit'];var _0x5e5e7d;if(_0x23cb6c>=_0x1d0ff3){_0x23cb6c=_0x1d0ff3;_0x5e5e7d=0xc8;}else{_0x5e5e7d=0xce;}_0x5cc153[_0x1299('0x1b')](_0x5e5e7d);return _0x5cc153['set'](_0x1299('0x1f'),_0x27c1f8+'-'+_0x23cb6c+'/'+_0x1d0ff3)['json'](_0x33a570);}return null;};}function patchUpdates(_0x3815a5){return function(_0x286013){try{jsonpatch[_0x1299('0x20')](_0x286013,_0x3815a5,!![]);}catch(_0x9dbb37){return BPromise[_0x1299('0x21')](_0x9dbb37);}return _0x286013[_0x1299('0x22')]();};}function saveUpdates(_0x4a0f07,_0x3c7af8){return function(_0x4237b2){if(_0x4237b2){return _0x4237b2[_0x1299('0x23')](_0x4a0f07)[_0x1299('0x24')](function(_0xffc545){return _0xffc545;});}return null;};}function removeEntity(_0x5c9fb3,_0x23d111){return function(_0x73e215){if(_0x73e215){return _0x73e215[_0x1299('0x25')]()['then'](function(){_0x5c9fb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x322477,_0x302281){return function(_0x35539b){if(!_0x35539b){_0x322477[_0x1299('0x1a')](0x194);}return _0x35539b;};}function handleError(_0x303ded,_0x23ffcc){_0x23ffcc=_0x23ffcc||0x1f4;return function(_0x11fe23){logger['error'](_0x11fe23[_0x1299('0x26')]);if(_0x11fe23['name']){delete _0x11fe23['name'];}_0x303ded[_0x1299('0x1b')](_0x23ffcc)['send'](_0x11fe23);};}exports['index']=function(_0x5d340e,_0x559430){var _0x402029={},_0x37c767={},_0x55804d={'count':0x0,'rows':[]};var _0x3f114e=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x59b0b1){return{'name':_0x59b0b1[_0x1299('0x27')],'type':_0x59b0b1['type']['key']};});_0x37c767[_0x1299('0x28')]=_['map'](_0x3f114e,_0x1299('0x29'));_0x37c767[_0x1299('0x2a')]=_[_0x1299('0x2b')](_0x5d340e[_0x1299('0x2a')]);_0x37c767['filters']=_[_0x1299('0x2c')](_0x37c767['model'],_0x37c767[_0x1299('0x2a')]);_0x402029[_0x1299('0x2d')]=_['intersection'](_0x37c767['model'],qs[_0x1299('0x2e')](_0x5d340e[_0x1299('0x2a')][_0x1299('0x2e')]));_0x402029[_0x1299('0x2d')]=_0x402029[_0x1299('0x2d')][_0x1299('0x2f')]?_0x402029['attributes']:_0x37c767['model'];if(!_0x5d340e[_0x1299('0x2a')][_0x1299('0x30')](_0x1299('0x31'))){_0x402029[_0x1299('0x1d')]=qs[_0x1299('0x1d')](_0x5d340e[_0x1299('0x2a')][_0x1299('0x1d')]);_0x402029[_0x1299('0x1c')]=qs[_0x1299('0x1c')](_0x5d340e[_0x1299('0x2a')][_0x1299('0x1c')]);}_0x402029[_0x1299('0x32')]=qs[_0x1299('0x33')](_0x5d340e['query'][_0x1299('0x33')]);_0x402029[_0x1299('0x34')]=qs[_0x1299('0x35')](_[_0x1299('0x36')](_0x5d340e['query'],_0x37c767[_0x1299('0x35')]),_0x3f114e);if(_0x5d340e[_0x1299('0x2a')][_0x1299('0x37')]){_0x402029[_0x1299('0x34')]=_[_0x1299('0x38')](_0x402029[_0x1299('0x34')],{'$or':_[_0x1299('0x39')](_0x3f114e,function(_0x555f11){if(_0x555f11['type']!=='VIRTUAL'){var _0x431ba2={};_0x431ba2[_0x555f11[_0x1299('0x29')]]={'$like':'%'+_0x5d340e[_0x1299('0x2a')][_0x1299('0x37')]+'%'};return _0x431ba2;}})});}_0x402029=_[_0x1299('0x38')]({},_0x402029,_0x5d340e['options']);var _0x352b51={'where':_0x402029['where']};return db[_0x1299('0x3a')][_0x1299('0x1e')](_0x352b51)['then'](function(_0x695e4c){_0x55804d[_0x1299('0x1e')]=_0x695e4c;if(_0x5d340e[_0x1299('0x2a')][_0x1299('0x3b')]){_0x402029[_0x1299('0x3c')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x402029);})[_0x1299('0x24')](function(_0x255313){_0x55804d[_0x1299('0x3d')]=_0x255313;return _0x55804d;})[_0x1299('0x24')](respondWithFilteredResult(_0x559430,_0x402029))[_0x1299('0x3e')](handleError(_0x559430,null));};exports[_0x1299('0x3f')]=function(_0x46f90f,_0x8506){var _0x25281c={'raw':!![],'where':{'id':_0x46f90f['params']['id']}},_0x2472cf={};_0x2472cf[_0x1299('0x28')]=_['keys'](db[_0x1299('0x3a')]['rawAttributes']);_0x2472cf[_0x1299('0x2a')]=_[_0x1299('0x2b')](_0x46f90f[_0x1299('0x2a')]);_0x2472cf[_0x1299('0x35')]=_['intersection'](_0x2472cf[_0x1299('0x28')],_0x2472cf[_0x1299('0x2a')]);_0x25281c[_0x1299('0x2d')]=_[_0x1299('0x2c')](_0x2472cf[_0x1299('0x28')],qs[_0x1299('0x2e')](_0x46f90f[_0x1299('0x2a')]['fields']));_0x25281c[_0x1299('0x2d')]=_0x25281c[_0x1299('0x2d')][_0x1299('0x2f')]?_0x25281c[_0x1299('0x2d')]:_0x2472cf['model'];if(_0x46f90f['query'][_0x1299('0x3b')]){_0x25281c[_0x1299('0x3c')]=[{'all':!![]}];}_0x25281c=_[_0x1299('0x38')]({},_0x25281c,_0x46f90f[_0x1299('0x40')]);return db[_0x1299('0x3a')]['find'](_0x25281c)[_0x1299('0x24')](handleEntityNotFound(_0x8506,null))[_0x1299('0x24')](respondWithResult(_0x8506,null))['catch'](handleError(_0x8506,null));};exports[_0x1299('0x41')]=function(_0x5fa6,_0x12e1e9){return db[_0x1299('0x3a')][_0x1299('0x41')](_0x5fa6[_0x1299('0x42')],{})['then'](respondWithResult(_0x12e1e9,0xc9))[_0x1299('0x3e')](handleError(_0x12e1e9,null));};exports[_0x1299('0x23')]=function(_0x21228a,_0x52a224){if(_0x21228a[_0x1299('0x42')]['id']){delete _0x21228a[_0x1299('0x42')]['id'];}return db[_0x1299('0x3a')][_0x1299('0x43')]({'where':{'id':_0x21228a[_0x1299('0x44')]['id']}})['then'](handleEntityNotFound(_0x52a224,null))['then'](saveUpdates(_0x21228a[_0x1299('0x42')],null))[_0x1299('0x24')](respondWithResult(_0x52a224,null))[_0x1299('0x3e')](handleError(_0x52a224,null));};exports[_0x1299('0x25')]=function(_0x58b9eb,_0x459103){return db['ChatInternalMessage'][_0x1299('0x43')]({'where':{'id':_0x58b9eb[_0x1299('0x44')]['id']}})['then'](handleEntityNotFound(_0x459103,null))['then'](removeEntity(_0x459103,null))['catch'](handleError(_0x459103,null));};exports['describe']=function(_0x41d67e,_0xa5e974){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0xa5e974,null))[_0x1299('0x3e')](handleError(_0xa5e974,null));};function wrapUser(_0x220076){return function(_0x2087cb){var _0x24995a=_0x220076[_0x1299('0x45')]({'plain':!![]});_0x24995a[_0x1299('0x46')]=[];if(_0x2087cb){_0x24995a[_0x1299('0x47')]=_0x2087cb[_0x1299('0x48')];_0x24995a['lastMessage']=_0x2087cb;}else{_0x24995a[_0x1299('0x47')]=moment(0x0)['format'](_0x1299('0x49'));_0x24995a[_0x1299('0x4a')]={};}return _0x24995a;};}exports[_0x1299('0x4b')]=function(_0x3645a1,_0x271f69,_0x325d38){var _0x668b4=[];return db['User'][_0x1299('0x4c')]({'where':{'role':[_0x1299('0x4d'),_0x1299('0x4e'),'user']},'attributes':['id',_0x1299('0x4f'),_0x1299('0x29'),_0x1299('0x50'),'userpic','internal','online','lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x1299('0x33')](_0x1299('0x51')),'include':[{'model':db[_0x1299('0x52')],'as':_0x1299('0x53'),'attributes':['id',_0x1299('0x29'),_0x1299('0x54')],'through':{'attributes':[]}}]})[_0x1299('0x24')](function(_0x569162){if(_0x569162){var _0x2229fd=_0x3645a1[_0x1299('0x55')][_0x1299('0x45')]({'plain':!![]});if(!_0x2229fd)throw new Error(_0x1299('0x56'));if(_0x2229fd['role']===_0x1299('0x55')){return db['UserProfileSection'][_0x1299('0x43')]({'where':{'name':_0x1299('0x57'),'userProfileId':_0x2229fd[_0x1299('0x58')]},'raw':!![]})[_0x1299('0x24')](function(_0x5bd0e8){if(_0x5bd0e8){if(_0x5bd0e8[_0x1299('0x59')]===0x0){return db[_0x1299('0x5a')][_0x1299('0x4c')]({'where':{'sectionId':_0x5bd0e8['id']},'raw':!![]})[_0x1299('0x24')](function(_0x5a7499){var _0x3b685d=[];if(_['isEmpty'](_0x5a7499)){_0x3b685d=_[_0x1299('0x37')](_0x569162,function(_0x1b76f5){if(_0x1b76f5[_0x1299('0x50')]!==_0x1299('0x4d')){return _0x1b76f5;}});return _0x3b685d;}else{for(var _0x5eb809=0x0;_0x5eb809<_0x569162[_0x1299('0x2f')];_0x5eb809++){var _0xb08ed8=_0x569162[_0x5eb809];if(_0xb08ed8[_0x1299('0x50')]===_0x1299('0x4d')){var _0x274bb6=_[_0x1299('0x43')](_0x5a7499,function(_0x3fda15){return _0x3fda15[_0x1299('0x5b')]===_0xb08ed8['id'];});if(_0x274bb6)_0x3b685d[_0x1299('0x5c')](_0xb08ed8);}else{_0x3b685d['push'](_0xb08ed8);}}return _0x3b685d;}});}else{return _0x569162;}}else{var _0x14a993=_[_0x1299('0x37')](_0x569162,function(_0x260bb3){if(_0x260bb3[_0x1299('0x50')]!==_0x1299('0x4d')){return _0x260bb3;}});return _0x14a993;}});}else{return _0x569162;}}})['then'](function(_0x41b8d9){var _0xe9e534=[];if(_0x41b8d9){_0x668b4=_0x41b8d9;for(var _0x45042c=0x0;_0x45042c<_0x41b8d9[_0x1299('0x2f')];_0x45042c+=0x1){_0x668b4[_0x45042c][_0x1299('0x46')]=[];_0xe9e534[_0x1299('0x5c')](db[_0x1299('0x3a')]['find']({'where':{'FromId':[_0x3645a1['user']['id'],_0x41b8d9[_0x45042c]['id']],'ToId':[_0x3645a1[_0x1299('0x55')]['id'],_0x41b8d9[_0x45042c]['id']],'ChatGroupId':null},'attributes':['id',_0x1299('0x48'),_0x1299('0x5d'),_0x1299('0x5e'),_0x1299('0x5f'),_0x1299('0x42')],'order':qs['sort'](_0x1299('0x60')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1299('0x24')](wrapUser(_0x41b8d9[_0x45042c])));}return BPromise['all'](_0xe9e534);}return[];})[_0x1299('0x24')](function(_0x10c0cb){return{'rows':_0x10c0cb,'count':_0x10c0cb[_0x1299('0x2f')]};})['then'](respondWithResult(_0x271f69,null))['catch'](handleError(_0x271f69,null));}; \ No newline at end of file +var _0xc4cb=['Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','ChatInternalMessage','include','findAll','rows','catch','show','params','length','find','create','body','update','destroy','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x2f8619,_0x195689){var _0x13b303=function(_0x31c236){while(--_0x31c236){_0x2f8619['push'](_0x2f8619['shift']());}};_0x13b303(++_0x195689);}(_0xc4cb,0xb5));var _0xbc4c=function(_0x4f3cd1,_0x4b666e){_0x4f3cd1=_0x4f3cd1-0x0;var _0x4f304d=_0xc4cb[_0x4f3cd1];return _0x4f304d;};'use strict';var emlformat=require(_0xbc4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbc4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc4c('0x2'));var moment=require('moment');var BPromise=require(_0xbc4c('0x3'));var Mustache=require('mustache');var util=require(_0xbc4c('0x4'));var path=require('path');var sox=require(_0xbc4c('0x5'));var csv=require(_0xbc4c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc4c('0x7'));var _=require(_0xbc4c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbc4c('0x9'));var toCsv=require(_0xbc4c('0x6'));var querystring=require('querystring');var Papa=require(_0xbc4c('0xa'));var Redis=require(_0xbc4c('0xb'));var authService=require(_0xbc4c('0xc'));var qs=require(_0xbc4c('0xd'));var as=require(_0xbc4c('0xe'));var hardwareService=require(_0xbc4c('0xf'));var logger=require('../../config/logger')(_0xbc4c('0x10'));var utils=require(_0xbc4c('0x11'));var config=require(_0xbc4c('0x12'));var licenseUtil=require(_0xbc4c('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbc4c('0x14')](config['redis'],{'host':_0xbc4c('0x15'),'port':0x18eb});var socket=require(_0xbc4c('0x16'))(new Redis(config[_0xbc4c('0x17')]));require(_0xbc4c('0x18'))['register'](socket);function respondWithStatusCode(_0xa9f2e8,_0x57fdc2){_0x57fdc2=_0x57fdc2||0xcc;return function(_0x3dd68c){if(_0x3dd68c){return _0xa9f2e8[_0xbc4c('0x19')](_0x57fdc2);}return _0xa9f2e8[_0xbc4c('0x1a')](_0x57fdc2)['end']();};}function respondWithResult(_0x4c0744,_0x536225){_0x536225=_0x536225||0xc8;return function(_0x10796b){if(_0x10796b){return _0x4c0744['status'](_0x536225)[_0xbc4c('0x1b')](_0x10796b);}};}function respondWithFilteredResult(_0x335bfd,_0x268360){return function(_0x5f5966){if(_0x5f5966){var _0x13e51d=typeof _0x268360[_0xbc4c('0x1c')]===_0xbc4c('0x1d')&&typeof _0x268360[_0xbc4c('0x1e')]===_0xbc4c('0x1d');var _0x32cc84=_0x5f5966[_0xbc4c('0x1f')];var _0x4ec2c2=_0x13e51d?0x0:_0x268360[_0xbc4c('0x1c')];var _0x2636a0=_0x13e51d?_0x5f5966['count']:_0x268360['offset']+_0x268360[_0xbc4c('0x1e')];var _0x584dee;if(_0x2636a0>=_0x32cc84){_0x2636a0=_0x32cc84;_0x584dee=0xc8;}else{_0x584dee=0xce;}_0x335bfd[_0xbc4c('0x1a')](_0x584dee);return _0x335bfd[_0xbc4c('0x20')](_0xbc4c('0x21'),_0x4ec2c2+'-'+_0x2636a0+'/'+_0x32cc84)['json'](_0x5f5966);}return null;};}function patchUpdates(_0x4b3bc8){return function(_0xd7b600){try{jsonpatch[_0xbc4c('0x22')](_0xd7b600,_0x4b3bc8,!![]);}catch(_0x25938a){return BPromise[_0xbc4c('0x23')](_0x25938a);}return _0xd7b600[_0xbc4c('0x24')]();};}function saveUpdates(_0x4fad4e,_0x5a6905){return function(_0x25142f){if(_0x25142f){return _0x25142f['update'](_0x4fad4e)[_0xbc4c('0x25')](function(_0x502f52){return _0x502f52;});}return null;};}function removeEntity(_0x4582b1,_0x5e3da4){return function(_0x37e305){if(_0x37e305){return _0x37e305['destroy']()['then'](function(){_0x4582b1[_0xbc4c('0x1a')](0xcc)[_0xbc4c('0x26')]();});}};}function handleEntityNotFound(_0x1745da,_0x29c887){return function(_0x2de758){if(!_0x2de758){_0x1745da[_0xbc4c('0x19')](0x194);}return _0x2de758;};}function handleError(_0x4454b0,_0x53a17f){_0x53a17f=_0x53a17f||0x1f4;return function(_0xa5301e){logger[_0xbc4c('0x27')](_0xa5301e[_0xbc4c('0x28')]);if(_0xa5301e[_0xbc4c('0x29')]){delete _0xa5301e[_0xbc4c('0x29')];}_0x4454b0[_0xbc4c('0x1a')](_0x53a17f)[_0xbc4c('0x2a')](_0xa5301e);};}exports[_0xbc4c('0x2b')]=function(_0xa88468,_0x5516de){var _0x323576={},_0x25f1c8={},_0x1db483={'count':0x0,'rows':[]};var _0x287ea9=_[_0xbc4c('0x2c')](db['ChatInternalMessage']['rawAttributes'],function(_0x2fb581){return{'name':_0x2fb581[_0xbc4c('0x2d')],'type':_0x2fb581[_0xbc4c('0x2e')][_0xbc4c('0x2f')]};});_0x25f1c8[_0xbc4c('0x30')]=_[_0xbc4c('0x2c')](_0x287ea9,_0xbc4c('0x29'));_0x25f1c8['query']=_[_0xbc4c('0x31')](_0xa88468['query']);_0x25f1c8[_0xbc4c('0x32')]=_[_0xbc4c('0x33')](_0x25f1c8[_0xbc4c('0x30')],_0x25f1c8[_0xbc4c('0x34')]);_0x323576['attributes']=_[_0xbc4c('0x33')](_0x25f1c8[_0xbc4c('0x30')],qs[_0xbc4c('0x35')](_0xa88468['query']['fields']));_0x323576[_0xbc4c('0x36')]=_0x323576[_0xbc4c('0x36')]['length']?_0x323576[_0xbc4c('0x36')]:_0x25f1c8[_0xbc4c('0x30')];if(!_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x37')]('nolimit')){_0x323576[_0xbc4c('0x1e')]=qs[_0xbc4c('0x1e')](_0xa88468[_0xbc4c('0x34')]['limit']);_0x323576[_0xbc4c('0x1c')]=qs[_0xbc4c('0x1c')](_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x1c')]);}_0x323576[_0xbc4c('0x38')]=qs[_0xbc4c('0x39')](_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x39')]);_0x323576[_0xbc4c('0x3a')]=qs[_0xbc4c('0x32')](_['pick'](_0xa88468[_0xbc4c('0x34')],_0x25f1c8[_0xbc4c('0x32')]),_0x287ea9);if(_0xa88468[_0xbc4c('0x34')][_0xbc4c('0x3b')]){_0x323576[_0xbc4c('0x3a')]=_[_0xbc4c('0x3c')](_0x323576[_0xbc4c('0x3a')],{'$or':_[_0xbc4c('0x2c')](_0x287ea9,function(_0x30ff28){if(_0x30ff28[_0xbc4c('0x2e')]!==_0xbc4c('0x3d')){var _0x38fdd2={};_0x38fdd2[_0x30ff28[_0xbc4c('0x29')]]={'$like':'%'+_0xa88468['query'][_0xbc4c('0x3b')]+'%'};return _0x38fdd2;}})});}_0x323576=_[_0xbc4c('0x3c')]({},_0x323576,_0xa88468['options']);var _0x1fd9f4={'where':_0x323576[_0xbc4c('0x3a')]};return db[_0xbc4c('0x3e')][_0xbc4c('0x1f')](_0x1fd9f4)[_0xbc4c('0x25')](function(_0x5d1d69){_0x1db483[_0xbc4c('0x1f')]=_0x5d1d69;if(_0xa88468[_0xbc4c('0x34')]['includeAll']){_0x323576[_0xbc4c('0x3f')]=[{'all':!![]}];}return db[_0xbc4c('0x3e')][_0xbc4c('0x40')](_0x323576);})[_0xbc4c('0x25')](function(_0x14eb91){_0x1db483[_0xbc4c('0x41')]=_0x14eb91;return _0x1db483;})[_0xbc4c('0x25')](respondWithFilteredResult(_0x5516de,_0x323576))[_0xbc4c('0x42')](handleError(_0x5516de,null));};exports[_0xbc4c('0x43')]=function(_0x18dc68,_0x1b2994){var _0x2446f7={'raw':!![],'where':{'id':_0x18dc68[_0xbc4c('0x44')]['id']}},_0x3308cb={};_0x3308cb['model']=_[_0xbc4c('0x31')](db['ChatInternalMessage']['rawAttributes']);_0x3308cb[_0xbc4c('0x34')]=_[_0xbc4c('0x31')](_0x18dc68[_0xbc4c('0x34')]);_0x3308cb[_0xbc4c('0x32')]=_[_0xbc4c('0x33')](_0x3308cb[_0xbc4c('0x30')],_0x3308cb[_0xbc4c('0x34')]);_0x2446f7[_0xbc4c('0x36')]=_['intersection'](_0x3308cb[_0xbc4c('0x30')],qs['fields'](_0x18dc68['query']['fields']));_0x2446f7['attributes']=_0x2446f7[_0xbc4c('0x36')][_0xbc4c('0x45')]?_0x2446f7[_0xbc4c('0x36')]:_0x3308cb['model'];if(_0x18dc68['query']['includeAll']){_0x2446f7[_0xbc4c('0x3f')]=[{'all':!![]}];}_0x2446f7=_[_0xbc4c('0x3c')]({},_0x2446f7,_0x18dc68['options']);return db[_0xbc4c('0x3e')][_0xbc4c('0x46')](_0x2446f7)[_0xbc4c('0x25')](handleEntityNotFound(_0x1b2994,null))['then'](respondWithResult(_0x1b2994,null))[_0xbc4c('0x42')](handleError(_0x1b2994,null));};exports[_0xbc4c('0x47')]=function(_0x55647b,_0xdee109){return db[_0xbc4c('0x3e')][_0xbc4c('0x47')](_0x55647b[_0xbc4c('0x48')],{})[_0xbc4c('0x25')](respondWithResult(_0xdee109,0xc9))[_0xbc4c('0x42')](handleError(_0xdee109,null));};exports[_0xbc4c('0x49')]=function(_0x385f70,_0x1ef0ef){if(_0x385f70[_0xbc4c('0x48')]['id']){delete _0x385f70[_0xbc4c('0x48')]['id'];}return db[_0xbc4c('0x3e')][_0xbc4c('0x46')]({'where':{'id':_0x385f70['params']['id']}})[_0xbc4c('0x25')](handleEntityNotFound(_0x1ef0ef,null))[_0xbc4c('0x25')](saveUpdates(_0x385f70[_0xbc4c('0x48')],null))[_0xbc4c('0x25')](respondWithResult(_0x1ef0ef,null))[_0xbc4c('0x42')](handleError(_0x1ef0ef,null));};exports[_0xbc4c('0x4a')]=function(_0x3c2a4b,_0x4e9047){return db['ChatInternalMessage'][_0xbc4c('0x46')]({'where':{'id':_0x3c2a4b[_0xbc4c('0x44')]['id']}})[_0xbc4c('0x25')](handleEntityNotFound(_0x4e9047,null))[_0xbc4c('0x25')](removeEntity(_0x4e9047,null))[_0xbc4c('0x42')](handleError(_0x4e9047,null));};exports[_0xbc4c('0x4b')]=function(_0x170f5f,_0x2af71f){return db[_0xbc4c('0x3e')][_0xbc4c('0x4b')]()[_0xbc4c('0x25')](respondWithResult(_0x2af71f,null))[_0xbc4c('0x42')](handleError(_0x2af71f,null));};function wrapUser(_0x4dfab5){return function(_0xdd6fcb){var _0xb021fb=_0x4dfab5['get']({'plain':!![]});_0xb021fb[_0xbc4c('0x4c')]=[];if(_0xdd6fcb){_0xb021fb[_0xbc4c('0x4d')]=_0xdd6fcb[_0xbc4c('0x4e')];_0xb021fb['lastMessage']=_0xdd6fcb;}else{_0xb021fb[_0xbc4c('0x4d')]=moment(0x0)[_0xbc4c('0x4f')](_0xbc4c('0x50'));_0xb021fb[_0xbc4c('0x51')]={};}return _0xb021fb;};}exports[_0xbc4c('0x52')]=function(_0x2a59fc,_0x2fcccf,_0x2d4886){var _0x24be34=[];return db[_0xbc4c('0x53')]['findAll']({'where':{'role':[_0xbc4c('0x54'),'admin',_0xbc4c('0x55')]},'attributes':['id',_0xbc4c('0x56'),_0xbc4c('0x29'),_0xbc4c('0x57'),'userpic',_0xbc4c('0x58'),_0xbc4c('0x59'),_0xbc4c('0x5a'),_0xbc4c('0x5b'),_0xbc4c('0x5c')],'order':qs[_0xbc4c('0x39')]('-online'),'include':[{'model':db[_0xbc4c('0x5d')],'as':_0xbc4c('0x5e'),'attributes':['id',_0xbc4c('0x29'),'type'],'through':{'attributes':[]}}]})[_0xbc4c('0x25')](function(_0x1935b3){if(_0x1935b3){var _0x36fefb=_0x2a59fc[_0xbc4c('0x55')][_0xbc4c('0x5f')]({'plain':!![]});if(!_0x36fefb)throw new Error(_0xbc4c('0x60'));if(_0x36fefb[_0xbc4c('0x57')]===_0xbc4c('0x55')){return db[_0xbc4c('0x61')][_0xbc4c('0x46')]({'where':{'name':_0xbc4c('0x62'),'userProfileId':_0x36fefb[_0xbc4c('0x63')]},'raw':!![]})[_0xbc4c('0x25')](function(_0xc9d099){if(_0xc9d099){if(_0xc9d099['autoAssociation']===0x0){return db['UserProfileResource'][_0xbc4c('0x40')]({'where':{'sectionId':_0xc9d099['id']},'raw':!![]})[_0xbc4c('0x25')](function(_0x122e75){var _0x1e5c8f=[];if(_[_0xbc4c('0x64')](_0x122e75)){_0x1e5c8f=_[_0xbc4c('0x3b')](_0x1935b3,function(_0x7f9f5d){if(_0x7f9f5d[_0xbc4c('0x57')]!==_0xbc4c('0x54')){return _0x7f9f5d;}});return _0x1e5c8f;}else{for(var _0x522be4=0x0;_0x522be4<_0x1935b3[_0xbc4c('0x45')];_0x522be4++){var _0x1326f3=_0x1935b3[_0x522be4];if(_0x1326f3[_0xbc4c('0x57')]===_0xbc4c('0x54')){var _0xcb93ed=_[_0xbc4c('0x46')](_0x122e75,function(_0x23a14b){return _0x23a14b[_0xbc4c('0x65')]===_0x1326f3['id'];});if(_0xcb93ed)_0x1e5c8f[_0xbc4c('0x66')](_0x1326f3);}else{_0x1e5c8f[_0xbc4c('0x66')](_0x1326f3);}}return _0x1e5c8f;}});}else{return _0x1935b3;}}else{var _0x141c41=_[_0xbc4c('0x3b')](_0x1935b3,function(_0x4bad06){if(_0x4bad06[_0xbc4c('0x57')]!==_0xbc4c('0x54')){return _0x4bad06;}});return _0x141c41;}});}else{return _0x1935b3;}}})[_0xbc4c('0x25')](function(_0x57f7ae){var _0xb1e908=[];if(_0x57f7ae){_0x24be34=_0x57f7ae;for(var _0x58719d=0x0;_0x58719d<_0x57f7ae['length'];_0x58719d+=0x1){_0x24be34[_0x58719d]['messages']=[];_0xb1e908[_0xbc4c('0x66')](db['ChatInternalMessage'][_0xbc4c('0x46')]({'where':{'FromId':[_0x2a59fc[_0xbc4c('0x55')]['id'],_0x57f7ae[_0x58719d]['id']],'ToId':[_0x2a59fc[_0xbc4c('0x55')]['id'],_0x57f7ae[_0x58719d]['id']],'ChatGroupId':null},'attributes':['id',_0xbc4c('0x4e'),'FromId',_0xbc4c('0x67'),_0xbc4c('0x68'),'body'],'order':qs[_0xbc4c('0x39')](_0xbc4c('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbc4c('0x25')](wrapUser(_0x57f7ae[_0x58719d])));}return BPromise[_0xbc4c('0x6a')](_0xb1e908);}return[];})[_0xbc4c('0x25')](function(_0x5e52ec){return{'rows':_0x5e52ec,'count':_0x5e52ec['length']};})[_0xbc4c('0x25')](respondWithResult(_0x2fcccf,null))[_0xbc4c('0x42')](handleError(_0x2fcccf,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2fd86e1..5ca7d6f 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 _0xa3d4=['emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners','save','remove'];(function(_0x8d3478,_0x1e55eb){var _0x5617cc=function(_0x7d7083){while(--_0x7d7083){_0x8d3478['push'](_0x8d3478['shift']());}};_0x5617cc(++_0x1e55eb);}(_0xa3d4,0x151));var _0x4a3d=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa3d4[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require(_0x4a3d('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x4a3d('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4a3d('0x2')](0x0);var events={'afterCreate':_0x4a3d('0x3'),'afterUpdate':'update','afterDestroy':_0x4a3d('0x4')};function emitEvent(_0x58057c){return function(_0x519729,_0x5394ae,_0x5ba05d){ChatInternalMessageEvents['emit'](_0x58057c+':'+_0x519729['id'],_0x519729);ChatInternalMessageEvents[_0x4a3d('0x5')](_0x58057c,_0x519729);_0x5ba05d(null);};}for(var e in events){if(events[_0x4a3d('0x6')](e)){var event=events[e];ChatInternalMessage[_0x4a3d('0x7')](e,emitEvent(event));}}module[_0x4a3d('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xdeb3=['remove','emit','hook','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x3e16d,_0x2c1a8e){var _0x1bbc39=function(_0x3be846){while(--_0x3be846){_0x3e16d['push'](_0x3e16d['shift']());}};_0x1bbc39(++_0x2c1a8e);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3deb('0x0'))['db'][_0x3deb('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3deb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3deb('0x3')};function emitEvent(_0x2e9b78){return function(_0x365134,_0x3114e7,_0x23bc12){ChatInternalMessageEvents['emit'](_0x2e9b78+':'+_0x365134['id'],_0x365134);ChatInternalMessageEvents[_0x3deb('0x4')](_0x2e9b78,_0x365134);_0x23bc12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x3deb('0x5')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 533f80b..7da9006 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 _0x638e=['define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports'];(function(_0x129b9f,_0x336f13){var _0x2109f8=function(_0x1463fc){while(--_0x1463fc){_0x129b9f['push'](_0x129b9f['shift']());}};_0x2109f8(++_0x336f13);}(_0x638e,0x64));var _0xe638=function(_0x56188d,_0x514566){_0x56188d=_0x56188d-0x0;var _0x6004b1=_0x638e[_0x56188d];return _0x6004b1;};'use strict';var _=require(_0xe638('0x0'));var util=require(_0xe638('0x1'));var logger=require(_0xe638('0x2'))(_0xe638('0x3'));var moment=require(_0xe638('0x4'));var BPromise=require(_0xe638('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe638('0x6'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xe638('0x7')]=function(_0x5303f1,_0x15ed32){return _0x5303f1[_0xe638('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xe638('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe638('0xa'),'collate':_0xe638('0xb')});}; \ No newline at end of file +var _0xbf64=['path','rimraf','../../config/environment','exports','ChatInternalMessage','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x418330,_0x4c8c2d){var _0x503c9a=function(_0x33ce45){while(--_0x33ce45){_0x418330['push'](_0x418330['shift']());}};_0x503c9a(++_0x4c8c2d);}(_0xbf64,0x8a));var _0x4bf6=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0xbf64[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require(_0x4bf6('0x0'));var util=require(_0x4bf6('0x1'));var logger=require(_0x4bf6('0x2'))(_0x4bf6('0x3'));var moment=require('moment');var BPromise=require(_0x4bf6('0x4'));var rp=require(_0x4bf6('0x5'));var fs=require('fs');var path=require(_0x4bf6('0x6'));var rimraf=require(_0x4bf6('0x7'));var config=require(_0x4bf6('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x4bf6('0x9')]=function(_0x35c473,_0x3dd7d1){return _0x35c473['define'](_0x4bf6('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bf6('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a3c8f91..1ca86ec 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 _0x2263=['request\x20sent','debug','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x2b7312,_0x599b03){var _0x2a72c9=function(_0x94cc67){while(--_0x94cc67){_0x2b7312['push'](_0x2b7312['shift']());}};_0x2a72c9(++_0x599b03);}(_0x2263,0x6e));var _0x3226=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0x2263[_0x58d5ac];return _0x37985c;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require(_0x3226('0x2'));var BPromise=require(_0x3226('0x3'));var rs=require(_0x3226('0x4'));var fs=require('fs');var Redis=require(_0x3226('0x5'));var db=require(_0x3226('0x6'))['db'];var utils=require(_0x3226('0x7'));var logger=require('../../config/logger')(_0x3226('0x8'));var config=require(_0x3226('0x9'));var jayson=require(_0x3226('0xa'));var client=jayson[_0x3226('0xb')][_0x3226('0xc')]({'port':0x232a});config['redis']=_[_0x3226('0xd')](config[_0x3226('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3226('0xe')]));require(_0x3226('0xf'))['register'](socket);function respondWithRpcPromise(_0x376054,_0x10321a,_0x2c4160){return new BPromise(function(_0x91eee3,_0x16f6ef){return client[_0x3226('0x10')](_0x376054,_0x2c4160)[_0x3226('0x11')](function(_0x4dfd7f){logger[_0x3226('0x12')](_0x3226('0x13'),_0x10321a,_0x3226('0x14'));logger[_0x3226('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x10321a,'request\x20sent',JSON['stringify'](_0x4dfd7f));if(_0x4dfd7f['error']){if(_0x4dfd7f['error'][_0x3226('0x16')]===0x1f4){logger[_0x3226('0x17')](_0x3226('0x13'),_0x10321a,_0x4dfd7f[_0x3226('0x17')]['message']);return _0x16f6ef(_0x4dfd7f['error'][_0x3226('0x18')]);}logger[_0x3226('0x17')](_0x3226('0x13'),_0x10321a,_0x4dfd7f['error'][_0x3226('0x18')]);return _0x91eee3(_0x4dfd7f[_0x3226('0x17')][_0x3226('0x18')]);}else{logger[_0x3226('0x12')](_0x3226('0x13'),_0x10321a,_0x3226('0x14'));_0x91eee3(_0x4dfd7f['result']['message']);}})[_0x3226('0x19')](function(_0x5ac619){logger[_0x3226('0x17')](_0x3226('0x13'),_0x10321a,_0x5ac619);_0x16f6ef(_0x5ac619);});});} \ No newline at end of file +var _0xbe12=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2f7b69,_0x32871d){var _0x55e94e=function(_0x51cdfe){while(--_0x51cdfe){_0x2f7b69['push'](_0x2f7b69['shift']());}};_0x55e94e(++_0x32871d);}(_0xbe12,0xea));var _0x2be1=function(_0x3aa48e,_0x22eb8d){_0x3aa48e=_0x3aa48e-0x0;var _0x26f857=_0xbe12[_0x3aa48e];return _0x26f857;};'use strict';var _=require(_0x2be1('0x0'));var util=require(_0x2be1('0x1'));var moment=require(_0x2be1('0x2'));var BPromise=require(_0x2be1('0x3'));var rs=require(_0x2be1('0x4'));var fs=require('fs');var Redis=require(_0x2be1('0x5'));var db=require(_0x2be1('0x6'))['db'];var utils=require(_0x2be1('0x7'));var logger=require(_0x2be1('0x8'))(_0x2be1('0x9'));var config=require(_0x2be1('0xa'));var jayson=require(_0x2be1('0xb'));var client=jayson['client'][_0x2be1('0xc')]({'port':0x232a});config[_0x2be1('0xd')]=_['defaults'](config[_0x2be1('0xd')],{'host':_0x2be1('0xe'),'port':0x18eb});var socket=require(_0x2be1('0xf'))(new Redis(config[_0x2be1('0xd')]));require(_0x2be1('0x10'))[_0x2be1('0x11')](socket);function respondWithRpcPromise(_0x18ae9b,_0x550a6e,_0x441571){return new BPromise(function(_0x44c9b1,_0x34840f){return client[_0x2be1('0x12')](_0x18ae9b,_0x441571)[_0x2be1('0x13')](function(_0x50f865){logger[_0x2be1('0x14')](_0x2be1('0x15'),_0x550a6e,_0x2be1('0x16'));logger[_0x2be1('0x17')](_0x2be1('0x18'),_0x550a6e,_0x2be1('0x16'),JSON['stringify'](_0x50f865));if(_0x50f865[_0x2be1('0x19')]){if(_0x50f865['error'][_0x2be1('0x1a')]===0x1f4){logger[_0x2be1('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x550a6e,_0x50f865[_0x2be1('0x19')][_0x2be1('0x1b')]);return _0x34840f(_0x50f865['error'][_0x2be1('0x1b')]);}logger[_0x2be1('0x19')](_0x2be1('0x15'),_0x550a6e,_0x50f865[_0x2be1('0x19')][_0x2be1('0x1b')]);return _0x44c9b1(_0x50f865[_0x2be1('0x19')]['message']);}else{logger[_0x2be1('0x14')](_0x2be1('0x15'),_0x550a6e,_0x2be1('0x16'));_0x44c9b1(_0x50f865[_0x2be1('0x1c')][_0x2be1('0x1b')]);}})['catch'](function(_0x10f95e){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x550a6e,_0x10f95e);_0x34840f(_0x10f95e);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index f1490f4..c57acee 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 _0x3cef=['./chatInternalMessage.events','remove','update','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x4e094a,_0x271b1e){var _0x2701f0=function(_0x383256){while(--_0x383256){_0x4e094a['push'](_0x4e094a['shift']());}};_0x2701f0(++_0x271b1e);}(_0x3cef,0x98));var _0xf3ce=function(_0x27f99f,_0x4ba1b8){_0x27f99f=_0x27f99f-0x0;var _0x16cf29=_0x3cef[_0x27f99f];return _0x16cf29;};'use strict';var ChatInternalMessageEvents=require(_0xf3ce('0x0'));var events=['save',_0xf3ce('0x1'),_0xf3ce('0x2')];function createListener(_0x595feb,_0x5d54c3){return function(_0x375011){_0x5d54c3[_0xf3ce('0x3')](_0x595feb,_0x375011);};}function removeListener(_0x55a8f0,_0x5ba08c){return function(){ChatInternalMessageEvents[_0xf3ce('0x4')](_0x55a8f0,_0x5ba08c);};}exports[_0xf3ce('0x5')]=function(_0x3c25f0){for(var _0x10c5b9=0x0,_0x24100a=events[_0xf3ce('0x6')];_0x10c5b9<_0x24100a;_0x10c5b9++){var _0x541acd=events[_0x10c5b9];var _0x3f3014=createListener(_0xf3ce('0x7')+_0x541acd,_0x3c25f0);ChatInternalMessageEvents['on'](_0x541acd,_0x3f3014);}}; \ No newline at end of file +var _0x1dd4=['./chatInternalMessage.events','save','remove','update','removeListener','register','chatInternalMessage:'];(function(_0x1d14a1,_0x386b02){var _0x150b15=function(_0x397d15){while(--_0x397d15){_0x1d14a1['push'](_0x1d14a1['shift']());}};_0x150b15(++_0x386b02);}(_0x1dd4,0x10a));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x41dd('0x0'));var events=[_0x41dd('0x1'),_0x41dd('0x2'),_0x41dd('0x3')];function createListener(_0x2ba232,_0x485cd5){return function(_0xd5aa8){_0x485cd5['emit'](_0x2ba232,_0xd5aa8);};}function removeListener(_0x1e9b94,_0x1c68c1){return function(){ChatInternalMessageEvents[_0x41dd('0x4')](_0x1e9b94,_0x1c68c1);};}exports[_0x41dd('0x5')]=function(_0x4d03c1){for(var _0x8eb682=0x0,_0x315dd5=events['length'];_0x8eb682<_0x315dd5;_0x8eb682++){var _0x2f0cc7=events[_0x8eb682];var _0x39237a=createListener(_0x41dd('0x6')+_0x2f0cc7,_0x4d03c1);ChatInternalMessageEvents['on'](_0x2f0cc7,_0x39237a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 5c0c57f..3e78947 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 _0x61d4=['show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','/users','getUsers','/:id'];(function(_0x5814ca,_0x3b6713){var _0xeb1833=function(_0x553de1){while(--_0x553de1){_0x5814ca['push'](_0x5814ca['shift']());}};_0xeb1833(++_0x3b6713);}(_0x61d4,0xbb));var _0x461d=function(_0xe7a4b5,_0x200412){_0xe7a4b5=_0xe7a4b5-0x0;var _0xe5bb55=_0x61d4[_0xe7a4b5];return _0xe5bb55;};'use strict';var multer=require('multer');var util=require(_0x461d('0x0'));var path=require(_0x461d('0x1'));var timeout=require(_0x461d('0x2'));var express=require(_0x461d('0x3'));var router=express[_0x461d('0x4')]();var fs_extra=require(_0x461d('0x5'));var auth=require(_0x461d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x461d('0x7')]('/',auth[_0x461d('0x8')](),controller['index']);router[_0x461d('0x7')](_0x461d('0x9'),auth[_0x461d('0x8')](),controller['describe']);router[_0x461d('0x7')](_0x461d('0xa'),auth[_0x461d('0x8')](),controller[_0x461d('0xb')]);router[_0x461d('0x7')](_0x461d('0xc'),auth[_0x461d('0x8')](),controller[_0x461d('0xd')]);router[_0x461d('0xe')]('/',auth[_0x461d('0x8')](),controller[_0x461d('0xf')]);router[_0x461d('0x10')](_0x461d('0xc'),controller[_0x461d('0x11')]);router[_0x461d('0x12')]('/:id',auth[_0x461d('0x8')](),controller[_0x461d('0x13')]);module['exports']=router; \ No newline at end of file +var _0x93b2=['../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','post','create','put','update','delete','/:id','destroy','exports','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x93b2,0xca));var _0x293b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x93b2[_0x4792c8];return _0x35edb1;};'use strict';var multer=require('multer');var util=require(_0x293b('0x0'));var path=require(_0x293b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x293b('0x2')]();var fs_extra=require(_0x293b('0x3'));var auth=require(_0x293b('0x4'));var interaction=require(_0x293b('0x5'));var config=require('../../config/environment');var controller=require(_0x293b('0x6'));router[_0x293b('0x7')]('/',auth[_0x293b('0x8')](),controller[_0x293b('0x9')]);router['get'](_0x293b('0xa'),auth['isAuthenticated'](),controller[_0x293b('0xb')]);router[_0x293b('0x7')](_0x293b('0xc'),auth[_0x293b('0x8')](),controller[_0x293b('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x293b('0xe')]);router[_0x293b('0xf')]('/',auth[_0x293b('0x8')](),controller[_0x293b('0x10')]);router[_0x293b('0x11')]('/:id',controller[_0x293b('0x12')]);router[_0x293b('0x13')](_0x293b('0x14'),auth['isAuthenticated'](),controller[_0x293b('0x15')]);module[_0x293b('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index d579366..2179a72 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 _0x235a=['exports','TEXT','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0x235a,0x1ef));var _0xa235=function(_0x4c5bcc,_0x1ea1e9){_0x4c5bcc=_0x4c5bcc-0x0;var _0x3ec229=_0x235a[_0x4c5bcc];return _0x3ec229;};'use strict';var Sequelize=require(_0xa235('0x0'));module[_0xa235('0x1')]={'body':{'type':Sequelize[_0xa235('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa235('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa235('0x4')]('in',_0xa235('0x5')),'defaultValue':_0xa235('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa235('0x6')]},'providerName':{'type':Sequelize[_0xa235('0x7')]},'providerResponse':{'type':Sequelize[_0xa235('0x2')]}}; \ No newline at end of file +var _0x97c1=['exports','medium','ENUM','out','DATE','STRING','sequelize'];(function(_0x507834,_0x7e84d4){var _0x54c524=function(_0x58c2e7){while(--_0x58c2e7){_0x507834['push'](_0x507834['shift']());}};_0x54c524(++_0x7e84d4);}(_0x97c1,0xdf));var _0x197c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x97c1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'body':{'type':Sequelize['TEXT'](_0x197c('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x197c('0x3')]('in',_0x197c('0x4')),'defaultValue':_0x197c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x197c('0x5')]},'providerName':{'type':Sequelize[_0x197c('0x6')]},'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 3d0c277..eca1a2d 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 _0x2fdc=['error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','keys','intersection','query','model','fields','attributes','length','order','sort','where','filters','pick','filter','VIRTUAL','ChatMessage','includeAll','include','findAll','params','merge','options','find','create','body','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','agent','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','null','RejectMessage','rejectMessage','Sequelize','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47c53e,_0x4e03ba){var _0x30cc26=function(_0x4744c8){while(--_0x4744c8){_0x47c53e['push'](_0x47c53e['shift']());}};_0x30cc26(++_0x4e03ba);}(_0x2fdc,0x154));var _0xc2fd=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x2fdc[_0x479509];return _0x382da8;};'use strict';var emlformat=require(_0xc2fd('0x0'));var rimraf=require(_0xc2fd('0x1'));var zipdir=require(_0xc2fd('0x2'));var jsonpatch=require(_0xc2fd('0x3'));var rp=require('request-promise');var moment=require(_0xc2fd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2fd('0x5'));var util=require('util');var path=require(_0xc2fd('0x6'));var sox=require(_0xc2fd('0x7'));var csv=require('to-csv');var ejs=require(_0xc2fd('0x8'));var fs=require('fs');var fs_extra=require(_0xc2fd('0x9'));var _=require(_0xc2fd('0xa'));var squel=require('squel');var crypto=require(_0xc2fd('0xb'));var jsforce=require(_0xc2fd('0xc'));var deskjs=require(_0xc2fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc2fd('0xe'));var Papa=require('papaparse');var Redis=require(_0xc2fd('0xf'));var authService=require(_0xc2fd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc2fd('0x11'));var hardwareService=require(_0xc2fd('0x12'));var logger=require(_0xc2fd('0x13'))(_0xc2fd('0x14'));var utils=require('../../config/utils');var config=require(_0xc2fd('0x15'));var licenseUtil=require(_0xc2fd('0x16'));var db=require('../../mysqldb')['db'];config[_0xc2fd('0x17')]=_[_0xc2fd('0x18')](config['redis'],{'host':_0xc2fd('0x19'),'port':0x18eb});var socket=require(_0xc2fd('0x1a'))(new Redis(config[_0xc2fd('0x17')]));require(_0xc2fd('0x1b'))['register'](socket);var jayson=require(_0xc2fd('0x1c'));var client=jayson[_0xc2fd('0x1d')][_0xc2fd('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xc2fd('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x29707b,_0x4b4773,_0x22f52d,_0x2bf50c){return new BPromise(function(_0x544806,_0xe83695){var _0x588197=_0x2bf50c||client;return _0x588197[_0xc2fd('0x1f')](_0x29707b,_0x22f52d)[_0xc2fd('0x20')](function(_0x2ee5b8){logger['info'](_0xc2fd('0x21'),_0x4b4773,_0xc2fd('0x22'));logger[_0xc2fd('0x23')](_0xc2fd('0x24'),_0x4b4773,_0xc2fd('0x22'),JSON[_0xc2fd('0x25')](_0x2ee5b8));if(_0x2ee5b8[_0xc2fd('0x26')]){if(_0x2ee5b8[_0xc2fd('0x26')][_0xc2fd('0x27')]===0x1f4){logger[_0xc2fd('0x26')]('ChatMessage,\x20%s,\x20%s',_0x4b4773,_0x2ee5b8[_0xc2fd('0x26')][_0xc2fd('0x28')]);return _0xe83695(_0x2ee5b8['error']['message']);}logger['error'](_0xc2fd('0x21'),_0x4b4773,_0x2ee5b8['error']['message']);return _0x544806(_0x2ee5b8['error'][_0xc2fd('0x28')]);}else{logger['info'](_0xc2fd('0x21'),_0x4b4773,'request\x20sent');_0x544806(_0x2ee5b8['result'][_0xc2fd('0x28')]);}})[_0xc2fd('0x29')](function(_0x1dfbaf){logger[_0xc2fd('0x26')]('ChatMessage,\x20%s,\x20%s',_0x4b4773,_0x1dfbaf);_0xe83695(_0x1dfbaf);});});}function respondWithStatusCode(_0x92c8aa,_0x18745c){_0x18745c=_0x18745c||0xcc;return function(_0x8f0fb4){if(_0x8f0fb4){return _0x92c8aa[_0xc2fd('0x2a')](_0x18745c);}return _0x92c8aa['status'](_0x18745c)['end']();};}function respondWithResult(_0x13cf6e,_0x295a6e){_0x295a6e=_0x295a6e||0xc8;return function(_0x546eb4){if(_0x546eb4){return _0x13cf6e[_0xc2fd('0x2b')](_0x295a6e)[_0xc2fd('0x2c')](_0x546eb4);}};}function respondWithFilteredResult(_0x74ecbe,_0x5d8c0e){return function(_0x2f4283){if(_0x2f4283){var _0x2a63c4=typeof _0x5d8c0e[_0xc2fd('0x2d')]===_0xc2fd('0x2e')&&typeof _0x5d8c0e['limit']==='undefined';var _0xfb9842=_0x2f4283[_0xc2fd('0x2f')];var _0x745baa=_0x2a63c4?0x0:_0x5d8c0e['offset'];var _0x94bec6=_0x2a63c4?_0x2f4283['count']:_0x5d8c0e[_0xc2fd('0x2d')]+_0x5d8c0e[_0xc2fd('0x30')];var _0x4f2e3;if(_0x94bec6>=_0xfb9842){_0x94bec6=_0xfb9842;_0x4f2e3=0xc8;}else{_0x4f2e3=0xce;}_0x74ecbe[_0xc2fd('0x2b')](_0x4f2e3);return _0x74ecbe['set'](_0xc2fd('0x31'),_0x745baa+'-'+_0x94bec6+'/'+_0xfb9842)['json'](_0x2f4283);}return null;};}function patchUpdates(_0x1f7824){return function(_0x448ff4){try{jsonpatch['apply'](_0x448ff4,_0x1f7824,!![]);}catch(_0x1b1762){return BPromise[_0xc2fd('0x32')](_0x1b1762);}return _0x448ff4['save']();};}function saveUpdates(_0x3e18a5,_0x5cc3a2){return function(_0x543101){if(_0x543101){return _0x543101[_0xc2fd('0x33')](_0x3e18a5)[_0xc2fd('0x20')](function(_0xe76814){return _0xe76814;});}return null;};}function removeEntity(_0x565b5b,_0x326c09){return function(_0x5e7f06){if(_0x5e7f06){return _0x5e7f06[_0xc2fd('0x34')]()[_0xc2fd('0x20')](function(){_0x565b5b[_0xc2fd('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5939d5,_0x27471e){return function(_0x37a556){if(!_0x37a556){_0x5939d5[_0xc2fd('0x2a')](0x194);}return _0x37a556;};}function handleError(_0x5e2423,_0x164e27){_0x164e27=_0x164e27||0x1f4;return function(_0x1ebd79){logger[_0xc2fd('0x26')](_0x1ebd79[_0xc2fd('0x35')]);if(_0x1ebd79[_0xc2fd('0x36')]){delete _0x1ebd79[_0xc2fd('0x36')];}_0x5e2423['status'](_0x164e27)[_0xc2fd('0x37')](_0x1ebd79);};}exports[_0xc2fd('0x38')]=function(_0x4029f0,_0x292a71){var _0x21d1a8={},_0x26bab4={},_0x5a55a3={'count':0x0,'rows':[]};var _0x3f1e58=_[_0xc2fd('0x39')](db['ChatMessage'][_0xc2fd('0x3a')],function(_0x3a1e9d){return{'name':_0x3a1e9d[_0xc2fd('0x3b')],'type':_0x3a1e9d[_0xc2fd('0x3c')]['key']};});_0x26bab4['model']=_[_0xc2fd('0x39')](_0x3f1e58,_0xc2fd('0x36'));_0x26bab4['query']=_[_0xc2fd('0x3d')](_0x4029f0['query']);_0x26bab4['filters']=_[_0xc2fd('0x3e')](_0x26bab4['model'],_0x26bab4[_0xc2fd('0x3f')]);_0x21d1a8['attributes']=_[_0xc2fd('0x3e')](_0x26bab4[_0xc2fd('0x40')],qs[_0xc2fd('0x41')](_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x41')]));_0x21d1a8[_0xc2fd('0x42')]=_0x21d1a8['attributes'][_0xc2fd('0x43')]?_0x21d1a8[_0xc2fd('0x42')]:_0x26bab4[_0xc2fd('0x40')];if(!_0x4029f0[_0xc2fd('0x3f')]['hasOwnProperty']('nolimit')){_0x21d1a8[_0xc2fd('0x30')]=qs[_0xc2fd('0x30')](_0x4029f0[_0xc2fd('0x3f')]['limit']);_0x21d1a8[_0xc2fd('0x2d')]=qs[_0xc2fd('0x2d')](_0x4029f0[_0xc2fd('0x3f')]['offset']);}_0x21d1a8[_0xc2fd('0x44')]=qs[_0xc2fd('0x45')](_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x45')]);_0x21d1a8[_0xc2fd('0x46')]=qs[_0xc2fd('0x47')](_[_0xc2fd('0x48')](_0x4029f0[_0xc2fd('0x3f')],_0x26bab4[_0xc2fd('0x47')]),_0x3f1e58);if(_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x49')]){_0x21d1a8[_0xc2fd('0x46')]=_['merge'](_0x21d1a8['where'],{'$or':_[_0xc2fd('0x39')](_0x3f1e58,function(_0xb1ea10){if(_0xb1ea10[_0xc2fd('0x3c')]!==_0xc2fd('0x4a')){var _0x411793={};_0x411793[_0xb1ea10[_0xc2fd('0x36')]]={'$like':'%'+_0x4029f0[_0xc2fd('0x3f')][_0xc2fd('0x49')]+'%'};return _0x411793;}})});}_0x21d1a8=_['merge']({},_0x21d1a8,_0x4029f0['options']);var _0x4c4634={'where':_0x21d1a8[_0xc2fd('0x46')]};return db[_0xc2fd('0x4b')][_0xc2fd('0x2f')](_0x4c4634)[_0xc2fd('0x20')](function(_0x4aa958){_0x5a55a3[_0xc2fd('0x2f')]=_0x4aa958;if(_0x4029f0['query'][_0xc2fd('0x4c')]){_0x21d1a8[_0xc2fd('0x4d')]=[{'all':!![]}];}return db[_0xc2fd('0x4b')][_0xc2fd('0x4e')](_0x21d1a8);})['then'](function(_0x1e9bdd){_0x5a55a3['rows']=_0x1e9bdd;return _0x5a55a3;})['then'](respondWithFilteredResult(_0x292a71,_0x21d1a8))[_0xc2fd('0x29')](handleError(_0x292a71,null));};exports['show']=function(_0x55eebb,_0x309126){var _0x39010e={'raw':!![],'where':{'id':_0x55eebb[_0xc2fd('0x4f')]['id']}},_0x49425f={};_0x49425f['model']=_['keys'](db[_0xc2fd('0x4b')]['rawAttributes']);_0x49425f[_0xc2fd('0x3f')]=_['keys'](_0x55eebb[_0xc2fd('0x3f')]);_0x49425f['filters']=_[_0xc2fd('0x3e')](_0x49425f['model'],_0x49425f['query']);_0x39010e[_0xc2fd('0x42')]=_[_0xc2fd('0x3e')](_0x49425f[_0xc2fd('0x40')],qs[_0xc2fd('0x41')](_0x55eebb['query']['fields']));_0x39010e[_0xc2fd('0x42')]=_0x39010e[_0xc2fd('0x42')]['length']?_0x39010e[_0xc2fd('0x42')]:_0x49425f[_0xc2fd('0x40')];if(_0x55eebb[_0xc2fd('0x3f')][_0xc2fd('0x4c')]){_0x39010e['include']=[{'all':!![]}];}_0x39010e=_[_0xc2fd('0x50')]({},_0x39010e,_0x55eebb[_0xc2fd('0x51')]);return db[_0xc2fd('0x4b')][_0xc2fd('0x52')](_0x39010e)[_0xc2fd('0x20')](handleEntityNotFound(_0x309126,null))[_0xc2fd('0x20')](respondWithResult(_0x309126,null))[_0xc2fd('0x29')](handleError(_0x309126,null));};exports[_0xc2fd('0x53')]=function(_0x22900e,_0x46fd7d){return db['ChatMessage'][_0xc2fd('0x53')](_0x22900e['body'],{})[_0xc2fd('0x20')](respondWithResult(_0x46fd7d,0xc9))['catch'](handleError(_0x46fd7d,null));};exports[_0xc2fd('0x33')]=function(_0x38bdcf,_0x1f2ed8){if(_0x38bdcf[_0xc2fd('0x54')]['id']){delete _0x38bdcf['body']['id'];}return db[_0xc2fd('0x4b')][_0xc2fd('0x52')]({'where':{'id':_0x38bdcf[_0xc2fd('0x4f')]['id']}})[_0xc2fd('0x20')](handleEntityNotFound(_0x1f2ed8,null))[_0xc2fd('0x20')](saveUpdates(_0x38bdcf['body'],null))[_0xc2fd('0x20')](respondWithResult(_0x1f2ed8,null))[_0xc2fd('0x29')](handleError(_0x1f2ed8,null));};exports['destroy']=function(_0x2b60e0,_0x4cdba2){return db['ChatMessage'][_0xc2fd('0x52')]({'where':{'id':_0x2b60e0[_0xc2fd('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4cdba2,null))[_0xc2fd('0x20')](removeEntity(_0x4cdba2,null))[_0xc2fd('0x29')](handleError(_0x4cdba2,null));};exports[_0xc2fd('0x55')]=function(_0x1b9cde,_0x224e77){return db[_0xc2fd('0x4b')][_0xc2fd('0x55')]()[_0xc2fd('0x20')](respondWithResult(_0x224e77,null))[_0xc2fd('0x29')](handleError(_0x224e77,null));};var interaction_log=require('../../config/logger')(_0xc2fd('0x56'));exports[_0xc2fd('0x57')]=function(_0x33c453,_0x3f2961,_0x16b5e3){var _0x4421f0={'agent':{},'channel':'chat'};if(_0x33c453[_0xc2fd('0x54')]['id']){delete _0x33c453[_0xc2fd('0x54')]['id'];}_0x33c453[_0xc2fd('0x54')]['read']=!![];_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x58')]=moment()['format'](_0xc2fd('0x59'));_0x33c453[_0xc2fd('0x54')]['UserId']=_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')]||_0x33c453[_0xc2fd('0x5b')]['id'];_0x4421f0['agent']['id']=_0x33c453['body'][_0xc2fd('0x5a')];return db[_0xc2fd('0x4b')][_0xc2fd('0x52')]({'where':{'id':_0x33c453['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f2961,null))[_0xc2fd('0x20')](saveUpdates(_0x33c453[_0xc2fd('0x54')],null))[_0xc2fd('0x20')](function(_0xa8f5ee){if(_0xa8f5ee){_0x4421f0[_0xc2fd('0x28')]=_0xa8f5ee[_0xc2fd('0x5c')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xa8f5ee[_0xc2fd('0x5d')]}});}return null;})[_0xc2fd('0x20')](handleEntityNotFound(_0x3f2961,null))[_0xc2fd('0x20')](function(_0x1067ad){if(_0x1067ad){return _0x1067ad[_0xc2fd('0x33')]({'UserId':_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')],'read1stAt':_[_0xc2fd('0x5e')](_0x1067ad[_0xc2fd('0x5f')])?moment()[_0xc2fd('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0xe0ad1d){if(_0xe0ad1d){_0x4421f0[_0xc2fd('0x61')]=_0xe0ad1d[_0xc2fd('0x5c')]({'plain':!![]});interaction_log['info'](_0xc2fd('0x62'),_0x33c453[_0xc2fd('0x5b')]['id'],_0x33c453[_0xc2fd('0x5b')][_0xc2fd('0x36')],_0x33c453[_0xc2fd('0x5b')][_0xc2fd('0x63')],_0x4421f0['interaction']['id'],_0x33c453[_0xc2fd('0x54')]?JSON[_0xc2fd('0x25')](_0x33c453[_0xc2fd('0x54')]):'null');return respondWithRpcPromise(_0xc2fd('0x64'),_0xc2fd('0x65'),_0x4421f0);}return null;})[_0xc2fd('0x20')](function(_0xb8f137){var _0xd06d3d=_0xc2fd('0x66')+_0xb8f137[_0xc2fd('0x28')][_0xc2fd('0x67')];return db[_0xc2fd('0x68')]['query'](_0xd06d3d,{'type':db['Sequelize'][_0xc2fd('0x69')][_0xc2fd('0x6a')],'raw':!![]})[_0xc2fd('0x20')](function(_0x4c5180){return _0x4c5180;});})[_0xc2fd('0x20')](function(_0x18c050){if(_0x18c050){_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x6b')]=_0x18c050[0x0];if(!_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')])return;return db['User'][_0xc2fd('0x52')]({'where':{'id':_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x5a')],'role':_0xc2fd('0x6c')},'attributes':['id',_0xc2fd('0x36'),'fullname',_0xc2fd('0x6d'),_0xc2fd('0x6e')],'raw':!![]});}return null;})['then'](function(_0x4c7cd0){if(!_0x4c7cd0)return null;_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x6c')]=_0x4c7cd0;return _0x4421f0;})[_0xc2fd('0x20')](function(_0x10ad74){if(_0x10ad74){if(_0x33c453[_0xc2fd('0x54')][_0xc2fd('0x6f')]){_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x70')]=util[_0xc2fd('0x60')](_0xc2fd('0x71'),_0x33c453[_0xc2fd('0x5b')][_0xc2fd('0x36')]);_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x72')]=_0x4421f0[_0xc2fd('0x72')];_0x4421f0[_0xc2fd('0x28')][_0xc2fd('0x73')]=_0x4421f0['channel'];_0x4421f0['message'][_0xc2fd('0x74')]=_0xc2fd('0x57');return respondWithRpcPromise('EventManager',_0xc2fd('0x75'),{'event':_0xc2fd('0x76'),'message':_[_0xc2fd('0x50')](_0x4421f0['message'],JSON[_0xc2fd('0x77')](_0x4421f0[_0xc2fd('0x61')]['formData']))},client9002)[_0xc2fd('0x20')](function(){return _0x4421f0;});}return _0x4421f0;}return null;})[_0xc2fd('0x20')](respondWithResult(_0x3f2961,null))[_0xc2fd('0x29')](handleError(_0x3f2961,null));};var interaction_log=require(_0xc2fd('0x13'))(_0xc2fd('0x56'));exports[_0xc2fd('0x32')]=function(_0x2bec22,_0x102aa9,_0x5ddf7f){var _0x167b33={'agent':{},'channel':'chat'};if(_0x2bec22['body']['id']){delete _0x2bec22[_0xc2fd('0x54')]['id'];}_0x2bec22[_0xc2fd('0x54')]['UserId']=_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')]||_0x2bec22[_0xc2fd('0x5b')]['id'];_0x167b33[_0xc2fd('0x6c')]['id']=_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')];return db[_0xc2fd('0x4b')]['find']({'where':{'id':_0x2bec22[_0xc2fd('0x4f')]['id'],'UserId':null}})[_0xc2fd('0x20')](handleEntityNotFound(_0x102aa9,null))[_0xc2fd('0x20')](function(_0x4da110){if(_0x4da110){_0x167b33['message']=_0x4da110[_0xc2fd('0x5c')]({'plain':!![]});return db['ChatInteraction'][_0xc2fd('0x52')]({'where':{'id':_0x4da110[_0xc2fd('0x5d')]}});}return null;})[_0xc2fd('0x20')](handleEntityNotFound(_0x102aa9,null))[_0xc2fd('0x20')](function(_0x34beb2){if(_0x34beb2){_0x167b33[_0xc2fd('0x61')]=_0x34beb2[_0xc2fd('0x5c')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bec22[_0xc2fd('0x5b')]['id'],_0x2bec22[_0xc2fd('0x5b')]['name'],_0x2bec22[_0xc2fd('0x5b')][_0xc2fd('0x63')],_0x167b33[_0xc2fd('0x61')]['id'],_0x2bec22[_0xc2fd('0x54')]?JSON[_0xc2fd('0x25')](_0x2bec22[_0xc2fd('0x54')]):_0xc2fd('0x78'));return respondWithRpcPromise(_0xc2fd('0x79'),_0xc2fd('0x7a'),_0x167b33);}return null;})[_0xc2fd('0x20')](function(_0x4bbe0a){var _0x3a6824=_0xc2fd('0x66')+_0x4bbe0a['message'][_0xc2fd('0x67')];return db[_0xc2fd('0x68')][_0xc2fd('0x3f')](_0x3a6824,{'type':db[_0xc2fd('0x7b')]['QueryTypes'][_0xc2fd('0x6a')],'raw':!![]})[_0xc2fd('0x20')](function(_0x1d3242){return _0x1d3242;});})[_0xc2fd('0x20')](function(_0xf9c38d){if(_0xf9c38d){_0x167b33[_0xc2fd('0x28')][_0xc2fd('0x6b')]=_0xf9c38d[0x0];if(!_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')])return;return db['User'][_0xc2fd('0x52')]({'where':{'id':_0x2bec22[_0xc2fd('0x54')][_0xc2fd('0x5a')],'role':_0xc2fd('0x6c')},'attributes':['id',_0xc2fd('0x36'),'fullname',_0xc2fd('0x6d'),_0xc2fd('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2f333f){if(!_0x2f333f)return null;_0x167b33['message'][_0xc2fd('0x6c')]=_0x2f333f;return _0x167b33;})[_0xc2fd('0x20')](function(_0x4de1a2){if(_0x4de1a2){_0x4de1a2['message'][_0xc2fd('0x70')]=util[_0xc2fd('0x60')](_0xc2fd('0x71'),_0x2bec22['user'][_0xc2fd('0x36')]);_0x4de1a2['message'][_0xc2fd('0x72')]=_0x167b33['channel'];_0x4de1a2[_0xc2fd('0x28')][_0xc2fd('0x73')]=_0x167b33['channel'];_0x4de1a2[_0xc2fd('0x28')][_0xc2fd('0x74')]='reject';respondWithRpcPromise(_0xc2fd('0x75'),'EventManager',{'event':_0xc2fd('0x7c'),'message':_['merge'](_0x167b33[_0xc2fd('0x28')],JSON[_0xc2fd('0x77')](_0x167b33[_0xc2fd('0x61')][_0xc2fd('0x7d')]))},client9002);return _0x167b33;}return null;})['then'](respondWithResult(_0x102aa9,null))[_0xc2fd('0x29')](handleError(_0x102aa9,null));}; \ No newline at end of file +var _0xdd1b=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./chatMessage.socket','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','name','index','ChatMessage','rawAttributes','type','key','model','query','keys','attributes','intersection','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','findAll','rows','show','includeAll','include','find','create','body','params','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','internal','SIP/%s','motionChannel','EventManager','acceptmessage','chat-interactions','chat','null','RejectMessage','rejectMessage','ContactId','interface','channel','rejectmessage','parse','formData','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x38b0bd,_0x2484e1){var _0x4664fa=function(_0x4614ec){while(--_0x4614ec){_0x38b0bd['push'](_0x38b0bd['shift']());}};_0x4664fa(++_0x2484e1);}(_0xdd1b,0x78));var _0xbdd1=function(_0x41b63f,_0x282fa1){_0x41b63f=_0x41b63f-0x0;var _0x35a1aa=_0xdd1b[_0x41b63f];return _0x35a1aa;};'use strict';var emlformat=require(_0xbdd1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbdd1('0x1'));var jsonpatch=require(_0xbdd1('0x2'));var rp=require(_0xbdd1('0x3'));var moment=require(_0xbdd1('0x4'));var BPromise=require(_0xbdd1('0x5'));var Mustache=require(_0xbdd1('0x6'));var util=require(_0xbdd1('0x7'));var path=require(_0xbdd1('0x8'));var sox=require(_0xbdd1('0x9'));var csv=require(_0xbdd1('0xa'));var ejs=require(_0xbdd1('0xb'));var fs=require('fs');var fs_extra=require(_0xbdd1('0xc'));var _=require(_0xbdd1('0xd'));var squel=require(_0xbdd1('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbdd1('0xf'));var toCsv=require(_0xbdd1('0xa'));var querystring=require(_0xbdd1('0x10'));var Papa=require(_0xbdd1('0x11'));var Redis=require('ioredis');var authService=require(_0xbdd1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbdd1('0x13'));var hardwareService=require(_0xbdd1('0x14'));var logger=require(_0xbdd1('0x15'))(_0xbdd1('0x16'));var utils=require(_0xbdd1('0x17'));var config=require(_0xbdd1('0x18'));var licenseUtil=require(_0xbdd1('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbdd1('0x1a')](config[_0xbdd1('0x1b')],{'host':_0xbdd1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdd1('0x1b')]));require(_0xbdd1('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xbdd1('0x1e')][_0xbdd1('0x1f')]({'port':0x232c});var client9002=jayson[_0xbdd1('0x1e')][_0xbdd1('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5ca526,_0x421ce2,_0x28d672,_0x349487){return new BPromise(function(_0x7183e,_0x5ed11a){var _0x48c02c=_0x349487||client;return _0x48c02c['request'](_0x5ca526,_0x28d672)[_0xbdd1('0x20')](function(_0x4449d3){logger[_0xbdd1('0x21')](_0xbdd1('0x22'),_0x421ce2,_0xbdd1('0x23'));logger[_0xbdd1('0x24')](_0xbdd1('0x25'),_0x421ce2,'request\x20sent',JSON[_0xbdd1('0x26')](_0x4449d3));if(_0x4449d3['error']){if(_0x4449d3[_0xbdd1('0x27')][_0xbdd1('0x28')]===0x1f4){logger[_0xbdd1('0x27')]('ChatMessage,\x20%s,\x20%s',_0x421ce2,_0x4449d3['error'][_0xbdd1('0x29')]);return _0x5ed11a(_0x4449d3[_0xbdd1('0x27')][_0xbdd1('0x29')]);}logger[_0xbdd1('0x27')](_0xbdd1('0x22'),_0x421ce2,_0x4449d3[_0xbdd1('0x27')]['message']);return _0x7183e(_0x4449d3[_0xbdd1('0x27')][_0xbdd1('0x29')]);}else{logger['info'](_0xbdd1('0x22'),_0x421ce2,_0xbdd1('0x23'));_0x7183e(_0x4449d3[_0xbdd1('0x2a')][_0xbdd1('0x29')]);}})[_0xbdd1('0x2b')](function(_0x53ee69){logger[_0xbdd1('0x27')](_0xbdd1('0x22'),_0x421ce2,_0x53ee69);_0x5ed11a(_0x53ee69);});});}function respondWithStatusCode(_0x150eee,_0x31bc5d){_0x31bc5d=_0x31bc5d||0xcc;return function(_0x33f9c4){if(_0x33f9c4){return _0x150eee[_0xbdd1('0x2c')](_0x31bc5d);}return _0x150eee[_0xbdd1('0x2d')](_0x31bc5d)[_0xbdd1('0x2e')]();};}function respondWithResult(_0x58d566,_0x2e64d2){_0x2e64d2=_0x2e64d2||0xc8;return function(_0x3e0a4f){if(_0x3e0a4f){return _0x58d566[_0xbdd1('0x2d')](_0x2e64d2)['json'](_0x3e0a4f);}};}function respondWithFilteredResult(_0x3b3bed,_0x13e5d4){return function(_0x573040){if(_0x573040){var _0x28c683=typeof _0x13e5d4[_0xbdd1('0x2f')]===_0xbdd1('0x30')&&typeof _0x13e5d4[_0xbdd1('0x31')]==='undefined';var _0x130de7=_0x573040[_0xbdd1('0x32')];var _0x1077b5=_0x28c683?0x0:_0x13e5d4[_0xbdd1('0x2f')];var _0x3ae95a=_0x28c683?_0x573040['count']:_0x13e5d4[_0xbdd1('0x2f')]+_0x13e5d4['limit'];var _0x514d78;if(_0x3ae95a>=_0x130de7){_0x3ae95a=_0x130de7;_0x514d78=0xc8;}else{_0x514d78=0xce;}_0x3b3bed[_0xbdd1('0x2d')](_0x514d78);return _0x3b3bed[_0xbdd1('0x33')]('Content-Range',_0x1077b5+'-'+_0x3ae95a+'/'+_0x130de7)[_0xbdd1('0x34')](_0x573040);}return null;};}function patchUpdates(_0x2bb175){return function(_0x43100b){try{jsonpatch[_0xbdd1('0x35')](_0x43100b,_0x2bb175,!![]);}catch(_0x266b88){return BPromise[_0xbdd1('0x36')](_0x266b88);}return _0x43100b[_0xbdd1('0x37')]();};}function saveUpdates(_0x51f244,_0xc4677e){return function(_0x1c8ae6){if(_0x1c8ae6){return _0x1c8ae6[_0xbdd1('0x38')](_0x51f244)[_0xbdd1('0x20')](function(_0x4999e0){return _0x4999e0;});}return null;};}function removeEntity(_0x164bf2,_0x466370){return function(_0x18172c){if(_0x18172c){return _0x18172c[_0xbdd1('0x39')]()['then'](function(){_0x164bf2[_0xbdd1('0x2d')](0xcc)[_0xbdd1('0x2e')]();});}};}function handleEntityNotFound(_0x478992,_0x48b59a){return function(_0x2e78c3){if(!_0x2e78c3){_0x478992[_0xbdd1('0x2c')](0x194);}return _0x2e78c3;};}function handleError(_0x83e20e,_0x219058){_0x219058=_0x219058||0x1f4;return function(_0x54fcd9){logger['error'](_0x54fcd9[_0xbdd1('0x3a')]);if(_0x54fcd9['name']){delete _0x54fcd9[_0xbdd1('0x3b')];}_0x83e20e[_0xbdd1('0x2d')](_0x219058)['send'](_0x54fcd9);};}exports[_0xbdd1('0x3c')]=function(_0x500d54,_0x359bfa){var _0x447c4b={},_0x3046ca={},_0x2c24df={'count':0x0,'rows':[]};var _0x5d1a23=_['map'](db[_0xbdd1('0x3d')][_0xbdd1('0x3e')],function(_0x399a4a){return{'name':_0x399a4a['fieldName'],'type':_0x399a4a[_0xbdd1('0x3f')][_0xbdd1('0x40')]};});_0x3046ca[_0xbdd1('0x41')]=_['map'](_0x5d1a23,_0xbdd1('0x3b'));_0x3046ca[_0xbdd1('0x42')]=_[_0xbdd1('0x43')](_0x500d54[_0xbdd1('0x42')]);_0x3046ca['filters']=_['intersection'](_0x3046ca[_0xbdd1('0x41')],_0x3046ca[_0xbdd1('0x42')]);_0x447c4b[_0xbdd1('0x44')]=_[_0xbdd1('0x45')](_0x3046ca['model'],qs['fields'](_0x500d54[_0xbdd1('0x42')]['fields']));_0x447c4b[_0xbdd1('0x44')]=_0x447c4b[_0xbdd1('0x44')][_0xbdd1('0x46')]?_0x447c4b[_0xbdd1('0x44')]:_0x3046ca[_0xbdd1('0x41')];if(!_0x500d54['query'][_0xbdd1('0x47')]('nolimit')){_0x447c4b[_0xbdd1('0x31')]=qs[_0xbdd1('0x31')](_0x500d54[_0xbdd1('0x42')]['limit']);_0x447c4b[_0xbdd1('0x2f')]=qs[_0xbdd1('0x2f')](_0x500d54['query'][_0xbdd1('0x2f')]);}_0x447c4b[_0xbdd1('0x48')]=qs[_0xbdd1('0x49')](_0x500d54[_0xbdd1('0x42')][_0xbdd1('0x49')]);_0x447c4b[_0xbdd1('0x4a')]=qs[_0xbdd1('0x4b')](_[_0xbdd1('0x4c')](_0x500d54[_0xbdd1('0x42')],_0x3046ca[_0xbdd1('0x4b')]),_0x5d1a23);if(_0x500d54[_0xbdd1('0x42')]['filter']){_0x447c4b['where']=_[_0xbdd1('0x4d')](_0x447c4b[_0xbdd1('0x4a')],{'$or':_['map'](_0x5d1a23,function(_0x785909){if(_0x785909[_0xbdd1('0x3f')]!==_0xbdd1('0x4e')){var _0x467365={};_0x467365[_0x785909[_0xbdd1('0x3b')]]={'$like':'%'+_0x500d54['query'][_0xbdd1('0x4f')]+'%'};return _0x467365;}})});}_0x447c4b=_['merge']({},_0x447c4b,_0x500d54['options']);var _0x43bc99={'where':_0x447c4b[_0xbdd1('0x4a')]};return db[_0xbdd1('0x3d')][_0xbdd1('0x32')](_0x43bc99)[_0xbdd1('0x20')](function(_0x3ca9bf){_0x2c24df[_0xbdd1('0x32')]=_0x3ca9bf;if(_0x500d54['query']['includeAll']){_0x447c4b['include']=[{'all':!![]}];}return db[_0xbdd1('0x3d')][_0xbdd1('0x50')](_0x447c4b);})[_0xbdd1('0x20')](function(_0x518ea3){_0x2c24df[_0xbdd1('0x51')]=_0x518ea3;return _0x2c24df;})['then'](respondWithFilteredResult(_0x359bfa,_0x447c4b))['catch'](handleError(_0x359bfa,null));};exports[_0xbdd1('0x52')]=function(_0x46e707,_0x2f3fcf){var _0x46ae66={'raw':!![],'where':{'id':_0x46e707['params']['id']}},_0xc24747={};_0xc24747[_0xbdd1('0x41')]=_[_0xbdd1('0x43')](db['ChatMessage'][_0xbdd1('0x3e')]);_0xc24747[_0xbdd1('0x42')]=_['keys'](_0x46e707[_0xbdd1('0x42')]);_0xc24747['filters']=_['intersection'](_0xc24747[_0xbdd1('0x41')],_0xc24747[_0xbdd1('0x42')]);_0x46ae66[_0xbdd1('0x44')]=_[_0xbdd1('0x45')](_0xc24747[_0xbdd1('0x41')],qs['fields'](_0x46e707[_0xbdd1('0x42')]['fields']));_0x46ae66[_0xbdd1('0x44')]=_0x46ae66[_0xbdd1('0x44')]['length']?_0x46ae66['attributes']:_0xc24747[_0xbdd1('0x41')];if(_0x46e707[_0xbdd1('0x42')][_0xbdd1('0x53')]){_0x46ae66[_0xbdd1('0x54')]=[{'all':!![]}];}_0x46ae66=_[_0xbdd1('0x4d')]({},_0x46ae66,_0x46e707['options']);return db[_0xbdd1('0x3d')][_0xbdd1('0x55')](_0x46ae66)['then'](handleEntityNotFound(_0x2f3fcf,null))['then'](respondWithResult(_0x2f3fcf,null))[_0xbdd1('0x2b')](handleError(_0x2f3fcf,null));};exports['create']=function(_0x52bfa7,_0x3bc954){return db[_0xbdd1('0x3d')][_0xbdd1('0x56')](_0x52bfa7[_0xbdd1('0x57')],{})['then'](respondWithResult(_0x3bc954,0xc9))[_0xbdd1('0x2b')](handleError(_0x3bc954,null));};exports[_0xbdd1('0x38')]=function(_0x34ebcb,_0x3abab4){if(_0x34ebcb[_0xbdd1('0x57')]['id']){delete _0x34ebcb[_0xbdd1('0x57')]['id'];}return db[_0xbdd1('0x3d')][_0xbdd1('0x55')]({'where':{'id':_0x34ebcb[_0xbdd1('0x58')]['id']}})[_0xbdd1('0x20')](handleEntityNotFound(_0x3abab4,null))['then'](saveUpdates(_0x34ebcb['body'],null))[_0xbdd1('0x20')](respondWithResult(_0x3abab4,null))[_0xbdd1('0x2b')](handleError(_0x3abab4,null));};exports[_0xbdd1('0x39')]=function(_0x1fa149,_0xa92533){return db['ChatMessage'][_0xbdd1('0x55')]({'where':{'id':_0x1fa149[_0xbdd1('0x58')]['id']}})[_0xbdd1('0x20')](handleEntityNotFound(_0xa92533,null))[_0xbdd1('0x20')](removeEntity(_0xa92533,null))[_0xbdd1('0x2b')](handleError(_0xa92533,null));};exports[_0xbdd1('0x59')]=function(_0x1ff680,_0xd13792){return db[_0xbdd1('0x3d')][_0xbdd1('0x59')]()[_0xbdd1('0x20')](respondWithResult(_0xd13792,null))['catch'](handleError(_0xd13792,null));};var interaction_log=require(_0xbdd1('0x15'))('chat-interactions');exports[_0xbdd1('0x5a')]=function(_0x35f798,_0x1fec55,_0x351350){var _0x3fbe35={'agent':{},'channel':'chat'};if(_0x35f798[_0xbdd1('0x57')]['id']){delete _0x35f798[_0xbdd1('0x57')]['id'];}_0x35f798[_0xbdd1('0x57')]['read']=!![];_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5b')]=moment()[_0xbdd1('0x5c')](_0xbdd1('0x5d'));_0x35f798[_0xbdd1('0x57')]['UserId']=_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5e')]||_0x35f798['user']['id'];_0x3fbe35[_0xbdd1('0x5f')]['id']=_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5e')];return db[_0xbdd1('0x3d')][_0xbdd1('0x55')]({'where':{'id':_0x35f798[_0xbdd1('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1fec55,null))[_0xbdd1('0x20')](saveUpdates(_0x35f798[_0xbdd1('0x57')],null))[_0xbdd1('0x20')](function(_0x5a49ba){if(_0x5a49ba){_0x3fbe35[_0xbdd1('0x29')]=_0x5a49ba['get']({'plain':!![]});return db[_0xbdd1('0x60')][_0xbdd1('0x55')]({'where':{'id':_0x5a49ba[_0xbdd1('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x1fec55,null))[_0xbdd1('0x20')](function(_0x36b67a){if(_0x36b67a){return _0x36b67a['update']({'UserId':_0x35f798['body'][_0xbdd1('0x5e')],'read1stAt':_[_0xbdd1('0x62')](_0x36b67a[_0xbdd1('0x63')])?moment()[_0xbdd1('0x5c')](_0xbdd1('0x5d')):undefined});}return null;})[_0xbdd1('0x20')](function(_0x412d79){if(_0x412d79){_0x3fbe35[_0xbdd1('0x64')]=_0x412d79[_0xbdd1('0x65')]({'plain':!![]});interaction_log[_0xbdd1('0x21')](_0xbdd1('0x66'),_0x35f798[_0xbdd1('0x67')]['id'],_0x35f798[_0xbdd1('0x67')][_0xbdd1('0x3b')],_0x35f798[_0xbdd1('0x67')][_0xbdd1('0x68')],_0x3fbe35['interaction']['id'],_0x35f798[_0xbdd1('0x57')]?JSON[_0xbdd1('0x26')](_0x35f798[_0xbdd1('0x57')]):'null');return respondWithRpcPromise(_0xbdd1('0x69'),'acceptMessage',_0x3fbe35);}return null;})[_0xbdd1('0x20')](function(_0x9b6bf2){var _0xd81313='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9b6bf2[_0xbdd1('0x29')]['ContactId'];return db[_0xbdd1('0x6a')]['query'](_0xd81313,{'type':db[_0xbdd1('0x6b')]['QueryTypes'][_0xbdd1('0x6c')],'raw':!![]})[_0xbdd1('0x20')](function(_0x471790){return _0x471790;});})[_0xbdd1('0x20')](function(_0x401550){if(_0x401550){_0x3fbe35[_0xbdd1('0x29')][_0xbdd1('0x6d')]=_0x401550[0x0];if(!_0x35f798[_0xbdd1('0x57')][_0xbdd1('0x5e')])return;return db[_0xbdd1('0x6e')][_0xbdd1('0x55')]({'where':{'id':_0x35f798['body']['UserId'],'role':_0xbdd1('0x5f')},'attributes':['id',_0xbdd1('0x3b'),_0xbdd1('0x6f'),'email',_0xbdd1('0x70')],'raw':!![]});}return null;})['then'](function(_0x25febf){if(!_0x25febf)return null;_0x3fbe35[_0xbdd1('0x29')][_0xbdd1('0x5f')]=_0x25febf;return _0x3fbe35;})[_0xbdd1('0x20')](function(_0x1bcc6f){if(_0x1bcc6f){if(_0x35f798[_0xbdd1('0x57')]['manual']){_0x3fbe35[_0xbdd1('0x29')]['interface']=util[_0xbdd1('0x5c')](_0xbdd1('0x71'),_0x35f798[_0xbdd1('0x67')]['name']);_0x3fbe35[_0xbdd1('0x29')]['channel']=_0x3fbe35['channel'];_0x3fbe35[_0xbdd1('0x29')][_0xbdd1('0x72')]=_0x3fbe35['channel'];_0x3fbe35[_0xbdd1('0x29')]['event']='accept';return respondWithRpcPromise(_0xbdd1('0x73'),_0xbdd1('0x73'),{'event':_0xbdd1('0x74'),'message':_[_0xbdd1('0x4d')](_0x3fbe35[_0xbdd1('0x29')],JSON['parse'](_0x3fbe35[_0xbdd1('0x64')]['formData']))},client9002)[_0xbdd1('0x20')](function(){return _0x3fbe35;});}return _0x3fbe35;}return null;})[_0xbdd1('0x20')](respondWithResult(_0x1fec55,null))[_0xbdd1('0x2b')](handleError(_0x1fec55,null));};var interaction_log=require(_0xbdd1('0x15'))(_0xbdd1('0x75'));exports['reject']=function(_0xd69b28,_0x1698c4,_0x1cedcb){var _0x1b5b1e={'agent':{},'channel':_0xbdd1('0x76')};if(_0xd69b28[_0xbdd1('0x57')]['id']){delete _0xd69b28[_0xbdd1('0x57')]['id'];}_0xd69b28[_0xbdd1('0x57')][_0xbdd1('0x5e')]=_0xd69b28[_0xbdd1('0x57')][_0xbdd1('0x5e')]||_0xd69b28[_0xbdd1('0x67')]['id'];_0x1b5b1e['agent']['id']=_0xd69b28['body'][_0xbdd1('0x5e')];return db[_0xbdd1('0x3d')]['find']({'where':{'id':_0xd69b28[_0xbdd1('0x58')]['id'],'UserId':null}})[_0xbdd1('0x20')](handleEntityNotFound(_0x1698c4,null))[_0xbdd1('0x20')](function(_0x506401){if(_0x506401){_0x1b5b1e['message']=_0x506401[_0xbdd1('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xbdd1('0x55')]({'where':{'id':_0x506401[_0xbdd1('0x61')]}});}return null;})[_0xbdd1('0x20')](handleEntityNotFound(_0x1698c4,null))[_0xbdd1('0x20')](function(_0x524269){if(_0x524269){_0x1b5b1e[_0xbdd1('0x64')]=_0x524269[_0xbdd1('0x65')]({'plain':!![]});interaction_log[_0xbdd1('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xd69b28[_0xbdd1('0x67')]['id'],_0xd69b28[_0xbdd1('0x67')]['name'],_0xd69b28[_0xbdd1('0x67')]['role'],_0x1b5b1e[_0xbdd1('0x64')]['id'],_0xd69b28[_0xbdd1('0x57')]?JSON[_0xbdd1('0x26')](_0xd69b28[_0xbdd1('0x57')]):_0xbdd1('0x77'));return respondWithRpcPromise(_0xbdd1('0x78'),_0xbdd1('0x79'),_0x1b5b1e);}return null;})['then'](function(_0x29b83c){var _0x324fa1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x29b83c[_0xbdd1('0x29')][_0xbdd1('0x7a')];return db[_0xbdd1('0x6a')][_0xbdd1('0x42')](_0x324fa1,{'type':db[_0xbdd1('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbdd1('0x20')](function(_0x246931){return _0x246931;});})[_0xbdd1('0x20')](function(_0x449912){if(_0x449912){_0x1b5b1e['message'][_0xbdd1('0x6d')]=_0x449912[0x0];if(!_0xd69b28[_0xbdd1('0x57')][_0xbdd1('0x5e')])return;return db[_0xbdd1('0x6e')][_0xbdd1('0x55')]({'where':{'id':_0xd69b28['body'][_0xbdd1('0x5e')],'role':_0xbdd1('0x5f')},'attributes':['id','name','fullname','email',_0xbdd1('0x70')],'raw':!![]});}return null;})['then'](function(_0x76bb20){if(!_0x76bb20)return null;_0x1b5b1e[_0xbdd1('0x29')][_0xbdd1('0x5f')]=_0x76bb20;return _0x1b5b1e;})[_0xbdd1('0x20')](function(_0x22ec8b){if(_0x22ec8b){_0x22ec8b[_0xbdd1('0x29')][_0xbdd1('0x7b')]=util[_0xbdd1('0x5c')](_0xbdd1('0x71'),_0xd69b28[_0xbdd1('0x67')]['name']);_0x22ec8b[_0xbdd1('0x29')][_0xbdd1('0x7c')]=_0x1b5b1e[_0xbdd1('0x7c')];_0x22ec8b[_0xbdd1('0x29')][_0xbdd1('0x72')]=_0x1b5b1e[_0xbdd1('0x7c')];_0x22ec8b[_0xbdd1('0x29')]['event']=_0xbdd1('0x36');respondWithRpcPromise(_0xbdd1('0x73'),_0xbdd1('0x73'),{'event':_0xbdd1('0x7d'),'message':_[_0xbdd1('0x4d')](_0x1b5b1e[_0xbdd1('0x29')],JSON[_0xbdd1('0x7e')](_0x1b5b1e[_0xbdd1('0x64')][_0xbdd1('0x7f')]))},client9002);return _0x1b5b1e;}return null;})[_0xbdd1('0x20')](respondWithResult(_0x1698c4,null))[_0xbdd1('0x2b')](handleError(_0x1698c4,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 06f0d5b..a30b7de 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 _0x0d3f=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x28a523,_0x3120e6){var _0x441f51=function(_0x237850){while(--_0x237850){_0x28a523['push'](_0x28a523['shift']());}};_0x441f51(++_0x3120e6);}(_0x0d3f,0xd6));var _0xf0d3=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0x0d3f[_0x879e31];return _0x3467e8;};'use strict';var EventEmitter=require(_0xf0d3('0x0'));var ChatMessage=require(_0xf0d3('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf0d3('0x2')](0x0);var events={'afterCreate':_0xf0d3('0x3'),'afterUpdate':_0xf0d3('0x4'),'afterDestroy':_0xf0d3('0x5')};function emitEvent(_0x171038){return function(_0x2e1755,_0x2c7d24,_0x343ffc){ChatMessageEvents['emit'](_0x171038+':'+_0x2e1755['id'],_0x2e1755);ChatMessageEvents[_0xf0d3('0x6')](_0x171038,_0x2e1755);_0x343ffc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xf0d3('0x7')](e,emitEvent(event));}}module[_0xf0d3('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xc28c=['../../mysqldb','save','update','remove','emit','exports','events'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc28c,0xc3));var _0xcc28=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xc28c[_0x1793de];return _0x4f0309;};'use strict';var EventEmitter=require(_0xcc28('0x0'));var ChatMessage=require(_0xcc28('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcc28('0x2'),'afterUpdate':_0xcc28('0x3'),'afterDestroy':_0xcc28('0x4')};function emitEvent(_0x3878bb){return function(_0x45da06,_0x2cc143,_0x230a8b){ChatMessageEvents[_0xcc28('0x5')](_0x3878bb+':'+_0x45da06['id'],_0x45da06);ChatMessageEvents['emit'](_0x3878bb,_0x45da06);_0x230a8b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xcc28('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 20cdc03..fa17faf 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 _0xc5ad=['toLowerCase','out','secret','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xc5ad,0xea));var _0xdc5a=function(_0x517169,_0x46af16){_0x517169=_0x517169-0x0;var _0x249bbd=_0xc5ad[_0x517169];return _0x249bbd;};'use strict';var _=require(_0xdc5a('0x0'));var util=require(_0xdc5a('0x1'));var logger=require(_0xdc5a('0x2'))(_0xdc5a('0x3'));var moment=require(_0xdc5a('0x4'));var BPromise=require(_0xdc5a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc5a('0x6'));var rimraf=require(_0xdc5a('0x7'));var config=require(_0xdc5a('0x8'));var attributes=require(_0xdc5a('0x9'));module[_0xdc5a('0xa')]=function(_0x51544e,_0x5a71f1){return _0x51544e[_0xdc5a('0xb')]('ChatMessage',attributes,{'tableName':_0xdc5a('0xc'),'paranoid':![],'indexes':[{'name':_0xdc5a('0xd'),'fields':['body'],'type':_0xdc5a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x188e6e,_0x4981a3,_0x339a96){var _0x485763=_0x51544e[_0xdc5a('0xf')];var _0x50583e=_0x188e6e[_0xdc5a('0x10')]({'plain':!![]});if(_0x50583e[_0xdc5a('0x11')]['toLowerCase']()==='in'||_0x50583e['direction'][_0xdc5a('0x12')]()===_0xdc5a('0x13')&&!_0x50583e[_0xdc5a('0x14')]&&!_['isNil'](_0x50583e['UserId'])){_0x485763['ChatInteraction'][_0xdc5a('0x15')]({'where':{'id':_0x50583e['ChatInteractionId']}})[_0xdc5a('0x16')](function(_0x4b3460){if(_0x4b3460){_0x4b3460[_0xdc5a('0x17')]({'lastMsgAt':_0x50583e[_0xdc5a('0x18')],'lastMsgDirection':_0x50583e[_0xdc5a('0x11')][_0xdc5a('0x12')]()});}})[_0xdc5a('0x19')](function(_0x41aba7){console['error'](_0x41aba7);});}_0x339a96();}},'charset':_0xdc5a('0x1a'),'collate':_0xdc5a('0x1b')});}; \ No newline at end of file +var _0xc090=['ChatInteraction','findOne','ChatInteractionId','then','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil'];(function(_0x5e1fb6,_0xf3495b){var _0x2cf20e=function(_0x4e51b4){while(--_0x4e51b4){_0x5e1fb6['push'](_0x5e1fb6['shift']());}};_0x2cf20e(++_0xf3495b);}(_0xc090,0x10c));var _0x0c09=function(_0x265e55,_0x4a337f){_0x265e55=_0x265e55-0x0;var _0x582e80=_0xc090[_0x265e55];return _0x582e80;};'use strict';var _=require(_0x0c09('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c09('0x1'));var moment=require(_0x0c09('0x2'));var BPromise=require(_0x0c09('0x3'));var rp=require(_0x0c09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c09('0x5'));var config=require('../../config/environment');var attributes=require(_0x0c09('0x6'));module['exports']=function(_0x399fb1,_0x4ed79f){return _0x399fb1[_0x0c09('0x7')](_0x0c09('0x8'),attributes,{'tableName':_0x0c09('0x9'),'paranoid':![],'indexes':[{'name':_0x0c09('0xa'),'fields':['body'],'type':_0x0c09('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x414e61,_0x2da373,_0x229de3){var _0x1a9777=_0x399fb1[_0x0c09('0xc')];var _0xcccdc9=_0x414e61['get']({'plain':!![]});if(_0xcccdc9[_0x0c09('0xd')][_0x0c09('0xe')]()==='in'||_0xcccdc9[_0x0c09('0xd')][_0x0c09('0xe')]()===_0x0c09('0xf')&&!_0xcccdc9[_0x0c09('0x10')]&&!_[_0x0c09('0x11')](_0xcccdc9['UserId'])){_0x1a9777[_0x0c09('0x12')][_0x0c09('0x13')]({'where':{'id':_0xcccdc9[_0x0c09('0x14')]}})[_0x0c09('0x15')](function(_0xd14505){if(_0xd14505){_0xd14505['update']({'lastMsgAt':_0xcccdc9['createdAt'],'lastMsgDirection':_0xcccdc9[_0x0c09('0xd')][_0x0c09('0xe')]()});}})[_0x0c09('0x16')](function(_0x35992d){console[_0x0c09('0x17')](_0x35992d);});}_0x229de3();}},'charset':_0x0c09('0x18'),'collate':_0x0c09('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index cbb5b80..270cba2 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 _0xa1d3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','bluebird'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xa1d3,0x147));var _0x3a1d=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0xa1d3[_0xb47dc0];return _0x57f0b0;};'use strict';var _=require(_0x3a1d('0x0'));var util=require(_0x3a1d('0x1'));var moment=require('moment');var BPromise=require(_0x3a1d('0x2'));var rs=require(_0x3a1d('0x3'));var fs=require('fs');var Redis=require(_0x3a1d('0x4'));var db=require(_0x3a1d('0x5'))['db'];var utils=require(_0x3a1d('0x6'));var logger=require(_0x3a1d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a1d('0x8'));var client=jayson[_0x3a1d('0x9')]['http']({'port':0x232a});config['redis']=_[_0x3a1d('0xa')](config[_0x3a1d('0xb')],{'host':_0x3a1d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3a1d('0xd'))[_0x3a1d('0xe')](socket);function respondWithRpcPromise(_0x16f419,_0x13077a,_0x3bf4d0){return new BPromise(function(_0x34bf96,_0x1b7dd3){return client[_0x3a1d('0xf')](_0x16f419,_0x3bf4d0)[_0x3a1d('0x10')](function(_0x38c318){logger[_0x3a1d('0x11')](_0x3a1d('0x12'),_0x13077a,_0x3a1d('0x13'));logger[_0x3a1d('0x14')](_0x3a1d('0x15'),_0x13077a,'request\x20sent',JSON[_0x3a1d('0x16')](_0x38c318));if(_0x38c318[_0x3a1d('0x17')]){if(_0x38c318[_0x3a1d('0x17')]['code']===0x1f4){logger[_0x3a1d('0x17')]('ChatMessage,\x20%s,\x20%s',_0x13077a,_0x38c318[_0x3a1d('0x17')][_0x3a1d('0x18')]);return _0x1b7dd3(_0x38c318[_0x3a1d('0x17')][_0x3a1d('0x18')]);}logger[_0x3a1d('0x17')](_0x3a1d('0x12'),_0x13077a,_0x38c318[_0x3a1d('0x17')][_0x3a1d('0x18')]);return _0x34bf96(_0x38c318[_0x3a1d('0x17')]['message']);}else{logger[_0x3a1d('0x11')](_0x3a1d('0x12'),_0x13077a,_0x3a1d('0x13'));_0x34bf96(_0x38c318[_0x3a1d('0x19')]['message']);}})[_0x3a1d('0x1a')](function(_0x2736a1){logger['error']('ChatMessage,\x20%s,\x20%s',_0x13077a,_0x2736a1);_0x1b7dd3(_0x2736a1);});});}exports['CreateChatMessage']=function(_0x3890aa){var _0x1af29d=this;return new Promise(function(_0x5723c9,_0x2af1d9){return db[_0x3a1d('0x1b')][_0x3a1d('0x1c')](_0x3890aa[_0x3a1d('0x1d')],{'raw':_0x3890aa[_0x3a1d('0x1e')]?_0x3890aa[_0x3a1d('0x1e')][_0x3a1d('0x1f')]===undefined?!![]:![]:!![]})[_0x3a1d('0x10')](function(_0x46c7d8){logger[_0x3a1d('0x11')](_0x3a1d('0x20'),_0x3890aa);logger[_0x3a1d('0x14')](_0x3a1d('0x20'),_0x3890aa,JSON[_0x3a1d('0x16')](_0x46c7d8));_0x5723c9(_0x46c7d8);})[_0x3a1d('0x1a')](function(_0x142fbf){logger[_0x3a1d('0x17')](_0x3a1d('0x20'),_0x142fbf['message'],_0x3890aa);_0x2af1d9(_0x1af29d[_0x3a1d('0x17')](0x1f4,_0x142fbf['message']));});});}; \ No newline at end of file +var _0xc222=['localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x2a7a13,_0x359530){var _0x5b77b1=function(_0x2426a3){while(--_0x2426a3){_0x2a7a13['push'](_0x2a7a13['shift']());}};_0x5b77b1(++_0x359530);}(_0xc222,0x153));var _0x2c22=function(_0xc3f40d,_0x2aafb0){_0xc3f40d=_0xc3f40d-0x0;var _0x3eac5f=_0xc222[_0xc3f40d];return _0x3eac5f;};'use strict';var _=require(_0x2c22('0x0'));var util=require(_0x2c22('0x1'));var moment=require('moment');var BPromise=require(_0x2c22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c22('0x3'));var db=require(_0x2c22('0x4'))['db'];var utils=require(_0x2c22('0x5'));var logger=require(_0x2c22('0x6'))(_0x2c22('0x7'));var config=require(_0x2c22('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2c22('0x9')][_0x2c22('0xa')]({'port':0x232a});config[_0x2c22('0xb')]=_[_0x2c22('0xc')](config[_0x2c22('0xb')],{'host':_0x2c22('0xd'),'port':0x18eb});var socket=require(_0x2c22('0xe'))(new Redis(config[_0x2c22('0xb')]));require(_0x2c22('0xf'))[_0x2c22('0x10')](socket);function respondWithRpcPromise(_0x105e7b,_0xc0dfd3,_0x4d47a2){return new BPromise(function(_0x1c669b,_0x161347){return client[_0x2c22('0x11')](_0x105e7b,_0x4d47a2)[_0x2c22('0x12')](function(_0xf67882){logger[_0x2c22('0x13')](_0x2c22('0x14'),_0xc0dfd3,_0x2c22('0x15'));logger[_0x2c22('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xc0dfd3,_0x2c22('0x15'),JSON['stringify'](_0xf67882));if(_0xf67882[_0x2c22('0x17')]){if(_0xf67882[_0x2c22('0x17')]['code']===0x1f4){logger[_0x2c22('0x17')](_0x2c22('0x14'),_0xc0dfd3,_0xf67882[_0x2c22('0x17')][_0x2c22('0x18')]);return _0x161347(_0xf67882[_0x2c22('0x17')][_0x2c22('0x18')]);}logger[_0x2c22('0x17')](_0x2c22('0x14'),_0xc0dfd3,_0xf67882[_0x2c22('0x17')][_0x2c22('0x18')]);return _0x1c669b(_0xf67882[_0x2c22('0x17')]['message']);}else{logger[_0x2c22('0x13')]('ChatMessage,\x20%s,\x20%s',_0xc0dfd3,_0x2c22('0x15'));_0x1c669b(_0xf67882[_0x2c22('0x19')][_0x2c22('0x18')]);}})['catch'](function(_0x198e7a){logger[_0x2c22('0x17')](_0x2c22('0x14'),_0xc0dfd3,_0x198e7a);_0x161347(_0x198e7a);});});}exports[_0x2c22('0x1a')]=function(_0x397f17){var _0x2ca4dd=this;return new Promise(function(_0x48847f,_0x2eedbe){return db[_0x2c22('0x1b')][_0x2c22('0x1c')](_0x397f17[_0x2c22('0x1d')],{'raw':_0x397f17[_0x2c22('0x1e')]?_0x397f17['options'][_0x2c22('0x1f')]===undefined?!![]:![]:!![]})[_0x2c22('0x12')](function(_0x4dbf43){logger['info'](_0x2c22('0x1a'),_0x397f17);logger[_0x2c22('0x16')](_0x2c22('0x1a'),_0x397f17,JSON['stringify'](_0x4dbf43));_0x48847f(_0x4dbf43);})['catch'](function(_0x361fa6){logger[_0x2c22('0x17')](_0x2c22('0x1a'),_0x361fa6[_0x2c22('0x18')],_0x397f17);_0x2eedbe(_0x2ca4dd[_0x2c22('0x17')](0x1f4,_0x361fa6[_0x2c22('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 19b49ac..a98111b 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 _0x032e=['removeListener','register','length','chatMessage:','./chatMessage.events','remove','update','emit'];(function(_0x82c1a,_0x10b911){var _0x54cd6b=function(_0x1d85e7){while(--_0x1d85e7){_0x82c1a['push'](_0x82c1a['shift']());}};_0x54cd6b(++_0x10b911);}(_0x032e,0x124));var _0xe032=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x032e[_0x5b561d];return _0x431060;};'use strict';var ChatMessageEvents=require(_0xe032('0x0'));var events=['save',_0xe032('0x1'),_0xe032('0x2')];function createListener(_0x5ca562,_0x4afba2){return function(_0x45ab5b){_0x4afba2[_0xe032('0x3')](_0x5ca562,_0x45ab5b);};}function removeListener(_0x2f44f6,_0x1983cc){return function(){ChatMessageEvents[_0xe032('0x4')](_0x2f44f6,_0x1983cc);};}exports[_0xe032('0x5')]=function(_0x2ba8a0){for(var _0x33ad0b=0x0,_0x37432f=events[_0xe032('0x6')];_0x33ad0b<_0x37432f;_0x33ad0b++){var _0x3289b0=events[_0x33ad0b];var _0xd84027=createListener(_0xe032('0x7')+_0x3289b0,_0x2ba8a0);ChatMessageEvents['on'](_0x3289b0,_0xd84027);}}; \ No newline at end of file +var _0x19da=['update','register','length','save'];(function(_0x5516e7,_0x4f2713){var _0x274af5=function(_0x127eb7){while(--_0x127eb7){_0x5516e7['push'](_0x5516e7['shift']());}};_0x274af5(++_0x4f2713);}(_0x19da,0x9f));var _0xa19d=function(_0x18f64a,_0x1c8248){_0x18f64a=_0x18f64a-0x0;var _0x44687f=_0x19da[_0x18f64a];return _0x44687f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f4613cc..30e3f83 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 _0x4ff1=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x48b1c3,_0x49ce96){var _0x1ecc49=function(_0x21e9e5){while(--_0x21e9e5){_0x48b1c3['push'](_0x48b1c3['shift']());}};_0x1ecc49(++_0x49ce96);}(_0x4ff1,0xe2));var _0x14ff=function(_0x5b3a7c,_0x275e07){_0x5b3a7c=_0x5b3a7c-0x0;var _0x2ff8cf=_0x4ff1[_0x5b3a7c];return _0x2ff8cf;};'use strict';var multer=require(_0x14ff('0x0'));var util=require(_0x14ff('0x1'));var path=require(_0x14ff('0x2'));var timeout=require(_0x14ff('0x3'));var express=require(_0x14ff('0x4'));var router=express['Router']();var fs_extra=require(_0x14ff('0x5'));var auth=require(_0x14ff('0x6'));var interaction=require(_0x14ff('0x7'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x14ff('0x8')]('/',auth[_0x14ff('0x9')](),controller['index']);router[_0x14ff('0x8')](_0x14ff('0xa'),auth[_0x14ff('0x9')](),controller[_0x14ff('0xb')]);router['get'](_0x14ff('0xc'),auth['isAuthenticated'](),controller[_0x14ff('0xd')]);router['post']('/',auth[_0x14ff('0x9')](),interaction['tracked'](_0x14ff('0xe'),'chatmessage:create'),controller[_0x14ff('0xf')]);router[_0x14ff('0x10')](_0x14ff('0xc'),controller[_0x14ff('0x11')]);router[_0x14ff('0x10')](_0x14ff('0x12'),auth['isAuthenticated'](),controller[_0x14ff('0x13')]);router[_0x14ff('0x10')](_0x14ff('0x14'),auth[_0x14ff('0x9')](),controller[_0x14ff('0x15')]);router[_0x14ff('0x16')](_0x14ff('0xc'),auth[_0x14ff('0x9')](),controller[_0x14ff('0x17')]);module[_0x14ff('0x18')]=router; \ No newline at end of file +var _0x1764=['delete','destroy','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject'];(function(_0x55380a,_0x536668){var _0x333037=function(_0x1ab290){while(--_0x1ab290){_0x55380a['push'](_0x55380a['shift']());}};_0x333037(++_0x536668);}(_0x1764,0x167));var _0x4176=function(_0x1eeb8b,_0x5f14bb){_0x1eeb8b=_0x1eeb8b-0x0;var _0x5ab7bb=_0x1764[_0x1eeb8b];return _0x5ab7bb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4176('0x0'));var express=require('express');var router=express[_0x4176('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x4176('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x4176('0x3'));var controller=require(_0x4176('0x4'));router[_0x4176('0x5')]('/',auth[_0x4176('0x6')](),controller[_0x4176('0x7')]);router[_0x4176('0x5')]('/describe',auth[_0x4176('0x6')](),controller[_0x4176('0x8')]);router['get'](_0x4176('0x9'),auth['isAuthenticated'](),controller[_0x4176('0xa')]);router['post']('/',auth[_0x4176('0x6')](),interaction[_0x4176('0xb')](_0x4176('0xc'),_0x4176('0xd')),controller[_0x4176('0xe')]);router[_0x4176('0xf')](_0x4176('0x9'),controller[_0x4176('0x10')]);router[_0x4176('0xf')](_0x4176('0x11'),auth[_0x4176('0x6')](),controller['accept']);router[_0x4176('0xf')](_0x4176('0x12'),auth[_0x4176('0x6')](),controller['reject']);router[_0x4176('0x13')](_0x4176('0x9'),auth[_0x4176('0x6')](),controller[_0x4176('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a59c8f1..a81b672 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 _0x95dd=['sequelize','exports','medium'];(function(_0x1c0d91,_0x4183d3){var _0x355d62=function(_0xfcd9a1){while(--_0xfcd9a1){_0x1c0d91['push'](_0x1c0d91['shift']());}};_0x355d62(++_0x4183d3);}(_0x95dd,0x93));var _0xd95d=function(_0x44a971,_0x4712f6){_0x44a971=_0x44a971-0x0;var _0x3768ac=_0x95dd[_0x44a971];return _0x3768ac;};'use strict';var Sequelize=require(_0xd95d('0x0'));module[_0xd95d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd95d('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x5dd7=['TEXT','medium','sequelize','exports'];(function(_0x43874c,_0x15fa25){var _0x1c7716=function(_0xea14c3){while(--_0xea14c3){_0x43874c['push'](_0x43874c['shift']());}};_0x1c7716(++_0x15fa25);}(_0x5dd7,0xbe));var _0x75dd=function(_0x3747e1,_0x2c560d){_0x3747e1=_0x3747e1-0x0;var _0x2d2520=_0x5dd7[_0x3747e1];return _0x2d2520;};'use strict';var Sequelize=require(_0x75dd('0x0'));module[_0x75dd('0x1')]={'body':{'type':Sequelize[_0x75dd('0x2')](_0x75dd('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 903c3d7..69cc380 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x96f3ed,_0x562ccf){_0x96f3ed=_0x96f3ed-0x0;var _0x23f696=_0x7a54[_0x96f3ed];return _0x23f696;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b0063,_0x17a0b5){_0x5b0063=_0x5b0063-0x0;var _0x3f3667=_0x7a54[_0x5b0063];return _0x3f3667;};'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 0446c00..7ca0388 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 _0x8974=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x53c700,_0x1409d6){var _0xf6a6f6=function(_0x3a12fc){while(--_0x3a12fc){_0x53c700['push'](_0x53c700['shift']());}};_0xf6a6f6(++_0x1409d6);}(_0x8974,0x172));var _0x4897=function(_0xb518e5,_0x5b627c){_0xb518e5=_0xb518e5-0x0;var _0x59c78e=_0x8974[_0xb518e5];return _0x59c78e;};'use strict';var _=require(_0x4897('0x0'));var util=require('util');var logger=require(_0x4897('0x1'))(_0x4897('0x2'));var moment=require(_0x4897('0x3'));var BPromise=require(_0x4897('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4897('0x5'));var rimraf=require(_0x4897('0x6'));var config=require(_0x4897('0x7'));var attributes=require(_0x4897('0x8'));module[_0x4897('0x9')]=function(_0x36bbeb,_0x11cbd2){return _0x36bbeb[_0x4897('0xa')](_0x4897('0xb'),attributes,{'tableName':_0x4897('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4897('0xd'),'collate':_0x4897('0xe')});}; \ No newline at end of file +var _0xe142=['ChatOfflineMessage','chat_offline_messages','lodash','util','request-promise','path','../../config/environment','exports'];(function(_0x1b2d45,_0x539428){var _0x438fd4=function(_0x374eb0){while(--_0x374eb0){_0x1b2d45['push'](_0x1b2d45['shift']());}};_0x438fd4(++_0x539428);}(_0xe142,0x7a));var _0x2e14=function(_0x47b107,_0x40d5e6){_0x47b107=_0x47b107-0x0;var _0xd19c2=_0xe142[_0x47b107];return _0xd19c2;};'use strict';var _=require(_0x2e14('0x0'));var util=require(_0x2e14('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2e14('0x2'));var fs=require('fs');var path=require(_0x2e14('0x3'));var rimraf=require('rimraf');var config=require(_0x2e14('0x4'));var attributes=require('./chatOfflineMessage.attributes');module[_0x2e14('0x5')]=function(_0x181a33,_0x627bb){return _0x181a33['define'](_0x2e14('0x6'),attributes,{'tableName':_0x2e14('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 4bae81c..09cd743 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 _0x819d=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x819d,0xc2));var _0xd819=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x819d[_0x209941];return _0x1e8729;};'use strict';var _=require(_0xd819('0x0'));var util=require('util');var moment=require(_0xd819('0x1'));var BPromise=require(_0xd819('0x2'));var rs=require(_0xd819('0x3'));var fs=require('fs');var Redis=require(_0xd819('0x4'));var db=require(_0xd819('0x5'))['db'];var utils=require(_0xd819('0x6'));var logger=require(_0xd819('0x7'))(_0xd819('0x8'));var config=require(_0xd819('0x9'));var jayson=require(_0xd819('0xa'));var client=jayson['client'][_0xd819('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346463,_0x3355dd,_0x274172){return new BPromise(function(_0x33f48b,_0x4972b6){return client[_0xd819('0xc')](_0x346463,_0x274172)[_0xd819('0xd')](function(_0x2219d1){logger['info'](_0xd819('0xe'),_0x3355dd,_0xd819('0xf'));logger[_0xd819('0x10')](_0xd819('0x11'),_0x3355dd,_0xd819('0xf'),JSON['stringify'](_0x2219d1));if(_0x2219d1[_0xd819('0x12')]){if(_0x2219d1[_0xd819('0x12')][_0xd819('0x13')]===0x1f4){logger[_0xd819('0x12')](_0xd819('0xe'),_0x3355dd,_0x2219d1['error'][_0xd819('0x14')]);return _0x4972b6(_0x2219d1[_0xd819('0x12')][_0xd819('0x14')]);}logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3355dd,_0x2219d1[_0xd819('0x12')]['message']);return _0x33f48b(_0x2219d1['error'][_0xd819('0x14')]);}else{logger[_0xd819('0x15')](_0xd819('0xe'),_0x3355dd,_0xd819('0xf'));_0x33f48b(_0x2219d1[_0xd819('0x16')][_0xd819('0x14')]);}})[_0xd819('0x17')](function(_0x1ed715){logger['error'](_0xd819('0xe'),_0x3355dd,_0x1ed715);_0x4972b6(_0x1ed715);});});} \ No newline at end of file +var _0x4d1b=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x369a41,_0x5ed95c){var _0x16807d=function(_0x189d9f){while(--_0x189d9f){_0x369a41['push'](_0x369a41['shift']());}};_0x16807d(++_0x5ed95c);}(_0x4d1b,0x128));var _0xb4d1=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0x4d1b[_0x4d2263];return _0x24aba0;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var moment=require('moment');var BPromise=require(_0xb4d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4d1('0x3'));var db=require(_0xb4d1('0x4'))['db'];var utils=require(_0xb4d1('0x5'));var logger=require(_0xb4d1('0x6'))(_0xb4d1('0x7'));var config=require(_0xb4d1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb4d1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c02c7,_0x52f371,_0x102ced){return new BPromise(function(_0x4cab1d,_0x301b90){return client[_0xb4d1('0xa')](_0x5c02c7,_0x102ced)['then'](function(_0x953c59){logger['info'](_0xb4d1('0xb'),_0x52f371,_0xb4d1('0xc'));logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x52f371,_0xb4d1('0xc'),JSON['stringify'](_0x953c59));if(_0x953c59[_0xb4d1('0xf')]){if(_0x953c59['error'][_0xb4d1('0x10')]===0x1f4){logger[_0xb4d1('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x52f371,_0x953c59['error'][_0xb4d1('0x11')]);return _0x301b90(_0x953c59[_0xb4d1('0xf')][_0xb4d1('0x11')]);}logger[_0xb4d1('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x52f371,_0x953c59[_0xb4d1('0xf')][_0xb4d1('0x11')]);return _0x4cab1d(_0x953c59[_0xb4d1('0xf')]['message']);}else{logger[_0xb4d1('0x12')](_0xb4d1('0xb'),_0x52f371,'request\x20sent');_0x4cab1d(_0x953c59[_0xb4d1('0x13')][_0xb4d1('0x11')]);}})[_0xb4d1('0x14')](function(_0x52c24b){logger[_0xb4d1('0xf')](_0xb4d1('0xb'),_0x52f371,_0x52c24b);_0x301b90(_0x52c24b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 2bbe597..06c586f 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 _0xcbc4=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x6bc0da,_0x5e62a9){var _0x27ee7d=function(_0x34ec93){while(--_0x34ec93){_0x6bc0da['push'](_0x6bc0da['shift']());}};_0x27ee7d(++_0x5e62a9);}(_0xcbc4,0x1e1));var _0x4cbc=function(_0x556072,_0x48fbd5){_0x556072=_0x556072-0x0;var _0x4db052=_0xcbc4[_0x556072];return _0x4db052;};'use strict';var multer=require(_0x4cbc('0x0'));var util=require(_0x4cbc('0x1'));var path=require(_0x4cbc('0x2'));var timeout=require(_0x4cbc('0x3'));var express=require(_0x4cbc('0x4'));var router=express[_0x4cbc('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4cbc('0x6'));var config=require(_0x4cbc('0x7'));var controller=require(_0x4cbc('0x8'));router['get']('/',auth[_0x4cbc('0x9')](),controller[_0x4cbc('0xa')]);router[_0x4cbc('0xb')](_0x4cbc('0xc'),auth['isAuthenticated'](),controller[_0x4cbc('0xd')]);router[_0x4cbc('0xb')](_0x4cbc('0xe'),auth['isAuthenticated'](),controller[_0x4cbc('0xf')]);router[_0x4cbc('0x10')]('/',auth[_0x4cbc('0x9')](),controller[_0x4cbc('0x11')]);router[_0x4cbc('0x12')](_0x4cbc('0xe'),auth[_0x4cbc('0x9')](),controller['update']);router[_0x4cbc('0x13')](_0x4cbc('0xe'),auth[_0x4cbc('0x9')](),controller[_0x4cbc('0x14')]);module[_0x4cbc('0x15')]=router; \ No newline at end of file +var _0x7716=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','put','update','exports','multer','util'];(function(_0x4dea1f,_0x37f472){var _0xfaf69a=function(_0x1280b2){while(--_0x1280b2){_0x4dea1f['push'](_0x4dea1f['shift']());}};_0xfaf69a(++_0x37f472);}(_0x7716,0xa0));var _0x6771=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x7716[_0x2af160];return _0x439d67;};'use strict';var multer=require(_0x6771('0x0'));var util=require(_0x6771('0x1'));var path=require(_0x6771('0x2'));var timeout=require('connect-timeout');var express=require(_0x6771('0x3'));var router=express[_0x6771('0x4')]();var fs_extra=require(_0x6771('0x5'));var auth=require(_0x6771('0x6'));var interaction=require(_0x6771('0x7'));var config=require(_0x6771('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x6771('0x9')]('/',auth['isAuthenticated'](),controller[_0x6771('0xa')]);router[_0x6771('0x9')]('/describe',auth[_0x6771('0xb')](),controller[_0x6771('0xc')]);router[_0x6771('0x9')](_0x6771('0xd'),auth[_0x6771('0xb')](),controller[_0x6771('0xe')]);router['post']('/',auth[_0x6771('0xb')](),controller['create']);router[_0x6771('0xf')](_0x6771('0xd'),auth[_0x6771('0xb')](),controller[_0x6771('0x10')]);router['delete'](_0x6771('0xd'),auth[_0x6771('0xb')](),controller['destroy']);module[_0x6771('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e10ccbd..a9d68d7 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 _0x6e61=['exports','timeout','STRING','INTEGER','sequelize'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x6e61,0x19e));var _0x16e6=function(_0x21c231,_0x13623d){_0x21c231=_0x21c231-0x0;var _0x26a8f3=_0x6e61[_0x21c231];return _0x26a8f3;};'use strict';var Sequelize=require(_0x16e6('0x0'));module[_0x16e6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x16e6('0x2')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x16e6('0x3')]},'timeout':{'type':Sequelize[_0x16e6('0x4')]}}; \ No newline at end of file +var _0xe965=['INTEGER','sequelize','mouseOver'];(function(_0x1a855f,_0x583229){var _0x3ff2fc=function(_0x114428){while(--_0x114428){_0x1a855f['push'](_0x1a855f['shift']());}};_0x3ff2fc(++_0x583229);}(_0xe965,0x9a));var _0x5e96=function(_0x2b40d5,_0x2ee655){_0x2b40d5=_0x2b40d5-0x0;var _0xd25833=_0xe965[_0x2b40d5];return _0xd25833;};'use strict';var Sequelize=require(_0x5e96('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5e96('0x1'),'timeout'),'defaultValue':_0x5e96('0x1')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5e96('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index b5a3f40..38fffa4 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 _0x956a=['show','params','model','keys','ChatProactiveAction','query','attributes','intersection','fields','options','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0xc1a4cf,_0x17141b){var _0x2930d1=function(_0x2e6e7a){while(--_0x2e6e7a){_0xc1a4cf['push'](_0xc1a4cf['shift']());}};_0x2930d1(++_0x17141b);}(_0x956a,0xb6));var _0xa956=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x956a[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa956('0x0'));var zipdir=require(_0xa956('0x1'));var jsonpatch=require(_0xa956('0x2'));var rp=require(_0xa956('0x3'));var moment=require(_0xa956('0x4'));var BPromise=require(_0xa956('0x5'));var Mustache=require(_0xa956('0x6'));var util=require(_0xa956('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa956('0x8'));var ejs=require(_0xa956('0x9'));var fs=require('fs');var fs_extra=require(_0xa956('0xa'));var _=require('lodash');var squel=require(_0xa956('0xb'));var crypto=require(_0xa956('0xc'));var jsforce=require(_0xa956('0xd'));var deskjs=require(_0xa956('0xe'));var toCsv=require(_0xa956('0x8'));var querystring=require(_0xa956('0xf'));var Papa=require(_0xa956('0x10'));var Redis=require('ioredis');var authService=require(_0xa956('0x11'));var qs=require(_0xa956('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa956('0x13'));var logger=require(_0xa956('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa956('0x15'));var licenseUtil=require(_0xa956('0x16'));var db=require(_0xa956('0x17'))['db'];function respondWithStatusCode(_0x4badea,_0x365f72){_0x365f72=_0x365f72||0xcc;return function(_0x277b64){if(_0x277b64){return _0x4badea[_0xa956('0x18')](_0x365f72);}return _0x4badea['status'](_0x365f72)['end']();};}function respondWithResult(_0xb63ef0,_0x48ac9f){_0x48ac9f=_0x48ac9f||0xc8;return function(_0x59ec97){if(_0x59ec97){return _0xb63ef0[_0xa956('0x19')](_0x48ac9f)[_0xa956('0x1a')](_0x59ec97);}};}function respondWithFilteredResult(_0x2044d2,_0x54d416){return function(_0x4b57f4){if(_0x4b57f4){var _0x5027c7=typeof _0x54d416[_0xa956('0x1b')]==='undefined'&&typeof _0x54d416[_0xa956('0x1c')]===_0xa956('0x1d');var _0x5681ce=_0x4b57f4[_0xa956('0x1e')];var _0x461c14=_0x5027c7?0x0:_0x54d416[_0xa956('0x1b')];var _0x5c7baf=_0x5027c7?_0x4b57f4['count']:_0x54d416[_0xa956('0x1b')]+_0x54d416[_0xa956('0x1c')];var _0x2b23bc;if(_0x5c7baf>=_0x5681ce){_0x5c7baf=_0x5681ce;_0x2b23bc=0xc8;}else{_0x2b23bc=0xce;}_0x2044d2[_0xa956('0x19')](_0x2b23bc);return _0x2044d2['set']('Content-Range',_0x461c14+'-'+_0x5c7baf+'/'+_0x5681ce)['json'](_0x4b57f4);}return null;};}function patchUpdates(_0x34c8c9){return function(_0x24125e){try{jsonpatch[_0xa956('0x1f')](_0x24125e,_0x34c8c9,!![]);}catch(_0x2af038){return BPromise[_0xa956('0x20')](_0x2af038);}return _0x24125e[_0xa956('0x21')]();};}function saveUpdates(_0x10f4f6,_0x2c1500){return function(_0x450ab7){if(_0x450ab7){return _0x450ab7[_0xa956('0x22')](_0x10f4f6)[_0xa956('0x23')](function(_0x5a9fae){return _0x5a9fae;});}return null;};}function removeEntity(_0x1d7fd9,_0x1c7a31){return function(_0x5c2924){if(_0x5c2924){return _0x5c2924[_0xa956('0x24')]()[_0xa956('0x23')](function(){_0x1d7fd9[_0xa956('0x19')](0xcc)[_0xa956('0x25')]();});}};}function handleEntityNotFound(_0x2eb9ca,_0x514ce3){return function(_0x73e035){if(!_0x73e035){_0x2eb9ca[_0xa956('0x18')](0x194);}return _0x73e035;};}function handleError(_0x217716,_0x137220){_0x137220=_0x137220||0x1f4;return function(_0x3533fe){logger[_0xa956('0x26')](_0x3533fe[_0xa956('0x27')]);if(_0x3533fe[_0xa956('0x28')]){delete _0x3533fe[_0xa956('0x28')];}_0x217716['status'](_0x137220)[_0xa956('0x29')](_0x3533fe);};}exports[_0xa956('0x2a')]=function(_0x1f5005,_0x416b91){var _0x3cd0a7={'raw':!![],'where':{'id':_0x1f5005[_0xa956('0x2b')]['id']}},_0x172909={};_0x172909[_0xa956('0x2c')]=_[_0xa956('0x2d')](db[_0xa956('0x2e')]['rawAttributes']);_0x172909['query']=_[_0xa956('0x2d')](_0x1f5005[_0xa956('0x2f')]);_0x172909['filters']=_['intersection'](_0x172909[_0xa956('0x2c')],_0x172909[_0xa956('0x2f')]);_0x3cd0a7[_0xa956('0x30')]=_[_0xa956('0x31')](_0x172909[_0xa956('0x2c')],qs[_0xa956('0x32')](_0x1f5005[_0xa956('0x2f')][_0xa956('0x32')]));_0x3cd0a7[_0xa956('0x30')]=_0x3cd0a7[_0xa956('0x30')]['length']?_0x3cd0a7['attributes']:_0x172909[_0xa956('0x2c')];if(_0x1f5005[_0xa956('0x2f')]['includeAll']){_0x3cd0a7['include']=[{'all':!![]}];}_0x3cd0a7=_['merge']({},_0x3cd0a7,_0x1f5005[_0xa956('0x33')]);return db[_0xa956('0x2e')][_0xa956('0x34')](_0x3cd0a7)['then'](handleEntityNotFound(_0x416b91,null))[_0xa956('0x23')](respondWithResult(_0x416b91,null))[_0xa956('0x35')](handleError(_0x416b91,null));};exports[_0xa956('0x36')]=function(_0x289075,_0x58d6d2){return db['ChatProactiveAction'][_0xa956('0x36')](_0x289075[_0xa956('0x37')],{})[_0xa956('0x23')](respondWithResult(_0x58d6d2,0xc9))[_0xa956('0x35')](handleError(_0x58d6d2,null));};exports[_0xa956('0x22')]=function(_0x3d4fa4,_0x25f19a){if(_0x3d4fa4[_0xa956('0x37')]['id']){delete _0x3d4fa4[_0xa956('0x37')]['id'];}return db[_0xa956('0x2e')][_0xa956('0x34')]({'where':{'id':_0x3d4fa4[_0xa956('0x2b')]['id']}})['then'](handleEntityNotFound(_0x25f19a,null))[_0xa956('0x23')](saveUpdates(_0x3d4fa4[_0xa956('0x37')],null))[_0xa956('0x23')](respondWithResult(_0x25f19a,null))[_0xa956('0x35')](handleError(_0x25f19a,null));};exports['destroy']=function(_0x2124c2,_0x45a850){return db[_0xa956('0x2e')][_0xa956('0x34')]({'where':{'id':_0x2124c2['params']['id']}})[_0xa956('0x23')](handleEntityNotFound(_0x45a850,null))[_0xa956('0x23')](removeEntity(_0x45a850,null))[_0xa956('0x35')](handleError(_0x45a850,null));}; \ No newline at end of file +var _0x5395=['status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','error','name','show','model','keys','query','filters','attributes','fields','include','merge','options','ChatProactiveAction','find','create','catch','body','params','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x5395,0x150));var _0x5539=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5395[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x5539('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5539('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5539('0x2'));var BPromise=require(_0x5539('0x3'));var Mustache=require(_0x5539('0x4'));var util=require('util');var path=require(_0x5539('0x5'));var sox=require(_0x5539('0x6'));var csv=require(_0x5539('0x7'));var ejs=require(_0x5539('0x8'));var fs=require('fs');var fs_extra=require(_0x5539('0x9'));var _=require(_0x5539('0xa'));var squel=require(_0x5539('0xb'));var crypto=require(_0x5539('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5539('0xd'));var toCsv=require(_0x5539('0x7'));var querystring=require(_0x5539('0xe'));var Papa=require(_0x5539('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5539('0x10'));var logger=require('../../config/logger')(_0x5539('0x11'));var utils=require('../../config/utils');var config=require(_0x5539('0x12'));var licenseUtil=require(_0x5539('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f8658,_0x14f0ac){_0x14f0ac=_0x14f0ac||0xcc;return function(_0x1a418b){if(_0x1a418b){return _0x4f8658[_0x5539('0x14')](_0x14f0ac);}return _0x4f8658[_0x5539('0x15')](_0x14f0ac)[_0x5539('0x16')]();};}function respondWithResult(_0x1aea33,_0x498eef){_0x498eef=_0x498eef||0xc8;return function(_0x17ec44){if(_0x17ec44){return _0x1aea33[_0x5539('0x15')](_0x498eef)['json'](_0x17ec44);}};}function respondWithFilteredResult(_0x42129b,_0x53a861){return function(_0x3d1ad7){if(_0x3d1ad7){var _0x53b670=typeof _0x53a861[_0x5539('0x17')]===_0x5539('0x18')&&typeof _0x53a861[_0x5539('0x19')]===_0x5539('0x18');var _0x437b01=_0x3d1ad7[_0x5539('0x1a')];var _0x53723f=_0x53b670?0x0:_0x53a861['offset'];var _0x52476f=_0x53b670?_0x3d1ad7[_0x5539('0x1a')]:_0x53a861['offset']+_0x53a861[_0x5539('0x19')];var _0x2f9cb1;if(_0x52476f>=_0x437b01){_0x52476f=_0x437b01;_0x2f9cb1=0xc8;}else{_0x2f9cb1=0xce;}_0x42129b[_0x5539('0x15')](_0x2f9cb1);return _0x42129b['set'](_0x5539('0x1b'),_0x53723f+'-'+_0x52476f+'/'+_0x437b01)[_0x5539('0x1c')](_0x3d1ad7);}return null;};}function patchUpdates(_0x5094d3){return function(_0x1171cc){try{jsonpatch['apply'](_0x1171cc,_0x5094d3,!![]);}catch(_0x2fb510){return BPromise[_0x5539('0x1d')](_0x2fb510);}return _0x1171cc[_0x5539('0x1e')]();};}function saveUpdates(_0x21f474,_0x4eae80){return function(_0x55732d){if(_0x55732d){return _0x55732d['update'](_0x21f474)[_0x5539('0x1f')](function(_0x4633b3){return _0x4633b3;});}return null;};}function removeEntity(_0x19b989,_0x1e12ad){return function(_0xa0f93b){if(_0xa0f93b){return _0xa0f93b[_0x5539('0x20')]()[_0x5539('0x1f')](function(){_0x19b989[_0x5539('0x15')](0xcc)[_0x5539('0x16')]();});}};}function handleEntityNotFound(_0x3e46f6,_0x3eb310){return function(_0x1ebd4a){if(!_0x1ebd4a){_0x3e46f6[_0x5539('0x14')](0x194);}return _0x1ebd4a;};}function handleError(_0x1dddca,_0x40e9fc){_0x40e9fc=_0x40e9fc||0x1f4;return function(_0xacacfc){logger[_0x5539('0x21')](_0xacacfc['stack']);if(_0xacacfc['name']){delete _0xacacfc[_0x5539('0x22')];}_0x1dddca[_0x5539('0x15')](_0x40e9fc)['send'](_0xacacfc);};}exports[_0x5539('0x23')]=function(_0x5c0be7,_0x58844f){var _0x2679dd={'raw':!![],'where':{'id':_0x5c0be7['params']['id']}},_0xcab0cf={};_0xcab0cf[_0x5539('0x24')]=_[_0x5539('0x25')](db['ChatProactiveAction']['rawAttributes']);_0xcab0cf[_0x5539('0x26')]=_['keys'](_0x5c0be7[_0x5539('0x26')]);_0xcab0cf[_0x5539('0x27')]=_['intersection'](_0xcab0cf[_0x5539('0x24')],_0xcab0cf['query']);_0x2679dd[_0x5539('0x28')]=_['intersection'](_0xcab0cf['model'],qs[_0x5539('0x29')](_0x5c0be7['query'][_0x5539('0x29')]));_0x2679dd[_0x5539('0x28')]=_0x2679dd[_0x5539('0x28')]['length']?_0x2679dd[_0x5539('0x28')]:_0xcab0cf[_0x5539('0x24')];if(_0x5c0be7[_0x5539('0x26')]['includeAll']){_0x2679dd[_0x5539('0x2a')]=[{'all':!![]}];}_0x2679dd=_[_0x5539('0x2b')]({},_0x2679dd,_0x5c0be7[_0x5539('0x2c')]);return db[_0x5539('0x2d')][_0x5539('0x2e')](_0x2679dd)['then'](handleEntityNotFound(_0x58844f,null))[_0x5539('0x1f')](respondWithResult(_0x58844f,null))['catch'](handleError(_0x58844f,null));};exports[_0x5539('0x2f')]=function(_0x163989,_0x5b4586){return db[_0x5539('0x2d')][_0x5539('0x2f')](_0x163989['body'],{})['then'](respondWithResult(_0x5b4586,0xc9))[_0x5539('0x30')](handleError(_0x5b4586,null));};exports['update']=function(_0x1ddad4,_0x5e16dc){if(_0x1ddad4[_0x5539('0x31')]['id']){delete _0x1ddad4[_0x5539('0x31')]['id'];}return db[_0x5539('0x2d')][_0x5539('0x2e')]({'where':{'id':_0x1ddad4[_0x5539('0x32')]['id']}})['then'](handleEntityNotFound(_0x5e16dc,null))['then'](saveUpdates(_0x1ddad4[_0x5539('0x31')],null))[_0x5539('0x1f')](respondWithResult(_0x5e16dc,null))[_0x5539('0x30')](handleError(_0x5e16dc,null));};exports[_0x5539('0x20')]=function(_0x4d39de,_0x32e0fa){return db[_0x5539('0x2d')][_0x5539('0x2e')]({'where':{'id':_0x4d39de[_0x5539('0x32')]['id']}})[_0x5539('0x1f')](handleEntityNotFound(_0x32e0fa,null))[_0x5539('0x1f')](removeEntity(_0x32e0fa,null))['catch'](handleError(_0x32e0fa,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 664fb94..84f1801 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 _0x1c61=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','lodash'];(function(_0x37f8ca,_0x49396d){var _0x4088ab=function(_0x5d4293){while(--_0x5d4293){_0x37f8ca['push'](_0x37f8ca['shift']());}};_0x4088ab(++_0x49396d);}(_0x1c61,0x17b));var _0x11c6=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x1c61[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x11c6('0x0'));var util=require(_0x11c6('0x1'));var logger=require(_0x11c6('0x2'))(_0x11c6('0x3'));var moment=require(_0x11c6('0x4'));var BPromise=require('bluebird');var rp=require(_0x11c6('0x5'));var fs=require('fs');var path=require(_0x11c6('0x6'));var rimraf=require('rimraf');var config=require(_0x11c6('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x11c6('0x8')]=function(_0x560857,_0x10ec53){return _0x560857[_0x11c6('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88c7=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x4ef2bc,_0x54b999){var _0x291985=function(_0x41c371){while(--_0x41c371){_0x4ef2bc['push'](_0x4ef2bc['shift']());}};_0x291985(++_0x54b999);}(_0x88c7,0x120));var _0x788c=function(_0x5e1a20,_0x3aac1d){_0x5e1a20=_0x5e1a20-0x0;var _0x74870f=_0x88c7[_0x5e1a20];return _0x74870f;};'use strict';var _=require(_0x788c('0x0'));var util=require(_0x788c('0x1'));var logger=require(_0x788c('0x2'))('api');var moment=require(_0x788c('0x3'));var BPromise=require(_0x788c('0x4'));var rp=require(_0x788c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x788c('0x6'));var config=require(_0x788c('0x7'));var attributes=require(_0x788c('0x8'));module[_0x788c('0x9')]=function(_0x49cc9c,_0x1c7da8){return _0x49cc9c[_0x788c('0xa')](_0x788c('0xb'),attributes,{'tableName':_0x788c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index c4ca966..75d6007 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 _0x4bb1=['../../config/logger','rpc','http','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b6f85,_0x348581){var _0x17d1b1=function(_0x18f9c9){while(--_0x18f9c9){_0x1b6f85['push'](_0x1b6f85['shift']());}};_0x17d1b1(++_0x348581);}(_0x4bb1,0x1d9));var _0x14bb=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0x4bb1[_0x523adf];return _0x283870;};'use strict';var _=require(_0x14bb('0x0'));var util=require(_0x14bb('0x1'));var moment=require(_0x14bb('0x2'));var BPromise=require(_0x14bb('0x3'));var rs=require(_0x14bb('0x4'));var fs=require('fs');var Redis=require(_0x14bb('0x5'));var db=require(_0x14bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x14bb('0x7'))(_0x14bb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x14bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa14363,_0x596f67,_0x2ef487){return new BPromise(function(_0x5a2315,_0x26c929){return client['request'](_0xa14363,_0x2ef487)['then'](function(_0x238116){logger[_0x14bb('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x596f67,_0x14bb('0xb'));logger[_0x14bb('0xc')](_0x14bb('0xd'),_0x596f67,_0x14bb('0xb'),JSON['stringify'](_0x238116));if(_0x238116[_0x14bb('0xe')]){if(_0x238116[_0x14bb('0xe')][_0x14bb('0xf')]===0x1f4){logger[_0x14bb('0xe')](_0x14bb('0x10'),_0x596f67,_0x238116[_0x14bb('0xe')][_0x14bb('0x11')]);return _0x26c929(_0x238116['error'][_0x14bb('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x596f67,_0x238116[_0x14bb('0xe')][_0x14bb('0x11')]);return _0x5a2315(_0x238116[_0x14bb('0xe')][_0x14bb('0x11')]);}else{logger[_0x14bb('0xa')](_0x14bb('0x10'),_0x596f67,_0x14bb('0xb'));_0x5a2315(_0x238116[_0x14bb('0x12')][_0x14bb('0x11')]);}})[_0x14bb('0x13')](function(_0x590532){logger[_0x14bb('0xe')](_0x14bb('0x10'),_0x596f67,_0x590532);_0x26c929(_0x590532);});});} \ No newline at end of file +var _0x4470=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x1d0608,_0x241384){var _0x31dbea=function(_0x6cdd80){while(--_0x6cdd80){_0x1d0608['push'](_0x1d0608['shift']());}};_0x31dbea(++_0x241384);}(_0x4470,0xe8));var _0x0447=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x4470[_0x421cf8];return _0x145c48;};'use strict';var _=require(_0x0447('0x0'));var util=require(_0x0447('0x1'));var moment=require(_0x0447('0x2'));var BPromise=require('bluebird');var rs=require(_0x0447('0x3'));var fs=require('fs');var Redis=require(_0x0447('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0447('0x5'));var logger=require(_0x0447('0x6'))(_0x0447('0x7'));var config=require(_0x0447('0x8'));var jayson=require(_0x0447('0x9'));var client=jayson['client'][_0x0447('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7d94a6,_0x1b651a,_0x177c82){return new BPromise(function(_0x3f6eff,_0x2df533){return client[_0x0447('0xb')](_0x7d94a6,_0x177c82)[_0x0447('0xc')](function(_0x3028ea){logger['info'](_0x0447('0xd'),_0x1b651a,_0x0447('0xe'));logger[_0x0447('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1b651a,_0x0447('0xe'),JSON[_0x0447('0x10')](_0x3028ea));if(_0x3028ea[_0x0447('0x11')]){if(_0x3028ea[_0x0447('0x11')][_0x0447('0x12')]===0x1f4){logger[_0x0447('0x11')](_0x0447('0xd'),_0x1b651a,_0x3028ea['error'][_0x0447('0x13')]);return _0x2df533(_0x3028ea[_0x0447('0x11')][_0x0447('0x13')]);}logger['error'](_0x0447('0xd'),_0x1b651a,_0x3028ea['error'][_0x0447('0x13')]);return _0x3f6eff(_0x3028ea[_0x0447('0x11')][_0x0447('0x13')]);}else{logger[_0x0447('0x14')](_0x0447('0xd'),_0x1b651a,_0x0447('0xe'));_0x3f6eff(_0x3028ea[_0x0447('0x15')]['message']);}})[_0x0447('0x16')](function(_0xccac1c){logger[_0x0447('0x11')](_0x0447('0xd'),_0x1b651a,_0xccac1c);_0x2df533(_0xccac1c);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index aea1af8..bbef643 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 _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb138,0x1dd));var _0x8b13=function(_0x1e72f6,_0x1ed2b2){_0x1e72f6=_0x1e72f6-0x0;var _0x1ff183=_0xb138[_0x1e72f6];return _0x1ff183;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file +var _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x20f2c9,_0x371080){var _0x1d9c40=function(_0x1fbf89){while(--_0x1fbf89){_0x20f2c9['push'](_0x20f2c9['shift']());}};_0x1d9c40(++_0x371080);}(_0xed1f,0x6a));var _0xfed1=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed1f[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);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 4b7abd3..faea9ba 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 _0xd788=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x19e7b9,_0x1eb83a){var _0x21a8c7=function(_0x167dc7){while(--_0x167dc7){_0x19e7b9['push'](_0x19e7b9['shift']());}};_0x21a8c7(++_0x1eb83a);}(_0xd788,0xdb));var _0x8d78=function(_0x1af0cb,_0x11055a){_0x1af0cb=_0x1af0cb-0x0;var _0x32c431=_0xd788[_0x1af0cb];return _0x32c431;};'use strict';var Sequelize=require('sequelize');module[_0x8d78('0x0')]={'name':{'type':Sequelize[_0x8d78('0x1')],'unique':_0x8d78('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8d78('0x1')]},'timeout':{'type':Sequelize[_0x8d78('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8d78('0x4'),_0x8d78('0x5'),_0x8d78('0x6'))}}; \ No newline at end of file +var _0x893a=['sequelize','INTEGER','ENUM','rrmemory','beepall'];(function(_0x5e2174,_0x3e35d4){var _0x5e25a1=function(_0x4dc415){while(--_0x4dc415){_0x5e2174['push'](_0x5e2174['shift']());}};_0x5e25a1(++_0x3e35d4);}(_0x893a,0xf0));var _0xa893=function(_0x47e871,_0xa9462c){_0x47e871=_0x47e871-0x0;var _0x1de398=_0x893a[_0x47e871];return _0x1de398;};'use strict';var Sequelize=require(_0xa893('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa893('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa893('0x2')](_0xa893('0x3'),_0xa893('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index f484bbb..c81b80f 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 _0x3873=['offset','set','Content-Range','apply','save','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','filter','options','includeAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','findOne','hasOwnProperty','order','pick','ChatQueueId','merge','UserChatQueue','findAll','User','UserId','agent','chatPause','updatedAt','createdAt','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','TeamId','includes','all','union','compact','isEmpty','forEach','addAgents','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','undefined','limit','count'];(function(_0x140484,_0xf0af75){var _0x2e2460=function(_0xaf08f9){while(--_0xaf08f9){_0x140484['push'](_0x140484['shift']());}};_0x2e2460(++_0xf0af75);}(_0x3873,0x188));var _0x3387=function(_0x253c60,_0xf8beb4){_0x253c60=_0x253c60-0x0;var _0x59fc2e=_0x3873[_0x253c60];return _0x59fc2e;};'use strict';var emlformat=require(_0x3387('0x0'));var rimraf=require(_0x3387('0x1'));var zipdir=require(_0x3387('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3387('0x3'));var BPromise=require(_0x3387('0x4'));var Mustache=require('mustache');var util=require(_0x3387('0x5'));var path=require(_0x3387('0x6'));var sox=require(_0x3387('0x7'));var csv=require(_0x3387('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3387('0x9'));var _=require(_0x3387('0xa'));var squel=require(_0x3387('0xb'));var crypto=require('crypto');var jsforce=require(_0x3387('0xc'));var deskjs=require(_0x3387('0xd'));var toCsv=require(_0x3387('0x8'));var querystring=require(_0x3387('0xe'));var Papa=require(_0x3387('0xf'));var Redis=require('ioredis');var authService=require(_0x3387('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3387('0x11'));var hardwareService=require(_0x3387('0x12'));var logger=require(_0x3387('0x13'))(_0x3387('0x14'));var utils=require(_0x3387('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3387('0x16'));var db=require(_0x3387('0x17'))['db'];config[_0x3387('0x18')]=_[_0x3387('0x19')](config[_0x3387('0x18')],{'host':_0x3387('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3387('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3387('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5602,_0x1de616,_0x4129d0,_0xf8935c){return new BPromise(function(_0x29c729,_0x52f926){var _0x2bcb9b=_0xf8935c||client;return _0x2bcb9b['request'](_0x4b5602,_0x4129d0)[_0x3387('0x1d')](function(_0x345541){logger[_0x3387('0x1e')](_0x3387('0x1f'),_0x1de616,_0x3387('0x20'));logger[_0x3387('0x21')](_0x3387('0x22'),_0x1de616,_0x3387('0x20'),JSON[_0x3387('0x23')](_0x345541));if(_0x345541['error']){if(_0x345541[_0x3387('0x24')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1de616,_0x345541['error'][_0x3387('0x25')]);return _0x52f926(_0x345541[_0x3387('0x24')][_0x3387('0x25')]);}logger[_0x3387('0x24')](_0x3387('0x1f'),_0x1de616,_0x345541['error'][_0x3387('0x25')]);return _0x29c729(_0x345541[_0x3387('0x24')][_0x3387('0x25')]);}else{logger['info'](_0x3387('0x1f'),_0x1de616,'request\x20sent');_0x29c729(_0x345541[_0x3387('0x26')][_0x3387('0x25')]);}})['catch'](function(_0x3ba762){logger[_0x3387('0x24')](_0x3387('0x1f'),_0x1de616,_0x3ba762);_0x52f926(_0x3ba762);});});}function respondWithStatusCode(_0x2ce9e3,_0x16986d){_0x16986d=_0x16986d||0xcc;return function(_0x308c19){if(_0x308c19){return _0x2ce9e3[_0x3387('0x27')](_0x16986d);}return _0x2ce9e3[_0x3387('0x28')](_0x16986d)[_0x3387('0x29')]();};}function respondWithResult(_0x3f9f42,_0x5ec797){_0x5ec797=_0x5ec797||0xc8;return function(_0xdfed38){if(_0xdfed38){return _0x3f9f42['status'](_0x5ec797)[_0x3387('0x2a')](_0xdfed38);}};}function respondWithFilteredResult(_0x194478,_0x2a6379){return function(_0x856b37){if(_0x856b37){var _0x1f51c8=typeof _0x2a6379['offset']===_0x3387('0x2b')&&typeof _0x2a6379[_0x3387('0x2c')]===_0x3387('0x2b');var _0x56932a=_0x856b37[_0x3387('0x2d')];var _0xe9ebee=_0x1f51c8?0x0:_0x2a6379[_0x3387('0x2e')];var _0x2b6015=_0x1f51c8?_0x856b37[_0x3387('0x2d')]:_0x2a6379['offset']+_0x2a6379[_0x3387('0x2c')];var _0x3efdf2;if(_0x2b6015>=_0x56932a){_0x2b6015=_0x56932a;_0x3efdf2=0xc8;}else{_0x3efdf2=0xce;}_0x194478[_0x3387('0x28')](_0x3efdf2);return _0x194478[_0x3387('0x2f')](_0x3387('0x30'),_0xe9ebee+'-'+_0x2b6015+'/'+_0x56932a)[_0x3387('0x2a')](_0x856b37);}return null;};}function patchUpdates(_0x51b878){return function(_0x10675e){try{jsonpatch[_0x3387('0x31')](_0x10675e,_0x51b878,!![]);}catch(_0x4b8c88){return BPromise['reject'](_0x4b8c88);}return _0x10675e[_0x3387('0x32')]();};}function saveUpdates(_0x508bb8,_0x5073d0){return function(_0x3e29ea){if(_0x3e29ea){return _0x3e29ea['update'](_0x508bb8)[_0x3387('0x1d')](function(_0xe14c5d){return _0xe14c5d;});}return null;};}function removeEntity(_0x806bb9,_0x56943a){return function(_0x55a52d){if(_0x55a52d){return _0x55a52d[_0x3387('0x33')]()[_0x3387('0x1d')](function(){var _0x1a7755=_0x55a52d[_0x3387('0x34')]({'plain':!![]});var _0x56af35=_0x3387('0x35');return db[_0x3387('0x36')][_0x3387('0x33')]({'where':{'type':_0x56af35,'resourceId':_0x1a7755['id']}})['then'](function(){return _0x55a52d;});})['then'](function(){_0x806bb9[_0x3387('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b3a88,_0x2b63a8){return function(_0x2c6012){if(!_0x2c6012){_0x1b3a88[_0x3387('0x27')](0x194);}return _0x2c6012;};}function handleError(_0x1fdf73,_0x56ee88){_0x56ee88=_0x56ee88||0x1f4;return function(_0x574e5f){logger[_0x3387('0x24')](_0x574e5f['stack']);if(_0x574e5f['name']){delete _0x574e5f[_0x3387('0x37')];}_0x1fdf73[_0x3387('0x28')](_0x56ee88)[_0x3387('0x38')](_0x574e5f);};}exports[_0x3387('0x39')]=function(_0x55702a,_0x389202){var _0x50f1be={},_0x5882fe={},_0x402551={'count':0x0,'rows':[]};var _0xff7f=_[_0x3387('0x3a')](db[_0x3387('0x3b')][_0x3387('0x3c')],function(_0x3cd583){return{'name':_0x3cd583[_0x3387('0x3d')],'type':_0x3cd583[_0x3387('0x3e')][_0x3387('0x3f')]};});_0x5882fe[_0x3387('0x40')]=_['map'](_0xff7f,_0x3387('0x37'));_0x5882fe[_0x3387('0x41')]=_[_0x3387('0x42')](_0x55702a[_0x3387('0x41')]);_0x5882fe[_0x3387('0x43')]=_[_0x3387('0x44')](_0x5882fe['model'],_0x5882fe[_0x3387('0x41')]);_0x50f1be['attributes']=_[_0x3387('0x44')](_0x5882fe['model'],qs[_0x3387('0x45')](_0x55702a['query'][_0x3387('0x45')]));_0x50f1be[_0x3387('0x46')]=_0x50f1be['attributes'][_0x3387('0x47')]?_0x50f1be[_0x3387('0x46')]:_0x5882fe[_0x3387('0x40')];if(!_0x55702a[_0x3387('0x41')]['hasOwnProperty'](_0x3387('0x48'))){_0x50f1be[_0x3387('0x2c')]=qs[_0x3387('0x2c')](_0x55702a['query']['limit']);_0x50f1be['offset']=qs[_0x3387('0x2e')](_0x55702a[_0x3387('0x41')][_0x3387('0x2e')]);}_0x50f1be['order']=qs[_0x3387('0x49')](_0x55702a[_0x3387('0x41')]['sort']);_0x50f1be[_0x3387('0x4a')]=qs[_0x3387('0x43')](_['pick'](_0x55702a[_0x3387('0x41')],_0x5882fe[_0x3387('0x43')]),_0xff7f);if(_0x55702a['query'][_0x3387('0x4b')]){_0x50f1be['where']=_['merge'](_0x50f1be[_0x3387('0x4a')],{'$or':_['map'](_0xff7f,function(_0x51ef1e){if(_0x51ef1e['type']!=='VIRTUAL'){var _0x276d37={};_0x276d37[_0x51ef1e[_0x3387('0x37')]]={'$like':'%'+_0x55702a[_0x3387('0x41')][_0x3387('0x4b')]+'%'};return _0x276d37;}})});}_0x50f1be=_['merge']({},_0x50f1be,_0x55702a[_0x3387('0x4c')]);var _0x2663d7={'where':_0x50f1be[_0x3387('0x4a')]};return db[_0x3387('0x3b')][_0x3387('0x2d')](_0x2663d7)[_0x3387('0x1d')](function(_0x37f52d){_0x402551[_0x3387('0x2d')]=_0x37f52d;if(_0x55702a[_0x3387('0x41')][_0x3387('0x4d')]){_0x50f1be['include']=[{'all':!![]}];}return db[_0x3387('0x3b')]['findAll'](_0x50f1be);})['then'](function(_0x46de27){_0x402551[_0x3387('0x4e')]=_0x46de27;return _0x402551;})['then'](respondWithFilteredResult(_0x389202,_0x50f1be))[_0x3387('0x4f')](handleError(_0x389202,null));};exports['show']=function(_0x250e2f,_0x17bd6d){var _0x3b37f5={'raw':!![],'where':{'id':_0x250e2f[_0x3387('0x50')]['id']}},_0x1c1938={};_0x1c1938['model']=_[_0x3387('0x42')](db[_0x3387('0x3b')][_0x3387('0x3c')]);_0x1c1938[_0x3387('0x41')]=_[_0x3387('0x42')](_0x250e2f[_0x3387('0x41')]);_0x1c1938[_0x3387('0x43')]=_[_0x3387('0x44')](_0x1c1938['model'],_0x1c1938['query']);_0x3b37f5[_0x3387('0x46')]=_['intersection'](_0x1c1938[_0x3387('0x40')],qs[_0x3387('0x45')](_0x250e2f['query'][_0x3387('0x45')]));_0x3b37f5[_0x3387('0x46')]=_0x3b37f5[_0x3387('0x46')][_0x3387('0x47')]?_0x3b37f5['attributes']:_0x1c1938[_0x3387('0x40')];if(_0x250e2f[_0x3387('0x41')][_0x3387('0x4d')]){_0x3b37f5['include']=[{'all':!![]}];}_0x3b37f5=_['merge']({},_0x3b37f5,_0x250e2f[_0x3387('0x4c')]);return db[_0x3387('0x3b')]['find'](_0x3b37f5)[_0x3387('0x1d')](handleEntityNotFound(_0x17bd6d,null))[_0x3387('0x1d')](respondWithResult(_0x17bd6d,null))[_0x3387('0x4f')](handleError(_0x17bd6d,null));};exports[_0x3387('0x51')]=function(_0x23c3f6,_0x2d521a){return db[_0x3387('0x3b')][_0x3387('0x51')](_0x23c3f6[_0x3387('0x52')],{})[_0x3387('0x1d')](function(_0x1c7d81){var _0x350e7c=_0x23c3f6[_0x3387('0x53')]['get']({'plain':!![]});if(!_0x350e7c)throw new Error(_0x3387('0x54'));if(_0x350e7c[_0x3387('0x55')]===_0x3387('0x53')){var _0x445c63=_0x1c7d81['get']({'plain':!![]});var _0x5d393c='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x5d393c,'userProfileId':_0x350e7c[_0x3387('0x56')]},'raw':!![]})[_0x3387('0x1d')](function(_0x5a82b2){if(_0x5a82b2&&_0x5a82b2['autoAssociation']===0x0){return db[_0x3387('0x36')][_0x3387('0x51')]({'name':_0x445c63[_0x3387('0x37')],'resourceId':_0x445c63['id'],'type':_0x5a82b2['name'],'sectionId':_0x5a82b2['id']},{})[_0x3387('0x1d')](function(){return _0x1c7d81;});}else{return _0x1c7d81;}})[_0x3387('0x4f')](function(_0x2495ee){logger[_0x3387('0x24')](_0x3387('0x57'),_0x2495ee);throw _0x2495ee;});}return _0x1c7d81;})[_0x3387('0x1d')](respondWithResult(_0x2d521a,0xc9))[_0x3387('0x4f')](handleError(_0x2d521a,null));};exports[_0x3387('0x58')]=function(_0x57a342,_0x50d096){if(_0x57a342['body']['id']){delete _0x57a342['body']['id'];}return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x57a342[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x50d096,null))['then'](saveUpdates(_0x57a342[_0x3387('0x52')],null))[_0x3387('0x1d')](respondWithResult(_0x50d096,null))['catch'](handleError(_0x50d096,null));};exports[_0x3387('0x33')]=function(_0x56165e,_0x35cf28){return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x56165e[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x35cf28,null))[_0x3387('0x1d')](removeEntity(_0x35cf28,null))['catch'](handleError(_0x35cf28,null));};exports[_0x3387('0x5a')]=function(_0x298dea,_0x22e7ea){return db[_0x3387('0x3b')][_0x3387('0x5a')]()['then'](respondWithResult(_0x22e7ea,null))['catch'](handleError(_0x22e7ea,null));};exports[_0x3387('0x5b')]=function(_0x4ed668,_0x3a31df,_0x1ff34a){var _0x3bcaed={'raw':!![],'where':{}},_0x1d137b={},_0x387e3b;return db[_0x3387('0x3b')][_0x3387('0x5c')]({'where':{'id':_0x4ed668[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x3a31df,null))[_0x3387('0x1d')](function(_0x5d19d8){if(_0x5d19d8){_0x387e3b=_0x5d19d8[_0x3387('0x34')]({'plain':!![]});_0x1d137b['model']=_[_0x3387('0x42')](db['UserChatQueue'][_0x3387('0x3c')]);_0x1d137b[_0x3387('0x41')]=_[_0x3387('0x42')](_0x4ed668['query']);_0x1d137b[_0x3387('0x43')]=_[_0x3387('0x44')](_0x1d137b[_0x3387('0x40')],_0x1d137b[_0x3387('0x41')]);_0x3bcaed[_0x3387('0x46')]=_[_0x3387('0x44')](_0x1d137b[_0x3387('0x40')],qs[_0x3387('0x45')](_0x4ed668[_0x3387('0x41')][_0x3387('0x45')]));_0x3bcaed[_0x3387('0x46')]=_0x3bcaed[_0x3387('0x46')][_0x3387('0x47')]?_0x3bcaed['attributes']:_0x1d137b[_0x3387('0x40')];if(!_0x4ed668[_0x3387('0x41')][_0x3387('0x5d')](_0x3387('0x48'))){_0x3bcaed[_0x3387('0x2c')]=qs[_0x3387('0x2c')](_0x4ed668[_0x3387('0x41')][_0x3387('0x2c')]);_0x3bcaed['offset']=qs[_0x3387('0x2e')](_0x4ed668[_0x3387('0x41')]['offset']);}_0x3bcaed[_0x3387('0x5e')]=qs[_0x3387('0x49')](_0x4ed668['query'][_0x3387('0x49')]);_0x3bcaed[_0x3387('0x4a')]=qs['filters'](_[_0x3387('0x5f')](_0x4ed668[_0x3387('0x41')],_0x1d137b[_0x3387('0x43')]));_0x3bcaed[_0x3387('0x4a')][_0x3387('0x60')]=_0x5d19d8['id'];if(_0x4ed668['query'][_0x3387('0x4b')]){_0x3bcaed[_0x3387('0x4a')]=_[_0x3387('0x61')](_0x3bcaed[_0x3387('0x4a')],{'$or':_[_0x3387('0x3a')](_0x3bcaed['attributes'],function(_0x2249d6){var _0x5c7575={};_0x5c7575[_0x2249d6]={'$like':'%'+_0x4ed668[_0x3387('0x41')][_0x3387('0x4b')]+'%'};return _0x5c7575;})});}_0x3bcaed=_[_0x3387('0x61')]({},_0x3bcaed,_0x4ed668[_0x3387('0x4c')]);return db[_0x3387('0x62')][_0x3387('0x63')](_0x3bcaed);}})[_0x3387('0x1d')](function(_0x45e52e){if(_0x45e52e){return db[_0x3387('0x64')]['findAndCountAll']({'where':{'id':_[_0x3387('0x3a')](_0x45e52e,_0x3387('0x65')),'role':_0x3387('0x66')},'attributes':['id',_0x3387('0x37'),_0x3387('0x67'),_0x3387('0x68'),_0x3387('0x69')]});}})[_0x3387('0x1d')](function(_0x30f0a8){if(_0x30f0a8){return{'count':_0x30f0a8[_0x3387('0x2d')],'rows':_[_0x3387('0x3a')](_0x30f0a8[_0x3387('0x4e')],function(_0x5b2079){return{'membername':_0x5b2079['name'],'UserId':_0x5b2079['id'],'queue_name':_0x387e3b[_0x3387('0x37')],'ChatQueueId':_0x387e3b['id'],'interface':util['format']('%s/%s',_0x3387('0x6a'),_0x5b2079[_0x3387('0x37')]),'penalty':0x0,'paused':_0x5b2079[_0x3387('0x67')],'createdAt':_0x5b2079[_0x3387('0x69')],'updatedAt':_0x5b2079['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3387('0x1d')](respondWithFilteredResult(_0x3a31df,_0x3bcaed))['catch'](handleError(_0x3a31df,null));};exports[_0x3387('0x6b')]=function(_0x4c40a6,_0x19b413,_0x25ed16){var _0x20ef25={};var _0x536cc5={};var _0x59c3c9;var _0x321157;return db['ChatQueue'][_0x3387('0x5c')]({'where':{'id':_0x4c40a6[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x19b413,null))[_0x3387('0x1d')](function(_0x3b0c6b){if(_0x3b0c6b){_0x59c3c9=_0x3b0c6b;_0x536cc5[_0x3387('0x40')]=_[_0x3387('0x42')](db[_0x3387('0x6c')][_0x3387('0x3c')]);_0x536cc5[_0x3387('0x41')]=_[_0x3387('0x42')](_0x4c40a6[_0x3387('0x41')]);_0x536cc5[_0x3387('0x43')]=_[_0x3387('0x44')](_0x536cc5[_0x3387('0x40')],_0x536cc5[_0x3387('0x41')]);_0x20ef25[_0x3387('0x46')]=_[_0x3387('0x44')](_0x536cc5[_0x3387('0x40')],qs[_0x3387('0x45')](_0x4c40a6[_0x3387('0x41')][_0x3387('0x45')]));_0x20ef25[_0x3387('0x46')]=_0x20ef25[_0x3387('0x46')][_0x3387('0x47')]?_0x20ef25[_0x3387('0x46')]:_0x536cc5[_0x3387('0x40')];_0x20ef25[_0x3387('0x5e')]=qs['sort'](_0x4c40a6[_0x3387('0x41')]['sort']);_0x20ef25[_0x3387('0x4a')]=qs[_0x3387('0x43')](_['pick'](_0x4c40a6[_0x3387('0x41')],_0x536cc5[_0x3387('0x43')]));if(_0x4c40a6[_0x3387('0x41')][_0x3387('0x4b')]){_0x20ef25[_0x3387('0x4a')]=_[_0x3387('0x61')](_0x20ef25[_0x3387('0x4a')],{'$or':_[_0x3387('0x3a')](_0x20ef25[_0x3387('0x46')],function(_0x2fd0ec){var _0x1a8721={};_0x1a8721[_0x2fd0ec]={'$like':'%'+_0x4c40a6[_0x3387('0x41')]['filter']+'%'};return _0x1a8721;})});}_0x20ef25=_[_0x3387('0x61')]({},_0x20ef25,_0x4c40a6[_0x3387('0x4c')]);return _0x59c3c9[_0x3387('0x6b')](_0x20ef25);}})['then'](function(_0x469570){if(_0x469570){_0x321157=_0x469570['length'];if(!_0x4c40a6[_0x3387('0x41')][_0x3387('0x5d')](_0x3387('0x48'))){_0x20ef25[_0x3387('0x2c')]=qs[_0x3387('0x2c')](_0x4c40a6[_0x3387('0x41')][_0x3387('0x2c')]);_0x20ef25['offset']=qs[_0x3387('0x2e')](_0x4c40a6[_0x3387('0x41')][_0x3387('0x2e')]);}return _0x59c3c9[_0x3387('0x6b')](_0x20ef25);}})['then'](function(_0x4982b1){if(_0x4982b1){return _0x4982b1?{'count':_0x321157,'rows':_0x4982b1}:null;}})[_0x3387('0x1d')](respondWithResult(_0x19b413,null))[_0x3387('0x4f')](handleError(_0x19b413,null));};exports[_0x3387('0x6d')]=function(_0x44cc24,_0x2b03b1,_0x370f1e){var _0x5f4750=_0x44cc24[_0x3387('0x52')][_0x3387('0x6e')];return db[_0x3387('0x6c')][_0x3387('0x63')]({'where':{'id':_0x5f4750},'attributes':['id'],'include':[{'model':db[_0x3387('0x64')],'as':_0x3387('0x6f'),'attributes':['id',_0x3387('0x37'),_0x3387('0x70'),_0x3387('0x71'),_0x3387('0x72')],'raw':!![]}]})[_0x3387('0x1d')](function(_0x29dae2){if(_0x29dae2){var _0x41b409=_[_0x3387('0x73')](_0x29dae2,function(_0x15b9ef){var _0x5944ce=_0x15b9ef[_0x3387('0x34')]({'plain':!![]});return _0x5944ce['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x44cc24[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](function(_0x17bfca){return db['sequelize'][_0x3387('0x74')](function(_0x1496af){return _0x17bfca[_0x3387('0x6d')](_0x5f4750,{'transaction':_0x1496af})['then'](function(){return BPromise[_0x3387('0x75')](_0x41b409,function(_0x3ce470){return db[_0x3387('0x62')][_0x3387('0x76')]({'where':{'UserId':_0x3ce470['id'],'ChatQueueId':_0x44cc24['params']['id']},'transaction':_0x1496af});});})[_0x3387('0x1d')](function(){_0x41b409['forEach'](function(_0x19dcb9){socket[_0x3387('0x77')](_0x3387('0x78'),{'UserId':_0x19dcb9['id'],'ChatQueueId':_0x17bfca['id']});});});});});}})['then'](respondWithStatusCode(_0x2b03b1,null))[_0x3387('0x4f')](handleError(_0x2b03b1,null));};exports[_0x3387('0x79')]=function(_0x3db160,_0x11b016,_0x181054){return db[_0x3387('0x6c')][_0x3387('0x63')]({'where':{'id':_0x3db160[_0x3387('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3387('0x64')],'as':_0x3387('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x3387('0x1d')](handleEntityNotFound(_0x11b016,null))[_0x3387('0x1d')](function(_0x1c8c71){var _0x3bad20=_[_0x3387('0x3a')](_0x1c8c71,'id');var _0x1e5943=[];var _0x10933d=[];var _0x2327dc=squel[_0x3387('0x7a')]();_0x2327dc[_0x3387('0x7b')](_0x3387('0x7c'))['from'](_0x3387('0x7d'),'tq')['join']('user_has_teams','ut',_0x3387('0x7e'))[_0x3387('0x4a')]('ChatQueueId\x20=\x20?',_0x3db160[_0x3387('0x50')]['id']);for(var _0xc62e4=0x0;_0xc62e4<_0x1c8c71[_0x3387('0x47')];_0xc62e4+=0x1){let _0xd455e8=_0x1c8c71[_0xc62e4];for(var _0xf71d6d=0x0;_0xf71d6d<_0xd455e8[_0x3387('0x6f')][_0x3387('0x47')];_0xf71d6d+=0x1){let _0x3260f9=_0xd455e8[_0x3387('0x6f')][_0xf71d6d];var _0x314f04=_0x2327dc[_0x3387('0x7f')]();_0x314f04[_0x3387('0x4a')](_0x3387('0x80'),_0x3260f9['id']);_0x10933d[_0x3387('0x81')](db[_0x3387('0x82')][_0x3387('0x41')](_0x314f04[_0x3387('0x83')](),{'type':db['sequelize'][_0x3387('0x84')]['SELECT']})['then'](function(_0x2b3dfd){if(_0x2b3dfd[_0x3387('0x47')]===0x1){return _0x3260f9['id'];}else{var _0x3a18be=_['every'](_['map'](_0x2b3dfd,_0x3387('0x85')),function(_0x3eabfb){return _[_0x3387('0x86')](_0x3bad20,_0x3eabfb);});if(_0x3a18be){return _0x3260f9['id'];}}}));}}return BPromise[_0x3387('0x87')](_0x10933d)[_0x3387('0x1d')](function(_0x1bf77c){_0x1e5943=_(_0x1e5943)[_0x3387('0x88')](_0x1bf77c)[_0x3387('0x89')]()['value']();return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x3db160[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](function(_0x4f90bd){return db[_0x3387('0x82')][_0x3387('0x74')](function(_0x14eb9b){return _0x4f90bd[_0x3387('0x79')](_0x3db160[_0x3387('0x41')]['ids'],{'transaction':_0x14eb9b})[_0x3387('0x1d')](function(){if(!_[_0x3387('0x8a')](_0x1e5943)){return _0x4f90bd['removeAgents'](_0x1e5943,{'transaction':_0x14eb9b});}})[_0x3387('0x1d')](function(){_0x1e5943[_0x3387('0x8b')](function(_0x4c6fa8){socket['emit']('userChatQueue:remove',{'UserId':_0x4c6fa8,'ChatQueueId':_0x4f90bd['id']});});});});});});})[_0x3387('0x1d')](respondWithStatusCode(_0x11b016,null))['catch'](handleError(_0x11b016,null));};exports[_0x3387('0x8c')]=function(_0x590142,_0x1d121b,_0x4be0f1){return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x590142[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x1d121b,null))[_0x3387('0x1d')](function(_0x39f964){if(_0x39f964){return _0x39f964['addAgents'](_0x590142['body']['ids'],_['omit'](_0x590142[_0x3387('0x52')],['ids','id'])||{})[_0x3387('0x8d')](function(_0x1aa395){for(var _0x23bc46=0x0;_0x23bc46<_0x590142[_0x3387('0x52')][_0x3387('0x6e')][_0x3387('0x47')];_0x23bc46+=0x1){socket[_0x3387('0x77')](_0x3387('0x78'),{'UserId':Number(_0x590142['body'][_0x3387('0x6e')][_0x23bc46]),'ChatQueueId':Number(_0x590142['params']['id'])});}return _0x1aa395;});}})[_0x3387('0x1d')](respondWithResult(_0x1d121b,null))['catch'](handleError(_0x1d121b,null));};exports[_0x3387('0x8e')]=function(_0x33fc1b,_0x505ae3,_0x2e234b){return db[_0x3387('0x3b')][_0x3387('0x59')]({'where':{'id':_0x33fc1b[_0x3387('0x50')]['id']}})[_0x3387('0x1d')](handleEntityNotFound(_0x505ae3,null))[_0x3387('0x1d')](function(_0x8222d6){if(_0x8222d6){return _0x8222d6[_0x3387('0x8e')](_0x33fc1b['query']['ids'])[_0x3387('0x1d')](function(){if(_[_0x3387('0x8f')](_0x33fc1b['query'][_0x3387('0x6e')])){for(var _0x49628c=0x0;_0x49628c<_0x33fc1b[_0x3387('0x41')][_0x3387('0x6e')][_0x3387('0x47')];_0x49628c+=0x1){socket[_0x3387('0x77')](_0x3387('0x90'),{'UserId':Number(_0x33fc1b[_0x3387('0x41')][_0x3387('0x6e')][_0x49628c]),'ChatQueueId':Number(_0x33fc1b['params']['id'])});}}else{socket[_0x3387('0x77')](_0x3387('0x90'),{'UserId':Number(_0x33fc1b['query']['ids']),'ChatQueueId':Number(_0x33fc1b[_0x3387('0x50')]['id'])});}});}})[_0x3387('0x1d')](respondWithStatusCode(_0x505ae3,null))[_0x3387('0x4f')](handleError(_0x505ae3,null));};exports[_0x3387('0x91')]=function(_0x230cde,_0x52ec0e,_0x5b08c1){var _0x255b82={};var _0x39df75={};var _0xfa3184;var _0x5c7ced;return db[_0x3387('0x3b')][_0x3387('0x5c')]({'where':{'id':_0x230cde[_0x3387('0x50')]['id']}})['then'](handleEntityNotFound(_0x52ec0e,null))[_0x3387('0x1d')](function(_0x4f8cde){if(_0x4f8cde){_0xfa3184=_0x4f8cde;_0x39df75['model']=_[_0x3387('0x42')](db[_0x3387('0x64')][_0x3387('0x3c')]);_0x39df75[_0x3387('0x41')]=_[_0x3387('0x42')](_0x230cde[_0x3387('0x41')]);_0x39df75['filters']=_[_0x3387('0x44')](_0x39df75['model'],_0x39df75[_0x3387('0x41')]);_0x255b82[_0x3387('0x46')]=_[_0x3387('0x44')](_0x39df75['model'],qs[_0x3387('0x45')](_0x230cde[_0x3387('0x41')]['fields']));_0x255b82[_0x3387('0x46')]=_0x255b82[_0x3387('0x46')]['length']?_0x255b82[_0x3387('0x46')]:_0x39df75['model'];_0x255b82[_0x3387('0x5e')]=qs[_0x3387('0x49')](_0x230cde[_0x3387('0x41')][_0x3387('0x49')]);_0x255b82['where']=qs[_0x3387('0x43')](_[_0x3387('0x5f')](_0x230cde['query'],_0x39df75[_0x3387('0x43')]));if(_0x230cde[_0x3387('0x41')]['filter']){_0x255b82['where']=_[_0x3387('0x61')](_0x255b82[_0x3387('0x4a')],{'$or':_[_0x3387('0x3a')](_0x255b82[_0x3387('0x46')],function(_0x24612b){var _0x2ab201={};_0x2ab201[_0x24612b]={'$like':'%'+_0x230cde[_0x3387('0x41')][_0x3387('0x4b')]+'%'};return _0x2ab201;})});}_0x255b82=_[_0x3387('0x61')]({},_0x255b82,_0x230cde['options']);return _0xfa3184['getAgents'](_0x255b82);}})[_0x3387('0x1d')](function(_0x472ad7){if(_0x472ad7){_0x5c7ced=_0x472ad7[_0x3387('0x47')];if(!_0x230cde[_0x3387('0x41')][_0x3387('0x5d')](_0x3387('0x48'))){_0x255b82[_0x3387('0x2c')]=qs['limit'](_0x230cde[_0x3387('0x41')][_0x3387('0x2c')]);_0x255b82[_0x3387('0x2e')]=qs['offset'](_0x230cde[_0x3387('0x41')][_0x3387('0x2e')]);}return _0xfa3184['getAgents'](_0x255b82);}})[_0x3387('0x1d')](function(_0x81b8ff){if(_0x81b8ff){return _0x81b8ff?{'count':_0x5c7ced,'rows':_0x81b8ff}:null;}})[_0x3387('0x1d')](respondWithResult(_0x52ec0e,null))[_0x3387('0x4f')](handleError(_0x52ec0e,null));}; \ No newline at end of file +var _0x16b5=['union','value','isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','ChatQueues','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','ChatQueue','rawAttributes','fieldName','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all'];(function(_0xa91351,_0xaddc7){var _0x34ecf7=function(_0x1fd813){while(--_0x1fd813){_0xa91351['push'](_0xa91351['shift']());}};_0x34ecf7(++_0xaddc7);}(_0x16b5,0x1df));var _0x516b=function(_0x343fe5,_0x589942){_0x343fe5=_0x343fe5-0x0;var _0x3f52e3=_0x16b5[_0x343fe5];return _0x3f52e3;};'use strict';var emlformat=require(_0x516b('0x0'));var rimraf=require(_0x516b('0x1'));var zipdir=require(_0x516b('0x2'));var jsonpatch=require(_0x516b('0x3'));var rp=require('request-promise');var moment=require(_0x516b('0x4'));var BPromise=require(_0x516b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x516b('0x6'));var csv=require(_0x516b('0x7'));var ejs=require(_0x516b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x516b('0x9'));var squel=require(_0x516b('0xa'));var crypto=require('crypto');var jsforce=require(_0x516b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x516b('0x7'));var querystring=require(_0x516b('0xc'));var Papa=require(_0x516b('0xd'));var Redis=require(_0x516b('0xe'));var authService=require(_0x516b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x516b('0x10'));var hardwareService=require(_0x516b('0x11'));var logger=require(_0x516b('0x12'))(_0x516b('0x13'));var utils=require('../../config/utils');var config=require(_0x516b('0x14'));var licenseUtil=require(_0x516b('0x15'));var db=require(_0x516b('0x16'))['db'];config[_0x516b('0x17')]=_[_0x516b('0x18')](config[_0x516b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x516b('0x19'))(new Redis(config[_0x516b('0x17')]));require(_0x516b('0x1a'))[_0x516b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x516b('0x1c')][_0x516b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5516fa,_0xe7b7af,_0x3a3a0b,_0x311f66){return new BPromise(function(_0x182f66,_0x53424f){var _0x54eb56=_0x311f66||client;return _0x54eb56['request'](_0x5516fa,_0x3a3a0b)['then'](function(_0xa9bafa){logger[_0x516b('0x1e')]('ChatQueue,\x20%s,\x20%s',_0xe7b7af,_0x516b('0x1f'));logger['debug'](_0x516b('0x20'),_0xe7b7af,'request\x20sent',JSON[_0x516b('0x21')](_0xa9bafa));if(_0xa9bafa[_0x516b('0x22')]){if(_0xa9bafa[_0x516b('0x22')][_0x516b('0x23')]===0x1f4){logger[_0x516b('0x22')](_0x516b('0x24'),_0xe7b7af,_0xa9bafa[_0x516b('0x22')][_0x516b('0x25')]);return _0x53424f(_0xa9bafa['error'][_0x516b('0x25')]);}logger['error'](_0x516b('0x24'),_0xe7b7af,_0xa9bafa[_0x516b('0x22')]['message']);return _0x182f66(_0xa9bafa['error'][_0x516b('0x25')]);}else{logger[_0x516b('0x1e')]('ChatQueue,\x20%s,\x20%s',_0xe7b7af,'request\x20sent');_0x182f66(_0xa9bafa[_0x516b('0x26')][_0x516b('0x25')]);}})[_0x516b('0x27')](function(_0xbaf7be){logger['error']('ChatQueue,\x20%s,\x20%s',_0xe7b7af,_0xbaf7be);_0x53424f(_0xbaf7be);});});}function respondWithStatusCode(_0xa2e393,_0x23930f){_0x23930f=_0x23930f||0xcc;return function(_0x407981){if(_0x407981){return _0xa2e393['sendStatus'](_0x23930f);}return _0xa2e393['status'](_0x23930f)['end']();};}function respondWithResult(_0x3c657c,_0x5ebffb){_0x5ebffb=_0x5ebffb||0xc8;return function(_0x2d3f5b){if(_0x2d3f5b){return _0x3c657c[_0x516b('0x28')](_0x5ebffb)[_0x516b('0x29')](_0x2d3f5b);}};}function respondWithFilteredResult(_0x7ed982,_0x59365a){return function(_0x34086e){if(_0x34086e){var _0x15ca01=typeof _0x59365a[_0x516b('0x2a')]===_0x516b('0x2b')&&typeof _0x59365a['limit']===_0x516b('0x2b');var _0x4de34f=_0x34086e['count'];var _0x1c086b=_0x15ca01?0x0:_0x59365a[_0x516b('0x2a')];var _0x9cf0d9=_0x15ca01?_0x34086e['count']:_0x59365a[_0x516b('0x2a')]+_0x59365a[_0x516b('0x2c')];var _0x31391c;if(_0x9cf0d9>=_0x4de34f){_0x9cf0d9=_0x4de34f;_0x31391c=0xc8;}else{_0x31391c=0xce;}_0x7ed982[_0x516b('0x28')](_0x31391c);return _0x7ed982['set'](_0x516b('0x2d'),_0x1c086b+'-'+_0x9cf0d9+'/'+_0x4de34f)[_0x516b('0x29')](_0x34086e);}return null;};}function patchUpdates(_0x3ce12c){return function(_0xe216d4){try{jsonpatch[_0x516b('0x2e')](_0xe216d4,_0x3ce12c,!![]);}catch(_0x5358e4){return BPromise[_0x516b('0x2f')](_0x5358e4);}return _0xe216d4[_0x516b('0x30')]();};}function saveUpdates(_0x3b83ab,_0x8557d4){return function(_0x57e6cc){if(_0x57e6cc){return _0x57e6cc[_0x516b('0x31')](_0x3b83ab)[_0x516b('0x32')](function(_0x3bf48b){return _0x3bf48b;});}return null;};}function removeEntity(_0x3f28a7,_0x1aedbc){return function(_0x539706){if(_0x539706){return _0x539706['destroy']()[_0x516b('0x32')](function(){var _0x5e4529=_0x539706[_0x516b('0x33')]({'plain':!![]});var _0x41bd35=_0x516b('0x34');return db[_0x516b('0x35')][_0x516b('0x36')]({'where':{'type':_0x41bd35,'resourceId':_0x5e4529['id']}})['then'](function(){return _0x539706;});})[_0x516b('0x32')](function(){_0x3f28a7[_0x516b('0x28')](0xcc)[_0x516b('0x37')]();});}};}function handleEntityNotFound(_0x46dfea,_0x27db45){return function(_0x5f40ed){if(!_0x5f40ed){_0x46dfea[_0x516b('0x38')](0x194);}return _0x5f40ed;};}function handleError(_0x3e7f9f,_0x2aeede){_0x2aeede=_0x2aeede||0x1f4;return function(_0x2198eb){logger[_0x516b('0x22')](_0x2198eb[_0x516b('0x39')]);if(_0x2198eb[_0x516b('0x3a')]){delete _0x2198eb['name'];}_0x3e7f9f[_0x516b('0x28')](_0x2aeede)[_0x516b('0x3b')](_0x2198eb);};}exports[_0x516b('0x3c')]=function(_0x13a249,_0x1d9986){var _0x2222e9={},_0x576919={},_0x53653a={'count':0x0,'rows':[]};var _0x3bacee=_['map'](db[_0x516b('0x3d')][_0x516b('0x3e')],function(_0x1969af){return{'name':_0x1969af[_0x516b('0x3f')],'type':_0x1969af['type']['key']};});_0x576919[_0x516b('0x40')]=_[_0x516b('0x41')](_0x3bacee,'name');_0x576919['query']=_[_0x516b('0x42')](_0x13a249[_0x516b('0x43')]);_0x576919[_0x516b('0x44')]=_['intersection'](_0x576919[_0x516b('0x40')],_0x576919['query']);_0x2222e9[_0x516b('0x45')]=_[_0x516b('0x46')](_0x576919[_0x516b('0x40')],qs['fields'](_0x13a249[_0x516b('0x43')][_0x516b('0x47')]));_0x2222e9[_0x516b('0x45')]=_0x2222e9[_0x516b('0x45')][_0x516b('0x48')]?_0x2222e9[_0x516b('0x45')]:_0x576919[_0x516b('0x40')];if(!_0x13a249[_0x516b('0x43')][_0x516b('0x49')](_0x516b('0x4a'))){_0x2222e9['limit']=qs[_0x516b('0x2c')](_0x13a249[_0x516b('0x43')][_0x516b('0x2c')]);_0x2222e9[_0x516b('0x2a')]=qs[_0x516b('0x2a')](_0x13a249[_0x516b('0x43')]['offset']);}_0x2222e9['order']=qs['sort'](_0x13a249[_0x516b('0x43')][_0x516b('0x4b')]);_0x2222e9[_0x516b('0x4c')]=qs['filters'](_['pick'](_0x13a249[_0x516b('0x43')],_0x576919[_0x516b('0x44')]),_0x3bacee);if(_0x13a249[_0x516b('0x43')][_0x516b('0x4d')]){_0x2222e9[_0x516b('0x4c')]=_[_0x516b('0x4e')](_0x2222e9[_0x516b('0x4c')],{'$or':_['map'](_0x3bacee,function(_0x3ac9fd){if(_0x3ac9fd[_0x516b('0x4f')]!==_0x516b('0x50')){var _0x5ab787={};_0x5ab787[_0x3ac9fd[_0x516b('0x3a')]]={'$like':'%'+_0x13a249['query'][_0x516b('0x4d')]+'%'};return _0x5ab787;}})});}_0x2222e9=_['merge']({},_0x2222e9,_0x13a249[_0x516b('0x51')]);var _0xdd2978={'where':_0x2222e9['where']};return db[_0x516b('0x3d')][_0x516b('0x52')](_0xdd2978)['then'](function(_0x53e622){_0x53653a[_0x516b('0x52')]=_0x53e622;if(_0x13a249['query'][_0x516b('0x53')]){_0x2222e9['include']=[{'all':!![]}];}return db[_0x516b('0x3d')][_0x516b('0x54')](_0x2222e9);})[_0x516b('0x32')](function(_0x3a0420){_0x53653a[_0x516b('0x55')]=_0x3a0420;return _0x53653a;})[_0x516b('0x32')](respondWithFilteredResult(_0x1d9986,_0x2222e9))[_0x516b('0x27')](handleError(_0x1d9986,null));};exports[_0x516b('0x56')]=function(_0x4b774e,_0x1b1550){var _0x4bf57f={'raw':!![],'where':{'id':_0x4b774e[_0x516b('0x57')]['id']}},_0x4f0b02={};_0x4f0b02[_0x516b('0x40')]=_[_0x516b('0x42')](db[_0x516b('0x3d')][_0x516b('0x3e')]);_0x4f0b02['query']=_[_0x516b('0x42')](_0x4b774e[_0x516b('0x43')]);_0x4f0b02[_0x516b('0x44')]=_['intersection'](_0x4f0b02[_0x516b('0x40')],_0x4f0b02['query']);_0x4bf57f[_0x516b('0x45')]=_[_0x516b('0x46')](_0x4f0b02['model'],qs['fields'](_0x4b774e[_0x516b('0x43')][_0x516b('0x47')]));_0x4bf57f[_0x516b('0x45')]=_0x4bf57f['attributes'][_0x516b('0x48')]?_0x4bf57f['attributes']:_0x4f0b02['model'];if(_0x4b774e[_0x516b('0x43')]['includeAll']){_0x4bf57f[_0x516b('0x58')]=[{'all':!![]}];}_0x4bf57f=_['merge']({},_0x4bf57f,_0x4b774e['options']);return db['ChatQueue'][_0x516b('0x59')](_0x4bf57f)[_0x516b('0x32')](handleEntityNotFound(_0x1b1550,null))[_0x516b('0x32')](respondWithResult(_0x1b1550,null))[_0x516b('0x27')](handleError(_0x1b1550,null));};exports[_0x516b('0x5a')]=function(_0x524287,_0x57696){return db[_0x516b('0x3d')][_0x516b('0x5a')](_0x524287[_0x516b('0x5b')],{})['then'](function(_0x12bbb3){var _0x143e91=_0x524287['user']['get']({'plain':!![]});if(!_0x143e91)throw new Error(_0x516b('0x5c'));if(_0x143e91[_0x516b('0x5d')]===_0x516b('0x5e')){var _0x14c5bf=_0x12bbb3[_0x516b('0x33')]({'plain':!![]});var _0x1fce49='ChatQueues';return db[_0x516b('0x5f')]['find']({'where':{'name':_0x1fce49,'userProfileId':_0x143e91[_0x516b('0x60')]},'raw':!![]})[_0x516b('0x32')](function(_0x21ba9c){if(_0x21ba9c&&_0x21ba9c[_0x516b('0x61')]===0x0){return db[_0x516b('0x35')][_0x516b('0x5a')]({'name':_0x14c5bf[_0x516b('0x3a')],'resourceId':_0x14c5bf['id'],'type':_0x21ba9c[_0x516b('0x3a')],'sectionId':_0x21ba9c['id']},{})[_0x516b('0x32')](function(){return _0x12bbb3;});}else{return _0x12bbb3;}})[_0x516b('0x27')](function(_0x192630){logger[_0x516b('0x22')](_0x516b('0x62'),_0x192630);throw _0x192630;});}return _0x12bbb3;})[_0x516b('0x32')](respondWithResult(_0x57696,0xc9))[_0x516b('0x27')](handleError(_0x57696,null));};exports[_0x516b('0x31')]=function(_0x4a8c98,_0x529182){if(_0x4a8c98[_0x516b('0x5b')]['id']){delete _0x4a8c98[_0x516b('0x5b')]['id'];}return db['ChatQueue'][_0x516b('0x59')]({'where':{'id':_0x4a8c98[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x529182,null))['then'](saveUpdates(_0x4a8c98[_0x516b('0x5b')],null))[_0x516b('0x32')](respondWithResult(_0x529182,null))['catch'](handleError(_0x529182,null));};exports[_0x516b('0x36')]=function(_0x5e2bfe,_0x317467){return db['ChatQueue'][_0x516b('0x59')]({'where':{'id':_0x5e2bfe['params']['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x317467,null))[_0x516b('0x32')](removeEntity(_0x317467,null))['catch'](handleError(_0x317467,null));};exports[_0x516b('0x63')]=function(_0x380f0d,_0x4ab30a){return db[_0x516b('0x3d')][_0x516b('0x63')]()['then'](respondWithResult(_0x4ab30a,null))[_0x516b('0x27')](handleError(_0x4ab30a,null));};exports[_0x516b('0x64')]=function(_0x33550a,_0x426ad7,_0x1325a4){var _0x3cc251={'raw':!![],'where':{}},_0x43a1cb={},_0xa89e2f;return db[_0x516b('0x3d')][_0x516b('0x65')]({'where':{'id':_0x33550a[_0x516b('0x57')]['id']}})['then'](handleEntityNotFound(_0x426ad7,null))[_0x516b('0x32')](function(_0x2d88b4){if(_0x2d88b4){_0xa89e2f=_0x2d88b4[_0x516b('0x33')]({'plain':!![]});_0x43a1cb[_0x516b('0x40')]=_[_0x516b('0x42')](db[_0x516b('0x66')]['rawAttributes']);_0x43a1cb[_0x516b('0x43')]=_[_0x516b('0x42')](_0x33550a['query']);_0x43a1cb[_0x516b('0x44')]=_[_0x516b('0x46')](_0x43a1cb['model'],_0x43a1cb[_0x516b('0x43')]);_0x3cc251[_0x516b('0x45')]=_[_0x516b('0x46')](_0x43a1cb[_0x516b('0x40')],qs[_0x516b('0x47')](_0x33550a['query'][_0x516b('0x47')]));_0x3cc251[_0x516b('0x45')]=_0x3cc251[_0x516b('0x45')][_0x516b('0x48')]?_0x3cc251[_0x516b('0x45')]:_0x43a1cb[_0x516b('0x40')];if(!_0x33550a['query'][_0x516b('0x49')](_0x516b('0x4a'))){_0x3cc251[_0x516b('0x2c')]=qs[_0x516b('0x2c')](_0x33550a[_0x516b('0x43')][_0x516b('0x2c')]);_0x3cc251[_0x516b('0x2a')]=qs[_0x516b('0x2a')](_0x33550a[_0x516b('0x43')][_0x516b('0x2a')]);}_0x3cc251[_0x516b('0x67')]=qs[_0x516b('0x4b')](_0x33550a['query'][_0x516b('0x4b')]);_0x3cc251[_0x516b('0x4c')]=qs[_0x516b('0x44')](_[_0x516b('0x68')](_0x33550a['query'],_0x43a1cb[_0x516b('0x44')]));_0x3cc251['where'][_0x516b('0x69')]=_0x2d88b4['id'];if(_0x33550a[_0x516b('0x43')][_0x516b('0x4d')]){_0x3cc251['where']=_[_0x516b('0x4e')](_0x3cc251['where'],{'$or':_[_0x516b('0x41')](_0x3cc251[_0x516b('0x45')],function(_0xa9d3e4){var _0x58b2ea={};_0x58b2ea[_0xa9d3e4]={'$like':'%'+_0x33550a[_0x516b('0x43')][_0x516b('0x4d')]+'%'};return _0x58b2ea;})});}_0x3cc251=_[_0x516b('0x4e')]({},_0x3cc251,_0x33550a['options']);return db[_0x516b('0x66')][_0x516b('0x54')](_0x3cc251);}})[_0x516b('0x32')](function(_0x47ee6e){if(_0x47ee6e){return db[_0x516b('0x6a')][_0x516b('0x6b')]({'where':{'id':_['map'](_0x47ee6e,_0x516b('0x6c')),'role':_0x516b('0x6d')},'attributes':['id',_0x516b('0x3a'),_0x516b('0x6e'),_0x516b('0x6f'),'createdAt']});}})[_0x516b('0x32')](function(_0x23c06c){if(_0x23c06c){return{'count':_0x23c06c['count'],'rows':_[_0x516b('0x41')](_0x23c06c[_0x516b('0x55')],function(_0x5b261b){return{'membername':_0x5b261b[_0x516b('0x3a')],'UserId':_0x5b261b['id'],'queue_name':_0xa89e2f[_0x516b('0x3a')],'ChatQueueId':_0xa89e2f['id'],'interface':util[_0x516b('0x70')]('%s/%s',_0x516b('0x71'),_0x5b261b[_0x516b('0x3a')]),'penalty':0x0,'paused':_0x5b261b[_0x516b('0x6e')],'createdAt':_0x5b261b[_0x516b('0x72')],'updatedAt':_0x5b261b[_0x516b('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x516b('0x32')](respondWithFilteredResult(_0x426ad7,_0x3cc251))[_0x516b('0x27')](handleError(_0x426ad7,null));};exports[_0x516b('0x73')]=function(_0x11ea01,_0x19bdb0,_0x4a6922){var _0x1415e3={};var _0x37eb3d={};var _0x1308e3;var _0x5007c1;return db[_0x516b('0x3d')][_0x516b('0x65')]({'where':{'id':_0x11ea01[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x19bdb0,null))[_0x516b('0x32')](function(_0x673d8a){if(_0x673d8a){_0x1308e3=_0x673d8a;_0x37eb3d[_0x516b('0x40')]=_[_0x516b('0x42')](db[_0x516b('0x74')][_0x516b('0x3e')]);_0x37eb3d['query']=_[_0x516b('0x42')](_0x11ea01[_0x516b('0x43')]);_0x37eb3d[_0x516b('0x44')]=_[_0x516b('0x46')](_0x37eb3d[_0x516b('0x40')],_0x37eb3d[_0x516b('0x43')]);_0x1415e3[_0x516b('0x45')]=_[_0x516b('0x46')](_0x37eb3d[_0x516b('0x40')],qs[_0x516b('0x47')](_0x11ea01[_0x516b('0x43')]['fields']));_0x1415e3[_0x516b('0x45')]=_0x1415e3[_0x516b('0x45')][_0x516b('0x48')]?_0x1415e3[_0x516b('0x45')]:_0x37eb3d['model'];_0x1415e3[_0x516b('0x67')]=qs['sort'](_0x11ea01[_0x516b('0x43')][_0x516b('0x4b')]);_0x1415e3['where']=qs['filters'](_['pick'](_0x11ea01[_0x516b('0x43')],_0x37eb3d[_0x516b('0x44')]));if(_0x11ea01[_0x516b('0x43')][_0x516b('0x4d')]){_0x1415e3[_0x516b('0x4c')]=_[_0x516b('0x4e')](_0x1415e3['where'],{'$or':_[_0x516b('0x41')](_0x1415e3[_0x516b('0x45')],function(_0x385533){var _0x250d80={};_0x250d80[_0x385533]={'$like':'%'+_0x11ea01['query']['filter']+'%'};return _0x250d80;})});}_0x1415e3=_[_0x516b('0x4e')]({},_0x1415e3,_0x11ea01[_0x516b('0x51')]);return _0x1308e3[_0x516b('0x73')](_0x1415e3);}})['then'](function(_0xddfb0f){if(_0xddfb0f){_0x5007c1=_0xddfb0f[_0x516b('0x48')];if(!_0x11ea01['query'][_0x516b('0x49')]('nolimit')){_0x1415e3[_0x516b('0x2c')]=qs[_0x516b('0x2c')](_0x11ea01['query'][_0x516b('0x2c')]);_0x1415e3[_0x516b('0x2a')]=qs[_0x516b('0x2a')](_0x11ea01[_0x516b('0x43')][_0x516b('0x2a')]);}return _0x1308e3[_0x516b('0x73')](_0x1415e3);}})[_0x516b('0x32')](function(_0x345a25){if(_0x345a25){return _0x345a25?{'count':_0x5007c1,'rows':_0x345a25}:null;}})[_0x516b('0x32')](respondWithResult(_0x19bdb0,null))['catch'](handleError(_0x19bdb0,null));};exports[_0x516b('0x75')]=function(_0x142d3a,_0x8301fd,_0x7910c3){var _0x2d69af=_0x142d3a['body'][_0x516b('0x76')];return db[_0x516b('0x74')][_0x516b('0x54')]({'where':{'id':_0x2d69af},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x516b('0x3a'),_0x516b('0x77'),_0x516b('0x78'),_0x516b('0x79')],'raw':!![]}]})[_0x516b('0x32')](function(_0x3063e7){if(_0x3063e7){var _0x2cebce=_[_0x516b('0x7a')](_0x3063e7,function(_0x2fac04){var _0x7c28d9=_0x2fac04['get']({'plain':!![]});return _0x7c28d9[_0x516b('0x7b')];});return db['ChatQueue'][_0x516b('0x59')]({'where':{'id':_0x142d3a[_0x516b('0x57')]['id']}})[_0x516b('0x32')](function(_0xdfbcd){return db[_0x516b('0x7c')][_0x516b('0x7d')](function(_0x2b6e84){return _0xdfbcd[_0x516b('0x75')](_0x2d69af,{'transaction':_0x2b6e84})['then'](function(){return BPromise['each'](_0x2cebce,function(_0x4af78d){return db['UserChatQueue'][_0x516b('0x7e')]({'where':{'UserId':_0x4af78d['id'],'ChatQueueId':_0x142d3a['params']['id']},'transaction':_0x2b6e84});});})[_0x516b('0x32')](function(){_0x2cebce[_0x516b('0x7f')](function(_0x53e6d2){socket[_0x516b('0x80')]('userChatQueue:save',{'UserId':_0x53e6d2['id'],'ChatQueueId':_0xdfbcd['id']});});});});});}})[_0x516b('0x32')](respondWithStatusCode(_0x8301fd,null))['catch'](handleError(_0x8301fd,null));};exports[_0x516b('0x81')]=function(_0x2d1b69,_0x338f69,_0x33ea81){return db[_0x516b('0x74')][_0x516b('0x54')]({'where':{'id':_0x2d1b69[_0x516b('0x43')][_0x516b('0x76')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x516b('0x7b'),'attributes':['id'],'raw':!![]}]})[_0x516b('0x32')](handleEntityNotFound(_0x338f69,null))[_0x516b('0x32')](function(_0x2357b7){var _0x53c5fb=_['map'](_0x2357b7,'id');var _0x2b9535=[];var _0x49189d=[];var _0x25d6f6=squel[_0x516b('0x82')]();_0x25d6f6[_0x516b('0x83')](_0x516b('0x84'))[_0x516b('0x85')]('team_has_chat_queues','tq')['join'](_0x516b('0x86'),'ut',_0x516b('0x87'))[_0x516b('0x4c')](_0x516b('0x88'),_0x2d1b69['params']['id']);for(var _0x1a6bf2=0x0;_0x1a6bf2<_0x2357b7['length'];_0x1a6bf2+=0x1){let _0x5997bc=_0x2357b7[_0x1a6bf2];for(var _0xfaebf3=0x0;_0xfaebf3<_0x5997bc[_0x516b('0x7b')][_0x516b('0x48')];_0xfaebf3+=0x1){let _0x3f8df6=_0x5997bc['Agents'][_0xfaebf3];var _0x2e660f=_0x25d6f6[_0x516b('0x89')]();_0x2e660f['where'](_0x516b('0x8a'),_0x3f8df6['id']);_0x49189d[_0x516b('0x8b')](db[_0x516b('0x7c')][_0x516b('0x43')](_0x2e660f[_0x516b('0x8c')](),{'type':db['sequelize']['QueryTypes'][_0x516b('0x8d')]})[_0x516b('0x32')](function(_0x1f17fa){if(_0x1f17fa[_0x516b('0x48')]===0x1){return _0x3f8df6['id'];}else{var _0x85eeef=_['every'](_[_0x516b('0x41')](_0x1f17fa,_0x516b('0x8e')),function(_0x5b7b28){return _[_0x516b('0x8f')](_0x53c5fb,_0x5b7b28);});if(_0x85eeef){return _0x3f8df6['id'];}}}));}}return BPromise[_0x516b('0x90')](_0x49189d)[_0x516b('0x32')](function(_0x408881){_0x2b9535=_(_0x2b9535)[_0x516b('0x91')](_0x408881)['compact']()[_0x516b('0x92')]();return db[_0x516b('0x3d')][_0x516b('0x59')]({'where':{'id':_0x2d1b69[_0x516b('0x57')]['id']}})['then'](function(_0x36f337){return db[_0x516b('0x7c')]['transaction'](function(_0x3622a1){return _0x36f337[_0x516b('0x81')](_0x2d1b69[_0x516b('0x43')]['ids'],{'transaction':_0x3622a1})[_0x516b('0x32')](function(){if(!_[_0x516b('0x93')](_0x2b9535)){return _0x36f337[_0x516b('0x94')](_0x2b9535,{'transaction':_0x3622a1});}})[_0x516b('0x32')](function(){_0x2b9535[_0x516b('0x7f')](function(_0x41ae07){socket[_0x516b('0x80')]('userChatQueue:remove',{'UserId':_0x41ae07,'ChatQueueId':_0x36f337['id']});});});});});});})['then'](respondWithStatusCode(_0x338f69,null))[_0x516b('0x27')](handleError(_0x338f69,null));};exports['addAgents']=function(_0x58387b,_0x3ca014,_0x38cf92){return db[_0x516b('0x3d')][_0x516b('0x59')]({'where':{'id':_0x58387b[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0x3ca014,null))[_0x516b('0x32')](function(_0x5f04f6){if(_0x5f04f6){return _0x5f04f6[_0x516b('0x95')](_0x58387b[_0x516b('0x5b')][_0x516b('0x76')],_[_0x516b('0x96')](_0x58387b['body'],[_0x516b('0x76'),'id'])||{})[_0x516b('0x97')](function(_0xe9b825){for(var _0x111e2d=0x0;_0x111e2d<_0x58387b[_0x516b('0x5b')]['ids'][_0x516b('0x48')];_0x111e2d+=0x1){socket[_0x516b('0x80')](_0x516b('0x98'),{'UserId':Number(_0x58387b[_0x516b('0x5b')][_0x516b('0x76')][_0x111e2d]),'ChatQueueId':Number(_0x58387b['params']['id'])});}return _0xe9b825;});}})[_0x516b('0x32')](respondWithResult(_0x3ca014,null))['catch'](handleError(_0x3ca014,null));};exports[_0x516b('0x94')]=function(_0x199a43,_0xf1b882,_0x3fdca2){return db[_0x516b('0x3d')][_0x516b('0x59')]({'where':{'id':_0x199a43[_0x516b('0x57')]['id']}})[_0x516b('0x32')](handleEntityNotFound(_0xf1b882,null))['then'](function(_0x53e9d9){if(_0x53e9d9){return _0x53e9d9['removeAgents'](_0x199a43[_0x516b('0x43')][_0x516b('0x76')])['then'](function(){if(_[_0x516b('0x99')](_0x199a43[_0x516b('0x43')]['ids'])){for(var _0x560f66=0x0;_0x560f66<_0x199a43['query'][_0x516b('0x76')]['length'];_0x560f66+=0x1){socket['emit'](_0x516b('0x9a'),{'UserId':Number(_0x199a43[_0x516b('0x43')]['ids'][_0x560f66]),'ChatQueueId':Number(_0x199a43[_0x516b('0x57')]['id'])});}}else{socket[_0x516b('0x80')](_0x516b('0x9a'),{'UserId':Number(_0x199a43[_0x516b('0x43')]['ids']),'ChatQueueId':Number(_0x199a43[_0x516b('0x57')]['id'])});}});}})[_0x516b('0x32')](respondWithStatusCode(_0xf1b882,null))['catch'](handleError(_0xf1b882,null));};exports[_0x516b('0x9b')]=function(_0x214a64,_0x461da6,_0x6ab9f7){var _0x2b2aed={};var _0x39fca9={};var _0x9230;var _0x38f703;return db[_0x516b('0x3d')][_0x516b('0x65')]({'where':{'id':_0x214a64[_0x516b('0x57')]['id']}})['then'](handleEntityNotFound(_0x461da6,null))[_0x516b('0x32')](function(_0x2dcaf2){if(_0x2dcaf2){_0x9230=_0x2dcaf2;_0x39fca9[_0x516b('0x40')]=_['keys'](db[_0x516b('0x6a')][_0x516b('0x3e')]);_0x39fca9[_0x516b('0x43')]=_['keys'](_0x214a64[_0x516b('0x43')]);_0x39fca9[_0x516b('0x44')]=_[_0x516b('0x46')](_0x39fca9[_0x516b('0x40')],_0x39fca9[_0x516b('0x43')]);_0x2b2aed[_0x516b('0x45')]=_[_0x516b('0x46')](_0x39fca9[_0x516b('0x40')],qs['fields'](_0x214a64[_0x516b('0x43')]['fields']));_0x2b2aed[_0x516b('0x45')]=_0x2b2aed['attributes'][_0x516b('0x48')]?_0x2b2aed['attributes']:_0x39fca9[_0x516b('0x40')];_0x2b2aed[_0x516b('0x67')]=qs[_0x516b('0x4b')](_0x214a64[_0x516b('0x43')][_0x516b('0x4b')]);_0x2b2aed[_0x516b('0x4c')]=qs[_0x516b('0x44')](_['pick'](_0x214a64[_0x516b('0x43')],_0x39fca9[_0x516b('0x44')]));if(_0x214a64[_0x516b('0x43')]['filter']){_0x2b2aed['where']=_[_0x516b('0x4e')](_0x2b2aed[_0x516b('0x4c')],{'$or':_[_0x516b('0x41')](_0x2b2aed[_0x516b('0x45')],function(_0x1e5e55){var _0x2d16ff={};_0x2d16ff[_0x1e5e55]={'$like':'%'+_0x214a64[_0x516b('0x43')][_0x516b('0x4d')]+'%'};return _0x2d16ff;})});}_0x2b2aed=_[_0x516b('0x4e')]({},_0x2b2aed,_0x214a64[_0x516b('0x51')]);return _0x9230['getAgents'](_0x2b2aed);}})['then'](function(_0x54c931){if(_0x54c931){_0x38f703=_0x54c931[_0x516b('0x48')];if(!_0x214a64[_0x516b('0x43')][_0x516b('0x49')](_0x516b('0x4a'))){_0x2b2aed[_0x516b('0x2c')]=qs[_0x516b('0x2c')](_0x214a64[_0x516b('0x43')]['limit']);_0x2b2aed['offset']=qs[_0x516b('0x2a')](_0x214a64[_0x516b('0x43')][_0x516b('0x2a')]);}return _0x9230['getAgents'](_0x2b2aed);}})[_0x516b('0x32')](function(_0x2b5d94){if(_0x2b5d94){return _0x2b5d94?{'count':_0x38f703,'rows':_0x2b5d94}:null;}})[_0x516b('0x32')](respondWithResult(_0x461da6,null))['catch'](handleError(_0x461da6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index aa78211..638e6a4 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 _0x844d=['setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x34046c,_0x283124){var _0x5d4d17=function(_0x172fc1){while(--_0x172fc1){_0x34046c['push'](_0x34046c['shift']());}};_0x5d4d17(++_0x283124);}(_0x844d,0x1df));var _0xd844=function(_0x35ba71,_0xa2fbbd){_0x35ba71=_0x35ba71-0x0;var _0x5f04f4=_0x844d[_0x35ba71];return _0x5f04f4;};'use strict';var EventEmitter=require(_0xd844('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd844('0x1')](0x0);var events={'afterCreate':_0xd844('0x2'),'afterUpdate':_0xd844('0x3'),'afterDestroy':_0xd844('0x4')};function emitEvent(_0x5d1d64){return function(_0x4c07d0,_0x373ed1,_0x5a6ef2){ChatQueueEvents[_0xd844('0x5')](_0x5d1d64+':'+_0x4c07d0['id'],_0x4c07d0);ChatQueueEvents[_0xd844('0x5')](_0x5d1d64,_0x4c07d0);_0x5a6ef2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd844('0x6')](e,emitEvent(event));}}module[_0xd844('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x723e=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x43e271,_0x1bb3a2){var _0xd9efbd=function(_0x56ad2b){while(--_0x56ad2b){_0x43e271['push'](_0x43e271['shift']());}};_0xd9efbd(++_0x1bb3a2);}(_0x723e,0xd2));var _0xe723=function(_0x4f4c11,_0xdb6add){_0x4f4c11=_0x4f4c11-0x0;var _0x4dfd33=_0x723e[_0x4f4c11];return _0x4dfd33;};'use strict';var EventEmitter=require(_0xe723('0x0'));var ChatQueue=require(_0xe723('0x1'))['db'][_0xe723('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe723('0x3')](0x0);var events={'afterCreate':_0xe723('0x4'),'afterUpdate':'update','afterDestroy':_0xe723('0x5')};function emitEvent(_0x38559a){return function(_0x31cfa1,_0x5b1c10,_0x407867){ChatQueueEvents[_0xe723('0x6')](_0x38559a+':'+_0x31cfa1['id'],_0x31cfa1);ChatQueueEvents['emit'](_0x38559a,_0x31cfa1);_0x407867(null);};}for(var e in events){if(events[_0xe723('0x7')](e)){var event=events[e];ChatQueue[_0xe723('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index f018066..3cc6777 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 _0xb220=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','path','../../config/environment'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xb220,0x14f));var _0x0b22=function(_0x435b4c,_0x2909d7){_0x435b4c=_0x435b4c-0x0;var _0x4440d4=_0xb220[_0x435b4c];return _0x4440d4;};'use strict';var _=require(_0x0b22('0x0'));var util=require(_0x0b22('0x1'));var logger=require('../../config/logger')(_0x0b22('0x2'));var moment=require(_0x0b22('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b22('0x4'));var rimraf=require('rimraf');var config=require(_0x0b22('0x5'));var attributes=require(_0x0b22('0x6'));module[_0x0b22('0x7')]=function(_0xf27b09,_0x41a457){return _0xf27b09[_0x0b22('0x8')](_0x0b22('0x9'),attributes,{'tableName':_0x0b22('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc47=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ChatQueue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xfc47,0xaa));var _0x7fc4=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0xfc47[_0xd02def];return _0x2e8374;};'use strict';var _=require('lodash');var util=require(_0x7fc4('0x0'));var logger=require(_0x7fc4('0x1'))(_0x7fc4('0x2'));var moment=require(_0x7fc4('0x3'));var BPromise=require(_0x7fc4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7fc4('0x5'));var rimraf=require(_0x7fc4('0x6'));var config=require(_0x7fc4('0x7'));var attributes=require('./chatQueue.attributes');module[_0x7fc4('0x8')]=function(_0x13e7cc,_0x5bd2af){return _0x13e7cc['define'](_0x7fc4('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 1627900..d427690 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 _0x3ef7=['ShowChatQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x3ef7,0xa2));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require(_0x73ef('0x1'));var BPromise=require(_0x73ef('0x2'));var rs=require(_0x73ef('0x3'));var fs=require('fs');var Redis=require(_0x73ef('0x4'));var db=require(_0x73ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ef('0x6'))(_0x73ef('0x7'));var config=require(_0x73ef('0x8'));var jayson=require(_0x73ef('0x9'));var client=jayson['client'][_0x73ef('0xa')]({'port':0x232a});config[_0x73ef('0xb')]=_[_0x73ef('0xc')](config[_0x73ef('0xb')],{'host':_0x73ef('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73ef('0xb')]));require(_0x73ef('0xe'))['register'](socket);function respondWithRpcPromise(_0x1055e1,_0x21bfed,_0x364470){return new BPromise(function(_0x3bd4c9,_0x33aa09){return client['request'](_0x1055e1,_0x364470)[_0x73ef('0xf')](function(_0x111ce3){logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));logger[_0x73ef('0x13')](_0x73ef('0x14'),_0x21bfed,_0x73ef('0x12'),JSON[_0x73ef('0x15')](_0x111ce3));if(_0x111ce3[_0x73ef('0x16')]){if(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x17')]===0x1f4){logger[_0x73ef('0x16')]('ChatQueue,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')]['message']);return _0x33aa09(_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);}logger[_0x73ef('0x16')]('ChatQueue,\x20%s,\x20%s',_0x21bfed,_0x111ce3[_0x73ef('0x16')][_0x73ef('0x18')]);return _0x3bd4c9(_0x111ce3['error'][_0x73ef('0x18')]);}else{logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x21bfed,_0x73ef('0x12'));_0x3bd4c9(_0x111ce3[_0x73ef('0x19')]['message']);}})[_0x73ef('0x1a')](function(_0x4dc000){logger[_0x73ef('0x16')]('ChatQueue,\x20%s,\x20%s',_0x21bfed,_0x4dc000);_0x33aa09(_0x4dc000);});});}exports[_0x73ef('0x1b')]=function(_0x2168ec){var _0x36d02f=this;return new Promise(function(_0x2c4d28,_0x35d733){return db[_0x73ef('0x1c')][_0x73ef('0x1d')]({'raw':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec['options'][_0x73ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x20')]||null:null,'attributes':_0x2168ec['options']?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x21')]||null:null,'limit':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x22')]||null:null,'include':_0x2168ec[_0x73ef('0x1e')]?_0x2168ec[_0x73ef('0x1e')][_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x2168ec[_0x73ef('0x1e')]['include'],function(_0x2f9cae){return{'model':db[_0x2f9cae[_0x73ef('0x25')]],'as':_0x2f9cae['as'],'attributes':_0x2f9cae['attributes'],'include':_0x2f9cae['include']?_[_0x73ef('0x24')](_0x2f9cae['include'],function(_0x592e57){return{'model':db[_0x592e57[_0x73ef('0x25')]],'as':_0x592e57['as'],'attributes':_0x592e57[_0x73ef('0x21')],'include':_0x592e57[_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x592e57['include'],function(_0x35462d){return{'model':db[_0x35462d['model']],'as':_0x35462d['as'],'attributes':_0x35462d[_0x73ef('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x946100){logger[_0x73ef('0x10')](_0x73ef('0x1b'),_0x2168ec);logger[_0x73ef('0x13')](_0x73ef('0x1b'),_0x2168ec,JSON[_0x73ef('0x15')](_0x946100));_0x2c4d28(_0x946100);})[_0x73ef('0x1a')](function(_0x557b5d){logger[_0x73ef('0x16')](_0x73ef('0x1b'),_0x557b5d[_0x73ef('0x18')],_0x2168ec);_0x35d733(_0x36d02f['error'](0x1f4,_0x557b5d['message']));});});};exports[_0x73ef('0x26')]=function(_0x44b8c3){var _0x5f39e3=this;return new Promise(function(_0x252d1a,_0x589c4e){return db[_0x73ef('0x1c')][_0x73ef('0x27')]({'raw':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3['options'][_0x73ef('0x1f')]===undefined?!![]:![]:!![],'where':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3['options'][_0x73ef('0x20')]||null:null,'attributes':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3[_0x73ef('0x1e')]['attributes']||null:null,'include':_0x44b8c3[_0x73ef('0x1e')]?_0x44b8c3[_0x73ef('0x1e')][_0x73ef('0x23')]?_['map'](_0x44b8c3[_0x73ef('0x1e')][_0x73ef('0x23')],function(_0x4100fb){return{'model':db[_0x4100fb[_0x73ef('0x25')]],'as':_0x4100fb['as'],'attributes':_0x4100fb[_0x73ef('0x21')],'include':_0x4100fb[_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x4100fb[_0x73ef('0x23')],function(_0x459306){return{'model':db[_0x459306[_0x73ef('0x25')]],'as':_0x459306['as'],'attributes':_0x459306['attributes'],'include':_0x459306[_0x73ef('0x23')]?_[_0x73ef('0x24')](_0x459306[_0x73ef('0x23')],function(_0x50a986){return{'model':db[_0x50a986[_0x73ef('0x25')]],'as':_0x50a986['as'],'attributes':_0x50a986[_0x73ef('0x21')]};}):[]};}):[]};}):[]:[]})[_0x73ef('0xf')](function(_0x1303d9){logger[_0x73ef('0x10')]('ShowChatQueue',_0x44b8c3);logger['debug']('ShowChatQueue',_0x44b8c3,JSON[_0x73ef('0x15')](_0x1303d9));_0x252d1a(_0x1303d9);})[_0x73ef('0x1a')](function(_0x4e277c){logger[_0x73ef('0x16')](_0x73ef('0x26'),_0x4e277c[_0x73ef('0x18')],_0x44b8c3);_0x589c4e(_0x5f39e3['error'](0x1f4,_0x4e277c[_0x73ef('0x18')]));});});}; \ No newline at end of file +var _0xb627=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetChatQueue','ChatQueue','findAll','raw','options','attributes','include','map','model','catch','ShowChatQueue'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xb627,0x144));var _0x7b62=function(_0x362c28,_0x409626){_0x362c28=_0x362c28-0x0;var _0x183a40=_0xb627[_0x362c28];return _0x183a40;};'use strict';var _=require(_0x7b62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b62('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b62('0x2'));var db=require(_0x7b62('0x3'))['db'];var utils=require(_0x7b62('0x4'));var logger=require(_0x7b62('0x5'))(_0x7b62('0x6'));var config=require(_0x7b62('0x7'));var jayson=require(_0x7b62('0x8'));var client=jayson['client'][_0x7b62('0x9')]({'port':0x232a});config['redis']=_[_0x7b62('0xa')](config[_0x7b62('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7b62('0xc'))(new Redis(config['redis']));require(_0x7b62('0xd'))[_0x7b62('0xe')](socket);function respondWithRpcPromise(_0x1e1fd0,_0x5a1f7e,_0x19fe5c){return new BPromise(function(_0xe5c80e,_0x20a8dc){return client[_0x7b62('0xf')](_0x1e1fd0,_0x19fe5c)[_0x7b62('0x10')](function(_0x1f36fd){logger[_0x7b62('0x11')](_0x7b62('0x12'),_0x5a1f7e,_0x7b62('0x13'));logger[_0x7b62('0x14')](_0x7b62('0x15'),_0x5a1f7e,_0x7b62('0x13'),JSON[_0x7b62('0x16')](_0x1f36fd));if(_0x1f36fd['error']){if(_0x1f36fd[_0x7b62('0x17')]['code']===0x1f4){logger[_0x7b62('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5a1f7e,_0x1f36fd[_0x7b62('0x17')]['message']);return _0x20a8dc(_0x1f36fd['error'][_0x7b62('0x18')]);}logger['error'](_0x7b62('0x12'),_0x5a1f7e,_0x1f36fd[_0x7b62('0x17')][_0x7b62('0x18')]);return _0xe5c80e(_0x1f36fd['error'][_0x7b62('0x18')]);}else{logger['info'](_0x7b62('0x12'),_0x5a1f7e,_0x7b62('0x13'));_0xe5c80e(_0x1f36fd['result'][_0x7b62('0x18')]);}})['catch'](function(_0x1af762){logger[_0x7b62('0x17')](_0x7b62('0x12'),_0x5a1f7e,_0x1af762);_0x20a8dc(_0x1af762);});});}exports[_0x7b62('0x19')]=function(_0x472849){var _0x5e4bea=this;return new Promise(function(_0x30e81e,_0x229819){return db[_0x7b62('0x1a')][_0x7b62('0x1b')]({'raw':_0x472849['options']?_0x472849['options'][_0x7b62('0x1c')]===undefined?!![]:![]:!![],'where':_0x472849[_0x7b62('0x1d')]?_0x472849[_0x7b62('0x1d')]['where']||null:null,'attributes':_0x472849['options']?_0x472849[_0x7b62('0x1d')][_0x7b62('0x1e')]||null:null,'limit':_0x472849[_0x7b62('0x1d')]?_0x472849['options']['limit']||null:null,'include':_0x472849['options']?_0x472849[_0x7b62('0x1d')][_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x472849[_0x7b62('0x1d')][_0x7b62('0x1f')],function(_0x5144d1){return{'model':db[_0x5144d1[_0x7b62('0x21')]],'as':_0x5144d1['as'],'attributes':_0x5144d1[_0x7b62('0x1e')],'include':_0x5144d1['include']?_['map'](_0x5144d1[_0x7b62('0x1f')],function(_0x26c00a){return{'model':db[_0x26c00a[_0x7b62('0x21')]],'as':_0x26c00a['as'],'attributes':_0x26c00a[_0x7b62('0x1e')],'include':_0x26c00a[_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x26c00a['include'],function(_0x1d009d){return{'model':db[_0x1d009d[_0x7b62('0x21')]],'as':_0x1d009d['as'],'attributes':_0x1d009d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b62('0x10')](function(_0x120f10){logger['info'](_0x7b62('0x19'),_0x472849);logger[_0x7b62('0x14')](_0x7b62('0x19'),_0x472849,JSON['stringify'](_0x120f10));_0x30e81e(_0x120f10);})[_0x7b62('0x22')](function(_0x10c503){logger[_0x7b62('0x17')](_0x7b62('0x19'),_0x10c503[_0x7b62('0x18')],_0x472849);_0x229819(_0x5e4bea[_0x7b62('0x17')](0x1f4,_0x10c503[_0x7b62('0x18')]));});});};exports[_0x7b62('0x23')]=function(_0x26cd5c){var _0x80def9=this;return new Promise(function(_0xe15fed,_0x143983){return db[_0x7b62('0x1a')]['find']({'raw':_0x26cd5c[_0x7b62('0x1d')]?_0x26cd5c[_0x7b62('0x1d')][_0x7b62('0x1c')]===undefined?!![]:![]:!![],'where':_0x26cd5c[_0x7b62('0x1d')]?_0x26cd5c[_0x7b62('0x1d')]['where']||null:null,'attributes':_0x26cd5c['options']?_0x26cd5c[_0x7b62('0x1d')][_0x7b62('0x1e')]||null:null,'include':_0x26cd5c[_0x7b62('0x1d')]?_0x26cd5c['options'][_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x26cd5c['options'][_0x7b62('0x1f')],function(_0x312dfa){return{'model':db[_0x312dfa[_0x7b62('0x21')]],'as':_0x312dfa['as'],'attributes':_0x312dfa['attributes'],'include':_0x312dfa[_0x7b62('0x1f')]?_[_0x7b62('0x20')](_0x312dfa['include'],function(_0x180171){return{'model':db[_0x180171[_0x7b62('0x21')]],'as':_0x180171['as'],'attributes':_0x180171[_0x7b62('0x1e')],'include':_0x180171['include']?_[_0x7b62('0x20')](_0x180171[_0x7b62('0x1f')],function(_0x45bf81){return{'model':db[_0x45bf81[_0x7b62('0x21')]],'as':_0x45bf81['as'],'attributes':_0x45bf81[_0x7b62('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7b62('0x10')](function(_0xc89f6d){logger[_0x7b62('0x11')](_0x7b62('0x23'),_0x26cd5c);logger[_0x7b62('0x14')](_0x7b62('0x23'),_0x26cd5c,JSON[_0x7b62('0x16')](_0xc89f6d));_0xe15fed(_0xc89f6d);})[_0x7b62('0x22')](function(_0xd20ca8){logger[_0x7b62('0x17')](_0x7b62('0x23'),_0xd20ca8[_0x7b62('0x18')],_0x26cd5c);_0x143983(_0x80def9[_0x7b62('0x17')](0x1f4,_0xd20ca8[_0x7b62('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index a370aea..a03c118 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 _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x48952d,_0x3a8b6e){var _0x162322=function(_0x550109){while(--_0x550109){_0x48952d['push'](_0x48952d['shift']());}};_0x162322(++_0x3a8b6e);}(_0x80d9,0x15c));var _0x980d=function(_0x35db9b,_0x2e26e3){_0x35db9b=_0x35db9b-0x0;var _0x495ec1=_0x80d9[_0x35db9b];return _0x495ec1;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}}; \ No newline at end of file +var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5cbb15,_0x4861b4){_0x5cbb15=_0x5cbb15-0x0;var _0x51c839=_0x9bde[_0x5cbb15];return _0x51c839;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 6fef504..d168b74 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x5fc3[_0x1b1a3b];return _0x385347;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _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(_0x8a3327,_0xcec090){var _0x444e06=function(_0x1c355e){while(--_0x1c355e){_0x8a3327['push'](_0x8a3327['shift']());}};_0x444e06(++_0xcec090);}(_0x55ca,0x126));var _0xa55c=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x55ca[_0x51d129];return _0x44c377;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index f6e0ab9..eff641a 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 _0x0b6b=['DATE','moment','STRING'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x0b6b,0xdf));var _0xb0b6=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x0b6b[_0x644ecd];return _0x1c66ce;};'use strict';var moment=require(_0xb0b6('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb0b6('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb0b6('0x1')]},'joinAt':{'type':Sequelize[_0xb0b6('0x2')]},'leaveAt':{'type':Sequelize[_0xb0b6('0x2')]},'acceptAt':{'type':Sequelize[_0xb0b6('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7f00=['exports','STRING','DATE','moment','sequelize'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7f00,0x161));var _0x07f0=function(_0x2cc21c,_0x4ceefa){_0x2cc21c=_0x2cc21c-0x0;var _0x59e4ea=_0x7f00[_0x2cc21c];return _0x59e4ea;};'use strict';var moment=require(_0x07f0('0x0'));var Sequelize=require(_0x07f0('0x1'));module[_0x07f0('0x2')]={'uniqueid':{'type':Sequelize[_0x07f0('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x07f0('0x4')]},'acceptAt':{'type':Sequelize[_0x07f0('0x4')]},'exitAt':{'type':Sequelize[_0x07f0('0x4')]},'reason':{'type':Sequelize[_0x07f0('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 2d074b1..783760e 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 _0x06ae=['ChatQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','name','index','map'];(function(_0x2965b7,_0x571a43){var _0x2b729c=function(_0x25625a){while(--_0x25625a){_0x2965b7['push'](_0x2965b7['shift']());}};_0x2b729c(++_0x571a43);}(_0x06ae,0x16e));var _0xe06a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x06ae[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe06a('0x0'));var zipdir=require(_0xe06a('0x1'));var jsonpatch=require(_0xe06a('0x2'));var rp=require(_0xe06a('0x3'));var moment=require(_0xe06a('0x4'));var BPromise=require(_0xe06a('0x5'));var Mustache=require(_0xe06a('0x6'));var util=require(_0xe06a('0x7'));var path=require(_0xe06a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe06a('0x9'));var _=require(_0xe06a('0xa'));var squel=require(_0xe06a('0xb'));var crypto=require(_0xe06a('0xc'));var jsforce=require(_0xe06a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe06a('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe06a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe06a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe06a('0x11'))(_0xe06a('0x12'));var utils=require('../../config/utils');var config=require(_0xe06a('0x13'));var licenseUtil=require(_0xe06a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb402c7,_0x87ff63){_0x87ff63=_0x87ff63||0xcc;return function(_0x3aaf53){if(_0x3aaf53){return _0xb402c7['sendStatus'](_0x87ff63);}return _0xb402c7[_0xe06a('0x15')](_0x87ff63)[_0xe06a('0x16')]();};}function respondWithResult(_0x359273,_0xf8a9a7){_0xf8a9a7=_0xf8a9a7||0xc8;return function(_0x335c0d){if(_0x335c0d){return _0x359273['status'](_0xf8a9a7)[_0xe06a('0x17')](_0x335c0d);}};}function respondWithFilteredResult(_0x1080da,_0x171b77){return function(_0xe471a9){if(_0xe471a9){var _0x4d0e41=typeof _0x171b77[_0xe06a('0x18')]==='undefined'&&typeof _0x171b77[_0xe06a('0x19')]==='undefined';var _0x534380=_0xe471a9['count'];var _0x7a5a6f=_0x4d0e41?0x0:_0x171b77[_0xe06a('0x18')];var _0xc62c1f=_0x4d0e41?_0xe471a9['count']:_0x171b77[_0xe06a('0x18')]+_0x171b77[_0xe06a('0x19')];var _0x5806b6;if(_0xc62c1f>=_0x534380){_0xc62c1f=_0x534380;_0x5806b6=0xc8;}else{_0x5806b6=0xce;}_0x1080da[_0xe06a('0x15')](_0x5806b6);return _0x1080da['set'](_0xe06a('0x1a'),_0x7a5a6f+'-'+_0xc62c1f+'/'+_0x534380)['json'](_0xe471a9);}return null;};}function patchUpdates(_0x550ff8){return function(_0x70d702){try{jsonpatch[_0xe06a('0x1b')](_0x70d702,_0x550ff8,!![]);}catch(_0x1e7f25){return BPromise[_0xe06a('0x1c')](_0x1e7f25);}return _0x70d702[_0xe06a('0x1d')]();};}function saveUpdates(_0xd2adcd,_0x2ab25f){return function(_0x2c30c7){if(_0x2c30c7){return _0x2c30c7[_0xe06a('0x1e')](_0xd2adcd)[_0xe06a('0x1f')](function(_0x5970d9){return _0x5970d9;});}return null;};}function removeEntity(_0xd6bf1,_0x31c2cb){return function(_0xf13325){if(_0xf13325){return _0xf13325[_0xe06a('0x20')]()[_0xe06a('0x1f')](function(){_0xd6bf1[_0xe06a('0x15')](0xcc)[_0xe06a('0x16')]();});}};}function handleEntityNotFound(_0x19a7e0,_0x456d2d){return function(_0x4ef4ca){if(!_0x4ef4ca){_0x19a7e0['sendStatus'](0x194);}return _0x4ef4ca;};}function handleError(_0x42453d,_0x552310){_0x552310=_0x552310||0x1f4;return function(_0x319e25){logger['error'](_0x319e25['stack']);if(_0x319e25['name']){delete _0x319e25[_0xe06a('0x21')];}_0x42453d[_0xe06a('0x15')](_0x552310)['send'](_0x319e25);};}exports[_0xe06a('0x22')]=function(_0x1613d8,_0x4506b3){var _0x1c5964={},_0x15cf61={},_0x3a3568={'count':0x0,'rows':[]};var _0x3b95a4=_[_0xe06a('0x23')](db[_0xe06a('0x24')]['rawAttributes'],function(_0x4bee48){return{'name':_0x4bee48[_0xe06a('0x25')],'type':_0x4bee48[_0xe06a('0x26')][_0xe06a('0x27')]};});_0x15cf61[_0xe06a('0x28')]=_['map'](_0x3b95a4,_0xe06a('0x21'));_0x15cf61['query']=_[_0xe06a('0x29')](_0x1613d8[_0xe06a('0x2a')]);_0x15cf61[_0xe06a('0x2b')]=_[_0xe06a('0x2c')](_0x15cf61['model'],_0x15cf61[_0xe06a('0x2a')]);_0x1c5964[_0xe06a('0x2d')]=_[_0xe06a('0x2c')](_0x15cf61[_0xe06a('0x28')],qs['fields'](_0x1613d8['query'][_0xe06a('0x2e')]));_0x1c5964[_0xe06a('0x2d')]=_0x1c5964[_0xe06a('0x2d')][_0xe06a('0x2f')]?_0x1c5964[_0xe06a('0x2d')]:_0x15cf61[_0xe06a('0x28')];if(!_0x1613d8['query']['hasOwnProperty'](_0xe06a('0x30'))){_0x1c5964['limit']=qs[_0xe06a('0x19')](_0x1613d8['query'][_0xe06a('0x19')]);_0x1c5964[_0xe06a('0x18')]=qs[_0xe06a('0x18')](_0x1613d8['query']['offset']);}_0x1c5964[_0xe06a('0x31')]=qs[_0xe06a('0x32')](_0x1613d8[_0xe06a('0x2a')][_0xe06a('0x32')]);_0x1c5964[_0xe06a('0x33')]=qs[_0xe06a('0x2b')](_['pick'](_0x1613d8['query'],_0x15cf61['filters']),_0x3b95a4);if(_0x1613d8['query'][_0xe06a('0x34')]){_0x1c5964[_0xe06a('0x33')]=_[_0xe06a('0x35')](_0x1c5964[_0xe06a('0x33')],{'$or':_[_0xe06a('0x23')](_0x3b95a4,function(_0x4a3e73){if(_0x4a3e73[_0xe06a('0x26')]!==_0xe06a('0x36')){var _0x9c0671={};_0x9c0671[_0x4a3e73['name']]={'$like':'%'+_0x1613d8[_0xe06a('0x2a')][_0xe06a('0x34')]+'%'};return _0x9c0671;}})});}_0x1c5964=_[_0xe06a('0x35')]({},_0x1c5964,_0x1613d8[_0xe06a('0x37')]);var _0x28d34e={'where':_0x1c5964[_0xe06a('0x33')]};return db[_0xe06a('0x24')][_0xe06a('0x38')](_0x28d34e)['then'](function(_0x5737b5){_0x3a3568[_0xe06a('0x38')]=_0x5737b5;if(_0x1613d8['query']['includeAll']){_0x1c5964[_0xe06a('0x39')]=[{'all':!![]}];}return db[_0xe06a('0x24')][_0xe06a('0x3a')](_0x1c5964);})['then'](function(_0x57c990){_0x3a3568[_0xe06a('0x3b')]=_0x57c990;return _0x3a3568;})[_0xe06a('0x1f')](respondWithFilteredResult(_0x4506b3,_0x1c5964))[_0xe06a('0x3c')](handleError(_0x4506b3,null));};exports[_0xe06a('0x3d')]=function(_0x55ebd8,_0x1029a1){var _0x5d2f1a={'raw':!![],'where':{'id':_0x55ebd8[_0xe06a('0x3e')]['id']}},_0x3994c9={};_0x3994c9['model']=_[_0xe06a('0x29')](db[_0xe06a('0x24')]['rawAttributes']);_0x3994c9['query']=_['keys'](_0x55ebd8['query']);_0x3994c9[_0xe06a('0x2b')]=_['intersection'](_0x3994c9['model'],_0x3994c9['query']);_0x5d2f1a['attributes']=_[_0xe06a('0x2c')](_0x3994c9[_0xe06a('0x28')],qs[_0xe06a('0x2e')](_0x55ebd8[_0xe06a('0x2a')][_0xe06a('0x2e')]));_0x5d2f1a[_0xe06a('0x2d')]=_0x5d2f1a['attributes'][_0xe06a('0x2f')]?_0x5d2f1a[_0xe06a('0x2d')]:_0x3994c9[_0xe06a('0x28')];if(_0x55ebd8[_0xe06a('0x2a')][_0xe06a('0x3f')]){_0x5d2f1a['include']=[{'all':!![]}];}_0x5d2f1a=_['merge']({},_0x5d2f1a,_0x55ebd8[_0xe06a('0x37')]);return db[_0xe06a('0x24')][_0xe06a('0x40')](_0x5d2f1a)[_0xe06a('0x1f')](handleEntityNotFound(_0x1029a1,null))['then'](respondWithResult(_0x1029a1,null))[_0xe06a('0x3c')](handleError(_0x1029a1,null));};exports[_0xe06a('0x41')]=function(_0x2d9a0b,_0x5b1e09){return db['ChatQueueReport']['create'](_0x2d9a0b[_0xe06a('0x42')],{})[_0xe06a('0x1f')](respondWithResult(_0x5b1e09,0xc9))[_0xe06a('0x3c')](handleError(_0x5b1e09,null));};exports[_0xe06a('0x1e')]=function(_0x5923f2,_0x1bf7af){if(_0x5923f2[_0xe06a('0x42')]['id']){delete _0x5923f2[_0xe06a('0x42')]['id'];}return db[_0xe06a('0x24')][_0xe06a('0x40')]({'where':{'id':_0x5923f2['params']['id']}})[_0xe06a('0x1f')](handleEntityNotFound(_0x1bf7af,null))[_0xe06a('0x1f')](saveUpdates(_0x5923f2[_0xe06a('0x42')],null))[_0xe06a('0x1f')](respondWithResult(_0x1bf7af,null))['catch'](handleError(_0x1bf7af,null));};exports['destroy']=function(_0x6b7bf0,_0x449a52){return db[_0xe06a('0x24')]['find']({'where':{'id':_0x6b7bf0[_0xe06a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x449a52,null))[_0xe06a('0x1f')](removeEntity(_0x449a52,null))['catch'](handleError(_0x449a52,null));};exports['describe']=function(_0x4f765d,_0x4dc7ac){return db[_0xe06a('0x24')]['describe']()[_0xe06a('0x1f')](respondWithResult(_0x4dc7ac,null))[_0xe06a('0x3c')](handleError(_0x4dc7ac,null));}; \ No newline at end of file +var _0xc812=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','ChatQueueReport'];(function(_0x4de69d,_0x3a4e59){var _0x124b33=function(_0x4b27af){while(--_0x4b27af){_0x4de69d['push'](_0x4de69d['shift']());}};_0x124b33(++_0x3a4e59);}(_0xc812,0xbc));var _0x2c81=function(_0x327cf5,_0x3b6240){_0x327cf5=_0x327cf5-0x0;var _0xb2dcc4=_0xc812[_0x327cf5];return _0xb2dcc4;};'use strict';var emlformat=require(_0x2c81('0x0'));var rimraf=require(_0x2c81('0x1'));var zipdir=require(_0x2c81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c81('0x3'));var moment=require(_0x2c81('0x4'));var BPromise=require(_0x2c81('0x5'));var Mustache=require(_0x2c81('0x6'));var util=require('util');var path=require(_0x2c81('0x7'));var sox=require(_0x2c81('0x8'));var csv=require('to-csv');var ejs=require(_0x2c81('0x9'));var fs=require('fs');var fs_extra=require(_0x2c81('0xa'));var _=require(_0x2c81('0xb'));var squel=require(_0x2c81('0xc'));var crypto=require(_0x2c81('0xd'));var jsforce=require(_0x2c81('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2c81('0xf'));var querystring=require(_0x2c81('0x10'));var Papa=require(_0x2c81('0x11'));var Redis=require(_0x2c81('0x12'));var authService=require(_0x2c81('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2c81('0x14'));var hardwareService=require(_0x2c81('0x15'));var logger=require(_0x2c81('0x16'))(_0x2c81('0x17'));var utils=require(_0x2c81('0x18'));var config=require(_0x2c81('0x19'));var licenseUtil=require(_0x2c81('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22a187,_0x2270da){_0x2270da=_0x2270da||0xcc;return function(_0x5e2812){if(_0x5e2812){return _0x22a187['sendStatus'](_0x2270da);}return _0x22a187[_0x2c81('0x1b')](_0x2270da)[_0x2c81('0x1c')]();};}function respondWithResult(_0x4def60,_0x425a60){_0x425a60=_0x425a60||0xc8;return function(_0x258b0f){if(_0x258b0f){return _0x4def60[_0x2c81('0x1b')](_0x425a60)[_0x2c81('0x1d')](_0x258b0f);}};}function respondWithFilteredResult(_0x2de1ee,_0x3a51aa){return function(_0x35c42b){if(_0x35c42b){var _0x169c74=typeof _0x3a51aa['offset']===_0x2c81('0x1e')&&typeof _0x3a51aa[_0x2c81('0x1f')]==='undefined';var _0xa53149=_0x35c42b[_0x2c81('0x20')];var _0x3d5a02=_0x169c74?0x0:_0x3a51aa[_0x2c81('0x21')];var _0x101325=_0x169c74?_0x35c42b[_0x2c81('0x20')]:_0x3a51aa['offset']+_0x3a51aa[_0x2c81('0x1f')];var _0x9ec98;if(_0x101325>=_0xa53149){_0x101325=_0xa53149;_0x9ec98=0xc8;}else{_0x9ec98=0xce;}_0x2de1ee[_0x2c81('0x1b')](_0x9ec98);return _0x2de1ee[_0x2c81('0x22')](_0x2c81('0x23'),_0x3d5a02+'-'+_0x101325+'/'+_0xa53149)[_0x2c81('0x1d')](_0x35c42b);}return null;};}function patchUpdates(_0x27bc2e){return function(_0x46e141){try{jsonpatch['apply'](_0x46e141,_0x27bc2e,!![]);}catch(_0x525b13){return BPromise[_0x2c81('0x24')](_0x525b13);}return _0x46e141['save']();};}function saveUpdates(_0x296b46,_0x5d1d30){return function(_0x573dce){if(_0x573dce){return _0x573dce['update'](_0x296b46)[_0x2c81('0x25')](function(_0x2d02f7){return _0x2d02f7;});}return null;};}function removeEntity(_0xf4d4ab,_0x3e529f){return function(_0x5a8980){if(_0x5a8980){return _0x5a8980[_0x2c81('0x26')]()[_0x2c81('0x25')](function(){_0xf4d4ab[_0x2c81('0x1b')](0xcc)[_0x2c81('0x1c')]();});}};}function handleEntityNotFound(_0x309b2f,_0xca2041){return function(_0x436e5a){if(!_0x436e5a){_0x309b2f['sendStatus'](0x194);}return _0x436e5a;};}function handleError(_0x2ca1a1,_0x171d12){_0x171d12=_0x171d12||0x1f4;return function(_0x1def4c){logger[_0x2c81('0x27')](_0x1def4c[_0x2c81('0x28')]);if(_0x1def4c['name']){delete _0x1def4c[_0x2c81('0x29')];}_0x2ca1a1[_0x2c81('0x1b')](_0x171d12)[_0x2c81('0x2a')](_0x1def4c);};}exports[_0x2c81('0x2b')]=function(_0x4122bc,_0x44566d){var _0x238e5a={},_0x3adf97={},_0x40d231={'count':0x0,'rows':[]};var _0x249cba=_[_0x2c81('0x2c')](db[_0x2c81('0x2d')][_0x2c81('0x2e')],function(_0x19bfee){return{'name':_0x19bfee['fieldName'],'type':_0x19bfee[_0x2c81('0x2f')][_0x2c81('0x30')]};});_0x3adf97[_0x2c81('0x31')]=_[_0x2c81('0x2c')](_0x249cba,'name');_0x3adf97[_0x2c81('0x32')]=_[_0x2c81('0x33')](_0x4122bc[_0x2c81('0x32')]);_0x3adf97[_0x2c81('0x34')]=_[_0x2c81('0x35')](_0x3adf97[_0x2c81('0x31')],_0x3adf97[_0x2c81('0x32')]);_0x238e5a[_0x2c81('0x36')]=_[_0x2c81('0x35')](_0x3adf97[_0x2c81('0x31')],qs['fields'](_0x4122bc['query'][_0x2c81('0x37')]));_0x238e5a[_0x2c81('0x36')]=_0x238e5a[_0x2c81('0x36')][_0x2c81('0x38')]?_0x238e5a[_0x2c81('0x36')]:_0x3adf97[_0x2c81('0x31')];if(!_0x4122bc['query'][_0x2c81('0x39')](_0x2c81('0x3a'))){_0x238e5a['limit']=qs['limit'](_0x4122bc['query'][_0x2c81('0x1f')]);_0x238e5a[_0x2c81('0x21')]=qs[_0x2c81('0x21')](_0x4122bc[_0x2c81('0x32')][_0x2c81('0x21')]);}_0x238e5a[_0x2c81('0x3b')]=qs[_0x2c81('0x3c')](_0x4122bc[_0x2c81('0x32')]['sort']);_0x238e5a[_0x2c81('0x3d')]=qs[_0x2c81('0x34')](_[_0x2c81('0x3e')](_0x4122bc[_0x2c81('0x32')],_0x3adf97[_0x2c81('0x34')]),_0x249cba);if(_0x4122bc[_0x2c81('0x32')][_0x2c81('0x3f')]){_0x238e5a[_0x2c81('0x3d')]=_[_0x2c81('0x40')](_0x238e5a[_0x2c81('0x3d')],{'$or':_[_0x2c81('0x2c')](_0x249cba,function(_0x42279d){if(_0x42279d[_0x2c81('0x2f')]!==_0x2c81('0x41')){var _0x43e4ff={};_0x43e4ff[_0x42279d[_0x2c81('0x29')]]={'$like':'%'+_0x4122bc[_0x2c81('0x32')]['filter']+'%'};return _0x43e4ff;}})});}_0x238e5a=_[_0x2c81('0x40')]({},_0x238e5a,_0x4122bc['options']);var _0x2f4e21={'where':_0x238e5a[_0x2c81('0x3d')]};return db['ChatQueueReport'][_0x2c81('0x20')](_0x2f4e21)['then'](function(_0x331e2a){_0x40d231['count']=_0x331e2a;if(_0x4122bc[_0x2c81('0x32')][_0x2c81('0x42')]){_0x238e5a[_0x2c81('0x43')]=[{'all':!![]}];}return db[_0x2c81('0x2d')][_0x2c81('0x44')](_0x238e5a);})[_0x2c81('0x25')](function(_0x20d254){_0x40d231['rows']=_0x20d254;return _0x40d231;})['then'](respondWithFilteredResult(_0x44566d,_0x238e5a))[_0x2c81('0x45')](handleError(_0x44566d,null));};exports[_0x2c81('0x46')]=function(_0x253c80,_0x65b3ef){var _0x1e07de={'raw':!![],'where':{'id':_0x253c80[_0x2c81('0x47')]['id']}},_0x1f2316={};_0x1f2316['model']=_['keys'](db[_0x2c81('0x2d')][_0x2c81('0x2e')]);_0x1f2316['query']=_[_0x2c81('0x33')](_0x253c80[_0x2c81('0x32')]);_0x1f2316[_0x2c81('0x34')]=_[_0x2c81('0x35')](_0x1f2316[_0x2c81('0x31')],_0x1f2316[_0x2c81('0x32')]);_0x1e07de[_0x2c81('0x36')]=_[_0x2c81('0x35')](_0x1f2316[_0x2c81('0x31')],qs[_0x2c81('0x37')](_0x253c80[_0x2c81('0x32')][_0x2c81('0x37')]));_0x1e07de[_0x2c81('0x36')]=_0x1e07de['attributes'][_0x2c81('0x38')]?_0x1e07de[_0x2c81('0x36')]:_0x1f2316[_0x2c81('0x31')];if(_0x253c80['query'][_0x2c81('0x42')]){_0x1e07de['include']=[{'all':!![]}];}_0x1e07de=_[_0x2c81('0x40')]({},_0x1e07de,_0x253c80[_0x2c81('0x48')]);return db[_0x2c81('0x2d')][_0x2c81('0x49')](_0x1e07de)[_0x2c81('0x25')](handleEntityNotFound(_0x65b3ef,null))[_0x2c81('0x25')](respondWithResult(_0x65b3ef,null))[_0x2c81('0x45')](handleError(_0x65b3ef,null));};exports[_0x2c81('0x4a')]=function(_0x150040,_0x5a2686){return db[_0x2c81('0x2d')][_0x2c81('0x4a')](_0x150040[_0x2c81('0x4b')],{})['then'](respondWithResult(_0x5a2686,0xc9))[_0x2c81('0x45')](handleError(_0x5a2686,null));};exports[_0x2c81('0x4c')]=function(_0xe11709,_0x2dd610){if(_0xe11709[_0x2c81('0x4b')]['id']){delete _0xe11709[_0x2c81('0x4b')]['id'];}return db[_0x2c81('0x2d')][_0x2c81('0x49')]({'where':{'id':_0xe11709[_0x2c81('0x47')]['id']}})[_0x2c81('0x25')](handleEntityNotFound(_0x2dd610,null))['then'](saveUpdates(_0xe11709[_0x2c81('0x4b')],null))[_0x2c81('0x25')](respondWithResult(_0x2dd610,null))[_0x2c81('0x45')](handleError(_0x2dd610,null));};exports[_0x2c81('0x26')]=function(_0xedecfc,_0x2a24b0){return db[_0x2c81('0x2d')][_0x2c81('0x49')]({'where':{'id':_0xedecfc[_0x2c81('0x47')]['id']}})[_0x2c81('0x25')](handleEntityNotFound(_0x2a24b0,null))[_0x2c81('0x25')](removeEntity(_0x2a24b0,null))['catch'](handleError(_0x2a24b0,null));};exports['describe']=function(_0x2d5141,_0x95fce6){return db['ChatQueueReport'][_0x2c81('0x4d')]()[_0x2c81('0x25')](respondWithResult(_0x95fce6,null))[_0x2c81('0x45')](handleError(_0x95fce6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f256364..8624617 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x1fded6,_0x5e9e49){var _0xa5e0b9=function(_0x15bc36){while(--_0x15bc36){_0x1fded6['push'](_0x1fded6['shift']());}};_0xa5e0b9(++_0x5e9e49);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x31b2a5,_0x2480b4){var _0x198fa4=function(_0x1414b9){while(--_0x1414b9){_0x31b2a5['push'](_0x31b2a5['shift']());}};_0x198fa4(++_0x2480b4);}(_0xb10b,0x12a));var _0xbb10=function(_0x501932,_0x432837){_0x501932=_0x501932-0x0;var _0x1fe5eb=_0xb10b[_0x501932];return _0x1fe5eb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index e00f363..da12e13 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 _0x268d=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','body','options','catch','UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x268d,0x1cc));var _0xd268=function(_0x28c304,_0x195ab5){_0x28c304=_0x28c304-0x0;var _0x54a1a5=_0x268d[_0x28c304];return _0x54a1a5;};'use strict';var _=require(_0xd268('0x0'));var util=require(_0xd268('0x1'));var moment=require(_0xd268('0x2'));var BPromise=require('bluebird');var rs=require(_0xd268('0x3'));var fs=require('fs');var Redis=require(_0xd268('0x4'));var db=require(_0xd268('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd268('0x6'))(_0xd268('0x7'));var config=require(_0xd268('0x8'));var jayson=require(_0xd268('0x9'));var client=jayson[_0xd268('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5acdb8,_0x59cf09,_0x2c6939){return new BPromise(function(_0x5d8751,_0x2307c5){return client[_0xd268('0xb')](_0x5acdb8,_0x2c6939)[_0xd268('0xc')](function(_0x2a0daa){logger[_0xd268('0xd')](_0xd268('0xe'),_0x59cf09,_0xd268('0xf'));logger[_0xd268('0x10')](_0xd268('0x11'),_0x59cf09,_0xd268('0xf'),JSON[_0xd268('0x12')](_0x2a0daa));if(_0x2a0daa['error']){if(_0x2a0daa[_0xd268('0x13')][_0xd268('0x14')]===0x1f4){logger[_0xd268('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x59cf09,_0x2a0daa[_0xd268('0x13')][_0xd268('0x15')]);return _0x2307c5(_0x2a0daa['error'][_0xd268('0x15')]);}logger[_0xd268('0x13')](_0xd268('0xe'),_0x59cf09,_0x2a0daa['error'][_0xd268('0x15')]);return _0x5d8751(_0x2a0daa[_0xd268('0x13')]['message']);}else{logger['info'](_0xd268('0xe'),_0x59cf09,_0xd268('0xf'));_0x5d8751(_0x2a0daa[_0xd268('0x16')][_0xd268('0x15')]);}})['catch'](function(_0x229036){logger['error'](_0xd268('0xe'),_0x59cf09,_0x229036);_0x2307c5(_0x229036);});});}exports[_0xd268('0x17')]=function(_0x38d30f){var _0x1ac1f1=this;return new Promise(function(_0x42b558,_0x5ddc4e){return db[_0xd268('0x18')]['create'](_0x38d30f[_0xd268('0x19')],{'raw':_0x38d30f[_0xd268('0x1a')]?_0x38d30f[_0xd268('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2b3594){logger[_0xd268('0xd')](_0xd268('0x17'),_0x38d30f);logger[_0xd268('0x10')](_0xd268('0x17'),_0x38d30f,JSON[_0xd268('0x12')](_0x2b3594));_0x42b558(_0x2b3594);})[_0xd268('0x1b')](function(_0x40cffe){logger[_0xd268('0x13')](_0xd268('0x17'),_0x40cffe['message'],_0x38d30f);_0x5ddc4e(_0x1ac1f1[_0xd268('0x13')](0x1f4,_0x40cffe['message']));});});};exports[_0xd268('0x1c')]=function(_0x590c82){var _0x2e8358=this;return new Promise(function(_0x4470f2,_0x58a2c0){return db[_0xd268('0x18')][_0xd268('0x1d')](_0x590c82[_0xd268('0x19')],{'raw':_0x590c82[_0xd268('0x1a')]?_0x590c82[_0xd268('0x1a')][_0xd268('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x590c82['options']?_0x590c82[_0xd268('0x1a')][_0xd268('0x1f')]||null:null,'attributes':_0x590c82['options']?_0x590c82[_0xd268('0x1a')][_0xd268('0x20')]||null:null,'limit':_0x590c82['options']?_0x590c82[_0xd268('0x1a')][_0xd268('0x21')]||null:null})[_0xd268('0xc')](function(_0xf674dd){logger['info'](_0xd268('0x1c'),_0x590c82);logger[_0xd268('0x10')](_0xd268('0x1c'),_0x590c82,JSON[_0xd268('0x12')](_0xf674dd));_0x4470f2(_0xf674dd);})[_0xd268('0x1b')](function(_0x18130d){logger['error']('UpdateChatQueueReport',_0x18130d[_0xd268('0x15')],_0x590c82);_0x58a2c0(_0x2e8358[_0xd268('0x13')](0x1f4,_0x18130d[_0xd268('0x15')]));});});}; \ No newline at end of file +var _0x17b6=['UpdateChatQueueReport','update','where','attributes','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options'];(function(_0x158023,_0x5d5b6a){var _0x1a8451=function(_0x403239){while(--_0x403239){_0x158023['push'](_0x158023['shift']());}};_0x1a8451(++_0x5d5b6a);}(_0x17b6,0xf7));var _0x617b=function(_0x5b58d1,_0x52a0c0){_0x5b58d1=_0x5b58d1-0x0;var _0x4a57fe=_0x17b6[_0x5b58d1];return _0x4a57fe;};'use strict';var _=require(_0x617b('0x0'));var util=require(_0x617b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x617b('0x2'))['db'];var utils=require(_0x617b('0x3'));var logger=require(_0x617b('0x4'))('rpc');var config=require(_0x617b('0x5'));var jayson=require(_0x617b('0x6'));var client=jayson['client'][_0x617b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ca647,_0x502d56,_0x4ddd96){return new BPromise(function(_0x3e9f8c,_0x19729e){return client['request'](_0x2ca647,_0x4ddd96)[_0x617b('0x8')](function(_0x81347a){logger[_0x617b('0x9')](_0x617b('0xa'),_0x502d56,_0x617b('0xb'));logger[_0x617b('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x502d56,'request\x20sent',JSON[_0x617b('0xd')](_0x81347a));if(_0x81347a['error']){if(_0x81347a[_0x617b('0xe')][_0x617b('0xf')]===0x1f4){logger['error'](_0x617b('0xa'),_0x502d56,_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);return _0x19729e(_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);}logger[_0x617b('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x502d56,_0x81347a['error'][_0x617b('0x10')]);return _0x3e9f8c(_0x81347a[_0x617b('0xe')][_0x617b('0x10')]);}else{logger[_0x617b('0x9')](_0x617b('0xa'),_0x502d56,_0x617b('0xb'));_0x3e9f8c(_0x81347a[_0x617b('0x11')]['message']);}})[_0x617b('0x12')](function(_0x51e650){logger[_0x617b('0xe')](_0x617b('0xa'),_0x502d56,_0x51e650);_0x19729e(_0x51e650);});});}exports[_0x617b('0x13')]=function(_0x3576b3){var _0x40ab9d=this;return new Promise(function(_0x58c73e,_0x3549b1){return db[_0x617b('0x14')]['create'](_0x3576b3[_0x617b('0x15')],{'raw':_0x3576b3[_0x617b('0x16')]?_0x3576b3[_0x617b('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x617b('0x8')](function(_0x13d8da){logger[_0x617b('0x9')](_0x617b('0x13'),_0x3576b3);logger[_0x617b('0xc')](_0x617b('0x13'),_0x3576b3,JSON[_0x617b('0xd')](_0x13d8da));_0x58c73e(_0x13d8da);})[_0x617b('0x12')](function(_0x3edc07){logger['error'](_0x617b('0x13'),_0x3edc07[_0x617b('0x10')],_0x3576b3);_0x3549b1(_0x40ab9d[_0x617b('0xe')](0x1f4,_0x3edc07[_0x617b('0x10')]));});});};exports[_0x617b('0x17')]=function(_0x398c30){var _0x234461=this;return new Promise(function(_0x57fdca,_0x114b35){return db[_0x617b('0x14')][_0x617b('0x18')](_0x398c30[_0x617b('0x15')],{'raw':_0x398c30[_0x617b('0x16')]?_0x398c30['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398c30['options']?_0x398c30[_0x617b('0x16')][_0x617b('0x19')]||null:null,'attributes':_0x398c30['options']?_0x398c30[_0x617b('0x16')][_0x617b('0x1a')]||null:null,'limit':_0x398c30[_0x617b('0x16')]?_0x398c30[_0x617b('0x16')]['limit']||null:null})[_0x617b('0x8')](function(_0x21f896){logger[_0x617b('0x9')](_0x617b('0x17'),_0x398c30);logger[_0x617b('0xc')](_0x617b('0x17'),_0x398c30,JSON[_0x617b('0xd')](_0x21f896));_0x57fdca(_0x21f896);})[_0x617b('0x12')](function(_0x4b078c){logger[_0x617b('0xe')](_0x617b('0x17'),_0x4b078c[_0x617b('0x10')],_0x398c30);_0x114b35(_0x234461[_0x617b('0xe')](0x1f4,_0x4b078c[_0x617b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fa91e63..6179226 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 _0x46f5=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x1f9db7,_0x51d589){var _0xd36cd7=function(_0xa78ed8){while(--_0xa78ed8){_0x1f9db7['push'](_0x1f9db7['shift']());}};_0xd36cd7(++_0x51d589);}(_0x46f5,0xab));var _0x546f=function(_0x3e1227,_0x3ae7a6){_0x3e1227=_0x3e1227-0x0;var _0x734828=_0x46f5[_0x3e1227];return _0x734828;};'use strict';var multer=require(_0x546f('0x0'));var util=require(_0x546f('0x1'));var path=require(_0x546f('0x2'));var timeout=require(_0x546f('0x3'));var express=require(_0x546f('0x4'));var router=express[_0x546f('0x5')]();var fs_extra=require(_0x546f('0x6'));var auth=require(_0x546f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x546f('0x8'));var controller=require(_0x546f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x546f('0xa')]);router[_0x546f('0xb')](_0x546f('0xc'),auth['isAuthenticated'](),controller[_0x546f('0xd')]);router['get'](_0x546f('0xe'),auth[_0x546f('0xf')](),controller[_0x546f('0x10')]);router[_0x546f('0x11')]('/',auth[_0x546f('0xf')](),controller[_0x546f('0x12')]);router[_0x546f('0x13')](_0x546f('0xe'),auth[_0x546f('0xf')](),controller[_0x546f('0x14')]);router[_0x546f('0x15')](_0x546f('0xe'),auth[_0x546f('0xf')](),controller[_0x546f('0x16')]);module[_0x546f('0x17')]=router; \ No newline at end of file +var _0x7a8f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4e53be,_0x25ed6b){var _0x3b5092=function(_0x3c157d){while(--_0x3c157d){_0x4e53be['push'](_0x4e53be['shift']());}};_0x3b5092(++_0x25ed6b);}(_0x7a8f,0x9a));var _0xf7a8=function(_0x562cc7,_0x2eba6b){_0x562cc7=_0x562cc7-0x0;var _0x5c54e1=_0x7a8f[_0x562cc7];return _0x5c54e1;};'use strict';var multer=require(_0xf7a8('0x0'));var util=require(_0xf7a8('0x1'));var path=require(_0xf7a8('0x2'));var timeout=require(_0xf7a8('0x3'));var express=require(_0xf7a8('0x4'));var router=express[_0xf7a8('0x5')]();var fs_extra=require(_0xf7a8('0x6'));var auth=require(_0xf7a8('0x7'));var interaction=require(_0xf7a8('0x8'));var config=require(_0xf7a8('0x9'));var controller=require(_0xf7a8('0xa'));router[_0xf7a8('0xb')]('/',auth['isAuthenticated'](),controller[_0xf7a8('0xc')]);router[_0xf7a8('0xb')](_0xf7a8('0xd'),auth[_0xf7a8('0xe')](),controller['describe']);router[_0xf7a8('0xb')]('/:id',auth[_0xf7a8('0xe')](),controller[_0xf7a8('0xf')]);router[_0xf7a8('0x10')]('/',auth[_0xf7a8('0xe')](),controller[_0xf7a8('0x11')]);router['put'](_0xf7a8('0x12'),auth['isAuthenticated'](),controller[_0xf7a8('0x13')]);router[_0xf7a8('0x14')](_0xf7a8('0x12'),auth[_0xf7a8('0xe')](),controller[_0xf7a8('0x15')]);module[_0xf7a8('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 8173528..1eeb592 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0x34e8,0x12c));var _0x834e=function(_0x24ea7c,_0x47adf8){_0x24ea7c=_0x24ea7c-0x0;var _0x4b33c2=_0x34e8[_0x24ea7c];return _0x4b33c2;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x2f3a69,_0x54afed){var _0xa9341a=function(_0x6a91e){while(--_0x6a91e){_0x2f3a69['push'](_0x2f3a69['shift']());}};_0xa9341a(++_0x54afed);}(_0x70e0,0x17b));var _0x070e=function(_0x2a643d,_0x2f1d3c){_0x2a643d=_0x2a643d-0x0;var _0x5c5d98=_0x70e0[_0x2a643d];return _0x5c5d98;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1b44f0f..8e43d20 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 _0x18ee=['filter','merge','type','options','then','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','ChatTransferReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x18ee,0xb0));var _0xe18e=function(_0x554cf6,_0x13304e){_0x554cf6=_0x554cf6-0x0;var _0xc69891=_0x18ee[_0x554cf6];return _0xc69891;};'use strict';var emlformat=require(_0xe18e('0x0'));var rimraf=require(_0xe18e('0x1'));var zipdir=require(_0xe18e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe18e('0x3'));var moment=require(_0xe18e('0x4'));var BPromise=require(_0xe18e('0x5'));var Mustache=require(_0xe18e('0x6'));var util=require(_0xe18e('0x7'));var path=require(_0xe18e('0x8'));var sox=require(_0xe18e('0x9'));var csv=require(_0xe18e('0xa'));var ejs=require(_0xe18e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe18e('0xc'));var squel=require(_0xe18e('0xd'));var crypto=require('crypto');var jsforce=require(_0xe18e('0xe'));var deskjs=require(_0xe18e('0xf'));var toCsv=require(_0xe18e('0xa'));var querystring=require('querystring');var Papa=require(_0xe18e('0x10'));var Redis=require(_0xe18e('0x11'));var authService=require(_0xe18e('0x12'));var qs=require(_0xe18e('0x13'));var as=require(_0xe18e('0x14'));var hardwareService=require(_0xe18e('0x15'));var logger=require(_0xe18e('0x16'))('api');var utils=require(_0xe18e('0x17'));var config=require(_0xe18e('0x18'));var licenseUtil=require(_0xe18e('0x19'));var db=require(_0xe18e('0x1a'))['db'];function respondWithStatusCode(_0x229262,_0xa87c10){_0xa87c10=_0xa87c10||0xcc;return function(_0x5b72a1){if(_0x5b72a1){return _0x229262[_0xe18e('0x1b')](_0xa87c10);}return _0x229262[_0xe18e('0x1c')](_0xa87c10)[_0xe18e('0x1d')]();};}function respondWithResult(_0x221b95,_0x3a4787){_0x3a4787=_0x3a4787||0xc8;return function(_0x46c250){if(_0x46c250){return _0x221b95['status'](_0x3a4787)[_0xe18e('0x1e')](_0x46c250);}};}function respondWithFilteredResult(_0x5838c3,_0x29243e){return function(_0x56efde){if(_0x56efde){var _0x47c0db=typeof _0x29243e[_0xe18e('0x1f')]==='undefined'&&typeof _0x29243e['limit']==='undefined';var _0x25803b=_0x56efde[_0xe18e('0x20')];var _0x5c039f=_0x47c0db?0x0:_0x29243e[_0xe18e('0x1f')];var _0xf10bd3=_0x47c0db?_0x56efde[_0xe18e('0x20')]:_0x29243e[_0xe18e('0x1f')]+_0x29243e[_0xe18e('0x21')];var _0x47e1f1;if(_0xf10bd3>=_0x25803b){_0xf10bd3=_0x25803b;_0x47e1f1=0xc8;}else{_0x47e1f1=0xce;}_0x5838c3[_0xe18e('0x1c')](_0x47e1f1);return _0x5838c3[_0xe18e('0x22')](_0xe18e('0x23'),_0x5c039f+'-'+_0xf10bd3+'/'+_0x25803b)['json'](_0x56efde);}return null;};}function patchUpdates(_0x4af23c){return function(_0x298f14){try{jsonpatch[_0xe18e('0x24')](_0x298f14,_0x4af23c,!![]);}catch(_0x2c0b0d){return BPromise[_0xe18e('0x25')](_0x2c0b0d);}return _0x298f14[_0xe18e('0x26')]();};}function saveUpdates(_0x2cba3c,_0x1c6b00){return function(_0x22bd75){if(_0x22bd75){return _0x22bd75[_0xe18e('0x27')](_0x2cba3c)['then'](function(_0x2a392c){return _0x2a392c;});}return null;};}function removeEntity(_0x4cbf34,_0x56a037){return function(_0x2c7a23){if(_0x2c7a23){return _0x2c7a23[_0xe18e('0x28')]()['then'](function(){_0x4cbf34[_0xe18e('0x1c')](0xcc)[_0xe18e('0x1d')]();});}};}function handleEntityNotFound(_0x9c60f3,_0x13896f){return function(_0x5332da){if(!_0x5332da){_0x9c60f3[_0xe18e('0x1b')](0x194);}return _0x5332da;};}function handleError(_0x316ce5,_0x5ad1ba){_0x5ad1ba=_0x5ad1ba||0x1f4;return function(_0x3f602b){logger['error'](_0x3f602b[_0xe18e('0x29')]);if(_0x3f602b[_0xe18e('0x2a')]){delete _0x3f602b[_0xe18e('0x2a')];}_0x316ce5[_0xe18e('0x1c')](_0x5ad1ba)['send'](_0x3f602b);};}exports[_0xe18e('0x2b')]=function(_0x6529ec,_0x29d8a6){var _0x30cc5f={},_0x384bb9={},_0x1871d8={'count':0x0,'rows':[]};var _0x123127=_[_0xe18e('0x2c')](db[_0xe18e('0x2d')]['rawAttributes'],function(_0x10c494){return{'name':_0x10c494[_0xe18e('0x2e')],'type':_0x10c494['type'][_0xe18e('0x2f')]};});_0x384bb9[_0xe18e('0x30')]=_[_0xe18e('0x2c')](_0x123127,_0xe18e('0x2a'));_0x384bb9['query']=_['keys'](_0x6529ec[_0xe18e('0x31')]);_0x384bb9[_0xe18e('0x32')]=_[_0xe18e('0x33')](_0x384bb9[_0xe18e('0x30')],_0x384bb9[_0xe18e('0x31')]);_0x30cc5f[_0xe18e('0x34')]=_[_0xe18e('0x33')](_0x384bb9[_0xe18e('0x30')],qs[_0xe18e('0x35')](_0x6529ec[_0xe18e('0x31')][_0xe18e('0x35')]));_0x30cc5f[_0xe18e('0x34')]=_0x30cc5f[_0xe18e('0x34')][_0xe18e('0x36')]?_0x30cc5f[_0xe18e('0x34')]:_0x384bb9[_0xe18e('0x30')];if(!_0x6529ec[_0xe18e('0x31')][_0xe18e('0x37')](_0xe18e('0x38'))){_0x30cc5f[_0xe18e('0x21')]=qs[_0xe18e('0x21')](_0x6529ec[_0xe18e('0x31')][_0xe18e('0x21')]);_0x30cc5f[_0xe18e('0x1f')]=qs[_0xe18e('0x1f')](_0x6529ec[_0xe18e('0x31')]['offset']);}_0x30cc5f[_0xe18e('0x39')]=qs[_0xe18e('0x3a')](_0x6529ec['query'][_0xe18e('0x3a')]);_0x30cc5f[_0xe18e('0x3b')]=qs[_0xe18e('0x32')](_[_0xe18e('0x3c')](_0x6529ec[_0xe18e('0x31')],_0x384bb9['filters']),_0x123127);if(_0x6529ec[_0xe18e('0x31')][_0xe18e('0x3d')]){_0x30cc5f['where']=_[_0xe18e('0x3e')](_0x30cc5f[_0xe18e('0x3b')],{'$or':_['map'](_0x123127,function(_0x460899){if(_0x460899[_0xe18e('0x3f')]!=='VIRTUAL'){var _0x22744e={};_0x22744e[_0x460899[_0xe18e('0x2a')]]={'$like':'%'+_0x6529ec[_0xe18e('0x31')][_0xe18e('0x3d')]+'%'};return _0x22744e;}})});}_0x30cc5f=_[_0xe18e('0x3e')]({},_0x30cc5f,_0x6529ec[_0xe18e('0x40')]);var _0x4bc34d={'where':_0x30cc5f[_0xe18e('0x3b')]};return db[_0xe18e('0x2d')]['count'](_0x4bc34d)[_0xe18e('0x41')](function(_0x28792b){_0x1871d8[_0xe18e('0x20')]=_0x28792b;if(_0x6529ec['query'][_0xe18e('0x42')]){_0x30cc5f[_0xe18e('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xe18e('0x44')](_0x30cc5f);})[_0xe18e('0x41')](function(_0x535a5e){_0x1871d8[_0xe18e('0x45')]=_0x535a5e;return _0x1871d8;})[_0xe18e('0x41')](respondWithFilteredResult(_0x29d8a6,_0x30cc5f))['catch'](handleError(_0x29d8a6,null));};exports[_0xe18e('0x46')]=function(_0x1447d8,_0x2a09de){var _0x4bb430={'raw':!![],'where':{'id':_0x1447d8[_0xe18e('0x47')]['id']}},_0x534504={};_0x534504['model']=_[_0xe18e('0x48')](db[_0xe18e('0x2d')][_0xe18e('0x49')]);_0x534504[_0xe18e('0x31')]=_['keys'](_0x1447d8[_0xe18e('0x31')]);_0x534504['filters']=_[_0xe18e('0x33')](_0x534504[_0xe18e('0x30')],_0x534504[_0xe18e('0x31')]);_0x4bb430[_0xe18e('0x34')]=_[_0xe18e('0x33')](_0x534504[_0xe18e('0x30')],qs['fields'](_0x1447d8['query']['fields']));_0x4bb430[_0xe18e('0x34')]=_0x4bb430['attributes'][_0xe18e('0x36')]?_0x4bb430[_0xe18e('0x34')]:_0x534504[_0xe18e('0x30')];if(_0x1447d8[_0xe18e('0x31')][_0xe18e('0x42')]){_0x4bb430[_0xe18e('0x43')]=[{'all':!![]}];}_0x4bb430=_[_0xe18e('0x3e')]({},_0x4bb430,_0x1447d8[_0xe18e('0x40')]);return db['ChatTransferReport'][_0xe18e('0x4a')](_0x4bb430)['then'](handleEntityNotFound(_0x2a09de,null))[_0xe18e('0x41')](respondWithResult(_0x2a09de,null))[_0xe18e('0x4b')](handleError(_0x2a09de,null));};exports[_0xe18e('0x4c')]=function(_0x2af12f,_0x982d34){return db['ChatTransferReport'][_0xe18e('0x4c')](_0x2af12f[_0xe18e('0x4d')],{})[_0xe18e('0x41')](respondWithResult(_0x982d34,0xc9))['catch'](handleError(_0x982d34,null));};exports['update']=function(_0x144b1e,_0x310a04){if(_0x144b1e[_0xe18e('0x4d')]['id']){delete _0x144b1e[_0xe18e('0x4d')]['id'];}return db[_0xe18e('0x2d')][_0xe18e('0x4a')]({'where':{'id':_0x144b1e[_0xe18e('0x47')]['id']}})['then'](handleEntityNotFound(_0x310a04,null))[_0xe18e('0x41')](saveUpdates(_0x144b1e[_0xe18e('0x4d')],null))['then'](respondWithResult(_0x310a04,null))['catch'](handleError(_0x310a04,null));};exports[_0xe18e('0x28')]=function(_0x10c6ea,_0x556fea){return db['ChatTransferReport'][_0xe18e('0x4a')]({'where':{'id':_0x10c6ea[_0xe18e('0x47')]['id']}})['then'](handleEntityNotFound(_0x556fea,null))[_0xe18e('0x41')](removeEntity(_0x556fea,null))[_0xe18e('0x4b')](handleError(_0x556fea,null));};exports[_0xe18e('0x4e')]=function(_0x48c669,_0x1bedd5){return db[_0xe18e('0x2d')]['describe']()['then'](respondWithResult(_0x1bedd5,null))[_0xe18e('0x4b')](handleError(_0x1bedd5,null));}; \ No newline at end of file +var _0xcb70=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir'];(function(_0x4defd6,_0x37bbd3){var _0x4c9276=function(_0x1d7a3d){while(--_0x1d7a3d){_0x4defd6['push'](_0x4defd6['shift']());}};_0x4c9276(++_0x37bbd3);}(_0xcb70,0xe1));var _0x0cb7=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xcb70[_0x500419];return _0x241c1a;};'use strict';var emlformat=require(_0x0cb7('0x0'));var rimraf=require(_0x0cb7('0x1'));var zipdir=require(_0x0cb7('0x2'));var jsonpatch=require(_0x0cb7('0x3'));var rp=require(_0x0cb7('0x4'));var moment=require(_0x0cb7('0x5'));var BPromise=require(_0x0cb7('0x6'));var Mustache=require(_0x0cb7('0x7'));var util=require(_0x0cb7('0x8'));var path=require(_0x0cb7('0x9'));var sox=require(_0x0cb7('0xa'));var csv=require(_0x0cb7('0xb'));var ejs=require(_0x0cb7('0xc'));var fs=require('fs');var fs_extra=require(_0x0cb7('0xd'));var _=require(_0x0cb7('0xe'));var squel=require(_0x0cb7('0xf'));var crypto=require(_0x0cb7('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x0cb7('0x11'));var toCsv=require(_0x0cb7('0xb'));var querystring=require(_0x0cb7('0x12'));var Papa=require(_0x0cb7('0x13'));var Redis=require(_0x0cb7('0x14'));var authService=require(_0x0cb7('0x15'));var qs=require(_0x0cb7('0x16'));var as=require(_0x0cb7('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0cb7('0x18'));var utils=require(_0x0cb7('0x19'));var config=require(_0x0cb7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cb7('0x1b'))['db'];function respondWithStatusCode(_0x39d12e,_0x454f64){_0x454f64=_0x454f64||0xcc;return function(_0x1c230){if(_0x1c230){return _0x39d12e[_0x0cb7('0x1c')](_0x454f64);}return _0x39d12e[_0x0cb7('0x1d')](_0x454f64)[_0x0cb7('0x1e')]();};}function respondWithResult(_0x5c0653,_0x490070){_0x490070=_0x490070||0xc8;return function(_0x2f2dd9){if(_0x2f2dd9){return _0x5c0653[_0x0cb7('0x1d')](_0x490070)[_0x0cb7('0x1f')](_0x2f2dd9);}};}function respondWithFilteredResult(_0x382909,_0x2b36ed){return function(_0x18cad1){if(_0x18cad1){var _0x837106=typeof _0x2b36ed[_0x0cb7('0x20')]===_0x0cb7('0x21')&&typeof _0x2b36ed[_0x0cb7('0x22')]===_0x0cb7('0x21');var _0xf6b70a=_0x18cad1[_0x0cb7('0x23')];var _0x23d928=_0x837106?0x0:_0x2b36ed['offset'];var _0x34b2b5=_0x837106?_0x18cad1[_0x0cb7('0x23')]:_0x2b36ed[_0x0cb7('0x20')]+_0x2b36ed[_0x0cb7('0x22')];var _0x536c51;if(_0x34b2b5>=_0xf6b70a){_0x34b2b5=_0xf6b70a;_0x536c51=0xc8;}else{_0x536c51=0xce;}_0x382909[_0x0cb7('0x1d')](_0x536c51);return _0x382909[_0x0cb7('0x24')]('Content-Range',_0x23d928+'-'+_0x34b2b5+'/'+_0xf6b70a)[_0x0cb7('0x1f')](_0x18cad1);}return null;};}function patchUpdates(_0x4480ea){return function(_0x7c03f2){try{jsonpatch['apply'](_0x7c03f2,_0x4480ea,!![]);}catch(_0x2b00d9){return BPromise['reject'](_0x2b00d9);}return _0x7c03f2[_0x0cb7('0x25')]();};}function saveUpdates(_0x31c7fb,_0x68737a){return function(_0x22cdd3){if(_0x22cdd3){return _0x22cdd3[_0x0cb7('0x26')](_0x31c7fb)[_0x0cb7('0x27')](function(_0x8f2377){return _0x8f2377;});}return null;};}function removeEntity(_0xb3127d,_0x4843d4){return function(_0xd482e8){if(_0xd482e8){return _0xd482e8['destroy']()['then'](function(){_0xb3127d['status'](0xcc)[_0x0cb7('0x1e')]();});}};}function handleEntityNotFound(_0x5cca56,_0x14d49b){return function(_0x10fc7f){if(!_0x10fc7f){_0x5cca56['sendStatus'](0x194);}return _0x10fc7f;};}function handleError(_0x14c2f2,_0x5f716a){_0x5f716a=_0x5f716a||0x1f4;return function(_0x20a702){logger['error'](_0x20a702[_0x0cb7('0x28')]);if(_0x20a702[_0x0cb7('0x29')]){delete _0x20a702[_0x0cb7('0x29')];}_0x14c2f2[_0x0cb7('0x1d')](_0x5f716a)['send'](_0x20a702);};}exports[_0x0cb7('0x2a')]=function(_0xc263b4,_0x47dd3b){var _0x5e54e2={},_0xb4654b={},_0x4f964d={'count':0x0,'rows':[]};var _0x2bc850=_[_0x0cb7('0x2b')](db['ChatTransferReport'][_0x0cb7('0x2c')],function(_0x33219b){return{'name':_0x33219b[_0x0cb7('0x2d')],'type':_0x33219b[_0x0cb7('0x2e')][_0x0cb7('0x2f')]};});_0xb4654b[_0x0cb7('0x30')]=_[_0x0cb7('0x2b')](_0x2bc850,_0x0cb7('0x29'));_0xb4654b[_0x0cb7('0x31')]=_['keys'](_0xc263b4['query']);_0xb4654b[_0x0cb7('0x32')]=_[_0x0cb7('0x33')](_0xb4654b[_0x0cb7('0x30')],_0xb4654b[_0x0cb7('0x31')]);_0x5e54e2[_0x0cb7('0x34')]=_['intersection'](_0xb4654b[_0x0cb7('0x30')],qs[_0x0cb7('0x35')](_0xc263b4[_0x0cb7('0x31')]['fields']));_0x5e54e2[_0x0cb7('0x34')]=_0x5e54e2[_0x0cb7('0x34')][_0x0cb7('0x36')]?_0x5e54e2[_0x0cb7('0x34')]:_0xb4654b[_0x0cb7('0x30')];if(!_0xc263b4['query'][_0x0cb7('0x37')](_0x0cb7('0x38'))){_0x5e54e2['limit']=qs[_0x0cb7('0x22')](_0xc263b4[_0x0cb7('0x31')]['limit']);_0x5e54e2[_0x0cb7('0x20')]=qs[_0x0cb7('0x20')](_0xc263b4['query']['offset']);}_0x5e54e2['order']=qs[_0x0cb7('0x39')](_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x39')]);_0x5e54e2['where']=qs['filters'](_[_0x0cb7('0x3a')](_0xc263b4[_0x0cb7('0x31')],_0xb4654b['filters']),_0x2bc850);if(_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x3b')]){_0x5e54e2[_0x0cb7('0x3c')]=_[_0x0cb7('0x3d')](_0x5e54e2['where'],{'$or':_[_0x0cb7('0x2b')](_0x2bc850,function(_0x8bad60){if(_0x8bad60['type']!==_0x0cb7('0x3e')){var _0x47b7d2={};_0x47b7d2[_0x8bad60[_0x0cb7('0x29')]]={'$like':'%'+_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x3b')]+'%'};return _0x47b7d2;}})});}_0x5e54e2=_['merge']({},_0x5e54e2,_0xc263b4[_0x0cb7('0x3f')]);var _0x4dad2d={'where':_0x5e54e2[_0x0cb7('0x3c')]};return db[_0x0cb7('0x40')][_0x0cb7('0x23')](_0x4dad2d)[_0x0cb7('0x27')](function(_0x40e8b4){_0x4f964d[_0x0cb7('0x23')]=_0x40e8b4;if(_0xc263b4[_0x0cb7('0x31')][_0x0cb7('0x41')]){_0x5e54e2[_0x0cb7('0x42')]=[{'all':!![]}];}return db[_0x0cb7('0x40')][_0x0cb7('0x43')](_0x5e54e2);})['then'](function(_0x195098){_0x4f964d['rows']=_0x195098;return _0x4f964d;})[_0x0cb7('0x27')](respondWithFilteredResult(_0x47dd3b,_0x5e54e2))[_0x0cb7('0x44')](handleError(_0x47dd3b,null));};exports[_0x0cb7('0x45')]=function(_0x120a38,_0x4327cf){var _0x4c1230={'raw':!![],'where':{'id':_0x120a38[_0x0cb7('0x46')]['id']}},_0xd4fa40={};_0xd4fa40[_0x0cb7('0x30')]=_[_0x0cb7('0x47')](db[_0x0cb7('0x40')]['rawAttributes']);_0xd4fa40['query']=_[_0x0cb7('0x47')](_0x120a38[_0x0cb7('0x31')]);_0xd4fa40['filters']=_[_0x0cb7('0x33')](_0xd4fa40[_0x0cb7('0x30')],_0xd4fa40['query']);_0x4c1230['attributes']=_[_0x0cb7('0x33')](_0xd4fa40[_0x0cb7('0x30')],qs[_0x0cb7('0x35')](_0x120a38['query'][_0x0cb7('0x35')]));_0x4c1230['attributes']=_0x4c1230[_0x0cb7('0x34')][_0x0cb7('0x36')]?_0x4c1230[_0x0cb7('0x34')]:_0xd4fa40[_0x0cb7('0x30')];if(_0x120a38[_0x0cb7('0x31')]['includeAll']){_0x4c1230[_0x0cb7('0x42')]=[{'all':!![]}];}_0x4c1230=_[_0x0cb7('0x3d')]({},_0x4c1230,_0x120a38[_0x0cb7('0x3f')]);return db['ChatTransferReport']['find'](_0x4c1230)[_0x0cb7('0x27')](handleEntityNotFound(_0x4327cf,null))[_0x0cb7('0x27')](respondWithResult(_0x4327cf,null))[_0x0cb7('0x44')](handleError(_0x4327cf,null));};exports['create']=function(_0x16bca2,_0x4c84ff){return db[_0x0cb7('0x40')][_0x0cb7('0x48')](_0x16bca2[_0x0cb7('0x49')],{})[_0x0cb7('0x27')](respondWithResult(_0x4c84ff,0xc9))[_0x0cb7('0x44')](handleError(_0x4c84ff,null));};exports[_0x0cb7('0x26')]=function(_0x47cf42,_0x38452e){if(_0x47cf42['body']['id']){delete _0x47cf42['body']['id'];}return db[_0x0cb7('0x40')][_0x0cb7('0x4a')]({'where':{'id':_0x47cf42[_0x0cb7('0x46')]['id']}})[_0x0cb7('0x27')](handleEntityNotFound(_0x38452e,null))[_0x0cb7('0x27')](saveUpdates(_0x47cf42[_0x0cb7('0x49')],null))[_0x0cb7('0x27')](respondWithResult(_0x38452e,null))[_0x0cb7('0x44')](handleError(_0x38452e,null));};exports['destroy']=function(_0x21ce20,_0x1ddc24){return db['ChatTransferReport']['find']({'where':{'id':_0x21ce20['params']['id']}})[_0x0cb7('0x27')](handleEntityNotFound(_0x1ddc24,null))['then'](removeEntity(_0x1ddc24,null))['catch'](handleError(_0x1ddc24,null));};exports['describe']=function(_0x32955a,_0x1a453f){return db[_0x0cb7('0x40')][_0x0cb7('0x4b')]()['then'](respondWithResult(_0x1a453f,null))[_0x0cb7('0x44')](handleError(_0x1a453f,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index c8997f4..48c5d0a 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 _0x3831=['api','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3831,0xa7));var _0x1383=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0x3831[_0x403c8d];return _0x4ca60d;};'use strict';var _=require('lodash');var util=require(_0x1383('0x0'));var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1383('0x6'));var attributes=require(_0x1383('0x7'));module[_0x1383('0x8')]=function(_0x374b7c,_0xcf931e){return _0x374b7c[_0x1383('0x9')](_0x1383('0xa'),attributes,{'tableName':_0x1383('0xb'),'paranoid':![],'indexes':[{'name':_0x1383('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d8f=['exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x43829d,_0x5e47e9){var _0x1a6d13=function(_0x28faf4){while(--_0x28faf4){_0x43829d['push'](_0x43829d['shift']());}};_0x1a6d13(++_0x5e47e9);}(_0x8d8f,0x66));var _0xf8d8=function(_0x51cdf3,_0x290d9c){_0x51cdf3=_0x51cdf3-0x0;var _0xf2d8e7=_0x8d8f[_0x51cdf3];return _0xf2d8e7;};'use strict';var _=require(_0xf8d8('0x0'));var util=require(_0xf8d8('0x1'));var logger=require(_0xf8d8('0x2'))('api');var moment=require(_0xf8d8('0x3'));var BPromise=require(_0xf8d8('0x4'));var rp=require(_0xf8d8('0x5'));var fs=require('fs');var path=require(_0xf8d8('0x6'));var rimraf=require(_0xf8d8('0x7'));var config=require(_0xf8d8('0x8'));var attributes=require(_0xf8d8('0x9'));module[_0xf8d8('0xa')]=function(_0x743c5c,_0x3d8e66){return _0x743c5c[_0xf8d8('0xb')]('ChatTransferReport',attributes,{'tableName':_0xf8d8('0xc'),'paranoid':![],'indexes':[{'name':_0xf8d8('0xd'),'fields':[_0xf8d8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index a6e9c31..cdcb0a1 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 _0x0eae=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','moment'];(function(_0x51dada,_0x4ddb59){var _0x209d74=function(_0x2e1892){while(--_0x2e1892){_0x51dada['push'](_0x51dada['shift']());}};_0x209d74(++_0x4ddb59);}(_0x0eae,0x8e));var _0xe0ea=function(_0x180833,_0x2cdcaf){_0x180833=_0x180833-0x0;var _0x119a72=_0x0eae[_0x180833];return _0x119a72;};'use strict';var _=require(_0xe0ea('0x0'));var util=require('util');var moment=require(_0xe0ea('0x1'));var BPromise=require(_0xe0ea('0x2'));var rs=require(_0xe0ea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe0ea('0x5'));var config=require(_0xe0ea('0x6'));var jayson=require(_0xe0ea('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dea89,_0x33cd49,_0x367812){return new BPromise(function(_0xf284e,_0x257007){return client[_0xe0ea('0x8')](_0x3dea89,_0x367812)[_0xe0ea('0x9')](function(_0x170b9d){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x33cd49,_0xe0ea('0xa'));logger[_0xe0ea('0xb')](_0xe0ea('0xc'),_0x33cd49,_0xe0ea('0xa'),JSON['stringify'](_0x170b9d));if(_0x170b9d[_0xe0ea('0xd')]){if(_0x170b9d[_0xe0ea('0xd')]['code']===0x1f4){logger[_0xe0ea('0xd')](_0xe0ea('0xe'),_0x33cd49,_0x170b9d[_0xe0ea('0xd')][_0xe0ea('0xf')]);return _0x257007(_0x170b9d[_0xe0ea('0xd')]['message']);}logger[_0xe0ea('0xd')](_0xe0ea('0xe'),_0x33cd49,_0x170b9d[_0xe0ea('0xd')]['message']);return _0xf284e(_0x170b9d['error'][_0xe0ea('0xf')]);}else{logger[_0xe0ea('0x10')](_0xe0ea('0xe'),_0x33cd49,_0xe0ea('0xa'));_0xf284e(_0x170b9d[_0xe0ea('0x11')][_0xe0ea('0xf')]);}})['catch'](function(_0x211f91){logger[_0xe0ea('0xd')](_0xe0ea('0xe'),_0x33cd49,_0x211f91);_0x257007(_0x211f91);});});} \ No newline at end of file +var _0x7cd9=['jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x23b9af,_0x428b68){var _0x3dbd65=function(_0x3027c4){while(--_0x3027c4){_0x23b9af['push'](_0x23b9af['shift']());}};_0x3dbd65(++_0x428b68);}(_0x7cd9,0x71));var _0x97cd=function(_0x61bd5c,_0x2386fb){_0x61bd5c=_0x61bd5c-0x0;var _0x1289b5=_0x7cd9[_0x61bd5c];return _0x1289b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x97cd('0x0'));var BPromise=require(_0x97cd('0x1'));var rs=require(_0x97cd('0x2'));var fs=require('fs');var Redis=require(_0x97cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x97cd('0x4'))(_0x97cd('0x5'));var config=require(_0x97cd('0x6'));var jayson=require(_0x97cd('0x7'));var client=jayson[_0x97cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x235489,_0x440236,_0x24afb4){return new BPromise(function(_0x51b41b,_0x13e763){return client[_0x97cd('0x9')](_0x235489,_0x24afb4)['then'](function(_0x764b86){logger[_0x97cd('0xa')](_0x97cd('0xb'),_0x440236,_0x97cd('0xc'));logger[_0x97cd('0xd')](_0x97cd('0xe'),_0x440236,'request\x20sent',JSON['stringify'](_0x764b86));if(_0x764b86[_0x97cd('0xf')]){if(_0x764b86[_0x97cd('0xf')][_0x97cd('0x10')]===0x1f4){logger['error'](_0x97cd('0xb'),_0x440236,_0x764b86[_0x97cd('0xf')][_0x97cd('0x11')]);return _0x13e763(_0x764b86['error']['message']);}logger[_0x97cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x440236,_0x764b86[_0x97cd('0xf')][_0x97cd('0x11')]);return _0x51b41b(_0x764b86[_0x97cd('0xf')][_0x97cd('0x11')]);}else{logger[_0x97cd('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x440236,_0x97cd('0xc'));_0x51b41b(_0x764b86[_0x97cd('0x12')]['message']);}})[_0x97cd('0x13')](function(_0x5c5005){logger[_0x97cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x440236,_0x5c5005);_0x13e763(_0x5c5005);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fed89d0..7098788 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 _0x7d43=['describe','show','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe'];(function(_0x5f7592,_0x235310){var _0x3080c7=function(_0x23fc29){while(--_0x23fc29){_0x5f7592['push'](_0x5f7592['shift']());}};_0x3080c7(++_0x235310);}(_0x7d43,0x113));var _0x37d4=function(_0x56e906,_0x15aacf){_0x56e906=_0x56e906-0x0;var _0x3575e2=_0x7d43[_0x56e906];return _0x3575e2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x37d4('0x0'));var timeout=require(_0x37d4('0x1'));var express=require(_0x37d4('0x2'));var router=express[_0x37d4('0x3')]();var fs_extra=require(_0x37d4('0x4'));var auth=require(_0x37d4('0x5'));var interaction=require(_0x37d4('0x6'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x37d4('0x7')]('/',auth[_0x37d4('0x8')](),controller['index']);router[_0x37d4('0x7')](_0x37d4('0x9'),auth[_0x37d4('0x8')](),controller[_0x37d4('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x37d4('0xb')]);router['post']('/',auth[_0x37d4('0x8')](),controller[_0x37d4('0xc')]);router[_0x37d4('0xd')](_0x37d4('0xe'),auth[_0x37d4('0x8')](),controller[_0x37d4('0xf')]);router[_0x37d4('0x10')](_0x37d4('0xe'),auth['isAuthenticated'](),controller[_0x37d4('0x11')]);module[_0x37d4('0x12')]=router; \ No newline at end of file +var _0x8a60=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3fa631,_0x24392c){var _0x5c9dec=function(_0x36d01a){while(--_0x36d01a){_0x3fa631['push'](_0x3fa631['shift']());}};_0x5c9dec(++_0x24392c);}(_0x8a60,0x1b1));var _0x08a6=function(_0x1b5838,_0x25ec5b){_0x1b5838=_0x1b5838-0x0;var _0x213065=_0x8a60[_0x1b5838];return _0x213065;};'use strict';var multer=require(_0x08a6('0x0'));var util=require(_0x08a6('0x1'));var path=require(_0x08a6('0x2'));var timeout=require(_0x08a6('0x3'));var express=require(_0x08a6('0x4'));var router=express[_0x08a6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x08a6('0x6'));var interaction=require(_0x08a6('0x7'));var config=require(_0x08a6('0x8'));var controller=require(_0x08a6('0x9'));router['get']('/',auth[_0x08a6('0xa')](),controller['index']);router[_0x08a6('0xb')](_0x08a6('0xc'),auth[_0x08a6('0xa')](),controller[_0x08a6('0xd')]);router['get'](_0x08a6('0xe'),auth['isAuthenticated'](),controller[_0x08a6('0xf')]);router[_0x08a6('0x10')]('/',auth['isAuthenticated'](),controller[_0x08a6('0x11')]);router[_0x08a6('0x12')](_0x08a6('0xe'),auth['isAuthenticated'](),controller[_0x08a6('0x13')]);router[_0x08a6('0x14')](_0x08a6('0xe'),auth[_0x08a6('0xa')](),controller[_0x08a6('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index ab4d207..b625ef5 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 _0x5db4=['Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','ENUM','rounded','squared','Send','Contact\x20us','BOOLEAN','TEXT'];(function(_0x51d99b,_0x40f96f){var _0x359a78=function(_0x4eba9d){while(--_0x4eba9d){_0x51d99b['push'](_0x51d99b['shift']());}};_0x359a78(++_0x40f96f);}(_0x5db4,0xd2));var _0x45db=function(_0x15b810,_0x63d5f6){_0x15b810=_0x15b810-0x0;var _0xaf9022=_0x5db4[_0x15b810];return _0xaf9022;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x45db('0x0'));module[_0x45db('0x1')]={'name':{'type':Sequelize[_0x45db('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'unique':_0x45db('0x3')},'description':{'type':Sequelize[_0x45db('0x2')]},'mapKey':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x4')},'mapKeyOffline':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0x45db('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x45db('0x5')},'customerAlias':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x45db('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':_0x45db('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x45db('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x45db('0x8')](_0x45db('0x9'),_0x45db('0xa')),'defaultValue':_0x45db('0x9')},'header_online':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xb')},'header_offline':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xc')},'download_transcript':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x45db('0xe')]},'closingQuestion':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x11')},'placeholderMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x12')},'closingMessageButton':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xb')},'skipMessageButton':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x45db('0x8')](_0x45db('0x13'),_0x45db('0x14')),'defaultValue':_0x45db('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x45db('0xe')],'defaultValue':function(){return JSON[_0x45db('0x15')]({'items':[{'type':_0x45db('0x16'),'variable':null,'config':{'placeholder':_0x45db('0x17'),'type':_0x45db('0x18'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x45db('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x45db('0x4'),'type':_0x45db('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x45db('0x19')]('onlineForm')?JSON[_0x45db('0x1a')](this['getDataValue'](_0x45db('0x1b'))):{};},'set':function(_0x3a7070){return this[_0x45db('0x1c')]('onlineForm',JSON['stringify'](_0x3a7070));}},'offlineForm':{'type':Sequelize[_0x45db('0xe')],'defaultValue':function(){return JSON[_0x45db('0x15')]({'items':[{'type':_0x45db('0x16'),'props':{'title':_0x45db('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x45db('0x4'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x45db('0x1d')},'props':{'title':_0x45db('0x1d'),'helpText':_0x45db('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x45db('0x19')](_0x45db('0x1f'))?JSON[_0x45db('0x1a')](this[_0x45db('0x19')](_0x45db('0x1f'))):{};},'set':function(_0x2953e1){return this[_0x45db('0x1c')](_0x45db('0x1f'),JSON[_0x45db('0x15')](_0x2953e1));}},'token':{'type':Sequelize[_0x45db('0x2')],'defaultValue':function(){return rs[_0x45db('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x45db('0x2')]},'forwardOffline':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x45db('0x2')]},'waitingTitle':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x21')},'waitingMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x22')},'offlineMessageBody':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x23')},'skipUnmanaged':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x45db('0xe')],'defaultValue':function(){return _0x45db('0x24');}},'notificationSound':{'type':Sequelize[_0x45db('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x45db('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x45db('0x2')],'defaultValue':_0x45db('0x25')},'verticalAlignment':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x45db('0x26')},'defaultTitle':{'type':Sequelize[_0x45db('0x2')]},'customerAvatar':{'type':Sequelize[_0x45db('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x45db('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':_0x45db('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x45db('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x45db('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x45db('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x45db('0x7')],'comment':_0x45db('0x28')},'mandatoryDisposition':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![],'comment':_0x45db('0x29'),'set':function(_0x2faf8a){if(!_0x2faf8a)this[_0x45db('0x1c')](_0x45db('0x2a'),null);this[_0x45db('0x1c')](_0x45db('0x2b'),_0x2faf8a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x45db('0x2')]},'vidaooTopic':{'type':Sequelize[_0x45db('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x45db('0x2')],'defaultValue':function(){return _0x45db('0x2c');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x45db('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x45db('0xe')]}}; \ No newline at end of file +var _0x4c8a=['exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','squared','rounded','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','star','thumb','stringify','name','text','input','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring'];(function(_0x2f9849,_0x209c0e){var _0x1aefac=function(_0x127084){while(--_0x127084){_0x2f9849['push'](_0x2f9849['shift']());}};_0x1aefac(++_0x209c0e);}(_0x4c8a,0x155));var _0xa4c8=function(_0x4e99e4,_0x438118){_0x4e99e4=_0x4e99e4-0x0;var _0x558491=_0x4c8a[_0x4e99e4];return _0x558491;};'use strict';var Sequelize=require(_0xa4c8('0x0'));var rs=require(_0xa4c8('0x1'));module[_0xa4c8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa4c8('0x3')]},'mapKey':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x5')},'customerAlias':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa4c8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':_0xa4c8('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa4c8('0x3')]},'animation':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa4c8('0x9')]('rounded',_0xa4c8('0xa')),'defaultValue':_0xa4c8('0xb')},'header_online':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0xc')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa4c8('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x11')},'noteTitle':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x12')},'placeholderMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x13')},'closingMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x14')},'skipMessageButton':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa4c8('0x9')](_0xa4c8('0x16'),_0xa4c8('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xa4c8('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xa4c8('0x19'),'type':_0xa4c8('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xa4c8('0x1b'),'props':{'title':_0xa4c8('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xa4c8('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa4c8('0x1c')](_0xa4c8('0x1d'))?JSON['parse'](this[_0xa4c8('0x1c')](_0xa4c8('0x1d'))):{};},'set':function(_0x5a7e21){return this[_0xa4c8('0x1e')](_0xa4c8('0x1d'),JSON[_0xa4c8('0x18')](_0x5a7e21));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xa4c8('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa4c8('0x4'),'type':_0xa4c8('0x4')},'variable':null},{'type':_0xa4c8('0x1f'),'config':{'placeholder':_0xa4c8('0x20')},'props':{'title':_0xa4c8('0x20'),'helpText':_0xa4c8('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON['parse'](this[_0xa4c8('0x1c')](_0xa4c8('0x22'))):{};},'set':function(_0x5a3453){return this[_0xa4c8('0x1e')]('offlineForm',JSON[_0xa4c8('0x18')](_0x5a3453));}},'token':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':function(){return rs[_0xa4c8('0x23')]();}},'autoclose':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa4c8('0x3')]},'waitingTitle':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x15')},'sendUnmanaged':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa4c8('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa4c8('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[_0xa4c8('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa4c8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x28')},'verticalAlignment':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xa4c8('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa4c8('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':_0xa4c8('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa4c8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa4c8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':_0xa4c8('0x2b')},'systemAvatar':{'type':Sequelize[_0xa4c8('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![],'comment':_0xa4c8('0x2c'),'set':function(_0x798076){if(!_0x798076)this[_0xa4c8('0x1e')](_0xa4c8('0x2d'),null);this['setDataValue'](_0xa4c8('0x2e'),_0x798076);}},'vidaooEscalation':{'type':Sequelize[_0xa4c8('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa4c8('0x3')]},'vidaooTopic':{'type':Sequelize[_0xa4c8('0x3')],'allowNull':![],'defaultValue':_0xa4c8('0x2f')},'vidaooNote':{'type':Sequelize[_0xa4c8('0x3')],'defaultValue':function(){return _0xa4c8('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xa4c8('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa4c8('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9e76e8e..4df2f18 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 _0x26fb=['papaparse','../../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','./chatWebsite.socket','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','ChatWebsites','stack','name','status','send','Pause','mandatoryDispositionPause','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','ChatWebsite','findAll','rows','catch','show','rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','params','ChatWebsiteId','findOne','Disposition','include','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','filename','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','notify','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','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','CmList','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','priority','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','interaction','ChatInteraction','messageId','created','push','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','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','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','basename','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','auth','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','omit','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','Interval','Intervals','getProactiveActions','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','virtual','replace','verticalAlignment','color','textColor','backgroundColor','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring'];(function(_0x6c6857,_0x204494){var _0x19e2fe=function(_0x4d78d4){while(--_0x4d78d4){_0x6c6857['push'](_0x6c6857['shift']());}};_0x19e2fe(++_0x204494);}(_0x26fb,0x11e));var _0xb26f=function(_0x7ff9e4,_0x19e358){_0x7ff9e4=_0x7ff9e4-0x0;var _0x468415=_0x26fb[_0x7ff9e4];return _0x468415;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb26f('0x0'));var zipdir=require(_0xb26f('0x1'));var jsonpatch=require(_0xb26f('0x2'));var rp=require('request-promise');var moment=require(_0xb26f('0x3'));var BPromise=require(_0xb26f('0x4'));var Mustache=require(_0xb26f('0x5'));var util=require(_0xb26f('0x6'));var path=require(_0xb26f('0x7'));var sox=require(_0xb26f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb26f('0x9'));var _=require(_0xb26f('0xa'));var squel=require(_0xb26f('0xb'));var crypto=require(_0xb26f('0xc'));var jsforce=require(_0xb26f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb26f('0xe'));var querystring=require(_0xb26f('0xf'));var Papa=require(_0xb26f('0x10'));var Redis=require('ioredis');var authService=require(_0xb26f('0x11'));var qs=require(_0xb26f('0x12'));var as=require(_0xb26f('0x13'));var hardwareService=require(_0xb26f('0x14'));var logger=require(_0xb26f('0x15'))(_0xb26f('0x16'));var utils=require('../../config/utils');var config=require(_0xb26f('0x17'));var licenseUtil=require(_0xb26f('0x18'));var db=require(_0xb26f('0x19'))['db'];config[_0xb26f('0x1a')]=_[_0xb26f('0x1b')](config[_0xb26f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb26f('0x1c'))(new Redis(config['redis']));require(_0xb26f('0x1d'))['register'](socket);var jayson=require(_0xb26f('0x1e'));var client=jayson[_0xb26f('0x1f')][_0xb26f('0x20')]({'port':0x232c});var client9002=jayson[_0xb26f('0x1f')]['http']({'port':0x232a});var client9003=jayson['client'][_0xb26f('0x20')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x281917,_0x42d7d9,_0x31b381,_0x5985a6){return new BPromise(function(_0x4c3239,_0x5bd26c){var _0x10c7b6=_0x5985a6||client;return _0x10c7b6[_0xb26f('0x21')](_0x281917,_0x31b381)['then'](function(_0x461677){logger[_0xb26f('0x22')](_0xb26f('0x23'),_0x42d7d9,'request\x20sent');logger[_0xb26f('0x24')](_0xb26f('0x25'),_0x42d7d9,_0xb26f('0x26'),JSON[_0xb26f('0x27')](_0x461677));if(_0x461677[_0xb26f('0x28')]){if(_0x461677[_0xb26f('0x28')][_0xb26f('0x29')]===0x1f4){logger['error'](_0xb26f('0x23'),_0x42d7d9,_0x461677['error'][_0xb26f('0x2a')]);return _0x5bd26c(_0x461677[_0xb26f('0x28')][_0xb26f('0x2a')]);}logger['error'](_0xb26f('0x23'),_0x42d7d9,_0x461677[_0xb26f('0x28')]['message']);return _0x4c3239(_0x461677['error'][_0xb26f('0x2a')]);}else{logger[_0xb26f('0x22')](_0xb26f('0x23'),_0x42d7d9,_0xb26f('0x26'));_0x4c3239(_0x461677['result'][_0xb26f('0x2a')]);}})['catch'](function(_0x4752db){logger[_0xb26f('0x28')](_0xb26f('0x23'),_0x42d7d9,_0x4752db);_0x5bd26c(_0x4752db);});});}function respondWithStatusCode(_0x378d2f,_0x57af9d){_0x57af9d=_0x57af9d||0xcc;return function(_0x3cfca0){if(_0x3cfca0){return _0x378d2f[_0xb26f('0x2b')](_0x57af9d);}return _0x378d2f['status'](_0x57af9d)[_0xb26f('0x2c')]();};}function respondWithResult(_0x21077b,_0x3c251b){_0x3c251b=_0x3c251b||0xc8;return function(_0x3f6d5b){if(_0x3f6d5b){return _0x21077b['status'](_0x3c251b)[_0xb26f('0x2d')](_0x3f6d5b);}};}function respondWithFilteredResult(_0x2c112d,_0x4ef0ab){return function(_0x2939ae){if(_0x2939ae){var _0x40e185=typeof _0x4ef0ab[_0xb26f('0x2e')]===_0xb26f('0x2f')&&typeof _0x4ef0ab[_0xb26f('0x30')]==='undefined';var _0x5ae183=_0x2939ae[_0xb26f('0x31')];var _0x6f4265=_0x40e185?0x0:_0x4ef0ab[_0xb26f('0x2e')];var _0x674091=_0x40e185?_0x2939ae[_0xb26f('0x31')]:_0x4ef0ab[_0xb26f('0x2e')]+_0x4ef0ab[_0xb26f('0x30')];var _0x3d09eb;if(_0x674091>=_0x5ae183){_0x674091=_0x5ae183;_0x3d09eb=0xc8;}else{_0x3d09eb=0xce;}_0x2c112d['status'](_0x3d09eb);return _0x2c112d['set']('Content-Range',_0x6f4265+'-'+_0x674091+'/'+_0x5ae183)[_0xb26f('0x2d')](_0x2939ae);}return null;};}function patchUpdates(_0x50f750){return function(_0x1e66a4){try{jsonpatch[_0xb26f('0x32')](_0x1e66a4,_0x50f750,!![]);}catch(_0xa20663){return BPromise[_0xb26f('0x33')](_0xa20663);}return _0x1e66a4['save']();};}function saveUpdates(_0x1543f,_0x209aa0){return function(_0x141477){if(_0x141477){return _0x141477[_0xb26f('0x34')](_0x1543f)[_0xb26f('0x35')](function(_0x2c217d){return _0x2c217d;});}return null;};}function removeEntity(_0x1a0dbd,_0x55e805){return function(_0x32448e){if(_0x32448e){return _0x32448e[_0xb26f('0x36')]()[_0xb26f('0x35')](function(){var _0x1309d9=_0x32448e[_0xb26f('0x37')]({'plain':!![]});var _0x2a43d8=_0xb26f('0x38');return db['UserProfileResource'][_0xb26f('0x36')]({'where':{'type':_0x2a43d8,'resourceId':_0x1309d9['id']}})['then'](function(){return _0x32448e;});})[_0xb26f('0x35')](function(){_0x1a0dbd['status'](0xcc)[_0xb26f('0x2c')]();});}};}function handleEntityNotFound(_0x3fe3a8,_0x84c88){return function(_0x3b5899){if(!_0x3b5899){_0x3fe3a8[_0xb26f('0x2b')](0x194);}return _0x3b5899;};}function handleError(_0x5918e9,_0x305f83){_0x305f83=_0x305f83||0x1f4;return function(_0x1adfb0){logger[_0xb26f('0x28')](_0x1adfb0[_0xb26f('0x39')]);if(_0x1adfb0[_0xb26f('0x3a')]){delete _0x1adfb0[_0xb26f('0x3a')];}_0x5918e9[_0xb26f('0x3b')](_0x305f83)[_0xb26f('0x3c')](_0x1adfb0);};}exports['index']=function(_0x20f048,_0x4ecd11){var _0x7f8352={'include':[{'model':db[_0xb26f('0x3d')],'as':_0xb26f('0x3e')}]},_0x27cd71={},_0x80dc3e={'count':0x0,'rows':[]};var _0x19e81f=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x1e3ddb){return{'name':_0x1e3ddb[_0xb26f('0x3f')],'type':_0x1e3ddb[_0xb26f('0x40')][_0xb26f('0x41')]};});_0x27cd71[_0xb26f('0x42')]=_['map'](_0x19e81f,_0xb26f('0x3a'));_0x27cd71[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x20f048[_0xb26f('0x43')]);_0x27cd71[_0xb26f('0x45')]=_['intersection'](_0x27cd71[_0xb26f('0x42')],_0x27cd71[_0xb26f('0x43')]);_0x7f8352[_0xb26f('0x46')]=_['intersection'](_0x27cd71[_0xb26f('0x42')],qs['fields'](_0x20f048[_0xb26f('0x43')][_0xb26f('0x47')]));_0x7f8352[_0xb26f('0x46')]=_0x7f8352['attributes'][_0xb26f('0x48')]?_0x7f8352[_0xb26f('0x46')]:_0x27cd71['model'];if(!_0x20f048[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x7f8352['limit']=qs[_0xb26f('0x30')](_0x20f048['query'][_0xb26f('0x30')]);_0x7f8352[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x20f048[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x7f8352[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x20f048[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x7f8352[_0xb26f('0x4d')]=qs['filters'](_[_0xb26f('0x4e')](_0x20f048[_0xb26f('0x43')],_0x27cd71[_0xb26f('0x45')]),_0x19e81f);if(_0x20f048[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x7f8352['where']=_[_0xb26f('0x50')](_0x7f8352[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x19e81f,function(_0x23e249){if(_0x23e249['type']!=='VIRTUAL'){var _0x1155e4={};_0x1155e4[_0x23e249['name']]={'$like':'%'+_0x20f048[_0xb26f('0x43')][_0xb26f('0x4f')]+'%'};return _0x1155e4;}})});}_0x7f8352=_[_0xb26f('0x50')]({},_0x7f8352,_0x20f048[_0xb26f('0x52')]);var _0x629290={'where':_0x7f8352[_0xb26f('0x4d')]};return db['ChatWebsite'][_0xb26f('0x31')](_0x629290)[_0xb26f('0x35')](function(_0x49b6dd){_0x80dc3e[_0xb26f('0x31')]=_0x49b6dd;if(_0x20f048[_0xb26f('0x43')][_0xb26f('0x53')]){_0x7f8352['include']=[{'all':!![]}];}return db[_0xb26f('0x54')][_0xb26f('0x55')](_0x7f8352);})[_0xb26f('0x35')](function(_0x593822){_0x80dc3e[_0xb26f('0x56')]=_0x593822;return _0x80dc3e;})['then'](respondWithFilteredResult(_0x4ecd11,_0x7f8352))[_0xb26f('0x57')](handleError(_0x4ecd11,null));};exports[_0xb26f('0x58')]=function(_0x414ac6,_0x1fae4c){var _0x136cc1={'raw':![],'where':{'id':_0x414ac6['params']['id']},'include':[{'model':db[_0xb26f('0x3d')],'as':_0xb26f('0x3e')}]},_0x49f09f={};_0x49f09f[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0x54')][_0xb26f('0x59')]);_0x49f09f[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x414ac6['query']);_0x49f09f[_0xb26f('0x45')]=_[_0xb26f('0x5a')](_0x49f09f[_0xb26f('0x42')],_0x49f09f[_0xb26f('0x43')]);_0x136cc1[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x49f09f['model'],qs[_0xb26f('0x47')](_0x414ac6[_0xb26f('0x43')][_0xb26f('0x47')]));_0x136cc1[_0xb26f('0x46')]=_0x136cc1[_0xb26f('0x46')][_0xb26f('0x48')]?_0x136cc1[_0xb26f('0x46')]:_0x49f09f[_0xb26f('0x42')];if(_0x414ac6[_0xb26f('0x43')][_0xb26f('0x53')]){_0x136cc1['include']=[{'all':!![]}];}_0x136cc1=_[_0xb26f('0x50')]({},_0x136cc1,_0x414ac6[_0xb26f('0x52')]);return db[_0xb26f('0x54')]['find'](_0x136cc1)[_0xb26f('0x35')](handleEntityNotFound(_0x1fae4c,null))[_0xb26f('0x35')](respondWithResult(_0x1fae4c,null))[_0xb26f('0x57')](handleError(_0x1fae4c,null));};exports['create']=function(_0xc5ce94,_0x58bd8e){return db['ChatWebsite'][_0xb26f('0x5b')](_0xc5ce94[_0xb26f('0x5c')],{})[_0xb26f('0x35')](function(_0x1a2ca7){var _0x102b68=_0xc5ce94[_0xb26f('0x5d')][_0xb26f('0x37')]({'plain':!![]});if(!_0x102b68)throw new Error(_0xb26f('0x5e'));if(_0x102b68[_0xb26f('0x5f')]===_0xb26f('0x5d')){var _0x1b3bbc=_0x1a2ca7['get']({'plain':!![]});var _0xeb84c1=_0xb26f('0x38');return db[_0xb26f('0x60')][_0xb26f('0x61')]({'where':{'name':_0xeb84c1,'userProfileId':_0x102b68[_0xb26f('0x62')]},'raw':!![]})[_0xb26f('0x35')](function(_0x4035a6){if(_0x4035a6&&_0x4035a6[_0xb26f('0x63')]===0x0){return db[_0xb26f('0x64')]['create']({'name':_0x1b3bbc[_0xb26f('0x3a')],'resourceId':_0x1b3bbc['id'],'type':_0x4035a6[_0xb26f('0x3a')],'sectionId':_0x4035a6['id']},{})[_0xb26f('0x35')](function(){return _0x1a2ca7;});}else{return _0x1a2ca7;}})[_0xb26f('0x57')](function(_0x4a57dc){logger[_0xb26f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a57dc);throw _0x4a57dc;});}return _0x1a2ca7;})[_0xb26f('0x35')](respondWithResult(_0x58bd8e,0xc9))['catch'](handleError(_0x58bd8e,null));};exports['update']=function(_0x5863e4,_0xb1b89c){if(_0x5863e4[_0xb26f('0x5c')]['id']){delete _0x5863e4[_0xb26f('0x5c')]['id'];}return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x5863e4['params']['id']},'include':[{'model':db[_0xb26f('0x3d')],'as':_0xb26f('0x3e')}]})[_0xb26f('0x35')](handleEntityNotFound(_0xb1b89c,null))[_0xb26f('0x35')](saveUpdates(_0x5863e4[_0xb26f('0x5c')],null))[_0xb26f('0x35')](respondWithResult(_0xb1b89c,null))[_0xb26f('0x57')](handleError(_0xb1b89c,null));};exports[_0xb26f('0x36')]=function(_0x417dc6,_0x5dde9e){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x417dc6['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5dde9e,null))[_0xb26f('0x35')](removeEntity(_0x5dde9e,null))[_0xb26f('0x57')](handleError(_0x5dde9e,null));};exports['describe']=function(_0x2d3902,_0x893ea9){return db[_0xb26f('0x54')][_0xb26f('0x65')]()[_0xb26f('0x35')](respondWithResult(_0x893ea9,null))['catch'](handleError(_0x893ea9,null));};exports[_0xb26f('0x66')]=function(_0xc16170,_0x1b8148,_0xfae85e){if(_0xc16170[_0xb26f('0x5c')]['id']){delete _0xc16170[_0xb26f('0x5c')]['id'];}return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0xc16170[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x1b8148,null))[_0xb26f('0x35')](function(_0x2ac616){if(_0x2ac616){_0xc16170[_0xb26f('0x5c')][_0xb26f('0x68')]=_0x2ac616['id'];return db['Disposition'][_0xb26f('0x5b')](_0xc16170[_0xb26f('0x5c')]);}})['then'](respondWithResult(_0x1b8148,null))[_0xb26f('0x57')](handleError(_0x1b8148,null));};exports['getDispositions']=function(_0x27b21a,_0x3408bd,_0x2c4b2a){var _0x3a807b={'raw':![],'where':{}};var _0x4de2b1={};var _0x3d8356={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x27b21a[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x3408bd,null))[_0xb26f('0x35')](function(_0x55b39e){if(_0x55b39e){_0x4de2b1['model']=_['keys'](db[_0xb26f('0x6a')][_0xb26f('0x59')]);_0x4de2b1[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x27b21a['query']);_0x4de2b1[_0xb26f('0x45')]=_[_0xb26f('0x5a')](_0x4de2b1['model'],_0x4de2b1[_0xb26f('0x43')]);_0x3a807b[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x4de2b1[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x27b21a[_0xb26f('0x43')][_0xb26f('0x47')]));_0x3a807b[_0xb26f('0x46')]=_0x3a807b[_0xb26f('0x46')][_0xb26f('0x48')]?_0x3a807b[_0xb26f('0x46')]:_0x4de2b1[_0xb26f('0x42')];if(!_0x27b21a['query'][_0xb26f('0x49')]('nolimit')){_0x3a807b[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x27b21a[_0xb26f('0x43')]['limit']);_0x3a807b[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x27b21a[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x3a807b['order']=qs['sort'](_0x27b21a[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x3a807b[_0xb26f('0x4d')]=qs[_0xb26f('0x45')](_[_0xb26f('0x4e')](_0x27b21a[_0xb26f('0x43')],_0x4de2b1[_0xb26f('0x45')]));_0x3a807b[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x55b39e['id'];if(_0x27b21a[_0xb26f('0x43')]['filter']){_0x3a807b[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x3a807b[_0xb26f('0x4d')],{'$or':_['map'](_0x3a807b[_0xb26f('0x46')],function(_0xbd6852){var _0x16591d={};_0x16591d[_0xbd6852]={'$like':'%'+_0x27b21a[_0xb26f('0x43')]['filter']+'%'};return _0x16591d;})});}_0x3a807b=_[_0xb26f('0x50')]({},_0x3a807b,_0x27b21a[_0xb26f('0x52')]);return db[_0xb26f('0x6a')][_0xb26f('0x31')]({'where':_0x3a807b['where']})['then'](function(_0x54a003){_0x3d8356[_0xb26f('0x31')]=_0x54a003;if(_0x27b21a[_0xb26f('0x43')]['includeAll']){_0x3a807b[_0xb26f('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xb26f('0x55')](_0x3a807b);})[_0xb26f('0x35')](function(_0x160ad9){_0x3d8356[_0xb26f('0x56')]=_0x160ad9;return _0x3d8356;});}})[_0xb26f('0x35')](respondWithFilteredResult(_0x3408bd,_0x3a807b))[_0xb26f('0x57')](handleError(_0x3408bd,null));};exports[_0xb26f('0x6c')]=function(_0x31fb05,_0x2c4a61,_0x1b6ac2){return db['ChatWebsite']['find']({'where':{'id':_0x31fb05[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x2c4a61,null))[_0xb26f('0x35')](function(_0x24144a){if(_0x24144a){return _0x24144a[_0xb26f('0x6c')](_0x31fb05['query']['ids']);}})[_0xb26f('0x35')](respondWithStatusCode(_0x2c4a61,null))[_0xb26f('0x57')](handleError(_0x2c4a61,null));};exports[_0xb26f('0x6d')]=function(_0x2ebd3f,_0x4acdeb,_0xe1c120){if(_0x2ebd3f[_0xb26f('0x5c')]['id']){delete _0x2ebd3f[_0xb26f('0x5c')]['id'];}return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x2ebd3f[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x4acdeb,null))[_0xb26f('0x35')](function(_0x22a5f8){if(_0x22a5f8){_0x2ebd3f[_0xb26f('0x5c')]['ChatWebsiteId']=_0x22a5f8['id'];return db['CannedAnswer'][_0xb26f('0x5b')](_0x2ebd3f[_0xb26f('0x5c')]);}})[_0xb26f('0x35')](respondWithResult(_0x4acdeb,null))['catch'](handleError(_0x4acdeb,null));};exports[_0xb26f('0x6e')]=function(_0xebf77b,_0x5a1bbf,_0x423fb0){var _0x4d5dcd={'raw':![],'where':{}};var _0xf3b5a8={};var _0x15fd69={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0xebf77b['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5a1bbf,null))['then'](function(_0x2b638d){if(_0x2b638d){_0xf3b5a8[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0x6f')][_0xb26f('0x59')]);_0xf3b5a8[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0xebf77b[_0xb26f('0x43')]);_0xf3b5a8['filters']=_[_0xb26f('0x5a')](_0xf3b5a8['model'],_0xf3b5a8[_0xb26f('0x43')]);_0x4d5dcd['attributes']=_[_0xb26f('0x5a')](_0xf3b5a8[_0xb26f('0x42')],qs['fields'](_0xebf77b[_0xb26f('0x43')][_0xb26f('0x47')]));_0x4d5dcd['attributes']=_0x4d5dcd['attributes'][_0xb26f('0x48')]?_0x4d5dcd[_0xb26f('0x46')]:_0xf3b5a8[_0xb26f('0x42')];if(!_0xebf77b[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x4d5dcd[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0xebf77b['query'][_0xb26f('0x30')]);_0x4d5dcd[_0xb26f('0x2e')]=qs['offset'](_0xebf77b[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x4d5dcd[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0xebf77b[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x4d5dcd[_0xb26f('0x4d')]=qs['filters'](_[_0xb26f('0x4e')](_0xebf77b[_0xb26f('0x43')],_0xf3b5a8['filters']));_0x4d5dcd[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x2b638d['id'];if(_0xebf77b[_0xb26f('0x43')]['filter']){_0x4d5dcd[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x4d5dcd[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x4d5dcd['attributes'],function(_0x1d081c){var _0x9ec5db={};_0x9ec5db[_0x1d081c]={'$like':'%'+_0xebf77b[_0xb26f('0x43')][_0xb26f('0x4f')]+'%'};return _0x9ec5db;})});}_0x4d5dcd=_[_0xb26f('0x50')]({},_0x4d5dcd,_0xebf77b[_0xb26f('0x52')]);return db[_0xb26f('0x6f')][_0xb26f('0x31')]({'where':_0x4d5dcd[_0xb26f('0x4d')]})[_0xb26f('0x35')](function(_0xf13796){_0x15fd69[_0xb26f('0x31')]=_0xf13796;if(_0xebf77b[_0xb26f('0x43')]['includeAll']){_0x4d5dcd[_0xb26f('0x6b')]=[{'all':!![]}];}return db[_0xb26f('0x6f')][_0xb26f('0x55')](_0x4d5dcd);})[_0xb26f('0x35')](function(_0xdeb20){_0x15fd69[_0xb26f('0x56')]=_0xdeb20;return _0x15fd69;});}})[_0xb26f('0x35')](respondWithFilteredResult(_0x5a1bbf,_0x4d5dcd))[_0xb26f('0x57')](handleError(_0x5a1bbf,null));};exports[_0xb26f('0x70')]=function(_0x5c6ed9,_0x261ad4,_0x36424c){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x5c6ed9[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x261ad4,null))[_0xb26f('0x35')](function(_0x1be6d2){if(_0x1be6d2){return _0x1be6d2['removeAnswers'](_0x5c6ed9[_0xb26f('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x261ad4,null))['catch'](handleError(_0x261ad4,null));};exports[_0xb26f('0x71')]=function(_0x1fb114,_0x39680d,_0x37e021){_0x1fb114[_0xb26f('0x5c')][_0xb26f('0x72')]=_0x1fb114['file'][_0xb26f('0x73')];return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x1fb114[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x39680d,null))[_0xb26f('0x35')](saveUpdates(_0x1fb114[_0xb26f('0x5c')],null))['then'](respondWithResult(_0x39680d,null))[_0xb26f('0x57')](handleError(_0x39680d,null));};exports['addAvatar']=function(_0x4864c0,_0x30fbb2,_0x5285e1){_0x4864c0['body'][_0xb26f('0x74')]=_0x4864c0[_0xb26f('0x75')][_0xb26f('0x73')];return db[_0xb26f('0x54')]['find']({'where':{'id':_0x4864c0['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x30fbb2,null))[_0xb26f('0x35')](saveUpdates(_0x4864c0['body'],null))[_0xb26f('0x35')](respondWithResult(_0x30fbb2,null))[_0xb26f('0x57')](handleError(_0x30fbb2,null));};exports['addCustomerAvatar']=function(_0x462c9f,_0x5d2f18,_0x179429){_0x462c9f['body'][_0xb26f('0x76')]=_0x462c9f[_0xb26f('0x75')]['filename'];return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x462c9f[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5d2f18,null))['then'](saveUpdates(_0x462c9f[_0xb26f('0x5c')],null))[_0xb26f('0x35')](respondWithResult(_0x5d2f18,null))[_0xb26f('0x57')](handleError(_0x5d2f18,null));};exports[_0xb26f('0x77')]=function(_0x540ad4,_0x18261f,_0x542be0){_0x540ad4['body'][_0xb26f('0x78')]=_0x540ad4['file']['filename'];return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x540ad4['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x18261f,null))['then'](saveUpdates(_0x540ad4[_0xb26f('0x5c')],null))['then'](respondWithResult(_0x18261f,null))['catch'](handleError(_0x18261f,null));};exports[_0xb26f('0x79')]=function(_0x1e38f6,_0x4abeae,_0x4a520d){var _0x30306=path['join'](config[_0xb26f('0x7a')],'server/files/images/logos/default_logo.svg');var _0x50a5e7={'where':{'id':_0x1e38f6[_0xb26f('0x67')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x309a65=![];return require(_0xb26f('0x18'))[_0xb26f('0x7b')]()[_0xb26f('0x35')](function(_0x47b4cb){if(_0x47b4cb){_0x309a65=_0x47b4cb[_0xb26f('0x7c')];}})[_0xb26f('0x35')](function(){return db['ChatWebsite'][_0xb26f('0x61')](_0x50a5e7);})['then'](handleEntityNotFound(_0x4abeae,null))['then'](function(_0x47d3d4){if(_0x47d3d4){if(!_['isNil'](_0x47d3d4['sitepic'])){if(fs[_0xb26f('0x7d')](path[_0xb26f('0x7e')](config['root'],'server/files/images/logos/',_0x47d3d4[_0xb26f('0x72')]))&&_0x309a65){_0x30306=path[_0xb26f('0x7e')](config['root'],_0xb26f('0x7f'),_0x47d3d4[_0xb26f('0x72')]);}}return _0x4abeae[_0xb26f('0x80')](_0x30306);}})[_0xb26f('0x57')](handleError(_0x4abeae,null));};exports['getAvatar']=function(_0x4d79c7,_0x22077a,_0x19fdd0){var _0x32e86c=path[_0xb26f('0x7e')](config['root'],_0xb26f('0x81'));var _0x16f9f4={'where':{'id':_0x4d79c7[_0xb26f('0x67')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x16f9f4)[_0xb26f('0x35')](handleEntityNotFound(_0x22077a,null))['then'](function(_0x2ae72a){if(_0x2ae72a){if(!_[_0xb26f('0x82')](_0x2ae72a['agentAvatar'])){if(fs[_0xb26f('0x7d')](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x83'),_0x2ae72a[_0xb26f('0x74')]))){_0x32e86c=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/',_0x2ae72a[_0xb26f('0x74')]);}}return _0x22077a[_0xb26f('0x80')](_0x32e86c);}})[_0xb26f('0x57')](handleError(_0x22077a,null));};exports[_0xb26f('0x84')]=function(_0x3a6eba,_0x2623eb,_0x4c9be9){var _0x4082aa=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/customer_avatar.png');var _0x221202={'where':{'id':_0x3a6eba[_0xb26f('0x67')]['id']},'attributes':['id',_0xb26f('0x76'),_0xb26f('0x85')],'raw':!![]};return db[_0xb26f('0x54')]['find'](_0x221202)['then'](handleEntityNotFound(_0x2623eb,null))['then'](function(_0x3da409){if(_0x3da409){if(!_[_0xb26f('0x82')](_0x3da409[_0xb26f('0x76')])){if(fs['existsSync'](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x83'),_0x3da409[_0xb26f('0x76')]))&&_0x3da409[_0xb26f('0x85')]){_0x4082aa=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x83'),_0x3da409[_0xb26f('0x76')]);}}return _0x2623eb[_0xb26f('0x80')](_0x4082aa);}})[_0xb26f('0x57')](handleError(_0x2623eb,null));};exports[_0xb26f('0x86')]=function(_0x40b042,_0x969ebb,_0x4d1d01){var _0x4c4760=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/system_avatar.png');var _0x4ac2a2={'where':{'id':_0x40b042['params']['id']},'attributes':['id',_0xb26f('0x78')],'raw':!![]};return db[_0xb26f('0x54')]['find'](_0x4ac2a2)[_0xb26f('0x35')](handleEntityNotFound(_0x969ebb,null))[_0xb26f('0x35')](function(_0xb76cbf){if(_0xb76cbf){if(!_[_0xb26f('0x82')](_0xb76cbf[_0xb26f('0x78')])){if(fs[_0xb26f('0x7d')](path['join'](config['root'],_0xb26f('0x83'),_0xb76cbf['systemAvatar']))){_0x4c4760=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],'server/files/images/avatars/',_0xb76cbf['systemAvatar']);}}return _0x969ebb[_0xb26f('0x80')](_0x4c4760);}})[_0xb26f('0x57')](handleError(_0x969ebb,null));};exports[_0xb26f('0x87')]=function(_0x5cd62d,_0x411fef,_0x3dcb10){var _0x106c1e=require('user-agent-parser');var _0x47efcb=new _0x106c1e();var _0x4158e6=_0x47efcb[_0xb26f('0x88')](_0x5cd62d['headers'][_0xb26f('0x89')])[_0xb26f('0x8a')]();var _0x47fa78={'body':_0x5cd62d[_0xb26f('0x5c')],'channel':_0xb26f('0x8b')};var _0x4b8e7e=[];var _0x475965=[];var _0x4ae45c={};var _0x4bdcce=![];return db[_0xb26f('0x8c')][_0xb26f('0x65')]()['then'](function(_0x5ee8a9){if(!_0x5ee8a9){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x8f'));}_0x4b8e7e=_[_0xb26f('0x90')](_['keys'](_0x5ee8a9),[_0xb26f('0x91'),_0xb26f('0x92')]);_0x475965=_[_0xb26f('0x90')](_[_0xb26f('0x44')](_0x5ee8a9),['createdAt',_0xb26f('0x92'),_0xb26f('0x93'),'ListId']);if(_0x5cd62d[_0xb26f('0x5c')]['id']){delete _0x5cd62d['body']['id'];}if(_[_0xb26f('0x82')](_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x94')])){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x5c')])||_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x5c')]===''){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x95'));}if(_[_0xb26f('0x82')](_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x96')])){throw new db['Sequelize'][(_0xb26f('0x8e'))](_0xb26f('0x97')+_0x475965);}if(!_[_0xb26f('0x98')](_0x475965,_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x96')])){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x99')+_0x475965);}_0x4ae45c[_0x5cd62d['body'][_0xb26f('0x96')]]=_0x5cd62d['body'][_0xb26f('0x94')];})[_0xb26f('0x35')](function(){return db[_0xb26f('0x54')]['find']({'where':{'id':_0x5cd62d['params']['id']},'include':[{'model':db[_0xb26f('0x9a')],'as':'List','include':[{'model':db[_0xb26f('0x8c')],'as':_0xb26f('0x9b'),'where':_0x4ae45c,'limit':0x1,'order':[['updatedAt',_0xb26f('0x9c')]]}]},{'model':db[_0xb26f('0x9d')],'as':_0xb26f('0x9e')}]});})[_0xb26f('0x35')](handleEntityNotFound(_0x411fef,null))[_0xb26f('0x35')](function(_0x3aad75){if(_0x3aad75&&_0x3aad75['List']){_0x47fa78[_0xb26f('0x9f')]=_0x3aad75;_0x47fa78[_0xb26f('0xa0')]=_0x3aad75[_0xb26f('0x9e')];_0x47fa78[_0xb26f('0xa1')]=_0x3aad75[_0xb26f('0xa2')];_0x47fa78[_0xb26f('0xa0')]=_['orderBy'](_0x47fa78['applications'],[_0xb26f('0xa3')],['asc']);if(_0x47fa78['account'][_0xb26f('0x9e')]){delete _0x47fa78[_0xb26f('0x9f')][_0xb26f('0x9e')];}if(_0x47fa78[_0xb26f('0x9f')][_0xb26f('0xa2')]&&_0x47fa78[_0xb26f('0x9f')][_0xb26f('0xa2')]['Contacts'][_0xb26f('0x48')]){return _0x47fa78[_0xb26f('0x9f')]['List'][_0xb26f('0x9b')][0x0];}var _0x11ac1b=_[_0xb26f('0x1b')](_0x5cd62d[_0xb26f('0x5c')],{'firstName':_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x94')],'ListId':_0x3aad75[_0xb26f('0xa4')]});_0x11ac1b[_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x96')]]=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0x94')];return db[_0xb26f('0x8c')]['create'](_0x11ac1b,{'fields':_0x4b8e7e,'raw':!![]});}})[_0xb26f('0x35')](handleEntityNotFound(_0x411fef,null))['then'](function(_0x485483){_0x47fa78[_0xb26f('0xa5')]=_0x485483;var _0x454d6f=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xa6')];if(_0x5cd62d[_0xb26f('0xa7')]['cf-connecting-ip']){_0x454d6f=_0x5cd62d['headers'][_0xb26f('0xa8')];}else if(_0x5cd62d[_0xb26f('0xa7')][_0xb26f('0xa9')]){_0x454d6f=_[_0xb26f('0xaa')](_0x5cd62d[_0xb26f('0xa7')]['x-forwarded-for']['split'](','));}if(_0x485483){var _0x33ec3e={'ContactId':_0x485483['id'],'ChatWebsiteId':_0x5cd62d[_0xb26f('0x67')]['id'],'from':(_0x485483[_0xb26f('0xab')]||'')+'\x20'+(_0x485483[_0xb26f('0xac')]||''),'customerIp':_0x454d6f,'customerPort':_0x5cd62d['headers']['x-real-port']?_0x5cd62d[_0xb26f('0xa7')][_0xb26f('0xad')]:null,'referer':_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xae')],'browserName':_0x4158e6['browser']['name']&&_0x4158e6[_0xb26f('0xaf')][_0xb26f('0xb0')]?util['format'](_0xb26f('0xb1'),_0x4158e6[_0xb26f('0xaf')][_0xb26f('0x3a')],_0x4158e6['browser']['version']):_0xb26f('0xb2'),'browserVersion':_0x4158e6[_0xb26f('0xaf')]['version']||_0xb26f('0xb2'),'osName':util[_0xb26f('0xb3')](_0xb26f('0xb1'),_0x4158e6['os'][_0xb26f('0x3a')],_0x4158e6['os'][_0xb26f('0xb0')]),'osVersion':_0x4158e6['os'][_0xb26f('0xb0')],'deviceModel':_0x4158e6[_0xb26f('0xb4')][_0xb26f('0x42')]&&_0x4158e6[_0xb26f('0xb4')][_0xb26f('0xb5')]?util[_0xb26f('0xb3')](_0xb26f('0xb6'),_0x4158e6[_0xb26f('0xb4')]['model'],_0x4158e6[_0xb26f('0xb4')][_0xb26f('0xb5')],_0x4158e6['device'][_0xb26f('0x40')]):null,'deviceVendor':_0x4158e6[_0xb26f('0xb4')][_0xb26f('0xb5')],'deviceType':_0x4158e6[_0xb26f('0xb4')]['type'],'formData':JSON['stringify'](_0x5cd62d[_0xb26f('0x5c')])};var _0xd34330={'ChatWebsiteId':_0x5cd62d[_0xb26f('0x67')]['id'],'closed':![]};if(_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')]){_0xd34330['threadId']=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')];return db['ChatInteraction']['find']({'where':_0xd34330})[_0xb26f('0x35')](function(_0x4b66bc){if(_0x4b66bc){return[_0x4b66bc,![]];}_0x33ec3e[_0xb26f('0xb7')]=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')];_0x33ec3e[_0xb26f('0xb8')]=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb8')];return db['ChatInteraction']['create'](_0x33ec3e)['then'](function(_0x39d361){return[_0x39d361,!![]];});});}_0xd34330['ContactId']=_0x485483['id'];if(_0x5cd62d['body'][_0xb26f('0xb9')]&&_0x5cd62d['body'][_0xb26f('0xb9')]['id']){_0xd34330['id']=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb9')]['id'];return db[_0xb26f('0xba')][_0xb26f('0x61')]({'where':_0xd34330})[_0xb26f('0x35')](function(_0xb2edb7){if(_0xb2edb7){return[_0xb2edb7,![]];}return db[_0xb26f('0xba')][_0xb26f('0x5b')](_0x33ec3e)[_0xb26f('0x35')](function(_0x46d8e9){return[_0x46d8e9,!![]];});});}return db[_0xb26f('0xba')][_0xb26f('0x5b')](_0x33ec3e)['then'](function(_0x2173fe){return[_0x2173fe,!![]];});}})['spread'](function(_0x59582d,_0x36d71f){if(_0x59582d){_0x4bdcce=_0x36d71f;if(!_0x36d71f){var _0x28b578={'from':(_0x47fa78[_0xb26f('0xa5')][_0xb26f('0xab')]||'')+'\x20'+(_0x47fa78['contact']['lastName']||'')};if(_0x5cd62d['body']['threadId']&&_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xbb')]&&_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xb7')]!=_0x5cd62d[_0xb26f('0x5c')]['messageId']){_0x28b578['threadId']=_0x5cd62d[_0xb26f('0x5c')][_0xb26f('0xbb')];}return _0x59582d[_0xb26f('0x34')](_0x28b578);}else{return _0x59582d;}}})[_0xb26f('0x35')](function(_0x2e728c){_0x47fa78[_0xb26f('0xb9')]=_0x2e728c[_0xb26f('0x37')]({'plain':!![]});_0x47fa78[_0xb26f('0xb9')][_0xb26f('0xbc')]=_0x4bdcce;if(_0x47fa78[_0xb26f('0xb9')][_0xb26f('0xbc')]){if(_0x47fa78[_0xb26f('0x9f')]['autoclose']){_0x47fa78[_0xb26f('0xa0')][_0xb26f('0xbd')]({'id':0x0,'priority':_0x47fa78[_0xb26f('0xa0')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xb26f('0xbe')});}}return db[_0xb26f('0xbf')][_0xb26f('0x5b')]({'body':_0x5cd62d['body']['body'],'ChatWebsiteId':_0x5cd62d['params']['id'],'ChatInteractionId':_0x2e728c['id'],'direction':'in','ContactId':_0x47fa78[_0xb26f('0xa5')]['id'],'AttachmentId':_0x5cd62d['body'][_0xb26f('0xc0')]});})['then'](function(_0x5598cc){_0x47fa78[_0xb26f('0x2a')]=_0x5598cc;if(_0x47fa78[_0xb26f('0xb9')][_0xb26f('0xc1')]){return db[_0xb26f('0xc2')]['find']({'attributes':['id',_0xb26f('0x3a')],'where':{'id':_0x47fa78[_0xb26f('0xb9')]['UserId']}})['then'](function(_0x19dd4f){if(_0x19dd4f){_0x47fa78[_0xb26f('0xa0')][_0xb26f('0xc3')]({'id':0x0,'priority':0x0,'app':_0xb26f('0xc4'),'appdata':_0x19dd4f[_0xb26f('0x3a')]+','+(_0x47fa78['account'][_0xb26f('0xc5')]||0xa),'interval':_0xb26f('0xbe')});_0x47fa78[_0xb26f('0xc6')]=!![];}return respondWithRpcPromise(_0xb26f('0xc7'),_0xb26f('0xc8'),_0x47fa78);});}return respondWithRpcPromise('Start',_0xb26f('0xc8'),_0x47fa78);})['then'](function(_0x1b70e8){respondWithRpcPromise(_0xb26f('0xc9'),_0xb26f('0xc9'),{'event':_0xb26f('0x87'),'message':_0x1b70e8},client9002);return _0x1b70e8;})[_0xb26f('0x35')](respondWithResult(_0x411fef,null))['catch'](handleError(_0x411fef,null));};exports[_0xb26f('0xca')]=function(_0x2ac669,_0x11b08a,_0x86dc0c){var _0x9f77df,_0x1c7efd,_0x21c3b3;var _0x1984f2=[];var _0xe2f39f=[];var _0x53b9a7={};var _0x3f20cf=_0x2ac669[_0xb26f('0xcb')]||[];var _0x4da1b4=[];var _0x21ee31;return db[_0xb26f('0x8c')][_0xb26f('0x65')]()[_0xb26f('0x35')](function(_0x154668){if(!_0x154668){throw new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x8f'));}_0xe2f39f=_[_0xb26f('0x90')](_[_0xb26f('0x44')](_0x154668),[_0xb26f('0x91'),'updatedAt']);_0x1984f2=_['difference'](_[_0xb26f('0x44')](_0x154668),[_0xb26f('0x91'),_0xb26f('0x92'),_0xb26f('0x93'),'ListId']);if(_0x2ac669[_0xb26f('0x5c')]['id']){delete _0x2ac669[_0xb26f('0x5c')]['id'];}if(_[_0xb26f('0x82')](_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')])){throw _0x11b08a['status'](0x1f4)[_0xb26f('0x3c')](new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0xcc')));}if(_[_0xb26f('0x82')](_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x5c')])||_0x2ac669[_0xb26f('0x5c')]['body']===''){throw _0x11b08a[_0xb26f('0x3b')](0x1f4)['send'](new db[(_0xb26f('0x8d'))][(_0xb26f('0x8e'))](_0xb26f('0x95')));}if(_[_0xb26f('0x82')](_0x2ac669[_0xb26f('0x5c')][_0xb26f('0xcd')])){throw _0x11b08a[_0xb26f('0x3b')](0x1f4)[_0xb26f('0x3c')](new db['Sequelize'][(_0xb26f('0x8e'))](_0xb26f('0xce')+_0x1984f2));}if(!_[_0xb26f('0x98')](_0x1984f2,_0x2ac669[_0xb26f('0x5c')][_0xb26f('0xcd')])){throw _0x11b08a['status'](0x1f4)['send'](new db['Sequelize']['ValidationError'](_0xb26f('0xcf')+_0x1984f2));}_0x53b9a7[_0x2ac669[_0xb26f('0x5c')][_0xb26f('0xcd')]]=_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')];})[_0xb26f('0x35')](function(){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x2ac669[_0xb26f('0x67')]['id']},'include':[{'model':db[_0xb26f('0x9a')],'as':_0xb26f('0xa2')},{'model':db[_0xb26f('0xd0')],'as':'MailAccount'}]});})[_0xb26f('0x35')](handleEntityNotFound(_0x11b08a,null))['then'](function(_0x3acd5d){if(_0x3acd5d&&_0x3acd5d[_0xb26f('0xa2')]){_0x1c7efd=_0x3acd5d;var _0x301c47=_[_0xb26f('0x1b')](_0x2ac669['body'],{'firstName':_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')],'phone':_0x2ac669['body']['from'],'ListId':_0x3acd5d[_0xb26f('0xa4')]});_0x301c47[_0x2ac669['body'][_0xb26f('0xcd')]]=_0x2ac669[_0xb26f('0x5c')][_0xb26f('0x94')];return db[_0xb26f('0x8c')][_0xb26f('0xd1')]({'where':_0x53b9a7,'defaults':_0x301c47});}})['spread'](function(_0x89941f){if(_0x89941f){_0x21c3b3=_0x89941f;var _0x54201d=fs[_0xb26f('0xd2')](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0xd3')),_0xb26f('0xd4'));var _0x4fc3ad=ejs[_0xb26f('0xd5')](_0x54201d,{'body':_[_0xb26f('0xd6')](_0x2ac669['body'][_0xb26f('0x5c')]),'bodyTitle':_0x1c7efd[_0xb26f('0xd7')]});return db['ChatOfflineMessage']['create']({'body':_0x4fc3ad,'ContactId':_0x89941f['id'],'ChatWebsiteId':_0x1c7efd['id']});}})[_0xb26f('0x35')](function(_0x47d44b){_0x21ee31=_0x47d44b;if(_0x3f20cf['length']){var _0x5e8431=_0x3f20cf[_0xb26f('0x51')](function(_0x38c956){return{'name':_0x38c956[_0xb26f('0xd8')],'basename':_0x38c956['filename'],'type':_0x38c956[_0xb26f('0xd9')],'ChatOfflineMessageId':_0x47d44b['id']};});_0x4da1b4=_0x5e8431[_0xb26f('0x51')](_0x23e84a=>{var _0x192e5f={'filename':_0x23e84a[_0xb26f('0x3a')],'path':path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0xda'),'files',_0xb26f('0xdb'),'offline-chat',_0x23e84a[_0xb26f('0xdc')])};return _0x192e5f;});if(!_0x1c7efd['openNewInteraction']){return db['sequelize'][_0xb26f('0xdd')](function(_0x4cbd4c){return db[_0xb26f('0xde')][_0xb26f('0xdf')](_0x5e8431,{'transaction':_0x4cbd4c});});}}})['then'](function(){if(_0x21ee31){_0x9f77df=_0x21ee31;return db[_0xb26f('0xd0')][_0xb26f('0x69')]({'where':{'active':!![]},'include':[{'model':db[_0xb26f('0xe0')],'as':_0xb26f('0xe1'),'raw':!![]}]});}})[_0xb26f('0x35')](function(_0x5ae686){if(_0x5ae686&&_0x5ae686[_0xb26f('0xe1')]&&_0x1c7efd[_0xb26f('0xe2')]&&_0x1c7efd[_0xb26f('0xe3')]){var _0x2c0bfe={'tls':{'rejectUnauthorized':![]}};if(_0x5ae686['Smtp'][_0xb26f('0xe4')]){_0x2c0bfe[_0xb26f('0xe4')]=_0x5ae686['Smtp'][_0xb26f('0xe4')];}else{_0x2c0bfe[_0xb26f('0xe5')]=_0x5ae686[_0xb26f('0xe1')][_0xb26f('0xe5')];_0x2c0bfe[_0xb26f('0xe6')]=_0x5ae686[_0xb26f('0xe1')][_0xb26f('0xe6')];_0x2c0bfe[_0xb26f('0xe7')]=_0x5ae686[_0xb26f('0xe1')]['secure'];}if(_0x5ae686['Smtp']['authentication']){_0x2c0bfe[_0xb26f('0xe8')]={'user':_0x5ae686[_0xb26f('0xe1')][_0xb26f('0x5d')],'pass':_0x5ae686[_0xb26f('0xe1')]['pass']};}return respondWithRpcPromise(_0xb26f('0xe9'),'sendMail',{'account':_0x2c0bfe,'message':{'from':util[_0xb26f('0xb3')](_0xb26f('0xea'),_0x5ae686[_0xb26f('0x3a')],_0x5ae686[_0xb26f('0xeb')]||_0x5ae686[_0xb26f('0xe1')][_0xb26f('0x5d')]),'to':_0x1c7efd[_0xb26f('0xe3')],'subject':_0x1c7efd[_0xb26f('0xec')],'html':_0x9f77df[_0xb26f('0x5c')],'attachments':_0x4da1b4}},client9003)[_0xb26f('0x35')](function(){return _0x9f77df;})[_0xb26f('0x57')](function(_0x4046bd){console[_0xb26f('0x28')](_0x4046bd);});}})[_0xb26f('0x35')](function(){if(_0x1c7efd&&_0x1c7efd[_0xb26f('0xed')]&&_0x1c7efd[_0xb26f('0xee')]){var _0x385d73=[];if(_0x3f20cf[_0xb26f('0x48')]){_0x385d73=_0x3f20cf[_0xb26f('0x51')](function(_0x2baee0){return{'name':_0x2baee0[_0xb26f('0xd8')],'basename':_0x2baee0[_0xb26f('0x73')],'type':_0x2baee0['mimetype'],'ChatOfflineMessageId':_0x21ee31['id']};});}var _0x5b670f;if(!_[_0xb26f('0x82')](_0x1c7efd[_0xb26f('0xef')])){var _0xd42a0d=_[_0xb26f('0x51')](_0x2ac669[_0xb26f('0x5c')],function(_0x18babd){return _0x18babd;});var _0x45db90=_['toPairsIn'](_0xd42a0d)[0x0];var _0x8bdda6=_[_0xb26f('0xf0')](_0x45db90,function(_0x21f57b){return _0x21f57b;});_0x5b670f=_0x8bdda6[0x1][_0x1c7efd[_0xb26f('0xef')]];}var _0x2ed1f7={'from':_0x21c3b3[_0xb26f('0xeb')],'firstName':_0x21c3b3[_0xb26f('0xab')],'lastName':_0x21c3b3[_0xb26f('0xac')],'mapKey':_0xb26f('0xeb'),'message':{'from':_0x21c3b3[_0xb26f('0xeb')],'to':_0x1c7efd[_0xb26f('0xd0')][_0xb26f('0xeb')],'cc':'','subject':_[_0xb26f('0x82')](_0x5b670f)?_0x1c7efd['offlineMessageSubject']:_0x5b670f,'messageId':'','sentAt':new Date(),'attach':_0x385d73[_0xb26f('0x48')],'attachments':_0x385d73,'originChannel':_0xb26f('0xf1'),'ChatWebsiteId':_0x1c7efd['id'],'ChatOfflineMessageId':_0x9f77df['id'],'originTo':_0x1c7efd[_0xb26f('0xd0')][_0xb26f('0xeb')]},'body':_0x9f77df['body']};var _0x5b3f37={'account':{'id':_0x1c7efd['MailAccountId']},'body':_0x2ed1f7,'log':_0xb26f('0xf2')};return respondWithRpcPromise(_0xb26f('0xf2'),'notifyMail',_0x5b3f37,client9001)['then'](function(){return _0x9f77df;})[_0xb26f('0x57')](function(_0x34005a){console[_0xb26f('0x28')](_0x34005a);});}return;})[_0xb26f('0x35')](function(){if(_0x9f77df){return _0x9f77df;}})[_0xb26f('0x35')](respondWithResult(_0x11b08a,null))[_0xb26f('0x57')](function(_0x2c4ae3){console[_0xb26f('0x28')]('catch',_0x2c4ae3);for(var _0x5c5c69 of _0x3f20cf){var _0x5a2a7c=path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0xda'),'files','attachments',_0xb26f('0xf3'),_0x5c5c69[_0xb26f('0x73')]);fs_extra[_0xb26f('0xf4')](_0x5a2a7c)['catch'](function(_0x46ba60){console[_0xb26f('0x28')](_0xb26f('0xf5'),_0x5a2a7c,_0x46ba60);});}});};exports[_0xb26f('0xf6')]=function(_0x3c16a3,_0x136a3d,_0xabec87){return db[_0xb26f('0xba')][_0xb26f('0x61')]({'where':{'id':_0x3c16a3[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x136a3d,null))[_0xb26f('0x35')](function(_0x4223c0){if(_0x4223c0){return _0x4223c0[_0xb26f('0xf6')](_0x3c16a3[_0xb26f('0x5c')][_0xb26f('0xf7')],_[_0xb26f('0xf8')](_0x3c16a3[_0xb26f('0x5c')],[_0xb26f('0xf7'),'id'])||{});}})[_0xb26f('0x35')](respondWithResult(_0x136a3d,null))['catch'](handleError(_0x136a3d,null));};exports['getInteractions']=function(_0x1f1ab2,_0x54f6da,_0x4a8a38){var _0x90af14={'raw':![],'where':{}};var _0x483814={};var _0x48eb88={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x1f1ab2[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x54f6da,null))[_0xb26f('0x35')](function(_0x393b85){if(_0x393b85){_0x483814[_0xb26f('0x42')]=_[_0xb26f('0x44')](db['ChatInteraction'][_0xb26f('0x59')]);_0x483814[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x1f1ab2['query']);_0x483814['filters']=_[_0xb26f('0x5a')](_0x483814[_0xb26f('0x42')],_0x483814[_0xb26f('0x43')]);_0x90af14[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x483814['model'],qs[_0xb26f('0x47')](_0x1f1ab2['query'][_0xb26f('0x47')]));_0x90af14[_0xb26f('0x46')]=_0x90af14['attributes'][_0xb26f('0x48')]?_0x90af14[_0xb26f('0x46')]:_0x483814['model'];if(!_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x90af14[_0xb26f('0x30')]=qs['limit'](_0x1f1ab2['query']['limit']);_0x90af14[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x90af14[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x90af14['where']=qs[_0xb26f('0x45')](_['pick'](_0x1f1ab2[_0xb26f('0x43')],_0x483814[_0xb26f('0x45')]));_0x90af14[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x393b85['id'];if(_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x90af14[_0xb26f('0x4d')]=_['merge'](_0x90af14[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x90af14['attributes'],function(_0x53f21){var _0x114aec={};_0x114aec[_0x53f21]={'$like':'%'+_0x1f1ab2[_0xb26f('0x43')]['filter']+'%'};return _0x114aec;})});}_0x90af14=_[_0xb26f('0x50')]({},_0x90af14,_0x1f1ab2[_0xb26f('0x52')]);return db[_0xb26f('0xba')][_0xb26f('0x31')]({'where':_0x90af14[_0xb26f('0x4d')]})[_0xb26f('0x35')](function(_0x4102dd){_0x48eb88[_0xb26f('0x31')]=_0x4102dd;if(_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0x53')]){_0x90af14[_0xb26f('0x6b')]=[{'model':db[_0xb26f('0x8c')],'as':_0xb26f('0xf9'),'required':![]},{'model':db[_0xb26f('0xc2')],'as':_0xb26f('0xfa'),'attributes':[_0xb26f('0x3a'),_0xb26f('0xfb'),_0xb26f('0xfc')],'required':![]},{'model':db[_0xb26f('0xfd')],'as':_0xb26f('0xfe'),'attributes':['id',_0xb26f('0x3a'),'color'],'where':_0x1f1ab2[_0xb26f('0x43')]['tag']?{'id':_0x1f1ab2[_0xb26f('0x43')]['tag']}:undefined,'required':_0x1f1ab2[_0xb26f('0x43')][_0xb26f('0xff')]?!![]:![]}];}return db[_0xb26f('0xba')]['findAll'](_0x90af14);})['then'](function(_0x423624){_0x48eb88[_0xb26f('0x56')]=_0x423624;return _0x48eb88;});}})['then'](respondWithFilteredResult(_0x54f6da,_0x90af14))['catch'](handleError(_0x54f6da,null));};function iftimePromise(_0x354f2a,_0x8fdf68){return respondWithRpcPromise(_0xb26f('0x100'),_0xb26f('0x101'),{'command':_0x8fdf68[_0xb26f('0x102')]?util['format'](_0xb26f('0x103'),_0x354f2a[_0xb26f('0x104')],_0x8fdf68[_0xb26f('0x102')]):util[_0xb26f('0xb3')]('iftime\x20%s',_0x354f2a['interval'])},client9002)[_0xb26f('0x35')](function(_0x159411){var _0x527bf8=_0x159411&&_0x159411[_0xb26f('0x105')](_0xb26f('0x106'))>=0x0?!![]:![];logger['info'](_0xb26f('0x107'),_0x8fdf68['id'],_0x354f2a['id'],_0x354f2a[_0xb26f('0x104')],_0x527bf8?_0xb26f('0x108'):_0xb26f('0x109'),_0x8fdf68['timezone']?_0x8fdf68[_0xb26f('0x102')]:'No\x20timezone');return _0x527bf8;})['catch'](function(_0xf4be83){logger[_0xb26f('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x8fdf68['id'],_0x354f2a['id'],_0x354f2a[_0xb26f('0x104')],util[_0xb26f('0x10a')](_0xf4be83,{'showHidden':![],'depth':null}),_0x8fdf68[_0xb26f('0x102')]?_0x8fdf68[_0xb26f('0x102')]:'No\x20timezone');return![];});}exports[_0xb26f('0x101')]=function(_0x4fa2ed,_0x4dcf84,_0x59b019){var _0x2e46f1=0x0;var _0x5b1ea6=0x0;var _0x39dfce=![];var _0x7e2b86;var _0x14cdb3;return db[_0xb26f('0x54')]['find']({'where':{'id':_0x4fa2ed[_0xb26f('0x67')]['id']},'include':[{'model':db[_0xb26f('0x10b')],'as':'Interval','include':[{'model':db[_0xb26f('0x10b')],'as':_0xb26f('0x10c'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xb26f('0x35')](handleEntityNotFound(_0x4dcf84,null))['then'](function(_0x3b20a5){if(_0x3b20a5){_0x7e2b86=_0x3b20a5;return _0x3b20a5[_0xb26f('0x10d')]({'raw':!![]});}})[_0xb26f('0x35')](function(_0x3bae72){if(_0x7e2b86){if(_0x3bae72){_0x14cdb3=_0x3bae72;}}return require(_0xb26f('0x18'))[_0xb26f('0x7b')]();})[_0xb26f('0x35')](function(_0x356bc3){if(_0x356bc3){_0x5b1ea6=_0x356bc3['virtual'];_0x39dfce=_0x356bc3[_0xb26f('0x7c')];}})['then'](function(){return db[_0xb26f('0xba')]['count']({'where':{'closed':![]}});})['then'](function(_0x530415){_0x2e46f1=_0x530415;if(_0x5b1ea6&&_0x530415>_0x5b1ea6){return db['License'][_0xb26f('0x69')]({'where':{'id':0x1}})[_0xb26f('0x35')](function(_0x353743){if(_0x353743){_0x353743[_0xb26f('0x10e')]('chatLicenseExceeded');}});}})[_0xb26f('0x35')](function(){if(_0x7e2b86[_0xb26f('0x10b')]&&_0x7e2b86[_0xb26f('0x10b')][_0xb26f('0x10c')]){var _0x16a405=[];for(var _0x54c3e3=0x0;_0x54c3e3<_0x7e2b86[_0xb26f('0x10b')]['Intervals'][_0xb26f('0x48')];_0x54c3e3++){var _0x2c4f16=_0x7e2b86[_0xb26f('0x10b')][_0xb26f('0x10c')][_0x54c3e3]['get']({'plain':!![]});_0x16a405[_0xb26f('0xbd')](iftimePromise(_0x2c4f16,_0x7e2b86));}return BPromise[_0xb26f('0x10f')](_0x16a405)[_0xb26f('0x35')](function(_0x33f055){return _[_0xb26f('0x110')](_0x33f055);});}else{return!![];}})['then'](function(_0x2d9a88){var _0x3bf54a=fs[_0xb26f('0xd2')](path[_0xb26f('0x7e')](config[_0xb26f('0x7a')],_0xb26f('0x111')),_0xb26f('0xd4'));var _0x15d780={'remote':_0x7e2b86[_0xb26f('0x112')],'query':querystring['stringify'](_[_0xb26f('0x50')](_0x7e2b86[_0xb26f('0x37')]({'plain':!![]}),{'customerIp':_0x4fa2ed[_0xb26f('0xa7')][_0xb26f('0xa9')]||_0x4fa2ed[_0xb26f('0xa7')][_0xb26f('0x113')]||_0x4fa2ed['connection']['remoteAddress']||_0x4fa2ed['ip'],'referer':_0x4fa2ed[_0xb26f('0xa7')][_0xb26f('0xae')],'openedInteractions':_0x2e46f1,'maxInteractions':_0x5b1ea6,'virtual':_0x39dfce[_0xb26f('0x114')],'online':_0x2d9a88,'custom':_0x39dfce}))[_0xb26f('0x115')](/'/g,'\x5c\x27')};_0x4dcf84['send'](ejs['render'](Mustache[_0xb26f('0xd5')](_0x3bf54a,_0x15d780),{'proactiveActions':_0x14cdb3,'alignment':_0x7e2b86['alignment'],'verticalAlignment':_0x7e2b86[_0xb26f('0x116')],'div_color':_0x7e2b86[_0xb26f('0x117')],'text_color':_0x7e2b86[_0xb26f('0x118')],'button_color':_0x7e2b86['color_button'],'background_color':_0x7e2b86[_0xb26f('0x119')]}));})[_0xb26f('0x57')](handleError(_0x4dcf84,null));};exports['addApplications']=function(_0x5a9e58,_0x16249d,_0xb527dd){return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x5a9e58[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x16249d,null))[_0xb26f('0x35')](function(_0x36997b){if(_0x36997b){return db['sequelize'][_0xb26f('0xdd')](function(_0x47c009){return db[_0xb26f('0x9d')][_0xb26f('0x36')]({'where':{'ChatWebsiteId':_0x5a9e58['params']['id']},'transaction':_0x47c009})[_0xb26f('0x35')](function(_0x4e0ad7){var _0x295e8d=_[_0xb26f('0x51')](_0x5a9e58[_0xb26f('0x5c')],function(_0x2fbb05){_0x2fbb05[_0xb26f('0x68')]=_0x5a9e58[_0xb26f('0x67')]['id'];return _0x2fbb05;});return db[_0xb26f('0x9d')][_0xb26f('0xdf')](_0x295e8d,{'transaction':_0x47c009});});})['then'](function(){return db[_0xb26f('0x9d')][_0xb26f('0x11a')]({'where':{'ChatWebsiteId':_0x5a9e58[_0xb26f('0x67')]['id']},'order':_0xb26f('0xa3')});});}})[_0xb26f('0x35')](respondWithResult(_0x16249d,null))[_0xb26f('0x57')](handleError(_0x16249d,null));};exports[_0xb26f('0x11b')]=function(_0x6f6cd7,_0x594152,_0x319d63){var _0x75b1ff={};var _0x5c4398={};var _0x410c3d;var _0x4ef2db;return db['ChatWebsite'][_0xb26f('0x69')]({'where':{'id':_0x6f6cd7['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x594152,null))[_0xb26f('0x35')](function(_0x515edb){if(_0x515edb){_0x410c3d=_0x515edb;_0x5c4398[_0xb26f('0x42')]=_[_0xb26f('0x44')](db['ChatApplication'][_0xb26f('0x59')]);_0x5c4398['query']=_[_0xb26f('0x44')](_0x6f6cd7['query']);_0x5c4398[_0xb26f('0x45')]=_['intersection'](_0x5c4398['model'],_0x5c4398[_0xb26f('0x43')]);_0x75b1ff[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x5c4398['model'],qs['fields'](_0x6f6cd7[_0xb26f('0x43')]['fields']));_0x75b1ff['attributes']=_0x75b1ff[_0xb26f('0x46')][_0xb26f('0x48')]?_0x75b1ff[_0xb26f('0x46')]:_0x5c4398[_0xb26f('0x42')];_0x75b1ff['order']=qs[_0xb26f('0x4c')](_0x6f6cd7['query'][_0xb26f('0x4c')]);_0x75b1ff[_0xb26f('0x4d')]=qs[_0xb26f('0x45')](_['pick'](_0x6f6cd7['query'],_0x5c4398['filters']));if(_0x6f6cd7['query']['filter']){_0x75b1ff['where']=_[_0xb26f('0x50')](_0x75b1ff['where'],{'$or':_[_0xb26f('0x51')](_0x75b1ff[_0xb26f('0x46')],function(_0x11c604){var _0x14e0d7={};_0x14e0d7[_0x11c604]={'$like':'%'+_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x4f')]+'%'};return _0x14e0d7;})});}_0x75b1ff=_[_0xb26f('0x50')]({},_0x75b1ff,_0x6f6cd7[_0xb26f('0x52')]);return _0x410c3d[_0xb26f('0x11b')](_0x75b1ff);}})['then'](function(_0x1792b9){if(_0x1792b9){_0x4ef2db=_0x1792b9[_0xb26f('0x48')];if(!_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x75b1ff[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x30')]);_0x75b1ff['offset']=qs['offset'](_0x6f6cd7[_0xb26f('0x43')][_0xb26f('0x2e')]);}return _0x410c3d[_0xb26f('0x11b')](_0x75b1ff);}})[_0xb26f('0x35')](function(_0x5bfc47){if(_0x5bfc47){return _0x5bfc47?{'count':_0x4ef2db,'rows':_0x5bfc47}:null;}})['then'](respondWithResult(_0x594152,null))['catch'](handleError(_0x594152,null));};exports[_0xb26f('0x11c')]=function(_0x30b531,_0x5d399e,_0x1d0f88){return db['chatProactiveAction'][_0xb26f('0x61')]({'where':{'id':_0x30b531[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5d399e,null))[_0xb26f('0x35')](function(_0x388aac){if(_0x388aac){return _0x388aac['addProactiveActions'](_0x30b531[_0xb26f('0x5c')]['ids'],_[_0xb26f('0xf8')](_0x30b531['body'],[_0xb26f('0xf7'),'id'])||{});}})[_0xb26f('0x35')](respondWithResult(_0x5d399e,null))[_0xb26f('0x57')](handleError(_0x5d399e,null));};exports['getProactiveActions']=function(_0x3be71c,_0x2115ba,_0x4b992e){var _0x145433={};var _0x245c75={};var _0x5a0499;var _0x5c5133;return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x3be71c[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x2115ba,null))[_0xb26f('0x35')](function(_0x3414f5){if(_0x3414f5){_0x5a0499=_0x3414f5;_0x245c75[_0xb26f('0x42')]=_['keys'](db[_0xb26f('0x11d')]['rawAttributes']);_0x245c75[_0xb26f('0x43')]=_[_0xb26f('0x44')](_0x3be71c['query']);_0x245c75[_0xb26f('0x45')]=_[_0xb26f('0x5a')](_0x245c75[_0xb26f('0x42')],_0x245c75[_0xb26f('0x43')]);_0x145433['attributes']=_['intersection'](_0x245c75[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x3be71c[_0xb26f('0x43')]['fields']));_0x145433['attributes']=_0x145433[_0xb26f('0x46')]['length']?_0x145433[_0xb26f('0x46')]:_0x245c75[_0xb26f('0x42')];_0x145433[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x3be71c[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x145433['where']=qs[_0xb26f('0x45')](_['pick'](_0x3be71c[_0xb26f('0x43')],_0x245c75[_0xb26f('0x45')]));if(_0x3be71c[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x145433[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x145433[_0xb26f('0x4d')],{'$or':_[_0xb26f('0x51')](_0x145433['attributes'],function(_0x191ffa){var _0x58a0e6={};_0x58a0e6[_0x191ffa]={'$like':'%'+_0x3be71c['query'][_0xb26f('0x4f')]+'%'};return _0x58a0e6;})});}_0x145433=_['merge']({},_0x145433,_0x3be71c[_0xb26f('0x52')]);return _0x5a0499[_0xb26f('0x10d')](_0x145433);}})['then'](function(_0x4ec96c){if(_0x4ec96c){_0x5c5133=_0x4ec96c[_0xb26f('0x48')];if(!_0x3be71c[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x145433[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x3be71c[_0xb26f('0x43')][_0xb26f('0x30')]);_0x145433[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x3be71c[_0xb26f('0x43')][_0xb26f('0x2e')]);}return _0x5a0499[_0xb26f('0x10d')](_0x145433);}})['then'](function(_0x2682ec){if(_0x2682ec){return _0x2682ec?{'count':_0x5c5133,'rows':_0x2682ec}:null;}})[_0xb26f('0x35')](respondWithResult(_0x2115ba,null))[_0xb26f('0x57')](handleError(_0x2115ba,null));};exports[_0xb26f('0x11e')]=function(_0x3bef60,_0x5cebc1,_0x34c30d){var _0x46a4b6=_0x3bef60[_0xb26f('0x43')][_0xb26f('0x11f')]===_0xb26f('0x120')?_0xb26f('0x121'):_0xb26f('0x122');return db[_0xb26f('0x54')][_0xb26f('0x61')]({'attributes':['id',_0x46a4b6],'where':{'id':_0x3bef60['params']['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x5cebc1,null))[_0xb26f('0x35')](function(_0x455b44){if(_0x455b44){var _0x453f15=_0x455b44[_0x46a4b6];var _0xbff0ed=_0x453f15&&_0x453f15['items']?_0x453f15[_0xb26f('0x123')]:[];_0x5cebc1['send']({'fromKey':_[_0xb26f('0x82')](_0x453f15[_0xb26f('0x124')])?undefined:_0x453f15['fromKey'],'count':_0xbff0ed[_0xb26f('0x48')],'rows':_0xbff0ed});}})[_0xb26f('0x57')](handleError(_0x5cebc1,null));};exports['getOfflineMessages']=function(_0x237dca,_0x4f6a92,_0x3cc10d){var _0x498d03={'raw':![],'where':{}};var _0x16a471={};var _0x359b3a={'count':0x0,'rows':[]};return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x237dca[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x4f6a92,null))[_0xb26f('0x35')](function(_0x2ca893){if(_0x2ca893){_0x16a471[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0x125')]['rawAttributes']);_0x16a471['query']=_[_0xb26f('0x44')](_0x237dca[_0xb26f('0x43')]);_0x16a471['filters']=_['intersection'](_0x16a471[_0xb26f('0x42')],_0x16a471[_0xb26f('0x43')]);_0x498d03[_0xb26f('0x46')]=_[_0xb26f('0x5a')](_0x16a471[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x237dca['query']['fields']));_0x498d03[_0xb26f('0x46')]=_0x498d03[_0xb26f('0x46')]['length']?_0x498d03[_0xb26f('0x46')]:_0x16a471[_0xb26f('0x42')];if(!_0x237dca[_0xb26f('0x43')][_0xb26f('0x49')](_0xb26f('0x4a'))){_0x498d03[_0xb26f('0x30')]=qs[_0xb26f('0x30')](_0x237dca[_0xb26f('0x43')]['limit']);_0x498d03['offset']=qs['offset'](_0x237dca[_0xb26f('0x43')][_0xb26f('0x2e')]);}_0x498d03[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x237dca[_0xb26f('0x43')][_0xb26f('0x4c')]);_0x498d03['where']=qs[_0xb26f('0x45')](_[_0xb26f('0x4e')](_0x237dca[_0xb26f('0x43')],_0x16a471[_0xb26f('0x45')]));_0x498d03[_0xb26f('0x4d')][_0xb26f('0x68')]=_0x2ca893['id'];if(_0x237dca['query'][_0xb26f('0x4f')]){_0x498d03[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x498d03['where'],{'$or':_['map'](_0x498d03[_0xb26f('0x46')],function(_0x2ab886){var _0x80ae3e={};_0x80ae3e[_0x2ab886]={'$like':'%'+_0x237dca['query']['filter']+'%'};return _0x80ae3e;})});}_0x498d03=_['merge']({},_0x498d03,_0x237dca[_0xb26f('0x52')]);return db['ChatOfflineMessage']['count']({'where':_0x498d03[_0xb26f('0x4d')]})[_0xb26f('0x35')](function(_0x5b236b){_0x359b3a[_0xb26f('0x31')]=_0x5b236b;if(_0x237dca[_0xb26f('0x43')][_0xb26f('0x53')]){_0x498d03[_0xb26f('0x6b')]=[{'all':!![]}];}else{_0x498d03[_0xb26f('0x6b')]=[{'model':db[_0xb26f('0x8c')],'as':'Contact','required':![]},{'model':db[_0xb26f('0xde')],'as':_0xb26f('0x126'),'required':![]}];}return db[_0xb26f('0x125')][_0xb26f('0x55')](_0x498d03);})[_0xb26f('0x35')](function(_0x3f3785){_0x359b3a[_0xb26f('0x56')]=_0x3f3785;return _0x359b3a;});}})[_0xb26f('0x35')](respondWithFilteredResult(_0x4f6a92,_0x498d03))['catch'](handleError(_0x4f6a92,null));};exports[_0xb26f('0x127')]=function(_0x3167a3,_0x3e85c7,_0x1b3a0f){return db['ChatWebsite']['find']({'where':{'id':_0x3167a3[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x3e85c7,null))[_0xb26f('0x35')](function(_0x806323){if(_0x806323){return _0x806323[_0xb26f('0x127')](_0x3167a3[_0xb26f('0x5c')][_0xb26f('0xf7')],_['omit'](_0x3167a3[_0xb26f('0x5c')],['ids','id'])||{})['spread'](function(_0x20fcba){for(var _0x46ab05=0x0;_0x46ab05<_0x3167a3[_0xb26f('0x5c')][_0xb26f('0xf7')][_0xb26f('0x48')];_0x46ab05+=0x1){socket[_0xb26f('0x128')](_0xb26f('0x129'),{'UserId':Number(_0x3167a3[_0xb26f('0x5c')][_0xb26f('0xf7')][_0x46ab05]),'ChatWebsiteId':Number(_0x3167a3[_0xb26f('0x67')]['id'])});}return _0x20fcba;});}})[_0xb26f('0x35')](respondWithResult(_0x3e85c7,null))[_0xb26f('0x57')](handleError(_0x3e85c7,null));};exports[_0xb26f('0x12a')]=function(_0x2abc44,_0x35825b,_0x1e30c7){return db[_0xb26f('0x54')][_0xb26f('0x61')]({'where':{'id':_0x2abc44[_0xb26f('0x67')]['id']}})['then'](handleEntityNotFound(_0x35825b,null))[_0xb26f('0x35')](function(_0x12045b){if(_0x12045b){return _0x12045b[_0xb26f('0x12a')](_0x2abc44['query'][_0xb26f('0xf7')])[_0xb26f('0x35')](function(){if(_[_0xb26f('0x12b')](_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')])){for(var _0x20da45=0x0;_0x20da45<_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')][_0xb26f('0x48')];_0x20da45+=0x1){socket[_0xb26f('0x128')](_0xb26f('0x12c'),{'UserId':Number(_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')][_0x20da45]),'ChatWebsiteId':Number(_0x2abc44['params']['id'])});}}else{socket[_0xb26f('0x128')](_0xb26f('0x12c'),{'UserId':Number(_0x2abc44[_0xb26f('0x43')][_0xb26f('0xf7')]),'ChatWebsiteId':Number(_0x2abc44[_0xb26f('0x67')]['id'])});}});}})['then'](respondWithStatusCode(_0x35825b,null))[_0xb26f('0x57')](handleError(_0x35825b,null));};exports[_0xb26f('0x12d')]=function(_0x7fd0d5,_0x3f08bf,_0x560b5c){var _0x172c42={};var _0x41968a={};var _0x31f574;var _0x1ed66e;return db[_0xb26f('0x54')][_0xb26f('0x69')]({'where':{'id':_0x7fd0d5[_0xb26f('0x67')]['id']}})[_0xb26f('0x35')](handleEntityNotFound(_0x3f08bf,null))[_0xb26f('0x35')](function(_0x45f70b){if(_0x45f70b){_0x31f574=_0x45f70b;_0x41968a[_0xb26f('0x42')]=_[_0xb26f('0x44')](db[_0xb26f('0xc2')][_0xb26f('0x59')]);_0x41968a['query']=_[_0xb26f('0x44')](_0x7fd0d5['query']);_0x41968a[_0xb26f('0x45')]=_['intersection'](_0x41968a['model'],_0x41968a[_0xb26f('0x43')]);_0x172c42[_0xb26f('0x46')]=_['intersection'](_0x41968a[_0xb26f('0x42')],qs[_0xb26f('0x47')](_0x7fd0d5[_0xb26f('0x43')]['fields']));_0x172c42[_0xb26f('0x46')]=_0x172c42[_0xb26f('0x46')][_0xb26f('0x48')]?_0x172c42[_0xb26f('0x46')]:_0x41968a[_0xb26f('0x42')];_0x172c42[_0xb26f('0x4b')]=qs[_0xb26f('0x4c')](_0x7fd0d5[_0xb26f('0x43')]['sort']);_0x172c42[_0xb26f('0x4d')]=qs[_0xb26f('0x45')](_['pick'](_0x7fd0d5['query'],_0x41968a[_0xb26f('0x45')]));if(_0x7fd0d5[_0xb26f('0x43')][_0xb26f('0x4f')]){_0x172c42[_0xb26f('0x4d')]=_[_0xb26f('0x50')](_0x172c42[_0xb26f('0x4d')],{'$or':_['map'](_0x172c42[_0xb26f('0x46')],function(_0x244119){var _0x24c8d0={};_0x24c8d0[_0x244119]={'$like':'%'+_0x7fd0d5['query']['filter']+'%'};return _0x24c8d0;})});}_0x172c42=_[_0xb26f('0x50')]({},_0x172c42,_0x7fd0d5[_0xb26f('0x52')]);return _0x31f574['getAgents'](_0x172c42);}})[_0xb26f('0x35')](function(_0x4359fb){if(_0x4359fb){_0x1ed66e=_0x4359fb[_0xb26f('0x48')];if(!_0x7fd0d5[_0xb26f('0x43')]['hasOwnProperty'](_0xb26f('0x4a'))){_0x172c42['limit']=qs[_0xb26f('0x30')](_0x7fd0d5[_0xb26f('0x43')]['limit']);_0x172c42[_0xb26f('0x2e')]=qs[_0xb26f('0x2e')](_0x7fd0d5[_0xb26f('0x43')][_0xb26f('0x2e')]);}return _0x31f574[_0xb26f('0x12d')](_0x172c42);}})[_0xb26f('0x35')](function(_0x16ea79){if(_0x16ea79){return _0x16ea79?{'count':_0x1ed66e,'rows':_0x16ea79}:null;}})[_0xb26f('0x35')](respondWithResult(_0x3f08bf,null))[_0xb26f('0x57')](handleError(_0x3f08bf,null));}; \ No newline at end of file +var _0xff18=['filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','map','rows','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','user-agent','getResult','chat','Sequelize','createdAt','difference','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailAccount','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','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','getProactiveActions','virtual','License','increment','push','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','color','color_button','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','ChatWebsite','rawAttributes','type','key','keys','query'];(function(_0x445979,_0x18811a){var _0x117b2d=function(_0x43c834){while(--_0x43c834){_0x445979['push'](_0x445979['shift']());}};_0x117b2d(++_0x18811a);}(_0xff18,0xf7));var _0x8ff1=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0xff18[_0x61b3ab];return _0x57097f;};'use strict';var emlformat=require(_0x8ff1('0x0'));var rimraf=require(_0x8ff1('0x1'));var zipdir=require(_0x8ff1('0x2'));var jsonpatch=require(_0x8ff1('0x3'));var rp=require(_0x8ff1('0x4'));var moment=require(_0x8ff1('0x5'));var BPromise=require(_0x8ff1('0x6'));var Mustache=require(_0x8ff1('0x7'));var util=require(_0x8ff1('0x8'));var path=require('path');var sox=require(_0x8ff1('0x9'));var csv=require(_0x8ff1('0xa'));var ejs=require(_0x8ff1('0xb'));var fs=require('fs');var fs_extra=require(_0x8ff1('0xc'));var _=require(_0x8ff1('0xd'));var squel=require('squel');var crypto=require(_0x8ff1('0xe'));var jsforce=require(_0x8ff1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8ff1('0xa'));var querystring=require(_0x8ff1('0x10'));var Papa=require('papaparse');var Redis=require(_0x8ff1('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8ff1('0x12'));var hardwareService=require(_0x8ff1('0x13'));var logger=require(_0x8ff1('0x14'))(_0x8ff1('0x15'));var utils=require(_0x8ff1('0x16'));var config=require(_0x8ff1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ff1('0x18'))['db'];config[_0x8ff1('0x19')]=_[_0x8ff1('0x1a')](config[_0x8ff1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ff1('0x1b'))(new Redis(config[_0x8ff1('0x19')]));require(_0x8ff1('0x1c'))[_0x8ff1('0x1d')](socket);var jayson=require(_0x8ff1('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8ff1('0x1f')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x8ff1('0x1f')][_0x8ff1('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x52aef2,_0x499084,_0x34e54e,_0x390137){return new BPromise(function(_0x325a77,_0x121844){var _0x316fd4=_0x390137||client;return _0x316fd4[_0x8ff1('0x21')](_0x52aef2,_0x34e54e)['then'](function(_0x490d8b){logger[_0x8ff1('0x22')](_0x8ff1('0x23'),_0x499084,_0x8ff1('0x24'));logger[_0x8ff1('0x25')](_0x8ff1('0x26'),_0x499084,_0x8ff1('0x24'),JSON[_0x8ff1('0x27')](_0x490d8b));if(_0x490d8b[_0x8ff1('0x28')]){if(_0x490d8b[_0x8ff1('0x28')]['code']===0x1f4){logger[_0x8ff1('0x28')](_0x8ff1('0x23'),_0x499084,_0x490d8b['error'][_0x8ff1('0x29')]);return _0x121844(_0x490d8b[_0x8ff1('0x28')][_0x8ff1('0x29')]);}logger[_0x8ff1('0x28')](_0x8ff1('0x23'),_0x499084,_0x490d8b[_0x8ff1('0x28')][_0x8ff1('0x29')]);return _0x325a77(_0x490d8b[_0x8ff1('0x28')][_0x8ff1('0x29')]);}else{logger[_0x8ff1('0x22')](_0x8ff1('0x23'),_0x499084,_0x8ff1('0x24'));_0x325a77(_0x490d8b['result']['message']);}})[_0x8ff1('0x2a')](function(_0x35f81e){logger[_0x8ff1('0x28')](_0x8ff1('0x23'),_0x499084,_0x35f81e);_0x121844(_0x35f81e);});});}function respondWithStatusCode(_0x3a07c0,_0x427c6b){_0x427c6b=_0x427c6b||0xcc;return function(_0x28999c){if(_0x28999c){return _0x3a07c0[_0x8ff1('0x2b')](_0x427c6b);}return _0x3a07c0[_0x8ff1('0x2c')](_0x427c6b)['end']();};}function respondWithResult(_0x4da48a,_0xbb257a){_0xbb257a=_0xbb257a||0xc8;return function(_0x34c195){if(_0x34c195){return _0x4da48a[_0x8ff1('0x2c')](_0xbb257a)[_0x8ff1('0x2d')](_0x34c195);}};}function respondWithFilteredResult(_0x2ee655,_0x19205c){return function(_0x4dbd97){if(_0x4dbd97){var _0xee7179=typeof _0x19205c[_0x8ff1('0x2e')]===_0x8ff1('0x2f')&&typeof _0x19205c[_0x8ff1('0x30')]===_0x8ff1('0x2f');var _0x5d768a=_0x4dbd97[_0x8ff1('0x31')];var _0x28b722=_0xee7179?0x0:_0x19205c['offset'];var _0x4cac51=_0xee7179?_0x4dbd97[_0x8ff1('0x31')]:_0x19205c['offset']+_0x19205c['limit'];var _0x2e3860;if(_0x4cac51>=_0x5d768a){_0x4cac51=_0x5d768a;_0x2e3860=0xc8;}else{_0x2e3860=0xce;}_0x2ee655[_0x8ff1('0x2c')](_0x2e3860);return _0x2ee655[_0x8ff1('0x32')](_0x8ff1('0x33'),_0x28b722+'-'+_0x4cac51+'/'+_0x5d768a)['json'](_0x4dbd97);}return null;};}function patchUpdates(_0xba35ae){return function(_0x37148f){try{jsonpatch[_0x8ff1('0x34')](_0x37148f,_0xba35ae,!![]);}catch(_0x286f4b){return BPromise[_0x8ff1('0x35')](_0x286f4b);}return _0x37148f[_0x8ff1('0x36')]();};}function saveUpdates(_0x55d19b,_0x99be0b){return function(_0x15372b){if(_0x15372b){return _0x15372b[_0x8ff1('0x37')](_0x55d19b)[_0x8ff1('0x38')](function(_0x3e3158){return _0x3e3158;});}return null;};}function removeEntity(_0x122107,_0x231cfb){return function(_0x9f7bcb){if(_0x9f7bcb){return _0x9f7bcb[_0x8ff1('0x39')]()[_0x8ff1('0x38')](function(){var _0x27f39a=_0x9f7bcb[_0x8ff1('0x3a')]({'plain':!![]});var _0x18e94c=_0x8ff1('0x3b');return db[_0x8ff1('0x3c')][_0x8ff1('0x39')]({'where':{'type':_0x18e94c,'resourceId':_0x27f39a['id']}})[_0x8ff1('0x38')](function(){return _0x9f7bcb;});})[_0x8ff1('0x38')](function(){_0x122107[_0x8ff1('0x2c')](0xcc)[_0x8ff1('0x3d')]();});}};}function handleEntityNotFound(_0x1daebc,_0x1da624){return function(_0x24e47f){if(!_0x24e47f){_0x1daebc['sendStatus'](0x194);}return _0x24e47f;};}function handleError(_0x3796df,_0x586300){_0x586300=_0x586300||0x1f4;return function(_0x204c61){logger[_0x8ff1('0x28')](_0x204c61[_0x8ff1('0x3e')]);if(_0x204c61[_0x8ff1('0x3f')]){delete _0x204c61[_0x8ff1('0x3f')];}_0x3796df[_0x8ff1('0x2c')](_0x586300)[_0x8ff1('0x40')](_0x204c61);};}exports[_0x8ff1('0x41')]=function(_0x5c8fd6,_0xdbfbc3){var _0x49559f={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x542463={},_0x1ed97f={'count':0x0,'rows':[]};var _0x12a703=_['map'](db[_0x8ff1('0x42')][_0x8ff1('0x43')],function(_0x3541e0){return{'name':_0x3541e0['fieldName'],'type':_0x3541e0[_0x8ff1('0x44')][_0x8ff1('0x45')]};});_0x542463['model']=_['map'](_0x12a703,_0x8ff1('0x3f'));_0x542463['query']=_[_0x8ff1('0x46')](_0x5c8fd6[_0x8ff1('0x47')]);_0x542463[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x542463['model'],_0x542463[_0x8ff1('0x47')]);_0x49559f[_0x8ff1('0x4a')]=_[_0x8ff1('0x49')](_0x542463[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x5c8fd6['query'][_0x8ff1('0x4c')]));_0x49559f['attributes']=_0x49559f[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x49559f['attributes']:_0x542463['model'];if(!_0x5c8fd6[_0x8ff1('0x47')]['hasOwnProperty'](_0x8ff1('0x4e'))){_0x49559f[_0x8ff1('0x30')]=qs[_0x8ff1('0x30')](_0x5c8fd6[_0x8ff1('0x47')]['limit']);_0x49559f[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x49559f['order']=qs['sort'](_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x49559f[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x5c8fd6[_0x8ff1('0x47')],_0x542463[_0x8ff1('0x48')]),_0x12a703);if(_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x52')]){_0x49559f[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0x49559f[_0x8ff1('0x50')],{'$or':_['map'](_0x12a703,function(_0x5ed394){if(_0x5ed394['type']!=='VIRTUAL'){var _0x578029={};_0x578029[_0x5ed394['name']]={'$like':'%'+_0x5c8fd6['query'][_0x8ff1('0x52')]+'%'};return _0x578029;}})});}_0x49559f=_[_0x8ff1('0x53')]({},_0x49559f,_0x5c8fd6[_0x8ff1('0x54')]);var _0x581270={'where':_0x49559f[_0x8ff1('0x50')]};return db[_0x8ff1('0x42')][_0x8ff1('0x31')](_0x581270)[_0x8ff1('0x38')](function(_0x3be850){_0x1ed97f[_0x8ff1('0x31')]=_0x3be850;if(_0x5c8fd6[_0x8ff1('0x47')][_0x8ff1('0x55')]){_0x49559f[_0x8ff1('0x56')]=[{'all':!![]}];}return db[_0x8ff1('0x42')][_0x8ff1('0x57')](_0x49559f);})[_0x8ff1('0x38')](function(_0x57c8ff){_0x1ed97f['rows']=_0x57c8ff;return _0x1ed97f;})[_0x8ff1('0x38')](respondWithFilteredResult(_0xdbfbc3,_0x49559f))[_0x8ff1('0x2a')](handleError(_0xdbfbc3,null));};exports[_0x8ff1('0x58')]=function(_0x5ef79e,_0x495a42){var _0x306a78={'raw':![],'where':{'id':_0x5ef79e[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0x5a')],'as':_0x8ff1('0x5b')}]},_0x143e26={};_0x143e26[_0x8ff1('0x4b')]=_[_0x8ff1('0x46')](db[_0x8ff1('0x42')]['rawAttributes']);_0x143e26[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x5ef79e[_0x8ff1('0x47')]);_0x143e26[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x143e26[_0x8ff1('0x4b')],_0x143e26[_0x8ff1('0x47')]);_0x306a78[_0x8ff1('0x4a')]=_['intersection'](_0x143e26[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x5ef79e[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x306a78[_0x8ff1('0x4a')]=_0x306a78[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x306a78[_0x8ff1('0x4a')]:_0x143e26[_0x8ff1('0x4b')];if(_0x5ef79e[_0x8ff1('0x47')]['includeAll']){_0x306a78[_0x8ff1('0x56')]=[{'all':!![]}];}_0x306a78=_['merge']({},_0x306a78,_0x5ef79e['options']);return db[_0x8ff1('0x42')][_0x8ff1('0x5c')](_0x306a78)['then'](handleEntityNotFound(_0x495a42,null))[_0x8ff1('0x38')](respondWithResult(_0x495a42,null))[_0x8ff1('0x2a')](handleError(_0x495a42,null));};exports[_0x8ff1('0x5d')]=function(_0x4a1f36,_0x4b6317){return db[_0x8ff1('0x42')]['create'](_0x4a1f36[_0x8ff1('0x5e')],{})[_0x8ff1('0x38')](function(_0x5f3040){var _0x1f90bd=_0x4a1f36[_0x8ff1('0x5f')]['get']({'plain':!![]});if(!_0x1f90bd)throw new Error(_0x8ff1('0x60'));if(_0x1f90bd[_0x8ff1('0x61')]===_0x8ff1('0x5f')){var _0x4e40c7=_0x5f3040['get']({'plain':!![]});var _0x458bdd='ChatWebsites';return db[_0x8ff1('0x62')][_0x8ff1('0x5c')]({'where':{'name':_0x458bdd,'userProfileId':_0x1f90bd[_0x8ff1('0x63')]},'raw':!![]})['then'](function(_0x37bed1){if(_0x37bed1&&_0x37bed1[_0x8ff1('0x64')]===0x0){return db[_0x8ff1('0x3c')][_0x8ff1('0x5d')]({'name':_0x4e40c7[_0x8ff1('0x3f')],'resourceId':_0x4e40c7['id'],'type':_0x37bed1['name'],'sectionId':_0x37bed1['id']},{})[_0x8ff1('0x38')](function(){return _0x5f3040;});}else{return _0x5f3040;}})['catch'](function(_0x288f68){logger['error'](_0x8ff1('0x65'),_0x288f68);throw _0x288f68;});}return _0x5f3040;})[_0x8ff1('0x38')](respondWithResult(_0x4b6317,0xc9))[_0x8ff1('0x2a')](handleError(_0x4b6317,null));};exports[_0x8ff1('0x37')]=function(_0x34e444,_0x15cb6d){if(_0x34e444['body']['id']){delete _0x34e444[_0x8ff1('0x5e')]['id'];}return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x34e444[_0x8ff1('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x15cb6d,null))[_0x8ff1('0x38')](saveUpdates(_0x34e444[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x15cb6d,null))[_0x8ff1('0x2a')](handleError(_0x15cb6d,null));};exports[_0x8ff1('0x39')]=function(_0x115f25,_0xd654db){return db[_0x8ff1('0x42')]['find']({'where':{'id':_0x115f25[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0xd654db,null))[_0x8ff1('0x38')](removeEntity(_0xd654db,null))['catch'](handleError(_0xd654db,null));};exports[_0x8ff1('0x66')]=function(_0x2792cb,_0x4c0857){return db['ChatWebsite']['describe']()[_0x8ff1('0x38')](respondWithResult(_0x4c0857,null))['catch'](handleError(_0x4c0857,null));};exports[_0x8ff1('0x67')]=function(_0x40853e,_0x2e0240,_0x4d710f){if(_0x40853e[_0x8ff1('0x5e')]['id']){delete _0x40853e[_0x8ff1('0x5e')]['id'];}return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x40853e[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x2e0240,null))[_0x8ff1('0x38')](function(_0x20dd36){if(_0x20dd36){_0x40853e['body'][_0x8ff1('0x68')]=_0x20dd36['id'];return db['Disposition'][_0x8ff1('0x5d')](_0x40853e[_0x8ff1('0x5e')]);}})[_0x8ff1('0x38')](respondWithResult(_0x2e0240,null))[_0x8ff1('0x2a')](handleError(_0x2e0240,null));};exports[_0x8ff1('0x69')]=function(_0x2a179a,_0x309bfa,_0x311453){var _0x119444={'raw':![],'where':{}};var _0x3fce92={};var _0x9fb25a={'count':0x0,'rows':[]};return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x2a179a['params']['id']}})['then'](handleEntityNotFound(_0x309bfa,null))[_0x8ff1('0x38')](function(_0x3ee12a){if(_0x3ee12a){_0x3fce92[_0x8ff1('0x4b')]=_[_0x8ff1('0x46')](db[_0x8ff1('0x6b')]['rawAttributes']);_0x3fce92[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x2a179a[_0x8ff1('0x47')]);_0x3fce92[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x3fce92[_0x8ff1('0x4b')],_0x3fce92[_0x8ff1('0x47')]);_0x119444['attributes']=_[_0x8ff1('0x49')](_0x3fce92['model'],qs[_0x8ff1('0x4c')](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x119444[_0x8ff1('0x4a')]=_0x119444[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x119444[_0x8ff1('0x4a')]:_0x3fce92[_0x8ff1('0x4b')];if(!_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x119444[_0x8ff1('0x30')]=qs[_0x8ff1('0x30')](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x119444['offset']=qs[_0x8ff1('0x2e')](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x119444['order']=qs['sort'](_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x119444[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x2a179a[_0x8ff1('0x47')],_0x3fce92['filters']));_0x119444[_0x8ff1('0x50')]['ChatWebsiteId']=_0x3ee12a['id'];if(_0x2a179a['query'][_0x8ff1('0x52')]){_0x119444[_0x8ff1('0x50')]=_['merge'](_0x119444[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x119444[_0x8ff1('0x4a')],function(_0x426f52){var _0x270b88={};_0x270b88[_0x426f52]={'$like':'%'+_0x2a179a[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x270b88;})});}_0x119444=_[_0x8ff1('0x53')]({},_0x119444,_0x2a179a[_0x8ff1('0x54')]);return db[_0x8ff1('0x6b')][_0x8ff1('0x31')]({'where':_0x119444[_0x8ff1('0x50')]})[_0x8ff1('0x38')](function(_0x9637d2){_0x9fb25a[_0x8ff1('0x31')]=_0x9637d2;if(_0x2a179a[_0x8ff1('0x47')]['includeAll']){_0x119444[_0x8ff1('0x56')]=[{'all':!![]}];}return db[_0x8ff1('0x6b')][_0x8ff1('0x57')](_0x119444);})['then'](function(_0xf8be2c){_0x9fb25a[_0x8ff1('0x6e')]=_0xf8be2c;return _0x9fb25a;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x309bfa,_0x119444))[_0x8ff1('0x2a')](handleError(_0x309bfa,null));};exports['removeDispositions']=function(_0x39ad8f,_0x5a2bdb,_0x53d908){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x39ad8f[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x5a2bdb,null))[_0x8ff1('0x38')](function(_0x28821c){if(_0x28821c){return _0x28821c[_0x8ff1('0x6f')](_0x39ad8f[_0x8ff1('0x47')][_0x8ff1('0x70')]);}})[_0x8ff1('0x38')](respondWithStatusCode(_0x5a2bdb,null))[_0x8ff1('0x2a')](handleError(_0x5a2bdb,null));};exports[_0x8ff1('0x71')]=function(_0x3e6717,_0x74bf0,_0x23b140){if(_0x3e6717[_0x8ff1('0x5e')]['id']){delete _0x3e6717['body']['id'];}return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x3e6717[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x74bf0,null))['then'](function(_0x22729a){if(_0x22729a){_0x3e6717[_0x8ff1('0x5e')][_0x8ff1('0x68')]=_0x22729a['id'];return db['CannedAnswer'][_0x8ff1('0x5d')](_0x3e6717[_0x8ff1('0x5e')]);}})[_0x8ff1('0x38')](respondWithResult(_0x74bf0,null))[_0x8ff1('0x2a')](handleError(_0x74bf0,null));};exports['getAnswers']=function(_0x40f34a,_0x1ee435,_0x1e01f8){var _0x250be4={'raw':![],'where':{}};var _0x3b46d3={};var _0x2dac0c={'count':0x0,'rows':[]};return db[_0x8ff1('0x42')]['findOne']({'where':{'id':_0x40f34a['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x1ee435,null))[_0x8ff1('0x38')](function(_0x2ea1ee){if(_0x2ea1ee){_0x3b46d3['model']=_['keys'](db[_0x8ff1('0x72')]['rawAttributes']);_0x3b46d3[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x40f34a['query']);_0x3b46d3[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x3b46d3['model'],_0x3b46d3[_0x8ff1('0x47')]);_0x250be4[_0x8ff1('0x4a')]=_['intersection'](_0x3b46d3['model'],qs[_0x8ff1('0x4c')](_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x250be4['attributes']=_0x250be4[_0x8ff1('0x4a')]['length']?_0x250be4[_0x8ff1('0x4a')]:_0x3b46d3[_0x8ff1('0x4b')];if(!_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x250be4[_0x8ff1('0x30')]=qs[_0x8ff1('0x30')](_0x40f34a['query']['limit']);_0x250be4[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x40f34a['query'][_0x8ff1('0x2e')]);}_0x250be4[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x250be4[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_['pick'](_0x40f34a[_0x8ff1('0x47')],_0x3b46d3[_0x8ff1('0x48')]));_0x250be4[_0x8ff1('0x50')][_0x8ff1('0x68')]=_0x2ea1ee['id'];if(_0x40f34a[_0x8ff1('0x47')]['filter']){_0x250be4[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0x250be4[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x250be4[_0x8ff1('0x4a')],function(_0x325467){var _0xc91d45={};_0xc91d45[_0x325467]={'$like':'%'+_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0xc91d45;})});}_0x250be4=_[_0x8ff1('0x53')]({},_0x250be4,_0x40f34a['options']);return db[_0x8ff1('0x72')][_0x8ff1('0x31')]({'where':_0x250be4[_0x8ff1('0x50')]})[_0x8ff1('0x38')](function(_0x4384fe){_0x2dac0c[_0x8ff1('0x31')]=_0x4384fe;if(_0x40f34a[_0x8ff1('0x47')][_0x8ff1('0x55')]){_0x250be4['include']=[{'all':!![]}];}return db[_0x8ff1('0x72')]['findAll'](_0x250be4);})[_0x8ff1('0x38')](function(_0x46991e){_0x2dac0c[_0x8ff1('0x6e')]=_0x46991e;return _0x2dac0c;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x1ee435,_0x250be4))['catch'](handleError(_0x1ee435,null));};exports[_0x8ff1('0x74')]=function(_0x4b1f26,_0x49e4bd,_0x2ad108){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x4b1f26['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x49e4bd,null))[_0x8ff1('0x38')](function(_0x46473b){if(_0x46473b){return _0x46473b[_0x8ff1('0x74')](_0x4b1f26[_0x8ff1('0x47')][_0x8ff1('0x70')]);}})[_0x8ff1('0x38')](respondWithStatusCode(_0x49e4bd,null))['catch'](handleError(_0x49e4bd,null));};exports[_0x8ff1('0x75')]=function(_0x15835f,_0x57edb2,_0x4f68b6){_0x15835f[_0x8ff1('0x5e')]['sitepic']=_0x15835f[_0x8ff1('0x76')][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x15835f['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x57edb2,null))[_0x8ff1('0x38')](saveUpdates(_0x15835f[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x57edb2,null))[_0x8ff1('0x2a')](handleError(_0x57edb2,null));};exports[_0x8ff1('0x78')]=function(_0x1ea546,_0x2f4eac,_0xbb20ac){_0x1ea546[_0x8ff1('0x5e')]['agentAvatar']=_0x1ea546[_0x8ff1('0x76')][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x1ea546[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x2f4eac,null))['then'](saveUpdates(_0x1ea546[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x2f4eac,null))[_0x8ff1('0x2a')](handleError(_0x2f4eac,null));};exports[_0x8ff1('0x79')]=function(_0x5f09e0,_0x464bfd,_0xe4632d){_0x5f09e0[_0x8ff1('0x5e')][_0x8ff1('0x7a')]=_0x5f09e0['file'][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x5f09e0['params']['id']}})['then'](handleEntityNotFound(_0x464bfd,null))[_0x8ff1('0x38')](saveUpdates(_0x5f09e0[_0x8ff1('0x5e')],null))[_0x8ff1('0x38')](respondWithResult(_0x464bfd,null))[_0x8ff1('0x2a')](handleError(_0x464bfd,null));};exports[_0x8ff1('0x7b')]=function(_0x55f0a3,_0x2d6f2d,_0x3a249a){_0x55f0a3[_0x8ff1('0x5e')][_0x8ff1('0x7c')]=_0x55f0a3[_0x8ff1('0x76')][_0x8ff1('0x77')];return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x55f0a3['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x2d6f2d,null))[_0x8ff1('0x38')](saveUpdates(_0x55f0a3['body'],null))[_0x8ff1('0x38')](respondWithResult(_0x2d6f2d,null))[_0x8ff1('0x2a')](handleError(_0x2d6f2d,null));};exports[_0x8ff1('0x7d')]=function(_0x436073,_0x433ad4,_0x341ed0){var _0x36141c=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],'server/files/images/logos/default_logo.svg');var _0x2cb219={'where':{'id':_0x436073[_0x8ff1('0x59')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1fe7de=![];return require(_0x8ff1('0x80'))[_0x8ff1('0x81')]()['then'](function(_0x5eb4a1){if(_0x5eb4a1){_0x1fe7de=_0x5eb4a1[_0x8ff1('0x82')];}})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0x42')]['find'](_0x2cb219);})[_0x8ff1('0x38')](handleEntityNotFound(_0x433ad4,null))[_0x8ff1('0x38')](function(_0x3823be){if(_0x3823be){if(!_['isNil'](_0x3823be['sitepic'])){if(fs[_0x8ff1('0x83')](path[_0x8ff1('0x7e')](config['root'],_0x8ff1('0x84'),_0x3823be['sitepic']))&&_0x1fe7de){_0x36141c=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x84'),_0x3823be['sitepic']);}}return _0x433ad4[_0x8ff1('0x85')](_0x36141c);}})[_0x8ff1('0x2a')](handleError(_0x433ad4,null));};exports[_0x8ff1('0x86')]=function(_0x13a8cc,_0xba2600,_0x11add9){var _0x34f240=path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0x87'));var _0x2c6a8f={'where':{'id':_0x13a8cc[_0x8ff1('0x59')]['id']},'attributes':['id',_0x8ff1('0x88')],'raw':!![]};return db[_0x8ff1('0x42')][_0x8ff1('0x5c')](_0x2c6a8f)[_0x8ff1('0x38')](handleEntityNotFound(_0xba2600,null))[_0x8ff1('0x38')](function(_0x5fc65c){if(_0x5fc65c){if(!_[_0x8ff1('0x89')](_0x5fc65c[_0x8ff1('0x88')])){if(fs[_0x8ff1('0x83')](path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x5fc65c[_0x8ff1('0x88')]))){_0x34f240=path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x5fc65c['agentAvatar']);}}return _0xba2600[_0x8ff1('0x85')](_0x34f240);}})[_0x8ff1('0x2a')](handleError(_0xba2600,null));};exports[_0x8ff1('0x8b')]=function(_0x63efd1,_0x49d509,_0x4399b2){var _0x3b17a3=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],'server/files/images/avatars/customer_avatar.png');var _0x4528c5={'where':{'id':_0x63efd1[_0x8ff1('0x59')]['id']},'attributes':['id',_0x8ff1('0x7a'),_0x8ff1('0x8c')],'raw':!![]};return db['ChatWebsite'][_0x8ff1('0x5c')](_0x4528c5)['then'](handleEntityNotFound(_0x49d509,null))[_0x8ff1('0x38')](function(_0x226969){if(_0x226969){if(!_[_0x8ff1('0x89')](_0x226969['customerAvatar'])){if(fs['existsSync'](path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x226969[_0x8ff1('0x7a')]))&&_0x226969[_0x8ff1('0x8c')]){_0x3b17a3=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x226969[_0x8ff1('0x7a')]);}}return _0x49d509['download'](_0x3b17a3);}})['catch'](handleError(_0x49d509,null));};exports[_0x8ff1('0x8d')]=function(_0x4e34d4,_0x10ecdc,_0x4607f1){var _0x3da7b0=path['join'](config['root'],_0x8ff1('0x8e'));var _0x5ad166={'where':{'id':_0x4e34d4['params']['id']},'attributes':['id',_0x8ff1('0x7c')],'raw':!![]};return db[_0x8ff1('0x42')][_0x8ff1('0x5c')](_0x5ad166)['then'](handleEntityNotFound(_0x10ecdc,null))['then'](function(_0x2648e8){if(_0x2648e8){if(!_[_0x8ff1('0x89')](_0x2648e8[_0x8ff1('0x7c')])){if(fs[_0x8ff1('0x83')](path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0x8a'),_0x2648e8['systemAvatar']))){_0x3da7b0=path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],'server/files/images/avatars/',_0x2648e8[_0x8ff1('0x7c')]);}}return _0x10ecdc[_0x8ff1('0x85')](_0x3da7b0);}})[_0x8ff1('0x2a')](handleError(_0x10ecdc,null));};exports['notify']=function(_0x890202,_0x1f4a39,_0x28e956){var _0x2b70e1=require('user-agent-parser');var _0x5f4161=new _0x2b70e1();var _0x36d218=_0x5f4161[_0x8ff1('0x8f')](_0x890202['headers'][_0x8ff1('0x90')])[_0x8ff1('0x91')]();var _0xcefe11={'body':_0x890202[_0x8ff1('0x5e')],'channel':_0x8ff1('0x92')};var _0x1ca560=[];var _0xc174d5=[];var _0x956440={};var _0x436bdd=![];return db['CmContact'][_0x8ff1('0x66')]()[_0x8ff1('0x38')](function(_0xb62826){if(!_0xb62826){throw new db[(_0x8ff1('0x93'))]['ValidationError']('no\x20available\x20attributes');}_0x1ca560=_['difference'](_[_0x8ff1('0x46')](_0xb62826),[_0x8ff1('0x94'),'updatedAt']);_0xc174d5=_[_0x8ff1('0x95')](_[_0x8ff1('0x46')](_0xb62826),[_0x8ff1('0x94'),_0x8ff1('0x96'),_0x8ff1('0x97'),_0x8ff1('0x98')]);if(_0x890202[_0x8ff1('0x5e')]['id']){delete _0x890202[_0x8ff1('0x5e')]['id'];}if(_[_0x8ff1('0x89')](_0x890202['body'][_0x8ff1('0x99')])){throw new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9b'));}if(_[_0x8ff1('0x89')](_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x5e')])||_0x890202['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x8ff1('0x9c'));}if(_[_0x8ff1('0x89')](_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x9d')])){throw new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9e')+_0xc174d5);}if(!_['includes'](_0xc174d5,_0x890202['body'][_0x8ff1('0x9d')])){throw new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9f')+_0xc174d5);}_0x956440[_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x9d')]]=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x99')];})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x890202[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0xa0')],'as':_0x8ff1('0xa1'),'include':[{'model':db[_0x8ff1('0xa2')],'as':_0x8ff1('0xa3'),'where':_0x956440,'limit':0x1,'order':[[_0x8ff1('0x96'),_0x8ff1('0xa4')]]}]},{'model':db[_0x8ff1('0xa5')],'as':_0x8ff1('0xa6')}]});})['then'](handleEntityNotFound(_0x1f4a39,null))[_0x8ff1('0x38')](function(_0x52b0bb){if(_0x52b0bb&&_0x52b0bb[_0x8ff1('0xa1')]){_0xcefe11['account']=_0x52b0bb;_0xcefe11['applications']=_0x52b0bb[_0x8ff1('0xa6')];_0xcefe11[_0x8ff1('0xa7')]=_0x52b0bb['List'];_0xcefe11[_0x8ff1('0xa8')]=_[_0x8ff1('0xa9')](_0xcefe11[_0x8ff1('0xa8')],[_0x8ff1('0xaa')],[_0x8ff1('0xab')]);if(_0xcefe11[_0x8ff1('0xac')][_0x8ff1('0xa6')]){delete _0xcefe11['account'][_0x8ff1('0xa6')];}if(_0xcefe11[_0x8ff1('0xac')][_0x8ff1('0xa1')]&&_0xcefe11['account'][_0x8ff1('0xa1')][_0x8ff1('0xa3')][_0x8ff1('0x4d')]){return _0xcefe11['account'][_0x8ff1('0xa1')][_0x8ff1('0xa3')][0x0];}var _0x51afa2=_[_0x8ff1('0x1a')](_0x890202['body'],{'firstName':_0x890202[_0x8ff1('0x5e')]['from'],'ListId':_0x52b0bb['ListId']});_0x51afa2[_0x890202[_0x8ff1('0x5e')]['mapKey']]=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x99')];return db[_0x8ff1('0xa2')]['create'](_0x51afa2,{'fields':_0x1ca560,'raw':!![]});}})['then'](handleEntityNotFound(_0x1f4a39,null))[_0x8ff1('0x38')](function(_0x33d79f){_0xcefe11[_0x8ff1('0xad')]=_0x33d79f;var _0x299afd=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xae')];if(_0x890202['headers'][_0x8ff1('0xaf')]){_0x299afd=_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xaf')];}else if(_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb1')]){_0x299afd=_[_0x8ff1('0xb2')](_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb1')][_0x8ff1('0xb3')](','));}if(_0x33d79f){var _0x3db4bf={'ContactId':_0x33d79f['id'],'ChatWebsiteId':_0x890202['params']['id'],'from':(_0x33d79f[_0x8ff1('0xb4')]||'')+'\x20'+(_0x33d79f[_0x8ff1('0xb5')]||''),'customerIp':_0x299afd,'customerPort':_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb6')]?_0x890202[_0x8ff1('0xb0')][_0x8ff1('0xb6')]:null,'referer':_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xb7')],'browserName':_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0x3f')]&&_0x36d218[_0x8ff1('0xb8')]['version']?util[_0x8ff1('0xb9')](_0x8ff1('0xba'),_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0x3f')],_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0xbb')]):_0x8ff1('0xbc'),'browserVersion':_0x36d218[_0x8ff1('0xb8')][_0x8ff1('0xbb')]||_0x8ff1('0xbc'),'osName':util[_0x8ff1('0xb9')](_0x8ff1('0xba'),_0x36d218['os']['name'],_0x36d218['os']['version']),'osVersion':_0x36d218['os'][_0x8ff1('0xbb')],'deviceModel':_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0x4b')]&&_0x36d218[_0x8ff1('0xbd')]['vendor']?util[_0x8ff1('0xb9')](_0x8ff1('0xbe'),_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0x4b')],_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0xbf')],_0x36d218['device'][_0x8ff1('0x44')]):null,'deviceVendor':_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0xbf')],'deviceType':_0x36d218[_0x8ff1('0xbd')][_0x8ff1('0x44')],'formData':JSON[_0x8ff1('0x27')](_0x890202[_0x8ff1('0x5e')])};var _0x247707={'ChatWebsiteId':_0x890202[_0x8ff1('0x59')]['id'],'closed':![]};if(_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')]){_0x247707['threadId']=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')];return db[_0x8ff1('0xc1')][_0x8ff1('0x5c')]({'where':_0x247707})[_0x8ff1('0x38')](function(_0x413834){if(_0x413834){return[_0x413834,![]];}_0x3db4bf['threadId']=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')];_0x3db4bf[_0x8ff1('0xc2')]=_0x890202[_0x8ff1('0x5e')]['externalUrl'];return db[_0x8ff1('0xc1')][_0x8ff1('0x5d')](_0x3db4bf)[_0x8ff1('0x38')](function(_0x1e6482){return[_0x1e6482,!![]];});});}_0x247707[_0x8ff1('0xc3')]=_0x33d79f['id'];if(_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc4')]&&_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc4')]['id']){_0x247707['id']=_0x890202['body']['interaction']['id'];return db[_0x8ff1('0xc1')][_0x8ff1('0x5c')]({'where':_0x247707})[_0x8ff1('0x38')](function(_0x4cbdfd){if(_0x4cbdfd){return[_0x4cbdfd,![]];}return db[_0x8ff1('0xc1')][_0x8ff1('0x5d')](_0x3db4bf)[_0x8ff1('0x38')](function(_0x2c4d50){return[_0x2c4d50,!![]];});});}return db['ChatInteraction']['create'](_0x3db4bf)[_0x8ff1('0x38')](function(_0x17973b){return[_0x17973b,!![]];});}})['spread'](function(_0x2e1997,_0x7dd6b4){if(_0x2e1997){_0x436bdd=_0x7dd6b4;if(!_0x7dd6b4){var _0x55103a={'from':(_0xcefe11[_0x8ff1('0xad')][_0x8ff1('0xb4')]||'')+'\x20'+(_0xcefe11[_0x8ff1('0xad')]['lastName']||'')};if(_0x890202['body']['threadId']&&_0x890202['body'][_0x8ff1('0xc5')]&&_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc0')]!=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc5')]){_0x55103a[_0x8ff1('0xc0')]=_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xc5')];}return _0x2e1997[_0x8ff1('0x37')](_0x55103a);}else{return _0x2e1997;}}})[_0x8ff1('0x38')](function(_0x14706c){_0xcefe11[_0x8ff1('0xc4')]=_0x14706c[_0x8ff1('0x3a')]({'plain':!![]});_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xc6')]=_0x436bdd;if(_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xc6')]){if(_0xcefe11['account'][_0x8ff1('0xc7')]){_0xcefe11[_0x8ff1('0xa8')]['push']({'id':0x0,'priority':_0xcefe11[_0x8ff1('0xa8')]['length']+0x1,'app':_0x8ff1('0xc8'),'appdata':_0x8ff1('0xc9'),'interval':'*,*,*,*'});}}return db[_0x8ff1('0xca')][_0x8ff1('0x5d')]({'body':_0x890202[_0x8ff1('0x5e')][_0x8ff1('0x5e')],'ChatWebsiteId':_0x890202[_0x8ff1('0x59')]['id'],'ChatInteractionId':_0x14706c['id'],'direction':'in','ContactId':_0xcefe11[_0x8ff1('0xad')]['id'],'AttachmentId':_0x890202[_0x8ff1('0x5e')][_0x8ff1('0xcb')]});})[_0x8ff1('0x38')](function(_0x4869ad){_0xcefe11[_0x8ff1('0x29')]=_0x4869ad;if(_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xcc')]){return db[_0x8ff1('0xcd')]['find']({'attributes':['id','name'],'where':{'id':_0xcefe11[_0x8ff1('0xc4')][_0x8ff1('0xcc')]}})[_0x8ff1('0x38')](function(_0x171c45){if(_0x171c45){_0xcefe11[_0x8ff1('0xa8')][_0x8ff1('0xce')]({'id':0x0,'priority':0x0,'app':_0x8ff1('0xcf'),'appdata':_0x171c45[_0x8ff1('0x3f')]+','+(_0xcefe11[_0x8ff1('0xac')][_0x8ff1('0xd0')]||0xa),'interval':_0x8ff1('0xd1')});_0xcefe11[_0x8ff1('0xd2')]=!![];}return respondWithRpcPromise(_0x8ff1('0xd3'),_0x8ff1('0xd4'),_0xcefe11);});}return respondWithRpcPromise(_0x8ff1('0xd3'),_0x8ff1('0xd4'),_0xcefe11);})[_0x8ff1('0x38')](function(_0x4f853d){respondWithRpcPromise(_0x8ff1('0xd5'),_0x8ff1('0xd5'),{'event':'notify','message':_0x4f853d},client9002);return _0x4f853d;})[_0x8ff1('0x38')](respondWithResult(_0x1f4a39,null))[_0x8ff1('0x2a')](handleError(_0x1f4a39,null));};exports[_0x8ff1('0xd6')]=function(_0x3da73a,_0x391d44,_0x55d96d){var _0x27ab19,_0xd98019,_0x57013b;var _0x2559d8=[];var _0x36ae39=[];var _0x1ecd37={};var _0x132db0=_0x3da73a[_0x8ff1('0xd7')]||[];var _0x243e72=[];var _0x25a700;return db['CmContact'][_0x8ff1('0x66')]()[_0x8ff1('0x38')](function(_0x512a34){if(!_0x512a34){throw new db['Sequelize'][(_0x8ff1('0x9a'))](_0x8ff1('0xd8'));}_0x36ae39=_[_0x8ff1('0x95')](_['keys'](_0x512a34),[_0x8ff1('0x94'),_0x8ff1('0x96')]);_0x2559d8=_[_0x8ff1('0x95')](_[_0x8ff1('0x46')](_0x512a34),[_0x8ff1('0x94'),_0x8ff1('0x96'),_0x8ff1('0x97'),_0x8ff1('0x98')]);if(_0x3da73a['body']['id']){delete _0x3da73a[_0x8ff1('0x5e')]['id'];}if(_[_0x8ff1('0x89')](_0x3da73a['body'][_0x8ff1('0x99')])){throw _0x391d44[_0x8ff1('0x2c')](0x1f4)[_0x8ff1('0x40')](new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))]('from\x20is\x20mandatory'));}if(_[_0x8ff1('0x89')](_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x5e')])||_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x5e')]===''){throw _0x391d44['status'](0x1f4)['send'](new db[(_0x8ff1('0x93'))][(_0x8ff1('0x9a'))](_0x8ff1('0x9c')));}if(_['isNil'](_0x3da73a[_0x8ff1('0x5e')]['mapKeyOffline'])){throw _0x391d44[_0x8ff1('0x2c')](0x1f4)[_0x8ff1('0x40')](new db['Sequelize'][(_0x8ff1('0x9a'))](_0x8ff1('0xd9')+_0x2559d8));}if(!_[_0x8ff1('0xda')](_0x2559d8,_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0xdb')])){throw _0x391d44[_0x8ff1('0x2c')](0x1f4)[_0x8ff1('0x40')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2559d8));}_0x1ecd37[_0x3da73a[_0x8ff1('0x5e')]['mapKeyOffline']]=_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')];})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x3da73a[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0xa0')],'as':_0x8ff1('0xa1')},{'model':db['MailAccount'],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x391d44,null))[_0x8ff1('0x38')](function(_0x3210af){if(_0x3210af&&_0x3210af[_0x8ff1('0xa1')]){_0xd98019=_0x3210af;var _0x3fc799=_[_0x8ff1('0x1a')](_0x3da73a['body'],{'firstName':_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')],'phone':_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')],'ListId':_0x3210af[_0x8ff1('0x98')]});_0x3fc799[_0x3da73a['body'][_0x8ff1('0xdb')]]=_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x99')];return db[_0x8ff1('0xa2')][_0x8ff1('0xdc')]({'where':_0x1ecd37,'defaults':_0x3fc799});}})[_0x8ff1('0xdd')](function(_0x1c57e7){if(_0x1c57e7){_0x57013b=_0x1c57e7;var _0x239551=fs['readFileSync'](path[_0x8ff1('0x7e')](config['root'],_0x8ff1('0xde')),_0x8ff1('0xdf'));var _0x3cd0f5=ejs['render'](_0x239551,{'body':_[_0x8ff1('0xe0')](_0x3da73a[_0x8ff1('0x5e')][_0x8ff1('0x5e')]),'bodyTitle':_0xd98019['offlineMessageBody']});return db[_0x8ff1('0xe1')][_0x8ff1('0x5d')]({'body':_0x3cd0f5,'ContactId':_0x1c57e7['id'],'ChatWebsiteId':_0xd98019['id']});}})['then'](function(_0x5bebb4){_0x25a700=_0x5bebb4;if(_0x132db0[_0x8ff1('0x4d')]){var _0x1fca2d=_0x132db0[_0x8ff1('0x6d')](function(_0x414baa){return{'name':_0x414baa[_0x8ff1('0xe2')],'basename':_0x414baa[_0x8ff1('0x77')],'type':_0x414baa[_0x8ff1('0xe3')],'ChatOfflineMessageId':_0x5bebb4['id']};});_0x243e72=_0x1fca2d[_0x8ff1('0x6d')](_0x3f04fb=>{var _0x95587={'filename':_0x3f04fb[_0x8ff1('0x3f')],'path':path['join'](config[_0x8ff1('0x7f')],_0x8ff1('0xe4'),'files',_0x8ff1('0xe5'),_0x8ff1('0xe6'),_0x3f04fb[_0x8ff1('0xe7')])};return _0x95587;});if(!_0xd98019[_0x8ff1('0xe8')]){return db[_0x8ff1('0xe9')][_0x8ff1('0xea')](function(_0x49034a){return db[_0x8ff1('0xeb')][_0x8ff1('0xec')](_0x1fca2d,{'transaction':_0x49034a});});}}})[_0x8ff1('0x38')](function(){if(_0x25a700){_0x27ab19=_0x25a700;return db[_0x8ff1('0xed')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x8ff1('0x38')](function(_0x1a774d){if(_0x1a774d&&_0x1a774d[_0x8ff1('0xee')]&&_0xd98019[_0x8ff1('0xef')]&&_0xd98019[_0x8ff1('0xf0')]){var _0x334905={'tls':{'rejectUnauthorized':![]}};if(_0x1a774d['Smtp'][_0x8ff1('0xf1')]){_0x334905[_0x8ff1('0xf1')]=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf1')];}else{_0x334905['host']=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf2')];_0x334905[_0x8ff1('0xf3')]=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf3')];_0x334905[_0x8ff1('0xf4')]=_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf4')];}if(_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0xf5')]){_0x334905[_0x8ff1('0xf6')]={'user':_0x1a774d[_0x8ff1('0xee')]['user'],'pass':_0x1a774d['Smtp'][_0x8ff1('0xf7')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x334905,'message':{'from':util['format'](_0x8ff1('0xf8'),_0x1a774d['name'],_0x1a774d[_0x8ff1('0xf9')]||_0x1a774d[_0x8ff1('0xee')][_0x8ff1('0x5f')]),'to':_0xd98019[_0x8ff1('0xf0')],'subject':_0xd98019[_0x8ff1('0xfa')],'html':_0x27ab19[_0x8ff1('0x5e')],'attachments':_0x243e72}},client9003)[_0x8ff1('0x38')](function(){return _0x27ab19;})[_0x8ff1('0x2a')](function(_0xcf9cc0){console[_0x8ff1('0x28')](_0xcf9cc0);});}})[_0x8ff1('0x38')](function(){if(_0xd98019&&_0xd98019[_0x8ff1('0xe8')]&&_0xd98019[_0x8ff1('0xfb')]){var _0x5cf52a=[];if(_0x132db0[_0x8ff1('0x4d')]){_0x5cf52a=_0x132db0[_0x8ff1('0x6d')](function(_0x22fab5){return{'name':_0x22fab5[_0x8ff1('0xe2')],'basename':_0x22fab5['filename'],'type':_0x22fab5[_0x8ff1('0xe3')],'ChatOfflineMessageId':_0x25a700['id']};});}var _0x59c848;if(!_[_0x8ff1('0x89')](_0xd98019[_0x8ff1('0xfc')])){var _0x542c1b=_[_0x8ff1('0x6d')](_0x3da73a[_0x8ff1('0x5e')],function(_0x57eb6e){return _0x57eb6e;});var _0x28fe88=_['toPairsIn'](_0x542c1b)[0x0];var _0x42b984=_[_0x8ff1('0xfd')](_0x28fe88,function(_0x2aa26d){return _0x2aa26d;});_0x59c848=_0x42b984[0x1][_0xd98019[_0x8ff1('0xfc')]];}var _0x1238bc={'from':_0x57013b[_0x8ff1('0xf9')],'firstName':_0x57013b[_0x8ff1('0xb4')],'lastName':_0x57013b['lastName'],'mapKey':_0x8ff1('0xf9'),'message':{'from':_0x57013b['email'],'to':_0xd98019[_0x8ff1('0xed')]['email'],'cc':'','subject':_[_0x8ff1('0x89')](_0x59c848)?_0xd98019[_0x8ff1('0xfa')]:_0x59c848,'messageId':'','sentAt':new Date(),'attach':_0x5cf52a[_0x8ff1('0x4d')],'attachments':_0x5cf52a,'originChannel':_0x8ff1('0xfe'),'ChatWebsiteId':_0xd98019['id'],'ChatOfflineMessageId':_0x27ab19['id'],'originTo':_0xd98019[_0x8ff1('0xed')]['email']},'body':_0x27ab19[_0x8ff1('0x5e')]};var _0x1a5518={'account':{'id':_0xd98019[_0x8ff1('0xfb')]},'body':_0x1238bc,'log':_0x8ff1('0xff')};return respondWithRpcPromise(_0x8ff1('0xff'),'notifyMail',_0x1a5518,client9001)[_0x8ff1('0x38')](function(){return _0x27ab19;})[_0x8ff1('0x2a')](function(_0x56ba25){console['error'](_0x56ba25);});}return;})['then'](function(){if(_0x27ab19){return _0x27ab19;}})[_0x8ff1('0x38')](respondWithResult(_0x391d44,null))['catch'](function(_0x279506){console[_0x8ff1('0x28')]('catch',_0x279506);for(var _0x50f07d of _0x132db0){var _0x526649=path[_0x8ff1('0x7e')](config['root'],_0x8ff1('0xe4'),_0x8ff1('0xd7'),_0x8ff1('0xe5'),'offline-chat',_0x50f07d[_0x8ff1('0x77')]);fs_extra[_0x8ff1('0x100')](_0x526649)[_0x8ff1('0x2a')](function(_0x1acdc9){console['error'](_0x8ff1('0x101'),_0x526649,_0x1acdc9);});}});};exports[_0x8ff1('0x102')]=function(_0x264bb8,_0x3de791,_0x3ee01a){return db[_0x8ff1('0xc1')]['find']({'where':{'id':_0x264bb8[_0x8ff1('0x59')]['id']}})['then'](handleEntityNotFound(_0x3de791,null))[_0x8ff1('0x38')](function(_0x123afb){if(_0x123afb){return _0x123afb[_0x8ff1('0x102')](_0x264bb8[_0x8ff1('0x5e')][_0x8ff1('0x70')],_[_0x8ff1('0x103')](_0x264bb8[_0x8ff1('0x5e')],[_0x8ff1('0x70'),'id'])||{});}})['then'](respondWithResult(_0x3de791,null))[_0x8ff1('0x2a')](handleError(_0x3de791,null));};exports[_0x8ff1('0x104')]=function(_0x54e4ae,_0x3ac2e0,_0x2be619){var _0x1f2fa8={'raw':![],'where':{}};var _0x24c017={};var _0x58f4b9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8ff1('0x6a')]({'where':{'id':_0x54e4ae['params']['id']}})['then'](handleEntityNotFound(_0x3ac2e0,null))['then'](function(_0x10ad75){if(_0x10ad75){_0x24c017[_0x8ff1('0x4b')]=_[_0x8ff1('0x46')](db['ChatInteraction']['rawAttributes']);_0x24c017[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x54e4ae['query']);_0x24c017[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x24c017[_0x8ff1('0x4b')],_0x24c017[_0x8ff1('0x47')]);_0x1f2fa8[_0x8ff1('0x4a')]=_[_0x8ff1('0x49')](_0x24c017['model'],qs[_0x8ff1('0x4c')](_0x54e4ae['query']['fields']));_0x1f2fa8[_0x8ff1('0x4a')]=_0x1f2fa8[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x1f2fa8[_0x8ff1('0x4a')]:_0x24c017[_0x8ff1('0x4b')];if(!_0x54e4ae['query']['hasOwnProperty'](_0x8ff1('0x4e'))){_0x1f2fa8['limit']=qs[_0x8ff1('0x30')](_0x54e4ae[_0x8ff1('0x47')]['limit']);_0x1f2fa8[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x1f2fa8['order']=qs[_0x8ff1('0x4f')](_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x1f2fa8[_0x8ff1('0x50')]=qs['filters'](_[_0x8ff1('0x51')](_0x54e4ae['query'],_0x24c017['filters']));_0x1f2fa8[_0x8ff1('0x50')]['ChatWebsiteId']=_0x10ad75['id'];if(_0x54e4ae['query'][_0x8ff1('0x52')]){_0x1f2fa8[_0x8ff1('0x50')]=_['merge'](_0x1f2fa8[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x1f2fa8[_0x8ff1('0x4a')],function(_0x27713e){var _0x207101={};_0x207101[_0x27713e]={'$like':'%'+_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x207101;})});}_0x1f2fa8=_['merge']({},_0x1f2fa8,_0x54e4ae[_0x8ff1('0x54')]);return db[_0x8ff1('0xc1')][_0x8ff1('0x31')]({'where':_0x1f2fa8[_0x8ff1('0x50')]})[_0x8ff1('0x38')](function(_0x373c61){_0x58f4b9[_0x8ff1('0x31')]=_0x373c61;if(_0x54e4ae['query']['includeAll']){_0x1f2fa8[_0x8ff1('0x56')]=[{'model':db[_0x8ff1('0xa2')],'as':_0x8ff1('0x105'),'required':![]},{'model':db['User'],'as':_0x8ff1('0x106'),'attributes':['name','fullname',_0x8ff1('0x107')],'required':![]},{'model':db[_0x8ff1('0x108')],'as':'Tags','attributes':['id','name','color'],'where':_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x109')]?{'id':_0x54e4ae[_0x8ff1('0x47')]['tag']}:undefined,'required':_0x54e4ae[_0x8ff1('0x47')][_0x8ff1('0x109')]?!![]:![]}];}return db[_0x8ff1('0xc1')]['findAll'](_0x1f2fa8);})[_0x8ff1('0x38')](function(_0x3e96f5){_0x58f4b9[_0x8ff1('0x6e')]=_0x3e96f5;return _0x58f4b9;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x3ac2e0,_0x1f2fa8))[_0x8ff1('0x2a')](handleError(_0x3ac2e0,null));};function iftimePromise(_0x2eab59,_0x67e25b){return respondWithRpcPromise(_0x8ff1('0x10a'),_0x8ff1('0x10b'),{'command':_0x67e25b['timezone']?util[_0x8ff1('0xb9')](_0x8ff1('0x10c'),_0x2eab59[_0x8ff1('0x10d')],_0x67e25b['timezone']):util[_0x8ff1('0xb9')]('iftime\x20%s',_0x2eab59[_0x8ff1('0x10d')])},client9002)['then'](function(_0x373af5){var _0x583baf=_0x373af5&&_0x373af5[_0x8ff1('0x10e')](_0x8ff1('0x10f'))>=0x0?!![]:![];logger[_0x8ff1('0x22')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x67e25b['id'],_0x2eab59['id'],_0x2eab59['interval'],_0x583baf?_0x8ff1('0x110'):_0x8ff1('0x111'),_0x67e25b[_0x8ff1('0x112')]?_0x67e25b[_0x8ff1('0x112')]:_0x8ff1('0x113'));return _0x583baf;})[_0x8ff1('0x2a')](function(_0x23ec1d){logger['error'](_0x8ff1('0x114'),_0x67e25b['id'],_0x2eab59['id'],_0x2eab59[_0x8ff1('0x10d')],util[_0x8ff1('0x115')](_0x23ec1d,{'showHidden':![],'depth':null}),_0x67e25b[_0x8ff1('0x112')]?_0x67e25b[_0x8ff1('0x112')]:_0x8ff1('0x113'));return![];});}exports['getSnippet']=function(_0x255ad5,_0x119a5b,_0x86d5c5){var _0x99957d=0x0;var _0x3ff845=0x0;var _0x1eafaa=![];var _0xafbecc;var _0x20b0ea;return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x255ad5[_0x8ff1('0x59')]['id']},'include':[{'model':db[_0x8ff1('0x116')],'as':_0x8ff1('0x116'),'include':[{'model':db[_0x8ff1('0x116')],'as':_0x8ff1('0x117'),'attributes':['id',_0x8ff1('0x10d')],'raw':!![]}]}]})[_0x8ff1('0x38')](handleEntityNotFound(_0x119a5b,null))[_0x8ff1('0x38')](function(_0x458e7e){if(_0x458e7e){_0xafbecc=_0x458e7e;return _0x458e7e[_0x8ff1('0x118')]({'raw':!![]});}})['then'](function(_0x4ef77c){if(_0xafbecc){if(_0x4ef77c){_0x20b0ea=_0x4ef77c;}}return require(_0x8ff1('0x80'))[_0x8ff1('0x81')]();})['then'](function(_0x19f92e){if(_0x19f92e){_0x3ff845=_0x19f92e[_0x8ff1('0x119')];_0x1eafaa=_0x19f92e[_0x8ff1('0x82')];}})[_0x8ff1('0x38')](function(){return db[_0x8ff1('0xc1')][_0x8ff1('0x31')]({'where':{'closed':![]}});})[_0x8ff1('0x38')](function(_0x347e19){_0x99957d=_0x347e19;if(_0x3ff845&&_0x347e19>_0x3ff845){return db[_0x8ff1('0x11a')]['findOne']({'where':{'id':0x1}})[_0x8ff1('0x38')](function(_0x4e0c88){if(_0x4e0c88){_0x4e0c88[_0x8ff1('0x11b')]('chatLicenseExceeded');}});}})[_0x8ff1('0x38')](function(){if(_0xafbecc[_0x8ff1('0x116')]&&_0xafbecc[_0x8ff1('0x116')][_0x8ff1('0x117')]){var _0x398f29=[];for(var _0x1effb3=0x0;_0x1effb3<_0xafbecc[_0x8ff1('0x116')][_0x8ff1('0x117')][_0x8ff1('0x4d')];_0x1effb3++){var _0x10fd2d=_0xafbecc[_0x8ff1('0x116')]['Intervals'][_0x1effb3][_0x8ff1('0x3a')]({'plain':!![]});_0x398f29[_0x8ff1('0x11c')](iftimePromise(_0x10fd2d,_0xafbecc));}return BPromise['all'](_0x398f29)['then'](function(_0x3b57bf){return _[_0x8ff1('0x11d')](_0x3b57bf);});}else{return!![];}})[_0x8ff1('0x38')](function(_0x49c8c0){var _0x40f21f=fs[_0x8ff1('0x11e')](path[_0x8ff1('0x7e')](config[_0x8ff1('0x7f')],_0x8ff1('0x11f')),_0x8ff1('0xdf'));var _0x264388={'remote':_0xafbecc[_0x8ff1('0x120')],'query':querystring[_0x8ff1('0x27')](_[_0x8ff1('0x53')](_0xafbecc['get']({'plain':!![]}),{'customerIp':_0x255ad5['headers'][_0x8ff1('0xb1')]||_0x255ad5['headers'][_0x8ff1('0x121')]||_0x255ad5[_0x8ff1('0x122')][_0x8ff1('0x123')]||_0x255ad5['ip'],'referer':_0x255ad5[_0x8ff1('0xb0')][_0x8ff1('0xb7')],'openedInteractions':_0x99957d,'maxInteractions':_0x3ff845,'virtual':_0x1eafaa[_0x8ff1('0x119')],'online':_0x49c8c0,'custom':_0x1eafaa}))[_0x8ff1('0x124')](/'/g,'\x5c\x27')};_0x119a5b[_0x8ff1('0x40')](ejs['render'](Mustache[_0x8ff1('0x125')](_0x40f21f,_0x264388),{'proactiveActions':_0x20b0ea,'alignment':_0xafbecc[_0x8ff1('0x126')],'verticalAlignment':_0xafbecc[_0x8ff1('0x127')],'div_color':_0xafbecc[_0x8ff1('0x128')],'text_color':_0xafbecc['textColor'],'button_color':_0xafbecc[_0x8ff1('0x129')],'background_color':_0xafbecc[_0x8ff1('0x12a')]}));})[_0x8ff1('0x2a')](handleError(_0x119a5b,null));};exports[_0x8ff1('0x12b')]=function(_0x45fb24,_0x14c7d2,_0x3fbf61){return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x45fb24[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x14c7d2,null))[_0x8ff1('0x38')](function(_0x2f04ea){if(_0x2f04ea){return db[_0x8ff1('0xe9')][_0x8ff1('0xea')](function(_0x2d556d){return db[_0x8ff1('0xa5')]['destroy']({'where':{'ChatWebsiteId':_0x45fb24['params']['id']},'transaction':_0x2d556d})[_0x8ff1('0x38')](function(_0x1f046f){var _0x183d53=_[_0x8ff1('0x6d')](_0x45fb24[_0x8ff1('0x5e')],function(_0x369a9c){_0x369a9c[_0x8ff1('0x68')]=_0x45fb24[_0x8ff1('0x59')]['id'];return _0x369a9c;});return db[_0x8ff1('0xa5')]['bulkCreate'](_0x183d53,{'transaction':_0x2d556d});});})[_0x8ff1('0x38')](function(){return db['ChatApplication'][_0x8ff1('0x12c')]({'where':{'ChatWebsiteId':_0x45fb24[_0x8ff1('0x59')]['id']},'order':_0x8ff1('0xaa')});});}})['then'](respondWithResult(_0x14c7d2,null))[_0x8ff1('0x2a')](handleError(_0x14c7d2,null));};exports['getApplications']=function(_0xf62361,_0x1763e4,_0xde3af0){var _0x509da4={};var _0x1244f6={};var _0x3d5740;var _0x294417;return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0xf62361['params']['id']}})['then'](handleEntityNotFound(_0x1763e4,null))[_0x8ff1('0x38')](function(_0x28624c){if(_0x28624c){_0x3d5740=_0x28624c;_0x1244f6[_0x8ff1('0x4b')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x1244f6[_0x8ff1('0x47')]=_['keys'](_0xf62361[_0x8ff1('0x47')]);_0x1244f6[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x1244f6[_0x8ff1('0x4b')],_0x1244f6['query']);_0x509da4['attributes']=_[_0x8ff1('0x49')](_0x1244f6['model'],qs['fields'](_0xf62361[_0x8ff1('0x47')]['fields']));_0x509da4[_0x8ff1('0x4a')]=_0x509da4['attributes'][_0x8ff1('0x4d')]?_0x509da4['attributes']:_0x1244f6[_0x8ff1('0x4b')];_0x509da4['order']=qs['sort'](_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x509da4[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_['pick'](_0xf62361[_0x8ff1('0x47')],_0x1244f6[_0x8ff1('0x48')]));if(_0xf62361['query'][_0x8ff1('0x52')]){_0x509da4[_0x8ff1('0x50')]=_['merge'](_0x509da4['where'],{'$or':_[_0x8ff1('0x6d')](_0x509da4[_0x8ff1('0x4a')],function(_0x5476b4){var _0x3f88ed={};_0x3f88ed[_0x5476b4]={'$like':'%'+_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x3f88ed;})});}_0x509da4=_[_0x8ff1('0x53')]({},_0x509da4,_0xf62361[_0x8ff1('0x54')]);return _0x3d5740[_0x8ff1('0x12d')](_0x509da4);}})['then'](function(_0x52a32b){if(_0x52a32b){_0x294417=_0x52a32b[_0x8ff1('0x4d')];if(!_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x509da4['limit']=qs[_0x8ff1('0x30')](_0xf62361[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x509da4[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0xf62361['query'][_0x8ff1('0x2e')]);}return _0x3d5740[_0x8ff1('0x12d')](_0x509da4);}})[_0x8ff1('0x38')](function(_0x185c40){if(_0x185c40){return _0x185c40?{'count':_0x294417,'rows':_0x185c40}:null;}})[_0x8ff1('0x38')](respondWithResult(_0x1763e4,null))['catch'](handleError(_0x1763e4,null));};exports[_0x8ff1('0x12e')]=function(_0x55e3df,_0x1c49fa,_0x3a041b){return db[_0x8ff1('0x12f')][_0x8ff1('0x5c')]({'where':{'id':_0x55e3df['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x1c49fa,null))[_0x8ff1('0x38')](function(_0x3817d4){if(_0x3817d4){return _0x3817d4['addProactiveActions'](_0x55e3df[_0x8ff1('0x5e')][_0x8ff1('0x70')],_[_0x8ff1('0x103')](_0x55e3df['body'],[_0x8ff1('0x70'),'id'])||{});}})[_0x8ff1('0x38')](respondWithResult(_0x1c49fa,null))[_0x8ff1('0x2a')](handleError(_0x1c49fa,null));};exports[_0x8ff1('0x118')]=function(_0x4f86f3,_0x5a7e74,_0x38c701){var _0xe8e466={};var _0x1a70d7={};var _0x43a6ab;var _0x3a89bf;return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x4f86f3[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x5a7e74,null))[_0x8ff1('0x38')](function(_0x5d77b7){if(_0x5d77b7){_0x43a6ab=_0x5d77b7;_0x1a70d7['model']=_[_0x8ff1('0x46')](db[_0x8ff1('0x130')]['rawAttributes']);_0x1a70d7[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x4f86f3[_0x8ff1('0x47')]);_0x1a70d7[_0x8ff1('0x48')]=_['intersection'](_0x1a70d7['model'],_0x1a70d7['query']);_0xe8e466['attributes']=_[_0x8ff1('0x49')](_0x1a70d7[_0x8ff1('0x4b')],qs['fields'](_0x4f86f3['query'][_0x8ff1('0x4c')]));_0xe8e466[_0x8ff1('0x4a')]=_0xe8e466[_0x8ff1('0x4a')]['length']?_0xe8e466[_0x8ff1('0x4a')]:_0x1a70d7[_0x8ff1('0x4b')];_0xe8e466[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x4f86f3[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0xe8e466[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x4f86f3[_0x8ff1('0x47')],_0x1a70d7[_0x8ff1('0x48')]));if(_0x4f86f3[_0x8ff1('0x47')][_0x8ff1('0x52')]){_0xe8e466[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0xe8e466[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0xe8e466['attributes'],function(_0x580040){var _0x29c43a={};_0x29c43a[_0x580040]={'$like':'%'+_0x4f86f3[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x29c43a;})});}_0xe8e466=_[_0x8ff1('0x53')]({},_0xe8e466,_0x4f86f3[_0x8ff1('0x54')]);return _0x43a6ab[_0x8ff1('0x118')](_0xe8e466);}})[_0x8ff1('0x38')](function(_0x15f296){if(_0x15f296){_0x3a89bf=_0x15f296[_0x8ff1('0x4d')];if(!_0x4f86f3['query'][_0x8ff1('0x6c')]('nolimit')){_0xe8e466['limit']=qs[_0x8ff1('0x30')](_0x4f86f3['query'][_0x8ff1('0x30')]);_0xe8e466[_0x8ff1('0x2e')]=qs[_0x8ff1('0x2e')](_0x4f86f3['query']['offset']);}return _0x43a6ab[_0x8ff1('0x118')](_0xe8e466);}})[_0x8ff1('0x38')](function(_0x389662){if(_0x389662){return _0x389662?{'count':_0x3a89bf,'rows':_0x389662}:null;}})[_0x8ff1('0x38')](respondWithResult(_0x5a7e74,null))[_0x8ff1('0x2a')](handleError(_0x5a7e74,null));};exports[_0x8ff1('0x131')]=function(_0x5ed2d4,_0x23898e,_0x1dc40f){var _0x2d54bd=_0x5ed2d4[_0x8ff1('0x47')][_0x8ff1('0x132')]==='false'?'offlineForm':_0x8ff1('0x133');return db['ChatWebsite'][_0x8ff1('0x5c')]({'attributes':['id',_0x2d54bd],'where':{'id':_0x5ed2d4['params']['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x23898e,null))[_0x8ff1('0x38')](function(_0x4bc79a){if(_0x4bc79a){var _0x199df5=_0x4bc79a[_0x2d54bd];var _0x344780=_0x199df5&&_0x199df5[_0x8ff1('0x134')]?_0x199df5['items']:[];_0x23898e['send']({'fromKey':_[_0x8ff1('0x89')](_0x199df5[_0x8ff1('0x135')])?undefined:_0x199df5[_0x8ff1('0x135')],'count':_0x344780['length'],'rows':_0x344780});}})[_0x8ff1('0x2a')](handleError(_0x23898e,null));};exports[_0x8ff1('0x136')]=function(_0x21e7fa,_0x20f9a1,_0x2fdafc){var _0x1ecd24={'raw':![],'where':{}};var _0x4b9faa={};var _0xb90503={'count':0x0,'rows':[]};return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x21e7fa[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x20f9a1,null))[_0x8ff1('0x38')](function(_0x544c2b){if(_0x544c2b){_0x4b9faa[_0x8ff1('0x4b')]=_['keys'](db[_0x8ff1('0xe1')][_0x8ff1('0x43')]);_0x4b9faa['query']=_[_0x8ff1('0x46')](_0x21e7fa[_0x8ff1('0x47')]);_0x4b9faa[_0x8ff1('0x48')]=_['intersection'](_0x4b9faa[_0x8ff1('0x4b')],_0x4b9faa[_0x8ff1('0x47')]);_0x1ecd24[_0x8ff1('0x4a')]=_['intersection'](_0x4b9faa[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x4c')]));_0x1ecd24['attributes']=_0x1ecd24[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x1ecd24[_0x8ff1('0x4a')]:_0x4b9faa[_0x8ff1('0x4b')];if(!_0x21e7fa[_0x8ff1('0x47')]['hasOwnProperty'](_0x8ff1('0x4e'))){_0x1ecd24[_0x8ff1('0x30')]=qs['limit'](_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x1ecd24['offset']=qs['offset'](_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}_0x1ecd24[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x21e7fa[_0x8ff1('0x47')]['sort']);_0x1ecd24['where']=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x21e7fa[_0x8ff1('0x47')],_0x4b9faa[_0x8ff1('0x48')]));_0x1ecd24[_0x8ff1('0x50')][_0x8ff1('0x68')]=_0x544c2b['id'];if(_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x52')]){_0x1ecd24[_0x8ff1('0x50')]=_['merge'](_0x1ecd24[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x1ecd24['attributes'],function(_0x67cf4){var _0x1b0506={};_0x1b0506[_0x67cf4]={'$like':'%'+_0x21e7fa[_0x8ff1('0x47')][_0x8ff1('0x52')]+'%'};return _0x1b0506;})});}_0x1ecd24=_[_0x8ff1('0x53')]({},_0x1ecd24,_0x21e7fa[_0x8ff1('0x54')]);return db[_0x8ff1('0xe1')][_0x8ff1('0x31')]({'where':_0x1ecd24[_0x8ff1('0x50')]})['then'](function(_0x344ab5){_0xb90503['count']=_0x344ab5;if(_0x21e7fa[_0x8ff1('0x47')]['includeAll']){_0x1ecd24[_0x8ff1('0x56')]=[{'all':!![]}];}else{_0x1ecd24[_0x8ff1('0x56')]=[{'model':db[_0x8ff1('0xa2')],'as':'Contact','required':![]},{'model':db[_0x8ff1('0xeb')],'as':_0x8ff1('0x137'),'required':![]}];}return db['ChatOfflineMessage'][_0x8ff1('0x57')](_0x1ecd24);})['then'](function(_0xab1599){_0xb90503[_0x8ff1('0x6e')]=_0xab1599;return _0xb90503;});}})[_0x8ff1('0x38')](respondWithFilteredResult(_0x20f9a1,_0x1ecd24))['catch'](handleError(_0x20f9a1,null));};exports[_0x8ff1('0x138')]=function(_0x1850b5,_0x541482,_0x2da95c){return db[_0x8ff1('0x42')][_0x8ff1('0x5c')]({'where':{'id':_0x1850b5[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x541482,null))[_0x8ff1('0x38')](function(_0x563993){if(_0x563993){return _0x563993['addAgents'](_0x1850b5['body'][_0x8ff1('0x70')],_['omit'](_0x1850b5[_0x8ff1('0x5e')],[_0x8ff1('0x70'),'id'])||{})[_0x8ff1('0xdd')](function(_0x476103){for(var _0x51c2fe=0x0;_0x51c2fe<_0x1850b5['body'][_0x8ff1('0x70')][_0x8ff1('0x4d')];_0x51c2fe+=0x1){socket[_0x8ff1('0x139')](_0x8ff1('0x13a'),{'UserId':Number(_0x1850b5[_0x8ff1('0x5e')][_0x8ff1('0x70')][_0x51c2fe]),'ChatWebsiteId':Number(_0x1850b5[_0x8ff1('0x59')]['id'])});}return _0x476103;});}})[_0x8ff1('0x38')](respondWithResult(_0x541482,null))[_0x8ff1('0x2a')](handleError(_0x541482,null));};exports[_0x8ff1('0x13b')]=function(_0x45f71d,_0x36fd65,_0x28d201){return db['ChatWebsite'][_0x8ff1('0x5c')]({'where':{'id':_0x45f71d[_0x8ff1('0x59')]['id']}})[_0x8ff1('0x38')](handleEntityNotFound(_0x36fd65,null))['then'](function(_0x3feea5){if(_0x3feea5){return _0x3feea5[_0x8ff1('0x13b')](_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')])[_0x8ff1('0x38')](function(){if(_[_0x8ff1('0x13c')](_0x45f71d['query']['ids'])){for(var _0x37b4fd=0x0;_0x37b4fd<_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')][_0x8ff1('0x4d')];_0x37b4fd+=0x1){socket['emit'](_0x8ff1('0x13d'),{'UserId':Number(_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')][_0x37b4fd]),'ChatWebsiteId':Number(_0x45f71d[_0x8ff1('0x59')]['id'])});}}else{socket[_0x8ff1('0x139')](_0x8ff1('0x13d'),{'UserId':Number(_0x45f71d[_0x8ff1('0x47')][_0x8ff1('0x70')]),'ChatWebsiteId':Number(_0x45f71d[_0x8ff1('0x59')]['id'])});}});}})[_0x8ff1('0x38')](respondWithStatusCode(_0x36fd65,null))[_0x8ff1('0x2a')](handleError(_0x36fd65,null));};exports[_0x8ff1('0x13e')]=function(_0x4afab8,_0x5b57ac,_0x517e1a){var _0x123e78={};var _0x1b6984={};var _0x1cd235;var _0x7b5461;return db[_0x8ff1('0x42')][_0x8ff1('0x6a')]({'where':{'id':_0x4afab8['params']['id']}})['then'](handleEntityNotFound(_0x5b57ac,null))['then'](function(_0x257d31){if(_0x257d31){_0x1cd235=_0x257d31;_0x1b6984['model']=_['keys'](db[_0x8ff1('0xcd')]['rawAttributes']);_0x1b6984[_0x8ff1('0x47')]=_[_0x8ff1('0x46')](_0x4afab8[_0x8ff1('0x47')]);_0x1b6984[_0x8ff1('0x48')]=_[_0x8ff1('0x49')](_0x1b6984[_0x8ff1('0x4b')],_0x1b6984[_0x8ff1('0x47')]);_0x123e78[_0x8ff1('0x4a')]=_[_0x8ff1('0x49')](_0x1b6984[_0x8ff1('0x4b')],qs[_0x8ff1('0x4c')](_0x4afab8['query'][_0x8ff1('0x4c')]));_0x123e78[_0x8ff1('0x4a')]=_0x123e78[_0x8ff1('0x4a')][_0x8ff1('0x4d')]?_0x123e78['attributes']:_0x1b6984[_0x8ff1('0x4b')];_0x123e78[_0x8ff1('0x73')]=qs[_0x8ff1('0x4f')](_0x4afab8[_0x8ff1('0x47')][_0x8ff1('0x4f')]);_0x123e78[_0x8ff1('0x50')]=qs[_0x8ff1('0x48')](_[_0x8ff1('0x51')](_0x4afab8[_0x8ff1('0x47')],_0x1b6984[_0x8ff1('0x48')]));if(_0x4afab8[_0x8ff1('0x47')]['filter']){_0x123e78[_0x8ff1('0x50')]=_[_0x8ff1('0x53')](_0x123e78[_0x8ff1('0x50')],{'$or':_[_0x8ff1('0x6d')](_0x123e78[_0x8ff1('0x4a')],function(_0x546669){var _0x6e8665={};_0x6e8665[_0x546669]={'$like':'%'+_0x4afab8['query'][_0x8ff1('0x52')]+'%'};return _0x6e8665;})});}_0x123e78=_[_0x8ff1('0x53')]({},_0x123e78,_0x4afab8[_0x8ff1('0x54')]);return _0x1cd235[_0x8ff1('0x13e')](_0x123e78);}})[_0x8ff1('0x38')](function(_0x14ccb2){if(_0x14ccb2){_0x7b5461=_0x14ccb2[_0x8ff1('0x4d')];if(!_0x4afab8['query'][_0x8ff1('0x6c')](_0x8ff1('0x4e'))){_0x123e78[_0x8ff1('0x30')]=qs['limit'](_0x4afab8[_0x8ff1('0x47')][_0x8ff1('0x30')]);_0x123e78['offset']=qs[_0x8ff1('0x2e')](_0x4afab8[_0x8ff1('0x47')][_0x8ff1('0x2e')]);}return _0x1cd235[_0x8ff1('0x13e')](_0x123e78);}})[_0x8ff1('0x38')](function(_0x565d28){if(_0x565d28){return _0x565d28?{'count':_0x7b5461,'rows':_0x565d28}:null;}})[_0x8ff1('0x38')](respondWithResult(_0x5b57ac,null))['catch'](handleError(_0x5b57ac,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 6e9fda8..2a2e3b8 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 _0x72a2=['exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','hasOwnProperty','hook'];(function(_0x3f7dfb,_0x547826){var _0x1ab1a9=function(_0x1f2a31){while(--_0x1f2a31){_0x3f7dfb['push'](_0x3f7dfb['shift']());}};_0x1ab1a9(++_0x547826);}(_0x72a2,0x161));var _0x272a=function(_0x257920,_0x297c60){_0x257920=_0x257920-0x0;var _0x5232c3=_0x72a2[_0x257920];return _0x5232c3;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x272a('0x0'))['db'][_0x272a('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x272a('0x2')](0x0);var events={'afterCreate':_0x272a('0x3'),'afterUpdate':_0x272a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x266d0d){return function(_0x52287e,_0x1d154d,_0x48aa90){ChatWebsiteEvents['emit'](_0x266d0d+':'+_0x52287e['id'],_0x52287e);ChatWebsiteEvents['emit'](_0x266d0d,_0x52287e);_0x48aa90(null);};}for(var e in events){if(events[_0x272a('0x5')](e)){var event=events[e];ChatWebsite[_0x272a('0x6')](e,emitEvent(event));}}module[_0x272a('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xa5ca=['hook','exports','events','../../mysqldb','ChatWebsite','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa5ca[_0x1e4360];return _0x31e6b4;};'use strict';var EventEmitter=require(_0xaa5c('0x0'));var ChatWebsite=require(_0xaa5c('0x1'))['db'][_0xaa5c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xaa5c('0x3'),'afterDestroy':_0xaa5c('0x4')};function emitEvent(_0x2757fe){return function(_0x12c12f,_0x1d9faf,_0x324070){ChatWebsiteEvents['emit'](_0x2757fe+':'+_0x12c12f['id'],_0x12c12f);ChatWebsiteEvents['emit'](_0x2757fe,_0x12c12f);_0x324070(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xaa5c('0x5')](e,emitEvent(event));}}module[_0xaa5c('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 7616da1..eaee626 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 _0xe356=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','ChatWebsite','lodash','util'];(function(_0x460275,_0x493b00){var _0x59aeae=function(_0x18bcf3){while(--_0x18bcf3){_0x460275['push'](_0x460275['shift']());}};_0x59aeae(++_0x493b00);}(_0xe356,0x16f));var _0x6e35=function(_0x1dded6,_0x511be0){_0x1dded6=_0x1dded6-0x0;var _0x172bfa=_0xe356[_0x1dded6];return _0x172bfa;};'use strict';var _=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var logger=require(_0x6e35('0x2'))('api');var moment=require(_0x6e35('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e35('0x4'));var fs=require('fs');var path=require(_0x6e35('0x5'));var rimraf=require(_0x6e35('0x6'));var config=require(_0x6e35('0x7'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x585faf,_0x490073){return _0x585faf['define'](_0x6e35('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ede=['bluebird','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3ede,0x164));var _0xe3ed=function(_0x1085db,_0x41e087){_0x1085db=_0x1085db-0x0;var _0x392a60=_0x3ede[_0x1085db];return _0x392a60;};'use strict';var _=require(_0xe3ed('0x0'));var util=require(_0xe3ed('0x1'));var logger=require(_0xe3ed('0x2'))(_0xe3ed('0x3'));var moment=require('moment');var BPromise=require(_0xe3ed('0x4'));var rp=require(_0xe3ed('0x5'));var fs=require('fs');var path=require(_0xe3ed('0x6'));var rimraf=require(_0xe3ed('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3ed('0x8'));module[_0xe3ed('0x9')]=function(_0x556615,_0x2302f4){return _0x556615[_0xe3ed('0xa')]('ChatWebsite',attributes,{'tableName':_0xe3ed('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 4fd988f..c6bf0ec 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 _0x4904=['redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x50d5ae,_0x22a349){var _0x1e8d74=function(_0xd256a9){while(--_0xd256a9){_0x50d5ae['push'](_0x50d5ae['shift']());}};_0x1e8d74(++_0x22a349);}(_0x4904,0x1be));var _0x4490=function(_0x29b2f9,_0x436d8d){_0x29b2f9=_0x29b2f9-0x0;var _0x72bd86=_0x4904[_0x29b2f9];return _0x72bd86;};'use strict';var _=require('lodash');var util=require(_0x4490('0x0'));var moment=require('moment');var BPromise=require(_0x4490('0x1'));var rs=require(_0x4490('0x2'));var fs=require('fs');var Redis=require(_0x4490('0x3'));var db=require(_0x4490('0x4'))['db'];var utils=require(_0x4490('0x5'));var logger=require(_0x4490('0x6'))('rpc');var config=require(_0x4490('0x7'));var jayson=require(_0x4490('0x8'));var client=jayson['client'][_0x4490('0x9')]({'port':0x232a});config[_0x4490('0xa')]=_[_0x4490('0xb')](config[_0x4490('0xa')],{'host':_0x4490('0xc'),'port':0x18eb});var socket=require(_0x4490('0xd'))(new Redis(config[_0x4490('0xa')]));require(_0x4490('0xe'))['register'](socket);function respondWithRpcPromise(_0x85b65,_0x28c92d,_0x278f94){return new BPromise(function(_0x338f67,_0x10d07f){return client['request'](_0x85b65,_0x278f94)['then'](function(_0x3abb02){logger['info'](_0x4490('0xf'),_0x28c92d,'request\x20sent');logger[_0x4490('0x10')](_0x4490('0x11'),_0x28c92d,'request\x20sent',JSON[_0x4490('0x12')](_0x3abb02));if(_0x3abb02[_0x4490('0x13')]){if(_0x3abb02[_0x4490('0x13')]['code']===0x1f4){logger[_0x4490('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x28c92d,_0x3abb02['error'][_0x4490('0x14')]);return _0x10d07f(_0x3abb02['error'][_0x4490('0x14')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x28c92d,_0x3abb02['error'][_0x4490('0x14')]);return _0x338f67(_0x3abb02['error'][_0x4490('0x14')]);}else{logger[_0x4490('0x15')](_0x4490('0xf'),_0x28c92d,_0x4490('0x16'));_0x338f67(_0x3abb02['result'][_0x4490('0x14')]);}})[_0x4490('0x17')](function(_0xd48c7b){logger[_0x4490('0x13')](_0x4490('0xf'),_0x28c92d,_0xd48c7b);_0x10d07f(_0xd48c7b);});});} \ No newline at end of file +var _0x25f5=['socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x39abaa,_0x23f8a8){var _0x4b02bd=function(_0x2e2816){while(--_0x2e2816){_0x39abaa['push'](_0x39abaa['shift']());}};_0x4b02bd(++_0x23f8a8);}(_0x25f5,0x1ee));var _0x525f=function(_0x267096,_0x549583){_0x267096=_0x267096-0x0;var _0x4c4847=_0x25f5[_0x267096];return _0x4c4847;};'use strict';var _=require(_0x525f('0x0'));var util=require(_0x525f('0x1'));var moment=require(_0x525f('0x2'));var BPromise=require(_0x525f('0x3'));var rs=require(_0x525f('0x4'));var fs=require('fs');var Redis=require(_0x525f('0x5'));var db=require(_0x525f('0x6'))['db'];var utils=require(_0x525f('0x7'));var logger=require(_0x525f('0x8'))(_0x525f('0x9'));var config=require(_0x525f('0xa'));var jayson=require(_0x525f('0xb'));var client=jayson['client'][_0x525f('0xc')]({'port':0x232a});config[_0x525f('0xd')]=_[_0x525f('0xe')](config[_0x525f('0xd')],{'host':_0x525f('0xf'),'port':0x18eb});var socket=require(_0x525f('0x10'))(new Redis(config['redis']));require(_0x525f('0x11'))[_0x525f('0x12')](socket);function respondWithRpcPromise(_0x50c405,_0x47e084,_0x542c91){return new BPromise(function(_0x437f2f,_0x79119d){return client['request'](_0x50c405,_0x542c91)[_0x525f('0x13')](function(_0x3febc5){logger[_0x525f('0x14')](_0x525f('0x15'),_0x47e084,_0x525f('0x16'));logger['debug'](_0x525f('0x17'),_0x47e084,'request\x20sent',JSON[_0x525f('0x18')](_0x3febc5));if(_0x3febc5['error']){if(_0x3febc5[_0x525f('0x19')][_0x525f('0x1a')]===0x1f4){logger[_0x525f('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x47e084,_0x3febc5[_0x525f('0x19')]['message']);return _0x79119d(_0x3febc5[_0x525f('0x19')][_0x525f('0x1b')]);}logger[_0x525f('0x19')](_0x525f('0x15'),_0x47e084,_0x3febc5[_0x525f('0x19')][_0x525f('0x1b')]);return _0x437f2f(_0x3febc5[_0x525f('0x19')]['message']);}else{logger[_0x525f('0x14')](_0x525f('0x15'),_0x47e084,_0x525f('0x16'));_0x437f2f(_0x3febc5[_0x525f('0x1c')][_0x525f('0x1b')]);}})[_0x525f('0x1d')](function(_0x382dd4){logger[_0x525f('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x47e084,_0x382dd4);_0x79119d(_0x382dd4);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index dcb4e0f..68e0b24 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 _0x42de=['save','remove','update','removeListener','register','length','chatWebsite:'];(function(_0x51b698,_0x2fd161){var _0xfa0590=function(_0x3741ce){while(--_0x3741ce){_0x51b698['push'](_0x51b698['shift']());}};_0xfa0590(++_0x2fd161);}(_0x42de,0x134));var _0xe42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42de[_0x14add3];return _0x4a174f;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xe42d('0x0'),_0xe42d('0x1'),_0xe42d('0x2')];function createListener(_0x537566,_0x2a680a){return function(_0x43c0a4){_0x2a680a['emit'](_0x537566,_0x43c0a4);};}function removeListener(_0x5efdfb,_0x505232){return function(){ChatWebsiteEvents[_0xe42d('0x3')](_0x5efdfb,_0x505232);};}exports[_0xe42d('0x4')]=function(_0x39aeae){for(var _0x160e60=0x0,_0x3f82a3=events[_0xe42d('0x5')];_0x160e60<_0x3f82a3;_0x160e60++){var _0x4ce18b=events[_0x160e60];var _0x50e3ed=createListener(_0xe42d('0x6')+_0x4ce18b,_0x39aeae);ChatWebsiteEvents['on'](_0x4ce18b,_0x50e3ed);}}; \ No newline at end of file +var _0xd29f=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','register'];(function(_0x584d89,_0x108c0e){var _0x46ce5a=function(_0x50c3c6){while(--_0x50c3c6){_0x584d89['push'](_0x584d89['shift']());}};_0x46ce5a(++_0x108c0e);}(_0xd29f,0xf2));var _0xfd29=function(_0x5e6fe1,_0x8f80ad){_0x5e6fe1=_0x5e6fe1-0x0;var _0x5a6018=_0xd29f[_0x5e6fe1];return _0x5a6018;};'use strict';var ChatWebsiteEvents=require(_0xfd29('0x0'));var events=[_0xfd29('0x1'),_0xfd29('0x2'),_0xfd29('0x3')];function createListener(_0x1e56ac,_0x3265c3){return function(_0x581ce4){_0x3265c3[_0xfd29('0x4')](_0x1e56ac,_0x581ce4);};}function removeListener(_0x518afd,_0x554bea){return function(){ChatWebsiteEvents['removeListener'](_0x518afd,_0x554bea);};}exports[_0xfd29('0x5')]=function(_0x1650db){for(var _0x318754=0x0,_0x5c5c02=events[_0xfd29('0x6')];_0x318754<_0x5c5c02;_0x318754++){var _0x2c9234=events[_0x318754];var _0x2041ce=createListener(_0xfd29('0x7')+_0x2c9234,_0x1650db);ChatWebsiteEvents['on'](_0x2c9234,_0x2041ce);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 9c8e023..7ad9f25 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 _0x84d8=['now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s'];(function(_0x4eeb66,_0x1d7553){var _0x4aa808=function(_0x3fbcac){while(--_0x3fbcac){_0x4eeb66['push'](_0x4eeb66['shift']());}};_0x4aa808(++_0x1d7553);}(_0x84d8,0xb5));var _0x884d=function(_0x1d0487,_0x24e562){_0x1d0487=_0x1d0487-0x0;var _0x2d3823=_0x84d8[_0x1d0487];return _0x2d3823;};'use strict';var multer=require(_0x884d('0x0'));var util=require(_0x884d('0x1'));var path=require(_0x884d('0x2'));var timeout=require(_0x884d('0x3'));var express=require(_0x884d('0x4'));var router=express[_0x884d('0x5')]();var fs_extra=require(_0x884d('0x6'));var auth=require(_0x884d('0x7'));var interaction=require(_0x884d('0x8'));var config=require(_0x884d('0x9'));var controller=require(_0x884d('0xa'));router['get']('/',auth[_0x884d('0xb')](),controller[_0x884d('0xc')]);router[_0x884d('0xd')](_0x884d('0xe'),auth[_0x884d('0xb')](),controller[_0x884d('0xf')]);router['get'](_0x884d('0x10'),auth['isAuthenticated'](),controller[_0x884d('0x11')]);router[_0x884d('0xd')](_0x884d('0x12'),auth[_0x884d('0xb')](),controller[_0x884d('0x13')]);router[_0x884d('0xd')](_0x884d('0x14'),auth[_0x884d('0xb')](),controller['getAnswers']);router['get'](_0x884d('0x15'),controller[_0x884d('0x16')]);router[_0x884d('0xd')](_0x884d('0x17'),controller[_0x884d('0x18')]);router[_0x884d('0xd')](_0x884d('0x19'),controller['getCustomerAvatar']);router[_0x884d('0xd')]('/:id/system_avatar',controller[_0x884d('0x1a')]);router[_0x884d('0xd')](_0x884d('0x1b'),auth[_0x884d('0xb')](),controller[_0x884d('0x1c')]);router[_0x884d('0xd')](_0x884d('0x1d'),controller['getSnippet']);router[_0x884d('0xd')](_0x884d('0x1e'),auth[_0x884d('0xb')](),controller['getApplications']);router[_0x884d('0xd')](_0x884d('0x1f'),auth[_0x884d('0xb')](),controller[_0x884d('0x20')]);router[_0x884d('0xd')]('/:id/fields',controller[_0x884d('0x21')]);router[_0x884d('0xd')](_0x884d('0x22'),auth[_0x884d('0xb')](),controller[_0x884d('0x23')]);router[_0x884d('0xd')](_0x884d('0x24'),auth['isAuthenticated'](),controller[_0x884d('0x25')]);router[_0x884d('0x26')]('/',auth[_0x884d('0xb')](),controller[_0x884d('0x27')]);router[_0x884d('0x26')](_0x884d('0x12'),auth[_0x884d('0xb')](),controller[_0x884d('0x28')]);router[_0x884d('0x26')]('/:id/canned_answers',auth[_0x884d('0xb')](),controller[_0x884d('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x410f24,_0x52372e,_0x3d8716){_0x3d8716(null,path[_0x884d('0x2a')](config[_0x884d('0x2b')],_0x884d('0x2c')));},'filename':function(_0x4b7e80,_0x3f92cc,_0x203f04){_0x203f04(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date[_0x884d('0x2f')](),_0x3f92cc[_0x884d('0x30')]));}})});router['post']('/:id/logo',upload[_0x884d('0x31')](_0x884d('0x32')),controller[_0x884d('0x33')]);var upload=multer({'storage':multer[_0x884d('0x34')]({'destination':function(_0x47f21f,_0x380f0e,_0x3483a2){_0x3483a2(null,path['join'](config['root'],_0x884d('0x35')));},'filename':function(_0x30c858,_0x3196e4,_0x32d23e){_0x32d23e(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date['now'](),_0x3196e4[_0x884d('0x30')]));}})});router[_0x884d('0x26')](_0x884d('0x17'),upload[_0x884d('0x31')](_0x884d('0x32')),controller['addAvatar']);var upload=multer({'storage':multer[_0x884d('0x34')]({'destination':function(_0x12dba7,_0x505123,_0x29834e){_0x29834e(null,path[_0x884d('0x2a')](config[_0x884d('0x2b')],_0x884d('0x35')));},'filename':function(_0xc196f2,_0x3aec39,_0x29cd5f){_0x29cd5f(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date[_0x884d('0x2f')](),_0x3aec39[_0x884d('0x30')]));}})});router[_0x884d('0x26')](_0x884d('0x19'),upload['single'](_0x884d('0x32')),controller[_0x884d('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28bd68,_0x44ccfd,_0x78a74){_0x78a74(null,path['join'](config[_0x884d('0x2b')],_0x884d('0x35')));},'filename':function(_0x2fc8de,_0x22eaf7,_0x4bd3fc){_0x4bd3fc(null,util[_0x884d('0x2d')](_0x884d('0x2e'),Date[_0x884d('0x2f')](),_0x22eaf7[_0x884d('0x30')]));}})});router[_0x884d('0x26')](_0x884d('0x37'),upload[_0x884d('0x31')]('file'),controller[_0x884d('0x38')]);router[_0x884d('0x26')](_0x884d('0x39'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2a5a5c,_0x7d657f,_0x91686f){const _0x467c7c=path[_0x884d('0x2a')](config[_0x884d('0x2b')],_0x884d('0x3a'),_0x884d('0x3b'),_0x884d('0x3c'));fs_extra[_0x884d('0x3d')](_0x467c7c,function(){_0x91686f(null,_0x467c7c);});},'filename':function(_0x517545,_0x14725b,_0x179c82){const _0x23529a=_0x14725b['originalname'][_0x884d('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xf74fc3=path[_0x884d('0x3f')](_0x23529a);const _0x3056a3=Date[_0x884d('0x2f')]()+'-'+_0x23529a[_0x884d('0x3e')](_0xf74fc3,'')+_0xf74fc3;_0x179c82(null,_0x3056a3);}})});router[_0x884d('0x26')](_0x884d('0x40'),offlineUploadMulter[_0x884d('0x41')](),controller['offline']);router[_0x884d('0x26')]('/:id/interactions',auth[_0x884d('0xb')](),controller[_0x884d('0x42')]);router[_0x884d('0x26')](_0x884d('0x1e'),auth[_0x884d('0xb')](),controller[_0x884d('0x43')]);router[_0x884d('0x26')](_0x884d('0x1f'),auth[_0x884d('0xb')](),controller[_0x884d('0x44')]);router[_0x884d('0x26')](_0x884d('0x24'),auth['isAuthenticated'](),controller[_0x884d('0x45')]);router['put'](_0x884d('0x10'),auth[_0x884d('0xb')](),controller[_0x884d('0x46')]);router['delete'](_0x884d('0x10'),auth[_0x884d('0xb')](),controller['destroy']);router[_0x884d('0x47')](_0x884d('0x12'),auth[_0x884d('0xb')](),controller[_0x884d('0x48')]);router['delete'](_0x884d('0x14'),auth[_0x884d('0xb')](),controller[_0x884d('0x49')]);router[_0x884d('0x47')]('/:id/users',auth['isAuthenticated'](),controller[_0x884d('0x4a')]);module[_0x884d('0x4b')]=router; \ No newline at end of file +var _0x22e3=['put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSnippet','getApplications','getProactiveActions','/:id/fields','getOfflineMessages','getAgents','post','create','addAnswer','diskStorage','join','server/files/images/logos/','%s-%s','now','single','file','root','format','originalname','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','notify','attachments','replace','extname','/:id/offline','any','offline','addInteraction','/:id/proactive_actions','/:id/users'];(function(_0x327b51,_0x4a20bd){var _0x1b6be1=function(_0x1b63db){while(--_0x1b63db){_0x327b51['push'](_0x327b51['shift']());}};_0x1b6be1(++_0x4a20bd);}(_0x22e3,0x176));var _0x322e=function(_0x1d7c0e,_0x10a688){_0x1d7c0e=_0x1d7c0e-0x0;var _0x13526b=_0x22e3[_0x1d7c0e];return _0x13526b;};'use strict';var multer=require(_0x322e('0x0'));var util=require(_0x322e('0x1'));var path=require(_0x322e('0x2'));var timeout=require(_0x322e('0x3'));var express=require('express');var router=express[_0x322e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x322e('0x5'));var controller=require('./chatWebsite.controller');router[_0x322e('0x6')]('/',auth[_0x322e('0x7')](),controller['index']);router[_0x322e('0x6')]('/describe',auth[_0x322e('0x7')](),controller['describe']);router[_0x322e('0x6')](_0x322e('0x8'),auth[_0x322e('0x7')](),controller[_0x322e('0x9')]);router[_0x322e('0x6')](_0x322e('0xa'),auth['isAuthenticated'](),controller[_0x322e('0xb')]);router[_0x322e('0x6')](_0x322e('0xc'),auth[_0x322e('0x7')](),controller[_0x322e('0xd')]);router[_0x322e('0x6')](_0x322e('0xe'),controller[_0x322e('0xf')]);router[_0x322e('0x6')](_0x322e('0x10'),controller[_0x322e('0x11')]);router[_0x322e('0x6')]('/:id/customer_avatar',controller[_0x322e('0x12')]);router[_0x322e('0x6')](_0x322e('0x13'),controller['getSystemAvatar']);router[_0x322e('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x322e('0x6')]('/:id/snippet',controller[_0x322e('0x14')]);router[_0x322e('0x6')]('/:id/applications',auth['isAuthenticated'](),controller[_0x322e('0x15')]);router['get']('/:id/proactive_actions',auth[_0x322e('0x7')](),controller[_0x322e('0x16')]);router[_0x322e('0x6')](_0x322e('0x17'),controller['getFields']);router[_0x322e('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x322e('0x18')]);router[_0x322e('0x6')]('/:id/users',auth[_0x322e('0x7')](),controller[_0x322e('0x19')]);router[_0x322e('0x1a')]('/',auth[_0x322e('0x7')](),controller[_0x322e('0x1b')]);router['post']('/:id/dispositions',auth[_0x322e('0x7')](),controller['addDisposition']);router[_0x322e('0x1a')](_0x322e('0xc'),auth[_0x322e('0x7')](),controller[_0x322e('0x1c')]);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x206e64,_0x34cfb1,_0x549c39){_0x549c39(null,path[_0x322e('0x1e')](config['root'],_0x322e('0x1f')));},'filename':function(_0x49596b,_0x3a73cb,_0x268d0a){_0x268d0a(null,util['format'](_0x322e('0x20'),Date[_0x322e('0x21')](),_0x3a73cb['originalname']));}})});router[_0x322e('0x1a')](_0x322e('0xe'),upload[_0x322e('0x22')](_0x322e('0x23')),controller['addLogo']);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x172fd7,_0x52ee7b,_0x38d565){_0x38d565(null,path[_0x322e('0x1e')](config[_0x322e('0x24')],'server/files/images/avatars/'));},'filename':function(_0xae562d,_0xaece4d,_0x2de9d9){_0x2de9d9(null,util[_0x322e('0x25')](_0x322e('0x20'),Date[_0x322e('0x21')](),_0xaece4d[_0x322e('0x26')]));}})});router[_0x322e('0x1a')](_0x322e('0x10'),upload['single'](_0x322e('0x23')),controller[_0x322e('0x27')]);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x59ee69,_0x1ac520,_0x15181c){_0x15181c(null,path[_0x322e('0x1e')](config[_0x322e('0x24')],_0x322e('0x28')));},'filename':function(_0x2d6ec9,_0x55c72d,_0x2978fb){_0x2978fb(null,util[_0x322e('0x25')](_0x322e('0x20'),Date[_0x322e('0x21')](),_0x55c72d[_0x322e('0x26')]));}})});router[_0x322e('0x1a')](_0x322e('0x29'),upload['single'](_0x322e('0x23')),controller[_0x322e('0x2a')]);var upload=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x13cdee,_0x25ca14,_0x157eba){_0x157eba(null,path['join'](config[_0x322e('0x24')],_0x322e('0x28')));},'filename':function(_0x3d0d38,_0x3494a9,_0x4c2186){_0x4c2186(null,util['format'](_0x322e('0x20'),Date[_0x322e('0x21')](),_0x3494a9[_0x322e('0x26')]));}})});router[_0x322e('0x1a')](_0x322e('0x13'),upload[_0x322e('0x22')](_0x322e('0x23')),controller['addSystemAvatar']);router[_0x322e('0x1a')]('/:id/notify',controller[_0x322e('0x2b')]);const offlineUploadMulter=multer({'storage':multer[_0x322e('0x1d')]({'destination':function(_0x463e41,_0x33ef4f,_0x522c87){const _0x1ca60f=path[_0x322e('0x1e')](config[_0x322e('0x24')],'server/files',_0x322e('0x2c'),'offline-chat');fs_extra['ensureDir'](_0x1ca60f,function(){_0x522c87(null,_0x1ca60f);});},'filename':function(_0x34e582,_0xd6bd79,_0x518dcf){const _0x67a7b1=_0xd6bd79[_0x322e('0x26')][_0x322e('0x2d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x14be34=path[_0x322e('0x2e')](_0x67a7b1);const _0x2b59a2=Date[_0x322e('0x21')]()+'-'+_0x67a7b1[_0x322e('0x2d')](_0x14be34,'')+_0x14be34;_0x518dcf(null,_0x2b59a2);}})});router[_0x322e('0x1a')](_0x322e('0x2f'),offlineUploadMulter[_0x322e('0x30')](),controller[_0x322e('0x31')]);router[_0x322e('0x1a')]('/:id/interactions',auth[_0x322e('0x7')](),controller[_0x322e('0x32')]);router[_0x322e('0x1a')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x322e('0x33'),auth[_0x322e('0x7')](),controller['addProactiveActions']);router[_0x322e('0x1a')](_0x322e('0x34'),auth[_0x322e('0x7')](),controller['addAgents']);router[_0x322e('0x35')]('/:id',auth['isAuthenticated'](),controller[_0x322e('0x36')]);router[_0x322e('0x37')](_0x322e('0x8'),auth[_0x322e('0x7')](),controller[_0x322e('0x38')]);router['delete'](_0x322e('0xa'),auth[_0x322e('0x7')](),controller[_0x322e('0x39')]);router['delete'](_0x322e('0xc'),auth[_0x322e('0x7')](),controller[_0x322e('0x3a')]);router[_0x322e('0x37')](_0x322e('0x34'),auth['isAuthenticated'](),controller[_0x322e('0x3b')]);module[_0x322e('0x3c')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index c9828f4..e9e57f2 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 _0xafca=['sequelize','STRING','ENUM'];(function(_0x18038e,_0x4960f4){var _0x40dd27=function(_0xbbde17){while(--_0xbbde17){_0x18038e['push'](_0x18038e['shift']());}};_0x40dd27(++_0x4960f4);}(_0xafca,0x1ef));var _0xaafc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xafca[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaafc('0x0'));module['exports']={'name':{'type':Sequelize[_0xaafc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xaafc('0x2')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xaafc('0x1')]},'data2':{'type':Sequelize[_0xaafc('0x1')]}}; \ No newline at end of file +var _0xc03e=['Google','STRING','sequelize','ENUM'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xc03e,0x15a));var _0xec03=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0xc03e[_0x310990];return _0x648534;};'use strict';var Sequelize=require(_0xec03('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xec03('0x1')]('AmazonAWS',_0xec03('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xec03('0x3')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9115a73..8c04bee 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x4d80a6,_0x174bd5){var _0x56b904=function(_0x50f7b8){while(--_0x50f7b8){_0x4d80a6['push'](_0x4d80a6['shift']());}};_0x56b904(++_0x174bd5);}(_0x7a54,0x106));var _0x47a5=function(_0x483318,_0x557e49){_0x483318=_0x483318-0x0;var _0x3f555c=_0x7a54[_0x483318];return _0x3f555c;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0xded016,_0x38e294){var _0x1f4436=function(_0x3737aa){while(--_0x3737aa){_0xded016['push'](_0xded016['shift']());}};_0x1f4436(++_0x38e294);}(_0x7a54,0x106));var _0x47a5=function(_0x48ca1b,_0x4a358b){_0x48ca1b=_0x48ca1b-0x0;var _0x3ffc43=_0x7a54[_0x48ca1b];return _0x3ffc43;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 75029d5..6069332 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 _0x7f1c=['CloudProvider','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x5d866c,_0x11074f){var _0x45d888=function(_0x46acba){while(--_0x46acba){_0x5d866c['push'](_0x5d866c['shift']());}};_0x45d888(++_0x11074f);}(_0x7f1c,0xa9));var _0xc7f1=function(_0x320f31,_0x433146){_0x320f31=_0x320f31-0x0;var _0x3c8b72=_0x7f1c[_0x320f31];return _0x3c8b72;};'use strict';var _=require(_0xc7f1('0x0'));var util=require(_0xc7f1('0x1'));var logger=require('../../config/logger')(_0xc7f1('0x2'));var moment=require(_0xc7f1('0x3'));var BPromise=require(_0xc7f1('0x4'));var rp=require(_0xc7f1('0x5'));var fs=require('fs');var path=require(_0xc7f1('0x6'));var rimraf=require('rimraf');var config=require(_0xc7f1('0x7'));var attributes=require(_0xc7f1('0x8'));module[_0xc7f1('0x9')]=function(_0x5458b5,_0x48067f){return _0x5458b5[_0xc7f1('0xa')](_0xc7f1('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7dc=['exports','define','CloudProvider','util','api','moment','path','rimraf','./cloudProvider.attributes'];(function(_0x5cc2b3,_0x20f412){var _0x5db54b=function(_0x2df971){while(--_0x2df971){_0x5cc2b3['push'](_0x5cc2b3['shift']());}};_0x5db54b(++_0x20f412);}(_0xb7dc,0xa5));var _0xcb7d=function(_0x114388,_0x1f6249){_0x114388=_0x114388-0x0;var _0xf63db6=_0xb7dc[_0x114388];return _0xf63db6;};'use strict';var _=require('lodash');var util=require(_0xcb7d('0x0'));var logger=require('../../config/logger')(_0xcb7d('0x1'));var moment=require(_0xcb7d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb7d('0x3'));var rimraf=require(_0xcb7d('0x4'));var config=require('../../config/environment');var attributes=require(_0xcb7d('0x5'));module[_0xcb7d('0x6')]=function(_0x26770f,_0x213880){return _0x26770f[_0xcb7d('0x7')](_0xcb7d('0x8'),attributes,{'tableName':'cloud_providers','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 dd0d951..41d428c 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 _0x3445=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CloudProvider,\x20%s,\x20%s'];(function(_0x544da1,_0x53f02b){var _0x54cd5e=function(_0x1e2dca){while(--_0x1e2dca){_0x544da1['push'](_0x544da1['shift']());}};_0x54cd5e(++_0x53f02b);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5344('0x0'));var util=require(_0x5344('0x1'));var moment=require(_0x5344('0x2'));var BPromise=require(_0x5344('0x3'));var rs=require(_0x5344('0x4'));var fs=require('fs');var Redis=require(_0x5344('0x5'));var db=require(_0x5344('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5344('0x7'));var config=require(_0x5344('0x8'));var jayson=require(_0x5344('0x9'));var client=jayson[_0x5344('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ffe5f,_0x5642cb,_0x5a4f52){return new BPromise(function(_0x3f638c,_0x4adb8a){return client['request'](_0x4ffe5f,_0x5a4f52)[_0x5344('0xb')](function(_0xbc5346){logger[_0x5344('0xc')]('CloudProvider,\x20%s,\x20%s',_0x5642cb,_0x5344('0xd'));logger[_0x5344('0xe')](_0x5344('0xf'),_0x5642cb,_0x5344('0xd'),JSON[_0x5344('0x10')](_0xbc5346));if(_0xbc5346[_0x5344('0x11')]){if(_0xbc5346['error'][_0x5344('0x12')]===0x1f4){logger[_0x5344('0x11')]('CloudProvider,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')]['message']);return _0x4adb8a(_0xbc5346[_0x5344('0x11')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x5642cb,_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);return _0x3f638c(_0xbc5346[_0x5344('0x11')][_0x5344('0x13')]);}else{logger[_0x5344('0xc')](_0x5344('0x14'),_0x5642cb,_0x5344('0xd'));_0x3f638c(_0xbc5346[_0x5344('0x15')][_0x5344('0x13')]);}})[_0x5344('0x16')](function(_0x4ae241){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5642cb,_0x4ae241);_0x4adb8a(_0x4ae241);});});} \ No newline at end of file +var _0xdc15=['../../mysqldb','../../config/environment','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x164d1d,_0xc9ea47){var _0x518c9e=function(_0xa2b377){while(--_0xa2b377){_0x164d1d['push'](_0x164d1d['shift']());}};_0x518c9e(++_0xc9ea47);}(_0xdc15,0x1f3));var _0x5dc1=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xdc15[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0x5dc1('0x0'));var util=require('util');var moment=require(_0x5dc1('0x1'));var BPromise=require(_0x5dc1('0x2'));var rs=require(_0x5dc1('0x3'));var fs=require('fs');var Redis=require(_0x5dc1('0x4'));var db=require(_0x5dc1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5dc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5dc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ec95f,_0x22d677,_0x12abf9){return new BPromise(function(_0x1c90f6,_0x3e96c1){return client[_0x5dc1('0x8')](_0x2ec95f,_0x12abf9)[_0x5dc1('0x9')](function(_0x1f1293){logger[_0x5dc1('0xa')](_0x5dc1('0xb'),_0x22d677,'request\x20sent');logger['debug'](_0x5dc1('0xc'),_0x22d677,_0x5dc1('0xd'),JSON['stringify'](_0x1f1293));if(_0x1f1293[_0x5dc1('0xe')]){if(_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0xf')]===0x1f4){logger[_0x5dc1('0xe')](_0x5dc1('0xb'),_0x22d677,_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0x10')]);return _0x3e96c1(_0x1f1293['error'][_0x5dc1('0x10')]);}logger[_0x5dc1('0xe')]('CloudProvider,\x20%s,\x20%s',_0x22d677,_0x1f1293[_0x5dc1('0xe')][_0x5dc1('0x10')]);return _0x1c90f6(_0x1f1293['error'][_0x5dc1('0x10')]);}else{logger[_0x5dc1('0xa')](_0x5dc1('0xb'),_0x22d677,'request\x20sent');_0x1c90f6(_0x1f1293[_0x5dc1('0x11')]['message']);}})['catch'](function(_0x17506b){logger[_0x5dc1('0xe')](_0x5dc1('0xb'),_0x22d677,_0x17506b);_0x3e96c1(_0x17506b);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 113b97b..0c76300 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 _0x849a=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x204596,_0x3b1427){var _0x2bc591=function(_0x3109fb){while(--_0x3109fb){_0x204596['push'](_0x204596['shift']());}};_0x2bc591(++_0x3b1427);}(_0x849a,0x1ba));var _0xa849=function(_0xe9fcc6,_0xfc7da){_0xe9fcc6=_0xe9fcc6-0x0;var _0x6ce0bc=_0x849a[_0xe9fcc6];return _0x6ce0bc;};'use strict';var multer=require(_0xa849('0x0'));var util=require(_0xa849('0x1'));var path=require(_0xa849('0x2'));var timeout=require(_0xa849('0x3'));var express=require(_0xa849('0x4'));var router=express['Router']();var fs_extra=require(_0xa849('0x5'));var auth=require(_0xa849('0x6'));var interaction=require(_0xa849('0x7'));var config=require(_0xa849('0x8'));var controller=require(_0xa849('0x9'));router[_0xa849('0xa')]('/',auth[_0xa849('0xb')](),controller[_0xa849('0xc')]);router['get'](_0xa849('0xd'),auth['isAuthenticated'](),controller[_0xa849('0xe')]);router[_0xa849('0xf')]('/',auth['isAuthenticated'](),controller[_0xa849('0x10')]);router[_0xa849('0x11')](_0xa849('0xd'),auth[_0xa849('0xb')](),controller[_0xa849('0x12')]);router[_0xa849('0x13')](_0xa849('0xd'),auth[_0xa849('0xb')](),controller[_0xa849('0x14')]);module[_0xa849('0x15')]=router; \ No newline at end of file +var _0xe9d0=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./cloudProvider.controller'];(function(_0x47a41f,_0x48d92b){var _0x2411f5=function(_0x3f5b72){while(--_0x3f5b72){_0x47a41f['push'](_0x47a41f['shift']());}};_0x2411f5(++_0x48d92b);}(_0xe9d0,0x124));var _0x0e9d=function(_0x33c8b3,_0x27dc52){_0x33c8b3=_0x33c8b3-0x0;var _0x25089b=_0xe9d0[_0x33c8b3];return _0x25089b;};'use strict';var multer=require(_0x0e9d('0x0'));var util=require(_0x0e9d('0x1'));var path=require(_0x0e9d('0x2'));var timeout=require(_0x0e9d('0x3'));var express=require('express');var router=express[_0x0e9d('0x4')]();var fs_extra=require(_0x0e9d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0e9d('0x6'));var controller=require(_0x0e9d('0x7'));router[_0x0e9d('0x8')]('/',auth[_0x0e9d('0x9')](),controller[_0x0e9d('0xa')]);router[_0x0e9d('0x8')](_0x0e9d('0xb'),auth[_0x0e9d('0x9')](),controller[_0x0e9d('0xc')]);router[_0x0e9d('0xd')]('/',auth[_0x0e9d('0x9')](),controller[_0x0e9d('0xe')]);router[_0x0e9d('0xf')](_0x0e9d('0xb'),auth[_0x0e9d('0x9')](),controller[_0x0e9d('0x10')]);router[_0x0e9d('0x11')]('/:id',auth[_0x0e9d('0x9')](),controller[_0x0e9d('0x12')]);module[_0x0e9d('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 8155b7b..1beb478 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 _0x154e=['sequelize','exports','name','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x154e,0x1f0));var _0xe154=function(_0x453807,_0x4709e4){_0x453807=_0x453807-0x0;var _0x13070a=_0x154e[_0x453807];return _0x13070a;};'use strict';var Sequelize=require(_0xe154('0x0'));module[_0xe154('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe154('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe154('0x3')]},'companyId':{'type':Sequelize[_0xe154('0x3')]},'website':{'type':Sequelize[_0xe154('0x3')]},'phone':{'type':Sequelize[_0xe154('0x3')]},'fax':{'type':Sequelize[_0xe154('0x3')]},'type':{'type':Sequelize[_0xe154('0x3')]},'street':{'type':Sequelize[_0xe154('0x3')]},'postalCode':{'type':Sequelize[_0xe154('0x3')]},'city':{'type':Sequelize[_0xe154('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe154('0x3')]},'sStreet':{'type':Sequelize[_0xe154('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xe154('0x3')]},'description':{'type':Sequelize[_0xe154('0x3')]}}; \ No newline at end of file +var _0xb162=['STRING'];(function(_0x41655c,_0x1599ca){var _0x460eae=function(_0x211c53){while(--_0x211c53){_0x41655c['push'](_0x41655c['shift']());}};_0x460eae(++_0x1599ca);}(_0xb162,0x64));var _0x2b16=function(_0x15b6f,_0x2650e2){_0x15b6f=_0x15b6f-0x0;var _0x480f8f=_0xb162[_0x15b6f];return _0x480f8f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2b16('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x2b16('0x0')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2b16('0x0')]},'type':{'type':Sequelize[_0x2b16('0x0')]},'street':{'type':Sequelize[_0x2b16('0x0')]},'postalCode':{'type':Sequelize[_0x2b16('0x0')]},'city':{'type':Sequelize[_0x2b16('0x0')]},'country':{'type':Sequelize[_0x2b16('0x0')]},'email':{'type':Sequelize[_0x2b16('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2b16('0x0')]},'sStreet':{'type':Sequelize[_0x2b16('0x0')]},'sPostalCode':{'type':Sequelize[_0x2b16('0x0')]},'sCity':{'type':Sequelize[_0x2b16('0x0')]},'sCountry':{'type':Sequelize[_0x2b16('0x0')]},'description':{'type':Sequelize[_0x2b16('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 5684ef3..5d6bff1 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 _0x8a7b=['destroy','Companies','error','stack','name','CmCompany','model','keys','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','map','merge','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','body','user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8a7b,0x120));var _0xb8a7=function(_0xa1e7d7,_0x5714bb){_0xa1e7d7=_0xa1e7d7-0x0;var _0x287bee=_0x8a7b[_0xa1e7d7];return _0x287bee;};'use strict';var emlformat=require(_0xb8a7('0x0'));var rimraf=require(_0xb8a7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8a7('0x2'));var rp=require(_0xb8a7('0x3'));var moment=require(_0xb8a7('0x4'));var BPromise=require(_0xb8a7('0x5'));var Mustache=require(_0xb8a7('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb8a7('0x7'));var csv=require(_0xb8a7('0x8'));var ejs=require(_0xb8a7('0x9'));var fs=require('fs');var fs_extra=require(_0xb8a7('0xa'));var _=require(_0xb8a7('0xb'));var squel=require(_0xb8a7('0xc'));var crypto=require(_0xb8a7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb8a7('0xe'));var authService=require(_0xb8a7('0xf'));var qs=require(_0xb8a7('0x10'));var as=require(_0xb8a7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a7('0x12'))(_0xb8a7('0x13'));var utils=require(_0xb8a7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb8a7('0x15'));var db=require(_0xb8a7('0x16'))['db'];function respondWithStatusCode(_0x2962a1,_0x15bec5){_0x15bec5=_0x15bec5||0xcc;return function(_0x1133e6){if(_0x1133e6){return _0x2962a1[_0xb8a7('0x17')](_0x15bec5);}return _0x2962a1[_0xb8a7('0x18')](_0x15bec5)[_0xb8a7('0x19')]();};}function respondWithResult(_0x228496,_0x28c4d5){_0x28c4d5=_0x28c4d5||0xc8;return function(_0x13d889){if(_0x13d889){return _0x228496[_0xb8a7('0x18')](_0x28c4d5)[_0xb8a7('0x1a')](_0x13d889);}};}function respondWithFilteredResult(_0xbf6a13,_0x4496fd){return function(_0x20e9a9){if(_0x20e9a9){var _0x2298f1=typeof _0x4496fd[_0xb8a7('0x1b')]===_0xb8a7('0x1c')&&typeof _0x4496fd[_0xb8a7('0x1d')]===_0xb8a7('0x1c');var _0x54187b=_0x20e9a9[_0xb8a7('0x1e')];var _0x8c8c41=_0x2298f1?0x0:_0x4496fd['offset'];var _0x191a46=_0x2298f1?_0x20e9a9[_0xb8a7('0x1e')]:_0x4496fd[_0xb8a7('0x1b')]+_0x4496fd[_0xb8a7('0x1d')];var _0x237855;if(_0x191a46>=_0x54187b){_0x191a46=_0x54187b;_0x237855=0xc8;}else{_0x237855=0xce;}_0xbf6a13[_0xb8a7('0x18')](_0x237855);return _0xbf6a13[_0xb8a7('0x1f')](_0xb8a7('0x20'),_0x8c8c41+'-'+_0x191a46+'/'+_0x54187b)[_0xb8a7('0x1a')](_0x20e9a9);}return null;};}function patchUpdates(_0x1ef36a){return function(_0x3d7ff8){try{jsonpatch['apply'](_0x3d7ff8,_0x1ef36a,!![]);}catch(_0x1180e2){return BPromise[_0xb8a7('0x21')](_0x1180e2);}return _0x3d7ff8[_0xb8a7('0x22')]();};}function saveUpdates(_0x1fa452,_0x14e836){return function(_0x5f287b){if(_0x5f287b){return _0x5f287b['update'](_0x1fa452)[_0xb8a7('0x23')](function(_0x1e89f2){return _0x1e89f2;});}return null;};}function removeEntity(_0x35eaa9,_0x21eac1){return function(_0x5c11f8){if(_0x5c11f8){return _0x5c11f8[_0xb8a7('0x24')]()[_0xb8a7('0x23')](function(){var _0x544039=_0x5c11f8['get']({'plain':!![]});var _0xaf91c1=_0xb8a7('0x25');return db['UserProfileResource'][_0xb8a7('0x24')]({'where':{'type':_0xaf91c1,'resourceId':_0x544039['id']}})[_0xb8a7('0x23')](function(){return _0x5c11f8;});})[_0xb8a7('0x23')](function(){_0x35eaa9[_0xb8a7('0x18')](0xcc)[_0xb8a7('0x19')]();});}};}function handleEntityNotFound(_0x1eddba,_0x707047){return function(_0x4770d4){if(!_0x4770d4){_0x1eddba[_0xb8a7('0x17')](0x194);}return _0x4770d4;};}function handleError(_0x592873,_0x28fee0){_0x28fee0=_0x28fee0||0x1f4;return function(_0x22f4c8){logger[_0xb8a7('0x26')](_0x22f4c8[_0xb8a7('0x27')]);if(_0x22f4c8[_0xb8a7('0x28')]){delete _0x22f4c8[_0xb8a7('0x28')];}_0x592873[_0xb8a7('0x18')](_0x28fee0)['send'](_0x22f4c8);};}exports['index']=function(_0xcdaf46,_0x42dfc8){var _0x531d4d={},_0xb4b87f={},_0xf76953={'count':0x0,'rows':[]};return db[_0xb8a7('0x29')]['describe']()[_0xb8a7('0x23')](function(_0x21a4af){_0xb4b87f[_0xb8a7('0x2a')]=_[_0xb8a7('0x2b')](_0x21a4af);_0xb4b87f[_0xb8a7('0x2c')]=_[_0xb8a7('0x2b')](_0xcdaf46[_0xb8a7('0x2c')]);_0xb4b87f[_0xb8a7('0x2d')]=_['intersection'](_0xb4b87f[_0xb8a7('0x2a')],_0xb4b87f[_0xb8a7('0x2c')]);_0x531d4d[_0xb8a7('0x2e')]=_[_0xb8a7('0x2f')](_0xb4b87f['model'],qs['fields'](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x30')]));_0x531d4d['attributes']=_0x531d4d[_0xb8a7('0x2e')]['length']?_0x531d4d[_0xb8a7('0x2e')]:_0xb4b87f['model'];if(!_0xcdaf46[_0xb8a7('0x2c')]['hasOwnProperty'](_0xb8a7('0x31'))){_0x531d4d[_0xb8a7('0x1d')]=qs[_0xb8a7('0x1d')](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x1d')]);_0x531d4d[_0xb8a7('0x1b')]=qs['offset'](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x1b')]);}_0x531d4d['order']=qs['sort'](_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x32')]);_0x531d4d[_0xb8a7('0x33')]=qs[_0xb8a7('0x2d')](_[_0xb8a7('0x34')](_0xcdaf46['query'],_0xb4b87f[_0xb8a7('0x2d')]),_0x21a4af);if(_0xcdaf46[_0xb8a7('0x2c')][_0xb8a7('0x35')]){_0x531d4d[_0xb8a7('0x33')]=_['merge'](_0x531d4d[_0xb8a7('0x33')],{'$or':_[_0xb8a7('0x36')](_0x531d4d[_0xb8a7('0x2e')],function(_0x8f29b7){var _0x538815={};_0x538815[_0x8f29b7]={'$like':'%'+_0xcdaf46['query'][_0xb8a7('0x35')]+'%'};return _0x538815;})});}_0x531d4d=_[_0xb8a7('0x37')]({},_0x531d4d,_0xcdaf46['options']);var _0x44b199={'where':_0x531d4d[_0xb8a7('0x33')]};return db['CmCompany'][_0xb8a7('0x1e')](_0x44b199)[_0xb8a7('0x23')](function(_0x4d5a3c){_0xf76953[_0xb8a7('0x1e')]=_0x4d5a3c;if(_0xcdaf46['query']['includeAll']){_0x531d4d[_0xb8a7('0x38')]=[{'all':!![]}];}return db[_0xb8a7('0x29')][_0xb8a7('0x39')](_0x531d4d);})[_0xb8a7('0x23')](function(_0x36356b){_0xf76953[_0xb8a7('0x3a')]=_0x36356b;return _0xf76953;})[_0xb8a7('0x23')](respondWithFilteredResult(_0x42dfc8,_0x531d4d))[_0xb8a7('0x3b')](handleError(_0x42dfc8,null));})[_0xb8a7('0x3b')](handleError(_0x42dfc8,null));};exports[_0xb8a7('0x3c')]=function(_0x81d550,_0x1e1b78){var _0x5d951c={'raw':![],'where':{'id':_0x81d550[_0xb8a7('0x3d')]['id']}},_0x456b3a={};_0x456b3a['model']=_[_0xb8a7('0x2b')](db[_0xb8a7('0x29')]['rawAttributes']);_0x456b3a[_0xb8a7('0x2c')]=_[_0xb8a7('0x2b')](_0x81d550[_0xb8a7('0x2c')]);_0x456b3a[_0xb8a7('0x2d')]=_[_0xb8a7('0x2f')](_0x456b3a[_0xb8a7('0x2a')],_0x456b3a[_0xb8a7('0x2c')]);_0x5d951c['attributes']=_[_0xb8a7('0x2f')](_0x456b3a[_0xb8a7('0x2a')],qs[_0xb8a7('0x30')](_0x81d550[_0xb8a7('0x2c')]['fields']));_0x5d951c[_0xb8a7('0x2e')]=_0x5d951c['attributes'][_0xb8a7('0x3e')]?_0x5d951c[_0xb8a7('0x2e')]:_0x456b3a[_0xb8a7('0x2a')];if(_0x81d550[_0xb8a7('0x2c')][_0xb8a7('0x3f')]){_0x5d951c[_0xb8a7('0x38')]=[{'all':!![]}];}_0x5d951c=_['merge']({},_0x5d951c,_0x81d550[_0xb8a7('0x40')]);return db[_0xb8a7('0x29')][_0xb8a7('0x41')](_0x5d951c)[_0xb8a7('0x23')](handleEntityNotFound(_0x1e1b78,null))[_0xb8a7('0x23')](respondWithResult(_0x1e1b78,null))['catch'](handleError(_0x1e1b78,null));};exports[_0xb8a7('0x42')]=function(_0x3df377,_0x1ed972){return db[_0xb8a7('0x29')]['create'](_0x3df377[_0xb8a7('0x43')],{})[_0xb8a7('0x23')](function(_0x43735){var _0x35973c=_0x3df377[_0xb8a7('0x44')]['get']({'plain':!![]});if(!_0x35973c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35973c[_0xb8a7('0x45')]===_0xb8a7('0x44')){var _0x45688f=_0x43735[_0xb8a7('0x46')]({'plain':!![]});var _0x9afa73=_0xb8a7('0x25');return db['UserProfileSection'][_0xb8a7('0x41')]({'where':{'name':_0x9afa73,'userProfileId':_0x35973c[_0xb8a7('0x47')]},'raw':!![]})[_0xb8a7('0x23')](function(_0xcf08e4){if(_0xcf08e4&&_0xcf08e4['autoAssociation']===0x0){return db['UserProfileResource'][_0xb8a7('0x42')]({'name':_0x45688f[_0xb8a7('0x28')],'resourceId':_0x45688f['id'],'type':_0xcf08e4[_0xb8a7('0x28')],'sectionId':_0xcf08e4['id']},{})[_0xb8a7('0x23')](function(){return _0x43735;});}else{return _0x43735;}})['catch'](function(_0x5d4af1){logger[_0xb8a7('0x26')](_0xb8a7('0x48'),_0x5d4af1);throw _0x5d4af1;});}return _0x43735;})[_0xb8a7('0x23')](respondWithResult(_0x1ed972,0xc9))[_0xb8a7('0x3b')](handleError(_0x1ed972,null));};exports[_0xb8a7('0x49')]=function(_0x523b66,_0x14ce0a){if(_0x523b66[_0xb8a7('0x43')]['id']){delete _0x523b66[_0xb8a7('0x43')]['id'];}return db[_0xb8a7('0x29')]['find']({'where':{'id':_0x523b66[_0xb8a7('0x3d')]['id']}})['then'](handleEntityNotFound(_0x14ce0a,null))[_0xb8a7('0x23')](saveUpdates(_0x523b66[_0xb8a7('0x43')],null))['then'](respondWithResult(_0x14ce0a,null))[_0xb8a7('0x3b')](handleError(_0x14ce0a,null));};exports['destroy']=function(_0x54f49c,_0x46f9c7){return db[_0xb8a7('0x29')]['find']({'where':{'id':_0x54f49c[_0xb8a7('0x3d')]['id']}})[_0xb8a7('0x23')](handleEntityNotFound(_0x46f9c7,null))[_0xb8a7('0x23')](removeEntity(_0x46f9c7,null))[_0xb8a7('0x3b')](handleError(_0x46f9c7,null));};exports['describe']=function(_0x1c7093,_0x27594d){return db[_0xb8a7('0x29')][_0xb8a7('0x4a')]()[_0xb8a7('0x23')](respondWithResult(_0x27594d,null))[_0xb8a7('0x3b')](handleError(_0x27594d,null));};exports[_0xb8a7('0x4b')]=function(_0x2be8a4,_0x3c2eba,_0x24be9c){return db[_0xb8a7('0x4c')][_0xb8a7('0x41')]({'where':{'id':_0x2be8a4[_0xb8a7('0x3d')]['id']}})[_0xb8a7('0x23')](handleEntityNotFound(_0x3c2eba,null))['then'](function(_0x57c7b5){if(_0x57c7b5){return _0x57c7b5[_0xb8a7('0x4b')](_0x2be8a4[_0xb8a7('0x43')][_0xb8a7('0x4d')],_[_0xb8a7('0x4e')](_0x2be8a4[_0xb8a7('0x43')],[_0xb8a7('0x4d'),'id'])||{});}})[_0xb8a7('0x23')](respondWithResult(_0x3c2eba,null))[_0xb8a7('0x3b')](handleError(_0x3c2eba,null));};exports[_0xb8a7('0x4f')]=function(_0x57b9c4,_0x53e774,_0x83c23b){var _0x5bcc16={};var _0x5cbf5d={};var _0x1a5144;var _0x240a1f;return db[_0xb8a7('0x29')][_0xb8a7('0x50')]({'where':{'id':_0x57b9c4[_0xb8a7('0x3d')]['id']}})[_0xb8a7('0x23')](handleEntityNotFound(_0x53e774,null))[_0xb8a7('0x23')](function(_0x5371fb){if(_0x5371fb){_0x1a5144=_0x5371fb;_0x5cbf5d[_0xb8a7('0x2a')]=_[_0xb8a7('0x2b')](db[_0xb8a7('0x4c')]['rawAttributes']);_0x5cbf5d[_0xb8a7('0x2c')]=_[_0xb8a7('0x2b')](_0x57b9c4['query']);_0x5cbf5d[_0xb8a7('0x2d')]=_[_0xb8a7('0x2f')](_0x5cbf5d[_0xb8a7('0x2a')],_0x5cbf5d[_0xb8a7('0x2c')]);_0x5bcc16[_0xb8a7('0x2e')]=_[_0xb8a7('0x2f')](_0x5cbf5d[_0xb8a7('0x2a')],qs[_0xb8a7('0x30')](_0x57b9c4[_0xb8a7('0x2c')][_0xb8a7('0x30')]));_0x5bcc16[_0xb8a7('0x2e')]=_0x5bcc16['attributes'][_0xb8a7('0x3e')]?_0x5bcc16[_0xb8a7('0x2e')]:_0x5cbf5d[_0xb8a7('0x2a')];_0x5bcc16['order']=qs[_0xb8a7('0x32')](_0x57b9c4[_0xb8a7('0x2c')]['sort']);_0x5bcc16[_0xb8a7('0x33')]=qs[_0xb8a7('0x2d')](_[_0xb8a7('0x34')](_0x57b9c4[_0xb8a7('0x2c')],_0x5cbf5d[_0xb8a7('0x2d')]));if(_0x57b9c4[_0xb8a7('0x2c')]['filter']){_0x5bcc16[_0xb8a7('0x33')]=_['merge'](_0x5bcc16[_0xb8a7('0x33')],{'$or':_[_0xb8a7('0x36')](_0x5bcc16['attributes'],function(_0x4a591f){var _0x5d0386={};_0x5d0386[_0x4a591f]={'$like':'%'+_0x57b9c4['query'][_0xb8a7('0x35')]+'%'};return _0x5d0386;})});}_0x5bcc16=_['merge']({},_0x5bcc16,_0x57b9c4['options']);return _0x1a5144[_0xb8a7('0x4f')](_0x5bcc16);}})[_0xb8a7('0x23')](function(_0x12103e){if(_0x12103e){_0x240a1f=_0x12103e[_0xb8a7('0x3e')];if(!_0x57b9c4['query']['hasOwnProperty']('nolimit')){_0x5bcc16[_0xb8a7('0x1d')]=qs[_0xb8a7('0x1d')](_0x57b9c4[_0xb8a7('0x2c')]['limit']);_0x5bcc16[_0xb8a7('0x1b')]=qs[_0xb8a7('0x1b')](_0x57b9c4[_0xb8a7('0x2c')]['offset']);}return _0x1a5144[_0xb8a7('0x4f')](_0x5bcc16);}})[_0xb8a7('0x23')](function(_0x421af8){if(_0x421af8){return _0x421af8?{'count':_0x240a1f,'rows':_0x421af8}:null;}})['then'](respondWithResult(_0x53e774,null))['catch'](handleError(_0x53e774,null));}; \ No newline at end of file +var _0xd51c=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Companies','UserProfileResource','then','sendStatus','error','name','index','describe','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','map','filter','options','CmCompany','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','ids','omit','getContacts','findOne','CmContact','order','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset'];(function(_0x1cab41,_0x4bfa57){var _0x511deb=function(_0x3d1a43){while(--_0x3d1a43){_0x1cab41['push'](_0x1cab41['shift']());}};_0x511deb(++_0x4bfa57);}(_0xd51c,0x1f4));var _0xcd51=function(_0xe3cc00,_0x386247){_0xe3cc00=_0xe3cc00-0x0;var _0x1b6de3=_0xd51c[_0xe3cc00];return _0x1b6de3;};'use strict';var emlformat=require(_0xcd51('0x0'));var rimraf=require(_0xcd51('0x1'));var zipdir=require(_0xcd51('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd51('0x3'));var moment=require(_0xcd51('0x4'));var BPromise=require(_0xcd51('0x5'));var Mustache=require(_0xcd51('0x6'));var util=require(_0xcd51('0x7'));var path=require(_0xcd51('0x8'));var sox=require(_0xcd51('0x9'));var csv=require(_0xcd51('0xa'));var ejs=require(_0xcd51('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd51('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcd51('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd51('0xe'));var Redis=require(_0xcd51('0xf'));var authService=require(_0xcd51('0x10'));var qs=require(_0xcd51('0x11'));var as=require(_0xcd51('0x12'));var hardwareService=require(_0xcd51('0x13'));var logger=require(_0xcd51('0x14'))('api');var utils=require(_0xcd51('0x15'));var config=require(_0xcd51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd51('0x17'))['db'];function respondWithStatusCode(_0x583a49,_0x4f001b){_0x4f001b=_0x4f001b||0xcc;return function(_0x429c74){if(_0x429c74){return _0x583a49['sendStatus'](_0x4f001b);}return _0x583a49[_0xcd51('0x18')](_0x4f001b)[_0xcd51('0x19')]();};}function respondWithResult(_0xff24ba,_0x3f7754){_0x3f7754=_0x3f7754||0xc8;return function(_0x2e4cd9){if(_0x2e4cd9){return _0xff24ba[_0xcd51('0x18')](_0x3f7754)[_0xcd51('0x1a')](_0x2e4cd9);}};}function respondWithFilteredResult(_0x465cb5,_0x1a275f){return function(_0x1f0d17){if(_0x1f0d17){var _0x3d846a=typeof _0x1a275f[_0xcd51('0x1b')]===_0xcd51('0x1c')&&typeof _0x1a275f[_0xcd51('0x1d')]===_0xcd51('0x1c');var _0x445119=_0x1f0d17[_0xcd51('0x1e')];var _0x23b522=_0x3d846a?0x0:_0x1a275f[_0xcd51('0x1b')];var _0xc43ee3=_0x3d846a?_0x1f0d17['count']:_0x1a275f[_0xcd51('0x1b')]+_0x1a275f[_0xcd51('0x1d')];var _0x1f8161;if(_0xc43ee3>=_0x445119){_0xc43ee3=_0x445119;_0x1f8161=0xc8;}else{_0x1f8161=0xce;}_0x465cb5[_0xcd51('0x18')](_0x1f8161);return _0x465cb5[_0xcd51('0x1f')](_0xcd51('0x20'),_0x23b522+'-'+_0xc43ee3+'/'+_0x445119)[_0xcd51('0x1a')](_0x1f0d17);}return null;};}function patchUpdates(_0x3d7883){return function(_0x1a57b4){try{jsonpatch[_0xcd51('0x21')](_0x1a57b4,_0x3d7883,!![]);}catch(_0x293756){return BPromise[_0xcd51('0x22')](_0x293756);}return _0x1a57b4[_0xcd51('0x23')]();};}function saveUpdates(_0x38939d,_0x1b48e0){return function(_0x56a0cb){if(_0x56a0cb){return _0x56a0cb[_0xcd51('0x24')](_0x38939d)['then'](function(_0x44ce0c){return _0x44ce0c;});}return null;};}function removeEntity(_0x5da862,_0x5cebd4){return function(_0x35854c){if(_0x35854c){return _0x35854c[_0xcd51('0x25')]()['then'](function(){var _0x134928=_0x35854c['get']({'plain':!![]});var _0x4b16a5=_0xcd51('0x26');return db[_0xcd51('0x27')][_0xcd51('0x25')]({'where':{'type':_0x4b16a5,'resourceId':_0x134928['id']}})[_0xcd51('0x28')](function(){return _0x35854c;});})[_0xcd51('0x28')](function(){_0x5da862[_0xcd51('0x18')](0xcc)[_0xcd51('0x19')]();});}};}function handleEntityNotFound(_0x56936e,_0x82d64c){return function(_0x563994){if(!_0x563994){_0x56936e[_0xcd51('0x29')](0x194);}return _0x563994;};}function handleError(_0x8a8c91,_0x38a958){_0x38a958=_0x38a958||0x1f4;return function(_0x11be70){logger[_0xcd51('0x2a')](_0x11be70['stack']);if(_0x11be70[_0xcd51('0x2b')]){delete _0x11be70[_0xcd51('0x2b')];}_0x8a8c91[_0xcd51('0x18')](_0x38a958)['send'](_0x11be70);};}exports[_0xcd51('0x2c')]=function(_0x336eaf,_0x583071){var _0x13a2ab={},_0x319d7c={},_0x3ff5c9={'count':0x0,'rows':[]};return db['CmCompany'][_0xcd51('0x2d')]()[_0xcd51('0x28')](function(_0x4bdba5){_0x319d7c[_0xcd51('0x2e')]=_['keys'](_0x4bdba5);_0x319d7c[_0xcd51('0x2f')]=_[_0xcd51('0x30')](_0x336eaf[_0xcd51('0x2f')]);_0x319d7c[_0xcd51('0x31')]=_[_0xcd51('0x32')](_0x319d7c['model'],_0x319d7c[_0xcd51('0x2f')]);_0x13a2ab[_0xcd51('0x33')]=_[_0xcd51('0x32')](_0x319d7c[_0xcd51('0x2e')],qs['fields'](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x34')]));_0x13a2ab[_0xcd51('0x33')]=_0x13a2ab[_0xcd51('0x33')][_0xcd51('0x35')]?_0x13a2ab[_0xcd51('0x33')]:_0x319d7c['model'];if(!_0x336eaf[_0xcd51('0x2f')]['hasOwnProperty']('nolimit')){_0x13a2ab[_0xcd51('0x1d')]=qs['limit'](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x1d')]);_0x13a2ab['offset']=qs[_0xcd51('0x1b')](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x1b')]);}_0x13a2ab['order']=qs[_0xcd51('0x36')](_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x36')]);_0x13a2ab[_0xcd51('0x37')]=qs['filters'](_[_0xcd51('0x38')](_0x336eaf[_0xcd51('0x2f')],_0x319d7c[_0xcd51('0x31')]),_0x4bdba5);if(_0x336eaf[_0xcd51('0x2f')]['filter']){_0x13a2ab[_0xcd51('0x37')]=_[_0xcd51('0x39')](_0x13a2ab['where'],{'$or':_[_0xcd51('0x3a')](_0x13a2ab[_0xcd51('0x33')],function(_0x55ae2b){var _0x5459b2={};_0x5459b2[_0x55ae2b]={'$like':'%'+_0x336eaf[_0xcd51('0x2f')][_0xcd51('0x3b')]+'%'};return _0x5459b2;})});}_0x13a2ab=_[_0xcd51('0x39')]({},_0x13a2ab,_0x336eaf[_0xcd51('0x3c')]);var _0x352b53={'where':_0x13a2ab[_0xcd51('0x37')]};return db[_0xcd51('0x3d')][_0xcd51('0x1e')](_0x352b53)[_0xcd51('0x28')](function(_0x1e8e00){_0x3ff5c9['count']=_0x1e8e00;if(_0x336eaf[_0xcd51('0x2f')]['includeAll']){_0x13a2ab[_0xcd51('0x3e')]=[{'all':!![]}];}return db[_0xcd51('0x3d')][_0xcd51('0x3f')](_0x13a2ab);})[_0xcd51('0x28')](function(_0x479dff){_0x3ff5c9[_0xcd51('0x40')]=_0x479dff;return _0x3ff5c9;})[_0xcd51('0x28')](respondWithFilteredResult(_0x583071,_0x13a2ab))['catch'](handleError(_0x583071,null));})[_0xcd51('0x41')](handleError(_0x583071,null));};exports[_0xcd51('0x42')]=function(_0x4d0969,_0x289072){var _0x42ff4b={'raw':![],'where':{'id':_0x4d0969[_0xcd51('0x43')]['id']}},_0x1ccaca={};_0x1ccaca['model']=_['keys'](db['CmCompany'][_0xcd51('0x44')]);_0x1ccaca[_0xcd51('0x2f')]=_[_0xcd51('0x30')](_0x4d0969[_0xcd51('0x2f')]);_0x1ccaca[_0xcd51('0x31')]=_[_0xcd51('0x32')](_0x1ccaca['model'],_0x1ccaca[_0xcd51('0x2f')]);_0x42ff4b[_0xcd51('0x33')]=_[_0xcd51('0x32')](_0x1ccaca[_0xcd51('0x2e')],qs[_0xcd51('0x34')](_0x4d0969[_0xcd51('0x2f')][_0xcd51('0x34')]));_0x42ff4b[_0xcd51('0x33')]=_0x42ff4b[_0xcd51('0x33')]['length']?_0x42ff4b[_0xcd51('0x33')]:_0x1ccaca[_0xcd51('0x2e')];if(_0x4d0969[_0xcd51('0x2f')]['includeAll']){_0x42ff4b['include']=[{'all':!![]}];}_0x42ff4b=_['merge']({},_0x42ff4b,_0x4d0969[_0xcd51('0x3c')]);return db['CmCompany'][_0xcd51('0x45')](_0x42ff4b)['then'](handleEntityNotFound(_0x289072,null))[_0xcd51('0x28')](respondWithResult(_0x289072,null))[_0xcd51('0x41')](handleError(_0x289072,null));};exports[_0xcd51('0x46')]=function(_0x9d3a9f,_0xfb627e){return db[_0xcd51('0x3d')][_0xcd51('0x46')](_0x9d3a9f['body'],{})[_0xcd51('0x28')](function(_0x4ff751){var _0x115aac=_0x9d3a9f[_0xcd51('0x47')][_0xcd51('0x48')]({'plain':!![]});if(!_0x115aac)throw new Error(_0xcd51('0x49'));if(_0x115aac[_0xcd51('0x4a')]==='user'){var _0x4e33b3=_0x4ff751[_0xcd51('0x48')]({'plain':!![]});var _0x24b100=_0xcd51('0x26');return db[_0xcd51('0x4b')][_0xcd51('0x45')]({'where':{'name':_0x24b100,'userProfileId':_0x115aac[_0xcd51('0x4c')]},'raw':!![]})[_0xcd51('0x28')](function(_0x10a3fa){if(_0x10a3fa&&_0x10a3fa[_0xcd51('0x4d')]===0x0){return db[_0xcd51('0x27')][_0xcd51('0x46')]({'name':_0x4e33b3['name'],'resourceId':_0x4e33b3['id'],'type':_0x10a3fa[_0xcd51('0x2b')],'sectionId':_0x10a3fa['id']},{})[_0xcd51('0x28')](function(){return _0x4ff751;});}else{return _0x4ff751;}})[_0xcd51('0x41')](function(_0x46b8c3){logger[_0xcd51('0x2a')](_0xcd51('0x4e'),_0x46b8c3);throw _0x46b8c3;});}return _0x4ff751;})['then'](respondWithResult(_0xfb627e,0xc9))[_0xcd51('0x41')](handleError(_0xfb627e,null));};exports[_0xcd51('0x24')]=function(_0xe91bc4,_0x391c8f){if(_0xe91bc4[_0xcd51('0x4f')]['id']){delete _0xe91bc4['body']['id'];}return db[_0xcd51('0x3d')][_0xcd51('0x45')]({'where':{'id':_0xe91bc4['params']['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x391c8f,null))[_0xcd51('0x28')](saveUpdates(_0xe91bc4[_0xcd51('0x4f')],null))[_0xcd51('0x28')](respondWithResult(_0x391c8f,null))['catch'](handleError(_0x391c8f,null));};exports[_0xcd51('0x25')]=function(_0x51900d,_0x4946d9){return db[_0xcd51('0x3d')][_0xcd51('0x45')]({'where':{'id':_0x51900d['params']['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x4946d9,null))[_0xcd51('0x28')](removeEntity(_0x4946d9,null))['catch'](handleError(_0x4946d9,null));};exports[_0xcd51('0x2d')]=function(_0x171c30,_0x21171d){return db[_0xcd51('0x3d')][_0xcd51('0x2d')]()[_0xcd51('0x28')](respondWithResult(_0x21171d,null))[_0xcd51('0x41')](handleError(_0x21171d,null));};exports['addContacts']=function(_0xe787b4,_0x1998db,_0x5ecd93){return db['CmContact']['find']({'where':{'id':_0xe787b4[_0xcd51('0x43')]['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x1998db,null))[_0xcd51('0x28')](function(_0x15083c){if(_0x15083c){return _0x15083c['addContacts'](_0xe787b4['body'][_0xcd51('0x50')],_[_0xcd51('0x51')](_0xe787b4[_0xcd51('0x4f')],[_0xcd51('0x50'),'id'])||{});}})[_0xcd51('0x28')](respondWithResult(_0x1998db,null))[_0xcd51('0x41')](handleError(_0x1998db,null));};exports[_0xcd51('0x52')]=function(_0x483a89,_0x228d97,_0x47a9d4){var _0x110f6b={};var _0x3da669={};var _0x4627c2;var _0xc996b4;return db[_0xcd51('0x3d')][_0xcd51('0x53')]({'where':{'id':_0x483a89['params']['id']}})[_0xcd51('0x28')](handleEntityNotFound(_0x228d97,null))['then'](function(_0x3e8cf7){if(_0x3e8cf7){_0x4627c2=_0x3e8cf7;_0x3da669[_0xcd51('0x2e')]=_['keys'](db[_0xcd51('0x54')][_0xcd51('0x44')]);_0x3da669['query']=_[_0xcd51('0x30')](_0x483a89[_0xcd51('0x2f')]);_0x3da669[_0xcd51('0x31')]=_['intersection'](_0x3da669[_0xcd51('0x2e')],_0x3da669[_0xcd51('0x2f')]);_0x110f6b['attributes']=_['intersection'](_0x3da669['model'],qs[_0xcd51('0x34')](_0x483a89['query'][_0xcd51('0x34')]));_0x110f6b[_0xcd51('0x33')]=_0x110f6b[_0xcd51('0x33')][_0xcd51('0x35')]?_0x110f6b['attributes']:_0x3da669[_0xcd51('0x2e')];_0x110f6b[_0xcd51('0x55')]=qs[_0xcd51('0x36')](_0x483a89['query']['sort']);_0x110f6b[_0xcd51('0x37')]=qs[_0xcd51('0x31')](_[_0xcd51('0x38')](_0x483a89[_0xcd51('0x2f')],_0x3da669['filters']));if(_0x483a89[_0xcd51('0x2f')]['filter']){_0x110f6b[_0xcd51('0x37')]=_['merge'](_0x110f6b[_0xcd51('0x37')],{'$or':_[_0xcd51('0x3a')](_0x110f6b['attributes'],function(_0x2c4a35){var _0x150f6f={};_0x150f6f[_0x2c4a35]={'$like':'%'+_0x483a89['query'][_0xcd51('0x3b')]+'%'};return _0x150f6f;})});}_0x110f6b=_[_0xcd51('0x39')]({},_0x110f6b,_0x483a89[_0xcd51('0x3c')]);return _0x4627c2[_0xcd51('0x52')](_0x110f6b);}})['then'](function(_0x52d488){if(_0x52d488){_0xc996b4=_0x52d488[_0xcd51('0x35')];if(!_0x483a89[_0xcd51('0x2f')][_0xcd51('0x56')](_0xcd51('0x57'))){_0x110f6b[_0xcd51('0x1d')]=qs[_0xcd51('0x1d')](_0x483a89[_0xcd51('0x2f')][_0xcd51('0x1d')]);_0x110f6b[_0xcd51('0x1b')]=qs['offset'](_0x483a89[_0xcd51('0x2f')][_0xcd51('0x1b')]);}return _0x4627c2[_0xcd51('0x52')](_0x110f6b);}})[_0xcd51('0x28')](function(_0x534af7){if(_0x534af7){return _0x534af7?{'count':_0xc996b4,'rows':_0x534af7}:null;}})['then'](respondWithResult(_0x228d97,null))[_0xcd51('0x41')](handleError(_0x228d97,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 84516c5..b88d9da 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 _0xad0e=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','cm_companies'];(function(_0x449607,_0x287561){var _0x972d5=function(_0x222241){while(--_0x222241){_0x449607['push'](_0x449607['shift']());}};_0x972d5(++_0x287561);}(_0xad0e,0x1ea));var _0xead0=function(_0x5a8ec8,_0x10e03b){_0x5a8ec8=_0x5a8ec8-0x0;var _0x4c23aa=_0xad0e[_0x5a8ec8];return _0x4c23aa;};'use strict';var _=require(_0xead0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xead0('0x1'));var moment=require(_0xead0('0x2'));var BPromise=require('bluebird');var rp=require(_0xead0('0x3'));var fs=require('fs');var path=require(_0xead0('0x4'));var rimraf=require(_0xead0('0x5'));var config=require(_0xead0('0x6'));var attributes=require(_0xead0('0x7'));module['exports']=function(_0x4a01ad,_0x71aaf7){return _0x4a01ad[_0xead0('0x8')]('CmCompany',attributes,{'tableName':_0xead0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3f4=['bluebird','path','../../config/environment','./cmCompany.attributes','define','lodash','../../config/logger','api','moment'];(function(_0x338390,_0xd73537){var _0x1e4e0e=function(_0xe36dcf){while(--_0xe36dcf){_0x338390['push'](_0x338390['shift']());}};_0x1e4e0e(++_0xd73537);}(_0xf3f4,0x188));var _0x4f3f=function(_0x43c52f,_0x5d98ea){_0x43c52f=_0x43c52f-0x0;var _0x205e88=_0xf3f4[_0x43c52f];return _0x205e88;};'use strict';var _=require(_0x4f3f('0x0'));var util=require('util');var logger=require(_0x4f3f('0x1'))(_0x4f3f('0x2'));var moment=require(_0x4f3f('0x3'));var BPromise=require(_0x4f3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f3f('0x5'));var rimraf=require('rimraf');var config=require(_0x4f3f('0x6'));var attributes=require(_0x4f3f('0x7'));module['exports']=function(_0x254343,_0x39ed5e){return _0x254343[_0x4f3f('0x8')]('CmCompany',attributes,{'tableName':'cm_companies','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 b140706..03879e8 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 _0x8bc5=['info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8bc5,0x8d));var _0x58bc=function(_0xc1f5b2,_0x48b7d5){_0xc1f5b2=_0xc1f5b2-0x0;var _0x291aa3=_0x8bc5[_0xc1f5b2];return _0x291aa3;};'use strict';var _=require(_0x58bc('0x0'));var util=require('util');var moment=require(_0x58bc('0x1'));var BPromise=require('bluebird');var rs=require(_0x58bc('0x2'));var fs=require('fs');var Redis=require(_0x58bc('0x3'));var db=require(_0x58bc('0x4'))['db'];var utils=require(_0x58bc('0x5'));var logger=require(_0x58bc('0x6'))(_0x58bc('0x7'));var config=require(_0x58bc('0x8'));var jayson=require(_0x58bc('0x9'));var client=jayson[_0x58bc('0xa')][_0x58bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x72d2db,_0x295dee,_0x3e0b80){return new BPromise(function(_0x273f24,_0x26d27b){return client[_0x58bc('0xc')](_0x72d2db,_0x3e0b80)[_0x58bc('0xd')](function(_0x17e0df){logger['info'](_0x58bc('0xe'),_0x295dee,_0x58bc('0xf'));logger['debug'](_0x58bc('0x10'),_0x295dee,_0x58bc('0xf'),JSON['stringify'](_0x17e0df));if(_0x17e0df[_0x58bc('0x11')]){if(_0x17e0df[_0x58bc('0x11')][_0x58bc('0x12')]===0x1f4){logger[_0x58bc('0x11')](_0x58bc('0xe'),_0x295dee,_0x17e0df[_0x58bc('0x11')][_0x58bc('0x13')]);return _0x26d27b(_0x17e0df[_0x58bc('0x11')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x295dee,_0x17e0df[_0x58bc('0x11')][_0x58bc('0x13')]);return _0x273f24(_0x17e0df[_0x58bc('0x11')][_0x58bc('0x13')]);}else{logger[_0x58bc('0x14')]('CmCompany,\x20%s,\x20%s',_0x295dee,_0x58bc('0xf'));_0x273f24(_0x17e0df[_0x58bc('0x15')][_0x58bc('0x13')]);}})[_0x58bc('0x16')](function(_0x211b6e){logger[_0x58bc('0x11')](_0x58bc('0xe'),_0x295dee,_0x211b6e);_0x26d27b(_0x211b6e);});});} \ No newline at end of file +var _0x7f1d=['message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5462b3,_0x2d5bf0){var _0x44260d=function(_0x269fc1){while(--_0x269fc1){_0x5462b3['push'](_0x5462b3['shift']());}};_0x44260d(++_0x2d5bf0);}(_0x7f1d,0xe8));var _0xd7f1=function(_0x5afbd5,_0x48a693){_0x5afbd5=_0x5afbd5-0x0;var _0x298511=_0x7f1d[_0x5afbd5];return _0x298511;};'use strict';var _=require(_0xd7f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd7f1('0x1'));var rs=require(_0xd7f1('0x2'));var fs=require('fs');var Redis=require(_0xd7f1('0x3'));var db=require(_0xd7f1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd7f1('0x5'))(_0xd7f1('0x6'));var config=require(_0xd7f1('0x7'));var jayson=require(_0xd7f1('0x8'));var client=jayson[_0xd7f1('0x9')][_0xd7f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ecab1,_0x3088b1,_0x19a486){return new BPromise(function(_0x59e3df,_0x1e948c){return client[_0xd7f1('0xb')](_0x4ecab1,_0x19a486)[_0xd7f1('0xc')](function(_0x167fa7){logger[_0xd7f1('0xd')](_0xd7f1('0xe'),_0x3088b1,'request\x20sent');logger[_0xd7f1('0xf')](_0xd7f1('0x10'),_0x3088b1,_0xd7f1('0x11'),JSON[_0xd7f1('0x12')](_0x167fa7));if(_0x167fa7[_0xd7f1('0x13')]){if(_0x167fa7['error'][_0xd7f1('0x14')]===0x1f4){logger[_0xd7f1('0x13')](_0xd7f1('0xe'),_0x3088b1,_0x167fa7[_0xd7f1('0x13')][_0xd7f1('0x15')]);return _0x1e948c(_0x167fa7[_0xd7f1('0x13')][_0xd7f1('0x15')]);}logger['error'](_0xd7f1('0xe'),_0x3088b1,_0x167fa7[_0xd7f1('0x13')][_0xd7f1('0x15')]);return _0x59e3df(_0x167fa7[_0xd7f1('0x13')]['message']);}else{logger[_0xd7f1('0xd')](_0xd7f1('0xe'),_0x3088b1,_0xd7f1('0x11'));_0x59e3df(_0x167fa7[_0xd7f1('0x16')][_0xd7f1('0x15')]);}})['catch'](function(_0x3cac14){logger['error'](_0xd7f1('0xe'),_0x3088b1,_0x3cac14);_0x1e948c(_0x3cac14);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 9767be9..95d3331 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 _0xce35=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete'];(function(_0x407399,_0x481e7e){var _0x242a81=function(_0x871082){while(--_0x871082){_0x407399['push'](_0x407399['shift']());}};_0x242a81(++_0x481e7e);}(_0xce35,0xb0));var _0x5ce3=function(_0x1fdde0,_0x35ce6c){_0x1fdde0=_0x1fdde0-0x0;var _0x2db8d7=_0xce35[_0x1fdde0];return _0x2db8d7;};'use strict';var multer=require('multer');var util=require(_0x5ce3('0x0'));var path=require(_0x5ce3('0x1'));var timeout=require(_0x5ce3('0x2'));var express=require(_0x5ce3('0x3'));var router=express[_0x5ce3('0x4')]();var fs_extra=require(_0x5ce3('0x5'));var auth=require(_0x5ce3('0x6'));var interaction=require(_0x5ce3('0x7'));var config=require(_0x5ce3('0x8'));var controller=require(_0x5ce3('0x9'));router['get']('/',auth[_0x5ce3('0xa')](),controller[_0x5ce3('0xb')]);router[_0x5ce3('0xc')](_0x5ce3('0xd'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0xe')]);router[_0x5ce3('0xc')](_0x5ce3('0xf'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x10')]);router['get'](_0x5ce3('0x11'),auth[_0x5ce3('0xa')](),controller['getContacts']);router[_0x5ce3('0x12')]('/',auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x13')]);router[_0x5ce3('0x12')](_0x5ce3('0x11'),auth['isAuthenticated'](),controller[_0x5ce3('0x14')]);router[_0x5ce3('0x15')](_0x5ce3('0xf'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x16')]);router[_0x5ce3('0x17')](_0x5ce3('0xf'),auth[_0x5ce3('0xa')](),controller[_0x5ce3('0x18')]);module['exports']=router; \ No newline at end of file +var _0x6c57=['/:id','/:id/contacts','getContacts','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4e721e,_0x35b938){var _0x353a81=function(_0x519f56){while(--_0x519f56){_0x4e721e['push'](_0x4e721e['shift']());}};_0x353a81(++_0x35b938);}(_0x6c57,0x157));var _0x76c5=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6c57[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x76c5('0x0'));var util=require(_0x76c5('0x1'));var path=require(_0x76c5('0x2'));var timeout=require(_0x76c5('0x3'));var express=require(_0x76c5('0x4'));var router=express[_0x76c5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x76c5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76c5('0x7'));var controller=require(_0x76c5('0x8'));router[_0x76c5('0x9')]('/',auth[_0x76c5('0xa')](),controller[_0x76c5('0xb')]);router[_0x76c5('0x9')](_0x76c5('0xc'),auth[_0x76c5('0xa')](),controller[_0x76c5('0xd')]);router[_0x76c5('0x9')](_0x76c5('0xe'),auth[_0x76c5('0xa')](),controller['show']);router[_0x76c5('0x9')](_0x76c5('0xf'),auth['isAuthenticated'](),controller[_0x76c5('0x10')]);router['post']('/',auth[_0x76c5('0xa')](),controller[_0x76c5('0x11')]);router['post'](_0x76c5('0xf'),auth[_0x76c5('0xa')](),controller['addContacts']);router[_0x76c5('0x12')](_0x76c5('0xe'),auth[_0x76c5('0xa')](),controller[_0x76c5('0x13')]);router[_0x76c5('0x14')](_0x76c5('0xe'),auth[_0x76c5('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index d425c3d..51c801a 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 _0x40fc=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x17241e,_0x19c97c){var _0x1d0303=function(_0x17ebea){while(--_0x17ebea){_0x17241e['push'](_0x17241e['shift']());}};_0x1d0303(++_0x19c97c);}(_0x40fc,0x93));var _0xc40f=function(_0x452ac2,_0x45f034){_0x452ac2=_0x452ac2-0x0;var _0x5a589a=_0x40fc[_0x452ac2];return _0x5a589a;};'use strict';var _=require(_0xc40f('0x0'));var Sequelize=require(_0xc40f('0x1'));module[_0xc40f('0x2')]={'firstName':{'type':Sequelize[_0xc40f('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc40f('0x3')]},'street':{'type':Sequelize[_0xc40f('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc40f('0x3')]},'country':{'type':Sequelize[_0xc40f('0x3')]},'dateOfBirth':{'type':Sequelize[_0xc40f('0x3')]},'description':{'type':Sequelize[_0xc40f('0x4')]},'phone':{'type':Sequelize[_0xc40f('0x3')]},'mobile':{'type':Sequelize[_0xc40f('0x3')]},'fax':{'type':Sequelize[_0xc40f('0x3')]},'email':{'type':Sequelize[_0xc40f('0x3')]},'url':{'type':Sequelize[_0xc40f('0x3')]},'facebook':{'type':Sequelize[_0xc40f('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc40f('0x3')]},'viber':{'type':Sequelize[_0xc40f('0x3')]},'line':{'type':Sequelize[_0xc40f('0x3')]},'wechat':{'type':Sequelize[_0xc40f('0x3')]},'telegram':{'type':Sequelize[_0xc40f('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xc40f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc40f('0x6')],'defaultValue':Sequelize[_0xc40f('0x7')]}}; \ No newline at end of file +var _0xc4c3=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xc4c3,0x1df));var _0x3c4c=function(_0x5931bf,_0x28cf7b){_0x5931bf=_0x5931bf-0x0;var _0x22e090=_0xc4c3[_0x5931bf];return _0x22e090;};'use strict';var _=require('lodash');var Sequelize=require(_0x3c4c('0x0'));module[_0x3c4c('0x1')]={'firstName':{'type':Sequelize[_0x3c4c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x3c4c('0x2')]},'street':{'type':Sequelize[_0x3c4c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3c4c('0x2')]},'country':{'type':Sequelize[_0x3c4c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x3c4c('0x2')]},'description':{'type':Sequelize[_0x3c4c('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x3c4c('0x2')]},'fax':{'type':Sequelize[_0x3c4c('0x2')]},'email':{'type':Sequelize[_0x3c4c('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x3c4c('0x2')]},'fb_data':{'type':Sequelize[_0x3c4c('0x2')]},'twitter':{'type':Sequelize[_0x3c4c('0x2')]},'skype':{'type':Sequelize[_0x3c4c('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x3c4c('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x3c4c('0x2')]},'telegram':{'type':Sequelize[_0x3c4c('0x2')]},'UserId':{'type':Sequelize[_0x3c4c('0x4')]},'priority':{'type':Sequelize[_0x3c4c('0x4')](0x2)[_0x3c4c('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3c4c('0x6')],'defaultValue':Sequelize[_0x3c4c('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index ace65b2..90f53dc 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 _0x4cf0=['sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','catch','tags','columnName','displayName','alias','custom','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','MailMessage','MailInteraction','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','duplicates','$or','findOrCreate','spread','show','$and','findAll','omit','cf_%d','pickBy','format','setFields','values','phone','getTags','Tag','rawAttributes','setTags','ids','includeAll','include','CmHopperHistory','ContactId','options','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','parse','meta','import','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userThirdDisposition','findAndCountAll','fullname','Website','Account','closedAt','note','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','startCase','Interaction','all','flatten','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','CmContact','describe','length','keys','startsWith','push','CmCustomField','findOne','cf_','type','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','name','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','value','split','User','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','castTo','buildExpression','text','start','map','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','filter','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','SELECT','clone','forEach','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL'];(function(_0x398066,_0x3004ec){var _0x5a4945=function(_0x473353){while(--_0x473353){_0x398066['push'](_0x398066['shift']());}};_0x5a4945(++_0x3004ec);}(_0x4cf0,0xa1));var _0x04cf=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4cf0[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x04cf('0x0'));var rimraf=require(_0x04cf('0x1'));var zipdir=require(_0x04cf('0x2'));var jsonpatch=require(_0x04cf('0x3'));var rp=require(_0x04cf('0x4'));var moment=require(_0x04cf('0x5'));var BPromise=require(_0x04cf('0x6'));var Mustache=require(_0x04cf('0x7'));var util=require(_0x04cf('0x8'));var path=require(_0x04cf('0x9'));var sox=require(_0x04cf('0xa'));var csv=require(_0x04cf('0xb'));var ejs=require(_0x04cf('0xc'));var fs=require('fs');var fs_extra=require(_0x04cf('0xd'));var _=require(_0x04cf('0xe'));var squel=require('squel');var crypto=require(_0x04cf('0xf'));var jsforce=require(_0x04cf('0x10'));var deskjs=require(_0x04cf('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04cf('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04cf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04cf('0x14'));var logger=require('../../config/logger')(_0x04cf('0x15'));var utils=require('../../config/utils');var config=require(_0x04cf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x04cf('0x17'))['db'];config[_0x04cf('0x18')]=_[_0x04cf('0x19')](config[_0x04cf('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x04cf('0x1a'))(new Redis(config['redis']));require('./cmContact.socket')[_0x04cf('0x1b')](socket);function respondWithStatusCode(_0x4e8539,_0x5a267f){_0x5a267f=_0x5a267f||0xcc;return function(_0x1d1e98){if(_0x1d1e98){return _0x4e8539[_0x04cf('0x1c')](_0x5a267f);}return _0x4e8539[_0x04cf('0x1d')](_0x5a267f)[_0x04cf('0x1e')]();};}function respondWithResult(_0xd77efd,_0x373f2f){_0x373f2f=_0x373f2f||0xc8;return function(_0x1858c4){if(_0x1858c4){return _0xd77efd[_0x04cf('0x1d')](_0x373f2f)[_0x04cf('0x1f')](_0x1858c4);}};}function respondWithFilteredResult(_0x33f4a8,_0x5d41c5){return function(_0x21bc5c){if(_0x21bc5c){var _0x78be45=typeof _0x5d41c5[_0x04cf('0x20')]===_0x04cf('0x21')&&typeof _0x5d41c5[_0x04cf('0x22')]===_0x04cf('0x21');var _0x2572f1=_0x21bc5c[_0x04cf('0x23')];var _0x40f3c0=_0x78be45?0x0:_0x5d41c5['offset'];var _0x10cb82=_0x78be45?_0x21bc5c[_0x04cf('0x23')]:_0x5d41c5[_0x04cf('0x20')]+_0x5d41c5[_0x04cf('0x22')];var _0x4bd58f;if(_0x10cb82>=_0x2572f1){_0x10cb82=_0x2572f1;_0x4bd58f=0xc8;}else{_0x4bd58f=0xce;}_0x33f4a8['status'](_0x4bd58f);return _0x33f4a8['set'](_0x04cf('0x24'),_0x40f3c0+'-'+_0x10cb82+'/'+_0x2572f1)[_0x04cf('0x1f')](_0x21bc5c);}return null;};}function patchUpdates(_0x1b9728){return function(_0x1a564d){try{jsonpatch[_0x04cf('0x25')](_0x1a564d,_0x1b9728,!![]);}catch(_0x572bbe){return BPromise[_0x04cf('0x26')](_0x572bbe);}return _0x1a564d[_0x04cf('0x27')]();};}function saveUpdates(_0x50b31d,_0x3b9ed2){return function(_0x5eece9){if(_0x5eece9){return _0x5eece9[_0x04cf('0x28')](_0x50b31d)[_0x04cf('0x29')](function(_0x350263){return _0x350263;});}return null;};}function removeEntity(_0x16bca4,_0x4e29e1){return function(_0x3401c3){if(_0x3401c3){return _0x3401c3[_0x04cf('0x2a')]()['then'](function(){_0x16bca4[_0x04cf('0x1d')](0xcc)[_0x04cf('0x1e')]();});}};}function handleEntityNotFound(_0x5a99b8,_0xb7bf8a){return function(_0x526e24){if(!_0x526e24){_0x5a99b8[_0x04cf('0x1c')](0x194);}return _0x526e24;};}function handleError(_0x58a697,_0x5aabc3){_0x5aabc3=_0x5aabc3||0x1f4;return function(_0x3e85c0){logger[_0x04cf('0x2b')](_0x3e85c0[_0x04cf('0x2c')]);if(_0x3e85c0['name']){delete _0x3e85c0['name'];}_0x58a697[_0x04cf('0x1d')](_0x5aabc3)[_0x04cf('0x2d')](_0x3e85c0);};}exports[_0x04cf('0x2e')]=function(_0x341aa3,_0x571842){var _0x3ea43c={},_0x3d7404={},_0x3b3ea0={'count':0x0,'rows':[]};return db[_0x04cf('0x2f')][_0x04cf('0x30')]()[_0x04cf('0x29')](function(_0x55e2b2){var _0x7f1e1e=[];for(var _0x22a77a=0x0;_0x22a77a0x1){_0x57f6a0['or'](_0x04cf('0x6e'),qs[_0x04cf('0x6f')](_0x3c468d),null);}else{if(qs[_0x04cf('0x70')](_0x3c468d)){_0x57f6a0['or'](_0x04cf('0x71'),_0x3c468d+'%');_0x57f6a0['or'](_0x04cf('0x72'),_0x3c468d+'%');_0x57f6a0['or']('c.mobile\x20LIKE\x20?',_0x3c468d+'%');_0x57f6a0['or'](_0x04cf('0x73'),_0x3c468d+'%');}else if(qs[_0x04cf('0x74')](_0x3c468d)){_0x57f6a0['or']('c.email\x20LIKE\x20?',_0x3c468d+'%');}else{_0x57f6a0['or'](_0x04cf('0x75'),'%'+_0x3c468d+'%');_0x57f6a0['or'](_0x04cf('0x76'),'%'+_0x3c468d+'%');_0x57f6a0['or'](_0x04cf('0x77'),'%'+_0x3c468d+'%');}}}}_0x4d982d[_0x04cf('0x42')](_0x57f6a0);_0x4d982d[_0x04cf('0x78')](_0x04cf('0x79'));var _0x474ac6={'type':db[_0x04cf('0x7a')]['QueryTypes'][_0x04cf('0x7b')],'raw':!![]};var _0x566dfd=_0x4d982d[_0x04cf('0x7c')]()[_0x04cf('0x46')]('c.id');if(_0x3ea43c[_0x04cf('0x40')]){_0x3ea43c[_0x04cf('0x40')][_0x04cf('0x7d')](function(_0x13ba9f){_0x4d982d['order']('c.'+_0x13ba9f[0x0],_0x13ba9f[0x1]===_0x04cf('0x7e')?![]:!![]);});}if(!_['isEmpty'](_0x5db20f)){_0x4d982d[_0x04cf('0x7f')](_0x2bcfa2);_0x566dfd['where'](_0x04cf('0x80'),_0x5db20f);}BPromise[_0x04cf('0x81')]()['then'](function(){if(!_0x412066)return;if(_0x341aa3[_0x04cf('0x82')][_0x04cf('0x83')]!==_0x04cf('0x84'))return;if(!_[_0x04cf('0x85')](_0x412066[_0x04cf('0x56')],[_0x04cf('0x46'),_0x04cf('0x5a')])){return _0x341aa3[_0x04cf('0x82')]['getLists']({'attributes':['id'],'raw':!![]})[_0x04cf('0x29')](function(_0x5b0558){if(_['isEmpty'](_0x5b0558)){_0x566dfd[_0x04cf('0x42')](_0x04cf('0x86'));_0x4d982d[_0x04cf('0x42')](_0x04cf('0x86'));}else{_0x566dfd[_0x04cf('0x42')](_0x04cf('0x68'),_['map'](_0x5b0558,'id'));_0x4d982d['where']('c.ListId\x20IN\x20?',_['map'](_0x5b0558,'id'));}});}})[_0x04cf('0x29')](function(){if(_0x341aa3[_0x04cf('0x82')][_0x04cf('0x83')]===_0x04cf('0x84')&&!_0x412066&&!_0x341aa3[_0x04cf('0x39')]['ListId'])return[];return db[_0x04cf('0x87')][_0x04cf('0x39')](_0x566dfd[_0x04cf('0x88')](),_0x474ac6);})[_0x04cf('0x29')](function(_0x1aa5dd){_0x3b3ea0[_0x04cf('0x23')]=_0x1aa5dd[_0x04cf('0x31')];if(_0x3b3ea0[_0x04cf('0x23')]===0x0)return[];return db['sequelize'][_0x04cf('0x39')](_0x476175['toString'](),_0x474ac6)[_0x04cf('0x29')](function(_0x3ce565){_0x1139d6=_['keyBy'](_0x3ce565,'id');_0x474ac6=_[_0x04cf('0x89')](_0x474ac6,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x341aa3[_0x04cf('0x39')][_0x04cf('0x3d')]){_0x3ea43c[_0x04cf('0x3c')][_0x04cf('0x7d')](function(_0x48da5a){_0x4d982d[_0x04cf('0x46')]('c.'+_0x48da5a);});}else{_0x4d982d[_0x04cf('0x46')](_0x04cf('0x79'));_0x4d982d[_0x04cf('0x46')](_0x04cf('0x8a'));_0x4d982d['field'](_0x04cf('0x8b'));_0x4d982d['field'](_0x04cf('0x8c'));_0x4d982d['field'](_0x04cf('0x8d'));_0x4d982d[_0x04cf('0x46')](_0x04cf('0x8e'));_0x4d982d[_0x04cf('0x46')](_0x04cf('0x8f'));_0x4d982d[_0x04cf('0x46')](_0x04cf('0x90'));_0x4d982d['field'](_0x04cf('0x91'));_0x4d982d[_0x04cf('0x46')](_0x04cf('0x92'));_0x4d982d['field']('c.CompanyId');_0x4d982d['field'](_0x04cf('0x93'),'TagIds');}if(_0x3ea43c[_0x04cf('0x22')])_0x4d982d[_0x04cf('0x22')](_0x3ea43c[_0x04cf('0x22')]);if(_0x3ea43c[_0x04cf('0x20')])_0x4d982d['offset'](_0x3ea43c['offset']);return db[_0x04cf('0x87')][_0x04cf('0x39')](_0x4d982d[_0x04cf('0x88')](),_0x474ac6);});})['then'](function(_0x4d4f45){_0x4d4f45[_0x04cf('0x7d')](function(_0x19e576){if(_0x19e576[_0x04cf('0x94')]){_0x19e576['Tags']=[];_0x19e576[_0x04cf('0x94')][_0x04cf('0x59')](',')[_0x04cf('0x7d')](function(_0x378135){_0x19e576[_0x04cf('0x95')][_0x04cf('0x34')](_0x1139d6[_0x378135]);});}delete _0x19e576[_0x04cf('0x94')];});_0x3b3ea0[_0x04cf('0x96')]=_0x4d4f45;return _0x3b3ea0;})[_0x04cf('0x29')](respondWithFilteredResult(_0x571842,_0x3ea43c));})['catch'](handleError(_0x571842,null));};exports[_0x04cf('0x2a')]=function(_0x508632,_0x2f492e){return db[_0x04cf('0x2f')][_0x04cf('0x57')]({'where':{'id':_0x508632[_0x04cf('0x97')]['id']}})[_0x04cf('0x29')](handleEntityNotFound(_0x2f492e,null))['then'](removeEntity(_0x2f492e,null))[_0x04cf('0x98')](handleError(_0x2f492e,null));};exports[_0x04cf('0x30')]=function(_0x6f714d,_0xa0871){return db[_0x04cf('0x2f')][_0x04cf('0x30')]()[_0x04cf('0x29')](function(_0x124fd7){delete _0x124fd7[_0x04cf('0x99')];for(var _0x3b0782=0x0;_0x3b0782=_0x445557){_0x423eea=_0x445557;_0x3f853b=0xc8;}else{_0x3f853b=0xce;}_0x5f3c8b[_0x7cbc('0x1d')](_0x3f853b);return _0x5f3c8b[_0x7cbc('0x22')](_0x7cbc('0x23'),_0x5e0d80+'-'+_0x423eea+'/'+_0x445557)[_0x7cbc('0x24')](_0x590f00);}return null;};}function patchUpdates(_0xede139){return function(_0x138053){try{jsonpatch[_0x7cbc('0x25')](_0x138053,_0xede139,!![]);}catch(_0x329d83){return BPromise[_0x7cbc('0x26')](_0x329d83);}return _0x138053['save']();};}function saveUpdates(_0x5e3f9c,_0x1f1da9){return function(_0x1e738a){if(_0x1e738a){return _0x1e738a[_0x7cbc('0x27')](_0x5e3f9c)[_0x7cbc('0x28')](function(_0x49a547){return _0x49a547;});}return null;};}function removeEntity(_0x2881bd,_0x465fa5){return function(_0x2907c2){if(_0x2907c2){return _0x2907c2[_0x7cbc('0x29')]()[_0x7cbc('0x28')](function(){_0x2881bd[_0x7cbc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55e6ff,_0x36f986){return function(_0x292744){if(!_0x292744){_0x55e6ff[_0x7cbc('0x1b')](0x194);}return _0x292744;};}function handleError(_0x823d68,_0x448839){_0x448839=_0x448839||0x1f4;return function(_0x135e14){logger[_0x7cbc('0x2a')](_0x135e14[_0x7cbc('0x2b')]);if(_0x135e14[_0x7cbc('0x2c')]){delete _0x135e14[_0x7cbc('0x2c')];}_0x823d68[_0x7cbc('0x1d')](_0x448839)['send'](_0x135e14);};}exports[_0x7cbc('0x2d')]=function(_0x736374,_0x413f8b){var _0xf72233={},_0x48c9d3={},_0x1db578={'count':0x0,'rows':[]};return db[_0x7cbc('0x2e')]['describe']()[_0x7cbc('0x28')](function(_0x4d636f){var _0x4525af=[];for(var _0x39dbeb=0x0;_0x39dbeb0x1){_0x275f4c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x591a24),null);}else{if(qs[_0x7cbc('0x67')](_0x591a24)){_0x275f4c['or']('c.id\x20LIKE\x20?',_0x591a24+'%');_0x275f4c['or']('c.phone\x20LIKE\x20?',_0x591a24+'%');_0x275f4c['or'](_0x7cbc('0x68'),_0x591a24+'%');_0x275f4c['or']('c.fax\x20LIKE\x20?',_0x591a24+'%');}else if(qs[_0x7cbc('0x69')](_0x591a24)){_0x275f4c['or'](_0x7cbc('0x6a'),_0x591a24+'%');}else{_0x275f4c['or'](_0x7cbc('0x6b'),'%'+_0x591a24+'%');_0x275f4c['or']('c.lastName\x20LIKE\x20?','%'+_0x591a24+'%');_0x275f4c['or'](_0x7cbc('0x6a'),'%'+_0x591a24+'%');}}}}_0x3b7fb6[_0x7cbc('0x41')](_0x275f4c);_0x3b7fb6[_0x7cbc('0x6c')](_0x7cbc('0x6d'));var _0x477cc8={'type':db['Sequelize'][_0x7cbc('0x6e')][_0x7cbc('0x6f')],'raw':!![]};var _0x5204b0=_0x3b7fb6[_0x7cbc('0x70')]()[_0x7cbc('0x4f')](_0x7cbc('0x6d'));if(_0xf72233[_0x7cbc('0x3f')]){_0xf72233['order'][_0x7cbc('0x53')](function(_0x5e6d93){_0x3b7fb6[_0x7cbc('0x3f')]('c.'+_0x5e6d93[0x0],_0x5e6d93[0x1]===_0x7cbc('0x71')?![]:!![]);});}if(!_[_0x7cbc('0x5f')](_0x1af8cf)){_0x3b7fb6[_0x7cbc('0x72')](_0x373d7a);_0x5204b0[_0x7cbc('0x41')](_0x7cbc('0x73'),_0x1af8cf);}BPromise[_0x7cbc('0x74')]()[_0x7cbc('0x28')](function(){if(!_0x44d466)return;if(_0x736374['user'][_0x7cbc('0x75')]!==_0x7cbc('0x76'))return;if(!_['some'](_0x44d466['conditions'],[_0x7cbc('0x4f'),_0x7cbc('0x77')])){return _0x736374[_0x7cbc('0x78')]['getLists']({'attributes':['id'],'raw':!![]})[_0x7cbc('0x28')](function(_0x109ffb){if(_[_0x7cbc('0x5f')](_0x109ffb)){_0x5204b0[_0x7cbc('0x41')]('c.ListId\x20IS\x20NULL');_0x3b7fb6[_0x7cbc('0x41')](_0x7cbc('0x79'));}else{_0x5204b0[_0x7cbc('0x41')]('c.ListId\x20IN\x20?',_[_0x7cbc('0x52')](_0x109ffb,'id'));_0x3b7fb6[_0x7cbc('0x41')]('c.ListId\x20IN\x20?',_[_0x7cbc('0x52')](_0x109ffb,'id'));}});}})[_0x7cbc('0x28')](function(){if(_0x736374[_0x7cbc('0x78')]['role']===_0x7cbc('0x76')&&!_0x44d466&&!_0x736374[_0x7cbc('0x3d')]['ListId'])return[];return db['sequelize']['query'](_0x5204b0[_0x7cbc('0x7a')](),_0x477cc8);})[_0x7cbc('0x28')](function(_0x4101a8){_0x1db578[_0x7cbc('0x21')]=_0x4101a8[_0x7cbc('0x3e')];if(_0x1db578['count']===0x0)return[];return db[_0x7cbc('0x7b')][_0x7cbc('0x3d')](_0x2dc94a['toString'](),_0x477cc8)['then'](function(_0x44b067){_0xa1aad4=_[_0x7cbc('0x7c')](_0x44b067,'id');_0x477cc8=_[_0x7cbc('0x7d')](_0x477cc8,{'model':db[_0x7cbc('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x736374[_0x7cbc('0x3d')]['fields']){_0xf72233[_0x7cbc('0x3b')][_0x7cbc('0x53')](function(_0x1af22f){_0x3b7fb6['field']('c.'+_0x1af22f);});}else{_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x6d'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x7e'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x7f'));_0x3b7fb6['field'](_0x7cbc('0x80'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x81'));_0x3b7fb6['field']('c.fax');_0x3b7fb6['field'](_0x7cbc('0x82'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x83'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x84'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x85'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x86'));_0x3b7fb6[_0x7cbc('0x4f')](_0x7cbc('0x87'),_0x7cbc('0x88'));}if(_0xf72233['limit'])_0x3b7fb6[_0x7cbc('0x20')](_0xf72233[_0x7cbc('0x20')]);if(_0xf72233[_0x7cbc('0x1e')])_0x3b7fb6[_0x7cbc('0x1e')](_0xf72233[_0x7cbc('0x1e')]);return db[_0x7cbc('0x7b')]['query'](_0x3b7fb6[_0x7cbc('0x7a')](),_0x477cc8);});})[_0x7cbc('0x28')](function(_0x54eb02){_0x54eb02[_0x7cbc('0x53')](function(_0x209d26){if(_0x209d26['TagIds']){_0x209d26[_0x7cbc('0x89')]=[];_0x209d26[_0x7cbc('0x88')][_0x7cbc('0x51')](',')[_0x7cbc('0x53')](function(_0x43bdb6){_0x209d26['Tags']['push'](_0xa1aad4[_0x43bdb6]);});}delete _0x209d26[_0x7cbc('0x88')];});_0x1db578[_0x7cbc('0x8a')]=_0x54eb02;return _0x1db578;})[_0x7cbc('0x28')](respondWithFilteredResult(_0x413f8b,_0xf72233));})['catch'](handleError(_0x413f8b,null));};exports[_0x7cbc('0x29')]=function(_0x286497,_0x59a644){return db['CmContact'][_0x7cbc('0x4e')]({'where':{'id':_0x286497[_0x7cbc('0x8b')]['id']}})[_0x7cbc('0x28')](handleEntityNotFound(_0x59a644,null))['then'](removeEntity(_0x59a644,null))[_0x7cbc('0x8c')](handleError(_0x59a644,null));};exports[_0x7cbc('0x8d')]=function(_0x52627d,_0x1c0343){return db['CmContact'][_0x7cbc('0x8d')]()[_0x7cbc('0x28')](function(_0x418de4){delete _0x418de4['tags'];for(var _0x111d38=0x0;_0x111d38{}\s\\|]/g,'-');_0x2b2856(null,util[_0xe051('0x22')](_0xe051('0x23'),path[_0xe051('0x24')](_0x236a69['originalname'],path[_0xe051('0x25')](_0x236a69[_0xe051('0x20')])),Date['now'](),path[_0xe051('0x25')](_0x236a69[_0xe051('0x20')])));}})});router[_0xe051('0x18')](_0xe051('0x26'),upload[_0xe051('0x27')]('file'),controller[_0xe051('0x28')]);var upload=multer({'storage':multer[_0xe051('0x1c')]({'destination':function(_0x1af76c,_0x113f67,_0x3e57de){_0x3e57de(null,path[_0xe051('0x1d')](config[_0xe051('0x1e')],_0xe051('0x1f')));},'filename':function(_0x52c7fe,_0x16b826,_0x1f19ce){_0x16b826['originalname']=_0x16b826[_0xe051('0x20')][_0xe051('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f19ce(null,util[_0xe051('0x22')](_0xe051('0x23'),path[_0xe051('0x24')](_0x16b826['originalname'],path[_0xe051('0x25')](_0x16b826['originalname'])),Date['now'](),path[_0xe051('0x25')](_0x16b826['originalname'])));}})});router[_0xe051('0x18')](_0xe051('0x29'),upload[_0xe051('0x27')]('file'),controller[_0xe051('0x2a')]);router[_0xe051('0x18')](_0xe051('0x2b'),auth[_0xe051('0x7')](),controller[_0xe051('0x2c')]);router['put'](_0xe051('0xa'),auth[_0xe051('0x7')](),controller[_0xe051('0x2d')]);router[_0xe051('0x2e')](_0xe051('0xa'),auth['isAuthenticated'](),controller[_0xe051('0x2f')]);module[_0xe051('0x30')]=router; \ No newline at end of file +var _0x701b=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/:id','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','getJourney','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','single','uploadCsv','root','server/files/tmp','now','/upload','file','upload','/upload/:id','import'];(function(_0x36c9ff,_0x3dbb60){var _0x1b7229=function(_0x1d5225){while(--_0x1d5225){_0x36c9ff['push'](_0x36c9ff['shift']());}};_0x1b7229(++_0x3dbb60);}(_0x701b,0x1d9));var _0xb701=function(_0x7205ea,_0xe27677){_0x7205ea=_0x7205ea-0x0;var _0x29f6ec=_0x701b[_0x7205ea];return _0x29f6ec;};'use strict';var multer=require(_0xb701('0x0'));var util=require(_0xb701('0x1'));var path=require(_0xb701('0x2'));var timeout=require(_0xb701('0x3'));var express=require(_0xb701('0x4'));var router=express[_0xb701('0x5')]();var fs_extra=require(_0xb701('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb701('0x7'));var controller=require(_0xb701('0x8'));router[_0xb701('0x9')]('/',auth[_0xb701('0xa')](),controller[_0xb701('0xb')]);router[_0xb701('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xb701('0x9')](_0xb701('0xc'),auth[_0xb701('0xa')](),controller[_0xb701('0xd')]);router['get'](_0xb701('0xe'),auth[_0xb701('0xa')](),controller[_0xb701('0xf')]);router[_0xb701('0x9')]('/:id/hoppers',auth[_0xb701('0xa')](),controller[_0xb701('0x10')]);router[_0xb701('0x9')](_0xb701('0x11'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xb701('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xb701('0x12')]);router['get'](_0xb701('0x13'),auth['isAuthenticated'](),controller[_0xb701('0x14')]);router['get']('/:id/journey',auth[_0xb701('0xa')](),controller[_0xb701('0x15')]);router[_0xb701('0x16')](_0xb701('0x17'),auth[_0xb701('0xa')](),controller[_0xb701('0x18')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb701('0x19')]);router[_0xb701('0x16')](_0xb701('0x1a'),auth['isAuthenticated'](),controller[_0xb701('0x1b')]);router[_0xb701('0x16')](_0xb701('0xe'),auth[_0xb701('0xa')](),controller[_0xb701('0x1c')]);var upload=multer({'storage':multer[_0xb701('0x1d')]({'destination':function(_0x479953,_0x15f26d,_0x18aacd){_0x18aacd(null,path[_0xb701('0x1e')](config['root'],'server/files/tmp'));},'filename':function(_0x26b7f3,_0x55e310,_0x5d141f){_0x55e310[_0xb701('0x1f')]=_0x55e310['originalname'][_0xb701('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5d141f(null,util[_0xb701('0x21')](_0xb701('0x22'),path[_0xb701('0x23')](_0x55e310['originalname'],path[_0xb701('0x24')](_0x55e310[_0xb701('0x1f')])),Date['now'](),path[_0xb701('0x24')](_0x55e310[_0xb701('0x1f')])));}})});router['post']('/csv',upload[_0xb701('0x25')]('file'),controller[_0xb701('0x26')]);var upload=multer({'storage':multer[_0xb701('0x1d')]({'destination':function(_0x3d804b,_0x2e98c5,_0x180711){_0x180711(null,path['join'](config[_0xb701('0x27')],_0xb701('0x28')));},'filename':function(_0x52bfd7,_0xe87461,_0x449aad){_0xe87461[_0xb701('0x1f')]=_0xe87461[_0xb701('0x1f')][_0xb701('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x449aad(null,util[_0xb701('0x21')](_0xb701('0x22'),path[_0xb701('0x23')](_0xe87461[_0xb701('0x1f')],path[_0xb701('0x24')](_0xe87461[_0xb701('0x1f')])),Date[_0xb701('0x29')](),path['extname'](_0xe87461[_0xb701('0x1f')])));}})});router[_0xb701('0x16')](_0xb701('0x2a'),upload['single'](_0xb701('0x2b')),controller[_0xb701('0x2c')]);router[_0xb701('0x16')](_0xb701('0x2d'),auth['isAuthenticated'](),controller[_0xb701('0x2e')]);router[_0xb701('0x2f')](_0xb701('0xc'),auth[_0xb701('0xa')](),controller[_0xb701('0x30')]);router[_0xb701('0x31')]('/:id',auth[_0xb701('0xa')](),controller[_0xb701('0x32')]);module[_0xb701('0x33')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c98f435..7b08ed9 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 _0xbe80=['lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','select','parse','values','stringify','voice','sequelize'];(function(_0x3feec6,_0x4db012){var _0x56d5e2=function(_0x108629){while(--_0x108629){_0x3feec6['push'](_0x3feec6['shift']());}};_0x56d5e2(++_0x4db012);}(_0xbe80,0xc2));var _0x0be8=function(_0xbc9925,_0x4efe6c){_0xbc9925=_0xbc9925-0x0;var _0x251700=_0xbe80[_0xbc9925];return _0x251700;};'use strict';var Sequelize=require(_0x0be8('0x0'));var _=require(_0x0be8('0x1'));module[_0x0be8('0x2')]={'name':{'type':Sequelize[_0x0be8('0x3')],'get':function(_0x577890){return this[_0x0be8('0x4')](_0x0be8('0x5'));}},'alias':{'type':Sequelize[_0x0be8('0x6')],'allowNull':![],'set':function(_0x5979ce){this[_0x0be8('0x7')](_0x0be8('0x5'),_0x5979ce?_0x5979ce:this[_0x0be8('0x4')]('name'));}},'type':{'type':Sequelize[_0x0be8('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x0be8('0x8')](_0x0be8('0x9')),'get':function(){if(this[_0x0be8('0x4')]('type')===_0x0be8('0xa')){return JSON[_0x0be8('0xb')](this[_0x0be8('0x4')](_0x0be8('0xc')));}else{return this[_0x0be8('0x4')]('values');}},'set':function(_0x229b65){if(Array['isArray'](_0x229b65)){this[_0x0be8('0x7')](_0x0be8('0xc'),JSON[_0x0be8('0xd')](_0x229b65));}else{this['setDataValue'](_0x0be8('0xc'),_0x229b65);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x0be8('0xe'))}}; \ No newline at end of file +var _0xda04=['select','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long'];(function(_0x1a3ca2,_0xe144e7){var _0x30ea08=function(_0x37a9f6){while(--_0x37a9f6){_0x1a3ca2['push'](_0x1a3ca2['shift']());}};_0x30ea08(++_0xe144e7);}(_0xda04,0x6c));var _0x4da0=function(_0x13b0bd,_0x4a7ac5){_0x13b0bd=_0x13b0bd-0x0;var _0x16f517=_0xda04[_0x13b0bd];return _0x16f517;};'use strict';var Sequelize=require(_0x4da0('0x0'));var _=require(_0x4da0('0x1'));module[_0x4da0('0x2')]={'name':{'type':Sequelize[_0x4da0('0x3')],'get':function(_0x15f7ac){return this[_0x4da0('0x4')](_0x4da0('0x5'));}},'alias':{'type':Sequelize[_0x4da0('0x6')],'allowNull':![],'set':function(_0x270896){this[_0x4da0('0x7')](_0x4da0('0x5'),_0x270896?_0x270896:this['getDataValue'](_0x4da0('0x8')));}},'type':{'type':Sequelize[_0x4da0('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x4da0('0x9')](_0x4da0('0xa')),'get':function(){if(this[_0x4da0('0x4')]('type')===_0x4da0('0xb')){return JSON['parse'](this[_0x4da0('0x4')](_0x4da0('0xc')));}else{return this[_0x4da0('0x4')](_0x4da0('0xc'));}},'set':function(_0x3896fe){if(Array['isArray'](_0x3896fe)){this[_0x4da0('0x7')](_0x4da0('0xc'),JSON[_0x4da0('0xd')](_0x3896fe));}else{this[_0x4da0('0x7')](_0x4da0('0xc'),_0x3896fe);}}},'required':{'type':Sequelize[_0x4da0('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4da0('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x4da0('0xf')](_0x4da0('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 711088e..80ab13d 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 _0x8fdd=['querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','update','body','find','create','sequelize','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5c954d,_0x4e2836){var _0x340d4f=function(_0x559ccf){while(--_0x559ccf){_0x5c954d['push'](_0x5c954d['shift']());}};_0x340d4f(++_0x4e2836);}(_0x8fdd,0x13f));var _0xd8fd=function(_0x2803dc,_0x1cdaf1){_0x2803dc=_0x2803dc-0x0;var _0x552ae4=_0x8fdd[_0x2803dc];return _0x552ae4;};'use strict';var emlformat=require(_0xd8fd('0x0'));var rimraf=require(_0xd8fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd8fd('0x2'));var BPromise=require(_0xd8fd('0x3'));var Mustache=require('mustache');var util=require(_0xd8fd('0x4'));var path=require(_0xd8fd('0x5'));var sox=require('sox');var csv=require(_0xd8fd('0x6'));var ejs=require(_0xd8fd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8fd('0x8'));var squel=require(_0xd8fd('0x9'));var crypto=require(_0xd8fd('0xa'));var jsforce=require(_0xd8fd('0xb'));var deskjs=require(_0xd8fd('0xc'));var toCsv=require(_0xd8fd('0x6'));var querystring=require(_0xd8fd('0xd'));var Papa=require(_0xd8fd('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd8fd('0xf'));var hardwareService=require(_0xd8fd('0x10'));var logger=require(_0xd8fd('0x11'))(_0xd8fd('0x12'));var utils=require(_0xd8fd('0x13'));var config=require(_0xd8fd('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59c7f0,_0x47647f){_0x47647f=_0x47647f||0xcc;return function(_0x1d3669){if(_0x1d3669){return _0x59c7f0[_0xd8fd('0x15')](_0x47647f);}return _0x59c7f0[_0xd8fd('0x16')](_0x47647f)[_0xd8fd('0x17')]();};}function respondWithResult(_0x222556,_0x3e5eb5){_0x3e5eb5=_0x3e5eb5||0xc8;return function(_0x1564f7){if(_0x1564f7){return _0x222556['status'](_0x3e5eb5)[_0xd8fd('0x18')](_0x1564f7);}};}function respondWithFilteredResult(_0x1a8f54,_0x46985a){return function(_0xe40d2a){if(_0xe40d2a){var _0xc62ee2=typeof _0x46985a[_0xd8fd('0x19')]===_0xd8fd('0x1a')&&typeof _0x46985a['limit']===_0xd8fd('0x1a');var _0x37d10c=_0xe40d2a[_0xd8fd('0x1b')];var _0x3a854e=_0xc62ee2?0x0:_0x46985a[_0xd8fd('0x19')];var _0x13b7ed=_0xc62ee2?_0xe40d2a[_0xd8fd('0x1b')]:_0x46985a[_0xd8fd('0x19')]+_0x46985a[_0xd8fd('0x1c')];var _0x156744;if(_0x13b7ed>=_0x37d10c){_0x13b7ed=_0x37d10c;_0x156744=0xc8;}else{_0x156744=0xce;}_0x1a8f54[_0xd8fd('0x16')](_0x156744);return _0x1a8f54[_0xd8fd('0x1d')](_0xd8fd('0x1e'),_0x3a854e+'-'+_0x13b7ed+'/'+_0x37d10c)['json'](_0xe40d2a);}return null;};}function patchUpdates(_0x4f3120){return function(_0x4a5476){try{jsonpatch[_0xd8fd('0x1f')](_0x4a5476,_0x4f3120,!![]);}catch(_0x546622){return BPromise[_0xd8fd('0x20')](_0x546622);}return _0x4a5476['save']();};}function saveUpdates(_0x1eb723,_0x4bcd64){return function(_0x339277){if(_0x339277){return _0x339277['update'](_0x1eb723)[_0xd8fd('0x21')](function(_0x4ddc07){return _0x4ddc07;});}return null;};}function removeEntity(_0x3676b2,_0x2fd68c){return function(_0x342ff0){if(_0x342ff0){return _0x342ff0[_0xd8fd('0x22')]()['then'](function(){_0x3676b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ce42,_0x2db422){return function(_0xf6c9bf){if(!_0xf6c9bf){_0x55ce42['sendStatus'](0x194);}return _0xf6c9bf;};}function handleError(_0x1bde2f,_0x472090){_0x472090=_0x472090||0x1f4;return function(_0x21b848){logger['error'](_0x21b848[_0xd8fd('0x23')]);if(_0x21b848[_0xd8fd('0x24')]){delete _0x21b848[_0xd8fd('0x24')];}_0x1bde2f[_0xd8fd('0x16')](_0x472090)[_0xd8fd('0x25')](_0x21b848);};}exports['index']=function(_0x3d82be,_0x1450cb){var _0x586268={},_0x1e18fe={},_0x26b6b2={'count':0x0,'rows':[]};var _0x2ca848=_[_0xd8fd('0x26')](db[_0xd8fd('0x27')][_0xd8fd('0x28')],function(_0x538e90){return{'name':_0x538e90[_0xd8fd('0x29')],'type':_0x538e90[_0xd8fd('0x2a')][_0xd8fd('0x2b')]};});_0x1e18fe[_0xd8fd('0x2c')]=_['differenceBy'](_[_0xd8fd('0x26')](_0x2ca848,_0xd8fd('0x24')),[_0xd8fd('0x24')]);_0x1e18fe['query']=_['keys'](_0x3d82be[_0xd8fd('0x2d')]);_0x1e18fe[_0xd8fd('0x2e')]=_[_0xd8fd('0x2f')](_0x1e18fe['model'],_0x1e18fe[_0xd8fd('0x2d')]);_0x586268['attributes']=_[_0xd8fd('0x2f')](_0x1e18fe[_0xd8fd('0x2c')],qs[_0xd8fd('0x30')](_0x3d82be['query'][_0xd8fd('0x30')]));_0x586268[_0xd8fd('0x31')]=_0x586268[_0xd8fd('0x31')][_0xd8fd('0x32')]?_0x586268[_0xd8fd('0x31')]:_0x1e18fe['model'];if(!_0x3d82be['query'][_0xd8fd('0x33')](_0xd8fd('0x34'))){_0x586268[_0xd8fd('0x1c')]=qs['limit'](_0x3d82be[_0xd8fd('0x2d')][_0xd8fd('0x1c')]);_0x586268[_0xd8fd('0x19')]=qs[_0xd8fd('0x19')](_0x3d82be[_0xd8fd('0x2d')][_0xd8fd('0x19')]);}_0x586268[_0xd8fd('0x35')]=qs['sort'](_0x3d82be[_0xd8fd('0x2d')][_0xd8fd('0x36')]);_0x586268[_0xd8fd('0x37')]=qs[_0xd8fd('0x2e')](_['pick'](_0x3d82be['query'],_0x1e18fe[_0xd8fd('0x2e')]),_0x2ca848);if(_0x3d82be[_0xd8fd('0x2d')]['filter']){_0x586268[_0xd8fd('0x37')]=_[_0xd8fd('0x38')](_0x586268[_0xd8fd('0x37')],{'$or':_['map'](_0x2ca848,function(_0x4a4793){if(_0x4a4793[_0xd8fd('0x2a')]!==_0xd8fd('0x39')){var _0x181dd9={};_0x181dd9[_0x4a4793[_0xd8fd('0x24')]]={'$like':'%'+_0x3d82be['query'][_0xd8fd('0x3a')]+'%'};return _0x181dd9;}})});}_0x586268=_[_0xd8fd('0x38')]({},_0x586268,_0x3d82be[_0xd8fd('0x3b')]);var _0x2b512b={'where':_0x586268[_0xd8fd('0x37')]};return db[_0xd8fd('0x27')]['count'](_0x2b512b)[_0xd8fd('0x21')](function(_0x2a294e){_0x26b6b2[_0xd8fd('0x1b')]=_0x2a294e;if(_0x3d82be[_0xd8fd('0x2d')][_0xd8fd('0x3c')]){_0x586268[_0xd8fd('0x3d')]=[{'all':!![]}];}return db['CmCustomField'][_0xd8fd('0x3e')](_0x586268);})['then'](function(_0x506e99){_0x26b6b2[_0xd8fd('0x3f')]=_0x506e99;return _0x26b6b2;})['then'](respondWithFilteredResult(_0x1450cb,_0x586268))[_0xd8fd('0x40')](handleError(_0x1450cb,null));};exports[_0xd8fd('0x41')]=function(_0x3ff8d6,_0x4722f){var _0x123a67={'raw':!![],'where':{'id':_0x3ff8d6[_0xd8fd('0x42')]['id']}},_0x1fdb0a={};_0x1fdb0a[_0xd8fd('0x2c')]=_[_0xd8fd('0x43')](db[_0xd8fd('0x27')][_0xd8fd('0x28')]);_0x1fdb0a[_0xd8fd('0x2d')]=_[_0xd8fd('0x43')](_0x3ff8d6['query']);_0x1fdb0a[_0xd8fd('0x2e')]=_['intersection'](_0x1fdb0a['model'],_0x1fdb0a[_0xd8fd('0x2d')]);_0x123a67[_0xd8fd('0x31')]=_[_0xd8fd('0x2f')](_0x1fdb0a[_0xd8fd('0x2c')],qs['fields'](_0x3ff8d6[_0xd8fd('0x2d')]['fields']));_0x123a67[_0xd8fd('0x31')]=_0x123a67[_0xd8fd('0x31')][_0xd8fd('0x32')]?_0x123a67[_0xd8fd('0x31')]:_0x1fdb0a['model'];if(_0x3ff8d6[_0xd8fd('0x2d')][_0xd8fd('0x3c')]){_0x123a67['include']=[{'all':!![]}];}_0x123a67=_[_0xd8fd('0x38')]({},_0x123a67,_0x3ff8d6[_0xd8fd('0x3b')]);return db[_0xd8fd('0x27')]['find'](_0x123a67)[_0xd8fd('0x21')](handleEntityNotFound(_0x4722f,null))[_0xd8fd('0x21')](respondWithResult(_0x4722f,null))[_0xd8fd('0x40')](handleError(_0x4722f,null));};exports[_0xd8fd('0x44')]=function(_0x720686,_0x547cff){if(_0x720686[_0xd8fd('0x45')]['id']){delete _0x720686[_0xd8fd('0x45')]['id'];}return db[_0xd8fd('0x27')][_0xd8fd('0x46')]({'where':{'id':_0x720686[_0xd8fd('0x42')]['id']}})['then'](handleEntityNotFound(_0x547cff,null))[_0xd8fd('0x21')](saveUpdates(_0x720686['body'],null))[_0xd8fd('0x21')](respondWithResult(_0x547cff,null))[_0xd8fd('0x40')](handleError(_0x547cff,null));};exports[_0xd8fd('0x22')]=function(_0x2a98ad,_0xf080a0){return db[_0xd8fd('0x27')][_0xd8fd('0x46')]({'where':{'id':_0x2a98ad['params']['id']}})[_0xd8fd('0x21')](handleEntityNotFound(_0xf080a0,null))[_0xd8fd('0x21')](removeEntity(_0xf080a0,null))[_0xd8fd('0x40')](handleError(_0xf080a0,null));};exports[_0xd8fd('0x47')]=function(_0x212243,_0x9c53cb){var _0x586e00;return db[_0xd8fd('0x48')]['transaction'](function(_0x244a0a){return db[_0xd8fd('0x27')]['create'](_0x212243[_0xd8fd('0x45')],{'transaction':_0x244a0a})[_0xd8fd('0x21')](function(_0x4c65cb){_0x586e00=_0x4c65cb;var _0x4cdad0={'type':db[_0xd8fd('0x49')]['TEXT'],'transaction':_0x244a0a};switch(_0x212243[_0xd8fd('0x45')][_0xd8fd('0x2a')]){case'text':_0x4cdad0['type']=db['Sequelize'][_0xd8fd('0x4a')];break;case'number':_0x4cdad0['type']=db[_0xd8fd('0x49')][_0xd8fd('0x4b')];break;case _0xd8fd('0x4c'):_0x4cdad0[_0xd8fd('0x2a')]=db[_0xd8fd('0x49')][_0xd8fd('0x4d')];_0x4cdad0[_0xd8fd('0x4e')]=![];break;default:}return db[_0xd8fd('0x48')][_0xd8fd('0x4f')]['addColumn'](_0xd8fd('0x50'),util[_0xd8fd('0x51')](_0xd8fd('0x52'),_0x586e00['id']),_0x4cdad0);})[_0xd8fd('0x21')](function(){return _0x586e00;});})[_0xd8fd('0x21')](respondWithResult(_0x9c53cb,0xc9))[_0xd8fd('0x40')](handleError(_0x9c53cb,null));}; \ No newline at end of file +var _0x2f15=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','body','find','destroy','transaction','create','TEXT','Sequelize','number','sequelize','addColumn','cm_contacts','format','cf_%d','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters'];(function(_0xf1af27,_0x598bb1){var _0x46b274=function(_0x1dba43){while(--_0x1dba43){_0xf1af27['push'](_0xf1af27['shift']());}};_0x46b274(++_0x598bb1);}(_0x2f15,0x1cf));var _0x52f1=function(_0x1dc256,_0x3c239c){_0x1dc256=_0x1dc256-0x0;var _0x3f6cdd=_0x2f15[_0x1dc256];return _0x3f6cdd;};'use strict';var emlformat=require(_0x52f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x52f1('0x1'));var jsonpatch=require(_0x52f1('0x2'));var rp=require(_0x52f1('0x3'));var moment=require(_0x52f1('0x4'));var BPromise=require(_0x52f1('0x5'));var Mustache=require(_0x52f1('0x6'));var util=require('util');var path=require(_0x52f1('0x7'));var sox=require(_0x52f1('0x8'));var csv=require('to-csv');var ejs=require(_0x52f1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x52f1('0xa'));var crypto=require(_0x52f1('0xb'));var jsforce=require(_0x52f1('0xc'));var deskjs=require(_0x52f1('0xd'));var toCsv=require(_0x52f1('0xe'));var querystring=require(_0x52f1('0xf'));var Papa=require(_0x52f1('0x10'));var Redis=require(_0x52f1('0x11'));var authService=require(_0x52f1('0x12'));var qs=require(_0x52f1('0x13'));var as=require(_0x52f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52f1('0x15'))('api');var utils=require(_0x52f1('0x16'));var config=require(_0x52f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d1b3c,_0x1b2586){_0x1b2586=_0x1b2586||0xcc;return function(_0x43337d){if(_0x43337d){return _0x2d1b3c[_0x52f1('0x18')](_0x1b2586);}return _0x2d1b3c[_0x52f1('0x19')](_0x1b2586)[_0x52f1('0x1a')]();};}function respondWithResult(_0x17e132,_0x4ff39e){_0x4ff39e=_0x4ff39e||0xc8;return function(_0x4b021b){if(_0x4b021b){return _0x17e132[_0x52f1('0x19')](_0x4ff39e)['json'](_0x4b021b);}};}function respondWithFilteredResult(_0x3d6c8c,_0x107686){return function(_0x5003bf){if(_0x5003bf){var _0x295c73=typeof _0x107686[_0x52f1('0x1b')]===_0x52f1('0x1c')&&typeof _0x107686[_0x52f1('0x1d')]===_0x52f1('0x1c');var _0x4dac36=_0x5003bf[_0x52f1('0x1e')];var _0x3095d6=_0x295c73?0x0:_0x107686[_0x52f1('0x1b')];var _0x57b283=_0x295c73?_0x5003bf[_0x52f1('0x1e')]:_0x107686[_0x52f1('0x1b')]+_0x107686[_0x52f1('0x1d')];var _0x1099cc;if(_0x57b283>=_0x4dac36){_0x57b283=_0x4dac36;_0x1099cc=0xc8;}else{_0x1099cc=0xce;}_0x3d6c8c['status'](_0x1099cc);return _0x3d6c8c[_0x52f1('0x1f')]('Content-Range',_0x3095d6+'-'+_0x57b283+'/'+_0x4dac36)[_0x52f1('0x20')](_0x5003bf);}return null;};}function patchUpdates(_0x1739a5){return function(_0xb735e1){try{jsonpatch[_0x52f1('0x21')](_0xb735e1,_0x1739a5,!![]);}catch(_0xceb99a){return BPromise[_0x52f1('0x22')](_0xceb99a);}return _0xb735e1[_0x52f1('0x23')]();};}function saveUpdates(_0x1b5360,_0x47401a){return function(_0xca93f4){if(_0xca93f4){return _0xca93f4[_0x52f1('0x24')](_0x1b5360)['then'](function(_0x475d00){return _0x475d00;});}return null;};}function removeEntity(_0x21c571,_0x4d2845){return function(_0x249f10){if(_0x249f10){return _0x249f10['destroy']()[_0x52f1('0x25')](function(){_0x21c571['status'](0xcc)[_0x52f1('0x1a')]();});}};}function handleEntityNotFound(_0x1fec46,_0x28d67d){return function(_0x4d0f8f){if(!_0x4d0f8f){_0x1fec46[_0x52f1('0x18')](0x194);}return _0x4d0f8f;};}function handleError(_0x476921,_0x1c0f2b){_0x1c0f2b=_0x1c0f2b||0x1f4;return function(_0x15e228){logger[_0x52f1('0x26')](_0x15e228[_0x52f1('0x27')]);if(_0x15e228[_0x52f1('0x28')]){delete _0x15e228[_0x52f1('0x28')];}_0x476921['status'](_0x1c0f2b)[_0x52f1('0x29')](_0x15e228);};}exports[_0x52f1('0x2a')]=function(_0x47345d,_0x39a29b){var _0x5a65e2={},_0x439da4={},_0x1c2810={'count':0x0,'rows':[]};var _0x1a92e7=_[_0x52f1('0x2b')](db[_0x52f1('0x2c')][_0x52f1('0x2d')],function(_0x5619b5){return{'name':_0x5619b5[_0x52f1('0x2e')],'type':_0x5619b5[_0x52f1('0x2f')][_0x52f1('0x30')]};});_0x439da4['model']=_[_0x52f1('0x31')](_['map'](_0x1a92e7,_0x52f1('0x28')),[_0x52f1('0x28')]);_0x439da4[_0x52f1('0x32')]=_[_0x52f1('0x33')](_0x47345d[_0x52f1('0x32')]);_0x439da4[_0x52f1('0x34')]=_[_0x52f1('0x35')](_0x439da4[_0x52f1('0x36')],_0x439da4[_0x52f1('0x32')]);_0x5a65e2['attributes']=_['intersection'](_0x439da4['model'],qs[_0x52f1('0x37')](_0x47345d[_0x52f1('0x32')][_0x52f1('0x37')]));_0x5a65e2[_0x52f1('0x38')]=_0x5a65e2['attributes'][_0x52f1('0x39')]?_0x5a65e2[_0x52f1('0x38')]:_0x439da4[_0x52f1('0x36')];if(!_0x47345d[_0x52f1('0x32')][_0x52f1('0x3a')](_0x52f1('0x3b'))){_0x5a65e2[_0x52f1('0x1d')]=qs['limit'](_0x47345d[_0x52f1('0x32')][_0x52f1('0x1d')]);_0x5a65e2[_0x52f1('0x1b')]=qs[_0x52f1('0x1b')](_0x47345d[_0x52f1('0x32')]['offset']);}_0x5a65e2[_0x52f1('0x3c')]=qs[_0x52f1('0x3d')](_0x47345d[_0x52f1('0x32')][_0x52f1('0x3d')]);_0x5a65e2['where']=qs[_0x52f1('0x34')](_[_0x52f1('0x3e')](_0x47345d['query'],_0x439da4['filters']),_0x1a92e7);if(_0x47345d['query'][_0x52f1('0x3f')]){_0x5a65e2[_0x52f1('0x40')]=_[_0x52f1('0x41')](_0x5a65e2[_0x52f1('0x40')],{'$or':_[_0x52f1('0x2b')](_0x1a92e7,function(_0x240fb0){if(_0x240fb0[_0x52f1('0x2f')]!==_0x52f1('0x42')){var _0x4d92d8={};_0x4d92d8[_0x240fb0['name']]={'$like':'%'+_0x47345d[_0x52f1('0x32')][_0x52f1('0x3f')]+'%'};return _0x4d92d8;}})});}_0x5a65e2=_[_0x52f1('0x41')]({},_0x5a65e2,_0x47345d['options']);var _0x2d56fc={'where':_0x5a65e2[_0x52f1('0x40')]};return db[_0x52f1('0x2c')][_0x52f1('0x1e')](_0x2d56fc)[_0x52f1('0x25')](function(_0x1d8955){_0x1c2810['count']=_0x1d8955;if(_0x47345d[_0x52f1('0x32')][_0x52f1('0x43')]){_0x5a65e2['include']=[{'all':!![]}];}return db[_0x52f1('0x2c')][_0x52f1('0x44')](_0x5a65e2);})[_0x52f1('0x25')](function(_0x134488){_0x1c2810[_0x52f1('0x45')]=_0x134488;return _0x1c2810;})[_0x52f1('0x25')](respondWithFilteredResult(_0x39a29b,_0x5a65e2))[_0x52f1('0x46')](handleError(_0x39a29b,null));};exports['show']=function(_0x124307,_0x4b9f37){var _0x4bf7e0={'raw':!![],'where':{'id':_0x124307[_0x52f1('0x47')]['id']}},_0x3c6e33={};_0x3c6e33['model']=_['keys'](db[_0x52f1('0x2c')][_0x52f1('0x2d')]);_0x3c6e33[_0x52f1('0x32')]=_['keys'](_0x124307[_0x52f1('0x32')]);_0x3c6e33[_0x52f1('0x34')]=_[_0x52f1('0x35')](_0x3c6e33['model'],_0x3c6e33[_0x52f1('0x32')]);_0x4bf7e0[_0x52f1('0x38')]=_[_0x52f1('0x35')](_0x3c6e33[_0x52f1('0x36')],qs[_0x52f1('0x37')](_0x124307[_0x52f1('0x32')][_0x52f1('0x37')]));_0x4bf7e0[_0x52f1('0x38')]=_0x4bf7e0[_0x52f1('0x38')]['length']?_0x4bf7e0[_0x52f1('0x38')]:_0x3c6e33[_0x52f1('0x36')];if(_0x124307['query']['includeAll']){_0x4bf7e0[_0x52f1('0x48')]=[{'all':!![]}];}_0x4bf7e0=_[_0x52f1('0x41')]({},_0x4bf7e0,_0x124307['options']);return db['CmCustomField']['find'](_0x4bf7e0)['then'](handleEntityNotFound(_0x4b9f37,null))[_0x52f1('0x25')](respondWithResult(_0x4b9f37,null))[_0x52f1('0x46')](handleError(_0x4b9f37,null));};exports['update']=function(_0x1da420,_0x3bb1c0){if(_0x1da420['body']['id']){delete _0x1da420[_0x52f1('0x49')]['id'];}return db[_0x52f1('0x2c')][_0x52f1('0x4a')]({'where':{'id':_0x1da420[_0x52f1('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bb1c0,null))['then'](saveUpdates(_0x1da420['body'],null))[_0x52f1('0x25')](respondWithResult(_0x3bb1c0,null))[_0x52f1('0x46')](handleError(_0x3bb1c0,null));};exports[_0x52f1('0x4b')]=function(_0x37320d,_0x503285){return db[_0x52f1('0x2c')][_0x52f1('0x4a')]({'where':{'id':_0x37320d[_0x52f1('0x47')]['id']}})[_0x52f1('0x25')](handleEntityNotFound(_0x503285,null))[_0x52f1('0x25')](removeEntity(_0x503285,null))[_0x52f1('0x46')](handleError(_0x503285,null));};exports['create']=function(_0x14b09d,_0x3d55dc){var _0x2c40cb;return db['sequelize'][_0x52f1('0x4c')](function(_0x3b339c){return db[_0x52f1('0x2c')][_0x52f1('0x4d')](_0x14b09d['body'],{'transaction':_0x3b339c})[_0x52f1('0x25')](function(_0x4589d0){_0x2c40cb=_0x4589d0;var _0xc785f9={'type':db['Sequelize'][_0x52f1('0x4e')],'transaction':_0x3b339c};switch(_0x14b09d[_0x52f1('0x49')]['type']){case'text':_0xc785f9[_0x52f1('0x2f')]=db[_0x52f1('0x4f')][_0x52f1('0x4e')];break;case _0x52f1('0x50'):_0xc785f9['type']=db[_0x52f1('0x4f')]['INTEGER'];break;case'switch':_0xc785f9['type']=db[_0x52f1('0x4f')]['BOOLEAN'];_0xc785f9['defaultValue']=![];break;default:}return db[_0x52f1('0x51')]['queryInterface'][_0x52f1('0x52')](_0x52f1('0x53'),util[_0x52f1('0x54')](_0x52f1('0x55'),_0x2c40cb['id']),_0xc785f9);})[_0x52f1('0x25')](function(){return _0x2c40cb;});})[_0x52f1('0x25')](respondWithResult(_0x3d55dc,0xc9))[_0x52f1('0x46')](handleError(_0x3d55dc,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index f88a454..0e1749b 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 _0xca5b=['moment','bluebird','path','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x4d8e8f,_0x51c230){var _0x51ddbb=function(_0x5a4652){while(--_0x5a4652){_0x4d8e8f['push'](_0x4d8e8f['shift']());}};_0x51ddbb(++_0x51c230);}(_0xca5b,0x1de));var _0xbca5=function(_0xaff1bd,_0x5380c4){_0xaff1bd=_0xaff1bd-0x0;var _0x52ad89=_0xca5b[_0xaff1bd];return _0x52ad89;};'use strict';var _=require(_0xbca5('0x0'));var util=require(_0xbca5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbca5('0x2'));var BPromise=require(_0xbca5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbca5('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbca5('0x5'));module[_0xbca5('0x6')]=function(_0x2397a9,_0x330336){return _0x2397a9[_0xbca5('0x7')](_0xbca5('0x8'),attributes,{'tableName':_0xbca5('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x087a=['CmCustomField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define'];(function(_0x1ad0b4,_0x3638f4){var _0x42f563=function(_0x5a886e){while(--_0x5a886e){_0x1ad0b4['push'](_0x1ad0b4['shift']());}};_0x42f563(++_0x3638f4);}(_0x087a,0xd1));var _0xa087=function(_0x45cb88,_0x197aa9){_0x45cb88=_0x45cb88-0x0;var _0x3890a5=_0x087a[_0x45cb88];return _0x3890a5;};'use strict';var _=require(_0xa087('0x0'));var util=require(_0xa087('0x1'));var logger=require(_0xa087('0x2'))(_0xa087('0x3'));var moment=require(_0xa087('0x4'));var BPromise=require('bluebird');var rp=require(_0xa087('0x5'));var fs=require('fs');var path=require(_0xa087('0x6'));var rimraf=require(_0xa087('0x7'));var config=require(_0xa087('0x8'));var attributes=require(_0xa087('0x9'));module[_0xa087('0xa')]=function(_0x6a8d79,_0x12845d){return _0x6a8d79[_0xa087('0xb')](_0xa087('0xc'),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 d6f390f..212eea6 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 _0x699f=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x234499,_0x54c36e){var _0x482c7f=function(_0x11b313){while(--_0x11b313){_0x234499['push'](_0x234499['shift']());}};_0x482c7f(++_0x54c36e);}(_0x699f,0x124));var _0xf699=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x699f[_0x220afa];return _0x1b79d1;};'use strict';var _=require(_0xf699('0x0'));var util=require('util');var moment=require(_0xf699('0x1'));var BPromise=require(_0xf699('0x2'));var rs=require(_0xf699('0x3'));var fs=require('fs');var Redis=require(_0xf699('0x4'));var db=require(_0xf699('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf699('0x6'))('rpc');var config=require(_0xf699('0x7'));var jayson=require(_0xf699('0x8'));var client=jayson[_0xf699('0x9')][_0xf699('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a7a51,_0x32578a,_0x575e74){return new BPromise(function(_0x2c6714,_0x2261c9){return client[_0xf699('0xb')](_0x5a7a51,_0x575e74)[_0xf699('0xc')](function(_0x25c8af){logger[_0xf699('0xd')](_0xf699('0xe'),_0x32578a,'request\x20sent');logger[_0xf699('0xf')](_0xf699('0x10'),_0x32578a,_0xf699('0x11'),JSON[_0xf699('0x12')](_0x25c8af));if(_0x25c8af[_0xf699('0x13')]){if(_0x25c8af[_0xf699('0x13')][_0xf699('0x14')]===0x1f4){logger[_0xf699('0x13')]('CmCustomField,\x20%s,\x20%s',_0x32578a,_0x25c8af[_0xf699('0x13')][_0xf699('0x15')]);return _0x2261c9(_0x25c8af[_0xf699('0x13')][_0xf699('0x15')]);}logger[_0xf699('0x13')]('CmCustomField,\x20%s,\x20%s',_0x32578a,_0x25c8af[_0xf699('0x13')][_0xf699('0x15')]);return _0x2c6714(_0x25c8af[_0xf699('0x13')]['message']);}else{logger[_0xf699('0xd')]('CmCustomField,\x20%s,\x20%s',_0x32578a,_0xf699('0x11'));_0x2c6714(_0x25c8af[_0xf699('0x16')][_0xf699('0x15')]);}})[_0xf699('0x17')](function(_0x39bf45){logger[_0xf699('0x13')](_0xf699('0xe'),_0x32578a,_0x39bf45);_0x2261c9(_0x39bf45);});});} \ No newline at end of file +var _0x5b92=['http','request','then','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b92,0x14e));var _0x25b9=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5b92[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x25b9('0x0'));var util=require('util');var moment=require(_0x25b9('0x1'));var BPromise=require('bluebird');var rs=require(_0x25b9('0x2'));var fs=require('fs');var Redis=require(_0x25b9('0x3'));var db=require(_0x25b9('0x4'))['db'];var utils=require(_0x25b9('0x5'));var logger=require(_0x25b9('0x6'))(_0x25b9('0x7'));var config=require(_0x25b9('0x8'));var jayson=require(_0x25b9('0x9'));var client=jayson[_0x25b9('0xa')][_0x25b9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x363f83,_0x2120dd,_0x167795){return new BPromise(function(_0x23b61b,_0x4a80d5){return client[_0x25b9('0xc')](_0x363f83,_0x167795)[_0x25b9('0xd')](function(_0x48c2cc){logger[_0x25b9('0xe')](_0x25b9('0xf'),_0x2120dd,'request\x20sent');logger[_0x25b9('0x10')](_0x25b9('0x11'),_0x2120dd,_0x25b9('0x12'),JSON['stringify'](_0x48c2cc));if(_0x48c2cc[_0x25b9('0x13')]){if(_0x48c2cc['error']['code']===0x1f4){logger[_0x25b9('0x13')](_0x25b9('0xf'),_0x2120dd,_0x48c2cc[_0x25b9('0x13')]['message']);return _0x4a80d5(_0x48c2cc[_0x25b9('0x13')][_0x25b9('0x14')]);}logger[_0x25b9('0x13')]('CmCustomField,\x20%s,\x20%s',_0x2120dd,_0x48c2cc[_0x25b9('0x13')]['message']);return _0x23b61b(_0x48c2cc[_0x25b9('0x13')][_0x25b9('0x14')]);}else{logger[_0x25b9('0xe')](_0x25b9('0xf'),_0x2120dd,_0x25b9('0x12'));_0x23b61b(_0x48c2cc[_0x25b9('0x15')][_0x25b9('0x14')]);}})[_0x25b9('0x16')](function(_0x30be93){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2120dd,_0x30be93);_0x4a80d5(_0x30be93);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 2f9b241..fc5b669 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 _0x2e09=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5d0e5c,_0x1eb95f){var _0x2c4bd4=function(_0x5528dd){while(--_0x5528dd){_0x5d0e5c['push'](_0x5d0e5c['shift']());}};_0x2c4bd4(++_0x1eb95f);}(_0x2e09,0xc8));var _0x92e0=function(_0x32059c,_0x94a4f8){_0x32059c=_0x32059c-0x0;var _0x3dbba2=_0x2e09[_0x32059c];return _0x3dbba2;};'use strict';var multer=require(_0x92e0('0x0'));var util=require(_0x92e0('0x1'));var path=require(_0x92e0('0x2'));var timeout=require(_0x92e0('0x3'));var express=require(_0x92e0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x92e0('0x5'));var interaction=require(_0x92e0('0x6'));var config=require(_0x92e0('0x7'));var controller=require(_0x92e0('0x8'));router[_0x92e0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x92e0('0x9')](_0x92e0('0xa'),auth[_0x92e0('0xb')](),controller['show']);router['post']('/',auth[_0x92e0('0xb')](),controller[_0x92e0('0xc')]);router[_0x92e0('0xd')]('/:id',auth[_0x92e0('0xb')](),controller[_0x92e0('0xe')]);router[_0x92e0('0xf')](_0x92e0('0xa'),auth[_0x92e0('0xb')](),controller[_0x92e0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x0d4d=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','post','create'];(function(_0x4cb99f,_0x419e77){var _0x5ba8c7=function(_0x210a6a){while(--_0x210a6a){_0x4cb99f['push'](_0x4cb99f['shift']());}};_0x5ba8c7(++_0x419e77);}(_0x0d4d,0x132));var _0xd0d4=function(_0xd293ee,_0x6df897){_0xd293ee=_0xd293ee-0x0;var _0x2d3c5b=_0x0d4d[_0xd293ee];return _0x2d3c5b;};'use strict';var multer=require(_0xd0d4('0x0'));var util=require(_0xd0d4('0x1'));var path=require(_0xd0d4('0x2'));var timeout=require(_0xd0d4('0x3'));var express=require(_0xd0d4('0x4'));var router=express[_0xd0d4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd0d4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0d4('0x7'));var controller=require(_0xd0d4('0x8'));router['get']('/',auth[_0xd0d4('0x9')](),controller[_0xd0d4('0xa')]);router[_0xd0d4('0xb')]('/:id',auth[_0xd0d4('0x9')](),controller['show']);router[_0xd0d4('0xc')]('/',auth['isAuthenticated'](),controller[_0xd0d4('0xd')]);router[_0xd0d4('0xe')](_0xd0d4('0xf'),auth['isAuthenticated'](),controller[_0xd0d4('0x10')]);router[_0xd0d4('0x11')](_0xd0d4('0xf'),auth[_0xd0d4('0x9')](),controller[_0xd0d4('0x12')]);module[_0xd0d4('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 41916c7..1fdfafe 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 _0x14a1=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports'];(function(_0x13f230,_0x5ea0a9){var _0x4aef9c=function(_0x4d4ba5){while(--_0x4d4ba5){_0x13f230['push'](_0x13f230['shift']());}};_0x4aef9c(++_0x5ea0a9);}(_0x14a1,0xf1));var _0x114a=function(_0x25dc41,_0x814bc5){_0x25dc41=_0x25dc41-0x0;var _0x4b37bf=_0x14a1[_0x25dc41];return _0x4b37bf;};'use strict';var moment=require(_0x114a('0x0'));var Sequelize=require('sequelize');module[_0x114a('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x114a('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x114a('0x3')],'defaultValue':moment()[_0x114a('0x4')](_0x114a('0x5'))},'countbusyretry':{'type':Sequelize[_0x114a('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x114a('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x114a('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x114a('0x3')]},'priority':{'type':Sequelize[_0x114a('0x6')](0x2)[_0x114a('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x114a('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x114a('0x6')],'unique':_0x114a('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x114a('0x8')},'CampaignId':{'type':Sequelize[_0x114a('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x114a('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x114a('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x114a('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x443f=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x5d375e,_0x750513){var _0x419eba=function(_0xa34ee6){while(--_0xa34ee6){_0x5d375e['push'](_0x5d375e['shift']());}};_0x419eba(++_0x750513);}(_0x443f,0x72));var _0xf443=function(_0x238f80,_0x541b39){_0x238f80=_0x238f80-0x0;var _0x6b293b=_0x443f[_0x238f80];return _0x6b293b;};'use strict';var moment=require(_0xf443('0x0'));var Sequelize=require(_0xf443('0x1'));module[_0xf443('0x2')]={'phone':{'type':Sequelize[_0xf443('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xf443('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf443('0x5')],'defaultValue':moment()[_0xf443('0x6')](_0xf443('0x7'))},'countbusyretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf443('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf443('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf443('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf443('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf443('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf443('0xa')},'ListId':{'type':Sequelize[_0xf443('0x8')],'unique':_0xf443('0xa')},'UserId':{'type':Sequelize[_0xf443('0x8')]},'VoiceQueueId':{'type':Sequelize[_0xf443('0x8')],'unique':_0xf443('0xa')},'CampaignId':{'type':Sequelize[_0xf443('0x8')]},'countnosuchnumberretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf443('0x8')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1285d7b..75fdab7 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 _0xa1a5=['order','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','length','find','create','body','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','statedesc','campaign','membername','UserId','user','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','List','Queue','dialActive','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','then','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','filters','concat','$and','$or','$gte','$lte','$ne','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','nolimit'];(function(_0x5ae910,_0x151f20){var _0x558a61=function(_0x2f6cf3){while(--_0x2f6cf3){_0x5ae910['push'](_0x5ae910['shift']());}};_0x558a61(++_0x151f20);}(_0xa1a5,0x167));var _0x5a1a=function(_0x4d8177,_0x43f42d){_0x4d8177=_0x4d8177-0x0;var _0x581aaf=_0xa1a5[_0x4d8177];return _0x581aaf;};'use strict';var emlformat=require(_0x5a1a('0x0'));var rimraf=require(_0x5a1a('0x1'));var zipdir=require(_0x5a1a('0x2'));var jsonpatch=require(_0x5a1a('0x3'));var rp=require('request-promise');var moment=require(_0x5a1a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5a1a('0x5'));var util=require(_0x5a1a('0x6'));var path=require('path');var sox=require(_0x5a1a('0x7'));var csv=require(_0x5a1a('0x8'));var ejs=require(_0x5a1a('0x9'));var fs=require('fs');var fs_extra=require(_0x5a1a('0xa'));var _=require(_0x5a1a('0xb'));var squel=require(_0x5a1a('0xc'));var crypto=require(_0x5a1a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5a1a('0xe'));var toCsv=require(_0x5a1a('0x8'));var querystring=require('querystring');var Papa=require(_0x5a1a('0xf'));var Redis=require(_0x5a1a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5a1a('0x11'));var as=require(_0x5a1a('0x12'));var hardwareService=require(_0x5a1a('0x13'));var logger=require(_0x5a1a('0x14'))(_0x5a1a('0x15'));var utils=require('../../config/utils');var config=require(_0x5a1a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a1a('0x17'))['db'];function respondWithStatusCode(_0xc5c7c7,_0x37f9d6){_0x37f9d6=_0x37f9d6||0xcc;return function(_0x2f752d){if(_0x2f752d){return _0xc5c7c7[_0x5a1a('0x18')](_0x37f9d6);}return _0xc5c7c7[_0x5a1a('0x19')](_0x37f9d6)[_0x5a1a('0x1a')]();};}function respondWithResult(_0x2229dd,_0x19b890){_0x19b890=_0x19b890||0xc8;return function(_0x4d7996){if(_0x4d7996){return _0x2229dd[_0x5a1a('0x19')](_0x19b890)[_0x5a1a('0x1b')](_0x4d7996);}};}function respondWithFilteredResult(_0x29f653,_0x204825){return function(_0x535089){if(_0x535089){var _0x710b9d=typeof _0x204825[_0x5a1a('0x1c')]===_0x5a1a('0x1d')&&typeof _0x204825[_0x5a1a('0x1e')]===_0x5a1a('0x1d');var _0xb9cb4b=_0x535089[_0x5a1a('0x1f')];var _0x23ca5b=_0x710b9d?0x0:_0x204825[_0x5a1a('0x1c')];var _0x247c01=_0x710b9d?_0x535089[_0x5a1a('0x1f')]:_0x204825[_0x5a1a('0x1c')]+_0x204825[_0x5a1a('0x1e')];var _0x4e6830;if(_0x247c01>=_0xb9cb4b){_0x247c01=_0xb9cb4b;_0x4e6830=0xc8;}else{_0x4e6830=0xce;}_0x29f653[_0x5a1a('0x19')](_0x4e6830);return _0x29f653['set']('Content-Range',_0x23ca5b+'-'+_0x247c01+'/'+_0xb9cb4b)[_0x5a1a('0x1b')](_0x535089);}return null;};}function patchUpdates(_0x45166e){return function(_0x4d9aac){try{jsonpatch['apply'](_0x4d9aac,_0x45166e,!![]);}catch(_0x5490fd){return BPromise[_0x5a1a('0x20')](_0x5490fd);}return _0x4d9aac[_0x5a1a('0x21')]();};}function saveUpdates(_0x5bc645,_0x1fd8e6){return function(_0x2a951c){if(_0x2a951c){return _0x2a951c[_0x5a1a('0x22')](_0x5bc645)['then'](function(_0x2d4c38){return _0x2d4c38;});}return null;};}function removeEntity(_0x1f5027,_0xddd6f){return function(_0x1889ee){if(_0x1889ee){return _0x1889ee[_0x5a1a('0x23')]()[_0x5a1a('0x24')](function(){_0x1f5027[_0x5a1a('0x19')](0xcc)[_0x5a1a('0x1a')]();});}};}function handleEntityNotFound(_0x25d729,_0x2c88eb){return function(_0x5e3970){if(!_0x5e3970){_0x25d729[_0x5a1a('0x18')](0x194);}return _0x5e3970;};}function handleError(_0x28db53,_0x1d3cc9){_0x1d3cc9=_0x1d3cc9||0x1f4;return function(_0x2fa35c){logger[_0x5a1a('0x25')](_0x2fa35c[_0x5a1a('0x26')]);if(_0x2fa35c['name']){delete _0x2fa35c[_0x5a1a('0x27')];}_0x28db53['status'](_0x1d3cc9)[_0x5a1a('0x28')](_0x2fa35c);};}exports[_0x5a1a('0x29')]=function(_0x519bb8,_0x202e3b){var _0x234a89={},_0x35e55e={},_0xacae41={'count':0x0,'rows':[]};var _0x59c56b=_[_0x5a1a('0x2a')](db[_0x5a1a('0x2b')][_0x5a1a('0x2c')],function(_0x3d4455){return{'name':_0x3d4455[_0x5a1a('0x2d')],'type':_0x3d4455[_0x5a1a('0x2e')][_0x5a1a('0x2f')]};});_0x35e55e[_0x5a1a('0x30')]=_[_0x5a1a('0x2a')](_0x59c56b,_0x5a1a('0x27'));_0x35e55e['query']=_['keys'](_0x519bb8[_0x5a1a('0x31')]);_0x35e55e['filters']=_['intersection'](_0x35e55e['model'],_0x35e55e[_0x5a1a('0x31')]);_0x35e55e[_0x5a1a('0x32')]=_[_0x5a1a('0x33')](_0x35e55e['filters'],[_0x5a1a('0x34'),_0x5a1a('0x35'),'$gt',_0x5a1a('0x36'),'$lt',_0x5a1a('0x37'),_0x5a1a('0x38'),'$eq',_0x5a1a('0x39'),_0x5a1a('0x3a'),'$notBetween',_0x5a1a('0x3b'),_0x5a1a('0x3c'),_0x5a1a('0x3d'),_0x5a1a('0x3e'),_0x5a1a('0x3f'),_0x5a1a('0x40'),_0x5a1a('0x3d'),_0x5a1a('0x41'),_0x5a1a('0x42'),_0x5a1a('0x43'),_0x5a1a('0x44')]);_0x234a89[_0x5a1a('0x45')]=_[_0x5a1a('0x46')](_0x35e55e[_0x5a1a('0x30')],qs[_0x5a1a('0x47')](_0x519bb8[_0x5a1a('0x31')][_0x5a1a('0x47')]));_0x234a89['attributes']=_0x234a89[_0x5a1a('0x45')]['length']?_0x234a89[_0x5a1a('0x45')]:_0x35e55e[_0x5a1a('0x30')];if(!_0x519bb8[_0x5a1a('0x31')]['hasOwnProperty'](_0x5a1a('0x48'))){_0x234a89['limit']=qs[_0x5a1a('0x1e')](_0x519bb8['query']['limit']);_0x234a89['offset']=qs[_0x5a1a('0x1c')](_0x519bb8[_0x5a1a('0x31')][_0x5a1a('0x1c')]);}_0x234a89[_0x5a1a('0x49')]=qs['sort'](_0x519bb8[_0x5a1a('0x31')]['sort']);_0x234a89[_0x5a1a('0x4a')]=qs[_0x5a1a('0x32')](_[_0x5a1a('0x4b')](_0x519bb8[_0x5a1a('0x31')],_0x35e55e[_0x5a1a('0x32')]),_0x59c56b);if(_0x519bb8[_0x5a1a('0x31')][_0x5a1a('0x4c')]){_0x234a89['where']=_[_0x5a1a('0x4d')](_0x234a89[_0x5a1a('0x4a')],{'$or':_[_0x5a1a('0x2a')](_0x59c56b,function(_0x271072){if(_0x271072[_0x5a1a('0x2e')]!=='VIRTUAL'){var _0x5b6391={};_0x5b6391[_0x271072['name']]={'$like':'%'+_0x519bb8[_0x5a1a('0x31')][_0x5a1a('0x4c')]+'%'};return _0x5b6391;}})});}_0x234a89=_[_0x5a1a('0x4d')]({},_0x234a89,_0x519bb8[_0x5a1a('0x4e')]);var _0x369fcd={'where':_0x234a89['where']};return db[_0x5a1a('0x2b')][_0x5a1a('0x1f')](_0x369fcd)['then'](function(_0x39bb34){_0xacae41[_0x5a1a('0x1f')]=_0x39bb34;if(_0x519bb8['query'][_0x5a1a('0x4f')]){_0x234a89[_0x5a1a('0x50')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x234a89);})[_0x5a1a('0x24')](function(_0x51e6b4){_0xacae41['rows']=_0x51e6b4;return _0xacae41;})[_0x5a1a('0x24')](respondWithFilteredResult(_0x202e3b,_0x234a89))[_0x5a1a('0x51')](handleError(_0x202e3b,null));};exports[_0x5a1a('0x52')]=function(_0x1b8bcd,_0x1c6f90){var _0x5cd1ed={'raw':!![],'where':{'id':_0x1b8bcd[_0x5a1a('0x53')]['id']}},_0x3bfdc1={};_0x3bfdc1['model']=_[_0x5a1a('0x54')](db[_0x5a1a('0x2b')][_0x5a1a('0x2c')]);_0x3bfdc1[_0x5a1a('0x31')]=_['keys'](_0x1b8bcd[_0x5a1a('0x31')]);_0x3bfdc1[_0x5a1a('0x32')]=_[_0x5a1a('0x46')](_0x3bfdc1[_0x5a1a('0x30')],_0x3bfdc1[_0x5a1a('0x31')]);_0x5cd1ed[_0x5a1a('0x45')]=_[_0x5a1a('0x46')](_0x3bfdc1[_0x5a1a('0x30')],qs[_0x5a1a('0x47')](_0x1b8bcd[_0x5a1a('0x31')]['fields']));_0x5cd1ed[_0x5a1a('0x45')]=_0x5cd1ed[_0x5a1a('0x45')][_0x5a1a('0x55')]?_0x5cd1ed['attributes']:_0x3bfdc1[_0x5a1a('0x30')];if(_0x1b8bcd['query']['includeAll']){_0x5cd1ed['include']=[{'all':!![]}];}_0x5cd1ed=_[_0x5a1a('0x4d')]({},_0x5cd1ed,_0x1b8bcd[_0x5a1a('0x4e')]);return db[_0x5a1a('0x2b')][_0x5a1a('0x56')](_0x5cd1ed)[_0x5a1a('0x24')](handleEntityNotFound(_0x1c6f90,null))['then'](respondWithResult(_0x1c6f90,null))['catch'](handleError(_0x1c6f90,null));};exports[_0x5a1a('0x57')]=function(_0x1bd796,_0x1dfb1d){return db[_0x5a1a('0x2b')]['create'](_0x1bd796[_0x5a1a('0x58')],{})[_0x5a1a('0x24')](respondWithResult(_0x1dfb1d,0xc9))[_0x5a1a('0x51')](handleError(_0x1dfb1d,null));};exports[_0x5a1a('0x22')]=function(_0x17842b,_0xc45842){if(_0x17842b['body']['id']){delete _0x17842b[_0x5a1a('0x58')]['id'];}return db[_0x5a1a('0x2b')][_0x5a1a('0x56')]({'where':{'id':_0x17842b[_0x5a1a('0x53')]['id']}})[_0x5a1a('0x24')](handleEntityNotFound(_0xc45842,null))['then'](saveUpdates(_0x17842b['body'],null))[_0x5a1a('0x24')](respondWithResult(_0xc45842,null))[_0x5a1a('0x51')](handleError(_0xc45842,null));};exports[_0x5a1a('0x59')]=function(_0x5152ac,_0x53532d){return db[_0x5a1a('0x2b')][_0x5a1a('0x59')]()[_0x5a1a('0x24')](respondWithResult(_0x53532d,null))[_0x5a1a('0x51')](handleError(_0x53532d,null));};exports[_0x5a1a('0x23')]=function(_0x3b7894,_0x4ae74c){var _0x561e31;return db['CmHopper'][_0x5a1a('0x56')]({'where':{'id':_0x3b7894[_0x5a1a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4ae74c,null))['then'](function(_0x4c6cb6){if(_0x4c6cb6){return _0x4c6cb6['destroy']()[_0x5a1a('0x24')](function(_0x8acfc7){return _0x8acfc7;});}})[_0x5a1a('0x24')](function(_0x56881e){_0x561e31=_0x56881e;if(_0x56881e){if(_0x56881e[_0x5a1a('0x5a')]||_0x56881e['CampaignId']){return db[_0x56881e[_0x5a1a('0x5a')]?_0x5a1a('0x5b'):_0x5a1a('0x5c')][_0x5a1a('0x56')]({'where':{'id':_0x56881e['VoiceQueueId']?_0x56881e[_0x5a1a('0x5a')]:_0x56881e[_0x5a1a('0x5d')]},'attributes':['id','name'],'raw':!![]});}}})[_0x5a1a('0x24')](function(_0x264e61){var _0x5c2f8d={};if(_0x264e61){_[_0x5a1a('0x4d')](_0x5c2f8d,_[_0x5a1a('0x5e')](_0x561e31[_0x5a1a('0x5f')],[_0x5a1a('0x60'),'updatedAt','id']));_0x5c2f8d['state']=0x15;_0x5c2f8d[_0x5a1a('0x61')]='deleted';_0x5c2f8d[_0x5a1a('0x62')]=_0x264e61[_0x5a1a('0x27')];_0x5c2f8d[_0x5a1a('0x63')]=_0x3b7894['user'][_0x5a1a('0x27')];_0x5c2f8d[_0x5a1a('0x64')]=_0x3b7894[_0x5a1a('0x65')]['id'];_0x5c2f8d[_0x5a1a('0x66')]=!![];_0x5c2f8d[_0x5a1a('0x67')]=moment()[_0x5a1a('0x68')](_0x5a1a('0x69'));_0x5c2f8d[_0x5a1a('0x6a')]=_0x561e31[_0x5a1a('0x6b')];_0x5c2f8d['campaigntype']=_0x561e31['VoiceQueueId']?_0x5a1a('0x6c'):_0x5a1a('0x6d');return db[_0x5a1a('0x6e')]['find']({'where':{'id':_0x5c2f8d[_0x5a1a('0x6f')]},'attributes':[_0x5a1a('0x70'),_0x5a1a('0x71')]})[_0x5a1a('0x24')](function(_0x457d40){if(!_[_0x5a1a('0x72')](_0x4ae74c)&&!_[_0x5a1a('0x72')](_0x457d40['firstName'])){_0x5c2f8d['calleridname']=_0x457d40[_0x5a1a('0x70')];if(!_[_0x5a1a('0x72')](_0x457d40[_0x5a1a('0x71')])){_0x5c2f8d[_0x5a1a('0x73')]+='\x20'+_0x457d40[_0x5a1a('0x71')];}}})[_0x5a1a('0x74')](function(){return db['CmHopperFinal'][_0x5a1a('0x57')](_0x5c2f8d);});}})[_0x5a1a('0x24')](function(){return _0x4ae74c[_0x5a1a('0x19')](0xcc)['end']();})['catch'](handleError(_0x4ae74c,null));};exports['getPreview']=function(_0x3fd8f9,_0x2facd0,_0x789da1){var _0x3ef711=[];return db['CmContact'][_0x5a1a('0x59')]()[_0x5a1a('0x24')](function(_0x3be8ed){_0x3ef711=_[_0x5a1a('0x54')](_0x3be8ed);return _0x3fd8f9[_0x5a1a('0x65')][_0x5a1a('0x75')]({'where':{'type':_0x5a1a('0x76'),'dialActive':!![],'dialMethod':_0x5a1a('0x77')},'attributes':['id',_0x5a1a('0x78')],'raw':!![]});})['then'](function(_0x4d4f80){if(_0x4d4f80&&_0x4d4f80[_0x5a1a('0x55')]){return db[_0x5a1a('0x79')][_0x5a1a('0x7a')](function(_0x20051e){var _0x46a40c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x5a1a('0x69'))},'VoiceQueueId':{'$in':_[_0x5a1a('0x2a')](_0x4d4f80,'id')},'$or':[{'UserId':null},{'UserId':_0x3fd8f9[_0x5a1a('0x65')]['id']}]};var _0x32ea00=[];if(_0x3fd8f9[_0x5a1a('0x58')][_0x5a1a('0x7b')]&&_0x3fd8f9[_0x5a1a('0x58')][_0x5a1a('0x7b')]==='prev'){if(!_[_0x5a1a('0x7c')](_0x3fd8f9[_0x5a1a('0x58')][_0x5a1a('0x7d')])){_0x46a40c['id']={'$in':_0x3fd8f9[_0x5a1a('0x58')][_0x5a1a('0x7d')]};}_0x32ea00=[['priority',_0x5a1a('0x7e')],[_0x5a1a('0x7f'),_0x4d4f80[0x0][_0x5a1a('0x78')]===_0x5a1a('0x7e')?'DESC':_0x5a1a('0x7e')],db['sequelize'][_0x5a1a('0x80')](_0x5a1a('0x81')),['id',_0x5a1a('0x82')]];}else{if(!_[_0x5a1a('0x7c')](_0x3fd8f9[_0x5a1a('0x58')]['hopperIds'])){_0x46a40c['id']={'$notIn':_0x3fd8f9['body']['hopperIds']};}_0x32ea00=[[_0x5a1a('0x83'),_0x5a1a('0x82')],['scheduledAt',_0x4d4f80[0x0]['dialOrderByScheduledAt']],db[_0x5a1a('0x79')][_0x5a1a('0x80')](_0x5a1a('0x84')),['id',_0x5a1a('0x7e')]];}return db[_0x5a1a('0x2b')][_0x5a1a('0x85')]({'attributes':['id',_0x5a1a('0x86')],'where':_0x46a40c,'order':_0x32ea00,'transaction':_0x20051e,'lock':_0x20051e[_0x5a1a('0x87')][_0x5a1a('0x88')],'include':[{'model':db[_0x5a1a('0x6e')],'as':_0x5a1a('0x89'),'attributes':_0x3ef711,'include':[{'model':db['CmCompany'],'as':_0x5a1a('0x8a'),'attributes':['id',_0x5a1a('0x27')]}]},{'model':db['CmList'],'as':_0x5a1a('0x8b'),'attributes':['id',_0x5a1a('0x27')]},{'model':db[_0x5a1a('0x5b')],'as':_0x5a1a('0x8c'),'attributes':['id',_0x5a1a('0x27'),_0x5a1a('0x8d')]}]})[_0x5a1a('0x24')](function(_0x37d8f0){if(_0x37d8f0){return _0x37d8f0['update']({'UserId':_0x3fd8f9[_0x5a1a('0x65')]['id']},{'transaction':_0x20051e});}});});}})[_0x5a1a('0x24')](handleEntityNotFound(_0x2facd0,null))['then'](respondWithResult(_0x2facd0,null))['catch'](handleError(_0x2facd0,null));};exports['getOpenContacts']=function(_0x1719f8,_0x1ac562,_0x3fa58a){return _0x1719f8[_0x5a1a('0x65')][_0x5a1a('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x5a1a('0x24')](function(_0x24acad){if(_0x24acad&&_0x24acad[_0x5a1a('0x55')]){return db[_0x5a1a('0x2b')][_0x5a1a('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x5a1a('0x69'))},'VoiceQueueId':{'$in':_[_0x5a1a('0x2a')](_0x24acad,'id')},'$or':[{'UserId':null},{'UserId':_0x1719f8[_0x5a1a('0x65')]['id']}]}});}return 0x0;})[_0x5a1a('0x24')](function(_0x527d53){if(!_[_0x5a1a('0x72')](_0x527d53)&&_[_0x5a1a('0x8e')](_0x527d53)){return _0x1ac562[_0x5a1a('0x19')](0xc8)[_0x5a1a('0x1b')]({'contacts':_0x527d53});}else{logger[_0x5a1a('0x25')](_0x5a1a('0x8f'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x1ac562[_0x5a1a('0x18')](0x194);}})[_0x5a1a('0x51')](handleError(_0x1ac562,null));}; \ No newline at end of file +var _0x7bfd=['$contains','$contained','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','keys','rawAttributes','length','include','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','Campaign','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','isNil','lastName','end','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','sequelize','transaction','direction','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','index','map','CmHopper','type','filters','intersection','model','query','concat','$and','$or','$gt','$lt','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7bfd,0xe1));var _0xd7bf=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7bfd[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xd7bf('0x0'));var rimraf=require(_0xd7bf('0x1'));var zipdir=require(_0xd7bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7bf('0x3'));var moment=require(_0xd7bf('0x4'));var BPromise=require(_0xd7bf('0x5'));var Mustache=require(_0xd7bf('0x6'));var util=require('util');var path=require(_0xd7bf('0x7'));var sox=require(_0xd7bf('0x8'));var csv=require(_0xd7bf('0x9'));var ejs=require(_0xd7bf('0xa'));var fs=require('fs');var fs_extra=require(_0xd7bf('0xb'));var _=require(_0xd7bf('0xc'));var squel=require(_0xd7bf('0xd'));var crypto=require('crypto');var jsforce=require(_0xd7bf('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd7bf('0xf'));var Papa=require(_0xd7bf('0x10'));var Redis=require('ioredis');var authService=require(_0xd7bf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd7bf('0x12'));var hardwareService=require(_0xd7bf('0x13'));var logger=require(_0xd7bf('0x14'))(_0xd7bf('0x15'));var utils=require(_0xd7bf('0x16'));var config=require(_0xd7bf('0x17'));var licenseUtil=require(_0xd7bf('0x18'));var db=require(_0xd7bf('0x19'))['db'];function respondWithStatusCode(_0x209873,_0x1f1845){_0x1f1845=_0x1f1845||0xcc;return function(_0x5cc16d){if(_0x5cc16d){return _0x209873['sendStatus'](_0x1f1845);}return _0x209873[_0xd7bf('0x1a')](_0x1f1845)['end']();};}function respondWithResult(_0x30df3f,_0x4fe103){_0x4fe103=_0x4fe103||0xc8;return function(_0x31086a){if(_0x31086a){return _0x30df3f[_0xd7bf('0x1a')](_0x4fe103)[_0xd7bf('0x1b')](_0x31086a);}};}function respondWithFilteredResult(_0x2cf413,_0x3009d0){return function(_0x7b1701){if(_0x7b1701){var _0x47910f=typeof _0x3009d0[_0xd7bf('0x1c')]===_0xd7bf('0x1d')&&typeof _0x3009d0[_0xd7bf('0x1e')]===_0xd7bf('0x1d');var _0x529802=_0x7b1701[_0xd7bf('0x1f')];var _0x345743=_0x47910f?0x0:_0x3009d0[_0xd7bf('0x1c')];var _0x5c2101=_0x47910f?_0x7b1701[_0xd7bf('0x1f')]:_0x3009d0[_0xd7bf('0x1c')]+_0x3009d0[_0xd7bf('0x1e')];var _0x1f719d;if(_0x5c2101>=_0x529802){_0x5c2101=_0x529802;_0x1f719d=0xc8;}else{_0x1f719d=0xce;}_0x2cf413[_0xd7bf('0x1a')](_0x1f719d);return _0x2cf413[_0xd7bf('0x20')](_0xd7bf('0x21'),_0x345743+'-'+_0x5c2101+'/'+_0x529802)['json'](_0x7b1701);}return null;};}function patchUpdates(_0x5a8423){return function(_0x3268cf){try{jsonpatch[_0xd7bf('0x22')](_0x3268cf,_0x5a8423,!![]);}catch(_0x21cb25){return BPromise['reject'](_0x21cb25);}return _0x3268cf[_0xd7bf('0x23')]();};}function saveUpdates(_0x39a8ee,_0x42929c){return function(_0x35ef19){if(_0x35ef19){return _0x35ef19[_0xd7bf('0x24')](_0x39a8ee)[_0xd7bf('0x25')](function(_0x3726ac){return _0x3726ac;});}return null;};}function removeEntity(_0x64b846,_0x2a21d3){return function(_0x248559){if(_0x248559){return _0x248559['destroy']()['then'](function(){_0x64b846[_0xd7bf('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52c1c9,_0x30ec1f){return function(_0x2a8c29){if(!_0x2a8c29){_0x52c1c9[_0xd7bf('0x26')](0x194);}return _0x2a8c29;};}function handleError(_0x267ed3,_0x55d3da){_0x55d3da=_0x55d3da||0x1f4;return function(_0x221913){logger[_0xd7bf('0x27')](_0x221913[_0xd7bf('0x28')]);if(_0x221913[_0xd7bf('0x29')]){delete _0x221913[_0xd7bf('0x29')];}_0x267ed3[_0xd7bf('0x1a')](_0x55d3da)['send'](_0x221913);};}exports[_0xd7bf('0x2a')]=function(_0x17c8a3,_0x4fe4c0){var _0x5b060d={},_0x3b5a60={},_0x396ef1={'count':0x0,'rows':[]};var _0x511182=_[_0xd7bf('0x2b')](db[_0xd7bf('0x2c')]['rawAttributes'],function(_0x1420b6){return{'name':_0x1420b6['fieldName'],'type':_0x1420b6[_0xd7bf('0x2d')]['key']};});_0x3b5a60['model']=_[_0xd7bf('0x2b')](_0x511182,_0xd7bf('0x29'));_0x3b5a60['query']=_['keys'](_0x17c8a3['query']);_0x3b5a60[_0xd7bf('0x2e')]=_[_0xd7bf('0x2f')](_0x3b5a60[_0xd7bf('0x30')],_0x3b5a60[_0xd7bf('0x31')]);_0x3b5a60['filters']=_[_0xd7bf('0x32')](_0x3b5a60[_0xd7bf('0x2e')],[_0xd7bf('0x33'),_0xd7bf('0x34'),_0xd7bf('0x35'),'$gte',_0xd7bf('0x36'),'$lte','$ne','$eq','$not',_0xd7bf('0x37'),'$notBetween',_0xd7bf('0x38'),_0xd7bf('0x39'),_0xd7bf('0x3a'),_0xd7bf('0x3b'),_0xd7bf('0x3c'),_0xd7bf('0x3d'),_0xd7bf('0x3a'),_0xd7bf('0x3e'),_0xd7bf('0x3f'),_0xd7bf('0x40'),'$any']);_0x5b060d[_0xd7bf('0x41')]=_[_0xd7bf('0x2f')](_0x3b5a60['model'],qs[_0xd7bf('0x42')](_0x17c8a3['query'][_0xd7bf('0x42')]));_0x5b060d[_0xd7bf('0x41')]=_0x5b060d[_0xd7bf('0x41')]['length']?_0x5b060d[_0xd7bf('0x41')]:_0x3b5a60[_0xd7bf('0x30')];if(!_0x17c8a3[_0xd7bf('0x31')][_0xd7bf('0x43')](_0xd7bf('0x44'))){_0x5b060d[_0xd7bf('0x1e')]=qs[_0xd7bf('0x1e')](_0x17c8a3[_0xd7bf('0x31')][_0xd7bf('0x1e')]);_0x5b060d['offset']=qs[_0xd7bf('0x1c')](_0x17c8a3[_0xd7bf('0x31')][_0xd7bf('0x1c')]);}_0x5b060d[_0xd7bf('0x45')]=qs[_0xd7bf('0x46')](_0x17c8a3[_0xd7bf('0x31')][_0xd7bf('0x46')]);_0x5b060d[_0xd7bf('0x47')]=qs[_0xd7bf('0x2e')](_['pick'](_0x17c8a3['query'],_0x3b5a60[_0xd7bf('0x2e')]),_0x511182);if(_0x17c8a3[_0xd7bf('0x31')]['filter']){_0x5b060d[_0xd7bf('0x47')]=_[_0xd7bf('0x48')](_0x5b060d[_0xd7bf('0x47')],{'$or':_[_0xd7bf('0x2b')](_0x511182,function(_0x2eb614){if(_0x2eb614[_0xd7bf('0x2d')]!==_0xd7bf('0x49')){var _0x4ddab8={};_0x4ddab8[_0x2eb614[_0xd7bf('0x29')]]={'$like':'%'+_0x17c8a3[_0xd7bf('0x31')][_0xd7bf('0x4a')]+'%'};return _0x4ddab8;}})});}_0x5b060d=_['merge']({},_0x5b060d,_0x17c8a3[_0xd7bf('0x4b')]);var _0x49166b={'where':_0x5b060d['where']};return db[_0xd7bf('0x2c')][_0xd7bf('0x1f')](_0x49166b)['then'](function(_0x2e3176){_0x396ef1[_0xd7bf('0x1f')]=_0x2e3176;if(_0x17c8a3['query'][_0xd7bf('0x4c')]){_0x5b060d['include']=[{'all':!![]}];}return db[_0xd7bf('0x2c')][_0xd7bf('0x4d')](_0x5b060d);})['then'](function(_0x4d17e8){_0x396ef1[_0xd7bf('0x4e')]=_0x4d17e8;return _0x396ef1;})['then'](respondWithFilteredResult(_0x4fe4c0,_0x5b060d))[_0xd7bf('0x4f')](handleError(_0x4fe4c0,null));};exports['show']=function(_0x4660e2,_0x68de65){var _0x1c6742={'raw':!![],'where':{'id':_0x4660e2['params']['id']}},_0x535d7d={};_0x535d7d[_0xd7bf('0x30')]=_[_0xd7bf('0x50')](db[_0xd7bf('0x2c')][_0xd7bf('0x51')]);_0x535d7d[_0xd7bf('0x31')]=_[_0xd7bf('0x50')](_0x4660e2[_0xd7bf('0x31')]);_0x535d7d[_0xd7bf('0x2e')]=_[_0xd7bf('0x2f')](_0x535d7d[_0xd7bf('0x30')],_0x535d7d[_0xd7bf('0x31')]);_0x1c6742['attributes']=_[_0xd7bf('0x2f')](_0x535d7d['model'],qs[_0xd7bf('0x42')](_0x4660e2[_0xd7bf('0x31')]['fields']));_0x1c6742['attributes']=_0x1c6742[_0xd7bf('0x41')][_0xd7bf('0x52')]?_0x1c6742[_0xd7bf('0x41')]:_0x535d7d[_0xd7bf('0x30')];if(_0x4660e2[_0xd7bf('0x31')][_0xd7bf('0x4c')]){_0x1c6742[_0xd7bf('0x53')]=[{'all':!![]}];}_0x1c6742=_[_0xd7bf('0x48')]({},_0x1c6742,_0x4660e2[_0xd7bf('0x4b')]);return db['CmHopper'][_0xd7bf('0x54')](_0x1c6742)['then'](handleEntityNotFound(_0x68de65,null))[_0xd7bf('0x25')](respondWithResult(_0x68de65,null))[_0xd7bf('0x4f')](handleError(_0x68de65,null));};exports[_0xd7bf('0x55')]=function(_0x46fadd,_0x35268f){return db[_0xd7bf('0x2c')]['create'](_0x46fadd['body'],{})['then'](respondWithResult(_0x35268f,0xc9))['catch'](handleError(_0x35268f,null));};exports[_0xd7bf('0x24')]=function(_0x40668c,_0x16035d){if(_0x40668c[_0xd7bf('0x56')]['id']){delete _0x40668c[_0xd7bf('0x56')]['id'];}return db['CmHopper'][_0xd7bf('0x54')]({'where':{'id':_0x40668c[_0xd7bf('0x57')]['id']}})[_0xd7bf('0x25')](handleEntityNotFound(_0x16035d,null))[_0xd7bf('0x25')](saveUpdates(_0x40668c['body'],null))[_0xd7bf('0x25')](respondWithResult(_0x16035d,null))[_0xd7bf('0x4f')](handleError(_0x16035d,null));};exports[_0xd7bf('0x58')]=function(_0x125265,_0x102af4){return db[_0xd7bf('0x2c')]['describe']()[_0xd7bf('0x25')](respondWithResult(_0x102af4,null))[_0xd7bf('0x4f')](handleError(_0x102af4,null));};exports[_0xd7bf('0x59')]=function(_0x3828a8,_0x6eefae){var _0x3710ca;return db[_0xd7bf('0x2c')][_0xd7bf('0x54')]({'where':{'id':_0x3828a8[_0xd7bf('0x57')]['id']}})[_0xd7bf('0x25')](handleEntityNotFound(_0x6eefae,null))['then'](function(_0x5a7fd4){if(_0x5a7fd4){return _0x5a7fd4[_0xd7bf('0x59')]()[_0xd7bf('0x25')](function(_0x197b93){return _0x197b93;});}})['then'](function(_0x59f7b9){_0x3710ca=_0x59f7b9;if(_0x59f7b9){if(_0x59f7b9[_0xd7bf('0x5a')]||_0x59f7b9[_0xd7bf('0x5b')]){return db[_0x59f7b9[_0xd7bf('0x5a')]?'VoiceQueue':_0xd7bf('0x5c')][_0xd7bf('0x54')]({'where':{'id':_0x59f7b9['VoiceQueueId']?_0x59f7b9[_0xd7bf('0x5a')]:_0x59f7b9[_0xd7bf('0x5b')]},'attributes':['id',_0xd7bf('0x29')],'raw':!![]});}}})['then'](function(_0x43d06f){var _0x3033c9={};if(_0x43d06f){_[_0xd7bf('0x48')](_0x3033c9,_['omit'](_0x3710ca[_0xd7bf('0x5d')],[_0xd7bf('0x5e'),_0xd7bf('0x5f'),'id']));_0x3033c9[_0xd7bf('0x60')]=0x15;_0x3033c9['statedesc']=_0xd7bf('0x61');_0x3033c9[_0xd7bf('0x62')]=_0x43d06f[_0xd7bf('0x29')];_0x3033c9[_0xd7bf('0x63')]=_0x3828a8['user'][_0xd7bf('0x29')];_0x3033c9[_0xd7bf('0x64')]=_0x3828a8[_0xd7bf('0x65')]['id'];_0x3033c9['deleted']=!![];_0x3033c9['deletedat']=moment()[_0xd7bf('0x66')](_0xd7bf('0x67'));_0x3033c9[_0xd7bf('0x68')]=_0x3710ca[_0xd7bf('0x69')];_0x3033c9['campaigntype']=_0x3710ca['VoiceQueueId']?_0xd7bf('0x6a'):'ivr';return db[_0xd7bf('0x6b')][_0xd7bf('0x54')]({'where':{'id':_0x3033c9[_0xd7bf('0x6c')]},'attributes':[_0xd7bf('0x6d'),'lastName']})[_0xd7bf('0x25')](function(_0x15ff20){if(!_['isNil'](_0x6eefae)&&!_['isNil'](_0x15ff20[_0xd7bf('0x6d')])){_0x3033c9['calleridname']=_0x15ff20[_0xd7bf('0x6d')];if(!_[_0xd7bf('0x6e')](_0x15ff20[_0xd7bf('0x6f')])){_0x3033c9['calleridname']+='\x20'+_0x15ff20[_0xd7bf('0x6f')];}}})['finally'](function(){return db['CmHopperFinal']['create'](_0x3033c9);});}})['then'](function(){return _0x6eefae[_0xd7bf('0x1a')](0xcc)[_0xd7bf('0x70')]();})[_0xd7bf('0x4f')](handleError(_0x6eefae,null));};exports[_0xd7bf('0x71')]=function(_0x1cf244,_0x396466,_0x72ad9e){var _0x4d6466=[];return db[_0xd7bf('0x6b')]['describe']()[_0xd7bf('0x25')](function(_0x5141df){_0x4d6466=_[_0xd7bf('0x50')](_0x5141df);return _0x1cf244[_0xd7bf('0x65')][_0xd7bf('0x72')]({'where':{'type':_0xd7bf('0x73'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xd7bf('0x74')],'raw':!![]});})[_0xd7bf('0x25')](function(_0x5ee145){if(_0x5ee145&&_0x5ee145[_0xd7bf('0x52')]){return db[_0xd7bf('0x75')][_0xd7bf('0x76')](function(_0x1345e8){var _0x34ad05={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd7bf('0x66')](_0xd7bf('0x67'))},'VoiceQueueId':{'$in':_['map'](_0x5ee145,'id')},'$or':[{'UserId':null},{'UserId':_0x1cf244[_0xd7bf('0x65')]['id']}]};var _0x265a43=[];if(_0x1cf244[_0xd7bf('0x56')][_0xd7bf('0x77')]&&_0x1cf244[_0xd7bf('0x56')][_0xd7bf('0x77')]==='prev'){if(!_[_0xd7bf('0x78')](_0x1cf244['body'][_0xd7bf('0x79')])){_0x34ad05['id']={'$in':_0x1cf244[_0xd7bf('0x56')]['hopperIds']};}_0x265a43=[[_0xd7bf('0x7a'),_0xd7bf('0x7b')],['scheduledAt',_0x5ee145[0x0][_0xd7bf('0x74')]==='ASC'?_0xd7bf('0x7c'):'ASC'],db['sequelize'][_0xd7bf('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xd7bf('0x7c')]];}else{if(!_['isEmpty'](_0x1cf244['body'][_0xd7bf('0x79')])){_0x34ad05['id']={'$notIn':_0x1cf244[_0xd7bf('0x56')]['hopperIds']};}_0x265a43=[[_0xd7bf('0x7a'),_0xd7bf('0x7c')],['scheduledAt',_0x5ee145[0x0][_0xd7bf('0x74')]],db[_0xd7bf('0x75')][_0xd7bf('0x7d')](_0xd7bf('0x7e')),['id',_0xd7bf('0x7b')]];}return db['CmHopper'][_0xd7bf('0x7f')]({'attributes':['id',_0xd7bf('0x80')],'where':_0x34ad05,'order':_0x265a43,'transaction':_0x1345e8,'lock':_0x1345e8[_0xd7bf('0x81')][_0xd7bf('0x82')],'include':[{'model':db['CmContact'],'as':_0xd7bf('0x83'),'attributes':_0x4d6466,'include':[{'model':db[_0xd7bf('0x84')],'as':_0xd7bf('0x85'),'attributes':['id','name']}]},{'model':db[_0xd7bf('0x86')],'as':_0xd7bf('0x87'),'attributes':['id',_0xd7bf('0x29')]},{'model':db[_0xd7bf('0x88')],'as':_0xd7bf('0x89'),'attributes':['id',_0xd7bf('0x29'),_0xd7bf('0x8a')]}]})['then'](function(_0x3e01a2){if(_0x3e01a2){return _0x3e01a2[_0xd7bf('0x24')]({'UserId':_0x1cf244[_0xd7bf('0x65')]['id']},{'transaction':_0x1345e8});}});});}})[_0xd7bf('0x25')](handleEntityNotFound(_0x396466,null))[_0xd7bf('0x25')](respondWithResult(_0x396466,null))['catch'](handleError(_0x396466,null));};exports['getOpenContacts']=function(_0x239654,_0x1d309c,_0xd49ae2){return _0x239654[_0xd7bf('0x65')][_0xd7bf('0x72')]({'where':{'type':_0xd7bf('0x73'),'dialActive':!![],'dialMethod':_0xd7bf('0x8b')},'attributes':['id'],'raw':!![]})[_0xd7bf('0x25')](function(_0xff5471){if(_0xff5471&&_0xff5471['length']){return db[_0xd7bf('0x2c')][_0xd7bf('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd7bf('0x66')](_0xd7bf('0x67'))},'VoiceQueueId':{'$in':_[_0xd7bf('0x2b')](_0xff5471,'id')},'$or':[{'UserId':null},{'UserId':_0x239654[_0xd7bf('0x65')]['id']}]}});}return 0x0;})[_0xd7bf('0x25')](function(_0x596ca1){if(!_['isNil'](_0x596ca1)&&_[_0xd7bf('0x8c')](_0x596ca1)){return _0x1d309c[_0xd7bf('0x1a')](0xc8)['json']({'contacts':_0x596ca1});}else{logger[_0xd7bf('0x27')](_0xd7bf('0x8d'),_0xd7bf('0x8e'),0x194,_0xd7bf('0x8f'));_0x1d309c[_0xd7bf('0x26')](0x194);}})[_0xd7bf('0x4f')](handleError(_0x1d309c,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 4ff1973..565494f 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 _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2a888e,_0x12a9e8){var _0x1c3d63=function(_0x5366ab){while(--_0x5366ab){_0x2a888e['push'](_0x2a888e['shift']());}};_0x1c3d63(++_0x12a9e8);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf25c17,_0x288f2c){_0xf25c17=_0xf25c17-0x0;var _0x429736=_0xfdbd[_0xf25c17];return _0x429736;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fb=['util','../../config/logger','api','path','rimraf','./cmHopper.attributes','exports','CmHopper','scheduledat','priority','lodash'];(function(_0x25f29a,_0x4fc10f){var _0x55216f=function(_0x5d94df){while(--_0x5d94df){_0x25f29a['push'](_0x25f29a['shift']());}};_0x55216f(++_0x4fc10f);}(_0xd8fb,0x99));var _0xbd8f=function(_0xc48b60,_0x42ce31){_0xc48b60=_0xc48b60-0x0;var _0xd669e8=_0xd8fb[_0xc48b60];return _0xd669e8;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));module[_0xbd8f('0x7')]=function(_0x5543b2,_0x33d541){return _0x5543b2['define'](_0xbd8f('0x8'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xbd8f('0x9'),'fields':[_0xbd8f('0x9')]},{'name':'phone','fields':['phone']},{'name':_0xbd8f('0xa'),'fields':[_0xbd8f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 1466777..c7fe925 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 _0xa185=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowCmHopper','find','CreateCmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','voicePause','length','includes','push','all','CmHopperFinal','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','contactsRescheduled','GetContactRecallMe','UserId','GetCmHopperPreview','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x29106c,_0x4371d6){var _0x4133ac=function(_0x1917b7){while(--_0x1917b7){_0x29106c['push'](_0x29106c['shift']());}};_0x4133ac(++_0x4371d6);}(_0xa185,0x10e));var _0x5a18=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa185[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x5a18('0x0'));var moment=require('moment');var BPromise=require(_0x5a18('0x1'));var rs=require(_0x5a18('0x2'));var fs=require('fs');var Redis=require(_0x5a18('0x3'));var db=require(_0x5a18('0x4'))['db'];var utils=require(_0x5a18('0x5'));var logger=require(_0x5a18('0x6'))('rpc');var config=require(_0x5a18('0x7'));var jayson=require(_0x5a18('0x8'));var client=jayson[_0x5a18('0x9')][_0x5a18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59fcc4,_0x5cf3d0,_0x4d2845){return new BPromise(function(_0x43ce8c,_0xed2768){return client[_0x5a18('0xb')](_0x59fcc4,_0x4d2845)[_0x5a18('0xc')](function(_0x126d52){logger[_0x5a18('0xd')](_0x5a18('0xe'),_0x5cf3d0,_0x5a18('0xf'));logger[_0x5a18('0x10')](_0x5a18('0x11'),_0x5cf3d0,_0x5a18('0xf'),JSON['stringify'](_0x126d52));if(_0x126d52[_0x5a18('0x12')]){if(_0x126d52[_0x5a18('0x12')]['code']===0x1f4){logger['error'](_0x5a18('0xe'),_0x5cf3d0,_0x126d52[_0x5a18('0x12')][_0x5a18('0x13')]);return _0xed2768(_0x126d52[_0x5a18('0x12')]['message']);}logger[_0x5a18('0x12')]('CmHopper,\x20%s,\x20%s',_0x5cf3d0,_0x126d52['error'][_0x5a18('0x13')]);return _0x43ce8c(_0x126d52[_0x5a18('0x12')]['message']);}else{logger['info'](_0x5a18('0xe'),_0x5cf3d0,'request\x20sent');_0x43ce8c(_0x126d52['result'][_0x5a18('0x13')]);}})[_0x5a18('0x14')](function(_0x5e00bb){logger[_0x5a18('0x12')]('CmHopper,\x20%s,\x20%s',_0x5cf3d0,_0x5e00bb);_0xed2768(_0x5e00bb);});});}exports[_0x5a18('0x15')]=function(_0x516a44){var _0x5723c8=this;return new Promise(function(_0x50c08,_0x441ab6){return db[_0x5a18('0x16')][_0x5a18('0x17')]({'raw':_0x516a44['options']?_0x516a44[_0x5a18('0x18')][_0x5a18('0x19')]===undefined?!![]:![]:!![],'where':_0x516a44[_0x5a18('0x18')]?_0x516a44[_0x5a18('0x18')][_0x5a18('0x1a')]||null:null,'attributes':_0x516a44[_0x5a18('0x18')]?_0x516a44['options'][_0x5a18('0x1b')]||null:null,'limit':_0x516a44[_0x5a18('0x18')]?_0x516a44[_0x5a18('0x18')][_0x5a18('0x1c')]||null:null,'include':_0x516a44['options']?_0x516a44[_0x5a18('0x18')][_0x5a18('0x1d')]?_[_0x5a18('0x1e')](_0x516a44[_0x5a18('0x18')][_0x5a18('0x1d')],function(_0x501c1c){return{'model':db[_0x501c1c[_0x5a18('0x1f')]],'as':_0x501c1c['as'],'attributes':_0x501c1c[_0x5a18('0x1b')],'include':_0x501c1c['include']?_[_0x5a18('0x1e')](_0x501c1c['include'],function(_0x2434ec){return{'model':db[_0x2434ec[_0x5a18('0x1f')]],'as':_0x2434ec['as'],'attributes':_0x2434ec[_0x5a18('0x1b')],'include':_0x2434ec[_0x5a18('0x1d')]?_[_0x5a18('0x1e')](_0x2434ec[_0x5a18('0x1d')],function(_0x30318f){return{'model':db[_0x30318f['model']],'as':_0x30318f['as'],'attributes':_0x30318f[_0x5a18('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5a18('0xc')](function(_0x31b24b){logger[_0x5a18('0xd')](_0x5a18('0x15'),_0x516a44);logger[_0x5a18('0x10')](_0x5a18('0x15'),_0x516a44,JSON[_0x5a18('0x20')](_0x31b24b));_0x50c08(_0x31b24b);})[_0x5a18('0x14')](function(_0xb35af4){logger[_0x5a18('0x12')](_0x5a18('0x15'),_0xb35af4[_0x5a18('0x13')],_0x516a44);_0x441ab6(_0x5723c8[_0x5a18('0x12')](0x1f4,_0xb35af4[_0x5a18('0x13')]));});});};exports[_0x5a18('0x21')]=function(_0x188429){var _0x4cb553=this;return new Promise(function(_0x9e5b5f,_0x2ad63f){return db[_0x5a18('0x16')][_0x5a18('0x22')]({'raw':_0x188429[_0x5a18('0x18')]?_0x188429['options'][_0x5a18('0x19')]===undefined?!![]:![]:!![],'where':_0x188429[_0x5a18('0x18')]?_0x188429[_0x5a18('0x18')]['where']||null:null,'attributes':_0x188429[_0x5a18('0x18')]?_0x188429['options'][_0x5a18('0x1b')]||null:null,'include':_0x188429[_0x5a18('0x18')]?_0x188429[_0x5a18('0x18')][_0x5a18('0x1d')]?_[_0x5a18('0x1e')](_0x188429['options']['include'],function(_0x12ad9e){return{'model':db[_0x12ad9e[_0x5a18('0x1f')]],'as':_0x12ad9e['as'],'attributes':_0x12ad9e[_0x5a18('0x1b')],'include':_0x12ad9e[_0x5a18('0x1d')]?_['map'](_0x12ad9e[_0x5a18('0x1d')],function(_0x4d4ae9){return{'model':db[_0x4d4ae9[_0x5a18('0x1f')]],'as':_0x4d4ae9['as'],'attributes':_0x4d4ae9[_0x5a18('0x1b')],'include':_0x4d4ae9[_0x5a18('0x1d')]?_[_0x5a18('0x1e')](_0x4d4ae9[_0x5a18('0x1d')],function(_0x1cec02){return{'model':db[_0x1cec02[_0x5a18('0x1f')]],'as':_0x1cec02['as'],'attributes':_0x1cec02['attributes']};}):[]};}):[]};}):[]:[]})[_0x5a18('0xc')](function(_0x3bc85d){logger['info'](_0x5a18('0x21'),_0x188429);logger[_0x5a18('0x10')](_0x5a18('0x21'),_0x188429,JSON['stringify'](_0x3bc85d));_0x9e5b5f(_0x3bc85d);})[_0x5a18('0x14')](function(_0x2182f8){logger['error']('ShowCmHopper',_0x2182f8[_0x5a18('0x13')],_0x188429);_0x2ad63f(_0x4cb553[_0x5a18('0x12')](0x1f4,_0x2182f8['message']));});});};exports[_0x5a18('0x23')]=function(_0x5e9312){var _0x5af51a=this;return new Promise(function(_0x246604,_0xe86fba){return db[_0x5a18('0x16')][_0x5a18('0x24')](_0x5e9312[_0x5a18('0x25')],{'raw':_0x5e9312[_0x5a18('0x18')]?_0x5e9312[_0x5a18('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x148887){logger[_0x5a18('0xd')](_0x5a18('0x23'),_0x5e9312);logger[_0x5a18('0x10')](_0x5a18('0x23'),_0x5e9312,JSON['stringify'](_0x148887));_0x246604(_0x148887);})['catch'](function(_0x3fd750){logger[_0x5a18('0x12')]('CreateCmHopper',_0x3fd750[_0x5a18('0x13')],_0x5e9312);_0xe86fba(_0x5af51a[_0x5a18('0x12')](0x1f4,_0x3fd750[_0x5a18('0x13')]));});});};exports['UpdateCmHopper']=function(_0xd0da48){var _0x23c4b0=this;return new Promise(function(_0x430f93,_0x6ac20c){return db[_0x5a18('0x16')][_0x5a18('0x26')](_0xd0da48['body'],{'raw':_0xd0da48['options']?_0xd0da48[_0x5a18('0x18')][_0x5a18('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd0da48['options']?_0xd0da48[_0x5a18('0x18')]['where']||null:null,'attributes':_0xd0da48['options']?_0xd0da48['options']['attributes']||null:null,'limit':_0xd0da48[_0x5a18('0x18')]?_0xd0da48['options'][_0x5a18('0x1c')]||null:null})['then'](function(_0x442fdb){logger[_0x5a18('0xd')]('UpdateCmHopper',_0xd0da48);logger[_0x5a18('0x10')](_0x5a18('0x27'),_0xd0da48,JSON[_0x5a18('0x20')](_0x442fdb));_0x430f93(_0x442fdb);})[_0x5a18('0x14')](function(_0x15f4bd){logger[_0x5a18('0x12')]('UpdateCmHopper',_0x15f4bd[_0x5a18('0x13')],_0xd0da48);_0x6ac20c(_0x23c4b0['error'](0x1f4,_0x15f4bd['message']));});});};exports[_0x5a18('0x28')]=function(_0x158aae){var _0x476a4a=this;return new Promise(function(_0x49908e,_0x10e6a3){return db[_0x5a18('0x16')][_0x5a18('0x29')]({'where':_0x158aae[_0x5a18('0x18')]?_0x158aae[_0x5a18('0x18')][_0x5a18('0x1a')]||null:null})[_0x5a18('0xc')](function(_0x2c8390){logger['info'](_0x5a18('0x28'),_0x158aae);logger[_0x5a18('0x10')]('DestroyCmHopper',_0x158aae,JSON[_0x5a18('0x20')](_0x2c8390));_0x49908e(_0x2c8390);})[_0x5a18('0x14')](function(_0x5d29b6){logger['error'](_0x5a18('0x28'),_0x5d29b6[_0x5a18('0x13')],_0x158aae);_0x10e6a3(_0x476a4a['error'](0x1f4,_0x5d29b6['message']));});});};exports[_0x5a18('0x2a')]=function(_0x81cbac){var _0x9e908c=this;return new Promise(function(_0x2ed473,_0x59c3b7){return db[_0x5a18('0x2b')][_0x5a18('0x2c')]()['then'](function(_0x384ca8){return db[_0x5a18('0x2d')][_0x5a18('0x2e')](function(_0x5a624b){return db[_0x5a18('0x16')][_0x5a18('0x17')]({'where':_0x81cbac[_0x5a18('0x18')]?_0x81cbac[_0x5a18('0x18')]['where']||null:null,'attributes':_0x81cbac['options']?_0x81cbac['options']['attributes']||null:null,'limit':_0x81cbac[_0x5a18('0x18')]?_0x81cbac['options'][_0x5a18('0x1c')]||null:null,'order':_0x81cbac[_0x5a18('0x18')]?_0x81cbac['options'][_0x5a18('0x2f')]||null:null,'transaction':_0x5a624b,'lock':_0x5a624b[_0x5a18('0x30')][_0x5a18('0x31')],'include':[{'model':db[_0x5a18('0x2b')],'as':_0x5a18('0x32'),'attributes':_[_0x5a18('0x33')](_0x384ca8)},{'model':db[_0x5a18('0x34')],'as':_0x5a18('0x35'),'attributes':['id',_0x5a18('0x36'),_0x5a18('0x37')]}]})[_0x5a18('0xc')](function(_0x4c5405){var _0x5c4842=[];var _0x3be6cd=[];for(var _0x292a38=0x0;_0x292a38<_0x4c5405[_0x5a18('0x38')];_0x292a38+=0x1){var _0x55a376=_0x4c5405[_0x292a38]['UserId'];if(_0x55a376===null){_0x5c4842['push'](_0x4c5405[_0x292a38][_0x5a18('0x26')](_0x81cbac[_0x5a18('0x25')],{'transaction':_0x5a624b}));}else if(!_0x3be6cd[_0x5a18('0x39')](_0x55a376)){_0x3be6cd[_0x5a18('0x3a')](_0x55a376);_0x5c4842[_0x5a18('0x3a')](_0x4c5405[_0x292a38][_0x5a18('0x26')](_0x81cbac[_0x5a18('0x25')],{'transaction':_0x5a624b}));}}return BPromise[_0x5a18('0x3b')](_0x5c4842);});})[_0x5a18('0xc')](function(_0x1d0d4f){logger[_0x5a18('0xd')](_0x5a18('0x2a'),_0x81cbac);logger[_0x5a18('0x10')](_0x5a18('0x2a'),_0x81cbac,JSON[_0x5a18('0x20')](_0x1d0d4f));_0x2ed473(_0x1d0d4f);})[_0x5a18('0x14')](function(_0x6886dd){logger[_0x5a18('0x12')](_0x5a18('0x2a'),_0x6886dd[_0x5a18('0x13')],_0x81cbac);_0x59c3b7(_0x9e908c['error'](0x1f4,_0x6886dd[_0x5a18('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x3bdb7c){var _0x3d19fb=this;return new Promise(function(_0x4be037,_0xb6e3f8){return db[_0x5a18('0x2d')][_0x5a18('0x2e')](function(_0x690e17){return db[_0x5a18('0x3c')][_0x5a18('0x24')](_0x3bdb7c['body'],{'raw':_0x3bdb7c[_0x5a18('0x18')]?_0x3bdb7c[_0x5a18('0x18')][_0x5a18('0x19')]===undefined?!![]:![]:!![],'transaction':_0x690e17})[_0x5a18('0xc')](function(){return db[_0x5a18('0x16')][_0x5a18('0x29')]({'where':_0x3bdb7c['options']?_0x3bdb7c[_0x5a18('0x18')][_0x5a18('0x1a')]||null:null,'transaction':_0x690e17});});})[_0x5a18('0xc')](function(_0xe985ee){logger[_0x5a18('0xd')]('MoveContactManagedDialer',_0x3bdb7c);logger[_0x5a18('0x10')]('MoveContactManagedDialer',_0x3bdb7c,JSON[_0x5a18('0x20')](_0xe985ee));_0x4be037(_0xe985ee);})[_0x5a18('0x14')](function(_0x302f27){logger[_0x5a18('0x12')]('MoveContactManagedDialer',_0x302f27[_0x5a18('0x13')],_0x3bdb7c);_0xb6e3f8(_0x3d19fb['error'](0x1f4,_0x302f27[_0x5a18('0x13')]));});});};exports[_0x5a18('0x3d')]=function(_0x30ef9d){var _0x3e742a=this;return new Promise(function(_0x22bf7e,_0x508eee){return db[_0x5a18('0x16')][_0x5a18('0x17')]({'raw':_0x30ef9d[_0x5a18('0x18')]?_0x30ef9d['options'][_0x5a18('0x19')]===undefined?!![]:![]:!![],'where':_0x30ef9d[_0x5a18('0x18')]?_0x30ef9d[_0x5a18('0x18')][_0x5a18('0x1a')]||null:null,'attributes':[[db[_0x5a18('0x2d')]['fn'](_0x5a18('0x3e'),db[_0x5a18('0x2d')]['fn']('IF',db['sequelize']['literal'](_0x5a18('0x3f')+util[_0x5a18('0x40')]('\x22%s\x22',moment()[_0x5a18('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x5a18('0x41')]]})[_0x5a18('0xc')](function(_0x1b6345){logger[_0x5a18('0xd')](_0x5a18('0x3d'),_0x30ef9d);logger['debug'](_0x5a18('0x3d'),_0x30ef9d,JSON[_0x5a18('0x20')](_0x1b6345));_0x22bf7e(_0x1b6345);})[_0x5a18('0x14')](function(_0x4de516){logger[_0x5a18('0x12')]('CountReScheduled',_0x4de516['message'],_0x30ef9d);_0x508eee(_0x3e742a[_0x5a18('0x12')](0x1f4,_0x4de516[_0x5a18('0x13')]));});});};exports[_0x5a18('0x42')]=function(_0x4a8533){var _0x5d4186=this;return new Promise(function(_0x4d0740,_0x3e5bdc){return db[_0x5a18('0x2b')]['describe']()[_0x5a18('0xc')](function(_0x3f233f){return db[_0x5a18('0x2d')]['transaction'](function(_0x742820){return db['CmHopper'][_0x5a18('0x17')]({'where':_0x4a8533[_0x5a18('0x18')]?_0x4a8533['options']['where']||null:null,'attributes':_0x4a8533[_0x5a18('0x18')]?_0x4a8533[_0x5a18('0x18')][_0x5a18('0x1b')]||null:null,'limit':0x1,'order':_0x4a8533[_0x5a18('0x18')]?_0x4a8533[_0x5a18('0x18')][_0x5a18('0x2f')]||null:null,'group':db[_0x5a18('0x16')][_0x5a18('0x43')],'transaction':_0x742820,'lock':_0x742820['LOCK'][_0x5a18('0x31')],'include':_0x4a8533[_0x5a18('0x18')]?_0x4a8533[_0x5a18('0x18')][_0x5a18('0x1d')]?_[_0x5a18('0x1e')](_0x4a8533[_0x5a18('0x18')][_0x5a18('0x1d')],function(_0x5bd0b2){return{'model':db[_0x5bd0b2[_0x5a18('0x1f')]],'as':_0x5bd0b2['as'],'attributes':_0x5bd0b2['attributes'],'include':_0x5bd0b2['include']?_[_0x5a18('0x1e')](_0x5bd0b2[_0x5a18('0x1d')],function(_0xd596be){return{'model':db[_0xd596be[_0x5a18('0x1f')]],'as':_0xd596be['as'],'attributes':_0xd596be[_0x5a18('0x1b')],'include':_0xd596be[_0x5a18('0x1d')]?_[_0x5a18('0x1e')](_0xd596be[_0x5a18('0x1d')],function(_0x167c5f){return{'model':db[_0x167c5f[_0x5a18('0x1f')]],'as':_0x167c5f['as'],'attributes':_0x167c5f[_0x5a18('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5a18('0xc')](function(_0x1a111b){var _0x467fcb=[];for(var _0x39cd34=0x0;_0x39cd34<_0x1a111b[_0x5a18('0x38')];_0x39cd34+=0x1){_0x467fcb[_0x5a18('0x3a')](_0x1a111b[_0x39cd34][_0x5a18('0x26')](_0x4a8533[_0x5a18('0x25')],{'transaction':_0x742820}));}return BPromise[_0x5a18('0x3b')](_0x467fcb);});})[_0x5a18('0xc')](function(_0x1cc475){logger[_0x5a18('0xd')](_0x5a18('0x42'),_0x4a8533);logger[_0x5a18('0x10')](_0x5a18('0x42'),_0x4a8533,JSON['stringify'](_0x1cc475));_0x4d0740(_0x1cc475);})[_0x5a18('0x14')](function(_0x391327){logger[_0x5a18('0x12')]('GetContactRecallMe',_0x391327[_0x5a18('0x13')],_0x4a8533);_0x3e5bdc(_0x5d4186[_0x5a18('0x12')](0x1f4,_0x391327['message']));});});});};exports[_0x5a18('0x44')]=function(_0x1989b9){var _0x28a7a9=this;return new Promise(function(_0x4b4296,_0x249052){db[_0x5a18('0x2b')][_0x5a18('0x2c')]()[_0x5a18('0xc')](function(_0x2f46fa){return db[_0x5a18('0x16')][_0x5a18('0x17')]({'raw':_0x1989b9['options']?_0x1989b9['options']['raw']===undefined?!![]:![]:!![],'where':_0x1989b9[_0x5a18('0x18')]?_0x1989b9[_0x5a18('0x18')]['where']||null:null,'attributes':_0x1989b9[_0x5a18('0x18')]?_0x1989b9[_0x5a18('0x18')][_0x5a18('0x1b')]||null:null,'limit':_0x1989b9[_0x5a18('0x18')]?_0x1989b9['options'][_0x5a18('0x1c')]||null:null,'include':_0x1989b9['options']?_0x1989b9[_0x5a18('0x18')][_0x5a18('0x1d')]?_['map'](_0x1989b9[_0x5a18('0x18')]['include'],function(_0x43b43e){return{'model':db[_0x43b43e[_0x5a18('0x1f')]],'as':_0x43b43e['as'],'attributes':_0x43b43e['as']==='Contact'?_[_0x5a18('0x33')](_0x2f46fa):_0x43b43e[_0x5a18('0x1b')],'include':_0x43b43e['include']?_['map'](_0x43b43e['include'],function(_0x902c06){return{'model':db[_0x902c06[_0x5a18('0x1f')]],'as':_0x902c06['as'],'attributes':_0x902c06['attributes'],'include':_0x902c06[_0x5a18('0x1d')]?_['map'](_0x902c06[_0x5a18('0x1d')],function(_0x5159f4){return{'model':db[_0x5159f4[_0x5a18('0x1f')]],'as':_0x5159f4['as'],'attributes':_0x5159f4[_0x5a18('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5a18('0xc')](function(_0x5257ba){logger[_0x5a18('0xd')]('GetCmHopper',_0x1989b9);logger[_0x5a18('0x10')]('GetCmHopper',_0x1989b9,JSON[_0x5a18('0x20')](_0x5257ba));_0x4b4296(_0x5257ba);})[_0x5a18('0x14')](function(_0x99615d){logger[_0x5a18('0x12')]('GetCmHopper',_0x99615d[_0x5a18('0x13')],_0x1989b9);_0x249052(_0x28a7a9[_0x5a18('0x12')](0x1f4,_0x99615d[_0x5a18('0x13')]));});});});}; \ No newline at end of file +var _0xe259=['where','ShowCmHopper','CreateCmHopper','create','then','UpdateCmHopper','update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','CmHopperFinal','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','attributes','include','map','model','CmHopper','raw'];(function(_0x1b01da,_0x1c5aef){var _0x259c08=function(_0x167d38){while(--_0x167d38){_0x1b01da['push'](_0x1b01da['shift']());}};_0x259c08(++_0x1c5aef);}(_0xe259,0x6e));var _0x9e25=function(_0x3cc0a8,_0x34360f){_0x3cc0a8=_0x3cc0a8-0x0;var _0x1f0229=_0xe259[_0x3cc0a8];return _0x1f0229;};'use strict';var _=require(_0x9e25('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e25('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e25('0x2'));var db=require(_0x9e25('0x3'))['db'];var utils=require(_0x9e25('0x4'));var logger=require(_0x9e25('0x5'))(_0x9e25('0x6'));var config=require(_0x9e25('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9e25('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2faa2f,_0x401368,_0x20b481){return new BPromise(function(_0x2125eb,_0x4ad4a5){return client[_0x9e25('0x9')](_0x2faa2f,_0x20b481)['then'](function(_0x462518){logger[_0x9e25('0xa')](_0x9e25('0xb'),_0x401368,_0x9e25('0xc'));logger[_0x9e25('0xd')](_0x9e25('0xe'),_0x401368,_0x9e25('0xc'),JSON[_0x9e25('0xf')](_0x462518));if(_0x462518[_0x9e25('0x10')]){if(_0x462518[_0x9e25('0x10')][_0x9e25('0x11')]===0x1f4){logger[_0x9e25('0x10')](_0x9e25('0xb'),_0x401368,_0x462518[_0x9e25('0x10')][_0x9e25('0x12')]);return _0x4ad4a5(_0x462518[_0x9e25('0x10')][_0x9e25('0x12')]);}logger[_0x9e25('0x10')](_0x9e25('0xb'),_0x401368,_0x462518[_0x9e25('0x10')][_0x9e25('0x12')]);return _0x2125eb(_0x462518[_0x9e25('0x10')][_0x9e25('0x12')]);}else{logger[_0x9e25('0xa')](_0x9e25('0xb'),_0x401368,_0x9e25('0xc'));_0x2125eb(_0x462518[_0x9e25('0x13')][_0x9e25('0x12')]);}})[_0x9e25('0x14')](function(_0x5b6d34){logger[_0x9e25('0x10')]('CmHopper,\x20%s,\x20%s',_0x401368,_0x5b6d34);_0x4ad4a5(_0x5b6d34);});});}exports[_0x9e25('0x15')]=function(_0x420bf9){var _0x2f6c21=this;return new Promise(function(_0x5d2f89,_0x3c1661){return db['CmHopper'][_0x9e25('0x16')]({'raw':_0x420bf9[_0x9e25('0x17')]?_0x420bf9[_0x9e25('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x420bf9[_0x9e25('0x17')]?_0x420bf9[_0x9e25('0x17')]['where']||null:null,'attributes':_0x420bf9[_0x9e25('0x17')]?_0x420bf9[_0x9e25('0x17')][_0x9e25('0x18')]||null:null,'limit':_0x420bf9['options']?_0x420bf9[_0x9e25('0x17')]['limit']||null:null,'include':_0x420bf9['options']?_0x420bf9[_0x9e25('0x17')][_0x9e25('0x19')]?_[_0x9e25('0x1a')](_0x420bf9['options'][_0x9e25('0x19')],function(_0x566bf6){return{'model':db[_0x566bf6[_0x9e25('0x1b')]],'as':_0x566bf6['as'],'attributes':_0x566bf6[_0x9e25('0x18')],'include':_0x566bf6['include']?_['map'](_0x566bf6[_0x9e25('0x19')],function(_0x1ecb06){return{'model':db[_0x1ecb06['model']],'as':_0x1ecb06['as'],'attributes':_0x1ecb06[_0x9e25('0x18')],'include':_0x1ecb06['include']?_[_0x9e25('0x1a')](_0x1ecb06[_0x9e25('0x19')],function(_0x4060f0){return{'model':db[_0x4060f0[_0x9e25('0x1b')]],'as':_0x4060f0['as'],'attributes':_0x4060f0[_0x9e25('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55664b){logger['info'](_0x9e25('0x15'),_0x420bf9);logger[_0x9e25('0xd')]('GetCmHopper',_0x420bf9,JSON[_0x9e25('0xf')](_0x55664b));_0x5d2f89(_0x55664b);})[_0x9e25('0x14')](function(_0x369db5){logger[_0x9e25('0x10')](_0x9e25('0x15'),_0x369db5['message'],_0x420bf9);_0x3c1661(_0x2f6c21[_0x9e25('0x10')](0x1f4,_0x369db5[_0x9e25('0x12')]));});});};exports['ShowCmHopper']=function(_0x41ebd7){var _0x3e6fb7=this;return new Promise(function(_0x5e2538,_0x2ed8be){return db[_0x9e25('0x1c')]['find']({'raw':_0x41ebd7[_0x9e25('0x17')]?_0x41ebd7['options'][_0x9e25('0x1d')]===undefined?!![]:![]:!![],'where':_0x41ebd7['options']?_0x41ebd7[_0x9e25('0x17')][_0x9e25('0x1e')]||null:null,'attributes':_0x41ebd7[_0x9e25('0x17')]?_0x41ebd7[_0x9e25('0x17')]['attributes']||null:null,'include':_0x41ebd7['options']?_0x41ebd7[_0x9e25('0x17')]['include']?_[_0x9e25('0x1a')](_0x41ebd7['options'][_0x9e25('0x19')],function(_0x2f7032){return{'model':db[_0x2f7032[_0x9e25('0x1b')]],'as':_0x2f7032['as'],'attributes':_0x2f7032['attributes'],'include':_0x2f7032[_0x9e25('0x19')]?_[_0x9e25('0x1a')](_0x2f7032[_0x9e25('0x19')],function(_0x35d955){return{'model':db[_0x35d955['model']],'as':_0x35d955['as'],'attributes':_0x35d955[_0x9e25('0x18')],'include':_0x35d955['include']?_[_0x9e25('0x1a')](_0x35d955['include'],function(_0x193aaf){return{'model':db[_0x193aaf[_0x9e25('0x1b')]],'as':_0x193aaf['as'],'attributes':_0x193aaf[_0x9e25('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f1339){logger[_0x9e25('0xa')](_0x9e25('0x1f'),_0x41ebd7);logger[_0x9e25('0xd')](_0x9e25('0x1f'),_0x41ebd7,JSON[_0x9e25('0xf')](_0x5f1339));_0x5e2538(_0x5f1339);})[_0x9e25('0x14')](function(_0x380dc5){logger[_0x9e25('0x10')]('ShowCmHopper',_0x380dc5[_0x9e25('0x12')],_0x41ebd7);_0x2ed8be(_0x3e6fb7[_0x9e25('0x10')](0x1f4,_0x380dc5[_0x9e25('0x12')]));});});};exports[_0x9e25('0x20')]=function(_0x3a23e0){var _0x3a4cbf=this;return new Promise(function(_0x3f2229,_0x33b299){return db[_0x9e25('0x1c')][_0x9e25('0x21')](_0x3a23e0['body'],{'raw':_0x3a23e0[_0x9e25('0x17')]?_0x3a23e0[_0x9e25('0x17')][_0x9e25('0x1d')]===undefined?!![]:![]:!![]})[_0x9e25('0x22')](function(_0x1832ae){logger[_0x9e25('0xa')](_0x9e25('0x20'),_0x3a23e0);logger['debug']('CreateCmHopper',_0x3a23e0,JSON[_0x9e25('0xf')](_0x1832ae));_0x3f2229(_0x1832ae);})[_0x9e25('0x14')](function(_0x58dcdc){logger['error'](_0x9e25('0x20'),_0x58dcdc['message'],_0x3a23e0);_0x33b299(_0x3a4cbf['error'](0x1f4,_0x58dcdc['message']));});});};exports[_0x9e25('0x23')]=function(_0x55f30c){var _0x4f4861=this;return new Promise(function(_0x12be28,_0x2a0bc1){return db[_0x9e25('0x1c')][_0x9e25('0x24')](_0x55f30c[_0x9e25('0x25')],{'raw':_0x55f30c[_0x9e25('0x17')]?_0x55f30c[_0x9e25('0x17')][_0x9e25('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f30c[_0x9e25('0x17')]?_0x55f30c[_0x9e25('0x17')][_0x9e25('0x1e')]||null:null,'attributes':_0x55f30c[_0x9e25('0x17')]?_0x55f30c[_0x9e25('0x17')][_0x9e25('0x18')]||null:null,'limit':_0x55f30c[_0x9e25('0x17')]?_0x55f30c[_0x9e25('0x17')]['limit']||null:null})['then'](function(_0x1a2fc1){logger['info'](_0x9e25('0x23'),_0x55f30c);logger['debug'](_0x9e25('0x23'),_0x55f30c,JSON['stringify'](_0x1a2fc1));_0x12be28(_0x1a2fc1);})['catch'](function(_0x1e2ed4){logger[_0x9e25('0x10')](_0x9e25('0x23'),_0x1e2ed4[_0x9e25('0x12')],_0x55f30c);_0x2a0bc1(_0x4f4861[_0x9e25('0x10')](0x1f4,_0x1e2ed4[_0x9e25('0x12')]));});});};exports[_0x9e25('0x26')]=function(_0x3a3a68){var _0x44d99a=this;return new Promise(function(_0x56ef81,_0x35715f){return db[_0x9e25('0x1c')][_0x9e25('0x27')]({'where':_0x3a3a68[_0x9e25('0x17')]?_0x3a3a68['options'][_0x9e25('0x1e')]||null:null})['then'](function(_0x44f6bf){logger[_0x9e25('0xa')](_0x9e25('0x26'),_0x3a3a68);logger['debug'](_0x9e25('0x26'),_0x3a3a68,JSON[_0x9e25('0xf')](_0x44f6bf));_0x56ef81(_0x44f6bf);})[_0x9e25('0x14')](function(_0x49cd88){logger[_0x9e25('0x10')](_0x9e25('0x26'),_0x49cd88[_0x9e25('0x12')],_0x3a3a68);_0x35715f(_0x44d99a[_0x9e25('0x10')](0x1f4,_0x49cd88[_0x9e25('0x12')]));});});};exports[_0x9e25('0x28')]=function(_0x573e80){var _0x22b0e2=this;return new Promise(function(_0x24ae57,_0xefaedf){return db[_0x9e25('0x29')][_0x9e25('0x2a')]()[_0x9e25('0x22')](function(_0x123d72){return db[_0x9e25('0x2b')][_0x9e25('0x2c')](function(_0x46e26a){return db[_0x9e25('0x1c')][_0x9e25('0x16')]({'where':_0x573e80[_0x9e25('0x17')]?_0x573e80[_0x9e25('0x17')][_0x9e25('0x1e')]||null:null,'attributes':_0x573e80[_0x9e25('0x17')]?_0x573e80['options'][_0x9e25('0x18')]||null:null,'limit':_0x573e80[_0x9e25('0x17')]?_0x573e80['options']['limit']||null:null,'order':_0x573e80['options']?_0x573e80[_0x9e25('0x17')][_0x9e25('0x2d')]||null:null,'transaction':_0x46e26a,'lock':_0x46e26a[_0x9e25('0x2e')][_0x9e25('0x2f')],'include':[{'model':db['CmContact'],'as':_0x9e25('0x30'),'attributes':_[_0x9e25('0x31')](_0x123d72)},{'model':db[_0x9e25('0x32')],'as':'Agent','attributes':['id','name',_0x9e25('0x33')]}]})[_0x9e25('0x22')](function(_0x417c76){var _0x412c6f=[];var _0x477244=[];for(var _0x32e714=0x0;_0x32e714<_0x417c76[_0x9e25('0x34')];_0x32e714+=0x1){var _0x2584df=_0x417c76[_0x32e714][_0x9e25('0x35')];if(_0x2584df===null){_0x412c6f[_0x9e25('0x36')](_0x417c76[_0x32e714][_0x9e25('0x24')](_0x573e80[_0x9e25('0x25')],{'transaction':_0x46e26a}));}else if(!_0x477244[_0x9e25('0x37')](_0x2584df)){_0x477244[_0x9e25('0x36')](_0x2584df);_0x412c6f['push'](_0x417c76[_0x32e714][_0x9e25('0x24')](_0x573e80[_0x9e25('0x25')],{'transaction':_0x46e26a}));}}return BPromise[_0x9e25('0x38')](_0x412c6f);});})['then'](function(_0x53d83c){logger[_0x9e25('0xa')](_0x9e25('0x28'),_0x573e80);logger[_0x9e25('0xd')](_0x9e25('0x28'),_0x573e80,JSON[_0x9e25('0xf')](_0x53d83c));_0x24ae57(_0x53d83c);})[_0x9e25('0x14')](function(_0xa6d1af){logger['error']('GetContactDialer',_0xa6d1af['message'],_0x573e80);_0xefaedf(_0x22b0e2['error'](0x1f4,_0xa6d1af[_0x9e25('0x12')]));});});});};exports[_0x9e25('0x39')]=function(_0x11b54c){var _0x27bfff=this;return new Promise(function(_0x216b41,_0x4455de){return db[_0x9e25('0x2b')][_0x9e25('0x2c')](function(_0x51170e){return db[_0x9e25('0x3a')][_0x9e25('0x21')](_0x11b54c['body'],{'raw':_0x11b54c[_0x9e25('0x17')]?_0x11b54c[_0x9e25('0x17')][_0x9e25('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x51170e})[_0x9e25('0x22')](function(){return db[_0x9e25('0x1c')][_0x9e25('0x27')]({'where':_0x11b54c['options']?_0x11b54c[_0x9e25('0x17')][_0x9e25('0x1e')]||null:null,'transaction':_0x51170e});});})[_0x9e25('0x22')](function(_0x365523){logger['info']('MoveContactManagedDialer',_0x11b54c);logger[_0x9e25('0xd')](_0x9e25('0x39'),_0x11b54c,JSON[_0x9e25('0xf')](_0x365523));_0x216b41(_0x365523);})[_0x9e25('0x14')](function(_0xfe63f1){logger[_0x9e25('0x10')](_0x9e25('0x39'),_0xfe63f1[_0x9e25('0x12')],_0x11b54c);_0x4455de(_0x27bfff[_0x9e25('0x10')](0x1f4,_0xfe63f1[_0x9e25('0x12')]));});});};exports['CountReScheduled']=function(_0x3aaca3){var _0x4b6348=this;return new Promise(function(_0x5df300,_0x8f1525){return db['CmHopper']['findAll']({'raw':_0x3aaca3['options']?_0x3aaca3[_0x9e25('0x17')][_0x9e25('0x1d')]===undefined?!![]:![]:!![],'where':_0x3aaca3[_0x9e25('0x17')]?_0x3aaca3['options'][_0x9e25('0x1e')]||null:null,'attributes':[[db[_0x9e25('0x2b')]['fn'](_0x9e25('0x3b'),db[_0x9e25('0x2b')]['fn']('IF',db['sequelize'][_0x9e25('0x3c')]('`scheduledat`\x20>=\x20'+util[_0x9e25('0x3d')](_0x9e25('0x3e'),moment()[_0x9e25('0x3d')](_0x9e25('0x3f')))+_0x9e25('0x40')))),_0x9e25('0x41')]]})['then'](function(_0x1d6e70){logger[_0x9e25('0xa')]('CountReScheduled',_0x3aaca3);logger[_0x9e25('0xd')]('CountReScheduled',_0x3aaca3,JSON['stringify'](_0x1d6e70));_0x5df300(_0x1d6e70);})[_0x9e25('0x14')](function(_0x467fda){logger[_0x9e25('0x10')](_0x9e25('0x42'),_0x467fda['message'],_0x3aaca3);_0x8f1525(_0x4b6348[_0x9e25('0x10')](0x1f4,_0x467fda[_0x9e25('0x12')]));});});};exports[_0x9e25('0x43')]=function(_0x801880){var _0x5c88d8=this;return new Promise(function(_0x2121c7,_0x53cc4f){return db[_0x9e25('0x29')][_0x9e25('0x2a')]()[_0x9e25('0x22')](function(_0x10f650){return db[_0x9e25('0x2b')][_0x9e25('0x2c')](function(_0x362a4e){return db[_0x9e25('0x1c')][_0x9e25('0x16')]({'where':_0x801880['options']?_0x801880['options'][_0x9e25('0x1e')]||null:null,'attributes':_0x801880[_0x9e25('0x17')]?_0x801880[_0x9e25('0x17')][_0x9e25('0x18')]||null:null,'limit':0x1,'order':_0x801880[_0x9e25('0x17')]?_0x801880[_0x9e25('0x17')][_0x9e25('0x2d')]||null:null,'group':db[_0x9e25('0x1c')][_0x9e25('0x35')],'transaction':_0x362a4e,'lock':_0x362a4e['LOCK']['UPDATE'],'include':_0x801880[_0x9e25('0x17')]?_0x801880[_0x9e25('0x17')][_0x9e25('0x19')]?_[_0x9e25('0x1a')](_0x801880[_0x9e25('0x17')][_0x9e25('0x19')],function(_0x305f85){return{'model':db[_0x305f85[_0x9e25('0x1b')]],'as':_0x305f85['as'],'attributes':_0x305f85['attributes'],'include':_0x305f85[_0x9e25('0x19')]?_[_0x9e25('0x1a')](_0x305f85[_0x9e25('0x19')],function(_0x2324e7){return{'model':db[_0x2324e7[_0x9e25('0x1b')]],'as':_0x2324e7['as'],'attributes':_0x2324e7[_0x9e25('0x18')],'include':_0x2324e7[_0x9e25('0x19')]?_[_0x9e25('0x1a')](_0x2324e7['include'],function(_0x1249da){return{'model':db[_0x1249da[_0x9e25('0x1b')]],'as':_0x1249da['as'],'attributes':_0x1249da[_0x9e25('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e25('0x22')](function(_0x4f049f){var _0x44d4c5=[];for(var _0xf8fb49=0x0;_0xf8fb49<_0x4f049f[_0x9e25('0x34')];_0xf8fb49+=0x1){_0x44d4c5[_0x9e25('0x36')](_0x4f049f[_0xf8fb49][_0x9e25('0x24')](_0x801880['body'],{'transaction':_0x362a4e}));}return BPromise[_0x9e25('0x38')](_0x44d4c5);});})['then'](function(_0x362f7a){logger[_0x9e25('0xa')](_0x9e25('0x43'),_0x801880);logger[_0x9e25('0xd')]('GetContactRecallMe',_0x801880,JSON[_0x9e25('0xf')](_0x362f7a));_0x2121c7(_0x362f7a);})[_0x9e25('0x14')](function(_0x1914f7){logger[_0x9e25('0x10')]('GetContactRecallMe',_0x1914f7[_0x9e25('0x12')],_0x801880);_0x53cc4f(_0x5c88d8[_0x9e25('0x10')](0x1f4,_0x1914f7[_0x9e25('0x12')]));});});});};exports[_0x9e25('0x44')]=function(_0xf0844c){var _0x2da155=this;return new Promise(function(_0x535465,_0x595f44){db['CmContact'][_0x9e25('0x2a')]()[_0x9e25('0x22')](function(_0x4ec289){return db[_0x9e25('0x1c')][_0x9e25('0x16')]({'raw':_0xf0844c[_0x9e25('0x17')]?_0xf0844c[_0x9e25('0x17')][_0x9e25('0x1d')]===undefined?!![]:![]:!![],'where':_0xf0844c[_0x9e25('0x17')]?_0xf0844c[_0x9e25('0x17')][_0x9e25('0x1e')]||null:null,'attributes':_0xf0844c[_0x9e25('0x17')]?_0xf0844c[_0x9e25('0x17')][_0x9e25('0x18')]||null:null,'limit':_0xf0844c[_0x9e25('0x17')]?_0xf0844c[_0x9e25('0x17')][_0x9e25('0x45')]||null:null,'include':_0xf0844c[_0x9e25('0x17')]?_0xf0844c[_0x9e25('0x17')]['include']?_[_0x9e25('0x1a')](_0xf0844c[_0x9e25('0x17')][_0x9e25('0x19')],function(_0x3b74d1){return{'model':db[_0x3b74d1[_0x9e25('0x1b')]],'as':_0x3b74d1['as'],'attributes':_0x3b74d1['as']==='Contact'?_[_0x9e25('0x31')](_0x4ec289):_0x3b74d1['attributes'],'include':_0x3b74d1['include']?_['map'](_0x3b74d1[_0x9e25('0x19')],function(_0x5cb54f){return{'model':db[_0x5cb54f[_0x9e25('0x1b')]],'as':_0x5cb54f['as'],'attributes':_0x5cb54f[_0x9e25('0x18')],'include':_0x5cb54f[_0x9e25('0x19')]?_[_0x9e25('0x1a')](_0x5cb54f[_0x9e25('0x19')],function(_0x8d4544){return{'model':db[_0x8d4544[_0x9e25('0x1b')]],'as':_0x8d4544['as'],'attributes':_0x8d4544[_0x9e25('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9e25('0x22')](function(_0x1b0d96){logger['info'](_0x9e25('0x15'),_0xf0844c);logger[_0x9e25('0xd')](_0x9e25('0x15'),_0xf0844c,JSON[_0x9e25('0xf')](_0x1b0d96));_0x535465(_0x1b0d96);})[_0x9e25('0x14')](function(_0x33335c){logger[_0x9e25('0x10')](_0x9e25('0x15'),_0x33335c[_0x9e25('0x12')],_0xf0844c);_0x595f44(_0x2da155['error'](0x1f4,_0x33335c[_0x9e25('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 630b75c..aae226e 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 _0xe959=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id','post','/preview','getPreview','put','update','delete','destroy'];(function(_0x25f7ba,_0xc13563){var _0x5edb08=function(_0x1457c9){while(--_0x1457c9){_0x25f7ba['push'](_0x25f7ba['shift']());}};_0x5edb08(++_0xc13563);}(_0xe959,0x143));var _0x9e95=function(_0x180a75,_0x1d8498){_0x180a75=_0x180a75-0x0;var _0x3a7559=_0xe959[_0x180a75];return _0x3a7559;};'use strict';var multer=require(_0x9e95('0x0'));var util=require(_0x9e95('0x1'));var path=require(_0x9e95('0x2'));var timeout=require(_0x9e95('0x3'));var express=require(_0x9e95('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9e95('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e95('0x6'));var controller=require(_0x9e95('0x7'));router[_0x9e95('0x8')]('/',auth[_0x9e95('0x9')](),controller[_0x9e95('0xa')]);router[_0x9e95('0x8')](_0x9e95('0xb'),auth[_0x9e95('0x9')](),controller['describe']);router[_0x9e95('0x8')](_0x9e95('0xc'),auth[_0x9e95('0x9')](),controller[_0x9e95('0xd')]);router[_0x9e95('0x8')](_0x9e95('0xe'),auth[_0x9e95('0x9')](),controller['show']);router[_0x9e95('0xf')]('/',auth[_0x9e95('0x9')](),controller['create']);router['post'](_0x9e95('0x10'),auth[_0x9e95('0x9')](),controller[_0x9e95('0x11')]);router[_0x9e95('0x12')]('/:id',auth[_0x9e95('0x9')](),controller[_0x9e95('0x13')]);router[_0x9e95('0x14')](_0x9e95('0xe'),auth['isAuthenticated'](),controller[_0x9e95('0x15')]);module[_0x9e95('0x16')]=router; \ No newline at end of file +var _0x5ada=['isAuthenticated','/describe','describe','/opencontacts','getOpenContacts','/:id','post','create','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get'];(function(_0x4812e0,_0x2ccf3c){var _0x252e0f=function(_0x14cdb8){while(--_0x14cdb8){_0x4812e0['push'](_0x4812e0['shift']());}};_0x252e0f(++_0x2ccf3c);}(_0x5ada,0x168));var _0xa5ad=function(_0x26b2a2,_0x50428a){_0x26b2a2=_0x26b2a2-0x0;var _0x139d27=_0x5ada[_0x26b2a2];return _0x139d27;};'use strict';var multer=require(_0xa5ad('0x0'));var util=require(_0xa5ad('0x1'));var path=require(_0xa5ad('0x2'));var timeout=require(_0xa5ad('0x3'));var express=require('express');var router=express[_0xa5ad('0x4')]();var fs_extra=require(_0xa5ad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa5ad('0x6'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0xa5ad('0x7')]('/',auth[_0xa5ad('0x8')](),controller['index']);router[_0xa5ad('0x7')](_0xa5ad('0x9'),auth[_0xa5ad('0x8')](),controller[_0xa5ad('0xa')]);router[_0xa5ad('0x7')](_0xa5ad('0xb'),auth[_0xa5ad('0x8')](),controller[_0xa5ad('0xc')]);router[_0xa5ad('0x7')](_0xa5ad('0xd'),auth[_0xa5ad('0x8')](),controller['show']);router[_0xa5ad('0xe')]('/',auth[_0xa5ad('0x8')](),controller[_0xa5ad('0xf')]);router[_0xa5ad('0xe')](_0xa5ad('0x10'),auth['isAuthenticated'](),controller[_0xa5ad('0x11')]);router[_0xa5ad('0x12')]('/:id',auth[_0xa5ad('0x8')](),controller[_0xa5ad('0x13')]);router[_0xa5ad('0x14')](_0xa5ad('0xd'),auth[_0xa5ad('0x8')](),controller[_0xa5ad('0x15')]);module[_0xa5ad('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index ce353d9..6ff1a2e 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 _0x31af=['contactListQueue','INTEGER','moment','sequelize','exports'];(function(_0x31bfee,_0x3ff4cb){var _0x18fa3a=function(_0x6a4efc){while(--_0x6a4efc){_0x31bfee['push'](_0x31bfee['shift']());}};_0x18fa3a(++_0x3ff4cb);}(_0x31af,0xde));var _0xf31a=function(_0x3c945d,_0x53dbb1){_0x3c945d=_0x3c945d-0x0;var _0xa6f5ac=_0x31af[_0x3c945d];return _0xa6f5ac;};'use strict';var moment=require(_0xf31a('0x0'));var Sequelize=require(_0xf31a('0x1'));module[_0xf31a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf31a('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xf31a('0x3')},'VoiceQueueId':{'type':Sequelize[_0xf31a('0x4')],'unique':_0xf31a('0x3')}}; \ No newline at end of file +var _0x036b=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x24d22f,_0xfa6241){var _0x33b153=function(_0x28caa6){while(--_0x28caa6){_0x24d22f['push'](_0x24d22f['shift']());}};_0x33b153(++_0xfa6241);}(_0x036b,0x145));var _0xb036=function(_0x226e5b,_0x4935ed){_0x226e5b=_0x226e5b-0x0;var _0x3c44d3=_0x036b[_0x226e5b];return _0x3c44d3;};'use strict';var moment=require(_0xb036('0x0'));var Sequelize=require(_0xb036('0x1'));module[_0xb036('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb036('0x3')],'unique':_0xb036('0x4')},'ListId':{'type':Sequelize[_0xb036('0x3')],'unique':_0xb036('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb036('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 6421942..e3f03a3 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 _0xa0df=['error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa0df,0x1f1));var _0xfa0d=function(_0x54a343,_0x319857){_0x54a343=_0x54a343-0x0;var _0x43fc88=_0xa0df[_0x54a343];return _0x43fc88;};'use strict';var emlformat=require(_0xfa0d('0x0'));var rimraf=require(_0xfa0d('0x1'));var zipdir=require(_0xfa0d('0x2'));var jsonpatch=require(_0xfa0d('0x3'));var rp=require(_0xfa0d('0x4'));var moment=require(_0xfa0d('0x5'));var BPromise=require(_0xfa0d('0x6'));var Mustache=require(_0xfa0d('0x7'));var util=require(_0xfa0d('0x8'));var path=require('path');var sox=require(_0xfa0d('0x9'));var csv=require(_0xfa0d('0xa'));var ejs=require(_0xfa0d('0xb'));var fs=require('fs');var fs_extra=require(_0xfa0d('0xc'));var _=require(_0xfa0d('0xd'));var squel=require(_0xfa0d('0xe'));var crypto=require(_0xfa0d('0xf'));var jsforce=require(_0xfa0d('0x10'));var deskjs=require(_0xfa0d('0x11'));var toCsv=require(_0xfa0d('0xa'));var querystring=require(_0xfa0d('0x12'));var Papa=require(_0xfa0d('0x13'));var Redis=require('ioredis');var authService=require(_0xfa0d('0x14'));var qs=require(_0xfa0d('0x15'));var as=require(_0xfa0d('0x16'));var hardwareService=require(_0xfa0d('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xfa0d('0x18'));var config=require(_0xfa0d('0x19'));var licenseUtil=require(_0xfa0d('0x1a'));var db=require(_0xfa0d('0x1b'))['db'];function respondWithStatusCode(_0x7681da,_0x3989a3){_0x3989a3=_0x3989a3||0xcc;return function(_0x8003f9){if(_0x8003f9){return _0x7681da[_0xfa0d('0x1c')](_0x3989a3);}return _0x7681da[_0xfa0d('0x1d')](_0x3989a3)[_0xfa0d('0x1e')]();};}function respondWithResult(_0xc63dee,_0x4a7649){_0x4a7649=_0x4a7649||0xc8;return function(_0x23d557){if(_0x23d557){return _0xc63dee[_0xfa0d('0x1d')](_0x4a7649)[_0xfa0d('0x1f')](_0x23d557);}};}function respondWithFilteredResult(_0x11137e,_0x1e4f99){return function(_0x32386e){if(_0x32386e){var _0x1d2b09=typeof _0x1e4f99[_0xfa0d('0x20')]===_0xfa0d('0x21')&&typeof _0x1e4f99[_0xfa0d('0x22')]===_0xfa0d('0x21');var _0xc7c9e2=_0x32386e[_0xfa0d('0x23')];var _0x30c8e4=_0x1d2b09?0x0:_0x1e4f99[_0xfa0d('0x20')];var _0x1ff88f=_0x1d2b09?_0x32386e[_0xfa0d('0x23')]:_0x1e4f99[_0xfa0d('0x20')]+_0x1e4f99['limit'];var _0x486ede;if(_0x1ff88f>=_0xc7c9e2){_0x1ff88f=_0xc7c9e2;_0x486ede=0xc8;}else{_0x486ede=0xce;}_0x11137e[_0xfa0d('0x1d')](_0x486ede);return _0x11137e[_0xfa0d('0x24')]('Content-Range',_0x30c8e4+'-'+_0x1ff88f+'/'+_0xc7c9e2)[_0xfa0d('0x1f')](_0x32386e);}return null;};}function patchUpdates(_0x2b8db1){return function(_0x2d325f){try{jsonpatch['apply'](_0x2d325f,_0x2b8db1,!![]);}catch(_0x39b54c){return BPromise[_0xfa0d('0x25')](_0x39b54c);}return _0x2d325f[_0xfa0d('0x26')]();};}function saveUpdates(_0x3a02a4,_0x439246){return function(_0x84548b){if(_0x84548b){return _0x84548b[_0xfa0d('0x27')](_0x3a02a4)['then'](function(_0x420d58){return _0x420d58;});}return null;};}function removeEntity(_0x29279a,_0x5f2372){return function(_0x3473f1){if(_0x3473f1){return _0x3473f1[_0xfa0d('0x28')]()[_0xfa0d('0x29')](function(){_0x29279a[_0xfa0d('0x1d')](0xcc)[_0xfa0d('0x1e')]();});}};}function handleEntityNotFound(_0x2dfc5f,_0x218863){return function(_0x42b24e){if(!_0x42b24e){_0x2dfc5f[_0xfa0d('0x1c')](0x194);}return _0x42b24e;};}function handleError(_0x404749,_0x5b8be8){_0x5b8be8=_0x5b8be8||0x1f4;return function(_0xbb590f){logger[_0xfa0d('0x2a')](_0xbb590f[_0xfa0d('0x2b')]);if(_0xbb590f[_0xfa0d('0x2c')]){delete _0xbb590f['name'];}_0x404749['status'](_0x5b8be8)[_0xfa0d('0x2d')](_0xbb590f);};}exports[_0xfa0d('0x2e')]=function(_0x56716d,_0x3832cf){var _0x17a917={},_0x20507e={},_0x5bc6b4={'count':0x0,'rows':[]};var _0x1f11c3=_[_0xfa0d('0x2f')](db[_0xfa0d('0x30')][_0xfa0d('0x31')],function(_0xf42423){return{'name':_0xf42423[_0xfa0d('0x32')],'type':_0xf42423[_0xfa0d('0x33')]['key']};});_0x20507e[_0xfa0d('0x34')]=_[_0xfa0d('0x2f')](_0x1f11c3,_0xfa0d('0x2c'));_0x20507e[_0xfa0d('0x35')]=_[_0xfa0d('0x36')](_0x56716d[_0xfa0d('0x35')]);_0x20507e[_0xfa0d('0x37')]=_[_0xfa0d('0x38')](_0x20507e['model'],_0x20507e[_0xfa0d('0x35')]);_0x17a917[_0xfa0d('0x39')]=_[_0xfa0d('0x38')](_0x20507e[_0xfa0d('0x34')],qs['fields'](_0x56716d[_0xfa0d('0x35')][_0xfa0d('0x3a')]));_0x17a917[_0xfa0d('0x39')]=_0x17a917[_0xfa0d('0x39')][_0xfa0d('0x3b')]?_0x17a917[_0xfa0d('0x39')]:_0x20507e[_0xfa0d('0x34')];if(!_0x56716d['query'][_0xfa0d('0x3c')](_0xfa0d('0x3d'))){_0x17a917['limit']=qs[_0xfa0d('0x22')](_0x56716d[_0xfa0d('0x35')][_0xfa0d('0x22')]);_0x17a917[_0xfa0d('0x20')]=qs[_0xfa0d('0x20')](_0x56716d[_0xfa0d('0x35')]['offset']);}_0x17a917[_0xfa0d('0x3e')]=qs[_0xfa0d('0x3f')](_0x56716d['query']['sort']);_0x17a917['where']=qs[_0xfa0d('0x37')](_[_0xfa0d('0x40')](_0x56716d['query'],_0x20507e['filters']),_0x1f11c3);if(_0x56716d['query']['filter']){_0x17a917[_0xfa0d('0x41')]=_[_0xfa0d('0x42')](_0x17a917[_0xfa0d('0x41')],{'$or':_[_0xfa0d('0x2f')](_0x1f11c3,function(_0x57e460){if(_0x57e460[_0xfa0d('0x33')]!=='VIRTUAL'){var _0x5d0c3e={};_0x5d0c3e[_0x57e460[_0xfa0d('0x2c')]]={'$like':'%'+_0x56716d[_0xfa0d('0x35')]['filter']+'%'};return _0x5d0c3e;}})});}_0x17a917=_[_0xfa0d('0x42')]({},_0x17a917,_0x56716d[_0xfa0d('0x43')]);var _0x37a076={'where':_0x17a917[_0xfa0d('0x41')]};return db[_0xfa0d('0x30')]['count'](_0x37a076)[_0xfa0d('0x29')](function(_0x1ae320){_0x5bc6b4[_0xfa0d('0x23')]=_0x1ae320;if(_0x56716d[_0xfa0d('0x35')][_0xfa0d('0x44')]){_0x17a917[_0xfa0d('0x45')]=[{'all':!![]}];}return db[_0xfa0d('0x30')][_0xfa0d('0x46')](_0x17a917);})[_0xfa0d('0x29')](function(_0x3d8e11){_0x5bc6b4[_0xfa0d('0x47')]=_0x3d8e11;return _0x5bc6b4;})[_0xfa0d('0x29')](respondWithFilteredResult(_0x3832cf,_0x17a917))[_0xfa0d('0x48')](handleError(_0x3832cf,null));};exports[_0xfa0d('0x49')]=function(_0x2f11f1,_0x3d5f87){var _0x5174d1={'raw':!![],'where':{'id':_0x2f11f1[_0xfa0d('0x4a')]['id']}},_0x469951={};_0x469951[_0xfa0d('0x34')]=_[_0xfa0d('0x36')](db[_0xfa0d('0x30')]['rawAttributes']);_0x469951[_0xfa0d('0x35')]=_[_0xfa0d('0x36')](_0x2f11f1['query']);_0x469951[_0xfa0d('0x37')]=_['intersection'](_0x469951[_0xfa0d('0x34')],_0x469951['query']);_0x5174d1[_0xfa0d('0x39')]=_[_0xfa0d('0x38')](_0x469951[_0xfa0d('0x34')],qs[_0xfa0d('0x3a')](_0x2f11f1[_0xfa0d('0x35')][_0xfa0d('0x3a')]));_0x5174d1[_0xfa0d('0x39')]=_0x5174d1['attributes'][_0xfa0d('0x3b')]?_0x5174d1[_0xfa0d('0x39')]:_0x469951[_0xfa0d('0x34')];if(_0x2f11f1[_0xfa0d('0x35')][_0xfa0d('0x44')]){_0x5174d1[_0xfa0d('0x45')]=[{'all':!![]}];}_0x5174d1=_[_0xfa0d('0x42')]({},_0x5174d1,_0x2f11f1[_0xfa0d('0x43')]);return db[_0xfa0d('0x30')][_0xfa0d('0x4b')](_0x5174d1)['then'](handleEntityNotFound(_0x3d5f87,null))[_0xfa0d('0x29')](respondWithResult(_0x3d5f87,null))[_0xfa0d('0x48')](handleError(_0x3d5f87,null));};exports[_0xfa0d('0x27')]=function(_0x7c8c0c,_0x15a90a){if(_0x7c8c0c[_0xfa0d('0x4c')]['id']){delete _0x7c8c0c['body']['id'];}return db[_0xfa0d('0x30')][_0xfa0d('0x4b')]({'where':{'id':_0x7c8c0c[_0xfa0d('0x4a')]['id']}})[_0xfa0d('0x29')](handleEntityNotFound(_0x15a90a,null))[_0xfa0d('0x29')](saveUpdates(_0x7c8c0c[_0xfa0d('0x4c')],null))['then'](respondWithResult(_0x15a90a,null))[_0xfa0d('0x48')](handleError(_0x15a90a,null));};exports['destroy']=function(_0xe28bbd,_0x2c9a09){return db[_0xfa0d('0x30')]['find']({'where':{'id':_0xe28bbd['params']['id']}})[_0xfa0d('0x29')](handleEntityNotFound(_0x2c9a09,null))[_0xfa0d('0x29')](removeEntity(_0x2c9a09,null))[_0xfa0d('0x48')](handleError(_0x2c9a09,null));};exports['describe']=function(_0x3c36b0,_0xca6ea){return db[_0xfa0d('0x30')]['describe']()[_0xfa0d('0x29')](respondWithResult(_0xca6ea,null))['catch'](handleError(_0xca6ea,null));}; \ No newline at end of file +var _0x2046=['count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','keys','CmHopperBlack','find','catch','body','destroy','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2046,0x195));var _0x6204=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2046[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x6204('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6204('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6204('0x2'));var moment=require(_0x6204('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6204('0x4'));var util=require(_0x6204('0x5'));var path=require(_0x6204('0x6'));var sox=require(_0x6204('0x7'));var csv=require(_0x6204('0x8'));var ejs=require(_0x6204('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6204('0xa'));var squel=require('squel');var crypto=require(_0x6204('0xb'));var jsforce=require(_0x6204('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6204('0x8'));var querystring=require(_0x6204('0xd'));var Papa=require('papaparse');var Redis=require(_0x6204('0xe'));var authService=require(_0x6204('0xf'));var qs=require(_0x6204('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6204('0x11'));var logger=require('../../config/logger')(_0x6204('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6204('0x13'));var db=require(_0x6204('0x14'))['db'];function respondWithStatusCode(_0x58b9d9,_0x4290df){_0x4290df=_0x4290df||0xcc;return function(_0xdd3974){if(_0xdd3974){return _0x58b9d9[_0x6204('0x15')](_0x4290df);}return _0x58b9d9['status'](_0x4290df)[_0x6204('0x16')]();};}function respondWithResult(_0x5f0cb0,_0x35c88a){_0x35c88a=_0x35c88a||0xc8;return function(_0x2b0fd1){if(_0x2b0fd1){return _0x5f0cb0[_0x6204('0x17')](_0x35c88a)['json'](_0x2b0fd1);}};}function respondWithFilteredResult(_0x2a909f,_0x4973c2){return function(_0x504e84){if(_0x504e84){var _0x375b6b=typeof _0x4973c2[_0x6204('0x18')]===_0x6204('0x19')&&typeof _0x4973c2[_0x6204('0x1a')]===_0x6204('0x19');var _0x4ed0e8=_0x504e84[_0x6204('0x1b')];var _0x51cd37=_0x375b6b?0x0:_0x4973c2[_0x6204('0x18')];var _0x1ba559=_0x375b6b?_0x504e84[_0x6204('0x1b')]:_0x4973c2[_0x6204('0x18')]+_0x4973c2[_0x6204('0x1a')];var _0x3eb6b;if(_0x1ba559>=_0x4ed0e8){_0x1ba559=_0x4ed0e8;_0x3eb6b=0xc8;}else{_0x3eb6b=0xce;}_0x2a909f['status'](_0x3eb6b);return _0x2a909f[_0x6204('0x1c')](_0x6204('0x1d'),_0x51cd37+'-'+_0x1ba559+'/'+_0x4ed0e8)[_0x6204('0x1e')](_0x504e84);}return null;};}function patchUpdates(_0xb43aed){return function(_0x58cfe1){try{jsonpatch[_0x6204('0x1f')](_0x58cfe1,_0xb43aed,!![]);}catch(_0x187e25){return BPromise[_0x6204('0x20')](_0x187e25);}return _0x58cfe1[_0x6204('0x21')]();};}function saveUpdates(_0xdb472d,_0x4eb61d){return function(_0x308f9c){if(_0x308f9c){return _0x308f9c[_0x6204('0x22')](_0xdb472d)[_0x6204('0x23')](function(_0x216352){return _0x216352;});}return null;};}function removeEntity(_0x471d4d,_0x12cf69){return function(_0x5ce0cd){if(_0x5ce0cd){return _0x5ce0cd['destroy']()[_0x6204('0x23')](function(){_0x471d4d[_0x6204('0x17')](0xcc)[_0x6204('0x16')]();});}};}function handleEntityNotFound(_0x256ed9,_0x3bd4a1){return function(_0x2b28d5){if(!_0x2b28d5){_0x256ed9[_0x6204('0x15')](0x194);}return _0x2b28d5;};}function handleError(_0x226b0b,_0x45a9cc){_0x45a9cc=_0x45a9cc||0x1f4;return function(_0x2cd403){logger[_0x6204('0x24')](_0x2cd403[_0x6204('0x25')]);if(_0x2cd403[_0x6204('0x26')]){delete _0x2cd403[_0x6204('0x26')];}_0x226b0b[_0x6204('0x17')](_0x45a9cc)[_0x6204('0x27')](_0x2cd403);};}exports[_0x6204('0x28')]=function(_0x3bf9c9,_0x25c69b){var _0x1f8fa3={},_0x3e87fa={},_0x48ecec={'count':0x0,'rows':[]};var _0x16cb7d=_[_0x6204('0x29')](db['CmHopperBlack']['rawAttributes'],function(_0xcf736b){return{'name':_0xcf736b[_0x6204('0x2a')],'type':_0xcf736b['type'][_0x6204('0x2b')]};});_0x3e87fa['model']=_[_0x6204('0x29')](_0x16cb7d,_0x6204('0x26'));_0x3e87fa[_0x6204('0x2c')]=_['keys'](_0x3bf9c9[_0x6204('0x2c')]);_0x3e87fa[_0x6204('0x2d')]=_[_0x6204('0x2e')](_0x3e87fa[_0x6204('0x2f')],_0x3e87fa[_0x6204('0x2c')]);_0x1f8fa3[_0x6204('0x30')]=_[_0x6204('0x2e')](_0x3e87fa[_0x6204('0x2f')],qs[_0x6204('0x31')](_0x3bf9c9[_0x6204('0x2c')]['fields']));_0x1f8fa3[_0x6204('0x30')]=_0x1f8fa3[_0x6204('0x30')][_0x6204('0x32')]?_0x1f8fa3[_0x6204('0x30')]:_0x3e87fa[_0x6204('0x2f')];if(!_0x3bf9c9[_0x6204('0x2c')]['hasOwnProperty'](_0x6204('0x33'))){_0x1f8fa3[_0x6204('0x1a')]=qs[_0x6204('0x1a')](_0x3bf9c9['query']['limit']);_0x1f8fa3[_0x6204('0x18')]=qs['offset'](_0x3bf9c9[_0x6204('0x2c')]['offset']);}_0x1f8fa3[_0x6204('0x34')]=qs[_0x6204('0x35')](_0x3bf9c9[_0x6204('0x2c')][_0x6204('0x35')]);_0x1f8fa3[_0x6204('0x36')]=qs[_0x6204('0x2d')](_[_0x6204('0x37')](_0x3bf9c9[_0x6204('0x2c')],_0x3e87fa[_0x6204('0x2d')]),_0x16cb7d);if(_0x3bf9c9[_0x6204('0x2c')][_0x6204('0x38')]){_0x1f8fa3[_0x6204('0x36')]=_[_0x6204('0x39')](_0x1f8fa3[_0x6204('0x36')],{'$or':_[_0x6204('0x29')](_0x16cb7d,function(_0x410a15){if(_0x410a15['type']!==_0x6204('0x3a')){var _0x56c50d={};_0x56c50d[_0x410a15['name']]={'$like':'%'+_0x3bf9c9[_0x6204('0x2c')]['filter']+'%'};return _0x56c50d;}})});}_0x1f8fa3=_[_0x6204('0x39')]({},_0x1f8fa3,_0x3bf9c9[_0x6204('0x3b')]);var _0x5b4a84={'where':_0x1f8fa3[_0x6204('0x36')]};return db['CmHopperBlack'][_0x6204('0x1b')](_0x5b4a84)['then'](function(_0x35350e){_0x48ecec[_0x6204('0x1b')]=_0x35350e;if(_0x3bf9c9[_0x6204('0x2c')][_0x6204('0x3c')]){_0x1f8fa3['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6204('0x3d')](_0x1f8fa3);})[_0x6204('0x23')](function(_0x107c04){_0x48ecec['rows']=_0x107c04;return _0x48ecec;})[_0x6204('0x23')](respondWithFilteredResult(_0x25c69b,_0x1f8fa3))['catch'](handleError(_0x25c69b,null));};exports[_0x6204('0x3e')]=function(_0x5c34cf,_0x5ea491){var _0x47fb47={'raw':!![],'where':{'id':_0x5c34cf[_0x6204('0x3f')]['id']}},_0x31771e={};_0x31771e[_0x6204('0x2f')]=_['keys'](db['CmHopperBlack'][_0x6204('0x40')]);_0x31771e['query']=_[_0x6204('0x41')](_0x5c34cf['query']);_0x31771e[_0x6204('0x2d')]=_[_0x6204('0x2e')](_0x31771e['model'],_0x31771e[_0x6204('0x2c')]);_0x47fb47[_0x6204('0x30')]=_[_0x6204('0x2e')](_0x31771e[_0x6204('0x2f')],qs[_0x6204('0x31')](_0x5c34cf[_0x6204('0x2c')][_0x6204('0x31')]));_0x47fb47['attributes']=_0x47fb47[_0x6204('0x30')]['length']?_0x47fb47[_0x6204('0x30')]:_0x31771e['model'];if(_0x5c34cf[_0x6204('0x2c')]['includeAll']){_0x47fb47['include']=[{'all':!![]}];}_0x47fb47=_[_0x6204('0x39')]({},_0x47fb47,_0x5c34cf[_0x6204('0x3b')]);return db[_0x6204('0x42')][_0x6204('0x43')](_0x47fb47)[_0x6204('0x23')](handleEntityNotFound(_0x5ea491,null))[_0x6204('0x23')](respondWithResult(_0x5ea491,null))[_0x6204('0x44')](handleError(_0x5ea491,null));};exports[_0x6204('0x22')]=function(_0x154d33,_0x101b56){if(_0x154d33['body']['id']){delete _0x154d33[_0x6204('0x45')]['id'];}return db[_0x6204('0x42')][_0x6204('0x43')]({'where':{'id':_0x154d33['params']['id']}})['then'](handleEntityNotFound(_0x101b56,null))[_0x6204('0x23')](saveUpdates(_0x154d33['body'],null))[_0x6204('0x23')](respondWithResult(_0x101b56,null))['catch'](handleError(_0x101b56,null));};exports[_0x6204('0x46')]=function(_0x58fda2,_0x55745a){return db[_0x6204('0x42')][_0x6204('0x43')]({'where':{'id':_0x58fda2[_0x6204('0x3f')]['id']}})[_0x6204('0x23')](handleEntityNotFound(_0x55745a,null))[_0x6204('0x23')](removeEntity(_0x55745a,null))[_0x6204('0x44')](handleError(_0x55745a,null));};exports[_0x6204('0x47')]=function(_0x3bce2b,_0x1e85c8){return db[_0x6204('0x42')]['describe']()[_0x6204('0x23')](respondWithResult(_0x1e85c8,null))[_0x6204('0x44')](handleError(_0x1e85c8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index a9bb111..6678a08 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 _0xa5fa=['bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0xa5fa,0x13d));var _0xaa5f=function(_0x4c16c4,_0x1f4fb2){_0x4c16c4=_0x4c16c4-0x0;var _0x2d2ddf=_0xa5fa[_0x4c16c4];return _0x2d2ddf;};'use strict';var _=require(_0xaa5f('0x0'));var util=require(_0xaa5f('0x1'));var logger=require(_0xaa5f('0x2'))(_0xaa5f('0x3'));var moment=require(_0xaa5f('0x4'));var BPromise=require(_0xaa5f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa5f('0x6'));var rimraf=require(_0xaa5f('0x7'));var config=require(_0xaa5f('0x8'));var attributes=require(_0xaa5f('0x9'));module[_0xaa5f('0xa')]=function(_0x6f924,_0x162458){return _0x6f924[_0xaa5f('0xb')](_0xaa5f('0xc'),attributes,{'tableName':_0xaa5f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21bd=['../../config/environment','./cmHopperBlack.attributes','exports','define','lodash','util','api','moment','request-promise','path'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x21bd,0x1e4));var _0xd21b=function(_0x39f227,_0x47d121){_0x39f227=_0x39f227-0x0;var _0x39bc85=_0x21bd[_0x39f227];return _0x39bc85;};'use strict';var _=require(_0xd21b('0x0'));var util=require(_0xd21b('0x1'));var logger=require('../../config/logger')(_0xd21b('0x2'));var moment=require(_0xd21b('0x3'));var BPromise=require('bluebird');var rp=require(_0xd21b('0x4'));var fs=require('fs');var path=require(_0xd21b('0x5'));var rimraf=require('rimraf');var config=require(_0xd21b('0x6'));var attributes=require(_0xd21b('0x7'));module[_0xd21b('0x8')]=function(_0x20dda1,_0x2572a0){return _0x20dda1[_0xd21b('0x9')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 9799511..f65f367 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 _0x9887=['client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','update','body','where','destroy','DestroyCmHopperBlack','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x47a768,_0x3357cc){var _0x5d756d=function(_0x3d89b4){while(--_0x3d89b4){_0x47a768['push'](_0x47a768['shift']());}};_0x5d756d(++_0x3357cc);}(_0x9887,0xac));var _0x7988=function(_0xa3f932,_0x4df53c){_0xa3f932=_0xa3f932-0x0;var _0x10d824=_0x9887[_0xa3f932];return _0x10d824;};'use strict';var _=require(_0x7988('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7988('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7988('0x2'))['db'];var utils=require(_0x7988('0x3'));var logger=require(_0x7988('0x4'))(_0x7988('0x5'));var config=require(_0x7988('0x6'));var jayson=require(_0x7988('0x7'));var client=jayson[_0x7988('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x812b18,_0x6befb7,_0x1b68c1){return new BPromise(function(_0x5c7d04,_0x2b2cff){return client[_0x7988('0x9')](_0x812b18,_0x1b68c1)[_0x7988('0xa')](function(_0x29923a){logger[_0x7988('0xb')](_0x7988('0xc'),_0x6befb7,_0x7988('0xd'));logger[_0x7988('0xe')](_0x7988('0xf'),_0x6befb7,_0x7988('0xd'),JSON['stringify'](_0x29923a));if(_0x29923a[_0x7988('0x10')]){if(_0x29923a[_0x7988('0x10')][_0x7988('0x11')]===0x1f4){logger[_0x7988('0x10')](_0x7988('0xc'),_0x6befb7,_0x29923a[_0x7988('0x10')]['message']);return _0x2b2cff(_0x29923a[_0x7988('0x10')][_0x7988('0x12')]);}logger[_0x7988('0x10')](_0x7988('0xc'),_0x6befb7,_0x29923a[_0x7988('0x10')][_0x7988('0x12')]);return _0x5c7d04(_0x29923a[_0x7988('0x10')]['message']);}else{logger[_0x7988('0xb')](_0x7988('0xc'),_0x6befb7,_0x7988('0xd'));_0x5c7d04(_0x29923a['result'][_0x7988('0x12')]);}})[_0x7988('0x13')](function(_0x46f302){logger[_0x7988('0x10')](_0x7988('0xc'),_0x6befb7,_0x46f302);_0x2b2cff(_0x46f302);});});}exports[_0x7988('0x14')]=function(_0x122d40){var _0x723c02=this;return new Promise(function(_0x22c26d,_0x1d307c){return db[_0x7988('0x15')]['findAll']({'raw':_0x122d40[_0x7988('0x16')]?_0x122d40['options'][_0x7988('0x17')]===undefined?!![]:![]:!![],'where':_0x122d40[_0x7988('0x16')]?_0x122d40[_0x7988('0x16')]['where']||null:null,'attributes':_0x122d40[_0x7988('0x16')]?_0x122d40['options'][_0x7988('0x18')]||null:null,'limit':_0x122d40[_0x7988('0x16')]?_0x122d40[_0x7988('0x16')][_0x7988('0x19')]||null:null,'include':_0x122d40[_0x7988('0x16')]?_0x122d40[_0x7988('0x16')][_0x7988('0x1a')]?_[_0x7988('0x1b')](_0x122d40[_0x7988('0x16')][_0x7988('0x1a')],function(_0x59e101){return{'model':db[_0x59e101[_0x7988('0x1c')]],'as':_0x59e101['as'],'attributes':_0x59e101['attributes'],'include':_0x59e101[_0x7988('0x1a')]?_[_0x7988('0x1b')](_0x59e101['include'],function(_0x465c17){return{'model':db[_0x465c17['model']],'as':_0x465c17['as'],'attributes':_0x465c17[_0x7988('0x18')],'include':_0x465c17[_0x7988('0x1a')]?_['map'](_0x465c17[_0x7988('0x1a')],function(_0x4ee37f){return{'model':db[_0x4ee37f['model']],'as':_0x4ee37f['as'],'attributes':_0x4ee37f[_0x7988('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7988('0xa')](function(_0x57915c){logger[_0x7988('0xb')]('GetCmHopperBlack',_0x122d40);logger['debug'](_0x7988('0x14'),_0x122d40,JSON[_0x7988('0x1d')](_0x57915c));_0x22c26d(_0x57915c);})[_0x7988('0x13')](function(_0x5619c2){logger[_0x7988('0x10')](_0x7988('0x14'),_0x5619c2[_0x7988('0x12')],_0x122d40);_0x1d307c(_0x723c02['error'](0x1f4,_0x5619c2[_0x7988('0x12')]));});});};exports[_0x7988('0x1e')]=function(_0x4fdd17){var _0x772737=this;return new Promise(function(_0x337033,_0x5ec696){return db[_0x7988('0x15')][_0x7988('0x1f')](_0x4fdd17[_0x7988('0x20')],{'raw':_0x4fdd17[_0x7988('0x16')]?_0x4fdd17[_0x7988('0x16')][_0x7988('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fdd17['options']?_0x4fdd17['options'][_0x7988('0x21')]||null:null,'attributes':_0x4fdd17[_0x7988('0x16')]?_0x4fdd17[_0x7988('0x16')][_0x7988('0x18')]||null:null,'limit':_0x4fdd17[_0x7988('0x16')]?_0x4fdd17[_0x7988('0x16')][_0x7988('0x19')]||null:null})[_0x7988('0xa')](function(_0xabb72){logger[_0x7988('0xb')](_0x7988('0x1e'),_0x4fdd17);logger[_0x7988('0xe')]('UpdateCmHopperBlack',_0x4fdd17,JSON['stringify'](_0xabb72));_0x337033(_0xabb72);})[_0x7988('0x13')](function(_0x13922b){logger[_0x7988('0x10')](_0x7988('0x1e'),_0x13922b[_0x7988('0x12')],_0x4fdd17);_0x5ec696(_0x772737[_0x7988('0x10')](0x1f4,_0x13922b[_0x7988('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x3a5c29){var _0x2d75e1=this;return new Promise(function(_0x1d7331,_0x1cc857){return db['CmHopperBlack'][_0x7988('0x22')]({'where':_0x3a5c29[_0x7988('0x16')]?_0x3a5c29['options'][_0x7988('0x21')]||null:null})['then'](function(_0x5de5c9){logger['info'](_0x7988('0x23'),_0x3a5c29);logger[_0x7988('0xe')](_0x7988('0x23'),_0x3a5c29,JSON['stringify'](_0x5de5c9));_0x1d7331(_0x5de5c9);})['catch'](function(_0x3b8f60){logger['error'](_0x7988('0x23'),_0x3b8f60[_0x7988('0x12')],_0x3a5c29);_0x1cc857(_0x2d75e1[_0x7988('0x10')](0x1f4,_0x3b8f60[_0x7988('0x12')]));});});}; \ No newline at end of file +var _0x2424=['include','map','model','GetCmHopperBlack','stringify','UpdateCmHopperBlack','update','body','where','limit','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','CmHopperBlack,\x20%s,\x20%s','message','result','catch','CmHopperBlack','findAll','options','raw','attributes'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0x2424,0x198));var _0x4242=function(_0x37eb9d,_0x55ca35){_0x37eb9d=_0x37eb9d-0x0;var _0x403ae0=_0x2424[_0x37eb9d];return _0x403ae0;};'use strict';var _=require(_0x4242('0x0'));var util=require('util');var moment=require(_0x4242('0x1'));var BPromise=require(_0x4242('0x2'));var rs=require(_0x4242('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4242('0x4'))['db'];var utils=require(_0x4242('0x5'));var logger=require(_0x4242('0x6'))('rpc');var config=require(_0x4242('0x7'));var jayson=require(_0x4242('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x378827,_0x49e14a,_0x3d6fe7){return new BPromise(function(_0x7a4f17,_0x25e95e){return client[_0x4242('0x9')](_0x378827,_0x3d6fe7)[_0x4242('0xa')](function(_0x5bc87e){logger[_0x4242('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x49e14a,_0x4242('0xc'));logger[_0x4242('0xd')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x49e14a,'request\x20sent',JSON['stringify'](_0x5bc87e));if(_0x5bc87e['error']){if(_0x5bc87e['error']['code']===0x1f4){logger[_0x4242('0xe')](_0x4242('0xf'),_0x49e14a,_0x5bc87e[_0x4242('0xe')][_0x4242('0x10')]);return _0x25e95e(_0x5bc87e['error'][_0x4242('0x10')]);}logger[_0x4242('0xe')](_0x4242('0xf'),_0x49e14a,_0x5bc87e[_0x4242('0xe')][_0x4242('0x10')]);return _0x7a4f17(_0x5bc87e[_0x4242('0xe')]['message']);}else{logger[_0x4242('0xb')](_0x4242('0xf'),_0x49e14a,'request\x20sent');_0x7a4f17(_0x5bc87e[_0x4242('0x11')][_0x4242('0x10')]);}})[_0x4242('0x12')](function(_0x34e5d8){logger[_0x4242('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x49e14a,_0x34e5d8);_0x25e95e(_0x34e5d8);});});}exports['GetCmHopperBlack']=function(_0x26096d){var _0x15f1ed=this;return new Promise(function(_0x1717fd,_0x156c26){return db[_0x4242('0x13')][_0x4242('0x14')]({'raw':_0x26096d[_0x4242('0x15')]?_0x26096d[_0x4242('0x15')][_0x4242('0x16')]===undefined?!![]:![]:!![],'where':_0x26096d['options']?_0x26096d['options']['where']||null:null,'attributes':_0x26096d['options']?_0x26096d[_0x4242('0x15')][_0x4242('0x17')]||null:null,'limit':_0x26096d['options']?_0x26096d[_0x4242('0x15')]['limit']||null:null,'include':_0x26096d[_0x4242('0x15')]?_0x26096d[_0x4242('0x15')][_0x4242('0x18')]?_[_0x4242('0x19')](_0x26096d['options'][_0x4242('0x18')],function(_0x4a8ed9){return{'model':db[_0x4a8ed9['model']],'as':_0x4a8ed9['as'],'attributes':_0x4a8ed9[_0x4242('0x17')],'include':_0x4a8ed9['include']?_[_0x4242('0x19')](_0x4a8ed9[_0x4242('0x18')],function(_0x276af0){return{'model':db[_0x276af0[_0x4242('0x1a')]],'as':_0x276af0['as'],'attributes':_0x276af0[_0x4242('0x17')],'include':_0x276af0['include']?_[_0x4242('0x19')](_0x276af0[_0x4242('0x18')],function(_0x30cd66){return{'model':db[_0x30cd66[_0x4242('0x1a')]],'as':_0x30cd66['as'],'attributes':_0x30cd66['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x91676f){logger['info'](_0x4242('0x1b'),_0x26096d);logger['debug'](_0x4242('0x1b'),_0x26096d,JSON[_0x4242('0x1c')](_0x91676f));_0x1717fd(_0x91676f);})[_0x4242('0x12')](function(_0x411f0b){logger['error']('GetCmHopperBlack',_0x411f0b[_0x4242('0x10')],_0x26096d);_0x156c26(_0x15f1ed['error'](0x1f4,_0x411f0b[_0x4242('0x10')]));});});};exports[_0x4242('0x1d')]=function(_0x30c47e){var _0x10e6e0=this;return new Promise(function(_0x2611f1,_0x56a2ae){return db[_0x4242('0x13')][_0x4242('0x1e')](_0x30c47e[_0x4242('0x1f')],{'raw':_0x30c47e[_0x4242('0x15')]?_0x30c47e[_0x4242('0x15')][_0x4242('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30c47e[_0x4242('0x15')]?_0x30c47e[_0x4242('0x15')][_0x4242('0x20')]||null:null,'attributes':_0x30c47e[_0x4242('0x15')]?_0x30c47e[_0x4242('0x15')][_0x4242('0x17')]||null:null,'limit':_0x30c47e[_0x4242('0x15')]?_0x30c47e[_0x4242('0x15')][_0x4242('0x21')]||null:null})[_0x4242('0xa')](function(_0x12f490){logger[_0x4242('0xb')](_0x4242('0x1d'),_0x30c47e);logger['debug']('UpdateCmHopperBlack',_0x30c47e,JSON[_0x4242('0x1c')](_0x12f490));_0x2611f1(_0x12f490);})[_0x4242('0x12')](function(_0x2ab359){logger[_0x4242('0xe')](_0x4242('0x1d'),_0x2ab359[_0x4242('0x10')],_0x30c47e);_0x56a2ae(_0x10e6e0[_0x4242('0xe')](0x1f4,_0x2ab359['message']));});});};exports['DestroyCmHopperBlack']=function(_0x527f06){var _0x43179a=this;return new Promise(function(_0x44b81c,_0x3a58d7){return db[_0x4242('0x13')][_0x4242('0x22')]({'where':_0x527f06[_0x4242('0x15')]?_0x527f06[_0x4242('0x15')]['where']||null:null})[_0x4242('0xa')](function(_0x516f5e){logger[_0x4242('0xb')](_0x4242('0x23'),_0x527f06);logger[_0x4242('0xd')](_0x4242('0x23'),_0x527f06,JSON[_0x4242('0x1c')](_0x516f5e));_0x44b81c(_0x516f5e);})[_0x4242('0x12')](function(_0x32f8d8){logger[_0x4242('0xe')](_0x4242('0x23'),_0x32f8d8[_0x4242('0x10')],_0x527f06);_0x3a58d7(_0x43179a[_0x4242('0xe')](0x1f4,_0x32f8d8[_0x4242('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 044c575..e55141c 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 _0x2675=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','put','/:id','delete','exports','multer','express','Router'];(function(_0x213492,_0x116b9a){var _0x25bb6f=function(_0x3f64a7){while(--_0x3f64a7){_0x213492['push'](_0x213492['shift']());}};_0x25bb6f(++_0x116b9a);}(_0x2675,0x75));var _0x5267=function(_0xe8488a,_0x176f21){_0xe8488a=_0xe8488a-0x0;var _0x3c2d6c=_0x2675[_0xe8488a];return _0x3c2d6c;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0xb')](_0x5267('0xc'),auth[_0x5267('0x7')](),controller['update']);router[_0x5267('0xd')]('/:id',auth[_0x5267('0x7')](),controller['destroy']);module[_0x5267('0xe')]=router; \ No newline at end of file +var _0x2ef3=['describe','/:id','show','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','/describe','isAuthenticated'];(function(_0x49e3d2,_0x458914){var _0x59f04e=function(_0x48533b){while(--_0x48533b){_0x49e3d2['push'](_0x49e3d2['shift']());}};_0x59f04e(++_0x458914);}(_0x2ef3,0xba));var _0x32ef=function(_0x339b64,_0x26c404){_0x339b64=_0x339b64-0x0;var _0xf75a6b=_0x2ef3[_0x339b64];return _0xf75a6b;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x32ef('0x10')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('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 736bcc5..ac4db6b 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 _0x4486=['exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize'];(function(_0x55eb36,_0x532b12){var _0x24530e=function(_0xd1509d){while(--_0xd1509d){_0x55eb36['push'](_0x55eb36['shift']());}};_0x24530e(++_0x532b12);}(_0x4486,0x67));var _0x6448=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x4486[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x6448('0x0'));var moment=require('moment');module[_0x6448('0x1')]={'state':{'type':Sequelize[_0x6448('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6448('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6448('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6448('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6448('0x3')]},'calleridnum':{'type':Sequelize[_0x6448('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6448('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x6448('0x4')]},'droptime':{'type':Sequelize[_0x6448('0x4')]},'endtime':{'type':Sequelize[_0x6448('0x4')]},'ringtime':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6448('0x3')]},'campaign':{'type':Sequelize[_0x6448('0x3')]},'campaigntype':{'type':Sequelize[_0x6448('0x3')]},'membername':{'type':Sequelize[_0x6448('0x3')]},'reason':{'type':Sequelize[_0x6448('0x3')]},'disposition':{'type':Sequelize[_0x6448('0x3')]},'secondDisposition':{'type':Sequelize[_0x6448('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6448('0x4')],'set':function(_0xa091d9){var _0x4ad332=this[_0x6448('0x5')](_0x6448('0x6'));if(_0x4ad332&&_0xa091d9){this[_0x6448('0x7')](_0x6448('0x8'),moment(_0xa091d9)[_0x6448('0x9')](moment(_0x4ad332),_0x6448('0xa')));}return this[_0x6448('0x7')](_0x6448('0xb'),_0xa091d9);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6448('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6448('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6448('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x6448('0x4')]},'callback':{'type':Sequelize[_0x6448('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6448('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6448('0x4')]},'deleted':{'type':Sequelize[_0x6448('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6448('0x4')]},'recallme':{'type':Sequelize[_0x6448('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6448('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6448('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x193f=['INTEGER','STRING','DATE','endtime','followuptime','diff','setDataValue','BOOLEAN','exports'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x193f,0xf2));var _0xf193=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x193f[_0x3d2e4b];return _0x509e78;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf193('0x0')]={'state':{'type':Sequelize[_0xf193('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf193('0x2')]},'scheduledat':{'type':Sequelize[_0xf193('0x3')]},'countbusyretry':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf193('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xf193('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf193('0x2')]},'calleridnum':{'type':Sequelize[_0xf193('0x2')]},'calleridname':{'type':Sequelize[_0xf193('0x2')]},'starttime':{'type':Sequelize[_0xf193('0x3')]},'responsetime':{'type':Sequelize[_0xf193('0x3')]},'answertime':{'type':Sequelize[_0xf193('0x3')]},'droptime':{'type':Sequelize[_0xf193('0x3')]},'endtime':{'type':Sequelize[_0xf193('0x3')]},'ringtime':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf193('0x2')]},'campaign':{'type':Sequelize[_0xf193('0x2')]},'campaigntype':{'type':Sequelize[_0xf193('0x2')]},'membername':{'type':Sequelize[_0xf193('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xf193('0x2')]},'secondDisposition':{'type':Sequelize[_0xf193('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf193('0x2')]},'dispositionat':{'type':Sequelize[_0xf193('0x3')],'set':function(_0xb299c7){var _0x3b05c7=this['getDataValue'](_0xf193('0x4'));if(_0x3b05c7&&_0xb299c7){this['setDataValue'](_0xf193('0x5'),moment(_0xb299c7)[_0xf193('0x6')](moment(_0x3b05c7),'seconds'));}return this[_0xf193('0x7')]('dispositionat',_0xb299c7);}},'amd':{'type':Sequelize[_0xf193('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf193('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf193('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf193('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf193('0x3')]},'deleted':{'type':Sequelize[_0xf193('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf193('0x3')]},'recallme':{'type':Sequelize[_0xf193('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf193('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf193('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf193('0x1')],'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 929f7fe..c9e2d66 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 _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','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=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x496cdc,_0x9d6db3){var _0x103a8e=function(_0x1c625a){while(--_0x1c625a){_0x496cdc['push'](_0x496cdc['shift']());}};_0x103a8e(++_0x9d6db3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc4aa[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));}; \ No newline at end of file +var _0xb016=['error','name','send','index','map','CmHopperFinal','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','body','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state','calleridnum','state\x20=\x204','group','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','end'];(function(_0xa85ed4,_0x24c0e6){var _0xcfc103=function(_0x802176){while(--_0x802176){_0xa85ed4['push'](_0xa85ed4['shift']());}};_0xcfc103(++_0x24c0e6);}(_0xb016,0x159));var _0x6b01=function(_0x4e55de,_0x54ea0c){_0x4e55de=_0x4e55de-0x0;var _0x362190=_0xb016[_0x4e55de];return _0x362190;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':!![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['describe']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['describe']()['then'](respondWithResult(_0x27442e,null))['catch'](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x12160f,_0x518d94){if(_0x12160f[_0x6b01('0x43')]['uniqueid']){delete _0x12160f['body']['uniqueid'];}return db[_0x6b01('0x29')][_0x6b01('0x44')]({'where':{'uniqueid':_0x12160f['params']['id']}})['then'](handleEntityNotFound(_0x518d94,null))[_0x6b01('0x21')](saveUpdates(_0x12160f['body'],null))[_0x6b01('0x21')](respondWithResult(_0x518d94,null))[_0x6b01('0x40')](handleError(_0x518d94,null));};exports[_0x6b01('0x45')]=function(_0x172a56,_0x13f6d7,_0x4d327f){return db[_0x6b01('0x29')][_0x6b01('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x172a56[_0x6b01('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x49')))),_0x6b01('0x4a')],[db[_0x6b01('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6b01('0x47')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x6b01('0x4b')],[db[_0x6b01('0x47')]['fn']('COUNT',db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')]['literal'](_0x6b01('0x4c')))),_0x6b01('0x4d')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')]('`state`\x20=\x208,\x201,\x20null'))),_0x6b01('0x4e')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db['sequelize']['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x4f')))),_0x6b01('0x50')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6b01('0x51')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db['sequelize']['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x53')))),_0x6b01('0x54')]]})[_0x6b01('0x21')](handleEntityNotFound(_0x13f6d7,null))[_0x6b01('0x21')](respondWithResult(_0x13f6d7,null))[_0x6b01('0x40')](handleError(_0x13f6d7,null));};exports[_0x6b01('0x55')]=function(_0x425d28,_0x132dda,_0x4c1345){return db[_0x6b01('0x29')][_0x6b01('0x3f')]({'raw':![],'where':{'CampaignId':_0x425d28[_0x6b01('0x41')]['id']},'attributes':[[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x49')))),'noSuchContacts'],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x56')))),'noAnswerContacts'],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x4c')))),_0x6b01('0x4d')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x57')))),_0x6b01('0x4e')],[db[_0x6b01('0x47')]['fn']('COUNT',db[_0x6b01('0x47')]['fn']('IF',db['sequelize'][_0x6b01('0x48')](_0x6b01('0x4f')))),_0x6b01('0x50')],[db['sequelize']['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x58')))),_0x6b01('0x51')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x52')))),_0x6b01('0x59')],[db[_0x6b01('0x47')]['fn'](_0x6b01('0x46'),db[_0x6b01('0x47')]['fn']('IF',db[_0x6b01('0x47')][_0x6b01('0x48')](_0x6b01('0x53')))),'answeringMachine']]})[_0x6b01('0x21')](handleEntityNotFound(_0x132dda,null))[_0x6b01('0x21')](respondWithResult(_0x132dda,null))[_0x6b01('0x40')](handleError(_0x132dda,null));};exports[_0x6b01('0x5a')]=function(_0x1c419c,_0x250889,_0x40931a){return db[_0x6b01('0x5b')][_0x6b01('0x44')]({'where':{'id':_0x1c419c[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x250889,null))[_0x6b01('0x21')](function(_0x468a0b){var _0x30171f;if(_0x468a0b){_0x30171f=squel[_0x6b01('0x5c')]()['into'](_0x6b01('0x5d'))[_0x6b01('0x5e')]([_0x6b01('0x5f'),_0x6b01('0x60'),_0x6b01('0x61'),_0x6b01('0x62'),_0x6b01('0x63'),_0x6b01('0x64'),_0x6b01('0x65')],squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x68'),_0x6b01('0x5f'))[_0x6b01('0x67')](_0x6b01('0x69'),_0x6b01('0x60'))[_0x6b01('0x67')](_0x6b01('0x6a'),_0x6b01('0x61'))[_0x6b01('0x67')]('ANY_VALUE(ListId)','ListId')['field']('ANY_VALUE(VoiceQueueId)',_0x6b01('0x63'))['field']('NOW()','createdAt')[_0x6b01('0x67')]('NOW()',_0x6b01('0x65'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c['params']['id']['toString']())[_0x6b01('0x37')](_0x6b01('0x6e'),_0x1c419c[_0x6b01('0x43')]['state'][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x70'))[_0x6b01('0x37')](_0x6b01('0x71'),squel['select']()[_0x6b01('0x67')]('phone')[_0x6b01('0x6b')](_0x6b01('0x5d'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c[_0x6b01('0x41')]['id']['toString']()))[_0x6b01('0x37')](_0x6b01('0x71'),squel[_0x6b01('0x66')]()[_0x6b01('0x67')]('calleridnum')[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x6d'),_0x1c419c[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]())['where']('state\x20=\x204'))['group'](_0x6b01('0x61')))[_0x6b01('0x6f')]();return db['sequelize'][_0x6b01('0x2c')](_0x30171f);}return[];})[_0x6b01('0x21')](respondWithResult(_0x250889,null))[_0x6b01('0x40')](handleError(_0x250889,null));};exports[_0x6b01('0x72')]=function(_0x536748,_0x18066a,_0x4ccc00){return db[_0x6b01('0x73')]['find']({'where':{'id':_0x536748[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x18066a,null))[_0x6b01('0x21')](function(_0x3bc182){var _0x410303;if(_0x3bc182){_0x410303=squel[_0x6b01('0x5c')]()[_0x6b01('0x74')](_0x6b01('0x5d'))[_0x6b01('0x5e')](['phone',_0x6b01('0x60'),'ContactId',_0x6b01('0x62'),_0x6b01('0x75'),_0x6b01('0x64'),_0x6b01('0x65')],squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x68'),_0x6b01('0x5f'))[_0x6b01('0x67')](_0x6b01('0x69'),_0x6b01('0x60'))['field'](_0x6b01('0x6a'),_0x6b01('0x61'))[_0x6b01('0x67')](_0x6b01('0x76'),'ListId')[_0x6b01('0x67')](_0x6b01('0x77'),_0x6b01('0x75'))[_0x6b01('0x67')](_0x6b01('0x69'),'createdAt')[_0x6b01('0x67')]('NOW()',_0x6b01('0x65'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x78'),_0x536748[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x6e'),_0x536748[_0x6b01('0x43')][_0x6b01('0x79')][_0x6b01('0x6f')]())[_0x6b01('0x37')](_0x6b01('0x70'))['where'](_0x6b01('0x71'),squel['select']()['field'](_0x6b01('0x5f'))[_0x6b01('0x6b')](_0x6b01('0x5d'))[_0x6b01('0x37')]('CampaignId\x20=\x20?',_0x536748[_0x6b01('0x41')]['id'][_0x6b01('0x6f')]()))[_0x6b01('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6b01('0x66')]()[_0x6b01('0x67')](_0x6b01('0x7a'))[_0x6b01('0x6b')](_0x6b01('0x6c'))[_0x6b01('0x37')](_0x6b01('0x78'),_0x536748[_0x6b01('0x41')]['id']['toString']())[_0x6b01('0x37')](_0x6b01('0x7b')))[_0x6b01('0x7c')](_0x6b01('0x61')))['toString']();return db['sequelize'][_0x6b01('0x2c')](_0x410303);}return[];})[_0x6b01('0x21')](respondWithResult(_0x18066a,null))[_0x6b01('0x40')](handleError(_0x18066a,null));};exports[_0x6b01('0x7d')]=function(_0x6a33d7,_0x214f54,_0x1343af){return db[_0x6b01('0x7e')]['findOne']({'where':{'VoiceQueueId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x63')],'CampaignId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x75')],'ContactId':_0x6a33d7[_0x6b01('0x43')][_0x6b01('0x61')]}})[_0x6b01('0x21')](handleEntityNotFound(_0x214f54,null))['then'](function(_0x5140ba){if(_0x5140ba){return _0x5140ba;}return null;})['then'](respondWithResult(_0x214f54,null))[_0x6b01('0x40')](handleError(_0x214f54,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ff5662f..c9f189b 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 _0x447e=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','api','moment','request-promise','path'];(function(_0x3778a1,_0x2237fa){var _0x4586aa=function(_0x4152fa){while(--_0x4152fa){_0x3778a1['push'](_0x3778a1['shift']());}};_0x4586aa(++_0x2237fa);}(_0x447e,0x167));var _0xe447=function(_0x3db0db,_0x3175a1){_0x3db0db=_0x3db0db-0x0;var _0x5cf912=_0x447e[_0x3db0db];return _0x5cf912;};'use strict';var _=require(_0xe447('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe447('0x1'));var moment=require(_0xe447('0x2'));var BPromise=require('bluebird');var rp=require(_0xe447('0x3'));var fs=require('fs');var path=require(_0xe447('0x4'));var rimraf=require(_0xe447('0x5'));var config=require(_0xe447('0x6'));var attributes=require(_0xe447('0x7'));module[_0xe447('0x8')]=function(_0x59ed8c,_0x50242e){return _0x59ed8c[_0xe447('0x9')]('CmHopperFinal',attributes,{'tableName':_0xe447('0xa'),'paranoid':![],'indexes':[{'name':_0xe447('0xb'),'fields':[_0xe447('0xb')]},{'name':_0xe447('0xc'),'fields':[_0xe447('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x375c=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x375c,0xf4));var _0xc375=function(_0x5ab81c,_0x2cfc10){_0x5ab81c=_0x5ab81c-0x0;var _0x37ac99=_0x375c[_0x5ab81c];return _0x37ac99;};'use strict';var _=require('lodash');var util=require(_0xc375('0x0'));var logger=require(_0xc375('0x1'))(_0xc375('0x2'));var moment=require(_0xc375('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc375('0x4'));var config=require(_0xc375('0x5'));var attributes=require('./cmHopperFinal.attributes');module[_0xc375('0x6')]=function(_0xd00bcc,_0x39a239){return _0xd00bcc[_0xc375('0x7')](_0xc375('0x8'),attributes,{'tableName':_0xc375('0x9'),'paranoid':![],'indexes':[{'name':_0xc375('0xa'),'fields':[_0xc375('0xa')]},{'name':_0xc375('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index c8d37c1..f0ef46e 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x251125,_0x16b749){var _0x17d618=function(_0x38cb07){while(--_0x38cb07){_0x251125['push'](_0x251125['shift']());}};_0x17d618(++_0x16b749);}(_0xb10b,0x12a));var _0xbb10=function(_0x2340e2,_0x1627f9){_0x2340e2=_0x2340e2-0x0;var _0x5ced10=_0xb10b[_0x2340e2];return _0x5ced10;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5e32c3,_0x26a299){var _0x455b1b=function(_0xc74e02){while(--_0xc74e02){_0x5e32c3['push'](_0x5e32c3['shift']());}};_0x455b1b(++_0x26a299);}(_0x7a54,0x106));var _0x47a5=function(_0x501e5a,_0x2047ae){_0x501e5a=_0x501e5a-0x0;var _0x112636=_0x7a54[_0x501e5a];return _0x112636;};'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 68b164e..d896e16 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 _0xd448=['/checkContactHopper','checkContactHopper','put','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','/describe','describe','get','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x4c5ebc,_0x52da71){var _0x29018e=function(_0x57ca5b){while(--_0x57ca5b){_0x4c5ebc['push'](_0x4c5ebc['shift']());}};_0x29018e(++_0x52da71);}(_0xd448,0x172));var _0x8d44=function(_0x17adca,_0x9f901){_0x17adca=_0x17adca-0x0;var _0x2d578a=_0xd448[_0x17adca];return _0x2d578a;};'use strict';var multer=require('multer');var util=require(_0x8d44('0x0'));var path=require(_0x8d44('0x1'));var timeout=require(_0x8d44('0x2'));var express=require(_0x8d44('0x3'));var router=express[_0x8d44('0x4')]();var fs_extra=require(_0x8d44('0x5'));var auth=require(_0x8d44('0x6'));var interaction=require(_0x8d44('0x7'));var config=require(_0x8d44('0x8'));var controller=require(_0x8d44('0x9'));router['get']('/',auth[_0x8d44('0xa')](),controller['index']);router['get'](_0x8d44('0xb'),auth[_0x8d44('0xa')](),controller[_0x8d44('0xc')]);router[_0x8d44('0xd')]('/:id',auth[_0x8d44('0xa')](),controller[_0x8d44('0xe')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x8d44('0xa')](),controller[_0x8d44('0xf')]);router[_0x8d44('0xd')]('/campaign/countAttributes/:id',auth[_0x8d44('0xa')](),controller[_0x8d44('0x10')]);router[_0x8d44('0x11')](_0x8d44('0x12'),auth['isAuthenticated'](),controller[_0x8d44('0x13')]);router[_0x8d44('0x11')](_0x8d44('0x14'),auth[_0x8d44('0xa')](),controller[_0x8d44('0x15')]);router['post'](_0x8d44('0x16'),auth[_0x8d44('0xa')](),controller[_0x8d44('0x17')]);router[_0x8d44('0x18')](_0x8d44('0x19'),auth['isAuthenticated'](),controller[_0x8d44('0x1a')]);module[_0x8d44('0x1b')]=router; \ No newline at end of file +var _0xf651=['./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','update','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2e6def,_0x490582){var _0x52ca11=function(_0x440e01){while(--_0x440e01){_0x2e6def['push'](_0x2e6def['shift']());}};_0x52ca11(++_0x490582);}(_0xf651,0x169));var _0x1f65=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf651[_0x101e7b];return _0x4995c0;};'use strict';var multer=require('multer');var util=require(_0x1f65('0x0'));var path=require(_0x1f65('0x1'));var timeout=require(_0x1f65('0x2'));var express=require(_0x1f65('0x3'));var router=express[_0x1f65('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1f65('0x5'));var config=require(_0x1f65('0x6'));var controller=require(_0x1f65('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1f65('0x8')]('/describe',auth[_0x1f65('0x9')](),controller[_0x1f65('0xa')]);router['get'](_0x1f65('0xb'),auth[_0x1f65('0x9')](),controller['show']);router[_0x1f65('0x8')](_0x1f65('0xc'),auth[_0x1f65('0x9')](),controller[_0x1f65('0xd')]);router[_0x1f65('0x8')](_0x1f65('0xe'),auth[_0x1f65('0x9')](),controller[_0x1f65('0xf')]);router['post'](_0x1f65('0x10'),auth[_0x1f65('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x1f65('0x11')](_0x1f65('0x12'),auth['isAuthenticated'](),controller[_0x1f65('0x13')]);router[_0x1f65('0x11')](_0x1f65('0x14'),auth['isAuthenticated'](),controller['checkContactHopper']);router['put']('/:id',auth[_0x1f65('0x9')](),controller[_0x1f65('0x15')]);module[_0x1f65('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 2b566fd..1642476 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 _0xd50f=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0xd50f,0x15a));var _0xfd50=function(_0x2dfd48,_0x1068b8){_0x2dfd48=_0x2dfd48-0x0;var _0x502da7=_0xd50f[_0x2dfd48];return _0x502da7;};'use strict';var Sequelize=require(_0xfd50('0x0'));module[_0xfd50('0x1')]={'state':{'type':Sequelize[_0xfd50('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xfd50('0x3')]},'scheduledat':{'type':Sequelize[_0xfd50('0x4')]},'countbusyretry':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfd50('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfd50('0x3')]},'starttime':{'type':Sequelize[_0xfd50('0x4')]},'responsetime':{'type':Sequelize[_0xfd50('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xfd50('0x4')]},'endtime':{'type':Sequelize[_0xfd50('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfd50('0x3')]},'campaign':{'type':Sequelize[_0xfd50('0x3')]},'campaigntype':{'type':Sequelize[_0xfd50('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xfd50('0x3')]},'amd':{'type':Sequelize[_0xfd50('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfd50('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfd50('0x4')]},'recallme':{'type':Sequelize[_0xfd50('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfd50('0x4')]},'edited':{'type':Sequelize[_0xfd50('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfd50('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x56a4=['DATE','BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x56a4,0xfe));var _0x456a=function(_0x7d9c0d,_0x165295){_0x7d9c0d=_0x7d9c0d-0x0;var _0x26a3c7=_0x56a4[_0x7d9c0d];return _0x26a3c7;};'use strict';var Sequelize=require(_0x456a('0x0'));module[_0x456a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x456a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x456a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x456a('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x456a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x456a('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x456a('0x4')]},'droptime':{'type':Sequelize[_0x456a('0x4')]},'endtime':{'type':Sequelize[_0x456a('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x456a('0x2')]},'campaign':{'type':Sequelize[_0x456a('0x2')]},'campaigntype':{'type':Sequelize[_0x456a('0x2')]},'membername':{'type':Sequelize[_0x456a('0x2')]},'reason':{'type':Sequelize[_0x456a('0x2')]},'amd':{'type':Sequelize[_0x456a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x456a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x456a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x456a('0x4')]},'recallme':{'type':Sequelize[_0x456a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x456a('0x4')]},'edited':{'type':Sequelize[_0x456a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x456a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x456a('0x3')],'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 4fe067d..46f6476 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 _0x58ac=['rawAttributes','find','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params'];(function(_0x48c5f6,_0x467809){var _0x5517a4=function(_0x48d762){while(--_0x48d762){_0x48c5f6['push'](_0x48c5f6['shift']());}};_0x5517a4(++_0x467809);}(_0x58ac,0x173));var _0xc58a=function(_0x5e3445,_0x20367c){_0x5e3445=_0x5e3445-0x0;var _0x2b8d08=_0x58ac[_0x5e3445];return _0x2b8d08;};'use strict';var emlformat=require(_0xc58a('0x0'));var rimraf=require(_0xc58a('0x1'));var zipdir=require(_0xc58a('0x2'));var jsonpatch=require(_0xc58a('0x3'));var rp=require(_0xc58a('0x4'));var moment=require(_0xc58a('0x5'));var BPromise=require(_0xc58a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc58a('0x7'));var sox=require(_0xc58a('0x8'));var csv=require(_0xc58a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc58a('0xa'));var _=require('lodash');var squel=require(_0xc58a('0xb'));var crypto=require(_0xc58a('0xc'));var jsforce=require(_0xc58a('0xd'));var deskjs=require(_0xc58a('0xe'));var toCsv=require(_0xc58a('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc58a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc58a('0x10'));var hardwareService=require(_0xc58a('0x11'));var logger=require('../../config/logger')(_0xc58a('0x12'));var utils=require(_0xc58a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc58a('0x14'));var db=require(_0xc58a('0x15'))['db'];function respondWithStatusCode(_0x51ec0f,_0x3ed21b){_0x3ed21b=_0x3ed21b||0xcc;return function(_0x2d5d49){if(_0x2d5d49){return _0x51ec0f[_0xc58a('0x16')](_0x3ed21b);}return _0x51ec0f[_0xc58a('0x17')](_0x3ed21b)['end']();};}function respondWithResult(_0x2cd082,_0x4adef6){_0x4adef6=_0x4adef6||0xc8;return function(_0x3547ee){if(_0x3547ee){return _0x2cd082[_0xc58a('0x17')](_0x4adef6)[_0xc58a('0x18')](_0x3547ee);}};}function respondWithFilteredResult(_0xf4e5b8,_0x517243){return function(_0x3906f7){if(_0x3906f7){var _0x3d3696=typeof _0x517243['offset']===_0xc58a('0x19')&&typeof _0x517243[_0xc58a('0x1a')]===_0xc58a('0x19');var _0x14b300=_0x3906f7[_0xc58a('0x1b')];var _0x3b8127=_0x3d3696?0x0:_0x517243[_0xc58a('0x1c')];var _0xe12b6e=_0x3d3696?_0x3906f7[_0xc58a('0x1b')]:_0x517243[_0xc58a('0x1c')]+_0x517243[_0xc58a('0x1a')];var _0x21a9c7;if(_0xe12b6e>=_0x14b300){_0xe12b6e=_0x14b300;_0x21a9c7=0xc8;}else{_0x21a9c7=0xce;}_0xf4e5b8[_0xc58a('0x17')](_0x21a9c7);return _0xf4e5b8[_0xc58a('0x1d')]('Content-Range',_0x3b8127+'-'+_0xe12b6e+'/'+_0x14b300)['json'](_0x3906f7);}return null;};}function patchUpdates(_0x359d19){return function(_0xbe746d){try{jsonpatch[_0xc58a('0x1e')](_0xbe746d,_0x359d19,!![]);}catch(_0x237a56){return BPromise['reject'](_0x237a56);}return _0xbe746d[_0xc58a('0x1f')]();};}function saveUpdates(_0x33324b,_0x4f92cd){return function(_0x4c44ac){if(_0x4c44ac){return _0x4c44ac[_0xc58a('0x20')](_0x33324b)[_0xc58a('0x21')](function(_0x1ef6c5){return _0x1ef6c5;});}return null;};}function removeEntity(_0x191856,_0xdc8fce){return function(_0x6bfa6e){if(_0x6bfa6e){return _0x6bfa6e[_0xc58a('0x22')]()[_0xc58a('0x21')](function(){_0x191856['status'](0xcc)[_0xc58a('0x23')]();});}};}function handleEntityNotFound(_0x5aa89b,_0x3190a3){return function(_0x1f2754){if(!_0x1f2754){_0x5aa89b[_0xc58a('0x16')](0x194);}return _0x1f2754;};}function handleError(_0x20b512,_0x4d002a){_0x4d002a=_0x4d002a||0x1f4;return function(_0x452028){logger[_0xc58a('0x24')](_0x452028[_0xc58a('0x25')]);if(_0x452028[_0xc58a('0x26')]){delete _0x452028[_0xc58a('0x26')];}_0x20b512[_0xc58a('0x17')](_0x4d002a)[_0xc58a('0x27')](_0x452028);};}exports[_0xc58a('0x28')]=function(_0x4bd17c,_0x3ac6fb){var _0x49560c={},_0x3111b2={},_0xa24d65={'count':0x0,'rows':[]};var _0x5f0ef2=_[_0xc58a('0x29')](db[_0xc58a('0x2a')]['rawAttributes'],function(_0x315462){return{'name':_0x315462[_0xc58a('0x2b')],'type':_0x315462[_0xc58a('0x2c')][_0xc58a('0x2d')]};});_0x3111b2[_0xc58a('0x2e')]=_[_0xc58a('0x29')](_0x5f0ef2,'name');_0x3111b2[_0xc58a('0x2f')]=_[_0xc58a('0x30')](_0x4bd17c[_0xc58a('0x2f')]);_0x3111b2[_0xc58a('0x31')]=_[_0xc58a('0x32')](_0x3111b2['model'],_0x3111b2[_0xc58a('0x2f')]);_0x49560c[_0xc58a('0x33')]=_[_0xc58a('0x32')](_0x3111b2['model'],qs[_0xc58a('0x34')](_0x4bd17c[_0xc58a('0x2f')][_0xc58a('0x34')]));_0x49560c[_0xc58a('0x33')]=_0x49560c[_0xc58a('0x33')][_0xc58a('0x35')]?_0x49560c[_0xc58a('0x33')]:_0x3111b2['model'];if(!_0x4bd17c[_0xc58a('0x2f')]['hasOwnProperty']('nolimit')){_0x49560c[_0xc58a('0x1a')]=qs[_0xc58a('0x1a')](_0x4bd17c[_0xc58a('0x2f')]['limit']);_0x49560c['offset']=qs[_0xc58a('0x1c')](_0x4bd17c[_0xc58a('0x2f')][_0xc58a('0x1c')]);}_0x49560c['order']=qs[_0xc58a('0x36')](_0x4bd17c[_0xc58a('0x2f')][_0xc58a('0x36')]);_0x49560c['where']=qs[_0xc58a('0x31')](_[_0xc58a('0x37')](_0x4bd17c['query'],_0x3111b2[_0xc58a('0x31')]),_0x5f0ef2);if(_0x4bd17c['query'][_0xc58a('0x38')]){_0x49560c[_0xc58a('0x39')]=_['merge'](_0x49560c['where'],{'$or':_[_0xc58a('0x29')](_0x5f0ef2,function(_0x4c2cca){if(_0x4c2cca[_0xc58a('0x2c')]!==_0xc58a('0x3a')){var _0x2e3e11={};_0x2e3e11[_0x4c2cca[_0xc58a('0x26')]]={'$like':'%'+_0x4bd17c[_0xc58a('0x2f')][_0xc58a('0x38')]+'%'};return _0x2e3e11;}})});}_0x49560c=_[_0xc58a('0x3b')]({},_0x49560c,_0x4bd17c[_0xc58a('0x3c')]);var _0x2a2d4e={'where':_0x49560c[_0xc58a('0x39')]};return db[_0xc58a('0x2a')][_0xc58a('0x1b')](_0x2a2d4e)[_0xc58a('0x21')](function(_0x525fd8){_0xa24d65[_0xc58a('0x1b')]=_0x525fd8;if(_0x4bd17c[_0xc58a('0x2f')][_0xc58a('0x3d')]){_0x49560c[_0xc58a('0x3e')]=[{'all':!![]}];}return db[_0xc58a('0x2a')][_0xc58a('0x3f')](_0x49560c);})[_0xc58a('0x21')](function(_0x102cf3){_0xa24d65[_0xc58a('0x40')]=_0x102cf3;return _0xa24d65;})[_0xc58a('0x21')](respondWithFilteredResult(_0x3ac6fb,_0x49560c))[_0xc58a('0x41')](handleError(_0x3ac6fb,null));};exports['show']=function(_0x2d9696,_0x469f01){var _0x59f2c8={'raw':!![],'where':{'id':_0x2d9696[_0xc58a('0x42')]['id']}},_0x3f4729={};_0x3f4729[_0xc58a('0x2e')]=_['keys'](db[_0xc58a('0x2a')][_0xc58a('0x43')]);_0x3f4729[_0xc58a('0x2f')]=_[_0xc58a('0x30')](_0x2d9696[_0xc58a('0x2f')]);_0x3f4729[_0xc58a('0x31')]=_[_0xc58a('0x32')](_0x3f4729[_0xc58a('0x2e')],_0x3f4729[_0xc58a('0x2f')]);_0x59f2c8['attributes']=_[_0xc58a('0x32')](_0x3f4729['model'],qs['fields'](_0x2d9696[_0xc58a('0x2f')][_0xc58a('0x34')]));_0x59f2c8['attributes']=_0x59f2c8[_0xc58a('0x33')]['length']?_0x59f2c8[_0xc58a('0x33')]:_0x3f4729[_0xc58a('0x2e')];if(_0x2d9696[_0xc58a('0x2f')][_0xc58a('0x3d')]){_0x59f2c8[_0xc58a('0x3e')]=[{'all':!![]}];}_0x59f2c8=_[_0xc58a('0x3b')]({},_0x59f2c8,_0x2d9696['options']);return db[_0xc58a('0x2a')][_0xc58a('0x44')](_0x59f2c8)[_0xc58a('0x21')](handleEntityNotFound(_0x469f01,null))['then'](respondWithResult(_0x469f01,null))[_0xc58a('0x41')](handleError(_0x469f01,null));};exports[_0xc58a('0x45')]=function(_0x194db3,_0x342be2){return db[_0xc58a('0x2a')][_0xc58a('0x45')](_0x194db3['body'],{})[_0xc58a('0x21')](respondWithResult(_0x342be2,0xc9))['catch'](handleError(_0x342be2,null));};exports[_0xc58a('0x46')]=function(_0x25d4a4,_0x4b9fff){return db[_0xc58a('0x2a')][_0xc58a('0x46')]()['then'](respondWithResult(_0x4b9fff,null))[_0xc58a('0x41')](handleError(_0x4b9fff,null));};exports[_0xc58a('0x20')]=function(_0x12ba1c,_0x1c1c70){if(_0x12ba1c[_0xc58a('0x47')]['uniqueid']){delete _0x12ba1c[_0xc58a('0x47')][_0xc58a('0x48')];}return db['CmHopperHistory'][_0xc58a('0x44')]({'where':{'uniqueid':_0x12ba1c['params']['id']}})[_0xc58a('0x21')](handleEntityNotFound(_0x1c1c70,null))[_0xc58a('0x21')](saveUpdates(_0x12ba1c[_0xc58a('0x47')],null))['then'](respondWithResult(_0x1c1c70,null))['catch'](handleError(_0x1c1c70,null));}; \ No newline at end of file +var _0x5345=['json','offset','limit','count','status','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x509150,_0x525f45){var _0x44809f=function(_0x246f24){while(--_0x246f24){_0x509150['push'](_0x509150['shift']());}};_0x44809f(++_0x525f45);}(_0x5345,0x76));var _0x5534=function(_0x39c4c6,_0x52d455){_0x39c4c6=_0x39c4c6-0x0;var _0x20c512=_0x5345[_0x39c4c6];return _0x20c512;};'use strict';var emlformat=require(_0x5534('0x0'));var rimraf=require(_0x5534('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5534('0x2'));var rp=require(_0x5534('0x3'));var moment=require(_0x5534('0x4'));var BPromise=require(_0x5534('0x5'));var Mustache=require(_0x5534('0x6'));var util=require(_0x5534('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5534('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5534('0x9'));var _=require(_0x5534('0xa'));var squel=require('squel');var crypto=require(_0x5534('0xb'));var jsforce=require(_0x5534('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5534('0xd'));var Papa=require('papaparse');var Redis=require(_0x5534('0xe'));var authService=require(_0x5534('0xf'));var qs=require(_0x5534('0x10'));var as=require(_0x5534('0x11'));var hardwareService=require(_0x5534('0x12'));var logger=require(_0x5534('0x13'))(_0x5534('0x14'));var utils=require(_0x5534('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5534('0x16'));var db=require(_0x5534('0x17'))['db'];function respondWithStatusCode(_0x255fcc,_0x36cbcd){_0x36cbcd=_0x36cbcd||0xcc;return function(_0x1c4d4c){if(_0x1c4d4c){return _0x255fcc['sendStatus'](_0x36cbcd);}return _0x255fcc['status'](_0x36cbcd)['end']();};}function respondWithResult(_0x4b0a11,_0x1a6065){_0x1a6065=_0x1a6065||0xc8;return function(_0x3d51af){if(_0x3d51af){return _0x4b0a11['status'](_0x1a6065)[_0x5534('0x18')](_0x3d51af);}};}function respondWithFilteredResult(_0x4c4144,_0x311917){return function(_0x48a8ed){if(_0x48a8ed){var _0x26b839=typeof _0x311917[_0x5534('0x19')]==='undefined'&&typeof _0x311917[_0x5534('0x1a')]==='undefined';var _0x37f73e=_0x48a8ed[_0x5534('0x1b')];var _0x245143=_0x26b839?0x0:_0x311917[_0x5534('0x19')];var _0x2a588c=_0x26b839?_0x48a8ed['count']:_0x311917[_0x5534('0x19')]+_0x311917[_0x5534('0x1a')];var _0x28b654;if(_0x2a588c>=_0x37f73e){_0x2a588c=_0x37f73e;_0x28b654=0xc8;}else{_0x28b654=0xce;}_0x4c4144[_0x5534('0x1c')](_0x28b654);return _0x4c4144['set']('Content-Range',_0x245143+'-'+_0x2a588c+'/'+_0x37f73e)['json'](_0x48a8ed);}return null;};}function patchUpdates(_0x26b1ef){return function(_0x4d19f5){try{jsonpatch[_0x5534('0x1d')](_0x4d19f5,_0x26b1ef,!![]);}catch(_0x2139be){return BPromise[_0x5534('0x1e')](_0x2139be);}return _0x4d19f5[_0x5534('0x1f')]();};}function saveUpdates(_0x463005,_0x421c6c){return function(_0x4c61ff){if(_0x4c61ff){return _0x4c61ff['update'](_0x463005)[_0x5534('0x20')](function(_0x2cf6f6){return _0x2cf6f6;});}return null;};}function removeEntity(_0x1e07c0,_0x2ca6f4){return function(_0x38ae8d){if(_0x38ae8d){return _0x38ae8d[_0x5534('0x21')]()['then'](function(){_0x1e07c0['status'](0xcc)[_0x5534('0x22')]();});}};}function handleEntityNotFound(_0x4c883a,_0x3a61fd){return function(_0x22d620){if(!_0x22d620){_0x4c883a['sendStatus'](0x194);}return _0x22d620;};}function handleError(_0x20a28b,_0x3fbb2f){_0x3fbb2f=_0x3fbb2f||0x1f4;return function(_0x14d737){logger[_0x5534('0x23')](_0x14d737[_0x5534('0x24')]);if(_0x14d737[_0x5534('0x25')]){delete _0x14d737[_0x5534('0x25')];}_0x20a28b[_0x5534('0x1c')](_0x3fbb2f)[_0x5534('0x26')](_0x14d737);};}exports[_0x5534('0x27')]=function(_0x33a8fd,_0xd85e29){var _0x191a3d={},_0x3992bb={},_0x5bbe7e={'count':0x0,'rows':[]};var _0x1d61b0=_[_0x5534('0x28')](db[_0x5534('0x29')]['rawAttributes'],function(_0x212a02){return{'name':_0x212a02[_0x5534('0x2a')],'type':_0x212a02[_0x5534('0x2b')]['key']};});_0x3992bb[_0x5534('0x2c')]=_[_0x5534('0x28')](_0x1d61b0,_0x5534('0x25'));_0x3992bb[_0x5534('0x2d')]=_['keys'](_0x33a8fd[_0x5534('0x2d')]);_0x3992bb[_0x5534('0x2e')]=_[_0x5534('0x2f')](_0x3992bb['model'],_0x3992bb[_0x5534('0x2d')]);_0x191a3d[_0x5534('0x30')]=_[_0x5534('0x2f')](_0x3992bb[_0x5534('0x2c')],qs[_0x5534('0x31')](_0x33a8fd[_0x5534('0x2d')]['fields']));_0x191a3d['attributes']=_0x191a3d[_0x5534('0x30')][_0x5534('0x32')]?_0x191a3d[_0x5534('0x30')]:_0x3992bb[_0x5534('0x2c')];if(!_0x33a8fd[_0x5534('0x2d')][_0x5534('0x33')]('nolimit')){_0x191a3d[_0x5534('0x1a')]=qs['limit'](_0x33a8fd[_0x5534('0x2d')][_0x5534('0x1a')]);_0x191a3d[_0x5534('0x19')]=qs['offset'](_0x33a8fd[_0x5534('0x2d')][_0x5534('0x19')]);}_0x191a3d[_0x5534('0x34')]=qs[_0x5534('0x35')](_0x33a8fd[_0x5534('0x2d')][_0x5534('0x35')]);_0x191a3d[_0x5534('0x36')]=qs[_0x5534('0x2e')](_['pick'](_0x33a8fd[_0x5534('0x2d')],_0x3992bb[_0x5534('0x2e')]),_0x1d61b0);if(_0x33a8fd[_0x5534('0x2d')][_0x5534('0x37')]){_0x191a3d[_0x5534('0x36')]=_[_0x5534('0x38')](_0x191a3d[_0x5534('0x36')],{'$or':_[_0x5534('0x28')](_0x1d61b0,function(_0x10165d){if(_0x10165d['type']!==_0x5534('0x39')){var _0xa76d75={};_0xa76d75[_0x10165d[_0x5534('0x25')]]={'$like':'%'+_0x33a8fd['query'][_0x5534('0x37')]+'%'};return _0xa76d75;}})});}_0x191a3d=_['merge']({},_0x191a3d,_0x33a8fd[_0x5534('0x3a')]);var _0xc4ed79={'where':_0x191a3d[_0x5534('0x36')]};return db[_0x5534('0x29')][_0x5534('0x1b')](_0xc4ed79)[_0x5534('0x20')](function(_0x1b149d){_0x5bbe7e[_0x5534('0x1b')]=_0x1b149d;if(_0x33a8fd['query']['includeAll']){_0x191a3d[_0x5534('0x3b')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x191a3d);})['then'](function(_0x3de5d0){_0x5bbe7e[_0x5534('0x3c')]=_0x3de5d0;return _0x5bbe7e;})['then'](respondWithFilteredResult(_0xd85e29,_0x191a3d))[_0x5534('0x3d')](handleError(_0xd85e29,null));};exports[_0x5534('0x3e')]=function(_0x1db45b,_0x5ce594){var _0x336c9a={'raw':!![],'where':{'id':_0x1db45b[_0x5534('0x3f')]['id']}},_0x1e01b0={};_0x1e01b0['model']=_[_0x5534('0x40')](db['CmHopperHistory'][_0x5534('0x41')]);_0x1e01b0['query']=_[_0x5534('0x40')](_0x1db45b[_0x5534('0x2d')]);_0x1e01b0[_0x5534('0x2e')]=_[_0x5534('0x2f')](_0x1e01b0[_0x5534('0x2c')],_0x1e01b0[_0x5534('0x2d')]);_0x336c9a[_0x5534('0x30')]=_[_0x5534('0x2f')](_0x1e01b0[_0x5534('0x2c')],qs[_0x5534('0x31')](_0x1db45b[_0x5534('0x2d')][_0x5534('0x31')]));_0x336c9a[_0x5534('0x30')]=_0x336c9a['attributes'][_0x5534('0x32')]?_0x336c9a[_0x5534('0x30')]:_0x1e01b0[_0x5534('0x2c')];if(_0x1db45b[_0x5534('0x2d')]['includeAll']){_0x336c9a[_0x5534('0x3b')]=[{'all':!![]}];}_0x336c9a=_['merge']({},_0x336c9a,_0x1db45b[_0x5534('0x3a')]);return db[_0x5534('0x29')][_0x5534('0x42')](_0x336c9a)['then'](handleEntityNotFound(_0x5ce594,null))[_0x5534('0x20')](respondWithResult(_0x5ce594,null))[_0x5534('0x3d')](handleError(_0x5ce594,null));};exports[_0x5534('0x43')]=function(_0x471527,_0x6fd916){return db[_0x5534('0x29')][_0x5534('0x43')](_0x471527[_0x5534('0x44')],{})[_0x5534('0x20')](respondWithResult(_0x6fd916,0xc9))[_0x5534('0x3d')](handleError(_0x6fd916,null));};exports[_0x5534('0x45')]=function(_0x164b1f,_0x3f2909){return db[_0x5534('0x29')][_0x5534('0x45')]()[_0x5534('0x20')](respondWithResult(_0x3f2909,null))[_0x5534('0x3d')](handleError(_0x3f2909,null));};exports['update']=function(_0x5e2151,_0x2026f5){if(_0x5e2151[_0x5534('0x44')][_0x5534('0x46')]){delete _0x5e2151[_0x5534('0x44')][_0x5534('0x46')];}return db['CmHopperHistory'][_0x5534('0x42')]({'where':{'uniqueid':_0x5e2151[_0x5534('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2026f5,null))['then'](saveUpdates(_0x5e2151[_0x5534('0x44')],null))[_0x5534('0x20')](respondWithResult(_0x2026f5,null))['catch'](handleError(_0x2026f5,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7175dee..4d4965b 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 _0xcf37=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime','uniqueid','util'];(function(_0x35b604,_0x577250){var _0x16b17f=function(_0x26cef5){while(--_0x26cef5){_0x35b604['push'](_0x35b604['shift']());}};_0x16b17f(++_0x577250);}(_0xcf37,0xdc));var _0x7cf3=function(_0x49a015,_0x4186e8){_0x49a015=_0x49a015-0x0;var _0x35b9c6=_0xcf37[_0x49a015];return _0x35b9c6;};'use strict';var _=require('lodash');var util=require(_0x7cf3('0x0'));var logger=require(_0x7cf3('0x1'))(_0x7cf3('0x2'));var moment=require(_0x7cf3('0x3'));var BPromise=require(_0x7cf3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cf3('0x5'));var rimraf=require(_0x7cf3('0x6'));var config=require(_0x7cf3('0x7'));var attributes=require(_0x7cf3('0x8'));module[_0x7cf3('0x9')]=function(_0x48c7cf,_0x488938){return _0x48c7cf['define']('CmHopperHistory',attributes,{'tableName':_0x7cf3('0xa'),'paranoid':![],'indexes':[{'name':_0x7cf3('0xb'),'fields':[_0x7cf3('0xb')]},{'name':'uniqueid','fields':[_0x7cf3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0adf=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime'];(function(_0xd2f716,_0xb85824){var _0x37697a=function(_0x4cf930){while(--_0x4cf930){_0xd2f716['push'](_0xd2f716['shift']());}};_0x37697a(++_0xb85824);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x54f22c,_0x1e371e){_0x54f22c=_0x54f22c-0x0;var _0x556989=_0x0adf[_0x54f22c];return _0x556989;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var logger=require(_0xf0ad('0x2'))('api');var moment=require(_0xf0ad('0x3'));var BPromise=require(_0xf0ad('0x4'));var rp=require(_0xf0ad('0x5'));var fs=require('fs');var path=require(_0xf0ad('0x6'));var rimraf=require(_0xf0ad('0x7'));var config=require(_0xf0ad('0x8'));var attributes=require(_0xf0ad('0x9'));module['exports']=function(_0x3bbf85,_0x53221f){return _0x3bbf85[_0xf0ad('0xa')](_0xf0ad('0xb'),attributes,{'tableName':_0xf0ad('0xc'),'paranoid':![],'indexes':[{'name':_0xf0ad('0xd'),'fields':[_0xf0ad('0xd')]},{'name':_0xf0ad('0xe'),'fields':[_0xf0ad('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 47f9c66..2da008b 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 _0x688a=['outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','result','catch','create','body','options','CreateCmHopperHistory','AvgHandleTime','CmHopperHistory','findAll','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','campaign','name','`state`\x20=\x200,\x201,\x20null'];(function(_0x3f2b46,_0x5693e5){var _0x150488=function(_0x35aebf){while(--_0x35aebf){_0x3f2b46['push'](_0x3f2b46['shift']());}};_0x150488(++_0x5693e5);}(_0x688a,0x124));var _0xa688=function(_0x167266,_0x44a138){_0x167266=_0x167266-0x0;var _0x61ba64=_0x688a[_0x167266];return _0x61ba64;};'use strict';var _=require(_0xa688('0x0'));var util=require(_0xa688('0x1'));var moment=require(_0xa688('0x2'));var BPromise=require('bluebird');var rs=require(_0xa688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa688('0x4'))['db'];var utils=require(_0xa688('0x5'));var logger=require('../../config/logger')(_0xa688('0x6'));var config=require(_0xa688('0x7'));var jayson=require(_0xa688('0x8'));var client=jayson[_0xa688('0x9')][_0xa688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a362a,_0x49e75d,_0x5aee29){return new BPromise(function(_0x45c969,_0x3f3d81){return client[_0xa688('0xb')](_0x2a362a,_0x5aee29)['then'](function(_0x4d3b92){logger[_0xa688('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x49e75d,'request\x20sent');logger[_0xa688('0xd')](_0xa688('0xe'),_0x49e75d,_0xa688('0xf'),JSON[_0xa688('0x10')](_0x4d3b92));if(_0x4d3b92[_0xa688('0x11')]){if(_0x4d3b92[_0xa688('0x11')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x49e75d,_0x4d3b92[_0xa688('0x11')][_0xa688('0x12')]);return _0x3f3d81(_0x4d3b92['error'][_0xa688('0x12')]);}logger['error'](_0xa688('0x13'),_0x49e75d,_0x4d3b92[_0xa688('0x11')]['message']);return _0x45c969(_0x4d3b92['error'][_0xa688('0x12')]);}else{logger['info'](_0xa688('0x13'),_0x49e75d,'request\x20sent');_0x45c969(_0x4d3b92[_0xa688('0x14')][_0xa688('0x12')]);}})[_0xa688('0x15')](function(_0x25b453){logger[_0xa688('0x11')](_0xa688('0x13'),_0x49e75d,_0x25b453);_0x3f3d81(_0x25b453);});});}exports['CreateCmHopperHistory']=function(_0x59e392){var _0x14ca3c=this;return new Promise(function(_0x1330d5,_0x5dc07f){return db['CmHopperHistory'][_0xa688('0x16')](_0x59e392[_0xa688('0x17')],{'raw':_0x59e392['options']?_0x59e392[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x152cfe){logger[_0xa688('0xc')](_0xa688('0x19'),_0x59e392);logger[_0xa688('0xd')](_0xa688('0x19'),_0x59e392,JSON[_0xa688('0x10')](_0x152cfe));_0x1330d5(_0x152cfe);})[_0xa688('0x15')](function(_0x203214){logger[_0xa688('0x11')](_0xa688('0x19'),_0x203214[_0xa688('0x12')],_0x59e392);_0x5dc07f(_0x14ca3c[_0xa688('0x11')](0x1f4,_0x203214[_0xa688('0x12')]));});});};exports[_0xa688('0x1a')]=function(_0x48cb17){var _0x442672=this;return new Promise(function(_0x32a682,_0x4fa15e){return db[_0xa688('0x1b')][_0xa688('0x1c')]({'raw':_0x48cb17['options']?_0x48cb17[_0xa688('0x18')][_0xa688('0x1d')]===undefined?!![]:![]:!![],'where':_0x48cb17[_0xa688('0x18')]?_0x48cb17[_0xa688('0x18')][_0xa688('0x1e')]||null:null,'attributes':[[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')][_0xa688('0x21')]('id')),_0xa688('0x22')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xa688('0x24')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0xa688('0x20'),db['sequelize']['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x25')))),_0xa688('0x26')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x27'),db[_0xa688('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x27'),db[_0xa688('0x1f')]['fn']('IF',db['sequelize'][_0xa688('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x376ad2){logger[_0xa688('0xc')](_0xa688('0x1a'),_0x48cb17);logger['debug']('AvgHandleTime',_0x48cb17,JSON[_0xa688('0x10')](_0x376ad2));_0x32a682(_0x376ad2);})[_0xa688('0x15')](function(_0x2ba000){logger[_0xa688('0x11')](_0xa688('0x1a'),_0x2ba000['message'],_0x48cb17);_0x4fa15e(_0x442672['error'](0x1f4,_0x2ba000[_0xa688('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x11806b){var _0x2f8f0d=this;return new Promise(function(_0x19e13b,_0x288171){return db['CmHopperHistory'][_0xa688('0x1c')]({'raw':_0x11806b['options']?_0x11806b['options'][_0xa688('0x1d')]===undefined?!![]:![]:!![],'where':_0x11806b['options']?_0x11806b[_0xa688('0x18')]['where']||null:null,'attributes':[[_0xa688('0x28'),_0xa688('0x29')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2a')))),_0xa688('0x2b')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2c')))),'outboundNoAnswerCallsDay'],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2d')))),'outboundAnswerCallsDay'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db['sequelize']['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2e')))),_0xa688('0x2f')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x208,\x201,\x20null'))),_0xa688('0x30')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x31')))),_0xa688('0x32')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa688('0x33')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x34')))),_0xa688('0x35')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x36')))),_0xa688('0x37')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x38')))),_0xa688('0x39')],[db['sequelize']['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3a')))),_0xa688('0x3b')],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3c')))),'outboundAnswerAgiCallsDay'],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x3d')))),'outboundRejectCallsDay'],[db[_0xa688('0x1f')]['fn']('COUNT',db[_0xa688('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xa688('0x3e')))),_0xa688('0x3f')]],'group':[_0xa688('0x28')]})['then'](function(_0x4381a4){logger['info']('GetVoiceQueueHopperHistory',_0x11806b);logger['debug']('GetVoiceQueueHopperHistory',_0x11806b,JSON['stringify'](_0x4381a4));_0x19e13b(_0x4381a4);})[_0xa688('0x15')](function(_0x1b8be2){logger[_0xa688('0x11')]('GetVoiceQueueHopperHistory',_0x1b8be2[_0xa688('0x12')],_0x11806b);_0x288171(_0x2f8f0d['error'](0x1f4,_0x1b8be2[_0xa688('0x12')]));});});};exports[_0xa688('0x40')]=function(_0x3adf43){var _0x38defa=this;return new Promise(function(_0x25c618,_0x409b63){return db[_0xa688('0x1b')][_0xa688('0x1c')]({'raw':_0x3adf43[_0xa688('0x18')]?_0x3adf43[_0xa688('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3adf43['options']?_0x3adf43['options'][_0xa688('0x1e')]||null:null,'attributes':[[_0xa688('0x28'),_0xa688('0x29')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')][_0xa688('0x21')]('id')),_0xa688('0x41')],[db[_0xa688('0x1f')]['fn'](_0xa688('0x20'),db[_0xa688('0x1f')]['fn']('IF',db[_0xa688('0x1f')][_0xa688('0x23')](_0xa688('0x2d')))),_0xa688('0x42')]],'group':['campaign']})['then'](function(_0x2068cb){logger['info']('GetCampaignHopperHistory',_0x3adf43);logger[_0xa688('0xd')](_0xa688('0x40'),_0x3adf43,JSON['stringify'](_0x2068cb));_0x25c618(_0x2068cb);})[_0xa688('0x15')](function(_0x4ccb2f){logger[_0xa688('0x11')]('GetCampaignHopperHistory',_0x4ccb2f[_0xa688('0x12')],_0x3adf43);_0x409b63(_0x38defa['error'](0x1f4,_0x4ccb2f[_0xa688('0x12')]));});});}; \ No newline at end of file +var _0xc2e8=['create','options','CreateCmHopperHistory','CmHopperHistory','findAll','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','raw','where','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','outboundReCallsDay','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x42343e,_0x5b0c01){var _0x23dffd=function(_0x3d1dcf){while(--_0x3d1dcf){_0x42343e['push'](_0x42343e['shift']());}};_0x23dffd(++_0x5b0c01);}(_0xc2e8,0x70));var _0x8c2e=function(_0x2c8661,_0x212022){_0x2c8661=_0x2c8661-0x0;var _0x395c74=_0xc2e8[_0x2c8661];return _0x395c74;};'use strict';var _=require(_0x8c2e('0x0'));var util=require(_0x8c2e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8c2e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c2e('0x3'))['db'];var utils=require(_0x8c2e('0x4'));var logger=require(_0x8c2e('0x5'))('rpc');var config=require(_0x8c2e('0x6'));var jayson=require(_0x8c2e('0x7'));var client=jayson[_0x8c2e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bf5d0,_0x4b8f44,_0x487731){return new BPromise(function(_0x4abd39,_0xcc200c){return client[_0x8c2e('0x9')](_0x4bf5d0,_0x487731)[_0x8c2e('0xa')](function(_0x331e6d){logger[_0x8c2e('0xb')](_0x8c2e('0xc'),_0x4b8f44,_0x8c2e('0xd'));logger[_0x8c2e('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4b8f44,_0x8c2e('0xd'),JSON[_0x8c2e('0xf')](_0x331e6d));if(_0x331e6d[_0x8c2e('0x10')]){if(_0x331e6d['error']['code']===0x1f4){logger['error'](_0x8c2e('0xc'),_0x4b8f44,_0x331e6d[_0x8c2e('0x10')][_0x8c2e('0x11')]);return _0xcc200c(_0x331e6d[_0x8c2e('0x10')][_0x8c2e('0x11')]);}logger[_0x8c2e('0x10')](_0x8c2e('0xc'),_0x4b8f44,_0x331e6d['error']['message']);return _0x4abd39(_0x331e6d[_0x8c2e('0x10')][_0x8c2e('0x11')]);}else{logger[_0x8c2e('0xb')](_0x8c2e('0xc'),_0x4b8f44,_0x8c2e('0xd'));_0x4abd39(_0x331e6d[_0x8c2e('0x12')]['message']);}})[_0x8c2e('0x13')](function(_0x10d610){logger[_0x8c2e('0x10')](_0x8c2e('0xc'),_0x4b8f44,_0x10d610);_0xcc200c(_0x10d610);});});}exports['CreateCmHopperHistory']=function(_0x944b34){var _0x8aa81d=this;return new Promise(function(_0x2e2e46,_0x56d9f4){return db['CmHopperHistory'][_0x8c2e('0x14')](_0x944b34['body'],{'raw':_0x944b34[_0x8c2e('0x15')]?_0x944b34[_0x8c2e('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x8c2e('0xa')](function(_0x3b101e){logger[_0x8c2e('0xb')](_0x8c2e('0x16'),_0x944b34);logger[_0x8c2e('0xe')]('CreateCmHopperHistory',_0x944b34,JSON[_0x8c2e('0xf')](_0x3b101e));_0x2e2e46(_0x3b101e);})['catch'](function(_0x4937b0){logger[_0x8c2e('0x10')](_0x8c2e('0x16'),_0x4937b0['message'],_0x944b34);_0x56d9f4(_0x8aa81d['error'](0x1f4,_0x4937b0[_0x8c2e('0x11')]));});});};exports['AvgHandleTime']=function(_0x350cc5){var _0x3e2aa0=this;return new Promise(function(_0xb03649,_0x50a3db){return db[_0x8c2e('0x17')][_0x8c2e('0x18')]({'raw':_0x350cc5[_0x8c2e('0x15')]?_0x350cc5[_0x8c2e('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x350cc5[_0x8c2e('0x15')]?_0x350cc5['options']['where']||null:null,'attributes':[[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db['sequelize']['col']('id')),_0x8c2e('0x1b')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x1d')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')]('`state`\x20=\x2010,\x201,\x20null'))),_0x8c2e('0x1e')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')]['literal'](_0x8c2e('0x1f')))),_0x8c2e('0x20')],[db['sequelize']['fn'](_0x8c2e('0x21'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x22')))),_0x8c2e('0x23')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x21'),db['sequelize']['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x24')))),_0x8c2e('0x25')]]})[_0x8c2e('0xa')](function(_0x1a51ac){logger[_0x8c2e('0xb')](_0x8c2e('0x26'),_0x350cc5);logger[_0x8c2e('0xe')]('AvgHandleTime',_0x350cc5,JSON[_0x8c2e('0xf')](_0x1a51ac));_0xb03649(_0x1a51ac);})[_0x8c2e('0x13')](function(_0x3a1bb1){logger[_0x8c2e('0x10')](_0x8c2e('0x26'),_0x3a1bb1['message'],_0x350cc5);_0x50a3db(_0x3e2aa0['error'](0x1f4,_0x3a1bb1[_0x8c2e('0x11')]));});});};exports[_0x8c2e('0x27')]=function(_0x21f515){var _0x22a23b=this;return new Promise(function(_0x1752f9,_0x31c677){return db[_0x8c2e('0x17')]['findAll']({'raw':_0x21f515['options']?_0x21f515[_0x8c2e('0x15')][_0x8c2e('0x28')]===undefined?!![]:![]:!![],'where':_0x21f515[_0x8c2e('0x15')]?_0x21f515[_0x8c2e('0x15')][_0x8c2e('0x29')]||null:null,'attributes':[[_0x8c2e('0x2a'),_0x8c2e('0x2b')],[db[_0x8c2e('0x19')]['fn']('COUNT',db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')]('`state`\x20=\x200,\x201,\x20null'))),_0x8c2e('0x2c')],[db['sequelize']['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x8c2e('0x2d')],[db[_0x8c2e('0x19')]['fn']('COUNT',db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')]['literal'](_0x8c2e('0x1d')))),'outboundAnswerCallsDay'],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')]('`state`\x20=\x205,\x201,\x20null'))),_0x8c2e('0x2e')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db['sequelize']['literal'](_0x8c2e('0x2f')))),_0x8c2e('0x30')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x31')))),'outboundDropCallsDayTimeout'],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x32')))),_0x8c2e('0x33')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')]['literal'](_0x8c2e('0x34')))),_0x8c2e('0x35')],[db[_0x8c2e('0x19')]['fn']('COUNT',db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x36')))),_0x8c2e('0x37')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x38')))),_0x8c2e('0x39')],[db['sequelize']['fn']('COUNT',db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x3a')))),_0x8c2e('0x3b')],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x3c')))),_0x8c2e('0x3d')],[db['sequelize']['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x8c2e('0x3e')]],'group':[_0x8c2e('0x2a')]})[_0x8c2e('0xa')](function(_0x3d9423){logger[_0x8c2e('0xb')](_0x8c2e('0x27'),_0x21f515);logger[_0x8c2e('0xe')](_0x8c2e('0x27'),_0x21f515,JSON[_0x8c2e('0xf')](_0x3d9423));_0x1752f9(_0x3d9423);})[_0x8c2e('0x13')](function(_0x5dfdd3){logger[_0x8c2e('0x10')](_0x8c2e('0x27'),_0x5dfdd3[_0x8c2e('0x11')],_0x21f515);_0x31c677(_0x22a23b[_0x8c2e('0x10')](0x1f4,_0x5dfdd3['message']));});});};exports[_0x8c2e('0x3f')]=function(_0x492215){var _0x180b15=this;return new Promise(function(_0x59b0d4,_0x3a47b8){return db['CmHopperHistory'][_0x8c2e('0x18')]({'raw':_0x492215['options']?_0x492215[_0x8c2e('0x15')][_0x8c2e('0x28')]===undefined?!![]:![]:!![],'where':_0x492215['options']?_0x492215[_0x8c2e('0x15')][_0x8c2e('0x29')]||null:null,'attributes':[[_0x8c2e('0x2a'),'name'],[db[_0x8c2e('0x19')]['fn'](_0x8c2e('0x1a'),db['sequelize'][_0x8c2e('0x40')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x8c2e('0x1a'),db[_0x8c2e('0x19')]['fn']('IF',db[_0x8c2e('0x19')][_0x8c2e('0x1c')](_0x8c2e('0x1d')))),_0x8c2e('0x41')]],'group':[_0x8c2e('0x2a')]})[_0x8c2e('0xa')](function(_0x204bbf){logger[_0x8c2e('0xb')](_0x8c2e('0x3f'),_0x492215);logger['debug']('GetCampaignHopperHistory',_0x492215,JSON[_0x8c2e('0xf')](_0x204bbf));_0x59b0d4(_0x204bbf);})[_0x8c2e('0x13')](function(_0x424800){logger[_0x8c2e('0x10')]('GetCampaignHopperHistory',_0x424800[_0x8c2e('0x11')],_0x492215);_0x3a47b8(_0x180b15[_0x8c2e('0x10')](0x1f4,_0x424800[_0x8c2e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a61590d..fcf4ff2 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 _0x5ff0=['isAuthenticated','get','/:id','post','create','put','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/describe'];(function(_0x30e79c,_0x5e0b71){var _0x4839a0=function(_0x8ad48b){while(--_0x8ad48b){_0x30e79c['push'](_0x30e79c['shift']());}};_0x4839a0(++_0x5e0b71);}(_0x5ff0,0xb6));var _0x05ff=function(_0x551a81,_0x1297a5){_0x551a81=_0x551a81-0x0;var _0x1cd44c=_0x5ff0[_0x551a81];return _0x1cd44c;};'use strict';var multer=require(_0x05ff('0x0'));var util=require(_0x05ff('0x1'));var path=require(_0x05ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x05ff('0x3'));var router=express[_0x05ff('0x4')]();var fs_extra=require(_0x05ff('0x5'));var auth=require(_0x05ff('0x6'));var interaction=require(_0x05ff('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x05ff('0x8')]);router['get'](_0x05ff('0x9'),auth[_0x05ff('0xa')](),controller['describe']);router[_0x05ff('0xb')](_0x05ff('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x05ff('0xd')]('/',auth[_0x05ff('0xa')](),controller[_0x05ff('0xe')]);router[_0x05ff('0xf')](_0x05ff('0xc'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x5182=['create','/:id','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','show','post'];(function(_0xc06b,_0x180c23){var _0x38dab3=function(_0x440f27){while(--_0x440f27){_0xc06b['push'](_0xc06b['shift']());}};_0x38dab3(++_0x180c23);}(_0x5182,0x1e3));var _0x2518=function(_0x1155e6,_0x233e73){_0x1155e6=_0x1155e6-0x0;var _0x35dd79=_0x5182[_0x1155e6];return _0x35dd79;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2518('0x0'));var express=require(_0x2518('0x1'));var router=express['Router']();var fs_extra=require(_0x2518('0x2'));var auth=require(_0x2518('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2518('0x4'));var controller=require(_0x2518('0x5'));router['get']('/',auth[_0x2518('0x6')](),controller[_0x2518('0x7')]);router[_0x2518('0x8')](_0x2518('0x9'),auth[_0x2518('0x6')](),controller[_0x2518('0xa')]);router[_0x2518('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2518('0xb')]);router[_0x2518('0xc')]('/',auth[_0x2518('0x6')](),controller[_0x2518('0xd')]);router['put'](_0x2518('0xe'),auth[_0x2518('0x6')](),controller['update']);module[_0x2518('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 961cdbc..b379e54 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 _0xf360=['exports','STRING','sequelize'];(function(_0x41b85f,_0x181095){var _0x59cce2=function(_0x925b40){while(--_0x925b40){_0x41b85f['push'](_0x41b85f['shift']());}};_0x59cce2(++_0x181095);}(_0xf360,0x9e));var _0x0f36=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xf360[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0x0f36('0x0'));module[_0x0f36('0x1')]={'name':{'type':Sequelize[_0x0f36('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0f36('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf5a=['exports','name','STRING'];(function(_0x13788e,_0x10b46a){var _0x1349d9=function(_0x21fbdb){while(--_0x21fbdb){_0x13788e['push'](_0x13788e['shift']());}};_0x1349d9(++_0x10b46a);}(_0xaf5a,0x144));var _0xaaf5=function(_0x4e4ee0,_0x66ce4f){_0x4e4ee0=_0x4e4ee0-0x0;var _0x2a413d=_0xaf5a[_0x4e4ee0];return _0x2a413d;};'use strict';var Sequelize=require('sequelize');module[_0xaaf5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xaaf5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaaf5('0x2')]},'dialPrefix':{'type':Sequelize[_0xaaf5('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 61d6a17..817e3d6 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 _0xdbf5=['tags','push','success','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','hasOwnProperty','nolimit','raw','CmCustomField','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','ids','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','send','index','CmList','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','attributes','fields','length','model','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','rows','removeDispositions','addContacts','CmContact','isArray'];(function(_0x304d22,_0x40537c){var _0x11694b=function(_0x121b59){while(--_0x121b59){_0x304d22['push'](_0x304d22['shift']());}};_0x11694b(++_0x40537c);}(_0xdbf5,0xc3));var _0x5dbf=function(_0x3350c3,_0xfe631a){_0x3350c3=_0x3350c3-0x0;var _0x240ec1=_0xdbf5[_0x3350c3];return _0x240ec1;};'use strict';var emlformat=require(_0x5dbf('0x0'));var rimraf=require(_0x5dbf('0x1'));var zipdir=require(_0x5dbf('0x2'));var jsonpatch=require(_0x5dbf('0x3'));var rp=require(_0x5dbf('0x4'));var moment=require(_0x5dbf('0x5'));var BPromise=require(_0x5dbf('0x6'));var Mustache=require(_0x5dbf('0x7'));var util=require(_0x5dbf('0x8'));var path=require(_0x5dbf('0x9'));var sox=require('sox');var csv=require(_0x5dbf('0xa'));var ejs=require(_0x5dbf('0xb'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xc'));var _=require(_0x5dbf('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5dbf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5dbf('0xa'));var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5dbf('0x12'));var as=require(_0x5dbf('0x13'));var hardwareService=require(_0x5dbf('0x14'));var logger=require(_0x5dbf('0x15'))(_0x5dbf('0x16'));var utils=require(_0x5dbf('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5dbf('0x19')](config[_0x5dbf('0x1a')],{'host':_0x5dbf('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dbf('0x1a')]));require(_0x5dbf('0x1c'))['register'](socket);function respondWithStatusCode(_0x5e54a6,_0x1918fc){_0x1918fc=_0x1918fc||0xcc;return function(_0x10245f){if(_0x10245f){return _0x5e54a6[_0x5dbf('0x1d')](_0x1918fc);}return _0x5e54a6[_0x5dbf('0x1e')](_0x1918fc)[_0x5dbf('0x1f')]();};}function respondWithResult(_0x56ef00,_0x2d3c41){_0x2d3c41=_0x2d3c41||0xc8;return function(_0x366c32){if(_0x366c32){return _0x56ef00[_0x5dbf('0x1e')](_0x2d3c41)[_0x5dbf('0x20')](_0x366c32);}};}function respondWithFilteredResult(_0x1c484a,_0x4019e7){return function(_0x231d1c){if(_0x231d1c){var _0xfef260=typeof _0x4019e7[_0x5dbf('0x21')]===_0x5dbf('0x22')&&typeof _0x4019e7[_0x5dbf('0x23')]===_0x5dbf('0x22');var _0x4bbc8f=_0x231d1c['count'];var _0x746a96=_0xfef260?0x0:_0x4019e7[_0x5dbf('0x21')];var _0x186edd=_0xfef260?_0x231d1c[_0x5dbf('0x24')]:_0x4019e7['offset']+_0x4019e7[_0x5dbf('0x23')];var _0x236773;if(_0x186edd>=_0x4bbc8f){_0x186edd=_0x4bbc8f;_0x236773=0xc8;}else{_0x236773=0xce;}_0x1c484a[_0x5dbf('0x1e')](_0x236773);return _0x1c484a[_0x5dbf('0x25')](_0x5dbf('0x26'),_0x746a96+'-'+_0x186edd+'/'+_0x4bbc8f)[_0x5dbf('0x20')](_0x231d1c);}return null;};}function patchUpdates(_0x2fb307){return function(_0x145985){try{jsonpatch[_0x5dbf('0x27')](_0x145985,_0x2fb307,!![]);}catch(_0x3f3d38){return BPromise[_0x5dbf('0x28')](_0x3f3d38);}return _0x145985[_0x5dbf('0x29')]();};}function saveUpdates(_0x5ea58f,_0x16f3aa){return function(_0xc41d4a){if(_0xc41d4a){return _0xc41d4a[_0x5dbf('0x2a')](_0x5ea58f)[_0x5dbf('0x2b')](function(_0x5189a8){return _0x5189a8;});}return null;};}function removeEntity(_0x5e159b,_0xcc5767){return function(_0x244055){if(_0x244055){return _0x244055[_0x5dbf('0x2c')]()['then'](function(){var _0x4e556b=_0x244055[_0x5dbf('0x2d')]({'plain':!![]});var _0x173cb4=_0x5dbf('0x2e');return db[_0x5dbf('0x2f')][_0x5dbf('0x2c')]({'where':{'type':_0x173cb4,'resourceId':_0x4e556b['id']}})[_0x5dbf('0x2b')](function(){return _0x244055;});})['then'](function(){_0x5e159b[_0x5dbf('0x1e')](0xcc)[_0x5dbf('0x1f')]();});}};}function handleEntityNotFound(_0x5da3c6,_0x55b0ee){return function(_0x38e7d1){if(!_0x38e7d1){_0x5da3c6['sendStatus'](0x194);}return _0x38e7d1;};}function handleError(_0x4f7149,_0x1c5b38){_0x1c5b38=_0x1c5b38||0x1f4;return function(_0x117890){logger[_0x5dbf('0x30')](_0x117890[_0x5dbf('0x31')]);if(_0x117890['name']){delete _0x117890['name'];}_0x4f7149[_0x5dbf('0x1e')](_0x1c5b38)[_0x5dbf('0x32')](_0x117890);};}exports[_0x5dbf('0x33')]=function(_0x27cd63,_0x5c42c1){var _0x2c94da={},_0x2bff13={},_0x349681={'count':0x0,'rows':[]};var _0x26562a=_['map'](db[_0x5dbf('0x34')][_0x5dbf('0x35')],function(_0x10a872){return{'name':_0x10a872[_0x5dbf('0x36')],'type':_0x10a872[_0x5dbf('0x37')][_0x5dbf('0x38')]};});_0x2bff13['model']=_[_0x5dbf('0x39')](_0x26562a,_0x5dbf('0x3a'));_0x2bff13[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x27cd63[_0x5dbf('0x3b')]);_0x2bff13[_0x5dbf('0x3d')]=_[_0x5dbf('0x3e')](_0x2bff13['model'],_0x2bff13[_0x5dbf('0x3b')]);_0x2c94da[_0x5dbf('0x3f')]=_[_0x5dbf('0x3e')](_0x2bff13['model'],qs['fields'](_0x27cd63['query'][_0x5dbf('0x40')]));_0x2c94da['attributes']=_0x2c94da[_0x5dbf('0x3f')][_0x5dbf('0x41')]?_0x2c94da['attributes']:_0x2bff13[_0x5dbf('0x42')];if(!_0x27cd63[_0x5dbf('0x3b')]['hasOwnProperty']('nolimit')){_0x2c94da[_0x5dbf('0x23')]=qs[_0x5dbf('0x23')](_0x27cd63[_0x5dbf('0x3b')][_0x5dbf('0x23')]);_0x2c94da['offset']=qs['offset'](_0x27cd63[_0x5dbf('0x3b')][_0x5dbf('0x21')]);}_0x2c94da[_0x5dbf('0x43')]=qs['sort'](_0x27cd63[_0x5dbf('0x3b')][_0x5dbf('0x44')]);_0x2c94da[_0x5dbf('0x45')]=qs[_0x5dbf('0x3d')](_[_0x5dbf('0x46')](_0x27cd63[_0x5dbf('0x3b')],_0x2bff13['filters']),_0x26562a);if(_0x27cd63[_0x5dbf('0x3b')][_0x5dbf('0x47')]){_0x2c94da[_0x5dbf('0x45')]=_['merge'](_0x2c94da[_0x5dbf('0x45')],{'$or':_[_0x5dbf('0x39')](_0x26562a,function(_0x2140a6){if(_0x2140a6['type']!=='VIRTUAL'){var _0x7160f7={};_0x7160f7[_0x2140a6[_0x5dbf('0x3a')]]={'$like':'%'+_0x27cd63['query'][_0x5dbf('0x47')]+'%'};return _0x7160f7;}})});}_0x2c94da=_[_0x5dbf('0x48')]({},_0x2c94da,_0x27cd63[_0x5dbf('0x49')]);var _0x33df86={'where':_0x2c94da[_0x5dbf('0x45')]};return db['CmList'][_0x5dbf('0x24')](_0x33df86)[_0x5dbf('0x2b')](function(_0x3ad9df){_0x349681['count']=_0x3ad9df;if(_0x27cd63[_0x5dbf('0x3b')][_0x5dbf('0x4a')]){_0x2c94da[_0x5dbf('0x4b')]=[{'all':!![]}];}return db[_0x5dbf('0x34')][_0x5dbf('0x4c')](_0x2c94da);})[_0x5dbf('0x2b')](function(_0x3b5cef){_0x349681['rows']=_0x3b5cef;return _0x349681;})[_0x5dbf('0x2b')](respondWithFilteredResult(_0x5c42c1,_0x2c94da))[_0x5dbf('0x4d')](handleError(_0x5c42c1,null));};exports['show']=function(_0x84f4ef,_0x28843b){var _0x471255={'raw':![],'where':{'id':_0x84f4ef[_0x5dbf('0x4e')]['id']}},_0x48e482={};_0x48e482[_0x5dbf('0x42')]=_[_0x5dbf('0x3c')](db['CmList'][_0x5dbf('0x35')]);_0x48e482[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x84f4ef['query']);_0x48e482[_0x5dbf('0x3d')]=_['intersection'](_0x48e482[_0x5dbf('0x42')],_0x48e482[_0x5dbf('0x3b')]);_0x471255[_0x5dbf('0x3f')]=_[_0x5dbf('0x3e')](_0x48e482[_0x5dbf('0x42')],qs['fields'](_0x84f4ef[_0x5dbf('0x3b')][_0x5dbf('0x40')]));_0x471255['attributes']=_0x471255[_0x5dbf('0x3f')][_0x5dbf('0x41')]?_0x471255['attributes']:_0x48e482[_0x5dbf('0x42')];if(_0x84f4ef['query'][_0x5dbf('0x4a')]){_0x471255['include']=[{'all':!![]}];}_0x471255=_[_0x5dbf('0x48')]({},_0x471255,_0x84f4ef[_0x5dbf('0x49')]);return db['CmList'][_0x5dbf('0x4f')](_0x471255)['then'](handleEntityNotFound(_0x28843b,null))[_0x5dbf('0x2b')](respondWithResult(_0x28843b,null))[_0x5dbf('0x4d')](handleError(_0x28843b,null));};exports[_0x5dbf('0x50')]=function(_0x56ad54,_0x260f03){return db[_0x5dbf('0x34')]['create'](_0x56ad54[_0x5dbf('0x51')],{})[_0x5dbf('0x2b')](function(_0xc31bc9){var _0x4475fb=_0x56ad54[_0x5dbf('0x52')][_0x5dbf('0x2d')]({'plain':!![]});if(!_0x4475fb)throw new Error(_0x5dbf('0x53'));if(_0x4475fb[_0x5dbf('0x54')]==='user'){var _0x187ab2=_0xc31bc9[_0x5dbf('0x2d')]({'plain':!![]});var _0x5bacb1=_0x5dbf('0x2e');return db['UserProfileSection'][_0x5dbf('0x4f')]({'where':{'name':_0x5bacb1,'userProfileId':_0x4475fb[_0x5dbf('0x55')]},'raw':!![]})[_0x5dbf('0x2b')](function(_0xf6b706){if(_0xf6b706&&_0xf6b706[_0x5dbf('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x187ab2[_0x5dbf('0x3a')],'resourceId':_0x187ab2['id'],'type':_0xf6b706[_0x5dbf('0x3a')],'sectionId':_0xf6b706['id']},{})[_0x5dbf('0x2b')](function(){return _0xc31bc9;});}else{return _0xc31bc9;}})['catch'](function(_0x12202e){logger['error'](_0x5dbf('0x57'),_0x12202e);throw _0x12202e;});}return _0xc31bc9;})['then'](respondWithResult(_0x260f03,0xc9))[_0x5dbf('0x4d')](handleError(_0x260f03,null));};exports[_0x5dbf('0x2a')]=function(_0x160bc0,_0x7fd442){if(_0x160bc0[_0x5dbf('0x51')]['id']){delete _0x160bc0[_0x5dbf('0x51')]['id'];}return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x160bc0['params']['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x7fd442,null))[_0x5dbf('0x2b')](saveUpdates(_0x160bc0['body'],null))['then'](respondWithResult(_0x7fd442,null))[_0x5dbf('0x4d')](handleError(_0x7fd442,null));};exports['destroy']=function(_0x56fb2c,_0x342731){return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x56fb2c[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x342731,null))[_0x5dbf('0x2b')](removeEntity(_0x342731,null))[_0x5dbf('0x4d')](handleError(_0x342731,null));};exports['describe']=function(_0x232563,_0x33a98d){return db[_0x5dbf('0x34')][_0x5dbf('0x58')]()[_0x5dbf('0x2b')](respondWithResult(_0x33a98d,null))[_0x5dbf('0x4d')](handleError(_0x33a98d,null));};exports[_0x5dbf('0x59')]=function(_0x56ae00,_0x48d909,_0x510f48){if(_0x56ae00[_0x5dbf('0x51')]['id']){delete _0x56ae00['body']['id'];}return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x56ae00[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x48d909,null))[_0x5dbf('0x2b')](function(_0x16fa0d){if(_0x16fa0d){_0x56ae00[_0x5dbf('0x51')][_0x5dbf('0x5a')]=_0x16fa0d['id'];return db[_0x5dbf('0x5b')][_0x5dbf('0x50')](_0x56ae00[_0x5dbf('0x51')]);}})[_0x5dbf('0x2b')](respondWithResult(_0x48d909,null))[_0x5dbf('0x4d')](handleError(_0x48d909,null));};exports[_0x5dbf('0x5c')]=function(_0x1fc946,_0x2d5175,_0x2e99d6){var _0x102212={'raw':![],'where':{}};var _0x1986a2={};var _0x5b155a={'count':0x0,'rows':[]};return db['CmList'][_0x5dbf('0x5d')]({'where':{'id':_0x1fc946[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x2d5175,null))[_0x5dbf('0x2b')](function(_0x14b2af){if(_0x14b2af){_0x1986a2[_0x5dbf('0x42')]=_[_0x5dbf('0x3c')](db[_0x5dbf('0x5b')][_0x5dbf('0x35')]);_0x1986a2[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x1fc946['query']);_0x1986a2['filters']=_['intersection'](_0x1986a2['model'],_0x1986a2[_0x5dbf('0x3b')]);_0x102212['attributes']=_[_0x5dbf('0x3e')](_0x1986a2[_0x5dbf('0x42')],qs[_0x5dbf('0x40')](_0x1fc946[_0x5dbf('0x3b')][_0x5dbf('0x40')]));_0x102212[_0x5dbf('0x3f')]=_0x102212[_0x5dbf('0x3f')]['length']?_0x102212[_0x5dbf('0x3f')]:_0x1986a2[_0x5dbf('0x42')];if(!_0x1fc946[_0x5dbf('0x3b')]['hasOwnProperty']('nolimit')){_0x102212['limit']=qs[_0x5dbf('0x23')](_0x1fc946[_0x5dbf('0x3b')][_0x5dbf('0x23')]);_0x102212[_0x5dbf('0x21')]=qs[_0x5dbf('0x21')](_0x1fc946[_0x5dbf('0x3b')][_0x5dbf('0x21')]);}_0x102212['order']=qs[_0x5dbf('0x44')](_0x1fc946['query'][_0x5dbf('0x44')]);_0x102212[_0x5dbf('0x45')]=qs[_0x5dbf('0x3d')](_[_0x5dbf('0x46')](_0x1fc946[_0x5dbf('0x3b')],_0x1986a2[_0x5dbf('0x3d')]));_0x102212['where'][_0x5dbf('0x5a')]=_0x14b2af['id'];if(_0x1fc946['query'][_0x5dbf('0x47')]){_0x102212[_0x5dbf('0x45')]=_[_0x5dbf('0x48')](_0x102212['where'],{'$or':_[_0x5dbf('0x39')](_0x102212['attributes'],function(_0x576a22){var _0x61fd15={};_0x61fd15[_0x576a22]={'$like':'%'+_0x1fc946[_0x5dbf('0x3b')]['filter']+'%'};return _0x61fd15;})});}_0x102212=_['merge']({},_0x102212,_0x1fc946[_0x5dbf('0x49')]);return db[_0x5dbf('0x5b')][_0x5dbf('0x24')]({'where':_0x102212[_0x5dbf('0x45')]})[_0x5dbf('0x2b')](function(_0x266d3f){_0x5b155a['count']=_0x266d3f;if(_0x1fc946[_0x5dbf('0x3b')][_0x5dbf('0x4a')]){_0x102212[_0x5dbf('0x4b')]=[{'all':!![]}];}return db[_0x5dbf('0x5b')][_0x5dbf('0x4c')](_0x102212);})[_0x5dbf('0x2b')](function(_0x13c5b4){_0x5b155a[_0x5dbf('0x5e')]=_0x13c5b4;return _0x5b155a;});}})[_0x5dbf('0x2b')](respondWithFilteredResult(_0x2d5175,_0x102212))[_0x5dbf('0x4d')](handleError(_0x2d5175,null));};exports[_0x5dbf('0x5f')]=function(_0x2a3192,_0x11c6c6,_0x110b26){return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x2a3192[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x11c6c6,null))[_0x5dbf('0x2b')](function(_0x59b35c){if(_0x59b35c){return _0x59b35c[_0x5dbf('0x5f')](_0x2a3192[_0x5dbf('0x3b')]['ids']);}})['then'](respondWithStatusCode(_0x11c6c6,null))[_0x5dbf('0x4d')](handleError(_0x11c6c6,null));};exports[_0x5dbf('0x60')]=function(_0x4a6f50,_0x2578ba,_0x382cc1){return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x4a6f50[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x2578ba,null))['then'](function(_0x5d9fc2){if(_0x5d9fc2){var _0xb2fdad=[];var _0x5961ab={'success':[],'errors':[]};return db[_0x5dbf('0x61')][_0x5dbf('0x58')]()[_0x5dbf('0x2b')](function(_0x103f63){if(_0x4a6f50[_0x5dbf('0x51')]['tags']&&_[_0x5dbf('0x62')](_0x4a6f50[_0x5dbf('0x51')][_0x5dbf('0x63')])){if(_0x4a6f50[_0x5dbf('0x51')][_0x5dbf('0x63')][_0x5dbf('0x41')]){_0x4a6f50[_0x5dbf('0x51')][_0x5dbf('0x63')]=_0x4a6f50[_0x5dbf('0x51')]['tags']['join'](';')+';';}else{_0x4a6f50['body']['tags']=null;}}else{_0x4a6f50['body'][_0x5dbf('0x63')]=null;}if(_0x4a6f50[_0x5dbf('0x51')]&&_['isArray'](_0x4a6f50['body'])){for(var _0x2d4237=0x0;_0x2d4237<_0x4a6f50[_0x5dbf('0x51')]['length'];_0x2d4237+=0x1){_0x4a6f50[_0x5dbf('0x51')][_0x2d4237]['ListId']=_0x4a6f50[_0x5dbf('0x4e')]['id'];_0xb2fdad[_0x5dbf('0x64')](_0x4a6f50[_0x5dbf('0x51')][_0x2d4237]);}return BPromise['each'](_0xb2fdad,function(_0x19b0d9){return db[_0x5dbf('0x61')][_0x5dbf('0x50')](_['omit'](_0x19b0d9,['ids','id'])||{},{'fields':_[_0x5dbf('0x3c')](_0x103f63),'raw':!![]})[_0x5dbf('0x2b')](function(_0x12867e){_0x5961ab[_0x5dbf('0x65')][_0x5dbf('0x64')](_0x12867e['dataValues']);})[_0x5dbf('0x4d')](function(_0xfd901b){_0x5961ab['errors'][_0x5dbf('0x64')]({'data':_0x19b0d9,'error':_0xfd901b[_0x5dbf('0x66')]});});})['then'](function(_0x2b6219){return _0x5961ab;})[_0x5dbf('0x4d')](function(_0x413f00){return _0x413f00;});}else{_0x2578ba['status'](0x190)['json']({'message':_0x5dbf('0x67')});}});}})[_0x5dbf('0x2b')](respondWithResult(_0x2578ba,null))['catch'](handleError(_0x2578ba,null));};exports[_0x5dbf('0x68')]=function(_0x3ad95a,_0x1d6c34,_0x3a1944){var _0x3cc036;return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x3ad95a[_0x5dbf('0x4e')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x5dbf('0x69')}]})[_0x5dbf('0x2b')](handleEntityNotFound(_0x1d6c34,null))[_0x5dbf('0x2b')](function(_0x305d72){if(_0x305d72){_0x3cc036=_0x305d72;return db[_0x5dbf('0x61')]['rawAttributes'];}})[_0x5dbf('0x2b')](function(_0x34175f){if(_0x34175f){var _0x6d869f={};var _0x1239fa={};_0x1239fa[_0x5dbf('0x42')]=_[_0x5dbf('0x6a')](_[_0x5dbf('0x3c')](_0x34175f),_[_0x5dbf('0x39')](_0x3cc036[_0x5dbf('0x69')],function(_0x5a4d33){return util[_0x5dbf('0x6b')](_0x5dbf('0x6c'),_0x5a4d33['id']);}));_0x1239fa[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x3ad95a['query']);_0x1239fa[_0x5dbf('0x3d')]=_['intersection'](_0x1239fa[_0x5dbf('0x42')],_0x1239fa[_0x5dbf('0x3b')]);_0x6d869f[_0x5dbf('0x3f')]=_[_0x5dbf('0x3e')](_0x1239fa[_0x5dbf('0x42')],qs['fields'](_0x3ad95a[_0x5dbf('0x3b')][_0x5dbf('0x40')]));_0x6d869f[_0x5dbf('0x3f')]=_0x6d869f[_0x5dbf('0x3f')]['length']?_0x6d869f[_0x5dbf('0x3f')]:_0x1239fa[_0x5dbf('0x42')];if(!_0x3ad95a[_0x5dbf('0x3b')][_0x5dbf('0x6d')](_0x5dbf('0x6e'))){_0x6d869f[_0x5dbf('0x23')]=qs[_0x5dbf('0x23')](_0x3ad95a['query'][_0x5dbf('0x23')]);_0x6d869f[_0x5dbf('0x21')]=qs[_0x5dbf('0x21')](_0x3ad95a[_0x5dbf('0x3b')][_0x5dbf('0x21')]);}_0x6d869f[_0x5dbf('0x43')]=qs[_0x5dbf('0x44')](_0x3ad95a[_0x5dbf('0x3b')]['sort']);_0x6d869f[_0x5dbf('0x45')]=qs[_0x5dbf('0x3d')](_[_0x5dbf('0x46')](_0x3ad95a['query'],_0x1239fa[_0x5dbf('0x3d')]));_0x6d869f[_0x5dbf('0x6f')]=!![];if(_0x3ad95a['query']['filter']){_0x6d869f[_0x5dbf('0x45')]=_[_0x5dbf('0x48')](_0x6d869f['where'],{'$or':_[_0x5dbf('0x39')](_0x6d869f[_0x5dbf('0x3f')],function(_0x1da901){var _0x46e181={};_0x46e181[_0x1da901]={'$like':'%'+_0x3ad95a[_0x5dbf('0x3b')][_0x5dbf('0x47')]+'%'};return _0x46e181;})});}_0x6d869f=_[_0x5dbf('0x48')]({},_0x6d869f,_0x3ad95a[_0x5dbf('0x49')]);return _0x3cc036[_0x5dbf('0x68')](_0x6d869f);}})[_0x5dbf('0x2b')](respondWithResult(_0x1d6c34,null))[_0x5dbf('0x4d')](handleError(_0x1d6c34,null));};exports['getContactsCsv']=function(_0x4f21d9,_0x6aa594,_0x125a7a){var _0x2fcc29;return db[_0x5dbf('0x34')]['find']({'where':{'id':_0x4f21d9[_0x5dbf('0x4e')]['id']},'include':[{'model':db[_0x5dbf('0x70')],'as':_0x5dbf('0x69')}]})['then'](handleEntityNotFound(_0x6aa594,null))[_0x5dbf('0x2b')](function(_0x8795d1){if(_0x8795d1){_0x2fcc29=_0x8795d1;return db[_0x5dbf('0x61')][_0x5dbf('0x35')];}})[_0x5dbf('0x2b')](function(_0x3000e5){if(_0x3000e5){var _0x34ab3a={};var _0x297aef={};_0x297aef[_0x5dbf('0x42')]=_[_0x5dbf('0x6a')](_[_0x5dbf('0x3c')](_0x3000e5),_[_0x5dbf('0x39')](_0x2fcc29[_0x5dbf('0x69')],function(_0xed50cb){return util[_0x5dbf('0x6b')](_0x5dbf('0x6c'),_0xed50cb['id']);}));_0x297aef[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x4f21d9[_0x5dbf('0x3b')]);_0x297aef[_0x5dbf('0x3d')]=_[_0x5dbf('0x3e')](_0x297aef[_0x5dbf('0x42')],_0x297aef[_0x5dbf('0x3b')]);_0x34ab3a[_0x5dbf('0x3f')]=_[_0x5dbf('0x3e')](_0x297aef[_0x5dbf('0x42')],qs[_0x5dbf('0x40')](_0x4f21d9[_0x5dbf('0x3b')][_0x5dbf('0x40')]));_0x34ab3a[_0x5dbf('0x3f')]=_0x34ab3a[_0x5dbf('0x3f')][_0x5dbf('0x41')]?_0x34ab3a['attributes']:_0x297aef['model'];if(!_0x4f21d9[_0x5dbf('0x3b')]['hasOwnProperty'](_0x5dbf('0x6e'))){_0x34ab3a['limit']=qs[_0x5dbf('0x23')](_0x4f21d9[_0x5dbf('0x3b')]['limit']);_0x34ab3a[_0x5dbf('0x21')]=qs[_0x5dbf('0x21')](_0x4f21d9[_0x5dbf('0x3b')][_0x5dbf('0x21')]);}_0x34ab3a[_0x5dbf('0x43')]=qs['sort'](_0x4f21d9[_0x5dbf('0x3b')]['sort']);_0x34ab3a[_0x5dbf('0x45')]=qs[_0x5dbf('0x3d')](_[_0x5dbf('0x46')](_0x4f21d9['query'],_0x297aef[_0x5dbf('0x3d')]));_0x34ab3a[_0x5dbf('0x6f')]=!![];if(_0x4f21d9[_0x5dbf('0x3b')][_0x5dbf('0x47')]){_0x34ab3a[_0x5dbf('0x45')]=_[_0x5dbf('0x48')](_0x34ab3a['where'],{'$or':_[_0x5dbf('0x39')](_0x34ab3a['attributes'],function(_0x586621){var _0x4858ad={};_0x4858ad[_0x586621]={'$like':'%'+_0x4f21d9[_0x5dbf('0x3b')]['filter']+'%'};return _0x4858ad;})});}_0x34ab3a=_['merge']({},_0x34ab3a,_0x4f21d9[_0x5dbf('0x49')]);return _0x2fcc29[_0x5dbf('0x68')](_0x34ab3a);}})[_0x5dbf('0x2b')](function(_0x50d29a){if(!_[_0x5dbf('0x71')](_0x50d29a)){var _0x1d3f46=toCsv(_0x50d29a);var _0xd64489=Date['now']();fs['writeFileSync'](util[_0x5dbf('0x6b')](_0x5dbf('0x72'),_0x2fcc29['id'],_0xd64489),_0x1d3f46);_0x6aa594[_0x5dbf('0x73')](_0x5dbf('0x74'),_0x5dbf('0x75')+util['format'](_0x5dbf('0x76'),_0x2fcc29['id'],_0xd64489));_0x6aa594[_0x5dbf('0x73')](_0x5dbf('0x77'),_0x5dbf('0x78'));return _0x6aa594[_0x5dbf('0x79')](util[_0x5dbf('0x6b')](_0x5dbf('0x72'),_0x2fcc29['id'],_0xd64489));}else{return _0x6aa594[_0x5dbf('0x1d')](0xcc);}})[_0x5dbf('0x4d')](handleError(_0x6aa594,null));};exports['addCustomField']=function(_0x77d69c,_0x4bd85c,_0x59ae09){var _0x13542a;delete _0x77d69c['body']['id'];return db[_0x5dbf('0x34')][_0x5dbf('0x5d')]({'where':{'id':_0x77d69c[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x4bd85c,null))[_0x5dbf('0x2b')](function(_0x8cd643){if(_0x8cd643){return db[_0x5dbf('0x7a')][_0x5dbf('0x7b')](function(_0x3ae002){return db[_0x5dbf('0x70')][_0x5dbf('0x50')](_0x77d69c[_0x5dbf('0x51')],{'transaction':_0x3ae002})['then'](function(_0xea0430){_0x13542a=_0xea0430;return _0x8cd643[_0x5dbf('0x7c')](_0xea0430,{'transaction':_0x3ae002});})['then'](function(){var _0xb826da={'type':db[_0x5dbf('0x7d')][_0x5dbf('0x7e')],'transaction':_0x3ae002};switch(_0x77d69c[_0x5dbf('0x51')][_0x5dbf('0x37')]){case _0x5dbf('0x7f'):_0xb826da[_0x5dbf('0x37')]=db[_0x5dbf('0x7d')]['TEXT'];break;case _0x5dbf('0x80'):_0xb826da[_0x5dbf('0x37')]=db['Sequelize'][_0x5dbf('0x81')];break;case _0x5dbf('0x82'):_0xb826da[_0x5dbf('0x37')]=db[_0x5dbf('0x7d')][_0x5dbf('0x83')];_0xb826da[_0x5dbf('0x84')]=![];break;default:}return db['sequelize']['queryInterface'][_0x5dbf('0x85')](_0x5dbf('0x86'),util[_0x5dbf('0x6b')](_0x5dbf('0x87'),_0x13542a['id']),_0xb826da);})[_0x5dbf('0x2b')](function(){return _0x13542a;});});}})[_0x5dbf('0x2b')](respondWithResult(_0x4bd85c,null))[_0x5dbf('0x4d')](handleError(_0x4bd85c,null));};exports[_0x5dbf('0x88')]=function(_0x3e427e,_0x50ae1c,_0x270ccf){var _0xe3ea2f={};var _0x469228={};var _0x5a17cd;var _0x5c7fdd;return db[_0x5dbf('0x34')][_0x5dbf('0x5d')]({'where':{'id':_0x3e427e['params']['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x50ae1c,null))[_0x5dbf('0x2b')](function(_0xcf084a){if(_0xcf084a){_0x5a17cd=_0xcf084a;_0x469228[_0x5dbf('0x42')]=_[_0x5dbf('0x3c')](db[_0x5dbf('0x70')][_0x5dbf('0x35')]);_0x469228[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x3e427e[_0x5dbf('0x3b')]);_0x469228[_0x5dbf('0x3d')]=_['intersection'](_0x469228[_0x5dbf('0x42')],_0x469228['query']);_0xe3ea2f[_0x5dbf('0x3f')]=_[_0x5dbf('0x3e')](_0x469228[_0x5dbf('0x42')],qs[_0x5dbf('0x40')](_0x3e427e[_0x5dbf('0x3b')]['fields']));_0xe3ea2f[_0x5dbf('0x3f')]=_0xe3ea2f[_0x5dbf('0x3f')][_0x5dbf('0x41')]?_0xe3ea2f['attributes']:_0x469228['model'];_0xe3ea2f['order']=qs[_0x5dbf('0x44')](_0x3e427e[_0x5dbf('0x3b')]['sort']);_0xe3ea2f['where']=qs['filters'](_[_0x5dbf('0x46')](_0x3e427e[_0x5dbf('0x3b')],_0x469228[_0x5dbf('0x3d')]));_0xe3ea2f['where']=_[_0x5dbf('0x48')](_0xe3ea2f[_0x5dbf('0x45')],{'$or':[{'ListId':_0xcf084a['id']},{'ListId':null}]});if(_0x3e427e['query'][_0x5dbf('0x47')]){_0xe3ea2f['where']=_[_0x5dbf('0x48')](_0xe3ea2f[_0x5dbf('0x45')],{'$or':_[_0x5dbf('0x39')](_0xe3ea2f[_0x5dbf('0x3f')],function(_0x2d94b1){var _0x113a71={};_0x113a71[_0x2d94b1]={'$like':'%'+_0x3e427e[_0x5dbf('0x3b')][_0x5dbf('0x47')]+'%'};return _0x113a71;})});}_0xe3ea2f=_[_0x5dbf('0x48')]({},_0xe3ea2f,_0x3e427e['options']);return db[_0x5dbf('0x70')][_0x5dbf('0x89')](_0xe3ea2f);}})[_0x5dbf('0x2b')](respondWithResult(_0x50ae1c,null))[_0x5dbf('0x4d')](handleError(_0x50ae1c,null));};exports[_0x5dbf('0x8a')]=function(_0x28ce44,_0x218717,_0x5d1cfb){return db[_0x5dbf('0x34')][_0x5dbf('0x4f')]({'where':{'id':_0x28ce44[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x218717,null))['then'](function(_0x454596){if(_0x454596){return _0x454596[_0x5dbf('0x8a')](_0x28ce44[_0x5dbf('0x51')]['ids'],_[_0x5dbf('0x8b')](_0x28ce44[_0x5dbf('0x51')],[_0x5dbf('0x8c'),'id'])||{})[_0x5dbf('0x8d')](function(_0x160c94){for(var _0x249e7b=0x0;_0x249e7b<_0x28ce44['body'][_0x5dbf('0x8c')]['length'];_0x249e7b+=0x1){socket[_0x5dbf('0x8e')](_0x5dbf('0x8f'),{'UserId':Number(_0x28ce44[_0x5dbf('0x51')][_0x5dbf('0x8c')][_0x249e7b]),'CmListId':Number(_0x28ce44[_0x5dbf('0x4e')]['id'])});}return _0x160c94;});}})[_0x5dbf('0x2b')](respondWithResult(_0x218717,null))[_0x5dbf('0x4d')](handleError(_0x218717,null));};exports[_0x5dbf('0x90')]=function(_0xe62aee,_0x4507a5,_0x4e5e15){return db[_0x5dbf('0x34')]['find']({'where':{'id':_0xe62aee[_0x5dbf('0x4e')]['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0x4507a5,null))[_0x5dbf('0x2b')](function(_0xb014dc){if(_0xb014dc){return _0xb014dc['removeAgents'](_0xe62aee[_0x5dbf('0x3b')]['ids'])[_0x5dbf('0x2b')](function(){if(_[_0x5dbf('0x62')](_0xe62aee['query']['ids'])){for(var _0x28fb58=0x0;_0x28fb58<_0xe62aee[_0x5dbf('0x3b')][_0x5dbf('0x8c')][_0x5dbf('0x41')];_0x28fb58+=0x1){socket['emit'](_0x5dbf('0x91'),{'UserId':Number(_0xe62aee[_0x5dbf('0x3b')]['ids'][_0x28fb58]),'CmListId':Number(_0xe62aee['params']['id'])});}}else{socket[_0x5dbf('0x8e')](_0x5dbf('0x91'),{'UserId':Number(_0xe62aee[_0x5dbf('0x3b')][_0x5dbf('0x8c')]),'CmListId':Number(_0xe62aee[_0x5dbf('0x4e')]['id'])});}});}})[_0x5dbf('0x2b')](respondWithStatusCode(_0x4507a5,null))['catch'](handleError(_0x4507a5,null));};exports[_0x5dbf('0x92')]=function(_0x5bcddd,_0xcc80ed,_0x1dd07d){var _0x2c9c8e={};var _0xa63687={};var _0x14d4bf;var _0x5eed9e;return db[_0x5dbf('0x34')][_0x5dbf('0x5d')]({'where':{'id':_0x5bcddd['params']['id']}})[_0x5dbf('0x2b')](handleEntityNotFound(_0xcc80ed,null))[_0x5dbf('0x2b')](function(_0x1a08f0){if(_0x1a08f0){_0x14d4bf=_0x1a08f0;_0xa63687[_0x5dbf('0x42')]=_[_0x5dbf('0x3c')](db['User'][_0x5dbf('0x35')]);_0xa63687[_0x5dbf('0x3b')]=_[_0x5dbf('0x3c')](_0x5bcddd[_0x5dbf('0x3b')]);_0xa63687[_0x5dbf('0x3d')]=_[_0x5dbf('0x3e')](_0xa63687[_0x5dbf('0x42')],_0xa63687[_0x5dbf('0x3b')]);_0x2c9c8e[_0x5dbf('0x3f')]=_['intersection'](_0xa63687[_0x5dbf('0x42')],qs[_0x5dbf('0x40')](_0x5bcddd['query'][_0x5dbf('0x40')]));_0x2c9c8e[_0x5dbf('0x3f')]=_0x2c9c8e['attributes'][_0x5dbf('0x41')]?_0x2c9c8e[_0x5dbf('0x3f')]:_0xa63687[_0x5dbf('0x42')];_0x2c9c8e[_0x5dbf('0x43')]=qs[_0x5dbf('0x44')](_0x5bcddd[_0x5dbf('0x3b')][_0x5dbf('0x44')]);_0x2c9c8e[_0x5dbf('0x45')]=qs[_0x5dbf('0x3d')](_[_0x5dbf('0x46')](_0x5bcddd[_0x5dbf('0x3b')],_0xa63687[_0x5dbf('0x3d')]));if(_0x5bcddd[_0x5dbf('0x3b')][_0x5dbf('0x47')]){_0x2c9c8e['where']=_['merge'](_0x2c9c8e['where'],{'$or':_['map'](_0x2c9c8e[_0x5dbf('0x3f')],function(_0x39f6c0){var _0x472beb={};_0x472beb[_0x39f6c0]={'$like':'%'+_0x5bcddd[_0x5dbf('0x3b')][_0x5dbf('0x47')]+'%'};return _0x472beb;})});}_0x2c9c8e=_['merge']({},_0x2c9c8e,_0x5bcddd[_0x5dbf('0x49')]);return _0x14d4bf[_0x5dbf('0x92')](_0x2c9c8e);}})[_0x5dbf('0x2b')](function(_0x2f6f24){if(_0x2f6f24){_0x5eed9e=_0x2f6f24['length'];if(!_0x5bcddd[_0x5dbf('0x3b')][_0x5dbf('0x6d')](_0x5dbf('0x6e'))){_0x2c9c8e[_0x5dbf('0x23')]=qs[_0x5dbf('0x23')](_0x5bcddd['query'][_0x5dbf('0x23')]);_0x2c9c8e[_0x5dbf('0x21')]=qs[_0x5dbf('0x21')](_0x5bcddd[_0x5dbf('0x3b')][_0x5dbf('0x21')]);}return _0x14d4bf[_0x5dbf('0x92')](_0x2c9c8e);}})['then'](function(_0xc1a3e0){if(_0xc1a3e0){return _0xc1a3e0?{'count':_0x5eed9e,'rows':_0xc1a3e0}:null;}})[_0x5dbf('0x2b')](respondWithResult(_0xcc80ed,null))[_0x5dbf('0x4d')](handleError(_0xcc80ed,null));}; \ No newline at end of file +var _0x127c=['register','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','map','CmList','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','pick','ListId','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','rawAttributes','format','cf_%d','raw','CustomFields','concat','setHeader','attachment;\x20filename=','list_%d_%s.csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','TEXT','text','Sequelize','INTEGER','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','./cmList.socket'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x127c,0x6e));var _0xc127=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x127c[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xc127('0x0'));var rimraf=require(_0xc127('0x1'));var zipdir=require(_0xc127('0x2'));var jsonpatch=require(_0xc127('0x3'));var rp=require(_0xc127('0x4'));var moment=require('moment');var BPromise=require(_0xc127('0x5'));var Mustache=require('mustache');var util=require(_0xc127('0x6'));var path=require(_0xc127('0x7'));var sox=require(_0xc127('0x8'));var csv=require(_0xc127('0x9'));var ejs=require(_0xc127('0xa'));var fs=require('fs');var fs_extra=require(_0xc127('0xb'));var _=require(_0xc127('0xc'));var squel=require('squel');var crypto=require(_0xc127('0xd'));var jsforce=require(_0xc127('0xe'));var deskjs=require(_0xc127('0xf'));var toCsv=require(_0xc127('0x9'));var querystring=require('querystring');var Papa=require(_0xc127('0x10'));var Redis=require(_0xc127('0x11'));var authService=require(_0xc127('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc127('0x13'));var logger=require(_0xc127('0x14'))('api');var utils=require(_0xc127('0x15'));var config=require(_0xc127('0x16'));var licenseUtil=require(_0xc127('0x17'));var db=require(_0xc127('0x18'))['db'];config['redis']=_[_0xc127('0x19')](config['redis'],{'host':_0xc127('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc127('0x1b'))[_0xc127('0x1c')](socket);function respondWithStatusCode(_0x2808fa,_0x169c2b){_0x169c2b=_0x169c2b||0xcc;return function(_0x43e451){if(_0x43e451){return _0x2808fa['sendStatus'](_0x169c2b);}return _0x2808fa[_0xc127('0x1d')](_0x169c2b)['end']();};}function respondWithResult(_0x35663a,_0x1e8fbd){_0x1e8fbd=_0x1e8fbd||0xc8;return function(_0x28fce8){if(_0x28fce8){return _0x35663a[_0xc127('0x1d')](_0x1e8fbd)['json'](_0x28fce8);}};}function respondWithFilteredResult(_0xd6a49b,_0x4fbb34){return function(_0x504720){if(_0x504720){var _0x59df4d=typeof _0x4fbb34[_0xc127('0x1e')]===_0xc127('0x1f')&&typeof _0x4fbb34['limit']===_0xc127('0x1f');var _0x2a18e7=_0x504720['count'];var _0x207cec=_0x59df4d?0x0:_0x4fbb34[_0xc127('0x1e')];var _0x38de91=_0x59df4d?_0x504720[_0xc127('0x20')]:_0x4fbb34['offset']+_0x4fbb34[_0xc127('0x21')];var _0x10b1d4;if(_0x38de91>=_0x2a18e7){_0x38de91=_0x2a18e7;_0x10b1d4=0xc8;}else{_0x10b1d4=0xce;}_0xd6a49b[_0xc127('0x1d')](_0x10b1d4);return _0xd6a49b[_0xc127('0x22')](_0xc127('0x23'),_0x207cec+'-'+_0x38de91+'/'+_0x2a18e7)[_0xc127('0x24')](_0x504720);}return null;};}function patchUpdates(_0x505b81){return function(_0x345821){try{jsonpatch[_0xc127('0x25')](_0x345821,_0x505b81,!![]);}catch(_0x2186e9){return BPromise[_0xc127('0x26')](_0x2186e9);}return _0x345821[_0xc127('0x27')]();};}function saveUpdates(_0x17dc02,_0x1dab12){return function(_0x197b9c){if(_0x197b9c){return _0x197b9c['update'](_0x17dc02)[_0xc127('0x28')](function(_0x197793){return _0x197793;});}return null;};}function removeEntity(_0x479698,_0x5ea184){return function(_0x14f4a){if(_0x14f4a){return _0x14f4a[_0xc127('0x29')]()[_0xc127('0x28')](function(){var _0x37f726=_0x14f4a['get']({'plain':!![]});var _0x3e2004='Lists';return db[_0xc127('0x2a')][_0xc127('0x29')]({'where':{'type':_0x3e2004,'resourceId':_0x37f726['id']}})['then'](function(){return _0x14f4a;});})[_0xc127('0x28')](function(){_0x479698['status'](0xcc)[_0xc127('0x2b')]();});}};}function handleEntityNotFound(_0x1ca208,_0x1e1e17){return function(_0xb1c25e){if(!_0xb1c25e){_0x1ca208[_0xc127('0x2c')](0x194);}return _0xb1c25e;};}function handleError(_0x486318,_0x250137){_0x250137=_0x250137||0x1f4;return function(_0x1d13fc){logger[_0xc127('0x2d')](_0x1d13fc[_0xc127('0x2e')]);if(_0x1d13fc['name']){delete _0x1d13fc[_0xc127('0x2f')];}_0x486318[_0xc127('0x1d')](_0x250137)['send'](_0x1d13fc);};}exports[_0xc127('0x30')]=function(_0x1406fc,_0x9862f2){var _0x2bb608={},_0x1dacd9={},_0x33a520={'count':0x0,'rows':[]};var _0x2f4f09=_[_0xc127('0x31')](db[_0xc127('0x32')]['rawAttributes'],function(_0x1eac2e){return{'name':_0x1eac2e[_0xc127('0x33')],'type':_0x1eac2e[_0xc127('0x34')][_0xc127('0x35')]};});_0x1dacd9[_0xc127('0x36')]=_[_0xc127('0x31')](_0x2f4f09,_0xc127('0x2f'));_0x1dacd9['query']=_[_0xc127('0x37')](_0x1406fc['query']);_0x1dacd9[_0xc127('0x38')]=_[_0xc127('0x39')](_0x1dacd9[_0xc127('0x36')],_0x1dacd9[_0xc127('0x3a')]);_0x2bb608['attributes']=_[_0xc127('0x39')](_0x1dacd9[_0xc127('0x36')],qs[_0xc127('0x3b')](_0x1406fc[_0xc127('0x3a')]['fields']));_0x2bb608[_0xc127('0x3c')]=_0x2bb608['attributes'][_0xc127('0x3d')]?_0x2bb608[_0xc127('0x3c')]:_0x1dacd9[_0xc127('0x36')];if(!_0x1406fc['query'][_0xc127('0x3e')](_0xc127('0x3f'))){_0x2bb608['limit']=qs['limit'](_0x1406fc[_0xc127('0x3a')][_0xc127('0x21')]);_0x2bb608[_0xc127('0x1e')]=qs[_0xc127('0x1e')](_0x1406fc[_0xc127('0x3a')]['offset']);}_0x2bb608[_0xc127('0x40')]=qs[_0xc127('0x41')](_0x1406fc[_0xc127('0x3a')][_0xc127('0x41')]);_0x2bb608[_0xc127('0x42')]=qs[_0xc127('0x38')](_['pick'](_0x1406fc[_0xc127('0x3a')],_0x1dacd9['filters']),_0x2f4f09);if(_0x1406fc[_0xc127('0x3a')][_0xc127('0x43')]){_0x2bb608[_0xc127('0x42')]=_[_0xc127('0x44')](_0x2bb608[_0xc127('0x42')],{'$or':_[_0xc127('0x31')](_0x2f4f09,function(_0x4995cc){if(_0x4995cc['type']!==_0xc127('0x45')){var _0x45334a={};_0x45334a[_0x4995cc['name']]={'$like':'%'+_0x1406fc[_0xc127('0x3a')][_0xc127('0x43')]+'%'};return _0x45334a;}})});}_0x2bb608=_['merge']({},_0x2bb608,_0x1406fc[_0xc127('0x46')]);var _0xa5e4bb={'where':_0x2bb608[_0xc127('0x42')]};return db[_0xc127('0x32')][_0xc127('0x20')](_0xa5e4bb)[_0xc127('0x28')](function(_0x4f8e7b){_0x33a520[_0xc127('0x20')]=_0x4f8e7b;if(_0x1406fc[_0xc127('0x3a')][_0xc127('0x47')]){_0x2bb608[_0xc127('0x48')]=[{'all':!![]}];}return db[_0xc127('0x32')]['findAll'](_0x2bb608);})[_0xc127('0x28')](function(_0x21569a){_0x33a520[_0xc127('0x49')]=_0x21569a;return _0x33a520;})['then'](respondWithFilteredResult(_0x9862f2,_0x2bb608))[_0xc127('0x4a')](handleError(_0x9862f2,null));};exports['show']=function(_0x110c48,_0x4ff684){var _0x16fb2f={'raw':![],'where':{'id':_0x110c48[_0xc127('0x4b')]['id']}},_0x5a30ff={};_0x5a30ff['model']=_['keys'](db['CmList']['rawAttributes']);_0x5a30ff['query']=_['keys'](_0x110c48[_0xc127('0x3a')]);_0x5a30ff[_0xc127('0x38')]=_[_0xc127('0x39')](_0x5a30ff['model'],_0x5a30ff[_0xc127('0x3a')]);_0x16fb2f[_0xc127('0x3c')]=_[_0xc127('0x39')](_0x5a30ff['model'],qs[_0xc127('0x3b')](_0x110c48[_0xc127('0x3a')][_0xc127('0x3b')]));_0x16fb2f[_0xc127('0x3c')]=_0x16fb2f[_0xc127('0x3c')][_0xc127('0x3d')]?_0x16fb2f[_0xc127('0x3c')]:_0x5a30ff[_0xc127('0x36')];if(_0x110c48[_0xc127('0x3a')]['includeAll']){_0x16fb2f[_0xc127('0x48')]=[{'all':!![]}];}_0x16fb2f=_[_0xc127('0x44')]({},_0x16fb2f,_0x110c48[_0xc127('0x46')]);return db['CmList'][_0xc127('0x4c')](_0x16fb2f)[_0xc127('0x28')](handleEntityNotFound(_0x4ff684,null))[_0xc127('0x28')](respondWithResult(_0x4ff684,null))[_0xc127('0x4a')](handleError(_0x4ff684,null));};exports[_0xc127('0x4d')]=function(_0x48afd9,_0x1a6116){return db[_0xc127('0x32')][_0xc127('0x4d')](_0x48afd9[_0xc127('0x4e')],{})['then'](function(_0x26061e){var _0x5d0c2b=_0x48afd9[_0xc127('0x4f')][_0xc127('0x50')]({'plain':!![]});if(!_0x5d0c2b)throw new Error(_0xc127('0x51'));if(_0x5d0c2b[_0xc127('0x52')]===_0xc127('0x4f')){var _0x21e108=_0x26061e[_0xc127('0x50')]({'plain':!![]});var _0x42a4b0=_0xc127('0x53');return db[_0xc127('0x54')][_0xc127('0x4c')]({'where':{'name':_0x42a4b0,'userProfileId':_0x5d0c2b['userProfileId']},'raw':!![]})[_0xc127('0x28')](function(_0xd14afe){if(_0xd14afe&&_0xd14afe['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x21e108['name'],'resourceId':_0x21e108['id'],'type':_0xd14afe['name'],'sectionId':_0xd14afe['id']},{})[_0xc127('0x28')](function(){return _0x26061e;});}else{return _0x26061e;}})[_0xc127('0x4a')](function(_0x231805){logger[_0xc127('0x2d')](_0xc127('0x55'),_0x231805);throw _0x231805;});}return _0x26061e;})[_0xc127('0x28')](respondWithResult(_0x1a6116,0xc9))[_0xc127('0x4a')](handleError(_0x1a6116,null));};exports['update']=function(_0x333ef2,_0x1a9c16){if(_0x333ef2[_0xc127('0x4e')]['id']){delete _0x333ef2[_0xc127('0x4e')]['id'];}return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x333ef2['params']['id']}})['then'](handleEntityNotFound(_0x1a9c16,null))[_0xc127('0x28')](saveUpdates(_0x333ef2[_0xc127('0x4e')],null))[_0xc127('0x28')](respondWithResult(_0x1a9c16,null))[_0xc127('0x4a')](handleError(_0x1a9c16,null));};exports[_0xc127('0x29')]=function(_0x32a569,_0x296dd9){return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x32a569[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x296dd9,null))[_0xc127('0x28')](removeEntity(_0x296dd9,null))[_0xc127('0x4a')](handleError(_0x296dd9,null));};exports[_0xc127('0x56')]=function(_0x34e058,_0xc8bba0){return db[_0xc127('0x32')]['describe']()['then'](respondWithResult(_0xc8bba0,null))[_0xc127('0x4a')](handleError(_0xc8bba0,null));};exports['addDisposition']=function(_0x47d9a2,_0x59858a,_0x3a532d){if(_0x47d9a2[_0xc127('0x4e')]['id']){delete _0x47d9a2[_0xc127('0x4e')]['id'];}return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x47d9a2['params']['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x59858a,null))[_0xc127('0x28')](function(_0x134dbe){if(_0x134dbe){_0x47d9a2[_0xc127('0x4e')]['ListId']=_0x134dbe['id'];return db[_0xc127('0x57')][_0xc127('0x4d')](_0x47d9a2[_0xc127('0x4e')]);}})[_0xc127('0x28')](respondWithResult(_0x59858a,null))[_0xc127('0x4a')](handleError(_0x59858a,null));};exports[_0xc127('0x58')]=function(_0x195278,_0x633b66,_0x4ead8d){var _0x293979={'raw':![],'where':{}};var _0x2b560d={};var _0x543dae={'count':0x0,'rows':[]};return db[_0xc127('0x32')][_0xc127('0x59')]({'where':{'id':_0x195278[_0xc127('0x4b')]['id']}})['then'](handleEntityNotFound(_0x633b66,null))[_0xc127('0x28')](function(_0x4bc0b5){if(_0x4bc0b5){_0x2b560d[_0xc127('0x36')]=_[_0xc127('0x37')](db['Disposition']['rawAttributes']);_0x2b560d[_0xc127('0x3a')]=_['keys'](_0x195278[_0xc127('0x3a')]);_0x2b560d[_0xc127('0x38')]=_[_0xc127('0x39')](_0x2b560d[_0xc127('0x36')],_0x2b560d[_0xc127('0x3a')]);_0x293979[_0xc127('0x3c')]=_[_0xc127('0x39')](_0x2b560d[_0xc127('0x36')],qs['fields'](_0x195278[_0xc127('0x3a')][_0xc127('0x3b')]));_0x293979[_0xc127('0x3c')]=_0x293979[_0xc127('0x3c')][_0xc127('0x3d')]?_0x293979['attributes']:_0x2b560d['model'];if(!_0x195278[_0xc127('0x3a')]['hasOwnProperty'](_0xc127('0x3f'))){_0x293979[_0xc127('0x21')]=qs[_0xc127('0x21')](_0x195278[_0xc127('0x3a')][_0xc127('0x21')]);_0x293979['offset']=qs['offset'](_0x195278[_0xc127('0x3a')][_0xc127('0x1e')]);}_0x293979['order']=qs[_0xc127('0x41')](_0x195278[_0xc127('0x3a')]['sort']);_0x293979[_0xc127('0x42')]=qs[_0xc127('0x38')](_[_0xc127('0x5a')](_0x195278[_0xc127('0x3a')],_0x2b560d[_0xc127('0x38')]));_0x293979['where'][_0xc127('0x5b')]=_0x4bc0b5['id'];if(_0x195278[_0xc127('0x3a')]['filter']){_0x293979[_0xc127('0x42')]=_[_0xc127('0x44')](_0x293979['where'],{'$or':_[_0xc127('0x31')](_0x293979[_0xc127('0x3c')],function(_0x50d862){var _0x54fff3={};_0x54fff3[_0x50d862]={'$like':'%'+_0x195278[_0xc127('0x3a')][_0xc127('0x43')]+'%'};return _0x54fff3;})});}_0x293979=_[_0xc127('0x44')]({},_0x293979,_0x195278[_0xc127('0x46')]);return db['Disposition'][_0xc127('0x20')]({'where':_0x293979[_0xc127('0x42')]})[_0xc127('0x28')](function(_0x2cd7d7){_0x543dae['count']=_0x2cd7d7;if(_0x195278['query']['includeAll']){_0x293979[_0xc127('0x48')]=[{'all':!![]}];}return db[_0xc127('0x57')][_0xc127('0x5c')](_0x293979);})[_0xc127('0x28')](function(_0x580443){_0x543dae[_0xc127('0x49')]=_0x580443;return _0x543dae;});}})[_0xc127('0x28')](respondWithFilteredResult(_0x633b66,_0x293979))[_0xc127('0x4a')](handleError(_0x633b66,null));};exports[_0xc127('0x5d')]=function(_0x2f032b,_0x159c96,_0x4d3547){return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x2f032b[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x159c96,null))['then'](function(_0x121878){if(_0x121878){return _0x121878[_0xc127('0x5d')](_0x2f032b[_0xc127('0x3a')][_0xc127('0x5e')]);}})['then'](respondWithStatusCode(_0x159c96,null))[_0xc127('0x4a')](handleError(_0x159c96,null));};exports[_0xc127('0x5f')]=function(_0x2b5103,_0x5cc2d8,_0x5b94be){return db[_0xc127('0x32')]['find']({'where':{'id':_0x2b5103[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x5cc2d8,null))[_0xc127('0x28')](function(_0x39961c){if(_0x39961c){var _0x49885a=[];var _0x5a588a={'success':[],'errors':[]};return db[_0xc127('0x60')][_0xc127('0x56')]()[_0xc127('0x28')](function(_0x92fb1d){if(_0x2b5103[_0xc127('0x4e')][_0xc127('0x61')]&&_[_0xc127('0x62')](_0x2b5103[_0xc127('0x4e')][_0xc127('0x61')])){if(_0x2b5103['body'][_0xc127('0x61')]['length']){_0x2b5103[_0xc127('0x4e')]['tags']=_0x2b5103['body']['tags'][_0xc127('0x63')](';')+';';}else{_0x2b5103[_0xc127('0x4e')][_0xc127('0x61')]=null;}}else{_0x2b5103['body']['tags']=null;}if(_0x2b5103[_0xc127('0x4e')]&&_[_0xc127('0x62')](_0x2b5103['body'])){for(var _0x233a43=0x0;_0x233a43<_0x2b5103[_0xc127('0x4e')][_0xc127('0x3d')];_0x233a43+=0x1){_0x2b5103[_0xc127('0x4e')][_0x233a43][_0xc127('0x5b')]=_0x2b5103['params']['id'];_0x49885a[_0xc127('0x64')](_0x2b5103[_0xc127('0x4e')][_0x233a43]);}return BPromise['each'](_0x49885a,function(_0x2903e1){return db['CmContact']['create'](_[_0xc127('0x65')](_0x2903e1,[_0xc127('0x5e'),'id'])||{},{'fields':_['keys'](_0x92fb1d),'raw':!![]})[_0xc127('0x28')](function(_0x1484de){_0x5a588a['success']['push'](_0x1484de[_0xc127('0x66')]);})[_0xc127('0x4a')](function(_0x512107){_0x5a588a['errors'][_0xc127('0x64')]({'data':_0x2903e1,'error':_0x512107[_0xc127('0x67')]});});})[_0xc127('0x28')](function(_0x357258){return _0x5a588a;})[_0xc127('0x4a')](function(_0x305a38){return _0x305a38;});}else{_0x5cc2d8['status'](0x190)[_0xc127('0x24')]({'message':_0xc127('0x68')});}});}})[_0xc127('0x28')](respondWithResult(_0x5cc2d8,null))[_0xc127('0x4a')](handleError(_0x5cc2d8,null));};exports[_0xc127('0x69')]=function(_0x34d126,_0x305f9e,_0x29099c){var _0x4ecd91;return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x34d126[_0xc127('0x4b')]['id']},'include':[{'model':db[_0xc127('0x6a')],'as':'CustomFields'}]})[_0xc127('0x28')](handleEntityNotFound(_0x305f9e,null))[_0xc127('0x28')](function(_0x1df7de){if(_0x1df7de){_0x4ecd91=_0x1df7de;return db[_0xc127('0x60')][_0xc127('0x6b')];}})['then'](function(_0x149968){if(_0x149968){var _0x2c14f8={};var _0x3dfd6b={};_0x3dfd6b[_0xc127('0x36')]=_['concat'](_[_0xc127('0x37')](_0x149968),_[_0xc127('0x31')](_0x4ecd91['CustomFields'],function(_0x24ba1a){return util[_0xc127('0x6c')](_0xc127('0x6d'),_0x24ba1a['id']);}));_0x3dfd6b['query']=_[_0xc127('0x37')](_0x34d126[_0xc127('0x3a')]);_0x3dfd6b[_0xc127('0x38')]=_[_0xc127('0x39')](_0x3dfd6b['model'],_0x3dfd6b[_0xc127('0x3a')]);_0x2c14f8[_0xc127('0x3c')]=_[_0xc127('0x39')](_0x3dfd6b['model'],qs[_0xc127('0x3b')](_0x34d126[_0xc127('0x3a')][_0xc127('0x3b')]));_0x2c14f8[_0xc127('0x3c')]=_0x2c14f8[_0xc127('0x3c')][_0xc127('0x3d')]?_0x2c14f8[_0xc127('0x3c')]:_0x3dfd6b['model'];if(!_0x34d126['query'][_0xc127('0x3e')](_0xc127('0x3f'))){_0x2c14f8[_0xc127('0x21')]=qs[_0xc127('0x21')](_0x34d126[_0xc127('0x3a')]['limit']);_0x2c14f8[_0xc127('0x1e')]=qs['offset'](_0x34d126[_0xc127('0x3a')][_0xc127('0x1e')]);}_0x2c14f8[_0xc127('0x40')]=qs[_0xc127('0x41')](_0x34d126[_0xc127('0x3a')][_0xc127('0x41')]);_0x2c14f8[_0xc127('0x42')]=qs[_0xc127('0x38')](_['pick'](_0x34d126[_0xc127('0x3a')],_0x3dfd6b[_0xc127('0x38')]));_0x2c14f8[_0xc127('0x6e')]=!![];if(_0x34d126['query']['filter']){_0x2c14f8[_0xc127('0x42')]=_[_0xc127('0x44')](_0x2c14f8[_0xc127('0x42')],{'$or':_[_0xc127('0x31')](_0x2c14f8[_0xc127('0x3c')],function(_0x558b18){var _0x12a027={};_0x12a027[_0x558b18]={'$like':'%'+_0x34d126[_0xc127('0x3a')][_0xc127('0x43')]+'%'};return _0x12a027;})});}_0x2c14f8=_[_0xc127('0x44')]({},_0x2c14f8,_0x34d126['options']);return _0x4ecd91[_0xc127('0x69')](_0x2c14f8);}})[_0xc127('0x28')](respondWithResult(_0x305f9e,null))['catch'](handleError(_0x305f9e,null));};exports['getContactsCsv']=function(_0x2ba854,_0x3a8e78,_0xa17626){var _0x41a708;return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x2ba854[_0xc127('0x4b')]['id']},'include':[{'model':db[_0xc127('0x6a')],'as':_0xc127('0x6f')}]})[_0xc127('0x28')](handleEntityNotFound(_0x3a8e78,null))[_0xc127('0x28')](function(_0x3732fa){if(_0x3732fa){_0x41a708=_0x3732fa;return db[_0xc127('0x60')][_0xc127('0x6b')];}})[_0xc127('0x28')](function(_0x437189){if(_0x437189){var _0x415ea3={};var _0x52f2e3={};_0x52f2e3[_0xc127('0x36')]=_[_0xc127('0x70')](_[_0xc127('0x37')](_0x437189),_[_0xc127('0x31')](_0x41a708[_0xc127('0x6f')],function(_0x5d19f9){return util[_0xc127('0x6c')](_0xc127('0x6d'),_0x5d19f9['id']);}));_0x52f2e3[_0xc127('0x3a')]=_[_0xc127('0x37')](_0x2ba854[_0xc127('0x3a')]);_0x52f2e3[_0xc127('0x38')]=_[_0xc127('0x39')](_0x52f2e3[_0xc127('0x36')],_0x52f2e3['query']);_0x415ea3[_0xc127('0x3c')]=_[_0xc127('0x39')](_0x52f2e3[_0xc127('0x36')],qs[_0xc127('0x3b')](_0x2ba854[_0xc127('0x3a')][_0xc127('0x3b')]));_0x415ea3['attributes']=_0x415ea3[_0xc127('0x3c')][_0xc127('0x3d')]?_0x415ea3[_0xc127('0x3c')]:_0x52f2e3[_0xc127('0x36')];if(!_0x2ba854[_0xc127('0x3a')][_0xc127('0x3e')](_0xc127('0x3f'))){_0x415ea3['limit']=qs[_0xc127('0x21')](_0x2ba854['query'][_0xc127('0x21')]);_0x415ea3['offset']=qs[_0xc127('0x1e')](_0x2ba854[_0xc127('0x3a')][_0xc127('0x1e')]);}_0x415ea3['order']=qs[_0xc127('0x41')](_0x2ba854[_0xc127('0x3a')]['sort']);_0x415ea3[_0xc127('0x42')]=qs[_0xc127('0x38')](_[_0xc127('0x5a')](_0x2ba854[_0xc127('0x3a')],_0x52f2e3[_0xc127('0x38')]));_0x415ea3['raw']=!![];if(_0x2ba854[_0xc127('0x3a')][_0xc127('0x43')]){_0x415ea3[_0xc127('0x42')]=_[_0xc127('0x44')](_0x415ea3['where'],{'$or':_['map'](_0x415ea3[_0xc127('0x3c')],function(_0x5f2fa){var _0x170983={};_0x170983[_0x5f2fa]={'$like':'%'+_0x2ba854[_0xc127('0x3a')][_0xc127('0x43')]+'%'};return _0x170983;})});}_0x415ea3=_[_0xc127('0x44')]({},_0x415ea3,_0x2ba854[_0xc127('0x46')]);return _0x41a708['getContacts'](_0x415ea3);}})[_0xc127('0x28')](function(_0x3119c2){if(!_['isEmpty'](_0x3119c2)){var _0x5d9f10=toCsv(_0x3119c2);var _0xea98cd=Date['now']();fs['writeFileSync'](util[_0xc127('0x6c')]('/tmp/list_%d_%s.csv',_0x41a708['id'],_0xea98cd),_0x5d9f10);_0x3a8e78[_0xc127('0x71')]('Content-disposition',_0xc127('0x72')+util[_0xc127('0x6c')](_0xc127('0x73'),_0x41a708['id'],_0xea98cd));_0x3a8e78[_0xc127('0x71')]('Content-type','text/csv');return _0x3a8e78[_0xc127('0x74')](util['format'](_0xc127('0x75'),_0x41a708['id'],_0xea98cd));}else{return _0x3a8e78[_0xc127('0x2c')](0xcc);}})['catch'](handleError(_0x3a8e78,null));};exports[_0xc127('0x76')]=function(_0x255f15,_0xfc2d38,_0x5f2350){var _0x3293bc;delete _0x255f15[_0xc127('0x4e')]['id'];return db[_0xc127('0x32')]['findOne']({'where':{'id':_0x255f15[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0xfc2d38,null))[_0xc127('0x28')](function(_0x478096){if(_0x478096){return db['sequelize'][_0xc127('0x77')](function(_0x564616){return db['CmCustomField'][_0xc127('0x4d')](_0x255f15[_0xc127('0x4e')],{'transaction':_0x564616})[_0xc127('0x28')](function(_0x169d88){_0x3293bc=_0x169d88;return _0x478096[_0xc127('0x78')](_0x169d88,{'transaction':_0x564616});})[_0xc127('0x28')](function(){var _0x5c4d8a={'type':db['Sequelize'][_0xc127('0x79')],'transaction':_0x564616};switch(_0x255f15[_0xc127('0x4e')]['type']){case _0xc127('0x7a'):_0x5c4d8a[_0xc127('0x34')]=db[_0xc127('0x7b')]['TEXT'];break;case'number':_0x5c4d8a[_0xc127('0x34')]=db[_0xc127('0x7b')][_0xc127('0x7c')];break;case'switch':_0x5c4d8a[_0xc127('0x34')]=db[_0xc127('0x7b')][_0xc127('0x7d')];_0x5c4d8a[_0xc127('0x7e')]=![];break;default:}return db[_0xc127('0x7f')]['queryInterface'][_0xc127('0x80')](_0xc127('0x81'),util[_0xc127('0x6c')]('cf_%s',_0x3293bc['id']),_0x5c4d8a);})[_0xc127('0x28')](function(){return _0x3293bc;});});}})[_0xc127('0x28')](respondWithResult(_0xfc2d38,null))[_0xc127('0x4a')](handleError(_0xfc2d38,null));};exports['getCustomFields']=function(_0x4a9c52,_0x5a7c1d,_0xa585ce){var _0x1b615c={};var _0x3be972={};var _0x3ad9b6;var _0x43a715;return db[_0xc127('0x32')]['findOne']({'where':{'id':_0x4a9c52[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x5a7c1d,null))['then'](function(_0x36a75c){if(_0x36a75c){_0x3ad9b6=_0x36a75c;_0x3be972[_0xc127('0x36')]=_['keys'](db['CmCustomField'][_0xc127('0x6b')]);_0x3be972['query']=_[_0xc127('0x37')](_0x4a9c52[_0xc127('0x3a')]);_0x3be972['filters']=_['intersection'](_0x3be972[_0xc127('0x36')],_0x3be972[_0xc127('0x3a')]);_0x1b615c[_0xc127('0x3c')]=_[_0xc127('0x39')](_0x3be972[_0xc127('0x36')],qs['fields'](_0x4a9c52[_0xc127('0x3a')][_0xc127('0x3b')]));_0x1b615c[_0xc127('0x3c')]=_0x1b615c[_0xc127('0x3c')]['length']?_0x1b615c[_0xc127('0x3c')]:_0x3be972[_0xc127('0x36')];_0x1b615c[_0xc127('0x40')]=qs['sort'](_0x4a9c52[_0xc127('0x3a')][_0xc127('0x41')]);_0x1b615c[_0xc127('0x42')]=qs[_0xc127('0x38')](_[_0xc127('0x5a')](_0x4a9c52[_0xc127('0x3a')],_0x3be972['filters']));_0x1b615c['where']=_['merge'](_0x1b615c[_0xc127('0x42')],{'$or':[{'ListId':_0x36a75c['id']},{'ListId':null}]});if(_0x4a9c52[_0xc127('0x3a')][_0xc127('0x43')]){_0x1b615c['where']=_[_0xc127('0x44')](_0x1b615c[_0xc127('0x42')],{'$or':_['map'](_0x1b615c[_0xc127('0x3c')],function(_0x2789ba){var _0x1a31f5={};_0x1a31f5[_0x2789ba]={'$like':'%'+_0x4a9c52[_0xc127('0x3a')][_0xc127('0x43')]+'%'};return _0x1a31f5;})});}_0x1b615c=_[_0xc127('0x44')]({},_0x1b615c,_0x4a9c52['options']);return db[_0xc127('0x6a')]['findAndCountAll'](_0x1b615c);}})['then'](respondWithResult(_0x5a7c1d,null))[_0xc127('0x4a')](handleError(_0x5a7c1d,null));};exports[_0xc127('0x82')]=function(_0x444a06,_0x10896c,_0xb8395a){return db[_0xc127('0x32')]['find']({'where':{'id':_0x444a06[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x10896c,null))['then'](function(_0x118fe5){if(_0x118fe5){return _0x118fe5['addAgents'](_0x444a06[_0xc127('0x4e')]['ids'],_[_0xc127('0x65')](_0x444a06[_0xc127('0x4e')],[_0xc127('0x5e'),'id'])||{})[_0xc127('0x83')](function(_0x4296ba){for(var _0x463bba=0x0;_0x463bba<_0x444a06['body'][_0xc127('0x5e')][_0xc127('0x3d')];_0x463bba+=0x1){socket['emit'](_0xc127('0x84'),{'UserId':Number(_0x444a06[_0xc127('0x4e')][_0xc127('0x5e')][_0x463bba]),'CmListId':Number(_0x444a06[_0xc127('0x4b')]['id'])});}return _0x4296ba;});}})['then'](respondWithResult(_0x10896c,null))[_0xc127('0x4a')](handleError(_0x10896c,null));};exports[_0xc127('0x85')]=function(_0x5310d9,_0x4595f6,_0x38e937){return db[_0xc127('0x32')][_0xc127('0x4c')]({'where':{'id':_0x5310d9['params']['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x4595f6,null))['then'](function(_0x53eb89){if(_0x53eb89){return _0x53eb89[_0xc127('0x85')](_0x5310d9[_0xc127('0x3a')][_0xc127('0x5e')])['then'](function(){if(_['isArray'](_0x5310d9[_0xc127('0x3a')][_0xc127('0x5e')])){for(var _0x27d406=0x0;_0x27d406<_0x5310d9[_0xc127('0x3a')][_0xc127('0x5e')][_0xc127('0x3d')];_0x27d406+=0x1){socket[_0xc127('0x86')]('userCmList:remove',{'UserId':Number(_0x5310d9[_0xc127('0x3a')][_0xc127('0x5e')][_0x27d406]),'CmListId':Number(_0x5310d9[_0xc127('0x4b')]['id'])});}}else{socket[_0xc127('0x86')](_0xc127('0x87'),{'UserId':Number(_0x5310d9[_0xc127('0x3a')][_0xc127('0x5e')]),'CmListId':Number(_0x5310d9['params']['id'])});}});}})[_0xc127('0x28')](respondWithStatusCode(_0x4595f6,null))[_0xc127('0x4a')](handleError(_0x4595f6,null));};exports[_0xc127('0x88')]=function(_0x2bd1cd,_0x1304d8,_0x3102bd){var _0x431f61={};var _0x1a8bc5={};var _0x33e859;var _0x1b82f1;return db['CmList'][_0xc127('0x59')]({'where':{'id':_0x2bd1cd[_0xc127('0x4b')]['id']}})[_0xc127('0x28')](handleEntityNotFound(_0x1304d8,null))[_0xc127('0x28')](function(_0x39d417){if(_0x39d417){_0x33e859=_0x39d417;_0x1a8bc5['model']=_[_0xc127('0x37')](db[_0xc127('0x89')][_0xc127('0x6b')]);_0x1a8bc5['query']=_[_0xc127('0x37')](_0x2bd1cd['query']);_0x1a8bc5[_0xc127('0x38')]=_[_0xc127('0x39')](_0x1a8bc5[_0xc127('0x36')],_0x1a8bc5[_0xc127('0x3a')]);_0x431f61['attributes']=_[_0xc127('0x39')](_0x1a8bc5[_0xc127('0x36')],qs[_0xc127('0x3b')](_0x2bd1cd['query'][_0xc127('0x3b')]));_0x431f61[_0xc127('0x3c')]=_0x431f61[_0xc127('0x3c')][_0xc127('0x3d')]?_0x431f61['attributes']:_0x1a8bc5['model'];_0x431f61[_0xc127('0x40')]=qs[_0xc127('0x41')](_0x2bd1cd[_0xc127('0x3a')][_0xc127('0x41')]);_0x431f61[_0xc127('0x42')]=qs[_0xc127('0x38')](_['pick'](_0x2bd1cd[_0xc127('0x3a')],_0x1a8bc5[_0xc127('0x38')]));if(_0x2bd1cd[_0xc127('0x3a')]['filter']){_0x431f61[_0xc127('0x42')]=_[_0xc127('0x44')](_0x431f61[_0xc127('0x42')],{'$or':_[_0xc127('0x31')](_0x431f61['attributes'],function(_0x51c32a){var _0x2f8659={};_0x2f8659[_0x51c32a]={'$like':'%'+_0x2bd1cd[_0xc127('0x3a')][_0xc127('0x43')]+'%'};return _0x2f8659;})});}_0x431f61=_['merge']({},_0x431f61,_0x2bd1cd[_0xc127('0x46')]);return _0x33e859[_0xc127('0x88')](_0x431f61);}})[_0xc127('0x28')](function(_0x3e9ec8){if(_0x3e9ec8){_0x1b82f1=_0x3e9ec8[_0xc127('0x3d')];if(!_0x2bd1cd['query'][_0xc127('0x3e')](_0xc127('0x3f'))){_0x431f61['limit']=qs['limit'](_0x2bd1cd[_0xc127('0x3a')][_0xc127('0x21')]);_0x431f61[_0xc127('0x1e')]=qs[_0xc127('0x1e')](_0x2bd1cd[_0xc127('0x3a')]['offset']);}return _0x33e859[_0xc127('0x88')](_0x431f61);}})[_0xc127('0x28')](function(_0x3d7073){if(_0x3d7073){return _0x3d7073?{'count':_0x1b82f1,'rows':_0x3d7073}:null;}})[_0xc127('0x28')](respondWithResult(_0x1304d8,null))[_0xc127('0x4a')](handleError(_0x1304d8,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 946fbc6..9d6d183 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e74,0x175));var _0x43e7=function(_0x598a5a,_0x5e4de7){_0x598a5a=_0x598a5a-0x0;var _0x1398c1=_0x3e74[_0x598a5a];return _0x1398c1;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x51d71a,_0x596fda){var _0xff01f1=function(_0x30480f){while(--_0x30480f){_0x51d71a['push'](_0x51d71a['shift']());}};_0xff01f1(++_0x596fda);}(_0x7217,0x19e));var _0x7721=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7217[_0x37bd26];return _0xe83dc4;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 25fee7c..fe6b4b7 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 _0x91a7=['bluebird','path','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x91a7,0xe7));var _0x791a=function(_0x56aba7,_0x59ce3b){_0x56aba7=_0x56aba7-0x0;var _0x2d2ebd=_0x91a7[_0x56aba7];return _0x2d2ebd;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird'];(function(_0x564b23,_0x42b003){var _0x128cdb=function(_0x28b278){while(--_0x28b278){_0x564b23['push'](_0x564b23['shift']());}};_0x128cdb(++_0x42b003);}(_0xe706,0xa3));var _0x6e70=function(_0x2dc53c,_0x4a29ce){_0x2dc53c=_0x2dc53c-0x0;var _0x32ea88=_0xe706[_0x2dc53c];return _0x32ea88;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index fe63c32..6208189 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 _0x4811=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','stringify','error','code','message','CmList,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x111692,_0x19f8a9){var _0x11836f=function(_0x2f2714){while(--_0x2f2714){_0x111692['push'](_0x111692['shift']());}};_0x11836f(++_0x19f8a9);}(_0x4811,0x172));var _0x1481=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x4811[_0x868b7c];return _0x21683c;};'use strict';var _=require(_0x1481('0x0'));var util=require('util');var moment=require(_0x1481('0x1'));var BPromise=require(_0x1481('0x2'));var rs=require(_0x1481('0x3'));var fs=require('fs');var Redis=require(_0x1481('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1481('0x5'));var logger=require(_0x1481('0x6'))(_0x1481('0x7'));var config=require(_0x1481('0x8'));var jayson=require(_0x1481('0x9'));var client=jayson[_0x1481('0xa')][_0x1481('0xb')]({'port':0x232a});config[_0x1481('0xc')]=_[_0x1481('0xd')](config[_0x1481('0xc')],{'host':_0x1481('0xe'),'port':0x18eb});var socket=require(_0x1481('0xf'))(new Redis(config[_0x1481('0xc')]));require('./cmList.socket')[_0x1481('0x10')](socket);function respondWithRpcPromise(_0x5e251d,_0x3c8fb4,_0x46add6){return new BPromise(function(_0xadb04d,_0x176595){return client['request'](_0x5e251d,_0x46add6)[_0x1481('0x11')](function(_0x241249){logger['info']('CmList,\x20%s,\x20%s',_0x3c8fb4,_0x1481('0x12'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x3c8fb4,_0x1481('0x12'),JSON[_0x1481('0x13')](_0x241249));if(_0x241249[_0x1481('0x14')]){if(_0x241249['error'][_0x1481('0x15')]===0x1f4){logger[_0x1481('0x14')]('CmList,\x20%s,\x20%s',_0x3c8fb4,_0x241249['error']['message']);return _0x176595(_0x241249['error'][_0x1481('0x16')]);}logger[_0x1481('0x14')](_0x1481('0x17'),_0x3c8fb4,_0x241249[_0x1481('0x14')][_0x1481('0x16')]);return _0xadb04d(_0x241249['error']['message']);}else{logger[_0x1481('0x18')](_0x1481('0x17'),_0x3c8fb4,_0x1481('0x12'));_0xadb04d(_0x241249[_0x1481('0x19')][_0x1481('0x16')]);}})[_0x1481('0x1a')](function(_0x3e5c57){logger[_0x1481('0x14')](_0x1481('0x17'),_0x3c8fb4,_0x3e5c57);_0x176595(_0x3e5c57);});});} \ No newline at end of file +var _0xa634=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent'];(function(_0x5a230d,_0x856502){var _0x350fe2=function(_0x4cbca6){while(--_0x4cbca6){_0x5a230d['push'](_0x5a230d['shift']());}};_0x350fe2(++_0x856502);}(_0xa634,0x88));var _0x4a63=function(_0x3fdbac,_0x151b7c){_0x3fdbac=_0x3fdbac-0x0;var _0x212730=_0xa634[_0x3fdbac];return _0x212730;};'use strict';var _=require(_0x4a63('0x0'));var util=require(_0x4a63('0x1'));var moment=require(_0x4a63('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a63('0x3'));var fs=require('fs');var Redis=require(_0x4a63('0x4'));var db=require(_0x4a63('0x5'))['db'];var utils=require(_0x4a63('0x6'));var logger=require(_0x4a63('0x7'))('rpc');var config=require(_0x4a63('0x8'));var jayson=require(_0x4a63('0x9'));var client=jayson[_0x4a63('0xa')]['http']({'port':0x232a});config[_0x4a63('0xb')]=_[_0x4a63('0xc')](config[_0x4a63('0xb')],{'host':_0x4a63('0xd'),'port':0x18eb});var socket=require(_0x4a63('0xe'))(new Redis(config['redis']));require(_0x4a63('0xf'))['register'](socket);function respondWithRpcPromise(_0x4fa62b,_0xecea4c,_0x195286){return new BPromise(function(_0x82f435,_0x46dad6){return client['request'](_0x4fa62b,_0x195286)[_0x4a63('0x10')](function(_0x48df83){logger[_0x4a63('0x11')](_0x4a63('0x12'),_0xecea4c,_0x4a63('0x13'));logger['debug'](_0x4a63('0x14'),_0xecea4c,_0x4a63('0x13'),JSON[_0x4a63('0x15')](_0x48df83));if(_0x48df83[_0x4a63('0x16')]){if(_0x48df83[_0x4a63('0x16')][_0x4a63('0x17')]===0x1f4){logger[_0x4a63('0x16')]('CmList,\x20%s,\x20%s',_0xecea4c,_0x48df83['error'][_0x4a63('0x18')]);return _0x46dad6(_0x48df83[_0x4a63('0x16')][_0x4a63('0x18')]);}logger[_0x4a63('0x16')](_0x4a63('0x12'),_0xecea4c,_0x48df83[_0x4a63('0x16')]['message']);return _0x82f435(_0x48df83['error'][_0x4a63('0x18')]);}else{logger[_0x4a63('0x11')]('CmList,\x20%s,\x20%s',_0xecea4c,_0x4a63('0x13'));_0x82f435(_0x48df83['result'][_0x4a63('0x18')]);}})[_0x4a63('0x19')](function(_0x5dd442){logger[_0x4a63('0x16')](_0x4a63('0x12'),_0xecea4c,_0x5dd442);_0x46dad6(_0x5dd442);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 41e406d..4740f4f 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 _0x3217=['length','save','update','emit','removeListener'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x3217,0x114));var _0x7321=function(_0x3e338e,_0x2b78a6){_0x3e338e=_0x3e338e-0x0;var _0x2921fc=_0x3217[_0x3e338e];return _0x2921fc;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x7321('0x0'),'remove',_0x7321('0x1')];function createListener(_0xae2d0d,_0x247909){return function(_0x40de48){_0x247909[_0x7321('0x2')](_0xae2d0d,_0x40de48);};}function removeListener(_0x20b015,_0x3ee587){return function(){CmListEvents[_0x7321('0x3')](_0x20b015,_0x3ee587);};}exports['register']=function(_0x14beaa){for(var _0x5c7a72=0x0,_0x39a6d8=events[_0x7321('0x4')];_0x5c7a72<_0x39a6d8;_0x5c7a72++){var _0x5e2ab=events[_0x5c7a72];var _0x102ffc=createListener('cmList:'+_0x5e2ab,_0x14beaa);CmListEvents['on'](_0x5e2ab,_0x102ffc);}}; \ No newline at end of file +var _0x0dac=['length','cmList:','./cmList.events','remove','update','emit','removeListener','register'];(function(_0x1f8f05,_0x52652e){var _0x52d81a=function(_0xef91e2){while(--_0xef91e2){_0x1f8f05['push'](_0x1f8f05['shift']());}};_0x52d81a(++_0x52652e);}(_0x0dac,0xfa));var _0xc0da=function(_0x5a1b3a,_0xa7156f){_0x5a1b3a=_0x5a1b3a-0x0;var _0x4a5298=_0x0dac[_0x5a1b3a];return _0x4a5298;};'use strict';var CmListEvents=require(_0xc0da('0x0'));var events=['save',_0xc0da('0x1'),_0xc0da('0x2')];function createListener(_0x51c5a2,_0x132dd6){return function(_0x227738){_0x132dd6[_0xc0da('0x3')](_0x51c5a2,_0x227738);};}function removeListener(_0x20d374,_0x5b3799){return function(){CmListEvents[_0xc0da('0x4')](_0x20d374,_0x5b3799);};}exports[_0xc0da('0x5')]=function(_0x544c97){for(var _0x25360e=0x0,_0x1e640e=events[_0xc0da('0x6')];_0x25360e<_0x1e640e;_0x25360e++){var _0x1290eb=events[_0x25360e];var _0x43f238=createListener(_0xc0da('0x7')+_0x1290eb,_0x544c97);CmListEvents['on'](_0x1290eb,_0x43f238);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 83397ca..7174726 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 _0x64d0=['/:id/dispositions','/:id/contacts','addCustomField','addAgents','put','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','getDispositions','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create'];(function(_0x3536bf,_0x4cd6e4){var _0x9f1455=function(_0x3c2bbd){while(--_0x3c2bbd){_0x3536bf['push'](_0x3536bf['shift']());}};_0x9f1455(++_0x4cd6e4);}(_0x64d0,0x171));var _0x064d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64d0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x064d('0x0'));var util=require(_0x064d('0x1'));var path=require(_0x064d('0x2'));var timeout=require(_0x064d('0x3'));var express=require(_0x064d('0x4'));var router=express['Router']();var fs_extra=require(_0x064d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x064d('0x6'));var config=require(_0x064d('0x7'));var controller=require('./cmList.controller');router[_0x064d('0x8')]('/',auth[_0x064d('0x9')](),controller[_0x064d('0xa')]);router[_0x064d('0x8')](_0x064d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x064d('0x8')](_0x064d('0xc'),auth[_0x064d('0x9')](),controller['show']);router[_0x064d('0x8')]('/:id/dispositions',auth[_0x064d('0x9')](),controller[_0x064d('0xd')]);router[_0x064d('0x8')]('/:id/contacts',auth[_0x064d('0x9')](),controller['getContacts']);router[_0x064d('0x8')]('/:id/contacts/csv',auth[_0x064d('0x9')](),controller[_0x064d('0xe')]);router[_0x064d('0x8')](_0x064d('0xf'),auth['isAuthenticated'](),controller[_0x064d('0x10')]);router['get'](_0x064d('0x11'),auth['isAuthenticated'](),controller[_0x064d('0x12')]);router[_0x064d('0x13')]('/',auth[_0x064d('0x9')](),controller[_0x064d('0x14')]);router['post'](_0x064d('0x15'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x064d('0x16'),auth[_0x064d('0x9')](),controller['addContacts']);router['post'](_0x064d('0xf'),auth[_0x064d('0x9')](),controller[_0x064d('0x17')]);router[_0x064d('0x13')](_0x064d('0x11'),auth[_0x064d('0x9')](),controller[_0x064d('0x18')]);router[_0x064d('0x19')](_0x064d('0xc'),auth[_0x064d('0x9')](),controller['update']);router[_0x064d('0x1a')](_0x064d('0xc'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x064d('0x15'),auth['isAuthenticated'](),controller[_0x064d('0x1b')]);router[_0x064d('0x1a')](_0x064d('0x11'),auth[_0x064d('0x9')](),controller[_0x064d('0x1c')]);module[_0x064d('0x1d')]=router; \ No newline at end of file +var _0xd3c4=['destroy','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addCustomField','addAgents','put','update','delete'];(function(_0x7791d5,_0xdab65f){var _0x5ce288=function(_0x2b818d){while(--_0x2b818d){_0x7791d5['push'](_0x7791d5['shift']());}};_0x5ce288(++_0xdab65f);}(_0xd3c4,0x87));var _0x4d3c=function(_0x285418,_0x39d933){_0x285418=_0x285418-0x0;var _0x3bcbd4=_0xd3c4[_0x285418];return _0x3bcbd4;};'use strict';var multer=require(_0x4d3c('0x0'));var util=require(_0x4d3c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d3c('0x2'));var router=express[_0x4d3c('0x3')]();var fs_extra=require(_0x4d3c('0x4'));var auth=require(_0x4d3c('0x5'));var interaction=require(_0x4d3c('0x6'));var config=require(_0x4d3c('0x7'));var controller=require(_0x4d3c('0x8'));router[_0x4d3c('0x9')]('/',auth[_0x4d3c('0xa')](),controller['index']);router['get'](_0x4d3c('0xb'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0xc')]);router[_0x4d3c('0x9')](_0x4d3c('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4d3c('0x9')](_0x4d3c('0xe'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0xf')]);router[_0x4d3c('0x9')](_0x4d3c('0x10'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x11')]);router[_0x4d3c('0x9')](_0x4d3c('0x12'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x4d3c('0x9')](_0x4d3c('0x13'),auth['isAuthenticated'](),controller[_0x4d3c('0x14')]);router[_0x4d3c('0x9')](_0x4d3c('0x15'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x16')]);router[_0x4d3c('0x17')]('/',auth['isAuthenticated'](),controller[_0x4d3c('0x18')]);router[_0x4d3c('0x17')]('/:id/dispositions',auth[_0x4d3c('0xa')](),controller['addDisposition']);router[_0x4d3c('0x17')](_0x4d3c('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0x4d3c('0x17')](_0x4d3c('0x13'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x19')]);router[_0x4d3c('0x17')](_0x4d3c('0x15'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x1a')]);router[_0x4d3c('0x1b')](_0x4d3c('0xd'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x1c')]);router[_0x4d3c('0x1d')]('/:id',auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x1e')]);router[_0x4d3c('0x1d')](_0x4d3c('0xe'),auth[_0x4d3c('0xa')](),controller['removeDispositions']);router[_0x4d3c('0x1d')](_0x4d3c('0x15'),auth[_0x4d3c('0xa')](),controller[_0x4d3c('0x1f')]);module[_0x4d3c('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 158bce9..27b4071 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 _0x7059=['VIRTUAL','getDataValue','field','STRING','sequelize','exports'];(function(_0x1c974d,_0x2fcb51){var _0x5b132b=function(_0x3d3be6){while(--_0x3d3be6){_0x1c974d['push'](_0x1c974d['shift']());}};_0x5b132b(++_0x2fcb51);}(_0x7059,0xca));var _0x9705=function(_0x1b512b,_0x33f42b){_0x1b512b=_0x1b512b-0x0;var _0x5882b0=_0x7059[_0x1b512b];return _0x5882b0;};'use strict';var Sequelize=require(_0x9705('0x0'));module[_0x9705('0x1')]={'name':{'type':Sequelize[_0x9705('0x2')],'get':function(_0x43fb22){return this[_0x9705('0x3')](_0x9705('0x4'));}},'field':{'type':Sequelize[_0x9705('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x9705('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x9705('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x2785=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2785,0x17d));var _0x5278=function(_0x56c7c0,_0x463d97){_0x56c7c0=_0x56c7c0-0x0;var _0x666b9a=_0x2785[_0x56c7c0];return _0x666b9a;};'use strict';var Sequelize=require(_0x5278('0x0'));module['exports']={'name':{'type':Sequelize[_0x5278('0x1')],'get':function(_0x1f9c62){return this[_0x5278('0x2')](_0x5278('0x3'));}},'field':{'type':Sequelize[_0x5278('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x5278('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x5278('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c9f0113..14245e5 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(_0x366b8c,_0x5a115d){var _0x56c02b=function(_0xa1c8c4){while(--_0xa1c8c4){_0x366b8c['push'](_0x366b8c['shift']());}};_0x56c02b(++_0x5a115d);}(_0x7a54,0x106));var _0x47a5=function(_0x404dae,_0x54dbb2){_0x404dae=_0x404dae-0x0;var _0x104792=_0x7a54[_0x404dae];return _0x104792;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x2d82dd,_0x24e92c){var _0x17070f=function(_0x1d0237){while(--_0x1d0237){_0x2d82dd['push'](_0x2d82dd['shift']());}};_0x17070f(++_0x24e92c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 994733d..f8c6de7 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 _0xc54d=['moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api'];(function(_0x45b73f,_0x2eeb2c){var _0x57434d=function(_0x107646){while(--_0x107646){_0x45b73f['push'](_0x45b73f['shift']());}};_0x57434d(++_0x2eeb2c);}(_0xc54d,0xbf));var _0xdc54=function(_0x46d7f8,_0x18d521){_0x46d7f8=_0x46d7f8-0x0;var _0x49a690=_0xc54d[_0x46d7f8];return _0x49a690;};'use strict';var _=require(_0xdc54('0x0'));var util=require(_0xdc54('0x1'));var logger=require(_0xdc54('0x2'))(_0xdc54('0x3'));var moment=require(_0xdc54('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc54('0x5'));var fs=require('fs');var path=require(_0xdc54('0x6'));var rimraf=require(_0xdc54('0x7'));var config=require(_0xdc54('0x8'));var attributes=require(_0xdc54('0x9'));module[_0xdc54('0xa')]=function(_0x295adc,_0x1084ba){return _0x295adc[_0xdc54('0xb')]('Condition',attributes,{'tableName':_0xdc54('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadfa=['define','Condition','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xadfa,0xb9));var _0xaadf=function(_0x5dd79d,_0x2e38ef){_0x5dd79d=_0x5dd79d-0x0;var _0x458c9e=_0xadfa[_0x5dd79d];return _0x458c9e;};'use strict';var _=require(_0xaadf('0x0'));var util=require(_0xaadf('0x1'));var logger=require(_0xaadf('0x2'))('api');var moment=require(_0xaadf('0x3'));var BPromise=require(_0xaadf('0x4'));var rp=require(_0xaadf('0x5'));var fs=require('fs');var path=require(_0xaadf('0x6'));var rimraf=require(_0xaadf('0x7'));var config=require(_0xaadf('0x8'));var attributes=require('./condition.attributes');module[_0xaadf('0x9')]=function(_0x11cfbf,_0x579daf){return _0x11cfbf[_0xaadf('0xa')](_0xaadf('0xb'),attributes,{'tableName':_0xaadf('0xc'),'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 5c4683a..766cf58 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 _0x5fc3=['http','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x49baec,_0x2e0691){var _0x21ea21=function(_0x1d0702){while(--_0x1d0702){_0x49baec['push'](_0x49baec['shift']());}};_0x21ea21(++_0x2e0691);}(_0x5fc3,0x1c2));var _0x35fc=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0x5fc3[_0x2f5a22];return _0x326b70;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require(_0x35fc('0x2'));var BPromise=require(_0x35fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x35fc('0x6'));var config=require(_0x35fc('0x7'));var jayson=require(_0x35fc('0x8'));var client=jayson[_0x35fc('0x9')][_0x35fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40aaa2,_0x54c607,_0x4ff8e3){return new BPromise(function(_0x5b3b56,_0x4e92ff){return client[_0x35fc('0xb')](_0x40aaa2,_0x4ff8e3)[_0x35fc('0xc')](function(_0x314943){logger['info'](_0x35fc('0xd'),_0x54c607,_0x35fc('0xe'));logger[_0x35fc('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x54c607,'request\x20sent',JSON['stringify'](_0x314943));if(_0x314943[_0x35fc('0x10')]){if(_0x314943[_0x35fc('0x10')]['code']===0x1f4){logger[_0x35fc('0x10')](_0x35fc('0xd'),_0x54c607,_0x314943['error'][_0x35fc('0x11')]);return _0x4e92ff(_0x314943[_0x35fc('0x10')]['message']);}logger[_0x35fc('0x10')](_0x35fc('0xd'),_0x54c607,_0x314943[_0x35fc('0x10')][_0x35fc('0x11')]);return _0x5b3b56(_0x314943[_0x35fc('0x10')][_0x35fc('0x11')]);}else{logger[_0x35fc('0x12')](_0x35fc('0xd'),_0x54c607,_0x35fc('0xe'));_0x5b3b56(_0x314943[_0x35fc('0x13')]['message']);}})['catch'](function(_0x5340ac){logger[_0x35fc('0x10')](_0x35fc('0xd'),_0x54c607,_0x5340ac);_0x4e92ff(_0x5340ac);});});} \ No newline at end of file +var _0x717d=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bc2a7,_0x2322d8){var _0x108272=function(_0x2721ed){while(--_0x2721ed){_0x4bc2a7['push'](_0x4bc2a7['shift']());}};_0x108272(++_0x2322d8);}(_0x717d,0x1e4));var _0xd717=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x717d[_0x30c649];return _0x3edfb9;};'use strict';var _=require(_0xd717('0x0'));var util=require(_0xd717('0x1'));var moment=require(_0xd717('0x2'));var BPromise=require(_0xd717('0x3'));var rs=require(_0xd717('0x4'));var fs=require('fs');var Redis=require(_0xd717('0x5'));var db=require(_0xd717('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd717('0x7'))(_0xd717('0x8'));var config=require(_0xd717('0x9'));var jayson=require(_0xd717('0xa'));var client=jayson['client'][_0xd717('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19657b,_0x13f7d7,_0x4b1302){return new BPromise(function(_0x14d797,_0x25d46d){return client[_0xd717('0xc')](_0x19657b,_0x4b1302)['then'](function(_0x49cd04){logger[_0xd717('0xd')](_0xd717('0xe'),_0x13f7d7,_0xd717('0xf'));logger[_0xd717('0x10')](_0xd717('0x11'),_0x13f7d7,_0xd717('0xf'),JSON[_0xd717('0x12')](_0x49cd04));if(_0x49cd04[_0xd717('0x13')]){if(_0x49cd04[_0xd717('0x13')][_0xd717('0x14')]===0x1f4){logger[_0xd717('0x13')](_0xd717('0xe'),_0x13f7d7,_0x49cd04[_0xd717('0x13')][_0xd717('0x15')]);return _0x25d46d(_0x49cd04[_0xd717('0x13')][_0xd717('0x15')]);}logger[_0xd717('0x13')](_0xd717('0xe'),_0x13f7d7,_0x49cd04['error'][_0xd717('0x15')]);return _0x14d797(_0x49cd04[_0xd717('0x13')][_0xd717('0x15')]);}else{logger[_0xd717('0xd')]('Condition,\x20%s,\x20%s',_0x13f7d7,_0xd717('0xf'));_0x14d797(_0x49cd04[_0xd717('0x16')][_0xd717('0x15')]);}})[_0xd717('0x17')](function(_0x1f32d3){logger[_0xd717('0x13')](_0xd717('0xe'),_0x13f7d7,_0x1f32d3);_0x25d46d(_0x1f32d3);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d43eb11..3deeea3 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 _0xef4b=['destroy','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','update','delete'];(function(_0x4e2148,_0x382a2c){var _0x323345=function(_0x426339){while(--_0x426339){_0x4e2148['push'](_0x4e2148['shift']());}};_0x323345(++_0x382a2c);}(_0xef4b,0x86));var _0xbef4=function(_0x5062da,_0x4400d2){_0x5062da=_0x5062da-0x0;var _0x46d327=_0xef4b[_0x5062da];return _0x46d327;};'use strict';var multer=require('multer');var util=require(_0xbef4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbef4('0x1'));var auth=require(_0xbef4('0x2'));var interaction=require(_0xbef4('0x3'));var config=require('../../config/environment');var controller=require(_0xbef4('0x4'));router['put'](_0xbef4('0x5'),auth[_0xbef4('0x6')](),controller[_0xbef4('0x7')]);router[_0xbef4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbef4('0x9')]);module[_0xbef4('0xa')]=router; \ No newline at end of file +var _0x81a8=['update','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0x54dad5,_0x16c7c3){var _0x380640=function(_0x6c11a0){while(--_0x6c11a0){_0x54dad5['push'](_0x54dad5['shift']());}};_0x380640(++_0x16c7c3);}(_0x81a8,0xbc));var _0x881a=function(_0x52dd39,_0xdb90a5){_0x52dd39=_0x52dd39-0x0;var _0x1d4076=_0x81a8[_0x52dd39];return _0x1d4076;};'use strict';var multer=require(_0x881a('0x0'));var util=require(_0x881a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x881a('0x2')]();var fs_extra=require(_0x881a('0x3'));var auth=require(_0x881a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x881a('0x5'));var controller=require(_0x881a('0x6'));router[_0x881a('0x7')](_0x881a('0x8'),auth[_0x881a('0x9')](),controller[_0x881a('0xa')]);router['delete']('/:id',auth[_0x881a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9f0bbc0..5202602 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(_0x34a843,_0x38ebb0){var _0x55a829=function(_0x27ac31){while(--_0x27ac31){_0x34a843['push'](_0x34a843['shift']());}};_0x55a829(++_0x38ebb0);}(_0x757a,0xde));var _0xa757=function(_0x2a0104,_0x34c1fa){_0x2a0104=_0x2a0104-0x0;var _0x57dc51=_0x757a[_0x2a0104];return _0x57dc51;};'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 _0x0713=['STRING','name'];(function(_0x1ff275,_0x12b011){var _0x156912=function(_0x47bf8b){while(--_0x47bf8b){_0x1ff275['push'](_0x1ff275['shift']());}};_0x156912(++_0x12b011);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 3f42863..e17345d 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 _0xb7fe=['attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','total','attrSerie3','voice','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','json','undefined','count','offset','status','Content-Range','apply','update','then','destroy','get','CustomDashboards','UserProfileResource','error','name','index','map','Dashboard','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','create','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','attrMetric'];(function(_0x4fe1f5,_0x50bac4){var _0x31fd73=function(_0x4099bb){while(--_0x4099bb){_0x4fe1f5['push'](_0x4fe1f5['shift']());}};_0x31fd73(++_0x50bac4);}(_0xb7fe,0x190));var _0xeb7f=function(_0x5063ad,_0x25eff0){_0x5063ad=_0x5063ad-0x0;var _0x34af95=_0xb7fe[_0x5063ad];return _0x34af95;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb7f('0x0'));var zipdir=require(_0xeb7f('0x1'));var jsonpatch=require(_0xeb7f('0x2'));var rp=require(_0xeb7f('0x3'));var moment=require(_0xeb7f('0x4'));var BPromise=require(_0xeb7f('0x5'));var Mustache=require(_0xeb7f('0x6'));var util=require('util');var path=require(_0xeb7f('0x7'));var sox=require('sox');var csv=require(_0xeb7f('0x8'));var ejs=require(_0xeb7f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb7f('0xa'));var squel=require(_0xeb7f('0xb'));var crypto=require(_0xeb7f('0xc'));var jsforce=require(_0xeb7f('0xd'));var deskjs=require(_0xeb7f('0xe'));var toCsv=require(_0xeb7f('0x8'));var querystring=require(_0xeb7f('0xf'));var Papa=require(_0xeb7f('0x10'));var Redis=require(_0xeb7f('0x11'));var authService=require(_0xeb7f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xeb7f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeb7f('0x14'));var utils=require(_0xeb7f('0x15'));var config=require(_0xeb7f('0x16'));var licenseUtil=require(_0xeb7f('0x17'));var db=require(_0xeb7f('0x18'))['db'];config['redis']=_[_0xeb7f('0x19')](config[_0xeb7f('0x1a')],{'host':_0xeb7f('0x1b'),'port':0x18eb});var socket=require(_0xeb7f('0x1c'))(new Redis(config['redis']));require(_0xeb7f('0x1d'))[_0xeb7f('0x1e')](socket);function respondWithStatusCode(_0x37bf29,_0xd58d5e){_0xd58d5e=_0xd58d5e||0xcc;return function(_0x126f5c){if(_0x126f5c){return _0x37bf29[_0xeb7f('0x1f')](_0xd58d5e);}return _0x37bf29['status'](_0xd58d5e)[_0xeb7f('0x20')]();};}function respondWithResult(_0x58f1ac,_0x1ccf66){_0x1ccf66=_0x1ccf66||0xc8;return function(_0x2e640d){if(_0x2e640d){return _0x58f1ac['status'](_0x1ccf66)[_0xeb7f('0x21')](_0x2e640d);}};}function respondWithFilteredResult(_0x572fee,_0x3bf3fb){return function(_0x1c18af){if(_0x1c18af){var _0x594048=typeof _0x3bf3fb['offset']===_0xeb7f('0x22')&&typeof _0x3bf3fb['limit']===_0xeb7f('0x22');var _0x2a517b=_0x1c18af[_0xeb7f('0x23')];var _0x50aff8=_0x594048?0x0:_0x3bf3fb['offset'];var _0x274f10=_0x594048?_0x1c18af[_0xeb7f('0x23')]:_0x3bf3fb[_0xeb7f('0x24')]+_0x3bf3fb['limit'];var _0x3a06e5;if(_0x274f10>=_0x2a517b){_0x274f10=_0x2a517b;_0x3a06e5=0xc8;}else{_0x3a06e5=0xce;}_0x572fee[_0xeb7f('0x25')](_0x3a06e5);return _0x572fee['set'](_0xeb7f('0x26'),_0x50aff8+'-'+_0x274f10+'/'+_0x2a517b)['json'](_0x1c18af);}return null;};}function patchUpdates(_0x19e3ef){return function(_0x545d58){try{jsonpatch[_0xeb7f('0x27')](_0x545d58,_0x19e3ef,!![]);}catch(_0x3e874a){return BPromise['reject'](_0x3e874a);}return _0x545d58['save']();};}function saveUpdates(_0x215c50,_0x9f4efa){return function(_0x163eee){if(_0x163eee){return _0x163eee[_0xeb7f('0x28')](_0x215c50)[_0xeb7f('0x29')](function(_0x37e3f7){return _0x37e3f7;});}return null;};}function removeEntity(_0x56aa46,_0x2a9080){return function(_0x5b9fba){if(_0x5b9fba){return _0x5b9fba[_0xeb7f('0x2a')]()[_0xeb7f('0x29')](function(){var _0x107b2e=_0x5b9fba[_0xeb7f('0x2b')]({'plain':!![]});var _0x4f70bd=_0xeb7f('0x2c');return db[_0xeb7f('0x2d')]['destroy']({'where':{'type':_0x4f70bd,'resourceId':_0x107b2e['id']}})[_0xeb7f('0x29')](function(){return _0x5b9fba;});})[_0xeb7f('0x29')](function(){_0x56aa46['status'](0xcc)[_0xeb7f('0x20')]();});}};}function handleEntityNotFound(_0x558ada,_0x236a8a){return function(_0x1452a7){if(!_0x1452a7){_0x558ada[_0xeb7f('0x1f')](0x194);}return _0x1452a7;};}function handleError(_0x2131ab,_0x4ab7c3){_0x4ab7c3=_0x4ab7c3||0x1f4;return function(_0x2209d4){logger[_0xeb7f('0x2e')](_0x2209d4['stack']);if(_0x2209d4[_0xeb7f('0x2f')]){delete _0x2209d4[_0xeb7f('0x2f')];}_0x2131ab[_0xeb7f('0x25')](_0x4ab7c3)['send'](_0x2209d4);};}exports[_0xeb7f('0x30')]=function(_0x504fb5,_0x4c6b7b){var _0x30a92d={},_0x49dfe0={},_0x5e2cfc={'count':0x0,'rows':[]};var _0x4ed3ce=_[_0xeb7f('0x31')](db[_0xeb7f('0x32')]['rawAttributes'],function(_0x460fc5){return{'name':_0x460fc5[_0xeb7f('0x33')],'type':_0x460fc5[_0xeb7f('0x34')][_0xeb7f('0x35')]};});_0x49dfe0[_0xeb7f('0x36')]=_[_0xeb7f('0x31')](_0x4ed3ce,_0xeb7f('0x2f'));_0x49dfe0['query']=_[_0xeb7f('0x37')](_0x504fb5[_0xeb7f('0x38')]);_0x49dfe0[_0xeb7f('0x39')]=_[_0xeb7f('0x3a')](_0x49dfe0[_0xeb7f('0x36')],_0x49dfe0[_0xeb7f('0x38')]);_0x30a92d[_0xeb7f('0x3b')]=_[_0xeb7f('0x3a')](_0x49dfe0['model'],qs['fields'](_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x3c')]));_0x30a92d['attributes']=_0x30a92d[_0xeb7f('0x3b')][_0xeb7f('0x3d')]?_0x30a92d['attributes']:_0x49dfe0['model'];if(!_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x3e')]('nolimit')){_0x30a92d['limit']=qs[_0xeb7f('0x3f')](_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x3f')]);_0x30a92d['offset']=qs[_0xeb7f('0x24')](_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x24')]);}_0x30a92d[_0xeb7f('0x40')]=qs[_0xeb7f('0x41')](_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x41')]);_0x30a92d[_0xeb7f('0x42')]=qs[_0xeb7f('0x39')](_[_0xeb7f('0x43')](_0x504fb5[_0xeb7f('0x38')],_0x49dfe0[_0xeb7f('0x39')]),_0x4ed3ce);if(_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x44')]){_0x30a92d['where']=_['merge'](_0x30a92d[_0xeb7f('0x42')],{'$or':_['map'](_0x4ed3ce,function(_0x46d636){if(_0x46d636[_0xeb7f('0x34')]!==_0xeb7f('0x45')){var _0x1c1766={};_0x1c1766[_0x46d636[_0xeb7f('0x2f')]]={'$like':'%'+_0x504fb5[_0xeb7f('0x38')][_0xeb7f('0x44')]+'%'};return _0x1c1766;}})});}_0x30a92d=_[_0xeb7f('0x46')]({},_0x30a92d,_0x504fb5[_0xeb7f('0x47')]);var _0x29ae85={'where':_0x30a92d[_0xeb7f('0x42')]};return db[_0xeb7f('0x32')][_0xeb7f('0x23')](_0x29ae85)[_0xeb7f('0x29')](function(_0x39307f){_0x5e2cfc[_0xeb7f('0x23')]=_0x39307f;if(_0x504fb5[_0xeb7f('0x38')]['includeAll']){_0x30a92d[_0xeb7f('0x48')]=[{'all':!![]}];}return db[_0xeb7f('0x32')][_0xeb7f('0x49')](_0x30a92d);})[_0xeb7f('0x29')](function(_0x194ada){_0x5e2cfc[_0xeb7f('0x4a')]=_0x194ada;return _0x5e2cfc;})[_0xeb7f('0x29')](respondWithFilteredResult(_0x4c6b7b,_0x30a92d))[_0xeb7f('0x4b')](handleError(_0x4c6b7b,null));};exports[_0xeb7f('0x4c')]=function(_0x5d9ff6,_0x9f0a39){var _0x19d5b6={'raw':![],'where':{'id':_0x5d9ff6[_0xeb7f('0x4d')]['id']}},_0x482d00={};_0x482d00['model']=_['keys'](db['Dashboard'][_0xeb7f('0x4e')]);_0x482d00[_0xeb7f('0x38')]=_[_0xeb7f('0x37')](_0x5d9ff6['query']);_0x482d00['filters']=_[_0xeb7f('0x3a')](_0x482d00[_0xeb7f('0x36')],_0x482d00[_0xeb7f('0x38')]);_0x19d5b6[_0xeb7f('0x3b')]=_[_0xeb7f('0x3a')](_0x482d00[_0xeb7f('0x36')],qs['fields'](_0x5d9ff6['query']['fields']));_0x19d5b6['attributes']=_0x19d5b6[_0xeb7f('0x3b')][_0xeb7f('0x3d')]?_0x19d5b6[_0xeb7f('0x3b')]:_0x482d00['model'];if(_0x5d9ff6['query'][_0xeb7f('0x4f')]){_0x19d5b6[_0xeb7f('0x48')]=[{'all':!![]}];}_0x19d5b6=_[_0xeb7f('0x46')]({},_0x19d5b6,_0x5d9ff6[_0xeb7f('0x47')]);return db[_0xeb7f('0x32')]['find'](_0x19d5b6)['then'](handleEntityNotFound(_0x9f0a39,null))[_0xeb7f('0x29')](respondWithResult(_0x9f0a39,null))['catch'](handleError(_0x9f0a39,null));};exports['create']=function(_0x112947,_0x4ae304){return db[_0xeb7f('0x32')]['create'](_0x112947[_0xeb7f('0x50')],{})['then'](function(_0x43e45b){var _0x49322f=_0x112947[_0xeb7f('0x51')]['get']({'plain':!![]});if(!_0x49322f)throw new Error(_0xeb7f('0x52'));if(_0x49322f['role']===_0xeb7f('0x51')){var _0x46baff=_0x43e45b[_0xeb7f('0x2b')]({'plain':!![]});var _0x4bef1d=_0xeb7f('0x2c');return db[_0xeb7f('0x53')][_0xeb7f('0x54')]({'where':{'name':_0x4bef1d,'userProfileId':_0x49322f[_0xeb7f('0x55')]},'raw':!![]})[_0xeb7f('0x29')](function(_0x2dc11a){if(_0x2dc11a&&_0x2dc11a['autoAssociation']===0x0){return db[_0xeb7f('0x2d')]['create']({'name':_0x46baff[_0xeb7f('0x2f')],'resourceId':_0x46baff['id'],'type':_0x2dc11a[_0xeb7f('0x2f')],'sectionId':_0x2dc11a['id']},{})['then'](function(){return _0x43e45b;});}else{return _0x43e45b;}})[_0xeb7f('0x4b')](function(_0x178850){logger[_0xeb7f('0x2e')](_0xeb7f('0x56'),_0x178850);throw _0x178850;});}return _0x43e45b;})['then'](respondWithResult(_0x4ae304,0xc9))['catch'](handleError(_0x4ae304,null));};exports['clone']=function(_0x1ad4a3,_0x2a56b8){var _0x283908={'where':{'id':_0x1ad4a3['params']['id']}},_0x182f63={};_0x182f63[_0xeb7f('0x36')]=_['keys'](db[_0xeb7f('0x32')][_0xeb7f('0x4e')]);_0x283908[_0xeb7f('0x3b')]=_['intersection'](_0x182f63[_0xeb7f('0x36')],qs[_0xeb7f('0x3c')](_0x1ad4a3['query'][_0xeb7f('0x3c')]));_0x283908['attributes']=_0x283908['attributes'][_0xeb7f('0x3d')]?_0x283908[_0xeb7f('0x3b')]:_0x182f63[_0xeb7f('0x36')];if(_0x1ad4a3[_0xeb7f('0x38')][_0xeb7f('0x4f')]){_0x283908[_0xeb7f('0x48')]=[{'all':!![]}];}_0x283908=_[_0xeb7f('0x46')]({},_0x283908,_0x1ad4a3['options']);return db[_0xeb7f('0x32')][_0xeb7f('0x54')](_0x283908)[_0xeb7f('0x29')](handleEntityNotFound(_0x2a56b8,null))[_0xeb7f('0x29')](function(_0x4f4397){if(_0x4f4397){var _0x79b8e7=_0x4f4397[_0xeb7f('0x2b')]({'plain':!![]});_0x79b8e7=qs[_0xeb7f('0x57')](_0x79b8e7,['id','createdAt',_0xeb7f('0x58')]);_0x1ad4a3[_0xeb7f('0x50')]=_[_0xeb7f('0x57')](_0x1ad4a3[_0xeb7f('0x50')],['id',_0xeb7f('0x59'),_0xeb7f('0x58')]);return db['Dashboard'][_0xeb7f('0x5a')](_['merge'](_0x79b8e7,_0x1ad4a3['body']),{'include':_0x1ad4a3['query'][_0xeb7f('0x4f')]?[{'all':!![]}]:undefined})[_0xeb7f('0x29')](function(_0x28ade9){var _0x163bea=_0x1ad4a3[_0xeb7f('0x51')]['get']({'plain':!![]});if(!_0x163bea)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x163bea['role']===_0xeb7f('0x51')){var _0x2ef664=_0x28ade9[_0xeb7f('0x2b')]({'plain':!![]});var _0x548e1e='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x548e1e,'userProfileId':_0x163bea[_0xeb7f('0x55')]},'raw':!![]})['then'](function(_0x5d5060){if(_0x5d5060&&_0x5d5060[_0xeb7f('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x2ef664['name'],'resourceId':_0x2ef664['id'],'type':_0x5d5060[_0xeb7f('0x2f')],'sectionId':_0x5d5060['id']},{})['then'](function(){return _0x28ade9;});}else{return _0x28ade9;}})[_0xeb7f('0x4b')](function(_0x199279){logger[_0xeb7f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x199279);throw _0x199279;});}return _0x28ade9;});}})[_0xeb7f('0x29')](respondWithResult(_0x2a56b8,0xc9))[_0xeb7f('0x4b')](handleError(_0x2a56b8,null));};exports['update']=function(_0x3a97e9,_0x40c7d5){if(_0x3a97e9[_0xeb7f('0x50')]['id']){delete _0x3a97e9['body']['id'];}return db[_0xeb7f('0x32')]['find']({'where':{'id':_0x3a97e9[_0xeb7f('0x4d')]['id']}})[_0xeb7f('0x29')](handleEntityNotFound(_0x40c7d5,null))[_0xeb7f('0x29')](saveUpdates(_0x3a97e9[_0xeb7f('0x50')],null))[_0xeb7f('0x29')](respondWithResult(_0x40c7d5,null))[_0xeb7f('0x4b')](handleError(_0x40c7d5,null));};exports[_0xeb7f('0x2a')]=function(_0x9ac561,_0x55f3dc){return db[_0xeb7f('0x32')]['find']({'where':{'id':_0x9ac561[_0xeb7f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55f3dc,null))[_0xeb7f('0x29')](removeEntity(_0x55f3dc,null))[_0xeb7f('0x4b')](handleError(_0x55f3dc,null));};function widgetAttributes(_0x3ae966){try{switch(_0x3ae966[_0xeb7f('0x34')]){case _0xeb7f('0x5c'):return[{'name':_0xeb7f('0x5d'),'value':_0x3ae966[_0xeb7f('0x5d')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966['attrs'][0x0]?_0x3ae966[_0xeb7f('0x5e')][0x0][_0xeb7f('0x5f')]:undefined)||'https://'}];case _0xeb7f('0x60'):return[{'name':'attrPath','value':_0x3ae966[_0xeb7f('0x61')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x0]?_0x3ae966[_0xeb7f('0x5e')][0x0][_0xeb7f('0x5f')]:undefined)||''}];case _0xeb7f('0x62'):return[{'name':_0xeb7f('0x63'),'value':_0x3ae966[_0xeb7f('0x63')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x0]?_0x3ae966[_0xeb7f('0x5e')][0x0][_0xeb7f('0x5f')]:undefined)||_0xeb7f('0x64')},{'name':'attrTimezone','value':_0x3ae966['attrTimezone']||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x1]?_0x3ae966[_0xeb7f('0x5e')][0x1][_0xeb7f('0x5f')]:undefined)||_0xeb7f('0x65')},{'name':_0xeb7f('0x66'),'value':_0x3ae966[_0xeb7f('0x66')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x2]?_0x3ae966['attrs'][0x2][_0xeb7f('0x5f')]:undefined)||0xc}];case'counter':return[{'name':_0xeb7f('0x67'),'value':_0x3ae966[_0xeb7f('0x67')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966['attrs'][0x0]?_0x3ae966[_0xeb7f('0x5e')][0x0][_0xeb7f('0x5f')]:undefined)||'total'},{'name':_0xeb7f('0x68'),'value':_0x3ae966['attrVoiceQueues']||(_0x3ae966['attrs']&&_0x3ae966['attrs'][0x1]?_0x3ae966['attrs'][0x1][_0xeb7f('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0x3ae966[_0xeb7f('0x66')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966['attrs'][0x2]?_0x3ae966[_0xeb7f('0x5e')][0x2][_0xeb7f('0x5f')]:undefined)||0x14},{'name':'attrChannel','value':_0x3ae966[_0xeb7f('0x69')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x3]?_0x3ae966['attrs'][0x3][_0xeb7f('0x5f')]:undefined)||'voice'},{'name':_0xeb7f('0x6a'),'value':_0x3ae966['attrEmailAccounts']||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x4]?_0x3ae966[_0xeb7f('0x5e')][0x4]['value']:undefined)||''},{'name':_0xeb7f('0x6b'),'value':_0x3ae966[_0xeb7f('0x6b')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x5]?_0x3ae966[_0xeb7f('0x5e')][0x5][_0xeb7f('0x5f')]:undefined)||''},{'name':_0xeb7f('0x6c'),'value':_0x3ae966[_0xeb7f('0x6c')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x6]?_0x3ae966[_0xeb7f('0x5e')][0x6][_0xeb7f('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3ae966[_0xeb7f('0x6d')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x7]?_0x3ae966[_0xeb7f('0x5e')][0x7][_0xeb7f('0x5f')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x3ae966[_0xeb7f('0x6e')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x8]?_0x3ae966['attrs'][0x8][_0xeb7f('0x5f')]:undefined)||''},{'name':_0xeb7f('0x6f'),'value':_0x3ae966[_0xeb7f('0x6f')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966['attrs'][0x9]?_0x3ae966[_0xeb7f('0x5e')][0x9][_0xeb7f('0x5f')]:undefined)||''}];case _0xeb7f('0x70'):case'pie-chart':return[{'name':_0xeb7f('0x71'),'value':_0x3ae966[_0xeb7f('0x71')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x0]?_0x3ae966[_0xeb7f('0x5e')][0x0][_0xeb7f('0x5f')]:undefined)||_0xeb7f('0x72')},{'name':'attrSerie2','value':_0x3ae966['attrSerie2']||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966['attrs'][0x1]?_0x3ae966[_0xeb7f('0x5e')][0x1][_0xeb7f('0x5f')]:undefined)||null},{'name':'attrSerie3','value':_0x3ae966[_0xeb7f('0x73')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966['attrs'][0x2]?_0x3ae966['attrs'][0x2][_0xeb7f('0x5f')]:undefined)||null},{'name':_0xeb7f('0x68'),'value':_0x3ae966[_0xeb7f('0x68')]||(_0x3ae966['attrs']&&_0x3ae966['attrs'][0x3]?_0x3ae966[_0xeb7f('0x5e')][0x3][_0xeb7f('0x5f')]:undefined)||[]},{'name':'attrChannel','value':_0x3ae966[_0xeb7f('0x69')]||(_0x3ae966['attrs']&&_0x3ae966[_0xeb7f('0x5e')][0x4]?_0x3ae966['attrs'][0x4][_0xeb7f('0x5f')]:undefined)||_0xeb7f('0x74')},{'name':_0xeb7f('0x6a'),'value':_0x3ae966['attrEmailAccounts']||(_0x3ae966['attrs']&&_0x3ae966[_0xeb7f('0x5e')][0x5]?_0x3ae966['attrs'][0x5][_0xeb7f('0x5f')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x3ae966[_0xeb7f('0x6b')]||(_0x3ae966['attrs']&&_0x3ae966[_0xeb7f('0x5e')][0x6]?_0x3ae966[_0xeb7f('0x5e')][0x6][_0xeb7f('0x5f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3ae966['attrSmsAccounts']||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x7]?_0x3ae966['attrs'][0x7][_0xeb7f('0x5f')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3ae966['attrOpenchannelAccounts']||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x8]?_0x3ae966[_0xeb7f('0x5e')][0x8]['value']:undefined)||''},{'name':_0xeb7f('0x6e'),'value':_0x3ae966[_0xeb7f('0x6e')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x9]?_0x3ae966[_0xeb7f('0x5e')][0x9][_0xeb7f('0x5f')]:undefined)||''},{'name':_0xeb7f('0x6f'),'value':_0x3ae966[_0xeb7f('0x6f')]||(_0x3ae966['attrs']&&_0x3ae966[_0xeb7f('0x5e')][0xa]?_0x3ae966[_0xeb7f('0x5e')][0xa][_0xeb7f('0x5f')]:undefined)||''}];case'web-report':return[{'name':_0xeb7f('0x75'),'type':_0x3ae966[_0xeb7f('0x76')]||(_0x3ae966['attrs']&&_0x3ae966[_0xeb7f('0x5e')][0x0]?_0x3ae966['attrs'][0x0][_0xeb7f('0x34')]:undefined)||null,'value':_0x3ae966[_0xeb7f('0x75')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x0]?_0x3ae966[_0xeb7f('0x5e')][0x0][_0xeb7f('0x5f')]:undefined)||null},{'name':_0xeb7f('0x77'),'value':_0x3ae966[_0xeb7f('0x77')]||(_0x3ae966[_0xeb7f('0x5e')]&&_0x3ae966[_0xeb7f('0x5e')][0x1]?_0x3ae966[_0xeb7f('0x5e')][0x1][_0xeb7f('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0xb705a9){logger[_0xeb7f('0x2e')](_0xeb7f('0x78'),JSON['stringify'](_0xb705a9));return[];}}exports[_0xeb7f('0x79')]=function(_0x48cbba,_0x109473,_0x55657c){if(_0x48cbba[_0xeb7f('0x50')]['id']){delete _0x48cbba[_0xeb7f('0x50')]['id'];}return db[_0xeb7f('0x32')][_0xeb7f('0x54')]({'where':{'id':_0x48cbba[_0xeb7f('0x4d')]['id']}})[_0xeb7f('0x29')](handleEntityNotFound(_0x109473,null))[_0xeb7f('0x29')](function(_0x36e740){if(_0x36e740){_0x48cbba[_0xeb7f('0x50')][_0xeb7f('0x7a')]=_0x36e740['id'];_0x48cbba[_0xeb7f('0x50')]['attrs']=widgetAttributes(_0x48cbba['body']);return db[_0xeb7f('0x7b')][_0xeb7f('0x5a')](_0x48cbba[_0xeb7f('0x50')]);}})[_0xeb7f('0x29')](respondWithResult(_0x109473,null))[_0xeb7f('0x4b')](handleError(_0x109473,null));};exports['getItems']=function(_0x537e95,_0x286539,_0x1f368e){var _0x350ea8={};var _0x2baadd={};var _0x2ef82f;var _0x4dd667;return db['Dashboard']['findOne']({'where':{'id':_0x537e95[_0xeb7f('0x4d')]['id']}})[_0xeb7f('0x29')](handleEntityNotFound(_0x286539,null))[_0xeb7f('0x29')](function(_0x177945){if(_0x177945){_0x2ef82f=_0x177945;_0x2baadd[_0xeb7f('0x36')]=_[_0xeb7f('0x37')](db[_0xeb7f('0x7b')][_0xeb7f('0x4e')]);_0x2baadd[_0xeb7f('0x38')]=_[_0xeb7f('0x37')](_0x537e95[_0xeb7f('0x38')]);_0x2baadd['filters']=_[_0xeb7f('0x3a')](_0x2baadd[_0xeb7f('0x36')],_0x2baadd['query']);_0x350ea8['attributes']=_['intersection'](_0x2baadd['model'],qs['fields'](_0x537e95[_0xeb7f('0x38')][_0xeb7f('0x3c')]));_0x350ea8['attributes']=_0x350ea8[_0xeb7f('0x3b')]['length']?_0x350ea8[_0xeb7f('0x3b')]:_0x2baadd[_0xeb7f('0x36')];_0x350ea8['order']=qs[_0xeb7f('0x41')](_0x537e95[_0xeb7f('0x38')]['sort']);_0x350ea8[_0xeb7f('0x42')]=qs[_0xeb7f('0x39')](_[_0xeb7f('0x43')](_0x537e95[_0xeb7f('0x38')],_0x2baadd[_0xeb7f('0x39')]));if(_0x537e95[_0xeb7f('0x38')][_0xeb7f('0x44')]){_0x350ea8[_0xeb7f('0x42')]=_[_0xeb7f('0x46')](_0x350ea8['where'],{'$or':_['map'](_0x350ea8[_0xeb7f('0x3b')],function(_0x348013){var _0x3232b2={};_0x3232b2[_0x348013]={'$like':'%'+_0x537e95['query']['filter']+'%'};return _0x3232b2;})});}_0x350ea8=_[_0xeb7f('0x46')]({},_0x350ea8,_0x537e95[_0xeb7f('0x47')]);return _0x2ef82f[_0xeb7f('0x7c')](_0x350ea8);}})[_0xeb7f('0x29')](function(_0x3d0514){if(_0x3d0514){_0x4dd667=_0x3d0514['length'];if(!_0x537e95[_0xeb7f('0x38')]['hasOwnProperty'](_0xeb7f('0x7d'))){_0x350ea8[_0xeb7f('0x3f')]=qs['limit'](_0x537e95[_0xeb7f('0x38')]['limit']);_0x350ea8[_0xeb7f('0x24')]=qs['offset'](_0x537e95[_0xeb7f('0x38')][_0xeb7f('0x24')]);}return _0x2ef82f[_0xeb7f('0x7c')](_0x350ea8);}})[_0xeb7f('0x29')](function(_0x14be6c){if(_0x14be6c){return _0x14be6c?{'count':_0x4dd667,'rows':_0x14be6c}:null;}})[_0xeb7f('0x29')](respondWithResult(_0x286539,null))[_0xeb7f('0x4b')](handleError(_0x286539,null));}; \ No newline at end of file +var _0xe2ec=['create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrWhatsappAccounts','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','getItems','DashboardItem','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','CustomDashboards','UserProfileResource','error','name','send','map','Dashboard','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe2ec,0x1b0));var _0xce2e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe2ec[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xce2e('0x0'));var rimraf=require(_0xce2e('0x1'));var zipdir=require(_0xce2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xce2e('0x3'));var BPromise=require(_0xce2e('0x4'));var Mustache=require(_0xce2e('0x5'));var util=require(_0xce2e('0x6'));var path=require('path');var sox=require(_0xce2e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce2e('0x8'));var _=require(_0xce2e('0x9'));var squel=require('squel');var crypto=require(_0xce2e('0xa'));var jsforce=require(_0xce2e('0xb'));var deskjs=require(_0xce2e('0xc'));var toCsv=require(_0xce2e('0xd'));var querystring=require(_0xce2e('0xe'));var Papa=require(_0xce2e('0xf'));var Redis=require(_0xce2e('0x10'));var authService=require(_0xce2e('0x11'));var qs=require(_0xce2e('0x12'));var as=require(_0xce2e('0x13'));var hardwareService=require(_0xce2e('0x14'));var logger=require(_0xce2e('0x15'))(_0xce2e('0x16'));var utils=require(_0xce2e('0x17'));var config=require(_0xce2e('0x18'));var licenseUtil=require(_0xce2e('0x19'));var db=require(_0xce2e('0x1a'))['db'];config[_0xce2e('0x1b')]=_[_0xce2e('0x1c')](config[_0xce2e('0x1b')],{'host':_0xce2e('0x1d'),'port':0x18eb});var socket=require(_0xce2e('0x1e'))(new Redis(config[_0xce2e('0x1b')]));require('./dashboard.socket')[_0xce2e('0x1f')](socket);function respondWithStatusCode(_0x3bce2f,_0x3c14d1){_0x3c14d1=_0x3c14d1||0xcc;return function(_0x24a6c3){if(_0x24a6c3){return _0x3bce2f[_0xce2e('0x20')](_0x3c14d1);}return _0x3bce2f['status'](_0x3c14d1)[_0xce2e('0x21')]();};}function respondWithResult(_0x3a97f3,_0x4311e0){_0x4311e0=_0x4311e0||0xc8;return function(_0x4d177d){if(_0x4d177d){return _0x3a97f3[_0xce2e('0x22')](_0x4311e0)[_0xce2e('0x23')](_0x4d177d);}};}function respondWithFilteredResult(_0x5df6f5,_0x562cb4){return function(_0x529ca9){if(_0x529ca9){var _0x367a67=typeof _0x562cb4[_0xce2e('0x24')]===_0xce2e('0x25')&&typeof _0x562cb4[_0xce2e('0x26')]===_0xce2e('0x25');var _0x1f0aac=_0x529ca9['count'];var _0x80224=_0x367a67?0x0:_0x562cb4[_0xce2e('0x24')];var _0x304af8=_0x367a67?_0x529ca9[_0xce2e('0x27')]:_0x562cb4[_0xce2e('0x24')]+_0x562cb4[_0xce2e('0x26')];var _0x5b9266;if(_0x304af8>=_0x1f0aac){_0x304af8=_0x1f0aac;_0x5b9266=0xc8;}else{_0x5b9266=0xce;}_0x5df6f5[_0xce2e('0x22')](_0x5b9266);return _0x5df6f5['set'](_0xce2e('0x28'),_0x80224+'-'+_0x304af8+'/'+_0x1f0aac)[_0xce2e('0x23')](_0x529ca9);}return null;};}function patchUpdates(_0x24a640){return function(_0x360278){try{jsonpatch[_0xce2e('0x29')](_0x360278,_0x24a640,!![]);}catch(_0x2415a4){return BPromise['reject'](_0x2415a4);}return _0x360278['save']();};}function saveUpdates(_0x2fd94d,_0x165d66){return function(_0x4248ef){if(_0x4248ef){return _0x4248ef[_0xce2e('0x2a')](_0x2fd94d)[_0xce2e('0x2b')](function(_0x4c95dc){return _0x4c95dc;});}return null;};}function removeEntity(_0x53d72d,_0x4508d6){return function(_0x326b81){if(_0x326b81){return _0x326b81[_0xce2e('0x2c')]()[_0xce2e('0x2b')](function(){var _0x4bb0f3=_0x326b81['get']({'plain':!![]});var _0x2da0f9=_0xce2e('0x2d');return db[_0xce2e('0x2e')][_0xce2e('0x2c')]({'where':{'type':_0x2da0f9,'resourceId':_0x4bb0f3['id']}})['then'](function(){return _0x326b81;});})[_0xce2e('0x2b')](function(){_0x53d72d['status'](0xcc)[_0xce2e('0x21')]();});}};}function handleEntityNotFound(_0x579622,_0x47adca){return function(_0x88b1e7){if(!_0x88b1e7){_0x579622[_0xce2e('0x20')](0x194);}return _0x88b1e7;};}function handleError(_0x3eb986,_0x5afbf0){_0x5afbf0=_0x5afbf0||0x1f4;return function(_0x50ddf5){logger[_0xce2e('0x2f')](_0x50ddf5['stack']);if(_0x50ddf5[_0xce2e('0x30')]){delete _0x50ddf5[_0xce2e('0x30')];}_0x3eb986[_0xce2e('0x22')](_0x5afbf0)[_0xce2e('0x31')](_0x50ddf5);};}exports['index']=function(_0x5f1a60,_0x2d131d){var _0x459a9d={},_0x1f7614={},_0x192a39={'count':0x0,'rows':[]};var _0x49e233=_[_0xce2e('0x32')](db[_0xce2e('0x33')]['rawAttributes'],function(_0x272f42){return{'name':_0x272f42[_0xce2e('0x34')],'type':_0x272f42[_0xce2e('0x35')][_0xce2e('0x36')]};});_0x1f7614[_0xce2e('0x37')]=_[_0xce2e('0x32')](_0x49e233,'name');_0x1f7614[_0xce2e('0x38')]=_['keys'](_0x5f1a60[_0xce2e('0x38')]);_0x1f7614['filters']=_[_0xce2e('0x39')](_0x1f7614[_0xce2e('0x37')],_0x1f7614[_0xce2e('0x38')]);_0x459a9d[_0xce2e('0x3a')]=_[_0xce2e('0x39')](_0x1f7614[_0xce2e('0x37')],qs[_0xce2e('0x3b')](_0x5f1a60[_0xce2e('0x38')][_0xce2e('0x3b')]));_0x459a9d[_0xce2e('0x3a')]=_0x459a9d[_0xce2e('0x3a')][_0xce2e('0x3c')]?_0x459a9d[_0xce2e('0x3a')]:_0x1f7614[_0xce2e('0x37')];if(!_0x5f1a60[_0xce2e('0x38')][_0xce2e('0x3d')](_0xce2e('0x3e'))){_0x459a9d[_0xce2e('0x26')]=qs[_0xce2e('0x26')](_0x5f1a60[_0xce2e('0x38')][_0xce2e('0x26')]);_0x459a9d[_0xce2e('0x24')]=qs[_0xce2e('0x24')](_0x5f1a60[_0xce2e('0x38')]['offset']);}_0x459a9d[_0xce2e('0x3f')]=qs[_0xce2e('0x40')](_0x5f1a60[_0xce2e('0x38')]['sort']);_0x459a9d[_0xce2e('0x41')]=qs['filters'](_[_0xce2e('0x42')](_0x5f1a60[_0xce2e('0x38')],_0x1f7614[_0xce2e('0x43')]),_0x49e233);if(_0x5f1a60[_0xce2e('0x38')]['filter']){_0x459a9d[_0xce2e('0x41')]=_[_0xce2e('0x44')](_0x459a9d[_0xce2e('0x41')],{'$or':_['map'](_0x49e233,function(_0x19613a){if(_0x19613a[_0xce2e('0x35')]!=='VIRTUAL'){var _0x3b266c={};_0x3b266c[_0x19613a['name']]={'$like':'%'+_0x5f1a60[_0xce2e('0x38')][_0xce2e('0x45')]+'%'};return _0x3b266c;}})});}_0x459a9d=_[_0xce2e('0x44')]({},_0x459a9d,_0x5f1a60[_0xce2e('0x46')]);var _0x4bd27a={'where':_0x459a9d['where']};return db[_0xce2e('0x33')][_0xce2e('0x27')](_0x4bd27a)['then'](function(_0xbfa711){_0x192a39[_0xce2e('0x27')]=_0xbfa711;if(_0x5f1a60[_0xce2e('0x38')][_0xce2e('0x47')]){_0x459a9d[_0xce2e('0x48')]=[{'all':!![]}];}return db[_0xce2e('0x33')][_0xce2e('0x49')](_0x459a9d);})[_0xce2e('0x2b')](function(_0x213213){_0x192a39[_0xce2e('0x4a')]=_0x213213;return _0x192a39;})['then'](respondWithFilteredResult(_0x2d131d,_0x459a9d))[_0xce2e('0x4b')](handleError(_0x2d131d,null));};exports[_0xce2e('0x4c')]=function(_0x5690a4,_0x4e594a){var _0x3d5a85={'raw':![],'where':{'id':_0x5690a4[_0xce2e('0x4d')]['id']}},_0x31b039={};_0x31b039[_0xce2e('0x37')]=_[_0xce2e('0x4e')](db[_0xce2e('0x33')]['rawAttributes']);_0x31b039[_0xce2e('0x38')]=_[_0xce2e('0x4e')](_0x5690a4['query']);_0x31b039['filters']=_[_0xce2e('0x39')](_0x31b039[_0xce2e('0x37')],_0x31b039[_0xce2e('0x38')]);_0x3d5a85[_0xce2e('0x3a')]=_[_0xce2e('0x39')](_0x31b039[_0xce2e('0x37')],qs['fields'](_0x5690a4[_0xce2e('0x38')]['fields']));_0x3d5a85[_0xce2e('0x3a')]=_0x3d5a85[_0xce2e('0x3a')][_0xce2e('0x3c')]?_0x3d5a85[_0xce2e('0x3a')]:_0x31b039[_0xce2e('0x37')];if(_0x5690a4['query']['includeAll']){_0x3d5a85['include']=[{'all':!![]}];}_0x3d5a85=_[_0xce2e('0x44')]({},_0x3d5a85,_0x5690a4[_0xce2e('0x46')]);return db[_0xce2e('0x33')][_0xce2e('0x4f')](_0x3d5a85)[_0xce2e('0x2b')](handleEntityNotFound(_0x4e594a,null))['then'](respondWithResult(_0x4e594a,null))['catch'](handleError(_0x4e594a,null));};exports[_0xce2e('0x50')]=function(_0xfd7d51,_0xb2798a){return db[_0xce2e('0x33')]['create'](_0xfd7d51[_0xce2e('0x51')],{})[_0xce2e('0x2b')](function(_0x4eeee8){var _0x4304e5=_0xfd7d51[_0xce2e('0x52')][_0xce2e('0x53')]({'plain':!![]});if(!_0x4304e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4304e5['role']===_0xce2e('0x52')){var _0x58bdb9=_0x4eeee8[_0xce2e('0x53')]({'plain':!![]});var _0x23b58b=_0xce2e('0x2d');return db[_0xce2e('0x54')][_0xce2e('0x4f')]({'where':{'name':_0x23b58b,'userProfileId':_0x4304e5[_0xce2e('0x55')]},'raw':!![]})[_0xce2e('0x2b')](function(_0x5cc1c1){if(_0x5cc1c1&&_0x5cc1c1[_0xce2e('0x56')]===0x0){return db[_0xce2e('0x2e')][_0xce2e('0x50')]({'name':_0x58bdb9[_0xce2e('0x30')],'resourceId':_0x58bdb9['id'],'type':_0x5cc1c1[_0xce2e('0x30')],'sectionId':_0x5cc1c1['id']},{})['then'](function(){return _0x4eeee8;});}else{return _0x4eeee8;}})[_0xce2e('0x4b')](function(_0x279449){logger['error'](_0xce2e('0x57'),_0x279449);throw _0x279449;});}return _0x4eeee8;})[_0xce2e('0x2b')](respondWithResult(_0xb2798a,0xc9))[_0xce2e('0x4b')](handleError(_0xb2798a,null));};exports['clone']=function(_0x2c5b2a,_0x18bae8){var _0x46811f={'where':{'id':_0x2c5b2a[_0xce2e('0x4d')]['id']}},_0x381e23={};_0x381e23['model']=_[_0xce2e('0x4e')](db[_0xce2e('0x33')][_0xce2e('0x58')]);_0x46811f[_0xce2e('0x3a')]=_[_0xce2e('0x39')](_0x381e23[_0xce2e('0x37')],qs[_0xce2e('0x3b')](_0x2c5b2a[_0xce2e('0x38')][_0xce2e('0x3b')]));_0x46811f[_0xce2e('0x3a')]=_0x46811f[_0xce2e('0x3a')][_0xce2e('0x3c')]?_0x46811f[_0xce2e('0x3a')]:_0x381e23[_0xce2e('0x37')];if(_0x2c5b2a['query'][_0xce2e('0x47')]){_0x46811f[_0xce2e('0x48')]=[{'all':!![]}];}_0x46811f=_[_0xce2e('0x44')]({},_0x46811f,_0x2c5b2a[_0xce2e('0x46')]);return db['Dashboard'][_0xce2e('0x4f')](_0x46811f)[_0xce2e('0x2b')](handleEntityNotFound(_0x18bae8,null))[_0xce2e('0x2b')](function(_0x2aaf7d){if(_0x2aaf7d){var _0x20bd42=_0x2aaf7d[_0xce2e('0x53')]({'plain':!![]});_0x20bd42=qs['omit'](_0x20bd42,['id',_0xce2e('0x59'),_0xce2e('0x5a')]);_0x2c5b2a[_0xce2e('0x51')]=_[_0xce2e('0x5b')](_0x2c5b2a[_0xce2e('0x51')],['id',_0xce2e('0x59'),_0xce2e('0x5a')]);return db[_0xce2e('0x33')][_0xce2e('0x50')](_[_0xce2e('0x44')](_0x20bd42,_0x2c5b2a[_0xce2e('0x51')]),{'include':_0x2c5b2a['query'][_0xce2e('0x47')]?[{'all':!![]}]:undefined})[_0xce2e('0x2b')](function(_0x1f03fb){var _0x340f8c=_0x2c5b2a[_0xce2e('0x52')]['get']({'plain':!![]});if(!_0x340f8c)throw new Error(_0xce2e('0x5c'));if(_0x340f8c[_0xce2e('0x5d')]==='user'){var _0x41d4ba=_0x1f03fb[_0xce2e('0x53')]({'plain':!![]});var _0x688f9=_0xce2e('0x2d');return db[_0xce2e('0x54')]['find']({'where':{'name':_0x688f9,'userProfileId':_0x340f8c['userProfileId']},'raw':!![]})['then'](function(_0x4886ef){if(_0x4886ef&&_0x4886ef[_0xce2e('0x56')]===0x0){return db[_0xce2e('0x2e')]['create']({'name':_0x41d4ba[_0xce2e('0x30')],'resourceId':_0x41d4ba['id'],'type':_0x4886ef[_0xce2e('0x30')],'sectionId':_0x4886ef['id']},{})[_0xce2e('0x2b')](function(){return _0x1f03fb;});}else{return _0x1f03fb;}})['catch'](function(_0xfdf35c){logger[_0xce2e('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfdf35c);throw _0xfdf35c;});}return _0x1f03fb;});}})[_0xce2e('0x2b')](respondWithResult(_0x18bae8,0xc9))[_0xce2e('0x4b')](handleError(_0x18bae8,null));};exports[_0xce2e('0x2a')]=function(_0x595343,_0x2fc5e6){if(_0x595343[_0xce2e('0x51')]['id']){delete _0x595343['body']['id'];}return db[_0xce2e('0x33')][_0xce2e('0x4f')]({'where':{'id':_0x595343[_0xce2e('0x4d')]['id']}})[_0xce2e('0x2b')](handleEntityNotFound(_0x2fc5e6,null))[_0xce2e('0x2b')](saveUpdates(_0x595343[_0xce2e('0x51')],null))[_0xce2e('0x2b')](respondWithResult(_0x2fc5e6,null))['catch'](handleError(_0x2fc5e6,null));};exports[_0xce2e('0x2c')]=function(_0x557196,_0x293656){return db['Dashboard']['find']({'where':{'id':_0x557196[_0xce2e('0x4d')]['id']}})[_0xce2e('0x2b')](handleEntityNotFound(_0x293656,null))[_0xce2e('0x2b')](removeEntity(_0x293656,null))[_0xce2e('0x4b')](handleError(_0x293656,null));};function widgetAttributes(_0x2cfa8e){try{switch(_0x2cfa8e[_0xce2e('0x35')]){case'iframe':return[{'name':_0xce2e('0x5e'),'value':_0x2cfa8e[_0xce2e('0x5e')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x0]?_0x2cfa8e[_0xce2e('0x5f')][0x0][_0xce2e('0x60')]:undefined)||'https://'}];case _0xce2e('0x61'):return[{'name':_0xce2e('0x62'),'value':_0x2cfa8e[_0xce2e('0x62')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x0]?_0x2cfa8e[_0xce2e('0x5f')][0x0][_0xce2e('0x60')]:undefined)||''}];case _0xce2e('0x63'):return[{'name':_0xce2e('0x64'),'value':_0x2cfa8e[_0xce2e('0x64')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x0]?_0x2cfa8e[_0xce2e('0x5f')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xce2e('0x65'),'value':_0x2cfa8e['attrTimezone']||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x1]?_0x2cfa8e[_0xce2e('0x5f')][0x1][_0xce2e('0x60')]:undefined)||_0xce2e('0x66')},{'name':_0xce2e('0x67'),'value':_0x2cfa8e[_0xce2e('0x67')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x2]?_0x2cfa8e[_0xce2e('0x5f')][0x2][_0xce2e('0x60')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x2cfa8e[_0xce2e('0x68')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x0]?_0x2cfa8e['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xce2e('0x69'),'value':_0x2cfa8e['attrVoiceQueues']||(_0x2cfa8e['attrs']&&_0x2cfa8e['attrs'][0x1]?_0x2cfa8e['attrs'][0x1]['value']:undefined)||[]},{'name':_0xce2e('0x67'),'value':_0x2cfa8e[_0xce2e('0x67')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x2]?_0x2cfa8e[_0xce2e('0x5f')][0x2]['value']:undefined)||0x14},{'name':_0xce2e('0x6a'),'value':_0x2cfa8e[_0xce2e('0x6a')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x3]?_0x2cfa8e[_0xce2e('0x5f')][0x3][_0xce2e('0x60')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2cfa8e[_0xce2e('0x6b')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x4]?_0x2cfa8e['attrs'][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x2cfa8e[_0xce2e('0x6c')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x5]?_0x2cfa8e[_0xce2e('0x5f')][0x5][_0xce2e('0x60')]:undefined)||''},{'name':_0xce2e('0x6d'),'value':_0x2cfa8e['attrSmsAccounts']||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x6]?_0x2cfa8e[_0xce2e('0x5f')][0x6][_0xce2e('0x60')]:undefined)||''},{'name':_0xce2e('0x6e'),'value':_0x2cfa8e[_0xce2e('0x6e')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x7]?_0x2cfa8e[_0xce2e('0x5f')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2cfa8e['attrWhatsappAccounts']||(_0x2cfa8e['attrs']&&_0x2cfa8e[_0xce2e('0x5f')][0x8]?_0x2cfa8e['attrs'][0x8][_0xce2e('0x60')]:undefined)||''},{'name':_0xce2e('0x6f'),'value':_0x2cfa8e[_0xce2e('0x6f')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x9]?_0x2cfa8e[_0xce2e('0x5f')][0x9]['value']:undefined)||''}];case _0xce2e('0x70'):case _0xce2e('0x71'):return[{'name':'attrSerie1','value':_0x2cfa8e[_0xce2e('0x72')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x0]?_0x2cfa8e[_0xce2e('0x5f')][0x0][_0xce2e('0x60')]:undefined)||'total'},{'name':_0xce2e('0x73'),'value':_0x2cfa8e[_0xce2e('0x73')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x1]?_0x2cfa8e[_0xce2e('0x5f')][0x1][_0xce2e('0x60')]:undefined)||null},{'name':_0xce2e('0x74'),'value':_0x2cfa8e[_0xce2e('0x74')]||(_0x2cfa8e['attrs']&&_0x2cfa8e['attrs'][0x2]?_0x2cfa8e[_0xce2e('0x5f')][0x2][_0xce2e('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2cfa8e['attrVoiceQueues']||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x3]?_0x2cfa8e[_0xce2e('0x5f')][0x3][_0xce2e('0x60')]:undefined)||[]},{'name':_0xce2e('0x6a'),'value':_0x2cfa8e['attrChannel']||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x4]?_0x2cfa8e[_0xce2e('0x5f')][0x4][_0xce2e('0x60')]:undefined)||_0xce2e('0x75')},{'name':_0xce2e('0x6b'),'value':_0x2cfa8e[_0xce2e('0x6b')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x5]?_0x2cfa8e['attrs'][0x5][_0xce2e('0x60')]:undefined)||''},{'name':_0xce2e('0x6c'),'value':_0x2cfa8e[_0xce2e('0x6c')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x6]?_0x2cfa8e[_0xce2e('0x5f')][0x6][_0xce2e('0x60')]:undefined)||''},{'name':_0xce2e('0x6d'),'value':_0x2cfa8e[_0xce2e('0x6d')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x7]?_0x2cfa8e[_0xce2e('0x5f')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2cfa8e[_0xce2e('0x6e')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x8]?_0x2cfa8e[_0xce2e('0x5f')][0x8][_0xce2e('0x60')]:undefined)||''},{'name':_0xce2e('0x76'),'value':_0x2cfa8e[_0xce2e('0x76')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x9]?_0x2cfa8e[_0xce2e('0x5f')][0x9]['value']:undefined)||''},{'name':_0xce2e('0x6f'),'value':_0x2cfa8e[_0xce2e('0x6f')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0xa]?_0x2cfa8e['attrs'][0xa][_0xce2e('0x60')]:undefined)||''}];case'web-report':return[{'name':_0xce2e('0x77'),'type':_0x2cfa8e[_0xce2e('0x78')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x0]?_0x2cfa8e['attrs'][0x0][_0xce2e('0x35')]:undefined)||null,'value':_0x2cfa8e['attrReport']||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e[_0xce2e('0x5f')][0x0]?_0x2cfa8e[_0xce2e('0x5f')][0x0][_0xce2e('0x60')]:undefined)||null},{'name':_0xce2e('0x79'),'value':_0x2cfa8e[_0xce2e('0x79')]||(_0x2cfa8e[_0xce2e('0x5f')]&&_0x2cfa8e['attrs'][0x1]?_0x2cfa8e[_0xce2e('0x5f')][0x1][_0xce2e('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x5989b4){logger[_0xce2e('0x2f')](_0xce2e('0x7a'),JSON[_0xce2e('0x7b')](_0x5989b4));return[];}}exports[_0xce2e('0x7c')]=function(_0xd069a9,_0x595c72,_0x27d1de){if(_0xd069a9[_0xce2e('0x51')]['id']){delete _0xd069a9[_0xce2e('0x51')]['id'];}return db['Dashboard'][_0xce2e('0x4f')]({'where':{'id':_0xd069a9[_0xce2e('0x4d')]['id']}})[_0xce2e('0x2b')](handleEntityNotFound(_0x595c72,null))[_0xce2e('0x2b')](function(_0x201da3){if(_0x201da3){_0xd069a9['body'][_0xce2e('0x7d')]=_0x201da3['id'];_0xd069a9[_0xce2e('0x51')]['attrs']=widgetAttributes(_0xd069a9['body']);return db['DashboardItem']['create'](_0xd069a9[_0xce2e('0x51')]);}})['then'](respondWithResult(_0x595c72,null))[_0xce2e('0x4b')](handleError(_0x595c72,null));};exports[_0xce2e('0x7e')]=function(_0xaf97d0,_0x3d3420,_0x7a68eb){var _0x1a72d7={};var _0x519e78={};var _0x5dbe1e;var _0x343f11;return db[_0xce2e('0x33')]['findOne']({'where':{'id':_0xaf97d0[_0xce2e('0x4d')]['id']}})[_0xce2e('0x2b')](handleEntityNotFound(_0x3d3420,null))[_0xce2e('0x2b')](function(_0x4aa32c){if(_0x4aa32c){_0x5dbe1e=_0x4aa32c;_0x519e78[_0xce2e('0x37')]=_[_0xce2e('0x4e')](db[_0xce2e('0x7f')][_0xce2e('0x58')]);_0x519e78[_0xce2e('0x38')]=_[_0xce2e('0x4e')](_0xaf97d0[_0xce2e('0x38')]);_0x519e78[_0xce2e('0x43')]=_['intersection'](_0x519e78[_0xce2e('0x37')],_0x519e78[_0xce2e('0x38')]);_0x1a72d7[_0xce2e('0x3a')]=_[_0xce2e('0x39')](_0x519e78[_0xce2e('0x37')],qs[_0xce2e('0x3b')](_0xaf97d0[_0xce2e('0x38')][_0xce2e('0x3b')]));_0x1a72d7[_0xce2e('0x3a')]=_0x1a72d7[_0xce2e('0x3a')]['length']?_0x1a72d7[_0xce2e('0x3a')]:_0x519e78[_0xce2e('0x37')];_0x1a72d7['order']=qs[_0xce2e('0x40')](_0xaf97d0[_0xce2e('0x38')]['sort']);_0x1a72d7[_0xce2e('0x41')]=qs[_0xce2e('0x43')](_[_0xce2e('0x42')](_0xaf97d0[_0xce2e('0x38')],_0x519e78['filters']));if(_0xaf97d0['query'][_0xce2e('0x45')]){_0x1a72d7[_0xce2e('0x41')]=_[_0xce2e('0x44')](_0x1a72d7[_0xce2e('0x41')],{'$or':_[_0xce2e('0x32')](_0x1a72d7['attributes'],function(_0x5d7e34){var _0x242122={};_0x242122[_0x5d7e34]={'$like':'%'+_0xaf97d0['query'][_0xce2e('0x45')]+'%'};return _0x242122;})});}_0x1a72d7=_[_0xce2e('0x44')]({},_0x1a72d7,_0xaf97d0[_0xce2e('0x46')]);return _0x5dbe1e[_0xce2e('0x7e')](_0x1a72d7);}})[_0xce2e('0x2b')](function(_0x48f2c5){if(_0x48f2c5){_0x343f11=_0x48f2c5[_0xce2e('0x3c')];if(!_0xaf97d0['query']['hasOwnProperty'](_0xce2e('0x3e'))){_0x1a72d7[_0xce2e('0x26')]=qs['limit'](_0xaf97d0[_0xce2e('0x38')]['limit']);_0x1a72d7[_0xce2e('0x24')]=qs[_0xce2e('0x24')](_0xaf97d0[_0xce2e('0x38')]['offset']);}return _0x5dbe1e[_0xce2e('0x7e')](_0x1a72d7);}})[_0xce2e('0x2b')](function(_0x291b19){if(_0x291b19){return _0x291b19?{'count':_0x343f11,'rows':_0x291b19}:null;}})[_0xce2e('0x2b')](respondWithResult(_0x3d3420,null))[_0xce2e('0x4b')](handleError(_0x3d3420,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 9fbfa6a..4c1ef10 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 _0xd4b7=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0xbd68b5,_0x5b274b){var _0x3e0cd6=function(_0x158324){while(--_0x158324){_0xbd68b5['push'](_0xbd68b5['shift']());}};_0x3e0cd6(++_0x5b274b);}(_0xd4b7,0x69));var _0x7d4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4b7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7d4b('0x0'));var Dashboard=require(_0x7d4b('0x1'))['db'][_0x7d4b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7d4b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d4b('0x4'),'afterDestroy':_0x7d4b('0x5')};function emitEvent(_0x28f8e1){return function(_0x492167,_0x54c180,_0x53dd2f){DashboardEvents['emit'](_0x28f8e1+':'+_0x492167['id'],_0x492167);DashboardEvents[_0x7d4b('0x6')](_0x28f8e1,_0x492167);_0x53dd2f(null);};}for(var e in events){if(events[_0x7d4b('0x7')](e)){var event=events[e];Dashboard[_0x7d4b('0x8')](e,emitEvent(event));}}module[_0x7d4b('0x9')]=DashboardEvents; \ No newline at end of file +var _0x2563=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x2563,0x75));var _0x3256=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2563[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3256('0x0'));var Dashboard=require(_0x3256('0x1'))['db'][_0x3256('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3256('0x3')](0x0);var events={'afterCreate':_0x3256('0x4'),'afterUpdate':_0x3256('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3be369){return function(_0x36d702,_0x5631d3,_0x348ebf){DashboardEvents[_0x3256('0x6')](_0x3be369+':'+_0x36d702['id'],_0x36d702);DashboardEvents['emit'](_0x3be369,_0x36d702);_0x348ebf(null);};}for(var e in events){if(events[_0x3256('0x7')](e)){var event=events[e];Dashboard[_0x3256('0x8')](e,emitEvent(event));}}module[_0x3256('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 295eeb0..79e45fe 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 _0x20bd=['path','rimraf','../../config/environment','exports','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28773d,_0xb0f157){var _0x4418c3=function(_0x3438c7){while(--_0x3438c7){_0x28773d['push'](_0x28773d['shift']());}};_0x4418c3(++_0xb0f157);}(_0x20bd,0xfe));var _0xd20b=function(_0x32541c,_0x15b357){_0x32541c=_0x32541c-0x0;var _0x1225a7=_0x20bd[_0x32541c];return _0x1225a7;};'use strict';var _=require(_0xd20b('0x0'));var util=require('util');var logger=require(_0xd20b('0x1'))(_0xd20b('0x2'));var moment=require(_0xd20b('0x3'));var BPromise=require(_0xd20b('0x4'));var rp=require(_0xd20b('0x5'));var fs=require('fs');var path=require(_0xd20b('0x6'));var rimraf=require(_0xd20b('0x7'));var config=require(_0xd20b('0x8'));var attributes=require('./dashboard.attributes');module[_0xd20b('0x9')]=function(_0x49f2b3,_0x430735){return _0x49f2b3[_0xd20b('0xa')](_0xd20b('0xb'),attributes,{'tableName':_0xd20b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa937=['./dashboard.attributes','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x14e6bf,_0x1dc09f){var _0x878d3d=function(_0x3bf8ab){while(--_0x3bf8ab){_0x14e6bf['push'](_0x14e6bf['shift']());}};_0x878d3d(++_0x1dc09f);}(_0xa937,0x163));var _0x7a93=function(_0x3be690,_0x4c5fa1){_0x3be690=_0x3be690-0x0;var _0x8facbf=_0xa937[_0x3be690];return _0x8facbf;};'use strict';var _=require(_0x7a93('0x0'));var util=require('util');var logger=require(_0x7a93('0x1'))(_0x7a93('0x2'));var moment=require(_0x7a93('0x3'));var BPromise=require(_0x7a93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a93('0x5'));var rimraf=require(_0x7a93('0x6'));var config=require(_0x7a93('0x7'));var attributes=require(_0x7a93('0x8'));module['exports']=function(_0x3ece45,_0xc772fa){return _0x3ece45['define'](_0x7a93('0x9'),attributes,{'tableName':_0x7a93('0xa'),'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 11a7dc0..1cbf704 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 _0xa629=['defaults','redis','socket.io-emitter','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x36129e,_0x3f80f5){var _0x16bdc9=function(_0x2ea7eb){while(--_0x2ea7eb){_0x36129e['push'](_0x36129e['shift']());}};_0x16bdc9(++_0x3f80f5);}(_0xa629,0x103));var _0x9a62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa629[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a62('0x0'));var util=require(_0x9a62('0x1'));var moment=require(_0x9a62('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a62('0x3'));var db=require(_0x9a62('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a62('0x5'))(_0x9a62('0x6'));var config=require(_0x9a62('0x7'));var jayson=require(_0x9a62('0x8'));var client=jayson[_0x9a62('0x9')][_0x9a62('0xa')]({'port':0x232a});config['redis']=_[_0x9a62('0xb')](config[_0x9a62('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a62('0xd'))(new Redis(config[_0x9a62('0xc')]));require(_0x9a62('0xe'))['register'](socket);function respondWithRpcPromise(_0x4d4ab1,_0x1b50e0,_0xbcd3d){return new BPromise(function(_0x1c0032,_0x3c6014){return client[_0x9a62('0xf')](_0x4d4ab1,_0xbcd3d)[_0x9a62('0x10')](function(_0x1e1cac){logger['info'](_0x9a62('0x11'),_0x1b50e0,_0x9a62('0x12'));logger[_0x9a62('0x13')](_0x9a62('0x14'),_0x1b50e0,_0x9a62('0x12'),JSON[_0x9a62('0x15')](_0x1e1cac));if(_0x1e1cac[_0x9a62('0x16')]){if(_0x1e1cac[_0x9a62('0x16')]['code']===0x1f4){logger[_0x9a62('0x16')]('Dashboard,\x20%s,\x20%s',_0x1b50e0,_0x1e1cac['error'][_0x9a62('0x17')]);return _0x3c6014(_0x1e1cac['error'][_0x9a62('0x17')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x1b50e0,_0x1e1cac[_0x9a62('0x16')][_0x9a62('0x17')]);return _0x1c0032(_0x1e1cac['error'][_0x9a62('0x17')]);}else{logger[_0x9a62('0x18')](_0x9a62('0x11'),_0x1b50e0,_0x9a62('0x12'));_0x1c0032(_0x1e1cac[_0x9a62('0x19')]['message']);}})[_0x9a62('0x1a')](function(_0x27520a){logger[_0x9a62('0x16')](_0x9a62('0x11'),_0x1b50e0,_0x27520a);_0x3c6014(_0x27520a);});});} \ No newline at end of file +var _0x8a79=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request'];(function(_0x3f7293,_0x210490){var _0xe9e329=function(_0x11ce81){while(--_0x11ce81){_0x3f7293['push'](_0x3f7293['shift']());}};_0xe9e329(++_0x210490);}(_0x8a79,0x192));var _0x98a7=function(_0x2c7bcb,_0x50af21){_0x2c7bcb=_0x2c7bcb-0x0;var _0x2571fb=_0x8a79[_0x2c7bcb];return _0x2571fb;};'use strict';var _=require(_0x98a7('0x0'));var util=require(_0x98a7('0x1'));var moment=require('moment');var BPromise=require(_0x98a7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98a7('0x3'));var db=require(_0x98a7('0x4'))['db'];var utils=require(_0x98a7('0x5'));var logger=require(_0x98a7('0x6'))(_0x98a7('0x7'));var config=require(_0x98a7('0x8'));var jayson=require(_0x98a7('0x9'));var client=jayson['client'][_0x98a7('0xa')]({'port':0x232a});config[_0x98a7('0xb')]=_[_0x98a7('0xc')](config[_0x98a7('0xb')],{'host':_0x98a7('0xd'),'port':0x18eb});var socket=require(_0x98a7('0xe'))(new Redis(config['redis']));require(_0x98a7('0xf'))[_0x98a7('0x10')](socket);function respondWithRpcPromise(_0x150261,_0x528c22,_0x84452a){return new BPromise(function(_0xc696a4,_0x273fa0){return client[_0x98a7('0x11')](_0x150261,_0x84452a)[_0x98a7('0x12')](function(_0x298359){logger[_0x98a7('0x13')](_0x98a7('0x14'),_0x528c22,_0x98a7('0x15'));logger[_0x98a7('0x16')](_0x98a7('0x17'),_0x528c22,_0x98a7('0x15'),JSON[_0x98a7('0x18')](_0x298359));if(_0x298359[_0x98a7('0x19')]){if(_0x298359[_0x98a7('0x19')][_0x98a7('0x1a')]===0x1f4){logger[_0x98a7('0x19')](_0x98a7('0x14'),_0x528c22,_0x298359[_0x98a7('0x19')][_0x98a7('0x1b')]);return _0x273fa0(_0x298359[_0x98a7('0x19')][_0x98a7('0x1b')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x528c22,_0x298359['error'][_0x98a7('0x1b')]);return _0xc696a4(_0x298359['error'][_0x98a7('0x1b')]);}else{logger[_0x98a7('0x13')](_0x98a7('0x14'),_0x528c22,_0x98a7('0x15'));_0xc696a4(_0x298359['result']['message']);}})['catch'](function(_0x3cc615){logger[_0x98a7('0x19')](_0x98a7('0x14'),_0x528c22,_0x3cc615);_0x273fa0(_0x3cc615);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1a2865f..daeb9c0 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 _0xc835=['length','./dashboard.events','save','remove','emit','removeListener','register'];(function(_0x1c9882,_0x3161b9){var _0x3d10e4=function(_0x3f0e1b){while(--_0x3f0e1b){_0x1c9882['push'](_0x1c9882['shift']());}};_0x3d10e4(++_0x3161b9);}(_0xc835,0xbe));var _0x5c83=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xc835[_0x4709c0];return _0x13348b;};'use strict';var DashboardEvents=require(_0x5c83('0x0'));var events=[_0x5c83('0x1'),_0x5c83('0x2'),'update'];function createListener(_0x8ddd04,_0x2f02ff){return function(_0x239bd4){_0x2f02ff[_0x5c83('0x3')](_0x8ddd04,_0x239bd4);};}function removeListener(_0x127c77,_0x3cc925){return function(){DashboardEvents[_0x5c83('0x4')](_0x127c77,_0x3cc925);};}exports[_0x5c83('0x5')]=function(_0x342d13){for(var _0x460040=0x0,_0x4af891=events[_0x5c83('0x6')];_0x460040<_0x4af891;_0x460040++){var _0x30cfb8=events[_0x460040];var _0x5ea01d=createListener('dashboard:'+_0x30cfb8,_0x342d13);DashboardEvents['on'](_0x30cfb8,_0x5ea01d);}}; \ No newline at end of file +var _0xc7a1=['length','dashboard:','./dashboard.events','save','remove','removeListener'];(function(_0x8929ac,_0x3cff89){var _0x258e8f=function(_0x4b0044){while(--_0x4b0044){_0x8929ac['push'](_0x8929ac['shift']());}};_0x258e8f(++_0x3cff89);}(_0xc7a1,0x1ac));var _0x1c7a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7a1[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardEvents=require(_0x1c7a('0x0'));var events=[_0x1c7a('0x1'),_0x1c7a('0x2'),'update'];function createListener(_0x4b8d5f,_0x4aa6bf){return function(_0x16a7cf){_0x4aa6bf['emit'](_0x4b8d5f,_0x16a7cf);};}function removeListener(_0x1cdc73,_0x22689d){return function(){DashboardEvents[_0x1c7a('0x3')](_0x1cdc73,_0x22689d);};}exports['register']=function(_0x33f97b){for(var _0x22edd0=0x0,_0x3e0236=events[_0x1c7a('0x4')];_0x22edd0<_0x3e0236;_0x22edd0++){var _0x3c525f=events[_0x22edd0];var _0x4dbfa5=createListener(_0x1c7a('0x5')+_0x3c525f,_0x33f97b);DashboardEvents['on'](_0x3c525f,_0x4dbfa5);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0b409ed..6007220 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 _0x253f=['../../components/interaction/service','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','create','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x253f,0x13b));var _0xf253=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x253f[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xf253('0x0'));var util=require(_0xf253('0x1'));var path=require(_0xf253('0x2'));var timeout=require(_0xf253('0x3'));var express=require(_0xf253('0x4'));var router=express[_0xf253('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf253('0x6'));var interaction=require(_0xf253('0x7'));var config=require('../../config/environment');var controller=require(_0xf253('0x8'));router['get']('/',auth[_0xf253('0x9')](),controller[_0xf253('0xa')]);router[_0xf253('0xb')](_0xf253('0xc'),auth[_0xf253('0x9')](),controller[_0xf253('0xd')]);router['get'](_0xf253('0xe'),auth[_0xf253('0x9')](),controller[_0xf253('0xf')]);router['post']('/',auth[_0xf253('0x9')](),controller[_0xf253('0x10')]);router[_0xf253('0x11')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0xf253('0x11')](_0xf253('0xe'),auth[_0xf253('0x9')](),controller['addItem']);router[_0xf253('0x12')](_0xf253('0xc'),auth[_0xf253('0x9')](),controller[_0xf253('0x13')]);router[_0xf253('0x14')]('/:id',auth[_0xf253('0x9')](),controller[_0xf253('0x15')]);module[_0xf253('0x16')]=router; \ No newline at end of file +var _0x4ac5=['/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','post','create'];(function(_0x527768,_0x3c6723){var _0x1bd92a=function(_0x3243f2){while(--_0x3243f2){_0x527768['push'](_0x527768['shift']());}};_0x1bd92a(++_0x3c6723);}(_0x4ac5,0xd8));var _0x54ac=function(_0x1090f8,_0xd83a11){_0x1090f8=_0x1090f8-0x0;var _0x180524=_0x4ac5[_0x1090f8];return _0x180524;};'use strict';var multer=require(_0x54ac('0x0'));var util=require(_0x54ac('0x1'));var path=require(_0x54ac('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x54ac('0x3')]();var fs_extra=require(_0x54ac('0x4'));var auth=require(_0x54ac('0x5'));var interaction=require(_0x54ac('0x6'));var config=require(_0x54ac('0x7'));var controller=require(_0x54ac('0x8'));router['get']('/',auth[_0x54ac('0x9')](),controller[_0x54ac('0xa')]);router[_0x54ac('0xb')](_0x54ac('0xc'),auth['isAuthenticated'](),controller[_0x54ac('0xd')]);router[_0x54ac('0xb')](_0x54ac('0xe'),auth[_0x54ac('0x9')](),controller[_0x54ac('0xf')]);router[_0x54ac('0x10')]('/',auth[_0x54ac('0x9')](),controller[_0x54ac('0x11')]);router['post'](_0x54ac('0x12'),auth[_0x54ac('0x9')](),controller[_0x54ac('0x13')]);router['post'](_0x54ac('0xe'),auth[_0x54ac('0x9')](),controller[_0x54ac('0x14')]);router[_0x54ac('0x15')](_0x54ac('0xc'),auth['isAuthenticated'](),controller[_0x54ac('0x16')]);router[_0x54ac('0x17')](_0x54ac('0xc'),auth[_0x54ac('0x9')](),controller[_0x54ac('0x18')]);module[_0x54ac('0x19')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index e94ba55..311965e 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 _0x9536=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x759956,_0x11c069){var _0x840af5=function(_0x55818f){while(--_0x55818f){_0x759956['push'](_0x759956['shift']());}};_0x840af5(++_0x11c069);}(_0x9536,0x179));var _0x6953=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x9536[_0x5e36d1];return _0x950b9e;};'use strict';var Sequelize=require(_0x6953('0x0'));var squel=require(_0x6953('0x1'));var _=require(_0x6953('0x2'));module[_0x6953('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6953('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x6953('0x5')),'get':function(){try{return JSON[_0x6953('0x6')](this[_0x6953('0x7')](_0x6953('0x8')));}catch(_0x2f3cc3){return[];}},'set':function(_0x494ac2){try{this[_0x6953('0x9')](_0x6953('0x8'),JSON[_0x6953('0xa')](_0x494ac2));}catch(_0x3e1aff){this[_0x6953('0x9')]('attrs',JSON[_0x6953('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6953('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x6953('0xb')]},'background':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x6953('0x4')],'allowNull':![],'defaultValue':_0x6953('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6953('0x4')]},'titleFontSize':{'type':Sequelize[_0x6953('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0x4975=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x2c4a6b,_0x29a928){var _0xe67f09=function(_0x3cbdaf){while(--_0x3cbdaf){_0x2c4a6b['push'](_0x2c4a6b['shift']());}};_0xe67f09(++_0x29a928);}(_0x4975,0x86));var _0x5497=function(_0x21e0cf,_0x3a8d70){_0x21e0cf=_0x21e0cf-0x0;var _0x3f84a4=_0x4975[_0x21e0cf];return _0x3f84a4;};'use strict';var Sequelize=require(_0x5497('0x0'));var squel=require('squel');var _=require(_0x5497('0x1'));module[_0x5497('0x2')]={'title':{'type':Sequelize[_0x5497('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5497('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5497('0x4')](_0x5497('0x5')),'get':function(){try{return JSON[_0x5497('0x6')](this[_0x5497('0x7')](_0x5497('0x8')));}catch(_0x5d5272){return[];}},'set':function(_0x539a27){try{this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')](_0x539a27));}catch(_0x674a2a){this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5497('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5497('0xb')]},'col':{'type':Sequelize[_0x5497('0xb')]},'background':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5497('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index c7de816..c93fc99 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 _0x965d=['squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','json','offset','count','limit','Content-Range','reject','save','update','then','destroy','error','name','show','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','params','catch','type','iframe','attrUrl','attrs','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','total','attrSerie2','attrSerie3','voice','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','lodash'];(function(_0x4cb817,_0x49aef8){var _0x310e21=function(_0x1f3cd4){while(--_0x1f3cd4){_0x4cb817['push'](_0x4cb817['shift']());}};_0x310e21(++_0x49aef8);}(_0x965d,0x1be));var _0xd965=function(_0x1bb928,_0x56e01a){_0x1bb928=_0x1bb928-0x0;var _0xadf945=_0x965d[_0x1bb928];return _0xadf945;};'use strict';var emlformat=require(_0xd965('0x0'));var rimraf=require(_0xd965('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd965('0x2'));var rp=require(_0xd965('0x3'));var moment=require(_0xd965('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd965('0x5'));var util=require(_0xd965('0x6'));var path=require(_0xd965('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd965('0x8'));var squel=require(_0xd965('0x9'));var crypto=require('crypto');var jsforce=require(_0xd965('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd965('0xb'));var querystring=require(_0xd965('0xc'));var Papa=require(_0xd965('0xd'));var Redis=require(_0xd965('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd965('0xf'));var as=require(_0xd965('0x10'));var hardwareService=require(_0xd965('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd965('0x12'));var db=require(_0xd965('0x13'))['db'];config['redis']=_[_0xd965('0x14')](config[_0xd965('0x15')],{'host':_0xd965('0x16'),'port':0x18eb});var socket=require(_0xd965('0x17'))(new Redis(config[_0xd965('0x15')]));require('./dashboardItem.socket')[_0xd965('0x18')](socket);function respondWithStatusCode(_0x419d38,_0x4ef970){_0x4ef970=_0x4ef970||0xcc;return function(_0x58bfb4){if(_0x58bfb4){return _0x419d38['sendStatus'](_0x4ef970);}return _0x419d38[_0xd965('0x19')](_0x4ef970)[_0xd965('0x1a')]();};}function respondWithResult(_0x13feed,_0x5f96c0){_0x5f96c0=_0x5f96c0||0xc8;return function(_0x4f1960){if(_0x4f1960){return _0x13feed[_0xd965('0x19')](_0x5f96c0)[_0xd965('0x1b')](_0x4f1960);}};}function respondWithFilteredResult(_0x340467,_0x233506){return function(_0x45f930){if(_0x45f930){var _0x5dbaff=typeof _0x233506[_0xd965('0x1c')]==='undefined'&&typeof _0x233506['limit']==='undefined';var _0x3c9901=_0x45f930[_0xd965('0x1d')];var _0x876ef4=_0x5dbaff?0x0:_0x233506[_0xd965('0x1c')];var _0x532c40=_0x5dbaff?_0x45f930[_0xd965('0x1d')]:_0x233506[_0xd965('0x1c')]+_0x233506[_0xd965('0x1e')];var _0x5121f4;if(_0x532c40>=_0x3c9901){_0x532c40=_0x3c9901;_0x5121f4=0xc8;}else{_0x5121f4=0xce;}_0x340467['status'](_0x5121f4);return _0x340467['set'](_0xd965('0x1f'),_0x876ef4+'-'+_0x532c40+'/'+_0x3c9901)['json'](_0x45f930);}return null;};}function patchUpdates(_0x26acc5){return function(_0xef392d){try{jsonpatch['apply'](_0xef392d,_0x26acc5,!![]);}catch(_0x55675d){return BPromise[_0xd965('0x20')](_0x55675d);}return _0xef392d[_0xd965('0x21')]();};}function saveUpdates(_0x1730bf,_0x34eb21){return function(_0x448642){if(_0x448642){return _0x448642[_0xd965('0x22')](_0x1730bf)[_0xd965('0x23')](function(_0x1a7367){return _0x1a7367;});}return null;};}function removeEntity(_0x38ca71,_0xc30f4d){return function(_0x420d91){if(_0x420d91){return _0x420d91[_0xd965('0x24')]()['then'](function(){_0x38ca71[_0xd965('0x19')](0xcc)[_0xd965('0x1a')]();});}};}function handleEntityNotFound(_0x540d0c,_0x47a140){return function(_0x4d6a07){if(!_0x4d6a07){_0x540d0c['sendStatus'](0x194);}return _0x4d6a07;};}function handleError(_0x4fc59f,_0x13d11d){_0x13d11d=_0x13d11d||0x1f4;return function(_0x182b87){logger[_0xd965('0x25')](_0x182b87['stack']);if(_0x182b87[_0xd965('0x26')]){delete _0x182b87[_0xd965('0x26')];}_0x4fc59f[_0xd965('0x19')](_0x13d11d)['send'](_0x182b87);};}exports[_0xd965('0x27')]=function(_0x591ed2,_0x5af825){var _0x5ac01e={'raw':![],'where':{'id':_0x591ed2['params']['id']}},_0x26379d={};_0x26379d[_0xd965('0x28')]=_['keys'](db[_0xd965('0x29')][_0xd965('0x2a')]);_0x26379d[_0xd965('0x2b')]=_[_0xd965('0x2c')](_0x591ed2['query']);_0x26379d[_0xd965('0x2d')]=_[_0xd965('0x2e')](_0x26379d['model'],_0x26379d[_0xd965('0x2b')]);_0x5ac01e[_0xd965('0x2f')]=_['intersection'](_0x26379d[_0xd965('0x28')],qs['fields'](_0x591ed2[_0xd965('0x2b')][_0xd965('0x30')]));_0x5ac01e[_0xd965('0x2f')]=_0x5ac01e[_0xd965('0x2f')]['length']?_0x5ac01e[_0xd965('0x2f')]:_0x26379d[_0xd965('0x28')];if(_0x591ed2['query'][_0xd965('0x31')]){_0x5ac01e[_0xd965('0x32')]=[{'all':!![]}];}_0x5ac01e=_[_0xd965('0x33')]({},_0x5ac01e,_0x591ed2[_0xd965('0x34')]);return db[_0xd965('0x29')][_0xd965('0x35')](_0x5ac01e)['then'](handleEntityNotFound(_0x5af825,null))[_0xd965('0x23')](respondWithResult(_0x5af825,null))['catch'](handleError(_0x5af825,null));};exports[_0xd965('0x24')]=function(_0x40b7d7,_0x49caa7){return db[_0xd965('0x29')][_0xd965('0x35')]({'where':{'id':_0x40b7d7[_0xd965('0x36')]['id']}})[_0xd965('0x23')](handleEntityNotFound(_0x49caa7,null))[_0xd965('0x23')](removeEntity(_0x49caa7,null))[_0xd965('0x37')](handleError(_0x49caa7,null));};function widgetAttributes(_0x2ee2a3){try{switch(_0x2ee2a3[_0xd965('0x38')]){case _0xd965('0x39'):return[{'name':_0xd965('0x3a'),'value':_0x2ee2a3['attrUrl']||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x0]?_0x2ee2a3[_0xd965('0x3b')][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0xd965('0x3c'),'value':_0x2ee2a3[_0xd965('0x3c')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x0]?_0x2ee2a3[_0xd965('0x3b')][0x0][_0xd965('0x3d')]:undefined)||''}];case _0xd965('0x3e'):return[{'name':_0xd965('0x3f'),'value':_0x2ee2a3[_0xd965('0x3f')]||(_0x2ee2a3['attrs']&&_0x2ee2a3['attrs'][0x0]?_0x2ee2a3['attrs'][0x0][_0xd965('0x3d')]:undefined)||_0xd965('0x40')},{'name':_0xd965('0x41'),'value':_0x2ee2a3[_0xd965('0x41')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x1]?_0x2ee2a3[_0xd965('0x3b')][0x1][_0xd965('0x3d')]:undefined)||'0.00'},{'name':_0xd965('0x42'),'value':_0x2ee2a3[_0xd965('0x42')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x2]?_0x2ee2a3['attrs'][0x2]['value']:undefined)||0xc}];case _0xd965('0x43'):return[{'name':_0xd965('0x44'),'value':_0x2ee2a3['attrMetric']||(_0x2ee2a3['attrs']&&_0x2ee2a3[_0xd965('0x3b')][0x0]?_0x2ee2a3[_0xd965('0x3b')][0x0][_0xd965('0x3d')]:undefined)||'total'},{'name':_0xd965('0x45'),'value':_0x2ee2a3[_0xd965('0x45')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x1]?_0x2ee2a3['attrs'][0x1][_0xd965('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0x2ee2a3[_0xd965('0x42')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x2]?_0x2ee2a3[_0xd965('0x3b')][0x2][_0xd965('0x3d')]:undefined)||0x14},{'name':_0xd965('0x46'),'value':_0x2ee2a3[_0xd965('0x46')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x3]?_0x2ee2a3['attrs'][0x3][_0xd965('0x3d')]:undefined)||'voice'},{'name':_0xd965('0x47'),'value':_0x2ee2a3['attrEmailAccounts']||(_0x2ee2a3['attrs']&&_0x2ee2a3['attrs'][0x4]?_0x2ee2a3[_0xd965('0x3b')][0x4][_0xd965('0x3d')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x2ee2a3[_0xd965('0x48')]||(_0x2ee2a3['attrs']&&_0x2ee2a3[_0xd965('0x3b')][0x5]?_0x2ee2a3[_0xd965('0x3b')][0x5]['value']:undefined)||''},{'name':_0xd965('0x49'),'value':_0x2ee2a3[_0xd965('0x49')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3['attrs'][0x6]?_0x2ee2a3['attrs'][0x6][_0xd965('0x3d')]:undefined)||''},{'name':_0xd965('0x4a'),'value':_0x2ee2a3['attrOpenchannelAccounts']||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x7]?_0x2ee2a3[_0xd965('0x3b')][0x7][_0xd965('0x3d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2ee2a3[_0xd965('0x4b')]||(_0x2ee2a3['attrs']&&_0x2ee2a3['attrs'][0x8]?_0x2ee2a3[_0xd965('0x3b')][0x8]['value']:undefined)||''},{'name':_0xd965('0x4c'),'value':_0x2ee2a3[_0xd965('0x4c')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x9]?_0x2ee2a3[_0xd965('0x3b')][0x9][_0xd965('0x3d')]:undefined)||''}];case _0xd965('0x4d'):case _0xd965('0x4e'):return[{'name':'attrSerie1','value':_0x2ee2a3['attrSerie1']||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x0]?_0x2ee2a3[_0xd965('0x3b')][0x0][_0xd965('0x3d')]:undefined)||_0xd965('0x4f')},{'name':_0xd965('0x50'),'value':_0x2ee2a3[_0xd965('0x50')]||(_0x2ee2a3['attrs']&&_0x2ee2a3[_0xd965('0x3b')][0x1]?_0x2ee2a3[_0xd965('0x3b')][0x1]['value']:undefined)||null},{'name':_0xd965('0x51'),'value':_0x2ee2a3[_0xd965('0x51')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x2]?_0x2ee2a3[_0xd965('0x3b')][0x2][_0xd965('0x3d')]:undefined)||null},{'name':_0xd965('0x45'),'value':_0x2ee2a3[_0xd965('0x45')]||(_0x2ee2a3['attrs']&&_0x2ee2a3[_0xd965('0x3b')][0x3]?_0x2ee2a3['attrs'][0x3]['value']:undefined)||[]},{'name':_0xd965('0x46'),'value':_0x2ee2a3['attrChannel']||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x4]?_0x2ee2a3[_0xd965('0x3b')][0x4][_0xd965('0x3d')]:undefined)||_0xd965('0x52')},{'name':_0xd965('0x47'),'value':_0x2ee2a3[_0xd965('0x47')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x5]?_0x2ee2a3[_0xd965('0x3b')][0x5][_0xd965('0x3d')]:undefined)||''},{'name':_0xd965('0x48'),'value':_0x2ee2a3[_0xd965('0x48')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x6]?_0x2ee2a3[_0xd965('0x3b')][0x6][_0xd965('0x3d')]:undefined)||''},{'name':_0xd965('0x49'),'value':_0x2ee2a3[_0xd965('0x49')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x7]?_0x2ee2a3['attrs'][0x7][_0xd965('0x3d')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2ee2a3[_0xd965('0x4a')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3['attrs'][0x8]?_0x2ee2a3[_0xd965('0x3b')][0x8]['value']:undefined)||''},{'name':_0xd965('0x4b'),'value':_0x2ee2a3['attrWhatsappAccounts']||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x9]?_0x2ee2a3[_0xd965('0x3b')][0x9][_0xd965('0x3d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2ee2a3[_0xd965('0x4c')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0xa]?_0x2ee2a3[_0xd965('0x3b')][0xa][_0xd965('0x3d')]:undefined)||''}];case _0xd965('0x53'):return[{'name':'attrReport','type':_0x2ee2a3[_0xd965('0x54')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3[_0xd965('0x3b')][0x0]?_0x2ee2a3[_0xd965('0x3b')][0x0][_0xd965('0x38')]:undefined)||null,'value':_0x2ee2a3[_0xd965('0x55')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3['attrs'][0x0]?_0x2ee2a3[_0xd965('0x3b')][0x0][_0xd965('0x3d')]:undefined)||null},{'name':_0xd965('0x56'),'value':_0x2ee2a3[_0xd965('0x56')]||(_0x2ee2a3[_0xd965('0x3b')]&&_0x2ee2a3['attrs'][0x1]?_0x2ee2a3[_0xd965('0x3b')][0x1][_0xd965('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x17f947){logger[_0xd965('0x25')](_0xd965('0x57'),JSON[_0xd965('0x58')](_0x17f947));return[];}}exports['create']=function(_0x2be4c4,_0x250d99){if(_0x2be4c4[_0xd965('0x59')]){_0x2be4c4['body'][_0xd965('0x3b')]=widgetAttributes(_0x2be4c4[_0xd965('0x59')]);}return db[_0xd965('0x29')][_0xd965('0x5a')](_0x2be4c4['body'],{})['then'](respondWithResult(_0x250d99,0xc9))[_0xd965('0x37')](handleError(_0x250d99,null));};exports[_0xd965('0x22')]=function(_0x369270,_0x4cb8d9){if(_0x369270[_0xd965('0x59')]['id']){delete _0x369270['body']['id'];}_0x369270[_0xd965('0x59')][_0xd965('0x3b')]=widgetAttributes(_0x369270['body']);return db[_0xd965('0x29')][_0xd965('0x35')]({'where':{'id':_0x369270[_0xd965('0x36')]['id']}})[_0xd965('0x23')](handleEntityNotFound(_0x4cb8d9,null))[_0xd965('0x23')](saveUpdates(_0x369270[_0xd965('0x59')],null))[_0xd965('0x23')](respondWithResult(_0x4cb8d9,null))[_0xd965('0x37')](handleError(_0x4cb8d9,null));}; \ No newline at end of file +var _0x12e9=['web-report','attrReport','reportType','attrRefresh','stringify','create','body','catch','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','status','end','json','offset','undefined','limit','count','set','reject','update','then','sendStatus','error','name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','destroy','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts'];(function(_0x28e502,_0x3e36c5){var _0x2fd662=function(_0x35cb6a){while(--_0x35cb6a){_0x28e502['push'](_0x28e502['shift']());}};_0x2fd662(++_0x3e36c5);}(_0x12e9,0x66));var _0x912e=function(_0x65a899,_0x560d17){_0x65a899=_0x65a899-0x0;var _0x5f0810=_0x12e9[_0x65a899];return _0x5f0810;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x912e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x912e('0x1'));var moment=require(_0x912e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x912e('0x3'));var util=require(_0x912e('0x4'));var path=require('path');var sox=require(_0x912e('0x5'));var csv=require(_0x912e('0x6'));var ejs=require(_0x912e('0x7'));var fs=require('fs');var fs_extra=require(_0x912e('0x8'));var _=require('lodash');var squel=require(_0x912e('0x9'));var crypto=require(_0x912e('0xa'));var jsforce=require(_0x912e('0xb'));var deskjs=require(_0x912e('0xc'));var toCsv=require(_0x912e('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x912e('0xd'));var qs=require(_0x912e('0xe'));var as=require(_0x912e('0xf'));var hardwareService=require(_0x912e('0x10'));var logger=require(_0x912e('0x11'))('api');var utils=require(_0x912e('0x12'));var config=require(_0x912e('0x13'));var licenseUtil=require(_0x912e('0x14'));var db=require(_0x912e('0x15'))['db'];config[_0x912e('0x16')]=_[_0x912e('0x17')](config[_0x912e('0x16')],{'host':_0x912e('0x18'),'port':0x18eb});var socket=require(_0x912e('0x19'))(new Redis(config[_0x912e('0x16')]));require(_0x912e('0x1a'))[_0x912e('0x1b')](socket);function respondWithStatusCode(_0x536c1b,_0x3a02aa){_0x3a02aa=_0x3a02aa||0xcc;return function(_0x4e0c4d){if(_0x4e0c4d){return _0x536c1b['sendStatus'](_0x3a02aa);}return _0x536c1b[_0x912e('0x1c')](_0x3a02aa)[_0x912e('0x1d')]();};}function respondWithResult(_0x19eed4,_0x5c44b1){_0x5c44b1=_0x5c44b1||0xc8;return function(_0x572179){if(_0x572179){return _0x19eed4[_0x912e('0x1c')](_0x5c44b1)[_0x912e('0x1e')](_0x572179);}};}function respondWithFilteredResult(_0x265614,_0x54860e){return function(_0x36fb67){if(_0x36fb67){var _0x100790=typeof _0x54860e[_0x912e('0x1f')]===_0x912e('0x20')&&typeof _0x54860e[_0x912e('0x21')]==='undefined';var _0x1f3ab0=_0x36fb67[_0x912e('0x22')];var _0x2dd441=_0x100790?0x0:_0x54860e[_0x912e('0x1f')];var _0x2f9d2f=_0x100790?_0x36fb67[_0x912e('0x22')]:_0x54860e[_0x912e('0x1f')]+_0x54860e[_0x912e('0x21')];var _0x271e00;if(_0x2f9d2f>=_0x1f3ab0){_0x2f9d2f=_0x1f3ab0;_0x271e00=0xc8;}else{_0x271e00=0xce;}_0x265614[_0x912e('0x1c')](_0x271e00);return _0x265614[_0x912e('0x23')]('Content-Range',_0x2dd441+'-'+_0x2f9d2f+'/'+_0x1f3ab0)[_0x912e('0x1e')](_0x36fb67);}return null;};}function patchUpdates(_0x4f1a6f){return function(_0x46f935){try{jsonpatch['apply'](_0x46f935,_0x4f1a6f,!![]);}catch(_0x3817a9){return BPromise[_0x912e('0x24')](_0x3817a9);}return _0x46f935['save']();};}function saveUpdates(_0x28497d,_0x1e59d8){return function(_0x892de0){if(_0x892de0){return _0x892de0[_0x912e('0x25')](_0x28497d)[_0x912e('0x26')](function(_0x5ba003){return _0x5ba003;});}return null;};}function removeEntity(_0x92f64d,_0x27c6f6){return function(_0x4636ce){if(_0x4636ce){return _0x4636ce['destroy']()[_0x912e('0x26')](function(){_0x92f64d['status'](0xcc)[_0x912e('0x1d')]();});}};}function handleEntityNotFound(_0x1c4ab6,_0xe48a67){return function(_0x3c6a2a){if(!_0x3c6a2a){_0x1c4ab6[_0x912e('0x27')](0x194);}return _0x3c6a2a;};}function handleError(_0x5267ef,_0x1f9ad4){_0x1f9ad4=_0x1f9ad4||0x1f4;return function(_0x12150f){logger[_0x912e('0x28')](_0x12150f['stack']);if(_0x12150f[_0x912e('0x29')]){delete _0x12150f['name'];}_0x5267ef['status'](_0x1f9ad4)['send'](_0x12150f);};}exports[_0x912e('0x2a')]=function(_0x58b9cf,_0x4cbb33){var _0x58d575={'raw':![],'where':{'id':_0x58b9cf[_0x912e('0x2b')]['id']}},_0x3f61a2={};_0x3f61a2[_0x912e('0x2c')]=_[_0x912e('0x2d')](db[_0x912e('0x2e')][_0x912e('0x2f')]);_0x3f61a2[_0x912e('0x30')]=_[_0x912e('0x2d')](_0x58b9cf[_0x912e('0x30')]);_0x3f61a2[_0x912e('0x31')]=_[_0x912e('0x32')](_0x3f61a2[_0x912e('0x2c')],_0x3f61a2[_0x912e('0x30')]);_0x58d575['attributes']=_['intersection'](_0x3f61a2[_0x912e('0x2c')],qs['fields'](_0x58b9cf[_0x912e('0x30')][_0x912e('0x33')]));_0x58d575[_0x912e('0x34')]=_0x58d575[_0x912e('0x34')][_0x912e('0x35')]?_0x58d575[_0x912e('0x34')]:_0x3f61a2[_0x912e('0x2c')];if(_0x58b9cf[_0x912e('0x30')][_0x912e('0x36')]){_0x58d575[_0x912e('0x37')]=[{'all':!![]}];}_0x58d575=_['merge']({},_0x58d575,_0x58b9cf[_0x912e('0x38')]);return db[_0x912e('0x2e')][_0x912e('0x39')](_0x58d575)[_0x912e('0x26')](handleEntityNotFound(_0x4cbb33,null))[_0x912e('0x26')](respondWithResult(_0x4cbb33,null))['catch'](handleError(_0x4cbb33,null));};exports[_0x912e('0x3a')]=function(_0x56a159,_0x3e716f){return db[_0x912e('0x2e')][_0x912e('0x39')]({'where':{'id':_0x56a159['params']['id']}})[_0x912e('0x26')](handleEntityNotFound(_0x3e716f,null))[_0x912e('0x26')](removeEntity(_0x3e716f,null))['catch'](handleError(_0x3e716f,null));};function widgetAttributes(_0x33b61d){try{switch(_0x33b61d[_0x912e('0x3b')]){case'iframe':return[{'name':_0x912e('0x3c'),'value':_0x33b61d[_0x912e('0x3c')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d['attrs'][0x0][_0x912e('0x3e')]:undefined)||'https://'}];case'custom':return[{'name':_0x912e('0x3f'),'value':_0x33b61d[_0x912e('0x3f')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3e')]:undefined)||''}];case _0x912e('0x40'):return[{'name':_0x912e('0x41'),'value':_0x33b61d[_0x912e('0x41')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3e')]:undefined)||_0x912e('0x42')},{'name':_0x912e('0x43'),'value':_0x33b61d[_0x912e('0x43')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1][_0x912e('0x3e')]:undefined)||_0x912e('0x44')},{'name':_0x912e('0x45'),'value':_0x33b61d[_0x912e('0x45')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x2]?_0x33b61d[_0x912e('0x3d')][0x2]['value']:undefined)||0xc}];case _0x912e('0x46'):return[{'name':_0x912e('0x47'),'value':_0x33b61d['attrMetric']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x0]?_0x33b61d['attrs'][0x0]['value']:undefined)||_0x912e('0x48')},{'name':_0x912e('0x49'),'value':_0x33b61d[_0x912e('0x49')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1][_0x912e('0x3e')]:undefined)||[]},{'name':'attrFontSize','value':_0x33b61d[_0x912e('0x45')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x2]?_0x33b61d['attrs'][0x2][_0x912e('0x3e')]:undefined)||0x14},{'name':_0x912e('0x4a'),'value':_0x33b61d[_0x912e('0x4a')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x3]?_0x33b61d[_0x912e('0x3d')][0x3][_0x912e('0x3e')]:undefined)||_0x912e('0x4b')},{'name':_0x912e('0x4c'),'value':_0x33b61d[_0x912e('0x4c')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x4]?_0x33b61d[_0x912e('0x3d')][0x4][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4d'),'value':_0x33b61d[_0x912e('0x4d')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x5]?_0x33b61d[_0x912e('0x3d')][0x5][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4e'),'value':_0x33b61d[_0x912e('0x4e')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x6]?_0x33b61d[_0x912e('0x3d')][0x6][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4f'),'value':_0x33b61d[_0x912e('0x4f')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x7]?_0x33b61d[_0x912e('0x3d')][0x7][_0x912e('0x3e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x33b61d['attrWhatsappAccounts']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x8]?_0x33b61d[_0x912e('0x3d')][0x8][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x50'),'value':_0x33b61d[_0x912e('0x50')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x9]?_0x33b61d[_0x912e('0x3d')][0x9][_0x912e('0x3e')]:undefined)||''}];case _0x912e('0x51'):case'pie-chart':return[{'name':_0x912e('0x52'),'value':_0x33b61d['attrSerie1']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d['attrs'][0x0][_0x912e('0x3e')]:undefined)||_0x912e('0x48')},{'name':_0x912e('0x53'),'value':_0x33b61d['attrSerie2']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1]['value']:undefined)||null},{'name':_0x912e('0x54'),'value':_0x33b61d['attrSerie3']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x2]?_0x33b61d[_0x912e('0x3d')][0x2]['value']:undefined)||null},{'name':_0x912e('0x49'),'value':_0x33b61d[_0x912e('0x49')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x3]?_0x33b61d['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x33b61d[_0x912e('0x4a')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x4]?_0x33b61d[_0x912e('0x3d')][0x4]['value']:undefined)||_0x912e('0x4b')},{'name':'attrEmailAccounts','value':_0x33b61d[_0x912e('0x4c')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x5]?_0x33b61d[_0x912e('0x3d')][0x5][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4d'),'value':_0x33b61d[_0x912e('0x4d')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x6]?_0x33b61d[_0x912e('0x3d')][0x6][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x4e'),'value':_0x33b61d[_0x912e('0x4e')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x7]?_0x33b61d[_0x912e('0x3d')][0x7]['value']:undefined)||''},{'name':_0x912e('0x4f'),'value':_0x33b61d[_0x912e('0x4f')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x8]?_0x33b61d[_0x912e('0x3d')][0x8][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x55'),'value':_0x33b61d['attrWhatsappAccounts']||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d['attrs'][0x9]?_0x33b61d[_0x912e('0x3d')][0x9][_0x912e('0x3e')]:undefined)||''},{'name':_0x912e('0x50'),'value':_0x33b61d[_0x912e('0x50')]||(_0x33b61d['attrs']&&_0x33b61d['attrs'][0xa]?_0x33b61d[_0x912e('0x3d')][0xa][_0x912e('0x3e')]:undefined)||''}];case _0x912e('0x56'):return[{'name':_0x912e('0x57'),'type':_0x33b61d[_0x912e('0x58')]||(_0x33b61d['attrs']&&_0x33b61d[_0x912e('0x3d')][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3b')]:undefined)||null,'value':_0x33b61d['attrReport']||(_0x33b61d['attrs']&&_0x33b61d['attrs'][0x0]?_0x33b61d[_0x912e('0x3d')][0x0][_0x912e('0x3e')]:undefined)||null},{'name':_0x912e('0x59'),'value':_0x33b61d[_0x912e('0x59')]||(_0x33b61d[_0x912e('0x3d')]&&_0x33b61d[_0x912e('0x3d')][0x1]?_0x33b61d[_0x912e('0x3d')][0x1][_0x912e('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x404788){logger[_0x912e('0x28')]('widgetAttributes:\x20%s',JSON[_0x912e('0x5a')](_0x404788));return[];}}exports[_0x912e('0x5b')]=function(_0x5ddf2d,_0x474d70){if(_0x5ddf2d[_0x912e('0x5c')]){_0x5ddf2d[_0x912e('0x5c')]['attrs']=widgetAttributes(_0x5ddf2d['body']);}return db['DashboardItem'][_0x912e('0x5b')](_0x5ddf2d[_0x912e('0x5c')],{})[_0x912e('0x26')](respondWithResult(_0x474d70,0xc9))[_0x912e('0x5d')](handleError(_0x474d70,null));};exports[_0x912e('0x25')]=function(_0x14a397,_0x461f83){if(_0x14a397[_0x912e('0x5c')]['id']){delete _0x14a397['body']['id'];}_0x14a397['body'][_0x912e('0x3d')]=widgetAttributes(_0x14a397[_0x912e('0x5c')]);return db[_0x912e('0x2e')][_0x912e('0x39')]({'where':{'id':_0x14a397[_0x912e('0x2b')]['id']}})[_0x912e('0x26')](handleEntityNotFound(_0x461f83,null))[_0x912e('0x26')](saveUpdates(_0x14a397[_0x912e('0x5c')],null))[_0x912e('0x26')](respondWithResult(_0x461f83,null))[_0x912e('0x5d')](handleError(_0x461f83,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7f4029b..4248e29 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 _0xd347=['hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update','emit'];(function(_0x2068c1,_0x19f0aa){var _0x156103=function(_0x531aa6){while(--_0x531aa6){_0x2068c1['push'](_0x2068c1['shift']());}};_0x156103(++_0x19f0aa);}(_0xd347,0x1c5));var _0x7d34=function(_0x1e2c0f,_0x15c887){_0x1e2c0f=_0x1e2c0f-0x0;var _0x3a8ebd=_0xd347[_0x1e2c0f];return _0x3a8ebd;};'use strict';var EventEmitter=require(_0x7d34('0x0'));var DashboardItem=require(_0x7d34('0x1'))['db'][_0x7d34('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d34('0x3'),'afterUpdate':_0x7d34('0x4'),'afterDestroy':'remove'};function emitEvent(_0x24c36e){return function(_0x53a625,_0x3df62d,_0x290332){DashboardItemEvents['emit'](_0x24c36e+':'+_0x53a625['id'],_0x53a625);DashboardItemEvents[_0x7d34('0x5')](_0x24c36e,_0x53a625);_0x290332(null);};}for(var e in events){if(events[_0x7d34('0x6')](e)){var event=events[e];DashboardItem[_0x7d34('0x7')](e,emitEvent(event));}}module[_0x7d34('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0xf1e7=['exports','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x118223,_0x22ab71){var _0x5cf1e7=function(_0x21beb4){while(--_0x21beb4){_0x118223['push'](_0x118223['shift']());}};_0x5cf1e7(++_0x22ab71);}(_0xf1e7,0x139));var _0x7f1e=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xf1e7[_0x27af45];return _0x18df21;};'use strict';var EventEmitter=require(_0x7f1e('0x0'));var DashboardItem=require(_0x7f1e('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7f1e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7f1e('0x3')};function emitEvent(_0x927577){return function(_0x5c45e5,_0x148f95,_0x5e5820){DashboardItemEvents['emit'](_0x927577+':'+_0x5c45e5['id'],_0x5c45e5);DashboardItemEvents[_0x7f1e('0x4')](_0x927577,_0x5c45e5);_0x5e5820(null);};}for(var e in events){if(events[_0x7f1e('0x5')](e)){var event=events[e];DashboardItem[_0x7f1e('0x6')](e,emitEvent(event));}}module[_0x7f1e('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 ebdf731..b46d265 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 _0x2356=['../../config/logger','bluebird','request-promise','../../config/environment','define','util'];(function(_0x139f80,_0x403b4d){var _0x52128f=function(_0x3a6b78){while(--_0x3a6b78){_0x139f80['push'](_0x139f80['shift']());}};_0x52128f(++_0x403b4d);}(_0x2356,0x14f));var _0x6235=function(_0x54d6ec,_0x21d997){_0x54d6ec=_0x54d6ec-0x0;var _0x2ca84d=_0x2356[_0x54d6ec];return _0x2ca84d;};'use strict';var _=require('lodash');var util=require(_0x6235('0x0'));var logger=require(_0x6235('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6235('0x2'));var rp=require(_0x6235('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6235('0x4'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x390c55,_0x17e08f){return _0x390c55[_0x6235('0x5')]('DashboardItem',attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc078=['dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc078,0xfd));var _0x8c07=function(_0x420092,_0x567e07){_0x420092=_0x420092-0x0;var _0x55a89d=_0xc078[_0x420092];return _0x55a89d;};'use strict';var _=require('lodash');var util=require(_0x8c07('0x0'));var logger=require(_0x8c07('0x1'))(_0x8c07('0x2'));var moment=require(_0x8c07('0x3'));var BPromise=require(_0x8c07('0x4'));var rp=require(_0x8c07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c07('0x6'));var config=require(_0x8c07('0x7'));var attributes=require(_0x8c07('0x8'));module[_0x8c07('0x9')]=function(_0x304920,_0x585966){return _0x304920['define'](_0x8c07('0xa'),attributes,{'tableName':_0x8c07('0xb'),'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 f6db220..940d705 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 _0x175d=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x5979a6,_0x564c8d){var _0x2df08c=function(_0x4892ef){while(--_0x4892ef){_0x5979a6['push'](_0x5979a6['shift']());}};_0x2df08c(++_0x564c8d);}(_0x175d,0x1df));var _0xd175=function(_0x2a31bb,_0x3a8fc4){_0x2a31bb=_0x2a31bb-0x0;var _0x37fb4a=_0x175d[_0x2a31bb];return _0x37fb4a;};'use strict';var _=require(_0xd175('0x0'));var util=require(_0xd175('0x1'));var moment=require(_0xd175('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd175('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd175('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd175('0x5'));var jayson=require(_0xd175('0x6'));var client=jayson[_0xd175('0x7')]['http']({'port':0x232a});config[_0xd175('0x8')]=_[_0xd175('0x9')](config[_0xd175('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xd175('0xa'))(new Redis(config['redis']));require(_0xd175('0xb'))[_0xd175('0xc')](socket);function respondWithRpcPromise(_0x33b8cc,_0x5019ea,_0x2d4fc2){return new BPromise(function(_0x5cc991,_0xaf1fc1){return client[_0xd175('0xd')](_0x33b8cc,_0x2d4fc2)['then'](function(_0x5d0564){logger['info'](_0xd175('0xe'),_0x5019ea,_0xd175('0xf'));logger['debug'](_0xd175('0x10'),_0x5019ea,_0xd175('0xf'),JSON['stringify'](_0x5d0564));if(_0x5d0564['error']){if(_0x5d0564['error'][_0xd175('0x11')]===0x1f4){logger[_0xd175('0x12')](_0xd175('0xe'),_0x5019ea,_0x5d0564[_0xd175('0x12')]['message']);return _0xaf1fc1(_0x5d0564[_0xd175('0x12')][_0xd175('0x13')]);}logger[_0xd175('0x12')](_0xd175('0xe'),_0x5019ea,_0x5d0564[_0xd175('0x12')]['message']);return _0x5cc991(_0x5d0564['error']['message']);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x5019ea,_0xd175('0xf'));_0x5cc991(_0x5d0564[_0xd175('0x14')]['message']);}})[_0xd175('0x15')](function(_0x4a4047){logger[_0xd175('0x12')](_0xd175('0xe'),_0x5019ea,_0x4a4047);_0xaf1fc1(_0x4a4047);});});} \ No newline at end of file +var _0x0a34=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','./dashboardItem.socket','register','request','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash','util'];(function(_0x209ea2,_0x53e08d){var _0x577a51=function(_0x305fbc){while(--_0x305fbc){_0x209ea2['push'](_0x209ea2['shift']());}};_0x577a51(++_0x53e08d);}(_0x0a34,0xee));var _0x40a3=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x0a34[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var moment=require('moment');var BPromise=require(_0x40a3('0x2'));var rs=require(_0x40a3('0x3'));var fs=require('fs');var Redis=require(_0x40a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40a3('0x5'));var logger=require(_0x40a3('0x6'))('rpc');var config=require(_0x40a3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x40a3('0x8')][_0x40a3('0x9')]({'port':0x232a});config['redis']=_[_0x40a3('0xa')](config[_0x40a3('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x40a3('0xc'))[_0x40a3('0xd')](socket);function respondWithRpcPromise(_0xcfe778,_0x1eed4f,_0x5ddf15){return new BPromise(function(_0x41680c,_0x21c5a8){return client[_0x40a3('0xe')](_0xcfe778,_0x5ddf15)['then'](function(_0x341f75){logger['info']('DashboardItem,\x20%s,\x20%s',_0x1eed4f,_0x40a3('0xf'));logger[_0x40a3('0x10')](_0x40a3('0x11'),_0x1eed4f,_0x40a3('0xf'),JSON['stringify'](_0x341f75));if(_0x341f75[_0x40a3('0x12')]){if(_0x341f75[_0x40a3('0x12')]['code']===0x1f4){logger['error'](_0x40a3('0x13'),_0x1eed4f,_0x341f75[_0x40a3('0x12')]['message']);return _0x21c5a8(_0x341f75['error']['message']);}logger[_0x40a3('0x12')](_0x40a3('0x13'),_0x1eed4f,_0x341f75['error']['message']);return _0x41680c(_0x341f75[_0x40a3('0x12')][_0x40a3('0x14')]);}else{logger[_0x40a3('0x15')](_0x40a3('0x13'),_0x1eed4f,_0x40a3('0xf'));_0x41680c(_0x341f75[_0x40a3('0x16')][_0x40a3('0x14')]);}})[_0x40a3('0x17')](function(_0x50673d){logger['error'](_0x40a3('0x13'),_0x1eed4f,_0x50673d);_0x21c5a8(_0x50673d);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 43d4164..2f1af00 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 _0xb843=['removeListener','register','length','dashboardItem:','save','update','emit'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xb843,0x123));var _0x3b84=function(_0x2ffe3c,_0x235a7b){_0x2ffe3c=_0x2ffe3c-0x0;var _0x10971b=_0xb843[_0x2ffe3c];return _0x10971b;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x3b84('0x0'),'remove',_0x3b84('0x1')];function createListener(_0x54e41a,_0x3051db){return function(_0x3b00bf){_0x3051db[_0x3b84('0x2')](_0x54e41a,_0x3b00bf);};}function removeListener(_0x4d5667,_0x1ef6a1){return function(){DashboardItemEvents[_0x3b84('0x3')](_0x4d5667,_0x1ef6a1);};}exports[_0x3b84('0x4')]=function(_0x47ea42){for(var _0x47fb4c=0x0,_0x119dab=events[_0x3b84('0x5')];_0x47fb4c<_0x119dab;_0x47fb4c++){var _0x497aa4=events[_0x47fb4c];var _0x2e13cb=createListener(_0x3b84('0x6')+_0x497aa4,_0x47ea42);DashboardItemEvents['on'](_0x497aa4,_0x2e13cb);}}; \ No newline at end of file +var _0x250f=['dashboardItem:','./dashboardItem.events','remove','removeListener','length'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x250f,0xa6));var _0xf250=function(_0x30a943,_0x271984){_0x30a943=_0x30a943-0x0;var _0x47a07f=_0x250f[_0x30a943];return _0x47a07f;};'use strict';var DashboardItemEvents=require(_0xf250('0x0'));var events=['save',_0xf250('0x1'),'update'];function createListener(_0x593e22,_0x18bf4c){return function(_0x150104){_0x18bf4c['emit'](_0x593e22,_0x150104);};}function removeListener(_0x47817e,_0x409c28){return function(){DashboardItemEvents[_0xf250('0x2')](_0x47817e,_0x409c28);};}exports['register']=function(_0x11ff72){for(var _0x35ab9a=0x0,_0x5d7883=events[_0xf250('0x3')];_0x35ab9a<_0x5d7883;_0x35ab9a++){var _0x495b2a=events[_0x35ab9a];var _0x162ab=createListener(_0xf250('0x4')+_0x495b2a,_0x11ff72);DashboardItemEvents['on'](_0x495b2a,_0x162ab);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 9ea88bd..84a9234 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 _0xe3ec=['update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','/:id'];(function(_0x12e2aa,_0xf562ea){var _0x5c0010=function(_0x34dc7b){while(--_0x34dc7b){_0x12e2aa['push'](_0x12e2aa['shift']());}};_0x5c0010(++_0xf562ea);}(_0xe3ec,0x1d8));var _0xce3e=function(_0x4aa48b,_0x2b464c){_0x4aa48b=_0x4aa48b-0x0;var _0x296fc0=_0xe3ec[_0x4aa48b];return _0x296fc0;};'use strict';var multer=require(_0xce3e('0x0'));var util=require(_0xce3e('0x1'));var path=require(_0xce3e('0x2'));var timeout=require(_0xce3e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xce3e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xce3e('0x5'));var config=require(_0xce3e('0x6'));var controller=require(_0xce3e('0x7'));router[_0xce3e('0x8')]('/:id',auth[_0xce3e('0x9')](),controller[_0xce3e('0xa')]);router[_0xce3e('0xb')]('/',auth['isAuthenticated'](),controller[_0xce3e('0xc')]);router['put'](_0xce3e('0xd'),auth[_0xce3e('0x9')](),controller[_0xce3e('0xe')]);router[_0xce3e('0xf')](_0xce3e('0xd'),auth[_0xce3e('0x9')](),controller[_0xce3e('0x10')]);module[_0xce3e('0x11')]=router; \ No newline at end of file +var _0xed3d=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x431a69,_0x50fbd8){var _0x369e8d=function(_0x3fc070){while(--_0x3fc070){_0x431a69['push'](_0x431a69['shift']());}};_0x369e8d(++_0x50fbd8);}(_0xed3d,0x193));var _0xded3=function(_0x539f0f,_0x229e94){_0x539f0f=_0x539f0f-0x0;var _0x1225bd=_0xed3d[_0x539f0f];return _0x1225bd;};'use strict';var multer=require(_0xded3('0x0'));var util=require(_0xded3('0x1'));var path=require(_0xded3('0x2'));var timeout=require(_0xded3('0x3'));var express=require(_0xded3('0x4'));var router=express[_0xded3('0x5')]();var fs_extra=require(_0xded3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xded3('0x7'));var controller=require(_0xded3('0x8'));router[_0xded3('0x9')](_0xded3('0xa'),auth[_0xded3('0xb')](),controller[_0xded3('0xc')]);router[_0xded3('0xd')]('/',auth['isAuthenticated'](),controller[_0xded3('0xe')]);router[_0xded3('0xf')](_0xded3('0xa'),auth[_0xded3('0xb')](),controller['update']);router[_0xded3('0x10')]('/:id',auth[_0xded3('0xb')](),controller[_0xded3('0x11')]);module[_0xded3('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 3d69cfd..42c807e 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 _0xf1c1=['exports','first','second','third'];(function(_0x137471,_0x139485){var _0x31091e=function(_0xcb621a){while(--_0xcb621a){_0x137471['push'](_0x137471['shift']());}};_0x31091e(++_0x139485);}(_0xf1c1,0x1ec));var _0x1f1c=function(_0x5865ce,_0x26dc3e){_0x5865ce=_0x5865ce-0x0;var _0x28fa6e=_0xf1c1[_0x5865ce];return _0x28fa6e;};'use strict';var Sequelize=require('sequelize');module[_0x1f1c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x1f1c('0x1'),_0x1f1c('0x2'),_0x1f1c('0x3')),'allowNull':![],'defaultValue':_0x1f1c('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1781=['first','second','third','sequelize','exports','STRING','ENUM'];(function(_0x256973,_0x3cdbd4){var _0x4bf1d8=function(_0x4b6fb6){while(--_0x4b6fb6){_0x256973['push'](_0x256973['shift']());}};_0x4bf1d8(++_0x3cdbd4);}(_0x1781,0x15a));var _0x1178=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1781[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x1178('0x0'));module[_0x1178('0x1')]={'name':{'type':Sequelize[_0x1178('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x1178('0x3')](_0x1178('0x4'),_0x1178('0x5'),_0x1178('0x6')),'allowNull':![],'defaultValue':_0x1178('0x4')},'description':{'type':Sequelize[_0x1178('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0b3c8ad..8ce42e0 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 _0x9fe9=['util','to-csv','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','get','Dispositions','sendStatus','error','stack','name','send','Disposition','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','show','params','length','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x4513df,_0x4aa378){var _0x14b805=function(_0x1247ed){while(--_0x1247ed){_0x4513df['push'](_0x4513df['shift']());}};_0x14b805(++_0x4aa378);}(_0x9fe9,0x184));var _0x99fe=function(_0x24a66a,_0xba9d6f){_0x24a66a=_0x24a66a-0x0;var _0x19a92e=_0x9fe9[_0x24a66a];return _0x19a92e;};'use strict';var emlformat=require(_0x99fe('0x0'));var rimraf=require(_0x99fe('0x1'));var zipdir=require(_0x99fe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99fe('0x3'));var moment=require(_0x99fe('0x4'));var BPromise=require(_0x99fe('0x5'));var Mustache=require(_0x99fe('0x6'));var util=require(_0x99fe('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x99fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x99fe('0x9'));var _=require('lodash');var squel=require(_0x99fe('0xa'));var crypto=require('crypto');var jsforce=require(_0x99fe('0xb'));var deskjs=require(_0x99fe('0xc'));var toCsv=require(_0x99fe('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99fe('0xd'));var authService=require(_0x99fe('0xe'));var qs=require(_0x99fe('0xf'));var as=require(_0x99fe('0x10'));var hardwareService=require(_0x99fe('0x11'));var logger=require(_0x99fe('0x12'))(_0x99fe('0x13'));var utils=require('../../config/utils');var config=require(_0x99fe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x99fe('0x15'))['db'];function respondWithStatusCode(_0x1e068f,_0xdb75f8){_0xdb75f8=_0xdb75f8||0xcc;return function(_0x5c6a74){if(_0x5c6a74){return _0x1e068f['sendStatus'](_0xdb75f8);}return _0x1e068f[_0x99fe('0x16')](_0xdb75f8)[_0x99fe('0x17')]();};}function respondWithResult(_0x1a4334,_0x5406ba){_0x5406ba=_0x5406ba||0xc8;return function(_0xf3da54){if(_0xf3da54){return _0x1a4334[_0x99fe('0x16')](_0x5406ba)['json'](_0xf3da54);}};}function respondWithFilteredResult(_0x524f91,_0x5e7b1e){return function(_0x278f5a){if(_0x278f5a){var _0x826faf=typeof _0x5e7b1e[_0x99fe('0x18')]===_0x99fe('0x19')&&typeof _0x5e7b1e[_0x99fe('0x1a')]===_0x99fe('0x19');var _0x5997ae=_0x278f5a[_0x99fe('0x1b')];var _0x33b0ca=_0x826faf?0x0:_0x5e7b1e[_0x99fe('0x18')];var _0x36d0e3=_0x826faf?_0x278f5a['count']:_0x5e7b1e[_0x99fe('0x18')]+_0x5e7b1e['limit'];var _0x208e18;if(_0x36d0e3>=_0x5997ae){_0x36d0e3=_0x5997ae;_0x208e18=0xc8;}else{_0x208e18=0xce;}_0x524f91[_0x99fe('0x16')](_0x208e18);return _0x524f91['set'](_0x99fe('0x1c'),_0x33b0ca+'-'+_0x36d0e3+'/'+_0x5997ae)[_0x99fe('0x1d')](_0x278f5a);}return null;};}function patchUpdates(_0x52809a){return function(_0x61d09){try{jsonpatch[_0x99fe('0x1e')](_0x61d09,_0x52809a,!![]);}catch(_0x3ce087){return BPromise[_0x99fe('0x1f')](_0x3ce087);}return _0x61d09[_0x99fe('0x20')]();};}function saveUpdates(_0x1f11b3,_0x48e737){return function(_0x38aa50){if(_0x38aa50){return _0x38aa50['update'](_0x1f11b3)[_0x99fe('0x21')](function(_0x4fd975){return _0x4fd975;});}return null;};}function removeEntity(_0x45b726,_0x3c80cd){return function(_0x582f46){if(_0x582f46){return _0x582f46[_0x99fe('0x22')]()[_0x99fe('0x21')](function(){var _0x540e3e=_0x582f46[_0x99fe('0x23')]({'plain':!![]});var _0x2ef31b=_0x99fe('0x24');return db['UserProfileResource'][_0x99fe('0x22')]({'where':{'type':_0x2ef31b,'resourceId':_0x540e3e['id']}})[_0x99fe('0x21')](function(){return _0x582f46;});})[_0x99fe('0x21')](function(){_0x45b726[_0x99fe('0x16')](0xcc)[_0x99fe('0x17')]();});}};}function handleEntityNotFound(_0x859f54,_0x39337){return function(_0x2de3db){if(!_0x2de3db){_0x859f54[_0x99fe('0x25')](0x194);}return _0x2de3db;};}function handleError(_0x2e906a,_0x196133){_0x196133=_0x196133||0x1f4;return function(_0x559998){logger[_0x99fe('0x26')](_0x559998[_0x99fe('0x27')]);if(_0x559998[_0x99fe('0x28')]){delete _0x559998[_0x99fe('0x28')];}_0x2e906a['status'](_0x196133)[_0x99fe('0x29')](_0x559998);};}exports['index']=function(_0x4f84f7,_0x422505){var _0x3e58bc={},_0x47d848={},_0xc446b={'count':0x0,'rows':[]};var _0x16eace=_['map'](db[_0x99fe('0x2a')][_0x99fe('0x2b')],function(_0x55028c){return{'name':_0x55028c[_0x99fe('0x2c')],'type':_0x55028c[_0x99fe('0x2d')][_0x99fe('0x2e')]};});_0x47d848[_0x99fe('0x2f')]=_[_0x99fe('0x30')](_0x16eace,'name');_0x47d848['query']=_[_0x99fe('0x31')](_0x4f84f7[_0x99fe('0x32')]);_0x47d848[_0x99fe('0x33')]=_['intersection'](_0x47d848[_0x99fe('0x2f')],_0x47d848[_0x99fe('0x32')]);_0x3e58bc[_0x99fe('0x34')]=_[_0x99fe('0x35')](_0x47d848[_0x99fe('0x2f')],qs[_0x99fe('0x36')](_0x4f84f7[_0x99fe('0x32')][_0x99fe('0x36')]));_0x3e58bc[_0x99fe('0x34')]=_0x3e58bc[_0x99fe('0x34')]['length']?_0x3e58bc[_0x99fe('0x34')]:_0x47d848[_0x99fe('0x2f')];if(!_0x4f84f7['query'][_0x99fe('0x37')]('nolimit')){_0x3e58bc[_0x99fe('0x1a')]=qs[_0x99fe('0x1a')](_0x4f84f7[_0x99fe('0x32')][_0x99fe('0x1a')]);_0x3e58bc['offset']=qs['offset'](_0x4f84f7['query'][_0x99fe('0x18')]);}_0x3e58bc['order']=qs[_0x99fe('0x38')](_0x4f84f7['query'][_0x99fe('0x38')]);_0x3e58bc[_0x99fe('0x39')]=qs[_0x99fe('0x33')](_[_0x99fe('0x3a')](_0x4f84f7['query'],_0x47d848['filters']),_0x16eace);if(_0x4f84f7['query'][_0x99fe('0x3b')]){_0x3e58bc[_0x99fe('0x39')]=_[_0x99fe('0x3c')](_0x3e58bc[_0x99fe('0x39')],{'$or':_[_0x99fe('0x30')](_0x16eace,function(_0x2f98a8){if(_0x2f98a8[_0x99fe('0x2d')]!=='VIRTUAL'){var _0x255b5a={};_0x255b5a[_0x2f98a8[_0x99fe('0x28')]]={'$like':'%'+_0x4f84f7[_0x99fe('0x32')][_0x99fe('0x3b')]+'%'};return _0x255b5a;}})});}_0x3e58bc=_[_0x99fe('0x3c')]({},_0x3e58bc,_0x4f84f7[_0x99fe('0x3d')]);var _0x441275={'where':_0x3e58bc[_0x99fe('0x39')]};return db[_0x99fe('0x2a')][_0x99fe('0x1b')](_0x441275)[_0x99fe('0x21')](function(_0x87e240){_0xc446b[_0x99fe('0x1b')]=_0x87e240;if(_0x4f84f7[_0x99fe('0x32')][_0x99fe('0x3e')]){_0x3e58bc['include']=[{'all':!![]}];}return db[_0x99fe('0x2a')]['findAll'](_0x3e58bc);})[_0x99fe('0x21')](function(_0x5ccb17){_0xc446b['rows']=_0x5ccb17;return _0xc446b;})[_0x99fe('0x21')](respondWithFilteredResult(_0x422505,_0x3e58bc))['catch'](handleError(_0x422505,null));};exports[_0x99fe('0x3f')]=function(_0xe79047,_0x42a215){var _0x7065a4={'raw':!![],'where':{'id':_0xe79047[_0x99fe('0x40')]['id']}},_0x32a2de={};_0x32a2de[_0x99fe('0x2f')]=_[_0x99fe('0x31')](db[_0x99fe('0x2a')]['rawAttributes']);_0x32a2de[_0x99fe('0x32')]=_[_0x99fe('0x31')](_0xe79047[_0x99fe('0x32')]);_0x32a2de[_0x99fe('0x33')]=_[_0x99fe('0x35')](_0x32a2de[_0x99fe('0x2f')],_0x32a2de[_0x99fe('0x32')]);_0x7065a4['attributes']=_[_0x99fe('0x35')](_0x32a2de[_0x99fe('0x2f')],qs[_0x99fe('0x36')](_0xe79047[_0x99fe('0x32')]['fields']));_0x7065a4[_0x99fe('0x34')]=_0x7065a4[_0x99fe('0x34')][_0x99fe('0x41')]?_0x7065a4[_0x99fe('0x34')]:_0x32a2de[_0x99fe('0x2f')];if(_0xe79047['query'][_0x99fe('0x3e')]){_0x7065a4[_0x99fe('0x42')]=[{'all':!![]}];}_0x7065a4=_[_0x99fe('0x3c')]({},_0x7065a4,_0xe79047[_0x99fe('0x3d')]);return db[_0x99fe('0x2a')][_0x99fe('0x43')](_0x7065a4)['then'](handleEntityNotFound(_0x42a215,null))[_0x99fe('0x21')](respondWithResult(_0x42a215,null))[_0x99fe('0x44')](handleError(_0x42a215,null));};exports['create']=function(_0x13778f,_0x435f74){return db[_0x99fe('0x2a')][_0x99fe('0x45')](_0x13778f[_0x99fe('0x46')],{})['then'](function(_0x582ece){var _0x41866b=_0x13778f['user'][_0x99fe('0x23')]({'plain':!![]});if(!_0x41866b)throw new Error(_0x99fe('0x47'));if(_0x41866b[_0x99fe('0x48')]===_0x99fe('0x49')){var _0x187a42=_0x582ece[_0x99fe('0x23')]({'plain':!![]});var _0x1ab168='Dispositions';return db[_0x99fe('0x4a')]['find']({'where':{'name':_0x1ab168,'userProfileId':_0x41866b['userProfileId']},'raw':!![]})[_0x99fe('0x21')](function(_0x4c672f){if(_0x4c672f&&_0x4c672f[_0x99fe('0x4b')]===0x0){return db[_0x99fe('0x4c')]['create']({'name':_0x187a42[_0x99fe('0x28')],'resourceId':_0x187a42['id'],'type':_0x4c672f[_0x99fe('0x28')],'sectionId':_0x4c672f['id']},{})[_0x99fe('0x21')](function(){return _0x582ece;});}else{return _0x582ece;}})[_0x99fe('0x44')](function(_0x3045df){logger[_0x99fe('0x26')](_0x99fe('0x4d'),_0x3045df);throw _0x3045df;});}return _0x582ece;})['then'](respondWithResult(_0x435f74,0xc9))[_0x99fe('0x44')](handleError(_0x435f74,null));};exports[_0x99fe('0x4e')]=function(_0x184ec0,_0x185ddd){if(_0x184ec0[_0x99fe('0x46')]['id']){delete _0x184ec0[_0x99fe('0x46')]['id'];}return db[_0x99fe('0x2a')]['find']({'where':{'id':_0x184ec0['params']['id']}})['then'](handleEntityNotFound(_0x185ddd,null))[_0x99fe('0x21')](saveUpdates(_0x184ec0[_0x99fe('0x46')],null))[_0x99fe('0x21')](respondWithResult(_0x185ddd,null))[_0x99fe('0x44')](handleError(_0x185ddd,null));};exports[_0x99fe('0x22')]=function(_0x2edf28,_0x2fbe16){return db['Disposition'][_0x99fe('0x43')]({'where':{'id':_0x2edf28[_0x99fe('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fbe16,null))[_0x99fe('0x21')](removeEntity(_0x2fbe16,null))[_0x99fe('0x44')](handleError(_0x2fbe16,null));}; \ No newline at end of file +var _0x69f8=['ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','error','stack','name','send','index','Disposition','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x34542c,_0xcf0c7e){var _0x37226b=function(_0x1489e7){while(--_0x1489e7){_0x34542c['push'](_0x34542c['shift']());}};_0x37226b(++_0xcf0c7e);}(_0x69f8,0x14c));var _0x869f=function(_0x439c60,_0x4544a6){_0x439c60=_0x439c60-0x0;var _0x596416=_0x69f8[_0x439c60];return _0x596416;};'use strict';var emlformat=require(_0x869f('0x0'));var rimraf=require(_0x869f('0x1'));var zipdir=require(_0x869f('0x2'));var jsonpatch=require(_0x869f('0x3'));var rp=require(_0x869f('0x4'));var moment=require(_0x869f('0x5'));var BPromise=require(_0x869f('0x6'));var Mustache=require(_0x869f('0x7'));var util=require(_0x869f('0x8'));var path=require(_0x869f('0x9'));var sox=require(_0x869f('0xa'));var csv=require(_0x869f('0xb'));var ejs=require(_0x869f('0xc'));var fs=require('fs');var fs_extra=require(_0x869f('0xd'));var _=require('lodash');var squel=require(_0x869f('0xe'));var crypto=require(_0x869f('0xf'));var jsforce=require(_0x869f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x869f('0x11'));var Papa=require('papaparse');var Redis=require(_0x869f('0x12'));var authService=require(_0x869f('0x13'));var qs=require(_0x869f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x869f('0x15'));var logger=require('../../config/logger')(_0x869f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x869f('0x17'));var db=require(_0x869f('0x18'))['db'];function respondWithStatusCode(_0x1afee7,_0x1d511b){_0x1d511b=_0x1d511b||0xcc;return function(_0x3bdca3){if(_0x3bdca3){return _0x1afee7[_0x869f('0x19')](_0x1d511b);}return _0x1afee7[_0x869f('0x1a')](_0x1d511b)[_0x869f('0x1b')]();};}function respondWithResult(_0x523855,_0x181817){_0x181817=_0x181817||0xc8;return function(_0x23a62b){if(_0x23a62b){return _0x523855[_0x869f('0x1a')](_0x181817)[_0x869f('0x1c')](_0x23a62b);}};}function respondWithFilteredResult(_0x213dca,_0x10ad23){return function(_0x7acd9e){if(_0x7acd9e){var _0x38290e=typeof _0x10ad23[_0x869f('0x1d')]===_0x869f('0x1e')&&typeof _0x10ad23[_0x869f('0x1f')]===_0x869f('0x1e');var _0x21b043=_0x7acd9e[_0x869f('0x20')];var _0x28c0a8=_0x38290e?0x0:_0x10ad23[_0x869f('0x1d')];var _0x1e0d75=_0x38290e?_0x7acd9e[_0x869f('0x20')]:_0x10ad23[_0x869f('0x1d')]+_0x10ad23[_0x869f('0x1f')];var _0x1078d6;if(_0x1e0d75>=_0x21b043){_0x1e0d75=_0x21b043;_0x1078d6=0xc8;}else{_0x1078d6=0xce;}_0x213dca[_0x869f('0x1a')](_0x1078d6);return _0x213dca[_0x869f('0x21')](_0x869f('0x22'),_0x28c0a8+'-'+_0x1e0d75+'/'+_0x21b043)[_0x869f('0x1c')](_0x7acd9e);}return null;};}function patchUpdates(_0x34cff7){return function(_0x5d1e4f){try{jsonpatch['apply'](_0x5d1e4f,_0x34cff7,!![]);}catch(_0x2689ca){return BPromise[_0x869f('0x23')](_0x2689ca);}return _0x5d1e4f[_0x869f('0x24')]();};}function saveUpdates(_0x41e75d,_0x58c941){return function(_0x256e3e){if(_0x256e3e){return _0x256e3e[_0x869f('0x25')](_0x41e75d)[_0x869f('0x26')](function(_0x25e8c4){return _0x25e8c4;});}return null;};}function removeEntity(_0x3a9ea7,_0x3dbdf5){return function(_0x3bf910){if(_0x3bf910){return _0x3bf910[_0x869f('0x27')]()[_0x869f('0x26')](function(){var _0x2ccf57=_0x3bf910[_0x869f('0x28')]({'plain':!![]});var _0x52f06d=_0x869f('0x29');return db['UserProfileResource'][_0x869f('0x27')]({'where':{'type':_0x52f06d,'resourceId':_0x2ccf57['id']}})[_0x869f('0x26')](function(){return _0x3bf910;});})['then'](function(){_0x3a9ea7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3380d2,_0x2361ec){return function(_0x121709){if(!_0x121709){_0x3380d2[_0x869f('0x19')](0x194);}return _0x121709;};}function handleError(_0x44810c,_0x25a039){_0x25a039=_0x25a039||0x1f4;return function(_0x6b475){logger[_0x869f('0x2a')](_0x6b475[_0x869f('0x2b')]);if(_0x6b475[_0x869f('0x2c')]){delete _0x6b475[_0x869f('0x2c')];}_0x44810c['status'](_0x25a039)[_0x869f('0x2d')](_0x6b475);};}exports[_0x869f('0x2e')]=function(_0x2993a4,_0x417720){var _0x61f09b={},_0x4628c0={},_0x2bf8bb={'count':0x0,'rows':[]};var _0x1f9792=_['map'](db[_0x869f('0x2f')]['rawAttributes'],function(_0x41de15){return{'name':_0x41de15[_0x869f('0x30')],'type':_0x41de15[_0x869f('0x31')][_0x869f('0x32')]};});_0x4628c0[_0x869f('0x33')]=_['map'](_0x1f9792,_0x869f('0x2c'));_0x4628c0[_0x869f('0x34')]=_[_0x869f('0x35')](_0x2993a4[_0x869f('0x34')]);_0x4628c0[_0x869f('0x36')]=_[_0x869f('0x37')](_0x4628c0[_0x869f('0x33')],_0x4628c0[_0x869f('0x34')]);_0x61f09b[_0x869f('0x38')]=_[_0x869f('0x37')](_0x4628c0[_0x869f('0x33')],qs[_0x869f('0x39')](_0x2993a4[_0x869f('0x34')]['fields']));_0x61f09b[_0x869f('0x38')]=_0x61f09b[_0x869f('0x38')][_0x869f('0x3a')]?_0x61f09b[_0x869f('0x38')]:_0x4628c0[_0x869f('0x33')];if(!_0x2993a4['query'][_0x869f('0x3b')]('nolimit')){_0x61f09b[_0x869f('0x1f')]=qs[_0x869f('0x1f')](_0x2993a4[_0x869f('0x34')][_0x869f('0x1f')]);_0x61f09b[_0x869f('0x1d')]=qs[_0x869f('0x1d')](_0x2993a4[_0x869f('0x34')][_0x869f('0x1d')]);}_0x61f09b[_0x869f('0x3c')]=qs[_0x869f('0x3d')](_0x2993a4[_0x869f('0x34')][_0x869f('0x3d')]);_0x61f09b[_0x869f('0x3e')]=qs[_0x869f('0x36')](_[_0x869f('0x3f')](_0x2993a4['query'],_0x4628c0[_0x869f('0x36')]),_0x1f9792);if(_0x2993a4['query']['filter']){_0x61f09b[_0x869f('0x3e')]=_[_0x869f('0x40')](_0x61f09b[_0x869f('0x3e')],{'$or':_[_0x869f('0x41')](_0x1f9792,function(_0x577c7a){if(_0x577c7a[_0x869f('0x31')]!==_0x869f('0x42')){var _0x299964={};_0x299964[_0x577c7a[_0x869f('0x2c')]]={'$like':'%'+_0x2993a4[_0x869f('0x34')]['filter']+'%'};return _0x299964;}})});}_0x61f09b=_[_0x869f('0x40')]({},_0x61f09b,_0x2993a4[_0x869f('0x43')]);var _0x4fd91c={'where':_0x61f09b[_0x869f('0x3e')]};return db[_0x869f('0x2f')][_0x869f('0x20')](_0x4fd91c)[_0x869f('0x26')](function(_0x460785){_0x2bf8bb['count']=_0x460785;if(_0x2993a4['query']['includeAll']){_0x61f09b[_0x869f('0x44')]=[{'all':!![]}];}return db[_0x869f('0x2f')][_0x869f('0x45')](_0x61f09b);})[_0x869f('0x26')](function(_0x1245dd){_0x2bf8bb[_0x869f('0x46')]=_0x1245dd;return _0x2bf8bb;})['then'](respondWithFilteredResult(_0x417720,_0x61f09b))['catch'](handleError(_0x417720,null));};exports[_0x869f('0x47')]=function(_0xf6ba4,_0x1b03f9){var _0x2ca1dc={'raw':!![],'where':{'id':_0xf6ba4[_0x869f('0x48')]['id']}},_0x14077c={};_0x14077c[_0x869f('0x33')]=_[_0x869f('0x35')](db['Disposition'][_0x869f('0x49')]);_0x14077c[_0x869f('0x34')]=_['keys'](_0xf6ba4['query']);_0x14077c['filters']=_['intersection'](_0x14077c['model'],_0x14077c[_0x869f('0x34')]);_0x2ca1dc[_0x869f('0x38')]=_[_0x869f('0x37')](_0x14077c[_0x869f('0x33')],qs[_0x869f('0x39')](_0xf6ba4['query'][_0x869f('0x39')]));_0x2ca1dc[_0x869f('0x38')]=_0x2ca1dc[_0x869f('0x38')][_0x869f('0x3a')]?_0x2ca1dc['attributes']:_0x14077c['model'];if(_0xf6ba4[_0x869f('0x34')][_0x869f('0x4a')]){_0x2ca1dc[_0x869f('0x44')]=[{'all':!![]}];}_0x2ca1dc=_['merge']({},_0x2ca1dc,_0xf6ba4[_0x869f('0x43')]);return db['Disposition'][_0x869f('0x4b')](_0x2ca1dc)[_0x869f('0x26')](handleEntityNotFound(_0x1b03f9,null))[_0x869f('0x26')](respondWithResult(_0x1b03f9,null))[_0x869f('0x4c')](handleError(_0x1b03f9,null));};exports[_0x869f('0x4d')]=function(_0x5228c7,_0x19c1d8){return db['Disposition'][_0x869f('0x4d')](_0x5228c7[_0x869f('0x4e')],{})[_0x869f('0x26')](function(_0x3b38b0){var _0x5e5c59=_0x5228c7[_0x869f('0x4f')][_0x869f('0x28')]({'plain':!![]});if(!_0x5e5c59)throw new Error(_0x869f('0x50'));if(_0x5e5c59['role']===_0x869f('0x4f')){var _0x555d9a=_0x3b38b0[_0x869f('0x28')]({'plain':!![]});var _0x3712c4=_0x869f('0x29');return db[_0x869f('0x51')][_0x869f('0x4b')]({'where':{'name':_0x3712c4,'userProfileId':_0x5e5c59[_0x869f('0x52')]},'raw':!![]})[_0x869f('0x26')](function(_0x45bb7e){if(_0x45bb7e&&_0x45bb7e[_0x869f('0x53')]===0x0){return db[_0x869f('0x54')]['create']({'name':_0x555d9a[_0x869f('0x2c')],'resourceId':_0x555d9a['id'],'type':_0x45bb7e[_0x869f('0x2c')],'sectionId':_0x45bb7e['id']},{})['then'](function(){return _0x3b38b0;});}else{return _0x3b38b0;}})[_0x869f('0x4c')](function(_0x59ba43){logger[_0x869f('0x2a')](_0x869f('0x55'),_0x59ba43);throw _0x59ba43;});}return _0x3b38b0;})[_0x869f('0x26')](respondWithResult(_0x19c1d8,0xc9))[_0x869f('0x4c')](handleError(_0x19c1d8,null));};exports[_0x869f('0x25')]=function(_0x2dc888,_0x3c5d03){if(_0x2dc888[_0x869f('0x4e')]['id']){delete _0x2dc888[_0x869f('0x4e')]['id'];}return db[_0x869f('0x2f')][_0x869f('0x4b')]({'where':{'id':_0x2dc888['params']['id']}})[_0x869f('0x26')](handleEntityNotFound(_0x3c5d03,null))[_0x869f('0x26')](saveUpdates(_0x2dc888[_0x869f('0x4e')],null))['then'](respondWithResult(_0x3c5d03,null))['catch'](handleError(_0x3c5d03,null));};exports[_0x869f('0x27')]=function(_0x540825,_0x477773){return db[_0x869f('0x2f')]['find']({'where':{'id':_0x540825['params']['id']}})[_0x869f('0x26')](handleEntityNotFound(_0x477773,null))['then'](removeEntity(_0x477773,null))[_0x869f('0x4c')](handleError(_0x477773,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 2aedc88..2028bdf 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 _0x78cc=['./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x78cc,0x120));var _0xc78c=function(_0x268c52,_0x1c41e3){_0x268c52=_0x268c52-0x0;var _0x933625=_0x78cc[_0x268c52];return _0x933625;};'use strict';var _=require(_0xc78c('0x0'));var util=require(_0xc78c('0x1'));var logger=require(_0xc78c('0x2'))(_0xc78c('0x3'));var moment=require(_0xc78c('0x4'));var BPromise=require(_0xc78c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc78c('0x6'));var rimraf=require(_0xc78c('0x7'));var config=require(_0xc78c('0x8'));var attributes=require(_0xc78c('0x9'));module[_0xc78c('0xa')]=function(_0x40d8e5,_0x401ca9){return _0x40d8e5[_0xc78c('0xb')](_0xc78c('0xc'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xc78c('0xd'),'fields':[_0xc78c('0xe'),_0xc78c('0xf')]},{'unique':!![],'name':_0xc78c('0x10'),'fields':[_0xc78c('0xe'),_0xc78c('0x11')]},{'unique':!![],'name':'name_mail','fields':[_0xc78c('0xe'),_0xc78c('0x12')]},{'unique':!![],'name':_0xc78c('0x13'),'fields':['name',_0xc78c('0x14')]},{'unique':!![],'name':_0xc78c('0x15'),'fields':['name',_0xc78c('0x16')]},{'unique':!![],'name':_0xc78c('0x17'),'fields':[_0xc78c('0xe'),_0xc78c('0x18')]},{'unique':!![],'name':_0xc78c('0x19'),'fields':[_0xc78c('0xe'),_0xc78c('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe45b=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId'];(function(_0x1a4376,_0x3a5355){var _0x36c8d9=function(_0xc1ae2e){while(--_0xc1ae2e){_0x1a4376['push'](_0x1a4376['shift']());}};_0x36c8d9(++_0x3a5355);}(_0xe45b,0x13b));var _0xbe45=function(_0x1a732b,_0x4c52ce){_0x1a732b=_0x1a732b-0x0;var _0xcfdf0d=_0xe45b[_0x1a732b];return _0xcfdf0d;};'use strict';var _=require('lodash');var util=require(_0xbe45('0x0'));var logger=require(_0xbe45('0x1'))(_0xbe45('0x2'));var moment=require('moment');var BPromise=require(_0xbe45('0x3'));var rp=require(_0xbe45('0x4'));var fs=require('fs');var path=require(_0xbe45('0x5'));var rimraf=require('rimraf');var config=require(_0xbe45('0x6'));var attributes=require(_0xbe45('0x7'));module['exports']=function(_0x353866,_0xb9e03b){return _0x353866[_0xbe45('0x8')](_0xbe45('0x9'),attributes,{'tableName':_0xbe45('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0xbe45('0xb')]},{'unique':!![],'name':_0xbe45('0xc'),'fields':[_0xbe45('0xd'),_0xbe45('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xbe45('0xd'),'MailAccountId']},{'unique':!![],'name':_0xbe45('0xf'),'fields':[_0xbe45('0xd'),_0xbe45('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0xbe45('0xd'),_0xbe45('0x11')]},{'unique':!![],'name':_0xbe45('0x12'),'fields':[_0xbe45('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0xbe45('0x13'),'fields':[_0xbe45('0xd'),_0xbe45('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 7ec2646..8ff38fe 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(_0x28a81e,_0x125bc8){var _0x140724=function(_0x4c7e52){while(--_0x4c7e52){_0x28a81e['push'](_0x28a81e['shift']());}};_0x140724(++_0x125bc8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x54bfda,_0x3a2678){var _0x102679=function(_0x1baf1b){while(--_0x1baf1b){_0x54bfda['push'](_0x54bfda['shift']());}};_0x102679(++_0x3a2678);}(_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 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 c85960d..76574e2 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 _0xee8d=['/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','post','create','update','delete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xee8d,0x1ac));var _0xdee8=function(_0x5ae459,_0x173ae5){_0x5ae459=_0x5ae459-0x0;var _0x3ed0d3=_0xee8d[_0x5ae459];return _0x3ed0d3;};'use strict';var multer=require('multer');var util=require(_0xdee8('0x0'));var path=require('path');var timeout=require(_0xdee8('0x1'));var express=require(_0xdee8('0x2'));var router=express[_0xdee8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdee8('0x4'));var interaction=require(_0xdee8('0x5'));var config=require(_0xdee8('0x6'));var controller=require('./disposition.controller');router['get']('/',auth[_0xdee8('0x7')](),controller['index']);router[_0xdee8('0x8')]('/:id',auth[_0xdee8('0x7')](),controller[_0xdee8('0x9')]);router[_0xdee8('0xa')]('/',auth['isAuthenticated'](),controller[_0xdee8('0xb')]);router['put']('/:id',auth[_0xdee8('0x7')](),controller[_0xdee8('0xc')]);router[_0xdee8('0xd')](_0xdee8('0xe'),auth['isAuthenticated'](),controller[_0xdee8('0xf')]);module[_0xdee8('0x10')]=router; \ No newline at end of file +var _0xf53e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x4fd4b1,_0x5bf92a){var _0x589eb5=function(_0x135f2c){while(--_0x135f2c){_0x4fd4b1['push'](_0x4fd4b1['shift']());}};_0x589eb5(++_0x5bf92a);}(_0xf53e,0xce));var _0xef53=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf53e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xef53('0x0'));var util=require(_0xef53('0x1'));var path=require(_0xef53('0x2'));var timeout=require('connect-timeout');var express=require(_0xef53('0x3'));var router=express[_0xef53('0x4')]();var fs_extra=require(_0xef53('0x5'));var auth=require(_0xef53('0x6'));var interaction=require(_0xef53('0x7'));var config=require(_0xef53('0x8'));var controller=require(_0xef53('0x9'));router[_0xef53('0xa')]('/',auth[_0xef53('0xb')](),controller[_0xef53('0xc')]);router['get'](_0xef53('0xd'),auth['isAuthenticated'](),controller[_0xef53('0xe')]);router[_0xef53('0xf')]('/',auth[_0xef53('0xb')](),controller['create']);router[_0xef53('0x10')](_0xef53('0xd'),auth[_0xef53('0xb')](),controller[_0xef53('0x11')]);router[_0xef53('0x12')](_0xef53('0xd'),auth['isAuthenticated'](),controller[_0xef53('0x13')]);module[_0xef53('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index ef7f8a6..28154ff 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 _0x17f5=['localstationid','ENUM','4800','9600','12000','2400','7200','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','exports','STRING','yes','xCALLY\x20Motion\x20Fax'];(function(_0x36d28d,_0x5835cc){var _0x8e9583=function(_0x550114){while(--_0x550114){_0x36d28d['push'](_0x36d28d['shift']());}};_0x8e9583(++_0x5835cc);}(_0x17f5,0xb4));var _0x517f=function(_0x2c7baf,_0x5eb677){_0x2c7baf=_0x2c7baf-0x0;var _0x55ed40=_0x17f5[_0x2c7baf];return _0x55ed40;};'use strict';var Sequelize=require('sequelize');module[_0x517f('0x0')]={'name':{'type':Sequelize[_0x517f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x517f('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x517f('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x517f('0x1')],'defaultValue':_0x517f('0x3')},'localstationid':{'type':Sequelize[_0x517f('0x1')],'unique':_0x517f('0x4')},'minrate':{'type':Sequelize[_0x517f('0x5')]('2400',_0x517f('0x6'),'7200',_0x517f('0x7'),_0x517f('0x8'),'14400'),'defaultValue':_0x517f('0x6')},'maxrate':{'type':Sequelize[_0x517f('0x5')](_0x517f('0x9'),_0x517f('0x6'),_0x517f('0xa'),_0x517f('0x7'),_0x517f('0x8'),_0x517f('0xb')),'defaultValue':_0x517f('0xb')},'modem':{'type':Sequelize[_0x517f('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x517f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x517f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x517f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x517f('0x5')](_0x517f('0xd'),_0x517f('0xe'),_0x517f('0xf'),_0x517f('0x10')),'defaultValue':_0x517f('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x517f('0x11')],'defaultValue':function(){return _0x517f('0x12');}},'notificationSound':{'type':Sequelize[_0x517f('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x517f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x517f('0xc')],'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['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x517f('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x59bc13){if(!_0x59bc13)this[_0x517f('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x517f('0x16'),_0x59bc13);}}}; \ No newline at end of file +var _0xd5b8=['localstationid','2400','7200','9600','12000','14400','4800','DADHI','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','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x28986e,_0x535f7d){var _0x5eb8ef=function(_0x148354){while(--_0x148354){_0x28986e['push'](_0x28986e['shift']());}};_0x5eb8ef(++_0x535f7d);}(_0xd5b8,0xb8));var _0x8d5b=function(_0x61cd27,_0x1bbbc6){_0x61cd27=_0x61cd27-0x0;var _0x33da92=_0xd5b8[_0x61cd27];return _0x33da92;};'use strict';var Sequelize=require('sequelize');module[_0x8d5b('0x0')]={'name':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8d5b('0x1')]},'ecm':{'type':Sequelize[_0x8d5b('0x2')](_0x8d5b('0x3'),'no'),'defaultValue':_0x8d5b('0x3')},'headerinfo':{'type':Sequelize[_0x8d5b('0x1')],'defaultValue':_0x8d5b('0x4')},'localstationid':{'type':Sequelize[_0x8d5b('0x1')],'unique':_0x8d5b('0x5')},'minrate':{'type':Sequelize['ENUM'](_0x8d5b('0x6'),'4800',_0x8d5b('0x7'),_0x8d5b('0x8'),_0x8d5b('0x9'),_0x8d5b('0xa')),'defaultValue':_0x8d5b('0xb')},'maxrate':{'type':Sequelize['ENUM']('2400','4800','7200','9600',_0x8d5b('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x8d5b('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x8d5b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x8d5b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX',_0x8d5b('0xc'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x8d5b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8d5b('0xd')],'defaultValue':function(){return _0x8d5b('0xe');}},'notificationSound':{'type':Sequelize[_0x8d5b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8d5b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8d5b('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8d5b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8d5b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8d5b('0x10')],'allowNull':!![],'defaultValue':null,'comment':_0x8d5b('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x8d5b('0xf')],'defaultValue':![],'comment':_0x8d5b('0x12'),'set':function(_0x2227c9){if(!_0x2227c9)this[_0x8d5b('0x13')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x8d5b('0x14'),_0x2227c9);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index d08349c..64dd622 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 _0xe909=['redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','end','status','json','undefined','limit','count','offset','set','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','fieldName','key','model','filters','intersection','attributes','query','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','includeAll','include','rows','show','Pause','keys','FaxAccount','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','findOne','nolimit','FaxAccountId','removeDispositions','ids','addAnswer','CannedAnswer','rawAttributes','findAll','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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'];(function(_0x5967e6,_0x103c1b){var _0x26706a=function(_0x2944ca){while(--_0x2944ca){_0x5967e6['push'](_0x5967e6['shift']());}};_0x26706a(++_0x103c1b);}(_0xe909,0xad));var _0x9e90=function(_0x110e11,_0x2386fb){_0x110e11=_0x110e11-0x0;var _0x16d509=_0xe909[_0x110e11];return _0x16d509;};'use strict';var emlformat=require(_0x9e90('0x0'));var rimraf=require(_0x9e90('0x1'));var zipdir=require(_0x9e90('0x2'));var jsonpatch=require(_0x9e90('0x3'));var rp=require(_0x9e90('0x4'));var moment=require(_0x9e90('0x5'));var BPromise=require(_0x9e90('0x6'));var Mustache=require(_0x9e90('0x7'));var util=require(_0x9e90('0x8'));var path=require(_0x9e90('0x9'));var sox=require(_0x9e90('0xa'));var csv=require(_0x9e90('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9e90('0xc'));var jsforce=require(_0x9e90('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9e90('0xb'));var querystring=require(_0x9e90('0xe'));var Papa=require(_0x9e90('0xf'));var Redis=require(_0x9e90('0x10'));var authService=require(_0x9e90('0x11'));var qs=require(_0x9e90('0x12'));var as=require(_0x9e90('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e90('0x14'))(_0x9e90('0x15'));var utils=require(_0x9e90('0x16'));var config=require(_0x9e90('0x17'));var licenseUtil=require(_0x9e90('0x18'));var db=require(_0x9e90('0x19'))['db'];config[_0x9e90('0x1a')]=_['defaults'](config['redis'],{'host':_0x9e90('0x1b'),'port':0x18eb});var socket=require(_0x9e90('0x1c'))(new Redis(config[_0x9e90('0x1a')]));require(_0x9e90('0x1d'))[_0x9e90('0x1e')](socket);var jayson=require(_0x9e90('0x1f'));var client=jayson[_0x9e90('0x20')][_0x9e90('0x21')]({'port':0x232c});var client9002=jayson[_0x9e90('0x20')][_0x9e90('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x7cc30b,_0x36bd83,_0x4b548c,_0x1fe617){return new BPromise(function(_0x5896bd,_0x17f5d1){var _0x12daf8=_0x1fe617||client;return _0x12daf8[_0x9e90('0x22')](_0x7cc30b,_0x4b548c)[_0x9e90('0x23')](function(_0x46683d){logger[_0x9e90('0x24')](_0x9e90('0x25'),_0x36bd83,_0x9e90('0x26'));logger[_0x9e90('0x27')](_0x9e90('0x28'),_0x36bd83,_0x9e90('0x26'),JSON[_0x9e90('0x29')](_0x46683d));if(_0x46683d['error']){if(_0x46683d[_0x9e90('0x2a')][_0x9e90('0x2b')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x36bd83,_0x46683d['error']['message']);return _0x17f5d1(_0x46683d[_0x9e90('0x2a')][_0x9e90('0x2c')]);}logger[_0x9e90('0x2a')](_0x9e90('0x25'),_0x36bd83,_0x46683d[_0x9e90('0x2a')][_0x9e90('0x2c')]);return _0x5896bd(_0x46683d[_0x9e90('0x2a')][_0x9e90('0x2c')]);}else{logger[_0x9e90('0x24')](_0x9e90('0x25'),_0x36bd83,_0x9e90('0x26'));_0x5896bd(_0x46683d['result'][_0x9e90('0x2c')]);}})['catch'](function(_0x1425c6){logger[_0x9e90('0x2a')](_0x9e90('0x25'),_0x36bd83,_0x1425c6);_0x17f5d1(_0x1425c6);});});}function respondWithStatusCode(_0x175457,_0x13d262){_0x13d262=_0x13d262||0xcc;return function(_0xf150f3){if(_0xf150f3){return _0x175457[_0x9e90('0x2d')](_0x13d262);}return _0x175457['status'](_0x13d262)[_0x9e90('0x2e')]();};}function respondWithResult(_0x336b95,_0x43be54){_0x43be54=_0x43be54||0xc8;return function(_0x54290a){if(_0x54290a){return _0x336b95[_0x9e90('0x2f')](_0x43be54)[_0x9e90('0x30')](_0x54290a);}};}function respondWithFilteredResult(_0x4533e8,_0x280a58){return function(_0x5e5305){if(_0x5e5305){var _0x1be736=typeof _0x280a58['offset']===_0x9e90('0x31')&&typeof _0x280a58[_0x9e90('0x32')]===_0x9e90('0x31');var _0xa34b13=_0x5e5305[_0x9e90('0x33')];var _0x3be792=_0x1be736?0x0:_0x280a58[_0x9e90('0x34')];var _0x226637=_0x1be736?_0x5e5305[_0x9e90('0x33')]:_0x280a58[_0x9e90('0x34')]+_0x280a58[_0x9e90('0x32')];var _0x1a5c96;if(_0x226637>=_0xa34b13){_0x226637=_0xa34b13;_0x1a5c96=0xc8;}else{_0x1a5c96=0xce;}_0x4533e8['status'](_0x1a5c96);return _0x4533e8[_0x9e90('0x35')]('Content-Range',_0x3be792+'-'+_0x226637+'/'+_0xa34b13)['json'](_0x5e5305);}return null;};}function patchUpdates(_0x431c26){return function(_0x2ab4a7){try{jsonpatch['apply'](_0x2ab4a7,_0x431c26,!![]);}catch(_0x2499c6){return BPromise[_0x9e90('0x36')](_0x2499c6);}return _0x2ab4a7[_0x9e90('0x37')]();};}function saveUpdates(_0x1133c6,_0x55d832){return function(_0x477096){if(_0x477096){return _0x477096[_0x9e90('0x38')](_0x1133c6)[_0x9e90('0x23')](function(_0x94ee7d){return _0x94ee7d;});}return null;};}function removeEntity(_0x336c96,_0x5f37e1){return function(_0xb7abd0){if(_0xb7abd0){return _0xb7abd0[_0x9e90('0x39')]()[_0x9e90('0x23')](function(){var _0x2fc3e6=_0xb7abd0[_0x9e90('0x3a')]({'plain':!![]});var _0x130d84='FaxAccounts';return db[_0x9e90('0x3b')][_0x9e90('0x39')]({'where':{'type':_0x130d84,'resourceId':_0x2fc3e6['id']}})[_0x9e90('0x23')](function(){return _0xb7abd0;});})[_0x9e90('0x23')](function(){_0x336c96[_0x9e90('0x2f')](0xcc)[_0x9e90('0x2e')]();});}};}function handleEntityNotFound(_0x1c5c1c,_0x173f0a){return function(_0x2774eb){if(!_0x2774eb){_0x1c5c1c[_0x9e90('0x2d')](0x194);}return _0x2774eb;};}function handleError(_0x19557d,_0x112dd7){_0x112dd7=_0x112dd7||0x1f4;return function(_0x204960){logger['error'](_0x204960[_0x9e90('0x3c')]);if(_0x204960[_0x9e90('0x3d')]){delete _0x204960[_0x9e90('0x3d')];}_0x19557d['status'](_0x112dd7)[_0x9e90('0x3e')](_0x204960);};}exports[_0x9e90('0x3f')]=function(_0x1fbf4d,_0xa43126){var _0x4fa6f0={'include':[{'model':db['Pause'],'as':_0x9e90('0x40')}]},_0x4a3b9d={},_0x15f076={'count':0x0,'rows':[]};var _0xf09fd7=_[_0x9e90('0x41')](db['FaxAccount']['rawAttributes'],function(_0xa2078f){return{'name':_0xa2078f[_0x9e90('0x42')],'type':_0xa2078f['type'][_0x9e90('0x43')]};});_0x4a3b9d[_0x9e90('0x44')]=_[_0x9e90('0x41')](_0xf09fd7,_0x9e90('0x3d'));_0x4a3b9d['query']=_['keys'](_0x1fbf4d['query']);_0x4a3b9d[_0x9e90('0x45')]=_[_0x9e90('0x46')](_0x4a3b9d[_0x9e90('0x44')],_0x4a3b9d['query']);_0x4fa6f0[_0x9e90('0x47')]=_[_0x9e90('0x46')](_0x4a3b9d[_0x9e90('0x44')],qs['fields'](_0x1fbf4d[_0x9e90('0x48')][_0x9e90('0x49')]));_0x4fa6f0[_0x9e90('0x47')]=_0x4fa6f0[_0x9e90('0x47')][_0x9e90('0x4a')]?_0x4fa6f0[_0x9e90('0x47')]:_0x4a3b9d['model'];if(!_0x1fbf4d['query'][_0x9e90('0x4b')]('nolimit')){_0x4fa6f0['limit']=qs[_0x9e90('0x32')](_0x1fbf4d[_0x9e90('0x48')][_0x9e90('0x32')]);_0x4fa6f0[_0x9e90('0x34')]=qs[_0x9e90('0x34')](_0x1fbf4d[_0x9e90('0x48')][_0x9e90('0x34')]);}_0x4fa6f0[_0x9e90('0x4c')]=qs[_0x9e90('0x4d')](_0x1fbf4d[_0x9e90('0x48')][_0x9e90('0x4d')]);_0x4fa6f0[_0x9e90('0x4e')]=qs[_0x9e90('0x45')](_[_0x9e90('0x4f')](_0x1fbf4d[_0x9e90('0x48')],_0x4a3b9d[_0x9e90('0x45')]),_0xf09fd7);if(_0x1fbf4d[_0x9e90('0x48')][_0x9e90('0x50')]){_0x4fa6f0['where']=_['merge'](_0x4fa6f0['where'],{'$or':_['map'](_0xf09fd7,function(_0x4092e7){if(_0x4092e7[_0x9e90('0x51')]!=='VIRTUAL'){var _0x32ea3b={};_0x32ea3b[_0x4092e7[_0x9e90('0x3d')]]={'$like':'%'+_0x1fbf4d['query']['filter']+'%'};return _0x32ea3b;}})});}_0x4fa6f0=_[_0x9e90('0x52')]({},_0x4fa6f0,_0x1fbf4d['options']);var _0x5f59e3={'where':_0x4fa6f0[_0x9e90('0x4e')]};return db['FaxAccount']['count'](_0x5f59e3)[_0x9e90('0x23')](function(_0x366ecf){_0x15f076[_0x9e90('0x33')]=_0x366ecf;if(_0x1fbf4d[_0x9e90('0x48')][_0x9e90('0x53')]){_0x4fa6f0[_0x9e90('0x54')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x4fa6f0);})[_0x9e90('0x23')](function(_0x5d79f3){_0x15f076[_0x9e90('0x55')]=_0x5d79f3;return _0x15f076;})[_0x9e90('0x23')](respondWithFilteredResult(_0xa43126,_0x4fa6f0))['catch'](handleError(_0xa43126,null));};exports[_0x9e90('0x56')]=function(_0x268959,_0x453ab5){var _0x3f1a37={'raw':![],'where':{'id':_0x268959['params']['id']},'include':[{'model':db[_0x9e90('0x57')],'as':_0x9e90('0x40')}]},_0x11fc98={};_0x11fc98[_0x9e90('0x44')]=_[_0x9e90('0x58')](db[_0x9e90('0x59')]['rawAttributes']);_0x11fc98[_0x9e90('0x48')]=_[_0x9e90('0x58')](_0x268959['query']);_0x11fc98[_0x9e90('0x45')]=_['intersection'](_0x11fc98[_0x9e90('0x44')],_0x11fc98[_0x9e90('0x48')]);_0x3f1a37[_0x9e90('0x47')]=_[_0x9e90('0x46')](_0x11fc98[_0x9e90('0x44')],qs[_0x9e90('0x49')](_0x268959[_0x9e90('0x48')][_0x9e90('0x49')]));_0x3f1a37[_0x9e90('0x47')]=_0x3f1a37[_0x9e90('0x47')][_0x9e90('0x4a')]?_0x3f1a37[_0x9e90('0x47')]:_0x11fc98[_0x9e90('0x44')];if(_0x268959[_0x9e90('0x48')][_0x9e90('0x53')]){_0x3f1a37[_0x9e90('0x54')]=[{'all':!![]}];}_0x3f1a37=_['merge']({},_0x3f1a37,_0x268959[_0x9e90('0x5a')]);return db[_0x9e90('0x59')]['find'](_0x3f1a37)['then'](handleEntityNotFound(_0x453ab5,null))['then'](respondWithResult(_0x453ab5,null))[_0x9e90('0x5b')](handleError(_0x453ab5,null));};exports[_0x9e90('0x5c')]=function(_0x3a98da,_0x2e6aa5){return db[_0x9e90('0x59')]['create'](_0x3a98da['body'],{})[_0x9e90('0x23')](function(_0x223360){var _0x515f36=_0x3a98da[_0x9e90('0x5d')][_0x9e90('0x3a')]({'plain':!![]});if(!_0x515f36)throw new Error(_0x9e90('0x5e'));if(_0x515f36['role']===_0x9e90('0x5d')){var _0x3acf68=_0x223360[_0x9e90('0x3a')]({'plain':!![]});var _0x3379a3=_0x9e90('0x5f');return db[_0x9e90('0x60')][_0x9e90('0x61')]({'where':{'name':_0x3379a3,'userProfileId':_0x515f36[_0x9e90('0x62')]},'raw':!![]})[_0x9e90('0x23')](function(_0x4ac9d6){if(_0x4ac9d6&&_0x4ac9d6[_0x9e90('0x63')]===0x0){return db[_0x9e90('0x3b')][_0x9e90('0x5c')]({'name':_0x3acf68[_0x9e90('0x3d')],'resourceId':_0x3acf68['id'],'type':_0x4ac9d6[_0x9e90('0x3d')],'sectionId':_0x4ac9d6['id']},{})[_0x9e90('0x23')](function(){return _0x223360;});}else{return _0x223360;}})[_0x9e90('0x5b')](function(_0x43186d){logger[_0x9e90('0x2a')](_0x9e90('0x64'),_0x43186d);throw _0x43186d;});}return _0x223360;})[_0x9e90('0x23')](respondWithResult(_0x2e6aa5,0xc9))[_0x9e90('0x5b')](handleError(_0x2e6aa5,null));};exports[_0x9e90('0x38')]=function(_0x1b853e,_0x588085){if(_0x1b853e[_0x9e90('0x65')]['id']){delete _0x1b853e[_0x9e90('0x65')]['id'];}return db[_0x9e90('0x59')][_0x9e90('0x61')]({'where':{'id':_0x1b853e[_0x9e90('0x66')]['id']},'include':[{'model':db['Pause'],'as':_0x9e90('0x40')}]})[_0x9e90('0x23')](handleEntityNotFound(_0x588085,null))['then'](saveUpdates(_0x1b853e[_0x9e90('0x65')],null))[_0x9e90('0x23')](respondWithResult(_0x588085,null))[_0x9e90('0x5b')](handleError(_0x588085,null));};exports['destroy']=function(_0x5b3b3c,_0x39dbce){return db[_0x9e90('0x59')]['find']({'where':{'id':_0x5b3b3c['params']['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x39dbce,null))[_0x9e90('0x23')](removeEntity(_0x39dbce,null))[_0x9e90('0x5b')](handleError(_0x39dbce,null));};exports['describe']=function(_0x15acf7,_0xe67ac7){return db[_0x9e90('0x59')][_0x9e90('0x67')]()[_0x9e90('0x23')](respondWithResult(_0xe67ac7,null))[_0x9e90('0x5b')](handleError(_0xe67ac7,null));};exports[_0x9e90('0x68')]=function(_0x466ed9,_0x40b3a3,_0x2df810){if(_0x466ed9[_0x9e90('0x65')]['id']){delete _0x466ed9['body']['id'];}return db[_0x9e90('0x59')]['find']({'where':{'id':_0x466ed9[_0x9e90('0x66')]['id']}})['then'](handleEntityNotFound(_0x40b3a3,null))[_0x9e90('0x23')](function(_0x42e8a4){if(_0x42e8a4){_0x466ed9[_0x9e90('0x65')]['FaxAccountId']=_0x42e8a4['id'];return db[_0x9e90('0x69')][_0x9e90('0x5c')](_0x466ed9[_0x9e90('0x65')]);}})['then'](respondWithResult(_0x40b3a3,null))[_0x9e90('0x5b')](handleError(_0x40b3a3,null));};exports['getDispositions']=function(_0x542504,_0x223f84,_0x28ed69){var _0x3e7c03={'raw':![],'where':{}};var _0xe6d572={};var _0x165165={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9e90('0x6a')]({'where':{'id':_0x542504[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x223f84,null))['then'](function(_0x2aa548){if(_0x2aa548){_0xe6d572[_0x9e90('0x44')]=_[_0x9e90('0x58')](db['Disposition']['rawAttributes']);_0xe6d572['query']=_[_0x9e90('0x58')](_0x542504[_0x9e90('0x48')]);_0xe6d572[_0x9e90('0x45')]=_[_0x9e90('0x46')](_0xe6d572[_0x9e90('0x44')],_0xe6d572['query']);_0x3e7c03[_0x9e90('0x47')]=_[_0x9e90('0x46')](_0xe6d572[_0x9e90('0x44')],qs[_0x9e90('0x49')](_0x542504[_0x9e90('0x48')][_0x9e90('0x49')]));_0x3e7c03['attributes']=_0x3e7c03['attributes']['length']?_0x3e7c03[_0x9e90('0x47')]:_0xe6d572[_0x9e90('0x44')];if(!_0x542504[_0x9e90('0x48')][_0x9e90('0x4b')](_0x9e90('0x6b'))){_0x3e7c03[_0x9e90('0x32')]=qs[_0x9e90('0x32')](_0x542504[_0x9e90('0x48')][_0x9e90('0x32')]);_0x3e7c03['offset']=qs[_0x9e90('0x34')](_0x542504['query'][_0x9e90('0x34')]);}_0x3e7c03['order']=qs[_0x9e90('0x4d')](_0x542504[_0x9e90('0x48')][_0x9e90('0x4d')]);_0x3e7c03[_0x9e90('0x4e')]=qs[_0x9e90('0x45')](_[_0x9e90('0x4f')](_0x542504[_0x9e90('0x48')],_0xe6d572[_0x9e90('0x45')]));_0x3e7c03[_0x9e90('0x4e')][_0x9e90('0x6c')]=_0x2aa548['id'];if(_0x542504['query']['filter']){_0x3e7c03[_0x9e90('0x4e')]=_['merge'](_0x3e7c03['where'],{'$or':_[_0x9e90('0x41')](_0x3e7c03[_0x9e90('0x47')],function(_0x760f1c){var _0x129f96={};_0x129f96[_0x760f1c]={'$like':'%'+_0x542504[_0x9e90('0x48')][_0x9e90('0x50')]+'%'};return _0x129f96;})});}_0x3e7c03=_[_0x9e90('0x52')]({},_0x3e7c03,_0x542504[_0x9e90('0x5a')]);return db[_0x9e90('0x69')][_0x9e90('0x33')]({'where':_0x3e7c03['where']})[_0x9e90('0x23')](function(_0xd0a244){_0x165165[_0x9e90('0x33')]=_0xd0a244;if(_0x542504['query'][_0x9e90('0x53')]){_0x3e7c03[_0x9e90('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3e7c03);})['then'](function(_0x5175a2){_0x165165[_0x9e90('0x55')]=_0x5175a2;return _0x165165;});}})[_0x9e90('0x23')](respondWithFilteredResult(_0x223f84,_0x3e7c03))[_0x9e90('0x5b')](handleError(_0x223f84,null));};exports[_0x9e90('0x6d')]=function(_0x20fb2c,_0x3c4eeb,_0x3264cc){return db['FaxAccount'][_0x9e90('0x61')]({'where':{'id':_0x20fb2c[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x3c4eeb,null))[_0x9e90('0x23')](function(_0x3ea3e7){if(_0x3ea3e7){return _0x3ea3e7[_0x9e90('0x6d')](_0x20fb2c[_0x9e90('0x48')][_0x9e90('0x6e')]);}})[_0x9e90('0x23')](respondWithStatusCode(_0x3c4eeb,null))['catch'](handleError(_0x3c4eeb,null));};exports[_0x9e90('0x6f')]=function(_0x4a01d4,_0x3806e1,_0x31e228){if(_0x4a01d4[_0x9e90('0x65')]['id']){delete _0x4a01d4[_0x9e90('0x65')]['id'];}return db[_0x9e90('0x59')][_0x9e90('0x61')]({'where':{'id':_0x4a01d4[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x3806e1,null))[_0x9e90('0x23')](function(_0xf52dc2){if(_0xf52dc2){_0x4a01d4['body'][_0x9e90('0x6c')]=_0xf52dc2['id'];return db['CannedAnswer'][_0x9e90('0x5c')](_0x4a01d4['body']);}})[_0x9e90('0x23')](respondWithResult(_0x3806e1,null))[_0x9e90('0x5b')](handleError(_0x3806e1,null));};exports['getAnswers']=function(_0x58393d,_0x4ff4e3,_0x285252){var _0x2207a8={'raw':![],'where':{}};var _0x434fa8={};var _0xda951={'count':0x0,'rows':[]};return db[_0x9e90('0x59')]['findOne']({'where':{'id':_0x58393d[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x4ff4e3,null))[_0x9e90('0x23')](function(_0x3617bc){if(_0x3617bc){_0x434fa8['model']=_[_0x9e90('0x58')](db[_0x9e90('0x70')][_0x9e90('0x71')]);_0x434fa8[_0x9e90('0x48')]=_[_0x9e90('0x58')](_0x58393d[_0x9e90('0x48')]);_0x434fa8['filters']=_['intersection'](_0x434fa8[_0x9e90('0x44')],_0x434fa8[_0x9e90('0x48')]);_0x2207a8[_0x9e90('0x47')]=_['intersection'](_0x434fa8[_0x9e90('0x44')],qs[_0x9e90('0x49')](_0x58393d[_0x9e90('0x48')]['fields']));_0x2207a8['attributes']=_0x2207a8['attributes'][_0x9e90('0x4a')]?_0x2207a8[_0x9e90('0x47')]:_0x434fa8[_0x9e90('0x44')];if(!_0x58393d[_0x9e90('0x48')][_0x9e90('0x4b')](_0x9e90('0x6b'))){_0x2207a8[_0x9e90('0x32')]=qs[_0x9e90('0x32')](_0x58393d[_0x9e90('0x48')][_0x9e90('0x32')]);_0x2207a8[_0x9e90('0x34')]=qs[_0x9e90('0x34')](_0x58393d[_0x9e90('0x48')]['offset']);}_0x2207a8[_0x9e90('0x4c')]=qs['sort'](_0x58393d[_0x9e90('0x48')][_0x9e90('0x4d')]);_0x2207a8[_0x9e90('0x4e')]=qs[_0x9e90('0x45')](_['pick'](_0x58393d['query'],_0x434fa8[_0x9e90('0x45')]));_0x2207a8[_0x9e90('0x4e')][_0x9e90('0x6c')]=_0x3617bc['id'];if(_0x58393d[_0x9e90('0x48')][_0x9e90('0x50')]){_0x2207a8[_0x9e90('0x4e')]=_[_0x9e90('0x52')](_0x2207a8[_0x9e90('0x4e')],{'$or':_[_0x9e90('0x41')](_0x2207a8[_0x9e90('0x47')],function(_0x3f901e){var _0x5002db={};_0x5002db[_0x3f901e]={'$like':'%'+_0x58393d['query'][_0x9e90('0x50')]+'%'};return _0x5002db;})});}_0x2207a8=_[_0x9e90('0x52')]({},_0x2207a8,_0x58393d[_0x9e90('0x5a')]);return db[_0x9e90('0x70')][_0x9e90('0x33')]({'where':_0x2207a8[_0x9e90('0x4e')]})[_0x9e90('0x23')](function(_0x24b5f8){_0xda951[_0x9e90('0x33')]=_0x24b5f8;if(_0x58393d['query'][_0x9e90('0x53')]){_0x2207a8[_0x9e90('0x54')]=[{'all':!![]}];}return db[_0x9e90('0x70')][_0x9e90('0x72')](_0x2207a8);})[_0x9e90('0x23')](function(_0x46fa12){_0xda951[_0x9e90('0x55')]=_0x46fa12;return _0xda951;});}})[_0x9e90('0x23')](respondWithFilteredResult(_0x4ff4e3,_0x2207a8))[_0x9e90('0x5b')](handleError(_0x4ff4e3,null));};exports[_0x9e90('0x73')]=function(_0xaba57c,_0xa7d1e4,_0x5f1863){return db[_0x9e90('0x59')][_0x9e90('0x61')]({'where':{'id':_0xaba57c[_0x9e90('0x66')]['id']}})['then'](handleEntityNotFound(_0xa7d1e4,null))[_0x9e90('0x23')](function(_0x57326f){if(_0x57326f){return _0x57326f['removeAnswers'](_0xaba57c[_0x9e90('0x48')]['ids']);}})['then'](respondWithStatusCode(_0xa7d1e4,null))[_0x9e90('0x5b')](handleError(_0xa7d1e4,null));};exports['addInteraction']=function(_0x5eb34d,_0x4fe66d,_0x2f42e0){return db['FaxInteraction'][_0x9e90('0x61')]({'where':{'id':_0x5eb34d[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x4fe66d,null))[_0x9e90('0x23')](function(_0x1ed909){if(_0x1ed909){return _0x1ed909[_0x9e90('0x74')](_0x5eb34d['body']['ids'],_[_0x9e90('0x75')](_0x5eb34d[_0x9e90('0x65')],[_0x9e90('0x6e'),'id'])||{});}})['then'](respondWithResult(_0x4fe66d,null))[_0x9e90('0x5b')](handleError(_0x4fe66d,null));};exports[_0x9e90('0x76')]=function(_0x5c2989,_0xc698b7,_0x5dd8b4){var _0x3297db={'raw':![],'where':{}};var _0x515e2d={};var _0xccc567={'count':0x0,'rows':[]};return db[_0x9e90('0x59')][_0x9e90('0x6a')]({'where':{'id':_0x5c2989[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0xc698b7,null))[_0x9e90('0x23')](function(_0x2689ae){if(_0x2689ae){_0x515e2d[_0x9e90('0x44')]=_[_0x9e90('0x58')](db[_0x9e90('0x77')][_0x9e90('0x71')]);_0x515e2d[_0x9e90('0x48')]=_['keys'](_0x5c2989[_0x9e90('0x48')]);_0x515e2d[_0x9e90('0x45')]=_['intersection'](_0x515e2d['model'],_0x515e2d[_0x9e90('0x48')]);_0x3297db['attributes']=_['intersection'](_0x515e2d[_0x9e90('0x44')],qs['fields'](_0x5c2989['query'][_0x9e90('0x49')]));_0x3297db[_0x9e90('0x47')]=_0x3297db[_0x9e90('0x47')][_0x9e90('0x4a')]?_0x3297db[_0x9e90('0x47')]:_0x515e2d['model'];if(!_0x5c2989['query'][_0x9e90('0x4b')](_0x9e90('0x6b'))){_0x3297db['limit']=qs[_0x9e90('0x32')](_0x5c2989[_0x9e90('0x48')]['limit']);_0x3297db[_0x9e90('0x34')]=qs[_0x9e90('0x34')](_0x5c2989[_0x9e90('0x48')]['offset']);}_0x3297db['order']=qs[_0x9e90('0x4d')](_0x5c2989[_0x9e90('0x48')]['sort']);_0x3297db[_0x9e90('0x4e')]=qs['filters'](_[_0x9e90('0x4f')](_0x5c2989[_0x9e90('0x48')],_0x515e2d[_0x9e90('0x45')]));_0x3297db['where'][_0x9e90('0x6c')]=_0x2689ae['id'];if(_0x5c2989['query'][_0x9e90('0x50')]){_0x3297db[_0x9e90('0x4e')]=_[_0x9e90('0x52')](_0x3297db[_0x9e90('0x4e')],{'$or':_[_0x9e90('0x41')](_0x3297db[_0x9e90('0x47')],function(_0x24aef0){var _0x342e4d={};_0x342e4d[_0x24aef0]={'$like':'%'+_0x5c2989[_0x9e90('0x48')]['filter']+'%'};return _0x342e4d;})});}_0x3297db=_['merge']({},_0x3297db,_0x5c2989[_0x9e90('0x5a')]);return db['FaxInteraction'][_0x9e90('0x33')]({'where':_0x3297db[_0x9e90('0x4e')]})[_0x9e90('0x23')](function(_0x5b352f){_0xccc567[_0x9e90('0x33')]=_0x5b352f;if(_0x5c2989['query'][_0x9e90('0x53')]){_0x3297db[_0x9e90('0x54')]=[{'model':db['CmContact'],'as':_0x9e90('0x78'),'required':![]},{'model':db[_0x9e90('0x79')],'as':_0x9e90('0x7a'),'attributes':[_0x9e90('0x3d'),_0x9e90('0x7b'),_0x9e90('0x7c')],'required':![]},{'model':db[_0x9e90('0x7d')],'as':'Tags','attributes':['id',_0x9e90('0x3d'),_0x9e90('0x7e')],'where':_0x5c2989[_0x9e90('0x48')][_0x9e90('0x7f')]?{'id':_0x5c2989[_0x9e90('0x48')][_0x9e90('0x7f')]}:undefined,'required':_0x5c2989[_0x9e90('0x48')][_0x9e90('0x7f')]?!![]:![]}];}return db['FaxInteraction'][_0x9e90('0x72')](_0x3297db);})[_0x9e90('0x23')](function(_0x7182fb){_0xccc567[_0x9e90('0x55')]=_0x7182fb;return _0xccc567;});}})[_0x9e90('0x23')](respondWithFilteredResult(_0xc698b7,_0x3297db))[_0x9e90('0x5b')](handleError(_0xc698b7,null));};exports[_0x9e90('0x80')]=function(_0x44ef9e,_0xcd0e4e,_0x365460){return db['FaxAccount'][_0x9e90('0x6a')]({'where':{'id':_0x44ef9e[_0x9e90('0x66')]['id']}})['then'](handleEntityNotFound(_0xcd0e4e,null))[_0x9e90('0x23')](function(_0x2849e5){if(_0x2849e5){return db[_0x9e90('0x81')][_0x9e90('0x82')](function(_0x443a14){return db[_0x9e90('0x83')][_0x9e90('0x39')]({'where':{'FaxAccountId':_0x44ef9e[_0x9e90('0x66')]['id']},'transaction':_0x443a14})[_0x9e90('0x23')](function(_0x2c7187){var _0x5f4217=_['map'](_0x44ef9e[_0x9e90('0x65')],function(_0xd6ea67){_0xd6ea67[_0x9e90('0x6c')]=_0x44ef9e['params']['id'];return _0xd6ea67;});return db[_0x9e90('0x83')][_0x9e90('0x84')](_0x5f4217,{'transaction':_0x443a14});});})['then'](function(){return db[_0x9e90('0x83')][_0x9e90('0x85')]({'where':{'FaxAccountId':_0x44ef9e[_0x9e90('0x66')]['id']},'order':_0x9e90('0x86')});});}})[_0x9e90('0x23')](respondWithResult(_0xcd0e4e,null))[_0x9e90('0x5b')](handleError(_0xcd0e4e,null));};exports[_0x9e90('0x87')]=function(_0x2cf96f,_0x4de084,_0x4977c7){var _0x2d10fa={};var _0x398a18={};var _0x4ead3a;var _0x431c4b;return db[_0x9e90('0x59')][_0x9e90('0x6a')]({'where':{'id':_0x2cf96f[_0x9e90('0x66')]['id']}})['then'](handleEntityNotFound(_0x4de084,null))['then'](function(_0x65756a){if(_0x65756a){_0x4ead3a=_0x65756a;_0x398a18[_0x9e90('0x44')]=_['keys'](db[_0x9e90('0x83')][_0x9e90('0x71')]);_0x398a18[_0x9e90('0x48')]=_[_0x9e90('0x58')](_0x2cf96f['query']);_0x398a18[_0x9e90('0x45')]=_[_0x9e90('0x46')](_0x398a18[_0x9e90('0x44')],_0x398a18['query']);_0x2d10fa[_0x9e90('0x47')]=_[_0x9e90('0x46')](_0x398a18[_0x9e90('0x44')],qs['fields'](_0x2cf96f[_0x9e90('0x48')][_0x9e90('0x49')]));_0x2d10fa[_0x9e90('0x47')]=_0x2d10fa[_0x9e90('0x47')][_0x9e90('0x4a')]?_0x2d10fa[_0x9e90('0x47')]:_0x398a18[_0x9e90('0x44')];_0x2d10fa[_0x9e90('0x4c')]=qs[_0x9e90('0x4d')](_0x2cf96f[_0x9e90('0x48')][_0x9e90('0x4d')]);_0x2d10fa[_0x9e90('0x4e')]=qs['filters'](_[_0x9e90('0x4f')](_0x2cf96f[_0x9e90('0x48')],_0x398a18[_0x9e90('0x45')]));if(_0x2cf96f[_0x9e90('0x48')][_0x9e90('0x50')]){_0x2d10fa[_0x9e90('0x4e')]=_[_0x9e90('0x52')](_0x2d10fa[_0x9e90('0x4e')],{'$or':_[_0x9e90('0x41')](_0x2d10fa['attributes'],function(_0x439091){var _0x233c07={};_0x233c07[_0x439091]={'$like':'%'+_0x2cf96f[_0x9e90('0x48')][_0x9e90('0x50')]+'%'};return _0x233c07;})});}_0x2d10fa=_['merge']({},_0x2d10fa,_0x2cf96f[_0x9e90('0x5a')]);return _0x4ead3a[_0x9e90('0x87')](_0x2d10fa);}})[_0x9e90('0x23')](function(_0x5a88a0){if(_0x5a88a0){_0x431c4b=_0x5a88a0[_0x9e90('0x4a')];if(!_0x2cf96f['query']['hasOwnProperty']('nolimit')){_0x2d10fa['limit']=qs['limit'](_0x2cf96f[_0x9e90('0x48')]['limit']);_0x2d10fa['offset']=qs['offset'](_0x2cf96f['query'][_0x9e90('0x34')]);}return _0x4ead3a['getApplications'](_0x2d10fa);}})[_0x9e90('0x23')](function(_0x5db7d0){if(_0x5db7d0){return _0x5db7d0?{'count':_0x431c4b,'rows':_0x5db7d0}:null;}})[_0x9e90('0x23')](respondWithResult(_0x4de084,null))[_0x9e90('0x5b')](handleError(_0x4de084,null));};function Extension(_0x5a5086,_0x5bfc4e,_0x580419,_0x5e73ba){this[_0x9e90('0x88')]=_0x9e90('0x89');this[_0x9e90('0x8a')]=_0x5a5086[_0x9e90('0x8b')];this[_0x9e90('0x8c')]=_0x5e73ba;this[_0x9e90('0x51')]=_0x9e90('0x8d');this['description']=_0x9e90('0x8e');this['FaxAccountId']=_0x5a5086['id'];this[_0x9e90('0x86')]=_0x5bfc4e;this[_0x9e90('0x8f')]=_0x580419;}function createExtensionsReciveFax(_0x1bcbc4){var _0x29fe46=0x1;var _0x5e7060=[];_0x5e7060[_0x9e90('0x90')](new Extension(_0x1bcbc4,_0x29fe46,'','Answer'));_0x29fe46+=0x1;_0x5e7060[_0x9e90('0x90')](new Extension(_0x1bcbc4,_0x29fe46,_0x9e90('0x91'),_0x9e90('0x92')));_0x29fe46+=0x1;for(var _0xc6d46e in _0x1bcbc4){if(_0x1bcbc4[_0x9e90('0x4b')](_0xc6d46e)&&(_0xc6d46e===_0x9e90('0x93')||_0xc6d46e===_0x9e90('0x8b')||_0xc6d46e===_0x9e90('0x94')||_0xc6d46e===_0x9e90('0x95')||_0xc6d46e==='headerinfo'||_0xc6d46e===_0x9e90('0x96')||_0xc6d46e==='minrate'||_0xc6d46e===_0x9e90('0x97')||_0xc6d46e===_0x9e90('0x98'))){_0x5e7060[_0x9e90('0x90')](new Extension(_0x1bcbc4,_0x29fe46,_0x9e90('0x99')+_0xc6d46e+')='+_0x1bcbc4[_0xc6d46e],_0x9e90('0x92')));_0x29fe46+=0x1;}}_0x5e7060[_0x9e90('0x90')](new Extension(_0x1bcbc4,_0x29fe46,'6',_0x9e90('0x9a')));_0x29fe46+=0x1;_0x5e7060['push'](new Extension(_0x1bcbc4,_0x29fe46,'/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',_0x9e90('0x9b')));_0x29fe46=0x0;return _0x5e7060;}exports[_0x9e90('0x9c')]=function(_0x18a7f,_0x36f628,_0x521120){var _0x4be697;return db[_0x9e90('0x81')][_0x9e90('0x82')](function(_0x5619fd){return db[_0x9e90('0x59')][_0x9e90('0x5c')](_0x18a7f[_0x9e90('0x65')],{'transaction':_0x5619fd})[_0x9e90('0x23')](function(_0x387e19){_0x4be697=_0x387e19[_0x9e90('0x3a')]({'plain':!![]});return db[_0x9e90('0x9d')][_0x9e90('0x84')](createExtensionsReciveFax(_0x4be697),{'transaction':_0x5619fd});});})[_0x9e90('0x23')](function(){return _0x4be697;})[_0x9e90('0x23')](respondWithResult(_0x36f628,null))[_0x9e90('0x5b')](handleError(_0x36f628,null));};exports[_0x9e90('0x9e')]=function(_0x1043f6,_0x8d0cd2,_0x385acb){var _0x4aa536;return db[_0x9e90('0x81')][_0x9e90('0x82')](function(_0x2f610c){return db['FaxAccount']['update'](_0x1043f6['body'],{'where':{'id':_0x1043f6[_0x9e90('0x65')]['id']},'transaction':_0x2f610c})['then'](function(_0xfcc3dd){return db[_0x9e90('0x9d')][_0x9e90('0x39')]({'where':{'FaxAccountId':_0x1043f6['body']['id']},'transaction':_0x2f610c})['then'](function(_0x4bc889){return db['VoiceExtension'][_0x9e90('0x84')](createExtensionsReciveFax(_[_0x9e90('0x75')](_0x1043f6['body'],[_0x9e90('0x9f'),_0x9e90('0x43'),_0x9e90('0xa0'),'updatedAt',_0x9e90('0xa1'),_0x9e90('0xa2')])),{'transaction':_0x2f610c});});});})['then'](function(){return db[_0x9e90('0x59')]['findById'](_0x1043f6['body']['id']);})[_0x9e90('0x23')](respondWithResult(_0x8d0cd2,null))[_0x9e90('0x5b')](handleError(_0x8d0cd2,null));};exports[_0x9e90('0xa3')]=function(_0x2a6ed3,_0x5182ed,_0x99c17c){var _0x152a75={'raw':!![],'where':{}};var _0x3f3a69={};var _0x14c234={'count':0x0,'rows':[]};return db[_0x9e90('0x59')][_0x9e90('0x6a')]({'where':{'id':_0x2a6ed3['params']['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x5182ed,null))[_0x9e90('0x23')](function(_0x1defee){if(_0x1defee){_0x3f3a69[_0x9e90('0x44')]=_[_0x9e90('0x58')](db[_0x9e90('0xa4')][_0x9e90('0x71')]);_0x3f3a69[_0x9e90('0x48')]=_['keys'](_0x2a6ed3['query']);_0x3f3a69['filters']=_[_0x9e90('0x46')](_0x3f3a69[_0x9e90('0x44')],_0x3f3a69['query']);_0x152a75[_0x9e90('0x47')]=_[_0x9e90('0x46')](_0x3f3a69[_0x9e90('0x44')],qs[_0x9e90('0x49')](_0x2a6ed3[_0x9e90('0x48')]['fields']));_0x152a75[_0x9e90('0x47')]=_0x152a75[_0x9e90('0x47')][_0x9e90('0x4a')]?_0x152a75[_0x9e90('0x47')]:_0x3f3a69[_0x9e90('0x44')];if(!_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0x4b')](_0x9e90('0x6b'))){_0x152a75[_0x9e90('0x32')]=qs['limit'](_0x2a6ed3[_0x9e90('0x48')]['limit']);_0x152a75[_0x9e90('0x34')]=qs[_0x9e90('0x34')](_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0x34')]);}_0x152a75[_0x9e90('0x4c')]=qs['sort'](_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0x4d')]);_0x152a75[_0x9e90('0x4e')]=qs[_0x9e90('0x45')](_[_0x9e90('0x4f')](_0x2a6ed3[_0x9e90('0x48')],_0x3f3a69[_0x9e90('0x45')]));_0x152a75[_0x9e90('0x4e')]['FaxAccountId']=_0x1defee['id'];if(_0x2a6ed3[_0x9e90('0x48')]['filter']){_0x152a75[_0x9e90('0x4e')]=_[_0x9e90('0x52')](_0x152a75[_0x9e90('0x4e')],{'$or':_[_0x9e90('0x41')](_0x152a75['attributes'],function(_0x29ab2e){var _0x24a194={};_0x24a194[_0x29ab2e]={'$like':'%'+_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0x50')]+'%'};return _0x24a194;})});}if(_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0xa5')]){var _0x26d805=_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0xa5')][_0x9e90('0xa6')](',');var _0xbe3fc2={};_0xbe3fc2[_0x26d805[0x0]]={'$gte':moment(_0x26d805[0x1])[_0x9e90('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x152a75[_0x9e90('0x4e')]=_['merge'](_0x152a75[_0x9e90('0x4e')],_0xbe3fc2);}_0x152a75=_[_0x9e90('0x52')]({},_0x152a75,_0x2a6ed3['options']);return db['FaxMessage']['count']({'where':_0x152a75['where']})['then'](function(_0x592fb3){_0x14c234['count']=_0x592fb3;if(_0x2a6ed3[_0x9e90('0x48')][_0x9e90('0x53')]){_0x152a75[_0x9e90('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x9e90('0x72')](_0x152a75);})['then'](function(_0x9b175e){_0x14c234[_0x9e90('0x55')]=_0x9b175e;return _0x14c234;});}})['then'](respondWithFilteredResult(_0x5182ed,_0x152a75))[_0x9e90('0x5b')](handleError(_0x5182ed,null));};exports[_0x9e90('0x3e')]=function(_0x20fa6f,_0x4b6057,_0x1ca037){var _0x5cbe43,_0x54f6a3={},_0x5baed8;if(_0x20fa6f[_0x9e90('0x65')]['to']){_0x5baed8=_0x20fa6f[_0x9e90('0x65')]['to'][0x0];}return db[_0x9e90('0x59')]['find']({'where':{'id':_0x20fa6f['params']['id']},'include':[{'model':db[_0x9e90('0xa8')],'as':_0x9e90('0xa9'),'include':[{'model':db['CmContact'],'as':_0x9e90('0xaa'),'where':{'fax':_0x5baed8},'limit':0x1,'order':[[_0x9e90('0xab'),_0x9e90('0xac')]]}]}]})['then'](handleEntityNotFound(_0x4b6057,null))['then'](function(_0x3b3ea7){_0x5cbe43=_0x3b3ea7;if(_0x20fa6f['body'][_0x9e90('0xad')]&&_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xad')][_0x9e90('0x4a')]){for(var _0x6fd14a=0x0;_0x6fd14a<_0x20fa6f[_0x9e90('0x65')]['attachments'][_0x9e90('0x4a')];_0x6fd14a+=0x1){_0x20fa6f[_0x9e90('0x65')]['attachments'][_0x6fd14a]={'filename':_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xad')][_0x6fd14a]['name'],'id':_0x20fa6f['body'][_0x9e90('0xad')][_0x6fd14a]['id'],'path':path[_0x9e90('0xae')](config[_0x9e90('0xaf')],_0x9e90('0xb0'),_0x20fa6f[_0x9e90('0x65')]['attachments'][_0x6fd14a][_0x9e90('0xb1')])};}}return respondWithRpcPromise(_0x9e90('0xb2'),'CheckAfterSend',{'FaxAccountId':_[_0x9e90('0xb3')](_0x20fa6f[_0x9e90('0x66')]['id'])?undefined:_0x20fa6f[_0x9e90('0x66')]['id'],'path':_[_0x9e90('0xb3')](_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xad')][0x0][_0x9e90('0x9')])?undefined:_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xad')][0x0][_0x9e90('0x9')],'fax':_[_0x9e90('0xb3')](_0x20fa6f[_0x9e90('0x65')]['to'][0x0])?undefined:_0x20fa6f[_0x9e90('0x65')]['to'][0x0]},client9002);})[_0x9e90('0x23')](function(){if(_0x5cbe43){if(_[_0x9e90('0xb3')](_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xb4')])){_0x20fa6f['body'][_0x9e90('0xb4')]=util[_0x9e90('0xa7')]('\x22%s\x22\x20<%s>',_0x5cbe43['name'],_0x5cbe43[_0x9e90('0xb5')]);}if(_0x5cbe43[_0x9e90('0xa9')]){if(_0x5cbe43[_0x9e90('0xa9')][_0x9e90('0xaa')][_0x9e90('0x4a')]){return _0x5cbe43[_0x9e90('0xa9')][_0x9e90('0xaa')][0x0];}else{return db['CmContact']['create'](_['defaults'](_0x20fa6f['body'],{'firstName':_0x20fa6f[_0x9e90('0x65')]['to'][0x0],'phone':_0x20fa6f[_0x9e90('0x65')]['to'][0x0],'fax':_0x20fa6f[_0x9e90('0x65')]['to'][0x0],'ListId':_0x5cbe43[_0x9e90('0xa2')]}));}}else{throw new Error(_0x9e90('0xb6'));}}else{throw new Error(_0x9e90('0xb7'));}})[_0x9e90('0x23')](function(_0x218049){if(_0x218049){return db['FaxInteraction'][_0x9e90('0x61')]({'where':{'ContactId':_0x218049['id'],'closed':![],'FaxAccountId':_0x5cbe43['id']}})[_0x9e90('0x23')](function(_0x3db5ae){if(_0x3db5ae){return[_0x3db5ae,![]];}return db[_0x9e90('0x77')][_0x9e90('0x5c')]({'UserId':_0x20fa6f[_0x9e90('0x5d')]['id'],'ContactId':_0x218049['id'],'FaxAccountId':_0x5cbe43['id'],'fax':_0x20fa6f['body']['to'][0x0],'firstMsgDirection':_0x9e90('0xb8'),'Messages':[_['merge'](_0x20fa6f[_0x9e90('0x65')],{'read':![],'body':_0x20fa6f[_0x9e90('0x65')]['attachments'][0x0][_0x9e90('0xb9')],'FaxAccountId':_0x5cbe43['id'],'UserId':_0x20fa6f['user']['id'],'ContactId':_0x218049['id'],'AttachmentId':_0x20fa6f['body'][_0x9e90('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x9e90('0xa4')],'as':_0x9e90('0xba')}]})['then'](function(_0x4537be){return[_0x4537be,!![]];});});}else{throw new Error(_0x9e90('0xbb'));}})[_0x9e90('0xbc')](function(_0x32b1ab,_0x4cda95){if(_0x4cda95){return _0x32b1ab;}return db[_0x9e90('0xa4')]['create']({'direction':_0x9e90('0xb8'),'read':![],'body':_0x20fa6f['body'][_0x9e90('0xad')][0x0]['filename'],'FaxAccountId':_0x5cbe43['id'],'FaxInteractionId':_0x32b1ab['id'],'UserId':_0x20fa6f[_0x9e90('0x5d')]['id'],'ContactId':_0x32b1ab['ContactId'],'AttachmentId':_0x20fa6f[_0x9e90('0x65')]['attachments'][0x0]['id']})['then'](function(_0x42565f){_0x32b1ab[_0x9e90('0xbd')][_0x9e90('0xba')]=[];_0x32b1ab[_0x9e90('0xbd')][_0x9e90('0xba')]['push'](_0x42565f[_0x9e90('0xbd')]);return _0x32b1ab;});})[_0x9e90('0x23')](function(_0x599f5c){respondWithRpcPromise(_0x9e90('0xbe'),_0x9e90('0xbe'),{'FaxAccountId':_[_0x9e90('0xb3')](_0x20fa6f[_0x9e90('0x66')]['id'])?undefined:_0x20fa6f[_0x9e90('0x66')]['id'],'path':_['isNil'](_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xad')][0x0][_0x9e90('0x9')])?undefined:_0x20fa6f['body'][_0x9e90('0xad')][0x0][_0x9e90('0x9')],'fax':_[_0x9e90('0xb3')](_0x20fa6f[_0x9e90('0x65')]['to'][0x0])?undefined:_0x20fa6f[_0x9e90('0x65')]['to'][0x0],'AttachmentId':_0x20fa6f[_0x9e90('0x65')][_0x9e90('0xad')][0x0]['id']},client9002)[_0x9e90('0x23')](function(_0x188bf7){logger[_0x9e90('0x24')](_0x9e90('0xbf'),_0x188bf7);})['catch'](function(_0x49a7b4){logger[_0x9e90('0x24')](_0x9e90('0xbf'),_0x49a7b4);});return _0x599f5c;})[_0x9e90('0x23')](respondWithResult(_0x4b6057,null))[_0x9e90('0x5b')](handleError(_0x4b6057,null));};exports[_0x9e90('0xc0')]=function(_0x35623f,_0x490b1c,_0x260a51){return db[_0x9e90('0x59')][_0x9e90('0x61')]({'where':{'id':_0x35623f[_0x9e90('0x66')]['id']}})['then'](handleEntityNotFound(_0x490b1c,null))['then'](function(_0x13ecc7){if(_0x13ecc7){return _0x13ecc7['addAgents'](_0x35623f[_0x9e90('0x65')][_0x9e90('0x6e')],_['omit'](_0x35623f[_0x9e90('0x65')],[_0x9e90('0x6e'),'id'])||{})[_0x9e90('0xbc')](function(_0x546a7f){for(var _0x431810=0x0;_0x431810<_0x35623f[_0x9e90('0x65')]['ids']['length'];_0x431810+=0x1){socket[_0x9e90('0xc1')](_0x9e90('0xc2'),{'UserId':Number(_0x35623f['body']['ids'][_0x431810]),'FaxAccountId':Number(_0x35623f[_0x9e90('0x66')]['id'])});}return _0x546a7f;});}})[_0x9e90('0x23')](respondWithResult(_0x490b1c,null))[_0x9e90('0x5b')](handleError(_0x490b1c,null));};exports[_0x9e90('0xc3')]=function(_0xe3b7a1,_0x3bf149,_0x1b6b96){return db[_0x9e90('0x59')][_0x9e90('0x61')]({'where':{'id':_0xe3b7a1[_0x9e90('0x66')]['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x3bf149,null))[_0x9e90('0x23')](function(_0x40d1a7){if(_0x40d1a7){return _0x40d1a7[_0x9e90('0xc3')](_0xe3b7a1['query'][_0x9e90('0x6e')])[_0x9e90('0x23')](function(){if(_[_0x9e90('0xc4')](_0xe3b7a1[_0x9e90('0x48')]['ids'])){for(var _0x3d36a2=0x0;_0x3d36a2<_0xe3b7a1['query'][_0x9e90('0x6e')]['length'];_0x3d36a2+=0x1){socket[_0x9e90('0xc1')](_0x9e90('0xc5'),{'UserId':Number(_0xe3b7a1[_0x9e90('0x48')][_0x9e90('0x6e')][_0x3d36a2]),'FaxAccountId':Number(_0xe3b7a1[_0x9e90('0x66')]['id'])});}}else{socket['emit'](_0x9e90('0xc5'),{'UserId':Number(_0xe3b7a1[_0x9e90('0x48')][_0x9e90('0x6e')]),'FaxAccountId':Number(_0xe3b7a1[_0x9e90('0x66')]['id'])});}});}})['then'](respondWithStatusCode(_0x3bf149,null))['catch'](handleError(_0x3bf149,null));};exports[_0x9e90('0xc6')]=function(_0x28dfa4,_0x1d76e5,_0x527c89){var _0x4d3d77={};var _0x48a8a5={};var _0x84b3fe;var _0x3fb805;return db[_0x9e90('0x59')]['findOne']({'where':{'id':_0x28dfa4['params']['id']}})[_0x9e90('0x23')](handleEntityNotFound(_0x1d76e5,null))[_0x9e90('0x23')](function(_0x20d671){if(_0x20d671){_0x84b3fe=_0x20d671;_0x48a8a5[_0x9e90('0x44')]=_['keys'](db[_0x9e90('0x79')]['rawAttributes']);_0x48a8a5[_0x9e90('0x48')]=_[_0x9e90('0x58')](_0x28dfa4[_0x9e90('0x48')]);_0x48a8a5['filters']=_[_0x9e90('0x46')](_0x48a8a5['model'],_0x48a8a5[_0x9e90('0x48')]);_0x4d3d77[_0x9e90('0x47')]=_[_0x9e90('0x46')](_0x48a8a5[_0x9e90('0x44')],qs['fields'](_0x28dfa4[_0x9e90('0x48')][_0x9e90('0x49')]));_0x4d3d77[_0x9e90('0x47')]=_0x4d3d77[_0x9e90('0x47')][_0x9e90('0x4a')]?_0x4d3d77['attributes']:_0x48a8a5[_0x9e90('0x44')];_0x4d3d77[_0x9e90('0x4c')]=qs[_0x9e90('0x4d')](_0x28dfa4['query'][_0x9e90('0x4d')]);_0x4d3d77['where']=qs[_0x9e90('0x45')](_[_0x9e90('0x4f')](_0x28dfa4['query'],_0x48a8a5['filters']));if(_0x28dfa4[_0x9e90('0x48')]['filter']){_0x4d3d77[_0x9e90('0x4e')]=_[_0x9e90('0x52')](_0x4d3d77[_0x9e90('0x4e')],{'$or':_[_0x9e90('0x41')](_0x4d3d77[_0x9e90('0x47')],function(_0x34474e){var _0x3dbe25={};_0x3dbe25[_0x34474e]={'$like':'%'+_0x28dfa4[_0x9e90('0x48')][_0x9e90('0x50')]+'%'};return _0x3dbe25;})});}_0x4d3d77=_['merge']({},_0x4d3d77,_0x28dfa4[_0x9e90('0x5a')]);return _0x84b3fe[_0x9e90('0xc6')](_0x4d3d77);}})[_0x9e90('0x23')](function(_0x5be22d){if(_0x5be22d){_0x3fb805=_0x5be22d[_0x9e90('0x4a')];if(!_0x28dfa4[_0x9e90('0x48')][_0x9e90('0x4b')](_0x9e90('0x6b'))){_0x4d3d77[_0x9e90('0x32')]=qs[_0x9e90('0x32')](_0x28dfa4['query'][_0x9e90('0x32')]);_0x4d3d77['offset']=qs['offset'](_0x28dfa4[_0x9e90('0x48')][_0x9e90('0x34')]);}return _0x84b3fe[_0x9e90('0xc6')](_0x4d3d77);}})[_0x9e90('0x23')](function(_0x136412){if(_0x136412){return _0x136412?{'count':_0x3fb805,'rows':_0x136412}:null;}})[_0x9e90('0x23')](respondWithResult(_0x1d76e5,null))[_0x9e90('0x5b')](handleError(_0x1d76e5,null));}; \ No newline at end of file +var _0xdf05=['autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','sort','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','localstationid','faxdetect','maxrate','minrate','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','tech','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','get','FaxAccounts','UserProfileResource','name','send','map','FaxAccount','fieldName','type','key','model','query','filters','intersection','fields','length','hasOwnProperty','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','Pause','mandatoryDispositionPause','keys','rawAttributes','attributes','find','role','user','userProfileId'];(function(_0x2c8671,_0x56778a){var _0x38dc58=function(_0x2e82db){while(--_0x2e82db){_0x2c8671['push'](_0x2c8671['shift']());}};_0x38dc58(++_0x56778a);}(_0xdf05,0x1e2));var _0x5df0=function(_0x381f7f,_0x1321a9){_0x381f7f=_0x381f7f-0x0;var _0xd2ae6d=_0xdf05[_0x381f7f];return _0xd2ae6d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5df0('0x0'));var rp=require('request-promise');var moment=require(_0x5df0('0x1'));var BPromise=require(_0x5df0('0x2'));var Mustache=require(_0x5df0('0x3'));var util=require(_0x5df0('0x4'));var path=require(_0x5df0('0x5'));var sox=require(_0x5df0('0x6'));var csv=require(_0x5df0('0x7'));var ejs=require(_0x5df0('0x8'));var fs=require('fs');var fs_extra=require(_0x5df0('0x9'));var _=require(_0x5df0('0xa'));var squel=require(_0x5df0('0xb'));var crypto=require(_0x5df0('0xc'));var jsforce=require(_0x5df0('0xd'));var deskjs=require(_0x5df0('0xe'));var toCsv=require(_0x5df0('0x7'));var querystring=require(_0x5df0('0xf'));var Papa=require('papaparse');var Redis=require(_0x5df0('0x10'));var authService=require(_0x5df0('0x11'));var qs=require(_0x5df0('0x12'));var as=require(_0x5df0('0x13'));var hardwareService=require(_0x5df0('0x14'));var logger=require(_0x5df0('0x15'))(_0x5df0('0x16'));var utils=require(_0x5df0('0x17'));var config=require(_0x5df0('0x18'));var licenseUtil=require(_0x5df0('0x19'));var db=require(_0x5df0('0x1a'))['db'];config[_0x5df0('0x1b')]=_[_0x5df0('0x1c')](config['redis'],{'host':_0x5df0('0x1d'),'port':0x18eb});var socket=require(_0x5df0('0x1e'))(new Redis(config['redis']));require(_0x5df0('0x1f'))[_0x5df0('0x20')](socket);var jayson=require(_0x5df0('0x21'));var client=jayson[_0x5df0('0x22')]['http']({'port':0x232c});var client9002=jayson['client'][_0x5df0('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x4ec62a,_0x28b817,_0x17737a,_0x43747e){return new BPromise(function(_0x7ef3bf,_0x2f5208){var _0x33d70f=_0x43747e||client;return _0x33d70f['request'](_0x4ec62a,_0x17737a)[_0x5df0('0x24')](function(_0x85629f){logger['info'](_0x5df0('0x25'),_0x28b817,_0x5df0('0x26'));logger['debug'](_0x5df0('0x27'),_0x28b817,'request\x20sent',JSON['stringify'](_0x85629f));if(_0x85629f[_0x5df0('0x28')]){if(_0x85629f['error'][_0x5df0('0x29')]===0x1f4){logger[_0x5df0('0x28')](_0x5df0('0x25'),_0x28b817,_0x85629f[_0x5df0('0x28')][_0x5df0('0x2a')]);return _0x2f5208(_0x85629f[_0x5df0('0x28')][_0x5df0('0x2a')]);}logger[_0x5df0('0x28')](_0x5df0('0x25'),_0x28b817,_0x85629f[_0x5df0('0x28')]['message']);return _0x7ef3bf(_0x85629f[_0x5df0('0x28')]['message']);}else{logger[_0x5df0('0x2b')]('FaxAccount,\x20%s,\x20%s',_0x28b817,_0x5df0('0x26'));_0x7ef3bf(_0x85629f['result'][_0x5df0('0x2a')]);}})[_0x5df0('0x2c')](function(_0x15b519){logger[_0x5df0('0x28')](_0x5df0('0x25'),_0x28b817,_0x15b519);_0x2f5208(_0x15b519);});});}function respondWithStatusCode(_0x5d0ca8,_0x8e6469){_0x8e6469=_0x8e6469||0xcc;return function(_0x47e787){if(_0x47e787){return _0x5d0ca8[_0x5df0('0x2d')](_0x8e6469);}return _0x5d0ca8['status'](_0x8e6469)[_0x5df0('0x2e')]();};}function respondWithResult(_0x1feba3,_0x31b34d){_0x31b34d=_0x31b34d||0xc8;return function(_0x2e3c3d){if(_0x2e3c3d){return _0x1feba3[_0x5df0('0x2f')](_0x31b34d)[_0x5df0('0x30')](_0x2e3c3d);}};}function respondWithFilteredResult(_0x3ff5c5,_0x2f69f8){return function(_0x239c11){if(_0x239c11){var _0x3029fc=typeof _0x2f69f8[_0x5df0('0x31')]===_0x5df0('0x32')&&typeof _0x2f69f8[_0x5df0('0x33')]==='undefined';var _0x334e58=_0x239c11[_0x5df0('0x34')];var _0x21f56b=_0x3029fc?0x0:_0x2f69f8[_0x5df0('0x31')];var _0x4a79bf=_0x3029fc?_0x239c11[_0x5df0('0x34')]:_0x2f69f8[_0x5df0('0x31')]+_0x2f69f8[_0x5df0('0x33')];var _0x1dd1f8;if(_0x4a79bf>=_0x334e58){_0x4a79bf=_0x334e58;_0x1dd1f8=0xc8;}else{_0x1dd1f8=0xce;}_0x3ff5c5['status'](_0x1dd1f8);return _0x3ff5c5['set'](_0x5df0('0x35'),_0x21f56b+'-'+_0x4a79bf+'/'+_0x334e58)[_0x5df0('0x30')](_0x239c11);}return null;};}function patchUpdates(_0x589cef){return function(_0x3e18e7){try{jsonpatch[_0x5df0('0x36')](_0x3e18e7,_0x589cef,!![]);}catch(_0x110bae){return BPromise['reject'](_0x110bae);}return _0x3e18e7[_0x5df0('0x37')]();};}function saveUpdates(_0x327f33,_0x3c02bc){return function(_0x49b502){if(_0x49b502){return _0x49b502['update'](_0x327f33)['then'](function(_0x3d3acb){return _0x3d3acb;});}return null;};}function removeEntity(_0x7728ee,_0x22ea1c){return function(_0x52e5fc){if(_0x52e5fc){return _0x52e5fc[_0x5df0('0x38')]()['then'](function(){var _0x2f7dc3=_0x52e5fc[_0x5df0('0x39')]({'plain':!![]});var _0x17b4c8=_0x5df0('0x3a');return db[_0x5df0('0x3b')][_0x5df0('0x38')]({'where':{'type':_0x17b4c8,'resourceId':_0x2f7dc3['id']}})[_0x5df0('0x24')](function(){return _0x52e5fc;});})['then'](function(){_0x7728ee[_0x5df0('0x2f')](0xcc)[_0x5df0('0x2e')]();});}};}function handleEntityNotFound(_0x153477,_0x923f55){return function(_0x2d91b0){if(!_0x2d91b0){_0x153477['sendStatus'](0x194);}return _0x2d91b0;};}function handleError(_0x39c80c,_0x1ad3ce){_0x1ad3ce=_0x1ad3ce||0x1f4;return function(_0xea0bac){logger[_0x5df0('0x28')](_0xea0bac['stack']);if(_0xea0bac[_0x5df0('0x3c')]){delete _0xea0bac[_0x5df0('0x3c')];}_0x39c80c[_0x5df0('0x2f')](_0x1ad3ce)[_0x5df0('0x3d')](_0xea0bac);};}exports['index']=function(_0x58f99b,_0x7e40d1){var _0x45064b={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5d085a={},_0x2f3173={'count':0x0,'rows':[]};var _0x43ca3f=_[_0x5df0('0x3e')](db[_0x5df0('0x3f')]['rawAttributes'],function(_0x3bc6f9){return{'name':_0x3bc6f9[_0x5df0('0x40')],'type':_0x3bc6f9[_0x5df0('0x41')][_0x5df0('0x42')]};});_0x5d085a[_0x5df0('0x43')]=_['map'](_0x43ca3f,_0x5df0('0x3c'));_0x5d085a[_0x5df0('0x44')]=_['keys'](_0x58f99b[_0x5df0('0x44')]);_0x5d085a[_0x5df0('0x45')]=_[_0x5df0('0x46')](_0x5d085a[_0x5df0('0x43')],_0x5d085a[_0x5df0('0x44')]);_0x45064b['attributes']=_['intersection'](_0x5d085a[_0x5df0('0x43')],qs[_0x5df0('0x47')](_0x58f99b[_0x5df0('0x44')]['fields']));_0x45064b['attributes']=_0x45064b['attributes'][_0x5df0('0x48')]?_0x45064b['attributes']:_0x5d085a[_0x5df0('0x43')];if(!_0x58f99b[_0x5df0('0x44')][_0x5df0('0x49')]('nolimit')){_0x45064b[_0x5df0('0x33')]=qs[_0x5df0('0x33')](_0x58f99b[_0x5df0('0x44')]['limit']);_0x45064b[_0x5df0('0x31')]=qs[_0x5df0('0x31')](_0x58f99b[_0x5df0('0x44')][_0x5df0('0x31')]);}_0x45064b[_0x5df0('0x4a')]=qs['sort'](_0x58f99b[_0x5df0('0x44')]['sort']);_0x45064b['where']=qs['filters'](_[_0x5df0('0x4b')](_0x58f99b[_0x5df0('0x44')],_0x5d085a[_0x5df0('0x45')]),_0x43ca3f);if(_0x58f99b['query'][_0x5df0('0x4c')]){_0x45064b[_0x5df0('0x4d')]=_[_0x5df0('0x4e')](_0x45064b[_0x5df0('0x4d')],{'$or':_[_0x5df0('0x3e')](_0x43ca3f,function(_0x2a82cc){if(_0x2a82cc[_0x5df0('0x41')]!==_0x5df0('0x4f')){var _0x2e0cc3={};_0x2e0cc3[_0x2a82cc[_0x5df0('0x3c')]]={'$like':'%'+_0x58f99b[_0x5df0('0x44')]['filter']+'%'};return _0x2e0cc3;}})});}_0x45064b=_['merge']({},_0x45064b,_0x58f99b[_0x5df0('0x50')]);var _0x3b5df9={'where':_0x45064b[_0x5df0('0x4d')]};return db['FaxAccount']['count'](_0x3b5df9)['then'](function(_0x974163){_0x2f3173[_0x5df0('0x34')]=_0x974163;if(_0x58f99b[_0x5df0('0x44')][_0x5df0('0x51')]){_0x45064b[_0x5df0('0x52')]=[{'all':!![]}];}return db[_0x5df0('0x3f')][_0x5df0('0x53')](_0x45064b);})[_0x5df0('0x24')](function(_0x18dadd){_0x2f3173['rows']=_0x18dadd;return _0x2f3173;})[_0x5df0('0x24')](respondWithFilteredResult(_0x7e40d1,_0x45064b))[_0x5df0('0x2c')](handleError(_0x7e40d1,null));};exports[_0x5df0('0x54')]=function(_0x491a79,_0x5dd841){var _0x3166fe={'raw':![],'where':{'id':_0x491a79['params']['id']},'include':[{'model':db[_0x5df0('0x55')],'as':_0x5df0('0x56')}]},_0x2739c0={};_0x2739c0['model']=_[_0x5df0('0x57')](db[_0x5df0('0x3f')][_0x5df0('0x58')]);_0x2739c0[_0x5df0('0x44')]=_[_0x5df0('0x57')](_0x491a79[_0x5df0('0x44')]);_0x2739c0['filters']=_[_0x5df0('0x46')](_0x2739c0[_0x5df0('0x43')],_0x2739c0[_0x5df0('0x44')]);_0x3166fe[_0x5df0('0x59')]=_[_0x5df0('0x46')](_0x2739c0['model'],qs['fields'](_0x491a79[_0x5df0('0x44')][_0x5df0('0x47')]));_0x3166fe['attributes']=_0x3166fe[_0x5df0('0x59')]['length']?_0x3166fe[_0x5df0('0x59')]:_0x2739c0[_0x5df0('0x43')];if(_0x491a79['query'][_0x5df0('0x51')]){_0x3166fe[_0x5df0('0x52')]=[{'all':!![]}];}_0x3166fe=_[_0x5df0('0x4e')]({},_0x3166fe,_0x491a79[_0x5df0('0x50')]);return db[_0x5df0('0x3f')][_0x5df0('0x5a')](_0x3166fe)[_0x5df0('0x24')](handleEntityNotFound(_0x5dd841,null))[_0x5df0('0x24')](respondWithResult(_0x5dd841,null))[_0x5df0('0x2c')](handleError(_0x5dd841,null));};exports['create']=function(_0x4ac027,_0x37dfdb){return db['FaxAccount']['create'](_0x4ac027['body'],{})[_0x5df0('0x24')](function(_0x5e5c47){var _0xb0ca60=_0x4ac027['user'][_0x5df0('0x39')]({'plain':!![]});if(!_0xb0ca60)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb0ca60[_0x5df0('0x5b')]===_0x5df0('0x5c')){var _0x12b30a=_0x5e5c47[_0x5df0('0x39')]({'plain':!![]});var _0x5410b3='FaxAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x5410b3,'userProfileId':_0xb0ca60[_0x5df0('0x5d')]},'raw':!![]})[_0x5df0('0x24')](function(_0x30f09b){if(_0x30f09b&&_0x30f09b[_0x5df0('0x5e')]===0x0){return db[_0x5df0('0x3b')][_0x5df0('0x5f')]({'name':_0x12b30a[_0x5df0('0x3c')],'resourceId':_0x12b30a['id'],'type':_0x30f09b[_0x5df0('0x3c')],'sectionId':_0x30f09b['id']},{})['then'](function(){return _0x5e5c47;});}else{return _0x5e5c47;}})['catch'](function(_0x1bbb86){logger[_0x5df0('0x28')](_0x5df0('0x60'),_0x1bbb86);throw _0x1bbb86;});}return _0x5e5c47;})[_0x5df0('0x24')](respondWithResult(_0x37dfdb,0xc9))[_0x5df0('0x2c')](handleError(_0x37dfdb,null));};exports[_0x5df0('0x61')]=function(_0x1d5b0e,_0x4ec978){if(_0x1d5b0e['body']['id']){delete _0x1d5b0e[_0x5df0('0x62')]['id'];}return db[_0x5df0('0x3f')][_0x5df0('0x5a')]({'where':{'id':_0x1d5b0e[_0x5df0('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0x5df0('0x56')}]})[_0x5df0('0x24')](handleEntityNotFound(_0x4ec978,null))[_0x5df0('0x24')](saveUpdates(_0x1d5b0e[_0x5df0('0x62')],null))['then'](respondWithResult(_0x4ec978,null))[_0x5df0('0x2c')](handleError(_0x4ec978,null));};exports['destroy']=function(_0x26673b,_0x436fb4){return db[_0x5df0('0x3f')]['find']({'where':{'id':_0x26673b[_0x5df0('0x63')]['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x436fb4,null))[_0x5df0('0x24')](removeEntity(_0x436fb4,null))[_0x5df0('0x2c')](handleError(_0x436fb4,null));};exports[_0x5df0('0x64')]=function(_0x463ccc,_0x587d62){return db[_0x5df0('0x3f')][_0x5df0('0x64')]()[_0x5df0('0x24')](respondWithResult(_0x587d62,null))['catch'](handleError(_0x587d62,null));};exports[_0x5df0('0x65')]=function(_0x128aa1,_0x194cb1,_0x1a18d6){if(_0x128aa1['body']['id']){delete _0x128aa1[_0x5df0('0x62')]['id'];}return db['FaxAccount'][_0x5df0('0x5a')]({'where':{'id':_0x128aa1['params']['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x194cb1,null))[_0x5df0('0x24')](function(_0x592409){if(_0x592409){_0x128aa1[_0x5df0('0x62')][_0x5df0('0x66')]=_0x592409['id'];return db[_0x5df0('0x67')]['create'](_0x128aa1[_0x5df0('0x62')]);}})[_0x5df0('0x24')](respondWithResult(_0x194cb1,null))['catch'](handleError(_0x194cb1,null));};exports[_0x5df0('0x68')]=function(_0x304033,_0x4d887a,_0x2d13e1){var _0x9c54ff={'raw':![],'where':{}};var _0x52ca45={};var _0x15cbd3={'count':0x0,'rows':[]};return db[_0x5df0('0x3f')][_0x5df0('0x69')]({'where':{'id':_0x304033[_0x5df0('0x63')]['id']}})['then'](handleEntityNotFound(_0x4d887a,null))[_0x5df0('0x24')](function(_0x3beb69){if(_0x3beb69){_0x52ca45['model']=_[_0x5df0('0x57')](db[_0x5df0('0x67')][_0x5df0('0x58')]);_0x52ca45[_0x5df0('0x44')]=_[_0x5df0('0x57')](_0x304033[_0x5df0('0x44')]);_0x52ca45[_0x5df0('0x45')]=_[_0x5df0('0x46')](_0x52ca45[_0x5df0('0x43')],_0x52ca45[_0x5df0('0x44')]);_0x9c54ff[_0x5df0('0x59')]=_[_0x5df0('0x46')](_0x52ca45[_0x5df0('0x43')],qs['fields'](_0x304033[_0x5df0('0x44')][_0x5df0('0x47')]));_0x9c54ff[_0x5df0('0x59')]=_0x9c54ff[_0x5df0('0x59')][_0x5df0('0x48')]?_0x9c54ff['attributes']:_0x52ca45[_0x5df0('0x43')];if(!_0x304033[_0x5df0('0x44')][_0x5df0('0x49')](_0x5df0('0x6a'))){_0x9c54ff[_0x5df0('0x33')]=qs[_0x5df0('0x33')](_0x304033['query'][_0x5df0('0x33')]);_0x9c54ff[_0x5df0('0x31')]=qs['offset'](_0x304033[_0x5df0('0x44')]['offset']);}_0x9c54ff[_0x5df0('0x4a')]=qs[_0x5df0('0x6b')](_0x304033[_0x5df0('0x44')][_0x5df0('0x6b')]);_0x9c54ff[_0x5df0('0x4d')]=qs[_0x5df0('0x45')](_[_0x5df0('0x4b')](_0x304033[_0x5df0('0x44')],_0x52ca45['filters']));_0x9c54ff[_0x5df0('0x4d')]['FaxAccountId']=_0x3beb69['id'];if(_0x304033[_0x5df0('0x44')][_0x5df0('0x4c')]){_0x9c54ff[_0x5df0('0x4d')]=_[_0x5df0('0x4e')](_0x9c54ff[_0x5df0('0x4d')],{'$or':_[_0x5df0('0x3e')](_0x9c54ff['attributes'],function(_0x1d65fb){var _0x5d08a3={};_0x5d08a3[_0x1d65fb]={'$like':'%'+_0x304033[_0x5df0('0x44')][_0x5df0('0x4c')]+'%'};return _0x5d08a3;})});}_0x9c54ff=_[_0x5df0('0x4e')]({},_0x9c54ff,_0x304033[_0x5df0('0x50')]);return db[_0x5df0('0x67')][_0x5df0('0x34')]({'where':_0x9c54ff[_0x5df0('0x4d')]})['then'](function(_0x144397){_0x15cbd3[_0x5df0('0x34')]=_0x144397;if(_0x304033['query'][_0x5df0('0x51')]){_0x9c54ff[_0x5df0('0x52')]=[{'all':!![]}];}return db[_0x5df0('0x67')][_0x5df0('0x53')](_0x9c54ff);})[_0x5df0('0x24')](function(_0x56e8db){_0x15cbd3[_0x5df0('0x6c')]=_0x56e8db;return _0x15cbd3;});}})[_0x5df0('0x24')](respondWithFilteredResult(_0x4d887a,_0x9c54ff))[_0x5df0('0x2c')](handleError(_0x4d887a,null));};exports['removeDispositions']=function(_0x2665be,_0x1fa90f,_0x1affda){return db['FaxAccount']['find']({'where':{'id':_0x2665be['params']['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x1fa90f,null))['then'](function(_0x9a46af){if(_0x9a46af){return _0x9a46af[_0x5df0('0x6d')](_0x2665be['query'][_0x5df0('0x6e')]);}})[_0x5df0('0x24')](respondWithStatusCode(_0x1fa90f,null))['catch'](handleError(_0x1fa90f,null));};exports[_0x5df0('0x6f')]=function(_0x2f7897,_0x30e24e,_0x57c9cc){if(_0x2f7897['body']['id']){delete _0x2f7897['body']['id'];}return db[_0x5df0('0x3f')]['find']({'where':{'id':_0x2f7897[_0x5df0('0x63')]['id']}})['then'](handleEntityNotFound(_0x30e24e,null))[_0x5df0('0x24')](function(_0x1fe22e){if(_0x1fe22e){_0x2f7897[_0x5df0('0x62')]['FaxAccountId']=_0x1fe22e['id'];return db[_0x5df0('0x70')][_0x5df0('0x5f')](_0x2f7897['body']);}})[_0x5df0('0x24')](respondWithResult(_0x30e24e,null))[_0x5df0('0x2c')](handleError(_0x30e24e,null));};exports[_0x5df0('0x71')]=function(_0x846755,_0x168fa3,_0x2b467b){var _0x3495eb={'raw':![],'where':{}};var _0x2d5ca0={};var _0x19714b={'count':0x0,'rows':[]};return db[_0x5df0('0x3f')][_0x5df0('0x69')]({'where':{'id':_0x846755[_0x5df0('0x63')]['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x168fa3,null))[_0x5df0('0x24')](function(_0x3ef3bb){if(_0x3ef3bb){_0x2d5ca0[_0x5df0('0x43')]=_['keys'](db[_0x5df0('0x70')][_0x5df0('0x58')]);_0x2d5ca0['query']=_[_0x5df0('0x57')](_0x846755[_0x5df0('0x44')]);_0x2d5ca0[_0x5df0('0x45')]=_[_0x5df0('0x46')](_0x2d5ca0['model'],_0x2d5ca0['query']);_0x3495eb['attributes']=_[_0x5df0('0x46')](_0x2d5ca0[_0x5df0('0x43')],qs[_0x5df0('0x47')](_0x846755[_0x5df0('0x44')][_0x5df0('0x47')]));_0x3495eb['attributes']=_0x3495eb[_0x5df0('0x59')][_0x5df0('0x48')]?_0x3495eb[_0x5df0('0x59')]:_0x2d5ca0[_0x5df0('0x43')];if(!_0x846755['query']['hasOwnProperty'](_0x5df0('0x6a'))){_0x3495eb[_0x5df0('0x33')]=qs[_0x5df0('0x33')](_0x846755[_0x5df0('0x44')][_0x5df0('0x33')]);_0x3495eb['offset']=qs[_0x5df0('0x31')](_0x846755[_0x5df0('0x44')][_0x5df0('0x31')]);}_0x3495eb[_0x5df0('0x4a')]=qs[_0x5df0('0x6b')](_0x846755[_0x5df0('0x44')][_0x5df0('0x6b')]);_0x3495eb[_0x5df0('0x4d')]=qs[_0x5df0('0x45')](_[_0x5df0('0x4b')](_0x846755[_0x5df0('0x44')],_0x2d5ca0['filters']));_0x3495eb['where'][_0x5df0('0x66')]=_0x3ef3bb['id'];if(_0x846755[_0x5df0('0x44')][_0x5df0('0x4c')]){_0x3495eb['where']=_[_0x5df0('0x4e')](_0x3495eb[_0x5df0('0x4d')],{'$or':_[_0x5df0('0x3e')](_0x3495eb[_0x5df0('0x59')],function(_0x4357dd){var _0x396044={};_0x396044[_0x4357dd]={'$like':'%'+_0x846755[_0x5df0('0x44')][_0x5df0('0x4c')]+'%'};return _0x396044;})});}_0x3495eb=_['merge']({},_0x3495eb,_0x846755[_0x5df0('0x50')]);return db[_0x5df0('0x70')][_0x5df0('0x34')]({'where':_0x3495eb[_0x5df0('0x4d')]})[_0x5df0('0x24')](function(_0x2108cf){_0x19714b[_0x5df0('0x34')]=_0x2108cf;if(_0x846755[_0x5df0('0x44')]['includeAll']){_0x3495eb['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3495eb);})[_0x5df0('0x24')](function(_0x3bd726){_0x19714b[_0x5df0('0x6c')]=_0x3bd726;return _0x19714b;});}})[_0x5df0('0x24')](respondWithFilteredResult(_0x168fa3,_0x3495eb))[_0x5df0('0x2c')](handleError(_0x168fa3,null));};exports[_0x5df0('0x72')]=function(_0x3d7524,_0x36529b,_0x91f101){return db[_0x5df0('0x3f')]['find']({'where':{'id':_0x3d7524['params']['id']}})['then'](handleEntityNotFound(_0x36529b,null))[_0x5df0('0x24')](function(_0x35ecda){if(_0x35ecda){return _0x35ecda[_0x5df0('0x72')](_0x3d7524['query'][_0x5df0('0x6e')]);}})[_0x5df0('0x24')](respondWithStatusCode(_0x36529b,null))[_0x5df0('0x2c')](handleError(_0x36529b,null));};exports[_0x5df0('0x73')]=function(_0x212ebc,_0xf1d99a,_0x107822){return db[_0x5df0('0x74')][_0x5df0('0x5a')]({'where':{'id':_0x212ebc['params']['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0xf1d99a,null))[_0x5df0('0x24')](function(_0x1d8505){if(_0x1d8505){return _0x1d8505[_0x5df0('0x73')](_0x212ebc[_0x5df0('0x62')][_0x5df0('0x6e')],_[_0x5df0('0x75')](_0x212ebc[_0x5df0('0x62')],[_0x5df0('0x6e'),'id'])||{});}})[_0x5df0('0x24')](respondWithResult(_0xf1d99a,null))['catch'](handleError(_0xf1d99a,null));};exports[_0x5df0('0x76')]=function(_0x27cfdd,_0x376f09,_0x332411){var _0xbfb396={'raw':![],'where':{}};var _0x42defa={};var _0x44bf49={'count':0x0,'rows':[]};return db[_0x5df0('0x3f')][_0x5df0('0x69')]({'where':{'id':_0x27cfdd[_0x5df0('0x63')]['id']}})['then'](handleEntityNotFound(_0x376f09,null))[_0x5df0('0x24')](function(_0x4aa54f){if(_0x4aa54f){_0x42defa[_0x5df0('0x43')]=_[_0x5df0('0x57')](db['FaxInteraction'][_0x5df0('0x58')]);_0x42defa[_0x5df0('0x44')]=_[_0x5df0('0x57')](_0x27cfdd[_0x5df0('0x44')]);_0x42defa[_0x5df0('0x45')]=_['intersection'](_0x42defa[_0x5df0('0x43')],_0x42defa[_0x5df0('0x44')]);_0xbfb396[_0x5df0('0x59')]=_['intersection'](_0x42defa[_0x5df0('0x43')],qs['fields'](_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x47')]));_0xbfb396[_0x5df0('0x59')]=_0xbfb396[_0x5df0('0x59')]['length']?_0xbfb396['attributes']:_0x42defa[_0x5df0('0x43')];if(!_0x27cfdd['query'][_0x5df0('0x49')](_0x5df0('0x6a'))){_0xbfb396[_0x5df0('0x33')]=qs['limit'](_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x33')]);_0xbfb396[_0x5df0('0x31')]=qs[_0x5df0('0x31')](_0x27cfdd[_0x5df0('0x44')]['offset']);}_0xbfb396[_0x5df0('0x4a')]=qs[_0x5df0('0x6b')](_0x27cfdd['query'][_0x5df0('0x6b')]);_0xbfb396['where']=qs[_0x5df0('0x45')](_['pick'](_0x27cfdd[_0x5df0('0x44')],_0x42defa['filters']));_0xbfb396[_0x5df0('0x4d')][_0x5df0('0x66')]=_0x4aa54f['id'];if(_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x4c')]){_0xbfb396[_0x5df0('0x4d')]=_[_0x5df0('0x4e')](_0xbfb396[_0x5df0('0x4d')],{'$or':_['map'](_0xbfb396[_0x5df0('0x59')],function(_0x485921){var _0x1439a8={};_0x1439a8[_0x485921]={'$like':'%'+_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x4c')]+'%'};return _0x1439a8;})});}_0xbfb396=_[_0x5df0('0x4e')]({},_0xbfb396,_0x27cfdd[_0x5df0('0x50')]);return db[_0x5df0('0x74')]['count']({'where':_0xbfb396[_0x5df0('0x4d')]})[_0x5df0('0x24')](function(_0x25defe){_0x44bf49['count']=_0x25defe;if(_0x27cfdd['query']['includeAll']){_0xbfb396[_0x5df0('0x52')]=[{'model':db[_0x5df0('0x77')],'as':_0x5df0('0x78'),'required':![]},{'model':db[_0x5df0('0x79')],'as':_0x5df0('0x7a'),'attributes':[_0x5df0('0x3c'),_0x5df0('0x7b'),_0x5df0('0x7c')],'required':![]},{'model':db[_0x5df0('0x7d')],'as':_0x5df0('0x7e'),'attributes':['id',_0x5df0('0x3c'),'color'],'where':_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x7f')]?{'id':_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x7f')]}:undefined,'required':_0x27cfdd[_0x5df0('0x44')][_0x5df0('0x7f')]?!![]:![]}];}return db[_0x5df0('0x74')][_0x5df0('0x53')](_0xbfb396);})['then'](function(_0x4fbe99){_0x44bf49[_0x5df0('0x6c')]=_0x4fbe99;return _0x44bf49;});}})[_0x5df0('0x24')](respondWithFilteredResult(_0x376f09,_0xbfb396))['catch'](handleError(_0x376f09,null));};exports[_0x5df0('0x80')]=function(_0x115554,_0x36ad44,_0x19accb){return db[_0x5df0('0x3f')][_0x5df0('0x69')]({'where':{'id':_0x115554[_0x5df0('0x63')]['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x36ad44,null))[_0x5df0('0x24')](function(_0x53c0e1){if(_0x53c0e1){return db[_0x5df0('0x81')][_0x5df0('0x82')](function(_0x17e9b4){return db[_0x5df0('0x83')][_0x5df0('0x38')]({'where':{'FaxAccountId':_0x115554[_0x5df0('0x63')]['id']},'transaction':_0x17e9b4})['then'](function(_0x3e903b){var _0x15ad56=_[_0x5df0('0x3e')](_0x115554[_0x5df0('0x62')],function(_0x24e2f3){_0x24e2f3[_0x5df0('0x66')]=_0x115554[_0x5df0('0x63')]['id'];return _0x24e2f3;});return db['FaxApplication'][_0x5df0('0x84')](_0x15ad56,{'transaction':_0x17e9b4});});})[_0x5df0('0x24')](function(){return db['FaxApplication'][_0x5df0('0x85')]({'where':{'FaxAccountId':_0x115554[_0x5df0('0x63')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x36ad44,null))[_0x5df0('0x2c')](handleError(_0x36ad44,null));};exports[_0x5df0('0x86')]=function(_0x301466,_0x51b35b,_0x48a0cd){var _0x3a29e8={};var _0x590326={};var _0x31f96e;var _0xbcd68e;return db[_0x5df0('0x3f')][_0x5df0('0x69')]({'where':{'id':_0x301466['params']['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x51b35b,null))[_0x5df0('0x24')](function(_0x9b0775){if(_0x9b0775){_0x31f96e=_0x9b0775;_0x590326[_0x5df0('0x43')]=_[_0x5df0('0x57')](db[_0x5df0('0x83')][_0x5df0('0x58')]);_0x590326[_0x5df0('0x44')]=_[_0x5df0('0x57')](_0x301466[_0x5df0('0x44')]);_0x590326[_0x5df0('0x45')]=_['intersection'](_0x590326[_0x5df0('0x43')],_0x590326[_0x5df0('0x44')]);_0x3a29e8['attributes']=_[_0x5df0('0x46')](_0x590326[_0x5df0('0x43')],qs[_0x5df0('0x47')](_0x301466[_0x5df0('0x44')][_0x5df0('0x47')]));_0x3a29e8['attributes']=_0x3a29e8[_0x5df0('0x59')][_0x5df0('0x48')]?_0x3a29e8[_0x5df0('0x59')]:_0x590326['model'];_0x3a29e8['order']=qs[_0x5df0('0x6b')](_0x301466[_0x5df0('0x44')][_0x5df0('0x6b')]);_0x3a29e8['where']=qs[_0x5df0('0x45')](_['pick'](_0x301466['query'],_0x590326[_0x5df0('0x45')]));if(_0x301466['query'][_0x5df0('0x4c')]){_0x3a29e8[_0x5df0('0x4d')]=_['merge'](_0x3a29e8['where'],{'$or':_[_0x5df0('0x3e')](_0x3a29e8['attributes'],function(_0x7ee3c0){var _0x49c35d={};_0x49c35d[_0x7ee3c0]={'$like':'%'+_0x301466[_0x5df0('0x44')][_0x5df0('0x4c')]+'%'};return _0x49c35d;})});}_0x3a29e8=_[_0x5df0('0x4e')]({},_0x3a29e8,_0x301466[_0x5df0('0x50')]);return _0x31f96e[_0x5df0('0x86')](_0x3a29e8);}})[_0x5df0('0x24')](function(_0x518ed4){if(_0x518ed4){_0xbcd68e=_0x518ed4[_0x5df0('0x48')];if(!_0x301466['query'][_0x5df0('0x49')]('nolimit')){_0x3a29e8[_0x5df0('0x33')]=qs[_0x5df0('0x33')](_0x301466[_0x5df0('0x44')][_0x5df0('0x33')]);_0x3a29e8['offset']=qs[_0x5df0('0x31')](_0x301466[_0x5df0('0x44')][_0x5df0('0x31')]);}return _0x31f96e['getApplications'](_0x3a29e8);}})[_0x5df0('0x24')](function(_0x46bda6){if(_0x46bda6){return _0x46bda6?{'count':_0xbcd68e,'rows':_0x46bda6}:null;}})[_0x5df0('0x24')](respondWithResult(_0x51b35b,null))[_0x5df0('0x2c')](handleError(_0x51b35b,null));};function Extension(_0x31e99c,_0x42c93f,_0x3834ad,_0x29e01d){this[_0x5df0('0x87')]=_0x5df0('0x88');this[_0x5df0('0x89')]=_0x31e99c['localstationid'];this[_0x5df0('0x8a')]=_0x29e01d;this[_0x5df0('0x41')]=_0x5df0('0x8b');this[_0x5df0('0x8c')]=_0x5df0('0x8d');this[_0x5df0('0x66')]=_0x31e99c['id'];this['priority']=_0x42c93f;this['appdata']=_0x3834ad;}function createExtensionsReciveFax(_0x24297a){var _0x4a61aa=0x1;var _0x3e1d3d=[];_0x3e1d3d[_0x5df0('0x8e')](new Extension(_0x24297a,_0x4a61aa,'',_0x5df0('0x8f')));_0x4a61aa+=0x1;_0x3e1d3d[_0x5df0('0x8e')](new Extension(_0x24297a,_0x4a61aa,_0x5df0('0x90'),'Set'));_0x4a61aa+=0x1;for(var _0x5e5c44 in _0x24297a){if(_0x24297a['hasOwnProperty'](_0x5e5c44)&&(_0x5e5c44===_0x5df0('0x91')||_0x5e5c44===_0x5df0('0x92')||_0x5e5c44==='gateway'||_0x5e5c44===_0x5df0('0x93')||_0x5e5c44==='headerinfo'||_0x5e5c44===_0x5df0('0x94')||_0x5e5c44===_0x5df0('0x95')||_0x5e5c44==='modem'||_0x5e5c44==='t38timeout')){_0x3e1d3d['push'](new Extension(_0x24297a,_0x4a61aa,_0x5df0('0x96')+_0x5e5c44+')='+_0x24297a[_0x5e5c44],_0x5df0('0x97')));_0x4a61aa+=0x1;}}_0x3e1d3d[_0x5df0('0x8e')](new Extension(_0x24297a,_0x4a61aa,'6',_0x5df0('0x98')));_0x4a61aa+=0x1;_0x3e1d3d[_0x5df0('0x8e')](new Extension(_0x24297a,_0x4a61aa,_0x5df0('0x99'),_0x5df0('0x9a')));_0x4a61aa=0x0;return _0x3e1d3d;}exports[_0x5df0('0x9b')]=function(_0x214108,_0x14e501,_0x22bae0){var _0x36340d;return db[_0x5df0('0x81')][_0x5df0('0x82')](function(_0x138f7a){return db[_0x5df0('0x3f')][_0x5df0('0x5f')](_0x214108[_0x5df0('0x62')],{'transaction':_0x138f7a})[_0x5df0('0x24')](function(_0x5ec1bf){_0x36340d=_0x5ec1bf[_0x5df0('0x39')]({'plain':!![]});return db['VoiceExtension'][_0x5df0('0x84')](createExtensionsReciveFax(_0x36340d),{'transaction':_0x138f7a});});})['then'](function(){return _0x36340d;})[_0x5df0('0x24')](respondWithResult(_0x14e501,null))[_0x5df0('0x2c')](handleError(_0x14e501,null));};exports['updateAccountApplications']=function(_0x461e5f,_0x3e1b6f,_0x233169){var _0x90aaaa;return db[_0x5df0('0x81')][_0x5df0('0x82')](function(_0x24e3ff){return db[_0x5df0('0x3f')][_0x5df0('0x61')](_0x461e5f[_0x5df0('0x62')],{'where':{'id':_0x461e5f['body']['id']},'transaction':_0x24e3ff})['then'](function(_0x1d11f0){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x461e5f[_0x5df0('0x62')]['id']},'transaction':_0x24e3ff})[_0x5df0('0x24')](function(_0x143a3e){return db['VoiceExtension'][_0x5df0('0x84')](createExtensionsReciveFax(_[_0x5df0('0x75')](_0x461e5f[_0x5df0('0x62')],[_0x5df0('0x9c'),_0x5df0('0x42'),_0x5df0('0x9d'),_0x5df0('0x9e'),_0x5df0('0x9f'),'ListId'])),{'transaction':_0x24e3ff});});});})['then'](function(){return db['FaxAccount']['findById'](_0x461e5f['body']['id']);})[_0x5df0('0x24')](respondWithResult(_0x3e1b6f,null))['catch'](handleError(_0x3e1b6f,null));};exports[_0x5df0('0xa0')]=function(_0x51a50b,_0x21d0c8,_0x16e2f9){var _0x49584f={'raw':!![],'where':{}};var _0x5030be={};var _0xe1d2e2={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5df0('0x69')]({'where':{'id':_0x51a50b[_0x5df0('0x63')]['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x21d0c8,null))[_0x5df0('0x24')](function(_0x337bb2){if(_0x337bb2){_0x5030be['model']=_['keys'](db[_0x5df0('0xa1')][_0x5df0('0x58')]);_0x5030be[_0x5df0('0x44')]=_['keys'](_0x51a50b[_0x5df0('0x44')]);_0x5030be['filters']=_[_0x5df0('0x46')](_0x5030be[_0x5df0('0x43')],_0x5030be[_0x5df0('0x44')]);_0x49584f[_0x5df0('0x59')]=_[_0x5df0('0x46')](_0x5030be['model'],qs[_0x5df0('0x47')](_0x51a50b['query'][_0x5df0('0x47')]));_0x49584f[_0x5df0('0x59')]=_0x49584f['attributes'][_0x5df0('0x48')]?_0x49584f['attributes']:_0x5030be['model'];if(!_0x51a50b[_0x5df0('0x44')][_0x5df0('0x49')](_0x5df0('0x6a'))){_0x49584f[_0x5df0('0x33')]=qs['limit'](_0x51a50b[_0x5df0('0x44')][_0x5df0('0x33')]);_0x49584f['offset']=qs[_0x5df0('0x31')](_0x51a50b[_0x5df0('0x44')][_0x5df0('0x31')]);}_0x49584f[_0x5df0('0x4a')]=qs[_0x5df0('0x6b')](_0x51a50b['query'][_0x5df0('0x6b')]);_0x49584f[_0x5df0('0x4d')]=qs[_0x5df0('0x45')](_[_0x5df0('0x4b')](_0x51a50b[_0x5df0('0x44')],_0x5030be[_0x5df0('0x45')]));_0x49584f[_0x5df0('0x4d')][_0x5df0('0x66')]=_0x337bb2['id'];if(_0x51a50b[_0x5df0('0x44')][_0x5df0('0x4c')]){_0x49584f['where']=_[_0x5df0('0x4e')](_0x49584f['where'],{'$or':_[_0x5df0('0x3e')](_0x49584f[_0x5df0('0x59')],function(_0x4b82d6){var _0x58692a={};_0x58692a[_0x4b82d6]={'$like':'%'+_0x51a50b[_0x5df0('0x44')][_0x5df0('0x4c')]+'%'};return _0x58692a;})});}if(_0x51a50b['query'][_0x5df0('0xa2')]){var _0xfc3a1a=_0x51a50b[_0x5df0('0x44')][_0x5df0('0xa2')]['split'](',');var _0x48671f={};_0x48671f[_0xfc3a1a[0x0]]={'$gte':moment(_0xfc3a1a[0x1])[_0x5df0('0xa3')](_0x5df0('0xa4'))};_0x49584f[_0x5df0('0x4d')]=_[_0x5df0('0x4e')](_0x49584f[_0x5df0('0x4d')],_0x48671f);}_0x49584f=_[_0x5df0('0x4e')]({},_0x49584f,_0x51a50b['options']);return db['FaxMessage'][_0x5df0('0x34')]({'where':_0x49584f[_0x5df0('0x4d')]})[_0x5df0('0x24')](function(_0x2ad81b){_0xe1d2e2[_0x5df0('0x34')]=_0x2ad81b;if(_0x51a50b[_0x5df0('0x44')][_0x5df0('0x51')]){_0x49584f[_0x5df0('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0x5df0('0x53')](_0x49584f);})[_0x5df0('0x24')](function(_0x47e029){_0xe1d2e2['rows']=_0x47e029;return _0xe1d2e2;});}})[_0x5df0('0x24')](respondWithFilteredResult(_0x21d0c8,_0x49584f))[_0x5df0('0x2c')](handleError(_0x21d0c8,null));};exports[_0x5df0('0x3d')]=function(_0x517b77,_0x4a649f,_0x5c9cd3){var _0x406035,_0x166761={},_0x3c6c9b;if(_0x517b77[_0x5df0('0x62')]['to']){_0x3c6c9b=_0x517b77[_0x5df0('0x62')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x517b77[_0x5df0('0x63')]['id']},'include':[{'model':db[_0x5df0('0xa5')],'as':_0x5df0('0xa6'),'include':[{'model':db[_0x5df0('0x77')],'as':_0x5df0('0xa7'),'where':{'fax':_0x3c6c9b},'limit':0x1,'order':[['updatedAt',_0x5df0('0xa8')]]}]}]})[_0x5df0('0x24')](handleEntityNotFound(_0x4a649f,null))[_0x5df0('0x24')](function(_0x45a8e9){_0x406035=_0x45a8e9;if(_0x517b77[_0x5df0('0x62')]['attachments']&&_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][_0x5df0('0x48')]){for(var _0x5bc0c9=0x0;_0x5bc0c9<_0x517b77['body'][_0x5df0('0xa9')][_0x5df0('0x48')];_0x5bc0c9+=0x1){_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][_0x5bc0c9]={'filename':_0x517b77['body'][_0x5df0('0xa9')][_0x5bc0c9][_0x5df0('0x3c')],'id':_0x517b77['body'][_0x5df0('0xa9')][_0x5bc0c9]['id'],'path':path[_0x5df0('0xaa')](config[_0x5df0('0xab')],_0x5df0('0xac'),_0x517b77['body'][_0x5df0('0xa9')][_0x5bc0c9]['basename'])};}}return respondWithRpcPromise(_0x5df0('0xad'),'CheckAfterSend',{'FaxAccountId':_[_0x5df0('0xae')](_0x517b77[_0x5df0('0x63')]['id'])?undefined:_0x517b77[_0x5df0('0x63')]['id'],'path':_[_0x5df0('0xae')](_0x517b77['body'][_0x5df0('0xa9')][0x0][_0x5df0('0x5')])?undefined:_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0][_0x5df0('0x5')],'fax':_[_0x5df0('0xae')](_0x517b77[_0x5df0('0x62')]['to'][0x0])?undefined:_0x517b77['body']['to'][0x0]},client9002);})[_0x5df0('0x24')](function(){if(_0x406035){if(_[_0x5df0('0xae')](_0x517b77[_0x5df0('0x62')]['from'])){_0x517b77[_0x5df0('0x62')][_0x5df0('0xaf')]=util['format']('\x22%s\x22\x20<%s>',_0x406035['name'],_0x406035['fax']);}if(_0x406035[_0x5df0('0xa6')]){if(_0x406035['List'][_0x5df0('0xa7')][_0x5df0('0x48')]){return _0x406035['List'][_0x5df0('0xa7')][0x0];}else{return db[_0x5df0('0x77')][_0x5df0('0x5f')](_[_0x5df0('0x1c')](_0x517b77[_0x5df0('0x62')],{'firstName':_0x517b77[_0x5df0('0x62')]['to'][0x0],'phone':_0x517b77['body']['to'][0x0],'fax':_0x517b77[_0x5df0('0x62')]['to'][0x0],'ListId':_0x406035[_0x5df0('0xb0')]}));}}else{throw new Error(_0x5df0('0xb1'));}}else{throw new Error(_0x5df0('0xb2'));}})['then'](function(_0x2ea21a){if(_0x2ea21a){return db['FaxInteraction']['find']({'where':{'ContactId':_0x2ea21a['id'],'closed':![],'FaxAccountId':_0x406035['id']}})[_0x5df0('0x24')](function(_0x505ac6){if(_0x505ac6){return[_0x505ac6,![]];}return db['FaxInteraction'][_0x5df0('0x5f')]({'UserId':_0x517b77[_0x5df0('0x5c')]['id'],'ContactId':_0x2ea21a['id'],'FaxAccountId':_0x406035['id'],'fax':_0x517b77[_0x5df0('0x62')]['to'][0x0],'firstMsgDirection':_0x5df0('0xb3'),'Messages':[_[_0x5df0('0x4e')](_0x517b77['body'],{'read':![],'body':_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0][_0x5df0('0xb4')],'FaxAccountId':_0x406035['id'],'UserId':_0x517b77[_0x5df0('0x5c')]['id'],'ContactId':_0x2ea21a['id'],'AttachmentId':_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x5df0('0xa1')],'as':_0x5df0('0xb5')}]})[_0x5df0('0x24')](function(_0xffca6){return[_0xffca6,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5df0('0xb6')](function(_0x4552db,_0x729384){if(_0x729384){return _0x4552db;}return db[_0x5df0('0xa1')][_0x5df0('0x5f')]({'direction':'out','read':![],'body':_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0][_0x5df0('0xb4')],'FaxAccountId':_0x406035['id'],'FaxInteractionId':_0x4552db['id'],'UserId':_0x517b77[_0x5df0('0x5c')]['id'],'ContactId':_0x4552db[_0x5df0('0xb7')],'AttachmentId':_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0]['id']})[_0x5df0('0x24')](function(_0x3870ef){_0x4552db[_0x5df0('0xb8')]['Messages']=[];_0x4552db[_0x5df0('0xb8')][_0x5df0('0xb5')][_0x5df0('0x8e')](_0x3870ef[_0x5df0('0xb8')]);return _0x4552db;});})['then'](function(_0x373b8c){respondWithRpcPromise('SendFax',_0x5df0('0xb9'),{'FaxAccountId':_[_0x5df0('0xae')](_0x517b77[_0x5df0('0x63')]['id'])?undefined:_0x517b77[_0x5df0('0x63')]['id'],'path':_['isNil'](_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0][_0x5df0('0x5')])?undefined:_0x517b77[_0x5df0('0x62')]['attachments'][0x0][_0x5df0('0x5')],'fax':_[_0x5df0('0xae')](_0x517b77[_0x5df0('0x62')]['to'][0x0])?undefined:_0x517b77['body']['to'][0x0],'AttachmentId':_0x517b77[_0x5df0('0x62')][_0x5df0('0xa9')][0x0]['id']},client9002)['then'](function(_0x5c45e0){logger[_0x5df0('0x2b')](_0x5df0('0xba'),_0x5c45e0);})[_0x5df0('0x2c')](function(_0x14e344){logger[_0x5df0('0x2b')](_0x5df0('0xba'),_0x14e344);});return _0x373b8c;})[_0x5df0('0x24')](respondWithResult(_0x4a649f,null))[_0x5df0('0x2c')](handleError(_0x4a649f,null));};exports[_0x5df0('0xbb')]=function(_0x27198e,_0x1ebbb1,_0x25d6bb){return db['FaxAccount'][_0x5df0('0x5a')]({'where':{'id':_0x27198e['params']['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x1ebbb1,null))[_0x5df0('0x24')](function(_0x1f9947){if(_0x1f9947){return _0x1f9947['addAgents'](_0x27198e[_0x5df0('0x62')]['ids'],_[_0x5df0('0x75')](_0x27198e[_0x5df0('0x62')],[_0x5df0('0x6e'),'id'])||{})[_0x5df0('0xb6')](function(_0x343db0){for(var _0x171b7a=0x0;_0x171b7a<_0x27198e[_0x5df0('0x62')]['ids'][_0x5df0('0x48')];_0x171b7a+=0x1){socket[_0x5df0('0xbc')]('userFaxAccount:save',{'UserId':Number(_0x27198e[_0x5df0('0x62')][_0x5df0('0x6e')][_0x171b7a]),'FaxAccountId':Number(_0x27198e[_0x5df0('0x63')]['id'])});}return _0x343db0;});}})['then'](respondWithResult(_0x1ebbb1,null))[_0x5df0('0x2c')](handleError(_0x1ebbb1,null));};exports['removeAgents']=function(_0x1c2664,_0x2a71a9,_0x4f2c1b){return db['FaxAccount'][_0x5df0('0x5a')]({'where':{'id':_0x1c2664['params']['id']}})[_0x5df0('0x24')](handleEntityNotFound(_0x2a71a9,null))['then'](function(_0x40be46){if(_0x40be46){return _0x40be46[_0x5df0('0xbd')](_0x1c2664['query'][_0x5df0('0x6e')])['then'](function(){if(_['isArray'](_0x1c2664[_0x5df0('0x44')]['ids'])){for(var _0x126eec=0x0;_0x126eec<_0x1c2664['query'][_0x5df0('0x6e')][_0x5df0('0x48')];_0x126eec+=0x1){socket[_0x5df0('0xbc')](_0x5df0('0xbe'),{'UserId':Number(_0x1c2664['query']['ids'][_0x126eec]),'FaxAccountId':Number(_0x1c2664['params']['id'])});}}else{socket[_0x5df0('0xbc')](_0x5df0('0xbe'),{'UserId':Number(_0x1c2664['query'][_0x5df0('0x6e')]),'FaxAccountId':Number(_0x1c2664[_0x5df0('0x63')]['id'])});}});}})[_0x5df0('0x24')](respondWithStatusCode(_0x2a71a9,null))[_0x5df0('0x2c')](handleError(_0x2a71a9,null));};exports[_0x5df0('0xbf')]=function(_0x5f2164,_0x4bcd6f,_0x55f587){var _0x457262={};var _0x14f691={};var _0x17ee22;var _0x37234a;return db['FaxAccount'][_0x5df0('0x69')]({'where':{'id':_0x5f2164['params']['id']}})['then'](handleEntityNotFound(_0x4bcd6f,null))[_0x5df0('0x24')](function(_0x44ae9e){if(_0x44ae9e){_0x17ee22=_0x44ae9e;_0x14f691['model']=_['keys'](db['User'][_0x5df0('0x58')]);_0x14f691[_0x5df0('0x44')]=_[_0x5df0('0x57')](_0x5f2164[_0x5df0('0x44')]);_0x14f691[_0x5df0('0x45')]=_[_0x5df0('0x46')](_0x14f691['model'],_0x14f691['query']);_0x457262['attributes']=_['intersection'](_0x14f691[_0x5df0('0x43')],qs[_0x5df0('0x47')](_0x5f2164[_0x5df0('0x44')][_0x5df0('0x47')]));_0x457262['attributes']=_0x457262['attributes'][_0x5df0('0x48')]?_0x457262[_0x5df0('0x59')]:_0x14f691[_0x5df0('0x43')];_0x457262['order']=qs[_0x5df0('0x6b')](_0x5f2164[_0x5df0('0x44')][_0x5df0('0x6b')]);_0x457262['where']=qs['filters'](_[_0x5df0('0x4b')](_0x5f2164[_0x5df0('0x44')],_0x14f691[_0x5df0('0x45')]));if(_0x5f2164['query'][_0x5df0('0x4c')]){_0x457262[_0x5df0('0x4d')]=_[_0x5df0('0x4e')](_0x457262['where'],{'$or':_['map'](_0x457262[_0x5df0('0x59')],function(_0x365015){var _0x29a424={};_0x29a424[_0x365015]={'$like':'%'+_0x5f2164[_0x5df0('0x44')][_0x5df0('0x4c')]+'%'};return _0x29a424;})});}_0x457262=_[_0x5df0('0x4e')]({},_0x457262,_0x5f2164[_0x5df0('0x50')]);return _0x17ee22[_0x5df0('0xbf')](_0x457262);}})[_0x5df0('0x24')](function(_0x2dcb38){if(_0x2dcb38){_0x37234a=_0x2dcb38[_0x5df0('0x48')];if(!_0x5f2164[_0x5df0('0x44')][_0x5df0('0x49')](_0x5df0('0x6a'))){_0x457262[_0x5df0('0x33')]=qs[_0x5df0('0x33')](_0x5f2164[_0x5df0('0x44')][_0x5df0('0x33')]);_0x457262[_0x5df0('0x31')]=qs['offset'](_0x5f2164[_0x5df0('0x44')][_0x5df0('0x31')]);}return _0x17ee22[_0x5df0('0xbf')](_0x457262);}})['then'](function(_0x4d96f9){if(_0x4d96f9){return _0x4d96f9?{'count':_0x37234a,'rows':_0x4d96f9}:null;}})[_0x5df0('0x24')](respondWithResult(_0x4bcd6f,null))[_0x5df0('0x2c')](handleError(_0x4bcd6f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index e4abcc2..0fb8e49 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 _0x5fbd=['update','remove','emit','hook','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x197767,_0x400276){var _0x5422c6=function(_0x5eeffd){while(--_0x5eeffd){_0x197767['push'](_0x197767['shift']());}};_0x5422c6(++_0x400276);}(_0x5fbd,0x104));var _0xd5fb=function(_0x5456c1,_0x5ab298){_0x5456c1=_0x5456c1-0x0;var _0x5b55f4=_0x5fbd[_0x5456c1];return _0x5b55f4;};'use strict';var EventEmitter=require(_0xd5fb('0x0'));var FaxAccount=require(_0xd5fb('0x1'))['db'][_0xd5fb('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd5fb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd5fb('0x4'),'afterDestroy':_0xd5fb('0x5')};function emitEvent(_0x507b94){return function(_0x106d6d,_0xb47c45,_0x36ff7d){FaxAccountEvents[_0xd5fb('0x6')](_0x507b94+':'+_0x106d6d['id'],_0x106d6d);FaxAccountEvents['emit'](_0x507b94,_0x106d6d);_0x36ff7d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xd5fb('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xb32f=['events','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x37e66a,_0x54a4ea){var _0x27e5b6=function(_0x5b28ff){while(--_0x5b28ff){_0x37e66a['push'](_0x37e66a['shift']());}};_0x27e5b6(++_0x54a4ea);}(_0xb32f,0x1c2));var _0xfb32=function(_0x4ef003,_0x179794){_0x4ef003=_0x4ef003-0x0;var _0x10d696=_0xb32f[_0x4ef003];return _0x10d696;};'use strict';var EventEmitter=require(_0xfb32('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xfb32('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xfb32('0x2')](0x0);var events={'afterCreate':_0xfb32('0x3'),'afterUpdate':_0xfb32('0x4'),'afterDestroy':_0xfb32('0x5')};function emitEvent(_0x52d11d){return function(_0x3977ce,_0x9f006c,_0x49d1a3){FaxAccountEvents['emit'](_0x52d11d+':'+_0x3977ce['id'],_0x3977ce);FaxAccountEvents[_0xfb32('0x6')](_0x52d11d,_0x3977ce);_0x49d1a3(null);};}for(var e in events){if(events[_0xfb32('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xfb32('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 7959ec4..6f5c03c 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 _0x78d8=['request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x78d8,0x174));var _0x878d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x78d8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x878d('0x0'));var util=require(_0x878d('0x1'));var logger=require(_0x878d('0x2'))(_0x878d('0x3'));var moment=require(_0x878d('0x4'));var BPromise=require(_0x878d('0x5'));var rp=require(_0x878d('0x6'));var fs=require('fs');var path=require(_0x878d('0x7'));var rimraf=require(_0x878d('0x8'));var config=require('../../config/environment');var attributes=require(_0x878d('0x9'));module[_0x878d('0xa')]=function(_0x5ed101,_0x3530eb){return _0x5ed101[_0x878d('0xb')](_0x878d('0xc'),attributes,{'tableName':_0x878d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6784=['define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxAccount.attributes'];(function(_0xdabcaf,_0x1a5a24){var _0x57d70d=function(_0x5c7aad){while(--_0x5c7aad){_0xdabcaf['push'](_0xdabcaf['shift']());}};_0x57d70d(++_0x1a5a24);}(_0x6784,0x19b));var _0x4678=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x6784[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x4678('0x0'));var util=require(_0x4678('0x1'));var logger=require(_0x4678('0x2'))(_0x4678('0x3'));var moment=require(_0x4678('0x4'));var BPromise=require(_0x4678('0x5'));var rp=require(_0x4678('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4678('0x7'));var config=require('../../config/environment');var attributes=require(_0x4678('0x8'));module['exports']=function(_0x15956c,_0x888202){return _0x15956c[_0x4678('0x9')](_0x4678('0xa'),attributes,{'tableName':_0x4678('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 175554a..adf40f2 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 _0x826d=['Sequelize','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','FaxAccount','find','List','Contacts','Applications','applications','list','priority','asc','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','attributes','limit','map','model','include','debug','body','fax','CmContact','ValidationError','keys','updatedAt','createdAt','CompanyId','ListId','isNil'];(function(_0x51e930,_0x5c796c){var _0x243ad6=function(_0x396f29){while(--_0x396f29){_0x51e930['push'](_0x51e930['shift']());}};_0x243ad6(++_0x5c796c);}(_0x826d,0x1c5));var _0xd826=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0x826d[_0x106214];return _0x5f5cea;};'use strict';var _=require(_0xd826('0x0'));var util=require(_0xd826('0x1'));var moment=require(_0xd826('0x2'));var BPromise=require(_0xd826('0x3'));var rs=require(_0xd826('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd826('0x5'))['db'];var utils=require(_0xd826('0x6'));var logger=require('../../config/logger')(_0xd826('0x7'));var config=require(_0xd826('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd826('0x9')][_0xd826('0xa')]({'port':0x232c});config[_0xd826('0xb')]=_[_0xd826('0xc')](config[_0xd826('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd826('0xd'))(new Redis(config['redis']));require(_0xd826('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e88e7,_0x25d248,_0x539225){return new BPromise(function(_0x362c54,_0x3ffd12){return client[_0xd826('0xf')](_0x2e88e7,_0x539225)[_0xd826('0x10')](function(_0x12b8d5){logger[_0xd826('0x11')]('FaxAccount,\x20%s,\x20%s',_0x25d248,_0xd826('0x12'));logger['debug'](_0xd826('0x13'),_0x25d248,_0xd826('0x12'),JSON[_0xd826('0x14')](_0x12b8d5));if(_0x12b8d5[_0xd826('0x15')]){if(_0x12b8d5[_0xd826('0x15')][_0xd826('0x16')]===0x1f4){logger[_0xd826('0x15')]('FaxAccount,\x20%s,\x20%s',_0x25d248,_0x12b8d5[_0xd826('0x15')][_0xd826('0x17')]);return _0x3ffd12(_0x12b8d5[_0xd826('0x15')]['message']);}logger[_0xd826('0x15')]('FaxAccount,\x20%s,\x20%s',_0x25d248,_0x12b8d5[_0xd826('0x15')][_0xd826('0x17')]);return _0x362c54(_0x12b8d5['error'][_0xd826('0x17')]);}else{logger[_0xd826('0x11')]('FaxAccount,\x20%s,\x20%s',_0x25d248,_0xd826('0x12'));_0x362c54(_0x12b8d5[_0xd826('0x18')][_0xd826('0x17')]);}})[_0xd826('0x19')](function(_0x4d0625){logger[_0xd826('0x15')]('FaxAccount,\x20%s,\x20%s',_0x25d248,_0x4d0625);_0x3ffd12(_0x4d0625);});});}exports[_0xd826('0x1a')]=function(_0x2aba44){var _0x35423a=this;return new Promise(function(_0x275853,_0x2908ec){return db['FaxAccount'][_0xd826('0x1b')]({'raw':_0x2aba44[_0xd826('0x1c')]?_0x2aba44[_0xd826('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2aba44['options']?_0x2aba44[_0xd826('0x1c')]['where']||null:null,'attributes':_0x2aba44[_0xd826('0x1c')]?_0x2aba44[_0xd826('0x1c')][_0xd826('0x1d')]||null:null,'limit':_0x2aba44[_0xd826('0x1c')]?_0x2aba44['options'][_0xd826('0x1e')]||null:null,'include':_0x2aba44[_0xd826('0x1c')]?_0x2aba44[_0xd826('0x1c')]['include']?_[_0xd826('0x1f')](_0x2aba44['options']['include'],function(_0x56550f){return{'model':db[_0x56550f[_0xd826('0x20')]],'as':_0x56550f['as'],'attributes':_0x56550f['attributes'],'include':_0x56550f['include']?_[_0xd826('0x1f')](_0x56550f[_0xd826('0x21')],function(_0x5a476a){return{'model':db[_0x5a476a[_0xd826('0x20')]],'as':_0x5a476a['as'],'attributes':_0x5a476a[_0xd826('0x1d')],'include':_0x5a476a[_0xd826('0x21')]?_['map'](_0x5a476a[_0xd826('0x21')],function(_0xbe286d){return{'model':db[_0xbe286d['model']],'as':_0xbe286d['as'],'attributes':_0xbe286d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd826('0x10')](function(_0x335441){logger[_0xd826('0x11')]('GetFaxAccount',_0x2aba44);logger[_0xd826('0x22')]('GetFaxAccount',_0x2aba44,JSON[_0xd826('0x14')](_0x335441));_0x275853(_0x335441);})['catch'](function(_0x4d1437){logger[_0xd826('0x15')](_0xd826('0x1a'),_0x4d1437['message'],_0x2aba44);_0x2908ec(_0x35423a[_0xd826('0x15')](0x1f4,_0x4d1437[_0xd826('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x215948,_0x2f22f5,_0x40e733){var _0x530b36=this;return new Promise(function(_0x354ead,_0x4ac423){var _0x34e92c={'body':_0x215948[_0xd826('0x23')],'channel':_0xd826('0x24')};var _0x30db67=[];var _0x4c9346=[];var _0x5e3c24={};return db[_0xd826('0x25')]['describe']()[_0xd826('0x10')](function(_0x34b060){if(!_0x34b060){throw new db['Sequelize'][(_0xd826('0x26'))]('no\x20available\x20attributes');}_0x30db67=_['difference'](_[_0xd826('0x27')](_0x34b060),['createdAt',_0xd826('0x28')]);_0x4c9346=_['difference'](_[_0xd826('0x27')](_0x34b060),[_0xd826('0x29'),_0xd826('0x28'),_0xd826('0x2a'),_0xd826('0x2b')]);if(_0x215948[_0xd826('0x23')]['id']){delete _0x215948[_0xd826('0x23')]['id'];}if(_[_0xd826('0x2c')](_0x215948[_0xd826('0x23')]['from'])){throw new db[(_0xd826('0x2d'))][(_0xd826('0x26'))](_0xd826('0x2e'));}if(_[_0xd826('0x2c')](_0x215948['body'][_0xd826('0x23')])||_0x215948['body']['body']===''){throw new db[(_0xd826('0x2d'))][(_0xd826('0x26'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd826('0x2c')](_0x215948['body']['mapKey'])){throw new db[(_0xd826('0x2d'))][(_0xd826('0x26'))](_0xd826('0x2f')+_0x4c9346);}if(!_['includes'](_0x4c9346,_0x215948[_0xd826('0x23')]['mapKey'])){throw new db['Sequelize'][(_0xd826('0x26'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c9346);}_0x5e3c24[_0x215948['body'][_0xd826('0x30')]]=_0x215948[_0xd826('0x23')][_0xd826('0x31')];})['then'](function(){return db[_0xd826('0x32')][_0xd826('0x33')]({'where':{'id':_0x215948['account']['id']},'include':[{'model':db['CmList'],'as':_0xd826('0x34'),'include':[{'model':db[_0xd826('0x25')],'as':_0xd826('0x35'),'where':_0x5e3c24,'limit':0x1,'order':[[_0xd826('0x28'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0xd826('0x36')}]});})[_0xd826('0x10')](function(_0x4ed172){if(_0x4ed172&&_0x4ed172['List']){var _0x5422e4=_0x4ed172['get']({'plain':!![]});_0x34e92c['account']=_0x5422e4;_0x34e92c[_0xd826('0x37')]=_0x5422e4[_0xd826('0x36')];_0x34e92c[_0xd826('0x38')]=_0x5422e4[_0xd826('0x34')];_0x34e92c[_0xd826('0x37')]=_['orderBy'](_0x34e92c[_0xd826('0x37')],[_0xd826('0x39')],[_0xd826('0x3a')]);if(_0x34e92c[_0xd826('0x3b')]['Applications']){delete _0x34e92c['account'][_0xd826('0x36')];}if(_0x34e92c[_0xd826('0x3b')][_0xd826('0x34')]&&_0x34e92c[_0xd826('0x3b')][_0xd826('0x34')][_0xd826('0x35')][_0xd826('0x3c')]){return _0x34e92c['account'][_0xd826('0x34')][_0xd826('0x35')][0x0];}var _0x1699d9=_[_0xd826('0xc')](_0x215948[_0xd826('0x23')],{'firstName':_0x215948['body'][_0xd826('0x31')],'ListId':_0x5422e4[_0xd826('0x2b')]});_0x1699d9[_0x215948[_0xd826('0x23')][_0xd826('0x30')]]=_0x215948[_0xd826('0x23')][_0xd826('0x31')];return db[_0xd826('0x25')][_0xd826('0x3d')](_0x1699d9,{'fields':_0x30db67,'raw':!![]});}})[_0xd826('0x10')](function(_0x21a32d){_0x34e92c[_0xd826('0x3e')]=_0x21a32d;if(_0x21a32d){var _0x422251={'ContactId':_0x21a32d['id'],'FaxAccountId':_0x215948[_0xd826('0x3b')]['id'],'fax':_0x21a32d[_0xd826('0x24')]};return db['FaxInteraction'][_0xd826('0x33')]({'where':{'ContactId':_0x21a32d['id'],'closed':![],'FaxAccountId':_0x215948[_0xd826('0x3b')]['id']}})[_0xd826('0x10')](function(_0x2f9e6c){if(_0x2f9e6c){return[_0x2f9e6c,![]];}return db[_0xd826('0x3f')][_0xd826('0x3d')](_0x422251)['then'](function(_0x1fdd5d){return[_0x1fdd5d,!![]];});});}else{throw new Error(_0xd826('0x40'));}})[_0xd826('0x41')](function(_0x326f89,_0x39a49f){var _0x176670=_0x326f89[_0xd826('0x42')]({'plain':!![]});if(_0x39a49f){if(_0x34e92c[_0xd826('0x3b')][_0xd826('0x43')]){_0x34e92c['applications'][_0xd826('0x44')]({'id':0x0,'priority':_0x34e92c[_0xd826('0x37')][_0xd826('0x3c')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xd826('0x45')});}_0x176670[_0xd826('0x46')]=!![];}else{_0x176670['created']=![];}_0x34e92c[_0xd826('0x47')]=_0x176670;return db[_0xd826('0x48')][_0xd826('0x3d')]({'body':_0x215948[_0xd826('0x23')][_0xd826('0x23')],'FaxAccountId':_0x215948[_0xd826('0x3b')]['id'],'FaxInteractionId':_0x326f89['id'],'direction':'in','ContactId':_0x326f89[_0xd826('0x49')],'AttachmentId':_0x215948[_0xd826('0x23')][_0xd826('0x4a')]});})['then'](function(_0x30ddd8){_0x34e92c[_0xd826('0x17')]=_0x30ddd8;if(_0x34e92c['interaction'][_0xd826('0x4b')]){return db[_0xd826('0x4c')][_0xd826('0x33')]({'attributes':['id','name'],'where':{'id':_0x34e92c[_0xd826('0x47')][_0xd826('0x4b')]}})['then'](function(_0x7485d6){if(_0x7485d6){_0x34e92c[_0xd826('0x37')][_0xd826('0x4d')]({'id':0x0,'priority':0x0,'app':_0xd826('0x4e'),'appdata':_0x7485d6[_0xd826('0x4f')]+','+(_0x34e92c[_0xd826('0x3b')][_0xd826('0x50')]||0xa),'interval':_0xd826('0x45')});}return respondWithRpcPromise(_0xd826('0x51'),_0xd826('0x52'),_0x34e92c);});}return respondWithRpcPromise('Start',_0xd826('0x52'),_0x34e92c);})[_0xd826('0x10')](function(_0x5ebd83){_0x354ead(_0x5ebd83);})[_0xd826('0x19')](function(_0x5b235b){_0x4ac423(_0x530b36[_0xd826('0x15')](0x1f4,_0x5b235b[_0xd826('0x17')]));});});}; \ No newline at end of file +var _0x3c5b=['code','message','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','stringify','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','keys','createdAt','CompanyId','ListId','body','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','CmList','Contacts','DESC','Applications','List','get','account','applications','list','orderBy','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','name','agent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x786a8f,_0x1b224d){var _0x519057=function(_0x20c21b){while(--_0x20c21b){_0x786a8f['push'](_0x786a8f['shift']());}};_0x519057(++_0x1b224d);}(_0x3c5b,0x19c));var _0xb3c5=function(_0x47b66c,_0x1098d0){_0x47b66c=_0x47b66c-0x0;var _0x396bfa=_0x3c5b[_0x47b66c];return _0x396bfa;};'use strict';var _=require(_0xb3c5('0x0'));var util=require(_0xb3c5('0x1'));var moment=require(_0xb3c5('0x2'));var BPromise=require(_0xb3c5('0x3'));var rs=require(_0xb3c5('0x4'));var fs=require('fs');var Redis=require(_0xb3c5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c5('0x6'));var logger=require(_0xb3c5('0x7'))(_0xb3c5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3c5('0x9')][_0xb3c5('0xa')]({'port':0x232c});config[_0xb3c5('0xb')]=_[_0xb3c5('0xc')](config[_0xb3c5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3c5('0xd'))(new Redis(config[_0xb3c5('0xb')]));require(_0xb3c5('0xe'))[_0xb3c5('0xf')](socket);function respondWithRpcPromise(_0x58887e,_0x59b557,_0x3bd51e){return new BPromise(function(_0xf62757,_0x5d0eea){return client['request'](_0x58887e,_0x3bd51e)[_0xb3c5('0x10')](function(_0x36d2c1){logger[_0xb3c5('0x11')](_0xb3c5('0x12'),_0x59b557,'request\x20sent');logger[_0xb3c5('0x13')](_0xb3c5('0x14'),_0x59b557,_0xb3c5('0x15'),JSON['stringify'](_0x36d2c1));if(_0x36d2c1['error']){if(_0x36d2c1[_0xb3c5('0x16')][_0xb3c5('0x17')]===0x1f4){logger[_0xb3c5('0x16')](_0xb3c5('0x12'),_0x59b557,_0x36d2c1[_0xb3c5('0x16')][_0xb3c5('0x18')]);return _0x5d0eea(_0x36d2c1['error'][_0xb3c5('0x18')]);}logger[_0xb3c5('0x16')](_0xb3c5('0x12'),_0x59b557,_0x36d2c1[_0xb3c5('0x16')][_0xb3c5('0x18')]);return _0xf62757(_0x36d2c1[_0xb3c5('0x16')][_0xb3c5('0x18')]);}else{logger[_0xb3c5('0x11')](_0xb3c5('0x12'),_0x59b557,_0xb3c5('0x15'));_0xf62757(_0x36d2c1['result'][_0xb3c5('0x18')]);}})[_0xb3c5('0x19')](function(_0x4ab65c){logger['error'](_0xb3c5('0x12'),_0x59b557,_0x4ab65c);_0x5d0eea(_0x4ab65c);});});}exports[_0xb3c5('0x1a')]=function(_0x264c55){var _0x1c2bfd=this;return new Promise(function(_0x8476e1,_0x94643a){return db[_0xb3c5('0x1b')]['findAll']({'raw':_0x264c55[_0xb3c5('0x1c')]?_0x264c55[_0xb3c5('0x1c')][_0xb3c5('0x1d')]===undefined?!![]:![]:!![],'where':_0x264c55[_0xb3c5('0x1c')]?_0x264c55[_0xb3c5('0x1c')][_0xb3c5('0x1e')]||null:null,'attributes':_0x264c55['options']?_0x264c55[_0xb3c5('0x1c')][_0xb3c5('0x1f')]||null:null,'limit':_0x264c55[_0xb3c5('0x1c')]?_0x264c55['options'][_0xb3c5('0x20')]||null:null,'include':_0x264c55[_0xb3c5('0x1c')]?_0x264c55[_0xb3c5('0x1c')][_0xb3c5('0x21')]?_[_0xb3c5('0x22')](_0x264c55[_0xb3c5('0x1c')][_0xb3c5('0x21')],function(_0x272799){return{'model':db[_0x272799[_0xb3c5('0x23')]],'as':_0x272799['as'],'attributes':_0x272799['attributes'],'include':_0x272799['include']?_[_0xb3c5('0x22')](_0x272799[_0xb3c5('0x21')],function(_0x1b83d7){return{'model':db[_0x1b83d7[_0xb3c5('0x23')]],'as':_0x1b83d7['as'],'attributes':_0x1b83d7[_0xb3c5('0x1f')],'include':_0x1b83d7[_0xb3c5('0x21')]?_[_0xb3c5('0x22')](_0x1b83d7[_0xb3c5('0x21')],function(_0xbc6ad6){return{'model':db[_0xbc6ad6[_0xb3c5('0x23')]],'as':_0xbc6ad6['as'],'attributes':_0xbc6ad6[_0xb3c5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb3c5('0x10')](function(_0x9122a1){logger[_0xb3c5('0x11')]('GetFaxAccount',_0x264c55);logger[_0xb3c5('0x13')](_0xb3c5('0x1a'),_0x264c55,JSON[_0xb3c5('0x24')](_0x9122a1));_0x8476e1(_0x9122a1);})['catch'](function(_0x589163){logger[_0xb3c5('0x16')]('GetFaxAccount',_0x589163[_0xb3c5('0x18')],_0x264c55);_0x94643a(_0x1c2bfd['error'](0x1f4,_0x589163[_0xb3c5('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x31e954,_0x35cdac,_0x41f03f){var _0x3e7df5=this;return new Promise(function(_0x5543e0,_0x17027c){var _0x413c2e={'body':_0x31e954['body'],'channel':_0xb3c5('0x25')};var _0x38a1f9=[];var _0x213568=[];var _0x1d4c60={};return db[_0xb3c5('0x26')]['describe']()[_0xb3c5('0x10')](function(_0x4d23ac){if(!_0x4d23ac){throw new db[(_0xb3c5('0x27'))]['ValidationError'](_0xb3c5('0x28'));}_0x38a1f9=_[_0xb3c5('0x29')](_['keys'](_0x4d23ac),['createdAt',_0xb3c5('0x2a')]);_0x213568=_[_0xb3c5('0x29')](_[_0xb3c5('0x2b')](_0x4d23ac),[_0xb3c5('0x2c'),'updatedAt',_0xb3c5('0x2d'),_0xb3c5('0x2e')]);if(_0x31e954[_0xb3c5('0x2f')]['id']){delete _0x31e954[_0xb3c5('0x2f')]['id'];}if(_[_0xb3c5('0x30')](_0x31e954['body'][_0xb3c5('0x31')])){throw new db[(_0xb3c5('0x27'))][(_0xb3c5('0x32'))](_0xb3c5('0x33'));}if(_[_0xb3c5('0x30')](_0x31e954[_0xb3c5('0x2f')]['body'])||_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x2f')]===''){throw new db['Sequelize'][(_0xb3c5('0x32'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb3c5('0x30')](_0x31e954[_0xb3c5('0x2f')]['mapKey'])){throw new db[(_0xb3c5('0x27'))][(_0xb3c5('0x32'))](_0xb3c5('0x34')+_0x213568);}if(!_[_0xb3c5('0x35')](_0x213568,_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x36')])){throw new db[(_0xb3c5('0x27'))][(_0xb3c5('0x32'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x213568);}_0x1d4c60[_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x36')]]=_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x31')];})[_0xb3c5('0x10')](function(){return db[_0xb3c5('0x1b')][_0xb3c5('0x37')]({'where':{'id':_0x31e954['account']['id']},'include':[{'model':db[_0xb3c5('0x38')],'as':'List','include':[{'model':db[_0xb3c5('0x26')],'as':_0xb3c5('0x39'),'where':_0x1d4c60,'limit':0x1,'order':[[_0xb3c5('0x2a'),_0xb3c5('0x3a')]]}]},{'model':db['FaxApplication'],'as':_0xb3c5('0x3b')}]});})['then'](function(_0x5c7754){if(_0x5c7754&&_0x5c7754[_0xb3c5('0x3c')]){var _0x27f02d=_0x5c7754[_0xb3c5('0x3d')]({'plain':!![]});_0x413c2e[_0xb3c5('0x3e')]=_0x27f02d;_0x413c2e[_0xb3c5('0x3f')]=_0x27f02d[_0xb3c5('0x3b')];_0x413c2e[_0xb3c5('0x40')]=_0x27f02d[_0xb3c5('0x3c')];_0x413c2e[_0xb3c5('0x3f')]=_[_0xb3c5('0x41')](_0x413c2e[_0xb3c5('0x3f')],['priority'],[_0xb3c5('0x42')]);if(_0x413c2e[_0xb3c5('0x3e')][_0xb3c5('0x3b')]){delete _0x413c2e[_0xb3c5('0x3e')][_0xb3c5('0x3b')];}if(_0x413c2e['account'][_0xb3c5('0x3c')]&&_0x413c2e[_0xb3c5('0x3e')][_0xb3c5('0x3c')]['Contacts'][_0xb3c5('0x43')]){return _0x413c2e[_0xb3c5('0x3e')]['List'][_0xb3c5('0x39')][0x0];}var _0x4a0026=_['defaults'](_0x31e954['body'],{'firstName':_0x31e954['body'][_0xb3c5('0x31')],'ListId':_0x27f02d['ListId']});_0x4a0026[_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x36')]]=_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x31')];return db[_0xb3c5('0x26')][_0xb3c5('0x44')](_0x4a0026,{'fields':_0x38a1f9,'raw':!![]});}})[_0xb3c5('0x10')](function(_0x368874){_0x413c2e[_0xb3c5('0x45')]=_0x368874;if(_0x368874){var _0x3e653b={'ContactId':_0x368874['id'],'FaxAccountId':_0x31e954[_0xb3c5('0x3e')]['id'],'fax':_0x368874[_0xb3c5('0x25')]};return db[_0xb3c5('0x46')][_0xb3c5('0x37')]({'where':{'ContactId':_0x368874['id'],'closed':![],'FaxAccountId':_0x31e954[_0xb3c5('0x3e')]['id']}})[_0xb3c5('0x10')](function(_0x509bbb){if(_0x509bbb){return[_0x509bbb,![]];}return db[_0xb3c5('0x46')]['create'](_0x3e653b)['then'](function(_0x4dc293){return[_0x4dc293,!![]];});});}else{throw new Error(_0xb3c5('0x47'));}})[_0xb3c5('0x48')](function(_0x59b7d6,_0x7daeb2){var _0x4ec434=_0x59b7d6[_0xb3c5('0x3d')]({'plain':!![]});if(_0x7daeb2){if(_0x413c2e[_0xb3c5('0x3e')][_0xb3c5('0x49')]){_0x413c2e[_0xb3c5('0x3f')][_0xb3c5('0x4a')]({'id':0x0,'priority':_0x413c2e[_0xb3c5('0x3f')][_0xb3c5('0x43')]+0x1,'app':_0xb3c5('0x4b'),'appdata':_0xb3c5('0x4c'),'interval':_0xb3c5('0x4d')});}_0x4ec434[_0xb3c5('0x4e')]=!![];}else{_0x4ec434[_0xb3c5('0x4e')]=![];}_0x413c2e[_0xb3c5('0x4f')]=_0x4ec434;return db['FaxMessage'][_0xb3c5('0x44')]({'body':_0x31e954['body'][_0xb3c5('0x2f')],'FaxAccountId':_0x31e954[_0xb3c5('0x3e')]['id'],'FaxInteractionId':_0x59b7d6['id'],'direction':'in','ContactId':_0x59b7d6[_0xb3c5('0x50')],'AttachmentId':_0x31e954[_0xb3c5('0x2f')][_0xb3c5('0x51')]});})[_0xb3c5('0x10')](function(_0x3ca67e){_0x413c2e[_0xb3c5('0x18')]=_0x3ca67e;if(_0x413c2e[_0xb3c5('0x4f')][_0xb3c5('0x52')]){return db['User'][_0xb3c5('0x37')]({'attributes':['id',_0xb3c5('0x53')],'where':{'id':_0x413c2e['interaction']['UserId']}})[_0xb3c5('0x10')](function(_0x3fb701){if(_0x3fb701){_0x413c2e[_0xb3c5('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb3c5('0x54'),'appdata':_0x3fb701[_0xb3c5('0x53')]+','+(_0x413c2e['account']['waitForTheAssignedAgent']||0xa),'interval':_0xb3c5('0x4d')});}return respondWithRpcPromise(_0xb3c5('0x55'),_0xb3c5('0x56'),_0x413c2e);});}return respondWithRpcPromise('Start',_0xb3c5('0x56'),_0x413c2e);})[_0xb3c5('0x10')](function(_0x1d78a0){_0x5543e0(_0x1d78a0);})[_0xb3c5('0x19')](function(_0x39eba2){_0x17027c(_0x3e7df5[_0xb3c5('0x16')](0x1f4,_0x39eba2[_0xb3c5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 27fe45a..fde484e 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 _0xf4f5=['faxAccount:','./faxAccount.events','remove','emit','removeListener','length'];(function(_0x88da9,_0x52cd6a){var _0x42df80=function(_0x19d9fd){while(--_0x19d9fd){_0x88da9['push'](_0x88da9['shift']());}};_0x42df80(++_0x52cd6a);}(_0xf4f5,0xdf));var _0x5f4f=function(_0x5f2f9c,_0x1f33c7){_0x5f2f9c=_0x5f2f9c-0x0;var _0xc1f0e2=_0xf4f5[_0x5f2f9c];return _0xc1f0e2;};'use strict';var FaxAccountEvents=require(_0x5f4f('0x0'));var events=['save',_0x5f4f('0x1'),'update'];function createListener(_0x24b710,_0x5c927c){return function(_0xc60069){_0x5c927c[_0x5f4f('0x2')](_0x24b710,_0xc60069);};}function removeListener(_0x9492e0,_0x25aea3){return function(){FaxAccountEvents[_0x5f4f('0x3')](_0x9492e0,_0x25aea3);};}exports['register']=function(_0x16d8be){for(var _0x2ed76e=0x0,_0x2d855=events[_0x5f4f('0x4')];_0x2ed76e<_0x2d855;_0x2ed76e++){var _0x45a81a=events[_0x2ed76e];var _0x585661=createListener(_0x5f4f('0x5')+_0x45a81a,_0x16d8be);FaxAccountEvents['on'](_0x45a81a,_0x585661);}}; \ No newline at end of file +var _0x95af=['length','./faxAccount.events','save','remove','emit','removeListener','register'];(function(_0x42ad1b,_0x3074b9){var _0x3792a5=function(_0x476875){while(--_0x476875){_0x42ad1b['push'](_0x42ad1b['shift']());}};_0x3792a5(++_0x3074b9);}(_0x95af,0x15f));var _0xf95a=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x95af[_0x4e676e];return _0x336a3c;};'use strict';var FaxAccountEvents=require(_0xf95a('0x0'));var events=[_0xf95a('0x1'),_0xf95a('0x2'),'update'];function createListener(_0x11777b,_0x102124){return function(_0x2b125a){_0x102124[_0xf95a('0x3')](_0x11777b,_0x2b125a);};}function removeListener(_0x4faa41,_0x444c1e){return function(){FaxAccountEvents[_0xf95a('0x4')](_0x4faa41,_0x444c1e);};}exports[_0xf95a('0x5')]=function(_0xfb1cd6){for(var _0x2ce508=0x0,_0x5e7c47=events[_0xf95a('0x6')];_0x2ce508<_0x5e7c47;_0x2ce508++){var _0x50c482=events[_0x2ce508];var _0x36671e=createListener('faxAccount:'+_0x50c482,_0xfb1cd6);FaxAccountEvents['on'](_0x50c482,_0x36671e);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9ce892a..aaeb809 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(_0x26ccb6,_0x24ff65){var _0x4846b8=function(_0x4ec6ac){while(--_0x4ec6ac){_0x26ccb6['push'](_0x26ccb6['shift']());}};_0x4846b8(++_0x24ff65);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x68b791,_0x47e1df){var _0x458a9c=function(_0x8ef0ba){while(--_0x8ef0ba){_0x68b791['push'](_0x68b791['shift']());}};_0x458a9c(++_0x47e1df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 7bebb42..e94a208 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 _0x6791=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x1d1a06,_0x2356f5){var _0x5bedef=function(_0x1c829e){while(--_0x1c829e){_0x1d1a06['push'](_0x1d1a06['shift']());}};_0x5bedef(++_0x2356f5);}(_0x6791,0x199));var _0x1679=function(_0x365b01,_0x4d1cb4){_0x365b01=_0x365b01-0x0;var _0x4235f5=_0x6791[_0x365b01];return _0x4235f5;};'use strict';var Sequelize=require(_0x1679('0x0'));module[_0x1679('0x1')]={'priority':{'type':Sequelize[_0x1679('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1679('0x3')],'allowNull':![],'defaultValue':_0x1679('0x4')},'appdata':{'type':Sequelize[_0x1679('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1679('0x3')],'defaultValue':_0x1679('0x6')}}; \ No newline at end of file +var _0x118a=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x50e372,_0x230934){var _0x46c66e=function(_0x330608){while(--_0x330608){_0x50e372['push'](_0x50e372['shift']());}};_0x46c66e(++_0x230934);}(_0x118a,0x1b8));var _0xa118=function(_0x377e66,_0x38d968){_0x377e66=_0x377e66-0x0;var _0xfa3ab9=_0x118a[_0x377e66];return _0xfa3ab9;};'use strict';var Sequelize=require(_0xa118('0x0'));module[_0xa118('0x1')]={'priority':{'type':Sequelize[_0xa118('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa118('0x3')],'allowNull':![],'defaultValue':_0xa118('0x4')},'appdata':{'type':Sequelize[_0xa118('0x5')]()},'description':{'type':Sequelize[_0xa118('0x3')]},'interval':{'type':Sequelize[_0xa118('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index b390ca1..b3151e4 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 _0xc9f5=['includeAll','findAll','length','include','find','catch','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','stack','name','send','index','FaxApplication','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xc9f5,0x126));var _0x5c9f=function(_0x574617,_0x42eccc){_0x574617=_0x574617-0x0;var _0x29de90=_0xc9f5[_0x574617];return _0x29de90;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c9f('0x0'));var zipdir=require(_0x5c9f('0x1'));var jsonpatch=require(_0x5c9f('0x2'));var rp=require(_0x5c9f('0x3'));var moment=require(_0x5c9f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5c9f('0x5'));var sox=require(_0x5c9f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c9f('0x7'));var _=require(_0x5c9f('0x8'));var squel=require(_0x5c9f('0x9'));var crypto=require(_0x5c9f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5c9f('0xb'));var toCsv=require(_0x5c9f('0xc'));var querystring=require(_0x5c9f('0xd'));var Papa=require('papaparse');var Redis=require(_0x5c9f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5c9f('0xf'));var as=require(_0x5c9f('0x10'));var hardwareService=require(_0x5c9f('0x11'));var logger=require(_0x5c9f('0x12'))(_0x5c9f('0x13'));var utils=require(_0x5c9f('0x14'));var config=require(_0x5c9f('0x15'));var licenseUtil=require(_0x5c9f('0x16'));var db=require(_0x5c9f('0x17'))['db'];function respondWithStatusCode(_0x241542,_0x518a87){_0x518a87=_0x518a87||0xcc;return function(_0x58ca89){if(_0x58ca89){return _0x241542[_0x5c9f('0x18')](_0x518a87);}return _0x241542[_0x5c9f('0x19')](_0x518a87)['end']();};}function respondWithResult(_0x4746ae,_0x643eee){_0x643eee=_0x643eee||0xc8;return function(_0x2b4e07){if(_0x2b4e07){return _0x4746ae[_0x5c9f('0x19')](_0x643eee)[_0x5c9f('0x1a')](_0x2b4e07);}};}function respondWithFilteredResult(_0x29f717,_0x31df63){return function(_0x334bb3){if(_0x334bb3){var _0x61b2e4=typeof _0x31df63[_0x5c9f('0x1b')]==='undefined'&&typeof _0x31df63['limit']===_0x5c9f('0x1c');var _0xe81523=_0x334bb3[_0x5c9f('0x1d')];var _0x1a79e7=_0x61b2e4?0x0:_0x31df63[_0x5c9f('0x1b')];var _0x33a9e9=_0x61b2e4?_0x334bb3['count']:_0x31df63[_0x5c9f('0x1b')]+_0x31df63[_0x5c9f('0x1e')];var _0x370e88;if(_0x33a9e9>=_0xe81523){_0x33a9e9=_0xe81523;_0x370e88=0xc8;}else{_0x370e88=0xce;}_0x29f717[_0x5c9f('0x19')](_0x370e88);return _0x29f717[_0x5c9f('0x1f')](_0x5c9f('0x20'),_0x1a79e7+'-'+_0x33a9e9+'/'+_0xe81523)['json'](_0x334bb3);}return null;};}function patchUpdates(_0xe785fe){return function(_0x496761){try{jsonpatch[_0x5c9f('0x21')](_0x496761,_0xe785fe,!![]);}catch(_0xb8b74c){return BPromise[_0x5c9f('0x22')](_0xb8b74c);}return _0x496761[_0x5c9f('0x23')]();};}function saveUpdates(_0xfb0077,_0x4135fb){return function(_0x25a34d){if(_0x25a34d){return _0x25a34d['update'](_0xfb0077)[_0x5c9f('0x24')](function(_0x5c3631){return _0x5c3631;});}return null;};}function removeEntity(_0x437acf,_0x4d64f9){return function(_0xe93dab){if(_0xe93dab){return _0xe93dab['destroy']()[_0x5c9f('0x24')](function(){_0x437acf[_0x5c9f('0x19')](0xcc)[_0x5c9f('0x25')]();});}};}function handleEntityNotFound(_0x80f138,_0x5b2b60){return function(_0x1132e7){if(!_0x1132e7){_0x80f138[_0x5c9f('0x18')](0x194);}return _0x1132e7;};}function handleError(_0x267132,_0x4472dc){_0x4472dc=_0x4472dc||0x1f4;return function(_0x5cef76){logger['error'](_0x5cef76[_0x5c9f('0x26')]);if(_0x5cef76[_0x5c9f('0x27')]){delete _0x5cef76['name'];}_0x267132[_0x5c9f('0x19')](_0x4472dc)[_0x5c9f('0x28')](_0x5cef76);};}exports[_0x5c9f('0x29')]=function(_0x123f12,_0x487a52){var _0x3c576d={},_0x598019={},_0x37cfbf={'count':0x0,'rows':[]};var _0x43d89b=_['map'](db[_0x5c9f('0x2a')]['rawAttributes'],function(_0x5d2a38){return{'name':_0x5d2a38['fieldName'],'type':_0x5d2a38[_0x5c9f('0x2b')][_0x5c9f('0x2c')]};});_0x598019[_0x5c9f('0x2d')]=_[_0x5c9f('0x2e')](_0x43d89b,_0x5c9f('0x27'));_0x598019['query']=_[_0x5c9f('0x2f')](_0x123f12['query']);_0x598019[_0x5c9f('0x30')]=_[_0x5c9f('0x31')](_0x598019[_0x5c9f('0x2d')],_0x598019[_0x5c9f('0x32')]);_0x3c576d[_0x5c9f('0x33')]=_[_0x5c9f('0x31')](_0x598019[_0x5c9f('0x2d')],qs[_0x5c9f('0x34')](_0x123f12['query'][_0x5c9f('0x34')]));_0x3c576d[_0x5c9f('0x33')]=_0x3c576d[_0x5c9f('0x33')]['length']?_0x3c576d[_0x5c9f('0x33')]:_0x598019[_0x5c9f('0x2d')];if(!_0x123f12[_0x5c9f('0x32')][_0x5c9f('0x35')]('nolimit')){_0x3c576d[_0x5c9f('0x1e')]=qs['limit'](_0x123f12[_0x5c9f('0x32')]['limit']);_0x3c576d[_0x5c9f('0x1b')]=qs['offset'](_0x123f12[_0x5c9f('0x32')][_0x5c9f('0x1b')]);}_0x3c576d[_0x5c9f('0x36')]=qs[_0x5c9f('0x37')](_0x123f12[_0x5c9f('0x32')][_0x5c9f('0x37')]);_0x3c576d[_0x5c9f('0x38')]=qs[_0x5c9f('0x30')](_[_0x5c9f('0x39')](_0x123f12[_0x5c9f('0x32')],_0x598019[_0x5c9f('0x30')]),_0x43d89b);if(_0x123f12[_0x5c9f('0x32')]['filter']){_0x3c576d[_0x5c9f('0x38')]=_[_0x5c9f('0x3a')](_0x3c576d[_0x5c9f('0x38')],{'$or':_[_0x5c9f('0x2e')](_0x43d89b,function(_0x54a3ed){if(_0x54a3ed['type']!==_0x5c9f('0x3b')){var _0x451a91={};_0x451a91[_0x54a3ed[_0x5c9f('0x27')]]={'$like':'%'+_0x123f12[_0x5c9f('0x32')]['filter']+'%'};return _0x451a91;}})});}_0x3c576d=_[_0x5c9f('0x3a')]({},_0x3c576d,_0x123f12[_0x5c9f('0x3c')]);var _0x668030={'where':_0x3c576d[_0x5c9f('0x38')]};return db['FaxApplication']['count'](_0x668030)[_0x5c9f('0x24')](function(_0x181383){_0x37cfbf[_0x5c9f('0x1d')]=_0x181383;if(_0x123f12[_0x5c9f('0x32')][_0x5c9f('0x3d')]){_0x3c576d['include']=[{'all':!![]}];}return db[_0x5c9f('0x2a')][_0x5c9f('0x3e')](_0x3c576d);})['then'](function(_0x2e1409){_0x37cfbf['rows']=_0x2e1409;return _0x37cfbf;})[_0x5c9f('0x24')](respondWithFilteredResult(_0x487a52,_0x3c576d))['catch'](handleError(_0x487a52,null));};exports['show']=function(_0x20478b,_0x221350){var _0x2c6e18={'raw':!![],'where':{'id':_0x20478b['params']['id']}},_0x314899={};_0x314899['model']=_[_0x5c9f('0x2f')](db[_0x5c9f('0x2a')]['rawAttributes']);_0x314899[_0x5c9f('0x32')]=_[_0x5c9f('0x2f')](_0x20478b[_0x5c9f('0x32')]);_0x314899[_0x5c9f('0x30')]=_[_0x5c9f('0x31')](_0x314899[_0x5c9f('0x2d')],_0x314899[_0x5c9f('0x32')]);_0x2c6e18[_0x5c9f('0x33')]=_[_0x5c9f('0x31')](_0x314899[_0x5c9f('0x2d')],qs[_0x5c9f('0x34')](_0x20478b[_0x5c9f('0x32')][_0x5c9f('0x34')]));_0x2c6e18[_0x5c9f('0x33')]=_0x2c6e18[_0x5c9f('0x33')][_0x5c9f('0x3f')]?_0x2c6e18[_0x5c9f('0x33')]:_0x314899[_0x5c9f('0x2d')];if(_0x20478b[_0x5c9f('0x32')][_0x5c9f('0x3d')]){_0x2c6e18[_0x5c9f('0x40')]=[{'all':!![]}];}_0x2c6e18=_[_0x5c9f('0x3a')]({},_0x2c6e18,_0x20478b[_0x5c9f('0x3c')]);return db[_0x5c9f('0x2a')][_0x5c9f('0x41')](_0x2c6e18)[_0x5c9f('0x24')](handleEntityNotFound(_0x221350,null))[_0x5c9f('0x24')](respondWithResult(_0x221350,null))[_0x5c9f('0x42')](handleError(_0x221350,null));};exports[_0x5c9f('0x43')]=function(_0x2e5551,_0x38bf86){return db['FaxApplication']['create'](_0x2e5551[_0x5c9f('0x44')],{})[_0x5c9f('0x24')](respondWithResult(_0x38bf86,0xc9))[_0x5c9f('0x42')](handleError(_0x38bf86,null));};exports['update']=function(_0xf14292,_0x293b53){if(_0xf14292[_0x5c9f('0x44')]['id']){delete _0xf14292['body']['id'];}return db[_0x5c9f('0x2a')][_0x5c9f('0x41')]({'where':{'id':_0xf14292[_0x5c9f('0x45')]['id']}})[_0x5c9f('0x24')](handleEntityNotFound(_0x293b53,null))['then'](saveUpdates(_0xf14292['body'],null))['then'](respondWithResult(_0x293b53,null))[_0x5c9f('0x42')](handleError(_0x293b53,null));};exports[_0x5c9f('0x46')]=function(_0x3a6ae9,_0x2a7dd6){return db['FaxApplication'][_0x5c9f('0x41')]({'where':{'id':_0x3a6ae9[_0x5c9f('0x45')]['id']}})[_0x5c9f('0x24')](handleEntityNotFound(_0x2a7dd6,null))[_0x5c9f('0x24')](removeEntity(_0x2a7dd6,null))[_0x5c9f('0x42')](handleError(_0x2a7dd6,null));}; \ No newline at end of file +var _0x0230=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','FaxApplication','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x0230,0x86));var _0x0023=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0230[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0023('0x0'));var zipdir=require(_0x0023('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0023('0x2'));var moment=require(_0x0023('0x3'));var BPromise=require(_0x0023('0x4'));var Mustache=require(_0x0023('0x5'));var util=require(_0x0023('0x6'));var path=require(_0x0023('0x7'));var sox=require('sox');var csv=require(_0x0023('0x8'));var ejs=require(_0x0023('0x9'));var fs=require('fs');var fs_extra=require(_0x0023('0xa'));var _=require(_0x0023('0xb'));var squel=require(_0x0023('0xc'));var crypto=require(_0x0023('0xd'));var jsforce=require(_0x0023('0xe'));var deskjs=require(_0x0023('0xf'));var toCsv=require(_0x0023('0x8'));var querystring=require('querystring');var Papa=require(_0x0023('0x10'));var Redis=require(_0x0023('0x11'));var authService=require(_0x0023('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0023('0x13'));var hardwareService=require(_0x0023('0x14'));var logger=require(_0x0023('0x15'))(_0x0023('0x16'));var utils=require(_0x0023('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0023('0x18'));var db=require(_0x0023('0x19'))['db'];function respondWithStatusCode(_0x50f1ab,_0x233729){_0x233729=_0x233729||0xcc;return function(_0x19c4f7){if(_0x19c4f7){return _0x50f1ab['sendStatus'](_0x233729);}return _0x50f1ab[_0x0023('0x1a')](_0x233729)[_0x0023('0x1b')]();};}function respondWithResult(_0x5a368b,_0xc44674){_0xc44674=_0xc44674||0xc8;return function(_0x2f29e6){if(_0x2f29e6){return _0x5a368b[_0x0023('0x1a')](_0xc44674)[_0x0023('0x1c')](_0x2f29e6);}};}function respondWithFilteredResult(_0x3ead94,_0x47f5ed){return function(_0x416bbc){if(_0x416bbc){var _0x4acc87=typeof _0x47f5ed[_0x0023('0x1d')]==='undefined'&&typeof _0x47f5ed[_0x0023('0x1e')]===_0x0023('0x1f');var _0x2de3d2=_0x416bbc[_0x0023('0x20')];var _0x2922c8=_0x4acc87?0x0:_0x47f5ed[_0x0023('0x1d')];var _0x4f4593=_0x4acc87?_0x416bbc[_0x0023('0x20')]:_0x47f5ed['offset']+_0x47f5ed[_0x0023('0x1e')];var _0x32f51e;if(_0x4f4593>=_0x2de3d2){_0x4f4593=_0x2de3d2;_0x32f51e=0xc8;}else{_0x32f51e=0xce;}_0x3ead94[_0x0023('0x1a')](_0x32f51e);return _0x3ead94[_0x0023('0x21')](_0x0023('0x22'),_0x2922c8+'-'+_0x4f4593+'/'+_0x2de3d2)[_0x0023('0x1c')](_0x416bbc);}return null;};}function patchUpdates(_0x55efab){return function(_0xae4819){try{jsonpatch[_0x0023('0x23')](_0xae4819,_0x55efab,!![]);}catch(_0x4adbec){return BPromise[_0x0023('0x24')](_0x4adbec);}return _0xae4819['save']();};}function saveUpdates(_0x3d4d4b,_0x127705){return function(_0x242eef){if(_0x242eef){return _0x242eef[_0x0023('0x25')](_0x3d4d4b)[_0x0023('0x26')](function(_0x268d6c){return _0x268d6c;});}return null;};}function removeEntity(_0x38f7f6,_0xb98360){return function(_0x422a55){if(_0x422a55){return _0x422a55[_0x0023('0x27')]()[_0x0023('0x26')](function(){_0x38f7f6[_0x0023('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x476831,_0x418c8a){return function(_0x1c5286){if(!_0x1c5286){_0x476831[_0x0023('0x28')](0x194);}return _0x1c5286;};}function handleError(_0x117b2b,_0x1ee511){_0x1ee511=_0x1ee511||0x1f4;return function(_0x17f2e7){logger[_0x0023('0x29')](_0x17f2e7[_0x0023('0x2a')]);if(_0x17f2e7[_0x0023('0x2b')]){delete _0x17f2e7[_0x0023('0x2b')];}_0x117b2b[_0x0023('0x1a')](_0x1ee511)['send'](_0x17f2e7);};}exports[_0x0023('0x2c')]=function(_0x4752f8,_0xa41192){var _0x4308d4={},_0x3c7bec={},_0x2a47e6={'count':0x0,'rows':[]};var _0x5ce17d=_[_0x0023('0x2d')](db[_0x0023('0x2e')]['rawAttributes'],function(_0xa286a2){return{'name':_0xa286a2['fieldName'],'type':_0xa286a2[_0x0023('0x2f')][_0x0023('0x30')]};});_0x3c7bec[_0x0023('0x31')]=_[_0x0023('0x2d')](_0x5ce17d,_0x0023('0x2b'));_0x3c7bec[_0x0023('0x32')]=_['keys'](_0x4752f8['query']);_0x3c7bec['filters']=_[_0x0023('0x33')](_0x3c7bec[_0x0023('0x31')],_0x3c7bec[_0x0023('0x32')]);_0x4308d4[_0x0023('0x34')]=_[_0x0023('0x33')](_0x3c7bec[_0x0023('0x31')],qs['fields'](_0x4752f8[_0x0023('0x32')][_0x0023('0x35')]));_0x4308d4[_0x0023('0x34')]=_0x4308d4[_0x0023('0x34')][_0x0023('0x36')]?_0x4308d4[_0x0023('0x34')]:_0x3c7bec[_0x0023('0x31')];if(!_0x4752f8[_0x0023('0x32')][_0x0023('0x37')](_0x0023('0x38'))){_0x4308d4[_0x0023('0x1e')]=qs['limit'](_0x4752f8[_0x0023('0x32')][_0x0023('0x1e')]);_0x4308d4[_0x0023('0x1d')]=qs['offset'](_0x4752f8['query'][_0x0023('0x1d')]);}_0x4308d4['order']=qs[_0x0023('0x39')](_0x4752f8[_0x0023('0x32')][_0x0023('0x39')]);_0x4308d4['where']=qs[_0x0023('0x3a')](_[_0x0023('0x3b')](_0x4752f8[_0x0023('0x32')],_0x3c7bec[_0x0023('0x3a')]),_0x5ce17d);if(_0x4752f8['query'][_0x0023('0x3c')]){_0x4308d4[_0x0023('0x3d')]=_[_0x0023('0x3e')](_0x4308d4[_0x0023('0x3d')],{'$or':_['map'](_0x5ce17d,function(_0x8c7b2b){if(_0x8c7b2b[_0x0023('0x2f')]!=='VIRTUAL'){var _0x94c4ef={};_0x94c4ef[_0x8c7b2b[_0x0023('0x2b')]]={'$like':'%'+_0x4752f8['query'][_0x0023('0x3c')]+'%'};return _0x94c4ef;}})});}_0x4308d4=_[_0x0023('0x3e')]({},_0x4308d4,_0x4752f8[_0x0023('0x3f')]);var _0x9657ad={'where':_0x4308d4[_0x0023('0x3d')]};return db[_0x0023('0x2e')][_0x0023('0x20')](_0x9657ad)[_0x0023('0x26')](function(_0xab3bfa){_0x2a47e6[_0x0023('0x20')]=_0xab3bfa;if(_0x4752f8[_0x0023('0x32')][_0x0023('0x40')]){_0x4308d4[_0x0023('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_0x0023('0x42')](_0x4308d4);})['then'](function(_0x3b0e08){_0x2a47e6[_0x0023('0x43')]=_0x3b0e08;return _0x2a47e6;})[_0x0023('0x26')](respondWithFilteredResult(_0xa41192,_0x4308d4))[_0x0023('0x44')](handleError(_0xa41192,null));};exports[_0x0023('0x45')]=function(_0x55f675,_0x2b0200){var _0x4a889e={'raw':!![],'where':{'id':_0x55f675[_0x0023('0x46')]['id']}},_0x4f6c32={};_0x4f6c32[_0x0023('0x31')]=_[_0x0023('0x47')](db[_0x0023('0x2e')][_0x0023('0x48')]);_0x4f6c32[_0x0023('0x32')]=_[_0x0023('0x47')](_0x55f675[_0x0023('0x32')]);_0x4f6c32[_0x0023('0x3a')]=_[_0x0023('0x33')](_0x4f6c32[_0x0023('0x31')],_0x4f6c32[_0x0023('0x32')]);_0x4a889e[_0x0023('0x34')]=_[_0x0023('0x33')](_0x4f6c32[_0x0023('0x31')],qs[_0x0023('0x35')](_0x55f675[_0x0023('0x32')][_0x0023('0x35')]));_0x4a889e['attributes']=_0x4a889e[_0x0023('0x34')][_0x0023('0x36')]?_0x4a889e['attributes']:_0x4f6c32[_0x0023('0x31')];if(_0x55f675[_0x0023('0x32')][_0x0023('0x40')]){_0x4a889e[_0x0023('0x41')]=[{'all':!![]}];}_0x4a889e=_[_0x0023('0x3e')]({},_0x4a889e,_0x55f675[_0x0023('0x3f')]);return db['FaxApplication'][_0x0023('0x49')](_0x4a889e)[_0x0023('0x26')](handleEntityNotFound(_0x2b0200,null))[_0x0023('0x26')](respondWithResult(_0x2b0200,null))[_0x0023('0x44')](handleError(_0x2b0200,null));};exports[_0x0023('0x4a')]=function(_0x179d6c,_0x3877b4){return db[_0x0023('0x2e')][_0x0023('0x4a')](_0x179d6c[_0x0023('0x4b')],{})[_0x0023('0x26')](respondWithResult(_0x3877b4,0xc9))['catch'](handleError(_0x3877b4,null));};exports[_0x0023('0x25')]=function(_0x524676,_0x17219e){if(_0x524676[_0x0023('0x4b')]['id']){delete _0x524676[_0x0023('0x4b')]['id'];}return db[_0x0023('0x2e')]['find']({'where':{'id':_0x524676['params']['id']}})[_0x0023('0x26')](handleEntityNotFound(_0x17219e,null))[_0x0023('0x26')](saveUpdates(_0x524676[_0x0023('0x4b')],null))['then'](respondWithResult(_0x17219e,null))[_0x0023('0x44')](handleError(_0x17219e,null));};exports[_0x0023('0x27')]=function(_0xcd8a84,_0xcc4da8){return db[_0x0023('0x2e')]['find']({'where':{'id':_0xcd8a84[_0x0023('0x46')]['id']}})[_0x0023('0x26')](handleEntityNotFound(_0xcc4da8,null))[_0x0023('0x26')](removeEntity(_0xcc4da8,null))['catch'](handleError(_0xcc4da8,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 05b1129..ba018ed 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 _0x490e=['./faxApplication.attributes','exports','define','utf8mb4','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x1fa33d,_0x4ae482){var _0x41c3ff=function(_0x1a9c70){while(--_0x1a9c70){_0x1fa33d['push'](_0x1fa33d['shift']());}};_0x41c3ff(++_0x4ae482);}(_0x490e,0x190));var _0xe490=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x490e[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0xe490('0x0'));var logger=require(_0xe490('0x1'))(_0xe490('0x2'));var moment=require('moment');var BPromise=require(_0xe490('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe490('0x4'));var rimraf=require(_0xe490('0x5'));var config=require(_0xe490('0x6'));var attributes=require(_0xe490('0x7'));module[_0xe490('0x8')]=function(_0x45cab9,_0x11cccd){return _0x45cab9[_0xe490('0x9')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe490('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb6c4=['fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x2dbd12,_0x3eedd2){var _0x378a8=function(_0x3bc946){while(--_0x3bc946){_0x2dbd12['push'](_0x2dbd12['shift']());}};_0x378a8(++_0x3eedd2);}(_0xb6c4,0x1d7));var _0x4b6c=function(_0x723d7c,_0x167f6d){_0x723d7c=_0x723d7c-0x0;var _0x470b5b=_0xb6c4[_0x723d7c];return _0x470b5b;};'use strict';var _=require(_0x4b6c('0x0'));var util=require(_0x4b6c('0x1'));var logger=require(_0x4b6c('0x2'))(_0x4b6c('0x3'));var moment=require('moment');var BPromise=require(_0x4b6c('0x4'));var rp=require(_0x4b6c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b6c('0x6'));var attributes=require(_0x4b6c('0x7'));module[_0x4b6c('0x8')]=function(_0x19dff5,_0x3a73b2){return _0x19dff5[_0x4b6c('0x9')]('FaxApplication',attributes,{'tableName':_0x4b6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b6c('0xb'),'collate':_0x4b6c('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 1a67c57..b310ed1 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 _0xb81d=['raw','where','attributes','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','UpdateFaxApplication','update','body','options'];(function(_0x4de874,_0x5b5115){var _0x24aaac=function(_0x17a936){while(--_0x17a936){_0x4de874['push'](_0x4de874['shift']());}};_0x24aaac(++_0x5b5115);}(_0xb81d,0x14e));var _0xdb81=function(_0x44a645,_0x378373){_0x44a645=_0x44a645-0x0;var _0x3697dd=_0xb81d[_0x44a645];return _0x3697dd;};'use strict';var _=require(_0xdb81('0x0'));var util=require('util');var moment=require(_0xdb81('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb81('0x2'));var db=require(_0xdb81('0x3'))['db'];var utils=require(_0xdb81('0x4'));var logger=require(_0xdb81('0x5'))(_0xdb81('0x6'));var config=require(_0xdb81('0x7'));var jayson=require(_0xdb81('0x8'));var client=jayson[_0xdb81('0x9')][_0xdb81('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ce56d,_0x597e43,_0x15c2e1){return new BPromise(function(_0x2103c1,_0x2cfd61){return client[_0xdb81('0xb')](_0x5ce56d,_0x15c2e1)[_0xdb81('0xc')](function(_0x339e9b){logger[_0xdb81('0xd')](_0xdb81('0xe'),_0x597e43,_0xdb81('0xf'));logger[_0xdb81('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x597e43,_0xdb81('0xf'),JSON[_0xdb81('0x11')](_0x339e9b));if(_0x339e9b['error']){if(_0x339e9b['error'][_0xdb81('0x12')]===0x1f4){logger[_0xdb81('0x13')]('FaxApplication,\x20%s,\x20%s',_0x597e43,_0x339e9b[_0xdb81('0x13')][_0xdb81('0x14')]);return _0x2cfd61(_0x339e9b[_0xdb81('0x13')][_0xdb81('0x14')]);}logger['error'](_0xdb81('0xe'),_0x597e43,_0x339e9b[_0xdb81('0x13')][_0xdb81('0x14')]);return _0x2103c1(_0x339e9b[_0xdb81('0x13')][_0xdb81('0x14')]);}else{logger[_0xdb81('0xd')]('FaxApplication,\x20%s,\x20%s',_0x597e43,'request\x20sent');_0x2103c1(_0x339e9b[_0xdb81('0x15')]['message']);}})['catch'](function(_0x219a5d){logger['error']('FaxApplication,\x20%s,\x20%s',_0x597e43,_0x219a5d);_0x2cfd61(_0x219a5d);});});}exports[_0xdb81('0x16')]=function(_0x4d8ea4){var _0x131df3=this;return new Promise(function(_0x2d8c10,_0x1f3a18){return db['FaxApplication'][_0xdb81('0x17')](_0x4d8ea4[_0xdb81('0x18')],{'raw':_0x4d8ea4[_0xdb81('0x19')]?_0x4d8ea4[_0xdb81('0x19')][_0xdb81('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d8ea4[_0xdb81('0x19')]?_0x4d8ea4[_0xdb81('0x19')][_0xdb81('0x1b')]||null:null,'attributes':_0x4d8ea4[_0xdb81('0x19')]?_0x4d8ea4[_0xdb81('0x19')][_0xdb81('0x1c')]||null:null,'limit':_0x4d8ea4['options']?_0x4d8ea4['options']['limit']||null:null})[_0xdb81('0xc')](function(_0x3f588f){logger['info']('UpdateFaxApplication',_0x4d8ea4);logger[_0xdb81('0x10')](_0xdb81('0x16'),_0x4d8ea4,JSON[_0xdb81('0x11')](_0x3f588f));_0x2d8c10(_0x3f588f);})[_0xdb81('0x1d')](function(_0x53531f){logger['error'](_0xdb81('0x16'),_0x53531f[_0xdb81('0x14')],_0x4d8ea4);_0x1f3a18(_0x131df3[_0xdb81('0x13')](0x1f4,_0x53531f[_0xdb81('0x14')]));});});}; \ No newline at end of file +var _0x1948=['moment','randomstring','../../mysqldb','rpc','client','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','limit','lodash'];(function(_0x2f6a59,_0x149feb){var _0x3642d8=function(_0x5edabf){while(--_0x5edabf){_0x2f6a59['push'](_0x2f6a59['shift']());}};_0x3642d8(++_0x149feb);}(_0x1948,0x1b4));var _0x8194=function(_0x3a3663,_0x55ef83){_0x3a3663=_0x3a3663-0x0;var _0x5e0dc7=_0x1948[_0x3a3663];return _0x5e0dc7;};'use strict';var _=require(_0x8194('0x0'));var util=require('util');var moment=require(_0x8194('0x1'));var BPromise=require('bluebird');var rs=require(_0x8194('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8194('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8194('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8194('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3450,_0x1c7625,_0x30a150){return new BPromise(function(_0x2f3ccd,_0x49ab88){return client['request'](_0x2e3450,_0x30a150)[_0x8194('0x6')](function(_0x43869e){logger[_0x8194('0x7')](_0x8194('0x8'),_0x1c7625,_0x8194('0x9'));logger[_0x8194('0xa')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1c7625,_0x8194('0x9'),JSON['stringify'](_0x43869e));if(_0x43869e[_0x8194('0xb')]){if(_0x43869e[_0x8194('0xb')][_0x8194('0xc')]===0x1f4){logger[_0x8194('0xb')]('FaxApplication,\x20%s,\x20%s',_0x1c7625,_0x43869e[_0x8194('0xb')]['message']);return _0x49ab88(_0x43869e[_0x8194('0xb')][_0x8194('0xd')]);}logger['error'](_0x8194('0x8'),_0x1c7625,_0x43869e[_0x8194('0xb')]['message']);return _0x2f3ccd(_0x43869e[_0x8194('0xb')][_0x8194('0xd')]);}else{logger[_0x8194('0x7')]('FaxApplication,\x20%s,\x20%s',_0x1c7625,_0x8194('0x9'));_0x2f3ccd(_0x43869e[_0x8194('0xe')][_0x8194('0xd')]);}})[_0x8194('0xf')](function(_0x4bb8da){logger['error'](_0x8194('0x8'),_0x1c7625,_0x4bb8da);_0x49ab88(_0x4bb8da);});});}exports[_0x8194('0x10')]=function(_0x38be1a){var _0x3d1842=this;return new Promise(function(_0x3261df,_0xacc4ec){return db[_0x8194('0x11')]['update'](_0x38be1a[_0x8194('0x12')],{'raw':_0x38be1a['options']?_0x38be1a[_0x8194('0x13')][_0x8194('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38be1a[_0x8194('0x13')]?_0x38be1a['options'][_0x8194('0x15')]||null:null,'attributes':_0x38be1a[_0x8194('0x13')]?_0x38be1a[_0x8194('0x13')]['attributes']||null:null,'limit':_0x38be1a[_0x8194('0x13')]?_0x38be1a[_0x8194('0x13')][_0x8194('0x16')]||null:null})[_0x8194('0x6')](function(_0x4a14f1){logger['info'](_0x8194('0x10'),_0x38be1a);logger[_0x8194('0xa')](_0x8194('0x10'),_0x38be1a,JSON['stringify'](_0x4a14f1));_0x3261df(_0x4a14f1);})['catch'](function(_0x105785){logger[_0x8194('0xb')](_0x8194('0x10'),_0x105785['message'],_0x38be1a);_0xacc4ec(_0x3d1842[_0x8194('0xb')](0x1f4,_0x105785[_0x8194('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 750ad05..d8bc39e 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 _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefda,0x96));var _0xaefd=function(_0x25be12,_0x5cbda0){_0x25be12=_0x25be12-0x0;var _0x3b9a8b=_0xefda[_0x25be12];return _0x3b9a8b;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file +var _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x3f1846,_0x130b87){var _0x1ced5c=function(_0x1ab561){while(--_0x1ab561){_0x3f1846['push'](_0x3f1846['shift']());}};_0x1ced5c(++_0x130b87);}(_0x7708,0x188));var _0x8770=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x7708[_0x460150];return _0x340677;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./faxApplication.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 466be14..70eb3da 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 _0x0c26=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3ff0f0,_0x5523bf){var _0x5dc82a=function(_0x14d26d){while(--_0x14d26d){_0x3ff0f0['push'](_0x3ff0f0['shift']());}};_0x5dc82a(++_0x5523bf);}(_0x0c26,0x1e7));var _0x60c2=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0c26[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x60c2('0x0'));module[_0x60c2('0x1')]={'closed':{'type':Sequelize[_0x60c2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x60c2('0x3')]},'disposition':{'type':Sequelize[_0x60c2('0x4')]},'secondDisposition':{'type':Sequelize[_0x60c2('0x4')]},'thirdDisposition':{'type':Sequelize[_0x60c2('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x60c2('0x3')]},'fax':{'type':Sequelize[_0x60c2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x60c2('0x5')]('in',_0x60c2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x60c2('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x60c2('0x5')]('in',_0x60c2('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xcaef=['STRING','out','exports','BOOLEAN','DATE'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xcaef,0x1c9));var _0xfcae=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xcaef[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require('sequelize');module[_0xfcae('0x0')]={'closed':{'type':Sequelize[_0xfcae('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfcae('0x2')]},'disposition':{'type':Sequelize[_0xfcae('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xfcae('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xfcae('0x2')]},'fax':{'type':Sequelize[_0xfcae('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfcae('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfcae('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfcae('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 043d136..2a6a26a 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 _0xc5ba=['apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','talking','unmanaged','total','closed','UserId','waiting','answered','index','rawAttributes','fieldName','keys','filters','intersection','model','fields','query','attributes','length','hasOwnProperty','order','sort','where','field','color','from','select','u.id','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','params','includeAll','include','merge','options','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','tmp','join','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range'];(function(_0x4369d0,_0x4bc2f2){var _0x1e8675=function(_0x35d79d){while(--_0x35d79d){_0x4369d0['push'](_0x4369d0['shift']());}};_0x1e8675(++_0x4bc2f2);}(_0xc5ba,0xb9));var _0xac5b=function(_0x245545,_0x4983b3){_0x245545=_0x245545-0x0;var _0x106a5f=_0xc5ba[_0x245545];return _0x106a5f;};'use strict';var emlformat=require(_0xac5b('0x0'));var rimraf=require(_0xac5b('0x1'));var zipdir=require(_0xac5b('0x2'));var jsonpatch=require(_0xac5b('0x3'));var rp=require(_0xac5b('0x4'));var moment=require(_0xac5b('0x5'));var BPromise=require(_0xac5b('0x6'));var Mustache=require(_0xac5b('0x7'));var util=require(_0xac5b('0x8'));var path=require(_0xac5b('0x9'));var sox=require(_0xac5b('0xa'));var csv=require(_0xac5b('0xb'));var ejs=require(_0xac5b('0xc'));var fs=require('fs');var fs_extra=require(_0xac5b('0xd'));var _=require(_0xac5b('0xe'));var squel=require(_0xac5b('0xf'));var crypto=require(_0xac5b('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac5b('0xb'));var querystring=require('querystring');var Papa=require(_0xac5b('0x11'));var Redis=require(_0xac5b('0x12'));var authService=require(_0xac5b('0x13'));var qs=require(_0xac5b('0x14'));var as=require(_0xac5b('0x15'));var hardwareService=require(_0xac5b('0x16'));var logger=require(_0xac5b('0x17'))(_0xac5b('0x18'));var utils=require(_0xac5b('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xac5b('0x1a'));var db=require(_0xac5b('0x1b'))['db'];config[_0xac5b('0x1c')]=_[_0xac5b('0x1d')](config[_0xac5b('0x1c')],{'host':_0xac5b('0x1e'),'port':0x18eb});var socket=require(_0xac5b('0x1f'))(new Redis(config[_0xac5b('0x1c')]));require(_0xac5b('0x20'))[_0xac5b('0x21')](socket);function respondWithStatusCode(_0x45372c,_0xab11ec){_0xab11ec=_0xab11ec||0xcc;return function(_0x5e1482){if(_0x5e1482){return _0x45372c[_0xac5b('0x22')](_0xab11ec);}return _0x45372c[_0xac5b('0x23')](_0xab11ec)[_0xac5b('0x24')]();};}function respondWithResult(_0x2e4742,_0xa0b4f2){_0xa0b4f2=_0xa0b4f2||0xc8;return function(_0x73f919){if(_0x73f919){return _0x2e4742[_0xac5b('0x23')](_0xa0b4f2)[_0xac5b('0x25')](_0x73f919);}};}function respondWithFilteredResult(_0xb0d0a3,_0x1e2385){return function(_0x11e6fa){if(_0x11e6fa){var _0x551ccf=typeof _0x1e2385[_0xac5b('0x26')]==='undefined'&&typeof _0x1e2385[_0xac5b('0x27')]==='undefined';var _0x5453b9=_0x11e6fa[_0xac5b('0x28')];var _0x5021a5=_0x551ccf?0x0:_0x1e2385['offset'];var _0x564dfe=_0x551ccf?_0x11e6fa[_0xac5b('0x28')]:_0x1e2385['offset']+_0x1e2385[_0xac5b('0x27')];var _0x2f88cd;if(_0x564dfe>=_0x5453b9){_0x564dfe=_0x5453b9;_0x2f88cd=0xc8;}else{_0x2f88cd=0xce;}_0xb0d0a3[_0xac5b('0x23')](_0x2f88cd);return _0xb0d0a3[_0xac5b('0x29')](_0xac5b('0x2a'),_0x5021a5+'-'+_0x564dfe+'/'+_0x5453b9)['json'](_0x11e6fa);}return null;};}function patchUpdates(_0x50c7ff){return function(_0x5bc6e7){try{jsonpatch[_0xac5b('0x2b')](_0x5bc6e7,_0x50c7ff,!![]);}catch(_0x48179d){return BPromise[_0xac5b('0x2c')](_0x48179d);}return _0x5bc6e7[_0xac5b('0x2d')]();};}function saveUpdates(_0x5a8a5a,_0xede69){return function(_0x4735cf){if(_0x4735cf){return _0x4735cf[_0xac5b('0x2e')](_0x5a8a5a)[_0xac5b('0x2f')](function(_0x3c3b08){return _0x3c3b08;});}return null;};}function removeEntity(_0x40e99f,_0x1f923d){return function(_0x44127a){if(_0x44127a){return _0x44127a[_0xac5b('0x30')]()[_0xac5b('0x2f')](function(){_0x40e99f['status'](0xcc)[_0xac5b('0x24')]();});}};}function handleEntityNotFound(_0xa48194,_0x351d33){return function(_0x4191a7){if(!_0x4191a7){_0xa48194[_0xac5b('0x22')](0x194);}return _0x4191a7;};}function handleError(_0x28daf0,_0x1d44f3){_0x1d44f3=_0x1d44f3||0x1f4;return function(_0x108027){logger[_0xac5b('0x31')](_0x108027[_0xac5b('0x32')]);if(_0x108027[_0xac5b('0x33')]){delete _0x108027['name'];}_0x28daf0[_0xac5b('0x23')](_0x1d44f3)[_0xac5b('0x34')](_0x108027);};}function getInteractionUsers(_0x3040f7,_0x59c870){return new BPromise(function(_0x7f2c21,_0x595e84){try{if(_0x59c870[_0x3040f7['id']]){_0x3040f7[_0xac5b('0x35')]=_[_0xac5b('0x36')](_0x59c870[_0x3040f7['id']],function(_0x2559f8){return{'id':_0x2559f8['id'],'fullname':_0x2559f8[_0xac5b('0x37')]};});}}catch(_0x47f417){_0x595e84(_0x47f417);}_0x7f2c21(_0x3040f7);});}function getInteractionTags(_0x1e046a,_0x5e8627){return new BPromise(function(_0x486245,_0x23d51d){try{if(_0x1e046a[_0xac5b('0x38')]){_0x1e046a['Tags']=[];_0x1e046a['TagIds'][_0xac5b('0x39')](',')[_0xac5b('0x3a')](function(_0x5b024d){_0x1e046a[_0xac5b('0x3b')][_0xac5b('0x3c')](_0x5e8627[_0x5b024d]);});}delete _0x1e046a[_0xac5b('0x38')];}catch(_0x5bd25a){_0x23d51d(_0x5bd25a);}_0x486245(_0x1e046a);});}function updateFaxInteraction(_0x54c6af,_0xd1ee60,_0x41bf26){return new BPromise(function(_0x57a460,_0x2f7e7f){return getInteractionUsers(_0x54c6af,_0x41bf26)[_0xac5b('0x2f')](function(_0x3f267b){return getInteractionTags(_0x3f267b,_0xd1ee60);})[_0xac5b('0x2f')](function(_0x5b8cf6){return getStateInteraction(_0x5b8cf6);})[_0xac5b('0x2f')](function(_0x2bfe03){_0x57a460(_0x2bfe03);})[_0xac5b('0x3d')](function(_0x43f110){_0x2f7e7f(_0x43f110);});});}function getStateInteraction(_0x252402){return new BPromise(function(_0x5dbf7b,_0x81e0f4){_0x252402['waiting']=0x0;_0x252402[_0xac5b('0x3e')]=0x0;_0x252402['answered']=0x0;_0x252402[_0xac5b('0x3f')]=0x0;_0x252402[_0xac5b('0x40')]=0x0;if(!_0x252402[_0xac5b('0x41')]&&!_0x252402[_0xac5b('0x42')])_0x252402[_0xac5b('0x43')]+=0x1;if(!_0x252402[_0xac5b('0x41')]&&_0x252402['UserId'])_0x252402[_0xac5b('0x3e')]+=0x1;if(_0x252402[_0xac5b('0x41')]&&_0x252402[_0xac5b('0x42')])_0x252402[_0xac5b('0x44')]+=0x1;if(_0x252402[_0xac5b('0x41')]&&!_0x252402[_0xac5b('0x42')])_0x252402[_0xac5b('0x3f')]+=0x1;_0x252402['total']+=0x1;_0x5dbf7b(_0x252402);});}exports[_0xac5b('0x45')]=function(_0x2f4e74,_0x1d918f){var _0x1e1e03={},_0x441fd9={},_0x3fc422={'count':0x0,'rows':[]};var _0x5aeaea=_[_0xac5b('0x36')](db['FaxInteraction'][_0xac5b('0x46')],function(_0x4b4ce0){return{'name':_0x4b4ce0[_0xac5b('0x47')],'type':_0x4b4ce0['type']['key']};});_0x441fd9['model']=_['map'](_0x5aeaea,'name');_0x441fd9['query']=_[_0xac5b('0x48')](_0x2f4e74['query']);_0x441fd9[_0xac5b('0x49')]=_[_0xac5b('0x4a')](_0x441fd9[_0xac5b('0x4b')],_0x441fd9['query']);_0x1e1e03['attributes']=_[_0xac5b('0x4a')](_0x441fd9['model'],qs[_0xac5b('0x4c')](_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x4c')]));_0x1e1e03[_0xac5b('0x4e')]=_0x1e1e03['attributes'][_0xac5b('0x4f')]?_0x1e1e03[_0xac5b('0x4e')]:_0x441fd9[_0xac5b('0x4b')];if(!_0x2f4e74['query'][_0xac5b('0x50')]('nolimit')){_0x1e1e03[_0xac5b('0x27')]=qs[_0xac5b('0x27')](_0x2f4e74[_0xac5b('0x4d')]['limit']);_0x1e1e03[_0xac5b('0x26')]=qs[_0xac5b('0x26')](_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x26')]);}_0x1e1e03[_0xac5b('0x51')]=qs[_0xac5b('0x52')](_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x52')]);_0x1e1e03[_0xac5b('0x53')]=qs['filters'](_['pick'](_0x2f4e74[_0xac5b('0x4d')],_0x441fd9['filters']),_0x5aeaea);var _0x50b463=[];var _0x50719d=squel['select']()['field']('id')[_0xac5b('0x54')](_0xac5b('0x33'))[_0xac5b('0x54')](_0xac5b('0x55'))[_0xac5b('0x56')]('tools_tags');var _0x483677=squel[_0xac5b('0x57')]()[_0xac5b('0x54')](_0xac5b('0x58'))[_0xac5b('0x54')](_0xac5b('0x59'))[_0xac5b('0x54')](_0xac5b('0x5a'))[_0xac5b('0x56')]('user_has_fax_interactions','ui')[_0xac5b('0x5b')](_0xac5b('0x5c'),'u',_0xac5b('0x5d'));var _0x17d09e=squel[_0xac5b('0x57')]()[_0xac5b('0x56')](_0xac5b('0x5e'),'i')['left_join'](_0xac5b('0x5f'),'c',_0xac5b('0x60'))['left_join']('users','o',_0xac5b('0x61'))[_0xac5b('0x5b')](_0xac5b('0x62'),'a',_0xac5b('0x63'))[_0xac5b('0x5b')](_0xac5b('0x64'),'me',_0xac5b('0x65'))[_0xac5b('0x5b')](_0xac5b('0x66'),'it',_0xac5b('0x67'))[_0xac5b('0x5b')](_0xac5b('0x68'),'t',_0xac5b('0x69'));var _0x3f074a=squel[_0xac5b('0x6a')]();var _0x6a7958=[];var _0x34be27=squel[_0xac5b('0x6a')]();var _0x1daa36;if(_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x6b')]){_0x1daa36=as[_0xac5b('0x6c')](_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x6b')]);var _0x40944c=_0x1daa36['sqlOperator'];for(var _0x43a617=0x0;_0x43a617<_0x1daa36[_0xac5b('0x6d')][_0xac5b('0x4f')];_0x43a617++){var _0x280096=_0x1daa36['conditions'][_0x43a617];var _0x178998='i';var _0x43f804=_[_0xac5b('0x6e')](_0x5aeaea,[_0xac5b('0x33'),_0x280096['field']]);if(!_0x43f804){switch(_0x280096[_0xac5b('0x54')]){case _0xac5b('0x6f'):if(_0x280096[_0xac5b('0x70')]==0x1){_0x17d09e[_0xac5b('0x71')]('`'+_0x280096[_0xac5b('0x54')]+_0xac5b('0x72'));}else{_0x17d09e[_0xac5b('0x71')]('`'+_0x280096['field']+_0xac5b('0x73'));}break;case'Contact':if(_0x280096[_0xac5b('0x74')]===_0xac5b('0x75')){if(_0x280096[_0xac5b('0x70')][_0xac5b('0x39')]('\x20')[_0xac5b('0x4f')]>0x1){_0x3f074a[_0x40944c](_0xac5b('0x76'),qs['getFullTextValue'](_0x280096[_0xac5b('0x70')]),null);}else{var _0x267db3='%'+_0x280096['value']+'%';_0x3f074a[_0x40944c](_0xac5b('0x77'),_0x267db3,_0x267db3,_0x267db3);}}else{_0x43f804=_[_0xac5b('0x6e')](_0x5aeaea,['name',_0xac5b('0x78')]);_0x280096['field']=_0xac5b('0x78');_0x59fa3d=as[_0xac5b('0x79')](_0x178998,_0x43f804[_0xac5b('0x7a')],_0x280096);_0x3f074a[_0x40944c](_0x59fa3d['text'],_0x59fa3d[_0xac5b('0x70')][_0xac5b('0x7b')],_0x59fa3d[_0xac5b('0x70')][_0xac5b('0x24')]);}break;case _0xac5b('0x7c'):var _0x573a91=_0x280096['value']['split'](',')[_0xac5b('0x36')](function(_0x28cf16){return Number(_0x28cf16);});_0x573a91[_0xac5b('0x3a')](function(_0x5e17b8){_0x34be27['or'](_0xac5b('0x7d'),'%,'+_0x5e17b8+',%');});_0x6a7958=_[_0xac5b('0x7e')](_0x6a7958,_0x573a91);break;case _0xac5b('0x7f'):if(_0x280096[_0xac5b('0x74')]===_0xac5b('0x75')){_0x3f074a[_0x40944c](_0xac5b('0x80'),'%'+_0x280096['value']+'%',null);}else{_0x43f804=_['find'](_0x5aeaea,['name',_0xac5b('0x42')]);_0x280096[_0xac5b('0x54')]=_0xac5b('0x42');_0x59fa3d=as[_0xac5b('0x79')](_0x178998,_0x43f804[_0xac5b('0x7a')],_0x280096);_0x3f074a[_0x40944c](_0x59fa3d[_0xac5b('0x81')],_0x59fa3d[_0xac5b('0x70')][_0xac5b('0x7b')],_0x59fa3d[_0xac5b('0x70')][_0xac5b('0x24')]);}break;case'body':_0x59fa3d=as[_0xac5b('0x79')]('me',null,_0x280096);_0x3f074a[_0x40944c](_0x59fa3d[_0xac5b('0x81')],_0x59fa3d['value'][_0xac5b('0x7b')],_0x59fa3d[_0xac5b('0x70')][_0xac5b('0x24')]);break;}}else{var _0x59fa3d=as[_0xac5b('0x79')](_0x178998,_0x43f804['type'],_0x280096);_0x3f074a[_0x40944c](_0x59fa3d[_0xac5b('0x81')],_0x59fa3d['value'][_0xac5b('0x7b')],_0x59fa3d['value'][_0xac5b('0x24')]);}}}else{var _0x5bcc27=_(_0x2f4e74[_0xac5b('0x4d')])[_0xac5b('0x48')]()[_0xac5b('0x36')](function(_0x265e87){return _['some'](_0x5aeaea,[_0xac5b('0x33'),_0x265e87])?_0x265e87:undefined;})['compact']()['value']();if(!_[_0xac5b('0x82')](_0x5bcc27)){_0x5bcc27['forEach'](function(_0x4f9f15){if(_0x4f9f15===_0xac5b('0x83')){_0x17d09e['where'](_0xac5b('0x84'),[][_0xac5b('0x85')](_0x2f4e74[_0xac5b('0x4d')][_0x4f9f15]));}else if(_0x4f9f15===_0xac5b('0x86')){var _0x485528=JSON[_0xac5b('0x87')](_0x2f4e74[_0xac5b('0x4d')][_0x4f9f15])[_0xac5b('0x88')];var _0x36d6ea=JSON[_0xac5b('0x87')](_0x2f4e74[_0xac5b('0x4d')][_0x4f9f15])['$lte'];_0x17d09e[_0xac5b('0x53')](_0xac5b('0x89'),_0x485528,_0x36d6ea);}else{if(_0x2f4e74[_0xac5b('0x4d')][_0x4f9f15]==='null'){_0x17d09e[_0xac5b('0x53')]('i.'+_0x4f9f15+_0xac5b('0x8a'));}else{_0x17d09e[_0xac5b('0x53')]('i.'+_0x4f9f15+'\x20=\x20?',_0x2f4e74['query'][_0x4f9f15]);}}});}if(_0x2f4e74['query']['read']){if(_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x8b')]==0x1){_0x17d09e['having']('`unreadMessages`\x20=\x200');}else{_0x17d09e[_0xac5b('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x8c')]){_0x6a7958=_[_0xac5b('0x8d')](_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x8c')])?_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x8c')]:new Array(_0x2f4e74[_0xac5b('0x4d')]['tag']);_0x6a7958[_0xac5b('0x3a')](function(_0x1cb5a5){_0x34be27['or'](_0xac5b('0x7d'),'%,'+_0x1cb5a5+',%');});}if(_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x8e')]){var _0x10ccf2=_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x8e')][_0xac5b('0x8f')]('\x5c','\x5c\x5c')[_0xac5b('0x8f')](/'/g,'\x27\x27');if(qs[_0xac5b('0x90')](_0x10ccf2)){_0x3f074a['or']('i.id\x20LIKE\x20?',_0x10ccf2+'%')['or'](_0xac5b('0x91'),_0x10ccf2+'%');}_0x3f074a['or'](_0xac5b('0x92'),_0x10ccf2+'%');}}_0x17d09e['where'](_0x3f074a);_0x17d09e[_0xac5b('0x93')](_0xac5b('0x94'));var _0x2908f4={'type':db['Sequelize'][_0xac5b('0x95')][_0xac5b('0x96')],'raw':!![]};var _0xbe0eb=_0x17d09e[_0xac5b('0x97')]();_0xbe0eb[_0xac5b('0x54')]('i.id');_0xbe0eb[_0xac5b('0x54')](_0xac5b('0x98'),_0xac5b('0x6f'));if(_0x1e1e03[_0xac5b('0x51')]){_0x1e1e03['order'][_0xac5b('0x3a')](function(_0x5e0f21){var _0x387357=_0x5e0f21[0x0]==='contactName'?_0x5e0f21[0x0]:'i.'+_0x5e0f21[0x0];_0x17d09e[_0xac5b('0x51')](_0x387357,_0x5e0f21[0x1]===_0xac5b('0x99')?![]:!![]);});}if(!_[_0xac5b('0x82')](_0x6a7958)){_0x17d09e['having'](_0x34be27);_0xbe0eb[_0xac5b('0x53')](_0xac5b('0x9a'),_0x6a7958);}BPromise[_0xac5b('0x9b')]()[_0xac5b('0x2f')](function(){if(!_0x1daa36){if(_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x83')])return;_0xbe0eb[_0xac5b('0x53')](_0xac5b('0x9c'));_0x17d09e[_0xac5b('0x53')](_0xac5b('0x9c'));return;}if(_0x2f4e74[_0xac5b('0x9d')]['role']!==_0xac5b('0x9e'))return;return _0x2f4e74['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xac5b('0x2f')](function(_0x5e4de6){if(_[_0xac5b('0x82')](_0x5e4de6)){_0xbe0eb[_0xac5b('0x53')](_0xac5b('0x9f'));_0x17d09e[_0xac5b('0x53')](_0xac5b('0x9f'));}else{_0xbe0eb['where'](_0xac5b('0x84'),_['map'](_0x5e4de6,'id'));_0x17d09e[_0xac5b('0x53')]('i.FaxAccountId\x20IN\x20?',_[_0xac5b('0x36')](_0x5e4de6,'id'));}});})[_0xac5b('0x2f')](function(){if(_0x2f4e74['user']['role']===_0xac5b('0x9e')&&!_0x1daa36&&!_0x2f4e74['query']['FaxAccountId'])return[];return db[_0xac5b('0xa0')][_0xac5b('0x4d')](_0xbe0eb[_0xac5b('0xa1')](),_0x2908f4);})[_0xac5b('0x2f')](function(_0x245258){_0x3fc422[_0xac5b('0x28')]=_0x245258['length'];if(_0x3fc422[_0xac5b('0x28')]===0x0)return[];return db[_0xac5b('0xa0')]['query'](_0x50719d[_0xac5b('0xa1')](),_0x2908f4)[_0xac5b('0x2f')](function(_0x1ae972){_0x50b463=_[_0xac5b('0xa2')](_0x1ae972,'id');_0x2908f4=_['merge'](_0x2908f4,{'model':db[_0xac5b('0xa3')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f4e74[_0xac5b('0x4d')][_0xac5b('0x4c')]){_0x1e1e03[_0xac5b('0x4e')][_0xac5b('0x3a')](function(_0x139053){_0x17d09e[_0xac5b('0x54')]('i.'+_0x139053);});}else{_0x17d09e[_0xac5b('0x54')](_0xac5b('0x98'),_0xac5b('0x6f'));_0x17d09e[_0xac5b('0x54')](_0xac5b('0xa4'),_0xac5b('0xa5'));_0x17d09e[_0xac5b('0x54')](_0xac5b('0xa6'),_0xac5b('0xa7'));_0x17d09e[_0xac5b('0x54')]('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');_0x17d09e['field'](_0xac5b('0xa8'));_0x17d09e['field'](_0xac5b('0xa9'),_0xac5b('0xaa'));_0x17d09e['field'](_0xac5b('0xab'),_0xac5b('0xac'));_0x17d09e[_0xac5b('0x54')](_0xac5b('0xad'),'Contact.email');_0x17d09e['field'](_0xac5b('0xae'),_0xac5b('0xaf'));_0x17d09e['field'](_0xac5b('0xb0'),'Contact.mobile');_0x17d09e['field'](_0xac5b('0xb1'),_0xac5b('0xb2'));_0x17d09e[_0xac5b('0x54')]('o.fullname',_0xac5b('0xb3'));_0x17d09e[_0xac5b('0x54')](_0xac5b('0xb4'),'Owner.internal');_0x17d09e[_0xac5b('0x54')](_0xac5b('0xb5'),_0xac5b('0x38'));}if(_0x1e1e03[_0xac5b('0x27')])_0x17d09e[_0xac5b('0x27')](_0x1e1e03[_0xac5b('0x27')]);if(_0x1e1e03[_0xac5b('0x26')])_0x17d09e[_0xac5b('0x26')](_0x1e1e03[_0xac5b('0x26')]);return db[_0xac5b('0xa0')][_0xac5b('0x4d')](_0x17d09e['toString'](),_0x2908f4);})['then'](function(_0x309913){if(_0x309913[_0xac5b('0x4f')]>0x0)_0x483677[_0xac5b('0x53')](_0xac5b('0xb6'),_['map'](_0x309913,'id'));return db[_0xac5b('0xa0')][_0xac5b('0x4d')](_0x483677[_0xac5b('0xa1')](),_0x2908f4)[_0xac5b('0x2f')](function(_0x31cb30){var _0x1c85c4=_[_0xac5b('0xb7')](_0x31cb30,_0xac5b('0xb8'));var _0x416b7b=[];_0x309913[_0xac5b('0x3a')](function(_0x3f4092){_0x416b7b[_0xac5b('0x3c')](updateFaxInteraction(_0x3f4092,_0x50b463,_0x1c85c4));});return BPromise[_0xac5b('0xb9')](_0x416b7b);});});})[_0xac5b('0x2f')](function(_0x460d83){_0x3fc422[_0xac5b('0xba')]=_0x460d83;return _0x3fc422;})[_0xac5b('0x2f')](respondWithFilteredResult(_0x1d918f,_0x1e1e03))[_0xac5b('0x3d')](handleError(_0x1d918f,null));};exports['show']=function(_0x15b0ff,_0x3dbd04){var _0x44a6a2={'raw':![],'where':{'id':_0x15b0ff[_0xac5b('0xbb')]['id']}},_0x3eb50d={};_0x3eb50d[_0xac5b('0x4b')]=_[_0xac5b('0x48')](db[_0xac5b('0xa3')][_0xac5b('0x46')]);_0x3eb50d[_0xac5b('0x4d')]=_[_0xac5b('0x48')](_0x15b0ff['query']);_0x3eb50d['filters']=_['intersection'](_0x3eb50d[_0xac5b('0x4b')],_0x3eb50d[_0xac5b('0x4d')]);_0x44a6a2[_0xac5b('0x4e')]=_['intersection'](_0x3eb50d[_0xac5b('0x4b')],qs[_0xac5b('0x4c')](_0x15b0ff[_0xac5b('0x4d')][_0xac5b('0x4c')]));_0x44a6a2[_0xac5b('0x4e')]=_0x44a6a2[_0xac5b('0x4e')]['length']?_0x44a6a2['attributes']:_0x3eb50d[_0xac5b('0x4b')];if(_0x15b0ff[_0xac5b('0x4d')][_0xac5b('0xbc')]){_0x44a6a2[_0xac5b('0xbd')]=[{'all':!![]}];}_0x44a6a2=_[_0xac5b('0xbe')]({},_0x44a6a2,_0x15b0ff[_0xac5b('0xbf')]);return db[_0xac5b('0xa3')][_0xac5b('0x6e')](_0x44a6a2)[_0xac5b('0x2f')](handleEntityNotFound(_0x3dbd04,null))[_0xac5b('0x2f')](respondWithResult(_0x3dbd04,null))[_0xac5b('0x3d')](handleError(_0x3dbd04,null));};exports['create']=function(_0x50d834,_0x316887){return db[_0xac5b('0xa3')]['create'](_0x50d834[_0xac5b('0xc0')],{})[_0xac5b('0x2f')](respondWithResult(_0x316887,0xc9))[_0xac5b('0x3d')](handleError(_0x316887,null));};exports[_0xac5b('0x2e')]=function(_0x4d00c2,_0x2bad48){if(_0x4d00c2[_0xac5b('0xc0')]['id']){delete _0x4d00c2['body']['id'];}return db[_0xac5b('0xa3')][_0xac5b('0x6e')]({'where':{'id':_0x4d00c2[_0xac5b('0xbb')]['id']}})[_0xac5b('0x2f')](handleEntityNotFound(_0x2bad48,null))[_0xac5b('0x2f')](saveUpdates(_0x4d00c2[_0xac5b('0xc0')],null))[_0xac5b('0x2f')](respondWithResult(_0x2bad48,null))[_0xac5b('0x3d')](handleError(_0x2bad48,null));};exports[_0xac5b('0x30')]=function(_0x56d845,_0x10450d){return db['FaxInteraction']['find']({'where':{'id':_0x56d845['params']['id']}})[_0xac5b('0x2f')](handleEntityNotFound(_0x10450d,null))[_0xac5b('0x2f')](removeEntity(_0x10450d,null))[_0xac5b('0x3d')](handleError(_0x10450d,null));};exports[_0xac5b('0xc1')]=function(_0x2a74fe,_0x13c268){return db[_0xac5b('0xa3')][_0xac5b('0xc1')]()[_0xac5b('0x2f')](respondWithResult(_0x13c268,null))[_0xac5b('0x3d')](handleError(_0x13c268,null));};exports[_0xac5b('0xc2')]=function(_0xab7718,_0x96ab8f,_0x274b8b){return db[_0xac5b('0xc3')][_0xac5b('0x6e')]({'where':{'id':_0xab7718[_0xac5b('0xbb')]['id']}})[_0xac5b('0x2f')](handleEntityNotFound(_0x96ab8f,null))[_0xac5b('0x2f')](function(_0x3041a8){if(_0x3041a8){return _0x3041a8['addMessage'](_0xab7718[_0xac5b('0xc0')][_0xac5b('0xc4')],_[_0xac5b('0xc5')](_0xab7718['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x96ab8f,null))['catch'](handleError(_0x96ab8f,null));};exports[_0xac5b('0xc6')]=function(_0x17a7f4,_0x5cb9d7,_0x2b3881){var _0x40053d={'raw':![],'where':{}};var _0x35bd6d={};var _0x31e41e={'count':0x0,'rows':[]};return db[_0xac5b('0xa3')][_0xac5b('0xc7')]({'where':{'id':_0x17a7f4['params']['id']}})[_0xac5b('0x2f')](handleEntityNotFound(_0x5cb9d7,null))[_0xac5b('0x2f')](function(_0x2effe3){if(_0x2effe3){_0x35bd6d[_0xac5b('0x4b')]=_[_0xac5b('0x48')](db['FaxMessage'][_0xac5b('0x46')]);_0x35bd6d[_0xac5b('0x4d')]=_[_0xac5b('0x48')](_0x17a7f4[_0xac5b('0x4d')]);_0x35bd6d[_0xac5b('0x49')]=_['intersection'](_0x35bd6d[_0xac5b('0x4b')],_0x35bd6d[_0xac5b('0x4d')]);_0x40053d['attributes']=_['intersection'](_0x35bd6d['model'],qs[_0xac5b('0x4c')](_0x17a7f4[_0xac5b('0x4d')][_0xac5b('0x4c')]));_0x40053d[_0xac5b('0x4e')]=_0x40053d[_0xac5b('0x4e')][_0xac5b('0x4f')]?_0x40053d['attributes']:_0x35bd6d['model'];if(!_0x17a7f4[_0xac5b('0x4d')][_0xac5b('0x50')](_0xac5b('0xc8'))){_0x40053d[_0xac5b('0x27')]=qs[_0xac5b('0x27')](_0x17a7f4['query']['limit']);_0x40053d[_0xac5b('0x26')]=qs[_0xac5b('0x26')](_0x17a7f4[_0xac5b('0x4d')][_0xac5b('0x26')]);}_0x40053d[_0xac5b('0x51')]=qs[_0xac5b('0x52')](_0x17a7f4['query'][_0xac5b('0x52')]);_0x40053d['where']=qs['filters'](_[_0xac5b('0xc9')](_0x17a7f4[_0xac5b('0x4d')],_0x35bd6d[_0xac5b('0x49')]));_0x40053d[_0xac5b('0x53')][_0xac5b('0xb8')]=_0x2effe3['id'];if(_0x17a7f4[_0xac5b('0x4d')][_0xac5b('0x8e')]){_0x40053d[_0xac5b('0x53')]=_[_0xac5b('0xbe')](_0x40053d['where'],{'$or':_[_0xac5b('0x36')](_0x40053d[_0xac5b('0x4e')],function(_0x2aa5c3){var _0x4e6893={};_0x4e6893[_0x2aa5c3]={'$like':'%'+_0x17a7f4[_0xac5b('0x4d')][_0xac5b('0x8e')]+'%'};return _0x4e6893;})});}if(_0x17a7f4[_0xac5b('0x4d')][_0xac5b('0x88')]){var _0x1db410=_0x17a7f4[_0xac5b('0x4d')]['$gte']['split'](',');var _0x5535a6={};_0x5535a6[_0x1db410[0x0]]={'$gte':moment(_0x1db410[0x1])[_0xac5b('0xca')](_0xac5b('0xcb'))};_0x40053d[_0xac5b('0x53')]=_[_0xac5b('0xbe')](_0x40053d['where'],_0x5535a6);}_0x40053d=_[_0xac5b('0xbe')]({},_0x40053d,_0x17a7f4['options']);return db[_0xac5b('0xc3')][_0xac5b('0x28')]({'where':_0x40053d['where']})['then'](function(_0x525a8c){_0x31e41e[_0xac5b('0x28')]=_0x525a8c;if(_0x17a7f4['query'][_0xac5b('0xbc')]){_0x40053d[_0xac5b('0xbd')]=[{'all':!![]}];}return db[_0xac5b('0xc3')][_0xac5b('0xcc')](_0x40053d);})[_0xac5b('0x2f')](function(_0x590740){_0x31e41e[_0xac5b('0xba')]=_0x590740;return _0x31e41e;});}})[_0xac5b('0x2f')](respondWithFilteredResult(_0x5cb9d7,_0x40053d))['catch'](handleError(_0x5cb9d7,null));};exports[_0xac5b('0xcd')]=function(_0x1b9fe6,_0x45bec2,_0x543797){return db[_0xac5b('0xa3')][_0xac5b('0x6e')]({'where':{'id':_0x1b9fe6[_0xac5b('0xbb')]['id']}})[_0xac5b('0x2f')](handleEntityNotFound(_0x45bec2,null))[_0xac5b('0x2f')](function(_0xa94077){if(_0xa94077){return _0xa94077[_0xac5b('0xce')](_0x1b9fe6[_0xac5b('0xc0')][_0xac5b('0xc4')],_['omit'](_0x1b9fe6[_0xac5b('0xc0')],[_0xac5b('0xc4'),'id'])||{})[_0xac5b('0xcf')](function(){return db[_0xac5b('0x7c')][_0xac5b('0xcc')]({'attributes':['id','name','color'],'where':{'id':_0x1b9fe6[_0xac5b('0xc0')][_0xac5b('0xc4')]}});})['then'](function(_0xdfd3cf){socket[_0xac5b('0xd0')](_0xac5b('0xd1'),{'id':Number(_0x1b9fe6[_0xac5b('0xbb')]['id']),'tags':_0xdfd3cf||[]});return{'id':Number(_0x1b9fe6['params']['id']),'tags':_0xdfd3cf||[]};});}})[_0xac5b('0x2f')](respondWithResult(_0x45bec2,null))[_0xac5b('0x3d')](handleError(_0x45bec2,null));};exports[_0xac5b('0xd2')]=function(_0x38f8a4,_0x13b3cc,_0x41a6d4){return db['FaxInteraction'][_0xac5b('0x6e')]({'where':{'id':_0x38f8a4[_0xac5b('0xbb')]['id']}})[_0xac5b('0x2f')](handleEntityNotFound(_0x13b3cc,null))['then'](function(_0x40c6b4){if(_0x40c6b4){return _0x40c6b4[_0xac5b('0xd2')](_0x38f8a4[_0xac5b('0x4d')][_0xac5b('0xc4')]);}})[_0xac5b('0x2f')](respondWithStatusCode(_0x13b3cc,null))[_0xac5b('0x3d')](handleError(_0x13b3cc,null));};exports[_0xac5b('0xd3')]=function(_0x593b9b,_0x9302b0){var _0xfb9955=moment()[_0xac5b('0xd4')]()[_0xac5b('0xa1')]();var _0x96fe6d=path['join'](config[_0xac5b('0xd5')],_0xac5b('0xd6'),'files',_0xac5b('0xd7'));var _0x545278=path[_0xac5b('0xd8')](config[_0xac5b('0xd5')],_0xac5b('0xd6'),'files','attachments');var _0x4c700c=path['join'](_0x96fe6d,_0xfb9955);var _0x5d7a6d=util[_0xac5b('0xca')](_0xac5b('0xd9'),_0x593b9b[_0xac5b('0xbb')]['id'],_0xfb9955);var _0x5aa3c5=path[_0xac5b('0xd8')](_0x96fe6d,_0x5d7a6d);var _0x14ae8b=[];_0x14ae8b['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x5aa353=[{'model':db['FaxMessage'],'as':_0xac5b('0xda'),'attributes':['id','body',_0xac5b('0x86')],'include':_0x14ae8b}];return db[_0xac5b('0xa3')]['find']({'where':{'id':_0x593b9b[_0xac5b('0xbb')]['id']},'include':_0x5aa353})[_0xac5b('0x2f')](handleEntityNotFound(_0x9302b0,null))[_0xac5b('0x2f')](function(_0x151913){if(_0x151913&&_0x151913[_0xac5b('0xda')]){var _0x1fdf0c=_0x151913[_0xac5b('0xdb')]({'plain':!![]});fs[_0xac5b('0xdc')](_0x4c700c);for(var _0x39cac6=0x0;_0x39cac6<_0x1fdf0c[_0xac5b('0xda')][_0xac5b('0x4f')];_0x39cac6++){var _0x23a64a=_0x1fdf0c[_0xac5b('0xda')][_0x39cac6][_0xac5b('0xdd')];if(_0x23a64a){var _0x108d29=path[_0xac5b('0xd8')](_0x545278,_0x23a64a[_0xac5b('0xde')]);if(fs[_0xac5b('0xdf')](_0x108d29)){fs[_0xac5b('0xe0')](_0x108d29)[_0xac5b('0xe1')](fs[_0xac5b('0xe2')](path['join'](_0x4c700c,_0x23a64a[_0xac5b('0xde')])));}}}return BPromise[_0xac5b('0x9b')]()[_0xac5b('0x2f')](function(){return new BPromise(function(_0x2f00e8,_0x48e55f){zipdir(_0x4c700c,{'saveTo':_0x5aa3c5},function(_0x531534,_0x3fd484){if(_0x531534)return _0x48e55f(_0x531534);return _0x2f00e8(_0x3fd484);});})['then'](function(){return new BPromise(function(_0x4a7890,_0x21c50d){rimraf(_0x4c700c,function(_0x41674a){if(_0x41674a)_0x21c50d(_0x41674a);return _0x4a7890();});});})['then'](function(){return _0x9302b0[_0xac5b('0xd3')](_0x5aa3c5,_0x5d7a6d,function(_0x93ab50){if(_0x93ab50){console[_0xac5b('0xe3')]('err',_0x93ab50);}else{fs['unlinkSync'](_0x5aa3c5);}});});});}else{return _0x9302b0['sendStatus'](0xc8);}})[_0xac5b('0x3d')](handleError(_0x9302b0,null));}; \ No newline at end of file +var _0xc906=['path','sox','to-csv','ejs','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','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','sendStatus','error','name','send','Users','map','Tags','split','push','TagIds','catch','waiting','talking','answered','unmanaged','UserId','closed','total','index','FaxInteraction','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','`\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)','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','pipe','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1b27c8,_0x511c2d){var _0x4c7d31=function(_0x12599d){while(--_0x12599d){_0x1b27c8['push'](_0x1b27c8['shift']());}};_0x4c7d31(++_0x511c2d);}(_0xc906,0x1ad));var _0x6c90=function(_0x57a138,_0x4aee44){_0x57a138=_0x57a138-0x0;var _0x45ea2d=_0xc906[_0x57a138];return _0x45ea2d;};'use strict';var emlformat=require(_0x6c90('0x0'));var rimraf=require(_0x6c90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c90('0x2'));var rp=require(_0x6c90('0x3'));var moment=require(_0x6c90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6c90('0x5'));var util=require(_0x6c90('0x6'));var path=require(_0x6c90('0x7'));var sox=require(_0x6c90('0x8'));var csv=require(_0x6c90('0x9'));var ejs=require(_0x6c90('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6c90('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6c90('0xc'));var toCsv=require(_0x6c90('0x9'));var querystring=require(_0x6c90('0xd'));var Papa=require(_0x6c90('0xe'));var Redis=require(_0x6c90('0xf'));var authService=require(_0x6c90('0x10'));var qs=require(_0x6c90('0x11'));var as=require(_0x6c90('0x12'));var hardwareService=require(_0x6c90('0x13'));var logger=require(_0x6c90('0x14'))(_0x6c90('0x15'));var utils=require(_0x6c90('0x16'));var config=require(_0x6c90('0x17'));var licenseUtil=require(_0x6c90('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6c90('0x19')](config[_0x6c90('0x1a')],{'host':_0x6c90('0x1b'),'port':0x18eb});var socket=require(_0x6c90('0x1c'))(new Redis(config[_0x6c90('0x1a')]));require(_0x6c90('0x1d'))[_0x6c90('0x1e')](socket);function respondWithStatusCode(_0x30f64a,_0x428232){_0x428232=_0x428232||0xcc;return function(_0x3c999b){if(_0x3c999b){return _0x30f64a['sendStatus'](_0x428232);}return _0x30f64a[_0x6c90('0x1f')](_0x428232)[_0x6c90('0x20')]();};}function respondWithResult(_0x273ed1,_0x1c6143){_0x1c6143=_0x1c6143||0xc8;return function(_0x4d0603){if(_0x4d0603){return _0x273ed1[_0x6c90('0x1f')](_0x1c6143)[_0x6c90('0x21')](_0x4d0603);}};}function respondWithFilteredResult(_0x5589ad,_0x1cfb2c){return function(_0x3f9572){if(_0x3f9572){var _0x1701d5=typeof _0x1cfb2c[_0x6c90('0x22')]===_0x6c90('0x23')&&typeof _0x1cfb2c[_0x6c90('0x24')]==='undefined';var _0x9fc18e=_0x3f9572[_0x6c90('0x25')];var _0x2dbe51=_0x1701d5?0x0:_0x1cfb2c['offset'];var _0x5b772a=_0x1701d5?_0x3f9572[_0x6c90('0x25')]:_0x1cfb2c[_0x6c90('0x22')]+_0x1cfb2c['limit'];var _0x224115;if(_0x5b772a>=_0x9fc18e){_0x5b772a=_0x9fc18e;_0x224115=0xc8;}else{_0x224115=0xce;}_0x5589ad['status'](_0x224115);return _0x5589ad[_0x6c90('0x26')](_0x6c90('0x27'),_0x2dbe51+'-'+_0x5b772a+'/'+_0x9fc18e)['json'](_0x3f9572);}return null;};}function patchUpdates(_0x137285){return function(_0x5f0efe){try{jsonpatch['apply'](_0x5f0efe,_0x137285,!![]);}catch(_0x3284a5){return BPromise['reject'](_0x3284a5);}return _0x5f0efe[_0x6c90('0x28')]();};}function saveUpdates(_0x55ddfc,_0xc3f320){return function(_0x62c427){if(_0x62c427){return _0x62c427[_0x6c90('0x29')](_0x55ddfc)[_0x6c90('0x2a')](function(_0xf51b92){return _0xf51b92;});}return null;};}function removeEntity(_0x4e1976,_0x3ad642){return function(_0x3c2744){if(_0x3c2744){return _0x3c2744['destroy']()[_0x6c90('0x2a')](function(){_0x4e1976['status'](0xcc)[_0x6c90('0x20')]();});}};}function handleEntityNotFound(_0x289cba,_0x198e23){return function(_0x20e4f7){if(!_0x20e4f7){_0x289cba[_0x6c90('0x2b')](0x194);}return _0x20e4f7;};}function handleError(_0x5a9cba,_0x2012b2){_0x2012b2=_0x2012b2||0x1f4;return function(_0x122246){logger[_0x6c90('0x2c')](_0x122246['stack']);if(_0x122246[_0x6c90('0x2d')]){delete _0x122246[_0x6c90('0x2d')];}_0x5a9cba[_0x6c90('0x1f')](_0x2012b2)[_0x6c90('0x2e')](_0x122246);};}function getInteractionUsers(_0x358639,_0x4ab78b){return new BPromise(function(_0x341e37,_0x4a010e){try{if(_0x4ab78b[_0x358639['id']]){_0x358639[_0x6c90('0x2f')]=_[_0x6c90('0x30')](_0x4ab78b[_0x358639['id']],function(_0x131a83){return{'id':_0x131a83['id'],'fullname':_0x131a83['fullname']};});}}catch(_0xb7d00f){_0x4a010e(_0xb7d00f);}_0x341e37(_0x358639);});}function getInteractionTags(_0x3f9500,_0x238492){return new BPromise(function(_0x5a1ef5,_0xdc5acc){try{if(_0x3f9500['TagIds']){_0x3f9500[_0x6c90('0x31')]=[];_0x3f9500['TagIds'][_0x6c90('0x32')](',')['forEach'](function(_0x3816b6){_0x3f9500['Tags'][_0x6c90('0x33')](_0x238492[_0x3816b6]);});}delete _0x3f9500[_0x6c90('0x34')];}catch(_0x585b08){_0xdc5acc(_0x585b08);}_0x5a1ef5(_0x3f9500);});}function updateFaxInteraction(_0x52191f,_0x2a01ba,_0x5588d8){return new BPromise(function(_0x8e2f85,_0x19ad54){return getInteractionUsers(_0x52191f,_0x5588d8)[_0x6c90('0x2a')](function(_0xd08ffa){return getInteractionTags(_0xd08ffa,_0x2a01ba);})[_0x6c90('0x2a')](function(_0x23a109){return getStateInteraction(_0x23a109);})[_0x6c90('0x2a')](function(_0x4c99ee){_0x8e2f85(_0x4c99ee);})[_0x6c90('0x35')](function(_0x24cf23){_0x19ad54(_0x24cf23);});});}function getStateInteraction(_0x4d1dc9){return new BPromise(function(_0x312dcf,_0x95c463){_0x4d1dc9[_0x6c90('0x36')]=0x0;_0x4d1dc9[_0x6c90('0x37')]=0x0;_0x4d1dc9[_0x6c90('0x38')]=0x0;_0x4d1dc9[_0x6c90('0x39')]=0x0;_0x4d1dc9['total']=0x0;if(!_0x4d1dc9['closed']&&!_0x4d1dc9[_0x6c90('0x3a')])_0x4d1dc9[_0x6c90('0x36')]+=0x1;if(!_0x4d1dc9['closed']&&_0x4d1dc9['UserId'])_0x4d1dc9[_0x6c90('0x37')]+=0x1;if(_0x4d1dc9[_0x6c90('0x3b')]&&_0x4d1dc9[_0x6c90('0x3a')])_0x4d1dc9[_0x6c90('0x38')]+=0x1;if(_0x4d1dc9[_0x6c90('0x3b')]&&!_0x4d1dc9[_0x6c90('0x3a')])_0x4d1dc9['unmanaged']+=0x1;_0x4d1dc9[_0x6c90('0x3c')]+=0x1;_0x312dcf(_0x4d1dc9);});}exports[_0x6c90('0x3d')]=function(_0x466adf,_0x50c554){var _0x3fd47f={},_0x474a13={},_0x24b043={'count':0x0,'rows':[]};var _0x444147=_[_0x6c90('0x30')](db[_0x6c90('0x3e')]['rawAttributes'],function(_0x84fde7){return{'name':_0x84fde7[_0x6c90('0x3f')],'type':_0x84fde7[_0x6c90('0x40')]['key']};});_0x474a13[_0x6c90('0x41')]=_['map'](_0x444147,'name');_0x474a13[_0x6c90('0x42')]=_[_0x6c90('0x43')](_0x466adf[_0x6c90('0x42')]);_0x474a13[_0x6c90('0x44')]=_[_0x6c90('0x45')](_0x474a13[_0x6c90('0x41')],_0x474a13[_0x6c90('0x42')]);_0x3fd47f['attributes']=_[_0x6c90('0x45')](_0x474a13[_0x6c90('0x41')],qs[_0x6c90('0x46')](_0x466adf[_0x6c90('0x42')][_0x6c90('0x46')]));_0x3fd47f[_0x6c90('0x47')]=_0x3fd47f[_0x6c90('0x47')]['length']?_0x3fd47f[_0x6c90('0x47')]:_0x474a13[_0x6c90('0x41')];if(!_0x466adf[_0x6c90('0x42')][_0x6c90('0x48')](_0x6c90('0x49'))){_0x3fd47f['limit']=qs[_0x6c90('0x24')](_0x466adf['query']['limit']);_0x3fd47f[_0x6c90('0x22')]=qs[_0x6c90('0x22')](_0x466adf['query']['offset']);}_0x3fd47f[_0x6c90('0x4a')]=qs[_0x6c90('0x4b')](_0x466adf[_0x6c90('0x42')][_0x6c90('0x4b')]);_0x3fd47f[_0x6c90('0x4c')]=qs['filters'](_['pick'](_0x466adf[_0x6c90('0x42')],_0x474a13[_0x6c90('0x44')]),_0x444147);var _0x307376=[];var _0x4ac2b4=squel[_0x6c90('0x4d')]()[_0x6c90('0x4e')]('id')[_0x6c90('0x4e')](_0x6c90('0x2d'))[_0x6c90('0x4e')](_0x6c90('0x4f'))[_0x6c90('0x50')](_0x6c90('0x51'));var _0x5dfa48=squel['select']()[_0x6c90('0x4e')](_0x6c90('0x52'))[_0x6c90('0x4e')](_0x6c90('0x53'))['field'](_0x6c90('0x54'))[_0x6c90('0x50')](_0x6c90('0x55'),'ui')[_0x6c90('0x56')]('users','u',_0x6c90('0x57'));var _0x551b0f=squel[_0x6c90('0x4d')]()[_0x6c90('0x50')]('fax_interactions','i')[_0x6c90('0x56')]('cm_contacts','c',_0x6c90('0x58'))[_0x6c90('0x56')]('users','o',_0x6c90('0x59'))[_0x6c90('0x56')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0x6c90('0x5a'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x6c90('0x56')](_0x6c90('0x5b'),'it',_0x6c90('0x5c'))['left_join'](_0x6c90('0x51'),'t',_0x6c90('0x5d'));var _0x3a5141=squel['expr']();var _0x33942e=[];var _0x1766aa=squel['expr']();var _0x339557;if(_0x466adf[_0x6c90('0x42')][_0x6c90('0x5e')]){_0x339557=as[_0x6c90('0x5f')](_0x466adf['query'][_0x6c90('0x5e')]);var _0x577939=_0x339557[_0x6c90('0x60')];for(var _0x51850a=0x0;_0x51850a<_0x339557[_0x6c90('0x61')][_0x6c90('0x62')];_0x51850a++){var _0xd8a93c=_0x339557[_0x6c90('0x61')][_0x51850a];var _0x1e3269='i';var _0x400447=_[_0x6c90('0x63')](_0x444147,[_0x6c90('0x2d'),_0xd8a93c[_0x6c90('0x4e')]]);if(!_0x400447){switch(_0xd8a93c[_0x6c90('0x4e')]){case _0x6c90('0x64'):if(_0xd8a93c[_0x6c90('0x65')]==0x1){_0x551b0f['having']('`'+_0xd8a93c['field']+_0x6c90('0x66'));}else{_0x551b0f['having']('`'+_0xd8a93c[_0x6c90('0x4e')]+_0x6c90('0x67'));}break;case _0x6c90('0x68'):if(_0xd8a93c[_0x6c90('0x69')]==='$substring'){if(_0xd8a93c[_0x6c90('0x65')][_0x6c90('0x32')]('\x20')[_0x6c90('0x62')]>0x1){_0x3a5141[_0x577939](_0x6c90('0x6a'),qs['getFullTextValue'](_0xd8a93c[_0x6c90('0x65')]),null);}else{var _0x5654d1='%'+_0xd8a93c[_0x6c90('0x65')]+'%';_0x3a5141[_0x577939]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5654d1,_0x5654d1,_0x5654d1);}}else{_0x400447=_[_0x6c90('0x63')](_0x444147,['name',_0x6c90('0x6b')]);_0xd8a93c[_0x6c90('0x4e')]='ContactId';_0x480353=as['buildExpression'](_0x1e3269,_0x400447[_0x6c90('0x40')],_0xd8a93c);_0x3a5141[_0x577939](_0x480353[_0x6c90('0x6c')],_0x480353[_0x6c90('0x65')][_0x6c90('0x6d')],_0x480353[_0x6c90('0x65')]['end']);}break;case _0x6c90('0x6e'):var _0x723205=_0xd8a93c[_0x6c90('0x65')][_0x6c90('0x32')](',')['map'](function(_0x19617b){return Number(_0x19617b);});_0x723205[_0x6c90('0x6f')](function(_0x36f33a){_0x1766aa['or'](_0x6c90('0x70'),'%,'+_0x36f33a+',%');});_0x33942e=_[_0x6c90('0x71')](_0x33942e,_0x723205);break;case _0x6c90('0x72'):if(_0xd8a93c[_0x6c90('0x69')]===_0x6c90('0x73')){_0x3a5141[_0x577939]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xd8a93c[_0x6c90('0x65')]+'%',null);}else{_0x400447=_[_0x6c90('0x63')](_0x444147,[_0x6c90('0x2d'),'UserId']);_0xd8a93c['field']=_0x6c90('0x3a');_0x480353=as['buildExpression'](_0x1e3269,_0x400447['type'],_0xd8a93c);_0x3a5141[_0x577939](_0x480353['text'],_0x480353[_0x6c90('0x65')]['start'],_0x480353[_0x6c90('0x65')]['end']);}break;case _0x6c90('0x74'):_0x480353=as['buildExpression']('me',null,_0xd8a93c);_0x3a5141[_0x577939](_0x480353['text'],_0x480353[_0x6c90('0x65')]['start'],_0x480353[_0x6c90('0x65')][_0x6c90('0x20')]);break;}}else{var _0x480353=as['buildExpression'](_0x1e3269,_0x400447[_0x6c90('0x40')],_0xd8a93c);_0x3a5141[_0x577939](_0x480353[_0x6c90('0x6c')],_0x480353['value'][_0x6c90('0x6d')],_0x480353[_0x6c90('0x65')][_0x6c90('0x20')]);}}}else{var _0xa0a981=_(_0x466adf['query'])[_0x6c90('0x43')]()[_0x6c90('0x30')](function(_0x4c1c07){return _[_0x6c90('0x75')](_0x444147,[_0x6c90('0x2d'),_0x4c1c07])?_0x4c1c07:undefined;})[_0x6c90('0x76')]()['value']();if(!_[_0x6c90('0x77')](_0xa0a981)){_0xa0a981[_0x6c90('0x6f')](function(_0x71921a){if(_0x71921a===_0x6c90('0x78')){_0x551b0f[_0x6c90('0x4c')](_0x6c90('0x79'),[][_0x6c90('0x7a')](_0x466adf[_0x6c90('0x42')][_0x71921a]));}else if(_0x71921a==='createdAt'){var _0x19c6b7=JSON[_0x6c90('0x7b')](_0x466adf[_0x6c90('0x42')][_0x71921a])[_0x6c90('0x7c')];var _0x3010a2=JSON['parse'](_0x466adf[_0x6c90('0x42')][_0x71921a])[_0x6c90('0x7d')];_0x551b0f[_0x6c90('0x4c')](_0x6c90('0x7e'),_0x19c6b7,_0x3010a2);}else{if(_0x466adf['query'][_0x71921a]===_0x6c90('0x7f')){_0x551b0f[_0x6c90('0x4c')]('i.'+_0x71921a+_0x6c90('0x80'));}else{_0x551b0f[_0x6c90('0x4c')]('i.'+_0x71921a+_0x6c90('0x81'),_0x466adf['query'][_0x71921a]);}}});}if(_0x466adf['query'][_0x6c90('0x82')]){if(_0x466adf[_0x6c90('0x42')][_0x6c90('0x82')]==0x1){_0x551b0f[_0x6c90('0x83')](_0x6c90('0x84'));}else{_0x551b0f[_0x6c90('0x83')](_0x6c90('0x85'));}}if(_0x466adf[_0x6c90('0x42')][_0x6c90('0x86')]){_0x33942e=_[_0x6c90('0x87')](_0x466adf[_0x6c90('0x42')][_0x6c90('0x86')])?_0x466adf['query'][_0x6c90('0x86')]:new Array(_0x466adf[_0x6c90('0x42')][_0x6c90('0x86')]);_0x33942e[_0x6c90('0x6f')](function(_0x560323){_0x1766aa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x560323+',%');});}if(_0x466adf['query'][_0x6c90('0x88')]){var _0x4ee00d=_0x466adf['query'][_0x6c90('0x88')]['replace']('\x5c','\x5c\x5c')[_0x6c90('0x89')](/'/g,'\x27\x27');if(qs[_0x6c90('0x8a')](_0x4ee00d)){_0x3a5141['or'](_0x6c90('0x8b'),_0x4ee00d+'%')['or'](_0x6c90('0x8c'),_0x4ee00d+'%');}_0x3a5141['or'](_0x6c90('0x8d'),_0x4ee00d+'%');}}_0x551b0f[_0x6c90('0x4c')](_0x3a5141);_0x551b0f['group']('i.id');var _0x198e4b={'type':db['Sequelize'][_0x6c90('0x8e')]['SELECT'],'raw':!![]};var _0x192993=_0x551b0f[_0x6c90('0x8f')]();_0x192993[_0x6c90('0x4e')]('i.id');_0x192993[_0x6c90('0x4e')](_0x6c90('0x90'),_0x6c90('0x64'));if(_0x3fd47f['order']){_0x3fd47f[_0x6c90('0x4a')][_0x6c90('0x6f')](function(_0x42e587){var _0x282042=_0x42e587[0x0]===_0x6c90('0x91')?_0x42e587[0x0]:'i.'+_0x42e587[0x0];_0x551b0f['order'](_0x282042,_0x42e587[0x1]===_0x6c90('0x92')?![]:!![]);});}if(!_[_0x6c90('0x77')](_0x33942e)){_0x551b0f[_0x6c90('0x83')](_0x1766aa);_0x192993[_0x6c90('0x4c')](_0x6c90('0x93'),_0x33942e);}BPromise[_0x6c90('0x94')]()['then'](function(){if(!_0x339557){if(_0x466adf[_0x6c90('0x42')][_0x6c90('0x78')])return;_0x192993[_0x6c90('0x4c')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x551b0f[_0x6c90('0x4c')](_0x6c90('0x95'));return;}if(_0x466adf[_0x6c90('0x96')][_0x6c90('0x97')]!==_0x6c90('0x98'))return;return _0x466adf[_0x6c90('0x96')][_0x6c90('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x49efc4){if(_[_0x6c90('0x77')](_0x49efc4)){_0x192993[_0x6c90('0x4c')](_0x6c90('0x9a'));_0x551b0f[_0x6c90('0x4c')](_0x6c90('0x9a'));}else{_0x192993[_0x6c90('0x4c')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x49efc4,'id'));_0x551b0f[_0x6c90('0x4c')](_0x6c90('0x79'),_[_0x6c90('0x30')](_0x49efc4,'id'));}});})[_0x6c90('0x2a')](function(){if(_0x466adf[_0x6c90('0x96')][_0x6c90('0x97')]===_0x6c90('0x98')&&!_0x339557&&!_0x466adf['query'][_0x6c90('0x78')])return[];return db[_0x6c90('0x9b')][_0x6c90('0x42')](_0x192993[_0x6c90('0x9c')](),_0x198e4b);})[_0x6c90('0x2a')](function(_0x198e91){_0x24b043[_0x6c90('0x25')]=_0x198e91['length'];if(_0x24b043[_0x6c90('0x25')]===0x0)return[];return db[_0x6c90('0x9b')][_0x6c90('0x42')](_0x4ac2b4[_0x6c90('0x9c')](),_0x198e4b)[_0x6c90('0x2a')](function(_0xacda7a){_0x307376=_[_0x6c90('0x9d')](_0xacda7a,'id');_0x198e4b=_[_0x6c90('0x9e')](_0x198e4b,{'model':db[_0x6c90('0x3e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x466adf['query'][_0x6c90('0x46')]){_0x3fd47f['attributes'][_0x6c90('0x6f')](function(_0xe00f5f){_0x551b0f[_0x6c90('0x4e')]('i.'+_0xe00f5f);});}else{_0x551b0f[_0x6c90('0x4e')](_0x6c90('0x90'),'unreadMessages');_0x551b0f['field']('a.key','Account.key');_0x551b0f[_0x6c90('0x4e')](_0x6c90('0x9f'),_0x6c90('0xa0'));_0x551b0f[_0x6c90('0x4e')](_0x6c90('0xa1'),_0x6c90('0x91'));_0x551b0f[_0x6c90('0x4e')]('i.*');_0x551b0f['field'](_0x6c90('0xa2'),_0x6c90('0xa3'));_0x551b0f[_0x6c90('0x4e')](_0x6c90('0xa4'),_0x6c90('0xa5'));_0x551b0f[_0x6c90('0x4e')]('c.email','Contact.email');_0x551b0f['field'](_0x6c90('0xa6'),_0x6c90('0xa7'));_0x551b0f[_0x6c90('0x4e')](_0x6c90('0xa8'),'Contact.mobile');_0x551b0f[_0x6c90('0x4e')]('c.fax',_0x6c90('0xa9'));_0x551b0f[_0x6c90('0x4e')]('o.fullname',_0x6c90('0xaa'));_0x551b0f[_0x6c90('0x4e')](_0x6c90('0xab'),'Owner.internal');_0x551b0f[_0x6c90('0x4e')](_0x6c90('0xac'),_0x6c90('0x34'));}if(_0x3fd47f[_0x6c90('0x24')])_0x551b0f['limit'](_0x3fd47f[_0x6c90('0x24')]);if(_0x3fd47f[_0x6c90('0x22')])_0x551b0f[_0x6c90('0x22')](_0x3fd47f['offset']);return db[_0x6c90('0x9b')][_0x6c90('0x42')](_0x551b0f[_0x6c90('0x9c')](),_0x198e4b);})[_0x6c90('0x2a')](function(_0x57fb35){if(_0x57fb35['length']>0x0)_0x5dfa48[_0x6c90('0x4c')](_0x6c90('0xad'),_['map'](_0x57fb35,'id'));return db[_0x6c90('0x9b')]['query'](_0x5dfa48[_0x6c90('0x9c')](),_0x198e4b)['then'](function(_0x439b5a){var _0x23b47c=_['groupBy'](_0x439b5a,_0x6c90('0xae'));var _0x12fcc3=[];_0x57fb35['forEach'](function(_0x11bbea){_0x12fcc3[_0x6c90('0x33')](updateFaxInteraction(_0x11bbea,_0x307376,_0x23b47c));});return BPromise[_0x6c90('0xaf')](_0x12fcc3);});});})[_0x6c90('0x2a')](function(_0x1d4c13){_0x24b043[_0x6c90('0xb0')]=_0x1d4c13;return _0x24b043;})[_0x6c90('0x2a')](respondWithFilteredResult(_0x50c554,_0x3fd47f))[_0x6c90('0x35')](handleError(_0x50c554,null));};exports[_0x6c90('0xb1')]=function(_0x1c579c,_0x22a72a){var _0x4c1d86={'raw':![],'where':{'id':_0x1c579c[_0x6c90('0xb2')]['id']}},_0x42eee7={};_0x42eee7[_0x6c90('0x41')]=_[_0x6c90('0x43')](db[_0x6c90('0x3e')][_0x6c90('0xb3')]);_0x42eee7[_0x6c90('0x42')]=_[_0x6c90('0x43')](_0x1c579c[_0x6c90('0x42')]);_0x42eee7[_0x6c90('0x44')]=_[_0x6c90('0x45')](_0x42eee7[_0x6c90('0x41')],_0x42eee7['query']);_0x4c1d86[_0x6c90('0x47')]=_[_0x6c90('0x45')](_0x42eee7['model'],qs['fields'](_0x1c579c['query'][_0x6c90('0x46')]));_0x4c1d86[_0x6c90('0x47')]=_0x4c1d86['attributes'][_0x6c90('0x62')]?_0x4c1d86[_0x6c90('0x47')]:_0x42eee7[_0x6c90('0x41')];if(_0x1c579c[_0x6c90('0x42')][_0x6c90('0xb4')]){_0x4c1d86['include']=[{'all':!![]}];}_0x4c1d86=_[_0x6c90('0x9e')]({},_0x4c1d86,_0x1c579c[_0x6c90('0xb5')]);return db['FaxInteraction'][_0x6c90('0x63')](_0x4c1d86)[_0x6c90('0x2a')](handleEntityNotFound(_0x22a72a,null))['then'](respondWithResult(_0x22a72a,null))[_0x6c90('0x35')](handleError(_0x22a72a,null));};exports[_0x6c90('0xb6')]=function(_0x4f898c,_0x2a6f11){return db['FaxInteraction']['create'](_0x4f898c['body'],{})[_0x6c90('0x2a')](respondWithResult(_0x2a6f11,0xc9))[_0x6c90('0x35')](handleError(_0x2a6f11,null));};exports[_0x6c90('0x29')]=function(_0x525e29,_0x4e8a45){if(_0x525e29['body']['id']){delete _0x525e29[_0x6c90('0x74')]['id'];}return db[_0x6c90('0x3e')][_0x6c90('0x63')]({'where':{'id':_0x525e29[_0x6c90('0xb2')]['id']}})[_0x6c90('0x2a')](handleEntityNotFound(_0x4e8a45,null))[_0x6c90('0x2a')](saveUpdates(_0x525e29[_0x6c90('0x74')],null))[_0x6c90('0x2a')](respondWithResult(_0x4e8a45,null))[_0x6c90('0x35')](handleError(_0x4e8a45,null));};exports['destroy']=function(_0x3abf6f,_0x379cbf){return db['FaxInteraction'][_0x6c90('0x63')]({'where':{'id':_0x3abf6f[_0x6c90('0xb2')]['id']}})['then'](handleEntityNotFound(_0x379cbf,null))[_0x6c90('0x2a')](removeEntity(_0x379cbf,null))['catch'](handleError(_0x379cbf,null));};exports[_0x6c90('0xb7')]=function(_0x14000d,_0x43aa20){return db[_0x6c90('0x3e')][_0x6c90('0xb7')]()[_0x6c90('0x2a')](respondWithResult(_0x43aa20,null))[_0x6c90('0x35')](handleError(_0x43aa20,null));};exports[_0x6c90('0xb8')]=function(_0x548f49,_0x48113d,_0xee2cf8){return db[_0x6c90('0xb9')][_0x6c90('0x63')]({'where':{'id':_0x548f49[_0x6c90('0xb2')]['id']}})['then'](handleEntityNotFound(_0x48113d,null))['then'](function(_0x587ab5){if(_0x587ab5){return _0x587ab5[_0x6c90('0xb8')](_0x548f49['body'][_0x6c90('0xba')],_[_0x6c90('0xbb')](_0x548f49['body'],[_0x6c90('0xba'),'id'])||{});}})[_0x6c90('0x2a')](respondWithResult(_0x48113d,null))[_0x6c90('0x35')](handleError(_0x48113d,null));};exports[_0x6c90('0xbc')]=function(_0x36664f,_0x5c085a,_0x2a6513){var _0x25a946={'raw':![],'where':{}};var _0x312085={};var _0x13a1f1={'count':0x0,'rows':[]};return db[_0x6c90('0x3e')][_0x6c90('0xbd')]({'where':{'id':_0x36664f[_0x6c90('0xb2')]['id']}})[_0x6c90('0x2a')](handleEntityNotFound(_0x5c085a,null))['then'](function(_0x43046e){if(_0x43046e){_0x312085[_0x6c90('0x41')]=_[_0x6c90('0x43')](db[_0x6c90('0xb9')][_0x6c90('0xb3')]);_0x312085[_0x6c90('0x42')]=_['keys'](_0x36664f[_0x6c90('0x42')]);_0x312085[_0x6c90('0x44')]=_[_0x6c90('0x45')](_0x312085[_0x6c90('0x41')],_0x312085['query']);_0x25a946['attributes']=_['intersection'](_0x312085[_0x6c90('0x41')],qs[_0x6c90('0x46')](_0x36664f['query'][_0x6c90('0x46')]));_0x25a946['attributes']=_0x25a946['attributes'][_0x6c90('0x62')]?_0x25a946['attributes']:_0x312085[_0x6c90('0x41')];if(!_0x36664f[_0x6c90('0x42')][_0x6c90('0x48')](_0x6c90('0x49'))){_0x25a946['limit']=qs[_0x6c90('0x24')](_0x36664f[_0x6c90('0x42')][_0x6c90('0x24')]);_0x25a946[_0x6c90('0x22')]=qs['offset'](_0x36664f[_0x6c90('0x42')][_0x6c90('0x22')]);}_0x25a946[_0x6c90('0x4a')]=qs[_0x6c90('0x4b')](_0x36664f['query'][_0x6c90('0x4b')]);_0x25a946[_0x6c90('0x4c')]=qs['filters'](_['pick'](_0x36664f[_0x6c90('0x42')],_0x312085[_0x6c90('0x44')]));_0x25a946[_0x6c90('0x4c')]['FaxInteractionId']=_0x43046e['id'];if(_0x36664f[_0x6c90('0x42')][_0x6c90('0x88')]){_0x25a946[_0x6c90('0x4c')]=_[_0x6c90('0x9e')](_0x25a946[_0x6c90('0x4c')],{'$or':_[_0x6c90('0x30')](_0x25a946[_0x6c90('0x47')],function(_0x2b24c1){var _0x31eeee={};_0x31eeee[_0x2b24c1]={'$like':'%'+_0x36664f[_0x6c90('0x42')][_0x6c90('0x88')]+'%'};return _0x31eeee;})});}if(_0x36664f[_0x6c90('0x42')][_0x6c90('0x7c')]){var _0xaa048=_0x36664f[_0x6c90('0x42')][_0x6c90('0x7c')][_0x6c90('0x32')](',');var _0x1f5753={};_0x1f5753[_0xaa048[0x0]]={'$gte':moment(_0xaa048[0x1])[_0x6c90('0xbe')](_0x6c90('0xbf'))};_0x25a946[_0x6c90('0x4c')]=_[_0x6c90('0x9e')](_0x25a946[_0x6c90('0x4c')],_0x1f5753);}_0x25a946=_[_0x6c90('0x9e')]({},_0x25a946,_0x36664f[_0x6c90('0xb5')]);return db['FaxMessage']['count']({'where':_0x25a946[_0x6c90('0x4c')]})[_0x6c90('0x2a')](function(_0x40690c){_0x13a1f1[_0x6c90('0x25')]=_0x40690c;if(_0x36664f[_0x6c90('0x42')][_0x6c90('0xb4')]){_0x25a946[_0x6c90('0xc0')]=[{'all':!![]}];}return db['FaxMessage'][_0x6c90('0xc1')](_0x25a946);})[_0x6c90('0x2a')](function(_0x13a1fa){_0x13a1f1[_0x6c90('0xb0')]=_0x13a1fa;return _0x13a1f1;});}})[_0x6c90('0x2a')](respondWithFilteredResult(_0x5c085a,_0x25a946))[_0x6c90('0x35')](handleError(_0x5c085a,null));};exports[_0x6c90('0xc2')]=function(_0x1080a8,_0x43fedf,_0x27dc38){return db[_0x6c90('0x3e')][_0x6c90('0x63')]({'where':{'id':_0x1080a8[_0x6c90('0xb2')]['id']}})[_0x6c90('0x2a')](handleEntityNotFound(_0x43fedf,null))[_0x6c90('0x2a')](function(_0x344eba){if(_0x344eba){return _0x344eba[_0x6c90('0xc3')](_0x1080a8[_0x6c90('0x74')][_0x6c90('0xba')],_[_0x6c90('0xbb')](_0x1080a8['body'],['ids','id'])||{})[_0x6c90('0xc4')](function(){return db[_0x6c90('0x6e')][_0x6c90('0xc1')]({'attributes':['id',_0x6c90('0x2d'),'color'],'where':{'id':_0x1080a8[_0x6c90('0x74')]['ids']}});})['then'](function(_0x19160b){socket[_0x6c90('0xc5')](_0x6c90('0xc6'),{'id':Number(_0x1080a8['params']['id']),'tags':_0x19160b||[]});return{'id':Number(_0x1080a8['params']['id']),'tags':_0x19160b||[]};});}})[_0x6c90('0x2a')](respondWithResult(_0x43fedf,null))[_0x6c90('0x35')](handleError(_0x43fedf,null));};exports['removeTags']=function(_0xfd8f65,_0x1f1a6b,_0x40016e){return db[_0x6c90('0x3e')][_0x6c90('0x63')]({'where':{'id':_0xfd8f65[_0x6c90('0xb2')]['id']}})['then'](handleEntityNotFound(_0x1f1a6b,null))[_0x6c90('0x2a')](function(_0x4bde0b){if(_0x4bde0b){return _0x4bde0b[_0x6c90('0xc7')](_0xfd8f65[_0x6c90('0x42')][_0x6c90('0xba')]);}})[_0x6c90('0x2a')](respondWithStatusCode(_0x1f1a6b,null))['catch'](handleError(_0x1f1a6b,null));};exports['download']=function(_0xc395e6,_0x3fa050){var _0x1ae82c=moment()[_0x6c90('0xc8')]()[_0x6c90('0x9c')]();var _0x4aa581=path[_0x6c90('0xc9')](config[_0x6c90('0xca')],_0x6c90('0xcb'),_0x6c90('0xcc'),'tmp');var _0x3ec078=path[_0x6c90('0xc9')](config['root'],_0x6c90('0xcb'),_0x6c90('0xcc'),_0x6c90('0xcd'));var _0x46b1fb=path[_0x6c90('0xc9')](_0x4aa581,_0x1ae82c);var _0x5f1cc4=util[_0x6c90('0xbe')](_0x6c90('0xce'),_0xc395e6['params']['id'],_0x1ae82c);var _0x1931c8=path[_0x6c90('0xc9')](_0x4aa581,_0x5f1cc4);var _0x3114ec=[];_0x3114ec[_0x6c90('0x33')]({'model':db[_0x6c90('0xcf')],'as':'Attachment','raw':!![]});var _0x504b85=[{'model':db['FaxMessage'],'as':_0x6c90('0xd0'),'attributes':['id','body',_0x6c90('0xd1')],'include':_0x3114ec}];return db[_0x6c90('0x3e')]['find']({'where':{'id':_0xc395e6['params']['id']},'include':_0x504b85})['then'](handleEntityNotFound(_0x3fa050,null))[_0x6c90('0x2a')](function(_0x3e6b36){if(_0x3e6b36&&_0x3e6b36['Messages']){var _0x470cbe=_0x3e6b36[_0x6c90('0xd2')]({'plain':!![]});fs[_0x6c90('0xd3')](_0x46b1fb);for(var _0x4dec70=0x0;_0x4dec70<_0x470cbe[_0x6c90('0xd0')]['length'];_0x4dec70++){var _0x8d3b47=_0x470cbe[_0x6c90('0xd0')][_0x4dec70][_0x6c90('0xcf')];if(_0x8d3b47){var _0x20fc06=path['join'](_0x3ec078,_0x8d3b47[_0x6c90('0xd4')]);if(fs[_0x6c90('0xd5')](_0x20fc06)){fs[_0x6c90('0xd6')](_0x20fc06)[_0x6c90('0xd7')](fs['createWriteStream'](path[_0x6c90('0xc9')](_0x46b1fb,_0x8d3b47[_0x6c90('0xd4')])));}}}return BPromise[_0x6c90('0x94')]()[_0x6c90('0x2a')](function(){return new BPromise(function(_0x3a9e41,_0x3bce25){zipdir(_0x46b1fb,{'saveTo':_0x1931c8},function(_0x7e7141,_0x4bf681){if(_0x7e7141)return _0x3bce25(_0x7e7141);return _0x3a9e41(_0x4bf681);});})[_0x6c90('0x2a')](function(){return new BPromise(function(_0x205b99,_0x53928f){rimraf(_0x46b1fb,function(_0x1ebfab){if(_0x1ebfab)_0x53928f(_0x1ebfab);return _0x205b99();});});})[_0x6c90('0x2a')](function(){return _0x3fa050['download'](_0x1931c8,_0x5f1cc4,function(_0x3f9273){if(_0x3f9273){console[_0x6c90('0xd8')](_0x6c90('0xd9'),_0x3f9273);}else{fs['unlinkSync'](_0x1931c8);}});});});}else{return _0x3fa050[_0x6c90('0x2b')](0xc8);}})['catch'](handleError(_0x3fa050,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b2904ad..9785df1 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 _0xd4c6=['save','update','remove','setDataValue','Users','map','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction'];(function(_0x5b2c56,_0x1ec56d){var _0x226966=function(_0x3d2290){while(--_0x3d2290){_0x5b2c56['push'](_0x5b2c56['shift']());}};_0x226966(++_0x1ec56d);}(_0xd4c6,0x8d));var _0x6d4c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4c6[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x6d4c('0x0'));var FaxInteraction=require(_0x6d4c('0x1'))['db'][_0x6d4c('0x2')];var FaxMessage=require(_0x6d4c('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d4c('0x3'),'afterUpdate':_0x6d4c('0x4'),'afterDestroy':_0x6d4c('0x5')};function emitEvent(_0x263c02){return function(_0x3bfa4f,_0x1dcc87,_0x534094){_0x3bfa4f['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x223fdd){_0x3bfa4f[_0x6d4c('0x6')](_0x6d4c('0x7'),_0x223fdd[_0x6d4c('0x8')](function(_0x13b9c5){return{'id':_0x13b9c5['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3bfa4f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6d4c('0x9')](function(_0x5b112c){_0x3bfa4f[_0x6d4c('0x6')]('unreadMessages',_0x5b112c[_0x6d4c('0xa')]);FaxInteractionEvents[_0x6d4c('0xb')](_0x263c02+':'+_0x3bfa4f['id'],_0x3bfa4f);FaxInteractionEvents[_0x6d4c('0xb')](_0x263c02,_0x3bfa4f);_0x534094(null);})[_0x6d4c('0xc')](_0x534094(null));};}for(var e in events){if(events[_0x6d4c('0xd')](e)){var event=events[e];FaxInteraction[_0x6d4c('0xe')](e,emitEvent(event));}}module[_0x6d4c('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x9edf=['setMaxListeners','save','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x31a34c,_0x32e5c0){var _0x5818db=function(_0x236908){while(--_0x236908){_0x31a34c['push'](_0x31a34c['shift']());}};_0x5818db(++_0x32e5c0);}(_0x9edf,0x11d));var _0xf9ed=function(_0x5aba28,_0xea1b1b){_0x5aba28=_0x5aba28-0x0;var _0x27819e=_0x9edf[_0x5aba28];return _0x27819e;};'use strict';var EventEmitter=require(_0xf9ed('0x0'));var FaxInteraction=require(_0xf9ed('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xf9ed('0x1'))['db'][_0xf9ed('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf9ed('0x3')](0x0);var events={'afterCreate':_0xf9ed('0x4'),'afterUpdate':'update','afterDestroy':_0xf9ed('0x5')};function emitEvent(_0x8ebd22){return function(_0x24e935,_0x239f5d,_0x269848){_0x24e935[_0xf9ed('0x6')]({'attributes':['id'],'raw':!![]})[_0xf9ed('0x7')](function(_0x50256b){_0x24e935['setDataValue']('Users',_0x50256b[_0xf9ed('0x8')](function(_0x411337){return{'id':_0x411337['id']};}));return FaxMessage[_0xf9ed('0x9')]({'where':{'FaxInteractionId':_0x24e935['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf9ed('0x7')](function(_0x525716){_0x24e935[_0xf9ed('0xa')](_0xf9ed('0xb'),_0x525716[_0xf9ed('0xc')]);FaxInteractionEvents[_0xf9ed('0xd')](_0x8ebd22+':'+_0x24e935['id'],_0x24e935);FaxInteractionEvents[_0xf9ed('0xd')](_0x8ebd22,_0x24e935);_0x269848(null);})[_0xf9ed('0xe')](_0x269848(null));};}for(var e in events){if(events[_0xf9ed('0xf')](e)){var event=events[e];FaxInteraction[_0xf9ed('0x10')](e,emitEvent(event));}}module[_0xf9ed('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b640684..fd9f758 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 _0x7e04=['./faxInteraction.attributes','define','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x4cc727,_0x3b3885){var _0x3ff76a=function(_0x1171e0){while(--_0x1171e0){_0x4cc727['push'](_0x4cc727['shift']());}};_0x3ff76a(++_0x3b3885);}(_0x7e04,0xd6));var _0x47e0=function(_0x1e6911,_0x2c997c){_0x1e6911=_0x1e6911-0x0;var _0x27c35f=_0x7e04[_0x1e6911];return _0x27c35f;};'use strict';var _=require(_0x47e0('0x0'));var util=require(_0x47e0('0x1'));var logger=require(_0x47e0('0x2'))('api');var moment=require(_0x47e0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x47e0('0x4'));var rimraf=require(_0x47e0('0x5'));var config=require('../../config/environment');var attributes=require(_0x47e0('0x6'));module['exports']=function(_0x103905,_0x15eb4a){return _0x103905[_0x47e0('0x7')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18f831,_0x2ac307,_0x31fd30){if(_0x18f831['changed']('closed')){_0x18f831[_0x47e0('0x8')]=moment()[_0x47e0('0x9')](_0x47e0('0xa'));}_0x31fd30(null,_0x18f831);}}});}; \ No newline at end of file +var _0x3914=['format','lodash','util','api','moment','request-promise','path','rimraf','./faxInteraction.attributes','exports','FaxInteraction','closed','closedAt'];(function(_0x1fb290,_0x328717){var _0x3ea2f1=function(_0x439950){while(--_0x439950){_0x1fb290['push'](_0x1fb290['shift']());}};_0x3ea2f1(++_0x328717);}(_0x3914,0xeb));var _0x4391=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x3914[_0x2f227c];return _0x5032bc;};'use strict';var _=require(_0x4391('0x0'));var util=require(_0x4391('0x1'));var logger=require('../../config/logger')(_0x4391('0x2'));var moment=require(_0x4391('0x3'));var BPromise=require('bluebird');var rp=require(_0x4391('0x4'));var fs=require('fs');var path=require(_0x4391('0x5'));var rimraf=require(_0x4391('0x6'));var config=require('../../config/environment');var attributes=require(_0x4391('0x7'));module[_0x4391('0x8')]=function(_0x540b62,_0x3717d5){return _0x540b62['define'](_0x4391('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x378c09,_0x17bcfb,_0x57c763){if(_0x378c09['changed'](_0x4391('0xa'))){_0x378c09[_0x4391('0xb')]=moment()[_0x4391('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x57c763(null,_0x378c09);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index fa677f4..cb7f176 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 _0xbd72=['raw','where','attributes','limit','then','catch','find','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./faxInteraction.socket','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options'];(function(_0x5722c1,_0x14ff99){var _0x89d1f8=function(_0x4aee67){while(--_0x4aee67){_0x5722c1['push'](_0x5722c1['shift']());}};_0x89d1f8(++_0x14ff99);}(_0xbd72,0x129));var _0x2bd7=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0xbd72[_0x135904];return _0x1ce7d5;};'use strict';var _=require('lodash');var util=require(_0x2bd7('0x0'));var moment=require(_0x2bd7('0x1'));var BPromise=require(_0x2bd7('0x2'));var rs=require(_0x2bd7('0x3'));var fs=require('fs');var Redis=require(_0x2bd7('0x4'));var db=require(_0x2bd7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bd7('0x6'))(_0x2bd7('0x7'));var config=require(_0x2bd7('0x8'));var jayson=require(_0x2bd7('0x9'));var client=jayson['client'][_0x2bd7('0xa')]({'port':0x232a});config[_0x2bd7('0xb')]=_[_0x2bd7('0xc')](config[_0x2bd7('0xb')],{'host':_0x2bd7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2bd7('0xb')]));require(_0x2bd7('0xe'))['register'](socket);function respondWithRpcPromise(_0xf0af76,_0x1f1ecb,_0x57f6a1){return new BPromise(function(_0x467796,_0x337541){return client[_0x2bd7('0xf')](_0xf0af76,_0x57f6a1)['then'](function(_0x39583b){logger[_0x2bd7('0x10')](_0x2bd7('0x11'),_0x1f1ecb,_0x2bd7('0x12'));logger[_0x2bd7('0x13')](_0x2bd7('0x14'),_0x1f1ecb,'request\x20sent',JSON[_0x2bd7('0x15')](_0x39583b));if(_0x39583b[_0x2bd7('0x16')]){if(_0x39583b['error'][_0x2bd7('0x17')]===0x1f4){logger[_0x2bd7('0x16')](_0x2bd7('0x11'),_0x1f1ecb,_0x39583b[_0x2bd7('0x16')]['message']);return _0x337541(_0x39583b[_0x2bd7('0x16')][_0x2bd7('0x18')]);}logger[_0x2bd7('0x16')](_0x2bd7('0x11'),_0x1f1ecb,_0x39583b['error'][_0x2bd7('0x18')]);return _0x467796(_0x39583b[_0x2bd7('0x16')]['message']);}else{logger['info'](_0x2bd7('0x11'),_0x1f1ecb,_0x2bd7('0x12'));_0x467796(_0x39583b[_0x2bd7('0x19')]['message']);}})['catch'](function(_0xedf929){logger[_0x2bd7('0x16')](_0x2bd7('0x11'),_0x1f1ecb,_0xedf929);_0x337541(_0xedf929);});});}exports[_0x2bd7('0x1a')]=function(_0x4e3096){var _0x26a476=this;return new Promise(function(_0x45ef2e,_0x35e259){return db[_0x2bd7('0x1b')][_0x2bd7('0x1c')](_0x4e3096[_0x2bd7('0x1d')],{'raw':_0x4e3096[_0x2bd7('0x1e')]?_0x4e3096[_0x2bd7('0x1e')][_0x2bd7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e3096[_0x2bd7('0x1e')]?_0x4e3096[_0x2bd7('0x1e')][_0x2bd7('0x20')]||null:null,'attributes':_0x4e3096[_0x2bd7('0x1e')]?_0x4e3096[_0x2bd7('0x1e')][_0x2bd7('0x21')]||null:null,'limit':_0x4e3096['options']?_0x4e3096[_0x2bd7('0x1e')][_0x2bd7('0x22')]||null:null})[_0x2bd7('0x23')](function(_0x406905){logger['info'](_0x2bd7('0x1a'),_0x4e3096);logger['debug'](_0x2bd7('0x1a'),_0x4e3096,JSON['stringify'](_0x406905));_0x45ef2e(_0x406905);})[_0x2bd7('0x24')](function(_0x4e8464){logger['error'](_0x2bd7('0x1a'),_0x4e8464['message'],_0x4e3096);_0x35e259(_0x26a476[_0x2bd7('0x16')](0x1f4,_0x4e8464[_0x2bd7('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2530c1){return new Promise(function(_0x1ca2f3,_0x56e035){return db[_0x2bd7('0x1b')][_0x2bd7('0x25')]({'where':_0x2530c1['options']?_0x2530c1[_0x2bd7('0x1e')][_0x2bd7('0x20')]||null:null})[_0x2bd7('0x23')](function(_0x3a6300){if(_0x3a6300){return _0x3a6300['addTags'](_0x2530c1['body'][_0x2bd7('0x26')],_[_0x2bd7('0x27')](_0x2530c1[_0x2bd7('0x1d')],[_0x2bd7('0x26'),'id'])||{});}})['spread'](function(_0x458ab8){logger[_0x2bd7('0x10')](_0x2bd7('0x28'),_0x2530c1);logger[_0x2bd7('0x13')]('AddTags',_0x2530c1,JSON['stringify'](_0x458ab8));_0x1ca2f3(_0x458ab8);})[_0x2bd7('0x24')](function(_0x2c7da5){logger[_0x2bd7('0x16')]('AddTags',_0x2c7da5[_0x2bd7('0x18')],_0x2530c1);_0x56e035(_this[_0x2bd7('0x16')](0x1f4,_0x2c7da5[_0x2bd7('0x18')]));});});}; \ No newline at end of file +var _0x1560=['info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','debug','stringify','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxInteraction.socket','register','request'];(function(_0x75f81c,_0x35454d){var _0x44d650=function(_0x1b1ae8){while(--_0x1b1ae8){_0x75f81c['push'](_0x75f81c['shift']());}};_0x44d650(++_0x35454d);}(_0x1560,0x177));var _0x0156=function(_0xe97b18,_0x1f6601){_0xe97b18=_0xe97b18-0x0;var _0x1beb8f=_0x1560[_0xe97b18];return _0x1beb8f;};'use strict';var _=require('lodash');var util=require(_0x0156('0x0'));var moment=require(_0x0156('0x1'));var BPromise=require(_0x0156('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0156('0x3'))['db'];var utils=require(_0x0156('0x4'));var logger=require(_0x0156('0x5'))(_0x0156('0x6'));var config=require(_0x0156('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0156('0x8')]['http']({'port':0x232a});config[_0x0156('0x9')]=_[_0x0156('0xa')](config['redis'],{'host':_0x0156('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0156('0x9')]));require(_0x0156('0xc'))[_0x0156('0xd')](socket);function respondWithRpcPromise(_0x4e58db,_0x3d8bad,_0x186c40){return new BPromise(function(_0x50509d,_0x1f34fe){return client[_0x0156('0xe')](_0x4e58db,_0x186c40)['then'](function(_0x30ab8c){logger[_0x0156('0xf')](_0x0156('0x10'),_0x3d8bad,_0x0156('0x11'));logger['debug'](_0x0156('0x12'),_0x3d8bad,_0x0156('0x11'),JSON['stringify'](_0x30ab8c));if(_0x30ab8c['error']){if(_0x30ab8c[_0x0156('0x13')]['code']===0x1f4){logger[_0x0156('0x13')](_0x0156('0x10'),_0x3d8bad,_0x30ab8c[_0x0156('0x13')][_0x0156('0x14')]);return _0x1f34fe(_0x30ab8c[_0x0156('0x13')][_0x0156('0x14')]);}logger[_0x0156('0x13')](_0x0156('0x10'),_0x3d8bad,_0x30ab8c[_0x0156('0x13')][_0x0156('0x14')]);return _0x50509d(_0x30ab8c[_0x0156('0x13')][_0x0156('0x14')]);}else{logger[_0x0156('0xf')](_0x0156('0x10'),_0x3d8bad,_0x0156('0x11'));_0x50509d(_0x30ab8c[_0x0156('0x15')][_0x0156('0x14')]);}})['catch'](function(_0x2defd2){logger[_0x0156('0x13')](_0x0156('0x10'),_0x3d8bad,_0x2defd2);_0x1f34fe(_0x2defd2);});});}exports[_0x0156('0x16')]=function(_0x336360){var _0x3ffc01=this;return new Promise(function(_0x284d2b,_0x2c0609){return db[_0x0156('0x17')][_0x0156('0x18')](_0x336360[_0x0156('0x19')],{'raw':_0x336360[_0x0156('0x1a')]?_0x336360['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x336360[_0x0156('0x1a')]?_0x336360[_0x0156('0x1a')][_0x0156('0x1b')]||null:null,'attributes':_0x336360[_0x0156('0x1a')]?_0x336360[_0x0156('0x1a')][_0x0156('0x1c')]||null:null,'limit':_0x336360[_0x0156('0x1a')]?_0x336360[_0x0156('0x1a')][_0x0156('0x1d')]||null:null})['then'](function(_0x6521fd){logger[_0x0156('0xf')](_0x0156('0x16'),_0x336360);logger[_0x0156('0x1e')]('UpdateFaxInteraction',_0x336360,JSON[_0x0156('0x1f')](_0x6521fd));_0x284d2b(_0x6521fd);})['catch'](function(_0xc714c2){logger[_0x0156('0x13')](_0x0156('0x16'),_0xc714c2[_0x0156('0x14')],_0x336360);_0x2c0609(_0x3ffc01['error'](0x1f4,_0xc714c2['message']));});});};exports[_0x0156('0x20')]=function(_0xa3204c){return new Promise(function(_0x5daa5a,_0x1a74cc){return db['FaxInteraction'][_0x0156('0x21')]({'where':_0xa3204c[_0x0156('0x1a')]?_0xa3204c[_0x0156('0x1a')][_0x0156('0x1b')]||null:null})['then'](function(_0xc3a595){if(_0xc3a595){return _0xc3a595[_0x0156('0x22')](_0xa3204c['body'][_0x0156('0x23')],_['omit'](_0xa3204c[_0x0156('0x19')],[_0x0156('0x23'),'id'])||{});}})[_0x0156('0x24')](function(_0x3c6f8d){logger[_0x0156('0xf')](_0x0156('0x25'),_0xa3204c);logger[_0x0156('0x1e')](_0x0156('0x25'),_0xa3204c,JSON['stringify'](_0x3c6f8d));_0x5daa5a(_0x3c6f8d);})[_0x0156('0x26')](function(_0x39623e){logger[_0x0156('0x13')]('AddTags',_0x39623e[_0x0156('0x14')],_0xa3204c);_0x1a74cc(_this[_0x0156('0x13')](0x1f4,_0x39623e[_0x0156('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4c98088..d959f18 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 _0x2e7b=['faxInteraction:','./faxInteraction.events','remove','update','removeListener','register','length'];(function(_0x5126e1,_0x37bb2c){var _0x329e1e=function(_0x3f958a){while(--_0x3f958a){_0x5126e1['push'](_0x5126e1['shift']());}};_0x329e1e(++_0x37bb2c);}(_0x2e7b,0x189));var _0xb2e7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2e7b[_0x5b644e];return _0x49c6bf;};'use strict';var FaxInteractionEvents=require(_0xb2e7('0x0'));var events=['save',_0xb2e7('0x1'),_0xb2e7('0x2')];function createListener(_0x228707,_0x1496b5){return function(_0x3dd56e){_0x1496b5['emit'](_0x228707,_0x3dd56e);};}function removeListener(_0x309ebc,_0x42ab8b){return function(){FaxInteractionEvents[_0xb2e7('0x3')](_0x309ebc,_0x42ab8b);};}exports[_0xb2e7('0x4')]=function(_0x3583f0){for(var _0x237fb5=0x0,_0x2eb15b=events[_0xb2e7('0x5')];_0x237fb5<_0x2eb15b;_0x237fb5++){var _0x27242d=events[_0x237fb5];var _0x1a2ac2=createListener(_0xb2e7('0x6')+_0x27242d,_0x3583f0);FaxInteractionEvents['on'](_0x27242d,_0x1a2ac2);}}; \ No newline at end of file +var _0xcb48=['register','length','faxInteraction:','save','update','emit','removeListener'];(function(_0x459573,_0x35679e){var _0x51ffcd=function(_0x37bb90){while(--_0x37bb90){_0x459573['push'](_0x459573['shift']());}};_0x51ffcd(++_0x35679e);}(_0xcb48,0x1a0));var _0x8cb4=function(_0x48aa85,_0x404f9a){_0x48aa85=_0x48aa85-0x0;var _0x4310b6=_0xcb48[_0x48aa85];return _0x4310b6;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x8cb4('0x0'),'remove',_0x8cb4('0x1')];function createListener(_0x1ec4f4,_0x35696d){return function(_0x20c189){_0x35696d[_0x8cb4('0x2')](_0x1ec4f4,_0x20c189);};}function removeListener(_0x2c122a,_0x28a39c){return function(){FaxInteractionEvents[_0x8cb4('0x3')](_0x2c122a,_0x28a39c);};}exports[_0x8cb4('0x4')]=function(_0x5c5a04){for(var _0x2316a1=0x0,_0x2ca43b=events[_0x8cb4('0x5')];_0x2316a1<_0x2ca43b;_0x2316a1++){var _0x2b1145=events[_0x2316a1];var _0x5da479=createListener(_0x8cb4('0x6')+_0x2b1145,_0x5c5a04);FaxInteractionEvents['on'](_0x2b1145,_0x5da479);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 736bd22..440b623 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 _0xb68a=['delete','faxinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','download','create','post','addMessage','/:id/tags','faxinteraction:addtags','addTags','put','tracked','fax','faxinteraction:update','update'];(function(_0xa2ed10,_0x52f61f){var _0x24c28c=function(_0x88a1ff){while(--_0x88a1ff){_0xa2ed10['push'](_0xa2ed10['shift']());}};_0x24c28c(++_0x52f61f);}(_0xb68a,0x1a8));var _0xab68=function(_0x33be73,_0x59d750){_0x33be73=_0x33be73-0x0;var _0x2d1f91=_0xb68a[_0x33be73];return _0x2d1f91;};'use strict';var multer=require(_0xab68('0x0'));var util=require(_0xab68('0x1'));var path=require(_0xab68('0x2'));var timeout=require('connect-timeout');var express=require(_0xab68('0x3'));var router=express[_0xab68('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xab68('0x5'));var controller=require('./faxInteraction.controller');router[_0xab68('0x6')]('/',auth[_0xab68('0x7')](),controller[_0xab68('0x8')]);router[_0xab68('0x6')](_0xab68('0x9'),auth['isAuthenticated'](),controller[_0xab68('0xa')]);router['get'](_0xab68('0xb'),auth[_0xab68('0x7')](),controller[_0xab68('0xc')]);router[_0xab68('0x6')](_0xab68('0xd'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0xab68('0x7')](),controller[_0xab68('0xe')]);router['post']('/',auth[_0xab68('0x7')](),controller[_0xab68('0xf')]);router[_0xab68('0x10')](_0xab68('0xd'),auth[_0xab68('0x7')](),controller[_0xab68('0x11')]);router[_0xab68('0x10')](_0xab68('0x12'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xab68('0x13')),controller[_0xab68('0x14')]);router[_0xab68('0x15')](_0xab68('0xb'),auth[_0xab68('0x7')](),interaction[_0xab68('0x16')](_0xab68('0x17'),_0xab68('0x18')),controller[_0xab68('0x19')]);router[_0xab68('0x1a')]('/:id',auth[_0xab68('0x7')](),interaction[_0xab68('0x16')]('fax',_0xab68('0x1b')),controller[_0xab68('0x1c')]);router['delete'](_0xab68('0x12'),auth['isAuthenticated'](),controller[_0xab68('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x240d=['removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','put','faxinteraction:update','update','delete','faxinteraction:destroy'];(function(_0x5a907b,_0x36ee0f){var _0x4c0627=function(_0x334e08){while(--_0x334e08){_0x5a907b['push'](_0x5a907b['shift']());}};_0x4c0627(++_0x36ee0f);}(_0x240d,0xa2));var _0xd240=function(_0x68964c,_0x34e2a7){_0x68964c=_0x68964c-0x0;var _0x94229c=_0x240d[_0x68964c];return _0x94229c;};'use strict';var multer=require(_0xd240('0x0'));var util=require(_0xd240('0x1'));var path=require(_0xd240('0x2'));var timeout=require(_0xd240('0x3'));var express=require(_0xd240('0x4'));var router=express[_0xd240('0x5')]();var fs_extra=require(_0xd240('0x6'));var auth=require(_0xd240('0x7'));var interaction=require(_0xd240('0x8'));var config=require('../../config/environment');var controller=require(_0xd240('0x9'));router[_0xd240('0xa')]('/',auth[_0xd240('0xb')](),controller[_0xd240('0xc')]);router[_0xd240('0xa')](_0xd240('0xd'),auth[_0xd240('0xb')](),controller[_0xd240('0xe')]);router[_0xd240('0xa')](_0xd240('0xf'),auth[_0xd240('0xb')](),controller[_0xd240('0x10')]);router[_0xd240('0xa')](_0xd240('0x11'),auth[_0xd240('0xb')](),controller['getMessages']);router[_0xd240('0xa')](_0xd240('0x12'),auth[_0xd240('0xb')](),controller['download']);router[_0xd240('0x13')]('/',auth['isAuthenticated'](),controller[_0xd240('0x14')]);router[_0xd240('0x13')]('/:id/messages',auth[_0xd240('0xb')](),controller[_0xd240('0x15')]);router['post'](_0xd240('0x16'),auth[_0xd240('0xb')](),interaction[_0xd240('0x17')](_0xd240('0x18'),'faxinteraction:addtags'),controller['addTags']);router[_0xd240('0x19')](_0xd240('0xf'),auth[_0xd240('0xb')](),interaction[_0xd240('0x17')]('fax',_0xd240('0x1a')),controller[_0xd240('0x1b')]);router[_0xd240('0x1c')](_0xd240('0xf'),auth[_0xd240('0xb')](),interaction['tracked'](_0xd240('0x18'),_0xd240('0x1d')),controller['destroy']);router[_0xd240('0x1c')](_0xd240('0x16'),auth['isAuthenticated'](),controller[_0xd240('0x1e')]);module[_0xd240('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index aaf04f5..4a29132 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 _0xa1a5=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x45bba6,_0x4ae180){_0x45bba6=_0x45bba6-0x0;var _0x51bf57=_0xa1a5[_0x45bba6];return _0x51bf57;};'use strict';var Sequelize=require(_0x5a1a('0x0'));module['exports']={'body':{'type':Sequelize[_0x5a1a('0x1')](_0x5a1a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5a1a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5a1a('0x4')]('in',_0x5a1a('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x5a1a('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5a1a('0x6')]}}; \ No newline at end of file +var _0x0884=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x371265,_0x4af59f){var _0x45fe0f=function(_0x2a9519){while(--_0x2a9519){_0x371265['push'](_0x371265['shift']());}};_0x45fe0f(++_0x4af59f);}(_0x0884,0xb3));var _0x4088=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0884[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4088('0x0'));module[_0x4088('0x1')]={'body':{'type':Sequelize[_0x4088('0x2')](_0x4088('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4088('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4088('0x5')]('in',_0x4088('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x4088('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x4088('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index dbc5637..c86bdd3 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 _0x8578=['pick','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','rows','catch','show','params','find','update','body','destroy','describe','../../config/logger','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT','contact','create','findOne','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','client','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','undefined','count','offset','limit','set','reject','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','sort','where'];(function(_0x190f62,_0x51f546){var _0xdf253e=function(_0xd906b){while(--_0xd906b){_0x190f62['push'](_0x190f62['shift']());}};_0xdf253e(++_0x51f546);}(_0x8578,0x159));var _0x8857=function(_0x565b36,_0x24db7c){_0x565b36=_0x565b36-0x0;var _0x3fd9c0=_0x8578[_0x565b36];return _0x3fd9c0;};'use strict';var emlformat=require(_0x8857('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8857('0x1'));var jsonpatch=require(_0x8857('0x2'));var rp=require(_0x8857('0x3'));var moment=require(_0x8857('0x4'));var BPromise=require(_0x8857('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8857('0x6'));var sox=require(_0x8857('0x7'));var csv=require(_0x8857('0x8'));var ejs=require(_0x8857('0x9'));var fs=require('fs');var fs_extra=require(_0x8857('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8857('0xb'));var jsforce=require(_0x8857('0xc'));var deskjs=require(_0x8857('0xd'));var toCsv=require(_0x8857('0x8'));var querystring=require(_0x8857('0xe'));var Papa=require(_0x8857('0xf'));var Redis=require(_0x8857('0x10'));var authService=require(_0x8857('0x11'));var qs=require(_0x8857('0x12'));var as=require(_0x8857('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8857('0x14'));var utils=require(_0x8857('0x15'));var config=require(_0x8857('0x16'));var licenseUtil=require(_0x8857('0x17'));var db=require(_0x8857('0x18'))['db'];config[_0x8857('0x19')]=_['defaults'](config[_0x8857('0x19')],{'host':_0x8857('0x1a'),'port':0x18eb});var socket=require(_0x8857('0x1b'))(new Redis(config[_0x8857('0x19')]));require(_0x8857('0x1c'))[_0x8857('0x1d')](socket);var jayson=require(_0x8857('0x1e'));var client=jayson['client'][_0x8857('0x1f')]({'port':0x232c});var client9002=jayson[_0x8857('0x20')][_0x8857('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x14f4f3,_0x5b9bd1,_0x3400c7,_0x4e2612){return new BPromise(function(_0x24de3f,_0x15df7d){var _0x2ce300=_0x4e2612||client;return _0x2ce300[_0x8857('0x21')](_0x14f4f3,_0x3400c7)[_0x8857('0x22')](function(_0x53a57d){logger[_0x8857('0x23')](_0x8857('0x24'),_0x5b9bd1,_0x8857('0x25'));logger['debug'](_0x8857('0x26'),_0x5b9bd1,'request\x20sent',JSON['stringify'](_0x53a57d));if(_0x53a57d[_0x8857('0x27')]){if(_0x53a57d[_0x8857('0x27')][_0x8857('0x28')]===0x1f4){logger[_0x8857('0x27')](_0x8857('0x24'),_0x5b9bd1,_0x53a57d[_0x8857('0x27')][_0x8857('0x29')]);return _0x15df7d(_0x53a57d[_0x8857('0x27')]['message']);}logger[_0x8857('0x27')](_0x8857('0x24'),_0x5b9bd1,_0x53a57d['error']['message']);return _0x24de3f(_0x53a57d[_0x8857('0x27')][_0x8857('0x29')]);}else{logger[_0x8857('0x23')]('FaxMessage,\x20%s,\x20%s',_0x5b9bd1,_0x8857('0x25'));_0x24de3f(_0x53a57d['result']['message']);}})['catch'](function(_0x3e1b2a){logger[_0x8857('0x27')](_0x8857('0x24'),_0x5b9bd1,_0x3e1b2a);_0x15df7d(_0x3e1b2a);});});}function respondWithStatusCode(_0x240436,_0x293b8f){_0x293b8f=_0x293b8f||0xcc;return function(_0x23f800){if(_0x23f800){return _0x240436[_0x8857('0x2a')](_0x293b8f);}return _0x240436[_0x8857('0x2b')](_0x293b8f)[_0x8857('0x2c')]();};}function respondWithResult(_0x410124,_0x5b0af7){_0x5b0af7=_0x5b0af7||0xc8;return function(_0x3a1e5b){if(_0x3a1e5b){return _0x410124[_0x8857('0x2b')](_0x5b0af7)['json'](_0x3a1e5b);}};}function respondWithFilteredResult(_0x3410c6,_0x551629){return function(_0x1f9b2b){if(_0x1f9b2b){var _0x528427=typeof _0x551629['offset']==='undefined'&&typeof _0x551629['limit']===_0x8857('0x2d');var _0x40ac99=_0x1f9b2b[_0x8857('0x2e')];var _0x43d33b=_0x528427?0x0:_0x551629['offset'];var _0xbc588=_0x528427?_0x1f9b2b[_0x8857('0x2e')]:_0x551629[_0x8857('0x2f')]+_0x551629[_0x8857('0x30')];var _0x598c3d;if(_0xbc588>=_0x40ac99){_0xbc588=_0x40ac99;_0x598c3d=0xc8;}else{_0x598c3d=0xce;}_0x3410c6[_0x8857('0x2b')](_0x598c3d);return _0x3410c6[_0x8857('0x31')]('Content-Range',_0x43d33b+'-'+_0xbc588+'/'+_0x40ac99)['json'](_0x1f9b2b);}return null;};}function patchUpdates(_0x45f9c0){return function(_0x50b0d4){try{jsonpatch['apply'](_0x50b0d4,_0x45f9c0,!![]);}catch(_0x5c8498){return BPromise[_0x8857('0x32')](_0x5c8498);}return _0x50b0d4['save']();};}function saveUpdates(_0x3ad30e,_0x304c28){return function(_0x28d1d8){if(_0x28d1d8){return _0x28d1d8['update'](_0x3ad30e)[_0x8857('0x22')](function(_0x3ca205){return _0x3ca205;});}return null;};}function removeEntity(_0x37bc21,_0x28f0d9){return function(_0x5b86e8){if(_0x5b86e8){return _0x5b86e8['destroy']()[_0x8857('0x22')](function(){_0x37bc21[_0x8857('0x2b')](0xcc)[_0x8857('0x2c')]();});}};}function handleEntityNotFound(_0x3e1e6a,_0x1b2aa9){return function(_0x167ac9){if(!_0x167ac9){_0x3e1e6a['sendStatus'](0x194);}return _0x167ac9;};}function handleError(_0x826dda,_0x51908f){_0x51908f=_0x51908f||0x1f4;return function(_0x5d7471){logger[_0x8857('0x27')](_0x5d7471[_0x8857('0x33')]);if(_0x5d7471[_0x8857('0x34')]){delete _0x5d7471[_0x8857('0x34')];}_0x826dda[_0x8857('0x2b')](_0x51908f)[_0x8857('0x35')](_0x5d7471);};}exports[_0x8857('0x36')]=function(_0x4427c4,_0x759595){var _0x508385={},_0xe822cb={},_0x4716df={'count':0x0,'rows':[]};var _0x5fb954=_['map'](db['FaxMessage'][_0x8857('0x37')],function(_0x11e3fa){return{'name':_0x11e3fa[_0x8857('0x38')],'type':_0x11e3fa[_0x8857('0x39')][_0x8857('0x3a')]};});_0xe822cb[_0x8857('0x3b')]=_[_0x8857('0x3c')](_0x5fb954,_0x8857('0x34'));_0xe822cb[_0x8857('0x3d')]=_['keys'](_0x4427c4[_0x8857('0x3d')]);_0xe822cb[_0x8857('0x3e')]=_['intersection'](_0xe822cb[_0x8857('0x3b')],_0xe822cb[_0x8857('0x3d')]);_0x508385['attributes']=_[_0x8857('0x3f')](_0xe822cb[_0x8857('0x3b')],qs[_0x8857('0x40')](_0x4427c4[_0x8857('0x3d')]['fields']));_0x508385[_0x8857('0x41')]=_0x508385[_0x8857('0x41')][_0x8857('0x42')]?_0x508385[_0x8857('0x41')]:_0xe822cb[_0x8857('0x3b')];if(!_0x4427c4[_0x8857('0x3d')]['hasOwnProperty']('nolimit')){_0x508385[_0x8857('0x30')]=qs[_0x8857('0x30')](_0x4427c4[_0x8857('0x3d')][_0x8857('0x30')]);_0x508385[_0x8857('0x2f')]=qs[_0x8857('0x2f')](_0x4427c4[_0x8857('0x3d')]['offset']);}_0x508385['order']=qs[_0x8857('0x43')](_0x4427c4[_0x8857('0x3d')][_0x8857('0x43')]);_0x508385[_0x8857('0x44')]=qs[_0x8857('0x3e')](_[_0x8857('0x45')](_0x4427c4[_0x8857('0x3d')],_0xe822cb['filters']),_0x5fb954);if(_0x4427c4[_0x8857('0x3d')]['filter']){_0x508385[_0x8857('0x44')]=_[_0x8857('0x46')](_0x508385[_0x8857('0x44')],{'$or':_['map'](_0x5fb954,function(_0x1e86a7){if(_0x1e86a7[_0x8857('0x39')]!==_0x8857('0x47')){var _0x1d354d={};_0x1d354d[_0x1e86a7[_0x8857('0x34')]]={'$like':'%'+_0x4427c4[_0x8857('0x3d')]['filter']+'%'};return _0x1d354d;}})});}_0x508385=_[_0x8857('0x46')]({},_0x508385,_0x4427c4[_0x8857('0x48')]);var _0x22ee2a={'where':_0x508385[_0x8857('0x44')]};return db[_0x8857('0x49')]['count'](_0x22ee2a)[_0x8857('0x22')](function(_0x258120){_0x4716df[_0x8857('0x2e')]=_0x258120;if(_0x4427c4[_0x8857('0x3d')][_0x8857('0x4a')]){_0x508385[_0x8857('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x8857('0x4c')](_0x508385);})[_0x8857('0x22')](function(_0x4dba50){_0x4716df[_0x8857('0x4d')]=_0x4dba50;return _0x4716df;})[_0x8857('0x22')](respondWithFilteredResult(_0x759595,_0x508385))[_0x8857('0x4e')](handleError(_0x759595,null));};exports[_0x8857('0x4f')]=function(_0x4f4dc8,_0x40cadd){var _0x158825={'raw':!![],'where':{'id':_0x4f4dc8[_0x8857('0x50')]['id']}},_0x44568c={};_0x44568c['model']=_['keys'](db[_0x8857('0x49')][_0x8857('0x37')]);_0x44568c[_0x8857('0x3d')]=_['keys'](_0x4f4dc8['query']);_0x44568c['filters']=_[_0x8857('0x3f')](_0x44568c[_0x8857('0x3b')],_0x44568c[_0x8857('0x3d')]);_0x158825[_0x8857('0x41')]=_[_0x8857('0x3f')](_0x44568c[_0x8857('0x3b')],qs[_0x8857('0x40')](_0x4f4dc8[_0x8857('0x3d')][_0x8857('0x40')]));_0x158825['attributes']=_0x158825[_0x8857('0x41')][_0x8857('0x42')]?_0x158825[_0x8857('0x41')]:_0x44568c['model'];if(_0x4f4dc8['query']['includeAll']){_0x158825[_0x8857('0x4b')]=[{'all':!![]}];}_0x158825=_['merge']({},_0x158825,_0x4f4dc8['options']);return db['FaxMessage'][_0x8857('0x51')](_0x158825)[_0x8857('0x22')](handleEntityNotFound(_0x40cadd,null))[_0x8857('0x22')](respondWithResult(_0x40cadd,null))[_0x8857('0x4e')](handleError(_0x40cadd,null));};exports[_0x8857('0x52')]=function(_0x47253a,_0x38d580){if(_0x47253a[_0x8857('0x53')]['id']){delete _0x47253a[_0x8857('0x53')]['id'];}return db[_0x8857('0x49')][_0x8857('0x51')]({'where':{'id':_0x47253a['params']['id']}})[_0x8857('0x22')](handleEntityNotFound(_0x38d580,null))[_0x8857('0x22')](saveUpdates(_0x47253a['body'],null))[_0x8857('0x22')](respondWithResult(_0x38d580,null))[_0x8857('0x4e')](handleError(_0x38d580,null));};exports[_0x8857('0x54')]=function(_0xa2c886,_0x1c9d78){return db[_0x8857('0x49')][_0x8857('0x51')]({'where':{'id':_0xa2c886[_0x8857('0x50')]['id']}})[_0x8857('0x22')](handleEntityNotFound(_0x1c9d78,null))['then'](removeEntity(_0x1c9d78,null))[_0x8857('0x4e')](handleError(_0x1c9d78,null));};exports[_0x8857('0x55')]=function(_0x59186e,_0x2fba94){return db['FaxMessage'][_0x8857('0x55')]()[_0x8857('0x22')](respondWithResult(_0x2fba94,null))[_0x8857('0x4e')](handleError(_0x2fba94,null));};var interaction_log=require(_0x8857('0x56'))(_0x8857('0x57'));exports[_0x8857('0x58')]=function(_0x5ae3ef,_0x1f7a12,_0x226255){var _0x2432a0={'agent':{},'channel':_0x8857('0x59')};if(_0x5ae3ef[_0x8857('0x53')]['id']){delete _0x5ae3ef['body']['id'];}_0x5ae3ef[_0x8857('0x53')][_0x8857('0x5a')]=!![];_0x5ae3ef['body']['readAt']=moment()[_0x8857('0x5b')](_0x8857('0x5c'));_0x5ae3ef[_0x8857('0x53')][_0x8857('0x5d')]=_0x5ae3ef[_0x8857('0x53')][_0x8857('0x5d')]||_0x5ae3ef['user']['id'];_0x2432a0['agent']['id']=_0x5ae3ef[_0x8857('0x53')]['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x5ae3ef[_0x8857('0x50')]['id'],'UserId':null}})[_0x8857('0x22')](handleEntityNotFound(_0x1f7a12,null))['then'](saveUpdates(_0x5ae3ef[_0x8857('0x53')],null))[_0x8857('0x22')](function(_0x1285b8){if(_0x1285b8){_0x2432a0['message']=_0x1285b8[_0x8857('0x5e')]({'plain':!![]});return db[_0x8857('0x5f')]['find']({'where':{'id':_0x1285b8['FaxInteractionId']}});}return null;})[_0x8857('0x22')](handleEntityNotFound(_0x1f7a12,null))[_0x8857('0x22')](function(_0x36b06a){if(_0x36b06a){return _0x36b06a['update']({'UserId':_0x5ae3ef[_0x8857('0x53')][_0x8857('0x5d')],'read1stAt':_[_0x8857('0x60')](_0x36b06a[_0x8857('0x61')])?moment()[_0x8857('0x5b')](_0x8857('0x5c')):undefined});}return null;})[_0x8857('0x22')](function(_0x1ec4d0){if(_0x1ec4d0){_0x2432a0[_0x8857('0x62')]=_0x1ec4d0[_0x8857('0x5e')]({'plain':!![]});interaction_log[_0x8857('0x23')](_0x8857('0x63'),_0x5ae3ef[_0x8857('0x64')]['id'],_0x5ae3ef[_0x8857('0x64')][_0x8857('0x34')],_0x5ae3ef[_0x8857('0x64')][_0x8857('0x65')],_0x2432a0[_0x8857('0x62')]['id'],_0x5ae3ef[_0x8857('0x53')]?JSON[_0x8857('0x66')](_0x5ae3ef[_0x8857('0x53')]):'null');return respondWithRpcPromise('AcceptMessage',_0x8857('0x67'),_0x2432a0);}return null;})[_0x8857('0x22')](function(_0x2705bb){var _0x2be0ad=_0x8857('0x68')+_0x2705bb[_0x8857('0x29')][_0x8857('0x69')];return db[_0x8857('0x6a')][_0x8857('0x3d')](_0x2be0ad,{'type':db[_0x8857('0x6b')][_0x8857('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x388c71){return _0x388c71;});})['then'](function(_0x57e889){if(_0x57e889){_0x2432a0['message']['contact']=_0x57e889[0x0];if(!_0x5ae3ef['body'][_0x8857('0x5d')])return;return db[_0x8857('0x6d')][_0x8857('0x51')]({'where':{'id':_0x5ae3ef[_0x8857('0x53')][_0x8857('0x5d')],'role':_0x8857('0x6e')},'attributes':['id','name',_0x8857('0x6f'),_0x8857('0x70'),_0x8857('0x71')],'raw':!![]});}return null;})[_0x8857('0x22')](function(_0x2db3a9){if(!_0x2db3a9)return null;_0x2432a0[_0x8857('0x29')][_0x8857('0x6e')]=_0x2db3a9;return _0x2432a0;})['then'](function(_0x2b4a5c){if(_0x2b4a5c){if(_0x5ae3ef[_0x8857('0x53')][_0x8857('0x72')]){_0x2432a0[_0x8857('0x29')]['interface']=util[_0x8857('0x5b')](_0x8857('0x73'),_0x5ae3ef['user'][_0x8857('0x34')]);_0x2432a0[_0x8857('0x29')][_0x8857('0x74')]=_0x2432a0[_0x8857('0x74')];_0x2432a0[_0x8857('0x29')][_0x8857('0x75')]=_0x2432a0['channel'];_0x2432a0[_0x8857('0x29')][_0x8857('0x76')]=_0x8857('0x58');return respondWithRpcPromise(_0x8857('0x77'),_0x8857('0x77'),{'event':'acceptmessage','message':_0x2432a0[_0x8857('0x29')]},client9002)[_0x8857('0x22')](function(){return _0x2432a0;});}return _0x2432a0;}return null;})['then'](respondWithResult(_0x1f7a12,null))[_0x8857('0x4e')](handleError(_0x1f7a12,null));};var interaction_log=require(_0x8857('0x56'))(_0x8857('0x57'));exports[_0x8857('0x32')]=function(_0x49d334,_0x13fe8d,_0x5b1110){var _0x3cab86={'agent':{},'channel':_0x8857('0x59')};if(_0x49d334[_0x8857('0x53')]['id']){delete _0x49d334[_0x8857('0x53')]['id'];}_0x49d334[_0x8857('0x53')][_0x8857('0x5d')]=_0x49d334['body'][_0x8857('0x5d')]||_0x49d334[_0x8857('0x64')]['id'];_0x3cab86['agent']['id']=_0x49d334['body'][_0x8857('0x5d')];return db[_0x8857('0x49')]['find']({'where':{'id':_0x49d334[_0x8857('0x50')]['id'],'UserId':null}})[_0x8857('0x22')](handleEntityNotFound(_0x13fe8d,null))[_0x8857('0x22')](function(_0x280e3f){if(_0x280e3f){_0x3cab86[_0x8857('0x29')]=_0x280e3f[_0x8857('0x5e')]({'plain':!![]});return db[_0x8857('0x5f')][_0x8857('0x51')]({'where':{'id':_0x280e3f[_0x8857('0x78')]}});}return null;})[_0x8857('0x22')](handleEntityNotFound(_0x13fe8d,null))[_0x8857('0x22')](function(_0x4361b0){if(_0x4361b0){_0x3cab86[_0x8857('0x62')]=_0x4361b0[_0x8857('0x5e')]({'plain':!![]});interaction_log[_0x8857('0x23')](_0x8857('0x79'),_0x49d334[_0x8857('0x64')]['id'],_0x49d334[_0x8857('0x64')][_0x8857('0x34')],_0x49d334['user'][_0x8857('0x65')],_0x3cab86[_0x8857('0x62')]['id'],_0x49d334[_0x8857('0x53')]?JSON[_0x8857('0x66')](_0x49d334[_0x8857('0x53')]):_0x8857('0x7a'));return respondWithRpcPromise(_0x8857('0x7b'),'rejectMessage',_0x3cab86);}return null;})[_0x8857('0x22')](function(_0x505cae){var _0x185f4a=_0x8857('0x68')+_0x505cae[_0x8857('0x29')][_0x8857('0x69')];return db['sequelize'][_0x8857('0x3d')](_0x185f4a,{'type':db['Sequelize'][_0x8857('0x6c')][_0x8857('0x7c')],'raw':!![]})['then'](function(_0x4725e2){return _0x4725e2;});})[_0x8857('0x22')](function(_0x5e52ee){if(_0x5e52ee){_0x3cab86[_0x8857('0x29')][_0x8857('0x7d')]=_0x5e52ee[0x0];if(!_0x49d334[_0x8857('0x53')]['UserId'])return;return db[_0x8857('0x6d')][_0x8857('0x51')]({'where':{'id':_0x49d334[_0x8857('0x53')][_0x8857('0x5d')],'role':_0x8857('0x6e')},'attributes':['id',_0x8857('0x34'),_0x8857('0x6f'),_0x8857('0x70'),_0x8857('0x71')],'raw':!![]});}return null;})[_0x8857('0x22')](function(_0x2b3098){if(!_0x2b3098)return null;_0x3cab86[_0x8857('0x29')][_0x8857('0x6e')]=_0x2b3098;return _0x3cab86;})[_0x8857('0x22')](function(_0x8638cc){if(_0x8638cc){_0x8638cc[_0x8857('0x29')]['interface']=util[_0x8857('0x5b')](_0x8857('0x73'),_0x49d334[_0x8857('0x64')][_0x8857('0x34')]);_0x8638cc[_0x8857('0x29')][_0x8857('0x74')]=_0x3cab86[_0x8857('0x74')];_0x8638cc[_0x8857('0x29')][_0x8857('0x75')]=_0x3cab86[_0x8857('0x74')];_0x8638cc[_0x8857('0x29')][_0x8857('0x76')]=_0x8857('0x32');respondWithRpcPromise('EventManager',_0x8857('0x77'),{'event':'rejectmessage','message':_0x8638cc[_0x8857('0x29')]},client9002);return _0x3cab86;}return null;})[_0x8857('0x22')](respondWithResult(_0x13fe8d,null))['catch'](handleError(_0x13fe8d,null));};exports[_0x8857('0x7e')]=function(_0x14e46d,_0xf331a7){var _0x5e7549;return db['FaxMessage'][_0x8857('0x7e')](_0x14e46d[_0x8857('0x53')],{})[_0x8857('0x22')](function(_0x1fcbd5){_0x5e7549=_0x1fcbd5;return db['CmContact'][_0x8857('0x7f')]({'where':{'id':_0x5e7549[_0x8857('0x69')]}});})[_0x8857('0x22')](function(_0x4dde39){if(_['isNil'](_0x4dde39)){return;}else{_0x5e7549[_0x8857('0x59')]=_0x4dde39[_0x8857('0x59')];return db[_0x8857('0x80')][_0x8857('0x7f')]({'where':{'id':_0x5e7549['AttachmentId']}});}})[_0x8857('0x22')](function(_0x115274){return respondWithRpcPromise(_0x8857('0x81'),_0x8857('0x81'),{'FaxAccountId':_['isNil'](_0x14e46d[_0x8857('0x53')])?undefined:_0x14e46d[_0x8857('0x53')][_0x8857('0x82')],'path':_['isNil'](_0x115274)?undefined:util[_0x8857('0x5b')](_0x8857('0x83'),_0x115274[_0x8857('0x84')]),'fax':_[_0x8857('0x60')](_0x5e7549[_0x8857('0x59')])?undefined:_0x5e7549[_0x8857('0x59')],'AttachmentId':_0x5e7549['AttachmentId']},client9002);})['then'](respondWithResult(_0xf331a7,0xc9))[_0x8857('0x4e')](handleError(_0xf331a7,null));};exports[_0x8857('0x85')]=function(_0x4d8f6b,_0x3116ee){var _0x4c7d61=path[_0x8857('0x86')](config['root'],_0x8857('0x87'),_0x8857('0x88'),_0x8857('0x89'));return db[_0x8857('0x49')]['find']({'where':{'id':_0x4d8f6b[_0x8857('0x50')]['id']},'include':[{'model':db[_0x8857('0x80')],'as':_0x8857('0x80')}]})[_0x8857('0x22')](handleEntityNotFound(_0x3116ee,null))['then'](function(_0x31ef6a){if(_0x31ef6a){return _0x3116ee[_0x8857('0x85')](path[_0x8857('0x86')](_0x4c7d61,_0x31ef6a[_0x8857('0x80')]['basename']));}})[_0x8857('0x4e')](handleError(_0x3116ee,null));}; \ No newline at end of file +var _0xfc6d=['event','EventManager','acceptmessage','fax','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','QueryTypes','contact','fullname','create','CmContact','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','root','files','attachments','download','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./faxMessage.socket','register','http','client','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','index','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','rows','show','params','includeAll','include','find','body','describe','fax-interactions','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','User','email','internal','interface','SIP/%s','channel','motionChannel'];(function(_0x414933,_0x55dede){var _0x32fd42=function(_0x3b32af){while(--_0x3b32af){_0x414933['push'](_0x414933['shift']());}};_0x32fd42(++_0x55dede);}(_0xfc6d,0xa4));var _0xdfc6=function(_0x47eaf4,_0x48966f){_0x47eaf4=_0x47eaf4-0x0;var _0x34e333=_0xfc6d[_0x47eaf4];return _0x34e333;};'use strict';var emlformat=require(_0xdfc6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdfc6('0x1'));var moment=require(_0xdfc6('0x2'));var BPromise=require(_0xdfc6('0x3'));var Mustache=require(_0xdfc6('0x4'));var util=require('util');var path=require(_0xdfc6('0x5'));var sox=require(_0xdfc6('0x6'));var csv=require('to-csv');var ejs=require(_0xdfc6('0x7'));var fs=require('fs');var fs_extra=require(_0xdfc6('0x8'));var _=require(_0xdfc6('0x9'));var squel=require(_0xdfc6('0xa'));var crypto=require(_0xdfc6('0xb'));var jsforce=require(_0xdfc6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdfc6('0xd'));var querystring=require(_0xdfc6('0xe'));var Papa=require(_0xdfc6('0xf'));var Redis=require(_0xdfc6('0x10'));var authService=require(_0xdfc6('0x11'));var qs=require(_0xdfc6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdfc6('0x13'));var logger=require(_0xdfc6('0x14'))(_0xdfc6('0x15'));var utils=require(_0xdfc6('0x16'));var config=require(_0xdfc6('0x17'));var licenseUtil=require(_0xdfc6('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdfc6('0x19')](config[_0xdfc6('0x1a')],{'host':_0xdfc6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdfc6('0x1c'))[_0xdfc6('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xdfc6('0x1e')]({'port':0x232c});var client9002=jayson[_0xdfc6('0x1f')][_0xdfc6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2d0ff3,_0x32903a,_0xa8de59,_0x149a93){return new BPromise(function(_0xfb6e7a,_0x3ae888){var _0x5e265e=_0x149a93||client;return _0x5e265e['request'](_0x2d0ff3,_0xa8de59)[_0xdfc6('0x20')](function(_0x436f30){logger[_0xdfc6('0x21')](_0xdfc6('0x22'),_0x32903a,_0xdfc6('0x23'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x32903a,_0xdfc6('0x23'),JSON['stringify'](_0x436f30));if(_0x436f30[_0xdfc6('0x24')]){if(_0x436f30[_0xdfc6('0x24')][_0xdfc6('0x25')]===0x1f4){logger['error'](_0xdfc6('0x22'),_0x32903a,_0x436f30[_0xdfc6('0x24')][_0xdfc6('0x26')]);return _0x3ae888(_0x436f30[_0xdfc6('0x24')]['message']);}logger['error'](_0xdfc6('0x22'),_0x32903a,_0x436f30['error'][_0xdfc6('0x26')]);return _0xfb6e7a(_0x436f30['error'][_0xdfc6('0x26')]);}else{logger[_0xdfc6('0x21')](_0xdfc6('0x22'),_0x32903a,_0xdfc6('0x23'));_0xfb6e7a(_0x436f30[_0xdfc6('0x27')][_0xdfc6('0x26')]);}})[_0xdfc6('0x28')](function(_0x28af52){logger[_0xdfc6('0x24')](_0xdfc6('0x22'),_0x32903a,_0x28af52);_0x3ae888(_0x28af52);});});}function respondWithStatusCode(_0x38a4e5,_0x53b99a){_0x53b99a=_0x53b99a||0xcc;return function(_0x5db8b3){if(_0x5db8b3){return _0x38a4e5['sendStatus'](_0x53b99a);}return _0x38a4e5[_0xdfc6('0x29')](_0x53b99a)['end']();};}function respondWithResult(_0x3c1672,_0x437c39){_0x437c39=_0x437c39||0xc8;return function(_0x143e86){if(_0x143e86){return _0x3c1672[_0xdfc6('0x29')](_0x437c39)[_0xdfc6('0x2a')](_0x143e86);}};}function respondWithFilteredResult(_0x2bd083,_0x11a454){return function(_0x32cdbd){if(_0x32cdbd){var _0x1045cc=typeof _0x11a454['offset']===_0xdfc6('0x2b')&&typeof _0x11a454[_0xdfc6('0x2c')]==='undefined';var _0x345a2a=_0x32cdbd[_0xdfc6('0x2d')];var _0x504aaa=_0x1045cc?0x0:_0x11a454['offset'];var _0x3f79ec=_0x1045cc?_0x32cdbd[_0xdfc6('0x2d')]:_0x11a454[_0xdfc6('0x2e')]+_0x11a454[_0xdfc6('0x2c')];var _0x4b4173;if(_0x3f79ec>=_0x345a2a){_0x3f79ec=_0x345a2a;_0x4b4173=0xc8;}else{_0x4b4173=0xce;}_0x2bd083[_0xdfc6('0x29')](_0x4b4173);return _0x2bd083[_0xdfc6('0x2f')](_0xdfc6('0x30'),_0x504aaa+'-'+_0x3f79ec+'/'+_0x345a2a)['json'](_0x32cdbd);}return null;};}function patchUpdates(_0x346a3b){return function(_0xe13829){try{jsonpatch[_0xdfc6('0x31')](_0xe13829,_0x346a3b,!![]);}catch(_0x1af274){return BPromise[_0xdfc6('0x32')](_0x1af274);}return _0xe13829[_0xdfc6('0x33')]();};}function saveUpdates(_0x1c2cda,_0x15592d){return function(_0xb5bb72){if(_0xb5bb72){return _0xb5bb72[_0xdfc6('0x34')](_0x1c2cda)[_0xdfc6('0x20')](function(_0x4ea484){return _0x4ea484;});}return null;};}function removeEntity(_0xad0703,_0x122b39){return function(_0xd8b7b){if(_0xd8b7b){return _0xd8b7b[_0xdfc6('0x35')]()['then'](function(){_0xad0703[_0xdfc6('0x29')](0xcc)[_0xdfc6('0x36')]();});}};}function handleEntityNotFound(_0x17a34b,_0x457ddb){return function(_0x5aadeb){if(!_0x5aadeb){_0x17a34b[_0xdfc6('0x37')](0x194);}return _0x5aadeb;};}function handleError(_0x18c251,_0x149659){_0x149659=_0x149659||0x1f4;return function(_0x2fbbe4){logger[_0xdfc6('0x24')](_0x2fbbe4['stack']);if(_0x2fbbe4[_0xdfc6('0x38')]){delete _0x2fbbe4['name'];}_0x18c251['status'](_0x149659)['send'](_0x2fbbe4);};}exports[_0xdfc6('0x39')]=function(_0x4fb783,_0x1d3c2c){var _0x1e02e2={},_0x1c40d6={},_0x2b7315={'count':0x0,'rows':[]};var _0x4cb6c2=_[_0xdfc6('0x3a')](db[_0xdfc6('0x3b')][_0xdfc6('0x3c')],function(_0x3cc05f){return{'name':_0x3cc05f[_0xdfc6('0x3d')],'type':_0x3cc05f['type'][_0xdfc6('0x3e')]};});_0x1c40d6[_0xdfc6('0x3f')]=_[_0xdfc6('0x3a')](_0x4cb6c2,_0xdfc6('0x38'));_0x1c40d6[_0xdfc6('0x40')]=_[_0xdfc6('0x41')](_0x4fb783[_0xdfc6('0x40')]);_0x1c40d6[_0xdfc6('0x42')]=_[_0xdfc6('0x43')](_0x1c40d6[_0xdfc6('0x3f')],_0x1c40d6['query']);_0x1e02e2['attributes']=_[_0xdfc6('0x43')](_0x1c40d6['model'],qs[_0xdfc6('0x44')](_0x4fb783['query'][_0xdfc6('0x44')]));_0x1e02e2[_0xdfc6('0x45')]=_0x1e02e2[_0xdfc6('0x45')][_0xdfc6('0x46')]?_0x1e02e2[_0xdfc6('0x45')]:_0x1c40d6[_0xdfc6('0x3f')];if(!_0x4fb783[_0xdfc6('0x40')][_0xdfc6('0x47')]('nolimit')){_0x1e02e2['limit']=qs[_0xdfc6('0x2c')](_0x4fb783[_0xdfc6('0x40')][_0xdfc6('0x2c')]);_0x1e02e2[_0xdfc6('0x2e')]=qs['offset'](_0x4fb783['query'][_0xdfc6('0x2e')]);}_0x1e02e2[_0xdfc6('0x48')]=qs['sort'](_0x4fb783[_0xdfc6('0x40')][_0xdfc6('0x49')]);_0x1e02e2[_0xdfc6('0x4a')]=qs[_0xdfc6('0x42')](_[_0xdfc6('0x4b')](_0x4fb783['query'],_0x1c40d6['filters']),_0x4cb6c2);if(_0x4fb783[_0xdfc6('0x40')]['filter']){_0x1e02e2['where']=_[_0xdfc6('0x4c')](_0x1e02e2['where'],{'$or':_['map'](_0x4cb6c2,function(_0x30909b){if(_0x30909b[_0xdfc6('0x4d')]!==_0xdfc6('0x4e')){var _0x5721f4={};_0x5721f4[_0x30909b[_0xdfc6('0x38')]]={'$like':'%'+_0x4fb783[_0xdfc6('0x40')][_0xdfc6('0x4f')]+'%'};return _0x5721f4;}})});}_0x1e02e2=_['merge']({},_0x1e02e2,_0x4fb783[_0xdfc6('0x50')]);var _0x37a36e={'where':_0x1e02e2[_0xdfc6('0x4a')]};return db[_0xdfc6('0x3b')][_0xdfc6('0x2d')](_0x37a36e)['then'](function(_0x43a7fc){_0x2b7315['count']=_0x43a7fc;if(_0x4fb783['query']['includeAll']){_0x1e02e2['include']=[{'all':!![]}];}return db[_0xdfc6('0x3b')]['findAll'](_0x1e02e2);})[_0xdfc6('0x20')](function(_0x2bdd33){_0x2b7315[_0xdfc6('0x51')]=_0x2bdd33;return _0x2b7315;})[_0xdfc6('0x20')](respondWithFilteredResult(_0x1d3c2c,_0x1e02e2))[_0xdfc6('0x28')](handleError(_0x1d3c2c,null));};exports[_0xdfc6('0x52')]=function(_0x3dc471,_0x313bb7){var _0x4fd7e4={'raw':!![],'where':{'id':_0x3dc471[_0xdfc6('0x53')]['id']}},_0x21e0cc={};_0x21e0cc[_0xdfc6('0x3f')]=_[_0xdfc6('0x41')](db[_0xdfc6('0x3b')][_0xdfc6('0x3c')]);_0x21e0cc[_0xdfc6('0x40')]=_['keys'](_0x3dc471[_0xdfc6('0x40')]);_0x21e0cc['filters']=_[_0xdfc6('0x43')](_0x21e0cc['model'],_0x21e0cc[_0xdfc6('0x40')]);_0x4fd7e4[_0xdfc6('0x45')]=_[_0xdfc6('0x43')](_0x21e0cc['model'],qs[_0xdfc6('0x44')](_0x3dc471[_0xdfc6('0x40')][_0xdfc6('0x44')]));_0x4fd7e4[_0xdfc6('0x45')]=_0x4fd7e4[_0xdfc6('0x45')]['length']?_0x4fd7e4['attributes']:_0x21e0cc[_0xdfc6('0x3f')];if(_0x3dc471[_0xdfc6('0x40')][_0xdfc6('0x54')]){_0x4fd7e4[_0xdfc6('0x55')]=[{'all':!![]}];}_0x4fd7e4=_['merge']({},_0x4fd7e4,_0x3dc471[_0xdfc6('0x50')]);return db[_0xdfc6('0x3b')][_0xdfc6('0x56')](_0x4fd7e4)[_0xdfc6('0x20')](handleEntityNotFound(_0x313bb7,null))[_0xdfc6('0x20')](respondWithResult(_0x313bb7,null))[_0xdfc6('0x28')](handleError(_0x313bb7,null));};exports[_0xdfc6('0x34')]=function(_0x4f60dd,_0x55dedf){if(_0x4f60dd['body']['id']){delete _0x4f60dd[_0xdfc6('0x57')]['id'];}return db[_0xdfc6('0x3b')][_0xdfc6('0x56')]({'where':{'id':_0x4f60dd[_0xdfc6('0x53')]['id']}})[_0xdfc6('0x20')](handleEntityNotFound(_0x55dedf,null))[_0xdfc6('0x20')](saveUpdates(_0x4f60dd['body'],null))['then'](respondWithResult(_0x55dedf,null))[_0xdfc6('0x28')](handleError(_0x55dedf,null));};exports['destroy']=function(_0x110ee6,_0x4de884){return db[_0xdfc6('0x3b')]['find']({'where':{'id':_0x110ee6[_0xdfc6('0x53')]['id']}})[_0xdfc6('0x20')](handleEntityNotFound(_0x4de884,null))[_0xdfc6('0x20')](removeEntity(_0x4de884,null))['catch'](handleError(_0x4de884,null));};exports[_0xdfc6('0x58')]=function(_0x49be54,_0x26dc52){return db[_0xdfc6('0x3b')][_0xdfc6('0x58')]()[_0xdfc6('0x20')](respondWithResult(_0x26dc52,null))[_0xdfc6('0x28')](handleError(_0x26dc52,null));};var interaction_log=require(_0xdfc6('0x14'))(_0xdfc6('0x59'));exports[_0xdfc6('0x5a')]=function(_0x32a67a,_0x15a6e3,_0x2a84e3){var _0x38a9b1={'agent':{},'channel':'fax'};if(_0x32a67a[_0xdfc6('0x57')]['id']){delete _0x32a67a[_0xdfc6('0x57')]['id'];}_0x32a67a[_0xdfc6('0x57')]['read']=!![];_0x32a67a[_0xdfc6('0x57')]['readAt']=moment()['format'](_0xdfc6('0x5b'));_0x32a67a['body'][_0xdfc6('0x5c')]=_0x32a67a[_0xdfc6('0x57')][_0xdfc6('0x5c')]||_0x32a67a[_0xdfc6('0x5d')]['id'];_0x38a9b1[_0xdfc6('0x5e')]['id']=_0x32a67a[_0xdfc6('0x57')]['UserId'];return db[_0xdfc6('0x3b')][_0xdfc6('0x56')]({'where':{'id':_0x32a67a[_0xdfc6('0x53')]['id'],'UserId':null}})[_0xdfc6('0x20')](handleEntityNotFound(_0x15a6e3,null))[_0xdfc6('0x20')](saveUpdates(_0x32a67a[_0xdfc6('0x57')],null))[_0xdfc6('0x20')](function(_0x1150e2){if(_0x1150e2){_0x38a9b1[_0xdfc6('0x26')]=_0x1150e2['get']({'plain':!![]});return db[_0xdfc6('0x5f')]['find']({'where':{'id':_0x1150e2[_0xdfc6('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x15a6e3,null))[_0xdfc6('0x20')](function(_0x1cd5e2){if(_0x1cd5e2){return _0x1cd5e2[_0xdfc6('0x34')]({'UserId':_0x32a67a[_0xdfc6('0x57')][_0xdfc6('0x5c')],'read1stAt':_[_0xdfc6('0x61')](_0x1cd5e2[_0xdfc6('0x62')])?moment()[_0xdfc6('0x63')](_0xdfc6('0x5b')):undefined});}return null;})[_0xdfc6('0x20')](function(_0x1e3b5d){if(_0x1e3b5d){_0x38a9b1['interaction']=_0x1e3b5d['get']({'plain':!![]});interaction_log[_0xdfc6('0x21')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x32a67a[_0xdfc6('0x5d')]['id'],_0x32a67a[_0xdfc6('0x5d')][_0xdfc6('0x38')],_0x32a67a[_0xdfc6('0x5d')][_0xdfc6('0x64')],_0x38a9b1[_0xdfc6('0x65')]['id'],_0x32a67a[_0xdfc6('0x57')]?JSON['stringify'](_0x32a67a[_0xdfc6('0x57')]):_0xdfc6('0x66'));return respondWithRpcPromise(_0xdfc6('0x67'),_0xdfc6('0x68'),_0x38a9b1);}return null;})['then'](function(_0x3b8d4c){var _0x5812e1=_0xdfc6('0x69')+_0x3b8d4c['message'][_0xdfc6('0x6a')];return db['sequelize'][_0xdfc6('0x40')](_0x5812e1,{'type':db[_0xdfc6('0x6b')]['QueryTypes'][_0xdfc6('0x6c')],'raw':!![]})['then'](function(_0xdd5d58){return _0xdd5d58;});})[_0xdfc6('0x20')](function(_0x10a9fd){if(_0x10a9fd){_0x38a9b1[_0xdfc6('0x26')]['contact']=_0x10a9fd[0x0];if(!_0x32a67a[_0xdfc6('0x57')][_0xdfc6('0x5c')])return;return db[_0xdfc6('0x6d')]['find']({'where':{'id':_0x32a67a[_0xdfc6('0x57')][_0xdfc6('0x5c')],'role':_0xdfc6('0x5e')},'attributes':['id',_0xdfc6('0x38'),'fullname',_0xdfc6('0x6e'),_0xdfc6('0x6f')],'raw':!![]});}return null;})[_0xdfc6('0x20')](function(_0x29233b){if(!_0x29233b)return null;_0x38a9b1[_0xdfc6('0x26')][_0xdfc6('0x5e')]=_0x29233b;return _0x38a9b1;})[_0xdfc6('0x20')](function(_0x4a5438){if(_0x4a5438){if(_0x32a67a[_0xdfc6('0x57')]['manual']){_0x38a9b1[_0xdfc6('0x26')][_0xdfc6('0x70')]=util[_0xdfc6('0x63')](_0xdfc6('0x71'),_0x32a67a[_0xdfc6('0x5d')][_0xdfc6('0x38')]);_0x38a9b1[_0xdfc6('0x26')][_0xdfc6('0x72')]=_0x38a9b1['channel'];_0x38a9b1['message'][_0xdfc6('0x73')]=_0x38a9b1[_0xdfc6('0x72')];_0x38a9b1[_0xdfc6('0x26')][_0xdfc6('0x74')]=_0xdfc6('0x5a');return respondWithRpcPromise('EventManager',_0xdfc6('0x75'),{'event':_0xdfc6('0x76'),'message':_0x38a9b1[_0xdfc6('0x26')]},client9002)[_0xdfc6('0x20')](function(){return _0x38a9b1;});}return _0x38a9b1;}return null;})[_0xdfc6('0x20')](respondWithResult(_0x15a6e3,null))[_0xdfc6('0x28')](handleError(_0x15a6e3,null));};var interaction_log=require(_0xdfc6('0x14'))(_0xdfc6('0x59'));exports[_0xdfc6('0x32')]=function(_0x33e8ba,_0x3a6de9,_0x1c822e){var _0x90dd1d={'agent':{},'channel':_0xdfc6('0x77')};if(_0x33e8ba[_0xdfc6('0x57')]['id']){delete _0x33e8ba['body']['id'];}_0x33e8ba[_0xdfc6('0x57')][_0xdfc6('0x5c')]=_0x33e8ba[_0xdfc6('0x57')][_0xdfc6('0x5c')]||_0x33e8ba[_0xdfc6('0x5d')]['id'];_0x90dd1d[_0xdfc6('0x5e')]['id']=_0x33e8ba['body'][_0xdfc6('0x5c')];return db[_0xdfc6('0x3b')][_0xdfc6('0x56')]({'where':{'id':_0x33e8ba[_0xdfc6('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a6de9,null))[_0xdfc6('0x20')](function(_0x49c21c){if(_0x49c21c){_0x90dd1d[_0xdfc6('0x26')]=_0x49c21c[_0xdfc6('0x78')]({'plain':!![]});return db['FaxInteraction'][_0xdfc6('0x56')]({'where':{'id':_0x49c21c[_0xdfc6('0x60')]}});}return null;})[_0xdfc6('0x20')](handleEntityNotFound(_0x3a6de9,null))[_0xdfc6('0x20')](function(_0x22b9a7){if(_0x22b9a7){_0x90dd1d[_0xdfc6('0x65')]=_0x22b9a7[_0xdfc6('0x78')]({'plain':!![]});interaction_log['info'](_0xdfc6('0x79'),_0x33e8ba[_0xdfc6('0x5d')]['id'],_0x33e8ba['user'][_0xdfc6('0x38')],_0x33e8ba[_0xdfc6('0x5d')][_0xdfc6('0x64')],_0x90dd1d['interaction']['id'],_0x33e8ba['body']?JSON[_0xdfc6('0x7a')](_0x33e8ba['body']):_0xdfc6('0x66'));return respondWithRpcPromise(_0xdfc6('0x7b'),_0xdfc6('0x7c'),_0x90dd1d);}return null;})['then'](function(_0x4dc6dc){var _0x157d45=_0xdfc6('0x69')+_0x4dc6dc[_0xdfc6('0x26')][_0xdfc6('0x6a')];return db['sequelize'][_0xdfc6('0x40')](_0x157d45,{'type':db[_0xdfc6('0x6b')][_0xdfc6('0x7d')][_0xdfc6('0x6c')],'raw':!![]})['then'](function(_0x49b49d){return _0x49b49d;});})['then'](function(_0x501f76){if(_0x501f76){_0x90dd1d[_0xdfc6('0x26')][_0xdfc6('0x7e')]=_0x501f76[0x0];if(!_0x33e8ba[_0xdfc6('0x57')][_0xdfc6('0x5c')])return;return db['User'][_0xdfc6('0x56')]({'where':{'id':_0x33e8ba[_0xdfc6('0x57')][_0xdfc6('0x5c')],'role':_0xdfc6('0x5e')},'attributes':['id',_0xdfc6('0x38'),_0xdfc6('0x7f'),_0xdfc6('0x6e'),_0xdfc6('0x6f')],'raw':!![]});}return null;})['then'](function(_0x3c557a){if(!_0x3c557a)return null;_0x90dd1d[_0xdfc6('0x26')]['agent']=_0x3c557a;return _0x90dd1d;})[_0xdfc6('0x20')](function(_0x568c8c){if(_0x568c8c){_0x568c8c[_0xdfc6('0x26')][_0xdfc6('0x70')]=util[_0xdfc6('0x63')]('SIP/%s',_0x33e8ba[_0xdfc6('0x5d')]['name']);_0x568c8c[_0xdfc6('0x26')][_0xdfc6('0x72')]=_0x90dd1d[_0xdfc6('0x72')];_0x568c8c[_0xdfc6('0x26')]['motionChannel']=_0x90dd1d[_0xdfc6('0x72')];_0x568c8c[_0xdfc6('0x26')][_0xdfc6('0x74')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x568c8c['message']},client9002);return _0x90dd1d;}return null;})[_0xdfc6('0x20')](respondWithResult(_0x3a6de9,null))[_0xdfc6('0x28')](handleError(_0x3a6de9,null));};exports[_0xdfc6('0x80')]=function(_0x12c7bb,_0x2d9d8a){var _0x557f87;return db[_0xdfc6('0x3b')][_0xdfc6('0x80')](_0x12c7bb['body'],{})[_0xdfc6('0x20')](function(_0x179205){_0x557f87=_0x179205;return db[_0xdfc6('0x81')][_0xdfc6('0x82')]({'where':{'id':_0x557f87['ContactId']}});})['then'](function(_0x37497a){if(_[_0xdfc6('0x61')](_0x37497a)){return;}else{_0x557f87['fax']=_0x37497a['fax'];return db['Attachment'][_0xdfc6('0x82')]({'where':{'id':_0x557f87[_0xdfc6('0x83')]}});}})[_0xdfc6('0x20')](function(_0x16a215){return respondWithRpcPromise(_0xdfc6('0x84'),'SendFax',{'FaxAccountId':_[_0xdfc6('0x61')](_0x12c7bb['body'])?undefined:_0x12c7bb[_0xdfc6('0x57')]['FaxAccountId'],'path':_['isNil'](_0x16a215)?undefined:util[_0xdfc6('0x63')](_0xdfc6('0x85'),_0x16a215[_0xdfc6('0x86')]),'fax':_[_0xdfc6('0x61')](_0x557f87[_0xdfc6('0x77')])?undefined:_0x557f87[_0xdfc6('0x77')],'AttachmentId':_0x557f87[_0xdfc6('0x83')]},client9002);})[_0xdfc6('0x20')](respondWithResult(_0x2d9d8a,0xc9))[_0xdfc6('0x28')](handleError(_0x2d9d8a,null));};exports['download']=function(_0x51f61c,_0x41e49f){var _0x4b8964=path[_0xdfc6('0x87')](config[_0xdfc6('0x88')],'server',_0xdfc6('0x89'),_0xdfc6('0x8a'));return db['FaxMessage'][_0xdfc6('0x56')]({'where':{'id':_0x51f61c[_0xdfc6('0x53')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0xdfc6('0x20')](handleEntityNotFound(_0x41e49f,null))[_0xdfc6('0x20')](function(_0x152ffb){if(_0x152ffb){return _0x41e49f[_0xdfc6('0x8b')](path[_0xdfc6('0x87')](_0x4b8964,_0x152ffb['Attachment'][_0xdfc6('0x86')]));}})['catch'](handleError(_0x41e49f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 7f24d13..141a2d4 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 _0xda19=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','save'];(function(_0x299089,_0x3cff81){var _0x11c91f=function(_0x3e135b){while(--_0x3e135b){_0x299089['push'](_0x299089['shift']());}};_0x11c91f(++_0x3cff81);}(_0xda19,0xd5));var _0x9da1=function(_0x28ccc5,_0x29e30b){_0x28ccc5=_0x28ccc5-0x0;var _0x1c0237=_0xda19[_0x28ccc5];return _0x1c0237;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x9da1('0x0'))['db'][_0x9da1('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9da1('0x2'),'afterUpdate':'update','afterDestroy':_0x9da1('0x3')};function emitEvent(_0x4c9c86){return function(_0x2a77c7,_0xef6f5a,_0x3c5f54){FaxMessageEvents[_0x9da1('0x4')](_0x4c9c86+':'+_0x2a77c7['id'],_0x2a77c7);FaxMessageEvents[_0x9da1('0x4')](_0x4c9c86,_0x2a77c7);_0x3c5f54(null);};}for(var e in events){if(events[_0x9da1('0x5')](e)){var event=events[e];FaxMessage[_0x9da1('0x6')](e,emitEvent(event));}}module[_0x9da1('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x9c63=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit'];(function(_0x3161f4,_0x8e7b45){var _0x1b2b59=function(_0x2adbfd){while(--_0x2adbfd){_0x3161f4['push'](_0x3161f4['shift']());}};_0x1b2b59(++_0x8e7b45);}(_0x9c63,0x1a7));var _0x39c6=function(_0x4703bb,_0x3d9f7d){_0x4703bb=_0x4703bb-0x0;var _0x2e8096=_0x9c63[_0x4703bb];return _0x2e8096;};'use strict';var EventEmitter=require(_0x39c6('0x0'));var FaxMessage=require(_0x39c6('0x1'))['db'][_0x39c6('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x39c6('0x3')](0x0);var events={'afterCreate':_0x39c6('0x4'),'afterUpdate':'update','afterDestroy':_0x39c6('0x5')};function emitEvent(_0x3061bc){return function(_0x521670,_0x59c413,_0x562c8f){FaxMessageEvents[_0x39c6('0x6')](_0x3061bc+':'+_0x521670['id'],_0x521670);FaxMessageEvents[_0x39c6('0x6')](_0x3061bc,_0x521670);_0x562c8f(null);};}for(var e in events){if(events[_0x39c6('0x7')](e)){var event=events[e];FaxMessage[_0x39c6('0x8')](e,emitEvent(event));}}module[_0x39c6('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 4f97a1e..4509de5 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 _0x193b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','update','catch','utf8mb4_unicode_ci'];(function(_0x2d1af2,_0x88458f){var _0x4db14e=function(_0x2f61ce){while(--_0x2f61ce){_0x2d1af2['push'](_0x2d1af2['shift']());}};_0x4db14e(++_0x88458f);}(_0x193b,0x1ed));var _0xb193=function(_0x3c3982,_0x163010){_0x3c3982=_0x3c3982-0x0;var _0x66448f=_0x193b[_0x3c3982];return _0x66448f;};'use strict';var _=require(_0xb193('0x0'));var util=require(_0xb193('0x1'));var logger=require(_0xb193('0x2'))(_0xb193('0x3'));var moment=require(_0xb193('0x4'));var BPromise=require(_0xb193('0x5'));var rp=require(_0xb193('0x6'));var fs=require('fs');var path=require(_0xb193('0x7'));var rimraf=require(_0xb193('0x8'));var config=require(_0xb193('0x9'));var attributes=require(_0xb193('0xa'));module[_0xb193('0xb')]=function(_0xceb273,_0x450855){return _0xceb273['define'](_0xb193('0xc'),attributes,{'tableName':_0xb193('0xd'),'paranoid':![],'indexes':[{'name':_0xb193('0xe'),'fields':[_0xb193('0xf')],'type':_0xb193('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b9f8c,_0x4d76df,_0x25c5b0){var _0x5b654e=_0xceb273[_0xb193('0x11')];var _0x4cb810=_0x2b9f8c[_0xb193('0x12')]({'plain':!![]});if(_0x4cb810[_0xb193('0x13')][_0xb193('0x14')]()==='in'||_0x4cb810[_0xb193('0x13')][_0xb193('0x14')]()===_0xb193('0x15')&&!_0x4cb810[_0xb193('0x16')]&&!_['isNil'](_0x4cb810[_0xb193('0x17')])){_0x5b654e[_0xb193('0x18')][_0xb193('0x19')]({'where':{'id':_0x4cb810['FaxInteractionId']}})['then'](function(_0x4f7d2f){if(_0x4f7d2f){_0x4f7d2f[_0xb193('0x1a')]({'lastMsgAt':_0x4cb810['createdAt'],'lastMsgDirection':_0x4cb810[_0xb193('0x13')][_0xb193('0x14')]()});}})[_0xb193('0x1b')](function(_0x1abcec){console['error'](_0x1abcec);});}_0x25c5b0();}},'charset':'utf8mb4','collate':_0xb193('0x1c')});}; \ No newline at end of file +var _0x84f9=['FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','path','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0x84f9,0xa8));var _0x984f=function(_0xd094df,_0x4c06ca){_0xd094df=_0xd094df-0x0;var _0x270fb5=_0x84f9[_0xd094df];return _0x270fb5;};'use strict';var _=require('lodash');var util=require(_0x984f('0x0'));var logger=require(_0x984f('0x1'))('api');var moment=require(_0x984f('0x2'));var BPromise=require('bluebird');var rp=require(_0x984f('0x3'));var fs=require('fs');var path=require(_0x984f('0x4'));var rimraf=require('rimraf');var config=require(_0x984f('0x5'));var attributes=require(_0x984f('0x6'));module['exports']=function(_0x5dfd52,_0x39226c){return _0x5dfd52[_0x984f('0x7')](_0x984f('0x8'),attributes,{'tableName':_0x984f('0x9'),'paranoid':![],'indexes':[{'name':_0x984f('0xa'),'fields':[_0x984f('0xb')],'type':_0x984f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e208b,_0x266721,_0x5814a2){var _0x2f9284=_0x5dfd52[_0x984f('0xd')];var _0x1bc5ac=_0x4e208b[_0x984f('0xe')]({'plain':!![]});if(_0x1bc5ac[_0x984f('0xf')][_0x984f('0x10')]()==='in'||_0x1bc5ac[_0x984f('0xf')][_0x984f('0x10')]()===_0x984f('0x11')&&!_0x1bc5ac[_0x984f('0x12')]&&!_[_0x984f('0x13')](_0x1bc5ac[_0x984f('0x14')])){_0x2f9284[_0x984f('0x15')][_0x984f('0x16')]({'where':{'id':_0x1bc5ac['FaxInteractionId']}})[_0x984f('0x17')](function(_0x5821cf){if(_0x5821cf){_0x5821cf[_0x984f('0x18')]({'lastMsgAt':_0x1bc5ac[_0x984f('0x19')],'lastMsgDirection':_0x1bc5ac[_0x984f('0xf')][_0x984f('0x10')]()});}})[_0x984f('0x1a')](function(_0x51a463){console[_0x984f('0x1b')](_0x51a463);});}_0x5814a2();}},'charset':_0x984f('0x1c'),'collate':_0x984f('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 50af4dc..49a564a 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 _0x9957=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','body','options','raw','CreateFaxMessage','catch','UpdateFaxMessage','FaxMessage','where','attributes','lodash'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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});config[_0x7995('0xc')]=_[_0x7995('0xd')](config['redis'],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require(_0x7995('0xf'))(new Redis(config['redis']));require(_0x7995('0x10'))[_0x7995('0x11')](socket);function respondWithRpcPromise(_0x18c8a3,_0x35b5fe,_0x3c1d19){return new BPromise(function(_0x1e400a,_0x341672){return client['request'](_0x18c8a3,_0x3c1d19)[_0x7995('0x12')](function(_0x41c652){logger['info'](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));logger[_0x7995('0x15')](_0x7995('0x16'),_0x35b5fe,_0x7995('0x14'),JSON[_0x7995('0x17')](_0x41c652));if(_0x41c652[_0x7995('0x18')]){if(_0x41c652['error']['code']===0x1f4){logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);return _0x341672(_0x41c652[_0x7995('0x18')][_0x7995('0x19')]);}logger[_0x7995('0x18')](_0x7995('0x13'),_0x35b5fe,_0x41c652['error'][_0x7995('0x19')]);return _0x1e400a(_0x41c652['error'][_0x7995('0x19')]);}else{logger[_0x7995('0x1a')](_0x7995('0x13'),_0x35b5fe,_0x7995('0x14'));_0x1e400a(_0x41c652[_0x7995('0x1b')][_0x7995('0x19')]);}})['catch'](function(_0x54c9ae){logger[_0x7995('0x18')]('FaxMessage,\x20%s,\x20%s',_0x35b5fe,_0x54c9ae);_0x341672(_0x54c9ae);});});}exports['CreateFaxMessage']=function(_0x3ec178){var _0x3d463e=this;return new Promise(function(_0x4cbe10,_0x3a9b54){return db['FaxMessage']['create'](_0x3ec178[_0x7995('0x1c')],{'raw':_0x3ec178[_0x7995('0x1d')]?_0x3ec178[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![]})[_0x7995('0x12')](function(_0x1c278a){logger['info'](_0x7995('0x1f'),_0x3ec178);logger[_0x7995('0x15')](_0x7995('0x1f'),_0x3ec178,JSON[_0x7995('0x17')](_0x1c278a));_0x4cbe10(_0x1c278a);})[_0x7995('0x20')](function(_0x13bc35){logger[_0x7995('0x18')](_0x7995('0x1f'),_0x13bc35['message'],_0x3ec178);_0x3a9b54(_0x3d463e[_0x7995('0x18')](0x1f4,_0x13bc35[_0x7995('0x19')]));});});};exports[_0x7995('0x21')]=function(_0x268ce7){var _0x3a3fcf=this;return new Promise(function(_0x2a307e,_0x56691a){return db[_0x7995('0x22')]['update'](_0x268ce7[_0x7995('0x1c')],{'raw':_0x268ce7[_0x7995('0x1d')]?_0x268ce7[_0x7995('0x1d')][_0x7995('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options'][_0x7995('0x23')]||null:null,'attributes':_0x268ce7['options']?_0x268ce7[_0x7995('0x1d')][_0x7995('0x24')]||null:null,'limit':_0x268ce7[_0x7995('0x1d')]?_0x268ce7['options']['limit']||null:null})['then'](function(_0x3573be){logger[_0x7995('0x1a')](_0x7995('0x21'),_0x268ce7);logger[_0x7995('0x15')](_0x7995('0x21'),_0x268ce7,JSON[_0x7995('0x17')](_0x3573be));_0x2a307e(_0x3573be);})['catch'](function(_0x481c74){logger[_0x7995('0x18')]('UpdateFaxMessage',_0x481c74[_0x7995('0x19')],_0x268ce7);_0x56691a(_0x3a3fcf[_0x7995('0x18')](0x1f4,_0x481c74[_0x7995('0x19')]));});});}; \ No newline at end of file +var _0xb821=['register','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','FaxMessage','update','where','attributes','limit','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0xcd4ff6,_0x22aa9e){var _0x4eaed2=function(_0xbe2451){while(--_0xbe2451){_0xcd4ff6['push'](_0xcd4ff6['shift']());}};_0x4eaed2(++_0x22aa9e);}(_0xb821,0xa7));var _0x1b82=function(_0x1094be,_0x672589){_0x1094be=_0x1094be-0x0;var _0x481e51=_0xb821[_0x1094be];return _0x481e51;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});config[_0x1b82('0x8')]=_[_0x1b82('0x9')](config[_0x1b82('0x8')],{'host':_0x1b82('0xa'),'port':0x18eb});var socket=require(_0x1b82('0xb'))(new Redis(config[_0x1b82('0x8')]));require(_0x1b82('0xc'))[_0x1b82('0xd')](socket);function respondWithRpcPromise(_0x4955b5,_0x4011f2,_0x30c6ee){return new BPromise(function(_0x44dfd4,_0x14c57a){return client[_0x1b82('0xe')](_0x4955b5,_0x30c6ee)[_0x1b82('0xf')](function(_0x739f99){logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1b82('0x11'));logger[_0x1b82('0x12')](_0x1b82('0x13'),_0x4011f2,_0x1b82('0x11'),JSON['stringify'](_0x739f99));if(_0x739f99[_0x1b82('0x14')]){if(_0x739f99['error']['code']===0x1f4){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);return _0x14c57a(_0x739f99['error'][_0x1b82('0x15')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x739f99[_0x1b82('0x14')]['message']);return _0x44dfd4(_0x739f99[_0x1b82('0x14')][_0x1b82('0x15')]);}else{logger[_0x1b82('0x10')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,'request\x20sent');_0x44dfd4(_0x739f99[_0x1b82('0x16')]['message']);}})[_0x1b82('0x17')](function(_0x1002a1){logger[_0x1b82('0x14')]('FaxMessage,\x20%s,\x20%s',_0x4011f2,_0x1002a1);_0x14c57a(_0x1002a1);});});}exports[_0x1b82('0x18')]=function(_0x2b6ee8){var _0x11af50=this;return new Promise(function(_0x46e5e2,_0x10d45c){return db['FaxMessage'][_0x1b82('0x19')](_0x2b6ee8[_0x1b82('0x1a')],{'raw':_0x2b6ee8[_0x1b82('0x1b')]?_0x2b6ee8[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![]})[_0x1b82('0xf')](function(_0x2d07f4){logger['info'](_0x1b82('0x18'),_0x2b6ee8);logger[_0x1b82('0x12')]('CreateFaxMessage',_0x2b6ee8,JSON[_0x1b82('0x1d')](_0x2d07f4));_0x46e5e2(_0x2d07f4);})[_0x1b82('0x17')](function(_0x1ad9d6){logger['error'](_0x1b82('0x18'),_0x1ad9d6['message'],_0x2b6ee8);_0x10d45c(_0x11af50['error'](0x1f4,_0x1ad9d6['message']));});});};exports[_0x1b82('0x1e')]=function(_0x149d0f){var _0xfd00d1=this;return new Promise(function(_0x257b79,_0x548a3b){return db[_0x1b82('0x1f')][_0x1b82('0x20')](_0x149d0f[_0x1b82('0x1a')],{'raw':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x21')]||null:null,'attributes':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f[_0x1b82('0x1b')][_0x1b82('0x22')]||null:null,'limit':_0x149d0f[_0x1b82('0x1b')]?_0x149d0f['options'][_0x1b82('0x23')]||null:null})[_0x1b82('0xf')](function(_0x155a34){logger[_0x1b82('0x10')](_0x1b82('0x1e'),_0x149d0f);logger[_0x1b82('0x12')](_0x1b82('0x1e'),_0x149d0f,JSON[_0x1b82('0x1d')](_0x155a34));_0x257b79(_0x155a34);})[_0x1b82('0x17')](function(_0x362657){logger['error'](_0x1b82('0x1e'),_0x362657[_0x1b82('0x15')],_0x149d0f);_0x548a3b(_0xfd00d1[_0x1b82('0x14')](0x1f4,_0x362657[_0x1b82('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index cb3eacf..51c73db 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 _0x7ee7=['faxMessage:','./faxMessage.events','save','remove','update','removeListener','register'];(function(_0x115d99,_0xffb2e9){var _0x5b036f=function(_0x5bcafe){while(--_0x5bcafe){_0x115d99['push'](_0x115d99['shift']());}};_0x5b036f(++_0xffb2e9);}(_0x7ee7,0x1eb));var _0x77ee=function(_0xfb8ce8,_0x4f11b1){_0xfb8ce8=_0xfb8ce8-0x0;var _0x2e6f8c=_0x7ee7[_0xfb8ce8];return _0x2e6f8c;};'use strict';var FaxMessageEvents=require(_0x77ee('0x0'));var events=[_0x77ee('0x1'),_0x77ee('0x2'),_0x77ee('0x3')];function createListener(_0x73dad4,_0x42b29c){return function(_0xe73ee){_0x42b29c['emit'](_0x73dad4,_0xe73ee);};}function removeListener(_0x4a543a,_0x255713){return function(){FaxMessageEvents[_0x77ee('0x4')](_0x4a543a,_0x255713);};}exports[_0x77ee('0x5')]=function(_0x17e24f){for(var _0x24905e=0x0,_0x32bc0c=events['length'];_0x24905e<_0x32bc0c;_0x24905e++){var _0x3dd45c=events[_0x24905e];var _0x5abaaf=createListener(_0x77ee('0x6')+_0x3dd45c,_0x17e24f);FaxMessageEvents['on'](_0x3dd45c,_0x5abaaf);}}; \ No newline at end of file +var _0xb603=['update','removeListener','length','remove'];(function(_0x23c93a,_0x5e4468){var _0x29698e=function(_0x3e534c){while(--_0x3e534c){_0x23c93a['push'](_0x23c93a['shift']());}};_0x29698e(++_0x5e4468);}(_0xb603,0x1ab));var _0x3b60=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xb603[_0x2642cb];return _0xe6e41;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x3b60('0x0'),_0x3b60('0x1')];function createListener(_0x3ea5fc,_0x4c44a7){return function(_0x5a322b){_0x4c44a7['emit'](_0x3ea5fc,_0x5a322b);};}function removeListener(_0x423fce,_0x4a93c5){return function(){FaxMessageEvents[_0x3b60('0x2')](_0x423fce,_0x4a93c5);};}exports['register']=function(_0x250cb9){for(var _0x137d61=0x0,_0x629143=events[_0x3b60('0x3')];_0x137d61<_0x629143;_0x137d61++){var _0x350103=events[_0x137d61];var _0x4b0218=createListener('faxMessage:'+_0x350103,_0x250cb9);FaxMessageEvents['on'](_0x350103,_0x4b0218);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3999e88..f771ff9 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 _0xb43b=['update','/:id/reject','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','/describe','isAuthenticated','describe','get','/:id','show','download','post','tracked','fax','create','put'];(function(_0xd4c5c7,_0x56d388){var _0x42f83e=function(_0x5dc5d6){while(--_0x5dc5d6){_0xd4c5c7['push'](_0xd4c5c7['shift']());}};_0x42f83e(++_0x56d388);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4a3a62,_0x40c9e8){_0x4a3a62=_0x4a3a62-0x0;var _0x43f86e=_0xb43b[_0x4a3a62];return _0x43f86e;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0xd')]('/:id/download',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')]('/',auth[_0xbb43('0xb')](),interaction[_0xbb43('0x12')](_0xbb43('0x13'),'faxmessage:create'),controller[_0xbb43('0x14')]);router[_0xbb43('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0x16')]);router['put']('/:id/accept',auth[_0xbb43('0xb')](),controller['accept']);router[_0xbb43('0x15')](_0xbb43('0x17'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','faxmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','express','Router'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe706,0xa3));var _0x6e70=function(_0xac3aa1,_0x2c961f){_0xac3aa1=_0xac3aa1-0x0;var _0x9f98bc=_0xe706[_0xac3aa1];return _0x9f98bc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),interaction['tracked']('fax',_0x6e70('0x14')),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')](_0x6e70('0x18'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x6e70('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x6e70('0x1a')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 5b52689..1b2a20c 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 _0xfef9=['INTEGER','sequelize','exports','name','STRING','ENUM','beepall'];(function(_0xca867b,_0x489f66){var _0x4c9b1b=function(_0x1bd9f6){while(--_0x1bd9f6){_0xca867b['push'](_0xca867b['shift']());}};_0x4c9b1b(++_0x489f66);}(_0xfef9,0xd3));var _0x9fef=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xfef9[_0x2d8f6c];return _0x3a00f6;};'use strict';var Sequelize=require(_0x9fef('0x0'));module[_0x9fef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9fef('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9fef('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9fef('0x4')]('rrmemory',_0x9fef('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x9fef('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3823=['roundrobin','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x1e416c,_0x14dec2){var _0x2cab82=function(_0x30c6cf){while(--_0x30c6cf){_0x1e416c['push'](_0x1e416c['shift']());}};_0x2cab82(++_0x14dec2);}(_0x3823,0xb0));var _0x3382=function(_0xcc02e0,_0x28bd47){_0xcc02e0=_0xcc02e0-0x0;var _0x3fea50=_0x3823[_0xcc02e0];return _0x3fea50;};'use strict';var Sequelize=require('sequelize');module[_0x3382('0x0')]={'name':{'type':Sequelize[_0x3382('0x1')],'unique':_0x3382('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3382('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3382('0x4'),_0x3382('0x5'),_0x3382('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3382('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 9f3f580..0cfd39c 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 _0xadbf=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','FaxQueue','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserFaxQueue','hasOwnProperty','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','findOne','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','isArray','getAgents','eml-format','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','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','get','FaxQueues','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1bf5b1,_0x596843){var _0x29eb1e=function(_0x468df5){while(--_0x468df5){_0x1bf5b1['push'](_0x1bf5b1['shift']());}};_0x29eb1e(++_0x596843);}(_0xadbf,0x1f3));var _0xfadb=function(_0x4116dc,_0x178c21){_0x4116dc=_0x4116dc-0x0;var _0x1db20c=_0xadbf[_0x4116dc];return _0x1db20c;};'use strict';var emlformat=require(_0xfadb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfadb('0x1'));var rp=require(_0xfadb('0x2'));var moment=require(_0xfadb('0x3'));var BPromise=require(_0xfadb('0x4'));var Mustache=require(_0xfadb('0x5'));var util=require('util');var path=require(_0xfadb('0x6'));var sox=require(_0xfadb('0x7'));var csv=require(_0xfadb('0x8'));var ejs=require(_0xfadb('0x9'));var fs=require('fs');var fs_extra=require(_0xfadb('0xa'));var _=require(_0xfadb('0xb'));var squel=require(_0xfadb('0xc'));var crypto=require(_0xfadb('0xd'));var jsforce=require(_0xfadb('0xe'));var deskjs=require(_0xfadb('0xf'));var toCsv=require(_0xfadb('0x8'));var querystring=require(_0xfadb('0x10'));var Papa=require(_0xfadb('0x11'));var Redis=require(_0xfadb('0x12'));var authService=require(_0xfadb('0x13'));var qs=require(_0xfadb('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfadb('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xfadb('0x16'));var licenseUtil=require(_0xfadb('0x17'));var db=require(_0xfadb('0x18'))['db'];config[_0xfadb('0x19')]=_[_0xfadb('0x1a')](config[_0xfadb('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xfadb('0x1b'))(new Redis(config[_0xfadb('0x19')]));require(_0xfadb('0x1c'))[_0xfadb('0x1d')](socket);function respondWithStatusCode(_0x5921bd,_0x4ecde5){_0x4ecde5=_0x4ecde5||0xcc;return function(_0x1cea67){if(_0x1cea67){return _0x5921bd[_0xfadb('0x1e')](_0x4ecde5);}return _0x5921bd[_0xfadb('0x1f')](_0x4ecde5)['end']();};}function respondWithResult(_0x282e37,_0x352228){_0x352228=_0x352228||0xc8;return function(_0xee4006){if(_0xee4006){return _0x282e37['status'](_0x352228)['json'](_0xee4006);}};}function respondWithFilteredResult(_0x2481e1,_0x19373f){return function(_0x361200){if(_0x361200){var _0x48584d=typeof _0x19373f['offset']===_0xfadb('0x20')&&typeof _0x19373f[_0xfadb('0x21')]===_0xfadb('0x20');var _0x2bd037=_0x361200[_0xfadb('0x22')];var _0x3bb707=_0x48584d?0x0:_0x19373f[_0xfadb('0x23')];var _0x2ffdc5=_0x48584d?_0x361200[_0xfadb('0x22')]:_0x19373f[_0xfadb('0x23')]+_0x19373f[_0xfadb('0x21')];var _0x161b81;if(_0x2ffdc5>=_0x2bd037){_0x2ffdc5=_0x2bd037;_0x161b81=0xc8;}else{_0x161b81=0xce;}_0x2481e1[_0xfadb('0x1f')](_0x161b81);return _0x2481e1[_0xfadb('0x24')](_0xfadb('0x25'),_0x3bb707+'-'+_0x2ffdc5+'/'+_0x2bd037)[_0xfadb('0x26')](_0x361200);}return null;};}function patchUpdates(_0x41b6d9){return function(_0x1fb21c){try{jsonpatch[_0xfadb('0x27')](_0x1fb21c,_0x41b6d9,!![]);}catch(_0xccbb2c){return BPromise['reject'](_0xccbb2c);}return _0x1fb21c['save']();};}function saveUpdates(_0x488e16,_0x2a7037){return function(_0x27ba64){if(_0x27ba64){return _0x27ba64[_0xfadb('0x28')](_0x488e16)[_0xfadb('0x29')](function(_0x5bbe3c){return _0x5bbe3c;});}return null;};}function removeEntity(_0x4c5b76,_0x3c994b){return function(_0x456b4b){if(_0x456b4b){return _0x456b4b[_0xfadb('0x2a')]()[_0xfadb('0x29')](function(){var _0x3ebb40=_0x456b4b[_0xfadb('0x2b')]({'plain':!![]});var _0x9f5ce2=_0xfadb('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x9f5ce2,'resourceId':_0x3ebb40['id']}})[_0xfadb('0x29')](function(){return _0x456b4b;});})[_0xfadb('0x29')](function(){_0x4c5b76[_0xfadb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x546307,_0x55efec){return function(_0x20cabf){if(!_0x20cabf){_0x546307[_0xfadb('0x1e')](0x194);}return _0x20cabf;};}function handleError(_0x414c75,_0x399983){_0x399983=_0x399983||0x1f4;return function(_0x42f630){logger['error'](_0x42f630[_0xfadb('0x2d')]);if(_0x42f630[_0xfadb('0x2e')]){delete _0x42f630[_0xfadb('0x2e')];}_0x414c75[_0xfadb('0x1f')](_0x399983)[_0xfadb('0x2f')](_0x42f630);};}exports['index']=function(_0xa74596,_0xc095f0){var _0x4a9c1a={},_0xfb3e75={},_0x206d26={'count':0x0,'rows':[]};var _0x25d6da=_[_0xfadb('0x30')](db['FaxQueue'][_0xfadb('0x31')],function(_0x2000bd){return{'name':_0x2000bd[_0xfadb('0x32')],'type':_0x2000bd[_0xfadb('0x33')][_0xfadb('0x34')]};});_0xfb3e75[_0xfadb('0x35')]=_[_0xfadb('0x30')](_0x25d6da,_0xfadb('0x2e'));_0xfb3e75[_0xfadb('0x36')]=_[_0xfadb('0x37')](_0xa74596[_0xfadb('0x36')]);_0xfb3e75[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0xfb3e75[_0xfadb('0x35')],_0xfb3e75[_0xfadb('0x36')]);_0x4a9c1a[_0xfadb('0x3a')]=_['intersection'](_0xfb3e75[_0xfadb('0x35')],qs['fields'](_0xa74596['query'][_0xfadb('0x3b')]));_0x4a9c1a[_0xfadb('0x3a')]=_0x4a9c1a[_0xfadb('0x3a')][_0xfadb('0x3c')]?_0x4a9c1a[_0xfadb('0x3a')]:_0xfb3e75[_0xfadb('0x35')];if(!_0xa74596[_0xfadb('0x36')]['hasOwnProperty'](_0xfadb('0x3d'))){_0x4a9c1a[_0xfadb('0x21')]=qs[_0xfadb('0x21')](_0xa74596[_0xfadb('0x36')][_0xfadb('0x21')]);_0x4a9c1a[_0xfadb('0x23')]=qs[_0xfadb('0x23')](_0xa74596[_0xfadb('0x36')]['offset']);}_0x4a9c1a[_0xfadb('0x3e')]=qs[_0xfadb('0x3f')](_0xa74596['query'][_0xfadb('0x3f')]);_0x4a9c1a[_0xfadb('0x40')]=qs[_0xfadb('0x38')](_[_0xfadb('0x41')](_0xa74596[_0xfadb('0x36')],_0xfb3e75[_0xfadb('0x38')]),_0x25d6da);if(_0xa74596[_0xfadb('0x36')][_0xfadb('0x42')]){_0x4a9c1a[_0xfadb('0x40')]=_[_0xfadb('0x43')](_0x4a9c1a[_0xfadb('0x40')],{'$or':_['map'](_0x25d6da,function(_0x245d15){if(_0x245d15['type']!==_0xfadb('0x44')){var _0xa827b8={};_0xa827b8[_0x245d15['name']]={'$like':'%'+_0xa74596[_0xfadb('0x36')][_0xfadb('0x42')]+'%'};return _0xa827b8;}})});}_0x4a9c1a=_[_0xfadb('0x43')]({},_0x4a9c1a,_0xa74596[_0xfadb('0x45')]);var _0x1ca343={'where':_0x4a9c1a[_0xfadb('0x40')]};return db['FaxQueue']['count'](_0x1ca343)[_0xfadb('0x29')](function(_0x2e0219){_0x206d26[_0xfadb('0x22')]=_0x2e0219;if(_0xa74596[_0xfadb('0x36')][_0xfadb('0x46')]){_0x4a9c1a[_0xfadb('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0xfadb('0x48')](_0x4a9c1a);})['then'](function(_0x414931){_0x206d26[_0xfadb('0x49')]=_0x414931;return _0x206d26;})['then'](respondWithFilteredResult(_0xc095f0,_0x4a9c1a))['catch'](handleError(_0xc095f0,null));};exports[_0xfadb('0x4a')]=function(_0x55af03,_0x35be52){var _0x2139b8={'raw':!![],'where':{'id':_0x55af03[_0xfadb('0x4b')]['id']}},_0x15238a={};_0x15238a[_0xfadb('0x35')]=_[_0xfadb('0x37')](db[_0xfadb('0x4c')][_0xfadb('0x31')]);_0x15238a[_0xfadb('0x36')]=_['keys'](_0x55af03[_0xfadb('0x36')]);_0x15238a[_0xfadb('0x38')]=_['intersection'](_0x15238a[_0xfadb('0x35')],_0x15238a[_0xfadb('0x36')]);_0x2139b8[_0xfadb('0x3a')]=_[_0xfadb('0x39')](_0x15238a['model'],qs['fields'](_0x55af03[_0xfadb('0x36')][_0xfadb('0x3b')]));_0x2139b8[_0xfadb('0x3a')]=_0x2139b8[_0xfadb('0x3a')][_0xfadb('0x3c')]?_0x2139b8[_0xfadb('0x3a')]:_0x15238a[_0xfadb('0x35')];if(_0x55af03[_0xfadb('0x36')][_0xfadb('0x46')]){_0x2139b8['include']=[{'all':!![]}];}_0x2139b8=_[_0xfadb('0x43')]({},_0x2139b8,_0x55af03[_0xfadb('0x45')]);return db[_0xfadb('0x4c')][_0xfadb('0x4d')](_0x2139b8)[_0xfadb('0x29')](handleEntityNotFound(_0x35be52,null))[_0xfadb('0x29')](respondWithResult(_0x35be52,null))[_0xfadb('0x4e')](handleError(_0x35be52,null));};exports[_0xfadb('0x4f')]=function(_0x5f0a72,_0x5ccf40){return db[_0xfadb('0x4c')][_0xfadb('0x4f')](_0x5f0a72[_0xfadb('0x50')],{})[_0xfadb('0x29')](function(_0x416662){var _0x281e33=_0x5f0a72['user'][_0xfadb('0x2b')]({'plain':!![]});if(!_0x281e33)throw new Error(_0xfadb('0x51'));if(_0x281e33[_0xfadb('0x52')]===_0xfadb('0x53')){var _0x42d23f=_0x416662[_0xfadb('0x2b')]({'plain':!![]});var _0x2c0599='FaxQueues';return db[_0xfadb('0x54')][_0xfadb('0x4d')]({'where':{'name':_0x2c0599,'userProfileId':_0x281e33['userProfileId']},'raw':!![]})['then'](function(_0xcffd88){if(_0xcffd88&&_0xcffd88[_0xfadb('0x55')]===0x0){return db['UserProfileResource'][_0xfadb('0x4f')]({'name':_0x42d23f['name'],'resourceId':_0x42d23f['id'],'type':_0xcffd88[_0xfadb('0x2e')],'sectionId':_0xcffd88['id']},{})[_0xfadb('0x29')](function(){return _0x416662;});}else{return _0x416662;}})[_0xfadb('0x4e')](function(_0x1972fe){logger['error'](_0xfadb('0x56'),_0x1972fe);throw _0x1972fe;});}return _0x416662;})[_0xfadb('0x29')](respondWithResult(_0x5ccf40,0xc9))[_0xfadb('0x4e')](handleError(_0x5ccf40,null));};exports[_0xfadb('0x28')]=function(_0x6f96f7,_0x3441ba){if(_0x6f96f7[_0xfadb('0x50')]['id']){delete _0x6f96f7[_0xfadb('0x50')]['id'];}return db['FaxQueue'][_0xfadb('0x4d')]({'where':{'id':_0x6f96f7[_0xfadb('0x4b')]['id']}})[_0xfadb('0x29')](handleEntityNotFound(_0x3441ba,null))[_0xfadb('0x29')](saveUpdates(_0x6f96f7[_0xfadb('0x50')],null))[_0xfadb('0x29')](respondWithResult(_0x3441ba,null))[_0xfadb('0x4e')](handleError(_0x3441ba,null));};exports[_0xfadb('0x2a')]=function(_0x31a70a,_0x4a89c6){return db[_0xfadb('0x4c')][_0xfadb('0x4d')]({'where':{'id':_0x31a70a['params']['id']}})['then'](handleEntityNotFound(_0x4a89c6,null))[_0xfadb('0x29')](removeEntity(_0x4a89c6,null))[_0xfadb('0x4e')](handleError(_0x4a89c6,null));};exports[_0xfadb('0x57')]=function(_0x516d95,_0x3a9410){return db['FaxQueue']['describe']()[_0xfadb('0x29')](respondWithResult(_0x3a9410,null))[_0xfadb('0x4e')](handleError(_0x3a9410,null));};exports['getMembers']=function(_0x479bcd,_0x2bc4c3,_0xcb5660){var _0x27d1e6={'raw':!![],'where':{}},_0x38ca69={},_0x15998f;return db['FaxQueue']['findOne']({'where':{'id':_0x479bcd[_0xfadb('0x4b')]['id']}})[_0xfadb('0x29')](handleEntityNotFound(_0x2bc4c3,null))[_0xfadb('0x29')](function(_0x4adaba){if(_0x4adaba){_0x15998f=_0x4adaba['get']({'plain':!![]});_0x38ca69[_0xfadb('0x35')]=_['keys'](db[_0xfadb('0x58')]['rawAttributes']);_0x38ca69[_0xfadb('0x36')]=_[_0xfadb('0x37')](_0x479bcd['query']);_0x38ca69[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0x38ca69[_0xfadb('0x35')],_0x38ca69[_0xfadb('0x36')]);_0x27d1e6['attributes']=_[_0xfadb('0x39')](_0x38ca69[_0xfadb('0x35')],qs[_0xfadb('0x3b')](_0x479bcd[_0xfadb('0x36')][_0xfadb('0x3b')]));_0x27d1e6['attributes']=_0x27d1e6['attributes'][_0xfadb('0x3c')]?_0x27d1e6[_0xfadb('0x3a')]:_0x38ca69['model'];if(!_0x479bcd['query'][_0xfadb('0x59')](_0xfadb('0x3d'))){_0x27d1e6[_0xfadb('0x21')]=qs[_0xfadb('0x21')](_0x479bcd[_0xfadb('0x36')][_0xfadb('0x21')]);_0x27d1e6['offset']=qs[_0xfadb('0x23')](_0x479bcd[_0xfadb('0x36')][_0xfadb('0x23')]);}_0x27d1e6[_0xfadb('0x3e')]=qs['sort'](_0x479bcd[_0xfadb('0x36')][_0xfadb('0x3f')]);_0x27d1e6[_0xfadb('0x40')]=qs[_0xfadb('0x38')](_[_0xfadb('0x41')](_0x479bcd[_0xfadb('0x36')],_0x38ca69['filters']));_0x27d1e6['where'][_0xfadb('0x5a')]=_0x4adaba['id'];if(_0x479bcd['query']['filter']){_0x27d1e6[_0xfadb('0x40')]=_[_0xfadb('0x43')](_0x27d1e6[_0xfadb('0x40')],{'$or':_['map'](_0x27d1e6[_0xfadb('0x3a')],function(_0x5e504b){var _0x1d7bea={};_0x1d7bea[_0x5e504b]={'$like':'%'+_0x479bcd['query'][_0xfadb('0x42')]+'%'};return _0x1d7bea;})});}_0x27d1e6=_[_0xfadb('0x43')]({},_0x27d1e6,_0x479bcd[_0xfadb('0x45')]);return db[_0xfadb('0x58')]['findAll'](_0x27d1e6);}})[_0xfadb('0x29')](function(_0x53da3a){if(_0x53da3a){return db[_0xfadb('0x5b')][_0xfadb('0x5c')]({'where':{'id':_[_0xfadb('0x30')](_0x53da3a,_0xfadb('0x5d')),'role':_0xfadb('0x5e')},'attributes':['id',_0xfadb('0x2e'),_0xfadb('0x5f'),_0xfadb('0x60'),_0xfadb('0x61')]});}})[_0xfadb('0x29')](function(_0x1fc2db){if(_0x1fc2db){return{'count':_0x1fc2db[_0xfadb('0x22')],'rows':_[_0xfadb('0x30')](_0x1fc2db[_0xfadb('0x49')],function(_0x4f076d){return{'membername':_0x4f076d['name'],'UserId':_0x4f076d['id'],'queue_name':_0x15998f[_0xfadb('0x2e')],'FaxQueueId':_0x15998f['id'],'interface':util['format'](_0xfadb('0x62'),_0xfadb('0x63'),_0x4f076d[_0xfadb('0x2e')]),'penalty':0x0,'paused':_0x4f076d[_0xfadb('0x5f')],'createdAt':_0x4f076d[_0xfadb('0x61')],'updatedAt':_0x4f076d[_0xfadb('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfadb('0x29')](respondWithFilteredResult(_0x2bc4c3,_0x27d1e6))[_0xfadb('0x4e')](handleError(_0x2bc4c3,null));};exports['getTeams']=function(_0x20a7d9,_0xb023ef,_0x1a9cb7){var _0x16b8d4={};var _0x541e30={};var _0xe73062;var _0x270776;return db[_0xfadb('0x4c')][_0xfadb('0x64')]({'where':{'id':_0x20a7d9[_0xfadb('0x4b')]['id']}})[_0xfadb('0x29')](handleEntityNotFound(_0xb023ef,null))['then'](function(_0x29f4ba){if(_0x29f4ba){_0xe73062=_0x29f4ba;_0x541e30['model']=_[_0xfadb('0x37')](db['Team']['rawAttributes']);_0x541e30[_0xfadb('0x36')]=_[_0xfadb('0x37')](_0x20a7d9['query']);_0x541e30[_0xfadb('0x38')]=_['intersection'](_0x541e30[_0xfadb('0x35')],_0x541e30['query']);_0x16b8d4[_0xfadb('0x3a')]=_[_0xfadb('0x39')](_0x541e30['model'],qs[_0xfadb('0x3b')](_0x20a7d9[_0xfadb('0x36')]['fields']));_0x16b8d4[_0xfadb('0x3a')]=_0x16b8d4[_0xfadb('0x3a')][_0xfadb('0x3c')]?_0x16b8d4['attributes']:_0x541e30[_0xfadb('0x35')];_0x16b8d4[_0xfadb('0x3e')]=qs[_0xfadb('0x3f')](_0x20a7d9[_0xfadb('0x36')]['sort']);_0x16b8d4[_0xfadb('0x40')]=qs[_0xfadb('0x38')](_['pick'](_0x20a7d9['query'],_0x541e30[_0xfadb('0x38')]));if(_0x20a7d9['query']['filter']){_0x16b8d4[_0xfadb('0x40')]=_[_0xfadb('0x43')](_0x16b8d4['where'],{'$or':_[_0xfadb('0x30')](_0x16b8d4[_0xfadb('0x3a')],function(_0x98e6aa){var _0x32ba6a={};_0x32ba6a[_0x98e6aa]={'$like':'%'+_0x20a7d9['query']['filter']+'%'};return _0x32ba6a;})});}_0x16b8d4=_[_0xfadb('0x43')]({},_0x16b8d4,_0x20a7d9[_0xfadb('0x45')]);return _0xe73062[_0xfadb('0x65')](_0x16b8d4);}})[_0xfadb('0x29')](function(_0x5d19fc){if(_0x5d19fc){_0x270776=_0x5d19fc['length'];if(!_0x20a7d9[_0xfadb('0x36')][_0xfadb('0x59')](_0xfadb('0x3d'))){_0x16b8d4[_0xfadb('0x21')]=qs[_0xfadb('0x21')](_0x20a7d9[_0xfadb('0x36')]['limit']);_0x16b8d4[_0xfadb('0x23')]=qs[_0xfadb('0x23')](_0x20a7d9[_0xfadb('0x36')]['offset']);}return _0xe73062['getTeams'](_0x16b8d4);}})['then'](function(_0x2cf9ed){if(_0x2cf9ed){return _0x2cf9ed?{'count':_0x270776,'rows':_0x2cf9ed}:null;}})[_0xfadb('0x29')](respondWithResult(_0xb023ef,null))['catch'](handleError(_0xb023ef,null));};exports[_0xfadb('0x66')]=function(_0x440f67,_0x26643a,_0x4f9cbd){var _0x23ca31=_0x440f67[_0xfadb('0x50')][_0xfadb('0x67')];return db[_0xfadb('0x68')]['findAll']({'where':{'id':_0x23ca31},'attributes':['id'],'include':[{'model':db[_0xfadb('0x5b')],'as':_0xfadb('0x69'),'attributes':['id',_0xfadb('0x2e'),_0xfadb('0x6a'),_0xfadb('0x6b'),_0xfadb('0x6c')],'raw':!![]}]})[_0xfadb('0x29')](function(_0x549a9f){if(_0x549a9f){var _0x1bbce9=_[_0xfadb('0x6d')](_0x549a9f,function(_0x3522c1){var _0x3b4c3e=_0x3522c1[_0xfadb('0x2b')]({'plain':!![]});return _0x3b4c3e[_0xfadb('0x69')];});return db['FaxQueue'][_0xfadb('0x4d')]({'where':{'id':_0x440f67['params']['id']}})[_0xfadb('0x29')](function(_0x9dba39){return db[_0xfadb('0x6e')][_0xfadb('0x6f')](function(_0x2cb9ac){return _0x9dba39['addTeams'](_0x23ca31,{'transaction':_0x2cb9ac})['then'](function(){return BPromise[_0xfadb('0x70')](_0x1bbce9,function(_0x1d14b9){return db['UserFaxQueue'][_0xfadb('0x71')]({'where':{'UserId':_0x1d14b9['id'],'FaxQueueId':_0x440f67[_0xfadb('0x4b')]['id']},'transaction':_0x2cb9ac});});})['then'](function(){_0x1bbce9[_0xfadb('0x72')](function(_0x390ee7){socket[_0xfadb('0x73')](_0xfadb('0x74'),{'UserId':_0x390ee7['id'],'FaxQueueId':_0x9dba39['id']});});});});});}})[_0xfadb('0x29')](respondWithStatusCode(_0x26643a,null))[_0xfadb('0x4e')](handleError(_0x26643a,null));};exports['removeTeams']=function(_0x219c20,_0x322edd,_0x1f321b){return db['Team']['findAll']({'where':{'id':_0x219c20[_0xfadb('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfadb('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfadb('0x29')](handleEntityNotFound(_0x322edd,null))['then'](function(_0x4d57ef){var _0x23d32b=_[_0xfadb('0x30')](_0x4d57ef,'id');var _0x128a48=[];var _0x2f8ba7=[];var _0x48be03=squel[_0xfadb('0x75')]();_0x48be03['field']('tq.TeamId')['from'](_0xfadb('0x76'),'tq')[_0xfadb('0x77')](_0xfadb('0x78'),'ut',_0xfadb('0x79'))[_0xfadb('0x40')](_0xfadb('0x7a'),_0x219c20[_0xfadb('0x4b')]['id']);for(var _0x58fd9b=0x0;_0x58fd9b<_0x4d57ef['length'];_0x58fd9b+=0x1){let _0x2e5413=_0x4d57ef[_0x58fd9b];for(var _0x32b5c2=0x0;_0x32b5c2<_0x2e5413[_0xfadb('0x69')][_0xfadb('0x3c')];_0x32b5c2+=0x1){let _0x68c6d1=_0x2e5413[_0xfadb('0x69')][_0x32b5c2];var _0x5e7c35=_0x48be03[_0xfadb('0x7b')]();_0x5e7c35[_0xfadb('0x40')](_0xfadb('0x7c'),_0x68c6d1['id']);_0x2f8ba7[_0xfadb('0x7d')](db[_0xfadb('0x6e')][_0xfadb('0x36')](_0x5e7c35['toString'](),{'type':db['sequelize'][_0xfadb('0x7e')][_0xfadb('0x7f')]})['then'](function(_0x5c354e){if(_0x5c354e[_0xfadb('0x3c')]===0x1){return _0x68c6d1['id'];}else{var _0x4f6832=_['every'](_['map'](_0x5c354e,_0xfadb('0x80')),function(_0x5cc8e1){return _['includes'](_0x23d32b,_0x5cc8e1);});if(_0x4f6832){return _0x68c6d1['id'];}}}));}}return BPromise[_0xfadb('0x81')](_0x2f8ba7)['then'](function(_0x71af60){_0x128a48=_(_0x128a48)[_0xfadb('0x82')](_0x71af60)[_0xfadb('0x83')]()[_0xfadb('0x84')]();return db[_0xfadb('0x4c')][_0xfadb('0x4d')]({'where':{'id':_0x219c20['params']['id']}})[_0xfadb('0x29')](function(_0x218188){return db[_0xfadb('0x6e')][_0xfadb('0x6f')](function(_0x54d34d){return _0x218188[_0xfadb('0x85')](_0x219c20['query'][_0xfadb('0x67')],{'transaction':_0x54d34d})[_0xfadb('0x29')](function(){if(!_[_0xfadb('0x86')](_0x128a48)){return _0x218188[_0xfadb('0x87')](_0x128a48,{'transaction':_0x54d34d});}})['then'](function(){_0x128a48['forEach'](function(_0x52af0f){socket[_0xfadb('0x73')](_0xfadb('0x88'),{'UserId':_0x52af0f,'FaxQueueId':_0x218188['id']});});});});});});})['then'](respondWithStatusCode(_0x322edd,null))[_0xfadb('0x4e')](handleError(_0x322edd,null));};exports[_0xfadb('0x89')]=function(_0x10c1b4,_0x5f3638,_0x85cc){return db[_0xfadb('0x4c')][_0xfadb('0x4d')]({'where':{'id':_0x10c1b4['params']['id']}})[_0xfadb('0x29')](handleEntityNotFound(_0x5f3638,null))[_0xfadb('0x29')](function(_0x5a4ec8){if(_0x5a4ec8){return _0x5a4ec8[_0xfadb('0x89')](_0x10c1b4['body'][_0xfadb('0x67')],_['omit'](_0x10c1b4[_0xfadb('0x50')],['ids','id'])||{})['spread'](function(_0xd6d7e7){for(var _0x1b21ee=0x0;_0x1b21ee<_0x10c1b4['body'][_0xfadb('0x67')]['length'];_0x1b21ee+=0x1){socket[_0xfadb('0x73')](_0xfadb('0x74'),{'UserId':Number(_0x10c1b4[_0xfadb('0x50')][_0xfadb('0x67')][_0x1b21ee]),'FaxQueueId':Number(_0x10c1b4[_0xfadb('0x4b')]['id'])});}return _0xd6d7e7;});}})['then'](respondWithResult(_0x5f3638,null))['catch'](handleError(_0x5f3638,null));};exports[_0xfadb('0x87')]=function(_0x1cf65f,_0x5dc680,_0x349061){return db['FaxQueue'][_0xfadb('0x4d')]({'where':{'id':_0x1cf65f['params']['id']}})[_0xfadb('0x29')](handleEntityNotFound(_0x5dc680,null))[_0xfadb('0x29')](function(_0x322e76){if(_0x322e76){return _0x322e76['removeAgents'](_0x1cf65f[_0xfadb('0x36')][_0xfadb('0x67')])['then'](function(){if(_[_0xfadb('0x8a')](_0x1cf65f[_0xfadb('0x36')][_0xfadb('0x67')])){for(var _0x3ce092=0x0;_0x3ce092<_0x1cf65f[_0xfadb('0x36')][_0xfadb('0x67')][_0xfadb('0x3c')];_0x3ce092+=0x1){socket[_0xfadb('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x1cf65f[_0xfadb('0x36')][_0xfadb('0x67')][_0x3ce092]),'FaxQueueId':Number(_0x1cf65f[_0xfadb('0x4b')]['id'])});}}else{socket[_0xfadb('0x73')](_0xfadb('0x88'),{'UserId':Number(_0x1cf65f[_0xfadb('0x36')]['ids']),'FaxQueueId':Number(_0x1cf65f[_0xfadb('0x4b')]['id'])});}});}})[_0xfadb('0x29')](respondWithStatusCode(_0x5dc680,null))[_0xfadb('0x4e')](handleError(_0x5dc680,null));};exports[_0xfadb('0x8b')]=function(_0x8a5861,_0x51dd53,_0x599339){var _0x217090={};var _0x5eede7={};var _0x4c4af2;var _0x47c3b0;return db[_0xfadb('0x4c')]['findOne']({'where':{'id':_0x8a5861[_0xfadb('0x4b')]['id']}})[_0xfadb('0x29')](handleEntityNotFound(_0x51dd53,null))['then'](function(_0x3b8233){if(_0x3b8233){_0x4c4af2=_0x3b8233;_0x5eede7[_0xfadb('0x35')]=_[_0xfadb('0x37')](db[_0xfadb('0x5b')][_0xfadb('0x31')]);_0x5eede7[_0xfadb('0x36')]=_['keys'](_0x8a5861['query']);_0x5eede7[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0x5eede7['model'],_0x5eede7[_0xfadb('0x36')]);_0x217090[_0xfadb('0x3a')]=_['intersection'](_0x5eede7[_0xfadb('0x35')],qs[_0xfadb('0x3b')](_0x8a5861[_0xfadb('0x36')][_0xfadb('0x3b')]));_0x217090[_0xfadb('0x3a')]=_0x217090[_0xfadb('0x3a')][_0xfadb('0x3c')]?_0x217090[_0xfadb('0x3a')]:_0x5eede7[_0xfadb('0x35')];_0x217090['order']=qs['sort'](_0x8a5861[_0xfadb('0x36')][_0xfadb('0x3f')]);_0x217090['where']=qs[_0xfadb('0x38')](_[_0xfadb('0x41')](_0x8a5861[_0xfadb('0x36')],_0x5eede7['filters']));if(_0x8a5861['query'][_0xfadb('0x42')]){_0x217090['where']=_['merge'](_0x217090[_0xfadb('0x40')],{'$or':_[_0xfadb('0x30')](_0x217090[_0xfadb('0x3a')],function(_0x18fa8f){var _0x598f7a={};_0x598f7a[_0x18fa8f]={'$like':'%'+_0x8a5861[_0xfadb('0x36')][_0xfadb('0x42')]+'%'};return _0x598f7a;})});}_0x217090=_[_0xfadb('0x43')]({},_0x217090,_0x8a5861['options']);return _0x4c4af2[_0xfadb('0x8b')](_0x217090);}})[_0xfadb('0x29')](function(_0x4e1e3d){if(_0x4e1e3d){_0x47c3b0=_0x4e1e3d[_0xfadb('0x3c')];if(!_0x8a5861[_0xfadb('0x36')]['hasOwnProperty']('nolimit')){_0x217090[_0xfadb('0x21')]=qs[_0xfadb('0x21')](_0x8a5861[_0xfadb('0x36')][_0xfadb('0x21')]);_0x217090[_0xfadb('0x23')]=qs[_0xfadb('0x23')](_0x8a5861['query']['offset']);}return _0x4c4af2[_0xfadb('0x8b')](_0x217090);}})['then'](function(_0x2a58db){if(_0x2a58db){return _0x2a58db?{'count':_0x47c3b0,'rows':_0x2a58db}:null;}})[_0xfadb('0x29')](respondWithResult(_0x51dd53,null))[_0xfadb('0x4e')](handleError(_0x51dd53,null));}; \ No newline at end of file +var _0x38a0=['userFaxQueue:save','Agents','select','field','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','SELECT','TeamId','includes','union','compact','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','end','error','stack','name','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','FaxQueueId','options','UserFaxQueue','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','voicePause','sequelize','transaction','findOrCreate','forEach'];(function(_0xf3c3f8,_0x275cec){var _0x38c047=function(_0x12266c){while(--_0x12266c){_0xf3c3f8['push'](_0xf3c3f8['shift']());}};_0x38c047(++_0x275cec);}(_0x38a0,0x120));var _0x038a=function(_0x35c266,_0x24de41){_0x35c266=_0x35c266-0x0;var _0xd75a7b=_0x38a0[_0x35c266];return _0xd75a7b;};'use strict';var emlformat=require(_0x038a('0x0'));var rimraf=require(_0x038a('0x1'));var zipdir=require(_0x038a('0x2'));var jsonpatch=require(_0x038a('0x3'));var rp=require(_0x038a('0x4'));var moment=require('moment');var BPromise=require(_0x038a('0x5'));var Mustache=require(_0x038a('0x6'));var util=require(_0x038a('0x7'));var path=require('path');var sox=require(_0x038a('0x8'));var csv=require(_0x038a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x038a('0xa'));var squel=require(_0x038a('0xb'));var crypto=require(_0x038a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x038a('0xd'));var toCsv=require(_0x038a('0x9'));var querystring=require(_0x038a('0xe'));var Papa=require(_0x038a('0xf'));var Redis=require(_0x038a('0x10'));var authService=require(_0x038a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x038a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x038a('0x13'))(_0x038a('0x14'));var utils=require(_0x038a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x038a('0x16'))['db'];config[_0x038a('0x17')]=_[_0x038a('0x18')](config[_0x038a('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x038a('0x17')]));require(_0x038a('0x19'))[_0x038a('0x1a')](socket);function respondWithStatusCode(_0x12f61e,_0x3979a6){_0x3979a6=_0x3979a6||0xcc;return function(_0x18c7a9){if(_0x18c7a9){return _0x12f61e[_0x038a('0x1b')](_0x3979a6);}return _0x12f61e[_0x038a('0x1c')](_0x3979a6)['end']();};}function respondWithResult(_0x24f138,_0x4bff2b){_0x4bff2b=_0x4bff2b||0xc8;return function(_0x216a33){if(_0x216a33){return _0x24f138[_0x038a('0x1c')](_0x4bff2b)[_0x038a('0x1d')](_0x216a33);}};}function respondWithFilteredResult(_0x5da952,_0x17811b){return function(_0x2b0bb9){if(_0x2b0bb9){var _0x1811aa=typeof _0x17811b[_0x038a('0x1e')]===_0x038a('0x1f')&&typeof _0x17811b[_0x038a('0x20')]==='undefined';var _0x3d0baa=_0x2b0bb9[_0x038a('0x21')];var _0x43286f=_0x1811aa?0x0:_0x17811b['offset'];var _0x543c4c=_0x1811aa?_0x2b0bb9[_0x038a('0x21')]:_0x17811b[_0x038a('0x1e')]+_0x17811b[_0x038a('0x20')];var _0x210c8a;if(_0x543c4c>=_0x3d0baa){_0x543c4c=_0x3d0baa;_0x210c8a=0xc8;}else{_0x210c8a=0xce;}_0x5da952['status'](_0x210c8a);return _0x5da952[_0x038a('0x22')](_0x038a('0x23'),_0x43286f+'-'+_0x543c4c+'/'+_0x3d0baa)[_0x038a('0x1d')](_0x2b0bb9);}return null;};}function patchUpdates(_0x6225bb){return function(_0x36b8dd){try{jsonpatch[_0x038a('0x24')](_0x36b8dd,_0x6225bb,!![]);}catch(_0x18fa2d){return BPromise[_0x038a('0x25')](_0x18fa2d);}return _0x36b8dd[_0x038a('0x26')]();};}function saveUpdates(_0x342756,_0x2107cb){return function(_0x4e4489){if(_0x4e4489){return _0x4e4489[_0x038a('0x27')](_0x342756)[_0x038a('0x28')](function(_0x4efc54){return _0x4efc54;});}return null;};}function removeEntity(_0x2e9947,_0x486a16){return function(_0x41121a){if(_0x41121a){return _0x41121a[_0x038a('0x29')]()[_0x038a('0x28')](function(){var _0x8d4fb3=_0x41121a['get']({'plain':!![]});var _0x15163a=_0x038a('0x2a');return db[_0x038a('0x2b')][_0x038a('0x29')]({'where':{'type':_0x15163a,'resourceId':_0x8d4fb3['id']}})[_0x038a('0x28')](function(){return _0x41121a;});})[_0x038a('0x28')](function(){_0x2e9947[_0x038a('0x1c')](0xcc)[_0x038a('0x2c')]();});}};}function handleEntityNotFound(_0x193b95,_0x5c09d2){return function(_0x42d0f1){if(!_0x42d0f1){_0x193b95['sendStatus'](0x194);}return _0x42d0f1;};}function handleError(_0x357e1d,_0x12ee9a){_0x12ee9a=_0x12ee9a||0x1f4;return function(_0x4e40a1){logger[_0x038a('0x2d')](_0x4e40a1[_0x038a('0x2e')]);if(_0x4e40a1[_0x038a('0x2f')]){delete _0x4e40a1['name'];}_0x357e1d[_0x038a('0x1c')](_0x12ee9a)['send'](_0x4e40a1);};}exports[_0x038a('0x30')]=function(_0xc40b96,_0x1ce6f6){var _0x433829={},_0x275fd6={},_0x30d959={'count':0x0,'rows':[]};var _0x231677=_['map'](db[_0x038a('0x31')][_0x038a('0x32')],function(_0x34e3bf){return{'name':_0x34e3bf[_0x038a('0x33')],'type':_0x34e3bf[_0x038a('0x34')][_0x038a('0x35')]};});_0x275fd6[_0x038a('0x36')]=_[_0x038a('0x37')](_0x231677,'name');_0x275fd6['query']=_[_0x038a('0x38')](_0xc40b96[_0x038a('0x39')]);_0x275fd6[_0x038a('0x3a')]=_[_0x038a('0x3b')](_0x275fd6[_0x038a('0x36')],_0x275fd6[_0x038a('0x39')]);_0x433829['attributes']=_[_0x038a('0x3b')](_0x275fd6[_0x038a('0x36')],qs[_0x038a('0x3c')](_0xc40b96[_0x038a('0x39')][_0x038a('0x3c')]));_0x433829[_0x038a('0x3d')]=_0x433829[_0x038a('0x3d')][_0x038a('0x3e')]?_0x433829[_0x038a('0x3d')]:_0x275fd6[_0x038a('0x36')];if(!_0xc40b96[_0x038a('0x39')][_0x038a('0x3f')](_0x038a('0x40'))){_0x433829[_0x038a('0x20')]=qs[_0x038a('0x20')](_0xc40b96['query']['limit']);_0x433829[_0x038a('0x1e')]=qs['offset'](_0xc40b96[_0x038a('0x39')][_0x038a('0x1e')]);}_0x433829[_0x038a('0x41')]=qs[_0x038a('0x42')](_0xc40b96[_0x038a('0x39')]['sort']);_0x433829['where']=qs['filters'](_[_0x038a('0x43')](_0xc40b96[_0x038a('0x39')],_0x275fd6[_0x038a('0x3a')]),_0x231677);if(_0xc40b96[_0x038a('0x39')][_0x038a('0x44')]){_0x433829['where']=_[_0x038a('0x45')](_0x433829['where'],{'$or':_[_0x038a('0x37')](_0x231677,function(_0x59f40c){if(_0x59f40c[_0x038a('0x34')]!==_0x038a('0x46')){var _0x20c16b={};_0x20c16b[_0x59f40c[_0x038a('0x2f')]]={'$like':'%'+_0xc40b96['query'][_0x038a('0x44')]+'%'};return _0x20c16b;}})});}_0x433829=_[_0x038a('0x45')]({},_0x433829,_0xc40b96['options']);var _0x5e98dd={'where':_0x433829[_0x038a('0x47')]};return db[_0x038a('0x31')]['count'](_0x5e98dd)[_0x038a('0x28')](function(_0x196a8d){_0x30d959[_0x038a('0x21')]=_0x196a8d;if(_0xc40b96[_0x038a('0x39')][_0x038a('0x48')]){_0x433829[_0x038a('0x49')]=[{'all':!![]}];}return db[_0x038a('0x31')][_0x038a('0x4a')](_0x433829);})['then'](function(_0x114ca9){_0x30d959[_0x038a('0x4b')]=_0x114ca9;return _0x30d959;})[_0x038a('0x28')](respondWithFilteredResult(_0x1ce6f6,_0x433829))[_0x038a('0x4c')](handleError(_0x1ce6f6,null));};exports['show']=function(_0x55d62a,_0x35aeac){var _0x21fc8b={'raw':!![],'where':{'id':_0x55d62a[_0x038a('0x4d')]['id']}},_0x4278aa={};_0x4278aa[_0x038a('0x36')]=_[_0x038a('0x38')](db[_0x038a('0x31')][_0x038a('0x32')]);_0x4278aa[_0x038a('0x39')]=_[_0x038a('0x38')](_0x55d62a[_0x038a('0x39')]);_0x4278aa[_0x038a('0x3a')]=_[_0x038a('0x3b')](_0x4278aa[_0x038a('0x36')],_0x4278aa['query']);_0x21fc8b['attributes']=_[_0x038a('0x3b')](_0x4278aa[_0x038a('0x36')],qs[_0x038a('0x3c')](_0x55d62a[_0x038a('0x39')]['fields']));_0x21fc8b[_0x038a('0x3d')]=_0x21fc8b['attributes'][_0x038a('0x3e')]?_0x21fc8b[_0x038a('0x3d')]:_0x4278aa[_0x038a('0x36')];if(_0x55d62a[_0x038a('0x39')][_0x038a('0x48')]){_0x21fc8b[_0x038a('0x49')]=[{'all':!![]}];}_0x21fc8b=_['merge']({},_0x21fc8b,_0x55d62a['options']);return db[_0x038a('0x31')][_0x038a('0x4e')](_0x21fc8b)[_0x038a('0x28')](handleEntityNotFound(_0x35aeac,null))['then'](respondWithResult(_0x35aeac,null))['catch'](handleError(_0x35aeac,null));};exports[_0x038a('0x4f')]=function(_0x2aaa4c,_0x27bc18){return db[_0x038a('0x31')][_0x038a('0x4f')](_0x2aaa4c[_0x038a('0x50')],{})[_0x038a('0x28')](function(_0x26e329){var _0x374233=_0x2aaa4c[_0x038a('0x51')][_0x038a('0x52')]({'plain':!![]});if(!_0x374233)throw new Error(_0x038a('0x53'));if(_0x374233[_0x038a('0x54')]===_0x038a('0x51')){var _0x424f49=_0x26e329[_0x038a('0x52')]({'plain':!![]});var _0x52036a=_0x038a('0x2a');return db[_0x038a('0x55')][_0x038a('0x4e')]({'where':{'name':_0x52036a,'userProfileId':_0x374233[_0x038a('0x56')]},'raw':!![]})[_0x038a('0x28')](function(_0x4dc541){if(_0x4dc541&&_0x4dc541[_0x038a('0x57')]===0x0){return db[_0x038a('0x2b')][_0x038a('0x4f')]({'name':_0x424f49[_0x038a('0x2f')],'resourceId':_0x424f49['id'],'type':_0x4dc541['name'],'sectionId':_0x4dc541['id']},{})[_0x038a('0x28')](function(){return _0x26e329;});}else{return _0x26e329;}})[_0x038a('0x4c')](function(_0x13d593){logger[_0x038a('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13d593);throw _0x13d593;});}return _0x26e329;})[_0x038a('0x28')](respondWithResult(_0x27bc18,0xc9))[_0x038a('0x4c')](handleError(_0x27bc18,null));};exports[_0x038a('0x27')]=function(_0x330836,_0x1b1b2a){if(_0x330836['body']['id']){delete _0x330836[_0x038a('0x50')]['id'];}return db[_0x038a('0x31')][_0x038a('0x4e')]({'where':{'id':_0x330836['params']['id']}})['then'](handleEntityNotFound(_0x1b1b2a,null))[_0x038a('0x28')](saveUpdates(_0x330836[_0x038a('0x50')],null))[_0x038a('0x28')](respondWithResult(_0x1b1b2a,null))[_0x038a('0x4c')](handleError(_0x1b1b2a,null));};exports[_0x038a('0x29')]=function(_0x14d1a5,_0x1f1ed1){return db[_0x038a('0x31')][_0x038a('0x4e')]({'where':{'id':_0x14d1a5[_0x038a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f1ed1,null))['then'](removeEntity(_0x1f1ed1,null))[_0x038a('0x4c')](handleError(_0x1f1ed1,null));};exports['describe']=function(_0x1209a6,_0x35d331){return db['FaxQueue'][_0x038a('0x58')]()['then'](respondWithResult(_0x35d331,null))[_0x038a('0x4c')](handleError(_0x35d331,null));};exports[_0x038a('0x59')]=function(_0x23d0e9,_0x39b503,_0x154e30){var _0x27cbac={'raw':!![],'where':{}},_0x2a51ae={},_0x348f9b;return db[_0x038a('0x31')][_0x038a('0x5a')]({'where':{'id':_0x23d0e9[_0x038a('0x4d')]['id']}})[_0x038a('0x28')](handleEntityNotFound(_0x39b503,null))[_0x038a('0x28')](function(_0x39bc30){if(_0x39bc30){_0x348f9b=_0x39bc30['get']({'plain':!![]});_0x2a51ae[_0x038a('0x36')]=_[_0x038a('0x38')](db['UserFaxQueue'][_0x038a('0x32')]);_0x2a51ae[_0x038a('0x39')]=_['keys'](_0x23d0e9['query']);_0x2a51ae['filters']=_['intersection'](_0x2a51ae['model'],_0x2a51ae['query']);_0x27cbac[_0x038a('0x3d')]=_[_0x038a('0x3b')](_0x2a51ae[_0x038a('0x36')],qs['fields'](_0x23d0e9[_0x038a('0x39')][_0x038a('0x3c')]));_0x27cbac[_0x038a('0x3d')]=_0x27cbac['attributes'][_0x038a('0x3e')]?_0x27cbac[_0x038a('0x3d')]:_0x2a51ae[_0x038a('0x36')];if(!_0x23d0e9['query']['hasOwnProperty'](_0x038a('0x40'))){_0x27cbac[_0x038a('0x20')]=qs['limit'](_0x23d0e9[_0x038a('0x39')]['limit']);_0x27cbac[_0x038a('0x1e')]=qs['offset'](_0x23d0e9[_0x038a('0x39')]['offset']);}_0x27cbac[_0x038a('0x41')]=qs[_0x038a('0x42')](_0x23d0e9[_0x038a('0x39')][_0x038a('0x42')]);_0x27cbac[_0x038a('0x47')]=qs[_0x038a('0x3a')](_[_0x038a('0x43')](_0x23d0e9[_0x038a('0x39')],_0x2a51ae[_0x038a('0x3a')]));_0x27cbac[_0x038a('0x47')][_0x038a('0x5b')]=_0x39bc30['id'];if(_0x23d0e9[_0x038a('0x39')]['filter']){_0x27cbac[_0x038a('0x47')]=_[_0x038a('0x45')](_0x27cbac[_0x038a('0x47')],{'$or':_[_0x038a('0x37')](_0x27cbac[_0x038a('0x3d')],function(_0x1b9fad){var _0x20ff26={};_0x20ff26[_0x1b9fad]={'$like':'%'+_0x23d0e9[_0x038a('0x39')][_0x038a('0x44')]+'%'};return _0x20ff26;})});}_0x27cbac=_['merge']({},_0x27cbac,_0x23d0e9[_0x038a('0x5c')]);return db[_0x038a('0x5d')][_0x038a('0x4a')](_0x27cbac);}})[_0x038a('0x28')](function(_0x4300ba){if(_0x4300ba){return db[_0x038a('0x5e')]['findAndCountAll']({'where':{'id':_[_0x038a('0x37')](_0x4300ba,_0x038a('0x5f')),'role':_0x038a('0x60')},'attributes':['id',_0x038a('0x2f'),_0x038a('0x61'),_0x038a('0x62'),_0x038a('0x63')]});}})['then'](function(_0x10e3e1){if(_0x10e3e1){return{'count':_0x10e3e1[_0x038a('0x21')],'rows':_[_0x038a('0x37')](_0x10e3e1[_0x038a('0x4b')],function(_0x2cecc8){return{'membername':_0x2cecc8[_0x038a('0x2f')],'UserId':_0x2cecc8['id'],'queue_name':_0x348f9b[_0x038a('0x2f')],'FaxQueueId':_0x348f9b['id'],'interface':util[_0x038a('0x64')](_0x038a('0x65'),'SIP',_0x2cecc8[_0x038a('0x2f')]),'penalty':0x0,'paused':_0x2cecc8[_0x038a('0x61')],'createdAt':_0x2cecc8[_0x038a('0x63')],'updatedAt':_0x2cecc8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x038a('0x28')](respondWithFilteredResult(_0x39b503,_0x27cbac))[_0x038a('0x4c')](handleError(_0x39b503,null));};exports[_0x038a('0x66')]=function(_0x2ac30f,_0x5cbd58,_0x1cf3c2){var _0x2c91ac={};var _0x1f62a1={};var _0x3c2277;var _0x895552;return db[_0x038a('0x31')]['findOne']({'where':{'id':_0x2ac30f[_0x038a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5cbd58,null))['then'](function(_0x46ed5f){if(_0x46ed5f){_0x3c2277=_0x46ed5f;_0x1f62a1[_0x038a('0x36')]=_[_0x038a('0x38')](db[_0x038a('0x67')][_0x038a('0x32')]);_0x1f62a1[_0x038a('0x39')]=_[_0x038a('0x38')](_0x2ac30f['query']);_0x1f62a1[_0x038a('0x3a')]=_['intersection'](_0x1f62a1[_0x038a('0x36')],_0x1f62a1[_0x038a('0x39')]);_0x2c91ac[_0x038a('0x3d')]=_[_0x038a('0x3b')](_0x1f62a1[_0x038a('0x36')],qs[_0x038a('0x3c')](_0x2ac30f[_0x038a('0x39')][_0x038a('0x3c')]));_0x2c91ac[_0x038a('0x3d')]=_0x2c91ac[_0x038a('0x3d')][_0x038a('0x3e')]?_0x2c91ac[_0x038a('0x3d')]:_0x1f62a1[_0x038a('0x36')];_0x2c91ac[_0x038a('0x41')]=qs[_0x038a('0x42')](_0x2ac30f[_0x038a('0x39')][_0x038a('0x42')]);_0x2c91ac[_0x038a('0x47')]=qs[_0x038a('0x3a')](_[_0x038a('0x43')](_0x2ac30f[_0x038a('0x39')],_0x1f62a1['filters']));if(_0x2ac30f[_0x038a('0x39')][_0x038a('0x44')]){_0x2c91ac[_0x038a('0x47')]=_[_0x038a('0x45')](_0x2c91ac[_0x038a('0x47')],{'$or':_[_0x038a('0x37')](_0x2c91ac['attributes'],function(_0x45b1e6){var _0xce4cbc={};_0xce4cbc[_0x45b1e6]={'$like':'%'+_0x2ac30f[_0x038a('0x39')][_0x038a('0x44')]+'%'};return _0xce4cbc;})});}_0x2c91ac=_[_0x038a('0x45')]({},_0x2c91ac,_0x2ac30f[_0x038a('0x5c')]);return _0x3c2277[_0x038a('0x66')](_0x2c91ac);}})[_0x038a('0x28')](function(_0x2c2e20){if(_0x2c2e20){_0x895552=_0x2c2e20[_0x038a('0x3e')];if(!_0x2ac30f['query'][_0x038a('0x3f')](_0x038a('0x40'))){_0x2c91ac[_0x038a('0x20')]=qs[_0x038a('0x20')](_0x2ac30f[_0x038a('0x39')][_0x038a('0x20')]);_0x2c91ac['offset']=qs[_0x038a('0x1e')](_0x2ac30f[_0x038a('0x39')]['offset']);}return _0x3c2277[_0x038a('0x66')](_0x2c91ac);}})['then'](function(_0x2e8e44){if(_0x2e8e44){return _0x2e8e44?{'count':_0x895552,'rows':_0x2e8e44}:null;}})[_0x038a('0x28')](respondWithResult(_0x5cbd58,null))[_0x038a('0x4c')](handleError(_0x5cbd58,null));};exports[_0x038a('0x68')]=function(_0x533e33,_0x2090ad,_0x100b36){var _0x24beee=_0x533e33[_0x038a('0x50')][_0x038a('0x69')];return db[_0x038a('0x67')][_0x038a('0x4a')]({'where':{'id':_0x24beee},'attributes':['id'],'include':[{'model':db[_0x038a('0x5e')],'as':'Agents','attributes':['id',_0x038a('0x2f'),'online',_0x038a('0x6a'),'interface'],'raw':!![]}]})[_0x038a('0x28')](function(_0x1842bf){if(_0x1842bf){var _0x1daef2=_['flatMap'](_0x1842bf,function(_0x4e5456){var _0x2c17db=_0x4e5456[_0x038a('0x52')]({'plain':!![]});return _0x2c17db['Agents'];});return db[_0x038a('0x31')][_0x038a('0x4e')]({'where':{'id':_0x533e33[_0x038a('0x4d')]['id']}})['then'](function(_0x4e2116){return db[_0x038a('0x6b')][_0x038a('0x6c')](function(_0x1b511f){return _0x4e2116[_0x038a('0x68')](_0x24beee,{'transaction':_0x1b511f})[_0x038a('0x28')](function(){return BPromise['each'](_0x1daef2,function(_0x462e14){return db['UserFaxQueue'][_0x038a('0x6d')]({'where':{'UserId':_0x462e14['id'],'FaxQueueId':_0x533e33[_0x038a('0x4d')]['id']},'transaction':_0x1b511f});});})[_0x038a('0x28')](function(){_0x1daef2[_0x038a('0x6e')](function(_0x3e76ad){socket['emit'](_0x038a('0x6f'),{'UserId':_0x3e76ad['id'],'FaxQueueId':_0x4e2116['id']});});});});});}})[_0x038a('0x28')](respondWithStatusCode(_0x2090ad,null))[_0x038a('0x4c')](handleError(_0x2090ad,null));};exports['removeTeams']=function(_0x2b54c2,_0x548c15,_0x1199a8){return db[_0x038a('0x67')]['findAll']({'where':{'id':_0x2b54c2[_0x038a('0x39')][_0x038a('0x69')]},'attributes':['id'],'include':[{'model':db[_0x038a('0x5e')],'as':_0x038a('0x70'),'attributes':['id'],'raw':!![]}]})[_0x038a('0x28')](handleEntityNotFound(_0x548c15,null))[_0x038a('0x28')](function(_0x221e56){var _0x2f7096=_[_0x038a('0x37')](_0x221e56,'id');var _0x149ad2=[];var _0x2edad2=[];var _0xb8798c=squel[_0x038a('0x71')]();_0xb8798c[_0x038a('0x72')]('tq.TeamId')[_0x038a('0x73')]('team_has_fax_queues','tq')[_0x038a('0x74')]('user_has_teams','ut',_0x038a('0x75'))[_0x038a('0x47')]('FaxQueueId\x20=\x20?',_0x2b54c2[_0x038a('0x4d')]['id']);for(var _0x5a4076=0x0;_0x5a4076<_0x221e56['length'];_0x5a4076+=0x1){let _0xbd04c0=_0x221e56[_0x5a4076];for(var _0x4c1c95=0x0;_0x4c1c95<_0xbd04c0['Agents'][_0x038a('0x3e')];_0x4c1c95+=0x1){let _0x29e8e5=_0xbd04c0[_0x038a('0x70')][_0x4c1c95];var _0x188785=_0xb8798c[_0x038a('0x76')]();_0x188785[_0x038a('0x47')]('ut.UserId\x20=\x20?',_0x29e8e5['id']);_0x2edad2[_0x038a('0x77')](db[_0x038a('0x6b')][_0x038a('0x39')](_0x188785['toString'](),{'type':db['sequelize']['QueryTypes'][_0x038a('0x78')]})[_0x038a('0x28')](function(_0x117eae){if(_0x117eae[_0x038a('0x3e')]===0x1){return _0x29e8e5['id'];}else{var _0x8aedd4=_['every'](_[_0x038a('0x37')](_0x117eae,_0x038a('0x79')),function(_0x4ef0ad){return _[_0x038a('0x7a')](_0x2f7096,_0x4ef0ad);});if(_0x8aedd4){return _0x29e8e5['id'];}}}));}}return BPromise['all'](_0x2edad2)['then'](function(_0xe2a993){_0x149ad2=_(_0x149ad2)[_0x038a('0x7b')](_0xe2a993)[_0x038a('0x7c')]()['value']();return db['FaxQueue'][_0x038a('0x4e')]({'where':{'id':_0x2b54c2[_0x038a('0x4d')]['id']}})['then'](function(_0x45d3dd){return db['sequelize'][_0x038a('0x6c')](function(_0x2b18d5){return _0x45d3dd[_0x038a('0x7d')](_0x2b54c2['query'][_0x038a('0x69')],{'transaction':_0x2b18d5})[_0x038a('0x28')](function(){if(!_[_0x038a('0x7e')](_0x149ad2)){return _0x45d3dd[_0x038a('0x7f')](_0x149ad2,{'transaction':_0x2b18d5});}})['then'](function(){_0x149ad2[_0x038a('0x6e')](function(_0x2b1917){socket[_0x038a('0x80')](_0x038a('0x81'),{'UserId':_0x2b1917,'FaxQueueId':_0x45d3dd['id']});});});});});});})['then'](respondWithStatusCode(_0x548c15,null))[_0x038a('0x4c')](handleError(_0x548c15,null));};exports['addAgents']=function(_0x9b63e2,_0x5e56be,_0x3df277){return db[_0x038a('0x31')][_0x038a('0x4e')]({'where':{'id':_0x9b63e2[_0x038a('0x4d')]['id']}})[_0x038a('0x28')](handleEntityNotFound(_0x5e56be,null))[_0x038a('0x28')](function(_0xf84b10){if(_0xf84b10){return _0xf84b10[_0x038a('0x82')](_0x9b63e2['body'][_0x038a('0x69')],_[_0x038a('0x83')](_0x9b63e2['body'],['ids','id'])||{})['spread'](function(_0x30d04f){for(var _0x1456c2=0x0;_0x1456c2<_0x9b63e2[_0x038a('0x50')][_0x038a('0x69')]['length'];_0x1456c2+=0x1){socket['emit']('userFaxQueue:save',{'UserId':Number(_0x9b63e2[_0x038a('0x50')][_0x038a('0x69')][_0x1456c2]),'FaxQueueId':Number(_0x9b63e2['params']['id'])});}return _0x30d04f;});}})[_0x038a('0x28')](respondWithResult(_0x5e56be,null))[_0x038a('0x4c')](handleError(_0x5e56be,null));};exports[_0x038a('0x7f')]=function(_0x155863,_0x13d517,_0x192ea9){return db[_0x038a('0x31')][_0x038a('0x4e')]({'where':{'id':_0x155863[_0x038a('0x4d')]['id']}})[_0x038a('0x28')](handleEntityNotFound(_0x13d517,null))[_0x038a('0x28')](function(_0xb72f93){if(_0xb72f93){return _0xb72f93[_0x038a('0x7f')](_0x155863[_0x038a('0x39')][_0x038a('0x69')])['then'](function(){if(_['isArray'](_0x155863['query'][_0x038a('0x69')])){for(var _0x23cdaa=0x0;_0x23cdaa<_0x155863[_0x038a('0x39')][_0x038a('0x69')]['length'];_0x23cdaa+=0x1){socket[_0x038a('0x80')]('userFaxQueue:remove',{'UserId':Number(_0x155863[_0x038a('0x39')][_0x038a('0x69')][_0x23cdaa]),'FaxQueueId':Number(_0x155863[_0x038a('0x4d')]['id'])});}}else{socket['emit'](_0x038a('0x81'),{'UserId':Number(_0x155863[_0x038a('0x39')][_0x038a('0x69')]),'FaxQueueId':Number(_0x155863[_0x038a('0x4d')]['id'])});}});}})[_0x038a('0x28')](respondWithStatusCode(_0x13d517,null))[_0x038a('0x4c')](handleError(_0x13d517,null));};exports[_0x038a('0x84')]=function(_0x4d491b,_0x2ce8d5,_0x31ed77){var _0x982d04={};var _0x1d2e74={};var _0x264c28;var _0x2dc4cd;return db['FaxQueue'][_0x038a('0x5a')]({'where':{'id':_0x4d491b['params']['id']}})[_0x038a('0x28')](handleEntityNotFound(_0x2ce8d5,null))[_0x038a('0x28')](function(_0x2263d9){if(_0x2263d9){_0x264c28=_0x2263d9;_0x1d2e74[_0x038a('0x36')]=_[_0x038a('0x38')](db[_0x038a('0x5e')][_0x038a('0x32')]);_0x1d2e74[_0x038a('0x39')]=_[_0x038a('0x38')](_0x4d491b['query']);_0x1d2e74[_0x038a('0x3a')]=_[_0x038a('0x3b')](_0x1d2e74[_0x038a('0x36')],_0x1d2e74[_0x038a('0x39')]);_0x982d04[_0x038a('0x3d')]=_[_0x038a('0x3b')](_0x1d2e74[_0x038a('0x36')],qs[_0x038a('0x3c')](_0x4d491b[_0x038a('0x39')][_0x038a('0x3c')]));_0x982d04[_0x038a('0x3d')]=_0x982d04[_0x038a('0x3d')][_0x038a('0x3e')]?_0x982d04[_0x038a('0x3d')]:_0x1d2e74[_0x038a('0x36')];_0x982d04[_0x038a('0x41')]=qs[_0x038a('0x42')](_0x4d491b[_0x038a('0x39')]['sort']);_0x982d04['where']=qs[_0x038a('0x3a')](_[_0x038a('0x43')](_0x4d491b[_0x038a('0x39')],_0x1d2e74[_0x038a('0x3a')]));if(_0x4d491b[_0x038a('0x39')][_0x038a('0x44')]){_0x982d04['where']=_[_0x038a('0x45')](_0x982d04[_0x038a('0x47')],{'$or':_['map'](_0x982d04[_0x038a('0x3d')],function(_0x23940b){var _0x27e49d={};_0x27e49d[_0x23940b]={'$like':'%'+_0x4d491b[_0x038a('0x39')][_0x038a('0x44')]+'%'};return _0x27e49d;})});}_0x982d04=_[_0x038a('0x45')]({},_0x982d04,_0x4d491b['options']);return _0x264c28['getAgents'](_0x982d04);}})[_0x038a('0x28')](function(_0x4e01ac){if(_0x4e01ac){_0x2dc4cd=_0x4e01ac[_0x038a('0x3e')];if(!_0x4d491b[_0x038a('0x39')][_0x038a('0x3f')](_0x038a('0x40'))){_0x982d04[_0x038a('0x20')]=qs[_0x038a('0x20')](_0x4d491b[_0x038a('0x39')][_0x038a('0x20')]);_0x982d04[_0x038a('0x1e')]=qs['offset'](_0x4d491b[_0x038a('0x39')]['offset']);}return _0x264c28[_0x038a('0x84')](_0x982d04);}})[_0x038a('0x28')](function(_0x5d1141){if(_0x5d1141){return _0x5d1141?{'count':_0x2dc4cd,'rows':_0x5d1141}:null;}})[_0x038a('0x28')](respondWithResult(_0x2ce8d5,null))[_0x038a('0x4c')](handleError(_0x2ce8d5,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b2eeabd..531295a 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 _0x67df=['setMaxListeners','save','update','remove','emit','hook','events','../../mysqldb'];(function(_0x567f6e,_0x596548){var _0x10d7f5=function(_0xcc21c7){while(--_0xcc21c7){_0x567f6e['push'](_0x567f6e['shift']());}};_0x10d7f5(++_0x596548);}(_0x67df,0xa6));var _0xf67d=function(_0x5d6ac7,_0x23a122){_0x5d6ac7=_0x5d6ac7-0x0;var _0x34ba49=_0x67df[_0x5d6ac7];return _0x34ba49;};'use strict';var EventEmitter=require(_0xf67d('0x0'));var FaxQueue=require(_0xf67d('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf67d('0x2')](0x0);var events={'afterCreate':_0xf67d('0x3'),'afterUpdate':_0xf67d('0x4'),'afterDestroy':_0xf67d('0x5')};function emitEvent(_0x246486){return function(_0x306e0b,_0x40f044,_0x1e4e7f){FaxQueueEvents[_0xf67d('0x6')](_0x246486+':'+_0x306e0b['id'],_0x306e0b);FaxQueueEvents['emit'](_0x246486,_0x306e0b);_0x1e4e7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xf67d('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x5d4e=['exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook'];(function(_0x3ff89e,_0x38c90d){var _0x11fcaf=function(_0x5c1c4f){while(--_0x5c1c4f){_0x3ff89e['push'](_0x3ff89e['shift']());}};_0x11fcaf(++_0x38c90d);}(_0x5d4e,0xe7));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe5d4('0x0'));var FaxQueue=require(_0xe5d4('0x1'))['db'][_0xe5d4('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe5d4('0x3')](0x0);var events={'afterCreate':_0xe5d4('0x4'),'afterUpdate':_0xe5d4('0x5'),'afterDestroy':_0xe5d4('0x6')};function emitEvent(_0x5144fb){return function(_0x567566,_0x15821c,_0x5ecabf){FaxQueueEvents['emit'](_0x5144fb+':'+_0x567566['id'],_0x567566);FaxQueueEvents['emit'](_0x5144fb,_0x567566);_0x5ecabf(null);};}for(var e in events){if(events[_0xe5d4('0x7')](e)){var event=events[e];FaxQueue[_0xe5d4('0x8')](e,emitEvent(event));}}module[_0xe5d4('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 a0106b1..aed9cb4 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 _0x1aff=['path','rimraf','./faxQueue.attributes','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5be635,_0x448e47){var _0x2e6328=function(_0x49b31e){while(--_0x49b31e){_0x5be635['push'](_0x5be635['shift']());}};_0x2e6328(++_0x448e47);}(_0x1aff,0x1de));var _0xf1af=function(_0x5215fe,_0xa7790c){_0x5215fe=_0x5215fe-0x0;var _0x207315=_0x1aff[_0x5215fe];return _0x207315;};'use strict';var _=require(_0xf1af('0x0'));var util=require(_0xf1af('0x1'));var logger=require(_0xf1af('0x2'))(_0xf1af('0x3'));var moment=require(_0xf1af('0x4'));var BPromise=require('bluebird');var rp=require(_0xf1af('0x5'));var fs=require('fs');var path=require(_0xf1af('0x6'));var rimraf=require(_0xf1af('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1af('0x8'));module['exports']=function(_0x24396e,_0x4dfe1b){return _0x24396e['define'](_0xf1af('0x9'),attributes,{'tableName':_0xf1af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0b2=['fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','FaxQueue'];(function(_0x35a01b,_0x259637){var _0x23dcf3=function(_0xd3668b){while(--_0xd3668b){_0x35a01b['push'](_0x35a01b['shift']());}};_0x23dcf3(++_0x259637);}(_0xd0b2,0x85));var _0x2d0b=function(_0x304a2c,_0x300911){_0x304a2c=_0x304a2c-0x0;var _0x39b2d9=_0xd0b2[_0x304a2c];return _0x39b2d9;};'use strict';var _=require('lodash');var util=require(_0x2d0b('0x0'));var logger=require(_0x2d0b('0x1'))(_0x2d0b('0x2'));var moment=require(_0x2d0b('0x3'));var BPromise=require(_0x2d0b('0x4'));var rp=require(_0x2d0b('0x5'));var fs=require('fs');var path=require(_0x2d0b('0x6'));var rimraf=require(_0x2d0b('0x7'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x2d0b('0x8')]=function(_0x36aadb,_0x3081ad){return _0x36aadb[_0x2d0b('0x9')](_0x2d0b('0xa'),attributes,{'tableName':_0x2d0b('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 6b7b8b0..4413643 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 _0x1596=['GetFaxQueue','FaxQueue','findAll','options','attributes','limit','map','model','include','ShowFaxQueue','find','raw','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch'];(function(_0x5d1787,_0x73afb){var _0x4b375d=function(_0x361ca1){while(--_0x361ca1){_0x5d1787['push'](_0x5d1787['shift']());}};_0x4b375d(++_0x73afb);}(_0x1596,0x1c8));var _0x6159=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1596[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6159('0x0'));var BPromise=require(_0x6159('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6159('0x2'));var db=require(_0x6159('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6159('0x4'));var config=require('../../config/environment');var jayson=require(_0x6159('0x5'));var client=jayson[_0x6159('0x6')][_0x6159('0x7')]({'port':0x232a});config['redis']=_[_0x6159('0x8')](config[_0x6159('0x9')],{'host':_0x6159('0xa'),'port':0x18eb});var socket=require(_0x6159('0xb'))(new Redis(config[_0x6159('0x9')]));require(_0x6159('0xc'))['register'](socket);function respondWithRpcPromise(_0x362303,_0x2bca37,_0x14f1b6){return new BPromise(function(_0x454781,_0xd6ea93){return client[_0x6159('0xd')](_0x362303,_0x14f1b6)[_0x6159('0xe')](function(_0x1e4a50){logger[_0x6159('0xf')](_0x6159('0x10'),_0x2bca37,'request\x20sent');logger[_0x6159('0x11')](_0x6159('0x12'),_0x2bca37,_0x6159('0x13'),JSON[_0x6159('0x14')](_0x1e4a50));if(_0x1e4a50[_0x6159('0x15')]){if(_0x1e4a50[_0x6159('0x15')]['code']===0x1f4){logger[_0x6159('0x15')]('FaxQueue,\x20%s,\x20%s',_0x2bca37,_0x1e4a50[_0x6159('0x15')]['message']);return _0xd6ea93(_0x1e4a50[_0x6159('0x15')]['message']);}logger[_0x6159('0x15')](_0x6159('0x10'),_0x2bca37,_0x1e4a50[_0x6159('0x15')]['message']);return _0x454781(_0x1e4a50[_0x6159('0x15')]['message']);}else{logger['info'](_0x6159('0x10'),_0x2bca37,_0x6159('0x13'));_0x454781(_0x1e4a50[_0x6159('0x16')][_0x6159('0x17')]);}})[_0x6159('0x18')](function(_0x309e1b){logger[_0x6159('0x15')](_0x6159('0x10'),_0x2bca37,_0x309e1b);_0xd6ea93(_0x309e1b);});});}exports[_0x6159('0x19')]=function(_0xc6553e){var _0x16277b=this;return new Promise(function(_0x3f9891,_0x13aab3){return db[_0x6159('0x1a')][_0x6159('0x1b')]({'raw':_0xc6553e[_0x6159('0x1c')]?_0xc6553e[_0x6159('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xc6553e['options']?_0xc6553e[_0x6159('0x1c')]['where']||null:null,'attributes':_0xc6553e['options']?_0xc6553e[_0x6159('0x1c')][_0x6159('0x1d')]||null:null,'limit':_0xc6553e[_0x6159('0x1c')]?_0xc6553e[_0x6159('0x1c')][_0x6159('0x1e')]||null:null,'include':_0xc6553e['options']?_0xc6553e[_0x6159('0x1c')]['include']?_[_0x6159('0x1f')](_0xc6553e[_0x6159('0x1c')]['include'],function(_0x255f1a){return{'model':db[_0x255f1a[_0x6159('0x20')]],'as':_0x255f1a['as'],'attributes':_0x255f1a[_0x6159('0x1d')],'include':_0x255f1a['include']?_['map'](_0x255f1a[_0x6159('0x21')],function(_0x3e0c82){return{'model':db[_0x3e0c82[_0x6159('0x20')]],'as':_0x3e0c82['as'],'attributes':_0x3e0c82['attributes'],'include':_0x3e0c82[_0x6159('0x21')]?_[_0x6159('0x1f')](_0x3e0c82[_0x6159('0x21')],function(_0x528420){return{'model':db[_0x528420[_0x6159('0x20')]],'as':_0x528420['as'],'attributes':_0x528420[_0x6159('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6159('0xe')](function(_0x401e2d){logger[_0x6159('0xf')](_0x6159('0x19'),_0xc6553e);logger[_0x6159('0x11')]('GetFaxQueue',_0xc6553e,JSON[_0x6159('0x14')](_0x401e2d));_0x3f9891(_0x401e2d);})[_0x6159('0x18')](function(_0xbd7188){logger['error'](_0x6159('0x19'),_0xbd7188[_0x6159('0x17')],_0xc6553e);_0x13aab3(_0x16277b[_0x6159('0x15')](0x1f4,_0xbd7188['message']));});});};exports[_0x6159('0x22')]=function(_0x1ba153){var _0xe69d94=this;return new Promise(function(_0x2d052a,_0x17807e){return db[_0x6159('0x1a')][_0x6159('0x23')]({'raw':_0x1ba153['options']?_0x1ba153['options'][_0x6159('0x24')]===undefined?!![]:![]:!![],'where':_0x1ba153[_0x6159('0x1c')]?_0x1ba153[_0x6159('0x1c')]['where']||null:null,'attributes':_0x1ba153[_0x6159('0x1c')]?_0x1ba153['options'][_0x6159('0x1d')]||null:null,'include':_0x1ba153[_0x6159('0x1c')]?_0x1ba153['options'][_0x6159('0x21')]?_['map'](_0x1ba153[_0x6159('0x1c')]['include'],function(_0x1c316f){return{'model':db[_0x1c316f[_0x6159('0x20')]],'as':_0x1c316f['as'],'attributes':_0x1c316f[_0x6159('0x1d')],'include':_0x1c316f['include']?_[_0x6159('0x1f')](_0x1c316f[_0x6159('0x21')],function(_0x46bb92){return{'model':db[_0x46bb92[_0x6159('0x20')]],'as':_0x46bb92['as'],'attributes':_0x46bb92[_0x6159('0x1d')],'include':_0x46bb92[_0x6159('0x21')]?_[_0x6159('0x1f')](_0x46bb92[_0x6159('0x21')],function(_0x688be8){return{'model':db[_0x688be8[_0x6159('0x20')]],'as':_0x688be8['as'],'attributes':_0x688be8[_0x6159('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6159('0xe')](function(_0x4b44bb){logger['info']('ShowFaxQueue',_0x1ba153);logger[_0x6159('0x11')](_0x6159('0x22'),_0x1ba153,JSON[_0x6159('0x14')](_0x4b44bb));_0x2d052a(_0x4b44bb);})[_0x6159('0x18')](function(_0x46f15f){logger['error'](_0x6159('0x22'),_0x46f15f[_0x6159('0x17')],_0x1ba153);_0x17807e(_0xe69d94[_0x6159('0x15')](0x1f4,_0x46f15f[_0x6159('0x17')]));});});}; \ No newline at end of file +var _0x95f1=['find','lodash','util','moment','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','FaxQueue','findAll','options','raw','where','attributes','limit','model','map','include','GetFaxQueue','stringify','ShowFaxQueue'];(function(_0x1b4912,_0x3e8bb9){var _0x48cac5=function(_0x55798b){while(--_0x55798b){_0x1b4912['push'](_0x1b4912['shift']());}};_0x48cac5(++_0x3e8bb9);}(_0x95f1,0x121));var _0x195f=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x95f1[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x195f('0x0'));var util=require(_0x195f('0x1'));var moment=require(_0x195f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x195f('0x3'))('rpc');var config=require(_0x195f('0x4'));var jayson=require(_0x195f('0x5'));var client=jayson['client'][_0x195f('0x6')]({'port':0x232a});config[_0x195f('0x7')]=_['defaults'](config[_0x195f('0x7')],{'host':_0x195f('0x8'),'port':0x18eb});var socket=require(_0x195f('0x9'))(new Redis(config[_0x195f('0x7')]));require(_0x195f('0xa'))[_0x195f('0xb')](socket);function respondWithRpcPromise(_0x5c31a1,_0x39770c,_0x1a93ed){return new BPromise(function(_0x5b838f,_0x5d7843){return client['request'](_0x5c31a1,_0x1a93ed)[_0x195f('0xc')](function(_0x44d0d9){logger[_0x195f('0xd')](_0x195f('0xe'),_0x39770c,_0x195f('0xf'));logger[_0x195f('0x10')](_0x195f('0x11'),_0x39770c,'request\x20sent',JSON['stringify'](_0x44d0d9));if(_0x44d0d9[_0x195f('0x12')]){if(_0x44d0d9[_0x195f('0x12')][_0x195f('0x13')]===0x1f4){logger['error'](_0x195f('0xe'),_0x39770c,_0x44d0d9[_0x195f('0x12')][_0x195f('0x14')]);return _0x5d7843(_0x44d0d9[_0x195f('0x12')][_0x195f('0x14')]);}logger[_0x195f('0x12')]('FaxQueue,\x20%s,\x20%s',_0x39770c,_0x44d0d9[_0x195f('0x12')][_0x195f('0x14')]);return _0x5b838f(_0x44d0d9[_0x195f('0x12')][_0x195f('0x14')]);}else{logger[_0x195f('0xd')](_0x195f('0xe'),_0x39770c,'request\x20sent');_0x5b838f(_0x44d0d9[_0x195f('0x15')]['message']);}})['catch'](function(_0x101bbf){logger[_0x195f('0x12')]('FaxQueue,\x20%s,\x20%s',_0x39770c,_0x101bbf);_0x5d7843(_0x101bbf);});});}exports['GetFaxQueue']=function(_0x6dca5e){var _0x14dcfd=this;return new Promise(function(_0x6b4975,_0x1be465){return db[_0x195f('0x16')][_0x195f('0x17')]({'raw':_0x6dca5e[_0x195f('0x18')]?_0x6dca5e[_0x195f('0x18')][_0x195f('0x19')]===undefined?!![]:![]:!![],'where':_0x6dca5e[_0x195f('0x18')]?_0x6dca5e['options'][_0x195f('0x1a')]||null:null,'attributes':_0x6dca5e[_0x195f('0x18')]?_0x6dca5e[_0x195f('0x18')][_0x195f('0x1b')]||null:null,'limit':_0x6dca5e[_0x195f('0x18')]?_0x6dca5e[_0x195f('0x18')][_0x195f('0x1c')]||null:null,'include':_0x6dca5e[_0x195f('0x18')]?_0x6dca5e[_0x195f('0x18')]['include']?_['map'](_0x6dca5e['options']['include'],function(_0x18d73d){return{'model':db[_0x18d73d[_0x195f('0x1d')]],'as':_0x18d73d['as'],'attributes':_0x18d73d['attributes'],'include':_0x18d73d['include']?_[_0x195f('0x1e')](_0x18d73d[_0x195f('0x1f')],function(_0x50720f){return{'model':db[_0x50720f[_0x195f('0x1d')]],'as':_0x50720f['as'],'attributes':_0x50720f[_0x195f('0x1b')],'include':_0x50720f[_0x195f('0x1f')]?_[_0x195f('0x1e')](_0x50720f[_0x195f('0x1f')],function(_0x58f9d2){return{'model':db[_0x58f9d2['model']],'as':_0x58f9d2['as'],'attributes':_0x58f9d2[_0x195f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x195f('0xc')](function(_0x187964){logger[_0x195f('0xd')](_0x195f('0x20'),_0x6dca5e);logger[_0x195f('0x10')](_0x195f('0x20'),_0x6dca5e,JSON[_0x195f('0x21')](_0x187964));_0x6b4975(_0x187964);})['catch'](function(_0xedf18b){logger[_0x195f('0x12')](_0x195f('0x20'),_0xedf18b['message'],_0x6dca5e);_0x1be465(_0x14dcfd[_0x195f('0x12')](0x1f4,_0xedf18b[_0x195f('0x14')]));});});};exports[_0x195f('0x22')]=function(_0x309f8e){var _0x4033ea=this;return new Promise(function(_0x2ab872,_0x1146a3){return db[_0x195f('0x16')][_0x195f('0x23')]({'raw':_0x309f8e[_0x195f('0x18')]?_0x309f8e[_0x195f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x309f8e[_0x195f('0x18')]?_0x309f8e[_0x195f('0x18')][_0x195f('0x1a')]||null:null,'attributes':_0x309f8e[_0x195f('0x18')]?_0x309f8e[_0x195f('0x18')][_0x195f('0x1b')]||null:null,'include':_0x309f8e[_0x195f('0x18')]?_0x309f8e[_0x195f('0x18')][_0x195f('0x1f')]?_[_0x195f('0x1e')](_0x309f8e[_0x195f('0x18')][_0x195f('0x1f')],function(_0x3f67d4){return{'model':db[_0x3f67d4[_0x195f('0x1d')]],'as':_0x3f67d4['as'],'attributes':_0x3f67d4[_0x195f('0x1b')],'include':_0x3f67d4[_0x195f('0x1f')]?_[_0x195f('0x1e')](_0x3f67d4[_0x195f('0x1f')],function(_0x43113d){return{'model':db[_0x43113d['model']],'as':_0x43113d['as'],'attributes':_0x43113d[_0x195f('0x1b')],'include':_0x43113d[_0x195f('0x1f')]?_[_0x195f('0x1e')](_0x43113d[_0x195f('0x1f')],function(_0xb76bc8){return{'model':db[_0xb76bc8[_0x195f('0x1d')]],'as':_0xb76bc8['as'],'attributes':_0xb76bc8['attributes']};}):[]};}):[]};}):[]:[]})[_0x195f('0xc')](function(_0x19e14f){logger[_0x195f('0xd')](_0x195f('0x22'),_0x309f8e);logger[_0x195f('0x10')](_0x195f('0x22'),_0x309f8e,JSON[_0x195f('0x21')](_0x19e14f));_0x2ab872(_0x19e14f);})['catch'](function(_0xd1c49){logger['error'](_0x195f('0x22'),_0xd1c49[_0x195f('0x14')],_0x309f8e);_0x1146a3(_0x4033ea[_0x195f('0x12')](0x1f4,_0xd1c49[_0x195f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c0f14c1..e05edef 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 _0xc45f=['save','update','emit','register','length','faxQueue:','./faxQueue.events'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xc45f,0xfb));var _0xfc45=function(_0x3b59a2,_0x1f3535){_0x3b59a2=_0x3b59a2-0x0;var _0x19e8a3=_0xc45f[_0x3b59a2];return _0x19e8a3;};'use strict';var FaxQueueEvents=require(_0xfc45('0x0'));var events=[_0xfc45('0x1'),'remove',_0xfc45('0x2')];function createListener(_0x30d5eb,_0x266e04){return function(_0x5c60da){_0x266e04[_0xfc45('0x3')](_0x30d5eb,_0x5c60da);};}function removeListener(_0x41a01e,_0x360bb2){return function(){FaxQueueEvents['removeListener'](_0x41a01e,_0x360bb2);};}exports[_0xfc45('0x4')]=function(_0x3d2149){for(var _0x44ae45=0x0,_0x316e06=events[_0xfc45('0x5')];_0x44ae45<_0x316e06;_0x44ae45++){var _0x12ab8c=events[_0x44ae45];var _0x60b982=createListener(_0xfc45('0x6')+_0x12ab8c,_0x3d2149);FaxQueueEvents['on'](_0x12ab8c,_0x60b982);}}; \ No newline at end of file +var _0x85d8=['remove','update','emit','length','faxQueue:','./faxQueue.events','save'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0x85d8,0x1b0));var _0x885d=function(_0x597b79,_0x3db52b){_0x597b79=_0x597b79-0x0;var _0x97717=_0x85d8[_0x597b79];return _0x97717;};'use strict';var FaxQueueEvents=require(_0x885d('0x0'));var events=[_0x885d('0x1'),_0x885d('0x2'),_0x885d('0x3')];function createListener(_0x3e5eab,_0x5bad48){return function(_0x328261){_0x5bad48[_0x885d('0x4')](_0x3e5eab,_0x328261);};}function removeListener(_0x320d7d,_0x3fe8a0){return function(){FaxQueueEvents['removeListener'](_0x320d7d,_0x3fe8a0);};}exports['register']=function(_0x186504){for(var _0x30dcc2=0x0,_0x3715b4=events[_0x885d('0x5')];_0x30dcc2<_0x3715b4;_0x30dcc2++){var _0x18428b=events[_0x30dcc2];var _0x11e6d7=createListener(_0x885d('0x6')+_0x18428b,_0x186504);FaxQueueEvents['on'](_0x18428b,_0x11e6d7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 89b3cfd..59a8ff0 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 _0x2675=['index','/describe','describe','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','/:id','update','delete','destroy','removeTeams','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated'];(function(_0x295849,_0x42b3eb){var _0x27d8d4=function(_0x375ae0){while(--_0x375ae0){_0x295849['push'](_0x295849['shift']());}};_0x27d8d4(++_0x42b3eb);}(_0x2675,0x75));var _0x5267=function(_0x87f64b,_0x146e71){_0x87f64b=_0x87f64b-0x0;var _0x426a73=_0x2675[_0x87f64b];return _0x426a73;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0x6')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller['getMembers']);router[_0x5267('0x6')]('/:id/teams',auth[_0x5267('0x7')](),controller['getTeams']);router[_0x5267('0x6')](_0x5267('0xc'),auth[_0x5267('0x7')](),controller[_0x5267('0xd')]);router[_0x5267('0xe')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xf')]);router[_0x5267('0xe')](_0x5267('0x10'),auth[_0x5267('0x7')](),controller[_0x5267('0x11')]);router[_0x5267('0xe')](_0x5267('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5267('0x12')](_0x5267('0x13'),auth[_0x5267('0x7')](),controller[_0x5267('0x14')]);router[_0x5267('0x15')](_0x5267('0x13'),auth[_0x5267('0x7')](),controller[_0x5267('0x16')]);router[_0x5267('0x15')](_0x5267('0x10'),auth[_0x5267('0x7')](),controller[_0x5267('0x17')]);router['delete'](_0x5267('0xc'),auth[_0x5267('0x7')](),controller['removeAgents']);module[_0x5267('0x18')]=router; \ No newline at end of file +var _0x2b29=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2b29,0x163));var _0x92b2=function(_0x356f7e,_0x2e4fb7){_0x356f7e=_0x356f7e-0x0;var _0x3fa2f3=_0x2b29[_0x356f7e];return _0x3fa2f3;};'use strict';var multer=require('multer');var util=require(_0x92b2('0x0'));var path=require(_0x92b2('0x1'));var timeout=require(_0x92b2('0x2'));var express=require(_0x92b2('0x3'));var router=express['Router']();var fs_extra=require(_0x92b2('0x4'));var auth=require(_0x92b2('0x5'));var interaction=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var controller=require(_0x92b2('0x8'));router[_0x92b2('0x9')]('/',auth['isAuthenticated'](),controller[_0x92b2('0xa')]);router['get'](_0x92b2('0xb'),auth[_0x92b2('0xc')](),controller['describe']);router[_0x92b2('0x9')](_0x92b2('0xd'),auth[_0x92b2('0xc')](),controller[_0x92b2('0xe')]);router['get'](_0x92b2('0xf'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x10')]);router[_0x92b2('0x9')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x12')]);router['get'](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x14')]);router['post']('/',auth[_0x92b2('0xc')](),controller[_0x92b2('0x15')]);router[_0x92b2('0x16')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x17')]);router['post'](_0x92b2('0x13'),auth['isAuthenticated'](),controller[_0x92b2('0x18')]);router[_0x92b2('0x19')](_0x92b2('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x92b2('0x1a')]('/:id',auth[_0x92b2('0xc')](),controller['destroy']);router[_0x92b2('0x1a')](_0x92b2('0x11'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1b')]);router[_0x92b2('0x1a')](_0x92b2('0x13'),auth[_0x92b2('0xc')](),controller[_0x92b2('0x1c')]);module[_0x92b2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 604905f..f11f087 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 _0x960d=['STRING','DATE','moment','exports'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x960d,0x1de));var _0xd960=function(_0x5af84e,_0x513ad0){_0x5af84e=_0x5af84e-0x0;var _0x5ce294=_0x960d[_0x5af84e];return _0x5ce294;};'use strict';var moment=require(_0xd960('0x0'));var Sequelize=require('sequelize');module[_0xd960('0x1')]={'uniqueid':{'type':Sequelize[_0xd960('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd960('0x2')]},'joinAt':{'type':Sequelize[_0xd960('0x3')]},'leaveAt':{'type':Sequelize[_0xd960('0x3')]},'acceptAt':{'type':Sequelize[_0xd960('0x3')]},'exitAt':{'type':Sequelize[_0xd960('0x3')]},'reason':{'type':Sequelize[_0xd960('0x2')]}}; \ No newline at end of file +var _0xaba8=['DATE','moment','sequelize','exports','STRING'];(function(_0xe7852b,_0x26a182){var _0x36eda7=function(_0x61840){while(--_0x61840){_0xe7852b['push'](_0xe7852b['shift']());}};_0x36eda7(++_0x26a182);}(_0xaba8,0x8d));var _0x8aba=function(_0x165254,_0x4d413f){_0x165254=_0x165254-0x0;var _0x283fc4=_0xaba8[_0x165254];return _0x283fc4;};'use strict';var moment=require(_0x8aba('0x0'));var Sequelize=require(_0x8aba('0x1'));module[_0x8aba('0x2')]={'uniqueid':{'type':Sequelize[_0x8aba('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8aba('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x8aba('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8aba('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index cf77c16..476483a 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 _0x132f=['merge','map','VIRTUAL','filter','options','findAll','rows','catch','params','rawAttributes','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','send','index','FaxQueueReport','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4423f6,_0x5e440f){var _0x5e8621=function(_0x14839f){while(--_0x14839f){_0x4423f6['push'](_0x4423f6['shift']());}};_0x5e8621(++_0x5e440f);}(_0x132f,0x182));var _0xf132=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x132f[_0x61b3ab];return _0x57097f;};'use strict';var emlformat=require(_0xf132('0x0'));var rimraf=require(_0xf132('0x1'));var zipdir=require(_0xf132('0x2'));var jsonpatch=require(_0xf132('0x3'));var rp=require(_0xf132('0x4'));var moment=require(_0xf132('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf132('0x6'));var util=require(_0xf132('0x7'));var path=require(_0xf132('0x8'));var sox=require(_0xf132('0x9'));var csv=require(_0xf132('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf132('0xb'));var _=require(_0xf132('0xc'));var squel=require('squel');var crypto=require(_0xf132('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf132('0xe'));var toCsv=require(_0xf132('0xa'));var querystring=require(_0xf132('0xf'));var Papa=require(_0xf132('0x10'));var Redis=require(_0xf132('0x11'));var authService=require(_0xf132('0x12'));var qs=require(_0xf132('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf132('0x14'))(_0xf132('0x15'));var utils=require(_0xf132('0x16'));var config=require(_0xf132('0x17'));var licenseUtil=require(_0xf132('0x18'));var db=require(_0xf132('0x19'))['db'];function respondWithStatusCode(_0x37d148,_0x1c79e0){_0x1c79e0=_0x1c79e0||0xcc;return function(_0x3f0f56){if(_0x3f0f56){return _0x37d148[_0xf132('0x1a')](_0x1c79e0);}return _0x37d148[_0xf132('0x1b')](_0x1c79e0)[_0xf132('0x1c')]();};}function respondWithResult(_0x5b58f8,_0x79d371){_0x79d371=_0x79d371||0xc8;return function(_0x259b76){if(_0x259b76){return _0x5b58f8['status'](_0x79d371)[_0xf132('0x1d')](_0x259b76);}};}function respondWithFilteredResult(_0x4edb9c,_0x50ed67){return function(_0x206e0c){if(_0x206e0c){var _0x24c138=typeof _0x50ed67[_0xf132('0x1e')]==='undefined'&&typeof _0x50ed67['limit']===_0xf132('0x1f');var _0x2f3c15=_0x206e0c[_0xf132('0x20')];var _0x31db78=_0x24c138?0x0:_0x50ed67['offset'];var _0x1af2db=_0x24c138?_0x206e0c[_0xf132('0x20')]:_0x50ed67[_0xf132('0x1e')]+_0x50ed67[_0xf132('0x21')];var _0x4b4f5d;if(_0x1af2db>=_0x2f3c15){_0x1af2db=_0x2f3c15;_0x4b4f5d=0xc8;}else{_0x4b4f5d=0xce;}_0x4edb9c[_0xf132('0x1b')](_0x4b4f5d);return _0x4edb9c['set'](_0xf132('0x22'),_0x31db78+'-'+_0x1af2db+'/'+_0x2f3c15)[_0xf132('0x1d')](_0x206e0c);}return null;};}function patchUpdates(_0x53b78a){return function(_0x129820){try{jsonpatch['apply'](_0x129820,_0x53b78a,!![]);}catch(_0x5aae77){return BPromise['reject'](_0x5aae77);}return _0x129820['save']();};}function saveUpdates(_0xbb67a7,_0x202dca){return function(_0x2fb27d){if(_0x2fb27d){return _0x2fb27d[_0xf132('0x23')](_0xbb67a7)[_0xf132('0x24')](function(_0x3f7613){return _0x3f7613;});}return null;};}function removeEntity(_0x209c99,_0x5c9958){return function(_0x3db8a0){if(_0x3db8a0){return _0x3db8a0[_0xf132('0x25')]()[_0xf132('0x24')](function(){_0x209c99[_0xf132('0x1b')](0xcc)[_0xf132('0x1c')]();});}};}function handleEntityNotFound(_0x271471,_0x6f16b1){return function(_0x4f1e5f){if(!_0x4f1e5f){_0x271471[_0xf132('0x1a')](0x194);}return _0x4f1e5f;};}function handleError(_0x2fdf22,_0x562770){_0x562770=_0x562770||0x1f4;return function(_0x5b01b5){logger[_0xf132('0x26')](_0x5b01b5[_0xf132('0x27')]);if(_0x5b01b5[_0xf132('0x28')]){delete _0x5b01b5[_0xf132('0x28')];}_0x2fdf22[_0xf132('0x1b')](_0x562770)[_0xf132('0x29')](_0x5b01b5);};}exports[_0xf132('0x2a')]=function(_0x1c1756,_0x395050){var _0x45fdf5={},_0x43a510={},_0x355212={'count':0x0,'rows':[]};var _0xeb393e=_['map'](db[_0xf132('0x2b')]['rawAttributes'],function(_0x4ff070){return{'name':_0x4ff070[_0xf132('0x2c')],'type':_0x4ff070['type']['key']};});_0x43a510[_0xf132('0x2d')]=_['map'](_0xeb393e,_0xf132('0x28'));_0x43a510[_0xf132('0x2e')]=_[_0xf132('0x2f')](_0x1c1756[_0xf132('0x2e')]);_0x43a510[_0xf132('0x30')]=_[_0xf132('0x31')](_0x43a510[_0xf132('0x2d')],_0x43a510[_0xf132('0x2e')]);_0x45fdf5[_0xf132('0x32')]=_[_0xf132('0x31')](_0x43a510[_0xf132('0x2d')],qs['fields'](_0x1c1756[_0xf132('0x2e')][_0xf132('0x33')]));_0x45fdf5['attributes']=_0x45fdf5[_0xf132('0x32')][_0xf132('0x34')]?_0x45fdf5['attributes']:_0x43a510['model'];if(!_0x1c1756[_0xf132('0x2e')][_0xf132('0x35')](_0xf132('0x36'))){_0x45fdf5[_0xf132('0x21')]=qs[_0xf132('0x21')](_0x1c1756[_0xf132('0x2e')][_0xf132('0x21')]);_0x45fdf5['offset']=qs['offset'](_0x1c1756['query']['offset']);}_0x45fdf5['order']=qs[_0xf132('0x37')](_0x1c1756['query'][_0xf132('0x37')]);_0x45fdf5[_0xf132('0x38')]=qs[_0xf132('0x30')](_[_0xf132('0x39')](_0x1c1756[_0xf132('0x2e')],_0x43a510[_0xf132('0x30')]),_0xeb393e);if(_0x1c1756['query']['filter']){_0x45fdf5['where']=_[_0xf132('0x3a')](_0x45fdf5['where'],{'$or':_[_0xf132('0x3b')](_0xeb393e,function(_0x54b933){if(_0x54b933['type']!==_0xf132('0x3c')){var _0x427430={};_0x427430[_0x54b933['name']]={'$like':'%'+_0x1c1756[_0xf132('0x2e')][_0xf132('0x3d')]+'%'};return _0x427430;}})});}_0x45fdf5=_[_0xf132('0x3a')]({},_0x45fdf5,_0x1c1756[_0xf132('0x3e')]);var _0x4c9d15={'where':_0x45fdf5['where']};return db['FaxQueueReport'][_0xf132('0x20')](_0x4c9d15)[_0xf132('0x24')](function(_0x1ae97e){_0x355212[_0xf132('0x20')]=_0x1ae97e;if(_0x1c1756['query']['includeAll']){_0x45fdf5['include']=[{'all':!![]}];}return db[_0xf132('0x2b')][_0xf132('0x3f')](_0x45fdf5);})[_0xf132('0x24')](function(_0x552c7e){_0x355212[_0xf132('0x40')]=_0x552c7e;return _0x355212;})[_0xf132('0x24')](respondWithFilteredResult(_0x395050,_0x45fdf5))[_0xf132('0x41')](handleError(_0x395050,null));};exports['show']=function(_0x121719,_0x4585fa){var _0x2ede85={'raw':!![],'where':{'id':_0x121719[_0xf132('0x42')]['id']}},_0x4c597f={};_0x4c597f['model']=_[_0xf132('0x2f')](db[_0xf132('0x2b')][_0xf132('0x43')]);_0x4c597f[_0xf132('0x2e')]=_[_0xf132('0x2f')](_0x121719['query']);_0x4c597f['filters']=_[_0xf132('0x31')](_0x4c597f['model'],_0x4c597f[_0xf132('0x2e')]);_0x2ede85['attributes']=_[_0xf132('0x31')](_0x4c597f['model'],qs[_0xf132('0x33')](_0x121719['query']['fields']));_0x2ede85[_0xf132('0x32')]=_0x2ede85[_0xf132('0x32')][_0xf132('0x34')]?_0x2ede85[_0xf132('0x32')]:_0x4c597f['model'];if(_0x121719['query'][_0xf132('0x44')]){_0x2ede85[_0xf132('0x45')]=[{'all':!![]}];}_0x2ede85=_[_0xf132('0x3a')]({},_0x2ede85,_0x121719[_0xf132('0x3e')]);return db[_0xf132('0x2b')][_0xf132('0x46')](_0x2ede85)[_0xf132('0x24')](handleEntityNotFound(_0x4585fa,null))[_0xf132('0x24')](respondWithResult(_0x4585fa,null))[_0xf132('0x41')](handleError(_0x4585fa,null));};exports['create']=function(_0x8d7d66,_0x184bf1){return db[_0xf132('0x2b')][_0xf132('0x47')](_0x8d7d66[_0xf132('0x48')],{})['then'](respondWithResult(_0x184bf1,0xc9))[_0xf132('0x41')](handleError(_0x184bf1,null));};exports[_0xf132('0x23')]=function(_0x3f22e2,_0x12d024){if(_0x3f22e2['body']['id']){delete _0x3f22e2[_0xf132('0x48')]['id'];}return db[_0xf132('0x2b')][_0xf132('0x46')]({'where':{'id':_0x3f22e2[_0xf132('0x42')]['id']}})['then'](handleEntityNotFound(_0x12d024,null))[_0xf132('0x24')](saveUpdates(_0x3f22e2[_0xf132('0x48')],null))['then'](respondWithResult(_0x12d024,null))[_0xf132('0x41')](handleError(_0x12d024,null));};exports[_0xf132('0x25')]=function(_0x425344,_0x3994d9){return db[_0xf132('0x2b')][_0xf132('0x46')]({'where':{'id':_0x425344['params']['id']}})['then'](handleEntityNotFound(_0x3994d9,null))[_0xf132('0x24')](removeEntity(_0x3994d9,null))['catch'](handleError(_0x3994d9,null));};exports[_0xf132('0x49')]=function(_0x5b68e2,_0x875fb0){return db[_0xf132('0x2b')][_0xf132('0x49')]()[_0xf132('0x24')](respondWithResult(_0x875fb0,null))[_0xf132('0x41')](handleError(_0x875fb0,null));}; \ No newline at end of file +var _0x2c6a=['fields','attributes','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','FaxQueueReport','findAll','show','params','include','merge','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','update','destroy','then','error','stack','name','send','index','fieldName','type','key','map','query','keys','filters','intersection','model'];(function(_0x503185,_0x20d261){var _0xb29eff=function(_0x15e65e){while(--_0x15e65e){_0x503185['push'](_0x503185['shift']());}};_0xb29eff(++_0x20d261);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xa2c6('0x0'));var rimraf=require(_0xa2c6('0x1'));var zipdir=require(_0xa2c6('0x2'));var jsonpatch=require(_0xa2c6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa2c6('0x4'));var Mustache=require('mustache');var util=require(_0xa2c6('0x5'));var path=require(_0xa2c6('0x6'));var sox=require(_0xa2c6('0x7'));var csv=require(_0xa2c6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa2c6('0x9'));var squel=require(_0xa2c6('0xa'));var crypto=require(_0xa2c6('0xb'));var jsforce=require(_0xa2c6('0xc'));var deskjs=require(_0xa2c6('0xd'));var toCsv=require(_0xa2c6('0x8'));var querystring=require(_0xa2c6('0xe'));var Papa=require('papaparse');var Redis=require(_0xa2c6('0xf'));var authService=require(_0xa2c6('0x10'));var qs=require(_0xa2c6('0x11'));var as=require(_0xa2c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2c6('0x13'))('api');var utils=require(_0xa2c6('0x14'));var config=require(_0xa2c6('0x15'));var licenseUtil=require(_0xa2c6('0x16'));var db=require(_0xa2c6('0x17'))['db'];function respondWithStatusCode(_0x4955be,_0x2897ee){_0x2897ee=_0x2897ee||0xcc;return function(_0x3234b6){if(_0x3234b6){return _0x4955be[_0xa2c6('0x18')](_0x2897ee);}return _0x4955be['status'](_0x2897ee)[_0xa2c6('0x19')]();};}function respondWithResult(_0x1dc749,_0x3ebb15){_0x3ebb15=_0x3ebb15||0xc8;return function(_0x1bc1dc){if(_0x1bc1dc){return _0x1dc749[_0xa2c6('0x1a')](_0x3ebb15)['json'](_0x1bc1dc);}};}function respondWithFilteredResult(_0x412229,_0x374404){return function(_0x43b97b){if(_0x43b97b){var _0x354dff=typeof _0x374404[_0xa2c6('0x1b')]===_0xa2c6('0x1c')&&typeof _0x374404['limit']===_0xa2c6('0x1c');var _0x4d49f8=_0x43b97b[_0xa2c6('0x1d')];var _0x114424=_0x354dff?0x0:_0x374404[_0xa2c6('0x1b')];var _0x2479bd=_0x354dff?_0x43b97b[_0xa2c6('0x1d')]:_0x374404[_0xa2c6('0x1b')]+_0x374404[_0xa2c6('0x1e')];var _0x2b3d6e;if(_0x2479bd>=_0x4d49f8){_0x2479bd=_0x4d49f8;_0x2b3d6e=0xc8;}else{_0x2b3d6e=0xce;}_0x412229['status'](_0x2b3d6e);return _0x412229[_0xa2c6('0x1f')](_0xa2c6('0x20'),_0x114424+'-'+_0x2479bd+'/'+_0x4d49f8)[_0xa2c6('0x21')](_0x43b97b);}return null;};}function patchUpdates(_0x21ec92){return function(_0x2a2fc9){try{jsonpatch['apply'](_0x2a2fc9,_0x21ec92,!![]);}catch(_0x35dd2a){return BPromise[_0xa2c6('0x22')](_0x35dd2a);}return _0x2a2fc9['save']();};}function saveUpdates(_0x20a86e,_0x58530d){return function(_0x8b2eea){if(_0x8b2eea){return _0x8b2eea[_0xa2c6('0x23')](_0x20a86e)['then'](function(_0x291057){return _0x291057;});}return null;};}function removeEntity(_0x5aabe2,_0x19a765){return function(_0x168de7){if(_0x168de7){return _0x168de7[_0xa2c6('0x24')]()[_0xa2c6('0x25')](function(){_0x5aabe2[_0xa2c6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed646,_0x4e9dcc){return function(_0x14c01e){if(!_0x14c01e){_0x2ed646[_0xa2c6('0x18')](0x194);}return _0x14c01e;};}function handleError(_0x5d687a,_0x2cedee){_0x2cedee=_0x2cedee||0x1f4;return function(_0x4485d4){logger[_0xa2c6('0x26')](_0x4485d4[_0xa2c6('0x27')]);if(_0x4485d4[_0xa2c6('0x28')]){delete _0x4485d4[_0xa2c6('0x28')];}_0x5d687a[_0xa2c6('0x1a')](_0x2cedee)[_0xa2c6('0x29')](_0x4485d4);};}exports[_0xa2c6('0x2a')]=function(_0x57d67a,_0x1655f8){var _0x46b082={},_0x233284={},_0x3702ec={'count':0x0,'rows':[]};var _0x598341=_['map'](db['FaxQueueReport']['rawAttributes'],function(_0xa6df69){return{'name':_0xa6df69[_0xa2c6('0x2b')],'type':_0xa6df69[_0xa2c6('0x2c')][_0xa2c6('0x2d')]};});_0x233284['model']=_[_0xa2c6('0x2e')](_0x598341,_0xa2c6('0x28'));_0x233284[_0xa2c6('0x2f')]=_[_0xa2c6('0x30')](_0x57d67a[_0xa2c6('0x2f')]);_0x233284[_0xa2c6('0x31')]=_[_0xa2c6('0x32')](_0x233284[_0xa2c6('0x33')],_0x233284[_0xa2c6('0x2f')]);_0x46b082['attributes']=_[_0xa2c6('0x32')](_0x233284[_0xa2c6('0x33')],qs[_0xa2c6('0x34')](_0x57d67a['query'][_0xa2c6('0x34')]));_0x46b082[_0xa2c6('0x35')]=_0x46b082['attributes']['length']?_0x46b082[_0xa2c6('0x35')]:_0x233284[_0xa2c6('0x33')];if(!_0x57d67a[_0xa2c6('0x2f')][_0xa2c6('0x36')]('nolimit')){_0x46b082[_0xa2c6('0x1e')]=qs[_0xa2c6('0x1e')](_0x57d67a[_0xa2c6('0x2f')][_0xa2c6('0x1e')]);_0x46b082[_0xa2c6('0x1b')]=qs[_0xa2c6('0x1b')](_0x57d67a[_0xa2c6('0x2f')]['offset']);}_0x46b082[_0xa2c6('0x37')]=qs[_0xa2c6('0x38')](_0x57d67a[_0xa2c6('0x2f')][_0xa2c6('0x38')]);_0x46b082[_0xa2c6('0x39')]=qs[_0xa2c6('0x31')](_[_0xa2c6('0x3a')](_0x57d67a['query'],_0x233284[_0xa2c6('0x31')]),_0x598341);if(_0x57d67a[_0xa2c6('0x2f')]['filter']){_0x46b082[_0xa2c6('0x39')]=_['merge'](_0x46b082[_0xa2c6('0x39')],{'$or':_[_0xa2c6('0x2e')](_0x598341,function(_0x5d23d9){if(_0x5d23d9[_0xa2c6('0x2c')]!==_0xa2c6('0x3b')){var _0x5a7db0={};_0x5a7db0[_0x5d23d9[_0xa2c6('0x28')]]={'$like':'%'+_0x57d67a[_0xa2c6('0x2f')][_0xa2c6('0x3c')]+'%'};return _0x5a7db0;}})});}_0x46b082=_['merge']({},_0x46b082,_0x57d67a[_0xa2c6('0x3d')]);var _0x56561a={'where':_0x46b082['where']};return db[_0xa2c6('0x3e')][_0xa2c6('0x1d')](_0x56561a)[_0xa2c6('0x25')](function(_0x27ed9e){_0x3702ec[_0xa2c6('0x1d')]=_0x27ed9e;if(_0x57d67a[_0xa2c6('0x2f')]['includeAll']){_0x46b082['include']=[{'all':!![]}];}return db[_0xa2c6('0x3e')][_0xa2c6('0x3f')](_0x46b082);})['then'](function(_0x2b0267){_0x3702ec['rows']=_0x2b0267;return _0x3702ec;})['then'](respondWithFilteredResult(_0x1655f8,_0x46b082))['catch'](handleError(_0x1655f8,null));};exports[_0xa2c6('0x40')]=function(_0x219942,_0x55b0fb){var _0x2a2895={'raw':!![],'where':{'id':_0x219942[_0xa2c6('0x41')]['id']}},_0x25acce={};_0x25acce[_0xa2c6('0x33')]=_['keys'](db[_0xa2c6('0x3e')]['rawAttributes']);_0x25acce[_0xa2c6('0x2f')]=_[_0xa2c6('0x30')](_0x219942[_0xa2c6('0x2f')]);_0x25acce['filters']=_['intersection'](_0x25acce[_0xa2c6('0x33')],_0x25acce[_0xa2c6('0x2f')]);_0x2a2895[_0xa2c6('0x35')]=_[_0xa2c6('0x32')](_0x25acce[_0xa2c6('0x33')],qs[_0xa2c6('0x34')](_0x219942[_0xa2c6('0x2f')][_0xa2c6('0x34')]));_0x2a2895[_0xa2c6('0x35')]=_0x2a2895['attributes']['length']?_0x2a2895[_0xa2c6('0x35')]:_0x25acce['model'];if(_0x219942[_0xa2c6('0x2f')]['includeAll']){_0x2a2895[_0xa2c6('0x42')]=[{'all':!![]}];}_0x2a2895=_[_0xa2c6('0x43')]({},_0x2a2895,_0x219942[_0xa2c6('0x3d')]);return db[_0xa2c6('0x3e')][_0xa2c6('0x44')](_0x2a2895)[_0xa2c6('0x25')](handleEntityNotFound(_0x55b0fb,null))['then'](respondWithResult(_0x55b0fb,null))[_0xa2c6('0x45')](handleError(_0x55b0fb,null));};exports[_0xa2c6('0x46')]=function(_0x4a66cb,_0x4fcf2e){return db[_0xa2c6('0x3e')]['create'](_0x4a66cb[_0xa2c6('0x47')],{})[_0xa2c6('0x25')](respondWithResult(_0x4fcf2e,0xc9))[_0xa2c6('0x45')](handleError(_0x4fcf2e,null));};exports['update']=function(_0x24e819,_0x2d7341){if(_0x24e819[_0xa2c6('0x47')]['id']){delete _0x24e819[_0xa2c6('0x47')]['id'];}return db[_0xa2c6('0x3e')]['find']({'where':{'id':_0x24e819['params']['id']}})[_0xa2c6('0x25')](handleEntityNotFound(_0x2d7341,null))[_0xa2c6('0x25')](saveUpdates(_0x24e819['body'],null))['then'](respondWithResult(_0x2d7341,null))['catch'](handleError(_0x2d7341,null));};exports[_0xa2c6('0x24')]=function(_0x106c29,_0x56fd27){return db[_0xa2c6('0x3e')]['find']({'where':{'id':_0x106c29[_0xa2c6('0x41')]['id']}})[_0xa2c6('0x25')](handleEntityNotFound(_0x56fd27,null))[_0xa2c6('0x25')](removeEntity(_0x56fd27,null))[_0xa2c6('0x45')](handleError(_0x56fd27,null));};exports[_0xa2c6('0x48')]=function(_0x153f3d,_0x135cde){return db['FaxQueueReport'][_0xa2c6('0x48')]()[_0xa2c6('0x25')](respondWithResult(_0x135cde,null))[_0xa2c6('0x45')](handleError(_0x135cde,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 937fad7..5b26b3b 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x28af35,_0x255b58){var _0x213e7f=function(_0x4edeb2){while(--_0x4edeb2){_0x28af35['push'](_0x28af35['shift']());}};_0x213e7f(++_0x255b58);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','../../config/logger','api'];(function(_0x172504,_0x45618c){var _0x209a5e=function(_0xaa4a49){while(--_0xaa4a49){_0x172504['push'](_0x172504['shift']());}};_0x209a5e(++_0x45618c);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1d1b15,_0x5ef518){_0x1d1b15=_0x1d1b15-0x0;var _0x1801d3=_0x7fbe[_0x1d1b15];return _0x1801d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xe7fb('0xc'),'fields':[_0xe7fb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index b85d960..b9e2634 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 _0x45ef=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateFaxQueueReport','FaxQueueReport','body','options','raw','debug','catch','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment'];(function(_0x164d4e,_0x2c337f){var _0x46eac4=function(_0x166dc3){while(--_0x166dc3){_0x164d4e['push'](_0x164d4e['shift']());}};_0x46eac4(++_0x2c337f);}(_0x45ef,0x129));var _0xf45e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x45ef[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xf45e('0x0'));var util=require(_0xf45e('0x1'));var moment=require(_0xf45e('0x2'));var BPromise=require(_0xf45e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf45e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf45e('0x5'));var logger=require(_0xf45e('0x6'))(_0xf45e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf45e('0x8'));var client=jayson['client'][_0xf45e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34bced,_0x5875a2,_0x4ef33f){return new BPromise(function(_0x1ddf2b,_0x452e0e){return client[_0xf45e('0xa')](_0x34bced,_0x4ef33f)[_0xf45e('0xb')](function(_0x1f7edc){logger[_0xf45e('0xc')](_0xf45e('0xd'),_0x5875a2,'request\x20sent');logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x5875a2,_0xf45e('0xe'),JSON[_0xf45e('0xf')](_0x1f7edc));if(_0x1f7edc[_0xf45e('0x10')]){if(_0x1f7edc['error'][_0xf45e('0x11')]===0x1f4){logger[_0xf45e('0x10')](_0xf45e('0xd'),_0x5875a2,_0x1f7edc[_0xf45e('0x10')][_0xf45e('0x12')]);return _0x452e0e(_0x1f7edc[_0xf45e('0x10')][_0xf45e('0x12')]);}logger['error'](_0xf45e('0xd'),_0x5875a2,_0x1f7edc[_0xf45e('0x10')][_0xf45e('0x12')]);return _0x1ddf2b(_0x1f7edc[_0xf45e('0x10')]['message']);}else{logger[_0xf45e('0xc')](_0xf45e('0xd'),_0x5875a2,_0xf45e('0xe'));_0x1ddf2b(_0x1f7edc['result'][_0xf45e('0x12')]);}})['catch'](function(_0x2231c4){logger['error'](_0xf45e('0xd'),_0x5875a2,_0x2231c4);_0x452e0e(_0x2231c4);});});}exports[_0xf45e('0x13')]=function(_0x475ddd){var _0x1edab2=this;return new Promise(function(_0xfa6e3c,_0x2b4852){return db[_0xf45e('0x14')]['create'](_0x475ddd[_0xf45e('0x15')],{'raw':_0x475ddd[_0xf45e('0x16')]?_0x475ddd['options'][_0xf45e('0x17')]===undefined?!![]:![]:!![]})[_0xf45e('0xb')](function(_0x311668){logger['info'](_0xf45e('0x13'),_0x475ddd);logger[_0xf45e('0x18')](_0xf45e('0x13'),_0x475ddd,JSON[_0xf45e('0xf')](_0x311668));_0xfa6e3c(_0x311668);})[_0xf45e('0x19')](function(_0x2aac18){logger[_0xf45e('0x10')](_0xf45e('0x13'),_0x2aac18[_0xf45e('0x12')],_0x475ddd);_0x2b4852(_0x1edab2[_0xf45e('0x10')](0x1f4,_0x2aac18[_0xf45e('0x12')]));});});};exports[_0xf45e('0x1a')]=function(_0x488b78){var _0x3ddfbd=this;return new Promise(function(_0x27d9d8,_0x5e722d){return db['FaxQueueReport'][_0xf45e('0x1b')](_0x488b78[_0xf45e('0x15')],{'raw':_0x488b78['options']?_0x488b78['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x488b78[_0xf45e('0x16')]?_0x488b78[_0xf45e('0x16')]['where']||null:null,'attributes':_0x488b78[_0xf45e('0x16')]?_0x488b78[_0xf45e('0x16')][_0xf45e('0x1c')]||null:null,'limit':_0x488b78[_0xf45e('0x16')]?_0x488b78[_0xf45e('0x16')][_0xf45e('0x1d')]||null:null})[_0xf45e('0xb')](function(_0x12c1e3){logger[_0xf45e('0xc')]('UpdateFaxQueueReport',_0x488b78);logger['debug']('UpdateFaxQueueReport',_0x488b78,JSON[_0xf45e('0xf')](_0x12c1e3));_0x27d9d8(_0x12c1e3);})[_0xf45e('0x19')](function(_0x59aba0){logger[_0xf45e('0x10')]('UpdateFaxQueueReport',_0x59aba0[_0xf45e('0x12')],_0x488b78);_0x5e722d(_0x3ddfbd['error'](0x1f4,_0x59aba0[_0xf45e('0x12')]));});});}; \ No newline at end of file +var _0xe9cf=['request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateFaxQueueReport','create','body','options','raw','catch','UpdateFaxQueueReport','FaxQueueReport','attributes','limit','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe9cf,0x1a8));var _0xfe9c=function(_0x1d0b20,_0x15898a){_0x1d0b20=_0x1d0b20-0x0;var _0x563b0d=_0xe9cf[_0x1d0b20];return _0x563b0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe9c('0x0'));var BPromise=require(_0xfe9c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9c('0x2'));var db=require(_0xfe9c('0x3'))['db'];var utils=require(_0xfe9c('0x4'));var logger=require(_0xfe9c('0x5'))(_0xfe9c('0x6'));var config=require('../../config/environment');var jayson=require(_0xfe9c('0x7'));var client=jayson[_0xfe9c('0x8')][_0xfe9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a918c,_0x5e9be6,_0x42aa3f){return new BPromise(function(_0x2a79e2,_0x93cfbb){return client[_0xfe9c('0xa')](_0x1a918c,_0x42aa3f)[_0xfe9c('0xb')](function(_0x4ccaa2){logger[_0xfe9c('0xc')](_0xfe9c('0xd'),_0x5e9be6,_0xfe9c('0xe'));logger[_0xfe9c('0xf')](_0xfe9c('0x10'),_0x5e9be6,'request\x20sent',JSON[_0xfe9c('0x11')](_0x4ccaa2));if(_0x4ccaa2[_0xfe9c('0x12')]){if(_0x4ccaa2[_0xfe9c('0x12')][_0xfe9c('0x13')]===0x1f4){logger[_0xfe9c('0x12')](_0xfe9c('0xd'),_0x5e9be6,_0x4ccaa2[_0xfe9c('0x12')]['message']);return _0x93cfbb(_0x4ccaa2['error'][_0xfe9c('0x14')]);}logger[_0xfe9c('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x5e9be6,_0x4ccaa2[_0xfe9c('0x12')]['message']);return _0x2a79e2(_0x4ccaa2[_0xfe9c('0x12')]['message']);}else{logger[_0xfe9c('0xc')](_0xfe9c('0xd'),_0x5e9be6,'request\x20sent');_0x2a79e2(_0x4ccaa2['result'][_0xfe9c('0x14')]);}})['catch'](function(_0x6dda45){logger[_0xfe9c('0x12')](_0xfe9c('0xd'),_0x5e9be6,_0x6dda45);_0x93cfbb(_0x6dda45);});});}exports[_0xfe9c('0x15')]=function(_0x5603bf){var _0x3a49e6=this;return new Promise(function(_0x116a2d,_0x3212d0){return db['FaxQueueReport'][_0xfe9c('0x16')](_0x5603bf[_0xfe9c('0x17')],{'raw':_0x5603bf[_0xfe9c('0x18')]?_0x5603bf[_0xfe9c('0x18')][_0xfe9c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2387fb){logger['info'](_0xfe9c('0x15'),_0x5603bf);logger['debug']('CreateFaxQueueReport',_0x5603bf,JSON[_0xfe9c('0x11')](_0x2387fb));_0x116a2d(_0x2387fb);})[_0xfe9c('0x1a')](function(_0xc2ef1d){logger[_0xfe9c('0x12')]('CreateFaxQueueReport',_0xc2ef1d['message'],_0x5603bf);_0x3212d0(_0x3a49e6[_0xfe9c('0x12')](0x1f4,_0xc2ef1d[_0xfe9c('0x14')]));});});};exports[_0xfe9c('0x1b')]=function(_0x3f5be4){var _0x57f7e0=this;return new Promise(function(_0x274954,_0x45fa3e){return db[_0xfe9c('0x1c')]['update'](_0x3f5be4[_0xfe9c('0x17')],{'raw':_0x3f5be4[_0xfe9c('0x18')]?_0x3f5be4['options'][_0xfe9c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5be4[_0xfe9c('0x18')]?_0x3f5be4[_0xfe9c('0x18')]['where']||null:null,'attributes':_0x3f5be4[_0xfe9c('0x18')]?_0x3f5be4['options'][_0xfe9c('0x1d')]||null:null,'limit':_0x3f5be4['options']?_0x3f5be4['options'][_0xfe9c('0x1e')]||null:null})['then'](function(_0x13e3f7){logger[_0xfe9c('0xc')](_0xfe9c('0x1b'),_0x3f5be4);logger[_0xfe9c('0xf')](_0xfe9c('0x1b'),_0x3f5be4,JSON[_0xfe9c('0x11')](_0x13e3f7));_0x274954(_0x13e3f7);})[_0xfe9c('0x1a')](function(_0x568c9a){logger[_0xfe9c('0x12')](_0xfe9c('0x1b'),_0x568c9a['message'],_0x3f5be4);_0x45fa3e(_0x57f7e0[_0xfe9c('0x12')](0x1f4,_0x568c9a[_0xfe9c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 5f44da8..441c471 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 _0xad22=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x374f65,_0x506f9e){var _0x412fba=function(_0x3f5b9c){while(--_0x3f5b9c){_0x374f65['push'](_0x374f65['shift']());}};_0x412fba(++_0x506f9e);}(_0xad22,0xf2));var _0x2ad2=function(_0x2a453b,_0x479c50){_0x2a453b=_0x2a453b-0x0;var _0x132f79=_0xad22[_0x2a453b];return _0x132f79;};'use strict';var multer=require(_0x2ad2('0x0'));var util=require('util');var path=require(_0x2ad2('0x1'));var timeout=require(_0x2ad2('0x2'));var express=require(_0x2ad2('0x3'));var router=express['Router']();var fs_extra=require(_0x2ad2('0x4'));var auth=require(_0x2ad2('0x5'));var interaction=require(_0x2ad2('0x6'));var config=require(_0x2ad2('0x7'));var controller=require(_0x2ad2('0x8'));router[_0x2ad2('0x9')]('/',auth[_0x2ad2('0xa')](),controller[_0x2ad2('0xb')]);router[_0x2ad2('0x9')](_0x2ad2('0xc'),auth[_0x2ad2('0xa')](),controller[_0x2ad2('0xd')]);router[_0x2ad2('0x9')](_0x2ad2('0xe'),auth['isAuthenticated'](),controller[_0x2ad2('0xf')]);router[_0x2ad2('0x10')]('/',auth['isAuthenticated'](),controller[_0x2ad2('0x11')]);router[_0x2ad2('0x12')](_0x2ad2('0xe'),auth[_0x2ad2('0xa')](),controller[_0x2ad2('0x13')]);router['delete'](_0x2ad2('0xe'),auth['isAuthenticated'](),controller[_0x2ad2('0x14')]);module[_0x2ad2('0x15')]=router; \ No newline at end of file +var _0xed35=['../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x12a4e0,_0x2f2d61){var _0x3ef737=function(_0x578e6a){while(--_0x578e6a){_0x12a4e0['push'](_0x12a4e0['shift']());}};_0x3ef737(++_0x2f2d61);}(_0xed35,0x13f));var _0x5ed3=function(_0x4c14ac,_0xcb9a8c){_0x4c14ac=_0x4c14ac-0x0;var _0x31f3f3=_0xed35[_0x4c14ac];return _0x31f3f3;};'use strict';var multer=require(_0x5ed3('0x0'));var util=require(_0x5ed3('0x1'));var path=require(_0x5ed3('0x2'));var timeout=require(_0x5ed3('0x3'));var express=require(_0x5ed3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5ed3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x5ed3('0x6')]('/',auth[_0x5ed3('0x7')](),controller[_0x5ed3('0x8')]);router[_0x5ed3('0x6')](_0x5ed3('0x9'),auth[_0x5ed3('0x7')](),controller[_0x5ed3('0xa')]);router[_0x5ed3('0x6')](_0x5ed3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5ed3('0xc')]('/',auth[_0x5ed3('0x7')](),controller[_0x5ed3('0xd')]);router[_0x5ed3('0xe')](_0x5ed3('0xb'),auth[_0x5ed3('0x7')](),controller[_0x5ed3('0xf')]);router[_0x5ed3('0x10')](_0x5ed3('0xb'),auth[_0x5ed3('0x7')](),controller[_0x5ed3('0x11')]);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 0b8122c..534fc78 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x5ab5bd,_0x12c446){var _0x3dddd8=function(_0x5ea7d0){while(--_0x5ea7d0){_0x5ab5bd['push'](_0x5ab5bd['shift']());}};_0x3dddd8(++_0x12c446);}(_0x34e8,0x12c));var _0x834e=function(_0x5883d1,_0x286e4a){_0x5883d1=_0x5883d1-0x0;var _0x1fac4e=_0x34e8[_0x5883d1];return _0x1fac4e;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x34ce26,_0x16daab){var _0x11a16c=function(_0x15a995){while(--_0x15a995){_0x34ce26['push'](_0x34ce26['shift']());}};_0x11a16c(++_0x16daab);}(_0x4b84,0x1cc));var _0x44b8=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x4b84[_0x22377a];return _0x36f105;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index c3b7cc3..931177a 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 _0x9c9e=['bluebird','mustache','util','path','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','FaxTransferReport','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9c9e,0x172));var _0xe9c9=function(_0x5629b6,_0x2f11a6){_0x5629b6=_0x5629b6-0x0;var _0x333cd6=_0x9c9e[_0x5629b6];return _0x333cd6;};'use strict';var emlformat=require(_0xe9c9('0x0'));var rimraf=require(_0xe9c9('0x1'));var zipdir=require(_0xe9c9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9c9('0x3'));var moment=require(_0xe9c9('0x4'));var BPromise=require(_0xe9c9('0x5'));var Mustache=require(_0xe9c9('0x6'));var util=require(_0xe9c9('0x7'));var path=require(_0xe9c9('0x8'));var sox=require('sox');var csv=require(_0xe9c9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9c9('0xa'));var squel=require('squel');var crypto=require(_0xe9c9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe9c9('0xc'));var toCsv=require(_0xe9c9('0x9'));var querystring=require(_0xe9c9('0xd'));var Papa=require('papaparse');var Redis=require(_0xe9c9('0xe'));var authService=require(_0xe9c9('0xf'));var qs=require(_0xe9c9('0x10'));var as=require(_0xe9c9('0x11'));var hardwareService=require(_0xe9c9('0x12'));var logger=require(_0xe9c9('0x13'))(_0xe9c9('0x14'));var utils=require(_0xe9c9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe9c9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xccab7b,_0x25567c){_0x25567c=_0x25567c||0xcc;return function(_0x58d5ae){if(_0x58d5ae){return _0xccab7b[_0xe9c9('0x17')](_0x25567c);}return _0xccab7b[_0xe9c9('0x18')](_0x25567c)[_0xe9c9('0x19')]();};}function respondWithResult(_0x46ae27,_0x5b05a4){_0x5b05a4=_0x5b05a4||0xc8;return function(_0x3a5f77){if(_0x3a5f77){return _0x46ae27[_0xe9c9('0x18')](_0x5b05a4)['json'](_0x3a5f77);}};}function respondWithFilteredResult(_0x30ce0a,_0x168814){return function(_0x39c524){if(_0x39c524){var _0xa32ac9=typeof _0x168814['offset']===_0xe9c9('0x1a')&&typeof _0x168814[_0xe9c9('0x1b')]===_0xe9c9('0x1a');var _0x42d6d7=_0x39c524[_0xe9c9('0x1c')];var _0x311858=_0xa32ac9?0x0:_0x168814['offset'];var _0x210eef=_0xa32ac9?_0x39c524[_0xe9c9('0x1c')]:_0x168814[_0xe9c9('0x1d')]+_0x168814[_0xe9c9('0x1b')];var _0xe71f79;if(_0x210eef>=_0x42d6d7){_0x210eef=_0x42d6d7;_0xe71f79=0xc8;}else{_0xe71f79=0xce;}_0x30ce0a[_0xe9c9('0x18')](_0xe71f79);return _0x30ce0a[_0xe9c9('0x1e')](_0xe9c9('0x1f'),_0x311858+'-'+_0x210eef+'/'+_0x42d6d7)[_0xe9c9('0x20')](_0x39c524);}return null;};}function patchUpdates(_0x4e49c1){return function(_0x2d7945){try{jsonpatch[_0xe9c9('0x21')](_0x2d7945,_0x4e49c1,!![]);}catch(_0x3af5c6){return BPromise[_0xe9c9('0x22')](_0x3af5c6);}return _0x2d7945['save']();};}function saveUpdates(_0x45a6b7,_0x297d5f){return function(_0x459442){if(_0x459442){return _0x459442[_0xe9c9('0x23')](_0x45a6b7)[_0xe9c9('0x24')](function(_0x873a32){return _0x873a32;});}return null;};}function removeEntity(_0x28787e,_0x30588b){return function(_0x5e301a){if(_0x5e301a){return _0x5e301a[_0xe9c9('0x25')]()[_0xe9c9('0x24')](function(){_0x28787e[_0xe9c9('0x18')](0xcc)[_0xe9c9('0x19')]();});}};}function handleEntityNotFound(_0x53e872,_0xae10d5){return function(_0x192965){if(!_0x192965){_0x53e872[_0xe9c9('0x17')](0x194);}return _0x192965;};}function handleError(_0x2da6d5,_0xa9effe){_0xa9effe=_0xa9effe||0x1f4;return function(_0x4e779f){logger[_0xe9c9('0x26')](_0x4e779f[_0xe9c9('0x27')]);if(_0x4e779f[_0xe9c9('0x28')]){delete _0x4e779f[_0xe9c9('0x28')];}_0x2da6d5[_0xe9c9('0x18')](_0xa9effe)[_0xe9c9('0x29')](_0x4e779f);};}exports[_0xe9c9('0x2a')]=function(_0xc6149c,_0x43de46){var _0xf95fb6={},_0x10715a={},_0x3b5044={'count':0x0,'rows':[]};var _0x202a34=_[_0xe9c9('0x2b')](db['FaxTransferReport'][_0xe9c9('0x2c')],function(_0x100a25){return{'name':_0x100a25[_0xe9c9('0x2d')],'type':_0x100a25[_0xe9c9('0x2e')]['key']};});_0x10715a[_0xe9c9('0x2f')]=_['map'](_0x202a34,_0xe9c9('0x28'));_0x10715a[_0xe9c9('0x30')]=_[_0xe9c9('0x31')](_0xc6149c[_0xe9c9('0x30')]);_0x10715a[_0xe9c9('0x32')]=_[_0xe9c9('0x33')](_0x10715a['model'],_0x10715a[_0xe9c9('0x30')]);_0xf95fb6[_0xe9c9('0x34')]=_[_0xe9c9('0x33')](_0x10715a[_0xe9c9('0x2f')],qs[_0xe9c9('0x35')](_0xc6149c[_0xe9c9('0x30')]['fields']));_0xf95fb6[_0xe9c9('0x34')]=_0xf95fb6[_0xe9c9('0x34')][_0xe9c9('0x36')]?_0xf95fb6[_0xe9c9('0x34')]:_0x10715a[_0xe9c9('0x2f')];if(!_0xc6149c[_0xe9c9('0x30')][_0xe9c9('0x37')]('nolimit')){_0xf95fb6[_0xe9c9('0x1b')]=qs[_0xe9c9('0x1b')](_0xc6149c[_0xe9c9('0x30')][_0xe9c9('0x1b')]);_0xf95fb6['offset']=qs[_0xe9c9('0x1d')](_0xc6149c['query']['offset']);}_0xf95fb6[_0xe9c9('0x38')]=qs[_0xe9c9('0x39')](_0xc6149c[_0xe9c9('0x30')][_0xe9c9('0x39')]);_0xf95fb6[_0xe9c9('0x3a')]=qs[_0xe9c9('0x32')](_[_0xe9c9('0x3b')](_0xc6149c[_0xe9c9('0x30')],_0x10715a[_0xe9c9('0x32')]),_0x202a34);if(_0xc6149c[_0xe9c9('0x30')][_0xe9c9('0x3c')]){_0xf95fb6[_0xe9c9('0x3a')]=_['merge'](_0xf95fb6['where'],{'$or':_[_0xe9c9('0x2b')](_0x202a34,function(_0x3ef1a5){if(_0x3ef1a5[_0xe9c9('0x2e')]!==_0xe9c9('0x3d')){var _0x543c30={};_0x543c30[_0x3ef1a5[_0xe9c9('0x28')]]={'$like':'%'+_0xc6149c['query'][_0xe9c9('0x3c')]+'%'};return _0x543c30;}})});}_0xf95fb6=_[_0xe9c9('0x3e')]({},_0xf95fb6,_0xc6149c[_0xe9c9('0x3f')]);var _0x10ced7={'where':_0xf95fb6[_0xe9c9('0x3a')]};return db[_0xe9c9('0x40')][_0xe9c9('0x1c')](_0x10ced7)[_0xe9c9('0x24')](function(_0x43bedc){_0x3b5044[_0xe9c9('0x1c')]=_0x43bedc;if(_0xc6149c[_0xe9c9('0x30')]['includeAll']){_0xf95fb6[_0xe9c9('0x41')]=[{'all':!![]}];}return db[_0xe9c9('0x40')][_0xe9c9('0x42')](_0xf95fb6);})['then'](function(_0x507a49){_0x3b5044['rows']=_0x507a49;return _0x3b5044;})[_0xe9c9('0x24')](respondWithFilteredResult(_0x43de46,_0xf95fb6))[_0xe9c9('0x43')](handleError(_0x43de46,null));};exports[_0xe9c9('0x44')]=function(_0x5378d4,_0x53a50d){var _0x48c431={'raw':!![],'where':{'id':_0x5378d4[_0xe9c9('0x45')]['id']}},_0x4d0b68={};_0x4d0b68['model']=_[_0xe9c9('0x31')](db[_0xe9c9('0x40')][_0xe9c9('0x2c')]);_0x4d0b68[_0xe9c9('0x30')]=_[_0xe9c9('0x31')](_0x5378d4[_0xe9c9('0x30')]);_0x4d0b68[_0xe9c9('0x32')]=_['intersection'](_0x4d0b68['model'],_0x4d0b68['query']);_0x48c431['attributes']=_['intersection'](_0x4d0b68[_0xe9c9('0x2f')],qs[_0xe9c9('0x35')](_0x5378d4[_0xe9c9('0x30')][_0xe9c9('0x35')]));_0x48c431[_0xe9c9('0x34')]=_0x48c431[_0xe9c9('0x34')]['length']?_0x48c431[_0xe9c9('0x34')]:_0x4d0b68[_0xe9c9('0x2f')];if(_0x5378d4[_0xe9c9('0x30')][_0xe9c9('0x46')]){_0x48c431['include']=[{'all':!![]}];}_0x48c431=_['merge']({},_0x48c431,_0x5378d4[_0xe9c9('0x3f')]);return db['FaxTransferReport'][_0xe9c9('0x47')](_0x48c431)[_0xe9c9('0x24')](handleEntityNotFound(_0x53a50d,null))[_0xe9c9('0x24')](respondWithResult(_0x53a50d,null))[_0xe9c9('0x43')](handleError(_0x53a50d,null));};exports[_0xe9c9('0x48')]=function(_0x154e58,_0x4356d4){return db[_0xe9c9('0x40')][_0xe9c9('0x48')](_0x154e58[_0xe9c9('0x49')],{})[_0xe9c9('0x24')](respondWithResult(_0x4356d4,0xc9))[_0xe9c9('0x43')](handleError(_0x4356d4,null));};exports[_0xe9c9('0x23')]=function(_0x934846,_0x2a9225){if(_0x934846[_0xe9c9('0x49')]['id']){delete _0x934846[_0xe9c9('0x49')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x934846[_0xe9c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a9225,null))[_0xe9c9('0x24')](saveUpdates(_0x934846[_0xe9c9('0x49')],null))[_0xe9c9('0x24')](respondWithResult(_0x2a9225,null))['catch'](handleError(_0x2a9225,null));};exports['destroy']=function(_0xc1a2dc,_0x5ef22a){return db[_0xe9c9('0x40')][_0xe9c9('0x47')]({'where':{'id':_0xc1a2dc[_0xe9c9('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ef22a,null))[_0xe9c9('0x24')](removeEntity(_0x5ef22a,null))[_0xe9c9('0x43')](handleError(_0x5ef22a,null));};exports['describe']=function(_0x5d0ed4,_0x3e52ed){return db[_0xe9c9('0x40')][_0xe9c9('0x4a')]()[_0xe9c9('0x24')](respondWithResult(_0x3e52ed,null))[_0xe9c9('0x43')](handleError(_0x3e52ed,null));}; \ No newline at end of file +var _0xbc3c=['name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbc3c,0x158));var _0xcbc3=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xbc3c[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0xcbc3('0x0'));var rimraf=require(_0xcbc3('0x1'));var zipdir=require(_0xcbc3('0x2'));var jsonpatch=require(_0xcbc3('0x3'));var rp=require(_0xcbc3('0x4'));var moment=require(_0xcbc3('0x5'));var BPromise=require(_0xcbc3('0x6'));var Mustache=require(_0xcbc3('0x7'));var util=require('util');var path=require(_0xcbc3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcbc3('0x9'));var fs=require('fs');var fs_extra=require(_0xcbc3('0xa'));var _=require(_0xcbc3('0xb'));var squel=require(_0xcbc3('0xc'));var crypto=require(_0xcbc3('0xd'));var jsforce=require(_0xcbc3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcbc3('0xf'));var Papa=require(_0xcbc3('0x10'));var Redis=require(_0xcbc3('0x11'));var authService=require(_0xcbc3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbc3('0x13'))('api');var utils=require(_0xcbc3('0x14'));var config=require(_0xcbc3('0x15'));var licenseUtil=require(_0xcbc3('0x16'));var db=require(_0xcbc3('0x17'))['db'];function respondWithStatusCode(_0x3e38cf,_0x16e96f){_0x16e96f=_0x16e96f||0xcc;return function(_0x5bc601){if(_0x5bc601){return _0x3e38cf[_0xcbc3('0x18')](_0x16e96f);}return _0x3e38cf[_0xcbc3('0x19')](_0x16e96f)[_0xcbc3('0x1a')]();};}function respondWithResult(_0xa704e2,_0x5a7031){_0x5a7031=_0x5a7031||0xc8;return function(_0x172766){if(_0x172766){return _0xa704e2['status'](_0x5a7031)['json'](_0x172766);}};}function respondWithFilteredResult(_0x386552,_0x33f4eb){return function(_0x5bb770){if(_0x5bb770){var _0x5f2280=typeof _0x33f4eb['offset']===_0xcbc3('0x1b')&&typeof _0x33f4eb['limit']==='undefined';var _0x4dff4f=_0x5bb770[_0xcbc3('0x1c')];var _0x4b9b61=_0x5f2280?0x0:_0x33f4eb[_0xcbc3('0x1d')];var _0xb11e66=_0x5f2280?_0x5bb770['count']:_0x33f4eb['offset']+_0x33f4eb[_0xcbc3('0x1e')];var _0x2ca8f1;if(_0xb11e66>=_0x4dff4f){_0xb11e66=_0x4dff4f;_0x2ca8f1=0xc8;}else{_0x2ca8f1=0xce;}_0x386552[_0xcbc3('0x19')](_0x2ca8f1);return _0x386552[_0xcbc3('0x1f')](_0xcbc3('0x20'),_0x4b9b61+'-'+_0xb11e66+'/'+_0x4dff4f)[_0xcbc3('0x21')](_0x5bb770);}return null;};}function patchUpdates(_0x5211b3){return function(_0x53ae6e){try{jsonpatch[_0xcbc3('0x22')](_0x53ae6e,_0x5211b3,!![]);}catch(_0x23ea4c){return BPromise[_0xcbc3('0x23')](_0x23ea4c);}return _0x53ae6e[_0xcbc3('0x24')]();};}function saveUpdates(_0x54a48e,_0x1b6f6c){return function(_0x5d4499){if(_0x5d4499){return _0x5d4499[_0xcbc3('0x25')](_0x54a48e)[_0xcbc3('0x26')](function(_0x1b991d){return _0x1b991d;});}return null;};}function removeEntity(_0x55f9cf,_0x23fc93){return function(_0x329011){if(_0x329011){return _0x329011[_0xcbc3('0x27')]()[_0xcbc3('0x26')](function(){_0x55f9cf[_0xcbc3('0x19')](0xcc)[_0xcbc3('0x1a')]();});}};}function handleEntityNotFound(_0x55fab3,_0x44f9c2){return function(_0x50f37d){if(!_0x50f37d){_0x55fab3[_0xcbc3('0x18')](0x194);}return _0x50f37d;};}function handleError(_0x7789fa,_0x1d62c0){_0x1d62c0=_0x1d62c0||0x1f4;return function(_0x55f683){logger['error'](_0x55f683[_0xcbc3('0x28')]);if(_0x55f683[_0xcbc3('0x29')]){delete _0x55f683['name'];}_0x7789fa['status'](_0x1d62c0)[_0xcbc3('0x2a')](_0x55f683);};}exports[_0xcbc3('0x2b')]=function(_0x3ea863,_0x3dd195){var _0x38c984={},_0x287a43={},_0x195701={'count':0x0,'rows':[]};var _0x50da29=_[_0xcbc3('0x2c')](db[_0xcbc3('0x2d')][_0xcbc3('0x2e')],function(_0x1ce060){return{'name':_0x1ce060[_0xcbc3('0x2f')],'type':_0x1ce060[_0xcbc3('0x30')][_0xcbc3('0x31')]};});_0x287a43[_0xcbc3('0x32')]=_[_0xcbc3('0x2c')](_0x50da29,'name');_0x287a43[_0xcbc3('0x33')]=_[_0xcbc3('0x34')](_0x3ea863['query']);_0x287a43['filters']=_['intersection'](_0x287a43[_0xcbc3('0x32')],_0x287a43[_0xcbc3('0x33')]);_0x38c984[_0xcbc3('0x35')]=_[_0xcbc3('0x36')](_0x287a43[_0xcbc3('0x32')],qs[_0xcbc3('0x37')](_0x3ea863['query']['fields']));_0x38c984[_0xcbc3('0x35')]=_0x38c984[_0xcbc3('0x35')][_0xcbc3('0x38')]?_0x38c984[_0xcbc3('0x35')]:_0x287a43['model'];if(!_0x3ea863[_0xcbc3('0x33')][_0xcbc3('0x39')](_0xcbc3('0x3a'))){_0x38c984[_0xcbc3('0x1e')]=qs['limit'](_0x3ea863[_0xcbc3('0x33')][_0xcbc3('0x1e')]);_0x38c984['offset']=qs[_0xcbc3('0x1d')](_0x3ea863[_0xcbc3('0x33')][_0xcbc3('0x1d')]);}_0x38c984[_0xcbc3('0x3b')]=qs[_0xcbc3('0x3c')](_0x3ea863['query']['sort']);_0x38c984[_0xcbc3('0x3d')]=qs[_0xcbc3('0x3e')](_[_0xcbc3('0x3f')](_0x3ea863[_0xcbc3('0x33')],_0x287a43[_0xcbc3('0x3e')]),_0x50da29);if(_0x3ea863[_0xcbc3('0x33')][_0xcbc3('0x40')]){_0x38c984[_0xcbc3('0x3d')]=_['merge'](_0x38c984[_0xcbc3('0x3d')],{'$or':_[_0xcbc3('0x2c')](_0x50da29,function(_0x544e4e){if(_0x544e4e[_0xcbc3('0x30')]!=='VIRTUAL'){var _0x20b750={};_0x20b750[_0x544e4e[_0xcbc3('0x29')]]={'$like':'%'+_0x3ea863[_0xcbc3('0x33')][_0xcbc3('0x40')]+'%'};return _0x20b750;}})});}_0x38c984=_[_0xcbc3('0x41')]({},_0x38c984,_0x3ea863[_0xcbc3('0x42')]);var _0x282bdf={'where':_0x38c984[_0xcbc3('0x3d')]};return db['FaxTransferReport']['count'](_0x282bdf)['then'](function(_0x3f4161){_0x195701[_0xcbc3('0x1c')]=_0x3f4161;if(_0x3ea863['query'][_0xcbc3('0x43')]){_0x38c984[_0xcbc3('0x44')]=[{'all':!![]}];}return db[_0xcbc3('0x2d')][_0xcbc3('0x45')](_0x38c984);})[_0xcbc3('0x26')](function(_0x2e8e52){_0x195701['rows']=_0x2e8e52;return _0x195701;})[_0xcbc3('0x26')](respondWithFilteredResult(_0x3dd195,_0x38c984))[_0xcbc3('0x46')](handleError(_0x3dd195,null));};exports[_0xcbc3('0x47')]=function(_0x1b47dd,_0x1aec7e){var _0x188431={'raw':!![],'where':{'id':_0x1b47dd[_0xcbc3('0x48')]['id']}},_0x43689f={};_0x43689f[_0xcbc3('0x32')]=_[_0xcbc3('0x34')](db[_0xcbc3('0x2d')][_0xcbc3('0x2e')]);_0x43689f['query']=_[_0xcbc3('0x34')](_0x1b47dd[_0xcbc3('0x33')]);_0x43689f['filters']=_['intersection'](_0x43689f[_0xcbc3('0x32')],_0x43689f[_0xcbc3('0x33')]);_0x188431[_0xcbc3('0x35')]=_[_0xcbc3('0x36')](_0x43689f[_0xcbc3('0x32')],qs[_0xcbc3('0x37')](_0x1b47dd[_0xcbc3('0x33')][_0xcbc3('0x37')]));_0x188431[_0xcbc3('0x35')]=_0x188431['attributes'][_0xcbc3('0x38')]?_0x188431[_0xcbc3('0x35')]:_0x43689f[_0xcbc3('0x32')];if(_0x1b47dd['query'][_0xcbc3('0x43')]){_0x188431['include']=[{'all':!![]}];}_0x188431=_[_0xcbc3('0x41')]({},_0x188431,_0x1b47dd[_0xcbc3('0x42')]);return db[_0xcbc3('0x2d')][_0xcbc3('0x49')](_0x188431)['then'](handleEntityNotFound(_0x1aec7e,null))[_0xcbc3('0x26')](respondWithResult(_0x1aec7e,null))[_0xcbc3('0x46')](handleError(_0x1aec7e,null));};exports[_0xcbc3('0x4a')]=function(_0x1190f0,_0x37473a){return db['FaxTransferReport']['create'](_0x1190f0[_0xcbc3('0x4b')],{})['then'](respondWithResult(_0x37473a,0xc9))[_0xcbc3('0x46')](handleError(_0x37473a,null));};exports['update']=function(_0x5b4773,_0x41420d){if(_0x5b4773[_0xcbc3('0x4b')]['id']){delete _0x5b4773[_0xcbc3('0x4b')]['id'];}return db[_0xcbc3('0x2d')][_0xcbc3('0x49')]({'where':{'id':_0x5b4773[_0xcbc3('0x48')]['id']}})[_0xcbc3('0x26')](handleEntityNotFound(_0x41420d,null))[_0xcbc3('0x26')](saveUpdates(_0x5b4773[_0xcbc3('0x4b')],null))[_0xcbc3('0x26')](respondWithResult(_0x41420d,null))[_0xcbc3('0x46')](handleError(_0x41420d,null));};exports[_0xcbc3('0x27')]=function(_0x513925,_0x427eb0){return db[_0xcbc3('0x2d')][_0xcbc3('0x49')]({'where':{'id':_0x513925['params']['id']}})[_0xcbc3('0x26')](handleEntityNotFound(_0x427eb0,null))[_0xcbc3('0x26')](removeEntity(_0x427eb0,null))[_0xcbc3('0x46')](handleError(_0x427eb0,null));};exports['describe']=function(_0x4ca7f4,_0x349024){return db[_0xcbc3('0x2d')][_0xcbc3('0x4c')]()[_0xcbc3('0x26')](respondWithResult(_0x349024,null))[_0xcbc3('0x46')](handleError(_0x349024,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 9d78a5c..23bc870 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 _0xc48e=['../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','rimraf'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xc48e,0xd7));var _0xec48=function(_0x5a4e15,_0x35335d){_0x5a4e15=_0x5a4e15-0x0;var _0x467258=_0xc48e[_0x5a4e15];return _0x467258;};'use strict';var _=require(_0xec48('0x0'));var util=require('util');var logger=require(_0xec48('0x1'))('api');var moment=require(_0xec48('0x2'));var BPromise=require(_0xec48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec48('0x4'));var config=require(_0xec48('0x5'));var attributes=require(_0xec48('0x6'));module[_0xec48('0x7')]=function(_0x1e369f,_0x10e11f){return _0x1e369f['define']('FaxTransferReport',attributes,{'tableName':_0xec48('0x8'),'paranoid':![],'indexes':[{'name':_0xec48('0x9'),'fields':[_0xec48('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3310=['bluebird','path','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer','uniqueid','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3310,0xf8));var _0x0331=function(_0xe9a1f2,_0x57ae91){_0xe9a1f2=_0xe9a1f2-0x0;var _0x476bae=_0x3310[_0xe9a1f2];return _0x476bae;};'use strict';var _=require(_0x0331('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0331('0x1'));var BPromise=require(_0x0331('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0331('0x3'));var rimraf=require('rimraf');var config=require(_0x0331('0x4'));var attributes=require(_0x0331('0x5'));module[_0x0331('0x6')]=function(_0x11cbfb,_0xed6d8d){return _0x11cbfb[_0x0331('0x7')]('FaxTransferReport',attributes,{'tableName':_0x0331('0x8'),'paranoid':![],'indexes':[{'name':_0x0331('0x9'),'fields':[_0x0331('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 3b8a7ed..8f06218 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 _0x7ec7=['info','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x245f4c,_0x256845){var _0x50b789=function(_0x4f993b){while(--_0x4f993b){_0x245f4c['push'](_0x245f4c['shift']());}};_0x50b789(++_0x256845);}(_0x7ec7,0x1a1));var _0x77ec=function(_0x3ee3c6,_0x19cd8e){_0x3ee3c6=_0x3ee3c6-0x0;var _0x5ec5be=_0x7ec7[_0x3ee3c6];return _0x5ec5be;};'use strict';var _=require(_0x77ec('0x0'));var util=require('util');var moment=require(_0x77ec('0x1'));var BPromise=require('bluebird');var rs=require(_0x77ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x77ec('0x3'));var logger=require(_0x77ec('0x4'))(_0x77ec('0x5'));var config=require(_0x77ec('0x6'));var jayson=require(_0x77ec('0x7'));var client=jayson[_0x77ec('0x8')][_0x77ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x242fa4,_0x4802bd,_0x3ebcdf){return new BPromise(function(_0x262f33,_0x4d4a3a){return client[_0x77ec('0xa')](_0x242fa4,_0x3ebcdf)[_0x77ec('0xb')](function(_0xb68a43){logger['info'](_0x77ec('0xc'),_0x4802bd,_0x77ec('0xd'));logger[_0x77ec('0xe')](_0x77ec('0xf'),_0x4802bd,_0x77ec('0xd'),JSON[_0x77ec('0x10')](_0xb68a43));if(_0xb68a43['error']){if(_0xb68a43[_0x77ec('0x11')][_0x77ec('0x12')]===0x1f4){logger[_0x77ec('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x4802bd,_0xb68a43[_0x77ec('0x11')]['message']);return _0x4d4a3a(_0xb68a43[_0x77ec('0x11')][_0x77ec('0x13')]);}logger[_0x77ec('0x11')](_0x77ec('0xc'),_0x4802bd,_0xb68a43[_0x77ec('0x11')][_0x77ec('0x13')]);return _0x262f33(_0xb68a43[_0x77ec('0x11')]['message']);}else{logger[_0x77ec('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x4802bd,_0x77ec('0xd'));_0x262f33(_0xb68a43[_0x77ec('0x15')][_0x77ec('0x13')]);}})[_0x77ec('0x16')](function(_0x33071e){logger[_0x77ec('0x11')](_0x77ec('0xc'),_0x4802bd,_0x33071e);_0x4d4a3a(_0x33071e);});});} \ No newline at end of file +var _0x9b8b=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x261999,_0x15f7e8){var _0x109e04=function(_0x4c8e93){while(--_0x4c8e93){_0x261999['push'](_0x261999['shift']());}};_0x109e04(++_0x15f7e8);}(_0x9b8b,0xb6));var _0xb9b8=function(_0x2c5d64,_0x47adc5){_0x2c5d64=_0x2c5d64-0x0;var _0x2c4082=_0x9b8b[_0x2c5d64];return _0x2c4082;};'use strict';var _=require(_0xb9b8('0x0'));var util=require(_0xb9b8('0x1'));var moment=require('moment');var BPromise=require(_0xb9b8('0x2'));var rs=require(_0xb9b8('0x3'));var fs=require('fs');var Redis=require(_0xb9b8('0x4'));var db=require(_0xb9b8('0x5'))['db'];var utils=require(_0xb9b8('0x6'));var logger=require('../../config/logger')(_0xb9b8('0x7'));var config=require(_0xb9b8('0x8'));var jayson=require(_0xb9b8('0x9'));var client=jayson[_0xb9b8('0xa')][_0xb9b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x476cf9,_0x1b2852,_0xc86729){return new BPromise(function(_0x3c3c52,_0x4eb2cb){return client[_0xb9b8('0xc')](_0x476cf9,_0xc86729)['then'](function(_0x5c3296){logger['info'](_0xb9b8('0xd'),_0x1b2852,_0xb9b8('0xe'));logger['debug'](_0xb9b8('0xf'),_0x1b2852,'request\x20sent',JSON[_0xb9b8('0x10')](_0x5c3296));if(_0x5c3296[_0xb9b8('0x11')]){if(_0x5c3296[_0xb9b8('0x11')][_0xb9b8('0x12')]===0x1f4){logger[_0xb9b8('0x11')](_0xb9b8('0xd'),_0x1b2852,_0x5c3296[_0xb9b8('0x11')][_0xb9b8('0x13')]);return _0x4eb2cb(_0x5c3296['error'][_0xb9b8('0x13')]);}logger[_0xb9b8('0x11')](_0xb9b8('0xd'),_0x1b2852,_0x5c3296[_0xb9b8('0x11')][_0xb9b8('0x13')]);return _0x3c3c52(_0x5c3296['error']['message']);}else{logger['info'](_0xb9b8('0xd'),_0x1b2852,_0xb9b8('0xe'));_0x3c3c52(_0x5c3296[_0xb9b8('0x14')][_0xb9b8('0x13')]);}})[_0xb9b8('0x15')](function(_0x241c81){logger[_0xb9b8('0x11')](_0xb9b8('0xd'),_0x1b2852,_0x241c81);_0x4eb2cb(_0x241c81);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 892557a..96d95a5 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 _0x147f=['index','isAuthenticated','describe','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x11d1af,_0x15b572){var _0x256654=function(_0x4775f2){while(--_0x4775f2){_0x11d1af['push'](_0x11d1af['shift']());}};_0x256654(++_0x15b572);}(_0x147f,0x182));var _0xf147=function(_0x2c592c,_0x2fc6af){_0x2c592c=_0x2c592c-0x0;var _0x59b813=_0x147f[_0x2c592c];return _0x59b813;};'use strict';var multer=require(_0xf147('0x0'));var util=require(_0xf147('0x1'));var path=require(_0xf147('0x2'));var timeout=require(_0xf147('0x3'));var express=require('express');var router=express[_0xf147('0x4')]();var fs_extra=require(_0xf147('0x5'));var auth=require(_0xf147('0x6'));var interaction=require(_0xf147('0x7'));var config=require(_0xf147('0x8'));var controller=require(_0xf147('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf147('0xa')]);router['get']('/describe',auth[_0xf147('0xb')](),controller[_0xf147('0xc')]);router[_0xf147('0xd')](_0xf147('0xe'),auth['isAuthenticated'](),controller[_0xf147('0xf')]);router[_0xf147('0x10')]('/',auth[_0xf147('0xb')](),controller[_0xf147('0x11')]);router['put'](_0xf147('0xe'),auth[_0xf147('0xb')](),controller[_0xf147('0x12')]);router[_0xf147('0x13')](_0xf147('0xe'),auth[_0xf147('0xb')](),controller[_0xf147('0x14')]);module[_0xf147('0x15')]=router; \ No newline at end of file +var _0xaf6b=['../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','show','create','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e8aa7,_0x247e48){var _0x120784=function(_0x5919ca){while(--_0x5919ca){_0x4e8aa7['push'](_0x4e8aa7['shift']());}};_0x120784(++_0x247e48);}(_0xaf6b,0x188));var _0xbaf6=function(_0x2b2583,_0x2ca543){_0x2b2583=_0x2b2583-0x0;var _0x38c9df=_0xaf6b[_0x2b2583];return _0x38c9df;};'use strict';var multer=require(_0xbaf6('0x0'));var util=require(_0xbaf6('0x1'));var path=require(_0xbaf6('0x2'));var timeout=require(_0xbaf6('0x3'));var express=require('express');var router=express[_0xbaf6('0x4')]();var fs_extra=require(_0xbaf6('0x5'));var auth=require(_0xbaf6('0x6'));var interaction=require(_0xbaf6('0x7'));var config=require(_0xbaf6('0x8'));var controller=require(_0xbaf6('0x9'));router['get']('/',auth[_0xbaf6('0xa')](),controller[_0xbaf6('0xb')]);router[_0xbaf6('0xc')](_0xbaf6('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xbaf6('0xc')]('/:id',auth[_0xbaf6('0xa')](),controller[_0xbaf6('0xe')]);router['post']('/',auth[_0xbaf6('0xa')](),controller[_0xbaf6('0xf')]);router['put'](_0xbaf6('0x10'),auth[_0xbaf6('0xa')](),controller[_0xbaf6('0x11')]);router['delete']('/:id',auth[_0xbaf6('0xa')](),controller[_0xbaf6('0x12')]);module[_0xbaf6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 1e89b6a..3647ea9 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 _0xab66=['/:id/fields','post','create','addConfiguration','put','/:id','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','/:id/configurations'];(function(_0x17c24c,_0x36f170){var _0x596382=function(_0x132352){while(--_0x132352){_0x17c24c['push'](_0x17c24c['shift']());}};_0x596382(++_0x36f170);}(_0xab66,0xd1));var _0x6ab6=function(_0x347166,_0x4aede2){_0x347166=_0x347166-0x0;var _0x519659=_0xab66[_0x347166];return _0x519659;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6ab6('0x0'));var timeout=require(_0x6ab6('0x1'));var express=require(_0x6ab6('0x2'));var router=express['Router']();var fs_extra=require(_0x6ab6('0x3'));var auth=require(_0x6ab6('0x4'));var interaction=require(_0x6ab6('0x5'));var config=require(_0x6ab6('0x6'));var controller=require(_0x6ab6('0x7'));router[_0x6ab6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6ab6('0x8')]('/:id',auth[_0x6ab6('0x9')](),controller['show']);router[_0x6ab6('0x8')](_0x6ab6('0xa'),auth[_0x6ab6('0x9')](),controller['getConfigurations']);router[_0x6ab6('0x8')](_0x6ab6('0xb'),auth[_0x6ab6('0x9')](),controller['getFields']);router[_0x6ab6('0xc')]('/',auth[_0x6ab6('0x9')](),controller[_0x6ab6('0xd')]);router[_0x6ab6('0xc')]('/:id/configurations',auth[_0x6ab6('0x9')](),controller[_0x6ab6('0xe')]);router[_0x6ab6('0xf')](_0x6ab6('0x10'),auth[_0x6ab6('0x9')](),controller[_0x6ab6('0x11')]);router[_0x6ab6('0x12')]('/:id',auth[_0x6ab6('0x9')](),controller['destroy']);module[_0x6ab6('0x13')]=router; \ No newline at end of file +var _0xf977=['show','/:id/configurations','getConfigurations','post','create','addConfiguration','put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x4f8997,_0x30da2d){var _0x11c2af=function(_0x44d92b){while(--_0x44d92b){_0x4f8997['push'](_0x4f8997['shift']());}};_0x11c2af(++_0x30da2d);}(_0xf977,0xcf));var _0x7f97=function(_0x1f7838,_0xf50224){_0x1f7838=_0x1f7838-0x0;var _0x46dd5f=_0xf977[_0x1f7838];return _0x46dd5f;};'use strict';var multer=require(_0x7f97('0x0'));var util=require('util');var path=require(_0x7f97('0x1'));var timeout=require(_0x7f97('0x2'));var express=require(_0x7f97('0x3'));var router=express[_0x7f97('0x4')]();var fs_extra=require(_0x7f97('0x5'));var auth=require(_0x7f97('0x6'));var interaction=require(_0x7f97('0x7'));var config=require('../../config/environment');var controller=require(_0x7f97('0x8'));router[_0x7f97('0x9')]('/',auth[_0x7f97('0xa')](),controller[_0x7f97('0xb')]);router[_0x7f97('0x9')](_0x7f97('0xc'),auth[_0x7f97('0xa')](),controller[_0x7f97('0xd')]);router['get'](_0x7f97('0xe'),auth[_0x7f97('0xa')](),controller[_0x7f97('0xf')]);router['get']('/:id/fields',auth[_0x7f97('0xa')](),controller['getFields']);router[_0x7f97('0x10')]('/',auth['isAuthenticated'](),controller[_0x7f97('0x11')]);router['post'](_0x7f97('0xe'),auth[_0x7f97('0xa')](),controller[_0x7f97('0x12')]);router[_0x7f97('0x13')](_0x7f97('0xc'),auth['isAuthenticated'](),controller[_0x7f97('0x14')]);router['delete']('/:id',auth[_0x7f97('0xa')](),controller[_0x7f97('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 23649f3..c16be45 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 _0xe291=['exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x24f2ca,_0x4e4b65){var _0x2f6646=function(_0x40aa5a){while(--_0x40aa5a){_0x24f2ca['push'](_0x24f2ca['shift']());}};_0x2f6646(++_0x4e4b65);}(_0xe291,0x1c2));var _0x1e29=function(_0xd5d175,_0x4a3679){_0xd5d175=_0xd5d175-0x0;var _0x5c1689=_0xe291[_0xd5d175];return _0x5c1689;};'use strict';var Sequelize=require('sequelize');module[_0x1e29('0x0')]={'name':{'type':Sequelize[_0x1e29('0x1')]},'description':{'type':Sequelize[_0x1e29('0x1')]},'username':{'type':Sequelize[_0x1e29('0x1')]},'remoteUri':{'type':Sequelize[_0x1e29('0x1')]},'authType':{'type':Sequelize[_0x1e29('0x2')](_0x1e29('0x3')),'defaultValue':_0x1e29('0x3')},'password':{'type':Sequelize[_0x1e29('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x1e29('0x1')]},'token':{'type':Sequelize[_0x1e29('0x1')]},'tokenSecret':{'type':Sequelize[_0x1e29('0x1')]},'serverUrl':{'type':Sequelize[_0x1e29('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1e29('0x2')](_0x1e29('0x4'),_0x1e29('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x1fd1=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x17bf0a,_0x1a79ab){var _0x4feb67=function(_0x5f3cd3){while(--_0x5f3cd3){_0x17bf0a['push'](_0x17bf0a['shift']());}};_0x4feb67(++_0x1a79ab);}(_0x1fd1,0x111));var _0x11fd=function(_0x30bdcd,_0x506661){_0x30bdcd=_0x30bdcd-0x0;var _0x57ac90=_0x1fd1[_0x30bdcd];return _0x57ac90;};'use strict';var Sequelize=require(_0x11fd('0x0'));module[_0x11fd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x11fd('0x2')]},'username':{'type':Sequelize[_0x11fd('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x11fd('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x11fd('0x2')]},'consumerKey':{'type':Sequelize[_0x11fd('0x2')]},'consumerSecret':{'type':Sequelize[_0x11fd('0x2')]},'token':{'type':Sequelize[_0x11fd('0x2')]},'tokenSecret':{'type':Sequelize[_0x11fd('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x11fd('0x3')](_0x11fd('0x4'),_0x11fd('0x5')),'defaultValue':_0x11fd('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 910697c..6f5c4e3 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 _0x04e6=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','find','destroy','getConfigurations','DeskConfiguration','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','type','DeskField','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','%s:%s','toString','base64','concat','_embedded','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','apply','reject','save','update','then','end','error','stack','name','index','map','DeskAccount','fieldName','query','filters','intersection','model','fields','attributes','length','nolimit','limit','order'];(function(_0x6f8991,_0x4a42ad){var _0x509b3f=function(_0xf7ebf0){while(--_0xf7ebf0){_0x6f8991['push'](_0x6f8991['shift']());}};_0x509b3f(++_0x4a42ad);}(_0x04e6,0xa8));var _0x604e=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x04e6[_0x1406ae];return _0x23a076;};'use strict';var emlformat=require(_0x604e('0x0'));var rimraf=require(_0x604e('0x1'));var zipdir=require(_0x604e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x604e('0x3'));var Mustache=require(_0x604e('0x4'));var util=require('util');var path=require(_0x604e('0x5'));var sox=require(_0x604e('0x6'));var csv=require(_0x604e('0x7'));var ejs=require(_0x604e('0x8'));var fs=require('fs');var fs_extra=require(_0x604e('0x9'));var _=require(_0x604e('0xa'));var squel=require(_0x604e('0xb'));var crypto=require(_0x604e('0xc'));var jsforce=require(_0x604e('0xd'));var deskjs=require(_0x604e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x604e('0xf'));var Papa=require(_0x604e('0x10'));var Redis=require(_0x604e('0x11'));var authService=require(_0x604e('0x12'));var qs=require(_0x604e('0x13'));var as=require(_0x604e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x604e('0x15'));var config=require(_0x604e('0x16'));var licenseUtil=require(_0x604e('0x17'));var db=require(_0x604e('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2168ed,_0x3b309a){_0x3b309a=_0x3b309a||0xcc;return function(_0x300ad7){if(_0x300ad7){return _0x2168ed[_0x604e('0x19')](_0x3b309a);}return _0x2168ed[_0x604e('0x1a')](_0x3b309a)['end']();};}function respondWithResult(_0x24f0a7,_0x255b0d){_0x255b0d=_0x255b0d||0xc8;return function(_0x470d40){if(_0x470d40){return _0x24f0a7['status'](_0x255b0d)[_0x604e('0x1b')](_0x470d40);}};}function respondWithFilteredResult(_0xad1adc,_0x1b18bb){return function(_0x2c4534){if(_0x2c4534){var _0x55fc5b=typeof _0x1b18bb['offset']===_0x604e('0x1c')&&typeof _0x1b18bb['limit']===_0x604e('0x1c');var _0x2ca189=_0x2c4534[_0x604e('0x1d')];var _0x2a3b3e=_0x55fc5b?0x0:_0x1b18bb['offset'];var _0x26a3b9=_0x55fc5b?_0x2c4534['count']:_0x1b18bb[_0x604e('0x1e')]+_0x1b18bb['limit'];var _0x5b5ece;if(_0x26a3b9>=_0x2ca189){_0x26a3b9=_0x2ca189;_0x5b5ece=0xc8;}else{_0x5b5ece=0xce;}_0xad1adc[_0x604e('0x1a')](_0x5b5ece);return _0xad1adc['set']('Content-Range',_0x2a3b3e+'-'+_0x26a3b9+'/'+_0x2ca189)[_0x604e('0x1b')](_0x2c4534);}return null;};}function patchUpdates(_0x387f01){return function(_0x17029){try{jsonpatch[_0x604e('0x1f')](_0x17029,_0x387f01,!![]);}catch(_0x2bf26b){return BPromise[_0x604e('0x20')](_0x2bf26b);}return _0x17029[_0x604e('0x21')]();};}function saveUpdates(_0x2449f6,_0x2a9c73){return function(_0x1ac752){if(_0x1ac752){return _0x1ac752[_0x604e('0x22')](_0x2449f6)[_0x604e('0x23')](function(_0x56f03f){return _0x56f03f;});}return null;};}function removeEntity(_0x5dcdf9,_0x3784c7){return function(_0x51f6f9){if(_0x51f6f9){return _0x51f6f9['destroy']()[_0x604e('0x23')](function(){_0x5dcdf9[_0x604e('0x1a')](0xcc)[_0x604e('0x24')]();});}};}function handleEntityNotFound(_0x4ed399,_0x3e6223){return function(_0x1ab14b){if(!_0x1ab14b){_0x4ed399[_0x604e('0x19')](0x194);}return _0x1ab14b;};}function handleError(_0x5f9cdd,_0x263b94){_0x263b94=_0x263b94||0x1f4;return function(_0x5a16aa){logger[_0x604e('0x25')](_0x5a16aa[_0x604e('0x26')]);if(_0x5a16aa[_0x604e('0x27')]){delete _0x5a16aa[_0x604e('0x27')];}_0x5f9cdd['status'](_0x263b94)['send'](_0x5a16aa);};}exports[_0x604e('0x28')]=function(_0x1b612e,_0x45fedd){var _0x91a139={},_0x507bbe={},_0x1f2682={'count':0x0,'rows':[]};var _0x35d6aa=_[_0x604e('0x29')](db[_0x604e('0x2a')]['rawAttributes'],function(_0x20735e){return{'name':_0x20735e[_0x604e('0x2b')],'type':_0x20735e['type']['key']};});_0x507bbe['model']=_[_0x604e('0x29')](_0x35d6aa,_0x604e('0x27'));_0x507bbe[_0x604e('0x2c')]=_['keys'](_0x1b612e[_0x604e('0x2c')]);_0x507bbe[_0x604e('0x2d')]=_['intersection'](_0x507bbe['model'],_0x507bbe['query']);_0x91a139['attributes']=_[_0x604e('0x2e')](_0x507bbe[_0x604e('0x2f')],qs[_0x604e('0x30')](_0x1b612e['query'][_0x604e('0x30')]));_0x91a139[_0x604e('0x31')]=_0x91a139[_0x604e('0x31')][_0x604e('0x32')]?_0x91a139['attributes']:_0x507bbe[_0x604e('0x2f')];if(!_0x1b612e[_0x604e('0x2c')]['hasOwnProperty'](_0x604e('0x33'))){_0x91a139[_0x604e('0x34')]=qs[_0x604e('0x34')](_0x1b612e[_0x604e('0x2c')][_0x604e('0x34')]);_0x91a139[_0x604e('0x1e')]=qs[_0x604e('0x1e')](_0x1b612e['query'][_0x604e('0x1e')]);}_0x91a139[_0x604e('0x35')]=qs[_0x604e('0x36')](_0x1b612e[_0x604e('0x2c')][_0x604e('0x36')]);_0x91a139[_0x604e('0x37')]=qs['filters'](_[_0x604e('0x38')](_0x1b612e[_0x604e('0x2c')],_0x507bbe[_0x604e('0x2d')]),_0x35d6aa);if(_0x1b612e['query'][_0x604e('0x39')]){_0x91a139[_0x604e('0x37')]=_[_0x604e('0x3a')](_0x91a139[_0x604e('0x37')],{'$or':_[_0x604e('0x29')](_0x35d6aa,function(_0x4948e6){if(_0x4948e6['type']!==_0x604e('0x3b')){var _0x2a6d40={};_0x2a6d40[_0x4948e6[_0x604e('0x27')]]={'$like':'%'+_0x1b612e[_0x604e('0x2c')][_0x604e('0x39')]+'%'};return _0x2a6d40;}})});}_0x91a139=_[_0x604e('0x3a')]({},_0x91a139,_0x1b612e[_0x604e('0x3c')]);var _0x1897a2={'where':_0x91a139[_0x604e('0x37')]};return db[_0x604e('0x2a')]['count'](_0x1897a2)[_0x604e('0x23')](function(_0x5692a9){_0x1f2682[_0x604e('0x1d')]=_0x5692a9;if(_0x1b612e[_0x604e('0x2c')][_0x604e('0x3d')]){_0x91a139[_0x604e('0x3e')]=[{'all':!![]}];}return db[_0x604e('0x2a')][_0x604e('0x3f')](_0x91a139);})[_0x604e('0x23')](function(_0x31cad1){_0x1f2682[_0x604e('0x40')]=_0x31cad1;return _0x1f2682;})['then'](respondWithFilteredResult(_0x45fedd,_0x91a139))[_0x604e('0x41')](handleError(_0x45fedd,null));};exports['show']=function(_0x2decdf,_0x3a34b0){var _0x5c33e1={'raw':![],'where':{'id':_0x2decdf[_0x604e('0x42')]['id']}},_0x74ec29={};_0x74ec29[_0x604e('0x2f')]=_[_0x604e('0x43')](db[_0x604e('0x2a')][_0x604e('0x44')]);_0x74ec29[_0x604e('0x2c')]=_[_0x604e('0x43')](_0x2decdf[_0x604e('0x2c')]);_0x74ec29[_0x604e('0x2d')]=_[_0x604e('0x2e')](_0x74ec29[_0x604e('0x2f')],_0x74ec29['query']);_0x5c33e1[_0x604e('0x31')]=_[_0x604e('0x2e')](_0x74ec29[_0x604e('0x2f')],qs[_0x604e('0x30')](_0x2decdf[_0x604e('0x2c')][_0x604e('0x30')]));_0x5c33e1[_0x604e('0x31')]=_0x5c33e1[_0x604e('0x31')][_0x604e('0x32')]?_0x5c33e1[_0x604e('0x31')]:_0x74ec29['model'];if(_0x2decdf['query'][_0x604e('0x3d')]){_0x5c33e1[_0x604e('0x3e')]=[{'all':!![]}];}_0x5c33e1=_[_0x604e('0x3a')]({},_0x5c33e1,_0x2decdf['options']);return db[_0x604e('0x2a')]['find'](_0x5c33e1)[_0x604e('0x23')](handleEntityNotFound(_0x3a34b0,null))['then'](respondWithResult(_0x3a34b0,null))[_0x604e('0x41')](handleError(_0x3a34b0,null));};exports[_0x604e('0x45')]=function(_0x1b8b05,_0x5df1ce){return db[_0x604e('0x2a')][_0x604e('0x45')](_0x1b8b05[_0x604e('0x46')],{})[_0x604e('0x23')](respondWithResult(_0x5df1ce,0xc9))['catch'](handleError(_0x5df1ce,null));};exports[_0x604e('0x22')]=function(_0x53ca86,_0x2b6e37){if(_0x53ca86[_0x604e('0x46')]['id']){delete _0x53ca86[_0x604e('0x46')]['id'];}return db[_0x604e('0x2a')][_0x604e('0x47')]({'where':{'id':_0x53ca86[_0x604e('0x42')]['id']}})[_0x604e('0x23')](handleEntityNotFound(_0x2b6e37,null))[_0x604e('0x23')](saveUpdates(_0x53ca86['body'],null))[_0x604e('0x23')](respondWithResult(_0x2b6e37,null))['catch'](handleError(_0x2b6e37,null));};exports[_0x604e('0x48')]=function(_0x50a08b,_0x5416c2){return db[_0x604e('0x2a')][_0x604e('0x47')]({'where':{'id':_0x50a08b[_0x604e('0x42')]['id']}})[_0x604e('0x23')](handleEntityNotFound(_0x5416c2,null))[_0x604e('0x23')](removeEntity(_0x5416c2,null))['catch'](handleError(_0x5416c2,null));};exports[_0x604e('0x49')]=function(_0x21021b,_0x488bd5,_0x3846ba){var _0x3ec9f2={};var _0x587082={};var _0x40897a;var _0x3bde92;return db[_0x604e('0x2a')]['findOne']({'where':{'id':_0x21021b[_0x604e('0x42')]['id']}})['then'](handleEntityNotFound(_0x488bd5,null))['then'](function(_0x59867c){if(_0x59867c){_0x40897a=_0x59867c;_0x587082[_0x604e('0x2f')]=_[_0x604e('0x43')](db[_0x604e('0x4a')][_0x604e('0x44')]);_0x587082['query']=_['keys'](_0x21021b[_0x604e('0x2c')]);_0x587082[_0x604e('0x2d')]=_[_0x604e('0x2e')](_0x587082['model'],_0x587082[_0x604e('0x2c')]);_0x3ec9f2[_0x604e('0x31')]=_[_0x604e('0x2e')](_0x587082[_0x604e('0x2f')],qs['fields'](_0x21021b[_0x604e('0x2c')]['fields']));_0x3ec9f2[_0x604e('0x31')]=_0x3ec9f2[_0x604e('0x31')][_0x604e('0x32')]?_0x3ec9f2['attributes']:_0x587082['model'];_0x3ec9f2[_0x604e('0x35')]=qs['sort'](_0x21021b[_0x604e('0x2c')]['sort']);_0x3ec9f2['where']=qs[_0x604e('0x2d')](_[_0x604e('0x38')](_0x21021b[_0x604e('0x2c')],_0x587082[_0x604e('0x2d')]));if(_0x21021b[_0x604e('0x2c')][_0x604e('0x39')]){_0x3ec9f2[_0x604e('0x37')]=_['merge'](_0x3ec9f2[_0x604e('0x37')],{'$or':_[_0x604e('0x29')](_0x3ec9f2[_0x604e('0x31')],function(_0x581572){var _0x568e7b={};_0x568e7b[_0x581572]={'$like':'%'+_0x21021b[_0x604e('0x2c')][_0x604e('0x39')]+'%'};return _0x568e7b;})});}_0x3ec9f2=_[_0x604e('0x3a')]({},_0x3ec9f2,_0x21021b[_0x604e('0x3c')]);return _0x40897a[_0x604e('0x49')](_0x3ec9f2);}})[_0x604e('0x23')](function(_0x2c3155){if(_0x2c3155){_0x3bde92=_0x2c3155[_0x604e('0x32')];if(!_0x21021b['query'][_0x604e('0x4b')](_0x604e('0x33'))){_0x3ec9f2[_0x604e('0x34')]=qs[_0x604e('0x34')](_0x21021b[_0x604e('0x2c')][_0x604e('0x34')]);_0x3ec9f2[_0x604e('0x1e')]=qs[_0x604e('0x1e')](_0x21021b['query'][_0x604e('0x1e')]);}return _0x40897a[_0x604e('0x49')](_0x3ec9f2);}})[_0x604e('0x23')](function(_0x447e67){if(_0x447e67){return _0x447e67?{'count':_0x3bde92,'rows':_0x447e67}:null;}})['then'](respondWithResult(_0x488bd5,null))['catch'](handleError(_0x488bd5,null));};exports['addConfiguration']=function(_0x2b9479,_0x1ac944,_0x15f7cc){if(_0x2b9479[_0x604e('0x46')]['id']){delete _0x2b9479['body']['id'];}return db[_0x604e('0x2a')]['findOne']({'where':{'id':_0x2b9479['params']['id']}})[_0x604e('0x23')](handleEntityNotFound(_0x1ac944,null))[_0x604e('0x23')](function(_0x5914ca){if(_0x5914ca){_0x2b9479[_0x604e('0x46')][_0x604e('0x4c')]=_0x5914ca['id'];_0x2b9479[_0x604e('0x46')][_0x604e('0x4d')]=integrations[_0x604e('0x4e')](_0x2b9479['body']['channel'],_0x2b9479['body']['type']);_0x2b9479[_0x604e('0x46')][_0x604e('0x4f')]=integrations[_0x604e('0x50')](_0x2b9479[_0x604e('0x46')]['channel'],_0x2b9479['body'][_0x604e('0x51')]);return db['DeskConfiguration'][_0x604e('0x45')](_0x2b9479[_0x604e('0x46')],{'include':[{'model':db[_0x604e('0x52')],'as':_0x604e('0x4d')},{'model':db[_0x604e('0x52')],'as':_0x604e('0x4f')}]});}return null;})[_0x604e('0x23')](respondWithResult(_0x1ac944,null))[_0x604e('0x41')](handleError(_0x1ac944,null));};exports[_0x604e('0x53')]=function(_0x4d7889,_0x51063c,_0x3ca590){var _0xca43a4=[{'name':_0x604e('0x54'),'label':_0x604e('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 _0x55cb90='';return db['DeskAccount']['findOne']({'where':{'id':_0x4d7889['params']['id']},'attributes':['id',_0x604e('0x55'),_0x604e('0x56'),_0x604e('0x57'),_0x604e('0x58'),'consumerKey',_0x604e('0x59'),_0x604e('0x5a'),'tokenSecret']})[_0x604e('0x23')](handleEntityNotFound(_0x51063c,null))[_0x604e('0x23')](function(_0x4daa7b){if(_0x4daa7b){_0x55cb90=_0x4daa7b[_0x604e('0x55')];var _0x34f17d=_0x55cb90[_0x604e('0x5b')](-0x1);if(_0x34f17d==='/'){_0x55cb90=_0x55cb90[_0x604e('0x5c')](0x0,_0x55cb90[_0x604e('0x5d')](_0x34f17d));}var _0x51f48e={'method':_0x604e('0x5e'),'uri':util[_0x604e('0x5f')](_0x604e('0x60'),_0x55cb90),'headers':{'Content-Type':_0x604e('0x61'),'Accept':'application/json'},'json':!![]};if(_0x4daa7b['authType']==='basic'){_0x51f48e[_0x604e('0x62')][_0x604e('0x63')]=util[_0x604e('0x5f')]('Basic\x20%s',new Buffer(util[_0x604e('0x5f')](_0x604e('0x64'),_0x4daa7b[_0x604e('0x57')],_0x4daa7b[_0x604e('0x58')]))[_0x604e('0x65')](_0x604e('0x66')));}return rp(_0x51f48e)[_0x604e('0x23')](function(_0x22e671){return _0xca43a4[_0x604e('0x67')](_[_0x604e('0x29')](_0x22e671[_0x604e('0x68')]['entries'],function(_0x4409a8){return{'id':_0x4409a8[_0x604e('0x27')],'name':_0x4409a8[_0x604e('0x27')],'type':_0x4409a8[_0x604e('0x51')],'active':_0x4409a8['active'],'label':_0x4409a8[_0x604e('0x69')],'custom':!![]};}));});}})[_0x604e('0x23')](function(_0x3fc120){return{'count':_0x3fc120[_0x604e('0x32')],'rows':_0x3fc120};})['then'](respondWithResult(_0x51063c,null))['catch'](function(_0x211252){var _0x14af29=_0x4d7889[_0x604e('0x2c')][_0x604e('0x6a')]?0x1f4:_0x211252[_0x604e('0x6b')]||0x1f4;logger[_0x604e('0x25')](_0x604e('0x6c'),'getFields',_0x14af29,JSON['stringify'](_0x211252));delete _0x211252[_0x604e('0x27')];if(_0x14af29===0x191){_0x14af29=0x190;}_0x51063c['status'](_0x14af29)[_0x604e('0x6d')](_0x4d7889[_0x604e('0x2c')][_0x604e('0x6a')]?{'message':_0x604e('0x6e'),'statusCode':_0x211252['statusCode']}:_0x211252);});}; \ No newline at end of file +var _0xedb8=['test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','DeskAccount','findAll','then','rows','catch','show','params','intersection','find','create','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','priority','remoteUri','authType','username','consumerSecret','tokenSecret','slice','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label'];(function(_0x1761ef,_0x35b061){var _0x229418=function(_0x1dfa4f){while(--_0x1dfa4f){_0x1761ef['push'](_0x1761ef['shift']());}};_0x229418(++_0x35b061);}(_0xedb8,0x157));var _0x8edb=function(_0x46e1b0,_0x145a6d){_0x46e1b0=_0x46e1b0-0x0;var _0x31520a=_0xedb8[_0x46e1b0];return _0x31520a;};'use strict';var emlformat=require(_0x8edb('0x0'));var rimraf=require(_0x8edb('0x1'));var zipdir=require(_0x8edb('0x2'));var jsonpatch=require(_0x8edb('0x3'));var rp=require('request-promise');var moment=require(_0x8edb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8edb('0x5'));var util=require('util');var path=require(_0x8edb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8edb('0x7'));var fs=require('fs');var fs_extra=require(_0x8edb('0x8'));var _=require(_0x8edb('0x9'));var squel=require('squel');var crypto=require(_0x8edb('0xa'));var jsforce=require(_0x8edb('0xb'));var deskjs=require(_0x8edb('0xc'));var toCsv=require(_0x8edb('0xd'));var querystring=require('querystring');var Papa=require(_0x8edb('0xe'));var Redis=require(_0x8edb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8edb('0x10'));var as=require(_0x8edb('0x11'));var hardwareService=require(_0x8edb('0x12'));var logger=require(_0x8edb('0x13'))(_0x8edb('0x14'));var utils=require(_0x8edb('0x15'));var config=require(_0x8edb('0x16'));var licenseUtil=require(_0x8edb('0x17'));var db=require(_0x8edb('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x34ad86,_0x1cae23){_0x1cae23=_0x1cae23||0xcc;return function(_0x297763){if(_0x297763){return _0x34ad86[_0x8edb('0x19')](_0x1cae23);}return _0x34ad86[_0x8edb('0x1a')](_0x1cae23)['end']();};}function respondWithResult(_0x647a63,_0x7f5cdb){_0x7f5cdb=_0x7f5cdb||0xc8;return function(_0x3603b8){if(_0x3603b8){return _0x647a63[_0x8edb('0x1a')](_0x7f5cdb)[_0x8edb('0x1b')](_0x3603b8);}};}function respondWithFilteredResult(_0x48ac67,_0xcf80e){return function(_0xf7da2e){if(_0xf7da2e){var _0x14000a=typeof _0xcf80e['offset']===_0x8edb('0x1c')&&typeof _0xcf80e[_0x8edb('0x1d')]===_0x8edb('0x1c');var _0x458f79=_0xf7da2e[_0x8edb('0x1e')];var _0x12b86b=_0x14000a?0x0:_0xcf80e[_0x8edb('0x1f')];var _0x730cf8=_0x14000a?_0xf7da2e[_0x8edb('0x1e')]:_0xcf80e[_0x8edb('0x1f')]+_0xcf80e[_0x8edb('0x1d')];var _0x1059bf;if(_0x730cf8>=_0x458f79){_0x730cf8=_0x458f79;_0x1059bf=0xc8;}else{_0x1059bf=0xce;}_0x48ac67['status'](_0x1059bf);return _0x48ac67[_0x8edb('0x20')](_0x8edb('0x21'),_0x12b86b+'-'+_0x730cf8+'/'+_0x458f79)[_0x8edb('0x1b')](_0xf7da2e);}return null;};}function patchUpdates(_0x4ac00b){return function(_0x4d4682){try{jsonpatch[_0x8edb('0x22')](_0x4d4682,_0x4ac00b,!![]);}catch(_0x1052df){return BPromise[_0x8edb('0x23')](_0x1052df);}return _0x4d4682['save']();};}function saveUpdates(_0x238051,_0x30928b){return function(_0x4356e9){if(_0x4356e9){return _0x4356e9[_0x8edb('0x24')](_0x238051)['then'](function(_0x41b76a){return _0x41b76a;});}return null;};}function removeEntity(_0xdbce11,_0x4d2b6a){return function(_0x37ed7b){if(_0x37ed7b){return _0x37ed7b[_0x8edb('0x25')]()['then'](function(){_0xdbce11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe70dc7,_0x53f2a1){return function(_0x30dc9a){if(!_0x30dc9a){_0xe70dc7[_0x8edb('0x19')](0x194);}return _0x30dc9a;};}function handleError(_0x3e428e,_0x2da582){_0x2da582=_0x2da582||0x1f4;return function(_0xa2d5ea){logger[_0x8edb('0x26')](_0xa2d5ea[_0x8edb('0x27')]);if(_0xa2d5ea[_0x8edb('0x28')]){delete _0xa2d5ea[_0x8edb('0x28')];}_0x3e428e[_0x8edb('0x1a')](_0x2da582)[_0x8edb('0x29')](_0xa2d5ea);};}exports[_0x8edb('0x2a')]=function(_0x353a0b,_0x1a1cda){var _0x2b46f4={},_0x22e72c={},_0x5de125={'count':0x0,'rows':[]};var _0x1010d0=_[_0x8edb('0x2b')](db['DeskAccount'][_0x8edb('0x2c')],function(_0x3ef815){return{'name':_0x3ef815[_0x8edb('0x2d')],'type':_0x3ef815[_0x8edb('0x2e')][_0x8edb('0x2f')]};});_0x22e72c['model']=_[_0x8edb('0x2b')](_0x1010d0,'name');_0x22e72c[_0x8edb('0x30')]=_[_0x8edb('0x31')](_0x353a0b[_0x8edb('0x30')]);_0x22e72c[_0x8edb('0x32')]=_['intersection'](_0x22e72c[_0x8edb('0x33')],_0x22e72c[_0x8edb('0x30')]);_0x2b46f4[_0x8edb('0x34')]=_['intersection'](_0x22e72c[_0x8edb('0x33')],qs[_0x8edb('0x35')](_0x353a0b['query']['fields']));_0x2b46f4[_0x8edb('0x34')]=_0x2b46f4['attributes'][_0x8edb('0x36')]?_0x2b46f4[_0x8edb('0x34')]:_0x22e72c[_0x8edb('0x33')];if(!_0x353a0b[_0x8edb('0x30')][_0x8edb('0x37')]('nolimit')){_0x2b46f4[_0x8edb('0x1d')]=qs[_0x8edb('0x1d')](_0x353a0b[_0x8edb('0x30')][_0x8edb('0x1d')]);_0x2b46f4[_0x8edb('0x1f')]=qs[_0x8edb('0x1f')](_0x353a0b[_0x8edb('0x30')][_0x8edb('0x1f')]);}_0x2b46f4[_0x8edb('0x38')]=qs[_0x8edb('0x39')](_0x353a0b['query'][_0x8edb('0x39')]);_0x2b46f4[_0x8edb('0x3a')]=qs[_0x8edb('0x32')](_[_0x8edb('0x3b')](_0x353a0b['query'],_0x22e72c['filters']),_0x1010d0);if(_0x353a0b[_0x8edb('0x30')]['filter']){_0x2b46f4[_0x8edb('0x3a')]=_[_0x8edb('0x3c')](_0x2b46f4[_0x8edb('0x3a')],{'$or':_[_0x8edb('0x2b')](_0x1010d0,function(_0xa9a426){if(_0xa9a426[_0x8edb('0x2e')]!=='VIRTUAL'){var _0x32643e={};_0x32643e[_0xa9a426[_0x8edb('0x28')]]={'$like':'%'+_0x353a0b[_0x8edb('0x30')][_0x8edb('0x3d')]+'%'};return _0x32643e;}})});}_0x2b46f4=_[_0x8edb('0x3c')]({},_0x2b46f4,_0x353a0b[_0x8edb('0x3e')]);var _0x4cc40c={'where':_0x2b46f4[_0x8edb('0x3a')]};return db['DeskAccount']['count'](_0x4cc40c)['then'](function(_0x236d4a){_0x5de125[_0x8edb('0x1e')]=_0x236d4a;if(_0x353a0b['query'][_0x8edb('0x3f')]){_0x2b46f4[_0x8edb('0x40')]=[{'all':!![]}];}return db[_0x8edb('0x41')][_0x8edb('0x42')](_0x2b46f4);})[_0x8edb('0x43')](function(_0x3863b0){_0x5de125[_0x8edb('0x44')]=_0x3863b0;return _0x5de125;})[_0x8edb('0x43')](respondWithFilteredResult(_0x1a1cda,_0x2b46f4))[_0x8edb('0x45')](handleError(_0x1a1cda,null));};exports[_0x8edb('0x46')]=function(_0x31836a,_0x4bca0a){var _0x89309b={'raw':![],'where':{'id':_0x31836a[_0x8edb('0x47')]['id']}},_0x518453={};_0x518453['model']=_[_0x8edb('0x31')](db[_0x8edb('0x41')]['rawAttributes']);_0x518453[_0x8edb('0x30')]=_[_0x8edb('0x31')](_0x31836a[_0x8edb('0x30')]);_0x518453[_0x8edb('0x32')]=_[_0x8edb('0x48')](_0x518453[_0x8edb('0x33')],_0x518453[_0x8edb('0x30')]);_0x89309b['attributes']=_[_0x8edb('0x48')](_0x518453[_0x8edb('0x33')],qs[_0x8edb('0x35')](_0x31836a[_0x8edb('0x30')][_0x8edb('0x35')]));_0x89309b[_0x8edb('0x34')]=_0x89309b[_0x8edb('0x34')][_0x8edb('0x36')]?_0x89309b['attributes']:_0x518453[_0x8edb('0x33')];if(_0x31836a[_0x8edb('0x30')][_0x8edb('0x3f')]){_0x89309b[_0x8edb('0x40')]=[{'all':!![]}];}_0x89309b=_[_0x8edb('0x3c')]({},_0x89309b,_0x31836a[_0x8edb('0x3e')]);return db[_0x8edb('0x41')][_0x8edb('0x49')](_0x89309b)[_0x8edb('0x43')](handleEntityNotFound(_0x4bca0a,null))['then'](respondWithResult(_0x4bca0a,null))[_0x8edb('0x45')](handleError(_0x4bca0a,null));};exports['create']=function(_0x748acd,_0x1b3063){return db['DeskAccount'][_0x8edb('0x4a')](_0x748acd[_0x8edb('0x4b')],{})[_0x8edb('0x43')](respondWithResult(_0x1b3063,0xc9))[_0x8edb('0x45')](handleError(_0x1b3063,null));};exports['update']=function(_0x1ec460,_0x5c441b){if(_0x1ec460[_0x8edb('0x4b')]['id']){delete _0x1ec460[_0x8edb('0x4b')]['id'];}return db[_0x8edb('0x41')][_0x8edb('0x49')]({'where':{'id':_0x1ec460['params']['id']}})[_0x8edb('0x43')](handleEntityNotFound(_0x5c441b,null))[_0x8edb('0x43')](saveUpdates(_0x1ec460[_0x8edb('0x4b')],null))['then'](respondWithResult(_0x5c441b,null))[_0x8edb('0x45')](handleError(_0x5c441b,null));};exports[_0x8edb('0x25')]=function(_0x2e52df,_0xbbd8ec){return db[_0x8edb('0x41')][_0x8edb('0x49')]({'where':{'id':_0x2e52df['params']['id']}})['then'](handleEntityNotFound(_0xbbd8ec,null))[_0x8edb('0x43')](removeEntity(_0xbbd8ec,null))[_0x8edb('0x45')](handleError(_0xbbd8ec,null));};exports[_0x8edb('0x4c')]=function(_0x444f32,_0x26e5b4,_0x27c011){var _0x5d7e64={};var _0x59c53c={};var _0xd26db7;var _0xbd573f;return db[_0x8edb('0x41')][_0x8edb('0x4d')]({'where':{'id':_0x444f32[_0x8edb('0x47')]['id']}})['then'](handleEntityNotFound(_0x26e5b4,null))[_0x8edb('0x43')](function(_0x1693ef){if(_0x1693ef){_0xd26db7=_0x1693ef;_0x59c53c[_0x8edb('0x33')]=_[_0x8edb('0x31')](db[_0x8edb('0x4e')]['rawAttributes']);_0x59c53c[_0x8edb('0x30')]=_[_0x8edb('0x31')](_0x444f32[_0x8edb('0x30')]);_0x59c53c['filters']=_['intersection'](_0x59c53c[_0x8edb('0x33')],_0x59c53c[_0x8edb('0x30')]);_0x5d7e64[_0x8edb('0x34')]=_['intersection'](_0x59c53c[_0x8edb('0x33')],qs[_0x8edb('0x35')](_0x444f32[_0x8edb('0x30')]['fields']));_0x5d7e64['attributes']=_0x5d7e64['attributes'][_0x8edb('0x36')]?_0x5d7e64[_0x8edb('0x34')]:_0x59c53c['model'];_0x5d7e64[_0x8edb('0x38')]=qs['sort'](_0x444f32[_0x8edb('0x30')][_0x8edb('0x39')]);_0x5d7e64[_0x8edb('0x3a')]=qs[_0x8edb('0x32')](_[_0x8edb('0x3b')](_0x444f32[_0x8edb('0x30')],_0x59c53c[_0x8edb('0x32')]));if(_0x444f32[_0x8edb('0x30')][_0x8edb('0x3d')]){_0x5d7e64[_0x8edb('0x3a')]=_[_0x8edb('0x3c')](_0x5d7e64[_0x8edb('0x3a')],{'$or':_[_0x8edb('0x2b')](_0x5d7e64['attributes'],function(_0xdc67b7){var _0xb8d548={};_0xb8d548[_0xdc67b7]={'$like':'%'+_0x444f32[_0x8edb('0x30')][_0x8edb('0x3d')]+'%'};return _0xb8d548;})});}_0x5d7e64=_['merge']({},_0x5d7e64,_0x444f32[_0x8edb('0x3e')]);return _0xd26db7[_0x8edb('0x4c')](_0x5d7e64);}})[_0x8edb('0x43')](function(_0x3c057a){if(_0x3c057a){_0xbd573f=_0x3c057a['length'];if(!_0x444f32[_0x8edb('0x30')][_0x8edb('0x37')]('nolimit')){_0x5d7e64[_0x8edb('0x1d')]=qs['limit'](_0x444f32[_0x8edb('0x30')]['limit']);_0x5d7e64[_0x8edb('0x1f')]=qs[_0x8edb('0x1f')](_0x444f32['query']['offset']);}return _0xd26db7[_0x8edb('0x4c')](_0x5d7e64);}})[_0x8edb('0x43')](function(_0x4c96ee){if(_0x4c96ee){return _0x4c96ee?{'count':_0xbd573f,'rows':_0x4c96ee}:null;}})[_0x8edb('0x43')](respondWithResult(_0x26e5b4,null))[_0x8edb('0x45')](handleError(_0x26e5b4,null));};exports[_0x8edb('0x4f')]=function(_0x42122d,_0x47263c,_0x49f51e){if(_0x42122d['body']['id']){delete _0x42122d[_0x8edb('0x4b')]['id'];}return db['DeskAccount'][_0x8edb('0x4d')]({'where':{'id':_0x42122d[_0x8edb('0x47')]['id']}})[_0x8edb('0x43')](handleEntityNotFound(_0x47263c,null))[_0x8edb('0x43')](function(_0x32cb00){if(_0x32cb00){_0x42122d[_0x8edb('0x4b')][_0x8edb('0x50')]=_0x32cb00['id'];_0x42122d[_0x8edb('0x4b')][_0x8edb('0x51')]=integrations[_0x8edb('0x52')](_0x42122d[_0x8edb('0x4b')][_0x8edb('0x53')],_0x42122d[_0x8edb('0x4b')][_0x8edb('0x2e')]);_0x42122d['body'][_0x8edb('0x54')]=integrations[_0x8edb('0x55')](_0x42122d[_0x8edb('0x4b')][_0x8edb('0x53')],_0x42122d[_0x8edb('0x4b')][_0x8edb('0x2e')]);return db[_0x8edb('0x4e')]['create'](_0x42122d['body'],{'include':[{'model':db['DeskField'],'as':_0x8edb('0x51')},{'model':db['DeskField'],'as':_0x8edb('0x54')}]});}return null;})['then'](respondWithResult(_0x47263c,null))[_0x8edb('0x45')](handleError(_0x47263c,null));};exports[_0x8edb('0x56')]=function(_0x4df90a,_0x1bf862,_0x3eeaee){var _0x20c315=[{'name':_0x8edb('0x57'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5833b7='';return db[_0x8edb('0x41')][_0x8edb('0x4d')]({'where':{'id':_0x4df90a['params']['id']},'attributes':['id',_0x8edb('0x58'),_0x8edb('0x59'),_0x8edb('0x5a'),'password','consumerKey',_0x8edb('0x5b'),'token',_0x8edb('0x5c')]})['then'](handleEntityNotFound(_0x1bf862,null))[_0x8edb('0x43')](function(_0xfe38ff){if(_0xfe38ff){_0x5833b7=_0xfe38ff[_0x8edb('0x58')];var _0x5ae47d=_0x5833b7[_0x8edb('0x5d')](-0x1);if(_0x5ae47d==='/'){_0x5833b7=_0x5833b7['substring'](0x0,_0x5833b7['lastIndexOf'](_0x5ae47d));}var _0x2b1bda={'method':_0x8edb('0x5e'),'uri':util[_0x8edb('0x5f')](_0x8edb('0x60'),_0x5833b7),'headers':{'Content-Type':'application/json','Accept':_0x8edb('0x61')},'json':!![]};if(_0xfe38ff[_0x8edb('0x59')]==='basic'){_0x2b1bda[_0x8edb('0x62')][_0x8edb('0x63')]=util[_0x8edb('0x5f')](_0x8edb('0x64'),new Buffer(util[_0x8edb('0x5f')](_0x8edb('0x65'),_0xfe38ff['username'],_0xfe38ff['password']))[_0x8edb('0x66')](_0x8edb('0x67')));}return rp(_0x2b1bda)[_0x8edb('0x43')](function(_0x50f7da){return _0x20c315[_0x8edb('0x68')](_[_0x8edb('0x2b')](_0x50f7da[_0x8edb('0x69')][_0x8edb('0x6a')],function(_0x52cf69){return{'id':_0x52cf69[_0x8edb('0x28')],'name':_0x52cf69[_0x8edb('0x28')],'type':_0x52cf69[_0x8edb('0x2e')],'active':_0x52cf69[_0x8edb('0x6b')],'label':_0x52cf69[_0x8edb('0x6c')],'custom':!![]};}));});}})[_0x8edb('0x43')](function(_0x20a926){return{'count':_0x20a926[_0x8edb('0x36')],'rows':_0x20a926};})['then'](respondWithResult(_0x1bf862,null))[_0x8edb('0x45')](function(_0x52f4c1){var _0x572477=_0x4df90a[_0x8edb('0x30')][_0x8edb('0x6d')]?0x1f4:_0x52f4c1['statusCode']||0x1f4;logger[_0x8edb('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x572477,JSON[_0x8edb('0x6e')](_0x52f4c1));delete _0x52f4c1[_0x8edb('0x28')];if(_0x572477===0x191){_0x572477=0x190;}_0x1bf862['status'](_0x572477)[_0x8edb('0x29')](_0x4df90a['query'][_0x8edb('0x6d')]?{'message':_0x8edb('0x6f'),'statusCode':_0x52f4c1[_0x8edb('0x70')]}:_0x52f4c1);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 92f7cd4..759f2e5 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 _0xf125=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api'];(function(_0xf67bbf,_0x44dda9){var _0x2b99c7=function(_0x4b264e){while(--_0x4b264e){_0xf67bbf['push'](_0xf67bbf['shift']());}};_0x2b99c7(++_0x44dda9);}(_0xf125,0x191));var _0x5f12=function(_0x52eff0,_0x3bf7ee){_0x52eff0=_0x52eff0-0x0;var _0x3f217d=_0xf125[_0x52eff0];return _0x3f217d;};'use strict';var _=require(_0x5f12('0x0'));var util=require(_0x5f12('0x1'));var logger=require(_0x5f12('0x2'))(_0x5f12('0x3'));var moment=require(_0x5f12('0x4'));var BPromise=require(_0x5f12('0x5'));var rp=require(_0x5f12('0x6'));var fs=require('fs');var path=require(_0x5f12('0x7'));var rimraf=require(_0x5f12('0x8'));var config=require(_0x5f12('0x9'));var attributes=require(_0x5f12('0xa'));var integrations=require('../../components/integrations/configuration');module[_0x5f12('0xb')]=function(_0x18106d,_0x34965b){return _0x18106d[_0x5f12('0xc')](_0x5f12('0xd'),attributes,{'tableName':_0x5f12('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b60=['./intDeskAccount.attributes','../../components/integrations/configuration','define','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x552f82,_0x14ad8c){var _0x211639=function(_0x4e929a){while(--_0x4e929a){_0x552f82['push'](_0x552f82['shift']());}};_0x211639(++_0x14ad8c);}(_0x1b60,0x130));var _0x01b6=function(_0xbdc283,_0x5e0184){_0xbdc283=_0xbdc283-0x0;var _0x319b3d=_0x1b60[_0xbdc283];return _0x319b3d;};'use strict';var _=require(_0x01b6('0x0'));var util=require(_0x01b6('0x1'));var logger=require(_0x01b6('0x2'))(_0x01b6('0x3'));var moment=require('moment');var BPromise=require(_0x01b6('0x4'));var rp=require(_0x01b6('0x5'));var fs=require('fs');var path=require(_0x01b6('0x6'));var rimraf=require(_0x01b6('0x7'));var config=require('../../config/environment');var attributes=require(_0x01b6('0x8'));var integrations=require(_0x01b6('0x9'));module['exports']=function(_0x4c1284,_0x4ee402){return _0x4c1284[_0x01b6('0xa')]('DeskAccount',attributes,{'tableName':_0x01b6('0xb'),'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 3f00ce3..db20d2c 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 _0x7b47=['map','include','model','then','catch','ShowDeskAccount','find','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes'];(function(_0x533cdf,_0x4087d2){var _0xd91753=function(_0x4ad080){while(--_0x4ad080){_0x533cdf['push'](_0x533cdf['shift']());}};_0xd91753(++_0x4087d2);}(_0x7b47,0x15b));var _0x77b4=function(_0xd15174,_0x2101e5){_0xd15174=_0xd15174-0x0;var _0x3aca0e=_0x7b47[_0xd15174];return _0x3aca0e;};'use strict';var _=require(_0x77b4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x77b4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77b4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x77b4('0x3'));var logger=require(_0x77b4('0x4'))(_0x77b4('0x5'));var config=require(_0x77b4('0x6'));var jayson=require(_0x77b4('0x7'));var client=jayson[_0x77b4('0x8')][_0x77b4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45532b,_0x22e007,_0x4fd875){return new BPromise(function(_0x2eea4d,_0x5e9d0f){return client['request'](_0x45532b,_0x4fd875)['then'](function(_0xb067e1){logger[_0x77b4('0xa')](_0x77b4('0xb'),_0x22e007,_0x77b4('0xc'));logger[_0x77b4('0xd')](_0x77b4('0xe'),_0x22e007,_0x77b4('0xc'),JSON[_0x77b4('0xf')](_0xb067e1));if(_0xb067e1[_0x77b4('0x10')]){if(_0xb067e1[_0x77b4('0x10')][_0x77b4('0x11')]===0x1f4){logger[_0x77b4('0x10')](_0x77b4('0xb'),_0x22e007,_0xb067e1[_0x77b4('0x10')][_0x77b4('0x12')]);return _0x5e9d0f(_0xb067e1[_0x77b4('0x10')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x22e007,_0xb067e1[_0x77b4('0x10')][_0x77b4('0x12')]);return _0x2eea4d(_0xb067e1[_0x77b4('0x10')][_0x77b4('0x12')]);}else{logger[_0x77b4('0xa')](_0x77b4('0xb'),_0x22e007,'request\x20sent');_0x2eea4d(_0xb067e1[_0x77b4('0x13')]['message']);}})['catch'](function(_0x38b70f){logger[_0x77b4('0x10')](_0x77b4('0xb'),_0x22e007,_0x38b70f);_0x5e9d0f(_0x38b70f);});});}exports[_0x77b4('0x14')]=function(_0x498acd){var _0xae7437=this;return new Promise(function(_0x4711c7,_0x21366a){return db[_0x77b4('0x15')][_0x77b4('0x16')]({'raw':_0x498acd[_0x77b4('0x17')]?_0x498acd[_0x77b4('0x17')][_0x77b4('0x18')]===undefined?!![]:![]:!![],'where':_0x498acd['options']?_0x498acd['options'][_0x77b4('0x19')]||null:null,'attributes':_0x498acd['options']?_0x498acd[_0x77b4('0x17')][_0x77b4('0x1a')]||null:null,'limit':_0x498acd[_0x77b4('0x17')]?_0x498acd[_0x77b4('0x17')]['limit']||null:null,'include':_0x498acd[_0x77b4('0x17')]?_0x498acd[_0x77b4('0x17')]['include']?_[_0x77b4('0x1b')](_0x498acd[_0x77b4('0x17')][_0x77b4('0x1c')],function(_0xc8642c){return{'model':db[_0xc8642c[_0x77b4('0x1d')]],'as':_0xc8642c['as'],'attributes':_0xc8642c[_0x77b4('0x1a')],'include':_0xc8642c[_0x77b4('0x1c')]?_[_0x77b4('0x1b')](_0xc8642c[_0x77b4('0x1c')],function(_0x446077){return{'model':db[_0x446077[_0x77b4('0x1d')]],'as':_0x446077['as'],'attributes':_0x446077['attributes'],'include':_0x446077[_0x77b4('0x1c')]?_['map'](_0x446077[_0x77b4('0x1c')],function(_0x46a6ab){return{'model':db[_0x46a6ab[_0x77b4('0x1d')]],'as':_0x46a6ab['as'],'attributes':_0x46a6ab[_0x77b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x77b4('0x1e')](function(_0x9ede86){logger[_0x77b4('0xa')](_0x77b4('0x14'),_0x498acd);logger[_0x77b4('0xd')](_0x77b4('0x14'),_0x498acd,JSON[_0x77b4('0xf')](_0x9ede86));_0x4711c7(_0x9ede86);})[_0x77b4('0x1f')](function(_0x6534b5){logger[_0x77b4('0x10')](_0x77b4('0x14'),_0x6534b5[_0x77b4('0x12')],_0x498acd);_0x21366a(_0xae7437[_0x77b4('0x10')](0x1f4,_0x6534b5[_0x77b4('0x12')]));});});};exports[_0x77b4('0x20')]=function(_0x24b78c){var _0x23a54b=this;return new Promise(function(_0x378270,_0x5db0b1){return db[_0x77b4('0x15')][_0x77b4('0x21')]({'raw':_0x24b78c[_0x77b4('0x17')]?_0x24b78c[_0x77b4('0x17')][_0x77b4('0x18')]===undefined?!![]:![]:!![],'where':_0x24b78c[_0x77b4('0x17')]?_0x24b78c[_0x77b4('0x17')][_0x77b4('0x19')]||null:null,'attributes':_0x24b78c[_0x77b4('0x17')]?_0x24b78c['options']['attributes']||null:null,'include':_0x24b78c[_0x77b4('0x17')]?_0x24b78c[_0x77b4('0x17')][_0x77b4('0x1c')]?_['map'](_0x24b78c[_0x77b4('0x17')][_0x77b4('0x1c')],function(_0x35152f){return{'model':db[_0x35152f[_0x77b4('0x1d')]],'as':_0x35152f['as'],'attributes':_0x35152f[_0x77b4('0x1a')],'include':_0x35152f[_0x77b4('0x1c')]?_[_0x77b4('0x1b')](_0x35152f[_0x77b4('0x1c')],function(_0x85c7bf){return{'model':db[_0x85c7bf[_0x77b4('0x1d')]],'as':_0x85c7bf['as'],'attributes':_0x85c7bf[_0x77b4('0x1a')],'include':_0x85c7bf[_0x77b4('0x1c')]?_['map'](_0x85c7bf[_0x77b4('0x1c')],function(_0x1be22a){return{'model':db[_0x1be22a['model']],'as':_0x1be22a['as'],'attributes':_0x1be22a[_0x77b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x77b4('0x1e')](function(_0x485e18){logger[_0x77b4('0xa')](_0x77b4('0x20'),_0x24b78c);logger['debug'](_0x77b4('0x20'),_0x24b78c,JSON[_0x77b4('0xf')](_0x485e18));_0x378270(_0x485e18);})[_0x77b4('0x1f')](function(_0x12f314){logger['error']('ShowDeskAccount',_0x12f314[_0x77b4('0x12')],_0x24b78c);_0x5db0b1(_0x23a54b[_0x77b4('0x10')](0x1f4,_0x12f314[_0x77b4('0x12')]));});});}; \ No newline at end of file +var _0x8881=['attributes','include','map','model','stringify','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where'];(function(_0x3e4584,_0x2ab0df){var _0x2f574c=function(_0x4ed59d){while(--_0x4ed59d){_0x3e4584['push'](_0x3e4584['shift']());}};_0x2f574c(++_0x2ab0df);}(_0x8881,0x151));var _0x1888=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x8881[_0x120376];return _0x28c529;};'use strict';var _=require(_0x1888('0x0'));var util=require(_0x1888('0x1'));var moment=require(_0x1888('0x2'));var BPromise=require(_0x1888('0x3'));var rs=require(_0x1888('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1888('0x5'))['db'];var utils=require(_0x1888('0x6'));var logger=require(_0x1888('0x7'))('rpc');var config=require(_0x1888('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1888('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7a51,_0x53400f,_0x3c2362){return new BPromise(function(_0x527511,_0x41cca5){return client[_0x1888('0xa')](_0x3f7a51,_0x3c2362)[_0x1888('0xb')](function(_0x1165aa){logger[_0x1888('0xc')](_0x1888('0xd'),_0x53400f,_0x1888('0xe'));logger[_0x1888('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x53400f,_0x1888('0xe'),JSON['stringify'](_0x1165aa));if(_0x1165aa['error']){if(_0x1165aa[_0x1888('0x10')][_0x1888('0x11')]===0x1f4){logger[_0x1888('0x10')]('DeskAccount,\x20%s,\x20%s',_0x53400f,_0x1165aa['error'][_0x1888('0x12')]);return _0x41cca5(_0x1165aa[_0x1888('0x10')]['message']);}logger[_0x1888('0x10')](_0x1888('0xd'),_0x53400f,_0x1165aa[_0x1888('0x10')][_0x1888('0x12')]);return _0x527511(_0x1165aa['error']['message']);}else{logger[_0x1888('0xc')](_0x1888('0xd'),_0x53400f,_0x1888('0xe'));_0x527511(_0x1165aa[_0x1888('0x13')][_0x1888('0x12')]);}})[_0x1888('0x14')](function(_0x5b8ece){logger[_0x1888('0x10')](_0x1888('0xd'),_0x53400f,_0x5b8ece);_0x41cca5(_0x5b8ece);});});}exports[_0x1888('0x15')]=function(_0x2b6500){var _0x56133d=this;return new Promise(function(_0x32eb47,_0x5e0c7d){return db[_0x1888('0x16')]['findAll']({'raw':_0x2b6500[_0x1888('0x17')]?_0x2b6500[_0x1888('0x17')][_0x1888('0x18')]===undefined?!![]:![]:!![],'where':_0x2b6500[_0x1888('0x17')]?_0x2b6500[_0x1888('0x17')][_0x1888('0x19')]||null:null,'attributes':_0x2b6500[_0x1888('0x17')]?_0x2b6500[_0x1888('0x17')][_0x1888('0x1a')]||null:null,'limit':_0x2b6500[_0x1888('0x17')]?_0x2b6500[_0x1888('0x17')]['limit']||null:null,'include':_0x2b6500[_0x1888('0x17')]?_0x2b6500[_0x1888('0x17')][_0x1888('0x1b')]?_[_0x1888('0x1c')](_0x2b6500['options']['include'],function(_0x361785){return{'model':db[_0x361785[_0x1888('0x1d')]],'as':_0x361785['as'],'attributes':_0x361785['attributes'],'include':_0x361785[_0x1888('0x1b')]?_[_0x1888('0x1c')](_0x361785[_0x1888('0x1b')],function(_0x4fdc82){return{'model':db[_0x4fdc82['model']],'as':_0x4fdc82['as'],'attributes':_0x4fdc82[_0x1888('0x1a')],'include':_0x4fdc82['include']?_[_0x1888('0x1c')](_0x4fdc82[_0x1888('0x1b')],function(_0x457ad7){return{'model':db[_0x457ad7[_0x1888('0x1d')]],'as':_0x457ad7['as'],'attributes':_0x457ad7['attributes']};}):[]};}):[]};}):[]:[]})[_0x1888('0xb')](function(_0x232439){logger['info']('GetDeskAccount',_0x2b6500);logger[_0x1888('0xf')](_0x1888('0x15'),_0x2b6500,JSON[_0x1888('0x1e')](_0x232439));_0x32eb47(_0x232439);})[_0x1888('0x14')](function(_0xbce24a){logger[_0x1888('0x10')]('GetDeskAccount',_0xbce24a[_0x1888('0x12')],_0x2b6500);_0x5e0c7d(_0x56133d[_0x1888('0x10')](0x1f4,_0xbce24a[_0x1888('0x12')]));});});};exports[_0x1888('0x1f')]=function(_0x10ef53){var _0x4ebfb6=this;return new Promise(function(_0x461a6c,_0xe7074b){return db[_0x1888('0x16')][_0x1888('0x20')]({'raw':_0x10ef53[_0x1888('0x17')]?_0x10ef53[_0x1888('0x17')][_0x1888('0x18')]===undefined?!![]:![]:!![],'where':_0x10ef53['options']?_0x10ef53[_0x1888('0x17')][_0x1888('0x19')]||null:null,'attributes':_0x10ef53[_0x1888('0x17')]?_0x10ef53['options'][_0x1888('0x1a')]||null:null,'include':_0x10ef53[_0x1888('0x17')]?_0x10ef53[_0x1888('0x17')][_0x1888('0x1b')]?_[_0x1888('0x1c')](_0x10ef53['options']['include'],function(_0x305151){return{'model':db[_0x305151[_0x1888('0x1d')]],'as':_0x305151['as'],'attributes':_0x305151['attributes'],'include':_0x305151[_0x1888('0x1b')]?_[_0x1888('0x1c')](_0x305151['include'],function(_0x25a131){return{'model':db[_0x25a131[_0x1888('0x1d')]],'as':_0x25a131['as'],'attributes':_0x25a131[_0x1888('0x1a')],'include':_0x25a131[_0x1888('0x1b')]?_['map'](_0x25a131[_0x1888('0x1b')],function(_0x4d46f0){return{'model':db[_0x4d46f0[_0x1888('0x1d')]],'as':_0x4d46f0['as'],'attributes':_0x4d46f0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x366e60){logger[_0x1888('0xc')](_0x1888('0x1f'),_0x10ef53);logger['debug']('ShowDeskAccount',_0x10ef53,JSON['stringify'](_0x366e60));_0x461a6c(_0x366e60);})[_0x1888('0x14')](function(_0x268063){logger[_0x1888('0x10')](_0x1888('0x1f'),_0x268063[_0x1888('0x12')],_0x10ef53);_0xe7074b(_0x4ebfb6[_0x1888('0x10')](0x1f4,_0x268063[_0x1888('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 8bdbda2..ab6151d 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x28a216,_0x47fda3){var _0x116c2c=function(_0xab3bce){while(--_0xab3bce){_0x28a216['push'](_0x28a216['shift']());}};_0x116c2c(++_0x47fda3);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x55ca,0x126));var _0xa55c=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0x55ca[_0x561771];return _0x54d16e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 7d998c9..0326347 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 _0x8297=['STRING','exports'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8297,0x107));var _0x7829=function(_0x54f8b6,_0x4efee3){_0x54f8b6=_0x54f8b6-0x0;var _0xd4afad=_0x8297[_0x54f8b6];return _0xd4afad;};'use strict';var Sequelize=require('sequelize');module[_0x7829('0x0')]={'name':{'type':Sequelize[_0x7829('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3de8=['exports','STRING','sequelize'];(function(_0x441861,_0x3ebe23){var _0x2498f2=function(_0x1b574a){while(--_0x1b574a){_0x441861['push'](_0x441861['shift']());}};_0x2498f2(++_0x3ebe23);}(_0x3de8,0x1e5));var _0x83de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3de8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x83de('0x0'));module[_0x83de('0x1')]={'name':{'type':Sequelize[_0x83de('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 82684e1..d7a0579 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 _0x0c41=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','DeskConfiguration','include','findAll','rows','catch','includeAll','find','create','body','params','getFields','findOne','DeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','undefined','count','offset','limit','Content-Range','json','apply','update','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x14c461,_0x4a4047){var _0x3f8601=function(_0x4e9e3a){while(--_0x4e9e3a){_0x14c461['push'](_0x14c461['shift']());}};_0x3f8601(++_0x4a4047);}(_0x0c41,0x1ba));var _0x10c4=function(_0x24c896,_0x1cd675){_0x24c896=_0x24c896-0x0;var _0x2c836e=_0x0c41[_0x24c896];return _0x2c836e;};'use strict';var emlformat=require(_0x10c4('0x0'));var rimraf=require(_0x10c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10c4('0x2'));var rp=require(_0x10c4('0x3'));var moment=require(_0x10c4('0x4'));var BPromise=require(_0x10c4('0x5'));var Mustache=require('mustache');var util=require(_0x10c4('0x6'));var path=require(_0x10c4('0x7'));var sox=require(_0x10c4('0x8'));var csv=require(_0x10c4('0x9'));var ejs=require(_0x10c4('0xa'));var fs=require('fs');var fs_extra=require(_0x10c4('0xb'));var _=require('lodash');var squel=require(_0x10c4('0xc'));var crypto=require(_0x10c4('0xd'));var jsforce=require(_0x10c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x10c4('0x9'));var querystring=require(_0x10c4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x10c4('0x10'));var qs=require(_0x10c4('0x11'));var as=require(_0x10c4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x10c4('0x13'));var utils=require(_0x10c4('0x14'));var config=require(_0x10c4('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45612e,_0x1585be){_0x1585be=_0x1585be||0xcc;return function(_0x3394c7){if(_0x3394c7){return _0x45612e['sendStatus'](_0x1585be);}return _0x45612e[_0x10c4('0x16')](_0x1585be)['end']();};}function respondWithResult(_0x24a3c2,_0xd8e004){_0xd8e004=_0xd8e004||0xc8;return function(_0x5174ae){if(_0x5174ae){return _0x24a3c2[_0x10c4('0x16')](_0xd8e004)['json'](_0x5174ae);}};}function respondWithFilteredResult(_0x31cecb,_0x1afcdb){return function(_0x591072){if(_0x591072){var _0x38a718=typeof _0x1afcdb['offset']==='undefined'&&typeof _0x1afcdb['limit']===_0x10c4('0x17');var _0x16166c=_0x591072[_0x10c4('0x18')];var _0x38f692=_0x38a718?0x0:_0x1afcdb[_0x10c4('0x19')];var _0x2a6842=_0x38a718?_0x591072[_0x10c4('0x18')]:_0x1afcdb['offset']+_0x1afcdb[_0x10c4('0x1a')];var _0x1b30ec;if(_0x2a6842>=_0x16166c){_0x2a6842=_0x16166c;_0x1b30ec=0xc8;}else{_0x1b30ec=0xce;}_0x31cecb['status'](_0x1b30ec);return _0x31cecb['set'](_0x10c4('0x1b'),_0x38f692+'-'+_0x2a6842+'/'+_0x16166c)[_0x10c4('0x1c')](_0x591072);}return null;};}function patchUpdates(_0x28e82b){return function(_0x4be217){try{jsonpatch[_0x10c4('0x1d')](_0x4be217,_0x28e82b,!![]);}catch(_0x19aba6){return BPromise['reject'](_0x19aba6);}return _0x4be217['save']();};}function saveUpdates(_0x3ad1b2,_0x1dfff3){return function(_0x163f1b){if(_0x163f1b){return _0x163f1b[_0x10c4('0x1e')](_0x3ad1b2)[_0x10c4('0x1f')](function(_0xb9aa4e){return _0xb9aa4e;});}return null;};}function removeEntity(_0x4c9ecc,_0x2508a3){return function(_0x41c091){if(_0x41c091){return _0x41c091[_0x10c4('0x20')]()[_0x10c4('0x1f')](function(){_0x4c9ecc[_0x10c4('0x16')](0xcc)[_0x10c4('0x21')]();});}};}function handleEntityNotFound(_0x18db8a,_0x23f12b){return function(_0x8e4c03){if(!_0x8e4c03){_0x18db8a[_0x10c4('0x22')](0x194);}return _0x8e4c03;};}function handleError(_0x456204,_0x116025){_0x116025=_0x116025||0x1f4;return function(_0x22b099){logger['error'](_0x22b099[_0x10c4('0x23')]);if(_0x22b099[_0x10c4('0x24')]){delete _0x22b099[_0x10c4('0x24')];}_0x456204['status'](_0x116025)[_0x10c4('0x25')](_0x22b099);};}exports[_0x10c4('0x26')]=function(_0x555946,_0x5bb953){var _0x8e794d={},_0x197d5d={},_0x3cf91e={'count':0x0,'rows':[]};var _0x26bf2f=_[_0x10c4('0x27')](db['DeskConfiguration'][_0x10c4('0x28')],function(_0x509f97){return{'name':_0x509f97[_0x10c4('0x29')],'type':_0x509f97[_0x10c4('0x2a')][_0x10c4('0x2b')]};});_0x197d5d[_0x10c4('0x2c')]=_[_0x10c4('0x27')](_0x26bf2f,_0x10c4('0x24'));_0x197d5d[_0x10c4('0x2d')]=_[_0x10c4('0x2e')](_0x555946[_0x10c4('0x2d')]);_0x197d5d[_0x10c4('0x2f')]=_[_0x10c4('0x30')](_0x197d5d[_0x10c4('0x2c')],_0x197d5d[_0x10c4('0x2d')]);_0x8e794d[_0x10c4('0x31')]=_['intersection'](_0x197d5d[_0x10c4('0x2c')],qs['fields'](_0x555946[_0x10c4('0x2d')][_0x10c4('0x32')]));_0x8e794d[_0x10c4('0x31')]=_0x8e794d[_0x10c4('0x31')][_0x10c4('0x33')]?_0x8e794d[_0x10c4('0x31')]:_0x197d5d[_0x10c4('0x2c')];if(!_0x555946[_0x10c4('0x2d')][_0x10c4('0x34')](_0x10c4('0x35'))){_0x8e794d['limit']=qs[_0x10c4('0x1a')](_0x555946[_0x10c4('0x2d')]['limit']);_0x8e794d[_0x10c4('0x19')]=qs[_0x10c4('0x19')](_0x555946[_0x10c4('0x2d')][_0x10c4('0x19')]);}_0x8e794d['order']=qs['sort'](_0x555946[_0x10c4('0x2d')][_0x10c4('0x36')]);_0x8e794d[_0x10c4('0x37')]=qs[_0x10c4('0x2f')](_[_0x10c4('0x38')](_0x555946[_0x10c4('0x2d')],_0x197d5d[_0x10c4('0x2f')]),_0x26bf2f);if(_0x555946[_0x10c4('0x2d')][_0x10c4('0x39')]){_0x8e794d[_0x10c4('0x37')]=_['merge'](_0x8e794d[_0x10c4('0x37')],{'$or':_[_0x10c4('0x27')](_0x26bf2f,function(_0x9c6dac){if(_0x9c6dac[_0x10c4('0x2a')]!==_0x10c4('0x3a')){var _0x5e2d74={};_0x5e2d74[_0x9c6dac[_0x10c4('0x24')]]={'$like':'%'+_0x555946[_0x10c4('0x2d')][_0x10c4('0x39')]+'%'};return _0x5e2d74;}})});}_0x8e794d=_[_0x10c4('0x3b')]({},_0x8e794d,_0x555946[_0x10c4('0x3c')]);var _0x5d6f64={'where':_0x8e794d[_0x10c4('0x37')]};return db[_0x10c4('0x3d')][_0x10c4('0x18')](_0x5d6f64)[_0x10c4('0x1f')](function(_0x3cb575){_0x3cf91e[_0x10c4('0x18')]=_0x3cb575;if(_0x555946[_0x10c4('0x2d')]['includeAll']){_0x8e794d[_0x10c4('0x3e')]=[{'all':!![]}];}return db[_0x10c4('0x3d')][_0x10c4('0x3f')](_0x8e794d);})['then'](function(_0x20f966){_0x3cf91e[_0x10c4('0x40')]=_0x20f966;return _0x3cf91e;})[_0x10c4('0x1f')](respondWithFilteredResult(_0x5bb953,_0x8e794d))[_0x10c4('0x41')](handleError(_0x5bb953,null));};exports['show']=function(_0x103099,_0x3f5bae){var _0x488fda={'raw':![],'where':{'id':_0x103099['params']['id']}},_0x2d921a={};_0x2d921a[_0x10c4('0x2c')]=_['keys'](db[_0x10c4('0x3d')][_0x10c4('0x28')]);_0x2d921a[_0x10c4('0x2d')]=_[_0x10c4('0x2e')](_0x103099[_0x10c4('0x2d')]);_0x2d921a[_0x10c4('0x2f')]=_['intersection'](_0x2d921a[_0x10c4('0x2c')],_0x2d921a[_0x10c4('0x2d')]);_0x488fda[_0x10c4('0x31')]=_[_0x10c4('0x30')](_0x2d921a['model'],qs['fields'](_0x103099[_0x10c4('0x2d')][_0x10c4('0x32')]));_0x488fda[_0x10c4('0x31')]=_0x488fda[_0x10c4('0x31')][_0x10c4('0x33')]?_0x488fda['attributes']:_0x2d921a[_0x10c4('0x2c')];if(_0x103099[_0x10c4('0x2d')][_0x10c4('0x42')]){_0x488fda['include']=[{'all':!![]}];}_0x488fda=_[_0x10c4('0x3b')]({},_0x488fda,_0x103099['options']);return db[_0x10c4('0x3d')][_0x10c4('0x43')](_0x488fda)[_0x10c4('0x1f')](handleEntityNotFound(_0x3f5bae,null))[_0x10c4('0x1f')](respondWithResult(_0x3f5bae,null))[_0x10c4('0x41')](handleError(_0x3f5bae,null));};exports[_0x10c4('0x44')]=function(_0x3aea8d,_0x5366fa){return db[_0x10c4('0x3d')][_0x10c4('0x44')](_0x3aea8d[_0x10c4('0x45')],{})[_0x10c4('0x1f')](respondWithResult(_0x5366fa,0xc9))[_0x10c4('0x41')](handleError(_0x5366fa,null));};exports['update']=function(_0x5686f7,_0x255d79){if(_0x5686f7['body']['id']){delete _0x5686f7[_0x10c4('0x45')]['id'];}return db[_0x10c4('0x3d')][_0x10c4('0x43')]({'where':{'id':_0x5686f7[_0x10c4('0x46')]['id']}})[_0x10c4('0x1f')](handleEntityNotFound(_0x255d79,null))['then'](saveUpdates(_0x5686f7[_0x10c4('0x45')],null))['then'](respondWithResult(_0x255d79,null))[_0x10c4('0x41')](handleError(_0x255d79,null));};exports['destroy']=function(_0x44939d,_0xcb1232){return db[_0x10c4('0x3d')]['find']({'where':{'id':_0x44939d[_0x10c4('0x46')]['id']}})['then'](handleEntityNotFound(_0xcb1232,null))[_0x10c4('0x1f')](removeEntity(_0xcb1232,null))[_0x10c4('0x41')](handleError(_0xcb1232,null));};exports[_0x10c4('0x47')]=function(_0x3a5715,_0x7bfa86,_0x4d4964){var _0x1a7f66={};var _0x55f520={};var _0x2a56c2;var _0x2a8c53;return db[_0x10c4('0x3d')][_0x10c4('0x48')]({'where':{'id':_0x3a5715[_0x10c4('0x46')]['id']}})[_0x10c4('0x1f')](handleEntityNotFound(_0x7bfa86,null))[_0x10c4('0x1f')](function(_0x2bd19b){if(_0x2bd19b){_0x2a56c2=_0x2bd19b;_0x55f520['model']=_[_0x10c4('0x2e')](db[_0x10c4('0x49')]['rawAttributes']);_0x55f520['query']=_['keys'](_0x3a5715[_0x10c4('0x2d')]);_0x55f520[_0x10c4('0x2f')]=_[_0x10c4('0x30')](_0x55f520[_0x10c4('0x2c')],_0x55f520[_0x10c4('0x2d')]);_0x1a7f66[_0x10c4('0x31')]=_[_0x10c4('0x30')](_0x55f520[_0x10c4('0x2c')],qs[_0x10c4('0x32')](_0x3a5715[_0x10c4('0x2d')][_0x10c4('0x32')]));_0x1a7f66[_0x10c4('0x31')]=_0x1a7f66['attributes'][_0x10c4('0x33')]?_0x1a7f66[_0x10c4('0x31')]:_0x55f520[_0x10c4('0x2c')];_0x1a7f66[_0x10c4('0x4a')]=qs['sort'](_0x3a5715[_0x10c4('0x2d')]['sort']);_0x1a7f66['where']=qs[_0x10c4('0x2f')](_[_0x10c4('0x38')](_0x3a5715['query'],_0x55f520[_0x10c4('0x2f')]));if(_0x3a5715[_0x10c4('0x2d')]['filter']){_0x1a7f66['where']=_[_0x10c4('0x3b')](_0x1a7f66['where'],{'$or':_['map'](_0x1a7f66[_0x10c4('0x31')],function(_0x48fca7){var _0x42b5b4={};_0x42b5b4[_0x48fca7]={'$like':'%'+_0x3a5715[_0x10c4('0x2d')][_0x10c4('0x39')]+'%'};return _0x42b5b4;})});}_0x1a7f66=_['merge']({},_0x1a7f66,_0x3a5715[_0x10c4('0x3c')]);return _0x2a56c2[_0x10c4('0x47')](_0x1a7f66);}})[_0x10c4('0x1f')](function(_0x154cb0){if(_0x154cb0){_0x2a8c53=_0x154cb0[_0x10c4('0x33')];if(!_0x3a5715[_0x10c4('0x2d')][_0x10c4('0x34')](_0x10c4('0x35'))){_0x1a7f66['limit']=qs[_0x10c4('0x1a')](_0x3a5715['query'][_0x10c4('0x1a')]);_0x1a7f66['offset']=qs[_0x10c4('0x19')](_0x3a5715[_0x10c4('0x2d')][_0x10c4('0x19')]);}return _0x2a56c2[_0x10c4('0x47')](_0x1a7f66);}})[_0x10c4('0x1f')](function(_0x2fcec3){if(_0x2fcec3){return _0x2fcec3?{'count':_0x2a8c53,'rows':_0x2fcec3}:null;}})[_0x10c4('0x1f')](respondWithResult(_0x7bfa86,null))[_0x10c4('0x41')](handleError(_0x7bfa86,null));};exports[_0x10c4('0x4b')]=function(_0x524510,_0x32840f,_0x732012){var _0x23ebdf={};var _0x4dde19={};var _0x409aa4;var _0x351f25;return db[_0x10c4('0x3d')][_0x10c4('0x48')]({'where':{'id':_0x524510['params']['id']}})[_0x10c4('0x1f')](handleEntityNotFound(_0x32840f,null))['then'](function(_0x14aa89){if(_0x14aa89){_0x409aa4=_0x14aa89;_0x4dde19['model']=_[_0x10c4('0x2e')](db[_0x10c4('0x49')][_0x10c4('0x28')]);_0x4dde19[_0x10c4('0x2d')]=_[_0x10c4('0x2e')](_0x524510[_0x10c4('0x2d')]);_0x4dde19[_0x10c4('0x2f')]=_[_0x10c4('0x30')](_0x4dde19['model'],_0x4dde19[_0x10c4('0x2d')]);_0x23ebdf[_0x10c4('0x31')]=_[_0x10c4('0x30')](_0x4dde19[_0x10c4('0x2c')],qs[_0x10c4('0x32')](_0x524510[_0x10c4('0x2d')][_0x10c4('0x32')]));_0x23ebdf[_0x10c4('0x31')]=_0x23ebdf[_0x10c4('0x31')][_0x10c4('0x33')]?_0x23ebdf['attributes']:_0x4dde19[_0x10c4('0x2c')];_0x23ebdf[_0x10c4('0x4a')]=qs[_0x10c4('0x36')](_0x524510[_0x10c4('0x2d')][_0x10c4('0x36')]);_0x23ebdf[_0x10c4('0x37')]=qs[_0x10c4('0x2f')](_[_0x10c4('0x38')](_0x524510[_0x10c4('0x2d')],_0x4dde19[_0x10c4('0x2f')]));if(_0x524510[_0x10c4('0x2d')][_0x10c4('0x39')]){_0x23ebdf[_0x10c4('0x37')]=_['merge'](_0x23ebdf[_0x10c4('0x37')],{'$or':_[_0x10c4('0x27')](_0x23ebdf[_0x10c4('0x31')],function(_0x17b751){var _0x255bf5={};_0x255bf5[_0x17b751]={'$like':'%'+_0x524510['query']['filter']+'%'};return _0x255bf5;})});}_0x23ebdf=_[_0x10c4('0x3b')]({},_0x23ebdf,_0x524510[_0x10c4('0x3c')]);return _0x409aa4[_0x10c4('0x4b')](_0x23ebdf);}})[_0x10c4('0x1f')](function(_0x234000){if(_0x234000){_0x351f25=_0x234000['length'];if(!_0x524510[_0x10c4('0x2d')][_0x10c4('0x34')](_0x10c4('0x35'))){_0x23ebdf['limit']=qs[_0x10c4('0x1a')](_0x524510['query'][_0x10c4('0x1a')]);_0x23ebdf[_0x10c4('0x19')]=qs['offset'](_0x524510[_0x10c4('0x2d')][_0x10c4('0x19')]);}return _0x409aa4[_0x10c4('0x4b')](_0x23ebdf);}})['then'](function(_0x4d3cd){if(_0x4d3cd){return _0x4d3cd?{'count':_0x351f25,'rows':_0x4d3cd}:null;}})[_0x10c4('0x1f')](respondWithResult(_0x32840f,null))['catch'](handleError(_0x32840f,null));};exports[_0x10c4('0x4c')]=function(_0x43987e,_0x4643cd,_0x195ec6){var _0x572f3e={};var _0x118b1e={};var _0x12aade;var _0x40ef3d;return db[_0x10c4('0x3d')][_0x10c4('0x48')]({'where':{'id':_0x43987e[_0x10c4('0x46')]['id']}})[_0x10c4('0x1f')](handleEntityNotFound(_0x4643cd,null))[_0x10c4('0x1f')](function(_0x5ae5a1){if(_0x5ae5a1){_0x12aade=_0x5ae5a1;_0x118b1e['model']=_[_0x10c4('0x2e')](db[_0x10c4('0x49')][_0x10c4('0x28')]);_0x118b1e[_0x10c4('0x2d')]=_[_0x10c4('0x2e')](_0x43987e[_0x10c4('0x2d')]);_0x118b1e[_0x10c4('0x2f')]=_[_0x10c4('0x30')](_0x118b1e[_0x10c4('0x2c')],_0x118b1e[_0x10c4('0x2d')]);_0x572f3e[_0x10c4('0x31')]=_[_0x10c4('0x30')](_0x118b1e[_0x10c4('0x2c')],qs['fields'](_0x43987e[_0x10c4('0x2d')][_0x10c4('0x32')]));_0x572f3e['attributes']=_0x572f3e[_0x10c4('0x31')][_0x10c4('0x33')]?_0x572f3e[_0x10c4('0x31')]:_0x118b1e[_0x10c4('0x2c')];_0x572f3e[_0x10c4('0x4a')]=qs['sort'](_0x43987e[_0x10c4('0x2d')]['sort']);_0x572f3e[_0x10c4('0x37')]=qs['filters'](_[_0x10c4('0x38')](_0x43987e[_0x10c4('0x2d')],_0x118b1e[_0x10c4('0x2f')]));if(_0x43987e['query']['filter']){_0x572f3e[_0x10c4('0x37')]=_[_0x10c4('0x3b')](_0x572f3e[_0x10c4('0x37')],{'$or':_[_0x10c4('0x27')](_0x572f3e[_0x10c4('0x31')],function(_0x560e58){var _0x2c97e7={};_0x2c97e7[_0x560e58]={'$like':'%'+_0x43987e['query'][_0x10c4('0x39')]+'%'};return _0x2c97e7;})});}_0x572f3e=_[_0x10c4('0x3b')]({},_0x572f3e,_0x43987e['options']);return _0x12aade[_0x10c4('0x4c')](_0x572f3e);}})[_0x10c4('0x1f')](function(_0x3a11d6){if(_0x3a11d6){_0x40ef3d=_0x3a11d6[_0x10c4('0x33')];if(!_0x43987e[_0x10c4('0x2d')][_0x10c4('0x34')](_0x10c4('0x35'))){_0x572f3e['limit']=qs[_0x10c4('0x1a')](_0x43987e[_0x10c4('0x2d')][_0x10c4('0x1a')]);_0x572f3e['offset']=qs[_0x10c4('0x19')](_0x43987e[_0x10c4('0x2d')][_0x10c4('0x19')]);}return _0x12aade[_0x10c4('0x4c')](_0x572f3e);}})[_0x10c4('0x1f')](function(_0x467e27){if(_0x467e27){return _0x467e27?{'count':_0x40ef3d,'rows':_0x467e27}:null;}})['then'](respondWithResult(_0x4643cd,null))[_0x10c4('0x41')](handleError(_0x4643cd,null));};exports[_0x10c4('0x4d')]=function(_0x16ab57,_0x11825d,_0x5c5613){var _0x3a7ee4={};var _0x3c8723={};var _0x2f23d7;var _0x33c404;return db[_0x10c4('0x3d')][_0x10c4('0x48')]({'where':{'id':_0x16ab57[_0x10c4('0x46')]['id']}})[_0x10c4('0x1f')](handleEntityNotFound(_0x11825d,null))[_0x10c4('0x1f')](function(_0x2d8524){if(_0x2d8524){_0x2f23d7=_0x2d8524;_0x3c8723[_0x10c4('0x2c')]=_[_0x10c4('0x2e')](db[_0x10c4('0x4e')]['rawAttributes']);_0x3c8723[_0x10c4('0x2d')]=_[_0x10c4('0x2e')](_0x16ab57[_0x10c4('0x2d')]);_0x3c8723['filters']=_['intersection'](_0x3c8723[_0x10c4('0x2c')],_0x3c8723[_0x10c4('0x2d')]);_0x3a7ee4[_0x10c4('0x31')]=_[_0x10c4('0x30')](_0x3c8723[_0x10c4('0x2c')],qs[_0x10c4('0x32')](_0x16ab57[_0x10c4('0x2d')]['fields']));_0x3a7ee4[_0x10c4('0x31')]=_0x3a7ee4['attributes'][_0x10c4('0x33')]?_0x3a7ee4[_0x10c4('0x31')]:_0x3c8723[_0x10c4('0x2c')];_0x3a7ee4['order']=qs[_0x10c4('0x36')](_0x16ab57[_0x10c4('0x2d')][_0x10c4('0x36')]);_0x3a7ee4['where']=qs['filters'](_['pick'](_0x16ab57[_0x10c4('0x2d')],_0x3c8723[_0x10c4('0x2f')]));if(_0x16ab57['query'][_0x10c4('0x39')]){_0x3a7ee4['where']=_[_0x10c4('0x3b')](_0x3a7ee4[_0x10c4('0x37')],{'$or':_['map'](_0x3a7ee4[_0x10c4('0x31')],function(_0x521e9b){var _0x227655={};_0x227655[_0x521e9b]={'$like':'%'+_0x16ab57[_0x10c4('0x2d')][_0x10c4('0x39')]+'%'};return _0x227655;})});}_0x3a7ee4=_['merge']({},_0x3a7ee4,_0x16ab57['options']);return _0x2f23d7['getTags'](_0x3a7ee4);}})['then'](function(_0x28cfac){if(_0x28cfac){_0x33c404=_0x28cfac['length'];if(!_0x16ab57['query'][_0x10c4('0x34')](_0x10c4('0x35'))){_0x3a7ee4[_0x10c4('0x1a')]=qs['limit'](_0x16ab57[_0x10c4('0x2d')][_0x10c4('0x1a')]);_0x3a7ee4[_0x10c4('0x19')]=qs[_0x10c4('0x19')](_0x16ab57[_0x10c4('0x2d')][_0x10c4('0x19')]);}return _0x2f23d7[_0x10c4('0x4d')](_0x3a7ee4);}})[_0x10c4('0x1f')](function(_0x47b0ec){if(_0x47b0ec){return _0x47b0ec?{'count':_0x33c404,'rows':_0x47b0ec}:null;}})['then'](respondWithResult(_0x11825d,null))[_0x10c4('0x41')](handleError(_0x11825d,null));};exports[_0x10c4('0x4f')]=function(_0x5311b4,_0x440933,_0xf4a80c){if(_0x5311b4['body']['id']){delete _0x5311b4[_0x10c4('0x45')]['id'];}return db[_0x10c4('0x3d')][_0x10c4('0x48')]({'where':{'id':_0x5311b4[_0x10c4('0x46')]['id']}})['then'](handleEntityNotFound(_0x440933,null))['then'](function(_0x51ea17){if(_0x51ea17){return _0x51ea17[_0x10c4('0x4f')](_0x5311b4[_0x10c4('0x45')][_0x10c4('0x50')]||[]);}return null;})[_0x10c4('0x1f')](respondWithResult(_0x440933,null))[_0x10c4('0x41')](handleError(_0x440933,null));}; \ No newline at end of file +var _0x0f8e=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','VIRTUAL','filter','merge','options','DeskConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','findOne','hasOwnProperty','nolimit','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x59b7ff,_0x5e5370){var _0x45efe9=function(_0x22ca09){while(--_0x22ca09){_0x59b7ff['push'](_0x59b7ff['shift']());}};_0x45efe9(++_0x5e5370);}(_0x0f8e,0x9a));var _0xe0f8=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x0f8e[_0x5806c3];return _0x48ac77;};'use strict';var emlformat=require(_0xe0f8('0x0'));var rimraf=require(_0xe0f8('0x1'));var zipdir=require(_0xe0f8('0x2'));var jsonpatch=require(_0xe0f8('0x3'));var rp=require(_0xe0f8('0x4'));var moment=require(_0xe0f8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe0f8('0x6'));var util=require(_0xe0f8('0x7'));var path=require(_0xe0f8('0x8'));var sox=require(_0xe0f8('0x9'));var csv=require('to-csv');var ejs=require(_0xe0f8('0xa'));var fs=require('fs');var fs_extra=require(_0xe0f8('0xb'));var _=require(_0xe0f8('0xc'));var squel=require(_0xe0f8('0xd'));var crypto=require(_0xe0f8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe0f8('0xf'));var toCsv=require(_0xe0f8('0x10'));var querystring=require(_0xe0f8('0x11'));var Papa=require(_0xe0f8('0x12'));var Redis=require(_0xe0f8('0x13'));var authService=require(_0xe0f8('0x14'));var qs=require(_0xe0f8('0x15'));var as=require(_0xe0f8('0x16'));var hardwareService=require(_0xe0f8('0x17'));var logger=require('../../config/logger')(_0xe0f8('0x18'));var utils=require(_0xe0f8('0x19'));var config=require(_0xe0f8('0x1a'));var licenseUtil=require(_0xe0f8('0x1b'));var db=require(_0xe0f8('0x1c'))['db'];function respondWithStatusCode(_0x5d28b3,_0xc08b10){_0xc08b10=_0xc08b10||0xcc;return function(_0x5081c5){if(_0x5081c5){return _0x5d28b3[_0xe0f8('0x1d')](_0xc08b10);}return _0x5d28b3[_0xe0f8('0x1e')](_0xc08b10)[_0xe0f8('0x1f')]();};}function respondWithResult(_0x48c3af,_0x439358){_0x439358=_0x439358||0xc8;return function(_0x265487){if(_0x265487){return _0x48c3af['status'](_0x439358)[_0xe0f8('0x20')](_0x265487);}};}function respondWithFilteredResult(_0x271c81,_0x24af31){return function(_0x4044e4){if(_0x4044e4){var _0x24a0aa=typeof _0x24af31[_0xe0f8('0x21')]===_0xe0f8('0x22')&&typeof _0x24af31[_0xe0f8('0x23')]===_0xe0f8('0x22');var _0x5a6b34=_0x4044e4[_0xe0f8('0x24')];var _0x554c73=_0x24a0aa?0x0:_0x24af31[_0xe0f8('0x21')];var _0x234f9=_0x24a0aa?_0x4044e4['count']:_0x24af31[_0xe0f8('0x21')]+_0x24af31[_0xe0f8('0x23')];var _0x3e9b32;if(_0x234f9>=_0x5a6b34){_0x234f9=_0x5a6b34;_0x3e9b32=0xc8;}else{_0x3e9b32=0xce;}_0x271c81[_0xe0f8('0x1e')](_0x3e9b32);return _0x271c81[_0xe0f8('0x25')](_0xe0f8('0x26'),_0x554c73+'-'+_0x234f9+'/'+_0x5a6b34)[_0xe0f8('0x20')](_0x4044e4);}return null;};}function patchUpdates(_0x2b2a38){return function(_0x2111ea){try{jsonpatch['apply'](_0x2111ea,_0x2b2a38,!![]);}catch(_0x1a449b){return BPromise['reject'](_0x1a449b);}return _0x2111ea[_0xe0f8('0x27')]();};}function saveUpdates(_0x4fdf27,_0x570c2c){return function(_0x33ef79){if(_0x33ef79){return _0x33ef79['update'](_0x4fdf27)[_0xe0f8('0x28')](function(_0x52d81e){return _0x52d81e;});}return null;};}function removeEntity(_0x6d9a9a,_0x18b0ca){return function(_0x4df1dc){if(_0x4df1dc){return _0x4df1dc[_0xe0f8('0x29')]()[_0xe0f8('0x28')](function(){_0x6d9a9a[_0xe0f8('0x1e')](0xcc)[_0xe0f8('0x1f')]();});}};}function handleEntityNotFound(_0x3750aa,_0x2a2d2d){return function(_0x3c15a3){if(!_0x3c15a3){_0x3750aa[_0xe0f8('0x1d')](0x194);}return _0x3c15a3;};}function handleError(_0x2efe8b,_0x1afd97){_0x1afd97=_0x1afd97||0x1f4;return function(_0x2ce12d){logger[_0xe0f8('0x2a')](_0x2ce12d[_0xe0f8('0x2b')]);if(_0x2ce12d[_0xe0f8('0x2c')]){delete _0x2ce12d[_0xe0f8('0x2c')];}_0x2efe8b[_0xe0f8('0x1e')](_0x1afd97)['send'](_0x2ce12d);};}exports[_0xe0f8('0x2d')]=function(_0x32b854,_0x3aaf47){var _0x3b6053={},_0x5dee42={},_0x3e8aef={'count':0x0,'rows':[]};var _0x183c9d=_[_0xe0f8('0x2e')](db['DeskConfiguration'][_0xe0f8('0x2f')],function(_0x2b699b){return{'name':_0x2b699b[_0xe0f8('0x30')],'type':_0x2b699b[_0xe0f8('0x31')][_0xe0f8('0x32')]};});_0x5dee42[_0xe0f8('0x33')]=_[_0xe0f8('0x2e')](_0x183c9d,_0xe0f8('0x2c'));_0x5dee42[_0xe0f8('0x34')]=_[_0xe0f8('0x35')](_0x32b854[_0xe0f8('0x34')]);_0x5dee42[_0xe0f8('0x36')]=_[_0xe0f8('0x37')](_0x5dee42[_0xe0f8('0x33')],_0x5dee42[_0xe0f8('0x34')]);_0x3b6053['attributes']=_[_0xe0f8('0x37')](_0x5dee42[_0xe0f8('0x33')],qs[_0xe0f8('0x38')](_0x32b854[_0xe0f8('0x34')][_0xe0f8('0x38')]));_0x3b6053[_0xe0f8('0x39')]=_0x3b6053[_0xe0f8('0x39')][_0xe0f8('0x3a')]?_0x3b6053['attributes']:_0x5dee42[_0xe0f8('0x33')];if(!_0x32b854[_0xe0f8('0x34')]['hasOwnProperty']('nolimit')){_0x3b6053[_0xe0f8('0x23')]=qs['limit'](_0x32b854[_0xe0f8('0x34')][_0xe0f8('0x23')]);_0x3b6053[_0xe0f8('0x21')]=qs[_0xe0f8('0x21')](_0x32b854[_0xe0f8('0x34')][_0xe0f8('0x21')]);}_0x3b6053[_0xe0f8('0x3b')]=qs[_0xe0f8('0x3c')](_0x32b854[_0xe0f8('0x34')][_0xe0f8('0x3c')]);_0x3b6053[_0xe0f8('0x3d')]=qs[_0xe0f8('0x36')](_[_0xe0f8('0x3e')](_0x32b854[_0xe0f8('0x34')],_0x5dee42[_0xe0f8('0x36')]),_0x183c9d);if(_0x32b854[_0xe0f8('0x34')]['filter']){_0x3b6053[_0xe0f8('0x3d')]=_['merge'](_0x3b6053[_0xe0f8('0x3d')],{'$or':_[_0xe0f8('0x2e')](_0x183c9d,function(_0x19607c){if(_0x19607c[_0xe0f8('0x31')]!==_0xe0f8('0x3f')){var _0x2c4348={};_0x2c4348[_0x19607c['name']]={'$like':'%'+_0x32b854[_0xe0f8('0x34')][_0xe0f8('0x40')]+'%'};return _0x2c4348;}})});}_0x3b6053=_[_0xe0f8('0x41')]({},_0x3b6053,_0x32b854[_0xe0f8('0x42')]);var _0x4546df={'where':_0x3b6053['where']};return db[_0xe0f8('0x43')][_0xe0f8('0x24')](_0x4546df)['then'](function(_0x175d5a){_0x3e8aef['count']=_0x175d5a;if(_0x32b854[_0xe0f8('0x34')][_0xe0f8('0x44')]){_0x3b6053['include']=[{'all':!![]}];}return db[_0xe0f8('0x43')][_0xe0f8('0x45')](_0x3b6053);})[_0xe0f8('0x28')](function(_0xfa858c){_0x3e8aef[_0xe0f8('0x46')]=_0xfa858c;return _0x3e8aef;})[_0xe0f8('0x28')](respondWithFilteredResult(_0x3aaf47,_0x3b6053))[_0xe0f8('0x47')](handleError(_0x3aaf47,null));};exports[_0xe0f8('0x48')]=function(_0x4fe576,_0x30b673){var _0xb2bbe8={'raw':![],'where':{'id':_0x4fe576[_0xe0f8('0x49')]['id']}},_0x4cbe77={};_0x4cbe77[_0xe0f8('0x33')]=_[_0xe0f8('0x35')](db['DeskConfiguration'][_0xe0f8('0x2f')]);_0x4cbe77['query']=_['keys'](_0x4fe576[_0xe0f8('0x34')]);_0x4cbe77[_0xe0f8('0x36')]=_[_0xe0f8('0x37')](_0x4cbe77['model'],_0x4cbe77[_0xe0f8('0x34')]);_0xb2bbe8[_0xe0f8('0x39')]=_[_0xe0f8('0x37')](_0x4cbe77[_0xe0f8('0x33')],qs['fields'](_0x4fe576['query']['fields']));_0xb2bbe8['attributes']=_0xb2bbe8[_0xe0f8('0x39')]['length']?_0xb2bbe8['attributes']:_0x4cbe77['model'];if(_0x4fe576[_0xe0f8('0x34')][_0xe0f8('0x44')]){_0xb2bbe8[_0xe0f8('0x4a')]=[{'all':!![]}];}_0xb2bbe8=_['merge']({},_0xb2bbe8,_0x4fe576['options']);return db['DeskConfiguration'][_0xe0f8('0x4b')](_0xb2bbe8)[_0xe0f8('0x28')](handleEntityNotFound(_0x30b673,null))['then'](respondWithResult(_0x30b673,null))[_0xe0f8('0x47')](handleError(_0x30b673,null));};exports[_0xe0f8('0x4c')]=function(_0x114898,_0x25c47e){return db[_0xe0f8('0x43')][_0xe0f8('0x4c')](_0x114898[_0xe0f8('0x4d')],{})[_0xe0f8('0x28')](respondWithResult(_0x25c47e,0xc9))[_0xe0f8('0x47')](handleError(_0x25c47e,null));};exports['update']=function(_0x3146fb,_0x5e0255){if(_0x3146fb['body']['id']){delete _0x3146fb[_0xe0f8('0x4d')]['id'];}return db[_0xe0f8('0x43')][_0xe0f8('0x4b')]({'where':{'id':_0x3146fb[_0xe0f8('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e0255,null))[_0xe0f8('0x28')](saveUpdates(_0x3146fb[_0xe0f8('0x4d')],null))[_0xe0f8('0x28')](respondWithResult(_0x5e0255,null))[_0xe0f8('0x47')](handleError(_0x5e0255,null));};exports['destroy']=function(_0x53a5ac,_0x57a588){return db[_0xe0f8('0x43')][_0xe0f8('0x4b')]({'where':{'id':_0x53a5ac[_0xe0f8('0x49')]['id']}})[_0xe0f8('0x28')](handleEntityNotFound(_0x57a588,null))['then'](removeEntity(_0x57a588,null))[_0xe0f8('0x47')](handleError(_0x57a588,null));};exports[_0xe0f8('0x4e')]=function(_0xddf486,_0x14a528,_0x463630){var _0x4ac270={};var _0xe084d5={};var _0x38cdde;var _0x19a26a;return db[_0xe0f8('0x43')][_0xe0f8('0x4f')]({'where':{'id':_0xddf486[_0xe0f8('0x49')]['id']}})['then'](handleEntityNotFound(_0x14a528,null))[_0xe0f8('0x28')](function(_0x4f289c){if(_0x4f289c){_0x38cdde=_0x4f289c;_0xe084d5[_0xe0f8('0x33')]=_['keys'](db['DeskField']['rawAttributes']);_0xe084d5[_0xe0f8('0x34')]=_[_0xe0f8('0x35')](_0xddf486[_0xe0f8('0x34')]);_0xe084d5[_0xe0f8('0x36')]=_[_0xe0f8('0x37')](_0xe084d5[_0xe0f8('0x33')],_0xe084d5[_0xe0f8('0x34')]);_0x4ac270[_0xe0f8('0x39')]=_[_0xe0f8('0x37')](_0xe084d5[_0xe0f8('0x33')],qs['fields'](_0xddf486['query']['fields']));_0x4ac270[_0xe0f8('0x39')]=_0x4ac270[_0xe0f8('0x39')]['length']?_0x4ac270[_0xe0f8('0x39')]:_0xe084d5[_0xe0f8('0x33')];_0x4ac270['order']=qs['sort'](_0xddf486[_0xe0f8('0x34')]['sort']);_0x4ac270[_0xe0f8('0x3d')]=qs[_0xe0f8('0x36')](_['pick'](_0xddf486[_0xe0f8('0x34')],_0xe084d5[_0xe0f8('0x36')]));if(_0xddf486[_0xe0f8('0x34')][_0xe0f8('0x40')]){_0x4ac270['where']=_['merge'](_0x4ac270['where'],{'$or':_['map'](_0x4ac270[_0xe0f8('0x39')],function(_0x238738){var _0x599148={};_0x599148[_0x238738]={'$like':'%'+_0xddf486['query'][_0xe0f8('0x40')]+'%'};return _0x599148;})});}_0x4ac270=_[_0xe0f8('0x41')]({},_0x4ac270,_0xddf486[_0xe0f8('0x42')]);return _0x38cdde[_0xe0f8('0x4e')](_0x4ac270);}})[_0xe0f8('0x28')](function(_0x2e5394){if(_0x2e5394){_0x19a26a=_0x2e5394[_0xe0f8('0x3a')];if(!_0xddf486['query'][_0xe0f8('0x50')](_0xe0f8('0x51'))){_0x4ac270[_0xe0f8('0x23')]=qs[_0xe0f8('0x23')](_0xddf486[_0xe0f8('0x34')][_0xe0f8('0x23')]);_0x4ac270['offset']=qs[_0xe0f8('0x21')](_0xddf486[_0xe0f8('0x34')][_0xe0f8('0x21')]);}return _0x38cdde['getFields'](_0x4ac270);}})[_0xe0f8('0x28')](function(_0x5efa07){if(_0x5efa07){return _0x5efa07?{'count':_0x19a26a,'rows':_0x5efa07}:null;}})['then'](respondWithResult(_0x14a528,null))[_0xe0f8('0x47')](handleError(_0x14a528,null));};exports[_0xe0f8('0x52')]=function(_0x36a45c,_0x550fdb,_0x593820){var _0x29a08d={};var _0x47f03e={};var _0x2c780c;var _0xcff5f5;return db[_0xe0f8('0x43')]['findOne']({'where':{'id':_0x36a45c[_0xe0f8('0x49')]['id']}})[_0xe0f8('0x28')](handleEntityNotFound(_0x550fdb,null))[_0xe0f8('0x28')](function(_0xa25e3d){if(_0xa25e3d){_0x2c780c=_0xa25e3d;_0x47f03e[_0xe0f8('0x33')]=_[_0xe0f8('0x35')](db[_0xe0f8('0x53')][_0xe0f8('0x2f')]);_0x47f03e[_0xe0f8('0x34')]=_[_0xe0f8('0x35')](_0x36a45c['query']);_0x47f03e[_0xe0f8('0x36')]=_['intersection'](_0x47f03e[_0xe0f8('0x33')],_0x47f03e['query']);_0x29a08d['attributes']=_[_0xe0f8('0x37')](_0x47f03e['model'],qs[_0xe0f8('0x38')](_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x38')]));_0x29a08d[_0xe0f8('0x39')]=_0x29a08d['attributes']['length']?_0x29a08d['attributes']:_0x47f03e[_0xe0f8('0x33')];_0x29a08d['order']=qs['sort'](_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x3c')]);_0x29a08d[_0xe0f8('0x3d')]=qs['filters'](_['pick'](_0x36a45c['query'],_0x47f03e[_0xe0f8('0x36')]));if(_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x40')]){_0x29a08d[_0xe0f8('0x3d')]=_[_0xe0f8('0x41')](_0x29a08d[_0xe0f8('0x3d')],{'$or':_[_0xe0f8('0x2e')](_0x29a08d[_0xe0f8('0x39')],function(_0x11107f){var _0x2c67f5={};_0x2c67f5[_0x11107f]={'$like':'%'+_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x40')]+'%'};return _0x2c67f5;})});}_0x29a08d=_[_0xe0f8('0x41')]({},_0x29a08d,_0x36a45c['options']);return _0x2c780c['getSubjects'](_0x29a08d);}})[_0xe0f8('0x28')](function(_0x26090f){if(_0x26090f){_0xcff5f5=_0x26090f[_0xe0f8('0x3a')];if(!_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x50')]('nolimit')){_0x29a08d[_0xe0f8('0x23')]=qs[_0xe0f8('0x23')](_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x23')]);_0x29a08d[_0xe0f8('0x21')]=qs[_0xe0f8('0x21')](_0x36a45c[_0xe0f8('0x34')][_0xe0f8('0x21')]);}return _0x2c780c['getSubjects'](_0x29a08d);}})['then'](function(_0x4c8d8b){if(_0x4c8d8b){return _0x4c8d8b?{'count':_0xcff5f5,'rows':_0x4c8d8b}:null;}})[_0xe0f8('0x28')](respondWithResult(_0x550fdb,null))[_0xe0f8('0x47')](handleError(_0x550fdb,null));};exports['getDescriptions']=function(_0x1e5731,_0x4a7405,_0x218050){var _0x483e1e={};var _0x10c5c9={};var _0x5ccebc;var _0xa120a2;return db['DeskConfiguration'][_0xe0f8('0x4f')]({'where':{'id':_0x1e5731[_0xe0f8('0x49')]['id']}})[_0xe0f8('0x28')](handleEntityNotFound(_0x4a7405,null))[_0xe0f8('0x28')](function(_0x2649a3){if(_0x2649a3){_0x5ccebc=_0x2649a3;_0x10c5c9[_0xe0f8('0x33')]=_[_0xe0f8('0x35')](db[_0xe0f8('0x53')][_0xe0f8('0x2f')]);_0x10c5c9[_0xe0f8('0x34')]=_[_0xe0f8('0x35')](_0x1e5731['query']);_0x10c5c9['filters']=_[_0xe0f8('0x37')](_0x10c5c9[_0xe0f8('0x33')],_0x10c5c9['query']);_0x483e1e['attributes']=_[_0xe0f8('0x37')](_0x10c5c9[_0xe0f8('0x33')],qs['fields'](_0x1e5731['query']['fields']));_0x483e1e['attributes']=_0x483e1e[_0xe0f8('0x39')][_0xe0f8('0x3a')]?_0x483e1e['attributes']:_0x10c5c9[_0xe0f8('0x33')];_0x483e1e[_0xe0f8('0x3b')]=qs[_0xe0f8('0x3c')](_0x1e5731[_0xe0f8('0x34')][_0xe0f8('0x3c')]);_0x483e1e[_0xe0f8('0x3d')]=qs[_0xe0f8('0x36')](_[_0xe0f8('0x3e')](_0x1e5731[_0xe0f8('0x34')],_0x10c5c9[_0xe0f8('0x36')]));if(_0x1e5731[_0xe0f8('0x34')]['filter']){_0x483e1e[_0xe0f8('0x3d')]=_[_0xe0f8('0x41')](_0x483e1e[_0xe0f8('0x3d')],{'$or':_[_0xe0f8('0x2e')](_0x483e1e[_0xe0f8('0x39')],function(_0x70959f){var _0x324558={};_0x324558[_0x70959f]={'$like':'%'+_0x1e5731[_0xe0f8('0x34')][_0xe0f8('0x40')]+'%'};return _0x324558;})});}_0x483e1e=_['merge']({},_0x483e1e,_0x1e5731[_0xe0f8('0x42')]);return _0x5ccebc['getDescriptions'](_0x483e1e);}})[_0xe0f8('0x28')](function(_0x2847f1){if(_0x2847f1){_0xa120a2=_0x2847f1[_0xe0f8('0x3a')];if(!_0x1e5731['query']['hasOwnProperty'](_0xe0f8('0x51'))){_0x483e1e['limit']=qs['limit'](_0x1e5731['query'][_0xe0f8('0x23')]);_0x483e1e[_0xe0f8('0x21')]=qs[_0xe0f8('0x21')](_0x1e5731['query'][_0xe0f8('0x21')]);}return _0x5ccebc[_0xe0f8('0x54')](_0x483e1e);}})[_0xe0f8('0x28')](function(_0x4d9701){if(_0x4d9701){return _0x4d9701?{'count':_0xa120a2,'rows':_0x4d9701}:null;}})[_0xe0f8('0x28')](respondWithResult(_0x4a7405,null))[_0xe0f8('0x47')](handleError(_0x4a7405,null));};exports[_0xe0f8('0x55')]=function(_0x3501ce,_0x604cbe,_0x3c2d92){var _0x3ee759={};var _0x3c8347={};var _0x3df680;var _0x30bbcf;return db['DeskConfiguration'][_0xe0f8('0x4f')]({'where':{'id':_0x3501ce[_0xe0f8('0x49')]['id']}})['then'](handleEntityNotFound(_0x604cbe,null))['then'](function(_0x395caa){if(_0x395caa){_0x3df680=_0x395caa;_0x3c8347[_0xe0f8('0x33')]=_[_0xe0f8('0x35')](db[_0xe0f8('0x56')][_0xe0f8('0x2f')]);_0x3c8347[_0xe0f8('0x34')]=_[_0xe0f8('0x35')](_0x3501ce['query']);_0x3c8347[_0xe0f8('0x36')]=_[_0xe0f8('0x37')](_0x3c8347[_0xe0f8('0x33')],_0x3c8347[_0xe0f8('0x34')]);_0x3ee759['attributes']=_[_0xe0f8('0x37')](_0x3c8347[_0xe0f8('0x33')],qs[_0xe0f8('0x38')](_0x3501ce['query']['fields']));_0x3ee759[_0xe0f8('0x39')]=_0x3ee759[_0xe0f8('0x39')]['length']?_0x3ee759['attributes']:_0x3c8347[_0xe0f8('0x33')];_0x3ee759[_0xe0f8('0x3b')]=qs[_0xe0f8('0x3c')](_0x3501ce['query'][_0xe0f8('0x3c')]);_0x3ee759[_0xe0f8('0x3d')]=qs['filters'](_[_0xe0f8('0x3e')](_0x3501ce[_0xe0f8('0x34')],_0x3c8347[_0xe0f8('0x36')]));if(_0x3501ce[_0xe0f8('0x34')][_0xe0f8('0x40')]){_0x3ee759[_0xe0f8('0x3d')]=_[_0xe0f8('0x41')](_0x3ee759[_0xe0f8('0x3d')],{'$or':_[_0xe0f8('0x2e')](_0x3ee759[_0xe0f8('0x39')],function(_0xa311c7){var _0x34d921={};_0x34d921[_0xa311c7]={'$like':'%'+_0x3501ce[_0xe0f8('0x34')][_0xe0f8('0x40')]+'%'};return _0x34d921;})});}_0x3ee759=_[_0xe0f8('0x41')]({},_0x3ee759,_0x3501ce[_0xe0f8('0x42')]);return _0x3df680[_0xe0f8('0x55')](_0x3ee759);}})['then'](function(_0x3566ce){if(_0x3566ce){_0x30bbcf=_0x3566ce[_0xe0f8('0x3a')];if(!_0x3501ce[_0xe0f8('0x34')][_0xe0f8('0x50')]('nolimit')){_0x3ee759[_0xe0f8('0x23')]=qs[_0xe0f8('0x23')](_0x3501ce[_0xe0f8('0x34')]['limit']);_0x3ee759[_0xe0f8('0x21')]=qs[_0xe0f8('0x21')](_0x3501ce[_0xe0f8('0x34')][_0xe0f8('0x21')]);}return _0x3df680[_0xe0f8('0x55')](_0x3ee759);}})[_0xe0f8('0x28')](function(_0x28c0ac){if(_0x28c0ac){return _0x28c0ac?{'count':_0x30bbcf,'rows':_0x28c0ac}:null;}})[_0xe0f8('0x28')](respondWithResult(_0x604cbe,null))[_0xe0f8('0x47')](handleError(_0x604cbe,null));};exports[_0xe0f8('0x57')]=function(_0x1b0d16,_0x489c17,_0x84aaf6){if(_0x1b0d16['body']['id']){delete _0x1b0d16[_0xe0f8('0x4d')]['id'];}return db[_0xe0f8('0x43')][_0xe0f8('0x4f')]({'where':{'id':_0x1b0d16[_0xe0f8('0x49')]['id']}})[_0xe0f8('0x28')](handleEntityNotFound(_0x489c17,null))[_0xe0f8('0x28')](function(_0x4d2e84){if(_0x4d2e84){return _0x4d2e84[_0xe0f8('0x57')](_0x1b0d16[_0xe0f8('0x4d')]['ids']||[]);}return null;})[_0xe0f8('0x28')](respondWithResult(_0x489c17,null))[_0xe0f8('0x47')](handleError(_0x489c17,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7776918..75e4f8f 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 _0x04af=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash'];(function(_0x583a53,_0x2fc759){var _0x50fc47=function(_0x1ebfb4){while(--_0x1ebfb4){_0x583a53['push'](_0x583a53['shift']());}};_0x50fc47(++_0x2fc759);}(_0x04af,0x143));var _0xf04a=function(_0x51cffa,_0x1d8f31){_0x51cffa=_0x51cffa-0x0;var _0x438136=_0x04af[_0x51cffa];return _0x438136;};'use strict';var _=require(_0xf04a('0x0'));var util=require('util');var logger=require(_0xf04a('0x1'))(_0xf04a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf04a('0x3'));var fs=require('fs');var path=require(_0xf04a('0x4'));var rimraf=require(_0xf04a('0x5'));var config=require(_0xf04a('0x6'));var attributes=require(_0xf04a('0x7'));module[_0xf04a('0x8')]=function(_0x572e13,_0x5789a5){return _0x572e13[_0xf04a('0x9')](_0xf04a('0xa'),attributes,{'tableName':_0xf04a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf71e=['DeskConfiguration','int_desk_configurations','api','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','exports','define'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf71e,0xa4));var _0xef71=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0xf71e[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xef71('0x0'));var moment=require('moment');var BPromise=require(_0xef71('0x1'));var rp=require(_0xef71('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef71('0x3'));var config=require('../../config/environment');var attributes=require(_0xef71('0x4'));module[_0xef71('0x5')]=function(_0x2fa065,_0x264e1b){return _0x2fa065[_0xef71('0x6')](_0xef71('0x7'),attributes,{'tableName':_0xef71('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 989381d..1ae4133 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 _0xbc36=['info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x307b96,_0x13a26b){var _0x4320ad=function(_0x224fc0){while(--_0x224fc0){_0x307b96['push'](_0x307b96['shift']());}};_0x4320ad(++_0x13a26b);}(_0xbc36,0x169));var _0x6bc3=function(_0x293843,_0x3f0e21){_0x293843=_0x293843-0x0;var _0x5c62c7=_0xbc36[_0x293843];return _0x5c62c7;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});} \ No newline at end of file +var _0x28a6=['request\x20sent','stringify','error','code','message','result','util','randomstring','../../mysqldb','../../config/logger','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x28a6,0x166));var _0x628a=function(_0x2d3d18,_0x475f4c){_0x2d3d18=_0x2d3d18-0x0;var _0x202f49=_0x28a6[_0x2d3d18];return _0x202f49;};'use strict';var _=require('lodash');var util=require(_0x628a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x628a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x628a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x628a('0x3'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x628a('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x471023,_0x2c1103,_0x124819){return new BPromise(function(_0x251da8,_0x3f9634){return client[_0x628a('0x5')](_0x471023,_0x124819)[_0x628a('0x6')](function(_0x39c936){logger[_0x628a('0x7')](_0x628a('0x8'),_0x2c1103,'request\x20sent');logger[_0x628a('0x9')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2c1103,_0x628a('0xa'),JSON[_0x628a('0xb')](_0x39c936));if(_0x39c936[_0x628a('0xc')]){if(_0x39c936[_0x628a('0xc')][_0x628a('0xd')]===0x1f4){logger[_0x628a('0xc')](_0x628a('0x8'),_0x2c1103,_0x39c936[_0x628a('0xc')][_0x628a('0xe')]);return _0x3f9634(_0x39c936[_0x628a('0xc')][_0x628a('0xe')]);}logger['error'](_0x628a('0x8'),_0x2c1103,_0x39c936[_0x628a('0xc')][_0x628a('0xe')]);return _0x251da8(_0x39c936[_0x628a('0xc')][_0x628a('0xe')]);}else{logger[_0x628a('0x7')](_0x628a('0x8'),_0x2c1103,_0x628a('0xa'));_0x251da8(_0x39c936[_0x628a('0xf')][_0x628a('0xe')]);}})['catch'](function(_0x2fd9c8){logger[_0x628a('0xc')](_0x628a('0x8'),_0x2c1103,_0x2fd9c8);_0x3f9634(_0x2fd9c8);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 5244ff3..e6dc0c9 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 _0x2ed4=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','create','put','/:id','update','delete'];(function(_0x211576,_0xcc41af){var _0x3ce235=function(_0x28bd8a){while(--_0x28bd8a){_0x211576['push'](_0x211576['shift']());}};_0x3ce235(++_0xcc41af);}(_0x2ed4,0xe6));var _0x42ed=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x2ed4[_0x3a78a0];return _0x48e917;};'use strict';var multer=require(_0x42ed('0x0'));var util=require(_0x42ed('0x1'));var path=require(_0x42ed('0x2'));var timeout=require(_0x42ed('0x3'));var express=require(_0x42ed('0x4'));var router=express[_0x42ed('0x5')]();var fs_extra=require(_0x42ed('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x42ed('0x7'));var config=require(_0x42ed('0x8'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x42ed('0x9')](),controller['index']);router[_0x42ed('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x42ed('0xb')]);router['post']('/',auth[_0x42ed('0x9')](),controller[_0x42ed('0xc')]);router[_0x42ed('0xd')](_0x42ed('0xe'),auth[_0x42ed('0x9')](),controller[_0x42ed('0xf')]);router[_0x42ed('0x10')](_0x42ed('0xe'),auth['isAuthenticated'](),controller[_0x42ed('0x11')]);module[_0x42ed('0x12')]=router; \ No newline at end of file +var _0xd6a8=['post','create','put','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','show'];(function(_0x53575e,_0x5350d4){var _0x5d964d=function(_0x4cc71b){while(--_0x4cc71b){_0x53575e['push'](_0x53575e['shift']());}};_0x5d964d(++_0x5350d4);}(_0xd6a8,0x175));var _0x8d6a=function(_0x52b31f,_0x106aff){_0x52b31f=_0x52b31f-0x0;var _0x4c50dd=_0xd6a8[_0x52b31f];return _0x4c50dd;};'use strict';var multer=require(_0x8d6a('0x0'));var util=require(_0x8d6a('0x1'));var path=require(_0x8d6a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d6a('0x3'));var auth=require(_0x8d6a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8d6a('0x5'));var controller=require(_0x8d6a('0x6'));router[_0x8d6a('0x7')]('/',auth[_0x8d6a('0x8')](),controller['index']);router[_0x8d6a('0x7')](_0x8d6a('0x9'),auth[_0x8d6a('0x8')](),controller[_0x8d6a('0xa')]);router[_0x8d6a('0xb')]('/',auth[_0x8d6a('0x8')](),controller[_0x8d6a('0xc')]);router[_0x8d6a('0xd')](_0x8d6a('0x9'),auth[_0x8d6a('0x8')](),controller['update']);router['delete'](_0x8d6a('0x9'),auth[_0x8d6a('0x8')](),controller[_0x8d6a('0xe')]);module[_0x8d6a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 022dd01..2c184a8 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 _0x4795=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x531220,_0x1f55dd){var _0x59defc=function(_0x4dd0d8){while(--_0x4dd0d8){_0x531220['push'](_0x531220['shift']());}};_0x59defc(++_0x1f55dd);}(_0x4795,0xa6));var _0x5479=function(_0x4640e8,_0x135135){_0x4640e8=_0x4640e8-0x0;var _0x58d0bd=_0x4795[_0x4640e8];return _0x58d0bd;};'use strict';var Sequelize=require(_0x5479('0x0'));module[_0x5479('0x1')]={'type':{'type':Sequelize[_0x5479('0x2')]('string',_0x5479('0x3'),_0x5479('0x4'),_0x5479('0x5'),_0x5479('0x6')),'defaultValue':_0x5479('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5479('0x8')]},'keyType':{'type':Sequelize[_0x5479('0x2')](_0x5479('0x7'),_0x5479('0x3'),_0x5479('0x4'))},'keyContent':{'type':Sequelize[_0x5479('0x8')]},'idField':{'type':Sequelize[_0x5479('0x8')]},'nameField':{'type':Sequelize[_0x5479('0x8')]},'customField':{'type':Sequelize[_0x5479('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5479('0x8')]}}; \ No newline at end of file +var _0x353c=['string','BOOLEAN','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x271f92,_0x22546d){var _0x317df7=function(_0x2dabce){while(--_0x2dabce){_0x271f92['push'](_0x271f92['shift']());}};_0x317df7(++_0x22546d);}(_0x353c,0x9b));var _0xc353=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x353c[_0x648163];return _0x199d4d;};'use strict';var Sequelize=require('sequelize');module[_0xc353('0x0')]={'type':{'type':Sequelize[_0xc353('0x1')]('string',_0xc353('0x2'),_0xc353('0x3'),_0xc353('0x4'),_0xc353('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc353('0x6')]},'key':{'type':Sequelize[_0xc353('0x6')]},'keyType':{'type':Sequelize[_0xc353('0x1')](_0xc353('0x7'),_0xc353('0x2'),_0xc353('0x3'))},'keyContent':{'type':Sequelize[_0xc353('0x6')]},'idField':{'type':Sequelize[_0xc353('0x6')]},'nameField':{'type':Sequelize[_0xc353('0x6')]},'customField':{'type':Sequelize[_0xc353('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 7001f00..edf6a67 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 _0xa9c7=['map','DeskField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','create','body','find','eml-format','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x16571a,_0x3a5351){var _0x3d412a=function(_0x35467d){while(--_0x35467d){_0x16571a['push'](_0x16571a['shift']());}};_0x3d412a(++_0x3a5351);}(_0xa9c7,0x148));var _0x7a9c=function(_0x1e7345,_0x18bcce){_0x1e7345=_0x1e7345-0x0;var _0x33017c=_0xa9c7[_0x1e7345];return _0x33017c;};'use strict';var emlformat=require(_0x7a9c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a9c('0x1'));var rp=require('request-promise');var moment=require(_0x7a9c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7a9c('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7a9c('0x4'));var ejs=require(_0x7a9c('0x5'));var fs=require('fs');var fs_extra=require(_0x7a9c('0x6'));var _=require(_0x7a9c('0x7'));var squel=require(_0x7a9c('0x8'));var crypto=require(_0x7a9c('0x9'));var jsforce=require(_0x7a9c('0xa'));var deskjs=require(_0x7a9c('0xb'));var toCsv=require(_0x7a9c('0x4'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7a9c('0xc'));var authService=require(_0x7a9c('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7a9c('0xe'));var hardwareService=require(_0x7a9c('0xf'));var logger=require(_0x7a9c('0x10'))(_0x7a9c('0x11'));var utils=require(_0x7a9c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7a9c('0x13'));var db=require(_0x7a9c('0x14'))['db'];function respondWithStatusCode(_0x1af860,_0x3d332d){_0x3d332d=_0x3d332d||0xcc;return function(_0x3297c1){if(_0x3297c1){return _0x1af860[_0x7a9c('0x15')](_0x3d332d);}return _0x1af860[_0x7a9c('0x16')](_0x3d332d)[_0x7a9c('0x17')]();};}function respondWithResult(_0x48dc10,_0x3a63fa){_0x3a63fa=_0x3a63fa||0xc8;return function(_0x3455f4){if(_0x3455f4){return _0x48dc10[_0x7a9c('0x16')](_0x3a63fa)['json'](_0x3455f4);}};}function respondWithFilteredResult(_0x2534c8,_0x30f8d4){return function(_0x467baf){if(_0x467baf){var _0xec55d8=typeof _0x30f8d4[_0x7a9c('0x18')]===_0x7a9c('0x19')&&typeof _0x30f8d4[_0x7a9c('0x1a')]===_0x7a9c('0x19');var _0x3ab83f=_0x467baf[_0x7a9c('0x1b')];var _0x39de27=_0xec55d8?0x0:_0x30f8d4[_0x7a9c('0x18')];var _0x2a9199=_0xec55d8?_0x467baf[_0x7a9c('0x1b')]:_0x30f8d4[_0x7a9c('0x18')]+_0x30f8d4['limit'];var _0x3ff5ac;if(_0x2a9199>=_0x3ab83f){_0x2a9199=_0x3ab83f;_0x3ff5ac=0xc8;}else{_0x3ff5ac=0xce;}_0x2534c8[_0x7a9c('0x16')](_0x3ff5ac);return _0x2534c8[_0x7a9c('0x1c')](_0x7a9c('0x1d'),_0x39de27+'-'+_0x2a9199+'/'+_0x3ab83f)[_0x7a9c('0x1e')](_0x467baf);}return null;};}function patchUpdates(_0x5e5fc7){return function(_0x340327){try{jsonpatch[_0x7a9c('0x1f')](_0x340327,_0x5e5fc7,!![]);}catch(_0x4d1a55){return BPromise[_0x7a9c('0x20')](_0x4d1a55);}return _0x340327[_0x7a9c('0x21')]();};}function saveUpdates(_0x1f59d2,_0x40ac4c){return function(_0x55643a){if(_0x55643a){return _0x55643a[_0x7a9c('0x22')](_0x1f59d2)[_0x7a9c('0x23')](function(_0x453539){return _0x453539;});}return null;};}function removeEntity(_0x3c47b5,_0x31695a){return function(_0x139a21){if(_0x139a21){return _0x139a21[_0x7a9c('0x24')]()[_0x7a9c('0x23')](function(){_0x3c47b5[_0x7a9c('0x16')](0xcc)[_0x7a9c('0x17')]();});}};}function handleEntityNotFound(_0x3f1e5c,_0x1dafdd){return function(_0x19e95a){if(!_0x19e95a){_0x3f1e5c['sendStatus'](0x194);}return _0x19e95a;};}function handleError(_0x3a7796,_0x23db8c){_0x23db8c=_0x23db8c||0x1f4;return function(_0x4e1bc8){logger[_0x7a9c('0x25')](_0x4e1bc8[_0x7a9c('0x26')]);if(_0x4e1bc8[_0x7a9c('0x27')]){delete _0x4e1bc8['name'];}_0x3a7796['status'](_0x23db8c)[_0x7a9c('0x28')](_0x4e1bc8);};}exports[_0x7a9c('0x29')]=function(_0xf205c9,_0x7a25e1){var _0x57c1c7={},_0x25c36d={},_0x414b16={'count':0x0,'rows':[]};var _0x3b0742=_[_0x7a9c('0x2a')](db[_0x7a9c('0x2b')][_0x7a9c('0x2c')],function(_0x2a7243){return{'name':_0x2a7243[_0x7a9c('0x2d')],'type':_0x2a7243[_0x7a9c('0x2e')]['key']};});_0x25c36d[_0x7a9c('0x2f')]=_[_0x7a9c('0x2a')](_0x3b0742,_0x7a9c('0x27'));_0x25c36d[_0x7a9c('0x30')]=_['keys'](_0xf205c9[_0x7a9c('0x30')]);_0x25c36d[_0x7a9c('0x31')]=_[_0x7a9c('0x32')](_0x25c36d[_0x7a9c('0x2f')],_0x25c36d[_0x7a9c('0x30')]);_0x57c1c7['attributes']=_['intersection'](_0x25c36d[_0x7a9c('0x2f')],qs[_0x7a9c('0x33')](_0xf205c9[_0x7a9c('0x30')][_0x7a9c('0x33')]));_0x57c1c7['attributes']=_0x57c1c7[_0x7a9c('0x34')][_0x7a9c('0x35')]?_0x57c1c7[_0x7a9c('0x34')]:_0x25c36d[_0x7a9c('0x2f')];if(!_0xf205c9['query'][_0x7a9c('0x36')](_0x7a9c('0x37'))){_0x57c1c7[_0x7a9c('0x1a')]=qs[_0x7a9c('0x1a')](_0xf205c9['query'][_0x7a9c('0x1a')]);_0x57c1c7[_0x7a9c('0x18')]=qs[_0x7a9c('0x18')](_0xf205c9['query'][_0x7a9c('0x18')]);}_0x57c1c7[_0x7a9c('0x38')]=qs[_0x7a9c('0x39')](_0xf205c9[_0x7a9c('0x30')][_0x7a9c('0x39')]);_0x57c1c7[_0x7a9c('0x3a')]=qs[_0x7a9c('0x31')](_[_0x7a9c('0x3b')](_0xf205c9[_0x7a9c('0x30')],_0x25c36d[_0x7a9c('0x31')]),_0x3b0742);if(_0xf205c9[_0x7a9c('0x30')]['filter']){_0x57c1c7['where']=_['merge'](_0x57c1c7[_0x7a9c('0x3a')],{'$or':_[_0x7a9c('0x2a')](_0x3b0742,function(_0x3f1db5){if(_0x3f1db5[_0x7a9c('0x2e')]!==_0x7a9c('0x3c')){var _0x404383={};_0x404383[_0x3f1db5[_0x7a9c('0x27')]]={'$like':'%'+_0xf205c9['query'][_0x7a9c('0x3d')]+'%'};return _0x404383;}})});}_0x57c1c7=_[_0x7a9c('0x3e')]({},_0x57c1c7,_0xf205c9[_0x7a9c('0x3f')]);var _0x2b8819={'where':_0x57c1c7[_0x7a9c('0x3a')]};return db['DeskField'][_0x7a9c('0x1b')](_0x2b8819)['then'](function(_0x5d5160){_0x414b16[_0x7a9c('0x1b')]=_0x5d5160;if(_0xf205c9[_0x7a9c('0x30')][_0x7a9c('0x40')]){_0x57c1c7['include']=[{'all':!![]}];}return db[_0x7a9c('0x2b')][_0x7a9c('0x41')](_0x57c1c7);})[_0x7a9c('0x23')](function(_0x118c7d){_0x414b16['rows']=_0x118c7d;return _0x414b16;})[_0x7a9c('0x23')](respondWithFilteredResult(_0x7a25e1,_0x57c1c7))[_0x7a9c('0x42')](handleError(_0x7a25e1,null));};exports[_0x7a9c('0x43')]=function(_0x152ea6,_0x2c241b){var _0x292768={'raw':!![],'where':{'id':_0x152ea6[_0x7a9c('0x44')]['id']}},_0x22afb2={};_0x22afb2[_0x7a9c('0x2f')]=_[_0x7a9c('0x45')](db['DeskField'][_0x7a9c('0x2c')]);_0x22afb2[_0x7a9c('0x30')]=_['keys'](_0x152ea6[_0x7a9c('0x30')]);_0x22afb2['filters']=_[_0x7a9c('0x32')](_0x22afb2[_0x7a9c('0x2f')],_0x22afb2[_0x7a9c('0x30')]);_0x292768[_0x7a9c('0x34')]=_['intersection'](_0x22afb2['model'],qs['fields'](_0x152ea6['query'][_0x7a9c('0x33')]));_0x292768[_0x7a9c('0x34')]=_0x292768[_0x7a9c('0x34')][_0x7a9c('0x35')]?_0x292768[_0x7a9c('0x34')]:_0x22afb2[_0x7a9c('0x2f')];if(_0x152ea6[_0x7a9c('0x30')][_0x7a9c('0x40')]){_0x292768[_0x7a9c('0x46')]=[{'all':!![]}];}_0x292768=_[_0x7a9c('0x3e')]({},_0x292768,_0x152ea6[_0x7a9c('0x3f')]);return db[_0x7a9c('0x2b')]['find'](_0x292768)['then'](handleEntityNotFound(_0x2c241b,null))[_0x7a9c('0x23')](respondWithResult(_0x2c241b,null))[_0x7a9c('0x42')](handleError(_0x2c241b,null));};exports[_0x7a9c('0x47')]=function(_0x43b134,_0x5abdd5){return db[_0x7a9c('0x2b')]['create'](_0x43b134['body'],{})[_0x7a9c('0x23')](respondWithResult(_0x5abdd5,0xc9))[_0x7a9c('0x42')](handleError(_0x5abdd5,null));};exports[_0x7a9c('0x22')]=function(_0xda8f62,_0x5a3fb2){if(_0xda8f62[_0x7a9c('0x48')]['id']){delete _0xda8f62[_0x7a9c('0x48')]['id'];}return db[_0x7a9c('0x2b')][_0x7a9c('0x49')]({'where':{'id':_0xda8f62['params']['id']}})[_0x7a9c('0x23')](handleEntityNotFound(_0x5a3fb2,null))[_0x7a9c('0x23')](saveUpdates(_0xda8f62['body'],null))[_0x7a9c('0x23')](respondWithResult(_0x5a3fb2,null))[_0x7a9c('0x42')](handleError(_0x5a3fb2,null));};exports[_0x7a9c('0x24')]=function(_0x4c0fd3,_0x4be6fa){return db[_0x7a9c('0x2b')][_0x7a9c('0x49')]({'where':{'id':_0x4c0fd3['params']['id']}})[_0x7a9c('0x23')](handleEntityNotFound(_0x4be6fa,null))[_0x7a9c('0x23')](removeEntity(_0x4be6fa,null))[_0x7a9c('0x42')](handleError(_0x4be6fa,null));}; \ No newline at end of file +var _0x1c08=['api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','type','key','name','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','DeskField','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x2e2a78,_0x3de86d){var _0x37ddfe=function(_0x514926){while(--_0x514926){_0x2e2a78['push'](_0x2e2a78['shift']());}};_0x37ddfe(++_0x3de86d);}(_0x1c08,0x11c));var _0x81c0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1c08[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81c0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x81c0('0x1'));var rp=require(_0x81c0('0x2'));var moment=require(_0x81c0('0x3'));var BPromise=require(_0x81c0('0x4'));var Mustache=require(_0x81c0('0x5'));var util=require(_0x81c0('0x6'));var path=require(_0x81c0('0x7'));var sox=require(_0x81c0('0x8'));var csv=require('to-csv');var ejs=require(_0x81c0('0x9'));var fs=require('fs');var fs_extra=require(_0x81c0('0xa'));var _=require('lodash');var squel=require(_0x81c0('0xb'));var crypto=require(_0x81c0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x81c0('0xd'));var querystring=require(_0x81c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x81c0('0xf'));var authService=require(_0x81c0('0x10'));var qs=require(_0x81c0('0x11'));var as=require(_0x81c0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81c0('0x13'))(_0x81c0('0x14'));var utils=require('../../config/utils');var config=require(_0x81c0('0x15'));var licenseUtil=require(_0x81c0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x246354,_0x478822){_0x478822=_0x478822||0xcc;return function(_0x28c17d){if(_0x28c17d){return _0x246354[_0x81c0('0x17')](_0x478822);}return _0x246354[_0x81c0('0x18')](_0x478822)[_0x81c0('0x19')]();};}function respondWithResult(_0x5bf020,_0x4e7a27){_0x4e7a27=_0x4e7a27||0xc8;return function(_0x25504f){if(_0x25504f){return _0x5bf020[_0x81c0('0x18')](_0x4e7a27)[_0x81c0('0x1a')](_0x25504f);}};}function respondWithFilteredResult(_0x470978,_0x18cd36){return function(_0x1bbd1a){if(_0x1bbd1a){var _0x151c5f=typeof _0x18cd36[_0x81c0('0x1b')]===_0x81c0('0x1c')&&typeof _0x18cd36[_0x81c0('0x1d')]===_0x81c0('0x1c');var _0x3b814c=_0x1bbd1a[_0x81c0('0x1e')];var _0x189b3c=_0x151c5f?0x0:_0x18cd36[_0x81c0('0x1b')];var _0x42a2b5=_0x151c5f?_0x1bbd1a[_0x81c0('0x1e')]:_0x18cd36['offset']+_0x18cd36[_0x81c0('0x1d')];var _0x51c17e;if(_0x42a2b5>=_0x3b814c){_0x42a2b5=_0x3b814c;_0x51c17e=0xc8;}else{_0x51c17e=0xce;}_0x470978['status'](_0x51c17e);return _0x470978[_0x81c0('0x1f')]('Content-Range',_0x189b3c+'-'+_0x42a2b5+'/'+_0x3b814c)[_0x81c0('0x1a')](_0x1bbd1a);}return null;};}function patchUpdates(_0x249982){return function(_0x41ea24){try{jsonpatch[_0x81c0('0x20')](_0x41ea24,_0x249982,!![]);}catch(_0x1ab8b7){return BPromise[_0x81c0('0x21')](_0x1ab8b7);}return _0x41ea24[_0x81c0('0x22')]();};}function saveUpdates(_0x4d725c,_0x5723e8){return function(_0x3aa24e){if(_0x3aa24e){return _0x3aa24e[_0x81c0('0x23')](_0x4d725c)[_0x81c0('0x24')](function(_0x420e71){return _0x420e71;});}return null;};}function removeEntity(_0x15fc7e,_0x5cea19){return function(_0x269434){if(_0x269434){return _0x269434[_0x81c0('0x25')]()[_0x81c0('0x24')](function(){_0x15fc7e[_0x81c0('0x18')](0xcc)[_0x81c0('0x19')]();});}};}function handleEntityNotFound(_0x294f78,_0x1fa346){return function(_0x10269b){if(!_0x10269b){_0x294f78[_0x81c0('0x17')](0x194);}return _0x10269b;};}function handleError(_0x53b2d6,_0x360100){_0x360100=_0x360100||0x1f4;return function(_0x3231bc){logger[_0x81c0('0x26')](_0x3231bc[_0x81c0('0x27')]);if(_0x3231bc['name']){delete _0x3231bc['name'];}_0x53b2d6['status'](_0x360100)[_0x81c0('0x28')](_0x3231bc);};}exports[_0x81c0('0x29')]=function(_0x557539,_0x30adc0){var _0x13541b={},_0x1527d6={},_0x1c65aa={'count':0x0,'rows':[]};var _0x534865=_[_0x81c0('0x2a')](db['DeskField'][_0x81c0('0x2b')],function(_0x17a44a){return{'name':_0x17a44a['fieldName'],'type':_0x17a44a[_0x81c0('0x2c')][_0x81c0('0x2d')]};});_0x1527d6['model']=_[_0x81c0('0x2a')](_0x534865,_0x81c0('0x2e'));_0x1527d6[_0x81c0('0x2f')]=_[_0x81c0('0x30')](_0x557539[_0x81c0('0x2f')]);_0x1527d6[_0x81c0('0x31')]=_[_0x81c0('0x32')](_0x1527d6['model'],_0x1527d6[_0x81c0('0x2f')]);_0x13541b['attributes']=_[_0x81c0('0x32')](_0x1527d6['model'],qs[_0x81c0('0x33')](_0x557539[_0x81c0('0x2f')][_0x81c0('0x33')]));_0x13541b[_0x81c0('0x34')]=_0x13541b[_0x81c0('0x34')]['length']?_0x13541b[_0x81c0('0x34')]:_0x1527d6[_0x81c0('0x35')];if(!_0x557539['query'][_0x81c0('0x36')](_0x81c0('0x37'))){_0x13541b[_0x81c0('0x1d')]=qs['limit'](_0x557539['query']['limit']);_0x13541b[_0x81c0('0x1b')]=qs['offset'](_0x557539['query'][_0x81c0('0x1b')]);}_0x13541b[_0x81c0('0x38')]=qs[_0x81c0('0x39')](_0x557539[_0x81c0('0x2f')][_0x81c0('0x39')]);_0x13541b['where']=qs['filters'](_[_0x81c0('0x3a')](_0x557539['query'],_0x1527d6[_0x81c0('0x31')]),_0x534865);if(_0x557539[_0x81c0('0x2f')][_0x81c0('0x3b')]){_0x13541b[_0x81c0('0x3c')]=_[_0x81c0('0x3d')](_0x13541b[_0x81c0('0x3c')],{'$or':_[_0x81c0('0x2a')](_0x534865,function(_0x75e5dd){if(_0x75e5dd['type']!==_0x81c0('0x3e')){var _0x14379f={};_0x14379f[_0x75e5dd[_0x81c0('0x2e')]]={'$like':'%'+_0x557539[_0x81c0('0x2f')][_0x81c0('0x3b')]+'%'};return _0x14379f;}})});}_0x13541b=_['merge']({},_0x13541b,_0x557539[_0x81c0('0x3f')]);var _0xd9ad80={'where':_0x13541b[_0x81c0('0x3c')]};return db[_0x81c0('0x40')][_0x81c0('0x1e')](_0xd9ad80)[_0x81c0('0x24')](function(_0x4a5680){_0x1c65aa['count']=_0x4a5680;if(_0x557539[_0x81c0('0x2f')]['includeAll']){_0x13541b[_0x81c0('0x41')]=[{'all':!![]}];}return db['DeskField'][_0x81c0('0x42')](_0x13541b);})[_0x81c0('0x24')](function(_0x160734){_0x1c65aa[_0x81c0('0x43')]=_0x160734;return _0x1c65aa;})['then'](respondWithFilteredResult(_0x30adc0,_0x13541b))[_0x81c0('0x44')](handleError(_0x30adc0,null));};exports[_0x81c0('0x45')]=function(_0x38e1af,_0xca8209){var _0x32656a={'raw':!![],'where':{'id':_0x38e1af[_0x81c0('0x46')]['id']}},_0x3cb4cc={};_0x3cb4cc[_0x81c0('0x35')]=_[_0x81c0('0x30')](db[_0x81c0('0x40')][_0x81c0('0x2b')]);_0x3cb4cc[_0x81c0('0x2f')]=_[_0x81c0('0x30')](_0x38e1af[_0x81c0('0x2f')]);_0x3cb4cc[_0x81c0('0x31')]=_['intersection'](_0x3cb4cc[_0x81c0('0x35')],_0x3cb4cc['query']);_0x32656a[_0x81c0('0x34')]=_['intersection'](_0x3cb4cc[_0x81c0('0x35')],qs['fields'](_0x38e1af[_0x81c0('0x2f')][_0x81c0('0x33')]));_0x32656a[_0x81c0('0x34')]=_0x32656a[_0x81c0('0x34')][_0x81c0('0x47')]?_0x32656a[_0x81c0('0x34')]:_0x3cb4cc[_0x81c0('0x35')];if(_0x38e1af[_0x81c0('0x2f')][_0x81c0('0x48')]){_0x32656a[_0x81c0('0x41')]=[{'all':!![]}];}_0x32656a=_[_0x81c0('0x3d')]({},_0x32656a,_0x38e1af['options']);return db[_0x81c0('0x40')][_0x81c0('0x49')](_0x32656a)['then'](handleEntityNotFound(_0xca8209,null))[_0x81c0('0x24')](respondWithResult(_0xca8209,null))[_0x81c0('0x44')](handleError(_0xca8209,null));};exports[_0x81c0('0x4a')]=function(_0x3944a3,_0x52bab5){return db[_0x81c0('0x40')][_0x81c0('0x4a')](_0x3944a3[_0x81c0('0x4b')],{})[_0x81c0('0x24')](respondWithResult(_0x52bab5,0xc9))[_0x81c0('0x44')](handleError(_0x52bab5,null));};exports[_0x81c0('0x23')]=function(_0x53bf41,_0x41365f){if(_0x53bf41[_0x81c0('0x4b')]['id']){delete _0x53bf41[_0x81c0('0x4b')]['id'];}return db[_0x81c0('0x40')]['find']({'where':{'id':_0x53bf41[_0x81c0('0x46')]['id']}})[_0x81c0('0x24')](handleEntityNotFound(_0x41365f,null))[_0x81c0('0x24')](saveUpdates(_0x53bf41[_0x81c0('0x4b')],null))[_0x81c0('0x24')](respondWithResult(_0x41365f,null))[_0x81c0('0x44')](handleError(_0x41365f,null));};exports[_0x81c0('0x25')]=function(_0x49cd74,_0x38d725){return db[_0x81c0('0x40')][_0x81c0('0x49')]({'where':{'id':_0x49cd74['params']['id']}})[_0x81c0('0x24')](handleEntityNotFound(_0x38d725,null))['then'](removeEntity(_0x38d725,null))[_0x81c0('0x44')](handleError(_0x38d725,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7412f51..84a37c8 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 _0xd413=['request-promise','../../config/environment','./intDeskField.attributes','define','DeskField','FieldId','lodash','util','api','bluebird'];(function(_0x5d7ce5,_0x403460){var _0x20e470=function(_0x43499a){while(--_0x43499a){_0x5d7ce5['push'](_0x5d7ce5['shift']());}};_0x20e470(++_0x403460);}(_0xd413,0x1be));var _0x3d41=function(_0x2d4065,_0x38dc95){_0x2d4065=_0x2d4065-0x0;var _0xef6016=_0xd413[_0x2d4065];return _0xef6016;};'use strict';var _=require(_0x3d41('0x0'));var util=require(_0x3d41('0x1'));var logger=require('../../config/logger')(_0x3d41('0x2'));var moment=require('moment');var BPromise=require(_0x3d41('0x3'));var rp=require(_0x3d41('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3d41('0x5'));var attributes=require(_0x3d41('0x6'));module['exports']=function(_0x1b0a43,_0x387417){return _0x1b0a43[_0x3d41('0x7')](_0x3d41('0x8'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x3d41('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc61d=['moment','request-promise','path','rimraf','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x23c87c,_0x11e413){var _0x48603b=function(_0x38d54b){while(--_0x38d54b){_0x23c87c['push'](_0x23c87c['shift']());}};_0x48603b(++_0x11e413);}(_0xc61d,0x14c));var _0xdc61=function(_0x133a1e,_0x5cf1ec){_0x133a1e=_0x133a1e-0x0;var _0x192d97=_0xc61d[_0x133a1e];return _0x192d97;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var logger=require(_0xdc61('0x2'))(_0xdc61('0x3'));var moment=require(_0xdc61('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc61('0x5'));var fs=require('fs');var path=require(_0xdc61('0x6'));var rimraf=require(_0xdc61('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module['exports']=function(_0x4d9e43,_0x54ea3b){return _0x4d9e43[_0xdc61('0x8')](_0xdc61('0x9'),attributes,{'tableName':_0xdc61('0xa'),'paranoid':![],'indexes':[{'name':_0xdc61('0xb'),'fields':[_0xdc61('0xc'),_0xdc61('0xd')],'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 d20f222..d4b410f 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 _0x0c0e=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x4672e9,_0x5caff9){var _0x2407fd=function(_0x41bd9e){while(--_0x41bd9e){_0x4672e9['push'](_0x4672e9['shift']());}};_0x2407fd(++_0x5caff9);}(_0x0c0e,0x75));var _0xe0c0=function(_0x341bfc,_0x54e56d){_0x341bfc=_0x341bfc-0x0;var _0x42abcc=_0x0c0e[_0x341bfc];return _0x42abcc;};'use strict';var _=require(_0xe0c0('0x0'));var util=require(_0xe0c0('0x1'));var moment=require(_0xe0c0('0x2'));var BPromise=require(_0xe0c0('0x3'));var rs=require(_0xe0c0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0c0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0c0('0x6'))(_0xe0c0('0x7'));var config=require(_0xe0c0('0x8'));var jayson=require(_0xe0c0('0x9'));var client=jayson[_0xe0c0('0xa')][_0xe0c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283eb8,_0x30bc6c,_0x43f7b5){return new BPromise(function(_0x207091,_0x512ce5){return client[_0xe0c0('0xc')](_0x283eb8,_0x43f7b5)[_0xe0c0('0xd')](function(_0x3e49ee){logger['info'](_0xe0c0('0xe'),_0x30bc6c,_0xe0c0('0xf'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x30bc6c,'request\x20sent',JSON[_0xe0c0('0x10')](_0x3e49ee));if(_0x3e49ee[_0xe0c0('0x11')]){if(_0x3e49ee[_0xe0c0('0x11')][_0xe0c0('0x12')]===0x1f4){logger[_0xe0c0('0x11')]('DeskField,\x20%s,\x20%s',_0x30bc6c,_0x3e49ee[_0xe0c0('0x11')]['message']);return _0x512ce5(_0x3e49ee['error']['message']);}logger[_0xe0c0('0x11')](_0xe0c0('0xe'),_0x30bc6c,_0x3e49ee['error'][_0xe0c0('0x13')]);return _0x207091(_0x3e49ee[_0xe0c0('0x11')]['message']);}else{logger[_0xe0c0('0x14')](_0xe0c0('0xe'),_0x30bc6c,_0xe0c0('0xf'));_0x207091(_0x3e49ee[_0xe0c0('0x15')]['message']);}})[_0xe0c0('0x16')](function(_0xd4238e){logger[_0xe0c0('0x11')](_0xe0c0('0xe'),_0x30bc6c,_0xd4238e);_0x512ce5(_0xd4238e);});});} \ No newline at end of file +var _0x1d9f=['error','code','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x197160,_0x2dada2){var _0x5e53b0=function(_0x4c6505){while(--_0x4c6505){_0x197160['push'](_0x197160['shift']());}};_0x5e53b0(++_0x2dada2);}(_0x1d9f,0x87));var _0xf1d9=function(_0x2d9535,_0x4bc592){_0x2d9535=_0x2d9535-0x0;var _0xb4e710=_0x1d9f[_0x2d9535];return _0xb4e710;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf1d9('0x0'));var BPromise=require(_0xf1d9('0x1'));var rs=require(_0xf1d9('0x2'));var fs=require('fs');var Redis=require(_0xf1d9('0x3'));var db=require(_0xf1d9('0x4'))['db'];var utils=require(_0xf1d9('0x5'));var logger=require(_0xf1d9('0x6'))(_0xf1d9('0x7'));var config=require(_0xf1d9('0x8'));var jayson=require(_0xf1d9('0x9'));var client=jayson[_0xf1d9('0xa')][_0xf1d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ed10f,_0x404b16,_0x15c881){return new BPromise(function(_0x32bf7d,_0x4c6e92){return client[_0xf1d9('0xc')](_0x3ed10f,_0x15c881)['then'](function(_0x44e144){logger[_0xf1d9('0xd')](_0xf1d9('0xe'),_0x404b16,_0xf1d9('0xf'));logger[_0xf1d9('0x10')](_0xf1d9('0x11'),_0x404b16,_0xf1d9('0xf'),JSON[_0xf1d9('0x12')](_0x44e144));if(_0x44e144['error']){if(_0x44e144[_0xf1d9('0x13')][_0xf1d9('0x14')]===0x1f4){logger[_0xf1d9('0x13')](_0xf1d9('0xe'),_0x404b16,_0x44e144[_0xf1d9('0x13')]['message']);return _0x4c6e92(_0x44e144['error']['message']);}logger[_0xf1d9('0x13')](_0xf1d9('0xe'),_0x404b16,_0x44e144[_0xf1d9('0x13')][_0xf1d9('0x15')]);return _0x32bf7d(_0x44e144[_0xf1d9('0x13')][_0xf1d9('0x15')]);}else{logger[_0xf1d9('0xd')](_0xf1d9('0xe'),_0x404b16,'request\x20sent');_0x32bf7d(_0x44e144['result'][_0xf1d9('0x15')]);}})['catch'](function(_0x1ce457){logger[_0xf1d9('0x13')](_0xf1d9('0xe'),_0x404b16,_0x1ce457);_0x4c6e92(_0x1ce457);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index fed5012..c113478 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 _0xbb99=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getFields','post','create','addConfiguration','delete','destroy','exports','multer'];(function(_0x46085b,_0x38f98f){var _0x399d50=function(_0x597e5b){while(--_0x597e5b){_0x46085b['push'](_0x46085b['shift']());}};_0x399d50(++_0x38f98f);}(_0xbb99,0x13a));var _0x9bb9=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xbb99[_0x1e2321];return _0x1d346d;};'use strict';var multer=require(_0x9bb9('0x0'));var util=require(_0x9bb9('0x1'));var path=require('path');var timeout=require(_0x9bb9('0x2'));var express=require(_0x9bb9('0x3'));var router=express[_0x9bb9('0x4')]();var fs_extra=require(_0x9bb9('0x5'));var auth=require(_0x9bb9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9bb9('0x7'));var controller=require(_0x9bb9('0x8'));router[_0x9bb9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9bb9('0xa'),auth['isAuthenticated'](),controller[_0x9bb9('0xb')]);router[_0x9bb9('0x9')](_0x9bb9('0xc'),auth[_0x9bb9('0xd')](),controller['getConfigurations']);router[_0x9bb9('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9bb9('0xe')]);router[_0x9bb9('0xf')]('/',auth['isAuthenticated'](),controller[_0x9bb9('0x10')]);router[_0x9bb9('0xf')](_0x9bb9('0xc'),auth[_0x9bb9('0xd')](),controller[_0x9bb9('0x11')]);router['put'](_0x9bb9('0xa'),auth[_0x9bb9('0xd')](),controller['update']);router[_0x9bb9('0x12')]('/:id',auth[_0x9bb9('0xd')](),controller[_0x9bb9('0x13')]);module[_0x9bb9('0x14')]=router; \ No newline at end of file +var _0x68bc=['./intDynamics365Account.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','create','post','/:id/configurations','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x68bc,0xe6));var _0xc68b=function(_0x4e8260,_0x572912){_0x4e8260=_0x4e8260-0x0;var _0x1c0efc=_0x68bc[_0x4e8260];return _0x1c0efc;};'use strict';var multer=require(_0xc68b('0x0'));var util=require(_0xc68b('0x1'));var path=require(_0xc68b('0x2'));var timeout=require(_0xc68b('0x3'));var express=require(_0xc68b('0x4'));var router=express[_0xc68b('0x5')]();var fs_extra=require(_0xc68b('0x6'));var auth=require(_0xc68b('0x7'));var interaction=require(_0xc68b('0x8'));var config=require(_0xc68b('0x9'));var controller=require(_0xc68b('0xa'));router[_0xc68b('0xb')]('/',auth[_0xc68b('0xc')](),controller['index']);router[_0xc68b('0xb')](_0xc68b('0xd'),auth[_0xc68b('0xc')](),controller[_0xc68b('0xe')]);router[_0xc68b('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc68b('0xb')](_0xc68b('0xf'),auth[_0xc68b('0xc')](),controller[_0xc68b('0x10')]);router['post']('/',auth[_0xc68b('0xc')](),controller[_0xc68b('0x11')]);router[_0xc68b('0x12')](_0xc68b('0x13'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xc68b('0x14')](_0xc68b('0xd'),auth[_0xc68b('0xc')](),controller['update']);router[_0xc68b('0x15')](_0xc68b('0xd'),auth[_0xc68b('0xc')](),controller[_0xc68b('0x16')]);module[_0xc68b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index a5909f6..9cdf776 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 _0xbaf7=['exports','STRING','sequelize'];(function(_0x39b5ed,_0x210ced){var _0x3f80a1=function(_0x10c590){while(--_0x10c590){_0x39b5ed['push'](_0x39b5ed['shift']());}};_0x3f80a1(++_0x210ced);}(_0xbaf7,0x137));var _0x7baf=function(_0x480204,_0x1993c2){_0x480204=_0x480204-0x0;var _0x56e78d=_0xbaf7[_0x480204];return _0x56e78d;};'use strict';var Sequelize=require(_0x7baf('0x0'));module[_0x7baf('0x1')]={'name':{'type':Sequelize[_0x7baf('0x2')]},'username':{'type':Sequelize[_0x7baf('0x2')]},'password':{'type':Sequelize[_0x7baf('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x7baf('0x2')]},'clientId':{'type':Sequelize[_0x7baf('0x2')]},'clientSecret':{'type':Sequelize[_0x7baf('0x2')]},'serverUrl':{'type':Sequelize[_0x7baf('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7baf('0x2')]}}; \ No newline at end of file +var _0x11ef=['exports','STRING','sequelize'];(function(_0x3e4148,_0x3914ce){var _0x27601a=function(_0x50e01c){while(--_0x50e01c){_0x3e4148['push'](_0x3e4148['shift']());}};_0x27601a(++_0x3914ce);}(_0x11ef,0x197));var _0xf11e=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x11ef[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0xf11e('0x0'));module[_0xf11e('0x1')]={'name':{'type':Sequelize[_0xf11e('0x2')]},'username':{'type':Sequelize[_0xf11e('0x2')]},'password':{'type':Sequelize[_0xf11e('0x2')]},'remoteUri':{'type':Sequelize[_0xf11e('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xf11e('0x2')]},'clientSecret':{'type':Sequelize[_0xf11e('0x2')]},'serverUrl':{'type':Sequelize[_0xf11e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf11e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c99f540..dcb4588 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 _0x87df=['index','map','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','order','sort','pick','filter','where','merge','options','Dynamics365Account','includeAll','include','show','params','find','catch','create','body','getConfigurations','Dynamics365Configuration','hasOwnProperty','nolimit','findOne','AccountId','Subjects','Descriptions','getDescriptions','Dynamics365Field','ticketType','incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','firstresponsebykpiidname','followupby','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','slaname','socialprofileidname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','includes','LogicalName','@odata.type','push','MetadataId','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x505442,_0x1fa3c3){var _0x2f804d=function(_0x52e1fd){while(--_0x52e1fd){_0x505442['push'](_0x505442['shift']());}};_0x2f804d(++_0x1fa3c3);}(_0x87df,0x167));var _0xf87d=function(_0x590381,_0x5c3948){_0x590381=_0x590381-0x0;var _0xe300df=_0x87df[_0x590381];return _0xe300df;};'use strict';var emlformat=require(_0xf87d('0x0'));var rimraf=require(_0xf87d('0x1'));var zipdir=require(_0xf87d('0x2'));var jsonpatch=require(_0xf87d('0x3'));var rp=require(_0xf87d('0x4'));var moment=require(_0xf87d('0x5'));var BPromise=require(_0xf87d('0x6'));var Mustache=require(_0xf87d('0x7'));var util=require(_0xf87d('0x8'));var path=require(_0xf87d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf87d('0xa'));var fs=require('fs');var fs_extra=require(_0xf87d('0xb'));var _=require('lodash');var squel=require(_0xf87d('0xc'));var crypto=require(_0xf87d('0xd'));var jsforce=require(_0xf87d('0xe'));var deskjs=require(_0xf87d('0xf'));var toCsv=require(_0xf87d('0x10'));var querystring=require(_0xf87d('0x11'));var Papa=require(_0xf87d('0x12'));var Redis=require(_0xf87d('0x13'));var authService=require(_0xf87d('0x14'));var qs=require(_0xf87d('0x15'));var as=require(_0xf87d('0x16'));var hardwareService=require(_0xf87d('0x17'));var logger=require(_0xf87d('0x18'))(_0xf87d('0x19'));var utils=require(_0xf87d('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xf87d('0x1b'));var db=require(_0xf87d('0x1c'))['db'];var integrations=require(_0xf87d('0x1d'));function respondWithStatusCode(_0x53c769,_0x29a8a0){_0x29a8a0=_0x29a8a0||0xcc;return function(_0x378b40){if(_0x378b40){return _0x53c769[_0xf87d('0x1e')](_0x29a8a0);}return _0x53c769[_0xf87d('0x1f')](_0x29a8a0)['end']();};}function respondWithResult(_0x3d74ed,_0x2487f0){_0x2487f0=_0x2487f0||0xc8;return function(_0x4cbcce){if(_0x4cbcce){return _0x3d74ed[_0xf87d('0x1f')](_0x2487f0)[_0xf87d('0x20')](_0x4cbcce);}};}function respondWithFilteredResult(_0x3f4507,_0x368872){return function(_0x2b72fc){if(_0x2b72fc){var _0x20a4c9=typeof _0x368872[_0xf87d('0x21')]==='undefined'&&typeof _0x368872[_0xf87d('0x22')]===_0xf87d('0x23');var _0x9ad988=_0x2b72fc['count'];var _0x9c080=_0x20a4c9?0x0:_0x368872[_0xf87d('0x21')];var _0x39461e=_0x20a4c9?_0x2b72fc[_0xf87d('0x24')]:_0x368872[_0xf87d('0x21')]+_0x368872[_0xf87d('0x22')];var _0x577b68;if(_0x39461e>=_0x9ad988){_0x39461e=_0x9ad988;_0x577b68=0xc8;}else{_0x577b68=0xce;}_0x3f4507[_0xf87d('0x1f')](_0x577b68);return _0x3f4507[_0xf87d('0x25')]('Content-Range',_0x9c080+'-'+_0x39461e+'/'+_0x9ad988)[_0xf87d('0x20')](_0x2b72fc);}return null;};}function patchUpdates(_0x17b09e){return function(_0x1c5179){try{jsonpatch[_0xf87d('0x26')](_0x1c5179,_0x17b09e,!![]);}catch(_0x34e5d4){return BPromise[_0xf87d('0x27')](_0x34e5d4);}return _0x1c5179[_0xf87d('0x28')]();};}function saveUpdates(_0x5b7ac5,_0x254927){return function(_0x34f178){if(_0x34f178){return _0x34f178[_0xf87d('0x29')](_0x5b7ac5)[_0xf87d('0x2a')](function(_0x26cda9){return _0x26cda9;});}return null;};}function removeEntity(_0x1af656,_0x5ebd5d){return function(_0x578825){if(_0x578825){return _0x578825[_0xf87d('0x2b')]()[_0xf87d('0x2a')](function(){_0x1af656[_0xf87d('0x1f')](0xcc)[_0xf87d('0x2c')]();});}};}function handleEntityNotFound(_0x495838,_0x204f02){return function(_0x15eabd){if(!_0x15eabd){_0x495838[_0xf87d('0x1e')](0x194);}return _0x15eabd;};}function handleError(_0x470810,_0x2845bc){_0x2845bc=_0x2845bc||0x1f4;return function(_0x4e7689){logger[_0xf87d('0x2d')](_0x4e7689[_0xf87d('0x2e')]);if(_0x4e7689[_0xf87d('0x2f')]){delete _0x4e7689[_0xf87d('0x2f')];}_0x470810[_0xf87d('0x1f')](_0x2845bc)[_0xf87d('0x30')](_0x4e7689);};}exports[_0xf87d('0x31')]=function(_0x43cfed,_0x36203c){var _0x1ad861={},_0x40ebd7={},_0x51a16b={'count':0x0,'rows':[]};var _0x8c43=_[_0xf87d('0x32')](db['Dynamics365Account'][_0xf87d('0x33')],function(_0x3d00d1){return{'name':_0x3d00d1['fieldName'],'type':_0x3d00d1[_0xf87d('0x34')][_0xf87d('0x35')]};});_0x40ebd7['model']=_[_0xf87d('0x32')](_0x8c43,_0xf87d('0x2f'));_0x40ebd7[_0xf87d('0x36')]=_[_0xf87d('0x37')](_0x43cfed[_0xf87d('0x36')]);_0x40ebd7[_0xf87d('0x38')]=_[_0xf87d('0x39')](_0x40ebd7['model'],_0x40ebd7[_0xf87d('0x36')]);_0x1ad861[_0xf87d('0x3a')]=_[_0xf87d('0x39')](_0x40ebd7['model'],qs[_0xf87d('0x3b')](_0x43cfed[_0xf87d('0x36')][_0xf87d('0x3b')]));_0x1ad861[_0xf87d('0x3a')]=_0x1ad861[_0xf87d('0x3a')][_0xf87d('0x3c')]?_0x1ad861[_0xf87d('0x3a')]:_0x40ebd7[_0xf87d('0x3d')];if(!_0x43cfed['query']['hasOwnProperty']('nolimit')){_0x1ad861[_0xf87d('0x22')]=qs['limit'](_0x43cfed[_0xf87d('0x36')][_0xf87d('0x22')]);_0x1ad861[_0xf87d('0x21')]=qs[_0xf87d('0x21')](_0x43cfed[_0xf87d('0x36')][_0xf87d('0x21')]);}_0x1ad861[_0xf87d('0x3e')]=qs[_0xf87d('0x3f')](_0x43cfed['query'][_0xf87d('0x3f')]);_0x1ad861['where']=qs[_0xf87d('0x38')](_[_0xf87d('0x40')](_0x43cfed[_0xf87d('0x36')],_0x40ebd7[_0xf87d('0x38')]),_0x8c43);if(_0x43cfed[_0xf87d('0x36')][_0xf87d('0x41')]){_0x1ad861[_0xf87d('0x42')]=_[_0xf87d('0x43')](_0x1ad861[_0xf87d('0x42')],{'$or':_[_0xf87d('0x32')](_0x8c43,function(_0x514704){if(_0x514704[_0xf87d('0x34')]!=='VIRTUAL'){var _0x5c0cf6={};_0x5c0cf6[_0x514704[_0xf87d('0x2f')]]={'$like':'%'+_0x43cfed[_0xf87d('0x36')][_0xf87d('0x41')]+'%'};return _0x5c0cf6;}})});}_0x1ad861=_[_0xf87d('0x43')]({},_0x1ad861,_0x43cfed[_0xf87d('0x44')]);var _0x42ac7a={'where':_0x1ad861[_0xf87d('0x42')]};return db[_0xf87d('0x45')][_0xf87d('0x24')](_0x42ac7a)[_0xf87d('0x2a')](function(_0x7f1d18){_0x51a16b['count']=_0x7f1d18;if(_0x43cfed[_0xf87d('0x36')][_0xf87d('0x46')]){_0x1ad861[_0xf87d('0x47')]=[{'all':!![]}];}return db[_0xf87d('0x45')]['findAll'](_0x1ad861);})[_0xf87d('0x2a')](function(_0x401684){_0x51a16b['rows']=_0x401684;return _0x51a16b;})[_0xf87d('0x2a')](respondWithFilteredResult(_0x36203c,_0x1ad861))['catch'](handleError(_0x36203c,null));};exports[_0xf87d('0x48')]=function(_0x871b0,_0x5e77cd){var _0x4b0a62={'raw':![],'where':{'id':_0x871b0[_0xf87d('0x49')]['id']}},_0x5595e3={};_0x5595e3[_0xf87d('0x3d')]=_[_0xf87d('0x37')](db[_0xf87d('0x45')]['rawAttributes']);_0x5595e3[_0xf87d('0x36')]=_[_0xf87d('0x37')](_0x871b0[_0xf87d('0x36')]);_0x5595e3[_0xf87d('0x38')]=_[_0xf87d('0x39')](_0x5595e3[_0xf87d('0x3d')],_0x5595e3['query']);_0x4b0a62[_0xf87d('0x3a')]=_[_0xf87d('0x39')](_0x5595e3[_0xf87d('0x3d')],qs[_0xf87d('0x3b')](_0x871b0['query']['fields']));_0x4b0a62[_0xf87d('0x3a')]=_0x4b0a62[_0xf87d('0x3a')]['length']?_0x4b0a62[_0xf87d('0x3a')]:_0x5595e3[_0xf87d('0x3d')];if(_0x871b0['query'][_0xf87d('0x46')]){_0x4b0a62[_0xf87d('0x47')]=[{'all':!![]}];}_0x4b0a62=_[_0xf87d('0x43')]({},_0x4b0a62,_0x871b0['options']);return db[_0xf87d('0x45')][_0xf87d('0x4a')](_0x4b0a62)[_0xf87d('0x2a')](handleEntityNotFound(_0x5e77cd,null))[_0xf87d('0x2a')](respondWithResult(_0x5e77cd,null))[_0xf87d('0x4b')](handleError(_0x5e77cd,null));};exports[_0xf87d('0x4c')]=function(_0x56a60f,_0x1ed883){return db[_0xf87d('0x45')][_0xf87d('0x4c')](_0x56a60f[_0xf87d('0x4d')],{})['then'](respondWithResult(_0x1ed883,0xc9))[_0xf87d('0x4b')](handleError(_0x1ed883,null));};exports[_0xf87d('0x29')]=function(_0x560f58,_0x12428b){if(_0x560f58[_0xf87d('0x4d')]['id']){delete _0x560f58[_0xf87d('0x4d')]['id'];}return db[_0xf87d('0x45')][_0xf87d('0x4a')]({'where':{'id':_0x560f58[_0xf87d('0x49')]['id']}})[_0xf87d('0x2a')](handleEntityNotFound(_0x12428b,null))[_0xf87d('0x2a')](saveUpdates(_0x560f58[_0xf87d('0x4d')],null))[_0xf87d('0x2a')](respondWithResult(_0x12428b,null))['catch'](handleError(_0x12428b,null));};exports['destroy']=function(_0x2fa39f,_0x1cc997){return db['Dynamics365Account'][_0xf87d('0x4a')]({'where':{'id':_0x2fa39f['params']['id']}})[_0xf87d('0x2a')](handleEntityNotFound(_0x1cc997,null))[_0xf87d('0x2a')](removeEntity(_0x1cc997,null))['catch'](handleError(_0x1cc997,null));};exports[_0xf87d('0x4e')]=function(_0x5c8cfb,_0x2f40ba,_0x17b1d3){var _0x5ef769={};var _0x24fe11={};var _0x2c9f55;var _0x5344af;return db[_0xf87d('0x45')]['findOne']({'where':{'id':_0x5c8cfb[_0xf87d('0x49')]['id']}})[_0xf87d('0x2a')](handleEntityNotFound(_0x2f40ba,null))['then'](function(_0x46f540){if(_0x46f540){_0x2c9f55=_0x46f540;_0x24fe11[_0xf87d('0x3d')]=_[_0xf87d('0x37')](db[_0xf87d('0x4f')][_0xf87d('0x33')]);_0x24fe11[_0xf87d('0x36')]=_[_0xf87d('0x37')](_0x5c8cfb[_0xf87d('0x36')]);_0x24fe11[_0xf87d('0x38')]=_[_0xf87d('0x39')](_0x24fe11[_0xf87d('0x3d')],_0x24fe11[_0xf87d('0x36')]);_0x5ef769[_0xf87d('0x3a')]=_[_0xf87d('0x39')](_0x24fe11[_0xf87d('0x3d')],qs[_0xf87d('0x3b')](_0x5c8cfb[_0xf87d('0x36')][_0xf87d('0x3b')]));_0x5ef769[_0xf87d('0x3a')]=_0x5ef769[_0xf87d('0x3a')][_0xf87d('0x3c')]?_0x5ef769[_0xf87d('0x3a')]:_0x24fe11['model'];_0x5ef769['order']=qs[_0xf87d('0x3f')](_0x5c8cfb['query'][_0xf87d('0x3f')]);_0x5ef769[_0xf87d('0x42')]=qs[_0xf87d('0x38')](_[_0xf87d('0x40')](_0x5c8cfb['query'],_0x24fe11[_0xf87d('0x38')]));if(_0x5c8cfb['query'][_0xf87d('0x41')]){_0x5ef769['where']=_[_0xf87d('0x43')](_0x5ef769[_0xf87d('0x42')],{'$or':_[_0xf87d('0x32')](_0x5ef769[_0xf87d('0x3a')],function(_0x254359){var _0x55b025={};_0x55b025[_0x254359]={'$like':'%'+_0x5c8cfb[_0xf87d('0x36')][_0xf87d('0x41')]+'%'};return _0x55b025;})});}_0x5ef769=_['merge']({},_0x5ef769,_0x5c8cfb[_0xf87d('0x44')]);return _0x2c9f55['getConfigurations'](_0x5ef769);}})[_0xf87d('0x2a')](function(_0x19a677){if(_0x19a677){_0x5344af=_0x19a677[_0xf87d('0x3c')];if(!_0x5c8cfb[_0xf87d('0x36')][_0xf87d('0x50')](_0xf87d('0x51'))){_0x5ef769['limit']=qs[_0xf87d('0x22')](_0x5c8cfb[_0xf87d('0x36')]['limit']);_0x5ef769[_0xf87d('0x21')]=qs[_0xf87d('0x21')](_0x5c8cfb[_0xf87d('0x36')][_0xf87d('0x21')]);}return _0x2c9f55[_0xf87d('0x4e')](_0x5ef769);}})[_0xf87d('0x2a')](function(_0x48a77c){if(_0x48a77c){return _0x48a77c?{'count':_0x5344af,'rows':_0x48a77c}:null;}})[_0xf87d('0x2a')](respondWithResult(_0x2f40ba,null))[_0xf87d('0x4b')](handleError(_0x2f40ba,null));};exports['addConfiguration']=function(_0x254b5b,_0x31ec4f,_0x5c365b){if(_0x254b5b[_0xf87d('0x4d')]['id']){delete _0x254b5b['body']['id'];}return db[_0xf87d('0x45')][_0xf87d('0x52')]({'where':{'id':_0x254b5b['params']['id']}})['then'](handleEntityNotFound(_0x31ec4f,null))[_0xf87d('0x2a')](function(_0x2b370a){if(_0x2b370a){_0x254b5b[_0xf87d('0x4d')][_0xf87d('0x53')]=_0x2b370a['id'];_0x254b5b[_0xf87d('0x4d')][_0xf87d('0x54')]=integrations['getSubjects'](_0x254b5b[_0xf87d('0x4d')]['channel'],_0x254b5b[_0xf87d('0x4d')]['type']);_0x254b5b[_0xf87d('0x4d')][_0xf87d('0x55')]=integrations[_0xf87d('0x56')](_0x254b5b[_0xf87d('0x4d')]['channel'],_0x254b5b[_0xf87d('0x4d')]['type']);return db['Dynamics365Configuration'][_0xf87d('0x4c')](_0x254b5b[_0xf87d('0x4d')],{'include':[{'model':db[_0xf87d('0x57')],'as':_0xf87d('0x54')},{'model':db['Dynamics365Field'],'as':_0xf87d('0x55')}]});}return null;})[_0xf87d('0x2a')](respondWithResult(_0x31ec4f,null))['catch'](handleError(_0x31ec4f,null));};exports['getFields']=function(_0xe40135,_0xc685f8,_0x385f22){var _0xa8fa5d=_0xe40135[_0xf87d('0x36')][_0xf87d('0x58')];var _0x22996f=_0xa8fa5d===_0xf87d('0x59')?'Incident':_0xf87d('0x5a');var _0x207cc9='';var _0x191a5e='';var _0x163db0='';var _0x40980e='';var _0x393f3a='';var _0x2117bb='';var _0x5f542f='';var _0x5b3c14='';var _0x5f3c96=['title',_0xf87d('0x5b'),_0xf87d('0x5c'),_0xf87d('0x5d'),_0xf87d('0x5e'),_0xf87d('0x5f'),_0xf87d('0x60'),_0xf87d('0x61'),'directioncode',_0xf87d('0x62')];var _0x522f72=[_0xf87d('0x63'),_0xf87d('0x64'),'actualserviceunits',_0xf87d('0x65'),'contactidname',_0xf87d('0x66'),_0xf87d('0x67'),'contractidname',_0xf87d('0x68'),_0xf87d('0x69'),_0xf87d('0x6a'),'createdbyyominame',_0xf87d('0x6b'),_0xf87d('0x6c'),'createdonbehalfbyyominame','customeridname',_0xf87d('0x6d'),_0xf87d('0x6e'),'emailaddress',_0xf87d('0x6f'),_0xf87d('0x70'),'entityimage_url','escalatedon','exchangerate',_0xf87d('0x71'),_0xf87d('0x72'),'importsequencenumber','influencescore',_0xf87d('0x73'),_0xf87d('0x74'),_0xf87d('0x75'),'modifiedbyexternalpartyname',_0xf87d('0x76'),_0xf87d('0x77'),'modifiedbyyominame',_0xf87d('0x78'),_0xf87d('0x79'),'modifiedonbehalfbyyominame',_0xf87d('0x7a'),_0xf87d('0x7b'),_0xf87d('0x7c'),_0xf87d('0x7d'),_0xf87d('0x7e'),_0xf87d('0x7f'),_0xf87d('0x80'),_0xf87d('0x81'),_0xf87d('0x82'),_0xf87d('0x83'),_0xf87d('0x84'),_0xf87d('0x85'),_0xf87d('0x86'),'productserialnumber',_0xf87d('0x87'),_0xf87d('0x88'),'responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname',_0xf87d('0x89'),_0xf87d('0x8a'),'statecode',_0xf87d('0x8b'),'subjectidname',_0xf87d('0x8c'),_0xf87d('0x8d'),_0xf87d('0x8e'),_0xf87d('0x8f'),_0xf87d('0x90'),_0xf87d('0x91')];var _0x4535fd=_0x5f3c96['concat'](_0x522f72);return db[_0xf87d('0x45')][_0xf87d('0x52')]({'where':{'id':_0xe40135[_0xf87d('0x49')]['id']},'attributes':['id',_0xf87d('0x92'),_0xf87d('0x93'),_0xf87d('0x94'),_0xf87d('0x95'),_0xf87d('0x96'),_0xf87d('0x97')]})['then'](handleEntityNotFound(_0xc685f8,null))[_0xf87d('0x2a')](function(_0x176432){if(_0x176432){_0x5b3c14=_0x176432[_0xf87d('0x94')];var _0x201b0f=_0x5b3c14[_0xf87d('0x98')](-0x1);if(_0x201b0f==='/'){_0x5b3c14=_0x5b3c14['substring'](0x0,_0x5b3c14[_0xf87d('0x99')](_0x201b0f));}_0x5f542f=util[_0xf87d('0x9a')](_0xf87d('0x9b'),_0x5b3c14);var _0x5b4771={'method':_0xf87d('0x9c'),'uri':_0xf87d('0x9d')+_0x176432[_0xf87d('0x95')]+_0xf87d('0x9e'),'form':{'client_id':_0x176432['clientId'],'resource':_0x5b3c14,'username':_0x176432[_0xf87d('0x92')],'password':_0x176432[_0xf87d('0x93')],'grant_type':_0xf87d('0x93'),'client_secret':_0x176432[_0xf87d('0x97')]},'json':!![]};return rp(_0x5b4771);}})[_0xf87d('0x2a')](function(_0x377ee0){_0x2117bb=_0x377ee0[_0xf87d('0x9f')];var _0x28ab68={'method':_0xf87d('0xa0'),'uri':encodeURI(_0x5f542f+_0xf87d('0xa1')+_0x22996f+'\x27'),'headers':{'Authorization':_0xf87d('0xa2')+_0x2117bb,'If-None-Match':null,'OData-Version':_0xf87d('0xa3')},'json':!![]};return rp(_0x28ab68);})[_0xf87d('0x2a')](function(_0x5f4c03){var _0x15669e=_0x5f4c03[_0xf87d('0xa4')][0x0];var _0x4a109f=_0x15669e['MetadataId'];var _0x21f279={'method':'GET','uri':_0x5f542f+_0xf87d('0xa5')+_0x4a109f+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf87d('0xa2')+_0x2117bb,'If-None-Match':null,'OData-Version':_0xf87d('0xa3')},'json':!![]};return rp(_0x21f279);})['then'](function(_0x5cfdb0){_0x207cc9=_0x5cfdb0;_0x191a5e=_0x207cc9[_0xf87d('0xa6')];_0x191a5e=_[_0xf87d('0xa7')](_0x191a5e,function(_0x522727){return!_0x4535fd[_0xf87d('0xa8')](_0x522727[_0xf87d('0xa9')]);});var _0x37ce17=[];var _0xcc746b=[];_0x191a5e['forEach'](function(_0xf2f767){if(_0xf2f767[_0xf87d('0xaa')]){var _0x3f9f16=_0xf2f767[_0xf87d('0xaa')]['substring'](_0xf2f767['@odata.type'][_0xf87d('0x99')]('.')+0x1);if(_0x3f9f16==='PicklistAttributeMetadata'){_0x37ce17[_0xf87d('0xab')](getSelectList(_0x5f542f,_0xa8fa5d,_0xcc746b,_0x207cc9[_0xf87d('0xac')],_0xf2f767[_0xf87d('0xac')],_0x2117bb));}}});return Promise[_0xf87d('0xad')](_0x37ce17);})['then'](function(_0x6fc7cf){_0x163db0=_0x6fc7cf[0x0];var _0x4466b6=[];var _0x38a341=[];_0x191a5e[_0xf87d('0xae')](function(_0x22ffd1){if(!_[_0xf87d('0xaf')](_0x22ffd1[_0xf87d('0xaa')])){var _0x445461=_0x22ffd1[_0xf87d('0xaa')]['substring'](_0x22ffd1[_0xf87d('0xaa')]['lastIndexOf']('.')+0x1);if(_0x445461===_0xf87d('0xb0')){_0x4466b6[_0xf87d('0xab')](getBooleanList(_0x5f542f,_0xa8fa5d,_0x38a341,_0x207cc9['MetadataId'],_0x22ffd1[_0xf87d('0xac')],_0x2117bb));}}});return Promise[_0xf87d('0xad')](_0x4466b6);})[_0xf87d('0x2a')](function(_0x24c687){_0x40980e=_0x24c687[0x0];var _0x5346d7=[];var _0x476f70=[];_0x191a5e[_0xf87d('0xae')](function(_0x21fcba){if(_0x21fcba[_0xf87d('0xaa')]){var _0x35e38f=_0x21fcba[_0xf87d('0xaa')]['substring'](_0x21fcba[_0xf87d('0xaa')][_0xf87d('0x99')]('.')+0x1);if(_0x35e38f===_0xf87d('0xb1')||_0x35e38f===_0xf87d('0xb2')||_0x35e38f==='BigIntAttributeMetadata'||_0x35e38f==='IntegerAttributeMetadata'||_0x35e38f===_0xf87d('0xb3')||_0x35e38f===_0xf87d('0xb4')||_0x35e38f===_0xf87d('0xb5')||_0x35e38f===_0xf87d('0xb6')||_0x35e38f===_0xf87d('0xb7')||_0x35e38f===_0xf87d('0xb8')){_0x5346d7[_0xf87d('0xab')](getInputList(_0x5f542f,_0xa8fa5d,_0x35e38f,_0x476f70,_0x207cc9['MetadataId'],_0x21fcba[_0xf87d('0xac')],_0x2117bb));}}});return Promise['all'](_0x5346d7);})[_0xf87d('0x2a')](function(_0x2ae01d){_0x393f3a=_0x2ae01d[0x0];var _0x40436f=_0x163db0[_0xf87d('0xb9')](_0x40980e)['concat'](_0x393f3a);var _0x41777a={'count':_0x40436f[_0xf87d('0x3c')],'rows':_0x40436f};return _0x41777a;})[_0xf87d('0x2a')](respondWithResult(_0xc685f8,null))[_0xf87d('0x4b')](function(_0x5233df){var _0x1c47c5=_0xe40135['query'][_0xf87d('0xba')]?0x1f4:_0x5233df[_0xf87d('0xbb')]||0x1f4;logger['error'](_0x5233df['stack']);delete _0x5233df[_0xf87d('0x2f')];if(_0x1c47c5===0x191){_0x1c47c5=0x190;}_0xc685f8[_0xf87d('0x1f')](_0x1c47c5)[_0xf87d('0x30')](_0xe40135[_0xf87d('0x36')][_0xf87d('0xba')]?{'message':_0xf87d('0xbc'),'statusCode':_0x5233df[_0xf87d('0xbb')]}:_0x5233df);});};function getSelectList(_0x4277bb,_0x215a14,_0xe8cae8,_0x1e785d,_0xd045fc,_0x1a9bf1){var _0xac023f={'method':_0xf87d('0xa0'),'uri':_0x4277bb+_0xf87d('0xa5')+_0x1e785d+')/Attributes('+_0xd045fc+_0xf87d('0xbd')+_0xf87d('0xbe'),'headers':{'Authorization':_0xf87d('0xa2')+_0x1a9bf1,'If-None-Match':null,'OData-Version':_0xf87d('0xa3')},'json':!![]};return rp(_0xac023f)['then'](function(_0x19b65e){var _0x10fd80=[];var _0x5db70a=_0x19b65e[_0xf87d('0xbf')][_0xf87d('0xc0')];_0x5db70a[_0xf87d('0xae')](function(_0x42b0c6){_0x10fd80[_0xf87d('0xab')]({'name':_0x42b0c6[_0xf87d('0xc1')][_0xf87d('0xc2')][_0xf87d('0xc1')],'value':String(_0x42b0c6[_0xf87d('0xc3')])});});var _0x190f97={'id':_0x215a14+'_'+_0x19b65e['LogicalName'],'name':_0x19b65e[_0xf87d('0xc4')]['UserLocalizedLabel'][_0xf87d('0xc1')],'custom':![],'options':_0x10fd80};_0xe8cae8[_0xf87d('0xab')](_0x190f97);return _0xe8cae8;});}function getBooleanList(_0x10ee0e,_0x1cee1d,_0x462a65,_0x10877b,_0x450de9,_0x37aeed){var _0x515884={'method':_0xf87d('0xa0'),'uri':_0x10ee0e+_0xf87d('0xa5')+_0x10877b+_0xf87d('0xc5')+_0x450de9+_0xf87d('0xc6'),'headers':{'Authorization':_0xf87d('0xa2')+_0x37aeed,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x515884)['then'](function(_0x2198d7){var _0x293578=[];_0x293578[_0xf87d('0xab')]({'name':_0x2198d7[_0xf87d('0xbf')]['TrueOption']['Label']['UserLocalizedLabel'][_0xf87d('0xc1')],'value':_0xf87d('0xc7')},{'name':_0x2198d7[_0xf87d('0xbf')][_0xf87d('0xc8')][_0xf87d('0xc1')][_0xf87d('0xc2')][_0xf87d('0xc1')],'value':_0xf87d('0xc9')});var _0x1bff16={'id':_0x1cee1d+'_'+_0x2198d7[_0xf87d('0xa9')],'name':_0x2198d7[_0xf87d('0xc4')][_0xf87d('0xc2')][_0xf87d('0xc1')],'custom':![],'options':_0x293578};_0x462a65[_0xf87d('0xab')](_0x1bff16);return _0x462a65;});}function getInputList(_0x2919a3,_0x19ccad,_0x59d54f,_0x178cb3,_0x1493e1,_0xdad78b,_0x46c359){var _0x51fa48={'method':_0xf87d('0xa0'),'uri':_0x2919a3+_0xf87d('0xa5')+_0x1493e1+')/Attributes('+_0xdad78b+_0xf87d('0xca')+_0x59d54f+_0xf87d('0xcb'),'headers':{'Authorization':_0xf87d('0xa2')+_0x46c359,'If-None-Match':null,'OData-Version':_0xf87d('0xa3')},'json':!![]};return rp(_0x51fa48)[_0xf87d('0x2a')](function(_0x35a1ab){var _0x249186={'id':_0x19ccad+'_'+_0x35a1ab[_0xf87d('0xa9')],'name':_0x35a1ab['DisplayName'][_0xf87d('0xc2')]?_0x35a1ab[_0xf87d('0xc4')][_0xf87d('0xc2')][_0xf87d('0xc1')]:_0x35a1ab[_0xf87d('0xa9')],'custom':![],'options':[]};_0x178cb3[_0xf87d('0xab')](_0x249186);return _0x178cb3;});} \ No newline at end of file +var _0x9649=['false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','destroy','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','error','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true'];(function(_0x4f9bda,_0x471af5){var _0x3ab198=function(_0x27d600){while(--_0x27d600){_0x4f9bda['push'](_0x4f9bda['shift']());}};_0x3ab198(++_0x471af5);}(_0x9649,0x19f));var _0x9964=function(_0x2ef511,_0x318677){_0x2ef511=_0x2ef511-0x0;var _0x13d18c=_0x9649[_0x2ef511];return _0x13d18c;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require('request-promise');var moment=require(_0x9964('0x4'));var BPromise=require(_0x9964('0x5'));var Mustache=require('mustache');var util=require(_0x9964('0x6'));var path=require('path');var sox=require(_0x9964('0x7'));var csv=require(_0x9964('0x8'));var ejs=require(_0x9964('0x9'));var fs=require('fs');var fs_extra=require(_0x9964('0xa'));var _=require(_0x9964('0xb'));var squel=require(_0x9964('0xc'));var crypto=require(_0x9964('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9964('0xe'));var toCsv=require(_0x9964('0x8'));var querystring=require('querystring');var Papa=require(_0x9964('0xf'));var Redis=require(_0x9964('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require(_0x9964('0x12'));var logger=require(_0x9964('0x13'))(_0x9964('0x14'));var utils=require(_0x9964('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9964('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9964('0x17'));function respondWithStatusCode(_0x39c624,_0x547b98){_0x547b98=_0x547b98||0xcc;return function(_0x15414d){if(_0x15414d){return _0x39c624[_0x9964('0x18')](_0x547b98);}return _0x39c624['status'](_0x547b98)[_0x9964('0x19')]();};}function respondWithResult(_0x463dbf,_0x11dfc9){_0x11dfc9=_0x11dfc9||0xc8;return function(_0x46688a){if(_0x46688a){return _0x463dbf[_0x9964('0x1a')](_0x11dfc9)['json'](_0x46688a);}};}function respondWithFilteredResult(_0x411544,_0x226e78){return function(_0x57b330){if(_0x57b330){var _0x2fd50d=typeof _0x226e78[_0x9964('0x1b')]==='undefined'&&typeof _0x226e78[_0x9964('0x1c')]===_0x9964('0x1d');var _0x69994d=_0x57b330[_0x9964('0x1e')];var _0x4f2f68=_0x2fd50d?0x0:_0x226e78[_0x9964('0x1b')];var _0x931a0f=_0x2fd50d?_0x57b330['count']:_0x226e78[_0x9964('0x1b')]+_0x226e78[_0x9964('0x1c')];var _0x25ab32;if(_0x931a0f>=_0x69994d){_0x931a0f=_0x69994d;_0x25ab32=0xc8;}else{_0x25ab32=0xce;}_0x411544[_0x9964('0x1a')](_0x25ab32);return _0x411544[_0x9964('0x1f')](_0x9964('0x20'),_0x4f2f68+'-'+_0x931a0f+'/'+_0x69994d)[_0x9964('0x21')](_0x57b330);}return null;};}function patchUpdates(_0x414649){return function(_0x1072b5){try{jsonpatch[_0x9964('0x22')](_0x1072b5,_0x414649,!![]);}catch(_0x4f625e){return BPromise[_0x9964('0x23')](_0x4f625e);}return _0x1072b5[_0x9964('0x24')]();};}function saveUpdates(_0x4c479f,_0x2b03a8){return function(_0x47912c){if(_0x47912c){return _0x47912c[_0x9964('0x25')](_0x4c479f)[_0x9964('0x26')](function(_0x1c5e34){return _0x1c5e34;});}return null;};}function removeEntity(_0x167525,_0x2d049c){return function(_0x62eda6){if(_0x62eda6){return _0x62eda6['destroy']()[_0x9964('0x26')](function(){_0x167525[_0x9964('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b05a8,_0x15a14c){return function(_0x196812){if(!_0x196812){_0x1b05a8[_0x9964('0x18')](0x194);}return _0x196812;};}function handleError(_0x26cd95,_0x5a5793){_0x5a5793=_0x5a5793||0x1f4;return function(_0x13df3d){logger['error'](_0x13df3d[_0x9964('0x27')]);if(_0x13df3d['name']){delete _0x13df3d[_0x9964('0x28')];}_0x26cd95['status'](_0x5a5793)[_0x9964('0x29')](_0x13df3d);};}exports[_0x9964('0x2a')]=function(_0x46c104,_0x44a38f){var _0x11cdce={},_0x23df5e={},_0x146cf2={'count':0x0,'rows':[]};var _0x2f6068=_[_0x9964('0x2b')](db['Dynamics365Account']['rawAttributes'],function(_0x5444a8){return{'name':_0x5444a8['fieldName'],'type':_0x5444a8[_0x9964('0x2c')][_0x9964('0x2d')]};});_0x23df5e[_0x9964('0x2e')]=_[_0x9964('0x2b')](_0x2f6068,_0x9964('0x28'));_0x23df5e[_0x9964('0x2f')]=_[_0x9964('0x30')](_0x46c104[_0x9964('0x2f')]);_0x23df5e[_0x9964('0x31')]=_['intersection'](_0x23df5e[_0x9964('0x2e')],_0x23df5e[_0x9964('0x2f')]);_0x11cdce['attributes']=_[_0x9964('0x32')](_0x23df5e[_0x9964('0x2e')],qs[_0x9964('0x33')](_0x46c104[_0x9964('0x2f')]['fields']));_0x11cdce['attributes']=_0x11cdce[_0x9964('0x34')]['length']?_0x11cdce['attributes']:_0x23df5e[_0x9964('0x2e')];if(!_0x46c104[_0x9964('0x2f')]['hasOwnProperty']('nolimit')){_0x11cdce[_0x9964('0x1c')]=qs[_0x9964('0x1c')](_0x46c104['query'][_0x9964('0x1c')]);_0x11cdce['offset']=qs['offset'](_0x46c104['query'][_0x9964('0x1b')]);}_0x11cdce[_0x9964('0x35')]=qs[_0x9964('0x36')](_0x46c104[_0x9964('0x2f')][_0x9964('0x36')]);_0x11cdce[_0x9964('0x37')]=qs[_0x9964('0x31')](_[_0x9964('0x38')](_0x46c104[_0x9964('0x2f')],_0x23df5e['filters']),_0x2f6068);if(_0x46c104[_0x9964('0x2f')][_0x9964('0x39')]){_0x11cdce[_0x9964('0x37')]=_[_0x9964('0x3a')](_0x11cdce['where'],{'$or':_['map'](_0x2f6068,function(_0x35f669){if(_0x35f669[_0x9964('0x2c')]!==_0x9964('0x3b')){var _0x1bad9d={};_0x1bad9d[_0x35f669[_0x9964('0x28')]]={'$like':'%'+_0x46c104['query'][_0x9964('0x39')]+'%'};return _0x1bad9d;}})});}_0x11cdce=_[_0x9964('0x3a')]({},_0x11cdce,_0x46c104[_0x9964('0x3c')]);var _0x3bde2b={'where':_0x11cdce[_0x9964('0x37')]};return db[_0x9964('0x3d')][_0x9964('0x1e')](_0x3bde2b)[_0x9964('0x26')](function(_0xa0432a){_0x146cf2[_0x9964('0x1e')]=_0xa0432a;if(_0x46c104[_0x9964('0x2f')][_0x9964('0x3e')]){_0x11cdce[_0x9964('0x3f')]=[{'all':!![]}];}return db[_0x9964('0x3d')][_0x9964('0x40')](_0x11cdce);})[_0x9964('0x26')](function(_0x57e107){_0x146cf2[_0x9964('0x41')]=_0x57e107;return _0x146cf2;})['then'](respondWithFilteredResult(_0x44a38f,_0x11cdce))[_0x9964('0x42')](handleError(_0x44a38f,null));};exports[_0x9964('0x43')]=function(_0x36ee92,_0x4c3d38){var _0xf4a80e={'raw':![],'where':{'id':_0x36ee92[_0x9964('0x44')]['id']}},_0x5f5312={};_0x5f5312['model']=_[_0x9964('0x30')](db[_0x9964('0x3d')][_0x9964('0x45')]);_0x5f5312[_0x9964('0x2f')]=_[_0x9964('0x30')](_0x36ee92[_0x9964('0x2f')]);_0x5f5312[_0x9964('0x31')]=_[_0x9964('0x32')](_0x5f5312['model'],_0x5f5312[_0x9964('0x2f')]);_0xf4a80e[_0x9964('0x34')]=_[_0x9964('0x32')](_0x5f5312[_0x9964('0x2e')],qs[_0x9964('0x33')](_0x36ee92[_0x9964('0x2f')][_0x9964('0x33')]));_0xf4a80e[_0x9964('0x34')]=_0xf4a80e[_0x9964('0x34')][_0x9964('0x46')]?_0xf4a80e['attributes']:_0x5f5312['model'];if(_0x36ee92[_0x9964('0x2f')]['includeAll']){_0xf4a80e[_0x9964('0x3f')]=[{'all':!![]}];}_0xf4a80e=_['merge']({},_0xf4a80e,_0x36ee92['options']);return db['Dynamics365Account'][_0x9964('0x47')](_0xf4a80e)[_0x9964('0x26')](handleEntityNotFound(_0x4c3d38,null))[_0x9964('0x26')](respondWithResult(_0x4c3d38,null))['catch'](handleError(_0x4c3d38,null));};exports['create']=function(_0x652882,_0x4aefaa){return db[_0x9964('0x3d')][_0x9964('0x48')](_0x652882[_0x9964('0x49')],{})[_0x9964('0x26')](respondWithResult(_0x4aefaa,0xc9))[_0x9964('0x42')](handleError(_0x4aefaa,null));};exports[_0x9964('0x25')]=function(_0x521d03,_0x2026da){if(_0x521d03[_0x9964('0x49')]['id']){delete _0x521d03[_0x9964('0x49')]['id'];}return db[_0x9964('0x3d')][_0x9964('0x47')]({'where':{'id':_0x521d03['params']['id']}})[_0x9964('0x26')](handleEntityNotFound(_0x2026da,null))[_0x9964('0x26')](saveUpdates(_0x521d03[_0x9964('0x49')],null))['then'](respondWithResult(_0x2026da,null))[_0x9964('0x42')](handleError(_0x2026da,null));};exports[_0x9964('0x4a')]=function(_0x474631,_0x2e8dec){return db[_0x9964('0x3d')][_0x9964('0x47')]({'where':{'id':_0x474631[_0x9964('0x44')]['id']}})[_0x9964('0x26')](handleEntityNotFound(_0x2e8dec,null))['then'](removeEntity(_0x2e8dec,null))[_0x9964('0x42')](handleError(_0x2e8dec,null));};exports['getConfigurations']=function(_0x511d95,_0x160316,_0x51cf46){var _0x2ea5b7={};var _0x45ca09={};var _0x6df7de;var _0x4b9325;return db[_0x9964('0x3d')][_0x9964('0x4b')]({'where':{'id':_0x511d95[_0x9964('0x44')]['id']}})[_0x9964('0x26')](handleEntityNotFound(_0x160316,null))[_0x9964('0x26')](function(_0x454d97){if(_0x454d97){_0x6df7de=_0x454d97;_0x45ca09[_0x9964('0x2e')]=_[_0x9964('0x30')](db[_0x9964('0x4c')]['rawAttributes']);_0x45ca09[_0x9964('0x2f')]=_['keys'](_0x511d95[_0x9964('0x2f')]);_0x45ca09[_0x9964('0x31')]=_[_0x9964('0x32')](_0x45ca09['model'],_0x45ca09[_0x9964('0x2f')]);_0x2ea5b7[_0x9964('0x34')]=_[_0x9964('0x32')](_0x45ca09[_0x9964('0x2e')],qs[_0x9964('0x33')](_0x511d95['query'][_0x9964('0x33')]));_0x2ea5b7[_0x9964('0x34')]=_0x2ea5b7[_0x9964('0x34')][_0x9964('0x46')]?_0x2ea5b7[_0x9964('0x34')]:_0x45ca09['model'];_0x2ea5b7['order']=qs['sort'](_0x511d95['query'][_0x9964('0x36')]);_0x2ea5b7['where']=qs['filters'](_['pick'](_0x511d95[_0x9964('0x2f')],_0x45ca09['filters']));if(_0x511d95[_0x9964('0x2f')][_0x9964('0x39')]){_0x2ea5b7[_0x9964('0x37')]=_['merge'](_0x2ea5b7[_0x9964('0x37')],{'$or':_['map'](_0x2ea5b7['attributes'],function(_0x3e4944){var _0x192a2c={};_0x192a2c[_0x3e4944]={'$like':'%'+_0x511d95[_0x9964('0x2f')]['filter']+'%'};return _0x192a2c;})});}_0x2ea5b7=_[_0x9964('0x3a')]({},_0x2ea5b7,_0x511d95[_0x9964('0x3c')]);return _0x6df7de[_0x9964('0x4d')](_0x2ea5b7);}})['then'](function(_0xba03fe){if(_0xba03fe){_0x4b9325=_0xba03fe[_0x9964('0x46')];if(!_0x511d95[_0x9964('0x2f')]['hasOwnProperty']('nolimit')){_0x2ea5b7[_0x9964('0x1c')]=qs[_0x9964('0x1c')](_0x511d95[_0x9964('0x2f')][_0x9964('0x1c')]);_0x2ea5b7[_0x9964('0x1b')]=qs[_0x9964('0x1b')](_0x511d95[_0x9964('0x2f')][_0x9964('0x1b')]);}return _0x6df7de[_0x9964('0x4d')](_0x2ea5b7);}})[_0x9964('0x26')](function(_0x11cd4c){if(_0x11cd4c){return _0x11cd4c?{'count':_0x4b9325,'rows':_0x11cd4c}:null;}})[_0x9964('0x26')](respondWithResult(_0x160316,null))[_0x9964('0x42')](handleError(_0x160316,null));};exports[_0x9964('0x4e')]=function(_0x3c706e,_0x59ab4c,_0x3274cd){if(_0x3c706e[_0x9964('0x49')]['id']){delete _0x3c706e[_0x9964('0x49')]['id'];}return db[_0x9964('0x3d')]['findOne']({'where':{'id':_0x3c706e['params']['id']}})['then'](handleEntityNotFound(_0x59ab4c,null))['then'](function(_0x4e374e){if(_0x4e374e){_0x3c706e[_0x9964('0x49')][_0x9964('0x4f')]=_0x4e374e['id'];_0x3c706e['body'][_0x9964('0x50')]=integrations[_0x9964('0x51')](_0x3c706e[_0x9964('0x49')][_0x9964('0x52')],_0x3c706e[_0x9964('0x49')]['type']);_0x3c706e[_0x9964('0x49')][_0x9964('0x53')]=integrations['getDescriptions'](_0x3c706e[_0x9964('0x49')]['channel'],_0x3c706e[_0x9964('0x49')]['type']);return db[_0x9964('0x4c')][_0x9964('0x48')](_0x3c706e['body'],{'include':[{'model':db[_0x9964('0x54')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x9964('0x53')}]});}return null;})['then'](respondWithResult(_0x59ab4c,null))[_0x9964('0x42')](handleError(_0x59ab4c,null));};exports['getFields']=function(_0x39acbe,_0x5666c0,_0x19c6f2){var _0xe4a9a8=_0x39acbe[_0x9964('0x2f')][_0x9964('0x55')];var _0x2d0b16=_0xe4a9a8===_0x9964('0x56')?'Incident':_0x9964('0x57');var _0x2d90c9='';var _0xa59931='';var _0x5800ea='';var _0x439832='';var _0x368dc4='';var _0x35d32b='';var _0x4533b8='';var _0x2b3746='';var _0x20c402=[_0x9964('0x58'),_0x9964('0x59'),_0x9964('0x5a'),_0x9964('0x5b'),_0x9964('0x5c'),'subject',_0x9964('0x5d'),'regardingobjectid',_0x9964('0x5e'),_0x9964('0x5f')];var _0x19fbef=[_0x9964('0x60'),'accountidyominame',_0x9964('0x61'),_0x9964('0x62'),_0x9964('0x63'),_0x9964('0x64'),_0x9964('0x65'),_0x9964('0x66'),_0x9964('0x67'),_0x9964('0x68'),_0x9964('0x69'),_0x9964('0x6a'),'createdon',_0x9964('0x6b'),_0x9964('0x6c'),_0x9964('0x6d'),_0x9964('0x6e'),_0x9964('0x6f'),_0x9964('0x70'),'entitlementidname',_0x9964('0x71'),_0x9964('0x72'),_0x9964('0x73'),_0x9964('0x74'),'firstresponsebykpiidname','followupby','importsequencenumber',_0x9964('0x75'),_0x9964('0x76'),'lastonholdtime',_0x9964('0x77'),_0x9964('0x78'),_0x9964('0x79'),'modifiedbyname',_0x9964('0x7a'),_0x9964('0x7b'),'modifiedonbehalfbyname',_0x9964('0x7c'),_0x9964('0x7d'),'msdyn_iotalertname',_0x9964('0x7e'),_0x9964('0x7f'),_0x9964('0x80'),_0x9964('0x81'),_0x9964('0x82'),'owneridyominame',_0x9964('0x83'),'primarycontactidname',_0x9964('0x84'),_0x9964('0x85'),'productidname',_0x9964('0x86'),_0x9964('0x87'),_0x9964('0x88'),_0x9964('0x89'),'responsiblecontactidname',_0x9964('0x8a'),_0x9964('0x8b'),_0x9964('0x8c'),_0x9964('0x8d'),_0x9964('0x8e'),_0x9964('0x8f'),_0x9964('0x90'),_0x9964('0x91'),_0x9964('0x92'),_0x9964('0x93'),_0x9964('0x94'),_0x9964('0x95'),'utcconversiontimezonecode',_0x9964('0x96')];var _0x56e3bf=_0x20c402[_0x9964('0x97')](_0x19fbef);return db[_0x9964('0x3d')]['findOne']({'where':{'id':_0x39acbe[_0x9964('0x44')]['id']},'attributes':['id',_0x9964('0x98'),_0x9964('0x99'),_0x9964('0x9a'),_0x9964('0x9b'),_0x9964('0x9c'),_0x9964('0x9d')]})[_0x9964('0x26')](handleEntityNotFound(_0x5666c0,null))['then'](function(_0x400bff){if(_0x400bff){_0x2b3746=_0x400bff[_0x9964('0x9a')];var _0x342d35=_0x2b3746['slice'](-0x1);if(_0x342d35==='/'){_0x2b3746=_0x2b3746[_0x9964('0x9e')](0x0,_0x2b3746[_0x9964('0x9f')](_0x342d35));}_0x4533b8=util[_0x9964('0xa0')]('%s/api/data/v9.0/',_0x2b3746);var _0xd8b86c={'method':_0x9964('0xa1'),'uri':_0x9964('0xa2')+_0x400bff[_0x9964('0x9b')]+_0x9964('0xa3'),'form':{'client_id':_0x400bff[_0x9964('0x9c')],'resource':_0x2b3746,'username':_0x400bff[_0x9964('0x98')],'password':_0x400bff[_0x9964('0x99')],'grant_type':_0x9964('0x99'),'client_secret':_0x400bff['clientSecret']},'json':!![]};return rp(_0xd8b86c);}})[_0x9964('0x26')](function(_0xe5a456){_0x35d32b=_0xe5a456[_0x9964('0xa4')];var _0x582b39={'method':_0x9964('0xa5'),'uri':encodeURI(_0x4533b8+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2d0b16+'\x27'),'headers':{'Authorization':_0x9964('0xa6')+_0x35d32b,'If-None-Match':null,'OData-Version':_0x9964('0xa7')},'json':!![]};return rp(_0x582b39);})[_0x9964('0x26')](function(_0x540bac){var _0x392672=_0x540bac[_0x9964('0xa8')][0x0];var _0x459d3b=_0x392672['MetadataId'];var _0x6ecc6d={'method':_0x9964('0xa5'),'uri':_0x4533b8+_0x9964('0xa9')+_0x459d3b+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x9964('0xa6')+_0x35d32b,'If-None-Match':null,'OData-Version':_0x9964('0xa7')},'json':!![]};return rp(_0x6ecc6d);})[_0x9964('0x26')](function(_0x5e5ef7){_0x2d90c9=_0x5e5ef7;_0xa59931=_0x2d90c9[_0x9964('0xaa')];_0xa59931=_[_0x9964('0xab')](_0xa59931,function(_0x31a14c){return!_0x56e3bf['includes'](_0x31a14c[_0x9964('0xac')]);});var _0x2f8d1d=[];var _0x1cd495=[];_0xa59931[_0x9964('0xad')](function(_0x3e7f64){if(_0x3e7f64[_0x9964('0xae')]){var _0x5bdd6d=_0x3e7f64[_0x9964('0xae')][_0x9964('0x9e')](_0x3e7f64[_0x9964('0xae')][_0x9964('0x9f')]('.')+0x1);if(_0x5bdd6d===_0x9964('0xaf')){_0x2f8d1d[_0x9964('0xb0')](getSelectList(_0x4533b8,_0xe4a9a8,_0x1cd495,_0x2d90c9[_0x9964('0xb1')],_0x3e7f64['MetadataId'],_0x35d32b));}}});return Promise[_0x9964('0xb2')](_0x2f8d1d);})[_0x9964('0x26')](function(_0x1570fc){_0x5800ea=_0x1570fc[0x0];var _0x3d820=[];var _0x1d1822=[];_0xa59931[_0x9964('0xad')](function(_0xf24f8a){if(!_[_0x9964('0xb3')](_0xf24f8a[_0x9964('0xae')])){var _0x19d39f=_0xf24f8a['@odata.type']['substring'](_0xf24f8a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x19d39f===_0x9964('0xb4')){_0x3d820[_0x9964('0xb0')](getBooleanList(_0x4533b8,_0xe4a9a8,_0x1d1822,_0x2d90c9[_0x9964('0xb1')],_0xf24f8a[_0x9964('0xb1')],_0x35d32b));}}});return Promise[_0x9964('0xb2')](_0x3d820);})[_0x9964('0x26')](function(_0x9f6bcf){_0x439832=_0x9f6bcf[0x0];var _0x5b5ece=[];var _0x4f7322=[];_0xa59931[_0x9964('0xad')](function(_0x53d1e0){if(_0x53d1e0[_0x9964('0xae')]){var _0x38f4ce=_0x53d1e0[_0x9964('0xae')][_0x9964('0x9e')](_0x53d1e0[_0x9964('0xae')]['lastIndexOf']('.')+0x1);if(_0x38f4ce==='StringAttributeMetadata'||_0x38f4ce==='DoubleAttributeMetadata'||_0x38f4ce==='BigIntAttributeMetadata'||_0x38f4ce==='IntegerAttributeMetadata'||_0x38f4ce===_0x9964('0xb5')||_0x38f4ce===_0x9964('0xb6')||_0x38f4ce===_0x9964('0xb7')||_0x38f4ce===_0x9964('0xb8')||_0x38f4ce===_0x9964('0xb9')||_0x38f4ce===_0x9964('0xba')){_0x5b5ece[_0x9964('0xb0')](getInputList(_0x4533b8,_0xe4a9a8,_0x38f4ce,_0x4f7322,_0x2d90c9[_0x9964('0xb1')],_0x53d1e0['MetadataId'],_0x35d32b));}}});return Promise[_0x9964('0xb2')](_0x5b5ece);})['then'](function(_0x3ecfb6){_0x368dc4=_0x3ecfb6[0x0];var _0x1c8ac0=_0x5800ea[_0x9964('0x97')](_0x439832)['concat'](_0x368dc4);var _0x9ad7a8={'count':_0x1c8ac0['length'],'rows':_0x1c8ac0};return _0x9ad7a8;})[_0x9964('0x26')](respondWithResult(_0x5666c0,null))[_0x9964('0x42')](function(_0x2b8be7){var _0xd7906f=_0x39acbe[_0x9964('0x2f')]['test']?0x1f4:_0x2b8be7[_0x9964('0xbb')]||0x1f4;logger[_0x9964('0xbc')](_0x2b8be7[_0x9964('0x27')]);delete _0x2b8be7[_0x9964('0x28')];if(_0xd7906f===0x191){_0xd7906f=0x190;}_0x5666c0[_0x9964('0x1a')](_0xd7906f)[_0x9964('0x29')](_0x39acbe['query'][_0x9964('0xbd')]?{'message':_0x9964('0xbe'),'statusCode':_0x2b8be7[_0x9964('0xbb')]}:_0x2b8be7);});};function getSelectList(_0x69a250,_0x34234,_0x2dfd1b,_0x527c0d,_0x3e74de,_0x44121c){var _0x1423f2={'method':_0x9964('0xa5'),'uri':_0x69a250+_0x9964('0xa9')+_0x527c0d+')/Attributes('+_0x3e74de+_0x9964('0xbf')+_0x9964('0xc0'),'headers':{'Authorization':_0x9964('0xa6')+_0x44121c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1423f2)[_0x9964('0x26')](function(_0x2683fa){var _0x2b3054=[];var _0x30743e=_0x2683fa['OptionSet'][_0x9964('0xc1')];_0x30743e[_0x9964('0xad')](function(_0x47503d){_0x2b3054['push']({'name':_0x47503d['Label']['UserLocalizedLabel'][_0x9964('0xc2')],'value':String(_0x47503d[_0x9964('0xc3')])});});var _0x33a708={'id':_0x34234+'_'+_0x2683fa[_0x9964('0xac')],'name':_0x2683fa[_0x9964('0xc4')][_0x9964('0xc5')][_0x9964('0xc2')],'custom':![],'options':_0x2b3054};_0x2dfd1b[_0x9964('0xb0')](_0x33a708);return _0x2dfd1b;});}function getBooleanList(_0x20081b,_0x4b8bbb,_0x47cc60,_0x1cee08,_0x2515df,_0x7f15b8){var _0x53f345={'method':_0x9964('0xa5'),'uri':_0x20081b+_0x9964('0xa9')+_0x1cee08+_0x9964('0xc6')+_0x2515df+_0x9964('0xc7'),'headers':{'Authorization':'Bearer\x20'+_0x7f15b8,'If-None-Match':null,'OData-Version':_0x9964('0xa7')},'json':!![]};return rp(_0x53f345)[_0x9964('0x26')](function(_0x2ddaf6){var _0x2bff92=[];_0x2bff92['push']({'name':_0x2ddaf6[_0x9964('0xc8')][_0x9964('0xc9')][_0x9964('0xc2')][_0x9964('0xc5')][_0x9964('0xc2')],'value':_0x9964('0xca')},{'name':_0x2ddaf6[_0x9964('0xc8')]['FalseOption'][_0x9964('0xc2')][_0x9964('0xc5')]['Label'],'value':_0x9964('0xcb')});var _0x185b75={'id':_0x4b8bbb+'_'+_0x2ddaf6[_0x9964('0xac')],'name':_0x2ddaf6[_0x9964('0xc4')][_0x9964('0xc5')][_0x9964('0xc2')],'custom':![],'options':_0x2bff92};_0x47cc60['push'](_0x185b75);return _0x47cc60;});}function getInputList(_0x1c7ea8,_0x1f4080,_0x3fdbbe,_0x1b5e14,_0x4a42ab,_0x3d40fd,_0x383702){var _0x2e9203={'method':'GET','uri':_0x1c7ea8+'EntityDefinitions('+_0x4a42ab+_0x9964('0xc6')+_0x3d40fd+_0x9964('0xcc')+_0x3fdbbe+_0x9964('0xcd'),'headers':{'Authorization':'Bearer\x20'+_0x383702,'If-None-Match':null,'OData-Version':_0x9964('0xa7')},'json':!![]};return rp(_0x2e9203)[_0x9964('0x26')](function(_0x44acb3){var _0x106ce5={'id':_0x1f4080+'_'+_0x44acb3[_0x9964('0xac')],'name':_0x44acb3[_0x9964('0xc4')][_0x9964('0xc5')]?_0x44acb3[_0x9964('0xc4')][_0x9964('0xc5')][_0x9964('0xc2')]:_0x44acb3['LogicalName'],'custom':![],'options':[]};_0x1b5e14[_0x9964('0xb0')](_0x106ce5);return _0x1b5e14;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b85509c..cad8a09 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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(_0x147369,_0x356d0b){var _0x2c8322=function(_0x158ef8){while(--_0x158ef8){_0x147369['push'](_0x147369['shift']());}};_0x2c8322(++_0x356d0b);}(_0xe706,0xa3));var _0x6e70=function(_0x29d1ba,_0x7a5223){_0x29d1ba=_0x29d1ba-0x0;var _0x3de575=_0xe706[_0x29d1ba];return _0x3de575;};'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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index bed299f..ae90f21 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 _0x9073=['stringify','catch','ShowDynamics365Account','Dynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetDynamics365Account','options','where','attributes','limit','map','model','include'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x9073,0x1cd));var _0x3907=function(_0x14a83c,_0x394b54){_0x14a83c=_0x14a83c-0x0;var _0x345d56=_0x9073[_0x14a83c];return _0x345d56;};'use strict';var _=require(_0x3907('0x0'));var util=require(_0x3907('0x1'));var moment=require(_0x3907('0x2'));var BPromise=require(_0x3907('0x3'));var rs=require(_0x3907('0x4'));var fs=require('fs');var Redis=require(_0x3907('0x5'));var db=require(_0x3907('0x6'))['db'];var utils=require(_0x3907('0x7'));var logger=require(_0x3907('0x8'))(_0x3907('0x9'));var config=require(_0x3907('0xa'));var jayson=require(_0x3907('0xb'));var client=jayson[_0x3907('0xc')][_0x3907('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x48d8f7,_0x115ab5,_0x359d8f){return new BPromise(function(_0x1f6f14,_0x161ea5){return client[_0x3907('0xe')](_0x48d8f7,_0x359d8f)[_0x3907('0xf')](function(_0x398843){logger[_0x3907('0x10')](_0x3907('0x11'),_0x115ab5,'request\x20sent');logger[_0x3907('0x12')](_0x3907('0x13'),_0x115ab5,_0x3907('0x14'),JSON['stringify'](_0x398843));if(_0x398843[_0x3907('0x15')]){if(_0x398843['error'][_0x3907('0x16')]===0x1f4){logger[_0x3907('0x15')]('Dynamics365Account,\x20%s,\x20%s',_0x115ab5,_0x398843['error'][_0x3907('0x17')]);return _0x161ea5(_0x398843[_0x3907('0x15')]['message']);}logger[_0x3907('0x15')](_0x3907('0x11'),_0x115ab5,_0x398843['error'][_0x3907('0x17')]);return _0x1f6f14(_0x398843[_0x3907('0x15')][_0x3907('0x17')]);}else{logger[_0x3907('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x115ab5,'request\x20sent');_0x1f6f14(_0x398843[_0x3907('0x18')][_0x3907('0x17')]);}})['catch'](function(_0xcaac0d){logger[_0x3907('0x15')](_0x3907('0x11'),_0x115ab5,_0xcaac0d);_0x161ea5(_0xcaac0d);});});}exports[_0x3907('0x19')]=function(_0x25ca8a){var _0x168f7f=this;return new Promise(function(_0x291ef2,_0x4607f7){return db['Dynamics365Account']['findAll']({'raw':_0x25ca8a[_0x3907('0x1a')]?_0x25ca8a['options']['raw']===undefined?!![]:![]:!![],'where':_0x25ca8a[_0x3907('0x1a')]?_0x25ca8a[_0x3907('0x1a')][_0x3907('0x1b')]||null:null,'attributes':_0x25ca8a['options']?_0x25ca8a['options'][_0x3907('0x1c')]||null:null,'limit':_0x25ca8a[_0x3907('0x1a')]?_0x25ca8a[_0x3907('0x1a')][_0x3907('0x1d')]||null:null,'include':_0x25ca8a['options']?_0x25ca8a[_0x3907('0x1a')]['include']?_[_0x3907('0x1e')](_0x25ca8a[_0x3907('0x1a')]['include'],function(_0x3fea01){return{'model':db[_0x3fea01[_0x3907('0x1f')]],'as':_0x3fea01['as'],'attributes':_0x3fea01[_0x3907('0x1c')],'include':_0x3fea01[_0x3907('0x20')]?_['map'](_0x3fea01[_0x3907('0x20')],function(_0x23b234){return{'model':db[_0x23b234[_0x3907('0x1f')]],'as':_0x23b234['as'],'attributes':_0x23b234[_0x3907('0x1c')],'include':_0x23b234[_0x3907('0x20')]?_[_0x3907('0x1e')](_0x23b234[_0x3907('0x20')],function(_0x301919){return{'model':db[_0x301919[_0x3907('0x1f')]],'as':_0x301919['as'],'attributes':_0x301919[_0x3907('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3907('0xf')](function(_0x1cd080){logger['info'](_0x3907('0x19'),_0x25ca8a);logger[_0x3907('0x12')](_0x3907('0x19'),_0x25ca8a,JSON[_0x3907('0x21')](_0x1cd080));_0x291ef2(_0x1cd080);})[_0x3907('0x22')](function(_0x17848a){logger[_0x3907('0x15')]('GetDynamics365Account',_0x17848a[_0x3907('0x17')],_0x25ca8a);_0x4607f7(_0x168f7f[_0x3907('0x15')](0x1f4,_0x17848a['message']));});});};exports[_0x3907('0x23')]=function(_0x5ec76b){var _0x144c0e=this;return new Promise(function(_0x3e1081,_0x232a40){return db[_0x3907('0x24')][_0x3907('0x25')]({'raw':_0x5ec76b[_0x3907('0x1a')]?_0x5ec76b[_0x3907('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5ec76b[_0x3907('0x1a')]?_0x5ec76b[_0x3907('0x1a')][_0x3907('0x1b')]||null:null,'attributes':_0x5ec76b[_0x3907('0x1a')]?_0x5ec76b[_0x3907('0x1a')][_0x3907('0x1c')]||null:null,'include':_0x5ec76b['options']?_0x5ec76b[_0x3907('0x1a')][_0x3907('0x20')]?_[_0x3907('0x1e')](_0x5ec76b[_0x3907('0x1a')][_0x3907('0x20')],function(_0x1b1940){return{'model':db[_0x1b1940[_0x3907('0x1f')]],'as':_0x1b1940['as'],'attributes':_0x1b1940[_0x3907('0x1c')],'include':_0x1b1940['include']?_['map'](_0x1b1940[_0x3907('0x20')],function(_0x5f590f){return{'model':db[_0x5f590f[_0x3907('0x1f')]],'as':_0x5f590f['as'],'attributes':_0x5f590f[_0x3907('0x1c')],'include':_0x5f590f[_0x3907('0x20')]?_['map'](_0x5f590f[_0x3907('0x20')],function(_0x153bfe){return{'model':db[_0x153bfe[_0x3907('0x1f')]],'as':_0x153bfe['as'],'attributes':_0x153bfe[_0x3907('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3907('0xf')](function(_0x3b06d8){logger[_0x3907('0x10')](_0x3907('0x23'),_0x5ec76b);logger[_0x3907('0x12')](_0x3907('0x23'),_0x5ec76b,JSON[_0x3907('0x21')](_0x3b06d8));_0x3e1081(_0x3b06d8);})[_0x3907('0x22')](function(_0x360892){logger[_0x3907('0x15')](_0x3907('0x23'),_0x360892['message'],_0x5ec76b);_0x232a40(_0x144c0e[_0x3907('0x15')](0x1f4,_0x360892[_0x3907('0x17')]));});});}; \ No newline at end of file +var _0x449b=['findAll','options','raw','where','attributes','limit','include','map','model','find','ShowDynamics365Account','catch','moment','bluebird','randomstring','rpc','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetDynamics365Account','Dynamics365Account'];(function(_0x47c3e6,_0x2ba526){var _0x3285ed=function(_0x39ecc1){while(--_0x39ecc1){_0x47c3e6['push'](_0x47c3e6['shift']());}};_0x3285ed(++_0x2ba526);}(_0x449b,0x174));var _0xb449=function(_0x1df85c,_0x29a8a0){_0x1df85c=_0x1df85c-0x0;var _0xbad217=_0x449b[_0x1df85c];return _0xbad217;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb449('0x0'));var BPromise=require(_0xb449('0x1'));var rs=require(_0xb449('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb449('0x3'));var config=require('../../config/environment');var jayson=require(_0xb449('0x4'));var client=jayson[_0xb449('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233cb7,_0x356608,_0xa65131){return new BPromise(function(_0x4e386a,_0x3ae748){return client[_0xb449('0x6')](_0x233cb7,_0xa65131)[_0xb449('0x7')](function(_0x3120c1){logger[_0xb449('0x8')](_0xb449('0x9'),_0x356608,_0xb449('0xa'));logger[_0xb449('0xb')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x356608,'request\x20sent',JSON[_0xb449('0xc')](_0x3120c1));if(_0x3120c1[_0xb449('0xd')]){if(_0x3120c1[_0xb449('0xd')][_0xb449('0xe')]===0x1f4){logger[_0xb449('0xd')](_0xb449('0x9'),_0x356608,_0x3120c1['error'][_0xb449('0xf')]);return _0x3ae748(_0x3120c1[_0xb449('0xd')][_0xb449('0xf')]);}logger[_0xb449('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x356608,_0x3120c1[_0xb449('0xd')][_0xb449('0xf')]);return _0x4e386a(_0x3120c1['error'][_0xb449('0xf')]);}else{logger[_0xb449('0x8')](_0xb449('0x9'),_0x356608,'request\x20sent');_0x4e386a(_0x3120c1['result']['message']);}})['catch'](function(_0x5cb4f8){logger['error'](_0xb449('0x9'),_0x356608,_0x5cb4f8);_0x3ae748(_0x5cb4f8);});});}exports[_0xb449('0x10')]=function(_0x3711e5){var _0x5dfaf0=this;return new Promise(function(_0x4de34b,_0xc64c66){return db[_0xb449('0x11')][_0xb449('0x12')]({'raw':_0x3711e5['options']?_0x3711e5[_0xb449('0x13')][_0xb449('0x14')]===undefined?!![]:![]:!![],'where':_0x3711e5[_0xb449('0x13')]?_0x3711e5['options'][_0xb449('0x15')]||null:null,'attributes':_0x3711e5['options']?_0x3711e5['options'][_0xb449('0x16')]||null:null,'limit':_0x3711e5[_0xb449('0x13')]?_0x3711e5[_0xb449('0x13')][_0xb449('0x17')]||null:null,'include':_0x3711e5[_0xb449('0x13')]?_0x3711e5[_0xb449('0x13')][_0xb449('0x18')]?_[_0xb449('0x19')](_0x3711e5['options'][_0xb449('0x18')],function(_0x357a0f){return{'model':db[_0x357a0f[_0xb449('0x1a')]],'as':_0x357a0f['as'],'attributes':_0x357a0f['attributes'],'include':_0x357a0f[_0xb449('0x18')]?_[_0xb449('0x19')](_0x357a0f[_0xb449('0x18')],function(_0xc66e34){return{'model':db[_0xc66e34[_0xb449('0x1a')]],'as':_0xc66e34['as'],'attributes':_0xc66e34[_0xb449('0x16')],'include':_0xc66e34[_0xb449('0x18')]?_[_0xb449('0x19')](_0xc66e34[_0xb449('0x18')],function(_0x2ea056){return{'model':db[_0x2ea056[_0xb449('0x1a')]],'as':_0x2ea056['as'],'attributes':_0x2ea056['attributes']};}):[]};}):[]};}):[]:[]})[_0xb449('0x7')](function(_0x5c1afa){logger[_0xb449('0x8')](_0xb449('0x10'),_0x3711e5);logger[_0xb449('0xb')](_0xb449('0x10'),_0x3711e5,JSON[_0xb449('0xc')](_0x5c1afa));_0x4de34b(_0x5c1afa);})['catch'](function(_0x19a840){logger[_0xb449('0xd')](_0xb449('0x10'),_0x19a840['message'],_0x3711e5);_0xc64c66(_0x5dfaf0[_0xb449('0xd')](0x1f4,_0x19a840[_0xb449('0xf')]));});});};exports['ShowDynamics365Account']=function(_0x2a388e){var _0x5503fe=this;return new Promise(function(_0x59e552,_0x42bb9b){return db[_0xb449('0x11')][_0xb449('0x1b')]({'raw':_0x2a388e[_0xb449('0x13')]?_0x2a388e[_0xb449('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x2a388e[_0xb449('0x13')]?_0x2a388e[_0xb449('0x13')][_0xb449('0x15')]||null:null,'attributes':_0x2a388e['options']?_0x2a388e['options'][_0xb449('0x16')]||null:null,'include':_0x2a388e['options']?_0x2a388e[_0xb449('0x13')][_0xb449('0x18')]?_['map'](_0x2a388e[_0xb449('0x13')][_0xb449('0x18')],function(_0x4acd22){return{'model':db[_0x4acd22[_0xb449('0x1a')]],'as':_0x4acd22['as'],'attributes':_0x4acd22[_0xb449('0x16')],'include':_0x4acd22[_0xb449('0x18')]?_[_0xb449('0x19')](_0x4acd22[_0xb449('0x18')],function(_0x541b19){return{'model':db[_0x541b19[_0xb449('0x1a')]],'as':_0x541b19['as'],'attributes':_0x541b19[_0xb449('0x16')],'include':_0x541b19[_0xb449('0x18')]?_['map'](_0x541b19[_0xb449('0x18')],function(_0x6037c8){return{'model':db[_0x6037c8['model']],'as':_0x6037c8['as'],'attributes':_0x6037c8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb449('0x7')](function(_0xd2b10a){logger[_0xb449('0x8')](_0xb449('0x1c'),_0x2a388e);logger[_0xb449('0xb')](_0xb449('0x1c'),_0x2a388e,JSON[_0xb449('0xc')](_0xd2b10a));_0x59e552(_0xd2b10a);})[_0xb449('0x1d')](function(_0x2a99a5){logger[_0xb449('0xd')](_0xb449('0x1c'),_0x2a99a5[_0xb449('0xf')],_0x2a388e);_0x42bb9b(_0x5503fe[_0xb449('0xd')](0x1f4,_0x2a99a5[_0xb449('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 8807662..69a10f4 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 _0xd19f=['../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','/:id','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x54fdd8,_0x2e81ae){var _0x4f6f8a=function(_0x2a970c){while(--_0x2a970c){_0x54fdd8['push'](_0x54fdd8['shift']());}};_0x4f6f8a(++_0x2e81ae);}(_0xd19f,0x161));var _0xfd19=function(_0x356e8d,_0x24c719){_0x356e8d=_0x356e8d-0x0;var _0x39e65a=_0xd19f[_0x356e8d];return _0x39e65a;};'use strict';var multer=require(_0xfd19('0x0'));var util=require(_0xfd19('0x1'));var path=require(_0xfd19('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd19('0x3'));var router=express[_0xfd19('0x4')]();var fs_extra=require(_0xfd19('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfd19('0x6'));var config=require(_0xfd19('0x7'));var controller=require(_0xfd19('0x8'));router['get']('/',auth[_0xfd19('0x9')](),controller[_0xfd19('0xa')]);router['get'](_0xfd19('0xb'),auth[_0xfd19('0x9')](),controller['show']);router[_0xfd19('0xc')](_0xfd19('0xd'),auth[_0xfd19('0x9')](),controller[_0xfd19('0xe')]);router[_0xfd19('0xc')](_0xfd19('0xf'),auth[_0xfd19('0x9')](),controller[_0xfd19('0x10')]);router[_0xfd19('0xc')](_0xfd19('0x11'),auth['isAuthenticated'](),controller[_0xfd19('0x12')]);router[_0xfd19('0x13')]('/',auth['isAuthenticated'](),controller[_0xfd19('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfd19('0x15')]);router[_0xfd19('0x16')](_0xfd19('0xb'),auth[_0xfd19('0x9')](),controller[_0xfd19('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7933=['put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getDescriptions','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7933,0xa6));var _0x3793=function(_0x239b6e,_0x1e0d98){_0x239b6e=_0x239b6e-0x0;var _0x403daf=_0x7933[_0x239b6e];return _0x403daf;};'use strict';var multer=require(_0x3793('0x0'));var util=require(_0x3793('0x1'));var path=require('path');var timeout=require(_0x3793('0x2'));var express=require('express');var router=express[_0x3793('0x3')]();var fs_extra=require(_0x3793('0x4'));var auth=require(_0x3793('0x5'));var interaction=require(_0x3793('0x6'));var config=require('../../config/environment');var controller=require(_0x3793('0x7'));router[_0x3793('0x8')]('/',auth['isAuthenticated'](),controller[_0x3793('0x9')]);router[_0x3793('0x8')](_0x3793('0xa'),auth['isAuthenticated'](),controller[_0x3793('0xb')]);router[_0x3793('0x8')](_0x3793('0xc'),auth[_0x3793('0xd')](),controller[_0x3793('0xe')]);router[_0x3793('0x8')](_0x3793('0xf'),auth[_0x3793('0xd')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x3793('0xd')](),controller[_0x3793('0x10')]);router['post']('/',auth[_0x3793('0xd')](),controller[_0x3793('0x11')]);router[_0x3793('0x12')](_0x3793('0xa'),auth[_0x3793('0xd')](),controller[_0x3793('0x13')]);router[_0x3793('0x14')](_0x3793('0xa'),auth['isAuthenticated'](),controller[_0x3793('0x15')]);module[_0x3793('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index cc3e695..ca681d2 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 _0x9a89=['sequelize','exports','STRING','ENUM','incident'];(function(_0x5893b4,_0x2f2730){var _0x1b0bf0=function(_0x22dbfa){while(--_0x22dbfa){_0x5893b4['push'](_0x5893b4['shift']());}};_0x1b0bf0(++_0x2f2730);}(_0x9a89,0xb4));var _0x99a8=function(_0x20c8f3,_0x5ba424){_0x20c8f3=_0x20c8f3-0x0;var _0x207d22=_0x9a89[_0x20c8f3];return _0x207d22;};'use strict';var Sequelize=require(_0x99a8('0x0'));module[_0x99a8('0x1')]={'name':{'type':Sequelize[_0x99a8('0x2')]},'description':{'type':Sequelize[_0x99a8('0x2')]},'ticketType':{'type':Sequelize[_0x99a8('0x3')](_0x99a8('0x4'),'phonecall'),'defaultValue':_0x99a8('0x4')}}; \ No newline at end of file +var _0xf7d7=['STRING','ENUM','phonecall','incident','sequelize','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xf7d7,0xee));var _0x7f7d=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0xf7d7[_0x31ced5];return _0x10d9e5;};'use strict';var Sequelize=require(_0x7f7d('0x0'));module[_0x7f7d('0x1')]={'name':{'type':Sequelize[_0x7f7d('0x2')]},'description':{'type':Sequelize[_0x7f7d('0x2')]},'ticketType':{'type':Sequelize[_0x7f7d('0x3')]('incident',_0x7f7d('0x4')),'defaultValue':_0x7f7d('0x5')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 53b0dfa..2431d4c 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 _0x85fd=['catch','rawAttributes','find','body','params','getFields','findOne','Dynamics365Field','nolimit','getSubjects','order','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','path','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','index','map','Dynamics365Configuration','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows'];(function(_0x1f0cca,_0x17b1e2){var _0x5f2471=function(_0x2cd772){while(--_0x2cd772){_0x1f0cca['push'](_0x1f0cca['shift']());}};_0x5f2471(++_0x17b1e2);}(_0x85fd,0x134));var _0xd85f=function(_0x606074,_0x1c769a){_0x606074=_0x606074-0x0;var _0x39775a=_0x85fd[_0x606074];return _0x39775a;};'use strict';var emlformat=require(_0xd85f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd85f('0x1'));var rp=require(_0xd85f('0x2'));var moment=require('moment');var BPromise=require(_0xd85f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd85f('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd85f('0x5'));var _=require(_0xd85f('0x6'));var squel=require(_0xd85f('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd85f('0x8'));var toCsv=require(_0xd85f('0x9'));var querystring=require('querystring');var Papa=require(_0xd85f('0xa'));var Redis=require(_0xd85f('0xb'));var authService=require(_0xd85f('0xc'));var qs=require(_0xd85f('0xd'));var as=require(_0xd85f('0xe'));var hardwareService=require(_0xd85f('0xf'));var logger=require(_0xd85f('0x10'))(_0xd85f('0x11'));var utils=require(_0xd85f('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd85f('0x13'))['db'];function respondWithStatusCode(_0x2aaf3c,_0x48961a){_0x48961a=_0x48961a||0xcc;return function(_0x4fc2b5){if(_0x4fc2b5){return _0x2aaf3c[_0xd85f('0x14')](_0x48961a);}return _0x2aaf3c['status'](_0x48961a)['end']();};}function respondWithResult(_0x5e06a2,_0x357ab5){_0x357ab5=_0x357ab5||0xc8;return function(_0x51badc){if(_0x51badc){return _0x5e06a2[_0xd85f('0x15')](_0x357ab5)['json'](_0x51badc);}};}function respondWithFilteredResult(_0x19da8b,_0x2323a9){return function(_0x65ed94){if(_0x65ed94){var _0x37937d=typeof _0x2323a9[_0xd85f('0x16')]===_0xd85f('0x17')&&typeof _0x2323a9[_0xd85f('0x18')]===_0xd85f('0x17');var _0x221f7e=_0x65ed94[_0xd85f('0x19')];var _0x5e3706=_0x37937d?0x0:_0x2323a9[_0xd85f('0x16')];var _0x23e79b=_0x37937d?_0x65ed94[_0xd85f('0x19')]:_0x2323a9['offset']+_0x2323a9[_0xd85f('0x18')];var _0x33b7a1;if(_0x23e79b>=_0x221f7e){_0x23e79b=_0x221f7e;_0x33b7a1=0xc8;}else{_0x33b7a1=0xce;}_0x19da8b[_0xd85f('0x15')](_0x33b7a1);return _0x19da8b['set'](_0xd85f('0x1a'),_0x5e3706+'-'+_0x23e79b+'/'+_0x221f7e)[_0xd85f('0x1b')](_0x65ed94);}return null;};}function patchUpdates(_0xa886ab){return function(_0xeb79e2){try{jsonpatch['apply'](_0xeb79e2,_0xa886ab,!![]);}catch(_0x1f8fb7){return BPromise[_0xd85f('0x1c')](_0x1f8fb7);}return _0xeb79e2[_0xd85f('0x1d')]();};}function saveUpdates(_0x16fc14,_0x5d864c){return function(_0x178997){if(_0x178997){return _0x178997[_0xd85f('0x1e')](_0x16fc14)[_0xd85f('0x1f')](function(_0x46b1d7){return _0x46b1d7;});}return null;};}function removeEntity(_0xe7fce0,_0x349872){return function(_0x511c83){if(_0x511c83){return _0x511c83[_0xd85f('0x20')]()[_0xd85f('0x1f')](function(){_0xe7fce0[_0xd85f('0x15')](0xcc)[_0xd85f('0x21')]();});}};}function handleEntityNotFound(_0x51c511,_0x1ddc39){return function(_0x3cbb6a){if(!_0x3cbb6a){_0x51c511[_0xd85f('0x14')](0x194);}return _0x3cbb6a;};}function handleError(_0x2f886f,_0x522ac9){_0x522ac9=_0x522ac9||0x1f4;return function(_0x3aa8d0){logger[_0xd85f('0x22')](_0x3aa8d0['stack']);if(_0x3aa8d0[_0xd85f('0x23')]){delete _0x3aa8d0[_0xd85f('0x23')];}_0x2f886f[_0xd85f('0x15')](_0x522ac9)[_0xd85f('0x24')](_0x3aa8d0);};}exports[_0xd85f('0x25')]=function(_0x435aa2,_0x3995b5){var _0xae226={},_0x212da5={},_0x2230b4={'count':0x0,'rows':[]};var _0x764647=_[_0xd85f('0x26')](db[_0xd85f('0x27')]['rawAttributes'],function(_0x531bab){return{'name':_0x531bab[_0xd85f('0x28')],'type':_0x531bab['type'][_0xd85f('0x29')]};});_0x212da5['model']=_[_0xd85f('0x26')](_0x764647,'name');_0x212da5[_0xd85f('0x2a')]=_[_0xd85f('0x2b')](_0x435aa2[_0xd85f('0x2a')]);_0x212da5[_0xd85f('0x2c')]=_[_0xd85f('0x2d')](_0x212da5['model'],_0x212da5['query']);_0xae226[_0xd85f('0x2e')]=_[_0xd85f('0x2d')](_0x212da5[_0xd85f('0x2f')],qs[_0xd85f('0x30')](_0x435aa2[_0xd85f('0x2a')]['fields']));_0xae226[_0xd85f('0x2e')]=_0xae226[_0xd85f('0x2e')][_0xd85f('0x31')]?_0xae226[_0xd85f('0x2e')]:_0x212da5[_0xd85f('0x2f')];if(!_0x435aa2['query'][_0xd85f('0x32')]('nolimit')){_0xae226[_0xd85f('0x18')]=qs[_0xd85f('0x18')](_0x435aa2[_0xd85f('0x2a')][_0xd85f('0x18')]);_0xae226[_0xd85f('0x16')]=qs[_0xd85f('0x16')](_0x435aa2[_0xd85f('0x2a')][_0xd85f('0x16')]);}_0xae226['order']=qs['sort'](_0x435aa2[_0xd85f('0x2a')][_0xd85f('0x33')]);_0xae226[_0xd85f('0x34')]=qs['filters'](_[_0xd85f('0x35')](_0x435aa2['query'],_0x212da5[_0xd85f('0x2c')]),_0x764647);if(_0x435aa2['query'][_0xd85f('0x36')]){_0xae226['where']=_[_0xd85f('0x37')](_0xae226['where'],{'$or':_[_0xd85f('0x26')](_0x764647,function(_0x289a20){if(_0x289a20[_0xd85f('0x38')]!=='VIRTUAL'){var _0x561423={};_0x561423[_0x289a20[_0xd85f('0x23')]]={'$like':'%'+_0x435aa2['query'][_0xd85f('0x36')]+'%'};return _0x561423;}})});}_0xae226=_['merge']({},_0xae226,_0x435aa2[_0xd85f('0x39')]);var _0x4a740b={'where':_0xae226['where']};return db['Dynamics365Configuration'][_0xd85f('0x19')](_0x4a740b)[_0xd85f('0x1f')](function(_0x4b23f1){_0x2230b4[_0xd85f('0x19')]=_0x4b23f1;if(_0x435aa2['query'][_0xd85f('0x3a')]){_0xae226[_0xd85f('0x3b')]=[{'all':!![]}];}return db[_0xd85f('0x27')][_0xd85f('0x3c')](_0xae226);})['then'](function(_0x132ca5){_0x2230b4[_0xd85f('0x3d')]=_0x132ca5;return _0x2230b4;})[_0xd85f('0x1f')](respondWithFilteredResult(_0x3995b5,_0xae226))[_0xd85f('0x3e')](handleError(_0x3995b5,null));};exports['show']=function(_0x16d07e,_0x35453b){var _0x39fd92={'raw':![],'where':{'id':_0x16d07e['params']['id']}},_0x262820={};_0x262820[_0xd85f('0x2f')]=_[_0xd85f('0x2b')](db[_0xd85f('0x27')][_0xd85f('0x3f')]);_0x262820[_0xd85f('0x2a')]=_[_0xd85f('0x2b')](_0x16d07e['query']);_0x262820['filters']=_[_0xd85f('0x2d')](_0x262820[_0xd85f('0x2f')],_0x262820[_0xd85f('0x2a')]);_0x39fd92['attributes']=_[_0xd85f('0x2d')](_0x262820[_0xd85f('0x2f')],qs[_0xd85f('0x30')](_0x16d07e[_0xd85f('0x2a')][_0xd85f('0x30')]));_0x39fd92[_0xd85f('0x2e')]=_0x39fd92[_0xd85f('0x2e')][_0xd85f('0x31')]?_0x39fd92['attributes']:_0x262820[_0xd85f('0x2f')];if(_0x16d07e[_0xd85f('0x2a')][_0xd85f('0x3a')]){_0x39fd92[_0xd85f('0x3b')]=[{'all':!![]}];}_0x39fd92=_['merge']({},_0x39fd92,_0x16d07e[_0xd85f('0x39')]);return db[_0xd85f('0x27')][_0xd85f('0x40')](_0x39fd92)[_0xd85f('0x1f')](handleEntityNotFound(_0x35453b,null))[_0xd85f('0x1f')](respondWithResult(_0x35453b,null))[_0xd85f('0x3e')](handleError(_0x35453b,null));};exports['create']=function(_0x4fa2e3,_0x50c4cf){return db[_0xd85f('0x27')]['create'](_0x4fa2e3[_0xd85f('0x41')],{})[_0xd85f('0x1f')](respondWithResult(_0x50c4cf,0xc9))[_0xd85f('0x3e')](handleError(_0x50c4cf,null));};exports[_0xd85f('0x1e')]=function(_0x2b530d,_0x2d1f2b){if(_0x2b530d[_0xd85f('0x41')]['id']){delete _0x2b530d[_0xd85f('0x41')]['id'];}return db[_0xd85f('0x27')][_0xd85f('0x40')]({'where':{'id':_0x2b530d['params']['id']}})[_0xd85f('0x1f')](handleEntityNotFound(_0x2d1f2b,null))[_0xd85f('0x1f')](saveUpdates(_0x2b530d['body'],null))[_0xd85f('0x1f')](respondWithResult(_0x2d1f2b,null))['catch'](handleError(_0x2d1f2b,null));};exports[_0xd85f('0x20')]=function(_0x45c338,_0x57ec16){return db[_0xd85f('0x27')][_0xd85f('0x40')]({'where':{'id':_0x45c338[_0xd85f('0x42')]['id']}})[_0xd85f('0x1f')](handleEntityNotFound(_0x57ec16,null))[_0xd85f('0x1f')](removeEntity(_0x57ec16,null))[_0xd85f('0x3e')](handleError(_0x57ec16,null));};exports[_0xd85f('0x43')]=function(_0x51e372,_0x16c341,_0x194055){var _0x4526d1={};var _0x19b567={};var _0x549eef;var _0x2573d1;return db[_0xd85f('0x27')][_0xd85f('0x44')]({'where':{'id':_0x51e372[_0xd85f('0x42')]['id']}})['then'](handleEntityNotFound(_0x16c341,null))[_0xd85f('0x1f')](function(_0xf04d57){if(_0xf04d57){_0x549eef=_0xf04d57;_0x19b567[_0xd85f('0x2f')]=_[_0xd85f('0x2b')](db[_0xd85f('0x45')][_0xd85f('0x3f')]);_0x19b567[_0xd85f('0x2a')]=_[_0xd85f('0x2b')](_0x51e372[_0xd85f('0x2a')]);_0x19b567['filters']=_[_0xd85f('0x2d')](_0x19b567['model'],_0x19b567[_0xd85f('0x2a')]);_0x4526d1['attributes']=_[_0xd85f('0x2d')](_0x19b567[_0xd85f('0x2f')],qs[_0xd85f('0x30')](_0x51e372[_0xd85f('0x2a')]['fields']));_0x4526d1[_0xd85f('0x2e')]=_0x4526d1[_0xd85f('0x2e')][_0xd85f('0x31')]?_0x4526d1['attributes']:_0x19b567[_0xd85f('0x2f')];_0x4526d1['order']=qs['sort'](_0x51e372['query'][_0xd85f('0x33')]);_0x4526d1[_0xd85f('0x34')]=qs[_0xd85f('0x2c')](_[_0xd85f('0x35')](_0x51e372[_0xd85f('0x2a')],_0x19b567['filters']));if(_0x51e372[_0xd85f('0x2a')][_0xd85f('0x36')]){_0x4526d1[_0xd85f('0x34')]=_[_0xd85f('0x37')](_0x4526d1['where'],{'$or':_['map'](_0x4526d1['attributes'],function(_0x453b65){var _0x112592={};_0x112592[_0x453b65]={'$like':'%'+_0x51e372[_0xd85f('0x2a')]['filter']+'%'};return _0x112592;})});}_0x4526d1=_[_0xd85f('0x37')]({},_0x4526d1,_0x51e372[_0xd85f('0x39')]);return _0x549eef[_0xd85f('0x43')](_0x4526d1);}})[_0xd85f('0x1f')](function(_0x3e08e8){if(_0x3e08e8){_0x2573d1=_0x3e08e8[_0xd85f('0x31')];if(!_0x51e372[_0xd85f('0x2a')]['hasOwnProperty'](_0xd85f('0x46'))){_0x4526d1[_0xd85f('0x18')]=qs[_0xd85f('0x18')](_0x51e372['query']['limit']);_0x4526d1[_0xd85f('0x16')]=qs[_0xd85f('0x16')](_0x51e372['query']['offset']);}return _0x549eef[_0xd85f('0x43')](_0x4526d1);}})[_0xd85f('0x1f')](function(_0x3ff0e4){if(_0x3ff0e4){return _0x3ff0e4?{'count':_0x2573d1,'rows':_0x3ff0e4}:null;}})[_0xd85f('0x1f')](respondWithResult(_0x16c341,null))[_0xd85f('0x3e')](handleError(_0x16c341,null));};exports[_0xd85f('0x47')]=function(_0x274062,_0x423203,_0xa07ca2){var _0x302551={};var _0x158f0a={};var _0x300471;var _0x4fda49;return db[_0xd85f('0x27')][_0xd85f('0x44')]({'where':{'id':_0x274062[_0xd85f('0x42')]['id']}})[_0xd85f('0x1f')](handleEntityNotFound(_0x423203,null))[_0xd85f('0x1f')](function(_0x5b5d0c){if(_0x5b5d0c){_0x300471=_0x5b5d0c;_0x158f0a[_0xd85f('0x2f')]=_[_0xd85f('0x2b')](db['Dynamics365Field'][_0xd85f('0x3f')]);_0x158f0a['query']=_['keys'](_0x274062[_0xd85f('0x2a')]);_0x158f0a[_0xd85f('0x2c')]=_[_0xd85f('0x2d')](_0x158f0a[_0xd85f('0x2f')],_0x158f0a[_0xd85f('0x2a')]);_0x302551['attributes']=_['intersection'](_0x158f0a[_0xd85f('0x2f')],qs[_0xd85f('0x30')](_0x274062[_0xd85f('0x2a')][_0xd85f('0x30')]));_0x302551[_0xd85f('0x2e')]=_0x302551[_0xd85f('0x2e')][_0xd85f('0x31')]?_0x302551['attributes']:_0x158f0a[_0xd85f('0x2f')];_0x302551['order']=qs[_0xd85f('0x33')](_0x274062[_0xd85f('0x2a')][_0xd85f('0x33')]);_0x302551[_0xd85f('0x34')]=qs[_0xd85f('0x2c')](_[_0xd85f('0x35')](_0x274062['query'],_0x158f0a[_0xd85f('0x2c')]));if(_0x274062[_0xd85f('0x2a')][_0xd85f('0x36')]){_0x302551['where']=_['merge'](_0x302551[_0xd85f('0x34')],{'$or':_[_0xd85f('0x26')](_0x302551[_0xd85f('0x2e')],function(_0x435f34){var _0x55a21f={};_0x55a21f[_0x435f34]={'$like':'%'+_0x274062[_0xd85f('0x2a')][_0xd85f('0x36')]+'%'};return _0x55a21f;})});}_0x302551=_[_0xd85f('0x37')]({},_0x302551,_0x274062[_0xd85f('0x39')]);return _0x300471[_0xd85f('0x47')](_0x302551);}})[_0xd85f('0x1f')](function(_0x5da4e3){if(_0x5da4e3){_0x4fda49=_0x5da4e3[_0xd85f('0x31')];if(!_0x274062[_0xd85f('0x2a')][_0xd85f('0x32')](_0xd85f('0x46'))){_0x302551[_0xd85f('0x18')]=qs[_0xd85f('0x18')](_0x274062[_0xd85f('0x2a')][_0xd85f('0x18')]);_0x302551[_0xd85f('0x16')]=qs['offset'](_0x274062['query']['offset']);}return _0x300471[_0xd85f('0x47')](_0x302551);}})[_0xd85f('0x1f')](function(_0x3457b7){if(_0x3457b7){return _0x3457b7?{'count':_0x4fda49,'rows':_0x3457b7}:null;}})[_0xd85f('0x1f')](respondWithResult(_0x423203,null))[_0xd85f('0x3e')](handleError(_0x423203,null));};exports['getDescriptions']=function(_0x242911,_0x4c80ad,_0x3facb4){var _0x196330={};var _0x3cba6a={};var _0x462eca;var _0x421a10;return db[_0xd85f('0x27')]['findOne']({'where':{'id':_0x242911['params']['id']}})['then'](handleEntityNotFound(_0x4c80ad,null))[_0xd85f('0x1f')](function(_0x456621){if(_0x456621){_0x462eca=_0x456621;_0x3cba6a['model']=_[_0xd85f('0x2b')](db[_0xd85f('0x45')]['rawAttributes']);_0x3cba6a[_0xd85f('0x2a')]=_[_0xd85f('0x2b')](_0x242911['query']);_0x3cba6a['filters']=_[_0xd85f('0x2d')](_0x3cba6a[_0xd85f('0x2f')],_0x3cba6a[_0xd85f('0x2a')]);_0x196330[_0xd85f('0x2e')]=_['intersection'](_0x3cba6a[_0xd85f('0x2f')],qs['fields'](_0x242911[_0xd85f('0x2a')][_0xd85f('0x30')]));_0x196330[_0xd85f('0x2e')]=_0x196330[_0xd85f('0x2e')]['length']?_0x196330[_0xd85f('0x2e')]:_0x3cba6a['model'];_0x196330[_0xd85f('0x48')]=qs[_0xd85f('0x33')](_0x242911[_0xd85f('0x2a')][_0xd85f('0x33')]);_0x196330[_0xd85f('0x34')]=qs[_0xd85f('0x2c')](_[_0xd85f('0x35')](_0x242911[_0xd85f('0x2a')],_0x3cba6a['filters']));if(_0x242911[_0xd85f('0x2a')]['filter']){_0x196330[_0xd85f('0x34')]=_[_0xd85f('0x37')](_0x196330[_0xd85f('0x34')],{'$or':_[_0xd85f('0x26')](_0x196330[_0xd85f('0x2e')],function(_0x3ae7ff){var _0x450d80={};_0x450d80[_0x3ae7ff]={'$like':'%'+_0x242911[_0xd85f('0x2a')]['filter']+'%'};return _0x450d80;})});}_0x196330=_[_0xd85f('0x37')]({},_0x196330,_0x242911[_0xd85f('0x39')]);return _0x462eca[_0xd85f('0x49')](_0x196330);}})[_0xd85f('0x1f')](function(_0x3f12bb){if(_0x3f12bb){_0x421a10=_0x3f12bb[_0xd85f('0x31')];if(!_0x242911['query'][_0xd85f('0x32')]('nolimit')){_0x196330['limit']=qs[_0xd85f('0x18')](_0x242911[_0xd85f('0x2a')]['limit']);_0x196330[_0xd85f('0x16')]=qs[_0xd85f('0x16')](_0x242911[_0xd85f('0x2a')][_0xd85f('0x16')]);}return _0x462eca['getDescriptions'](_0x196330);}})[_0xd85f('0x1f')](function(_0x180e30){if(_0x180e30){return _0x180e30?{'count':_0x421a10,'rows':_0x180e30}:null;}})[_0xd85f('0x1f')](respondWithResult(_0x4c80ad,null))[_0xd85f('0x3e')](handleError(_0x4c80ad,null));}; \ No newline at end of file +var _0xc7ad=['getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','findOne','getFields'];(function(_0x279251,_0x2fdf6f){var _0x1e1752=function(_0x32fe7b){while(--_0x32fe7b){_0x279251['push'](_0x279251['shift']());}};_0x1e1752(++_0x2fdf6f);}(_0xc7ad,0x102));var _0xdc7a=function(_0x56491b,_0x26c2c7){_0x56491b=_0x56491b-0x0;var _0x58db1b=_0xc7ad[_0x56491b];return _0x58db1b;};'use strict';var emlformat=require(_0xdc7a('0x0'));var rimraf=require(_0xdc7a('0x1'));var zipdir=require(_0xdc7a('0x2'));var jsonpatch=require(_0xdc7a('0x3'));var rp=require('request-promise');var moment=require(_0xdc7a('0x4'));var BPromise=require(_0xdc7a('0x5'));var Mustache=require(_0xdc7a('0x6'));var util=require(_0xdc7a('0x7'));var path=require(_0xdc7a('0x8'));var sox=require(_0xdc7a('0x9'));var csv=require('to-csv');var ejs=require(_0xdc7a('0xa'));var fs=require('fs');var fs_extra=require(_0xdc7a('0xb'));var _=require(_0xdc7a('0xc'));var squel=require(_0xdc7a('0xd'));var crypto=require(_0xdc7a('0xe'));var jsforce=require(_0xdc7a('0xf'));var deskjs=require(_0xdc7a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdc7a('0x11'));var authService=require(_0xdc7a('0x12'));var qs=require(_0xdc7a('0x13'));var as=require(_0xdc7a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc7a('0x15'))(_0xdc7a('0x16'));var utils=require('../../config/utils');var config=require(_0xdc7a('0x17'));var licenseUtil=require(_0xdc7a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49246b,_0x837c90){_0x837c90=_0x837c90||0xcc;return function(_0xe2d5d5){if(_0xe2d5d5){return _0x49246b[_0xdc7a('0x19')](_0x837c90);}return _0x49246b[_0xdc7a('0x1a')](_0x837c90)[_0xdc7a('0x1b')]();};}function respondWithResult(_0x371d22,_0x3d75f1){_0x3d75f1=_0x3d75f1||0xc8;return function(_0x20647e){if(_0x20647e){return _0x371d22['status'](_0x3d75f1)[_0xdc7a('0x1c')](_0x20647e);}};}function respondWithFilteredResult(_0x3224d4,_0x4678e1){return function(_0x30d623){if(_0x30d623){var _0x230f0f=typeof _0x4678e1['offset']===_0xdc7a('0x1d')&&typeof _0x4678e1[_0xdc7a('0x1e')]===_0xdc7a('0x1d');var _0x5c8754=_0x30d623[_0xdc7a('0x1f')];var _0x387969=_0x230f0f?0x0:_0x4678e1[_0xdc7a('0x20')];var _0x10dceb=_0x230f0f?_0x30d623['count']:_0x4678e1[_0xdc7a('0x20')]+_0x4678e1[_0xdc7a('0x1e')];var _0x2d2db0;if(_0x10dceb>=_0x5c8754){_0x10dceb=_0x5c8754;_0x2d2db0=0xc8;}else{_0x2d2db0=0xce;}_0x3224d4['status'](_0x2d2db0);return _0x3224d4[_0xdc7a('0x21')](_0xdc7a('0x22'),_0x387969+'-'+_0x10dceb+'/'+_0x5c8754)[_0xdc7a('0x1c')](_0x30d623);}return null;};}function patchUpdates(_0x2a761f){return function(_0x48cc78){try{jsonpatch[_0xdc7a('0x23')](_0x48cc78,_0x2a761f,!![]);}catch(_0x4e25cb){return BPromise[_0xdc7a('0x24')](_0x4e25cb);}return _0x48cc78[_0xdc7a('0x25')]();};}function saveUpdates(_0x3cc157,_0xed8293){return function(_0x4c0d77){if(_0x4c0d77){return _0x4c0d77[_0xdc7a('0x26')](_0x3cc157)[_0xdc7a('0x27')](function(_0x36af3e){return _0x36af3e;});}return null;};}function removeEntity(_0x14193a,_0x27c969){return function(_0x49897e){if(_0x49897e){return _0x49897e[_0xdc7a('0x28')]()[_0xdc7a('0x27')](function(){_0x14193a[_0xdc7a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ae28b,_0x1b7780){return function(_0x4d4fae){if(!_0x4d4fae){_0x1ae28b[_0xdc7a('0x19')](0x194);}return _0x4d4fae;};}function handleError(_0x154ee0,_0x171545){_0x171545=_0x171545||0x1f4;return function(_0x59ee3f){logger[_0xdc7a('0x29')](_0x59ee3f[_0xdc7a('0x2a')]);if(_0x59ee3f[_0xdc7a('0x2b')]){delete _0x59ee3f['name'];}_0x154ee0[_0xdc7a('0x1a')](_0x171545)[_0xdc7a('0x2c')](_0x59ee3f);};}exports[_0xdc7a('0x2d')]=function(_0x19fc6b,_0x58faca){var _0x1ae3e5={},_0x3e438e={},_0x1f5331={'count':0x0,'rows':[]};var _0x5ca24f=_[_0xdc7a('0x2e')](db[_0xdc7a('0x2f')][_0xdc7a('0x30')],function(_0x4913a7){return{'name':_0x4913a7[_0xdc7a('0x31')],'type':_0x4913a7[_0xdc7a('0x32')][_0xdc7a('0x33')]};});_0x3e438e[_0xdc7a('0x34')]=_[_0xdc7a('0x2e')](_0x5ca24f,_0xdc7a('0x2b'));_0x3e438e[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x19fc6b[_0xdc7a('0x35')]);_0x3e438e[_0xdc7a('0x37')]=_['intersection'](_0x3e438e[_0xdc7a('0x34')],_0x3e438e[_0xdc7a('0x35')]);_0x1ae3e5[_0xdc7a('0x38')]=_[_0xdc7a('0x39')](_0x3e438e[_0xdc7a('0x34')],qs['fields'](_0x19fc6b[_0xdc7a('0x35')][_0xdc7a('0x3a')]));_0x1ae3e5[_0xdc7a('0x38')]=_0x1ae3e5[_0xdc7a('0x38')][_0xdc7a('0x3b')]?_0x1ae3e5[_0xdc7a('0x38')]:_0x3e438e['model'];if(!_0x19fc6b['query'][_0xdc7a('0x3c')](_0xdc7a('0x3d'))){_0x1ae3e5[_0xdc7a('0x1e')]=qs[_0xdc7a('0x1e')](_0x19fc6b[_0xdc7a('0x35')][_0xdc7a('0x1e')]);_0x1ae3e5['offset']=qs[_0xdc7a('0x20')](_0x19fc6b[_0xdc7a('0x35')][_0xdc7a('0x20')]);}_0x1ae3e5[_0xdc7a('0x3e')]=qs[_0xdc7a('0x3f')](_0x19fc6b['query'][_0xdc7a('0x3f')]);_0x1ae3e5[_0xdc7a('0x40')]=qs['filters'](_[_0xdc7a('0x41')](_0x19fc6b['query'],_0x3e438e[_0xdc7a('0x37')]),_0x5ca24f);if(_0x19fc6b[_0xdc7a('0x35')][_0xdc7a('0x42')]){_0x1ae3e5['where']=_[_0xdc7a('0x43')](_0x1ae3e5[_0xdc7a('0x40')],{'$or':_[_0xdc7a('0x2e')](_0x5ca24f,function(_0x1e245e){if(_0x1e245e[_0xdc7a('0x32')]!==_0xdc7a('0x44')){var _0x330938={};_0x330938[_0x1e245e[_0xdc7a('0x2b')]]={'$like':'%'+_0x19fc6b[_0xdc7a('0x35')]['filter']+'%'};return _0x330938;}})});}_0x1ae3e5=_[_0xdc7a('0x43')]({},_0x1ae3e5,_0x19fc6b[_0xdc7a('0x45')]);var _0x4a58e7={'where':_0x1ae3e5['where']};return db['Dynamics365Configuration'][_0xdc7a('0x1f')](_0x4a58e7)[_0xdc7a('0x27')](function(_0x865b95){_0x1f5331[_0xdc7a('0x1f')]=_0x865b95;if(_0x19fc6b['query'][_0xdc7a('0x46')]){_0x1ae3e5[_0xdc7a('0x47')]=[{'all':!![]}];}return db[_0xdc7a('0x2f')][_0xdc7a('0x48')](_0x1ae3e5);})[_0xdc7a('0x27')](function(_0x471bc4){_0x1f5331[_0xdc7a('0x49')]=_0x471bc4;return _0x1f5331;})[_0xdc7a('0x27')](respondWithFilteredResult(_0x58faca,_0x1ae3e5))['catch'](handleError(_0x58faca,null));};exports[_0xdc7a('0x4a')]=function(_0x4231da,_0x496938){var _0x2a6c50={'raw':![],'where':{'id':_0x4231da[_0xdc7a('0x4b')]['id']}},_0x40f88a={};_0x40f88a[_0xdc7a('0x34')]=_['keys'](db['Dynamics365Configuration'][_0xdc7a('0x30')]);_0x40f88a[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x4231da[_0xdc7a('0x35')]);_0x40f88a['filters']=_[_0xdc7a('0x39')](_0x40f88a['model'],_0x40f88a[_0xdc7a('0x35')]);_0x2a6c50[_0xdc7a('0x38')]=_['intersection'](_0x40f88a[_0xdc7a('0x34')],qs['fields'](_0x4231da[_0xdc7a('0x35')]['fields']));_0x2a6c50[_0xdc7a('0x38')]=_0x2a6c50[_0xdc7a('0x38')][_0xdc7a('0x3b')]?_0x2a6c50[_0xdc7a('0x38')]:_0x40f88a[_0xdc7a('0x34')];if(_0x4231da[_0xdc7a('0x35')][_0xdc7a('0x46')]){_0x2a6c50[_0xdc7a('0x47')]=[{'all':!![]}];}_0x2a6c50=_['merge']({},_0x2a6c50,_0x4231da[_0xdc7a('0x45')]);return db[_0xdc7a('0x2f')][_0xdc7a('0x4c')](_0x2a6c50)[_0xdc7a('0x27')](handleEntityNotFound(_0x496938,null))[_0xdc7a('0x27')](respondWithResult(_0x496938,null))[_0xdc7a('0x4d')](handleError(_0x496938,null));};exports['create']=function(_0x5cf678,_0x316ad3){return db[_0xdc7a('0x2f')][_0xdc7a('0x4e')](_0x5cf678[_0xdc7a('0x4f')],{})[_0xdc7a('0x27')](respondWithResult(_0x316ad3,0xc9))[_0xdc7a('0x4d')](handleError(_0x316ad3,null));};exports[_0xdc7a('0x26')]=function(_0x146c9a,_0x387cf7){if(_0x146c9a['body']['id']){delete _0x146c9a[_0xdc7a('0x4f')]['id'];}return db[_0xdc7a('0x2f')][_0xdc7a('0x4c')]({'where':{'id':_0x146c9a['params']['id']}})[_0xdc7a('0x27')](handleEntityNotFound(_0x387cf7,null))[_0xdc7a('0x27')](saveUpdates(_0x146c9a['body'],null))[_0xdc7a('0x27')](respondWithResult(_0x387cf7,null))[_0xdc7a('0x4d')](handleError(_0x387cf7,null));};exports['destroy']=function(_0x2ca5ff,_0x5dd355){return db[_0xdc7a('0x2f')]['find']({'where':{'id':_0x2ca5ff[_0xdc7a('0x4b')]['id']}})[_0xdc7a('0x27')](handleEntityNotFound(_0x5dd355,null))['then'](removeEntity(_0x5dd355,null))[_0xdc7a('0x4d')](handleError(_0x5dd355,null));};exports['getFields']=function(_0x5cb868,_0x30e7f9,_0x4e8ec6){var _0x36d124={};var _0x2383b4={};var _0x20febd;var _0x176b00;return db[_0xdc7a('0x2f')][_0xdc7a('0x50')]({'where':{'id':_0x5cb868[_0xdc7a('0x4b')]['id']}})[_0xdc7a('0x27')](handleEntityNotFound(_0x30e7f9,null))[_0xdc7a('0x27')](function(_0x29aebd){if(_0x29aebd){_0x20febd=_0x29aebd;_0x2383b4[_0xdc7a('0x34')]=_['keys'](db['Dynamics365Field'][_0xdc7a('0x30')]);_0x2383b4[_0xdc7a('0x35')]=_[_0xdc7a('0x36')](_0x5cb868[_0xdc7a('0x35')]);_0x2383b4[_0xdc7a('0x37')]=_['intersection'](_0x2383b4[_0xdc7a('0x34')],_0x2383b4[_0xdc7a('0x35')]);_0x36d124[_0xdc7a('0x38')]=_['intersection'](_0x2383b4['model'],qs[_0xdc7a('0x3a')](_0x5cb868['query'][_0xdc7a('0x3a')]));_0x36d124[_0xdc7a('0x38')]=_0x36d124[_0xdc7a('0x38')][_0xdc7a('0x3b')]?_0x36d124[_0xdc7a('0x38')]:_0x2383b4[_0xdc7a('0x34')];_0x36d124[_0xdc7a('0x3e')]=qs[_0xdc7a('0x3f')](_0x5cb868[_0xdc7a('0x35')][_0xdc7a('0x3f')]);_0x36d124[_0xdc7a('0x40')]=qs[_0xdc7a('0x37')](_[_0xdc7a('0x41')](_0x5cb868[_0xdc7a('0x35')],_0x2383b4[_0xdc7a('0x37')]));if(_0x5cb868[_0xdc7a('0x35')][_0xdc7a('0x42')]){_0x36d124[_0xdc7a('0x40')]=_[_0xdc7a('0x43')](_0x36d124['where'],{'$or':_[_0xdc7a('0x2e')](_0x36d124[_0xdc7a('0x38')],function(_0x315d41){var _0x455b49={};_0x455b49[_0x315d41]={'$like':'%'+_0x5cb868[_0xdc7a('0x35')][_0xdc7a('0x42')]+'%'};return _0x455b49;})});}_0x36d124=_[_0xdc7a('0x43')]({},_0x36d124,_0x5cb868[_0xdc7a('0x45')]);return _0x20febd[_0xdc7a('0x51')](_0x36d124);}})['then'](function(_0x39d73b){if(_0x39d73b){_0x176b00=_0x39d73b[_0xdc7a('0x3b')];if(!_0x5cb868[_0xdc7a('0x35')][_0xdc7a('0x3c')](_0xdc7a('0x3d'))){_0x36d124[_0xdc7a('0x1e')]=qs['limit'](_0x5cb868[_0xdc7a('0x35')][_0xdc7a('0x1e')]);_0x36d124['offset']=qs['offset'](_0x5cb868[_0xdc7a('0x35')][_0xdc7a('0x20')]);}return _0x20febd[_0xdc7a('0x51')](_0x36d124);}})[_0xdc7a('0x27')](function(_0x457584){if(_0x457584){return _0x457584?{'count':_0x176b00,'rows':_0x457584}:null;}})[_0xdc7a('0x27')](respondWithResult(_0x30e7f9,null))['catch'](handleError(_0x30e7f9,null));};exports[_0xdc7a('0x52')]=function(_0x4a96a2,_0x27a79e,_0x250860){var _0x18c223={};var _0x286f3c={};var _0x5dde85;var _0x547b91;return db['Dynamics365Configuration'][_0xdc7a('0x50')]({'where':{'id':_0x4a96a2[_0xdc7a('0x4b')]['id']}})[_0xdc7a('0x27')](handleEntityNotFound(_0x27a79e,null))[_0xdc7a('0x27')](function(_0xb69202){if(_0xb69202){_0x5dde85=_0xb69202;_0x286f3c['model']=_[_0xdc7a('0x36')](db[_0xdc7a('0x53')][_0xdc7a('0x30')]);_0x286f3c['query']=_[_0xdc7a('0x36')](_0x4a96a2[_0xdc7a('0x35')]);_0x286f3c['filters']=_[_0xdc7a('0x39')](_0x286f3c[_0xdc7a('0x34')],_0x286f3c[_0xdc7a('0x35')]);_0x18c223[_0xdc7a('0x38')]=_[_0xdc7a('0x39')](_0x286f3c[_0xdc7a('0x34')],qs[_0xdc7a('0x3a')](_0x4a96a2[_0xdc7a('0x35')][_0xdc7a('0x3a')]));_0x18c223[_0xdc7a('0x38')]=_0x18c223[_0xdc7a('0x38')][_0xdc7a('0x3b')]?_0x18c223[_0xdc7a('0x38')]:_0x286f3c[_0xdc7a('0x34')];_0x18c223[_0xdc7a('0x3e')]=qs[_0xdc7a('0x3f')](_0x4a96a2[_0xdc7a('0x35')][_0xdc7a('0x3f')]);_0x18c223[_0xdc7a('0x40')]=qs[_0xdc7a('0x37')](_[_0xdc7a('0x41')](_0x4a96a2[_0xdc7a('0x35')],_0x286f3c['filters']));if(_0x4a96a2[_0xdc7a('0x35')]['filter']){_0x18c223[_0xdc7a('0x40')]=_[_0xdc7a('0x43')](_0x18c223[_0xdc7a('0x40')],{'$or':_['map'](_0x18c223[_0xdc7a('0x38')],function(_0x1a7fbf){var _0x4081bc={};_0x4081bc[_0x1a7fbf]={'$like':'%'+_0x4a96a2[_0xdc7a('0x35')][_0xdc7a('0x42')]+'%'};return _0x4081bc;})});}_0x18c223=_[_0xdc7a('0x43')]({},_0x18c223,_0x4a96a2[_0xdc7a('0x45')]);return _0x5dde85[_0xdc7a('0x52')](_0x18c223);}})['then'](function(_0x321276){if(_0x321276){_0x547b91=_0x321276['length'];if(!_0x4a96a2[_0xdc7a('0x35')][_0xdc7a('0x3c')]('nolimit')){_0x18c223[_0xdc7a('0x1e')]=qs['limit'](_0x4a96a2['query']['limit']);_0x18c223[_0xdc7a('0x20')]=qs[_0xdc7a('0x20')](_0x4a96a2[_0xdc7a('0x35')][_0xdc7a('0x20')]);}return _0x5dde85[_0xdc7a('0x52')](_0x18c223);}})[_0xdc7a('0x27')](function(_0x33d3f1){if(_0x33d3f1){return _0x33d3f1?{'count':_0x547b91,'rows':_0x33d3f1}:null;}})[_0xdc7a('0x27')](respondWithResult(_0x27a79e,null))[_0xdc7a('0x4d')](handleError(_0x27a79e,null));};exports[_0xdc7a('0x54')]=function(_0x1e8b99,_0x1a2718,_0xc173e2){var _0x142435={};var _0x18b599={};var _0x11b94c;var _0x25bcae;return db['Dynamics365Configuration'][_0xdc7a('0x50')]({'where':{'id':_0x1e8b99[_0xdc7a('0x4b')]['id']}})[_0xdc7a('0x27')](handleEntityNotFound(_0x1a2718,null))[_0xdc7a('0x27')](function(_0x5706b5){if(_0x5706b5){_0x11b94c=_0x5706b5;_0x18b599[_0xdc7a('0x34')]=_[_0xdc7a('0x36')](db[_0xdc7a('0x53')][_0xdc7a('0x30')]);_0x18b599['query']=_[_0xdc7a('0x36')](_0x1e8b99[_0xdc7a('0x35')]);_0x18b599['filters']=_[_0xdc7a('0x39')](_0x18b599['model'],_0x18b599['query']);_0x142435['attributes']=_[_0xdc7a('0x39')](_0x18b599['model'],qs[_0xdc7a('0x3a')](_0x1e8b99[_0xdc7a('0x35')][_0xdc7a('0x3a')]));_0x142435['attributes']=_0x142435[_0xdc7a('0x38')][_0xdc7a('0x3b')]?_0x142435[_0xdc7a('0x38')]:_0x18b599['model'];_0x142435[_0xdc7a('0x3e')]=qs[_0xdc7a('0x3f')](_0x1e8b99[_0xdc7a('0x35')][_0xdc7a('0x3f')]);_0x142435[_0xdc7a('0x40')]=qs['filters'](_[_0xdc7a('0x41')](_0x1e8b99[_0xdc7a('0x35')],_0x18b599[_0xdc7a('0x37')]));if(_0x1e8b99[_0xdc7a('0x35')][_0xdc7a('0x42')]){_0x142435[_0xdc7a('0x40')]=_[_0xdc7a('0x43')](_0x142435[_0xdc7a('0x40')],{'$or':_[_0xdc7a('0x2e')](_0x142435[_0xdc7a('0x38')],function(_0x182ce0){var _0x6e0eeb={};_0x6e0eeb[_0x182ce0]={'$like':'%'+_0x1e8b99['query'][_0xdc7a('0x42')]+'%'};return _0x6e0eeb;})});}_0x142435=_['merge']({},_0x142435,_0x1e8b99[_0xdc7a('0x45')]);return _0x11b94c[_0xdc7a('0x54')](_0x142435);}})[_0xdc7a('0x27')](function(_0x5d3aa8){if(_0x5d3aa8){_0x25bcae=_0x5d3aa8['length'];if(!_0x1e8b99[_0xdc7a('0x35')][_0xdc7a('0x3c')](_0xdc7a('0x3d'))){_0x142435['limit']=qs['limit'](_0x1e8b99[_0xdc7a('0x35')][_0xdc7a('0x1e')]);_0x142435[_0xdc7a('0x20')]=qs['offset'](_0x1e8b99['query'][_0xdc7a('0x20')]);}return _0x11b94c[_0xdc7a('0x54')](_0x142435);}})[_0xdc7a('0x27')](function(_0x2f54ee){if(_0x2f54ee){return _0x2f54ee?{'count':_0x25bcae,'rows':_0x2f54ee}:null;}})[_0xdc7a('0x27')](respondWithResult(_0x1a2718,null))[_0xdc7a('0x4d')](handleError(_0x1a2718,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 2a2d209..d0188e4 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84ab=['request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','lodash','util','../../config/logger','api','moment'];(function(_0x167283,_0x35e74c){var _0x300c95=function(_0x1e7354){while(--_0x1e7354){_0x167283['push'](_0x167283['shift']());}};_0x300c95(++_0x35e74c);}(_0x84ab,0x12f));var _0xb84a=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x84ab[_0x369151];return _0x4292d5;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x422311,_0x54125c){var _0x356858=function(_0x283a0f){while(--_0x283a0f){_0x422311['push'](_0x422311['shift']());}};_0x356858(++_0x54125c);}(_0x70e0,0x17b));var _0x070e=function(_0x374916,_0x131bf9){_0x374916=_0x374916-0x0;var _0x590975=_0x70e0[_0x374916];return _0x590975;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index c5eefe4..e2c3e34 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 _0x0a9c=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring'];(function(_0x5e77aa,_0x4acf6d){var _0x1af34d=function(_0x236d60){while(--_0x236d60){_0x5e77aa['push'](_0x5e77aa['shift']());}};_0x1af34d(++_0x4acf6d);}(_0x0a9c,0x1f4));var _0xc0a9=function(_0x47e064,_0x5387e0){_0x47e064=_0x47e064-0x0;var _0x1d9cf9=_0x0a9c[_0x47e064];return _0x1d9cf9;};'use strict';var _=require(_0xc0a9('0x0'));var util=require('util');var moment=require(_0xc0a9('0x1'));var BPromise=require(_0xc0a9('0x2'));var rs=require(_0xc0a9('0x3'));var fs=require('fs');var Redis=require(_0xc0a9('0x4'));var db=require(_0xc0a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0a9('0x6'))(_0xc0a9('0x7'));var config=require(_0xc0a9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc0a9('0x9')][_0xc0a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265b57,_0x232541,_0x135882){return new BPromise(function(_0x568999,_0x125231){return client[_0xc0a9('0xb')](_0x265b57,_0x135882)['then'](function(_0x1255ca){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x232541,_0xc0a9('0xc'));logger[_0xc0a9('0xd')](_0xc0a9('0xe'),_0x232541,_0xc0a9('0xc'),JSON[_0xc0a9('0xf')](_0x1255ca));if(_0x1255ca[_0xc0a9('0x10')]){if(_0x1255ca['error']['code']===0x1f4){logger[_0xc0a9('0x10')](_0xc0a9('0x11'),_0x232541,_0x1255ca[_0xc0a9('0x10')]['message']);return _0x125231(_0x1255ca[_0xc0a9('0x10')]['message']);}logger['error'](_0xc0a9('0x11'),_0x232541,_0x1255ca[_0xc0a9('0x10')]['message']);return _0x568999(_0x1255ca[_0xc0a9('0x10')][_0xc0a9('0x12')]);}else{logger[_0xc0a9('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x232541,_0xc0a9('0xc'));_0x568999(_0x1255ca['result'][_0xc0a9('0x12')]);}})[_0xc0a9('0x14')](function(_0x502bc9){logger[_0xc0a9('0x10')](_0xc0a9('0x11'),_0x232541,_0x502bc9);_0x125231(_0x502bc9);});});} \ No newline at end of file +var _0x0f6d=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x0f6d,0xef));var _0xd0f6=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x0f6d[_0x553a87];return _0x12d1e6;};'use strict';var _=require(_0xd0f6('0x0'));var util=require(_0xd0f6('0x1'));var moment=require(_0xd0f6('0x2'));var BPromise=require(_0xd0f6('0x3'));var rs=require(_0xd0f6('0x4'));var fs=require('fs');var Redis=require(_0xd0f6('0x5'));var db=require(_0xd0f6('0x6'))['db'];var utils=require(_0xd0f6('0x7'));var logger=require(_0xd0f6('0x8'))(_0xd0f6('0x9'));var config=require(_0xd0f6('0xa'));var jayson=require(_0xd0f6('0xb'));var client=jayson[_0xd0f6('0xc')][_0xd0f6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x25cc20,_0x4c61d6,_0x580029){return new BPromise(function(_0x20766b,_0x34ab5a){return client[_0xd0f6('0xe')](_0x25cc20,_0x580029)[_0xd0f6('0xf')](function(_0x518c91){logger[_0xd0f6('0x10')](_0xd0f6('0x11'),_0x4c61d6,_0xd0f6('0x12'));logger[_0xd0f6('0x13')](_0xd0f6('0x14'),_0x4c61d6,_0xd0f6('0x12'),JSON[_0xd0f6('0x15')](_0x518c91));if(_0x518c91[_0xd0f6('0x16')]){if(_0x518c91[_0xd0f6('0x16')][_0xd0f6('0x17')]===0x1f4){logger[_0xd0f6('0x16')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4c61d6,_0x518c91[_0xd0f6('0x16')][_0xd0f6('0x18')]);return _0x34ab5a(_0x518c91[_0xd0f6('0x16')]['message']);}logger[_0xd0f6('0x16')](_0xd0f6('0x11'),_0x4c61d6,_0x518c91[_0xd0f6('0x16')]['message']);return _0x20766b(_0x518c91[_0xd0f6('0x16')][_0xd0f6('0x18')]);}else{logger[_0xd0f6('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4c61d6,_0xd0f6('0x12'));_0x20766b(_0x518c91[_0xd0f6('0x19')][_0xd0f6('0x18')]);}})['catch'](function(_0x991888){logger[_0xd0f6('0x16')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4c61d6,_0x991888);_0x34ab5a(_0x991888);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8182479..f8838c7 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 _0x06b4=['get','isAuthenticated','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x5488fc,_0x45cee6){var _0x5642f2=function(_0x15c932){while(--_0x15c932){_0x5488fc['push'](_0x5488fc['shift']());}};_0x5642f2(++_0x45cee6);}(_0x06b4,0x113));var _0x406b=function(_0x6f9c53,_0xc9b94b){_0x6f9c53=_0x6f9c53-0x0;var _0x51e86e=_0x06b4[_0x6f9c53];return _0x51e86e;};'use strict';var multer=require(_0x406b('0x0'));var util=require(_0x406b('0x1'));var path=require(_0x406b('0x2'));var timeout=require(_0x406b('0x3'));var express=require(_0x406b('0x4'));var router=express['Router']();var fs_extra=require(_0x406b('0x5'));var auth=require(_0x406b('0x6'));var interaction=require(_0x406b('0x7'));var config=require(_0x406b('0x8'));var controller=require(_0x406b('0x9'));router[_0x406b('0xa')]('/',auth[_0x406b('0xb')](),controller['index']);router[_0x406b('0xa')](_0x406b('0xc'),auth[_0x406b('0xb')](),controller['show']);router[_0x406b('0xd')]('/',auth[_0x406b('0xb')](),controller[_0x406b('0xe')]);router['put'](_0x406b('0xc'),auth[_0x406b('0xb')](),controller[_0x406b('0xf')]);router[_0x406b('0x10')](_0x406b('0xc'),auth[_0x406b('0xb')](),controller[_0x406b('0x11')]);module[_0x406b('0x12')]=router; \ No newline at end of file +var _0x1617=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x1617,0xab));var _0x7161=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0x1617[_0xcfeda9];return _0x4826c7;};'use strict';var multer=require(_0x7161('0x0'));var util=require(_0x7161('0x1'));var path=require(_0x7161('0x2'));var timeout=require(_0x7161('0x3'));var express=require('express');var router=express[_0x7161('0x4')]();var fs_extra=require(_0x7161('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7161('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x7161('0x7')]('/',auth['isAuthenticated'](),controller[_0x7161('0x8')]);router[_0x7161('0x7')](_0x7161('0x9'),auth[_0x7161('0xa')](),controller[_0x7161('0xb')]);router[_0x7161('0xc')]('/',auth[_0x7161('0xa')](),controller[_0x7161('0xd')]);router[_0x7161('0xe')](_0x7161('0x9'),auth[_0x7161('0xa')](),controller[_0x7161('0xf')]);router[_0x7161('0x10')](_0x7161('0x9'),auth['isAuthenticated'](),controller[_0x7161('0x11')]);module[_0x7161('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 62235d5..4a0fc46 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 _0xab60=['string','BOOLEAN','exports','ENUM','customVariable','keyValue','STRING'];(function(_0x24243b,_0x55c567){var _0x1a85ce=function(_0x28c017){while(--_0x28c017){_0x24243b['push'](_0x24243b['shift']());}};_0x1a85ce(++_0x55c567);}(_0xab60,0xfe));var _0x0ab6=function(_0x30a0e0,_0x2982ae){_0x30a0e0=_0x30a0e0-0x0;var _0x242e63=_0xab60[_0x30a0e0];return _0x242e63;};'use strict';var Sequelize=require('sequelize');module[_0x0ab6('0x0')]={'type':{'type':Sequelize[_0x0ab6('0x1')]('string','variable',_0x0ab6('0x2'),_0x0ab6('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0ab6('0x4')]},'key':{'type':Sequelize[_0x0ab6('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x0ab6('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x0ab6('0x4')]},'idField':{'type':Sequelize[_0x0ab6('0x4')]},'nameField':{'type':Sequelize[_0x0ab6('0x4')]},'customField':{'type':Sequelize[_0x0ab6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0ab6('0x4')]}}; \ No newline at end of file +var _0x6822=['BOOLEAN','string','customVariable','keyValue','picklist','STRING','ENUM','variable'];(function(_0x6ae12c,_0x443d2c){var _0x5be82c=function(_0x46e4d4){while(--_0x46e4d4){_0x6ae12c['push'](_0x6ae12c['shift']());}};_0x5be82c(++_0x443d2c);}(_0x6822,0xf1));var _0x2682=function(_0x5ce559,_0x2767ee){_0x5ce559=_0x5ce559-0x0;var _0x4c02dc=_0x6822[_0x5ce559];return _0x4c02dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x2682('0x0'),'variable',_0x2682('0x1'),_0x2682('0x2'),_0x2682('0x3')),'defaultValue':_0x2682('0x0')},'content':{'type':Sequelize[_0x2682('0x4')]},'key':{'type':Sequelize[_0x2682('0x4')]},'keyType':{'type':Sequelize[_0x2682('0x5')](_0x2682('0x0'),_0x2682('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x2682('0x4')]},'idField':{'type':Sequelize[_0x2682('0x4')]},'nameField':{'type':Sequelize[_0x2682('0x4')]},'customField':{'type':Sequelize[_0x2682('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2682('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index eec6d76..4a3db2f 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 _0xad02=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','update','params','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xad02,0x111));var _0x2ad0=function(_0xf55e73,_0x3fecc5){_0xf55e73=_0xf55e73-0x0;var _0x116b99=_0xad02[_0xf55e73];return _0x116b99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2ad0('0x0'));var jsonpatch=require(_0x2ad0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2ad0('0x2'));var util=require('util');var path=require(_0x2ad0('0x3'));var sox=require(_0x2ad0('0x4'));var csv=require(_0x2ad0('0x5'));var ejs=require(_0x2ad0('0x6'));var fs=require('fs');var fs_extra=require(_0x2ad0('0x7'));var _=require(_0x2ad0('0x8'));var squel=require('squel');var crypto=require(_0x2ad0('0x9'));var jsforce=require(_0x2ad0('0xa'));var deskjs=require(_0x2ad0('0xb'));var toCsv=require(_0x2ad0('0x5'));var querystring=require(_0x2ad0('0xc'));var Papa=require(_0x2ad0('0xd'));var Redis=require(_0x2ad0('0xe'));var authService=require(_0x2ad0('0xf'));var qs=require(_0x2ad0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ad0('0x11'))(_0x2ad0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ad0('0x13'));var db=require(_0x2ad0('0x14'))['db'];function respondWithStatusCode(_0x2edcc7,_0xc600e4){_0xc600e4=_0xc600e4||0xcc;return function(_0x6a67c8){if(_0x6a67c8){return _0x2edcc7[_0x2ad0('0x15')](_0xc600e4);}return _0x2edcc7[_0x2ad0('0x16')](_0xc600e4)[_0x2ad0('0x17')]();};}function respondWithResult(_0x256f21,_0xdfe769){_0xdfe769=_0xdfe769||0xc8;return function(_0x3f490a){if(_0x3f490a){return _0x256f21[_0x2ad0('0x16')](_0xdfe769)['json'](_0x3f490a);}};}function respondWithFilteredResult(_0x5bc9fa,_0x3b0f20){return function(_0x1b8d10){if(_0x1b8d10){var _0x29b8cc=typeof _0x3b0f20[_0x2ad0('0x18')]===_0x2ad0('0x19')&&typeof _0x3b0f20['limit']===_0x2ad0('0x19');var _0x28b5aa=_0x1b8d10[_0x2ad0('0x1a')];var _0x35d8cb=_0x29b8cc?0x0:_0x3b0f20[_0x2ad0('0x18')];var _0x497c61=_0x29b8cc?_0x1b8d10[_0x2ad0('0x1a')]:_0x3b0f20[_0x2ad0('0x18')]+_0x3b0f20[_0x2ad0('0x1b')];var _0x7f2828;if(_0x497c61>=_0x28b5aa){_0x497c61=_0x28b5aa;_0x7f2828=0xc8;}else{_0x7f2828=0xce;}_0x5bc9fa[_0x2ad0('0x16')](_0x7f2828);return _0x5bc9fa[_0x2ad0('0x1c')](_0x2ad0('0x1d'),_0x35d8cb+'-'+_0x497c61+'/'+_0x28b5aa)['json'](_0x1b8d10);}return null;};}function patchUpdates(_0x445962){return function(_0x5889e6){try{jsonpatch[_0x2ad0('0x1e')](_0x5889e6,_0x445962,!![]);}catch(_0x8ba53c){return BPromise[_0x2ad0('0x1f')](_0x8ba53c);}return _0x5889e6[_0x2ad0('0x20')]();};}function saveUpdates(_0x3cda7e,_0x584622){return function(_0x420a23){if(_0x420a23){return _0x420a23['update'](_0x3cda7e)['then'](function(_0x54ed89){return _0x54ed89;});}return null;};}function removeEntity(_0x3ba3a0,_0x621eff){return function(_0x1ea820){if(_0x1ea820){return _0x1ea820[_0x2ad0('0x21')]()[_0x2ad0('0x22')](function(){_0x3ba3a0['status'](0xcc)[_0x2ad0('0x17')]();});}};}function handleEntityNotFound(_0x2a8f4a,_0x29b7dd){return function(_0x23afe){if(!_0x23afe){_0x2a8f4a[_0x2ad0('0x15')](0x194);}return _0x23afe;};}function handleError(_0x3c0ecd,_0x28dbd0){_0x28dbd0=_0x28dbd0||0x1f4;return function(_0x5c12c9){logger[_0x2ad0('0x23')](_0x5c12c9[_0x2ad0('0x24')]);if(_0x5c12c9['name']){delete _0x5c12c9[_0x2ad0('0x25')];}_0x3c0ecd[_0x2ad0('0x16')](_0x28dbd0)[_0x2ad0('0x26')](_0x5c12c9);};}exports[_0x2ad0('0x27')]=function(_0xc6a5a7,_0x47d346){var _0x4bf0e7={},_0x79254d={},_0xbb3a07={'count':0x0,'rows':[]};var _0x28766c=_[_0x2ad0('0x28')](db[_0x2ad0('0x29')][_0x2ad0('0x2a')],function(_0x532701){return{'name':_0x532701['fieldName'],'type':_0x532701[_0x2ad0('0x2b')][_0x2ad0('0x2c')]};});_0x79254d[_0x2ad0('0x2d')]=_['map'](_0x28766c,_0x2ad0('0x25'));_0x79254d['query']=_[_0x2ad0('0x2e')](_0xc6a5a7['query']);_0x79254d['filters']=_[_0x2ad0('0x2f')](_0x79254d[_0x2ad0('0x2d')],_0x79254d[_0x2ad0('0x30')]);_0x4bf0e7[_0x2ad0('0x31')]=_[_0x2ad0('0x2f')](_0x79254d['model'],qs['fields'](_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x32')]));_0x4bf0e7[_0x2ad0('0x31')]=_0x4bf0e7[_0x2ad0('0x31')]['length']?_0x4bf0e7[_0x2ad0('0x31')]:_0x79254d['model'];if(!_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x33')](_0x2ad0('0x34'))){_0x4bf0e7[_0x2ad0('0x1b')]=qs[_0x2ad0('0x1b')](_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x1b')]);_0x4bf0e7['offset']=qs['offset'](_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x18')]);}_0x4bf0e7[_0x2ad0('0x35')]=qs[_0x2ad0('0x36')](_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x36')]);_0x4bf0e7[_0x2ad0('0x37')]=qs['filters'](_[_0x2ad0('0x38')](_0xc6a5a7[_0x2ad0('0x30')],_0x79254d[_0x2ad0('0x39')]),_0x28766c);if(_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x3a')]){_0x4bf0e7['where']=_[_0x2ad0('0x3b')](_0x4bf0e7['where'],{'$or':_[_0x2ad0('0x28')](_0x28766c,function(_0x16489c){if(_0x16489c['type']!==_0x2ad0('0x3c')){var _0x3b3cab={};_0x3b3cab[_0x16489c[_0x2ad0('0x25')]]={'$like':'%'+_0xc6a5a7[_0x2ad0('0x30')]['filter']+'%'};return _0x3b3cab;}})});}_0x4bf0e7=_[_0x2ad0('0x3b')]({},_0x4bf0e7,_0xc6a5a7[_0x2ad0('0x3d')]);var _0x2c223a={'where':_0x4bf0e7[_0x2ad0('0x37')]};return db[_0x2ad0('0x29')][_0x2ad0('0x1a')](_0x2c223a)[_0x2ad0('0x22')](function(_0x1e157b){_0xbb3a07[_0x2ad0('0x1a')]=_0x1e157b;if(_0xc6a5a7[_0x2ad0('0x30')][_0x2ad0('0x3e')]){_0x4bf0e7['include']=[{'all':!![]}];}return db[_0x2ad0('0x29')][_0x2ad0('0x3f')](_0x4bf0e7);})[_0x2ad0('0x22')](function(_0x15ad2b){_0xbb3a07[_0x2ad0('0x40')]=_0x15ad2b;return _0xbb3a07;})['then'](respondWithFilteredResult(_0x47d346,_0x4bf0e7))[_0x2ad0('0x41')](handleError(_0x47d346,null));};exports[_0x2ad0('0x42')]=function(_0x3257e5,_0xc415ca){var _0x56b4a8={'raw':!![],'where':{'id':_0x3257e5['params']['id']}},_0x4ba80a={};_0x4ba80a[_0x2ad0('0x2d')]=_[_0x2ad0('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x4ba80a[_0x2ad0('0x30')]=_['keys'](_0x3257e5['query']);_0x4ba80a[_0x2ad0('0x39')]=_[_0x2ad0('0x2f')](_0x4ba80a['model'],_0x4ba80a[_0x2ad0('0x30')]);_0x56b4a8['attributes']=_[_0x2ad0('0x2f')](_0x4ba80a[_0x2ad0('0x2d')],qs[_0x2ad0('0x32')](_0x3257e5['query'][_0x2ad0('0x32')]));_0x56b4a8['attributes']=_0x56b4a8[_0x2ad0('0x31')]['length']?_0x56b4a8[_0x2ad0('0x31')]:_0x4ba80a['model'];if(_0x3257e5['query'][_0x2ad0('0x3e')]){_0x56b4a8[_0x2ad0('0x43')]=[{'all':!![]}];}_0x56b4a8=_[_0x2ad0('0x3b')]({},_0x56b4a8,_0x3257e5[_0x2ad0('0x3d')]);return db[_0x2ad0('0x29')][_0x2ad0('0x44')](_0x56b4a8)[_0x2ad0('0x22')](handleEntityNotFound(_0xc415ca,null))[_0x2ad0('0x22')](respondWithResult(_0xc415ca,null))[_0x2ad0('0x41')](handleError(_0xc415ca,null));};exports[_0x2ad0('0x45')]=function(_0x5151dd,_0x14b315){return db[_0x2ad0('0x29')]['create'](_0x5151dd[_0x2ad0('0x46')],{})[_0x2ad0('0x22')](respondWithResult(_0x14b315,0xc9))[_0x2ad0('0x41')](handleError(_0x14b315,null));};exports[_0x2ad0('0x47')]=function(_0x376b3f,_0x4e928a){if(_0x376b3f[_0x2ad0('0x46')]['id']){delete _0x376b3f[_0x2ad0('0x46')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x376b3f[_0x2ad0('0x48')]['id']}})[_0x2ad0('0x22')](handleEntityNotFound(_0x4e928a,null))[_0x2ad0('0x22')](saveUpdates(_0x376b3f['body'],null))['then'](respondWithResult(_0x4e928a,null))[_0x2ad0('0x41')](handleError(_0x4e928a,null));};exports[_0x2ad0('0x21')]=function(_0x26548b,_0x4c1179){return db[_0x2ad0('0x29')][_0x2ad0('0x44')]({'where':{'id':_0x26548b[_0x2ad0('0x48')]['id']}})[_0x2ad0('0x22')](handleEntityNotFound(_0x4c1179,null))['then'](removeEntity(_0x4c1179,null))['catch'](handleError(_0x4c1179,null));}; \ No newline at end of file +var _0x8a37=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','error','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Dynamics365Field','includeAll','include','findAll','catch','show','options','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x6f24f9,_0x14049c){var _0x3d36d7=function(_0x4c54bd){while(--_0x4c54bd){_0x6f24f9['push'](_0x6f24f9['shift']());}};_0x3d36d7(++_0x14049c);}(_0x8a37,0x77));var _0x78a3=function(_0x1e70e2,_0x2dbc29){_0x1e70e2=_0x1e70e2-0x0;var _0x3aff27=_0x8a37[_0x1e70e2];return _0x3aff27;};'use strict';var emlformat=require(_0x78a3('0x0'));var rimraf=require(_0x78a3('0x1'));var zipdir=require(_0x78a3('0x2'));var jsonpatch=require(_0x78a3('0x3'));var rp=require('request-promise');var moment=require(_0x78a3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x78a3('0x5'));var util=require('util');var path=require(_0x78a3('0x6'));var sox=require(_0x78a3('0x7'));var csv=require(_0x78a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78a3('0x9'));var crypto=require('crypto');var jsforce=require(_0x78a3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x78a3('0x8'));var querystring=require(_0x78a3('0xb'));var Papa=require(_0x78a3('0xc'));var Redis=require(_0x78a3('0xd'));var authService=require(_0x78a3('0xe'));var qs=require(_0x78a3('0xf'));var as=require(_0x78a3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78a3('0x11'))('api');var utils=require(_0x78a3('0x12'));var config=require(_0x78a3('0x13'));var licenseUtil=require(_0x78a3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47468f,_0x5b404a){_0x5b404a=_0x5b404a||0xcc;return function(_0x3a6aec){if(_0x3a6aec){return _0x47468f[_0x78a3('0x15')](_0x5b404a);}return _0x47468f[_0x78a3('0x16')](_0x5b404a)[_0x78a3('0x17')]();};}function respondWithResult(_0x25d24e,_0x40f26c){_0x40f26c=_0x40f26c||0xc8;return function(_0x418647){if(_0x418647){return _0x25d24e[_0x78a3('0x16')](_0x40f26c)[_0x78a3('0x18')](_0x418647);}};}function respondWithFilteredResult(_0x43fdc0,_0xe7cbac){return function(_0x1d1ada){if(_0x1d1ada){var _0xfa3e94=typeof _0xe7cbac[_0x78a3('0x19')]==='undefined'&&typeof _0xe7cbac['limit']===_0x78a3('0x1a');var _0x40f173=_0x1d1ada['count'];var _0x291225=_0xfa3e94?0x0:_0xe7cbac[_0x78a3('0x19')];var _0x5b2dd5=_0xfa3e94?_0x1d1ada[_0x78a3('0x1b')]:_0xe7cbac[_0x78a3('0x19')]+_0xe7cbac[_0x78a3('0x1c')];var _0x376b4e;if(_0x5b2dd5>=_0x40f173){_0x5b2dd5=_0x40f173;_0x376b4e=0xc8;}else{_0x376b4e=0xce;}_0x43fdc0[_0x78a3('0x16')](_0x376b4e);return _0x43fdc0[_0x78a3('0x1d')]('Content-Range',_0x291225+'-'+_0x5b2dd5+'/'+_0x40f173)[_0x78a3('0x18')](_0x1d1ada);}return null;};}function patchUpdates(_0x1a6dfa){return function(_0x70c41f){try{jsonpatch[_0x78a3('0x1e')](_0x70c41f,_0x1a6dfa,!![]);}catch(_0x5cc932){return BPromise['reject'](_0x5cc932);}return _0x70c41f[_0x78a3('0x1f')]();};}function saveUpdates(_0x1ee593,_0x5297ba){return function(_0xf5f9f2){if(_0xf5f9f2){return _0xf5f9f2[_0x78a3('0x20')](_0x1ee593)[_0x78a3('0x21')](function(_0x5b84fd){return _0x5b84fd;});}return null;};}function removeEntity(_0x17eb04,_0x45dfbd){return function(_0x242b66){if(_0x242b66){return _0x242b66['destroy']()[_0x78a3('0x21')](function(){_0x17eb04[_0x78a3('0x16')](0xcc)[_0x78a3('0x17')]();});}};}function handleEntityNotFound(_0x3e7545,_0x47cf41){return function(_0x215cb7){if(!_0x215cb7){_0x3e7545['sendStatus'](0x194);}return _0x215cb7;};}function handleError(_0x1aa805,_0x35f1a4){_0x35f1a4=_0x35f1a4||0x1f4;return function(_0x3b3f65){logger[_0x78a3('0x22')](_0x3b3f65['stack']);if(_0x3b3f65[_0x78a3('0x23')]){delete _0x3b3f65[_0x78a3('0x23')];}_0x1aa805[_0x78a3('0x16')](_0x35f1a4)['send'](_0x3b3f65);};}exports[_0x78a3('0x24')]=function(_0x21568c,_0x4ddc7f){var _0x1c992a={},_0xd20aba={},_0x4c1b01={'count':0x0,'rows':[]};var _0x580f91=_[_0x78a3('0x25')](db['Dynamics365Field'][_0x78a3('0x26')],function(_0x1edb27){return{'name':_0x1edb27[_0x78a3('0x27')],'type':_0x1edb27['type']['key']};});_0xd20aba[_0x78a3('0x28')]=_[_0x78a3('0x25')](_0x580f91,'name');_0xd20aba[_0x78a3('0x29')]=_[_0x78a3('0x2a')](_0x21568c[_0x78a3('0x29')]);_0xd20aba[_0x78a3('0x2b')]=_[_0x78a3('0x2c')](_0xd20aba[_0x78a3('0x28')],_0xd20aba[_0x78a3('0x29')]);_0x1c992a[_0x78a3('0x2d')]=_['intersection'](_0xd20aba[_0x78a3('0x28')],qs[_0x78a3('0x2e')](_0x21568c[_0x78a3('0x29')]['fields']));_0x1c992a[_0x78a3('0x2d')]=_0x1c992a[_0x78a3('0x2d')][_0x78a3('0x2f')]?_0x1c992a[_0x78a3('0x2d')]:_0xd20aba[_0x78a3('0x28')];if(!_0x21568c[_0x78a3('0x29')]['hasOwnProperty'](_0x78a3('0x30'))){_0x1c992a[_0x78a3('0x1c')]=qs[_0x78a3('0x1c')](_0x21568c['query'][_0x78a3('0x1c')]);_0x1c992a[_0x78a3('0x19')]=qs[_0x78a3('0x19')](_0x21568c[_0x78a3('0x29')][_0x78a3('0x19')]);}_0x1c992a[_0x78a3('0x31')]=qs['sort'](_0x21568c[_0x78a3('0x29')][_0x78a3('0x32')]);_0x1c992a[_0x78a3('0x33')]=qs[_0x78a3('0x2b')](_[_0x78a3('0x34')](_0x21568c[_0x78a3('0x29')],_0xd20aba[_0x78a3('0x2b')]),_0x580f91);if(_0x21568c[_0x78a3('0x29')][_0x78a3('0x35')]){_0x1c992a[_0x78a3('0x33')]=_[_0x78a3('0x36')](_0x1c992a['where'],{'$or':_[_0x78a3('0x25')](_0x580f91,function(_0x409e44){if(_0x409e44[_0x78a3('0x37')]!==_0x78a3('0x38')){var _0x2cc96e={};_0x2cc96e[_0x409e44[_0x78a3('0x23')]]={'$like':'%'+_0x21568c[_0x78a3('0x29')][_0x78a3('0x35')]+'%'};return _0x2cc96e;}})});}_0x1c992a=_[_0x78a3('0x36')]({},_0x1c992a,_0x21568c['options']);var _0xcb482a={'where':_0x1c992a['where']};return db[_0x78a3('0x39')]['count'](_0xcb482a)[_0x78a3('0x21')](function(_0x3bd72d){_0x4c1b01[_0x78a3('0x1b')]=_0x3bd72d;if(_0x21568c[_0x78a3('0x29')][_0x78a3('0x3a')]){_0x1c992a[_0x78a3('0x3b')]=[{'all':!![]}];}return db[_0x78a3('0x39')][_0x78a3('0x3c')](_0x1c992a);})[_0x78a3('0x21')](function(_0x524474){_0x4c1b01['rows']=_0x524474;return _0x4c1b01;})[_0x78a3('0x21')](respondWithFilteredResult(_0x4ddc7f,_0x1c992a))[_0x78a3('0x3d')](handleError(_0x4ddc7f,null));};exports[_0x78a3('0x3e')]=function(_0xedb5d6,_0x4ce57d){var _0x142e84={'raw':!![],'where':{'id':_0xedb5d6['params']['id']}},_0xe76cd4={};_0xe76cd4[_0x78a3('0x28')]=_[_0x78a3('0x2a')](db['Dynamics365Field'][_0x78a3('0x26')]);_0xe76cd4[_0x78a3('0x29')]=_[_0x78a3('0x2a')](_0xedb5d6[_0x78a3('0x29')]);_0xe76cd4['filters']=_[_0x78a3('0x2c')](_0xe76cd4[_0x78a3('0x28')],_0xe76cd4[_0x78a3('0x29')]);_0x142e84[_0x78a3('0x2d')]=_['intersection'](_0xe76cd4[_0x78a3('0x28')],qs['fields'](_0xedb5d6[_0x78a3('0x29')]['fields']));_0x142e84[_0x78a3('0x2d')]=_0x142e84[_0x78a3('0x2d')]['length']?_0x142e84[_0x78a3('0x2d')]:_0xe76cd4['model'];if(_0xedb5d6[_0x78a3('0x29')]['includeAll']){_0x142e84[_0x78a3('0x3b')]=[{'all':!![]}];}_0x142e84=_['merge']({},_0x142e84,_0xedb5d6[_0x78a3('0x3f')]);return db[_0x78a3('0x39')][_0x78a3('0x40')](_0x142e84)[_0x78a3('0x21')](handleEntityNotFound(_0x4ce57d,null))[_0x78a3('0x21')](respondWithResult(_0x4ce57d,null))[_0x78a3('0x3d')](handleError(_0x4ce57d,null));};exports[_0x78a3('0x41')]=function(_0x97633f,_0x2f45da){return db['Dynamics365Field'][_0x78a3('0x41')](_0x97633f['body'],{})[_0x78a3('0x21')](respondWithResult(_0x2f45da,0xc9))['catch'](handleError(_0x2f45da,null));};exports[_0x78a3('0x20')]=function(_0x28691e,_0x20d843){if(_0x28691e[_0x78a3('0x42')]['id']){delete _0x28691e[_0x78a3('0x42')]['id'];}return db[_0x78a3('0x39')]['find']({'where':{'id':_0x28691e[_0x78a3('0x43')]['id']}})[_0x78a3('0x21')](handleEntityNotFound(_0x20d843,null))[_0x78a3('0x21')](saveUpdates(_0x28691e['body'],null))['then'](respondWithResult(_0x20d843,null))[_0x78a3('0x3d')](handleError(_0x20d843,null));};exports[_0x78a3('0x44')]=function(_0x3669d5,_0x4410ac){return db[_0x78a3('0x39')]['find']({'where':{'id':_0x3669d5['params']['id']}})[_0x78a3('0x21')](handleEntityNotFound(_0x4410ac,null))[_0x78a3('0x21')](removeEntity(_0x4410ac,null))[_0x78a3('0x3d')](handleError(_0x4410ac,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 5e4fe29..4b1b0a2 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 _0x3a8b=['FieldId','lodash','api','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x35eff3,_0x36a1d4){var _0x26f974=function(_0x2fbd15){while(--_0x2fbd15){_0x35eff3['push'](_0x35eff3['shift']());}};_0x26f974(++_0x36a1d4);}(_0x3a8b,0x1bd));var _0xb3a8=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3a8b[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xb3a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb3a8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb3a8('0x2'));var fs=require('fs');var path=require(_0xb3a8('0x3'));var rimraf=require(_0xb3a8('0x4'));var config=require('../../config/environment');var attributes=require(_0xb3a8('0x5'));module[_0xb3a8('0x6')]=function(_0x15535b,_0x27f636){return _0x15535b[_0xb3a8('0x7')](_0xb3a8('0x8'),attributes,{'tableName':_0xb3a8('0x9'),'paranoid':![],'indexes':[{'name':_0xb3a8('0xa'),'fields':['idField',_0xb3a8('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4c44=['api','moment','bluebird','request-promise','path','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','util'];(function(_0x3a902a,_0xca8442){var _0x24f2d5=function(_0xb6799a){while(--_0xb6799a){_0x3a902a['push'](_0x3a902a['shift']());}};_0x24f2d5(++_0xca8442);}(_0x4c44,0x9b));var _0x44c4=function(_0x2df74c,_0x42b9cb){_0x2df74c=_0x2df74c-0x0;var _0x219cc6=_0x4c44[_0x2df74c];return _0x219cc6;};'use strict';var _=require('lodash');var util=require(_0x44c4('0x0'));var logger=require('../../config/logger')(_0x44c4('0x1'));var moment=require(_0x44c4('0x2'));var BPromise=require(_0x44c4('0x3'));var rp=require(_0x44c4('0x4'));var fs=require('fs');var path=require(_0x44c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x44c4('0x6'));module[_0x44c4('0x7')]=function(_0x50672e,_0x10d9c2){return _0x50672e[_0x44c4('0x8')](_0x44c4('0x9'),attributes,{'tableName':_0x44c4('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x44c4('0xb'),_0x44c4('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 1905f8d..1328799 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 _0xf4d8=['code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x90f28a,_0xf10877){var _0x417d19=function(_0x46e2a5){while(--_0x46e2a5){_0x90f28a['push'](_0x90f28a['shift']());}};_0x417d19(++_0xf10877);}(_0xf4d8,0x18c));var _0x8f4d=function(_0x57a0e2,_0x3bd8a1){_0x57a0e2=_0x57a0e2-0x0;var _0x2cad78=_0xf4d8[_0x57a0e2];return _0x2cad78;};'use strict';var _=require(_0x8f4d('0x0'));var util=require(_0x8f4d('0x1'));var moment=require(_0x8f4d('0x2'));var BPromise=require(_0x8f4d('0x3'));var rs=require(_0x8f4d('0x4'));var fs=require('fs');var Redis=require(_0x8f4d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f4d('0x6'))(_0x8f4d('0x7'));var config=require(_0x8f4d('0x8'));var jayson=require(_0x8f4d('0x9'));var client=jayson[_0x8f4d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52dcfb,_0x5c1978,_0x346984){return new BPromise(function(_0x16a291,_0x433220){return client['request'](_0x52dcfb,_0x346984)[_0x8f4d('0xb')](function(_0x4529ec){logger[_0x8f4d('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5c1978,_0x8f4d('0xd'));logger[_0x8f4d('0xe')](_0x8f4d('0xf'),_0x5c1978,_0x8f4d('0xd'),JSON[_0x8f4d('0x10')](_0x4529ec));if(_0x4529ec[_0x8f4d('0x11')]){if(_0x4529ec['error'][_0x8f4d('0x12')]===0x1f4){logger[_0x8f4d('0x11')](_0x8f4d('0x13'),_0x5c1978,_0x4529ec[_0x8f4d('0x11')][_0x8f4d('0x14')]);return _0x433220(_0x4529ec[_0x8f4d('0x11')][_0x8f4d('0x14')]);}logger[_0x8f4d('0x11')](_0x8f4d('0x13'),_0x5c1978,_0x4529ec[_0x8f4d('0x11')]['message']);return _0x16a291(_0x4529ec[_0x8f4d('0x11')][_0x8f4d('0x14')]);}else{logger[_0x8f4d('0xc')](_0x8f4d('0x13'),_0x5c1978,_0x8f4d('0xd'));_0x16a291(_0x4529ec[_0x8f4d('0x15')][_0x8f4d('0x14')]);}})[_0x8f4d('0x16')](function(_0x3d7386){logger[_0x8f4d('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x5c1978,_0x3d7386);_0x433220(_0x3d7386);});});} \ No newline at end of file +var _0xcdeb=['rpc','../../config/environment','http','then','info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4cf62e,_0x10b632){var _0x1e6456=function(_0x5b2124){while(--_0x5b2124){_0x4cf62e['push'](_0x4cf62e['shift']());}};_0x1e6456(++_0x10b632);}(_0xcdeb,0x161));var _0xbcde=function(_0x3c706e,_0x172939){_0x3c706e=_0x3c706e-0x0;var _0x1fbc1e=_0xcdeb[_0x3c706e];return _0x1fbc1e;};'use strict';var _=require(_0xbcde('0x0'));var util=require('util');var moment=require(_0xbcde('0x1'));var BPromise=require('bluebird');var rs=require(_0xbcde('0x2'));var fs=require('fs');var Redis=require(_0xbcde('0x3'));var db=require(_0xbcde('0x4'))['db'];var utils=require(_0xbcde('0x5'));var logger=require(_0xbcde('0x6'))(_0xbcde('0x7'));var config=require(_0xbcde('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbcde('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a1873,_0x2d49ff,_0x48a9d3){return new BPromise(function(_0x2b4cf0,_0x5617fb){return client['request'](_0x2a1873,_0x48a9d3)[_0xbcde('0xa')](function(_0x565fa3){logger[_0xbcde('0xb')](_0xbcde('0xc'),_0x2d49ff,'request\x20sent');logger[_0xbcde('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2d49ff,_0xbcde('0xe'),JSON['stringify'](_0x565fa3));if(_0x565fa3[_0xbcde('0xf')]){if(_0x565fa3[_0xbcde('0xf')][_0xbcde('0x10')]===0x1f4){logger['error'](_0xbcde('0xc'),_0x2d49ff,_0x565fa3[_0xbcde('0xf')][_0xbcde('0x11')]);return _0x5617fb(_0x565fa3[_0xbcde('0xf')][_0xbcde('0x11')]);}logger['error'](_0xbcde('0xc'),_0x2d49ff,_0x565fa3[_0xbcde('0xf')][_0xbcde('0x11')]);return _0x2b4cf0(_0x565fa3[_0xbcde('0xf')]['message']);}else{logger[_0xbcde('0xb')](_0xbcde('0xc'),_0x2d49ff,_0xbcde('0xe'));_0x2b4cf0(_0x565fa3[_0xbcde('0x12')][_0xbcde('0x11')]);}})[_0xbcde('0x13')](function(_0x5a193d){logger[_0xbcde('0xf')](_0xbcde('0xc'),_0x2d49ff,_0x5a193d);_0x5617fb(_0x5a193d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index eff63d0..f7bd486 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 _0xd994=['show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5e53be,_0x28ffa5){var _0x370496=function(_0x2d8d59){while(--_0x2d8d59){_0x5e53be['push'](_0x5e53be['shift']());}};_0x370496(++_0x28ffa5);}(_0xd994,0xe4));var _0x4d99=function(_0x14d169,_0x22cce4){_0x14d169=_0x14d169-0x0;var _0x4340cf=_0xd994[_0x14d169];return _0x4340cf;};'use strict';var multer=require('multer');var util=require(_0x4d99('0x0'));var path=require(_0x4d99('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d99('0x2'));var router=express[_0x4d99('0x3')]();var fs_extra=require(_0x4d99('0x4'));var auth=require(_0x4d99('0x5'));var interaction=require(_0x4d99('0x6'));var config=require(_0x4d99('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x4d99('0x8')]('/',auth[_0x4d99('0x9')](),controller[_0x4d99('0xa')]);router[_0x4d99('0x8')](_0x4d99('0xb'),auth[_0x4d99('0x9')](),controller[_0x4d99('0xc')]);router[_0x4d99('0x8')](_0x4d99('0xd'),auth[_0x4d99('0x9')](),controller['getConfigurations']);router[_0x4d99('0x8')](_0x4d99('0xe'),auth[_0x4d99('0x9')](),controller[_0x4d99('0xf')]);router[_0x4d99('0x10')]('/',auth[_0x4d99('0x9')](),controller[_0x4d99('0x11')]);router[_0x4d99('0x10')](_0x4d99('0xd'),auth['isAuthenticated'](),controller[_0x4d99('0x12')]);router[_0x4d99('0x13')]('/:id',auth[_0x4d99('0x9')](),controller[_0x4d99('0x14')]);router[_0x4d99('0x15')](_0x4d99('0xb'),auth[_0x4d99('0x9')](),controller[_0x4d99('0x16')]);module[_0x4d99('0x17')]=router; \ No newline at end of file +var _0x3233=['/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller','get','index'];(function(_0x5a4025,_0x4852ef){var _0x68d593=function(_0x531ef8){while(--_0x531ef8){_0x5a4025['push'](_0x5a4025['shift']());}};_0x68d593(++_0x4852ef);}(_0x3233,0x114));var _0x3323=function(_0x5bce9f,_0x515f4e){_0x5bce9f=_0x5bce9f-0x0;var _0x14c6c6=_0x3233[_0x5bce9f];return _0x14c6c6;};'use strict';var multer=require(_0x3323('0x0'));var util=require(_0x3323('0x1'));var path=require(_0x3323('0x2'));var timeout=require('connect-timeout');var express=require(_0x3323('0x3'));var router=express[_0x3323('0x4')]();var fs_extra=require(_0x3323('0x5'));var auth=require(_0x3323('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3323('0x7'));router[_0x3323('0x8')]('/',auth['isAuthenticated'](),controller[_0x3323('0x9')]);router['get'](_0x3323('0xa'),auth[_0x3323('0xb')](),controller[_0x3323('0xc')]);router['get'](_0x3323('0xd'),auth[_0x3323('0xb')](),controller[_0x3323('0xe')]);router['get'](_0x3323('0xf'),auth['isAuthenticated'](),controller[_0x3323('0x10')]);router['post']('/',auth[_0x3323('0xb')](),controller['create']);router[_0x3323('0x11')]('/:id/configurations',auth[_0x3323('0xb')](),controller[_0x3323('0x12')]);router[_0x3323('0x13')](_0x3323('0xa'),auth[_0x3323('0xb')](),controller['update']);router[_0x3323('0x14')](_0x3323('0xa'),auth[_0x3323('0xb')](),controller[_0x3323('0x15')]);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 e30a5d1..1401768 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(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x780496,_0x58c4e8){_0x780496=_0x780496-0x0;var _0x1a24a5=_0xaebd[_0x780496];return _0x1a24a5;};'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 _0x6343=['STRING','remoteUri'];(function(_0x43b9bd,_0x2aae37){var _0x2cc419=function(_0x360402){while(--_0x360402){_0x43b9bd['push'](_0x43b9bd['shift']());}};_0x2cc419(++_0x2aae37);}(_0x6343,0x168));var _0x3634=function(_0xc33195,_0x30fcb4){_0xc33195=_0xc33195-0x0;var _0x2c39f0=_0x6343[_0xc33195];return _0x2c39f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3634('0x0')]},'description':{'type':Sequelize[_0x3634('0x0')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x3634('0x1')},'serverUrl':{'type':Sequelize[_0x3634('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 4de1636..c268816 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 _0xb627=['fs-extra','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','../../components/integrations/configuration','status','offset','limit','count','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','FreshdeskAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','getConfigurations','rawAttributes','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','Subjects','findOne','remoteUri','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','apiKey','toString','base64','subject','agent','description','group','source','ticket_type','company','remove','includes','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x4debc3,_0x565e2e){var _0x3ad977=function(_0x307a05){while(--_0x307a05){_0x4debc3['push'](_0x4debc3['shift']());}};_0x3ad977(++_0x565e2e);}(_0xb627,0x144));var _0x7b62=function(_0x84c968,_0x39024c){_0x84c968=_0x84c968-0x0;var _0x3474cd=_0xb627[_0x84c968];return _0x3474cd;};'use strict';var emlformat=require(_0x7b62('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b62('0x1'));var rp=require('request-promise');var moment=require(_0x7b62('0x2'));var BPromise=require(_0x7b62('0x3'));var Mustache=require(_0x7b62('0x4'));var util=require(_0x7b62('0x5'));var path=require(_0x7b62('0x6'));var sox=require(_0x7b62('0x7'));var csv=require(_0x7b62('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b62('0x9'));var _=require('lodash');var squel=require(_0x7b62('0xa'));var crypto=require(_0x7b62('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b62('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7b62('0xd'));var Papa=require(_0x7b62('0xe'));var Redis=require(_0x7b62('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7b62('0x10'));var as=require(_0x7b62('0x11'));var hardwareService=require(_0x7b62('0x12'));var logger=require(_0x7b62('0x13'))(_0x7b62('0x14'));var utils=require(_0x7b62('0x15'));var config=require(_0x7b62('0x16'));var licenseUtil=require(_0x7b62('0x17'));var db=require(_0x7b62('0x18'))['db'];var integrations=require(_0x7b62('0x19'));function respondWithStatusCode(_0x2559c2,_0x2faaed){_0x2faaed=_0x2faaed||0xcc;return function(_0x413eb4){if(_0x413eb4){return _0x2559c2['sendStatus'](_0x2faaed);}return _0x2559c2[_0x7b62('0x1a')](_0x2faaed)['end']();};}function respondWithResult(_0xf53c12,_0x509d9f){_0x509d9f=_0x509d9f||0xc8;return function(_0x4602aa){if(_0x4602aa){return _0xf53c12['status'](_0x509d9f)['json'](_0x4602aa);}};}function respondWithFilteredResult(_0x38fed5,_0x4a0cdc){return function(_0x3f9afa){if(_0x3f9afa){var _0x44781f=typeof _0x4a0cdc[_0x7b62('0x1b')]==='undefined'&&typeof _0x4a0cdc[_0x7b62('0x1c')]==='undefined';var _0x315198=_0x3f9afa[_0x7b62('0x1d')];var _0x4cc586=_0x44781f?0x0:_0x4a0cdc[_0x7b62('0x1b')];var _0x5d8a48=_0x44781f?_0x3f9afa[_0x7b62('0x1d')]:_0x4a0cdc[_0x7b62('0x1b')]+_0x4a0cdc[_0x7b62('0x1c')];var _0xa3b79b;if(_0x5d8a48>=_0x315198){_0x5d8a48=_0x315198;_0xa3b79b=0xc8;}else{_0xa3b79b=0xce;}_0x38fed5[_0x7b62('0x1a')](_0xa3b79b);return _0x38fed5['set'](_0x7b62('0x1e'),_0x4cc586+'-'+_0x5d8a48+'/'+_0x315198)[_0x7b62('0x1f')](_0x3f9afa);}return null;};}function patchUpdates(_0x429cbb){return function(_0x124287){try{jsonpatch['apply'](_0x124287,_0x429cbb,!![]);}catch(_0x49a81f){return BPromise[_0x7b62('0x20')](_0x49a81f);}return _0x124287[_0x7b62('0x21')]();};}function saveUpdates(_0x136b61,_0x4c9c51){return function(_0x4d79be){if(_0x4d79be){return _0x4d79be[_0x7b62('0x22')](_0x136b61)[_0x7b62('0x23')](function(_0x185457){return _0x185457;});}return null;};}function removeEntity(_0x499f95,_0x498677){return function(_0x5644e0){if(_0x5644e0){return _0x5644e0[_0x7b62('0x24')]()[_0x7b62('0x23')](function(){_0x499f95[_0x7b62('0x1a')](0xcc)[_0x7b62('0x25')]();});}};}function handleEntityNotFound(_0x590089,_0x5144d1){return function(_0x128886){if(!_0x128886){_0x590089[_0x7b62('0x26')](0x194);}return _0x128886;};}function handleError(_0x4dea41,_0x490d68){_0x490d68=_0x490d68||0x1f4;return function(_0x33f7b6){logger[_0x7b62('0x27')](_0x33f7b6[_0x7b62('0x28')]);if(_0x33f7b6[_0x7b62('0x29')]){delete _0x33f7b6[_0x7b62('0x29')];}_0x4dea41[_0x7b62('0x1a')](_0x490d68)['send'](_0x33f7b6);};}exports[_0x7b62('0x2a')]=function(_0x1428c4,_0x5a20fb){var _0x2b4981={},_0x120f10={},_0x5cc467={'count':0x0,'rows':[]};var _0x34af87=_[_0x7b62('0x2b')](db[_0x7b62('0x2c')]['rawAttributes'],function(_0x38ef7a){return{'name':_0x38ef7a[_0x7b62('0x2d')],'type':_0x38ef7a[_0x7b62('0x2e')][_0x7b62('0x2f')]};});_0x120f10[_0x7b62('0x30')]=_[_0x7b62('0x2b')](_0x34af87,_0x7b62('0x29'));_0x120f10[_0x7b62('0x31')]=_[_0x7b62('0x32')](_0x1428c4[_0x7b62('0x31')]);_0x120f10[_0x7b62('0x33')]=_[_0x7b62('0x34')](_0x120f10[_0x7b62('0x30')],_0x120f10['query']);_0x2b4981[_0x7b62('0x35')]=_[_0x7b62('0x34')](_0x120f10[_0x7b62('0x30')],qs[_0x7b62('0x36')](_0x1428c4[_0x7b62('0x31')]['fields']));_0x2b4981['attributes']=_0x2b4981[_0x7b62('0x35')][_0x7b62('0x37')]?_0x2b4981[_0x7b62('0x35')]:_0x120f10['model'];if(!_0x1428c4[_0x7b62('0x31')][_0x7b62('0x38')]('nolimit')){_0x2b4981[_0x7b62('0x1c')]=qs[_0x7b62('0x1c')](_0x1428c4[_0x7b62('0x31')]['limit']);_0x2b4981[_0x7b62('0x1b')]=qs[_0x7b62('0x1b')](_0x1428c4['query'][_0x7b62('0x1b')]);}_0x2b4981[_0x7b62('0x39')]=qs[_0x7b62('0x3a')](_0x1428c4['query'][_0x7b62('0x3a')]);_0x2b4981[_0x7b62('0x3b')]=qs[_0x7b62('0x33')](_[_0x7b62('0x3c')](_0x1428c4[_0x7b62('0x31')],_0x120f10[_0x7b62('0x33')]),_0x34af87);if(_0x1428c4[_0x7b62('0x31')][_0x7b62('0x3d')]){_0x2b4981[_0x7b62('0x3b')]=_[_0x7b62('0x3e')](_0x2b4981[_0x7b62('0x3b')],{'$or':_[_0x7b62('0x2b')](_0x34af87,function(_0x26d12e){if(_0x26d12e[_0x7b62('0x2e')]!==_0x7b62('0x3f')){var _0x25ac52={};_0x25ac52[_0x26d12e[_0x7b62('0x29')]]={'$like':'%'+_0x1428c4[_0x7b62('0x31')][_0x7b62('0x3d')]+'%'};return _0x25ac52;}})});}_0x2b4981=_[_0x7b62('0x3e')]({},_0x2b4981,_0x1428c4[_0x7b62('0x40')]);var _0x4d67a3={'where':_0x2b4981['where']};return db[_0x7b62('0x2c')][_0x7b62('0x1d')](_0x4d67a3)[_0x7b62('0x23')](function(_0x5f29b6){_0x5cc467[_0x7b62('0x1d')]=_0x5f29b6;if(_0x1428c4[_0x7b62('0x31')][_0x7b62('0x41')]){_0x2b4981[_0x7b62('0x42')]=[{'all':!![]}];}return db[_0x7b62('0x2c')]['findAll'](_0x2b4981);})['then'](function(_0x511196){_0x5cc467[_0x7b62('0x43')]=_0x511196;return _0x5cc467;})[_0x7b62('0x23')](respondWithFilteredResult(_0x5a20fb,_0x2b4981))[_0x7b62('0x44')](handleError(_0x5a20fb,null));};exports['show']=function(_0x51f4aa,_0x2cb421){var _0x391975={'raw':![],'where':{'id':_0x51f4aa['params']['id']}},_0x399b81={};_0x399b81[_0x7b62('0x30')]=_[_0x7b62('0x32')](db[_0x7b62('0x2c')]['rawAttributes']);_0x399b81[_0x7b62('0x31')]=_['keys'](_0x51f4aa[_0x7b62('0x31')]);_0x399b81[_0x7b62('0x33')]=_['intersection'](_0x399b81[_0x7b62('0x30')],_0x399b81[_0x7b62('0x31')]);_0x391975[_0x7b62('0x35')]=_['intersection'](_0x399b81[_0x7b62('0x30')],qs['fields'](_0x51f4aa[_0x7b62('0x31')]['fields']));_0x391975[_0x7b62('0x35')]=_0x391975[_0x7b62('0x35')][_0x7b62('0x37')]?_0x391975['attributes']:_0x399b81[_0x7b62('0x30')];if(_0x51f4aa[_0x7b62('0x31')][_0x7b62('0x41')]){_0x391975[_0x7b62('0x42')]=[{'all':!![]}];}_0x391975=_[_0x7b62('0x3e')]({},_0x391975,_0x51f4aa[_0x7b62('0x40')]);return db[_0x7b62('0x2c')][_0x7b62('0x45')](_0x391975)[_0x7b62('0x23')](handleEntityNotFound(_0x2cb421,null))[_0x7b62('0x23')](respondWithResult(_0x2cb421,null))[_0x7b62('0x44')](handleError(_0x2cb421,null));};exports[_0x7b62('0x46')]=function(_0xa56c8c,_0x3708f3){return db[_0x7b62('0x2c')][_0x7b62('0x46')](_0xa56c8c['body'],{})['then'](respondWithResult(_0x3708f3,0xc9))[_0x7b62('0x44')](handleError(_0x3708f3,null));};exports['update']=function(_0x56e1f8,_0x482b8f){if(_0x56e1f8[_0x7b62('0x47')]['id']){delete _0x56e1f8[_0x7b62('0x47')]['id'];}return db[_0x7b62('0x2c')][_0x7b62('0x45')]({'where':{'id':_0x56e1f8['params']['id']}})[_0x7b62('0x23')](handleEntityNotFound(_0x482b8f,null))[_0x7b62('0x23')](saveUpdates(_0x56e1f8[_0x7b62('0x47')],null))['then'](respondWithResult(_0x482b8f,null))['catch'](handleError(_0x482b8f,null));};exports['destroy']=function(_0x42e480,_0x2fcc38){return db[_0x7b62('0x2c')][_0x7b62('0x45')]({'where':{'id':_0x42e480[_0x7b62('0x48')]['id']}})[_0x7b62('0x23')](handleEntityNotFound(_0x2fcc38,null))[_0x7b62('0x23')](removeEntity(_0x2fcc38,null))[_0x7b62('0x44')](handleError(_0x2fcc38,null));};exports[_0x7b62('0x49')]=function(_0x100a83,_0x4c1359,_0x22204b){var _0x58cc2e={};var _0x2313e2={};var _0x13c7eb;var _0x39d087;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x100a83['params']['id']}})[_0x7b62('0x23')](handleEntityNotFound(_0x4c1359,null))[_0x7b62('0x23')](function(_0x281b6f){if(_0x281b6f){_0x13c7eb=_0x281b6f;_0x2313e2[_0x7b62('0x30')]=_[_0x7b62('0x32')](db['FreshdeskConfiguration'][_0x7b62('0x4a')]);_0x2313e2[_0x7b62('0x31')]=_[_0x7b62('0x32')](_0x100a83[_0x7b62('0x31')]);_0x2313e2['filters']=_[_0x7b62('0x34')](_0x2313e2[_0x7b62('0x30')],_0x2313e2[_0x7b62('0x31')]);_0x58cc2e[_0x7b62('0x35')]=_[_0x7b62('0x34')](_0x2313e2[_0x7b62('0x30')],qs[_0x7b62('0x36')](_0x100a83[_0x7b62('0x31')][_0x7b62('0x36')]));_0x58cc2e['attributes']=_0x58cc2e['attributes']['length']?_0x58cc2e[_0x7b62('0x35')]:_0x2313e2[_0x7b62('0x30')];_0x58cc2e['order']=qs[_0x7b62('0x3a')](_0x100a83[_0x7b62('0x31')][_0x7b62('0x3a')]);_0x58cc2e[_0x7b62('0x3b')]=qs[_0x7b62('0x33')](_[_0x7b62('0x3c')](_0x100a83[_0x7b62('0x31')],_0x2313e2['filters']));if(_0x100a83[_0x7b62('0x31')][_0x7b62('0x3d')]){_0x58cc2e[_0x7b62('0x3b')]=_[_0x7b62('0x3e')](_0x58cc2e[_0x7b62('0x3b')],{'$or':_[_0x7b62('0x2b')](_0x58cc2e[_0x7b62('0x35')],function(_0x4bfa05){var _0x48928d={};_0x48928d[_0x4bfa05]={'$like':'%'+_0x100a83[_0x7b62('0x31')][_0x7b62('0x3d')]+'%'};return _0x48928d;})});}_0x58cc2e=_[_0x7b62('0x3e')]({},_0x58cc2e,_0x100a83['options']);return _0x13c7eb[_0x7b62('0x49')](_0x58cc2e);}})[_0x7b62('0x23')](function(_0x171108){if(_0x171108){_0x39d087=_0x171108['length'];if(!_0x100a83['query'][_0x7b62('0x38')](_0x7b62('0x4b'))){_0x58cc2e['limit']=qs[_0x7b62('0x1c')](_0x100a83[_0x7b62('0x31')][_0x7b62('0x1c')]);_0x58cc2e['offset']=qs[_0x7b62('0x1b')](_0x100a83['query'][_0x7b62('0x1b')]);}return _0x13c7eb[_0x7b62('0x49')](_0x58cc2e);}})[_0x7b62('0x23')](function(_0x345b7f){if(_0x345b7f){return _0x345b7f?{'count':_0x39d087,'rows':_0x345b7f}:null;}})[_0x7b62('0x23')](respondWithResult(_0x4c1359,null))[_0x7b62('0x44')](handleError(_0x4c1359,null));};exports[_0x7b62('0x4c')]=function(_0x38e5f4,_0x87759a,_0x2062c8){if(_0x38e5f4[_0x7b62('0x47')]['id']){delete _0x38e5f4[_0x7b62('0x47')]['id'];}return db[_0x7b62('0x2c')]['findOne']({'where':{'id':_0x38e5f4[_0x7b62('0x48')]['id']}})[_0x7b62('0x23')](handleEntityNotFound(_0x87759a,null))[_0x7b62('0x23')](function(_0x53f467){if(_0x53f467){_0x38e5f4['body'][_0x7b62('0x4d')]=_0x53f467['id'];_0x38e5f4['body']['Subjects']=integrations[_0x7b62('0x4e')](_0x38e5f4[_0x7b62('0x47')][_0x7b62('0x4f')],_0x38e5f4[_0x7b62('0x47')][_0x7b62('0x2e')]);_0x38e5f4[_0x7b62('0x47')][_0x7b62('0x50')]=integrations[_0x7b62('0x51')](_0x38e5f4[_0x7b62('0x47')][_0x7b62('0x4f')],_0x38e5f4[_0x7b62('0x47')][_0x7b62('0x2e')]);return db['FreshdeskConfiguration'][_0x7b62('0x46')](_0x38e5f4['body'],{'include':[{'model':db[_0x7b62('0x52')],'as':_0x7b62('0x53')},{'model':db['FreshdeskField'],'as':_0x7b62('0x50')}]});}return null;})['then'](respondWithResult(_0x87759a,null))[_0x7b62('0x44')](handleError(_0x87759a,null));};exports['getFields']=function(_0xf98f04,_0xd58cea,_0x4ceff7){var _0x102722='';return db[_0x7b62('0x2c')][_0x7b62('0x54')]({'where':{'id':_0xf98f04[_0x7b62('0x48')]['id']},'attributes':['id',_0x7b62('0x55'),'apiKey']})[_0x7b62('0x23')](handleEntityNotFound(_0xd58cea,null))[_0x7b62('0x23')](function(_0x5ea45c){if(_0x5ea45c){_0x102722=_0x5ea45c[_0x7b62('0x55')];var _0x2c1e73=_0x102722[_0x7b62('0x56')](-0x1);if(_0x2c1e73==='/'){_0x102722=_0x102722['substring'](0x0,_0x102722[_0x7b62('0x57')](_0x2c1e73));}return rp({'method':_0x7b62('0x58'),'uri':util[_0x7b62('0x59')](_0x7b62('0x5a'),_0x102722,_0x7b62('0x5b')),'headers':{'Authorization':util[_0x7b62('0x59')]('Basic\x20%s',new Buffer(util[_0x7b62('0x59')]('%s:X',_0x5ea45c[_0x7b62('0x5c')]))[_0x7b62('0x5d')](_0x7b62('0x5e')))},'json':!![]});}})[_0x7b62('0x23')](function(_0x34e33f){if(_0x34e33f){var _0x4330b0=['requester',_0x7b62('0x5f'),_0x7b62('0x60'),_0x7b62('0x61'),_0x7b62('0x1a'),'priority',_0x7b62('0x62'),_0x7b62('0x63'),_0x7b62('0x64'),_0x7b62('0x62'),_0x7b62('0x65')];_[_0x7b62('0x66')](_0x34e33f,function(_0x52cc4d){return _0x4330b0[_0x7b62('0x67')](_0x52cc4d[_0x7b62('0x29')])||!_0x52cc4d['default']&&_0x52cc4d[_0x7b62('0x2e')]!=='custom_text'&&_0x52cc4d['type']!==_0x7b62('0x68');});return{'count':_0x34e33f['length'],'rows':_[_0x7b62('0x2b')](_0x34e33f,function(_0x3b5635){return{'id':_0x3b5635[_0x7b62('0x29')],'name':_0x3b5635[_0x7b62('0x69')],'custom':!_0x3b5635['default'],'options':_0x3b5635[_0x7b62('0x6a')]?_[_0x7b62('0x2b')](_0x3b5635[_0x7b62('0x6a')],function(_0x12c371){return{'name':_['capitalize'](_0x12c371),'value':_0x12c371};}):[]};})};}})[_0x7b62('0x23')](respondWithResult(_0xd58cea,null))[_0x7b62('0x44')](function(_0x28fd98){var _0x27ee8f=_0xf98f04[_0x7b62('0x31')]['test']?0x1f4:_0x28fd98[_0x7b62('0x6b')]||0x1f4;logger[_0x7b62('0x27')](_0x7b62('0x6c'),_0x7b62('0x6d'),_0x27ee8f,JSON['stringify'](_0x28fd98));delete _0x28fd98['name'];if(_0x27ee8f===0x191){_0x27ee8f=0x190;}_0xd58cea['status'](_0x27ee8f)[_0x7b62('0x6e')](_0xf98f04['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x28fd98[_0x7b62('0x6b')]}:_0x28fd98);});}; \ No newline at end of file +var _0x5106=['intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshdeskField','getFields','remoteUri','slice','format','%s/%s','Basic\x20%s','%s:X','apiKey','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','offset','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x52e3e1,_0x162593){var _0x6a241f=function(_0x17b505){while(--_0x17b505){_0x52e3e1['push'](_0x52e3e1['shift']());}};_0x6a241f(++_0x162593);}(_0x5106,0x116));var _0x6510=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5106[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x6510('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6510('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6510('0x2'));var moment=require(_0x6510('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6510('0x4'));var path=require(_0x6510('0x5'));var sox=require(_0x6510('0x6'));var csv=require(_0x6510('0x7'));var ejs=require(_0x6510('0x8'));var fs=require('fs');var fs_extra=require(_0x6510('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6510('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6510('0x7'));var querystring=require('querystring');var Papa=require(_0x6510('0xb'));var Redis=require(_0x6510('0xc'));var authService=require(_0x6510('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6510('0xe'));var logger=require(_0x6510('0xf'))(_0x6510('0x10'));var utils=require(_0x6510('0x11'));var config=require(_0x6510('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6510('0x13'))['db'];var integrations=require(_0x6510('0x14'));function respondWithStatusCode(_0x1b78a8,_0xa4ee91){_0xa4ee91=_0xa4ee91||0xcc;return function(_0x197aed){if(_0x197aed){return _0x1b78a8['sendStatus'](_0xa4ee91);}return _0x1b78a8['status'](_0xa4ee91)[_0x6510('0x15')]();};}function respondWithResult(_0x11d86f,_0x2961d7){_0x2961d7=_0x2961d7||0xc8;return function(_0x17f40f){if(_0x17f40f){return _0x11d86f[_0x6510('0x16')](_0x2961d7)['json'](_0x17f40f);}};}function respondWithFilteredResult(_0x4cf143,_0x414557){return function(_0x423eda){if(_0x423eda){var _0x1c9dce=typeof _0x414557[_0x6510('0x17')]==='undefined'&&typeof _0x414557[_0x6510('0x18')]==='undefined';var _0x511579=_0x423eda[_0x6510('0x19')];var _0x47743b=_0x1c9dce?0x0:_0x414557[_0x6510('0x17')];var _0x506fd6=_0x1c9dce?_0x423eda[_0x6510('0x19')]:_0x414557[_0x6510('0x17')]+_0x414557['limit'];var _0x817dc7;if(_0x506fd6>=_0x511579){_0x506fd6=_0x511579;_0x817dc7=0xc8;}else{_0x817dc7=0xce;}_0x4cf143[_0x6510('0x16')](_0x817dc7);return _0x4cf143[_0x6510('0x1a')](_0x6510('0x1b'),_0x47743b+'-'+_0x506fd6+'/'+_0x511579)[_0x6510('0x1c')](_0x423eda);}return null;};}function patchUpdates(_0x508ed2){return function(_0x47f309){try{jsonpatch[_0x6510('0x1d')](_0x47f309,_0x508ed2,!![]);}catch(_0x524cc2){return BPromise[_0x6510('0x1e')](_0x524cc2);}return _0x47f309['save']();};}function saveUpdates(_0x1dfe6d,_0x36da2f){return function(_0x540cd9){if(_0x540cd9){return _0x540cd9[_0x6510('0x1f')](_0x1dfe6d)[_0x6510('0x20')](function(_0xddadae){return _0xddadae;});}return null;};}function removeEntity(_0x26903b,_0x4244d9){return function(_0x4feb7d){if(_0x4feb7d){return _0x4feb7d[_0x6510('0x21')]()[_0x6510('0x20')](function(){_0x26903b['status'](0xcc)[_0x6510('0x15')]();});}};}function handleEntityNotFound(_0x11b2d0,_0x5541f7){return function(_0x13fda4){if(!_0x13fda4){_0x11b2d0[_0x6510('0x22')](0x194);}return _0x13fda4;};}function handleError(_0xbf79b1,_0x2ef918){_0x2ef918=_0x2ef918||0x1f4;return function(_0x375dc4){logger[_0x6510('0x23')](_0x375dc4[_0x6510('0x24')]);if(_0x375dc4['name']){delete _0x375dc4[_0x6510('0x25')];}_0xbf79b1[_0x6510('0x16')](_0x2ef918)[_0x6510('0x26')](_0x375dc4);};}exports[_0x6510('0x27')]=function(_0x37410a,_0x42b81c){var _0x27757d={},_0x4876d3={},_0xf631dc={'count':0x0,'rows':[]};var _0x515c83=_['map'](db[_0x6510('0x28')][_0x6510('0x29')],function(_0x59561e){return{'name':_0x59561e[_0x6510('0x2a')],'type':_0x59561e[_0x6510('0x2b')][_0x6510('0x2c')]};});_0x4876d3[_0x6510('0x2d')]=_[_0x6510('0x2e')](_0x515c83,_0x6510('0x25'));_0x4876d3[_0x6510('0x2f')]=_[_0x6510('0x30')](_0x37410a[_0x6510('0x2f')]);_0x4876d3['filters']=_['intersection'](_0x4876d3['model'],_0x4876d3[_0x6510('0x2f')]);_0x27757d['attributes']=_[_0x6510('0x31')](_0x4876d3[_0x6510('0x2d')],qs[_0x6510('0x32')](_0x37410a['query'][_0x6510('0x32')]));_0x27757d[_0x6510('0x33')]=_0x27757d[_0x6510('0x33')][_0x6510('0x34')]?_0x27757d[_0x6510('0x33')]:_0x4876d3['model'];if(!_0x37410a[_0x6510('0x2f')][_0x6510('0x35')](_0x6510('0x36'))){_0x27757d['limit']=qs['limit'](_0x37410a[_0x6510('0x2f')][_0x6510('0x18')]);_0x27757d[_0x6510('0x17')]=qs[_0x6510('0x17')](_0x37410a[_0x6510('0x2f')]['offset']);}_0x27757d['order']=qs[_0x6510('0x37')](_0x37410a[_0x6510('0x2f')][_0x6510('0x37')]);_0x27757d['where']=qs[_0x6510('0x38')](_[_0x6510('0x39')](_0x37410a['query'],_0x4876d3[_0x6510('0x38')]),_0x515c83);if(_0x37410a['query']['filter']){_0x27757d['where']=_[_0x6510('0x3a')](_0x27757d[_0x6510('0x3b')],{'$or':_['map'](_0x515c83,function(_0x3f08b8){if(_0x3f08b8[_0x6510('0x2b')]!==_0x6510('0x3c')){var _0x600523={};_0x600523[_0x3f08b8[_0x6510('0x25')]]={'$like':'%'+_0x37410a['query'][_0x6510('0x3d')]+'%'};return _0x600523;}})});}_0x27757d=_[_0x6510('0x3a')]({},_0x27757d,_0x37410a[_0x6510('0x3e')]);var _0x16c05c={'where':_0x27757d[_0x6510('0x3b')]};return db[_0x6510('0x28')][_0x6510('0x19')](_0x16c05c)[_0x6510('0x20')](function(_0x3187d8){_0xf631dc[_0x6510('0x19')]=_0x3187d8;if(_0x37410a[_0x6510('0x2f')][_0x6510('0x3f')]){_0x27757d[_0x6510('0x40')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x6510('0x41')](_0x27757d);})[_0x6510('0x20')](function(_0x2bc17e){_0xf631dc[_0x6510('0x42')]=_0x2bc17e;return _0xf631dc;})[_0x6510('0x20')](respondWithFilteredResult(_0x42b81c,_0x27757d))[_0x6510('0x43')](handleError(_0x42b81c,null));};exports['show']=function(_0x4ecdef,_0x26c2ee){var _0x4924ef={'raw':![],'where':{'id':_0x4ecdef[_0x6510('0x44')]['id']}},_0x4c7369={};_0x4c7369['model']=_[_0x6510('0x30')](db[_0x6510('0x28')]['rawAttributes']);_0x4c7369[_0x6510('0x2f')]=_[_0x6510('0x30')](_0x4ecdef['query']);_0x4c7369[_0x6510('0x38')]=_[_0x6510('0x31')](_0x4c7369[_0x6510('0x2d')],_0x4c7369['query']);_0x4924ef[_0x6510('0x33')]=_[_0x6510('0x31')](_0x4c7369[_0x6510('0x2d')],qs[_0x6510('0x32')](_0x4ecdef[_0x6510('0x2f')][_0x6510('0x32')]));_0x4924ef['attributes']=_0x4924ef['attributes'][_0x6510('0x34')]?_0x4924ef[_0x6510('0x33')]:_0x4c7369[_0x6510('0x2d')];if(_0x4ecdef['query'][_0x6510('0x3f')]){_0x4924ef[_0x6510('0x40')]=[{'all':!![]}];}_0x4924ef=_['merge']({},_0x4924ef,_0x4ecdef[_0x6510('0x3e')]);return db[_0x6510('0x28')]['find'](_0x4924ef)[_0x6510('0x20')](handleEntityNotFound(_0x26c2ee,null))['then'](respondWithResult(_0x26c2ee,null))['catch'](handleError(_0x26c2ee,null));};exports[_0x6510('0x45')]=function(_0x286ea6,_0x19bb62){return db['FreshdeskAccount'][_0x6510('0x45')](_0x286ea6[_0x6510('0x46')],{})['then'](respondWithResult(_0x19bb62,0xc9))['catch'](handleError(_0x19bb62,null));};exports[_0x6510('0x1f')]=function(_0x3cefde,_0x2b45a7){if(_0x3cefde[_0x6510('0x46')]['id']){delete _0x3cefde[_0x6510('0x46')]['id'];}return db[_0x6510('0x28')]['find']({'where':{'id':_0x3cefde[_0x6510('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b45a7,null))[_0x6510('0x20')](saveUpdates(_0x3cefde[_0x6510('0x46')],null))[_0x6510('0x20')](respondWithResult(_0x2b45a7,null))['catch'](handleError(_0x2b45a7,null));};exports['destroy']=function(_0x2f796e,_0x4a2e8c){return db['FreshdeskAccount']['find']({'where':{'id':_0x2f796e[_0x6510('0x44')]['id']}})[_0x6510('0x20')](handleEntityNotFound(_0x4a2e8c,null))[_0x6510('0x20')](removeEntity(_0x4a2e8c,null))['catch'](handleError(_0x4a2e8c,null));};exports[_0x6510('0x47')]=function(_0x2a0314,_0x2eeaf4,_0x2378e6){var _0x1fc7aa={};var _0x431b42={};var _0x24b9cd;var _0x527168;return db[_0x6510('0x28')][_0x6510('0x48')]({'where':{'id':_0x2a0314[_0x6510('0x44')]['id']}})[_0x6510('0x20')](handleEntityNotFound(_0x2eeaf4,null))['then'](function(_0x580b4a){if(_0x580b4a){_0x24b9cd=_0x580b4a;_0x431b42[_0x6510('0x2d')]=_['keys'](db[_0x6510('0x49')][_0x6510('0x29')]);_0x431b42[_0x6510('0x2f')]=_[_0x6510('0x30')](_0x2a0314[_0x6510('0x2f')]);_0x431b42['filters']=_['intersection'](_0x431b42['model'],_0x431b42[_0x6510('0x2f')]);_0x1fc7aa[_0x6510('0x33')]=_[_0x6510('0x31')](_0x431b42['model'],qs[_0x6510('0x32')](_0x2a0314[_0x6510('0x2f')][_0x6510('0x32')]));_0x1fc7aa[_0x6510('0x33')]=_0x1fc7aa['attributes']['length']?_0x1fc7aa['attributes']:_0x431b42[_0x6510('0x2d')];_0x1fc7aa['order']=qs['sort'](_0x2a0314['query'][_0x6510('0x37')]);_0x1fc7aa[_0x6510('0x3b')]=qs[_0x6510('0x38')](_[_0x6510('0x39')](_0x2a0314[_0x6510('0x2f')],_0x431b42[_0x6510('0x38')]));if(_0x2a0314['query'][_0x6510('0x3d')]){_0x1fc7aa[_0x6510('0x3b')]=_[_0x6510('0x3a')](_0x1fc7aa['where'],{'$or':_[_0x6510('0x2e')](_0x1fc7aa[_0x6510('0x33')],function(_0x4c6c2d){var _0x1fc1da={};_0x1fc1da[_0x4c6c2d]={'$like':'%'+_0x2a0314[_0x6510('0x2f')][_0x6510('0x3d')]+'%'};return _0x1fc1da;})});}_0x1fc7aa=_[_0x6510('0x3a')]({},_0x1fc7aa,_0x2a0314[_0x6510('0x3e')]);return _0x24b9cd['getConfigurations'](_0x1fc7aa);}})[_0x6510('0x20')](function(_0x1a884f){if(_0x1a884f){_0x527168=_0x1a884f[_0x6510('0x34')];if(!_0x2a0314[_0x6510('0x2f')]['hasOwnProperty'](_0x6510('0x36'))){_0x1fc7aa[_0x6510('0x18')]=qs[_0x6510('0x18')](_0x2a0314[_0x6510('0x2f')][_0x6510('0x18')]);_0x1fc7aa[_0x6510('0x17')]=qs[_0x6510('0x17')](_0x2a0314[_0x6510('0x2f')][_0x6510('0x17')]);}return _0x24b9cd[_0x6510('0x47')](_0x1fc7aa);}})[_0x6510('0x20')](function(_0x4ef4d6){if(_0x4ef4d6){return _0x4ef4d6?{'count':_0x527168,'rows':_0x4ef4d6}:null;}})[_0x6510('0x20')](respondWithResult(_0x2eeaf4,null))[_0x6510('0x43')](handleError(_0x2eeaf4,null));};exports[_0x6510('0x4a')]=function(_0x343b4d,_0x582110,_0xadfcd7){if(_0x343b4d['body']['id']){delete _0x343b4d[_0x6510('0x46')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x343b4d['params']['id']}})[_0x6510('0x20')](handleEntityNotFound(_0x582110,null))[_0x6510('0x20')](function(_0x1c8ee3){if(_0x1c8ee3){_0x343b4d[_0x6510('0x46')]['AccountId']=_0x1c8ee3['id'];_0x343b4d['body']['Subjects']=integrations[_0x6510('0x4b')](_0x343b4d['body'][_0x6510('0x4c')],_0x343b4d['body'][_0x6510('0x2b')]);_0x343b4d[_0x6510('0x46')][_0x6510('0x4d')]=integrations[_0x6510('0x4e')](_0x343b4d['body'][_0x6510('0x4c')],_0x343b4d[_0x6510('0x46')][_0x6510('0x2b')]);return db[_0x6510('0x49')]['create'](_0x343b4d[_0x6510('0x46')],{'include':[{'model':db['FreshdeskField'],'as':_0x6510('0x4f')},{'model':db[_0x6510('0x50')],'as':_0x6510('0x4d')}]});}return null;})[_0x6510('0x20')](respondWithResult(_0x582110,null))[_0x6510('0x43')](handleError(_0x582110,null));};exports[_0x6510('0x51')]=function(_0x51ef2b,_0x139607,_0x9af998){var _0xe21afd='';return db[_0x6510('0x28')][_0x6510('0x48')]({'where':{'id':_0x51ef2b[_0x6510('0x44')]['id']},'attributes':['id',_0x6510('0x52'),'apiKey']})[_0x6510('0x20')](handleEntityNotFound(_0x139607,null))[_0x6510('0x20')](function(_0x468aee){if(_0x468aee){_0xe21afd=_0x468aee['remoteUri'];var _0x3901bd=_0xe21afd[_0x6510('0x53')](-0x1);if(_0x3901bd==='/'){_0xe21afd=_0xe21afd['substring'](0x0,_0xe21afd['lastIndexOf'](_0x3901bd));}return rp({'method':'GET','uri':util[_0x6510('0x54')](_0x6510('0x55'),_0xe21afd,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x6510('0x54')](_0x6510('0x56'),new Buffer(util[_0x6510('0x54')](_0x6510('0x57'),_0x468aee[_0x6510('0x58')]))['toString'](_0x6510('0x59')))},'json':!![]});}})[_0x6510('0x20')](function(_0x1b772f){if(_0x1b772f){var _0x282b93=['requester',_0x6510('0x5a'),_0x6510('0x5b'),_0x6510('0x5c'),'status',_0x6510('0x5d'),_0x6510('0x5e'),_0x6510('0x5f'),_0x6510('0x60'),_0x6510('0x5e'),_0x6510('0x61')];_[_0x6510('0x62')](_0x1b772f,function(_0x569c58){return _0x282b93['includes'](_0x569c58[_0x6510('0x25')])||!_0x569c58[_0x6510('0x63')]&&_0x569c58['type']!=='custom_text'&&_0x569c58[_0x6510('0x2b')]!==_0x6510('0x64');});return{'count':_0x1b772f[_0x6510('0x34')],'rows':_[_0x6510('0x2e')](_0x1b772f,function(_0x322671){return{'id':_0x322671['name'],'name':_0x322671[_0x6510('0x65')],'custom':!_0x322671[_0x6510('0x63')],'options':_0x322671[_0x6510('0x66')]?_[_0x6510('0x2e')](_0x322671[_0x6510('0x66')],function(_0x32df2c){return{'name':_[_0x6510('0x67')](_0x32df2c),'value':_0x32df2c};}):[]};})};}})[_0x6510('0x20')](respondWithResult(_0x139607,null))['catch'](function(_0x18f27c){var _0x44fd97=_0x51ef2b[_0x6510('0x2f')][_0x6510('0x68')]?0x1f4:_0x18f27c[_0x6510('0x69')]||0x1f4;logger['error'](_0x6510('0x6a'),_0x6510('0x51'),_0x44fd97,JSON[_0x6510('0x6b')](_0x18f27c));delete _0x18f27c[_0x6510('0x25')];if(_0x44fd97===0x191){_0x44fd97=0x190;}_0x139607[_0x6510('0x16')](_0x44fd97)[_0x6510('0x26')](_0x51ef2b['query']['test']?{'message':_0x6510('0x6c'),'statusCode':_0x18f27c[_0x6510('0x69')]}:_0x18f27c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index a9c6df5..4864ad8 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 _0xd373=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x2b197c,_0x4252e7){var _0x33abb1=function(_0x48933a){while(--_0x48933a){_0x2b197c['push'](_0x2b197c['shift']());}};_0x33abb1(++_0x4252e7);}(_0xd373,0x16e));var _0x3d37=function(_0x22acdf,_0x43e1b1){_0x22acdf=_0x22acdf-0x0;var _0x1d8b62=_0xd373[_0x22acdf];return _0x1d8b62;};'use strict';var _=require('lodash');var util=require(_0x3d37('0x0'));var logger=require(_0x3d37('0x1'))('api');var moment=require(_0x3d37('0x2'));var BPromise=require(_0x3d37('0x3'));var rp=require(_0x3d37('0x4'));var fs=require('fs');var path=require(_0x3d37('0x5'));var rimraf=require(_0x3d37('0x6'));var config=require(_0x3d37('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x3d37('0x8'));module[_0x3d37('0x9')]=function(_0x3e7976,_0x6ecf61){return _0x3e7976[_0x3d37('0xa')](_0x3d37('0xb'),attributes,{'tableName':_0x3d37('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b15=['bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','int_freshdesk_accounts','../../config/logger','api'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x6b15,0xbc));var _0x56b1=function(_0x304a16,_0x7c6389){_0x304a16=_0x304a16-0x0;var _0x2dc036=_0x6b15[_0x304a16];return _0x2dc036;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x56b1('0x0'))(_0x56b1('0x1'));var moment=require('moment');var BPromise=require(_0x56b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56b1('0x3'));var rimraf=require(_0x56b1('0x4'));var config=require(_0x56b1('0x5'));var attributes=require(_0x56b1('0x6'));var integrations=require(_0x56b1('0x7'));module[_0x56b1('0x8')]=function(_0x118764,_0x413d3d){return _0x118764['define']('FreshdeskAccount',attributes,{'tableName':_0x56b1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index a39ec5f..0e4e552 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 _0xd58d=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','request','then','request\x20sent','debug','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes','limit','map','include','model','info','ShowFreshdeskAccount','find','where'];(function(_0xf5f074,_0x37ce9e){var _0x87ab9f=function(_0x353b5e){while(--_0x353b5e){_0xf5f074['push'](_0xf5f074['shift']());}};_0x87ab9f(++_0x37ce9e);}(_0xd58d,0x176));var _0xdd58=function(_0xd08d76,_0x4f33ac){_0xd08d76=_0xd08d76-0x0;var _0xba4771=_0xd58d[_0xd08d76];return _0xba4771;};'use strict';var _=require(_0xdd58('0x0'));var util=require(_0xdd58('0x1'));var moment=require(_0xdd58('0x2'));var BPromise=require(_0xdd58('0x3'));var rs=require(_0xdd58('0x4'));var fs=require('fs');var Redis=require(_0xdd58('0x5'));var db=require(_0xdd58('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd58('0x7'))(_0xdd58('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53b0f1,_0x15f4d7,_0x4b83a6){return new BPromise(function(_0x5f5176,_0x2c0e26){return client[_0xdd58('0x9')](_0x53b0f1,_0x4b83a6)[_0xdd58('0xa')](function(_0x32d5bd){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x15f4d7,_0xdd58('0xb'));logger[_0xdd58('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x15f4d7,_0xdd58('0xb'),JSON[_0xdd58('0xd')](_0x32d5bd));if(_0x32d5bd[_0xdd58('0xe')]){if(_0x32d5bd[_0xdd58('0xe')][_0xdd58('0xf')]===0x1f4){logger[_0xdd58('0xe')](_0xdd58('0x10'),_0x15f4d7,_0x32d5bd[_0xdd58('0xe')][_0xdd58('0x11')]);return _0x2c0e26(_0x32d5bd[_0xdd58('0xe')][_0xdd58('0x11')]);}logger['error'](_0xdd58('0x10'),_0x15f4d7,_0x32d5bd[_0xdd58('0xe')][_0xdd58('0x11')]);return _0x5f5176(_0x32d5bd[_0xdd58('0xe')][_0xdd58('0x11')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x15f4d7,_0xdd58('0xb'));_0x5f5176(_0x32d5bd[_0xdd58('0x12')][_0xdd58('0x11')]);}})[_0xdd58('0x13')](function(_0xb41f3a){logger['error'](_0xdd58('0x10'),_0x15f4d7,_0xb41f3a);_0x2c0e26(_0xb41f3a);});});}exports[_0xdd58('0x14')]=function(_0x329990){var _0x59d571=this;return new Promise(function(_0x31f584,_0x39b46e){return db[_0xdd58('0x15')][_0xdd58('0x16')]({'raw':_0x329990['options']?_0x329990[_0xdd58('0x17')][_0xdd58('0x18')]===undefined?!![]:![]:!![],'where':_0x329990[_0xdd58('0x17')]?_0x329990[_0xdd58('0x17')]['where']||null:null,'attributes':_0x329990[_0xdd58('0x17')]?_0x329990[_0xdd58('0x17')][_0xdd58('0x19')]||null:null,'limit':_0x329990[_0xdd58('0x17')]?_0x329990[_0xdd58('0x17')][_0xdd58('0x1a')]||null:null,'include':_0x329990[_0xdd58('0x17')]?_0x329990[_0xdd58('0x17')]['include']?_[_0xdd58('0x1b')](_0x329990[_0xdd58('0x17')][_0xdd58('0x1c')],function(_0x5f4c3e){return{'model':db[_0x5f4c3e[_0xdd58('0x1d')]],'as':_0x5f4c3e['as'],'attributes':_0x5f4c3e[_0xdd58('0x19')],'include':_0x5f4c3e[_0xdd58('0x1c')]?_[_0xdd58('0x1b')](_0x5f4c3e[_0xdd58('0x1c')],function(_0x5eea7f){return{'model':db[_0x5eea7f['model']],'as':_0x5eea7f['as'],'attributes':_0x5eea7f[_0xdd58('0x19')],'include':_0x5eea7f[_0xdd58('0x1c')]?_[_0xdd58('0x1b')](_0x5eea7f['include'],function(_0x3bc57b){return{'model':db[_0x3bc57b[_0xdd58('0x1d')]],'as':_0x3bc57b['as'],'attributes':_0x3bc57b[_0xdd58('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdd58('0xa')](function(_0xca7879){logger[_0xdd58('0x1e')]('GetFreshdeskAccount',_0x329990);logger[_0xdd58('0xc')](_0xdd58('0x14'),_0x329990,JSON[_0xdd58('0xd')](_0xca7879));_0x31f584(_0xca7879);})['catch'](function(_0x1c50e9){logger[_0xdd58('0xe')]('GetFreshdeskAccount',_0x1c50e9[_0xdd58('0x11')],_0x329990);_0x39b46e(_0x59d571[_0xdd58('0xe')](0x1f4,_0x1c50e9[_0xdd58('0x11')]));});});};exports[_0xdd58('0x1f')]=function(_0x735e7c){var _0x251c76=this;return new Promise(function(_0x332630,_0x2aa8c4){return db[_0xdd58('0x15')][_0xdd58('0x20')]({'raw':_0x735e7c[_0xdd58('0x17')]?_0x735e7c['options'][_0xdd58('0x18')]===undefined?!![]:![]:!![],'where':_0x735e7c[_0xdd58('0x17')]?_0x735e7c[_0xdd58('0x17')][_0xdd58('0x21')]||null:null,'attributes':_0x735e7c[_0xdd58('0x17')]?_0x735e7c['options'][_0xdd58('0x19')]||null:null,'include':_0x735e7c['options']?_0x735e7c[_0xdd58('0x17')][_0xdd58('0x1c')]?_[_0xdd58('0x1b')](_0x735e7c['options'][_0xdd58('0x1c')],function(_0x3f2bd0){return{'model':db[_0x3f2bd0[_0xdd58('0x1d')]],'as':_0x3f2bd0['as'],'attributes':_0x3f2bd0[_0xdd58('0x19')],'include':_0x3f2bd0['include']?_['map'](_0x3f2bd0[_0xdd58('0x1c')],function(_0x3e2507){return{'model':db[_0x3e2507[_0xdd58('0x1d')]],'as':_0x3e2507['as'],'attributes':_0x3e2507[_0xdd58('0x19')],'include':_0x3e2507['include']?_[_0xdd58('0x1b')](_0x3e2507[_0xdd58('0x1c')],function(_0x622a84){return{'model':db[_0x622a84[_0xdd58('0x1d')]],'as':_0x622a84['as'],'attributes':_0x622a84[_0xdd58('0x19')]};}):[]};}):[]};}):[]:[]})[_0xdd58('0xa')](function(_0x204201){logger[_0xdd58('0x1e')]('ShowFreshdeskAccount',_0x735e7c);logger[_0xdd58('0xc')](_0xdd58('0x1f'),_0x735e7c,JSON[_0xdd58('0xd')](_0x204201));_0x332630(_0x204201);})[_0xdd58('0x13')](function(_0x31e842){logger[_0xdd58('0xe')](_0xdd58('0x1f'),_0x31e842['message'],_0x735e7c);_0x2aa8c4(_0x251c76[_0xdd58('0xe')](0x1f4,_0x31e842[_0xdd58('0x11')]));});});}; \ No newline at end of file +var _0x9dfe=['map','model','catch','ShowFreshdeskAccount','find','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9dfe,0x105));var _0xe9df=function(_0x2ab218,_0x53009e){_0x2ab218=_0x2ab218-0x0;var _0x23a15b=_0x9dfe[_0x2ab218];return _0x23a15b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9df('0x0'));var BPromise=require('bluebird');var rs=require(_0xe9df('0x1'));var fs=require('fs');var Redis=require(_0xe9df('0x2'));var db=require(_0xe9df('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9df('0x4'))(_0xe9df('0x5'));var config=require(_0xe9df('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe9df('0x7')][_0xe9df('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10d94d,_0x4313ee,_0x278e3f){return new BPromise(function(_0x2bdcf3,_0x273cde){return client['request'](_0x10d94d,_0x278e3f)[_0xe9df('0x9')](function(_0x29b493){logger[_0xe9df('0xa')](_0xe9df('0xb'),_0x4313ee,_0xe9df('0xc'));logger[_0xe9df('0xd')](_0xe9df('0xe'),_0x4313ee,_0xe9df('0xc'),JSON[_0xe9df('0xf')](_0x29b493));if(_0x29b493[_0xe9df('0x10')]){if(_0x29b493[_0xe9df('0x10')][_0xe9df('0x11')]===0x1f4){logger[_0xe9df('0x10')](_0xe9df('0xb'),_0x4313ee,_0x29b493[_0xe9df('0x10')][_0xe9df('0x12')]);return _0x273cde(_0x29b493[_0xe9df('0x10')][_0xe9df('0x12')]);}logger['error'](_0xe9df('0xb'),_0x4313ee,_0x29b493[_0xe9df('0x10')][_0xe9df('0x12')]);return _0x2bdcf3(_0x29b493[_0xe9df('0x10')]['message']);}else{logger[_0xe9df('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x4313ee,'request\x20sent');_0x2bdcf3(_0x29b493['result'][_0xe9df('0x12')]);}})['catch'](function(_0x5c9667){logger['error'](_0xe9df('0xb'),_0x4313ee,_0x5c9667);_0x273cde(_0x5c9667);});});}exports[_0xe9df('0x13')]=function(_0xeb0033){var _0xbb9bff=this;return new Promise(function(_0x27be44,_0x14e5f0){return db[_0xe9df('0x14')][_0xe9df('0x15')]({'raw':_0xeb0033[_0xe9df('0x16')]?_0xeb0033[_0xe9df('0x16')][_0xe9df('0x17')]===undefined?!![]:![]:!![],'where':_0xeb0033['options']?_0xeb0033[_0xe9df('0x16')][_0xe9df('0x18')]||null:null,'attributes':_0xeb0033[_0xe9df('0x16')]?_0xeb0033[_0xe9df('0x16')][_0xe9df('0x19')]||null:null,'limit':_0xeb0033[_0xe9df('0x16')]?_0xeb0033[_0xe9df('0x16')]['limit']||null:null,'include':_0xeb0033[_0xe9df('0x16')]?_0xeb0033[_0xe9df('0x16')][_0xe9df('0x1a')]?_[_0xe9df('0x1b')](_0xeb0033[_0xe9df('0x16')][_0xe9df('0x1a')],function(_0x5b0b66){return{'model':db[_0x5b0b66['model']],'as':_0x5b0b66['as'],'attributes':_0x5b0b66[_0xe9df('0x19')],'include':_0x5b0b66[_0xe9df('0x1a')]?_[_0xe9df('0x1b')](_0x5b0b66[_0xe9df('0x1a')],function(_0x1c6ec1){return{'model':db[_0x1c6ec1[_0xe9df('0x1c')]],'as':_0x1c6ec1['as'],'attributes':_0x1c6ec1[_0xe9df('0x19')],'include':_0x1c6ec1[_0xe9df('0x1a')]?_['map'](_0x1c6ec1[_0xe9df('0x1a')],function(_0x1cc38b){return{'model':db[_0x1cc38b[_0xe9df('0x1c')]],'as':_0x1cc38b['as'],'attributes':_0x1cc38b['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9df('0x9')](function(_0x14dc38){logger[_0xe9df('0xa')](_0xe9df('0x13'),_0xeb0033);logger[_0xe9df('0xd')](_0xe9df('0x13'),_0xeb0033,JSON[_0xe9df('0xf')](_0x14dc38));_0x27be44(_0x14dc38);})[_0xe9df('0x1d')](function(_0x2845d1){logger[_0xe9df('0x10')](_0xe9df('0x13'),_0x2845d1[_0xe9df('0x12')],_0xeb0033);_0x14e5f0(_0xbb9bff[_0xe9df('0x10')](0x1f4,_0x2845d1[_0xe9df('0x12')]));});});};exports[_0xe9df('0x1e')]=function(_0x18a900){var _0x222fe6=this;return new Promise(function(_0x5f56c9,_0x41a2d3){return db[_0xe9df('0x14')][_0xe9df('0x1f')]({'raw':_0x18a900['options']?_0x18a900[_0xe9df('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x18a900[_0xe9df('0x16')]?_0x18a900[_0xe9df('0x16')][_0xe9df('0x18')]||null:null,'attributes':_0x18a900[_0xe9df('0x16')]?_0x18a900[_0xe9df('0x16')]['attributes']||null:null,'include':_0x18a900[_0xe9df('0x16')]?_0x18a900[_0xe9df('0x16')][_0xe9df('0x1a')]?_[_0xe9df('0x1b')](_0x18a900[_0xe9df('0x16')]['include'],function(_0x4daec5){return{'model':db[_0x4daec5[_0xe9df('0x1c')]],'as':_0x4daec5['as'],'attributes':_0x4daec5[_0xe9df('0x19')],'include':_0x4daec5[_0xe9df('0x1a')]?_[_0xe9df('0x1b')](_0x4daec5[_0xe9df('0x1a')],function(_0x3db13c){return{'model':db[_0x3db13c['model']],'as':_0x3db13c['as'],'attributes':_0x3db13c['attributes'],'include':_0x3db13c[_0xe9df('0x1a')]?_[_0xe9df('0x1b')](_0x3db13c[_0xe9df('0x1a')],function(_0x38eba6){return{'model':db[_0x38eba6['model']],'as':_0x38eba6['as'],'attributes':_0x38eba6[_0xe9df('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe9df('0x9')](function(_0x4367de){logger[_0xe9df('0xa')]('ShowFreshdeskAccount',_0x18a900);logger[_0xe9df('0xd')](_0xe9df('0x1e'),_0x18a900,JSON[_0xe9df('0xf')](_0x4367de));_0x5f56c9(_0x4367de);})[_0xe9df('0x1d')](function(_0x27e180){logger['error'](_0xe9df('0x1e'),_0x27e180[_0xe9df('0x12')],_0x18a900);_0x41a2d3(_0x222fe6[_0xe9df('0x10')](0x1f4,_0x27e180['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index b3ee6b7..8e23a02 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 _0x3c38=['destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags','/:id'];(function(_0x3d7229,_0x18ab31){var _0x1e27ee=function(_0x671c5d){while(--_0x671c5d){_0x3d7229['push'](_0x3d7229['shift']());}};_0x1e27ee(++_0x18ab31);}(_0x3c38,0x1b6));var _0x83c3=function(_0xceb544,_0x34d663){_0xceb544=_0xceb544-0x0;var _0x381cab=_0x3c38[_0xceb544];return _0x381cab;};'use strict';var multer=require('multer');var util=require(_0x83c3('0x0'));var path=require(_0x83c3('0x1'));var timeout=require(_0x83c3('0x2'));var express=require('express');var router=express[_0x83c3('0x3')]();var fs_extra=require(_0x83c3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x83c3('0x5'));var config=require('../../config/environment');var controller=require(_0x83c3('0x6'));router[_0x83c3('0x7')]('/',auth[_0x83c3('0x8')](),controller['index']);router[_0x83c3('0x7')]('/:id',auth[_0x83c3('0x8')](),controller[_0x83c3('0x9')]);router[_0x83c3('0x7')]('/:id/fields',auth[_0x83c3('0x8')](),controller['getFields']);router[_0x83c3('0x7')](_0x83c3('0xa'),auth['isAuthenticated'](),controller[_0x83c3('0xb')]);router['get']('/:id/descriptions',auth[_0x83c3('0x8')](),controller['getDescriptions']);router[_0x83c3('0x7')](_0x83c3('0xc'),auth['isAuthenticated'](),controller[_0x83c3('0xd')]);router['post']('/',auth[_0x83c3('0x8')](),controller[_0x83c3('0xe')]);router[_0x83c3('0xf')](_0x83c3('0xc'),auth[_0x83c3('0x8')](),controller[_0x83c3('0x10')]);router['put'](_0x83c3('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x83c3('0x11'),auth[_0x83c3('0x8')](),controller[_0x83c3('0x12')]);module['exports']=router; \ No newline at end of file +var _0x6995=['/:id/tags','getTags','post','setTags','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x1ebc60,_0xc7f783){var _0x15a427=function(_0x22d2da){while(--_0x22d2da){_0x1ebc60['push'](_0x1ebc60['shift']());}};_0x15a427(++_0xc7f783);}(_0x6995,0xa9));var _0x5699=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6995[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x5699('0x0'));var util=require(_0x5699('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5699('0x2'));var auth=require(_0x5699('0x3'));var interaction=require(_0x5699('0x4'));var config=require('../../config/environment');var controller=require(_0x5699('0x5'));router[_0x5699('0x6')]('/',auth[_0x5699('0x7')](),controller['index']);router[_0x5699('0x6')](_0x5699('0x8'),auth[_0x5699('0x7')](),controller[_0x5699('0x9')]);router[_0x5699('0x6')](_0x5699('0xa'),auth[_0x5699('0x7')](),controller[_0x5699('0xb')]);router[_0x5699('0x6')]('/:id/subjects',auth[_0x5699('0x7')](),controller[_0x5699('0xc')]);router[_0x5699('0x6')](_0x5699('0xd'),auth[_0x5699('0x7')](),controller[_0x5699('0xe')]);router[_0x5699('0x6')](_0x5699('0xf'),auth[_0x5699('0x7')](),controller[_0x5699('0x10')]);router[_0x5699('0x11')]('/',auth[_0x5699('0x7')](),controller['create']);router[_0x5699('0x11')](_0x5699('0xf'),auth[_0x5699('0x7')](),controller[_0x5699('0x12')]);router['put'](_0x5699('0x8'),auth[_0x5699('0x7')](),controller[_0x5699('0x13')]);router[_0x5699('0x14')](_0x5699('0x8'),auth[_0x5699('0x7')](),controller[_0x5699('0x15')]);module[_0x5699('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 7aa6f9b..5c7a180 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 _0xcf8c=['sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xcf8c,0x156));var _0xccf8=function(_0xb5edf1,_0x820b1f){_0xb5edf1=_0xb5edf1-0x0;var _0x539ea1=_0xcf8c[_0xb5edf1];return _0x539ea1;};'use strict';var Sequelize=require(_0xccf8('0x0'));module[_0xccf8('0x1')]={'name':{'type':Sequelize[_0xccf8('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa164=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa164,0x69));var _0x4a16=function(_0x3ee75d,_0x501a05){_0x3ee75d=_0x3ee75d-0x0;var _0x5910a5=_0xa164[_0x3ee75d];return _0x5910a5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4a16('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index ac929ed..748894a 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 _0x75ad=['rows','catch','show','params','keys','length','includeAll','find','create','body','getFields','FreshdeskField','order','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','findAll'];(function(_0x3bc04d,_0x28ab50){var _0x2a543b=function(_0x316a98){while(--_0x316a98){_0x3bc04d['push'](_0x3bc04d['shift']());}};_0x2a543b(++_0x28ab50);}(_0x75ad,0x168));var _0xd75a=function(_0x16aaf2,_0x336e70){_0x16aaf2=_0x16aaf2-0x0;var _0x497d1f=_0x75ad[_0x16aaf2];return _0x497d1f;};'use strict';var emlformat=require(_0xd75a('0x0'));var rimraf=require(_0xd75a('0x1'));var zipdir=require(_0xd75a('0x2'));var jsonpatch=require(_0xd75a('0x3'));var rp=require(_0xd75a('0x4'));var moment=require(_0xd75a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd75a('0x6'));var util=require(_0xd75a('0x7'));var path=require(_0xd75a('0x8'));var sox=require(_0xd75a('0x9'));var csv=require(_0xd75a('0xa'));var ejs=require(_0xd75a('0xb'));var fs=require('fs');var fs_extra=require(_0xd75a('0xc'));var _=require(_0xd75a('0xd'));var squel=require(_0xd75a('0xe'));var crypto=require('crypto');var jsforce=require(_0xd75a('0xf'));var deskjs=require(_0xd75a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd75a('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd75a('0x12'));var logger=require(_0xd75a('0x13'))(_0xd75a('0x14'));var utils=require(_0xd75a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd75a('0x16'));var db=require(_0xd75a('0x17'))['db'];function respondWithStatusCode(_0x59c8a7,_0x2f7f04){_0x2f7f04=_0x2f7f04||0xcc;return function(_0x57eb5c){if(_0x57eb5c){return _0x59c8a7[_0xd75a('0x18')](_0x2f7f04);}return _0x59c8a7[_0xd75a('0x19')](_0x2f7f04)[_0xd75a('0x1a')]();};}function respondWithResult(_0x4bf7e1,_0x23bbe0){_0x23bbe0=_0x23bbe0||0xc8;return function(_0x77e9be){if(_0x77e9be){return _0x4bf7e1[_0xd75a('0x19')](_0x23bbe0)[_0xd75a('0x1b')](_0x77e9be);}};}function respondWithFilteredResult(_0x5d4f61,_0x2ddff1){return function(_0x1955ef){if(_0x1955ef){var _0x4f7c46=typeof _0x2ddff1[_0xd75a('0x1c')]===_0xd75a('0x1d')&&typeof _0x2ddff1[_0xd75a('0x1e')]===_0xd75a('0x1d');var _0x4e40e9=_0x1955ef['count'];var _0x26dd69=_0x4f7c46?0x0:_0x2ddff1[_0xd75a('0x1c')];var _0x119d91=_0x4f7c46?_0x1955ef['count']:_0x2ddff1['offset']+_0x2ddff1[_0xd75a('0x1e')];var _0x1c1e33;if(_0x119d91>=_0x4e40e9){_0x119d91=_0x4e40e9;_0x1c1e33=0xc8;}else{_0x1c1e33=0xce;}_0x5d4f61[_0xd75a('0x19')](_0x1c1e33);return _0x5d4f61[_0xd75a('0x1f')]('Content-Range',_0x26dd69+'-'+_0x119d91+'/'+_0x4e40e9)['json'](_0x1955ef);}return null;};}function patchUpdates(_0xe4e1a){return function(_0x713d11){try{jsonpatch[_0xd75a('0x20')](_0x713d11,_0xe4e1a,!![]);}catch(_0x1b4228){return BPromise[_0xd75a('0x21')](_0x1b4228);}return _0x713d11[_0xd75a('0x22')]();};}function saveUpdates(_0x9d307d,_0x47b719){return function(_0x448d8a){if(_0x448d8a){return _0x448d8a[_0xd75a('0x23')](_0x9d307d)[_0xd75a('0x24')](function(_0x3a6733){return _0x3a6733;});}return null;};}function removeEntity(_0x372564,_0x23222d){return function(_0xaf12e4){if(_0xaf12e4){return _0xaf12e4[_0xd75a('0x25')]()[_0xd75a('0x24')](function(){_0x372564['status'](0xcc)[_0xd75a('0x1a')]();});}};}function handleEntityNotFound(_0x15b418,_0x5f6424){return function(_0x5dc785){if(!_0x5dc785){_0x15b418['sendStatus'](0x194);}return _0x5dc785;};}function handleError(_0x127c8a,_0x42f572){_0x42f572=_0x42f572||0x1f4;return function(_0xbf6b12){logger['error'](_0xbf6b12[_0xd75a('0x26')]);if(_0xbf6b12[_0xd75a('0x27')]){delete _0xbf6b12[_0xd75a('0x27')];}_0x127c8a[_0xd75a('0x19')](_0x42f572)[_0xd75a('0x28')](_0xbf6b12);};}exports[_0xd75a('0x29')]=function(_0x33f315,_0x3cda51){var _0x56716e={},_0x46ca4d={},_0x164d5d={'count':0x0,'rows':[]};var _0x479e83=_[_0xd75a('0x2a')](db[_0xd75a('0x2b')][_0xd75a('0x2c')],function(_0x517bf2){return{'name':_0x517bf2[_0xd75a('0x2d')],'type':_0x517bf2[_0xd75a('0x2e')][_0xd75a('0x2f')]};});_0x46ca4d['model']=_[_0xd75a('0x2a')](_0x479e83,_0xd75a('0x27'));_0x46ca4d[_0xd75a('0x30')]=_['keys'](_0x33f315[_0xd75a('0x30')]);_0x46ca4d['filters']=_[_0xd75a('0x31')](_0x46ca4d['model'],_0x46ca4d['query']);_0x56716e[_0xd75a('0x32')]=_[_0xd75a('0x31')](_0x46ca4d[_0xd75a('0x33')],qs[_0xd75a('0x34')](_0x33f315[_0xd75a('0x30')][_0xd75a('0x34')]));_0x56716e[_0xd75a('0x32')]=_0x56716e[_0xd75a('0x32')]['length']?_0x56716e[_0xd75a('0x32')]:_0x46ca4d[_0xd75a('0x33')];if(!_0x33f315[_0xd75a('0x30')][_0xd75a('0x35')](_0xd75a('0x36'))){_0x56716e[_0xd75a('0x1e')]=qs['limit'](_0x33f315[_0xd75a('0x30')]['limit']);_0x56716e['offset']=qs[_0xd75a('0x1c')](_0x33f315[_0xd75a('0x30')][_0xd75a('0x1c')]);}_0x56716e['order']=qs[_0xd75a('0x37')](_0x33f315[_0xd75a('0x30')][_0xd75a('0x37')]);_0x56716e[_0xd75a('0x38')]=qs[_0xd75a('0x39')](_[_0xd75a('0x3a')](_0x33f315[_0xd75a('0x30')],_0x46ca4d[_0xd75a('0x39')]),_0x479e83);if(_0x33f315[_0xd75a('0x30')][_0xd75a('0x3b')]){_0x56716e[_0xd75a('0x38')]=_[_0xd75a('0x3c')](_0x56716e[_0xd75a('0x38')],{'$or':_[_0xd75a('0x2a')](_0x479e83,function(_0x2a2062){if(_0x2a2062['type']!==_0xd75a('0x3d')){var _0x414fb7={};_0x414fb7[_0x2a2062[_0xd75a('0x27')]]={'$like':'%'+_0x33f315[_0xd75a('0x30')][_0xd75a('0x3b')]+'%'};return _0x414fb7;}})});}_0x56716e=_[_0xd75a('0x3c')]({},_0x56716e,_0x33f315[_0xd75a('0x3e')]);var _0x1f85a8={'where':_0x56716e[_0xd75a('0x38')]};return db[_0xd75a('0x2b')][_0xd75a('0x3f')](_0x1f85a8)[_0xd75a('0x24')](function(_0x51a5e0){_0x164d5d[_0xd75a('0x3f')]=_0x51a5e0;if(_0x33f315[_0xd75a('0x30')]['includeAll']){_0x56716e['include']=[{'all':!![]}];}return db[_0xd75a('0x2b')][_0xd75a('0x40')](_0x56716e);})[_0xd75a('0x24')](function(_0x304dd9){_0x164d5d[_0xd75a('0x41')]=_0x304dd9;return _0x164d5d;})[_0xd75a('0x24')](respondWithFilteredResult(_0x3cda51,_0x56716e))[_0xd75a('0x42')](handleError(_0x3cda51,null));};exports[_0xd75a('0x43')]=function(_0x3063b4,_0x226459){var _0x55dfc6={'raw':![],'where':{'id':_0x3063b4[_0xd75a('0x44')]['id']}},_0x195f03={};_0x195f03[_0xd75a('0x33')]=_[_0xd75a('0x45')](db[_0xd75a('0x2b')][_0xd75a('0x2c')]);_0x195f03[_0xd75a('0x30')]=_['keys'](_0x3063b4[_0xd75a('0x30')]);_0x195f03[_0xd75a('0x39')]=_[_0xd75a('0x31')](_0x195f03['model'],_0x195f03[_0xd75a('0x30')]);_0x55dfc6[_0xd75a('0x32')]=_['intersection'](_0x195f03[_0xd75a('0x33')],qs[_0xd75a('0x34')](_0x3063b4[_0xd75a('0x30')]['fields']));_0x55dfc6['attributes']=_0x55dfc6[_0xd75a('0x32')][_0xd75a('0x46')]?_0x55dfc6['attributes']:_0x195f03[_0xd75a('0x33')];if(_0x3063b4[_0xd75a('0x30')][_0xd75a('0x47')]){_0x55dfc6['include']=[{'all':!![]}];}_0x55dfc6=_[_0xd75a('0x3c')]({},_0x55dfc6,_0x3063b4[_0xd75a('0x3e')]);return db[_0xd75a('0x2b')][_0xd75a('0x48')](_0x55dfc6)['then'](handleEntityNotFound(_0x226459,null))['then'](respondWithResult(_0x226459,null))['catch'](handleError(_0x226459,null));};exports[_0xd75a('0x49')]=function(_0x3fb754,_0x240193){return db[_0xd75a('0x2b')][_0xd75a('0x49')](_0x3fb754[_0xd75a('0x4a')],{})['then'](respondWithResult(_0x240193,0xc9))['catch'](handleError(_0x240193,null));};exports[_0xd75a('0x23')]=function(_0x5e3a37,_0x4d2de6){if(_0x5e3a37[_0xd75a('0x4a')]['id']){delete _0x5e3a37['body']['id'];}return db['FreshdeskConfiguration'][_0xd75a('0x48')]({'where':{'id':_0x5e3a37[_0xd75a('0x44')]['id']}})[_0xd75a('0x24')](handleEntityNotFound(_0x4d2de6,null))[_0xd75a('0x24')](saveUpdates(_0x5e3a37[_0xd75a('0x4a')],null))[_0xd75a('0x24')](respondWithResult(_0x4d2de6,null))[_0xd75a('0x42')](handleError(_0x4d2de6,null));};exports[_0xd75a('0x25')]=function(_0x3b2c62,_0x1ea624){return db[_0xd75a('0x2b')][_0xd75a('0x48')]({'where':{'id':_0x3b2c62[_0xd75a('0x44')]['id']}})[_0xd75a('0x24')](handleEntityNotFound(_0x1ea624,null))[_0xd75a('0x24')](removeEntity(_0x1ea624,null))[_0xd75a('0x42')](handleError(_0x1ea624,null));};exports[_0xd75a('0x4b')]=function(_0x4f5693,_0x14f280,_0x221282){var _0x8c536e={};var _0x5f2285={};var _0xb80107;var _0x31f2b9;return db[_0xd75a('0x2b')]['findOne']({'where':{'id':_0x4f5693[_0xd75a('0x44')]['id']}})[_0xd75a('0x24')](handleEntityNotFound(_0x14f280,null))[_0xd75a('0x24')](function(_0x184758){if(_0x184758){_0xb80107=_0x184758;_0x5f2285[_0xd75a('0x33')]=_[_0xd75a('0x45')](db[_0xd75a('0x4c')][_0xd75a('0x2c')]);_0x5f2285[_0xd75a('0x30')]=_[_0xd75a('0x45')](_0x4f5693[_0xd75a('0x30')]);_0x5f2285['filters']=_[_0xd75a('0x31')](_0x5f2285[_0xd75a('0x33')],_0x5f2285[_0xd75a('0x30')]);_0x8c536e[_0xd75a('0x32')]=_[_0xd75a('0x31')](_0x5f2285['model'],qs[_0xd75a('0x34')](_0x4f5693[_0xd75a('0x30')]['fields']));_0x8c536e[_0xd75a('0x32')]=_0x8c536e['attributes'][_0xd75a('0x46')]?_0x8c536e[_0xd75a('0x32')]:_0x5f2285['model'];_0x8c536e[_0xd75a('0x4d')]=qs[_0xd75a('0x37')](_0x4f5693[_0xd75a('0x30')]['sort']);_0x8c536e[_0xd75a('0x38')]=qs[_0xd75a('0x39')](_[_0xd75a('0x3a')](_0x4f5693[_0xd75a('0x30')],_0x5f2285['filters']));if(_0x4f5693[_0xd75a('0x30')][_0xd75a('0x3b')]){_0x8c536e['where']=_[_0xd75a('0x3c')](_0x8c536e[_0xd75a('0x38')],{'$or':_[_0xd75a('0x2a')](_0x8c536e['attributes'],function(_0xac1f9d){var _0x3b96d1={};_0x3b96d1[_0xac1f9d]={'$like':'%'+_0x4f5693['query'][_0xd75a('0x3b')]+'%'};return _0x3b96d1;})});}_0x8c536e=_['merge']({},_0x8c536e,_0x4f5693[_0xd75a('0x3e')]);return _0xb80107[_0xd75a('0x4b')](_0x8c536e);}})['then'](function(_0x214df6){if(_0x214df6){_0x31f2b9=_0x214df6['length'];if(!_0x4f5693[_0xd75a('0x30')][_0xd75a('0x35')](_0xd75a('0x36'))){_0x8c536e[_0xd75a('0x1e')]=qs[_0xd75a('0x1e')](_0x4f5693[_0xd75a('0x30')][_0xd75a('0x1e')]);_0x8c536e[_0xd75a('0x1c')]=qs['offset'](_0x4f5693[_0xd75a('0x30')][_0xd75a('0x1c')]);}return _0xb80107[_0xd75a('0x4b')](_0x8c536e);}})[_0xd75a('0x24')](function(_0x51013c){if(_0x51013c){return _0x51013c?{'count':_0x31f2b9,'rows':_0x51013c}:null;}})[_0xd75a('0x24')](respondWithResult(_0x14f280,null))['catch'](handleError(_0x14f280,null));};exports[_0xd75a('0x4e')]=function(_0x38b491,_0x1ebd40,_0x15b4c6){var _0x492a97={};var _0x1fb3aa={};var _0x3a7bc4;var _0x26d3bc;return db[_0xd75a('0x2b')][_0xd75a('0x4f')]({'where':{'id':_0x38b491[_0xd75a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1ebd40,null))[_0xd75a('0x24')](function(_0x53bdbc){if(_0x53bdbc){_0x3a7bc4=_0x53bdbc;_0x1fb3aa['model']=_['keys'](db[_0xd75a('0x4c')]['rawAttributes']);_0x1fb3aa[_0xd75a('0x30')]=_[_0xd75a('0x45')](_0x38b491['query']);_0x1fb3aa[_0xd75a('0x39')]=_['intersection'](_0x1fb3aa['model'],_0x1fb3aa['query']);_0x492a97[_0xd75a('0x32')]=_[_0xd75a('0x31')](_0x1fb3aa[_0xd75a('0x33')],qs['fields'](_0x38b491[_0xd75a('0x30')][_0xd75a('0x34')]));_0x492a97[_0xd75a('0x32')]=_0x492a97[_0xd75a('0x32')]['length']?_0x492a97[_0xd75a('0x32')]:_0x1fb3aa[_0xd75a('0x33')];_0x492a97['order']=qs[_0xd75a('0x37')](_0x38b491['query'][_0xd75a('0x37')]);_0x492a97[_0xd75a('0x38')]=qs[_0xd75a('0x39')](_[_0xd75a('0x3a')](_0x38b491[_0xd75a('0x30')],_0x1fb3aa['filters']));if(_0x38b491[_0xd75a('0x30')][_0xd75a('0x3b')]){_0x492a97[_0xd75a('0x38')]=_[_0xd75a('0x3c')](_0x492a97['where'],{'$or':_[_0xd75a('0x2a')](_0x492a97[_0xd75a('0x32')],function(_0xd923d7){var _0x450f45={};_0x450f45[_0xd923d7]={'$like':'%'+_0x38b491[_0xd75a('0x30')][_0xd75a('0x3b')]+'%'};return _0x450f45;})});}_0x492a97=_[_0xd75a('0x3c')]({},_0x492a97,_0x38b491[_0xd75a('0x3e')]);return _0x3a7bc4[_0xd75a('0x4e')](_0x492a97);}})[_0xd75a('0x24')](function(_0x229d04){if(_0x229d04){_0x26d3bc=_0x229d04[_0xd75a('0x46')];if(!_0x38b491['query'][_0xd75a('0x35')](_0xd75a('0x36'))){_0x492a97[_0xd75a('0x1e')]=qs[_0xd75a('0x1e')](_0x38b491[_0xd75a('0x30')][_0xd75a('0x1e')]);_0x492a97[_0xd75a('0x1c')]=qs[_0xd75a('0x1c')](_0x38b491[_0xd75a('0x30')][_0xd75a('0x1c')]);}return _0x3a7bc4[_0xd75a('0x4e')](_0x492a97);}})[_0xd75a('0x24')](function(_0x3bf71c){if(_0x3bf71c){return _0x3bf71c?{'count':_0x26d3bc,'rows':_0x3bf71c}:null;}})['then'](respondWithResult(_0x1ebd40,null))[_0xd75a('0x42')](handleError(_0x1ebd40,null));};exports[_0xd75a('0x50')]=function(_0x2ed7d4,_0x5e481d,_0x164bfb){var _0xf76f7={};var _0x55fe92={};var _0xc956a6;var _0x448bc2;return db[_0xd75a('0x2b')][_0xd75a('0x4f')]({'where':{'id':_0x2ed7d4[_0xd75a('0x44')]['id']}})[_0xd75a('0x24')](handleEntityNotFound(_0x5e481d,null))[_0xd75a('0x24')](function(_0x2c1bea){if(_0x2c1bea){_0xc956a6=_0x2c1bea;_0x55fe92[_0xd75a('0x33')]=_[_0xd75a('0x45')](db['FreshdeskField'][_0xd75a('0x2c')]);_0x55fe92[_0xd75a('0x30')]=_[_0xd75a('0x45')](_0x2ed7d4['query']);_0x55fe92[_0xd75a('0x39')]=_[_0xd75a('0x31')](_0x55fe92[_0xd75a('0x33')],_0x55fe92[_0xd75a('0x30')]);_0xf76f7['attributes']=_[_0xd75a('0x31')](_0x55fe92[_0xd75a('0x33')],qs[_0xd75a('0x34')](_0x2ed7d4[_0xd75a('0x30')]['fields']));_0xf76f7[_0xd75a('0x32')]=_0xf76f7[_0xd75a('0x32')]['length']?_0xf76f7[_0xd75a('0x32')]:_0x55fe92[_0xd75a('0x33')];_0xf76f7[_0xd75a('0x4d')]=qs[_0xd75a('0x37')](_0x2ed7d4['query'][_0xd75a('0x37')]);_0xf76f7['where']=qs['filters'](_[_0xd75a('0x3a')](_0x2ed7d4[_0xd75a('0x30')],_0x55fe92['filters']));if(_0x2ed7d4[_0xd75a('0x30')][_0xd75a('0x3b')]){_0xf76f7[_0xd75a('0x38')]=_[_0xd75a('0x3c')](_0xf76f7[_0xd75a('0x38')],{'$or':_['map'](_0xf76f7[_0xd75a('0x32')],function(_0x59211e){var _0x52ed70={};_0x52ed70[_0x59211e]={'$like':'%'+_0x2ed7d4['query']['filter']+'%'};return _0x52ed70;})});}_0xf76f7=_[_0xd75a('0x3c')]({},_0xf76f7,_0x2ed7d4['options']);return _0xc956a6[_0xd75a('0x50')](_0xf76f7);}})[_0xd75a('0x24')](function(_0x5ad166){if(_0x5ad166){_0x448bc2=_0x5ad166['length'];if(!_0x2ed7d4['query'][_0xd75a('0x35')](_0xd75a('0x36'))){_0xf76f7[_0xd75a('0x1e')]=qs[_0xd75a('0x1e')](_0x2ed7d4['query'][_0xd75a('0x1e')]);_0xf76f7['offset']=qs[_0xd75a('0x1c')](_0x2ed7d4['query'][_0xd75a('0x1c')]);}return _0xc956a6[_0xd75a('0x50')](_0xf76f7);}})[_0xd75a('0x24')](function(_0x3a1cdf){if(_0x3a1cdf){return _0x3a1cdf?{'count':_0x448bc2,'rows':_0x3a1cdf}:null;}})[_0xd75a('0x24')](respondWithResult(_0x5e481d,null))[_0xd75a('0x42')](handleError(_0x5e481d,null));};exports[_0xd75a('0x51')]=function(_0x499726,_0x42c2a9,_0x2e94b8){var _0x6cdcf6={};var _0x592d3d={};var _0x4c2281;var _0x21195d;return db[_0xd75a('0x2b')][_0xd75a('0x4f')]({'where':{'id':_0x499726[_0xd75a('0x44')]['id']}})[_0xd75a('0x24')](handleEntityNotFound(_0x42c2a9,null))['then'](function(_0x27ab9c){if(_0x27ab9c){_0x4c2281=_0x27ab9c;_0x592d3d[_0xd75a('0x33')]=_[_0xd75a('0x45')](db[_0xd75a('0x52')][_0xd75a('0x2c')]);_0x592d3d[_0xd75a('0x30')]=_[_0xd75a('0x45')](_0x499726[_0xd75a('0x30')]);_0x592d3d['filters']=_[_0xd75a('0x31')](_0x592d3d[_0xd75a('0x33')],_0x592d3d[_0xd75a('0x30')]);_0x6cdcf6[_0xd75a('0x32')]=_[_0xd75a('0x31')](_0x592d3d[_0xd75a('0x33')],qs['fields'](_0x499726[_0xd75a('0x30')][_0xd75a('0x34')]));_0x6cdcf6[_0xd75a('0x32')]=_0x6cdcf6['attributes']['length']?_0x6cdcf6['attributes']:_0x592d3d[_0xd75a('0x33')];_0x6cdcf6['order']=qs[_0xd75a('0x37')](_0x499726[_0xd75a('0x30')][_0xd75a('0x37')]);_0x6cdcf6[_0xd75a('0x38')]=qs[_0xd75a('0x39')](_[_0xd75a('0x3a')](_0x499726['query'],_0x592d3d[_0xd75a('0x39')]));if(_0x499726['query'][_0xd75a('0x3b')]){_0x6cdcf6[_0xd75a('0x38')]=_[_0xd75a('0x3c')](_0x6cdcf6[_0xd75a('0x38')],{'$or':_[_0xd75a('0x2a')](_0x6cdcf6[_0xd75a('0x32')],function(_0x1d71e8){var _0x2218bb={};_0x2218bb[_0x1d71e8]={'$like':'%'+_0x499726[_0xd75a('0x30')][_0xd75a('0x3b')]+'%'};return _0x2218bb;})});}_0x6cdcf6=_['merge']({},_0x6cdcf6,_0x499726[_0xd75a('0x3e')]);return _0x4c2281[_0xd75a('0x51')](_0x6cdcf6);}})[_0xd75a('0x24')](function(_0xfbfe55){if(_0xfbfe55){_0x21195d=_0xfbfe55[_0xd75a('0x46')];if(!_0x499726[_0xd75a('0x30')]['hasOwnProperty'](_0xd75a('0x36'))){_0x6cdcf6[_0xd75a('0x1e')]=qs[_0xd75a('0x1e')](_0x499726[_0xd75a('0x30')]['limit']);_0x6cdcf6[_0xd75a('0x1c')]=qs[_0xd75a('0x1c')](_0x499726['query'][_0xd75a('0x1c')]);}return _0x4c2281[_0xd75a('0x51')](_0x6cdcf6);}})[_0xd75a('0x24')](function(_0x55e4a3){if(_0x55e4a3){return _0x55e4a3?{'count':_0x21195d,'rows':_0x55e4a3}:null;}})[_0xd75a('0x24')](respondWithResult(_0x42c2a9,null))[_0xd75a('0x42')](handleError(_0x42c2a9,null));};exports[_0xd75a('0x53')]=function(_0x4c0420,_0x16a5f6,_0x585b8e){if(_0x4c0420[_0xd75a('0x4a')]['id']){delete _0x4c0420[_0xd75a('0x4a')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4c0420[_0xd75a('0x44')]['id']}})['then'](handleEntityNotFound(_0x16a5f6,null))[_0xd75a('0x24')](function(_0x29a73c){if(_0x29a73c){return _0x29a73c[_0xd75a('0x53')](_0x4c0420[_0xd75a('0x4a')][_0xd75a('0x54')]||[]);}return null;})['then'](respondWithResult(_0x16a5f6,null))['catch'](handleError(_0x16a5f6,null));}; \ No newline at end of file +var _0x34c0=['../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','params','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x34c0,0x90));var _0x034c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34c0[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x034c('0x0'));var rimraf=require(_0x034c('0x1'));var zipdir=require(_0x034c('0x2'));var jsonpatch=require(_0x034c('0x3'));var rp=require(_0x034c('0x4'));var moment=require(_0x034c('0x5'));var BPromise=require(_0x034c('0x6'));var Mustache=require(_0x034c('0x7'));var util=require(_0x034c('0x8'));var path=require(_0x034c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x034c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x034c('0xb'));var crypto=require(_0x034c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x034c('0xd'));var toCsv=require(_0x034c('0xe'));var querystring=require(_0x034c('0xf'));var Papa=require(_0x034c('0x10'));var Redis=require(_0x034c('0x11'));var authService=require(_0x034c('0x12'));var qs=require(_0x034c('0x13'));var as=require(_0x034c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x034c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x034c('0x16'))['db'];function respondWithStatusCode(_0x3cfe2c,_0xd0824f){_0xd0824f=_0xd0824f||0xcc;return function(_0x4975f0){if(_0x4975f0){return _0x3cfe2c[_0x034c('0x17')](_0xd0824f);}return _0x3cfe2c[_0x034c('0x18')](_0xd0824f)['end']();};}function respondWithResult(_0x896d88,_0x5384bb){_0x5384bb=_0x5384bb||0xc8;return function(_0x3daa0c){if(_0x3daa0c){return _0x896d88['status'](_0x5384bb)[_0x034c('0x19')](_0x3daa0c);}};}function respondWithFilteredResult(_0x1455af,_0xb45e96){return function(_0x3a6033){if(_0x3a6033){var _0x114980=typeof _0xb45e96[_0x034c('0x1a')]===_0x034c('0x1b')&&typeof _0xb45e96[_0x034c('0x1c')]===_0x034c('0x1b');var _0x5e3601=_0x3a6033[_0x034c('0x1d')];var _0xee792e=_0x114980?0x0:_0xb45e96[_0x034c('0x1a')];var _0x4351c6=_0x114980?_0x3a6033[_0x034c('0x1d')]:_0xb45e96['offset']+_0xb45e96['limit'];var _0x3eef38;if(_0x4351c6>=_0x5e3601){_0x4351c6=_0x5e3601;_0x3eef38=0xc8;}else{_0x3eef38=0xce;}_0x1455af['status'](_0x3eef38);return _0x1455af['set']('Content-Range',_0xee792e+'-'+_0x4351c6+'/'+_0x5e3601)[_0x034c('0x19')](_0x3a6033);}return null;};}function patchUpdates(_0x1721b3){return function(_0x2cd0bd){try{jsonpatch[_0x034c('0x1e')](_0x2cd0bd,_0x1721b3,!![]);}catch(_0x7a1b2d){return BPromise[_0x034c('0x1f')](_0x7a1b2d);}return _0x2cd0bd['save']();};}function saveUpdates(_0x313e62,_0x576960){return function(_0x11879c){if(_0x11879c){return _0x11879c[_0x034c('0x20')](_0x313e62)[_0x034c('0x21')](function(_0x42daa4){return _0x42daa4;});}return null;};}function removeEntity(_0x5a032d,_0x4a93f6){return function(_0x384f6c){if(_0x384f6c){return _0x384f6c[_0x034c('0x22')]()['then'](function(){_0x5a032d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d9b6,_0x1826d3){return function(_0x391e8b){if(!_0x391e8b){_0x31d9b6[_0x034c('0x17')](0x194);}return _0x391e8b;};}function handleError(_0x345208,_0x46c98a){_0x46c98a=_0x46c98a||0x1f4;return function(_0x3b57e8){logger[_0x034c('0x23')](_0x3b57e8[_0x034c('0x24')]);if(_0x3b57e8[_0x034c('0x25')]){delete _0x3b57e8['name'];}_0x345208[_0x034c('0x18')](_0x46c98a)[_0x034c('0x26')](_0x3b57e8);};}exports[_0x034c('0x27')]=function(_0x2f0198,_0x540257){var _0x2d84dc={},_0x39745a={},_0x30a43b={'count':0x0,'rows':[]};var _0x11a906=_[_0x034c('0x28')](db[_0x034c('0x29')]['rawAttributes'],function(_0x19a8dc){return{'name':_0x19a8dc[_0x034c('0x2a')],'type':_0x19a8dc['type'][_0x034c('0x2b')]};});_0x39745a['model']=_[_0x034c('0x28')](_0x11a906,_0x034c('0x25'));_0x39745a['query']=_[_0x034c('0x2c')](_0x2f0198[_0x034c('0x2d')]);_0x39745a[_0x034c('0x2e')]=_[_0x034c('0x2f')](_0x39745a[_0x034c('0x30')],_0x39745a['query']);_0x2d84dc[_0x034c('0x31')]=_['intersection'](_0x39745a[_0x034c('0x30')],qs['fields'](_0x2f0198[_0x034c('0x2d')][_0x034c('0x32')]));_0x2d84dc[_0x034c('0x31')]=_0x2d84dc['attributes'][_0x034c('0x33')]?_0x2d84dc[_0x034c('0x31')]:_0x39745a[_0x034c('0x30')];if(!_0x2f0198['query'][_0x034c('0x34')](_0x034c('0x35'))){_0x2d84dc[_0x034c('0x1c')]=qs[_0x034c('0x1c')](_0x2f0198['query']['limit']);_0x2d84dc[_0x034c('0x1a')]=qs[_0x034c('0x1a')](_0x2f0198[_0x034c('0x2d')]['offset']);}_0x2d84dc[_0x034c('0x36')]=qs[_0x034c('0x37')](_0x2f0198[_0x034c('0x2d')][_0x034c('0x37')]);_0x2d84dc['where']=qs[_0x034c('0x2e')](_[_0x034c('0x38')](_0x2f0198[_0x034c('0x2d')],_0x39745a[_0x034c('0x2e')]),_0x11a906);if(_0x2f0198[_0x034c('0x2d')][_0x034c('0x39')]){_0x2d84dc[_0x034c('0x3a')]=_[_0x034c('0x3b')](_0x2d84dc['where'],{'$or':_[_0x034c('0x28')](_0x11a906,function(_0x56e75c){if(_0x56e75c['type']!==_0x034c('0x3c')){var _0x4f715d={};_0x4f715d[_0x56e75c[_0x034c('0x25')]]={'$like':'%'+_0x2f0198[_0x034c('0x2d')][_0x034c('0x39')]+'%'};return _0x4f715d;}})});}_0x2d84dc=_[_0x034c('0x3b')]({},_0x2d84dc,_0x2f0198['options']);var _0x4513af={'where':_0x2d84dc[_0x034c('0x3a')]};return db[_0x034c('0x29')][_0x034c('0x1d')](_0x4513af)[_0x034c('0x21')](function(_0xb79575){_0x30a43b[_0x034c('0x1d')]=_0xb79575;if(_0x2f0198[_0x034c('0x2d')][_0x034c('0x3d')]){_0x2d84dc[_0x034c('0x3e')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x034c('0x3f')](_0x2d84dc);})[_0x034c('0x21')](function(_0x236695){_0x30a43b[_0x034c('0x40')]=_0x236695;return _0x30a43b;})[_0x034c('0x21')](respondWithFilteredResult(_0x540257,_0x2d84dc))['catch'](handleError(_0x540257,null));};exports[_0x034c('0x41')]=function(_0x4e5959,_0xe25ca0){var _0x5cf41f={'raw':![],'where':{'id':_0x4e5959['params']['id']}},_0x1f37da={};_0x1f37da['model']=_[_0x034c('0x2c')](db[_0x034c('0x29')][_0x034c('0x42')]);_0x1f37da[_0x034c('0x2d')]=_['keys'](_0x4e5959[_0x034c('0x2d')]);_0x1f37da[_0x034c('0x2e')]=_[_0x034c('0x2f')](_0x1f37da['model'],_0x1f37da[_0x034c('0x2d')]);_0x5cf41f[_0x034c('0x31')]=_['intersection'](_0x1f37da[_0x034c('0x30')],qs[_0x034c('0x32')](_0x4e5959[_0x034c('0x2d')][_0x034c('0x32')]));_0x5cf41f[_0x034c('0x31')]=_0x5cf41f[_0x034c('0x31')][_0x034c('0x33')]?_0x5cf41f[_0x034c('0x31')]:_0x1f37da[_0x034c('0x30')];if(_0x4e5959[_0x034c('0x2d')][_0x034c('0x3d')]){_0x5cf41f['include']=[{'all':!![]}];}_0x5cf41f=_[_0x034c('0x3b')]({},_0x5cf41f,_0x4e5959[_0x034c('0x43')]);return db[_0x034c('0x29')][_0x034c('0x44')](_0x5cf41f)['then'](handleEntityNotFound(_0xe25ca0,null))[_0x034c('0x21')](respondWithResult(_0xe25ca0,null))[_0x034c('0x45')](handleError(_0xe25ca0,null));};exports[_0x034c('0x46')]=function(_0x3cacc3,_0x5310e4){return db[_0x034c('0x29')]['create'](_0x3cacc3['body'],{})[_0x034c('0x21')](respondWithResult(_0x5310e4,0xc9))[_0x034c('0x45')](handleError(_0x5310e4,null));};exports[_0x034c('0x20')]=function(_0x44a7a8,_0x48ef34){if(_0x44a7a8[_0x034c('0x47')]['id']){delete _0x44a7a8[_0x034c('0x47')]['id'];}return db[_0x034c('0x29')][_0x034c('0x44')]({'where':{'id':_0x44a7a8[_0x034c('0x48')]['id']}})[_0x034c('0x21')](handleEntityNotFound(_0x48ef34,null))['then'](saveUpdates(_0x44a7a8[_0x034c('0x47')],null))[_0x034c('0x21')](respondWithResult(_0x48ef34,null))['catch'](handleError(_0x48ef34,null));};exports[_0x034c('0x22')]=function(_0xdb332a,_0x5c85d1){return db['FreshdeskConfiguration'][_0x034c('0x44')]({'where':{'id':_0xdb332a[_0x034c('0x48')]['id']}})[_0x034c('0x21')](handleEntityNotFound(_0x5c85d1,null))[_0x034c('0x21')](removeEntity(_0x5c85d1,null))[_0x034c('0x45')](handleError(_0x5c85d1,null));};exports[_0x034c('0x49')]=function(_0x1eeabf,_0x5d6d23,_0x4dec0e){var _0x1efa59={};var _0x1a4e8b={};var _0x99fe07;var _0x4e4996;return db[_0x034c('0x29')][_0x034c('0x4a')]({'where':{'id':_0x1eeabf[_0x034c('0x48')]['id']}})[_0x034c('0x21')](handleEntityNotFound(_0x5d6d23,null))['then'](function(_0x45e185){if(_0x45e185){_0x99fe07=_0x45e185;_0x1a4e8b[_0x034c('0x30')]=_['keys'](db[_0x034c('0x4b')][_0x034c('0x42')]);_0x1a4e8b['query']=_[_0x034c('0x2c')](_0x1eeabf['query']);_0x1a4e8b[_0x034c('0x2e')]=_['intersection'](_0x1a4e8b[_0x034c('0x30')],_0x1a4e8b[_0x034c('0x2d')]);_0x1efa59[_0x034c('0x31')]=_[_0x034c('0x2f')](_0x1a4e8b[_0x034c('0x30')],qs[_0x034c('0x32')](_0x1eeabf[_0x034c('0x2d')][_0x034c('0x32')]));_0x1efa59[_0x034c('0x31')]=_0x1efa59[_0x034c('0x31')][_0x034c('0x33')]?_0x1efa59['attributes']:_0x1a4e8b[_0x034c('0x30')];_0x1efa59[_0x034c('0x36')]=qs[_0x034c('0x37')](_0x1eeabf[_0x034c('0x2d')][_0x034c('0x37')]);_0x1efa59[_0x034c('0x3a')]=qs[_0x034c('0x2e')](_[_0x034c('0x38')](_0x1eeabf[_0x034c('0x2d')],_0x1a4e8b[_0x034c('0x2e')]));if(_0x1eeabf[_0x034c('0x2d')][_0x034c('0x39')]){_0x1efa59[_0x034c('0x3a')]=_['merge'](_0x1efa59[_0x034c('0x3a')],{'$or':_['map'](_0x1efa59[_0x034c('0x31')],function(_0x1c260a){var _0x105630={};_0x105630[_0x1c260a]={'$like':'%'+_0x1eeabf[_0x034c('0x2d')]['filter']+'%'};return _0x105630;})});}_0x1efa59=_[_0x034c('0x3b')]({},_0x1efa59,_0x1eeabf[_0x034c('0x43')]);return _0x99fe07[_0x034c('0x49')](_0x1efa59);}})[_0x034c('0x21')](function(_0x330f5d){if(_0x330f5d){_0x4e4996=_0x330f5d[_0x034c('0x33')];if(!_0x1eeabf[_0x034c('0x2d')]['hasOwnProperty'](_0x034c('0x35'))){_0x1efa59[_0x034c('0x1c')]=qs[_0x034c('0x1c')](_0x1eeabf['query'][_0x034c('0x1c')]);_0x1efa59[_0x034c('0x1a')]=qs[_0x034c('0x1a')](_0x1eeabf[_0x034c('0x2d')][_0x034c('0x1a')]);}return _0x99fe07[_0x034c('0x49')](_0x1efa59);}})[_0x034c('0x21')](function(_0x7538f0){if(_0x7538f0){return _0x7538f0?{'count':_0x4e4996,'rows':_0x7538f0}:null;}})[_0x034c('0x21')](respondWithResult(_0x5d6d23,null))['catch'](handleError(_0x5d6d23,null));};exports['getSubjects']=function(_0x37ebe2,_0x268bbc,_0xc405f0){var _0x3819c5={};var _0x34e5ed={};var _0x5d4d6f;var _0x195ffb;return db[_0x034c('0x29')][_0x034c('0x4a')]({'where':{'id':_0x37ebe2[_0x034c('0x48')]['id']}})['then'](handleEntityNotFound(_0x268bbc,null))[_0x034c('0x21')](function(_0x2c43a0){if(_0x2c43a0){_0x5d4d6f=_0x2c43a0;_0x34e5ed[_0x034c('0x30')]=_[_0x034c('0x2c')](db[_0x034c('0x4b')][_0x034c('0x42')]);_0x34e5ed[_0x034c('0x2d')]=_['keys'](_0x37ebe2['query']);_0x34e5ed[_0x034c('0x2e')]=_['intersection'](_0x34e5ed[_0x034c('0x30')],_0x34e5ed[_0x034c('0x2d')]);_0x3819c5[_0x034c('0x31')]=_[_0x034c('0x2f')](_0x34e5ed[_0x034c('0x30')],qs['fields'](_0x37ebe2[_0x034c('0x2d')][_0x034c('0x32')]));_0x3819c5['attributes']=_0x3819c5['attributes'][_0x034c('0x33')]?_0x3819c5[_0x034c('0x31')]:_0x34e5ed[_0x034c('0x30')];_0x3819c5[_0x034c('0x36')]=qs[_0x034c('0x37')](_0x37ebe2['query']['sort']);_0x3819c5[_0x034c('0x3a')]=qs[_0x034c('0x2e')](_['pick'](_0x37ebe2[_0x034c('0x2d')],_0x34e5ed[_0x034c('0x2e')]));if(_0x37ebe2['query'][_0x034c('0x39')]){_0x3819c5[_0x034c('0x3a')]=_[_0x034c('0x3b')](_0x3819c5['where'],{'$or':_[_0x034c('0x28')](_0x3819c5[_0x034c('0x31')],function(_0x5f2ae5){var _0x28550d={};_0x28550d[_0x5f2ae5]={'$like':'%'+_0x37ebe2[_0x034c('0x2d')][_0x034c('0x39')]+'%'};return _0x28550d;})});}_0x3819c5=_[_0x034c('0x3b')]({},_0x3819c5,_0x37ebe2[_0x034c('0x43')]);return _0x5d4d6f[_0x034c('0x4c')](_0x3819c5);}})['then'](function(_0x3f0e6b){if(_0x3f0e6b){_0x195ffb=_0x3f0e6b[_0x034c('0x33')];if(!_0x37ebe2[_0x034c('0x2d')][_0x034c('0x34')](_0x034c('0x35'))){_0x3819c5[_0x034c('0x1c')]=qs[_0x034c('0x1c')](_0x37ebe2[_0x034c('0x2d')]['limit']);_0x3819c5[_0x034c('0x1a')]=qs[_0x034c('0x1a')](_0x37ebe2['query'][_0x034c('0x1a')]);}return _0x5d4d6f[_0x034c('0x4c')](_0x3819c5);}})[_0x034c('0x21')](function(_0x411f3d){if(_0x411f3d){return _0x411f3d?{'count':_0x195ffb,'rows':_0x411f3d}:null;}})[_0x034c('0x21')](respondWithResult(_0x268bbc,null))[_0x034c('0x45')](handleError(_0x268bbc,null));};exports['getDescriptions']=function(_0xdc2f54,_0x254e22,_0x39a016){var _0x1e7295={};var _0x4cfd4e={};var _0xca1553;var _0x570a75;return db[_0x034c('0x29')]['findOne']({'where':{'id':_0xdc2f54[_0x034c('0x48')]['id']}})[_0x034c('0x21')](handleEntityNotFound(_0x254e22,null))['then'](function(_0x39a799){if(_0x39a799){_0xca1553=_0x39a799;_0x4cfd4e['model']=_[_0x034c('0x2c')](db['FreshdeskField']['rawAttributes']);_0x4cfd4e[_0x034c('0x2d')]=_[_0x034c('0x2c')](_0xdc2f54['query']);_0x4cfd4e['filters']=_[_0x034c('0x2f')](_0x4cfd4e[_0x034c('0x30')],_0x4cfd4e['query']);_0x1e7295['attributes']=_[_0x034c('0x2f')](_0x4cfd4e[_0x034c('0x30')],qs['fields'](_0xdc2f54['query'][_0x034c('0x32')]));_0x1e7295[_0x034c('0x31')]=_0x1e7295['attributes'][_0x034c('0x33')]?_0x1e7295[_0x034c('0x31')]:_0x4cfd4e[_0x034c('0x30')];_0x1e7295[_0x034c('0x36')]=qs['sort'](_0xdc2f54[_0x034c('0x2d')][_0x034c('0x37')]);_0x1e7295[_0x034c('0x3a')]=qs[_0x034c('0x2e')](_[_0x034c('0x38')](_0xdc2f54['query'],_0x4cfd4e[_0x034c('0x2e')]));if(_0xdc2f54[_0x034c('0x2d')]['filter']){_0x1e7295[_0x034c('0x3a')]=_[_0x034c('0x3b')](_0x1e7295[_0x034c('0x3a')],{'$or':_['map'](_0x1e7295['attributes'],function(_0x3b96f1){var _0x36189c={};_0x36189c[_0x3b96f1]={'$like':'%'+_0xdc2f54[_0x034c('0x2d')]['filter']+'%'};return _0x36189c;})});}_0x1e7295=_[_0x034c('0x3b')]({},_0x1e7295,_0xdc2f54[_0x034c('0x43')]);return _0xca1553[_0x034c('0x4d')](_0x1e7295);}})[_0x034c('0x21')](function(_0x5f0f16){if(_0x5f0f16){_0x570a75=_0x5f0f16['length'];if(!_0xdc2f54['query'][_0x034c('0x34')]('nolimit')){_0x1e7295[_0x034c('0x1c')]=qs[_0x034c('0x1c')](_0xdc2f54[_0x034c('0x2d')][_0x034c('0x1c')]);_0x1e7295[_0x034c('0x1a')]=qs[_0x034c('0x1a')](_0xdc2f54[_0x034c('0x2d')][_0x034c('0x1a')]);}return _0xca1553['getDescriptions'](_0x1e7295);}})[_0x034c('0x21')](function(_0x5eb6d1){if(_0x5eb6d1){return _0x5eb6d1?{'count':_0x570a75,'rows':_0x5eb6d1}:null;}})[_0x034c('0x21')](respondWithResult(_0x254e22,null))[_0x034c('0x45')](handleError(_0x254e22,null));};exports[_0x034c('0x4e')]=function(_0x3fcd98,_0x2d3b1d,_0xca032d){var _0x4b8023={};var _0x588c78={};var _0x4c1a6e;var _0x46e00d;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x3fcd98[_0x034c('0x48')]['id']}})[_0x034c('0x21')](handleEntityNotFound(_0x2d3b1d,null))[_0x034c('0x21')](function(_0x76799a){if(_0x76799a){_0x4c1a6e=_0x76799a;_0x588c78[_0x034c('0x30')]=_[_0x034c('0x2c')](db[_0x034c('0x4f')][_0x034c('0x42')]);_0x588c78['query']=_[_0x034c('0x2c')](_0x3fcd98[_0x034c('0x2d')]);_0x588c78[_0x034c('0x2e')]=_['intersection'](_0x588c78[_0x034c('0x30')],_0x588c78['query']);_0x4b8023[_0x034c('0x31')]=_[_0x034c('0x2f')](_0x588c78[_0x034c('0x30')],qs[_0x034c('0x32')](_0x3fcd98[_0x034c('0x2d')][_0x034c('0x32')]));_0x4b8023[_0x034c('0x31')]=_0x4b8023[_0x034c('0x31')]['length']?_0x4b8023[_0x034c('0x31')]:_0x588c78[_0x034c('0x30')];_0x4b8023[_0x034c('0x36')]=qs[_0x034c('0x37')](_0x3fcd98[_0x034c('0x2d')][_0x034c('0x37')]);_0x4b8023[_0x034c('0x3a')]=qs['filters'](_[_0x034c('0x38')](_0x3fcd98[_0x034c('0x2d')],_0x588c78[_0x034c('0x2e')]));if(_0x3fcd98[_0x034c('0x2d')][_0x034c('0x39')]){_0x4b8023['where']=_['merge'](_0x4b8023[_0x034c('0x3a')],{'$or':_[_0x034c('0x28')](_0x4b8023[_0x034c('0x31')],function(_0x1d2cde){var _0x132cc4={};_0x132cc4[_0x1d2cde]={'$like':'%'+_0x3fcd98[_0x034c('0x2d')][_0x034c('0x39')]+'%'};return _0x132cc4;})});}_0x4b8023=_[_0x034c('0x3b')]({},_0x4b8023,_0x3fcd98[_0x034c('0x43')]);return _0x4c1a6e[_0x034c('0x4e')](_0x4b8023);}})['then'](function(_0x7f176d){if(_0x7f176d){_0x46e00d=_0x7f176d['length'];if(!_0x3fcd98[_0x034c('0x2d')][_0x034c('0x34')](_0x034c('0x35'))){_0x4b8023[_0x034c('0x1c')]=qs[_0x034c('0x1c')](_0x3fcd98[_0x034c('0x2d')][_0x034c('0x1c')]);_0x4b8023['offset']=qs[_0x034c('0x1a')](_0x3fcd98[_0x034c('0x2d')][_0x034c('0x1a')]);}return _0x4c1a6e[_0x034c('0x4e')](_0x4b8023);}})[_0x034c('0x21')](function(_0x54efaf){if(_0x54efaf){return _0x54efaf?{'count':_0x46e00d,'rows':_0x54efaf}:null;}})[_0x034c('0x21')](respondWithResult(_0x2d3b1d,null))[_0x034c('0x45')](handleError(_0x2d3b1d,null));};exports[_0x034c('0x50')]=function(_0x1ec025,_0x3c0953,_0x360981){if(_0x1ec025['body']['id']){delete _0x1ec025[_0x034c('0x47')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x1ec025[_0x034c('0x48')]['id']}})[_0x034c('0x21')](handleEntityNotFound(_0x3c0953,null))['then'](function(_0x3c4b2e){if(_0x3c4b2e){return _0x3c4b2e[_0x034c('0x50')](_0x1ec025['body'][_0x034c('0x51')]||[]);}return null;})[_0x034c('0x21')](respondWithResult(_0x3c0953,null))[_0x034c('0x45')](handleError(_0x3c0953,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 952985f..7ac7598 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 _0xfbb6=['bluebird','request-promise','path','../../config/environment','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment'];(function(_0x4a4e4f,_0x3b31b2){var _0x47744d=function(_0x16bbaa){while(--_0x16bbaa){_0x4a4e4f['push'](_0x4a4e4f['shift']());}};_0x47744d(++_0x3b31b2);}(_0xfbb6,0x6a));var _0x6fbb=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0xfbb6[_0xf33afd];return _0x5f432a;};'use strict';var _=require(_0x6fbb('0x0'));var util=require('util');var logger=require(_0x6fbb('0x1'))(_0x6fbb('0x2'));var moment=require(_0x6fbb('0x3'));var BPromise=require(_0x6fbb('0x4'));var rp=require(_0x6fbb('0x5'));var fs=require('fs');var path=require(_0x6fbb('0x6'));var rimraf=require('rimraf');var config=require(_0x6fbb('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x13ac9e,_0x5cd417){return _0x13ac9e['define'](_0x6fbb('0x8'),attributes,{'tableName':_0x6fbb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c0e=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0x1c0e,0xff));var _0xe1c0=function(_0x38e7b8,_0x3e323f){_0x38e7b8=_0x38e7b8-0x0;var _0x45ff7a=_0x1c0e[_0x38e7b8];return _0x45ff7a;};'use strict';var _=require('lodash');var util=require(_0xe1c0('0x0'));var logger=require(_0xe1c0('0x1'))(_0xe1c0('0x2'));var moment=require('moment');var BPromise=require(_0xe1c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1c0('0x4'));var rimraf=require(_0xe1c0('0x5'));var config=require(_0xe1c0('0x6'));var attributes=require(_0xe1c0('0x7'));module[_0xe1c0('0x8')]=function(_0x104d4a,_0x393feb){return _0x104d4a[_0xe1c0('0x9')](_0xe1c0('0xa'),attributes,{'tableName':_0xe1c0('0xb'),'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 5a62957..932e000 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 _0x68df=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x57112d,_0x9ea573){var _0x3c32b9=function(_0x349dda){while(--_0x349dda){_0x57112d['push'](_0x57112d['shift']());}};_0x3c32b9(++_0x9ea573);}(_0x68df,0x1d0));var _0xf68d=function(_0x3ad737,_0x300131){_0x3ad737=_0x3ad737-0x0;var _0x16c1e2=_0x68df[_0x3ad737];return _0x16c1e2;};'use strict';var _=require(_0xf68d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf68d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf68d('0x2'));var db=require(_0xf68d('0x3'))['db'];var utils=require(_0xf68d('0x4'));var logger=require(_0xf68d('0x5'))(_0xf68d('0x6'));var config=require(_0xf68d('0x7'));var jayson=require(_0xf68d('0x8'));var client=jayson[_0xf68d('0x9')][_0xf68d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b7c80,_0x250e0a,_0x10683b){return new BPromise(function(_0x5d936c,_0x1ee900){return client[_0xf68d('0xb')](_0x4b7c80,_0x10683b)[_0xf68d('0xc')](function(_0x44a12a){logger['info'](_0xf68d('0xd'),_0x250e0a,_0xf68d('0xe'));logger[_0xf68d('0xf')](_0xf68d('0x10'),_0x250e0a,_0xf68d('0xe'),JSON[_0xf68d('0x11')](_0x44a12a));if(_0x44a12a[_0xf68d('0x12')]){if(_0x44a12a[_0xf68d('0x12')][_0xf68d('0x13')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x250e0a,_0x44a12a['error'][_0xf68d('0x14')]);return _0x1ee900(_0x44a12a['error'][_0xf68d('0x14')]);}logger[_0xf68d('0x12')](_0xf68d('0xd'),_0x250e0a,_0x44a12a['error']['message']);return _0x5d936c(_0x44a12a['error'][_0xf68d('0x14')]);}else{logger[_0xf68d('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x250e0a,_0xf68d('0xe'));_0x5d936c(_0x44a12a[_0xf68d('0x16')][_0xf68d('0x14')]);}})[_0xf68d('0x17')](function(_0x5a911c){logger[_0xf68d('0x12')](_0xf68d('0xd'),_0x250e0a,_0x5a911c);_0x1ee900(_0x5a911c);});});} \ No newline at end of file +var _0x61a6=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x173b83,_0x415369){var _0x852dd3=function(_0x4c76e0){while(--_0x4c76e0){_0x173b83['push'](_0x173b83['shift']());}};_0x852dd3(++_0x415369);}(_0x61a6,0x64));var _0x661a=function(_0x58d5c6,_0x265fcc){_0x58d5c6=_0x58d5c6-0x0;var _0x1fdb16=_0x61a6[_0x58d5c6];return _0x1fdb16;};'use strict';var _=require(_0x661a('0x0'));var util=require(_0x661a('0x1'));var moment=require(_0x661a('0x2'));var BPromise=require('bluebird');var rs=require(_0x661a('0x3'));var fs=require('fs');var Redis=require(_0x661a('0x4'));var db=require(_0x661a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x661a('0x6'))('rpc');var config=require(_0x661a('0x7'));var jayson=require(_0x661a('0x8'));var client=jayson[_0x661a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea9f8,_0x1c5656,_0x1d00f6){return new BPromise(function(_0x48f72c,_0x5caf92){return client[_0x661a('0xa')](_0x2ea9f8,_0x1d00f6)[_0x661a('0xb')](function(_0xa99b61){logger[_0x661a('0xc')](_0x661a('0xd'),_0x1c5656,_0x661a('0xe'));logger['debug'](_0x661a('0xf'),_0x1c5656,_0x661a('0xe'),JSON['stringify'](_0xa99b61));if(_0xa99b61['error']){if(_0xa99b61['error']['code']===0x1f4){logger[_0x661a('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1c5656,_0xa99b61['error'][_0x661a('0x11')]);return _0x5caf92(_0xa99b61[_0x661a('0x10')][_0x661a('0x11')]);}logger['error'](_0x661a('0xd'),_0x1c5656,_0xa99b61['error'][_0x661a('0x11')]);return _0x48f72c(_0xa99b61[_0x661a('0x10')][_0x661a('0x11')]);}else{logger[_0x661a('0xc')](_0x661a('0xd'),_0x1c5656,'request\x20sent');_0x48f72c(_0xa99b61[_0x661a('0x12')][_0x661a('0x11')]);}})[_0x661a('0x13')](function(_0x171c38){logger['error'](_0x661a('0xd'),_0x1c5656,_0x171c38);_0x5caf92(_0x171c38);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c864aba..bfa5b84 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 _0x0a89=['show','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x528a6e,_0x15abad){var _0x2cf224=function(_0x2c4e14){while(--_0x2c4e14){_0x528a6e['push'](_0x528a6e['shift']());}};_0x2cf224(++_0x15abad);}(_0x0a89,0x85));var _0x90a8=function(_0x3eff02,_0x15e996){_0x3eff02=_0x3eff02-0x0;var _0x14cf25=_0x0a89[_0x3eff02];return _0x14cf25;};'use strict';var multer=require(_0x90a8('0x0'));var util=require('util');var path=require(_0x90a8('0x1'));var timeout=require(_0x90a8('0x2'));var express=require(_0x90a8('0x3'));var router=express[_0x90a8('0x4')]();var fs_extra=require(_0x90a8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x90a8('0x6'));var config=require(_0x90a8('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x90a8('0x8')]('/',auth[_0x90a8('0x9')](),controller[_0x90a8('0xa')]);router[_0x90a8('0x8')]('/:id',auth[_0x90a8('0x9')](),controller[_0x90a8('0xb')]);router['post']('/',auth[_0x90a8('0x9')](),controller[_0x90a8('0xc')]);router[_0x90a8('0xd')](_0x90a8('0xe'),auth['isAuthenticated'](),controller[_0x90a8('0xf')]);router[_0x90a8('0x10')](_0x90a8('0xe'),auth['isAuthenticated'](),controller[_0x90a8('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfaf0=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0x3822a2,_0x5557bb){var _0x4f110f=function(_0x49c6a2){while(--_0x49c6a2){_0x3822a2['push'](_0x3822a2['shift']());}};_0x4f110f(++_0x5557bb);}(_0xfaf0,0x99));var _0x0faf=function(_0x3d18dd,_0x399c8c){_0x3d18dd=_0x3d18dd-0x0;var _0x4da859=_0xfaf0[_0x3d18dd];return _0x4da859;};'use strict';var multer=require(_0x0faf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0faf('0x1'));var express=require(_0x0faf('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0faf('0x3'));var config=require(_0x0faf('0x4'));var controller=require(_0x0faf('0x5'));router[_0x0faf('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0faf('0x6')](_0x0faf('0x7'),auth[_0x0faf('0x8')](),controller[_0x0faf('0x9')]);router[_0x0faf('0xa')]('/',auth[_0x0faf('0x8')](),controller[_0x0faf('0xb')]);router['put'](_0x0faf('0x7'),auth[_0x0faf('0x8')](),controller[_0x0faf('0xc')]);router[_0x0faf('0xd')](_0x0faf('0x7'),auth[_0x0faf('0x8')](),controller[_0x0faf('0xe')]);module[_0x0faf('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 1a86126..4449c17 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 _0x64d8=['variable','customVariable','STRING','sequelize','ENUM','string'];(function(_0x1b35b6,_0x57c933){var _0x5e0e18=function(_0x5a8666){while(--_0x5a8666){_0x1b35b6['push'](_0x1b35b6['shift']());}};_0x5e0e18(++_0x57c933);}(_0x64d8,0x11d));var _0x864d=function(_0x2f47f1,_0x17f6a7){_0x2f47f1=_0x2f47f1-0x0;var _0x1e2329=_0x64d8[_0x2f47f1];return _0x1e2329;};'use strict';var Sequelize=require(_0x864d('0x0'));module['exports']={'type':{'type':Sequelize[_0x864d('0x1')](_0x864d('0x2'),_0x864d('0x3'),_0x864d('0x4'),'keyValue','picklist'),'defaultValue':_0x864d('0x2')},'content':{'type':Sequelize[_0x864d('0x5')]},'key':{'type':Sequelize[_0x864d('0x5')]},'keyType':{'type':Sequelize[_0x864d('0x1')](_0x864d('0x2'),_0x864d('0x3'),_0x864d('0x4'))},'keyContent':{'type':Sequelize[_0x864d('0x5')]},'idField':{'type':Sequelize[_0x864d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x864d('0x5')]}}; \ No newline at end of file +var _0xaa07=['variable','customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM'];(function(_0x67692d,_0x325a75){var _0x1016c3=function(_0x36f451){while(--_0x36f451){_0x67692d['push'](_0x67692d['shift']());}};_0x1016c3(++_0x325a75);}(_0xaa07,0x1cd));var _0x7aa0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xaa07[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7aa0('0x0'));module[_0x7aa0('0x1')]={'type':{'type':Sequelize[_0x7aa0('0x2')]('string',_0x7aa0('0x3'),_0x7aa0('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7aa0('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x7aa0('0x6'),'variable',_0x7aa0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7aa0('0x5')]},'nameField':{'type':Sequelize[_0x7aa0('0x5')]},'customField':{'type':Sequelize[_0x7aa0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 0735aa5..0d29f1d 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 _0xa699=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','FreshdeskField','includeAll','include','rows','show','params','options','find','catch','create','body','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','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send'];(function(_0x24b38e,_0xa9b14){var _0x5a70a1=function(_0x2befad){while(--_0x2befad){_0x24b38e['push'](_0x24b38e['shift']());}};_0x5a70a1(++_0xa9b14);}(_0xa699,0x6b));var _0x9a69=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xa699[_0x5447aa];return _0xb21e53;};'use strict';var emlformat=require(_0x9a69('0x0'));var rimraf=require(_0x9a69('0x1'));var zipdir=require(_0x9a69('0x2'));var jsonpatch=require(_0x9a69('0x3'));var rp=require(_0x9a69('0x4'));var moment=require(_0x9a69('0x5'));var BPromise=require(_0x9a69('0x6'));var Mustache=require(_0x9a69('0x7'));var util=require(_0x9a69('0x8'));var path=require(_0x9a69('0x9'));var sox=require(_0x9a69('0xa'));var csv=require(_0x9a69('0xb'));var ejs=require(_0x9a69('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a69('0xd'));var squel=require(_0x9a69('0xe'));var crypto=require(_0x9a69('0xf'));var jsforce=require(_0x9a69('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9a69('0xb'));var querystring=require(_0x9a69('0x11'));var Papa=require(_0x9a69('0x12'));var Redis=require(_0x9a69('0x13'));var authService=require(_0x9a69('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a69('0x15'));var logger=require('../../config/logger')(_0x9a69('0x16'));var utils=require(_0x9a69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a69('0x18'));var db=require(_0x9a69('0x19'))['db'];function respondWithStatusCode(_0x56e43f,_0x81dfb1){_0x81dfb1=_0x81dfb1||0xcc;return function(_0x2e613e){if(_0x2e613e){return _0x56e43f[_0x9a69('0x1a')](_0x81dfb1);}return _0x56e43f[_0x9a69('0x1b')](_0x81dfb1)[_0x9a69('0x1c')]();};}function respondWithResult(_0x70475b,_0x34b5b0){_0x34b5b0=_0x34b5b0||0xc8;return function(_0x2a5b83){if(_0x2a5b83){return _0x70475b[_0x9a69('0x1b')](_0x34b5b0)['json'](_0x2a5b83);}};}function respondWithFilteredResult(_0x2323ae,_0x17de41){return function(_0x2be3ec){if(_0x2be3ec){var _0x5e982d=typeof _0x17de41[_0x9a69('0x1d')]===_0x9a69('0x1e')&&typeof _0x17de41[_0x9a69('0x1f')]===_0x9a69('0x1e');var _0xed2c19=_0x2be3ec['count'];var _0x2e4264=_0x5e982d?0x0:_0x17de41[_0x9a69('0x1d')];var _0x186a5a=_0x5e982d?_0x2be3ec[_0x9a69('0x20')]:_0x17de41[_0x9a69('0x1d')]+_0x17de41[_0x9a69('0x1f')];var _0x2633d5;if(_0x186a5a>=_0xed2c19){_0x186a5a=_0xed2c19;_0x2633d5=0xc8;}else{_0x2633d5=0xce;}_0x2323ae[_0x9a69('0x1b')](_0x2633d5);return _0x2323ae[_0x9a69('0x21')](_0x9a69('0x22'),_0x2e4264+'-'+_0x186a5a+'/'+_0xed2c19)['json'](_0x2be3ec);}return null;};}function patchUpdates(_0x4d8db9){return function(_0x5ebb09){try{jsonpatch[_0x9a69('0x23')](_0x5ebb09,_0x4d8db9,!![]);}catch(_0x12ebe5){return BPromise['reject'](_0x12ebe5);}return _0x5ebb09[_0x9a69('0x24')]();};}function saveUpdates(_0x527ca6,_0x265291){return function(_0x4d6a93){if(_0x4d6a93){return _0x4d6a93['update'](_0x527ca6)['then'](function(_0x189989){return _0x189989;});}return null;};}function removeEntity(_0x5f4138,_0x140cbe){return function(_0x28f5f7){if(_0x28f5f7){return _0x28f5f7[_0x9a69('0x25')]()[_0x9a69('0x26')](function(){_0x5f4138['status'](0xcc)[_0x9a69('0x1c')]();});}};}function handleEntityNotFound(_0x5130b2,_0x203d32){return function(_0x4ef126){if(!_0x4ef126){_0x5130b2['sendStatus'](0x194);}return _0x4ef126;};}function handleError(_0xbcdcd9,_0xf6fea2){_0xf6fea2=_0xf6fea2||0x1f4;return function(_0x268cef){logger[_0x9a69('0x27')](_0x268cef[_0x9a69('0x28')]);if(_0x268cef[_0x9a69('0x29')]){delete _0x268cef[_0x9a69('0x29')];}_0xbcdcd9[_0x9a69('0x1b')](_0xf6fea2)[_0x9a69('0x2a')](_0x268cef);};}exports[_0x9a69('0x2b')]=function(_0x47916a,_0x1ff48e){var _0x165a87={},_0x5433b3={},_0x54e643={'count':0x0,'rows':[]};var _0x4b3539=_[_0x9a69('0x2c')](db['FreshdeskField'][_0x9a69('0x2d')],function(_0x2d15e3){return{'name':_0x2d15e3[_0x9a69('0x2e')],'type':_0x2d15e3[_0x9a69('0x2f')][_0x9a69('0x30')]};});_0x5433b3[_0x9a69('0x31')]=_[_0x9a69('0x2c')](_0x4b3539,_0x9a69('0x29'));_0x5433b3[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x47916a[_0x9a69('0x32')]);_0x5433b3[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x5433b3[_0x9a69('0x31')],_0x5433b3[_0x9a69('0x32')]);_0x165a87[_0x9a69('0x36')]=_[_0x9a69('0x35')](_0x5433b3['model'],qs['fields'](_0x47916a[_0x9a69('0x32')][_0x9a69('0x37')]));_0x165a87[_0x9a69('0x36')]=_0x165a87[_0x9a69('0x36')][_0x9a69('0x38')]?_0x165a87['attributes']:_0x5433b3['model'];if(!_0x47916a['query']['hasOwnProperty'](_0x9a69('0x39'))){_0x165a87[_0x9a69('0x1f')]=qs[_0x9a69('0x1f')](_0x47916a[_0x9a69('0x32')][_0x9a69('0x1f')]);_0x165a87[_0x9a69('0x1d')]=qs['offset'](_0x47916a['query'][_0x9a69('0x1d')]);}_0x165a87[_0x9a69('0x3a')]=qs[_0x9a69('0x3b')](_0x47916a['query'][_0x9a69('0x3b')]);_0x165a87[_0x9a69('0x3c')]=qs[_0x9a69('0x34')](_[_0x9a69('0x3d')](_0x47916a[_0x9a69('0x32')],_0x5433b3[_0x9a69('0x34')]),_0x4b3539);if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]){_0x165a87[_0x9a69('0x3c')]=_[_0x9a69('0x3f')](_0x165a87[_0x9a69('0x3c')],{'$or':_['map'](_0x4b3539,function(_0x1ac0b7){if(_0x1ac0b7['type']!=='VIRTUAL'){var _0x4cc399={};_0x4cc399[_0x1ac0b7['name']]={'$like':'%'+_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]+'%'};return _0x4cc399;}})});}_0x165a87=_['merge']({},_0x165a87,_0x47916a['options']);var _0x5a1e62={'where':_0x165a87[_0x9a69('0x3c')]};return db[_0x9a69('0x40')][_0x9a69('0x20')](_0x5a1e62)['then'](function(_0x2ff507){_0x54e643[_0x9a69('0x20')]=_0x2ff507;if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x41')]){_0x165a87[_0x9a69('0x42')]=[{'all':!![]}];}return db[_0x9a69('0x40')]['findAll'](_0x165a87);})[_0x9a69('0x26')](function(_0x27d0db){_0x54e643[_0x9a69('0x43')]=_0x27d0db;return _0x54e643;})[_0x9a69('0x26')](respondWithFilteredResult(_0x1ff48e,_0x165a87))['catch'](handleError(_0x1ff48e,null));};exports[_0x9a69('0x44')]=function(_0x373939,_0x5b309a){var _0x318de1={'raw':!![],'where':{'id':_0x373939[_0x9a69('0x45')]['id']}},_0x3c78e2={};_0x3c78e2['model']=_['keys'](db['FreshdeskField'][_0x9a69('0x2d')]);_0x3c78e2[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x373939[_0x9a69('0x32')]);_0x3c78e2['filters']=_[_0x9a69('0x35')](_0x3c78e2[_0x9a69('0x31')],_0x3c78e2[_0x9a69('0x32')]);_0x318de1[_0x9a69('0x36')]=_['intersection'](_0x3c78e2[_0x9a69('0x31')],qs[_0x9a69('0x37')](_0x373939[_0x9a69('0x32')][_0x9a69('0x37')]));_0x318de1['attributes']=_0x318de1[_0x9a69('0x36')]['length']?_0x318de1[_0x9a69('0x36')]:_0x3c78e2['model'];if(_0x373939[_0x9a69('0x32')]['includeAll']){_0x318de1[_0x9a69('0x42')]=[{'all':!![]}];}_0x318de1=_['merge']({},_0x318de1,_0x373939[_0x9a69('0x46')]);return db[_0x9a69('0x40')][_0x9a69('0x47')](_0x318de1)[_0x9a69('0x26')](handleEntityNotFound(_0x5b309a,null))['then'](respondWithResult(_0x5b309a,null))[_0x9a69('0x48')](handleError(_0x5b309a,null));};exports[_0x9a69('0x49')]=function(_0x77781d,_0x2537b0){return db[_0x9a69('0x40')][_0x9a69('0x49')](_0x77781d[_0x9a69('0x4a')],{})[_0x9a69('0x26')](respondWithResult(_0x2537b0,0xc9))[_0x9a69('0x48')](handleError(_0x2537b0,null));};exports['update']=function(_0x281ef0,_0x6046a7){if(_0x281ef0[_0x9a69('0x4a')]['id']){delete _0x281ef0[_0x9a69('0x4a')]['id'];}return db[_0x9a69('0x40')][_0x9a69('0x47')]({'where':{'id':_0x281ef0[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x6046a7,null))[_0x9a69('0x26')](saveUpdates(_0x281ef0[_0x9a69('0x4a')],null))[_0x9a69('0x26')](respondWithResult(_0x6046a7,null))[_0x9a69('0x48')](handleError(_0x6046a7,null));};exports[_0x9a69('0x25')]=function(_0x43b084,_0x18ab7a){return db['FreshdeskField'][_0x9a69('0x47')]({'where':{'id':_0x43b084[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x18ab7a,null))[_0x9a69('0x26')](removeEntity(_0x18ab7a,null))[_0x9a69('0x48')](handleError(_0x18ab7a,null));}; \ No newline at end of file +var _0x98e5=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','name','index','FreshdeskField','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','filters','find','create','body','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel'];(function(_0x21d88d,_0x4ff19c){var _0x30a579=function(_0x24cf7a){while(--_0x24cf7a){_0x21d88d['push'](_0x21d88d['shift']());}};_0x30a579(++_0x4ff19c);}(_0x98e5,0x8a));var _0x598e=function(_0x559d10,_0x34a9ab){_0x559d10=_0x559d10-0x0;var _0x12dc5=_0x98e5[_0x559d10];return _0x12dc5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x598e('0x0'));var rp=require(_0x598e('0x1'));var moment=require('moment');var BPromise=require(_0x598e('0x2'));var Mustache=require(_0x598e('0x3'));var util=require('util');var path=require(_0x598e('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x598e('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x598e('0x6'));var squel=require(_0x598e('0x7'));var crypto=require(_0x598e('0x8'));var jsforce=require(_0x598e('0x9'));var deskjs=require(_0x598e('0xa'));var toCsv=require(_0x598e('0xb'));var querystring=require(_0x598e('0xc'));var Papa=require(_0x598e('0xd'));var Redis=require(_0x598e('0xe'));var authService=require(_0x598e('0xf'));var qs=require(_0x598e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x598e('0x11'));var logger=require(_0x598e('0x12'))('api');var utils=require(_0x598e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x598e('0x14'));var db=require(_0x598e('0x15'))['db'];function respondWithStatusCode(_0x2e3614,_0xd29d12){_0xd29d12=_0xd29d12||0xcc;return function(_0x3811b2){if(_0x3811b2){return _0x2e3614['sendStatus'](_0xd29d12);}return _0x2e3614[_0x598e('0x16')](_0xd29d12)['end']();};}function respondWithResult(_0x1c3f37,_0x51d7f0){_0x51d7f0=_0x51d7f0||0xc8;return function(_0x4e253a){if(_0x4e253a){return _0x1c3f37[_0x598e('0x16')](_0x51d7f0)[_0x598e('0x17')](_0x4e253a);}};}function respondWithFilteredResult(_0x3d6571,_0x38868b){return function(_0x34c672){if(_0x34c672){var _0x93ba6c=typeof _0x38868b[_0x598e('0x18')]==='undefined'&&typeof _0x38868b[_0x598e('0x19')]===_0x598e('0x1a');var _0x3521bc=_0x34c672[_0x598e('0x1b')];var _0x50ffbb=_0x93ba6c?0x0:_0x38868b[_0x598e('0x18')];var _0x2ecb1e=_0x93ba6c?_0x34c672[_0x598e('0x1b')]:_0x38868b[_0x598e('0x18')]+_0x38868b[_0x598e('0x19')];var _0x1c1085;if(_0x2ecb1e>=_0x3521bc){_0x2ecb1e=_0x3521bc;_0x1c1085=0xc8;}else{_0x1c1085=0xce;}_0x3d6571[_0x598e('0x16')](_0x1c1085);return _0x3d6571[_0x598e('0x1c')](_0x598e('0x1d'),_0x50ffbb+'-'+_0x2ecb1e+'/'+_0x3521bc)[_0x598e('0x17')](_0x34c672);}return null;};}function patchUpdates(_0x17e5f1){return function(_0x2a1a65){try{jsonpatch[_0x598e('0x1e')](_0x2a1a65,_0x17e5f1,!![]);}catch(_0x20c1bb){return BPromise[_0x598e('0x1f')](_0x20c1bb);}return _0x2a1a65[_0x598e('0x20')]();};}function saveUpdates(_0x233f16,_0x5b9c3){return function(_0x4a483b){if(_0x4a483b){return _0x4a483b[_0x598e('0x21')](_0x233f16)['then'](function(_0xdec363){return _0xdec363;});}return null;};}function removeEntity(_0x3cea88,_0x5df3ba){return function(_0x45e7ee){if(_0x45e7ee){return _0x45e7ee[_0x598e('0x22')]()[_0x598e('0x23')](function(){_0x3cea88[_0x598e('0x16')](0xcc)[_0x598e('0x24')]();});}};}function handleEntityNotFound(_0x3e434e,_0x2cb735){return function(_0x2a8fbc){if(!_0x2a8fbc){_0x3e434e[_0x598e('0x25')](0x194);}return _0x2a8fbc;};}function handleError(_0x19d4f8,_0x1a8d85){_0x1a8d85=_0x1a8d85||0x1f4;return function(_0x5d63ce){logger[_0x598e('0x26')](_0x5d63ce['stack']);if(_0x5d63ce[_0x598e('0x27')]){delete _0x5d63ce[_0x598e('0x27')];}_0x19d4f8[_0x598e('0x16')](_0x1a8d85)['send'](_0x5d63ce);};}exports[_0x598e('0x28')]=function(_0xc81d68,_0x158681){var _0x884e0f={},_0x43ddf0={},_0x5ecac3={'count':0x0,'rows':[]};var _0x4fad2d=_['map'](db[_0x598e('0x29')][_0x598e('0x2a')],function(_0x2ee4a5){return{'name':_0x2ee4a5[_0x598e('0x2b')],'type':_0x2ee4a5[_0x598e('0x2c')][_0x598e('0x2d')]};});_0x43ddf0['model']=_[_0x598e('0x2e')](_0x4fad2d,_0x598e('0x27'));_0x43ddf0[_0x598e('0x2f')]=_[_0x598e('0x30')](_0xc81d68[_0x598e('0x2f')]);_0x43ddf0['filters']=_[_0x598e('0x31')](_0x43ddf0[_0x598e('0x32')],_0x43ddf0[_0x598e('0x2f')]);_0x884e0f['attributes']=_[_0x598e('0x31')](_0x43ddf0[_0x598e('0x32')],qs['fields'](_0xc81d68[_0x598e('0x2f')][_0x598e('0x33')]));_0x884e0f[_0x598e('0x34')]=_0x884e0f[_0x598e('0x34')][_0x598e('0x35')]?_0x884e0f[_0x598e('0x34')]:_0x43ddf0['model'];if(!_0xc81d68[_0x598e('0x2f')][_0x598e('0x36')](_0x598e('0x37'))){_0x884e0f['limit']=qs['limit'](_0xc81d68[_0x598e('0x2f')]['limit']);_0x884e0f[_0x598e('0x18')]=qs[_0x598e('0x18')](_0xc81d68['query']['offset']);}_0x884e0f[_0x598e('0x38')]=qs['sort'](_0xc81d68[_0x598e('0x2f')][_0x598e('0x39')]);_0x884e0f[_0x598e('0x3a')]=qs['filters'](_[_0x598e('0x3b')](_0xc81d68['query'],_0x43ddf0['filters']),_0x4fad2d);if(_0xc81d68[_0x598e('0x2f')][_0x598e('0x3c')]){_0x884e0f['where']=_['merge'](_0x884e0f[_0x598e('0x3a')],{'$or':_[_0x598e('0x2e')](_0x4fad2d,function(_0x5254e5){if(_0x5254e5[_0x598e('0x2c')]!==_0x598e('0x3d')){var _0x38142c={};_0x38142c[_0x5254e5[_0x598e('0x27')]]={'$like':'%'+_0xc81d68[_0x598e('0x2f')][_0x598e('0x3c')]+'%'};return _0x38142c;}})});}_0x884e0f=_[_0x598e('0x3e')]({},_0x884e0f,_0xc81d68['options']);var _0x3ee264={'where':_0x884e0f[_0x598e('0x3a')]};return db[_0x598e('0x29')][_0x598e('0x1b')](_0x3ee264)[_0x598e('0x23')](function(_0x25af45){_0x5ecac3[_0x598e('0x1b')]=_0x25af45;if(_0xc81d68[_0x598e('0x2f')][_0x598e('0x3f')]){_0x884e0f[_0x598e('0x40')]=[{'all':!![]}];}return db[_0x598e('0x29')][_0x598e('0x41')](_0x884e0f);})[_0x598e('0x23')](function(_0x5633c9){_0x5ecac3['rows']=_0x5633c9;return _0x5ecac3;})[_0x598e('0x23')](respondWithFilteredResult(_0x158681,_0x884e0f))[_0x598e('0x42')](handleError(_0x158681,null));};exports[_0x598e('0x43')]=function(_0x3c7828,_0x4d3273){var _0x3799c7={'raw':!![],'where':{'id':_0x3c7828[_0x598e('0x44')]['id']}},_0x22f24b={};_0x22f24b['model']=_[_0x598e('0x30')](db[_0x598e('0x29')][_0x598e('0x2a')]);_0x22f24b[_0x598e('0x2f')]=_[_0x598e('0x30')](_0x3c7828[_0x598e('0x2f')]);_0x22f24b[_0x598e('0x45')]=_[_0x598e('0x31')](_0x22f24b[_0x598e('0x32')],_0x22f24b[_0x598e('0x2f')]);_0x3799c7[_0x598e('0x34')]=_['intersection'](_0x22f24b['model'],qs['fields'](_0x3c7828[_0x598e('0x2f')][_0x598e('0x33')]));_0x3799c7[_0x598e('0x34')]=_0x3799c7['attributes'][_0x598e('0x35')]?_0x3799c7[_0x598e('0x34')]:_0x22f24b[_0x598e('0x32')];if(_0x3c7828['query'][_0x598e('0x3f')]){_0x3799c7[_0x598e('0x40')]=[{'all':!![]}];}_0x3799c7=_[_0x598e('0x3e')]({},_0x3799c7,_0x3c7828['options']);return db[_0x598e('0x29')][_0x598e('0x46')](_0x3799c7)[_0x598e('0x23')](handleEntityNotFound(_0x4d3273,null))[_0x598e('0x23')](respondWithResult(_0x4d3273,null))[_0x598e('0x42')](handleError(_0x4d3273,null));};exports[_0x598e('0x47')]=function(_0x5ec8d8,_0x2c7c8f){return db[_0x598e('0x29')]['create'](_0x5ec8d8[_0x598e('0x48')],{})[_0x598e('0x23')](respondWithResult(_0x2c7c8f,0xc9))[_0x598e('0x42')](handleError(_0x2c7c8f,null));};exports['update']=function(_0x59e67b,_0x57b11a){if(_0x59e67b[_0x598e('0x48')]['id']){delete _0x59e67b[_0x598e('0x48')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x59e67b[_0x598e('0x44')]['id']}})[_0x598e('0x23')](handleEntityNotFound(_0x57b11a,null))['then'](saveUpdates(_0x59e67b['body'],null))[_0x598e('0x23')](respondWithResult(_0x57b11a,null))[_0x598e('0x42')](handleError(_0x57b11a,null));};exports[_0x598e('0x22')]=function(_0x34a43d,_0x5cbe61){return db['FreshdeskField'][_0x598e('0x46')]({'where':{'id':_0x34a43d['params']['id']}})[_0x598e('0x23')](handleEntityNotFound(_0x5cbe61,null))['then'](removeEntity(_0x5cbe61,null))[_0x598e('0x42')](handleError(_0x5cbe61,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d5bad62..6d92bca 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 _0x7217=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x1e53e0,_0x17c2b0){var _0x293cdf=function(_0x3bf7ce){while(--_0x3bf7ce){_0x1e53e0['push'](_0x1e53e0['shift']());}};_0x293cdf(++_0x17c2b0);}(_0x7217,0xa9));var _0x7721=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x7217[_0x49ca18];return _0x145d54;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7721('0x0'))('api');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var fs=require('fs');var path=require(_0x7721('0x4'));var rimraf=require(_0x7721('0x5'));var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0xb646e7,_0x4d935b){return _0xb646e7['define'](_0x7721('0x9'),attributes,{'tableName':_0x7721('0xa'),'paranoid':![],'indexes':[{'name':_0x7721('0xb'),'fields':[_0x7721('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe198=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports'];(function(_0xa1b78d,_0x3ad7f1){var _0x51d557=function(_0x329242){while(--_0x329242){_0xa1b78d['push'](_0xa1b78d['shift']());}};_0x51d557(++_0x3ad7f1);}(_0xe198,0x6f));var _0x8e19=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe198[_0x543084];return _0x306a57;};'use strict';var _=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8e19('0x2'));var BPromise=require(_0x8e19('0x3'));var rp=require(_0x8e19('0x4'));var fs=require('fs');var path=require(_0x8e19('0x5'));var rimraf=require(_0x8e19('0x6'));var config=require('../../config/environment');var attributes=require(_0x8e19('0x7'));module[_0x8e19('0x8')]=function(_0x2fb138,_0x188ce0){return _0x2fb138[_0x8e19('0x9')](_0x8e19('0xa'),attributes,{'tableName':_0x8e19('0xb'),'paranoid':![],'indexes':[{'name':_0x8e19('0xc'),'fields':[_0x8e19('0xd'),_0x8e19('0xe')],'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 1d1cff2..7e037e6 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 _0x196f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x53a356,_0x9da31a){var _0xc2b531=function(_0x393f2b){while(--_0x393f2b){_0x53a356['push'](_0x53a356['shift']());}};_0xc2b531(++_0x9da31a);}(_0x196f,0x16e));var _0xf196=function(_0x3f7014,_0x33a1bc){_0x3f7014=_0x3f7014-0x0;var _0x4b4eeb=_0x196f[_0x3f7014];return _0x4b4eeb;};'use strict';var _=require(_0xf196('0x0'));var util=require(_0xf196('0x1'));var moment=require(_0xf196('0x2'));var BPromise=require(_0xf196('0x3'));var rs=require(_0xf196('0x4'));var fs=require('fs');var Redis=require(_0xf196('0x5'));var db=require(_0xf196('0x6'))['db'];var utils=require(_0xf196('0x7'));var logger=require(_0xf196('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf196('0x9'));var client=jayson[_0xf196('0xa')][_0xf196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1aa1ee,_0x27df65,_0x28d76b){return new BPromise(function(_0x38c665,_0x9077d9){return client[_0xf196('0xc')](_0x1aa1ee,_0x28d76b)[_0xf196('0xd')](function(_0x50859b){logger[_0xf196('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x27df65,_0xf196('0xf'));logger['debug'](_0xf196('0x10'),_0x27df65,_0xf196('0xf'),JSON[_0xf196('0x11')](_0x50859b));if(_0x50859b[_0xf196('0x12')]){if(_0x50859b[_0xf196('0x12')][_0xf196('0x13')]===0x1f4){logger[_0xf196('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x27df65,_0x50859b[_0xf196('0x12')]['message']);return _0x9077d9(_0x50859b[_0xf196('0x12')]['message']);}logger[_0xf196('0x12')](_0xf196('0x14'),_0x27df65,_0x50859b[_0xf196('0x12')][_0xf196('0x15')]);return _0x38c665(_0x50859b['error'][_0xf196('0x15')]);}else{logger[_0xf196('0xe')](_0xf196('0x14'),_0x27df65,_0xf196('0xf'));_0x38c665(_0x50859b['result'][_0xf196('0x15')]);}})[_0xf196('0x16')](function(_0x2b132f){logger[_0xf196('0x12')](_0xf196('0x14'),_0x27df65,_0x2b132f);_0x9077d9(_0x2b132f);});});} \ No newline at end of file +var _0x3fe2=['client','request','info','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x20891f,_0x6a7c17){var _0x43304c=function(_0x42b437){while(--_0x42b437){_0x20891f['push'](_0x20891f['shift']());}};_0x43304c(++_0x6a7c17);}(_0x3fe2,0x83));var _0x23fe=function(_0x5d64b6,_0x22a509){_0x5d64b6=_0x5d64b6-0x0;var _0xe9993f=_0x3fe2[_0x5d64b6];return _0xe9993f;};'use strict';var _=require(_0x23fe('0x0'));var util=require(_0x23fe('0x1'));var moment=require(_0x23fe('0x2'));var BPromise=require(_0x23fe('0x3'));var rs=require(_0x23fe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23fe('0x5'))['db'];var utils=require(_0x23fe('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x23fe('0x7'));var jayson=require(_0x23fe('0x8'));var client=jayson[_0x23fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e2cdd,_0x33285f,_0x59a4c6){return new BPromise(function(_0x2283f2,_0x19a5fa){return client[_0x23fe('0xa')](_0x5e2cdd,_0x59a4c6)['then'](function(_0x1c615b){logger[_0x23fe('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x33285f,'request\x20sent');logger['debug'](_0x23fe('0xc'),_0x33285f,_0x23fe('0xd'),JSON[_0x23fe('0xe')](_0x1c615b));if(_0x1c615b[_0x23fe('0xf')]){if(_0x1c615b[_0x23fe('0xf')][_0x23fe('0x10')]===0x1f4){logger[_0x23fe('0xf')](_0x23fe('0x11'),_0x33285f,_0x1c615b[_0x23fe('0xf')]['message']);return _0x19a5fa(_0x1c615b[_0x23fe('0xf')]['message']);}logger[_0x23fe('0xf')](_0x23fe('0x11'),_0x33285f,_0x1c615b[_0x23fe('0xf')][_0x23fe('0x12')]);return _0x2283f2(_0x1c615b[_0x23fe('0xf')]['message']);}else{logger[_0x23fe('0xb')](_0x23fe('0x11'),_0x33285f,'request\x20sent');_0x2283f2(_0x1c615b['result']['message']);}})[_0x23fe('0x13')](function(_0x59091c){logger[_0x23fe('0xf')](_0x23fe('0x11'),_0x33285f,_0x59091c);_0x19a5fa(_0x59091c);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index cbfb6e0..14f263c 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 _0xd404=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show'];(function(_0x32f778,_0x14f110){var _0x5f1d67=function(_0x1a2415){while(--_0x1a2415){_0x32f778['push'](_0x32f778['shift']());}};_0x5f1d67(++_0x14f110);}(_0xd404,0x15b));var _0x4d40=function(_0x5ee5a1,_0x55ac78){_0x5ee5a1=_0x5ee5a1-0x0;var _0x20d117=_0xd404[_0x5ee5a1];return _0x20d117;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/:id',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0x11')]);router[_0x4d40('0x10')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x12')]);router[_0x4d40('0x13')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller['update']);router[_0x4d40('0x15')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);module[_0x4d40('0x17')]=router; \ No newline at end of file +var _0x6f7a=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x13cf5e,_0x216f0b){var _0xb26f15=function(_0x5b5e60){while(--_0x5b5e60){_0x13cf5e['push'](_0x13cf5e['shift']());}};_0xb26f15(++_0x216f0b);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x491cad,_0x31e8de){_0x491cad=_0x491cad-0x0;var _0x339f32=_0x6f7a[_0x491cad];return _0x339f32;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa6f7('0x10')]);router[_0xa6f7('0x11')]('/',auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['post'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);router[_0xa6f7('0x14')]('/:id',auth[_0xa6f7('0xb')](),controller['update']);router[_0xa6f7('0x15')](_0xa6f7('0xd'),auth[_0xa6f7('0xb')](),controller['destroy']);module[_0xa6f7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 521f4fd..50f4eae 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 _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x3996e7,_0x4328a1){var _0x2369d3=function(_0x10449d){while(--_0x10449d){_0x3996e7['push'](_0x3996e7['shift']());}};_0x2369d3(++_0x4328a1);}(_0xe5af,0x9c));var _0xfe5a=function(_0x47f36c,_0xa846e0){_0x47f36c=_0x47f36c-0x0;var _0x2b5c83=_0xe5af[_0x47f36c];return _0x2b5c83;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x5cbf3a,_0x31b32b){var _0x360805=function(_0x13b23a){while(--_0x13b23a){_0x5cbf3a['push'](_0x5cbf3a['shift']());}};_0x360805(++_0x31b32b);}(_0x1a37,0xb4));var _0x71a3=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x1a37[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'name':{'type':Sequelize[_0x71a3('0x2')]},'description':{'type':Sequelize[_0x71a3('0x2')]},'username':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x3')},'apiKey':{'type':Sequelize[_0x71a3('0x2')]},'remoteUri':{'type':Sequelize[_0x71a3('0x2')],'unique':_0x71a3('0x4')},'serverUrl':{'type':Sequelize[_0x71a3('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 7821d7c..53c603e 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 _0xba78=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','FreshsalesAccount','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','rawAttributes','includeAll','options','find','create','body','params','getConfigurations','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0xba78,0x1a8));var _0x8ba7=function(_0x4f8421,_0xcae84d){_0x4f8421=_0x4f8421-0x0;var _0x3fb3ba=_0xba78[_0x4f8421];return _0x3fb3ba;};'use strict';var emlformat=require(_0x8ba7('0x0'));var rimraf=require(_0x8ba7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ba7('0x2'));var rp=require(_0x8ba7('0x3'));var moment=require(_0x8ba7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8ba7('0x5'));var util=require(_0x8ba7('0x6'));var path=require(_0x8ba7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8ba7('0x8'));var fs=require('fs');var fs_extra=require(_0x8ba7('0x9'));var _=require(_0x8ba7('0xa'));var squel=require(_0x8ba7('0xb'));var crypto=require(_0x8ba7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8ba7('0xd'));var toCsv=require(_0x8ba7('0xe'));var querystring=require(_0x8ba7('0xf'));var Papa=require(_0x8ba7('0x10'));var Redis=require(_0x8ba7('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8ba7('0x12'));var hardwareService=require(_0x8ba7('0x13'));var logger=require('../../config/logger')(_0x8ba7('0x14'));var utils=require(_0x8ba7('0x15'));var config=require(_0x8ba7('0x16'));var licenseUtil=require(_0x8ba7('0x17'));var db=require(_0x8ba7('0x18'))['db'];var integrations=require(_0x8ba7('0x19'));function respondWithStatusCode(_0x29cc66,_0x426dc4){_0x426dc4=_0x426dc4||0xcc;return function(_0x1e6b07){if(_0x1e6b07){return _0x29cc66[_0x8ba7('0x1a')](_0x426dc4);}return _0x29cc66[_0x8ba7('0x1b')](_0x426dc4)[_0x8ba7('0x1c')]();};}function respondWithResult(_0x9b144e,_0x5e371f){_0x5e371f=_0x5e371f||0xc8;return function(_0x161049){if(_0x161049){return _0x9b144e[_0x8ba7('0x1b')](_0x5e371f)['json'](_0x161049);}};}function respondWithFilteredResult(_0x2728e4,_0x475ff8){return function(_0x5842f5){if(_0x5842f5){var _0x39aa1e=typeof _0x475ff8[_0x8ba7('0x1d')]===_0x8ba7('0x1e')&&typeof _0x475ff8[_0x8ba7('0x1f')]===_0x8ba7('0x1e');var _0x494535=_0x5842f5[_0x8ba7('0x20')];var _0x12a768=_0x39aa1e?0x0:_0x475ff8[_0x8ba7('0x1d')];var _0x2439da=_0x39aa1e?_0x5842f5[_0x8ba7('0x20')]:_0x475ff8[_0x8ba7('0x1d')]+_0x475ff8[_0x8ba7('0x1f')];var _0x351224;if(_0x2439da>=_0x494535){_0x2439da=_0x494535;_0x351224=0xc8;}else{_0x351224=0xce;}_0x2728e4[_0x8ba7('0x1b')](_0x351224);return _0x2728e4[_0x8ba7('0x21')](_0x8ba7('0x22'),_0x12a768+'-'+_0x2439da+'/'+_0x494535)[_0x8ba7('0x23')](_0x5842f5);}return null;};}function patchUpdates(_0xe10989){return function(_0x5e4733){try{jsonpatch[_0x8ba7('0x24')](_0x5e4733,_0xe10989,!![]);}catch(_0xb7fbf0){return BPromise[_0x8ba7('0x25')](_0xb7fbf0);}return _0x5e4733[_0x8ba7('0x26')]();};}function saveUpdates(_0x159c89,_0x2f8f6e){return function(_0x42ab82){if(_0x42ab82){return _0x42ab82[_0x8ba7('0x27')](_0x159c89)[_0x8ba7('0x28')](function(_0x134d69){return _0x134d69;});}return null;};}function removeEntity(_0x594477,_0x22552a){return function(_0x48a9e1){if(_0x48a9e1){return _0x48a9e1[_0x8ba7('0x29')]()[_0x8ba7('0x28')](function(){_0x594477[_0x8ba7('0x1b')](0xcc)[_0x8ba7('0x1c')]();});}};}function handleEntityNotFound(_0x5b43c5,_0x5837b0){return function(_0x590b9f){if(!_0x590b9f){_0x5b43c5[_0x8ba7('0x1a')](0x194);}return _0x590b9f;};}function handleError(_0x5b233b,_0x1f8b38){_0x1f8b38=_0x1f8b38||0x1f4;return function(_0x47052b){logger['error'](_0x47052b['stack']);if(_0x47052b['name']){delete _0x47052b[_0x8ba7('0x2a')];}_0x5b233b[_0x8ba7('0x1b')](_0x1f8b38)[_0x8ba7('0x2b')](_0x47052b);};}exports[_0x8ba7('0x2c')]=function(_0x2337df,_0x4cc0f6){var _0xea09f={},_0x50b7a7={},_0x5a4d6f={'count':0x0,'rows':[]};var _0x12026f=_[_0x8ba7('0x2d')](db[_0x8ba7('0x2e')]['rawAttributes'],function(_0x1f8fbf){return{'name':_0x1f8fbf['fieldName'],'type':_0x1f8fbf[_0x8ba7('0x2f')][_0x8ba7('0x30')]};});_0x50b7a7[_0x8ba7('0x31')]=_['map'](_0x12026f,_0x8ba7('0x2a'));_0x50b7a7[_0x8ba7('0x32')]=_[_0x8ba7('0x33')](_0x2337df[_0x8ba7('0x32')]);_0x50b7a7[_0x8ba7('0x34')]=_['intersection'](_0x50b7a7[_0x8ba7('0x31')],_0x50b7a7['query']);_0xea09f['attributes']=_[_0x8ba7('0x35')](_0x50b7a7[_0x8ba7('0x31')],qs[_0x8ba7('0x36')](_0x2337df[_0x8ba7('0x32')][_0x8ba7('0x36')]));_0xea09f['attributes']=_0xea09f['attributes'][_0x8ba7('0x37')]?_0xea09f[_0x8ba7('0x38')]:_0x50b7a7[_0x8ba7('0x31')];if(!_0x2337df[_0x8ba7('0x32')][_0x8ba7('0x39')](_0x8ba7('0x3a'))){_0xea09f['limit']=qs[_0x8ba7('0x1f')](_0x2337df[_0x8ba7('0x32')][_0x8ba7('0x1f')]);_0xea09f[_0x8ba7('0x1d')]=qs[_0x8ba7('0x1d')](_0x2337df[_0x8ba7('0x32')]['offset']);}_0xea09f[_0x8ba7('0x3b')]=qs[_0x8ba7('0x3c')](_0x2337df['query'][_0x8ba7('0x3c')]);_0xea09f[_0x8ba7('0x3d')]=qs[_0x8ba7('0x34')](_[_0x8ba7('0x3e')](_0x2337df[_0x8ba7('0x32')],_0x50b7a7[_0x8ba7('0x34')]),_0x12026f);if(_0x2337df['query'][_0x8ba7('0x3f')]){_0xea09f['where']=_[_0x8ba7('0x40')](_0xea09f[_0x8ba7('0x3d')],{'$or':_[_0x8ba7('0x2d')](_0x12026f,function(_0x483295){if(_0x483295['type']!==_0x8ba7('0x41')){var _0x3b1cd0={};_0x3b1cd0[_0x483295[_0x8ba7('0x2a')]]={'$like':'%'+_0x2337df['query'][_0x8ba7('0x3f')]+'%'};return _0x3b1cd0;}})});}_0xea09f=_[_0x8ba7('0x40')]({},_0xea09f,_0x2337df['options']);var _0x647077={'where':_0xea09f[_0x8ba7('0x3d')]};return db[_0x8ba7('0x2e')][_0x8ba7('0x20')](_0x647077)[_0x8ba7('0x28')](function(_0x520bc0){_0x5a4d6f[_0x8ba7('0x20')]=_0x520bc0;if(_0x2337df['query']['includeAll']){_0xea09f[_0x8ba7('0x42')]=[{'all':!![]}];}return db[_0x8ba7('0x2e')][_0x8ba7('0x43')](_0xea09f);})[_0x8ba7('0x28')](function(_0x1f3497){_0x5a4d6f[_0x8ba7('0x44')]=_0x1f3497;return _0x5a4d6f;})[_0x8ba7('0x28')](respondWithFilteredResult(_0x4cc0f6,_0xea09f))[_0x8ba7('0x45')](handleError(_0x4cc0f6,null));};exports[_0x8ba7('0x46')]=function(_0x525b09,_0x590a77){var _0x2951a0={'raw':![],'where':{'id':_0x525b09['params']['id']}},_0x3ecdf8={};_0x3ecdf8[_0x8ba7('0x31')]=_[_0x8ba7('0x33')](db[_0x8ba7('0x2e')][_0x8ba7('0x47')]);_0x3ecdf8[_0x8ba7('0x32')]=_[_0x8ba7('0x33')](_0x525b09[_0x8ba7('0x32')]);_0x3ecdf8[_0x8ba7('0x34')]=_['intersection'](_0x3ecdf8['model'],_0x3ecdf8[_0x8ba7('0x32')]);_0x2951a0[_0x8ba7('0x38')]=_['intersection'](_0x3ecdf8[_0x8ba7('0x31')],qs[_0x8ba7('0x36')](_0x525b09[_0x8ba7('0x32')][_0x8ba7('0x36')]));_0x2951a0['attributes']=_0x2951a0[_0x8ba7('0x38')][_0x8ba7('0x37')]?_0x2951a0[_0x8ba7('0x38')]:_0x3ecdf8[_0x8ba7('0x31')];if(_0x525b09[_0x8ba7('0x32')][_0x8ba7('0x48')]){_0x2951a0[_0x8ba7('0x42')]=[{'all':!![]}];}_0x2951a0=_[_0x8ba7('0x40')]({},_0x2951a0,_0x525b09[_0x8ba7('0x49')]);return db[_0x8ba7('0x2e')][_0x8ba7('0x4a')](_0x2951a0)['then'](handleEntityNotFound(_0x590a77,null))[_0x8ba7('0x28')](respondWithResult(_0x590a77,null))['catch'](handleError(_0x590a77,null));};exports[_0x8ba7('0x4b')]=function(_0x1f1c61,_0x300622){return db[_0x8ba7('0x2e')][_0x8ba7('0x4b')](_0x1f1c61[_0x8ba7('0x4c')],{})[_0x8ba7('0x28')](respondWithResult(_0x300622,0xc9))[_0x8ba7('0x45')](handleError(_0x300622,null));};exports[_0x8ba7('0x27')]=function(_0x335259,_0x5e52d4){if(_0x335259['body']['id']){delete _0x335259[_0x8ba7('0x4c')]['id'];}return db['FreshsalesAccount'][_0x8ba7('0x4a')]({'where':{'id':_0x335259[_0x8ba7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e52d4,null))['then'](saveUpdates(_0x335259['body'],null))['then'](respondWithResult(_0x5e52d4,null))[_0x8ba7('0x45')](handleError(_0x5e52d4,null));};exports[_0x8ba7('0x29')]=function(_0x56e38d,_0x495356){return db['FreshsalesAccount'][_0x8ba7('0x4a')]({'where':{'id':_0x56e38d[_0x8ba7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x495356,null))[_0x8ba7('0x28')](removeEntity(_0x495356,null))[_0x8ba7('0x45')](handleError(_0x495356,null));};exports[_0x8ba7('0x4e')]=function(_0x346be9,_0x49745a,_0xc69c78){var _0x2a8e51={};var _0x2db57f={};var _0x2ac2c5;var _0x298c9b;return db[_0x8ba7('0x2e')]['findOne']({'where':{'id':_0x346be9[_0x8ba7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49745a,null))[_0x8ba7('0x28')](function(_0x467cf7){if(_0x467cf7){_0x2ac2c5=_0x467cf7;_0x2db57f[_0x8ba7('0x31')]=_[_0x8ba7('0x33')](db[_0x8ba7('0x4f')][_0x8ba7('0x47')]);_0x2db57f[_0x8ba7('0x32')]=_['keys'](_0x346be9[_0x8ba7('0x32')]);_0x2db57f[_0x8ba7('0x34')]=_['intersection'](_0x2db57f['model'],_0x2db57f[_0x8ba7('0x32')]);_0x2a8e51[_0x8ba7('0x38')]=_[_0x8ba7('0x35')](_0x2db57f['model'],qs['fields'](_0x346be9[_0x8ba7('0x32')][_0x8ba7('0x36')]));_0x2a8e51[_0x8ba7('0x38')]=_0x2a8e51['attributes'][_0x8ba7('0x37')]?_0x2a8e51[_0x8ba7('0x38')]:_0x2db57f[_0x8ba7('0x31')];_0x2a8e51[_0x8ba7('0x3b')]=qs['sort'](_0x346be9[_0x8ba7('0x32')]['sort']);_0x2a8e51['where']=qs[_0x8ba7('0x34')](_[_0x8ba7('0x3e')](_0x346be9[_0x8ba7('0x32')],_0x2db57f[_0x8ba7('0x34')]));if(_0x346be9[_0x8ba7('0x32')][_0x8ba7('0x3f')]){_0x2a8e51['where']=_[_0x8ba7('0x40')](_0x2a8e51[_0x8ba7('0x3d')],{'$or':_['map'](_0x2a8e51['attributes'],function(_0x212ca5){var _0x3e532d={};_0x3e532d[_0x212ca5]={'$like':'%'+_0x346be9['query']['filter']+'%'};return _0x3e532d;})});}_0x2a8e51=_[_0x8ba7('0x40')]({},_0x2a8e51,_0x346be9[_0x8ba7('0x49')]);return _0x2ac2c5[_0x8ba7('0x4e')](_0x2a8e51);}})['then'](function(_0xf74d8e){if(_0xf74d8e){_0x298c9b=_0xf74d8e[_0x8ba7('0x37')];if(!_0x346be9[_0x8ba7('0x32')]['hasOwnProperty']('nolimit')){_0x2a8e51[_0x8ba7('0x1f')]=qs[_0x8ba7('0x1f')](_0x346be9[_0x8ba7('0x32')][_0x8ba7('0x1f')]);_0x2a8e51[_0x8ba7('0x1d')]=qs['offset'](_0x346be9['query'][_0x8ba7('0x1d')]);}return _0x2ac2c5[_0x8ba7('0x4e')](_0x2a8e51);}})[_0x8ba7('0x28')](function(_0x4741c0){if(_0x4741c0){return _0x4741c0?{'count':_0x298c9b,'rows':_0x4741c0}:null;}})[_0x8ba7('0x28')](respondWithResult(_0x49745a,null))[_0x8ba7('0x45')](handleError(_0x49745a,null));};exports[_0x8ba7('0x50')]=function(_0x225736,_0xc36d94,_0x2cca56){if(_0x225736['body']['id']){delete _0x225736[_0x8ba7('0x4c')]['id'];}return db[_0x8ba7('0x2e')]['findOne']({'where':{'id':_0x225736[_0x8ba7('0x4d')]['id']}})[_0x8ba7('0x28')](handleEntityNotFound(_0xc36d94,null))[_0x8ba7('0x28')](function(_0x83db70){if(_0x83db70){_0x225736['body'][_0x8ba7('0x51')]=_0x83db70['id'];_0x225736[_0x8ba7('0x4c')][_0x8ba7('0x52')]=integrations[_0x8ba7('0x53')](_0x225736[_0x8ba7('0x4c')][_0x8ba7('0x54')],_0x225736[_0x8ba7('0x4c')][_0x8ba7('0x2f')]);_0x225736[_0x8ba7('0x4c')]['Descriptions']=integrations[_0x8ba7('0x55')](_0x225736[_0x8ba7('0x4c')][_0x8ba7('0x54')],_0x225736[_0x8ba7('0x4c')][_0x8ba7('0x2f')]);return db['FreshsalesConfiguration'][_0x8ba7('0x4b')](_0x225736[_0x8ba7('0x4c')],{'include':[{'model':db[_0x8ba7('0x56')],'as':_0x8ba7('0x52')},{'model':db[_0x8ba7('0x56')],'as':_0x8ba7('0x57')}]});}return null;})[_0x8ba7('0x28')](respondWithResult(_0xc36d94,null))[_0x8ba7('0x45')](handleError(_0xc36d94,null));};exports[_0x8ba7('0x58')]=function(_0x19a206,_0x4c7075,_0x49301c){var _0x5c354c='';var _0x2b632c='';return db[_0x8ba7('0x2e')]['findOne']({'where':{'id':_0x19a206[_0x8ba7('0x4d')]['id']},'attributes':['id',_0x8ba7('0x59'),_0x8ba7('0x5a'),_0x8ba7('0x5b')]})[_0x8ba7('0x28')](handleEntityNotFound(_0x4c7075,null))[_0x8ba7('0x28')](function(_0x40f1a4){if(_0x40f1a4){_0x2b632c=_0x40f1a4[_0x8ba7('0x59')];_0x5c354c=_0x40f1a4[_0x8ba7('0x5a')];var _0x3b8481=_0x40f1a4[_0x8ba7('0x5a')][_0x8ba7('0x5c')](-0x1);if(_0x3b8481==='/'){_0x5c354c=_0x5c354c['substring'](0x0,_0x5c354c['lastIndexOf'](_0x3b8481));}return rp({'method':'GET','uri':util[_0x8ba7('0x5d')](_0x8ba7('0x5e'),_0x5c354c,_0x8ba7('0x5f')),'headers':{'Authorization':_0x8ba7('0x60')+_0x40f1a4[_0x8ba7('0x5b')]},'json':!![]});}})[_0x8ba7('0x28')](function(_0x58f05a){if(_0x58f05a){var _0x4d97a5=_0x58f05a[_0x8ba7('0x61')];var _0x2d3f3f=![];var _0x46605a=null;for(_0x46605a=0x0;_0x46605a<_0x4d97a5[_0x8ba7('0x37')];_0x46605a++){if(_0x4d97a5[_0x46605a][_0x8ba7('0x62')]===_0x2b632c){_0x2d3f3f=!![];}}if(_0x2d3f3f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x8ba7('0x63')});}}})['then'](respondWithResult(_0x4c7075,null))[_0x8ba7('0x45')](function(_0x4317e2){var _0x6fac46=_0x19a206['query'][_0x8ba7('0x64')]?0x1f4:_0x4317e2['statusCode']||0x1f4;logger[_0x8ba7('0x65')](_0x8ba7('0x66'),_0x8ba7('0x58'),_0x6fac46,JSON[_0x8ba7('0x67')](_0x4317e2));delete _0x4317e2['name'];if(_0x6fac46===0x191){_0x6fac46=0x190;}_0x4c7075[_0x8ba7('0x1b')](_0x6fac46)[_0x8ba7('0x2b')](_0x19a206['query'][_0x8ba7('0x64')]?{'message':_0x8ba7('0x68'),'statusCode':_0x4317e2[_0x8ba7('0x69')]}:_0x4317e2);});}; \ No newline at end of file +var _0xd4d1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','findOne','order','getConfigurations','AccountId','getSubjects','channel','Descriptions','FreshsalesConfiguration','FreshsalesField','Subjects','apiKey','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x323403,_0x426cfe){var _0x2b8e3e=function(_0x122b6a){while(--_0x122b6a){_0x323403['push'](_0x323403['shift']());}};_0x2b8e3e(++_0x426cfe);}(_0xd4d1,0xd0));var _0x1d4d=function(_0x103bac,_0x3ba2f5){_0x103bac=_0x103bac-0x0;var _0x1fd48e=_0xd4d1[_0x103bac];return _0x1fd48e;};'use strict';var emlformat=require(_0x1d4d('0x0'));var rimraf=require(_0x1d4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d4d('0x2'));var rp=require(_0x1d4d('0x3'));var moment=require('moment');var BPromise=require(_0x1d4d('0x4'));var Mustache=require(_0x1d4d('0x5'));var util=require(_0x1d4d('0x6'));var path=require(_0x1d4d('0x7'));var sox=require(_0x1d4d('0x8'));var csv=require(_0x1d4d('0x9'));var ejs=require(_0x1d4d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d4d('0xb'));var _=require(_0x1d4d('0xc'));var squel=require(_0x1d4d('0xd'));var crypto=require(_0x1d4d('0xe'));var jsforce=require(_0x1d4d('0xf'));var deskjs=require(_0x1d4d('0x10'));var toCsv=require(_0x1d4d('0x9'));var querystring=require(_0x1d4d('0x11'));var Papa=require(_0x1d4d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d4d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d4d('0x14'));var logger=require(_0x1d4d('0x15'))(_0x1d4d('0x16'));var utils=require('../../config/utils');var config=require(_0x1d4d('0x17'));var licenseUtil=require(_0x1d4d('0x18'));var db=require(_0x1d4d('0x19'))['db'];var integrations=require(_0x1d4d('0x1a'));function respondWithStatusCode(_0x168de7,_0x15ead7){_0x15ead7=_0x15ead7||0xcc;return function(_0x1625e5){if(_0x1625e5){return _0x168de7[_0x1d4d('0x1b')](_0x15ead7);}return _0x168de7[_0x1d4d('0x1c')](_0x15ead7)[_0x1d4d('0x1d')]();};}function respondWithResult(_0x1d4f6e,_0xb5d555){_0xb5d555=_0xb5d555||0xc8;return function(_0x1c8493){if(_0x1c8493){return _0x1d4f6e[_0x1d4d('0x1c')](_0xb5d555)['json'](_0x1c8493);}};}function respondWithFilteredResult(_0xfecc4b,_0xbe44f7){return function(_0x290d7b){if(_0x290d7b){var _0xb88ea1=typeof _0xbe44f7[_0x1d4d('0x1e')]===_0x1d4d('0x1f')&&typeof _0xbe44f7[_0x1d4d('0x20')]===_0x1d4d('0x1f');var _0x372d34=_0x290d7b[_0x1d4d('0x21')];var _0x4e4608=_0xb88ea1?0x0:_0xbe44f7[_0x1d4d('0x1e')];var _0x26f512=_0xb88ea1?_0x290d7b[_0x1d4d('0x21')]:_0xbe44f7[_0x1d4d('0x1e')]+_0xbe44f7[_0x1d4d('0x20')];var _0x3253c7;if(_0x26f512>=_0x372d34){_0x26f512=_0x372d34;_0x3253c7=0xc8;}else{_0x3253c7=0xce;}_0xfecc4b['status'](_0x3253c7);return _0xfecc4b[_0x1d4d('0x22')](_0x1d4d('0x23'),_0x4e4608+'-'+_0x26f512+'/'+_0x372d34)[_0x1d4d('0x24')](_0x290d7b);}return null;};}function patchUpdates(_0x496d50){return function(_0x253325){try{jsonpatch[_0x1d4d('0x25')](_0x253325,_0x496d50,!![]);}catch(_0x4eb4db){return BPromise[_0x1d4d('0x26')](_0x4eb4db);}return _0x253325[_0x1d4d('0x27')]();};}function saveUpdates(_0x507cc3,_0x1f6ab3){return function(_0x93e25f){if(_0x93e25f){return _0x93e25f[_0x1d4d('0x28')](_0x507cc3)[_0x1d4d('0x29')](function(_0x193e66){return _0x193e66;});}return null;};}function removeEntity(_0x178090,_0x287716){return function(_0x17ad99){if(_0x17ad99){return _0x17ad99[_0x1d4d('0x2a')]()[_0x1d4d('0x29')](function(){_0x178090[_0x1d4d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd907,_0x107b3b){return function(_0x322c42){if(!_0x322c42){_0x2fd907[_0x1d4d('0x1b')](0x194);}return _0x322c42;};}function handleError(_0x365e8d,_0x328407){_0x328407=_0x328407||0x1f4;return function(_0x432928){logger['error'](_0x432928[_0x1d4d('0x2b')]);if(_0x432928[_0x1d4d('0x2c')]){delete _0x432928[_0x1d4d('0x2c')];}_0x365e8d[_0x1d4d('0x1c')](_0x328407)[_0x1d4d('0x2d')](_0x432928);};}exports[_0x1d4d('0x2e')]=function(_0x5c8d03,_0x1ff362){var _0x3cc129={},_0x3a96c9={},_0x224790={'count':0x0,'rows':[]};var _0x3d821e=_[_0x1d4d('0x2f')](db[_0x1d4d('0x30')][_0x1d4d('0x31')],function(_0x20672f){return{'name':_0x20672f[_0x1d4d('0x32')],'type':_0x20672f[_0x1d4d('0x33')][_0x1d4d('0x34')]};});_0x3a96c9['model']=_[_0x1d4d('0x2f')](_0x3d821e,_0x1d4d('0x2c'));_0x3a96c9[_0x1d4d('0x35')]=_[_0x1d4d('0x36')](_0x5c8d03[_0x1d4d('0x35')]);_0x3a96c9['filters']=_[_0x1d4d('0x37')](_0x3a96c9[_0x1d4d('0x38')],_0x3a96c9['query']);_0x3cc129[_0x1d4d('0x39')]=_[_0x1d4d('0x37')](_0x3a96c9[_0x1d4d('0x38')],qs[_0x1d4d('0x3a')](_0x5c8d03[_0x1d4d('0x35')][_0x1d4d('0x3a')]));_0x3cc129[_0x1d4d('0x39')]=_0x3cc129[_0x1d4d('0x39')][_0x1d4d('0x3b')]?_0x3cc129[_0x1d4d('0x39')]:_0x3a96c9[_0x1d4d('0x38')];if(!_0x5c8d03[_0x1d4d('0x35')][_0x1d4d('0x3c')]('nolimit')){_0x3cc129[_0x1d4d('0x20')]=qs[_0x1d4d('0x20')](_0x5c8d03['query'][_0x1d4d('0x20')]);_0x3cc129[_0x1d4d('0x1e')]=qs[_0x1d4d('0x1e')](_0x5c8d03[_0x1d4d('0x35')][_0x1d4d('0x1e')]);}_0x3cc129['order']=qs[_0x1d4d('0x3d')](_0x5c8d03[_0x1d4d('0x35')][_0x1d4d('0x3d')]);_0x3cc129[_0x1d4d('0x3e')]=qs[_0x1d4d('0x3f')](_[_0x1d4d('0x40')](_0x5c8d03[_0x1d4d('0x35')],_0x3a96c9[_0x1d4d('0x3f')]),_0x3d821e);if(_0x5c8d03[_0x1d4d('0x35')]['filter']){_0x3cc129[_0x1d4d('0x3e')]=_[_0x1d4d('0x41')](_0x3cc129['where'],{'$or':_['map'](_0x3d821e,function(_0x413bee){if(_0x413bee['type']!=='VIRTUAL'){var _0x1eeb5b={};_0x1eeb5b[_0x413bee['name']]={'$like':'%'+_0x5c8d03[_0x1d4d('0x35')][_0x1d4d('0x42')]+'%'};return _0x1eeb5b;}})});}_0x3cc129=_['merge']({},_0x3cc129,_0x5c8d03[_0x1d4d('0x43')]);var _0x3bd9b2={'where':_0x3cc129[_0x1d4d('0x3e')]};return db[_0x1d4d('0x30')][_0x1d4d('0x21')](_0x3bd9b2)['then'](function(_0x11f82e){_0x224790[_0x1d4d('0x21')]=_0x11f82e;if(_0x5c8d03[_0x1d4d('0x35')]['includeAll']){_0x3cc129[_0x1d4d('0x44')]=[{'all':!![]}];}return db[_0x1d4d('0x30')][_0x1d4d('0x45')](_0x3cc129);})[_0x1d4d('0x29')](function(_0x361d98){_0x224790[_0x1d4d('0x46')]=_0x361d98;return _0x224790;})[_0x1d4d('0x29')](respondWithFilteredResult(_0x1ff362,_0x3cc129))[_0x1d4d('0x47')](handleError(_0x1ff362,null));};exports[_0x1d4d('0x48')]=function(_0x443f73,_0x4e17c4){var _0x5af175={'raw':![],'where':{'id':_0x443f73[_0x1d4d('0x49')]['id']}},_0x20096b={};_0x20096b[_0x1d4d('0x38')]=_[_0x1d4d('0x36')](db['FreshsalesAccount'][_0x1d4d('0x31')]);_0x20096b[_0x1d4d('0x35')]=_[_0x1d4d('0x36')](_0x443f73[_0x1d4d('0x35')]);_0x20096b[_0x1d4d('0x3f')]=_['intersection'](_0x20096b[_0x1d4d('0x38')],_0x20096b[_0x1d4d('0x35')]);_0x5af175[_0x1d4d('0x39')]=_['intersection'](_0x20096b['model'],qs[_0x1d4d('0x3a')](_0x443f73[_0x1d4d('0x35')][_0x1d4d('0x3a')]));_0x5af175[_0x1d4d('0x39')]=_0x5af175[_0x1d4d('0x39')][_0x1d4d('0x3b')]?_0x5af175[_0x1d4d('0x39')]:_0x20096b['model'];if(_0x443f73[_0x1d4d('0x35')][_0x1d4d('0x4a')]){_0x5af175[_0x1d4d('0x44')]=[{'all':!![]}];}_0x5af175=_['merge']({},_0x5af175,_0x443f73[_0x1d4d('0x43')]);return db[_0x1d4d('0x30')][_0x1d4d('0x4b')](_0x5af175)['then'](handleEntityNotFound(_0x4e17c4,null))[_0x1d4d('0x29')](respondWithResult(_0x4e17c4,null))[_0x1d4d('0x47')](handleError(_0x4e17c4,null));};exports['create']=function(_0x46b469,_0x3798f1){return db[_0x1d4d('0x30')][_0x1d4d('0x4c')](_0x46b469['body'],{})[_0x1d4d('0x29')](respondWithResult(_0x3798f1,0xc9))[_0x1d4d('0x47')](handleError(_0x3798f1,null));};exports[_0x1d4d('0x28')]=function(_0x2d4f84,_0x3515f2){if(_0x2d4f84[_0x1d4d('0x4d')]['id']){delete _0x2d4f84['body']['id'];}return db['FreshsalesAccount'][_0x1d4d('0x4b')]({'where':{'id':_0x2d4f84[_0x1d4d('0x49')]['id']}})['then'](handleEntityNotFound(_0x3515f2,null))[_0x1d4d('0x29')](saveUpdates(_0x2d4f84[_0x1d4d('0x4d')],null))['then'](respondWithResult(_0x3515f2,null))[_0x1d4d('0x47')](handleError(_0x3515f2,null));};exports[_0x1d4d('0x2a')]=function(_0x33afb7,_0x21c469){return db[_0x1d4d('0x30')][_0x1d4d('0x4b')]({'where':{'id':_0x33afb7[_0x1d4d('0x49')]['id']}})[_0x1d4d('0x29')](handleEntityNotFound(_0x21c469,null))[_0x1d4d('0x29')](removeEntity(_0x21c469,null))[_0x1d4d('0x47')](handleError(_0x21c469,null));};exports['getConfigurations']=function(_0x7c8a3d,_0x4dbbd7,_0x27aa60){var _0x191c43={};var _0x1d8ec9={};var _0x22ae02;var _0x1d5a5c;return db[_0x1d4d('0x30')][_0x1d4d('0x4e')]({'where':{'id':_0x7c8a3d[_0x1d4d('0x49')]['id']}})[_0x1d4d('0x29')](handleEntityNotFound(_0x4dbbd7,null))['then'](function(_0x3d95f5){if(_0x3d95f5){_0x22ae02=_0x3d95f5;_0x1d8ec9[_0x1d4d('0x38')]=_[_0x1d4d('0x36')](db['FreshsalesConfiguration'][_0x1d4d('0x31')]);_0x1d8ec9[_0x1d4d('0x35')]=_[_0x1d4d('0x36')](_0x7c8a3d[_0x1d4d('0x35')]);_0x1d8ec9['filters']=_['intersection'](_0x1d8ec9[_0x1d4d('0x38')],_0x1d8ec9[_0x1d4d('0x35')]);_0x191c43[_0x1d4d('0x39')]=_[_0x1d4d('0x37')](_0x1d8ec9[_0x1d4d('0x38')],qs['fields'](_0x7c8a3d[_0x1d4d('0x35')]['fields']));_0x191c43[_0x1d4d('0x39')]=_0x191c43['attributes']['length']?_0x191c43['attributes']:_0x1d8ec9['model'];_0x191c43[_0x1d4d('0x4f')]=qs[_0x1d4d('0x3d')](_0x7c8a3d[_0x1d4d('0x35')][_0x1d4d('0x3d')]);_0x191c43[_0x1d4d('0x3e')]=qs['filters'](_[_0x1d4d('0x40')](_0x7c8a3d[_0x1d4d('0x35')],_0x1d8ec9[_0x1d4d('0x3f')]));if(_0x7c8a3d[_0x1d4d('0x35')]['filter']){_0x191c43[_0x1d4d('0x3e')]=_[_0x1d4d('0x41')](_0x191c43[_0x1d4d('0x3e')],{'$or':_[_0x1d4d('0x2f')](_0x191c43[_0x1d4d('0x39')],function(_0x88a3f8){var _0x191c09={};_0x191c09[_0x88a3f8]={'$like':'%'+_0x7c8a3d['query'][_0x1d4d('0x42')]+'%'};return _0x191c09;})});}_0x191c43=_[_0x1d4d('0x41')]({},_0x191c43,_0x7c8a3d[_0x1d4d('0x43')]);return _0x22ae02[_0x1d4d('0x50')](_0x191c43);}})['then'](function(_0x67e560){if(_0x67e560){_0x1d5a5c=_0x67e560[_0x1d4d('0x3b')];if(!_0x7c8a3d[_0x1d4d('0x35')][_0x1d4d('0x3c')]('nolimit')){_0x191c43[_0x1d4d('0x20')]=qs[_0x1d4d('0x20')](_0x7c8a3d[_0x1d4d('0x35')][_0x1d4d('0x20')]);_0x191c43['offset']=qs[_0x1d4d('0x1e')](_0x7c8a3d['query']['offset']);}return _0x22ae02[_0x1d4d('0x50')](_0x191c43);}})['then'](function(_0x55672b){if(_0x55672b){return _0x55672b?{'count':_0x1d5a5c,'rows':_0x55672b}:null;}})[_0x1d4d('0x29')](respondWithResult(_0x4dbbd7,null))['catch'](handleError(_0x4dbbd7,null));};exports['addConfiguration']=function(_0x2f7e6c,_0x1d8b72,_0x18785b){if(_0x2f7e6c[_0x1d4d('0x4d')]['id']){delete _0x2f7e6c[_0x1d4d('0x4d')]['id'];}return db[_0x1d4d('0x30')][_0x1d4d('0x4e')]({'where':{'id':_0x2f7e6c[_0x1d4d('0x49')]['id']}})[_0x1d4d('0x29')](handleEntityNotFound(_0x1d8b72,null))['then'](function(_0xc7df36){if(_0xc7df36){_0x2f7e6c[_0x1d4d('0x4d')][_0x1d4d('0x51')]=_0xc7df36['id'];_0x2f7e6c[_0x1d4d('0x4d')]['Subjects']=integrations[_0x1d4d('0x52')](_0x2f7e6c['body'][_0x1d4d('0x53')],_0x2f7e6c['body'][_0x1d4d('0x33')]);_0x2f7e6c['body'][_0x1d4d('0x54')]=integrations['getDescriptions'](_0x2f7e6c[_0x1d4d('0x4d')][_0x1d4d('0x53')],_0x2f7e6c['body'][_0x1d4d('0x33')]);return db[_0x1d4d('0x55')]['create'](_0x2f7e6c['body'],{'include':[{'model':db[_0x1d4d('0x56')],'as':_0x1d4d('0x57')},{'model':db[_0x1d4d('0x56')],'as':_0x1d4d('0x54')}]});}return null;})[_0x1d4d('0x29')](respondWithResult(_0x1d8b72,null))[_0x1d4d('0x47')](handleError(_0x1d8b72,null));};exports['getFields']=function(_0x1694c9,_0x4b003d,_0x245a07){var _0x5f11c6='';var _0x21a216='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x1694c9[_0x1d4d('0x49')]['id']},'attributes':['id','username','remoteUri',_0x1d4d('0x58')]})[_0x1d4d('0x29')](handleEntityNotFound(_0x4b003d,null))[_0x1d4d('0x29')](function(_0x46cbf0){if(_0x46cbf0){_0x21a216=_0x46cbf0[_0x1d4d('0x59')];_0x5f11c6=_0x46cbf0[_0x1d4d('0x5a')];var _0x5394c7=_0x46cbf0[_0x1d4d('0x5a')][_0x1d4d('0x5b')](-0x1);if(_0x5394c7==='/'){_0x5f11c6=_0x5f11c6[_0x1d4d('0x5c')](0x0,_0x5f11c6[_0x1d4d('0x5d')](_0x5394c7));}return rp({'method':_0x1d4d('0x5e'),'uri':util[_0x1d4d('0x5f')](_0x1d4d('0x60'),_0x5f11c6,_0x1d4d('0x61')),'headers':{'Authorization':_0x1d4d('0x62')+_0x46cbf0[_0x1d4d('0x58')]},'json':!![]});}})[_0x1d4d('0x29')](function(_0x572484){if(_0x572484){var _0x2bdf0e=_0x572484['users'];var _0x26c1d2=![];var _0x185e44=null;for(_0x185e44=0x0;_0x185e44<_0x2bdf0e['length'];_0x185e44++){if(_0x2bdf0e[_0x185e44]['email']===_0x21a216){_0x26c1d2=!![];}}if(_0x26c1d2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x1d4d('0x63')});}}})[_0x1d4d('0x29')](respondWithResult(_0x4b003d,null))[_0x1d4d('0x47')](function(_0x11da02){var _0x5a1bbf=_0x1694c9[_0x1d4d('0x35')][_0x1d4d('0x64')]?0x1f4:_0x11da02[_0x1d4d('0x65')]||0x1f4;logger[_0x1d4d('0x66')](_0x1d4d('0x67'),_0x1d4d('0x68'),_0x5a1bbf,JSON[_0x1d4d('0x69')](_0x11da02));delete _0x11da02[_0x1d4d('0x2c')];if(_0x5a1bbf===0x191){_0x5a1bbf=0x190;}_0x4b003d['status'](_0x5a1bbf)[_0x1d4d('0x2d')](_0x1694c9[_0x1d4d('0x35')][_0x1d4d('0x64')]?{'message':_0x1d4d('0x6a'),'statusCode':_0x11da02[_0x1d4d('0x65')]}:_0x11da02);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index ad30e4f..c3f94d1 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 _0x68b3=['moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x388a7a,_0x577d7b){var _0x509a1f=function(_0x36cde6){while(--_0x36cde6){_0x388a7a['push'](_0x388a7a['shift']());}};_0x509a1f(++_0x577d7b);}(_0x68b3,0x1d8));var _0x368b=function(_0x16f191,_0x33045f){_0x16f191=_0x16f191-0x0;var _0x55657c=_0x68b3[_0x16f191];return _0x55657c;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var logger=require(_0x368b('0x2'))(_0x368b('0x3'));var moment=require(_0x368b('0x4'));var BPromise=require('bluebird');var rp=require(_0x368b('0x5'));var fs=require('fs');var path=require(_0x368b('0x6'));var rimraf=require(_0x368b('0x7'));var config=require(_0x368b('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x368b('0x9'));module[_0x368b('0xa')]=function(_0x104dad,_0x23584a){return _0x104dad[_0x368b('0xb')](_0x368b('0xc'),attributes,{'tableName':_0x368b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed1c=['path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','request-promise'];(function(_0x141c37,_0x154a1b){var _0x354cf5=function(_0x483f77){while(--_0x483f77){_0x141c37['push'](_0x141c37['shift']());}};_0x354cf5(++_0x154a1b);}(_0xed1c,0xe4));var _0xced1=function(_0x2797be,_0x5934f4){_0x2797be=_0x2797be-0x0;var _0x211244=_0xed1c[_0x2797be];return _0x211244;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));var integrations=require(_0xced1('0x6'));module[_0xced1('0x7')]=function(_0x37b22b,_0x59399e){return _0x37b22b[_0xced1('0x8')](_0xced1('0x9'),attributes,{'tableName':_0xced1('0xa'),'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 16040b9..a6a043d 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 _0x0424=['info','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x53b27a,_0x51b7ec){var _0x5b0336=function(_0x1a2f0b){while(--_0x1a2f0b){_0x53b27a['push'](_0x53b27a['shift']());}};_0x5b0336(++_0x51b7ec);}(_0x0424,0x159));var _0x4042=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x0424[_0x383627];return _0x2c16a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4042('0x0'));var BPromise=require(_0x4042('0x1'));var rs=require(_0x4042('0x2'));var fs=require('fs');var Redis=require(_0x4042('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4042('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4042('0x5'));var jayson=require(_0x4042('0x6'));var client=jayson[_0x4042('0x7')][_0x4042('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3abaf1,_0xa5310f,_0x10ec07){return new BPromise(function(_0x5d11bf,_0x509772){return client[_0x4042('0x9')](_0x3abaf1,_0x10ec07)[_0x4042('0xa')](function(_0x103e4a){logger['info'](_0x4042('0xb'),_0xa5310f,_0x4042('0xc'));logger[_0x4042('0xd')](_0x4042('0xe'),_0xa5310f,_0x4042('0xc'),JSON[_0x4042('0xf')](_0x103e4a));if(_0x103e4a[_0x4042('0x10')]){if(_0x103e4a[_0x4042('0x10')]['code']===0x1f4){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a['error'][_0x4042('0x11')]);return _0x509772(_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);}logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x103e4a[_0x4042('0x10')][_0x4042('0x11')]);return _0x5d11bf(_0x103e4a['error'][_0x4042('0x11')]);}else{logger[_0x4042('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0xa5310f,_0x4042('0xc'));_0x5d11bf(_0x103e4a[_0x4042('0x13')][_0x4042('0x11')]);}})[_0x4042('0x14')](function(_0x31e765){logger[_0x4042('0x10')](_0x4042('0xb'),_0xa5310f,_0x31e765);_0x509772(_0x31e765);});});}exports[_0x4042('0x15')]=function(_0x466077){var _0x4b02d4=this;return new Promise(function(_0xe5c1ec,_0x4fe024){return db[_0x4042('0x16')]['findAll']({'raw':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x466077[_0x4042('0x17')]?_0x466077['options'][_0x4042('0x19')]||null:null,'attributes':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1a')]||null:null,'limit':_0x466077['options']?_0x466077[_0x4042('0x17')][_0x4042('0x1b')]||null:null,'include':_0x466077[_0x4042('0x17')]?_0x466077[_0x4042('0x17')][_0x4042('0x1c')]?_['map'](_0x466077[_0x4042('0x17')][_0x4042('0x1c')],function(_0x519f2c){return{'model':db[_0x519f2c[_0x4042('0x1d')]],'as':_0x519f2c['as'],'attributes':_0x519f2c['attributes'],'include':_0x519f2c[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x519f2c[_0x4042('0x1c')],function(_0x5d5c6d){return{'model':db[_0x5d5c6d[_0x4042('0x1d')]],'as':_0x5d5c6d['as'],'attributes':_0x5d5c6d[_0x4042('0x1a')],'include':_0x5d5c6d[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x5d5c6d[_0x4042('0x1c')],function(_0x52e575){return{'model':db[_0x52e575['model']],'as':_0x52e575['as'],'attributes':_0x52e575[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26542c){logger[_0x4042('0x12')](_0x4042('0x15'),_0x466077);logger[_0x4042('0xd')]('GetFreshsalesAccount',_0x466077,JSON[_0x4042('0xf')](_0x26542c));_0xe5c1ec(_0x26542c);})[_0x4042('0x14')](function(_0x4a6a6e){logger[_0x4042('0x10')](_0x4042('0x15'),_0x4a6a6e[_0x4042('0x11')],_0x466077);_0x4fe024(_0x4b02d4['error'](0x1f4,_0x4a6a6e['message']));});});};exports[_0x4042('0x1f')]=function(_0x43bd1c){var _0x59773f=this;return new Promise(function(_0x3e9304,_0xc42d70){return db[_0x4042('0x16')][_0x4042('0x20')]({'raw':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')][_0x4042('0x18')]===undefined?!![]:![]:!![],'where':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['where']||null:null,'attributes':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['attributes']||null:null,'include':_0x43bd1c[_0x4042('0x17')]?_0x43bd1c[_0x4042('0x17')]['include']?_[_0x4042('0x1e')](_0x43bd1c[_0x4042('0x17')][_0x4042('0x1c')],function(_0xaa7c99){return{'model':db[_0xaa7c99[_0x4042('0x1d')]],'as':_0xaa7c99['as'],'attributes':_0xaa7c99[_0x4042('0x1a')],'include':_0xaa7c99[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0xaa7c99[_0x4042('0x1c')],function(_0x37195b){return{'model':db[_0x37195b[_0x4042('0x1d')]],'as':_0x37195b['as'],'attributes':_0x37195b[_0x4042('0x1a')],'include':_0x37195b[_0x4042('0x1c')]?_[_0x4042('0x1e')](_0x37195b[_0x4042('0x1c')],function(_0x2b5f5e){return{'model':db[_0x2b5f5e[_0x4042('0x1d')]],'as':_0x2b5f5e['as'],'attributes':_0x2b5f5e[_0x4042('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4042('0xa')](function(_0x26b7b0){logger[_0x4042('0x12')]('ShowFreshsalesAccount',_0x43bd1c);logger[_0x4042('0xd')](_0x4042('0x1f'),_0x43bd1c,JSON[_0x4042('0xf')](_0x26b7b0));_0x3e9304(_0x26b7b0);})[_0x4042('0x14')](function(_0x588932){logger[_0x4042('0x10')](_0x4042('0x1f'),_0x588932[_0x4042('0x11')],_0x43bd1c);_0xc42d70(_0x59773f[_0x4042('0x10')](0x1f4,_0x588932[_0x4042('0x11')]));});});}; \ No newline at end of file +var _0x781d=['model','map','GetFreshsalesAccount','find','ShowFreshsalesAccount','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x781d,0x14a));var _0xd781=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x781d[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['GetFreshsalesAccount']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')]({'raw':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'limit':_0x1407fc[_0xd781('0x19')]?_0x1407fc['options'][_0xd781('0x1c')]||null:null,'include':_0x1407fc['options']?_0x1407fc['options'][_0xd781('0x1d')]?_['map'](_0x1407fc[_0xd781('0x19')][_0xd781('0x1d')],function(_0x395087){return{'model':db[_0x395087[_0xd781('0x1e')]],'as':_0x395087['as'],'attributes':_0x395087[_0xd781('0x1b')],'include':_0x395087[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x395087[_0xd781('0x1d')],function(_0x10940b){return{'model':db[_0x10940b['model']],'as':_0x10940b['as'],'attributes':_0x10940b['attributes'],'include':_0x10940b[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x10940b[_0xd781('0x1d')],function(_0x57b41e){return{'model':db[_0x57b41e[_0xd781('0x1e')]],'as':_0x57b41e['as'],'attributes':_0x57b41e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e29c8){logger['info'](_0xd781('0x20'),_0x1407fc);logger[_0xd781('0xf')]('GetFreshsalesAccount',_0x1407fc,JSON['stringify'](_0x1e29c8));_0x395d9c(_0x1e29c8);})[_0xd781('0x16')](function(_0x5b0464){logger[_0xd781('0x11')]('GetFreshsalesAccount',_0x5b0464[_0xd781('0x13')],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x5b0464['message']));});});};exports['ShowFreshsalesAccount']=function(_0x432d14){var _0x29e81a=this;return new Promise(function(_0x1c7d83,_0x5a389c){return db['FreshsalesAccount'][_0xd781('0x21')]({'raw':_0x432d14[_0xd781('0x19')]?_0x432d14[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'include':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x432d14[_0xd781('0x19')]['include'],function(_0x23dffb){return{'model':db[_0x23dffb[_0xd781('0x1e')]],'as':_0x23dffb['as'],'attributes':_0x23dffb[_0xd781('0x1b')],'include':_0x23dffb[_0xd781('0x1d')]?_['map'](_0x23dffb[_0xd781('0x1d')],function(_0x3f20e2){return{'model':db[_0x3f20e2['model']],'as':_0x3f20e2['as'],'attributes':_0x3f20e2[_0xd781('0x1b')],'include':_0x3f20e2['include']?_[_0xd781('0x1f')](_0x3f20e2[_0xd781('0x1d')],function(_0x57fdb6){return{'model':db[_0x57fdb6[_0xd781('0x1e')]],'as':_0x57fdb6['as'],'attributes':_0x57fdb6[_0xd781('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a29b7){logger['info'](_0xd781('0x22'),_0x432d14);logger[_0xd781('0xf')]('ShowFreshsalesAccount',_0x432d14,JSON[_0xd781('0x23')](_0x2a29b7));_0x1c7d83(_0x2a29b7);})[_0xd781('0x16')](function(_0x5651de){logger[_0xd781('0x11')](_0xd781('0x22'),_0x5651de[_0xd781('0x13')],_0x432d14);_0x5a389c(_0x29e81a['error'](0x1f4,_0x5651de[_0xd781('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 2d34989..8a891fb 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 _0xf411=['../../config/environment','./intFreshsalesConfiguration.controller','get','index','isAuthenticated','show','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','/:id','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x4b62b7,_0x25d768){var _0x40a591=function(_0x52feb4){while(--_0x52feb4){_0x4b62b7['push'](_0x4b62b7['shift']());}};_0x40a591(++_0x25d768);}(_0xf411,0xea));var _0x1f41=function(_0x3a25e1,_0x2458e3){_0x3a25e1=_0x3a25e1-0x0;var _0x524aca=_0xf411[_0x3a25e1];return _0x524aca;};'use strict';var multer=require(_0x1f41('0x0'));var util=require('util');var path=require(_0x1f41('0x1'));var timeout=require(_0x1f41('0x2'));var express=require('express');var router=express[_0x1f41('0x3')]();var fs_extra=require(_0x1f41('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f41('0x5'));var config=require(_0x1f41('0x6'));var controller=require(_0x1f41('0x7'));router[_0x1f41('0x8')]('/',auth['isAuthenticated'](),controller[_0x1f41('0x9')]);router['get']('/:id',auth[_0x1f41('0xa')](),controller[_0x1f41('0xb')]);router[_0x1f41('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x1f41('0x8')](_0x1f41('0xc'),auth[_0x1f41('0xa')](),controller[_0x1f41('0xd')]);router[_0x1f41('0x8')](_0x1f41('0xe'),auth[_0x1f41('0xa')](),controller[_0x1f41('0xf')]);router['post']('/',auth[_0x1f41('0xa')](),controller[_0x1f41('0x10')]);router['put'](_0x1f41('0x11'),auth[_0x1f41('0xa')](),controller[_0x1f41('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1f41('0x13')]=router; \ No newline at end of file +var _0x33b3=['../../config/environment','get','isAuthenticated','index','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','delete','exports','multer','util','express','Router','../../components/interaction/service'];(function(_0x4b6182,_0xa98fdd){var _0x582892=function(_0x60c498){while(--_0x60c498){_0x4b6182['push'](_0x4b6182['shift']());}};_0x582892(++_0xa98fdd);}(_0x33b3,0x18b));var _0x333b=function(_0x4e78a4,_0x5df882){_0x4e78a4=_0x4e78a4-0x0;var _0x3f98d4=_0x33b3[_0x4e78a4];return _0x3f98d4;};'use strict';var multer=require(_0x333b('0x0'));var util=require(_0x333b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x333b('0x2'));var router=express[_0x333b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x333b('0x4'));var config=require(_0x333b('0x5'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x333b('0x6')]('/',auth[_0x333b('0x7')](),controller[_0x333b('0x8')]);router[_0x333b('0x6')]('/:id',auth[_0x333b('0x7')](),controller['show']);router[_0x333b('0x6')]('/:id/subjects',auth[_0x333b('0x7')](),controller['getSubjects']);router[_0x333b('0x6')](_0x333b('0x9'),auth[_0x333b('0x7')](),controller[_0x333b('0xa')]);router[_0x333b('0x6')](_0x333b('0xb'),auth[_0x333b('0x7')](),controller[_0x333b('0xc')]);router[_0x333b('0xd')]('/',auth[_0x333b('0x7')](),controller[_0x333b('0xe')]);router[_0x333b('0xf')](_0x333b('0x10'),auth[_0x333b('0x7')](),controller[_0x333b('0x11')]);router[_0x333b('0x12')](_0x333b('0x10'),auth[_0x333b('0x7')](),controller['destroy']);module[_0x333b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index a361ea4..93e14dc 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 _0x9c87=['sequelize','exports','STRING'];(function(_0x465e2f,_0x28addc){var _0x21c512=function(_0x25968f){while(--_0x25968f){_0x465e2f['push'](_0x465e2f['shift']());}};_0x21c512(++_0x28addc);}(_0x9c87,0x1d7));var _0x79c8=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x9c87[_0x2adbeb];return _0x5e18a6;};'use strict';var Sequelize=require(_0x79c8('0x0'));module[_0x79c8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x79c8('0x2')]}}; \ No newline at end of file +var _0x932a=['exports','STRING','sequelize'];(function(_0x615880,_0x3be21c){var _0x5e5226=function(_0x4b10d7){while(--_0x4b10d7){_0x615880['push'](_0x615880['shift']());}};_0x5e5226(++_0x3be21c);}(_0x932a,0xbf));var _0xa932=function(_0x545dff,_0x2606eb){_0x545dff=_0x545dff-0x0;var _0x1317a4=_0x932a[_0x545dff];return _0x1317a4;};'use strict';var Sequelize=require(_0xa932('0x0'));module[_0xa932('0x1')]={'name':{'type':Sequelize[_0xa932('0x2')]},'description':{'type':Sequelize[_0xa932('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 2e95cc3..b5256c5 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 _0x3619=['key','map','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rawAttributes','intersection','options','find','catch','create','body','findOne','params','FreshsalesField','getSubjects','hasOwnProperty','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','FreshsalesConfiguration','fieldName','type'];(function(_0x4eef7d,_0x538970){var _0x3e1137=function(_0x4ec74a){while(--_0x4ec74a){_0x4eef7d['push'](_0x4eef7d['shift']());}};_0x3e1137(++_0x538970);}(_0x3619,0x1c1));var _0x9361=function(_0x58fe86,_0x19655f){_0x58fe86=_0x58fe86-0x0;var _0x3f0732=_0x3619[_0x58fe86];return _0x3f0732;};'use strict';var emlformat=require(_0x9361('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9361('0x1'));var jsonpatch=require(_0x9361('0x2'));var rp=require(_0x9361('0x3'));var moment=require(_0x9361('0x4'));var BPromise=require(_0x9361('0x5'));var Mustache=require(_0x9361('0x6'));var util=require(_0x9361('0x7'));var path=require(_0x9361('0x8'));var sox=require(_0x9361('0x9'));var csv=require(_0x9361('0xa'));var ejs=require(_0x9361('0xb'));var fs=require('fs');var fs_extra=require(_0x9361('0xc'));var _=require(_0x9361('0xd'));var squel=require(_0x9361('0xe'));var crypto=require(_0x9361('0xf'));var jsforce=require(_0x9361('0x10'));var deskjs=require(_0x9361('0x11'));var toCsv=require(_0x9361('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9361('0x12'));var authService=require(_0x9361('0x13'));var qs=require(_0x9361('0x14'));var as=require(_0x9361('0x15'));var hardwareService=require(_0x9361('0x16'));var logger=require('../../config/logger')(_0x9361('0x17'));var utils=require('../../config/utils');var config=require(_0x9361('0x18'));var licenseUtil=require(_0x9361('0x19'));var db=require(_0x9361('0x1a'))['db'];function respondWithStatusCode(_0x2d2662,_0x4d57d2){_0x4d57d2=_0x4d57d2||0xcc;return function(_0x5274b6){if(_0x5274b6){return _0x2d2662[_0x9361('0x1b')](_0x4d57d2);}return _0x2d2662[_0x9361('0x1c')](_0x4d57d2)[_0x9361('0x1d')]();};}function respondWithResult(_0x5aabb2,_0x4ad005){_0x4ad005=_0x4ad005||0xc8;return function(_0x222eb0){if(_0x222eb0){return _0x5aabb2[_0x9361('0x1c')](_0x4ad005)[_0x9361('0x1e')](_0x222eb0);}};}function respondWithFilteredResult(_0x47dc17,_0xf59c48){return function(_0x3290ab){if(_0x3290ab){var _0x1f4593=typeof _0xf59c48[_0x9361('0x1f')]===_0x9361('0x20')&&typeof _0xf59c48[_0x9361('0x21')]===_0x9361('0x20');var _0x14c4c1=_0x3290ab[_0x9361('0x22')];var _0x8451c=_0x1f4593?0x0:_0xf59c48[_0x9361('0x1f')];var _0x5543e1=_0x1f4593?_0x3290ab[_0x9361('0x22')]:_0xf59c48['offset']+_0xf59c48[_0x9361('0x21')];var _0x39bc07;if(_0x5543e1>=_0x14c4c1){_0x5543e1=_0x14c4c1;_0x39bc07=0xc8;}else{_0x39bc07=0xce;}_0x47dc17[_0x9361('0x1c')](_0x39bc07);return _0x47dc17[_0x9361('0x23')](_0x9361('0x24'),_0x8451c+'-'+_0x5543e1+'/'+_0x14c4c1)[_0x9361('0x1e')](_0x3290ab);}return null;};}function patchUpdates(_0x2a8b9e){return function(_0x3f4458){try{jsonpatch[_0x9361('0x25')](_0x3f4458,_0x2a8b9e,!![]);}catch(_0x332638){return BPromise[_0x9361('0x26')](_0x332638);}return _0x3f4458['save']();};}function saveUpdates(_0x16d328,_0x2cee67){return function(_0x1403e7){if(_0x1403e7){return _0x1403e7[_0x9361('0x27')](_0x16d328)[_0x9361('0x28')](function(_0x9634fc){return _0x9634fc;});}return null;};}function removeEntity(_0x34a9d1,_0x1e2bf1){return function(_0x2f6412){if(_0x2f6412){return _0x2f6412[_0x9361('0x29')]()[_0x9361('0x28')](function(){_0x34a9d1['status'](0xcc)[_0x9361('0x1d')]();});}};}function handleEntityNotFound(_0x407948,_0x4f46e3){return function(_0x1d5789){if(!_0x1d5789){_0x407948[_0x9361('0x1b')](0x194);}return _0x1d5789;};}function handleError(_0x59b9af,_0xd842f7){_0xd842f7=_0xd842f7||0x1f4;return function(_0x37e1ce){logger[_0x9361('0x2a')](_0x37e1ce['stack']);if(_0x37e1ce[_0x9361('0x2b')]){delete _0x37e1ce[_0x9361('0x2b')];}_0x59b9af[_0x9361('0x1c')](_0xd842f7)[_0x9361('0x2c')](_0x37e1ce);};}exports[_0x9361('0x2d')]=function(_0x259c99,_0x3e4360){var _0x2e4bba={},_0x202759={},_0x18d8d7={'count':0x0,'rows':[]};var _0x4ced98=_['map'](db[_0x9361('0x2e')]['rawAttributes'],function(_0x5e8011){return{'name':_0x5e8011[_0x9361('0x2f')],'type':_0x5e8011[_0x9361('0x30')][_0x9361('0x31')]};});_0x202759['model']=_[_0x9361('0x32')](_0x4ced98,_0x9361('0x2b'));_0x202759[_0x9361('0x33')]=_[_0x9361('0x34')](_0x259c99[_0x9361('0x33')]);_0x202759[_0x9361('0x35')]=_['intersection'](_0x202759[_0x9361('0x36')],_0x202759[_0x9361('0x33')]);_0x2e4bba[_0x9361('0x37')]=_['intersection'](_0x202759[_0x9361('0x36')],qs['fields'](_0x259c99[_0x9361('0x33')][_0x9361('0x38')]));_0x2e4bba[_0x9361('0x37')]=_0x2e4bba[_0x9361('0x37')][_0x9361('0x39')]?_0x2e4bba[_0x9361('0x37')]:_0x202759[_0x9361('0x36')];if(!_0x259c99[_0x9361('0x33')]['hasOwnProperty'](_0x9361('0x3a'))){_0x2e4bba[_0x9361('0x21')]=qs[_0x9361('0x21')](_0x259c99['query'][_0x9361('0x21')]);_0x2e4bba[_0x9361('0x1f')]=qs['offset'](_0x259c99[_0x9361('0x33')]['offset']);}_0x2e4bba[_0x9361('0x3b')]=qs[_0x9361('0x3c')](_0x259c99[_0x9361('0x33')][_0x9361('0x3c')]);_0x2e4bba[_0x9361('0x3d')]=qs['filters'](_[_0x9361('0x3e')](_0x259c99[_0x9361('0x33')],_0x202759[_0x9361('0x35')]),_0x4ced98);if(_0x259c99[_0x9361('0x33')][_0x9361('0x3f')]){_0x2e4bba[_0x9361('0x3d')]=_['merge'](_0x2e4bba[_0x9361('0x3d')],{'$or':_[_0x9361('0x32')](_0x4ced98,function(_0x3d89d1){if(_0x3d89d1['type']!==_0x9361('0x40')){var _0x3d3f5f={};_0x3d3f5f[_0x3d89d1[_0x9361('0x2b')]]={'$like':'%'+_0x259c99[_0x9361('0x33')][_0x9361('0x3f')]+'%'};return _0x3d3f5f;}})});}_0x2e4bba=_[_0x9361('0x41')]({},_0x2e4bba,_0x259c99['options']);var _0x219b6e={'where':_0x2e4bba[_0x9361('0x3d')]};return db[_0x9361('0x2e')]['count'](_0x219b6e)['then'](function(_0x416c23){_0x18d8d7[_0x9361('0x22')]=_0x416c23;if(_0x259c99['query'][_0x9361('0x42')]){_0x2e4bba[_0x9361('0x43')]=[{'all':!![]}];}return db[_0x9361('0x2e')][_0x9361('0x44')](_0x2e4bba);})[_0x9361('0x28')](function(_0x2ea348){_0x18d8d7['rows']=_0x2ea348;return _0x18d8d7;})['then'](respondWithFilteredResult(_0x3e4360,_0x2e4bba))['catch'](handleError(_0x3e4360,null));};exports['show']=function(_0x3e07ee,_0x3dae77){var _0x2e32ea={'raw':![],'where':{'id':_0x3e07ee['params']['id']}},_0x9d759f={};_0x9d759f[_0x9361('0x36')]=_[_0x9361('0x34')](db[_0x9361('0x2e')][_0x9361('0x45')]);_0x9d759f['query']=_['keys'](_0x3e07ee[_0x9361('0x33')]);_0x9d759f[_0x9361('0x35')]=_[_0x9361('0x46')](_0x9d759f[_0x9361('0x36')],_0x9d759f[_0x9361('0x33')]);_0x2e32ea[_0x9361('0x37')]=_[_0x9361('0x46')](_0x9d759f[_0x9361('0x36')],qs[_0x9361('0x38')](_0x3e07ee['query'][_0x9361('0x38')]));_0x2e32ea[_0x9361('0x37')]=_0x2e32ea[_0x9361('0x37')]['length']?_0x2e32ea[_0x9361('0x37')]:_0x9d759f[_0x9361('0x36')];if(_0x3e07ee['query'][_0x9361('0x42')]){_0x2e32ea[_0x9361('0x43')]=[{'all':!![]}];}_0x2e32ea=_[_0x9361('0x41')]({},_0x2e32ea,_0x3e07ee[_0x9361('0x47')]);return db[_0x9361('0x2e')][_0x9361('0x48')](_0x2e32ea)['then'](handleEntityNotFound(_0x3dae77,null))[_0x9361('0x28')](respondWithResult(_0x3dae77,null))[_0x9361('0x49')](handleError(_0x3dae77,null));};exports[_0x9361('0x4a')]=function(_0x3cff7c,_0x5f4ee3){return db[_0x9361('0x2e')][_0x9361('0x4a')](_0x3cff7c[_0x9361('0x4b')],{})['then'](respondWithResult(_0x5f4ee3,0xc9))['catch'](handleError(_0x5f4ee3,null));};exports['update']=function(_0x5ca462,_0x4ff7de){if(_0x5ca462['body']['id']){delete _0x5ca462['body']['id'];}return db[_0x9361('0x2e')][_0x9361('0x48')]({'where':{'id':_0x5ca462['params']['id']}})['then'](handleEntityNotFound(_0x4ff7de,null))[_0x9361('0x28')](saveUpdates(_0x5ca462[_0x9361('0x4b')],null))[_0x9361('0x28')](respondWithResult(_0x4ff7de,null))[_0x9361('0x49')](handleError(_0x4ff7de,null));};exports[_0x9361('0x29')]=function(_0x8947e2,_0x186038){return db[_0x9361('0x2e')][_0x9361('0x48')]({'where':{'id':_0x8947e2['params']['id']}})[_0x9361('0x28')](handleEntityNotFound(_0x186038,null))['then'](removeEntity(_0x186038,null))[_0x9361('0x49')](handleError(_0x186038,null));};exports['getSubjects']=function(_0x536746,_0x2bef51,_0x70e33c){var _0xea7921={};var _0x5dd46b={};var _0xeca051;var _0x501ff0;return db[_0x9361('0x2e')][_0x9361('0x4c')]({'where':{'id':_0x536746[_0x9361('0x4d')]['id']}})[_0x9361('0x28')](handleEntityNotFound(_0x2bef51,null))['then'](function(_0x3f9ca9){if(_0x3f9ca9){_0xeca051=_0x3f9ca9;_0x5dd46b['model']=_['keys'](db[_0x9361('0x4e')]['rawAttributes']);_0x5dd46b[_0x9361('0x33')]=_[_0x9361('0x34')](_0x536746[_0x9361('0x33')]);_0x5dd46b[_0x9361('0x35')]=_[_0x9361('0x46')](_0x5dd46b[_0x9361('0x36')],_0x5dd46b[_0x9361('0x33')]);_0xea7921['attributes']=_['intersection'](_0x5dd46b[_0x9361('0x36')],qs[_0x9361('0x38')](_0x536746['query'][_0x9361('0x38')]));_0xea7921['attributes']=_0xea7921[_0x9361('0x37')][_0x9361('0x39')]?_0xea7921[_0x9361('0x37')]:_0x5dd46b[_0x9361('0x36')];_0xea7921[_0x9361('0x3b')]=qs['sort'](_0x536746['query']['sort']);_0xea7921[_0x9361('0x3d')]=qs[_0x9361('0x35')](_[_0x9361('0x3e')](_0x536746['query'],_0x5dd46b[_0x9361('0x35')]));if(_0x536746[_0x9361('0x33')][_0x9361('0x3f')]){_0xea7921['where']=_['merge'](_0xea7921[_0x9361('0x3d')],{'$or':_[_0x9361('0x32')](_0xea7921[_0x9361('0x37')],function(_0x3cbaa3){var _0x72db50={};_0x72db50[_0x3cbaa3]={'$like':'%'+_0x536746[_0x9361('0x33')][_0x9361('0x3f')]+'%'};return _0x72db50;})});}_0xea7921=_[_0x9361('0x41')]({},_0xea7921,_0x536746[_0x9361('0x47')]);return _0xeca051[_0x9361('0x4f')](_0xea7921);}})['then'](function(_0x24f072){if(_0x24f072){_0x501ff0=_0x24f072[_0x9361('0x39')];if(!_0x536746[_0x9361('0x33')][_0x9361('0x50')]('nolimit')){_0xea7921[_0x9361('0x21')]=qs['limit'](_0x536746['query'][_0x9361('0x21')]);_0xea7921[_0x9361('0x1f')]=qs['offset'](_0x536746[_0x9361('0x33')][_0x9361('0x1f')]);}return _0xeca051['getSubjects'](_0xea7921);}})[_0x9361('0x28')](function(_0x1336ce){if(_0x1336ce){return _0x1336ce?{'count':_0x501ff0,'rows':_0x1336ce}:null;}})[_0x9361('0x28')](respondWithResult(_0x2bef51,null))['catch'](handleError(_0x2bef51,null));};exports[_0x9361('0x51')]=function(_0x1b53e1,_0x167d8b,_0xf1d96c){var _0x350144={};var _0x1f032d={};var _0x1f2294;var _0x46848a;return db[_0x9361('0x2e')][_0x9361('0x4c')]({'where':{'id':_0x1b53e1['params']['id']}})[_0x9361('0x28')](handleEntityNotFound(_0x167d8b,null))[_0x9361('0x28')](function(_0x1a0651){if(_0x1a0651){_0x1f2294=_0x1a0651;_0x1f032d[_0x9361('0x36')]=_['keys'](db['FreshsalesField'][_0x9361('0x45')]);_0x1f032d[_0x9361('0x33')]=_[_0x9361('0x34')](_0x1b53e1['query']);_0x1f032d[_0x9361('0x35')]=_[_0x9361('0x46')](_0x1f032d[_0x9361('0x36')],_0x1f032d[_0x9361('0x33')]);_0x350144[_0x9361('0x37')]=_['intersection'](_0x1f032d['model'],qs[_0x9361('0x38')](_0x1b53e1[_0x9361('0x33')][_0x9361('0x38')]));_0x350144[_0x9361('0x37')]=_0x350144[_0x9361('0x37')][_0x9361('0x39')]?_0x350144[_0x9361('0x37')]:_0x1f032d[_0x9361('0x36')];_0x350144['order']=qs[_0x9361('0x3c')](_0x1b53e1[_0x9361('0x33')][_0x9361('0x3c')]);_0x350144['where']=qs[_0x9361('0x35')](_[_0x9361('0x3e')](_0x1b53e1[_0x9361('0x33')],_0x1f032d['filters']));if(_0x1b53e1['query'][_0x9361('0x3f')]){_0x350144[_0x9361('0x3d')]=_[_0x9361('0x41')](_0x350144[_0x9361('0x3d')],{'$or':_[_0x9361('0x32')](_0x350144[_0x9361('0x37')],function(_0x5382dc){var _0x4dee07={};_0x4dee07[_0x5382dc]={'$like':'%'+_0x1b53e1[_0x9361('0x33')][_0x9361('0x3f')]+'%'};return _0x4dee07;})});}_0x350144=_[_0x9361('0x41')]({},_0x350144,_0x1b53e1[_0x9361('0x47')]);return _0x1f2294[_0x9361('0x51')](_0x350144);}})[_0x9361('0x28')](function(_0x2a6899){if(_0x2a6899){_0x46848a=_0x2a6899['length'];if(!_0x1b53e1[_0x9361('0x33')][_0x9361('0x50')](_0x9361('0x3a'))){_0x350144[_0x9361('0x21')]=qs['limit'](_0x1b53e1[_0x9361('0x33')][_0x9361('0x21')]);_0x350144[_0x9361('0x1f')]=qs[_0x9361('0x1f')](_0x1b53e1['query'][_0x9361('0x1f')]);}return _0x1f2294[_0x9361('0x51')](_0x350144);}})[_0x9361('0x28')](function(_0x4006f9){if(_0x4006f9){return _0x4006f9?{'count':_0x46848a,'rows':_0x4006f9}:null;}})['then'](respondWithResult(_0x167d8b,null))['catch'](handleError(_0x167d8b,null));};exports[_0x9361('0x52')]=function(_0x5b346e,_0x33cb14,_0x41e0e7){var _0x23aa5e={};var _0x36bfbc={};var _0x23e93d;var _0x57ab0a;return db['FreshsalesConfiguration'][_0x9361('0x4c')]({'where':{'id':_0x5b346e[_0x9361('0x4d')]['id']}})[_0x9361('0x28')](handleEntityNotFound(_0x33cb14,null))[_0x9361('0x28')](function(_0x32ea0e){if(_0x32ea0e){_0x23e93d=_0x32ea0e;_0x36bfbc['model']=_[_0x9361('0x34')](db[_0x9361('0x4e')]['rawAttributes']);_0x36bfbc[_0x9361('0x33')]=_[_0x9361('0x34')](_0x5b346e[_0x9361('0x33')]);_0x36bfbc[_0x9361('0x35')]=_[_0x9361('0x46')](_0x36bfbc['model'],_0x36bfbc[_0x9361('0x33')]);_0x23aa5e[_0x9361('0x37')]=_[_0x9361('0x46')](_0x36bfbc[_0x9361('0x36')],qs[_0x9361('0x38')](_0x5b346e[_0x9361('0x33')]['fields']));_0x23aa5e[_0x9361('0x37')]=_0x23aa5e['attributes']['length']?_0x23aa5e[_0x9361('0x37')]:_0x36bfbc[_0x9361('0x36')];_0x23aa5e[_0x9361('0x3b')]=qs['sort'](_0x5b346e[_0x9361('0x33')][_0x9361('0x3c')]);_0x23aa5e[_0x9361('0x3d')]=qs[_0x9361('0x35')](_[_0x9361('0x3e')](_0x5b346e[_0x9361('0x33')],_0x36bfbc[_0x9361('0x35')]));if(_0x5b346e[_0x9361('0x33')][_0x9361('0x3f')]){_0x23aa5e[_0x9361('0x3d')]=_[_0x9361('0x41')](_0x23aa5e[_0x9361('0x3d')],{'$or':_['map'](_0x23aa5e[_0x9361('0x37')],function(_0x4ddb58){var _0x1701da={};_0x1701da[_0x4ddb58]={'$like':'%'+_0x5b346e[_0x9361('0x33')]['filter']+'%'};return _0x1701da;})});}_0x23aa5e=_[_0x9361('0x41')]({},_0x23aa5e,_0x5b346e[_0x9361('0x47')]);return _0x23e93d[_0x9361('0x52')](_0x23aa5e);}})['then'](function(_0x289bd8){if(_0x289bd8){_0x57ab0a=_0x289bd8[_0x9361('0x39')];if(!_0x5b346e[_0x9361('0x33')][_0x9361('0x50')](_0x9361('0x3a'))){_0x23aa5e['limit']=qs[_0x9361('0x21')](_0x5b346e[_0x9361('0x33')][_0x9361('0x21')]);_0x23aa5e[_0x9361('0x1f')]=qs[_0x9361('0x1f')](_0x5b346e[_0x9361('0x33')][_0x9361('0x1f')]);}return _0x23e93d[_0x9361('0x52')](_0x23aa5e);}})[_0x9361('0x28')](function(_0x3ad141){if(_0x3ad141){return _0x3ad141?{'count':_0x57ab0a,'rows':_0x3ad141}:null;}})[_0x9361('0x28')](respondWithResult(_0x33cb14,null))['catch'](handleError(_0x33cb14,null));}; \ No newline at end of file +var _0xefc9=['end','offset','undefined','count','limit','Content-Range','json','apply','reject','destroy','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','findAll','then','rows','catch','show','includeAll','include','merge','find','create','body','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xefc9,0x85));var _0x9efc=function(_0x4c1ca5,_0x43a6ee){_0x4c1ca5=_0x4c1ca5-0x0;var _0x4c36f3=_0xefc9[_0x4c1ca5];return _0x4c36f3;};'use strict';var emlformat=require(_0x9efc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9efc('0x1'));var rp=require(_0x9efc('0x2'));var moment=require(_0x9efc('0x3'));var BPromise=require(_0x9efc('0x4'));var Mustache=require(_0x9efc('0x5'));var util=require(_0x9efc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9efc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9efc('0x8'));var _=require('lodash');var squel=require(_0x9efc('0x9'));var crypto=require(_0x9efc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9efc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9efc('0xc'));var Papa=require(_0x9efc('0xd'));var Redis=require(_0x9efc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9efc('0xf'));var as=require(_0x9efc('0x10'));var hardwareService=require(_0x9efc('0x11'));var logger=require(_0x9efc('0x12'))('api');var utils=require(_0x9efc('0x13'));var config=require(_0x9efc('0x14'));var licenseUtil=require(_0x9efc('0x15'));var db=require(_0x9efc('0x16'))['db'];function respondWithStatusCode(_0x11e061,_0x16ea1a){_0x16ea1a=_0x16ea1a||0xcc;return function(_0x1b8d49){if(_0x1b8d49){return _0x11e061[_0x9efc('0x17')](_0x16ea1a);}return _0x11e061[_0x9efc('0x18')](_0x16ea1a)[_0x9efc('0x19')]();};}function respondWithResult(_0x5297da,_0x370681){_0x370681=_0x370681||0xc8;return function(_0x3f50d5){if(_0x3f50d5){return _0x5297da[_0x9efc('0x18')](_0x370681)['json'](_0x3f50d5);}};}function respondWithFilteredResult(_0x5367e6,_0xfb2f3c){return function(_0x1a0479){if(_0x1a0479){var _0x47132d=typeof _0xfb2f3c[_0x9efc('0x1a')]==='undefined'&&typeof _0xfb2f3c['limit']===_0x9efc('0x1b');var _0x4838ec=_0x1a0479['count'];var _0x333b4a=_0x47132d?0x0:_0xfb2f3c['offset'];var _0x2640d9=_0x47132d?_0x1a0479[_0x9efc('0x1c')]:_0xfb2f3c['offset']+_0xfb2f3c[_0x9efc('0x1d')];var _0x5f0045;if(_0x2640d9>=_0x4838ec){_0x2640d9=_0x4838ec;_0x5f0045=0xc8;}else{_0x5f0045=0xce;}_0x5367e6['status'](_0x5f0045);return _0x5367e6['set'](_0x9efc('0x1e'),_0x333b4a+'-'+_0x2640d9+'/'+_0x4838ec)[_0x9efc('0x1f')](_0x1a0479);}return null;};}function patchUpdates(_0x156fb5){return function(_0x4691eb){try{jsonpatch[_0x9efc('0x20')](_0x4691eb,_0x156fb5,!![]);}catch(_0x27ef21){return BPromise[_0x9efc('0x21')](_0x27ef21);}return _0x4691eb['save']();};}function saveUpdates(_0xf1ed01,_0x4b8a4f){return function(_0x184920){if(_0x184920){return _0x184920['update'](_0xf1ed01)['then'](function(_0x59c6c0){return _0x59c6c0;});}return null;};}function removeEntity(_0x23eec6,_0x1ca4bd){return function(_0x171dd0){if(_0x171dd0){return _0x171dd0[_0x9efc('0x22')]()['then'](function(){_0x23eec6[_0x9efc('0x18')](0xcc)[_0x9efc('0x19')]();});}};}function handleEntityNotFound(_0x15c0e2,_0x300bf4){return function(_0x13f38c){if(!_0x13f38c){_0x15c0e2[_0x9efc('0x17')](0x194);}return _0x13f38c;};}function handleError(_0x5ebf71,_0x4d0592){_0x4d0592=_0x4d0592||0x1f4;return function(_0x3f165e){logger['error'](_0x3f165e[_0x9efc('0x23')]);if(_0x3f165e[_0x9efc('0x24')]){delete _0x3f165e[_0x9efc('0x24')];}_0x5ebf71[_0x9efc('0x18')](_0x4d0592)[_0x9efc('0x25')](_0x3f165e);};}exports[_0x9efc('0x26')]=function(_0x2cf8b8,_0x23dc0a){var _0xa2649d={},_0x3a4913={},_0xb90d93={'count':0x0,'rows':[]};var _0x35a6ad=_[_0x9efc('0x27')](db[_0x9efc('0x28')][_0x9efc('0x29')],function(_0x5f44f3){return{'name':_0x5f44f3[_0x9efc('0x2a')],'type':_0x5f44f3[_0x9efc('0x2b')][_0x9efc('0x2c')]};});_0x3a4913[_0x9efc('0x2d')]=_[_0x9efc('0x27')](_0x35a6ad,_0x9efc('0x24'));_0x3a4913[_0x9efc('0x2e')]=_[_0x9efc('0x2f')](_0x2cf8b8[_0x9efc('0x2e')]);_0x3a4913['filters']=_[_0x9efc('0x30')](_0x3a4913['model'],_0x3a4913[_0x9efc('0x2e')]);_0xa2649d[_0x9efc('0x31')]=_[_0x9efc('0x30')](_0x3a4913[_0x9efc('0x2d')],qs[_0x9efc('0x32')](_0x2cf8b8[_0x9efc('0x2e')][_0x9efc('0x32')]));_0xa2649d[_0x9efc('0x31')]=_0xa2649d[_0x9efc('0x31')][_0x9efc('0x33')]?_0xa2649d[_0x9efc('0x31')]:_0x3a4913[_0x9efc('0x2d')];if(!_0x2cf8b8[_0x9efc('0x2e')][_0x9efc('0x34')](_0x9efc('0x35'))){_0xa2649d[_0x9efc('0x1d')]=qs['limit'](_0x2cf8b8[_0x9efc('0x2e')]['limit']);_0xa2649d[_0x9efc('0x1a')]=qs[_0x9efc('0x1a')](_0x2cf8b8[_0x9efc('0x2e')][_0x9efc('0x1a')]);}_0xa2649d[_0x9efc('0x36')]=qs['sort'](_0x2cf8b8['query'][_0x9efc('0x37')]);_0xa2649d[_0x9efc('0x38')]=qs[_0x9efc('0x39')](_[_0x9efc('0x3a')](_0x2cf8b8[_0x9efc('0x2e')],_0x3a4913[_0x9efc('0x39')]),_0x35a6ad);if(_0x2cf8b8['query']['filter']){_0xa2649d[_0x9efc('0x38')]=_['merge'](_0xa2649d[_0x9efc('0x38')],{'$or':_[_0x9efc('0x27')](_0x35a6ad,function(_0x2b7140){if(_0x2b7140[_0x9efc('0x2b')]!==_0x9efc('0x3b')){var _0x2afa3e={};_0x2afa3e[_0x2b7140[_0x9efc('0x24')]]={'$like':'%'+_0x2cf8b8['query'][_0x9efc('0x3c')]+'%'};return _0x2afa3e;}})});}_0xa2649d=_['merge']({},_0xa2649d,_0x2cf8b8[_0x9efc('0x3d')]);var _0xe5ae86={'where':_0xa2649d['where']};return db[_0x9efc('0x28')]['count'](_0xe5ae86)['then'](function(_0x468c6d){_0xb90d93['count']=_0x468c6d;if(_0x2cf8b8['query']['includeAll']){_0xa2649d['include']=[{'all':!![]}];}return db[_0x9efc('0x28')][_0x9efc('0x3e')](_0xa2649d);})[_0x9efc('0x3f')](function(_0x4ca571){_0xb90d93[_0x9efc('0x40')]=_0x4ca571;return _0xb90d93;})['then'](respondWithFilteredResult(_0x23dc0a,_0xa2649d))[_0x9efc('0x41')](handleError(_0x23dc0a,null));};exports[_0x9efc('0x42')]=function(_0x106d0b,_0x1de94e){var _0x567174={'raw':![],'where':{'id':_0x106d0b['params']['id']}},_0x4083d4={};_0x4083d4[_0x9efc('0x2d')]=_[_0x9efc('0x2f')](db[_0x9efc('0x28')]['rawAttributes']);_0x4083d4['query']=_[_0x9efc('0x2f')](_0x106d0b[_0x9efc('0x2e')]);_0x4083d4[_0x9efc('0x39')]=_[_0x9efc('0x30')](_0x4083d4[_0x9efc('0x2d')],_0x4083d4['query']);_0x567174[_0x9efc('0x31')]=_[_0x9efc('0x30')](_0x4083d4[_0x9efc('0x2d')],qs[_0x9efc('0x32')](_0x106d0b['query'][_0x9efc('0x32')]));_0x567174['attributes']=_0x567174[_0x9efc('0x31')][_0x9efc('0x33')]?_0x567174[_0x9efc('0x31')]:_0x4083d4[_0x9efc('0x2d')];if(_0x106d0b[_0x9efc('0x2e')][_0x9efc('0x43')]){_0x567174[_0x9efc('0x44')]=[{'all':!![]}];}_0x567174=_[_0x9efc('0x45')]({},_0x567174,_0x106d0b[_0x9efc('0x3d')]);return db[_0x9efc('0x28')][_0x9efc('0x46')](_0x567174)[_0x9efc('0x3f')](handleEntityNotFound(_0x1de94e,null))['then'](respondWithResult(_0x1de94e,null))[_0x9efc('0x41')](handleError(_0x1de94e,null));};exports[_0x9efc('0x47')]=function(_0x587bf9,_0x3101d1){return db[_0x9efc('0x28')]['create'](_0x587bf9[_0x9efc('0x48')],{})[_0x9efc('0x3f')](respondWithResult(_0x3101d1,0xc9))[_0x9efc('0x41')](handleError(_0x3101d1,null));};exports['update']=function(_0x460959,_0x1af2eb){if(_0x460959[_0x9efc('0x48')]['id']){delete _0x460959[_0x9efc('0x48')]['id'];}return db[_0x9efc('0x28')][_0x9efc('0x46')]({'where':{'id':_0x460959[_0x9efc('0x49')]['id']}})[_0x9efc('0x3f')](handleEntityNotFound(_0x1af2eb,null))['then'](saveUpdates(_0x460959[_0x9efc('0x48')],null))['then'](respondWithResult(_0x1af2eb,null))[_0x9efc('0x41')](handleError(_0x1af2eb,null));};exports['destroy']=function(_0x43edc8,_0x3c8397){return db[_0x9efc('0x28')]['find']({'where':{'id':_0x43edc8[_0x9efc('0x49')]['id']}})[_0x9efc('0x3f')](handleEntityNotFound(_0x3c8397,null))[_0x9efc('0x3f')](removeEntity(_0x3c8397,null))[_0x9efc('0x41')](handleError(_0x3c8397,null));};exports[_0x9efc('0x4a')]=function(_0x46a130,_0x5bdfd0,_0x1bec7a){var _0x5d6243={};var _0x7b9820={};var _0x39d7ac;var _0x41e7b5;return db[_0x9efc('0x28')][_0x9efc('0x4b')]({'where':{'id':_0x46a130['params']['id']}})[_0x9efc('0x3f')](handleEntityNotFound(_0x5bdfd0,null))[_0x9efc('0x3f')](function(_0x45e30b){if(_0x45e30b){_0x39d7ac=_0x45e30b;_0x7b9820['model']=_[_0x9efc('0x2f')](db[_0x9efc('0x4c')][_0x9efc('0x29')]);_0x7b9820[_0x9efc('0x2e')]=_[_0x9efc('0x2f')](_0x46a130[_0x9efc('0x2e')]);_0x7b9820[_0x9efc('0x39')]=_[_0x9efc('0x30')](_0x7b9820[_0x9efc('0x2d')],_0x7b9820[_0x9efc('0x2e')]);_0x5d6243[_0x9efc('0x31')]=_[_0x9efc('0x30')](_0x7b9820[_0x9efc('0x2d')],qs['fields'](_0x46a130[_0x9efc('0x2e')][_0x9efc('0x32')]));_0x5d6243[_0x9efc('0x31')]=_0x5d6243['attributes'][_0x9efc('0x33')]?_0x5d6243[_0x9efc('0x31')]:_0x7b9820['model'];_0x5d6243[_0x9efc('0x36')]=qs[_0x9efc('0x37')](_0x46a130[_0x9efc('0x2e')][_0x9efc('0x37')]);_0x5d6243[_0x9efc('0x38')]=qs[_0x9efc('0x39')](_[_0x9efc('0x3a')](_0x46a130['query'],_0x7b9820[_0x9efc('0x39')]));if(_0x46a130[_0x9efc('0x2e')][_0x9efc('0x3c')]){_0x5d6243[_0x9efc('0x38')]=_['merge'](_0x5d6243[_0x9efc('0x38')],{'$or':_[_0x9efc('0x27')](_0x5d6243['attributes'],function(_0x1b0a01){var _0x12d0cc={};_0x12d0cc[_0x1b0a01]={'$like':'%'+_0x46a130[_0x9efc('0x2e')][_0x9efc('0x3c')]+'%'};return _0x12d0cc;})});}_0x5d6243=_[_0x9efc('0x45')]({},_0x5d6243,_0x46a130['options']);return _0x39d7ac[_0x9efc('0x4a')](_0x5d6243);}})[_0x9efc('0x3f')](function(_0x473fc7){if(_0x473fc7){_0x41e7b5=_0x473fc7[_0x9efc('0x33')];if(!_0x46a130[_0x9efc('0x2e')][_0x9efc('0x34')](_0x9efc('0x35'))){_0x5d6243[_0x9efc('0x1d')]=qs['limit'](_0x46a130[_0x9efc('0x2e')][_0x9efc('0x1d')]);_0x5d6243['offset']=qs[_0x9efc('0x1a')](_0x46a130[_0x9efc('0x2e')]['offset']);}return _0x39d7ac[_0x9efc('0x4a')](_0x5d6243);}})[_0x9efc('0x3f')](function(_0x54badf){if(_0x54badf){return _0x54badf?{'count':_0x41e7b5,'rows':_0x54badf}:null;}})['then'](respondWithResult(_0x5bdfd0,null))['catch'](handleError(_0x5bdfd0,null));};exports[_0x9efc('0x4d')]=function(_0x394806,_0x222357,_0x5290e7){var _0x565952={};var _0x35d937={};var _0x1f837c;var _0x4fa6e5;return db[_0x9efc('0x28')]['findOne']({'where':{'id':_0x394806[_0x9efc('0x49')]['id']}})[_0x9efc('0x3f')](handleEntityNotFound(_0x222357,null))[_0x9efc('0x3f')](function(_0x447451){if(_0x447451){_0x1f837c=_0x447451;_0x35d937['model']=_['keys'](db[_0x9efc('0x4c')][_0x9efc('0x29')]);_0x35d937[_0x9efc('0x2e')]=_[_0x9efc('0x2f')](_0x394806[_0x9efc('0x2e')]);_0x35d937['filters']=_['intersection'](_0x35d937[_0x9efc('0x2d')],_0x35d937[_0x9efc('0x2e')]);_0x565952['attributes']=_[_0x9efc('0x30')](_0x35d937[_0x9efc('0x2d')],qs[_0x9efc('0x32')](_0x394806['query']['fields']));_0x565952[_0x9efc('0x31')]=_0x565952[_0x9efc('0x31')][_0x9efc('0x33')]?_0x565952[_0x9efc('0x31')]:_0x35d937[_0x9efc('0x2d')];_0x565952['order']=qs[_0x9efc('0x37')](_0x394806[_0x9efc('0x2e')][_0x9efc('0x37')]);_0x565952[_0x9efc('0x38')]=qs[_0x9efc('0x39')](_[_0x9efc('0x3a')](_0x394806[_0x9efc('0x2e')],_0x35d937[_0x9efc('0x39')]));if(_0x394806[_0x9efc('0x2e')][_0x9efc('0x3c')]){_0x565952['where']=_[_0x9efc('0x45')](_0x565952['where'],{'$or':_['map'](_0x565952['attributes'],function(_0x18e455){var _0x1cf10e={};_0x1cf10e[_0x18e455]={'$like':'%'+_0x394806[_0x9efc('0x2e')][_0x9efc('0x3c')]+'%'};return _0x1cf10e;})});}_0x565952=_['merge']({},_0x565952,_0x394806[_0x9efc('0x3d')]);return _0x1f837c[_0x9efc('0x4d')](_0x565952);}})[_0x9efc('0x3f')](function(_0x22ec08){if(_0x22ec08){_0x4fa6e5=_0x22ec08[_0x9efc('0x33')];if(!_0x394806[_0x9efc('0x2e')]['hasOwnProperty'](_0x9efc('0x35'))){_0x565952[_0x9efc('0x1d')]=qs[_0x9efc('0x1d')](_0x394806[_0x9efc('0x2e')]['limit']);_0x565952[_0x9efc('0x1a')]=qs['offset'](_0x394806[_0x9efc('0x2e')][_0x9efc('0x1a')]);}return _0x1f837c['getDescriptions'](_0x565952);}})[_0x9efc('0x3f')](function(_0x5d58f2){if(_0x5d58f2){return _0x5d58f2?{'count':_0x4fa6e5,'rows':_0x5d58f2}:null;}})[_0x9efc('0x3f')](respondWithResult(_0x222357,null))[_0x9efc('0x41')](handleError(_0x222357,null));};exports[_0x9efc('0x4e')]=function(_0xdd0cbf,_0x2666bb,_0x4184eb){var _0x1affd8={};var _0x6a67d9={};var _0x2c2b7d;var _0x2ab7bd;return db[_0x9efc('0x28')][_0x9efc('0x4b')]({'where':{'id':_0xdd0cbf[_0x9efc('0x49')]['id']}})[_0x9efc('0x3f')](handleEntityNotFound(_0x2666bb,null))['then'](function(_0x181bbe){if(_0x181bbe){_0x2c2b7d=_0x181bbe;_0x6a67d9[_0x9efc('0x2d')]=_[_0x9efc('0x2f')](db[_0x9efc('0x4c')][_0x9efc('0x29')]);_0x6a67d9[_0x9efc('0x2e')]=_[_0x9efc('0x2f')](_0xdd0cbf[_0x9efc('0x2e')]);_0x6a67d9[_0x9efc('0x39')]=_[_0x9efc('0x30')](_0x6a67d9[_0x9efc('0x2d')],_0x6a67d9[_0x9efc('0x2e')]);_0x1affd8['attributes']=_[_0x9efc('0x30')](_0x6a67d9[_0x9efc('0x2d')],qs[_0x9efc('0x32')](_0xdd0cbf[_0x9efc('0x2e')][_0x9efc('0x32')]));_0x1affd8[_0x9efc('0x31')]=_0x1affd8[_0x9efc('0x31')]['length']?_0x1affd8[_0x9efc('0x31')]:_0x6a67d9[_0x9efc('0x2d')];_0x1affd8['order']=qs[_0x9efc('0x37')](_0xdd0cbf[_0x9efc('0x2e')][_0x9efc('0x37')]);_0x1affd8[_0x9efc('0x38')]=qs[_0x9efc('0x39')](_['pick'](_0xdd0cbf['query'],_0x6a67d9['filters']));if(_0xdd0cbf[_0x9efc('0x2e')][_0x9efc('0x3c')]){_0x1affd8[_0x9efc('0x38')]=_[_0x9efc('0x45')](_0x1affd8['where'],{'$or':_[_0x9efc('0x27')](_0x1affd8[_0x9efc('0x31')],function(_0x43e905){var _0x4a9326={};_0x4a9326[_0x43e905]={'$like':'%'+_0xdd0cbf[_0x9efc('0x2e')][_0x9efc('0x3c')]+'%'};return _0x4a9326;})});}_0x1affd8=_['merge']({},_0x1affd8,_0xdd0cbf[_0x9efc('0x3d')]);return _0x2c2b7d[_0x9efc('0x4e')](_0x1affd8);}})['then'](function(_0x35e830){if(_0x35e830){_0x2ab7bd=_0x35e830[_0x9efc('0x33')];if(!_0xdd0cbf[_0x9efc('0x2e')][_0x9efc('0x34')](_0x9efc('0x35'))){_0x1affd8[_0x9efc('0x1d')]=qs['limit'](_0xdd0cbf['query'][_0x9efc('0x1d')]);_0x1affd8['offset']=qs['offset'](_0xdd0cbf[_0x9efc('0x2e')][_0x9efc('0x1a')]);}return _0x2c2b7d[_0x9efc('0x4e')](_0x1affd8);}})[_0x9efc('0x3f')](function(_0x26c0e9){if(_0x26c0e9){return _0x26c0e9?{'count':_0x2ab7bd,'rows':_0x26c0e9}:null;}})['then'](respondWithResult(_0x2666bb,null))['catch'](handleError(_0x2666bb,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 42b93e5..4019fa4 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 _0x7ef1=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations','lodash'];(function(_0xdfcdc3,_0x2d34db){var _0x37d718=function(_0x2476b5){while(--_0x2476b5){_0xdfcdc3['push'](_0xdfcdc3['shift']());}};_0x37d718(++_0x2d34db);}(_0x7ef1,0xb3));var _0x17ef=function(_0x42a9f4,_0x5280ee){_0x42a9f4=_0x42a9f4-0x0;var _0x2668bc=_0x7ef1[_0x42a9f4];return _0x2668bc;};'use strict';var _=require(_0x17ef('0x0'));var util=require(_0x17ef('0x1'));var logger=require(_0x17ef('0x2'))(_0x17ef('0x3'));var moment=require(_0x17ef('0x4'));var BPromise=require(_0x17ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17ef('0x6'));var rimraf=require(_0x17ef('0x7'));var config=require(_0x17ef('0x8'));var attributes=require(_0x17ef('0x9'));module['exports']=function(_0x2b5330,_0x336871){return _0x2b5330[_0x17ef('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x17ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ee7=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','util','../../config/logger','api','path','rimraf'];(function(_0x4caa01,_0x536f5b){var _0x2e08bf=function(_0x4620d5){while(--_0x4620d5){_0x4caa01['push'](_0x4caa01['shift']());}};_0x2e08bf(++_0x536f5b);}(_0x3ee7,0xd6));var _0x73ee=function(_0x15d6fc,_0x482d0e){_0x15d6fc=_0x15d6fc-0x0;var _0x1e5d9a=_0x3ee7[_0x15d6fc];return _0x1e5d9a;};'use strict';var _=require(_0x73ee('0x0'));var util=require(_0x73ee('0x1'));var logger=require(_0x73ee('0x2'))(_0x73ee('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x73ee('0x4'));var rimraf=require(_0x73ee('0x5'));var config=require(_0x73ee('0x6'));var attributes=require(_0x73ee('0x7'));module[_0x73ee('0x8')]=function(_0x4e6bea,_0x266163){return _0x4e6bea[_0x73ee('0x9')]('FreshsalesConfiguration',attributes,{'tableName':_0x73ee('0xa'),'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 d51bcac..ccb5ecf 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 _0xbbc7=['info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then'];(function(_0x2487ff,_0x54504c){var _0x12e218=function(_0x273261){while(--_0x273261){_0x2487ff['push'](_0x2487ff['shift']());}};_0x12e218(++_0x54504c);}(_0xbbc7,0xbb));var _0x7bbc=function(_0x104033,_0x4748a5){_0x104033=_0x104033-0x0;var _0x8b665=_0xbbc7[_0x104033];return _0x8b665;};'use strict';var _=require('lodash');var util=require(_0x7bbc('0x0'));var moment=require(_0x7bbc('0x1'));var BPromise=require(_0x7bbc('0x2'));var rs=require(_0x7bbc('0x3'));var fs=require('fs');var Redis=require(_0x7bbc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bbc('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7bbc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7bbc('0x7')][_0x7bbc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x316a38,_0xcebc67,_0x4c1497){return new BPromise(function(_0x578b5b,_0x4ba583){return client[_0x7bbc('0x9')](_0x316a38,_0x4c1497)[_0x7bbc('0xa')](function(_0x262de0){logger[_0x7bbc('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xcebc67,_0x7bbc('0xc'));logger[_0x7bbc('0xd')](_0x7bbc('0xe'),_0xcebc67,_0x7bbc('0xc'),JSON[_0x7bbc('0xf')](_0x262de0));if(_0x262de0[_0x7bbc('0x10')]){if(_0x262de0['error'][_0x7bbc('0x11')]===0x1f4){logger[_0x7bbc('0x10')](_0x7bbc('0x12'),_0xcebc67,_0x262de0[_0x7bbc('0x10')]['message']);return _0x4ba583(_0x262de0[_0x7bbc('0x10')][_0x7bbc('0x13')]);}logger[_0x7bbc('0x10')](_0x7bbc('0x12'),_0xcebc67,_0x262de0[_0x7bbc('0x10')][_0x7bbc('0x13')]);return _0x578b5b(_0x262de0[_0x7bbc('0x10')][_0x7bbc('0x13')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0xcebc67,_0x7bbc('0xc'));_0x578b5b(_0x262de0[_0x7bbc('0x14')][_0x7bbc('0x13')]);}})[_0x7bbc('0x15')](function(_0x3cc05f){logger['error'](_0x7bbc('0x12'),_0xcebc67,_0x3cc05f);_0x4ba583(_0x3cc05f);});});} \ No newline at end of file +var _0xb91c=['debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb91c,0x1be));var _0xcb91=function(_0x140c14,_0x20bea8){_0x140c14=_0x140c14-0x0;var _0x3fa0cd=_0xb91c[_0x140c14];return _0x3fa0cd;};'use strict';var _=require('lodash');var util=require(_0xcb91('0x0'));var moment=require(_0xcb91('0x1'));var BPromise=require(_0xcb91('0x2'));var rs=require(_0xcb91('0x3'));var fs=require('fs');var Redis=require(_0xcb91('0x4'));var db=require(_0xcb91('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb91('0x6'))(_0xcb91('0x7'));var config=require('../../config/environment');var jayson=require(_0xcb91('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xea3a93,_0x3c6df2,_0x5a5846){return new BPromise(function(_0x2cc69d,_0x345006){return client[_0xcb91('0x9')](_0xea3a93,_0x5a5846)[_0xcb91('0xa')](function(_0x5d878a){logger[_0xcb91('0xb')](_0xcb91('0xc'),_0x3c6df2,_0xcb91('0xd'));logger[_0xcb91('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3c6df2,'request\x20sent',JSON[_0xcb91('0xf')](_0x5d878a));if(_0x5d878a['error']){if(_0x5d878a[_0xcb91('0x10')][_0xcb91('0x11')]===0x1f4){logger[_0xcb91('0x10')](_0xcb91('0xc'),_0x3c6df2,_0x5d878a[_0xcb91('0x10')]['message']);return _0x345006(_0x5d878a[_0xcb91('0x10')][_0xcb91('0x12')]);}logger[_0xcb91('0x10')](_0xcb91('0xc'),_0x3c6df2,_0x5d878a[_0xcb91('0x10')][_0xcb91('0x12')]);return _0x2cc69d(_0x5d878a[_0xcb91('0x10')]['message']);}else{logger[_0xcb91('0xb')](_0xcb91('0xc'),_0x3c6df2,_0xcb91('0xd'));_0x2cc69d(_0x5d878a[_0xcb91('0x13')][_0xcb91('0x12')]);}})['catch'](function(_0x5b03c5){logger[_0xcb91('0x10')](_0xcb91('0xc'),_0x3c6df2,_0x5b03c5);_0x345006(_0x5b03c5);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 3311d55..b3e946a 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 _0x87df=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x41c9a6,_0x290c43){var _0x253783=function(_0x220e01){while(--_0x220e01){_0x41c9a6['push'](_0x41c9a6['shift']());}};_0x253783(++_0x290c43);}(_0x87df,0x167));var _0xf87d=function(_0x21001b,_0x3ff1a8){_0x21001b=_0x21001b-0x0;var _0x665a00=_0x87df[_0x21001b];return _0x665a00;};'use strict';var multer=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var path=require(_0xf87d('0x2'));var timeout=require(_0xf87d('0x3'));var express=require(_0xf87d('0x4'));var router=express[_0xf87d('0x5')]();var fs_extra=require(_0xf87d('0x6'));var auth=require(_0xf87d('0x7'));var interaction=require(_0xf87d('0x8'));var config=require(_0xf87d('0x9'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xf87d('0xa')](),controller[_0xf87d('0xb')]);router['get'](_0xf87d('0xc'),auth[_0xf87d('0xa')](),controller[_0xf87d('0xd')]);router[_0xf87d('0xe')]('/',auth[_0xf87d('0xa')](),controller[_0xf87d('0xf')]);router[_0xf87d('0x10')](_0xf87d('0xc'),auth[_0xf87d('0xa')](),controller[_0xf87d('0x11')]);router[_0xf87d('0x12')](_0xf87d('0xc'),auth[_0xf87d('0xa')](),controller[_0xf87d('0x13')]);module[_0xf87d('0x14')]=router; \ No newline at end of file +var _0x89c3=['Router','fs-extra','../../components/auth/service','../../config/environment','get','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x43ce91,_0x591b24){var _0x2b39d3=function(_0x5efc9b){while(--_0x5efc9b){_0x43ce91['push'](_0x43ce91['shift']());}};_0x2b39d3(++_0x591b24);}(_0x89c3,0xff));var _0x389c=function(_0x3a1d21,_0x576a02){_0x3a1d21=_0x3a1d21-0x0;var _0x279d16=_0x89c3[_0x3a1d21];return _0x279d16;};'use strict';var multer=require(_0x389c('0x0'));var util=require(_0x389c('0x1'));var path=require(_0x389c('0x2'));var timeout=require(_0x389c('0x3'));var express=require(_0x389c('0x4'));var router=express[_0x389c('0x5')]();var fs_extra=require(_0x389c('0x6'));var auth=require(_0x389c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x389c('0x8'));var controller=require('./intFreshsalesField.controller');router[_0x389c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x389c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x389c('0xa')]);router[_0x389c('0xb')]('/',auth[_0x389c('0xc')](),controller[_0x389c('0xd')]);router[_0x389c('0xe')](_0x389c('0xf'),auth[_0x389c('0xc')](),controller[_0x389c('0x10')]);router[_0x389c('0x11')]('/:id',auth[_0x389c('0xc')](),controller[_0x389c('0x12')]);module[_0x389c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 9146d24..87a05fb 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 _0x4114=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x2f7a84,_0x21e73d){var _0x43d597=function(_0x3f1e74){while(--_0x3f1e74){_0x2f7a84['push'](_0x2f7a84['shift']());}};_0x43d597(++_0x21e73d);}(_0x4114,0x191));var _0x4411=function(_0x1180d5,_0xa6c23c){_0x1180d5=_0x1180d5-0x0;var _0x55ad8b=_0x4114[_0x1180d5];return _0x55ad8b;};'use strict';var Sequelize=require(_0x4411('0x0'));module[_0x4411('0x1')]={'type':{'type':Sequelize[_0x4411('0x2')](_0x4411('0x3'),_0x4411('0x4'),_0x4411('0x5'),_0x4411('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4411('0x7')]},'keyType':{'type':Sequelize[_0x4411('0x2')]('string',_0x4411('0x4'),_0x4411('0x5'))},'keyContent':{'type':Sequelize[_0x4411('0x7')]},'idField':{'type':Sequelize[_0x4411('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4411('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb104=['customVariable','BOOLEAN','exports','string','keyValue','picklist','STRING','ENUM','variable'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb104,0x197));var _0x4b10=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0xb104[_0x396466];return _0x5e9ab4;};'use strict';var Sequelize=require('sequelize');module[_0x4b10('0x0')]={'type':{'type':Sequelize['ENUM'](_0x4b10('0x1'),'variable','customVariable',_0x4b10('0x2'),_0x4b10('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4b10('0x4')]},'key':{'type':Sequelize[_0x4b10('0x4')]},'keyType':{'type':Sequelize[_0x4b10('0x5')](_0x4b10('0x1'),_0x4b10('0x6'),_0x4b10('0x7'))},'keyContent':{'type':Sequelize[_0x4b10('0x4')]},'idField':{'type':Sequelize[_0x4b10('0x4')]},'nameField':{'type':Sequelize[_0x4b10('0x4')]},'customField':{'type':Sequelize[_0x4b10('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4b10('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 4e7bf54..b1c68f0 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 _0x74cc=['undefined','count','limit','status','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','FreshsalesField','include','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset'];(function(_0xdd3ba3,_0x320c25){var _0x2f0791=function(_0x5c9280){while(--_0x5c9280){_0xdd3ba3['push'](_0xdd3ba3['shift']());}};_0x2f0791(++_0x320c25);}(_0x74cc,0x102));var _0xc74c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x74cc[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc74c('0x0'));var zipdir=require(_0xc74c('0x1'));var jsonpatch=require(_0xc74c('0x2'));var rp=require(_0xc74c('0x3'));var moment=require(_0xc74c('0x4'));var BPromise=require(_0xc74c('0x5'));var Mustache=require(_0xc74c('0x6'));var util=require(_0xc74c('0x7'));var path=require(_0xc74c('0x8'));var sox=require(_0xc74c('0x9'));var csv=require(_0xc74c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc74c('0xb'));var squel=require(_0xc74c('0xc'));var crypto=require(_0xc74c('0xd'));var jsforce=require(_0xc74c('0xe'));var deskjs=require(_0xc74c('0xf'));var toCsv=require(_0xc74c('0xa'));var querystring=require(_0xc74c('0x10'));var Papa=require(_0xc74c('0x11'));var Redis=require(_0xc74c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc74c('0x13'));var as=require(_0xc74c('0x14'));var hardwareService=require(_0xc74c('0x15'));var logger=require(_0xc74c('0x16'))(_0xc74c('0x17'));var utils=require('../../config/utils');var config=require(_0xc74c('0x18'));var licenseUtil=require(_0xc74c('0x19'));var db=require(_0xc74c('0x1a'))['db'];function respondWithStatusCode(_0x59f9c6,_0xe4d593){_0xe4d593=_0xe4d593||0xcc;return function(_0x19e734){if(_0x19e734){return _0x59f9c6['sendStatus'](_0xe4d593);}return _0x59f9c6['status'](_0xe4d593)[_0xc74c('0x1b')]();};}function respondWithResult(_0x5b1c1f,_0x401f43){_0x401f43=_0x401f43||0xc8;return function(_0x4939f8){if(_0x4939f8){return _0x5b1c1f['status'](_0x401f43)[_0xc74c('0x1c')](_0x4939f8);}};}function respondWithFilteredResult(_0x230d06,_0x7f1dd2){return function(_0x54b3a3){if(_0x54b3a3){var _0x4022ed=typeof _0x7f1dd2[_0xc74c('0x1d')]===_0xc74c('0x1e')&&typeof _0x7f1dd2['limit']===_0xc74c('0x1e');var _0x48d1e2=_0x54b3a3[_0xc74c('0x1f')];var _0x4a1e48=_0x4022ed?0x0:_0x7f1dd2['offset'];var _0x11113d=_0x4022ed?_0x54b3a3[_0xc74c('0x1f')]:_0x7f1dd2['offset']+_0x7f1dd2[_0xc74c('0x20')];var _0x34366f;if(_0x11113d>=_0x48d1e2){_0x11113d=_0x48d1e2;_0x34366f=0xc8;}else{_0x34366f=0xce;}_0x230d06[_0xc74c('0x21')](_0x34366f);return _0x230d06['set'](_0xc74c('0x22'),_0x4a1e48+'-'+_0x11113d+'/'+_0x48d1e2)[_0xc74c('0x1c')](_0x54b3a3);}return null;};}function patchUpdates(_0x3f7b2e){return function(_0x55c4d8){try{jsonpatch['apply'](_0x55c4d8,_0x3f7b2e,!![]);}catch(_0x53c162){return BPromise[_0xc74c('0x23')](_0x53c162);}return _0x55c4d8[_0xc74c('0x24')]();};}function saveUpdates(_0x381bc8,_0x270a95){return function(_0x51ec3d){if(_0x51ec3d){return _0x51ec3d[_0xc74c('0x25')](_0x381bc8)[_0xc74c('0x26')](function(_0x218f45){return _0x218f45;});}return null;};}function removeEntity(_0x19c43c,_0x203fba){return function(_0x1f4e3e){if(_0x1f4e3e){return _0x1f4e3e[_0xc74c('0x27')]()['then'](function(){_0x19c43c[_0xc74c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276c6b,_0x24a842){return function(_0x1a566b){if(!_0x1a566b){_0x276c6b['sendStatus'](0x194);}return _0x1a566b;};}function handleError(_0x17d048,_0x346f07){_0x346f07=_0x346f07||0x1f4;return function(_0x309c21){logger[_0xc74c('0x28')](_0x309c21[_0xc74c('0x29')]);if(_0x309c21['name']){delete _0x309c21[_0xc74c('0x2a')];}_0x17d048['status'](_0x346f07)[_0xc74c('0x2b')](_0x309c21);};}exports[_0xc74c('0x2c')]=function(_0x388a17,_0x864a76){var _0x433398={},_0x1955e0={},_0x3e578a={'count':0x0,'rows':[]};var _0x443133=_[_0xc74c('0x2d')](db['FreshsalesField'][_0xc74c('0x2e')],function(_0xee0b6e){return{'name':_0xee0b6e[_0xc74c('0x2f')],'type':_0xee0b6e[_0xc74c('0x30')]['key']};});_0x1955e0[_0xc74c('0x31')]=_[_0xc74c('0x2d')](_0x443133,'name');_0x1955e0['query']=_[_0xc74c('0x32')](_0x388a17[_0xc74c('0x33')]);_0x1955e0[_0xc74c('0x34')]=_[_0xc74c('0x35')](_0x1955e0['model'],_0x1955e0[_0xc74c('0x33')]);_0x433398[_0xc74c('0x36')]=_[_0xc74c('0x35')](_0x1955e0[_0xc74c('0x31')],qs[_0xc74c('0x37')](_0x388a17[_0xc74c('0x33')][_0xc74c('0x37')]));_0x433398[_0xc74c('0x36')]=_0x433398[_0xc74c('0x36')][_0xc74c('0x38')]?_0x433398[_0xc74c('0x36')]:_0x1955e0['model'];if(!_0x388a17[_0xc74c('0x33')]['hasOwnProperty'](_0xc74c('0x39'))){_0x433398[_0xc74c('0x20')]=qs[_0xc74c('0x20')](_0x388a17[_0xc74c('0x33')][_0xc74c('0x20')]);_0x433398[_0xc74c('0x1d')]=qs[_0xc74c('0x1d')](_0x388a17[_0xc74c('0x33')][_0xc74c('0x1d')]);}_0x433398[_0xc74c('0x3a')]=qs[_0xc74c('0x3b')](_0x388a17['query'][_0xc74c('0x3b')]);_0x433398['where']=qs['filters'](_['pick'](_0x388a17[_0xc74c('0x33')],_0x1955e0[_0xc74c('0x34')]),_0x443133);if(_0x388a17['query']['filter']){_0x433398[_0xc74c('0x3c')]=_['merge'](_0x433398['where'],{'$or':_['map'](_0x443133,function(_0x23faf5){if(_0x23faf5[_0xc74c('0x30')]!=='VIRTUAL'){var _0x4f0eda={};_0x4f0eda[_0x23faf5['name']]={'$like':'%'+_0x388a17[_0xc74c('0x33')][_0xc74c('0x3d')]+'%'};return _0x4f0eda;}})});}_0x433398=_[_0xc74c('0x3e')]({},_0x433398,_0x388a17[_0xc74c('0x3f')]);var _0x205800={'where':_0x433398[_0xc74c('0x3c')]};return db[_0xc74c('0x40')][_0xc74c('0x1f')](_0x205800)[_0xc74c('0x26')](function(_0x23d0bc){_0x3e578a[_0xc74c('0x1f')]=_0x23d0bc;if(_0x388a17[_0xc74c('0x33')]['includeAll']){_0x433398[_0xc74c('0x41')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x433398);})[_0xc74c('0x26')](function(_0xd237d1){_0x3e578a['rows']=_0xd237d1;return _0x3e578a;})[_0xc74c('0x26')](respondWithFilteredResult(_0x864a76,_0x433398))[_0xc74c('0x42')](handleError(_0x864a76,null));};exports[_0xc74c('0x43')]=function(_0x10dd80,_0x439688){var _0x1450c7={'raw':!![],'where':{'id':_0x10dd80[_0xc74c('0x44')]['id']}},_0x488842={};_0x488842['model']=_['keys'](db[_0xc74c('0x40')]['rawAttributes']);_0x488842[_0xc74c('0x33')]=_[_0xc74c('0x32')](_0x10dd80[_0xc74c('0x33')]);_0x488842[_0xc74c('0x34')]=_[_0xc74c('0x35')](_0x488842[_0xc74c('0x31')],_0x488842[_0xc74c('0x33')]);_0x1450c7[_0xc74c('0x36')]=_[_0xc74c('0x35')](_0x488842['model'],qs[_0xc74c('0x37')](_0x10dd80[_0xc74c('0x33')]['fields']));_0x1450c7[_0xc74c('0x36')]=_0x1450c7['attributes'][_0xc74c('0x38')]?_0x1450c7['attributes']:_0x488842[_0xc74c('0x31')];if(_0x10dd80[_0xc74c('0x33')]['includeAll']){_0x1450c7['include']=[{'all':!![]}];}_0x1450c7=_[_0xc74c('0x3e')]({},_0x1450c7,_0x10dd80[_0xc74c('0x3f')]);return db[_0xc74c('0x40')][_0xc74c('0x45')](_0x1450c7)[_0xc74c('0x26')](handleEntityNotFound(_0x439688,null))[_0xc74c('0x26')](respondWithResult(_0x439688,null))[_0xc74c('0x42')](handleError(_0x439688,null));};exports[_0xc74c('0x46')]=function(_0xf0cc96,_0x2a57f2){return db['FreshsalesField'][_0xc74c('0x46')](_0xf0cc96[_0xc74c('0x47')],{})[_0xc74c('0x26')](respondWithResult(_0x2a57f2,0xc9))[_0xc74c('0x42')](handleError(_0x2a57f2,null));};exports[_0xc74c('0x25')]=function(_0x226526,_0x9ded2){if(_0x226526['body']['id']){delete _0x226526['body']['id'];}return db['FreshsalesField'][_0xc74c('0x45')]({'where':{'id':_0x226526[_0xc74c('0x44')]['id']}})[_0xc74c('0x26')](handleEntityNotFound(_0x9ded2,null))['then'](saveUpdates(_0x226526[_0xc74c('0x47')],null))[_0xc74c('0x26')](respondWithResult(_0x9ded2,null))[_0xc74c('0x42')](handleError(_0x9ded2,null));};exports['destroy']=function(_0x2e1199,_0x1bfff5){return db[_0xc74c('0x40')]['find']({'where':{'id':_0x2e1199[_0xc74c('0x44')]['id']}})[_0xc74c('0x26')](handleEntityNotFound(_0x1bfff5,null))[_0xc74c('0x26')](removeEntity(_0x1bfff5,null))[_0xc74c('0x42')](handleError(_0x1bfff5,null));}; \ No newline at end of file +var _0x9067=['limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','FreshsalesField','rawAttributes','length','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3a54bc,_0x3ff13){var _0x58d604=function(_0x1577d5){while(--_0x1577d5){_0x3a54bc['push'](_0x3a54bc['shift']());}};_0x58d604(++_0x3ff13);}(_0x9067,0x76));var _0x7906=function(_0x1d8e25,_0x40d7af){_0x1d8e25=_0x1d8e25-0x0;var _0x15927e=_0x9067[_0x1d8e25];return _0x15927e;};'use strict';var emlformat=require(_0x7906('0x0'));var rimraf=require(_0x7906('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7906('0x2'));var rp=require(_0x7906('0x3'));var moment=require('moment');var BPromise=require(_0x7906('0x4'));var Mustache=require(_0x7906('0x5'));var util=require(_0x7906('0x6'));var path=require('path');var sox=require(_0x7906('0x7'));var csv=require(_0x7906('0x8'));var ejs=require(_0x7906('0x9'));var fs=require('fs');var fs_extra=require(_0x7906('0xa'));var _=require(_0x7906('0xb'));var squel=require(_0x7906('0xc'));var crypto=require(_0x7906('0xd'));var jsforce=require(_0x7906('0xe'));var deskjs=require(_0x7906('0xf'));var toCsv=require(_0x7906('0x8'));var querystring=require('querystring');var Papa=require(_0x7906('0x10'));var Redis=require(_0x7906('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7906('0x12'));var as=require(_0x7906('0x13'));var hardwareService=require(_0x7906('0x14'));var logger=require('../../config/logger')(_0x7906('0x15'));var utils=require(_0x7906('0x16'));var config=require(_0x7906('0x17'));var licenseUtil=require(_0x7906('0x18'));var db=require(_0x7906('0x19'))['db'];function respondWithStatusCode(_0xc09da3,_0x40309d){_0x40309d=_0x40309d||0xcc;return function(_0x52c26f){if(_0x52c26f){return _0xc09da3[_0x7906('0x1a')](_0x40309d);}return _0xc09da3[_0x7906('0x1b')](_0x40309d)[_0x7906('0x1c')]();};}function respondWithResult(_0x1bfdb3,_0x2a50e7){_0x2a50e7=_0x2a50e7||0xc8;return function(_0x261697){if(_0x261697){return _0x1bfdb3[_0x7906('0x1b')](_0x2a50e7)[_0x7906('0x1d')](_0x261697);}};}function respondWithFilteredResult(_0x5bf39b,_0x1d7900){return function(_0x374c53){if(_0x374c53){var _0x1e4bc2=typeof _0x1d7900[_0x7906('0x1e')]===_0x7906('0x1f')&&typeof _0x1d7900[_0x7906('0x20')]==='undefined';var _0x56ed25=_0x374c53[_0x7906('0x21')];var _0x3c6898=_0x1e4bc2?0x0:_0x1d7900['offset'];var _0x124386=_0x1e4bc2?_0x374c53[_0x7906('0x21')]:_0x1d7900[_0x7906('0x1e')]+_0x1d7900[_0x7906('0x20')];var _0x5aa504;if(_0x124386>=_0x56ed25){_0x124386=_0x56ed25;_0x5aa504=0xc8;}else{_0x5aa504=0xce;}_0x5bf39b['status'](_0x5aa504);return _0x5bf39b['set'](_0x7906('0x22'),_0x3c6898+'-'+_0x124386+'/'+_0x56ed25)[_0x7906('0x1d')](_0x374c53);}return null;};}function patchUpdates(_0x34c1b9){return function(_0x4e8b17){try{jsonpatch[_0x7906('0x23')](_0x4e8b17,_0x34c1b9,!![]);}catch(_0x272d5e){return BPromise[_0x7906('0x24')](_0x272d5e);}return _0x4e8b17[_0x7906('0x25')]();};}function saveUpdates(_0x45991a,_0x5e4566){return function(_0x332e62){if(_0x332e62){return _0x332e62['update'](_0x45991a)[_0x7906('0x26')](function(_0x3c1970){return _0x3c1970;});}return null;};}function removeEntity(_0xe7f942,_0x181474){return function(_0xc9c749){if(_0xc9c749){return _0xc9c749['destroy']()[_0x7906('0x26')](function(){_0xe7f942[_0x7906('0x1b')](0xcc)[_0x7906('0x1c')]();});}};}function handleEntityNotFound(_0x325c4e,_0x5246cb){return function(_0x2e665f){if(!_0x2e665f){_0x325c4e[_0x7906('0x1a')](0x194);}return _0x2e665f;};}function handleError(_0x9ba498,_0x509b73){_0x509b73=_0x509b73||0x1f4;return function(_0x60b27c){logger[_0x7906('0x27')](_0x60b27c[_0x7906('0x28')]);if(_0x60b27c[_0x7906('0x29')]){delete _0x60b27c[_0x7906('0x29')];}_0x9ba498['status'](_0x509b73)[_0x7906('0x2a')](_0x60b27c);};}exports[_0x7906('0x2b')]=function(_0x42821d,_0x525896){var _0x326b19={},_0x158276={},_0x23ce3a={'count':0x0,'rows':[]};var _0x17b7c1=_[_0x7906('0x2c')](db['FreshsalesField']['rawAttributes'],function(_0x5affdd){return{'name':_0x5affdd[_0x7906('0x2d')],'type':_0x5affdd[_0x7906('0x2e')][_0x7906('0x2f')]};});_0x158276[_0x7906('0x30')]=_['map'](_0x17b7c1,'name');_0x158276['query']=_[_0x7906('0x31')](_0x42821d['query']);_0x158276[_0x7906('0x32')]=_['intersection'](_0x158276[_0x7906('0x30')],_0x158276[_0x7906('0x33')]);_0x326b19['attributes']=_[_0x7906('0x34')](_0x158276[_0x7906('0x30')],qs[_0x7906('0x35')](_0x42821d[_0x7906('0x33')][_0x7906('0x35')]));_0x326b19[_0x7906('0x36')]=_0x326b19[_0x7906('0x36')]['length']?_0x326b19[_0x7906('0x36')]:_0x158276[_0x7906('0x30')];if(!_0x42821d[_0x7906('0x33')][_0x7906('0x37')](_0x7906('0x38'))){_0x326b19[_0x7906('0x20')]=qs[_0x7906('0x20')](_0x42821d[_0x7906('0x33')]['limit']);_0x326b19[_0x7906('0x1e')]=qs[_0x7906('0x1e')](_0x42821d['query']['offset']);}_0x326b19['order']=qs[_0x7906('0x39')](_0x42821d[_0x7906('0x33')][_0x7906('0x39')]);_0x326b19['where']=qs[_0x7906('0x32')](_['pick'](_0x42821d[_0x7906('0x33')],_0x158276[_0x7906('0x32')]),_0x17b7c1);if(_0x42821d['query'][_0x7906('0x3a')]){_0x326b19[_0x7906('0x3b')]=_[_0x7906('0x3c')](_0x326b19[_0x7906('0x3b')],{'$or':_['map'](_0x17b7c1,function(_0xf6c7f){if(_0xf6c7f[_0x7906('0x2e')]!==_0x7906('0x3d')){var _0x23e93a={};_0x23e93a[_0xf6c7f[_0x7906('0x29')]]={'$like':'%'+_0x42821d[_0x7906('0x33')]['filter']+'%'};return _0x23e93a;}})});}_0x326b19=_['merge']({},_0x326b19,_0x42821d[_0x7906('0x3e')]);var _0x1b6430={'where':_0x326b19[_0x7906('0x3b')]};return db['FreshsalesField'][_0x7906('0x21')](_0x1b6430)['then'](function(_0x537c76){_0x23ce3a['count']=_0x537c76;if(_0x42821d[_0x7906('0x33')][_0x7906('0x3f')]){_0x326b19[_0x7906('0x40')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x326b19);})['then'](function(_0x2c4735){_0x23ce3a[_0x7906('0x41')]=_0x2c4735;return _0x23ce3a;})[_0x7906('0x26')](respondWithFilteredResult(_0x525896,_0x326b19))[_0x7906('0x42')](handleError(_0x525896,null));};exports['show']=function(_0x1b2aee,_0x13a5d4){var _0x5c6dde={'raw':!![],'where':{'id':_0x1b2aee[_0x7906('0x43')]['id']}},_0x2b1c40={};_0x2b1c40[_0x7906('0x30')]=_['keys'](db[_0x7906('0x44')][_0x7906('0x45')]);_0x2b1c40[_0x7906('0x33')]=_[_0x7906('0x31')](_0x1b2aee['query']);_0x2b1c40[_0x7906('0x32')]=_[_0x7906('0x34')](_0x2b1c40[_0x7906('0x30')],_0x2b1c40[_0x7906('0x33')]);_0x5c6dde[_0x7906('0x36')]=_['intersection'](_0x2b1c40[_0x7906('0x30')],qs[_0x7906('0x35')](_0x1b2aee[_0x7906('0x33')]['fields']));_0x5c6dde[_0x7906('0x36')]=_0x5c6dde[_0x7906('0x36')][_0x7906('0x46')]?_0x5c6dde[_0x7906('0x36')]:_0x2b1c40['model'];if(_0x1b2aee[_0x7906('0x33')][_0x7906('0x3f')]){_0x5c6dde[_0x7906('0x40')]=[{'all':!![]}];}_0x5c6dde=_[_0x7906('0x3c')]({},_0x5c6dde,_0x1b2aee[_0x7906('0x3e')]);return db['FreshsalesField'][_0x7906('0x47')](_0x5c6dde)[_0x7906('0x26')](handleEntityNotFound(_0x13a5d4,null))[_0x7906('0x26')](respondWithResult(_0x13a5d4,null))[_0x7906('0x42')](handleError(_0x13a5d4,null));};exports['create']=function(_0x6ca342,_0x94ce05){return db[_0x7906('0x44')][_0x7906('0x48')](_0x6ca342[_0x7906('0x49')],{})[_0x7906('0x26')](respondWithResult(_0x94ce05,0xc9))[_0x7906('0x42')](handleError(_0x94ce05,null));};exports[_0x7906('0x4a')]=function(_0x1f581e,_0x576a7e){if(_0x1f581e['body']['id']){delete _0x1f581e[_0x7906('0x49')]['id'];}return db[_0x7906('0x44')]['find']({'where':{'id':_0x1f581e['params']['id']}})[_0x7906('0x26')](handleEntityNotFound(_0x576a7e,null))['then'](saveUpdates(_0x1f581e[_0x7906('0x49')],null))[_0x7906('0x26')](respondWithResult(_0x576a7e,null))[_0x7906('0x42')](handleError(_0x576a7e,null));};exports['destroy']=function(_0x485dd5,_0x1cb02d){return db[_0x7906('0x44')][_0x7906('0x47')]({'where':{'id':_0x485dd5[_0x7906('0x43')]['id']}})[_0x7906('0x26')](handleEntityNotFound(_0x1cb02d,null))['then'](removeEntity(_0x1cb02d,null))[_0x7906('0x42')](handleError(_0x1cb02d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e4d4701..46f3ed9 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 _0x351d=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','FreshsalesField','int_freshsales_fields','idField','FieldId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x351d,0x90));var _0xd351=function(_0x327427,_0x3bc4f4){_0x327427=_0x327427-0x0;var _0x30c6bd=_0x351d[_0x327427];return _0x30c6bd;};'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('./intFreshsalesField.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xd351('0xa'),_0xd351('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xde6f=['exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes'];(function(_0x1bffda,_0x1e9817){var _0x10d401=function(_0x2ded74){while(--_0x2ded74){_0x1bffda['push'](_0x1bffda['shift']());}};_0x10d401(++_0x1e9817);}(_0xde6f,0x84));var _0xfde6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde6f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfde6('0x0'))(_0xfde6('0x1'));var moment=require(_0xfde6('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde6('0x3'));var fs=require('fs');var path=require(_0xfde6('0x4'));var rimraf=require(_0xfde6('0x5'));var config=require(_0xfde6('0x6'));var attributes=require(_0xfde6('0x7'));module[_0xfde6('0x8')]=function(_0x50d21a,_0x5628ea){return _0x50d21a[_0xfde6('0x9')](_0xfde6('0xa'),attributes,{'tableName':_0xfde6('0xb'),'paranoid':![],'indexes':[{'name':_0xfde6('0xc'),'fields':['idField',_0xfde6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 50ac8c9..9a8c41e 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(_0x1334e3,_0x4d41d8){var _0xec79e3=function(_0x368e2e){while(--_0x368e2e){_0x1334e3['push'](_0x1334e3['shift']());}};_0xec79e3(++_0x4d41d8);}(_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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0xadb5,0xad));var _0x5adb=function(_0x18494c,_0x2ad1ca){_0x18494c=_0x18494c-0x0;var _0x4c276c=_0xadb5[_0x18494c];return _0x4c276c;};'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']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index cfd379d..c3e106e 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5db7e2,_0x336610){var _0x29abd1=function(_0x5eab86){while(--_0x5eab86){_0x5db7e2['push'](_0x5db7e2['shift']());}};_0x29abd1(++_0x336610);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x193af9,_0xa04b6b){var _0xa8b025=function(_0x2945f8){while(--_0x2945f8){_0x193af9['push'](_0x193af9['shift']());}};_0xa8b025(++_0xa04b6b);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index fd2de03..c3e3736 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 _0x3618=['exports','STRING','username','ENUM','integrationTab','sequelize'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0x3618,0x10d));var _0x8361=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x3618[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x8361('0x0'));module[_0x8361('0x1')]={'name':{'type':Sequelize[_0x8361('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8361('0x2')],'unique':_0x8361('0x3')},'remoteUri':{'type':Sequelize[_0x8361('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8361('0x2')]},'securityToken':{'type':Sequelize[_0x8361('0x2')]},'serverUrl':{'type':Sequelize[_0x8361('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8361('0x4')](_0x8361('0x5'),'newTab'),'defaultValue':_0x8361('0x5')}}; \ No newline at end of file +var _0xfcbb=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x5e4729,_0x138d65){var _0x491dfb=function(_0x181ac5){while(--_0x181ac5){_0x5e4729['push'](_0x5e4729['shift']());}};_0x491dfb(++_0x138d65);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x4d39aa,_0x108f9a){_0x4d39aa=_0x4d39aa-0x0;var _0x558983=_0xfcbb[_0x4d39aa];return _0x558983;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfcb('0x3')},'remoteUri':{'type':Sequelize[_0xbfcb('0x2')]},'password':{'type':Sequelize[_0xbfcb('0x2')]},'clientId':{'type':Sequelize[_0xbfcb('0x2')]},'clientSecret':{'type':Sequelize[_0xbfcb('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbfcb('0x4')](_0xbfcb('0x5'),_0xbfcb('0x6')),'defaultValue':_0xbfcb('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index e52c75c..2307bee 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 _0x9418=['order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','value','true','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SalesforceAccount','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','params','include','options','find','catch','create','body','destroy','findOne','SalesforceConfiguration'];(function(_0x17de9d,_0x3e855f){var _0x5a147a=function(_0x1497f4){while(--_0x1497f4){_0x17de9d['push'](_0x17de9d['shift']());}};_0x5a147a(++_0x3e855f);}(_0x9418,0xaf));var _0x8941=function(_0x549a09,_0x2fe584){_0x549a09=_0x549a09-0x0;var _0x3ef978=_0x9418[_0x549a09];return _0x3ef978;};'use strict';var emlformat=require(_0x8941('0x0'));var rimraf=require(_0x8941('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8941('0x2'));var rp=require('request-promise');var moment=require(_0x8941('0x3'));var BPromise=require(_0x8941('0x4'));var Mustache=require(_0x8941('0x5'));var util=require(_0x8941('0x6'));var path=require(_0x8941('0x7'));var sox=require(_0x8941('0x8'));var csv=require('to-csv');var ejs=require(_0x8941('0x9'));var fs=require('fs');var fs_extra=require(_0x8941('0xa'));var _=require(_0x8941('0xb'));var squel=require(_0x8941('0xc'));var crypto=require(_0x8941('0xd'));var jsforce=require(_0x8941('0xe'));var deskjs=require(_0x8941('0xf'));var toCsv=require(_0x8941('0x10'));var querystring=require(_0x8941('0x11'));var Papa=require(_0x8941('0x12'));var Redis=require(_0x8941('0x13'));var authService=require(_0x8941('0x14'));var qs=require(_0x8941('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8941('0x16'));var logger=require(_0x8941('0x17'))(_0x8941('0x18'));var utils=require('../../config/utils');var config=require(_0x8941('0x19'));var licenseUtil=require(_0x8941('0x1a'));var db=require(_0x8941('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4dce4f,_0x1a4713){_0x1a4713=_0x1a4713||0xcc;return function(_0x41c549){if(_0x41c549){return _0x4dce4f[_0x8941('0x1c')](_0x1a4713);}return _0x4dce4f[_0x8941('0x1d')](_0x1a4713)[_0x8941('0x1e')]();};}function respondWithResult(_0x1cd577,_0x56be3a){_0x56be3a=_0x56be3a||0xc8;return function(_0x47bdd6){if(_0x47bdd6){return _0x1cd577['status'](_0x56be3a)[_0x8941('0x1f')](_0x47bdd6);}};}function respondWithFilteredResult(_0x2ada4f,_0x248add){return function(_0x2c05a0){if(_0x2c05a0){var _0x24559a=typeof _0x248add[_0x8941('0x20')]===_0x8941('0x21')&&typeof _0x248add[_0x8941('0x22')]===_0x8941('0x21');var _0x387a7b=_0x2c05a0[_0x8941('0x23')];var _0x55cc1d=_0x24559a?0x0:_0x248add[_0x8941('0x20')];var _0x21a2c0=_0x24559a?_0x2c05a0['count']:_0x248add[_0x8941('0x20')]+_0x248add[_0x8941('0x22')];var _0x1c2f5d;if(_0x21a2c0>=_0x387a7b){_0x21a2c0=_0x387a7b;_0x1c2f5d=0xc8;}else{_0x1c2f5d=0xce;}_0x2ada4f[_0x8941('0x1d')](_0x1c2f5d);return _0x2ada4f[_0x8941('0x24')](_0x8941('0x25'),_0x55cc1d+'-'+_0x21a2c0+'/'+_0x387a7b)['json'](_0x2c05a0);}return null;};}function patchUpdates(_0x564986){return function(_0x1e3234){try{jsonpatch[_0x8941('0x26')](_0x1e3234,_0x564986,!![]);}catch(_0x350901){return BPromise[_0x8941('0x27')](_0x350901);}return _0x1e3234[_0x8941('0x28')]();};}function saveUpdates(_0x3a4e5f,_0x231cc6){return function(_0x1c6663){if(_0x1c6663){return _0x1c6663[_0x8941('0x29')](_0x3a4e5f)[_0x8941('0x2a')](function(_0x44956a){return _0x44956a;});}return null;};}function removeEntity(_0x56cb3e,_0x2587a6){return function(_0x1a990b){if(_0x1a990b){return _0x1a990b['destroy']()[_0x8941('0x2a')](function(){_0x56cb3e[_0x8941('0x1d')](0xcc)[_0x8941('0x1e')]();});}};}function handleEntityNotFound(_0x5ae77a,_0x345907){return function(_0x5382d4){if(!_0x5382d4){_0x5ae77a[_0x8941('0x1c')](0x194);}return _0x5382d4;};}function handleError(_0x3f34e7,_0x26010e){_0x26010e=_0x26010e||0x1f4;return function(_0x527688){logger[_0x8941('0x2b')](_0x527688[_0x8941('0x2c')]);if(_0x527688['name']){delete _0x527688[_0x8941('0x2d')];}_0x3f34e7[_0x8941('0x1d')](_0x26010e)[_0x8941('0x2e')](_0x527688);};}exports['index']=function(_0x70c702,_0xde54d5){var _0x572bd1={},_0x26e8b6={},_0x13f980={'count':0x0,'rows':[]};var _0x3177d3=_[_0x8941('0x2f')](db[_0x8941('0x30')]['rawAttributes'],function(_0x387b6f){return{'name':_0x387b6f[_0x8941('0x31')],'type':_0x387b6f[_0x8941('0x32')][_0x8941('0x33')]};});_0x26e8b6[_0x8941('0x34')]=_[_0x8941('0x2f')](_0x3177d3,_0x8941('0x2d'));_0x26e8b6['query']=_[_0x8941('0x35')](_0x70c702['query']);_0x26e8b6[_0x8941('0x36')]=_[_0x8941('0x37')](_0x26e8b6[_0x8941('0x34')],_0x26e8b6[_0x8941('0x38')]);_0x572bd1[_0x8941('0x39')]=_[_0x8941('0x37')](_0x26e8b6[_0x8941('0x34')],qs[_0x8941('0x3a')](_0x70c702[_0x8941('0x38')][_0x8941('0x3a')]));_0x572bd1[_0x8941('0x39')]=_0x572bd1[_0x8941('0x39')][_0x8941('0x3b')]?_0x572bd1[_0x8941('0x39')]:_0x26e8b6[_0x8941('0x34')];if(!_0x70c702[_0x8941('0x38')][_0x8941('0x3c')](_0x8941('0x3d'))){_0x572bd1[_0x8941('0x22')]=qs['limit'](_0x70c702['query'][_0x8941('0x22')]);_0x572bd1[_0x8941('0x20')]=qs[_0x8941('0x20')](_0x70c702[_0x8941('0x38')][_0x8941('0x20')]);}_0x572bd1['order']=qs[_0x8941('0x3e')](_0x70c702['query'][_0x8941('0x3e')]);_0x572bd1['where']=qs[_0x8941('0x36')](_[_0x8941('0x3f')](_0x70c702[_0x8941('0x38')],_0x26e8b6[_0x8941('0x36')]),_0x3177d3);if(_0x70c702['query']['filter']){_0x572bd1[_0x8941('0x40')]=_[_0x8941('0x41')](_0x572bd1['where'],{'$or':_[_0x8941('0x2f')](_0x3177d3,function(_0x416e17){if(_0x416e17[_0x8941('0x32')]!==_0x8941('0x42')){var _0x2a5693={};_0x2a5693[_0x416e17[_0x8941('0x2d')]]={'$like':'%'+_0x70c702[_0x8941('0x38')][_0x8941('0x43')]+'%'};return _0x2a5693;}})});}_0x572bd1=_[_0x8941('0x41')]({},_0x572bd1,_0x70c702['options']);var _0x5ee549={'where':_0x572bd1[_0x8941('0x40')]};return db[_0x8941('0x30')]['count'](_0x5ee549)['then'](function(_0x47b613){_0x13f980[_0x8941('0x23')]=_0x47b613;if(_0x70c702['query'][_0x8941('0x44')]){_0x572bd1['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x8941('0x45')](_0x572bd1);})[_0x8941('0x2a')](function(_0x59bc44){_0x13f980[_0x8941('0x46')]=_0x59bc44;return _0x13f980;})[_0x8941('0x2a')](respondWithFilteredResult(_0xde54d5,_0x572bd1))['catch'](handleError(_0xde54d5,null));};exports['show']=function(_0x35aff9,_0x155f18){var _0x40a660={'raw':![],'where':{'id':_0x35aff9[_0x8941('0x47')]['id']}},_0x5e3eb1={};_0x5e3eb1[_0x8941('0x34')]=_[_0x8941('0x35')](db['SalesforceAccount']['rawAttributes']);_0x5e3eb1[_0x8941('0x38')]=_['keys'](_0x35aff9['query']);_0x5e3eb1[_0x8941('0x36')]=_['intersection'](_0x5e3eb1[_0x8941('0x34')],_0x5e3eb1[_0x8941('0x38')]);_0x40a660[_0x8941('0x39')]=_[_0x8941('0x37')](_0x5e3eb1[_0x8941('0x34')],qs[_0x8941('0x3a')](_0x35aff9[_0x8941('0x38')]['fields']));_0x40a660[_0x8941('0x39')]=_0x40a660['attributes'][_0x8941('0x3b')]?_0x40a660[_0x8941('0x39')]:_0x5e3eb1[_0x8941('0x34')];if(_0x35aff9[_0x8941('0x38')][_0x8941('0x44')]){_0x40a660[_0x8941('0x48')]=[{'all':!![]}];}_0x40a660=_[_0x8941('0x41')]({},_0x40a660,_0x35aff9[_0x8941('0x49')]);return db['SalesforceAccount'][_0x8941('0x4a')](_0x40a660)[_0x8941('0x2a')](handleEntityNotFound(_0x155f18,null))[_0x8941('0x2a')](respondWithResult(_0x155f18,null))[_0x8941('0x4b')](handleError(_0x155f18,null));};exports[_0x8941('0x4c')]=function(_0x54cb91,_0x25a585){return db[_0x8941('0x30')][_0x8941('0x4c')](_0x54cb91[_0x8941('0x4d')],{})[_0x8941('0x2a')](respondWithResult(_0x25a585,0xc9))[_0x8941('0x4b')](handleError(_0x25a585,null));};exports[_0x8941('0x29')]=function(_0x4c2731,_0x3bfed1){if(_0x4c2731[_0x8941('0x4d')]['id']){delete _0x4c2731[_0x8941('0x4d')]['id'];}return db[_0x8941('0x30')][_0x8941('0x4a')]({'where':{'id':_0x4c2731[_0x8941('0x47')]['id']}})['then'](handleEntityNotFound(_0x3bfed1,null))[_0x8941('0x2a')](saveUpdates(_0x4c2731[_0x8941('0x4d')],null))[_0x8941('0x2a')](respondWithResult(_0x3bfed1,null))['catch'](handleError(_0x3bfed1,null));};exports[_0x8941('0x4e')]=function(_0xcfa9a7,_0x42c831){return db[_0x8941('0x30')][_0x8941('0x4a')]({'where':{'id':_0xcfa9a7[_0x8941('0x47')]['id']}})[_0x8941('0x2a')](handleEntityNotFound(_0x42c831,null))[_0x8941('0x2a')](removeEntity(_0x42c831,null))[_0x8941('0x4b')](handleError(_0x42c831,null));};exports['getConfigurations']=function(_0x563dab,_0x21462b,_0x4565ff){var _0x5cb5a9={};var _0x7b4e4b={};var _0x207ccc;var _0xd18881;return db[_0x8941('0x30')][_0x8941('0x4f')]({'where':{'id':_0x563dab[_0x8941('0x47')]['id']}})[_0x8941('0x2a')](handleEntityNotFound(_0x21462b,null))[_0x8941('0x2a')](function(_0x42398d){if(_0x42398d){_0x207ccc=_0x42398d;_0x7b4e4b[_0x8941('0x34')]=_[_0x8941('0x35')](db[_0x8941('0x50')]['rawAttributes']);_0x7b4e4b['query']=_['keys'](_0x563dab[_0x8941('0x38')]);_0x7b4e4b['filters']=_['intersection'](_0x7b4e4b['model'],_0x7b4e4b[_0x8941('0x38')]);_0x5cb5a9['attributes']=_[_0x8941('0x37')](_0x7b4e4b[_0x8941('0x34')],qs[_0x8941('0x3a')](_0x563dab[_0x8941('0x38')][_0x8941('0x3a')]));_0x5cb5a9[_0x8941('0x39')]=_0x5cb5a9[_0x8941('0x39')][_0x8941('0x3b')]?_0x5cb5a9[_0x8941('0x39')]:_0x7b4e4b['model'];_0x5cb5a9[_0x8941('0x51')]=qs['sort'](_0x563dab[_0x8941('0x38')][_0x8941('0x3e')]);_0x5cb5a9['where']=qs['filters'](_[_0x8941('0x3f')](_0x563dab['query'],_0x7b4e4b[_0x8941('0x36')]));if(_0x563dab[_0x8941('0x38')][_0x8941('0x43')]){_0x5cb5a9[_0x8941('0x40')]=_[_0x8941('0x41')](_0x5cb5a9[_0x8941('0x40')],{'$or':_[_0x8941('0x2f')](_0x5cb5a9['attributes'],function(_0x24fa4f){var _0xd881f8={};_0xd881f8[_0x24fa4f]={'$like':'%'+_0x563dab['query'][_0x8941('0x43')]+'%'};return _0xd881f8;})});}_0x5cb5a9=_[_0x8941('0x41')]({},_0x5cb5a9,_0x563dab[_0x8941('0x49')]);return _0x207ccc[_0x8941('0x52')](_0x5cb5a9);}})[_0x8941('0x2a')](function(_0x517e25){if(_0x517e25){_0xd18881=_0x517e25[_0x8941('0x3b')];if(!_0x563dab[_0x8941('0x38')][_0x8941('0x3c')]('nolimit')){_0x5cb5a9['limit']=qs[_0x8941('0x22')](_0x563dab[_0x8941('0x38')][_0x8941('0x22')]);_0x5cb5a9[_0x8941('0x20')]=qs[_0x8941('0x20')](_0x563dab['query'][_0x8941('0x20')]);}return _0x207ccc['getConfigurations'](_0x5cb5a9);}})[_0x8941('0x2a')](function(_0x58ab2e){if(_0x58ab2e){return _0x58ab2e?{'count':_0xd18881,'rows':_0x58ab2e}:null;}})['then'](respondWithResult(_0x21462b,null))[_0x8941('0x4b')](handleError(_0x21462b,null));};exports[_0x8941('0x53')]=function(_0x1e2ef7,_0x41a374,_0x4d798d){if(_0x1e2ef7[_0x8941('0x4d')]['id']){delete _0x1e2ef7['body']['id'];}return db[_0x8941('0x30')][_0x8941('0x4f')]({'where':{'id':_0x1e2ef7[_0x8941('0x47')]['id']}})[_0x8941('0x2a')](handleEntityNotFound(_0x41a374,null))[_0x8941('0x2a')](function(_0xa08d4d){if(_0xa08d4d){_0x1e2ef7['body'][_0x8941('0x54')]=_0xa08d4d['id'];_0x1e2ef7[_0x8941('0x4d')][_0x8941('0x55')]=integrations[_0x8941('0x56')](_0x1e2ef7[_0x8941('0x4d')]['channel'],_0x1e2ef7['body'][_0x8941('0x32')]);_0x1e2ef7[_0x8941('0x4d')][_0x8941('0x57')]=integrations[_0x8941('0x58')](_0x1e2ef7[_0x8941('0x4d')]['channel'],_0x1e2ef7[_0x8941('0x4d')][_0x8941('0x32')]);return db[_0x8941('0x50')][_0x8941('0x4c')](_0x1e2ef7[_0x8941('0x4d')],{'include':[{'model':db[_0x8941('0x59')],'as':_0x8941('0x55')},{'model':db[_0x8941('0x59')],'as':_0x8941('0x57')}]});}return null;})[_0x8941('0x2a')](respondWithResult(_0x41a374,null))[_0x8941('0x4b')](handleError(_0x41a374,null));};exports['getFields']=function(_0x3d8661,_0x493437,_0x4e2d72){var _0x421f92;var _0x224156='';var _0x41a879=_0x8941('0x5a');return db[_0x8941('0x30')][_0x8941('0x4f')]({'where':{'id':_0x3d8661[_0x8941('0x47')]['id']},'attributes':['id',_0x8941('0x5b'),_0x8941('0x5c'),_0x8941('0x5d'),_0x8941('0x5e'),_0x8941('0x5f'),_0x8941('0x60')]})[_0x8941('0x2a')](handleEntityNotFound(_0x493437,null))[_0x8941('0x2a')](function(_0x1cc773){if(_0x1cc773){_0x224156=_0x1cc773[_0x8941('0x5b')];var _0x465cef=_0x224156[_0x8941('0x61')](-0x1);if(_0x465cef==='/'){_0x224156=_0x224156[_0x8941('0x62')](0x0,_0x224156[_0x8941('0x63')](_0x465cef));}_0x421f92=new jsforce['Connection']({'oauth2':{'loginUrl':_0x224156,'clientId':_0x1cc773['clientId'],'clientSecret':_0x1cc773[_0x8941('0x5d')]}});return _0x421f92['login'](_0x1cc773[_0x8941('0x5e')],_0x1cc773[_0x8941('0x5f')][_0x8941('0x64')](_0x1cc773[_0x8941('0x60')]));}})['then'](function(_0x142968){if(_0x142968){if(!_[_0x8941('0x65')](_0x3d8661[_0x8941('0x38')]['ticketType'])){_0x41a879=_0x3d8661['query'][_0x8941('0x66')];}return _0x421f92[_0x8941('0x67')](_0x41a879)[_0x8941('0x68')]();}})['then'](function(_0x227990){var _0xe7b498=['OwnerId',_0x8941('0x69'),_0x8941('0x6a'),_0x8941('0x6b'),_0x8941('0x6c'),'Description'];var _0x248742=[_0x8941('0x6d'),_0x8941('0x6e'),_0x8941('0x6f'),_0x8941('0x70'),_0x8941('0x71'),_0x8941('0x72'),'phone'];if(_0x227990){_[_0x8941('0x73')](_0x227990[_0x8941('0x3a')],function(_0x2adac7){return _0xe7b498['includes'](_0x2adac7[_0x8941('0x2d')])||!_0x248742[_0x8941('0x74')](_0x2adac7[_0x8941('0x32')]);});return{'count':_0x227990[_0x8941('0x3a')][_0x8941('0x3b')],'rows':_[_0x8941('0x2f')](_0x227990[_0x8941('0x3a')],function(_0x416357){return{'id':_0x416357[_0x8941('0x2d')],'name':_0x416357[_0x8941('0x75')],'custom':_0x416357[_0x8941('0x76')],'options':_0x416357[_0x8941('0x77')][_0x8941('0x3b')]>0x0?_[_0x8941('0x2f')](_0x416357['picklistValues'],function(_0x4c9e38){return{'name':_0x4c9e38[_0x8941('0x75')],'value':_0x4c9e38[_0x8941('0x78')]};}):_0x416357[_0x8941('0x32')]==_0x8941('0x70')?[{'name':'True','value':_0x8941('0x79')},{'name':_0x8941('0x7a'),'value':_0x8941('0x7b')}]:[]};})};}})['then'](respondWithResult(_0x493437,null))[_0x8941('0x4b')](function(_0x431c0f){var _0x3b4fae=_0x3d8661[_0x8941('0x38')][_0x8941('0x7c')]?0x1f4:_0x431c0f['statusCode']||0x1f4;logger[_0x8941('0x2b')](_0x8941('0x7d'),'getFields',_0x3b4fae,JSON[_0x8941('0x7e')](_0x431c0f));delete _0x431c0f[_0x8941('0x2d')];if(_0x3b4fae===0x191){_0x3b4fae=0x190;}_0x493437[_0x8941('0x1d')](_0x3b4fae)[_0x8941('0x2e')](_0x3d8661[_0x8941('0x38')][_0x8941('0x7c')]?{'message':_0x8941('0x7f'),'statusCode':_0x431c0f['statusCode']}:_0x431c0f);});}; \ No newline at end of file +var _0x60e4=['IsReminderSet','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','label','custom','picklistValues','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','rimraf','request-promise','moment','bluebird','mustache','util','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','nolimit','addConfiguration','Subjects','Descriptions','getDescriptions','channel','SalesforceField','Task','clientSecret','username','password','remoteUri','slice','Connection','clientId','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate'];(function(_0x5567dd,_0x35d872){var _0x11f96c=function(_0x5ba6ed){while(--_0x5ba6ed){_0x5567dd['push'](_0x5567dd['shift']());}};_0x11f96c(++_0x35d872);}(_0x60e4,0x1f2));var _0x460e=function(_0x20b535,_0x1790d9){_0x20b535=_0x20b535-0x0;var _0x14daef=_0x60e4[_0x20b535];return _0x14daef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x460e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x460e('0x1'));var moment=require(_0x460e('0x2'));var BPromise=require(_0x460e('0x3'));var Mustache=require(_0x460e('0x4'));var util=require(_0x460e('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x460e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x460e('0x7'));var squel=require('squel');var crypto=require(_0x460e('0x8'));var jsforce=require(_0x460e('0x9'));var deskjs=require(_0x460e('0xa'));var toCsv=require(_0x460e('0xb'));var querystring=require('querystring');var Papa=require(_0x460e('0xc'));var Redis=require('ioredis');var authService=require(_0x460e('0xd'));var qs=require(_0x460e('0xe'));var as=require(_0x460e('0xf'));var hardwareService=require(_0x460e('0x10'));var logger=require(_0x460e('0x11'))(_0x460e('0x12'));var utils=require(_0x460e('0x13'));var config=require(_0x460e('0x14'));var licenseUtil=require(_0x460e('0x15'));var db=require(_0x460e('0x16'))['db'];var integrations=require(_0x460e('0x17'));function respondWithStatusCode(_0x522733,_0x1e788b){_0x1e788b=_0x1e788b||0xcc;return function(_0x1b24a6){if(_0x1b24a6){return _0x522733['sendStatus'](_0x1e788b);}return _0x522733[_0x460e('0x18')](_0x1e788b)['end']();};}function respondWithResult(_0x599e10,_0x39b4df){_0x39b4df=_0x39b4df||0xc8;return function(_0x2d6754){if(_0x2d6754){return _0x599e10[_0x460e('0x18')](_0x39b4df)['json'](_0x2d6754);}};}function respondWithFilteredResult(_0x3df007,_0x4bf6df){return function(_0x8f6720){if(_0x8f6720){var _0x9e7f39=typeof _0x4bf6df['offset']===_0x460e('0x19')&&typeof _0x4bf6df[_0x460e('0x1a')]===_0x460e('0x19');var _0x3cf060=_0x8f6720[_0x460e('0x1b')];var _0x113063=_0x9e7f39?0x0:_0x4bf6df[_0x460e('0x1c')];var _0x2cf52b=_0x9e7f39?_0x8f6720[_0x460e('0x1b')]:_0x4bf6df[_0x460e('0x1c')]+_0x4bf6df[_0x460e('0x1a')];var _0x2a2f42;if(_0x2cf52b>=_0x3cf060){_0x2cf52b=_0x3cf060;_0x2a2f42=0xc8;}else{_0x2a2f42=0xce;}_0x3df007['status'](_0x2a2f42);return _0x3df007[_0x460e('0x1d')](_0x460e('0x1e'),_0x113063+'-'+_0x2cf52b+'/'+_0x3cf060)['json'](_0x8f6720);}return null;};}function patchUpdates(_0x4aa50f){return function(_0x48e29b){try{jsonpatch[_0x460e('0x1f')](_0x48e29b,_0x4aa50f,!![]);}catch(_0x24df08){return BPromise[_0x460e('0x20')](_0x24df08);}return _0x48e29b['save']();};}function saveUpdates(_0x4a6f36,_0x32716b){return function(_0x5eaee1){if(_0x5eaee1){return _0x5eaee1['update'](_0x4a6f36)[_0x460e('0x21')](function(_0x34701d){return _0x34701d;});}return null;};}function removeEntity(_0x4327ff,_0x12cbc9){return function(_0x2b3f06){if(_0x2b3f06){return _0x2b3f06[_0x460e('0x22')]()[_0x460e('0x21')](function(){_0x4327ff[_0x460e('0x18')](0xcc)[_0x460e('0x23')]();});}};}function handleEntityNotFound(_0x466eb8,_0x42c4a2){return function(_0xa5c10e){if(!_0xa5c10e){_0x466eb8['sendStatus'](0x194);}return _0xa5c10e;};}function handleError(_0x301fd0,_0x42106d){_0x42106d=_0x42106d||0x1f4;return function(_0x5276c0){logger[_0x460e('0x24')](_0x5276c0[_0x460e('0x25')]);if(_0x5276c0[_0x460e('0x26')]){delete _0x5276c0[_0x460e('0x26')];}_0x301fd0[_0x460e('0x18')](_0x42106d)[_0x460e('0x27')](_0x5276c0);};}exports['index']=function(_0x4b1034,_0x57395a){var _0x447982={},_0x24413a={},_0x928499={'count':0x0,'rows':[]};var _0x563d15=_[_0x460e('0x28')](db[_0x460e('0x29')][_0x460e('0x2a')],function(_0xef0b35){return{'name':_0xef0b35[_0x460e('0x2b')],'type':_0xef0b35[_0x460e('0x2c')]['key']};});_0x24413a[_0x460e('0x2d')]=_['map'](_0x563d15,'name');_0x24413a[_0x460e('0x2e')]=_[_0x460e('0x2f')](_0x4b1034[_0x460e('0x2e')]);_0x24413a['filters']=_[_0x460e('0x30')](_0x24413a['model'],_0x24413a[_0x460e('0x2e')]);_0x447982[_0x460e('0x31')]=_[_0x460e('0x30')](_0x24413a[_0x460e('0x2d')],qs[_0x460e('0x32')](_0x4b1034['query'][_0x460e('0x32')]));_0x447982[_0x460e('0x31')]=_0x447982['attributes'][_0x460e('0x33')]?_0x447982['attributes']:_0x24413a[_0x460e('0x2d')];if(!_0x4b1034[_0x460e('0x2e')]['hasOwnProperty']('nolimit')){_0x447982['limit']=qs[_0x460e('0x1a')](_0x4b1034[_0x460e('0x2e')]['limit']);_0x447982[_0x460e('0x1c')]=qs[_0x460e('0x1c')](_0x4b1034['query'][_0x460e('0x1c')]);}_0x447982['order']=qs[_0x460e('0x34')](_0x4b1034[_0x460e('0x2e')][_0x460e('0x34')]);_0x447982['where']=qs['filters'](_[_0x460e('0x35')](_0x4b1034[_0x460e('0x2e')],_0x24413a[_0x460e('0x36')]),_0x563d15);if(_0x4b1034['query'][_0x460e('0x37')]){_0x447982[_0x460e('0x38')]=_[_0x460e('0x39')](_0x447982['where'],{'$or':_['map'](_0x563d15,function(_0x36c199){if(_0x36c199[_0x460e('0x2c')]!==_0x460e('0x3a')){var _0x4b1e63={};_0x4b1e63[_0x36c199[_0x460e('0x26')]]={'$like':'%'+_0x4b1034[_0x460e('0x2e')][_0x460e('0x37')]+'%'};return _0x4b1e63;}})});}_0x447982=_['merge']({},_0x447982,_0x4b1034[_0x460e('0x3b')]);var _0x7d233={'where':_0x447982['where']};return db[_0x460e('0x29')][_0x460e('0x1b')](_0x7d233)['then'](function(_0x11279d){_0x928499[_0x460e('0x1b')]=_0x11279d;if(_0x4b1034[_0x460e('0x2e')][_0x460e('0x3c')]){_0x447982['include']=[{'all':!![]}];}return db[_0x460e('0x29')][_0x460e('0x3d')](_0x447982);})[_0x460e('0x21')](function(_0x5796c3){_0x928499[_0x460e('0x3e')]=_0x5796c3;return _0x928499;})[_0x460e('0x21')](respondWithFilteredResult(_0x57395a,_0x447982))[_0x460e('0x3f')](handleError(_0x57395a,null));};exports[_0x460e('0x40')]=function(_0x1533ab,_0x115ad8){var _0x2e8ba3={'raw':![],'where':{'id':_0x1533ab[_0x460e('0x41')]['id']}},_0x116463={};_0x116463['model']=_[_0x460e('0x2f')](db[_0x460e('0x29')][_0x460e('0x2a')]);_0x116463[_0x460e('0x2e')]=_[_0x460e('0x2f')](_0x1533ab['query']);_0x116463['filters']=_[_0x460e('0x30')](_0x116463['model'],_0x116463[_0x460e('0x2e')]);_0x2e8ba3[_0x460e('0x31')]=_['intersection'](_0x116463['model'],qs[_0x460e('0x32')](_0x1533ab[_0x460e('0x2e')]['fields']));_0x2e8ba3[_0x460e('0x31')]=_0x2e8ba3[_0x460e('0x31')][_0x460e('0x33')]?_0x2e8ba3[_0x460e('0x31')]:_0x116463[_0x460e('0x2d')];if(_0x1533ab['query'][_0x460e('0x3c')]){_0x2e8ba3[_0x460e('0x42')]=[{'all':!![]}];}_0x2e8ba3=_[_0x460e('0x39')]({},_0x2e8ba3,_0x1533ab[_0x460e('0x3b')]);return db[_0x460e('0x29')][_0x460e('0x43')](_0x2e8ba3)[_0x460e('0x21')](handleEntityNotFound(_0x115ad8,null))['then'](respondWithResult(_0x115ad8,null))['catch'](handleError(_0x115ad8,null));};exports[_0x460e('0x44')]=function(_0x3d6f9f,_0x1ea90c){return db[_0x460e('0x29')][_0x460e('0x44')](_0x3d6f9f['body'],{})['then'](respondWithResult(_0x1ea90c,0xc9))['catch'](handleError(_0x1ea90c,null));};exports[_0x460e('0x45')]=function(_0x4cc493,_0x4fd699){if(_0x4cc493[_0x460e('0x46')]['id']){delete _0x4cc493[_0x460e('0x46')]['id'];}return db[_0x460e('0x29')]['find']({'where':{'id':_0x4cc493[_0x460e('0x41')]['id']}})[_0x460e('0x21')](handleEntityNotFound(_0x4fd699,null))[_0x460e('0x21')](saveUpdates(_0x4cc493[_0x460e('0x46')],null))[_0x460e('0x21')](respondWithResult(_0x4fd699,null))['catch'](handleError(_0x4fd699,null));};exports['destroy']=function(_0x368106,_0x3d1e2d){return db[_0x460e('0x29')]['find']({'where':{'id':_0x368106['params']['id']}})['then'](handleEntityNotFound(_0x3d1e2d,null))[_0x460e('0x21')](removeEntity(_0x3d1e2d,null))[_0x460e('0x3f')](handleError(_0x3d1e2d,null));};exports[_0x460e('0x47')]=function(_0x868bb2,_0x2b1add,_0x5631fe){var _0x18403c={};var _0x214879={};var _0x158d3d;var _0x426ec0;return db['SalesforceAccount'][_0x460e('0x48')]({'where':{'id':_0x868bb2[_0x460e('0x41')]['id']}})[_0x460e('0x21')](handleEntityNotFound(_0x2b1add,null))[_0x460e('0x21')](function(_0x36c9cf){if(_0x36c9cf){_0x158d3d=_0x36c9cf;_0x214879[_0x460e('0x2d')]=_[_0x460e('0x2f')](db[_0x460e('0x49')][_0x460e('0x2a')]);_0x214879[_0x460e('0x2e')]=_[_0x460e('0x2f')](_0x868bb2[_0x460e('0x2e')]);_0x214879['filters']=_[_0x460e('0x30')](_0x214879[_0x460e('0x2d')],_0x214879['query']);_0x18403c['attributes']=_['intersection'](_0x214879[_0x460e('0x2d')],qs[_0x460e('0x32')](_0x868bb2['query'][_0x460e('0x32')]));_0x18403c['attributes']=_0x18403c[_0x460e('0x31')][_0x460e('0x33')]?_0x18403c[_0x460e('0x31')]:_0x214879[_0x460e('0x2d')];_0x18403c['order']=qs[_0x460e('0x34')](_0x868bb2[_0x460e('0x2e')][_0x460e('0x34')]);_0x18403c[_0x460e('0x38')]=qs['filters'](_['pick'](_0x868bb2[_0x460e('0x2e')],_0x214879['filters']));if(_0x868bb2['query']['filter']){_0x18403c[_0x460e('0x38')]=_[_0x460e('0x39')](_0x18403c[_0x460e('0x38')],{'$or':_[_0x460e('0x28')](_0x18403c[_0x460e('0x31')],function(_0x256b10){var _0x50e01c={};_0x50e01c[_0x256b10]={'$like':'%'+_0x868bb2[_0x460e('0x2e')][_0x460e('0x37')]+'%'};return _0x50e01c;})});}_0x18403c=_[_0x460e('0x39')]({},_0x18403c,_0x868bb2[_0x460e('0x3b')]);return _0x158d3d[_0x460e('0x47')](_0x18403c);}})['then'](function(_0x329557){if(_0x329557){_0x426ec0=_0x329557[_0x460e('0x33')];if(!_0x868bb2[_0x460e('0x2e')][_0x460e('0x4a')](_0x460e('0x4b'))){_0x18403c['limit']=qs[_0x460e('0x1a')](_0x868bb2[_0x460e('0x2e')][_0x460e('0x1a')]);_0x18403c['offset']=qs[_0x460e('0x1c')](_0x868bb2[_0x460e('0x2e')][_0x460e('0x1c')]);}return _0x158d3d[_0x460e('0x47')](_0x18403c);}})[_0x460e('0x21')](function(_0x589ab4){if(_0x589ab4){return _0x589ab4?{'count':_0x426ec0,'rows':_0x589ab4}:null;}})[_0x460e('0x21')](respondWithResult(_0x2b1add,null))[_0x460e('0x3f')](handleError(_0x2b1add,null));};exports[_0x460e('0x4c')]=function(_0x3e00af,_0x24688e,_0x276066){if(_0x3e00af[_0x460e('0x46')]['id']){delete _0x3e00af[_0x460e('0x46')]['id'];}return db[_0x460e('0x29')][_0x460e('0x48')]({'where':{'id':_0x3e00af[_0x460e('0x41')]['id']}})[_0x460e('0x21')](handleEntityNotFound(_0x24688e,null))[_0x460e('0x21')](function(_0x1ee83b){if(_0x1ee83b){_0x3e00af[_0x460e('0x46')]['AccountId']=_0x1ee83b['id'];_0x3e00af['body'][_0x460e('0x4d')]=integrations['getSubjects'](_0x3e00af['body']['channel'],_0x3e00af['body'][_0x460e('0x2c')]);_0x3e00af[_0x460e('0x46')][_0x460e('0x4e')]=integrations[_0x460e('0x4f')](_0x3e00af[_0x460e('0x46')][_0x460e('0x50')],_0x3e00af[_0x460e('0x46')]['type']);return db[_0x460e('0x49')]['create'](_0x3e00af[_0x460e('0x46')],{'include':[{'model':db[_0x460e('0x51')],'as':'Subjects'},{'model':db[_0x460e('0x51')],'as':_0x460e('0x4e')}]});}return null;})[_0x460e('0x21')](respondWithResult(_0x24688e,null))[_0x460e('0x3f')](handleError(_0x24688e,null));};exports['getFields']=function(_0x4b0962,_0x296831,_0x294882){var _0x4e03f2;var _0x48c53f='';var _0xbdece6=_0x460e('0x52');return db[_0x460e('0x29')][_0x460e('0x48')]({'where':{'id':_0x4b0962[_0x460e('0x41')]['id']},'attributes':['id','remoteUri','clientId',_0x460e('0x53'),_0x460e('0x54'),_0x460e('0x55'),'securityToken']})[_0x460e('0x21')](handleEntityNotFound(_0x296831,null))[_0x460e('0x21')](function(_0x537e97){if(_0x537e97){_0x48c53f=_0x537e97[_0x460e('0x56')];var _0x5ca753=_0x48c53f[_0x460e('0x57')](-0x1);if(_0x5ca753==='/'){_0x48c53f=_0x48c53f['substring'](0x0,_0x48c53f['lastIndexOf'](_0x5ca753));}_0x4e03f2=new jsforce[(_0x460e('0x58'))]({'oauth2':{'loginUrl':_0x48c53f,'clientId':_0x537e97[_0x460e('0x59')],'clientSecret':_0x537e97['clientSecret']}});return _0x4e03f2[_0x460e('0x5a')](_0x537e97[_0x460e('0x54')],_0x537e97[_0x460e('0x55')][_0x460e('0x5b')](_0x537e97['securityToken']));}})[_0x460e('0x21')](function(_0x3186f7){if(_0x3186f7){if(!_[_0x460e('0x5c')](_0x4b0962['query'][_0x460e('0x5d')])){_0xbdece6=_0x4b0962[_0x460e('0x2e')][_0x460e('0x5d')];}return _0x4e03f2['sobject'](_0xbdece6)[_0x460e('0x5e')]();}})[_0x460e('0x21')](function(_0xb99c1b){var _0x27ccd0=[_0x460e('0x5f'),_0x460e('0x60'),_0x460e('0x61'),'IsRecurrence',_0x460e('0x62'),_0x460e('0x63')];var _0x59d8fe=['string',_0x460e('0x64'),_0x460e('0x65'),_0x460e('0x66'),_0x460e('0x67'),_0x460e('0x68'),_0x460e('0x69')];if(_0xb99c1b){_[_0x460e('0x6a')](_0xb99c1b[_0x460e('0x32')],function(_0x38a665){return _0x27ccd0[_0x460e('0x6b')](_0x38a665[_0x460e('0x26')])||!_0x59d8fe[_0x460e('0x6b')](_0x38a665[_0x460e('0x2c')]);});return{'count':_0xb99c1b[_0x460e('0x32')][_0x460e('0x33')],'rows':_[_0x460e('0x28')](_0xb99c1b[_0x460e('0x32')],function(_0x522434){return{'id':_0x522434[_0x460e('0x26')],'name':_0x522434[_0x460e('0x6c')],'custom':_0x522434[_0x460e('0x6d')],'options':_0x522434[_0x460e('0x6e')]['length']>0x0?_[_0x460e('0x28')](_0x522434[_0x460e('0x6e')],function(_0x3e0300){return{'name':_0x3e0300['label'],'value':_0x3e0300['value']};}):_0x522434[_0x460e('0x2c')]==_0x460e('0x66')?[{'name':_0x460e('0x6f'),'value':_0x460e('0x70')},{'name':_0x460e('0x71'),'value':_0x460e('0x72')}]:[]};})};}})[_0x460e('0x21')](respondWithResult(_0x296831,null))['catch'](function(_0x1efa8e){var _0x49c1fc=_0x4b0962['query'][_0x460e('0x73')]?0x1f4:_0x1efa8e[_0x460e('0x74')]||0x1f4;logger['error'](_0x460e('0x75'),_0x460e('0x76'),_0x49c1fc,JSON['stringify'](_0x1efa8e));delete _0x1efa8e['name'];if(_0x49c1fc===0x191){_0x49c1fc=0x190;}_0x296831[_0x460e('0x18')](_0x49c1fc)[_0x460e('0x27')](_0x4b0962['query'][_0x460e('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0x1efa8e[_0x460e('0x74')]}:_0x1efa8e);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5162c30..973ed3e 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 _0x735a=['path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util','../../config/logger','bluebird','request-promise'];(function(_0x1dc82c,_0x4f43eb){var _0x39b34a=function(_0x552615){while(--_0x552615){_0x1dc82c['push'](_0x1dc82c['shift']());}};_0x39b34a(++_0x4f43eb);}(_0x735a,0x1a9));var _0xa735=function(_0x4cf47c,_0x22c1b2){_0x4cf47c=_0x4cf47c-0x0;var _0x57a97a=_0x735a[_0x4cf47c];return _0x57a97a;};'use strict';var _=require('lodash');var util=require(_0xa735('0x0'));var logger=require(_0xa735('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa735('0x2'));var rp=require(_0xa735('0x3'));var fs=require('fs');var path=require(_0xa735('0x4'));var rimraf=require(_0xa735('0x5'));var config=require('../../config/environment');var attributes=require(_0xa735('0x6'));var integrations=require(_0xa735('0x7'));module[_0xa735('0x8')]=function(_0x2704b9,_0x45cc37){return _0x2704b9[_0xa735('0x9')](_0xa735('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbcb=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x2ace66,_0x562128){var _0x504be5=function(_0x15507f){while(--_0x15507f){_0x2ace66['push'](_0x2ace66['shift']());}};_0x504be5(++_0x562128);}(_0xbbcb,0x16e));var _0xbbbc=function(_0x3df37e,_0x335a82){_0x3df37e=_0x3df37e-0x0;var _0x15efe1=_0xbbcb[_0x3df37e];return _0x15efe1;};'use strict';var _=require(_0xbbbc('0x0'));var util=require(_0xbbbc('0x1'));var logger=require(_0xbbbc('0x2'))(_0xbbbc('0x3'));var moment=require(_0xbbbc('0x4'));var BPromise=require(_0xbbbc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbbc('0x6'));var rimraf=require(_0xbbbc('0x7'));var config=require(_0xbbbc('0x8'));var attributes=require(_0xbbbc('0x9'));var integrations=require(_0xbbbc('0xa'));module[_0xbbbc('0xb')]=function(_0x1bea66,_0x343542){return _0x1bea66[_0xbbbc('0xc')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','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 98459af..2e55122 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 _0x88ba=['GetSalesforceAccount','ShowSalesforceAccount','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SalesforceAccount','options','raw','where','attributes','limit','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88ba,0x66));var _0xa88b=function(_0x54f493,_0x385811){_0x54f493=_0x54f493-0x0;var _0x5f2b47=_0x88ba[_0x54f493];return _0x5f2b47;};'use strict';var _=require(_0xa88b('0x0'));var util=require('util');var moment=require(_0xa88b('0x1'));var BPromise=require(_0xa88b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa88b('0x3'));var db=require(_0xa88b('0x4'))['db'];var utils=require(_0xa88b('0x5'));var logger=require(_0xa88b('0x6'))('rpc');var config=require(_0xa88b('0x7'));var jayson=require(_0xa88b('0x8'));var client=jayson[_0xa88b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c5fa6,_0x377ad0,_0x31eccb){return new BPromise(function(_0x3683d7,_0xa70ec7){return client[_0xa88b('0xa')](_0x2c5fa6,_0x31eccb)['then'](function(_0x1e4c26){logger[_0xa88b('0xb')](_0xa88b('0xc'),_0x377ad0,'request\x20sent');logger[_0xa88b('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x377ad0,_0xa88b('0xe'),JSON[_0xa88b('0xf')](_0x1e4c26));if(_0x1e4c26[_0xa88b('0x10')]){if(_0x1e4c26['error'][_0xa88b('0x11')]===0x1f4){logger[_0xa88b('0x10')](_0xa88b('0xc'),_0x377ad0,_0x1e4c26['error'][_0xa88b('0x12')]);return _0xa70ec7(_0x1e4c26[_0xa88b('0x10')][_0xa88b('0x12')]);}logger[_0xa88b('0x10')](_0xa88b('0xc'),_0x377ad0,_0x1e4c26['error'][_0xa88b('0x12')]);return _0x3683d7(_0x1e4c26[_0xa88b('0x10')]['message']);}else{logger['info'](_0xa88b('0xc'),_0x377ad0,_0xa88b('0xe'));_0x3683d7(_0x1e4c26[_0xa88b('0x13')][_0xa88b('0x12')]);}})[_0xa88b('0x14')](function(_0x4a4689){logger[_0xa88b('0x10')](_0xa88b('0xc'),_0x377ad0,_0x4a4689);_0xa70ec7(_0x4a4689);});});}exports['GetSalesforceAccount']=function(_0x4c8037){var _0x2378dc=this;return new Promise(function(_0x2eef46,_0x540701){return db[_0xa88b('0x15')]['findAll']({'raw':_0x4c8037[_0xa88b('0x16')]?_0x4c8037[_0xa88b('0x16')][_0xa88b('0x17')]===undefined?!![]:![]:!![],'where':_0x4c8037[_0xa88b('0x16')]?_0x4c8037['options'][_0xa88b('0x18')]||null:null,'attributes':_0x4c8037['options']?_0x4c8037['options'][_0xa88b('0x19')]||null:null,'limit':_0x4c8037[_0xa88b('0x16')]?_0x4c8037['options'][_0xa88b('0x1a')]||null:null,'include':_0x4c8037[_0xa88b('0x16')]?_0x4c8037[_0xa88b('0x16')][_0xa88b('0x1b')]?_[_0xa88b('0x1c')](_0x4c8037[_0xa88b('0x16')][_0xa88b('0x1b')],function(_0x1f0b1d){return{'model':db[_0x1f0b1d['model']],'as':_0x1f0b1d['as'],'attributes':_0x1f0b1d['attributes'],'include':_0x1f0b1d[_0xa88b('0x1b')]?_[_0xa88b('0x1c')](_0x1f0b1d['include'],function(_0x5b92c2){return{'model':db[_0x5b92c2['model']],'as':_0x5b92c2['as'],'attributes':_0x5b92c2['attributes'],'include':_0x5b92c2[_0xa88b('0x1b')]?_['map'](_0x5b92c2[_0xa88b('0x1b')],function(_0x3733aa){return{'model':db[_0x3733aa[_0xa88b('0x1d')]],'as':_0x3733aa['as'],'attributes':_0x3733aa[_0xa88b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x106d79){logger[_0xa88b('0xb')](_0xa88b('0x1e'),_0x4c8037);logger[_0xa88b('0xd')](_0xa88b('0x1e'),_0x4c8037,JSON[_0xa88b('0xf')](_0x106d79));_0x2eef46(_0x106d79);})[_0xa88b('0x14')](function(_0x2b7f57){logger['error']('GetSalesforceAccount',_0x2b7f57[_0xa88b('0x12')],_0x4c8037);_0x540701(_0x2378dc[_0xa88b('0x10')](0x1f4,_0x2b7f57['message']));});});};exports[_0xa88b('0x1f')]=function(_0x32085d){var _0x5e2e10=this;return new Promise(function(_0x3bc173,_0x48c15c){return db[_0xa88b('0x15')]['find']({'raw':_0x32085d[_0xa88b('0x16')]?_0x32085d[_0xa88b('0x16')][_0xa88b('0x17')]===undefined?!![]:![]:!![],'where':_0x32085d[_0xa88b('0x16')]?_0x32085d[_0xa88b('0x16')]['where']||null:null,'attributes':_0x32085d[_0xa88b('0x16')]?_0x32085d[_0xa88b('0x16')]['attributes']||null:null,'include':_0x32085d[_0xa88b('0x16')]?_0x32085d[_0xa88b('0x16')][_0xa88b('0x1b')]?_[_0xa88b('0x1c')](_0x32085d[_0xa88b('0x16')][_0xa88b('0x1b')],function(_0x480e7c){return{'model':db[_0x480e7c['model']],'as':_0x480e7c['as'],'attributes':_0x480e7c[_0xa88b('0x19')],'include':_0x480e7c['include']?_[_0xa88b('0x1c')](_0x480e7c[_0xa88b('0x1b')],function(_0x3ef0cc){return{'model':db[_0x3ef0cc['model']],'as':_0x3ef0cc['as'],'attributes':_0x3ef0cc[_0xa88b('0x19')],'include':_0x3ef0cc[_0xa88b('0x1b')]?_[_0xa88b('0x1c')](_0x3ef0cc[_0xa88b('0x1b')],function(_0x28afe2){return{'model':db[_0x28afe2[_0xa88b('0x1d')]],'as':_0x28afe2['as'],'attributes':_0x28afe2['attributes']};}):[]};}):[]};}):[]:[]})[_0xa88b('0x20')](function(_0xacde58){logger[_0xa88b('0xb')](_0xa88b('0x1f'),_0x32085d);logger[_0xa88b('0xd')](_0xa88b('0x1f'),_0x32085d,JSON['stringify'](_0xacde58));_0x3bc173(_0xacde58);})[_0xa88b('0x14')](function(_0x542596){logger[_0xa88b('0x10')](_0xa88b('0x1f'),_0x542596[_0xa88b('0x12')],_0x32085d);_0x48c15c(_0x5e2e10['error'](0x1f4,_0x542596[_0xa88b('0x12')]));});});}; \ No newline at end of file +var _0x4e09=['where','limit','include','map','model','attributes','ShowSalesforceAccount','SalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetSalesforceAccount','findAll','options','raw'];(function(_0x478a86,_0x32c3a6){var _0x5441cf=function(_0x492488){while(--_0x492488){_0x478a86['push'](_0x478a86['shift']());}};_0x5441cf(++_0x32c3a6);}(_0x4e09,0x166));var _0x94e0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4e09[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x94e0('0x0'));var moment=require(_0x94e0('0x1'));var BPromise=require(_0x94e0('0x2'));var rs=require(_0x94e0('0x3'));var fs=require('fs');var Redis=require(_0x94e0('0x4'));var db=require(_0x94e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x94e0('0x6'))(_0x94e0('0x7'));var config=require(_0x94e0('0x8'));var jayson=require(_0x94e0('0x9'));var client=jayson[_0x94e0('0xa')][_0x94e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f2f5,_0x2ee1df,_0x2110f1){return new BPromise(function(_0x4e6402,_0x2870bf){return client['request'](_0x13f2f5,_0x2110f1)[_0x94e0('0xc')](function(_0x4decab){logger[_0x94e0('0xd')](_0x94e0('0xe'),_0x2ee1df,_0x94e0('0xf'));logger[_0x94e0('0x10')](_0x94e0('0x11'),_0x2ee1df,_0x94e0('0xf'),JSON[_0x94e0('0x12')](_0x4decab));if(_0x4decab[_0x94e0('0x13')]){if(_0x4decab[_0x94e0('0x13')]['code']===0x1f4){logger[_0x94e0('0x13')](_0x94e0('0xe'),_0x2ee1df,_0x4decab[_0x94e0('0x13')]['message']);return _0x2870bf(_0x4decab[_0x94e0('0x13')][_0x94e0('0x14')]);}logger[_0x94e0('0x13')](_0x94e0('0xe'),_0x2ee1df,_0x4decab[_0x94e0('0x13')][_0x94e0('0x14')]);return _0x4e6402(_0x4decab[_0x94e0('0x13')]['message']);}else{logger[_0x94e0('0xd')](_0x94e0('0xe'),_0x2ee1df,_0x94e0('0xf'));_0x4e6402(_0x4decab[_0x94e0('0x15')][_0x94e0('0x14')]);}})[_0x94e0('0x16')](function(_0x1b4a69){logger[_0x94e0('0x13')](_0x94e0('0xe'),_0x2ee1df,_0x1b4a69);_0x2870bf(_0x1b4a69);});});}exports[_0x94e0('0x17')]=function(_0x5479dd){var _0x5390a7=this;return new Promise(function(_0x39cec8,_0x5b80fb){return db['SalesforceAccount'][_0x94e0('0x18')]({'raw':_0x5479dd[_0x94e0('0x19')]?_0x5479dd[_0x94e0('0x19')][_0x94e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5479dd['options']?_0x5479dd['options'][_0x94e0('0x1b')]||null:null,'attributes':_0x5479dd[_0x94e0('0x19')]?_0x5479dd['options']['attributes']||null:null,'limit':_0x5479dd[_0x94e0('0x19')]?_0x5479dd[_0x94e0('0x19')][_0x94e0('0x1c')]||null:null,'include':_0x5479dd['options']?_0x5479dd[_0x94e0('0x19')][_0x94e0('0x1d')]?_[_0x94e0('0x1e')](_0x5479dd['options'][_0x94e0('0x1d')],function(_0x516855){return{'model':db[_0x516855[_0x94e0('0x1f')]],'as':_0x516855['as'],'attributes':_0x516855[_0x94e0('0x20')],'include':_0x516855[_0x94e0('0x1d')]?_[_0x94e0('0x1e')](_0x516855[_0x94e0('0x1d')],function(_0x4199f7){return{'model':db[_0x4199f7[_0x94e0('0x1f')]],'as':_0x4199f7['as'],'attributes':_0x4199f7[_0x94e0('0x20')],'include':_0x4199f7[_0x94e0('0x1d')]?_[_0x94e0('0x1e')](_0x4199f7[_0x94e0('0x1d')],function(_0x2e0761){return{'model':db[_0x2e0761[_0x94e0('0x1f')]],'as':_0x2e0761['as'],'attributes':_0x2e0761[_0x94e0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d9309){logger['info'](_0x94e0('0x17'),_0x5479dd);logger[_0x94e0('0x10')]('GetSalesforceAccount',_0x5479dd,JSON[_0x94e0('0x12')](_0x4d9309));_0x39cec8(_0x4d9309);})['catch'](function(_0x3f2700){logger[_0x94e0('0x13')](_0x94e0('0x17'),_0x3f2700[_0x94e0('0x14')],_0x5479dd);_0x5b80fb(_0x5390a7[_0x94e0('0x13')](0x1f4,_0x3f2700['message']));});});};exports[_0x94e0('0x21')]=function(_0x17e18f){var _0x9136=this;return new Promise(function(_0x5d901e,_0x5ba979){return db[_0x94e0('0x22')]['find']({'raw':_0x17e18f[_0x94e0('0x19')]?_0x17e18f[_0x94e0('0x19')][_0x94e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x17e18f[_0x94e0('0x19')]?_0x17e18f['options']['where']||null:null,'attributes':_0x17e18f[_0x94e0('0x19')]?_0x17e18f[_0x94e0('0x19')][_0x94e0('0x20')]||null:null,'include':_0x17e18f[_0x94e0('0x19')]?_0x17e18f[_0x94e0('0x19')]['include']?_[_0x94e0('0x1e')](_0x17e18f[_0x94e0('0x19')][_0x94e0('0x1d')],function(_0x25f741){return{'model':db[_0x25f741[_0x94e0('0x1f')]],'as':_0x25f741['as'],'attributes':_0x25f741[_0x94e0('0x20')],'include':_0x25f741[_0x94e0('0x1d')]?_['map'](_0x25f741[_0x94e0('0x1d')],function(_0x2e0bcd){return{'model':db[_0x2e0bcd[_0x94e0('0x1f')]],'as':_0x2e0bcd['as'],'attributes':_0x2e0bcd['attributes'],'include':_0x2e0bcd[_0x94e0('0x1d')]?_[_0x94e0('0x1e')](_0x2e0bcd[_0x94e0('0x1d')],function(_0x46caa8){return{'model':db[_0x46caa8[_0x94e0('0x1f')]],'as':_0x46caa8['as'],'attributes':_0x46caa8[_0x94e0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x94e0('0xc')](function(_0x3e836b){logger[_0x94e0('0xd')](_0x94e0('0x21'),_0x17e18f);logger[_0x94e0('0x10')](_0x94e0('0x21'),_0x17e18f,JSON['stringify'](_0x3e836b));_0x5d901e(_0x3e836b);})['catch'](function(_0x33689b){logger[_0x94e0('0x13')](_0x94e0('0x21'),_0x33689b[_0x94e0('0x14')],_0x17e18f);_0x5ba979(_0x9136['error'](0x1f4,_0x33689b['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index c913a38..d350cd7 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x881c1e,_0x4e722c){var _0x457556=function(_0x21b598){while(--_0x21b598){_0x881c1e['push'](_0x881c1e['shift']());}};_0x457556(++_0x4e722c);}(_0xadb5,0xad));var _0x5adb=function(_0x54a6e5,_0x4b5a9d){_0x54a6e5=_0x54a6e5-0x0;var _0x50fc7e=_0xadb5[_0x54a6e5];return _0x50fc7e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x3615ea,_0x5040dc){var _0x4c3c72=function(_0x3a1858){while(--_0x3a1858){_0x3615ea['push'](_0x3615ea['shift']());}};_0x4c3c72(++_0x5040dc);}(_0xadb5,0xad));var _0x5adb=function(_0x55b5fa,_0x378fd3){_0x55b5fa=_0x55b5fa-0x0;var _0x255801=_0xadb5[_0x55b5fa];return _0x255801;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index ee9f73b..5377b5e 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 _0x8a6e=['nothing','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account'];(function(_0x131f4d,_0x3f7198){var _0x7aada4=function(_0x2f2ee1){while(--_0x2f2ee1){_0x131f4d['push'](_0x131f4d['shift']());}};_0x7aada4(++_0x3f7198);}(_0x8a6e,0x18d));var _0xe8a6=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x8a6e[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0xe8a6('0x0'));module[_0xe8a6('0x1')]={'name':{'type':Sequelize[_0xe8a6('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xe8a6('0x3')](_0xe8a6('0x4'),_0xe8a6('0x5')),'defaultValue':_0xe8a6('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0xe8a6('0x6'),_0xe8a6('0x7'),_0xe8a6('0x8'),_0xe8a6('0x9'),_0xe8a6('0xa')),'defaultValue':_0xe8a6('0x6')},'moduleCreate':{'type':Sequelize[_0xe8a6('0x3')](_0xe8a6('0xb'),'contact','lead',_0xe8a6('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xe8a6('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xe8a6('0x2')]}}; \ No newline at end of file +var _0x265c=['lead','contact','account','sequelize','exports','STRING','ENUM','Task','Case','contact_lead'];(function(_0x329411,_0x3cad72){var _0x3ee254=function(_0x248882){while(--_0x248882){_0x329411['push'](_0x329411['shift']());}};_0x3ee254(++_0x3cad72);}(_0x265c,0x17f));var _0xc265=function(_0x399472,_0x5e6d6d){_0x399472=_0x399472-0x0;var _0x1ad9d1=_0x265c[_0x399472];return _0x1ad9d1;};'use strict';var Sequelize=require(_0xc265('0x0'));module[_0xc265('0x1')]={'name':{'type':Sequelize[_0xc265('0x2')]},'description':{'type':Sequelize[_0xc265('0x2')]},'ticketType':{'type':Sequelize[_0xc265('0x3')](_0xc265('0x4'),_0xc265('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xc265('0x3')](_0xc265('0x6'),'contact',_0xc265('0x7'),'account_contact_lead','account'),'defaultValue':_0xc265('0x6')},'moduleCreate':{'type':Sequelize[_0xc265('0x3')]('nothing',_0xc265('0x8'),'lead',_0xc265('0x9')),'defaultValue':_0xc265('0x7')},'leadId':{'type':Sequelize[_0xc265('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xc265('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xc265('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xc265('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 4461c66..bf3ec13 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 _0x53f9=['getFields','getSubjects','findOne','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','SalesforceField','order'];(function(_0x4f5a09,_0x5f0925){var _0x243da4=function(_0x129c11){while(--_0x129c11){_0x4f5a09['push'](_0x4f5a09['shift']());}};_0x243da4(++_0x5f0925);}(_0x53f9,0xf8));var _0x953f=function(_0x169a8a,_0x3526b1){_0x169a8a=_0x169a8a-0x0;var _0x2e8502=_0x53f9[_0x169a8a];return _0x2e8502;};'use strict';var emlformat=require(_0x953f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x953f('0x1'));var jsonpatch=require(_0x953f('0x2'));var rp=require(_0x953f('0x3'));var moment=require(_0x953f('0x4'));var BPromise=require(_0x953f('0x5'));var Mustache=require(_0x953f('0x6'));var util=require(_0x953f('0x7'));var path=require(_0x953f('0x8'));var sox=require(_0x953f('0x9'));var csv=require(_0x953f('0xa'));var ejs=require(_0x953f('0xb'));var fs=require('fs');var fs_extra=require(_0x953f('0xc'));var _=require(_0x953f('0xd'));var squel=require('squel');var crypto=require(_0x953f('0xe'));var jsforce=require(_0x953f('0xf'));var deskjs=require(_0x953f('0x10'));var toCsv=require(_0x953f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x953f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x953f('0x12'));var as=require(_0x953f('0x13'));var hardwareService=require(_0x953f('0x14'));var logger=require(_0x953f('0x15'))(_0x953f('0x16'));var utils=require(_0x953f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x953f('0x18'))['db'];function respondWithStatusCode(_0x2c9cc3,_0x58b9be){_0x58b9be=_0x58b9be||0xcc;return function(_0x51e460){if(_0x51e460){return _0x2c9cc3[_0x953f('0x19')](_0x58b9be);}return _0x2c9cc3[_0x953f('0x1a')](_0x58b9be)['end']();};}function respondWithResult(_0x3821c7,_0x2d24f1){_0x2d24f1=_0x2d24f1||0xc8;return function(_0x3a8f05){if(_0x3a8f05){return _0x3821c7['status'](_0x2d24f1)[_0x953f('0x1b')](_0x3a8f05);}};}function respondWithFilteredResult(_0x2ecf18,_0x2b07c5){return function(_0xc8ddc1){if(_0xc8ddc1){var _0x5b1397=typeof _0x2b07c5['offset']===_0x953f('0x1c')&&typeof _0x2b07c5['limit']==='undefined';var _0x3454f2=_0xc8ddc1[_0x953f('0x1d')];var _0x2f552b=_0x5b1397?0x0:_0x2b07c5[_0x953f('0x1e')];var _0x25fc71=_0x5b1397?_0xc8ddc1[_0x953f('0x1d')]:_0x2b07c5[_0x953f('0x1e')]+_0x2b07c5[_0x953f('0x1f')];var _0x104dfa;if(_0x25fc71>=_0x3454f2){_0x25fc71=_0x3454f2;_0x104dfa=0xc8;}else{_0x104dfa=0xce;}_0x2ecf18[_0x953f('0x1a')](_0x104dfa);return _0x2ecf18[_0x953f('0x20')](_0x953f('0x21'),_0x2f552b+'-'+_0x25fc71+'/'+_0x3454f2)[_0x953f('0x1b')](_0xc8ddc1);}return null;};}function patchUpdates(_0x1d268c){return function(_0x4c2622){try{jsonpatch['apply'](_0x4c2622,_0x1d268c,!![]);}catch(_0x10ec35){return BPromise[_0x953f('0x22')](_0x10ec35);}return _0x4c2622[_0x953f('0x23')]();};}function saveUpdates(_0x131577,_0x3cd81a){return function(_0x5e6611){if(_0x5e6611){return _0x5e6611[_0x953f('0x24')](_0x131577)[_0x953f('0x25')](function(_0x1836fd){return _0x1836fd;});}return null;};}function removeEntity(_0x530dfc,_0x267b28){return function(_0xdfab1b){if(_0xdfab1b){return _0xdfab1b[_0x953f('0x26')]()[_0x953f('0x25')](function(){_0x530dfc['status'](0xcc)[_0x953f('0x27')]();});}};}function handleEntityNotFound(_0x1df37e,_0x4342a9){return function(_0x541c9f){if(!_0x541c9f){_0x1df37e['sendStatus'](0x194);}return _0x541c9f;};}function handleError(_0x1e58f1,_0x247123){_0x247123=_0x247123||0x1f4;return function(_0x1b6fa9){logger['error'](_0x1b6fa9[_0x953f('0x28')]);if(_0x1b6fa9['name']){delete _0x1b6fa9[_0x953f('0x29')];}_0x1e58f1['status'](_0x247123)[_0x953f('0x2a')](_0x1b6fa9);};}exports[_0x953f('0x2b')]=function(_0x1ea62e,_0x5c1580){var _0x968418={},_0x43a65d={},_0x2b2d0c={'count':0x0,'rows':[]};var _0x4c621f=_[_0x953f('0x2c')](db[_0x953f('0x2d')][_0x953f('0x2e')],function(_0xefe943){return{'name':_0xefe943['fieldName'],'type':_0xefe943[_0x953f('0x2f')]['key']};});_0x43a65d[_0x953f('0x30')]=_[_0x953f('0x2c')](_0x4c621f,_0x953f('0x29'));_0x43a65d[_0x953f('0x31')]=_[_0x953f('0x32')](_0x1ea62e[_0x953f('0x31')]);_0x43a65d[_0x953f('0x33')]=_[_0x953f('0x34')](_0x43a65d[_0x953f('0x30')],_0x43a65d['query']);_0x968418[_0x953f('0x35')]=_['intersection'](_0x43a65d[_0x953f('0x30')],qs[_0x953f('0x36')](_0x1ea62e[_0x953f('0x31')][_0x953f('0x36')]));_0x968418[_0x953f('0x35')]=_0x968418[_0x953f('0x35')]['length']?_0x968418[_0x953f('0x35')]:_0x43a65d[_0x953f('0x30')];if(!_0x1ea62e[_0x953f('0x31')]['hasOwnProperty'](_0x953f('0x37'))){_0x968418[_0x953f('0x1f')]=qs[_0x953f('0x1f')](_0x1ea62e[_0x953f('0x31')][_0x953f('0x1f')]);_0x968418[_0x953f('0x1e')]=qs[_0x953f('0x1e')](_0x1ea62e['query'][_0x953f('0x1e')]);}_0x968418['order']=qs['sort'](_0x1ea62e['query'][_0x953f('0x38')]);_0x968418[_0x953f('0x39')]=qs[_0x953f('0x33')](_[_0x953f('0x3a')](_0x1ea62e[_0x953f('0x31')],_0x43a65d[_0x953f('0x33')]),_0x4c621f);if(_0x1ea62e[_0x953f('0x31')][_0x953f('0x3b')]){_0x968418[_0x953f('0x39')]=_[_0x953f('0x3c')](_0x968418[_0x953f('0x39')],{'$or':_[_0x953f('0x2c')](_0x4c621f,function(_0x5c8afe){if(_0x5c8afe[_0x953f('0x2f')]!==_0x953f('0x3d')){var _0xef4c1d={};_0xef4c1d[_0x5c8afe['name']]={'$like':'%'+_0x1ea62e[_0x953f('0x31')]['filter']+'%'};return _0xef4c1d;}})});}_0x968418=_[_0x953f('0x3c')]({},_0x968418,_0x1ea62e[_0x953f('0x3e')]);var _0x54686e={'where':_0x968418[_0x953f('0x39')]};return db[_0x953f('0x2d')][_0x953f('0x1d')](_0x54686e)[_0x953f('0x25')](function(_0x447874){_0x2b2d0c[_0x953f('0x1d')]=_0x447874;if(_0x1ea62e[_0x953f('0x31')][_0x953f('0x3f')]){_0x968418['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x953f('0x40')](_0x968418);})[_0x953f('0x25')](function(_0x9fcaab){_0x2b2d0c[_0x953f('0x41')]=_0x9fcaab;return _0x2b2d0c;})[_0x953f('0x25')](respondWithFilteredResult(_0x5c1580,_0x968418))[_0x953f('0x42')](handleError(_0x5c1580,null));};exports[_0x953f('0x43')]=function(_0x145fbf,_0x3f5ac5){var _0x2cc794={'raw':![],'where':{'id':_0x145fbf[_0x953f('0x44')]['id']}},_0x573ca9={};_0x573ca9[_0x953f('0x30')]=_[_0x953f('0x32')](db[_0x953f('0x2d')][_0x953f('0x2e')]);_0x573ca9['query']=_[_0x953f('0x32')](_0x145fbf[_0x953f('0x31')]);_0x573ca9[_0x953f('0x33')]=_[_0x953f('0x34')](_0x573ca9[_0x953f('0x30')],_0x573ca9[_0x953f('0x31')]);_0x2cc794['attributes']=_[_0x953f('0x34')](_0x573ca9[_0x953f('0x30')],qs[_0x953f('0x36')](_0x145fbf[_0x953f('0x31')][_0x953f('0x36')]));_0x2cc794[_0x953f('0x35')]=_0x2cc794[_0x953f('0x35')][_0x953f('0x45')]?_0x2cc794['attributes']:_0x573ca9[_0x953f('0x30')];if(_0x145fbf[_0x953f('0x31')][_0x953f('0x3f')]){_0x2cc794[_0x953f('0x46')]=[{'all':!![]}];}_0x2cc794=_[_0x953f('0x3c')]({},_0x2cc794,_0x145fbf[_0x953f('0x3e')]);return db['SalesforceConfiguration'][_0x953f('0x47')](_0x2cc794)['then'](handleEntityNotFound(_0x3f5ac5,null))['then'](respondWithResult(_0x3f5ac5,null))[_0x953f('0x42')](handleError(_0x3f5ac5,null));};exports[_0x953f('0x48')]=function(_0x94f32b,_0x4fd276){return db['SalesforceConfiguration'][_0x953f('0x48')](_0x94f32b[_0x953f('0x49')],{})[_0x953f('0x25')](respondWithResult(_0x4fd276,0xc9))[_0x953f('0x42')](handleError(_0x4fd276,null));};exports['update']=function(_0x50907e,_0x3612ec){if(_0x50907e['body']['id']){delete _0x50907e[_0x953f('0x49')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x50907e[_0x953f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3612ec,null))[_0x953f('0x25')](saveUpdates(_0x50907e['body'],null))[_0x953f('0x25')](respondWithResult(_0x3612ec,null))[_0x953f('0x42')](handleError(_0x3612ec,null));};exports['destroy']=function(_0x23a7a5,_0x16623e){return db[_0x953f('0x2d')][_0x953f('0x47')]({'where':{'id':_0x23a7a5[_0x953f('0x44')]['id']}})[_0x953f('0x25')](handleEntityNotFound(_0x16623e,null))['then'](removeEntity(_0x16623e,null))[_0x953f('0x42')](handleError(_0x16623e,null));};exports['getFields']=function(_0x20f549,_0x592c04,_0x28061b){var _0x646703={};var _0x75b1fc={};var _0xc3c04a;var _0x2dabe8;return db[_0x953f('0x2d')]['findOne']({'where':{'id':_0x20f549['params']['id']}})['then'](handleEntityNotFound(_0x592c04,null))[_0x953f('0x25')](function(_0x4b4184){if(_0x4b4184){_0xc3c04a=_0x4b4184;_0x75b1fc[_0x953f('0x30')]=_[_0x953f('0x32')](db[_0x953f('0x4a')][_0x953f('0x2e')]);_0x75b1fc[_0x953f('0x31')]=_[_0x953f('0x32')](_0x20f549[_0x953f('0x31')]);_0x75b1fc[_0x953f('0x33')]=_['intersection'](_0x75b1fc[_0x953f('0x30')],_0x75b1fc['query']);_0x646703[_0x953f('0x35')]=_[_0x953f('0x34')](_0x75b1fc[_0x953f('0x30')],qs['fields'](_0x20f549['query'][_0x953f('0x36')]));_0x646703[_0x953f('0x35')]=_0x646703[_0x953f('0x35')][_0x953f('0x45')]?_0x646703[_0x953f('0x35')]:_0x75b1fc[_0x953f('0x30')];_0x646703[_0x953f('0x4b')]=qs[_0x953f('0x38')](_0x20f549[_0x953f('0x31')][_0x953f('0x38')]);_0x646703[_0x953f('0x39')]=qs['filters'](_['pick'](_0x20f549['query'],_0x75b1fc['filters']));if(_0x20f549[_0x953f('0x31')][_0x953f('0x3b')]){_0x646703[_0x953f('0x39')]=_[_0x953f('0x3c')](_0x646703['where'],{'$or':_['map'](_0x646703[_0x953f('0x35')],function(_0x294864){var _0xe868db={};_0xe868db[_0x294864]={'$like':'%'+_0x20f549['query'][_0x953f('0x3b')]+'%'};return _0xe868db;})});}_0x646703=_[_0x953f('0x3c')]({},_0x646703,_0x20f549[_0x953f('0x3e')]);return _0xc3c04a[_0x953f('0x4c')](_0x646703);}})[_0x953f('0x25')](function(_0x3dce02){if(_0x3dce02){_0x2dabe8=_0x3dce02['length'];if(!_0x20f549[_0x953f('0x31')]['hasOwnProperty']('nolimit')){_0x646703[_0x953f('0x1f')]=qs[_0x953f('0x1f')](_0x20f549[_0x953f('0x31')]['limit']);_0x646703[_0x953f('0x1e')]=qs[_0x953f('0x1e')](_0x20f549[_0x953f('0x31')][_0x953f('0x1e')]);}return _0xc3c04a[_0x953f('0x4c')](_0x646703);}})[_0x953f('0x25')](function(_0x36a067){if(_0x36a067){return _0x36a067?{'count':_0x2dabe8,'rows':_0x36a067}:null;}})['then'](respondWithResult(_0x592c04,null))['catch'](handleError(_0x592c04,null));};exports[_0x953f('0x4d')]=function(_0x27cd43,_0x3395cc,_0x327408){var _0x57c852={};var _0x258578={};var _0x62f437;var _0x35f45e;return db[_0x953f('0x2d')][_0x953f('0x4e')]({'where':{'id':_0x27cd43[_0x953f('0x44')]['id']}})[_0x953f('0x25')](handleEntityNotFound(_0x3395cc,null))[_0x953f('0x25')](function(_0x98494c){if(_0x98494c){_0x62f437=_0x98494c;_0x258578[_0x953f('0x30')]=_['keys'](db[_0x953f('0x4a')]['rawAttributes']);_0x258578[_0x953f('0x31')]=_[_0x953f('0x32')](_0x27cd43[_0x953f('0x31')]);_0x258578[_0x953f('0x33')]=_[_0x953f('0x34')](_0x258578[_0x953f('0x30')],_0x258578[_0x953f('0x31')]);_0x57c852[_0x953f('0x35')]=_[_0x953f('0x34')](_0x258578['model'],qs[_0x953f('0x36')](_0x27cd43[_0x953f('0x31')]['fields']));_0x57c852['attributes']=_0x57c852['attributes'][_0x953f('0x45')]?_0x57c852[_0x953f('0x35')]:_0x258578[_0x953f('0x30')];_0x57c852[_0x953f('0x4b')]=qs['sort'](_0x27cd43[_0x953f('0x31')][_0x953f('0x38')]);_0x57c852[_0x953f('0x39')]=qs['filters'](_[_0x953f('0x3a')](_0x27cd43['query'],_0x258578[_0x953f('0x33')]));if(_0x27cd43[_0x953f('0x31')]['filter']){_0x57c852[_0x953f('0x39')]=_[_0x953f('0x3c')](_0x57c852['where'],{'$or':_[_0x953f('0x2c')](_0x57c852[_0x953f('0x35')],function(_0x3d0231){var _0x5c3177={};_0x5c3177[_0x3d0231]={'$like':'%'+_0x27cd43[_0x953f('0x31')][_0x953f('0x3b')]+'%'};return _0x5c3177;})});}_0x57c852=_[_0x953f('0x3c')]({},_0x57c852,_0x27cd43[_0x953f('0x3e')]);return _0x62f437[_0x953f('0x4d')](_0x57c852);}})[_0x953f('0x25')](function(_0x50d728){if(_0x50d728){_0x35f45e=_0x50d728[_0x953f('0x45')];if(!_0x27cd43[_0x953f('0x31')][_0x953f('0x4f')](_0x953f('0x37'))){_0x57c852['limit']=qs['limit'](_0x27cd43[_0x953f('0x31')][_0x953f('0x1f')]);_0x57c852[_0x953f('0x1e')]=qs[_0x953f('0x1e')](_0x27cd43['query'][_0x953f('0x1e')]);}return _0x62f437['getSubjects'](_0x57c852);}})[_0x953f('0x25')](function(_0x154faa){if(_0x154faa){return _0x154faa?{'count':_0x35f45e,'rows':_0x154faa}:null;}})[_0x953f('0x25')](respondWithResult(_0x3395cc,null))['catch'](handleError(_0x3395cc,null));};exports[_0x953f('0x50')]=function(_0x3be3b8,_0x1b0b1f,_0xfbb415){var _0x38ce2d={};var _0x3855d5={};var _0x12faad;var _0x589a40;return db[_0x953f('0x2d')]['findOne']({'where':{'id':_0x3be3b8[_0x953f('0x44')]['id']}})[_0x953f('0x25')](handleEntityNotFound(_0x1b0b1f,null))[_0x953f('0x25')](function(_0x230788){if(_0x230788){_0x12faad=_0x230788;_0x3855d5[_0x953f('0x30')]=_[_0x953f('0x32')](db['SalesforceField'][_0x953f('0x2e')]);_0x3855d5[_0x953f('0x31')]=_[_0x953f('0x32')](_0x3be3b8['query']);_0x3855d5[_0x953f('0x33')]=_['intersection'](_0x3855d5['model'],_0x3855d5[_0x953f('0x31')]);_0x38ce2d[_0x953f('0x35')]=_['intersection'](_0x3855d5[_0x953f('0x30')],qs['fields'](_0x3be3b8[_0x953f('0x31')][_0x953f('0x36')]));_0x38ce2d[_0x953f('0x35')]=_0x38ce2d[_0x953f('0x35')][_0x953f('0x45')]?_0x38ce2d['attributes']:_0x3855d5['model'];_0x38ce2d[_0x953f('0x4b')]=qs[_0x953f('0x38')](_0x3be3b8[_0x953f('0x31')][_0x953f('0x38')]);_0x38ce2d[_0x953f('0x39')]=qs[_0x953f('0x33')](_[_0x953f('0x3a')](_0x3be3b8[_0x953f('0x31')],_0x3855d5['filters']));if(_0x3be3b8[_0x953f('0x31')][_0x953f('0x3b')]){_0x38ce2d['where']=_[_0x953f('0x3c')](_0x38ce2d['where'],{'$or':_[_0x953f('0x2c')](_0x38ce2d[_0x953f('0x35')],function(_0x53eecb){var _0x2695f0={};_0x2695f0[_0x53eecb]={'$like':'%'+_0x3be3b8['query'][_0x953f('0x3b')]+'%'};return _0x2695f0;})});}_0x38ce2d=_[_0x953f('0x3c')]({},_0x38ce2d,_0x3be3b8['options']);return _0x12faad[_0x953f('0x50')](_0x38ce2d);}})[_0x953f('0x25')](function(_0x1f0895){if(_0x1f0895){_0x589a40=_0x1f0895['length'];if(!_0x3be3b8[_0x953f('0x31')]['hasOwnProperty'](_0x953f('0x37'))){_0x38ce2d[_0x953f('0x1f')]=qs[_0x953f('0x1f')](_0x3be3b8['query'][_0x953f('0x1f')]);_0x38ce2d[_0x953f('0x1e')]=qs['offset'](_0x3be3b8[_0x953f('0x31')][_0x953f('0x1e')]);}return _0x12faad['getDescriptions'](_0x38ce2d);}})[_0x953f('0x25')](function(_0x26b491){if(_0x26b491){return _0x26b491?{'count':_0x589a40,'rows':_0x26b491}:null;}})[_0x953f('0x25')](respondWithResult(_0x1b0b1f,null))[_0x953f('0x42')](handleError(_0x1b0b1f,null));}; \ No newline at end of file +var _0x212b=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','getFields','findOne','SalesforceField','getSubjects','pick','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','destroy','error','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x1d7487,_0x21b7a9){var _0x26668e=function(_0x3b6f45){while(--_0x3b6f45){_0x1d7487['push'](_0x1d7487['shift']());}};_0x26668e(++_0x21b7a9);}(_0x212b,0x148));var _0xb212=function(_0xae28bd,_0x4b76da){_0xae28bd=_0xae28bd-0x0;var _0x169a01=_0x212b[_0xae28bd];return _0x169a01;};'use strict';var emlformat=require(_0xb212('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb212('0x1'));var jsonpatch=require(_0xb212('0x2'));var rp=require(_0xb212('0x3'));var moment=require(_0xb212('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb212('0x5'));var util=require(_0xb212('0x6'));var path=require(_0xb212('0x7'));var sox=require('sox');var csv=require(_0xb212('0x8'));var ejs=require(_0xb212('0x9'));var fs=require('fs');var fs_extra=require(_0xb212('0xa'));var _=require('lodash');var squel=require(_0xb212('0xb'));var crypto=require(_0xb212('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb212('0xd'));var toCsv=require(_0xb212('0x8'));var querystring=require(_0xb212('0xe'));var Papa=require('papaparse');var Redis=require(_0xb212('0xf'));var authService=require(_0xb212('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb212('0x11'))('api');var utils=require(_0xb212('0x12'));var config=require(_0xb212('0x13'));var licenseUtil=require(_0xb212('0x14'));var db=require(_0xb212('0x15'))['db'];function respondWithStatusCode(_0x41eba8,_0x1dd322){_0x1dd322=_0x1dd322||0xcc;return function(_0x11ea42){if(_0x11ea42){return _0x41eba8[_0xb212('0x16')](_0x1dd322);}return _0x41eba8[_0xb212('0x17')](_0x1dd322)[_0xb212('0x18')]();};}function respondWithResult(_0x2b64a7,_0x2f12bf){_0x2f12bf=_0x2f12bf||0xc8;return function(_0x5118f5){if(_0x5118f5){return _0x2b64a7['status'](_0x2f12bf)['json'](_0x5118f5);}};}function respondWithFilteredResult(_0x4baa5b,_0x105d4c){return function(_0x11dcab){if(_0x11dcab){var _0x1b2f6d=typeof _0x105d4c['offset']===_0xb212('0x19')&&typeof _0x105d4c[_0xb212('0x1a')]===_0xb212('0x19');var _0xaffb30=_0x11dcab[_0xb212('0x1b')];var _0x267c58=_0x1b2f6d?0x0:_0x105d4c[_0xb212('0x1c')];var _0xe6b2f8=_0x1b2f6d?_0x11dcab[_0xb212('0x1b')]:_0x105d4c[_0xb212('0x1c')]+_0x105d4c[_0xb212('0x1a')];var _0x30f248;if(_0xe6b2f8>=_0xaffb30){_0xe6b2f8=_0xaffb30;_0x30f248=0xc8;}else{_0x30f248=0xce;}_0x4baa5b[_0xb212('0x17')](_0x30f248);return _0x4baa5b['set']('Content-Range',_0x267c58+'-'+_0xe6b2f8+'/'+_0xaffb30)[_0xb212('0x1d')](_0x11dcab);}return null;};}function patchUpdates(_0x409e51){return function(_0x228a57){try{jsonpatch[_0xb212('0x1e')](_0x228a57,_0x409e51,!![]);}catch(_0x1a374d){return BPromise[_0xb212('0x1f')](_0x1a374d);}return _0x228a57[_0xb212('0x20')]();};}function saveUpdates(_0x19fc16,_0x3b9361){return function(_0x30aaba){if(_0x30aaba){return _0x30aaba[_0xb212('0x21')](_0x19fc16)[_0xb212('0x22')](function(_0x114d8f){return _0x114d8f;});}return null;};}function removeEntity(_0x491c3b,_0x5e0c12){return function(_0x25d40e){if(_0x25d40e){return _0x25d40e[_0xb212('0x23')]()[_0xb212('0x22')](function(){_0x491c3b[_0xb212('0x17')](0xcc)[_0xb212('0x18')]();});}};}function handleEntityNotFound(_0x2b9046,_0x2aafe4){return function(_0x4ca0a2){if(!_0x4ca0a2){_0x2b9046[_0xb212('0x16')](0x194);}return _0x4ca0a2;};}function handleError(_0x48d420,_0xd1180f){_0xd1180f=_0xd1180f||0x1f4;return function(_0x32849a){logger[_0xb212('0x24')](_0x32849a['stack']);if(_0x32849a[_0xb212('0x25')]){delete _0x32849a[_0xb212('0x25')];}_0x48d420[_0xb212('0x17')](_0xd1180f)['send'](_0x32849a);};}exports[_0xb212('0x26')]=function(_0x277812,_0x882231){var _0xdf3d5d={},_0xd069d9={},_0x3cd772={'count':0x0,'rows':[]};var _0x429f03=_[_0xb212('0x27')](db[_0xb212('0x28')][_0xb212('0x29')],function(_0x36746b){return{'name':_0x36746b[_0xb212('0x2a')],'type':_0x36746b[_0xb212('0x2b')][_0xb212('0x2c')]};});_0xd069d9[_0xb212('0x2d')]=_['map'](_0x429f03,'name');_0xd069d9[_0xb212('0x2e')]=_[_0xb212('0x2f')](_0x277812['query']);_0xd069d9[_0xb212('0x30')]=_[_0xb212('0x31')](_0xd069d9[_0xb212('0x2d')],_0xd069d9[_0xb212('0x2e')]);_0xdf3d5d[_0xb212('0x32')]=_[_0xb212('0x31')](_0xd069d9[_0xb212('0x2d')],qs[_0xb212('0x33')](_0x277812['query']['fields']));_0xdf3d5d[_0xb212('0x32')]=_0xdf3d5d[_0xb212('0x32')][_0xb212('0x34')]?_0xdf3d5d[_0xb212('0x32')]:_0xd069d9[_0xb212('0x2d')];if(!_0x277812[_0xb212('0x2e')][_0xb212('0x35')](_0xb212('0x36'))){_0xdf3d5d[_0xb212('0x1a')]=qs[_0xb212('0x1a')](_0x277812[_0xb212('0x2e')][_0xb212('0x1a')]);_0xdf3d5d[_0xb212('0x1c')]=qs['offset'](_0x277812[_0xb212('0x2e')][_0xb212('0x1c')]);}_0xdf3d5d[_0xb212('0x37')]=qs[_0xb212('0x38')](_0x277812[_0xb212('0x2e')]['sort']);_0xdf3d5d[_0xb212('0x39')]=qs[_0xb212('0x30')](_['pick'](_0x277812[_0xb212('0x2e')],_0xd069d9['filters']),_0x429f03);if(_0x277812[_0xb212('0x2e')][_0xb212('0x3a')]){_0xdf3d5d['where']=_[_0xb212('0x3b')](_0xdf3d5d[_0xb212('0x39')],{'$or':_[_0xb212('0x27')](_0x429f03,function(_0x2b36a0){if(_0x2b36a0['type']!==_0xb212('0x3c')){var _0x789b87={};_0x789b87[_0x2b36a0['name']]={'$like':'%'+_0x277812[_0xb212('0x2e')]['filter']+'%'};return _0x789b87;}})});}_0xdf3d5d=_['merge']({},_0xdf3d5d,_0x277812[_0xb212('0x3d')]);var _0x1e4b89={'where':_0xdf3d5d[_0xb212('0x39')]};return db[_0xb212('0x28')][_0xb212('0x1b')](_0x1e4b89)[_0xb212('0x22')](function(_0x6ac8e7){_0x3cd772['count']=_0x6ac8e7;if(_0x277812[_0xb212('0x2e')][_0xb212('0x3e')]){_0xdf3d5d[_0xb212('0x3f')]=[{'all':!![]}];}return db[_0xb212('0x28')]['findAll'](_0xdf3d5d);})[_0xb212('0x22')](function(_0x49aaac){_0x3cd772['rows']=_0x49aaac;return _0x3cd772;})[_0xb212('0x22')](respondWithFilteredResult(_0x882231,_0xdf3d5d))[_0xb212('0x40')](handleError(_0x882231,null));};exports[_0xb212('0x41')]=function(_0x2af145,_0x4df445){var _0x180930={'raw':![],'where':{'id':_0x2af145[_0xb212('0x42')]['id']}},_0x413245={};_0x413245[_0xb212('0x2d')]=_[_0xb212('0x2f')](db[_0xb212('0x28')][_0xb212('0x29')]);_0x413245[_0xb212('0x2e')]=_[_0xb212('0x2f')](_0x2af145['query']);_0x413245[_0xb212('0x30')]=_['intersection'](_0x413245[_0xb212('0x2d')],_0x413245['query']);_0x180930[_0xb212('0x32')]=_[_0xb212('0x31')](_0x413245['model'],qs[_0xb212('0x33')](_0x2af145[_0xb212('0x2e')][_0xb212('0x33')]));_0x180930[_0xb212('0x32')]=_0x180930[_0xb212('0x32')]['length']?_0x180930['attributes']:_0x413245[_0xb212('0x2d')];if(_0x2af145[_0xb212('0x2e')][_0xb212('0x3e')]){_0x180930[_0xb212('0x3f')]=[{'all':!![]}];}_0x180930=_[_0xb212('0x3b')]({},_0x180930,_0x2af145[_0xb212('0x3d')]);return db[_0xb212('0x28')][_0xb212('0x43')](_0x180930)['then'](handleEntityNotFound(_0x4df445,null))['then'](respondWithResult(_0x4df445,null))['catch'](handleError(_0x4df445,null));};exports[_0xb212('0x44')]=function(_0x5e8643,_0x6861cc){return db[_0xb212('0x28')][_0xb212('0x44')](_0x5e8643[_0xb212('0x45')],{})[_0xb212('0x22')](respondWithResult(_0x6861cc,0xc9))[_0xb212('0x40')](handleError(_0x6861cc,null));};exports[_0xb212('0x21')]=function(_0x559b7b,_0x4d6d1b){if(_0x559b7b[_0xb212('0x45')]['id']){delete _0x559b7b[_0xb212('0x45')]['id'];}return db[_0xb212('0x28')]['find']({'where':{'id':_0x559b7b[_0xb212('0x42')]['id']}})[_0xb212('0x22')](handleEntityNotFound(_0x4d6d1b,null))[_0xb212('0x22')](saveUpdates(_0x559b7b[_0xb212('0x45')],null))[_0xb212('0x22')](respondWithResult(_0x4d6d1b,null))[_0xb212('0x40')](handleError(_0x4d6d1b,null));};exports[_0xb212('0x23')]=function(_0x3c8c4e,_0x56a00d){return db[_0xb212('0x28')][_0xb212('0x43')]({'where':{'id':_0x3c8c4e[_0xb212('0x42')]['id']}})[_0xb212('0x22')](handleEntityNotFound(_0x56a00d,null))[_0xb212('0x22')](removeEntity(_0x56a00d,null))[_0xb212('0x40')](handleError(_0x56a00d,null));};exports[_0xb212('0x46')]=function(_0x3de750,_0x59d707,_0x502817){var _0xf32ef={};var _0x189925={};var _0x5d1399;var _0x3d05e2;return db[_0xb212('0x28')][_0xb212('0x47')]({'where':{'id':_0x3de750[_0xb212('0x42')]['id']}})[_0xb212('0x22')](handleEntityNotFound(_0x59d707,null))['then'](function(_0x510208){if(_0x510208){_0x5d1399=_0x510208;_0x189925['model']=_[_0xb212('0x2f')](db[_0xb212('0x48')][_0xb212('0x29')]);_0x189925[_0xb212('0x2e')]=_[_0xb212('0x2f')](_0x3de750[_0xb212('0x2e')]);_0x189925['filters']=_[_0xb212('0x31')](_0x189925['model'],_0x189925['query']);_0xf32ef[_0xb212('0x32')]=_[_0xb212('0x31')](_0x189925[_0xb212('0x2d')],qs[_0xb212('0x33')](_0x3de750[_0xb212('0x2e')][_0xb212('0x33')]));_0xf32ef[_0xb212('0x32')]=_0xf32ef[_0xb212('0x32')][_0xb212('0x34')]?_0xf32ef[_0xb212('0x32')]:_0x189925[_0xb212('0x2d')];_0xf32ef[_0xb212('0x37')]=qs[_0xb212('0x38')](_0x3de750[_0xb212('0x2e')]['sort']);_0xf32ef['where']=qs['filters'](_['pick'](_0x3de750[_0xb212('0x2e')],_0x189925['filters']));if(_0x3de750[_0xb212('0x2e')][_0xb212('0x3a')]){_0xf32ef[_0xb212('0x39')]=_[_0xb212('0x3b')](_0xf32ef[_0xb212('0x39')],{'$or':_[_0xb212('0x27')](_0xf32ef[_0xb212('0x32')],function(_0xdd55d1){var _0x1c7dcc={};_0x1c7dcc[_0xdd55d1]={'$like':'%'+_0x3de750[_0xb212('0x2e')]['filter']+'%'};return _0x1c7dcc;})});}_0xf32ef=_[_0xb212('0x3b')]({},_0xf32ef,_0x3de750['options']);return _0x5d1399['getFields'](_0xf32ef);}})[_0xb212('0x22')](function(_0x12d283){if(_0x12d283){_0x3d05e2=_0x12d283['length'];if(!_0x3de750[_0xb212('0x2e')][_0xb212('0x35')](_0xb212('0x36'))){_0xf32ef[_0xb212('0x1a')]=qs[_0xb212('0x1a')](_0x3de750[_0xb212('0x2e')][_0xb212('0x1a')]);_0xf32ef[_0xb212('0x1c')]=qs[_0xb212('0x1c')](_0x3de750[_0xb212('0x2e')][_0xb212('0x1c')]);}return _0x5d1399['getFields'](_0xf32ef);}})[_0xb212('0x22')](function(_0x36c052){if(_0x36c052){return _0x36c052?{'count':_0x3d05e2,'rows':_0x36c052}:null;}})[_0xb212('0x22')](respondWithResult(_0x59d707,null))[_0xb212('0x40')](handleError(_0x59d707,null));};exports[_0xb212('0x49')]=function(_0xa5d5e8,_0x4c7873,_0x5da21){var _0x18f926={};var _0x134212={};var _0x3e3243;var _0x16b166;return db[_0xb212('0x28')][_0xb212('0x47')]({'where':{'id':_0xa5d5e8[_0xb212('0x42')]['id']}})[_0xb212('0x22')](handleEntityNotFound(_0x4c7873,null))[_0xb212('0x22')](function(_0x507dfa){if(_0x507dfa){_0x3e3243=_0x507dfa;_0x134212[_0xb212('0x2d')]=_['keys'](db[_0xb212('0x48')]['rawAttributes']);_0x134212[_0xb212('0x2e')]=_[_0xb212('0x2f')](_0xa5d5e8[_0xb212('0x2e')]);_0x134212[_0xb212('0x30')]=_[_0xb212('0x31')](_0x134212[_0xb212('0x2d')],_0x134212[_0xb212('0x2e')]);_0x18f926[_0xb212('0x32')]=_[_0xb212('0x31')](_0x134212['model'],qs[_0xb212('0x33')](_0xa5d5e8[_0xb212('0x2e')][_0xb212('0x33')]));_0x18f926['attributes']=_0x18f926[_0xb212('0x32')]['length']?_0x18f926[_0xb212('0x32')]:_0x134212[_0xb212('0x2d')];_0x18f926[_0xb212('0x37')]=qs[_0xb212('0x38')](_0xa5d5e8[_0xb212('0x2e')][_0xb212('0x38')]);_0x18f926[_0xb212('0x39')]=qs[_0xb212('0x30')](_[_0xb212('0x4a')](_0xa5d5e8[_0xb212('0x2e')],_0x134212[_0xb212('0x30')]));if(_0xa5d5e8[_0xb212('0x2e')]['filter']){_0x18f926[_0xb212('0x39')]=_[_0xb212('0x3b')](_0x18f926['where'],{'$or':_[_0xb212('0x27')](_0x18f926[_0xb212('0x32')],function(_0x39f7fc){var _0x1e48de={};_0x1e48de[_0x39f7fc]={'$like':'%'+_0xa5d5e8[_0xb212('0x2e')][_0xb212('0x3a')]+'%'};return _0x1e48de;})});}_0x18f926=_[_0xb212('0x3b')]({},_0x18f926,_0xa5d5e8['options']);return _0x3e3243[_0xb212('0x49')](_0x18f926);}})[_0xb212('0x22')](function(_0x27fbba){if(_0x27fbba){_0x16b166=_0x27fbba[_0xb212('0x34')];if(!_0xa5d5e8['query'][_0xb212('0x35')](_0xb212('0x36'))){_0x18f926[_0xb212('0x1a')]=qs['limit'](_0xa5d5e8[_0xb212('0x2e')][_0xb212('0x1a')]);_0x18f926['offset']=qs[_0xb212('0x1c')](_0xa5d5e8[_0xb212('0x2e')]['offset']);}return _0x3e3243[_0xb212('0x49')](_0x18f926);}})[_0xb212('0x22')](function(_0x3d7641){if(_0x3d7641){return _0x3d7641?{'count':_0x16b166,'rows':_0x3d7641}:null;}})[_0xb212('0x22')](respondWithResult(_0x4c7873,null))[_0xb212('0x40')](handleError(_0x4c7873,null));};exports[_0xb212('0x4b')]=function(_0x514605,_0x3cf59f,_0x9fd11d){var _0x351d2a={};var _0x19641a={};var _0x541f18;var _0x14e7fb;return db[_0xb212('0x28')][_0xb212('0x47')]({'where':{'id':_0x514605[_0xb212('0x42')]['id']}})[_0xb212('0x22')](handleEntityNotFound(_0x3cf59f,null))[_0xb212('0x22')](function(_0x2e3ec6){if(_0x2e3ec6){_0x541f18=_0x2e3ec6;_0x19641a[_0xb212('0x2d')]=_[_0xb212('0x2f')](db[_0xb212('0x48')]['rawAttributes']);_0x19641a['query']=_[_0xb212('0x2f')](_0x514605[_0xb212('0x2e')]);_0x19641a[_0xb212('0x30')]=_['intersection'](_0x19641a['model'],_0x19641a[_0xb212('0x2e')]);_0x351d2a[_0xb212('0x32')]=_[_0xb212('0x31')](_0x19641a[_0xb212('0x2d')],qs[_0xb212('0x33')](_0x514605[_0xb212('0x2e')][_0xb212('0x33')]));_0x351d2a[_0xb212('0x32')]=_0x351d2a[_0xb212('0x32')]['length']?_0x351d2a[_0xb212('0x32')]:_0x19641a[_0xb212('0x2d')];_0x351d2a['order']=qs['sort'](_0x514605[_0xb212('0x2e')][_0xb212('0x38')]);_0x351d2a[_0xb212('0x39')]=qs[_0xb212('0x30')](_['pick'](_0x514605[_0xb212('0x2e')],_0x19641a[_0xb212('0x30')]));if(_0x514605[_0xb212('0x2e')][_0xb212('0x3a')]){_0x351d2a[_0xb212('0x39')]=_['merge'](_0x351d2a[_0xb212('0x39')],{'$or':_['map'](_0x351d2a[_0xb212('0x32')],function(_0x53c9fa){var _0xef8311={};_0xef8311[_0x53c9fa]={'$like':'%'+_0x514605[_0xb212('0x2e')][_0xb212('0x3a')]+'%'};return _0xef8311;})});}_0x351d2a=_[_0xb212('0x3b')]({},_0x351d2a,_0x514605['options']);return _0x541f18[_0xb212('0x4b')](_0x351d2a);}})['then'](function(_0x4e989f){if(_0x4e989f){_0x14e7fb=_0x4e989f['length'];if(!_0x514605[_0xb212('0x2e')][_0xb212('0x35')](_0xb212('0x36'))){_0x351d2a[_0xb212('0x1a')]=qs[_0xb212('0x1a')](_0x514605[_0xb212('0x2e')][_0xb212('0x1a')]);_0x351d2a[_0xb212('0x1c')]=qs[_0xb212('0x1c')](_0x514605['query']['offset']);}return _0x541f18[_0xb212('0x4b')](_0x351d2a);}})[_0xb212('0x22')](function(_0x496852){if(_0x496852){return _0x496852?{'count':_0x14e7fb,'rows':_0x496852}:null;}})[_0xb212('0x22')](respondWithResult(_0x3cf59f,null))['catch'](handleError(_0x3cf59f,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 172041e..afcd339 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 _0x2665=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x2665,0x160));var _0x5266=function(_0x4035d1,_0x1147a0){_0x4035d1=_0x4035d1-0x0;var _0x330276=_0x2665[_0x4035d1];return _0x330276;};'use strict';var _=require(_0x5266('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5266('0x1'));var moment=require(_0x5266('0x2'));var BPromise=require(_0x5266('0x3'));var rp=require(_0x5266('0x4'));var fs=require('fs');var path=require(_0x5266('0x5'));var rimraf=require(_0x5266('0x6'));var config=require(_0x5266('0x7'));var attributes=require(_0x5266('0x8'));module['exports']=function(_0x24c781,_0x5f5b2b){return _0x24c781['define'](_0x5266('0x9'),attributes,{'tableName':_0x5266('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaaae=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1e271f,_0x3207d0){var _0x69856d=function(_0xd7facd){while(--_0xd7facd){_0x1e271f['push'](_0x1e271f['shift']());}};_0x69856d(++_0x3207d0);}(_0xaaae,0x88));var _0xeaaa=function(_0x3fca8f,_0x45d988){_0x3fca8f=_0x3fca8f-0x0;var _0x39b5e4=_0xaaae[_0x3fca8f];return _0x39b5e4;};'use strict';var _=require('lodash');var util=require(_0xeaaa('0x0'));var logger=require(_0xeaaa('0x1'))(_0xeaaa('0x2'));var moment=require(_0xeaaa('0x3'));var BPromise=require(_0xeaaa('0x4'));var rp=require(_0xeaaa('0x5'));var fs=require('fs');var path=require(_0xeaaa('0x6'));var rimraf=require('rimraf');var config=require(_0xeaaa('0x7'));var attributes=require(_0xeaaa('0x8'));module[_0xeaaa('0x9')]=function(_0xb17ec2,_0x5b4eec){return _0xb17ec2[_0xeaaa('0xa')](_0xeaaa('0xb'),attributes,{'tableName':_0xeaaa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index f145545..98703b3 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 _0x302f=['debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3f56dc,_0x4185a6){var _0x303690=function(_0x8b8f9b){while(--_0x8b8f9b){_0x3f56dc['push'](_0x3f56dc['shift']());}};_0x303690(++_0x4185a6);}(_0x302f,0x1bd));var _0xf302=function(_0x21a413,_0x5dab51){_0x21a413=_0x21a413-0x0;var _0x274357=_0x302f[_0x21a413];return _0x274357;};'use strict';var _=require(_0xf302('0x0'));var util=require(_0xf302('0x1'));var moment=require(_0xf302('0x2'));var BPromise=require('bluebird');var rs=require(_0xf302('0x3'));var fs=require('fs');var Redis=require(_0xf302('0x4'));var db=require(_0xf302('0x5'))['db'];var utils=require(_0xf302('0x6'));var logger=require(_0xf302('0x7'))(_0xf302('0x8'));var config=require('../../config/environment');var jayson=require(_0xf302('0x9'));var client=jayson[_0xf302('0xa')][_0xf302('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7541,_0x475861,_0x91d41c){return new BPromise(function(_0x2ff5ce,_0x47efd0){return client[_0xf302('0xc')](_0x2d7541,_0x91d41c)['then'](function(_0x577067){logger['info'](_0xf302('0xd'),_0x475861,_0xf302('0xe'));logger[_0xf302('0xf')](_0xf302('0x10'),_0x475861,'request\x20sent',JSON[_0xf302('0x11')](_0x577067));if(_0x577067['error']){if(_0x577067[_0xf302('0x12')][_0xf302('0x13')]===0x1f4){logger[_0xf302('0x12')](_0xf302('0xd'),_0x475861,_0x577067['error'][_0xf302('0x14')]);return _0x47efd0(_0x577067['error']['message']);}logger['error'](_0xf302('0xd'),_0x475861,_0x577067[_0xf302('0x12')][_0xf302('0x14')]);return _0x2ff5ce(_0x577067[_0xf302('0x12')][_0xf302('0x14')]);}else{logger[_0xf302('0x15')]('SalesforceConfiguration,\x20%s,\x20%s',_0x475861,_0xf302('0xe'));_0x2ff5ce(_0x577067['result'][_0xf302('0x14')]);}})[_0xf302('0x16')](function(_0x3de480){logger[_0xf302('0x12')](_0xf302('0xd'),_0x475861,_0x3de480);_0x47efd0(_0x3de480);});});} \ No newline at end of file +var _0xf56b=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1ca9f6,_0x300b5a){var _0x1a21d=function(_0x51c2e4){while(--_0x51c2e4){_0x1ca9f6['push'](_0x1ca9f6['shift']());}};_0x1a21d(++_0x300b5a);}(_0xf56b,0x19f));var _0xbf56=function(_0x1cfafc,_0x56a2e0){_0x1cfafc=_0x1cfafc-0x0;var _0x34213a=_0xf56b[_0x1cfafc];return _0x34213a;};'use strict';var _=require(_0xbf56('0x0'));var util=require('util');var moment=require(_0xbf56('0x1'));var BPromise=require(_0xbf56('0x2'));var rs=require(_0xbf56('0x3'));var fs=require('fs');var Redis=require(_0xbf56('0x4'));var db=require(_0xbf56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf56('0x6'))('rpc');var config=require(_0xbf56('0x7'));var jayson=require(_0xbf56('0x8'));var client=jayson[_0xbf56('0x9')][_0xbf56('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x509010,_0x509b74,_0x220eb3){return new BPromise(function(_0x1ecd73,_0x364c19){return client['request'](_0x509010,_0x220eb3)[_0xbf56('0xb')](function(_0x176ceb){logger['info'](_0xbf56('0xc'),_0x509b74,_0xbf56('0xd'));logger[_0xbf56('0xe')](_0xbf56('0xf'),_0x509b74,_0xbf56('0xd'),JSON[_0xbf56('0x10')](_0x176ceb));if(_0x176ceb[_0xbf56('0x11')]){if(_0x176ceb[_0xbf56('0x11')]['code']===0x1f4){logger[_0xbf56('0x11')](_0xbf56('0xc'),_0x509b74,_0x176ceb[_0xbf56('0x11')][_0xbf56('0x12')]);return _0x364c19(_0x176ceb[_0xbf56('0x11')][_0xbf56('0x12')]);}logger[_0xbf56('0x11')](_0xbf56('0xc'),_0x509b74,_0x176ceb[_0xbf56('0x11')][_0xbf56('0x12')]);return _0x1ecd73(_0x176ceb[_0xbf56('0x11')][_0xbf56('0x12')]);}else{logger[_0xbf56('0x13')](_0xbf56('0xc'),_0x509b74,'request\x20sent');_0x1ecd73(_0x176ceb['result'][_0xbf56('0x12')]);}})[_0xbf56('0x14')](function(_0x5b0a5f){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x509b74,_0x5b0a5f);_0x364c19(_0x5b0a5f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 7f0c669..304e6a3 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 _0x1093=['delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x49ac36,_0x3f483c){var _0x1d6cf4=function(_0x574326){while(--_0x574326){_0x49ac36['push'](_0x49ac36['shift']());}};_0x1d6cf4(++_0x3f483c);}(_0x1093,0xfe));var _0x3109=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x1093[_0x4e6ae6];return _0x23c108;};'use strict';var multer=require(_0x3109('0x0'));var util=require(_0x3109('0x1'));var path=require('path');var timeout=require(_0x3109('0x2'));var express=require('express');var router=express[_0x3109('0x3')]();var fs_extra=require(_0x3109('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3109('0x5'));var config=require(_0x3109('0x6'));var controller=require(_0x3109('0x7'));router[_0x3109('0x8')]('/',auth[_0x3109('0x9')](),controller[_0x3109('0xa')]);router[_0x3109('0x8')](_0x3109('0xb'),auth['isAuthenticated'](),controller[_0x3109('0xc')]);router[_0x3109('0xd')]('/',auth['isAuthenticated'](),controller[_0x3109('0xe')]);router['put']('/:id',auth[_0x3109('0x9')](),controller[_0x3109('0xf')]);router[_0x3109('0x10')](_0x3109('0xb'),auth[_0x3109('0x9')](),controller['destroy']);module[_0x3109('0x11')]=router; \ No newline at end of file +var _0x6ad8=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6ad8,0x141));var _0x86ad=function(_0x185580,_0x25043f){_0x185580=_0x185580-0x0;var _0x32b841=_0x6ad8[_0x185580];return _0x32b841;};'use strict';var multer=require(_0x86ad('0x0'));var util=require(_0x86ad('0x1'));var path=require(_0x86ad('0x2'));var timeout=require(_0x86ad('0x3'));var express=require(_0x86ad('0x4'));var router=express[_0x86ad('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x86ad('0x6'));var interaction=require(_0x86ad('0x7'));var config=require(_0x86ad('0x8'));var controller=require(_0x86ad('0x9'));router['get']('/',auth[_0x86ad('0xa')](),controller[_0x86ad('0xb')]);router[_0x86ad('0xc')](_0x86ad('0xd'),auth[_0x86ad('0xa')](),controller[_0x86ad('0xe')]);router['post']('/',auth[_0x86ad('0xa')](),controller[_0x86ad('0xf')]);router[_0x86ad('0x10')](_0x86ad('0xd'),auth[_0x86ad('0xa')](),controller[_0x86ad('0x11')]);router[_0x86ad('0x12')](_0x86ad('0xd'),auth[_0x86ad('0xa')](),controller['destroy']);module[_0x86ad('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index e832ff1..21abe14 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 _0xf27e=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf27e,0x11f));var _0xef27=function(_0x4d8e39,_0x1a5325){_0x4d8e39=_0x4d8e39-0x0;var _0x41869c=_0xf27e[_0x4d8e39];return _0x41869c;};'use strict';var Sequelize=require(_0xef27('0x0'));module[_0xef27('0x1')]={'type':{'type':Sequelize[_0xef27('0x2')](_0xef27('0x3'),_0xef27('0x4'),_0xef27('0x5'),_0xef27('0x6'),'picklist'),'defaultValue':_0xef27('0x3')},'content':{'type':Sequelize[_0xef27('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xef27('0x2')](_0xef27('0x3'),_0xef27('0x4'),_0xef27('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xef27('0x7')]},'variableName':{'type':Sequelize[_0xef27('0x7')]}}; \ No newline at end of file +var _0xca9e=['sequelize','exports','ENUM','variable','customVariable','string','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca9e,0x13b));var _0xeca9=function(_0xe13cc0,_0x22e7c2){_0xe13cc0=_0xe13cc0-0x0;var _0x3e13f4=_0xca9e[_0xe13cc0];return _0x3e13f4;};'use strict';var Sequelize=require(_0xeca9('0x0'));module[_0xeca9('0x1')]={'type':{'type':Sequelize[_0xeca9('0x2')]('string',_0xeca9('0x3'),_0xeca9('0x4'),'keyValue','picklist'),'defaultValue':_0xeca9('0x5')},'content':{'type':Sequelize[_0xeca9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xeca9('0x2')](_0xeca9('0x5'),_0xeca9('0x3'),_0xeca9('0x4'))},'keyContent':{'type':Sequelize[_0xeca9('0x6')]},'idField':{'type':Sequelize[_0xeca9('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 97e2eea..9aa2d3b 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 _0xc8cb=['offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','SalesforceField','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','bluebird','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc8cb,0x80));var _0xbc8c=function(_0x188703,_0x596b26){_0x188703=_0x188703-0x0;var _0x1a0c81=_0xc8cb[_0x188703];return _0x1a0c81;};'use strict';var emlformat=require(_0xbc8c('0x0'));var rimraf=require(_0xbc8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc8c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbc8c('0x3'));var Mustache=require('mustache');var util=require(_0xbc8c('0x4'));var path=require(_0xbc8c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc8c('0x6'));var _=require(_0xbc8c('0x7'));var squel=require(_0xbc8c('0x8'));var crypto=require(_0xbc8c('0x9'));var jsforce=require(_0xbc8c('0xa'));var deskjs=require(_0xbc8c('0xb'));var toCsv=require(_0xbc8c('0xc'));var querystring=require(_0xbc8c('0xd'));var Papa=require(_0xbc8c('0xe'));var Redis=require(_0xbc8c('0xf'));var authService=require(_0xbc8c('0x10'));var qs=require(_0xbc8c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc8c('0x12'));var logger=require(_0xbc8c('0x13'))('api');var utils=require(_0xbc8c('0x14'));var config=require(_0xbc8c('0x15'));var licenseUtil=require(_0xbc8c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x208e53,_0x5a5683){_0x5a5683=_0x5a5683||0xcc;return function(_0x2e3852){if(_0x2e3852){return _0x208e53[_0xbc8c('0x17')](_0x5a5683);}return _0x208e53['status'](_0x5a5683)[_0xbc8c('0x18')]();};}function respondWithResult(_0x2164d7,_0x42e4a2){_0x42e4a2=_0x42e4a2||0xc8;return function(_0x540f5a){if(_0x540f5a){return _0x2164d7['status'](_0x42e4a2)[_0xbc8c('0x19')](_0x540f5a);}};}function respondWithFilteredResult(_0x589c50,_0x40028e){return function(_0x4ffc3d){if(_0x4ffc3d){var _0x125dd3=typeof _0x40028e[_0xbc8c('0x1a')]==='undefined'&&typeof _0x40028e['limit']===_0xbc8c('0x1b');var _0x3a2335=_0x4ffc3d[_0xbc8c('0x1c')];var _0x559696=_0x125dd3?0x0:_0x40028e[_0xbc8c('0x1a')];var _0x848496=_0x125dd3?_0x4ffc3d[_0xbc8c('0x1c')]:_0x40028e[_0xbc8c('0x1a')]+_0x40028e[_0xbc8c('0x1d')];var _0x1366e3;if(_0x848496>=_0x3a2335){_0x848496=_0x3a2335;_0x1366e3=0xc8;}else{_0x1366e3=0xce;}_0x589c50[_0xbc8c('0x1e')](_0x1366e3);return _0x589c50[_0xbc8c('0x1f')](_0xbc8c('0x20'),_0x559696+'-'+_0x848496+'/'+_0x3a2335)[_0xbc8c('0x19')](_0x4ffc3d);}return null;};}function patchUpdates(_0x2ef899){return function(_0x541992){try{jsonpatch[_0xbc8c('0x21')](_0x541992,_0x2ef899,!![]);}catch(_0x3f2aba){return BPromise[_0xbc8c('0x22')](_0x3f2aba);}return _0x541992[_0xbc8c('0x23')]();};}function saveUpdates(_0x3cc7d1,_0x16d225){return function(_0x35b292){if(_0x35b292){return _0x35b292[_0xbc8c('0x24')](_0x3cc7d1)[_0xbc8c('0x25')](function(_0x1f4b3a){return _0x1f4b3a;});}return null;};}function removeEntity(_0x253866,_0x297d98){return function(_0x8890ff){if(_0x8890ff){return _0x8890ff[_0xbc8c('0x26')]()[_0xbc8c('0x25')](function(){_0x253866[_0xbc8c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55593e,_0x2231d4){return function(_0x1c7a3a){if(!_0x1c7a3a){_0x55593e['sendStatus'](0x194);}return _0x1c7a3a;};}function handleError(_0x2518ff,_0x5592ed){_0x5592ed=_0x5592ed||0x1f4;return function(_0x6da668){logger[_0xbc8c('0x27')](_0x6da668[_0xbc8c('0x28')]);if(_0x6da668[_0xbc8c('0x29')]){delete _0x6da668[_0xbc8c('0x29')];}_0x2518ff['status'](_0x5592ed)[_0xbc8c('0x2a')](_0x6da668);};}exports['index']=function(_0xed4c66,_0x2c7d17){var _0x124f8d={},_0x2961c5={},_0x2a41a9={'count':0x0,'rows':[]};var _0x52d016=_[_0xbc8c('0x2b')](db['SalesforceField'][_0xbc8c('0x2c')],function(_0x5f1d2c){return{'name':_0x5f1d2c[_0xbc8c('0x2d')],'type':_0x5f1d2c[_0xbc8c('0x2e')][_0xbc8c('0x2f')]};});_0x2961c5[_0xbc8c('0x30')]=_[_0xbc8c('0x2b')](_0x52d016,_0xbc8c('0x29'));_0x2961c5[_0xbc8c('0x31')]=_[_0xbc8c('0x32')](_0xed4c66[_0xbc8c('0x31')]);_0x2961c5[_0xbc8c('0x33')]=_[_0xbc8c('0x34')](_0x2961c5['model'],_0x2961c5[_0xbc8c('0x31')]);_0x124f8d[_0xbc8c('0x35')]=_[_0xbc8c('0x34')](_0x2961c5[_0xbc8c('0x30')],qs['fields'](_0xed4c66['query'][_0xbc8c('0x36')]));_0x124f8d['attributes']=_0x124f8d[_0xbc8c('0x35')][_0xbc8c('0x37')]?_0x124f8d[_0xbc8c('0x35')]:_0x2961c5['model'];if(!_0xed4c66[_0xbc8c('0x31')][_0xbc8c('0x38')](_0xbc8c('0x39'))){_0x124f8d[_0xbc8c('0x1d')]=qs[_0xbc8c('0x1d')](_0xed4c66['query'][_0xbc8c('0x1d')]);_0x124f8d[_0xbc8c('0x1a')]=qs[_0xbc8c('0x1a')](_0xed4c66[_0xbc8c('0x31')]['offset']);}_0x124f8d[_0xbc8c('0x3a')]=qs[_0xbc8c('0x3b')](_0xed4c66[_0xbc8c('0x31')][_0xbc8c('0x3b')]);_0x124f8d['where']=qs[_0xbc8c('0x33')](_[_0xbc8c('0x3c')](_0xed4c66[_0xbc8c('0x31')],_0x2961c5[_0xbc8c('0x33')]),_0x52d016);if(_0xed4c66[_0xbc8c('0x31')][_0xbc8c('0x3d')]){_0x124f8d[_0xbc8c('0x3e')]=_[_0xbc8c('0x3f')](_0x124f8d[_0xbc8c('0x3e')],{'$or':_[_0xbc8c('0x2b')](_0x52d016,function(_0x549c56){if(_0x549c56[_0xbc8c('0x2e')]!==_0xbc8c('0x40')){var _0x9558d3={};_0x9558d3[_0x549c56[_0xbc8c('0x29')]]={'$like':'%'+_0xed4c66[_0xbc8c('0x31')][_0xbc8c('0x3d')]+'%'};return _0x9558d3;}})});}_0x124f8d=_[_0xbc8c('0x3f')]({},_0x124f8d,_0xed4c66['options']);var _0x5988dc={'where':_0x124f8d[_0xbc8c('0x3e')]};return db[_0xbc8c('0x41')][_0xbc8c('0x1c')](_0x5988dc)[_0xbc8c('0x25')](function(_0x261e28){_0x2a41a9[_0xbc8c('0x1c')]=_0x261e28;if(_0xed4c66[_0xbc8c('0x31')][_0xbc8c('0x42')]){_0x124f8d['include']=[{'all':!![]}];}return db['SalesforceField'][_0xbc8c('0x43')](_0x124f8d);})['then'](function(_0x2f18b4){_0x2a41a9[_0xbc8c('0x44')]=_0x2f18b4;return _0x2a41a9;})[_0xbc8c('0x25')](respondWithFilteredResult(_0x2c7d17,_0x124f8d))['catch'](handleError(_0x2c7d17,null));};exports[_0xbc8c('0x45')]=function(_0x591a9b,_0x5b4441){var _0x52cb3b={'raw':!![],'where':{'id':_0x591a9b[_0xbc8c('0x46')]['id']}},_0x31758c={};_0x31758c[_0xbc8c('0x30')]=_[_0xbc8c('0x32')](db[_0xbc8c('0x41')][_0xbc8c('0x2c')]);_0x31758c[_0xbc8c('0x31')]=_[_0xbc8c('0x32')](_0x591a9b['query']);_0x31758c[_0xbc8c('0x33')]=_[_0xbc8c('0x34')](_0x31758c['model'],_0x31758c[_0xbc8c('0x31')]);_0x52cb3b['attributes']=_[_0xbc8c('0x34')](_0x31758c[_0xbc8c('0x30')],qs['fields'](_0x591a9b[_0xbc8c('0x31')][_0xbc8c('0x36')]));_0x52cb3b[_0xbc8c('0x35')]=_0x52cb3b[_0xbc8c('0x35')][_0xbc8c('0x37')]?_0x52cb3b[_0xbc8c('0x35')]:_0x31758c['model'];if(_0x591a9b[_0xbc8c('0x31')][_0xbc8c('0x42')]){_0x52cb3b[_0xbc8c('0x47')]=[{'all':!![]}];}_0x52cb3b=_[_0xbc8c('0x3f')]({},_0x52cb3b,_0x591a9b[_0xbc8c('0x48')]);return db[_0xbc8c('0x41')][_0xbc8c('0x49')](_0x52cb3b)[_0xbc8c('0x25')](handleEntityNotFound(_0x5b4441,null))[_0xbc8c('0x25')](respondWithResult(_0x5b4441,null))[_0xbc8c('0x4a')](handleError(_0x5b4441,null));};exports[_0xbc8c('0x4b')]=function(_0xdc4aa0,_0x3b0f79){return db[_0xbc8c('0x41')][_0xbc8c('0x4b')](_0xdc4aa0[_0xbc8c('0x4c')],{})[_0xbc8c('0x25')](respondWithResult(_0x3b0f79,0xc9))[_0xbc8c('0x4a')](handleError(_0x3b0f79,null));};exports[_0xbc8c('0x24')]=function(_0xf9e51d,_0x12a146){if(_0xf9e51d[_0xbc8c('0x4c')]['id']){delete _0xf9e51d[_0xbc8c('0x4c')]['id'];}return db[_0xbc8c('0x41')][_0xbc8c('0x49')]({'where':{'id':_0xf9e51d['params']['id']}})[_0xbc8c('0x25')](handleEntityNotFound(_0x12a146,null))[_0xbc8c('0x25')](saveUpdates(_0xf9e51d['body'],null))[_0xbc8c('0x25')](respondWithResult(_0x12a146,null))[_0xbc8c('0x4a')](handleError(_0x12a146,null));};exports[_0xbc8c('0x26')]=function(_0x4be8c4,_0x297fcc){return db[_0xbc8c('0x41')][_0xbc8c('0x49')]({'where':{'id':_0x4be8c4[_0xbc8c('0x46')]['id']}})['then'](handleEntityNotFound(_0x297fcc,null))['then'](removeEntity(_0x297fcc,null))[_0xbc8c('0x4a')](handleError(_0x297fcc,null));}; \ No newline at end of file +var _0xbe59=['key','model','map','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','length','find','create','body','update','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','end','stack','name','send','index','SalesforceField','rawAttributes','fieldName'];(function(_0x302134,_0x473aae){var _0x12a6b5=function(_0x2713c9){while(--_0x2713c9){_0x302134['push'](_0x302134['shift']());}};_0x12a6b5(++_0x473aae);}(_0xbe59,0x104));var _0x9be5=function(_0x4f7a1e,_0x5468a9){_0x4f7a1e=_0x4f7a1e-0x0;var _0x1d060d=_0xbe59[_0x4f7a1e];return _0x1d060d;};'use strict';var emlformat=require(_0x9be5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9be5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9be5('0x2'));var moment=require(_0x9be5('0x3'));var BPromise=require(_0x9be5('0x4'));var Mustache=require(_0x9be5('0x5'));var util=require(_0x9be5('0x6'));var path=require(_0x9be5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9be5('0x8'));var _=require(_0x9be5('0x9'));var squel=require(_0x9be5('0xa'));var crypto=require('crypto');var jsforce=require(_0x9be5('0xb'));var deskjs=require(_0x9be5('0xc'));var toCsv=require(_0x9be5('0xd'));var querystring=require('querystring');var Papa=require(_0x9be5('0xe'));var Redis=require(_0x9be5('0xf'));var authService=require(_0x9be5('0x10'));var qs=require(_0x9be5('0x11'));var as=require(_0x9be5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9be5('0x13'));var utils=require(_0x9be5('0x14'));var config=require(_0x9be5('0x15'));var licenseUtil=require(_0x9be5('0x16'));var db=require(_0x9be5('0x17'))['db'];function respondWithStatusCode(_0x407c2b,_0x1eb43f){_0x1eb43f=_0x1eb43f||0xcc;return function(_0x2011a5){if(_0x2011a5){return _0x407c2b[_0x9be5('0x18')](_0x1eb43f);}return _0x407c2b[_0x9be5('0x19')](_0x1eb43f)['end']();};}function respondWithResult(_0x1753aa,_0x42f2d5){_0x42f2d5=_0x42f2d5||0xc8;return function(_0x13c943){if(_0x13c943){return _0x1753aa[_0x9be5('0x19')](_0x42f2d5)['json'](_0x13c943);}};}function respondWithFilteredResult(_0x384ec4,_0x5d0e11){return function(_0x57473a){if(_0x57473a){var _0x41ea35=typeof _0x5d0e11[_0x9be5('0x1a')]===_0x9be5('0x1b')&&typeof _0x5d0e11[_0x9be5('0x1c')]===_0x9be5('0x1b');var _0x2eaf05=_0x57473a[_0x9be5('0x1d')];var _0x7d834c=_0x41ea35?0x0:_0x5d0e11[_0x9be5('0x1a')];var _0x5e8145=_0x41ea35?_0x57473a[_0x9be5('0x1d')]:_0x5d0e11[_0x9be5('0x1a')]+_0x5d0e11[_0x9be5('0x1c')];var _0x116894;if(_0x5e8145>=_0x2eaf05){_0x5e8145=_0x2eaf05;_0x116894=0xc8;}else{_0x116894=0xce;}_0x384ec4[_0x9be5('0x19')](_0x116894);return _0x384ec4[_0x9be5('0x1e')](_0x9be5('0x1f'),_0x7d834c+'-'+_0x5e8145+'/'+_0x2eaf05)[_0x9be5('0x20')](_0x57473a);}return null;};}function patchUpdates(_0x2fed5a){return function(_0x38f5d2){try{jsonpatch['apply'](_0x38f5d2,_0x2fed5a,!![]);}catch(_0x358fa8){return BPromise[_0x9be5('0x21')](_0x358fa8);}return _0x38f5d2[_0x9be5('0x22')]();};}function saveUpdates(_0x167c62,_0x3d6d63){return function(_0x23bdc4){if(_0x23bdc4){return _0x23bdc4['update'](_0x167c62)[_0x9be5('0x23')](function(_0x5bb242){return _0x5bb242;});}return null;};}function removeEntity(_0x54e85e,_0x82a74c){return function(_0x1a6916){if(_0x1a6916){return _0x1a6916['destroy']()[_0x9be5('0x23')](function(){_0x54e85e['status'](0xcc)[_0x9be5('0x24')]();});}};}function handleEntityNotFound(_0x66b2b5,_0x280894){return function(_0x164c6c){if(!_0x164c6c){_0x66b2b5['sendStatus'](0x194);}return _0x164c6c;};}function handleError(_0x18305b,_0x1cb1e3){_0x1cb1e3=_0x1cb1e3||0x1f4;return function(_0x4264cf){logger['error'](_0x4264cf[_0x9be5('0x25')]);if(_0x4264cf[_0x9be5('0x26')]){delete _0x4264cf[_0x9be5('0x26')];}_0x18305b[_0x9be5('0x19')](_0x1cb1e3)[_0x9be5('0x27')](_0x4264cf);};}exports[_0x9be5('0x28')]=function(_0xa6a19d,_0x5175f3){var _0xd842a1={},_0x17e7fe={},_0x18d6a2={'count':0x0,'rows':[]};var _0x3c9323=_['map'](db[_0x9be5('0x29')][_0x9be5('0x2a')],function(_0x2c76d0){return{'name':_0x2c76d0[_0x9be5('0x2b')],'type':_0x2c76d0['type'][_0x9be5('0x2c')]};});_0x17e7fe[_0x9be5('0x2d')]=_[_0x9be5('0x2e')](_0x3c9323,'name');_0x17e7fe['query']=_[_0x9be5('0x2f')](_0xa6a19d[_0x9be5('0x30')]);_0x17e7fe[_0x9be5('0x31')]=_[_0x9be5('0x32')](_0x17e7fe['model'],_0x17e7fe[_0x9be5('0x30')]);_0xd842a1[_0x9be5('0x33')]=_[_0x9be5('0x32')](_0x17e7fe[_0x9be5('0x2d')],qs['fields'](_0xa6a19d[_0x9be5('0x30')]['fields']));_0xd842a1['attributes']=_0xd842a1[_0x9be5('0x33')]['length']?_0xd842a1[_0x9be5('0x33')]:_0x17e7fe[_0x9be5('0x2d')];if(!_0xa6a19d[_0x9be5('0x30')][_0x9be5('0x34')](_0x9be5('0x35'))){_0xd842a1[_0x9be5('0x1c')]=qs[_0x9be5('0x1c')](_0xa6a19d[_0x9be5('0x30')][_0x9be5('0x1c')]);_0xd842a1[_0x9be5('0x1a')]=qs[_0x9be5('0x1a')](_0xa6a19d[_0x9be5('0x30')][_0x9be5('0x1a')]);}_0xd842a1[_0x9be5('0x36')]=qs[_0x9be5('0x37')](_0xa6a19d[_0x9be5('0x30')][_0x9be5('0x37')]);_0xd842a1[_0x9be5('0x38')]=qs[_0x9be5('0x31')](_[_0x9be5('0x39')](_0xa6a19d[_0x9be5('0x30')],_0x17e7fe[_0x9be5('0x31')]),_0x3c9323);if(_0xa6a19d['query'][_0x9be5('0x3a')]){_0xd842a1[_0x9be5('0x38')]=_[_0x9be5('0x3b')](_0xd842a1[_0x9be5('0x38')],{'$or':_[_0x9be5('0x2e')](_0x3c9323,function(_0x1dfda9){if(_0x1dfda9[_0x9be5('0x3c')]!==_0x9be5('0x3d')){var _0x493098={};_0x493098[_0x1dfda9[_0x9be5('0x26')]]={'$like':'%'+_0xa6a19d['query']['filter']+'%'};return _0x493098;}})});}_0xd842a1=_['merge']({},_0xd842a1,_0xa6a19d[_0x9be5('0x3e')]);var _0x3be84d={'where':_0xd842a1[_0x9be5('0x38')]};return db[_0x9be5('0x29')][_0x9be5('0x1d')](_0x3be84d)[_0x9be5('0x23')](function(_0x177263){_0x18d6a2[_0x9be5('0x1d')]=_0x177263;if(_0xa6a19d[_0x9be5('0x30')][_0x9be5('0x3f')]){_0xd842a1[_0x9be5('0x40')]=[{'all':!![]}];}return db[_0x9be5('0x29')][_0x9be5('0x41')](_0xd842a1);})[_0x9be5('0x23')](function(_0x56ef9d){_0x18d6a2['rows']=_0x56ef9d;return _0x18d6a2;})[_0x9be5('0x23')](respondWithFilteredResult(_0x5175f3,_0xd842a1))[_0x9be5('0x42')](handleError(_0x5175f3,null));};exports[_0x9be5('0x43')]=function(_0x4ff735,_0x37fb3b){var _0x32a4d4={'raw':!![],'where':{'id':_0x4ff735[_0x9be5('0x44')]['id']}},_0x5da1e3={};_0x5da1e3['model']=_['keys'](db['SalesforceField'][_0x9be5('0x2a')]);_0x5da1e3[_0x9be5('0x30')]=_[_0x9be5('0x2f')](_0x4ff735[_0x9be5('0x30')]);_0x5da1e3[_0x9be5('0x31')]=_[_0x9be5('0x32')](_0x5da1e3[_0x9be5('0x2d')],_0x5da1e3[_0x9be5('0x30')]);_0x32a4d4[_0x9be5('0x33')]=_[_0x9be5('0x32')](_0x5da1e3[_0x9be5('0x2d')],qs[_0x9be5('0x45')](_0x4ff735[_0x9be5('0x30')]['fields']));_0x32a4d4[_0x9be5('0x33')]=_0x32a4d4[_0x9be5('0x33')][_0x9be5('0x46')]?_0x32a4d4['attributes']:_0x5da1e3[_0x9be5('0x2d')];if(_0x4ff735[_0x9be5('0x30')][_0x9be5('0x3f')]){_0x32a4d4[_0x9be5('0x40')]=[{'all':!![]}];}_0x32a4d4=_[_0x9be5('0x3b')]({},_0x32a4d4,_0x4ff735['options']);return db[_0x9be5('0x29')][_0x9be5('0x47')](_0x32a4d4)[_0x9be5('0x23')](handleEntityNotFound(_0x37fb3b,null))[_0x9be5('0x23')](respondWithResult(_0x37fb3b,null))[_0x9be5('0x42')](handleError(_0x37fb3b,null));};exports[_0x9be5('0x48')]=function(_0x3bd035,_0x473472){return db[_0x9be5('0x29')][_0x9be5('0x48')](_0x3bd035[_0x9be5('0x49')],{})[_0x9be5('0x23')](respondWithResult(_0x473472,0xc9))[_0x9be5('0x42')](handleError(_0x473472,null));};exports[_0x9be5('0x4a')]=function(_0x1c6374,_0x39b131){if(_0x1c6374['body']['id']){delete _0x1c6374[_0x9be5('0x49')]['id'];}return db[_0x9be5('0x29')]['find']({'where':{'id':_0x1c6374['params']['id']}})[_0x9be5('0x23')](handleEntityNotFound(_0x39b131,null))[_0x9be5('0x23')](saveUpdates(_0x1c6374[_0x9be5('0x49')],null))[_0x9be5('0x23')](respondWithResult(_0x39b131,null))['catch'](handleError(_0x39b131,null));};exports[_0x9be5('0x4b')]=function(_0x76ce13,_0x495eb1){return db['SalesforceField'][_0x9be5('0x47')]({'where':{'id':_0x76ce13[_0x9be5('0x44')]['id']}})['then'](handleEntityNotFound(_0x495eb1,null))[_0x9be5('0x23')](removeEntity(_0x495eb1,null))[_0x9be5('0x42')](handleError(_0x495eb1,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e8b9830..13c5827 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 _0x8e7f=['moment','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','api'];(function(_0x55c72d,_0x5d7876){var _0x3b64b6=function(_0x22de97){while(--_0x22de97){_0x55c72d['push'](_0x55c72d['shift']());}};_0x3b64b6(++_0x5d7876);}(_0x8e7f,0x92));var _0xf8e7=function(_0x2d23d2,_0x494788){_0x2d23d2=_0x2d23d2-0x0;var _0xcc59f1=_0x8e7f[_0x2d23d2];return _0xcc59f1;};'use strict';var _=require(_0xf8e7('0x0'));var util=require(_0xf8e7('0x1'));var logger=require(_0xf8e7('0x2'))(_0xf8e7('0x3'));var moment=require(_0xf8e7('0x4'));var BPromise=require(_0xf8e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8e7('0x6'));var rimraf=require(_0xf8e7('0x7'));var config=require(_0xf8e7('0x8'));var attributes=require(_0xf8e7('0x9'));module['exports']=function(_0x1c120f,_0x5fa96b){return _0x1c120f[_0xf8e7('0xa')](_0xf8e7('0xb'),attributes,{'tableName':_0xf8e7('0xc'),'paranoid':![],'indexes':[{'name':_0xf8e7('0xd'),'fields':[_0xf8e7('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2785=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1925a0,_0x4c4746){var _0x5a5ab6=function(_0x600e63){while(--_0x600e63){_0x1925a0['push'](_0x1925a0['shift']());}};_0x5a5ab6(++_0x4c4746);}(_0x2785,0x81));var _0x5278=function(_0x45f4e9,_0x5246fd){_0x45f4e9=_0x45f4e9-0x0;var _0x559d8f=_0x2785[_0x45f4e9];return _0x559d8f;};'use strict';var _=require('lodash');var util=require(_0x5278('0x0'));var logger=require(_0x5278('0x1'))(_0x5278('0x2'));var moment=require(_0x5278('0x3'));var BPromise=require(_0x5278('0x4'));var rp=require(_0x5278('0x5'));var fs=require('fs');var path=require(_0x5278('0x6'));var rimraf=require(_0x5278('0x7'));var config=require(_0x5278('0x8'));var attributes=require(_0x5278('0x9'));module[_0x5278('0xa')]=function(_0x14ce76,_0x102810){return _0x14ce76[_0x5278('0xb')](_0x5278('0xc'),attributes,{'tableName':_0x5278('0xd'),'paranoid':![],'indexes':[{'name':_0x5278('0xe'),'fields':[_0x5278('0xf'),_0x5278('0x10')],'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 c5d27fa..a49afdd 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 _0x51bc=['debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0xc72885,_0x4d95ca){var _0x46d095=function(_0x52d8a8){while(--_0x52d8a8){_0xc72885['push'](_0xc72885['shift']());}};_0x46d095(++_0x4d95ca);}(_0x51bc,0xa1));var _0xc51b=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x51bc[_0xf0ec6e];return _0x8bbc27;};'use strict';var _=require(_0xc51b('0x0'));var util=require(_0xc51b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc51b('0x2'));var fs=require('fs');var Redis=require(_0xc51b('0x3'));var db=require(_0xc51b('0x4'))['db'];var utils=require(_0xc51b('0x5'));var logger=require(_0xc51b('0x6'))('rpc');var config=require(_0xc51b('0x7'));var jayson=require(_0xc51b('0x8'));var client=jayson[_0xc51b('0x9')][_0xc51b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ce219,_0x3cbeef,_0x1c5582){return new BPromise(function(_0x1831f7,_0x46a3e6){return client[_0xc51b('0xb')](_0x1ce219,_0x1c5582)['then'](function(_0x3e4b15){logger[_0xc51b('0xc')](_0xc51b('0xd'),_0x3cbeef,_0xc51b('0xe'));logger[_0xc51b('0xf')](_0xc51b('0x10'),_0x3cbeef,_0xc51b('0xe'),JSON[_0xc51b('0x11')](_0x3e4b15));if(_0x3e4b15[_0xc51b('0x12')]){if(_0x3e4b15['error'][_0xc51b('0x13')]===0x1f4){logger['error'](_0xc51b('0xd'),_0x3cbeef,_0x3e4b15['error'][_0xc51b('0x14')]);return _0x46a3e6(_0x3e4b15['error']['message']);}logger[_0xc51b('0x12')](_0xc51b('0xd'),_0x3cbeef,_0x3e4b15[_0xc51b('0x12')][_0xc51b('0x14')]);return _0x1831f7(_0x3e4b15[_0xc51b('0x12')][_0xc51b('0x14')]);}else{logger[_0xc51b('0xc')](_0xc51b('0xd'),_0x3cbeef,_0xc51b('0xe'));_0x1831f7(_0x3e4b15[_0xc51b('0x15')]['message']);}})['catch'](function(_0x5a10c0){logger[_0xc51b('0x12')](_0xc51b('0xd'),_0x3cbeef,_0x5a10c0);_0x46a3e6(_0x5a10c0);});});} \ No newline at end of file +var _0xfc14=['SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x3caa6d,_0x2f7da7){var _0x47c898=function(_0xe22fb3){while(--_0xe22fb3){_0x3caa6d['push'](_0x3caa6d['shift']());}};_0x47c898(++_0x2f7da7);}(_0xfc14,0xbc));var _0x4fc1=function(_0x222ab7,_0x32f160){_0x222ab7=_0x222ab7-0x0;var _0x4fee73=_0xfc14[_0x222ab7];return _0x4fee73;};'use strict';var _=require(_0x4fc1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4fc1('0x1'));var rs=require(_0x4fc1('0x2'));var fs=require('fs');var Redis=require(_0x4fc1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4fc1('0x4'))(_0x4fc1('0x5'));var config=require(_0x4fc1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4fc1('0x7')][_0x4fc1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10ce64,_0x32d5be,_0x2fc415){return new BPromise(function(_0x4f0a5f,_0x127a50){return client[_0x4fc1('0x9')](_0x10ce64,_0x2fc415)[_0x4fc1('0xa')](function(_0x3ae57b){logger[_0x4fc1('0xb')](_0x4fc1('0xc'),_0x32d5be,_0x4fc1('0xd'));logger['debug'](_0x4fc1('0xe'),_0x32d5be,_0x4fc1('0xd'),JSON[_0x4fc1('0xf')](_0x3ae57b));if(_0x3ae57b[_0x4fc1('0x10')]){if(_0x3ae57b[_0x4fc1('0x10')][_0x4fc1('0x11')]===0x1f4){logger[_0x4fc1('0x10')](_0x4fc1('0xc'),_0x32d5be,_0x3ae57b[_0x4fc1('0x10')][_0x4fc1('0x12')]);return _0x127a50(_0x3ae57b['error'][_0x4fc1('0x12')]);}logger[_0x4fc1('0x10')](_0x4fc1('0xc'),_0x32d5be,_0x3ae57b['error'][_0x4fc1('0x12')]);return _0x4f0a5f(_0x3ae57b['error'][_0x4fc1('0x12')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x32d5be,_0x4fc1('0xd'));_0x4f0a5f(_0x3ae57b[_0x4fc1('0x13')][_0x4fc1('0x12')]);}})['catch'](function(_0x507dcc){logger[_0x4fc1('0x10')](_0x4fc1('0xc'),_0x32d5be,_0x507dcc);_0x127a50(_0x507dcc);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 658d431..94c3e7e 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 _0x7235=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x24831b,_0x4dd122){var _0x684b0b=function(_0xf8b5fe){while(--_0xf8b5fe){_0x24831b['push'](_0x24831b['shift']());}};_0x684b0b(++_0x4dd122);}(_0x7235,0x77));var _0x5723=function(_0x29543a,_0x36c223){_0x29543a=_0x29543a-0x0;var _0x37038a=_0x7235[_0x29543a];return _0x37038a;};'use strict';var multer=require(_0x5723('0x0'));var util=require(_0x5723('0x1'));var path=require(_0x5723('0x2'));var timeout=require(_0x5723('0x3'));var express=require('express');var router=express[_0x5723('0x4')]();var fs_extra=require(_0x5723('0x5'));var auth=require(_0x5723('0x6'));var interaction=require(_0x5723('0x7'));var config=require(_0x5723('0x8'));var controller=require(_0x5723('0x9'));router[_0x5723('0xa')]('/',auth[_0x5723('0xb')](),controller[_0x5723('0xc')]);router[_0x5723('0xa')](_0x5723('0xd'),auth[_0x5723('0xb')](),controller[_0x5723('0xe')]);router[_0x5723('0xa')](_0x5723('0xf'),auth[_0x5723('0xb')](),controller[_0x5723('0x10')]);router['get'](_0x5723('0x11'),auth[_0x5723('0xb')](),controller[_0x5723('0x12')]);router['post']('/',auth[_0x5723('0xb')](),controller[_0x5723('0x13')]);router[_0x5723('0x14')](_0x5723('0xf'),auth[_0x5723('0xb')](),controller[_0x5723('0x15')]);router[_0x5723('0x16')](_0x5723('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5723('0x17')](_0x5723('0xd'),auth[_0x5723('0xb')](),controller['destroy']);module[_0x5723('0x18')]=router; \ No newline at end of file +var _0x0ca5=['../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2fed29,_0x58711c){var _0x3697d7=function(_0x2d049b){while(--_0x2d049b){_0x2fed29['push'](_0x2fed29['shift']());}};_0x3697d7(++_0x58711c);}(_0x0ca5,0xfc));var _0x50ca=function(_0x5de6a6,_0x29effa){_0x5de6a6=_0x5de6a6-0x0;var _0x87a12c=_0x0ca5[_0x5de6a6];return _0x87a12c;};'use strict';var multer=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var path=require(_0x50ca('0x2'));var timeout=require(_0x50ca('0x3'));var express=require(_0x50ca('0x4'));var router=express[_0x50ca('0x5')]();var fs_extra=require(_0x50ca('0x6'));var auth=require(_0x50ca('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x50ca('0x8'));var controller=require(_0x50ca('0x9'));router[_0x50ca('0xa')]('/',auth[_0x50ca('0xb')](),controller['index']);router[_0x50ca('0xa')](_0x50ca('0xc'),auth['isAuthenticated'](),controller[_0x50ca('0xd')]);router['get'](_0x50ca('0xe'),auth['isAuthenticated'](),controller[_0x50ca('0xf')]);router[_0x50ca('0xa')](_0x50ca('0x10'),auth[_0x50ca('0xb')](),controller[_0x50ca('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x50ca('0x12')]);router[_0x50ca('0x13')](_0x50ca('0xe'),auth[_0x50ca('0xb')](),controller[_0x50ca('0x14')]);router[_0x50ca('0x15')](_0x50ca('0xc'),auth[_0x50ca('0xb')](),controller[_0x50ca('0x16')]);router[_0x50ca('0x17')](_0x50ca('0xc'),auth[_0x50ca('0xb')](),controller[_0x50ca('0x18')]);module[_0x50ca('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 8163150..7b117c4 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 _0x5222=['sequelize','STRING','username','remoteUri'];(function(_0x2037b0,_0xf9a7fa){var _0x43ca2c=function(_0x5180c0){while(--_0x5180c0){_0x2037b0['push'](_0x2037b0['shift']());}};_0x43ca2c(++_0xf9a7fa);}(_0x5222,0x1d8));var _0x2522=function(_0x35928b,_0x53890f){_0x35928b=_0x35928b-0x0;var _0x486edb=_0x5222[_0x35928b];return _0x486edb;};'use strict';var Sequelize=require(_0x2522('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2522('0x1')]},'username':{'type':Sequelize[_0x2522('0x1')],'unique':_0x2522('0x2')},'password':{'type':Sequelize[_0x2522('0x1')]},'email':{'type':Sequelize[_0x2522('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x2522('0x3')},'serverUrl':{'type':Sequelize[_0x2522('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc186=['remoteUri','sequelize','STRING','username'];(function(_0x3ecd69,_0x38156d){var _0x211b0e=function(_0x5f50b7){while(--_0x5f50b7){_0x3ecd69['push'](_0x3ecd69['shift']());}};_0x211b0e(++_0x38156d);}(_0xc186,0x19d));var _0x6c18=function(_0x232baa,_0x30d64c){_0x232baa=_0x232baa-0x0;var _0x18393e=_0xc186[_0x232baa];return _0x18393e;};'use strict';var Sequelize=require(_0x6c18('0x0'));module['exports']={'name':{'type':Sequelize[_0x6c18('0x1')]},'description':{'type':Sequelize[_0x6c18('0x1')]},'username':{'type':Sequelize[_0x6c18('0x1')],'unique':_0x6c18('0x2')},'password':{'type':Sequelize[_0x6c18('0x1')]},'email':{'type':Sequelize[_0x6c18('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6c18('0x3')},'serverUrl':{'type':Sequelize[_0x6c18('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 e908337..f9698ce 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 _0x273c=['true','False','GET','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','include','rows','catch','show','length','includeAll','create','body','find','params','getConfigurations','findOne','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','subcategory','work_notes','short_description','close_code','work_start','business_stc','description','calendar_duration','sys_class_name','close_notes','follow_up','contact_type','problem_id','company','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True'];(function(_0x552804,_0x3c3d1e){var _0x32be66=function(_0x14c213){while(--_0x14c213){_0x552804['push'](_0x552804['shift']());}};_0x32be66(++_0x3c3d1e);}(_0x273c,0x17d));var _0xc273=function(_0x12e6e5,_0x39855b){_0x12e6e5=_0x12e6e5-0x0;var _0x4ef6ce=_0x273c[_0x12e6e5];return _0x4ef6ce;};'use strict';var emlformat=require(_0xc273('0x0'));var rimraf=require(_0xc273('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc273('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc273('0x3'));var Mustache=require(_0xc273('0x4'));var util=require(_0xc273('0x5'));var path=require(_0xc273('0x6'));var sox=require(_0xc273('0x7'));var csv=require(_0xc273('0x8'));var ejs=require(_0xc273('0x9'));var fs=require('fs');var fs_extra=require(_0xc273('0xa'));var _=require('lodash');var squel=require(_0xc273('0xb'));var crypto=require(_0xc273('0xc'));var jsforce=require(_0xc273('0xd'));var deskjs=require(_0xc273('0xe'));var toCsv=require(_0xc273('0x8'));var querystring=require(_0xc273('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc273('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc273('0x11'));var hardwareService=require(_0xc273('0x12'));var logger=require(_0xc273('0x13'))('api');var utils=require(_0xc273('0x14'));var config=require(_0xc273('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc273('0x16'))['db'];var integrations=require(_0xc273('0x17'));function respondWithStatusCode(_0x32b171,_0x13faa9){_0x13faa9=_0x13faa9||0xcc;return function(_0x3cf370){if(_0x3cf370){return _0x32b171['sendStatus'](_0x13faa9);}return _0x32b171['status'](_0x13faa9)[_0xc273('0x18')]();};}function respondWithResult(_0x16d482,_0x1bdba2){_0x1bdba2=_0x1bdba2||0xc8;return function(_0x22b468){if(_0x22b468){return _0x16d482[_0xc273('0x19')](_0x1bdba2)['json'](_0x22b468);}};}function respondWithFilteredResult(_0xcd7e1c,_0xfa69a6){return function(_0x3e22ba){if(_0x3e22ba){var _0x3165f9=typeof _0xfa69a6[_0xc273('0x1a')]===_0xc273('0x1b')&&typeof _0xfa69a6[_0xc273('0x1c')]==='undefined';var _0x3194b5=_0x3e22ba[_0xc273('0x1d')];var _0x23b673=_0x3165f9?0x0:_0xfa69a6['offset'];var _0x45c489=_0x3165f9?_0x3e22ba['count']:_0xfa69a6['offset']+_0xfa69a6[_0xc273('0x1c')];var _0x3daa60;if(_0x45c489>=_0x3194b5){_0x45c489=_0x3194b5;_0x3daa60=0xc8;}else{_0x3daa60=0xce;}_0xcd7e1c['status'](_0x3daa60);return _0xcd7e1c[_0xc273('0x1e')](_0xc273('0x1f'),_0x23b673+'-'+_0x45c489+'/'+_0x3194b5)[_0xc273('0x20')](_0x3e22ba);}return null;};}function patchUpdates(_0x705721){return function(_0x4bd88d){try{jsonpatch[_0xc273('0x21')](_0x4bd88d,_0x705721,!![]);}catch(_0x184d5b){return BPromise[_0xc273('0x22')](_0x184d5b);}return _0x4bd88d['save']();};}function saveUpdates(_0x105156,_0xbed904){return function(_0x45f5fc){if(_0x45f5fc){return _0x45f5fc[_0xc273('0x23')](_0x105156)[_0xc273('0x24')](function(_0x3c858d){return _0x3c858d;});}return null;};}function removeEntity(_0x9f1c3d,_0x13f11a){return function(_0x3eb0bb){if(_0x3eb0bb){return _0x3eb0bb[_0xc273('0x25')]()['then'](function(){_0x9f1c3d[_0xc273('0x19')](0xcc)[_0xc273('0x18')]();});}};}function handleEntityNotFound(_0x6ddf58,_0x40bf8b){return function(_0x1ce84f){if(!_0x1ce84f){_0x6ddf58['sendStatus'](0x194);}return _0x1ce84f;};}function handleError(_0x15d22f,_0x214ff9){_0x214ff9=_0x214ff9||0x1f4;return function(_0xbda4f2){logger[_0xc273('0x26')](_0xbda4f2[_0xc273('0x27')]);if(_0xbda4f2['name']){delete _0xbda4f2['name'];}_0x15d22f[_0xc273('0x19')](_0x214ff9)[_0xc273('0x28')](_0xbda4f2);};}exports[_0xc273('0x29')]=function(_0x41ba5f,_0x29797d){var _0x4d5705={},_0xa62533={},_0x470af1={'count':0x0,'rows':[]};var _0x18973e=_['map'](db[_0xc273('0x2a')][_0xc273('0x2b')],function(_0x5297aa){return{'name':_0x5297aa[_0xc273('0x2c')],'type':_0x5297aa[_0xc273('0x2d')][_0xc273('0x2e')]};});_0xa62533['model']=_[_0xc273('0x2f')](_0x18973e,_0xc273('0x30'));_0xa62533[_0xc273('0x31')]=_[_0xc273('0x32')](_0x41ba5f[_0xc273('0x31')]);_0xa62533[_0xc273('0x33')]=_[_0xc273('0x34')](_0xa62533[_0xc273('0x35')],_0xa62533['query']);_0x4d5705[_0xc273('0x36')]=_[_0xc273('0x34')](_0xa62533[_0xc273('0x35')],qs['fields'](_0x41ba5f[_0xc273('0x31')][_0xc273('0x37')]));_0x4d5705[_0xc273('0x36')]=_0x4d5705[_0xc273('0x36')]['length']?_0x4d5705['attributes']:_0xa62533[_0xc273('0x35')];if(!_0x41ba5f[_0xc273('0x31')][_0xc273('0x38')](_0xc273('0x39'))){_0x4d5705[_0xc273('0x1c')]=qs[_0xc273('0x1c')](_0x41ba5f[_0xc273('0x31')]['limit']);_0x4d5705['offset']=qs['offset'](_0x41ba5f[_0xc273('0x31')][_0xc273('0x1a')]);}_0x4d5705[_0xc273('0x3a')]=qs['sort'](_0x41ba5f[_0xc273('0x31')]['sort']);_0x4d5705['where']=qs[_0xc273('0x33')](_['pick'](_0x41ba5f['query'],_0xa62533[_0xc273('0x33')]),_0x18973e);if(_0x41ba5f[_0xc273('0x31')][_0xc273('0x3b')]){_0x4d5705[_0xc273('0x3c')]=_[_0xc273('0x3d')](_0x4d5705[_0xc273('0x3c')],{'$or':_[_0xc273('0x2f')](_0x18973e,function(_0x33fed0){if(_0x33fed0[_0xc273('0x2d')]!==_0xc273('0x3e')){var _0x44fe54={};_0x44fe54[_0x33fed0['name']]={'$like':'%'+_0x41ba5f[_0xc273('0x31')][_0xc273('0x3b')]+'%'};return _0x44fe54;}})});}_0x4d5705=_[_0xc273('0x3d')]({},_0x4d5705,_0x41ba5f[_0xc273('0x3f')]);var _0x536464={'where':_0x4d5705[_0xc273('0x3c')]};return db[_0xc273('0x2a')]['count'](_0x536464)[_0xc273('0x24')](function(_0x516d93){_0x470af1['count']=_0x516d93;if(_0x41ba5f['query']['includeAll']){_0x4d5705[_0xc273('0x40')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x4d5705);})[_0xc273('0x24')](function(_0x3ff9cd){_0x470af1[_0xc273('0x41')]=_0x3ff9cd;return _0x470af1;})['then'](respondWithFilteredResult(_0x29797d,_0x4d5705))[_0xc273('0x42')](handleError(_0x29797d,null));};exports[_0xc273('0x43')]=function(_0x32663e,_0x2ddd5e){var _0x7f769d={'raw':![],'where':{'id':_0x32663e['params']['id']}},_0xc49679={};_0xc49679['model']=_['keys'](db['ServicenowAccount'][_0xc273('0x2b')]);_0xc49679[_0xc273('0x31')]=_[_0xc273('0x32')](_0x32663e['query']);_0xc49679['filters']=_[_0xc273('0x34')](_0xc49679['model'],_0xc49679['query']);_0x7f769d[_0xc273('0x36')]=_[_0xc273('0x34')](_0xc49679[_0xc273('0x35')],qs['fields'](_0x32663e['query'][_0xc273('0x37')]));_0x7f769d[_0xc273('0x36')]=_0x7f769d[_0xc273('0x36')][_0xc273('0x44')]?_0x7f769d[_0xc273('0x36')]:_0xc49679[_0xc273('0x35')];if(_0x32663e[_0xc273('0x31')][_0xc273('0x45')]){_0x7f769d['include']=[{'all':!![]}];}_0x7f769d=_[_0xc273('0x3d')]({},_0x7f769d,_0x32663e[_0xc273('0x3f')]);return db[_0xc273('0x2a')]['find'](_0x7f769d)[_0xc273('0x24')](handleEntityNotFound(_0x2ddd5e,null))[_0xc273('0x24')](respondWithResult(_0x2ddd5e,null))[_0xc273('0x42')](handleError(_0x2ddd5e,null));};exports[_0xc273('0x46')]=function(_0x1a4569,_0x4ec159){return db['ServicenowAccount'][_0xc273('0x46')](_0x1a4569['body'],{})['then'](respondWithResult(_0x4ec159,0xc9))['catch'](handleError(_0x4ec159,null));};exports[_0xc273('0x23')]=function(_0x3bce32,_0x299156){if(_0x3bce32[_0xc273('0x47')]['id']){delete _0x3bce32['body']['id'];}return db[_0xc273('0x2a')][_0xc273('0x48')]({'where':{'id':_0x3bce32[_0xc273('0x49')]['id']}})[_0xc273('0x24')](handleEntityNotFound(_0x299156,null))['then'](saveUpdates(_0x3bce32[_0xc273('0x47')],null))[_0xc273('0x24')](respondWithResult(_0x299156,null))[_0xc273('0x42')](handleError(_0x299156,null));};exports['destroy']=function(_0x3ad5d3,_0xfbf6fb){return db[_0xc273('0x2a')][_0xc273('0x48')]({'where':{'id':_0x3ad5d3[_0xc273('0x49')]['id']}})['then'](handleEntityNotFound(_0xfbf6fb,null))[_0xc273('0x24')](removeEntity(_0xfbf6fb,null))[_0xc273('0x42')](handleError(_0xfbf6fb,null));};exports[_0xc273('0x4a')]=function(_0x418670,_0x2525c9,_0x210d60){var _0x36644a={};var _0x256479={};var _0x51ebac;var _0x46fd0f;return db['ServicenowAccount'][_0xc273('0x4b')]({'where':{'id':_0x418670[_0xc273('0x49')]['id']}})[_0xc273('0x24')](handleEntityNotFound(_0x2525c9,null))[_0xc273('0x24')](function(_0xc34ff0){if(_0xc34ff0){_0x51ebac=_0xc34ff0;_0x256479[_0xc273('0x35')]=_[_0xc273('0x32')](db[_0xc273('0x4c')][_0xc273('0x2b')]);_0x256479[_0xc273('0x31')]=_[_0xc273('0x32')](_0x418670['query']);_0x256479['filters']=_[_0xc273('0x34')](_0x256479[_0xc273('0x35')],_0x256479[_0xc273('0x31')]);_0x36644a[_0xc273('0x36')]=_[_0xc273('0x34')](_0x256479[_0xc273('0x35')],qs[_0xc273('0x37')](_0x418670['query']['fields']));_0x36644a[_0xc273('0x36')]=_0x36644a['attributes']['length']?_0x36644a['attributes']:_0x256479[_0xc273('0x35')];_0x36644a[_0xc273('0x3a')]=qs['sort'](_0x418670[_0xc273('0x31')]['sort']);_0x36644a[_0xc273('0x3c')]=qs[_0xc273('0x33')](_[_0xc273('0x4d')](_0x418670[_0xc273('0x31')],_0x256479[_0xc273('0x33')]));if(_0x418670[_0xc273('0x31')]['filter']){_0x36644a['where']=_['merge'](_0x36644a[_0xc273('0x3c')],{'$or':_['map'](_0x36644a[_0xc273('0x36')],function(_0x100554){var _0x51d752={};_0x51d752[_0x100554]={'$like':'%'+_0x418670['query']['filter']+'%'};return _0x51d752;})});}_0x36644a=_[_0xc273('0x3d')]({},_0x36644a,_0x418670[_0xc273('0x3f')]);return _0x51ebac[_0xc273('0x4a')](_0x36644a);}})[_0xc273('0x24')](function(_0x4e2ee8){if(_0x4e2ee8){_0x46fd0f=_0x4e2ee8[_0xc273('0x44')];if(!_0x418670['query'][_0xc273('0x38')](_0xc273('0x39'))){_0x36644a[_0xc273('0x1c')]=qs[_0xc273('0x1c')](_0x418670[_0xc273('0x31')]['limit']);_0x36644a[_0xc273('0x1a')]=qs['offset'](_0x418670['query'][_0xc273('0x1a')]);}return _0x51ebac[_0xc273('0x4a')](_0x36644a);}})[_0xc273('0x24')](function(_0x159b0f){if(_0x159b0f){return _0x159b0f?{'count':_0x46fd0f,'rows':_0x159b0f}:null;}})[_0xc273('0x24')](respondWithResult(_0x2525c9,null))[_0xc273('0x42')](handleError(_0x2525c9,null));};exports[_0xc273('0x4e')]=function(_0x1c0eb3,_0x1d26e9,_0x4b10f0){if(_0x1c0eb3[_0xc273('0x47')]['id']){delete _0x1c0eb3[_0xc273('0x47')]['id'];}return db[_0xc273('0x2a')][_0xc273('0x4b')]({'where':{'id':_0x1c0eb3[_0xc273('0x49')]['id']}})[_0xc273('0x24')](handleEntityNotFound(_0x1d26e9,null))[_0xc273('0x24')](function(_0x48fc60){if(_0x48fc60){_0x1c0eb3[_0xc273('0x47')][_0xc273('0x4f')]=_0x48fc60['id'];_0x1c0eb3[_0xc273('0x47')][_0xc273('0x50')]=integrations[_0xc273('0x51')](_0x1c0eb3[_0xc273('0x47')][_0xc273('0x52')],_0x1c0eb3[_0xc273('0x47')][_0xc273('0x2d')]);_0x1c0eb3[_0xc273('0x47')][_0xc273('0x53')]=integrations[_0xc273('0x54')](_0x1c0eb3['body']['channel'],_0x1c0eb3[_0xc273('0x47')][_0xc273('0x2d')]);return db[_0xc273('0x4c')][_0xc273('0x46')](_0x1c0eb3[_0xc273('0x47')],{'include':[{'model':db[_0xc273('0x55')],'as':_0xc273('0x50')},{'model':db[_0xc273('0x55')],'as':_0xc273('0x53')}]});}return null;})[_0xc273('0x24')](respondWithResult(_0x1d26e9,null))['catch'](handleError(_0x1d26e9,null));};exports[_0xc273('0x56')]=function(_0x3b920b,_0xb3e95a,_0x312bc2){var _0x5c2c2f=[_0xc273('0x57'),_0xc273('0x58'),_0xc273('0x59'),'subcategory','close_code',_0xc273('0x5a'),_0xc273('0x5b'),_0xc273('0x5c'),_0xc273('0x5d')];var _0x3fcf3f=[_0xc273('0x5e'),'made_sla',_0xc273('0x5f'),_0xc273('0x60'),_0xc273('0x61'),_0xc273('0x62'),_0xc273('0x63'),_0xc273('0x58'),_0xc273('0x64'),'number',_0xc273('0x65'),_0xc273('0x66'),'opened_by',_0xc273('0x67'),_0xc273('0x68'),_0xc273('0x69'),_0xc273('0x6a'),_0xc273('0x6b'),'knowledge',_0xc273('0x3a'),_0xc273('0x6c'),'closed_at',_0xc273('0x6d'),_0xc273('0x6e'),'impact',_0xc273('0x6f'),_0xc273('0x70'),_0xc273('0x71'),_0xc273('0x72'),_0xc273('0x73'),_0xc273('0x74'),'time_worked',_0xc273('0x75'),'opened_at',_0xc273('0x76'),'group_list',_0xc273('0x77'),_0xc273('0x78'),_0xc273('0x79'),_0xc273('0x7a'),_0xc273('0x7b'),_0xc273('0x7c'),_0xc273('0x7d'),_0xc273('0x7e'),_0xc273('0x7f'),'correlation_display','delivery_task',_0xc273('0x80'),'assignment_group',_0xc273('0x81'),'additional_assignee_list',_0xc273('0x82'),_0xc273('0x83'),_0xc273('0x5a'),_0xc273('0x84'),_0xc273('0x85'),'closed_by',_0xc273('0x86'),'parent_incident','sys_id',_0xc273('0x87'),'reopened_by',_0xc273('0x5b'),'urgency',_0xc273('0x88'),_0xc273('0x89'),'reassignment_count','activity_due',_0xc273('0x8a'),_0xc273('0x5c'),_0xc273('0x8b'),_0xc273('0x8c'),_0xc273('0x8d'),_0xc273('0x8e'),_0xc273('0x8f'),'sys_mod_count',_0xc273('0x90'),_0xc273('0x91'),_0xc273('0x92'),_0xc273('0x93'),_0xc273('0x94'),_0xc273('0x95'),'category'];var _0x55e8ee='';var _0x2567a5='';var _0x4079e0=[];var _0x5eaed0='';var _0x1f3459='';var _0x310eff=[];var _0x39ae57='';var _0x36fe56='';var _0x40f3e1={};var _0x45a474='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x3b920b['params']['id']},'attributes':['id',_0xc273('0x96'),_0xc273('0x97'),_0xc273('0x98'),_0xc273('0x99'),_0xc273('0x9a')]})['then'](handleEntityNotFound(_0xb3e95a,null))[_0xc273('0x24')](function(_0x382b28){if(_0x382b28){_0x45a474=_0x382b28[_0xc273('0x99')];var _0x437870=_0x45a474['slice'](-0x1);if(_0x437870==='/'){_0x45a474=_0x45a474['substring'](0x0,_0x45a474[_0xc273('0x9b')](_0x437870));}_0x36fe56=util[_0xc273('0x9c')](_0xc273('0x9d'),_0x45a474);_0x39ae57=util['format'](_0xc273('0x9e'),_0x45a474);_0x40f3e1={'user':_0x382b28[_0xc273('0x96')],'pass':_0x382b28[_0xc273('0x97')]};var _0x253f4d={'method':'GET','uri':_0x36fe56+_0xc273('0x9f'),'auth':_0x40f3e1,'json':!![]};return rp(_0x253f4d);}})[_0xc273('0x24')](function(_0xa21c5a){if(_0xa21c5a[_0xc273('0xa0')][_0xc273('0x44')]>0x0){_0x55e8ee=_0xa21c5a[_0xc273('0xa0')];}console[_0xc273('0xa1')](_0xc273('0xa2'),_0x55e8ee);_0x310eff=[];_0x2567a5=Object['assign']([],_0x55e8ee);_[_0xc273('0xa3')](_0x2567a5,function(_0x3d41e2){return!_0x5c2c2f[_0xc273('0xa4')](_0x3d41e2[_0xc273('0x30')]);});_0x2567a5[_0xc273('0xa5')](function(_0x296b00){var _0x4f1de6=createFieldObject(_0x39ae57,_0x40f3e1,_0x296b00[_0xc273('0xa6')],_0x296b00['name'],_0x296b00[_0xc273('0xa7')],![]);_0x310eff[_0xc273('0xa8')](_0x4f1de6);});return Promise[_0xc273('0xa9')](_0x310eff);})[_0xc273('0x24')](function(_0x3c2b25){_0x4079e0=_0x3c2b25;_0x5eaed0=Object[_0xc273('0xaa')]([],_0x55e8ee);console['log'](_0xc273('0xab'),_0x55e8ee);_[_0xc273('0xa3')](_0x5eaed0,function(_0x2fc8c7){return _0x3fcf3f[_0xc273('0xa4')](_0x2fc8c7[_0xc273('0x30')]);});console[_0xc273('0xa1')](_0xc273('0xac'),_0x5eaed0);_0x310eff=[];_0x5eaed0[_0xc273('0xa5')](function(_0x239025){var _0x3ba711=createFieldObject(_0x39ae57,_0x40f3e1,_0x239025['internalType'],_0x239025['name'],_0x239025[_0xc273('0xa7')],!![]);_0x310eff[_0xc273('0xa8')](_0x3ba711);});return Promise['all'](_0x310eff);})['then'](function(_0x48e734){_0x1f3459=_0x48e734;var _0x5b6f47=_0x4079e0[_0xc273('0xad')](_0x1f3459);return{'count':_0x5b6f47[_0xc273('0x44')],'rows':_0x5b6f47};})[_0xc273('0x24')](respondWithResult(_0xb3e95a,null))[_0xc273('0x42')](function(_0xb8d860){console[_0xc273('0xa1')](_0xc273('0xae')+_0xb8d860);var _0x490f08=_0x3b920b[_0xc273('0x31')][_0xc273('0xaf')]?0x1f4:_0xb8d860[_0xc273('0xb0')]||0x1f4;logger[_0xc273('0x26')](_0xb8d860[_0xc273('0x27')]);delete _0xb8d860[_0xc273('0x30')];if(_0x490f08===0x191){_0x490f08=0x190;}_0xb3e95a['status'](_0x490f08)['send'](_0x3b920b[_0xc273('0x31')][_0xc273('0xaf')]?{'message':_0xc273('0xb1'),'statusCode':_0xb8d860['statusCode']}:_0xb8d860);});};function createFieldObject(_0x1ab177,_0x5772e3,_0x13be9d,_0x1f5be1,_0x2f3e68,_0xb90fe2){return new Promise(function(_0x38768a,_0x4df167){var _0x2fef57={'id':_0x1f5be1,'name':_0x2f3e68,'custom':_0xb90fe2};if(_0x13be9d===_0xc273('0xb2')){_0x2fef57[_0xc273('0x3f')]=[{'name':_0xc273('0xb3'),'value':_0xc273('0xb4')},{'name':_0xc273('0xb5'),'value':'false'}];_0x38768a(_0x2fef57);}else{var _0x520443={'method':_0xc273('0xb6'),'uri':_0x1ab177+_0xc273('0xb7')+_0x1f5be1,'auth':_0x5772e3,'json':!![]};return rp(_0x520443)[_0xc273('0x24')](function(_0x22f5b8){var _0x224de7=[];if(_0x22f5b8[_0xc273('0xa0')][_0xc273('0x44')]>0x0){_0x22f5b8['result'][_0xc273('0xa5')](function(_0x24b752){if(_0x24b752[_0xc273('0xb8')]===_0xc273('0xb9')){var _0x159db8={'name':_0x24b752[_0xc273('0xa7')],'value':_0x24b752[_0xc273('0xba')]};_0x224de7[_0xc273('0xa8')](_0x159db8);}});}_0x2fef57[_0xc273('0x3f')]=_0x224de7;if(_0x2fef57[_0xc273('0x3f')][_0xc273('0x44')]>0x0){_0x38768a(_0x2fef57);}else{if(_0xb90fe2==![]){_0x38768a();}else{_0x38768a(_0x2fef57);}}});}});} \ No newline at end of file +var _0xb181=['pick','filter','merge','then','includeAll','include','findAll','rows','catch','params','keys','length','options','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ServicenowField','Subjects','getFields','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','made_sla','caused_by','child_incidents','resolved_by','opened_by','user_input','sys_domain','state','calendar_stc','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','problem_id','assigned_to','comments','approval','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','username','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','internalType','push','all','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5cc655,_0x4b6145){var _0x244379=function(_0x30d2c5){while(--_0x30d2c5){_0x5cc655['push'](_0x5cc655['shift']());}};_0x244379(++_0x4b6145);}(_0xb181,0x1da));var _0x1b18=function(_0x4f187e,_0x55f880){_0x4f187e=_0x4f187e-0x0;var _0x19ce4a=_0xb181[_0x4f187e];return _0x19ce4a;};'use strict';var emlformat=require(_0x1b18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b18('0x1'));var jsonpatch=require(_0x1b18('0x2'));var rp=require('request-promise');var moment=require(_0x1b18('0x3'));var BPromise=require(_0x1b18('0x4'));var Mustache=require(_0x1b18('0x5'));var util=require(_0x1b18('0x6'));var path=require(_0x1b18('0x7'));var sox=require('sox');var csv=require(_0x1b18('0x8'));var ejs=require(_0x1b18('0x9'));var fs=require('fs');var fs_extra=require(_0x1b18('0xa'));var _=require('lodash');var squel=require(_0x1b18('0xb'));var crypto=require('crypto');var jsforce=require(_0x1b18('0xc'));var deskjs=require(_0x1b18('0xd'));var toCsv=require(_0x1b18('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1b18('0xe'));var qs=require(_0x1b18('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1b18('0x10'));var config=require(_0x1b18('0x11'));var licenseUtil=require(_0x1b18('0x12'));var db=require(_0x1b18('0x13'))['db'];var integrations=require(_0x1b18('0x14'));function respondWithStatusCode(_0x30529e,_0x339693){_0x339693=_0x339693||0xcc;return function(_0x2da25b){if(_0x2da25b){return _0x30529e[_0x1b18('0x15')](_0x339693);}return _0x30529e[_0x1b18('0x16')](_0x339693)[_0x1b18('0x17')]();};}function respondWithResult(_0x2b2c64,_0x569bc7){_0x569bc7=_0x569bc7||0xc8;return function(_0x4ec120){if(_0x4ec120){return _0x2b2c64[_0x1b18('0x16')](_0x569bc7)[_0x1b18('0x18')](_0x4ec120);}};}function respondWithFilteredResult(_0x2f7c64,_0x4a3261){return function(_0x2406ac){if(_0x2406ac){var _0x542855=typeof _0x4a3261[_0x1b18('0x19')]===_0x1b18('0x1a')&&typeof _0x4a3261[_0x1b18('0x1b')]===_0x1b18('0x1a');var _0x4c0446=_0x2406ac['count'];var _0x3514b1=_0x542855?0x0:_0x4a3261[_0x1b18('0x19')];var _0x536b2d=_0x542855?_0x2406ac[_0x1b18('0x1c')]:_0x4a3261['offset']+_0x4a3261[_0x1b18('0x1b')];var _0xbc5f88;if(_0x536b2d>=_0x4c0446){_0x536b2d=_0x4c0446;_0xbc5f88=0xc8;}else{_0xbc5f88=0xce;}_0x2f7c64[_0x1b18('0x16')](_0xbc5f88);return _0x2f7c64[_0x1b18('0x1d')](_0x1b18('0x1e'),_0x3514b1+'-'+_0x536b2d+'/'+_0x4c0446)[_0x1b18('0x18')](_0x2406ac);}return null;};}function patchUpdates(_0x4b61b9){return function(_0x11c449){try{jsonpatch[_0x1b18('0x1f')](_0x11c449,_0x4b61b9,!![]);}catch(_0x5c36a3){return BPromise[_0x1b18('0x20')](_0x5c36a3);}return _0x11c449[_0x1b18('0x21')]();};}function saveUpdates(_0x38e32c,_0x19644a){return function(_0x4eebf4){if(_0x4eebf4){return _0x4eebf4['update'](_0x38e32c)['then'](function(_0x2bd875){return _0x2bd875;});}return null;};}function removeEntity(_0x479c66,_0x217f8e){return function(_0x3ef301){if(_0x3ef301){return _0x3ef301[_0x1b18('0x22')]()['then'](function(){_0x479c66[_0x1b18('0x16')](0xcc)[_0x1b18('0x17')]();});}};}function handleEntityNotFound(_0x3e37a3,_0x5b4af6){return function(_0x556db0){if(!_0x556db0){_0x3e37a3['sendStatus'](0x194);}return _0x556db0;};}function handleError(_0x15b02a,_0x11443d){_0x11443d=_0x11443d||0x1f4;return function(_0x588edc){logger[_0x1b18('0x23')](_0x588edc[_0x1b18('0x24')]);if(_0x588edc[_0x1b18('0x25')]){delete _0x588edc[_0x1b18('0x25')];}_0x15b02a[_0x1b18('0x16')](_0x11443d)[_0x1b18('0x26')](_0x588edc);};}exports[_0x1b18('0x27')]=function(_0x220280,_0x56c991){var _0x6a93fc={},_0x25bfad={},_0x14aa1a={'count':0x0,'rows':[]};var _0x1d171a=_['map'](db[_0x1b18('0x28')][_0x1b18('0x29')],function(_0x366666){return{'name':_0x366666[_0x1b18('0x2a')],'type':_0x366666[_0x1b18('0x2b')][_0x1b18('0x2c')]};});_0x25bfad[_0x1b18('0x2d')]=_[_0x1b18('0x2e')](_0x1d171a,_0x1b18('0x25'));_0x25bfad[_0x1b18('0x2f')]=_['keys'](_0x220280[_0x1b18('0x2f')]);_0x25bfad[_0x1b18('0x30')]=_[_0x1b18('0x31')](_0x25bfad[_0x1b18('0x2d')],_0x25bfad[_0x1b18('0x2f')]);_0x6a93fc[_0x1b18('0x32')]=_['intersection'](_0x25bfad[_0x1b18('0x2d')],qs[_0x1b18('0x33')](_0x220280[_0x1b18('0x2f')]['fields']));_0x6a93fc[_0x1b18('0x32')]=_0x6a93fc['attributes']['length']?_0x6a93fc[_0x1b18('0x32')]:_0x25bfad[_0x1b18('0x2d')];if(!_0x220280[_0x1b18('0x2f')][_0x1b18('0x34')](_0x1b18('0x35'))){_0x6a93fc[_0x1b18('0x1b')]=qs['limit'](_0x220280[_0x1b18('0x2f')][_0x1b18('0x1b')]);_0x6a93fc[_0x1b18('0x19')]=qs[_0x1b18('0x19')](_0x220280[_0x1b18('0x2f')][_0x1b18('0x19')]);}_0x6a93fc[_0x1b18('0x36')]=qs[_0x1b18('0x37')](_0x220280[_0x1b18('0x2f')]['sort']);_0x6a93fc[_0x1b18('0x38')]=qs[_0x1b18('0x30')](_[_0x1b18('0x39')](_0x220280['query'],_0x25bfad[_0x1b18('0x30')]),_0x1d171a);if(_0x220280[_0x1b18('0x2f')][_0x1b18('0x3a')]){_0x6a93fc[_0x1b18('0x38')]=_[_0x1b18('0x3b')](_0x6a93fc[_0x1b18('0x38')],{'$or':_[_0x1b18('0x2e')](_0x1d171a,function(_0x5c8df2){if(_0x5c8df2[_0x1b18('0x2b')]!=='VIRTUAL'){var _0x2f3ccd={};_0x2f3ccd[_0x5c8df2[_0x1b18('0x25')]]={'$like':'%'+_0x220280[_0x1b18('0x2f')][_0x1b18('0x3a')]+'%'};return _0x2f3ccd;}})});}_0x6a93fc=_[_0x1b18('0x3b')]({},_0x6a93fc,_0x220280['options']);var _0x46cded={'where':_0x6a93fc['where']};return db[_0x1b18('0x28')][_0x1b18('0x1c')](_0x46cded)[_0x1b18('0x3c')](function(_0x532a51){_0x14aa1a[_0x1b18('0x1c')]=_0x532a51;if(_0x220280[_0x1b18('0x2f')][_0x1b18('0x3d')]){_0x6a93fc[_0x1b18('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x1b18('0x3f')](_0x6a93fc);})[_0x1b18('0x3c')](function(_0x42b815){_0x14aa1a[_0x1b18('0x40')]=_0x42b815;return _0x14aa1a;})[_0x1b18('0x3c')](respondWithFilteredResult(_0x56c991,_0x6a93fc))[_0x1b18('0x41')](handleError(_0x56c991,null));};exports['show']=function(_0x49cd28,_0xe2c311){var _0x2b3c7c={'raw':![],'where':{'id':_0x49cd28[_0x1b18('0x42')]['id']}},_0x5edb76={};_0x5edb76[_0x1b18('0x2d')]=_[_0x1b18('0x43')](db[_0x1b18('0x28')][_0x1b18('0x29')]);_0x5edb76[_0x1b18('0x2f')]=_['keys'](_0x49cd28[_0x1b18('0x2f')]);_0x5edb76['filters']=_['intersection'](_0x5edb76[_0x1b18('0x2d')],_0x5edb76[_0x1b18('0x2f')]);_0x2b3c7c[_0x1b18('0x32')]=_[_0x1b18('0x31')](_0x5edb76[_0x1b18('0x2d')],qs[_0x1b18('0x33')](_0x49cd28[_0x1b18('0x2f')]['fields']));_0x2b3c7c['attributes']=_0x2b3c7c[_0x1b18('0x32')][_0x1b18('0x44')]?_0x2b3c7c['attributes']:_0x5edb76[_0x1b18('0x2d')];if(_0x49cd28['query'][_0x1b18('0x3d')]){_0x2b3c7c[_0x1b18('0x3e')]=[{'all':!![]}];}_0x2b3c7c=_['merge']({},_0x2b3c7c,_0x49cd28[_0x1b18('0x45')]);return db[_0x1b18('0x28')][_0x1b18('0x46')](_0x2b3c7c)[_0x1b18('0x3c')](handleEntityNotFound(_0xe2c311,null))['then'](respondWithResult(_0xe2c311,null))[_0x1b18('0x41')](handleError(_0xe2c311,null));};exports[_0x1b18('0x47')]=function(_0x55a2cb,_0x2a688e){return db['ServicenowAccount'][_0x1b18('0x47')](_0x55a2cb[_0x1b18('0x48')],{})[_0x1b18('0x3c')](respondWithResult(_0x2a688e,0xc9))[_0x1b18('0x41')](handleError(_0x2a688e,null));};exports[_0x1b18('0x49')]=function(_0x14b3b8,_0xe0d284){if(_0x14b3b8[_0x1b18('0x48')]['id']){delete _0x14b3b8[_0x1b18('0x48')]['id'];}return db[_0x1b18('0x28')]['find']({'where':{'id':_0x14b3b8[_0x1b18('0x42')]['id']}})[_0x1b18('0x3c')](handleEntityNotFound(_0xe0d284,null))[_0x1b18('0x3c')](saveUpdates(_0x14b3b8[_0x1b18('0x48')],null))['then'](respondWithResult(_0xe0d284,null))[_0x1b18('0x41')](handleError(_0xe0d284,null));};exports['destroy']=function(_0x1f04a8,_0xf06ace){return db[_0x1b18('0x28')]['find']({'where':{'id':_0x1f04a8[_0x1b18('0x42')]['id']}})[_0x1b18('0x3c')](handleEntityNotFound(_0xf06ace,null))[_0x1b18('0x3c')](removeEntity(_0xf06ace,null))[_0x1b18('0x41')](handleError(_0xf06ace,null));};exports[_0x1b18('0x4a')]=function(_0x4afda8,_0x476714,_0x43a19d){var _0x59422e={};var _0x347ba1={};var _0x3f310a;var _0x3c43a6;return db[_0x1b18('0x28')][_0x1b18('0x4b')]({'where':{'id':_0x4afda8['params']['id']}})[_0x1b18('0x3c')](handleEntityNotFound(_0x476714,null))[_0x1b18('0x3c')](function(_0x51b274){if(_0x51b274){_0x3f310a=_0x51b274;_0x347ba1['model']=_[_0x1b18('0x43')](db[_0x1b18('0x4c')][_0x1b18('0x29')]);_0x347ba1['query']=_[_0x1b18('0x43')](_0x4afda8['query']);_0x347ba1[_0x1b18('0x30')]=_[_0x1b18('0x31')](_0x347ba1['model'],_0x347ba1[_0x1b18('0x2f')]);_0x59422e[_0x1b18('0x32')]=_['intersection'](_0x347ba1[_0x1b18('0x2d')],qs[_0x1b18('0x33')](_0x4afda8[_0x1b18('0x2f')]['fields']));_0x59422e[_0x1b18('0x32')]=_0x59422e[_0x1b18('0x32')]['length']?_0x59422e[_0x1b18('0x32')]:_0x347ba1[_0x1b18('0x2d')];_0x59422e[_0x1b18('0x36')]=qs[_0x1b18('0x37')](_0x4afda8[_0x1b18('0x2f')][_0x1b18('0x37')]);_0x59422e['where']=qs[_0x1b18('0x30')](_[_0x1b18('0x39')](_0x4afda8[_0x1b18('0x2f')],_0x347ba1[_0x1b18('0x30')]));if(_0x4afda8[_0x1b18('0x2f')][_0x1b18('0x3a')]){_0x59422e[_0x1b18('0x38')]=_[_0x1b18('0x3b')](_0x59422e[_0x1b18('0x38')],{'$or':_[_0x1b18('0x2e')](_0x59422e[_0x1b18('0x32')],function(_0xbd734d){var _0x5f5787={};_0x5f5787[_0xbd734d]={'$like':'%'+_0x4afda8[_0x1b18('0x2f')][_0x1b18('0x3a')]+'%'};return _0x5f5787;})});}_0x59422e=_[_0x1b18('0x3b')]({},_0x59422e,_0x4afda8[_0x1b18('0x45')]);return _0x3f310a['getConfigurations'](_0x59422e);}})[_0x1b18('0x3c')](function(_0x17042f){if(_0x17042f){_0x3c43a6=_0x17042f['length'];if(!_0x4afda8[_0x1b18('0x2f')][_0x1b18('0x34')](_0x1b18('0x35'))){_0x59422e[_0x1b18('0x1b')]=qs['limit'](_0x4afda8[_0x1b18('0x2f')][_0x1b18('0x1b')]);_0x59422e[_0x1b18('0x19')]=qs['offset'](_0x4afda8['query'][_0x1b18('0x19')]);}return _0x3f310a['getConfigurations'](_0x59422e);}})[_0x1b18('0x3c')](function(_0x4e805f){if(_0x4e805f){return _0x4e805f?{'count':_0x3c43a6,'rows':_0x4e805f}:null;}})['then'](respondWithResult(_0x476714,null))[_0x1b18('0x41')](handleError(_0x476714,null));};exports[_0x1b18('0x4d')]=function(_0x5ac42a,_0x3ce825,_0x1655fb){if(_0x5ac42a['body']['id']){delete _0x5ac42a[_0x1b18('0x48')]['id'];}return db['ServicenowAccount'][_0x1b18('0x4b')]({'where':{'id':_0x5ac42a[_0x1b18('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ce825,null))[_0x1b18('0x3c')](function(_0x3f8481){if(_0x3f8481){_0x5ac42a[_0x1b18('0x48')][_0x1b18('0x4e')]=_0x3f8481['id'];_0x5ac42a['body']['Subjects']=integrations[_0x1b18('0x4f')](_0x5ac42a[_0x1b18('0x48')]['channel'],_0x5ac42a[_0x1b18('0x48')]['type']);_0x5ac42a['body'][_0x1b18('0x50')]=integrations[_0x1b18('0x51')](_0x5ac42a[_0x1b18('0x48')][_0x1b18('0x52')],_0x5ac42a[_0x1b18('0x48')][_0x1b18('0x2b')]);return db['ServicenowConfiguration'][_0x1b18('0x47')](_0x5ac42a['body'],{'include':[{'model':db[_0x1b18('0x53')],'as':_0x1b18('0x54')},{'model':db[_0x1b18('0x53')],'as':_0x1b18('0x50')}]});}return null;})[_0x1b18('0x3c')](respondWithResult(_0x3ce825,null))[_0x1b18('0x41')](handleError(_0x3ce825,null));};exports[_0x1b18('0x55')]=function(_0x137a5c,_0x2cf774,_0x44749f){var _0x4c63a6=['made_sla',_0x1b18('0x56'),_0x1b18('0x57'),_0x1b18('0x58'),_0x1b18('0x59'),_0x1b18('0x5a'),_0x1b18('0x5b'),_0x1b18('0x5c'),_0x1b18('0x5d')];var _0x4aebab=['parent',_0x1b18('0x5e'),_0x1b18('0x5f'),'watch_list','upon_reject','sys_updated_on',_0x1b18('0x60'),_0x1b18('0x56'),'approval_history','number',_0x1b18('0x61'),'sys_updated_by',_0x1b18('0x62'),_0x1b18('0x63'),'sys_created_on',_0x1b18('0x64'),_0x1b18('0x65'),'sys_created_by',_0x1b18('0x57'),_0x1b18('0x36'),_0x1b18('0x66'),'closed_at','cmdb_ci','delivery_plan','impact',_0x1b18('0x67'),'work_notes_list',_0x1b18('0x68'),_0x1b18('0x69'),_0x1b18('0x6a'),_0x1b18('0x6b'),_0x1b18('0x6c'),_0x1b18('0x6d'),'opened_at',_0x1b18('0x6e'),'group_list',_0x1b18('0x6f'),_0x1b18('0x70'),_0x1b18('0x71'),'caller_id',_0x1b18('0x72'),'subcategory',_0x1b18('0x73'),_0x1b18('0x74'),_0x1b18('0x59'),'correlation_display',_0x1b18('0x75'),'work_start',_0x1b18('0x76'),_0x1b18('0x77'),_0x1b18('0x78'),'description',_0x1b18('0x79'),'notify',_0x1b18('0x7a'),_0x1b18('0x7b'),_0x1b18('0x7c'),_0x1b18('0x7d'),'parent_incident',_0x1b18('0x7e'),_0x1b18('0x7f'),_0x1b18('0x80'),_0x1b18('0x5b'),'urgency',_0x1b18('0x81'),'company','reassignment_count','activity_due',_0x1b18('0x82'),_0x1b18('0x5c'),_0x1b18('0x83'),'sla_due',_0x1b18('0x84'),'comments_and_work_notes',_0x1b18('0x85'),_0x1b18('0x86'),_0x1b18('0x87'),_0x1b18('0x88'),_0x1b18('0x89'),_0x1b18('0x8a'),_0x1b18('0x8b'),_0x1b18('0x8c'),_0x1b18('0x5d')];var _0x8478c3='';var _0x1dd359='';var _0x24c37e=[];var _0xc1eb46='';var _0x9ab185='';var _0x5c219=[];var _0x4ad81f='';var _0x3fb489='';var _0x17b182={};var _0x297052='';return db['ServicenowAccount'][_0x1b18('0x4b')]({'where':{'id':_0x137a5c[_0x1b18('0x42')]['id']},'attributes':['id','username',_0x1b18('0x8d'),_0x1b18('0x8e'),'remoteUri',_0x1b18('0x8f')]})['then'](handleEntityNotFound(_0x2cf774,null))['then'](function(_0x2fc4ab){if(_0x2fc4ab){_0x297052=_0x2fc4ab[_0x1b18('0x90')];var _0x64c905=_0x297052[_0x1b18('0x91')](-0x1);if(_0x64c905==='/'){_0x297052=_0x297052[_0x1b18('0x92')](0x0,_0x297052[_0x1b18('0x93')](_0x64c905));}_0x3fb489=util[_0x1b18('0x94')]('%s/api/now/doc/table/schema/',_0x297052);_0x4ad81f=util[_0x1b18('0x94')]('%s/api/now/table/',_0x297052);_0x17b182={'user':_0x2fc4ab[_0x1b18('0x95')],'pass':_0x2fc4ab['password']};var _0x5c2441={'method':_0x1b18('0x96'),'uri':_0x3fb489+_0x1b18('0x97'),'auth':_0x17b182,'json':!![]};return rp(_0x5c2441);}})[_0x1b18('0x3c')](function(_0x59720d){if(_0x59720d[_0x1b18('0x98')][_0x1b18('0x44')]>0x0){_0x8478c3=_0x59720d['result'];}console['log'](_0x1b18('0x99'),_0x8478c3);_0x5c219=[];_0x1dd359=Object[_0x1b18('0x9a')]([],_0x8478c3);_['remove'](_0x1dd359,function(_0x433e25){return!_0x4c63a6[_0x1b18('0x9b')](_0x433e25[_0x1b18('0x25')]);});_0x1dd359[_0x1b18('0x9c')](function(_0x22f0b4){var _0x4c41db=createFieldObject(_0x4ad81f,_0x17b182,_0x22f0b4[_0x1b18('0x9d')],_0x22f0b4[_0x1b18('0x25')],_0x22f0b4['label'],![]);_0x5c219[_0x1b18('0x9e')](_0x4c41db);});return Promise[_0x1b18('0x9f')](_0x5c219);})[_0x1b18('0x3c')](function(_0x3e9f6a){_0x24c37e=_0x3e9f6a;_0xc1eb46=Object[_0x1b18('0x9a')]([],_0x8478c3);console[_0x1b18('0xa0')](_0x1b18('0xa1'),_0x8478c3);_[_0x1b18('0xa2')](_0xc1eb46,function(_0x307668){return _0x4aebab['includes'](_0x307668[_0x1b18('0x25')]);});console[_0x1b18('0xa0')](_0x1b18('0xa3'),_0xc1eb46);_0x5c219=[];_0xc1eb46[_0x1b18('0x9c')](function(_0x176b22){var _0xd60435=createFieldObject(_0x4ad81f,_0x17b182,_0x176b22[_0x1b18('0x9d')],_0x176b22['name'],_0x176b22[_0x1b18('0xa4')],!![]);_0x5c219[_0x1b18('0x9e')](_0xd60435);});return Promise[_0x1b18('0x9f')](_0x5c219);})[_0x1b18('0x3c')](function(_0xc9a28f){_0x9ab185=_0xc9a28f;var _0x299b38=_0x24c37e['concat'](_0x9ab185);return{'count':_0x299b38[_0x1b18('0x44')],'rows':_0x299b38};})[_0x1b18('0x3c')](respondWithResult(_0x2cf774,null))['catch'](function(_0x2460e6){console[_0x1b18('0xa0')](_0x1b18('0xa5')+_0x2460e6);var _0x454791=_0x137a5c[_0x1b18('0x2f')][_0x1b18('0xa6')]?0x1f4:_0x2460e6[_0x1b18('0xa7')]||0x1f4;logger[_0x1b18('0x23')](_0x2460e6['stack']);delete _0x2460e6['name'];if(_0x454791===0x191){_0x454791=0x190;}_0x2cf774[_0x1b18('0x16')](_0x454791)[_0x1b18('0x26')](_0x137a5c[_0x1b18('0x2f')][_0x1b18('0xa6')]?{'message':_0x1b18('0xa8'),'statusCode':_0x2460e6[_0x1b18('0xa7')]}:_0x2460e6);});};function createFieldObject(_0x22efdc,_0x5b67a5,_0x1ff480,_0x25ff99,_0x3940cb,_0xaef238){return new Promise(function(_0x48018b,_0x481716){var _0x422931={'id':_0x25ff99,'name':_0x3940cb,'custom':_0xaef238};if(_0x1ff480===_0x1b18('0xa9')){_0x422931[_0x1b18('0x45')]=[{'name':_0x1b18('0xaa'),'value':_0x1b18('0xab')},{'name':_0x1b18('0xac'),'value':_0x1b18('0xad')}];_0x48018b(_0x422931);}else{var _0x56b238={'method':_0x1b18('0x96'),'uri':_0x22efdc+_0x1b18('0xae')+_0x25ff99,'auth':_0x5b67a5,'json':!![]};return rp(_0x56b238)[_0x1b18('0x3c')](function(_0xa39857){var _0x472c8a=[];if(_0xa39857[_0x1b18('0x98')][_0x1b18('0x44')]>0x0){_0xa39857[_0x1b18('0x98')][_0x1b18('0x9c')](function(_0x357c88){if(_0x357c88[_0x1b18('0xaf')]===_0x1b18('0xad')){var _0x3461c2={'name':_0x357c88[_0x1b18('0xa4')],'value':_0x357c88[_0x1b18('0xb0')]};_0x472c8a['push'](_0x3461c2);}});}_0x422931[_0x1b18('0x45')]=_0x472c8a;if(_0x422931[_0x1b18('0x45')][_0x1b18('0x44')]>0x0){_0x48018b(_0x422931);}else{if(_0xaef238==![]){_0x48018b();}else{_0x48018b(_0x422931);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 3185fda..3cfd44c 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 _0xf2ca=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5e8c7c,_0x3429c6){_0x5e8c7c=_0x5e8c7c-0x0;var _0x48f7bd=_0xf2ca[_0x5e8c7c];return _0x48f7bd;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xaf2c('0x9'));module[_0xaf2c('0xa')]=function(_0x297740,_0x1f9531){return _0x297740['define'](_0xaf2c('0xb'),attributes,{'tableName':_0xaf2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','util','../../config/logger','api','bluebird'];(function(_0x375d3e,_0x59abf5){var _0x5abe22=function(_0x463ce5){while(--_0x463ce5){_0x375d3e['push'](_0x375d3e['shift']());}};_0x5abe22(++_0x59abf5);}(_0x038b,0x114));var _0xb038=function(_0xf341eb,_0x327a22){_0xf341eb=_0xf341eb-0x0;var _0x4e12fb=_0x038b[_0xf341eb];return _0x4e12fb;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));var integrations=require(_0xb038('0x7'));module['exports']=function(_0x54e1e7,_0x2e3e64){return _0x54e1e7[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 5865a51..cd1654e 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 _0x20dd=['request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetServicenowAccount','stringify','ShowServicenowAccount','ServicenowAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4acbeb,_0x9f7a24){var _0x3dcf96=function(_0x451ba5){while(--_0x451ba5){_0x4acbeb['push'](_0x4acbeb['shift']());}};_0x3dcf96(++_0x9f7a24);}(_0x20dd,0x1d2));var _0xd20d=function(_0x5c443e,_0x90ced8){_0x5c443e=_0x5c443e-0x0;var _0x14e708=_0x20dd[_0x5c443e];return _0x14e708;};'use strict';var _=require(_0xd20d('0x0'));var util=require('util');var moment=require(_0xd20d('0x1'));var BPromise=require(_0xd20d('0x2'));var rs=require(_0xd20d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd20d('0x4'))['db'];var utils=require(_0xd20d('0x5'));var logger=require(_0xd20d('0x6'))(_0xd20d('0x7'));var config=require(_0xd20d('0x8'));var jayson=require(_0xd20d('0x9'));var client=jayson[_0xd20d('0xa')][_0xd20d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x78cc25,_0x537972,_0x2b4f69){return new BPromise(function(_0x442e56,_0x26bdcf){return client[_0xd20d('0xc')](_0x78cc25,_0x2b4f69)[_0xd20d('0xd')](function(_0x481756){logger[_0xd20d('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x537972,_0xd20d('0xf'));logger[_0xd20d('0x10')](_0xd20d('0x11'),_0x537972,_0xd20d('0xf'),JSON['stringify'](_0x481756));if(_0x481756[_0xd20d('0x12')]){if(_0x481756[_0xd20d('0x12')][_0xd20d('0x13')]===0x1f4){logger['error'](_0xd20d('0x14'),_0x537972,_0x481756[_0xd20d('0x12')][_0xd20d('0x15')]);return _0x26bdcf(_0x481756['error']['message']);}logger[_0xd20d('0x12')](_0xd20d('0x14'),_0x537972,_0x481756[_0xd20d('0x12')]['message']);return _0x442e56(_0x481756[_0xd20d('0x12')]['message']);}else{logger[_0xd20d('0xe')](_0xd20d('0x14'),_0x537972,_0xd20d('0xf'));_0x442e56(_0x481756[_0xd20d('0x16')][_0xd20d('0x15')]);}})[_0xd20d('0x17')](function(_0x981b26){logger[_0xd20d('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x537972,_0x981b26);_0x26bdcf(_0x981b26);});});}exports['GetServicenowAccount']=function(_0x35045b){var _0x168df4=this;return new Promise(function(_0x45d204,_0x347c7b){return db['ServicenowAccount'][_0xd20d('0x18')]({'raw':_0x35045b[_0xd20d('0x19')]?_0x35045b[_0xd20d('0x19')][_0xd20d('0x1a')]===undefined?!![]:![]:!![],'where':_0x35045b[_0xd20d('0x19')]?_0x35045b[_0xd20d('0x19')][_0xd20d('0x1b')]||null:null,'attributes':_0x35045b[_0xd20d('0x19')]?_0x35045b[_0xd20d('0x19')]['attributes']||null:null,'limit':_0x35045b[_0xd20d('0x19')]?_0x35045b[_0xd20d('0x19')][_0xd20d('0x1c')]||null:null,'include':_0x35045b['options']?_0x35045b['options'][_0xd20d('0x1d')]?_[_0xd20d('0x1e')](_0x35045b[_0xd20d('0x19')]['include'],function(_0x25eb85){return{'model':db[_0x25eb85[_0xd20d('0x1f')]],'as':_0x25eb85['as'],'attributes':_0x25eb85[_0xd20d('0x20')],'include':_0x25eb85[_0xd20d('0x1d')]?_['map'](_0x25eb85[_0xd20d('0x1d')],function(_0x4e6be9){return{'model':db[_0x4e6be9[_0xd20d('0x1f')]],'as':_0x4e6be9['as'],'attributes':_0x4e6be9[_0xd20d('0x20')],'include':_0x4e6be9['include']?_['map'](_0x4e6be9[_0xd20d('0x1d')],function(_0x49394c){return{'model':db[_0x49394c[_0xd20d('0x1f')]],'as':_0x49394c['as'],'attributes':_0x49394c[_0xd20d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd20d('0xd')](function(_0xdf39c5){logger[_0xd20d('0xe')](_0xd20d('0x21'),_0x35045b);logger[_0xd20d('0x10')](_0xd20d('0x21'),_0x35045b,JSON[_0xd20d('0x22')](_0xdf39c5));_0x45d204(_0xdf39c5);})[_0xd20d('0x17')](function(_0x2d6c72){logger[_0xd20d('0x12')]('GetServicenowAccount',_0x2d6c72[_0xd20d('0x15')],_0x35045b);_0x347c7b(_0x168df4[_0xd20d('0x12')](0x1f4,_0x2d6c72['message']));});});};exports[_0xd20d('0x23')]=function(_0x2b8969){var _0x20fa03=this;return new Promise(function(_0x369dbe,_0x4ee91f){return db[_0xd20d('0x24')]['find']({'raw':_0x2b8969[_0xd20d('0x19')]?_0x2b8969[_0xd20d('0x19')][_0xd20d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2b8969[_0xd20d('0x19')]?_0x2b8969['options'][_0xd20d('0x1b')]||null:null,'attributes':_0x2b8969[_0xd20d('0x19')]?_0x2b8969[_0xd20d('0x19')][_0xd20d('0x20')]||null:null,'include':_0x2b8969[_0xd20d('0x19')]?_0x2b8969[_0xd20d('0x19')][_0xd20d('0x1d')]?_[_0xd20d('0x1e')](_0x2b8969[_0xd20d('0x19')][_0xd20d('0x1d')],function(_0x53a83d){return{'model':db[_0x53a83d[_0xd20d('0x1f')]],'as':_0x53a83d['as'],'attributes':_0x53a83d[_0xd20d('0x20')],'include':_0x53a83d[_0xd20d('0x1d')]?_[_0xd20d('0x1e')](_0x53a83d[_0xd20d('0x1d')],function(_0x8b5fba){return{'model':db[_0x8b5fba[_0xd20d('0x1f')]],'as':_0x8b5fba['as'],'attributes':_0x8b5fba['attributes'],'include':_0x8b5fba['include']?_[_0xd20d('0x1e')](_0x8b5fba[_0xd20d('0x1d')],function(_0x52138d){return{'model':db[_0x52138d[_0xd20d('0x1f')]],'as':_0x52138d['as'],'attributes':_0x52138d[_0xd20d('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd20d('0xd')](function(_0x249ada){logger[_0xd20d('0xe')](_0xd20d('0x23'),_0x2b8969);logger[_0xd20d('0x10')](_0xd20d('0x23'),_0x2b8969,JSON[_0xd20d('0x22')](_0x249ada));_0x369dbe(_0x249ada);})[_0xd20d('0x17')](function(_0x434472){logger[_0xd20d('0x12')]('ShowServicenowAccount',_0x434472[_0xd20d('0x15')],_0x2b8969);_0x4ee91f(_0x20fa03[_0xd20d('0x12')](0x1f4,_0x434472[_0xd20d('0x15')]));});});}; \ No newline at end of file +var _0x17f9=['ShowServicenowAccount','ServicenowAccount','find','raw','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','GetServicenowAccount','findAll','options','where','limit','include','map','model','attributes','debug'];(function(_0x5d7009,_0xc5b919){var _0x82bc4f=function(_0x3d1acf){while(--_0x3d1acf){_0x5d7009['push'](_0x5d7009['shift']());}};_0x82bc4f(++_0xc5b919);}(_0x17f9,0x1cb));var _0x917f=function(_0x3b3295,_0x5d28d9){_0x3b3295=_0x3b3295-0x0;var _0x28f5e6=_0x17f9[_0x3b3295];return _0x28f5e6;};'use strict';var _=require('lodash');var util=require(_0x917f('0x0'));var moment=require(_0x917f('0x1'));var BPromise=require(_0x917f('0x2'));var rs=require(_0x917f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x917f('0x4'));var logger=require(_0x917f('0x5'))(_0x917f('0x6'));var config=require(_0x917f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x917f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x401391,_0x1d8756,_0x3dc3a1){return new BPromise(function(_0x2314c3,_0x335ebe){return client[_0x917f('0x9')](_0x401391,_0x3dc3a1)[_0x917f('0xa')](function(_0x4efe36){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1d8756,_0x917f('0xb'));logger['debug'](_0x917f('0xc'),_0x1d8756,_0x917f('0xb'),JSON[_0x917f('0xd')](_0x4efe36));if(_0x4efe36['error']){if(_0x4efe36['error'][_0x917f('0xe')]===0x1f4){logger[_0x917f('0xf')](_0x917f('0x10'),_0x1d8756,_0x4efe36[_0x917f('0xf')][_0x917f('0x11')]);return _0x335ebe(_0x4efe36['error'][_0x917f('0x11')]);}logger[_0x917f('0xf')](_0x917f('0x10'),_0x1d8756,_0x4efe36[_0x917f('0xf')][_0x917f('0x11')]);return _0x2314c3(_0x4efe36[_0x917f('0xf')]['message']);}else{logger[_0x917f('0x12')](_0x917f('0x10'),_0x1d8756,'request\x20sent');_0x2314c3(_0x4efe36[_0x917f('0x13')][_0x917f('0x11')]);}})[_0x917f('0x14')](function(_0x18f6ae){logger['error'](_0x917f('0x10'),_0x1d8756,_0x18f6ae);_0x335ebe(_0x18f6ae);});});}exports[_0x917f('0x15')]=function(_0x3976e5){var _0x2e150c=this;return new Promise(function(_0x50a39b,_0x41cc5c){return db['ServicenowAccount'][_0x917f('0x16')]({'raw':_0x3976e5[_0x917f('0x17')]?_0x3976e5[_0x917f('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3976e5[_0x917f('0x17')]?_0x3976e5[_0x917f('0x17')][_0x917f('0x18')]||null:null,'attributes':_0x3976e5[_0x917f('0x17')]?_0x3976e5['options']['attributes']||null:null,'limit':_0x3976e5[_0x917f('0x17')]?_0x3976e5[_0x917f('0x17')][_0x917f('0x19')]||null:null,'include':_0x3976e5[_0x917f('0x17')]?_0x3976e5[_0x917f('0x17')][_0x917f('0x1a')]?_[_0x917f('0x1b')](_0x3976e5[_0x917f('0x17')][_0x917f('0x1a')],function(_0x1450bf){return{'model':db[_0x1450bf[_0x917f('0x1c')]],'as':_0x1450bf['as'],'attributes':_0x1450bf[_0x917f('0x1d')],'include':_0x1450bf[_0x917f('0x1a')]?_[_0x917f('0x1b')](_0x1450bf[_0x917f('0x1a')],function(_0x4b6e26){return{'model':db[_0x4b6e26[_0x917f('0x1c')]],'as':_0x4b6e26['as'],'attributes':_0x4b6e26[_0x917f('0x1d')],'include':_0x4b6e26[_0x917f('0x1a')]?_[_0x917f('0x1b')](_0x4b6e26[_0x917f('0x1a')],function(_0x2fe952){return{'model':db[_0x2fe952[_0x917f('0x1c')]],'as':_0x2fe952['as'],'attributes':_0x2fe952[_0x917f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x917f('0xa')](function(_0x1caa84){logger[_0x917f('0x12')](_0x917f('0x15'),_0x3976e5);logger[_0x917f('0x1e')]('GetServicenowAccount',_0x3976e5,JSON[_0x917f('0xd')](_0x1caa84));_0x50a39b(_0x1caa84);})[_0x917f('0x14')](function(_0x471a48){logger[_0x917f('0xf')]('GetServicenowAccount',_0x471a48[_0x917f('0x11')],_0x3976e5);_0x41cc5c(_0x2e150c[_0x917f('0xf')](0x1f4,_0x471a48['message']));});});};exports[_0x917f('0x1f')]=function(_0x29f877){var _0x14cd0b=this;return new Promise(function(_0x5b0099,_0x21d985){return db[_0x917f('0x20')][_0x917f('0x21')]({'raw':_0x29f877[_0x917f('0x17')]?_0x29f877[_0x917f('0x17')][_0x917f('0x22')]===undefined?!![]:![]:!![],'where':_0x29f877[_0x917f('0x17')]?_0x29f877[_0x917f('0x17')][_0x917f('0x18')]||null:null,'attributes':_0x29f877[_0x917f('0x17')]?_0x29f877['options'][_0x917f('0x1d')]||null:null,'include':_0x29f877['options']?_0x29f877[_0x917f('0x17')][_0x917f('0x1a')]?_[_0x917f('0x1b')](_0x29f877[_0x917f('0x17')][_0x917f('0x1a')],function(_0x114b26){return{'model':db[_0x114b26[_0x917f('0x1c')]],'as':_0x114b26['as'],'attributes':_0x114b26[_0x917f('0x1d')],'include':_0x114b26[_0x917f('0x1a')]?_[_0x917f('0x1b')](_0x114b26['include'],function(_0x48138a){return{'model':db[_0x48138a[_0x917f('0x1c')]],'as':_0x48138a['as'],'attributes':_0x48138a[_0x917f('0x1d')],'include':_0x48138a[_0x917f('0x1a')]?_[_0x917f('0x1b')](_0x48138a[_0x917f('0x1a')],function(_0xa44fa8){return{'model':db[_0xa44fa8[_0x917f('0x1c')]],'as':_0xa44fa8['as'],'attributes':_0xa44fa8[_0x917f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x917f('0xa')](function(_0x300be1){logger[_0x917f('0x12')](_0x917f('0x1f'),_0x29f877);logger[_0x917f('0x1e')]('ShowServicenowAccount',_0x29f877,JSON['stringify'](_0x300be1));_0x5b0099(_0x300be1);})['catch'](function(_0x1e2d09){logger['error'](_0x917f('0x1f'),_0x1e2d09[_0x917f('0x11')],_0x29f877);_0x21d985(_0x14cd0b[_0x917f('0xf')](0x1f4,_0x1e2d09[_0x917f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 4dcc779..31f3154 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 _0xbd59=['isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','exports','multer','path','Router','fs-extra','../../components/auth/service','get'];(function(_0x4864ad,_0x4c865b){var _0x2c7f82=function(_0xea17a2){while(--_0xea17a2){_0x4864ad['push'](_0x4864ad['shift']());}};_0x2c7f82(++_0x4c865b);}(_0xbd59,0x1e0));var _0x9bd5=function(_0x11ae46,_0x27db66){_0x11ae46=_0x11ae46-0x0;var _0x590095=_0xbd59[_0x11ae46];return _0x590095;};'use strict';var multer=require(_0x9bd5('0x0'));var util=require('util');var path=require(_0x9bd5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bd5('0x2')]();var fs_extra=require(_0x9bd5('0x3'));var auth=require(_0x9bd5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x9bd5('0x5')]('/',auth[_0x9bd5('0x6')](),controller[_0x9bd5('0x7')]);router[_0x9bd5('0x5')](_0x9bd5('0x8'),auth[_0x9bd5('0x6')](),controller['show']);router[_0x9bd5('0x5')](_0x9bd5('0x9'),auth[_0x9bd5('0x6')](),controller[_0x9bd5('0xa')]);router[_0x9bd5('0x5')]('/:id/subjects',auth[_0x9bd5('0x6')](),controller[_0x9bd5('0xb')]);router[_0x9bd5('0x5')](_0x9bd5('0xc'),auth['isAuthenticated'](),controller[_0x9bd5('0xd')]);router[_0x9bd5('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9bd5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9bd5('0x10')]);router['delete'](_0x9bd5('0x8'),auth[_0x9bd5('0x6')](),controller['destroy']);module[_0x9bd5('0x11')]=router; \ No newline at end of file +var _0x1370=['../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1ce8fd,_0x1fd875){var _0xd5cdb5=function(_0x1efa4d){while(--_0x1efa4d){_0x1ce8fd['push'](_0x1ce8fd['shift']());}};_0xd5cdb5(++_0x1fd875);}(_0x1370,0x13b));var _0x0137=function(_0x229a03,_0x36fefc){_0x229a03=_0x229a03-0x0;var _0x2d6e11=_0x1370[_0x229a03];return _0x2d6e11;};'use strict';var multer=require(_0x0137('0x0'));var util=require(_0x0137('0x1'));var path=require('path');var timeout=require(_0x0137('0x2'));var express=require(_0x0137('0x3'));var router=express[_0x0137('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0137('0x5'));var interaction=require(_0x0137('0x6'));var config=require(_0x0137('0x7'));var controller=require(_0x0137('0x8'));router[_0x0137('0x9')]('/',auth[_0x0137('0xa')](),controller['index']);router[_0x0137('0x9')](_0x0137('0xb'),auth[_0x0137('0xa')](),controller[_0x0137('0xc')]);router[_0x0137('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x0137('0x9')](_0x0137('0xd'),auth[_0x0137('0xa')](),controller[_0x0137('0xe')]);router['get'](_0x0137('0xf'),auth[_0x0137('0xa')](),controller[_0x0137('0x10')]);router[_0x0137('0x11')]('/',auth[_0x0137('0xa')](),controller[_0x0137('0x12')]);router[_0x0137('0x13')](_0x0137('0xb'),auth[_0x0137('0xa')](),controller['update']);router[_0x0137('0x14')](_0x0137('0xb'),auth[_0x0137('0xa')](),controller[_0x0137('0x15')]);module[_0x0137('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 fe09ea7..139cf97 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 _0x2879=['STRING','exports'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x2879,0xb5));var _0x9287=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2879[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x9287('0x0')]={'name':{'type':Sequelize[_0x9287('0x1')]},'description':{'type':Sequelize[_0x9287('0x1')]}}; \ No newline at end of file +var _0x67f3=['STRING','sequelize','exports'];(function(_0x2f6e30,_0x5bbeac){var _0xa702a0=function(_0x922f4b){while(--_0x922f4b){_0x2f6e30['push'](_0x2f6e30['shift']());}};_0xa702a0(++_0x5bbeac);}(_0x67f3,0x91));var _0x367f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x67f3[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0x367f('0x0'));module[_0x367f('0x1')]={'name':{'type':Sequelize[_0x367f('0x2')]},'description':{'type':Sequelize[_0x367f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 939a675..1a37f70 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 _0xb03b=['set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','length','find','create','body','getFields','ServicenowField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x49742f,_0xe0af97){var _0x5139ab=function(_0x307dea){while(--_0x307dea){_0x49742f['push'](_0x49742f['shift']());}};_0x5139ab(++_0xe0af97);}(_0xb03b,0x16d));var _0xbb03=function(_0x2cbc8e,_0x43a5b0){_0x2cbc8e=_0x2cbc8e-0x0;var _0x1fc1a3=_0xb03b[_0x2cbc8e];return _0x1fc1a3;};'use strict';var emlformat=require(_0xbb03('0x0'));var rimraf=require(_0xbb03('0x1'));var zipdir=require(_0xbb03('0x2'));var jsonpatch=require(_0xbb03('0x3'));var rp=require('request-promise');var moment=require(_0xbb03('0x4'));var BPromise=require(_0xbb03('0x5'));var Mustache=require('mustache');var util=require(_0xbb03('0x6'));var path=require(_0xbb03('0x7'));var sox=require(_0xbb03('0x8'));var csv=require(_0xbb03('0x9'));var ejs=require(_0xbb03('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb03('0xb'));var jsforce=require(_0xbb03('0xc'));var deskjs=require(_0xbb03('0xd'));var toCsv=require(_0xbb03('0x9'));var querystring=require(_0xbb03('0xe'));var Papa=require(_0xbb03('0xf'));var Redis=require(_0xbb03('0x10'));var authService=require(_0xbb03('0x11'));var qs=require(_0xbb03('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb03('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbb03('0x14'));var licenseUtil=require(_0xbb03('0x15'));var db=require(_0xbb03('0x16'))['db'];function respondWithStatusCode(_0x267f91,_0x509b2e){_0x509b2e=_0x509b2e||0xcc;return function(_0x2de77a){if(_0x2de77a){return _0x267f91[_0xbb03('0x17')](_0x509b2e);}return _0x267f91[_0xbb03('0x18')](_0x509b2e)[_0xbb03('0x19')]();};}function respondWithResult(_0x3d9ae3,_0x2c589c){_0x2c589c=_0x2c589c||0xc8;return function(_0x217e2c){if(_0x217e2c){return _0x3d9ae3[_0xbb03('0x18')](_0x2c589c)[_0xbb03('0x1a')](_0x217e2c);}};}function respondWithFilteredResult(_0x3ccf2d,_0x310d25){return function(_0x3741cb){if(_0x3741cb){var _0x178fa1=typeof _0x310d25[_0xbb03('0x1b')]===_0xbb03('0x1c')&&typeof _0x310d25['limit']===_0xbb03('0x1c');var _0x2ceeae=_0x3741cb[_0xbb03('0x1d')];var _0x57dcee=_0x178fa1?0x0:_0x310d25[_0xbb03('0x1b')];var _0x46e817=_0x178fa1?_0x3741cb[_0xbb03('0x1d')]:_0x310d25[_0xbb03('0x1b')]+_0x310d25['limit'];var _0x2e9628;if(_0x46e817>=_0x2ceeae){_0x46e817=_0x2ceeae;_0x2e9628=0xc8;}else{_0x2e9628=0xce;}_0x3ccf2d[_0xbb03('0x18')](_0x2e9628);return _0x3ccf2d[_0xbb03('0x1e')](_0xbb03('0x1f'),_0x57dcee+'-'+_0x46e817+'/'+_0x2ceeae)[_0xbb03('0x1a')](_0x3741cb);}return null;};}function patchUpdates(_0x4adb7a){return function(_0x33e282){try{jsonpatch[_0xbb03('0x20')](_0x33e282,_0x4adb7a,!![]);}catch(_0x5d8697){return BPromise[_0xbb03('0x21')](_0x5d8697);}return _0x33e282['save']();};}function saveUpdates(_0x4a7f69,_0x173c20){return function(_0x2f87a4){if(_0x2f87a4){return _0x2f87a4[_0xbb03('0x22')](_0x4a7f69)[_0xbb03('0x23')](function(_0x2e7309){return _0x2e7309;});}return null;};}function removeEntity(_0x4217ed,_0x527fc5){return function(_0x53d541){if(_0x53d541){return _0x53d541[_0xbb03('0x24')]()[_0xbb03('0x23')](function(){_0x4217ed[_0xbb03('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c0e2,_0x32fbc3){return function(_0x5f03ec){if(!_0x5f03ec){_0x14c0e2['sendStatus'](0x194);}return _0x5f03ec;};}function handleError(_0x52c9a9,_0x2ff5b8){_0x2ff5b8=_0x2ff5b8||0x1f4;return function(_0xb9dbbc){logger[_0xbb03('0x25')](_0xb9dbbc['stack']);if(_0xb9dbbc[_0xbb03('0x26')]){delete _0xb9dbbc[_0xbb03('0x26')];}_0x52c9a9[_0xbb03('0x18')](_0x2ff5b8)[_0xbb03('0x27')](_0xb9dbbc);};}exports[_0xbb03('0x28')]=function(_0x4dd523,_0x4d0d6f){var _0x3cad25={},_0x4724a1={},_0x494d32={'count':0x0,'rows':[]};var _0x1cd46d=_[_0xbb03('0x29')](db[_0xbb03('0x2a')][_0xbb03('0x2b')],function(_0x24319d){return{'name':_0x24319d[_0xbb03('0x2c')],'type':_0x24319d[_0xbb03('0x2d')][_0xbb03('0x2e')]};});_0x4724a1[_0xbb03('0x2f')]=_['map'](_0x1cd46d,_0xbb03('0x26'));_0x4724a1[_0xbb03('0x30')]=_[_0xbb03('0x31')](_0x4dd523[_0xbb03('0x30')]);_0x4724a1[_0xbb03('0x32')]=_[_0xbb03('0x33')](_0x4724a1[_0xbb03('0x2f')],_0x4724a1[_0xbb03('0x30')]);_0x3cad25[_0xbb03('0x34')]=_[_0xbb03('0x33')](_0x4724a1['model'],qs[_0xbb03('0x35')](_0x4dd523[_0xbb03('0x30')][_0xbb03('0x35')]));_0x3cad25['attributes']=_0x3cad25[_0xbb03('0x34')]['length']?_0x3cad25[_0xbb03('0x34')]:_0x4724a1[_0xbb03('0x2f')];if(!_0x4dd523[_0xbb03('0x30')][_0xbb03('0x36')](_0xbb03('0x37'))){_0x3cad25[_0xbb03('0x38')]=qs[_0xbb03('0x38')](_0x4dd523[_0xbb03('0x30')][_0xbb03('0x38')]);_0x3cad25[_0xbb03('0x1b')]=qs[_0xbb03('0x1b')](_0x4dd523['query'][_0xbb03('0x1b')]);}_0x3cad25[_0xbb03('0x39')]=qs['sort'](_0x4dd523[_0xbb03('0x30')][_0xbb03('0x3a')]);_0x3cad25['where']=qs['filters'](_[_0xbb03('0x3b')](_0x4dd523['query'],_0x4724a1[_0xbb03('0x32')]),_0x1cd46d);if(_0x4dd523[_0xbb03('0x30')][_0xbb03('0x3c')]){_0x3cad25[_0xbb03('0x3d')]=_[_0xbb03('0x3e')](_0x3cad25['where'],{'$or':_[_0xbb03('0x29')](_0x1cd46d,function(_0x3b9e13){if(_0x3b9e13[_0xbb03('0x2d')]!==_0xbb03('0x3f')){var _0x47754f={};_0x47754f[_0x3b9e13['name']]={'$like':'%'+_0x4dd523['query'][_0xbb03('0x3c')]+'%'};return _0x47754f;}})});}_0x3cad25=_[_0xbb03('0x3e')]({},_0x3cad25,_0x4dd523[_0xbb03('0x40')]);var _0x58be1a={'where':_0x3cad25[_0xbb03('0x3d')]};return db[_0xbb03('0x2a')]['count'](_0x58be1a)['then'](function(_0x260fb8){_0x494d32[_0xbb03('0x1d')]=_0x260fb8;if(_0x4dd523[_0xbb03('0x30')][_0xbb03('0x41')]){_0x3cad25[_0xbb03('0x42')]=[{'all':!![]}];}return db[_0xbb03('0x2a')][_0xbb03('0x43')](_0x3cad25);})[_0xbb03('0x23')](function(_0x460198){_0x494d32['rows']=_0x460198;return _0x494d32;})[_0xbb03('0x23')](respondWithFilteredResult(_0x4d0d6f,_0x3cad25))[_0xbb03('0x44')](handleError(_0x4d0d6f,null));};exports['show']=function(_0x563d0b,_0x414982){var _0x494d8c={'raw':![],'where':{'id':_0x563d0b[_0xbb03('0x45')]['id']}},_0x332f97={};_0x332f97[_0xbb03('0x2f')]=_['keys'](db[_0xbb03('0x2a')][_0xbb03('0x2b')]);_0x332f97[_0xbb03('0x30')]=_['keys'](_0x563d0b[_0xbb03('0x30')]);_0x332f97[_0xbb03('0x32')]=_['intersection'](_0x332f97['model'],_0x332f97[_0xbb03('0x30')]);_0x494d8c[_0xbb03('0x34')]=_[_0xbb03('0x33')](_0x332f97['model'],qs['fields'](_0x563d0b['query'][_0xbb03('0x35')]));_0x494d8c[_0xbb03('0x34')]=_0x494d8c[_0xbb03('0x34')][_0xbb03('0x46')]?_0x494d8c['attributes']:_0x332f97[_0xbb03('0x2f')];if(_0x563d0b[_0xbb03('0x30')]['includeAll']){_0x494d8c[_0xbb03('0x42')]=[{'all':!![]}];}_0x494d8c=_['merge']({},_0x494d8c,_0x563d0b[_0xbb03('0x40')]);return db[_0xbb03('0x2a')][_0xbb03('0x47')](_0x494d8c)[_0xbb03('0x23')](handleEntityNotFound(_0x414982,null))[_0xbb03('0x23')](respondWithResult(_0x414982,null))[_0xbb03('0x44')](handleError(_0x414982,null));};exports['create']=function(_0x44c369,_0x3d732c){return db['ServicenowConfiguration'][_0xbb03('0x48')](_0x44c369['body'],{})[_0xbb03('0x23')](respondWithResult(_0x3d732c,0xc9))['catch'](handleError(_0x3d732c,null));};exports[_0xbb03('0x22')]=function(_0x4e383a,_0x9f3ee4){if(_0x4e383a[_0xbb03('0x49')]['id']){delete _0x4e383a['body']['id'];}return db[_0xbb03('0x2a')][_0xbb03('0x47')]({'where':{'id':_0x4e383a[_0xbb03('0x45')]['id']}})[_0xbb03('0x23')](handleEntityNotFound(_0x9f3ee4,null))['then'](saveUpdates(_0x4e383a[_0xbb03('0x49')],null))[_0xbb03('0x23')](respondWithResult(_0x9f3ee4,null))[_0xbb03('0x44')](handleError(_0x9f3ee4,null));};exports[_0xbb03('0x24')]=function(_0x106856,_0x155635){return db[_0xbb03('0x2a')][_0xbb03('0x47')]({'where':{'id':_0x106856[_0xbb03('0x45')]['id']}})[_0xbb03('0x23')](handleEntityNotFound(_0x155635,null))['then'](removeEntity(_0x155635,null))[_0xbb03('0x44')](handleError(_0x155635,null));};exports[_0xbb03('0x4a')]=function(_0x9d4042,_0x44f704,_0x2a87e9){var _0x1bb4f9={};var _0x25b547={};var _0x37ab68;var _0x4854ca;return db[_0xbb03('0x2a')]['findOne']({'where':{'id':_0x9d4042[_0xbb03('0x45')]['id']}})[_0xbb03('0x23')](handleEntityNotFound(_0x44f704,null))[_0xbb03('0x23')](function(_0x3e4489){if(_0x3e4489){_0x37ab68=_0x3e4489;_0x25b547['model']=_['keys'](db[_0xbb03('0x4b')]['rawAttributes']);_0x25b547[_0xbb03('0x30')]=_['keys'](_0x9d4042['query']);_0x25b547[_0xbb03('0x32')]=_['intersection'](_0x25b547[_0xbb03('0x2f')],_0x25b547['query']);_0x1bb4f9['attributes']=_[_0xbb03('0x33')](_0x25b547[_0xbb03('0x2f')],qs[_0xbb03('0x35')](_0x9d4042[_0xbb03('0x30')][_0xbb03('0x35')]));_0x1bb4f9[_0xbb03('0x34')]=_0x1bb4f9[_0xbb03('0x34')][_0xbb03('0x46')]?_0x1bb4f9[_0xbb03('0x34')]:_0x25b547[_0xbb03('0x2f')];_0x1bb4f9[_0xbb03('0x39')]=qs['sort'](_0x9d4042[_0xbb03('0x30')]['sort']);_0x1bb4f9[_0xbb03('0x3d')]=qs[_0xbb03('0x32')](_['pick'](_0x9d4042['query'],_0x25b547[_0xbb03('0x32')]));if(_0x9d4042[_0xbb03('0x30')][_0xbb03('0x3c')]){_0x1bb4f9[_0xbb03('0x3d')]=_[_0xbb03('0x3e')](_0x1bb4f9[_0xbb03('0x3d')],{'$or':_[_0xbb03('0x29')](_0x1bb4f9[_0xbb03('0x34')],function(_0x5049fd){var _0x2577ea={};_0x2577ea[_0x5049fd]={'$like':'%'+_0x9d4042[_0xbb03('0x30')][_0xbb03('0x3c')]+'%'};return _0x2577ea;})});}_0x1bb4f9=_[_0xbb03('0x3e')]({},_0x1bb4f9,_0x9d4042['options']);return _0x37ab68['getFields'](_0x1bb4f9);}})[_0xbb03('0x23')](function(_0x29ccbb){if(_0x29ccbb){_0x4854ca=_0x29ccbb['length'];if(!_0x9d4042[_0xbb03('0x30')][_0xbb03('0x36')]('nolimit')){_0x1bb4f9['limit']=qs[_0xbb03('0x38')](_0x9d4042[_0xbb03('0x30')][_0xbb03('0x38')]);_0x1bb4f9[_0xbb03('0x1b')]=qs['offset'](_0x9d4042[_0xbb03('0x30')][_0xbb03('0x1b')]);}return _0x37ab68[_0xbb03('0x4a')](_0x1bb4f9);}})[_0xbb03('0x23')](function(_0x424220){if(_0x424220){return _0x424220?{'count':_0x4854ca,'rows':_0x424220}:null;}})['then'](respondWithResult(_0x44f704,null))[_0xbb03('0x44')](handleError(_0x44f704,null));};exports[_0xbb03('0x4c')]=function(_0xd4db87,_0x1c2177,_0x14c819){var _0x2f627b={};var _0x52b98f={};var _0x5e2276;var _0x6d60ae;return db['ServicenowConfiguration'][_0xbb03('0x4d')]({'where':{'id':_0xd4db87[_0xbb03('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c2177,null))[_0xbb03('0x23')](function(_0x30bac8){if(_0x30bac8){_0x5e2276=_0x30bac8;_0x52b98f['model']=_[_0xbb03('0x31')](db[_0xbb03('0x4b')][_0xbb03('0x2b')]);_0x52b98f['query']=_[_0xbb03('0x31')](_0xd4db87[_0xbb03('0x30')]);_0x52b98f['filters']=_[_0xbb03('0x33')](_0x52b98f[_0xbb03('0x2f')],_0x52b98f['query']);_0x2f627b['attributes']=_[_0xbb03('0x33')](_0x52b98f[_0xbb03('0x2f')],qs[_0xbb03('0x35')](_0xd4db87[_0xbb03('0x30')][_0xbb03('0x35')]));_0x2f627b['attributes']=_0x2f627b[_0xbb03('0x34')][_0xbb03('0x46')]?_0x2f627b[_0xbb03('0x34')]:_0x52b98f[_0xbb03('0x2f')];_0x2f627b['order']=qs[_0xbb03('0x3a')](_0xd4db87[_0xbb03('0x30')][_0xbb03('0x3a')]);_0x2f627b[_0xbb03('0x3d')]=qs[_0xbb03('0x32')](_[_0xbb03('0x3b')](_0xd4db87[_0xbb03('0x30')],_0x52b98f[_0xbb03('0x32')]));if(_0xd4db87['query'][_0xbb03('0x3c')]){_0x2f627b['where']=_[_0xbb03('0x3e')](_0x2f627b[_0xbb03('0x3d')],{'$or':_['map'](_0x2f627b[_0xbb03('0x34')],function(_0x26b889){var _0x5548bd={};_0x5548bd[_0x26b889]={'$like':'%'+_0xd4db87[_0xbb03('0x30')][_0xbb03('0x3c')]+'%'};return _0x5548bd;})});}_0x2f627b=_['merge']({},_0x2f627b,_0xd4db87[_0xbb03('0x40')]);return _0x5e2276[_0xbb03('0x4c')](_0x2f627b);}})[_0xbb03('0x23')](function(_0x2bb93a){if(_0x2bb93a){_0x6d60ae=_0x2bb93a[_0xbb03('0x46')];if(!_0xd4db87[_0xbb03('0x30')][_0xbb03('0x36')](_0xbb03('0x37'))){_0x2f627b[_0xbb03('0x38')]=qs[_0xbb03('0x38')](_0xd4db87[_0xbb03('0x30')]['limit']);_0x2f627b[_0xbb03('0x1b')]=qs[_0xbb03('0x1b')](_0xd4db87[_0xbb03('0x30')][_0xbb03('0x1b')]);}return _0x5e2276[_0xbb03('0x4c')](_0x2f627b);}})[_0xbb03('0x23')](function(_0x351c47){if(_0x351c47){return _0x351c47?{'count':_0x6d60ae,'rows':_0x351c47}:null;}})['then'](respondWithResult(_0x1c2177,null))[_0xbb03('0x44')](handleError(_0x1c2177,null));};exports['getDescriptions']=function(_0x4ec9a6,_0x36d1e3,_0x1f00e6){var _0x2bca8d={};var _0x534671={};var _0xdb9485;var _0x4e2e77;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x4ec9a6[_0xbb03('0x45')]['id']}})[_0xbb03('0x23')](handleEntityNotFound(_0x36d1e3,null))['then'](function(_0x50deaf){if(_0x50deaf){_0xdb9485=_0x50deaf;_0x534671['model']=_['keys'](db[_0xbb03('0x4b')][_0xbb03('0x2b')]);_0x534671[_0xbb03('0x30')]=_[_0xbb03('0x31')](_0x4ec9a6[_0xbb03('0x30')]);_0x534671[_0xbb03('0x32')]=_[_0xbb03('0x33')](_0x534671[_0xbb03('0x2f')],_0x534671[_0xbb03('0x30')]);_0x2bca8d[_0xbb03('0x34')]=_['intersection'](_0x534671[_0xbb03('0x2f')],qs[_0xbb03('0x35')](_0x4ec9a6[_0xbb03('0x30')][_0xbb03('0x35')]));_0x2bca8d[_0xbb03('0x34')]=_0x2bca8d[_0xbb03('0x34')][_0xbb03('0x46')]?_0x2bca8d[_0xbb03('0x34')]:_0x534671[_0xbb03('0x2f')];_0x2bca8d[_0xbb03('0x39')]=qs[_0xbb03('0x3a')](_0x4ec9a6[_0xbb03('0x30')]['sort']);_0x2bca8d[_0xbb03('0x3d')]=qs[_0xbb03('0x32')](_[_0xbb03('0x3b')](_0x4ec9a6[_0xbb03('0x30')],_0x534671['filters']));if(_0x4ec9a6['query'][_0xbb03('0x3c')]){_0x2bca8d[_0xbb03('0x3d')]=_[_0xbb03('0x3e')](_0x2bca8d['where'],{'$or':_[_0xbb03('0x29')](_0x2bca8d[_0xbb03('0x34')],function(_0x4739fd){var _0x354b8d={};_0x354b8d[_0x4739fd]={'$like':'%'+_0x4ec9a6[_0xbb03('0x30')][_0xbb03('0x3c')]+'%'};return _0x354b8d;})});}_0x2bca8d=_[_0xbb03('0x3e')]({},_0x2bca8d,_0x4ec9a6['options']);return _0xdb9485[_0xbb03('0x4e')](_0x2bca8d);}})[_0xbb03('0x23')](function(_0xdc3b8f){if(_0xdc3b8f){_0x4e2e77=_0xdc3b8f[_0xbb03('0x46')];if(!_0x4ec9a6['query'][_0xbb03('0x36')]('nolimit')){_0x2bca8d['limit']=qs['limit'](_0x4ec9a6[_0xbb03('0x30')][_0xbb03('0x38')]);_0x2bca8d[_0xbb03('0x1b')]=qs[_0xbb03('0x1b')](_0x4ec9a6['query']['offset']);}return _0xdb9485['getDescriptions'](_0x2bca8d);}})[_0xbb03('0x23')](function(_0x299d2a){if(_0x299d2a){return _0x299d2a?{'count':_0x4e2e77,'rows':_0x299d2a}:null;}})['then'](respondWithResult(_0x36d1e3,null))[_0xbb03('0x44')](handleError(_0x36d1e3,null));}; \ No newline at end of file +var _0x98fc=['VIRTUAL','options','include','findAll','catch','params','keys','includeAll','create','body','find','getFields','findOne','ServicenowField','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x5ad796,_0x417264){var _0x366327=function(_0x3777f){while(--_0x3777f){_0x5ad796['push'](_0x5ad796['shift']());}};_0x366327(++_0x417264);}(_0x98fc,0x152));var _0xc98f=function(_0x4c11fb,_0x32dbc0){_0x4c11fb=_0x4c11fb-0x0;var _0x4caf73=_0x98fc[_0x4c11fb];return _0x4caf73;};'use strict';var emlformat=require(_0xc98f('0x0'));var rimraf=require(_0xc98f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc98f('0x2'));var rp=require(_0xc98f('0x3'));var moment=require(_0xc98f('0x4'));var BPromise=require(_0xc98f('0x5'));var Mustache=require(_0xc98f('0x6'));var util=require(_0xc98f('0x7'));var path=require(_0xc98f('0x8'));var sox=require(_0xc98f('0x9'));var csv=require(_0xc98f('0xa'));var ejs=require(_0xc98f('0xb'));var fs=require('fs');var fs_extra=require(_0xc98f('0xc'));var _=require(_0xc98f('0xd'));var squel=require('squel');var crypto=require(_0xc98f('0xe'));var jsforce=require(_0xc98f('0xf'));var deskjs=require(_0xc98f('0x10'));var toCsv=require(_0xc98f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc98f('0x11'));var as=require(_0xc98f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc98f('0x13'))(_0xc98f('0x14'));var utils=require(_0xc98f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc98f('0x16'));var db=require(_0xc98f('0x17'))['db'];function respondWithStatusCode(_0x5fd471,_0x1dd0c0){_0x1dd0c0=_0x1dd0c0||0xcc;return function(_0x5ab367){if(_0x5ab367){return _0x5fd471[_0xc98f('0x18')](_0x1dd0c0);}return _0x5fd471['status'](_0x1dd0c0)['end']();};}function respondWithResult(_0x57509b,_0x385354){_0x385354=_0x385354||0xc8;return function(_0x13803a){if(_0x13803a){return _0x57509b[_0xc98f('0x19')](_0x385354)[_0xc98f('0x1a')](_0x13803a);}};}function respondWithFilteredResult(_0x248592,_0x305082){return function(_0x1f83d9){if(_0x1f83d9){var _0x226a0d=typeof _0x305082[_0xc98f('0x1b')]==='undefined'&&typeof _0x305082[_0xc98f('0x1c')]===_0xc98f('0x1d');var _0x214683=_0x1f83d9[_0xc98f('0x1e')];var _0x520afd=_0x226a0d?0x0:_0x305082[_0xc98f('0x1b')];var _0x30c4c1=_0x226a0d?_0x1f83d9[_0xc98f('0x1e')]:_0x305082['offset']+_0x305082['limit'];var _0x114bc8;if(_0x30c4c1>=_0x214683){_0x30c4c1=_0x214683;_0x114bc8=0xc8;}else{_0x114bc8=0xce;}_0x248592[_0xc98f('0x19')](_0x114bc8);return _0x248592[_0xc98f('0x1f')](_0xc98f('0x20'),_0x520afd+'-'+_0x30c4c1+'/'+_0x214683)[_0xc98f('0x1a')](_0x1f83d9);}return null;};}function patchUpdates(_0x124a0b){return function(_0x1ff0ec){try{jsonpatch[_0xc98f('0x21')](_0x1ff0ec,_0x124a0b,!![]);}catch(_0x5a8957){return BPromise[_0xc98f('0x22')](_0x5a8957);}return _0x1ff0ec[_0xc98f('0x23')]();};}function saveUpdates(_0x473cad,_0x24e32e){return function(_0x1918b1){if(_0x1918b1){return _0x1918b1[_0xc98f('0x24')](_0x473cad)[_0xc98f('0x25')](function(_0x309fba){return _0x309fba;});}return null;};}function removeEntity(_0x1730eb,_0x57dbba){return function(_0x97c67b){if(_0x97c67b){return _0x97c67b['destroy']()[_0xc98f('0x25')](function(){_0x1730eb[_0xc98f('0x19')](0xcc)[_0xc98f('0x26')]();});}};}function handleEntityNotFound(_0x2a6f9a,_0x40c6df){return function(_0x1d51cd){if(!_0x1d51cd){_0x2a6f9a[_0xc98f('0x18')](0x194);}return _0x1d51cd;};}function handleError(_0x492060,_0x145410){_0x145410=_0x145410||0x1f4;return function(_0x198395){logger[_0xc98f('0x27')](_0x198395[_0xc98f('0x28')]);if(_0x198395[_0xc98f('0x29')]){delete _0x198395[_0xc98f('0x29')];}_0x492060[_0xc98f('0x19')](_0x145410)[_0xc98f('0x2a')](_0x198395);};}exports[_0xc98f('0x2b')]=function(_0x4a6954,_0xfeba74){var _0x1efebb={},_0x31d635={},_0x14eaf6={'count':0x0,'rows':[]};var _0x4f0a41=_[_0xc98f('0x2c')](db[_0xc98f('0x2d')]['rawAttributes'],function(_0x129cae){return{'name':_0x129cae[_0xc98f('0x2e')],'type':_0x129cae['type'][_0xc98f('0x2f')]};});_0x31d635[_0xc98f('0x30')]=_[_0xc98f('0x2c')](_0x4f0a41,_0xc98f('0x29'));_0x31d635[_0xc98f('0x31')]=_['keys'](_0x4a6954[_0xc98f('0x31')]);_0x31d635[_0xc98f('0x32')]=_[_0xc98f('0x33')](_0x31d635[_0xc98f('0x30')],_0x31d635[_0xc98f('0x31')]);_0x1efebb[_0xc98f('0x34')]=_[_0xc98f('0x33')](_0x31d635[_0xc98f('0x30')],qs['fields'](_0x4a6954[_0xc98f('0x31')][_0xc98f('0x35')]));_0x1efebb['attributes']=_0x1efebb['attributes'][_0xc98f('0x36')]?_0x1efebb[_0xc98f('0x34')]:_0x31d635[_0xc98f('0x30')];if(!_0x4a6954[_0xc98f('0x31')]['hasOwnProperty'](_0xc98f('0x37'))){_0x1efebb[_0xc98f('0x1c')]=qs[_0xc98f('0x1c')](_0x4a6954[_0xc98f('0x31')][_0xc98f('0x1c')]);_0x1efebb[_0xc98f('0x1b')]=qs[_0xc98f('0x1b')](_0x4a6954[_0xc98f('0x31')][_0xc98f('0x1b')]);}_0x1efebb[_0xc98f('0x38')]=qs[_0xc98f('0x39')](_0x4a6954[_0xc98f('0x31')]['sort']);_0x1efebb[_0xc98f('0x3a')]=qs[_0xc98f('0x32')](_[_0xc98f('0x3b')](_0x4a6954[_0xc98f('0x31')],_0x31d635[_0xc98f('0x32')]),_0x4f0a41);if(_0x4a6954[_0xc98f('0x31')][_0xc98f('0x3c')]){_0x1efebb[_0xc98f('0x3a')]=_[_0xc98f('0x3d')](_0x1efebb[_0xc98f('0x3a')],{'$or':_['map'](_0x4f0a41,function(_0x59d661){if(_0x59d661['type']!==_0xc98f('0x3e')){var _0x10bae3={};_0x10bae3[_0x59d661[_0xc98f('0x29')]]={'$like':'%'+_0x4a6954[_0xc98f('0x31')]['filter']+'%'};return _0x10bae3;}})});}_0x1efebb=_[_0xc98f('0x3d')]({},_0x1efebb,_0x4a6954[_0xc98f('0x3f')]);var _0x76df58={'where':_0x1efebb[_0xc98f('0x3a')]};return db[_0xc98f('0x2d')]['count'](_0x76df58)['then'](function(_0x114c1b){_0x14eaf6[_0xc98f('0x1e')]=_0x114c1b;if(_0x4a6954[_0xc98f('0x31')]['includeAll']){_0x1efebb[_0xc98f('0x40')]=[{'all':!![]}];}return db[_0xc98f('0x2d')][_0xc98f('0x41')](_0x1efebb);})[_0xc98f('0x25')](function(_0x2cb030){_0x14eaf6['rows']=_0x2cb030;return _0x14eaf6;})[_0xc98f('0x25')](respondWithFilteredResult(_0xfeba74,_0x1efebb))[_0xc98f('0x42')](handleError(_0xfeba74,null));};exports['show']=function(_0x4f1b52,_0x2a7544){var _0x777298={'raw':![],'where':{'id':_0x4f1b52[_0xc98f('0x43')]['id']}},_0x3b507e={};_0x3b507e[_0xc98f('0x30')]=_[_0xc98f('0x44')](db[_0xc98f('0x2d')]['rawAttributes']);_0x3b507e[_0xc98f('0x31')]=_[_0xc98f('0x44')](_0x4f1b52[_0xc98f('0x31')]);_0x3b507e['filters']=_[_0xc98f('0x33')](_0x3b507e['model'],_0x3b507e['query']);_0x777298[_0xc98f('0x34')]=_[_0xc98f('0x33')](_0x3b507e[_0xc98f('0x30')],qs[_0xc98f('0x35')](_0x4f1b52[_0xc98f('0x31')][_0xc98f('0x35')]));_0x777298['attributes']=_0x777298['attributes'][_0xc98f('0x36')]?_0x777298['attributes']:_0x3b507e[_0xc98f('0x30')];if(_0x4f1b52['query'][_0xc98f('0x45')]){_0x777298[_0xc98f('0x40')]=[{'all':!![]}];}_0x777298=_[_0xc98f('0x3d')]({},_0x777298,_0x4f1b52[_0xc98f('0x3f')]);return db[_0xc98f('0x2d')]['find'](_0x777298)[_0xc98f('0x25')](handleEntityNotFound(_0x2a7544,null))['then'](respondWithResult(_0x2a7544,null))[_0xc98f('0x42')](handleError(_0x2a7544,null));};exports['create']=function(_0x31adf9,_0x1e98fc){return db[_0xc98f('0x2d')][_0xc98f('0x46')](_0x31adf9[_0xc98f('0x47')],{})[_0xc98f('0x25')](respondWithResult(_0x1e98fc,0xc9))[_0xc98f('0x42')](handleError(_0x1e98fc,null));};exports[_0xc98f('0x24')]=function(_0x30d6a9,_0x42dc7d){if(_0x30d6a9[_0xc98f('0x47')]['id']){delete _0x30d6a9[_0xc98f('0x47')]['id'];}return db['ServicenowConfiguration'][_0xc98f('0x48')]({'where':{'id':_0x30d6a9[_0xc98f('0x43')]['id']}})[_0xc98f('0x25')](handleEntityNotFound(_0x42dc7d,null))[_0xc98f('0x25')](saveUpdates(_0x30d6a9['body'],null))['then'](respondWithResult(_0x42dc7d,null))[_0xc98f('0x42')](handleError(_0x42dc7d,null));};exports['destroy']=function(_0x190f93,_0x27b32c){return db[_0xc98f('0x2d')][_0xc98f('0x48')]({'where':{'id':_0x190f93[_0xc98f('0x43')]['id']}})['then'](handleEntityNotFound(_0x27b32c,null))[_0xc98f('0x25')](removeEntity(_0x27b32c,null))['catch'](handleError(_0x27b32c,null));};exports[_0xc98f('0x49')]=function(_0x20d52d,_0x3361bd,_0x3da0ed){var _0x3fec82={};var _0x456264={};var _0x4830ea;var _0x5d3982;return db[_0xc98f('0x2d')][_0xc98f('0x4a')]({'where':{'id':_0x20d52d[_0xc98f('0x43')]['id']}})[_0xc98f('0x25')](handleEntityNotFound(_0x3361bd,null))['then'](function(_0x577b0a){if(_0x577b0a){_0x4830ea=_0x577b0a;_0x456264[_0xc98f('0x30')]=_[_0xc98f('0x44')](db[_0xc98f('0x4b')][_0xc98f('0x4c')]);_0x456264['query']=_['keys'](_0x20d52d[_0xc98f('0x31')]);_0x456264[_0xc98f('0x32')]=_[_0xc98f('0x33')](_0x456264[_0xc98f('0x30')],_0x456264[_0xc98f('0x31')]);_0x3fec82['attributes']=_[_0xc98f('0x33')](_0x456264['model'],qs['fields'](_0x20d52d['query'][_0xc98f('0x35')]));_0x3fec82[_0xc98f('0x34')]=_0x3fec82[_0xc98f('0x34')][_0xc98f('0x36')]?_0x3fec82['attributes']:_0x456264[_0xc98f('0x30')];_0x3fec82[_0xc98f('0x38')]=qs['sort'](_0x20d52d['query'][_0xc98f('0x39')]);_0x3fec82[_0xc98f('0x3a')]=qs[_0xc98f('0x32')](_['pick'](_0x20d52d[_0xc98f('0x31')],_0x456264[_0xc98f('0x32')]));if(_0x20d52d[_0xc98f('0x31')][_0xc98f('0x3c')]){_0x3fec82[_0xc98f('0x3a')]=_[_0xc98f('0x3d')](_0x3fec82[_0xc98f('0x3a')],{'$or':_['map'](_0x3fec82[_0xc98f('0x34')],function(_0x56bc18){var _0x4d8aa1={};_0x4d8aa1[_0x56bc18]={'$like':'%'+_0x20d52d[_0xc98f('0x31')][_0xc98f('0x3c')]+'%'};return _0x4d8aa1;})});}_0x3fec82=_[_0xc98f('0x3d')]({},_0x3fec82,_0x20d52d[_0xc98f('0x3f')]);return _0x4830ea[_0xc98f('0x49')](_0x3fec82);}})[_0xc98f('0x25')](function(_0x5f2c8a){if(_0x5f2c8a){_0x5d3982=_0x5f2c8a[_0xc98f('0x36')];if(!_0x20d52d[_0xc98f('0x31')][_0xc98f('0x4d')](_0xc98f('0x37'))){_0x3fec82[_0xc98f('0x1c')]=qs[_0xc98f('0x1c')](_0x20d52d['query'][_0xc98f('0x1c')]);_0x3fec82[_0xc98f('0x1b')]=qs[_0xc98f('0x1b')](_0x20d52d[_0xc98f('0x31')]['offset']);}return _0x4830ea[_0xc98f('0x49')](_0x3fec82);}})[_0xc98f('0x25')](function(_0x300bd2){if(_0x300bd2){return _0x300bd2?{'count':_0x5d3982,'rows':_0x300bd2}:null;}})[_0xc98f('0x25')](respondWithResult(_0x3361bd,null))['catch'](handleError(_0x3361bd,null));};exports[_0xc98f('0x4e')]=function(_0x4e72bb,_0x576f0a,_0x3d6caa){var _0xfe040d={};var _0x3e1ee3={};var _0x354224;var _0x100acc;return db[_0xc98f('0x2d')][_0xc98f('0x4a')]({'where':{'id':_0x4e72bb['params']['id']}})[_0xc98f('0x25')](handleEntityNotFound(_0x576f0a,null))[_0xc98f('0x25')](function(_0x489c9c){if(_0x489c9c){_0x354224=_0x489c9c;_0x3e1ee3[_0xc98f('0x30')]=_[_0xc98f('0x44')](db[_0xc98f('0x4b')][_0xc98f('0x4c')]);_0x3e1ee3[_0xc98f('0x31')]=_['keys'](_0x4e72bb[_0xc98f('0x31')]);_0x3e1ee3[_0xc98f('0x32')]=_[_0xc98f('0x33')](_0x3e1ee3['model'],_0x3e1ee3[_0xc98f('0x31')]);_0xfe040d[_0xc98f('0x34')]=_[_0xc98f('0x33')](_0x3e1ee3[_0xc98f('0x30')],qs[_0xc98f('0x35')](_0x4e72bb[_0xc98f('0x31')][_0xc98f('0x35')]));_0xfe040d['attributes']=_0xfe040d[_0xc98f('0x34')][_0xc98f('0x36')]?_0xfe040d[_0xc98f('0x34')]:_0x3e1ee3[_0xc98f('0x30')];_0xfe040d[_0xc98f('0x38')]=qs[_0xc98f('0x39')](_0x4e72bb[_0xc98f('0x31')][_0xc98f('0x39')]);_0xfe040d[_0xc98f('0x3a')]=qs['filters'](_['pick'](_0x4e72bb[_0xc98f('0x31')],_0x3e1ee3[_0xc98f('0x32')]));if(_0x4e72bb['query']['filter']){_0xfe040d[_0xc98f('0x3a')]=_[_0xc98f('0x3d')](_0xfe040d[_0xc98f('0x3a')],{'$or':_[_0xc98f('0x2c')](_0xfe040d[_0xc98f('0x34')],function(_0x4584fb){var _0x22017b={};_0x22017b[_0x4584fb]={'$like':'%'+_0x4e72bb[_0xc98f('0x31')][_0xc98f('0x3c')]+'%'};return _0x22017b;})});}_0xfe040d=_[_0xc98f('0x3d')]({},_0xfe040d,_0x4e72bb[_0xc98f('0x3f')]);return _0x354224[_0xc98f('0x4e')](_0xfe040d);}})[_0xc98f('0x25')](function(_0x5305a9){if(_0x5305a9){_0x100acc=_0x5305a9[_0xc98f('0x36')];if(!_0x4e72bb[_0xc98f('0x31')]['hasOwnProperty'](_0xc98f('0x37'))){_0xfe040d[_0xc98f('0x1c')]=qs[_0xc98f('0x1c')](_0x4e72bb[_0xc98f('0x31')][_0xc98f('0x1c')]);_0xfe040d['offset']=qs[_0xc98f('0x1b')](_0x4e72bb[_0xc98f('0x31')][_0xc98f('0x1b')]);}return _0x354224[_0xc98f('0x4e')](_0xfe040d);}})[_0xc98f('0x25')](function(_0x17883d){if(_0x17883d){return _0x17883d?{'count':_0x100acc,'rows':_0x17883d}:null;}})[_0xc98f('0x25')](respondWithResult(_0x576f0a,null))[_0xc98f('0x42')](handleError(_0x576f0a,null));};exports[_0xc98f('0x4f')]=function(_0x22cf3f,_0x7a7a2f,_0x248111){var _0x296ffc={};var _0x512df4={};var _0x1f574c;var _0x5e41f6;return db[_0xc98f('0x2d')][_0xc98f('0x4a')]({'where':{'id':_0x22cf3f[_0xc98f('0x43')]['id']}})[_0xc98f('0x25')](handleEntityNotFound(_0x7a7a2f,null))['then'](function(_0x3d119e){if(_0x3d119e){_0x1f574c=_0x3d119e;_0x512df4[_0xc98f('0x30')]=_[_0xc98f('0x44')](db['ServicenowField']['rawAttributes']);_0x512df4['query']=_[_0xc98f('0x44')](_0x22cf3f[_0xc98f('0x31')]);_0x512df4['filters']=_[_0xc98f('0x33')](_0x512df4[_0xc98f('0x30')],_0x512df4['query']);_0x296ffc[_0xc98f('0x34')]=_['intersection'](_0x512df4[_0xc98f('0x30')],qs['fields'](_0x22cf3f[_0xc98f('0x31')][_0xc98f('0x35')]));_0x296ffc[_0xc98f('0x34')]=_0x296ffc[_0xc98f('0x34')][_0xc98f('0x36')]?_0x296ffc['attributes']:_0x512df4[_0xc98f('0x30')];_0x296ffc[_0xc98f('0x38')]=qs[_0xc98f('0x39')](_0x22cf3f[_0xc98f('0x31')][_0xc98f('0x39')]);_0x296ffc[_0xc98f('0x3a')]=qs[_0xc98f('0x32')](_[_0xc98f('0x3b')](_0x22cf3f[_0xc98f('0x31')],_0x512df4[_0xc98f('0x32')]));if(_0x22cf3f['query'][_0xc98f('0x3c')]){_0x296ffc[_0xc98f('0x3a')]=_['merge'](_0x296ffc[_0xc98f('0x3a')],{'$or':_[_0xc98f('0x2c')](_0x296ffc['attributes'],function(_0x429b9e){var _0x10fa81={};_0x10fa81[_0x429b9e]={'$like':'%'+_0x22cf3f[_0xc98f('0x31')][_0xc98f('0x3c')]+'%'};return _0x10fa81;})});}_0x296ffc=_[_0xc98f('0x3d')]({},_0x296ffc,_0x22cf3f['options']);return _0x1f574c['getDescriptions'](_0x296ffc);}})['then'](function(_0xa56e88){if(_0xa56e88){_0x5e41f6=_0xa56e88[_0xc98f('0x36')];if(!_0x22cf3f[_0xc98f('0x31')][_0xc98f('0x4d')](_0xc98f('0x37'))){_0x296ffc[_0xc98f('0x1c')]=qs[_0xc98f('0x1c')](_0x22cf3f[_0xc98f('0x31')][_0xc98f('0x1c')]);_0x296ffc[_0xc98f('0x1b')]=qs[_0xc98f('0x1b')](_0x22cf3f[_0xc98f('0x31')]['offset']);}return _0x1f574c['getDescriptions'](_0x296ffc);}})[_0xc98f('0x25')](function(_0x2b0fe8){if(_0x2b0fe8){return _0x2b0fe8?{'count':_0x5e41f6,'rows':_0x2b0fe8}:null;}})['then'](respondWithResult(_0x7a7a2f,null))['catch'](handleError(_0x7a7a2f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index e4a06e4..671d869 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 _0x1619=['int_servicenow_configurations','../../config/logger','moment','bluebird','request-promise','rimraf','./intServicenowConfiguration.attributes','define'];(function(_0x2ed7d9,_0x3e0125){var _0x473fa5=function(_0x1fbbd2){while(--_0x1fbbd2){_0x2ed7d9['push'](_0x2ed7d9['shift']());}};_0x473fa5(++_0x3e0125);}(_0x1619,0x189));var _0x9161=function(_0x34ebd4,_0x4d7edc){_0x34ebd4=_0x34ebd4-0x0;var _0x37fdc0=_0x1619[_0x34ebd4];return _0x37fdc0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9161('0x0'))('api');var moment=require(_0x9161('0x1'));var BPromise=require(_0x9161('0x2'));var rp=require(_0x9161('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9161('0x4'));var config=require('../../config/environment');var attributes=require(_0x9161('0x5'));module['exports']=function(_0x50ed78,_0x1b006d){return _0x50ed78[_0x9161('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0x9161('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b65=['api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x772d99,_0x3012b1){var _0x479bcc=function(_0x32ac92){while(--_0x32ac92){_0x772d99['push'](_0x772d99['shift']());}};_0x479bcc(++_0x3012b1);}(_0x2b65,0x131));var _0x52b6=function(_0x33cfe6,_0x3e215c){_0x33cfe6=_0x33cfe6-0x0;var _0x34b6cf=_0x2b65[_0x33cfe6];return _0x34b6cf;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var logger=require(_0x52b6('0x2'))(_0x52b6('0x3'));var moment=require(_0x52b6('0x4'));var BPromise=require(_0x52b6('0x5'));var rp=require(_0x52b6('0x6'));var fs=require('fs');var path=require(_0x52b6('0x7'));var rimraf=require('rimraf');var config=require(_0x52b6('0x8'));var attributes=require(_0x52b6('0x9'));module[_0x52b6('0xa')]=function(_0x2c643d,_0x25593f){return _0x2c643d[_0x52b6('0xb')](_0x52b6('0xc'),attributes,{'tableName':_0x52b6('0xd'),'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 70c8772..dd204e6 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 _0xa1a9=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug'];(function(_0x10c57a,_0x339472){var _0x1465d6=function(_0x2859b0){while(--_0x2859b0){_0x10c57a['push'](_0x10c57a['shift']());}};_0x1465d6(++_0x339472);}(_0xa1a9,0x75));var _0x9a1a=function(_0x165e15,_0x4b3c02){_0x165e15=_0x165e15-0x0;var _0xe8447a=_0xa1a9[_0x165e15];return _0xe8447a;};'use strict';var _=require(_0x9a1a('0x0'));var util=require(_0x9a1a('0x1'));var moment=require('moment');var BPromise=require(_0x9a1a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a1a('0x3'));var db=require(_0x9a1a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a1a('0x5'))(_0x9a1a('0x6'));var config=require(_0x9a1a('0x7'));var jayson=require(_0x9a1a('0x8'));var client=jayson['client'][_0x9a1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31fed8,_0x5f6a06,_0x3ef39d){return new BPromise(function(_0x97784f,_0x41794d){return client[_0x9a1a('0xa')](_0x31fed8,_0x3ef39d)[_0x9a1a('0xb')](function(_0x3011b3){logger[_0x9a1a('0xc')](_0x9a1a('0xd'),_0x5f6a06,'request\x20sent');logger[_0x9a1a('0xe')](_0x9a1a('0xf'),_0x5f6a06,_0x9a1a('0x10'),JSON[_0x9a1a('0x11')](_0x3011b3));if(_0x3011b3['error']){if(_0x3011b3[_0x9a1a('0x12')][_0x9a1a('0x13')]===0x1f4){logger[_0x9a1a('0x12')](_0x9a1a('0xd'),_0x5f6a06,_0x3011b3[_0x9a1a('0x12')][_0x9a1a('0x14')]);return _0x41794d(_0x3011b3[_0x9a1a('0x12')]['message']);}logger['error'](_0x9a1a('0xd'),_0x5f6a06,_0x3011b3['error'][_0x9a1a('0x14')]);return _0x97784f(_0x3011b3[_0x9a1a('0x12')][_0x9a1a('0x14')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x5f6a06,_0x9a1a('0x10'));_0x97784f(_0x3011b3[_0x9a1a('0x15')][_0x9a1a('0x14')]);}})['catch'](function(_0xc63c63){logger[_0x9a1a('0x12')](_0x9a1a('0xd'),_0x5f6a06,_0xc63c63);_0x41794d(_0xc63c63);});});} \ No newline at end of file +var _0xc260=['debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x47c068,_0x4dea98){var _0x52aac2=function(_0x223a67){while(--_0x223a67){_0x47c068['push'](_0x47c068['shift']());}};_0x52aac2(++_0x4dea98);}(_0xc260,0x151));var _0x0c26=function(_0x1ce3f9,_0x4d8f26){_0x1ce3f9=_0x1ce3f9-0x0;var _0x43c85e=_0xc260[_0x1ce3f9];return _0x43c85e;};'use strict';var _=require('lodash');var util=require(_0x0c26('0x0'));var moment=require(_0x0c26('0x1'));var BPromise=require(_0x0c26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c26('0x3'));var db=require(_0x0c26('0x4'))['db'];var utils=require(_0x0c26('0x5'));var logger=require('../../config/logger')(_0x0c26('0x6'));var config=require(_0x0c26('0x7'));var jayson=require(_0x0c26('0x8'));var client=jayson[_0x0c26('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b2600,_0x5738aa,_0x351980){return new BPromise(function(_0x159b91,_0x59d33b){return client[_0x0c26('0xa')](_0x4b2600,_0x351980)[_0x0c26('0xb')](function(_0x109ccc){logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x5738aa,_0x0c26('0xe'));logger[_0x0c26('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5738aa,_0x0c26('0xe'),JSON[_0x0c26('0x10')](_0x109ccc));if(_0x109ccc['error']){if(_0x109ccc[_0x0c26('0x11')][_0x0c26('0x12')]===0x1f4){logger['error'](_0x0c26('0xd'),_0x5738aa,_0x109ccc[_0x0c26('0x11')][_0x0c26('0x13')]);return _0x59d33b(_0x109ccc[_0x0c26('0x11')][_0x0c26('0x13')]);}logger[_0x0c26('0x11')](_0x0c26('0xd'),_0x5738aa,_0x109ccc['error'][_0x0c26('0x13')]);return _0x159b91(_0x109ccc[_0x0c26('0x11')][_0x0c26('0x13')]);}else{logger[_0x0c26('0xc')](_0x0c26('0xd'),_0x5738aa,_0x0c26('0xe'));_0x159b91(_0x109ccc[_0x0c26('0x14')][_0x0c26('0x13')]);}})[_0x0c26('0x15')](function(_0xef680d){logger[_0x0c26('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5738aa,_0xef680d);_0x59d33b(_0xef680d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 9e3af05..4749ff4 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 _0xc4b2=['isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','get'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0xc4b2,0xda));var _0x2c4b=function(_0x639772,_0x19d681){_0x639772=_0x639772-0x0;var _0x54da9f=_0xc4b2[_0x639772];return _0x54da9f;};'use strict';var multer=require(_0x2c4b('0x0'));var util=require(_0x2c4b('0x1'));var path=require(_0x2c4b('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c4b('0x3'));var router=express[_0x2c4b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c4b('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router[_0x2c4b('0x6')]('/',auth[_0x2c4b('0x7')](),controller[_0x2c4b('0x8')]);router['get'](_0x2c4b('0x9'),auth[_0x2c4b('0x7')](),controller[_0x2c4b('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2c4b('0xb')](_0x2c4b('0x9'),auth[_0x2c4b('0x7')](),controller[_0x2c4b('0xc')]);router[_0x2c4b('0xd')](_0x2c4b('0x9'),auth[_0x2c4b('0x7')](),controller['destroy']);module[_0x2c4b('0xe')]=router; \ No newline at end of file +var _0x9e2e=['exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy'];(function(_0x483786,_0x40583c){var _0x39e651=function(_0x362fd8){while(--_0x362fd8){_0x483786['push'](_0x483786['shift']());}};_0x39e651(++_0x40583c);}(_0x9e2e,0x121));var _0xe9e2=function(_0x4c3373,_0x160100){_0x4c3373=_0x4c3373-0x0;var _0x3a3864=_0x9e2e[_0x4c3373];return _0x3a3864;};'use strict';var multer=require('multer');var util=require(_0xe9e2('0x0'));var path=require('path');var timeout=require(_0xe9e2('0x1'));var express=require(_0xe9e2('0x2'));var router=express['Router']();var fs_extra=require(_0xe9e2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe9e2('0x4'));var config=require(_0xe9e2('0x5'));var controller=require(_0xe9e2('0x6'));router['get']('/',auth[_0xe9e2('0x7')](),controller[_0xe9e2('0x8')]);router[_0xe9e2('0x9')](_0xe9e2('0xa'),auth[_0xe9e2('0x7')](),controller[_0xe9e2('0xb')]);router['post']('/',auth[_0xe9e2('0x7')](),controller[_0xe9e2('0xc')]);router[_0xe9e2('0xd')](_0xe9e2('0xa'),auth[_0xe9e2('0x7')](),controller[_0xe9e2('0xe')]);router[_0xe9e2('0xf')](_0xe9e2('0xa'),auth[_0xe9e2('0x7')](),controller[_0xe9e2('0x10')]);module[_0xe9e2('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 7422bd8..e84005f 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 _0xcf68=['sequelize','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0xcf68,0x170));var _0x8cf6=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xcf68[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0x8cf6('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8cf6('0x1'),_0x8cf6('0x2'),_0x8cf6('0x3'),_0x8cf6('0x4'),_0x8cf6('0x5')),'defaultValue':_0x8cf6('0x1')},'content':{'type':Sequelize[_0x8cf6('0x6')]},'key':{'type':Sequelize[_0x8cf6('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x8cf6('0x1'),_0x8cf6('0x2'),_0x8cf6('0x3'))},'keyContent':{'type':Sequelize[_0x8cf6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8cf6('0x6')]},'customField':{'type':Sequelize[_0x8cf6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8cf6('0x6')]}}; \ No newline at end of file +var _0x7214=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x17e4f9,_0x4318be){var _0xf6cb46=function(_0x329493){while(--_0x329493){_0x17e4f9['push'](_0x17e4f9['shift']());}};_0xf6cb46(++_0x4318be);}(_0x7214,0x143));var _0x4721=function(_0xae39f,_0x27b6ff){_0xae39f=_0xae39f-0x0;var _0x3de66a=_0x7214[_0xae39f];return _0x3de66a;};'use strict';var Sequelize=require(_0x4721('0x0'));module[_0x4721('0x1')]={'type':{'type':Sequelize[_0x4721('0x2')](_0x4721('0x3'),_0x4721('0x4'),_0x4721('0x5'),_0x4721('0x6'),_0x4721('0x7')),'defaultValue':_0x4721('0x3')},'content':{'type':Sequelize[_0x4721('0x8')]},'key':{'type':Sequelize[_0x4721('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x4721('0x4'),_0x4721('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4721('0x8')]},'nameField':{'type':Sequelize[_0x4721('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4721('0x8')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index a11359f..5e61823 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 _0x5dd8=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','map','ServicenowField','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv'];(function(_0x12608a,_0x2e3732){var _0x369992=function(_0x3fbea7){while(--_0x3fbea7){_0x12608a['push'](_0x12608a['shift']());}};_0x369992(++_0x2e3732);}(_0x5dd8,0x18e));var _0x85dd=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x5dd8[_0x329664];return _0x4e346e;};'use strict';var emlformat=require(_0x85dd('0x0'));var rimraf=require(_0x85dd('0x1'));var zipdir=require(_0x85dd('0x2'));var jsonpatch=require(_0x85dd('0x3'));var rp=require(_0x85dd('0x4'));var moment=require(_0x85dd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x85dd('0x6'));var util=require(_0x85dd('0x7'));var path=require(_0x85dd('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x85dd('0x9'));var fs=require('fs');var fs_extra=require(_0x85dd('0xa'));var _=require(_0x85dd('0xb'));var squel=require(_0x85dd('0xc'));var crypto=require(_0x85dd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x85dd('0xe'));var toCsv=require(_0x85dd('0xf'));var querystring=require('querystring');var Papa=require(_0x85dd('0x10'));var Redis=require(_0x85dd('0x11'));var authService=require(_0x85dd('0x12'));var qs=require(_0x85dd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x85dd('0x14'));var utils=require('../../config/utils');var config=require(_0x85dd('0x15'));var licenseUtil=require(_0x85dd('0x16'));var db=require(_0x85dd('0x17'))['db'];function respondWithStatusCode(_0x1b61e4,_0x5b4c35){_0x5b4c35=_0x5b4c35||0xcc;return function(_0x14eb2f){if(_0x14eb2f){return _0x1b61e4[_0x85dd('0x18')](_0x5b4c35);}return _0x1b61e4['status'](_0x5b4c35)[_0x85dd('0x19')]();};}function respondWithResult(_0x1a66ce,_0x4cf311){_0x4cf311=_0x4cf311||0xc8;return function(_0x3b5283){if(_0x3b5283){return _0x1a66ce[_0x85dd('0x1a')](_0x4cf311)[_0x85dd('0x1b')](_0x3b5283);}};}function respondWithFilteredResult(_0x4c0d33,_0x1f3821){return function(_0x430686){if(_0x430686){var _0x5e3df9=typeof _0x1f3821[_0x85dd('0x1c')]===_0x85dd('0x1d')&&typeof _0x1f3821[_0x85dd('0x1e')]==='undefined';var _0x29c19a=_0x430686[_0x85dd('0x1f')];var _0x56027c=_0x5e3df9?0x0:_0x1f3821[_0x85dd('0x1c')];var _0x4f56be=_0x5e3df9?_0x430686[_0x85dd('0x1f')]:_0x1f3821[_0x85dd('0x1c')]+_0x1f3821[_0x85dd('0x1e')];var _0x39ef29;if(_0x4f56be>=_0x29c19a){_0x4f56be=_0x29c19a;_0x39ef29=0xc8;}else{_0x39ef29=0xce;}_0x4c0d33[_0x85dd('0x1a')](_0x39ef29);return _0x4c0d33[_0x85dd('0x20')](_0x85dd('0x21'),_0x56027c+'-'+_0x4f56be+'/'+_0x29c19a)['json'](_0x430686);}return null;};}function patchUpdates(_0x262632){return function(_0xffd24){try{jsonpatch['apply'](_0xffd24,_0x262632,!![]);}catch(_0x175000){return BPromise['reject'](_0x175000);}return _0xffd24['save']();};}function saveUpdates(_0x18ac5e,_0x2bd934){return function(_0x3a4fda){if(_0x3a4fda){return _0x3a4fda[_0x85dd('0x22')](_0x18ac5e)[_0x85dd('0x23')](function(_0x5aa73a){return _0x5aa73a;});}return null;};}function removeEntity(_0x43c661,_0x1c688e){return function(_0xc7c597){if(_0xc7c597){return _0xc7c597['destroy']()[_0x85dd('0x23')](function(){_0x43c661['status'](0xcc)[_0x85dd('0x19')]();});}};}function handleEntityNotFound(_0x434370,_0x1ff162){return function(_0x1e902c){if(!_0x1e902c){_0x434370[_0x85dd('0x18')](0x194);}return _0x1e902c;};}function handleError(_0x47de13,_0x224482){_0x224482=_0x224482||0x1f4;return function(_0x5cc767){logger[_0x85dd('0x24')](_0x5cc767[_0x85dd('0x25')]);if(_0x5cc767[_0x85dd('0x26')]){delete _0x5cc767[_0x85dd('0x26')];}_0x47de13[_0x85dd('0x1a')](_0x224482)[_0x85dd('0x27')](_0x5cc767);};}exports['index']=function(_0x971d5d,_0x4d13c1){var _0x2258b3={},_0x341500={},_0x121dbe={'count':0x0,'rows':[]};var _0x1a6e6c=_[_0x85dd('0x28')](db[_0x85dd('0x29')][_0x85dd('0x2a')],function(_0x40e2a7){return{'name':_0x40e2a7['fieldName'],'type':_0x40e2a7[_0x85dd('0x2b')][_0x85dd('0x2c')]};});_0x341500[_0x85dd('0x2d')]=_[_0x85dd('0x28')](_0x1a6e6c,'name');_0x341500['query']=_[_0x85dd('0x2e')](_0x971d5d['query']);_0x341500[_0x85dd('0x2f')]=_['intersection'](_0x341500['model'],_0x341500[_0x85dd('0x30')]);_0x2258b3[_0x85dd('0x31')]=_[_0x85dd('0x32')](_0x341500[_0x85dd('0x2d')],qs['fields'](_0x971d5d[_0x85dd('0x30')][_0x85dd('0x33')]));_0x2258b3[_0x85dd('0x31')]=_0x2258b3['attributes'][_0x85dd('0x34')]?_0x2258b3['attributes']:_0x341500[_0x85dd('0x2d')];if(!_0x971d5d[_0x85dd('0x30')][_0x85dd('0x35')](_0x85dd('0x36'))){_0x2258b3[_0x85dd('0x1e')]=qs['limit'](_0x971d5d[_0x85dd('0x30')][_0x85dd('0x1e')]);_0x2258b3['offset']=qs[_0x85dd('0x1c')](_0x971d5d[_0x85dd('0x30')][_0x85dd('0x1c')]);}_0x2258b3['order']=qs[_0x85dd('0x37')](_0x971d5d['query'][_0x85dd('0x37')]);_0x2258b3[_0x85dd('0x38')]=qs['filters'](_['pick'](_0x971d5d[_0x85dd('0x30')],_0x341500['filters']),_0x1a6e6c);if(_0x971d5d[_0x85dd('0x30')][_0x85dd('0x39')]){_0x2258b3[_0x85dd('0x38')]=_['merge'](_0x2258b3[_0x85dd('0x38')],{'$or':_[_0x85dd('0x28')](_0x1a6e6c,function(_0x4e5d86){if(_0x4e5d86['type']!==_0x85dd('0x3a')){var _0x4c981d={};_0x4c981d[_0x4e5d86['name']]={'$like':'%'+_0x971d5d['query']['filter']+'%'};return _0x4c981d;}})});}_0x2258b3=_[_0x85dd('0x3b')]({},_0x2258b3,_0x971d5d[_0x85dd('0x3c')]);var _0x2daa8c={'where':_0x2258b3['where']};return db[_0x85dd('0x29')][_0x85dd('0x1f')](_0x2daa8c)[_0x85dd('0x23')](function(_0x5365c6){_0x121dbe[_0x85dd('0x1f')]=_0x5365c6;if(_0x971d5d[_0x85dd('0x30')][_0x85dd('0x3d')]){_0x2258b3[_0x85dd('0x3e')]=[{'all':!![]}];}return db[_0x85dd('0x29')][_0x85dd('0x3f')](_0x2258b3);})['then'](function(_0x2def2d){_0x121dbe['rows']=_0x2def2d;return _0x121dbe;})['then'](respondWithFilteredResult(_0x4d13c1,_0x2258b3))[_0x85dd('0x40')](handleError(_0x4d13c1,null));};exports['show']=function(_0x6f42f5,_0x14545b){var _0x468742={'raw':!![],'where':{'id':_0x6f42f5['params']['id']}},_0x4a3318={};_0x4a3318[_0x85dd('0x2d')]=_[_0x85dd('0x2e')](db['ServicenowField']['rawAttributes']);_0x4a3318['query']=_[_0x85dd('0x2e')](_0x6f42f5[_0x85dd('0x30')]);_0x4a3318[_0x85dd('0x2f')]=_[_0x85dd('0x32')](_0x4a3318[_0x85dd('0x2d')],_0x4a3318[_0x85dd('0x30')]);_0x468742['attributes']=_[_0x85dd('0x32')](_0x4a3318[_0x85dd('0x2d')],qs[_0x85dd('0x33')](_0x6f42f5['query'][_0x85dd('0x33')]));_0x468742[_0x85dd('0x31')]=_0x468742[_0x85dd('0x31')][_0x85dd('0x34')]?_0x468742['attributes']:_0x4a3318[_0x85dd('0x2d')];if(_0x6f42f5[_0x85dd('0x30')][_0x85dd('0x3d')]){_0x468742[_0x85dd('0x3e')]=[{'all':!![]}];}_0x468742=_[_0x85dd('0x3b')]({},_0x468742,_0x6f42f5['options']);return db[_0x85dd('0x29')][_0x85dd('0x41')](_0x468742)[_0x85dd('0x23')](handleEntityNotFound(_0x14545b,null))['then'](respondWithResult(_0x14545b,null))[_0x85dd('0x40')](handleError(_0x14545b,null));};exports['create']=function(_0x30a746,_0x52d8e3){return db[_0x85dd('0x29')]['create'](_0x30a746[_0x85dd('0x42')],{})['then'](respondWithResult(_0x52d8e3,0xc9))['catch'](handleError(_0x52d8e3,null));};exports['update']=function(_0x2a164c,_0x5738d8){if(_0x2a164c['body']['id']){delete _0x2a164c['body']['id'];}return db['ServicenowField'][_0x85dd('0x41')]({'where':{'id':_0x2a164c[_0x85dd('0x43')]['id']}})[_0x85dd('0x23')](handleEntityNotFound(_0x5738d8,null))[_0x85dd('0x23')](saveUpdates(_0x2a164c[_0x85dd('0x42')],null))[_0x85dd('0x23')](respondWithResult(_0x5738d8,null))[_0x85dd('0x40')](handleError(_0x5738d8,null));};exports[_0x85dd('0x44')]=function(_0x136db8,_0x52e3cf){return db[_0x85dd('0x29')][_0x85dd('0x41')]({'where':{'id':_0x136db8[_0x85dd('0x43')]['id']}})[_0x85dd('0x23')](handleEntityNotFound(_0x52e3cf,null))['then'](removeEntity(_0x52e3cf,null))[_0x85dd('0x40')](handleError(_0x52e3cf,null));}; \ No newline at end of file +var _0x30d7=['intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','includeAll','include','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','count','status','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0xe6dc60,_0x57d06a){var _0x272681=function(_0x46fbec){while(--_0x46fbec){_0xe6dc60['push'](_0xe6dc60['shift']());}};_0x272681(++_0x57d06a);}(_0x30d7,0x1db));var _0x730d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30d7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x730d('0x0'));var zipdir=require(_0x730d('0x1'));var jsonpatch=require(_0x730d('0x2'));var rp=require(_0x730d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x730d('0x4'));var util=require(_0x730d('0x5'));var path=require(_0x730d('0x6'));var sox=require(_0x730d('0x7'));var csv=require('to-csv');var ejs=require(_0x730d('0x8'));var fs=require('fs');var fs_extra=require(_0x730d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x730d('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x730d('0xb'));var Papa=require('papaparse');var Redis=require(_0x730d('0xc'));var authService=require(_0x730d('0xd'));var qs=require(_0x730d('0xe'));var as=require(_0x730d('0xf'));var hardwareService=require(_0x730d('0x10'));var logger=require('../../config/logger')(_0x730d('0x11'));var utils=require(_0x730d('0x12'));var config=require(_0x730d('0x13'));var licenseUtil=require(_0x730d('0x14'));var db=require(_0x730d('0x15'))['db'];function respondWithStatusCode(_0x1733e4,_0x28ff06){_0x28ff06=_0x28ff06||0xcc;return function(_0x538f92){if(_0x538f92){return _0x1733e4[_0x730d('0x16')](_0x28ff06);}return _0x1733e4['status'](_0x28ff06)[_0x730d('0x17')]();};}function respondWithResult(_0x5475db,_0x1d432d){_0x1d432d=_0x1d432d||0xc8;return function(_0x5b691d){if(_0x5b691d){return _0x5475db['status'](_0x1d432d)['json'](_0x5b691d);}};}function respondWithFilteredResult(_0xae8924,_0x195192){return function(_0x31d3bf){if(_0x31d3bf){var _0x5b216=typeof _0x195192[_0x730d('0x18')]===_0x730d('0x19')&&typeof _0x195192['limit']===_0x730d('0x19');var _0x4bc39f=_0x31d3bf[_0x730d('0x1a')];var _0x520e65=_0x5b216?0x0:_0x195192['offset'];var _0xf5d13c=_0x5b216?_0x31d3bf[_0x730d('0x1a')]:_0x195192[_0x730d('0x18')]+_0x195192['limit'];var _0x1c7e12;if(_0xf5d13c>=_0x4bc39f){_0xf5d13c=_0x4bc39f;_0x1c7e12=0xc8;}else{_0x1c7e12=0xce;}_0xae8924[_0x730d('0x1b')](_0x1c7e12);return _0xae8924[_0x730d('0x1c')](_0x730d('0x1d'),_0x520e65+'-'+_0xf5d13c+'/'+_0x4bc39f)[_0x730d('0x1e')](_0x31d3bf);}return null;};}function patchUpdates(_0x3f62e8){return function(_0x1039a1){try{jsonpatch[_0x730d('0x1f')](_0x1039a1,_0x3f62e8,!![]);}catch(_0x582d4a){return BPromise['reject'](_0x582d4a);}return _0x1039a1[_0x730d('0x20')]();};}function saveUpdates(_0x322f04,_0x1cf714){return function(_0x500f4f){if(_0x500f4f){return _0x500f4f[_0x730d('0x21')](_0x322f04)[_0x730d('0x22')](function(_0x348655){return _0x348655;});}return null;};}function removeEntity(_0x2d40da,_0x68993f){return function(_0x22c053){if(_0x22c053){return _0x22c053[_0x730d('0x23')]()[_0x730d('0x22')](function(){_0x2d40da[_0x730d('0x1b')](0xcc)[_0x730d('0x17')]();});}};}function handleEntityNotFound(_0x294d92,_0x14eb08){return function(_0x5bbe38){if(!_0x5bbe38){_0x294d92[_0x730d('0x16')](0x194);}return _0x5bbe38;};}function handleError(_0x19ba02,_0x13aa44){_0x13aa44=_0x13aa44||0x1f4;return function(_0x217841){logger[_0x730d('0x24')](_0x217841[_0x730d('0x25')]);if(_0x217841[_0x730d('0x26')]){delete _0x217841[_0x730d('0x26')];}_0x19ba02[_0x730d('0x1b')](_0x13aa44)['send'](_0x217841);};}exports[_0x730d('0x27')]=function(_0x167a98,_0x33935f){var _0x3a9abf={},_0x364ff2={},_0x3b54ff={'count':0x0,'rows':[]};var _0x447fc3=_[_0x730d('0x28')](db[_0x730d('0x29')][_0x730d('0x2a')],function(_0x439835){return{'name':_0x439835[_0x730d('0x2b')],'type':_0x439835[_0x730d('0x2c')][_0x730d('0x2d')]};});_0x364ff2[_0x730d('0x2e')]=_[_0x730d('0x28')](_0x447fc3,_0x730d('0x26'));_0x364ff2[_0x730d('0x2f')]=_[_0x730d('0x30')](_0x167a98[_0x730d('0x2f')]);_0x364ff2[_0x730d('0x31')]=_[_0x730d('0x32')](_0x364ff2[_0x730d('0x2e')],_0x364ff2[_0x730d('0x2f')]);_0x3a9abf[_0x730d('0x33')]=_['intersection'](_0x364ff2[_0x730d('0x2e')],qs[_0x730d('0x34')](_0x167a98[_0x730d('0x2f')]['fields']));_0x3a9abf[_0x730d('0x33')]=_0x3a9abf[_0x730d('0x33')][_0x730d('0x35')]?_0x3a9abf[_0x730d('0x33')]:_0x364ff2[_0x730d('0x2e')];if(!_0x167a98['query'][_0x730d('0x36')](_0x730d('0x37'))){_0x3a9abf[_0x730d('0x38')]=qs[_0x730d('0x38')](_0x167a98[_0x730d('0x2f')][_0x730d('0x38')]);_0x3a9abf['offset']=qs[_0x730d('0x18')](_0x167a98['query'][_0x730d('0x18')]);}_0x3a9abf[_0x730d('0x39')]=qs[_0x730d('0x3a')](_0x167a98[_0x730d('0x2f')][_0x730d('0x3a')]);_0x3a9abf[_0x730d('0x3b')]=qs[_0x730d('0x31')](_[_0x730d('0x3c')](_0x167a98[_0x730d('0x2f')],_0x364ff2[_0x730d('0x31')]),_0x447fc3);if(_0x167a98[_0x730d('0x2f')]['filter']){_0x3a9abf[_0x730d('0x3b')]=_[_0x730d('0x3d')](_0x3a9abf[_0x730d('0x3b')],{'$or':_[_0x730d('0x28')](_0x447fc3,function(_0x63be10){if(_0x63be10[_0x730d('0x2c')]!==_0x730d('0x3e')){var _0x47b1d5={};_0x47b1d5[_0x63be10[_0x730d('0x26')]]={'$like':'%'+_0x167a98[_0x730d('0x2f')][_0x730d('0x3f')]+'%'};return _0x47b1d5;}})});}_0x3a9abf=_['merge']({},_0x3a9abf,_0x167a98['options']);var _0x39d9a7={'where':_0x3a9abf[_0x730d('0x3b')]};return db[_0x730d('0x29')][_0x730d('0x1a')](_0x39d9a7)[_0x730d('0x22')](function(_0x3d0467){_0x3b54ff[_0x730d('0x1a')]=_0x3d0467;if(_0x167a98['query']['includeAll']){_0x3a9abf['include']=[{'all':!![]}];}return db[_0x730d('0x29')][_0x730d('0x40')](_0x3a9abf);})[_0x730d('0x22')](function(_0x36e2ce){_0x3b54ff[_0x730d('0x41')]=_0x36e2ce;return _0x3b54ff;})[_0x730d('0x22')](respondWithFilteredResult(_0x33935f,_0x3a9abf))[_0x730d('0x42')](handleError(_0x33935f,null));};exports[_0x730d('0x43')]=function(_0x19da58,_0x5dbda2){var _0x562256={'raw':!![],'where':{'id':_0x19da58['params']['id']}},_0x3ee60f={};_0x3ee60f[_0x730d('0x2e')]=_[_0x730d('0x30')](db['ServicenowField'][_0x730d('0x2a')]);_0x3ee60f[_0x730d('0x2f')]=_[_0x730d('0x30')](_0x19da58[_0x730d('0x2f')]);_0x3ee60f[_0x730d('0x31')]=_[_0x730d('0x32')](_0x3ee60f[_0x730d('0x2e')],_0x3ee60f[_0x730d('0x2f')]);_0x562256[_0x730d('0x33')]=_[_0x730d('0x32')](_0x3ee60f[_0x730d('0x2e')],qs[_0x730d('0x34')](_0x19da58[_0x730d('0x2f')][_0x730d('0x34')]));_0x562256[_0x730d('0x33')]=_0x562256[_0x730d('0x33')][_0x730d('0x35')]?_0x562256[_0x730d('0x33')]:_0x3ee60f[_0x730d('0x2e')];if(_0x19da58[_0x730d('0x2f')][_0x730d('0x44')]){_0x562256[_0x730d('0x45')]=[{'all':!![]}];}_0x562256=_[_0x730d('0x3d')]({},_0x562256,_0x19da58[_0x730d('0x46')]);return db[_0x730d('0x29')][_0x730d('0x47')](_0x562256)['then'](handleEntityNotFound(_0x5dbda2,null))[_0x730d('0x22')](respondWithResult(_0x5dbda2,null))['catch'](handleError(_0x5dbda2,null));};exports[_0x730d('0x48')]=function(_0x22dbd2,_0x4849d2){return db['ServicenowField'][_0x730d('0x48')](_0x22dbd2[_0x730d('0x49')],{})[_0x730d('0x22')](respondWithResult(_0x4849d2,0xc9))[_0x730d('0x42')](handleError(_0x4849d2,null));};exports[_0x730d('0x21')]=function(_0x5d299c,_0x4e382d){if(_0x5d299c[_0x730d('0x49')]['id']){delete _0x5d299c[_0x730d('0x49')]['id'];}return db[_0x730d('0x29')]['find']({'where':{'id':_0x5d299c[_0x730d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4e382d,null))['then'](saveUpdates(_0x5d299c[_0x730d('0x49')],null))[_0x730d('0x22')](respondWithResult(_0x4e382d,null))[_0x730d('0x42')](handleError(_0x4e382d,null));};exports['destroy']=function(_0x237978,_0x3fc151){return db[_0x730d('0x29')]['find']({'where':{'id':_0x237978[_0x730d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3fc151,null))[_0x730d('0x22')](removeEntity(_0x3fc151,null))[_0x730d('0x42')](handleError(_0x3fc151,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 023d527..2384cc3 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 _0x0532=['rimraf','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','moment','bluebird','request-promise'];(function(_0x7b0433,_0x1aadc5){var _0x407991=function(_0x44bd13){while(--_0x44bd13){_0x7b0433['push'](_0x7b0433['shift']());}};_0x407991(++_0x1aadc5);}(_0x0532,0x14c));var _0x2053=function(_0x5cdd60,_0x5de353){_0x5cdd60=_0x5cdd60-0x0;var _0x3d0ae9=_0x0532[_0x5cdd60];return _0x3d0ae9;};'use strict';var _=require(_0x2053('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2053('0x1'));var BPromise=require(_0x2053('0x2'));var rp=require(_0x2053('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2053('0x4'));var config=require('../../config/environment');var attributes=require(_0x2053('0x5'));module[_0x2053('0x6')]=function(_0x2ff363,_0x14c5a4){return _0x2ff363['define'](_0x2053('0x7'),attributes,{'tableName':_0x2053('0x8'),'paranoid':![],'indexes':[{'name':_0x2053('0x9'),'fields':[_0x2053('0xa'),_0x2053('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c7d=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','idField','FieldId','lodash','util','moment','bluebird','request-promise'];(function(_0x42d645,_0x61c13f){var _0x448a1=function(_0x285d12){while(--_0x285d12){_0x42d645['push'](_0x42d645['shift']());}};_0x448a1(++_0x61c13f);}(_0x8c7d,0x13f));var _0xd8c7=function(_0x4ce942,_0x1cde4e){_0x4ce942=_0x4ce942-0x0;var _0x37823a=_0x8c7d[_0x4ce942];return _0x37823a;};'use strict';var _=require(_0xd8c7('0x0'));var util=require(_0xd8c7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd8c7('0x2'));var BPromise=require(_0xd8c7('0x3'));var rp=require(_0xd8c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8c7('0x5'));var config=require(_0xd8c7('0x6'));var attributes=require(_0xd8c7('0x7'));module[_0xd8c7('0x8')]=function(_0x23b091,_0x479551){return _0x23b091['define'](_0xd8c7('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xd8c7('0xa'),_0xd8c7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 92ba7d5..4fc78fe 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 _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x57a143,_0x220898){var _0x504556=function(_0x1cb6d4){while(--_0x1cb6d4){_0x57a143['push'](_0x57a143['shift']());}};_0x504556(++_0x220898);}(_0x70e0,0x17b));var _0x070e=function(_0x4ec64d,_0x248423){_0x4ec64d=_0x4ec64d-0x0;var _0x246fc8=_0x70e0[_0x4ec64d];return _0x246fc8;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0xf56d4a,_0x5e5790){var _0x319aed=function(_0x20a199){while(--_0x20a199){_0xf56d4a['push'](_0xf56d4a['shift']());}};_0x319aed(++_0x5e5790);}(_0xb7e7,0x121));var _0x7b7e=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xb7e7[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index db6c1ff..73f3027 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x174218,_0x208955){var _0x4bd4db=function(_0x3f8298){while(--_0x3f8298){_0x174218['push'](_0x174218['shift']());}};_0x4bd4db(++_0x208955);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x23ad8e,_0xc7b498){var _0x35f23c=function(_0x57ab34){while(--_0x57ab34){_0x23ad8e['push'](_0x23ad8e['shift']());}};_0x35f23c(++_0xc7b498);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 3dac52e..d25dc2d 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(_0x4fb185,_0x39a6d2){var _0x1d1d4=function(_0xa4e301){while(--_0xa4e301){_0x4fb185['push'](_0x4fb185['shift']());}};_0x1d1d4(++_0x39a6d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x3ae805,_0x507f1a){var _0x4c3061=function(_0x26bba7){while(--_0x26bba7){_0x3ae805['push'](_0x3ae805['shift']());}};_0x4c3061(++_0x507f1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 93d06c4..6d941aa 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 _0x916a=['xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','stringify','Calls','values','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','SugarcrmAccount','findAll','rows','catch','show','params','include','create','body','find','destroy','getConfigurations','findOne','SugarcrmConfiguration','AccountId','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','username','PLAIN'];(function(_0x14d3cc,_0x567831){var _0x1f822b=function(_0x1eeeb9){while(--_0x1eeeb9){_0x14d3cc['push'](_0x14d3cc['shift']());}};_0x1f822b(++_0x567831);}(_0x916a,0x8f));var _0xa916=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x916a[_0x220dbb];return _0x2b77de;};'use strict';var emlformat=require(_0xa916('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa916('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa916('0x2'));var moment=require(_0xa916('0x3'));var BPromise=require(_0xa916('0x4'));var Mustache=require(_0xa916('0x5'));var util=require(_0xa916('0x6'));var path=require(_0xa916('0x7'));var sox=require(_0xa916('0x8'));var csv=require(_0xa916('0x9'));var ejs=require(_0xa916('0xa'));var fs=require('fs');var fs_extra=require(_0xa916('0xb'));var _=require(_0xa916('0xc'));var squel=require(_0xa916('0xd'));var crypto=require(_0xa916('0xe'));var jsforce=require(_0xa916('0xf'));var deskjs=require(_0xa916('0x10'));var toCsv=require(_0xa916('0x9'));var querystring=require(_0xa916('0x11'));var Papa=require('papaparse');var Redis=require(_0xa916('0x12'));var authService=require(_0xa916('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa916('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa916('0x15'))(_0xa916('0x16'));var utils=require(_0xa916('0x17'));var config=require(_0xa916('0x18'));var licenseUtil=require(_0xa916('0x19'));var db=require(_0xa916('0x1a'))['db'];var integrations=require(_0xa916('0x1b'));function respondWithStatusCode(_0x399081,_0x31a5a1){_0x31a5a1=_0x31a5a1||0xcc;return function(_0x4684be){if(_0x4684be){return _0x399081['sendStatus'](_0x31a5a1);}return _0x399081['status'](_0x31a5a1)[_0xa916('0x1c')]();};}function respondWithResult(_0x4c1ac7,_0x507189){_0x507189=_0x507189||0xc8;return function(_0x100c4f){if(_0x100c4f){return _0x4c1ac7[_0xa916('0x1d')](_0x507189)[_0xa916('0x1e')](_0x100c4f);}};}function respondWithFilteredResult(_0x3f34fa,_0x3da5f2){return function(_0x43b543){if(_0x43b543){var _0x547f3a=typeof _0x3da5f2[_0xa916('0x1f')]===_0xa916('0x20')&&typeof _0x3da5f2[_0xa916('0x21')]==='undefined';var _0x1fa5b2=_0x43b543[_0xa916('0x22')];var _0x4ae927=_0x547f3a?0x0:_0x3da5f2[_0xa916('0x1f')];var _0x5717c3=_0x547f3a?_0x43b543[_0xa916('0x22')]:_0x3da5f2['offset']+_0x3da5f2['limit'];var _0x4a2fe8;if(_0x5717c3>=_0x1fa5b2){_0x5717c3=_0x1fa5b2;_0x4a2fe8=0xc8;}else{_0x4a2fe8=0xce;}_0x3f34fa['status'](_0x4a2fe8);return _0x3f34fa[_0xa916('0x23')](_0xa916('0x24'),_0x4ae927+'-'+_0x5717c3+'/'+_0x1fa5b2)['json'](_0x43b543);}return null;};}function patchUpdates(_0x3630f4){return function(_0x22ac88){try{jsonpatch[_0xa916('0x25')](_0x22ac88,_0x3630f4,!![]);}catch(_0x2a1000){return BPromise[_0xa916('0x26')](_0x2a1000);}return _0x22ac88[_0xa916('0x27')]();};}function saveUpdates(_0x141d0d,_0x39a6ee){return function(_0x3bee55){if(_0x3bee55){return _0x3bee55[_0xa916('0x28')](_0x141d0d)['then'](function(_0x4c5534){return _0x4c5534;});}return null;};}function removeEntity(_0x2a0f4b,_0x31bd36){return function(_0x19989e){if(_0x19989e){return _0x19989e['destroy']()['then'](function(){_0x2a0f4b[_0xa916('0x1d')](0xcc)[_0xa916('0x1c')]();});}};}function handleEntityNotFound(_0x1a57f3,_0xf48728){return function(_0x1a3b32){if(!_0x1a3b32){_0x1a57f3[_0xa916('0x29')](0x194);}return _0x1a3b32;};}function handleError(_0x519d6d,_0xe667d0){_0xe667d0=_0xe667d0||0x1f4;return function(_0x573509){logger[_0xa916('0x2a')](_0x573509[_0xa916('0x2b')]);if(_0x573509['name']){delete _0x573509[_0xa916('0x2c')];}_0x519d6d[_0xa916('0x1d')](_0xe667d0)['send'](_0x573509);};}exports[_0xa916('0x2d')]=function(_0x4b2aef,_0x494528){var _0x5dc5={},_0x173f6f={},_0x35a245={'count':0x0,'rows':[]};var _0x2e8725=_['map'](db['SugarcrmAccount'][_0xa916('0x2e')],function(_0x4d81e4){return{'name':_0x4d81e4[_0xa916('0x2f')],'type':_0x4d81e4[_0xa916('0x30')][_0xa916('0x31')]};});_0x173f6f[_0xa916('0x32')]=_['map'](_0x2e8725,_0xa916('0x2c'));_0x173f6f[_0xa916('0x33')]=_[_0xa916('0x34')](_0x4b2aef['query']);_0x173f6f[_0xa916('0x35')]=_[_0xa916('0x36')](_0x173f6f['model'],_0x173f6f[_0xa916('0x33')]);_0x5dc5['attributes']=_[_0xa916('0x36')](_0x173f6f[_0xa916('0x32')],qs[_0xa916('0x37')](_0x4b2aef[_0xa916('0x33')]['fields']));_0x5dc5[_0xa916('0x38')]=_0x5dc5['attributes'][_0xa916('0x39')]?_0x5dc5[_0xa916('0x38')]:_0x173f6f['model'];if(!_0x4b2aef['query'][_0xa916('0x3a')](_0xa916('0x3b'))){_0x5dc5['limit']=qs[_0xa916('0x21')](_0x4b2aef[_0xa916('0x33')][_0xa916('0x21')]);_0x5dc5[_0xa916('0x1f')]=qs[_0xa916('0x1f')](_0x4b2aef[_0xa916('0x33')]['offset']);}_0x5dc5[_0xa916('0x3c')]=qs[_0xa916('0x3d')](_0x4b2aef[_0xa916('0x33')]['sort']);_0x5dc5[_0xa916('0x3e')]=qs['filters'](_[_0xa916('0x3f')](_0x4b2aef[_0xa916('0x33')],_0x173f6f[_0xa916('0x35')]),_0x2e8725);if(_0x4b2aef[_0xa916('0x33')][_0xa916('0x40')]){_0x5dc5[_0xa916('0x3e')]=_[_0xa916('0x41')](_0x5dc5[_0xa916('0x3e')],{'$or':_[_0xa916('0x42')](_0x2e8725,function(_0x47d46f){if(_0x47d46f[_0xa916('0x30')]!==_0xa916('0x43')){var _0xc64c09={};_0xc64c09[_0x47d46f[_0xa916('0x2c')]]={'$like':'%'+_0x4b2aef[_0xa916('0x33')][_0xa916('0x40')]+'%'};return _0xc64c09;}})});}_0x5dc5=_[_0xa916('0x41')]({},_0x5dc5,_0x4b2aef[_0xa916('0x44')]);var _0x1c27b4={'where':_0x5dc5[_0xa916('0x3e')]};return db['SugarcrmAccount'][_0xa916('0x22')](_0x1c27b4)[_0xa916('0x45')](function(_0x4e4d36){_0x35a245[_0xa916('0x22')]=_0x4e4d36;if(_0x4b2aef[_0xa916('0x33')][_0xa916('0x46')]){_0x5dc5['include']=[{'all':!![]}];}return db[_0xa916('0x47')][_0xa916('0x48')](_0x5dc5);})['then'](function(_0x55845d){_0x35a245[_0xa916('0x49')]=_0x55845d;return _0x35a245;})[_0xa916('0x45')](respondWithFilteredResult(_0x494528,_0x5dc5))[_0xa916('0x4a')](handleError(_0x494528,null));};exports[_0xa916('0x4b')]=function(_0xb7e6e0,_0x545189){var _0x4f53a7={'raw':![],'where':{'id':_0xb7e6e0[_0xa916('0x4c')]['id']}},_0x46d568={};_0x46d568['model']=_[_0xa916('0x34')](db['SugarcrmAccount']['rawAttributes']);_0x46d568[_0xa916('0x33')]=_['keys'](_0xb7e6e0[_0xa916('0x33')]);_0x46d568[_0xa916('0x35')]=_[_0xa916('0x36')](_0x46d568[_0xa916('0x32')],_0x46d568[_0xa916('0x33')]);_0x4f53a7[_0xa916('0x38')]=_[_0xa916('0x36')](_0x46d568[_0xa916('0x32')],qs[_0xa916('0x37')](_0xb7e6e0[_0xa916('0x33')]['fields']));_0x4f53a7['attributes']=_0x4f53a7['attributes'][_0xa916('0x39')]?_0x4f53a7[_0xa916('0x38')]:_0x46d568[_0xa916('0x32')];if(_0xb7e6e0[_0xa916('0x33')][_0xa916('0x46')]){_0x4f53a7[_0xa916('0x4d')]=[{'all':!![]}];}_0x4f53a7=_[_0xa916('0x41')]({},_0x4f53a7,_0xb7e6e0[_0xa916('0x44')]);return db[_0xa916('0x47')]['find'](_0x4f53a7)[_0xa916('0x45')](handleEntityNotFound(_0x545189,null))[_0xa916('0x45')](respondWithResult(_0x545189,null))['catch'](handleError(_0x545189,null));};exports['create']=function(_0x66d367,_0x471139){return db[_0xa916('0x47')][_0xa916('0x4e')](_0x66d367[_0xa916('0x4f')],{})[_0xa916('0x45')](respondWithResult(_0x471139,0xc9))[_0xa916('0x4a')](handleError(_0x471139,null));};exports['update']=function(_0xfb7b49,_0x5be33c){if(_0xfb7b49[_0xa916('0x4f')]['id']){delete _0xfb7b49['body']['id'];}return db[_0xa916('0x47')][_0xa916('0x50')]({'where':{'id':_0xfb7b49[_0xa916('0x4c')]['id']}})[_0xa916('0x45')](handleEntityNotFound(_0x5be33c,null))['then'](saveUpdates(_0xfb7b49[_0xa916('0x4f')],null))[_0xa916('0x45')](respondWithResult(_0x5be33c,null))[_0xa916('0x4a')](handleError(_0x5be33c,null));};exports[_0xa916('0x51')]=function(_0x2aa5ea,_0x560d34){return db[_0xa916('0x47')][_0xa916('0x50')]({'where':{'id':_0x2aa5ea[_0xa916('0x4c')]['id']}})[_0xa916('0x45')](handleEntityNotFound(_0x560d34,null))[_0xa916('0x45')](removeEntity(_0x560d34,null))[_0xa916('0x4a')](handleError(_0x560d34,null));};exports[_0xa916('0x52')]=function(_0x2759c3,_0x54aba5,_0x326d6a){var _0x15a6fc={};var _0x37bbc5={};var _0x372d07;var _0x73acb1;return db[_0xa916('0x47')][_0xa916('0x53')]({'where':{'id':_0x2759c3[_0xa916('0x4c')]['id']}})['then'](handleEntityNotFound(_0x54aba5,null))[_0xa916('0x45')](function(_0x323e9c){if(_0x323e9c){_0x372d07=_0x323e9c;_0x37bbc5[_0xa916('0x32')]=_['keys'](db[_0xa916('0x54')][_0xa916('0x2e')]);_0x37bbc5[_0xa916('0x33')]=_['keys'](_0x2759c3[_0xa916('0x33')]);_0x37bbc5[_0xa916('0x35')]=_[_0xa916('0x36')](_0x37bbc5[_0xa916('0x32')],_0x37bbc5[_0xa916('0x33')]);_0x15a6fc['attributes']=_[_0xa916('0x36')](_0x37bbc5['model'],qs[_0xa916('0x37')](_0x2759c3[_0xa916('0x33')][_0xa916('0x37')]));_0x15a6fc[_0xa916('0x38')]=_0x15a6fc[_0xa916('0x38')][_0xa916('0x39')]?_0x15a6fc[_0xa916('0x38')]:_0x37bbc5[_0xa916('0x32')];_0x15a6fc[_0xa916('0x3c')]=qs[_0xa916('0x3d')](_0x2759c3['query'][_0xa916('0x3d')]);_0x15a6fc[_0xa916('0x3e')]=qs['filters'](_[_0xa916('0x3f')](_0x2759c3[_0xa916('0x33')],_0x37bbc5['filters']));if(_0x2759c3[_0xa916('0x33')][_0xa916('0x40')]){_0x15a6fc[_0xa916('0x3e')]=_[_0xa916('0x41')](_0x15a6fc[_0xa916('0x3e')],{'$or':_[_0xa916('0x42')](_0x15a6fc[_0xa916('0x38')],function(_0x158190){var _0x5e1b78={};_0x5e1b78[_0x158190]={'$like':'%'+_0x2759c3[_0xa916('0x33')][_0xa916('0x40')]+'%'};return _0x5e1b78;})});}_0x15a6fc=_[_0xa916('0x41')]({},_0x15a6fc,_0x2759c3[_0xa916('0x44')]);return _0x372d07['getConfigurations'](_0x15a6fc);}})[_0xa916('0x45')](function(_0x3d4bd5){if(_0x3d4bd5){_0x73acb1=_0x3d4bd5[_0xa916('0x39')];if(!_0x2759c3['query'][_0xa916('0x3a')](_0xa916('0x3b'))){_0x15a6fc['limit']=qs['limit'](_0x2759c3[_0xa916('0x33')][_0xa916('0x21')]);_0x15a6fc[_0xa916('0x1f')]=qs[_0xa916('0x1f')](_0x2759c3[_0xa916('0x33')][_0xa916('0x1f')]);}return _0x372d07['getConfigurations'](_0x15a6fc);}})[_0xa916('0x45')](function(_0x81a707){if(_0x81a707){return _0x81a707?{'count':_0x73acb1,'rows':_0x81a707}:null;}})['then'](respondWithResult(_0x54aba5,null))[_0xa916('0x4a')](handleError(_0x54aba5,null));};exports['addConfiguration']=function(_0x1e9614,_0x2c9524,_0x3bb5f3){if(_0x1e9614[_0xa916('0x4f')]['id']){delete _0x1e9614[_0xa916('0x4f')]['id'];}return db[_0xa916('0x47')][_0xa916('0x53')]({'where':{'id':_0x1e9614[_0xa916('0x4c')]['id']}})[_0xa916('0x45')](handleEntityNotFound(_0x2c9524,null))[_0xa916('0x45')](function(_0x55f8c5){if(_0x55f8c5){_0x1e9614[_0xa916('0x4f')][_0xa916('0x55')]=_0x55f8c5['id'];_0x1e9614['body']['Subjects']=integrations['getSubjects'](_0x1e9614['body'][_0xa916('0x56')],_0x1e9614['body'][_0xa916('0x30')]);_0x1e9614['body'][_0xa916('0x57')]=integrations[_0xa916('0x58')](_0x1e9614[_0xa916('0x4f')][_0xa916('0x56')],_0x1e9614['body'][_0xa916('0x30')]);return db[_0xa916('0x54')]['create'](_0x1e9614[_0xa916('0x4f')],{'include':[{'model':db[_0xa916('0x59')],'as':_0xa916('0x5a')},{'model':db[_0xa916('0x59')],'as':_0xa916('0x57')}]});}return null;})[_0xa916('0x45')](respondWithResult(_0x2c9524,null))[_0xa916('0x4a')](handleError(_0x2c9524,null));};exports[_0xa916('0x5b')]=function(_0x427dc0,_0x4d7369,_0x2c9590){var _0x58c8c3='';var _0x203f9e=['id',_0xa916('0x2c'),_0xa916('0x5c'),_0xa916('0x5d'),_0xa916('0x5e'),'date_start',_0xa916('0x5f'),_0xa916('0x60'),_0xa916('0x61'),'parent_type','parent_name',_0xa916('0x62')];return db[_0xa916('0x47')]['findOne']({'where':{'id':_0x427dc0['params']['id']},'attributes':['id','username',_0xa916('0x63'),_0xa916('0x64')]})[_0xa916('0x45')](handleEntityNotFound(_0x4d7369,null))[_0xa916('0x45')](function(_0x2a27d){if(_0x2a27d){_0x58c8c3=_0x2a27d[_0xa916('0x64')];var _0x37857d=_0x58c8c3[_0xa916('0x65')](-0x1);if(_0x37857d==='/'){_0x58c8c3=_0x58c8c3[_0xa916('0x66')](0x0,_0x58c8c3[_0xa916('0x67')](_0x37857d));}return rp({'method':_0xa916('0x68'),'uri':util[_0xa916('0x69')](_0xa916('0x6a'),_0x58c8c3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xa916('0x6b'),'input_type':_0xa916('0x6c'),'response_type':_0xa916('0x6c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2a27d[_0xa916('0x6d')],'password':_0x2a27d['password'],'encryption':_0xa916('0x6e')},'application':_0xa916('0x6f')})}});}})[_0xa916('0x45')](function(_0x5c28f2){if(_0x5c28f2&&_0x5c28f2[_0xa916('0x2c')]!==_0xa916('0x70')&&_0x5c28f2[_0xa916('0x2c')]!==_0xa916('0x71')){return rp({'method':_0xa916('0x68'),'uri':util['format']('%s%s',_0x58c8c3,_0xa916('0x72')),'json':!![],'form':{'method':_0xa916('0x73'),'input_type':'JSON','response_type':_0xa916('0x6c'),'rest_data':JSON[_0xa916('0x74')]({'session':_0x5c28f2['id'],'module_name':_0xa916('0x75')})}})[_0xa916('0x45')](function(_0x4e4b40){if(_0x4e4b40){var _0x558f98=_[_0xa916('0x76')](_0x4e4b40['module_fields']);_['remove'](_0x558f98,function(_0x40dc3a){return _0x203f9e[_0xa916('0x77')](_0x40dc3a[_0xa916('0x2c')]);});return{'count':_0x558f98[_0xa916('0x39')],'rows':_[_0xa916('0x42')](_0x558f98,function(_0x2ccb9b){return{'id':_0x2ccb9b[_0xa916('0x2c')],'name':_0x2ccb9b[_0xa916('0x78')],'custom':_['endsWith'](_0x2ccb9b['name'],'_c')?!![]:![],'options':_0x2ccb9b[_0xa916('0x44')]?_[_0xa916('0x42')](_['values'](_0x2ccb9b[_0xa916('0x44')]),function(_0x56b197){return{'name':_0x56b197[_0xa916('0x79')],'value':_0x56b197['name']};}):[]};})};}})[_0xa916('0x45')](respondWithResult(_0x4d7369,null))[_0xa916('0x4a')](function(_0x3375fe){var _0x1bba10=_0x427dc0[_0xa916('0x33')][_0xa916('0x7a')]?0x1f4:_0x3375fe[_0xa916('0x7b')]||0x1f4;logger[_0xa916('0x2a')](_0xa916('0x7c'),_0xa916('0x5b'),_0x1bba10,JSON[_0xa916('0x74')](_0x3375fe));delete _0x3375fe['name'];if(_0x1bba10===0x191){_0x1bba10=0x190;}_0x4d7369['status'](_0x1bba10)[_0xa916('0x7d')](_0x427dc0[_0xa916('0x33')]['test']?{'message':_0xa916('0x7e'),'statusCode':_0x3375fe[_0xa916('0x7b')]}:_0x3375fe);});}else{var _0x5868a6=0x1f4;_0x4d7369[_0xa916('0x1d')](_0x5868a6)[_0xa916('0x7d')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x4c67=['Content-Range','apply','save','update','then','destroy','sendStatus','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','type','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','pick','options','nolimit','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','values','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4c67,0x1cd));var _0x74c6=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0x4c67[_0x220afa];return _0x1b79d1;};'use strict';var emlformat=require(_0x74c6('0x0'));var rimraf=require(_0x74c6('0x1'));var zipdir=require(_0x74c6('0x2'));var jsonpatch=require(_0x74c6('0x3'));var rp=require(_0x74c6('0x4'));var moment=require(_0x74c6('0x5'));var BPromise=require(_0x74c6('0x6'));var Mustache=require(_0x74c6('0x7'));var util=require(_0x74c6('0x8'));var path=require(_0x74c6('0x9'));var sox=require(_0x74c6('0xa'));var csv=require(_0x74c6('0xb'));var ejs=require(_0x74c6('0xc'));var fs=require('fs');var fs_extra=require(_0x74c6('0xd'));var _=require(_0x74c6('0xe'));var squel=require('squel');var crypto=require(_0x74c6('0xf'));var jsforce=require(_0x74c6('0x10'));var deskjs=require(_0x74c6('0x11'));var toCsv=require(_0x74c6('0xb'));var querystring=require(_0x74c6('0x12'));var Papa=require(_0x74c6('0x13'));var Redis=require('ioredis');var authService=require(_0x74c6('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x74c6('0x15'));var hardwareService=require(_0x74c6('0x16'));var logger=require(_0x74c6('0x17'))('api');var utils=require(_0x74c6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x74c6('0x19'));var db=require(_0x74c6('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x355545,_0x22bfe3){_0x22bfe3=_0x22bfe3||0xcc;return function(_0x277643){if(_0x277643){return _0x355545['sendStatus'](_0x22bfe3);}return _0x355545[_0x74c6('0x1b')](_0x22bfe3)[_0x74c6('0x1c')]();};}function respondWithResult(_0x1b965d,_0x591b1e){_0x591b1e=_0x591b1e||0xc8;return function(_0x22b46d){if(_0x22b46d){return _0x1b965d['status'](_0x591b1e)[_0x74c6('0x1d')](_0x22b46d);}};}function respondWithFilteredResult(_0x496784,_0x18b24b){return function(_0x402e10){if(_0x402e10){var _0x2ad6df=typeof _0x18b24b[_0x74c6('0x1e')]===_0x74c6('0x1f')&&typeof _0x18b24b['limit']===_0x74c6('0x1f');var _0x376d46=_0x402e10[_0x74c6('0x20')];var _0x288063=_0x2ad6df?0x0:_0x18b24b[_0x74c6('0x1e')];var _0x32d698=_0x2ad6df?_0x402e10[_0x74c6('0x20')]:_0x18b24b[_0x74c6('0x1e')]+_0x18b24b[_0x74c6('0x21')];var _0x3b59a6;if(_0x32d698>=_0x376d46){_0x32d698=_0x376d46;_0x3b59a6=0xc8;}else{_0x3b59a6=0xce;}_0x496784['status'](_0x3b59a6);return _0x496784[_0x74c6('0x22')](_0x74c6('0x23'),_0x288063+'-'+_0x32d698+'/'+_0x376d46)[_0x74c6('0x1d')](_0x402e10);}return null;};}function patchUpdates(_0x26c8f0){return function(_0x384999){try{jsonpatch[_0x74c6('0x24')](_0x384999,_0x26c8f0,!![]);}catch(_0x54dd24){return BPromise['reject'](_0x54dd24);}return _0x384999[_0x74c6('0x25')]();};}function saveUpdates(_0x1d8ffa,_0x349f69){return function(_0x409168){if(_0x409168){return _0x409168[_0x74c6('0x26')](_0x1d8ffa)[_0x74c6('0x27')](function(_0x65f546){return _0x65f546;});}return null;};}function removeEntity(_0x59e9ff,_0x2e152b){return function(_0x49a305){if(_0x49a305){return _0x49a305[_0x74c6('0x28')]()['then'](function(){_0x59e9ff[_0x74c6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7a4e2d,_0x5315b1){return function(_0x575e83){if(!_0x575e83){_0x7a4e2d[_0x74c6('0x29')](0x194);}return _0x575e83;};}function handleError(_0x45d95d,_0x4d6d7d){_0x4d6d7d=_0x4d6d7d||0x1f4;return function(_0x21f3a1){logger[_0x74c6('0x2a')](_0x21f3a1['stack']);if(_0x21f3a1['name']){delete _0x21f3a1[_0x74c6('0x2b')];}_0x45d95d[_0x74c6('0x1b')](_0x4d6d7d)[_0x74c6('0x2c')](_0x21f3a1);};}exports[_0x74c6('0x2d')]=function(_0x29ed3e,_0x2bed72){var _0x48664b={},_0x18f1b9={},_0x5f2ed8={'count':0x0,'rows':[]};var _0x55512a=_[_0x74c6('0x2e')](db[_0x74c6('0x2f')][_0x74c6('0x30')],function(_0x5d4278){return{'name':_0x5d4278[_0x74c6('0x31')],'type':_0x5d4278['type'][_0x74c6('0x32')]};});_0x18f1b9[_0x74c6('0x33')]=_[_0x74c6('0x2e')](_0x55512a,_0x74c6('0x2b'));_0x18f1b9[_0x74c6('0x34')]=_[_0x74c6('0x35')](_0x29ed3e[_0x74c6('0x34')]);_0x18f1b9['filters']=_[_0x74c6('0x36')](_0x18f1b9[_0x74c6('0x33')],_0x18f1b9[_0x74c6('0x34')]);_0x48664b[_0x74c6('0x37')]=_[_0x74c6('0x36')](_0x18f1b9[_0x74c6('0x33')],qs[_0x74c6('0x38')](_0x29ed3e[_0x74c6('0x34')]['fields']));_0x48664b['attributes']=_0x48664b['attributes'][_0x74c6('0x39')]?_0x48664b[_0x74c6('0x37')]:_0x18f1b9[_0x74c6('0x33')];if(!_0x29ed3e[_0x74c6('0x34')][_0x74c6('0x3a')]('nolimit')){_0x48664b[_0x74c6('0x21')]=qs['limit'](_0x29ed3e[_0x74c6('0x34')][_0x74c6('0x21')]);_0x48664b[_0x74c6('0x1e')]=qs[_0x74c6('0x1e')](_0x29ed3e[_0x74c6('0x34')][_0x74c6('0x1e')]);}_0x48664b[_0x74c6('0x3b')]=qs[_0x74c6('0x3c')](_0x29ed3e[_0x74c6('0x34')][_0x74c6('0x3c')]);_0x48664b['where']=qs[_0x74c6('0x3d')](_['pick'](_0x29ed3e[_0x74c6('0x34')],_0x18f1b9['filters']),_0x55512a);if(_0x29ed3e['query'][_0x74c6('0x3e')]){_0x48664b[_0x74c6('0x3f')]=_[_0x74c6('0x40')](_0x48664b['where'],{'$or':_[_0x74c6('0x2e')](_0x55512a,function(_0x1cea8a){if(_0x1cea8a[_0x74c6('0x41')]!=='VIRTUAL'){var _0x1fe02e={};_0x1fe02e[_0x1cea8a[_0x74c6('0x2b')]]={'$like':'%'+_0x29ed3e[_0x74c6('0x34')][_0x74c6('0x3e')]+'%'};return _0x1fe02e;}})});}_0x48664b=_['merge']({},_0x48664b,_0x29ed3e['options']);var _0x3679f6={'where':_0x48664b[_0x74c6('0x3f')]};return db[_0x74c6('0x2f')]['count'](_0x3679f6)[_0x74c6('0x27')](function(_0x11acf1){_0x5f2ed8[_0x74c6('0x20')]=_0x11acf1;if(_0x29ed3e[_0x74c6('0x34')]['includeAll']){_0x48664b[_0x74c6('0x42')]=[{'all':!![]}];}return db[_0x74c6('0x2f')][_0x74c6('0x43')](_0x48664b);})[_0x74c6('0x27')](function(_0x28de7f){_0x5f2ed8[_0x74c6('0x44')]=_0x28de7f;return _0x5f2ed8;})[_0x74c6('0x27')](respondWithFilteredResult(_0x2bed72,_0x48664b))[_0x74c6('0x45')](handleError(_0x2bed72,null));};exports[_0x74c6('0x46')]=function(_0x102dfb,_0x141ac8){var _0x5cf39c={'raw':![],'where':{'id':_0x102dfb[_0x74c6('0x47')]['id']}},_0x34d2ea={};_0x34d2ea[_0x74c6('0x33')]=_[_0x74c6('0x35')](db['SugarcrmAccount'][_0x74c6('0x30')]);_0x34d2ea[_0x74c6('0x34')]=_[_0x74c6('0x35')](_0x102dfb[_0x74c6('0x34')]);_0x34d2ea['filters']=_[_0x74c6('0x36')](_0x34d2ea['model'],_0x34d2ea['query']);_0x5cf39c[_0x74c6('0x37')]=_[_0x74c6('0x36')](_0x34d2ea['model'],qs[_0x74c6('0x38')](_0x102dfb['query'][_0x74c6('0x38')]));_0x5cf39c[_0x74c6('0x37')]=_0x5cf39c['attributes']['length']?_0x5cf39c[_0x74c6('0x37')]:_0x34d2ea['model'];if(_0x102dfb['query']['includeAll']){_0x5cf39c[_0x74c6('0x42')]=[{'all':!![]}];}_0x5cf39c=_['merge']({},_0x5cf39c,_0x102dfb['options']);return db['SugarcrmAccount'][_0x74c6('0x48')](_0x5cf39c)[_0x74c6('0x27')](handleEntityNotFound(_0x141ac8,null))[_0x74c6('0x27')](respondWithResult(_0x141ac8,null))[_0x74c6('0x45')](handleError(_0x141ac8,null));};exports[_0x74c6('0x49')]=function(_0x3a3f0f,_0x355221){return db[_0x74c6('0x2f')][_0x74c6('0x49')](_0x3a3f0f['body'],{})[_0x74c6('0x27')](respondWithResult(_0x355221,0xc9))[_0x74c6('0x45')](handleError(_0x355221,null));};exports[_0x74c6('0x26')]=function(_0x444859,_0x233f44){if(_0x444859[_0x74c6('0x4a')]['id']){delete _0x444859[_0x74c6('0x4a')]['id'];}return db['SugarcrmAccount'][_0x74c6('0x48')]({'where':{'id':_0x444859['params']['id']}})[_0x74c6('0x27')](handleEntityNotFound(_0x233f44,null))[_0x74c6('0x27')](saveUpdates(_0x444859['body'],null))[_0x74c6('0x27')](respondWithResult(_0x233f44,null))[_0x74c6('0x45')](handleError(_0x233f44,null));};exports[_0x74c6('0x28')]=function(_0x5aae37,_0x41164f){return db[_0x74c6('0x2f')][_0x74c6('0x48')]({'where':{'id':_0x5aae37[_0x74c6('0x47')]['id']}})['then'](handleEntityNotFound(_0x41164f,null))[_0x74c6('0x27')](removeEntity(_0x41164f,null))[_0x74c6('0x45')](handleError(_0x41164f,null));};exports[_0x74c6('0x4b')]=function(_0x2140f0,_0x46cd4f,_0x3b7863){var _0x50520d={};var _0x10a9a0={};var _0xb1f951;var _0x49b5f4;return db[_0x74c6('0x2f')][_0x74c6('0x4c')]({'where':{'id':_0x2140f0[_0x74c6('0x47')]['id']}})[_0x74c6('0x27')](handleEntityNotFound(_0x46cd4f,null))['then'](function(_0x37b3b7){if(_0x37b3b7){_0xb1f951=_0x37b3b7;_0x10a9a0[_0x74c6('0x33')]=_['keys'](db[_0x74c6('0x4d')][_0x74c6('0x30')]);_0x10a9a0[_0x74c6('0x34')]=_[_0x74c6('0x35')](_0x2140f0[_0x74c6('0x34')]);_0x10a9a0[_0x74c6('0x3d')]=_[_0x74c6('0x36')](_0x10a9a0[_0x74c6('0x33')],_0x10a9a0['query']);_0x50520d['attributes']=_['intersection'](_0x10a9a0[_0x74c6('0x33')],qs[_0x74c6('0x38')](_0x2140f0[_0x74c6('0x34')][_0x74c6('0x38')]));_0x50520d[_0x74c6('0x37')]=_0x50520d[_0x74c6('0x37')][_0x74c6('0x39')]?_0x50520d['attributes']:_0x10a9a0[_0x74c6('0x33')];_0x50520d[_0x74c6('0x3b')]=qs['sort'](_0x2140f0[_0x74c6('0x34')][_0x74c6('0x3c')]);_0x50520d[_0x74c6('0x3f')]=qs[_0x74c6('0x3d')](_[_0x74c6('0x4e')](_0x2140f0[_0x74c6('0x34')],_0x10a9a0[_0x74c6('0x3d')]));if(_0x2140f0[_0x74c6('0x34')][_0x74c6('0x3e')]){_0x50520d[_0x74c6('0x3f')]=_['merge'](_0x50520d[_0x74c6('0x3f')],{'$or':_[_0x74c6('0x2e')](_0x50520d[_0x74c6('0x37')],function(_0x20caa5){var _0x5a3007={};_0x5a3007[_0x20caa5]={'$like':'%'+_0x2140f0[_0x74c6('0x34')][_0x74c6('0x3e')]+'%'};return _0x5a3007;})});}_0x50520d=_[_0x74c6('0x40')]({},_0x50520d,_0x2140f0[_0x74c6('0x4f')]);return _0xb1f951[_0x74c6('0x4b')](_0x50520d);}})['then'](function(_0x2b3486){if(_0x2b3486){_0x49b5f4=_0x2b3486['length'];if(!_0x2140f0['query'][_0x74c6('0x3a')](_0x74c6('0x50'))){_0x50520d[_0x74c6('0x21')]=qs['limit'](_0x2140f0[_0x74c6('0x34')][_0x74c6('0x21')]);_0x50520d[_0x74c6('0x1e')]=qs[_0x74c6('0x1e')](_0x2140f0[_0x74c6('0x34')][_0x74c6('0x1e')]);}return _0xb1f951[_0x74c6('0x4b')](_0x50520d);}})[_0x74c6('0x27')](function(_0x22a7b6){if(_0x22a7b6){return _0x22a7b6?{'count':_0x49b5f4,'rows':_0x22a7b6}:null;}})[_0x74c6('0x27')](respondWithResult(_0x46cd4f,null))[_0x74c6('0x45')](handleError(_0x46cd4f,null));};exports['addConfiguration']=function(_0x14dbca,_0x566384,_0x409517){if(_0x14dbca[_0x74c6('0x4a')]['id']){delete _0x14dbca['body']['id'];}return db['SugarcrmAccount'][_0x74c6('0x4c')]({'where':{'id':_0x14dbca[_0x74c6('0x47')]['id']}})[_0x74c6('0x27')](handleEntityNotFound(_0x566384,null))['then'](function(_0x2d6ed3){if(_0x2d6ed3){_0x14dbca[_0x74c6('0x4a')]['AccountId']=_0x2d6ed3['id'];_0x14dbca['body'][_0x74c6('0x51')]=integrations[_0x74c6('0x52')](_0x14dbca[_0x74c6('0x4a')]['channel'],_0x14dbca[_0x74c6('0x4a')][_0x74c6('0x41')]);_0x14dbca['body'][_0x74c6('0x53')]=integrations[_0x74c6('0x54')](_0x14dbca[_0x74c6('0x4a')][_0x74c6('0x55')],_0x14dbca[_0x74c6('0x4a')][_0x74c6('0x41')]);return db[_0x74c6('0x4d')][_0x74c6('0x49')](_0x14dbca[_0x74c6('0x4a')],{'include':[{'model':db[_0x74c6('0x56')],'as':_0x74c6('0x51')},{'model':db[_0x74c6('0x56')],'as':_0x74c6('0x53')}]});}return null;})['then'](respondWithResult(_0x566384,null))[_0x74c6('0x45')](handleError(_0x566384,null));};exports['getFields']=function(_0x97807f,_0x4cf7f3,_0xa673f1){var _0x5ce2e7='';var _0x48168a=['id',_0x74c6('0x2b'),_0x74c6('0x57'),_0x74c6('0x58'),_0x74c6('0x59'),_0x74c6('0x5a'),_0x74c6('0x5b'),_0x74c6('0x5c'),_0x74c6('0x5d'),_0x74c6('0x5e'),_0x74c6('0x5f'),_0x74c6('0x60')];return db[_0x74c6('0x2f')]['findOne']({'where':{'id':_0x97807f[_0x74c6('0x47')]['id']},'attributes':['id',_0x74c6('0x61'),_0x74c6('0x62'),_0x74c6('0x63')]})[_0x74c6('0x27')](handleEntityNotFound(_0x4cf7f3,null))[_0x74c6('0x27')](function(_0x3d6a50){if(_0x3d6a50){_0x5ce2e7=_0x3d6a50[_0x74c6('0x63')];var _0x3d139c=_0x5ce2e7[_0x74c6('0x64')](-0x1);if(_0x3d139c==='/'){_0x5ce2e7=_0x5ce2e7['substring'](0x0,_0x5ce2e7[_0x74c6('0x65')](_0x3d139c));}return rp({'method':_0x74c6('0x66'),'uri':util[_0x74c6('0x67')](_0x74c6('0x68'),_0x5ce2e7,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x74c6('0x69'),'input_type':_0x74c6('0x6a'),'response_type':_0x74c6('0x6a'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3d6a50[_0x74c6('0x61')],'password':_0x3d6a50[_0x74c6('0x62')],'encryption':_0x74c6('0x6b')},'application':_0x74c6('0x6c')})}});}})['then'](function(_0x1b22a8){if(_0x1b22a8&&_0x1b22a8[_0x74c6('0x2b')]!==_0x74c6('0x6d')&&_0x1b22a8['name']!==_0x74c6('0x6e')){return rp({'method':_0x74c6('0x66'),'uri':util[_0x74c6('0x67')]('%s%s',_0x5ce2e7,_0x74c6('0x6f')),'json':!![],'form':{'method':_0x74c6('0x70'),'input_type':_0x74c6('0x6a'),'response_type':_0x74c6('0x6a'),'rest_data':JSON['stringify']({'session':_0x1b22a8['id'],'module_name':_0x74c6('0x71')})}})[_0x74c6('0x27')](function(_0xb2ac83){if(_0xb2ac83){var _0x1bf147=_[_0x74c6('0x72')](_0xb2ac83['module_fields']);_[_0x74c6('0x73')](_0x1bf147,function(_0x3b75df){return _0x48168a['includes'](_0x3b75df[_0x74c6('0x2b')]);});return{'count':_0x1bf147[_0x74c6('0x39')],'rows':_[_0x74c6('0x2e')](_0x1bf147,function(_0x53036a){return{'id':_0x53036a[_0x74c6('0x2b')],'name':_0x53036a[_0x74c6('0x74')],'custom':_[_0x74c6('0x75')](_0x53036a['name'],'_c')?!![]:![],'options':_0x53036a['options']?_[_0x74c6('0x2e')](_[_0x74c6('0x72')](_0x53036a[_0x74c6('0x4f')]),function(_0x3514bf){return{'name':_0x3514bf[_0x74c6('0x76')],'value':_0x3514bf['name']};}):[]};})};}})[_0x74c6('0x27')](respondWithResult(_0x4cf7f3,null))['catch'](function(_0x449e1b){var _0x1167b8=_0x97807f[_0x74c6('0x34')][_0x74c6('0x77')]?0x1f4:_0x449e1b[_0x74c6('0x78')]||0x1f4;logger[_0x74c6('0x2a')](_0x74c6('0x79'),_0x74c6('0x7a'),_0x1167b8,JSON['stringify'](_0x449e1b));delete _0x449e1b[_0x74c6('0x2b')];if(_0x1167b8===0x191){_0x1167b8=0x190;}_0x4cf7f3[_0x74c6('0x1b')](_0x1167b8)[_0x74c6('0x2c')](_0x97807f[_0x74c6('0x34')][_0x74c6('0x77')]?{'message':_0x74c6('0x7b'),'statusCode':_0x449e1b['statusCode']}:_0x449e1b);});}else{var _0x345bc6=0x1f4;_0x4cf7f3[_0x74c6('0x1b')](_0x345bc6)[_0x74c6('0x2c')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index d247734..5a5eefa 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 _0x75dc=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x75dc,0x1d7));var _0xc75d=function(_0x2f0b82,_0xa07e26){_0x2f0b82=_0x2f0b82-0x0;var _0x5d6fb1=_0x75dc[_0x2f0b82];return _0x5d6fb1;};'use strict';var _=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc75d('0x2'));var rp=require(_0xc75d('0x3'));var fs=require('fs');var path=require(_0xc75d('0x4'));var rimraf=require(_0xc75d('0x5'));var config=require(_0xc75d('0x6'));var attributes=require(_0xc75d('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc75d('0x8')]=function(_0x1db578,_0x928edc){return _0x1db578['define'](_0xc75d('0x9'),attributes,{'tableName':_0xc75d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f96=['exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7e72eb,_0x3698a7){var _0x598001=function(_0x412a42){while(--_0x412a42){_0x7e72eb['push'](_0x7e72eb['shift']());}};_0x598001(++_0x3698a7);}(_0x7f96,0xa0));var _0x67f9=function(_0x5957be,_0x5c6d83){_0x5957be=_0x5957be-0x0;var _0x49faa4=_0x7f96[_0x5957be];return _0x49faa4;};'use strict';var _=require(_0x67f9('0x0'));var util=require('util');var logger=require(_0x67f9('0x1'))(_0x67f9('0x2'));var moment=require(_0x67f9('0x3'));var BPromise=require(_0x67f9('0x4'));var rp=require(_0x67f9('0x5'));var fs=require('fs');var path=require(_0x67f9('0x6'));var rimraf=require(_0x67f9('0x7'));var config=require(_0x67f9('0x8'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x67f9('0x9')]=function(_0x14f8d8,_0x2acb50){return _0x14f8d8[_0x67f9('0xa')](_0x67f9('0xb'),attributes,{'tableName':_0x67f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index afbeaf6..8fef6c9 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 _0x26ac=['where','limit','include','map','model','attributes','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','catch','SugarcrmAccount','findAll','options','raw'];(function(_0x11959b,_0xe37fe5){var _0x1a1e6e=function(_0x23bc3d){while(--_0x23bc3d){_0x11959b['push'](_0x11959b['shift']());}};_0x1a1e6e(++_0xe37fe5);}(_0x26ac,0x9f));var _0xc26a=function(_0x14631d,_0x1a96f8){_0x14631d=_0x14631d-0x0;var _0x26b3c4=_0x26ac[_0x14631d];return _0x26b3c4;};'use strict';var _=require(_0xc26a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc26a('0x1'));var db=require(_0xc26a('0x2'))['db'];var utils=require(_0xc26a('0x3'));var logger=require(_0xc26a('0x4'))('rpc');var config=require(_0xc26a('0x5'));var jayson=require(_0xc26a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cd2fe,_0x525c69,_0x35e555){return new BPromise(function(_0x1b4fab,_0x3adc89){return client[_0xc26a('0x7')](_0x5cd2fe,_0x35e555)[_0xc26a('0x8')](function(_0x38c78e){logger[_0xc26a('0x9')]('SugarcrmAccount,\x20%s,\x20%s',_0x525c69,_0xc26a('0xa'));logger[_0xc26a('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x525c69,_0xc26a('0xa'),JSON[_0xc26a('0xc')](_0x38c78e));if(_0x38c78e[_0xc26a('0xd')]){if(_0x38c78e[_0xc26a('0xd')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x525c69,_0x38c78e['error']['message']);return _0x3adc89(_0x38c78e['error'][_0xc26a('0xe')]);}logger[_0xc26a('0xd')](_0xc26a('0xf'),_0x525c69,_0x38c78e[_0xc26a('0xd')][_0xc26a('0xe')]);return _0x1b4fab(_0x38c78e[_0xc26a('0xd')][_0xc26a('0xe')]);}else{logger[_0xc26a('0x9')](_0xc26a('0xf'),_0x525c69,_0xc26a('0xa'));_0x1b4fab(_0x38c78e['result'][_0xc26a('0xe')]);}})[_0xc26a('0x10')](function(_0x1e7d48){logger[_0xc26a('0xd')](_0xc26a('0xf'),_0x525c69,_0x1e7d48);_0x3adc89(_0x1e7d48);});});}exports['GetSugarcrmAccount']=function(_0x23ad43){var _0x29f3af=this;return new Promise(function(_0x3447c5,_0xad0609){return db[_0xc26a('0x11')][_0xc26a('0x12')]({'raw':_0x23ad43[_0xc26a('0x13')]?_0x23ad43[_0xc26a('0x13')][_0xc26a('0x14')]===undefined?!![]:![]:!![],'where':_0x23ad43[_0xc26a('0x13')]?_0x23ad43['options'][_0xc26a('0x15')]||null:null,'attributes':_0x23ad43[_0xc26a('0x13')]?_0x23ad43[_0xc26a('0x13')]['attributes']||null:null,'limit':_0x23ad43[_0xc26a('0x13')]?_0x23ad43[_0xc26a('0x13')][_0xc26a('0x16')]||null:null,'include':_0x23ad43['options']?_0x23ad43[_0xc26a('0x13')][_0xc26a('0x17')]?_[_0xc26a('0x18')](_0x23ad43[_0xc26a('0x13')][_0xc26a('0x17')],function(_0x474e11){return{'model':db[_0x474e11[_0xc26a('0x19')]],'as':_0x474e11['as'],'attributes':_0x474e11[_0xc26a('0x1a')],'include':_0x474e11[_0xc26a('0x17')]?_[_0xc26a('0x18')](_0x474e11[_0xc26a('0x17')],function(_0x804248){return{'model':db[_0x804248['model']],'as':_0x804248['as'],'attributes':_0x804248[_0xc26a('0x1a')],'include':_0x804248['include']?_[_0xc26a('0x18')](_0x804248[_0xc26a('0x17')],function(_0x2e1968){return{'model':db[_0x2e1968[_0xc26a('0x19')]],'as':_0x2e1968['as'],'attributes':_0x2e1968[_0xc26a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc26a('0x8')](function(_0x559b8c){logger[_0xc26a('0x9')](_0xc26a('0x1b'),_0x23ad43);logger[_0xc26a('0xb')]('GetSugarcrmAccount',_0x23ad43,JSON[_0xc26a('0xc')](_0x559b8c));_0x3447c5(_0x559b8c);})[_0xc26a('0x10')](function(_0x1677d9){logger['error'](_0xc26a('0x1b'),_0x1677d9[_0xc26a('0xe')],_0x23ad43);_0xad0609(_0x29f3af[_0xc26a('0xd')](0x1f4,_0x1677d9[_0xc26a('0xe')]));});});};exports[_0xc26a('0x1c')]=function(_0x56759d){var _0x59ff1b=this;return new Promise(function(_0x32a739,_0x232f03){return db[_0xc26a('0x11')][_0xc26a('0x1d')]({'raw':_0x56759d[_0xc26a('0x13')]?_0x56759d[_0xc26a('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x56759d[_0xc26a('0x13')]?_0x56759d[_0xc26a('0x13')]['where']||null:null,'attributes':_0x56759d[_0xc26a('0x13')]?_0x56759d['options'][_0xc26a('0x1a')]||null:null,'include':_0x56759d[_0xc26a('0x13')]?_0x56759d['options']['include']?_[_0xc26a('0x18')](_0x56759d[_0xc26a('0x13')][_0xc26a('0x17')],function(_0x210cab){return{'model':db[_0x210cab[_0xc26a('0x19')]],'as':_0x210cab['as'],'attributes':_0x210cab[_0xc26a('0x1a')],'include':_0x210cab['include']?_[_0xc26a('0x18')](_0x210cab[_0xc26a('0x17')],function(_0x115ef4){return{'model':db[_0x115ef4[_0xc26a('0x19')]],'as':_0x115ef4['as'],'attributes':_0x115ef4[_0xc26a('0x1a')],'include':_0x115ef4['include']?_[_0xc26a('0x18')](_0x115ef4[_0xc26a('0x17')],function(_0xb204a4){return{'model':db[_0xb204a4['model']],'as':_0xb204a4['as'],'attributes':_0xb204a4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc26a('0x8')](function(_0x5d6289){logger[_0xc26a('0x9')](_0xc26a('0x1c'),_0x56759d);logger[_0xc26a('0xb')](_0xc26a('0x1c'),_0x56759d,JSON[_0xc26a('0xc')](_0x5d6289));_0x32a739(_0x5d6289);})[_0xc26a('0x10')](function(_0x3e6f6d){logger[_0xc26a('0xd')]('ShowSugarcrmAccount',_0x3e6f6d['message'],_0x56759d);_0x232f03(_0x59ff1b['error'](0x1f4,_0x3e6f6d[_0xc26a('0xe')]));});});}; \ No newline at end of file +var _0x30e5=['jayson/promise','http','then','request\x20sent','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','info','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x30e5,0x7f));var _0x530e=function(_0x44e411,_0x2be66f){_0x44e411=_0x44e411-0x0;var _0x240ac2=_0x30e5[_0x44e411];return _0x240ac2;};'use strict';var _=require(_0x530e('0x0'));var util=require(_0x530e('0x1'));var moment=require(_0x530e('0x2'));var BPromise=require(_0x530e('0x3'));var rs=require(_0x530e('0x4'));var fs=require('fs');var Redis=require(_0x530e('0x5'));var db=require(_0x530e('0x6'))['db'];var utils=require(_0x530e('0x7'));var logger=require(_0x530e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x530e('0x9'));var client=jayson['client'][_0x530e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdbb191,_0x220d2a,_0x5c2a11){return new BPromise(function(_0x18d8b5,_0x3083fe){return client['request'](_0xdbb191,_0x5c2a11)[_0x530e('0xb')](function(_0x25c339){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x220d2a,_0x530e('0xc'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x220d2a,'request\x20sent',JSON[_0x530e('0xd')](_0x25c339));if(_0x25c339[_0x530e('0xe')]){if(_0x25c339['error'][_0x530e('0xf')]===0x1f4){logger[_0x530e('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x220d2a,_0x25c339[_0x530e('0xe')][_0x530e('0x10')]);return _0x3083fe(_0x25c339[_0x530e('0xe')][_0x530e('0x10')]);}logger[_0x530e('0xe')](_0x530e('0x11'),_0x220d2a,_0x25c339[_0x530e('0xe')][_0x530e('0x10')]);return _0x18d8b5(_0x25c339[_0x530e('0xe')][_0x530e('0x10')]);}else{logger[_0x530e('0x12')](_0x530e('0x11'),_0x220d2a,_0x530e('0xc'));_0x18d8b5(_0x25c339['result'][_0x530e('0x10')]);}})[_0x530e('0x13')](function(_0x3bb017){logger[_0x530e('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x220d2a,_0x3bb017);_0x3083fe(_0x3bb017);});});}exports[_0x530e('0x14')]=function(_0x18ba1){var _0x441668=this;return new Promise(function(_0xd3a182,_0xc394ac){return db[_0x530e('0x15')][_0x530e('0x16')]({'raw':_0x18ba1[_0x530e('0x17')]?_0x18ba1['options'][_0x530e('0x18')]===undefined?!![]:![]:!![],'where':_0x18ba1[_0x530e('0x17')]?_0x18ba1[_0x530e('0x17')][_0x530e('0x19')]||null:null,'attributes':_0x18ba1[_0x530e('0x17')]?_0x18ba1[_0x530e('0x17')][_0x530e('0x1a')]||null:null,'limit':_0x18ba1[_0x530e('0x17')]?_0x18ba1[_0x530e('0x17')][_0x530e('0x1b')]||null:null,'include':_0x18ba1['options']?_0x18ba1[_0x530e('0x17')][_0x530e('0x1c')]?_[_0x530e('0x1d')](_0x18ba1['options']['include'],function(_0x308eb9){return{'model':db[_0x308eb9['model']],'as':_0x308eb9['as'],'attributes':_0x308eb9[_0x530e('0x1a')],'include':_0x308eb9['include']?_[_0x530e('0x1d')](_0x308eb9['include'],function(_0x3e5800){return{'model':db[_0x3e5800[_0x530e('0x1e')]],'as':_0x3e5800['as'],'attributes':_0x3e5800[_0x530e('0x1a')],'include':_0x3e5800[_0x530e('0x1c')]?_[_0x530e('0x1d')](_0x3e5800[_0x530e('0x1c')],function(_0x5f2270){return{'model':db[_0x5f2270[_0x530e('0x1e')]],'as':_0x5f2270['as'],'attributes':_0x5f2270[_0x530e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x530e('0xb')](function(_0x251bb9){logger[_0x530e('0x12')](_0x530e('0x14'),_0x18ba1);logger[_0x530e('0x1f')](_0x530e('0x14'),_0x18ba1,JSON[_0x530e('0xd')](_0x251bb9));_0xd3a182(_0x251bb9);})[_0x530e('0x13')](function(_0x560a9e){logger[_0x530e('0xe')](_0x530e('0x14'),_0x560a9e[_0x530e('0x10')],_0x18ba1);_0xc394ac(_0x441668[_0x530e('0xe')](0x1f4,_0x560a9e[_0x530e('0x10')]));});});};exports[_0x530e('0x20')]=function(_0x413f06){var _0x4315a1=this;return new Promise(function(_0x37b86a,_0xb5607a){return db[_0x530e('0x15')][_0x530e('0x21')]({'raw':_0x413f06[_0x530e('0x17')]?_0x413f06[_0x530e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x413f06[_0x530e('0x17')]?_0x413f06[_0x530e('0x17')][_0x530e('0x19')]||null:null,'attributes':_0x413f06[_0x530e('0x17')]?_0x413f06[_0x530e('0x17')][_0x530e('0x1a')]||null:null,'include':_0x413f06[_0x530e('0x17')]?_0x413f06['options'][_0x530e('0x1c')]?_[_0x530e('0x1d')](_0x413f06[_0x530e('0x17')][_0x530e('0x1c')],function(_0x1be757){return{'model':db[_0x1be757['model']],'as':_0x1be757['as'],'attributes':_0x1be757[_0x530e('0x1a')],'include':_0x1be757[_0x530e('0x1c')]?_[_0x530e('0x1d')](_0x1be757[_0x530e('0x1c')],function(_0x469c41){return{'model':db[_0x469c41[_0x530e('0x1e')]],'as':_0x469c41['as'],'attributes':_0x469c41['attributes'],'include':_0x469c41[_0x530e('0x1c')]?_['map'](_0x469c41[_0x530e('0x1c')],function(_0x14c17a){return{'model':db[_0x14c17a[_0x530e('0x1e')]],'as':_0x14c17a['as'],'attributes':_0x14c17a[_0x530e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x530e('0xb')](function(_0x206000){logger[_0x530e('0x12')](_0x530e('0x20'),_0x413f06);logger[_0x530e('0x1f')](_0x530e('0x20'),_0x413f06,JSON[_0x530e('0xd')](_0x206000));_0x37b86a(_0x206000);})[_0x530e('0x13')](function(_0x3f5ebc){logger[_0x530e('0xe')](_0x530e('0x20'),_0x3f5ebc[_0x530e('0x10')],_0x413f06);_0xb5607a(_0x4315a1['error'](0x1f4,_0x3f5ebc[_0x530e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 2a5112c..b49d64b 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 _0x03ba=['Router','fs-extra','./intSugarcrmConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util','express'];(function(_0x3fb52c,_0x3b590b){var _0x1d9c36=function(_0xfbda0b){while(--_0xfbda0b){_0x3fb52c['push'](_0x3fb52c['shift']());}};_0x1d9c36(++_0x3b590b);}(_0x03ba,0xe4));var _0xa03b=function(_0x539a7b,_0x447ae0){_0x539a7b=_0x539a7b-0x0;var _0x1e9fe0=_0x03ba[_0x539a7b];return _0x1e9fe0;};'use strict';var multer=require(_0xa03b('0x0'));var util=require(_0xa03b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa03b('0x2'));var router=express[_0xa03b('0x3')]();var fs_extra=require(_0xa03b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa03b('0x5'));router['get']('/',auth[_0xa03b('0x6')](),controller[_0xa03b('0x7')]);router['get'](_0xa03b('0x8'),auth[_0xa03b('0x6')](),controller[_0xa03b('0x9')]);router[_0xa03b('0xa')](_0xa03b('0xb'),auth[_0xa03b('0x6')](),controller['getFields']);router[_0xa03b('0xa')](_0xa03b('0xc'),auth[_0xa03b('0x6')](),controller[_0xa03b('0xd')]);router[_0xa03b('0xa')](_0xa03b('0xe'),auth[_0xa03b('0x6')](),controller[_0xa03b('0xf')]);router[_0xa03b('0x10')]('/',auth[_0xa03b('0x6')](),controller[_0xa03b('0x11')]);router[_0xa03b('0x12')](_0xa03b('0x8'),auth[_0xa03b('0x6')](),controller['update']);router[_0xa03b('0x13')](_0xa03b('0x8'),auth[_0xa03b('0x6')](),controller['destroy']);module[_0xa03b('0x14')]=router; \ No newline at end of file +var _0x3684=['/:id/subjects','getSubjects','/:id/descriptions','isAuthenticated','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../config/environment','get','index','show','/:id/fields'];(function(_0x16eb06,_0x36d462){var _0x2cb579=function(_0x5e17ec){while(--_0x5e17ec){_0x16eb06['push'](_0x16eb06['shift']());}};_0x2cb579(++_0x36d462);}(_0x3684,0xff));var _0x4368=function(_0x41b1f8,_0x323c9f){_0x41b1f8=_0x41b1f8-0x0;var _0x25b882=_0x3684[_0x41b1f8];return _0x25b882;};'use strict';var multer=require('multer');var util=require(_0x4368('0x0'));var path=require(_0x4368('0x1'));var timeout=require(_0x4368('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4368('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4368('0x4'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x4368('0x5')]('/',auth['isAuthenticated'](),controller[_0x4368('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4368('0x7')]);router[_0x4368('0x5')](_0x4368('0x8'),auth['isAuthenticated'](),controller['getFields']);router[_0x4368('0x5')](_0x4368('0x9'),auth['isAuthenticated'](),controller[_0x4368('0xa')]);router[_0x4368('0x5')](_0x4368('0xb'),auth[_0x4368('0xc')](),controller[_0x4368('0xd')]);router[_0x4368('0xe')]('/',auth[_0x4368('0xc')](),controller[_0x4368('0xf')]);router[_0x4368('0x10')](_0x4368('0x11'),auth[_0x4368('0xc')](),controller[_0x4368('0x12')]);router[_0x4368('0x13')](_0x4368('0x11'),auth['isAuthenticated'](),controller[_0x4368('0x14')]);module[_0x4368('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index c579358..f2acc4e 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 _0x95f3=['STRING','sequelize','exports'];(function(_0x47738f,_0x361629){var _0x2a9def=function(_0x182f9a){while(--_0x182f9a){_0x47738f['push'](_0x47738f['shift']());}};_0x2a9def(++_0x361629);}(_0x95f3,0x196));var _0x395f=function(_0x306806,_0x4a5bf7){_0x306806=_0x306806-0x0;var _0x2cc344=_0x95f3[_0x306806];return _0x2cc344;};'use strict';var Sequelize=require(_0x395f('0x0'));module[_0x395f('0x1')]={'name':{'type':Sequelize[_0x395f('0x2')]},'description':{'type':Sequelize[_0x395f('0x2')]}}; \ No newline at end of file +var _0x9d10=['exports','STRING'];(function(_0x380b8f,_0x32271d){var _0x646c69=function(_0x57c77f){while(--_0x57c77f){_0x380b8f['push'](_0x380b8f['shift']());}};_0x646c69(++_0x32271d);}(_0x9d10,0x162));var _0x09d1=function(_0x176329,_0x53d28d){_0x176329=_0x176329-0x0;var _0x186483=_0x9d10[_0x176329];return _0x186483;};'use strict';var Sequelize=require('sequelize');module[_0x09d1('0x0')]={'name':{'type':Sequelize[_0x09d1('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d93c3aa..71419c3 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 _0xb240=['key','query','keys','intersection','model','fields','attributes','hasOwnProperty','where','pick','filters','merge','VIRTUAL','options','include','catch','params','rawAttributes','length','includeAll','find','create','body','getFields','SugarcrmField','order','sort','filter','nolimit','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','name','send','index','map','SugarcrmConfiguration','fieldName','type'];(function(_0x11147d,_0x1f2726){var _0x4086d4=function(_0x57ce0a){while(--_0x57ce0a){_0x11147d['push'](_0x11147d['shift']());}};_0x4086d4(++_0x1f2726);}(_0xb240,0x110));var _0x0b24=function(_0x222de9,_0x3ae373){_0x222de9=_0x222de9-0x0;var _0x5cba77=_0xb240[_0x222de9];return _0x5cba77;};'use strict';var emlformat=require(_0x0b24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b24('0x1'));var jsonpatch=require(_0x0b24('0x2'));var rp=require(_0x0b24('0x3'));var moment=require(_0x0b24('0x4'));var BPromise=require(_0x0b24('0x5'));var Mustache=require(_0x0b24('0x6'));var util=require(_0x0b24('0x7'));var path=require(_0x0b24('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0b24('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b24('0xa'));var squel=require('squel');var crypto=require(_0x0b24('0xb'));var jsforce=require(_0x0b24('0xc'));var deskjs=require(_0x0b24('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0b24('0xe'));var Papa=require(_0x0b24('0xf'));var Redis=require(_0x0b24('0x10'));var authService=require(_0x0b24('0x11'));var qs=require(_0x0b24('0x12'));var as=require(_0x0b24('0x13'));var hardwareService=require(_0x0b24('0x14'));var logger=require(_0x0b24('0x15'))(_0x0b24('0x16'));var utils=require(_0x0b24('0x17'));var config=require(_0x0b24('0x18'));var licenseUtil=require(_0x0b24('0x19'));var db=require(_0x0b24('0x1a'))['db'];function respondWithStatusCode(_0x34b88e,_0xcbf957){_0xcbf957=_0xcbf957||0xcc;return function(_0x4a7788){if(_0x4a7788){return _0x34b88e[_0x0b24('0x1b')](_0xcbf957);}return _0x34b88e[_0x0b24('0x1c')](_0xcbf957)[_0x0b24('0x1d')]();};}function respondWithResult(_0x58e598,_0x2e0e0f){_0x2e0e0f=_0x2e0e0f||0xc8;return function(_0x203519){if(_0x203519){return _0x58e598[_0x0b24('0x1c')](_0x2e0e0f)['json'](_0x203519);}};}function respondWithFilteredResult(_0x55cce5,_0x2fb6a1){return function(_0x434376){if(_0x434376){var _0x1862f9=typeof _0x2fb6a1[_0x0b24('0x1e')]==='undefined'&&typeof _0x2fb6a1[_0x0b24('0x1f')]===_0x0b24('0x20');var _0x35a64b=_0x434376[_0x0b24('0x21')];var _0x4fead2=_0x1862f9?0x0:_0x2fb6a1[_0x0b24('0x1e')];var _0x4b5e55=_0x1862f9?_0x434376[_0x0b24('0x21')]:_0x2fb6a1[_0x0b24('0x1e')]+_0x2fb6a1[_0x0b24('0x1f')];var _0xceb58e;if(_0x4b5e55>=_0x35a64b){_0x4b5e55=_0x35a64b;_0xceb58e=0xc8;}else{_0xceb58e=0xce;}_0x55cce5[_0x0b24('0x1c')](_0xceb58e);return _0x55cce5[_0x0b24('0x22')]('Content-Range',_0x4fead2+'-'+_0x4b5e55+'/'+_0x35a64b)[_0x0b24('0x23')](_0x434376);}return null;};}function patchUpdates(_0x245c3f){return function(_0x11a0f8){try{jsonpatch[_0x0b24('0x24')](_0x11a0f8,_0x245c3f,!![]);}catch(_0x201f09){return BPromise[_0x0b24('0x25')](_0x201f09);}return _0x11a0f8[_0x0b24('0x26')]();};}function saveUpdates(_0xf1c3e9,_0x4d1db1){return function(_0x4405ca){if(_0x4405ca){return _0x4405ca[_0x0b24('0x27')](_0xf1c3e9)['then'](function(_0x18c134){return _0x18c134;});}return null;};}function removeEntity(_0x31435c,_0x1e2915){return function(_0x133a5c){if(_0x133a5c){return _0x133a5c['destroy']()[_0x0b24('0x28')](function(){_0x31435c[_0x0b24('0x1c')](0xcc)[_0x0b24('0x1d')]();});}};}function handleEntityNotFound(_0x222c43,_0x47b296){return function(_0x6f0f12){if(!_0x6f0f12){_0x222c43[_0x0b24('0x1b')](0x194);}return _0x6f0f12;};}function handleError(_0x5a6d02,_0xadd3ce){_0xadd3ce=_0xadd3ce||0x1f4;return function(_0x1547a5){logger['error'](_0x1547a5['stack']);if(_0x1547a5[_0x0b24('0x29')]){delete _0x1547a5[_0x0b24('0x29')];}_0x5a6d02[_0x0b24('0x1c')](_0xadd3ce)[_0x0b24('0x2a')](_0x1547a5);};}exports[_0x0b24('0x2b')]=function(_0x425a09,_0x356cab){var _0xb8f467={},_0x49f366={},_0x58c609={'count':0x0,'rows':[]};var _0x36833f=_[_0x0b24('0x2c')](db[_0x0b24('0x2d')]['rawAttributes'],function(_0x1e1757){return{'name':_0x1e1757[_0x0b24('0x2e')],'type':_0x1e1757[_0x0b24('0x2f')][_0x0b24('0x30')]};});_0x49f366['model']=_[_0x0b24('0x2c')](_0x36833f,_0x0b24('0x29'));_0x49f366[_0x0b24('0x31')]=_[_0x0b24('0x32')](_0x425a09[_0x0b24('0x31')]);_0x49f366['filters']=_['intersection'](_0x49f366['model'],_0x49f366[_0x0b24('0x31')]);_0xb8f467['attributes']=_[_0x0b24('0x33')](_0x49f366[_0x0b24('0x34')],qs[_0x0b24('0x35')](_0x425a09[_0x0b24('0x31')][_0x0b24('0x35')]));_0xb8f467[_0x0b24('0x36')]=_0xb8f467['attributes']['length']?_0xb8f467[_0x0b24('0x36')]:_0x49f366[_0x0b24('0x34')];if(!_0x425a09[_0x0b24('0x31')][_0x0b24('0x37')]('nolimit')){_0xb8f467[_0x0b24('0x1f')]=qs['limit'](_0x425a09['query'][_0x0b24('0x1f')]);_0xb8f467[_0x0b24('0x1e')]=qs['offset'](_0x425a09['query'][_0x0b24('0x1e')]);}_0xb8f467['order']=qs['sort'](_0x425a09[_0x0b24('0x31')]['sort']);_0xb8f467[_0x0b24('0x38')]=qs['filters'](_[_0x0b24('0x39')](_0x425a09[_0x0b24('0x31')],_0x49f366[_0x0b24('0x3a')]),_0x36833f);if(_0x425a09[_0x0b24('0x31')]['filter']){_0xb8f467[_0x0b24('0x38')]=_[_0x0b24('0x3b')](_0xb8f467[_0x0b24('0x38')],{'$or':_[_0x0b24('0x2c')](_0x36833f,function(_0xbfd56a){if(_0xbfd56a[_0x0b24('0x2f')]!==_0x0b24('0x3c')){var _0x174314={};_0x174314[_0xbfd56a[_0x0b24('0x29')]]={'$like':'%'+_0x425a09[_0x0b24('0x31')]['filter']+'%'};return _0x174314;}})});}_0xb8f467=_[_0x0b24('0x3b')]({},_0xb8f467,_0x425a09[_0x0b24('0x3d')]);var _0x1d649e={'where':_0xb8f467[_0x0b24('0x38')]};return db[_0x0b24('0x2d')][_0x0b24('0x21')](_0x1d649e)[_0x0b24('0x28')](function(_0x2315d9){_0x58c609[_0x0b24('0x21')]=_0x2315d9;if(_0x425a09[_0x0b24('0x31')]['includeAll']){_0xb8f467[_0x0b24('0x3e')]=[{'all':!![]}];}return db[_0x0b24('0x2d')]['findAll'](_0xb8f467);})[_0x0b24('0x28')](function(_0x6be394){_0x58c609['rows']=_0x6be394;return _0x58c609;})['then'](respondWithFilteredResult(_0x356cab,_0xb8f467))[_0x0b24('0x3f')](handleError(_0x356cab,null));};exports['show']=function(_0x3bda51,_0x57b49b){var _0xad348d={'raw':![],'where':{'id':_0x3bda51[_0x0b24('0x40')]['id']}},_0x355d1e={};_0x355d1e[_0x0b24('0x34')]=_['keys'](db[_0x0b24('0x2d')][_0x0b24('0x41')]);_0x355d1e[_0x0b24('0x31')]=_['keys'](_0x3bda51[_0x0b24('0x31')]);_0x355d1e[_0x0b24('0x3a')]=_[_0x0b24('0x33')](_0x355d1e[_0x0b24('0x34')],_0x355d1e[_0x0b24('0x31')]);_0xad348d[_0x0b24('0x36')]=_[_0x0b24('0x33')](_0x355d1e['model'],qs['fields'](_0x3bda51[_0x0b24('0x31')]['fields']));_0xad348d[_0x0b24('0x36')]=_0xad348d['attributes'][_0x0b24('0x42')]?_0xad348d[_0x0b24('0x36')]:_0x355d1e[_0x0b24('0x34')];if(_0x3bda51['query'][_0x0b24('0x43')]){_0xad348d[_0x0b24('0x3e')]=[{'all':!![]}];}_0xad348d=_[_0x0b24('0x3b')]({},_0xad348d,_0x3bda51[_0x0b24('0x3d')]);return db[_0x0b24('0x2d')][_0x0b24('0x44')](_0xad348d)[_0x0b24('0x28')](handleEntityNotFound(_0x57b49b,null))[_0x0b24('0x28')](respondWithResult(_0x57b49b,null))[_0x0b24('0x3f')](handleError(_0x57b49b,null));};exports[_0x0b24('0x45')]=function(_0x160b6d,_0x5e036f){return db[_0x0b24('0x2d')]['create'](_0x160b6d['body'],{})[_0x0b24('0x28')](respondWithResult(_0x5e036f,0xc9))[_0x0b24('0x3f')](handleError(_0x5e036f,null));};exports[_0x0b24('0x27')]=function(_0x55f80f,_0x20b290){if(_0x55f80f[_0x0b24('0x46')]['id']){delete _0x55f80f[_0x0b24('0x46')]['id'];}return db[_0x0b24('0x2d')]['find']({'where':{'id':_0x55f80f[_0x0b24('0x40')]['id']}})[_0x0b24('0x28')](handleEntityNotFound(_0x20b290,null))[_0x0b24('0x28')](saveUpdates(_0x55f80f[_0x0b24('0x46')],null))[_0x0b24('0x28')](respondWithResult(_0x20b290,null))[_0x0b24('0x3f')](handleError(_0x20b290,null));};exports['destroy']=function(_0x30bab7,_0x151a4f){return db[_0x0b24('0x2d')][_0x0b24('0x44')]({'where':{'id':_0x30bab7[_0x0b24('0x40')]['id']}})[_0x0b24('0x28')](handleEntityNotFound(_0x151a4f,null))[_0x0b24('0x28')](removeEntity(_0x151a4f,null))[_0x0b24('0x3f')](handleError(_0x151a4f,null));};exports[_0x0b24('0x47')]=function(_0xda230c,_0x55405e,_0x1ed60f){var _0x1e6bf6={};var _0x25b124={};var _0x38ce43;var _0x3c20fa;return db[_0x0b24('0x2d')]['findOne']({'where':{'id':_0xda230c[_0x0b24('0x40')]['id']}})[_0x0b24('0x28')](handleEntityNotFound(_0x55405e,null))[_0x0b24('0x28')](function(_0x4461ed){if(_0x4461ed){_0x38ce43=_0x4461ed;_0x25b124[_0x0b24('0x34')]=_[_0x0b24('0x32')](db[_0x0b24('0x48')]['rawAttributes']);_0x25b124['query']=_[_0x0b24('0x32')](_0xda230c[_0x0b24('0x31')]);_0x25b124[_0x0b24('0x3a')]=_[_0x0b24('0x33')](_0x25b124['model'],_0x25b124[_0x0b24('0x31')]);_0x1e6bf6[_0x0b24('0x36')]=_[_0x0b24('0x33')](_0x25b124[_0x0b24('0x34')],qs[_0x0b24('0x35')](_0xda230c[_0x0b24('0x31')][_0x0b24('0x35')]));_0x1e6bf6[_0x0b24('0x36')]=_0x1e6bf6['attributes'][_0x0b24('0x42')]?_0x1e6bf6[_0x0b24('0x36')]:_0x25b124[_0x0b24('0x34')];_0x1e6bf6[_0x0b24('0x49')]=qs[_0x0b24('0x4a')](_0xda230c[_0x0b24('0x31')][_0x0b24('0x4a')]);_0x1e6bf6[_0x0b24('0x38')]=qs['filters'](_[_0x0b24('0x39')](_0xda230c[_0x0b24('0x31')],_0x25b124['filters']));if(_0xda230c['query'][_0x0b24('0x4b')]){_0x1e6bf6[_0x0b24('0x38')]=_[_0x0b24('0x3b')](_0x1e6bf6[_0x0b24('0x38')],{'$or':_[_0x0b24('0x2c')](_0x1e6bf6['attributes'],function(_0x352b52){var _0xed6959={};_0xed6959[_0x352b52]={'$like':'%'+_0xda230c[_0x0b24('0x31')][_0x0b24('0x4b')]+'%'};return _0xed6959;})});}_0x1e6bf6=_[_0x0b24('0x3b')]({},_0x1e6bf6,_0xda230c[_0x0b24('0x3d')]);return _0x38ce43[_0x0b24('0x47')](_0x1e6bf6);}})[_0x0b24('0x28')](function(_0x1e8d97){if(_0x1e8d97){_0x3c20fa=_0x1e8d97[_0x0b24('0x42')];if(!_0xda230c[_0x0b24('0x31')]['hasOwnProperty'](_0x0b24('0x4c'))){_0x1e6bf6[_0x0b24('0x1f')]=qs[_0x0b24('0x1f')](_0xda230c[_0x0b24('0x31')][_0x0b24('0x1f')]);_0x1e6bf6['offset']=qs[_0x0b24('0x1e')](_0xda230c['query']['offset']);}return _0x38ce43[_0x0b24('0x47')](_0x1e6bf6);}})['then'](function(_0x12345d){if(_0x12345d){return _0x12345d?{'count':_0x3c20fa,'rows':_0x12345d}:null;}})[_0x0b24('0x28')](respondWithResult(_0x55405e,null))[_0x0b24('0x3f')](handleError(_0x55405e,null));};exports[_0x0b24('0x4d')]=function(_0x5ee2fa,_0x532343,_0x30a9b1){var _0x335138={};var _0x4a6cb8={};var _0x4de2f0;var _0x606ed9;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x5ee2fa[_0x0b24('0x40')]['id']}})['then'](handleEntityNotFound(_0x532343,null))['then'](function(_0x3bd9e4){if(_0x3bd9e4){_0x4de2f0=_0x3bd9e4;_0x4a6cb8[_0x0b24('0x34')]=_[_0x0b24('0x32')](db[_0x0b24('0x48')][_0x0b24('0x41')]);_0x4a6cb8[_0x0b24('0x31')]=_[_0x0b24('0x32')](_0x5ee2fa['query']);_0x4a6cb8[_0x0b24('0x3a')]=_[_0x0b24('0x33')](_0x4a6cb8[_0x0b24('0x34')],_0x4a6cb8[_0x0b24('0x31')]);_0x335138['attributes']=_['intersection'](_0x4a6cb8[_0x0b24('0x34')],qs[_0x0b24('0x35')](_0x5ee2fa[_0x0b24('0x31')][_0x0b24('0x35')]));_0x335138[_0x0b24('0x36')]=_0x335138[_0x0b24('0x36')][_0x0b24('0x42')]?_0x335138['attributes']:_0x4a6cb8[_0x0b24('0x34')];_0x335138['order']=qs[_0x0b24('0x4a')](_0x5ee2fa[_0x0b24('0x31')][_0x0b24('0x4a')]);_0x335138[_0x0b24('0x38')]=qs[_0x0b24('0x3a')](_['pick'](_0x5ee2fa[_0x0b24('0x31')],_0x4a6cb8[_0x0b24('0x3a')]));if(_0x5ee2fa[_0x0b24('0x31')]['filter']){_0x335138['where']=_[_0x0b24('0x3b')](_0x335138[_0x0b24('0x38')],{'$or':_[_0x0b24('0x2c')](_0x335138['attributes'],function(_0x3543c8){var _0x19dfdc={};_0x19dfdc[_0x3543c8]={'$like':'%'+_0x5ee2fa[_0x0b24('0x31')][_0x0b24('0x4b')]+'%'};return _0x19dfdc;})});}_0x335138=_[_0x0b24('0x3b')]({},_0x335138,_0x5ee2fa[_0x0b24('0x3d')]);return _0x4de2f0[_0x0b24('0x4d')](_0x335138);}})[_0x0b24('0x28')](function(_0x156a24){if(_0x156a24){_0x606ed9=_0x156a24[_0x0b24('0x42')];if(!_0x5ee2fa['query'][_0x0b24('0x37')](_0x0b24('0x4c'))){_0x335138[_0x0b24('0x1f')]=qs[_0x0b24('0x1f')](_0x5ee2fa['query'][_0x0b24('0x1f')]);_0x335138[_0x0b24('0x1e')]=qs[_0x0b24('0x1e')](_0x5ee2fa[_0x0b24('0x31')][_0x0b24('0x1e')]);}return _0x4de2f0[_0x0b24('0x4d')](_0x335138);}})[_0x0b24('0x28')](function(_0x1ffe42){if(_0x1ffe42){return _0x1ffe42?{'count':_0x606ed9,'rows':_0x1ffe42}:null;}})[_0x0b24('0x28')](respondWithResult(_0x532343,null))[_0x0b24('0x3f')](handleError(_0x532343,null));};exports['getDescriptions']=function(_0x4cfec2,_0x5476d9,_0xfaae38){var _0x5c7a4d={};var _0x325413={};var _0x470c43;var _0xa24b8d;return db['SugarcrmConfiguration'][_0x0b24('0x4e')]({'where':{'id':_0x4cfec2[_0x0b24('0x40')]['id']}})[_0x0b24('0x28')](handleEntityNotFound(_0x5476d9,null))[_0x0b24('0x28')](function(_0x10a7e6){if(_0x10a7e6){_0x470c43=_0x10a7e6;_0x325413[_0x0b24('0x34')]=_[_0x0b24('0x32')](db[_0x0b24('0x48')][_0x0b24('0x41')]);_0x325413['query']=_['keys'](_0x4cfec2[_0x0b24('0x31')]);_0x325413[_0x0b24('0x3a')]=_[_0x0b24('0x33')](_0x325413[_0x0b24('0x34')],_0x325413[_0x0b24('0x31')]);_0x5c7a4d[_0x0b24('0x36')]=_[_0x0b24('0x33')](_0x325413[_0x0b24('0x34')],qs[_0x0b24('0x35')](_0x4cfec2[_0x0b24('0x31')][_0x0b24('0x35')]));_0x5c7a4d['attributes']=_0x5c7a4d[_0x0b24('0x36')][_0x0b24('0x42')]?_0x5c7a4d[_0x0b24('0x36')]:_0x325413['model'];_0x5c7a4d[_0x0b24('0x49')]=qs[_0x0b24('0x4a')](_0x4cfec2[_0x0b24('0x31')][_0x0b24('0x4a')]);_0x5c7a4d[_0x0b24('0x38')]=qs[_0x0b24('0x3a')](_['pick'](_0x4cfec2[_0x0b24('0x31')],_0x325413[_0x0b24('0x3a')]));if(_0x4cfec2[_0x0b24('0x31')][_0x0b24('0x4b')]){_0x5c7a4d[_0x0b24('0x38')]=_[_0x0b24('0x3b')](_0x5c7a4d[_0x0b24('0x38')],{'$or':_[_0x0b24('0x2c')](_0x5c7a4d['attributes'],function(_0x404c1c){var _0x34fd8b={};_0x34fd8b[_0x404c1c]={'$like':'%'+_0x4cfec2[_0x0b24('0x31')]['filter']+'%'};return _0x34fd8b;})});}_0x5c7a4d=_[_0x0b24('0x3b')]({},_0x5c7a4d,_0x4cfec2[_0x0b24('0x3d')]);return _0x470c43[_0x0b24('0x4f')](_0x5c7a4d);}})[_0x0b24('0x28')](function(_0x1dfec2){if(_0x1dfec2){_0xa24b8d=_0x1dfec2[_0x0b24('0x42')];if(!_0x4cfec2[_0x0b24('0x31')][_0x0b24('0x37')](_0x0b24('0x4c'))){_0x5c7a4d[_0x0b24('0x1f')]=qs[_0x0b24('0x1f')](_0x4cfec2['query']['limit']);_0x5c7a4d[_0x0b24('0x1e')]=qs[_0x0b24('0x1e')](_0x4cfec2['query'][_0x0b24('0x1e')]);}return _0x470c43['getDescriptions'](_0x5c7a4d);}})[_0x0b24('0x28')](function(_0x310209){if(_0x310209){return _0x310209?{'count':_0xa24b8d,'rows':_0x310209}:null;}})[_0x0b24('0x28')](respondWithResult(_0x5476d9,null))['catch'](handleError(_0x5476d9,null));}; \ No newline at end of file +var _0xa4b4=['end','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','body','findOne','SugarcrmField','getFields','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x47ad08,_0x28fcd1){var _0x302699=function(_0x45a213){while(--_0x45a213){_0x47ad08['push'](_0x47ad08['shift']());}};_0x302699(++_0x28fcd1);}(_0xa4b4,0x88));var _0x4a4b=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa4b4[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a4b('0x0'));var zipdir=require(_0x4a4b('0x1'));var jsonpatch=require(_0x4a4b('0x2'));var rp=require(_0x4a4b('0x3'));var moment=require('moment');var BPromise=require(_0x4a4b('0x4'));var Mustache=require(_0x4a4b('0x5'));var util=require(_0x4a4b('0x6'));var path=require(_0x4a4b('0x7'));var sox=require(_0x4a4b('0x8'));var csv=require(_0x4a4b('0x9'));var ejs=require(_0x4a4b('0xa'));var fs=require('fs');var fs_extra=require(_0x4a4b('0xb'));var _=require('lodash');var squel=require(_0x4a4b('0xc'));var crypto=require(_0x4a4b('0xd'));var jsforce=require(_0x4a4b('0xe'));var deskjs=require(_0x4a4b('0xf'));var toCsv=require(_0x4a4b('0x9'));var querystring=require(_0x4a4b('0x10'));var Papa=require(_0x4a4b('0x11'));var Redis=require(_0x4a4b('0x12'));var authService=require(_0x4a4b('0x13'));var qs=require(_0x4a4b('0x14'));var as=require(_0x4a4b('0x15'));var hardwareService=require(_0x4a4b('0x16'));var logger=require('../../config/logger')(_0x4a4b('0x17'));var utils=require(_0x4a4b('0x18'));var config=require(_0x4a4b('0x19'));var licenseUtil=require(_0x4a4b('0x1a'));var db=require(_0x4a4b('0x1b'))['db'];function respondWithStatusCode(_0x4c920d,_0x1a37b6){_0x1a37b6=_0x1a37b6||0xcc;return function(_0x1af708){if(_0x1af708){return _0x4c920d[_0x4a4b('0x1c')](_0x1a37b6);}return _0x4c920d[_0x4a4b('0x1d')](_0x1a37b6)[_0x4a4b('0x1e')]();};}function respondWithResult(_0x32d358,_0x5a0f79){_0x5a0f79=_0x5a0f79||0xc8;return function(_0x5c5933){if(_0x5c5933){return _0x32d358[_0x4a4b('0x1d')](_0x5a0f79)['json'](_0x5c5933);}};}function respondWithFilteredResult(_0x479462,_0x4ff673){return function(_0x3a2ac9){if(_0x3a2ac9){var _0x141070=typeof _0x4ff673['offset']==='undefined'&&typeof _0x4ff673[_0x4a4b('0x1f')]==='undefined';var _0x5e4376=_0x3a2ac9[_0x4a4b('0x20')];var _0x596b21=_0x141070?0x0:_0x4ff673[_0x4a4b('0x21')];var _0x11994d=_0x141070?_0x3a2ac9[_0x4a4b('0x20')]:_0x4ff673[_0x4a4b('0x21')]+_0x4ff673[_0x4a4b('0x1f')];var _0x11cb16;if(_0x11994d>=_0x5e4376){_0x11994d=_0x5e4376;_0x11cb16=0xc8;}else{_0x11cb16=0xce;}_0x479462[_0x4a4b('0x1d')](_0x11cb16);return _0x479462[_0x4a4b('0x22')](_0x4a4b('0x23'),_0x596b21+'-'+_0x11994d+'/'+_0x5e4376)[_0x4a4b('0x24')](_0x3a2ac9);}return null;};}function patchUpdates(_0xb41342){return function(_0x4414d4){try{jsonpatch[_0x4a4b('0x25')](_0x4414d4,_0xb41342,!![]);}catch(_0x2232cf){return BPromise[_0x4a4b('0x26')](_0x2232cf);}return _0x4414d4[_0x4a4b('0x27')]();};}function saveUpdates(_0x2d1a09,_0x345ec0){return function(_0xd65aaf){if(_0xd65aaf){return _0xd65aaf[_0x4a4b('0x28')](_0x2d1a09)[_0x4a4b('0x29')](function(_0x30980a){return _0x30980a;});}return null;};}function removeEntity(_0x319181,_0x30e694){return function(_0xe5a9a3){if(_0xe5a9a3){return _0xe5a9a3['destroy']()['then'](function(){_0x319181[_0x4a4b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cd923,_0x3e691f){return function(_0x26cdfa){if(!_0x26cdfa){_0x3cd923[_0x4a4b('0x1c')](0x194);}return _0x26cdfa;};}function handleError(_0x2de1d6,_0x1aacbb){_0x1aacbb=_0x1aacbb||0x1f4;return function(_0x33b7de){logger['error'](_0x33b7de[_0x4a4b('0x2a')]);if(_0x33b7de[_0x4a4b('0x2b')]){delete _0x33b7de['name'];}_0x2de1d6[_0x4a4b('0x1d')](_0x1aacbb)[_0x4a4b('0x2c')](_0x33b7de);};}exports[_0x4a4b('0x2d')]=function(_0x2ffd26,_0x103220){var _0x3a9210={},_0xce3768={},_0x27cc00={'count':0x0,'rows':[]};var _0xb43b56=_[_0x4a4b('0x2e')](db[_0x4a4b('0x2f')][_0x4a4b('0x30')],function(_0x35c70b){return{'name':_0x35c70b[_0x4a4b('0x31')],'type':_0x35c70b[_0x4a4b('0x32')][_0x4a4b('0x33')]};});_0xce3768[_0x4a4b('0x34')]=_['map'](_0xb43b56,_0x4a4b('0x2b'));_0xce3768[_0x4a4b('0x35')]=_[_0x4a4b('0x36')](_0x2ffd26['query']);_0xce3768[_0x4a4b('0x37')]=_['intersection'](_0xce3768[_0x4a4b('0x34')],_0xce3768['query']);_0x3a9210[_0x4a4b('0x38')]=_[_0x4a4b('0x39')](_0xce3768[_0x4a4b('0x34')],qs[_0x4a4b('0x3a')](_0x2ffd26[_0x4a4b('0x35')][_0x4a4b('0x3a')]));_0x3a9210['attributes']=_0x3a9210[_0x4a4b('0x38')][_0x4a4b('0x3b')]?_0x3a9210[_0x4a4b('0x38')]:_0xce3768['model'];if(!_0x2ffd26['query'][_0x4a4b('0x3c')]('nolimit')){_0x3a9210[_0x4a4b('0x1f')]=qs[_0x4a4b('0x1f')](_0x2ffd26[_0x4a4b('0x35')][_0x4a4b('0x1f')]);_0x3a9210[_0x4a4b('0x21')]=qs['offset'](_0x2ffd26['query'][_0x4a4b('0x21')]);}_0x3a9210[_0x4a4b('0x3d')]=qs[_0x4a4b('0x3e')](_0x2ffd26['query'][_0x4a4b('0x3e')]);_0x3a9210[_0x4a4b('0x3f')]=qs[_0x4a4b('0x37')](_[_0x4a4b('0x40')](_0x2ffd26['query'],_0xce3768[_0x4a4b('0x37')]),_0xb43b56);if(_0x2ffd26[_0x4a4b('0x35')][_0x4a4b('0x41')]){_0x3a9210[_0x4a4b('0x3f')]=_[_0x4a4b('0x42')](_0x3a9210[_0x4a4b('0x3f')],{'$or':_['map'](_0xb43b56,function(_0x176e53){if(_0x176e53[_0x4a4b('0x32')]!==_0x4a4b('0x43')){var _0x31b355={};_0x31b355[_0x176e53['name']]={'$like':'%'+_0x2ffd26['query'][_0x4a4b('0x41')]+'%'};return _0x31b355;}})});}_0x3a9210=_[_0x4a4b('0x42')]({},_0x3a9210,_0x2ffd26[_0x4a4b('0x44')]);var _0x6b611a={'where':_0x3a9210[_0x4a4b('0x3f')]};return db[_0x4a4b('0x2f')][_0x4a4b('0x20')](_0x6b611a)[_0x4a4b('0x29')](function(_0x31caf2){_0x27cc00[_0x4a4b('0x20')]=_0x31caf2;if(_0x2ffd26['query'][_0x4a4b('0x45')]){_0x3a9210[_0x4a4b('0x46')]=[{'all':!![]}];}return db[_0x4a4b('0x2f')][_0x4a4b('0x47')](_0x3a9210);})[_0x4a4b('0x29')](function(_0x1d86ce){_0x27cc00[_0x4a4b('0x48')]=_0x1d86ce;return _0x27cc00;})['then'](respondWithFilteredResult(_0x103220,_0x3a9210))['catch'](handleError(_0x103220,null));};exports['show']=function(_0x5f3000,_0x2f3202){var _0x4c9891={'raw':![],'where':{'id':_0x5f3000[_0x4a4b('0x49')]['id']}},_0x395dc7={};_0x395dc7['model']=_[_0x4a4b('0x36')](db[_0x4a4b('0x2f')]['rawAttributes']);_0x395dc7[_0x4a4b('0x35')]=_[_0x4a4b('0x36')](_0x5f3000['query']);_0x395dc7[_0x4a4b('0x37')]=_[_0x4a4b('0x39')](_0x395dc7[_0x4a4b('0x34')],_0x395dc7['query']);_0x4c9891['attributes']=_[_0x4a4b('0x39')](_0x395dc7[_0x4a4b('0x34')],qs['fields'](_0x5f3000['query'][_0x4a4b('0x3a')]));_0x4c9891[_0x4a4b('0x38')]=_0x4c9891[_0x4a4b('0x38')][_0x4a4b('0x3b')]?_0x4c9891['attributes']:_0x395dc7[_0x4a4b('0x34')];if(_0x5f3000[_0x4a4b('0x35')][_0x4a4b('0x45')]){_0x4c9891[_0x4a4b('0x46')]=[{'all':!![]}];}_0x4c9891=_['merge']({},_0x4c9891,_0x5f3000[_0x4a4b('0x44')]);return db[_0x4a4b('0x2f')][_0x4a4b('0x4a')](_0x4c9891)[_0x4a4b('0x29')](handleEntityNotFound(_0x2f3202,null))[_0x4a4b('0x29')](respondWithResult(_0x2f3202,null))[_0x4a4b('0x4b')](handleError(_0x2f3202,null));};exports['create']=function(_0x3e3028,_0x3b9eb5){return db[_0x4a4b('0x2f')]['create'](_0x3e3028[_0x4a4b('0x4c')],{})['then'](respondWithResult(_0x3b9eb5,0xc9))[_0x4a4b('0x4b')](handleError(_0x3b9eb5,null));};exports[_0x4a4b('0x28')]=function(_0x15f59e,_0x4532e4){if(_0x15f59e['body']['id']){delete _0x15f59e[_0x4a4b('0x4c')]['id'];}return db[_0x4a4b('0x2f')][_0x4a4b('0x4a')]({'where':{'id':_0x15f59e[_0x4a4b('0x49')]['id']}})[_0x4a4b('0x29')](handleEntityNotFound(_0x4532e4,null))[_0x4a4b('0x29')](saveUpdates(_0x15f59e[_0x4a4b('0x4c')],null))[_0x4a4b('0x29')](respondWithResult(_0x4532e4,null))[_0x4a4b('0x4b')](handleError(_0x4532e4,null));};exports['destroy']=function(_0x499e62,_0xec844a){return db[_0x4a4b('0x2f')][_0x4a4b('0x4a')]({'where':{'id':_0x499e62[_0x4a4b('0x49')]['id']}})['then'](handleEntityNotFound(_0xec844a,null))['then'](removeEntity(_0xec844a,null))[_0x4a4b('0x4b')](handleError(_0xec844a,null));};exports['getFields']=function(_0x376bc3,_0x64ef6c,_0x42361c){var _0x5cd581={};var _0x36a372={};var _0x2b8f9c;var _0x180b8c;return db[_0x4a4b('0x2f')][_0x4a4b('0x4d')]({'where':{'id':_0x376bc3[_0x4a4b('0x49')]['id']}})[_0x4a4b('0x29')](handleEntityNotFound(_0x64ef6c,null))[_0x4a4b('0x29')](function(_0x22872c){if(_0x22872c){_0x2b8f9c=_0x22872c;_0x36a372[_0x4a4b('0x34')]=_[_0x4a4b('0x36')](db[_0x4a4b('0x4e')]['rawAttributes']);_0x36a372[_0x4a4b('0x35')]=_['keys'](_0x376bc3[_0x4a4b('0x35')]);_0x36a372[_0x4a4b('0x37')]=_['intersection'](_0x36a372[_0x4a4b('0x34')],_0x36a372[_0x4a4b('0x35')]);_0x5cd581[_0x4a4b('0x38')]=_[_0x4a4b('0x39')](_0x36a372[_0x4a4b('0x34')],qs[_0x4a4b('0x3a')](_0x376bc3[_0x4a4b('0x35')][_0x4a4b('0x3a')]));_0x5cd581[_0x4a4b('0x38')]=_0x5cd581[_0x4a4b('0x38')]['length']?_0x5cd581[_0x4a4b('0x38')]:_0x36a372[_0x4a4b('0x34')];_0x5cd581[_0x4a4b('0x3d')]=qs[_0x4a4b('0x3e')](_0x376bc3[_0x4a4b('0x35')]['sort']);_0x5cd581[_0x4a4b('0x3f')]=qs['filters'](_[_0x4a4b('0x40')](_0x376bc3[_0x4a4b('0x35')],_0x36a372[_0x4a4b('0x37')]));if(_0x376bc3[_0x4a4b('0x35')]['filter']){_0x5cd581['where']=_[_0x4a4b('0x42')](_0x5cd581['where'],{'$or':_[_0x4a4b('0x2e')](_0x5cd581['attributes'],function(_0x202917){var _0x25c4ec={};_0x25c4ec[_0x202917]={'$like':'%'+_0x376bc3[_0x4a4b('0x35')][_0x4a4b('0x41')]+'%'};return _0x25c4ec;})});}_0x5cd581=_[_0x4a4b('0x42')]({},_0x5cd581,_0x376bc3[_0x4a4b('0x44')]);return _0x2b8f9c[_0x4a4b('0x4f')](_0x5cd581);}})[_0x4a4b('0x29')](function(_0x390cd9){if(_0x390cd9){_0x180b8c=_0x390cd9['length'];if(!_0x376bc3[_0x4a4b('0x35')]['hasOwnProperty']('nolimit')){_0x5cd581[_0x4a4b('0x1f')]=qs[_0x4a4b('0x1f')](_0x376bc3[_0x4a4b('0x35')][_0x4a4b('0x1f')]);_0x5cd581[_0x4a4b('0x21')]=qs['offset'](_0x376bc3[_0x4a4b('0x35')][_0x4a4b('0x21')]);}return _0x2b8f9c[_0x4a4b('0x4f')](_0x5cd581);}})[_0x4a4b('0x29')](function(_0x15fd4d){if(_0x15fd4d){return _0x15fd4d?{'count':_0x180b8c,'rows':_0x15fd4d}:null;}})[_0x4a4b('0x29')](respondWithResult(_0x64ef6c,null))[_0x4a4b('0x4b')](handleError(_0x64ef6c,null));};exports['getSubjects']=function(_0x513fd1,_0x1e72c9,_0x152135){var _0x3d87d3={};var _0x5d8cd0={};var _0x21ff7b;var _0x246db0;return db[_0x4a4b('0x2f')][_0x4a4b('0x4d')]({'where':{'id':_0x513fd1['params']['id']}})[_0x4a4b('0x29')](handleEntityNotFound(_0x1e72c9,null))[_0x4a4b('0x29')](function(_0x12241c){if(_0x12241c){_0x21ff7b=_0x12241c;_0x5d8cd0['model']=_['keys'](db['SugarcrmField'][_0x4a4b('0x30')]);_0x5d8cd0[_0x4a4b('0x35')]=_[_0x4a4b('0x36')](_0x513fd1[_0x4a4b('0x35')]);_0x5d8cd0[_0x4a4b('0x37')]=_[_0x4a4b('0x39')](_0x5d8cd0[_0x4a4b('0x34')],_0x5d8cd0[_0x4a4b('0x35')]);_0x3d87d3[_0x4a4b('0x38')]=_['intersection'](_0x5d8cd0['model'],qs[_0x4a4b('0x3a')](_0x513fd1[_0x4a4b('0x35')][_0x4a4b('0x3a')]));_0x3d87d3['attributes']=_0x3d87d3[_0x4a4b('0x38')][_0x4a4b('0x3b')]?_0x3d87d3['attributes']:_0x5d8cd0[_0x4a4b('0x34')];_0x3d87d3[_0x4a4b('0x3d')]=qs[_0x4a4b('0x3e')](_0x513fd1['query'][_0x4a4b('0x3e')]);_0x3d87d3[_0x4a4b('0x3f')]=qs['filters'](_[_0x4a4b('0x40')](_0x513fd1[_0x4a4b('0x35')],_0x5d8cd0[_0x4a4b('0x37')]));if(_0x513fd1[_0x4a4b('0x35')][_0x4a4b('0x41')]){_0x3d87d3[_0x4a4b('0x3f')]=_[_0x4a4b('0x42')](_0x3d87d3['where'],{'$or':_[_0x4a4b('0x2e')](_0x3d87d3[_0x4a4b('0x38')],function(_0x1bc736){var _0x181c91={};_0x181c91[_0x1bc736]={'$like':'%'+_0x513fd1[_0x4a4b('0x35')][_0x4a4b('0x41')]+'%'};return _0x181c91;})});}_0x3d87d3=_['merge']({},_0x3d87d3,_0x513fd1[_0x4a4b('0x44')]);return _0x21ff7b[_0x4a4b('0x50')](_0x3d87d3);}})[_0x4a4b('0x29')](function(_0x4478e6){if(_0x4478e6){_0x246db0=_0x4478e6['length'];if(!_0x513fd1[_0x4a4b('0x35')]['hasOwnProperty'](_0x4a4b('0x51'))){_0x3d87d3[_0x4a4b('0x1f')]=qs[_0x4a4b('0x1f')](_0x513fd1[_0x4a4b('0x35')][_0x4a4b('0x1f')]);_0x3d87d3['offset']=qs[_0x4a4b('0x21')](_0x513fd1[_0x4a4b('0x35')][_0x4a4b('0x21')]);}return _0x21ff7b[_0x4a4b('0x50')](_0x3d87d3);}})[_0x4a4b('0x29')](function(_0x1930a2){if(_0x1930a2){return _0x1930a2?{'count':_0x246db0,'rows':_0x1930a2}:null;}})['then'](respondWithResult(_0x1e72c9,null))[_0x4a4b('0x4b')](handleError(_0x1e72c9,null));};exports[_0x4a4b('0x52')]=function(_0x3b6863,_0x5d7ec3,_0x34cb89){var _0x488fd9={};var _0x4909e3={};var _0x5f04c9;var _0x5c522;return db['SugarcrmConfiguration'][_0x4a4b('0x4d')]({'where':{'id':_0x3b6863[_0x4a4b('0x49')]['id']}})['then'](handleEntityNotFound(_0x5d7ec3,null))[_0x4a4b('0x29')](function(_0xc0bf23){if(_0xc0bf23){_0x5f04c9=_0xc0bf23;_0x4909e3[_0x4a4b('0x34')]=_[_0x4a4b('0x36')](db[_0x4a4b('0x4e')]['rawAttributes']);_0x4909e3[_0x4a4b('0x35')]=_[_0x4a4b('0x36')](_0x3b6863['query']);_0x4909e3[_0x4a4b('0x37')]=_[_0x4a4b('0x39')](_0x4909e3['model'],_0x4909e3['query']);_0x488fd9[_0x4a4b('0x38')]=_[_0x4a4b('0x39')](_0x4909e3['model'],qs[_0x4a4b('0x3a')](_0x3b6863['query'][_0x4a4b('0x3a')]));_0x488fd9[_0x4a4b('0x38')]=_0x488fd9[_0x4a4b('0x38')]['length']?_0x488fd9[_0x4a4b('0x38')]:_0x4909e3[_0x4a4b('0x34')];_0x488fd9['order']=qs['sort'](_0x3b6863[_0x4a4b('0x35')][_0x4a4b('0x3e')]);_0x488fd9[_0x4a4b('0x3f')]=qs[_0x4a4b('0x37')](_[_0x4a4b('0x40')](_0x3b6863[_0x4a4b('0x35')],_0x4909e3['filters']));if(_0x3b6863['query'][_0x4a4b('0x41')]){_0x488fd9[_0x4a4b('0x3f')]=_[_0x4a4b('0x42')](_0x488fd9[_0x4a4b('0x3f')],{'$or':_['map'](_0x488fd9[_0x4a4b('0x38')],function(_0xf8f017){var _0x448d1b={};_0x448d1b[_0xf8f017]={'$like':'%'+_0x3b6863[_0x4a4b('0x35')][_0x4a4b('0x41')]+'%'};return _0x448d1b;})});}_0x488fd9=_[_0x4a4b('0x42')]({},_0x488fd9,_0x3b6863[_0x4a4b('0x44')]);return _0x5f04c9[_0x4a4b('0x52')](_0x488fd9);}})[_0x4a4b('0x29')](function(_0x490cbf){if(_0x490cbf){_0x5c522=_0x490cbf[_0x4a4b('0x3b')];if(!_0x3b6863['query'][_0x4a4b('0x3c')](_0x4a4b('0x51'))){_0x488fd9[_0x4a4b('0x1f')]=qs[_0x4a4b('0x1f')](_0x3b6863[_0x4a4b('0x35')]['limit']);_0x488fd9[_0x4a4b('0x21')]=qs[_0x4a4b('0x21')](_0x3b6863['query'][_0x4a4b('0x21')]);}return _0x5f04c9[_0x4a4b('0x52')](_0x488fd9);}})[_0x4a4b('0x29')](function(_0x528b10){if(_0x528b10){return _0x528b10?{'count':_0x5c522,'rows':_0x528b10}:null;}})['then'](respondWithResult(_0x5d7ec3,null))[_0x4a4b('0x4b')](handleError(_0x5d7ec3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 4f2adb2..86f97d7 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 _0xf454=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x1cbb7c,_0x5c4886){var _0x519224=function(_0x180155){while(--_0x180155){_0x1cbb7c['push'](_0x1cbb7c['shift']());}};_0x519224(++_0x5c4886);}(_0xf454,0x179));var _0x4f45=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf454[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4f45('0x0'));var util=require(_0x4f45('0x1'));var logger=require(_0x4f45('0x2'))(_0x4f45('0x3'));var moment=require(_0x4f45('0x4'));var BPromise=require(_0x4f45('0x5'));var rp=require(_0x4f45('0x6'));var fs=require('fs');var path=require(_0x4f45('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f45('0x8'));module[_0x4f45('0x9')]=function(_0x2bcada,_0x1af68b){return _0x2bcada[_0x4f45('0xa')](_0x4f45('0xb'),attributes,{'tableName':_0x4f45('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a06=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','path'];(function(_0x17660d,_0x233288){var _0xce3b14=function(_0x35ca8e){while(--_0x35ca8e){_0x17660d['push'](_0x17660d['shift']());}};_0xce3b14(++_0x233288);}(_0x2a06,0x1f4));var _0x62a0=function(_0x570016,_0x111cb9){_0x570016=_0x570016-0x0;var _0x3b4176=_0x2a06[_0x570016];return _0x3b4176;};'use strict';var _=require(_0x62a0('0x0'));var util=require(_0x62a0('0x1'));var logger=require(_0x62a0('0x2'))(_0x62a0('0x3'));var moment=require(_0x62a0('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x62a0('0x5'));var rimraf=require(_0x62a0('0x6'));var config=require(_0x62a0('0x7'));var attributes=require(_0x62a0('0x8'));module[_0x62a0('0x9')]=function(_0x526c96,_0x3e313c){return _0x526c96['define'](_0x62a0('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 962f89f..96a40c5 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 _0x5bf0=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result'];(function(_0x5f2a50,_0x4700e0){var _0x7577ca=function(_0x45f47e){while(--_0x45f47e){_0x5f2a50['push'](_0x5f2a50['shift']());}};_0x7577ca(++_0x4700e0);}(_0x5bf0,0x17a));var _0x05bf=function(_0x55ce3e,_0x4b0935){_0x55ce3e=_0x55ce3e-0x0;var _0x1f2f95=_0x5bf0[_0x55ce3e];return _0x1f2f95;};'use strict';var _=require(_0x05bf('0x0'));var util=require('util');var moment=require(_0x05bf('0x1'));var BPromise=require(_0x05bf('0x2'));var rs=require(_0x05bf('0x3'));var fs=require('fs');var Redis=require(_0x05bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x05bf('0x5'));var logger=require('../../config/logger')(_0x05bf('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x05bf('0x7')][_0x05bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1b5ce,_0x2f8b94,_0x381a6b){return new BPromise(function(_0x9d363e,_0x7f4c6f){return client['request'](_0xe1b5ce,_0x381a6b)[_0x05bf('0x9')](function(_0x46ee02){logger[_0x05bf('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f8b94,'request\x20sent');logger['debug'](_0x05bf('0xb'),_0x2f8b94,_0x05bf('0xc'),JSON['stringify'](_0x46ee02));if(_0x46ee02[_0x05bf('0xd')]){if(_0x46ee02[_0x05bf('0xd')][_0x05bf('0xe')]===0x1f4){logger['error'](_0x05bf('0xf'),_0x2f8b94,_0x46ee02['error'][_0x05bf('0x10')]);return _0x7f4c6f(_0x46ee02[_0x05bf('0xd')][_0x05bf('0x10')]);}logger[_0x05bf('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2f8b94,_0x46ee02[_0x05bf('0xd')][_0x05bf('0x10')]);return _0x9d363e(_0x46ee02['error'][_0x05bf('0x10')]);}else{logger[_0x05bf('0xa')](_0x05bf('0xf'),_0x2f8b94,_0x05bf('0xc'));_0x9d363e(_0x46ee02[_0x05bf('0x11')][_0x05bf('0x10')]);}})['catch'](function(_0xe0080a){logger[_0x05bf('0xd')](_0x05bf('0xf'),_0x2f8b94,_0xe0080a);_0x7f4c6f(_0xe0080a);});});} \ No newline at end of file +var _0x46dc=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x40001a,_0x57f2ae){var _0x4cec45=function(_0x5e4166){while(--_0x5e4166){_0x40001a['push'](_0x40001a['shift']());}};_0x4cec45(++_0x57f2ae);}(_0x46dc,0x13e));var _0xc46d=function(_0x4406eb,_0x3cf162){_0x4406eb=_0x4406eb-0x0;var _0x271aa4=_0x46dc[_0x4406eb];return _0x271aa4;};'use strict';var _=require(_0xc46d('0x0'));var util=require(_0xc46d('0x1'));var moment=require(_0xc46d('0x2'));var BPromise=require(_0xc46d('0x3'));var rs=require(_0xc46d('0x4'));var fs=require('fs');var Redis=require(_0xc46d('0x5'));var db=require(_0xc46d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc46d('0x7'));var config=require(_0xc46d('0x8'));var jayson=require(_0xc46d('0x9'));var client=jayson[_0xc46d('0xa')][_0xc46d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11bf3e,_0x1870b7,_0x2a987a){return new BPromise(function(_0x6fde4f,_0x18e66b){return client[_0xc46d('0xc')](_0x11bf3e,_0x2a987a)[_0xc46d('0xd')](function(_0xaecfe8){logger[_0xc46d('0xe')](_0xc46d('0xf'),_0x1870b7,'request\x20sent');logger['debug'](_0xc46d('0x10'),_0x1870b7,_0xc46d('0x11'),JSON[_0xc46d('0x12')](_0xaecfe8));if(_0xaecfe8[_0xc46d('0x13')]){if(_0xaecfe8[_0xc46d('0x13')]['code']===0x1f4){logger[_0xc46d('0x13')](_0xc46d('0xf'),_0x1870b7,_0xaecfe8['error']['message']);return _0x18e66b(_0xaecfe8['error'][_0xc46d('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x1870b7,_0xaecfe8['error'][_0xc46d('0x14')]);return _0x6fde4f(_0xaecfe8[_0xc46d('0x13')][_0xc46d('0x14')]);}else{logger[_0xc46d('0xe')](_0xc46d('0xf'),_0x1870b7,_0xc46d('0x11'));_0x6fde4f(_0xaecfe8[_0xc46d('0x15')][_0xc46d('0x14')]);}})[_0xc46d('0x16')](function(_0x20a342){logger[_0xc46d('0x13')](_0xc46d('0xf'),_0x1870b7,_0x20a342);_0x18e66b(_0x20a342);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 4eeeffb..21bba42 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 _0x24d2=['./intSugarcrmField.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','multer','util','path','Router','../../config/environment'];(function(_0x401be1,_0x2f5c4a){var _0x7b4efe=function(_0x529538){while(--_0x529538){_0x401be1['push'](_0x401be1['shift']());}};_0x7b4efe(++_0x2f5c4a);}(_0x24d2,0x1c9));var _0x224d=function(_0x109ca4,_0x18be7a){_0x109ca4=_0x109ca4-0x0;var _0x2d74a9=_0x24d2[_0x109ca4];return _0x2d74a9;};'use strict';var multer=require(_0x224d('0x0'));var util=require(_0x224d('0x1'));var path=require(_0x224d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x224d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x224d('0x4'));var controller=require(_0x224d('0x5'));router[_0x224d('0x6')]('/',auth[_0x224d('0x7')](),controller['index']);router[_0x224d('0x6')](_0x224d('0x8'),auth[_0x224d('0x7')](),controller['show']);router['post']('/',auth[_0x224d('0x7')](),controller[_0x224d('0x9')]);router[_0x224d('0xa')](_0x224d('0x8'),auth[_0x224d('0x7')](),controller[_0x224d('0xb')]);router[_0x224d('0xc')](_0x224d('0x8'),auth[_0x224d('0x7')](),controller[_0x224d('0xd')]);module['exports']=router; \ No newline at end of file +var _0xa04e=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x17b56e,_0x547cbe){var _0x44ffc6=function(_0x598439){while(--_0x598439){_0x17b56e['push'](_0x17b56e['shift']());}};_0x44ffc6(++_0x547cbe);}(_0xa04e,0x129));var _0xea04=function(_0x214efb,_0x515f95){_0x214efb=_0x214efb-0x0;var _0x41856a=_0xa04e[_0x214efb];return _0x41856a;};'use strict';var multer=require(_0xea04('0x0'));var util=require(_0xea04('0x1'));var path=require(_0xea04('0x2'));var timeout=require(_0xea04('0x3'));var express=require(_0xea04('0x4'));var router=express[_0xea04('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xea04('0x6'));var interaction=require(_0xea04('0x7'));var config=require(_0xea04('0x8'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xea04('0x9')](),controller[_0xea04('0xa')]);router[_0xea04('0xb')](_0xea04('0xc'),auth[_0xea04('0x9')](),controller[_0xea04('0xd')]);router['post']('/',auth[_0xea04('0x9')](),controller[_0xea04('0xe')]);router[_0xea04('0xf')](_0xea04('0xc'),auth[_0xea04('0x9')](),controller['update']);router[_0xea04('0x10')](_0xea04('0xc'),auth[_0xea04('0x9')](),controller[_0xea04('0x11')]);module[_0xea04('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 28756ba..2489ea7 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 _0xd65c=['keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','string','variable'];(function(_0x26c396,_0x5f1f75){var _0x1112bd=function(_0x30b5ec){while(--_0x30b5ec){_0x26c396['push'](_0x26c396['shift']());}};_0x1112bd(++_0x5f1f75);}(_0xd65c,0x8c));var _0xcd65=function(_0x19a562,_0x4b669f){_0x19a562=_0x19a562-0x0;var _0x3bd3f3=_0xd65c[_0x19a562];return _0x3bd3f3;};'use strict';var Sequelize=require(_0xcd65('0x0'));module[_0xcd65('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcd65('0x2'),_0xcd65('0x3'),'customVariable',_0xcd65('0x4'),'picklist'),'defaultValue':_0xcd65('0x2')},'content':{'type':Sequelize[_0xcd65('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xcd65('0x6'))},'keyContent':{'type':Sequelize[_0xcd65('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcd65('0x5')]},'customField':{'type':Sequelize[_0xcd65('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcd65('0x5')]}}; \ No newline at end of file +var _0xadab=['sequelize','ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN'];(function(_0x162b7c,_0xce6e99){var _0x304633=function(_0x10b640){while(--_0x10b640){_0x162b7c['push'](_0x162b7c['shift']());}};_0x304633(++_0xce6e99);}(_0xadab,0x150));var _0xbada=function(_0x451402,_0x561cb8){_0x451402=_0x451402-0x0;var _0x4ffb7f=_0xadab[_0x451402];return _0x4ffb7f;};'use strict';var Sequelize=require(_0xbada('0x0'));module['exports']={'type':{'type':Sequelize[_0xbada('0x1')]('string',_0xbada('0x2'),_0xbada('0x3'),'keyValue',_0xbada('0x4')),'defaultValue':_0xbada('0x5')},'content':{'type':Sequelize[_0xbada('0x6')]},'key':{'type':Sequelize[_0xbada('0x6')]},'keyType':{'type':Sequelize[_0xbada('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbada('0x6')]},'nameField':{'type':Sequelize[_0xbada('0x6')]},'customField':{'type':Sequelize[_0xbada('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbada('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 296dec1..5227572 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 _0xd814=['sendStatus','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','find','create','body','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','destroy','then'];(function(_0x2f9005,_0x2a4281){var _0x1ef28a=function(_0x51bfdb){while(--_0x51bfdb){_0x2f9005['push'](_0x2f9005['shift']());}};_0x1ef28a(++_0x2a4281);}(_0xd814,0xee));var _0x4d81=function(_0x190509,_0xefb742){_0x190509=_0x190509-0x0;var _0x4032a8=_0xd814[_0x190509];return _0x4032a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d81('0x0'));var zipdir=require(_0x4d81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d81('0x2'));var moment=require(_0x4d81('0x3'));var BPromise=require(_0x4d81('0x4'));var Mustache=require(_0x4d81('0x5'));var util=require(_0x4d81('0x6'));var path=require('path');var sox=require(_0x4d81('0x7'));var csv=require(_0x4d81('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d81('0x9'));var squel=require(_0x4d81('0xa'));var crypto=require(_0x4d81('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d81('0x8'));var querystring=require(_0x4d81('0xc'));var Papa=require(_0x4d81('0xd'));var Redis=require(_0x4d81('0xe'));var authService=require(_0x4d81('0xf'));var qs=require(_0x4d81('0x10'));var as=require(_0x4d81('0x11'));var hardwareService=require(_0x4d81('0x12'));var logger=require('../../config/logger')(_0x4d81('0x13'));var utils=require('../../config/utils');var config=require(_0x4d81('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d81('0x15'))['db'];function respondWithStatusCode(_0x412f2b,_0x120b4c){_0x120b4c=_0x120b4c||0xcc;return function(_0x4b4096){if(_0x4b4096){return _0x412f2b['sendStatus'](_0x120b4c);}return _0x412f2b[_0x4d81('0x16')](_0x120b4c)[_0x4d81('0x17')]();};}function respondWithResult(_0x3ca9e0,_0x3f9592){_0x3f9592=_0x3f9592||0xc8;return function(_0x585940){if(_0x585940){return _0x3ca9e0[_0x4d81('0x16')](_0x3f9592)[_0x4d81('0x18')](_0x585940);}};}function respondWithFilteredResult(_0x2af8bf,_0x28e724){return function(_0x186ab8){if(_0x186ab8){var _0x17b78f=typeof _0x28e724[_0x4d81('0x19')]===_0x4d81('0x1a')&&typeof _0x28e724[_0x4d81('0x1b')]==='undefined';var _0xbefdda=_0x186ab8[_0x4d81('0x1c')];var _0x3a31db=_0x17b78f?0x0:_0x28e724[_0x4d81('0x19')];var _0x997b2a=_0x17b78f?_0x186ab8['count']:_0x28e724[_0x4d81('0x19')]+_0x28e724[_0x4d81('0x1b')];var _0x1ff612;if(_0x997b2a>=_0xbefdda){_0x997b2a=_0xbefdda;_0x1ff612=0xc8;}else{_0x1ff612=0xce;}_0x2af8bf['status'](_0x1ff612);return _0x2af8bf[_0x4d81('0x1d')](_0x4d81('0x1e'),_0x3a31db+'-'+_0x997b2a+'/'+_0xbefdda)[_0x4d81('0x18')](_0x186ab8);}return null;};}function patchUpdates(_0x1e2896){return function(_0x2ecc9d){try{jsonpatch['apply'](_0x2ecc9d,_0x1e2896,!![]);}catch(_0x5af453){return BPromise[_0x4d81('0x1f')](_0x5af453);}return _0x2ecc9d['save']();};}function saveUpdates(_0x5b4a4f,_0x4753f0){return function(_0x44b21c){if(_0x44b21c){return _0x44b21c['update'](_0x5b4a4f)['then'](function(_0x438cc1){return _0x438cc1;});}return null;};}function removeEntity(_0xa4d722,_0x3c23d3){return function(_0x187313){if(_0x187313){return _0x187313[_0x4d81('0x20')]()[_0x4d81('0x21')](function(){_0xa4d722[_0x4d81('0x16')](0xcc)[_0x4d81('0x17')]();});}};}function handleEntityNotFound(_0x374288,_0x178936){return function(_0x290c54){if(!_0x290c54){_0x374288[_0x4d81('0x22')](0x194);}return _0x290c54;};}function handleError(_0x49148b,_0xcbe1f8){_0xcbe1f8=_0xcbe1f8||0x1f4;return function(_0x56fbd8){logger['error'](_0x56fbd8['stack']);if(_0x56fbd8[_0x4d81('0x23')]){delete _0x56fbd8['name'];}_0x49148b['status'](_0xcbe1f8)[_0x4d81('0x24')](_0x56fbd8);};}exports[_0x4d81('0x25')]=function(_0xf17783,_0x53358a){var _0x3268ce={},_0x308b97={},_0x5742aa={'count':0x0,'rows':[]};var _0x3920a2=_[_0x4d81('0x26')](db[_0x4d81('0x27')][_0x4d81('0x28')],function(_0x642a){return{'name':_0x642a[_0x4d81('0x29')],'type':_0x642a[_0x4d81('0x2a')][_0x4d81('0x2b')]};});_0x308b97['model']=_[_0x4d81('0x26')](_0x3920a2,_0x4d81('0x23'));_0x308b97[_0x4d81('0x2c')]=_['keys'](_0xf17783[_0x4d81('0x2c')]);_0x308b97['filters']=_[_0x4d81('0x2d')](_0x308b97[_0x4d81('0x2e')],_0x308b97[_0x4d81('0x2c')]);_0x3268ce[_0x4d81('0x2f')]=_[_0x4d81('0x2d')](_0x308b97[_0x4d81('0x2e')],qs[_0x4d81('0x30')](_0xf17783[_0x4d81('0x2c')][_0x4d81('0x30')]));_0x3268ce[_0x4d81('0x2f')]=_0x3268ce[_0x4d81('0x2f')][_0x4d81('0x31')]?_0x3268ce[_0x4d81('0x2f')]:_0x308b97['model'];if(!_0xf17783['query'][_0x4d81('0x32')]('nolimit')){_0x3268ce[_0x4d81('0x1b')]=qs[_0x4d81('0x1b')](_0xf17783[_0x4d81('0x2c')][_0x4d81('0x1b')]);_0x3268ce[_0x4d81('0x19')]=qs[_0x4d81('0x19')](_0xf17783[_0x4d81('0x2c')][_0x4d81('0x19')]);}_0x3268ce['order']=qs[_0x4d81('0x33')](_0xf17783[_0x4d81('0x2c')]['sort']);_0x3268ce[_0x4d81('0x34')]=qs['filters'](_[_0x4d81('0x35')](_0xf17783['query'],_0x308b97['filters']),_0x3920a2);if(_0xf17783[_0x4d81('0x2c')][_0x4d81('0x36')]){_0x3268ce[_0x4d81('0x34')]=_[_0x4d81('0x37')](_0x3268ce['where'],{'$or':_[_0x4d81('0x26')](_0x3920a2,function(_0x20629c){if(_0x20629c[_0x4d81('0x2a')]!==_0x4d81('0x38')){var _0x66c425={};_0x66c425[_0x20629c[_0x4d81('0x23')]]={'$like':'%'+_0xf17783[_0x4d81('0x2c')]['filter']+'%'};return _0x66c425;}})});}_0x3268ce=_['merge']({},_0x3268ce,_0xf17783[_0x4d81('0x39')]);var _0x49d7e5={'where':_0x3268ce[_0x4d81('0x34')]};return db[_0x4d81('0x27')]['count'](_0x49d7e5)['then'](function(_0x11e8f5){_0x5742aa[_0x4d81('0x1c')]=_0x11e8f5;if(_0xf17783[_0x4d81('0x2c')][_0x4d81('0x3a')]){_0x3268ce[_0x4d81('0x3b')]=[{'all':!![]}];}return db['SugarcrmField'][_0x4d81('0x3c')](_0x3268ce);})[_0x4d81('0x21')](function(_0x4605f5){_0x5742aa['rows']=_0x4605f5;return _0x5742aa;})[_0x4d81('0x21')](respondWithFilteredResult(_0x53358a,_0x3268ce))[_0x4d81('0x3d')](handleError(_0x53358a,null));};exports['show']=function(_0x5659f9,_0x2ce380){var _0x406166={'raw':!![],'where':{'id':_0x5659f9[_0x4d81('0x3e')]['id']}},_0x51beaf={};_0x51beaf[_0x4d81('0x2e')]=_['keys'](db['SugarcrmField'][_0x4d81('0x28')]);_0x51beaf[_0x4d81('0x2c')]=_[_0x4d81('0x3f')](_0x5659f9['query']);_0x51beaf['filters']=_['intersection'](_0x51beaf[_0x4d81('0x2e')],_0x51beaf['query']);_0x406166[_0x4d81('0x2f')]=_[_0x4d81('0x2d')](_0x51beaf[_0x4d81('0x2e')],qs[_0x4d81('0x30')](_0x5659f9[_0x4d81('0x2c')]['fields']));_0x406166['attributes']=_0x406166[_0x4d81('0x2f')][_0x4d81('0x31')]?_0x406166['attributes']:_0x51beaf['model'];if(_0x5659f9[_0x4d81('0x2c')]['includeAll']){_0x406166['include']=[{'all':!![]}];}_0x406166=_[_0x4d81('0x37')]({},_0x406166,_0x5659f9[_0x4d81('0x39')]);return db[_0x4d81('0x27')][_0x4d81('0x40')](_0x406166)[_0x4d81('0x21')](handleEntityNotFound(_0x2ce380,null))[_0x4d81('0x21')](respondWithResult(_0x2ce380,null))[_0x4d81('0x3d')](handleError(_0x2ce380,null));};exports[_0x4d81('0x41')]=function(_0x15d916,_0x3dd173){return db[_0x4d81('0x27')]['create'](_0x15d916[_0x4d81('0x42')],{})['then'](respondWithResult(_0x3dd173,0xc9))[_0x4d81('0x3d')](handleError(_0x3dd173,null));};exports[_0x4d81('0x43')]=function(_0x369116,_0x3ced60){if(_0x369116[_0x4d81('0x42')]['id']){delete _0x369116[_0x4d81('0x42')]['id'];}return db[_0x4d81('0x27')][_0x4d81('0x40')]({'where':{'id':_0x369116[_0x4d81('0x3e')]['id']}})[_0x4d81('0x21')](handleEntityNotFound(_0x3ced60,null))[_0x4d81('0x21')](saveUpdates(_0x369116[_0x4d81('0x42')],null))[_0x4d81('0x21')](respondWithResult(_0x3ced60,null))[_0x4d81('0x3d')](handleError(_0x3ced60,null));};exports[_0x4d81('0x20')]=function(_0x5ec0c3,_0x5e1ac5){return db[_0x4d81('0x27')]['find']({'where':{'id':_0x5ec0c3[_0x4d81('0x3e')]['id']}})[_0x4d81('0x21')](handleEntityNotFound(_0x5e1ac5,null))[_0x4d81('0x21')](removeEntity(_0x5e1ac5,null))[_0x4d81('0x3d')](handleError(_0x5e1ac5,null));}; \ No newline at end of file +var _0x1b2b=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','error','name','index','map','key','query','keys','intersection','model','fields','length','attributes','hasOwnProperty','limit','order','filters','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','SugarcrmField','findAll','rows','catch','params','rawAttributes','find','create','body','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x5406d8,_0x1a248e){var _0x16c734=function(_0x384d74){while(--_0x384d74){_0x5406d8['push'](_0x5406d8['shift']());}};_0x16c734(++_0x1a248e);}(_0x1b2b,0x7d));var _0xb1b2=function(_0x2ff127,_0x3d6e2b){_0x2ff127=_0x2ff127-0x0;var _0x53af48=_0x1b2b[_0x2ff127];return _0x53af48;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb1b2('0x0'));var moment=require(_0xb1b2('0x1'));var BPromise=require(_0xb1b2('0x2'));var Mustache=require(_0xb1b2('0x3'));var util=require(_0xb1b2('0x4'));var path=require(_0xb1b2('0x5'));var sox=require(_0xb1b2('0x6'));var csv=require(_0xb1b2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1b2('0x8'));var _=require('lodash');var squel=require(_0xb1b2('0x9'));var crypto=require('crypto');var jsforce=require(_0xb1b2('0xa'));var deskjs=require(_0xb1b2('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb1b2('0xc'));var Papa=require(_0xb1b2('0xd'));var Redis=require(_0xb1b2('0xe'));var authService=require(_0xb1b2('0xf'));var qs=require(_0xb1b2('0x10'));var as=require(_0xb1b2('0x11'));var hardwareService=require(_0xb1b2('0x12'));var logger=require(_0xb1b2('0x13'))(_0xb1b2('0x14'));var utils=require(_0xb1b2('0x15'));var config=require(_0xb1b2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1b2('0x17'))['db'];function respondWithStatusCode(_0xdf9e95,_0x756b7e){_0x756b7e=_0x756b7e||0xcc;return function(_0x4e9b41){if(_0x4e9b41){return _0xdf9e95[_0xb1b2('0x18')](_0x756b7e);}return _0xdf9e95[_0xb1b2('0x19')](_0x756b7e)[_0xb1b2('0x1a')]();};}function respondWithResult(_0x256917,_0xaa8a08){_0xaa8a08=_0xaa8a08||0xc8;return function(_0x5e3c99){if(_0x5e3c99){return _0x256917['status'](_0xaa8a08)[_0xb1b2('0x1b')](_0x5e3c99);}};}function respondWithFilteredResult(_0xa5dd93,_0x540586){return function(_0x290ea8){if(_0x290ea8){var _0x29cd63=typeof _0x540586[_0xb1b2('0x1c')]===_0xb1b2('0x1d')&&typeof _0x540586['limit']===_0xb1b2('0x1d');var _0x4f3301=_0x290ea8[_0xb1b2('0x1e')];var _0x3c8658=_0x29cd63?0x0:_0x540586[_0xb1b2('0x1c')];var _0x1ee02b=_0x29cd63?_0x290ea8[_0xb1b2('0x1e')]:_0x540586[_0xb1b2('0x1c')]+_0x540586['limit'];var _0x269e4a;if(_0x1ee02b>=_0x4f3301){_0x1ee02b=_0x4f3301;_0x269e4a=0xc8;}else{_0x269e4a=0xce;}_0xa5dd93[_0xb1b2('0x19')](_0x269e4a);return _0xa5dd93[_0xb1b2('0x1f')](_0xb1b2('0x20'),_0x3c8658+'-'+_0x1ee02b+'/'+_0x4f3301)[_0xb1b2('0x1b')](_0x290ea8);}return null;};}function patchUpdates(_0x211e8a){return function(_0x3eb9f3){try{jsonpatch['apply'](_0x3eb9f3,_0x211e8a,!![]);}catch(_0x3c9a3c){return BPromise[_0xb1b2('0x21')](_0x3c9a3c);}return _0x3eb9f3[_0xb1b2('0x22')]();};}function saveUpdates(_0x31d5a1,_0x98c87c){return function(_0x43e3ac){if(_0x43e3ac){return _0x43e3ac['update'](_0x31d5a1)[_0xb1b2('0x23')](function(_0x5afece){return _0x5afece;});}return null;};}function removeEntity(_0x3effe7,_0x66a503){return function(_0xfe8c64){if(_0xfe8c64){return _0xfe8c64[_0xb1b2('0x24')]()[_0xb1b2('0x23')](function(){_0x3effe7['status'](0xcc)[_0xb1b2('0x1a')]();});}};}function handleEntityNotFound(_0xafd4a8,_0x31fe0e){return function(_0x13f397){if(!_0x13f397){_0xafd4a8[_0xb1b2('0x18')](0x194);}return _0x13f397;};}function handleError(_0x54fe54,_0x3caf4e){_0x3caf4e=_0x3caf4e||0x1f4;return function(_0x1b4ead){logger[_0xb1b2('0x25')](_0x1b4ead['stack']);if(_0x1b4ead[_0xb1b2('0x26')]){delete _0x1b4ead[_0xb1b2('0x26')];}_0x54fe54[_0xb1b2('0x19')](_0x3caf4e)['send'](_0x1b4ead);};}exports[_0xb1b2('0x27')]=function(_0x4efa6a,_0x3ac468){var _0x501c17={},_0x100466={},_0x1705fe={'count':0x0,'rows':[]};var _0x65dacb=_[_0xb1b2('0x28')](db['SugarcrmField']['rawAttributes'],function(_0x5d23d2){return{'name':_0x5d23d2['fieldName'],'type':_0x5d23d2['type'][_0xb1b2('0x29')]};});_0x100466['model']=_[_0xb1b2('0x28')](_0x65dacb,'name');_0x100466[_0xb1b2('0x2a')]=_[_0xb1b2('0x2b')](_0x4efa6a[_0xb1b2('0x2a')]);_0x100466['filters']=_[_0xb1b2('0x2c')](_0x100466[_0xb1b2('0x2d')],_0x100466[_0xb1b2('0x2a')]);_0x501c17['attributes']=_[_0xb1b2('0x2c')](_0x100466[_0xb1b2('0x2d')],qs[_0xb1b2('0x2e')](_0x4efa6a[_0xb1b2('0x2a')][_0xb1b2('0x2e')]));_0x501c17['attributes']=_0x501c17['attributes'][_0xb1b2('0x2f')]?_0x501c17[_0xb1b2('0x30')]:_0x100466['model'];if(!_0x4efa6a[_0xb1b2('0x2a')][_0xb1b2('0x31')]('nolimit')){_0x501c17[_0xb1b2('0x32')]=qs[_0xb1b2('0x32')](_0x4efa6a[_0xb1b2('0x2a')]['limit']);_0x501c17[_0xb1b2('0x1c')]=qs[_0xb1b2('0x1c')](_0x4efa6a[_0xb1b2('0x2a')][_0xb1b2('0x1c')]);}_0x501c17[_0xb1b2('0x33')]=qs['sort'](_0x4efa6a[_0xb1b2('0x2a')]['sort']);_0x501c17['where']=qs[_0xb1b2('0x34')](_[_0xb1b2('0x35')](_0x4efa6a['query'],_0x100466[_0xb1b2('0x34')]),_0x65dacb);if(_0x4efa6a['query']['filter']){_0x501c17['where']=_[_0xb1b2('0x36')](_0x501c17[_0xb1b2('0x37')],{'$or':_[_0xb1b2('0x28')](_0x65dacb,function(_0xae4c54){if(_0xae4c54[_0xb1b2('0x38')]!==_0xb1b2('0x39')){var _0x24d9ea={};_0x24d9ea[_0xae4c54['name']]={'$like':'%'+_0x4efa6a[_0xb1b2('0x2a')][_0xb1b2('0x3a')]+'%'};return _0x24d9ea;}})});}_0x501c17=_[_0xb1b2('0x36')]({},_0x501c17,_0x4efa6a[_0xb1b2('0x3b')]);var _0x212c94={'where':_0x501c17[_0xb1b2('0x37')]};return db['SugarcrmField'][_0xb1b2('0x1e')](_0x212c94)[_0xb1b2('0x23')](function(_0xbc58cd){_0x1705fe[_0xb1b2('0x1e')]=_0xbc58cd;if(_0x4efa6a[_0xb1b2('0x2a')][_0xb1b2('0x3c')]){_0x501c17[_0xb1b2('0x3d')]=[{'all':!![]}];}return db[_0xb1b2('0x3e')][_0xb1b2('0x3f')](_0x501c17);})[_0xb1b2('0x23')](function(_0x2762f6){_0x1705fe[_0xb1b2('0x40')]=_0x2762f6;return _0x1705fe;})[_0xb1b2('0x23')](respondWithFilteredResult(_0x3ac468,_0x501c17))[_0xb1b2('0x41')](handleError(_0x3ac468,null));};exports['show']=function(_0x23f542,_0x17e146){var _0x5c4c65={'raw':!![],'where':{'id':_0x23f542[_0xb1b2('0x42')]['id']}},_0x330c1b={};_0x330c1b[_0xb1b2('0x2d')]=_[_0xb1b2('0x2b')](db[_0xb1b2('0x3e')][_0xb1b2('0x43')]);_0x330c1b[_0xb1b2('0x2a')]=_[_0xb1b2('0x2b')](_0x23f542['query']);_0x330c1b['filters']=_['intersection'](_0x330c1b[_0xb1b2('0x2d')],_0x330c1b[_0xb1b2('0x2a')]);_0x5c4c65['attributes']=_[_0xb1b2('0x2c')](_0x330c1b['model'],qs[_0xb1b2('0x2e')](_0x23f542[_0xb1b2('0x2a')][_0xb1b2('0x2e')]));_0x5c4c65[_0xb1b2('0x30')]=_0x5c4c65['attributes'][_0xb1b2('0x2f')]?_0x5c4c65['attributes']:_0x330c1b['model'];if(_0x23f542[_0xb1b2('0x2a')][_0xb1b2('0x3c')]){_0x5c4c65[_0xb1b2('0x3d')]=[{'all':!![]}];}_0x5c4c65=_[_0xb1b2('0x36')]({},_0x5c4c65,_0x23f542[_0xb1b2('0x3b')]);return db[_0xb1b2('0x3e')][_0xb1b2('0x44')](_0x5c4c65)[_0xb1b2('0x23')](handleEntityNotFound(_0x17e146,null))[_0xb1b2('0x23')](respondWithResult(_0x17e146,null))[_0xb1b2('0x41')](handleError(_0x17e146,null));};exports['create']=function(_0x5b7d69,_0x39ef2b){return db[_0xb1b2('0x3e')][_0xb1b2('0x45')](_0x5b7d69[_0xb1b2('0x46')],{})['then'](respondWithResult(_0x39ef2b,0xc9))['catch'](handleError(_0x39ef2b,null));};exports['update']=function(_0x1539d0,_0x5b957c){if(_0x1539d0[_0xb1b2('0x46')]['id']){delete _0x1539d0['body']['id'];}return db['SugarcrmField'][_0xb1b2('0x44')]({'where':{'id':_0x1539d0[_0xb1b2('0x42')]['id']}})[_0xb1b2('0x23')](handleEntityNotFound(_0x5b957c,null))['then'](saveUpdates(_0x1539d0[_0xb1b2('0x46')],null))[_0xb1b2('0x23')](respondWithResult(_0x5b957c,null))['catch'](handleError(_0x5b957c,null));};exports['destroy']=function(_0x5b46dc,_0x370e74){return db[_0xb1b2('0x3e')][_0xb1b2('0x44')]({'where':{'id':_0x5b46dc['params']['id']}})[_0xb1b2('0x23')](handleEntityNotFound(_0x370e74,null))[_0xb1b2('0x23')](removeEntity(_0x370e74,null))[_0xb1b2('0x41')](handleError(_0x370e74,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d3cee82..59fb71f 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 _0x97d9=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x3e38fb,_0x4b3e08){var _0x6e1814=function(_0x133ea7){while(--_0x133ea7){_0x3e38fb['push'](_0x3e38fb['shift']());}};_0x6e1814(++_0x4b3e08);}(_0x97d9,0xbf));var _0x997d=function(_0xf1fb5b,_0x37714c){_0xf1fb5b=_0xf1fb5b-0x0;var _0x5993d0=_0x97d9[_0xf1fb5b];return _0x5993d0;};'use strict';var _=require(_0x997d('0x0'));var util=require(_0x997d('0x1'));var logger=require(_0x997d('0x2'))(_0x997d('0x3'));var moment=require('moment');var BPromise=require(_0x997d('0x4'));var rp=require(_0x997d('0x5'));var fs=require('fs');var path=require(_0x997d('0x6'));var rimraf=require(_0x997d('0x7'));var config=require(_0x997d('0x8'));var attributes=require(_0x997d('0x9'));module['exports']=function(_0xdc1348,_0x39ef2c){return _0xdc1348[_0x997d('0xa')]('SugarcrmField',attributes,{'tableName':_0x997d('0xb'),'paranoid':![],'indexes':[{'name':_0x997d('0xc'),'fields':[_0x997d('0xd'),_0x997d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc666=['sugarcrm_unique_index','idField','lodash','util','api','moment','path','rimraf','../../config/environment','exports','SugarcrmField'];(function(_0x534041,_0x62d440){var _0x3f382b=function(_0x1f032b){while(--_0x1f032b){_0x534041['push'](_0x534041['shift']());}};_0x3f382b(++_0x62d440);}(_0xc666,0x115));var _0x6c66=function(_0x23fea8,_0x2af7be){_0x23fea8=_0x23fea8-0x0;var _0x197809=_0xc666[_0x23fea8];return _0x197809;};'use strict';var _=require(_0x6c66('0x0'));var util=require(_0x6c66('0x1'));var logger=require('../../config/logger')(_0x6c66('0x2'));var moment=require(_0x6c66('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c66('0x4'));var rimraf=require(_0x6c66('0x5'));var config=require(_0x6c66('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x6c66('0x7')]=function(_0x4fe3e8,_0x23b907){return _0x4fe3e8['define'](_0x6c66('0x8'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x6c66('0x9'),'fields':[_0x6c66('0xa'),'FieldId'],'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 735f11b..fc64ac1 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 _0xa9fe=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','message','result','lodash'];(function(_0x5ea7b9,_0x15c806){var _0x51378a=function(_0x13fd30){while(--_0x13fd30){_0x5ea7b9['push'](_0x5ea7b9['shift']());}};_0x51378a(++_0x15c806);}(_0xa9fe,0x149));var _0xea9f=function(_0x30b942,_0x78959e){_0x30b942=_0x30b942-0x0;var _0x4f86f2=_0xa9fe[_0x30b942];return _0x4f86f2;};'use strict';var _=require(_0xea9f('0x0'));var util=require('util');var moment=require(_0xea9f('0x1'));var BPromise=require(_0xea9f('0x2'));var rs=require(_0xea9f('0x3'));var fs=require('fs');var Redis=require(_0xea9f('0x4'));var db=require(_0xea9f('0x5'))['db'];var utils=require(_0xea9f('0x6'));var logger=require(_0xea9f('0x7'))(_0xea9f('0x8'));var config=require(_0xea9f('0x9'));var jayson=require(_0xea9f('0xa'));var client=jayson[_0xea9f('0xb')][_0xea9f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13f259,_0x1870c4,_0x1dfb51){return new BPromise(function(_0x319928,_0x2b1a41){return client[_0xea9f('0xd')](_0x13f259,_0x1dfb51)[_0xea9f('0xe')](function(_0x1b981e){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1870c4,_0xea9f('0xf'));logger[_0xea9f('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1870c4,_0xea9f('0xf'),JSON[_0xea9f('0x11')](_0x1b981e));if(_0x1b981e['error']){if(_0x1b981e[_0xea9f('0x12')][_0xea9f('0x13')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x1870c4,_0x1b981e[_0xea9f('0x12')][_0xea9f('0x14')]);return _0x2b1a41(_0x1b981e[_0xea9f('0x12')][_0xea9f('0x14')]);}logger[_0xea9f('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x1870c4,_0x1b981e[_0xea9f('0x12')]['message']);return _0x319928(_0x1b981e[_0xea9f('0x12')][_0xea9f('0x14')]);}else{logger['info']('SugarcrmField,\x20%s,\x20%s',_0x1870c4,_0xea9f('0xf'));_0x319928(_0x1b981e[_0xea9f('0x15')][_0xea9f('0x14')]);}})['catch'](function(_0x48f847){logger[_0xea9f('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x1870c4,_0x48f847);_0x2b1a41(_0x48f847);});});} \ No newline at end of file +var _0x4c13=['SugarcrmField,\x20%s,\x20%s','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0xadbe2b,_0x4971e5){var _0x4216ba=function(_0x421174){while(--_0x421174){_0xadbe2b['push'](_0xadbe2b['shift']());}};_0x4216ba(++_0x4971e5);}(_0x4c13,0xfb));var _0x34c1=function(_0x92a933,_0x154235){_0x92a933=_0x92a933-0x0;var _0xaf79c5=_0x4c13[_0x92a933];return _0xaf79c5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x34c1('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34c1('0x1'));var db=require(_0x34c1('0x2'))['db'];var utils=require(_0x34c1('0x3'));var logger=require(_0x34c1('0x4'))('rpc');var config=require(_0x34c1('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x34c1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c21b1,_0x5e7a05,_0x3a27e1){return new BPromise(function(_0x5a64e9,_0x3705d0){return client[_0x34c1('0x7')](_0x1c21b1,_0x3a27e1)[_0x34c1('0x8')](function(_0x170f4b){logger[_0x34c1('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x5e7a05,_0x34c1('0xa'));logger[_0x34c1('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x5e7a05,_0x34c1('0xa'),JSON[_0x34c1('0xc')](_0x170f4b));if(_0x170f4b[_0x34c1('0xd')]){if(_0x170f4b[_0x34c1('0xd')][_0x34c1('0xe')]===0x1f4){logger[_0x34c1('0xd')](_0x34c1('0xf'),_0x5e7a05,_0x170f4b[_0x34c1('0xd')][_0x34c1('0x10')]);return _0x3705d0(_0x170f4b['error'][_0x34c1('0x10')]);}logger[_0x34c1('0xd')](_0x34c1('0xf'),_0x5e7a05,_0x170f4b[_0x34c1('0xd')][_0x34c1('0x10')]);return _0x5a64e9(_0x170f4b[_0x34c1('0xd')][_0x34c1('0x10')]);}else{logger[_0x34c1('0x9')](_0x34c1('0xf'),_0x5e7a05,_0x34c1('0xa'));_0x5a64e9(_0x170f4b[_0x34c1('0x11')][_0x34c1('0x10')]);}})[_0x34c1('0x12')](function(_0x456611){logger[_0x34c1('0xd')](_0x34c1('0xf'),_0x5e7a05,_0x456611);_0x3705d0(_0x456611);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d09904f..c95dc5b 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 _0x5243=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','delete','destroy','exports','multer'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x5243,0x71));var _0x3524=function(_0x4056a5,_0x4ad851){_0x4056a5=_0x4056a5-0x0;var _0x260e54=_0x5243[_0x4056a5];return _0x260e54;};'use strict';var multer=require(_0x3524('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3524('0x1'));var express=require(_0x3524('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3524('0x3'));var interaction=require(_0x3524('0x4'));var config=require('../../config/environment');var controller=require(_0x3524('0x5'));router['get']('/',auth[_0x3524('0x6')](),controller['index']);router[_0x3524('0x7')](_0x3524('0x8'),auth[_0x3524('0x6')](),controller[_0x3524('0x9')]);router[_0x3524('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3524('0xa')]);router[_0x3524('0x7')](_0x3524('0xb'),auth[_0x3524('0x6')](),controller[_0x3524('0xc')]);router['post']('/',auth[_0x3524('0x6')](),controller[_0x3524('0xd')]);router['post'](_0x3524('0xe'),auth[_0x3524('0x6')](),controller[_0x3524('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3524('0x10')](_0x3524('0x8'),auth['isAuthenticated'](),controller[_0x3524('0x11')]);module[_0x3524('0x12')]=router; \ No newline at end of file +var _0xc01b=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','put','destroy'];(function(_0x5ed082,_0x12c0ef){var _0x1423a9=function(_0x39c976){while(--_0x39c976){_0x5ed082['push'](_0x5ed082['shift']());}};_0x1423a9(++_0x12c0ef);}(_0xc01b,0x74));var _0xbc01=function(_0x4645ca,_0xbf713b){_0x4645ca=_0x4645ca-0x0;var _0x54c855=_0xc01b[_0x4645ca];return _0x54c855;};'use strict';var multer=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var path=require(_0xbc01('0x2'));var timeout=require(_0xbc01('0x3'));var express=require(_0xbc01('0x4'));var router=express[_0xbc01('0x5')]();var fs_extra=require(_0xbc01('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbc01('0x7'));var config=require(_0xbc01('0x8'));var controller=require(_0xbc01('0x9'));router[_0xbc01('0xa')]('/',auth[_0xbc01('0xb')](),controller[_0xbc01('0xc')]);router[_0xbc01('0xa')](_0xbc01('0xd'),auth[_0xbc01('0xb')](),controller[_0xbc01('0xe')]);router[_0xbc01('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xbc01('0xf')]);router[_0xbc01('0xa')](_0xbc01('0x10'),auth[_0xbc01('0xb')](),controller[_0xbc01('0x11')]);router[_0xbc01('0x12')]('/',auth[_0xbc01('0xb')](),controller['create']);router[_0xbc01('0x12')](_0xbc01('0x13'),auth[_0xbc01('0xb')](),controller['addConfiguration']);router[_0xbc01('0x14')](_0xbc01('0xd'),auth[_0xbc01('0xb')](),controller['update']);router['delete']('/:id',auth[_0xbc01('0xb')](),controller[_0xbc01('0x15')]);module[_0xbc01('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 70d992a..27add6e 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 _0xa264=['STRING','HelpDesk','sequelize','exports'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0xa264,0x1a2));var _0x4a26=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0xa264[_0x324012];return _0x435cf2;};'use strict';var Sequelize=require(_0x4a26('0x0'));module[_0x4a26('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4a26('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4a26('0x3')},'remoteUri':{'type':Sequelize[_0x4a26('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x4a26('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x4a26('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x33ba=['sequelize','STRING'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0x33ba,0x76));var _0xa33b=function(_0x3f6289,_0x2d099b){_0x3f6289=_0x3f6289-0x0;var _0x41ca3c=_0x33ba[_0x3f6289];return _0x41ca3c;};'use strict';var Sequelize=require(_0xa33b('0x0'));module['exports']={'name':{'type':Sequelize[_0xa33b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa33b('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xa33b('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xa33b('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 63fc37e..14c329c 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 _0x193f=['serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../components/integrations/configuration','status','end','undefined','count','offset','limit','Content-Range','apply','save','update','sendStatus','stack','name','send','index','map','VtigerAccount','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','nolimit','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','include','find','then','create','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','order','pick','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','getFields','username','moduleName','remoteUri'];(function(_0x5d1e7e,_0x49753e){var _0x23fae9=function(_0x3f8a3f){while(--_0x3f8a3f){_0x5d1e7e['push'](_0x5d1e7e['shift']());}};_0x23fae9(++_0x49753e);}(_0x193f,0x99));var _0xf193=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0x193f[_0x285800];return _0x4b809e;};'use strict';var emlformat=require(_0xf193('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf193('0x1'));var jsonpatch=require(_0xf193('0x2'));var rp=require(_0xf193('0x3'));var moment=require('moment');var BPromise=require(_0xf193('0x4'));var Mustache=require('mustache');var util=require(_0xf193('0x5'));var path=require(_0xf193('0x6'));var sox=require('sox');var csv=require(_0xf193('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf193('0x8'));var squel=require(_0xf193('0x9'));var crypto=require(_0xf193('0xa'));var jsforce=require(_0xf193('0xb'));var deskjs=require(_0xf193('0xc'));var toCsv=require(_0xf193('0x7'));var querystring=require(_0xf193('0xd'));var Papa=require('papaparse');var Redis=require(_0xf193('0xe'));var authService=require(_0xf193('0xf'));var qs=require(_0xf193('0x10'));var as=require(_0xf193('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf193('0x12'));var utils=require('../../config/utils');var config=require(_0xf193('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf193('0x14'));function respondWithStatusCode(_0x1738ad,_0x242d71){_0x242d71=_0x242d71||0xcc;return function(_0x4d6dfc){if(_0x4d6dfc){return _0x1738ad['sendStatus'](_0x242d71);}return _0x1738ad[_0xf193('0x15')](_0x242d71)[_0xf193('0x16')]();};}function respondWithResult(_0x45049c,_0x18e5ef){_0x18e5ef=_0x18e5ef||0xc8;return function(_0x46f3a4){if(_0x46f3a4){return _0x45049c[_0xf193('0x15')](_0x18e5ef)['json'](_0x46f3a4);}};}function respondWithFilteredResult(_0x2013ef,_0x455855){return function(_0x1572f7){if(_0x1572f7){var _0x1abcb6=typeof _0x455855['offset']===_0xf193('0x17')&&typeof _0x455855['limit']===_0xf193('0x17');var _0x3c7ee3=_0x1572f7[_0xf193('0x18')];var _0x9f72f3=_0x1abcb6?0x0:_0x455855[_0xf193('0x19')];var _0x462766=_0x1abcb6?_0x1572f7[_0xf193('0x18')]:_0x455855[_0xf193('0x19')]+_0x455855[_0xf193('0x1a')];var _0x703efa;if(_0x462766>=_0x3c7ee3){_0x462766=_0x3c7ee3;_0x703efa=0xc8;}else{_0x703efa=0xce;}_0x2013ef[_0xf193('0x15')](_0x703efa);return _0x2013ef['set'](_0xf193('0x1b'),_0x9f72f3+'-'+_0x462766+'/'+_0x3c7ee3)['json'](_0x1572f7);}return null;};}function patchUpdates(_0x58dbb6){return function(_0xb51428){try{jsonpatch[_0xf193('0x1c')](_0xb51428,_0x58dbb6,!![]);}catch(_0x3b21b1){return BPromise['reject'](_0x3b21b1);}return _0xb51428[_0xf193('0x1d')]();};}function saveUpdates(_0x29f1cd,_0x91db8c){return function(_0x48337f){if(_0x48337f){return _0x48337f[_0xf193('0x1e')](_0x29f1cd)['then'](function(_0x52afd4){return _0x52afd4;});}return null;};}function removeEntity(_0x510b2b,_0x25d6f3){return function(_0x2415ca){if(_0x2415ca){return _0x2415ca['destroy']()['then'](function(){_0x510b2b['status'](0xcc)[_0xf193('0x16')]();});}};}function handleEntityNotFound(_0x460f6b,_0x24af18){return function(_0xba3b07){if(!_0xba3b07){_0x460f6b[_0xf193('0x1f')](0x194);}return _0xba3b07;};}function handleError(_0x2edd9e,_0x39bb16){_0x39bb16=_0x39bb16||0x1f4;return function(_0xf58ffd){logger['error'](_0xf58ffd[_0xf193('0x20')]);if(_0xf58ffd[_0xf193('0x21')]){delete _0xf58ffd['name'];}_0x2edd9e[_0xf193('0x15')](_0x39bb16)[_0xf193('0x22')](_0xf58ffd);};}exports[_0xf193('0x23')]=function(_0x1b2833,_0x3f57de){var _0x43ac4b={},_0x202d68={},_0x15afce={'count':0x0,'rows':[]};var _0x55ef4f=_[_0xf193('0x24')](db[_0xf193('0x25')]['rawAttributes'],function(_0x33ecaf){return{'name':_0x33ecaf[_0xf193('0x26')],'type':_0x33ecaf[_0xf193('0x27')]['key']};});_0x202d68['model']=_[_0xf193('0x24')](_0x55ef4f,_0xf193('0x21'));_0x202d68['query']=_[_0xf193('0x28')](_0x1b2833[_0xf193('0x29')]);_0x202d68[_0xf193('0x2a')]=_[_0xf193('0x2b')](_0x202d68['model'],_0x202d68[_0xf193('0x29')]);_0x43ac4b[_0xf193('0x2c')]=_['intersection'](_0x202d68[_0xf193('0x2d')],qs[_0xf193('0x2e')](_0x1b2833[_0xf193('0x29')][_0xf193('0x2e')]));_0x43ac4b[_0xf193('0x2c')]=_0x43ac4b[_0xf193('0x2c')][_0xf193('0x2f')]?_0x43ac4b[_0xf193('0x2c')]:_0x202d68[_0xf193('0x2d')];if(!_0x1b2833[_0xf193('0x29')]['hasOwnProperty'](_0xf193('0x30'))){_0x43ac4b[_0xf193('0x1a')]=qs[_0xf193('0x1a')](_0x1b2833[_0xf193('0x29')][_0xf193('0x1a')]);_0x43ac4b[_0xf193('0x19')]=qs['offset'](_0x1b2833[_0xf193('0x29')][_0xf193('0x19')]);}_0x43ac4b['order']=qs[_0xf193('0x31')](_0x1b2833[_0xf193('0x29')]['sort']);_0x43ac4b[_0xf193('0x32')]=qs[_0xf193('0x2a')](_['pick'](_0x1b2833[_0xf193('0x29')],_0x202d68[_0xf193('0x2a')]),_0x55ef4f);if(_0x1b2833['query']['filter']){_0x43ac4b[_0xf193('0x32')]=_[_0xf193('0x33')](_0x43ac4b[_0xf193('0x32')],{'$or':_[_0xf193('0x24')](_0x55ef4f,function(_0x3451da){if(_0x3451da[_0xf193('0x27')]!==_0xf193('0x34')){var _0x4f6018={};_0x4f6018[_0x3451da['name']]={'$like':'%'+_0x1b2833[_0xf193('0x29')]['filter']+'%'};return _0x4f6018;}})});}_0x43ac4b=_[_0xf193('0x33')]({},_0x43ac4b,_0x1b2833[_0xf193('0x35')]);var _0x54698f={'where':_0x43ac4b['where']};return db[_0xf193('0x25')][_0xf193('0x18')](_0x54698f)['then'](function(_0x323184){_0x15afce[_0xf193('0x18')]=_0x323184;if(_0x1b2833[_0xf193('0x29')][_0xf193('0x36')]){_0x43ac4b['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xf193('0x37')](_0x43ac4b);})['then'](function(_0x542f38){_0x15afce[_0xf193('0x38')]=_0x542f38;return _0x15afce;})['then'](respondWithFilteredResult(_0x3f57de,_0x43ac4b))[_0xf193('0x39')](handleError(_0x3f57de,null));};exports['show']=function(_0x5cddce,_0x496e9b){var _0xeeaabd={'raw':![],'where':{'id':_0x5cddce['params']['id']}},_0x5a9f32={};_0x5a9f32[_0xf193('0x2d')]=_['keys'](db[_0xf193('0x25')][_0xf193('0x3a')]);_0x5a9f32['query']=_[_0xf193('0x28')](_0x5cddce[_0xf193('0x29')]);_0x5a9f32[_0xf193('0x2a')]=_[_0xf193('0x2b')](_0x5a9f32[_0xf193('0x2d')],_0x5a9f32[_0xf193('0x29')]);_0xeeaabd['attributes']=_[_0xf193('0x2b')](_0x5a9f32['model'],qs[_0xf193('0x2e')](_0x5cddce[_0xf193('0x29')][_0xf193('0x2e')]));_0xeeaabd['attributes']=_0xeeaabd[_0xf193('0x2c')]['length']?_0xeeaabd[_0xf193('0x2c')]:_0x5a9f32[_0xf193('0x2d')];if(_0x5cddce[_0xf193('0x29')][_0xf193('0x36')]){_0xeeaabd[_0xf193('0x3b')]=[{'all':!![]}];}_0xeeaabd=_[_0xf193('0x33')]({},_0xeeaabd,_0x5cddce[_0xf193('0x35')]);return db[_0xf193('0x25')][_0xf193('0x3c')](_0xeeaabd)[_0xf193('0x3d')](handleEntityNotFound(_0x496e9b,null))[_0xf193('0x3d')](respondWithResult(_0x496e9b,null))['catch'](handleError(_0x496e9b,null));};exports[_0xf193('0x3e')]=function(_0x47b08b,_0x263d94){return db[_0xf193('0x25')][_0xf193('0x3e')](_0x47b08b['body'],{})['then'](respondWithResult(_0x263d94,0xc9))[_0xf193('0x39')](handleError(_0x263d94,null));};exports[_0xf193('0x1e')]=function(_0x553d45,_0x53dab9){if(_0x553d45[_0xf193('0x3f')]['id']){delete _0x553d45['body']['id'];}return db['VtigerAccount'][_0xf193('0x3c')]({'where':{'id':_0x553d45[_0xf193('0x40')]['id']}})[_0xf193('0x3d')](handleEntityNotFound(_0x53dab9,null))[_0xf193('0x3d')](saveUpdates(_0x553d45[_0xf193('0x3f')],null))[_0xf193('0x3d')](respondWithResult(_0x53dab9,null))[_0xf193('0x39')](handleError(_0x53dab9,null));};exports[_0xf193('0x41')]=function(_0x4e96bb,_0x3ec5d5){return db[_0xf193('0x25')][_0xf193('0x3c')]({'where':{'id':_0x4e96bb[_0xf193('0x40')]['id']}})[_0xf193('0x3d')](handleEntityNotFound(_0x3ec5d5,null))[_0xf193('0x3d')](removeEntity(_0x3ec5d5,null))['catch'](handleError(_0x3ec5d5,null));};exports[_0xf193('0x42')]=function(_0x123fc9,_0x10bef9,_0x1fa342){var _0x4622dc={};var _0x29a9e7={};var _0x39192e;var _0x114b07;return db[_0xf193('0x25')][_0xf193('0x43')]({'where':{'id':_0x123fc9[_0xf193('0x40')]['id']}})[_0xf193('0x3d')](handleEntityNotFound(_0x10bef9,null))['then'](function(_0x45e6f4){if(_0x45e6f4){_0x39192e=_0x45e6f4;_0x29a9e7[_0xf193('0x2d')]=_[_0xf193('0x28')](db[_0xf193('0x44')][_0xf193('0x3a')]);_0x29a9e7['query']=_['keys'](_0x123fc9['query']);_0x29a9e7[_0xf193('0x2a')]=_['intersection'](_0x29a9e7['model'],_0x29a9e7[_0xf193('0x29')]);_0x4622dc['attributes']=_[_0xf193('0x2b')](_0x29a9e7[_0xf193('0x2d')],qs[_0xf193('0x2e')](_0x123fc9['query'][_0xf193('0x2e')]));_0x4622dc[_0xf193('0x2c')]=_0x4622dc[_0xf193('0x2c')][_0xf193('0x2f')]?_0x4622dc[_0xf193('0x2c')]:_0x29a9e7[_0xf193('0x2d')];_0x4622dc[_0xf193('0x45')]=qs['sort'](_0x123fc9[_0xf193('0x29')][_0xf193('0x31')]);_0x4622dc['where']=qs[_0xf193('0x2a')](_[_0xf193('0x46')](_0x123fc9['query'],_0x29a9e7[_0xf193('0x2a')]));if(_0x123fc9[_0xf193('0x29')][_0xf193('0x47')]){_0x4622dc['where']=_[_0xf193('0x33')](_0x4622dc['where'],{'$or':_[_0xf193('0x24')](_0x4622dc['attributes'],function(_0x213ab1){var _0x3f0e10={};_0x3f0e10[_0x213ab1]={'$like':'%'+_0x123fc9[_0xf193('0x29')][_0xf193('0x47')]+'%'};return _0x3f0e10;})});}_0x4622dc=_['merge']({},_0x4622dc,_0x123fc9[_0xf193('0x35')]);return _0x39192e[_0xf193('0x42')](_0x4622dc);}})['then'](function(_0x269854){if(_0x269854){_0x114b07=_0x269854[_0xf193('0x2f')];if(!_0x123fc9[_0xf193('0x29')][_0xf193('0x48')](_0xf193('0x30'))){_0x4622dc['limit']=qs[_0xf193('0x1a')](_0x123fc9['query'][_0xf193('0x1a')]);_0x4622dc[_0xf193('0x19')]=qs['offset'](_0x123fc9[_0xf193('0x29')][_0xf193('0x19')]);}return _0x39192e[_0xf193('0x42')](_0x4622dc);}})[_0xf193('0x3d')](function(_0x503cea){if(_0x503cea){return _0x503cea?{'count':_0x114b07,'rows':_0x503cea}:null;}})[_0xf193('0x3d')](respondWithResult(_0x10bef9,null))[_0xf193('0x39')](handleError(_0x10bef9,null));};exports[_0xf193('0x49')]=function(_0x452cfc,_0x443da1,_0x183eec){if(_0x452cfc[_0xf193('0x3f')]['id']){delete _0x452cfc[_0xf193('0x3f')]['id'];}return db[_0xf193('0x25')][_0xf193('0x43')]({'where':{'id':_0x452cfc[_0xf193('0x40')]['id']}})[_0xf193('0x3d')](handleEntityNotFound(_0x443da1,null))[_0xf193('0x3d')](function(_0x1b89cc){if(_0x1b89cc){_0x452cfc['body'][_0xf193('0x4a')]=_0x1b89cc['id'];_0x452cfc['body']['Subjects']=integrations[_0xf193('0x4b')](_0x452cfc['body'][_0xf193('0x4c')],_0x452cfc[_0xf193('0x3f')][_0xf193('0x27')]);_0x452cfc['body'][_0xf193('0x4d')]=integrations[_0xf193('0x4e')](_0x452cfc[_0xf193('0x3f')][_0xf193('0x4c')],_0x452cfc[_0xf193('0x3f')]['type']);return db['VtigerConfiguration'][_0xf193('0x3e')](_0x452cfc[_0xf193('0x3f')],{'include':[{'model':db[_0xf193('0x4f')],'as':_0xf193('0x50')},{'model':db[_0xf193('0x4f')],'as':'Descriptions'}]});}return null;})[_0xf193('0x3d')](respondWithResult(_0x443da1,null))[_0xf193('0x39')](handleError(_0x443da1,null));};var md5=require('md5');exports[_0xf193('0x51')]=function(_0x10ad1f,_0x56ac32,_0xb1b9ca){var _0x292663=null;var _0x5a3f8e=null;var _0xa386aa=null;var _0x3da08d=null;var _0x559b1f='';return db[_0xf193('0x25')][_0xf193('0x43')]({'where':{'id':_0x10ad1f[_0xf193('0x40')]['id']},'attributes':['id','name',_0xf193('0x52'),'description',_0xf193('0x53'),_0xf193('0x54'),_0xf193('0x55'),'accessKey']})[_0xf193('0x3d')](handleEntityNotFound(_0x56ac32,null))['then'](function(_0x55ce81){if(_0x55ce81){_0x292663=_0x55ce81[_0xf193('0x52')];_0x5a3f8e=_0x55ce81[_0xf193('0x56')];_0xa386aa=_0x55ce81[_0xf193('0x53')];_0x559b1f=_0x55ce81['remoteUri'];var _0x2408aa=_0x559b1f[_0xf193('0x57')](-0x1);if(_0x2408aa==='/'){_0x559b1f=_0x559b1f[_0xf193('0x58')](0x0,_0x559b1f[_0xf193('0x59')](_0x2408aa));}_0x3da08d=util['format'](_0xf193('0x5a'),_0x559b1f);var _0x18086={'method':_0xf193('0x5b'),'uri':_0x3da08d,'qs':{'operation':_0xf193('0x5c'),'username':_0x55ce81[_0xf193('0x52')]},'json':!![]};return rp(_0x18086);}})[_0xf193('0x3d')](function(_0x2f8f58){if(_0x2f8f58['success']){var _0x359604={'method':_0xf193('0x5d'),'uri':_0x3da08d,'form':{'operation':_0xf193('0x5e'),'username':_0x292663,'accessKey':md5(_0x2f8f58[_0xf193('0x5f')][_0xf193('0x60')]+_0x5a3f8e)},'json':!![]};return rp(_0x359604);}})[_0xf193('0x3d')](function(_0x3a9ad7){if(_0x3a9ad7[_0xf193('0x61')]){var _0x13b0a4={'method':_0xf193('0x5b'),'uri':_0x3da08d,'qs':{'operation':_0xf193('0x62'),'username':_0x292663,'sessionName':_0x3a9ad7[_0xf193('0x5f')][_0xf193('0x63')],'elementType':_0xa386aa},'json':!![]};return rp(_0x13b0a4);}})['then'](function(_0x4dbee7){if(_0x4dbee7[_0xf193('0x61')]){var _0x40d6fc=[_0xf193('0x64'),_0xf193('0x65'),_0xf193('0x66')];_[_0xf193('0x67')](_0x4dbee7[_0xf193('0x5f')][_0xf193('0x2e')],function(_0x32d076){return _0x40d6fc[_0xf193('0x68')](_0x32d076[_0xf193('0x27')][_0xf193('0x21')]);});_[_0xf193('0x67')](_0x4dbee7[_0xf193('0x5f')][_0xf193('0x2e')],function(_0x13a9dd){return _0x13a9dd[_0xf193('0x69')]===_0xf193('0x6a');});return{'count':_0x4dbee7[_0xf193('0x5f')]['fields'][_0xf193('0x2f')],'rows':_[_0xf193('0x24')](_0x4dbee7[_0xf193('0x5f')][_0xf193('0x2e')],function(_0x309d1f){return{'id':_0x309d1f[_0xf193('0x21')],'name':_0x309d1f[_0xf193('0x6b')],'custom':_[_0xf193('0x6c')](_0x309d1f['name'],_0xf193('0x6d'))?!![]:![],'options':_0x309d1f['type'][_0xf193('0x21')]===_0xf193('0x6e')&&_0x309d1f[_0xf193('0x27')]['picklistValues']['length']>0x0?_[_0xf193('0x24')](_0x309d1f[_0xf193('0x27')][_0xf193('0x6f')],function(_0x779b3a){return{'name':_0x779b3a[_0xf193('0x6b')],'value':_0x779b3a[_0xf193('0x70')]};}):[]};})};}})[_0xf193('0x3d')](respondWithResult(_0x56ac32,null))['catch'](function(_0x43a660){console[_0xf193('0x71')](_0xf193('0x72')+_0x43a660);var _0x160369=_0x10ad1f[_0xf193('0x29')][_0xf193('0x73')]?0x1f4:_0x43a660[_0xf193('0x74')]||0x1f4;logger['error'](_0xf193('0x75'),_0xf193('0x51'),_0x160369,JSON[_0xf193('0x76')](_0x43a660));delete _0x43a660[_0xf193('0x21')];if(_0x160369===0x191){_0x160369=0x190;}_0x56ac32[_0xf193('0x15')](_0x160369)['send'](_0x10ad1f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x43a660['statusCode']}:_0x43a660);});}; \ No newline at end of file +var _0x1a4e=['find','create','body','params','getConfigurations','VtigerConfiguration','addConfiguration','findOne','channel','Descriptions','VtigerField','Subjects','getFields','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','username','POST','login','result','success','describe','sessionName','autogenerated','remove','includes','editable','cf_','picklist','picklistValues','label','value','log','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','type','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','filter','options','VtigerAccount','includeAll','findAll','catch','show'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0x1a4e,0xa8));var _0xe1a4=function(_0x2c9d22,_0x28f65a){_0x2c9d22=_0x2c9d22-0x0;var _0x160346=_0x1a4e[_0x2c9d22];return _0x160346;};'use strict';var emlformat=require(_0xe1a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe1a4('0x1'));var jsonpatch=require(_0xe1a4('0x2'));var rp=require(_0xe1a4('0x3'));var moment=require(_0xe1a4('0x4'));var BPromise=require(_0xe1a4('0x5'));var Mustache=require(_0xe1a4('0x6'));var util=require('util');var path=require(_0xe1a4('0x7'));var sox=require(_0xe1a4('0x8'));var csv=require(_0xe1a4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe1a4('0xa'));var _=require(_0xe1a4('0xb'));var squel=require(_0xe1a4('0xc'));var crypto=require(_0xe1a4('0xd'));var jsforce=require(_0xe1a4('0xe'));var deskjs=require(_0xe1a4('0xf'));var toCsv=require(_0xe1a4('0x9'));var querystring=require(_0xe1a4('0x10'));var Papa=require(_0xe1a4('0x11'));var Redis=require(_0xe1a4('0x12'));var authService=require(_0xe1a4('0x13'));var qs=require(_0xe1a4('0x14'));var as=require(_0xe1a4('0x15'));var hardwareService=require(_0xe1a4('0x16'));var logger=require(_0xe1a4('0x17'))(_0xe1a4('0x18'));var utils=require(_0xe1a4('0x19'));var config=require(_0xe1a4('0x1a'));var licenseUtil=require(_0xe1a4('0x1b'));var db=require(_0xe1a4('0x1c'))['db'];var integrations=require(_0xe1a4('0x1d'));function respondWithStatusCode(_0x1393a5,_0x580401){_0x580401=_0x580401||0xcc;return function(_0x1d75a1){if(_0x1d75a1){return _0x1393a5[_0xe1a4('0x1e')](_0x580401);}return _0x1393a5[_0xe1a4('0x1f')](_0x580401)[_0xe1a4('0x20')]();};}function respondWithResult(_0x40387f,_0x4d6e4f){_0x4d6e4f=_0x4d6e4f||0xc8;return function(_0x1a613a){if(_0x1a613a){return _0x40387f['status'](_0x4d6e4f)[_0xe1a4('0x21')](_0x1a613a);}};}function respondWithFilteredResult(_0x11f4ea,_0x20d720){return function(_0x2f0527){if(_0x2f0527){var _0x5dd880=typeof _0x20d720[_0xe1a4('0x22')]===_0xe1a4('0x23')&&typeof _0x20d720[_0xe1a4('0x24')]===_0xe1a4('0x23');var _0x492636=_0x2f0527[_0xe1a4('0x25')];var _0x2b8391=_0x5dd880?0x0:_0x20d720[_0xe1a4('0x22')];var _0xe62ab3=_0x5dd880?_0x2f0527['count']:_0x20d720[_0xe1a4('0x22')]+_0x20d720['limit'];var _0x39c590;if(_0xe62ab3>=_0x492636){_0xe62ab3=_0x492636;_0x39c590=0xc8;}else{_0x39c590=0xce;}_0x11f4ea[_0xe1a4('0x1f')](_0x39c590);return _0x11f4ea[_0xe1a4('0x26')](_0xe1a4('0x27'),_0x2b8391+'-'+_0xe62ab3+'/'+_0x492636)['json'](_0x2f0527);}return null;};}function patchUpdates(_0x43e294){return function(_0x8c3ae0){try{jsonpatch[_0xe1a4('0x28')](_0x8c3ae0,_0x43e294,!![]);}catch(_0x333509){return BPromise[_0xe1a4('0x29')](_0x333509);}return _0x8c3ae0[_0xe1a4('0x2a')]();};}function saveUpdates(_0x4b38dd,_0x10df47){return function(_0x30718b){if(_0x30718b){return _0x30718b[_0xe1a4('0x2b')](_0x4b38dd)[_0xe1a4('0x2c')](function(_0x2abff6){return _0x2abff6;});}return null;};}function removeEntity(_0x383319,_0x3e0bc3){return function(_0x3c1bf0){if(_0x3c1bf0){return _0x3c1bf0[_0xe1a4('0x2d')]()[_0xe1a4('0x2c')](function(){_0x383319[_0xe1a4('0x1f')](0xcc)[_0xe1a4('0x20')]();});}};}function handleEntityNotFound(_0x4513f8,_0x3eb645){return function(_0x3a67d0){if(!_0x3a67d0){_0x4513f8[_0xe1a4('0x1e')](0x194);}return _0x3a67d0;};}function handleError(_0x562853,_0x2cc8e3){_0x2cc8e3=_0x2cc8e3||0x1f4;return function(_0x545346){logger[_0xe1a4('0x2e')](_0x545346[_0xe1a4('0x2f')]);if(_0x545346['name']){delete _0x545346['name'];}_0x562853['status'](_0x2cc8e3)[_0xe1a4('0x30')](_0x545346);};}exports[_0xe1a4('0x31')]=function(_0x11c2ba,_0x3ff0e4){var _0x2b4235={},_0x4d9aa5={},_0x3c6833={'count':0x0,'rows':[]};var _0x5df3a2=_[_0xe1a4('0x32')](db['VtigerAccount'][_0xe1a4('0x33')],function(_0x4be197){return{'name':_0x4be197['fieldName'],'type':_0x4be197[_0xe1a4('0x34')][_0xe1a4('0x35')]};});_0x4d9aa5[_0xe1a4('0x36')]=_[_0xe1a4('0x32')](_0x5df3a2,_0xe1a4('0x37'));_0x4d9aa5['query']=_[_0xe1a4('0x38')](_0x11c2ba[_0xe1a4('0x39')]);_0x4d9aa5['filters']=_[_0xe1a4('0x3a')](_0x4d9aa5[_0xe1a4('0x36')],_0x4d9aa5[_0xe1a4('0x39')]);_0x2b4235[_0xe1a4('0x3b')]=_[_0xe1a4('0x3a')](_0x4d9aa5[_0xe1a4('0x36')],qs[_0xe1a4('0x3c')](_0x11c2ba[_0xe1a4('0x39')]['fields']));_0x2b4235[_0xe1a4('0x3b')]=_0x2b4235[_0xe1a4('0x3b')][_0xe1a4('0x3d')]?_0x2b4235[_0xe1a4('0x3b')]:_0x4d9aa5[_0xe1a4('0x36')];if(!_0x11c2ba['query'][_0xe1a4('0x3e')](_0xe1a4('0x3f'))){_0x2b4235[_0xe1a4('0x24')]=qs[_0xe1a4('0x24')](_0x11c2ba[_0xe1a4('0x39')][_0xe1a4('0x24')]);_0x2b4235[_0xe1a4('0x22')]=qs[_0xe1a4('0x22')](_0x11c2ba['query'][_0xe1a4('0x22')]);}_0x2b4235['order']=qs['sort'](_0x11c2ba[_0xe1a4('0x39')][_0xe1a4('0x40')]);_0x2b4235[_0xe1a4('0x41')]=qs['filters'](_[_0xe1a4('0x42')](_0x11c2ba[_0xe1a4('0x39')],_0x4d9aa5[_0xe1a4('0x43')]),_0x5df3a2);if(_0x11c2ba[_0xe1a4('0x39')]['filter']){_0x2b4235[_0xe1a4('0x41')]=_[_0xe1a4('0x44')](_0x2b4235[_0xe1a4('0x41')],{'$or':_[_0xe1a4('0x32')](_0x5df3a2,function(_0x4f5bf5){if(_0x4f5bf5[_0xe1a4('0x34')]!=='VIRTUAL'){var _0x477e10={};_0x477e10[_0x4f5bf5[_0xe1a4('0x37')]]={'$like':'%'+_0x11c2ba[_0xe1a4('0x39')][_0xe1a4('0x45')]+'%'};return _0x477e10;}})});}_0x2b4235=_[_0xe1a4('0x44')]({},_0x2b4235,_0x11c2ba[_0xe1a4('0x46')]);var _0x2318c3={'where':_0x2b4235[_0xe1a4('0x41')]};return db[_0xe1a4('0x47')][_0xe1a4('0x25')](_0x2318c3)[_0xe1a4('0x2c')](function(_0x2b4b0d){_0x3c6833[_0xe1a4('0x25')]=_0x2b4b0d;if(_0x11c2ba[_0xe1a4('0x39')][_0xe1a4('0x48')]){_0x2b4235['include']=[{'all':!![]}];}return db[_0xe1a4('0x47')][_0xe1a4('0x49')](_0x2b4235);})[_0xe1a4('0x2c')](function(_0x35f406){_0x3c6833['rows']=_0x35f406;return _0x3c6833;})[_0xe1a4('0x2c')](respondWithFilteredResult(_0x3ff0e4,_0x2b4235))[_0xe1a4('0x4a')](handleError(_0x3ff0e4,null));};exports[_0xe1a4('0x4b')]=function(_0x30ae0b,_0x4bc2ab){var _0x2caaff={'raw':![],'where':{'id':_0x30ae0b['params']['id']}},_0x24cb2e={};_0x24cb2e['model']=_[_0xe1a4('0x38')](db[_0xe1a4('0x47')][_0xe1a4('0x33')]);_0x24cb2e[_0xe1a4('0x39')]=_[_0xe1a4('0x38')](_0x30ae0b[_0xe1a4('0x39')]);_0x24cb2e['filters']=_[_0xe1a4('0x3a')](_0x24cb2e[_0xe1a4('0x36')],_0x24cb2e[_0xe1a4('0x39')]);_0x2caaff[_0xe1a4('0x3b')]=_['intersection'](_0x24cb2e[_0xe1a4('0x36')],qs[_0xe1a4('0x3c')](_0x30ae0b[_0xe1a4('0x39')][_0xe1a4('0x3c')]));_0x2caaff[_0xe1a4('0x3b')]=_0x2caaff['attributes']['length']?_0x2caaff[_0xe1a4('0x3b')]:_0x24cb2e[_0xe1a4('0x36')];if(_0x30ae0b[_0xe1a4('0x39')][_0xe1a4('0x48')]){_0x2caaff['include']=[{'all':!![]}];}_0x2caaff=_[_0xe1a4('0x44')]({},_0x2caaff,_0x30ae0b['options']);return db[_0xe1a4('0x47')][_0xe1a4('0x4c')](_0x2caaff)[_0xe1a4('0x2c')](handleEntityNotFound(_0x4bc2ab,null))[_0xe1a4('0x2c')](respondWithResult(_0x4bc2ab,null))[_0xe1a4('0x4a')](handleError(_0x4bc2ab,null));};exports[_0xe1a4('0x4d')]=function(_0x5aaa29,_0x4e8a58){return db[_0xe1a4('0x47')][_0xe1a4('0x4d')](_0x5aaa29[_0xe1a4('0x4e')],{})[_0xe1a4('0x2c')](respondWithResult(_0x4e8a58,0xc9))[_0xe1a4('0x4a')](handleError(_0x4e8a58,null));};exports[_0xe1a4('0x2b')]=function(_0x13ab23,_0x11b143){if(_0x13ab23[_0xe1a4('0x4e')]['id']){delete _0x13ab23[_0xe1a4('0x4e')]['id'];}return db['VtigerAccount'][_0xe1a4('0x4c')]({'where':{'id':_0x13ab23['params']['id']}})[_0xe1a4('0x2c')](handleEntityNotFound(_0x11b143,null))[_0xe1a4('0x2c')](saveUpdates(_0x13ab23['body'],null))[_0xe1a4('0x2c')](respondWithResult(_0x11b143,null))[_0xe1a4('0x4a')](handleError(_0x11b143,null));};exports['destroy']=function(_0x3c5a01,_0x42ab2a){return db[_0xe1a4('0x47')][_0xe1a4('0x4c')]({'where':{'id':_0x3c5a01[_0xe1a4('0x4f')]['id']}})[_0xe1a4('0x2c')](handleEntityNotFound(_0x42ab2a,null))['then'](removeEntity(_0x42ab2a,null))['catch'](handleError(_0x42ab2a,null));};exports[_0xe1a4('0x50')]=function(_0xdb7ad7,_0x4ac8fc,_0xc1718a){var _0x23b62c={};var _0x4d009b={};var _0x3a74b3;var _0x557559;return db['VtigerAccount']['findOne']({'where':{'id':_0xdb7ad7[_0xe1a4('0x4f')]['id']}})[_0xe1a4('0x2c')](handleEntityNotFound(_0x4ac8fc,null))[_0xe1a4('0x2c')](function(_0x24023e){if(_0x24023e){_0x3a74b3=_0x24023e;_0x4d009b['model']=_[_0xe1a4('0x38')](db[_0xe1a4('0x51')][_0xe1a4('0x33')]);_0x4d009b['query']=_[_0xe1a4('0x38')](_0xdb7ad7[_0xe1a4('0x39')]);_0x4d009b[_0xe1a4('0x43')]=_[_0xe1a4('0x3a')](_0x4d009b['model'],_0x4d009b[_0xe1a4('0x39')]);_0x23b62c[_0xe1a4('0x3b')]=_[_0xe1a4('0x3a')](_0x4d009b[_0xe1a4('0x36')],qs[_0xe1a4('0x3c')](_0xdb7ad7[_0xe1a4('0x39')]['fields']));_0x23b62c[_0xe1a4('0x3b')]=_0x23b62c[_0xe1a4('0x3b')][_0xe1a4('0x3d')]?_0x23b62c[_0xe1a4('0x3b')]:_0x4d009b[_0xe1a4('0x36')];_0x23b62c['order']=qs[_0xe1a4('0x40')](_0xdb7ad7[_0xe1a4('0x39')][_0xe1a4('0x40')]);_0x23b62c[_0xe1a4('0x41')]=qs[_0xe1a4('0x43')](_['pick'](_0xdb7ad7['query'],_0x4d009b['filters']));if(_0xdb7ad7[_0xe1a4('0x39')][_0xe1a4('0x45')]){_0x23b62c[_0xe1a4('0x41')]=_['merge'](_0x23b62c[_0xe1a4('0x41')],{'$or':_[_0xe1a4('0x32')](_0x23b62c[_0xe1a4('0x3b')],function(_0x480350){var _0x3b9afd={};_0x3b9afd[_0x480350]={'$like':'%'+_0xdb7ad7['query']['filter']+'%'};return _0x3b9afd;})});}_0x23b62c=_[_0xe1a4('0x44')]({},_0x23b62c,_0xdb7ad7[_0xe1a4('0x46')]);return _0x3a74b3['getConfigurations'](_0x23b62c);}})['then'](function(_0xcce769){if(_0xcce769){_0x557559=_0xcce769['length'];if(!_0xdb7ad7[_0xe1a4('0x39')][_0xe1a4('0x3e')](_0xe1a4('0x3f'))){_0x23b62c[_0xe1a4('0x24')]=qs[_0xe1a4('0x24')](_0xdb7ad7['query'][_0xe1a4('0x24')]);_0x23b62c[_0xe1a4('0x22')]=qs[_0xe1a4('0x22')](_0xdb7ad7[_0xe1a4('0x39')][_0xe1a4('0x22')]);}return _0x3a74b3[_0xe1a4('0x50')](_0x23b62c);}})[_0xe1a4('0x2c')](function(_0x3c94b8){if(_0x3c94b8){return _0x3c94b8?{'count':_0x557559,'rows':_0x3c94b8}:null;}})[_0xe1a4('0x2c')](respondWithResult(_0x4ac8fc,null))[_0xe1a4('0x4a')](handleError(_0x4ac8fc,null));};exports[_0xe1a4('0x52')]=function(_0xc5cbea,_0x21ab5f,_0x236b57){if(_0xc5cbea[_0xe1a4('0x4e')]['id']){delete _0xc5cbea[_0xe1a4('0x4e')]['id'];}return db[_0xe1a4('0x47')][_0xe1a4('0x53')]({'where':{'id':_0xc5cbea[_0xe1a4('0x4f')]['id']}})[_0xe1a4('0x2c')](handleEntityNotFound(_0x21ab5f,null))[_0xe1a4('0x2c')](function(_0x1bc49d){if(_0x1bc49d){_0xc5cbea[_0xe1a4('0x4e')]['AccountId']=_0x1bc49d['id'];_0xc5cbea[_0xe1a4('0x4e')]['Subjects']=integrations['getSubjects'](_0xc5cbea[_0xe1a4('0x4e')][_0xe1a4('0x54')],_0xc5cbea[_0xe1a4('0x4e')][_0xe1a4('0x34')]);_0xc5cbea[_0xe1a4('0x4e')][_0xe1a4('0x55')]=integrations['getDescriptions'](_0xc5cbea[_0xe1a4('0x4e')]['channel'],_0xc5cbea[_0xe1a4('0x4e')][_0xe1a4('0x34')]);return db[_0xe1a4('0x51')][_0xe1a4('0x4d')](_0xc5cbea[_0xe1a4('0x4e')],{'include':[{'model':db[_0xe1a4('0x56')],'as':_0xe1a4('0x57')},{'model':db[_0xe1a4('0x56')],'as':_0xe1a4('0x55')}]});}return null;})[_0xe1a4('0x2c')](respondWithResult(_0x21ab5f,null))[_0xe1a4('0x4a')](handleError(_0x21ab5f,null));};var md5=require('md5');exports[_0xe1a4('0x58')]=function(_0xf78d4f,_0x4cf605,_0x388abf){var _0xc62da0=null;var _0x5f2b4b=null;var _0x3757fa=null;var _0x186021=null;var _0x4018eb='';return db[_0xe1a4('0x47')][_0xe1a4('0x53')]({'where':{'id':_0xf78d4f['params']['id']},'attributes':['id',_0xe1a4('0x37'),'username',_0xe1a4('0x59'),_0xe1a4('0x5a'),_0xe1a4('0x5b'),_0xe1a4('0x5c'),_0xe1a4('0x5d')]})[_0xe1a4('0x2c')](handleEntityNotFound(_0x4cf605,null))[_0xe1a4('0x2c')](function(_0x41adbe){if(_0x41adbe){_0xc62da0=_0x41adbe['username'];_0x5f2b4b=_0x41adbe[_0xe1a4('0x5d')];_0x3757fa=_0x41adbe[_0xe1a4('0x5a')];_0x4018eb=_0x41adbe[_0xe1a4('0x5b')];var _0x54e22c=_0x4018eb[_0xe1a4('0x5e')](-0x1);if(_0x54e22c==='/'){_0x4018eb=_0x4018eb[_0xe1a4('0x5f')](0x0,_0x4018eb[_0xe1a4('0x60')](_0x54e22c));}_0x186021=util[_0xe1a4('0x61')](_0xe1a4('0x62'),_0x4018eb);var _0x2b6e7b={'method':_0xe1a4('0x63'),'uri':_0x186021,'qs':{'operation':_0xe1a4('0x64'),'username':_0x41adbe[_0xe1a4('0x65')]},'json':!![]};return rp(_0x2b6e7b);}})[_0xe1a4('0x2c')](function(_0x5b18ce){if(_0x5b18ce['success']){var _0x46957f={'method':_0xe1a4('0x66'),'uri':_0x186021,'form':{'operation':_0xe1a4('0x67'),'username':_0xc62da0,'accessKey':md5(_0x5b18ce[_0xe1a4('0x68')]['token']+_0x5f2b4b)},'json':!![]};return rp(_0x46957f);}})['then'](function(_0x4ee741){if(_0x4ee741[_0xe1a4('0x69')]){var _0x377cb0={'method':_0xe1a4('0x63'),'uri':_0x186021,'qs':{'operation':_0xe1a4('0x6a'),'username':_0xc62da0,'sessionName':_0x4ee741[_0xe1a4('0x68')][_0xe1a4('0x6b')],'elementType':_0x3757fa},'json':!![]};return rp(_0x377cb0);}})[_0xe1a4('0x2c')](function(_0x2abb5b){if(_0x2abb5b[_0xe1a4('0x69')]){var _0x5184d1=[_0xe1a4('0x6c'),'reference','owner'];_[_0xe1a4('0x6d')](_0x2abb5b[_0xe1a4('0x68')][_0xe1a4('0x3c')],function(_0x350da4){return _0x5184d1[_0xe1a4('0x6e')](_0x350da4['type']['name']);});_[_0xe1a4('0x6d')](_0x2abb5b[_0xe1a4('0x68')][_0xe1a4('0x3c')],function(_0x48c053){return _0x48c053[_0xe1a4('0x6f')]==='false';});return{'count':_0x2abb5b[_0xe1a4('0x68')][_0xe1a4('0x3c')][_0xe1a4('0x3d')],'rows':_[_0xe1a4('0x32')](_0x2abb5b[_0xe1a4('0x68')][_0xe1a4('0x3c')],function(_0x13e63a){return{'id':_0x13e63a[_0xe1a4('0x37')],'name':_0x13e63a['label'],'custom':_['startsWith'](_0x13e63a['name'],_0xe1a4('0x70'))?!![]:![],'options':_0x13e63a['type']['name']===_0xe1a4('0x71')&&_0x13e63a[_0xe1a4('0x34')][_0xe1a4('0x72')][_0xe1a4('0x3d')]>0x0?_[_0xe1a4('0x32')](_0x13e63a[_0xe1a4('0x34')][_0xe1a4('0x72')],function(_0x5869de){return{'name':_0x5869de[_0xe1a4('0x73')],'value':_0x5869de[_0xe1a4('0x74')]};}):[]};})};}})[_0xe1a4('0x2c')](respondWithResult(_0x4cf605,null))[_0xe1a4('0x4a')](function(_0x470715){console[_0xe1a4('0x75')]('vTiger\x20error:\x20'+_0x470715);var _0x1de6f5=_0xf78d4f['query'][_0xe1a4('0x76')]?0x1f4:_0x470715['statusCode']||0x1f4;logger[_0xe1a4('0x2e')](_0xe1a4('0x77'),_0xe1a4('0x58'),_0x1de6f5,JSON[_0xe1a4('0x78')](_0x470715));delete _0x470715[_0xe1a4('0x37')];if(_0x1de6f5===0x191){_0x1de6f5=0x190;}_0x4cf605[_0xe1a4('0x1f')](_0x1de6f5)[_0xe1a4('0x30')](_0xf78d4f['query'][_0xe1a4('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x470715[_0xe1a4('0x79')]}:_0x470715);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1e30822..6d6b8f0 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 _0x9418=['int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9418,0xb7));var _0x8941=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x9418[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require(_0x8941('0x0'));var util=require(_0x8941('0x1'));var logger=require(_0x8941('0x2'))('api');var moment=require(_0x8941('0x3'));var BPromise=require(_0x8941('0x4'));var rp=require(_0x8941('0x5'));var fs=require('fs');var path=require(_0x8941('0x6'));var rimraf=require(_0x8941('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x8941('0x8'));module[_0x8941('0x9')]=function(_0x398ddd,_0x18c78b){return _0x398ddd[_0x8941('0xa')](_0x8941('0xb'),attributes,{'tableName':_0x8941('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa27c=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','util'];(function(_0xac533d,_0x5801e6){var _0x167c5f=function(_0x443f89){while(--_0x443f89){_0xac533d['push'](_0xac533d['shift']());}};_0x167c5f(++_0x5801e6);}(_0xa27c,0x11f));var _0xca27=function(_0x22c1dd,_0x13d4d1){_0x22c1dd=_0x22c1dd-0x0;var _0x2b4532=_0xa27c[_0x22c1dd];return _0x2b4532;};'use strict';var _=require('lodash');var util=require(_0xca27('0x0'));var logger=require(_0xca27('0x1'))(_0xca27('0x2'));var moment=require('moment');var BPromise=require(_0xca27('0x3'));var rp=require(_0xca27('0x4'));var fs=require('fs');var path=require(_0xca27('0x5'));var rimraf=require(_0xca27('0x6'));var config=require(_0xca27('0x7'));var attributes=require(_0xca27('0x8'));var integrations=require(_0xca27('0x9'));module['exports']=function(_0x320b6d,_0x13fab3){return _0x320b6d[_0xca27('0xa')]('VtigerAccount',attributes,{'tableName':_0xca27('0xb'),'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 42b2e18..fbf2226 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 _0x4ded=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','stringify','find','ShowVtigerAccount','lodash','util'];(function(_0x274d7d,_0x3bba99){var _0x5e876a=function(_0x25daec){while(--_0x25daec){_0x274d7d['push'](_0x274d7d['shift']());}};_0x5e876a(++_0x3bba99);}(_0x4ded,0x116));var _0xd4de=function(_0x2cbec6,_0x3011e7){_0x2cbec6=_0x2cbec6-0x0;var _0x18f365=_0x4ded[_0x2cbec6];return _0x18f365;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2433b8,_0x15eb91,_0x2c56d5){return new BPromise(function(_0x4453c2,_0x1e8c35){return client['request'](_0x2433b8,_0x2c56d5)[_0xd4de('0xd')](function(_0x5ebcf3){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x15eb91,_0xd4de('0xe'));logger[_0xd4de('0xf')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x15eb91,'request\x20sent',JSON['stringify'](_0x5ebcf3));if(_0x5ebcf3[_0xd4de('0x10')]){if(_0x5ebcf3['error'][_0xd4de('0x11')]===0x1f4){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x1e8c35(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x4453c2(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}else{logger[_0xd4de('0x14')](_0xd4de('0x12'),_0x15eb91,_0xd4de('0xe'));_0x4453c2(_0x5ebcf3[_0xd4de('0x15')]['message']);}})['catch'](function(_0x3df820){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x3df820);_0x1e8c35(_0x3df820);});});}exports[_0xd4de('0x16')]=function(_0x5b1d1c){var _0x4d0df6=this;return new Promise(function(_0x1e91d5,_0x54b757){return db[_0xd4de('0x17')][_0xd4de('0x18')]({'raw':_0x5b1d1c['options']?_0x5b1d1c[_0xd4de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1a')]||null:null,'attributes':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c['options'][_0xd4de('0x1b')]||null:null,'limit':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1c')]||null:null,'include':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1d')],function(_0x534b37){return{'model':db[_0x534b37[_0xd4de('0x1f')]],'as':_0x534b37['as'],'attributes':_0x534b37[_0xd4de('0x1b')],'include':_0x534b37[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x534b37[_0xd4de('0x1d')],function(_0x984904){return{'model':db[_0x984904[_0xd4de('0x1f')]],'as':_0x984904['as'],'attributes':_0x984904[_0xd4de('0x1b')],'include':_0x984904[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x984904[_0xd4de('0x1d')],function(_0xb2d8a1){return{'model':db[_0xb2d8a1['model']],'as':_0xb2d8a1['as'],'attributes':_0xb2d8a1[_0xd4de('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd4de('0xd')](function(_0x5005b0){logger[_0xd4de('0x14')]('GetVtigerAccount',_0x5b1d1c);logger[_0xd4de('0xf')](_0xd4de('0x16'),_0x5b1d1c,JSON[_0xd4de('0x20')](_0x5005b0));_0x1e91d5(_0x5005b0);})['catch'](function(_0xd4de93){logger[_0xd4de('0x10')](_0xd4de('0x16'),_0xd4de93['message'],_0x5b1d1c);_0x54b757(_0x4d0df6[_0xd4de('0x10')](0x1f4,_0xd4de93[_0xd4de('0x13')]));});});};exports['ShowVtigerAccount']=function(_0x5103b5){var _0x5706fe=this;return new Promise(function(_0x3f6491,_0x496795){return db[_0xd4de('0x17')][_0xd4de('0x21')]({'raw':_0x5103b5[_0xd4de('0x19')]?_0x5103b5[_0xd4de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5103b5[_0xd4de('0x19')]?_0x5103b5[_0xd4de('0x19')]['where']||null:null,'attributes':_0x5103b5[_0xd4de('0x19')]?_0x5103b5[_0xd4de('0x19')]['attributes']||null:null,'include':_0x5103b5['options']?_0x5103b5[_0xd4de('0x19')][_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x5103b5[_0xd4de('0x19')]['include'],function(_0x2bdc98){return{'model':db[_0x2bdc98[_0xd4de('0x1f')]],'as':_0x2bdc98['as'],'attributes':_0x2bdc98['attributes'],'include':_0x2bdc98[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x2bdc98[_0xd4de('0x1d')],function(_0x34528a){return{'model':db[_0x34528a[_0xd4de('0x1f')]],'as':_0x34528a['as'],'attributes':_0x34528a[_0xd4de('0x1b')],'include':_0x34528a['include']?_['map'](_0x34528a[_0xd4de('0x1d')],function(_0x2d2fda){return{'model':db[_0x2d2fda[_0xd4de('0x1f')]],'as':_0x2d2fda['as'],'attributes':_0x2d2fda['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4de('0xd')](function(_0x44b96c){logger['info'](_0xd4de('0x22'),_0x5103b5);logger[_0xd4de('0xf')](_0xd4de('0x22'),_0x5103b5,JSON[_0xd4de('0x20')](_0x44b96c));_0x3f6491(_0x44b96c);})['catch'](function(_0x53d7dc){logger[_0xd4de('0x10')]('ShowVtigerAccount',_0x53d7dc[_0xd4de('0x13')],_0x5103b5);_0x496795(_0x5706fe['error'](0x1f4,_0x53d7dc[_0xd4de('0x13')]));});});}; \ No newline at end of file +var _0x6f7a=['then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','VtigerAccount','options','raw','where','attributes','include','model','map','GetVtigerAccount','ShowVtigerAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5b328a,_0x5c48bc){var _0xfcf474=function(_0x296320){while(--_0x296320){_0x5b328a['push'](_0x5b328a['shift']());}};_0xfcf474(++_0x5c48bc);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1f2f38,_0x23d7f1){_0x1f2f38=_0x1f2f38-0x0;var _0x35c357=_0x6f7a[_0x1f2f38];return _0x35c357;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});}exports['GetVtigerAccount']=function(_0x4a8827){var _0xba7755=this;return new Promise(function(_0x5298ba,_0x378967){return db[_0xa6f7('0x1a')]['findAll']({'raw':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x4a8827['options']?_0x4a8827[_0xa6f7('0x1b')][_0xa6f7('0x1e')]||null:null,'limit':_0x4a8827['options']?_0x4a8827['options']['limit']||null:null,'include':_0x4a8827[_0xa6f7('0x1b')]?_0x4a8827[_0xa6f7('0x1b')]['include']?_['map'](_0x4a8827['options'][_0xa6f7('0x1f')],function(_0xc77e8e){return{'model':db[_0xc77e8e[_0xa6f7('0x20')]],'as':_0xc77e8e['as'],'attributes':_0xc77e8e['attributes'],'include':_0xc77e8e['include']?_[_0xa6f7('0x21')](_0xc77e8e['include'],function(_0x47ef97){return{'model':db[_0x47ef97[_0xa6f7('0x20')]],'as':_0x47ef97['as'],'attributes':_0x47ef97['attributes'],'include':_0x47ef97[_0xa6f7('0x1f')]?_[_0xa6f7('0x21')](_0x47ef97[_0xa6f7('0x1f')],function(_0x2b4c6c){return{'model':db[_0x2b4c6c[_0xa6f7('0x20')]],'as':_0x2b4c6c['as'],'attributes':_0x2b4c6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c419b){logger[_0xa6f7('0xf')]('GetVtigerAccount',_0x4a8827);logger[_0xa6f7('0x10')](_0xa6f7('0x22'),_0x4a8827,JSON[_0xa6f7('0x12')](_0x1c419b));_0x5298ba(_0x1c419b);})[_0xa6f7('0x19')](function(_0x224f5a){logger[_0xa6f7('0x13')](_0xa6f7('0x22'),_0x224f5a[_0xa6f7('0x16')],_0x4a8827);_0x378967(_0xba7755[_0xa6f7('0x13')](0x1f4,_0x224f5a[_0xa6f7('0x16')]));});});};exports[_0xa6f7('0x23')]=function(_0x278bad){var _0x52f9c1=this;return new Promise(function(_0x442ccf,_0x42dc49){return db['VtigerAccount'][_0xa6f7('0x24')]({'raw':_0x278bad[_0xa6f7('0x1b')]?_0x278bad['options']['raw']===undefined?!![]:![]:!![],'where':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1d')]||null:null,'attributes':_0x278bad[_0xa6f7('0x1b')]?_0x278bad[_0xa6f7('0x1b')]['attributes']||null:null,'include':_0x278bad['options']?_0x278bad[_0xa6f7('0x1b')]['include']?_[_0xa6f7('0x21')](_0x278bad[_0xa6f7('0x1b')][_0xa6f7('0x1f')],function(_0x237e5d){return{'model':db[_0x237e5d[_0xa6f7('0x20')]],'as':_0x237e5d['as'],'attributes':_0x237e5d[_0xa6f7('0x1e')],'include':_0x237e5d['include']?_[_0xa6f7('0x21')](_0x237e5d[_0xa6f7('0x1f')],function(_0x1a5de5){return{'model':db[_0x1a5de5['model']],'as':_0x1a5de5['as'],'attributes':_0x1a5de5[_0xa6f7('0x1e')],'include':_0x1a5de5['include']?_[_0xa6f7('0x21')](_0x1a5de5[_0xa6f7('0x1f')],function(_0x45837c){return{'model':db[_0x45837c['model']],'as':_0x45837c['as'],'attributes':_0x45837c[_0xa6f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa6f7('0xe')](function(_0x3b3bc2){logger[_0xa6f7('0xf')](_0xa6f7('0x23'),_0x278bad);logger[_0xa6f7('0x10')]('ShowVtigerAccount',_0x278bad,JSON[_0xa6f7('0x12')](_0x3b3bc2));_0x442ccf(_0x3b3bc2);})[_0xa6f7('0x19')](function(_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x23'),_0xc25a1b[_0xa6f7('0x16')],_0x278bad);_0x42dc49(_0x52f9c1[_0xa6f7('0x13')](0x1f4,_0xc25a1b[_0xa6f7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index ed69b8c..331ec2f 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 _0x5ab1=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util'];(function(_0x35bc0d,_0x43ac23){var _0x4b64a7=function(_0x34d5bc){while(--_0x34d5bc){_0x35bc0d['push'](_0x35bc0d['shift']());}};_0x4b64a7(++_0x43ac23);}(_0x5ab1,0xfb));var _0x15ab=function(_0x368753,_0x4f5f45){_0x368753=_0x368753-0x0;var _0x1d0ec7=_0x5ab1[_0x368753];return _0x1d0ec7;};'use strict';var multer=require(_0x15ab('0x0'));var util=require(_0x15ab('0x1'));var path=require(_0x15ab('0x2'));var timeout=require('connect-timeout');var express=require(_0x15ab('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15ab('0x4'));var interaction=require(_0x15ab('0x5'));var config=require(_0x15ab('0x6'));var controller=require(_0x15ab('0x7'));router['get']('/',auth[_0x15ab('0x8')](),controller[_0x15ab('0x9')]);router[_0x15ab('0xa')](_0x15ab('0xb'),auth[_0x15ab('0x8')](),controller['show']);router[_0x15ab('0xa')]('/:id/fields',auth[_0x15ab('0x8')](),controller[_0x15ab('0xc')]);router[_0x15ab('0xa')](_0x15ab('0xd'),auth[_0x15ab('0x8')](),controller[_0x15ab('0xe')]);router[_0x15ab('0xa')](_0x15ab('0xf'),auth['isAuthenticated'](),controller[_0x15ab('0x10')]);router[_0x15ab('0x11')]('/',auth[_0x15ab('0x8')](),controller[_0x15ab('0x12')]);router[_0x15ab('0x13')]('/:id',auth[_0x15ab('0x8')](),controller[_0x15ab('0x14')]);router['delete'](_0x15ab('0xb'),auth[_0x15ab('0x8')](),controller[_0x15ab('0x15')]);module[_0x15ab('0x16')]=router; \ No newline at end of file +var _0xb0ff=['getSubjects','/:id/descriptions','create','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xb0ff,0x1bb));var _0xfb0f=function(_0x3b18d1,_0x56bddd){_0x3b18d1=_0x3b18d1-0x0;var _0xa6bb1d=_0xb0ff[_0x3b18d1];return _0xa6bb1d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xfb0f('0x0'));var express=require('express');var router=express[_0xfb0f('0x1')]();var fs_extra=require(_0xfb0f('0x2'));var auth=require(_0xfb0f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfb0f('0x4'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0xfb0f('0x5')](),controller[_0xfb0f('0x6')]);router[_0xfb0f('0x7')](_0xfb0f('0x8'),auth[_0xfb0f('0x5')](),controller[_0xfb0f('0x9')]);router[_0xfb0f('0x7')](_0xfb0f('0xa'),auth[_0xfb0f('0x5')](),controller[_0xfb0f('0xb')]);router[_0xfb0f('0x7')](_0xfb0f('0xc'),auth[_0xfb0f('0x5')](),controller[_0xfb0f('0xd')]);router['get'](_0xfb0f('0xe'),auth[_0xfb0f('0x5')](),controller['getDescriptions']);router['post']('/',auth[_0xfb0f('0x5')](),controller[_0xfb0f('0xf')]);router['put'](_0xfb0f('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xfb0f('0x10')]('/:id',auth[_0xfb0f('0x5')](),controller[_0xfb0f('0x11')]);module[_0xfb0f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 4e5f068..a37ce96 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 _0x9464=['STRING','exports'];(function(_0x151ed4,_0x23cfb8){var _0x1c6f7e=function(_0x5466be){while(--_0x5466be){_0x151ed4['push'](_0x151ed4['shift']());}};_0x1c6f7e(++_0x23cfb8);}(_0x9464,0xb7));var _0x4946=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0x9464[_0x31295c];return _0x2c150e;};'use strict';var Sequelize=require('sequelize');module[_0x4946('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4946('0x1')]}}; \ No newline at end of file +var _0x407e=['sequelize','exports','STRING'];(function(_0x2dc96f,_0x459058){var _0xd012da=function(_0x38d032){while(--_0x38d032){_0x2dc96f['push'](_0x2dc96f['shift']());}};_0xd012da(++_0x459058);}(_0x407e,0x10b));var _0xe407=function(_0x269c42,_0xeed101){_0x269c42=_0x269c42-0x0;var _0x4dad76=_0x407e[_0x269c42];return _0x4dad76;};'use strict';var Sequelize=require(_0xe407('0x0'));module[_0xe407('0x1')]={'name':{'type':Sequelize[_0xe407('0x2')]},'description':{'type':Sequelize[_0xe407('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 114b25d..72be0c4 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 _0x11ab=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','VtigerField','order','pick','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x37406c,_0x3b0edd){var _0x43bfc1=function(_0x5ab06c){while(--_0x5ab06c){_0x37406c['push'](_0x37406c['shift']());}};_0x43bfc1(++_0x3b0edd);}(_0x11ab,0xf5));var _0xb11a=function(_0x2c47b9,_0x1b1a83){_0x2c47b9=_0x2c47b9-0x0;var _0x384f3f=_0x11ab[_0x2c47b9];return _0x384f3f;};'use strict';var emlformat=require(_0xb11a('0x0'));var rimraf=require(_0xb11a('0x1'));var zipdir=require(_0xb11a('0x2'));var jsonpatch=require(_0xb11a('0x3'));var rp=require(_0xb11a('0x4'));var moment=require(_0xb11a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb11a('0x6'));var util=require(_0xb11a('0x7'));var path=require(_0xb11a('0x8'));var sox=require(_0xb11a('0x9'));var csv=require(_0xb11a('0xa'));var ejs=require(_0xb11a('0xb'));var fs=require('fs');var fs_extra=require(_0xb11a('0xc'));var _=require(_0xb11a('0xd'));var squel=require(_0xb11a('0xe'));var crypto=require(_0xb11a('0xf'));var jsforce=require(_0xb11a('0x10'));var deskjs=require(_0xb11a('0x11'));var toCsv=require(_0xb11a('0xa'));var querystring=require(_0xb11a('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb11a('0x13'));var qs=require(_0xb11a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb11a('0x15'));var logger=require(_0xb11a('0x16'))(_0xb11a('0x17'));var utils=require(_0xb11a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb11a('0x19'));var db=require(_0xb11a('0x1a'))['db'];function respondWithStatusCode(_0x5f079b,_0x344180){_0x344180=_0x344180||0xcc;return function(_0x58435e){if(_0x58435e){return _0x5f079b[_0xb11a('0x1b')](_0x344180);}return _0x5f079b['status'](_0x344180)[_0xb11a('0x1c')]();};}function respondWithResult(_0x1fb70,_0x4938e3){_0x4938e3=_0x4938e3||0xc8;return function(_0x2400b6){if(_0x2400b6){return _0x1fb70[_0xb11a('0x1d')](_0x4938e3)['json'](_0x2400b6);}};}function respondWithFilteredResult(_0x1ed410,_0x31a9a0){return function(_0x25b105){if(_0x25b105){var _0x2c8026=typeof _0x31a9a0[_0xb11a('0x1e')]==='undefined'&&typeof _0x31a9a0[_0xb11a('0x1f')]===_0xb11a('0x20');var _0x4f6255=_0x25b105['count'];var _0x5b5ffc=_0x2c8026?0x0:_0x31a9a0['offset'];var _0x5b70fe=_0x2c8026?_0x25b105[_0xb11a('0x21')]:_0x31a9a0[_0xb11a('0x1e')]+_0x31a9a0[_0xb11a('0x1f')];var _0xd836c0;if(_0x5b70fe>=_0x4f6255){_0x5b70fe=_0x4f6255;_0xd836c0=0xc8;}else{_0xd836c0=0xce;}_0x1ed410['status'](_0xd836c0);return _0x1ed410[_0xb11a('0x22')](_0xb11a('0x23'),_0x5b5ffc+'-'+_0x5b70fe+'/'+_0x4f6255)[_0xb11a('0x24')](_0x25b105);}return null;};}function patchUpdates(_0x5857e8){return function(_0x28045f){try{jsonpatch[_0xb11a('0x25')](_0x28045f,_0x5857e8,!![]);}catch(_0x5c551d){return BPromise['reject'](_0x5c551d);}return _0x28045f[_0xb11a('0x26')]();};}function saveUpdates(_0xb4adc5,_0xb8cc94){return function(_0x89d6db){if(_0x89d6db){return _0x89d6db[_0xb11a('0x27')](_0xb4adc5)['then'](function(_0x4b4552){return _0x4b4552;});}return null;};}function removeEntity(_0x1c58c7,_0x150313){return function(_0x144431){if(_0x144431){return _0x144431[_0xb11a('0x28')]()[_0xb11a('0x29')](function(){_0x1c58c7[_0xb11a('0x1d')](0xcc)[_0xb11a('0x1c')]();});}};}function handleEntityNotFound(_0x15c84e,_0x24edb6){return function(_0x18cebb){if(!_0x18cebb){_0x15c84e[_0xb11a('0x1b')](0x194);}return _0x18cebb;};}function handleError(_0x87279a,_0xe33caa){_0xe33caa=_0xe33caa||0x1f4;return function(_0xde358d){logger['error'](_0xde358d[_0xb11a('0x2a')]);if(_0xde358d['name']){delete _0xde358d[_0xb11a('0x2b')];}_0x87279a[_0xb11a('0x1d')](_0xe33caa)[_0xb11a('0x2c')](_0xde358d);};}exports[_0xb11a('0x2d')]=function(_0x25d09d,_0x2e9873){var _0x4c981c={},_0x801591={},_0x5379e5={'count':0x0,'rows':[]};var _0x3b919c=_[_0xb11a('0x2e')](db[_0xb11a('0x2f')]['rawAttributes'],function(_0xe57dba){return{'name':_0xe57dba[_0xb11a('0x30')],'type':_0xe57dba[_0xb11a('0x31')][_0xb11a('0x32')]};});_0x801591['model']=_[_0xb11a('0x2e')](_0x3b919c,'name');_0x801591[_0xb11a('0x33')]=_[_0xb11a('0x34')](_0x25d09d[_0xb11a('0x33')]);_0x801591['filters']=_[_0xb11a('0x35')](_0x801591['model'],_0x801591['query']);_0x4c981c['attributes']=_['intersection'](_0x801591['model'],qs[_0xb11a('0x36')](_0x25d09d[_0xb11a('0x33')][_0xb11a('0x36')]));_0x4c981c['attributes']=_0x4c981c[_0xb11a('0x37')][_0xb11a('0x38')]?_0x4c981c[_0xb11a('0x37')]:_0x801591[_0xb11a('0x39')];if(!_0x25d09d['query'][_0xb11a('0x3a')](_0xb11a('0x3b'))){_0x4c981c['limit']=qs['limit'](_0x25d09d['query'][_0xb11a('0x1f')]);_0x4c981c[_0xb11a('0x1e')]=qs[_0xb11a('0x1e')](_0x25d09d[_0xb11a('0x33')][_0xb11a('0x1e')]);}_0x4c981c['order']=qs[_0xb11a('0x3c')](_0x25d09d[_0xb11a('0x33')][_0xb11a('0x3c')]);_0x4c981c[_0xb11a('0x3d')]=qs[_0xb11a('0x3e')](_['pick'](_0x25d09d[_0xb11a('0x33')],_0x801591[_0xb11a('0x3e')]),_0x3b919c);if(_0x25d09d[_0xb11a('0x33')][_0xb11a('0x3f')]){_0x4c981c[_0xb11a('0x3d')]=_[_0xb11a('0x40')](_0x4c981c['where'],{'$or':_['map'](_0x3b919c,function(_0x1c3e53){if(_0x1c3e53[_0xb11a('0x31')]!==_0xb11a('0x41')){var _0x40b0a8={};_0x40b0a8[_0x1c3e53[_0xb11a('0x2b')]]={'$like':'%'+_0x25d09d[_0xb11a('0x33')][_0xb11a('0x3f')]+'%'};return _0x40b0a8;}})});}_0x4c981c=_[_0xb11a('0x40')]({},_0x4c981c,_0x25d09d['options']);var _0x31cad4={'where':_0x4c981c[_0xb11a('0x3d')]};return db[_0xb11a('0x2f')][_0xb11a('0x21')](_0x31cad4)[_0xb11a('0x29')](function(_0x402a96){_0x5379e5[_0xb11a('0x21')]=_0x402a96;if(_0x25d09d[_0xb11a('0x33')][_0xb11a('0x42')]){_0x4c981c[_0xb11a('0x43')]=[{'all':!![]}];}return db[_0xb11a('0x2f')][_0xb11a('0x44')](_0x4c981c);})[_0xb11a('0x29')](function(_0x135891){_0x5379e5[_0xb11a('0x45')]=_0x135891;return _0x5379e5;})[_0xb11a('0x29')](respondWithFilteredResult(_0x2e9873,_0x4c981c))[_0xb11a('0x46')](handleError(_0x2e9873,null));};exports[_0xb11a('0x47')]=function(_0x32957f,_0x57f9ba){var _0x40454d={'raw':![],'where':{'id':_0x32957f[_0xb11a('0x48')]['id']}},_0x597e7f={};_0x597e7f[_0xb11a('0x39')]=_[_0xb11a('0x34')](db[_0xb11a('0x2f')][_0xb11a('0x49')]);_0x597e7f['query']=_[_0xb11a('0x34')](_0x32957f['query']);_0x597e7f[_0xb11a('0x3e')]=_[_0xb11a('0x35')](_0x597e7f[_0xb11a('0x39')],_0x597e7f[_0xb11a('0x33')]);_0x40454d[_0xb11a('0x37')]=_['intersection'](_0x597e7f[_0xb11a('0x39')],qs[_0xb11a('0x36')](_0x32957f[_0xb11a('0x33')][_0xb11a('0x36')]));_0x40454d[_0xb11a('0x37')]=_0x40454d[_0xb11a('0x37')]['length']?_0x40454d[_0xb11a('0x37')]:_0x597e7f['model'];if(_0x32957f[_0xb11a('0x33')][_0xb11a('0x42')]){_0x40454d['include']=[{'all':!![]}];}_0x40454d=_[_0xb11a('0x40')]({},_0x40454d,_0x32957f[_0xb11a('0x4a')]);return db['VtigerConfiguration'][_0xb11a('0x4b')](_0x40454d)['then'](handleEntityNotFound(_0x57f9ba,null))[_0xb11a('0x29')](respondWithResult(_0x57f9ba,null))[_0xb11a('0x46')](handleError(_0x57f9ba,null));};exports['create']=function(_0x20db0d,_0x243df4){return db[_0xb11a('0x2f')][_0xb11a('0x4c')](_0x20db0d[_0xb11a('0x4d')],{})[_0xb11a('0x29')](respondWithResult(_0x243df4,0xc9))['catch'](handleError(_0x243df4,null));};exports[_0xb11a('0x27')]=function(_0x156400,_0x59df80){if(_0x156400[_0xb11a('0x4d')]['id']){delete _0x156400[_0xb11a('0x4d')]['id'];}return db['VtigerConfiguration'][_0xb11a('0x4b')]({'where':{'id':_0x156400[_0xb11a('0x48')]['id']}})[_0xb11a('0x29')](handleEntityNotFound(_0x59df80,null))[_0xb11a('0x29')](saveUpdates(_0x156400[_0xb11a('0x4d')],null))[_0xb11a('0x29')](respondWithResult(_0x59df80,null))['catch'](handleError(_0x59df80,null));};exports[_0xb11a('0x28')]=function(_0x74cec7,_0x4c303e){return db[_0xb11a('0x2f')][_0xb11a('0x4b')]({'where':{'id':_0x74cec7[_0xb11a('0x48')]['id']}})['then'](handleEntityNotFound(_0x4c303e,null))[_0xb11a('0x29')](removeEntity(_0x4c303e,null))['catch'](handleError(_0x4c303e,null));};exports['getFields']=function(_0x3ff33f,_0x1db31d,_0x4c8c10){var _0x2d81d5={};var _0x437f7c={};var _0x2b2e46;var _0x3eb291;return db[_0xb11a('0x2f')]['findOne']({'where':{'id':_0x3ff33f['params']['id']}})[_0xb11a('0x29')](handleEntityNotFound(_0x1db31d,null))['then'](function(_0x645a0b){if(_0x645a0b){_0x2b2e46=_0x645a0b;_0x437f7c[_0xb11a('0x39')]=_[_0xb11a('0x34')](db[_0xb11a('0x4e')]['rawAttributes']);_0x437f7c[_0xb11a('0x33')]=_['keys'](_0x3ff33f[_0xb11a('0x33')]);_0x437f7c[_0xb11a('0x3e')]=_[_0xb11a('0x35')](_0x437f7c[_0xb11a('0x39')],_0x437f7c['query']);_0x2d81d5[_0xb11a('0x37')]=_['intersection'](_0x437f7c[_0xb11a('0x39')],qs[_0xb11a('0x36')](_0x3ff33f['query'][_0xb11a('0x36')]));_0x2d81d5[_0xb11a('0x37')]=_0x2d81d5[_0xb11a('0x37')]['length']?_0x2d81d5[_0xb11a('0x37')]:_0x437f7c[_0xb11a('0x39')];_0x2d81d5[_0xb11a('0x4f')]=qs[_0xb11a('0x3c')](_0x3ff33f[_0xb11a('0x33')]['sort']);_0x2d81d5[_0xb11a('0x3d')]=qs[_0xb11a('0x3e')](_[_0xb11a('0x50')](_0x3ff33f[_0xb11a('0x33')],_0x437f7c[_0xb11a('0x3e')]));if(_0x3ff33f[_0xb11a('0x33')][_0xb11a('0x3f')]){_0x2d81d5[_0xb11a('0x3d')]=_['merge'](_0x2d81d5[_0xb11a('0x3d')],{'$or':_[_0xb11a('0x2e')](_0x2d81d5['attributes'],function(_0x1dc7c4){var _0x411e35={};_0x411e35[_0x1dc7c4]={'$like':'%'+_0x3ff33f['query'][_0xb11a('0x3f')]+'%'};return _0x411e35;})});}_0x2d81d5=_['merge']({},_0x2d81d5,_0x3ff33f[_0xb11a('0x4a')]);return _0x2b2e46[_0xb11a('0x51')](_0x2d81d5);}})[_0xb11a('0x29')](function(_0x5c1cc5){if(_0x5c1cc5){_0x3eb291=_0x5c1cc5['length'];if(!_0x3ff33f[_0xb11a('0x33')]['hasOwnProperty']('nolimit')){_0x2d81d5['limit']=qs[_0xb11a('0x1f')](_0x3ff33f[_0xb11a('0x33')][_0xb11a('0x1f')]);_0x2d81d5[_0xb11a('0x1e')]=qs[_0xb11a('0x1e')](_0x3ff33f[_0xb11a('0x33')][_0xb11a('0x1e')]);}return _0x2b2e46[_0xb11a('0x51')](_0x2d81d5);}})['then'](function(_0x2f6c20){if(_0x2f6c20){return _0x2f6c20?{'count':_0x3eb291,'rows':_0x2f6c20}:null;}})[_0xb11a('0x29')](respondWithResult(_0x1db31d,null))[_0xb11a('0x46')](handleError(_0x1db31d,null));};exports[_0xb11a('0x52')]=function(_0x38cff5,_0xd91b7a,_0x18bd2f){var _0x477b30={};var _0x1ab776={};var _0x437c52;var _0x127ccd;return db[_0xb11a('0x2f')]['findOne']({'where':{'id':_0x38cff5[_0xb11a('0x48')]['id']}})[_0xb11a('0x29')](handleEntityNotFound(_0xd91b7a,null))[_0xb11a('0x29')](function(_0x36c06a){if(_0x36c06a){_0x437c52=_0x36c06a;_0x1ab776['model']=_['keys'](db[_0xb11a('0x4e')]['rawAttributes']);_0x1ab776[_0xb11a('0x33')]=_[_0xb11a('0x34')](_0x38cff5[_0xb11a('0x33')]);_0x1ab776[_0xb11a('0x3e')]=_['intersection'](_0x1ab776['model'],_0x1ab776['query']);_0x477b30[_0xb11a('0x37')]=_[_0xb11a('0x35')](_0x1ab776[_0xb11a('0x39')],qs[_0xb11a('0x36')](_0x38cff5['query']['fields']));_0x477b30[_0xb11a('0x37')]=_0x477b30[_0xb11a('0x37')][_0xb11a('0x38')]?_0x477b30[_0xb11a('0x37')]:_0x1ab776[_0xb11a('0x39')];_0x477b30['order']=qs[_0xb11a('0x3c')](_0x38cff5['query'][_0xb11a('0x3c')]);_0x477b30['where']=qs['filters'](_[_0xb11a('0x50')](_0x38cff5['query'],_0x1ab776[_0xb11a('0x3e')]));if(_0x38cff5[_0xb11a('0x33')][_0xb11a('0x3f')]){_0x477b30[_0xb11a('0x3d')]=_[_0xb11a('0x40')](_0x477b30['where'],{'$or':_['map'](_0x477b30[_0xb11a('0x37')],function(_0x307d03){var _0x202397={};_0x202397[_0x307d03]={'$like':'%'+_0x38cff5[_0xb11a('0x33')][_0xb11a('0x3f')]+'%'};return _0x202397;})});}_0x477b30=_[_0xb11a('0x40')]({},_0x477b30,_0x38cff5[_0xb11a('0x4a')]);return _0x437c52[_0xb11a('0x52')](_0x477b30);}})['then'](function(_0x4efcd5){if(_0x4efcd5){_0x127ccd=_0x4efcd5[_0xb11a('0x38')];if(!_0x38cff5[_0xb11a('0x33')][_0xb11a('0x3a')](_0xb11a('0x3b'))){_0x477b30[_0xb11a('0x1f')]=qs[_0xb11a('0x1f')](_0x38cff5[_0xb11a('0x33')]['limit']);_0x477b30[_0xb11a('0x1e')]=qs[_0xb11a('0x1e')](_0x38cff5['query'][_0xb11a('0x1e')]);}return _0x437c52['getSubjects'](_0x477b30);}})[_0xb11a('0x29')](function(_0x3f19ac){if(_0x3f19ac){return _0x3f19ac?{'count':_0x127ccd,'rows':_0x3f19ac}:null;}})['then'](respondWithResult(_0xd91b7a,null))['catch'](handleError(_0xd91b7a,null));};exports['getDescriptions']=function(_0x420755,_0x2c4882,_0x1f0aa6){var _0x2a46ee={};var _0x287428={};var _0x14e23b;var _0x3f2c1f;return db[_0xb11a('0x2f')][_0xb11a('0x53')]({'where':{'id':_0x420755[_0xb11a('0x48')]['id']}})[_0xb11a('0x29')](handleEntityNotFound(_0x2c4882,null))['then'](function(_0x51bf45){if(_0x51bf45){_0x14e23b=_0x51bf45;_0x287428[_0xb11a('0x39')]=_[_0xb11a('0x34')](db[_0xb11a('0x4e')][_0xb11a('0x49')]);_0x287428[_0xb11a('0x33')]=_[_0xb11a('0x34')](_0x420755[_0xb11a('0x33')]);_0x287428['filters']=_['intersection'](_0x287428[_0xb11a('0x39')],_0x287428['query']);_0x2a46ee[_0xb11a('0x37')]=_[_0xb11a('0x35')](_0x287428[_0xb11a('0x39')],qs[_0xb11a('0x36')](_0x420755['query'][_0xb11a('0x36')]));_0x2a46ee[_0xb11a('0x37')]=_0x2a46ee[_0xb11a('0x37')][_0xb11a('0x38')]?_0x2a46ee[_0xb11a('0x37')]:_0x287428[_0xb11a('0x39')];_0x2a46ee[_0xb11a('0x4f')]=qs[_0xb11a('0x3c')](_0x420755[_0xb11a('0x33')][_0xb11a('0x3c')]);_0x2a46ee[_0xb11a('0x3d')]=qs[_0xb11a('0x3e')](_[_0xb11a('0x50')](_0x420755[_0xb11a('0x33')],_0x287428['filters']));if(_0x420755[_0xb11a('0x33')][_0xb11a('0x3f')]){_0x2a46ee[_0xb11a('0x3d')]=_['merge'](_0x2a46ee[_0xb11a('0x3d')],{'$or':_[_0xb11a('0x2e')](_0x2a46ee[_0xb11a('0x37')],function(_0x59266d){var _0x332292={};_0x332292[_0x59266d]={'$like':'%'+_0x420755[_0xb11a('0x33')]['filter']+'%'};return _0x332292;})});}_0x2a46ee=_[_0xb11a('0x40')]({},_0x2a46ee,_0x420755[_0xb11a('0x4a')]);return _0x14e23b[_0xb11a('0x54')](_0x2a46ee);}})[_0xb11a('0x29')](function(_0xad0d71){if(_0xad0d71){_0x3f2c1f=_0xad0d71[_0xb11a('0x38')];if(!_0x420755[_0xb11a('0x33')]['hasOwnProperty'](_0xb11a('0x3b'))){_0x2a46ee[_0xb11a('0x1f')]=qs[_0xb11a('0x1f')](_0x420755[_0xb11a('0x33')][_0xb11a('0x1f')]);_0x2a46ee['offset']=qs[_0xb11a('0x1e')](_0x420755['query']['offset']);}return _0x14e23b['getDescriptions'](_0x2a46ee);}})['then'](function(_0x1d6a14){if(_0x1d6a14){return _0x1d6a14?{'count':_0x3f2c1f,'rows':_0x1d6a14}:null;}})['then'](respondWithResult(_0x2c4882,null))[_0xb11a('0x46')](handleError(_0x2c4882,null));}; \ No newline at end of file +var _0x4f79=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','reject','update','destroy','then','error','name','index','VtigerConfiguration','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','map','type','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','VtigerField','getFields','nolimit','findOne','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0xe2e796,_0x28ef15){var _0x21c655=function(_0x298aba){while(--_0x298aba){_0xe2e796['push'](_0xe2e796['shift']());}};_0x21c655(++_0x28ef15);}(_0x4f79,0x1d2));var _0x94f7=function(_0x53961d,_0x16b208){_0x53961d=_0x53961d-0x0;var _0x45d198=_0x4f79[_0x53961d];return _0x45d198;};'use strict';var emlformat=require(_0x94f7('0x0'));var rimraf=require(_0x94f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94f7('0x2'));var rp=require(_0x94f7('0x3'));var moment=require(_0x94f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x94f7('0x5'));var util=require(_0x94f7('0x6'));var path=require(_0x94f7('0x7'));var sox=require('sox');var csv=require(_0x94f7('0x8'));var ejs=require(_0x94f7('0x9'));var fs=require('fs');var fs_extra=require(_0x94f7('0xa'));var _=require(_0x94f7('0xb'));var squel=require('squel');var crypto=require(_0x94f7('0xc'));var jsforce=require(_0x94f7('0xd'));var deskjs=require(_0x94f7('0xe'));var toCsv=require(_0x94f7('0x8'));var querystring=require(_0x94f7('0xf'));var Papa=require(_0x94f7('0x10'));var Redis=require(_0x94f7('0x11'));var authService=require(_0x94f7('0x12'));var qs=require(_0x94f7('0x13'));var as=require(_0x94f7('0x14'));var hardwareService=require(_0x94f7('0x15'));var logger=require('../../config/logger')(_0x94f7('0x16'));var utils=require(_0x94f7('0x17'));var config=require(_0x94f7('0x18'));var licenseUtil=require(_0x94f7('0x19'));var db=require(_0x94f7('0x1a'))['db'];function respondWithStatusCode(_0x444aee,_0x3b16b6){_0x3b16b6=_0x3b16b6||0xcc;return function(_0x4ad4bf){if(_0x4ad4bf){return _0x444aee['sendStatus'](_0x3b16b6);}return _0x444aee[_0x94f7('0x1b')](_0x3b16b6)[_0x94f7('0x1c')]();};}function respondWithResult(_0x193122,_0x51afac){_0x51afac=_0x51afac||0xc8;return function(_0x30cb03){if(_0x30cb03){return _0x193122[_0x94f7('0x1b')](_0x51afac)[_0x94f7('0x1d')](_0x30cb03);}};}function respondWithFilteredResult(_0x2f4299,_0x287223){return function(_0xb28104){if(_0xb28104){var _0x5ec69e=typeof _0x287223[_0x94f7('0x1e')]===_0x94f7('0x1f')&&typeof _0x287223[_0x94f7('0x20')]===_0x94f7('0x1f');var _0x30133e=_0xb28104['count'];var _0x597385=_0x5ec69e?0x0:_0x287223[_0x94f7('0x1e')];var _0x24a28c=_0x5ec69e?_0xb28104['count']:_0x287223['offset']+_0x287223[_0x94f7('0x20')];var _0x5a05cd;if(_0x24a28c>=_0x30133e){_0x24a28c=_0x30133e;_0x5a05cd=0xc8;}else{_0x5a05cd=0xce;}_0x2f4299[_0x94f7('0x1b')](_0x5a05cd);return _0x2f4299['set']('Content-Range',_0x597385+'-'+_0x24a28c+'/'+_0x30133e)[_0x94f7('0x1d')](_0xb28104);}return null;};}function patchUpdates(_0x5cffe6){return function(_0x4d2627){try{jsonpatch['apply'](_0x4d2627,_0x5cffe6,!![]);}catch(_0x45d667){return BPromise[_0x94f7('0x21')](_0x45d667);}return _0x4d2627['save']();};}function saveUpdates(_0x4dcc60,_0x114ba5){return function(_0x4bbf05){if(_0x4bbf05){return _0x4bbf05[_0x94f7('0x22')](_0x4dcc60)['then'](function(_0x1d0f2a){return _0x1d0f2a;});}return null;};}function removeEntity(_0x1d3afe,_0x2af80c){return function(_0x39527c){if(_0x39527c){return _0x39527c[_0x94f7('0x23')]()[_0x94f7('0x24')](function(){_0x1d3afe[_0x94f7('0x1b')](0xcc)[_0x94f7('0x1c')]();});}};}function handleEntityNotFound(_0x47174e,_0x13f7ed){return function(_0x560847){if(!_0x560847){_0x47174e['sendStatus'](0x194);}return _0x560847;};}function handleError(_0x4ab2cd,_0x239921){_0x239921=_0x239921||0x1f4;return function(_0x5ba0ea){logger[_0x94f7('0x25')](_0x5ba0ea['stack']);if(_0x5ba0ea[_0x94f7('0x26')]){delete _0x5ba0ea[_0x94f7('0x26')];}_0x4ab2cd[_0x94f7('0x1b')](_0x239921)['send'](_0x5ba0ea);};}exports[_0x94f7('0x27')]=function(_0x107214,_0x47bc18){var _0x348a6d={},_0x560119={},_0x43b85e={'count':0x0,'rows':[]};var _0x37f8bc=_['map'](db[_0x94f7('0x28')][_0x94f7('0x29')],function(_0x3af701){return{'name':_0x3af701[_0x94f7('0x2a')],'type':_0x3af701['type']['key']};});_0x560119['model']=_['map'](_0x37f8bc,_0x94f7('0x26'));_0x560119[_0x94f7('0x2b')]=_['keys'](_0x107214['query']);_0x560119['filters']=_[_0x94f7('0x2c')](_0x560119[_0x94f7('0x2d')],_0x560119[_0x94f7('0x2b')]);_0x348a6d[_0x94f7('0x2e')]=_['intersection'](_0x560119[_0x94f7('0x2d')],qs[_0x94f7('0x2f')](_0x107214[_0x94f7('0x2b')]['fields']));_0x348a6d['attributes']=_0x348a6d[_0x94f7('0x2e')][_0x94f7('0x30')]?_0x348a6d['attributes']:_0x560119[_0x94f7('0x2d')];if(!_0x107214[_0x94f7('0x2b')][_0x94f7('0x31')]('nolimit')){_0x348a6d[_0x94f7('0x20')]=qs[_0x94f7('0x20')](_0x107214[_0x94f7('0x2b')]['limit']);_0x348a6d[_0x94f7('0x1e')]=qs[_0x94f7('0x1e')](_0x107214['query'][_0x94f7('0x1e')]);}_0x348a6d[_0x94f7('0x32')]=qs[_0x94f7('0x33')](_0x107214[_0x94f7('0x2b')]['sort']);_0x348a6d['where']=qs[_0x94f7('0x34')](_[_0x94f7('0x35')](_0x107214[_0x94f7('0x2b')],_0x560119['filters']),_0x37f8bc);if(_0x107214['query']['filter']){_0x348a6d[_0x94f7('0x36')]=_[_0x94f7('0x37')](_0x348a6d[_0x94f7('0x36')],{'$or':_[_0x94f7('0x38')](_0x37f8bc,function(_0x346514){if(_0x346514[_0x94f7('0x39')]!==_0x94f7('0x3a')){var _0x329ef0={};_0x329ef0[_0x346514[_0x94f7('0x26')]]={'$like':'%'+_0x107214[_0x94f7('0x2b')][_0x94f7('0x3b')]+'%'};return _0x329ef0;}})});}_0x348a6d=_[_0x94f7('0x37')]({},_0x348a6d,_0x107214['options']);var _0xb6c6df={'where':_0x348a6d[_0x94f7('0x36')]};return db['VtigerConfiguration'][_0x94f7('0x3c')](_0xb6c6df)[_0x94f7('0x24')](function(_0x12178b){_0x43b85e[_0x94f7('0x3c')]=_0x12178b;if(_0x107214[_0x94f7('0x2b')][_0x94f7('0x3d')]){_0x348a6d[_0x94f7('0x3e')]=[{'all':!![]}];}return db[_0x94f7('0x28')][_0x94f7('0x3f')](_0x348a6d);})[_0x94f7('0x24')](function(_0xff2488){_0x43b85e[_0x94f7('0x40')]=_0xff2488;return _0x43b85e;})['then'](respondWithFilteredResult(_0x47bc18,_0x348a6d))[_0x94f7('0x41')](handleError(_0x47bc18,null));};exports[_0x94f7('0x42')]=function(_0x5451e7,_0x343f80){var _0x18d5e7={'raw':![],'where':{'id':_0x5451e7[_0x94f7('0x43')]['id']}},_0x320133={};_0x320133[_0x94f7('0x2d')]=_[_0x94f7('0x44')](db[_0x94f7('0x28')][_0x94f7('0x29')]);_0x320133[_0x94f7('0x2b')]=_[_0x94f7('0x44')](_0x5451e7[_0x94f7('0x2b')]);_0x320133[_0x94f7('0x34')]=_[_0x94f7('0x2c')](_0x320133[_0x94f7('0x2d')],_0x320133[_0x94f7('0x2b')]);_0x18d5e7[_0x94f7('0x2e')]=_[_0x94f7('0x2c')](_0x320133['model'],qs['fields'](_0x5451e7['query'][_0x94f7('0x2f')]));_0x18d5e7[_0x94f7('0x2e')]=_0x18d5e7['attributes'][_0x94f7('0x30')]?_0x18d5e7['attributes']:_0x320133[_0x94f7('0x2d')];if(_0x5451e7[_0x94f7('0x2b')][_0x94f7('0x3d')]){_0x18d5e7[_0x94f7('0x3e')]=[{'all':!![]}];}_0x18d5e7=_[_0x94f7('0x37')]({},_0x18d5e7,_0x5451e7[_0x94f7('0x45')]);return db[_0x94f7('0x28')][_0x94f7('0x46')](_0x18d5e7)[_0x94f7('0x24')](handleEntityNotFound(_0x343f80,null))[_0x94f7('0x24')](respondWithResult(_0x343f80,null))[_0x94f7('0x41')](handleError(_0x343f80,null));};exports[_0x94f7('0x47')]=function(_0x10a083,_0x33af4d){return db[_0x94f7('0x28')][_0x94f7('0x47')](_0x10a083[_0x94f7('0x48')],{})[_0x94f7('0x24')](respondWithResult(_0x33af4d,0xc9))['catch'](handleError(_0x33af4d,null));};exports[_0x94f7('0x22')]=function(_0x5795d8,_0x1d581e){if(_0x5795d8['body']['id']){delete _0x5795d8[_0x94f7('0x48')]['id'];}return db['VtigerConfiguration'][_0x94f7('0x46')]({'where':{'id':_0x5795d8[_0x94f7('0x43')]['id']}})[_0x94f7('0x24')](handleEntityNotFound(_0x1d581e,null))[_0x94f7('0x24')](saveUpdates(_0x5795d8[_0x94f7('0x48')],null))['then'](respondWithResult(_0x1d581e,null))['catch'](handleError(_0x1d581e,null));};exports[_0x94f7('0x23')]=function(_0x14daaf,_0x2d73b1){return db[_0x94f7('0x28')][_0x94f7('0x46')]({'where':{'id':_0x14daaf[_0x94f7('0x43')]['id']}})[_0x94f7('0x24')](handleEntityNotFound(_0x2d73b1,null))[_0x94f7('0x24')](removeEntity(_0x2d73b1,null))[_0x94f7('0x41')](handleError(_0x2d73b1,null));};exports['getFields']=function(_0x127de3,_0x44eaf1,_0x2685b5){var _0x794611={};var _0x474094={};var _0x569c65;var _0x198a15;return db[_0x94f7('0x28')]['findOne']({'where':{'id':_0x127de3[_0x94f7('0x43')]['id']}})[_0x94f7('0x24')](handleEntityNotFound(_0x44eaf1,null))[_0x94f7('0x24')](function(_0x2ee558){if(_0x2ee558){_0x569c65=_0x2ee558;_0x474094[_0x94f7('0x2d')]=_['keys'](db[_0x94f7('0x49')]['rawAttributes']);_0x474094[_0x94f7('0x2b')]=_['keys'](_0x127de3[_0x94f7('0x2b')]);_0x474094[_0x94f7('0x34')]=_[_0x94f7('0x2c')](_0x474094[_0x94f7('0x2d')],_0x474094[_0x94f7('0x2b')]);_0x794611[_0x94f7('0x2e')]=_[_0x94f7('0x2c')](_0x474094[_0x94f7('0x2d')],qs[_0x94f7('0x2f')](_0x127de3['query']['fields']));_0x794611['attributes']=_0x794611[_0x94f7('0x2e')][_0x94f7('0x30')]?_0x794611[_0x94f7('0x2e')]:_0x474094['model'];_0x794611[_0x94f7('0x32')]=qs['sort'](_0x127de3[_0x94f7('0x2b')][_0x94f7('0x33')]);_0x794611[_0x94f7('0x36')]=qs[_0x94f7('0x34')](_[_0x94f7('0x35')](_0x127de3[_0x94f7('0x2b')],_0x474094[_0x94f7('0x34')]));if(_0x127de3['query']['filter']){_0x794611[_0x94f7('0x36')]=_['merge'](_0x794611['where'],{'$or':_[_0x94f7('0x38')](_0x794611['attributes'],function(_0x48ea10){var _0x51f730={};_0x51f730[_0x48ea10]={'$like':'%'+_0x127de3['query'][_0x94f7('0x3b')]+'%'};return _0x51f730;})});}_0x794611=_[_0x94f7('0x37')]({},_0x794611,_0x127de3[_0x94f7('0x45')]);return _0x569c65[_0x94f7('0x4a')](_0x794611);}})[_0x94f7('0x24')](function(_0x85a129){if(_0x85a129){_0x198a15=_0x85a129[_0x94f7('0x30')];if(!_0x127de3['query'][_0x94f7('0x31')](_0x94f7('0x4b'))){_0x794611[_0x94f7('0x20')]=qs[_0x94f7('0x20')](_0x127de3[_0x94f7('0x2b')][_0x94f7('0x20')]);_0x794611['offset']=qs[_0x94f7('0x1e')](_0x127de3[_0x94f7('0x2b')][_0x94f7('0x1e')]);}return _0x569c65[_0x94f7('0x4a')](_0x794611);}})[_0x94f7('0x24')](function(_0x26947d){if(_0x26947d){return _0x26947d?{'count':_0x198a15,'rows':_0x26947d}:null;}})['then'](respondWithResult(_0x44eaf1,null))[_0x94f7('0x41')](handleError(_0x44eaf1,null));};exports['getSubjects']=function(_0x589029,_0x15ee2f,_0x1cb463){var _0x5e0098={};var _0x5e6ff0={};var _0x1f4c11;var _0x2b6810;return db['VtigerConfiguration'][_0x94f7('0x4c')]({'where':{'id':_0x589029['params']['id']}})[_0x94f7('0x24')](handleEntityNotFound(_0x15ee2f,null))[_0x94f7('0x24')](function(_0x154e8b){if(_0x154e8b){_0x1f4c11=_0x154e8b;_0x5e6ff0[_0x94f7('0x2d')]=_[_0x94f7('0x44')](db[_0x94f7('0x49')][_0x94f7('0x29')]);_0x5e6ff0['query']=_[_0x94f7('0x44')](_0x589029[_0x94f7('0x2b')]);_0x5e6ff0[_0x94f7('0x34')]=_[_0x94f7('0x2c')](_0x5e6ff0[_0x94f7('0x2d')],_0x5e6ff0[_0x94f7('0x2b')]);_0x5e0098[_0x94f7('0x2e')]=_['intersection'](_0x5e6ff0[_0x94f7('0x2d')],qs[_0x94f7('0x2f')](_0x589029[_0x94f7('0x2b')][_0x94f7('0x2f')]));_0x5e0098[_0x94f7('0x2e')]=_0x5e0098[_0x94f7('0x2e')][_0x94f7('0x30')]?_0x5e0098[_0x94f7('0x2e')]:_0x5e6ff0[_0x94f7('0x2d')];_0x5e0098['order']=qs['sort'](_0x589029['query'][_0x94f7('0x33')]);_0x5e0098[_0x94f7('0x36')]=qs[_0x94f7('0x34')](_[_0x94f7('0x35')](_0x589029[_0x94f7('0x2b')],_0x5e6ff0[_0x94f7('0x34')]));if(_0x589029[_0x94f7('0x2b')][_0x94f7('0x3b')]){_0x5e0098['where']=_[_0x94f7('0x37')](_0x5e0098[_0x94f7('0x36')],{'$or':_['map'](_0x5e0098[_0x94f7('0x2e')],function(_0x2ec2ea){var _0x197e72={};_0x197e72[_0x2ec2ea]={'$like':'%'+_0x589029[_0x94f7('0x2b')]['filter']+'%'};return _0x197e72;})});}_0x5e0098=_['merge']({},_0x5e0098,_0x589029[_0x94f7('0x45')]);return _0x1f4c11['getSubjects'](_0x5e0098);}})[_0x94f7('0x24')](function(_0x28b6a8){if(_0x28b6a8){_0x2b6810=_0x28b6a8[_0x94f7('0x30')];if(!_0x589029[_0x94f7('0x2b')]['hasOwnProperty']('nolimit')){_0x5e0098['limit']=qs['limit'](_0x589029[_0x94f7('0x2b')][_0x94f7('0x20')]);_0x5e0098['offset']=qs[_0x94f7('0x1e')](_0x589029[_0x94f7('0x2b')]['offset']);}return _0x1f4c11[_0x94f7('0x4d')](_0x5e0098);}})['then'](function(_0x307184){if(_0x307184){return _0x307184?{'count':_0x2b6810,'rows':_0x307184}:null;}})[_0x94f7('0x24')](respondWithResult(_0x15ee2f,null))['catch'](handleError(_0x15ee2f,null));};exports[_0x94f7('0x4e')]=function(_0xbf94f5,_0xe3ee4e,_0x1f3de7){var _0x3b5542={};var _0x398e77={};var _0x2b36a9;var _0x156dd6;return db[_0x94f7('0x28')][_0x94f7('0x4c')]({'where':{'id':_0xbf94f5['params']['id']}})['then'](handleEntityNotFound(_0xe3ee4e,null))[_0x94f7('0x24')](function(_0x44cb88){if(_0x44cb88){_0x2b36a9=_0x44cb88;_0x398e77[_0x94f7('0x2d')]=_[_0x94f7('0x44')](db[_0x94f7('0x49')][_0x94f7('0x29')]);_0x398e77[_0x94f7('0x2b')]=_[_0x94f7('0x44')](_0xbf94f5[_0x94f7('0x2b')]);_0x398e77['filters']=_['intersection'](_0x398e77['model'],_0x398e77[_0x94f7('0x2b')]);_0x3b5542['attributes']=_['intersection'](_0x398e77['model'],qs[_0x94f7('0x2f')](_0xbf94f5[_0x94f7('0x2b')][_0x94f7('0x2f')]));_0x3b5542[_0x94f7('0x2e')]=_0x3b5542['attributes'][_0x94f7('0x30')]?_0x3b5542[_0x94f7('0x2e')]:_0x398e77[_0x94f7('0x2d')];_0x3b5542[_0x94f7('0x32')]=qs['sort'](_0xbf94f5[_0x94f7('0x2b')][_0x94f7('0x33')]);_0x3b5542[_0x94f7('0x36')]=qs['filters'](_[_0x94f7('0x35')](_0xbf94f5[_0x94f7('0x2b')],_0x398e77[_0x94f7('0x34')]));if(_0xbf94f5[_0x94f7('0x2b')][_0x94f7('0x3b')]){_0x3b5542[_0x94f7('0x36')]=_[_0x94f7('0x37')](_0x3b5542['where'],{'$or':_[_0x94f7('0x38')](_0x3b5542[_0x94f7('0x2e')],function(_0x1732a1){var _0x1b6eef={};_0x1b6eef[_0x1732a1]={'$like':'%'+_0xbf94f5[_0x94f7('0x2b')][_0x94f7('0x3b')]+'%'};return _0x1b6eef;})});}_0x3b5542=_[_0x94f7('0x37')]({},_0x3b5542,_0xbf94f5[_0x94f7('0x45')]);return _0x2b36a9[_0x94f7('0x4e')](_0x3b5542);}})[_0x94f7('0x24')](function(_0xc43f93){if(_0xc43f93){_0x156dd6=_0xc43f93[_0x94f7('0x30')];if(!_0xbf94f5['query'][_0x94f7('0x31')](_0x94f7('0x4b'))){_0x3b5542[_0x94f7('0x20')]=qs[_0x94f7('0x20')](_0xbf94f5[_0x94f7('0x2b')][_0x94f7('0x20')]);_0x3b5542[_0x94f7('0x1e')]=qs['offset'](_0xbf94f5['query'][_0x94f7('0x1e')]);}return _0x2b36a9['getDescriptions'](_0x3b5542);}})['then'](function(_0x1b33c3){if(_0x1b33c3){return _0x1b33c3?{'count':_0x156dd6,'rows':_0x1b33c3}:null;}})[_0x94f7('0x24')](respondWithResult(_0xe3ee4e,null))[_0x94f7('0x41')](handleError(_0xe3ee4e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6a756aa..8a35928 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 _0x18a4=['exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x455a49,_0x441ef7){var _0x2c1e7a=function(_0x3e4d77){while(--_0x3e4d77){_0x455a49['push'](_0x455a49['shift']());}};_0x2c1e7a(++_0x441ef7);}(_0x18a4,0x82));var _0x418a=function(_0x30e593,_0xd03451){_0x30e593=_0x30e593-0x0;var _0x1fef82=_0x18a4[_0x30e593];return _0x1fef82;};'use strict';var _=require(_0x418a('0x0'));var util=require(_0x418a('0x1'));var logger=require(_0x418a('0x2'))(_0x418a('0x3'));var moment=require(_0x418a('0x4'));var BPromise=require(_0x418a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x418a('0x6'));var rimraf=require(_0x418a('0x7'));var config=require(_0x418a('0x8'));var attributes=require(_0x418a('0x9'));module[_0x418a('0xa')]=function(_0x307b49,_0x261ca8){return _0x307b49[_0x418a('0xb')](_0x418a('0xc'),attributes,{'tableName':_0x418a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcac2=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3940c7,_0x5e609d){var _0x1d6b99=function(_0x23fb1f){while(--_0x23fb1f){_0x3940c7['push'](_0x3940c7['shift']());}};_0x1d6b99(++_0x5e609d);}(_0xcac2,0x131));var _0x2cac=function(_0x25c2e9,_0x48cf71){_0x25c2e9=_0x25c2e9-0x0;var _0x4ea7b8=_0xcac2[_0x25c2e9];return _0x4ea7b8;};'use strict';var _=require('lodash');var util=require(_0x2cac('0x0'));var logger=require(_0x2cac('0x1'))('api');var moment=require(_0x2cac('0x2'));var BPromise=require(_0x2cac('0x3'));var rp=require(_0x2cac('0x4'));var fs=require('fs');var path=require(_0x2cac('0x5'));var rimraf=require(_0x2cac('0x6'));var config=require(_0x2cac('0x7'));var attributes=require(_0x2cac('0x8'));module[_0x2cac('0x9')]=function(_0x4f3c00,_0x47dcc8){return _0x4f3c00[_0x2cac('0xa')](_0x2cac('0xb'),attributes,{'tableName':_0x2cac('0xc'),'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 ec2fa37..e24eb34 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 _0x8462=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x227195,_0x2de164){var _0x599f65=function(_0x114a01){while(--_0x114a01){_0x227195['push'](_0x227195['shift']());}};_0x599f65(++_0x2de164);}(_0x8462,0x1cf));var _0x2846=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x8462[_0xbe200f];return _0x192597;};'use strict';var _=require('lodash');var util=require(_0x2846('0x0'));var moment=require('moment');var BPromise=require(_0x2846('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2846('0x2'));var db=require(_0x2846('0x3'))['db'];var utils=require(_0x2846('0x4'));var logger=require('../../config/logger')(_0x2846('0x5'));var config=require(_0x2846('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2846('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5dedbb,_0x5ac138,_0x82d6b5){return new BPromise(function(_0x96d1f4,_0xedeb5d){return client[_0x2846('0x8')](_0x5dedbb,_0x82d6b5)[_0x2846('0x9')](function(_0x178f2b){logger[_0x2846('0xa')](_0x2846('0xb'),_0x5ac138,_0x2846('0xc'));logger[_0x2846('0xd')](_0x2846('0xe'),_0x5ac138,_0x2846('0xc'),JSON[_0x2846('0xf')](_0x178f2b));if(_0x178f2b[_0x2846('0x10')]){if(_0x178f2b['error'][_0x2846('0x11')]===0x1f4){logger[_0x2846('0x10')](_0x2846('0xb'),_0x5ac138,_0x178f2b['error']['message']);return _0xedeb5d(_0x178f2b[_0x2846('0x10')]['message']);}logger[_0x2846('0x10')](_0x2846('0xb'),_0x5ac138,_0x178f2b['error'][_0x2846('0x12')]);return _0x96d1f4(_0x178f2b[_0x2846('0x10')]['message']);}else{logger['info'](_0x2846('0xb'),_0x5ac138,_0x2846('0xc'));_0x96d1f4(_0x178f2b[_0x2846('0x13')][_0x2846('0x12')]);}})[_0x2846('0x14')](function(_0xe3e473){logger['error'](_0x2846('0xb'),_0x5ac138,_0xe3e473);_0xedeb5d(_0xe3e473);});});} \ No newline at end of file +var _0x1b79=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x16cade,_0x49787d){var _0x1f9a74=function(_0x557eb8){while(--_0x557eb8){_0x16cade['push'](_0x16cade['shift']());}};_0x1f9a74(++_0x49787d);}(_0x1b79,0x135));var _0x91b7=function(_0x4919f6,_0x3d006a){_0x4919f6=_0x4919f6-0x0;var _0x56fe4e=_0x1b79[_0x4919f6];return _0x56fe4e;};'use strict';var _=require('lodash');var util=require(_0x91b7('0x0'));var moment=require(_0x91b7('0x1'));var BPromise=require(_0x91b7('0x2'));var rs=require(_0x91b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91b7('0x4'))['db'];var utils=require(_0x91b7('0x5'));var logger=require('../../config/logger')(_0x91b7('0x6'));var config=require(_0x91b7('0x7'));var jayson=require(_0x91b7('0x8'));var client=jayson[_0x91b7('0x9')][_0x91b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110137,_0x30aab4,_0x1752a7){return new BPromise(function(_0x126c62,_0x3d5acb){return client[_0x91b7('0xb')](_0x110137,_0x1752a7)[_0x91b7('0xc')](function(_0x5d6316){logger['info'](_0x91b7('0xd'),_0x30aab4,_0x91b7('0xe'));logger[_0x91b7('0xf')](_0x91b7('0x10'),_0x30aab4,'request\x20sent',JSON[_0x91b7('0x11')](_0x5d6316));if(_0x5d6316[_0x91b7('0x12')]){if(_0x5d6316[_0x91b7('0x12')]['code']===0x1f4){logger[_0x91b7('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x30aab4,_0x5d6316[_0x91b7('0x12')]['message']);return _0x3d5acb(_0x5d6316[_0x91b7('0x12')][_0x91b7('0x13')]);}logger[_0x91b7('0x12')](_0x91b7('0xd'),_0x30aab4,_0x5d6316[_0x91b7('0x12')][_0x91b7('0x13')]);return _0x126c62(_0x5d6316[_0x91b7('0x12')]['message']);}else{logger[_0x91b7('0x14')]('VtigerConfiguration,\x20%s,\x20%s',_0x30aab4,_0x91b7('0xe'));_0x126c62(_0x5d6316[_0x91b7('0x15')][_0x91b7('0x13')]);}})[_0x91b7('0x16')](function(_0x5810c7){logger[_0x91b7('0x12')](_0x91b7('0xd'),_0x30aab4,_0x5810c7);_0x3d5acb(_0x5810c7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 34054b2..3195b66 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 _0x3fa9=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','path','express'];(function(_0x2b8bbe,_0x37eb6a){var _0x1bb210=function(_0x116173){while(--_0x116173){_0x2b8bbe['push'](_0x2b8bbe['shift']());}};_0x1bb210(++_0x37eb6a);}(_0x3fa9,0x185));var _0x93fa=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x3fa9[_0x2763f2];return _0x3ef471;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x93fa('0x0'));var timeout=require('connect-timeout');var express=require(_0x93fa('0x1'));var router=express[_0x93fa('0x2')]();var fs_extra=require(_0x93fa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x93fa('0x4'));var config=require(_0x93fa('0x5'));var controller=require(_0x93fa('0x6'));router[_0x93fa('0x7')]('/',auth[_0x93fa('0x8')](),controller[_0x93fa('0x9')]);router[_0x93fa('0x7')](_0x93fa('0xa'),auth[_0x93fa('0x8')](),controller[_0x93fa('0xb')]);router[_0x93fa('0xc')]('/',auth[_0x93fa('0x8')](),controller[_0x93fa('0xd')]);router[_0x93fa('0xe')](_0x93fa('0xa'),auth[_0x93fa('0x8')](),controller['update']);router['delete'](_0x93fa('0xa'),auth[_0x93fa('0x8')](),controller[_0x93fa('0xf')]);module[_0x93fa('0x10')]=router; \ No newline at end of file +var _0x4a0d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','util','path'];(function(_0x2e235e,_0x494a1e){var _0x5dbd3b=function(_0x95a9c8){while(--_0x95a9c8){_0x2e235e['push'](_0x2e235e['shift']());}};_0x5dbd3b(++_0x494a1e);}(_0x4a0d,0xa9));var _0xd4a0=function(_0x3b154f,_0x14fd22){_0x3b154f=_0x3b154f-0x0;var _0xe53d42=_0x4a0d[_0x3b154f];return _0xe53d42;};'use strict';var multer=require('multer');var util=require(_0xd4a0('0x0'));var path=require(_0xd4a0('0x1'));var timeout=require(_0xd4a0('0x2'));var express=require(_0xd4a0('0x3'));var router=express[_0xd4a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd4a0('0x5'));var interaction=require(_0xd4a0('0x6'));var config=require('../../config/environment');var controller=require(_0xd4a0('0x7'));router[_0xd4a0('0x8')]('/',auth[_0xd4a0('0x9')](),controller[_0xd4a0('0xa')]);router['get']('/:id',auth[_0xd4a0('0x9')](),controller[_0xd4a0('0xb')]);router[_0xd4a0('0xc')]('/',auth[_0xd4a0('0x9')](),controller[_0xd4a0('0xd')]);router[_0xd4a0('0xe')](_0xd4a0('0xf'),auth[_0xd4a0('0x9')](),controller[_0xd4a0('0x10')]);router[_0xd4a0('0x11')](_0xd4a0('0xf'),auth[_0xd4a0('0x9')](),controller['destroy']);module[_0xd4a0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e3e2a01..89cf937 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 _0xca49=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','string'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xca49,0xf1));var _0x9ca4=function(_0x4b3e49,_0x9e566c){_0x4b3e49=_0x4b3e49-0x0;var _0x57e339=_0xca49[_0x4b3e49];return _0x57e339;};'use strict';var Sequelize=require(_0x9ca4('0x0'));module[_0x9ca4('0x1')]={'type':{'type':Sequelize[_0x9ca4('0x2')]('string',_0x9ca4('0x3'),_0x9ca4('0x4'),_0x9ca4('0x5'),'picklist'),'defaultValue':_0x9ca4('0x6')},'content':{'type':Sequelize[_0x9ca4('0x7')]},'key':{'type':Sequelize[_0x9ca4('0x7')]},'keyType':{'type':Sequelize[_0x9ca4('0x2')]('string',_0x9ca4('0x3'),_0x9ca4('0x4'))},'keyContent':{'type':Sequelize[_0x9ca4('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9ca4('0x7')]}}; \ No newline at end of file +var _0x95f0=['picklist','string','STRING','sequelize','exports','ENUM','variable','customVariable'];(function(_0x112d43,_0x3dafc1){var _0x3373be=function(_0x5017e7){while(--_0x5017e7){_0x112d43['push'](_0x112d43['shift']());}};_0x3373be(++_0x3dafc1);}(_0x95f0,0x13b));var _0x095f=function(_0x51cec1,_0xedcd67){_0x51cec1=_0x51cec1-0x0;var _0x916b8d=_0x95f0[_0x51cec1];return _0x916b8d;};'use strict';var Sequelize=require(_0x095f('0x0'));module[_0x095f('0x1')]={'type':{'type':Sequelize[_0x095f('0x2')]('string',_0x095f('0x3'),_0x095f('0x4'),'keyValue',_0x095f('0x5')),'defaultValue':_0x095f('0x6')},'content':{'type':Sequelize[_0x095f('0x7')]},'key':{'type':Sequelize[_0x095f('0x7')]},'keyType':{'type':Sequelize[_0x095f('0x2')](_0x095f('0x6'),_0x095f('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x095f('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x095f('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x095f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 3d68030..5b39cf1 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 _0xf9a8=['api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','stack','send','map','VtigerField','rawAttributes','fieldName','type','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','params','keys','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','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(_0x4fd687,_0x39f88b){var _0x28754a=function(_0x43efc2){while(--_0x43efc2){_0x4fd687['push'](_0x4fd687['shift']());}};_0x28754a(++_0x39f88b);}(_0xf9a8,0x199));var _0x8f9a=function(_0x4c3081,_0x1490e6){_0x4c3081=_0x4c3081-0x0;var _0x5ae224=_0xf9a8[_0x4c3081];return _0x5ae224;};'use strict';var emlformat=require(_0x8f9a('0x0'));var rimraf=require(_0x8f9a('0x1'));var zipdir=require(_0x8f9a('0x2'));var jsonpatch=require(_0x8f9a('0x3'));var rp=require('request-promise');var moment=require(_0x8f9a('0x4'));var BPromise=require(_0x8f9a('0x5'));var Mustache=require(_0x8f9a('0x6'));var util=require(_0x8f9a('0x7'));var path=require(_0x8f9a('0x8'));var sox=require(_0x8f9a('0x9'));var csv=require(_0x8f9a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f9a('0xb'));var _=require(_0x8f9a('0xc'));var squel=require('squel');var crypto=require(_0x8f9a('0xd'));var jsforce=require(_0x8f9a('0xe'));var deskjs=require(_0x8f9a('0xf'));var toCsv=require(_0x8f9a('0xa'));var querystring=require(_0x8f9a('0x10'));var Papa=require(_0x8f9a('0x11'));var Redis=require(_0x8f9a('0x12'));var authService=require(_0x8f9a('0x13'));var qs=require(_0x8f9a('0x14'));var as=require(_0x8f9a('0x15'));var hardwareService=require(_0x8f9a('0x16'));var logger=require('../../config/logger')(_0x8f9a('0x17'));var utils=require('../../config/utils');var config=require(_0x8f9a('0x18'));var licenseUtil=require(_0x8f9a('0x19'));var db=require(_0x8f9a('0x1a'))['db'];function respondWithStatusCode(_0x191100,_0x4c144c){_0x4c144c=_0x4c144c||0xcc;return function(_0x18fd7b){if(_0x18fd7b){return _0x191100[_0x8f9a('0x1b')](_0x4c144c);}return _0x191100[_0x8f9a('0x1c')](_0x4c144c)[_0x8f9a('0x1d')]();};}function respondWithResult(_0x4363e7,_0x14b93e){_0x14b93e=_0x14b93e||0xc8;return function(_0x63f89c){if(_0x63f89c){return _0x4363e7['status'](_0x14b93e)[_0x8f9a('0x1e')](_0x63f89c);}};}function respondWithFilteredResult(_0x1bcf92,_0x1fbd0e){return function(_0x2a252b){if(_0x2a252b){var _0x119317=typeof _0x1fbd0e[_0x8f9a('0x1f')]==='undefined'&&typeof _0x1fbd0e[_0x8f9a('0x20')]===_0x8f9a('0x21');var _0x4ea38e=_0x2a252b[_0x8f9a('0x22')];var _0x1c2999=_0x119317?0x0:_0x1fbd0e['offset'];var _0x26459e=_0x119317?_0x2a252b[_0x8f9a('0x22')]:_0x1fbd0e[_0x8f9a('0x1f')]+_0x1fbd0e['limit'];var _0x12a332;if(_0x26459e>=_0x4ea38e){_0x26459e=_0x4ea38e;_0x12a332=0xc8;}else{_0x12a332=0xce;}_0x1bcf92[_0x8f9a('0x1c')](_0x12a332);return _0x1bcf92[_0x8f9a('0x23')]('Content-Range',_0x1c2999+'-'+_0x26459e+'/'+_0x4ea38e)['json'](_0x2a252b);}return null;};}function patchUpdates(_0x385cdb){return function(_0x26695e){try{jsonpatch['apply'](_0x26695e,_0x385cdb,!![]);}catch(_0x320184){return BPromise[_0x8f9a('0x24')](_0x320184);}return _0x26695e[_0x8f9a('0x25')]();};}function saveUpdates(_0x1dab92,_0x7f7bd3){return function(_0x3acd7f){if(_0x3acd7f){return _0x3acd7f[_0x8f9a('0x26')](_0x1dab92)[_0x8f9a('0x27')](function(_0x57f4e3){return _0x57f4e3;});}return null;};}function removeEntity(_0x174059,_0xeb111e){return function(_0x12b6d1){if(_0x12b6d1){return _0x12b6d1[_0x8f9a('0x28')]()[_0x8f9a('0x27')](function(){_0x174059[_0x8f9a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519eac,_0xefdbc3){return function(_0x5a8033){if(!_0x5a8033){_0x519eac[_0x8f9a('0x1b')](0x194);}return _0x5a8033;};}function handleError(_0x73e792,_0x1e4031){_0x1e4031=_0x1e4031||0x1f4;return function(_0x5b4ff3){logger['error'](_0x5b4ff3[_0x8f9a('0x29')]);if(_0x5b4ff3['name']){delete _0x5b4ff3['name'];}_0x73e792[_0x8f9a('0x1c')](_0x1e4031)[_0x8f9a('0x2a')](_0x5b4ff3);};}exports['index']=function(_0x3a522b,_0x23a99f){var _0x446022={},_0x4bc46e={},_0x48c66b={'count':0x0,'rows':[]};var _0x338e65=_[_0x8f9a('0x2b')](db[_0x8f9a('0x2c')][_0x8f9a('0x2d')],function(_0x42e80b){return{'name':_0x42e80b[_0x8f9a('0x2e')],'type':_0x42e80b[_0x8f9a('0x2f')]['key']};});_0x4bc46e['model']=_[_0x8f9a('0x2b')](_0x338e65,_0x8f9a('0x30'));_0x4bc46e[_0x8f9a('0x31')]=_['keys'](_0x3a522b['query']);_0x4bc46e[_0x8f9a('0x32')]=_[_0x8f9a('0x33')](_0x4bc46e[_0x8f9a('0x34')],_0x4bc46e[_0x8f9a('0x31')]);_0x446022['attributes']=_[_0x8f9a('0x33')](_0x4bc46e['model'],qs[_0x8f9a('0x35')](_0x3a522b[_0x8f9a('0x31')]['fields']));_0x446022[_0x8f9a('0x36')]=_0x446022[_0x8f9a('0x36')]['length']?_0x446022['attributes']:_0x4bc46e['model'];if(!_0x3a522b['query'][_0x8f9a('0x37')]('nolimit')){_0x446022[_0x8f9a('0x20')]=qs[_0x8f9a('0x20')](_0x3a522b['query'][_0x8f9a('0x20')]);_0x446022[_0x8f9a('0x1f')]=qs[_0x8f9a('0x1f')](_0x3a522b[_0x8f9a('0x31')][_0x8f9a('0x1f')]);}_0x446022['order']=qs[_0x8f9a('0x38')](_0x3a522b[_0x8f9a('0x31')][_0x8f9a('0x38')]);_0x446022['where']=qs[_0x8f9a('0x32')](_[_0x8f9a('0x39')](_0x3a522b['query'],_0x4bc46e[_0x8f9a('0x32')]),_0x338e65);if(_0x3a522b['query'][_0x8f9a('0x3a')]){_0x446022[_0x8f9a('0x3b')]=_['merge'](_0x446022['where'],{'$or':_[_0x8f9a('0x2b')](_0x338e65,function(_0x4d66a6){if(_0x4d66a6[_0x8f9a('0x2f')]!=='VIRTUAL'){var _0x5c30aa={};_0x5c30aa[_0x4d66a6[_0x8f9a('0x30')]]={'$like':'%'+_0x3a522b[_0x8f9a('0x31')][_0x8f9a('0x3a')]+'%'};return _0x5c30aa;}})});}_0x446022=_['merge']({},_0x446022,_0x3a522b[_0x8f9a('0x3c')]);var _0x447b5b={'where':_0x446022[_0x8f9a('0x3b')]};return db[_0x8f9a('0x2c')]['count'](_0x447b5b)['then'](function(_0x2e3855){_0x48c66b['count']=_0x2e3855;if(_0x3a522b[_0x8f9a('0x31')][_0x8f9a('0x3d')]){_0x446022[_0x8f9a('0x3e')]=[{'all':!![]}];}return db[_0x8f9a('0x2c')][_0x8f9a('0x3f')](_0x446022);})[_0x8f9a('0x27')](function(_0x5ed9f3){_0x48c66b[_0x8f9a('0x40')]=_0x5ed9f3;return _0x48c66b;})[_0x8f9a('0x27')](respondWithFilteredResult(_0x23a99f,_0x446022))[_0x8f9a('0x41')](handleError(_0x23a99f,null));};exports['show']=function(_0x3fbdbe,_0x3198bd){var _0x43fe87={'raw':!![],'where':{'id':_0x3fbdbe[_0x8f9a('0x42')]['id']}},_0x56ce7c={};_0x56ce7c[_0x8f9a('0x34')]=_[_0x8f9a('0x43')](db[_0x8f9a('0x2c')][_0x8f9a('0x2d')]);_0x56ce7c['query']=_['keys'](_0x3fbdbe[_0x8f9a('0x31')]);_0x56ce7c[_0x8f9a('0x32')]=_[_0x8f9a('0x33')](_0x56ce7c[_0x8f9a('0x34')],_0x56ce7c['query']);_0x43fe87[_0x8f9a('0x36')]=_[_0x8f9a('0x33')](_0x56ce7c[_0x8f9a('0x34')],qs[_0x8f9a('0x35')](_0x3fbdbe[_0x8f9a('0x31')][_0x8f9a('0x35')]));_0x43fe87[_0x8f9a('0x36')]=_0x43fe87[_0x8f9a('0x36')]['length']?_0x43fe87[_0x8f9a('0x36')]:_0x56ce7c['model'];if(_0x3fbdbe[_0x8f9a('0x31')][_0x8f9a('0x3d')]){_0x43fe87[_0x8f9a('0x3e')]=[{'all':!![]}];}_0x43fe87=_[_0x8f9a('0x44')]({},_0x43fe87,_0x3fbdbe[_0x8f9a('0x3c')]);return db[_0x8f9a('0x2c')]['find'](_0x43fe87)[_0x8f9a('0x27')](handleEntityNotFound(_0x3198bd,null))[_0x8f9a('0x27')](respondWithResult(_0x3198bd,null))[_0x8f9a('0x41')](handleError(_0x3198bd,null));};exports[_0x8f9a('0x45')]=function(_0x40deb3,_0xd4b52c){return db[_0x8f9a('0x2c')][_0x8f9a('0x45')](_0x40deb3['body'],{})[_0x8f9a('0x27')](respondWithResult(_0xd4b52c,0xc9))[_0x8f9a('0x41')](handleError(_0xd4b52c,null));};exports[_0x8f9a('0x26')]=function(_0x417684,_0x5ca10f){if(_0x417684[_0x8f9a('0x46')]['id']){delete _0x417684[_0x8f9a('0x46')]['id'];}return db[_0x8f9a('0x2c')][_0x8f9a('0x47')]({'where':{'id':_0x417684[_0x8f9a('0x42')]['id']}})[_0x8f9a('0x27')](handleEntityNotFound(_0x5ca10f,null))[_0x8f9a('0x27')](saveUpdates(_0x417684[_0x8f9a('0x46')],null))[_0x8f9a('0x27')](respondWithResult(_0x5ca10f,null))['catch'](handleError(_0x5ca10f,null));};exports[_0x8f9a('0x28')]=function(_0x2742be,_0x51f7e4){return db[_0x8f9a('0x2c')][_0x8f9a('0x47')]({'where':{'id':_0x2742be[_0x8f9a('0x42')]['id']}})[_0x8f9a('0x27')](handleEntityNotFound(_0x51f7e4,null))['then'](removeEntity(_0x51f7e4,null))['catch'](handleError(_0x51f7e4,null));}; \ No newline at end of file +var _0xbb80=['request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','VtigerField','includeAll','findAll','rows','catch','show','params','keys','include','options','create','body','find','eml-format','rimraf','fast-json-patch'];(function(_0x4c55b0,_0x49bc17){var _0x4f94ab=function(_0x43f7a1){while(--_0x43f7a1){_0x4c55b0['push'](_0x4c55b0['shift']());}};_0x4f94ab(++_0x49bc17);}(_0xbb80,0xc3));var _0x0bb8=function(_0x583eca,_0x2e0211){_0x583eca=_0x583eca-0x0;var _0x2bcd31=_0xbb80[_0x583eca];return _0x2bcd31;};'use strict';var emlformat=require(_0x0bb8('0x0'));var rimraf=require(_0x0bb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bb8('0x2'));var rp=require(_0x0bb8('0x3'));var moment=require(_0x0bb8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0bb8('0x5'));var csv=require(_0x0bb8('0x6'));var ejs=require(_0x0bb8('0x7'));var fs=require('fs');var fs_extra=require(_0x0bb8('0x8'));var _=require(_0x0bb8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bb8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0bb8('0x6'));var querystring=require(_0x0bb8('0xb'));var Papa=require(_0x0bb8('0xc'));var Redis=require('ioredis');var authService=require(_0x0bb8('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0bb8('0xe'));var hardwareService=require(_0x0bb8('0xf'));var logger=require(_0x0bb8('0x10'))(_0x0bb8('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0bb8('0x12'))['db'];function respondWithStatusCode(_0x421e6e,_0x39a67d){_0x39a67d=_0x39a67d||0xcc;return function(_0xeec256){if(_0xeec256){return _0x421e6e[_0x0bb8('0x13')](_0x39a67d);}return _0x421e6e[_0x0bb8('0x14')](_0x39a67d)[_0x0bb8('0x15')]();};}function respondWithResult(_0x356204,_0x4b22a8){_0x4b22a8=_0x4b22a8||0xc8;return function(_0x218b45){if(_0x218b45){return _0x356204[_0x0bb8('0x14')](_0x4b22a8)[_0x0bb8('0x16')](_0x218b45);}};}function respondWithFilteredResult(_0x269d1a,_0x5d9618){return function(_0x2d3548){if(_0x2d3548){var _0x2d4bd2=typeof _0x5d9618[_0x0bb8('0x17')]===_0x0bb8('0x18')&&typeof _0x5d9618[_0x0bb8('0x19')]===_0x0bb8('0x18');var _0xe526d=_0x2d3548[_0x0bb8('0x1a')];var _0x36a5d0=_0x2d4bd2?0x0:_0x5d9618[_0x0bb8('0x17')];var _0x151442=_0x2d4bd2?_0x2d3548['count']:_0x5d9618[_0x0bb8('0x17')]+_0x5d9618[_0x0bb8('0x19')];var _0x45b01c;if(_0x151442>=_0xe526d){_0x151442=_0xe526d;_0x45b01c=0xc8;}else{_0x45b01c=0xce;}_0x269d1a['status'](_0x45b01c);return _0x269d1a['set'](_0x0bb8('0x1b'),_0x36a5d0+'-'+_0x151442+'/'+_0xe526d)[_0x0bb8('0x16')](_0x2d3548);}return null;};}function patchUpdates(_0x1e3d6c){return function(_0x17a9ac){try{jsonpatch['apply'](_0x17a9ac,_0x1e3d6c,!![]);}catch(_0x1459c3){return BPromise['reject'](_0x1459c3);}return _0x17a9ac[_0x0bb8('0x1c')]();};}function saveUpdates(_0x13a0b9,_0x443cb5){return function(_0x46504d){if(_0x46504d){return _0x46504d[_0x0bb8('0x1d')](_0x13a0b9)[_0x0bb8('0x1e')](function(_0x2d03a8){return _0x2d03a8;});}return null;};}function removeEntity(_0x5f55ac,_0x336ea2){return function(_0x9a3500){if(_0x9a3500){return _0x9a3500[_0x0bb8('0x1f')]()[_0x0bb8('0x1e')](function(){_0x5f55ac[_0x0bb8('0x14')](0xcc)[_0x0bb8('0x15')]();});}};}function handleEntityNotFound(_0x1baed8,_0x3c9426){return function(_0x1a5ea4){if(!_0x1a5ea4){_0x1baed8['sendStatus'](0x194);}return _0x1a5ea4;};}function handleError(_0x554efd,_0x559b52){_0x559b52=_0x559b52||0x1f4;return function(_0xaa4e81){logger['error'](_0xaa4e81['stack']);if(_0xaa4e81['name']){delete _0xaa4e81[_0x0bb8('0x20')];}_0x554efd[_0x0bb8('0x14')](_0x559b52)[_0x0bb8('0x21')](_0xaa4e81);};}exports[_0x0bb8('0x22')]=function(_0x306066,_0x4f70f5){var _0x8ea433={},_0x4db4d0={},_0x352e15={'count':0x0,'rows':[]};var _0xd33bb2=_['map'](db['VtigerField'][_0x0bb8('0x23')],function(_0x2f60a5){return{'name':_0x2f60a5[_0x0bb8('0x24')],'type':_0x2f60a5[_0x0bb8('0x25')][_0x0bb8('0x26')]};});_0x4db4d0['model']=_['map'](_0xd33bb2,'name');_0x4db4d0['query']=_['keys'](_0x306066[_0x0bb8('0x27')]);_0x4db4d0[_0x0bb8('0x28')]=_[_0x0bb8('0x29')](_0x4db4d0[_0x0bb8('0x2a')],_0x4db4d0['query']);_0x8ea433['attributes']=_[_0x0bb8('0x29')](_0x4db4d0[_0x0bb8('0x2a')],qs[_0x0bb8('0x2b')](_0x306066[_0x0bb8('0x27')][_0x0bb8('0x2b')]));_0x8ea433[_0x0bb8('0x2c')]=_0x8ea433[_0x0bb8('0x2c')][_0x0bb8('0x2d')]?_0x8ea433['attributes']:_0x4db4d0['model'];if(!_0x306066['query'][_0x0bb8('0x2e')]('nolimit')){_0x8ea433[_0x0bb8('0x19')]=qs[_0x0bb8('0x19')](_0x306066[_0x0bb8('0x27')][_0x0bb8('0x19')]);_0x8ea433[_0x0bb8('0x17')]=qs['offset'](_0x306066[_0x0bb8('0x27')][_0x0bb8('0x17')]);}_0x8ea433[_0x0bb8('0x2f')]=qs['sort'](_0x306066[_0x0bb8('0x27')][_0x0bb8('0x30')]);_0x8ea433['where']=qs['filters'](_['pick'](_0x306066[_0x0bb8('0x27')],_0x4db4d0[_0x0bb8('0x28')]),_0xd33bb2);if(_0x306066[_0x0bb8('0x27')]['filter']){_0x8ea433['where']=_['merge'](_0x8ea433[_0x0bb8('0x31')],{'$or':_['map'](_0xd33bb2,function(_0x58dbc2){if(_0x58dbc2[_0x0bb8('0x25')]!==_0x0bb8('0x32')){var _0x493a44={};_0x493a44[_0x58dbc2[_0x0bb8('0x20')]]={'$like':'%'+_0x306066[_0x0bb8('0x27')][_0x0bb8('0x33')]+'%'};return _0x493a44;}})});}_0x8ea433=_[_0x0bb8('0x34')]({},_0x8ea433,_0x306066['options']);var _0x2376dc={'where':_0x8ea433[_0x0bb8('0x31')]};return db[_0x0bb8('0x35')][_0x0bb8('0x1a')](_0x2376dc)[_0x0bb8('0x1e')](function(_0x4350ce){_0x352e15[_0x0bb8('0x1a')]=_0x4350ce;if(_0x306066[_0x0bb8('0x27')][_0x0bb8('0x36')]){_0x8ea433['include']=[{'all':!![]}];}return db[_0x0bb8('0x35')][_0x0bb8('0x37')](_0x8ea433);})[_0x0bb8('0x1e')](function(_0x4b11d5){_0x352e15[_0x0bb8('0x38')]=_0x4b11d5;return _0x352e15;})[_0x0bb8('0x1e')](respondWithFilteredResult(_0x4f70f5,_0x8ea433))[_0x0bb8('0x39')](handleError(_0x4f70f5,null));};exports[_0x0bb8('0x3a')]=function(_0x2c5fdb,_0x5514ee){var _0x400afa={'raw':!![],'where':{'id':_0x2c5fdb[_0x0bb8('0x3b')]['id']}},_0x1815da={};_0x1815da[_0x0bb8('0x2a')]=_[_0x0bb8('0x3c')](db['VtigerField']['rawAttributes']);_0x1815da['query']=_[_0x0bb8('0x3c')](_0x2c5fdb[_0x0bb8('0x27')]);_0x1815da[_0x0bb8('0x28')]=_[_0x0bb8('0x29')](_0x1815da['model'],_0x1815da[_0x0bb8('0x27')]);_0x400afa['attributes']=_[_0x0bb8('0x29')](_0x1815da['model'],qs[_0x0bb8('0x2b')](_0x2c5fdb[_0x0bb8('0x27')][_0x0bb8('0x2b')]));_0x400afa[_0x0bb8('0x2c')]=_0x400afa['attributes'][_0x0bb8('0x2d')]?_0x400afa[_0x0bb8('0x2c')]:_0x1815da[_0x0bb8('0x2a')];if(_0x2c5fdb[_0x0bb8('0x27')]['includeAll']){_0x400afa[_0x0bb8('0x3d')]=[{'all':!![]}];}_0x400afa=_['merge']({},_0x400afa,_0x2c5fdb[_0x0bb8('0x3e')]);return db[_0x0bb8('0x35')]['find'](_0x400afa)[_0x0bb8('0x1e')](handleEntityNotFound(_0x5514ee,null))[_0x0bb8('0x1e')](respondWithResult(_0x5514ee,null))[_0x0bb8('0x39')](handleError(_0x5514ee,null));};exports['create']=function(_0xf21669,_0x32f919){return db[_0x0bb8('0x35')][_0x0bb8('0x3f')](_0xf21669[_0x0bb8('0x40')],{})['then'](respondWithResult(_0x32f919,0xc9))[_0x0bb8('0x39')](handleError(_0x32f919,null));};exports[_0x0bb8('0x1d')]=function(_0x398f46,_0x5bedba){if(_0x398f46[_0x0bb8('0x40')]['id']){delete _0x398f46[_0x0bb8('0x40')]['id'];}return db[_0x0bb8('0x35')]['find']({'where':{'id':_0x398f46['params']['id']}})[_0x0bb8('0x1e')](handleEntityNotFound(_0x5bedba,null))[_0x0bb8('0x1e')](saveUpdates(_0x398f46['body'],null))[_0x0bb8('0x1e')](respondWithResult(_0x5bedba,null))[_0x0bb8('0x39')](handleError(_0x5bedba,null));};exports['destroy']=function(_0x44f44b,_0x46e855){return db[_0x0bb8('0x35')][_0x0bb8('0x41')]({'where':{'id':_0x44f44b['params']['id']}})[_0x0bb8('0x1e')](handleEntityNotFound(_0x46e855,null))[_0x0bb8('0x1e')](removeEntity(_0x46e855,null))[_0x0bb8('0x39')](handleError(_0x46e855,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 058b809..4b74ebf 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 _0xd710=['util','api','moment','request-promise','path','rimraf','../../config/environment','define','VtigerField','vtiger_unique_index','idField','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd710,0x14f));var _0x0d71=function(_0x2a70a4,_0x4797f2){_0x2a70a4=_0x2a70a4-0x0;var _0x490fd9=_0xd710[_0x2a70a4];return _0x490fd9;};'use strict';var _=require(_0x0d71('0x0'));var util=require(_0x0d71('0x1'));var logger=require('../../config/logger')(_0x0d71('0x2'));var moment=require(_0x0d71('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d71('0x4'));var fs=require('fs');var path=require(_0x0d71('0x5'));var rimraf=require(_0x0d71('0x6'));var config=require(_0x0d71('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x54615b,_0x594f90){return _0x54615b[_0x0d71('0x8')](_0x0d71('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x0d71('0xa'),'fields':[_0x0d71('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf14b=['bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash','../../config/logger','moment'];(function(_0x531d80,_0x530508){var _0x222b7d=function(_0x122cd0){while(--_0x122cd0){_0x531d80['push'](_0x531d80['shift']());}};_0x222b7d(++_0x530508);}(_0xf14b,0x17d));var _0xbf14=function(_0x2382b7,_0x271ef2){_0x2382b7=_0x2382b7-0x0;var _0x4ea157=_0xf14b[_0x2382b7];return _0x4ea157;};'use strict';var _=require(_0xbf14('0x0'));var util=require('util');var logger=require(_0xbf14('0x1'))('api');var moment=require(_0xbf14('0x2'));var BPromise=require(_0xbf14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf14('0x4'));var rimraf=require(_0xbf14('0x5'));var config=require(_0xbf14('0x6'));var attributes=require(_0xbf14('0x7'));module['exports']=function(_0x589ede,_0x4a80a0){return _0x589ede['define'](_0xbf14('0x8'),attributes,{'tableName':_0xbf14('0x9'),'paranoid':![],'indexes':[{'name':_0xbf14('0xa'),'fields':['idField',_0xbf14('0xb')],'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 dd1028f..acf0838 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 _0x37e2=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result'];(function(_0x15a954,_0x2b822a){var _0x3c0627=function(_0x4a7ea7){while(--_0x4a7ea7){_0x15a954['push'](_0x15a954['shift']());}};_0x3c0627(++_0x2b822a);}(_0x37e2,0x135));var _0x237e=function(_0x10b5fe,_0x8c1204){_0x10b5fe=_0x10b5fe-0x0;var _0x26ed80=_0x37e2[_0x10b5fe];return _0x26ed80;};'use strict';var _=require(_0x237e('0x0'));var util=require(_0x237e('0x1'));var moment=require(_0x237e('0x2'));var BPromise=require('bluebird');var rs=require(_0x237e('0x3'));var fs=require('fs');var Redis=require(_0x237e('0x4'));var db=require(_0x237e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x237e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x237e('0x7')][_0x237e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc30b8a,_0x218e6d,_0x2cba76){return new BPromise(function(_0x205d55,_0x23e5b){return client[_0x237e('0x9')](_0xc30b8a,_0x2cba76)[_0x237e('0xa')](function(_0x345783){logger[_0x237e('0xb')]('VtigerField,\x20%s,\x20%s',_0x218e6d,_0x237e('0xc'));logger[_0x237e('0xd')](_0x237e('0xe'),_0x218e6d,_0x237e('0xc'),JSON[_0x237e('0xf')](_0x345783));if(_0x345783['error']){if(_0x345783[_0x237e('0x10')][_0x237e('0x11')]===0x1f4){logger[_0x237e('0x10')](_0x237e('0x12'),_0x218e6d,_0x345783[_0x237e('0x10')][_0x237e('0x13')]);return _0x23e5b(_0x345783['error']['message']);}logger[_0x237e('0x10')](_0x237e('0x12'),_0x218e6d,_0x345783[_0x237e('0x10')]['message']);return _0x205d55(_0x345783['error'][_0x237e('0x13')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x218e6d,_0x237e('0xc'));_0x205d55(_0x345783[_0x237e('0x14')][_0x237e('0x13')]);}})[_0x237e('0x15')](function(_0x4f189e){logger['error'](_0x237e('0x12'),_0x218e6d,_0x4f189e);_0x23e5b(_0x4f189e);});});} \ No newline at end of file +var _0x6a27=['../../config/logger','rpc','jayson/promise','client','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4d1b6e,_0xbcedc6){var _0x2c9234=function(_0x4fa9ca){while(--_0x4fa9ca){_0x4d1b6e['push'](_0x4d1b6e['shift']());}};_0x2c9234(++_0xbcedc6);}(_0x6a27,0x152));var _0x76a2=function(_0xb4ec3a,_0x2bace0){_0xb4ec3a=_0xb4ec3a-0x0;var _0x1b83db=_0x6a27[_0xb4ec3a];return _0x1b83db;};'use strict';var _=require(_0x76a2('0x0'));var util=require(_0x76a2('0x1'));var moment=require(_0x76a2('0x2'));var BPromise=require(_0x76a2('0x3'));var rs=require(_0x76a2('0x4'));var fs=require('fs');var Redis=require(_0x76a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x76a2('0x6'));var logger=require(_0x76a2('0x7'))(_0x76a2('0x8'));var config=require('../../config/environment');var jayson=require(_0x76a2('0x9'));var client=jayson[_0x76a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44753c,_0x34225c,_0x38e5a3){return new BPromise(function(_0x126ba9,_0x3c1dcc){return client[_0x76a2('0xb')](_0x44753c,_0x38e5a3)['then'](function(_0xef6c6a){logger[_0x76a2('0xc')](_0x76a2('0xd'),_0x34225c,_0x76a2('0xe'));logger[_0x76a2('0xf')](_0x76a2('0x10'),_0x34225c,_0x76a2('0xe'),JSON[_0x76a2('0x11')](_0xef6c6a));if(_0xef6c6a[_0x76a2('0x12')]){if(_0xef6c6a[_0x76a2('0x12')][_0x76a2('0x13')]===0x1f4){logger[_0x76a2('0x12')](_0x76a2('0xd'),_0x34225c,_0xef6c6a['error'][_0x76a2('0x14')]);return _0x3c1dcc(_0xef6c6a['error'][_0x76a2('0x14')]);}logger[_0x76a2('0x12')](_0x76a2('0xd'),_0x34225c,_0xef6c6a[_0x76a2('0x12')]['message']);return _0x126ba9(_0xef6c6a['error'][_0x76a2('0x14')]);}else{logger['info'](_0x76a2('0xd'),_0x34225c,_0x76a2('0xe'));_0x126ba9(_0xef6c6a[_0x76a2('0x15')][_0x76a2('0x14')]);}})[_0x76a2('0x16')](function(_0x56327e){logger[_0x76a2('0x12')](_0x76a2('0xd'),_0x34225c,_0x56327e);_0x3c1dcc(_0x56327e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 6a3aeda..3eddd3b 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 _0x648b=['exports','multer','util','Router','fs-extra','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','put','delete','destroy'];(function(_0xfd01c5,_0x11fcf7){var _0x3c9b1a=function(_0x2c00aa){while(--_0x2c00aa){_0xfd01c5['push'](_0xfd01c5['shift']());}};_0x3c9b1a(++_0x11fcf7);}(_0x648b,0x73));var _0xb648=function(_0x47a2d6,_0x21ae03){_0x47a2d6=_0x47a2d6-0x0;var _0x474128=_0x648b[_0x47a2d6];return _0x474128;};'use strict';var multer=require(_0xb648('0x0'));var util=require(_0xb648('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb648('0x2')]();var fs_extra=require(_0xb648('0x3'));var auth=require(_0xb648('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb648('0x5'));router[_0xb648('0x6')]('/',auth[_0xb648('0x7')](),controller[_0xb648('0x8')]);router['get'](_0xb648('0x9'),auth[_0xb648('0x7')](),controller[_0xb648('0xa')]);router[_0xb648('0x6')](_0xb648('0xb'),auth[_0xb648('0x7')](),controller[_0xb648('0xc')]);router['get'](_0xb648('0xd'),auth[_0xb648('0x7')](),controller['getFields']);router['post']('/',auth[_0xb648('0x7')](),controller[_0xb648('0xe')]);router['post'](_0xb648('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb648('0xf')](_0xb648('0x9'),auth[_0xb648('0x7')](),controller['update']);router[_0xb648('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb648('0x11')]);module[_0xb648('0x12')]=router; \ No newline at end of file +var _0x6449=['show','/:id/configurations','/:id/fields','getFields','create','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6449,0x11e));var _0x9644=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x6449[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require(_0x9644('0x0'));var util=require(_0x9644('0x1'));var path=require(_0x9644('0x2'));var timeout=require(_0x9644('0x3'));var express=require('express');var router=express[_0x9644('0x4')]();var fs_extra=require(_0x9644('0x5'));var auth=require(_0x9644('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9644('0x7'));var controller=require(_0x9644('0x8'));router[_0x9644('0x9')]('/',auth[_0x9644('0xa')](),controller[_0x9644('0xb')]);router[_0x9644('0x9')](_0x9644('0xc'),auth[_0x9644('0xa')](),controller[_0x9644('0xd')]);router[_0x9644('0x9')](_0x9644('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x9644('0x9')](_0x9644('0xf'),auth['isAuthenticated'](),controller[_0x9644('0x10')]);router['post']('/',auth[_0x9644('0xa')](),controller[_0x9644('0x11')]);router[_0x9644('0x12')](_0x9644('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9644('0x13')](_0x9644('0xc'),auth[_0x9644('0xa')](),controller['update']);router[_0x9644('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9644('0x15')]);module[_0x9644('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 0aa3bcc..f85880a 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 _0x79a3=['newTab','integrationTab','sequelize','STRING','username','remoteUri','ENUM','password','token'];(function(_0x4c83c2,_0x4280f8){var _0x235506=function(_0x3f4b99){while(--_0x3f4b99){_0x4c83c2['push'](_0x4c83c2['shift']());}};_0x235506(++_0x4280f8);}(_0x79a3,0x80));var _0x379a=function(_0x2d0f1d,_0x34ea6f){_0x2d0f1d=_0x2d0f1d-0x0;var _0x42866f=_0x79a3[_0x2d0f1d];return _0x42866f;};'use strict';var Sequelize=require(_0x379a('0x0'));module['exports']={'name':{'type':Sequelize[_0x379a('0x1')]},'description':{'type':Sequelize[_0x379a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x379a('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x379a('0x3')},'authType':{'type':Sequelize[_0x379a('0x4')](_0x379a('0x5'),_0x379a('0x6')),'defaultValue':_0x379a('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x379a('0x7')),'defaultValue':_0x379a('0x8')}}; \ No newline at end of file +var _0x96fd=['newTab','exports','STRING','remoteUri','password','token','ENUM','integrationTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96fd,0x1e9));var _0xd96f=function(_0x47147e,_0x40a905){_0x47147e=_0x47147e-0x0;var _0x19673f=_0x96fd[_0x47147e];return _0x19673f;};'use strict';var Sequelize=require('sequelize');module[_0xd96f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd96f('0x1')]},'username':{'type':Sequelize[_0xd96f('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xd96f('0x1')]},'token':{'type':Sequelize[_0xd96f('0x1')]},'remoteUri':{'type':Sequelize[_0xd96f('0x1')],'unique':_0xd96f('0x2')},'authType':{'type':Sequelize['ENUM'](_0xd96f('0x3'),_0xd96f('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0xd96f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd96f('0x5')](_0xd96f('0x6'),_0xd96f('0x7')),'defaultValue':_0xd96f('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7a5fb58..3cff8ab 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 _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1c4de4,_0x5a9c2e){_0x1c4de4=_0x1c4de4-0x0;var _0x84fa29=_0xb58b[_0x1c4de4];return _0x84fa29;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});}; \ No newline at end of file +var _0xe511=['getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','ZendeskConfiguration','create','getFields','username','password','authType','remoteUri','substring','format','ticket_fields','headers','Basic\x20%s','%s:%s','toString','token','%s/token:%s','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','send','test','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','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','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','stack','index','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','ZendeskAccount','includeAll','include','findAll','catch','show','params','rawAttributes','fields','options','body','find','nolimit'];(function(_0x2440d7,_0x21820e){var _0x58bd9d=function(_0x246051){while(--_0x246051){_0x2440d7['push'](_0x2440d7['shift']());}};_0x58bd9d(++_0x21820e);}(_0xe511,0x16f));var _0x1e51=function(_0x4ce64a,_0x20363e){_0x4ce64a=_0x4ce64a-0x0;var _0xea198=_0xe511[_0x4ce64a];return _0xea198;};'use strict';var emlformat=require(_0x1e51('0x0'));var rimraf=require(_0x1e51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1e51('0x2'));var rp=require('request-promise');var moment=require(_0x1e51('0x3'));var BPromise=require(_0x1e51('0x4'));var Mustache=require('mustache');var util=require(_0x1e51('0x5'));var path=require(_0x1e51('0x6'));var sox=require(_0x1e51('0x7'));var csv=require(_0x1e51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e51('0x9'));var _=require(_0x1e51('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e51('0xb'));var deskjs=require(_0x1e51('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1e51('0xd'));var Redis=require(_0x1e51('0xe'));var authService=require(_0x1e51('0xf'));var qs=require(_0x1e51('0x10'));var as=require(_0x1e51('0x11'));var hardwareService=require(_0x1e51('0x12'));var logger=require('../../config/logger')(_0x1e51('0x13'));var utils=require(_0x1e51('0x14'));var config=require(_0x1e51('0x15'));var licenseUtil=require(_0x1e51('0x16'));var db=require(_0x1e51('0x17'))['db'];var integrations=require(_0x1e51('0x18'));function respondWithStatusCode(_0x5544eb,_0x408a77){_0x408a77=_0x408a77||0xcc;return function(_0x102f01){if(_0x102f01){return _0x5544eb[_0x1e51('0x19')](_0x408a77);}return _0x5544eb[_0x1e51('0x1a')](_0x408a77)[_0x1e51('0x1b')]();};}function respondWithResult(_0x32945d,_0x441c70){_0x441c70=_0x441c70||0xc8;return function(_0x467e77){if(_0x467e77){return _0x32945d[_0x1e51('0x1a')](_0x441c70)[_0x1e51('0x1c')](_0x467e77);}};}function respondWithFilteredResult(_0x5a5c07,_0x3b01b7){return function(_0x24db4f){if(_0x24db4f){var _0x4526b4=typeof _0x3b01b7['offset']===_0x1e51('0x1d')&&typeof _0x3b01b7['limit']==='undefined';var _0x1f6f4e=_0x24db4f[_0x1e51('0x1e')];var _0x40ae4c=_0x4526b4?0x0:_0x3b01b7[_0x1e51('0x1f')];var _0x4d1aae=_0x4526b4?_0x24db4f[_0x1e51('0x1e')]:_0x3b01b7['offset']+_0x3b01b7[_0x1e51('0x20')];var _0x4a9272;if(_0x4d1aae>=_0x1f6f4e){_0x4d1aae=_0x1f6f4e;_0x4a9272=0xc8;}else{_0x4a9272=0xce;}_0x5a5c07[_0x1e51('0x1a')](_0x4a9272);return _0x5a5c07[_0x1e51('0x21')](_0x1e51('0x22'),_0x40ae4c+'-'+_0x4d1aae+'/'+_0x1f6f4e)[_0x1e51('0x1c')](_0x24db4f);}return null;};}function patchUpdates(_0x506f40){return function(_0x5223c3){try{jsonpatch['apply'](_0x5223c3,_0x506f40,!![]);}catch(_0x548c32){return BPromise[_0x1e51('0x23')](_0x548c32);}return _0x5223c3['save']();};}function saveUpdates(_0x3f7340,_0x28aacb){return function(_0x415154){if(_0x415154){return _0x415154[_0x1e51('0x24')](_0x3f7340)[_0x1e51('0x25')](function(_0xf9298){return _0xf9298;});}return null;};}function removeEntity(_0x270adf,_0x461d3d){return function(_0x4bcdd3){if(_0x4bcdd3){return _0x4bcdd3['destroy']()[_0x1e51('0x25')](function(){_0x270adf[_0x1e51('0x1a')](0xcc)[_0x1e51('0x1b')]();});}};}function handleEntityNotFound(_0x1386db,_0x505d79){return function(_0x54d031){if(!_0x54d031){_0x1386db['sendStatus'](0x194);}return _0x54d031;};}function handleError(_0x1eb83f,_0x2a1561){_0x2a1561=_0x2a1561||0x1f4;return function(_0x433c2d){logger['error'](_0x433c2d[_0x1e51('0x26')]);if(_0x433c2d['name']){delete _0x433c2d['name'];}_0x1eb83f[_0x1e51('0x1a')](_0x2a1561)['send'](_0x433c2d);};}exports[_0x1e51('0x27')]=function(_0x1eb79f,_0x56722f){var _0x3e6ef2={},_0x10ee23={},_0x71c7af={'count':0x0,'rows':[]};var _0x6862d1=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x20eb9b){return{'name':_0x20eb9b[_0x1e51('0x28')],'type':_0x20eb9b[_0x1e51('0x29')][_0x1e51('0x2a')]};});_0x10ee23[_0x1e51('0x2b')]=_[_0x1e51('0x2c')](_0x6862d1,_0x1e51('0x2d'));_0x10ee23[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x1eb79f[_0x1e51('0x2e')]);_0x10ee23[_0x1e51('0x30')]=_['intersection'](_0x10ee23[_0x1e51('0x2b')],_0x10ee23[_0x1e51('0x2e')]);_0x3e6ef2[_0x1e51('0x31')]=_[_0x1e51('0x32')](_0x10ee23[_0x1e51('0x2b')],qs['fields'](_0x1eb79f[_0x1e51('0x2e')]['fields']));_0x3e6ef2[_0x1e51('0x31')]=_0x3e6ef2[_0x1e51('0x31')][_0x1e51('0x33')]?_0x3e6ef2['attributes']:_0x10ee23[_0x1e51('0x2b')];if(!_0x1eb79f['query'][_0x1e51('0x34')]('nolimit')){_0x3e6ef2['limit']=qs[_0x1e51('0x20')](_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x20')]);_0x3e6ef2['offset']=qs[_0x1e51('0x1f')](_0x1eb79f['query'][_0x1e51('0x1f')]);}_0x3e6ef2[_0x1e51('0x35')]=qs['sort'](_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x36')]);_0x3e6ef2[_0x1e51('0x37')]=qs[_0x1e51('0x30')](_[_0x1e51('0x38')](_0x1eb79f[_0x1e51('0x2e')],_0x10ee23['filters']),_0x6862d1);if(_0x1eb79f['query'][_0x1e51('0x39')]){_0x3e6ef2['where']=_[_0x1e51('0x3a')](_0x3e6ef2[_0x1e51('0x37')],{'$or':_[_0x1e51('0x2c')](_0x6862d1,function(_0xcfa1d8){if(_0xcfa1d8[_0x1e51('0x29')]!==_0x1e51('0x3b')){var _0x845a62={};_0x845a62[_0xcfa1d8[_0x1e51('0x2d')]]={'$like':'%'+_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x39')]+'%'};return _0x845a62;}})});}_0x3e6ef2=_[_0x1e51('0x3a')]({},_0x3e6ef2,_0x1eb79f['options']);var _0x29a689={'where':_0x3e6ef2['where']};return db[_0x1e51('0x3c')][_0x1e51('0x1e')](_0x29a689)[_0x1e51('0x25')](function(_0x471386){_0x71c7af[_0x1e51('0x1e')]=_0x471386;if(_0x1eb79f[_0x1e51('0x2e')][_0x1e51('0x3d')]){_0x3e6ef2[_0x1e51('0x3e')]=[{'all':!![]}];}return db[_0x1e51('0x3c')][_0x1e51('0x3f')](_0x3e6ef2);})[_0x1e51('0x25')](function(_0x5b4b3f){_0x71c7af['rows']=_0x5b4b3f;return _0x71c7af;})[_0x1e51('0x25')](respondWithFilteredResult(_0x56722f,_0x3e6ef2))[_0x1e51('0x40')](handleError(_0x56722f,null));};exports[_0x1e51('0x41')]=function(_0x4650e4,_0x1ef3d3){var _0x1a9e0d={'raw':![],'where':{'id':_0x4650e4[_0x1e51('0x42')]['id']}},_0x25592c={};_0x25592c['model']=_[_0x1e51('0x2f')](db[_0x1e51('0x3c')][_0x1e51('0x43')]);_0x25592c[_0x1e51('0x2e')]=_[_0x1e51('0x2f')](_0x4650e4[_0x1e51('0x2e')]);_0x25592c[_0x1e51('0x30')]=_['intersection'](_0x25592c[_0x1e51('0x2b')],_0x25592c[_0x1e51('0x2e')]);_0x1a9e0d['attributes']=_[_0x1e51('0x32')](_0x25592c[_0x1e51('0x2b')],qs[_0x1e51('0x44')](_0x4650e4['query'][_0x1e51('0x44')]));_0x1a9e0d[_0x1e51('0x31')]=_0x1a9e0d[_0x1e51('0x31')][_0x1e51('0x33')]?_0x1a9e0d[_0x1e51('0x31')]:_0x25592c[_0x1e51('0x2b')];if(_0x4650e4[_0x1e51('0x2e')][_0x1e51('0x3d')]){_0x1a9e0d[_0x1e51('0x3e')]=[{'all':!![]}];}_0x1a9e0d=_['merge']({},_0x1a9e0d,_0x4650e4[_0x1e51('0x45')]);return db[_0x1e51('0x3c')]['find'](_0x1a9e0d)[_0x1e51('0x25')](handleEntityNotFound(_0x1ef3d3,null))[_0x1e51('0x25')](respondWithResult(_0x1ef3d3,null))[_0x1e51('0x40')](handleError(_0x1ef3d3,null));};exports['create']=function(_0x44468a,_0x4634de){return db[_0x1e51('0x3c')]['create'](_0x44468a[_0x1e51('0x46')],{})['then'](respondWithResult(_0x4634de,0xc9))['catch'](handleError(_0x4634de,null));};exports['update']=function(_0x169e6c,_0x2e79ca){if(_0x169e6c['body']['id']){delete _0x169e6c['body']['id'];}return db[_0x1e51('0x3c')][_0x1e51('0x47')]({'where':{'id':_0x169e6c[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x2e79ca,null))[_0x1e51('0x25')](saveUpdates(_0x169e6c[_0x1e51('0x46')],null))['then'](respondWithResult(_0x2e79ca,null))[_0x1e51('0x40')](handleError(_0x2e79ca,null));};exports['destroy']=function(_0xf6bd35,_0x43589a){return db['ZendeskAccount']['find']({'where':{'id':_0xf6bd35['params']['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x43589a,null))[_0x1e51('0x25')](removeEntity(_0x43589a,null))[_0x1e51('0x40')](handleError(_0x43589a,null));};exports['getConfigurations']=function(_0x2fdee1,_0x1fe669,_0x4226da){var _0x2100d4={};var _0x1ccb55={};var _0x12584c;var _0x32fe1f;return db[_0x1e51('0x3c')]['findOne']({'where':{'id':_0x2fdee1[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x1fe669,null))[_0x1e51('0x25')](function(_0x213edb){if(_0x213edb){_0x12584c=_0x213edb;_0x1ccb55[_0x1e51('0x2b')]=_[_0x1e51('0x2f')](db['ZendeskConfiguration'][_0x1e51('0x43')]);_0x1ccb55['query']=_['keys'](_0x2fdee1['query']);_0x1ccb55[_0x1e51('0x30')]=_[_0x1e51('0x32')](_0x1ccb55[_0x1e51('0x2b')],_0x1ccb55['query']);_0x2100d4[_0x1e51('0x31')]=_[_0x1e51('0x32')](_0x1ccb55[_0x1e51('0x2b')],qs['fields'](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x44')]));_0x2100d4[_0x1e51('0x31')]=_0x2100d4['attributes'][_0x1e51('0x33')]?_0x2100d4[_0x1e51('0x31')]:_0x1ccb55[_0x1e51('0x2b')];_0x2100d4[_0x1e51('0x35')]=qs[_0x1e51('0x36')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x36')]);_0x2100d4[_0x1e51('0x37')]=qs['filters'](_[_0x1e51('0x38')](_0x2fdee1[_0x1e51('0x2e')],_0x1ccb55['filters']));if(_0x2fdee1['query']['filter']){_0x2100d4[_0x1e51('0x37')]=_[_0x1e51('0x3a')](_0x2100d4[_0x1e51('0x37')],{'$or':_[_0x1e51('0x2c')](_0x2100d4[_0x1e51('0x31')],function(_0x3c322c){var _0x45b649={};_0x45b649[_0x3c322c]={'$like':'%'+_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x39')]+'%'};return _0x45b649;})});}_0x2100d4=_['merge']({},_0x2100d4,_0x2fdee1['options']);return _0x12584c['getConfigurations'](_0x2100d4);}})[_0x1e51('0x25')](function(_0x4048a4){if(_0x4048a4){_0x32fe1f=_0x4048a4['length'];if(!_0x2fdee1['query'][_0x1e51('0x34')](_0x1e51('0x48'))){_0x2100d4['limit']=qs[_0x1e51('0x20')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x20')]);_0x2100d4[_0x1e51('0x1f')]=qs[_0x1e51('0x1f')](_0x2fdee1[_0x1e51('0x2e')][_0x1e51('0x1f')]);}return _0x12584c[_0x1e51('0x49')](_0x2100d4);}})[_0x1e51('0x25')](function(_0x32863f){if(_0x32863f){return _0x32863f?{'count':_0x32fe1f,'rows':_0x32863f}:null;}})['then'](respondWithResult(_0x1fe669,null))[_0x1e51('0x40')](handleError(_0x1fe669,null));};exports[_0x1e51('0x4a')]=function(_0x3657a2,_0x402bbd,_0xc720e2){if(_0x3657a2[_0x1e51('0x46')]['id']){delete _0x3657a2['body']['id'];}return db['ZendeskAccount'][_0x1e51('0x4b')]({'where':{'id':_0x3657a2[_0x1e51('0x42')]['id']}})[_0x1e51('0x25')](handleEntityNotFound(_0x402bbd,null))[_0x1e51('0x25')](function(_0x52a439){if(_0x52a439){_0x3657a2['body']['AccountId']=_0x52a439['id'];_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4c')]=integrations[_0x1e51('0x4d')](_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4e')],_0x3657a2['body'][_0x1e51('0x29')]);_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4f')]=integrations['getDescriptions'](_0x3657a2[_0x1e51('0x46')][_0x1e51('0x4e')],_0x3657a2[_0x1e51('0x46')]['type']);return db[_0x1e51('0x50')][_0x1e51('0x51')](_0x3657a2['body'],{'include':[{'model':db['ZendeskField'],'as':_0x1e51('0x4c')},{'model':db['ZendeskField'],'as':_0x1e51('0x4f')}]});}return null;})['then'](respondWithResult(_0x402bbd,null))[_0x1e51('0x40')](handleError(_0x402bbd,null));};exports[_0x1e51('0x52')]=function(_0x35f12e,_0x457e4a,_0x5142ed){var _0x37f3e6='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x35f12e[_0x1e51('0x42')]['id']},'attributes':['id',_0x1e51('0x53'),_0x1e51('0x54'),'token',_0x1e51('0x55'),_0x1e51('0x56')]})[_0x1e51('0x25')](handleEntityNotFound(_0x457e4a,null))[_0x1e51('0x25')](function(_0x5b76ae){if(_0x5b76ae){_0x37f3e6=_0x5b76ae[_0x1e51('0x56')];var _0x5ef17b=_0x37f3e6['slice'](-0x1);if(_0x5ef17b==='/'){_0x37f3e6=_0x37f3e6[_0x1e51('0x57')](0x0,_0x37f3e6['lastIndexOf'](_0x5ef17b));}var _0x35ece9={'method':'GET','uri':util[_0x1e51('0x58')]('%s/%s',_0x37f3e6,_0x1e51('0x59')),'json':!![]};switch(_0x5b76ae[_0x1e51('0x55')]){case'password':_0x35ece9[_0x1e51('0x5a')]={'Authorization':util['format'](_0x1e51('0x5b'),new Buffer(util[_0x1e51('0x58')](_0x1e51('0x5c'),_0x5b76ae[_0x1e51('0x53')],_0x5b76ae[_0x1e51('0x54')]))[_0x1e51('0x5d')]('base64'))};break;case _0x1e51('0x5e'):_0x35ece9['headers']={'Authorization':util['format'](_0x1e51('0x5b'),new Buffer(util[_0x1e51('0x58')](_0x1e51('0x5f'),_0x5b76ae[_0x1e51('0x53')],_0x5b76ae[_0x1e51('0x5e')]))[_0x1e51('0x5d')](_0x1e51('0x60')))};break;default:throw new db['Sequelize'][(_0x1e51('0x61'))](_0x1e51('0x62'));}return rp(_0x35ece9);}})[_0x1e51('0x25')](function(_0x4c6920){if(_0x4c6920){var _0x4da887=[_0x1e51('0x63'),_0x1e51('0x64'),'group',_0x1e51('0x65')];_[_0x1e51('0x66')](_0x4c6920['ticket_fields'],function(_0x5eb939){return _0x4da887[_0x1e51('0x67')](_0x5eb939[_0x1e51('0x29')]);});return{'count':_0x4c6920[_0x1e51('0x59')][_0x1e51('0x33')],'rows':_[_0x1e51('0x2c')](_0x4c6920[_0x1e51('0x59')],function(_0x3718d9){return{'id':_0x3718d9['id'],'name':_0x3718d9['position']>0x7?_0x3718d9['title']:_0x3718d9[_0x1e51('0x29')],'custom':_0x3718d9[_0x1e51('0x68')]>0x7?!![]:![],'options':_0x3718d9['system_field_options']?_0x3718d9[_0x1e51('0x69')]:_0x3718d9[_0x1e51('0x6a')]?_0x3718d9['custom_field_options']:[]};})};}})[_0x1e51('0x25')](respondWithResult(_0x457e4a,null))['catch'](function(_0x34b98f){var _0x561812=_0x35f12e['query']['test']?0x1f4:_0x34b98f['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x1e51('0x52'),_0x561812,JSON['stringify'](_0x34b98f));delete _0x34b98f[_0x1e51('0x2d')];if(_0x561812===0x191){_0x561812=0x190;}_0x457e4a['status'](_0x561812)[_0x1e51('0x6b')](_0x35f12e[_0x1e51('0x2e')][_0x1e51('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x34b98f[_0x1e51('0x6d')]}:_0x34b98f);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7008f1d..80dcbd8 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 _0x897e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x3e480a,_0x563e80){var _0x27b0dd=function(_0xadc25e){while(--_0xadc25e){_0x3e480a['push'](_0x3e480a['shift']());}};_0x27b0dd(++_0x563e80);}(_0x897e,0xb3));var _0xe897=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x897e[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require(_0xe897('0x0'));var logger=require(_0xe897('0x1'))(_0xe897('0x2'));var moment=require(_0xe897('0x3'));var BPromise=require(_0xe897('0x4'));var rp=require(_0xe897('0x5'));var fs=require('fs');var path=require(_0xe897('0x6'));var rimraf=require('rimraf');var config=require(_0xe897('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xe897('0x8'));module[_0xe897('0x9')]=function(_0xf63c9d,_0x660b13){return _0xf63c9d['define'](_0xe897('0xa'),attributes,{'tableName':_0xe897('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4a9=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd4a9,0x168));var _0x9d4a=function(_0x581d64,_0x55f84a){_0x581d64=_0x581d64-0x0;var _0x3bb0bf=_0xd4a9[_0x581d64];return _0x3bb0bf;};'use strict';var _=require('lodash');var util=require(_0x9d4a('0x0'));var logger=require(_0x9d4a('0x1'))(_0x9d4a('0x2'));var moment=require(_0x9d4a('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d4a('0x4'));var fs=require('fs');var path=require(_0x9d4a('0x5'));var rimraf=require(_0x9d4a('0x6'));var config=require(_0x9d4a('0x7'));var attributes=require(_0x9d4a('0x8'));var integrations=require(_0x9d4a('0x9'));module[_0x9d4a('0xa')]=function(_0x1bc438,_0x4ebae8){return _0x1bc438['define'](_0x9d4a('0xb'),attributes,{'tableName':_0x9d4a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 9313290..fff72cc 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 _0x555d=['GetZendeskAccount','findAll','options','where','limit','map','include','model','attributes','catch','ZendeskAccount','find','raw','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x582a70,_0x590844){var _0x1b9eea=function(_0x542953){while(--_0x542953){_0x582a70['push'](_0x582a70['shift']());}};_0x1b9eea(++_0x590844);}(_0x555d,0x103));var _0xd555=function(_0x1c3c85,_0x4d5e12){_0x1c3c85=_0x1c3c85-0x0;var _0x5d504a=_0x555d[_0x1c3c85];return _0x5d504a;};'use strict';var _=require(_0xd555('0x0'));var util=require('util');var moment=require(_0xd555('0x1'));var BPromise=require(_0xd555('0x2'));var rs=require(_0xd555('0x3'));var fs=require('fs');var Redis=require(_0xd555('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd555('0x5'))(_0xd555('0x6'));var config=require(_0xd555('0x7'));var jayson=require(_0xd555('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x254b72,_0x4c7012,_0x3a4c3a){return new BPromise(function(_0xef6a1f,_0x48bbb7){return client[_0xd555('0x9')](_0x254b72,_0x3a4c3a)[_0xd555('0xa')](function(_0x2e454f){logger[_0xd555('0xb')](_0xd555('0xc'),_0x4c7012,'request\x20sent');logger[_0xd555('0xd')](_0xd555('0xe'),_0x4c7012,_0xd555('0xf'),JSON[_0xd555('0x10')](_0x2e454f));if(_0x2e454f[_0xd555('0x11')]){if(_0x2e454f['error'][_0xd555('0x12')]===0x1f4){logger[_0xd555('0x11')](_0xd555('0xc'),_0x4c7012,_0x2e454f[_0xd555('0x11')][_0xd555('0x13')]);return _0x48bbb7(_0x2e454f['error'][_0xd555('0x13')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4c7012,_0x2e454f[_0xd555('0x11')][_0xd555('0x13')]);return _0xef6a1f(_0x2e454f['error']['message']);}else{logger[_0xd555('0xb')](_0xd555('0xc'),_0x4c7012,_0xd555('0xf'));_0xef6a1f(_0x2e454f[_0xd555('0x14')][_0xd555('0x13')]);}})['catch'](function(_0x1e7951){logger[_0xd555('0x11')](_0xd555('0xc'),_0x4c7012,_0x1e7951);_0x48bbb7(_0x1e7951);});});}exports[_0xd555('0x15')]=function(_0x4cea15){var _0x3fa137=this;return new Promise(function(_0x489e15,_0x414b62){return db['ZendeskAccount'][_0xd555('0x16')]({'raw':_0x4cea15['options']?_0x4cea15[_0xd555('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4cea15[_0xd555('0x17')]?_0x4cea15[_0xd555('0x17')][_0xd555('0x18')]||null:null,'attributes':_0x4cea15[_0xd555('0x17')]?_0x4cea15[_0xd555('0x17')]['attributes']||null:null,'limit':_0x4cea15[_0xd555('0x17')]?_0x4cea15[_0xd555('0x17')][_0xd555('0x19')]||null:null,'include':_0x4cea15[_0xd555('0x17')]?_0x4cea15[_0xd555('0x17')]['include']?_[_0xd555('0x1a')](_0x4cea15['options'][_0xd555('0x1b')],function(_0xd36d9c){return{'model':db[_0xd36d9c[_0xd555('0x1c')]],'as':_0xd36d9c['as'],'attributes':_0xd36d9c['attributes'],'include':_0xd36d9c[_0xd555('0x1b')]?_['map'](_0xd36d9c[_0xd555('0x1b')],function(_0x97b5be){return{'model':db[_0x97b5be[_0xd555('0x1c')]],'as':_0x97b5be['as'],'attributes':_0x97b5be[_0xd555('0x1d')],'include':_0x97b5be[_0xd555('0x1b')]?_['map'](_0x97b5be[_0xd555('0x1b')],function(_0x3ba790){return{'model':db[_0x3ba790['model']],'as':_0x3ba790['as'],'attributes':_0x3ba790[_0xd555('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd555('0xa')](function(_0x2903da){logger[_0xd555('0xb')](_0xd555('0x15'),_0x4cea15);logger[_0xd555('0xd')](_0xd555('0x15'),_0x4cea15,JSON[_0xd555('0x10')](_0x2903da));_0x489e15(_0x2903da);})[_0xd555('0x1e')](function(_0x35645b){logger[_0xd555('0x11')]('GetZendeskAccount',_0x35645b['message'],_0x4cea15);_0x414b62(_0x3fa137[_0xd555('0x11')](0x1f4,_0x35645b[_0xd555('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x455247){var _0x4502dd=this;return new Promise(function(_0x512b69,_0x28f488){return db[_0xd555('0x1f')][_0xd555('0x20')]({'raw':_0x455247[_0xd555('0x17')]?_0x455247[_0xd555('0x17')][_0xd555('0x21')]===undefined?!![]:![]:!![],'where':_0x455247[_0xd555('0x17')]?_0x455247['options']['where']||null:null,'attributes':_0x455247[_0xd555('0x17')]?_0x455247[_0xd555('0x17')]['attributes']||null:null,'include':_0x455247['options']?_0x455247[_0xd555('0x17')]['include']?_[_0xd555('0x1a')](_0x455247[_0xd555('0x17')]['include'],function(_0x547664){return{'model':db[_0x547664[_0xd555('0x1c')]],'as':_0x547664['as'],'attributes':_0x547664[_0xd555('0x1d')],'include':_0x547664['include']?_[_0xd555('0x1a')](_0x547664[_0xd555('0x1b')],function(_0x31e327){return{'model':db[_0x31e327['model']],'as':_0x31e327['as'],'attributes':_0x31e327[_0xd555('0x1d')],'include':_0x31e327[_0xd555('0x1b')]?_['map'](_0x31e327[_0xd555('0x1b')],function(_0xda38a1){return{'model':db[_0xda38a1[_0xd555('0x1c')]],'as':_0xda38a1['as'],'attributes':_0xda38a1['attributes']};}):[]};}):[]};}):[]:[]})[_0xd555('0xa')](function(_0x4cad90){logger[_0xd555('0xb')]('ShowZendeskAccount',_0x455247);logger[_0xd555('0xd')](_0xd555('0x22'),_0x455247,JSON[_0xd555('0x10')](_0x4cad90));_0x512b69(_0x4cad90);})[_0xd555('0x1e')](function(_0x88a810){logger['error'](_0xd555('0x22'),_0x88a810['message'],_0x455247);_0x28f488(_0x4502dd[_0xd555('0x11')](0x1f4,_0x88a810[_0xd555('0x13')]));});});}; \ No newline at end of file +var _0x266d=['code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2aa22c,_0x29e564){var _0x4ea8ef=function(_0x1b39e5){while(--_0x1b39e5){_0x2aa22c['push'](_0x2aa22c['shift']());}};_0x4ea8ef(++_0x29e564);}(_0x266d,0x152));var _0xd266=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x266d[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd266('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd266('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd266('0x2'));var config=require(_0xd266('0x3'));var jayson=require(_0xd266('0x4'));var client=jayson[_0xd266('0x5')][_0xd266('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2b4d50,_0x3a5374,_0x2ac059){return new BPromise(function(_0x752c3b,_0x13b5e9){return client['request'](_0x2b4d50,_0x2ac059)[_0xd266('0x7')](function(_0x51d6c8){logger[_0xd266('0x8')]('ZendeskAccount,\x20%s,\x20%s',_0x3a5374,_0xd266('0x9'));logger[_0xd266('0xa')](_0xd266('0xb'),_0x3a5374,'request\x20sent',JSON[_0xd266('0xc')](_0x51d6c8));if(_0x51d6c8[_0xd266('0xd')]){if(_0x51d6c8[_0xd266('0xd')][_0xd266('0xe')]===0x1f4){logger[_0xd266('0xd')](_0xd266('0xf'),_0x3a5374,_0x51d6c8['error'][_0xd266('0x10')]);return _0x13b5e9(_0x51d6c8[_0xd266('0xd')][_0xd266('0x10')]);}logger['error'](_0xd266('0xf'),_0x3a5374,_0x51d6c8[_0xd266('0xd')][_0xd266('0x10')]);return _0x752c3b(_0x51d6c8[_0xd266('0xd')][_0xd266('0x10')]);}else{logger['info'](_0xd266('0xf'),_0x3a5374,'request\x20sent');_0x752c3b(_0x51d6c8[_0xd266('0x11')][_0xd266('0x10')]);}})[_0xd266('0x12')](function(_0x40dfd8){logger['error'](_0xd266('0xf'),_0x3a5374,_0x40dfd8);_0x13b5e9(_0x40dfd8);});});}exports[_0xd266('0x13')]=function(_0x34680e){var _0x292d75=this;return new Promise(function(_0x535b48,_0x56101c){return db[_0xd266('0x14')][_0xd266('0x15')]({'raw':_0x34680e['options']?_0x34680e[_0xd266('0x16')][_0xd266('0x17')]===undefined?!![]:![]:!![],'where':_0x34680e['options']?_0x34680e[_0xd266('0x16')][_0xd266('0x18')]||null:null,'attributes':_0x34680e[_0xd266('0x16')]?_0x34680e['options'][_0xd266('0x19')]||null:null,'limit':_0x34680e[_0xd266('0x16')]?_0x34680e[_0xd266('0x16')][_0xd266('0x1a')]||null:null,'include':_0x34680e[_0xd266('0x16')]?_0x34680e['options'][_0xd266('0x1b')]?_['map'](_0x34680e[_0xd266('0x16')]['include'],function(_0x29f59a){return{'model':db[_0x29f59a['model']],'as':_0x29f59a['as'],'attributes':_0x29f59a[_0xd266('0x19')],'include':_0x29f59a[_0xd266('0x1b')]?_[_0xd266('0x1c')](_0x29f59a[_0xd266('0x1b')],function(_0x409a7a){return{'model':db[_0x409a7a[_0xd266('0x1d')]],'as':_0x409a7a['as'],'attributes':_0x409a7a['attributes'],'include':_0x409a7a['include']?_['map'](_0x409a7a[_0xd266('0x1b')],function(_0x2b0d64){return{'model':db[_0x2b0d64['model']],'as':_0x2b0d64['as'],'attributes':_0x2b0d64[_0xd266('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a4ddc){logger[_0xd266('0x8')](_0xd266('0x13'),_0x34680e);logger[_0xd266('0xa')](_0xd266('0x13'),_0x34680e,JSON['stringify'](_0x4a4ddc));_0x535b48(_0x4a4ddc);})[_0xd266('0x12')](function(_0x59c188){logger[_0xd266('0xd')]('GetZendeskAccount',_0x59c188[_0xd266('0x10')],_0x34680e);_0x56101c(_0x292d75[_0xd266('0xd')](0x1f4,_0x59c188[_0xd266('0x10')]));});});};exports[_0xd266('0x1e')]=function(_0x4cd945){var _0x532dda=this;return new Promise(function(_0x64d81a,_0x595909){return db['ZendeskAccount'][_0xd266('0x1f')]({'raw':_0x4cd945[_0xd266('0x16')]?_0x4cd945['options']['raw']===undefined?!![]:![]:!![],'where':_0x4cd945[_0xd266('0x16')]?_0x4cd945['options'][_0xd266('0x18')]||null:null,'attributes':_0x4cd945[_0xd266('0x16')]?_0x4cd945[_0xd266('0x16')]['attributes']||null:null,'include':_0x4cd945[_0xd266('0x16')]?_0x4cd945[_0xd266('0x16')][_0xd266('0x1b')]?_[_0xd266('0x1c')](_0x4cd945['options'][_0xd266('0x1b')],function(_0x323f54){return{'model':db[_0x323f54[_0xd266('0x1d')]],'as':_0x323f54['as'],'attributes':_0x323f54[_0xd266('0x19')],'include':_0x323f54[_0xd266('0x1b')]?_['map'](_0x323f54['include'],function(_0x4bfc3b){return{'model':db[_0x4bfc3b['model']],'as':_0x4bfc3b['as'],'attributes':_0x4bfc3b['attributes'],'include':_0x4bfc3b['include']?_['map'](_0x4bfc3b[_0xd266('0x1b')],function(_0x2c0ef4){return{'model':db[_0x2c0ef4[_0xd266('0x1d')]],'as':_0x2c0ef4['as'],'attributes':_0x2c0ef4[_0xd266('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd266('0x7')](function(_0x129201){logger[_0xd266('0x8')](_0xd266('0x1e'),_0x4cd945);logger['debug'](_0xd266('0x1e'),_0x4cd945,JSON[_0xd266('0xc')](_0x129201));_0x64d81a(_0x129201);})[_0xd266('0x12')](function(_0x5d382b){logger['error'](_0xd266('0x1e'),_0x5d382b[_0xd266('0x10')],_0x4cd945);_0x595909(_0x532dda[_0xd266('0xd')](0x1f4,_0x5d382b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 910d810..87b038c 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 _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0xcd81b8,_0x18d9fd){var _0xc3ae18=function(_0x2bd4e0){while(--_0x2bd4e0){_0xcd81b8['push'](_0xcd81b8['shift']());}};_0xc3ae18(++_0x18d9fd);}(_0x4483,0x1a3));var _0x3448=function(_0x4fe924,_0x400332){_0x4fe924=_0x4fe924-0x0;var _0x6d4cec=_0x4483[_0x4fe924];return _0x6d4cec;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x53a066,_0x109f6d){var _0x5362ac=function(_0xe3b8b1){while(--_0xe3b8b1){_0x53a066['push'](_0x53a066['shift']());}};_0x5362ac(++_0x109f6d);}(_0xda3f,0xec));var _0xfda3=function(_0x3f68d3,_0x16bf2f){_0x3f68d3=_0x3f68d3-0x0;var _0x45e7b2=_0xda3f[_0x3f68d3];return _0x45e7b2;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index c488d7a..39c2199 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 _0xd15e=['sequelize','exports','STRING'];(function(_0x1b6adc,_0x8d0616){var _0x4b8727=function(_0x3913f5){while(--_0x3913f5){_0x1b6adc['push'](_0x1b6adc['shift']());}};_0x4b8727(++_0x8d0616);}(_0xd15e,0x129));var _0xed15=function(_0xd952dc,_0x117925){_0xd952dc=_0xd952dc-0x0;var _0x410e82=_0xd15e[_0xd952dc];return _0x410e82;};'use strict';var Sequelize=require(_0xed15('0x0'));module[_0xed15('0x1')]={'name':{'type':Sequelize[_0xed15('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbbf6=['STRING','sequelize'];(function(_0x4ad972,_0x565ded){var _0xd217ed=function(_0x4939ef){while(--_0x4939ef){_0x4ad972['push'](_0x4ad972['shift']());}};_0xd217ed(++_0x565ded);}(_0xbbf6,0x14d));var _0x6bbf=function(_0x547995,_0x175dd9){_0x547995=_0x547995-0x0;var _0x1df3ef=_0xbbf6[_0x547995];return _0x1df3ef;};'use strict';var Sequelize=require(_0x6bbf('0x0'));module['exports']={'name':{'type':Sequelize[_0x6bbf('0x1')]},'description':{'type':Sequelize[_0x6bbf('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 377e6d7..4fd89ae 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 _0xe184=['status','set','Content-Range','json','update','then','destroy','error','stack','name','ZendeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','includeAll','find','create','catch','body','params','findOne','ZendeskField','map','getFields','nolimit','getSubjects','rawAttributes','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset'];(function(_0x294499,_0x1785b3){var _0x42a72e=function(_0x3d3b18){while(--_0x3d3b18){_0x294499['push'](_0x294499['shift']());}};_0x42a72e(++_0x1785b3);}(_0xe184,0xd3));var _0x4e18=function(_0x2d25e1,_0x13df3c){_0x2d25e1=_0x2d25e1-0x0;var _0x5bb5ff=_0xe184[_0x2d25e1];return _0x5bb5ff;};'use strict';var emlformat=require(_0x4e18('0x0'));var rimraf=require(_0x4e18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e18('0x2'));var rp=require(_0x4e18('0x3'));var moment=require('moment');var BPromise=require(_0x4e18('0x4'));var Mustache=require('mustache');var util=require(_0x4e18('0x5'));var path=require(_0x4e18('0x6'));var sox=require('sox');var csv=require(_0x4e18('0x7'));var ejs=require(_0x4e18('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e18('0x9'));var squel=require(_0x4e18('0xa'));var crypto=require(_0x4e18('0xb'));var jsforce=require(_0x4e18('0xc'));var deskjs=require(_0x4e18('0xd'));var toCsv=require(_0x4e18('0x7'));var querystring=require(_0x4e18('0xe'));var Papa=require(_0x4e18('0xf'));var Redis=require('ioredis');var authService=require(_0x4e18('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e18('0x11'))(_0x4e18('0x12'));var utils=require(_0x4e18('0x13'));var config=require(_0x4e18('0x14'));var licenseUtil=require(_0x4e18('0x15'));var db=require(_0x4e18('0x16'))['db'];function respondWithStatusCode(_0x19ccf3,_0x271bae){_0x271bae=_0x271bae||0xcc;return function(_0x1483dc){if(_0x1483dc){return _0x19ccf3[_0x4e18('0x17')](_0x271bae);}return _0x19ccf3['status'](_0x271bae)[_0x4e18('0x18')]();};}function respondWithResult(_0x1840ed,_0xae5d51){_0xae5d51=_0xae5d51||0xc8;return function(_0x5e03c2){if(_0x5e03c2){return _0x1840ed['status'](_0xae5d51)['json'](_0x5e03c2);}};}function respondWithFilteredResult(_0x18c94a,_0x4ae122){return function(_0x108cf3){if(_0x108cf3){var _0x37bdae=typeof _0x4ae122['offset']===_0x4e18('0x19')&&typeof _0x4ae122[_0x4e18('0x1a')]===_0x4e18('0x19');var _0x33708c=_0x108cf3[_0x4e18('0x1b')];var _0x27b58c=_0x37bdae?0x0:_0x4ae122['offset'];var _0x3858ce=_0x37bdae?_0x108cf3[_0x4e18('0x1b')]:_0x4ae122[_0x4e18('0x1c')]+_0x4ae122[_0x4e18('0x1a')];var _0x50c4c6;if(_0x3858ce>=_0x33708c){_0x3858ce=_0x33708c;_0x50c4c6=0xc8;}else{_0x50c4c6=0xce;}_0x18c94a[_0x4e18('0x1d')](_0x50c4c6);return _0x18c94a[_0x4e18('0x1e')](_0x4e18('0x1f'),_0x27b58c+'-'+_0x3858ce+'/'+_0x33708c)[_0x4e18('0x20')](_0x108cf3);}return null;};}function patchUpdates(_0x220d5b){return function(_0x592a45){try{jsonpatch['apply'](_0x592a45,_0x220d5b,!![]);}catch(_0x2428f3){return BPromise['reject'](_0x2428f3);}return _0x592a45['save']();};}function saveUpdates(_0x5933b3,_0x4039ff){return function(_0x1caab0){if(_0x1caab0){return _0x1caab0[_0x4e18('0x21')](_0x5933b3)[_0x4e18('0x22')](function(_0x5b72b0){return _0x5b72b0;});}return null;};}function removeEntity(_0x505f80,_0x765c7c){return function(_0x258b5f){if(_0x258b5f){return _0x258b5f[_0x4e18('0x23')]()[_0x4e18('0x22')](function(){_0x505f80[_0x4e18('0x1d')](0xcc)[_0x4e18('0x18')]();});}};}function handleEntityNotFound(_0x50aa46,_0x37d077){return function(_0x32e9a3){if(!_0x32e9a3){_0x50aa46[_0x4e18('0x17')](0x194);}return _0x32e9a3;};}function handleError(_0x42206d,_0x215ce7){_0x215ce7=_0x215ce7||0x1f4;return function(_0x244093){logger[_0x4e18('0x24')](_0x244093[_0x4e18('0x25')]);if(_0x244093[_0x4e18('0x26')]){delete _0x244093['name'];}_0x42206d[_0x4e18('0x1d')](_0x215ce7)['send'](_0x244093);};}exports['index']=function(_0x4fce3b,_0x35a8ad){var _0x2f1674={},_0x2076a2={},_0x210321={'count':0x0,'rows':[]};var _0x502149=_['map'](db[_0x4e18('0x27')]['rawAttributes'],function(_0x423e93){return{'name':_0x423e93[_0x4e18('0x28')],'type':_0x423e93[_0x4e18('0x29')][_0x4e18('0x2a')]};});_0x2076a2[_0x4e18('0x2b')]=_['map'](_0x502149,_0x4e18('0x26'));_0x2076a2[_0x4e18('0x2c')]=_[_0x4e18('0x2d')](_0x4fce3b[_0x4e18('0x2c')]);_0x2076a2[_0x4e18('0x2e')]=_[_0x4e18('0x2f')](_0x2076a2[_0x4e18('0x2b')],_0x2076a2[_0x4e18('0x2c')]);_0x2f1674[_0x4e18('0x30')]=_[_0x4e18('0x2f')](_0x2076a2[_0x4e18('0x2b')],qs[_0x4e18('0x31')](_0x4fce3b[_0x4e18('0x2c')]['fields']));_0x2f1674[_0x4e18('0x30')]=_0x2f1674[_0x4e18('0x30')][_0x4e18('0x32')]?_0x2f1674[_0x4e18('0x30')]:_0x2076a2['model'];if(!_0x4fce3b['query'][_0x4e18('0x33')]('nolimit')){_0x2f1674[_0x4e18('0x1a')]=qs[_0x4e18('0x1a')](_0x4fce3b['query']['limit']);_0x2f1674[_0x4e18('0x1c')]=qs[_0x4e18('0x1c')](_0x4fce3b['query']['offset']);}_0x2f1674[_0x4e18('0x34')]=qs[_0x4e18('0x35')](_0x4fce3b[_0x4e18('0x2c')][_0x4e18('0x35')]);_0x2f1674[_0x4e18('0x36')]=qs[_0x4e18('0x2e')](_[_0x4e18('0x37')](_0x4fce3b[_0x4e18('0x2c')],_0x2076a2[_0x4e18('0x2e')]),_0x502149);if(_0x4fce3b[_0x4e18('0x2c')][_0x4e18('0x38')]){_0x2f1674[_0x4e18('0x36')]=_[_0x4e18('0x39')](_0x2f1674['where'],{'$or':_['map'](_0x502149,function(_0x343701){if(_0x343701['type']!==_0x4e18('0x3a')){var _0x36d011={};_0x36d011[_0x343701['name']]={'$like':'%'+_0x4fce3b[_0x4e18('0x2c')][_0x4e18('0x38')]+'%'};return _0x36d011;}})});}_0x2f1674=_['merge']({},_0x2f1674,_0x4fce3b[_0x4e18('0x3b')]);var _0x1b0809={'where':_0x2f1674[_0x4e18('0x36')]};return db[_0x4e18('0x27')]['count'](_0x1b0809)[_0x4e18('0x22')](function(_0x2c3bad){_0x210321[_0x4e18('0x1b')]=_0x2c3bad;if(_0x4fce3b[_0x4e18('0x2c')]['includeAll']){_0x2f1674[_0x4e18('0x3c')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x2f1674);})[_0x4e18('0x22')](function(_0x1dfe67){_0x210321[_0x4e18('0x3d')]=_0x1dfe67;return _0x210321;})['then'](respondWithFilteredResult(_0x35a8ad,_0x2f1674))['catch'](handleError(_0x35a8ad,null));};exports[_0x4e18('0x3e')]=function(_0x108e70,_0x1f9dc7){var _0x35179e={'raw':![],'where':{'id':_0x108e70['params']['id']}},_0x1937dd={};_0x1937dd[_0x4e18('0x2b')]=_[_0x4e18('0x2d')](db[_0x4e18('0x27')]['rawAttributes']);_0x1937dd[_0x4e18('0x2c')]=_[_0x4e18('0x2d')](_0x108e70[_0x4e18('0x2c')]);_0x1937dd[_0x4e18('0x2e')]=_['intersection'](_0x1937dd[_0x4e18('0x2b')],_0x1937dd['query']);_0x35179e[_0x4e18('0x30')]=_[_0x4e18('0x2f')](_0x1937dd['model'],qs[_0x4e18('0x31')](_0x108e70[_0x4e18('0x2c')][_0x4e18('0x31')]));_0x35179e[_0x4e18('0x30')]=_0x35179e[_0x4e18('0x30')][_0x4e18('0x32')]?_0x35179e[_0x4e18('0x30')]:_0x1937dd[_0x4e18('0x2b')];if(_0x108e70[_0x4e18('0x2c')][_0x4e18('0x3f')]){_0x35179e[_0x4e18('0x3c')]=[{'all':!![]}];}_0x35179e=_['merge']({},_0x35179e,_0x108e70[_0x4e18('0x3b')]);return db[_0x4e18('0x27')][_0x4e18('0x40')](_0x35179e)[_0x4e18('0x22')](handleEntityNotFound(_0x1f9dc7,null))[_0x4e18('0x22')](respondWithResult(_0x1f9dc7,null))['catch'](handleError(_0x1f9dc7,null));};exports['create']=function(_0x3d79c6,_0x4617fc){return db[_0x4e18('0x27')][_0x4e18('0x41')](_0x3d79c6['body'],{})[_0x4e18('0x22')](respondWithResult(_0x4617fc,0xc9))[_0x4e18('0x42')](handleError(_0x4617fc,null));};exports['update']=function(_0x1daa12,_0xbcbfcb){if(_0x1daa12['body']['id']){delete _0x1daa12[_0x4e18('0x43')]['id'];}return db[_0x4e18('0x27')][_0x4e18('0x40')]({'where':{'id':_0x1daa12['params']['id']}})[_0x4e18('0x22')](handleEntityNotFound(_0xbcbfcb,null))[_0x4e18('0x22')](saveUpdates(_0x1daa12[_0x4e18('0x43')],null))[_0x4e18('0x22')](respondWithResult(_0xbcbfcb,null))[_0x4e18('0x42')](handleError(_0xbcbfcb,null));};exports[_0x4e18('0x23')]=function(_0x318062,_0x311788){return db[_0x4e18('0x27')][_0x4e18('0x40')]({'where':{'id':_0x318062[_0x4e18('0x44')]['id']}})[_0x4e18('0x22')](handleEntityNotFound(_0x311788,null))[_0x4e18('0x22')](removeEntity(_0x311788,null))[_0x4e18('0x42')](handleError(_0x311788,null));};exports['getFields']=function(_0x52b3a,_0x1e21a1,_0x56c963){var _0x49f61e={};var _0x2e1c84={};var _0x5e562d;var _0x32d1ad;return db[_0x4e18('0x27')][_0x4e18('0x45')]({'where':{'id':_0x52b3a[_0x4e18('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e21a1,null))[_0x4e18('0x22')](function(_0xc6e887){if(_0xc6e887){_0x5e562d=_0xc6e887;_0x2e1c84[_0x4e18('0x2b')]=_[_0x4e18('0x2d')](db[_0x4e18('0x46')]['rawAttributes']);_0x2e1c84[_0x4e18('0x2c')]=_[_0x4e18('0x2d')](_0x52b3a[_0x4e18('0x2c')]);_0x2e1c84[_0x4e18('0x2e')]=_['intersection'](_0x2e1c84[_0x4e18('0x2b')],_0x2e1c84[_0x4e18('0x2c')]);_0x49f61e[_0x4e18('0x30')]=_['intersection'](_0x2e1c84[_0x4e18('0x2b')],qs[_0x4e18('0x31')](_0x52b3a[_0x4e18('0x2c')][_0x4e18('0x31')]));_0x49f61e[_0x4e18('0x30')]=_0x49f61e[_0x4e18('0x30')][_0x4e18('0x32')]?_0x49f61e['attributes']:_0x2e1c84[_0x4e18('0x2b')];_0x49f61e['order']=qs[_0x4e18('0x35')](_0x52b3a[_0x4e18('0x2c')][_0x4e18('0x35')]);_0x49f61e[_0x4e18('0x36')]=qs[_0x4e18('0x2e')](_[_0x4e18('0x37')](_0x52b3a[_0x4e18('0x2c')],_0x2e1c84[_0x4e18('0x2e')]));if(_0x52b3a['query'][_0x4e18('0x38')]){_0x49f61e[_0x4e18('0x36')]=_[_0x4e18('0x39')](_0x49f61e[_0x4e18('0x36')],{'$or':_[_0x4e18('0x47')](_0x49f61e[_0x4e18('0x30')],function(_0x381ff8){var _0x2afb59={};_0x2afb59[_0x381ff8]={'$like':'%'+_0x52b3a['query'][_0x4e18('0x38')]+'%'};return _0x2afb59;})});}_0x49f61e=_[_0x4e18('0x39')]({},_0x49f61e,_0x52b3a[_0x4e18('0x3b')]);return _0x5e562d[_0x4e18('0x48')](_0x49f61e);}})[_0x4e18('0x22')](function(_0x4fda3d){if(_0x4fda3d){_0x32d1ad=_0x4fda3d['length'];if(!_0x52b3a[_0x4e18('0x2c')][_0x4e18('0x33')](_0x4e18('0x49'))){_0x49f61e['limit']=qs[_0x4e18('0x1a')](_0x52b3a[_0x4e18('0x2c')][_0x4e18('0x1a')]);_0x49f61e['offset']=qs[_0x4e18('0x1c')](_0x52b3a[_0x4e18('0x2c')][_0x4e18('0x1c')]);}return _0x5e562d[_0x4e18('0x48')](_0x49f61e);}})[_0x4e18('0x22')](function(_0x3cf761){if(_0x3cf761){return _0x3cf761?{'count':_0x32d1ad,'rows':_0x3cf761}:null;}})[_0x4e18('0x22')](respondWithResult(_0x1e21a1,null))[_0x4e18('0x42')](handleError(_0x1e21a1,null));};exports[_0x4e18('0x4a')]=function(_0x3488c6,_0x2d9e9f,_0x74232f){var _0x1ed62c={};var _0x4d35e8={};var _0xb4e476;var _0x9ecfe4;return db[_0x4e18('0x27')][_0x4e18('0x45')]({'where':{'id':_0x3488c6[_0x4e18('0x44')]['id']}})[_0x4e18('0x22')](handleEntityNotFound(_0x2d9e9f,null))[_0x4e18('0x22')](function(_0x2a2334){if(_0x2a2334){_0xb4e476=_0x2a2334;_0x4d35e8[_0x4e18('0x2b')]=_[_0x4e18('0x2d')](db[_0x4e18('0x46')]['rawAttributes']);_0x4d35e8[_0x4e18('0x2c')]=_[_0x4e18('0x2d')](_0x3488c6[_0x4e18('0x2c')]);_0x4d35e8[_0x4e18('0x2e')]=_[_0x4e18('0x2f')](_0x4d35e8[_0x4e18('0x2b')],_0x4d35e8[_0x4e18('0x2c')]);_0x1ed62c[_0x4e18('0x30')]=_[_0x4e18('0x2f')](_0x4d35e8[_0x4e18('0x2b')],qs[_0x4e18('0x31')](_0x3488c6[_0x4e18('0x2c')]['fields']));_0x1ed62c['attributes']=_0x1ed62c[_0x4e18('0x30')][_0x4e18('0x32')]?_0x1ed62c[_0x4e18('0x30')]:_0x4d35e8[_0x4e18('0x2b')];_0x1ed62c['order']=qs[_0x4e18('0x35')](_0x3488c6['query'][_0x4e18('0x35')]);_0x1ed62c[_0x4e18('0x36')]=qs['filters'](_['pick'](_0x3488c6[_0x4e18('0x2c')],_0x4d35e8[_0x4e18('0x2e')]));if(_0x3488c6['query']['filter']){_0x1ed62c[_0x4e18('0x36')]=_[_0x4e18('0x39')](_0x1ed62c[_0x4e18('0x36')],{'$or':_[_0x4e18('0x47')](_0x1ed62c['attributes'],function(_0x43a9e8){var _0x2dda74={};_0x2dda74[_0x43a9e8]={'$like':'%'+_0x3488c6[_0x4e18('0x2c')][_0x4e18('0x38')]+'%'};return _0x2dda74;})});}_0x1ed62c=_[_0x4e18('0x39')]({},_0x1ed62c,_0x3488c6[_0x4e18('0x3b')]);return _0xb4e476[_0x4e18('0x4a')](_0x1ed62c);}})[_0x4e18('0x22')](function(_0x4f125f){if(_0x4f125f){_0x9ecfe4=_0x4f125f[_0x4e18('0x32')];if(!_0x3488c6[_0x4e18('0x2c')][_0x4e18('0x33')](_0x4e18('0x49'))){_0x1ed62c[_0x4e18('0x1a')]=qs[_0x4e18('0x1a')](_0x3488c6['query']['limit']);_0x1ed62c[_0x4e18('0x1c')]=qs['offset'](_0x3488c6[_0x4e18('0x2c')][_0x4e18('0x1c')]);}return _0xb4e476['getSubjects'](_0x1ed62c);}})['then'](function(_0x3d901c){if(_0x3d901c){return _0x3d901c?{'count':_0x9ecfe4,'rows':_0x3d901c}:null;}})[_0x4e18('0x22')](respondWithResult(_0x2d9e9f,null))[_0x4e18('0x42')](handleError(_0x2d9e9f,null));};exports['getDescriptions']=function(_0x52140f,_0x2433e2,_0x100c75){var _0x2acd92={};var _0x551890={};var _0x4e81b5;var _0x298da6;return db[_0x4e18('0x27')][_0x4e18('0x45')]({'where':{'id':_0x52140f[_0x4e18('0x44')]['id']}})[_0x4e18('0x22')](handleEntityNotFound(_0x2433e2,null))[_0x4e18('0x22')](function(_0x39a6da){if(_0x39a6da){_0x4e81b5=_0x39a6da;_0x551890[_0x4e18('0x2b')]=_[_0x4e18('0x2d')](db[_0x4e18('0x46')][_0x4e18('0x4b')]);_0x551890[_0x4e18('0x2c')]=_[_0x4e18('0x2d')](_0x52140f[_0x4e18('0x2c')]);_0x551890[_0x4e18('0x2e')]=_[_0x4e18('0x2f')](_0x551890['model'],_0x551890[_0x4e18('0x2c')]);_0x2acd92['attributes']=_['intersection'](_0x551890['model'],qs[_0x4e18('0x31')](_0x52140f[_0x4e18('0x2c')][_0x4e18('0x31')]));_0x2acd92[_0x4e18('0x30')]=_0x2acd92[_0x4e18('0x30')][_0x4e18('0x32')]?_0x2acd92[_0x4e18('0x30')]:_0x551890['model'];_0x2acd92[_0x4e18('0x34')]=qs[_0x4e18('0x35')](_0x52140f[_0x4e18('0x2c')][_0x4e18('0x35')]);_0x2acd92[_0x4e18('0x36')]=qs[_0x4e18('0x2e')](_['pick'](_0x52140f[_0x4e18('0x2c')],_0x551890['filters']));if(_0x52140f['query'][_0x4e18('0x38')]){_0x2acd92['where']=_['merge'](_0x2acd92[_0x4e18('0x36')],{'$or':_['map'](_0x2acd92[_0x4e18('0x30')],function(_0x19405f){var _0x5bf8d4={};_0x5bf8d4[_0x19405f]={'$like':'%'+_0x52140f[_0x4e18('0x2c')][_0x4e18('0x38')]+'%'};return _0x5bf8d4;})});}_0x2acd92=_['merge']({},_0x2acd92,_0x52140f[_0x4e18('0x3b')]);return _0x4e81b5[_0x4e18('0x4c')](_0x2acd92);}})[_0x4e18('0x22')](function(_0x59aae6){if(_0x59aae6){_0x298da6=_0x59aae6['length'];if(!_0x52140f[_0x4e18('0x2c')]['hasOwnProperty'](_0x4e18('0x49'))){_0x2acd92[_0x4e18('0x1a')]=qs[_0x4e18('0x1a')](_0x52140f[_0x4e18('0x2c')][_0x4e18('0x1a')]);_0x2acd92[_0x4e18('0x1c')]=qs['offset'](_0x52140f[_0x4e18('0x2c')][_0x4e18('0x1c')]);}return _0x4e81b5[_0x4e18('0x4c')](_0x2acd92);}})[_0x4e18('0x22')](function(_0x473417){if(_0x473417){return _0x473417?{'count':_0x298da6,'rows':_0x473417}:null;}})[_0x4e18('0x22')](respondWithResult(_0x2433e2,null))['catch'](handleError(_0x2433e2,null));};exports[_0x4e18('0x4d')]=function(_0x15b037,_0x43ea46,_0x2edcc3){var _0xc41fe9={};var _0x50c5a7={};var _0x175e7e;var _0x2a0d32;return db[_0x4e18('0x27')][_0x4e18('0x45')]({'where':{'id':_0x15b037[_0x4e18('0x44')]['id']}})[_0x4e18('0x22')](handleEntityNotFound(_0x43ea46,null))['then'](function(_0x36d218){if(_0x36d218){_0x175e7e=_0x36d218;_0x50c5a7['model']=_[_0x4e18('0x2d')](db['Tag'][_0x4e18('0x4b')]);_0x50c5a7[_0x4e18('0x2c')]=_[_0x4e18('0x2d')](_0x15b037[_0x4e18('0x2c')]);_0x50c5a7[_0x4e18('0x2e')]=_[_0x4e18('0x2f')](_0x50c5a7[_0x4e18('0x2b')],_0x50c5a7[_0x4e18('0x2c')]);_0xc41fe9[_0x4e18('0x30')]=_[_0x4e18('0x2f')](_0x50c5a7[_0x4e18('0x2b')],qs['fields'](_0x15b037[_0x4e18('0x2c')][_0x4e18('0x31')]));_0xc41fe9['attributes']=_0xc41fe9['attributes'][_0x4e18('0x32')]?_0xc41fe9[_0x4e18('0x30')]:_0x50c5a7[_0x4e18('0x2b')];_0xc41fe9[_0x4e18('0x34')]=qs[_0x4e18('0x35')](_0x15b037[_0x4e18('0x2c')]['sort']);_0xc41fe9[_0x4e18('0x36')]=qs[_0x4e18('0x2e')](_[_0x4e18('0x37')](_0x15b037['query'],_0x50c5a7[_0x4e18('0x2e')]));if(_0x15b037[_0x4e18('0x2c')][_0x4e18('0x38')]){_0xc41fe9[_0x4e18('0x36')]=_[_0x4e18('0x39')](_0xc41fe9[_0x4e18('0x36')],{'$or':_['map'](_0xc41fe9[_0x4e18('0x30')],function(_0x5eab9d){var _0x4b0de7={};_0x4b0de7[_0x5eab9d]={'$like':'%'+_0x15b037[_0x4e18('0x2c')][_0x4e18('0x38')]+'%'};return _0x4b0de7;})});}_0xc41fe9=_[_0x4e18('0x39')]({},_0xc41fe9,_0x15b037['options']);return _0x175e7e[_0x4e18('0x4d')](_0xc41fe9);}})[_0x4e18('0x22')](function(_0x45f37a){if(_0x45f37a){_0x2a0d32=_0x45f37a[_0x4e18('0x32')];if(!_0x15b037['query'][_0x4e18('0x33')](_0x4e18('0x49'))){_0xc41fe9[_0x4e18('0x1a')]=qs[_0x4e18('0x1a')](_0x15b037[_0x4e18('0x2c')][_0x4e18('0x1a')]);_0xc41fe9[_0x4e18('0x1c')]=qs[_0x4e18('0x1c')](_0x15b037['query'][_0x4e18('0x1c')]);}return _0x175e7e[_0x4e18('0x4d')](_0xc41fe9);}})[_0x4e18('0x22')](function(_0x507611){if(_0x507611){return _0x507611?{'count':_0x2a0d32,'rows':_0x507611}:null;}})[_0x4e18('0x22')](respondWithResult(_0x43ea46,null))[_0x4e18('0x42')](handleError(_0x43ea46,null));};exports[_0x4e18('0x4e')]=function(_0x361827,_0x37cc6d,_0x3079d9){if(_0x361827[_0x4e18('0x43')]['id']){delete _0x361827[_0x4e18('0x43')]['id'];}return db[_0x4e18('0x27')]['findOne']({'where':{'id':_0x361827[_0x4e18('0x44')]['id']}})['then'](handleEntityNotFound(_0x37cc6d,null))[_0x4e18('0x22')](function(_0x2ae4f6){if(_0x2ae4f6){return _0x2ae4f6[_0x4e18('0x4e')](_0x361827[_0x4e18('0x43')][_0x4e18('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x37cc6d,null))[_0x4e18('0x42')](handleError(_0x37cc6d,null));}; \ No newline at end of file +var _0xdc7d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','error','name','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','hasOwnProperty','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4c4669,_0x4b121c){var _0x2f4e9e=function(_0x47bf6a){while(--_0x47bf6a){_0x4c4669['push'](_0x4c4669['shift']());}};_0x2f4e9e(++_0x4b121c);}(_0xdc7d,0xde));var _0xddc7=function(_0xc350fd,_0xf7bdfd){_0xc350fd=_0xc350fd-0x0;var _0x1f2f58=_0xdc7d[_0xc350fd];return _0x1f2f58;};'use strict';var emlformat=require(_0xddc7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xddc7('0x1'));var rp=require(_0xddc7('0x2'));var moment=require('moment');var BPromise=require(_0xddc7('0x3'));var Mustache=require(_0xddc7('0x4'));var util=require(_0xddc7('0x5'));var path=require('path');var sox=require(_0xddc7('0x6'));var csv=require(_0xddc7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddc7('0x8'));var _=require('lodash');var squel=require(_0xddc7('0x9'));var crypto=require(_0xddc7('0xa'));var jsforce=require(_0xddc7('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xddc7('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xddc7('0xd'));var as=require(_0xddc7('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xddc7('0xf'))(_0xddc7('0x10'));var utils=require(_0xddc7('0x11'));var config=require(_0xddc7('0x12'));var licenseUtil=require(_0xddc7('0x13'));var db=require(_0xddc7('0x14'))['db'];function respondWithStatusCode(_0x3d9dce,_0x40c4f8){_0x40c4f8=_0x40c4f8||0xcc;return function(_0x540656){if(_0x540656){return _0x3d9dce[_0xddc7('0x15')](_0x40c4f8);}return _0x3d9dce[_0xddc7('0x16')](_0x40c4f8)['end']();};}function respondWithResult(_0x48b5ac,_0x4fd17a){_0x4fd17a=_0x4fd17a||0xc8;return function(_0x3e0e58){if(_0x3e0e58){return _0x48b5ac[_0xddc7('0x16')](_0x4fd17a)['json'](_0x3e0e58);}};}function respondWithFilteredResult(_0x52f186,_0x60a7bc){return function(_0x18cc92){if(_0x18cc92){var _0x405b9d=typeof _0x60a7bc[_0xddc7('0x17')]===_0xddc7('0x18')&&typeof _0x60a7bc[_0xddc7('0x19')]===_0xddc7('0x18');var _0x17eba4=_0x18cc92['count'];var _0x115b04=_0x405b9d?0x0:_0x60a7bc[_0xddc7('0x17')];var _0x209b21=_0x405b9d?_0x18cc92[_0xddc7('0x1a')]:_0x60a7bc[_0xddc7('0x17')]+_0x60a7bc['limit'];var _0xf6b40c;if(_0x209b21>=_0x17eba4){_0x209b21=_0x17eba4;_0xf6b40c=0xc8;}else{_0xf6b40c=0xce;}_0x52f186[_0xddc7('0x16')](_0xf6b40c);return _0x52f186[_0xddc7('0x1b')]('Content-Range',_0x115b04+'-'+_0x209b21+'/'+_0x17eba4)[_0xddc7('0x1c')](_0x18cc92);}return null;};}function patchUpdates(_0x30222e){return function(_0x468b9f){try{jsonpatch[_0xddc7('0x1d')](_0x468b9f,_0x30222e,!![]);}catch(_0x3688e9){return BPromise[_0xddc7('0x1e')](_0x3688e9);}return _0x468b9f[_0xddc7('0x1f')]();};}function saveUpdates(_0x30c3a3,_0x400bb8){return function(_0x54c055){if(_0x54c055){return _0x54c055[_0xddc7('0x20')](_0x30c3a3)[_0xddc7('0x21')](function(_0x46eba2){return _0x46eba2;});}return null;};}function removeEntity(_0x4ea7ae,_0x15e9a9){return function(_0x10c209){if(_0x10c209){return _0x10c209['destroy']()[_0xddc7('0x21')](function(){_0x4ea7ae[_0xddc7('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5642e3,_0x2e24c2){return function(_0x4b3258){if(!_0x4b3258){_0x5642e3[_0xddc7('0x15')](0x194);}return _0x4b3258;};}function handleError(_0x3c7b33,_0x15bf4f){_0x15bf4f=_0x15bf4f||0x1f4;return function(_0x145429){logger[_0xddc7('0x22')](_0x145429['stack']);if(_0x145429[_0xddc7('0x23')]){delete _0x145429['name'];}_0x3c7b33['status'](_0x15bf4f)[_0xddc7('0x24')](_0x145429);};}exports['index']=function(_0x9b0b22,_0x6cebfd){var _0x56fa72={},_0x3de35e={},_0x45912f={'count':0x0,'rows':[]};var _0x5e8268=_[_0xddc7('0x25')](db[_0xddc7('0x26')][_0xddc7('0x27')],function(_0x14ef69){return{'name':_0x14ef69[_0xddc7('0x28')],'type':_0x14ef69[_0xddc7('0x29')][_0xddc7('0x2a')]};});_0x3de35e['model']=_['map'](_0x5e8268,_0xddc7('0x23'));_0x3de35e[_0xddc7('0x2b')]=_[_0xddc7('0x2c')](_0x9b0b22[_0xddc7('0x2b')]);_0x3de35e['filters']=_[_0xddc7('0x2d')](_0x3de35e[_0xddc7('0x2e')],_0x3de35e[_0xddc7('0x2b')]);_0x56fa72['attributes']=_[_0xddc7('0x2d')](_0x3de35e[_0xddc7('0x2e')],qs[_0xddc7('0x2f')](_0x9b0b22[_0xddc7('0x2b')]['fields']));_0x56fa72[_0xddc7('0x30')]=_0x56fa72[_0xddc7('0x30')][_0xddc7('0x31')]?_0x56fa72[_0xddc7('0x30')]:_0x3de35e[_0xddc7('0x2e')];if(!_0x9b0b22['query']['hasOwnProperty'](_0xddc7('0x32'))){_0x56fa72[_0xddc7('0x19')]=qs[_0xddc7('0x19')](_0x9b0b22[_0xddc7('0x2b')][_0xddc7('0x19')]);_0x56fa72[_0xddc7('0x17')]=qs['offset'](_0x9b0b22[_0xddc7('0x2b')][_0xddc7('0x17')]);}_0x56fa72[_0xddc7('0x33')]=qs[_0xddc7('0x34')](_0x9b0b22[_0xddc7('0x2b')][_0xddc7('0x34')]);_0x56fa72['where']=qs[_0xddc7('0x35')](_['pick'](_0x9b0b22['query'],_0x3de35e['filters']),_0x5e8268);if(_0x9b0b22[_0xddc7('0x2b')][_0xddc7('0x36')]){_0x56fa72[_0xddc7('0x37')]=_['merge'](_0x56fa72[_0xddc7('0x37')],{'$or':_[_0xddc7('0x25')](_0x5e8268,function(_0x33a1af){if(_0x33a1af[_0xddc7('0x29')]!==_0xddc7('0x38')){var _0x458e8d={};_0x458e8d[_0x33a1af[_0xddc7('0x23')]]={'$like':'%'+_0x9b0b22[_0xddc7('0x2b')][_0xddc7('0x36')]+'%'};return _0x458e8d;}})});}_0x56fa72=_[_0xddc7('0x39')]({},_0x56fa72,_0x9b0b22[_0xddc7('0x3a')]);var _0x1715b1={'where':_0x56fa72[_0xddc7('0x37')]};return db[_0xddc7('0x26')][_0xddc7('0x1a')](_0x1715b1)[_0xddc7('0x21')](function(_0x46753b){_0x45912f[_0xddc7('0x1a')]=_0x46753b;if(_0x9b0b22[_0xddc7('0x2b')][_0xddc7('0x3b')]){_0x56fa72[_0xddc7('0x3c')]=[{'all':!![]}];}return db[_0xddc7('0x26')][_0xddc7('0x3d')](_0x56fa72);})[_0xddc7('0x21')](function(_0x37aa6a){_0x45912f['rows']=_0x37aa6a;return _0x45912f;})['then'](respondWithFilteredResult(_0x6cebfd,_0x56fa72))[_0xddc7('0x3e')](handleError(_0x6cebfd,null));};exports[_0xddc7('0x3f')]=function(_0xa86988,_0xdfbd21){var _0x9023e7={'raw':![],'where':{'id':_0xa86988[_0xddc7('0x40')]['id']}},_0x514bd4={};_0x514bd4[_0xddc7('0x2e')]=_[_0xddc7('0x2c')](db['ZendeskConfiguration'][_0xddc7('0x27')]);_0x514bd4[_0xddc7('0x2b')]=_['keys'](_0xa86988['query']);_0x514bd4['filters']=_[_0xddc7('0x2d')](_0x514bd4[_0xddc7('0x2e')],_0x514bd4[_0xddc7('0x2b')]);_0x9023e7[_0xddc7('0x30')]=_['intersection'](_0x514bd4[_0xddc7('0x2e')],qs[_0xddc7('0x2f')](_0xa86988[_0xddc7('0x2b')]['fields']));_0x9023e7[_0xddc7('0x30')]=_0x9023e7[_0xddc7('0x30')][_0xddc7('0x31')]?_0x9023e7[_0xddc7('0x30')]:_0x514bd4[_0xddc7('0x2e')];if(_0xa86988[_0xddc7('0x2b')][_0xddc7('0x3b')]){_0x9023e7[_0xddc7('0x3c')]=[{'all':!![]}];}_0x9023e7=_[_0xddc7('0x39')]({},_0x9023e7,_0xa86988[_0xddc7('0x3a')]);return db['ZendeskConfiguration'][_0xddc7('0x41')](_0x9023e7)[_0xddc7('0x21')](handleEntityNotFound(_0xdfbd21,null))[_0xddc7('0x21')](respondWithResult(_0xdfbd21,null))[_0xddc7('0x3e')](handleError(_0xdfbd21,null));};exports[_0xddc7('0x42')]=function(_0x9b9864,_0x559239){return db[_0xddc7('0x26')][_0xddc7('0x42')](_0x9b9864[_0xddc7('0x43')],{})[_0xddc7('0x21')](respondWithResult(_0x559239,0xc9))['catch'](handleError(_0x559239,null));};exports[_0xddc7('0x20')]=function(_0x25b763,_0x113951){if(_0x25b763[_0xddc7('0x43')]['id']){delete _0x25b763[_0xddc7('0x43')]['id'];}return db[_0xddc7('0x26')][_0xddc7('0x41')]({'where':{'id':_0x25b763[_0xddc7('0x40')]['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x113951,null))[_0xddc7('0x21')](saveUpdates(_0x25b763[_0xddc7('0x43')],null))[_0xddc7('0x21')](respondWithResult(_0x113951,null))[_0xddc7('0x3e')](handleError(_0x113951,null));};exports[_0xddc7('0x44')]=function(_0x1027cc,_0x42c765){return db[_0xddc7('0x26')][_0xddc7('0x41')]({'where':{'id':_0x1027cc[_0xddc7('0x40')]['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x42c765,null))[_0xddc7('0x21')](removeEntity(_0x42c765,null))[_0xddc7('0x3e')](handleError(_0x42c765,null));};exports[_0xddc7('0x45')]=function(_0xe8f2dd,_0x38fcc2,_0xf466b3){var _0x45ec99={};var _0x2309dd={};var _0x337e2f;var _0x39c302;return db[_0xddc7('0x26')][_0xddc7('0x46')]({'where':{'id':_0xe8f2dd['params']['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x38fcc2,null))[_0xddc7('0x21')](function(_0x20e1a1){if(_0x20e1a1){_0x337e2f=_0x20e1a1;_0x2309dd[_0xddc7('0x2e')]=_['keys'](db[_0xddc7('0x47')][_0xddc7('0x27')]);_0x2309dd[_0xddc7('0x2b')]=_[_0xddc7('0x2c')](_0xe8f2dd[_0xddc7('0x2b')]);_0x2309dd[_0xddc7('0x35')]=_['intersection'](_0x2309dd[_0xddc7('0x2e')],_0x2309dd[_0xddc7('0x2b')]);_0x45ec99[_0xddc7('0x30')]=_['intersection'](_0x2309dd[_0xddc7('0x2e')],qs[_0xddc7('0x2f')](_0xe8f2dd['query']['fields']));_0x45ec99['attributes']=_0x45ec99[_0xddc7('0x30')][_0xddc7('0x31')]?_0x45ec99[_0xddc7('0x30')]:_0x2309dd['model'];_0x45ec99[_0xddc7('0x33')]=qs[_0xddc7('0x34')](_0xe8f2dd[_0xddc7('0x2b')][_0xddc7('0x34')]);_0x45ec99[_0xddc7('0x37')]=qs[_0xddc7('0x35')](_[_0xddc7('0x48')](_0xe8f2dd[_0xddc7('0x2b')],_0x2309dd['filters']));if(_0xe8f2dd['query'][_0xddc7('0x36')]){_0x45ec99[_0xddc7('0x37')]=_[_0xddc7('0x39')](_0x45ec99[_0xddc7('0x37')],{'$or':_[_0xddc7('0x25')](_0x45ec99[_0xddc7('0x30')],function(_0x15bcc8){var _0x490ff3={};_0x490ff3[_0x15bcc8]={'$like':'%'+_0xe8f2dd[_0xddc7('0x2b')][_0xddc7('0x36')]+'%'};return _0x490ff3;})});}_0x45ec99=_[_0xddc7('0x39')]({},_0x45ec99,_0xe8f2dd[_0xddc7('0x3a')]);return _0x337e2f[_0xddc7('0x45')](_0x45ec99);}})['then'](function(_0x5749ad){if(_0x5749ad){_0x39c302=_0x5749ad[_0xddc7('0x31')];if(!_0xe8f2dd[_0xddc7('0x2b')]['hasOwnProperty'](_0xddc7('0x32'))){_0x45ec99['limit']=qs['limit'](_0xe8f2dd[_0xddc7('0x2b')][_0xddc7('0x19')]);_0x45ec99[_0xddc7('0x17')]=qs[_0xddc7('0x17')](_0xe8f2dd[_0xddc7('0x2b')][_0xddc7('0x17')]);}return _0x337e2f[_0xddc7('0x45')](_0x45ec99);}})['then'](function(_0x385356){if(_0x385356){return _0x385356?{'count':_0x39c302,'rows':_0x385356}:null;}})['then'](respondWithResult(_0x38fcc2,null))[_0xddc7('0x3e')](handleError(_0x38fcc2,null));};exports[_0xddc7('0x49')]=function(_0x197b1c,_0x158023,_0x1b5ab5){var _0xa9d738={};var _0x1c42e1={};var _0x22457c;var _0x171124;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x197b1c[_0xddc7('0x40')]['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x158023,null))[_0xddc7('0x21')](function(_0x4f0c56){if(_0x4f0c56){_0x22457c=_0x4f0c56;_0x1c42e1['model']=_[_0xddc7('0x2c')](db[_0xddc7('0x47')][_0xddc7('0x27')]);_0x1c42e1[_0xddc7('0x2b')]=_[_0xddc7('0x2c')](_0x197b1c[_0xddc7('0x2b')]);_0x1c42e1[_0xddc7('0x35')]=_['intersection'](_0x1c42e1[_0xddc7('0x2e')],_0x1c42e1['query']);_0xa9d738[_0xddc7('0x30')]=_[_0xddc7('0x2d')](_0x1c42e1[_0xddc7('0x2e')],qs[_0xddc7('0x2f')](_0x197b1c[_0xddc7('0x2b')][_0xddc7('0x2f')]));_0xa9d738[_0xddc7('0x30')]=_0xa9d738[_0xddc7('0x30')]['length']?_0xa9d738[_0xddc7('0x30')]:_0x1c42e1[_0xddc7('0x2e')];_0xa9d738['order']=qs[_0xddc7('0x34')](_0x197b1c['query'][_0xddc7('0x34')]);_0xa9d738['where']=qs[_0xddc7('0x35')](_[_0xddc7('0x48')](_0x197b1c['query'],_0x1c42e1[_0xddc7('0x35')]));if(_0x197b1c[_0xddc7('0x2b')]['filter']){_0xa9d738[_0xddc7('0x37')]=_[_0xddc7('0x39')](_0xa9d738['where'],{'$or':_[_0xddc7('0x25')](_0xa9d738[_0xddc7('0x30')],function(_0x5c74df){var _0x54c4c7={};_0x54c4c7[_0x5c74df]={'$like':'%'+_0x197b1c['query'][_0xddc7('0x36')]+'%'};return _0x54c4c7;})});}_0xa9d738=_[_0xddc7('0x39')]({},_0xa9d738,_0x197b1c[_0xddc7('0x3a')]);return _0x22457c[_0xddc7('0x49')](_0xa9d738);}})[_0xddc7('0x21')](function(_0x5a69c1){if(_0x5a69c1){_0x171124=_0x5a69c1['length'];if(!_0x197b1c[_0xddc7('0x2b')]['hasOwnProperty'](_0xddc7('0x32'))){_0xa9d738[_0xddc7('0x19')]=qs[_0xddc7('0x19')](_0x197b1c[_0xddc7('0x2b')][_0xddc7('0x19')]);_0xa9d738[_0xddc7('0x17')]=qs[_0xddc7('0x17')](_0x197b1c[_0xddc7('0x2b')][_0xddc7('0x17')]);}return _0x22457c[_0xddc7('0x49')](_0xa9d738);}})[_0xddc7('0x21')](function(_0x475216){if(_0x475216){return _0x475216?{'count':_0x171124,'rows':_0x475216}:null;}})[_0xddc7('0x21')](respondWithResult(_0x158023,null))[_0xddc7('0x3e')](handleError(_0x158023,null));};exports['getDescriptions']=function(_0x5673fd,_0x392651,_0x2d8908){var _0x62c5d6={};var _0x21d557={};var _0x2af3e1;var _0x907a9c;return db['ZendeskConfiguration'][_0xddc7('0x46')]({'where':{'id':_0x5673fd[_0xddc7('0x40')]['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x392651,null))['then'](function(_0x5c46a8){if(_0x5c46a8){_0x2af3e1=_0x5c46a8;_0x21d557[_0xddc7('0x2e')]=_[_0xddc7('0x2c')](db[_0xddc7('0x47')][_0xddc7('0x27')]);_0x21d557[_0xddc7('0x2b')]=_[_0xddc7('0x2c')](_0x5673fd['query']);_0x21d557[_0xddc7('0x35')]=_[_0xddc7('0x2d')](_0x21d557[_0xddc7('0x2e')],_0x21d557[_0xddc7('0x2b')]);_0x62c5d6[_0xddc7('0x30')]=_['intersection'](_0x21d557[_0xddc7('0x2e')],qs[_0xddc7('0x2f')](_0x5673fd['query'][_0xddc7('0x2f')]));_0x62c5d6[_0xddc7('0x30')]=_0x62c5d6[_0xddc7('0x30')]['length']?_0x62c5d6[_0xddc7('0x30')]:_0x21d557[_0xddc7('0x2e')];_0x62c5d6[_0xddc7('0x33')]=qs['sort'](_0x5673fd[_0xddc7('0x2b')][_0xddc7('0x34')]);_0x62c5d6[_0xddc7('0x37')]=qs[_0xddc7('0x35')](_[_0xddc7('0x48')](_0x5673fd[_0xddc7('0x2b')],_0x21d557['filters']));if(_0x5673fd[_0xddc7('0x2b')]['filter']){_0x62c5d6[_0xddc7('0x37')]=_['merge'](_0x62c5d6['where'],{'$or':_['map'](_0x62c5d6[_0xddc7('0x30')],function(_0x560bda){var _0x207bc3={};_0x207bc3[_0x560bda]={'$like':'%'+_0x5673fd[_0xddc7('0x2b')]['filter']+'%'};return _0x207bc3;})});}_0x62c5d6=_[_0xddc7('0x39')]({},_0x62c5d6,_0x5673fd[_0xddc7('0x3a')]);return _0x2af3e1[_0xddc7('0x4a')](_0x62c5d6);}})[_0xddc7('0x21')](function(_0x5b02e2){if(_0x5b02e2){_0x907a9c=_0x5b02e2['length'];if(!_0x5673fd[_0xddc7('0x2b')][_0xddc7('0x4b')](_0xddc7('0x32'))){_0x62c5d6[_0xddc7('0x19')]=qs[_0xddc7('0x19')](_0x5673fd[_0xddc7('0x2b')][_0xddc7('0x19')]);_0x62c5d6[_0xddc7('0x17')]=qs[_0xddc7('0x17')](_0x5673fd['query'][_0xddc7('0x17')]);}return _0x2af3e1[_0xddc7('0x4a')](_0x62c5d6);}})['then'](function(_0xe33e6d){if(_0xe33e6d){return _0xe33e6d?{'count':_0x907a9c,'rows':_0xe33e6d}:null;}})[_0xddc7('0x21')](respondWithResult(_0x392651,null))[_0xddc7('0x3e')](handleError(_0x392651,null));};exports[_0xddc7('0x4c')]=function(_0x3c8979,_0x2c64e3,_0x3e7a91){var _0x54bccb={};var _0x2484b5={};var _0xc65b4c;var _0x5ba050;return db[_0xddc7('0x26')][_0xddc7('0x46')]({'where':{'id':_0x3c8979[_0xddc7('0x40')]['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x2c64e3,null))[_0xddc7('0x21')](function(_0x5ea47c){if(_0x5ea47c){_0xc65b4c=_0x5ea47c;_0x2484b5[_0xddc7('0x2e')]=_[_0xddc7('0x2c')](db['Tag'][_0xddc7('0x27')]);_0x2484b5[_0xddc7('0x2b')]=_[_0xddc7('0x2c')](_0x3c8979['query']);_0x2484b5[_0xddc7('0x35')]=_[_0xddc7('0x2d')](_0x2484b5['model'],_0x2484b5[_0xddc7('0x2b')]);_0x54bccb['attributes']=_[_0xddc7('0x2d')](_0x2484b5[_0xddc7('0x2e')],qs[_0xddc7('0x2f')](_0x3c8979[_0xddc7('0x2b')][_0xddc7('0x2f')]));_0x54bccb['attributes']=_0x54bccb[_0xddc7('0x30')][_0xddc7('0x31')]?_0x54bccb[_0xddc7('0x30')]:_0x2484b5[_0xddc7('0x2e')];_0x54bccb[_0xddc7('0x33')]=qs[_0xddc7('0x34')](_0x3c8979[_0xddc7('0x2b')][_0xddc7('0x34')]);_0x54bccb[_0xddc7('0x37')]=qs[_0xddc7('0x35')](_[_0xddc7('0x48')](_0x3c8979[_0xddc7('0x2b')],_0x2484b5[_0xddc7('0x35')]));if(_0x3c8979['query']['filter']){_0x54bccb[_0xddc7('0x37')]=_[_0xddc7('0x39')](_0x54bccb[_0xddc7('0x37')],{'$or':_['map'](_0x54bccb['attributes'],function(_0x5eb865){var _0x3ea61f={};_0x3ea61f[_0x5eb865]={'$like':'%'+_0x3c8979[_0xddc7('0x2b')][_0xddc7('0x36')]+'%'};return _0x3ea61f;})});}_0x54bccb=_[_0xddc7('0x39')]({},_0x54bccb,_0x3c8979[_0xddc7('0x3a')]);return _0xc65b4c[_0xddc7('0x4c')](_0x54bccb);}})[_0xddc7('0x21')](function(_0x46d808){if(_0x46d808){_0x5ba050=_0x46d808[_0xddc7('0x31')];if(!_0x3c8979['query']['hasOwnProperty'](_0xddc7('0x32'))){_0x54bccb[_0xddc7('0x19')]=qs[_0xddc7('0x19')](_0x3c8979[_0xddc7('0x2b')][_0xddc7('0x19')]);_0x54bccb[_0xddc7('0x17')]=qs['offset'](_0x3c8979['query'][_0xddc7('0x17')]);}return _0xc65b4c[_0xddc7('0x4c')](_0x54bccb);}})[_0xddc7('0x21')](function(_0x1b6056){if(_0x1b6056){return _0x1b6056?{'count':_0x5ba050,'rows':_0x1b6056}:null;}})['then'](respondWithResult(_0x2c64e3,null))[_0xddc7('0x3e')](handleError(_0x2c64e3,null));};exports['setTags']=function(_0x28f945,_0x5a5748,_0xeeddfb){if(_0x28f945[_0xddc7('0x43')]['id']){delete _0x28f945[_0xddc7('0x43')]['id'];}return db['ZendeskConfiguration'][_0xddc7('0x46')]({'where':{'id':_0x28f945[_0xddc7('0x40')]['id']}})[_0xddc7('0x21')](handleEntityNotFound(_0x5a5748,null))[_0xddc7('0x21')](function(_0x23f95e){if(_0x23f95e){return _0x23f95e[_0xddc7('0x4d')](_0x28f945['body'][_0xddc7('0x4e')]||[]);}return null;})[_0xddc7('0x21')](respondWithResult(_0x5a5748,null))['catch'](handleError(_0x5a5748,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index f338097..e289fa1 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 _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x50c988,_0x555724){_0x50c988=_0x50c988-0x0;var _0x418f84=_0xd7d1[_0x50c988];return _0x418f84;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x566f1a,_0x2ed52e){_0x566f1a=_0x566f1a-0x0;var _0x549445=_0xd7d1[_0x566f1a];return _0x549445;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'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 f00f32d..1498fea 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 _0x0440=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3a4c07,_0x18440c){var _0x5a4943=function(_0x4afb24){while(--_0x4afb24){_0x3a4c07['push'](_0x3a4c07['shift']());}};_0x5a4943(++_0x18440c);}(_0x0440,0xed));var _0x0044=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x0440[_0x5a5395];return _0x4da43d;};'use strict';var _=require('lodash');var util=require(_0x0044('0x0'));var moment=require(_0x0044('0x1'));var BPromise=require(_0x0044('0x2'));var rs=require(_0x0044('0x3'));var fs=require('fs');var Redis=require(_0x0044('0x4'));var db=require(_0x0044('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0044('0x6'))(_0x0044('0x7'));var config=require(_0x0044('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0044('0x9')][_0x0044('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11ef1e,_0x5e1619,_0x1067be){return new BPromise(function(_0x1917b2,_0x268c47){return client[_0x0044('0xb')](_0x11ef1e,_0x1067be)[_0x0044('0xc')](function(_0x632b14){logger[_0x0044('0xd')](_0x0044('0xe'),_0x5e1619,_0x0044('0xf'));logger['debug'](_0x0044('0x10'),_0x5e1619,_0x0044('0xf'),JSON['stringify'](_0x632b14));if(_0x632b14['error']){if(_0x632b14[_0x0044('0x11')][_0x0044('0x12')]===0x1f4){logger[_0x0044('0x11')](_0x0044('0xe'),_0x5e1619,_0x632b14[_0x0044('0x11')][_0x0044('0x13')]);return _0x268c47(_0x632b14[_0x0044('0x11')][_0x0044('0x13')]);}logger[_0x0044('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5e1619,_0x632b14[_0x0044('0x11')][_0x0044('0x13')]);return _0x1917b2(_0x632b14[_0x0044('0x11')][_0x0044('0x13')]);}else{logger[_0x0044('0xd')](_0x0044('0xe'),_0x5e1619,'request\x20sent');_0x1917b2(_0x632b14[_0x0044('0x14')][_0x0044('0x13')]);}})[_0x0044('0x15')](function(_0x56a879){logger['error'](_0x0044('0xe'),_0x5e1619,_0x56a879);_0x268c47(_0x56a879);});});} \ No newline at end of file +var _0x6439=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x4d227b,_0x52b248){var _0x3a2293=function(_0x46385e){while(--_0x46385e){_0x4d227b['push'](_0x4d227b['shift']());}};_0x3a2293(++_0x52b248);}(_0x6439,0xa0));var _0x9643=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x6439[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x9643('0x0'));var util=require('util');var moment=require(_0x9643('0x1'));var BPromise=require(_0x9643('0x2'));var rs=require(_0x9643('0x3'));var fs=require('fs');var Redis=require(_0x9643('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9643('0x5'));var logger=require('../../config/logger')(_0x9643('0x6'));var config=require(_0x9643('0x7'));var jayson=require(_0x9643('0x8'));var client=jayson[_0x9643('0x9')][_0x9643('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x559934,_0x40e242,_0x3fab48){return new BPromise(function(_0x2a25d0,_0x399eca){return client[_0x9643('0xb')](_0x559934,_0x3fab48)[_0x9643('0xc')](function(_0x1fbb1b){logger[_0x9643('0xd')](_0x9643('0xe'),_0x40e242,_0x9643('0xf'));logger['debug'](_0x9643('0x10'),_0x40e242,_0x9643('0xf'),JSON[_0x9643('0x11')](_0x1fbb1b));if(_0x1fbb1b[_0x9643('0x12')]){if(_0x1fbb1b['error'][_0x9643('0x13')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x40e242,_0x1fbb1b[_0x9643('0x12')][_0x9643('0x14')]);return _0x399eca(_0x1fbb1b[_0x9643('0x12')]['message']);}logger['error'](_0x9643('0xe'),_0x40e242,_0x1fbb1b[_0x9643('0x12')]['message']);return _0x2a25d0(_0x1fbb1b['error'][_0x9643('0x14')]);}else{logger[_0x9643('0xd')](_0x9643('0xe'),_0x40e242,_0x9643('0xf'));_0x2a25d0(_0x1fbb1b['result'][_0x9643('0x14')]);}})[_0x9643('0x15')](function(_0x7ffad6){logger['error'](_0x9643('0xe'),_0x40e242,_0x7ffad6);_0x399eca(_0x7ffad6);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 5e9c313..d1eccee 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 _0x7c81=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x594ad8,_0x3a536e){var _0x7055dd=function(_0x1c35d3){while(--_0x1c35d3){_0x594ad8['push'](_0x594ad8['shift']());}};_0x7055dd(++_0x3a536e);}(_0x7c81,0x1a9));var _0x17c8=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x7c81[_0x166e96];return _0x553d73;};'use strict';var multer=require(_0x17c8('0x0'));var util=require(_0x17c8('0x1'));var path=require(_0x17c8('0x2'));var timeout=require('connect-timeout');var express=require(_0x17c8('0x3'));var router=express[_0x17c8('0x4')]();var fs_extra=require(_0x17c8('0x5'));var auth=require(_0x17c8('0x6'));var interaction=require(_0x17c8('0x7'));var config=require(_0x17c8('0x8'));var controller=require(_0x17c8('0x9'));router[_0x17c8('0xa')]('/',auth[_0x17c8('0xb')](),controller[_0x17c8('0xc')]);router[_0x17c8('0xa')](_0x17c8('0xd'),auth['isAuthenticated'](),controller[_0x17c8('0xe')]);router[_0x17c8('0xf')]('/',auth['isAuthenticated'](),controller[_0x17c8('0x10')]);router[_0x17c8('0x11')](_0x17c8('0xd'),auth[_0x17c8('0xb')](),controller[_0x17c8('0x12')]);router[_0x17c8('0x13')](_0x17c8('0xd'),auth['isAuthenticated'](),controller[_0x17c8('0x14')]);module[_0x17c8('0x15')]=router; \ No newline at end of file +var _0xbd09=['create','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show'];(function(_0x6f9533,_0x21bf48){var _0x137093=function(_0x2193fe){while(--_0x2193fe){_0x6f9533['push'](_0x6f9533['shift']());}};_0x137093(++_0x21bf48);}(_0xbd09,0x15c));var _0x9bd0=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xbd09[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9bd0('0x0'));var timeout=require(_0x9bd0('0x1'));var express=require(_0x9bd0('0x2'));var router=express[_0x9bd0('0x3')]();var fs_extra=require(_0x9bd0('0x4'));var auth=require(_0x9bd0('0x5'));var interaction=require(_0x9bd0('0x6'));var config=require('../../config/environment');var controller=require(_0x9bd0('0x7'));router[_0x9bd0('0x8')]('/',auth[_0x9bd0('0x9')](),controller[_0x9bd0('0xa')]);router[_0x9bd0('0x8')]('/:id',auth[_0x9bd0('0x9')](),controller[_0x9bd0('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9bd0('0xc')]);router[_0x9bd0('0xd')](_0x9bd0('0xe'),auth['isAuthenticated'](),controller[_0x9bd0('0xf')]);router[_0x9bd0('0x10')](_0x9bd0('0xe'),auth[_0x9bd0('0x9')](),controller[_0x9bd0('0x11')]);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 4208852..47da98e 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 _0x0780=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0780,0x138));var _0x0078=function(_0x148485,_0x4c447f){_0x148485=_0x148485-0x0;var _0x5db933=_0x0780[_0x148485];return _0x5db933;};'use strict';var Sequelize=require(_0x0078('0x0'));module[_0x0078('0x1')]={'type':{'type':Sequelize[_0x0078('0x2')]('string',_0x0078('0x3'),_0x0078('0x4'),_0x0078('0x5'),_0x0078('0x6')),'defaultValue':_0x0078('0x7')},'content':{'type':Sequelize[_0x0078('0x8')]},'key':{'type':Sequelize[_0x0078('0x8')]},'keyType':{'type':Sequelize[_0x0078('0x2')](_0x0078('0x7'),_0x0078('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0078('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0078('0x8')]},'customField':{'type':Sequelize[_0x0078('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0078('0x8')]}}; \ No newline at end of file +var _0x17eb=['picklist','STRING','string','variable','customVariable','keyValue'];(function(_0x546b32,_0x331fbd){var _0x1cdf6e=function(_0x4b4c86){while(--_0x4b4c86){_0x546b32['push'](_0x546b32['shift']());}};_0x1cdf6e(++_0x331fbd);}(_0x17eb,0x1ee));var _0xb17e=function(_0x1fa04f,_0x5a792f){_0x1fa04f=_0x1fa04f-0x0;var _0x2bd31c=_0x17eb[_0x1fa04f];return _0x2bd31c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xb17e('0x0'),_0xb17e('0x1'),_0xb17e('0x2'),_0xb17e('0x3'),_0xb17e('0x4')),'defaultValue':_0xb17e('0x0')},'content':{'type':Sequelize[_0xb17e('0x5')]},'key':{'type':Sequelize[_0xb17e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb17e('0x0'),_0xb17e('0x1'),_0xb17e('0x2'))},'keyContent':{'type':Sequelize[_0xb17e('0x5')]},'idField':{'type':Sequelize[_0xb17e('0x5')]},'nameField':{'type':Sequelize[_0xb17e('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb17e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 886821d..251ba9e 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 _0x6baa=['count','limit','Content-Range','apply','reject','save','update','then','name','send','index','map','ZendeskField','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','options','find','create','body','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x4adfa1,_0x493e0a){var _0x5371bc=function(_0x11d39e){while(--_0x11d39e){_0x4adfa1['push'](_0x4adfa1['shift']());}};_0x5371bc(++_0x493e0a);}(_0x6baa,0x1e2));var _0xa6ba=function(_0x4d716a,_0x346802){_0x4d716a=_0x4d716a-0x0;var _0x3eac0e=_0x6baa[_0x4d716a];return _0x3eac0e;};'use strict';var emlformat=require(_0xa6ba('0x0'));var rimraf=require(_0xa6ba('0x1'));var zipdir=require(_0xa6ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6ba('0x3'));var moment=require(_0xa6ba('0x4'));var BPromise=require(_0xa6ba('0x5'));var Mustache=require('mustache');var util=require(_0xa6ba('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa6ba('0x7'));var fs=require('fs');var fs_extra=require(_0xa6ba('0x8'));var _=require('lodash');var squel=require(_0xa6ba('0x9'));var crypto=require(_0xa6ba('0xa'));var jsforce=require(_0xa6ba('0xb'));var deskjs=require(_0xa6ba('0xc'));var toCsv=require(_0xa6ba('0xd'));var querystring=require(_0xa6ba('0xe'));var Papa=require(_0xa6ba('0xf'));var Redis=require(_0xa6ba('0x10'));var authService=require(_0xa6ba('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6ba('0x12'));var logger=require(_0xa6ba('0x13'))(_0xa6ba('0x14'));var utils=require(_0xa6ba('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6ba('0x16'))['db'];function respondWithStatusCode(_0xdedbd7,_0x503dd1){_0x503dd1=_0x503dd1||0xcc;return function(_0x5a0659){if(_0x5a0659){return _0xdedbd7[_0xa6ba('0x17')](_0x503dd1);}return _0xdedbd7[_0xa6ba('0x18')](_0x503dd1)[_0xa6ba('0x19')]();};}function respondWithResult(_0xf26832,_0x436d47){_0x436d47=_0x436d47||0xc8;return function(_0x528a6e){if(_0x528a6e){return _0xf26832[_0xa6ba('0x18')](_0x436d47)[_0xa6ba('0x1a')](_0x528a6e);}};}function respondWithFilteredResult(_0x34f453,_0x176b77){return function(_0x2a56fd){if(_0x2a56fd){var _0x570387=typeof _0x176b77[_0xa6ba('0x1b')]===_0xa6ba('0x1c')&&typeof _0x176b77['limit']==='undefined';var _0x24c040=_0x2a56fd['count'];var _0x350064=_0x570387?0x0:_0x176b77[_0xa6ba('0x1b')];var _0x37020f=_0x570387?_0x2a56fd[_0xa6ba('0x1d')]:_0x176b77[_0xa6ba('0x1b')]+_0x176b77[_0xa6ba('0x1e')];var _0x51698e;if(_0x37020f>=_0x24c040){_0x37020f=_0x24c040;_0x51698e=0xc8;}else{_0x51698e=0xce;}_0x34f453['status'](_0x51698e);return _0x34f453['set'](_0xa6ba('0x1f'),_0x350064+'-'+_0x37020f+'/'+_0x24c040)[_0xa6ba('0x1a')](_0x2a56fd);}return null;};}function patchUpdates(_0x3c5de9){return function(_0x5f3da8){try{jsonpatch[_0xa6ba('0x20')](_0x5f3da8,_0x3c5de9,!![]);}catch(_0x2ec14b){return BPromise[_0xa6ba('0x21')](_0x2ec14b);}return _0x5f3da8[_0xa6ba('0x22')]();};}function saveUpdates(_0x13ebff,_0x4a1a30){return function(_0x30013b){if(_0x30013b){return _0x30013b[_0xa6ba('0x23')](_0x13ebff)[_0xa6ba('0x24')](function(_0x156ddd){return _0x156ddd;});}return null;};}function removeEntity(_0x38bbcd,_0x2a5aca){return function(_0x16f90d){if(_0x16f90d){return _0x16f90d['destroy']()[_0xa6ba('0x24')](function(){_0x38bbcd[_0xa6ba('0x18')](0xcc)[_0xa6ba('0x19')]();});}};}function handleEntityNotFound(_0x3edb48,_0x2dbfa2){return function(_0x492135){if(!_0x492135){_0x3edb48['sendStatus'](0x194);}return _0x492135;};}function handleError(_0x23bd03,_0x26c956){_0x26c956=_0x26c956||0x1f4;return function(_0x148fcd){logger['error'](_0x148fcd['stack']);if(_0x148fcd[_0xa6ba('0x25')]){delete _0x148fcd[_0xa6ba('0x25')];}_0x23bd03[_0xa6ba('0x18')](_0x26c956)[_0xa6ba('0x26')](_0x148fcd);};}exports[_0xa6ba('0x27')]=function(_0x162d76,_0x2098df){var _0x5bf853={},_0x1dfc99={},_0x37e22e={'count':0x0,'rows':[]};var _0x808320=_[_0xa6ba('0x28')](db[_0xa6ba('0x29')][_0xa6ba('0x2a')],function(_0x105773){return{'name':_0x105773['fieldName'],'type':_0x105773['type'][_0xa6ba('0x2b')]};});_0x1dfc99[_0xa6ba('0x2c')]=_[_0xa6ba('0x28')](_0x808320,'name');_0x1dfc99[_0xa6ba('0x2d')]=_[_0xa6ba('0x2e')](_0x162d76[_0xa6ba('0x2d')]);_0x1dfc99[_0xa6ba('0x2f')]=_[_0xa6ba('0x30')](_0x1dfc99[_0xa6ba('0x2c')],_0x1dfc99['query']);_0x5bf853[_0xa6ba('0x31')]=_['intersection'](_0x1dfc99['model'],qs[_0xa6ba('0x32')](_0x162d76['query'][_0xa6ba('0x32')]));_0x5bf853['attributes']=_0x5bf853['attributes'][_0xa6ba('0x33')]?_0x5bf853[_0xa6ba('0x31')]:_0x1dfc99[_0xa6ba('0x2c')];if(!_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x34')](_0xa6ba('0x35'))){_0x5bf853[_0xa6ba('0x1e')]=qs[_0xa6ba('0x1e')](_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x1e')]);_0x5bf853[_0xa6ba('0x1b')]=qs[_0xa6ba('0x1b')](_0x162d76['query']['offset']);}_0x5bf853[_0xa6ba('0x36')]=qs[_0xa6ba('0x37')](_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x37')]);_0x5bf853[_0xa6ba('0x38')]=qs[_0xa6ba('0x2f')](_[_0xa6ba('0x39')](_0x162d76[_0xa6ba('0x2d')],_0x1dfc99[_0xa6ba('0x2f')]),_0x808320);if(_0x162d76['query'][_0xa6ba('0x3a')]){_0x5bf853[_0xa6ba('0x38')]=_[_0xa6ba('0x3b')](_0x5bf853[_0xa6ba('0x38')],{'$or':_['map'](_0x808320,function(_0x212654){if(_0x212654[_0xa6ba('0x3c')]!==_0xa6ba('0x3d')){var _0x43b1dc={};_0x43b1dc[_0x212654[_0xa6ba('0x25')]]={'$like':'%'+_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x3a')]+'%'};return _0x43b1dc;}})});}_0x5bf853=_[_0xa6ba('0x3b')]({},_0x5bf853,_0x162d76['options']);var _0x2d11d7={'where':_0x5bf853['where']};return db[_0xa6ba('0x29')][_0xa6ba('0x1d')](_0x2d11d7)[_0xa6ba('0x24')](function(_0x24f95a){_0x37e22e['count']=_0x24f95a;if(_0x162d76[_0xa6ba('0x2d')][_0xa6ba('0x3e')]){_0x5bf853[_0xa6ba('0x3f')]=[{'all':!![]}];}return db[_0xa6ba('0x29')][_0xa6ba('0x40')](_0x5bf853);})[_0xa6ba('0x24')](function(_0x30cbf1){_0x37e22e[_0xa6ba('0x41')]=_0x30cbf1;return _0x37e22e;})['then'](respondWithFilteredResult(_0x2098df,_0x5bf853))['catch'](handleError(_0x2098df,null));};exports[_0xa6ba('0x42')]=function(_0x1b21c2,_0x4a8734){var _0x1dc3ae={'raw':!![],'where':{'id':_0x1b21c2['params']['id']}},_0x410b9f={};_0x410b9f[_0xa6ba('0x2c')]=_[_0xa6ba('0x2e')](db[_0xa6ba('0x29')][_0xa6ba('0x2a')]);_0x410b9f[_0xa6ba('0x2d')]=_[_0xa6ba('0x2e')](_0x1b21c2['query']);_0x410b9f['filters']=_[_0xa6ba('0x30')](_0x410b9f[_0xa6ba('0x2c')],_0x410b9f['query']);_0x1dc3ae[_0xa6ba('0x31')]=_[_0xa6ba('0x30')](_0x410b9f[_0xa6ba('0x2c')],qs['fields'](_0x1b21c2[_0xa6ba('0x2d')][_0xa6ba('0x32')]));_0x1dc3ae[_0xa6ba('0x31')]=_0x1dc3ae[_0xa6ba('0x31')]['length']?_0x1dc3ae[_0xa6ba('0x31')]:_0x410b9f[_0xa6ba('0x2c')];if(_0x1b21c2[_0xa6ba('0x2d')][_0xa6ba('0x3e')]){_0x1dc3ae['include']=[{'all':!![]}];}_0x1dc3ae=_[_0xa6ba('0x3b')]({},_0x1dc3ae,_0x1b21c2[_0xa6ba('0x43')]);return db[_0xa6ba('0x29')][_0xa6ba('0x44')](_0x1dc3ae)['then'](handleEntityNotFound(_0x4a8734,null))['then'](respondWithResult(_0x4a8734,null))['catch'](handleError(_0x4a8734,null));};exports[_0xa6ba('0x45')]=function(_0x921dfa,_0xe8642d){return db[_0xa6ba('0x29')][_0xa6ba('0x45')](_0x921dfa[_0xa6ba('0x46')],{})[_0xa6ba('0x24')](respondWithResult(_0xe8642d,0xc9))[_0xa6ba('0x47')](handleError(_0xe8642d,null));};exports[_0xa6ba('0x23')]=function(_0x34aefc,_0x398f82){if(_0x34aefc[_0xa6ba('0x46')]['id']){delete _0x34aefc[_0xa6ba('0x46')]['id'];}return db[_0xa6ba('0x29')][_0xa6ba('0x44')]({'where':{'id':_0x34aefc[_0xa6ba('0x48')]['id']}})[_0xa6ba('0x24')](handleEntityNotFound(_0x398f82,null))[_0xa6ba('0x24')](saveUpdates(_0x34aefc[_0xa6ba('0x46')],null))['then'](respondWithResult(_0x398f82,null))[_0xa6ba('0x47')](handleError(_0x398f82,null));};exports['destroy']=function(_0x4d9d8e,_0x1d7129){return db['ZendeskField'][_0xa6ba('0x44')]({'where':{'id':_0x4d9d8e['params']['id']}})[_0xa6ba('0x24')](handleEntityNotFound(_0x1d7129,null))[_0xa6ba('0x24')](removeEntity(_0x1d7129,null))['catch'](handleError(_0x1d7129,null));}; \ No newline at end of file +var _0xb99b=['length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','model','query','keys','intersection','fields','attributes'];(function(_0x17df16,_0x84c577){var _0x1ba549=function(_0x4a368c){while(--_0x4a368c){_0x17df16['push'](_0x17df16['shift']());}};_0x1ba549(++_0x84c577);}(_0xb99b,0xa9));var _0xbb99=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb99b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbb99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb99('0x1'));var jsonpatch=require(_0xbb99('0x2'));var rp=require('request-promise');var moment=require(_0xbb99('0x3'));var BPromise=require(_0xbb99('0x4'));var Mustache=require(_0xbb99('0x5'));var util=require(_0xbb99('0x6'));var path=require(_0xbb99('0x7'));var sox=require('sox');var csv=require(_0xbb99('0x8'));var ejs=require(_0xbb99('0x9'));var fs=require('fs');var fs_extra=require(_0xbb99('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb99('0xb'));var jsforce=require(_0xbb99('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbb99('0x8'));var querystring=require('querystring');var Papa=require(_0xbb99('0xd'));var Redis=require(_0xbb99('0xe'));var authService=require(_0xbb99('0xf'));var qs=require(_0xbb99('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb99('0x11'));var logger=require(_0xbb99('0x12'))(_0xbb99('0x13'));var utils=require(_0xbb99('0x14'));var config=require(_0xbb99('0x15'));var licenseUtil=require(_0xbb99('0x16'));var db=require(_0xbb99('0x17'))['db'];function respondWithStatusCode(_0x482f94,_0x51db42){_0x51db42=_0x51db42||0xcc;return function(_0x3e5f67){if(_0x3e5f67){return _0x482f94[_0xbb99('0x18')](_0x51db42);}return _0x482f94[_0xbb99('0x19')](_0x51db42)[_0xbb99('0x1a')]();};}function respondWithResult(_0x231eeb,_0x5f4fcc){_0x5f4fcc=_0x5f4fcc||0xc8;return function(_0x7b2faa){if(_0x7b2faa){return _0x231eeb[_0xbb99('0x19')](_0x5f4fcc)[_0xbb99('0x1b')](_0x7b2faa);}};}function respondWithFilteredResult(_0x3fcfa5,_0x476615){return function(_0xde9808){if(_0xde9808){var _0x96dbe5=typeof _0x476615['offset']===_0xbb99('0x1c')&&typeof _0x476615['limit']===_0xbb99('0x1c');var _0x32f9e0=_0xde9808[_0xbb99('0x1d')];var _0xe4aebc=_0x96dbe5?0x0:_0x476615[_0xbb99('0x1e')];var _0x3392f8=_0x96dbe5?_0xde9808[_0xbb99('0x1d')]:_0x476615[_0xbb99('0x1e')]+_0x476615['limit'];var _0x47390b;if(_0x3392f8>=_0x32f9e0){_0x3392f8=_0x32f9e0;_0x47390b=0xc8;}else{_0x47390b=0xce;}_0x3fcfa5[_0xbb99('0x19')](_0x47390b);return _0x3fcfa5[_0xbb99('0x1f')](_0xbb99('0x20'),_0xe4aebc+'-'+_0x3392f8+'/'+_0x32f9e0)['json'](_0xde9808);}return null;};}function patchUpdates(_0x4e623f){return function(_0x1a3d82){try{jsonpatch['apply'](_0x1a3d82,_0x4e623f,!![]);}catch(_0x143978){return BPromise[_0xbb99('0x21')](_0x143978);}return _0x1a3d82[_0xbb99('0x22')]();};}function saveUpdates(_0x29b657,_0x1d4bc3){return function(_0x2b823a){if(_0x2b823a){return _0x2b823a[_0xbb99('0x23')](_0x29b657)[_0xbb99('0x24')](function(_0x3662ca){return _0x3662ca;});}return null;};}function removeEntity(_0x1b284d,_0x21a8f4){return function(_0x30bbca){if(_0x30bbca){return _0x30bbca[_0xbb99('0x25')]()[_0xbb99('0x24')](function(){_0x1b284d[_0xbb99('0x19')](0xcc)[_0xbb99('0x1a')]();});}};}function handleEntityNotFound(_0x514fd5,_0x487f0a){return function(_0x3e542b){if(!_0x3e542b){_0x514fd5[_0xbb99('0x18')](0x194);}return _0x3e542b;};}function handleError(_0x21e26a,_0xe002a6){_0xe002a6=_0xe002a6||0x1f4;return function(_0x3ebb6f){logger[_0xbb99('0x26')](_0x3ebb6f[_0xbb99('0x27')]);if(_0x3ebb6f[_0xbb99('0x28')]){delete _0x3ebb6f[_0xbb99('0x28')];}_0x21e26a[_0xbb99('0x19')](_0xe002a6)[_0xbb99('0x29')](_0x3ebb6f);};}exports[_0xbb99('0x2a')]=function(_0x5d5afd,_0x44fc62){var _0x19cae0={},_0x10d370={},_0x47ae71={'count':0x0,'rows':[]};var _0x3d954c=_[_0xbb99('0x2b')](db[_0xbb99('0x2c')][_0xbb99('0x2d')],function(_0xf25929){return{'name':_0xf25929['fieldName'],'type':_0xf25929[_0xbb99('0x2e')]['key']};});_0x10d370[_0xbb99('0x2f')]=_['map'](_0x3d954c,'name');_0x10d370[_0xbb99('0x30')]=_[_0xbb99('0x31')](_0x5d5afd[_0xbb99('0x30')]);_0x10d370['filters']=_['intersection'](_0x10d370[_0xbb99('0x2f')],_0x10d370['query']);_0x19cae0['attributes']=_[_0xbb99('0x32')](_0x10d370[_0xbb99('0x2f')],qs['fields'](_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x33')]));_0x19cae0[_0xbb99('0x34')]=_0x19cae0[_0xbb99('0x34')][_0xbb99('0x35')]?_0x19cae0[_0xbb99('0x34')]:_0x10d370['model'];if(!_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x36')](_0xbb99('0x37'))){_0x19cae0['limit']=qs['limit'](_0x5d5afd['query'][_0xbb99('0x38')]);_0x19cae0[_0xbb99('0x1e')]=qs['offset'](_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x1e')]);}_0x19cae0[_0xbb99('0x39')]=qs[_0xbb99('0x3a')](_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x3a')]);_0x19cae0[_0xbb99('0x3b')]=qs[_0xbb99('0x3c')](_['pick'](_0x5d5afd[_0xbb99('0x30')],_0x10d370[_0xbb99('0x3c')]),_0x3d954c);if(_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x3d')]){_0x19cae0[_0xbb99('0x3b')]=_[_0xbb99('0x3e')](_0x19cae0[_0xbb99('0x3b')],{'$or':_[_0xbb99('0x2b')](_0x3d954c,function(_0x193090){if(_0x193090[_0xbb99('0x2e')]!=='VIRTUAL'){var _0x12d6cc={};_0x12d6cc[_0x193090[_0xbb99('0x28')]]={'$like':'%'+_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x3d')]+'%'};return _0x12d6cc;}})});}_0x19cae0=_[_0xbb99('0x3e')]({},_0x19cae0,_0x5d5afd[_0xbb99('0x3f')]);var _0x530d49={'where':_0x19cae0[_0xbb99('0x3b')]};return db[_0xbb99('0x2c')]['count'](_0x530d49)[_0xbb99('0x24')](function(_0x5b8b57){_0x47ae71[_0xbb99('0x1d')]=_0x5b8b57;if(_0x5d5afd[_0xbb99('0x30')][_0xbb99('0x40')]){_0x19cae0[_0xbb99('0x41')]=[{'all':!![]}];}return db[_0xbb99('0x2c')][_0xbb99('0x42')](_0x19cae0);})[_0xbb99('0x24')](function(_0x1b8876){_0x47ae71[_0xbb99('0x43')]=_0x1b8876;return _0x47ae71;})[_0xbb99('0x24')](respondWithFilteredResult(_0x44fc62,_0x19cae0))[_0xbb99('0x44')](handleError(_0x44fc62,null));};exports[_0xbb99('0x45')]=function(_0x57e388,_0x17b5aa){var _0x398aa0={'raw':!![],'where':{'id':_0x57e388[_0xbb99('0x46')]['id']}},_0x20c76f={};_0x20c76f[_0xbb99('0x2f')]=_[_0xbb99('0x31')](db['ZendeskField']['rawAttributes']);_0x20c76f[_0xbb99('0x30')]=_[_0xbb99('0x31')](_0x57e388['query']);_0x20c76f[_0xbb99('0x3c')]=_[_0xbb99('0x32')](_0x20c76f[_0xbb99('0x2f')],_0x20c76f[_0xbb99('0x30')]);_0x398aa0['attributes']=_[_0xbb99('0x32')](_0x20c76f[_0xbb99('0x2f')],qs[_0xbb99('0x33')](_0x57e388['query'][_0xbb99('0x33')]));_0x398aa0['attributes']=_0x398aa0[_0xbb99('0x34')]['length']?_0x398aa0[_0xbb99('0x34')]:_0x20c76f[_0xbb99('0x2f')];if(_0x57e388[_0xbb99('0x30')]['includeAll']){_0x398aa0[_0xbb99('0x41')]=[{'all':!![]}];}_0x398aa0=_['merge']({},_0x398aa0,_0x57e388[_0xbb99('0x3f')]);return db[_0xbb99('0x2c')]['find'](_0x398aa0)[_0xbb99('0x24')](handleEntityNotFound(_0x17b5aa,null))['then'](respondWithResult(_0x17b5aa,null))[_0xbb99('0x44')](handleError(_0x17b5aa,null));};exports['create']=function(_0x3b2246,_0x1dac4d){return db[_0xbb99('0x2c')][_0xbb99('0x47')](_0x3b2246[_0xbb99('0x48')],{})[_0xbb99('0x24')](respondWithResult(_0x1dac4d,0xc9))[_0xbb99('0x44')](handleError(_0x1dac4d,null));};exports[_0xbb99('0x23')]=function(_0x532f26,_0x1e3d2a){if(_0x532f26[_0xbb99('0x48')]['id']){delete _0x532f26[_0xbb99('0x48')]['id'];}return db[_0xbb99('0x2c')][_0xbb99('0x49')]({'where':{'id':_0x532f26[_0xbb99('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e3d2a,null))[_0xbb99('0x24')](saveUpdates(_0x532f26['body'],null))['then'](respondWithResult(_0x1e3d2a,null))['catch'](handleError(_0x1e3d2a,null));};exports[_0xbb99('0x25')]=function(_0x27fce0,_0x399822){return db[_0xbb99('0x2c')]['find']({'where':{'id':_0x27fce0[_0xbb99('0x46')]['id']}})[_0xbb99('0x24')](handleEntityNotFound(_0x399822,null))[_0xbb99('0x24')](removeEntity(_0x399822,null))[_0xbb99('0x44')](handleError(_0x399822,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 48bb5fa..31ef1f2 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 _0x48bd=['../../config/environment','idField','FieldId','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x1f4044,_0x1af817){var _0x544a89=function(_0x3a816f){while(--_0x3a816f){_0x1f4044['push'](_0x1f4044['shift']());}};_0x544a89(++_0x1af817);}(_0x48bd,0x1b3));var _0xd48b=function(_0xe6a7d8,_0x24f39a){_0xe6a7d8=_0xe6a7d8-0x0;var _0x5412f5=_0x48bd[_0xe6a7d8];return _0x5412f5;};'use strict';var _=require(_0xd48b('0x0'));var util=require(_0xd48b('0x1'));var logger=require(_0xd48b('0x2'))(_0xd48b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd48b('0x4'));var fs=require('fs');var path=require(_0xd48b('0x5'));var rimraf=require('rimraf');var config=require(_0xd48b('0x6'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x47e74e,_0x40e579){return _0x47e74e['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xd48b('0x7'),_0xd48b('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21d3=['api','moment','request-promise','path','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','FieldId','lodash','util','../../config/logger'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x21d3,0x89));var _0x321d=function(_0x589095,_0x2f31d9){_0x589095=_0x589095-0x0;var _0x1750d0=_0x21d3[_0x589095];return _0x1750d0;};'use strict';var _=require(_0x321d('0x0'));var util=require(_0x321d('0x1'));var logger=require(_0x321d('0x2'))(_0x321d('0x3'));var moment=require(_0x321d('0x4'));var BPromise=require('bluebird');var rp=require(_0x321d('0x5'));var fs=require('fs');var path=require(_0x321d('0x6'));var rimraf=require(_0x321d('0x7'));var config=require('../../config/environment');var attributes=require(_0x321d('0x8'));module[_0x321d('0x9')]=function(_0x36e1a0,_0x2b81d8){return _0x36e1a0[_0x321d('0xa')](_0x321d('0xb'),attributes,{'tableName':_0x321d('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x321d('0xd')],'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 8212891..76888a6 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 _0x6cad=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','catch','util'];(function(_0x473181,_0x239f30){var _0x4b8e8b=function(_0x4ad9d9){while(--_0x4ad9d9){_0x473181['push'](_0x473181['shift']());}};_0x4b8e8b(++_0x239f30);}(_0x6cad,0x110));var _0xd6ca=function(_0x482b31,_0xf1b1){_0x482b31=_0x482b31-0x0;var _0x504004=_0x6cad[_0x482b31];return _0x504004;};'use strict';var _=require('lodash');var util=require(_0xd6ca('0x0'));var moment=require('moment');var BPromise=require(_0xd6ca('0x1'));var rs=require(_0xd6ca('0x2'));var fs=require('fs');var Redis=require(_0xd6ca('0x3'));var db=require(_0xd6ca('0x4'))['db'];var utils=require(_0xd6ca('0x5'));var logger=require('../../config/logger')(_0xd6ca('0x6'));var config=require(_0xd6ca('0x7'));var jayson=require(_0xd6ca('0x8'));var client=jayson['client'][_0xd6ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2356c6,_0xa553ea,_0x2f9b11){return new BPromise(function(_0xd069a9,_0x6ea17d){return client[_0xd6ca('0xa')](_0x2356c6,_0x2f9b11)[_0xd6ca('0xb')](function(_0x3d6063){logger[_0xd6ca('0xc')](_0xd6ca('0xd'),_0xa553ea,_0xd6ca('0xe'));logger[_0xd6ca('0xf')](_0xd6ca('0x10'),_0xa553ea,_0xd6ca('0xe'),JSON['stringify'](_0x3d6063));if(_0x3d6063[_0xd6ca('0x11')]){if(_0x3d6063[_0xd6ca('0x11')][_0xd6ca('0x12')]===0x1f4){logger['error'](_0xd6ca('0xd'),_0xa553ea,_0x3d6063[_0xd6ca('0x11')][_0xd6ca('0x13')]);return _0x6ea17d(_0x3d6063[_0xd6ca('0x11')][_0xd6ca('0x13')]);}logger[_0xd6ca('0x11')]('ZendeskField,\x20%s,\x20%s',_0xa553ea,_0x3d6063[_0xd6ca('0x11')][_0xd6ca('0x13')]);return _0xd069a9(_0x3d6063[_0xd6ca('0x11')][_0xd6ca('0x13')]);}else{logger[_0xd6ca('0xc')]('ZendeskField,\x20%s,\x20%s',_0xa553ea,_0xd6ca('0xe'));_0xd069a9(_0x3d6063['result'][_0xd6ca('0x13')]);}})[_0xd6ca('0x14')](function(_0x3db4f8){logger[_0xd6ca('0x11')](_0xd6ca('0xd'),_0xa553ea,_0x3db4f8);_0x6ea17d(_0x3db4f8);});});} \ No newline at end of file +var _0x88d2=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x29e32e,_0x34ce49){var _0x40840f=function(_0x52e811){while(--_0x52e811){_0x29e32e['push'](_0x29e32e['shift']());}};_0x40840f(++_0x34ce49);}(_0x88d2,0x146));var _0x288d=function(_0x174d10,_0x29c7e5){_0x174d10=_0x174d10-0x0;var _0x58102a=_0x88d2[_0x174d10];return _0x58102a;};'use strict';var _=require(_0x288d('0x0'));var util=require(_0x288d('0x1'));var moment=require(_0x288d('0x2'));var BPromise=require(_0x288d('0x3'));var rs=require(_0x288d('0x4'));var fs=require('fs');var Redis=require(_0x288d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x288d('0x6'));var logger=require('../../config/logger')(_0x288d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x288d('0x8')][_0x288d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27541b,_0x253125,_0x524f10){return new BPromise(function(_0x589bed,_0x25a55b){return client[_0x288d('0xa')](_0x27541b,_0x524f10)[_0x288d('0xb')](function(_0xabc672){logger[_0x288d('0xc')](_0x288d('0xd'),_0x253125,'request\x20sent');logger[_0x288d('0xe')](_0x288d('0xf'),_0x253125,'request\x20sent',JSON[_0x288d('0x10')](_0xabc672));if(_0xabc672[_0x288d('0x11')]){if(_0xabc672[_0x288d('0x11')][_0x288d('0x12')]===0x1f4){logger[_0x288d('0x11')]('ZendeskField,\x20%s,\x20%s',_0x253125,_0xabc672[_0x288d('0x11')][_0x288d('0x13')]);return _0x25a55b(_0xabc672[_0x288d('0x11')][_0x288d('0x13')]);}logger[_0x288d('0x11')]('ZendeskField,\x20%s,\x20%s',_0x253125,_0xabc672['error']['message']);return _0x589bed(_0xabc672['error'][_0x288d('0x13')]);}else{logger[_0x288d('0xc')](_0x288d('0xd'),_0x253125,_0x288d('0x14'));_0x589bed(_0xabc672[_0x288d('0x15')][_0x288d('0x13')]);}})[_0x288d('0x16')](function(_0x5eb6ba){logger[_0x288d('0x11')](_0x288d('0xd'),_0x253125,_0x5eb6ba);_0x25a55b(_0x5eb6ba);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2d4741e..91a941a 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 _0x32e5=['index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x17a5da,_0x570f30){var _0x198bc7=function(_0x55f248){while(--_0x55f248){_0x17a5da['push'](_0x17a5da['shift']());}};_0x198bc7(++_0x570f30);}(_0x32e5,0x14f));var _0x532e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x32e5[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x532e('0x0'));var path=require(_0x532e('0x1'));var timeout=require(_0x532e('0x2'));var express=require(_0x532e('0x3'));var router=express['Router']();var fs_extra=require(_0x532e('0x4'));var auth=require(_0x532e('0x5'));var interaction=require(_0x532e('0x6'));var config=require(_0x532e('0x7'));var controller=require(_0x532e('0x8'));router[_0x532e('0x9')]('/',auth['isAuthenticated'](),controller[_0x532e('0xa')]);router['get'](_0x532e('0xb'),auth[_0x532e('0xc')](),controller[_0x532e('0xd')]);router[_0x532e('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x532e('0xe')]);router[_0x532e('0x9')](_0x532e('0xf'),auth[_0x532e('0xc')](),controller[_0x532e('0x10')]);router[_0x532e('0x11')]('/',auth[_0x532e('0xc')](),controller[_0x532e('0x12')]);router['post'](_0x532e('0x13'),auth[_0x532e('0xc')](),controller['addConfiguration']);router[_0x532e('0x14')]('/:id',auth[_0x532e('0xc')](),controller[_0x532e('0x15')]);router[_0x532e('0x16')](_0x532e('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe60d=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x11642e,_0x5a5162){var _0x5724f9=function(_0x1689d2){while(--_0x1689d2){_0x11642e['push'](_0x11642e['shift']());}};_0x5724f9(++_0x5a5162);}(_0xe60d,0x161));var _0xde60=function(_0x3f216f,_0x1558d9){_0x3f216f=_0x3f216f-0x0;var _0x681ae=_0xe60d[_0x3f216f];return _0x681ae;};'use strict';var multer=require(_0xde60('0x0'));var util=require(_0xde60('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xde60('0x2'));var router=express[_0xde60('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xde60('0x4'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0xde60('0x5')]('/',auth[_0xde60('0x6')](),controller[_0xde60('0x7')]);router[_0xde60('0x5')](_0xde60('0x8'),auth['isAuthenticated'](),controller[_0xde60('0x9')]);router['get'](_0xde60('0xa'),auth[_0xde60('0x6')](),controller[_0xde60('0xb')]);router[_0xde60('0x5')](_0xde60('0xc'),auth[_0xde60('0x6')](),controller[_0xde60('0xd')]);router[_0xde60('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xde60('0xe')](_0xde60('0xa'),auth[_0xde60('0x6')](),controller[_0xde60('0xf')]);router[_0xde60('0x10')](_0xde60('0x8'),auth[_0xde60('0x6')](),controller[_0xde60('0x11')]);router['delete']('/:id',auth[_0xde60('0x6')](),controller[_0xde60('0x12')]);module[_0xde60('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0003ed5..7c776d1 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 _0x668b=['exports','STRING','sequelize'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x668b,0x140));var _0xb668=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0x668b[_0x29e0eb];return _0x597d2d;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb668('0x2')]},'host':{'type':Sequelize[_0xb668('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb668('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb668('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xb668('0x2')]},'refreshToken':{'type':Sequelize[_0xb668('0x2')]}}; \ No newline at end of file +var _0x5636=['sequelize','exports','STRING'];(function(_0x1dcb9c,_0x52bf3c){var _0x2fb11f=function(_0x63bd54){while(--_0x63bd54){_0x1dcb9c['push'](_0x1dcb9c['shift']());}};_0x2fb11f(++_0x52bf3c);}(_0x5636,0x102));var _0x6563=function(_0x4c3f93,_0x50c3b2){_0x4c3f93=_0x4c3f93-0x0;var _0x115be6=_0x5636[_0x4c3f93];return _0x115be6;};'use strict';var Sequelize=require(_0x6563('0x0'));module[_0x6563('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x6563('0x2')]},'clientId':{'type':Sequelize[_0x6563('0x2')]},'clientSecret':{'type':Sequelize[_0x6563('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x6563('0x2')]},'refreshToken':{'type':Sequelize[_0x6563('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 63631f6..0d71b59 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 _0x1479=['ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','code','zoho.eu','com','serverUrl','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','includes','api_name','system_mandatory','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','catch','show','params','find','create','body','destroy','getConfigurations','findOne','length','options','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Subjects'];(function(_0x4d212e,_0x30e7b8){var _0x2c0fcc=function(_0x452883){while(--_0x452883){_0x4d212e['push'](_0x4d212e['shift']());}};_0x2c0fcc(++_0x30e7b8);}(_0x1479,0x132));var _0x9147=function(_0xcf1bcb,_0x5b1b5b){_0xcf1bcb=_0xcf1bcb-0x0;var _0x571d0b=_0x1479[_0xcf1bcb];return _0x571d0b;};'use strict';var emlformat=require(_0x9147('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9147('0x1'));var rp=require(_0x9147('0x2'));var moment=require(_0x9147('0x3'));var BPromise=require(_0x9147('0x4'));var Mustache=require(_0x9147('0x5'));var util=require(_0x9147('0x6'));var path=require(_0x9147('0x7'));var sox=require(_0x9147('0x8'));var csv=require(_0x9147('0x9'));var ejs=require(_0x9147('0xa'));var fs=require('fs');var fs_extra=require(_0x9147('0xb'));var _=require(_0x9147('0xc'));var squel=require(_0x9147('0xd'));var crypto=require(_0x9147('0xe'));var jsforce=require(_0x9147('0xf'));var deskjs=require(_0x9147('0x10'));var toCsv=require(_0x9147('0x9'));var querystring=require('querystring');var Papa=require(_0x9147('0x11'));var Redis=require('ioredis');var authService=require(_0x9147('0x12'));var qs=require(_0x9147('0x13'));var as=require(_0x9147('0x14'));var hardwareService=require(_0x9147('0x15'));var logger=require(_0x9147('0x16'))(_0x9147('0x17'));var utils=require(_0x9147('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9147('0x19'));var db=require(_0x9147('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4b4b03,_0x5d5a45){_0x5d5a45=_0x5d5a45||0xcc;return function(_0x324416){if(_0x324416){return _0x4b4b03[_0x9147('0x1b')](_0x5d5a45);}return _0x4b4b03[_0x9147('0x1c')](_0x5d5a45)[_0x9147('0x1d')]();};}function respondWithResult(_0x23c73a,_0xe6162d){_0xe6162d=_0xe6162d||0xc8;return function(_0x54d300){if(_0x54d300){return _0x23c73a[_0x9147('0x1c')](_0xe6162d)[_0x9147('0x1e')](_0x54d300);}};}function respondWithFilteredResult(_0x5f4cbb,_0x1e9683){return function(_0x3dd809){if(_0x3dd809){var _0x258b2d=typeof _0x1e9683[_0x9147('0x1f')]===_0x9147('0x20')&&typeof _0x1e9683[_0x9147('0x21')]===_0x9147('0x20');var _0x44628e=_0x3dd809[_0x9147('0x22')];var _0x2ccb21=_0x258b2d?0x0:_0x1e9683[_0x9147('0x1f')];var _0x56344c=_0x258b2d?_0x3dd809[_0x9147('0x22')]:_0x1e9683['offset']+_0x1e9683[_0x9147('0x21')];var _0x236cd6;if(_0x56344c>=_0x44628e){_0x56344c=_0x44628e;_0x236cd6=0xc8;}else{_0x236cd6=0xce;}_0x5f4cbb[_0x9147('0x1c')](_0x236cd6);return _0x5f4cbb[_0x9147('0x23')](_0x9147('0x24'),_0x2ccb21+'-'+_0x56344c+'/'+_0x44628e)[_0x9147('0x1e')](_0x3dd809);}return null;};}function patchUpdates(_0x447d7a){return function(_0x52156b){try{jsonpatch['apply'](_0x52156b,_0x447d7a,!![]);}catch(_0x513914){return BPromise[_0x9147('0x25')](_0x513914);}return _0x52156b[_0x9147('0x26')]();};}function saveUpdates(_0x4f455d,_0x94359b){return function(_0x2a548e){if(_0x2a548e){return _0x2a548e[_0x9147('0x27')](_0x4f455d)[_0x9147('0x28')](function(_0x465a70){return _0x465a70;});}return null;};}function removeEntity(_0x2dc1ba,_0x4cd76b){return function(_0x3f6827){if(_0x3f6827){return _0x3f6827['destroy']()[_0x9147('0x28')](function(){_0x2dc1ba[_0x9147('0x1c')](0xcc)[_0x9147('0x1d')]();});}};}function handleEntityNotFound(_0x426b6e,_0x51a64d){return function(_0x26585a){if(!_0x26585a){_0x426b6e[_0x9147('0x1b')](0x194);}return _0x26585a;};}function handleError(_0x262a35,_0x43b492){_0x43b492=_0x43b492||0x1f4;return function(_0x4800d9){logger[_0x9147('0x29')](_0x4800d9[_0x9147('0x2a')]);if(_0x4800d9['name']){delete _0x4800d9[_0x9147('0x2b')];}_0x262a35[_0x9147('0x1c')](_0x43b492)[_0x9147('0x2c')](_0x4800d9);};}exports[_0x9147('0x2d')]=function(_0x1aa098,_0x34a459){var _0x554a03={},_0x1c1017={},_0x4414b8={'count':0x0,'rows':[]};var _0x17376e=_[_0x9147('0x2e')](db[_0x9147('0x2f')][_0x9147('0x30')],function(_0x3cb9e9){return{'name':_0x3cb9e9['fieldName'],'type':_0x3cb9e9[_0x9147('0x31')][_0x9147('0x32')]};});_0x1c1017[_0x9147('0x33')]=_[_0x9147('0x2e')](_0x17376e,_0x9147('0x2b'));_0x1c1017[_0x9147('0x34')]=_[_0x9147('0x35')](_0x1aa098[_0x9147('0x34')]);_0x1c1017[_0x9147('0x36')]=_[_0x9147('0x37')](_0x1c1017['model'],_0x1c1017['query']);_0x554a03[_0x9147('0x38')]=_[_0x9147('0x37')](_0x1c1017[_0x9147('0x33')],qs[_0x9147('0x39')](_0x1aa098[_0x9147('0x34')][_0x9147('0x39')]));_0x554a03[_0x9147('0x38')]=_0x554a03[_0x9147('0x38')]['length']?_0x554a03[_0x9147('0x38')]:_0x1c1017[_0x9147('0x33')];if(!_0x1aa098[_0x9147('0x34')]['hasOwnProperty'](_0x9147('0x3a'))){_0x554a03['limit']=qs[_0x9147('0x21')](_0x1aa098[_0x9147('0x34')]['limit']);_0x554a03[_0x9147('0x1f')]=qs[_0x9147('0x1f')](_0x1aa098[_0x9147('0x34')][_0x9147('0x1f')]);}_0x554a03[_0x9147('0x3b')]=qs['sort'](_0x1aa098[_0x9147('0x34')][_0x9147('0x3c')]);_0x554a03[_0x9147('0x3d')]=qs['filters'](_[_0x9147('0x3e')](_0x1aa098[_0x9147('0x34')],_0x1c1017[_0x9147('0x36')]),_0x17376e);if(_0x1aa098[_0x9147('0x34')][_0x9147('0x3f')]){_0x554a03['where']=_[_0x9147('0x40')](_0x554a03[_0x9147('0x3d')],{'$or':_['map'](_0x17376e,function(_0x76dff5){if(_0x76dff5[_0x9147('0x31')]!==_0x9147('0x41')){var _0x35695b={};_0x35695b[_0x76dff5[_0x9147('0x2b')]]={'$like':'%'+_0x1aa098[_0x9147('0x34')][_0x9147('0x3f')]+'%'};return _0x35695b;}})});}_0x554a03=_[_0x9147('0x40')]({},_0x554a03,_0x1aa098['options']);var _0x226c0c={'where':_0x554a03[_0x9147('0x3d')]};return db[_0x9147('0x2f')][_0x9147('0x22')](_0x226c0c)[_0x9147('0x28')](function(_0x269629){_0x4414b8[_0x9147('0x22')]=_0x269629;if(_0x1aa098[_0x9147('0x34')]['includeAll']){_0x554a03[_0x9147('0x42')]=[{'all':!![]}];}return db[_0x9147('0x2f')]['findAll'](_0x554a03);})[_0x9147('0x28')](function(_0x57e734){_0x4414b8['rows']=_0x57e734;return _0x4414b8;})['then'](respondWithFilteredResult(_0x34a459,_0x554a03))[_0x9147('0x43')](handleError(_0x34a459,null));};exports[_0x9147('0x44')]=function(_0x3b6f44,_0x15f6fc){var _0x59acc5={'raw':![],'where':{'id':_0x3b6f44[_0x9147('0x45')]['id']}},_0x31f4e5={};_0x31f4e5[_0x9147('0x33')]=_[_0x9147('0x35')](db[_0x9147('0x2f')][_0x9147('0x30')]);_0x31f4e5['query']=_[_0x9147('0x35')](_0x3b6f44[_0x9147('0x34')]);_0x31f4e5[_0x9147('0x36')]=_[_0x9147('0x37')](_0x31f4e5[_0x9147('0x33')],_0x31f4e5[_0x9147('0x34')]);_0x59acc5['attributes']=_[_0x9147('0x37')](_0x31f4e5[_0x9147('0x33')],qs[_0x9147('0x39')](_0x3b6f44['query'][_0x9147('0x39')]));_0x59acc5[_0x9147('0x38')]=_0x59acc5[_0x9147('0x38')]['length']?_0x59acc5['attributes']:_0x31f4e5['model'];if(_0x3b6f44[_0x9147('0x34')]['includeAll']){_0x59acc5['include']=[{'all':!![]}];}_0x59acc5=_[_0x9147('0x40')]({},_0x59acc5,_0x3b6f44['options']);return db[_0x9147('0x2f')][_0x9147('0x46')](_0x59acc5)[_0x9147('0x28')](handleEntityNotFound(_0x15f6fc,null))[_0x9147('0x28')](respondWithResult(_0x15f6fc,null))['catch'](handleError(_0x15f6fc,null));};exports[_0x9147('0x47')]=function(_0x3840cc,_0x4a9d34){return db['ZohoAccount'][_0x9147('0x47')](_0x3840cc['body'],{})[_0x9147('0x28')](respondWithResult(_0x4a9d34,0xc9))['catch'](handleError(_0x4a9d34,null));};exports[_0x9147('0x27')]=function(_0x18f6a4,_0x1348c0){if(_0x18f6a4['body']['id']){delete _0x18f6a4[_0x9147('0x48')]['id'];}return db[_0x9147('0x2f')][_0x9147('0x46')]({'where':{'id':_0x18f6a4['params']['id']}})[_0x9147('0x28')](handleEntityNotFound(_0x1348c0,null))['then'](saveUpdates(_0x18f6a4[_0x9147('0x48')],null))[_0x9147('0x28')](respondWithResult(_0x1348c0,null))['catch'](handleError(_0x1348c0,null));};exports[_0x9147('0x49')]=function(_0x510a45,_0x20b27f){return db[_0x9147('0x2f')]['find']({'where':{'id':_0x510a45[_0x9147('0x45')]['id']}})[_0x9147('0x28')](handleEntityNotFound(_0x20b27f,null))['then'](removeEntity(_0x20b27f,null))[_0x9147('0x43')](handleError(_0x20b27f,null));};exports[_0x9147('0x4a')]=function(_0x12ed62,_0x2363f1,_0x509ec8){var _0x28363f={};var _0x4efd35={};var _0x4a5877;var _0x35ea60;return db['ZohoAccount'][_0x9147('0x4b')]({'where':{'id':_0x12ed62[_0x9147('0x45')]['id']}})[_0x9147('0x28')](handleEntityNotFound(_0x2363f1,null))[_0x9147('0x28')](function(_0x265518){if(_0x265518){_0x4a5877=_0x265518;_0x4efd35[_0x9147('0x33')]=_[_0x9147('0x35')](db['ZohoConfiguration'][_0x9147('0x30')]);_0x4efd35['query']=_['keys'](_0x12ed62['query']);_0x4efd35[_0x9147('0x36')]=_['intersection'](_0x4efd35[_0x9147('0x33')],_0x4efd35[_0x9147('0x34')]);_0x28363f[_0x9147('0x38')]=_[_0x9147('0x37')](_0x4efd35[_0x9147('0x33')],qs[_0x9147('0x39')](_0x12ed62[_0x9147('0x34')][_0x9147('0x39')]));_0x28363f[_0x9147('0x38')]=_0x28363f[_0x9147('0x38')][_0x9147('0x4c')]?_0x28363f['attributes']:_0x4efd35[_0x9147('0x33')];_0x28363f['order']=qs[_0x9147('0x3c')](_0x12ed62[_0x9147('0x34')][_0x9147('0x3c')]);_0x28363f[_0x9147('0x3d')]=qs[_0x9147('0x36')](_[_0x9147('0x3e')](_0x12ed62[_0x9147('0x34')],_0x4efd35[_0x9147('0x36')]));if(_0x12ed62['query'][_0x9147('0x3f')]){_0x28363f['where']=_['merge'](_0x28363f['where'],{'$or':_[_0x9147('0x2e')](_0x28363f[_0x9147('0x38')],function(_0x31f1f5){var _0xd05ed7={};_0xd05ed7[_0x31f1f5]={'$like':'%'+_0x12ed62[_0x9147('0x34')][_0x9147('0x3f')]+'%'};return _0xd05ed7;})});}_0x28363f=_[_0x9147('0x40')]({},_0x28363f,_0x12ed62[_0x9147('0x4d')]);return _0x4a5877[_0x9147('0x4a')](_0x28363f);}})['then'](function(_0x22008d){if(_0x22008d){_0x35ea60=_0x22008d[_0x9147('0x4c')];if(!_0x12ed62[_0x9147('0x34')][_0x9147('0x4e')](_0x9147('0x3a'))){_0x28363f['limit']=qs[_0x9147('0x21')](_0x12ed62[_0x9147('0x34')]['limit']);_0x28363f['offset']=qs['offset'](_0x12ed62['query'][_0x9147('0x1f')]);}return _0x4a5877[_0x9147('0x4a')](_0x28363f);}})['then'](function(_0x40197b){if(_0x40197b){return _0x40197b?{'count':_0x35ea60,'rows':_0x40197b}:null;}})[_0x9147('0x28')](respondWithResult(_0x2363f1,null))[_0x9147('0x43')](handleError(_0x2363f1,null));};exports[_0x9147('0x4f')]=function(_0x139e12,_0x14920a,_0x47a3e9){if(_0x139e12['body']['id']){delete _0x139e12[_0x9147('0x48')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x139e12[_0x9147('0x45')]['id']}})[_0x9147('0x28')](handleEntityNotFound(_0x14920a,null))[_0x9147('0x28')](function(_0x4db82e){if(_0x4db82e){_0x139e12['body'][_0x9147('0x50')]=_0x4db82e['id'];_0x139e12[_0x9147('0x48')]['Subjects']=integrations[_0x9147('0x51')](_0x139e12[_0x9147('0x48')][_0x9147('0x52')],_0x139e12[_0x9147('0x48')][_0x9147('0x31')]);_0x139e12[_0x9147('0x48')]['Descriptions']=integrations['getDescriptions'](_0x139e12[_0x9147('0x48')]['channel'],_0x139e12[_0x9147('0x48')]['type']);return db['ZohoConfiguration'][_0x9147('0x47')](_0x139e12[_0x9147('0x48')],{'include':[{'model':db['ZohoField'],'as':_0x9147('0x53')},{'model':db[_0x9147('0x54')],'as':_0x9147('0x55')}]});}return null;})[_0x9147('0x28')](respondWithResult(_0x14920a,null))[_0x9147('0x43')](handleError(_0x14920a,null));};function getAccessToken(_0x3f5106){return new Promise(function(_0x569eed,_0x4f565f){var _0x4ddb50;switch(_0x3f5106[_0x9147('0x56')]){case'US':_0x4ddb50=_0x9147('0x57');break;case'AU':_0x4ddb50='https://accounts.zoho.com.au';break;case'EU':_0x4ddb50=_0x9147('0x58');break;case'IN':_0x4ddb50='https://accounts.zoho.in';break;case'CN':_0x4ddb50='https://accounts.zoho.com.cn';break;default:_0x4ddb50=_0x9147('0x58');break;}var _0x502a6b={'method':_0x9147('0x59'),'uri':_0x4ddb50+_0x9147('0x5a'),'qs':{'refresh_token':_0x3f5106[_0x9147('0x5b')],'client_id':_0x3f5106[_0x9147('0x5c')],'client_secret':_0x3f5106[_0x9147('0x5d')],'grant_type':_0x9147('0x5e')},'json':!![]};return rp(_0x502a6b)[_0x9147('0x28')](function(_0x4f7d5c){if(_0x4f7d5c[_0x9147('0x5f')]){_0x569eed(_0x4f7d5c[_0x9147('0x5f')]);}else{_0x4f565f(_0x9147('0x60'));}})[_0x9147('0x43')](function(_0x7ae766){_0x4f565f(_0x7ae766);});});}exports[_0x9147('0x61')]=function(_0xa290de,_0x4c7c1a,_0x5700a5){var _0x28aa6d,_0x5146b9,_0x1c48e8,_0x1ab87d,_0x5de974;return db[_0x9147('0x2f')][_0x9147('0x4b')]({'where':{'id':_0xa290de[_0x9147('0x45')]['id']},'attributes':['id',_0x9147('0x62'),_0x9147('0x56'),'clientId',_0x9147('0x5d'),'serverUrl',_0x9147('0x63'),'refreshToken']})['then'](handleEntityNotFound(_0x4c7c1a,null))[_0x9147('0x28')](function(_0x234f04){_0x5de974=_0x234f04;_0x28aa6d=_0x5de974[_0x9147('0x62')];_0x5146b9=_0x28aa6d===_0x9147('0x64')?'eu':_0x9147('0x65');_0x1c48e8=_0x5de974[_0x9147('0x66')];var _0x4e5a1d=_0x1c48e8[_0x9147('0x67')](-0x1);if(_0x4e5a1d==='/'||_0x4e5a1d==='\x5c'||_0x4e5a1d===':'){_0x1c48e8=_0x1c48e8[_0x9147('0x68')](0x0,_0x1c48e8['lastIndexOf'](_0x4e5a1d));}if(!_0x5de974['refreshToken']){throw new Error(_0x9147('0x69'));}return getAccessToken(_0x5de974);})['then'](function(_0x19df86){if(_0x19df86){return rp({'method':_0x9147('0x6a'),'uri':util[_0x9147('0x6b')](_0x9147('0x6c'),_0x5146b9),'qs':{'module':_0x9147('0x6d')},'headers':{'Authorization':_0x9147('0x6e')+_0x19df86},'json':!![]});}})['then'](function(_0x48c29d){if(_0x48c29d){if(_0x48c29d[_0x9147('0x6f')]&&_0x48c29d['response']['error']){throw new Error(_0x48c29d[_0x9147('0x6f')]['error'][_0x9147('0x70')]);}var _0x2f6416=[];var _0x3cbbc1=[];var _0x4582e3=['Owner',_0x9147('0x71'),_0x9147('0x72'),_0x9147('0x73'),_0x9147('0x74'),_0x9147('0x75'),'Call_Start_Time',_0x9147('0x76')];_0x3cbbc1=_['remove'](_0x48c29d[_0x9147('0x39')],function(_0x5be8d0){return _0x4582e3[_0x9147('0x77')](_0x5be8d0[_0x9147('0x78')]);});for(var _0x4f1af4=0x0;_0x4f1af4<_0x3cbbc1[_0x9147('0x4c')];_0x4f1af4++){if(_0x3cbbc1[_0x4f1af4][_0x9147('0x79')]===![]){_0x2f6416['push']({'id':_0x3cbbc1[_0x4f1af4]['id'],'name':_0x3cbbc1[_0x4f1af4]['display_label'],'custom':_0x3cbbc1[_0x4f1af4][_0x9147('0x7a')],'options':_0x3cbbc1[_0x4f1af4][_0x9147('0x7b')]===_0x9147('0x7c')&&_0x3cbbc1[_0x4f1af4][_0x9147('0x7d')]['length']>-0x1?_['map'](_0x3cbbc1[_0x4f1af4][_0x9147('0x7d')],function(_0x28197d){return{'name':_0x28197d,'value':_0x28197d};}):[]});}}return{'count':_0x2f6416[_0x9147('0x4c')],'rows':_0x2f6416};}else{return{'count':0x0,'rows':[]};}})[_0x9147('0x28')](respondWithResult(_0x4c7c1a,null))[_0x9147('0x43')](function(_0x4bd210){var _0x126f58=_0xa290de['query'][_0x9147('0x7e')]?0x1f4:_0x4bd210[_0x9147('0x7f')]||0x1f4;logger[_0x9147('0x29')](_0x9147('0x80'),_0x9147('0x61'),_0x126f58,JSON['stringify'](_0x4bd210));delete _0x4bd210[_0x9147('0x2b')];if(_0x126f58===0x191){_0x126f58=0x190;}_0x4c7c1a[_0x9147('0x1c')](_0x126f58)[_0x9147('0x2c')](_0xa290de[_0x9147('0x34')][_0x9147('0x7e')]?{'message':_0x9147('0x81'),'statusCode':_0x4bd210[_0x9147('0x7f')]}:_0x4bd210);});}; \ No newline at end of file +var _0x567c=['map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','destroy','params','findOne','ZohoConfiguration','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','zoho.eu','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','response','message','Owner','Subject','Description','Call_Duration','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','sendStatus','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key'];(function(_0x2cf425,_0x31c131){var _0x43bd48=function(_0x534c27){while(--_0x534c27){_0x2cf425['push'](_0x2cf425['shift']());}};_0x43bd48(++_0x31c131);}(_0x567c,0xcf));var _0xc567=function(_0x2804fa,_0x3100db){_0x2804fa=_0x2804fa-0x0;var _0x4cf40d=_0x567c[_0x2804fa];return _0x4cf40d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc567('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc567('0x1'));var BPromise=require(_0xc567('0x2'));var Mustache=require(_0xc567('0x3'));var util=require(_0xc567('0x4'));var path=require('path');var sox=require(_0xc567('0x5'));var csv=require(_0xc567('0x6'));var ejs=require(_0xc567('0x7'));var fs=require('fs');var fs_extra=require(_0xc567('0x8'));var _=require(_0xc567('0x9'));var squel=require(_0xc567('0xa'));var crypto=require(_0xc567('0xb'));var jsforce=require(_0xc567('0xc'));var deskjs=require(_0xc567('0xd'));var toCsv=require(_0xc567('0x6'));var querystring=require(_0xc567('0xe'));var Papa=require(_0xc567('0xf'));var Redis=require(_0xc567('0x10'));var authService=require(_0xc567('0x11'));var qs=require(_0xc567('0x12'));var as=require(_0xc567('0x13'));var hardwareService=require(_0xc567('0x14'));var logger=require(_0xc567('0x15'))(_0xc567('0x16'));var utils=require('../../config/utils');var config=require(_0xc567('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc567('0x18'));function respondWithStatusCode(_0xd73fb7,_0x76401e){_0x76401e=_0x76401e||0xcc;return function(_0x2cb1b6){if(_0x2cb1b6){return _0xd73fb7['sendStatus'](_0x76401e);}return _0xd73fb7[_0xc567('0x19')](_0x76401e)[_0xc567('0x1a')]();};}function respondWithResult(_0x585219,_0x4e1527){_0x4e1527=_0x4e1527||0xc8;return function(_0x15cff8){if(_0x15cff8){return _0x585219[_0xc567('0x19')](_0x4e1527)['json'](_0x15cff8);}};}function respondWithFilteredResult(_0x2ebc82,_0x4a8b44){return function(_0x556032){if(_0x556032){var _0x1245ef=typeof _0x4a8b44[_0xc567('0x1b')]===_0xc567('0x1c')&&typeof _0x4a8b44[_0xc567('0x1d')]===_0xc567('0x1c');var _0x546387=_0x556032[_0xc567('0x1e')];var _0x3e25af=_0x1245ef?0x0:_0x4a8b44[_0xc567('0x1b')];var _0x13147f=_0x1245ef?_0x556032[_0xc567('0x1e')]:_0x4a8b44[_0xc567('0x1b')]+_0x4a8b44[_0xc567('0x1d')];var _0x505dc6;if(_0x13147f>=_0x546387){_0x13147f=_0x546387;_0x505dc6=0xc8;}else{_0x505dc6=0xce;}_0x2ebc82['status'](_0x505dc6);return _0x2ebc82[_0xc567('0x1f')](_0xc567('0x20'),_0x3e25af+'-'+_0x13147f+'/'+_0x546387)[_0xc567('0x21')](_0x556032);}return null;};}function patchUpdates(_0x513611){return function(_0x2a0724){try{jsonpatch['apply'](_0x2a0724,_0x513611,!![]);}catch(_0x29adcb){return BPromise[_0xc567('0x22')](_0x29adcb);}return _0x2a0724[_0xc567('0x23')]();};}function saveUpdates(_0x36055b,_0x42d020){return function(_0x244a97){if(_0x244a97){return _0x244a97[_0xc567('0x24')](_0x36055b)['then'](function(_0x560e33){return _0x560e33;});}return null;};}function removeEntity(_0x39c2f6,_0x4eff05){return function(_0x1f4e73){if(_0x1f4e73){return _0x1f4e73['destroy']()[_0xc567('0x25')](function(){_0x39c2f6[_0xc567('0x19')](0xcc)[_0xc567('0x1a')]();});}};}function handleEntityNotFound(_0x5e64a2,_0x3f9e0a){return function(_0x5ab53e){if(!_0x5ab53e){_0x5e64a2[_0xc567('0x26')](0x194);}return _0x5ab53e;};}function handleError(_0x3080a7,_0x599ff1){_0x599ff1=_0x599ff1||0x1f4;return function(_0x19af6b){logger[_0xc567('0x27')](_0x19af6b[_0xc567('0x28')]);if(_0x19af6b['name']){delete _0x19af6b[_0xc567('0x29')];}_0x3080a7['status'](_0x599ff1)[_0xc567('0x2a')](_0x19af6b);};}exports[_0xc567('0x2b')]=function(_0x788aa4,_0x3041d5){var _0x2754f1={},_0x5db7f4={},_0x5e9eb3={'count':0x0,'rows':[]};var _0x1ea0db=_['map'](db[_0xc567('0x2c')][_0xc567('0x2d')],function(_0x591bf6){return{'name':_0x591bf6[_0xc567('0x2e')],'type':_0x591bf6[_0xc567('0x2f')][_0xc567('0x30')]};});_0x5db7f4['model']=_[_0xc567('0x31')](_0x1ea0db,_0xc567('0x29'));_0x5db7f4[_0xc567('0x32')]=_['keys'](_0x788aa4[_0xc567('0x32')]);_0x5db7f4[_0xc567('0x33')]=_[_0xc567('0x34')](_0x5db7f4[_0xc567('0x35')],_0x5db7f4[_0xc567('0x32')]);_0x2754f1['attributes']=_[_0xc567('0x34')](_0x5db7f4[_0xc567('0x35')],qs[_0xc567('0x36')](_0x788aa4[_0xc567('0x32')]['fields']));_0x2754f1[_0xc567('0x37')]=_0x2754f1[_0xc567('0x37')][_0xc567('0x38')]?_0x2754f1['attributes']:_0x5db7f4[_0xc567('0x35')];if(!_0x788aa4[_0xc567('0x32')][_0xc567('0x39')](_0xc567('0x3a'))){_0x2754f1[_0xc567('0x1d')]=qs[_0xc567('0x1d')](_0x788aa4[_0xc567('0x32')][_0xc567('0x1d')]);_0x2754f1['offset']=qs[_0xc567('0x1b')](_0x788aa4[_0xc567('0x32')][_0xc567('0x1b')]);}_0x2754f1[_0xc567('0x3b')]=qs[_0xc567('0x3c')](_0x788aa4[_0xc567('0x32')][_0xc567('0x3c')]);_0x2754f1['where']=qs[_0xc567('0x33')](_['pick'](_0x788aa4[_0xc567('0x32')],_0x5db7f4[_0xc567('0x33')]),_0x1ea0db);if(_0x788aa4['query'][_0xc567('0x3d')]){_0x2754f1[_0xc567('0x3e')]=_[_0xc567('0x3f')](_0x2754f1['where'],{'$or':_[_0xc567('0x31')](_0x1ea0db,function(_0x48d7c9){if(_0x48d7c9['type']!==_0xc567('0x40')){var _0x1fde60={};_0x1fde60[_0x48d7c9[_0xc567('0x29')]]={'$like':'%'+_0x788aa4[_0xc567('0x32')][_0xc567('0x3d')]+'%'};return _0x1fde60;}})});}_0x2754f1=_[_0xc567('0x3f')]({},_0x2754f1,_0x788aa4[_0xc567('0x41')]);var _0x8d0265={'where':_0x2754f1[_0xc567('0x3e')]};return db[_0xc567('0x2c')][_0xc567('0x1e')](_0x8d0265)[_0xc567('0x25')](function(_0x306436){_0x5e9eb3[_0xc567('0x1e')]=_0x306436;if(_0x788aa4[_0xc567('0x32')]['includeAll']){_0x2754f1[_0xc567('0x42')]=[{'all':!![]}];}return db[_0xc567('0x2c')][_0xc567('0x43')](_0x2754f1);})[_0xc567('0x25')](function(_0x79c3f4){_0x5e9eb3[_0xc567('0x44')]=_0x79c3f4;return _0x5e9eb3;})['then'](respondWithFilteredResult(_0x3041d5,_0x2754f1))[_0xc567('0x45')](handleError(_0x3041d5,null));};exports[_0xc567('0x46')]=function(_0x40fe65,_0x3442ce){var _0x3d4d85={'raw':![],'where':{'id':_0x40fe65['params']['id']}},_0x867963={};_0x867963[_0xc567('0x35')]=_['keys'](db[_0xc567('0x2c')][_0xc567('0x2d')]);_0x867963[_0xc567('0x32')]=_[_0xc567('0x47')](_0x40fe65['query']);_0x867963['filters']=_[_0xc567('0x34')](_0x867963['model'],_0x867963['query']);_0x3d4d85[_0xc567('0x37')]=_[_0xc567('0x34')](_0x867963[_0xc567('0x35')],qs[_0xc567('0x36')](_0x40fe65[_0xc567('0x32')][_0xc567('0x36')]));_0x3d4d85[_0xc567('0x37')]=_0x3d4d85[_0xc567('0x37')][_0xc567('0x38')]?_0x3d4d85['attributes']:_0x867963['model'];if(_0x40fe65['query'][_0xc567('0x48')]){_0x3d4d85[_0xc567('0x42')]=[{'all':!![]}];}_0x3d4d85=_[_0xc567('0x3f')]({},_0x3d4d85,_0x40fe65[_0xc567('0x41')]);return db['ZohoAccount'][_0xc567('0x49')](_0x3d4d85)['then'](handleEntityNotFound(_0x3442ce,null))[_0xc567('0x25')](respondWithResult(_0x3442ce,null))[_0xc567('0x45')](handleError(_0x3442ce,null));};exports['create']=function(_0x31bb76,_0x1472da){return db[_0xc567('0x2c')][_0xc567('0x4a')](_0x31bb76['body'],{})[_0xc567('0x25')](respondWithResult(_0x1472da,0xc9))[_0xc567('0x45')](handleError(_0x1472da,null));};exports[_0xc567('0x24')]=function(_0x1ce789,_0x451a2e){if(_0x1ce789[_0xc567('0x4b')]['id']){delete _0x1ce789[_0xc567('0x4b')]['id'];}return db[_0xc567('0x2c')][_0xc567('0x49')]({'where':{'id':_0x1ce789['params']['id']}})['then'](handleEntityNotFound(_0x451a2e,null))[_0xc567('0x25')](saveUpdates(_0x1ce789['body'],null))[_0xc567('0x25')](respondWithResult(_0x451a2e,null))['catch'](handleError(_0x451a2e,null));};exports[_0xc567('0x4c')]=function(_0x3f31a8,_0x26bb6c){return db[_0xc567('0x2c')][_0xc567('0x49')]({'where':{'id':_0x3f31a8[_0xc567('0x4d')]['id']}})[_0xc567('0x25')](handleEntityNotFound(_0x26bb6c,null))[_0xc567('0x25')](removeEntity(_0x26bb6c,null))[_0xc567('0x45')](handleError(_0x26bb6c,null));};exports['getConfigurations']=function(_0x9c4056,_0x1b50a8,_0x45f704){var _0x283ae3={};var _0x5b45bf={};var _0x51802e;var _0x17b1b9;return db['ZohoAccount'][_0xc567('0x4e')]({'where':{'id':_0x9c4056['params']['id']}})['then'](handleEntityNotFound(_0x1b50a8,null))[_0xc567('0x25')](function(_0x1624b3){if(_0x1624b3){_0x51802e=_0x1624b3;_0x5b45bf['model']=_[_0xc567('0x47')](db[_0xc567('0x4f')][_0xc567('0x2d')]);_0x5b45bf['query']=_[_0xc567('0x47')](_0x9c4056[_0xc567('0x32')]);_0x5b45bf[_0xc567('0x33')]=_[_0xc567('0x34')](_0x5b45bf[_0xc567('0x35')],_0x5b45bf[_0xc567('0x32')]);_0x283ae3[_0xc567('0x37')]=_[_0xc567('0x34')](_0x5b45bf['model'],qs['fields'](_0x9c4056['query'][_0xc567('0x36')]));_0x283ae3[_0xc567('0x37')]=_0x283ae3[_0xc567('0x37')][_0xc567('0x38')]?_0x283ae3[_0xc567('0x37')]:_0x5b45bf[_0xc567('0x35')];_0x283ae3[_0xc567('0x3b')]=qs[_0xc567('0x3c')](_0x9c4056[_0xc567('0x32')][_0xc567('0x3c')]);_0x283ae3['where']=qs[_0xc567('0x33')](_[_0xc567('0x50')](_0x9c4056[_0xc567('0x32')],_0x5b45bf[_0xc567('0x33')]));if(_0x9c4056[_0xc567('0x32')][_0xc567('0x3d')]){_0x283ae3[_0xc567('0x3e')]=_[_0xc567('0x3f')](_0x283ae3[_0xc567('0x3e')],{'$or':_[_0xc567('0x31')](_0x283ae3[_0xc567('0x37')],function(_0x5e2900){var _0x5b988a={};_0x5b988a[_0x5e2900]={'$like':'%'+_0x9c4056[_0xc567('0x32')][_0xc567('0x3d')]+'%'};return _0x5b988a;})});}_0x283ae3=_[_0xc567('0x3f')]({},_0x283ae3,_0x9c4056[_0xc567('0x41')]);return _0x51802e[_0xc567('0x51')](_0x283ae3);}})[_0xc567('0x25')](function(_0x44afc8){if(_0x44afc8){_0x17b1b9=_0x44afc8[_0xc567('0x38')];if(!_0x9c4056[_0xc567('0x32')][_0xc567('0x39')](_0xc567('0x3a'))){_0x283ae3[_0xc567('0x1d')]=qs[_0xc567('0x1d')](_0x9c4056[_0xc567('0x32')][_0xc567('0x1d')]);_0x283ae3[_0xc567('0x1b')]=qs[_0xc567('0x1b')](_0x9c4056['query']['offset']);}return _0x51802e[_0xc567('0x51')](_0x283ae3);}})['then'](function(_0x216b34){if(_0x216b34){return _0x216b34?{'count':_0x17b1b9,'rows':_0x216b34}:null;}})[_0xc567('0x25')](respondWithResult(_0x1b50a8,null))[_0xc567('0x45')](handleError(_0x1b50a8,null));};exports[_0xc567('0x52')]=function(_0x42e001,_0x2ade3b,_0x5d4559){if(_0x42e001[_0xc567('0x4b')]['id']){delete _0x42e001['body']['id'];}return db['ZohoAccount'][_0xc567('0x4e')]({'where':{'id':_0x42e001[_0xc567('0x4d')]['id']}})[_0xc567('0x25')](handleEntityNotFound(_0x2ade3b,null))[_0xc567('0x25')](function(_0x3e6b4d){if(_0x3e6b4d){_0x42e001[_0xc567('0x4b')][_0xc567('0x53')]=_0x3e6b4d['id'];_0x42e001['body'][_0xc567('0x54')]=integrations[_0xc567('0x55')](_0x42e001[_0xc567('0x4b')][_0xc567('0x56')],_0x42e001[_0xc567('0x4b')][_0xc567('0x2f')]);_0x42e001[_0xc567('0x4b')][_0xc567('0x57')]=integrations[_0xc567('0x58')](_0x42e001[_0xc567('0x4b')]['channel'],_0x42e001[_0xc567('0x4b')][_0xc567('0x2f')]);return db[_0xc567('0x4f')]['create'](_0x42e001[_0xc567('0x4b')],{'include':[{'model':db[_0xc567('0x59')],'as':_0xc567('0x54')},{'model':db[_0xc567('0x59')],'as':_0xc567('0x57')}]});}return null;})[_0xc567('0x25')](respondWithResult(_0x2ade3b,null))[_0xc567('0x45')](handleError(_0x2ade3b,null));};function getAccessToken(_0x19789e){return new Promise(function(_0x23dde5,_0x4c3a59){var _0x437fda;switch(_0x19789e[_0xc567('0x5a')]){case'US':_0x437fda=_0xc567('0x5b');break;case'AU':_0x437fda='https://accounts.zoho.com.au';break;case'EU':_0x437fda='https://accounts.zoho.eu';break;case'IN':_0x437fda='https://accounts.zoho.in';break;case'CN':_0x437fda='https://accounts.zoho.com.cn';break;default:_0x437fda=_0xc567('0x5c');break;}var _0x4f1748={'method':_0xc567('0x5d'),'uri':_0x437fda+_0xc567('0x5e'),'qs':{'refresh_token':_0x19789e['refreshToken'],'client_id':_0x19789e['clientId'],'client_secret':_0x19789e[_0xc567('0x5f')],'grant_type':_0xc567('0x60')},'json':!![]};return rp(_0x4f1748)[_0xc567('0x25')](function(_0xfc2c21){if(_0xfc2c21[_0xc567('0x61')]){_0x23dde5(_0xfc2c21['access_token']);}else{_0x4c3a59(_0xc567('0x62'));}})[_0xc567('0x45')](function(_0x48ee3e){_0x4c3a59(_0x48ee3e);});});}exports[_0xc567('0x63')]=function(_0x1fc726,_0x23e214,_0x55352e){var _0x708c5b,_0x229436,_0x25d783,_0x357086,_0x86867c;return db[_0xc567('0x2c')][_0xc567('0x4e')]({'where':{'id':_0x1fc726[_0xc567('0x4d')]['id']},'attributes':['id',_0xc567('0x64'),_0xc567('0x5a'),'clientId',_0xc567('0x5f'),_0xc567('0x65'),_0xc567('0x66'),'refreshToken']})[_0xc567('0x25')](handleEntityNotFound(_0x23e214,null))[_0xc567('0x25')](function(_0x36fc12){_0x86867c=_0x36fc12;_0x708c5b=_0x86867c[_0xc567('0x64')];_0x229436=_0x708c5b===_0xc567('0x67')?'eu':_0xc567('0x68');_0x25d783=_0x86867c[_0xc567('0x65')];var _0x587f00=_0x25d783[_0xc567('0x69')](-0x1);if(_0x587f00==='/'||_0x587f00==='\x5c'||_0x587f00===':'){_0x25d783=_0x25d783[_0xc567('0x6a')](0x0,_0x25d783['lastIndexOf'](_0x587f00));}if(!_0x86867c[_0xc567('0x6b')]){throw new Error(_0xc567('0x6c'));}return getAccessToken(_0x86867c);})[_0xc567('0x25')](function(_0x32ac5e){if(_0x32ac5e){return rp({'method':_0xc567('0x6d'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x229436),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x32ac5e},'json':!![]});}})['then'](function(_0x14b007){if(_0x14b007){if(_0x14b007[_0xc567('0x6e')]&&_0x14b007[_0xc567('0x6e')][_0xc567('0x27')]){throw new Error(_0x14b007['response'][_0xc567('0x27')][_0xc567('0x6f')]);}var _0x14475b=[];var _0x465e57=[];var _0x381b58=[_0xc567('0x70'),_0xc567('0x71'),_0xc567('0x72'),'WhoId',_0xc567('0x73'),'Call_Result','Call_Start_Time','Call_Type'];_0x465e57=_['remove'](_0x14b007[_0xc567('0x36')],function(_0x23e677){return _0x381b58[_0xc567('0x74')](_0x23e677[_0xc567('0x75')]);});for(var _0x58cba6=0x0;_0x58cba6<_0x465e57[_0xc567('0x38')];_0x58cba6++){if(_0x465e57[_0x58cba6][_0xc567('0x76')]===![]){_0x14475b[_0xc567('0x77')]({'id':_0x465e57[_0x58cba6]['id'],'name':_0x465e57[_0x58cba6][_0xc567('0x78')],'custom':_0x465e57[_0x58cba6][_0xc567('0x79')],'options':_0x465e57[_0x58cba6][_0xc567('0x7a')]==='picklist'&&_0x465e57[_0x58cba6]['pick_list_values'][_0xc567('0x38')]>-0x1?_[_0xc567('0x31')](_0x465e57[_0x58cba6][_0xc567('0x7b')],function(_0xf87346){return{'name':_0xf87346,'value':_0xf87346};}):[]});}}return{'count':_0x14475b[_0xc567('0x38')],'rows':_0x14475b};}else{return{'count':0x0,'rows':[]};}})[_0xc567('0x25')](respondWithResult(_0x23e214,null))[_0xc567('0x45')](function(_0x57ea40){var _0x36e5e7=_0x1fc726['query'][_0xc567('0x7c')]?0x1f4:_0x57ea40[_0xc567('0x7d')]||0x1f4;logger['error'](_0xc567('0x7e'),_0xc567('0x63'),_0x36e5e7,JSON['stringify'](_0x57ea40));delete _0x57ea40[_0xc567('0x29')];if(_0x36e5e7===0x191){_0x36e5e7=0x190;}_0x23e214['status'](_0x36e5e7)['send'](_0x1fc726['query'][_0xc567('0x7c')]?{'message':_0xc567('0x7f'),'statusCode':_0x57ea40[_0xc567('0x7d')]}:_0x57ea40);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 02f2186..fa7420f 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 _0x8025=['changed','clientId','code','host','serverUrl','substring','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','authorization_code','clientSecret','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','slice','lastIndexOf','https://accounts.zoho.com','/oauth/v2/token','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x4c46f4,_0x451240){var _0x221f46=function(_0x5b7742){while(--_0x5b7742){_0x4c46f4['push'](_0x4c46f4['shift']());}};_0x221f46(++_0x451240);}(_0x8025,0xd3));var _0x5802=function(_0x1cb701,_0xaebc06){_0x1cb701=_0x1cb701-0x0;var _0x2ac38d=_0x8025[_0x1cb701];return _0x2ac38d;};'use strict';var _=require(_0x5802('0x0'));var util=require('util');var logger=require(_0x5802('0x1'))(_0x5802('0x2'));var moment=require(_0x5802('0x3'));var BPromise=require(_0x5802('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5802('0x5'));var rimraf=require(_0x5802('0x6'));var config=require(_0x5802('0x7'));var attributes=require(_0x5802('0x8'));var integrations=require(_0x5802('0x9'));module[_0x5802('0xa')]=function(_0x2e33d7,_0x9c53b){return _0x2e33d7[_0x5802('0xb')](_0x5802('0xc'),attributes,{'tableName':_0x5802('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41e929,_0x227548,_0x4fcb8c){if(_0x41e929[_0x5802('0xe')]('zone')||_0x41e929[_0x5802('0xe')]('serverUrl')||_0x41e929[_0x5802('0xe')](_0x5802('0xf'))||_0x41e929[_0x5802('0xe')]('clientSecret')||_0x41e929[_0x5802('0xe')](_0x5802('0x10'))||_0x41e929[_0x5802('0xe')](_0x5802('0x11'))){var _0x22f52b,_0x9e0496;_0x22f52b=_0x41e929[_0x5802('0x12')];var _0x2656f6=_0x22f52b['slice'](-0x1);if(_0x2656f6==='/'||_0x2656f6==='\x5c'||_0x2656f6===':'){_0x22f52b=_0x22f52b[_0x5802('0x13')](0x0,_0x22f52b['lastIndexOf'](_0x2656f6));}switch(_0x41e929[_0x5802('0x14')]){case'US':_0x9e0496='https://accounts.zoho.com';break;case'AU':_0x9e0496=_0x5802('0x15');break;case'IN':_0x9e0496=_0x5802('0x16');break;case'CN':_0x9e0496=_0x5802('0x17');break;default:_0x9e0496=_0x5802('0x18');break;}var _0x34017f={'method':_0x5802('0x19'),'uri':_0x9e0496+'/oauth/v2/token','form':{'grant_type':_0x5802('0x1a'),'client_id':_0x41e929[_0x5802('0xf')],'client_secret':_0x41e929[_0x5802('0x1b')],'redirect_uri':_0x41e929['serverUrl'],'code':_0x41e929[_0x5802('0x10')]},'headers':{'Content-Type':_0x5802('0x1c')}};return rp(_0x34017f)[_0x5802('0x1d')](function(_0x2196ea){var _0x48ad59=JSON[_0x5802('0x1e')](_0x2196ea);if(_0x48ad59[_0x5802('0x1f')]){_0x41e929[_0x5802('0x20')]=_0x48ad59[_0x5802('0x1f')];logger[_0x5802('0x21')](util['format'](_0x5802('0x22'),_0x41e929[_0x5802('0x23')],_0x41e929['id']));}else{logger['error'](util[_0x5802('0x24')](_0x5802('0x25'),_0x41e929[_0x5802('0x23')],_0x41e929['id']),util[_0x5802('0x26')](_0x48ad59,{'showHidden':![],'depth':null}));}return _0x4fcb8c(null,_0x227548);})[_0x5802('0x27')](function(_0x137dec){logger[_0x5802('0x28')](util[_0x5802('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x41e929[_0x5802('0x23')],_0x41e929['id']),util[_0x5802('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x4fcb8c(_0x137dec);});}else{return _0x4fcb8c(null,_0x227548);}},'beforeUpdate':function(_0x25f91a,_0x3ca7c0,_0x537e16){if(_0x25f91a[_0x5802('0xe')](_0x5802('0x14'))||_0x25f91a['changed'](_0x5802('0x12'))||_0x25f91a['changed'](_0x5802('0xf'))||_0x25f91a['changed'](_0x5802('0x1b'))||_0x25f91a['changed'](_0x5802('0x10'))||_0x25f91a['changed'](_0x5802('0x11'))){var _0x20a88b,_0x37f5b3;_0x20a88b=_0x25f91a['serverUrl'];var _0x832265=_0x20a88b[_0x5802('0x29')](-0x1);if(_0x832265==='/'||_0x832265==='\x5c'||_0x832265===':'){_0x20a88b=_0x20a88b[_0x5802('0x13')](0x0,_0x20a88b[_0x5802('0x2a')](_0x832265));}switch(_0x25f91a[_0x5802('0x14')]){case'US':_0x37f5b3=_0x5802('0x2b');break;case'AU':_0x37f5b3=_0x5802('0x15');break;case'IN':_0x37f5b3='https://accounts.zoho.in';break;case'CN':_0x37f5b3='https://accounts.zoho.com.cn';break;default:_0x37f5b3='https://accounts.zoho.eu';break;}var _0x11ddf6={'method':_0x5802('0x19'),'uri':_0x37f5b3+_0x5802('0x2c'),'form':{'grant_type':'authorization_code','client_id':_0x25f91a[_0x5802('0xf')],'client_secret':_0x25f91a[_0x5802('0x1b')],'redirect_uri':_0x25f91a[_0x5802('0x12')],'code':_0x25f91a[_0x5802('0x10')]},'headers':{'Content-Type':_0x5802('0x1c')}};return rp(_0x11ddf6)[_0x5802('0x1d')](function(_0xc60b04){var _0x21302c=JSON[_0x5802('0x1e')](_0xc60b04);if(_0x21302c[_0x5802('0x1f')]){_0x25f91a[_0x5802('0x20')]=_0x21302c[_0x5802('0x1f')];logger[_0x5802('0x21')](util[_0x5802('0x24')](_0x5802('0x22'),_0x25f91a[_0x5802('0x23')],_0x25f91a['id']));}else{logger[_0x5802('0x28')](util['format'](_0x5802('0x25'),_0x25f91a['name'],_0x25f91a['id']),util[_0x5802('0x26')](_0x21302c,{'showHidden':![],'depth':null}));}return _0x537e16(null,_0x3ca7c0);})[_0x5802('0x27')](function(_0x4edc1e){logger[_0x5802('0x28')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x25f91a[_0x5802('0x23')],_0x25f91a['id']),util[_0x5802('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x537e16(_0x4edc1e);});}else{return _0x537e16(null,_0x3ca7c0);}}}});}; \ No newline at end of file +var _0xfc52=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','slice','lastIndexOf','zone','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','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','inspect','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','error','util'];(function(_0x52d040,_0x2f8ceb){var _0x3bf74c=function(_0xad8cdf){while(--_0xad8cdf){_0x52d040['push'](_0x52d040['shift']());}};_0x3bf74c(++_0x2f8ceb);}(_0xfc52,0x77));var _0x2fc5=function(_0x53a382,_0x21cfcf){_0x53a382=_0x53a382-0x0;var _0x150aca=_0xfc52[_0x53a382];return _0x150aca;};'use strict';var _=require('lodash');var util=require(_0x2fc5('0x0'));var logger=require(_0x2fc5('0x1'))(_0x2fc5('0x2'));var moment=require('moment');var BPromise=require(_0x2fc5('0x3'));var rp=require(_0x2fc5('0x4'));var fs=require('fs');var path=require(_0x2fc5('0x5'));var rimraf=require(_0x2fc5('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x2fc5('0x7'));module[_0x2fc5('0x8')]=function(_0x33b3f5,_0x29c8cc){return _0x33b3f5['define'](_0x2fc5('0x9'),attributes,{'tableName':_0x2fc5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4982a0,_0x3e0cc2,_0x308ad4){if(_0x4982a0[_0x2fc5('0xb')]('zone')||_0x4982a0['changed'](_0x2fc5('0xc'))||_0x4982a0['changed'](_0x2fc5('0xd'))||_0x4982a0[_0x2fc5('0xb')](_0x2fc5('0xe'))||_0x4982a0[_0x2fc5('0xb')](_0x2fc5('0xf'))||_0x4982a0['changed']('host')){var _0x34481f,_0x7f1cce;_0x34481f=_0x4982a0[_0x2fc5('0xc')];var _0x1d68ef=_0x34481f[_0x2fc5('0x10')](-0x1);if(_0x1d68ef==='/'||_0x1d68ef==='\x5c'||_0x1d68ef===':'){_0x34481f=_0x34481f['substring'](0x0,_0x34481f[_0x2fc5('0x11')](_0x1d68ef));}switch(_0x4982a0[_0x2fc5('0x12')]){case'US':_0x7f1cce='https://accounts.zoho.com';break;case'AU':_0x7f1cce='https://accounts.zoho.com.au';break;case'IN':_0x7f1cce=_0x2fc5('0x13');break;case'CN':_0x7f1cce=_0x2fc5('0x14');break;default:_0x7f1cce='https://accounts.zoho.eu';break;}var _0x4e56af={'method':_0x2fc5('0x15'),'uri':_0x7f1cce+_0x2fc5('0x16'),'form':{'grant_type':_0x2fc5('0x17'),'client_id':_0x4982a0['clientId'],'client_secret':_0x4982a0[_0x2fc5('0xe')],'redirect_uri':_0x4982a0[_0x2fc5('0xc')],'code':_0x4982a0['code']},'headers':{'Content-Type':_0x2fc5('0x18')}};return rp(_0x4e56af)[_0x2fc5('0x19')](function(_0x4af376){var _0x281278=JSON[_0x2fc5('0x1a')](_0x4af376);if(_0x281278[_0x2fc5('0x1b')]){_0x4982a0[_0x2fc5('0x1c')]=_0x281278['refresh_token'];logger[_0x2fc5('0x1d')](util[_0x2fc5('0x1e')](_0x2fc5('0x1f'),_0x4982a0[_0x2fc5('0x20')],_0x4982a0['id']));}else{logger['error'](util[_0x2fc5('0x1e')](_0x2fc5('0x21'),_0x4982a0[_0x2fc5('0x20')],_0x4982a0['id']),util['inspect'](_0x281278,{'showHidden':![],'depth':null}));}return _0x308ad4(null,_0x3e0cc2);})[_0x2fc5('0x22')](function(_0x896c0b){logger['error'](util[_0x2fc5('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4982a0[_0x2fc5('0x20')],_0x4982a0['id']),util[_0x2fc5('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x308ad4(_0x896c0b);});}else{return _0x308ad4(null,_0x3e0cc2);}},'beforeUpdate':function(_0x5d410f,_0x46de2e,_0x49819e){if(_0x5d410f['changed'](_0x2fc5('0x12'))||_0x5d410f[_0x2fc5('0xb')](_0x2fc5('0xc'))||_0x5d410f['changed'](_0x2fc5('0xd'))||_0x5d410f['changed']('clientSecret')||_0x5d410f[_0x2fc5('0xb')](_0x2fc5('0xf'))||_0x5d410f['changed']('host')){var _0x4855f6,_0x513298;_0x4855f6=_0x5d410f[_0x2fc5('0xc')];var _0xff74f3=_0x4855f6['slice'](-0x1);if(_0xff74f3==='/'||_0xff74f3==='\x5c'||_0xff74f3===':'){_0x4855f6=_0x4855f6['substring'](0x0,_0x4855f6[_0x2fc5('0x11')](_0xff74f3));}switch(_0x5d410f[_0x2fc5('0x12')]){case'US':_0x513298=_0x2fc5('0x24');break;case'AU':_0x513298=_0x2fc5('0x25');break;case'IN':_0x513298=_0x2fc5('0x13');break;case'CN':_0x513298=_0x2fc5('0x14');break;default:_0x513298=_0x2fc5('0x26');break;}var _0x5757f1={'method':'POST','uri':_0x513298+_0x2fc5('0x16'),'form':{'grant_type':_0x2fc5('0x17'),'client_id':_0x5d410f[_0x2fc5('0xd')],'client_secret':_0x5d410f[_0x2fc5('0xe')],'redirect_uri':_0x5d410f['serverUrl'],'code':_0x5d410f['code']},'headers':{'Content-Type':_0x2fc5('0x18')}};return rp(_0x5757f1)['then'](function(_0x4ace26){var _0x914cf4=JSON[_0x2fc5('0x1a')](_0x4ace26);if(_0x914cf4[_0x2fc5('0x1b')]){_0x5d410f[_0x2fc5('0x1c')]=_0x914cf4[_0x2fc5('0x1b')];logger[_0x2fc5('0x1d')](util[_0x2fc5('0x1e')](_0x2fc5('0x1f'),_0x5d410f[_0x2fc5('0x20')],_0x5d410f['id']));}else{logger['error'](util[_0x2fc5('0x1e')](_0x2fc5('0x21'),_0x5d410f[_0x2fc5('0x20')],_0x5d410f['id']),util[_0x2fc5('0x23')](_0x914cf4,{'showHidden':![],'depth':null}));}return _0x49819e(null,_0x46de2e);})['catch'](function(_0x13d03b){logger[_0x2fc5('0x27')](util[_0x2fc5('0x1e')](_0x2fc5('0x21'),_0x5d410f['name'],_0x5d410f['id']),util[_0x2fc5('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x49819e(_0x13d03b);});}else{return _0x49819e(null,_0x46de2e);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index faa3886..5e86e64 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 _0xd5a2=['error','code','message','catch','ZohoAccount','findAll','options','where','attributes','include','map','model','GetZohoAccount','ShowZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x8550ba,_0x57c10d){var _0x432399=function(_0x33ab8a){while(--_0x33ab8a){_0x8550ba['push'](_0x8550ba['shift']());}};_0x432399(++_0x57c10d);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x1b69ae,_0x309c76){_0x1b69ae=_0x1b69ae-0x0;var _0x5d1ac4=_0xd5a2[_0x1b69ae];return _0x5d1ac4;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));var BPromise=require(_0x2d5a('0x2'));var rs=require(_0x2d5a('0x3'));var fs=require('fs');var Redis=require(_0x2d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d5a('0x5'));var logger=require(_0x2d5a('0x6'))(_0x2d5a('0x7'));var config=require(_0x2d5a('0x8'));var jayson=require(_0x2d5a('0x9'));var client=jayson[_0x2d5a('0xa')][_0x2d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ae103,_0x1cdfc4,_0x7eb4c3){return new BPromise(function(_0x79898c,_0x4d5c52){return client['request'](_0x1ae103,_0x7eb4c3)[_0x2d5a('0xc')](function(_0x562b6a){logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,'request\x20sent');logger[_0x2d5a('0xf')](_0x2d5a('0x10'),_0x1cdfc4,_0x2d5a('0x11'),JSON[_0x2d5a('0x12')](_0x562b6a));if(_0x562b6a[_0x2d5a('0x13')]){if(_0x562b6a['error'][_0x2d5a('0x14')]===0x1f4){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x4d5c52(_0x562b6a['error'][_0x2d5a('0x15')]);}logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x562b6a[_0x2d5a('0x13')]['message']);return _0x79898c(_0x562b6a[_0x2d5a('0x13')][_0x2d5a('0x15')]);}else{logger[_0x2d5a('0xd')](_0x2d5a('0xe'),_0x1cdfc4,_0x2d5a('0x11'));_0x79898c(_0x562b6a['result'][_0x2d5a('0x15')]);}})[_0x2d5a('0x16')](function(_0x38de62){logger[_0x2d5a('0x13')](_0x2d5a('0xe'),_0x1cdfc4,_0x38de62);_0x4d5c52(_0x38de62);});});}exports['GetZohoAccount']=function(_0x454c53){var _0x50f723=this;return new Promise(function(_0x34ae77,_0x29692e){return db[_0x2d5a('0x17')][_0x2d5a('0x18')]({'raw':_0x454c53['options']?_0x454c53['options']['raw']===undefined?!![]:![]:!![],'where':_0x454c53['options']?_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1a')]||null:null,'attributes':_0x454c53['options']?_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1b')]||null:null,'limit':_0x454c53[_0x2d5a('0x19')]?_0x454c53[_0x2d5a('0x19')]['limit']||null:null,'include':_0x454c53[_0x2d5a('0x19')]?_0x454c53['options'][_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x454c53[_0x2d5a('0x19')][_0x2d5a('0x1c')],function(_0x5f1c75){return{'model':db[_0x5f1c75['model']],'as':_0x5f1c75['as'],'attributes':_0x5f1c75['attributes'],'include':_0x5f1c75[_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x5f1c75[_0x2d5a('0x1c')],function(_0x304b9a){return{'model':db[_0x304b9a[_0x2d5a('0x1e')]],'as':_0x304b9a['as'],'attributes':_0x304b9a[_0x2d5a('0x1b')],'include':_0x304b9a['include']?_[_0x2d5a('0x1d')](_0x304b9a[_0x2d5a('0x1c')],function(_0x24f733){return{'model':db[_0x24f733[_0x2d5a('0x1e')]],'as':_0x24f733['as'],'attributes':_0x24f733[_0x2d5a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d5a('0xc')](function(_0x4fb606){logger['info'](_0x2d5a('0x1f'),_0x454c53);logger[_0x2d5a('0xf')]('GetZohoAccount',_0x454c53,JSON[_0x2d5a('0x12')](_0x4fb606));_0x34ae77(_0x4fb606);})[_0x2d5a('0x16')](function(_0x199686){logger[_0x2d5a('0x13')](_0x2d5a('0x1f'),_0x199686[_0x2d5a('0x15')],_0x454c53);_0x29692e(_0x50f723[_0x2d5a('0x13')](0x1f4,_0x199686[_0x2d5a('0x15')]));});});};exports[_0x2d5a('0x20')]=function(_0x3e8fda){var _0xf62d6e=this;return new Promise(function(_0x3a55ff,_0x598b61){return db[_0x2d5a('0x17')][_0x2d5a('0x21')]({'raw':_0x3e8fda['options']?_0x3e8fda[_0x2d5a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3e8fda['options']?_0x3e8fda['options']['where']||null:null,'attributes':_0x3e8fda[_0x2d5a('0x19')]?_0x3e8fda['options'][_0x2d5a('0x1b')]||null:null,'include':_0x3e8fda[_0x2d5a('0x19')]?_0x3e8fda['options'][_0x2d5a('0x1c')]?_['map'](_0x3e8fda[_0x2d5a('0x19')][_0x2d5a('0x1c')],function(_0x69f4f){return{'model':db[_0x69f4f['model']],'as':_0x69f4f['as'],'attributes':_0x69f4f[_0x2d5a('0x1b')],'include':_0x69f4f[_0x2d5a('0x1c')]?_['map'](_0x69f4f[_0x2d5a('0x1c')],function(_0x4f0792){return{'model':db[_0x4f0792[_0x2d5a('0x1e')]],'as':_0x4f0792['as'],'attributes':_0x4f0792[_0x2d5a('0x1b')],'include':_0x4f0792[_0x2d5a('0x1c')]?_[_0x2d5a('0x1d')](_0x4f0792[_0x2d5a('0x1c')],function(_0x3e166f){return{'model':db[_0x3e166f[_0x2d5a('0x1e')]],'as':_0x3e166f['as'],'attributes':_0x3e166f[_0x2d5a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d5a('0xc')](function(_0x31955b){logger[_0x2d5a('0xd')]('ShowZohoAccount',_0x3e8fda);logger[_0x2d5a('0xf')]('ShowZohoAccount',_0x3e8fda,JSON['stringify'](_0x31955b));_0x3a55ff(_0x31955b);})[_0x2d5a('0x16')](function(_0x33c16e){logger[_0x2d5a('0x13')](_0x2d5a('0x20'),_0x33c16e[_0x2d5a('0x15')],_0x3e8fda);_0x598b61(_0xf62d6e[_0x2d5a('0x13')](0x1f4,_0x33c16e['message']));});});}; \ No newline at end of file +var _0x5eef=['../../config/logger','rpc','../../config/environment','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','model','attributes','map','find','ShowZohoAccount','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x26e037,_0x212af2){var _0x4cd030=function(_0x5f11bd){while(--_0x5f11bd){_0x26e037['push'](_0x26e037['shift']());}};_0x4cd030(++_0x212af2);}(_0x5eef,0x9c));var _0xf5ee=function(_0x4708af,_0x1dbc44){_0x4708af=_0x4708af-0x0;var _0x39e6f6=_0x5eef[_0x4708af];return _0x39e6f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5ee('0x0'));var BPromise=require('bluebird');var rs=require(_0xf5ee('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5ee('0x2'))['db'];var utils=require(_0xf5ee('0x3'));var logger=require(_0xf5ee('0x4'))(_0xf5ee('0x5'));var config=require(_0xf5ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae819,_0x24e3a5,_0x4f0e34){return new BPromise(function(_0x31c9d8,_0x2e4224){return client[_0xf5ee('0x7')](_0x3ae819,_0x4f0e34)[_0xf5ee('0x8')](function(_0x125def){logger[_0xf5ee('0x9')](_0xf5ee('0xa'),_0x24e3a5,_0xf5ee('0xb'));logger[_0xf5ee('0xc')](_0xf5ee('0xd'),_0x24e3a5,'request\x20sent',JSON[_0xf5ee('0xe')](_0x125def));if(_0x125def['error']){if(_0x125def[_0xf5ee('0xf')]['code']===0x1f4){logger[_0xf5ee('0xf')](_0xf5ee('0xa'),_0x24e3a5,_0x125def[_0xf5ee('0xf')][_0xf5ee('0x10')]);return _0x2e4224(_0x125def['error'][_0xf5ee('0x10')]);}logger[_0xf5ee('0xf')](_0xf5ee('0xa'),_0x24e3a5,_0x125def[_0xf5ee('0xf')]['message']);return _0x31c9d8(_0x125def['error'][_0xf5ee('0x10')]);}else{logger[_0xf5ee('0x9')](_0xf5ee('0xa'),_0x24e3a5,_0xf5ee('0xb'));_0x31c9d8(_0x125def[_0xf5ee('0x11')]['message']);}})[_0xf5ee('0x12')](function(_0x21a35c){logger['error'](_0xf5ee('0xa'),_0x24e3a5,_0x21a35c);_0x2e4224(_0x21a35c);});});}exports[_0xf5ee('0x13')]=function(_0x26cb76){var _0xb02e78=this;return new Promise(function(_0x47a0b2,_0x12462d){return db[_0xf5ee('0x14')][_0xf5ee('0x15')]({'raw':_0x26cb76['options']?_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x17')]===undefined?!![]:![]:!![],'where':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x18')]||null:null,'attributes':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76['options']['attributes']||null:null,'limit':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x19')]||null:null,'include':_0x26cb76[_0xf5ee('0x16')]?_0x26cb76['options'][_0xf5ee('0x1a')]?_['map'](_0x26cb76[_0xf5ee('0x16')][_0xf5ee('0x1a')],function(_0x2e2f35){return{'model':db[_0x2e2f35[_0xf5ee('0x1b')]],'as':_0x2e2f35['as'],'attributes':_0x2e2f35[_0xf5ee('0x1c')],'include':_0x2e2f35['include']?_[_0xf5ee('0x1d')](_0x2e2f35[_0xf5ee('0x1a')],function(_0x5b7744){return{'model':db[_0x5b7744[_0xf5ee('0x1b')]],'as':_0x5b7744['as'],'attributes':_0x5b7744[_0xf5ee('0x1c')],'include':_0x5b7744[_0xf5ee('0x1a')]?_[_0xf5ee('0x1d')](_0x5b7744[_0xf5ee('0x1a')],function(_0x3db008){return{'model':db[_0x3db008[_0xf5ee('0x1b')]],'as':_0x3db008['as'],'attributes':_0x3db008[_0xf5ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf5ee('0x8')](function(_0x576d16){logger['info'](_0xf5ee('0x13'),_0x26cb76);logger[_0xf5ee('0xc')](_0xf5ee('0x13'),_0x26cb76,JSON[_0xf5ee('0xe')](_0x576d16));_0x47a0b2(_0x576d16);})[_0xf5ee('0x12')](function(_0x46359c){logger[_0xf5ee('0xf')](_0xf5ee('0x13'),_0x46359c['message'],_0x26cb76);_0x12462d(_0xb02e78['error'](0x1f4,_0x46359c[_0xf5ee('0x10')]));});});};exports['ShowZohoAccount']=function(_0x148ba1){var _0x4cdaa0=this;return new Promise(function(_0x36c069,_0x5589d1){return db[_0xf5ee('0x14')][_0xf5ee('0x1e')]({'raw':_0x148ba1[_0xf5ee('0x16')]?_0x148ba1[_0xf5ee('0x16')][_0xf5ee('0x17')]===undefined?!![]:![]:!![],'where':_0x148ba1[_0xf5ee('0x16')]?_0x148ba1[_0xf5ee('0x16')]['where']||null:null,'attributes':_0x148ba1['options']?_0x148ba1[_0xf5ee('0x16')][_0xf5ee('0x1c')]||null:null,'include':_0x148ba1[_0xf5ee('0x16')]?_0x148ba1[_0xf5ee('0x16')][_0xf5ee('0x1a')]?_[_0xf5ee('0x1d')](_0x148ba1['options'][_0xf5ee('0x1a')],function(_0x3afa1e){return{'model':db[_0x3afa1e[_0xf5ee('0x1b')]],'as':_0x3afa1e['as'],'attributes':_0x3afa1e[_0xf5ee('0x1c')],'include':_0x3afa1e[_0xf5ee('0x1a')]?_['map'](_0x3afa1e['include'],function(_0x162857){return{'model':db[_0x162857[_0xf5ee('0x1b')]],'as':_0x162857['as'],'attributes':_0x162857[_0xf5ee('0x1c')],'include':_0x162857[_0xf5ee('0x1a')]?_['map'](_0x162857[_0xf5ee('0x1a')],function(_0xa4712f){return{'model':db[_0xa4712f[_0xf5ee('0x1b')]],'as':_0xa4712f['as'],'attributes':_0xa4712f[_0xf5ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf5ee('0x8')](function(_0xce449c){logger[_0xf5ee('0x9')](_0xf5ee('0x1f'),_0x148ba1);logger[_0xf5ee('0xc')](_0xf5ee('0x1f'),_0x148ba1,JSON[_0xf5ee('0xe')](_0xce449c));_0x36c069(_0xce449c);})[_0xf5ee('0x12')](function(_0x121ba4){logger[_0xf5ee('0xf')](_0xf5ee('0x1f'),_0x121ba4[_0xf5ee('0x10')],_0x148ba1);_0x5589d1(_0x4cdaa0[_0xf5ee('0xf')](0x1f4,_0x121ba4[_0xf5ee('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index d02c597..6db903c 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 _0xd3b1=['index','get','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','./intZohoConfiguration.controller'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xd3b1,0x1f2));var _0x1d3b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd3b1[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x1d3b('0x0'));var util=require('util');var path=require(_0x1d3b('0x1'));var timeout=require(_0x1d3b('0x2'));var express=require(_0x1d3b('0x3'));var router=express['Router']();var fs_extra=require(_0x1d3b('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1d3b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x1d3b('0x6')]);router[_0x1d3b('0x7')](_0x1d3b('0x8'),auth[_0x1d3b('0x9')](),controller[_0x1d3b('0xa')]);router[_0x1d3b('0x7')](_0x1d3b('0xb'),auth[_0x1d3b('0x9')](),controller['getFields']);router[_0x1d3b('0x7')](_0x1d3b('0xc'),auth[_0x1d3b('0x9')](),controller[_0x1d3b('0xd')]);router[_0x1d3b('0x7')](_0x1d3b('0xe'),auth[_0x1d3b('0x9')](),controller['getDescriptions']);router[_0x1d3b('0xf')]('/',auth[_0x1d3b('0x9')](),controller[_0x1d3b('0x10')]);router['put'](_0x1d3b('0x8'),auth['isAuthenticated'](),controller[_0x1d3b('0x11')]);router[_0x1d3b('0x12')](_0x1d3b('0x8'),auth['isAuthenticated'](),controller[_0x1d3b('0x13')]);module[_0x1d3b('0x14')]=router; \ No newline at end of file +var _0xbd80=['fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','util','path','express','Router'];(function(_0x22027b,_0x647716){var _0x1ce55d=function(_0x51c125){while(--_0x51c125){_0x22027b['push'](_0x22027b['shift']());}};_0x1ce55d(++_0x647716);}(_0xbd80,0xf9));var _0x0bd8=function(_0x50a453,_0x28740a){_0x50a453=_0x50a453-0x0;var _0x52cf59=_0xbd80[_0x50a453];return _0x52cf59;};'use strict';var multer=require('multer');var util=require(_0x0bd8('0x0'));var path=require(_0x0bd8('0x1'));var timeout=require('connect-timeout');var express=require(_0x0bd8('0x2'));var router=express[_0x0bd8('0x3')]();var fs_extra=require(_0x0bd8('0x4'));var auth=require(_0x0bd8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bd8('0x6'));var controller=require(_0x0bd8('0x7'));router[_0x0bd8('0x8')]('/',auth['isAuthenticated'](),controller[_0x0bd8('0x9')]);router[_0x0bd8('0x8')](_0x0bd8('0xa'),auth[_0x0bd8('0xb')](),controller[_0x0bd8('0xc')]);router['get'](_0x0bd8('0xd'),auth[_0x0bd8('0xb')](),controller[_0x0bd8('0xe')]);router[_0x0bd8('0x8')](_0x0bd8('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x0bd8('0x10'),auth['isAuthenticated'](),controller[_0x0bd8('0x11')]);router[_0x0bd8('0x12')]('/',auth[_0x0bd8('0xb')](),controller[_0x0bd8('0x13')]);router['put'](_0x0bd8('0xa'),auth[_0x0bd8('0xb')](),controller[_0x0bd8('0x14')]);router['delete'](_0x0bd8('0xa'),auth['isAuthenticated'](),controller[_0x0bd8('0x15')]);module[_0x0bd8('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index ff1fc4c..ffe7fe0 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 _0xf2c6=['STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x562e78,_0x96d491){var _0x47eeb0=function(_0x17763c){while(--_0x17763c){_0x562e78['push'](_0x562e78['shift']());}};_0x47eeb0(++_0x96d491);}(_0xf2c6,0x1e6));var _0x6f2c=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0xf2c6[_0x1cbcf1];return _0x3a06f0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6f2c('0x0')]},'moduleCreate':{'type':Sequelize[_0x6f2c('0x1')](_0x6f2c('0x2'),_0x6f2c('0x3'),_0x6f2c('0x4')),'defaultValue':_0x6f2c('0x2')},'moduleSearch':{'type':Sequelize[_0x6f2c('0x1')](_0x6f2c('0x5'),_0x6f2c('0x3'),_0x6f2c('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x6f2c('0x0')]}}; \ No newline at end of file +var _0x9c5a=['nothing','contact_lead','STRING','sequelize','exports','ENUM','lead','contact'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3c084c,_0x132774){_0x3c084c=_0x3c084c-0x0;var _0x49f8ff=_0x9c5a[_0x3c084c];return _0x49f8ff;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xa9c5('0x2')](_0xa9c5('0x3'),_0xa9c5('0x4'),_0xa9c5('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xa9c5('0x2')](_0xa9c5('0x6'),'contact',_0xa9c5('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xa9c5('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index e48db5c..27d8737 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 _0x9271=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getFields','ZohoField','getSubjects','findOne','getDescriptions','eml-format'];(function(_0x4ed59d,_0x5f0b0e){var _0xff9391=function(_0x184980){while(--_0x184980){_0x4ed59d['push'](_0x4ed59d['shift']());}};_0xff9391(++_0x5f0b0e);}(_0x9271,0x1eb));var _0x1927=function(_0x3b5b9f,_0x38d863){_0x3b5b9f=_0x3b5b9f-0x0;var _0x2eb751=_0x9271[_0x3b5b9f];return _0x2eb751;};'use strict';var emlformat=require(_0x1927('0x0'));var rimraf=require(_0x1927('0x1'));var zipdir=require(_0x1927('0x2'));var jsonpatch=require(_0x1927('0x3'));var rp=require('request-promise');var moment=require(_0x1927('0x4'));var BPromise=require(_0x1927('0x5'));var Mustache=require(_0x1927('0x6'));var util=require(_0x1927('0x7'));var path=require('path');var sox=require(_0x1927('0x8'));var csv=require(_0x1927('0x9'));var ejs=require(_0x1927('0xa'));var fs=require('fs');var fs_extra=require(_0x1927('0xb'));var _=require(_0x1927('0xc'));var squel=require(_0x1927('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1927('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1927('0xf'));var Papa=require(_0x1927('0x10'));var Redis=require(_0x1927('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1927('0x12'));var hardwareService=require(_0x1927('0x13'));var logger=require(_0x1927('0x14'))(_0x1927('0x15'));var utils=require(_0x1927('0x16'));var config=require(_0x1927('0x17'));var licenseUtil=require(_0x1927('0x18'));var db=require(_0x1927('0x19'))['db'];function respondWithStatusCode(_0x13b80d,_0x2a884f){_0x2a884f=_0x2a884f||0xcc;return function(_0xaf188e){if(_0xaf188e){return _0x13b80d[_0x1927('0x1a')](_0x2a884f);}return _0x13b80d[_0x1927('0x1b')](_0x2a884f)[_0x1927('0x1c')]();};}function respondWithResult(_0x3c6ae7,_0x59d192){_0x59d192=_0x59d192||0xc8;return function(_0x465f60){if(_0x465f60){return _0x3c6ae7['status'](_0x59d192)[_0x1927('0x1d')](_0x465f60);}};}function respondWithFilteredResult(_0x385001,_0x1f519e){return function(_0x2d241b){if(_0x2d241b){var _0x415609=typeof _0x1f519e['offset']===_0x1927('0x1e')&&typeof _0x1f519e[_0x1927('0x1f')]===_0x1927('0x1e');var _0x3f3e99=_0x2d241b[_0x1927('0x20')];var _0x47f489=_0x415609?0x0:_0x1f519e[_0x1927('0x21')];var _0x108f46=_0x415609?_0x2d241b['count']:_0x1f519e[_0x1927('0x21')]+_0x1f519e[_0x1927('0x1f')];var _0x4bb973;if(_0x108f46>=_0x3f3e99){_0x108f46=_0x3f3e99;_0x4bb973=0xc8;}else{_0x4bb973=0xce;}_0x385001[_0x1927('0x1b')](_0x4bb973);return _0x385001[_0x1927('0x22')](_0x1927('0x23'),_0x47f489+'-'+_0x108f46+'/'+_0x3f3e99)[_0x1927('0x1d')](_0x2d241b);}return null;};}function patchUpdates(_0x694368){return function(_0x3ffa61){try{jsonpatch[_0x1927('0x24')](_0x3ffa61,_0x694368,!![]);}catch(_0x5bf8b9){return BPromise[_0x1927('0x25')](_0x5bf8b9);}return _0x3ffa61[_0x1927('0x26')]();};}function saveUpdates(_0x557fd9,_0x95afc8){return function(_0x3c1d4c){if(_0x3c1d4c){return _0x3c1d4c['update'](_0x557fd9)[_0x1927('0x27')](function(_0x414a6b){return _0x414a6b;});}return null;};}function removeEntity(_0x287ef9,_0x3e657d){return function(_0x2a9b53){if(_0x2a9b53){return _0x2a9b53['destroy']()[_0x1927('0x27')](function(){_0x287ef9[_0x1927('0x1b')](0xcc)[_0x1927('0x1c')]();});}};}function handleEntityNotFound(_0x41148d,_0x201f25){return function(_0x2d0640){if(!_0x2d0640){_0x41148d['sendStatus'](0x194);}return _0x2d0640;};}function handleError(_0x2d4580,_0x11da8e){_0x11da8e=_0x11da8e||0x1f4;return function(_0x209ca2){logger[_0x1927('0x28')](_0x209ca2[_0x1927('0x29')]);if(_0x209ca2[_0x1927('0x2a')]){delete _0x209ca2[_0x1927('0x2a')];}_0x2d4580[_0x1927('0x1b')](_0x11da8e)[_0x1927('0x2b')](_0x209ca2);};}exports['index']=function(_0xce89d,_0x666e4a){var _0x33a4f5={},_0x329001={},_0x150ab2={'count':0x0,'rows':[]};var _0x1e5972=_[_0x1927('0x2c')](db[_0x1927('0x2d')][_0x1927('0x2e')],function(_0x4d9365){return{'name':_0x4d9365[_0x1927('0x2f')],'type':_0x4d9365[_0x1927('0x30')][_0x1927('0x31')]};});_0x329001['model']=_[_0x1927('0x2c')](_0x1e5972,_0x1927('0x2a'));_0x329001[_0x1927('0x32')]=_[_0x1927('0x33')](_0xce89d[_0x1927('0x32')]);_0x329001[_0x1927('0x34')]=_['intersection'](_0x329001[_0x1927('0x35')],_0x329001[_0x1927('0x32')]);_0x33a4f5[_0x1927('0x36')]=_[_0x1927('0x37')](_0x329001['model'],qs[_0x1927('0x38')](_0xce89d[_0x1927('0x32')][_0x1927('0x38')]));_0x33a4f5[_0x1927('0x36')]=_0x33a4f5[_0x1927('0x36')][_0x1927('0x39')]?_0x33a4f5[_0x1927('0x36')]:_0x329001[_0x1927('0x35')];if(!_0xce89d[_0x1927('0x32')][_0x1927('0x3a')](_0x1927('0x3b'))){_0x33a4f5['limit']=qs['limit'](_0xce89d['query'][_0x1927('0x1f')]);_0x33a4f5[_0x1927('0x21')]=qs[_0x1927('0x21')](_0xce89d[_0x1927('0x32')][_0x1927('0x21')]);}_0x33a4f5[_0x1927('0x3c')]=qs['sort'](_0xce89d[_0x1927('0x32')][_0x1927('0x3d')]);_0x33a4f5['where']=qs['filters'](_[_0x1927('0x3e')](_0xce89d[_0x1927('0x32')],_0x329001[_0x1927('0x34')]),_0x1e5972);if(_0xce89d[_0x1927('0x32')][_0x1927('0x3f')]){_0x33a4f5[_0x1927('0x40')]=_[_0x1927('0x41')](_0x33a4f5[_0x1927('0x40')],{'$or':_[_0x1927('0x2c')](_0x1e5972,function(_0x2a2794){if(_0x2a2794[_0x1927('0x30')]!=='VIRTUAL'){var _0x448db4={};_0x448db4[_0x2a2794[_0x1927('0x2a')]]={'$like':'%'+_0xce89d[_0x1927('0x32')][_0x1927('0x3f')]+'%'};return _0x448db4;}})});}_0x33a4f5=_[_0x1927('0x41')]({},_0x33a4f5,_0xce89d[_0x1927('0x42')]);var _0x50ddce={'where':_0x33a4f5[_0x1927('0x40')]};return db[_0x1927('0x2d')][_0x1927('0x20')](_0x50ddce)[_0x1927('0x27')](function(_0x2c6228){_0x150ab2[_0x1927('0x20')]=_0x2c6228;if(_0xce89d[_0x1927('0x32')][_0x1927('0x43')]){_0x33a4f5[_0x1927('0x44')]=[{'all':!![]}];}return db[_0x1927('0x2d')][_0x1927('0x45')](_0x33a4f5);})['then'](function(_0x38dd9d){_0x150ab2[_0x1927('0x46')]=_0x38dd9d;return _0x150ab2;})[_0x1927('0x27')](respondWithFilteredResult(_0x666e4a,_0x33a4f5))['catch'](handleError(_0x666e4a,null));};exports[_0x1927('0x47')]=function(_0x5d1424,_0x1c9113){var _0x11fb57={'raw':![],'where':{'id':_0x5d1424[_0x1927('0x48')]['id']}},_0x24fd09={};_0x24fd09[_0x1927('0x35')]=_['keys'](db[_0x1927('0x2d')][_0x1927('0x2e')]);_0x24fd09[_0x1927('0x32')]=_[_0x1927('0x33')](_0x5d1424[_0x1927('0x32')]);_0x24fd09[_0x1927('0x34')]=_['intersection'](_0x24fd09[_0x1927('0x35')],_0x24fd09[_0x1927('0x32')]);_0x11fb57[_0x1927('0x36')]=_[_0x1927('0x37')](_0x24fd09[_0x1927('0x35')],qs[_0x1927('0x38')](_0x5d1424['query']['fields']));_0x11fb57[_0x1927('0x36')]=_0x11fb57[_0x1927('0x36')][_0x1927('0x39')]?_0x11fb57[_0x1927('0x36')]:_0x24fd09[_0x1927('0x35')];if(_0x5d1424['query'][_0x1927('0x43')]){_0x11fb57['include']=[{'all':!![]}];}_0x11fb57=_[_0x1927('0x41')]({},_0x11fb57,_0x5d1424[_0x1927('0x42')]);return db[_0x1927('0x2d')][_0x1927('0x49')](_0x11fb57)[_0x1927('0x27')](handleEntityNotFound(_0x1c9113,null))[_0x1927('0x27')](respondWithResult(_0x1c9113,null))[_0x1927('0x4a')](handleError(_0x1c9113,null));};exports['create']=function(_0x5aafa8,_0x59f757){return db[_0x1927('0x2d')][_0x1927('0x4b')](_0x5aafa8[_0x1927('0x4c')],{})[_0x1927('0x27')](respondWithResult(_0x59f757,0xc9))[_0x1927('0x4a')](handleError(_0x59f757,null));};exports['update']=function(_0x1ce6ab,_0x45a2d3){if(_0x1ce6ab[_0x1927('0x4c')]['id']){delete _0x1ce6ab[_0x1927('0x4c')]['id'];}return db[_0x1927('0x2d')][_0x1927('0x49')]({'where':{'id':_0x1ce6ab[_0x1927('0x48')]['id']}})[_0x1927('0x27')](handleEntityNotFound(_0x45a2d3,null))[_0x1927('0x27')](saveUpdates(_0x1ce6ab[_0x1927('0x4c')],null))[_0x1927('0x27')](respondWithResult(_0x45a2d3,null))[_0x1927('0x4a')](handleError(_0x45a2d3,null));};exports['destroy']=function(_0x5831ad,_0x32a408){return db[_0x1927('0x2d')]['find']({'where':{'id':_0x5831ad['params']['id']}})['then'](handleEntityNotFound(_0x32a408,null))[_0x1927('0x27')](removeEntity(_0x32a408,null))[_0x1927('0x4a')](handleError(_0x32a408,null));};exports[_0x1927('0x4d')]=function(_0x5782b3,_0x24c680,_0x426c42){var _0x132c68={};var _0x2f3a14={};var _0x36dd20;var _0x82ca14;return db[_0x1927('0x2d')]['findOne']({'where':{'id':_0x5782b3['params']['id']}})[_0x1927('0x27')](handleEntityNotFound(_0x24c680,null))[_0x1927('0x27')](function(_0x10ba54){if(_0x10ba54){_0x36dd20=_0x10ba54;_0x2f3a14[_0x1927('0x35')]=_[_0x1927('0x33')](db[_0x1927('0x4e')]['rawAttributes']);_0x2f3a14[_0x1927('0x32')]=_[_0x1927('0x33')](_0x5782b3['query']);_0x2f3a14[_0x1927('0x34')]=_[_0x1927('0x37')](_0x2f3a14[_0x1927('0x35')],_0x2f3a14[_0x1927('0x32')]);_0x132c68[_0x1927('0x36')]=_[_0x1927('0x37')](_0x2f3a14[_0x1927('0x35')],qs['fields'](_0x5782b3[_0x1927('0x32')][_0x1927('0x38')]));_0x132c68[_0x1927('0x36')]=_0x132c68[_0x1927('0x36')]['length']?_0x132c68['attributes']:_0x2f3a14[_0x1927('0x35')];_0x132c68[_0x1927('0x3c')]=qs[_0x1927('0x3d')](_0x5782b3[_0x1927('0x32')][_0x1927('0x3d')]);_0x132c68['where']=qs[_0x1927('0x34')](_['pick'](_0x5782b3[_0x1927('0x32')],_0x2f3a14[_0x1927('0x34')]));if(_0x5782b3[_0x1927('0x32')]['filter']){_0x132c68[_0x1927('0x40')]=_[_0x1927('0x41')](_0x132c68[_0x1927('0x40')],{'$or':_['map'](_0x132c68[_0x1927('0x36')],function(_0x1a75c0){var _0x12b5e0={};_0x12b5e0[_0x1a75c0]={'$like':'%'+_0x5782b3[_0x1927('0x32')]['filter']+'%'};return _0x12b5e0;})});}_0x132c68=_[_0x1927('0x41')]({},_0x132c68,_0x5782b3['options']);return _0x36dd20[_0x1927('0x4d')](_0x132c68);}})[_0x1927('0x27')](function(_0x35140d){if(_0x35140d){_0x82ca14=_0x35140d['length'];if(!_0x5782b3[_0x1927('0x32')][_0x1927('0x3a')](_0x1927('0x3b'))){_0x132c68[_0x1927('0x1f')]=qs[_0x1927('0x1f')](_0x5782b3['query'][_0x1927('0x1f')]);_0x132c68[_0x1927('0x21')]=qs[_0x1927('0x21')](_0x5782b3[_0x1927('0x32')][_0x1927('0x21')]);}return _0x36dd20['getFields'](_0x132c68);}})['then'](function(_0x1ced8c){if(_0x1ced8c){return _0x1ced8c?{'count':_0x82ca14,'rows':_0x1ced8c}:null;}})[_0x1927('0x27')](respondWithResult(_0x24c680,null))[_0x1927('0x4a')](handleError(_0x24c680,null));};exports[_0x1927('0x4f')]=function(_0x790744,_0x54d57e,_0x58c7d3){var _0x352915={};var _0x4989f6={};var _0x2ed157;var _0xa093d3;return db[_0x1927('0x2d')][_0x1927('0x50')]({'where':{'id':_0x790744['params']['id']}})[_0x1927('0x27')](handleEntityNotFound(_0x54d57e,null))[_0x1927('0x27')](function(_0x5f5b2f){if(_0x5f5b2f){_0x2ed157=_0x5f5b2f;_0x4989f6[_0x1927('0x35')]=_[_0x1927('0x33')](db[_0x1927('0x4e')][_0x1927('0x2e')]);_0x4989f6['query']=_[_0x1927('0x33')](_0x790744[_0x1927('0x32')]);_0x4989f6[_0x1927('0x34')]=_[_0x1927('0x37')](_0x4989f6[_0x1927('0x35')],_0x4989f6[_0x1927('0x32')]);_0x352915['attributes']=_['intersection'](_0x4989f6[_0x1927('0x35')],qs[_0x1927('0x38')](_0x790744[_0x1927('0x32')][_0x1927('0x38')]));_0x352915[_0x1927('0x36')]=_0x352915['attributes'][_0x1927('0x39')]?_0x352915[_0x1927('0x36')]:_0x4989f6[_0x1927('0x35')];_0x352915[_0x1927('0x3c')]=qs['sort'](_0x790744[_0x1927('0x32')][_0x1927('0x3d')]);_0x352915[_0x1927('0x40')]=qs[_0x1927('0x34')](_['pick'](_0x790744[_0x1927('0x32')],_0x4989f6['filters']));if(_0x790744[_0x1927('0x32')]['filter']){_0x352915['where']=_[_0x1927('0x41')](_0x352915['where'],{'$or':_[_0x1927('0x2c')](_0x352915[_0x1927('0x36')],function(_0x481914){var _0x5a8221={};_0x5a8221[_0x481914]={'$like':'%'+_0x790744['query'][_0x1927('0x3f')]+'%'};return _0x5a8221;})});}_0x352915=_[_0x1927('0x41')]({},_0x352915,_0x790744[_0x1927('0x42')]);return _0x2ed157[_0x1927('0x4f')](_0x352915);}})[_0x1927('0x27')](function(_0x2ab89e){if(_0x2ab89e){_0xa093d3=_0x2ab89e[_0x1927('0x39')];if(!_0x790744['query']['hasOwnProperty']('nolimit')){_0x352915[_0x1927('0x1f')]=qs['limit'](_0x790744['query'][_0x1927('0x1f')]);_0x352915[_0x1927('0x21')]=qs[_0x1927('0x21')](_0x790744[_0x1927('0x32')][_0x1927('0x21')]);}return _0x2ed157[_0x1927('0x4f')](_0x352915);}})[_0x1927('0x27')](function(_0x454d52){if(_0x454d52){return _0x454d52?{'count':_0xa093d3,'rows':_0x454d52}:null;}})[_0x1927('0x27')](respondWithResult(_0x54d57e,null))[_0x1927('0x4a')](handleError(_0x54d57e,null));};exports['getDescriptions']=function(_0x10ae16,_0x33ae00,_0x2ebcbf){var _0x2b009c={};var _0x457a6e={};var _0xa3b45e;var _0x22f6ff;return db[_0x1927('0x2d')][_0x1927('0x50')]({'where':{'id':_0x10ae16[_0x1927('0x48')]['id']}})[_0x1927('0x27')](handleEntityNotFound(_0x33ae00,null))[_0x1927('0x27')](function(_0x47ee8b){if(_0x47ee8b){_0xa3b45e=_0x47ee8b;_0x457a6e[_0x1927('0x35')]=_[_0x1927('0x33')](db['ZohoField'][_0x1927('0x2e')]);_0x457a6e[_0x1927('0x32')]=_[_0x1927('0x33')](_0x10ae16[_0x1927('0x32')]);_0x457a6e[_0x1927('0x34')]=_[_0x1927('0x37')](_0x457a6e[_0x1927('0x35')],_0x457a6e[_0x1927('0x32')]);_0x2b009c[_0x1927('0x36')]=_[_0x1927('0x37')](_0x457a6e[_0x1927('0x35')],qs[_0x1927('0x38')](_0x10ae16[_0x1927('0x32')][_0x1927('0x38')]));_0x2b009c[_0x1927('0x36')]=_0x2b009c[_0x1927('0x36')]['length']?_0x2b009c[_0x1927('0x36')]:_0x457a6e[_0x1927('0x35')];_0x2b009c[_0x1927('0x3c')]=qs[_0x1927('0x3d')](_0x10ae16['query']['sort']);_0x2b009c[_0x1927('0x40')]=qs[_0x1927('0x34')](_['pick'](_0x10ae16[_0x1927('0x32')],_0x457a6e[_0x1927('0x34')]));if(_0x10ae16[_0x1927('0x32')][_0x1927('0x3f')]){_0x2b009c[_0x1927('0x40')]=_[_0x1927('0x41')](_0x2b009c[_0x1927('0x40')],{'$or':_['map'](_0x2b009c['attributes'],function(_0x3bb4f6){var _0x2b3c93={};_0x2b3c93[_0x3bb4f6]={'$like':'%'+_0x10ae16[_0x1927('0x32')]['filter']+'%'};return _0x2b3c93;})});}_0x2b009c=_[_0x1927('0x41')]({},_0x2b009c,_0x10ae16[_0x1927('0x42')]);return _0xa3b45e[_0x1927('0x51')](_0x2b009c);}})[_0x1927('0x27')](function(_0x3412f6){if(_0x3412f6){_0x22f6ff=_0x3412f6['length'];if(!_0x10ae16['query'][_0x1927('0x3a')]('nolimit')){_0x2b009c['limit']=qs[_0x1927('0x1f')](_0x10ae16['query']['limit']);_0x2b009c['offset']=qs[_0x1927('0x21')](_0x10ae16['query'][_0x1927('0x21')]);}return _0xa3b45e[_0x1927('0x51')](_0x2b009c);}})[_0x1927('0x27')](function(_0xd67d3d){if(_0xd67d3d){return _0xd67d3d?{'count':_0x22f6ff,'rows':_0xd67d3d}:null;}})[_0x1927('0x27')](respondWithResult(_0x33ae00,null))[_0x1927('0x4a')](handleError(_0x33ae00,null));}; \ No newline at end of file +var _0x2c80=['findAll','catch','show','options','find','create','body','update','params','findOne','ZohoField','getFields','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','stack','name','map','ZohoConfiguration','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include'];(function(_0x25791b,_0x51e52a){var _0x1491d5=function(_0x494c01){while(--_0x494c01){_0x25791b['push'](_0x25791b['shift']());}};_0x1491d5(++_0x51e52a);}(_0x2c80,0xf5));var _0x02c8=function(_0x3238bd,_0x4ea3ef){_0x3238bd=_0x3238bd-0x0;var _0xdc7a7e=_0x2c80[_0x3238bd];return _0xdc7a7e;};'use strict';var emlformat=require(_0x02c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02c8('0x1'));var jsonpatch=require(_0x02c8('0x2'));var rp=require(_0x02c8('0x3'));var moment=require(_0x02c8('0x4'));var BPromise=require(_0x02c8('0x5'));var Mustache=require(_0x02c8('0x6'));var util=require('util');var path=require(_0x02c8('0x7'));var sox=require(_0x02c8('0x8'));var csv=require(_0x02c8('0x9'));var ejs=require(_0x02c8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02c8('0xb'));var squel=require(_0x02c8('0xc'));var crypto=require(_0x02c8('0xd'));var jsforce=require(_0x02c8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x02c8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x02c8('0xf'));var authService=require(_0x02c8('0x10'));var qs=require(_0x02c8('0x11'));var as=require(_0x02c8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x02c8('0x13'))('api');var utils=require(_0x02c8('0x14'));var config=require(_0x02c8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x02c8('0x16'))['db'];function respondWithStatusCode(_0x23f878,_0x16caa2){_0x16caa2=_0x16caa2||0xcc;return function(_0x558106){if(_0x558106){return _0x23f878[_0x02c8('0x17')](_0x16caa2);}return _0x23f878[_0x02c8('0x18')](_0x16caa2)[_0x02c8('0x19')]();};}function respondWithResult(_0x51f153,_0x385bad){_0x385bad=_0x385bad||0xc8;return function(_0xca0e2b){if(_0xca0e2b){return _0x51f153[_0x02c8('0x18')](_0x385bad)[_0x02c8('0x1a')](_0xca0e2b);}};}function respondWithFilteredResult(_0x1cf935,_0x15948e){return function(_0x46503d){if(_0x46503d){var _0x229d3c=typeof _0x15948e[_0x02c8('0x1b')]===_0x02c8('0x1c')&&typeof _0x15948e[_0x02c8('0x1d')]===_0x02c8('0x1c');var _0x4984f7=_0x46503d['count'];var _0x5cad90=_0x229d3c?0x0:_0x15948e['offset'];var _0x35c041=_0x229d3c?_0x46503d['count']:_0x15948e['offset']+_0x15948e['limit'];var _0x2e7146;if(_0x35c041>=_0x4984f7){_0x35c041=_0x4984f7;_0x2e7146=0xc8;}else{_0x2e7146=0xce;}_0x1cf935['status'](_0x2e7146);return _0x1cf935[_0x02c8('0x1e')](_0x02c8('0x1f'),_0x5cad90+'-'+_0x35c041+'/'+_0x4984f7)[_0x02c8('0x1a')](_0x46503d);}return null;};}function patchUpdates(_0x16668e){return function(_0x18278e){try{jsonpatch[_0x02c8('0x20')](_0x18278e,_0x16668e,!![]);}catch(_0x5f0c7d){return BPromise['reject'](_0x5f0c7d);}return _0x18278e[_0x02c8('0x21')]();};}function saveUpdates(_0x3af7d2,_0x29a29e){return function(_0x5c537d){if(_0x5c537d){return _0x5c537d['update'](_0x3af7d2)[_0x02c8('0x22')](function(_0x1d4797){return _0x1d4797;});}return null;};}function removeEntity(_0x4939a8,_0x36b4a9){return function(_0x5408a2){if(_0x5408a2){return _0x5408a2[_0x02c8('0x23')]()['then'](function(){_0x4939a8['status'](0xcc)[_0x02c8('0x19')]();});}};}function handleEntityNotFound(_0x313720,_0x1e7650){return function(_0xf78034){if(!_0xf78034){_0x313720[_0x02c8('0x17')](0x194);}return _0xf78034;};}function handleError(_0x3b8297,_0x46bc29){_0x46bc29=_0x46bc29||0x1f4;return function(_0x2cad3a){logger['error'](_0x2cad3a[_0x02c8('0x24')]);if(_0x2cad3a[_0x02c8('0x25')]){delete _0x2cad3a[_0x02c8('0x25')];}_0x3b8297[_0x02c8('0x18')](_0x46bc29)['send'](_0x2cad3a);};}exports['index']=function(_0x465276,_0xdd23c1){var _0x5becdd={},_0xf0c6ea={},_0x292634={'count':0x0,'rows':[]};var _0x48b1f6=_[_0x02c8('0x26')](db[_0x02c8('0x27')][_0x02c8('0x28')],function(_0x645d51){return{'name':_0x645d51['fieldName'],'type':_0x645d51[_0x02c8('0x29')][_0x02c8('0x2a')]};});_0xf0c6ea['model']=_['map'](_0x48b1f6,_0x02c8('0x25'));_0xf0c6ea['query']=_[_0x02c8('0x2b')](_0x465276['query']);_0xf0c6ea[_0x02c8('0x2c')]=_[_0x02c8('0x2d')](_0xf0c6ea[_0x02c8('0x2e')],_0xf0c6ea[_0x02c8('0x2f')]);_0x5becdd[_0x02c8('0x30')]=_[_0x02c8('0x2d')](_0xf0c6ea[_0x02c8('0x2e')],qs[_0x02c8('0x31')](_0x465276[_0x02c8('0x2f')][_0x02c8('0x31')]));_0x5becdd['attributes']=_0x5becdd[_0x02c8('0x30')][_0x02c8('0x32')]?_0x5becdd[_0x02c8('0x30')]:_0xf0c6ea[_0x02c8('0x2e')];if(!_0x465276[_0x02c8('0x2f')][_0x02c8('0x33')](_0x02c8('0x34'))){_0x5becdd[_0x02c8('0x1d')]=qs['limit'](_0x465276['query'][_0x02c8('0x1d')]);_0x5becdd[_0x02c8('0x1b')]=qs[_0x02c8('0x1b')](_0x465276['query']['offset']);}_0x5becdd[_0x02c8('0x35')]=qs[_0x02c8('0x36')](_0x465276['query'][_0x02c8('0x36')]);_0x5becdd[_0x02c8('0x37')]=qs['filters'](_[_0x02c8('0x38')](_0x465276[_0x02c8('0x2f')],_0xf0c6ea[_0x02c8('0x2c')]),_0x48b1f6);if(_0x465276[_0x02c8('0x2f')]['filter']){_0x5becdd[_0x02c8('0x37')]=_[_0x02c8('0x39')](_0x5becdd[_0x02c8('0x37')],{'$or':_[_0x02c8('0x26')](_0x48b1f6,function(_0x1c7818){if(_0x1c7818[_0x02c8('0x29')]!==_0x02c8('0x3a')){var _0x2c5d40={};_0x2c5d40[_0x1c7818[_0x02c8('0x25')]]={'$like':'%'+_0x465276[_0x02c8('0x2f')][_0x02c8('0x3b')]+'%'};return _0x2c5d40;}})});}_0x5becdd=_['merge']({},_0x5becdd,_0x465276['options']);var _0x51b3b3={'where':_0x5becdd['where']};return db[_0x02c8('0x27')][_0x02c8('0x3c')](_0x51b3b3)['then'](function(_0x4c70d3){_0x292634[_0x02c8('0x3c')]=_0x4c70d3;if(_0x465276[_0x02c8('0x2f')][_0x02c8('0x3d')]){_0x5becdd[_0x02c8('0x3e')]=[{'all':!![]}];}return db[_0x02c8('0x27')][_0x02c8('0x3f')](_0x5becdd);})['then'](function(_0x47210e){_0x292634['rows']=_0x47210e;return _0x292634;})[_0x02c8('0x22')](respondWithFilteredResult(_0xdd23c1,_0x5becdd))[_0x02c8('0x40')](handleError(_0xdd23c1,null));};exports[_0x02c8('0x41')]=function(_0xe59a0b,_0x1463f5){var _0x5739b8={'raw':![],'where':{'id':_0xe59a0b['params']['id']}},_0xa95742={};_0xa95742[_0x02c8('0x2e')]=_[_0x02c8('0x2b')](db[_0x02c8('0x27')][_0x02c8('0x28')]);_0xa95742[_0x02c8('0x2f')]=_[_0x02c8('0x2b')](_0xe59a0b[_0x02c8('0x2f')]);_0xa95742[_0x02c8('0x2c')]=_[_0x02c8('0x2d')](_0xa95742['model'],_0xa95742[_0x02c8('0x2f')]);_0x5739b8[_0x02c8('0x30')]=_[_0x02c8('0x2d')](_0xa95742[_0x02c8('0x2e')],qs[_0x02c8('0x31')](_0xe59a0b[_0x02c8('0x2f')]['fields']));_0x5739b8[_0x02c8('0x30')]=_0x5739b8['attributes'][_0x02c8('0x32')]?_0x5739b8[_0x02c8('0x30')]:_0xa95742['model'];if(_0xe59a0b[_0x02c8('0x2f')][_0x02c8('0x3d')]){_0x5739b8['include']=[{'all':!![]}];}_0x5739b8=_[_0x02c8('0x39')]({},_0x5739b8,_0xe59a0b[_0x02c8('0x42')]);return db[_0x02c8('0x27')][_0x02c8('0x43')](_0x5739b8)['then'](handleEntityNotFound(_0x1463f5,null))[_0x02c8('0x22')](respondWithResult(_0x1463f5,null))['catch'](handleError(_0x1463f5,null));};exports[_0x02c8('0x44')]=function(_0x30fc4d,_0xdad29c){return db[_0x02c8('0x27')][_0x02c8('0x44')](_0x30fc4d[_0x02c8('0x45')],{})[_0x02c8('0x22')](respondWithResult(_0xdad29c,0xc9))[_0x02c8('0x40')](handleError(_0xdad29c,null));};exports[_0x02c8('0x46')]=function(_0x3b98e7,_0x586ac2){if(_0x3b98e7[_0x02c8('0x45')]['id']){delete _0x3b98e7['body']['id'];}return db[_0x02c8('0x27')][_0x02c8('0x43')]({'where':{'id':_0x3b98e7[_0x02c8('0x47')]['id']}})[_0x02c8('0x22')](handleEntityNotFound(_0x586ac2,null))[_0x02c8('0x22')](saveUpdates(_0x3b98e7['body'],null))[_0x02c8('0x22')](respondWithResult(_0x586ac2,null))['catch'](handleError(_0x586ac2,null));};exports[_0x02c8('0x23')]=function(_0x3de14a,_0x4e4662){return db['ZohoConfiguration']['find']({'where':{'id':_0x3de14a[_0x02c8('0x47')]['id']}})['then'](handleEntityNotFound(_0x4e4662,null))[_0x02c8('0x22')](removeEntity(_0x4e4662,null))[_0x02c8('0x40')](handleError(_0x4e4662,null));};exports['getFields']=function(_0x3439a6,_0x2a0a29,_0x38a07c){var _0x3995b4={};var _0x53c20b={};var _0x360d5f;var _0x485ed9;return db[_0x02c8('0x27')][_0x02c8('0x48')]({'where':{'id':_0x3439a6[_0x02c8('0x47')]['id']}})[_0x02c8('0x22')](handleEntityNotFound(_0x2a0a29,null))[_0x02c8('0x22')](function(_0x5ec835){if(_0x5ec835){_0x360d5f=_0x5ec835;_0x53c20b['model']=_[_0x02c8('0x2b')](db[_0x02c8('0x49')][_0x02c8('0x28')]);_0x53c20b[_0x02c8('0x2f')]=_[_0x02c8('0x2b')](_0x3439a6[_0x02c8('0x2f')]);_0x53c20b[_0x02c8('0x2c')]=_[_0x02c8('0x2d')](_0x53c20b[_0x02c8('0x2e')],_0x53c20b['query']);_0x3995b4[_0x02c8('0x30')]=_['intersection'](_0x53c20b['model'],qs[_0x02c8('0x31')](_0x3439a6[_0x02c8('0x2f')][_0x02c8('0x31')]));_0x3995b4['attributes']=_0x3995b4[_0x02c8('0x30')][_0x02c8('0x32')]?_0x3995b4[_0x02c8('0x30')]:_0x53c20b[_0x02c8('0x2e')];_0x3995b4[_0x02c8('0x35')]=qs['sort'](_0x3439a6[_0x02c8('0x2f')]['sort']);_0x3995b4['where']=qs[_0x02c8('0x2c')](_['pick'](_0x3439a6[_0x02c8('0x2f')],_0x53c20b[_0x02c8('0x2c')]));if(_0x3439a6[_0x02c8('0x2f')]['filter']){_0x3995b4[_0x02c8('0x37')]=_[_0x02c8('0x39')](_0x3995b4[_0x02c8('0x37')],{'$or':_[_0x02c8('0x26')](_0x3995b4[_0x02c8('0x30')],function(_0x188860){var _0x10d154={};_0x10d154[_0x188860]={'$like':'%'+_0x3439a6[_0x02c8('0x2f')][_0x02c8('0x3b')]+'%'};return _0x10d154;})});}_0x3995b4=_[_0x02c8('0x39')]({},_0x3995b4,_0x3439a6[_0x02c8('0x42')]);return _0x360d5f[_0x02c8('0x4a')](_0x3995b4);}})[_0x02c8('0x22')](function(_0xde4d1d){if(_0xde4d1d){_0x485ed9=_0xde4d1d[_0x02c8('0x32')];if(!_0x3439a6[_0x02c8('0x2f')][_0x02c8('0x33')]('nolimit')){_0x3995b4[_0x02c8('0x1d')]=qs['limit'](_0x3439a6[_0x02c8('0x2f')]['limit']);_0x3995b4[_0x02c8('0x1b')]=qs[_0x02c8('0x1b')](_0x3439a6[_0x02c8('0x2f')][_0x02c8('0x1b')]);}return _0x360d5f[_0x02c8('0x4a')](_0x3995b4);}})[_0x02c8('0x22')](function(_0x47f862){if(_0x47f862){return _0x47f862?{'count':_0x485ed9,'rows':_0x47f862}:null;}})[_0x02c8('0x22')](respondWithResult(_0x2a0a29,null))[_0x02c8('0x40')](handleError(_0x2a0a29,null));};exports['getSubjects']=function(_0x3e3d43,_0x4e575b,_0x4b6c41){var _0x2a5d9a={};var _0x4aaa5a={};var _0x3a3bd1;var _0x5e85b6;return db[_0x02c8('0x27')][_0x02c8('0x48')]({'where':{'id':_0x3e3d43['params']['id']}})[_0x02c8('0x22')](handleEntityNotFound(_0x4e575b,null))[_0x02c8('0x22')](function(_0x569d31){if(_0x569d31){_0x3a3bd1=_0x569d31;_0x4aaa5a['model']=_['keys'](db[_0x02c8('0x49')][_0x02c8('0x28')]);_0x4aaa5a[_0x02c8('0x2f')]=_[_0x02c8('0x2b')](_0x3e3d43['query']);_0x4aaa5a[_0x02c8('0x2c')]=_[_0x02c8('0x2d')](_0x4aaa5a[_0x02c8('0x2e')],_0x4aaa5a[_0x02c8('0x2f')]);_0x2a5d9a[_0x02c8('0x30')]=_[_0x02c8('0x2d')](_0x4aaa5a[_0x02c8('0x2e')],qs[_0x02c8('0x31')](_0x3e3d43['query'][_0x02c8('0x31')]));_0x2a5d9a['attributes']=_0x2a5d9a['attributes'][_0x02c8('0x32')]?_0x2a5d9a['attributes']:_0x4aaa5a[_0x02c8('0x2e')];_0x2a5d9a[_0x02c8('0x35')]=qs['sort'](_0x3e3d43[_0x02c8('0x2f')]['sort']);_0x2a5d9a[_0x02c8('0x37')]=qs[_0x02c8('0x2c')](_[_0x02c8('0x38')](_0x3e3d43[_0x02c8('0x2f')],_0x4aaa5a[_0x02c8('0x2c')]));if(_0x3e3d43['query'][_0x02c8('0x3b')]){_0x2a5d9a[_0x02c8('0x37')]=_[_0x02c8('0x39')](_0x2a5d9a['where'],{'$or':_[_0x02c8('0x26')](_0x2a5d9a[_0x02c8('0x30')],function(_0x46526d){var _0x20e668={};_0x20e668[_0x46526d]={'$like':'%'+_0x3e3d43[_0x02c8('0x2f')][_0x02c8('0x3b')]+'%'};return _0x20e668;})});}_0x2a5d9a=_[_0x02c8('0x39')]({},_0x2a5d9a,_0x3e3d43[_0x02c8('0x42')]);return _0x3a3bd1['getSubjects'](_0x2a5d9a);}})['then'](function(_0x1b3f62){if(_0x1b3f62){_0x5e85b6=_0x1b3f62[_0x02c8('0x32')];if(!_0x3e3d43['query'][_0x02c8('0x33')](_0x02c8('0x34'))){_0x2a5d9a[_0x02c8('0x1d')]=qs['limit'](_0x3e3d43[_0x02c8('0x2f')][_0x02c8('0x1d')]);_0x2a5d9a[_0x02c8('0x1b')]=qs['offset'](_0x3e3d43['query'][_0x02c8('0x1b')]);}return _0x3a3bd1[_0x02c8('0x4b')](_0x2a5d9a);}})[_0x02c8('0x22')](function(_0x1e94d7){if(_0x1e94d7){return _0x1e94d7?{'count':_0x5e85b6,'rows':_0x1e94d7}:null;}})['then'](respondWithResult(_0x4e575b,null))[_0x02c8('0x40')](handleError(_0x4e575b,null));};exports['getDescriptions']=function(_0x15c6d8,_0x5da69d,_0x42cd1d){var _0x5cebfc={};var _0x27a37a={};var _0x36fa4f;var _0x1f6b47;return db[_0x02c8('0x27')]['findOne']({'where':{'id':_0x15c6d8[_0x02c8('0x47')]['id']}})[_0x02c8('0x22')](handleEntityNotFound(_0x5da69d,null))[_0x02c8('0x22')](function(_0x73f236){if(_0x73f236){_0x36fa4f=_0x73f236;_0x27a37a[_0x02c8('0x2e')]=_['keys'](db[_0x02c8('0x49')][_0x02c8('0x28')]);_0x27a37a[_0x02c8('0x2f')]=_['keys'](_0x15c6d8[_0x02c8('0x2f')]);_0x27a37a[_0x02c8('0x2c')]=_[_0x02c8('0x2d')](_0x27a37a[_0x02c8('0x2e')],_0x27a37a['query']);_0x5cebfc[_0x02c8('0x30')]=_[_0x02c8('0x2d')](_0x27a37a[_0x02c8('0x2e')],qs['fields'](_0x15c6d8[_0x02c8('0x2f')][_0x02c8('0x31')]));_0x5cebfc[_0x02c8('0x30')]=_0x5cebfc['attributes'][_0x02c8('0x32')]?_0x5cebfc['attributes']:_0x27a37a['model'];_0x5cebfc[_0x02c8('0x35')]=qs[_0x02c8('0x36')](_0x15c6d8[_0x02c8('0x2f')][_0x02c8('0x36')]);_0x5cebfc['where']=qs['filters'](_[_0x02c8('0x38')](_0x15c6d8['query'],_0x27a37a[_0x02c8('0x2c')]));if(_0x15c6d8[_0x02c8('0x2f')][_0x02c8('0x3b')]){_0x5cebfc[_0x02c8('0x37')]=_[_0x02c8('0x39')](_0x5cebfc[_0x02c8('0x37')],{'$or':_[_0x02c8('0x26')](_0x5cebfc[_0x02c8('0x30')],function(_0x3598b2){var _0x44374e={};_0x44374e[_0x3598b2]={'$like':'%'+_0x15c6d8[_0x02c8('0x2f')][_0x02c8('0x3b')]+'%'};return _0x44374e;})});}_0x5cebfc=_[_0x02c8('0x39')]({},_0x5cebfc,_0x15c6d8[_0x02c8('0x42')]);return _0x36fa4f[_0x02c8('0x4c')](_0x5cebfc);}})['then'](function(_0x35a3bd){if(_0x35a3bd){_0x1f6b47=_0x35a3bd[_0x02c8('0x32')];if(!_0x15c6d8[_0x02c8('0x2f')]['hasOwnProperty']('nolimit')){_0x5cebfc[_0x02c8('0x1d')]=qs[_0x02c8('0x1d')](_0x15c6d8['query'][_0x02c8('0x1d')]);_0x5cebfc[_0x02c8('0x1b')]=qs[_0x02c8('0x1b')](_0x15c6d8[_0x02c8('0x2f')][_0x02c8('0x1b')]);}return _0x36fa4f[_0x02c8('0x4c')](_0x5cebfc);}})[_0x02c8('0x22')](function(_0x185f27){if(_0x185f27){return _0x185f27?{'count':_0x1f6b47,'rows':_0x185f27}:null;}})[_0x02c8('0x22')](respondWithResult(_0x5da69d,null))[_0x02c8('0x40')](handleError(_0x5da69d,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6dd421c..edd7ce9 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 _0x6cf8=['define','ZohoConfiguration','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x6cf8,0x12b));var _0x86cf=function(_0x5e4cbd,_0x502d42){_0x5e4cbd=_0x5e4cbd-0x0;var _0x4e4874=_0x6cf8[_0x5e4cbd];return _0x4e4874;};'use strict';var _=require(_0x86cf('0x0'));var util=require(_0x86cf('0x1'));var logger=require(_0x86cf('0x2'))('api');var moment=require(_0x86cf('0x3'));var BPromise=require(_0x86cf('0x4'));var rp=require(_0x86cf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86cf('0x6'));var config=require(_0x86cf('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x86cf('0x8')]=function(_0xf05679,_0x430bab){return _0xf05679[_0x86cf('0x9')](_0x86cf('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce46=['api','request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','lodash','util','../../config/logger'];(function(_0x1809e4,_0x298dc1){var _0x1bc63c=function(_0x314359){while(--_0x314359){_0x1809e4['push'](_0x1809e4['shift']());}};_0x1bc63c(++_0x298dc1);}(_0xce46,0x173));var _0x6ce4=function(_0x36dbd0,_0x5ebaa6){_0x36dbd0=_0x36dbd0-0x0;var _0x19398c=_0xce46[_0x36dbd0];return _0x19398c;};'use strict';var _=require(_0x6ce4('0x0'));var util=require(_0x6ce4('0x1'));var logger=require(_0x6ce4('0x2'))(_0x6ce4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ce4('0x4'));var fs=require('fs');var path=require(_0x6ce4('0x5'));var rimraf=require(_0x6ce4('0x6'));var config=require(_0x6ce4('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x6ce4('0x8')]=function(_0x4686ae,_0x2d3248){return _0x4686ae[_0x6ce4('0x9')](_0x6ce4('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index b2a5168..8314ee7 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 _0x66f6=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x46399a,_0x108f44){var _0x3f97ca=function(_0xb8ca74){while(--_0xb8ca74){_0x46399a['push'](_0x46399a['shift']());}};_0x3f97ca(++_0x108f44);}(_0x66f6,0x152));var _0x666f=function(_0x1f8147,_0x4fabf2){_0x1f8147=_0x1f8147-0x0;var _0x53aedf=_0x66f6[_0x1f8147];return _0x53aedf;};'use strict';var _=require(_0x666f('0x0'));var util=require('util');var moment=require(_0x666f('0x1'));var BPromise=require(_0x666f('0x2'));var rs=require(_0x666f('0x3'));var fs=require('fs');var Redis=require(_0x666f('0x4'));var db=require(_0x666f('0x5'))['db'];var utils=require(_0x666f('0x6'));var logger=require(_0x666f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x666f('0x8'));var client=jayson[_0x666f('0x9')][_0x666f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e7121,_0x39917f,_0x1cead7){return new BPromise(function(_0x3e4c62,_0x7afdac){return client[_0x666f('0xb')](_0x3e7121,_0x1cead7)[_0x666f('0xc')](function(_0x1066a7){logger[_0x666f('0xd')](_0x666f('0xe'),_0x39917f,_0x666f('0xf'));logger['debug'](_0x666f('0x10'),_0x39917f,_0x666f('0xf'),JSON[_0x666f('0x11')](_0x1066a7));if(_0x1066a7[_0x666f('0x12')]){if(_0x1066a7[_0x666f('0x12')]['code']===0x1f4){logger[_0x666f('0x12')](_0x666f('0xe'),_0x39917f,_0x1066a7[_0x666f('0x12')]['message']);return _0x7afdac(_0x1066a7['error'][_0x666f('0x13')]);}logger[_0x666f('0x12')](_0x666f('0xe'),_0x39917f,_0x1066a7[_0x666f('0x12')][_0x666f('0x13')]);return _0x3e4c62(_0x1066a7['error'][_0x666f('0x13')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x39917f,_0x666f('0xf'));_0x3e4c62(_0x1066a7[_0x666f('0x14')]['message']);}})[_0x666f('0x15')](function(_0x43b5d2){logger['error'](_0x666f('0xe'),_0x39917f,_0x43b5d2);_0x7afdac(_0x43b5d2);});});} \ No newline at end of file +var _0x0610=['lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5d6b6f,_0x5e8e66){var _0x389548=function(_0x254e7c){while(--_0x254e7c){_0x5d6b6f['push'](_0x5d6b6f['shift']());}};_0x389548(++_0x5e8e66);}(_0x0610,0xc6));var _0x0061=function(_0x1a4541,_0x43a707){_0x1a4541=_0x1a4541-0x0;var _0x2f2dc0=_0x0610[_0x1a4541];return _0x2f2dc0;};'use strict';var _=require(_0x0061('0x0'));var util=require(_0x0061('0x1'));var moment=require(_0x0061('0x2'));var BPromise=require('bluebird');var rs=require(_0x0061('0x3'));var fs=require('fs');var Redis=require(_0x0061('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0061('0x5'))('rpc');var config=require(_0x0061('0x6'));var jayson=require(_0x0061('0x7'));var client=jayson[_0x0061('0x8')][_0x0061('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x155968,_0x11e746,_0x2d5228){return new BPromise(function(_0x4efffc,_0x5728f4){return client[_0x0061('0xa')](_0x155968,_0x2d5228)[_0x0061('0xb')](function(_0x4521ce){logger[_0x0061('0xc')](_0x0061('0xd'),_0x11e746,_0x0061('0xe'));logger[_0x0061('0xf')](_0x0061('0x10'),_0x11e746,_0x0061('0xe'),JSON[_0x0061('0x11')](_0x4521ce));if(_0x4521ce[_0x0061('0x12')]){if(_0x4521ce['error'][_0x0061('0x13')]===0x1f4){logger[_0x0061('0x12')](_0x0061('0xd'),_0x11e746,_0x4521ce['error'][_0x0061('0x14')]);return _0x5728f4(_0x4521ce[_0x0061('0x12')][_0x0061('0x14')]);}logger['error'](_0x0061('0xd'),_0x11e746,_0x4521ce[_0x0061('0x12')][_0x0061('0x14')]);return _0x4efffc(_0x4521ce[_0x0061('0x12')][_0x0061('0x14')]);}else{logger[_0x0061('0xc')](_0x0061('0xd'),_0x11e746,'request\x20sent');_0x4efffc(_0x4521ce['result']['message']);}})[_0x0061('0x15')](function(_0x6f7eff){logger[_0x0061('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x11e746,_0x6f7eff);_0x5728f4(_0x6f7eff);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 7e334a5..1b464bd 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 _0x99f0=['update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x3a3527,_0x55c9d0){var _0x54440a=function(_0x5a47a5){while(--_0x5a47a5){_0x3a3527['push'](_0x3a3527['shift']());}};_0x54440a(++_0x55c9d0);}(_0x99f0,0x174));var _0x099f=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x99f0[_0x5a1a51];return _0x47edd7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x099f('0x0'));var express=require(_0x099f('0x1'));var router=express[_0x099f('0x2')]();var fs_extra=require(_0x099f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x099f('0x4'));var config=require(_0x099f('0x5'));var controller=require('./intZohoField.controller');router[_0x099f('0x6')]('/',auth[_0x099f('0x7')](),controller['index']);router[_0x099f('0x6')](_0x099f('0x8'),auth[_0x099f('0x7')](),controller[_0x099f('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x099f('0xa')]);router[_0x099f('0xb')](_0x099f('0x8'),auth[_0x099f('0x7')](),controller[_0x099f('0xc')]);router[_0x099f('0xd')](_0x099f('0x8'),auth['isAuthenticated'](),controller[_0x099f('0xe')]);module[_0x099f('0xf')]=router; \ No newline at end of file +var _0x2049=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intZohoField.controller','get','isAuthenticated','index','show','post','create'];(function(_0x22f68e,_0xfccd63){var _0x4ce720=function(_0x17dc76){while(--_0x17dc76){_0x22f68e['push'](_0x22f68e['shift']());}};_0x4ce720(++_0xfccd63);}(_0x2049,0x1b5));var _0x9204=function(_0x3c820f,_0x16ce17){_0x3c820f=_0x3c820f-0x0;var _0x1314b=_0x2049[_0x3c820f];return _0x1314b;};'use strict';var multer=require(_0x9204('0x0'));var util=require(_0x9204('0x1'));var path=require('path');var timeout=require(_0x9204('0x2'));var express=require(_0x9204('0x3'));var router=express[_0x9204('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9204('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9204('0x6'));router[_0x9204('0x7')]('/',auth[_0x9204('0x8')](),controller[_0x9204('0x9')]);router[_0x9204('0x7')]('/:id',auth[_0x9204('0x8')](),controller[_0x9204('0xa')]);router[_0x9204('0xb')]('/',auth[_0x9204('0x8')](),controller[_0x9204('0xc')]);router[_0x9204('0xd')](_0x9204('0xe'),auth[_0x9204('0x8')](),controller[_0x9204('0xf')]);router[_0x9204('0x10')](_0x9204('0xe'),auth[_0x9204('0x8')](),controller['destroy']);module[_0x9204('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 03404fa..5882972 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 _0xa9c4=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa9c4,0xf9));var _0x4a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4a9c('0x0'));module[_0x4a9c('0x1')]={'type':{'type':Sequelize[_0x4a9c('0x2')](_0x4a9c('0x3'),_0x4a9c('0x4'),_0x4a9c('0x5'),_0x4a9c('0x6'),_0x4a9c('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4a9c('0x8')]},'keyType':{'type':Sequelize[_0x4a9c('0x2')](_0x4a9c('0x3'),_0x4a9c('0x4'),_0x4a9c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4a9c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4a9c('0x8')]}}; \ No newline at end of file +var _0xe9d3=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','exports'];(function(_0x3a7222,_0x3f3279){var _0x121acb=function(_0xb5bf10){while(--_0xb5bf10){_0x3a7222['push'](_0x3a7222['shift']());}};_0x121acb(++_0x3f3279);}(_0xe9d3,0x1df));var _0x3e9d=function(_0x51e073,_0x45c759){_0x51e073=_0x51e073-0x0;var _0x327ac1=_0xe9d3[_0x51e073];return _0x327ac1;};'use strict';var Sequelize=require('sequelize');module[_0x3e9d('0x0')]={'type':{'type':Sequelize[_0x3e9d('0x1')](_0x3e9d('0x2'),_0x3e9d('0x3'),_0x3e9d('0x4'),_0x3e9d('0x5'),_0x3e9d('0x6')),'defaultValue':_0x3e9d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3e9d('0x1')](_0x3e9d('0x2'),_0x3e9d('0x3'),_0x3e9d('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3e9d('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3e9d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 7c6b05e..b503f8b 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 _0x03cb=['json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x4f17b0,_0x20bd3e){var _0x4073aa=function(_0x54f43d){while(--_0x54f43d){_0x4f17b0['push'](_0x4f17b0['shift']());}};_0x4073aa(++_0x20bd3e);}(_0x03cb,0x1dc));var _0xb03c=function(_0x26c2f7,_0x1eb968){_0x26c2f7=_0x26c2f7-0x0;var _0x354d89=_0x03cb[_0x26c2f7];return _0x354d89;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb03c('0x0'));var rp=require(_0xb03c('0x1'));var moment=require(_0xb03c('0x2'));var BPromise=require(_0xb03c('0x3'));var Mustache=require(_0xb03c('0x4'));var util=require(_0xb03c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb03c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb03c('0x7'));var squel=require(_0xb03c('0x8'));var crypto=require(_0xb03c('0x9'));var jsforce=require(_0xb03c('0xa'));var deskjs=require(_0xb03c('0xb'));var toCsv=require(_0xb03c('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb03c('0xc'));var qs=require(_0xb03c('0xd'));var as=require(_0xb03c('0xe'));var hardwareService=require(_0xb03c('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb03c('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xb03c('0x11'))['db'];function respondWithStatusCode(_0x378fdf,_0x1a6281){_0x1a6281=_0x1a6281||0xcc;return function(_0x55fab3){if(_0x55fab3){return _0x378fdf[_0xb03c('0x12')](_0x1a6281);}return _0x378fdf[_0xb03c('0x13')](_0x1a6281)[_0xb03c('0x14')]();};}function respondWithResult(_0x19d9ee,_0x2fa937){_0x2fa937=_0x2fa937||0xc8;return function(_0x692918){if(_0x692918){return _0x19d9ee[_0xb03c('0x13')](_0x2fa937)[_0xb03c('0x15')](_0x692918);}};}function respondWithFilteredResult(_0x5dd8f7,_0x42adf5){return function(_0x32cdd3){if(_0x32cdd3){var _0x159549=typeof _0x42adf5['offset']===_0xb03c('0x16')&&typeof _0x42adf5[_0xb03c('0x17')]==='undefined';var _0x3219d1=_0x32cdd3['count'];var _0x4f6cf6=_0x159549?0x0:_0x42adf5[_0xb03c('0x18')];var _0x311c21=_0x159549?_0x32cdd3[_0xb03c('0x19')]:_0x42adf5[_0xb03c('0x18')]+_0x42adf5['limit'];var _0x4ceac5;if(_0x311c21>=_0x3219d1){_0x311c21=_0x3219d1;_0x4ceac5=0xc8;}else{_0x4ceac5=0xce;}_0x5dd8f7[_0xb03c('0x13')](_0x4ceac5);return _0x5dd8f7[_0xb03c('0x1a')](_0xb03c('0x1b'),_0x4f6cf6+'-'+_0x311c21+'/'+_0x3219d1)[_0xb03c('0x15')](_0x32cdd3);}return null;};}function patchUpdates(_0x14c5ed){return function(_0x300f67){try{jsonpatch[_0xb03c('0x1c')](_0x300f67,_0x14c5ed,!![]);}catch(_0x5ea19b){return BPromise['reject'](_0x5ea19b);}return _0x300f67[_0xb03c('0x1d')]();};}function saveUpdates(_0x2ca5bf,_0x5bf07f){return function(_0x389ba8){if(_0x389ba8){return _0x389ba8[_0xb03c('0x1e')](_0x2ca5bf)[_0xb03c('0x1f')](function(_0x94da14){return _0x94da14;});}return null;};}function removeEntity(_0x4edea8,_0x1c83fa){return function(_0x3c4f2e){if(_0x3c4f2e){return _0x3c4f2e[_0xb03c('0x20')]()[_0xb03c('0x1f')](function(){_0x4edea8[_0xb03c('0x13')](0xcc)[_0xb03c('0x14')]();});}};}function handleEntityNotFound(_0x1fa851,_0x32b746){return function(_0x37ad6f){if(!_0x37ad6f){_0x1fa851['sendStatus'](0x194);}return _0x37ad6f;};}function handleError(_0x2706ec,_0x6241d0){_0x6241d0=_0x6241d0||0x1f4;return function(_0x32a9a4){logger[_0xb03c('0x21')](_0x32a9a4[_0xb03c('0x22')]);if(_0x32a9a4[_0xb03c('0x23')]){delete _0x32a9a4['name'];}_0x2706ec['status'](_0x6241d0)[_0xb03c('0x24')](_0x32a9a4);};}exports['index']=function(_0x4e758c,_0x4290fe){var _0x410a35={},_0xc89599={},_0x4f206e={'count':0x0,'rows':[]};var _0x253714=_[_0xb03c('0x25')](db['ZohoField'][_0xb03c('0x26')],function(_0x531fa6){return{'name':_0x531fa6[_0xb03c('0x27')],'type':_0x531fa6[_0xb03c('0x28')][_0xb03c('0x29')]};});_0xc89599[_0xb03c('0x2a')]=_['map'](_0x253714,_0xb03c('0x23'));_0xc89599[_0xb03c('0x2b')]=_['keys'](_0x4e758c['query']);_0xc89599['filters']=_[_0xb03c('0x2c')](_0xc89599[_0xb03c('0x2a')],_0xc89599[_0xb03c('0x2b')]);_0x410a35[_0xb03c('0x2d')]=_[_0xb03c('0x2c')](_0xc89599[_0xb03c('0x2a')],qs[_0xb03c('0x2e')](_0x4e758c[_0xb03c('0x2b')][_0xb03c('0x2e')]));_0x410a35[_0xb03c('0x2d')]=_0x410a35[_0xb03c('0x2d')][_0xb03c('0x2f')]?_0x410a35[_0xb03c('0x2d')]:_0xc89599['model'];if(!_0x4e758c['query'][_0xb03c('0x30')](_0xb03c('0x31'))){_0x410a35[_0xb03c('0x17')]=qs[_0xb03c('0x17')](_0x4e758c['query'][_0xb03c('0x17')]);_0x410a35[_0xb03c('0x18')]=qs[_0xb03c('0x18')](_0x4e758c[_0xb03c('0x2b')][_0xb03c('0x18')]);}_0x410a35[_0xb03c('0x32')]=qs[_0xb03c('0x33')](_0x4e758c[_0xb03c('0x2b')][_0xb03c('0x33')]);_0x410a35[_0xb03c('0x34')]=qs['filters'](_[_0xb03c('0x35')](_0x4e758c['query'],_0xc89599[_0xb03c('0x36')]),_0x253714);if(_0x4e758c['query'][_0xb03c('0x37')]){_0x410a35['where']=_['merge'](_0x410a35[_0xb03c('0x34')],{'$or':_[_0xb03c('0x25')](_0x253714,function(_0xfc58cf){if(_0xfc58cf[_0xb03c('0x28')]!==_0xb03c('0x38')){var _0x563250={};_0x563250[_0xfc58cf[_0xb03c('0x23')]]={'$like':'%'+_0x4e758c[_0xb03c('0x2b')][_0xb03c('0x37')]+'%'};return _0x563250;}})});}_0x410a35=_[_0xb03c('0x39')]({},_0x410a35,_0x4e758c[_0xb03c('0x3a')]);var _0x4a1577={'where':_0x410a35[_0xb03c('0x34')]};return db[_0xb03c('0x3b')][_0xb03c('0x19')](_0x4a1577)[_0xb03c('0x1f')](function(_0x3831e3){_0x4f206e[_0xb03c('0x19')]=_0x3831e3;if(_0x4e758c[_0xb03c('0x2b')][_0xb03c('0x3c')]){_0x410a35[_0xb03c('0x3d')]=[{'all':!![]}];}return db[_0xb03c('0x3b')][_0xb03c('0x3e')](_0x410a35);})[_0xb03c('0x1f')](function(_0x38bd87){_0x4f206e[_0xb03c('0x3f')]=_0x38bd87;return _0x4f206e;})[_0xb03c('0x1f')](respondWithFilteredResult(_0x4290fe,_0x410a35))[_0xb03c('0x40')](handleError(_0x4290fe,null));};exports[_0xb03c('0x41')]=function(_0x26fef4,_0x45f382){var _0x4c3b1f={'raw':!![],'where':{'id':_0x26fef4[_0xb03c('0x42')]['id']}},_0x69a0d1={};_0x69a0d1[_0xb03c('0x2a')]=_[_0xb03c('0x43')](db['ZohoField']['rawAttributes']);_0x69a0d1[_0xb03c('0x2b')]=_['keys'](_0x26fef4['query']);_0x69a0d1[_0xb03c('0x36')]=_[_0xb03c('0x2c')](_0x69a0d1[_0xb03c('0x2a')],_0x69a0d1[_0xb03c('0x2b')]);_0x4c3b1f['attributes']=_[_0xb03c('0x2c')](_0x69a0d1[_0xb03c('0x2a')],qs['fields'](_0x26fef4[_0xb03c('0x2b')][_0xb03c('0x2e')]));_0x4c3b1f['attributes']=_0x4c3b1f[_0xb03c('0x2d')][_0xb03c('0x2f')]?_0x4c3b1f['attributes']:_0x69a0d1['model'];if(_0x26fef4[_0xb03c('0x2b')]['includeAll']){_0x4c3b1f[_0xb03c('0x3d')]=[{'all':!![]}];}_0x4c3b1f=_[_0xb03c('0x39')]({},_0x4c3b1f,_0x26fef4[_0xb03c('0x3a')]);return db[_0xb03c('0x3b')][_0xb03c('0x44')](_0x4c3b1f)[_0xb03c('0x1f')](handleEntityNotFound(_0x45f382,null))[_0xb03c('0x1f')](respondWithResult(_0x45f382,null))[_0xb03c('0x40')](handleError(_0x45f382,null));};exports[_0xb03c('0x45')]=function(_0x42c49a,_0x5703ea){return db[_0xb03c('0x3b')][_0xb03c('0x45')](_0x42c49a[_0xb03c('0x46')],{})[_0xb03c('0x1f')](respondWithResult(_0x5703ea,0xc9))[_0xb03c('0x40')](handleError(_0x5703ea,null));};exports[_0xb03c('0x1e')]=function(_0x447e78,_0x1d1c1d){if(_0x447e78[_0xb03c('0x46')]['id']){delete _0x447e78[_0xb03c('0x46')]['id'];}return db[_0xb03c('0x3b')][_0xb03c('0x44')]({'where':{'id':_0x447e78[_0xb03c('0x42')]['id']}})[_0xb03c('0x1f')](handleEntityNotFound(_0x1d1c1d,null))[_0xb03c('0x1f')](saveUpdates(_0x447e78[_0xb03c('0x46')],null))[_0xb03c('0x1f')](respondWithResult(_0x1d1c1d,null))[_0xb03c('0x40')](handleError(_0x1d1c1d,null));};exports[_0xb03c('0x20')]=function(_0x5ee226,_0x488d85){return db[_0xb03c('0x3b')][_0xb03c('0x44')]({'where':{'id':_0x5ee226[_0xb03c('0x42')]['id']}})['then'](handleEntityNotFound(_0x488d85,null))['then'](removeEntity(_0x488d85,null))['catch'](handleError(_0x488d85,null));}; \ No newline at end of file +var _0x0feb=['then','error','stack','name','send','index','ZohoField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x0feb,0x6c));var _0xb0fe=function(_0x14e8b7,_0x2628d0){_0x14e8b7=_0x14e8b7-0x0;var _0x2610d6=_0x0feb[_0x14e8b7];return _0x2610d6;};'use strict';var emlformat=require(_0xb0fe('0x0'));var rimraf=require(_0xb0fe('0x1'));var zipdir=require(_0xb0fe('0x2'));var jsonpatch=require(_0xb0fe('0x3'));var rp=require(_0xb0fe('0x4'));var moment=require(_0xb0fe('0x5'));var BPromise=require(_0xb0fe('0x6'));var Mustache=require(_0xb0fe('0x7'));var util=require('util');var path=require(_0xb0fe('0x8'));var sox=require(_0xb0fe('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb0fe('0xa'));var _=require('lodash');var squel=require(_0xb0fe('0xb'));var crypto=require('crypto');var jsforce=require(_0xb0fe('0xc'));var deskjs=require(_0xb0fe('0xd'));var toCsv=require(_0xb0fe('0xe'));var querystring=require('querystring');var Papa=require(_0xb0fe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0fe('0x10'));var logger=require(_0xb0fe('0x11'))('api');var utils=require(_0xb0fe('0x12'));var config=require(_0xb0fe('0x13'));var licenseUtil=require(_0xb0fe('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42c09f,_0xec8329){_0xec8329=_0xec8329||0xcc;return function(_0x10ed65){if(_0x10ed65){return _0x42c09f[_0xb0fe('0x15')](_0xec8329);}return _0x42c09f[_0xb0fe('0x16')](_0xec8329)[_0xb0fe('0x17')]();};}function respondWithResult(_0xdd3eb9,_0x28f297){_0x28f297=_0x28f297||0xc8;return function(_0x1fc0f5){if(_0x1fc0f5){return _0xdd3eb9[_0xb0fe('0x16')](_0x28f297)['json'](_0x1fc0f5);}};}function respondWithFilteredResult(_0x33e6b8,_0x1546a7){return function(_0x5b6c1f){if(_0x5b6c1f){var _0x42b0be=typeof _0x1546a7[_0xb0fe('0x18')]===_0xb0fe('0x19')&&typeof _0x1546a7[_0xb0fe('0x1a')]===_0xb0fe('0x19');var _0x235bd1=_0x5b6c1f[_0xb0fe('0x1b')];var _0x28741d=_0x42b0be?0x0:_0x1546a7[_0xb0fe('0x18')];var _0x2e5cd3=_0x42b0be?_0x5b6c1f[_0xb0fe('0x1b')]:_0x1546a7[_0xb0fe('0x18')]+_0x1546a7[_0xb0fe('0x1a')];var _0x31c533;if(_0x2e5cd3>=_0x235bd1){_0x2e5cd3=_0x235bd1;_0x31c533=0xc8;}else{_0x31c533=0xce;}_0x33e6b8[_0xb0fe('0x16')](_0x31c533);return _0x33e6b8[_0xb0fe('0x1c')](_0xb0fe('0x1d'),_0x28741d+'-'+_0x2e5cd3+'/'+_0x235bd1)[_0xb0fe('0x1e')](_0x5b6c1f);}return null;};}function patchUpdates(_0x4b1c31){return function(_0x48d320){try{jsonpatch['apply'](_0x48d320,_0x4b1c31,!![]);}catch(_0xe7efed){return BPromise[_0xb0fe('0x1f')](_0xe7efed);}return _0x48d320[_0xb0fe('0x20')]();};}function saveUpdates(_0x3e2dbc,_0x5ee4a5){return function(_0x1076c2){if(_0x1076c2){return _0x1076c2[_0xb0fe('0x21')](_0x3e2dbc)[_0xb0fe('0x22')](function(_0x5479f6){return _0x5479f6;});}return null;};}function removeEntity(_0x4cb1c4,_0x54b7a6){return function(_0x50a413){if(_0x50a413){return _0x50a413['destroy']()[_0xb0fe('0x22')](function(){_0x4cb1c4[_0xb0fe('0x16')](0xcc)[_0xb0fe('0x17')]();});}};}function handleEntityNotFound(_0x1d7db4,_0x51ffd5){return function(_0x1b655e){if(!_0x1b655e){_0x1d7db4[_0xb0fe('0x15')](0x194);}return _0x1b655e;};}function handleError(_0x43cc62,_0x5443ee){_0x5443ee=_0x5443ee||0x1f4;return function(_0xb7045f){logger[_0xb0fe('0x23')](_0xb7045f[_0xb0fe('0x24')]);if(_0xb7045f[_0xb0fe('0x25')]){delete _0xb7045f['name'];}_0x43cc62[_0xb0fe('0x16')](_0x5443ee)[_0xb0fe('0x26')](_0xb7045f);};}exports[_0xb0fe('0x27')]=function(_0x5f5b97,_0x251e5c){var _0x2f46ee={},_0x168545={},_0x36c19a={'count':0x0,'rows':[]};var _0x3b8a3c=_['map'](db[_0xb0fe('0x28')][_0xb0fe('0x29')],function(_0x97183c){return{'name':_0x97183c[_0xb0fe('0x2a')],'type':_0x97183c[_0xb0fe('0x2b')][_0xb0fe('0x2c')]};});_0x168545[_0xb0fe('0x2d')]=_[_0xb0fe('0x2e')](_0x3b8a3c,_0xb0fe('0x25'));_0x168545['query']=_[_0xb0fe('0x2f')](_0x5f5b97[_0xb0fe('0x30')]);_0x168545[_0xb0fe('0x31')]=_[_0xb0fe('0x32')](_0x168545[_0xb0fe('0x2d')],_0x168545[_0xb0fe('0x30')]);_0x2f46ee['attributes']=_['intersection'](_0x168545[_0xb0fe('0x2d')],qs[_0xb0fe('0x33')](_0x5f5b97[_0xb0fe('0x30')][_0xb0fe('0x33')]));_0x2f46ee[_0xb0fe('0x34')]=_0x2f46ee['attributes'][_0xb0fe('0x35')]?_0x2f46ee[_0xb0fe('0x34')]:_0x168545[_0xb0fe('0x2d')];if(!_0x5f5b97['query'][_0xb0fe('0x36')](_0xb0fe('0x37'))){_0x2f46ee[_0xb0fe('0x1a')]=qs[_0xb0fe('0x1a')](_0x5f5b97['query']['limit']);_0x2f46ee['offset']=qs[_0xb0fe('0x18')](_0x5f5b97[_0xb0fe('0x30')][_0xb0fe('0x18')]);}_0x2f46ee['order']=qs[_0xb0fe('0x38')](_0x5f5b97[_0xb0fe('0x30')][_0xb0fe('0x38')]);_0x2f46ee[_0xb0fe('0x39')]=qs[_0xb0fe('0x31')](_[_0xb0fe('0x3a')](_0x5f5b97[_0xb0fe('0x30')],_0x168545[_0xb0fe('0x31')]),_0x3b8a3c);if(_0x5f5b97['query']['filter']){_0x2f46ee[_0xb0fe('0x39')]=_['merge'](_0x2f46ee[_0xb0fe('0x39')],{'$or':_['map'](_0x3b8a3c,function(_0x380e18){if(_0x380e18[_0xb0fe('0x2b')]!==_0xb0fe('0x3b')){var _0x1e6513={};_0x1e6513[_0x380e18[_0xb0fe('0x25')]]={'$like':'%'+_0x5f5b97['query']['filter']+'%'};return _0x1e6513;}})});}_0x2f46ee=_[_0xb0fe('0x3c')]({},_0x2f46ee,_0x5f5b97[_0xb0fe('0x3d')]);var _0x11db1d={'where':_0x2f46ee['where']};return db['ZohoField'][_0xb0fe('0x1b')](_0x11db1d)[_0xb0fe('0x22')](function(_0x4856b2){_0x36c19a[_0xb0fe('0x1b')]=_0x4856b2;if(_0x5f5b97[_0xb0fe('0x30')][_0xb0fe('0x3e')]){_0x2f46ee['include']=[{'all':!![]}];}return db[_0xb0fe('0x28')]['findAll'](_0x2f46ee);})[_0xb0fe('0x22')](function(_0x528eb9){_0x36c19a[_0xb0fe('0x3f')]=_0x528eb9;return _0x36c19a;})[_0xb0fe('0x22')](respondWithFilteredResult(_0x251e5c,_0x2f46ee))[_0xb0fe('0x40')](handleError(_0x251e5c,null));};exports[_0xb0fe('0x41')]=function(_0xb110b,_0x215c9a){var _0x4cf080={'raw':!![],'where':{'id':_0xb110b[_0xb0fe('0x42')]['id']}},_0x28fc8a={};_0x28fc8a['model']=_[_0xb0fe('0x2f')](db[_0xb0fe('0x28')][_0xb0fe('0x29')]);_0x28fc8a[_0xb0fe('0x30')]=_[_0xb0fe('0x2f')](_0xb110b[_0xb0fe('0x30')]);_0x28fc8a[_0xb0fe('0x31')]=_['intersection'](_0x28fc8a[_0xb0fe('0x2d')],_0x28fc8a['query']);_0x4cf080['attributes']=_[_0xb0fe('0x32')](_0x28fc8a[_0xb0fe('0x2d')],qs[_0xb0fe('0x33')](_0xb110b['query'][_0xb0fe('0x33')]));_0x4cf080['attributes']=_0x4cf080[_0xb0fe('0x34')]['length']?_0x4cf080['attributes']:_0x28fc8a[_0xb0fe('0x2d')];if(_0xb110b['query'][_0xb0fe('0x3e')]){_0x4cf080[_0xb0fe('0x43')]=[{'all':!![]}];}_0x4cf080=_['merge']({},_0x4cf080,_0xb110b[_0xb0fe('0x3d')]);return db['ZohoField'][_0xb0fe('0x44')](_0x4cf080)['then'](handleEntityNotFound(_0x215c9a,null))[_0xb0fe('0x22')](respondWithResult(_0x215c9a,null))[_0xb0fe('0x40')](handleError(_0x215c9a,null));};exports[_0xb0fe('0x45')]=function(_0x208994,_0x528774){return db[_0xb0fe('0x28')][_0xb0fe('0x45')](_0x208994[_0xb0fe('0x46')],{})[_0xb0fe('0x22')](respondWithResult(_0x528774,0xc9))[_0xb0fe('0x40')](handleError(_0x528774,null));};exports[_0xb0fe('0x21')]=function(_0x302fca,_0x5ae391){if(_0x302fca['body']['id']){delete _0x302fca[_0xb0fe('0x46')]['id'];}return db[_0xb0fe('0x28')]['find']({'where':{'id':_0x302fca[_0xb0fe('0x42')]['id']}})[_0xb0fe('0x22')](handleEntityNotFound(_0x5ae391,null))[_0xb0fe('0x22')](saveUpdates(_0x302fca[_0xb0fe('0x46')],null))[_0xb0fe('0x22')](respondWithResult(_0x5ae391,null))['catch'](handleError(_0x5ae391,null));};exports['destroy']=function(_0x51c8c4,_0x20614b){return db[_0xb0fe('0x28')]['find']({'where':{'id':_0x51c8c4[_0xb0fe('0x42')]['id']}})[_0xb0fe('0x22')](handleEntityNotFound(_0x20614b,null))['then'](removeEntity(_0x20614b,null))[_0xb0fe('0x40')](handleError(_0x20614b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 2ef1d8c..19ae2de 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 _0x47c5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZohoField.attributes','exports','define'];(function(_0x44da57,_0x497d81){var _0x5c699e=function(_0x2b96e1){while(--_0x2b96e1){_0x44da57['push'](_0x44da57['shift']());}};_0x5c699e(++_0x497d81);}(_0x47c5,0x165));var _0x547c=function(_0x3da647,_0xa1a501){_0x3da647=_0x3da647-0x0;var _0x2e91a2=_0x47c5[_0x3da647];return _0x2e91a2;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));module[_0x547c('0x9')]=function(_0x51ab7f,_0x2e5b57){return _0x51ab7f[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('0xc'),'paranoid':![],'indexes':[{'name':_0x547c('0xd'),'fields':[_0x547c('0xe'),_0x547c('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5204=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x167b19,_0x56081a){var _0x1fcca2=function(_0x544ca4){while(--_0x544ca4){_0x167b19['push'](_0x167b19['shift']());}};_0x1fcca2(++_0x56081a);}(_0x5204,0xdf));var _0x4520=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x5204[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./intZohoField.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'paranoid':![],'indexes':[{'name':_0x4520('0xc'),'fields':['idField',_0x4520('0xd')],'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 adf9ad2..9174504 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 _0x0074=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ZohoField,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0074,0xe9));var _0x4007=function(_0x3ad4bc,_0x3673ef){_0x3ad4bc=_0x3ad4bc-0x0;var _0x22045d=_0x0074[_0x3ad4bc];return _0x22045d;};'use strict';var _=require(_0x4007('0x0'));var util=require('util');var moment=require(_0x4007('0x1'));var BPromise=require(_0x4007('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4007('0x3'));var db=require(_0x4007('0x4'))['db'];var utils=require(_0x4007('0x5'));var logger=require(_0x4007('0x6'))(_0x4007('0x7'));var config=require(_0x4007('0x8'));var jayson=require(_0x4007('0x9'));var client=jayson[_0x4007('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfa8c72,_0x421c6f,_0x1c4738){return new BPromise(function(_0x2f4862,_0x2c1f9e){return client[_0x4007('0xb')](_0xfa8c72,_0x1c4738)['then'](function(_0xc25648){logger[_0x4007('0xc')](_0x4007('0xd'),_0x421c6f,'request\x20sent');logger[_0x4007('0xe')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x421c6f,_0x4007('0xf'),JSON['stringify'](_0xc25648));if(_0xc25648[_0x4007('0x10')]){if(_0xc25648[_0x4007('0x10')][_0x4007('0x11')]===0x1f4){logger[_0x4007('0x10')](_0x4007('0xd'),_0x421c6f,_0xc25648[_0x4007('0x10')][_0x4007('0x12')]);return _0x2c1f9e(_0xc25648[_0x4007('0x10')][_0x4007('0x12')]);}logger[_0x4007('0x10')](_0x4007('0xd'),_0x421c6f,_0xc25648[_0x4007('0x10')]['message']);return _0x2f4862(_0xc25648[_0x4007('0x10')][_0x4007('0x12')]);}else{logger[_0x4007('0xc')](_0x4007('0xd'),_0x421c6f,'request\x20sent');_0x2f4862(_0xc25648[_0x4007('0x13')][_0x4007('0x12')]);}})[_0x4007('0x14')](function(_0x6b22e4){logger[_0x4007('0x10')](_0x4007('0xd'),_0x421c6f,_0x6b22e4);_0x2c1f9e(_0x6b22e4);});});} \ No newline at end of file +var _0xc362=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc362,0x13b));var _0x2c36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc362[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2c36('0x0'));var util=require('util');var moment=require(_0x2c36('0x1'));var BPromise=require(_0x2c36('0x2'));var rs=require(_0x2c36('0x3'));var fs=require('fs');var Redis=require(_0x2c36('0x4'));var db=require(_0x2c36('0x5'))['db'];var utils=require(_0x2c36('0x6'));var logger=require('../../config/logger')(_0x2c36('0x7'));var config=require(_0x2c36('0x8'));var jayson=require(_0x2c36('0x9'));var client=jayson[_0x2c36('0xa')][_0x2c36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8dc22d,_0x3ec392,_0x419cf6){return new BPromise(function(_0x24705a,_0x574fab){return client[_0x2c36('0xc')](_0x8dc22d,_0x419cf6)[_0x2c36('0xd')](function(_0x229f75){logger[_0x2c36('0xe')](_0x2c36('0xf'),_0x3ec392,'request\x20sent');logger['debug'](_0x2c36('0x10'),_0x3ec392,'request\x20sent',JSON[_0x2c36('0x11')](_0x229f75));if(_0x229f75[_0x2c36('0x12')]){if(_0x229f75['error'][_0x2c36('0x13')]===0x1f4){logger[_0x2c36('0x12')](_0x2c36('0xf'),_0x3ec392,_0x229f75[_0x2c36('0x12')][_0x2c36('0x14')]);return _0x574fab(_0x229f75[_0x2c36('0x12')][_0x2c36('0x14')]);}logger[_0x2c36('0x12')](_0x2c36('0xf'),_0x3ec392,_0x229f75[_0x2c36('0x12')][_0x2c36('0x14')]);return _0x24705a(_0x229f75[_0x2c36('0x12')][_0x2c36('0x14')]);}else{logger[_0x2c36('0xe')](_0x2c36('0xf'),_0x3ec392,_0x2c36('0x15'));_0x24705a(_0x229f75['result'][_0x2c36('0x14')]);}})[_0x2c36('0x16')](function(_0x2f87a1){logger['error']('ZohoField,\x20%s,\x20%s',_0x3ec392,_0x2f87a1);_0x574fab(_0x2f87a1);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7fc8535..07a9261 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x10d4ef,_0x21cbd3){var _0x17b232=function(_0x3eb7cb){while(--_0x3eb7cb){_0x10d4ef['push'](_0x10d4ef['shift']());}};_0x17b232(++_0x21cbd3);}(_0xedd9,0xfc));var _0x9edd=function(_0xcb06d5,_0x206c99){_0xcb06d5=_0xcb06d5-0x0;var _0x4cf088=_0xedd9[_0xcb06d5];return _0x4cf088;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x32ee50,_0x564493){var _0x12a1b3=function(_0x3d6bc8){while(--_0x3d6bc8){_0x32ee50['push'](_0x32ee50['shift']());}};_0x12a1b3(++_0x564493);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'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 f3e2c6f..b7d356b 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 _0x2c8d=['BOOLEAN','state','exports','STRING','unique_name_and_version','app.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c8d,0x1a6));var _0xd2c8=function(_0x48759a,_0x4155a1){_0x48759a=_0x48759a-0x0;var _0x640699=_0x2c8d[_0x48759a];return _0x640699;};'use strict';var Sequelize=require('sequelize');module[_0xd2c8('0x0')]={'name':{'type':Sequelize[_0xd2c8('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xd2c8('0x1')],'allowNull':![],'unique':_0xd2c8('0x2')},'main':{'type':Sequelize[_0xd2c8('0x1')],'defaultValue':_0xd2c8('0x3')},'filename':{'type':Sequelize[_0xd2c8('0x1')]},'path':{'type':Sequelize[_0xd2c8('0x1')]},'type':{'type':Sequelize[_0xd2c8('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xd2c8('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xd2c8('0x1')]},'logo':{'type':Sequelize[_0xd2c8('0x1')]},'state':{'type':Sequelize[_0xd2c8('0x1')],'unique':_0xd2c8('0x5')},'description':{'type':Sequelize[_0xd2c8('0x1')]},'title':{'type':Sequelize[_0xd2c8('0x1')]},'remoteUri':{'type':Sequelize[_0xd2c8('0x1')]},'link':{'type':Sequelize[_0xd2c8('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0fd9=['state','sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN'];(function(_0x21006f,_0x5299dd){var _0x36d8a7=function(_0x4ab01e){while(--_0x4ab01e){_0x21006f['push'](_0x21006f['shift']());}};_0x36d8a7(++_0x5299dd);}(_0x0fd9,0x1dd));var _0x90fd=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0x0fd9[_0x3db122];return _0x325b67;};'use strict';var Sequelize=require(_0x90fd('0x0'));module[_0x90fd('0x1')]={'name':{'type':Sequelize[_0x90fd('0x2')],'allowNull':![],'unique':_0x90fd('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x90fd('0x3')},'main':{'type':Sequelize[_0x90fd('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x90fd('0x2')]},'type':{'type':Sequelize[_0x90fd('0x2')]},'size':{'type':Sequelize[_0x90fd('0x4')]},'active':{'type':Sequelize[_0x90fd('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x90fd('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x90fd('0x2')],'unique':_0x90fd('0x6')},'description':{'type':Sequelize[_0x90fd('0x2')]},'title':{'type':Sequelize[_0x90fd('0x2')]},'remoteUri':{'type':Sequelize[_0x90fd('0x2')]},'link':{'type':Sequelize[_0x90fd('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 a0631c4..ca8081b 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 _0x1a85=['includeAll','find','create','body','params','destroy','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields'];(function(_0x408cf3,_0x134e6e){var _0x126ba4=function(_0x49809f){while(--_0x49809f){_0x408cf3['push'](_0x408cf3['shift']());}};_0x126ba4(++_0x134e6e);}(_0x1a85,0x178));var _0x51a8=function(_0x58c608,_0x16f6df){_0x58c608=_0x58c608-0x0;var _0x4fb8aa=_0x1a85[_0x58c608];return _0x4fb8aa;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['Integration'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));}; \ No newline at end of file +var _0x1a85=['includeAll','find','create','body','params','destroy','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields'];(function(_0xfce2db,_0x242b53){var _0x3e534d=function(_0x262862){while(--_0x262862){_0xfce2db['push'](_0xfce2db['shift']());}};_0x3e534d(++_0x242b53);}(_0x1a85,0x178));var _0x51a8=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0x1a85[_0x35c97a];return _0x388917;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['Integration'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index ce5b040..14588eb 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 _0x7250=['util','api','request-promise','path','../../config/environment','define','Integration','lodash'];(function(_0x2f35c5,_0x3268a6){var _0x2676d1=function(_0xd6c36e){while(--_0xd6c36e){_0x2f35c5['push'](_0x2f35c5['shift']());}};_0x2676d1(++_0x3268a6);}(_0x7250,0x7f));var _0x0725=function(_0x4d794d,_0x382bd5){_0x4d794d=_0x4d794d-0x0;var _0x106eee=_0x7250[_0x4d794d];return _0x106eee;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var logger=require('../../config/logger')(_0x0725('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0725('0x3'));var fs=require('fs');var path=require(_0x0725('0x4'));var rimraf=require('rimraf');var config=require(_0x0725('0x5'));var attributes=require('./integration.attributes');module['exports']=function(_0x297657,_0x1591d4){return _0x297657[_0x0725('0x6')](_0x0725('0x7'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x605e=['util','api','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','define','Integration','lodash'];(function(_0x57ae8c,_0x4fb0c2){var _0x5cac62=function(_0x46822a){while(--_0x46822a){_0x57ae8c['push'](_0x57ae8c['shift']());}};_0x5cac62(++_0x4fb0c2);}(_0x605e,0xe5));var _0xe605=function(_0x4d19e7,_0x5cfa7f){_0x4d19e7=_0x4d19e7-0x0;var _0x41f29a=_0x605e[_0x4d19e7];return _0x41f29a;};'use strict';var _=require(_0xe605('0x0'));var util=require(_0xe605('0x1'));var logger=require('../../config/logger')(_0xe605('0x2'));var moment=require('moment');var BPromise=require(_0xe605('0x3'));var rp=require(_0xe605('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe605('0x5'));var config=require(_0xe605('0x6'));var attributes=require(_0xe605('0x7'));module['exports']=function(_0x1a7f77,_0x3d9797){return _0x1a7f77[_0xe605('0x8')](_0xe605('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index d593191..377ca22 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0xc4b332,_0x29bda0){var _0x30cc64=function(_0x39e92f){while(--_0x39e92f){_0xc4b332['push'](_0xc4b332['shift']());}};_0x30cc64(++_0x29bda0);}(_0x9f0e,0x116));var _0xe9f0=function(_0x115bdb,_0x3294f1){_0x115bdb=_0x115bdb-0x0;var _0xbab9f=_0x9f0e[_0x115bdb];return _0xbab9f;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file +var _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x3502ff,_0x31fb50){var _0x26e746=function(_0x326a86){while(--_0x326a86){_0x3502ff['push'](_0x3502ff['shift']());}};_0x26e746(++_0x31fb50);}(_0x9f0e,0x116));var _0xe9f0=function(_0xf99d43,_0x50f5f4){_0xf99d43=_0xf99d43-0x0;var _0x1ef979=_0x9f0e[_0xf99d43];return _0x1ef979;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('Integration,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8d4bbe5..6f568d1 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'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 _0xc6ac=['./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28b522,_0x13f610){var _0x52786b=function(_0x1d7c16){while(--_0x1d7c16){_0x28b522['push'](_0x28b522['shift']());}};_0x52786b(++_0x13f610);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2a7731,_0x1f90e8){_0x2a7731=_0x2a7731-0x0;var _0x53da9f=_0xc6ac[_0x2a7731];return _0x53da9f;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0x12')]('/',auth[_0xcc6a('0xc')](),controller['create']);router[_0xcc6a('0x13')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['update']);router[_0xcc6a('0x14')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 631da25..cf8eb4c 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 _0x8de2=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize','exports'];(function(_0x52cc7e,_0x10d54e){var _0x3c46d2=function(_0x2d27db){while(--_0x2d27db){_0x52cc7e['push'](_0x52cc7e['shift']());}};_0x3c46d2(++_0x10d54e);}(_0x8de2,0x184));var _0x28de=function(_0x10ff18,_0x11a300){_0x10ff18=_0x10ff18-0x0;var _0x76d79c=_0x8de2[_0x10ff18];return _0x76d79c;};'use strict';var Sequelize=require(_0x28de('0x0'));module[_0x28de('0x1')]={'integration':{'type':Sequelize[_0x28de('0x2')]},'eventChannel':{'type':Sequelize[_0x28de('0x2')]},'exitStatus':{'type':Sequelize[_0x28de('0x2')]},'ticketId':{'type':Sequelize[_0x28de('0x2')]},'integrationId':{'type':Sequelize[_0x28de('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x28de('0x2')]},'calleridnum':{'type':Sequelize[_0x28de('0x2')]},'calleridname':{'type':Sequelize[_0x28de('0x2')]},'queue':{'type':Sequelize[_0x28de('0x2')]},'interface':{'type':Sequelize[_0x28de('0x2')]},'membername':{'type':Sequelize[_0x28de('0x2')]},'agentcalledAt':{'type':Sequelize[_0x28de('0x4')]},'agentconnectAt':{'type':Sequelize[_0x28de('0x4')]},'holdtime':{'type':Sequelize[_0x28de('0x3')]},'agentcomplete':{'type':Sequelize[_0x28de('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x28de('0x4')]},'talktime':{'type':Sequelize[_0x28de('0x3')]},'agentacw':{'type':Sequelize[_0x28de('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x28de('0x3')]},'reason':{'type':Sequelize[_0x28de('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x28de('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x28de('0x4')]},'agentdump':{'type':Sequelize[_0x28de('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x28de('0x2')]},'channel':{'type':Sequelize[_0x28de('0x2')]},'channelstate':{'type':Sequelize[_0x28de('0x3')]},'channelstatedesc':{'type':Sequelize[_0x28de('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x28de('0x2')]},'language':{'type':Sequelize[_0x28de('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x28de('0x2')]},'exten':{'type':Sequelize[_0x28de('0x2')]},'priority':{'type':Sequelize[_0x28de('0x2')]},'destchannel':{'type':Sequelize[_0x28de('0x2')]},'destchannelstate':{'type':Sequelize[_0x28de('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x28de('0x2')]},'destcalleridnum':{'type':Sequelize[_0x28de('0x2')]},'destcalleridname':{'type':Sequelize[_0x28de('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x28de('0x2')]},'destlanguage':{'type':Sequelize[_0x28de('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x28de('0x2')]},'destexten':{'type':Sequelize[_0x28de('0x2')]},'destpriority':{'type':Sequelize[_0x28de('0x2')]},'destuniqueid':{'type':Sequelize[_0x28de('0x2')]},'messageId':{'type':Sequelize[_0x28de('0x2')]},'inReplyTo':{'type':Sequelize[_0x28de('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x28de('0x2')]},'to':{'type':Sequelize[_0x28de('0x2')]},'cc':{'type':Sequelize[_0x28de('0x2')]},'attachment':{'type':Sequelize[_0x28de('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x28de('0x6')]},'status':{'type':Sequelize[_0x28de('0x7')]('SENT',_0x28de('0x8'),_0x28de('0x9'),'FAILED')},'url':{'type':Sequelize[_0x28de('0x2')]},'app':{'type':Sequelize[_0x28de('0x2')]},'appdata':{'type':Sequelize[_0x28de('0x2')]},'projectId':{'type':Sequelize[_0x28de('0x3')]}}; \ No newline at end of file +var _0xe490=['BOOLEAN','TEXT','SENT','SENDING','FAILED','sequelize','STRING','INTEGER','DATE'];(function(_0x30340d,_0x4ca178){var _0x1d56a7=function(_0x5ee85f){while(--_0x5ee85f){_0x30340d['push'](_0x30340d['shift']());}};_0x1d56a7(++_0x4ca178);}(_0xe490,0x140));var _0x0e49=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe490[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0x0e49('0x0'));module['exports']={'integration':{'type':Sequelize[_0x0e49('0x1')]},'eventChannel':{'type':Sequelize[_0x0e49('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x0e49('0x2')]},'contacts':{'type':Sequelize[_0x0e49('0x1')]},'uniqueid':{'type':Sequelize[_0x0e49('0x1')]},'calleridnum':{'type':Sequelize[_0x0e49('0x1')]},'calleridname':{'type':Sequelize[_0x0e49('0x1')]},'queue':{'type':Sequelize[_0x0e49('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0e49('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x0e49('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x0e49('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x0e49('0x2')]},'agentacw':{'type':Sequelize[_0x0e49('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0e49('0x2')]},'reason':{'type':Sequelize[_0x0e49('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x0e49('0x3')]},'agentdump':{'type':Sequelize[_0x0e49('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x0e49('0x1')]},'channel':{'type':Sequelize[_0x0e49('0x1')]},'channelstate':{'type':Sequelize[_0x0e49('0x2')]},'channelstatedesc':{'type':Sequelize[_0x0e49('0x1')]},'connectedlinenum':{'type':Sequelize[_0x0e49('0x1')]},'connectedlinename':{'type':Sequelize[_0x0e49('0x1')]},'language':{'type':Sequelize[_0x0e49('0x1')]},'accountcode':{'type':Sequelize[_0x0e49('0x1')]},'context':{'type':Sequelize[_0x0e49('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0e49('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x0e49('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x0e49('0x1')]},'destcalleridnum':{'type':Sequelize[_0x0e49('0x1')]},'destcalleridname':{'type':Sequelize[_0x0e49('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x0e49('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x0e49('0x1')]},'destexten':{'type':Sequelize[_0x0e49('0x1')]},'destpriority':{'type':Sequelize[_0x0e49('0x1')]},'destuniqueid':{'type':Sequelize[_0x0e49('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x0e49('0x1')]},'subject':{'type':Sequelize[_0x0e49('0x1')]},'from':{'type':Sequelize[_0x0e49('0x1')]},'to':{'type':Sequelize[_0x0e49('0x1')]},'cc':{'type':Sequelize[_0x0e49('0x1')]},'attachment':{'type':Sequelize[_0x0e49('0x5')]},'html':{'type':Sequelize[_0x0e49('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0x0e49('0x6'),_0x0e49('0x7'),'RECEIVED',_0x0e49('0x8'))},'url':{'type':Sequelize[_0x0e49('0x1')]},'app':{'type':Sequelize[_0x0e49('0x1')]},'appdata':{'type':Sequelize[_0x0e49('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index bd99b79..cae7624 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 _0x6b48=['params','keys','length','merge','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','show'];(function(_0x2ae582,_0x58621c){var _0x4d28b0=function(_0x20bb8c){while(--_0x20bb8c){_0x2ae582['push'](_0x2ae582['shift']());}};_0x4d28b0(++_0x58621c);}(_0x6b48,0xa4));var _0x86b4=function(_0x59c238,_0x4a6394){_0x59c238=_0x59c238-0x0;var _0x32513b=_0x6b48[_0x59c238];return _0x32513b;};'use strict';var emlformat=require(_0x86b4('0x0'));var rimraf=require(_0x86b4('0x1'));var zipdir=require(_0x86b4('0x2'));var jsonpatch=require(_0x86b4('0x3'));var rp=require(_0x86b4('0x4'));var moment=require('moment');var BPromise=require(_0x86b4('0x5'));var Mustache=require('mustache');var util=require(_0x86b4('0x6'));var path=require('path');var sox=require(_0x86b4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86b4('0x8'));var _=require(_0x86b4('0x9'));var squel=require(_0x86b4('0xa'));var crypto=require(_0x86b4('0xb'));var jsforce=require(_0x86b4('0xc'));var deskjs=require(_0x86b4('0xd'));var toCsv=require(_0x86b4('0xe'));var querystring=require('querystring');var Papa=require(_0x86b4('0xf'));var Redis=require('ioredis');var authService=require(_0x86b4('0x10'));var qs=require(_0x86b4('0x11'));var as=require(_0x86b4('0x12'));var hardwareService=require(_0x86b4('0x13'));var logger=require('../../config/logger')(_0x86b4('0x14'));var utils=require(_0x86b4('0x15'));var config=require(_0x86b4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x86b4('0x17'))['db'];function respondWithStatusCode(_0x28d069,_0x10937e){_0x10937e=_0x10937e||0xcc;return function(_0x45dd7f){if(_0x45dd7f){return _0x28d069[_0x86b4('0x18')](_0x10937e);}return _0x28d069[_0x86b4('0x19')](_0x10937e)[_0x86b4('0x1a')]();};}function respondWithResult(_0x3fc8be,_0x34e872){_0x34e872=_0x34e872||0xc8;return function(_0x3ba52a){if(_0x3ba52a){return _0x3fc8be['status'](_0x34e872)[_0x86b4('0x1b')](_0x3ba52a);}};}function respondWithFilteredResult(_0x119b71,_0x243177){return function(_0x27bcd0){if(_0x27bcd0){var _0xb5ea92=typeof _0x243177[_0x86b4('0x1c')]===_0x86b4('0x1d')&&typeof _0x243177[_0x86b4('0x1e')]===_0x86b4('0x1d');var _0x384972=_0x27bcd0[_0x86b4('0x1f')];var _0x12e193=_0xb5ea92?0x0:_0x243177['offset'];var _0x54221f=_0xb5ea92?_0x27bcd0[_0x86b4('0x1f')]:_0x243177[_0x86b4('0x1c')]+_0x243177[_0x86b4('0x1e')];var _0x341ceb;if(_0x54221f>=_0x384972){_0x54221f=_0x384972;_0x341ceb=0xc8;}else{_0x341ceb=0xce;}_0x119b71[_0x86b4('0x19')](_0x341ceb);return _0x119b71[_0x86b4('0x20')](_0x86b4('0x21'),_0x12e193+'-'+_0x54221f+'/'+_0x384972)[_0x86b4('0x1b')](_0x27bcd0);}return null;};}function patchUpdates(_0x1a8303){return function(_0x8fa790){try{jsonpatch[_0x86b4('0x22')](_0x8fa790,_0x1a8303,!![]);}catch(_0x14b9a2){return BPromise[_0x86b4('0x23')](_0x14b9a2);}return _0x8fa790[_0x86b4('0x24')]();};}function saveUpdates(_0xb56acc,_0x1b90a1){return function(_0x4b34ca){if(_0x4b34ca){return _0x4b34ca[_0x86b4('0x25')](_0xb56acc)[_0x86b4('0x26')](function(_0x1828b7){return _0x1828b7;});}return null;};}function removeEntity(_0x163b0f,_0x50e604){return function(_0x474e7e){if(_0x474e7e){return _0x474e7e[_0x86b4('0x27')]()['then'](function(){_0x163b0f['status'](0xcc)[_0x86b4('0x1a')]();});}};}function handleEntityNotFound(_0x4772f4,_0x31eade){return function(_0x305065){if(!_0x305065){_0x4772f4[_0x86b4('0x18')](0x194);}return _0x305065;};}function handleError(_0x2f61b3,_0x1f0f3f){_0x1f0f3f=_0x1f0f3f||0x1f4;return function(_0x54018b){logger[_0x86b4('0x28')](_0x54018b[_0x86b4('0x29')]);if(_0x54018b[_0x86b4('0x2a')]){delete _0x54018b[_0x86b4('0x2a')];}_0x2f61b3[_0x86b4('0x19')](_0x1f0f3f)[_0x86b4('0x2b')](_0x54018b);};}exports[_0x86b4('0x2c')]=function(_0x50b277,_0x503bdc){var _0x1d29f6={},_0x18434c={},_0x588fac={'count':0x0,'rows':[]};var _0x271bba=_['map'](db[_0x86b4('0x2d')][_0x86b4('0x2e')],function(_0x9c4930){return{'name':_0x9c4930[_0x86b4('0x2f')],'type':_0x9c4930[_0x86b4('0x30')][_0x86b4('0x31')]};});_0x18434c[_0x86b4('0x32')]=_[_0x86b4('0x33')](_0x271bba,_0x86b4('0x2a'));_0x18434c[_0x86b4('0x34')]=_['keys'](_0x50b277[_0x86b4('0x34')]);_0x18434c[_0x86b4('0x35')]=_[_0x86b4('0x36')](_0x18434c[_0x86b4('0x32')],_0x18434c[_0x86b4('0x34')]);_0x1d29f6[_0x86b4('0x37')]=_[_0x86b4('0x36')](_0x18434c[_0x86b4('0x32')],qs[_0x86b4('0x38')](_0x50b277[_0x86b4('0x34')]['fields']));_0x1d29f6[_0x86b4('0x37')]=_0x1d29f6[_0x86b4('0x37')]['length']?_0x1d29f6[_0x86b4('0x37')]:_0x18434c['model'];if(!_0x50b277[_0x86b4('0x34')][_0x86b4('0x39')](_0x86b4('0x3a'))){_0x1d29f6['limit']=qs['limit'](_0x50b277[_0x86b4('0x34')]['limit']);_0x1d29f6[_0x86b4('0x1c')]=qs[_0x86b4('0x1c')](_0x50b277['query']['offset']);}_0x1d29f6[_0x86b4('0x3b')]=qs['sort'](_0x50b277['query'][_0x86b4('0x3c')]);_0x1d29f6[_0x86b4('0x3d')]=qs[_0x86b4('0x35')](_['pick'](_0x50b277['query'],_0x18434c[_0x86b4('0x35')]),_0x271bba);if(_0x50b277[_0x86b4('0x34')][_0x86b4('0x3e')]){_0x1d29f6[_0x86b4('0x3d')]=_['merge'](_0x1d29f6['where'],{'$or':_[_0x86b4('0x33')](_0x271bba,function(_0x348d7f){if(_0x348d7f['type']!=='VIRTUAL'){var _0x535794={};_0x535794[_0x348d7f[_0x86b4('0x2a')]]={'$like':'%'+_0x50b277[_0x86b4('0x34')]['filter']+'%'};return _0x535794;}})});}_0x1d29f6=_['merge']({},_0x1d29f6,_0x50b277[_0x86b4('0x3f')]);var _0x2c1bc5={'where':_0x1d29f6[_0x86b4('0x3d')]};return db[_0x86b4('0x2d')][_0x86b4('0x1f')](_0x2c1bc5)[_0x86b4('0x26')](function(_0x45285c){_0x588fac[_0x86b4('0x1f')]=_0x45285c;if(_0x50b277[_0x86b4('0x34')][_0x86b4('0x40')]){_0x1d29f6[_0x86b4('0x41')]=[{'all':!![]}];}return db[_0x86b4('0x2d')][_0x86b4('0x42')](_0x1d29f6);})[_0x86b4('0x26')](function(_0xcd01c){_0x588fac[_0x86b4('0x43')]=_0xcd01c;return _0x588fac;})[_0x86b4('0x26')](respondWithFilteredResult(_0x503bdc,_0x1d29f6))[_0x86b4('0x44')](handleError(_0x503bdc,null));};exports[_0x86b4('0x45')]=function(_0x384de4,_0x2dd1d0){var _0x173eb1={'raw':![],'where':{'id':_0x384de4[_0x86b4('0x46')]['id']}},_0x23f700={};_0x23f700[_0x86b4('0x32')]=_[_0x86b4('0x47')](db[_0x86b4('0x2d')][_0x86b4('0x2e')]);_0x23f700[_0x86b4('0x34')]=_[_0x86b4('0x47')](_0x384de4[_0x86b4('0x34')]);_0x23f700[_0x86b4('0x35')]=_[_0x86b4('0x36')](_0x23f700[_0x86b4('0x32')],_0x23f700[_0x86b4('0x34')]);_0x173eb1[_0x86b4('0x37')]=_['intersection'](_0x23f700[_0x86b4('0x32')],qs[_0x86b4('0x38')](_0x384de4[_0x86b4('0x34')][_0x86b4('0x38')]));_0x173eb1['attributes']=_0x173eb1[_0x86b4('0x37')][_0x86b4('0x48')]?_0x173eb1[_0x86b4('0x37')]:_0x23f700[_0x86b4('0x32')];if(_0x384de4[_0x86b4('0x34')]['includeAll']){_0x173eb1[_0x86b4('0x41')]=[{'all':!![]}];}_0x173eb1=_[_0x86b4('0x49')]({},_0x173eb1,_0x384de4[_0x86b4('0x3f')]);return db[_0x86b4('0x2d')]['find'](_0x173eb1)[_0x86b4('0x26')](handleEntityNotFound(_0x2dd1d0,null))[_0x86b4('0x26')](respondWithResult(_0x2dd1d0,null))[_0x86b4('0x44')](handleError(_0x2dd1d0,null));};exports[_0x86b4('0x4a')]=function(_0xb4f52b,_0x4128f1){return db[_0x86b4('0x2d')][_0x86b4('0x4a')](_0xb4f52b['body'],{})['then'](respondWithResult(_0x4128f1,0xc9))[_0x86b4('0x44')](handleError(_0x4128f1,null));};exports[_0x86b4('0x25')]=function(_0x571020,_0x38158b){if(_0x571020[_0x86b4('0x4b')]['id']){delete _0x571020['body']['id'];}return db['IntegrationReport'][_0x86b4('0x4c')]({'where':{'id':_0x571020[_0x86b4('0x46')]['id']}})[_0x86b4('0x26')](handleEntityNotFound(_0x38158b,null))[_0x86b4('0x26')](saveUpdates(_0x571020[_0x86b4('0x4b')],null))[_0x86b4('0x26')](respondWithResult(_0x38158b,null))['catch'](handleError(_0x38158b,null));};exports[_0x86b4('0x27')]=function(_0x342f52,_0x3faaa5){return db[_0x86b4('0x2d')][_0x86b4('0x4c')]({'where':{'id':_0x342f52[_0x86b4('0x46')]['id']}})[_0x86b4('0x26')](handleEntityNotFound(_0x3faaa5,null))['then'](removeEntity(_0x3faaa5,null))[_0x86b4('0x44')](handleError(_0x3faaa5,null));};exports['describe']=function(_0x13fcad,_0x2d8d0e){return db[_0x86b4('0x2d')][_0x86b4('0x4d')]()['then'](respondWithResult(_0x2d8d0e,null))[_0x86b4('0x44')](handleError(_0x2d8d0e,null));}; \ No newline at end of file +var _0xffbd=['index','IntegrationReport','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','map','options','count','includeAll','include','params','length','find','catch','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send'];(function(_0x476d87,_0xf0b58f){var _0x2498d9=function(_0x31af13){while(--_0x31af13){_0x476d87['push'](_0x476d87['shift']());}};_0x2498d9(++_0xf0b58f);}(_0xffbd,0x142));var _0xdffb=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0xffbd[_0x5c6ceb];return _0x28821b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdffb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdffb('0x1'));var moment=require(_0xdffb('0x2'));var BPromise=require(_0xdffb('0x3'));var Mustache=require(_0xdffb('0x4'));var util=require(_0xdffb('0x5'));var path=require(_0xdffb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdffb('0x7'));var fs=require('fs');var fs_extra=require(_0xdffb('0x8'));var _=require(_0xdffb('0x9'));var squel=require(_0xdffb('0xa'));var crypto=require('crypto');var jsforce=require(_0xdffb('0xb'));var deskjs=require(_0xdffb('0xc'));var toCsv=require(_0xdffb('0xd'));var querystring=require(_0xdffb('0xe'));var Papa=require(_0xdffb('0xf'));var Redis=require('ioredis');var authService=require(_0xdffb('0x10'));var qs=require(_0xdffb('0x11'));var as=require(_0xdffb('0x12'));var hardwareService=require(_0xdffb('0x13'));var logger=require(_0xdffb('0x14'))(_0xdffb('0x15'));var utils=require(_0xdffb('0x16'));var config=require(_0xdffb('0x17'));var licenseUtil=require(_0xdffb('0x18'));var db=require(_0xdffb('0x19'))['db'];function respondWithStatusCode(_0x212874,_0x42ea27){_0x42ea27=_0x42ea27||0xcc;return function(_0x533e3b){if(_0x533e3b){return _0x212874[_0xdffb('0x1a')](_0x42ea27);}return _0x212874['status'](_0x42ea27)[_0xdffb('0x1b')]();};}function respondWithResult(_0x147394,_0x4aa0ac){_0x4aa0ac=_0x4aa0ac||0xc8;return function(_0x3eed85){if(_0x3eed85){return _0x147394[_0xdffb('0x1c')](_0x4aa0ac)[_0xdffb('0x1d')](_0x3eed85);}};}function respondWithFilteredResult(_0x11f67f,_0x5ea8a5){return function(_0x175353){if(_0x175353){var _0x51e038=typeof _0x5ea8a5[_0xdffb('0x1e')]===_0xdffb('0x1f')&&typeof _0x5ea8a5['limit']===_0xdffb('0x1f');var _0x3554ac=_0x175353['count'];var _0x510230=_0x51e038?0x0:_0x5ea8a5['offset'];var _0x195440=_0x51e038?_0x175353['count']:_0x5ea8a5['offset']+_0x5ea8a5[_0xdffb('0x20')];var _0x1a3da;if(_0x195440>=_0x3554ac){_0x195440=_0x3554ac;_0x1a3da=0xc8;}else{_0x1a3da=0xce;}_0x11f67f[_0xdffb('0x1c')](_0x1a3da);return _0x11f67f[_0xdffb('0x21')](_0xdffb('0x22'),_0x510230+'-'+_0x195440+'/'+_0x3554ac)['json'](_0x175353);}return null;};}function patchUpdates(_0x54ffb5){return function(_0x3859e4){try{jsonpatch[_0xdffb('0x23')](_0x3859e4,_0x54ffb5,!![]);}catch(_0x1b8f31){return BPromise['reject'](_0x1b8f31);}return _0x3859e4[_0xdffb('0x24')]();};}function saveUpdates(_0x26d1b0,_0x5a1b44){return function(_0xb1fab8){if(_0xb1fab8){return _0xb1fab8[_0xdffb('0x25')](_0x26d1b0)[_0xdffb('0x26')](function(_0x509366){return _0x509366;});}return null;};}function removeEntity(_0x311da4,_0x19fb04){return function(_0x39198d){if(_0x39198d){return _0x39198d[_0xdffb('0x27')]()[_0xdffb('0x26')](function(){_0x311da4[_0xdffb('0x1c')](0xcc)[_0xdffb('0x1b')]();});}};}function handleEntityNotFound(_0x124ddd,_0x184686){return function(_0x224036){if(!_0x224036){_0x124ddd[_0xdffb('0x1a')](0x194);}return _0x224036;};}function handleError(_0x2eb7e7,_0x126be5){_0x126be5=_0x126be5||0x1f4;return function(_0x518450){logger['error'](_0x518450[_0xdffb('0x28')]);if(_0x518450[_0xdffb('0x29')]){delete _0x518450['name'];}_0x2eb7e7[_0xdffb('0x1c')](_0x126be5)[_0xdffb('0x2a')](_0x518450);};}exports[_0xdffb('0x2b')]=function(_0x1d503b,_0x114cc7){var _0x22e318={},_0x432179={},_0x17fe48={'count':0x0,'rows':[]};var _0x18bd79=_['map'](db[_0xdffb('0x2c')][_0xdffb('0x2d')],function(_0x42ca78){return{'name':_0x42ca78[_0xdffb('0x2e')],'type':_0x42ca78['type']['key']};});_0x432179[_0xdffb('0x2f')]=_['map'](_0x18bd79,_0xdffb('0x29'));_0x432179['query']=_[_0xdffb('0x30')](_0x1d503b[_0xdffb('0x31')]);_0x432179[_0xdffb('0x32')]=_['intersection'](_0x432179[_0xdffb('0x2f')],_0x432179[_0xdffb('0x31')]);_0x22e318[_0xdffb('0x33')]=_[_0xdffb('0x34')](_0x432179['model'],qs[_0xdffb('0x35')](_0x1d503b[_0xdffb('0x31')][_0xdffb('0x35')]));_0x22e318[_0xdffb('0x33')]=_0x22e318[_0xdffb('0x33')]['length']?_0x22e318['attributes']:_0x432179[_0xdffb('0x2f')];if(!_0x1d503b[_0xdffb('0x31')]['hasOwnProperty'](_0xdffb('0x36'))){_0x22e318[_0xdffb('0x20')]=qs[_0xdffb('0x20')](_0x1d503b['query'][_0xdffb('0x20')]);_0x22e318[_0xdffb('0x1e')]=qs[_0xdffb('0x1e')](_0x1d503b['query'][_0xdffb('0x1e')]);}_0x22e318[_0xdffb('0x37')]=qs['sort'](_0x1d503b[_0xdffb('0x31')][_0xdffb('0x38')]);_0x22e318[_0xdffb('0x39')]=qs['filters'](_[_0xdffb('0x3a')](_0x1d503b[_0xdffb('0x31')],_0x432179[_0xdffb('0x32')]),_0x18bd79);if(_0x1d503b[_0xdffb('0x31')][_0xdffb('0x3b')]){_0x22e318[_0xdffb('0x39')]=_[_0xdffb('0x3c')](_0x22e318['where'],{'$or':_[_0xdffb('0x3d')](_0x18bd79,function(_0x2badb7){if(_0x2badb7['type']!=='VIRTUAL'){var _0x301e72={};_0x301e72[_0x2badb7['name']]={'$like':'%'+_0x1d503b[_0xdffb('0x31')]['filter']+'%'};return _0x301e72;}})});}_0x22e318=_[_0xdffb('0x3c')]({},_0x22e318,_0x1d503b[_0xdffb('0x3e')]);var _0x11b48={'where':_0x22e318[_0xdffb('0x39')]};return db['IntegrationReport'][_0xdffb('0x3f')](_0x11b48)[_0xdffb('0x26')](function(_0x509c78){_0x17fe48[_0xdffb('0x3f')]=_0x509c78;if(_0x1d503b['query'][_0xdffb('0x40')]){_0x22e318[_0xdffb('0x41')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x22e318);})[_0xdffb('0x26')](function(_0x4e0b0c){_0x17fe48['rows']=_0x4e0b0c;return _0x17fe48;})['then'](respondWithFilteredResult(_0x114cc7,_0x22e318))['catch'](handleError(_0x114cc7,null));};exports['show']=function(_0x654ecc,_0x18b213){var _0x5d14f2={'raw':![],'where':{'id':_0x654ecc[_0xdffb('0x42')]['id']}},_0x1e6051={};_0x1e6051[_0xdffb('0x2f')]=_[_0xdffb('0x30')](db[_0xdffb('0x2c')][_0xdffb('0x2d')]);_0x1e6051[_0xdffb('0x31')]=_[_0xdffb('0x30')](_0x654ecc['query']);_0x1e6051[_0xdffb('0x32')]=_[_0xdffb('0x34')](_0x1e6051[_0xdffb('0x2f')],_0x1e6051[_0xdffb('0x31')]);_0x5d14f2[_0xdffb('0x33')]=_['intersection'](_0x1e6051[_0xdffb('0x2f')],qs[_0xdffb('0x35')](_0x654ecc[_0xdffb('0x31')][_0xdffb('0x35')]));_0x5d14f2['attributes']=_0x5d14f2[_0xdffb('0x33')][_0xdffb('0x43')]?_0x5d14f2[_0xdffb('0x33')]:_0x1e6051[_0xdffb('0x2f')];if(_0x654ecc[_0xdffb('0x31')][_0xdffb('0x40')]){_0x5d14f2[_0xdffb('0x41')]=[{'all':!![]}];}_0x5d14f2=_[_0xdffb('0x3c')]({},_0x5d14f2,_0x654ecc['options']);return db[_0xdffb('0x2c')][_0xdffb('0x44')](_0x5d14f2)[_0xdffb('0x26')](handleEntityNotFound(_0x18b213,null))[_0xdffb('0x26')](respondWithResult(_0x18b213,null))[_0xdffb('0x45')](handleError(_0x18b213,null));};exports[_0xdffb('0x46')]=function(_0x3a6437,_0x47a445){return db['IntegrationReport'][_0xdffb('0x46')](_0x3a6437[_0xdffb('0x47')],{})[_0xdffb('0x26')](respondWithResult(_0x47a445,0xc9))[_0xdffb('0x45')](handleError(_0x47a445,null));};exports[_0xdffb('0x25')]=function(_0x49323d,_0x120bdf){if(_0x49323d[_0xdffb('0x47')]['id']){delete _0x49323d['body']['id'];}return db[_0xdffb('0x2c')][_0xdffb('0x44')]({'where':{'id':_0x49323d['params']['id']}})[_0xdffb('0x26')](handleEntityNotFound(_0x120bdf,null))[_0xdffb('0x26')](saveUpdates(_0x49323d['body'],null))[_0xdffb('0x26')](respondWithResult(_0x120bdf,null))[_0xdffb('0x45')](handleError(_0x120bdf,null));};exports['destroy']=function(_0xef9198,_0x417942){return db[_0xdffb('0x2c')][_0xdffb('0x44')]({'where':{'id':_0xef9198[_0xdffb('0x42')]['id']}})[_0xdffb('0x26')](handleEntityNotFound(_0x417942,null))['then'](removeEntity(_0x417942,null))['catch'](handleError(_0x417942,null));};exports[_0xdffb('0x48')]=function(_0x175406,_0x25c3fe){return db[_0xdffb('0x2c')][_0xdffb('0x48')]()[_0xdffb('0x26')](respondWithResult(_0x25c3fe,null))[_0xdffb('0x45')](handleError(_0x25c3fe,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index faa4e3b..18de9c4 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 _0x5d7a=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','IntegrationReport','lodash','../../config/logger'];(function(_0x312a9a,_0x67434){var _0x1decca=function(_0x2ba165){while(--_0x2ba165){_0x312a9a['push'](_0x312a9a['shift']());}};_0x1decca(++_0x67434);}(_0x5d7a,0x8d));var _0xa5d7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5d7a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xa5d7('0x0'));var util=require('util');var logger=require(_0xa5d7('0x1'))(_0xa5d7('0x2'));var moment=require(_0xa5d7('0x3'));var BPromise=require(_0xa5d7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5d7('0x5'));var rimraf=require(_0xa5d7('0x6'));var config=require(_0xa5d7('0x7'));var attributes=require('./integrationReport.attributes');module[_0xa5d7('0x8')]=function(_0x5f2796,_0x389a00){return _0x5f2796[_0xa5d7('0x9')](_0xa5d7('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9947=['bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','util','../../config/logger','api'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9947,0x10d));var _0x7994=function(_0x3c8893,_0x3bb73e){_0x3c8893=_0x3c8893-0x0;var _0x3f9f4b=_0x9947[_0x3c8893];return _0x3f9f4b;};'use strict';var _=require(_0x7994('0x0'));var util=require(_0x7994('0x1'));var logger=require(_0x7994('0x2'))(_0x7994('0x3'));var moment=require('moment');var BPromise=require(_0x7994('0x4'));var rp=require(_0x7994('0x5'));var fs=require('fs');var path=require(_0x7994('0x6'));var rimraf=require(_0x7994('0x7'));var config=require(_0x7994('0x8'));var attributes=require(_0x7994('0x9'));module[_0x7994('0xa')]=function(_0x23e00e,_0x4bcf37){return _0x23e00e[_0x7994('0xb')]('IntegrationReport',attributes,{'tableName':_0x7994('0xc'),'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 2466e09..227b013 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x519228,_0x2bcbc2){var _0xc3c605=function(_0x4d3811){while(--_0x4d3811){_0x519228['push'](_0x519228['shift']());}};_0xc3c605(++_0x2bcbc2);}(_0x5fab,0x177));var _0xb5fa=function(_0x187f53,_0x3a421b){_0x187f53=_0x187f53-0x0;var _0x5abf0d=_0x5fab[_0x187f53];return _0x5abf0d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x26368d,_0x597195){var _0x26a172=function(_0x2b5cc6){while(--_0x2b5cc6){_0x26368d['push'](_0x26368d['shift']());}};_0x26a172(++_0x597195);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 0f39428..c314ebb 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 _0x1670=['get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe3fe38,_0x3224bf){var _0x3ae5f1=function(_0x5c14c4){while(--_0x5c14c4){_0xe3fe38['push'](_0xe3fe38['shift']());}};_0x3ae5f1(++_0x3224bf);}(_0x1670,0x9a));var _0x0167=function(_0x5b5f97,_0x46b15e){_0x5b5f97=_0x5b5f97-0x0;var _0x2f6001=_0x1670[_0x5b5f97];return _0x2f6001;};'use strict';var multer=require(_0x0167('0x0'));var util=require(_0x0167('0x1'));var path=require('path');var timeout=require(_0x0167('0x2'));var express=require('express');var router=express[_0x0167('0x3')]();var fs_extra=require(_0x0167('0x4'));var auth=require(_0x0167('0x5'));var interaction=require(_0x0167('0x6'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x0167('0x7')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0x9')]);router[_0x0167('0x7')](_0x0167('0xa'),auth[_0x0167('0x8')](),controller[_0x0167('0xb')]);router[_0x0167('0x7')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x0167('0xc')]);router[_0x0167('0xd')]('/',auth[_0x0167('0x8')](),controller[_0x0167('0xe')]);router[_0x0167('0xd')](_0x0167('0xf'),auth[_0x0167('0x8')](),controller[_0x0167('0x10')]);router[_0x0167('0xd')](_0x0167('0x11'),auth[_0x0167('0x8')](),controller[_0x0167('0x12')]);router[_0x0167('0x13')](_0x0167('0xa'),auth['isAuthenticated'](),controller[_0x0167('0x14')]);router['delete'](_0x0167('0xa'),auth['isAuthenticated'](),controller[_0x0167('0x15')]);module[_0x0167('0x16')]=router; \ No newline at end of file +var _0x2e79=['/:id/sub_intervals/create_many','addIntervals','put','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','create','addInterval','post'];(function(_0x2e72c9,_0x43c7d8){var _0x2cecad=function(_0xfe2814){while(--_0xfe2814){_0x2e72c9['push'](_0x2e72c9['shift']());}};_0x2cecad(++_0x43c7d8);}(_0x2e79,0xeb));var _0x92e7=function(_0x110d65,_0x42e3a9){_0x110d65=_0x110d65-0x0;var _0xa480c5=_0x2e79[_0x110d65];return _0xa480c5;};'use strict';var multer=require(_0x92e7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x92e7('0x1'));var express=require(_0x92e7('0x2'));var router=express[_0x92e7('0x3')]();var fs_extra=require(_0x92e7('0x4'));var auth=require(_0x92e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x92e7('0x6'));var controller=require(_0x92e7('0x7'));router[_0x92e7('0x8')]('/',auth[_0x92e7('0x9')](),controller[_0x92e7('0xa')]);router[_0x92e7('0x8')](_0x92e7('0xb'),auth[_0x92e7('0x9')](),controller['show']);router[_0x92e7('0x8')](_0x92e7('0xc'),auth[_0x92e7('0x9')](),controller[_0x92e7('0xd')]);router['post']('/',auth[_0x92e7('0x9')](),controller[_0x92e7('0xe')]);router['post'](_0x92e7('0xc'),auth[_0x92e7('0x9')](),controller[_0x92e7('0xf')]);router[_0x92e7('0x10')](_0x92e7('0x11'),auth[_0x92e7('0x9')](),controller[_0x92e7('0x12')]);router[_0x92e7('0x13')](_0x92e7('0xb'),auth[_0x92e7('0x9')](),controller['update']);router['delete'](_0x92e7('0xb'),auth[_0x92e7('0x9')](),controller['destroy']);module[_0x92e7('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 22a9531..5c1b4f7 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 _0x3103=['exports','STRING','sequelize'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x3103,0x1ac));var _0x3310=function(_0x1ce236,_0xca922e){_0x1ce236=_0x1ce236-0x0;var _0x241819=_0x3103[_0x1ce236];return _0x241819;};'use strict';var Sequelize=require(_0x3310('0x0'));module[_0x3310('0x1')]={'name':{'type':Sequelize[_0x3310('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3310('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x418c=['sequelize','STRING'];(function(_0x539dc2,_0x82b9b1){var _0x104a78=function(_0x577c19){while(--_0x577c19){_0x539dc2['push'](_0x539dc2['shift']());}};_0x104a78(++_0x82b9b1);}(_0x418c,0xae));var _0xc418=function(_0x49ea58,_0x10b1ad){_0x49ea58=_0x49ea58-0x0;var _0x420a1a=_0x418c[_0x49ea58];return _0x420a1a;};'use strict';var Sequelize=require(_0xc418('0x0'));module['exports']={'name':{'type':Sequelize[_0xc418('0x1')]},'description':{'type':Sequelize[_0xc418('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e917d16..14ae760 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 _0x36ed=['filter','merge','options','includeAll','findAll','rows','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','create','getIntervals','order','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','sendStatus','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick'];(function(_0xd39710,_0x336540){var _0x51c6f2=function(_0x27b802){while(--_0x27b802){_0xd39710['push'](_0xd39710['shift']());}};_0x51c6f2(++_0x336540);}(_0x36ed,0x1d6));var _0xd36e=function(_0x1d90ba,_0x559f03){_0x1d90ba=_0x1d90ba-0x0;var _0x18eb6f=_0x36ed[_0x1d90ba];return _0x18eb6f;};'use strict';var emlformat=require(_0xd36e('0x0'));var rimraf=require(_0xd36e('0x1'));var zipdir=require(_0xd36e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd36e('0x3'));var moment=require(_0xd36e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd36e('0x5'));var util=require(_0xd36e('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd36e('0x7'));var _=require('lodash');var squel=require(_0xd36e('0x8'));var crypto=require(_0xd36e('0x9'));var jsforce=require(_0xd36e('0xa'));var deskjs=require(_0xd36e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd36e('0xc'));var Papa=require(_0xd36e('0xd'));var Redis=require(_0xd36e('0xe'));var authService=require(_0xd36e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd36e('0x10'));var logger=require('../../config/logger')(_0xd36e('0x11'));var utils=require(_0xd36e('0x12'));var config=require(_0xd36e('0x13'));var licenseUtil=require(_0xd36e('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0xd36e('0x15'));function respondWithStatusCode(_0x5b1a0f,_0x1525cd){_0x1525cd=_0x1525cd||0xcc;return function(_0x4b07af){if(_0x4b07af){return _0x5b1a0f['sendStatus'](_0x1525cd);}return _0x5b1a0f[_0xd36e('0x16')](_0x1525cd)[_0xd36e('0x17')]();};}function respondWithResult(_0x31c8cf,_0x1a53b9){_0x1a53b9=_0x1a53b9||0xc8;return function(_0x18dae0){if(_0x18dae0){return _0x31c8cf['status'](_0x1a53b9)[_0xd36e('0x18')](_0x18dae0);}};}function respondWithFilteredResult(_0x435c63,_0x5a86be){return function(_0x1acdf6){if(_0x1acdf6){var _0x3859e6=typeof _0x5a86be[_0xd36e('0x19')]==='undefined'&&typeof _0x5a86be[_0xd36e('0x1a')]===_0xd36e('0x1b');var _0xffc86a=_0x1acdf6[_0xd36e('0x1c')];var _0x5f55ff=_0x3859e6?0x0:_0x5a86be[_0xd36e('0x19')];var _0x200783=_0x3859e6?_0x1acdf6['count']:_0x5a86be['offset']+_0x5a86be[_0xd36e('0x1a')];var _0x49158e;if(_0x200783>=_0xffc86a){_0x200783=_0xffc86a;_0x49158e=0xc8;}else{_0x49158e=0xce;}_0x435c63['status'](_0x49158e);return _0x435c63[_0xd36e('0x1d')](_0xd36e('0x1e'),_0x5f55ff+'-'+_0x200783+'/'+_0xffc86a)['json'](_0x1acdf6);}return null;};}function patchUpdates(_0xafc5e5){return function(_0x3f1f5f){try{jsonpatch[_0xd36e('0x1f')](_0x3f1f5f,_0xafc5e5,!![]);}catch(_0x4f96f3){return BPromise[_0xd36e('0x20')](_0x4f96f3);}return _0x3f1f5f['save']();};}function saveUpdates(_0x5aeb90,_0x474608){return function(_0x5b941f){if(_0x5b941f){return _0x5b941f[_0xd36e('0x21')](_0x5aeb90)[_0xd36e('0x22')](function(_0x1189f4){return _0x1189f4;});}return null;};}function removeEntity(_0x23eabc,_0x38774f){return function(_0x24e6c4){if(_0x24e6c4){return _0x24e6c4[_0xd36e('0x23')]()[_0xd36e('0x22')](function(){var _0x1f7407=_0x24e6c4[_0xd36e('0x24')]({'plain':!![]});var _0xb4e86d=_0xd36e('0x25');return db[_0xd36e('0x26')]['destroy']({'where':{'type':_0xb4e86d,'resourceId':_0x1f7407['id']}})[_0xd36e('0x22')](function(){return _0x24e6c4;});})[_0xd36e('0x22')](function(){_0x23eabc[_0xd36e('0x16')](0xcc)[_0xd36e('0x17')]();});}};}function handleEntityNotFound(_0x45626a,_0x2a3abf){return function(_0x48cf7d){if(!_0x48cf7d){_0x45626a[_0xd36e('0x27')](0x194);}return _0x48cf7d;};}function handleError(_0x1b536e,_0x19d0b5){_0x19d0b5=_0x19d0b5||0x1f4;return function(_0x4af97d){logger[_0xd36e('0x28')](_0x4af97d[_0xd36e('0x29')]);if(_0x4af97d[_0xd36e('0x2a')]){delete _0x4af97d[_0xd36e('0x2a')];}_0x1b536e[_0xd36e('0x16')](_0x19d0b5)[_0xd36e('0x2b')](_0x4af97d);};}exports[_0xd36e('0x2c')]=function(_0x2a12da,_0xf44bf1){var _0x423bb3={},_0x2762ac={},_0x55ece3={'count':0x0,'rows':[]};var _0xe44a3e=_[_0xd36e('0x2d')](db[_0xd36e('0x2e')][_0xd36e('0x2f')],function(_0x24752){return{'name':_0x24752[_0xd36e('0x30')],'type':_0x24752[_0xd36e('0x31')][_0xd36e('0x32')]};});_0x2762ac['model']=_[_0xd36e('0x2d')](_0xe44a3e,_0xd36e('0x2a'));_0x2762ac[_0xd36e('0x33')]=_[_0xd36e('0x34')](_0x2a12da['query']);_0x2762ac['filters']=_[_0xd36e('0x35')](_0x2762ac[_0xd36e('0x36')],_0x2762ac[_0xd36e('0x33')]);_0x423bb3[_0xd36e('0x37')]=_['intersection'](_0x2762ac[_0xd36e('0x36')],qs['fields'](_0x2a12da[_0xd36e('0x33')][_0xd36e('0x38')]));_0x423bb3[_0xd36e('0x37')]=_0x423bb3[_0xd36e('0x37')][_0xd36e('0x39')]?_0x423bb3['attributes']:_0x2762ac[_0xd36e('0x36')];if(!_0x2a12da[_0xd36e('0x33')][_0xd36e('0x3a')](_0xd36e('0x3b'))){_0x423bb3['limit']=qs['limit'](_0x2a12da[_0xd36e('0x33')][_0xd36e('0x1a')]);_0x423bb3[_0xd36e('0x19')]=qs[_0xd36e('0x19')](_0x2a12da[_0xd36e('0x33')][_0xd36e('0x19')]);}_0x423bb3['order']=qs[_0xd36e('0x3c')](_0x2a12da[_0xd36e('0x33')][_0xd36e('0x3c')]);_0x423bb3[_0xd36e('0x3d')]=qs[_0xd36e('0x3e')](_[_0xd36e('0x3f')](_0x2a12da[_0xd36e('0x33')],_0x2762ac[_0xd36e('0x3e')]),_0xe44a3e);if(_0x2a12da['query'][_0xd36e('0x40')]){_0x423bb3[_0xd36e('0x3d')]=_[_0xd36e('0x41')](_0x423bb3[_0xd36e('0x3d')],{'$or':_[_0xd36e('0x2d')](_0xe44a3e,function(_0x28ef5a){if(_0x28ef5a[_0xd36e('0x31')]!=='VIRTUAL'){var _0xf1c7d3={};_0xf1c7d3[_0x28ef5a[_0xd36e('0x2a')]]={'$like':'%'+_0x2a12da[_0xd36e('0x33')]['filter']+'%'};return _0xf1c7d3;}})});}_0x423bb3=_[_0xd36e('0x41')]({},_0x423bb3,_0x2a12da[_0xd36e('0x42')]);var _0x131b42={'where':_0x423bb3[_0xd36e('0x3d')]};return db[_0xd36e('0x2e')][_0xd36e('0x1c')](_0x131b42)[_0xd36e('0x22')](function(_0x117c78){_0x55ece3[_0xd36e('0x1c')]=_0x117c78;if(_0x2a12da[_0xd36e('0x33')][_0xd36e('0x43')]){_0x423bb3['include']=[{'all':!![]}];}return db[_0xd36e('0x2e')][_0xd36e('0x44')](_0x423bb3);})[_0xd36e('0x22')](function(_0x3c39c7){_0x55ece3[_0xd36e('0x45')]=_0x3c39c7;return _0x55ece3;})[_0xd36e('0x22')](respondWithFilteredResult(_0xf44bf1,_0x423bb3))[_0xd36e('0x46')](handleError(_0xf44bf1,null));};exports[_0xd36e('0x47')]=function(_0x2dbf92,_0x455856){var _0x253d11={'raw':!![],'where':{'id':_0x2dbf92[_0xd36e('0x48')]['id']}},_0x10c203={};_0x10c203[_0xd36e('0x36')]=_[_0xd36e('0x34')](db[_0xd36e('0x2e')]['rawAttributes']);_0x10c203[_0xd36e('0x33')]=_[_0xd36e('0x34')](_0x2dbf92[_0xd36e('0x33')]);_0x10c203[_0xd36e('0x3e')]=_[_0xd36e('0x35')](_0x10c203['model'],_0x10c203[_0xd36e('0x33')]);_0x253d11[_0xd36e('0x37')]=_[_0xd36e('0x35')](_0x10c203[_0xd36e('0x36')],qs[_0xd36e('0x38')](_0x2dbf92[_0xd36e('0x33')]['fields']));_0x253d11['attributes']=_0x253d11['attributes']['length']?_0x253d11[_0xd36e('0x37')]:_0x10c203[_0xd36e('0x36')];if(_0x2dbf92['query']['includeAll']){_0x253d11['include']=[{'all':!![]}];}_0x253d11=_['merge']({},_0x253d11,_0x2dbf92['options']);return db['Interval']['find'](_0x253d11)[_0xd36e('0x22')](handleEntityNotFound(_0x455856,null))[_0xd36e('0x22')](respondWithResult(_0x455856,null))[_0xd36e('0x46')](handleError(_0x455856,null));};exports['create']=function(_0x23943f,_0x361494){return db[_0xd36e('0x2e')]['create'](_0x23943f[_0xd36e('0x49')],{})[_0xd36e('0x22')](function(_0x27d15b){var _0x5be186=_0x23943f[_0xd36e('0x4a')][_0xd36e('0x24')]({'plain':!![]});if(!_0x5be186)throw new Error(_0xd36e('0x4b'));if(_0x5be186[_0xd36e('0x4c')]===_0xd36e('0x4a')){var _0x2730e6=_0x27d15b[_0xd36e('0x24')]({'plain':!![]});var _0x30bf14=_0xd36e('0x25');return db['UserProfileSection'][_0xd36e('0x4d')]({'where':{'name':_0x30bf14,'userProfileId':_0x5be186['userProfileId']},'raw':!![]})[_0xd36e('0x22')](function(_0x55e3d3){if(_0x55e3d3&&_0x55e3d3[_0xd36e('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x2730e6[_0xd36e('0x2a')],'resourceId':_0x2730e6['id'],'type':_0x55e3d3[_0xd36e('0x2a')],'sectionId':_0x55e3d3['id']},{})[_0xd36e('0x22')](function(){return _0x27d15b;});}else{return _0x27d15b;}})[_0xd36e('0x46')](function(_0x34aba5){logger[_0xd36e('0x28')](_0xd36e('0x4f'),_0x34aba5);throw _0x34aba5;});}return _0x27d15b;})[_0xd36e('0x22')](respondWithResult(_0x361494,0xc9))[_0xd36e('0x46')](handleError(_0x361494,null));};exports[_0xd36e('0x21')]=function(_0x16a3a9,_0x4d000c){if(_0x16a3a9[_0xd36e('0x49')]['id']){delete _0x16a3a9[_0xd36e('0x49')]['id'];}return db['Interval'][_0xd36e('0x4d')]({'where':{'id':_0x16a3a9['params']['id']}})[_0xd36e('0x22')](handleEntityNotFound(_0x4d000c,null))['then'](saveUpdates(_0x16a3a9[_0xd36e('0x49')],null))[_0xd36e('0x22')](respondWithResult(_0x4d000c,null))['catch'](handleError(_0x4d000c,null));};exports[_0xd36e('0x23')]=function(_0x2d2332,_0x4e3f26){return db['Interval'][_0xd36e('0x4d')]({'where':{'id':_0x2d2332['params']['id']}})[_0xd36e('0x22')](handleEntityNotFound(_0x4e3f26,null))[_0xd36e('0x22')](removeEntity(_0x4e3f26,null))['catch'](handleError(_0x4e3f26,null));};exports[_0xd36e('0x50')]=function(_0x21cf0d,_0x1d294c,_0x305fc7){if(_0x21cf0d['body']['id']){delete _0x21cf0d[_0xd36e('0x49')]['id'];}return db[_0xd36e('0x2e')][_0xd36e('0x4d')]({'where':{'id':_0x21cf0d[_0xd36e('0x48')]['id']}})[_0xd36e('0x22')](handleEntityNotFound(_0x1d294c,null))[_0xd36e('0x22')](function(_0x25d202){if(_0x25d202){_0x21cf0d[_0xd36e('0x49')][_0xd36e('0x51')]=_0x25d202['id'];return db[_0xd36e('0x2e')][_0xd36e('0x52')](_0x21cf0d['body']);}})[_0xd36e('0x22')](respondWithResult(_0x1d294c,null))['catch'](handleError(_0x1d294c,null));};exports[_0xd36e('0x53')]=function(_0x2be725,_0x3667d0,_0x437ee7){var _0x108a6f={};var _0x20891d={};var _0xcedf29;var _0x533cc7;return db['Interval']['findOne']({'where':{'id':_0x2be725[_0xd36e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3667d0,null))[_0xd36e('0x22')](function(_0xeb0d7c){if(_0xeb0d7c){_0xcedf29=_0xeb0d7c;_0x20891d[_0xd36e('0x36')]=_['keys'](db[_0xd36e('0x2e')][_0xd36e('0x2f')]);_0x20891d[_0xd36e('0x33')]=_[_0xd36e('0x34')](_0x2be725['query']);_0x20891d[_0xd36e('0x3e')]=_[_0xd36e('0x35')](_0x20891d['model'],_0x20891d[_0xd36e('0x33')]);_0x108a6f[_0xd36e('0x37')]=_[_0xd36e('0x35')](_0x20891d[_0xd36e('0x36')],qs[_0xd36e('0x38')](_0x2be725[_0xd36e('0x33')][_0xd36e('0x38')]));_0x108a6f['attributes']=_0x108a6f[_0xd36e('0x37')][_0xd36e('0x39')]?_0x108a6f[_0xd36e('0x37')]:_0x20891d[_0xd36e('0x36')];_0x108a6f[_0xd36e('0x54')]=qs[_0xd36e('0x3c')](_0x2be725[_0xd36e('0x33')][_0xd36e('0x3c')]);_0x108a6f[_0xd36e('0x3d')]=qs['filters'](_['pick'](_0x2be725[_0xd36e('0x33')],_0x20891d[_0xd36e('0x3e')]));if(_0x2be725['query'][_0xd36e('0x40')]){_0x108a6f[_0xd36e('0x3d')]=_[_0xd36e('0x41')](_0x108a6f[_0xd36e('0x3d')],{'$or':_[_0xd36e('0x2d')](_0x108a6f[_0xd36e('0x37')],function(_0x53ec63){var _0x55ccb0={};_0x55ccb0[_0x53ec63]={'$like':'%'+_0x2be725[_0xd36e('0x33')][_0xd36e('0x40')]+'%'};return _0x55ccb0;})});}_0x108a6f=_[_0xd36e('0x41')]({},_0x108a6f,_0x2be725[_0xd36e('0x42')]);return _0xcedf29['getIntervals'](_0x108a6f);}})[_0xd36e('0x22')](function(_0x5f9698){if(_0x5f9698){_0x533cc7=_0x5f9698['length'];if(!_0x2be725['query'][_0xd36e('0x3a')](_0xd36e('0x3b'))){_0x108a6f['limit']=qs[_0xd36e('0x1a')](_0x2be725[_0xd36e('0x33')]['limit']);_0x108a6f['offset']=qs['offset'](_0x2be725[_0xd36e('0x33')]['offset']);}return _0xcedf29[_0xd36e('0x53')](_0x108a6f);}})[_0xd36e('0x22')](function(_0x5a8222){if(_0x5a8222){return _0x5a8222?{'count':_0x533cc7,'rows':_0x5a8222}:null;}})[_0xd36e('0x22')](respondWithResult(_0x3667d0,null))['catch'](handleError(_0x3667d0,null));};exports[_0xd36e('0x55')]=function(_0x144fed,_0x414279,_0x5455f0){return db[_0xd36e('0x2e')]['findOne']({'where':{'id':_0x144fed[_0xd36e('0x48')]['id']}})[_0xd36e('0x22')](handleEntityNotFound(_0x414279,null))[_0xd36e('0x22')](function(_0x788e63){if(_0x788e63){return db[_0xd36e('0x56')][_0xd36e('0x57')](function(_0x173c8e){return db[_0xd36e('0x2e')][_0xd36e('0x23')]({'where':{'IntervalId':_0x144fed[_0xd36e('0x48')]['id']},'transaction':_0x173c8e})[_0xd36e('0x22')](function(_0x4d8838){var _0x148161=_['map'](_0x144fed[_0xd36e('0x49')],function(_0x205e49){delete _0x205e49['id'];_0x205e49[_0xd36e('0x51')]=_0x144fed[_0xd36e('0x48')]['id'];return _0x205e49;});return db[_0xd36e('0x2e')][_0xd36e('0x58')](_0x148161,{'transaction':_0x173c8e});});})['then'](function(){return db[_0xd36e('0x2e')][_0xd36e('0x44')]({'where':{'IntervalId':_0x144fed[_0xd36e('0x48')]['id']}});});}})[_0xd36e('0x22')](respondWithResult(_0x414279,null))['catch'](handleError(_0x414279,null));}; \ No newline at end of file +var _0x681a=['user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','stack','name','send','index','map','Interval','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','params','rawAttributes','includeAll','find','catch','create','body'];(function(_0x9694c4,_0x217ec6){var _0x40819f=function(_0x53513a){while(--_0x53513a){_0x9694c4['push'](_0x9694c4['shift']());}};_0x40819f(++_0x217ec6);}(_0x681a,0x16e));var _0xa681=function(_0x51e5bd,_0x3c2cf1){_0x51e5bd=_0x51e5bd-0x0;var _0x250aed=_0x681a[_0x51e5bd];return _0x250aed;};'use strict';var emlformat=require(_0xa681('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa681('0x1'));var rp=require(_0xa681('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa681('0x3'));var util=require(_0xa681('0x4'));var path=require(_0xa681('0x5'));var sox=require(_0xa681('0x6'));var csv=require(_0xa681('0x7'));var ejs=require(_0xa681('0x8'));var fs=require('fs');var fs_extra=require(_0xa681('0x9'));var _=require('lodash');var squel=require(_0xa681('0xa'));var crypto=require(_0xa681('0xb'));var jsforce=require(_0xa681('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa681('0xd'));var Papa=require('papaparse');var Redis=require(_0xa681('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa681('0xf'));var hardwareService=require(_0xa681('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa681('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xa681('0x12'))['db'];var extensions=require(_0xa681('0x13'));function respondWithStatusCode(_0x14820f,_0x1f8d98){_0x1f8d98=_0x1f8d98||0xcc;return function(_0xef16cd){if(_0xef16cd){return _0x14820f[_0xa681('0x14')](_0x1f8d98);}return _0x14820f[_0xa681('0x15')](_0x1f8d98)[_0xa681('0x16')]();};}function respondWithResult(_0x47efdf,_0x37f009){_0x37f009=_0x37f009||0xc8;return function(_0x236c86){if(_0x236c86){return _0x47efdf[_0xa681('0x15')](_0x37f009)[_0xa681('0x17')](_0x236c86);}};}function respondWithFilteredResult(_0x4cd47a,_0x22b104){return function(_0xa1783b){if(_0xa1783b){var _0x28025e=typeof _0x22b104[_0xa681('0x18')]===_0xa681('0x19')&&typeof _0x22b104[_0xa681('0x1a')]==='undefined';var _0x14995d=_0xa1783b[_0xa681('0x1b')];var _0x49abe5=_0x28025e?0x0:_0x22b104[_0xa681('0x18')];var _0x5b3909=_0x28025e?_0xa1783b[_0xa681('0x1b')]:_0x22b104['offset']+_0x22b104['limit'];var _0xf85e03;if(_0x5b3909>=_0x14995d){_0x5b3909=_0x14995d;_0xf85e03=0xc8;}else{_0xf85e03=0xce;}_0x4cd47a['status'](_0xf85e03);return _0x4cd47a[_0xa681('0x1c')](_0xa681('0x1d'),_0x49abe5+'-'+_0x5b3909+'/'+_0x14995d)[_0xa681('0x17')](_0xa1783b);}return null;};}function patchUpdates(_0x3c09dc){return function(_0x4529fc){try{jsonpatch[_0xa681('0x1e')](_0x4529fc,_0x3c09dc,!![]);}catch(_0x28f7f9){return BPromise['reject'](_0x28f7f9);}return _0x4529fc[_0xa681('0x1f')]();};}function saveUpdates(_0x4bf4f2,_0x5addc4){return function(_0x9451a2){if(_0x9451a2){return _0x9451a2[_0xa681('0x20')](_0x4bf4f2)[_0xa681('0x21')](function(_0x51116d){return _0x51116d;});}return null;};}function removeEntity(_0x552669,_0x56f417){return function(_0xc20ada){if(_0xc20ada){return _0xc20ada[_0xa681('0x22')]()[_0xa681('0x21')](function(){var _0x2c13ac=_0xc20ada[_0xa681('0x23')]({'plain':!![]});var _0x579f36=_0xa681('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x579f36,'resourceId':_0x2c13ac['id']}})[_0xa681('0x21')](function(){return _0xc20ada;});})[_0xa681('0x21')](function(){_0x552669['status'](0xcc)[_0xa681('0x16')]();});}};}function handleEntityNotFound(_0x167c1b,_0x28eaae){return function(_0x4522fe){if(!_0x4522fe){_0x167c1b['sendStatus'](0x194);}return _0x4522fe;};}function handleError(_0x458772,_0x2285da){_0x2285da=_0x2285da||0x1f4;return function(_0x1e7354){logger['error'](_0x1e7354[_0xa681('0x25')]);if(_0x1e7354[_0xa681('0x26')]){delete _0x1e7354[_0xa681('0x26')];}_0x458772[_0xa681('0x15')](_0x2285da)[_0xa681('0x27')](_0x1e7354);};}exports[_0xa681('0x28')]=function(_0x53c0f3,_0x472096){var _0x484355={},_0x55376a={},_0x3032c0={'count':0x0,'rows':[]};var _0x2713d9=_[_0xa681('0x29')](db[_0xa681('0x2a')]['rawAttributes'],function(_0x12766c){return{'name':_0x12766c[_0xa681('0x2b')],'type':_0x12766c['type'][_0xa681('0x2c')]};});_0x55376a[_0xa681('0x2d')]=_[_0xa681('0x29')](_0x2713d9,_0xa681('0x26'));_0x55376a[_0xa681('0x2e')]=_[_0xa681('0x2f')](_0x53c0f3[_0xa681('0x2e')]);_0x55376a[_0xa681('0x30')]=_[_0xa681('0x31')](_0x55376a['model'],_0x55376a[_0xa681('0x2e')]);_0x484355['attributes']=_[_0xa681('0x31')](_0x55376a[_0xa681('0x2d')],qs['fields'](_0x53c0f3['query'][_0xa681('0x32')]));_0x484355[_0xa681('0x33')]=_0x484355[_0xa681('0x33')][_0xa681('0x34')]?_0x484355['attributes']:_0x55376a[_0xa681('0x2d')];if(!_0x53c0f3[_0xa681('0x2e')][_0xa681('0x35')](_0xa681('0x36'))){_0x484355['limit']=qs[_0xa681('0x1a')](_0x53c0f3['query'][_0xa681('0x1a')]);_0x484355['offset']=qs[_0xa681('0x18')](_0x53c0f3[_0xa681('0x2e')][_0xa681('0x18')]);}_0x484355[_0xa681('0x37')]=qs[_0xa681('0x38')](_0x53c0f3['query'][_0xa681('0x38')]);_0x484355[_0xa681('0x39')]=qs[_0xa681('0x30')](_[_0xa681('0x3a')](_0x53c0f3[_0xa681('0x2e')],_0x55376a[_0xa681('0x30')]),_0x2713d9);if(_0x53c0f3['query'][_0xa681('0x3b')]){_0x484355[_0xa681('0x39')]=_['merge'](_0x484355[_0xa681('0x39')],{'$or':_['map'](_0x2713d9,function(_0x11fdfa){if(_0x11fdfa[_0xa681('0x3c')]!==_0xa681('0x3d')){var _0x4c7568={};_0x4c7568[_0x11fdfa[_0xa681('0x26')]]={'$like':'%'+_0x53c0f3['query'][_0xa681('0x3b')]+'%'};return _0x4c7568;}})});}_0x484355=_[_0xa681('0x3e')]({},_0x484355,_0x53c0f3[_0xa681('0x3f')]);var _0x2ee16e={'where':_0x484355['where']};return db[_0xa681('0x2a')][_0xa681('0x1b')](_0x2ee16e)[_0xa681('0x21')](function(_0x3833a1){_0x3032c0[_0xa681('0x1b')]=_0x3833a1;if(_0x53c0f3[_0xa681('0x2e')]['includeAll']){_0x484355[_0xa681('0x40')]=[{'all':!![]}];}return db['Interval'][_0xa681('0x41')](_0x484355);})['then'](function(_0x5c34bd){_0x3032c0[_0xa681('0x42')]=_0x5c34bd;return _0x3032c0;})[_0xa681('0x21')](respondWithFilteredResult(_0x472096,_0x484355))['catch'](handleError(_0x472096,null));};exports['show']=function(_0x47d637,_0x134d23){var _0x481150={'raw':!![],'where':{'id':_0x47d637[_0xa681('0x43')]['id']}},_0x1edac1={};_0x1edac1['model']=_[_0xa681('0x2f')](db[_0xa681('0x2a')][_0xa681('0x44')]);_0x1edac1[_0xa681('0x2e')]=_[_0xa681('0x2f')](_0x47d637[_0xa681('0x2e')]);_0x1edac1['filters']=_[_0xa681('0x31')](_0x1edac1['model'],_0x1edac1['query']);_0x481150['attributes']=_['intersection'](_0x1edac1[_0xa681('0x2d')],qs[_0xa681('0x32')](_0x47d637[_0xa681('0x2e')]['fields']));_0x481150[_0xa681('0x33')]=_0x481150['attributes'][_0xa681('0x34')]?_0x481150['attributes']:_0x1edac1[_0xa681('0x2d')];if(_0x47d637[_0xa681('0x2e')][_0xa681('0x45')]){_0x481150['include']=[{'all':!![]}];}_0x481150=_[_0xa681('0x3e')]({},_0x481150,_0x47d637[_0xa681('0x3f')]);return db[_0xa681('0x2a')][_0xa681('0x46')](_0x481150)['then'](handleEntityNotFound(_0x134d23,null))['then'](respondWithResult(_0x134d23,null))[_0xa681('0x47')](handleError(_0x134d23,null));};exports[_0xa681('0x48')]=function(_0x40ed94,_0x1e262e){return db[_0xa681('0x2a')][_0xa681('0x48')](_0x40ed94[_0xa681('0x49')],{})['then'](function(_0x634ae5){var _0x1742b0=_0x40ed94[_0xa681('0x4a')][_0xa681('0x23')]({'plain':!![]});if(!_0x1742b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1742b0[_0xa681('0x4b')]===_0xa681('0x4a')){var _0x27c636=_0x634ae5[_0xa681('0x23')]({'plain':!![]});var _0x42edc1=_0xa681('0x24');return db[_0xa681('0x4c')][_0xa681('0x46')]({'where':{'name':_0x42edc1,'userProfileId':_0x1742b0[_0xa681('0x4d')]},'raw':!![]})['then'](function(_0x454e86){if(_0x454e86&&_0x454e86[_0xa681('0x4e')]===0x0){return db['UserProfileResource'][_0xa681('0x48')]({'name':_0x27c636[_0xa681('0x26')],'resourceId':_0x27c636['id'],'type':_0x454e86['name'],'sectionId':_0x454e86['id']},{})[_0xa681('0x21')](function(){return _0x634ae5;});}else{return _0x634ae5;}})[_0xa681('0x47')](function(_0x53fd61){logger[_0xa681('0x4f')](_0xa681('0x50'),_0x53fd61);throw _0x53fd61;});}return _0x634ae5;})[_0xa681('0x21')](respondWithResult(_0x1e262e,0xc9))[_0xa681('0x47')](handleError(_0x1e262e,null));};exports[_0xa681('0x20')]=function(_0x51eb6e,_0xc9711a){if(_0x51eb6e[_0xa681('0x49')]['id']){delete _0x51eb6e[_0xa681('0x49')]['id'];}return db[_0xa681('0x2a')][_0xa681('0x46')]({'where':{'id':_0x51eb6e[_0xa681('0x43')]['id']}})[_0xa681('0x21')](handleEntityNotFound(_0xc9711a,null))['then'](saveUpdates(_0x51eb6e[_0xa681('0x49')],null))[_0xa681('0x21')](respondWithResult(_0xc9711a,null))[_0xa681('0x47')](handleError(_0xc9711a,null));};exports[_0xa681('0x22')]=function(_0x473aec,_0x2c9338){return db['Interval']['find']({'where':{'id':_0x473aec[_0xa681('0x43')]['id']}})[_0xa681('0x21')](handleEntityNotFound(_0x2c9338,null))[_0xa681('0x21')](removeEntity(_0x2c9338,null))[_0xa681('0x47')](handleError(_0x2c9338,null));};exports[_0xa681('0x51')]=function(_0x5888bd,_0x423f58,_0x51514e){if(_0x5888bd[_0xa681('0x49')]['id']){delete _0x5888bd[_0xa681('0x49')]['id'];}return db[_0xa681('0x2a')][_0xa681('0x46')]({'where':{'id':_0x5888bd[_0xa681('0x43')]['id']}})['then'](handleEntityNotFound(_0x423f58,null))[_0xa681('0x21')](function(_0x22f479){if(_0x22f479){_0x5888bd[_0xa681('0x49')]['IntervalId']=_0x22f479['id'];return db[_0xa681('0x2a')][_0xa681('0x48')](_0x5888bd[_0xa681('0x49')]);}})[_0xa681('0x21')](respondWithResult(_0x423f58,null))['catch'](handleError(_0x423f58,null));};exports['getIntervals']=function(_0x5112cd,_0x377838,_0x596d9f){var _0x3d6de1={};var _0x5dfebb={};var _0x7669b8;var _0x3f7ee4;return db[_0xa681('0x2a')]['findOne']({'where':{'id':_0x5112cd['params']['id']}})['then'](handleEntityNotFound(_0x377838,null))[_0xa681('0x21')](function(_0x2f92f4){if(_0x2f92f4){_0x7669b8=_0x2f92f4;_0x5dfebb[_0xa681('0x2d')]=_[_0xa681('0x2f')](db[_0xa681('0x2a')][_0xa681('0x44')]);_0x5dfebb[_0xa681('0x2e')]=_[_0xa681('0x2f')](_0x5112cd[_0xa681('0x2e')]);_0x5dfebb['filters']=_[_0xa681('0x31')](_0x5dfebb[_0xa681('0x2d')],_0x5dfebb[_0xa681('0x2e')]);_0x3d6de1[_0xa681('0x33')]=_[_0xa681('0x31')](_0x5dfebb[_0xa681('0x2d')],qs[_0xa681('0x32')](_0x5112cd['query'][_0xa681('0x32')]));_0x3d6de1['attributes']=_0x3d6de1[_0xa681('0x33')][_0xa681('0x34')]?_0x3d6de1[_0xa681('0x33')]:_0x5dfebb['model'];_0x3d6de1[_0xa681('0x37')]=qs[_0xa681('0x38')](_0x5112cd[_0xa681('0x2e')][_0xa681('0x38')]);_0x3d6de1[_0xa681('0x39')]=qs[_0xa681('0x30')](_[_0xa681('0x3a')](_0x5112cd[_0xa681('0x2e')],_0x5dfebb[_0xa681('0x30')]));if(_0x5112cd[_0xa681('0x2e')][_0xa681('0x3b')]){_0x3d6de1[_0xa681('0x39')]=_[_0xa681('0x3e')](_0x3d6de1[_0xa681('0x39')],{'$or':_[_0xa681('0x29')](_0x3d6de1['attributes'],function(_0x1d7219){var _0x16ad35={};_0x16ad35[_0x1d7219]={'$like':'%'+_0x5112cd[_0xa681('0x2e')]['filter']+'%'};return _0x16ad35;})});}_0x3d6de1=_[_0xa681('0x3e')]({},_0x3d6de1,_0x5112cd[_0xa681('0x3f')]);return _0x7669b8['getIntervals'](_0x3d6de1);}})['then'](function(_0x4bf9a7){if(_0x4bf9a7){_0x3f7ee4=_0x4bf9a7['length'];if(!_0x5112cd[_0xa681('0x2e')][_0xa681('0x35')](_0xa681('0x36'))){_0x3d6de1[_0xa681('0x1a')]=qs[_0xa681('0x1a')](_0x5112cd[_0xa681('0x2e')][_0xa681('0x1a')]);_0x3d6de1['offset']=qs[_0xa681('0x18')](_0x5112cd[_0xa681('0x2e')][_0xa681('0x18')]);}return _0x7669b8[_0xa681('0x52')](_0x3d6de1);}})[_0xa681('0x21')](function(_0xa96d08){if(_0xa96d08){return _0xa96d08?{'count':_0x3f7ee4,'rows':_0xa96d08}:null;}})[_0xa681('0x21')](respondWithResult(_0x377838,null))['catch'](handleError(_0x377838,null));};exports['addIntervals']=function(_0x117485,_0x30f853,_0x1fce21){return db[_0xa681('0x2a')][_0xa681('0x53')]({'where':{'id':_0x117485[_0xa681('0x43')]['id']}})['then'](handleEntityNotFound(_0x30f853,null))[_0xa681('0x21')](function(_0x5ba49b){if(_0x5ba49b){return db[_0xa681('0x54')][_0xa681('0x55')](function(_0x4bcb50){return db[_0xa681('0x2a')][_0xa681('0x22')]({'where':{'IntervalId':_0x117485[_0xa681('0x43')]['id']},'transaction':_0x4bcb50})['then'](function(_0x5eba8a){var _0x520e00=_[_0xa681('0x29')](_0x117485['body'],function(_0xe80cbb){delete _0xe80cbb['id'];_0xe80cbb[_0xa681('0x56')]=_0x117485['params']['id'];return _0xe80cbb;});return db[_0xa681('0x2a')][_0xa681('0x57')](_0x520e00,{'transaction':_0x4bcb50});});})[_0xa681('0x21')](function(){return db[_0xa681('0x2a')][_0xa681('0x41')]({'where':{'IntervalId':_0x117485['params']['id']}});});}})[_0xa681('0x21')](respondWithResult(_0x30f853,null))['catch'](handleError(_0x30f853,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 55fa5ce..9ca1210 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 _0xd4bd=['moment','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','tools_intervals','rewrite','lodash','../../config/logger','api'];(function(_0x381413,_0xc62fa4){var _0x485621=function(_0x2aa7e9){while(--_0x2aa7e9){_0x381413['push'](_0x381413['shift']());}};_0x485621(++_0xc62fa4);}(_0xd4bd,0x19d));var _0xdd4b=function(_0x3a968c,_0x2cb691){_0x3a968c=_0x3a968c-0x0;var _0x1acf4a=_0xd4bd[_0x3a968c];return _0x1acf4a;};'use strict';var _=require(_0xdd4b('0x0'));var util=require('util');var logger=require(_0xdd4b('0x1'))(_0xdd4b('0x2'));var moment=require(_0xdd4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xdd4b('0x4'));var fs=require('fs');var path=require(_0xdd4b('0x5'));var rimraf=require(_0xdd4b('0x6'));var config=require(_0xdd4b('0x7'));var attributes=require(_0xdd4b('0x8'));var extensions=require('../../components/extensions/rewrite');module[_0xdd4b('0x9')]=function(_0xf6fd9b,_0x4ec6b1){return _0xf6fd9b[_0xdd4b('0xa')]('Interval',attributes,{'tableName':_0xdd4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4811b8,_0x14cf27){extensions[_0xdd4b('0xc')](_0xf6fd9b,_0x4811b8);},'afterBulkCreate':function(_0x579a47,_0x3a73bd,_0x5074ba){_0x5074ba();extensions['rewrite'](_0xf6fd9b,_0x579a47[0x0]);},'afterUpdate':function(_0x588544,_0x2f308d){extensions['rewrite'](_0xf6fd9b,_0x588544);},'afterDestroy':function(_0x51928c,_0x978d65){extensions['rewrite'](_0xf6fd9b,_0x51928c);}}});}; \ No newline at end of file +var _0x0c01=['rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','api','request-promise','path'];(function(_0x3695c0,_0x19db2d){var _0x34a466=function(_0x17d996){while(--_0x17d996){_0x3695c0['push'](_0x3695c0['shift']());}};_0x34a466(++_0x19db2d);}(_0x0c01,0x10f));var _0x10c0=function(_0x4b7054,_0x195e0b){_0x4b7054=_0x4b7054-0x0;var _0x164945=_0x0c01[_0x4b7054];return _0x164945;};'use strict';var _=require(_0x10c0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x10c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x10c0('0x2'));var fs=require('fs');var path=require(_0x10c0('0x3'));var rimraf=require(_0x10c0('0x4'));var config=require(_0x10c0('0x5'));var attributes=require(_0x10c0('0x6'));var extensions=require(_0x10c0('0x7'));module[_0x10c0('0x8')]=function(_0x4db8c1,_0x120b8c){return _0x4db8c1['define'](_0x10c0('0x9'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x303e51,_0x3212e5){extensions[_0x10c0('0xa')](_0x4db8c1,_0x303e51);},'afterBulkCreate':function(_0x19fa55,_0xe93678,_0x2f9b58){_0x2f9b58();extensions[_0x10c0('0xa')](_0x4db8c1,_0x19fa55[0x0]);},'afterUpdate':function(_0x5c84d3,_0x85125b){extensions[_0x10c0('0xa')](_0x4db8c1,_0x5c84d3);},'afterDestroy':function(_0x55a3ec,_0x4be5df){extensions['rewrite'](_0x4db8c1,_0x55a3ec);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index df4cc0a..9230a82 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(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 772d514..8745f83 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x37134f,_0x1958a8){var _0x3848b1=function(_0x2a911c){while(--_0x2a911c){_0x37134f['push'](_0x37134f['shift']());}};_0x3848b1(++_0x1958a8);}(_0x2ef3,0xba));var _0x32ef=function(_0x46c4d1,_0x20a961){_0x46c4d1=_0x46c4d1-0x0;var _0x17b4f9=_0x2ef3[_0x46c4d1];return _0x17b4f9;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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 bdb6207..8b376f5 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 _0xfd85=['3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','api'];(function(_0x1be5f8,_0x12493f){var _0x517434=function(_0x2f8ddb){while(--_0x2f8ddb){_0x1be5f8['push'](_0x1be5f8['shift']());}};_0x517434(++_0x12493f);}(_0xfd85,0xe3));var _0x5fd8=function(_0x534deb,_0x21de0c){_0x534deb=_0x534deb-0x0;var _0x1b3238=_0xfd85[_0x534deb];return _0x1b3238;};'use strict';var BPromise=require('bluebird');var https=require(_0x5fd8('0x0'));var logger=require(_0x5fd8('0x1'))(_0x5fd8('0x2'));var USERNAME='support';var PASSWORD=_0x5fd8('0x3');function openIssue(_0x42e5ea,_0x2811fb){var _0x21a205={'fields':{'project':{'key':_0x42e5ea[_0x5fd8('0x4')]||'MOTGUI'},'summary':(_0x42e5ea[_0x5fd8('0x5')]||_0x5fd8('0x6'))+_0x5fd8('0x7')+_0x42e5ea['ip'],'description':_0x42e5ea[_0x5fd8('0x8')]||JSON[_0x5fd8('0x9')](_0x42e5ea),'issuetype':{'name':_0x42e5ea[_0x5fd8('0xa')]||'Bug'}}};_0x21a205[_0x5fd8('0xb')][_0x5fd8('0xc')]=_0x42e5ea[_0x5fd8('0xd')];_0x21a205[_0x5fd8('0xb')][_0x5fd8('0xe')]=_0x42e5ea[_0x5fd8('0xf')];_0x21a205[_0x5fd8('0xb')]['customfield_11502']=_0x42e5ea[_0x5fd8('0x10')];_0x21a205['fields'][_0x5fd8('0x11')]=_0x42e5ea[_0x5fd8('0x12')];_0x21a205[_0x5fd8('0xb')][_0x5fd8('0x13')]=_0x42e5ea[_0x5fd8('0x14')];_0x21a205['fields'][_0x5fd8('0x15')]=_0x42e5ea['ip'];var _0x12c193={'host':_0x5fd8('0x16'),'port':0x1bb,'path':_0x5fd8('0x17'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x5fd8('0x18'),'Authorization':_0x5fd8('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x5fd8('0x1a')](_0x5fd8('0x1b'))}};var _0x3300fa=JSON['stringify'](_0x21a205);var _0x4f99ef=https[_0x5fd8('0x1c')](_0x12c193,function(_0x2c19a7){_0x2c19a7[_0x5fd8('0x1d')](_0x5fd8('0x1e'));var _0x45ddb3='';_0x2c19a7['on'](_0x5fd8('0x1f'),function(_0x4c016a){_0x45ddb3+=_0x4c016a;});_0x2c19a7['on'](_0x5fd8('0x20'),function(){if(_0x2811fb){return _0x2811fb['status'](_0x2c19a7[_0x5fd8('0x21')])[_0x5fd8('0x22')](JSON[_0x5fd8('0x23')](_0x45ddb3));}});});_0x4f99ef['on']('error',function(_0x53a047){if(_0x2811fb){return _0x2811fb['status'](0x1f4)[_0x5fd8('0x22')]({'errors':[{'message':_0x5fd8('0x24'),'type':'api.jira'}]});}});_0x4f99ef[_0x5fd8('0x25')](_0x3300fa);_0x4f99ef[_0x5fd8('0x20')]();}exports[_0x5fd8('0x26')]=openIssue;exports[_0x5fd8('0x27')]=function(_0x5e0074,_0x41a1c0){_0x5e0074[_0x5fd8('0x28')]['ip']=_0x5e0074[_0x5fd8('0x29')][_0x5fd8('0x2a')]||_0x5e0074[_0x5fd8('0x2b')][_0x5fd8('0x2c')]||_0x5e0074[_0x5fd8('0x2d')][_0x5fd8('0x2c')]||_0x5e0074[_0x5fd8('0x2b')][_0x5fd8('0x2d')][_0x5fd8('0x2c')];return openIssue(_0x5e0074[_0x5fd8('0x28')],_0x41a1c0);}; \ No newline at end of file +var _0x5786=['end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','headers','remoteAddress','connection','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','fields','customfield_11500','email','oldToken','customfield_11502','newToken','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','base64','request','utf8','data'];(function(_0x1a0eb8,_0x302873){var _0x37fb88=function(_0x17cd03){while(--_0x17cd03){_0x1a0eb8['push'](_0x1a0eb8['shift']());}};_0x37fb88(++_0x302873);}(_0x5786,0x16e));var _0x6578=function(_0x2293fa,_0x253ed5){_0x2293fa=_0x2293fa-0x0;var _0x396aca=_0x5786[_0x2293fa];return _0x396aca;};'use strict';var BPromise=require(_0x6578('0x0'));var https=require(_0x6578('0x1'));var logger=require(_0x6578('0x2'))(_0x6578('0x3'));var USERNAME=_0x6578('0x4');var PASSWORD=_0x6578('0x5');function openIssue(_0x355424,_0x593b72){var _0x5db89e={'fields':{'project':{'key':_0x355424[_0x6578('0x6')]||_0x6578('0x7')},'summary':(_0x355424['summary']||_0x6578('0x8'))+_0x6578('0x9')+_0x355424['ip'],'description':_0x355424[_0x6578('0xa')]||JSON[_0x6578('0xb')](_0x355424),'issuetype':{'name':_0x355424['issuetype']||'Bug'}}};_0x5db89e[_0x6578('0xc')][_0x6578('0xd')]=_0x355424[_0x6578('0xe')];_0x5db89e[_0x6578('0xc')]['customfield_11501']=_0x355424[_0x6578('0xf')];_0x5db89e[_0x6578('0xc')][_0x6578('0x10')]=_0x355424[_0x6578('0x11')];_0x5db89e[_0x6578('0xc')]['customfield_11503']=_0x355424[_0x6578('0x12')];_0x5db89e[_0x6578('0xc')]['customfield_11504']=_0x355424[_0x6578('0x13')];_0x5db89e[_0x6578('0xc')][_0x6578('0x14')]=_0x355424['ip'];var _0xefbaaf={'host':_0x6578('0x15'),'port':0x1bb,'path':_0x6578('0x16'),'method':_0x6578('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x6578('0x18'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6578('0x19')](_0x6578('0x1a'))}};var _0x49d5c8=JSON[_0x6578('0xb')](_0x5db89e);var _0x625550=https[_0x6578('0x1b')](_0xefbaaf,function(_0x2f6089){_0x2f6089['setEncoding'](_0x6578('0x1c'));var _0x466004='';_0x2f6089['on'](_0x6578('0x1d'),function(_0x4199d5){_0x466004+=_0x4199d5;});_0x2f6089['on'](_0x6578('0x1e'),function(){if(_0x593b72){return _0x593b72[_0x6578('0x1f')](_0x2f6089[_0x6578('0x20')])[_0x6578('0x21')](JSON[_0x6578('0x22')](_0x466004));}});});_0x625550['on'](_0x6578('0x23'),function(_0x112861){if(_0x593b72){return _0x593b72[_0x6578('0x1f')](0x1f4)[_0x6578('0x21')]({'errors':[{'message':_0x6578('0x24'),'type':_0x6578('0x25')}]});}});_0x625550[_0x6578('0x26')](_0x49d5c8);_0x625550['end']();}exports[_0x6578('0x27')]=openIssue;exports['send']=function(_0x8a4168,_0x51a4be){_0x8a4168['body']['ip']=_0x8a4168[_0x6578('0x28')]['x-forwarded-for']||_0x8a4168['connection']['remoteAddress']||_0x8a4168['socket'][_0x6578('0x29')]||_0x8a4168[_0x6578('0x2a')][_0x6578('0x2b')][_0x6578('0x29')];return openIssue(_0x8a4168['body'],_0x51a4be);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 6005faa..08362e7 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 _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17ba,0xab));var _0xa17b=function(_0x49afb5,_0x5cc3da){_0x49afb5=_0x49afb5-0x0;var _0x1f0a98=_0x17ba[_0x49afb5];return _0x1f0a98;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file +var _0xfd28=['show','put','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xfd28,0x148));var _0x8fd2=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0xfd28[_0x2272b5];return _0x110156;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xd')]('/:id',auth[_0x8fd2('0x8')](),controller['update']);router[_0x8fd2('0xe')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0xf')]);module[_0x8fd2('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 2401685..5facaab 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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x19932a,_0x9251e7){_0x19932a=_0x19932a-0x0;var _0x5dca9a=_0x7a54[_0x19932a];return _0x5dca9a;};'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(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x397a3f,_0x261479){_0x397a3f=_0x397a3f-0x0;var _0x45c155=_0x7a54[_0x397a3f];return _0x45c155;};'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 e9be450..bec0027 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 _0xeda8=['Content-Range','apply','reject','update','then','stack','name','send','index','map','JscriptyAnswerReport','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','destroy','describe','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'];(function(_0x35ab09,_0x46b085){var _0x129b75=function(_0x1c0a7d){while(--_0x1c0a7d){_0x35ab09['push'](_0x35ab09['shift']());}};_0x129b75(++_0x46b085);}(_0xeda8,0x104));var _0x8eda=function(_0x345495,_0x1e9e1c){_0x345495=_0x345495-0x0;var _0x237bd9=_0xeda8[_0x345495];return _0x237bd9;};'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['create']=function(_0xcde3e,_0x52b026){return db[_0x8eda('0x2a')]['create'](_0xcde3e[_0x8eda('0x46')],{})['then'](respondWithResult(_0x52b026,0xc9))[_0x8eda('0x40')](handleError(_0x52b026,null));};exports[_0x8eda('0x23')]=function(_0xf445,_0x395f5a){if(_0xf445[_0x8eda('0x46')]['id']){delete _0xf445[_0x8eda('0x46')]['id'];}return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'id':_0xf445[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x395f5a,null))[_0x8eda('0x24')](saveUpdates(_0xf445[_0x8eda('0x46')],null))['then'](respondWithResult(_0x395f5a,null))[_0x8eda('0x40')](handleError(_0x395f5a,null));};exports[_0x8eda('0x47')]=function(_0x25b1eb,_0x3259de){return db[_0x8eda('0x2a')][_0x8eda('0x45')]({'where':{'id':_0x25b1eb[_0x8eda('0x42')]['id']}})[_0x8eda('0x24')](handleEntityNotFound(_0x3259de,null))[_0x8eda('0x24')](removeEntity(_0x3259de,null))[_0x8eda('0x40')](handleError(_0x3259de,null));};exports[_0x8eda('0x48')]=function(_0x370ec2,_0x1c5e12){return db[_0x8eda('0x2a')][_0x8eda('0x48')]()['then'](respondWithResult(_0x1c5e12,null))[_0x8eda('0x40')](handleError(_0x1c5e12,null));}; \ No newline at end of file +var _0xa1f6=['error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0xa1f6[_0x485f35];return _0x2ad118;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['JscriptyAnswerReport'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['JscriptyAnswerReport'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 3c183e8..a02a469 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 _0x2f55=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define'];(function(_0x4c2a93,_0x5324a4){var _0x4847b4=function(_0xf50c3d){while(--_0xf50c3d){_0x4c2a93['push'](_0x4c2a93['shift']());}};_0x4847b4(++_0x5324a4);}(_0x2f55,0xfe));var _0x52f5=function(_0x4d89fe,_0x458af3){_0x4d89fe=_0x4d89fe-0x0;var _0x4a6944=_0x2f55[_0x4d89fe];return _0x4a6944;};'use strict';var _=require(_0x52f5('0x0'));var util=require(_0x52f5('0x1'));var logger=require('../../config/logger')(_0x52f5('0x2'));var moment=require(_0x52f5('0x3'));var BPromise=require(_0x52f5('0x4'));var rp=require(_0x52f5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52f5('0x6'));var config=require(_0x52f5('0x7'));var attributes=require(_0x52f5('0x8'));module['exports']=function(_0x134052,_0x3090d9){return _0x134052[_0x52f5('0x9')](_0x52f5('0xa'),attributes,{'tableName':_0x52f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42a7=['report_jscripty_answers','util','../../config/logger','moment','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x428678,_0x38e947){var _0x5c4e66=function(_0x2707ab){while(--_0x2707ab){_0x428678['push'](_0x428678['shift']());}};_0x5c4e66(++_0x38e947);}(_0x42a7,0x191));var _0x742a=function(_0x2bd8e5,_0x113d99){_0x2bd8e5=_0x2bd8e5-0x0;var _0x5b0230=_0x42a7[_0x2bd8e5];return _0x5b0230;};'use strict';var _=require('lodash');var util=require(_0x742a('0x0'));var logger=require(_0x742a('0x1'))('api');var moment=require(_0x742a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x742a('0x3'));var rimraf=require('rimraf');var config=require(_0x742a('0x4'));var attributes=require(_0x742a('0x5'));module[_0x742a('0x6')]=function(_0x16c949,_0x2f3522){return _0x16c949[_0x742a('0x7')](_0x742a('0x8'),attributes,{'tableName':_0x742a('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 dd8c2a8..8693544 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 _0xcc23=['rpc','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1062e3,_0x49349e){var _0x92e616=function(_0x1ca4fe){while(--_0x1ca4fe){_0x1062e3['push'](_0x1062e3['shift']());}};_0x92e616(++_0x49349e);}(_0xcc23,0x1ec));var _0x3cc2=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xcc23[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x3cc2('0x0'));var util=require(_0x3cc2('0x1'));var moment=require(_0x3cc2('0x2'));var BPromise=require(_0x3cc2('0x3'));var rs=require(_0x3cc2('0x4'));var fs=require('fs');var Redis=require(_0x3cc2('0x5'));var db=require(_0x3cc2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cc2('0x7'))(_0x3cc2('0x8'));var config=require('../../config/environment');var jayson=require(_0x3cc2('0x9'));var client=jayson[_0x3cc2('0xa')][_0x3cc2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3589f3,_0x10cd29,_0x4df071){return new BPromise(function(_0x306c13,_0x156ddf){return client['request'](_0x3589f3,_0x4df071)['then'](function(_0x32aa74){logger[_0x3cc2('0xc')](_0x3cc2('0xd'),_0x10cd29,_0x3cc2('0xe'));logger[_0x3cc2('0xf')](_0x3cc2('0x10'),_0x10cd29,_0x3cc2('0xe'),JSON['stringify'](_0x32aa74));if(_0x32aa74[_0x3cc2('0x11')]){if(_0x32aa74[_0x3cc2('0x11')]['code']===0x1f4){logger[_0x3cc2('0x11')](_0x3cc2('0xd'),_0x10cd29,_0x32aa74['error'][_0x3cc2('0x12')]);return _0x156ddf(_0x32aa74['error'][_0x3cc2('0x12')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x10cd29,_0x32aa74[_0x3cc2('0x11')][_0x3cc2('0x12')]);return _0x306c13(_0x32aa74[_0x3cc2('0x11')][_0x3cc2('0x12')]);}else{logger[_0x3cc2('0xc')](_0x3cc2('0xd'),_0x10cd29,_0x3cc2('0xe'));_0x306c13(_0x32aa74[_0x3cc2('0x13')]['message']);}})['catch'](function(_0x3f3ffd){logger[_0x3cc2('0x11')](_0x3cc2('0xd'),_0x10cd29,_0x3f3ffd);_0x156ddf(_0x3f3ffd);});});} \ No newline at end of file +var _0x0d6d=['jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3e3ced,_0xa61727){var _0x186f7d=function(_0x44c6d3){while(--_0x44c6d3){_0x3e3ced['push'](_0x3e3ced['shift']());}};_0x186f7d(++_0xa61727);}(_0x0d6d,0xff));var _0xd0d6=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x0d6d[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xd0d6('0x0'));var util=require(_0xd0d6('0x1'));var moment=require(_0xd0d6('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0d6('0x3'));var fs=require('fs');var Redis=require(_0xd0d6('0x4'));var db=require(_0xd0d6('0x5'))['db'];var utils=require(_0xd0d6('0x6'));var logger=require('../../config/logger')(_0xd0d6('0x7'));var config=require(_0xd0d6('0x8'));var jayson=require(_0xd0d6('0x9'));var client=jayson[_0xd0d6('0xa')][_0xd0d6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5822cd,_0x481ddb,_0x41a778){return new BPromise(function(_0x25b977,_0x517e5a){return client[_0xd0d6('0xc')](_0x5822cd,_0x41a778)[_0xd0d6('0xd')](function(_0x41200e){logger[_0xd0d6('0xe')](_0xd0d6('0xf'),_0x481ddb,_0xd0d6('0x10'));logger[_0xd0d6('0x11')](_0xd0d6('0x12'),_0x481ddb,'request\x20sent',JSON['stringify'](_0x41200e));if(_0x41200e[_0xd0d6('0x13')]){if(_0x41200e['error'][_0xd0d6('0x14')]===0x1f4){logger[_0xd0d6('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x481ddb,_0x41200e[_0xd0d6('0x13')]['message']);return _0x517e5a(_0x41200e[_0xd0d6('0x13')][_0xd0d6('0x15')]);}logger['error'](_0xd0d6('0xf'),_0x481ddb,_0x41200e[_0xd0d6('0x13')][_0xd0d6('0x15')]);return _0x25b977(_0x41200e[_0xd0d6('0x13')]['message']);}else{logger[_0xd0d6('0xe')](_0xd0d6('0xf'),_0x481ddb,_0xd0d6('0x10'));_0x25b977(_0x41200e[_0xd0d6('0x16')][_0xd0d6('0x15')]);}})[_0xd0d6('0x17')](function(_0x4bcf21){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x481ddb,_0x4bcf21);_0x517e5a(_0x4bcf21);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index bdb450d..0be2177 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 _0x39fa=['create','/:id/clone','clone','put','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','getSummary','post'];(function(_0x2d3e76,_0x12816b){var _0x4dfef1=function(_0x25efaa){while(--_0x25efaa){_0x2d3e76['push'](_0x2d3e76['shift']());}};_0x4dfef1(++_0x12816b);}(_0x39fa,0xd7));var _0xa39f=function(_0x4f7bad,_0x4b3603){_0x4f7bad=_0x4f7bad-0x0;var _0x20f248=_0x39fa[_0x4f7bad];return _0x20f248;};'use strict';var multer=require('multer');var util=require(_0xa39f('0x0'));var path=require(_0xa39f('0x1'));var timeout=require(_0xa39f('0x2'));var express=require(_0xa39f('0x3'));var router=express['Router']();var fs_extra=require(_0xa39f('0x4'));var auth=require(_0xa39f('0x5'));var interaction=require(_0xa39f('0x6'));var config=require(_0xa39f('0x7'));var controller=require('./jscriptyProject.controller');router[_0xa39f('0x8')]('/',auth[_0xa39f('0x9')](),controller[_0xa39f('0xa')]);router[_0xa39f('0x8')](_0xa39f('0xb'),auth[_0xa39f('0x9')](),controller[_0xa39f('0xc')]);router[_0xa39f('0x8')](_0xa39f('0xd'),auth['isAuthenticated'](),controller[_0xa39f('0xe')]);router[_0xa39f('0x8')](_0xa39f('0xf'),auth[_0xa39f('0x9')](),controller[_0xa39f('0x10')]);router[_0xa39f('0x8')]('/:id/summary',auth[_0xa39f('0x9')](),timeout('30s'),controller[_0xa39f('0x11')]);router[_0xa39f('0x12')]('/',auth[_0xa39f('0x9')](),controller[_0xa39f('0x13')]);router[_0xa39f('0x12')](_0xa39f('0x14'),auth['isAuthenticated'](),controller[_0xa39f('0x15')]);router[_0xa39f('0x16')](_0xa39f('0xb'),auth[_0xa39f('0x9')](),controller[_0xa39f('0x17')]);router['delete'](_0xa39f('0xb'),auth['isAuthenticated'](),controller[_0xa39f('0x18')]);module[_0xa39f('0x19')]=router; \ No newline at end of file +var _0xe11b=['../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','30s','getSummary','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe11b,0x131));var _0xbe11=function(_0x43db5c,_0x5cc48b){_0x43db5c=_0x43db5c-0x0;var _0x1f794d=_0xe11b[_0x43db5c];return _0x1f794d;};'use strict';var multer=require(_0xbe11('0x0'));var util=require(_0xbe11('0x1'));var path=require(_0xbe11('0x2'));var timeout=require(_0xbe11('0x3'));var express=require(_0xbe11('0x4'));var router=express['Router']();var fs_extra=require(_0xbe11('0x5'));var auth=require(_0xbe11('0x6'));var interaction=require(_0xbe11('0x7'));var config=require('../../config/environment');var controller=require(_0xbe11('0x8'));router[_0xbe11('0x9')]('/',auth[_0xbe11('0xa')](),controller[_0xbe11('0xb')]);router[_0xbe11('0x9')](_0xbe11('0xc'),auth[_0xbe11('0xa')](),controller[_0xbe11('0xd')]);router[_0xbe11('0x9')](_0xbe11('0xe'),auth[_0xbe11('0xa')](),controller[_0xbe11('0xf')]);router['get'](_0xbe11('0x10'),auth[_0xbe11('0xa')](),controller['getAnswers']);router[_0xbe11('0x9')]('/:id/summary',auth[_0xbe11('0xa')](),timeout(_0xbe11('0x11')),controller[_0xbe11('0x12')]);router[_0xbe11('0x13')]('/',auth[_0xbe11('0xa')](),controller[_0xbe11('0x14')]);router[_0xbe11('0x13')]('/:id/clone',auth[_0xbe11('0xa')](),controller['clone']);router['put'](_0xbe11('0xc'),auth['isAuthenticated'](),controller[_0xbe11('0x15')]);router['delete'](_0xbe11('0xc'),auth[_0xbe11('0xa')](),controller[_0xbe11('0x16')]);module[_0xbe11('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6320af2..5eaf48c 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 _0x454e=['STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','lodash','util','exports'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0x454e,0xc0));var _0xe454=function(_0x2d11dd,_0x59302d){_0x2d11dd=_0x2d11dd-0x0;var _0x25ccc1=_0x454e[_0x2d11dd];return _0x25ccc1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xe454('0x0'));var util=require(_0xe454('0x1'));module[_0xe454('0x2')]={'name':{'type':Sequelize[_0xe454('0x3')],'unique':'name'},'description':{'type':Sequelize[_0xe454('0x3')]},'formData':{'type':Sequelize[_0xe454('0x4')](_0xe454('0x5')),'set':function(_0xf23b49){if(_[_0xe454('0x6')](_0xf23b49)){this[_0xe454('0x7')]('formData',JSON[_0xe454('0x8')](_0xf23b49));}else if(_[_0xe454('0x9')](_0xf23b49)){this[_0xe454('0x7')](_0xe454('0xa'),_0xf23b49);}else{this[_0xe454('0x7')](_0xe454('0xa'),util['format'](_0xe454('0xb'),this[_0xe454('0xc')](_0xe454('0xd'))||'',this[_0xe454('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xe454('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x554b=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','STRING','TEXT','long','setDataValue','formData','isString'];(function(_0x201c5c,_0xa23c7b){var _0x234033=function(_0x1372a5){while(--_0x1372a5){_0x201c5c['push'](_0x201c5c['shift']());}};_0x234033(++_0xa23c7b);}(_0x554b,0x1d9));var _0xb554=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x554b[_0x3740fe];return _0x55492b;};'use strict';var Sequelize=require(_0xb554('0x0'));var _=require(_0xb554('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0xb554('0x2')],'unique':'name'},'description':{'type':Sequelize[_0xb554('0x2')]},'formData':{'type':Sequelize[_0xb554('0x3')](_0xb554('0x4')),'set':function(_0x2ddf68){if(_['isObjectLike'](_0x2ddf68)){this[_0xb554('0x5')](_0xb554('0x6'),JSON['stringify'](_0x2ddf68));}else if(_[_0xb554('0x7')](_0x2ddf68)){this['setDataValue'](_0xb554('0x6'),_0x2ddf68);}else{this['setDataValue'](_0xb554('0x6'),util['format'](_0xb554('0x8'),this[_0xb554('0x9')](_0xb554('0xa'))||'',this[_0xb554('0x9')](_0xb554('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb554('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 0bbab5b..f5b32fe 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 _0x7d80=['toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','apply','save','then','destroy','error','stack','name','send','index','map','JscriptyProject','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','findAll','rows','catch','show','params','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','includeAll','omit','createdAt','updatedAt','UserProfileSection','getSessions','JscriptySessionReport','pick','ProjectId','filter','getAnswers','JscriptyAnswerReport','number','fromCharCode'];(function(_0x1aaf79,_0x298f15){var _0x12e371=function(_0x245a49){while(--_0x245a49){_0x1aaf79['push'](_0x1aaf79['shift']());}};_0x12e371(++_0x298f15);}(_0x7d80,0x17a));var _0x07d8=function(_0x3fda7a,_0x5b3b30){_0x3fda7a=_0x3fda7a-0x0;var _0x4f5863=_0x7d80[_0x3fda7a];return _0x4f5863;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07d8('0x0'));var zipdir=require(_0x07d8('0x1'));var jsonpatch=require(_0x07d8('0x2'));var rp=require(_0x07d8('0x3'));var moment=require(_0x07d8('0x4'));var BPromise=require(_0x07d8('0x5'));var Mustache=require('mustache');var util=require(_0x07d8('0x6'));var path=require('path');var sox=require(_0x07d8('0x7'));var csv=require(_0x07d8('0x8'));var ejs=require(_0x07d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x07d8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x07d8('0x8'));var querystring=require(_0x07d8('0xb'));var Papa=require('papaparse');var Redis=require(_0x07d8('0xc'));var authService=require(_0x07d8('0xd'));var qs=require(_0x07d8('0xe'));var as=require(_0x07d8('0xf'));var hardwareService=require(_0x07d8('0x10'));var logger=require(_0x07d8('0x11'))(_0x07d8('0x12'));var utils=require('../../config/utils');var config=require(_0x07d8('0x13'));var licenseUtil=require(_0x07d8('0x14'));var db=require(_0x07d8('0x15'))['db'];function respondWithStatusCode(_0x9dbef7,_0x20fb9a){_0x20fb9a=_0x20fb9a||0xcc;return function(_0x14ee4c){if(_0x14ee4c){return _0x9dbef7[_0x07d8('0x16')](_0x20fb9a);}return _0x9dbef7['status'](_0x20fb9a)[_0x07d8('0x17')]();};}function respondWithResult(_0x6d311c,_0x17d24e){_0x17d24e=_0x17d24e||0xc8;return function(_0x584765){if(_0x584765){return _0x6d311c[_0x07d8('0x18')](_0x17d24e)[_0x07d8('0x19')](_0x584765);}};}function respondWithFilteredResult(_0x567f2c,_0x2254c9){return function(_0x1bd568){if(_0x1bd568){var _0x3584aa=typeof _0x2254c9[_0x07d8('0x1a')]===_0x07d8('0x1b')&&typeof _0x2254c9['limit']===_0x07d8('0x1b');var _0x73250c=_0x1bd568['count'];var _0x7fa5f3=_0x3584aa?0x0:_0x2254c9[_0x07d8('0x1a')];var _0x27eb23=_0x3584aa?_0x1bd568[_0x07d8('0x1c')]:_0x2254c9[_0x07d8('0x1a')]+_0x2254c9[_0x07d8('0x1d')];var _0x1fe8b5;if(_0x27eb23>=_0x73250c){_0x27eb23=_0x73250c;_0x1fe8b5=0xc8;}else{_0x1fe8b5=0xce;}_0x567f2c[_0x07d8('0x18')](_0x1fe8b5);return _0x567f2c['set']('Content-Range',_0x7fa5f3+'-'+_0x27eb23+'/'+_0x73250c)[_0x07d8('0x19')](_0x1bd568);}return null;};}function patchUpdates(_0x4fcc4d){return function(_0x5afa12){try{jsonpatch[_0x07d8('0x1e')](_0x5afa12,_0x4fcc4d,!![]);}catch(_0x3f15a9){return BPromise['reject'](_0x3f15a9);}return _0x5afa12[_0x07d8('0x1f')]();};}function saveUpdates(_0x957b5,_0x40a095){return function(_0x33dd51){if(_0x33dd51){return _0x33dd51['update'](_0x957b5)[_0x07d8('0x20')](function(_0x14d8d7){return _0x14d8d7;});}return null;};}function removeEntity(_0x56282d,_0x1dbe70){return function(_0x208bad){if(_0x208bad){return _0x208bad[_0x07d8('0x21')]()[_0x07d8('0x20')](function(){var _0x53f551=_0x208bad['get']({'plain':!![]});var _0x1e87c5='Projects';return db['UserProfileResource'][_0x07d8('0x21')]({'where':{'type':_0x1e87c5,'resourceId':_0x53f551['id']}})[_0x07d8('0x20')](function(){return _0x208bad;});})[_0x07d8('0x20')](function(){_0x56282d[_0x07d8('0x18')](0xcc)[_0x07d8('0x17')]();});}};}function handleEntityNotFound(_0x575390,_0x3993c8){return function(_0x5325ee){if(!_0x5325ee){_0x575390[_0x07d8('0x16')](0x194);}return _0x5325ee;};}function handleError(_0x4d3863,_0x54735c){_0x54735c=_0x54735c||0x1f4;return function(_0x262308){logger[_0x07d8('0x22')](_0x262308[_0x07d8('0x23')]);if(_0x262308[_0x07d8('0x24')]){delete _0x262308[_0x07d8('0x24')];}_0x4d3863['status'](_0x54735c)[_0x07d8('0x25')](_0x262308);};}exports[_0x07d8('0x26')]=function(_0x338639,_0x171f43){var _0x25ed60={},_0x210c5a={},_0x230666={'count':0x0,'rows':[]};var _0x1cd148=_[_0x07d8('0x27')](db[_0x07d8('0x28')]['rawAttributes'],function(_0x355d69){return{'name':_0x355d69[_0x07d8('0x29')],'type':_0x355d69[_0x07d8('0x2a')][_0x07d8('0x2b')]};});_0x210c5a['model']=_['map'](_0x1cd148,_0x07d8('0x24'));_0x210c5a[_0x07d8('0x2c')]=_[_0x07d8('0x2d')](_0x338639[_0x07d8('0x2c')]);_0x210c5a['filters']=_[_0x07d8('0x2e')](_0x210c5a[_0x07d8('0x2f')],_0x210c5a[_0x07d8('0x2c')]);_0x25ed60[_0x07d8('0x30')]=_[_0x07d8('0x2e')](_0x210c5a[_0x07d8('0x2f')],qs[_0x07d8('0x31')](_0x338639[_0x07d8('0x2c')][_0x07d8('0x31')]));_0x25ed60[_0x07d8('0x30')]=_0x25ed60[_0x07d8('0x30')]['length']?_0x25ed60[_0x07d8('0x30')]:_0x210c5a[_0x07d8('0x2f')];if(!_0x338639[_0x07d8('0x2c')][_0x07d8('0x32')](_0x07d8('0x33'))){_0x25ed60[_0x07d8('0x1d')]=qs[_0x07d8('0x1d')](_0x338639[_0x07d8('0x2c')][_0x07d8('0x1d')]);_0x25ed60['offset']=qs[_0x07d8('0x1a')](_0x338639[_0x07d8('0x2c')][_0x07d8('0x1a')]);}_0x25ed60[_0x07d8('0x34')]=qs[_0x07d8('0x35')](_0x338639['query']['sort']);_0x25ed60[_0x07d8('0x36')]=qs[_0x07d8('0x37')](_['pick'](_0x338639[_0x07d8('0x2c')],_0x210c5a[_0x07d8('0x37')]),_0x1cd148);if(_0x338639['query']['filter']){_0x25ed60['where']=_[_0x07d8('0x38')](_0x25ed60[_0x07d8('0x36')],{'$or':_['map'](_0x1cd148,function(_0x2a51af){if(_0x2a51af[_0x07d8('0x2a')]!==_0x07d8('0x39')){var _0x23246e={};_0x23246e[_0x2a51af['name']]={'$like':'%'+_0x338639['query']['filter']+'%'};return _0x23246e;}})});}_0x25ed60=_[_0x07d8('0x38')]({},_0x25ed60,_0x338639[_0x07d8('0x3a')]);var _0x3aaa90={'where':_0x25ed60['where']};return db[_0x07d8('0x28')]['count'](_0x3aaa90)['then'](function(_0x311349){_0x230666[_0x07d8('0x1c')]=_0x311349;if(_0x338639['query']['includeAll']){_0x25ed60['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x07d8('0x3b')](_0x25ed60);})[_0x07d8('0x20')](function(_0x2770d4){_0x230666[_0x07d8('0x3c')]=_0x2770d4;return _0x230666;})[_0x07d8('0x20')](respondWithFilteredResult(_0x171f43,_0x25ed60))[_0x07d8('0x3d')](handleError(_0x171f43,null));};exports[_0x07d8('0x3e')]=function(_0x292231,_0x18db9a){var _0x1d7379={'raw':![],'where':{'id':_0x292231[_0x07d8('0x3f')]['id']}},_0x4e2948={};_0x4e2948['model']=_[_0x07d8('0x2d')](db['JscriptyProject']['rawAttributes']);_0x4e2948['query']=_[_0x07d8('0x2d')](_0x292231[_0x07d8('0x2c')]);_0x4e2948[_0x07d8('0x37')]=_['intersection'](_0x4e2948[_0x07d8('0x2f')],_0x4e2948['query']);_0x1d7379[_0x07d8('0x30')]=_['intersection'](_0x4e2948[_0x07d8('0x2f')],qs['fields'](_0x292231[_0x07d8('0x2c')][_0x07d8('0x31')]));_0x1d7379['attributes']=_0x1d7379[_0x07d8('0x30')][_0x07d8('0x40')]?_0x1d7379['attributes']:_0x4e2948[_0x07d8('0x2f')];if(_0x292231['query']['includeAll']){_0x1d7379[_0x07d8('0x41')]=[{'all':!![]}];}_0x1d7379=_['merge']({},_0x1d7379,_0x292231[_0x07d8('0x3a')]);return db[_0x07d8('0x28')][_0x07d8('0x42')](_0x1d7379)[_0x07d8('0x20')](handleEntityNotFound(_0x18db9a,null))['then'](respondWithResult(_0x18db9a,null))[_0x07d8('0x3d')](handleError(_0x18db9a,null));};exports[_0x07d8('0x43')]=function(_0x4480a5,_0x234ecb){return db[_0x07d8('0x28')][_0x07d8('0x43')](_0x4480a5[_0x07d8('0x44')],{})[_0x07d8('0x20')](function(_0x3e35be){var _0x59444f=_0x4480a5[_0x07d8('0x45')][_0x07d8('0x46')]({'plain':!![]});if(!_0x59444f)throw new Error(_0x07d8('0x47'));if(_0x59444f[_0x07d8('0x48')]===_0x07d8('0x45')){var _0x43ee28=_0x3e35be[_0x07d8('0x46')]({'plain':!![]});var _0x4276c5=_0x07d8('0x49');return db['UserProfileSection'][_0x07d8('0x42')]({'where':{'name':_0x4276c5,'userProfileId':_0x59444f[_0x07d8('0x4a')]},'raw':!![]})[_0x07d8('0x20')](function(_0x417405){if(_0x417405&&_0x417405[_0x07d8('0x4b')]===0x0){return db[_0x07d8('0x4c')][_0x07d8('0x43')]({'name':_0x43ee28[_0x07d8('0x24')],'resourceId':_0x43ee28['id'],'type':_0x417405[_0x07d8('0x24')],'sectionId':_0x417405['id']},{})[_0x07d8('0x20')](function(){return _0x3e35be;});}else{return _0x3e35be;}})[_0x07d8('0x3d')](function(_0x204f7a){logger['error'](_0x07d8('0x4d'),_0x204f7a);throw _0x204f7a;});}return _0x3e35be;})[_0x07d8('0x20')](respondWithResult(_0x234ecb,0xc9))[_0x07d8('0x3d')](handleError(_0x234ecb,null));};exports[_0x07d8('0x4e')]=function(_0x3d17ab,_0x5bd980){var _0x28ac8a={'where':{'id':_0x3d17ab[_0x07d8('0x3f')]['id']}},_0x506fd7={};_0x506fd7[_0x07d8('0x2f')]=_['keys'](db[_0x07d8('0x28')][_0x07d8('0x4f')]);_0x28ac8a[_0x07d8('0x30')]=_[_0x07d8('0x2e')](_0x506fd7[_0x07d8('0x2f')],qs['fields'](_0x3d17ab[_0x07d8('0x2c')]['fields']));_0x28ac8a['attributes']=_0x28ac8a[_0x07d8('0x30')]['length']?_0x28ac8a[_0x07d8('0x30')]:_0x506fd7[_0x07d8('0x2f')];if(_0x3d17ab[_0x07d8('0x2c')][_0x07d8('0x50')]){_0x28ac8a['include']=[{'all':!![]}];}_0x28ac8a=_[_0x07d8('0x38')]({},_0x28ac8a,_0x3d17ab[_0x07d8('0x3a')]);return db[_0x07d8('0x28')][_0x07d8('0x42')](_0x28ac8a)[_0x07d8('0x20')](handleEntityNotFound(_0x5bd980,null))[_0x07d8('0x20')](function(_0x2f03bd){if(_0x2f03bd){var _0x59785c=_0x2f03bd[_0x07d8('0x46')]({'plain':!![]});_0x59785c=qs[_0x07d8('0x51')](_0x59785c,['id',_0x07d8('0x52'),_0x07d8('0x53')]);_0x3d17ab[_0x07d8('0x44')]=_['omit'](_0x3d17ab[_0x07d8('0x44')],['id','createdAt','updatedAt']);return db[_0x07d8('0x28')][_0x07d8('0x43')](_[_0x07d8('0x38')](_0x59785c,_0x3d17ab['body']),{'include':_0x3d17ab[_0x07d8('0x2c')][_0x07d8('0x50')]?[{'all':!![]}]:undefined})[_0x07d8('0x20')](function(_0x323e5d){var _0x3c7aef=_0x3d17ab[_0x07d8('0x45')][_0x07d8('0x46')]({'plain':!![]});if(!_0x3c7aef)throw new Error(_0x07d8('0x47'));if(_0x3c7aef[_0x07d8('0x48')]===_0x07d8('0x45')){var _0x2f94cc=_0x323e5d['get']({'plain':!![]});var _0x11c223='Projects';return db[_0x07d8('0x54')][_0x07d8('0x42')]({'where':{'name':_0x11c223,'userProfileId':_0x3c7aef[_0x07d8('0x4a')]},'raw':!![]})['then'](function(_0x4fb25a){if(_0x4fb25a&&_0x4fb25a[_0x07d8('0x4b')]===0x0){return db[_0x07d8('0x4c')][_0x07d8('0x43')]({'name':_0x2f94cc[_0x07d8('0x24')],'resourceId':_0x2f94cc['id'],'type':_0x4fb25a['name'],'sectionId':_0x4fb25a['id']},{})[_0x07d8('0x20')](function(){return _0x323e5d;});}else{return _0x323e5d;}})['catch'](function(_0x18aaa7){logger[_0x07d8('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18aaa7);throw _0x18aaa7;});}return _0x323e5d;});}})[_0x07d8('0x20')](respondWithResult(_0x5bd980,0xc9))['catch'](handleError(_0x5bd980,null));};exports['update']=function(_0x188a3b,_0x366931){if(_0x188a3b[_0x07d8('0x44')]['id']){delete _0x188a3b[_0x07d8('0x44')]['id'];}return db[_0x07d8('0x28')]['find']({'where':{'id':_0x188a3b[_0x07d8('0x3f')]['id']}})[_0x07d8('0x20')](handleEntityNotFound(_0x366931,null))[_0x07d8('0x20')](saveUpdates(_0x188a3b[_0x07d8('0x44')],null))[_0x07d8('0x20')](respondWithResult(_0x366931,null))[_0x07d8('0x3d')](handleError(_0x366931,null));};exports['destroy']=function(_0x17468c,_0x12ce48){return db[_0x07d8('0x28')][_0x07d8('0x42')]({'where':{'id':_0x17468c[_0x07d8('0x3f')]['id']}})[_0x07d8('0x20')](handleEntityNotFound(_0x12ce48,null))['then'](removeEntity(_0x12ce48,null))[_0x07d8('0x3d')](handleError(_0x12ce48,null));};exports[_0x07d8('0x55')]=function(_0x3ec50a,_0xd6ba45,_0x2bfb38){var _0xee6b8c={'raw':!![],'where':{}};var _0x30f25f={};var _0x49eb58={'count':0x0,'rows':[]};return db[_0x07d8('0x28')]['findOne']({'where':{'id':_0x3ec50a[_0x07d8('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd6ba45,null))[_0x07d8('0x20')](function(_0x3a53d8){if(_0x3a53d8){_0x30f25f[_0x07d8('0x2f')]=_[_0x07d8('0x2d')](db[_0x07d8('0x56')][_0x07d8('0x4f')]);_0x30f25f['query']=_[_0x07d8('0x2d')](_0x3ec50a[_0x07d8('0x2c')]);_0x30f25f['filters']=_['intersection'](_0x30f25f['model'],_0x30f25f[_0x07d8('0x2c')]);_0xee6b8c['attributes']=_[_0x07d8('0x2e')](_0x30f25f[_0x07d8('0x2f')],qs[_0x07d8('0x31')](_0x3ec50a[_0x07d8('0x2c')]['fields']));_0xee6b8c[_0x07d8('0x30')]=_0xee6b8c[_0x07d8('0x30')][_0x07d8('0x40')]?_0xee6b8c[_0x07d8('0x30')]:_0x30f25f[_0x07d8('0x2f')];if(!_0x3ec50a[_0x07d8('0x2c')][_0x07d8('0x32')](_0x07d8('0x33'))){_0xee6b8c['limit']=qs[_0x07d8('0x1d')](_0x3ec50a[_0x07d8('0x2c')][_0x07d8('0x1d')]);_0xee6b8c[_0x07d8('0x1a')]=qs[_0x07d8('0x1a')](_0x3ec50a['query'][_0x07d8('0x1a')]);}_0xee6b8c[_0x07d8('0x34')]=qs['sort'](_0x3ec50a['query'][_0x07d8('0x35')]);_0xee6b8c[_0x07d8('0x36')]=qs[_0x07d8('0x37')](_[_0x07d8('0x57')](_0x3ec50a[_0x07d8('0x2c')],_0x30f25f[_0x07d8('0x37')]));_0xee6b8c['where'][_0x07d8('0x58')]=_0x3a53d8['id'];if(_0x3ec50a['query'][_0x07d8('0x59')]){_0xee6b8c[_0x07d8('0x36')]=_[_0x07d8('0x38')](_0xee6b8c[_0x07d8('0x36')],{'$or':_[_0x07d8('0x27')](_0xee6b8c[_0x07d8('0x30')],function(_0x1afe83){var _0x468ef5={};_0x468ef5[_0x1afe83]={'$like':'%'+_0x3ec50a[_0x07d8('0x2c')][_0x07d8('0x59')]+'%'};return _0x468ef5;})});}_0xee6b8c=_['merge']({},_0xee6b8c,_0x3ec50a['options']);return db[_0x07d8('0x56')]['count']({'where':_0xee6b8c['where']})[_0x07d8('0x20')](function(_0x42bf67){_0x49eb58[_0x07d8('0x1c')]=_0x42bf67;if(_0x3ec50a['query'][_0x07d8('0x50')]){_0xee6b8c[_0x07d8('0x41')]=[{'all':!![]}];}return db[_0x07d8('0x56')]['findAll'](_0xee6b8c);})[_0x07d8('0x20')](function(_0x13feb8){_0x49eb58[_0x07d8('0x3c')]=_0x13feb8;return _0x49eb58;});}})['then'](respondWithFilteredResult(_0xd6ba45,_0xee6b8c))[_0x07d8('0x3d')](handleError(_0xd6ba45,null));};exports[_0x07d8('0x5a')]=function(_0x295ae5,_0x1e3940,_0x24965a){var _0x224467={'raw':!![],'where':{}};var _0x4b9b3a={};var _0x59aa42={'count':0x0,'rows':[]};return db[_0x07d8('0x28')]['findOne']({'where':{'id':_0x295ae5[_0x07d8('0x3f')]['id']}})[_0x07d8('0x20')](handleEntityNotFound(_0x1e3940,null))['then'](function(_0x160fbd){if(_0x160fbd){_0x4b9b3a[_0x07d8('0x2f')]=_[_0x07d8('0x2d')](db[_0x07d8('0x5b')][_0x07d8('0x4f')]);_0x4b9b3a[_0x07d8('0x2c')]=_[_0x07d8('0x2d')](_0x295ae5[_0x07d8('0x2c')]);_0x4b9b3a['filters']=_['intersection'](_0x4b9b3a['model'],_0x4b9b3a[_0x07d8('0x2c')]);_0x224467[_0x07d8('0x30')]=_[_0x07d8('0x2e')](_0x4b9b3a[_0x07d8('0x2f')],qs[_0x07d8('0x31')](_0x295ae5[_0x07d8('0x2c')][_0x07d8('0x31')]));_0x224467[_0x07d8('0x30')]=_0x224467[_0x07d8('0x30')][_0x07d8('0x40')]?_0x224467[_0x07d8('0x30')]:_0x4b9b3a[_0x07d8('0x2f')];if(!_0x295ae5[_0x07d8('0x2c')][_0x07d8('0x32')](_0x07d8('0x33'))){_0x224467['limit']=qs[_0x07d8('0x1d')](_0x295ae5['query']['limit']);_0x224467[_0x07d8('0x1a')]=qs['offset'](_0x295ae5['query'][_0x07d8('0x1a')]);}_0x224467['order']=qs[_0x07d8('0x35')](_0x295ae5[_0x07d8('0x2c')]['sort']);_0x224467['where']=qs[_0x07d8('0x37')](_[_0x07d8('0x57')](_0x295ae5[_0x07d8('0x2c')],_0x4b9b3a[_0x07d8('0x37')]));_0x224467[_0x07d8('0x36')][_0x07d8('0x58')]=_0x160fbd['id'];if(_0x295ae5[_0x07d8('0x2c')][_0x07d8('0x59')]){_0x224467['where']=_[_0x07d8('0x38')](_0x224467['where'],{'$or':_['map'](_0x224467[_0x07d8('0x30')],function(_0x37f427){var _0x4cbdec={};_0x4cbdec[_0x37f427]={'$like':'%'+_0x295ae5[_0x07d8('0x2c')]['filter']+'%'};return _0x4cbdec;})});}_0x224467=_[_0x07d8('0x38')]({},_0x224467,_0x295ae5[_0x07d8('0x3a')]);return db[_0x07d8('0x5b')]['count']({'where':_0x224467[_0x07d8('0x36')]})[_0x07d8('0x20')](function(_0x22a92a){_0x59aa42[_0x07d8('0x1c')]=_0x22a92a;if(_0x295ae5[_0x07d8('0x2c')]['includeAll']){_0x224467[_0x07d8('0x41')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x224467);})[_0x07d8('0x20')](function(_0x5c55b6){_0x59aa42[_0x07d8('0x3c')]=_0x5c55b6;return _0x59aa42;});}})['then'](respondWithFilteredResult(_0x1e3940,_0x224467))[_0x07d8('0x3d')](handleError(_0x1e3940,null));};function char(_0x196765){return _0x07d8('0x5c')===typeof _0x196765?String[_0x07d8('0x5d')]['apply'](null,arguments):_0x196765;}function needsEncapsulation(_0x4b5ccb){return!!_0x4b5ccb&&(_0x4b5ccb[_0x07d8('0x5e')]()['indexOf'](char(0xd))>=0x0||_0x4b5ccb['toString']()[_0x07d8('0x5f')](char(0xa))>=0x0||_0x4b5ccb[_0x07d8('0x5e')]()[_0x07d8('0x5f')](char(0x2c))>=0x0||_0x4b5ccb[_0x07d8('0x5e')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x40d97c){var _0x285b05=char(0x22),_0x4cd177='\x5c'+char(0x22),_0xc612a0=_0x40d97c[_0x07d8('0x5e')]()[_0x07d8('0x60')](new RegExp(_0x285b05,'g'),_0x4cd177);return _0x285b05+_0xc612a0+_0x285b05;}exports[_0x07d8('0x61')]=function(_0x1d9c84,_0x3b2bcb,_0x213092){var _0xe73fb2,_0x1e38a9;var _0x2aaa17={'where':{'ProjectId':_0x1d9c84[_0x07d8('0x3f')]['id']}};if(_0x1d9c84[_0x07d8('0x2c')][_0x07d8('0x62')]){_0x2aaa17[_0x07d8('0x36')]['starttime']=JSON[_0x07d8('0x63')](_0x1d9c84[_0x07d8('0x2c')][_0x07d8('0x62')]);}return db['JscriptySessionReport'][_0x07d8('0x3b')](_0x2aaa17)[_0x07d8('0x20')](handleEntityNotFound(_0x3b2bcb,null))['then'](function(_0x2702a2){if(_0x2702a2){_0xe73fb2=_0x2702a2;return db[_0x07d8('0x64')][_0x07d8('0x3b')]({'where':{'SessionId':{'$in':_[_0x07d8('0x27')](_0xe73fb2,'id')},'ProjectId':_0x1d9c84[_0x07d8('0x3f')]['id']},'order':_0x07d8('0x65')});}})[_0x07d8('0x20')](handleEntityNotFound(_0x3b2bcb,null))['then'](function(_0x1a6ab1){if(_0x1a6ab1){_0x1e38a9=_0x1a6ab1;var _0x117204={};for(var _0x46a8c3=0x0,_0x5bc07b=_0x1e38a9[_0x07d8('0x40')];_0x46a8c3<_0x5bc07b;_0x46a8c3++){if(!_0x117204[_0x07d8('0x32')](_0x1e38a9[_0x46a8c3][_0x07d8('0x66')])){_0x117204[_0x1e38a9[_0x46a8c3][_0x07d8('0x66')]]=needsEncapsulation(_0x1e38a9[_0x46a8c3][_0x07d8('0x67')])?encapsulate(_0x1e38a9[_0x46a8c3][_0x07d8('0x67')]):_0x1e38a9[_0x46a8c3][_0x07d8('0x67')];}}var _0x50ca44=[],_0x3fc334={};for(var _0xfb4111=0x0,_0x44012c=_0xe73fb2[_0x07d8('0x40')];_0xfb4111<_0x44012c;_0xfb4111++){_0x3fc334={'ProjectId':_0x1d9c84['params']['id'],'SessionId':_0xe73fb2[_0xfb4111]['id'],'StartTime':moment(_0xe73fb2[_0xfb4111][_0x07d8('0x68')])[_0x07d8('0x69')](_0x07d8('0x6a'))};for(var _0xe78594=0x0,_0x430a8a=_0x1e38a9[_0x07d8('0x40')];_0xe78594<_0x430a8a;_0xe78594++){if(_0x1e38a9[_0xe78594]['SessionId']==_0xe73fb2[_0xfb4111]['id']&&_0x117204[_0x07d8('0x32')](_0x1e38a9[_0xe78594][_0x07d8('0x66')])){_0x3fc334[_0x117204[_0x1e38a9[_0xe78594][_0x07d8('0x66')]]]=_0x1e38a9[_0xe78594][_0x07d8('0x6b')];}}for(var _0x3eff41 in _0x117204){if(!_0x3fc334[_0x07d8('0x32')](_0x117204[_0x3eff41])){_0x3fc334[_0x117204[_0x3eff41]]=null;}}_0x50ca44[_0x07d8('0x6c')](_0x3fc334);}return _0x50ca44;}})[_0x07d8('0x20')](function(_0x34c3d2){if(!_[_0x07d8('0x6d')](_0x34c3d2)){var _0x54c856=toCsv(_0x34c3d2);var _0xa5100e=Date[_0x07d8('0x6e')]();fs[_0x07d8('0x6f')](util[_0x07d8('0x69')](_0x07d8('0x70'),_0x1d9c84[_0x07d8('0x3f')]['id'],_0xa5100e),_0x54c856);_0x3b2bcb[_0x07d8('0x71')](_0x07d8('0x72'),_0x07d8('0x73')+util[_0x07d8('0x69')](_0x07d8('0x74'),_0x1d9c84[_0x07d8('0x3f')]['id'],_0xa5100e));_0x3b2bcb[_0x07d8('0x71')]('Content-type',_0x07d8('0x75'));return _0x3b2bcb['download'](util[_0x07d8('0x69')](_0x07d8('0x70'),_0x1d9c84[_0x07d8('0x3f')]['id'],_0xa5100e));}else{return _0x3b2bcb['sendStatus'](0xcc);}})[_0x07d8('0x3d')](handleError(_0x3b2bcb,null));}; \ No newline at end of file +var _0xbc95=['ProjectId','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','rows','number','toString','indexOf','replace','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','answer','push','isEmpty','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','Projects','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','show','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','createdAt','updatedAt','body','UserProfileResource','getSessions','findOne'];(function(_0x3c1e2e,_0x383e30){var _0x3dbe7c=function(_0x4785eb){while(--_0x4785eb){_0x3c1e2e['push'](_0x3c1e2e['shift']());}};_0x3dbe7c(++_0x383e30);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x5a1cf3,_0x161eca){_0x5a1cf3=_0x5a1cf3-0x0;var _0x24d3cc=_0xbc95[_0x5a1cf3];return _0x24d3cc;};'use strict';var emlformat=require(_0x5bc9('0x0'));var rimraf=require(_0x5bc9('0x1'));var zipdir=require(_0x5bc9('0x2'));var jsonpatch=require(_0x5bc9('0x3'));var rp=require(_0x5bc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5bc9('0x5'));var path=require(_0x5bc9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bc9('0x7'));var _=require('lodash');var squel=require(_0x5bc9('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5bc9('0x9'));var toCsv=require(_0x5bc9('0xa'));var querystring=require(_0x5bc9('0xb'));var Papa=require(_0x5bc9('0xc'));var Redis=require(_0x5bc9('0xd'));var authService=require(_0x5bc9('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5bc9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5bc9('0x10'));var utils=require('../../config/utils');var config=require(_0x5bc9('0x11'));var licenseUtil=require(_0x5bc9('0x12'));var db=require(_0x5bc9('0x13'))['db'];function respondWithStatusCode(_0x3d60bc,_0x357ad6){_0x357ad6=_0x357ad6||0xcc;return function(_0x55cfcd){if(_0x55cfcd){return _0x3d60bc[_0x5bc9('0x14')](_0x357ad6);}return _0x3d60bc[_0x5bc9('0x15')](_0x357ad6)['end']();};}function respondWithResult(_0x1e345a,_0x5c67b1){_0x5c67b1=_0x5c67b1||0xc8;return function(_0x48a2c2){if(_0x48a2c2){return _0x1e345a[_0x5bc9('0x15')](_0x5c67b1)[_0x5bc9('0x16')](_0x48a2c2);}};}function respondWithFilteredResult(_0x298800,_0x16cf5f){return function(_0x443185){if(_0x443185){var _0x33053f=typeof _0x16cf5f['offset']==='undefined'&&typeof _0x16cf5f[_0x5bc9('0x17')]===_0x5bc9('0x18');var _0x59e5f1=_0x443185[_0x5bc9('0x19')];var _0x46963b=_0x33053f?0x0:_0x16cf5f[_0x5bc9('0x1a')];var _0x50baff=_0x33053f?_0x443185[_0x5bc9('0x19')]:_0x16cf5f[_0x5bc9('0x1a')]+_0x16cf5f[_0x5bc9('0x17')];var _0x502dc0;if(_0x50baff>=_0x59e5f1){_0x50baff=_0x59e5f1;_0x502dc0=0xc8;}else{_0x502dc0=0xce;}_0x298800[_0x5bc9('0x15')](_0x502dc0);return _0x298800['set'](_0x5bc9('0x1b'),_0x46963b+'-'+_0x50baff+'/'+_0x59e5f1)[_0x5bc9('0x16')](_0x443185);}return null;};}function patchUpdates(_0x299a7c){return function(_0x242bb4){try{jsonpatch[_0x5bc9('0x1c')](_0x242bb4,_0x299a7c,!![]);}catch(_0x4f525d){return BPromise['reject'](_0x4f525d);}return _0x242bb4[_0x5bc9('0x1d')]();};}function saveUpdates(_0x45acb8,_0x44827d){return function(_0x4433ab){if(_0x4433ab){return _0x4433ab[_0x5bc9('0x1e')](_0x45acb8)[_0x5bc9('0x1f')](function(_0x168056){return _0x168056;});}return null;};}function removeEntity(_0x37f3aa,_0x12a750){return function(_0x517a44){if(_0x517a44){return _0x517a44[_0x5bc9('0x20')]()[_0x5bc9('0x1f')](function(){var _0x25b70e=_0x517a44[_0x5bc9('0x21')]({'plain':!![]});var _0x4f6e4b=_0x5bc9('0x22');return db['UserProfileResource'][_0x5bc9('0x20')]({'where':{'type':_0x4f6e4b,'resourceId':_0x25b70e['id']}})[_0x5bc9('0x1f')](function(){return _0x517a44;});})[_0x5bc9('0x1f')](function(){_0x37f3aa[_0x5bc9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f19e0,_0x5b5cbc){return function(_0x4cb942){if(!_0x4cb942){_0x1f19e0[_0x5bc9('0x14')](0x194);}return _0x4cb942;};}function handleError(_0x5124db,_0x128848){_0x128848=_0x128848||0x1f4;return function(_0x49d8a3){logger['error'](_0x49d8a3[_0x5bc9('0x23')]);if(_0x49d8a3[_0x5bc9('0x24')]){delete _0x49d8a3[_0x5bc9('0x24')];}_0x5124db[_0x5bc9('0x15')](_0x128848)[_0x5bc9('0x25')](_0x49d8a3);};}exports[_0x5bc9('0x26')]=function(_0x485012,_0x5c26b1){var _0x5c41df={},_0x5d7044={},_0x4003ca={'count':0x0,'rows':[]};var _0xefa097=_[_0x5bc9('0x27')](db[_0x5bc9('0x28')][_0x5bc9('0x29')],function(_0xbc7c93){return{'name':_0xbc7c93[_0x5bc9('0x2a')],'type':_0xbc7c93[_0x5bc9('0x2b')]['key']};});_0x5d7044[_0x5bc9('0x2c')]=_['map'](_0xefa097,'name');_0x5d7044[_0x5bc9('0x2d')]=_[_0x5bc9('0x2e')](_0x485012[_0x5bc9('0x2d')]);_0x5d7044['filters']=_['intersection'](_0x5d7044['model'],_0x5d7044[_0x5bc9('0x2d')]);_0x5c41df[_0x5bc9('0x2f')]=_[_0x5bc9('0x30')](_0x5d7044[_0x5bc9('0x2c')],qs[_0x5bc9('0x31')](_0x485012[_0x5bc9('0x2d')][_0x5bc9('0x31')]));_0x5c41df[_0x5bc9('0x2f')]=_0x5c41df['attributes'][_0x5bc9('0x32')]?_0x5c41df[_0x5bc9('0x2f')]:_0x5d7044[_0x5bc9('0x2c')];if(!_0x485012[_0x5bc9('0x2d')][_0x5bc9('0x33')](_0x5bc9('0x34'))){_0x5c41df[_0x5bc9('0x17')]=qs['limit'](_0x485012['query'][_0x5bc9('0x17')]);_0x5c41df[_0x5bc9('0x1a')]=qs[_0x5bc9('0x1a')](_0x485012[_0x5bc9('0x2d')][_0x5bc9('0x1a')]);}_0x5c41df[_0x5bc9('0x35')]=qs[_0x5bc9('0x36')](_0x485012[_0x5bc9('0x2d')][_0x5bc9('0x36')]);_0x5c41df['where']=qs[_0x5bc9('0x37')](_[_0x5bc9('0x38')](_0x485012[_0x5bc9('0x2d')],_0x5d7044['filters']),_0xefa097);if(_0x485012['query'][_0x5bc9('0x39')]){_0x5c41df[_0x5bc9('0x3a')]=_[_0x5bc9('0x3b')](_0x5c41df['where'],{'$or':_['map'](_0xefa097,function(_0x3fd9bf){if(_0x3fd9bf['type']!==_0x5bc9('0x3c')){var _0x445d3a={};_0x445d3a[_0x3fd9bf['name']]={'$like':'%'+_0x485012[_0x5bc9('0x2d')][_0x5bc9('0x39')]+'%'};return _0x445d3a;}})});}_0x5c41df=_['merge']({},_0x5c41df,_0x485012['options']);var _0x4b0610={'where':_0x5c41df[_0x5bc9('0x3a')]};return db[_0x5bc9('0x28')][_0x5bc9('0x19')](_0x4b0610)[_0x5bc9('0x1f')](function(_0x222447){_0x4003ca[_0x5bc9('0x19')]=_0x222447;if(_0x485012['query'][_0x5bc9('0x3d')]){_0x5c41df['include']=[{'all':!![]}];}return db[_0x5bc9('0x28')]['findAll'](_0x5c41df);})[_0x5bc9('0x1f')](function(_0x4e43f3){_0x4003ca['rows']=_0x4e43f3;return _0x4003ca;})[_0x5bc9('0x1f')](respondWithFilteredResult(_0x5c26b1,_0x5c41df))['catch'](handleError(_0x5c26b1,null));};exports[_0x5bc9('0x3e')]=function(_0x2c159e,_0x57c2eb){var _0x29b001={'raw':![],'where':{'id':_0x2c159e['params']['id']}},_0x975083={};_0x975083[_0x5bc9('0x2c')]=_[_0x5bc9('0x2e')](db['JscriptyProject'][_0x5bc9('0x29')]);_0x975083[_0x5bc9('0x2d')]=_[_0x5bc9('0x2e')](_0x2c159e[_0x5bc9('0x2d')]);_0x975083[_0x5bc9('0x37')]=_[_0x5bc9('0x30')](_0x975083[_0x5bc9('0x2c')],_0x975083[_0x5bc9('0x2d')]);_0x29b001['attributes']=_[_0x5bc9('0x30')](_0x975083[_0x5bc9('0x2c')],qs[_0x5bc9('0x31')](_0x2c159e[_0x5bc9('0x2d')][_0x5bc9('0x31')]));_0x29b001[_0x5bc9('0x2f')]=_0x29b001[_0x5bc9('0x2f')][_0x5bc9('0x32')]?_0x29b001[_0x5bc9('0x2f')]:_0x975083[_0x5bc9('0x2c')];if(_0x2c159e[_0x5bc9('0x2d')][_0x5bc9('0x3d')]){_0x29b001[_0x5bc9('0x3f')]=[{'all':!![]}];}_0x29b001=_[_0x5bc9('0x3b')]({},_0x29b001,_0x2c159e['options']);return db[_0x5bc9('0x28')][_0x5bc9('0x40')](_0x29b001)[_0x5bc9('0x1f')](handleEntityNotFound(_0x57c2eb,null))[_0x5bc9('0x1f')](respondWithResult(_0x57c2eb,null))[_0x5bc9('0x41')](handleError(_0x57c2eb,null));};exports[_0x5bc9('0x42')]=function(_0x4f2217,_0x2ca74a){return db[_0x5bc9('0x28')]['create'](_0x4f2217['body'],{})[_0x5bc9('0x1f')](function(_0x44ec8c){var _0x4c22df=_0x4f2217[_0x5bc9('0x43')][_0x5bc9('0x21')]({'plain':!![]});if(!_0x4c22df)throw new Error(_0x5bc9('0x44'));if(_0x4c22df[_0x5bc9('0x45')]===_0x5bc9('0x43')){var _0x26fea4=_0x44ec8c[_0x5bc9('0x21')]({'plain':!![]});var _0x5f37d8='Projects';return db[_0x5bc9('0x46')][_0x5bc9('0x40')]({'where':{'name':_0x5f37d8,'userProfileId':_0x4c22df[_0x5bc9('0x47')]},'raw':!![]})[_0x5bc9('0x1f')](function(_0x238ca0){if(_0x238ca0&&_0x238ca0[_0x5bc9('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x26fea4['name'],'resourceId':_0x26fea4['id'],'type':_0x238ca0[_0x5bc9('0x24')],'sectionId':_0x238ca0['id']},{})[_0x5bc9('0x1f')](function(){return _0x44ec8c;});}else{return _0x44ec8c;}})['catch'](function(_0x3adc51){logger[_0x5bc9('0x49')](_0x5bc9('0x4a'),_0x3adc51);throw _0x3adc51;});}return _0x44ec8c;})[_0x5bc9('0x1f')](respondWithResult(_0x2ca74a,0xc9))[_0x5bc9('0x41')](handleError(_0x2ca74a,null));};exports[_0x5bc9('0x4b')]=function(_0xd1ed8b,_0xa2b06d){var _0x93a8ab={'where':{'id':_0xd1ed8b[_0x5bc9('0x4c')]['id']}},_0x3b7004={};_0x3b7004[_0x5bc9('0x2c')]=_[_0x5bc9('0x2e')](db['JscriptyProject'][_0x5bc9('0x29')]);_0x93a8ab['attributes']=_['intersection'](_0x3b7004['model'],qs[_0x5bc9('0x31')](_0xd1ed8b['query'][_0x5bc9('0x31')]));_0x93a8ab[_0x5bc9('0x2f')]=_0x93a8ab[_0x5bc9('0x2f')][_0x5bc9('0x32')]?_0x93a8ab[_0x5bc9('0x2f')]:_0x3b7004[_0x5bc9('0x2c')];if(_0xd1ed8b['query'][_0x5bc9('0x3d')]){_0x93a8ab[_0x5bc9('0x3f')]=[{'all':!![]}];}_0x93a8ab=_[_0x5bc9('0x3b')]({},_0x93a8ab,_0xd1ed8b[_0x5bc9('0x4d')]);return db[_0x5bc9('0x28')][_0x5bc9('0x40')](_0x93a8ab)[_0x5bc9('0x1f')](handleEntityNotFound(_0xa2b06d,null))[_0x5bc9('0x1f')](function(_0x71a65){if(_0x71a65){var _0x102ea3=_0x71a65[_0x5bc9('0x21')]({'plain':!![]});_0x102ea3=qs[_0x5bc9('0x4e')](_0x102ea3,['id',_0x5bc9('0x4f'),_0x5bc9('0x50')]);_0xd1ed8b[_0x5bc9('0x51')]=_[_0x5bc9('0x4e')](_0xd1ed8b[_0x5bc9('0x51')],['id','createdAt','updatedAt']);return db[_0x5bc9('0x28')][_0x5bc9('0x42')](_[_0x5bc9('0x3b')](_0x102ea3,_0xd1ed8b['body']),{'include':_0xd1ed8b[_0x5bc9('0x2d')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x4c2223){var _0x2d96d0=_0xd1ed8b[_0x5bc9('0x43')][_0x5bc9('0x21')]({'plain':!![]});if(!_0x2d96d0)throw new Error(_0x5bc9('0x44'));if(_0x2d96d0['role']===_0x5bc9('0x43')){var _0x518fb6=_0x4c2223[_0x5bc9('0x21')]({'plain':!![]});var _0x171c8a='Projects';return db[_0x5bc9('0x46')][_0x5bc9('0x40')]({'where':{'name':_0x171c8a,'userProfileId':_0x2d96d0['userProfileId']},'raw':!![]})['then'](function(_0x412885){if(_0x412885&&_0x412885[_0x5bc9('0x48')]===0x0){return db[_0x5bc9('0x52')][_0x5bc9('0x42')]({'name':_0x518fb6[_0x5bc9('0x24')],'resourceId':_0x518fb6['id'],'type':_0x412885[_0x5bc9('0x24')],'sectionId':_0x412885['id']},{})['then'](function(){return _0x4c2223;});}else{return _0x4c2223;}})[_0x5bc9('0x41')](function(_0x47edab){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47edab);throw _0x47edab;});}return _0x4c2223;});}})[_0x5bc9('0x1f')](respondWithResult(_0xa2b06d,0xc9))[_0x5bc9('0x41')](handleError(_0xa2b06d,null));};exports[_0x5bc9('0x1e')]=function(_0x496d7b,_0x49eda6){if(_0x496d7b[_0x5bc9('0x51')]['id']){delete _0x496d7b[_0x5bc9('0x51')]['id'];}return db['JscriptyProject'][_0x5bc9('0x40')]({'where':{'id':_0x496d7b[_0x5bc9('0x4c')]['id']}})[_0x5bc9('0x1f')](handleEntityNotFound(_0x49eda6,null))[_0x5bc9('0x1f')](saveUpdates(_0x496d7b[_0x5bc9('0x51')],null))[_0x5bc9('0x1f')](respondWithResult(_0x49eda6,null))[_0x5bc9('0x41')](handleError(_0x49eda6,null));};exports[_0x5bc9('0x20')]=function(_0x2328e3,_0x3d5d27){return db[_0x5bc9('0x28')][_0x5bc9('0x40')]({'where':{'id':_0x2328e3[_0x5bc9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3d5d27,null))['then'](removeEntity(_0x3d5d27,null))[_0x5bc9('0x41')](handleError(_0x3d5d27,null));};exports[_0x5bc9('0x53')]=function(_0x43f7c3,_0x545711,_0x3cb9e2){var _0x20ecdf={'raw':!![],'where':{}};var _0x29e99e={};var _0x2c8f1f={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5bc9('0x54')]({'where':{'id':_0x43f7c3['params']['id']}})['then'](handleEntityNotFound(_0x545711,null))[_0x5bc9('0x1f')](function(_0x2dbd08){if(_0x2dbd08){_0x29e99e[_0x5bc9('0x2c')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0x29e99e[_0x5bc9('0x2d')]=_['keys'](_0x43f7c3[_0x5bc9('0x2d')]);_0x29e99e[_0x5bc9('0x37')]=_['intersection'](_0x29e99e[_0x5bc9('0x2c')],_0x29e99e[_0x5bc9('0x2d')]);_0x20ecdf['attributes']=_['intersection'](_0x29e99e[_0x5bc9('0x2c')],qs[_0x5bc9('0x31')](_0x43f7c3[_0x5bc9('0x2d')][_0x5bc9('0x31')]));_0x20ecdf['attributes']=_0x20ecdf[_0x5bc9('0x2f')][_0x5bc9('0x32')]?_0x20ecdf[_0x5bc9('0x2f')]:_0x29e99e[_0x5bc9('0x2c')];if(!_0x43f7c3[_0x5bc9('0x2d')][_0x5bc9('0x33')](_0x5bc9('0x34'))){_0x20ecdf[_0x5bc9('0x17')]=qs[_0x5bc9('0x17')](_0x43f7c3[_0x5bc9('0x2d')][_0x5bc9('0x17')]);_0x20ecdf['offset']=qs['offset'](_0x43f7c3[_0x5bc9('0x2d')][_0x5bc9('0x1a')]);}_0x20ecdf[_0x5bc9('0x35')]=qs[_0x5bc9('0x36')](_0x43f7c3[_0x5bc9('0x2d')]['sort']);_0x20ecdf[_0x5bc9('0x3a')]=qs['filters'](_[_0x5bc9('0x38')](_0x43f7c3[_0x5bc9('0x2d')],_0x29e99e[_0x5bc9('0x37')]));_0x20ecdf[_0x5bc9('0x3a')][_0x5bc9('0x55')]=_0x2dbd08['id'];if(_0x43f7c3[_0x5bc9('0x2d')][_0x5bc9('0x39')]){_0x20ecdf[_0x5bc9('0x3a')]=_[_0x5bc9('0x3b')](_0x20ecdf[_0x5bc9('0x3a')],{'$or':_['map'](_0x20ecdf['attributes'],function(_0x19090){var _0x457017={};_0x457017[_0x19090]={'$like':'%'+_0x43f7c3[_0x5bc9('0x2d')][_0x5bc9('0x39')]+'%'};return _0x457017;})});}_0x20ecdf=_[_0x5bc9('0x3b')]({},_0x20ecdf,_0x43f7c3[_0x5bc9('0x4d')]);return db[_0x5bc9('0x56')][_0x5bc9('0x19')]({'where':_0x20ecdf[_0x5bc9('0x3a')]})['then'](function(_0x317f17){_0x2c8f1f[_0x5bc9('0x19')]=_0x317f17;if(_0x43f7c3['query'][_0x5bc9('0x3d')]){_0x20ecdf[_0x5bc9('0x3f')]=[{'all':!![]}];}return db[_0x5bc9('0x56')][_0x5bc9('0x57')](_0x20ecdf);})[_0x5bc9('0x1f')](function(_0x4b1b63){_0x2c8f1f['rows']=_0x4b1b63;return _0x2c8f1f;});}})[_0x5bc9('0x1f')](respondWithFilteredResult(_0x545711,_0x20ecdf))[_0x5bc9('0x41')](handleError(_0x545711,null));};exports[_0x5bc9('0x58')]=function(_0x572d64,_0xe97dbd,_0x47ff28){var _0x3ca58d={'raw':!![],'where':{}};var _0xf2c589={};var _0x514d57={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5bc9('0x54')]({'where':{'id':_0x572d64[_0x5bc9('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe97dbd,null))[_0x5bc9('0x1f')](function(_0x5133f0){if(_0x5133f0){_0xf2c589[_0x5bc9('0x2c')]=_['keys'](db[_0x5bc9('0x59')][_0x5bc9('0x29')]);_0xf2c589[_0x5bc9('0x2d')]=_[_0x5bc9('0x2e')](_0x572d64['query']);_0xf2c589[_0x5bc9('0x37')]=_[_0x5bc9('0x30')](_0xf2c589[_0x5bc9('0x2c')],_0xf2c589[_0x5bc9('0x2d')]);_0x3ca58d[_0x5bc9('0x2f')]=_[_0x5bc9('0x30')](_0xf2c589[_0x5bc9('0x2c')],qs[_0x5bc9('0x31')](_0x572d64[_0x5bc9('0x2d')][_0x5bc9('0x31')]));_0x3ca58d['attributes']=_0x3ca58d[_0x5bc9('0x2f')]['length']?_0x3ca58d[_0x5bc9('0x2f')]:_0xf2c589[_0x5bc9('0x2c')];if(!_0x572d64[_0x5bc9('0x2d')]['hasOwnProperty'](_0x5bc9('0x34'))){_0x3ca58d['limit']=qs[_0x5bc9('0x17')](_0x572d64[_0x5bc9('0x2d')]['limit']);_0x3ca58d[_0x5bc9('0x1a')]=qs[_0x5bc9('0x1a')](_0x572d64[_0x5bc9('0x2d')][_0x5bc9('0x1a')]);}_0x3ca58d['order']=qs[_0x5bc9('0x36')](_0x572d64[_0x5bc9('0x2d')][_0x5bc9('0x36')]);_0x3ca58d['where']=qs[_0x5bc9('0x37')](_[_0x5bc9('0x38')](_0x572d64[_0x5bc9('0x2d')],_0xf2c589['filters']));_0x3ca58d[_0x5bc9('0x3a')][_0x5bc9('0x55')]=_0x5133f0['id'];if(_0x572d64[_0x5bc9('0x2d')][_0x5bc9('0x39')]){_0x3ca58d['where']=_[_0x5bc9('0x3b')](_0x3ca58d[_0x5bc9('0x3a')],{'$or':_['map'](_0x3ca58d[_0x5bc9('0x2f')],function(_0x120fc7){var _0x35a975={};_0x35a975[_0x120fc7]={'$like':'%'+_0x572d64['query'][_0x5bc9('0x39')]+'%'};return _0x35a975;})});}_0x3ca58d=_[_0x5bc9('0x3b')]({},_0x3ca58d,_0x572d64[_0x5bc9('0x4d')]);return db[_0x5bc9('0x59')][_0x5bc9('0x19')]({'where':_0x3ca58d[_0x5bc9('0x3a')]})[_0x5bc9('0x1f')](function(_0x5836e1){_0x514d57[_0x5bc9('0x19')]=_0x5836e1;if(_0x572d64[_0x5bc9('0x2d')][_0x5bc9('0x3d')]){_0x3ca58d[_0x5bc9('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x5bc9('0x57')](_0x3ca58d);})['then'](function(_0x6a9964){_0x514d57[_0x5bc9('0x5a')]=_0x6a9964;return _0x514d57;});}})[_0x5bc9('0x1f')](respondWithFilteredResult(_0xe97dbd,_0x3ca58d))[_0x5bc9('0x41')](handleError(_0xe97dbd,null));};function char(_0x544c9a){return _0x5bc9('0x5b')===typeof _0x544c9a?String['fromCharCode'][_0x5bc9('0x1c')](null,arguments):_0x544c9a;}function needsEncapsulation(_0x5107e2){return!!_0x5107e2&&(_0x5107e2[_0x5bc9('0x5c')]()[_0x5bc9('0x5d')](char(0xd))>=0x0||_0x5107e2['toString']()[_0x5bc9('0x5d')](char(0xa))>=0x0||_0x5107e2[_0x5bc9('0x5c')]()[_0x5bc9('0x5d')](char(0x2c))>=0x0||_0x5107e2[_0x5bc9('0x5c')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x1c09df){var _0x1bd57c=char(0x22),_0x189f47='\x5c'+char(0x22),_0x3bb694=_0x1c09df[_0x5bc9('0x5c')]()[_0x5bc9('0x5e')](new RegExp(_0x1bd57c,'g'),_0x189f47);return _0x1bd57c+_0x3bb694+_0x1bd57c;}exports[_0x5bc9('0x5f')]=function(_0x1c9056,_0x1c8883,_0x45e671){var _0x3bd0e4,_0x169a01;var _0xb3e859={'where':{'ProjectId':_0x1c9056[_0x5bc9('0x4c')]['id']}};if(_0x1c9056[_0x5bc9('0x2d')]['startTime']){_0xb3e859[_0x5bc9('0x3a')][_0x5bc9('0x60')]=JSON[_0x5bc9('0x61')](_0x1c9056[_0x5bc9('0x2d')][_0x5bc9('0x62')]);}return db[_0x5bc9('0x56')][_0x5bc9('0x57')](_0xb3e859)['then'](handleEntityNotFound(_0x1c8883,null))[_0x5bc9('0x1f')](function(_0x5cb46c){if(_0x5cb46c){_0x3bd0e4=_0x5cb46c;return db[_0x5bc9('0x63')][_0x5bc9('0x57')]({'where':{'SessionId':{'$in':_['map'](_0x3bd0e4,'id')},'ProjectId':_0x1c9056['params']['id']},'order':_0x5bc9('0x64')});}})[_0x5bc9('0x1f')](handleEntityNotFound(_0x1c8883,null))[_0x5bc9('0x1f')](function(_0x2ec4fd){if(_0x2ec4fd){_0x169a01=_0x2ec4fd;var _0xbb2536={};for(var _0x38b9ac=0x0,_0x32b179=_0x169a01[_0x5bc9('0x32')];_0x38b9ac<_0x32b179;_0x38b9ac++){if(!_0xbb2536[_0x5bc9('0x33')](_0x169a01[_0x38b9ac]['questionId'])){_0xbb2536[_0x169a01[_0x38b9ac][_0x5bc9('0x65')]]=needsEncapsulation(_0x169a01[_0x38b9ac][_0x5bc9('0x66')])?encapsulate(_0x169a01[_0x38b9ac][_0x5bc9('0x66')]):_0x169a01[_0x38b9ac][_0x5bc9('0x66')];}}var _0x5a9de7=[],_0x3a76a9={};for(var _0x58ce00=0x0,_0x3d2956=_0x3bd0e4['length'];_0x58ce00<_0x3d2956;_0x58ce00++){_0x3a76a9={'ProjectId':_0x1c9056[_0x5bc9('0x4c')]['id'],'SessionId':_0x3bd0e4[_0x58ce00]['id'],'StartTime':moment(_0x3bd0e4[_0x58ce00][_0x5bc9('0x60')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0xc19070=0x0,_0x68e702=_0x169a01['length'];_0xc19070<_0x68e702;_0xc19070++){if(_0x169a01[_0xc19070][_0x5bc9('0x67')]==_0x3bd0e4[_0x58ce00]['id']&&_0xbb2536['hasOwnProperty'](_0x169a01[_0xc19070][_0x5bc9('0x65')])){_0x3a76a9[_0xbb2536[_0x169a01[_0xc19070][_0x5bc9('0x65')]]]=_0x169a01[_0xc19070][_0x5bc9('0x68')];}}for(var _0x2d456a in _0xbb2536){if(!_0x3a76a9['hasOwnProperty'](_0xbb2536[_0x2d456a])){_0x3a76a9[_0xbb2536[_0x2d456a]]=null;}}_0x5a9de7[_0x5bc9('0x69')](_0x3a76a9);}return _0x5a9de7;}})[_0x5bc9('0x1f')](function(_0x3631d4){if(!_[_0x5bc9('0x6a')](_0x3631d4)){var _0x53356a=toCsv(_0x3631d4);var _0x41d3ce=Date[_0x5bc9('0x6b')]();fs[_0x5bc9('0x6c')](util[_0x5bc9('0x6d')](_0x5bc9('0x6e'),_0x1c9056[_0x5bc9('0x4c')]['id'],_0x41d3ce),_0x53356a);_0x1c8883[_0x5bc9('0x6f')](_0x5bc9('0x70'),_0x5bc9('0x71')+util[_0x5bc9('0x6d')](_0x5bc9('0x72'),_0x1c9056[_0x5bc9('0x4c')]['id'],_0x41d3ce));_0x1c8883[_0x5bc9('0x6f')](_0x5bc9('0x73'),'text/csv');return _0x1c8883[_0x5bc9('0x74')](util[_0x5bc9('0x6d')](_0x5bc9('0x6e'),_0x1c9056[_0x5bc9('0x4c')]['id'],_0x41d3ce));}else{return _0x1c8883[_0x5bc9('0x14')](0xcc);}})[_0x5bc9('0x41')](handleError(_0x1c8883,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 1aee069..06cfbcf 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 _0xe77f=['request-promise','path','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','api','moment'];(function(_0x1f1384,_0x349022){var _0x24ca76=function(_0xb2426){while(--_0xb2426){_0x1f1384['push'](_0x1f1384['shift']());}};_0x24ca76(++_0x349022);}(_0xe77f,0xba));var _0xfe77=function(_0x2fd3ee,_0x5a96e1){_0x2fd3ee=_0x2fd3ee-0x0;var _0x13f8e6=_0xe77f[_0x2fd3ee];return _0x13f8e6;};'use strict';var _=require(_0xfe77('0x0'));var util=require(_0xfe77('0x1'));var logger=require('../../config/logger')(_0xfe77('0x2'));var moment=require(_0xfe77('0x3'));var BPromise=require('bluebird');var rp=require(_0xfe77('0x4'));var fs=require('fs');var path=require(_0xfe77('0x5'));var rimraf=require('rimraf');var config=require(_0xfe77('0x6'));var attributes=require(_0xfe77('0x7'));module[_0xfe77('0x8')]=function(_0x1ce970,_0x130b85){return _0x1ce970['define']('JscriptyProject',attributes,{'tableName':_0xfe77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3baf=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x3baf,0xf7));var _0xf3ba=function(_0x90b94e,_0x34592e){_0x90b94e=_0x90b94e-0x0;var _0x144935=_0x3baf[_0x90b94e];return _0x144935;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var logger=require(_0xf3ba('0x2'))(_0xf3ba('0x3'));var moment=require(_0xf3ba('0x4'));var BPromise=require(_0xf3ba('0x5'));var rp=require(_0xf3ba('0x6'));var fs=require('fs');var path=require(_0xf3ba('0x7'));var rimraf=require(_0xf3ba('0x8'));var config=require(_0xf3ba('0x9'));var attributes=require(_0xf3ba('0xa'));module[_0xf3ba('0xb')]=function(_0x475268,_0x2e6df2){return _0x475268[_0xf3ba('0xc')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index ccaa3bb..1e6d127 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x26793a,_0x49cf51){var _0x575efb=function(_0x2f4db7){while(--_0x2f4db7){_0x26793a['push'](_0x26793a['shift']());}};_0x575efb(++_0x49cf51);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x1bb987,_0x44b24b){var _0x3c794e=function(_0x110dd7){while(--_0x110dd7){_0x1bb987['push'](_0x1bb987['shift']());}};_0x3c794e(++_0x44b24b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 9a6fe00..24ad9d7 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 _0x1ef5=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','util','path'];(function(_0x3698df,_0xc7c825){var _0x59e54a=function(_0x5818d2){while(--_0x5818d2){_0x3698df['push'](_0x3698df['shift']());}};_0x59e54a(++_0xc7c825);}(_0x1ef5,0x1cc));var _0x51ef=function(_0x2ccfe9,_0x3ab1b2){_0x2ccfe9=_0x2ccfe9-0x0;var _0x5d725c=_0x1ef5[_0x2ccfe9];return _0x5d725c;};'use strict';var multer=require('multer');var util=require(_0x51ef('0x0'));var path=require(_0x51ef('0x1'));var timeout=require(_0x51ef('0x2'));var express=require(_0x51ef('0x3'));var router=express[_0x51ef('0x4')]();var fs_extra=require(_0x51ef('0x5'));var auth=require(_0x51ef('0x6'));var interaction=require(_0x51ef('0x7'));var config=require(_0x51ef('0x8'));var controller=require(_0x51ef('0x9'));router[_0x51ef('0xa')]('/',auth[_0x51ef('0xb')](),controller[_0x51ef('0xc')]);router['get'](_0x51ef('0xd'),auth[_0x51ef('0xb')](),controller[_0x51ef('0xe')]);router['get'](_0x51ef('0xf'),auth['isAuthenticated'](),controller[_0x51ef('0x10')]);router[_0x51ef('0x11')]('/',auth[_0x51ef('0xb')](),controller['create']);router[_0x51ef('0x12')]('/:id',auth[_0x51ef('0xb')](),controller['update']);router[_0x51ef('0x13')]('/:id',auth[_0x51ef('0xb')](),controller[_0x51ef('0x14')]);module['exports']=router; \ No newline at end of file +var _0x352e=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy'];(function(_0x2107c7,_0x97397){var _0x2f6005=function(_0x5e0f1f){while(--_0x5e0f1f){_0x2107c7['push'](_0x2107c7['shift']());}};_0x2f6005(++_0x97397);}(_0x352e,0x135));var _0xe352=function(_0xd20c97,_0x1ec1d5){_0xd20c97=_0xd20c97-0x0;var _0x538633=_0x352e[_0xd20c97];return _0x538633;};'use strict';var multer=require(_0xe352('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe352('0x1'));var express=require(_0xe352('0x2'));var router=express[_0xe352('0x3')]();var fs_extra=require(_0xe352('0x4'));var auth=require(_0xe352('0x5'));var interaction=require(_0xe352('0x6'));var config=require(_0xe352('0x7'));var controller=require(_0xe352('0x8'));router[_0xe352('0x9')]('/',auth['isAuthenticated'](),controller[_0xe352('0xa')]);router[_0xe352('0x9')](_0xe352('0xb'),auth[_0xe352('0xc')](),controller['describe']);router[_0xe352('0x9')](_0xe352('0xd'),auth[_0xe352('0xc')](),controller[_0xe352('0xe')]);router[_0xe352('0xf')]('/',auth[_0xe352('0xc')](),controller[_0xe352('0x10')]);router[_0xe352('0x11')](_0xe352('0xd'),auth[_0xe352('0xc')](),controller[_0xe352('0x12')]);router[_0xe352('0x13')]('/:id',auth[_0xe352('0xc')](),controller[_0xe352('0x14')]);module[_0xe352('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 259bd15..9b80f44 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x541861,_0x556220){_0x541861=_0x541861-0x0;var _0x40e30b=_0x7a54[_0x541861];return _0x40e30b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x99537e,_0x340d6b){_0x99537e=_0x99537e-0x0;var _0x46e164=_0x7a54[_0x99537e];return _0x46e164;};'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 f698b57..49b9d09 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 _0x1a0f=['update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','query','filters','intersection','attributes','fields','length','model','order','sort','where','pick','filter','merge','type','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','reject','save'];(function(_0x43c11e,_0x53216f){var _0xc5cf61=function(_0x291dcc){while(--_0x291dcc){_0x43c11e['push'](_0x43c11e['shift']());}};_0xc5cf61(++_0x53216f);}(_0x1a0f,0x18f));var _0xf1a0=function(_0x2c699e,_0x5e9d6c){_0x2c699e=_0x2c699e-0x0;var _0x5844e3=_0x1a0f[_0x2c699e];return _0x5844e3;};'use strict';var emlformat=require(_0xf1a0('0x0'));var rimraf=require(_0xf1a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1a0('0x2'));var rp=require('request-promise');var moment=require(_0xf1a0('0x3'));var BPromise=require(_0xf1a0('0x4'));var Mustache=require(_0xf1a0('0x5'));var util=require('util');var path=require(_0xf1a0('0x6'));var sox=require(_0xf1a0('0x7'));var csv=require(_0xf1a0('0x8'));var ejs=require(_0xf1a0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1a0('0xa'));var squel=require(_0xf1a0('0xb'));var crypto=require('crypto');var jsforce=require(_0xf1a0('0xc'));var deskjs=require(_0xf1a0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf1a0('0xe'));var Redis=require(_0xf1a0('0xf'));var authService=require(_0xf1a0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf1a0('0x11'));var hardwareService=require(_0xf1a0('0x12'));var logger=require('../../config/logger')(_0xf1a0('0x13'));var utils=require('../../config/utils');var config=require(_0xf1a0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1a0('0x15'))['db'];function respondWithStatusCode(_0x20b449,_0x4c82a7){_0x4c82a7=_0x4c82a7||0xcc;return function(_0x308a17){if(_0x308a17){return _0x20b449[_0xf1a0('0x16')](_0x4c82a7);}return _0x20b449[_0xf1a0('0x17')](_0x4c82a7)[_0xf1a0('0x18')]();};}function respondWithResult(_0xe68b86,_0x1520a6){_0x1520a6=_0x1520a6||0xc8;return function(_0x28051a){if(_0x28051a){return _0xe68b86[_0xf1a0('0x17')](_0x1520a6)['json'](_0x28051a);}};}function respondWithFilteredResult(_0xec3a9,_0x5c1e75){return function(_0x12e8cf){if(_0x12e8cf){var _0x3f3619=typeof _0x5c1e75['offset']===_0xf1a0('0x19')&&typeof _0x5c1e75[_0xf1a0('0x1a')]===_0xf1a0('0x19');var _0xfc0726=_0x12e8cf['count'];var _0x3e1b2d=_0x3f3619?0x0:_0x5c1e75[_0xf1a0('0x1b')];var _0x3fb29d=_0x3f3619?_0x12e8cf[_0xf1a0('0x1c')]:_0x5c1e75['offset']+_0x5c1e75[_0xf1a0('0x1a')];var _0x456dcc;if(_0x3fb29d>=_0xfc0726){_0x3fb29d=_0xfc0726;_0x456dcc=0xc8;}else{_0x456dcc=0xce;}_0xec3a9[_0xf1a0('0x17')](_0x456dcc);return _0xec3a9[_0xf1a0('0x1d')](_0xf1a0('0x1e'),_0x3e1b2d+'-'+_0x3fb29d+'/'+_0xfc0726)['json'](_0x12e8cf);}return null;};}function patchUpdates(_0x4b7985){return function(_0x37907e){try{jsonpatch['apply'](_0x37907e,_0x4b7985,!![]);}catch(_0x55882b){return BPromise[_0xf1a0('0x1f')](_0x55882b);}return _0x37907e[_0xf1a0('0x20')]();};}function saveUpdates(_0x75973b,_0x216352){return function(_0x3c8332){if(_0x3c8332){return _0x3c8332[_0xf1a0('0x21')](_0x75973b)[_0xf1a0('0x22')](function(_0x186383){return _0x186383;});}return null;};}function removeEntity(_0x76b20e,_0x201b84){return function(_0x5cd85e){if(_0x5cd85e){return _0x5cd85e[_0xf1a0('0x23')]()[_0xf1a0('0x22')](function(){_0x76b20e['status'](0xcc)[_0xf1a0('0x18')]();});}};}function handleEntityNotFound(_0xef4b64,_0x1a21cc){return function(_0x3a7512){if(!_0x3a7512){_0xef4b64[_0xf1a0('0x16')](0x194);}return _0x3a7512;};}function handleError(_0x3a1dd4,_0x376b41){_0x376b41=_0x376b41||0x1f4;return function(_0x4d09f5){logger[_0xf1a0('0x24')](_0x4d09f5[_0xf1a0('0x25')]);if(_0x4d09f5[_0xf1a0('0x26')]){delete _0x4d09f5[_0xf1a0('0x26')];}_0x3a1dd4[_0xf1a0('0x17')](_0x376b41)['send'](_0x4d09f5);};}exports[_0xf1a0('0x27')]=function(_0x3aec49,_0x3b14e3){var _0x530705={},_0x2f4d96={},_0x58d3c8={'count':0x0,'rows':[]};var _0x3697a4=_[_0xf1a0('0x28')](db['JscriptyQuestionReport'][_0xf1a0('0x29')],function(_0x47c370){return{'name':_0x47c370[_0xf1a0('0x2a')],'type':_0x47c370['type']['key']};});_0x2f4d96['model']=_[_0xf1a0('0x28')](_0x3697a4,_0xf1a0('0x26'));_0x2f4d96[_0xf1a0('0x2b')]=_['keys'](_0x3aec49[_0xf1a0('0x2b')]);_0x2f4d96[_0xf1a0('0x2c')]=_[_0xf1a0('0x2d')](_0x2f4d96['model'],_0x2f4d96['query']);_0x530705[_0xf1a0('0x2e')]=_[_0xf1a0('0x2d')](_0x2f4d96['model'],qs[_0xf1a0('0x2f')](_0x3aec49['query'][_0xf1a0('0x2f')]));_0x530705[_0xf1a0('0x2e')]=_0x530705['attributes'][_0xf1a0('0x30')]?_0x530705['attributes']:_0x2f4d96[_0xf1a0('0x31')];if(!_0x3aec49[_0xf1a0('0x2b')]['hasOwnProperty']('nolimit')){_0x530705[_0xf1a0('0x1a')]=qs[_0xf1a0('0x1a')](_0x3aec49['query']['limit']);_0x530705[_0xf1a0('0x1b')]=qs[_0xf1a0('0x1b')](_0x3aec49['query'][_0xf1a0('0x1b')]);}_0x530705[_0xf1a0('0x32')]=qs[_0xf1a0('0x33')](_0x3aec49[_0xf1a0('0x2b')][_0xf1a0('0x33')]);_0x530705[_0xf1a0('0x34')]=qs[_0xf1a0('0x2c')](_[_0xf1a0('0x35')](_0x3aec49[_0xf1a0('0x2b')],_0x2f4d96[_0xf1a0('0x2c')]),_0x3697a4);if(_0x3aec49[_0xf1a0('0x2b')][_0xf1a0('0x36')]){_0x530705[_0xf1a0('0x34')]=_[_0xf1a0('0x37')](_0x530705[_0xf1a0('0x34')],{'$or':_[_0xf1a0('0x28')](_0x3697a4,function(_0x356b74){if(_0x356b74[_0xf1a0('0x38')]!==_0xf1a0('0x39')){var _0x477833={};_0x477833[_0x356b74[_0xf1a0('0x26')]]={'$like':'%'+_0x3aec49[_0xf1a0('0x2b')][_0xf1a0('0x36')]+'%'};return _0x477833;}})});}_0x530705=_['merge']({},_0x530705,_0x3aec49[_0xf1a0('0x3a')]);var _0x4274cb={'where':_0x530705[_0xf1a0('0x34')]};return db[_0xf1a0('0x3b')][_0xf1a0('0x1c')](_0x4274cb)[_0xf1a0('0x22')](function(_0x20d50c){_0x58d3c8[_0xf1a0('0x1c')]=_0x20d50c;if(_0x3aec49[_0xf1a0('0x2b')][_0xf1a0('0x3c')]){_0x530705[_0xf1a0('0x3d')]=[{'all':!![]}];}return db[_0xf1a0('0x3b')][_0xf1a0('0x3e')](_0x530705);})[_0xf1a0('0x22')](function(_0x226aec){_0x58d3c8[_0xf1a0('0x3f')]=_0x226aec;return _0x58d3c8;})[_0xf1a0('0x22')](respondWithFilteredResult(_0x3b14e3,_0x530705))['catch'](handleError(_0x3b14e3,null));};exports[_0xf1a0('0x40')]=function(_0x1c101e,_0x24c3a7){var _0x4995a6={'raw':!![],'where':{'id':_0x1c101e[_0xf1a0('0x41')]['id']}},_0x2147ad={};_0x2147ad['model']=_[_0xf1a0('0x42')](db[_0xf1a0('0x3b')][_0xf1a0('0x29')]);_0x2147ad['query']=_[_0xf1a0('0x42')](_0x1c101e[_0xf1a0('0x2b')]);_0x2147ad[_0xf1a0('0x2c')]=_[_0xf1a0('0x2d')](_0x2147ad[_0xf1a0('0x31')],_0x2147ad[_0xf1a0('0x2b')]);_0x4995a6[_0xf1a0('0x2e')]=_[_0xf1a0('0x2d')](_0x2147ad[_0xf1a0('0x31')],qs['fields'](_0x1c101e[_0xf1a0('0x2b')][_0xf1a0('0x2f')]));_0x4995a6['attributes']=_0x4995a6[_0xf1a0('0x2e')][_0xf1a0('0x30')]?_0x4995a6['attributes']:_0x2147ad['model'];if(_0x1c101e[_0xf1a0('0x2b')][_0xf1a0('0x3c')]){_0x4995a6[_0xf1a0('0x3d')]=[{'all':!![]}];}_0x4995a6=_[_0xf1a0('0x37')]({},_0x4995a6,_0x1c101e[_0xf1a0('0x3a')]);return db[_0xf1a0('0x3b')][_0xf1a0('0x43')](_0x4995a6)[_0xf1a0('0x22')](handleEntityNotFound(_0x24c3a7,null))[_0xf1a0('0x22')](respondWithResult(_0x24c3a7,null))[_0xf1a0('0x44')](handleError(_0x24c3a7,null));};exports[_0xf1a0('0x45')]=function(_0x1a2588,_0x4bb7c3){return db[_0xf1a0('0x3b')][_0xf1a0('0x45')](_0x1a2588[_0xf1a0('0x46')],{})['then'](respondWithResult(_0x4bb7c3,0xc9))[_0xf1a0('0x44')](handleError(_0x4bb7c3,null));};exports[_0xf1a0('0x21')]=function(_0x59c16f,_0x45deac){if(_0x59c16f[_0xf1a0('0x46')]['id']){delete _0x59c16f[_0xf1a0('0x46')]['id'];}return db[_0xf1a0('0x3b')][_0xf1a0('0x43')]({'where':{'id':_0x59c16f[_0xf1a0('0x41')]['id']}})['then'](handleEntityNotFound(_0x45deac,null))[_0xf1a0('0x22')](saveUpdates(_0x59c16f['body'],null))['then'](respondWithResult(_0x45deac,null))[_0xf1a0('0x44')](handleError(_0x45deac,null));};exports[_0xf1a0('0x23')]=function(_0x1e1628,_0x191e1d){return db['JscriptyQuestionReport'][_0xf1a0('0x43')]({'where':{'id':_0x1e1628[_0xf1a0('0x41')]['id']}})[_0xf1a0('0x22')](handleEntityNotFound(_0x191e1d,null))[_0xf1a0('0x22')](removeEntity(_0x191e1d,null))['catch'](handleError(_0x191e1d,null));};exports[_0xf1a0('0x47')]=function(_0x1512ef,_0x225724){return db[_0xf1a0('0x3b')][_0xf1a0('0x47')]()[_0xf1a0('0x22')](respondWithResult(_0x225724,null))['catch'](handleError(_0x225724,null));}; \ No newline at end of file +var _0x8f4c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','JscriptyQuestionReport','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x118986,_0x2ea044){var _0x25c9e6=function(_0x13b4d4){while(--_0x13b4d4){_0x118986['push'](_0x118986['shift']());}};_0x25c9e6(++_0x2ea044);}(_0x8f4c,0x113));var _0xc8f4=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0x8f4c[_0x10c16d];return _0x5896f4;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x177a44,_0x3dd717){return function(_0x5c94c6){if(!_0x5c94c6){_0x177a44[_0xc8f4('0x17')](0x194);}return _0x5c94c6;};}function handleError(_0x21062f,_0x11f766){_0x11f766=_0x11f766||0x1f4;return function(_0x2fa052){logger['error'](_0x2fa052[_0xc8f4('0x26')]);if(_0x2fa052[_0xc8f4('0x27')]){delete _0x2fa052['name'];}_0x21062f[_0xc8f4('0x18')](_0x11f766)[_0xc8f4('0x28')](_0x2fa052);};}exports[_0xc8f4('0x29')]=function(_0x1b70bc,_0x24bef0){var _0x385e41={},_0x4a25da={},_0x45f972={'count':0x0,'rows':[]};var _0x24bb78=_[_0xc8f4('0x2a')](db['JscriptyQuestionReport'][_0xc8f4('0x2b')],function(_0x3a4b1b){return{'name':_0x3a4b1b['fieldName'],'type':_0x3a4b1b['type']['key']};});_0x4a25da[_0xc8f4('0x2c')]=_[_0xc8f4('0x2a')](_0x24bb78,_0xc8f4('0x27'));_0x4a25da[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x1b70bc[_0xc8f4('0x2d')]);_0x4a25da[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x4a25da['model'],_0x4a25da[_0xc8f4('0x2d')]);_0x385e41[_0xc8f4('0x31')]=_[_0xc8f4('0x30')](_0x4a25da['model'],qs[_0xc8f4('0x32')](_0x1b70bc[_0xc8f4('0x2d')]['fields']));_0x385e41[_0xc8f4('0x31')]=_0x385e41[_0xc8f4('0x31')][_0xc8f4('0x33')]?_0x385e41['attributes']:_0x4a25da[_0xc8f4('0x2c')];if(!_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x34')]('nolimit')){_0x385e41[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1e')]);_0x385e41[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1d')]);}_0x385e41[_0xc8f4('0x35')]=qs[_0xc8f4('0x36')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x36')]);_0x385e41[_0xc8f4('0x37')]=qs[_0xc8f4('0x2f')](_[_0xc8f4('0x38')](_0x1b70bc[_0xc8f4('0x2d')],_0x4a25da['filters']),_0x24bb78);if(_0x1b70bc[_0xc8f4('0x2d')]['filter']){_0x385e41[_0xc8f4('0x37')]=_['merge'](_0x385e41[_0xc8f4('0x37')],{'$or':_[_0xc8f4('0x2a')](_0x24bb78,function(_0x7ef69a){if(_0x7ef69a[_0xc8f4('0x39')]!==_0xc8f4('0x3a')){var _0x724060={};_0x724060[_0x7ef69a[_0xc8f4('0x27')]]={'$like':'%'+_0x1b70bc['query'][_0xc8f4('0x3b')]+'%'};return _0x724060;}})});}_0x385e41=_[_0xc8f4('0x3c')]({},_0x385e41,_0x1b70bc[_0xc8f4('0x3d')]);var _0x14ce2e={'where':_0x385e41['where']};return db[_0xc8f4('0x3e')][_0xc8f4('0x1c')](_0x14ce2e)[_0xc8f4('0x24')](function(_0x1d0b2d){_0x45f972[_0xc8f4('0x1c')]=_0x1d0b2d;if(_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x385e41[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x3e')][_0xc8f4('0x41')](_0x385e41);})[_0xc8f4('0x24')](function(_0xd56415){_0x45f972['rows']=_0xd56415;return _0x45f972;})[_0xc8f4('0x24')](respondWithFilteredResult(_0x24bef0,_0x385e41))[_0xc8f4('0x42')](handleError(_0x24bef0,null));};exports[_0xc8f4('0x43')]=function(_0x275f4a,_0x588ff9){var _0x49da16={'raw':!![],'where':{'id':_0x275f4a[_0xc8f4('0x44')]['id']}},_0x413a55={};_0x413a55['model']=_[_0xc8f4('0x2e')](db[_0xc8f4('0x3e')]['rawAttributes']);_0x413a55['query']=_[_0xc8f4('0x2e')](_0x275f4a[_0xc8f4('0x2d')]);_0x413a55[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x413a55[_0xc8f4('0x2c')],_0x413a55[_0xc8f4('0x2d')]);_0x49da16['attributes']=_['intersection'](_0x413a55[_0xc8f4('0x2c')],qs[_0xc8f4('0x32')](_0x275f4a[_0xc8f4('0x2d')]['fields']));_0x49da16['attributes']=_0x49da16['attributes']['length']?_0x49da16['attributes']:_0x413a55[_0xc8f4('0x2c')];if(_0x275f4a[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x49da16[_0xc8f4('0x40')]=[{'all':!![]}];}_0x49da16=_[_0xc8f4('0x3c')]({},_0x49da16,_0x275f4a[_0xc8f4('0x3d')]);return db['JscriptyQuestionReport'][_0xc8f4('0x45')](_0x49da16)[_0xc8f4('0x24')](handleEntityNotFound(_0x588ff9,null))['then'](respondWithResult(_0x588ff9,null))['catch'](handleError(_0x588ff9,null));};exports[_0xc8f4('0x46')]=function(_0x82a5e,_0x3ca0d6){return db[_0xc8f4('0x3e')]['create'](_0x82a5e['body'],{})[_0xc8f4('0x24')](respondWithResult(_0x3ca0d6,0xc9))[_0xc8f4('0x42')](handleError(_0x3ca0d6,null));};exports[_0xc8f4('0x47')]=function(_0x2bc4db,_0x141f81){if(_0x2bc4db[_0xc8f4('0x48')]['id']){delete _0x2bc4db['body']['id'];}return db['JscriptyQuestionReport'][_0xc8f4('0x45')]({'where':{'id':_0x2bc4db[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x141f81,null))[_0xc8f4('0x24')](saveUpdates(_0x2bc4db[_0xc8f4('0x48')],null))[_0xc8f4('0x24')](respondWithResult(_0x141f81,null))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports[_0xc8f4('0x25')]=function(_0x3d9d67,_0x5b4035){return db['JscriptyQuestionReport'][_0xc8f4('0x45')]({'where':{'id':_0x3d9d67[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x5b4035,null))[_0xc8f4('0x24')](removeEntity(_0x5b4035,null))[_0xc8f4('0x42')](handleError(_0x5b4035,null));};exports[_0xc8f4('0x49')]=function(_0x4715f3,_0x36c304){return db[_0xc8f4('0x3e')][_0xc8f4('0x49')]()[_0xc8f4('0x24')](respondWithResult(_0x36c304,null))[_0xc8f4('0x42')](handleError(_0x36c304,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4f59fe1..3b87c48 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 _0x88ba=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0x88ba,0x138));var _0xa88b=function(_0xe38764,_0x28ce79){_0xe38764=_0xe38764-0x0;var _0x5979cf=_0x88ba[_0xe38764];return _0x5979cf;};'use strict';var _=require('lodash');var util=require(_0xa88b('0x0'));var logger=require(_0xa88b('0x1'))(_0xa88b('0x2'));var moment=require(_0xa88b('0x3'));var BPromise=require(_0xa88b('0x4'));var rp=require(_0xa88b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa88b('0x6'));var config=require(_0xa88b('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa88b('0x8')]=function(_0x4bf2b8,_0x57e5c8){return _0x4bf2b8[_0xa88b('0x9')](_0xa88b('0xa'),attributes,{'tableName':_0xa88b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x418f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','util'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x418f,0xb3));var _0xf418=function(_0x5eb6e6,_0x17f551){_0x5eb6e6=_0x5eb6e6-0x0;var _0x35c38b=_0x418f[_0x5eb6e6];return _0x35c38b;};'use strict';var _=require('lodash');var util=require(_0xf418('0x0'));var logger=require(_0xf418('0x1'))(_0xf418('0x2'));var moment=require(_0xf418('0x3'));var BPromise=require(_0xf418('0x4'));var rp=require(_0xf418('0x5'));var fs=require('fs');var path=require(_0xf418('0x6'));var rimraf=require(_0xf418('0x7'));var config=require(_0xf418('0x8'));var attributes=require(_0xf418('0x9'));module[_0xf418('0xa')]=function(_0x5f1a48,_0x122def){return _0x5f1a48['define'](_0xf418('0xb'),attributes,{'tableName':'report_jscripty_questions','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 ae3cc38..cabae2c 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 _0x6b5c=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x34fb31,_0x4fbd1b){var _0x894917=function(_0xec5248){while(--_0xec5248){_0x34fb31['push'](_0x34fb31['shift']());}};_0x894917(++_0x4fbd1b);}(_0x6b5c,0x8a));var _0xc6b5=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x6b5c[_0x3d1244];return _0x5d6372;};'use strict';var _=require(_0xc6b5('0x0'));var util=require(_0xc6b5('0x1'));var moment=require('moment');var BPromise=require(_0xc6b5('0x2'));var rs=require(_0xc6b5('0x3'));var fs=require('fs');var Redis=require(_0xc6b5('0x4'));var db=require(_0xc6b5('0x5'))['db'];var utils=require(_0xc6b5('0x6'));var logger=require(_0xc6b5('0x7'))(_0xc6b5('0x8'));var config=require(_0xc6b5('0x9'));var jayson=require(_0xc6b5('0xa'));var client=jayson['client'][_0xc6b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a831,_0x3bc49f,_0x250e43){return new BPromise(function(_0x5ed118,_0x11668c){return client[_0xc6b5('0xc')](_0x53a831,_0x250e43)[_0xc6b5('0xd')](function(_0x127264){logger['info'](_0xc6b5('0xe'),_0x3bc49f,'request\x20sent');logger[_0xc6b5('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3bc49f,_0xc6b5('0x10'),JSON[_0xc6b5('0x11')](_0x127264));if(_0x127264[_0xc6b5('0x12')]){if(_0x127264[_0xc6b5('0x12')][_0xc6b5('0x13')]===0x1f4){logger[_0xc6b5('0x12')](_0xc6b5('0xe'),_0x3bc49f,_0x127264[_0xc6b5('0x12')]['message']);return _0x11668c(_0x127264[_0xc6b5('0x12')][_0xc6b5('0x14')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3bc49f,_0x127264[_0xc6b5('0x12')][_0xc6b5('0x14')]);return _0x5ed118(_0x127264['error'][_0xc6b5('0x14')]);}else{logger['info'](_0xc6b5('0xe'),_0x3bc49f,_0xc6b5('0x10'));_0x5ed118(_0x127264[_0xc6b5('0x15')][_0xc6b5('0x14')]);}})[_0xc6b5('0x16')](function(_0x281d3f){logger[_0xc6b5('0x12')](_0xc6b5('0xe'),_0x3bc49f,_0x281d3f);_0x11668c(_0x281d3f);});});} \ No newline at end of file +var _0x97ec=['http','request','request\x20sent','debug','stringify','code','error','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x19e1e8,_0x150698){var _0x21fc2c=function(_0x55facc){while(--_0x55facc){_0x19e1e8['push'](_0x19e1e8['shift']());}};_0x21fc2c(++_0x150698);}(_0x97ec,0x8f));var _0xc97e=function(_0x2070ac,_0x58d6c8){_0x2070ac=_0x2070ac-0x0;var _0x140205=_0x97ec[_0x2070ac];return _0x140205;};'use strict';var _=require(_0xc97e('0x0'));var util=require(_0xc97e('0x1'));var moment=require(_0xc97e('0x2'));var BPromise=require(_0xc97e('0x3'));var rs=require(_0xc97e('0x4'));var fs=require('fs');var Redis=require(_0xc97e('0x5'));var db=require(_0xc97e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc97e('0x7'))(_0xc97e('0x8'));var config=require('../../config/environment');var jayson=require(_0xc97e('0x9'));var client=jayson[_0xc97e('0xa')][_0xc97e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114fc6,_0x3848ff,_0x2808e9){return new BPromise(function(_0x3ebd1f,_0x4877ff){return client[_0xc97e('0xc')](_0x114fc6,_0x2808e9)['then'](function(_0x1bd2c7){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3848ff,_0xc97e('0xd'));logger[_0xc97e('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3848ff,_0xc97e('0xd'),JSON[_0xc97e('0xf')](_0x1bd2c7));if(_0x1bd2c7['error']){if(_0x1bd2c7['error'][_0xc97e('0x10')]===0x1f4){logger[_0xc97e('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3848ff,_0x1bd2c7[_0xc97e('0x11')]['message']);return _0x4877ff(_0x1bd2c7['error']['message']);}logger[_0xc97e('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3848ff,_0x1bd2c7[_0xc97e('0x11')][_0xc97e('0x12')]);return _0x3ebd1f(_0x1bd2c7[_0xc97e('0x11')][_0xc97e('0x12')]);}else{logger['info'](_0xc97e('0x13'),_0x3848ff,_0xc97e('0xd'));_0x3ebd1f(_0x1bd2c7[_0xc97e('0x14')][_0xc97e('0x12')]);}})[_0xc97e('0x15')](function(_0x2a40a6){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3848ff,_0x2a40a6);_0x4877ff(_0x2a40a6);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2b5de31..913434e 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 _0x4b2f=['describe','/:id','show','/:id/questions','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0x152c9a,_0x15db16){var _0x43a214=function(_0x29ce5e){while(--_0x29ce5e){_0x152c9a['push'](_0x152c9a['shift']());}};_0x43a214(++_0x15db16);}(_0x4b2f,0x81));var _0xf4b2=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x4b2f[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0xf4b2('0x0'));var util=require('util');var path=require(_0xf4b2('0x1'));var timeout=require(_0xf4b2('0x2'));var express=require(_0xf4b2('0x3'));var router=express[_0xf4b2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf4b2('0x5'));var interaction=require(_0xf4b2('0x6'));var config=require('../../config/environment');var controller=require(_0xf4b2('0x7'));router[_0xf4b2('0x8')]('/',auth[_0xf4b2('0x9')](),controller[_0xf4b2('0xa')]);router[_0xf4b2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf4b2('0xb')]);router[_0xf4b2('0x8')](_0xf4b2('0xc'),auth['isAuthenticated'](),controller[_0xf4b2('0xd')]);router['get'](_0xf4b2('0xe'),auth[_0xf4b2('0x9')](),controller['getQuestions']);router['post']('/',auth[_0xf4b2('0x9')](),controller[_0xf4b2('0xf')]);router[_0xf4b2('0x10')]('/:id',auth[_0xf4b2('0x9')](),controller['update']);router[_0xf4b2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf4b2('0x12')]);module[_0xf4b2('0x13')]=router; \ No newline at end of file +var _0x629e=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','describe','/:id','show','/:id/questions','getQuestions','post','put','update','delete','destroy'];(function(_0x588524,_0x249075){var _0x3c2e90=function(_0x40450c){while(--_0x40450c){_0x588524['push'](_0x588524['shift']());}};_0x3c2e90(++_0x249075);}(_0x629e,0x1e3));var _0xe629=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x629e[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xe629('0x0'));var util=require(_0xe629('0x1'));var path=require(_0xe629('0x2'));var timeout=require('connect-timeout');var express=require(_0xe629('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe629('0x4'));var interaction=require(_0xe629('0x5'));var config=require(_0xe629('0x6'));var controller=require(_0xe629('0x7'));router['get']('/',auth[_0xe629('0x8')](),controller[_0xe629('0x9')]);router[_0xe629('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xe629('0xb')]);router[_0xe629('0xa')](_0xe629('0xc'),auth[_0xe629('0x8')](),controller[_0xe629('0xd')]);router['get'](_0xe629('0xe'),auth[_0xe629('0x8')](),controller[_0xe629('0xf')]);router[_0xe629('0x10')]('/',auth[_0xe629('0x8')](),controller['create']);router[_0xe629('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xe629('0x12')]);router[_0xe629('0x13')]('/:id',auth[_0xe629('0x8')](),controller[_0xe629('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index f35c07d..abef84b 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 _0x2ade=['exports','setDataValue','format','DATE','STRING','BOOLEAN','moment'];(function(_0x4f1280,_0x2ecae8){var _0x1c4713=function(_0x45027a){while(--_0x45027a){_0x4f1280['push'](_0x4f1280['shift']());}};_0x1c4713(++_0x2ecae8);}(_0x2ade,0x195));var _0xe2ad=function(_0x519d2b,_0x273a35){_0x519d2b=_0x519d2b-0x0;var _0x28431d=_0x2ade[_0x519d2b];return _0x28431d;};'use strict';var moment=require(_0xe2ad('0x0'));var Sequelize=require('sequelize');module[_0xe2ad('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x40e2be){this[_0xe2ad('0x2')]('starttime',_0x40e2be);this[_0xe2ad('0x2')]('endtime',moment()[_0xe2ad('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xe2ad('0x4')]},'membername':{'type':Sequelize[_0xe2ad('0x5')]},'projectname':{'type':Sequelize[_0xe2ad('0x5')]},'queue':{'type':Sequelize[_0xe2ad('0x5')]},'uniqueid':{'type':Sequelize[_0xe2ad('0x5')]},'calleridname':{'type':Sequelize[_0xe2ad('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xe2ad('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xe9cb=['exports','DATE','setDataValue','starttime','format','STRING','BOOLEAN','moment'];(function(_0x7bd108,_0x2facc7){var _0x1a0666=function(_0x27b35c){while(--_0x27b35c){_0x7bd108['push'](_0x7bd108['shift']());}};_0x1a0666(++_0x2facc7);}(_0xe9cb,0xbf));var _0xbe9c=function(_0x58795d,_0x4826af){_0x58795d=_0x58795d-0x0;var _0x4c7f8d=_0xe9cb[_0x58795d];return _0x4c7f8d;};'use strict';var moment=require(_0xbe9c('0x0'));var Sequelize=require('sequelize');module[_0xbe9c('0x1')]={'starttime':{'type':Sequelize[_0xbe9c('0x2')],'set':function(_0x566a37){this[_0xbe9c('0x3')](_0xbe9c('0x4'),_0x566a37);this['setDataValue']('endtime',moment()[_0xbe9c('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xbe9c('0x2')]},'membername':{'type':Sequelize[_0xbe9c('0x6')]},'projectname':{'type':Sequelize[_0xbe9c('0x6')]},'queue':{'type':Sequelize[_0xbe9c('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe9c('0x6')]},'calleridnum':{'type':Sequelize[_0xbe9c('0x6')]},'completed':{'type':Sequelize[_0xbe9c('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 78136b7..60b2164 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 _0x74aa=['find','create','body','update','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','destroy','then','error','stack','name','send','index','map','JscriptySessionReport','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll'];(function(_0xdf9982,_0x1df601){var _0x2f80b1=function(_0x3b6c6e){while(--_0x3b6c6e){_0xdf9982['push'](_0xdf9982['shift']());}};_0x2f80b1(++_0x1df601);}(_0x74aa,0x186));var _0xa74a=function(_0x21978b,_0x299446){_0x21978b=_0x21978b-0x0;var _0x102c98=_0x74aa[_0x21978b];return _0x102c98;};'use strict';var emlformat=require(_0xa74a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa74a('0x1'));var jsonpatch=require(_0xa74a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa74a('0x3'));var Mustache=require('mustache');var util=require(_0xa74a('0x4'));var path=require(_0xa74a('0x5'));var sox=require(_0xa74a('0x6'));var csv=require(_0xa74a('0x7'));var ejs=require(_0xa74a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa74a('0x9'));var squel=require(_0xa74a('0xa'));var crypto=require(_0xa74a('0xb'));var jsforce=require(_0xa74a('0xc'));var deskjs=require(_0xa74a('0xd'));var toCsv=require(_0xa74a('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa74a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa74a('0xf'));var utils=require(_0xa74a('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xa74a('0x11'));var db=require(_0xa74a('0x12'))['db'];function respondWithStatusCode(_0x2f743d,_0x5f9787){_0x5f9787=_0x5f9787||0xcc;return function(_0x565ea0){if(_0x565ea0){return _0x2f743d[_0xa74a('0x13')](_0x5f9787);}return _0x2f743d[_0xa74a('0x14')](_0x5f9787)[_0xa74a('0x15')]();};}function respondWithResult(_0x288a87,_0x1fa180){_0x1fa180=_0x1fa180||0xc8;return function(_0x31616f){if(_0x31616f){return _0x288a87[_0xa74a('0x14')](_0x1fa180)[_0xa74a('0x16')](_0x31616f);}};}function respondWithFilteredResult(_0x4974c5,_0x396e15){return function(_0xf4d0e7){if(_0xf4d0e7){var _0x4610df=typeof _0x396e15[_0xa74a('0x17')]==='undefined'&&typeof _0x396e15[_0xa74a('0x18')]===_0xa74a('0x19');var _0x5cad63=_0xf4d0e7[_0xa74a('0x1a')];var _0x5e7f9f=_0x4610df?0x0:_0x396e15[_0xa74a('0x17')];var _0x227362=_0x4610df?_0xf4d0e7[_0xa74a('0x1a')]:_0x396e15[_0xa74a('0x17')]+_0x396e15[_0xa74a('0x18')];var _0x4b394e;if(_0x227362>=_0x5cad63){_0x227362=_0x5cad63;_0x4b394e=0xc8;}else{_0x4b394e=0xce;}_0x4974c5[_0xa74a('0x14')](_0x4b394e);return _0x4974c5[_0xa74a('0x1b')]('Content-Range',_0x5e7f9f+'-'+_0x227362+'/'+_0x5cad63)['json'](_0xf4d0e7);}return null;};}function patchUpdates(_0x521b55){return function(_0x59999c){try{jsonpatch[_0xa74a('0x1c')](_0x59999c,_0x521b55,!![]);}catch(_0x1e48e9){return BPromise[_0xa74a('0x1d')](_0x1e48e9);}return _0x59999c['save']();};}function saveUpdates(_0x50df77,_0x4e8037){return function(_0x5cc405){if(_0x5cc405){return _0x5cc405['update'](_0x50df77)['then'](function(_0x2ed1e8){return _0x2ed1e8;});}return null;};}function removeEntity(_0x3b55e5,_0x50911e){return function(_0x80f6f2){if(_0x80f6f2){return _0x80f6f2[_0xa74a('0x1e')]()[_0xa74a('0x1f')](function(){_0x3b55e5[_0xa74a('0x14')](0xcc)[_0xa74a('0x15')]();});}};}function handleEntityNotFound(_0x17ef28,_0x1f2e26){return function(_0x4faf84){if(!_0x4faf84){_0x17ef28[_0xa74a('0x13')](0x194);}return _0x4faf84;};}function handleError(_0x2f780f,_0x4196a9){_0x4196a9=_0x4196a9||0x1f4;return function(_0x2d88c4){logger[_0xa74a('0x20')](_0x2d88c4[_0xa74a('0x21')]);if(_0x2d88c4[_0xa74a('0x22')]){delete _0x2d88c4[_0xa74a('0x22')];}_0x2f780f[_0xa74a('0x14')](_0x4196a9)[_0xa74a('0x23')](_0x2d88c4);};}exports[_0xa74a('0x24')]=function(_0x10950e,_0x5c91ab){var _0x8a564c={},_0x5d92b4={},_0x4236a7={'count':0x0,'rows':[]};var _0x4e20e5=_[_0xa74a('0x25')](db[_0xa74a('0x26')]['rawAttributes'],function(_0x46e31d){return{'name':_0x46e31d['fieldName'],'type':_0x46e31d[_0xa74a('0x27')][_0xa74a('0x28')]};});_0x5d92b4[_0xa74a('0x29')]=_[_0xa74a('0x25')](_0x4e20e5,_0xa74a('0x22'));_0x5d92b4['query']=_['keys'](_0x10950e['query']);_0x5d92b4['filters']=_['intersection'](_0x5d92b4[_0xa74a('0x29')],_0x5d92b4[_0xa74a('0x2a')]);_0x8a564c[_0xa74a('0x2b')]=_[_0xa74a('0x2c')](_0x5d92b4[_0xa74a('0x29')],qs['fields'](_0x10950e['query'][_0xa74a('0x2d')]));_0x8a564c[_0xa74a('0x2b')]=_0x8a564c[_0xa74a('0x2b')][_0xa74a('0x2e')]?_0x8a564c[_0xa74a('0x2b')]:_0x5d92b4[_0xa74a('0x29')];if(!_0x10950e[_0xa74a('0x2a')][_0xa74a('0x2f')](_0xa74a('0x30'))){_0x8a564c['limit']=qs['limit'](_0x10950e['query'][_0xa74a('0x18')]);_0x8a564c['offset']=qs[_0xa74a('0x17')](_0x10950e[_0xa74a('0x2a')][_0xa74a('0x17')]);}_0x8a564c[_0xa74a('0x31')]=qs[_0xa74a('0x32')](_0x10950e['query'][_0xa74a('0x32')]);_0x8a564c[_0xa74a('0x33')]=qs[_0xa74a('0x34')](_[_0xa74a('0x35')](_0x10950e[_0xa74a('0x2a')],_0x5d92b4['filters']),_0x4e20e5);if(_0x10950e['query'][_0xa74a('0x36')]){_0x8a564c[_0xa74a('0x33')]=_[_0xa74a('0x37')](_0x8a564c[_0xa74a('0x33')],{'$or':_[_0xa74a('0x25')](_0x4e20e5,function(_0x1c557c){if(_0x1c557c[_0xa74a('0x27')]!==_0xa74a('0x38')){var _0x316e34={};_0x316e34[_0x1c557c['name']]={'$like':'%'+_0x10950e[_0xa74a('0x2a')][_0xa74a('0x36')]+'%'};return _0x316e34;}})});}_0x8a564c=_[_0xa74a('0x37')]({},_0x8a564c,_0x10950e[_0xa74a('0x39')]);var _0x15aa47={'where':_0x8a564c['where']};return db['JscriptySessionReport'][_0xa74a('0x1a')](_0x15aa47)['then'](function(_0x842802){_0x4236a7[_0xa74a('0x1a')]=_0x842802;if(_0x10950e[_0xa74a('0x2a')]['includeAll']){_0x8a564c[_0xa74a('0x3a')]=[{'all':!![]}];}return db[_0xa74a('0x26')][_0xa74a('0x3b')](_0x8a564c);})[_0xa74a('0x1f')](function(_0x237590){_0x4236a7[_0xa74a('0x3c')]=_0x237590;return _0x4236a7;})[_0xa74a('0x1f')](respondWithFilteredResult(_0x5c91ab,_0x8a564c))[_0xa74a('0x3d')](handleError(_0x5c91ab,null));};exports[_0xa74a('0x3e')]=function(_0x4fbf11,_0x7fc043){var _0xb4196b={'raw':!![],'where':{'id':_0x4fbf11[_0xa74a('0x3f')]['id']}},_0xd1672b={};_0xd1672b[_0xa74a('0x29')]=_['keys'](db['JscriptySessionReport']['rawAttributes']);_0xd1672b['query']=_[_0xa74a('0x40')](_0x4fbf11[_0xa74a('0x2a')]);_0xd1672b[_0xa74a('0x34')]=_[_0xa74a('0x2c')](_0xd1672b[_0xa74a('0x29')],_0xd1672b[_0xa74a('0x2a')]);_0xb4196b[_0xa74a('0x2b')]=_['intersection'](_0xd1672b[_0xa74a('0x29')],qs['fields'](_0x4fbf11[_0xa74a('0x2a')][_0xa74a('0x2d')]));_0xb4196b[_0xa74a('0x2b')]=_0xb4196b[_0xa74a('0x2b')][_0xa74a('0x2e')]?_0xb4196b[_0xa74a('0x2b')]:_0xd1672b[_0xa74a('0x29')];if(_0x4fbf11[_0xa74a('0x2a')][_0xa74a('0x41')]){_0xb4196b[_0xa74a('0x3a')]=[{'all':!![]}];}_0xb4196b=_[_0xa74a('0x37')]({},_0xb4196b,_0x4fbf11[_0xa74a('0x39')]);return db['JscriptySessionReport'][_0xa74a('0x42')](_0xb4196b)[_0xa74a('0x1f')](handleEntityNotFound(_0x7fc043,null))[_0xa74a('0x1f')](respondWithResult(_0x7fc043,null))[_0xa74a('0x3d')](handleError(_0x7fc043,null));};exports[_0xa74a('0x43')]=function(_0x8ba301,_0x30ecde){return db[_0xa74a('0x26')]['create'](_0x8ba301[_0xa74a('0x44')],{})[_0xa74a('0x1f')](respondWithResult(_0x30ecde,0xc9))[_0xa74a('0x3d')](handleError(_0x30ecde,null));};exports[_0xa74a('0x45')]=function(_0x758a57,_0x305fb2){if(_0x758a57['body']['id']){delete _0x758a57[_0xa74a('0x44')]['id'];}return db['JscriptySessionReport'][_0xa74a('0x42')]({'where':{'id':_0x758a57[_0xa74a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x305fb2,null))['then'](saveUpdates(_0x758a57[_0xa74a('0x44')],null))[_0xa74a('0x1f')](respondWithResult(_0x305fb2,null))[_0xa74a('0x3d')](handleError(_0x305fb2,null));};exports[_0xa74a('0x1e')]=function(_0x2ea452,_0x12597e){return db[_0xa74a('0x26')][_0xa74a('0x42')]({'where':{'id':_0x2ea452[_0xa74a('0x3f')]['id']}})[_0xa74a('0x1f')](handleEntityNotFound(_0x12597e,null))[_0xa74a('0x1f')](removeEntity(_0x12597e,null))[_0xa74a('0x3d')](handleError(_0x12597e,null));};exports['describe']=function(_0x1de0bb,_0x114da0){return db[_0xa74a('0x26')][_0xa74a('0x46')]()[_0xa74a('0x1f')](respondWithResult(_0x114da0,null))['catch'](handleError(_0x114da0,null));};exports[_0xa74a('0x47')]=function(_0x460b97,_0x42dab0,_0x5ecc60){var _0x1f9169={'raw':!![],'where':{}};var _0x3a0c73={};var _0x2f85dd={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xa74a('0x48')]({'where':{'id':_0x460b97[_0xa74a('0x3f')]['id']}})[_0xa74a('0x1f')](handleEntityNotFound(_0x42dab0,null))[_0xa74a('0x1f')](function(_0x43ceb7){if(_0x43ceb7){_0x3a0c73[_0xa74a('0x29')]=_['keys'](db[_0xa74a('0x49')][_0xa74a('0x4a')]);_0x3a0c73[_0xa74a('0x2a')]=_[_0xa74a('0x40')](_0x460b97['query']);_0x3a0c73[_0xa74a('0x34')]=_[_0xa74a('0x2c')](_0x3a0c73[_0xa74a('0x29')],_0x3a0c73[_0xa74a('0x2a')]);_0x1f9169[_0xa74a('0x2b')]=_['intersection'](_0x3a0c73[_0xa74a('0x29')],qs[_0xa74a('0x2d')](_0x460b97[_0xa74a('0x2a')]['fields']));_0x1f9169[_0xa74a('0x2b')]=_0x1f9169[_0xa74a('0x2b')][_0xa74a('0x2e')]?_0x1f9169['attributes']:_0x3a0c73[_0xa74a('0x29')];if(!_0x460b97['query'][_0xa74a('0x2f')](_0xa74a('0x30'))){_0x1f9169[_0xa74a('0x18')]=qs[_0xa74a('0x18')](_0x460b97[_0xa74a('0x2a')][_0xa74a('0x18')]);_0x1f9169[_0xa74a('0x17')]=qs[_0xa74a('0x17')](_0x460b97['query']['offset']);}_0x1f9169[_0xa74a('0x31')]=qs[_0xa74a('0x32')](_0x460b97[_0xa74a('0x2a')]['sort']);_0x1f9169[_0xa74a('0x33')]=qs[_0xa74a('0x34')](_[_0xa74a('0x35')](_0x460b97[_0xa74a('0x2a')],_0x3a0c73['filters']));_0x1f9169['where'][_0xa74a('0x4b')]=_0x43ceb7['id'];if(_0x460b97[_0xa74a('0x2a')][_0xa74a('0x36')]){_0x1f9169[_0xa74a('0x33')]=_['merge'](_0x1f9169[_0xa74a('0x33')],{'$or':_[_0xa74a('0x25')](_0x1f9169[_0xa74a('0x2b')],function(_0x5dce10){var _0x4fb6ef={};_0x4fb6ef[_0x5dce10]={'$like':'%'+_0x460b97[_0xa74a('0x2a')][_0xa74a('0x36')]+'%'};return _0x4fb6ef;})});}_0x1f9169=_[_0xa74a('0x37')]({},_0x1f9169,_0x460b97[_0xa74a('0x39')]);return db[_0xa74a('0x49')][_0xa74a('0x1a')]({'where':_0x1f9169[_0xa74a('0x33')]})[_0xa74a('0x1f')](function(_0x12c776){_0x2f85dd[_0xa74a('0x1a')]=_0x12c776;if(_0x460b97[_0xa74a('0x2a')]['includeAll']){_0x1f9169[_0xa74a('0x3a')]=[{'all':!![]}];}return db[_0xa74a('0x49')][_0xa74a('0x3b')](_0x1f9169);})[_0xa74a('0x1f')](function(_0x374c29){_0x2f85dd[_0xa74a('0x3c')]=_0x374c29;return _0x2f85dd;});}})[_0xa74a('0x1f')](respondWithFilteredResult(_0x42dab0,_0x1f9169))[_0xa74a('0x3d')](handleError(_0x42dab0,null));}; \ No newline at end of file +var _0xe82f=['find','create','body','params','describe','findOne','JscriptyQuestionReport','SessionId','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','name','send','map','JscriptySessionReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe82f,0xa2));var _0xfe82=function(_0x1d4967,_0x17d5eb){_0x1d4967=_0x1d4967-0x0;var _0x33a0ee=_0xe82f[_0x1d4967];return _0x33a0ee;};'use strict';var emlformat=require(_0xfe82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe82('0x1'));var jsonpatch=require(_0xfe82('0x2'));var rp=require(_0xfe82('0x3'));var moment=require('moment');var BPromise=require(_0xfe82('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe82('0x5'));var sox=require(_0xfe82('0x6'));var csv=require('to-csv');var ejs=require(_0xfe82('0x7'));var fs=require('fs');var fs_extra=require(_0xfe82('0x8'));var _=require(_0xfe82('0x9'));var squel=require('squel');var crypto=require(_0xfe82('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfe82('0xb'));var Papa=require(_0xfe82('0xc'));var Redis=require(_0xfe82('0xd'));var authService=require(_0xfe82('0xe'));var qs=require(_0xfe82('0xf'));var as=require(_0xfe82('0x10'));var hardwareService=require(_0xfe82('0x11'));var logger=require(_0xfe82('0x12'))(_0xfe82('0x13'));var utils=require(_0xfe82('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfe82('0x15'));var db=require(_0xfe82('0x16'))['db'];function respondWithStatusCode(_0x27497c,_0x2c2d4a){_0x2c2d4a=_0x2c2d4a||0xcc;return function(_0x1eba05){if(_0x1eba05){return _0x27497c[_0xfe82('0x17')](_0x2c2d4a);}return _0x27497c[_0xfe82('0x18')](_0x2c2d4a)['end']();};}function respondWithResult(_0x33b7b4,_0x99e69f){_0x99e69f=_0x99e69f||0xc8;return function(_0x194c3a){if(_0x194c3a){return _0x33b7b4[_0xfe82('0x18')](_0x99e69f)[_0xfe82('0x19')](_0x194c3a);}};}function respondWithFilteredResult(_0x599e16,_0x652aa8){return function(_0x2955e6){if(_0x2955e6){var _0x388adc=typeof _0x652aa8[_0xfe82('0x1a')]==='undefined'&&typeof _0x652aa8['limit']===_0xfe82('0x1b');var _0x190458=_0x2955e6['count'];var _0x153c08=_0x388adc?0x0:_0x652aa8[_0xfe82('0x1a')];var _0x39f228=_0x388adc?_0x2955e6[_0xfe82('0x1c')]:_0x652aa8[_0xfe82('0x1a')]+_0x652aa8[_0xfe82('0x1d')];var _0x4dabc8;if(_0x39f228>=_0x190458){_0x39f228=_0x190458;_0x4dabc8=0xc8;}else{_0x4dabc8=0xce;}_0x599e16['status'](_0x4dabc8);return _0x599e16[_0xfe82('0x1e')](_0xfe82('0x1f'),_0x153c08+'-'+_0x39f228+'/'+_0x190458)[_0xfe82('0x19')](_0x2955e6);}return null;};}function patchUpdates(_0x37c82b){return function(_0xa59b8e){try{jsonpatch[_0xfe82('0x20')](_0xa59b8e,_0x37c82b,!![]);}catch(_0x262580){return BPromise[_0xfe82('0x21')](_0x262580);}return _0xa59b8e['save']();};}function saveUpdates(_0x403ba7,_0x32d2b5){return function(_0x46fc96){if(_0x46fc96){return _0x46fc96[_0xfe82('0x22')](_0x403ba7)[_0xfe82('0x23')](function(_0x4fbd62){return _0x4fbd62;});}return null;};}function removeEntity(_0x6c9daa,_0x20d16a){return function(_0x489173){if(_0x489173){return _0x489173[_0xfe82('0x24')]()['then'](function(){_0x6c9daa[_0xfe82('0x18')](0xcc)[_0xfe82('0x25')]();});}};}function handleEntityNotFound(_0x1a0074,_0x448703){return function(_0x489690){if(!_0x489690){_0x1a0074[_0xfe82('0x17')](0x194);}return _0x489690;};}function handleError(_0x4adc83,_0xc26c72){_0xc26c72=_0xc26c72||0x1f4;return function(_0x4f4c69){logger['error'](_0x4f4c69['stack']);if(_0x4f4c69[_0xfe82('0x26')]){delete _0x4f4c69['name'];}_0x4adc83[_0xfe82('0x18')](_0xc26c72)[_0xfe82('0x27')](_0x4f4c69);};}exports['index']=function(_0x3cdd19,_0x27328e){var _0x4db76f={},_0x26c87a={},_0xc2e690={'count':0x0,'rows':[]};var _0x579ad2=_[_0xfe82('0x28')](db[_0xfe82('0x29')][_0xfe82('0x2a')],function(_0x4d7df2){return{'name':_0x4d7df2['fieldName'],'type':_0x4d7df2[_0xfe82('0x2b')]['key']};});_0x26c87a[_0xfe82('0x2c')]=_['map'](_0x579ad2,_0xfe82('0x26'));_0x26c87a['query']=_[_0xfe82('0x2d')](_0x3cdd19[_0xfe82('0x2e')]);_0x26c87a[_0xfe82('0x2f')]=_[_0xfe82('0x30')](_0x26c87a[_0xfe82('0x2c')],_0x26c87a[_0xfe82('0x2e')]);_0x4db76f[_0xfe82('0x31')]=_['intersection'](_0x26c87a[_0xfe82('0x2c')],qs[_0xfe82('0x32')](_0x3cdd19[_0xfe82('0x2e')][_0xfe82('0x32')]));_0x4db76f['attributes']=_0x4db76f[_0xfe82('0x31')][_0xfe82('0x33')]?_0x4db76f[_0xfe82('0x31')]:_0x26c87a['model'];if(!_0x3cdd19[_0xfe82('0x2e')][_0xfe82('0x34')](_0xfe82('0x35'))){_0x4db76f[_0xfe82('0x1d')]=qs['limit'](_0x3cdd19[_0xfe82('0x2e')][_0xfe82('0x1d')]);_0x4db76f['offset']=qs[_0xfe82('0x1a')](_0x3cdd19[_0xfe82('0x2e')]['offset']);}_0x4db76f[_0xfe82('0x36')]=qs['sort'](_0x3cdd19['query'][_0xfe82('0x37')]);_0x4db76f[_0xfe82('0x38')]=qs[_0xfe82('0x2f')](_[_0xfe82('0x39')](_0x3cdd19['query'],_0x26c87a[_0xfe82('0x2f')]),_0x579ad2);if(_0x3cdd19[_0xfe82('0x2e')][_0xfe82('0x3a')]){_0x4db76f[_0xfe82('0x38')]=_[_0xfe82('0x3b')](_0x4db76f[_0xfe82('0x38')],{'$or':_[_0xfe82('0x28')](_0x579ad2,function(_0x193ed3){if(_0x193ed3['type']!==_0xfe82('0x3c')){var _0x198f41={};_0x198f41[_0x193ed3[_0xfe82('0x26')]]={'$like':'%'+_0x3cdd19['query'][_0xfe82('0x3a')]+'%'};return _0x198f41;}})});}_0x4db76f=_[_0xfe82('0x3b')]({},_0x4db76f,_0x3cdd19[_0xfe82('0x3d')]);var _0x53e98a={'where':_0x4db76f[_0xfe82('0x38')]};return db[_0xfe82('0x29')][_0xfe82('0x1c')](_0x53e98a)['then'](function(_0x341397){_0xc2e690[_0xfe82('0x1c')]=_0x341397;if(_0x3cdd19[_0xfe82('0x2e')][_0xfe82('0x3e')]){_0x4db76f['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x4db76f);})['then'](function(_0xb982d9){_0xc2e690['rows']=_0xb982d9;return _0xc2e690;})[_0xfe82('0x23')](respondWithFilteredResult(_0x27328e,_0x4db76f))[_0xfe82('0x3f')](handleError(_0x27328e,null));};exports[_0xfe82('0x40')]=function(_0x29f51b,_0x277571){var _0x567a07={'raw':!![],'where':{'id':_0x29f51b['params']['id']}},_0x2b9584={};_0x2b9584[_0xfe82('0x2c')]=_[_0xfe82('0x2d')](db[_0xfe82('0x29')][_0xfe82('0x2a')]);_0x2b9584['query']=_[_0xfe82('0x2d')](_0x29f51b[_0xfe82('0x2e')]);_0x2b9584['filters']=_[_0xfe82('0x30')](_0x2b9584[_0xfe82('0x2c')],_0x2b9584[_0xfe82('0x2e')]);_0x567a07[_0xfe82('0x31')]=_[_0xfe82('0x30')](_0x2b9584[_0xfe82('0x2c')],qs[_0xfe82('0x32')](_0x29f51b['query'][_0xfe82('0x32')]));_0x567a07['attributes']=_0x567a07[_0xfe82('0x31')][_0xfe82('0x33')]?_0x567a07[_0xfe82('0x31')]:_0x2b9584[_0xfe82('0x2c')];if(_0x29f51b[_0xfe82('0x2e')][_0xfe82('0x3e')]){_0x567a07[_0xfe82('0x41')]=[{'all':!![]}];}_0x567a07=_[_0xfe82('0x3b')]({},_0x567a07,_0x29f51b[_0xfe82('0x3d')]);return db[_0xfe82('0x29')][_0xfe82('0x42')](_0x567a07)['then'](handleEntityNotFound(_0x277571,null))[_0xfe82('0x23')](respondWithResult(_0x277571,null))[_0xfe82('0x3f')](handleError(_0x277571,null));};exports['create']=function(_0xf630cb,_0x17a7e9){return db['JscriptySessionReport'][_0xfe82('0x43')](_0xf630cb['body'],{})['then'](respondWithResult(_0x17a7e9,0xc9))['catch'](handleError(_0x17a7e9,null));};exports['update']=function(_0x59aebe,_0x429264){if(_0x59aebe['body']['id']){delete _0x59aebe[_0xfe82('0x44')]['id'];}return db['JscriptySessionReport'][_0xfe82('0x42')]({'where':{'id':_0x59aebe[_0xfe82('0x45')]['id']}})[_0xfe82('0x23')](handleEntityNotFound(_0x429264,null))['then'](saveUpdates(_0x59aebe[_0xfe82('0x44')],null))[_0xfe82('0x23')](respondWithResult(_0x429264,null))[_0xfe82('0x3f')](handleError(_0x429264,null));};exports['destroy']=function(_0x427de7,_0x5a87ba){return db[_0xfe82('0x29')][_0xfe82('0x42')]({'where':{'id':_0x427de7['params']['id']}})[_0xfe82('0x23')](handleEntityNotFound(_0x5a87ba,null))[_0xfe82('0x23')](removeEntity(_0x5a87ba,null))[_0xfe82('0x3f')](handleError(_0x5a87ba,null));};exports['describe']=function(_0x3a6929,_0x31c3c0){return db[_0xfe82('0x29')][_0xfe82('0x46')]()[_0xfe82('0x23')](respondWithResult(_0x31c3c0,null))[_0xfe82('0x3f')](handleError(_0x31c3c0,null));};exports['getQuestions']=function(_0x4df5f6,_0x181de2,_0x143ffd){var _0x25dd70={'raw':!![],'where':{}};var _0x392551={};var _0x10d726={'count':0x0,'rows':[]};return db[_0xfe82('0x29')][_0xfe82('0x47')]({'where':{'id':_0x4df5f6[_0xfe82('0x45')]['id']}})[_0xfe82('0x23')](handleEntityNotFound(_0x181de2,null))[_0xfe82('0x23')](function(_0x109d3d){if(_0x109d3d){_0x392551[_0xfe82('0x2c')]=_[_0xfe82('0x2d')](db[_0xfe82('0x48')][_0xfe82('0x2a')]);_0x392551['query']=_['keys'](_0x4df5f6[_0xfe82('0x2e')]);_0x392551[_0xfe82('0x2f')]=_[_0xfe82('0x30')](_0x392551['model'],_0x392551[_0xfe82('0x2e')]);_0x25dd70[_0xfe82('0x31')]=_[_0xfe82('0x30')](_0x392551[_0xfe82('0x2c')],qs[_0xfe82('0x32')](_0x4df5f6['query'][_0xfe82('0x32')]));_0x25dd70['attributes']=_0x25dd70[_0xfe82('0x31')][_0xfe82('0x33')]?_0x25dd70[_0xfe82('0x31')]:_0x392551['model'];if(!_0x4df5f6[_0xfe82('0x2e')][_0xfe82('0x34')](_0xfe82('0x35'))){_0x25dd70[_0xfe82('0x1d')]=qs[_0xfe82('0x1d')](_0x4df5f6[_0xfe82('0x2e')][_0xfe82('0x1d')]);_0x25dd70[_0xfe82('0x1a')]=qs['offset'](_0x4df5f6[_0xfe82('0x2e')][_0xfe82('0x1a')]);}_0x25dd70[_0xfe82('0x36')]=qs[_0xfe82('0x37')](_0x4df5f6['query'][_0xfe82('0x37')]);_0x25dd70['where']=qs[_0xfe82('0x2f')](_[_0xfe82('0x39')](_0x4df5f6['query'],_0x392551[_0xfe82('0x2f')]));_0x25dd70['where'][_0xfe82('0x49')]=_0x109d3d['id'];if(_0x4df5f6[_0xfe82('0x2e')][_0xfe82('0x3a')]){_0x25dd70[_0xfe82('0x38')]=_[_0xfe82('0x3b')](_0x25dd70['where'],{'$or':_[_0xfe82('0x28')](_0x25dd70[_0xfe82('0x31')],function(_0x5da7a3){var _0x1ee0bf={};_0x1ee0bf[_0x5da7a3]={'$like':'%'+_0x4df5f6[_0xfe82('0x2e')][_0xfe82('0x3a')]+'%'};return _0x1ee0bf;})});}_0x25dd70=_['merge']({},_0x25dd70,_0x4df5f6[_0xfe82('0x3d')]);return db['JscriptyQuestionReport'][_0xfe82('0x1c')]({'where':_0x25dd70['where']})[_0xfe82('0x23')](function(_0x118aba){_0x10d726[_0xfe82('0x1c')]=_0x118aba;if(_0x4df5f6[_0xfe82('0x2e')][_0xfe82('0x3e')]){_0x25dd70[_0xfe82('0x41')]=[{'all':!![]}];}return db[_0xfe82('0x48')][_0xfe82('0x4a')](_0x25dd70);})[_0xfe82('0x23')](function(_0x374d87){_0x10d726[_0xfe82('0x4b')]=_0x374d87;return _0x10d726;});}})[_0xfe82('0x23')](respondWithFilteredResult(_0x181de2,_0x25dd70))[_0xfe82('0x3f')](handleError(_0x181de2,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 7345a29..5fb548e 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 _0xacf4=['define','JscriptySessionReport','report_jscripty_sessions','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptySessionReport.attributes','exports'];(function(_0x153a08,_0x8d956d){var _0x334eaf=function(_0x55f4ec){while(--_0x55f4ec){_0x153a08['push'](_0x153a08['shift']());}};_0x334eaf(++_0x8d956d);}(_0xacf4,0xe7));var _0x4acf=function(_0x554611,_0x11ced4){_0x554611=_0x554611-0x0;var _0x4fbc11=_0xacf4[_0x554611];return _0x4fbc11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb4c7=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2572e0,_0x27c30b){_0x2572e0=_0x2572e0-0x0;var _0x4829a2=_0xb4c7[_0x2572e0];return _0x4829a2;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var logger=require(_0x7b4c('0x2'))(_0x7b4c('0x3'));var moment=require(_0x7b4c('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b4c('0x5'));var fs=require('fs');var path=require(_0x7b4c('0x6'));var rimraf=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var attributes=require(_0x7b4c('0x9'));module['exports']=function(_0x1b0f57,_0x10e197){return _0x1b0f57[_0x7b4c('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x7b4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 68b270d..175abcc 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0xadb5,0xad));var _0x5adb=function(_0x5999ce,_0x51bc2f){_0x5999ce=_0x5999ce-0x0;var _0x5406c1=_0xadb5[_0x5999ce];return _0x5406c1;};'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']('JscriptySessionReport,\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 _0x781d=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s'];(function(_0x3d6fe4,_0x4b962a){var _0x3c33f5=function(_0x536010){while(--_0x536010){_0x3d6fe4['push'](_0x3d6fe4['shift']());}};_0x3c33f5(++_0x4b962a);}(_0x781d,0x14a));var _0xd781=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x781d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 6b9ed4a..c3427d6 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 _0x0be3=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','put','/:id','update','exports'];(function(_0x4cd021,_0x39fa02){var _0x846d25=function(_0x51fc6c){while(--_0x51fc6c){_0x4cd021['push'](_0x4cd021['shift']());}};_0x846d25(++_0x39fa02);}(_0x0be3,0x9a));var _0x30be=function(_0x33a48c,_0x4676f1){_0x33a48c=_0x33a48c-0x0;var _0x512897=_0x0be3[_0x33a48c];return _0x512897;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x30be('0x0'));var timeout=require(_0x30be('0x1'));var express=require(_0x30be('0x2'));var router=express['Router']();var fs_extra=require(_0x30be('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x30be('0x4'));var config=require(_0x30be('0x5'));var controller=require(_0x30be('0x6'));router['get']('/',controller['index']);router[_0x30be('0x7')](_0x30be('0x8'),auth['isAuthenticated'](),controller[_0x30be('0x9')]);module[_0x30be('0xa')]=router; \ No newline at end of file +var _0x0a25=['./license.controller','get','index','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e3480,_0x4e9223){var _0x4293e8=function(_0x1f6c51){while(--_0x1f6c51){_0x1e3480['push'](_0x1e3480['shift']());}};_0x4293e8(++_0x4e9223);}(_0x0a25,0x68));var _0x50a2=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0x0a25[_0x270a54];return _0x4d07d0;};'use strict';var multer=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var path=require('path');var timeout=require(_0x50a2('0x2'));var express=require(_0x50a2('0x3'));var router=express['Router']();var fs_extra=require(_0x50a2('0x4'));var auth=require(_0x50a2('0x5'));var interaction=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var controller=require(_0x50a2('0x8'));router[_0x50a2('0x9')]('/',controller[_0x50a2('0xa')]);router[_0x50a2('0xb')](_0x50a2('0xc'),auth[_0x50a2('0xd')](),controller[_0x50a2('0xe')]);module[_0x50a2('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index c14ae95..5945d88 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 _0x7f32=['TEXT','STRING','INTEGER','exports'];(function(_0x5be4d1,_0x1d389b){var _0x210077=function(_0x80941d){while(--_0x80941d){_0x5be4d1['push'](_0x5be4d1['shift']());}};_0x210077(++_0x1d389b);}(_0x7f32,0x107));var _0x27f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7f32[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x27f3('0x0')]={'license':{'type':Sequelize[_0x27f3('0x1')]},'data1':{'type':Sequelize[_0x27f3('0x2')]},'data2':{'type':Sequelize[_0x27f3('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x27f3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5abe=['INTEGER','exports','TEXT','STRING'];(function(_0x53a3cb,_0x18a0e2){var _0x3b298a=function(_0x861f25){while(--_0x861f25){_0x53a3cb['push'](_0x53a3cb['shift']());}};_0x3b298a(++_0x18a0e2);}(_0x5abe,0x91));var _0xe5ab=function(_0x180963,_0x20e62e){_0x180963=_0x180963-0x0;var _0x541850=_0x5abe[_0x180963];return _0x541850;};'use strict';var Sequelize=require('sequelize');module[_0xe5ab('0x0')]={'license':{'type':Sequelize[_0xe5ab('0x1')]},'data1':{'type':Sequelize[_0xe5ab('0x2')]},'data2':{'type':Sequelize[_0xe5ab('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xe5ab('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index b65edd3..dea6dee 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 _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf494,0x1c6));var _0x4f49=function(_0x306168,_0x523acf){_0x306168=_0x306168-0x0;var _0xba1a11=_0xf494[_0x306168];return _0xba1a11;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file +var _0x2ef3=['length','options','then','catch','body','params','get','checkLicense','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x36f32a,_0x2cade4){var _0x47f97e=function(_0x14a418){while(--_0x14a418){_0x36f32a['push'](_0x36f32a['shift']());}};_0x47f97e(++_0x2cade4);}(_0x2ef3,0xba));var _0x32ef=function(_0x266c1c,_0x56f0ea){_0x266c1c=_0x266c1c-0x0;var _0x55d6e2=_0x2ef3[_0x266c1c];return _0x55d6e2;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}var utilLicense=require('../../config/license/util');exports[_0x32ef('0x29')]=function(_0x2f5d06,_0x5a04cd){var _0x12de1a={'raw':!![],'where':{'id':0x1}},_0x3c569d={};_0x3c569d[_0x32ef('0x2a')]=_[_0x32ef('0x2b')](db['License'][_0x32ef('0x2c')]);_0x3c569d[_0x32ef('0x2d')]=_[_0x32ef('0x2b')](_0x2f5d06[_0x32ef('0x2d')]);_0x3c569d[_0x32ef('0x2e')]=_[_0x32ef('0x2f')](_0x3c569d[_0x32ef('0x2a')],_0x3c569d['query']);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x3c569d[_0x32ef('0x2a')],qs[_0x32ef('0x31')](_0x2f5d06['query'][_0x32ef('0x31')]));_0x12de1a[_0x32ef('0x30')]=_0x12de1a[_0x32ef('0x30')][_0x32ef('0x32')]?_0x12de1a[_0x32ef('0x30')]:_0x3c569d['model'];_0x12de1a=_['merge']({},_0x12de1a,_0x2f5d06[_0x32ef('0x33')]);return utilLicense['getLicense'](_0x12de1a)[_0x32ef('0x34')](respondWithResult(_0x5a04cd,null))[_0x32ef('0x35')](handleError(_0x5a04cd,null));};exports[_0x32ef('0x24')]=function(_0x390670,_0x389583){if(_0x390670[_0x32ef('0x36')]['id']){delete _0x390670['body']['id'];}return db['License']['find']({'where':{'id':_0x390670[_0x32ef('0x37')]['id']}})[_0x32ef('0x34')](handleEntityNotFound(_0x389583,null))[_0x32ef('0x34')](function(_0x5f2443){var _0x4fb402=_0x5f2443[_0x32ef('0x38')]({'plain':!![]});return utilLicense[_0x32ef('0x39')](_0x4fb402,_0x390670[_0x32ef('0x36')]['key']);})['then'](function(_0xcbdec8){if(!_0xcbdec8[_0x32ef('0x3a')]){return saveUpdates(_0x390670[_0x32ef('0x36')],null);}return _0xcbdec8;})[_0x32ef('0x34')](respondWithResult(_0x389583,null))[_0x32ef('0x35')](handleError(_0x389583,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index a5a37b7..bd2f327 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 _0x4b3a=['../../config/environment','exports','define','license','util','../../config/logger','api','moment','request-promise','path'];(function(_0x26e89f,_0x2cf803){var _0x3759f0=function(_0x51df81){while(--_0x51df81){_0x26e89f['push'](_0x26e89f['shift']());}};_0x3759f0(++_0x2cf803);}(_0x4b3a,0x16c));var _0xa4b3=function(_0xf17151,_0x2cea91){_0xf17151=_0xf17151-0x0;var _0x3483eb=_0x4b3a[_0xf17151];return _0x3483eb;};'use strict';var _=require('lodash');var util=require(_0xa4b3('0x0'));var logger=require(_0xa4b3('0x1'))(_0xa4b3('0x2'));var moment=require(_0xa4b3('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4b3('0x4'));var fs=require('fs');var path=require(_0xa4b3('0x5'));var rimraf=require('rimraf');var config=require(_0xa4b3('0x6'));var attributes=require('./license.attributes');module[_0xa4b3('0x7')]=function(_0xc13b62,_0x14d5f5){return _0xc13b62[_0xa4b3('0x8')]('License',attributes,{'tableName':_0xa4b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cf7=['License','license','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define'];(function(_0x202e38,_0x1be01d){var _0xf4c051=function(_0x67d36){while(--_0x67d36){_0x202e38['push'](_0x202e38['shift']());}};_0xf4c051(++_0x1be01d);}(_0x2cf7,0x120));var _0x72cf=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x2cf7[_0x427352];return _0x23e0e6;};'use strict';var _=require(_0x72cf('0x0'));var util=require(_0x72cf('0x1'));var logger=require('../../config/logger')(_0x72cf('0x2'));var moment=require(_0x72cf('0x3'));var BPromise=require(_0x72cf('0x4'));var rp=require(_0x72cf('0x5'));var fs=require('fs');var path=require(_0x72cf('0x6'));var rimraf=require('rimraf');var config=require(_0x72cf('0x7'));var attributes=require(_0x72cf('0x8'));module[_0x72cf('0x9')]=function(_0x1da313,_0x54200c){return _0x1da313[_0x72cf('0xa')](_0x72cf('0xb'),attributes,{'tableName':_0x72cf('0xc'),'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 d25242e..4113d78 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 _0x89f1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','bluebird','randomstring'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x89f1,0x19f));var _0x189f=function(_0x548503,_0x1aa00c){_0x548503=_0x548503-0x0;var _0xf8f05f=_0x89f1[_0x548503];return _0xf8f05f;};'use strict';var _=require('lodash');var util=require(_0x189f('0x0'));var moment=require('moment');var BPromise=require(_0x189f('0x1'));var rs=require(_0x189f('0x2'));var fs=require('fs');var Redis=require(_0x189f('0x3'));var db=require(_0x189f('0x4'))['db'];var utils=require(_0x189f('0x5'));var logger=require(_0x189f('0x6'))('rpc');var config=require(_0x189f('0x7'));var jayson=require(_0x189f('0x8'));var client=jayson[_0x189f('0x9')][_0x189f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20b647,_0x4a9914,_0x17f04e){return new BPromise(function(_0x2b3e68,_0x14239b){return client['request'](_0x20b647,_0x17f04e)['then'](function(_0x1a358c){logger['info'](_0x189f('0xb'),_0x4a9914,_0x189f('0xc'));logger['debug'](_0x189f('0xd'),_0x4a9914,_0x189f('0xc'),JSON[_0x189f('0xe')](_0x1a358c));if(_0x1a358c[_0x189f('0xf')]){if(_0x1a358c[_0x189f('0xf')]['code']===0x1f4){logger[_0x189f('0xf')]('License,\x20%s,\x20%s',_0x4a9914,_0x1a358c['error']['message']);return _0x14239b(_0x1a358c[_0x189f('0xf')]['message']);}logger[_0x189f('0xf')](_0x189f('0xb'),_0x4a9914,_0x1a358c[_0x189f('0xf')]['message']);return _0x2b3e68(_0x1a358c['error'][_0x189f('0x10')]);}else{logger[_0x189f('0x11')](_0x189f('0xb'),_0x4a9914,_0x189f('0xc'));_0x2b3e68(_0x1a358c[_0x189f('0x12')]['message']);}})['catch'](function(_0x2bcb7f){logger[_0x189f('0xf')]('License,\x20%s,\x20%s',_0x4a9914,_0x2bcb7f);_0x14239b(_0x2bcb7f);});});} \ No newline at end of file +var _0x215e=['moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2603cf,_0x3e9864){var _0x818959=function(_0x4f19a1){while(--_0x4f19a1){_0x2603cf['push'](_0x2603cf['shift']());}};_0x818959(++_0x3e9864);}(_0x215e,0x109));var _0xe215=function(_0x1f3395,_0x168e18){_0x1f3395=_0x1f3395-0x0;var _0x565b0e=_0x215e[_0x1f3395];return _0x565b0e;};'use strict';var _=require(_0xe215('0x0'));var util=require('util');var moment=require(_0xe215('0x1'));var BPromise=require('bluebird');var rs=require(_0xe215('0x2'));var fs=require('fs');var Redis=require(_0xe215('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe215('0x4'));var logger=require(_0xe215('0x5'))('rpc');var config=require(_0xe215('0x6'));var jayson=require(_0xe215('0x7'));var client=jayson[_0xe215('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0aee,_0x4b361f,_0x2dfc6c){return new BPromise(function(_0x220d3a,_0x1dd11b){return client['request'](_0x4d0aee,_0x2dfc6c)[_0xe215('0x9')](function(_0x5c417d){logger['info'](_0xe215('0xa'),_0x4b361f,_0xe215('0xb'));logger[_0xe215('0xc')](_0xe215('0xd'),_0x4b361f,_0xe215('0xb'),JSON[_0xe215('0xe')](_0x5c417d));if(_0x5c417d['error']){if(_0x5c417d[_0xe215('0xf')][_0xe215('0x10')]===0x1f4){logger[_0xe215('0xf')](_0xe215('0xa'),_0x4b361f,_0x5c417d[_0xe215('0xf')][_0xe215('0x11')]);return _0x1dd11b(_0x5c417d[_0xe215('0xf')]['message']);}logger[_0xe215('0xf')](_0xe215('0xa'),_0x4b361f,_0x5c417d[_0xe215('0xf')][_0xe215('0x11')]);return _0x220d3a(_0x5c417d['error'][_0xe215('0x11')]);}else{logger['info'](_0xe215('0xa'),_0x4b361f,_0xe215('0xb'));_0x220d3a(_0x5c417d[_0xe215('0x12')][_0xe215('0x11')]);}})['catch'](function(_0x562eda){logger['error']('License,\x20%s,\x20%s',_0x4b361f,_0x562eda);_0x1dd11b(_0x562eda);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7697d9d..d506d0d 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 _0xdec2=['getAgents','post','/:id/dispositions','addDisposition','create','addInteraction','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','/:id/users'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdec2,0xde));var _0x2dec=function(_0x58d9e8,_0x1994bf){_0x58d9e8=_0x58d9e8-0x0;var _0x5a0ed2=_0xdec2[_0x58d9e8];return _0x5a0ed2;};'use strict';var multer=require(_0x2dec('0x0'));var util=require(_0x2dec('0x1'));var path=require(_0x2dec('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2dec('0x3'));var auth=require(_0x2dec('0x4'));var interaction=require(_0x2dec('0x5'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x2dec('0x6')]('/',auth[_0x2dec('0x7')](),controller['index']);router[_0x2dec('0x6')](_0x2dec('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x2dec('0x6')](_0x2dec('0x9'),auth['isAuthenticated'](),controller[_0x2dec('0xa')]);router[_0x2dec('0x6')]('/:id/dispositions',auth[_0x2dec('0x7')](),controller[_0x2dec('0xb')]);router[_0x2dec('0x6')](_0x2dec('0xc'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x2dec('0x6')](_0x2dec('0xd'),auth[_0x2dec('0x7')](),controller[_0x2dec('0xe')]);router[_0x2dec('0x6')](_0x2dec('0xf'),auth['isAuthenticated'](),controller[_0x2dec('0x10')]);router[_0x2dec('0x6')](_0x2dec('0x11'),auth['isAuthenticated'](),controller[_0x2dec('0x12')]);router[_0x2dec('0x6')](_0x2dec('0x13'),auth[_0x2dec('0x7')](),controller['getApplications']);router[_0x2dec('0x6')](_0x2dec('0x14'),auth['isAuthenticated'](),controller[_0x2dec('0x15')]);router[_0x2dec('0x6')](_0x2dec('0x16'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x2dec('0x6')](_0x2dec('0x17'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x18')]);router[_0x2dec('0x19')](_0x2dec('0x1a'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x1b')]);router['post'](_0x2dec('0xc'),auth[_0x2dec('0x7')](),controller['addAnswer']);router[_0x2dec('0x19')]('/',auth['isAuthenticated'](),controller[_0x2dec('0x1c')]);router['post'](_0x2dec('0xd'),auth[_0x2dec('0x7')](),controller['addImap']);router['post'](_0x2dec('0xf'),auth[_0x2dec('0x7')](),controller['addSmtp']);router['post'](_0x2dec('0x11'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x1d')]);router['post'](_0x2dec('0x13'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x1e')]);router[_0x2dec('0x19')](_0x2dec('0x1f'),auth['isAuthenticated'](),controller['send']);router['post'](_0x2dec('0x17'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x20')]);router[_0x2dec('0x21')](_0x2dec('0x9'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x22')]);router[_0x2dec('0x23')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2dec('0x24')]);router[_0x2dec('0x23')]('/:id/canned_answers',auth[_0x2dec('0x7')](),controller[_0x2dec('0x25')]);router[_0x2dec('0x23')](_0x2dec('0xd'),auth['isAuthenticated'](),controller[_0x2dec('0x26')]);router['delete'](_0x2dec('0xf'),auth[_0x2dec('0x7')](),controller['removeSmtp']);router[_0x2dec('0x23')](_0x2dec('0x9'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x27')]);router[_0x2dec('0x23')](_0x2dec('0x17'),auth[_0x2dec('0x7')](),controller[_0x2dec('0x28')]);module['exports']=router; \ No newline at end of file +var _0xac08=['getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','addDisposition','addAnswer','post','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xac08,0xa6));var _0x8ac0=function(_0x962d42,_0xc5f826){_0x962d42=_0x962d42-0x0;var _0x506f3b=_0xac08[_0x962d42];return _0x506f3b;};'use strict';var multer=require(_0x8ac0('0x0'));var util=require(_0x8ac0('0x1'));var path=require(_0x8ac0('0x2'));var timeout=require(_0x8ac0('0x3'));var express=require(_0x8ac0('0x4'));var router=express['Router']();var fs_extra=require(_0x8ac0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8ac0('0x6'));var config=require(_0x8ac0('0x7'));var controller=require(_0x8ac0('0x8'));router[_0x8ac0('0x9')]('/',auth['isAuthenticated'](),controller[_0x8ac0('0xa')]);router[_0x8ac0('0x9')](_0x8ac0('0xb'),auth[_0x8ac0('0xc')](),controller['describe']);router[_0x8ac0('0x9')](_0x8ac0('0xd'),auth[_0x8ac0('0xc')](),controller['show']);router['get'](_0x8ac0('0xe'),auth[_0x8ac0('0xc')](),controller['getDispositions']);router[_0x8ac0('0x9')](_0x8ac0('0xf'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x10')]);router['get'](_0x8ac0('0x11'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x12')]);router[_0x8ac0('0x9')]('/:id/out_servers',auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x13')]);router[_0x8ac0('0x9')](_0x8ac0('0x14'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x15')]);router[_0x8ac0('0x9')]('/:id/applications',auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x16')]);router[_0x8ac0('0x9')](_0x8ac0('0x17'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x18')]);router[_0x8ac0('0x9')]('/:id/verify',auth['isAuthenticated'](),controller[_0x8ac0('0x19')]);router[_0x8ac0('0x9')](_0x8ac0('0x1a'),auth[_0x8ac0('0xc')](),controller['getAgents']);router['post'](_0x8ac0('0xe'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x1b')]);router['post'](_0x8ac0('0xf'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x1c')]);router[_0x8ac0('0x1d')]('/',auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x1e')]);router[_0x8ac0('0x1d')](_0x8ac0('0x11'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x1f')]);router[_0x8ac0('0x1d')](_0x8ac0('0x20'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x21')]);router[_0x8ac0('0x1d')](_0x8ac0('0x14'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x22')]);router['post'](_0x8ac0('0x23'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x24')]);router[_0x8ac0('0x1d')](_0x8ac0('0x25'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x26')]);router['post']('/:id/users',auth[_0x8ac0('0xc')](),controller['addAgents']);router['put'](_0x8ac0('0xd'),auth['isAuthenticated'](),controller[_0x8ac0('0x27')]);router[_0x8ac0('0x28')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8ac0('0x29')]);router[_0x8ac0('0x28')](_0x8ac0('0xf'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x2a')]);router['delete'](_0x8ac0('0x11'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x2b')]);router[_0x8ac0('0x28')](_0x8ac0('0x20'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x2c')]);router[_0x8ac0('0x28')]('/:id',auth[_0x8ac0('0xc')](),controller['destroy']);router[_0x8ac0('0x28')](_0x8ac0('0x1a'),auth[_0x8ac0('0xc')](),controller[_0x8ac0('0x2d')]);module[_0x8ac0('0x2e')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 1bc0c4b..56e9e77 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 _0x7579=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x1eee49,_0x46c891){var _0x45c304=function(_0x5e9d43){while(--_0x5e9d43){_0x1eee49['push'](_0x1eee49['shift']());}};_0x45c304(++_0x46c891);}(_0x7579,0x1e2));var _0x9757=function(_0x148ebe,_0x1235dd){_0x148ebe=_0x148ebe-0x0;var _0x204b9a=_0x7579[_0x148ebe];return _0x204b9a;};'use strict';var Sequelize=require(_0x9757('0x0'));module[_0x9757('0x1')]={'description':{'type':Sequelize[_0x9757('0x2')]},'name':{'type':Sequelize[_0x9757('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x9757('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9757('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x9757('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x9757('0x4')]},'markAsUnread':{'type':Sequelize[_0x9757('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9757('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x9757('0x5')](0x2)[_0x9757('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9757('0x4')],'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[_0x9757('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9757('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9757('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9757('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9757('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9757('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x9757('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x9757('0x3')],'defaultValue':![],'comment':_0x9757('0x8'),'set':function(_0x399cca){if(!_0x399cca)this[_0x9757('0x9')](_0x9757('0xa'),null);this[_0x9757('0x9')](_0x9757('0xb'),_0x399cca);}}}; \ No newline at end of file +var _0xaa7c=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x402e3e,_0x38ea52){var _0x2f56bb=function(_0x134124){while(--_0x134124){_0x402e3e['push'](_0x402e3e['shift']());}};_0x2f56bb(++_0x38ea52);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x190c18,_0x10891a){_0x190c18=_0x190c18-0x0;var _0x125ad4=_0xaa7c[_0x190c18];return _0x125ad4;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xcaa7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xcaa7('0x3')]},'markAsUnread':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcaa7('0x1')],'allowNull':![],'defaultValue':_0xcaa7('0x4')},'fontSize':{'type':Sequelize[_0xcaa7('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xcaa7('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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcaa7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcaa7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcaa7('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xcaa7('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e037c){if(!_0x2e037c)this[_0xcaa7('0x7')](_0xcaa7('0x8'),null);this[_0xcaa7('0x7')](_0xcaa7('0x9'),_0x2e037c);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b4eae14..adba0f9 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 _0x1d62=['$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','defaults','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','localhost','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','get','MailAccounts','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','include','MailAccount','rows','params','mandatoryDispositionPause','options','find','body','update','describe','MailAccountId','Disposition','getDispositions','findOne','nolimit','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','ListId','isNil','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','addInteraction','MailInteraction','CmContact','Contact','User','Owner','Tag','Tags','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1d62,0x1af));var _0x21d6=function(_0x1dbeab,_0x4a1619){_0x1dbeab=_0x1dbeab-0x0;var _0x5662db=_0x1d62[_0x1dbeab];return _0x5662db;};'use strict';var emlformat=require(_0x21d6('0x0'));var rimraf=require(_0x21d6('0x1'));var zipdir=require(_0x21d6('0x2'));var jsonpatch=require(_0x21d6('0x3'));var rp=require(_0x21d6('0x4'));var moment=require('moment');var BPromise=require(_0x21d6('0x5'));var Mustache=require(_0x21d6('0x6'));var util=require(_0x21d6('0x7'));var path=require(_0x21d6('0x8'));var sox=require(_0x21d6('0x9'));var csv=require(_0x21d6('0xa'));var ejs=require(_0x21d6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x21d6('0xc'));var crypto=require(_0x21d6('0xd'));var jsforce=require(_0x21d6('0xe'));var deskjs=require(_0x21d6('0xf'));var toCsv=require(_0x21d6('0xa'));var querystring=require(_0x21d6('0x10'));var Papa=require(_0x21d6('0x11'));var htmlToText=require(_0x21d6('0x12'));var juice=require(_0x21d6('0x13'));var Redis=require('ioredis');var authService=require(_0x21d6('0x14'));var qs=require(_0x21d6('0x15'));var as=require(_0x21d6('0x16'));var hardwareService=require(_0x21d6('0x17'));var logger=require(_0x21d6('0x18'))(_0x21d6('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x21d6('0x1a'));var db=require('../../mysqldb')['db'];config[_0x21d6('0x1b')]=_['defaults'](config[_0x21d6('0x1b')],{'host':_0x21d6('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x21d6('0x1d'))[_0x21d6('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x21d6('0x1f')][_0x21d6('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x258554,_0x3d40e6,_0x148b96,_0x56b5f7){return new BPromise(function(_0x2a2b32,_0xf8abc6){var _0x3e8001=_0x56b5f7||client;return _0x3e8001[_0x21d6('0x21')](_0x258554,_0x148b96)[_0x21d6('0x22')](function(_0x3e3b0b){logger[_0x21d6('0x23')](_0x21d6('0x24'),_0x3d40e6,_0x21d6('0x25'));logger[_0x21d6('0x26')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3d40e6,'request\x20sent',JSON['stringify'](_0x3e3b0b));if(_0x3e3b0b[_0x21d6('0x27')]){if(_0x3e3b0b[_0x21d6('0x27')][_0x21d6('0x28')]===0x1f4){logger['error'](_0x21d6('0x24'),_0x3d40e6,_0x3e3b0b[_0x21d6('0x27')][_0x21d6('0x29')]);return _0xf8abc6(_0x3e3b0b[_0x21d6('0x27')][_0x21d6('0x29')]);}logger[_0x21d6('0x27')](_0x21d6('0x24'),_0x3d40e6,_0x3e3b0b[_0x21d6('0x27')][_0x21d6('0x29')]);return _0x2a2b32(_0x3e3b0b[_0x21d6('0x27')][_0x21d6('0x29')]);}else{logger[_0x21d6('0x23')](_0x21d6('0x24'),_0x3d40e6,'request\x20sent');_0x2a2b32(_0x3e3b0b['result'][_0x21d6('0x29')]);}})[_0x21d6('0x2a')](function(_0x599ea5){logger[_0x21d6('0x27')]('MailAccount,\x20%s,\x20%s',_0x3d40e6,_0x599ea5);_0xf8abc6(_0x599ea5);});});}function respondWithStatusCode(_0x4b53f5,_0x15ebd6){_0x15ebd6=_0x15ebd6||0xcc;return function(_0x20add1){if(_0x20add1){return _0x4b53f5[_0x21d6('0x2b')](_0x15ebd6);}return _0x4b53f5['status'](_0x15ebd6)[_0x21d6('0x2c')]();};}function respondWithResult(_0x208d73,_0xe87c0f){_0xe87c0f=_0xe87c0f||0xc8;return function(_0x5ea242){if(_0x5ea242){return _0x208d73[_0x21d6('0x2d')](_0xe87c0f)[_0x21d6('0x2e')](_0x5ea242);}};}function respondWithFilteredResult(_0x2a176e,_0x15f2e1){return function(_0x4112cb){if(_0x4112cb){var _0x3b9b1d=typeof _0x15f2e1[_0x21d6('0x2f')]===_0x21d6('0x30')&&typeof _0x15f2e1[_0x21d6('0x31')]===_0x21d6('0x30');var _0x55c49e=_0x4112cb[_0x21d6('0x32')];var _0x35968b=_0x3b9b1d?0x0:_0x15f2e1['offset'];var _0x549c32=_0x3b9b1d?_0x4112cb[_0x21d6('0x32')]:_0x15f2e1[_0x21d6('0x2f')]+_0x15f2e1[_0x21d6('0x31')];var _0x272875;if(_0x549c32>=_0x55c49e){_0x549c32=_0x55c49e;_0x272875=0xc8;}else{_0x272875=0xce;}_0x2a176e[_0x21d6('0x2d')](_0x272875);return _0x2a176e[_0x21d6('0x33')]('Content-Range',_0x35968b+'-'+_0x549c32+'/'+_0x55c49e)[_0x21d6('0x2e')](_0x4112cb);}return null;};}function patchUpdates(_0xcf011e){return function(_0x40e1ed){try{jsonpatch['apply'](_0x40e1ed,_0xcf011e,!![]);}catch(_0xbbaf23){return BPromise[_0x21d6('0x34')](_0xbbaf23);}return _0x40e1ed['save']();};}function saveUpdates(_0x3baa3e,_0x3a2e69){return function(_0x28b9e8){if(_0x28b9e8){return _0x28b9e8['update'](_0x3baa3e)[_0x21d6('0x22')](function(_0x359072){return _0x359072;});}return null;};}function removeEntity(_0x455a4e,_0x48fcb7){return function(_0x1dd687){if(_0x1dd687){return _0x1dd687['destroy']()[_0x21d6('0x22')](function(){var _0x3bf066=_0x1dd687[_0x21d6('0x35')]({'plain':!![]});var _0x102b87=_0x21d6('0x36');return db[_0x21d6('0x37')][_0x21d6('0x38')]({'where':{'type':_0x102b87,'resourceId':_0x3bf066['id']}})[_0x21d6('0x22')](function(){return _0x1dd687;});})['then'](function(){_0x455a4e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24a298,_0x27df6f){return function(_0x4033b7){if(!_0x4033b7){_0x24a298['sendStatus'](0x194);}return _0x4033b7;};}function handleError(_0x8b8dce,_0x456e6c){_0x456e6c=_0x456e6c||0x1f4;return function(_0x789953){logger[_0x21d6('0x27')](_0x789953[_0x21d6('0x39')]);if(_0x789953[_0x21d6('0x3a')]){delete _0x789953[_0x21d6('0x3a')];}_0x8b8dce[_0x21d6('0x2d')](_0x456e6c)[_0x21d6('0x3b')](_0x789953);};}exports[_0x21d6('0x3c')]=function(_0x4eda56,_0x45d28c){var _0x5e391c={'include':[{'model':db[_0x21d6('0x3d')],'as':_0x21d6('0x3e')},{'model':db[_0x21d6('0x3f')],'as':_0x21d6('0x40')},{'model':db[_0x21d6('0x41')],'as':'mandatoryDispositionPause'}]},_0x27ba24={},_0x557b59={'count':0x0,'rows':[]};var _0x61311f=_[_0x21d6('0x42')](db['MailAccount'][_0x21d6('0x43')],function(_0x414bc7){return{'name':_0x414bc7[_0x21d6('0x44')],'type':_0x414bc7[_0x21d6('0x45')][_0x21d6('0x46')]};});_0x27ba24[_0x21d6('0x47')]=_[_0x21d6('0x42')](_0x61311f,'name');_0x27ba24[_0x21d6('0x48')]=_[_0x21d6('0x49')](_0x4eda56[_0x21d6('0x48')]);_0x27ba24[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0x27ba24['model'],_0x27ba24['query']);_0x5e391c[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0x27ba24['model'],qs['fields'](_0x4eda56[_0x21d6('0x48')][_0x21d6('0x4d')]));_0x5e391c[_0x21d6('0x4c')]=_0x5e391c['attributes'][_0x21d6('0x4e')]?_0x5e391c[_0x21d6('0x4c')]:_0x27ba24['model'];if(!_0x4eda56[_0x21d6('0x48')][_0x21d6('0x4f')]('nolimit')){_0x5e391c['limit']=qs['limit'](_0x4eda56[_0x21d6('0x48')][_0x21d6('0x31')]);_0x5e391c['offset']=qs[_0x21d6('0x2f')](_0x4eda56[_0x21d6('0x48')]['offset']);}_0x5e391c[_0x21d6('0x50')]=qs[_0x21d6('0x51')](_0x4eda56[_0x21d6('0x48')][_0x21d6('0x51')]);_0x5e391c[_0x21d6('0x52')]=qs[_0x21d6('0x4a')](_[_0x21d6('0x53')](_0x4eda56[_0x21d6('0x48')],_0x27ba24[_0x21d6('0x4a')]),_0x61311f);if(_0x4eda56[_0x21d6('0x48')]['filter']){_0x5e391c[_0x21d6('0x52')]=_[_0x21d6('0x54')](_0x5e391c['where'],{'$or':_[_0x21d6('0x42')](_0x61311f,function(_0x31678c){if(_0x31678c[_0x21d6('0x45')]!=='VIRTUAL'){var _0x58af41={};_0x58af41[_0x31678c['name']]={'$like':'%'+_0x4eda56[_0x21d6('0x48')][_0x21d6('0x55')]+'%'};return _0x58af41;}})});}_0x5e391c=_[_0x21d6('0x54')]({},_0x5e391c,_0x4eda56['options']);var _0x3513e5={'where':_0x5e391c[_0x21d6('0x52')]};return db['MailAccount']['count'](_0x3513e5)['then'](function(_0x2466d7){_0x557b59[_0x21d6('0x32')]=_0x2466d7;if(_0x4eda56[_0x21d6('0x48')][_0x21d6('0x56')]){_0x5e391c[_0x21d6('0x57')]=[{'all':!![]}];}return db[_0x21d6('0x58')]['findAll'](_0x5e391c);})[_0x21d6('0x22')](function(_0x513761){_0x557b59[_0x21d6('0x59')]=_0x513761;return _0x557b59;})[_0x21d6('0x22')](respondWithFilteredResult(_0x45d28c,_0x5e391c))[_0x21d6('0x2a')](handleError(_0x45d28c,null));};exports['show']=function(_0x4ffe26,_0x1763fa){var _0x226722={'raw':![],'where':{'id':_0x4ffe26[_0x21d6('0x5a')]['id']},'include':[{'model':db[_0x21d6('0x3d')],'as':'Imap'},{'model':db[_0x21d6('0x3f')],'as':_0x21d6('0x40')},{'model':db[_0x21d6('0x41')],'as':_0x21d6('0x5b')}]},_0x56f0f5={};_0x56f0f5[_0x21d6('0x47')]=_[_0x21d6('0x49')](db[_0x21d6('0x58')]['rawAttributes']);_0x56f0f5['query']=_[_0x21d6('0x49')](_0x4ffe26[_0x21d6('0x48')]);_0x56f0f5[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0x56f0f5[_0x21d6('0x47')],_0x56f0f5[_0x21d6('0x48')]);_0x226722[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0x56f0f5[_0x21d6('0x47')],qs[_0x21d6('0x4d')](_0x4ffe26['query'][_0x21d6('0x4d')]));_0x226722[_0x21d6('0x4c')]=_0x226722[_0x21d6('0x4c')][_0x21d6('0x4e')]?_0x226722['attributes']:_0x56f0f5['model'];if(_0x4ffe26[_0x21d6('0x48')][_0x21d6('0x56')]){_0x226722[_0x21d6('0x57')]=[{'all':!![]}];}_0x226722=_[_0x21d6('0x54')]({},_0x226722,_0x4ffe26[_0x21d6('0x5c')]);return db[_0x21d6('0x58')][_0x21d6('0x5d')](_0x226722)['then'](handleEntityNotFound(_0x1763fa,null))[_0x21d6('0x22')](respondWithResult(_0x1763fa,null))[_0x21d6('0x2a')](handleError(_0x1763fa,null));};exports['update']=function(_0x401271,_0x4b6877){if(_0x401271['body']['id']){delete _0x401271['body']['id'];}return db[_0x21d6('0x58')][_0x21d6('0x5d')]({'where':{'id':_0x401271[_0x21d6('0x5a')]['id']},'include':[{'model':db[_0x21d6('0x3d')],'as':'Imap'},{'model':db[_0x21d6('0x3f')],'as':'Smtp'},{'model':db[_0x21d6('0x41')],'as':_0x21d6('0x5b')}]})[_0x21d6('0x22')](handleEntityNotFound(_0x4b6877,null))[_0x21d6('0x22')](saveUpdates(_0x401271[_0x21d6('0x5e')],null))[_0x21d6('0x22')](function(_0x42f71b){if(_0x42f71b&&_0x401271[_0x21d6('0x5e')]['Imap']){return db[_0x21d6('0x3d')][_0x21d6('0x5f')](_0x401271['body']['Imap'],{'where':{'MailAccountId':_0x42f71b['id']}})[_0x21d6('0x22')](function(){return _0x42f71b;});}return _0x42f71b;})[_0x21d6('0x22')](function(_0x1fc65e){if(_0x1fc65e&&_0x401271[_0x21d6('0x5e')]['Smtp']){return db[_0x21d6('0x3f')][_0x21d6('0x5f')](_0x401271[_0x21d6('0x5e')][_0x21d6('0x40')],{'where':{'MailAccountId':_0x1fc65e['id']}})[_0x21d6('0x22')](function(){return _0x1fc65e;});}return _0x1fc65e;})[_0x21d6('0x22')](respondWithResult(_0x4b6877,null))[_0x21d6('0x2a')](handleError(_0x4b6877,null));};exports['describe']=function(_0x119f53,_0x17e1fe){return db['MailAccount'][_0x21d6('0x60')]()[_0x21d6('0x22')](respondWithResult(_0x17e1fe,null))[_0x21d6('0x2a')](handleError(_0x17e1fe,null));};exports['addDisposition']=function(_0x9296e2,_0x243b39,_0x1394e0){if(_0x9296e2['body']['id']){delete _0x9296e2[_0x21d6('0x5e')]['id'];}return db[_0x21d6('0x58')]['find']({'where':{'id':_0x9296e2['params']['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x243b39,null))[_0x21d6('0x22')](function(_0x1e2952){if(_0x1e2952){_0x9296e2[_0x21d6('0x5e')][_0x21d6('0x61')]=_0x1e2952['id'];return db[_0x21d6('0x62')]['create'](_0x9296e2[_0x21d6('0x5e')]);}})['then'](respondWithResult(_0x243b39,null))[_0x21d6('0x2a')](handleError(_0x243b39,null));};exports[_0x21d6('0x63')]=function(_0x7e49e8,_0x12a8fd,_0x321ce1){var _0x43e727={'raw':![],'where':{}};var _0x31c819={};var _0x4fd837={'count':0x0,'rows':[]};return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x7e49e8['params']['id']}})['then'](handleEntityNotFound(_0x12a8fd,null))[_0x21d6('0x22')](function(_0x39051e){if(_0x39051e){_0x31c819['model']=_[_0x21d6('0x49')](db[_0x21d6('0x62')][_0x21d6('0x43')]);_0x31c819[_0x21d6('0x48')]=_[_0x21d6('0x49')](_0x7e49e8[_0x21d6('0x48')]);_0x31c819['filters']=_[_0x21d6('0x4b')](_0x31c819[_0x21d6('0x47')],_0x31c819[_0x21d6('0x48')]);_0x43e727[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0x31c819['model'],qs['fields'](_0x7e49e8['query'][_0x21d6('0x4d')]));_0x43e727[_0x21d6('0x4c')]=_0x43e727[_0x21d6('0x4c')][_0x21d6('0x4e')]?_0x43e727[_0x21d6('0x4c')]:_0x31c819[_0x21d6('0x47')];if(!_0x7e49e8[_0x21d6('0x48')][_0x21d6('0x4f')](_0x21d6('0x65'))){_0x43e727[_0x21d6('0x31')]=qs[_0x21d6('0x31')](_0x7e49e8['query']['limit']);_0x43e727[_0x21d6('0x2f')]=qs[_0x21d6('0x2f')](_0x7e49e8[_0x21d6('0x48')][_0x21d6('0x2f')]);}_0x43e727['order']=qs[_0x21d6('0x51')](_0x7e49e8[_0x21d6('0x48')]['sort']);_0x43e727[_0x21d6('0x52')]=qs[_0x21d6('0x4a')](_[_0x21d6('0x53')](_0x7e49e8['query'],_0x31c819['filters']));_0x43e727[_0x21d6('0x52')][_0x21d6('0x61')]=_0x39051e['id'];if(_0x7e49e8[_0x21d6('0x48')][_0x21d6('0x55')]){_0x43e727[_0x21d6('0x52')]=_[_0x21d6('0x54')](_0x43e727[_0x21d6('0x52')],{'$or':_[_0x21d6('0x42')](_0x43e727[_0x21d6('0x4c')],function(_0x21078c){var _0x28654f={};_0x28654f[_0x21078c]={'$like':'%'+_0x7e49e8[_0x21d6('0x48')][_0x21d6('0x55')]+'%'};return _0x28654f;})});}_0x43e727=_[_0x21d6('0x54')]({},_0x43e727,_0x7e49e8[_0x21d6('0x5c')]);return db['Disposition'][_0x21d6('0x32')]({'where':_0x43e727[_0x21d6('0x52')]})['then'](function(_0x76253){_0x4fd837[_0x21d6('0x32')]=_0x76253;if(_0x7e49e8['query']['includeAll']){_0x43e727[_0x21d6('0x57')]=[{'all':!![]}];}return db['Disposition'][_0x21d6('0x66')](_0x43e727);})[_0x21d6('0x22')](function(_0x262b67){_0x4fd837[_0x21d6('0x59')]=_0x262b67;return _0x4fd837;});}})[_0x21d6('0x22')](respondWithFilteredResult(_0x12a8fd,_0x43e727))[_0x21d6('0x2a')](handleError(_0x12a8fd,null));};exports['removeDispositions']=function(_0x56291e,_0x283a5c,_0x8831eb){return db[_0x21d6('0x58')][_0x21d6('0x5d')]({'where':{'id':_0x56291e['params']['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x283a5c,null))[_0x21d6('0x22')](function(_0x457602){if(_0x457602){return _0x457602[_0x21d6('0x67')](_0x56291e['query']['ids']);}})[_0x21d6('0x22')](respondWithStatusCode(_0x283a5c,null))['catch'](handleError(_0x283a5c,null));};exports[_0x21d6('0x68')]=function(_0x3d451e,_0xaae494,_0x4d4b43){if(_0x3d451e[_0x21d6('0x5e')]['id']){delete _0x3d451e[_0x21d6('0x5e')]['id'];}return db[_0x21d6('0x58')][_0x21d6('0x5d')]({'where':{'id':_0x3d451e[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0xaae494,null))[_0x21d6('0x22')](function(_0x491f98){if(_0x491f98){_0x3d451e[_0x21d6('0x5e')][_0x21d6('0x61')]=_0x491f98['id'];return db['CannedAnswer']['create'](_0x3d451e[_0x21d6('0x5e')]);}})['then'](respondWithResult(_0xaae494,null))[_0x21d6('0x2a')](handleError(_0xaae494,null));};exports[_0x21d6('0x69')]=function(_0x514772,_0x191336,_0x25dbd4){var _0x20f22d={'raw':![],'where':{}};var _0x3ed46e={};var _0x445c3e={'count':0x0,'rows':[]};return db[_0x21d6('0x58')]['findOne']({'where':{'id':_0x514772[_0x21d6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x191336,null))[_0x21d6('0x22')](function(_0xc6a8c1){if(_0xc6a8c1){_0x3ed46e[_0x21d6('0x47')]=_['keys'](db['CannedAnswer'][_0x21d6('0x43')]);_0x3ed46e[_0x21d6('0x48')]=_['keys'](_0x514772[_0x21d6('0x48')]);_0x3ed46e[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0x3ed46e[_0x21d6('0x47')],_0x3ed46e[_0x21d6('0x48')]);_0x20f22d[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0x3ed46e[_0x21d6('0x47')],qs[_0x21d6('0x4d')](_0x514772[_0x21d6('0x48')]['fields']));_0x20f22d[_0x21d6('0x4c')]=_0x20f22d[_0x21d6('0x4c')][_0x21d6('0x4e')]?_0x20f22d['attributes']:_0x3ed46e[_0x21d6('0x47')];if(!_0x514772[_0x21d6('0x48')]['hasOwnProperty'](_0x21d6('0x65'))){_0x20f22d[_0x21d6('0x31')]=qs['limit'](_0x514772[_0x21d6('0x48')]['limit']);_0x20f22d['offset']=qs[_0x21d6('0x2f')](_0x514772['query'][_0x21d6('0x2f')]);}_0x20f22d[_0x21d6('0x50')]=qs[_0x21d6('0x51')](_0x514772[_0x21d6('0x48')][_0x21d6('0x51')]);_0x20f22d[_0x21d6('0x52')]=qs[_0x21d6('0x4a')](_[_0x21d6('0x53')](_0x514772[_0x21d6('0x48')],_0x3ed46e[_0x21d6('0x4a')]));_0x20f22d[_0x21d6('0x52')][_0x21d6('0x61')]=_0xc6a8c1['id'];if(_0x514772[_0x21d6('0x48')]['filter']){_0x20f22d[_0x21d6('0x52')]=_[_0x21d6('0x54')](_0x20f22d[_0x21d6('0x52')],{'$or':_['map'](_0x20f22d[_0x21d6('0x4c')],function(_0x26bf5b){var _0x5e135a={};_0x5e135a[_0x26bf5b]={'$like':'%'+_0x514772['query'][_0x21d6('0x55')]+'%'};return _0x5e135a;})});}_0x20f22d=_[_0x21d6('0x54')]({},_0x20f22d,_0x514772[_0x21d6('0x5c')]);return db['CannedAnswer']['count']({'where':_0x20f22d['where']})[_0x21d6('0x22')](function(_0x3bac49){_0x445c3e[_0x21d6('0x32')]=_0x3bac49;if(_0x514772[_0x21d6('0x48')][_0x21d6('0x56')]){_0x20f22d['include']=[{'all':!![]}];}return db[_0x21d6('0x6a')][_0x21d6('0x66')](_0x20f22d);})[_0x21d6('0x22')](function(_0x58f6b5){_0x445c3e['rows']=_0x58f6b5;return _0x445c3e;});}})['then'](respondWithFilteredResult(_0x191336,_0x20f22d))[_0x21d6('0x2a')](handleError(_0x191336,null));};exports[_0x21d6('0x6b')]=function(_0x3e44a1,_0x4194e9,_0x50d155){return db[_0x21d6('0x58')]['find']({'where':{'id':_0x3e44a1[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x4194e9,null))[_0x21d6('0x22')](function(_0x40051e){if(_0x40051e){return _0x40051e[_0x21d6('0x6b')](_0x3e44a1[_0x21d6('0x48')][_0x21d6('0x6c')]);}})[_0x21d6('0x22')](respondWithStatusCode(_0x4194e9,null))[_0x21d6('0x2a')](handleError(_0x4194e9,null));};exports['create']=function(_0x5093bb,_0x2e6619){var _0x2eb5d8={'name':_0x5093bb[_0x21d6('0x5e')]['name'],'key':_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x46')],'email':_0x5093bb['body']['email'],'ListId':_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x6d')],'active':!_['isNil'](_0x5093bb[_0x21d6('0x5e')]['active'])?_0x5093bb[_0x21d6('0x5e')]['active']:!![],'description':_0x5093bb['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x21d6('0x6e')](_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x6f')])){if(_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x70')]){_0x2eb5d8[_0x21d6('0x3e')][_0x21d6('0x71')]=_0x2eb5d8[_0x21d6('0x40')][_0x21d6('0x71')]=_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x72')];_0x2eb5d8['Imap']['password']=_0x2eb5d8[_0x21d6('0x40')][_0x21d6('0x73')]=_0x5093bb['body'][_0x21d6('0x74')];}else{_0x2eb5d8[_0x21d6('0x3e')][_0x21d6('0x75')]=_0x2eb5d8[_0x21d6('0x40')][_0x21d6('0x75')]=![];}_0x2eb5d8[_0x21d6('0x3e')][_0x21d6('0x76')]=_0x5093bb[_0x21d6('0x5e')]['Imap']['host'];_0x2eb5d8[_0x21d6('0x3e')][_0x21d6('0x77')]=_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x3e')][_0x21d6('0x77')];_0x2eb5d8[_0x21d6('0x40')]['host']=_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x40')][_0x21d6('0x76')];_0x2eb5d8[_0x21d6('0x40')][_0x21d6('0x77')]=_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x40')][_0x21d6('0x77')];}else{_0x2eb5d8[_0x21d6('0x3e')][_0x21d6('0x78')]=_0x2eb5d8['Smtp'][_0x21d6('0x78')]=_0x5093bb['body'][_0x21d6('0x6f')];_0x2eb5d8['Imap']['user']=_0x2eb5d8['Smtp'][_0x21d6('0x71')]=_0x5093bb[_0x21d6('0x5e')][_0x21d6('0x72')];_0x2eb5d8['Imap'][_0x21d6('0x79')]=_0x2eb5d8[_0x21d6('0x40')][_0x21d6('0x73')]=_0x5093bb[_0x21d6('0x5e')]['cpassword'];}return db['MailAccount'][_0x21d6('0x7a')](_0x2eb5d8,{'include':[{'model':db[_0x21d6('0x3f')],'as':'Smtp'},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x21d6('0x22')](function(_0x394602){var _0x114606=_0x5093bb[_0x21d6('0x71')][_0x21d6('0x35')]({'plain':!![]});if(!_0x114606)throw new Error(_0x21d6('0x7b'));if(_0x114606[_0x21d6('0x7c')]===_0x21d6('0x71')){var _0x55f7c8=_0x394602[_0x21d6('0x35')]({'plain':!![]});return db[_0x21d6('0x7d')][_0x21d6('0x5d')]({'where':{'name':_0x21d6('0x36'),'userProfileId':_0x114606[_0x21d6('0x7e')]},'raw':!![]})['then'](function(_0x109ce5){if(_0x109ce5&&_0x109ce5['autoAssociation']===0x0){return db[_0x21d6('0x37')][_0x21d6('0x7a')]({'name':_0x55f7c8[_0x21d6('0x3a')],'resourceId':_0x55f7c8['id'],'type':_0x109ce5[_0x21d6('0x3a')],'sectionId':_0x109ce5['id']},{})[_0x21d6('0x22')](function(){return _0x394602;});}else{return _0x394602;}})[_0x21d6('0x2a')](function(_0x42cee6){logger[_0x21d6('0x27')](_0x21d6('0x7f'),_0x42cee6);throw _0x42cee6;});}return _0x394602;})[_0x21d6('0x22')](respondWithResult(_0x2e6619,0xc9))['catch'](handleError(_0x2e6619,null));};exports[_0x21d6('0x80')]=function(_0x4f6ac9,_0x5531f2,_0xb4a57d){return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x4f6ac9[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x5531f2,null))[_0x21d6('0x22')](function(_0x1bec99){if(_0x1bec99){return _0x1bec99[_0x21d6('0x80')]();}return null;})[_0x21d6('0x22')](respondWithResult(_0x5531f2,null))['catch'](handleError(_0x5531f2,null));};exports[_0x21d6('0x81')]=function(_0x4a44ae,_0x2d937c,_0x29fa0a){if(_0x4a44ae[_0x21d6('0x5e')]['id']){delete _0x4a44ae[_0x21d6('0x5e')]['id'];}return db[_0x21d6('0x58')][_0x21d6('0x5d')]({'where':{'id':_0x4a44ae[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x2d937c,null))[_0x21d6('0x22')](function(_0x5e58b2){if(_0x5e58b2){_0x4a44ae['body'][_0x21d6('0x61')]=_0x5e58b2['id'];return db['MailServerIn'][_0x21d6('0x7a')](_0x4a44ae[_0x21d6('0x5e')]);}})[_0x21d6('0x22')](respondWithResult(_0x2d937c,null))[_0x21d6('0x2a')](handleError(_0x2d937c,null));};exports[_0x21d6('0x82')]=function(_0x565ff5,_0x4f33ae,_0x5b15b6){return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x565ff5[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x4f33ae,null))[_0x21d6('0x22')](function(_0x3a6757){if(_0x3a6757){return _0x3a6757['setImap'](null);}return null;})[_0x21d6('0x22')](respondWithStatusCode(_0x4f33ae,null))[_0x21d6('0x2a')](handleError(_0x4f33ae,null));};exports[_0x21d6('0x83')]=function(_0x1e1dc1,_0x25127d,_0x4ab43c){return db[_0x21d6('0x58')]['findOne']({'where':{'id':_0x1e1dc1[_0x21d6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x25127d,null))[_0x21d6('0x22')](function(_0x3f53ed){if(_0x3f53ed){return _0x3f53ed[_0x21d6('0x83')]();}return null;})[_0x21d6('0x22')](respondWithResult(_0x25127d,null))[_0x21d6('0x2a')](handleError(_0x25127d,null));};exports['addSmtp']=function(_0xdf7ce3,_0x379c40,_0x4fd05a){if(_0xdf7ce3[_0x21d6('0x5e')]['id']){delete _0xdf7ce3['body']['id'];}return db[_0x21d6('0x58')][_0x21d6('0x5d')]({'where':{'id':_0xdf7ce3['params']['id']}})['then'](handleEntityNotFound(_0x379c40,null))[_0x21d6('0x22')](function(_0x1838be){if(_0x1838be){_0xdf7ce3[_0x21d6('0x5e')][_0x21d6('0x61')]=_0x1838be['id'];return db[_0x21d6('0x3f')][_0x21d6('0x7a')](_0xdf7ce3[_0x21d6('0x5e')]);}})['then'](respondWithResult(_0x379c40,null))[_0x21d6('0x2a')](handleError(_0x379c40,null));};exports[_0x21d6('0x84')]=function(_0xc27da5,_0x4ce7a0,_0x42737b){return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0xc27da5['params']['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x4ce7a0,null))[_0x21d6('0x22')](function(_0xfa064a){if(_0xfa064a){return _0xfa064a['setSmtp'](null);}return null;})[_0x21d6('0x22')](respondWithStatusCode(_0x4ce7a0,null))[_0x21d6('0x2a')](handleError(_0x4ce7a0,null));};exports[_0x21d6('0x85')]=function(_0x1c94bb,_0x2bb575,_0x5f3f42){return db[_0x21d6('0x86')][_0x21d6('0x5d')]({'where':{'id':_0x1c94bb['params']['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x2bb575,null))[_0x21d6('0x22')](function(_0x183995){if(_0x183995){return _0x183995['addInteraction'](_0x1c94bb[_0x21d6('0x5e')][_0x21d6('0x6c')],_['omit'](_0x1c94bb[_0x21d6('0x5e')],[_0x21d6('0x6c'),'id'])||{});}})['then'](respondWithResult(_0x2bb575,null))['catch'](handleError(_0x2bb575,null));};exports['getInteractions']=function(_0x39e3e5,_0x209181,_0xe27465){var _0x48c502={'raw':![],'where':{}};var _0x34762d={};var _0x14f064={'count':0x0,'rows':[]};return db['MailAccount'][_0x21d6('0x64')]({'where':{'id':_0x39e3e5[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x209181,null))[_0x21d6('0x22')](function(_0x1197f3){if(_0x1197f3){_0x34762d['model']=_[_0x21d6('0x49')](db[_0x21d6('0x86')][_0x21d6('0x43')]);_0x34762d['query']=_[_0x21d6('0x49')](_0x39e3e5[_0x21d6('0x48')]);_0x34762d[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0x34762d[_0x21d6('0x47')],_0x34762d['query']);_0x48c502['attributes']=_[_0x21d6('0x4b')](_0x34762d[_0x21d6('0x47')],qs[_0x21d6('0x4d')](_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x4d')]));_0x48c502['attributes']=_0x48c502['attributes']['length']?_0x48c502[_0x21d6('0x4c')]:_0x34762d[_0x21d6('0x47')];if(!_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x4f')](_0x21d6('0x65'))){_0x48c502['limit']=qs[_0x21d6('0x31')](_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x31')]);_0x48c502[_0x21d6('0x2f')]=qs[_0x21d6('0x2f')](_0x39e3e5[_0x21d6('0x48')]['offset']);}_0x48c502[_0x21d6('0x50')]=qs[_0x21d6('0x51')](_0x39e3e5['query'][_0x21d6('0x51')]);_0x48c502['where']=qs['filters'](_[_0x21d6('0x53')](_0x39e3e5[_0x21d6('0x48')],_0x34762d[_0x21d6('0x4a')]));_0x48c502['where'][_0x21d6('0x61')]=_0x1197f3['id'];if(_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x55')]){_0x48c502['where']=_['merge'](_0x48c502[_0x21d6('0x52')],{'$or':_[_0x21d6('0x42')](_0x48c502['attributes'],function(_0x4078ec){var _0x477891={};_0x477891[_0x4078ec]={'$like':'%'+_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x55')]+'%'};return _0x477891;})});}_0x48c502=_['merge']({},_0x48c502,_0x39e3e5['options']);return db['MailInteraction'][_0x21d6('0x32')]({'where':_0x48c502['where']})['then'](function(_0x20614f){_0x14f064[_0x21d6('0x32')]=_0x20614f;if(_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x56')]){_0x48c502[_0x21d6('0x57')]=[{'model':db[_0x21d6('0x87')],'as':_0x21d6('0x88'),'required':![]},{'model':db[_0x21d6('0x89')],'as':_0x21d6('0x8a'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x21d6('0x8b')],'as':_0x21d6('0x8c'),'attributes':['id','name','color'],'where':_0x39e3e5['query']['tag']?{'id':_0x39e3e5['query'][_0x21d6('0x8d')]}:undefined,'required':_0x39e3e5[_0x21d6('0x48')][_0x21d6('0x8d')]?!![]:![]}];}return db[_0x21d6('0x86')][_0x21d6('0x66')](_0x48c502);})[_0x21d6('0x22')](function(_0x376c2f){_0x14f064[_0x21d6('0x59')]=_0x376c2f;return _0x14f064;});}})[_0x21d6('0x22')](respondWithFilteredResult(_0x209181,_0x48c502))['catch'](handleError(_0x209181,null));};exports['addApplications']=function(_0x306849,_0x3bbfec,_0x37be36){return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x306849[_0x21d6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3bbfec,null))[_0x21d6('0x22')](function(_0x82719b){if(_0x82719b){return db[_0x21d6('0x8e')][_0x21d6('0x8f')](function(_0x1f2702){return db[_0x21d6('0x90')][_0x21d6('0x38')]({'where':{'MailAccountId':_0x306849[_0x21d6('0x5a')]['id']},'transaction':_0x1f2702})[_0x21d6('0x22')](function(_0x592f12){var _0x14b375=_[_0x21d6('0x42')](_0x306849[_0x21d6('0x5e')],function(_0x485af0){_0x485af0[_0x21d6('0x61')]=_0x306849[_0x21d6('0x5a')]['id'];return _0x485af0;});return db[_0x21d6('0x90')][_0x21d6('0x91')](_0x14b375,{'transaction':_0x1f2702});});})[_0x21d6('0x22')](function(){return db['MailApplication'][_0x21d6('0x92')]({'where':{'MailAccountId':_0x306849['params']['id']},'order':_0x21d6('0x93')});});}})[_0x21d6('0x22')](respondWithResult(_0x3bbfec,null))[_0x21d6('0x2a')](handleError(_0x3bbfec,null));};exports[_0x21d6('0x94')]=function(_0x346e97,_0x212b47,_0x1ba752){var _0x46469e={};var _0x31a797={};var _0x30e855;var _0x305b49;return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x346e97[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x212b47,null))[_0x21d6('0x22')](function(_0x2274fe){if(_0x2274fe){_0x30e855=_0x2274fe;_0x31a797['model']=_[_0x21d6('0x49')](db['MailApplication']['rawAttributes']);_0x31a797[_0x21d6('0x48')]=_[_0x21d6('0x49')](_0x346e97[_0x21d6('0x48')]);_0x31a797[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0x31a797[_0x21d6('0x47')],_0x31a797['query']);_0x46469e[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0x31a797[_0x21d6('0x47')],qs[_0x21d6('0x4d')](_0x346e97[_0x21d6('0x48')][_0x21d6('0x4d')]));_0x46469e[_0x21d6('0x4c')]=_0x46469e[_0x21d6('0x4c')][_0x21d6('0x4e')]?_0x46469e[_0x21d6('0x4c')]:_0x31a797['model'];_0x46469e[_0x21d6('0x50')]=qs[_0x21d6('0x51')](_0x346e97[_0x21d6('0x48')][_0x21d6('0x51')]);_0x46469e[_0x21d6('0x52')]=qs['filters'](_[_0x21d6('0x53')](_0x346e97['query'],_0x31a797[_0x21d6('0x4a')]));if(_0x346e97[_0x21d6('0x48')][_0x21d6('0x55')]){_0x46469e[_0x21d6('0x52')]=_['merge'](_0x46469e[_0x21d6('0x52')],{'$or':_[_0x21d6('0x42')](_0x46469e['attributes'],function(_0x1b9304){var _0xd45c4={};_0xd45c4[_0x1b9304]={'$like':'%'+_0x346e97[_0x21d6('0x48')][_0x21d6('0x55')]+'%'};return _0xd45c4;})});}_0x46469e=_[_0x21d6('0x54')]({},_0x46469e,_0x346e97[_0x21d6('0x5c')]);return _0x30e855[_0x21d6('0x94')](_0x46469e);}})[_0x21d6('0x22')](function(_0x3e3e43){if(_0x3e3e43){_0x305b49=_0x3e3e43[_0x21d6('0x4e')];if(!_0x346e97[_0x21d6('0x48')][_0x21d6('0x4f')]('nolimit')){_0x46469e[_0x21d6('0x31')]=qs[_0x21d6('0x31')](_0x346e97[_0x21d6('0x48')][_0x21d6('0x31')]);_0x46469e['offset']=qs[_0x21d6('0x2f')](_0x346e97['query'][_0x21d6('0x2f')]);}return _0x30e855[_0x21d6('0x94')](_0x46469e);}})['then'](function(_0x34fa31){if(_0x34fa31){return _0x34fa31?{'count':_0x305b49,'rows':_0x34fa31}:null;}})[_0x21d6('0x22')](respondWithResult(_0x212b47,null))[_0x21d6('0x2a')](handleError(_0x212b47,null));};exports[_0x21d6('0x95')]=function(_0x42dbd0,_0x56f7d0,_0xc76a04){var _0x3cc1f2={'raw':!![],'where':{}};var _0x3d3ef8={};var _0x5da00a={'count':0x0,'rows':[]};return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x42dbd0['params']['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x56f7d0,null))[_0x21d6('0x22')](function(_0x525577){if(_0x525577){_0x3d3ef8[_0x21d6('0x47')]=_[_0x21d6('0x49')](db[_0x21d6('0x96')]['rawAttributes']);_0x3d3ef8[_0x21d6('0x48')]=_[_0x21d6('0x49')](_0x42dbd0[_0x21d6('0x48')]);_0x3d3ef8[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0x3d3ef8[_0x21d6('0x47')],_0x3d3ef8['query']);_0x3cc1f2[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0x3d3ef8[_0x21d6('0x47')],qs['fields'](_0x42dbd0['query'][_0x21d6('0x4d')]));_0x3cc1f2[_0x21d6('0x4c')]=_0x3cc1f2['attributes'][_0x21d6('0x4e')]?_0x3cc1f2[_0x21d6('0x4c')]:_0x3d3ef8['model'];if(!_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x4f')](_0x21d6('0x65'))){_0x3cc1f2[_0x21d6('0x31')]=qs['limit'](_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x31')]);_0x3cc1f2[_0x21d6('0x2f')]=qs[_0x21d6('0x2f')](_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x2f')]);}_0x3cc1f2[_0x21d6('0x50')]=qs['sort'](_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x51')]);_0x3cc1f2[_0x21d6('0x52')]=qs[_0x21d6('0x4a')](_['pick'](_0x42dbd0[_0x21d6('0x48')],_0x3d3ef8[_0x21d6('0x4a')]));_0x3cc1f2['where'][_0x21d6('0x61')]=_0x525577['id'];if(_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x55')]){_0x3cc1f2['where']=_[_0x21d6('0x54')](_0x3cc1f2[_0x21d6('0x52')],{'$or':_[_0x21d6('0x42')](_0x3cc1f2['attributes'],function(_0x462af5){var _0x2f5232={};_0x2f5232[_0x462af5]={'$like':'%'+_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x55')]+'%'};return _0x2f5232;})});}if(_0x42dbd0[_0x21d6('0x48')]['$gte']){var _0x775112=_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x97')][_0x21d6('0x98')](',');var _0x2215bf={};_0x2215bf[_0x775112[0x0]]={'$gte':moment(_0x775112[0x1])[_0x21d6('0x99')](_0x21d6('0x9a'))};_0x3cc1f2[_0x21d6('0x52')]=_[_0x21d6('0x54')](_0x3cc1f2[_0x21d6('0x52')],_0x2215bf);}_0x3cc1f2=_['merge']({},_0x3cc1f2,_0x42dbd0[_0x21d6('0x5c')]);return db[_0x21d6('0x96')][_0x21d6('0x32')]({'where':_0x3cc1f2[_0x21d6('0x52')]})['then'](function(_0x30f90d){_0x5da00a['count']=_0x30f90d;if(_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x56')]){_0x3cc1f2[_0x21d6('0x57')]=[{'all':!![]}];}return db['MailMessage'][_0x21d6('0x66')](_0x3cc1f2);})[_0x21d6('0x22')](function(_0x352f09){if(_0x42dbd0[_0x21d6('0x48')][_0x21d6('0x9b')]===_0x21d6('0x9c')){for(var _0x1bb462=0x0;_0x1bb462<_0x352f09[_0x21d6('0x4e')];_0x1bb462++){_0x352f09[_0x1bb462]['body']=juice(_0x352f09[_0x1bb462]['body']);}}_0x5da00a[_0x21d6('0x59')]=_0x352f09;return _0x5da00a;});}})[_0x21d6('0x22')](respondWithFilteredResult(_0x56f7d0,_0x3cc1f2))[_0x21d6('0x2a')](handleError(_0x56f7d0,null));};exports[_0x21d6('0x3b')]=function(_0x40a05b,_0x350ba5,_0x3dd671){var _0x5c8477,_0x2effd5={},_0x37b803;if(_0x40a05b[_0x21d6('0x5e')]['to']){_0x37b803=_0x40a05b[_0x21d6('0x5e')]['to'][_0x21d6('0x98')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x40a05b[_0x21d6('0x5a')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x21d6('0x87')],'as':_0x21d6('0x9d'),'where':{'email':_0x37b803},'limit':0x1,'order':[[_0x21d6('0x9e'),_0x21d6('0x9f')]]}]},{'model':db['MailServerOut'],'as':_0x21d6('0x40'),'raw':!![]}]})['then'](handleEntityNotFound(_0x350ba5,null))[_0x21d6('0x22')](function(_0x7ff5af){if(_0x7ff5af){_0x5c8477=_0x7ff5af;if(_0x7ff5af['Smtp']){if(_[_0x21d6('0x6e')](_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xa0')])){_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xa0')]=util['format'](_0x21d6('0xa1'),_0x7ff5af[_0x21d6('0x3a')],_0x7ff5af[_0x21d6('0xa2')]||_0x7ff5af['Smtp'][_0x21d6('0x71')]);}if(_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xa3')]&&_0x40a05b['body']['attachments']['length']){for(var _0x3419ad=0x0;_0x3419ad<_0x40a05b['body'][_0x21d6('0xa3')][_0x21d6('0x4e')];_0x3419ad+=0x1){_0x40a05b['body'][_0x21d6('0xa3')][_0x3419ad]={'filename':_0x40a05b[_0x21d6('0x5e')]['attachments'][_0x3419ad][_0x21d6('0x3a')],'path':path[_0x21d6('0xa4')](config[_0x21d6('0xa5')],_0x21d6('0xa6'),_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xa3')][_0x3419ad][_0x21d6('0xa7')])};}}var _0x5e19f7={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x7ff5af[_0x21d6('0x40')][_0x21d6('0x78')])){if(_0x7ff5af[_0x21d6('0x40')][_0x21d6('0x75')]){_0x5e19f7[_0x21d6('0xa8')]={'user':_0x7ff5af[_0x21d6('0x40')]['user'],'pass':_0x7ff5af[_0x21d6('0x40')]['pass']};}_0x5e19f7['host']=_0x7ff5af['Smtp'][_0x21d6('0x76')];_0x5e19f7[_0x21d6('0x77')]=_0x7ff5af['Smtp']['port'];_0x5e19f7['secure']=_0x7ff5af[_0x21d6('0x40')][_0x21d6('0xa9')];}else{_0x5e19f7[_0x21d6('0x78')]=_0x7ff5af['Smtp']['service'];_0x5e19f7[_0x21d6('0xa8')]={'user':_0x7ff5af['Smtp']['user'],'pass':_0x7ff5af[_0x21d6('0x40')][_0x21d6('0x73')]};}return respondWithRpcPromise(_0x21d6('0xaa'),_0x21d6('0xab'),{'account':_0x5e19f7,'message':_0x40a05b[_0x21d6('0x5e')]});}else{throw new Error(_0x21d6('0xac'));}}})[_0x21d6('0x22')](function(_0x3789f6){if(_0x3789f6){_0x2effd5=_0x3789f6;if(_0x5c8477[_0x21d6('0xad')]){if(_0x5c8477[_0x21d6('0xad')][_0x21d6('0x9d')][_0x21d6('0x4e')]){return _0x5c8477['List'][_0x21d6('0x9d')][0x0];}else{return db['CmContact']['create'](_[_0x21d6('0xae')](_0x40a05b[_0x21d6('0x5e')],{'firstName':_0x40a05b[_0x21d6('0x5e')]['to'],'email':_0x40a05b[_0x21d6('0x5e')]['to'],'phone':_0x40a05b['body']['to'],'ListId':_0x5c8477[_0x21d6('0x6d')]}));}}else{throw new Error(_0x21d6('0xac'));}}})[_0x21d6('0x22')](function(_0x7eb811){if(_0x7eb811){var _0x508201={'UserId':_0x40a05b['user']['id'],'ContactId':_0x7eb811['id'],'MailAccountId':_0x5c8477['id'],'inReplyTo':_0x2effd5[_0x21d6('0xaf')],'to':_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xa0')],'cc':_0x40a05b[_0x21d6('0x5e')]['cc'],'subject':_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xb0')],'attach':_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xb1')],'firstMsgDirection':_0x21d6('0xb2'),'lastMsgAt':moment()[_0x21d6('0x99')](_0x21d6('0x9a')),'lastMsgDirection':_0x21d6('0xb2'),'Messages':[_[_0x21d6('0x54')](_0x40a05b[_0x21d6('0x5e')],{'messageId':_0x2effd5[_0x21d6('0xaf')],'sentAt':moment()[_0x21d6('0x99')](_0x21d6('0x9a')),'read':!![],'MailAccountId':_0x5c8477['id'],'UserId':_0x40a05b[_0x21d6('0x71')]['id'],'ContactId':_0x7eb811['id']})]};if(_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xb3')]){_0x508201=_[_0x21d6('0x54')](_0x508201,_0x40a05b[_0x21d6('0x5e')][_0x21d6('0xb3')]);}return db[_0x21d6('0x86')][_0x21d6('0x7a')](_0x508201,{'include':[{'model':db['MailMessage'],'as':_0x21d6('0xb4')}]});}})['then'](respondWithResult(_0x350ba5,null))[_0x21d6('0x2a')](handleError(_0x350ba5,null));};exports[_0x21d6('0xb5')]=function(_0x1a6fe2,_0x119556,_0x22ee8a){return db[_0x21d6('0x58')]['find']({'where':{'id':_0x1a6fe2[_0x21d6('0x5a')]['id']},'include':[{'model':db[_0x21d6('0x3f')],'as':_0x21d6('0x40'),'raw':!![]}]})[_0x21d6('0x22')](handleEntityNotFound(_0x119556,null))[_0x21d6('0x22')](function(_0x2fd2f9){if(_0x2fd2f9&&_0x2fd2f9[_0x21d6('0x40')]){var _0x1b2546={'id':_0x2fd2f9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2fd2f9['Smtp'][_0x21d6('0x78')]){_0x1b2546[_0x21d6('0x78')]=_0x2fd2f9['Smtp']['service'];}else{_0x1b2546[_0x21d6('0x76')]=_0x2fd2f9[_0x21d6('0x40')][_0x21d6('0x76')];_0x1b2546['port']=_0x2fd2f9[_0x21d6('0x40')][_0x21d6('0x77')];_0x1b2546[_0x21d6('0xa9')]=_0x2fd2f9[_0x21d6('0x40')][_0x21d6('0xa9')];}if(_0x2fd2f9['Smtp'][_0x21d6('0x75')]){_0x1b2546['auth']={'user':_0x2fd2f9[_0x21d6('0x40')]['user'],'pass':_0x2fd2f9[_0x21d6('0x40')][_0x21d6('0x73')]};}return respondWithRpcPromise(_0x21d6('0xb6'),_0x21d6('0xb5'),{'account':_0x1b2546});}})[_0x21d6('0x22')](respondWithResult(_0x119556,null))[_0x21d6('0x2a')](handleError(_0x119556,null));};exports[_0x21d6('0x38')]=function(_0x315ca0,_0x2394ef){return db[_0x21d6('0x58')][_0x21d6('0x5d')]({'where':{'id':_0x315ca0[_0x21d6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2394ef,null))[_0x21d6('0x22')](function(_0x3e5fe7){if(_0x3e5fe7&&_0x3e5fe7['service']){throw new db[(_0x21d6('0xb7'))][(_0x21d6('0xb8'))](_0x21d6('0xb9'));}return _0x3e5fe7;})['then'](removeEntity(_0x2394ef,null))[_0x21d6('0x2a')](handleError(_0x2394ef,null));};exports[_0x21d6('0xba')]=function(_0x459fa7,_0x276b7d,_0x59f260){return db['MailAccount'][_0x21d6('0x5d')]({'where':{'id':_0x459fa7[_0x21d6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x276b7d,null))[_0x21d6('0x22')](function(_0x1618f7){if(_0x1618f7){return _0x1618f7[_0x21d6('0xba')](_0x459fa7[_0x21d6('0x5e')][_0x21d6('0x6c')],_[_0x21d6('0xbb')](_0x459fa7['body'],[_0x21d6('0x6c'),'id'])||{})['spread'](function(_0xc1156d){for(var _0x2a18d2=0x0;_0x2a18d2<_0x459fa7[_0x21d6('0x5e')][_0x21d6('0x6c')][_0x21d6('0x4e')];_0x2a18d2+=0x1){socket[_0x21d6('0xbc')](_0x21d6('0xbd'),{'UserId':Number(_0x459fa7[_0x21d6('0x5e')][_0x21d6('0x6c')][_0x2a18d2]),'MailAccountId':Number(_0x459fa7[_0x21d6('0x5a')]['id'])});}return _0xc1156d;});}})[_0x21d6('0x22')](respondWithResult(_0x276b7d,null))[_0x21d6('0x2a')](handleError(_0x276b7d,null));};exports[_0x21d6('0xbe')]=function(_0x4a6c1c,_0x5adc1b,_0x2b4d52){return db['MailAccount']['find']({'where':{'id':_0x4a6c1c[_0x21d6('0x5a')]['id']}})[_0x21d6('0x22')](handleEntityNotFound(_0x5adc1b,null))[_0x21d6('0x22')](function(_0x526033){if(_0x526033){return _0x526033[_0x21d6('0xbe')](_0x4a6c1c[_0x21d6('0x48')][_0x21d6('0x6c')])[_0x21d6('0x22')](function(){if(_[_0x21d6('0xbf')](_0x4a6c1c[_0x21d6('0x48')]['ids'])){for(var _0x4fa56c=0x0;_0x4fa56c<_0x4a6c1c[_0x21d6('0x48')][_0x21d6('0x6c')]['length'];_0x4fa56c+=0x1){socket[_0x21d6('0xbc')](_0x21d6('0xc0'),{'UserId':Number(_0x4a6c1c[_0x21d6('0x48')]['ids'][_0x4fa56c]),'MailAccountId':Number(_0x4a6c1c[_0x21d6('0x5a')]['id'])});}}else{socket[_0x21d6('0xbc')](_0x21d6('0xc0'),{'UserId':Number(_0x4a6c1c[_0x21d6('0x48')][_0x21d6('0x6c')]),'MailAccountId':Number(_0x4a6c1c[_0x21d6('0x5a')]['id'])});}});}})[_0x21d6('0x22')](respondWithStatusCode(_0x5adc1b,null))[_0x21d6('0x2a')](handleError(_0x5adc1b,null));};exports['getAgents']=function(_0x592e15,_0x403dd8,_0x2f0d46){var _0x2e573e={};var _0xca95a7={};var _0x10b229;var _0x128430;return db[_0x21d6('0x58')][_0x21d6('0x64')]({'where':{'id':_0x592e15[_0x21d6('0x5a')]['id']}})['then'](handleEntityNotFound(_0x403dd8,null))[_0x21d6('0x22')](function(_0x1f157b){if(_0x1f157b){_0x10b229=_0x1f157b;_0xca95a7['model']=_['keys'](db[_0x21d6('0x89')][_0x21d6('0x43')]);_0xca95a7[_0x21d6('0x48')]=_[_0x21d6('0x49')](_0x592e15['query']);_0xca95a7[_0x21d6('0x4a')]=_[_0x21d6('0x4b')](_0xca95a7[_0x21d6('0x47')],_0xca95a7[_0x21d6('0x48')]);_0x2e573e[_0x21d6('0x4c')]=_[_0x21d6('0x4b')](_0xca95a7[_0x21d6('0x47')],qs[_0x21d6('0x4d')](_0x592e15['query'][_0x21d6('0x4d')]));_0x2e573e[_0x21d6('0x4c')]=_0x2e573e['attributes'][_0x21d6('0x4e')]?_0x2e573e[_0x21d6('0x4c')]:_0xca95a7[_0x21d6('0x47')];_0x2e573e[_0x21d6('0x50')]=qs[_0x21d6('0x51')](_0x592e15[_0x21d6('0x48')]['sort']);_0x2e573e[_0x21d6('0x52')]=qs[_0x21d6('0x4a')](_[_0x21d6('0x53')](_0x592e15[_0x21d6('0x48')],_0xca95a7[_0x21d6('0x4a')]));if(_0x592e15['query'][_0x21d6('0x55')]){_0x2e573e[_0x21d6('0x52')]=_[_0x21d6('0x54')](_0x2e573e[_0x21d6('0x52')],{'$or':_[_0x21d6('0x42')](_0x2e573e['attributes'],function(_0x185874){var _0x34447c={};_0x34447c[_0x185874]={'$like':'%'+_0x592e15[_0x21d6('0x48')]['filter']+'%'};return _0x34447c;})});}_0x2e573e=_[_0x21d6('0x54')]({},_0x2e573e,_0x592e15[_0x21d6('0x5c')]);return _0x10b229[_0x21d6('0xc1')](_0x2e573e);}})['then'](function(_0x4c599f){if(_0x4c599f){_0x128430=_0x4c599f['length'];if(!_0x592e15[_0x21d6('0x48')][_0x21d6('0x4f')](_0x21d6('0x65'))){_0x2e573e['limit']=qs[_0x21d6('0x31')](_0x592e15[_0x21d6('0x48')][_0x21d6('0x31')]);_0x2e573e[_0x21d6('0x2f')]=qs[_0x21d6('0x2f')](_0x592e15['query'][_0x21d6('0x2f')]);}return _0x10b229[_0x21d6('0xc1')](_0x2e573e);}})['then'](function(_0x5f532e){if(_0x5f532e){return _0x5f532e?{'count':_0x128430,'rows':_0x5f532e}:null;}})['then'](respondWithResult(_0x403dd8,null))[_0x21d6('0x2a')](handleError(_0x403dd8,null));}; \ No newline at end of file +var _0x486b=['addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','Tag','tag','sequelize','MailApplication','bulkCreate','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','DESC','from','%s\x20<%s>','attachments','join','root','auth','secure','SendMail','sendMail','List','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','destroy','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','html-to-text','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','limit','offset','apply','reject','save','update','then','get','MailAccounts','UserProfileResource','end','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','MailAccount','count','includeAll','include','findAll','rows','show','params','rawAttributes','body','mandatoryDispositionPause','describe','addDisposition','find','Disposition','create','getDispositions','hasOwnProperty','MailAccountId','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp'];(function(_0x4f4a5b,_0x338ed9){var _0x5da520=function(_0x42f3aa){while(--_0x42f3aa){_0x4f4a5b['push'](_0x4f4a5b['shift']());}};_0x5da520(++_0x338ed9);}(_0x486b,0xf8));var _0xb486=function(_0x9507bf,_0x500950){_0x9507bf=_0x9507bf-0x0;var _0x2a08b8=_0x486b[_0x9507bf];return _0x2a08b8;};'use strict';var emlformat=require(_0xb486('0x0'));var rimraf=require(_0xb486('0x1'));var zipdir=require(_0xb486('0x2'));var jsonpatch=require(_0xb486('0x3'));var rp=require(_0xb486('0x4'));var moment=require(_0xb486('0x5'));var BPromise=require(_0xb486('0x6'));var Mustache=require(_0xb486('0x7'));var util=require('util');var path=require(_0xb486('0x8'));var sox=require('sox');var csv=require(_0xb486('0x9'));var ejs=require(_0xb486('0xa'));var fs=require('fs');var fs_extra=require(_0xb486('0xb'));var _=require('lodash');var squel=require(_0xb486('0xc'));var crypto=require('crypto');var jsforce=require(_0xb486('0xd'));var deskjs=require(_0xb486('0xe'));var toCsv=require(_0xb486('0x9'));var querystring=require(_0xb486('0xf'));var Papa=require(_0xb486('0x10'));var htmlToText=require(_0xb486('0x11'));var juice=require('juice');var Redis=require('ioredis');var authService=require(_0xb486('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb486('0x13'))('api');var utils=require(_0xb486('0x14'));var config=require(_0xb486('0x15'));var licenseUtil=require(_0xb486('0x16'));var db=require('../../mysqldb')['db'];config[_0xb486('0x17')]=_[_0xb486('0x18')](config[_0xb486('0x17')],{'host':_0xb486('0x19'),'port':0x18eb});var socket=require(_0xb486('0x1a'))(new Redis(config[_0xb486('0x17')]));require('./mailAccount.socket')[_0xb486('0x1b')](socket);var jayson=require(_0xb486('0x1c'));var client=jayson[_0xb486('0x1d')][_0xb486('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x5ea415,_0x5a49bb,_0x476e5f,_0x507cf6){return new BPromise(function(_0x2c974a,_0x31828b){var _0x2b9e8c=_0x507cf6||client;return _0x2b9e8c[_0xb486('0x1f')](_0x5ea415,_0x476e5f)['then'](function(_0x4bda6e){logger[_0xb486('0x20')](_0xb486('0x21'),_0x5a49bb,_0xb486('0x22'));logger[_0xb486('0x23')](_0xb486('0x24'),_0x5a49bb,_0xb486('0x22'),JSON[_0xb486('0x25')](_0x4bda6e));if(_0x4bda6e[_0xb486('0x26')]){if(_0x4bda6e[_0xb486('0x26')][_0xb486('0x27')]===0x1f4){logger[_0xb486('0x26')](_0xb486('0x21'),_0x5a49bb,_0x4bda6e[_0xb486('0x26')][_0xb486('0x28')]);return _0x31828b(_0x4bda6e[_0xb486('0x26')][_0xb486('0x28')]);}logger['error'](_0xb486('0x21'),_0x5a49bb,_0x4bda6e[_0xb486('0x26')][_0xb486('0x28')]);return _0x2c974a(_0x4bda6e['error'][_0xb486('0x28')]);}else{logger['info'](_0xb486('0x21'),_0x5a49bb,_0xb486('0x22'));_0x2c974a(_0x4bda6e['result'][_0xb486('0x28')]);}})[_0xb486('0x29')](function(_0x2ac4bd){logger[_0xb486('0x26')](_0xb486('0x21'),_0x5a49bb,_0x2ac4bd);_0x31828b(_0x2ac4bd);});});}function respondWithStatusCode(_0x13bcc9,_0x5826a1){_0x5826a1=_0x5826a1||0xcc;return function(_0x5db5aa){if(_0x5db5aa){return _0x13bcc9[_0xb486('0x2a')](_0x5826a1);}return _0x13bcc9[_0xb486('0x2b')](_0x5826a1)['end']();};}function respondWithResult(_0x12e134,_0x42a9ca){_0x42a9ca=_0x42a9ca||0xc8;return function(_0x32c7d7){if(_0x32c7d7){return _0x12e134[_0xb486('0x2b')](_0x42a9ca)[_0xb486('0x2c')](_0x32c7d7);}};}function respondWithFilteredResult(_0x3dcd88,_0x47a80e){return function(_0x49c943){if(_0x49c943){var _0x5bb76f=typeof _0x47a80e['offset']==='undefined'&&typeof _0x47a80e[_0xb486('0x2d')]==='undefined';var _0x53070b=_0x49c943['count'];var _0x4759ec=_0x5bb76f?0x0:_0x47a80e[_0xb486('0x2e')];var _0xc2ece9=_0x5bb76f?_0x49c943['count']:_0x47a80e[_0xb486('0x2e')]+_0x47a80e[_0xb486('0x2d')];var _0x45c43d;if(_0xc2ece9>=_0x53070b){_0xc2ece9=_0x53070b;_0x45c43d=0xc8;}else{_0x45c43d=0xce;}_0x3dcd88[_0xb486('0x2b')](_0x45c43d);return _0x3dcd88['set']('Content-Range',_0x4759ec+'-'+_0xc2ece9+'/'+_0x53070b)[_0xb486('0x2c')](_0x49c943);}return null;};}function patchUpdates(_0x1fa4eb){return function(_0x4b28e7){try{jsonpatch[_0xb486('0x2f')](_0x4b28e7,_0x1fa4eb,!![]);}catch(_0x35b043){return BPromise[_0xb486('0x30')](_0x35b043);}return _0x4b28e7[_0xb486('0x31')]();};}function saveUpdates(_0x5bc84c,_0x58b66c){return function(_0x3b7190){if(_0x3b7190){return _0x3b7190[_0xb486('0x32')](_0x5bc84c)[_0xb486('0x33')](function(_0x2bdd5a){return _0x2bdd5a;});}return null;};}function removeEntity(_0x4d926a,_0xbbf97b){return function(_0x501a4b){if(_0x501a4b){return _0x501a4b['destroy']()[_0xb486('0x33')](function(){var _0x1188c9=_0x501a4b[_0xb486('0x34')]({'plain':!![]});var _0x39f7da=_0xb486('0x35');return db[_0xb486('0x36')]['destroy']({'where':{'type':_0x39f7da,'resourceId':_0x1188c9['id']}})[_0xb486('0x33')](function(){return _0x501a4b;});})[_0xb486('0x33')](function(){_0x4d926a[_0xb486('0x2b')](0xcc)[_0xb486('0x37')]();});}};}function handleEntityNotFound(_0xd23a1e,_0xa13348){return function(_0x3299f1){if(!_0x3299f1){_0xd23a1e[_0xb486('0x2a')](0x194);}return _0x3299f1;};}function handleError(_0x465df4,_0x591b90){_0x591b90=_0x591b90||0x1f4;return function(_0x4182fa){logger[_0xb486('0x26')](_0x4182fa[_0xb486('0x38')]);if(_0x4182fa[_0xb486('0x39')]){delete _0x4182fa[_0xb486('0x39')];}_0x465df4[_0xb486('0x2b')](_0x591b90)[_0xb486('0x3a')](_0x4182fa);};}exports[_0xb486('0x3b')]=function(_0x263b79,_0x4f69ce){var _0x2687e2={'include':[{'model':db[_0xb486('0x3c')],'as':_0xb486('0x3d')},{'model':db[_0xb486('0x3e')],'as':_0xb486('0x3f')},{'model':db[_0xb486('0x40')],'as':'mandatoryDispositionPause'}]},_0x16f437={},_0xdb862c={'count':0x0,'rows':[]};var _0x2fcb18=_[_0xb486('0x41')](db['MailAccount']['rawAttributes'],function(_0x5cbe64){return{'name':_0x5cbe64[_0xb486('0x42')],'type':_0x5cbe64['type'][_0xb486('0x43')]};});_0x16f437[_0xb486('0x44')]=_[_0xb486('0x41')](_0x2fcb18,'name');_0x16f437[_0xb486('0x45')]=_[_0xb486('0x46')](_0x263b79[_0xb486('0x45')]);_0x16f437[_0xb486('0x47')]=_['intersection'](_0x16f437[_0xb486('0x44')],_0x16f437['query']);_0x2687e2[_0xb486('0x48')]=_[_0xb486('0x49')](_0x16f437[_0xb486('0x44')],qs[_0xb486('0x4a')](_0x263b79[_0xb486('0x45')][_0xb486('0x4a')]));_0x2687e2[_0xb486('0x48')]=_0x2687e2['attributes'][_0xb486('0x4b')]?_0x2687e2['attributes']:_0x16f437[_0xb486('0x44')];if(!_0x263b79[_0xb486('0x45')]['hasOwnProperty'](_0xb486('0x4c'))){_0x2687e2[_0xb486('0x2d')]=qs[_0xb486('0x2d')](_0x263b79[_0xb486('0x45')][_0xb486('0x2d')]);_0x2687e2[_0xb486('0x2e')]=qs[_0xb486('0x2e')](_0x263b79['query'][_0xb486('0x2e')]);}_0x2687e2[_0xb486('0x4d')]=qs[_0xb486('0x4e')](_0x263b79[_0xb486('0x45')][_0xb486('0x4e')]);_0x2687e2[_0xb486('0x4f')]=qs['filters'](_[_0xb486('0x50')](_0x263b79[_0xb486('0x45')],_0x16f437[_0xb486('0x47')]),_0x2fcb18);if(_0x263b79[_0xb486('0x45')][_0xb486('0x51')]){_0x2687e2[_0xb486('0x4f')]=_[_0xb486('0x52')](_0x2687e2[_0xb486('0x4f')],{'$or':_[_0xb486('0x41')](_0x2fcb18,function(_0x42f3db){if(_0x42f3db[_0xb486('0x53')]!==_0xb486('0x54')){var _0x933fb4={};_0x933fb4[_0x42f3db['name']]={'$like':'%'+_0x263b79[_0xb486('0x45')][_0xb486('0x51')]+'%'};return _0x933fb4;}})});}_0x2687e2=_[_0xb486('0x52')]({},_0x2687e2,_0x263b79['options']);var _0x457b54={'where':_0x2687e2[_0xb486('0x4f')]};return db[_0xb486('0x55')][_0xb486('0x56')](_0x457b54)[_0xb486('0x33')](function(_0xa42162){_0xdb862c[_0xb486('0x56')]=_0xa42162;if(_0x263b79[_0xb486('0x45')][_0xb486('0x57')]){_0x2687e2[_0xb486('0x58')]=[{'all':!![]}];}return db[_0xb486('0x55')][_0xb486('0x59')](_0x2687e2);})[_0xb486('0x33')](function(_0x3b1923){_0xdb862c[_0xb486('0x5a')]=_0x3b1923;return _0xdb862c;})['then'](respondWithFilteredResult(_0x4f69ce,_0x2687e2))[_0xb486('0x29')](handleError(_0x4f69ce,null));};exports[_0xb486('0x5b')]=function(_0x2f3289,_0x388035){var _0x101457={'raw':![],'where':{'id':_0x2f3289[_0xb486('0x5c')]['id']},'include':[{'model':db[_0xb486('0x3c')],'as':_0xb486('0x3d')},{'model':db[_0xb486('0x3e')],'as':_0xb486('0x3f')},{'model':db[_0xb486('0x40')],'as':'mandatoryDispositionPause'}]},_0x94bb8e={};_0x94bb8e[_0xb486('0x44')]=_[_0xb486('0x46')](db['MailAccount'][_0xb486('0x5d')]);_0x94bb8e[_0xb486('0x45')]=_[_0xb486('0x46')](_0x2f3289[_0xb486('0x45')]);_0x94bb8e[_0xb486('0x47')]=_['intersection'](_0x94bb8e[_0xb486('0x44')],_0x94bb8e[_0xb486('0x45')]);_0x101457[_0xb486('0x48')]=_['intersection'](_0x94bb8e[_0xb486('0x44')],qs[_0xb486('0x4a')](_0x2f3289['query'][_0xb486('0x4a')]));_0x101457[_0xb486('0x48')]=_0x101457['attributes'][_0xb486('0x4b')]?_0x101457['attributes']:_0x94bb8e['model'];if(_0x2f3289[_0xb486('0x45')][_0xb486('0x57')]){_0x101457[_0xb486('0x58')]=[{'all':!![]}];}_0x101457=_[_0xb486('0x52')]({},_0x101457,_0x2f3289['options']);return db[_0xb486('0x55')]['find'](_0x101457)[_0xb486('0x33')](handleEntityNotFound(_0x388035,null))[_0xb486('0x33')](respondWithResult(_0x388035,null))['catch'](handleError(_0x388035,null));};exports[_0xb486('0x32')]=function(_0x321493,_0x5d26b3){if(_0x321493['body']['id']){delete _0x321493[_0xb486('0x5e')]['id'];}return db[_0xb486('0x55')]['find']({'where':{'id':_0x321493[_0xb486('0x5c')]['id']},'include':[{'model':db[_0xb486('0x3c')],'as':_0xb486('0x3d')},{'model':db[_0xb486('0x3e')],'as':'Smtp'},{'model':db[_0xb486('0x40')],'as':_0xb486('0x5f')}]})[_0xb486('0x33')](handleEntityNotFound(_0x5d26b3,null))[_0xb486('0x33')](saveUpdates(_0x321493[_0xb486('0x5e')],null))[_0xb486('0x33')](function(_0x5aadd8){if(_0x5aadd8&&_0x321493[_0xb486('0x5e')][_0xb486('0x3d')]){return db[_0xb486('0x3c')]['update'](_0x321493[_0xb486('0x5e')][_0xb486('0x3d')],{'where':{'MailAccountId':_0x5aadd8['id']}})[_0xb486('0x33')](function(){return _0x5aadd8;});}return _0x5aadd8;})['then'](function(_0x564cc5){if(_0x564cc5&&_0x321493[_0xb486('0x5e')]['Smtp']){return db['MailServerOut'][_0xb486('0x32')](_0x321493['body'][_0xb486('0x3f')],{'where':{'MailAccountId':_0x564cc5['id']}})[_0xb486('0x33')](function(){return _0x564cc5;});}return _0x564cc5;})['then'](respondWithResult(_0x5d26b3,null))[_0xb486('0x29')](handleError(_0x5d26b3,null));};exports[_0xb486('0x60')]=function(_0x25239c,_0x13c495){return db[_0xb486('0x55')][_0xb486('0x60')]()[_0xb486('0x33')](respondWithResult(_0x13c495,null))[_0xb486('0x29')](handleError(_0x13c495,null));};exports[_0xb486('0x61')]=function(_0x20da51,_0x5a073c,_0x54cb97){if(_0x20da51[_0xb486('0x5e')]['id']){delete _0x20da51['body']['id'];}return db[_0xb486('0x55')][_0xb486('0x62')]({'where':{'id':_0x20da51['params']['id']}})['then'](handleEntityNotFound(_0x5a073c,null))[_0xb486('0x33')](function(_0x547266){if(_0x547266){_0x20da51[_0xb486('0x5e')]['MailAccountId']=_0x547266['id'];return db[_0xb486('0x63')][_0xb486('0x64')](_0x20da51[_0xb486('0x5e')]);}})[_0xb486('0x33')](respondWithResult(_0x5a073c,null))[_0xb486('0x29')](handleError(_0x5a073c,null));};exports[_0xb486('0x65')]=function(_0x29f5e5,_0x3a90b1,_0x7c2d70){var _0x13c961={'raw':![],'where':{}};var _0x3819cc={};var _0x5ca5fe={'count':0x0,'rows':[]};return db[_0xb486('0x55')]['findOne']({'where':{'id':_0x29f5e5[_0xb486('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3a90b1,null))[_0xb486('0x33')](function(_0x418958){if(_0x418958){_0x3819cc['model']=_[_0xb486('0x46')](db['Disposition'][_0xb486('0x5d')]);_0x3819cc['query']=_['keys'](_0x29f5e5[_0xb486('0x45')]);_0x3819cc['filters']=_[_0xb486('0x49')](_0x3819cc[_0xb486('0x44')],_0x3819cc[_0xb486('0x45')]);_0x13c961['attributes']=_[_0xb486('0x49')](_0x3819cc[_0xb486('0x44')],qs[_0xb486('0x4a')](_0x29f5e5['query'][_0xb486('0x4a')]));_0x13c961['attributes']=_0x13c961[_0xb486('0x48')]['length']?_0x13c961[_0xb486('0x48')]:_0x3819cc['model'];if(!_0x29f5e5[_0xb486('0x45')][_0xb486('0x66')](_0xb486('0x4c'))){_0x13c961[_0xb486('0x2d')]=qs[_0xb486('0x2d')](_0x29f5e5[_0xb486('0x45')][_0xb486('0x2d')]);_0x13c961[_0xb486('0x2e')]=qs['offset'](_0x29f5e5['query'][_0xb486('0x2e')]);}_0x13c961[_0xb486('0x4d')]=qs['sort'](_0x29f5e5[_0xb486('0x45')]['sort']);_0x13c961['where']=qs['filters'](_[_0xb486('0x50')](_0x29f5e5['query'],_0x3819cc[_0xb486('0x47')]));_0x13c961[_0xb486('0x4f')][_0xb486('0x67')]=_0x418958['id'];if(_0x29f5e5[_0xb486('0x45')][_0xb486('0x51')]){_0x13c961[_0xb486('0x4f')]=_['merge'](_0x13c961[_0xb486('0x4f')],{'$or':_['map'](_0x13c961['attributes'],function(_0xa6f8e6){var _0x130854={};_0x130854[_0xa6f8e6]={'$like':'%'+_0x29f5e5[_0xb486('0x45')]['filter']+'%'};return _0x130854;})});}_0x13c961=_['merge']({},_0x13c961,_0x29f5e5[_0xb486('0x68')]);return db['Disposition'][_0xb486('0x56')]({'where':_0x13c961['where']})['then'](function(_0x2aaf43){_0x5ca5fe[_0xb486('0x56')]=_0x2aaf43;if(_0x29f5e5[_0xb486('0x45')][_0xb486('0x57')]){_0x13c961[_0xb486('0x58')]=[{'all':!![]}];}return db[_0xb486('0x63')]['findAll'](_0x13c961);})[_0xb486('0x33')](function(_0x409a16){_0x5ca5fe[_0xb486('0x5a')]=_0x409a16;return _0x5ca5fe;});}})[_0xb486('0x33')](respondWithFilteredResult(_0x3a90b1,_0x13c961))[_0xb486('0x29')](handleError(_0x3a90b1,null));};exports['removeDispositions']=function(_0x1dc2d8,_0x1d5822,_0x16f9ed){return db[_0xb486('0x55')][_0xb486('0x62')]({'where':{'id':_0x1dc2d8[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x1d5822,null))['then'](function(_0x30a84d){if(_0x30a84d){return _0x30a84d[_0xb486('0x69')](_0x1dc2d8[_0xb486('0x45')][_0xb486('0x6a')]);}})[_0xb486('0x33')](respondWithStatusCode(_0x1d5822,null))[_0xb486('0x29')](handleError(_0x1d5822,null));};exports[_0xb486('0x6b')]=function(_0x269d95,_0x309b00,_0x55c366){if(_0x269d95[_0xb486('0x5e')]['id']){delete _0x269d95[_0xb486('0x5e')]['id'];}return db[_0xb486('0x55')][_0xb486('0x62')]({'where':{'id':_0x269d95['params']['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x309b00,null))[_0xb486('0x33')](function(_0x32a9bb){if(_0x32a9bb){_0x269d95['body']['MailAccountId']=_0x32a9bb['id'];return db[_0xb486('0x6c')][_0xb486('0x64')](_0x269d95[_0xb486('0x5e')]);}})[_0xb486('0x33')](respondWithResult(_0x309b00,null))['catch'](handleError(_0x309b00,null));};exports[_0xb486('0x6d')]=function(_0x2246e8,_0xc03859,_0x54b84d){var _0x181e68={'raw':![],'where':{}};var _0x4df7ca={};var _0x3a3014={'count':0x0,'rows':[]};return db[_0xb486('0x55')][_0xb486('0x6e')]({'where':{'id':_0x2246e8[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0xc03859,null))[_0xb486('0x33')](function(_0x3939f4){if(_0x3939f4){_0x4df7ca[_0xb486('0x44')]=_[_0xb486('0x46')](db[_0xb486('0x6c')][_0xb486('0x5d')]);_0x4df7ca[_0xb486('0x45')]=_['keys'](_0x2246e8[_0xb486('0x45')]);_0x4df7ca['filters']=_['intersection'](_0x4df7ca[_0xb486('0x44')],_0x4df7ca[_0xb486('0x45')]);_0x181e68['attributes']=_[_0xb486('0x49')](_0x4df7ca[_0xb486('0x44')],qs['fields'](_0x2246e8[_0xb486('0x45')][_0xb486('0x4a')]));_0x181e68[_0xb486('0x48')]=_0x181e68['attributes']['length']?_0x181e68[_0xb486('0x48')]:_0x4df7ca[_0xb486('0x44')];if(!_0x2246e8[_0xb486('0x45')]['hasOwnProperty'](_0xb486('0x4c'))){_0x181e68[_0xb486('0x2d')]=qs['limit'](_0x2246e8['query']['limit']);_0x181e68[_0xb486('0x2e')]=qs[_0xb486('0x2e')](_0x2246e8['query'][_0xb486('0x2e')]);}_0x181e68['order']=qs[_0xb486('0x4e')](_0x2246e8[_0xb486('0x45')][_0xb486('0x4e')]);_0x181e68[_0xb486('0x4f')]=qs[_0xb486('0x47')](_[_0xb486('0x50')](_0x2246e8[_0xb486('0x45')],_0x4df7ca[_0xb486('0x47')]));_0x181e68[_0xb486('0x4f')]['MailAccountId']=_0x3939f4['id'];if(_0x2246e8['query'][_0xb486('0x51')]){_0x181e68['where']=_[_0xb486('0x52')](_0x181e68['where'],{'$or':_[_0xb486('0x41')](_0x181e68[_0xb486('0x48')],function(_0x58edb0){var _0x54f407={};_0x54f407[_0x58edb0]={'$like':'%'+_0x2246e8[_0xb486('0x45')][_0xb486('0x51')]+'%'};return _0x54f407;})});}_0x181e68=_[_0xb486('0x52')]({},_0x181e68,_0x2246e8[_0xb486('0x68')]);return db['CannedAnswer'][_0xb486('0x56')]({'where':_0x181e68[_0xb486('0x4f')]})[_0xb486('0x33')](function(_0x494d02){_0x3a3014[_0xb486('0x56')]=_0x494d02;if(_0x2246e8[_0xb486('0x45')]['includeAll']){_0x181e68['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x181e68);})['then'](function(_0x29f951){_0x3a3014['rows']=_0x29f951;return _0x3a3014;});}})[_0xb486('0x33')](respondWithFilteredResult(_0xc03859,_0x181e68))[_0xb486('0x29')](handleError(_0xc03859,null));};exports[_0xb486('0x6f')]=function(_0x451475,_0x36c342,_0x395d75){return db[_0xb486('0x55')][_0xb486('0x62')]({'where':{'id':_0x451475[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x36c342,null))[_0xb486('0x33')](function(_0x34a3d2){if(_0x34a3d2){return _0x34a3d2[_0xb486('0x6f')](_0x451475['query'][_0xb486('0x6a')]);}})['then'](respondWithStatusCode(_0x36c342,null))[_0xb486('0x29')](handleError(_0x36c342,null));};exports['create']=function(_0x3eb097,_0x17923c){var _0x3b077c={'name':_0x3eb097[_0xb486('0x5e')][_0xb486('0x39')],'key':_0x3eb097[_0xb486('0x5e')][_0xb486('0x43')],'email':_0x3eb097[_0xb486('0x5e')][_0xb486('0x70')],'ListId':_0x3eb097[_0xb486('0x5e')][_0xb486('0x71')],'active':!_[_0xb486('0x72')](_0x3eb097[_0xb486('0x5e')][_0xb486('0x73')])?_0x3eb097['body'][_0xb486('0x73')]:!![],'description':_0x3eb097[_0xb486('0x5e')][_0xb486('0x74')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x3eb097[_0xb486('0x5e')][_0xb486('0x75')])){if(_0x3eb097[_0xb486('0x5e')][_0xb486('0x76')]){_0x3b077c['Imap'][_0xb486('0x77')]=_0x3b077c[_0xb486('0x3f')]['user']=_0x3eb097[_0xb486('0x5e')][_0xb486('0x78')];_0x3b077c[_0xb486('0x3d')]['password']=_0x3b077c[_0xb486('0x3f')][_0xb486('0x79')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x7a')];}else{_0x3b077c[_0xb486('0x3d')][_0xb486('0x7b')]=_0x3b077c[_0xb486('0x3f')][_0xb486('0x7b')]=![];}_0x3b077c[_0xb486('0x3d')][_0xb486('0x7c')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x3d')][_0xb486('0x7c')];_0x3b077c[_0xb486('0x3d')][_0xb486('0x7d')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x3d')][_0xb486('0x7d')];_0x3b077c[_0xb486('0x3f')][_0xb486('0x7c')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x3f')]['host'];_0x3b077c[_0xb486('0x3f')][_0xb486('0x7d')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x3f')][_0xb486('0x7d')];}else{_0x3b077c[_0xb486('0x3d')][_0xb486('0x7e')]=_0x3b077c[_0xb486('0x3f')][_0xb486('0x7e')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x75')];_0x3b077c['Imap'][_0xb486('0x77')]=_0x3b077c['Smtp'][_0xb486('0x77')]=_0x3eb097[_0xb486('0x5e')][_0xb486('0x78')];_0x3b077c['Imap'][_0xb486('0x7f')]=_0x3b077c[_0xb486('0x3f')][_0xb486('0x79')]=_0x3eb097['body']['cpassword'];}return db['MailAccount'][_0xb486('0x64')](_0x3b077c,{'include':[{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xb486('0x3c')],'as':'Imap'}]})[_0xb486('0x33')](function(_0x570d96){var _0x260646=_0x3eb097[_0xb486('0x77')]['get']({'plain':!![]});if(!_0x260646)throw new Error(_0xb486('0x80'));if(_0x260646[_0xb486('0x81')]===_0xb486('0x77')){var _0x4399e9=_0x570d96[_0xb486('0x34')]({'plain':!![]});return db[_0xb486('0x82')][_0xb486('0x62')]({'where':{'name':'MailAccounts','userProfileId':_0x260646['userProfileId']},'raw':!![]})[_0xb486('0x33')](function(_0x4ceed1){if(_0x4ceed1&&_0x4ceed1[_0xb486('0x83')]===0x0){return db[_0xb486('0x36')]['create']({'name':_0x4399e9['name'],'resourceId':_0x4399e9['id'],'type':_0x4ceed1[_0xb486('0x39')],'sectionId':_0x4ceed1['id']},{})[_0xb486('0x33')](function(){return _0x570d96;});}else{return _0x570d96;}})['catch'](function(_0x371416){logger[_0xb486('0x26')](_0xb486('0x84'),_0x371416);throw _0x371416;});}return _0x570d96;})[_0xb486('0x33')](respondWithResult(_0x17923c,0xc9))[_0xb486('0x29')](handleError(_0x17923c,null));};exports[_0xb486('0x85')]=function(_0x4581ff,_0x5505e7,_0x54af2c){return db[_0xb486('0x55')]['findOne']({'where':{'id':_0x4581ff['params']['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x5505e7,null))[_0xb486('0x33')](function(_0x2baa45){if(_0x2baa45){return _0x2baa45[_0xb486('0x85')]();}return null;})['then'](respondWithResult(_0x5505e7,null))[_0xb486('0x29')](handleError(_0x5505e7,null));};exports[_0xb486('0x86')]=function(_0x8575d9,_0x451b65,_0x2945eb){if(_0x8575d9['body']['id']){delete _0x8575d9[_0xb486('0x5e')]['id'];}return db['MailAccount'][_0xb486('0x62')]({'where':{'id':_0x8575d9[_0xb486('0x5c')]['id']}})['then'](handleEntityNotFound(_0x451b65,null))[_0xb486('0x33')](function(_0x519681){if(_0x519681){_0x8575d9[_0xb486('0x5e')][_0xb486('0x67')]=_0x519681['id'];return db['MailServerIn'][_0xb486('0x64')](_0x8575d9['body']);}})[_0xb486('0x33')](respondWithResult(_0x451b65,null))[_0xb486('0x29')](handleError(_0x451b65,null));};exports[_0xb486('0x87')]=function(_0x52849f,_0x3612f6,_0x12c531){return db[_0xb486('0x55')]['findOne']({'where':{'id':_0x52849f[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x3612f6,null))[_0xb486('0x33')](function(_0x3e92e6){if(_0x3e92e6){return _0x3e92e6[_0xb486('0x88')](null);}return null;})[_0xb486('0x33')](respondWithStatusCode(_0x3612f6,null))[_0xb486('0x29')](handleError(_0x3612f6,null));};exports[_0xb486('0x89')]=function(_0x2155a3,_0xcc6b93,_0x57ce3a){return db['MailAccount'][_0xb486('0x6e')]({'where':{'id':_0x2155a3[_0xb486('0x5c')]['id']}})['then'](handleEntityNotFound(_0xcc6b93,null))[_0xb486('0x33')](function(_0x1fe806){if(_0x1fe806){return _0x1fe806['getSmtp']();}return null;})[_0xb486('0x33')](respondWithResult(_0xcc6b93,null))[_0xb486('0x29')](handleError(_0xcc6b93,null));};exports[_0xb486('0x8a')]=function(_0x1894b1,_0x137823,_0x50ead7){if(_0x1894b1[_0xb486('0x5e')]['id']){delete _0x1894b1[_0xb486('0x5e')]['id'];}return db[_0xb486('0x55')][_0xb486('0x62')]({'where':{'id':_0x1894b1['params']['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x137823,null))[_0xb486('0x33')](function(_0x4cfc63){if(_0x4cfc63){_0x1894b1[_0xb486('0x5e')][_0xb486('0x67')]=_0x4cfc63['id'];return db[_0xb486('0x3e')][_0xb486('0x64')](_0x1894b1[_0xb486('0x5e')]);}})[_0xb486('0x33')](respondWithResult(_0x137823,null))[_0xb486('0x29')](handleError(_0x137823,null));};exports[_0xb486('0x8b')]=function(_0xc7805,_0x48f091,_0x2ab102){return db[_0xb486('0x55')]['findOne']({'where':{'id':_0xc7805[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x48f091,null))[_0xb486('0x33')](function(_0x5f3cb5){if(_0x5f3cb5){return _0x5f3cb5[_0xb486('0x8c')](null);}return null;})[_0xb486('0x33')](respondWithStatusCode(_0x48f091,null))[_0xb486('0x29')](handleError(_0x48f091,null));};exports[_0xb486('0x8d')]=function(_0x4d709f,_0x3c1df1,_0x46e705){return db[_0xb486('0x8e')][_0xb486('0x62')]({'where':{'id':_0x4d709f[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x3c1df1,null))['then'](function(_0x17bcfd){if(_0x17bcfd){return _0x17bcfd[_0xb486('0x8d')](_0x4d709f['body'][_0xb486('0x6a')],_[_0xb486('0x8f')](_0x4d709f[_0xb486('0x5e')],[_0xb486('0x6a'),'id'])||{});}})[_0xb486('0x33')](respondWithResult(_0x3c1df1,null))[_0xb486('0x29')](handleError(_0x3c1df1,null));};exports[_0xb486('0x90')]=function(_0x39e669,_0x15334b,_0x1fb8b8){var _0x560444={'raw':![],'where':{}};var _0x2d001f={};var _0x25249d={'count':0x0,'rows':[]};return db[_0xb486('0x55')][_0xb486('0x6e')]({'where':{'id':_0x39e669[_0xb486('0x5c')]['id']}})['then'](handleEntityNotFound(_0x15334b,null))[_0xb486('0x33')](function(_0x1aece8){if(_0x1aece8){_0x2d001f[_0xb486('0x44')]=_[_0xb486('0x46')](db['MailInteraction'][_0xb486('0x5d')]);_0x2d001f[_0xb486('0x45')]=_[_0xb486('0x46')](_0x39e669[_0xb486('0x45')]);_0x2d001f['filters']=_[_0xb486('0x49')](_0x2d001f[_0xb486('0x44')],_0x2d001f[_0xb486('0x45')]);_0x560444[_0xb486('0x48')]=_[_0xb486('0x49')](_0x2d001f[_0xb486('0x44')],qs[_0xb486('0x4a')](_0x39e669[_0xb486('0x45')][_0xb486('0x4a')]));_0x560444[_0xb486('0x48')]=_0x560444[_0xb486('0x48')]['length']?_0x560444[_0xb486('0x48')]:_0x2d001f[_0xb486('0x44')];if(!_0x39e669[_0xb486('0x45')][_0xb486('0x66')]('nolimit')){_0x560444[_0xb486('0x2d')]=qs[_0xb486('0x2d')](_0x39e669['query'][_0xb486('0x2d')]);_0x560444[_0xb486('0x2e')]=qs[_0xb486('0x2e')](_0x39e669[_0xb486('0x45')][_0xb486('0x2e')]);}_0x560444[_0xb486('0x4d')]=qs[_0xb486('0x4e')](_0x39e669['query'][_0xb486('0x4e')]);_0x560444[_0xb486('0x4f')]=qs[_0xb486('0x47')](_[_0xb486('0x50')](_0x39e669[_0xb486('0x45')],_0x2d001f[_0xb486('0x47')]));_0x560444[_0xb486('0x4f')][_0xb486('0x67')]=_0x1aece8['id'];if(_0x39e669[_0xb486('0x45')][_0xb486('0x51')]){_0x560444[_0xb486('0x4f')]=_['merge'](_0x560444['where'],{'$or':_['map'](_0x560444[_0xb486('0x48')],function(_0x10f069){var _0x42a4c3={};_0x42a4c3[_0x10f069]={'$like':'%'+_0x39e669['query'][_0xb486('0x51')]+'%'};return _0x42a4c3;})});}_0x560444=_[_0xb486('0x52')]({},_0x560444,_0x39e669[_0xb486('0x68')]);return db['MailInteraction'][_0xb486('0x56')]({'where':_0x560444[_0xb486('0x4f')]})[_0xb486('0x33')](function(_0xd2e098){_0x25249d['count']=_0xd2e098;if(_0x39e669['query'][_0xb486('0x57')]){_0x560444[_0xb486('0x58')]=[{'model':db[_0xb486('0x91')],'as':_0xb486('0x92'),'required':![]},{'model':db['User'],'as':_0xb486('0x93'),'attributes':[_0xb486('0x39'),'fullname',_0xb486('0x94')],'required':![]},{'model':db[_0xb486('0x95')],'as':'Tags','attributes':['id',_0xb486('0x39'),'color'],'where':_0x39e669[_0xb486('0x45')]['tag']?{'id':_0x39e669[_0xb486('0x45')][_0xb486('0x96')]}:undefined,'required':_0x39e669['query'][_0xb486('0x96')]?!![]:![]}];}return db[_0xb486('0x8e')][_0xb486('0x59')](_0x560444);})[_0xb486('0x33')](function(_0x397851){_0x25249d['rows']=_0x397851;return _0x25249d;});}})[_0xb486('0x33')](respondWithFilteredResult(_0x15334b,_0x560444))['catch'](handleError(_0x15334b,null));};exports['addApplications']=function(_0x4fa548,_0x8186c6,_0x1a0a92){return db['MailAccount']['findOne']({'where':{'id':_0x4fa548[_0xb486('0x5c')]['id']}})['then'](handleEntityNotFound(_0x8186c6,null))[_0xb486('0x33')](function(_0x333b2f){if(_0x333b2f){return db[_0xb486('0x97')]['transaction'](function(_0x59f3c1){return db[_0xb486('0x98')]['destroy']({'where':{'MailAccountId':_0x4fa548[_0xb486('0x5c')]['id']},'transaction':_0x59f3c1})[_0xb486('0x33')](function(_0x7f5bf5){var _0x3d1c56=_[_0xb486('0x41')](_0x4fa548[_0xb486('0x5e')],function(_0x18a6fc){_0x18a6fc[_0xb486('0x67')]=_0x4fa548[_0xb486('0x5c')]['id'];return _0x18a6fc;});return db[_0xb486('0x98')][_0xb486('0x99')](_0x3d1c56,{'transaction':_0x59f3c1});});})[_0xb486('0x33')](function(){return db[_0xb486('0x98')]['findAndCountAll']({'where':{'MailAccountId':_0x4fa548[_0xb486('0x5c')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x8186c6,null))[_0xb486('0x29')](handleError(_0x8186c6,null));};exports[_0xb486('0x9a')]=function(_0x359352,_0xa7b6bf,_0x5655cf){var _0x2759d9={};var _0x486809={};var _0x534a6c;var _0x21c28b;return db[_0xb486('0x55')][_0xb486('0x6e')]({'where':{'id':_0x359352[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0xa7b6bf,null))[_0xb486('0x33')](function(_0x541c0a){if(_0x541c0a){_0x534a6c=_0x541c0a;_0x486809['model']=_[_0xb486('0x46')](db[_0xb486('0x98')][_0xb486('0x5d')]);_0x486809[_0xb486('0x45')]=_[_0xb486('0x46')](_0x359352[_0xb486('0x45')]);_0x486809[_0xb486('0x47')]=_[_0xb486('0x49')](_0x486809[_0xb486('0x44')],_0x486809[_0xb486('0x45')]);_0x2759d9[_0xb486('0x48')]=_[_0xb486('0x49')](_0x486809['model'],qs[_0xb486('0x4a')](_0x359352[_0xb486('0x45')][_0xb486('0x4a')]));_0x2759d9[_0xb486('0x48')]=_0x2759d9[_0xb486('0x48')][_0xb486('0x4b')]?_0x2759d9[_0xb486('0x48')]:_0x486809[_0xb486('0x44')];_0x2759d9[_0xb486('0x4d')]=qs[_0xb486('0x4e')](_0x359352[_0xb486('0x45')][_0xb486('0x4e')]);_0x2759d9[_0xb486('0x4f')]=qs[_0xb486('0x47')](_[_0xb486('0x50')](_0x359352['query'],_0x486809[_0xb486('0x47')]));if(_0x359352[_0xb486('0x45')]['filter']){_0x2759d9[_0xb486('0x4f')]=_[_0xb486('0x52')](_0x2759d9[_0xb486('0x4f')],{'$or':_[_0xb486('0x41')](_0x2759d9[_0xb486('0x48')],function(_0x2ad3c6){var _0x30222e={};_0x30222e[_0x2ad3c6]={'$like':'%'+_0x359352[_0xb486('0x45')]['filter']+'%'};return _0x30222e;})});}_0x2759d9=_[_0xb486('0x52')]({},_0x2759d9,_0x359352[_0xb486('0x68')]);return _0x534a6c[_0xb486('0x9a')](_0x2759d9);}})['then'](function(_0x4af94f){if(_0x4af94f){_0x21c28b=_0x4af94f[_0xb486('0x4b')];if(!_0x359352['query'][_0xb486('0x66')]('nolimit')){_0x2759d9[_0xb486('0x2d')]=qs['limit'](_0x359352['query'][_0xb486('0x2d')]);_0x2759d9[_0xb486('0x2e')]=qs[_0xb486('0x2e')](_0x359352[_0xb486('0x45')][_0xb486('0x2e')]);}return _0x534a6c['getApplications'](_0x2759d9);}})[_0xb486('0x33')](function(_0x31c6fe){if(_0x31c6fe){return _0x31c6fe?{'count':_0x21c28b,'rows':_0x31c6fe}:null;}})[_0xb486('0x33')](respondWithResult(_0xa7b6bf,null))[_0xb486('0x29')](handleError(_0xa7b6bf,null));};exports['getMessages']=function(_0x13a07e,_0x4b2930,_0x1f6ce8){var _0x3d1e16={'raw':!![],'where':{}};var _0x16d827={};var _0x1655c8={'count':0x0,'rows':[]};return db[_0xb486('0x55')][_0xb486('0x6e')]({'where':{'id':_0x13a07e[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x4b2930,null))[_0xb486('0x33')](function(_0x34f4b2){if(_0x34f4b2){_0x16d827[_0xb486('0x44')]=_[_0xb486('0x46')](db[_0xb486('0x9b')][_0xb486('0x5d')]);_0x16d827['query']=_[_0xb486('0x46')](_0x13a07e[_0xb486('0x45')]);_0x16d827['filters']=_['intersection'](_0x16d827[_0xb486('0x44')],_0x16d827[_0xb486('0x45')]);_0x3d1e16[_0xb486('0x48')]=_[_0xb486('0x49')](_0x16d827['model'],qs['fields'](_0x13a07e[_0xb486('0x45')][_0xb486('0x4a')]));_0x3d1e16[_0xb486('0x48')]=_0x3d1e16['attributes'][_0xb486('0x4b')]?_0x3d1e16['attributes']:_0x16d827[_0xb486('0x44')];if(!_0x13a07e[_0xb486('0x45')]['hasOwnProperty']('nolimit')){_0x3d1e16[_0xb486('0x2d')]=qs[_0xb486('0x2d')](_0x13a07e[_0xb486('0x45')]['limit']);_0x3d1e16[_0xb486('0x2e')]=qs[_0xb486('0x2e')](_0x13a07e['query']['offset']);}_0x3d1e16['order']=qs[_0xb486('0x4e')](_0x13a07e['query'][_0xb486('0x4e')]);_0x3d1e16[_0xb486('0x4f')]=qs['filters'](_['pick'](_0x13a07e[_0xb486('0x45')],_0x16d827[_0xb486('0x47')]));_0x3d1e16[_0xb486('0x4f')][_0xb486('0x67')]=_0x34f4b2['id'];if(_0x13a07e['query'][_0xb486('0x51')]){_0x3d1e16[_0xb486('0x4f')]=_[_0xb486('0x52')](_0x3d1e16['where'],{'$or':_[_0xb486('0x41')](_0x3d1e16[_0xb486('0x48')],function(_0x2e469a){var _0xcbe4b3={};_0xcbe4b3[_0x2e469a]={'$like':'%'+_0x13a07e['query'][_0xb486('0x51')]+'%'};return _0xcbe4b3;})});}if(_0x13a07e[_0xb486('0x45')][_0xb486('0x9c')]){var _0x44aedf=_0x13a07e[_0xb486('0x45')][_0xb486('0x9c')][_0xb486('0x9d')](',');var _0x47c07d={};_0x47c07d[_0x44aedf[0x0]]={'$gte':moment(_0x44aedf[0x1])[_0xb486('0x9e')](_0xb486('0x9f'))};_0x3d1e16[_0xb486('0x4f')]=_[_0xb486('0x52')](_0x3d1e16['where'],_0x47c07d);}_0x3d1e16=_[_0xb486('0x52')]({},_0x3d1e16,_0x13a07e['options']);return db[_0xb486('0x9b')]['count']({'where':_0x3d1e16['where']})['then'](function(_0x256cef){_0x1655c8[_0xb486('0x56')]=_0x256cef;if(_0x13a07e[_0xb486('0x45')][_0xb486('0x57')]){_0x3d1e16[_0xb486('0x58')]=[{'all':!![]}];}return db[_0xb486('0x9b')]['findAll'](_0x3d1e16);})['then'](function(_0x3ce696){if(_0x13a07e[_0xb486('0x45')][_0xb486('0xa0')]===_0xb486('0xa1')){for(var _0xf4f9f4=0x0;_0xf4f9f4<_0x3ce696[_0xb486('0x4b')];_0xf4f9f4++){_0x3ce696[_0xf4f9f4][_0xb486('0x5e')]=juice(_0x3ce696[_0xf4f9f4][_0xb486('0x5e')]);}}_0x1655c8[_0xb486('0x5a')]=_0x3ce696;return _0x1655c8;});}})[_0xb486('0x33')](respondWithFilteredResult(_0x4b2930,_0x3d1e16))[_0xb486('0x29')](handleError(_0x4b2930,null));};exports['send']=function(_0x453687,_0x18440e,_0xadc223){var _0x4f942d,_0xf6860e={},_0x322593;if(_0x453687[_0xb486('0x5e')]['to']){_0x322593=_0x453687[_0xb486('0x5e')]['to'][_0xb486('0x9d')](',')[0x0];}return db[_0xb486('0x55')]['find']({'where':{'id':_0x453687[_0xb486('0x5c')]['id']},'include':[{'model':db[_0xb486('0xa2')],'as':'List','include':[{'model':db[_0xb486('0x91')],'as':_0xb486('0xa3'),'where':{'email':_0x322593},'limit':0x1,'order':[['updatedAt',_0xb486('0xa4')]]}]},{'model':db[_0xb486('0x3e')],'as':'Smtp','raw':!![]}]})[_0xb486('0x33')](handleEntityNotFound(_0x18440e,null))['then'](function(_0x575096){if(_0x575096){_0x4f942d=_0x575096;if(_0x575096[_0xb486('0x3f')]){if(_[_0xb486('0x72')](_0x453687['body']['from'])){_0x453687[_0xb486('0x5e')][_0xb486('0xa5')]=util[_0xb486('0x9e')](_0xb486('0xa6'),_0x575096[_0xb486('0x39')],_0x575096[_0xb486('0x70')]||_0x575096[_0xb486('0x3f')][_0xb486('0x77')]);}if(_0x453687[_0xb486('0x5e')][_0xb486('0xa7')]&&_0x453687[_0xb486('0x5e')][_0xb486('0xa7')][_0xb486('0x4b')]){for(var _0x359a75=0x0;_0x359a75<_0x453687[_0xb486('0x5e')][_0xb486('0xa7')][_0xb486('0x4b')];_0x359a75+=0x1){_0x453687[_0xb486('0x5e')]['attachments'][_0x359a75]={'filename':_0x453687[_0xb486('0x5e')]['attachments'][_0x359a75]['name'],'path':path[_0xb486('0xa8')](config[_0xb486('0xa9')],'server/files/attachments',_0x453687['body']['attachments'][_0x359a75]['basename'])};}}var _0x417ca1={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x575096[_0xb486('0x3f')][_0xb486('0x7e')])){if(_0x575096['Smtp']['authentication']){_0x417ca1[_0xb486('0xaa')]={'user':_0x575096[_0xb486('0x3f')][_0xb486('0x77')],'pass':_0x575096[_0xb486('0x3f')][_0xb486('0x79')]};}_0x417ca1['host']=_0x575096[_0xb486('0x3f')]['host'];_0x417ca1['port']=_0x575096['Smtp'][_0xb486('0x7d')];_0x417ca1[_0xb486('0xab')]=_0x575096[_0xb486('0x3f')]['secure'];}else{_0x417ca1[_0xb486('0x7e')]=_0x575096[_0xb486('0x3f')][_0xb486('0x7e')];_0x417ca1[_0xb486('0xaa')]={'user':_0x575096[_0xb486('0x3f')][_0xb486('0x77')],'pass':_0x575096[_0xb486('0x3f')][_0xb486('0x79')]};}return respondWithRpcPromise(_0xb486('0xac'),_0xb486('0xad'),{'account':_0x417ca1,'message':_0x453687[_0xb486('0x5e')]});}else{throw new Error('List\x20not\x20found');}}})[_0xb486('0x33')](function(_0x3259fc){if(_0x3259fc){_0xf6860e=_0x3259fc;if(_0x4f942d[_0xb486('0xae')]){if(_0x4f942d[_0xb486('0xae')][_0xb486('0xa3')][_0xb486('0x4b')]){return _0x4f942d[_0xb486('0xae')]['Contacts'][0x0];}else{return db[_0xb486('0x91')][_0xb486('0x64')](_[_0xb486('0x18')](_0x453687[_0xb486('0x5e')],{'firstName':_0x453687[_0xb486('0x5e')]['to'],'email':_0x453687['body']['to'],'phone':_0x453687[_0xb486('0x5e')]['to'],'ListId':_0x4f942d['ListId']}));}}else{throw new Error(_0xb486('0xaf'));}}})['then'](function(_0x5f5b1c){if(_0x5f5b1c){var _0x2091e1={'UserId':_0x453687['user']['id'],'ContactId':_0x5f5b1c['id'],'MailAccountId':_0x4f942d['id'],'inReplyTo':_0xf6860e[_0xb486('0xb0')],'to':_0x453687[_0xb486('0x5e')][_0xb486('0xa5')],'cc':_0x453687[_0xb486('0x5e')]['cc'],'subject':_0x453687[_0xb486('0x5e')][_0xb486('0xb1')],'attach':_0x453687['body']['attach'],'firstMsgDirection':_0xb486('0xb2'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0xb486('0x52')](_0x453687['body'],{'messageId':_0xf6860e[_0xb486('0xb0')],'sentAt':moment()['format'](_0xb486('0x9f')),'read':!![],'MailAccountId':_0x4f942d['id'],'UserId':_0x453687[_0xb486('0x77')]['id'],'ContactId':_0x5f5b1c['id']})]};if(_0x453687[_0xb486('0x5e')][_0xb486('0xb3')]){_0x2091e1=_[_0xb486('0x52')](_0x2091e1,_0x453687[_0xb486('0x5e')][_0xb486('0xb3')]);}return db['MailInteraction'][_0xb486('0x64')](_0x2091e1,{'include':[{'model':db[_0xb486('0x9b')],'as':_0xb486('0xb4')}]});}})['then'](respondWithResult(_0x18440e,null))[_0xb486('0x29')](handleError(_0x18440e,null));};exports[_0xb486('0xb5')]=function(_0x114fae,_0x2ad0b7,_0x4770ff){return db[_0xb486('0x55')][_0xb486('0x62')]({'where':{'id':_0x114fae[_0xb486('0x5c')]['id']},'include':[{'model':db[_0xb486('0x3e')],'as':_0xb486('0x3f'),'raw':!![]}]})[_0xb486('0x33')](handleEntityNotFound(_0x2ad0b7,null))[_0xb486('0x33')](function(_0x548de0){if(_0x548de0&&_0x548de0[_0xb486('0x3f')]){var _0x1cc637={'id':_0x548de0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x548de0['Smtp'][_0xb486('0x7e')]){_0x1cc637[_0xb486('0x7e')]=_0x548de0['Smtp']['service'];}else{_0x1cc637['host']=_0x548de0['Smtp']['host'];_0x1cc637['port']=_0x548de0[_0xb486('0x3f')][_0xb486('0x7d')];_0x1cc637['secure']=_0x548de0[_0xb486('0x3f')][_0xb486('0xab')];}if(_0x548de0[_0xb486('0x3f')][_0xb486('0x7b')]){_0x1cc637['auth']={'user':_0x548de0[_0xb486('0x3f')][_0xb486('0x77')],'pass':_0x548de0[_0xb486('0x3f')][_0xb486('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0xb486('0xb5'),{'account':_0x1cc637});}})[_0xb486('0x33')](respondWithResult(_0x2ad0b7,null))[_0xb486('0x29')](handleError(_0x2ad0b7,null));};exports[_0xb486('0xb6')]=function(_0x35406e,_0x52f4aa){return db['MailAccount'][_0xb486('0x62')]({'where':{'id':_0x35406e['params']['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x52f4aa,null))[_0xb486('0x33')](function(_0x138608){if(_0x138608&&_0x138608[_0xb486('0x7e')]){throw new db['Sequelize'][(_0xb486('0xb7'))](_0xb486('0xb8'));}return _0x138608;})[_0xb486('0x33')](removeEntity(_0x52f4aa,null))['catch'](handleError(_0x52f4aa,null));};exports[_0xb486('0xb9')]=function(_0x1266a4,_0x157ecd,_0x538622){return db[_0xb486('0x55')]['find']({'where':{'id':_0x1266a4[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x157ecd,null))[_0xb486('0x33')](function(_0xb9b920){if(_0xb9b920){return _0xb9b920[_0xb486('0xb9')](_0x1266a4[_0xb486('0x5e')][_0xb486('0x6a')],_['omit'](_0x1266a4[_0xb486('0x5e')],[_0xb486('0x6a'),'id'])||{})[_0xb486('0xba')](function(_0x356fdd){for(var _0x42eaca=0x0;_0x42eaca<_0x1266a4['body'][_0xb486('0x6a')][_0xb486('0x4b')];_0x42eaca+=0x1){socket[_0xb486('0xbb')](_0xb486('0xbc'),{'UserId':Number(_0x1266a4[_0xb486('0x5e')][_0xb486('0x6a')][_0x42eaca]),'MailAccountId':Number(_0x1266a4[_0xb486('0x5c')]['id'])});}return _0x356fdd;});}})[_0xb486('0x33')](respondWithResult(_0x157ecd,null))['catch'](handleError(_0x157ecd,null));};exports['removeAgents']=function(_0x566e09,_0x3c1b85,_0x2b91ca){return db['MailAccount'][_0xb486('0x62')]({'where':{'id':_0x566e09[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x3c1b85,null))[_0xb486('0x33')](function(_0x338971){if(_0x338971){return _0x338971[_0xb486('0xbd')](_0x566e09[_0xb486('0x45')][_0xb486('0x6a')])[_0xb486('0x33')](function(){if(_['isArray'](_0x566e09[_0xb486('0x45')][_0xb486('0x6a')])){for(var _0x9510d0=0x0;_0x9510d0<_0x566e09[_0xb486('0x45')][_0xb486('0x6a')][_0xb486('0x4b')];_0x9510d0+=0x1){socket[_0xb486('0xbb')](_0xb486('0xbe'),{'UserId':Number(_0x566e09[_0xb486('0x45')]['ids'][_0x9510d0]),'MailAccountId':Number(_0x566e09[_0xb486('0x5c')]['id'])});}}else{socket[_0xb486('0xbb')]('userMailAccount:remove',{'UserId':Number(_0x566e09[_0xb486('0x45')][_0xb486('0x6a')]),'MailAccountId':Number(_0x566e09[_0xb486('0x5c')]['id'])});}});}})[_0xb486('0x33')](respondWithStatusCode(_0x3c1b85,null))[_0xb486('0x29')](handleError(_0x3c1b85,null));};exports[_0xb486('0xbf')]=function(_0x4fd7d6,_0x5aa508,_0x5c0429){var _0xc6031f={};var _0x1fac98={};var _0x46e62c;var _0x38d676;return db[_0xb486('0x55')][_0xb486('0x6e')]({'where':{'id':_0x4fd7d6[_0xb486('0x5c')]['id']}})[_0xb486('0x33')](handleEntityNotFound(_0x5aa508,null))[_0xb486('0x33')](function(_0xd20a50){if(_0xd20a50){_0x46e62c=_0xd20a50;_0x1fac98[_0xb486('0x44')]=_['keys'](db[_0xb486('0xc0')][_0xb486('0x5d')]);_0x1fac98[_0xb486('0x45')]=_[_0xb486('0x46')](_0x4fd7d6['query']);_0x1fac98['filters']=_[_0xb486('0x49')](_0x1fac98[_0xb486('0x44')],_0x1fac98[_0xb486('0x45')]);_0xc6031f[_0xb486('0x48')]=_['intersection'](_0x1fac98['model'],qs[_0xb486('0x4a')](_0x4fd7d6[_0xb486('0x45')]['fields']));_0xc6031f['attributes']=_0xc6031f[_0xb486('0x48')][_0xb486('0x4b')]?_0xc6031f[_0xb486('0x48')]:_0x1fac98[_0xb486('0x44')];_0xc6031f[_0xb486('0x4d')]=qs[_0xb486('0x4e')](_0x4fd7d6[_0xb486('0x45')]['sort']);_0xc6031f['where']=qs[_0xb486('0x47')](_[_0xb486('0x50')](_0x4fd7d6[_0xb486('0x45')],_0x1fac98[_0xb486('0x47')]));if(_0x4fd7d6[_0xb486('0x45')][_0xb486('0x51')]){_0xc6031f[_0xb486('0x4f')]=_['merge'](_0xc6031f[_0xb486('0x4f')],{'$or':_[_0xb486('0x41')](_0xc6031f[_0xb486('0x48')],function(_0x130467){var _0x20b3c5={};_0x20b3c5[_0x130467]={'$like':'%'+_0x4fd7d6['query']['filter']+'%'};return _0x20b3c5;})});}_0xc6031f=_[_0xb486('0x52')]({},_0xc6031f,_0x4fd7d6[_0xb486('0x68')]);return _0x46e62c[_0xb486('0xbf')](_0xc6031f);}})['then'](function(_0x28c255){if(_0x28c255){_0x38d676=_0x28c255[_0xb486('0x4b')];if(!_0x4fd7d6[_0xb486('0x45')][_0xb486('0x66')](_0xb486('0x4c'))){_0xc6031f[_0xb486('0x2d')]=qs['limit'](_0x4fd7d6['query']['limit']);_0xc6031f[_0xb486('0x2e')]=qs[_0xb486('0x2e')](_0x4fd7d6[_0xb486('0x45')][_0xb486('0x2e')]);}return _0x46e62c[_0xb486('0xbf')](_0xc6031f);}})[_0xb486('0x33')](function(_0x1aed7f){if(_0x1aed7f){return _0x1aed7f?{'count':_0x38d676,'rows':_0x1aed7f}:null;}})[_0xb486('0x33')](respondWithResult(_0x5aa508,null))[_0xb486('0x29')](handleError(_0x5aa508,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 1fe8c49..2827c3f 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 _0xdab6=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x105320,_0x3a9151){var _0x2a2e4a=function(_0x21710a){while(--_0x21710a){_0x105320['push'](_0x105320['shift']());}};_0x2a2e4a(++_0x3a9151);}(_0xdab6,0x9a));var _0x6dab=function(_0x48996e,_0x48fe8a){_0x48996e=_0x48996e-0x0;var _0x4823bc=_0xdab6[_0x48996e];return _0x4823bc;};'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 +var _0x0b91=['MailAccount','save','update','remove','emit','hook','../../mysqldb'];(function(_0x2ba9ac,_0xa1fdc4){var _0x1b0fc9=function(_0x4343de){while(--_0x4343de){_0x2ba9ac['push'](_0x2ba9ac['shift']());}};_0x1b0fc9(++_0xa1fdc4);}(_0x0b91,0xae));var _0x10b9=function(_0x567729,_0x496557){_0x567729=_0x567729-0x0;var _0x5a8f22=_0x0b91[_0x567729];return _0x5a8f22;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x10b9('0x0'))['db'][_0x10b9('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x10b9('0x2'),'afterUpdate':_0x10b9('0x3'),'afterDestroy':_0x10b9('0x4')};function emitEvent(_0x59acf6){return function(_0x48c86c,_0x423d83,_0xb0e1c2){MailAccountEvents[_0x10b9('0x5')](_0x59acf6+':'+_0x48c86c['id'],_0x48c86c);MailAccountEvents[_0x10b9('0x5')](_0x59acf6,_0x48c86c);_0xb0e1c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x10b9('0x6')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 626535f..3c247c1 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 _0x583e=['rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','util','api','moment','bluebird','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x583e,0x1bd));var _0xe583=function(_0x4109a7,_0x33895a){_0x4109a7=_0x4109a7-0x0;var _0x5630a9=_0x583e[_0x4109a7];return _0x5630a9;};'use strict';var _=require('lodash');var util=require(_0xe583('0x0'));var logger=require('../../config/logger')(_0xe583('0x1'));var moment=require(_0xe583('0x2'));var BPromise=require(_0xe583('0x3'));var rp=require(_0xe583('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe583('0x5'));var config=require(_0xe583('0x6'));var attributes=require(_0xe583('0x7'));module[_0xe583('0x8')]=function(_0x2ee326,_0x14446f){return _0x2ee326['define'](_0xe583('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0b3=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','MailAccount','lodash','util','api','moment','bluebird'];(function(_0x44b057,_0x4f87f2){var _0x440a12=function(_0x4512a7){while(--_0x4512a7){_0x44b057['push'](_0x44b057['shift']());}};_0x440a12(++_0x4f87f2);}(_0xa0b3,0x103));var _0x3a0b=function(_0x1008cf,_0x588ae7){_0x1008cf=_0x1008cf-0x0;var _0x1a8f84=_0xa0b3[_0x1008cf];return _0x1a8f84;};'use strict';var _=require(_0x3a0b('0x0'));var util=require(_0x3a0b('0x1'));var logger=require('../../config/logger')(_0x3a0b('0x2'));var moment=require(_0x3a0b('0x3'));var BPromise=require(_0x3a0b('0x4'));var rp=require(_0x3a0b('0x5'));var fs=require('fs');var path=require(_0x3a0b('0x6'));var rimraf=require(_0x3a0b('0x7'));var config=require(_0x3a0b('0x8'));var attributes=require(_0x3a0b('0x9'));module['exports']=function(_0x4b372a,_0x26cdfc){return _0x4b372a['define'](_0x3a0b('0xa'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 278640e..f8e8966 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 _0xe5ca=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','localhost','socket.io-emitter','redis','./mailAccount.socket','register','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','MailAccount,\x20%s,\x20%s','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetMailAccount','debug','stringify','ShowMailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','CompanyId','ListId','body','from\x20is\x20mandatory','isNil','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','from','updatedAt','MailApplication','Smtp','List','get','account','omit','Applications','applications','list','orderBy','length','*,*,*,*','Contacts','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','update','format','created','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','interaction','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','lodash'];(function(_0x54bc96,_0x20cb68){var _0x4685b9=function(_0x41f797){while(--_0x41f797){_0x54bc96['push'](_0x54bc96['shift']());}};_0x4685b9(++_0x20cb68);}(_0xe5ca,0x1f3));var _0xae5c=function(_0x53fe97,_0x544271){_0x53fe97=_0x53fe97-0x0;var _0x5c49a2=_0xe5ca[_0x53fe97];return _0x5c49a2;};'use strict';var _=require(_0xae5c('0x0'));var util=require('util');var moment=require(_0xae5c('0x1'));var BPromise=require(_0xae5c('0x2'));var rs=require(_0xae5c('0x3'));var fs=require('fs');var Redis=require(_0xae5c('0x4'));var db=require(_0xae5c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xae5c('0x6'))('rpc');var config=require(_0xae5c('0x7'));var jayson=require(_0xae5c('0x8'));var client=jayson[_0xae5c('0x9')]['http']({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0xae5c('0xa'),'port':0x18eb});var socket=require(_0xae5c('0xb'))(new Redis(config[_0xae5c('0xc')]));require(_0xae5c('0xd'))[_0xae5c('0xe')](socket);function respondWithRpcPromise(_0x4f2e61,_0x58b565,_0x47feb9){return new BPromise(function(_0x1e99f6,_0x172c64){return client[_0xae5c('0xf')](_0x4f2e61,_0x47feb9)[_0xae5c('0x10')](function(_0x462c72){logger[_0xae5c('0x11')]('MailAccount,\x20%s,\x20%s',_0x58b565,_0xae5c('0x12'));logger['debug'](_0xae5c('0x13'),_0x58b565,_0xae5c('0x12'),JSON['stringify'](_0x462c72));if(_0x462c72[_0xae5c('0x14')]){if(_0x462c72['error'][_0xae5c('0x15')]===0x1f4){logger[_0xae5c('0x14')]('MailAccount,\x20%s,\x20%s',_0x58b565,_0x462c72['error'][_0xae5c('0x16')]);return _0x172c64(_0x462c72[_0xae5c('0x14')][_0xae5c('0x16')]);}logger['error'](_0xae5c('0x17'),_0x58b565,_0x462c72[_0xae5c('0x14')][_0xae5c('0x16')]);return _0x1e99f6(_0x462c72[_0xae5c('0x14')][_0xae5c('0x16')]);}else{logger[_0xae5c('0x11')]('MailAccount,\x20%s,\x20%s',_0x58b565,_0xae5c('0x12'));_0x1e99f6(_0x462c72[_0xae5c('0x18')][_0xae5c('0x16')]);}})[_0xae5c('0x19')](function(_0x1f3e02){logger[_0xae5c('0x14')](_0xae5c('0x17'),_0x58b565,_0x1f3e02);_0x172c64(_0x1f3e02);});});}exports['GetMailAccount']=function(_0x2899bc){var _0x3db3d5=this;return new Promise(function(_0x5e714a,_0xaa500f){return db[_0xae5c('0x1a')][_0xae5c('0x1b')]({'raw':_0x2899bc[_0xae5c('0x1c')]?_0x2899bc['options'][_0xae5c('0x1d')]===undefined?!![]:![]:!![],'where':_0x2899bc['options']?_0x2899bc['options'][_0xae5c('0x1e')]||null:null,'attributes':_0x2899bc[_0xae5c('0x1c')]?_0x2899bc[_0xae5c('0x1c')][_0xae5c('0x1f')]||null:null,'limit':_0x2899bc[_0xae5c('0x1c')]?_0x2899bc[_0xae5c('0x1c')][_0xae5c('0x20')]||null:null,'include':_0x2899bc[_0xae5c('0x1c')]?_0x2899bc[_0xae5c('0x1c')][_0xae5c('0x21')]?_[_0xae5c('0x22')](_0x2899bc[_0xae5c('0x1c')]['include'],function(_0x538ea5){return{'model':db[_0x538ea5['model']],'as':_0x538ea5['as'],'attributes':_0x538ea5[_0xae5c('0x1f')],'include':_0x538ea5['include']?_[_0xae5c('0x22')](_0x538ea5['include'],function(_0x1b151d){return{'model':db[_0x1b151d['model']],'as':_0x1b151d['as'],'attributes':_0x1b151d[_0xae5c('0x1f')],'include':_0x1b151d[_0xae5c('0x21')]?_[_0xae5c('0x22')](_0x1b151d[_0xae5c('0x21')],function(_0x1f2e2c){return{'model':db[_0x1f2e2c[_0xae5c('0x23')]],'as':_0x1f2e2c['as'],'attributes':_0x1f2e2c[_0xae5c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xae5c('0x10')](function(_0x241e51){logger[_0xae5c('0x11')](_0xae5c('0x24'),_0x2899bc);logger[_0xae5c('0x25')](_0xae5c('0x24'),_0x2899bc,JSON[_0xae5c('0x26')](_0x241e51));_0x5e714a(_0x241e51);})['catch'](function(_0x3e6093){logger['error'](_0xae5c('0x24'),_0x3e6093[_0xae5c('0x16')],_0x2899bc);_0xaa500f(_0x3db3d5['error'](0x1f4,_0x3e6093[_0xae5c('0x16')]));});});};exports[_0xae5c('0x27')]=function(_0x35c9f0){var _0x1bce60=this;return new Promise(function(_0x7d1499,_0x1a3fd1){return db[_0xae5c('0x1a')][_0xae5c('0x28')]({'raw':_0x35c9f0[_0xae5c('0x1c')]?_0x35c9f0[_0xae5c('0x1c')][_0xae5c('0x1d')]===undefined?!![]:![]:!![],'where':_0x35c9f0[_0xae5c('0x1c')]?_0x35c9f0[_0xae5c('0x1c')][_0xae5c('0x1e')]||null:null,'attributes':_0x35c9f0[_0xae5c('0x1c')]?_0x35c9f0[_0xae5c('0x1c')][_0xae5c('0x1f')]||null:null,'include':_0x35c9f0[_0xae5c('0x1c')]?_0x35c9f0['options'][_0xae5c('0x21')]?_['map'](_0x35c9f0[_0xae5c('0x1c')][_0xae5c('0x21')],function(_0x3f9c10){return{'model':db[_0x3f9c10[_0xae5c('0x23')]],'as':_0x3f9c10['as'],'attributes':_0x3f9c10['attributes'],'include':_0x3f9c10[_0xae5c('0x21')]?_[_0xae5c('0x22')](_0x3f9c10[_0xae5c('0x21')],function(_0x50732e){return{'model':db[_0x50732e[_0xae5c('0x23')]],'as':_0x50732e['as'],'attributes':_0x50732e['attributes'],'include':_0x50732e[_0xae5c('0x21')]?_[_0xae5c('0x22')](_0x50732e['include'],function(_0x29218c){return{'model':db[_0x29218c[_0xae5c('0x23')]],'as':_0x29218c['as'],'attributes':_0x29218c[_0xae5c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xae5c('0x10')](function(_0x49ac8b){logger[_0xae5c('0x11')](_0xae5c('0x27'),_0x35c9f0);logger['debug'](_0xae5c('0x27'),_0x35c9f0,JSON['stringify'](_0x49ac8b));_0x7d1499(_0x49ac8b);})[_0xae5c('0x19')](function(_0x425b57){logger['error'](_0xae5c('0x27'),_0x425b57[_0xae5c('0x16')],_0x35c9f0);_0x1a3fd1(_0x1bce60[_0xae5c('0x14')](0x1f4,_0x425b57[_0xae5c('0x16')]));});});};exports[_0xae5c('0x29')]=function(_0x4fcac4){var _0x3c5482=this;return new Promise(function(_0x79bd0d,_0x4ae553){var _0x3658ba={'body':_0x4fcac4['body'],'channel':_0xae5c('0x2a')};var _0x565495=_[_0xae5c('0x2b')](_[_0xae5c('0x2c')](db[_0xae5c('0x2d')][_0xae5c('0x2e')]),['createdAt','updatedAt',_0xae5c('0x2f'),_0xae5c('0x30')]);var _0x1aff09=![];if(_0x4fcac4[_0xae5c('0x31')]['id']){delete _0x4fcac4[_0xae5c('0x31')]['id'];}if(_['isNil'](_0x4fcac4[_0xae5c('0x31')]['from'])){return _0x4ae553(_0x3c5482[_0xae5c('0x14')](0x1f4,_0xae5c('0x32')));}if(_[_0xae5c('0x33')](_0x4fcac4[_0xae5c('0x31')]['body'])||_0x4fcac4['body'][_0xae5c('0x31')]===''){return _0x4ae553(_0x3c5482[_0xae5c('0x14')](0x1f4,_0xae5c('0x34')));}if(_[_0xae5c('0x33')](_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x35')])){return _0x4ae553(_0x3c5482['error'](0x1f4,_0xae5c('0x36')+_0x565495));}if(!_[_0xae5c('0x37')](_0x565495,_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x35')])){return _0x4ae553(_0x3c5482['error'](0x1f4,_0xae5c('0x38')+_0x565495));}var _0x306be6={};_0x306be6[_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x35')]]=_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x39')];return db[_0xae5c('0x1a')]['find']({'where':{'id':_0x4fcac4['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xae5c('0x2d')],'as':'Contacts','where':_0x306be6,'limit':0x1,'order':[[_0xae5c('0x3a'),'DESC']]}]},{'model':db[_0xae5c('0x3b')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xae5c('0x3c')}]})[_0xae5c('0x10')](function(_0x708468){if(_0x708468&&_0x708468[_0xae5c('0x3d')]){var _0x38dae4=_0x708468[_0xae5c('0x3e')]({'plain':!![]});_0x3658ba[_0xae5c('0x3f')]=_[_0xae5c('0x40')](_0x38dae4,[_0xae5c('0x41'),'List']);_0x3658ba[_0xae5c('0x42')]=_0x38dae4[_0xae5c('0x41')];_0x3658ba[_0xae5c('0x43')]=_0x38dae4[_0xae5c('0x3d')];_0x3658ba[_0xae5c('0x42')]=_[_0xae5c('0x44')](_0x3658ba[_0xae5c('0x42')],['priority'],['asc']);if(_0x3658ba[_0xae5c('0x3f')]&&_0x3658ba[_0xae5c('0x3f')]['autoclose']){_0x3658ba['applications']['push']({'id':0x0,'priority':_0x3658ba[_0xae5c('0x42')][_0xae5c('0x45')]+0x1,'app':'close','appdata':'autoclose','interval':_0xae5c('0x46')});}if(_0x3658ba[_0xae5c('0x3f')]['Applications']){delete _0x3658ba[_0xae5c('0x3f')][_0xae5c('0x41')];}if(_0x3658ba[_0xae5c('0x3f')][_0xae5c('0x3d')]){delete _0x3658ba[_0xae5c('0x3f')]['List'];}if(_0x38dae4[_0xae5c('0x3d')][_0xae5c('0x47')][_0xae5c('0x45')]){return _0x38dae4[_0xae5c('0x3d')][_0xae5c('0x47')][0x0];}var _0x24a6de=_['defaults'](_0x4fcac4[_0xae5c('0x31')],{'firstName':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x39')],'ListId':_0x38dae4[_0xae5c('0x30')]});_0x24a6de[_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x35')]]=_0x4fcac4[_0xae5c('0x31')]['from'];return db[_0xae5c('0x2d')]['create'](_0x24a6de);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x80bb4f){_0x3658ba[_0xae5c('0x48')]=_0x80bb4f;if(_0x80bb4f){if(!_0x4fcac4['body'][_0xae5c('0x16')][_0xae5c('0x49')]){_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x49')]=rs[_0xae5c('0x4a')]()+'\x20'+_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x39')];}var _0x43d5e3={'ContactId':_0x80bb4f['id'],'MailAccountId':_0x4fcac4[_0xae5c('0x3f')]['id'],'inReplyTo':_0x4fcac4[_0xae5c('0x31')]['message'][_0xae5c('0x49')],'to':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x39')],'cc':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')]['cc'],'subject':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x4b')],'attach':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x4c')],'lastMsgAt':moment()['format'](_0xae5c('0x4d')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xae5c('0x28')]({'where':{'closed':![],'MailAccountId':_0x4fcac4['account']['id']},'include':[{'model':db[_0xae5c('0x4e')],'as':_0xae5c('0x4f'),'attributes':[_0xae5c('0x49')],'where':{'messageId':_0x4fcac4[_0xae5c('0x31')]['message'][_0xae5c('0x50')]}}]})[_0xae5c('0x10')](function(_0x240e09){if(_0x240e09){return[_0x240e09,![]];}return db['MailInteraction'][_0xae5c('0x51')](_0x43d5e3)[_0xae5c('0x10')](function(_0x4faade){return[_0x4faade,!![]];});});}else{throw new Error(_0xae5c('0x52'));}})['spread'](function(_0x3efce1,_0x1842b0){if(_0x3efce1){_0x1aff09=_0x1842b0;if(!_0x1842b0){return _0x3efce1[_0xae5c('0x53')]({'inReplyTo':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x49')],'to':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x39')],'cc':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')]['cc'],'subject':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x4b')],'attach':_0x3efce1['attach']?_0x3efce1[_0xae5c('0x4c')]:_0x4fcac4['body']['message'][_0xae5c('0x4c')],'substatus':null,'substatusAt':moment()[_0xae5c('0x54')](_0xae5c('0x4d')),'lastMsgAt':moment()[_0xae5c('0x54')](_0xae5c('0x4d')),'lastMsgDirection':'in'});}else{return _0x3efce1;}}})['then'](function(_0x40f760){_0x3658ba['interaction']=_0x40f760['get']({'plain':!![]});_0x3658ba['interaction'][_0xae5c('0x55')]=_0x1aff09;return db[_0xae5c('0x4e')][_0xae5c('0x51')]({'body':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x31')],'MailAccountId':_0x4fcac4[_0xae5c('0x3f')]['id'],'MailInteractionId':_0x40f760['id'],'direction':'in','ContactId':_0x3658ba[_0xae5c('0x48')]['id'],'messageId':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')]['messageId'],'from':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')]['from'],'to':_0x4fcac4['body'][_0xae5c('0x16')]['to'],'cc':_0x4fcac4['body'][_0xae5c('0x16')]['cc'],'subject':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x4b')],'attach':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')]['attach'],'Attachments':_0x4fcac4['body']['message']['attachments'],'originTo':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x56')],'originCc':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')]['originCc'],'bcc':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x57')],'ChatWebsiteId':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x58')]||null,'originChannel':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x59')]||_0xae5c('0x5a'),'ChatOfflineMessageId':_0x4fcac4[_0xae5c('0x31')][_0xae5c('0x16')][_0xae5c('0x5b')]||null},{'include':[{'model':db['Attachment'],'as':_0xae5c('0x5c')}]});})[_0xae5c('0x10')](function(_0x4b2633){_0x3658ba[_0xae5c('0x16')]=_0x4b2633;if(_0x3658ba[_0xae5c('0x5d')][_0xae5c('0x5e')]){return db[_0xae5c('0x5f')]['find']({'attributes':['id','name'],'where':{'id':_0x3658ba['interaction'][_0xae5c('0x5e')]}})[_0xae5c('0x10')](function(_0x428624){if(_0x428624){_0x3658ba[_0xae5c('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0xae5c('0x60'),'appdata':_0x428624['name']+','+(_0x3658ba[_0xae5c('0x3f')][_0xae5c('0x61')]||0xa),'interval':_0xae5c('0x46')});}return respondWithRpcPromise(_0xae5c('0x62'),_0xae5c('0x63'),_0x3658ba);});}return respondWithRpcPromise(_0xae5c('0x62'),_0xae5c('0x63'),_0x3658ba);})[_0xae5c('0x10')](function(_0x1ded9c){_0x79bd0d(_0x1ded9c);})[_0xae5c('0x19')](function(_0x589346){_0x4ae553(_0x3c5482['error'](0x1f4,_0x589346[_0xae5c('0x16')]));});});}; \ No newline at end of file +var _0x2f0e=['MailAccount','options','raw','where','attributes','limit','include','model','map','ShowMailAccount','find','NotifyMailAccount','body','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','List','Contacts','DESC','MailApplication','Smtp','omit','applications','Applications','orderBy','priority','asc','length','*,*,*,*','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetMailAccount'];(function(_0x38f4dd,_0xf2b993){var _0x5970c3=function(_0x38fa31){while(--_0x38fa31){_0x38f4dd['push'](_0x38f4dd['shift']());}};_0x5970c3(++_0xf2b993);}(_0x2f0e,0xb2));var _0xe2f0=function(_0x12bc55,_0x729eaf){_0x12bc55=_0x12bc55-0x0;var _0xb9e72a=_0x2f0e[_0x12bc55];return _0xb9e72a;};'use strict';var _=require(_0xe2f0('0x0'));var util=require(_0xe2f0('0x1'));var moment=require(_0xe2f0('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2f0('0x3'));var fs=require('fs');var Redis=require(_0xe2f0('0x4'));var db=require(_0xe2f0('0x5'))['db'];var utils=require(_0xe2f0('0x6'));var logger=require(_0xe2f0('0x7'))(_0xe2f0('0x8'));var config=require(_0xe2f0('0x9'));var jayson=require(_0xe2f0('0xa'));var client=jayson['client']['http']({'port':0x232c});config[_0xe2f0('0xb')]=_['defaults'](config[_0xe2f0('0xb')],{'host':_0xe2f0('0xc'),'port':0x18eb});var socket=require(_0xe2f0('0xd'))(new Redis(config[_0xe2f0('0xb')]));require(_0xe2f0('0xe'))[_0xe2f0('0xf')](socket);function respondWithRpcPromise(_0x19e6b3,_0x366919,_0x37ce58){return new BPromise(function(_0x11fd67,_0x2a5200){return client[_0xe2f0('0x10')](_0x19e6b3,_0x37ce58)[_0xe2f0('0x11')](function(_0x117c97){logger['info'](_0xe2f0('0x12'),_0x366919,_0xe2f0('0x13'));logger[_0xe2f0('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x366919,_0xe2f0('0x13'),JSON[_0xe2f0('0x15')](_0x117c97));if(_0x117c97[_0xe2f0('0x16')]){if(_0x117c97['error'][_0xe2f0('0x17')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x366919,_0x117c97[_0xe2f0('0x16')]['message']);return _0x2a5200(_0x117c97['error'][_0xe2f0('0x18')]);}logger[_0xe2f0('0x16')]('MailAccount,\x20%s,\x20%s',_0x366919,_0x117c97[_0xe2f0('0x16')]['message']);return _0x11fd67(_0x117c97['error'][_0xe2f0('0x18')]);}else{logger[_0xe2f0('0x19')](_0xe2f0('0x12'),_0x366919,_0xe2f0('0x13'));_0x11fd67(_0x117c97['result'][_0xe2f0('0x18')]);}})[_0xe2f0('0x1a')](function(_0x561f5b){logger[_0xe2f0('0x16')](_0xe2f0('0x12'),_0x366919,_0x561f5b);_0x2a5200(_0x561f5b);});});}exports[_0xe2f0('0x1b')]=function(_0x3e6bae){var _0x546e37=this;return new Promise(function(_0x203db8,_0x55a461){return db[_0xe2f0('0x1c')]['findAll']({'raw':_0x3e6bae[_0xe2f0('0x1d')]?_0x3e6bae[_0xe2f0('0x1d')][_0xe2f0('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e6bae['options']?_0x3e6bae[_0xe2f0('0x1d')][_0xe2f0('0x1f')]||null:null,'attributes':_0x3e6bae[_0xe2f0('0x1d')]?_0x3e6bae[_0xe2f0('0x1d')][_0xe2f0('0x20')]||null:null,'limit':_0x3e6bae['options']?_0x3e6bae['options'][_0xe2f0('0x21')]||null:null,'include':_0x3e6bae['options']?_0x3e6bae['options']['include']?_['map'](_0x3e6bae[_0xe2f0('0x1d')][_0xe2f0('0x22')],function(_0x3b1484){return{'model':db[_0x3b1484[_0xe2f0('0x23')]],'as':_0x3b1484['as'],'attributes':_0x3b1484[_0xe2f0('0x20')],'include':_0x3b1484[_0xe2f0('0x22')]?_[_0xe2f0('0x24')](_0x3b1484[_0xe2f0('0x22')],function(_0x14275a){return{'model':db[_0x14275a[_0xe2f0('0x23')]],'as':_0x14275a['as'],'attributes':_0x14275a[_0xe2f0('0x20')],'include':_0x14275a[_0xe2f0('0x22')]?_[_0xe2f0('0x24')](_0x14275a[_0xe2f0('0x22')],function(_0x57c08d){return{'model':db[_0x57c08d[_0xe2f0('0x23')]],'as':_0x57c08d['as'],'attributes':_0x57c08d[_0xe2f0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29c08b){logger[_0xe2f0('0x19')]('GetMailAccount',_0x3e6bae);logger[_0xe2f0('0x14')](_0xe2f0('0x1b'),_0x3e6bae,JSON[_0xe2f0('0x15')](_0x29c08b));_0x203db8(_0x29c08b);})[_0xe2f0('0x1a')](function(_0x175ef5){logger[_0xe2f0('0x16')](_0xe2f0('0x1b'),_0x175ef5[_0xe2f0('0x18')],_0x3e6bae);_0x55a461(_0x546e37[_0xe2f0('0x16')](0x1f4,_0x175ef5['message']));});});};exports[_0xe2f0('0x25')]=function(_0x513a2b){var _0x363408=this;return new Promise(function(_0x4923c3,_0x3162db){return db[_0xe2f0('0x1c')][_0xe2f0('0x26')]({'raw':_0x513a2b[_0xe2f0('0x1d')]?_0x513a2b[_0xe2f0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x513a2b[_0xe2f0('0x1d')]?_0x513a2b[_0xe2f0('0x1d')][_0xe2f0('0x1f')]||null:null,'attributes':_0x513a2b[_0xe2f0('0x1d')]?_0x513a2b[_0xe2f0('0x1d')][_0xe2f0('0x20')]||null:null,'include':_0x513a2b[_0xe2f0('0x1d')]?_0x513a2b['options'][_0xe2f0('0x22')]?_['map'](_0x513a2b[_0xe2f0('0x1d')]['include'],function(_0x4f43db){return{'model':db[_0x4f43db[_0xe2f0('0x23')]],'as':_0x4f43db['as'],'attributes':_0x4f43db[_0xe2f0('0x20')],'include':_0x4f43db[_0xe2f0('0x22')]?_[_0xe2f0('0x24')](_0x4f43db['include'],function(_0x223732){return{'model':db[_0x223732[_0xe2f0('0x23')]],'as':_0x223732['as'],'attributes':_0x223732[_0xe2f0('0x20')],'include':_0x223732['include']?_['map'](_0x223732[_0xe2f0('0x22')],function(_0x4b4e2b){return{'model':db[_0x4b4e2b['model']],'as':_0x4b4e2b['as'],'attributes':_0x4b4e2b[_0xe2f0('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1311f8){logger[_0xe2f0('0x19')](_0xe2f0('0x25'),_0x513a2b);logger[_0xe2f0('0x14')](_0xe2f0('0x25'),_0x513a2b,JSON['stringify'](_0x1311f8));_0x4923c3(_0x1311f8);})['catch'](function(_0x11db83){logger['error'](_0xe2f0('0x25'),_0x11db83['message'],_0x513a2b);_0x3162db(_0x363408[_0xe2f0('0x16')](0x1f4,_0x11db83[_0xe2f0('0x18')]));});});};exports[_0xe2f0('0x27')]=function(_0xa94655){var _0x25dc90=this;return new Promise(function(_0x294406,_0x3e019f){var _0x35e255={'body':_0xa94655[_0xe2f0('0x28')],'channel':'mail'};var _0xe6138a=_[_0xe2f0('0x29')](_['keys'](db[_0xe2f0('0x2a')][_0xe2f0('0x2b')]),[_0xe2f0('0x2c'),_0xe2f0('0x2d'),_0xe2f0('0x2e'),_0xe2f0('0x2f')]);var _0x2a61e4=![];if(_0xa94655[_0xe2f0('0x28')]['id']){delete _0xa94655['body']['id'];}if(_[_0xe2f0('0x30')](_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x31')])){return _0x3e019f(_0x25dc90['error'](0x1f4,_0xe2f0('0x32')));}if(_[_0xe2f0('0x30')](_0xa94655[_0xe2f0('0x28')]['body'])||_0xa94655[_0xe2f0('0x28')]['body']===''){return _0x3e019f(_0x25dc90[_0xe2f0('0x16')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xe2f0('0x30')](_0xa94655[_0xe2f0('0x28')]['mapKey'])){return _0x3e019f(_0x25dc90['error'](0x1f4,_0xe2f0('0x33')+_0xe6138a));}if(!_[_0xe2f0('0x34')](_0xe6138a,_0xa94655['body']['mapKey'])){return _0x3e019f(_0x25dc90[_0xe2f0('0x16')](0x1f4,_0xe2f0('0x35')+_0xe6138a));}var _0x57d71a={};_0x57d71a[_0xa94655['body'][_0xe2f0('0x36')]]=_0xa94655[_0xe2f0('0x28')]['from'];return db[_0xe2f0('0x1c')][_0xe2f0('0x26')]({'where':{'id':_0xa94655[_0xe2f0('0x37')]['id']},'include':[{'model':db[_0xe2f0('0x38')],'as':_0xe2f0('0x39'),'include':[{'model':db[_0xe2f0('0x2a')],'as':_0xe2f0('0x3a'),'where':_0x57d71a,'limit':0x1,'order':[[_0xe2f0('0x2d'),_0xe2f0('0x3b')]]}]},{'model':db[_0xe2f0('0x3c')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xe2f0('0x3d')}]})['then'](function(_0x1ee607){if(_0x1ee607&&_0x1ee607[_0xe2f0('0x39')]){var _0x1d3708=_0x1ee607['get']({'plain':!![]});_0x35e255['account']=_[_0xe2f0('0x3e')](_0x1d3708,['Applications','List']);_0x35e255[_0xe2f0('0x3f')]=_0x1d3708[_0xe2f0('0x40')];_0x35e255['list']=_0x1d3708[_0xe2f0('0x39')];_0x35e255[_0xe2f0('0x3f')]=_[_0xe2f0('0x41')](_0x35e255[_0xe2f0('0x3f')],[_0xe2f0('0x42')],[_0xe2f0('0x43')]);if(_0x35e255[_0xe2f0('0x37')]&&_0x35e255[_0xe2f0('0x37')]['autoclose']){_0x35e255[_0xe2f0('0x3f')]['push']({'id':0x0,'priority':_0x35e255['applications'][_0xe2f0('0x44')]+0x1,'app':'close','appdata':'autoclose','interval':_0xe2f0('0x45')});}if(_0x35e255[_0xe2f0('0x37')][_0xe2f0('0x40')]){delete _0x35e255[_0xe2f0('0x37')]['Applications'];}if(_0x35e255[_0xe2f0('0x37')][_0xe2f0('0x39')]){delete _0x35e255[_0xe2f0('0x37')][_0xe2f0('0x39')];}if(_0x1d3708[_0xe2f0('0x39')][_0xe2f0('0x3a')][_0xe2f0('0x44')]){return _0x1d3708[_0xe2f0('0x39')][_0xe2f0('0x3a')][0x0];}var _0x118a77=_['defaults'](_0xa94655[_0xe2f0('0x28')],{'firstName':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x31')],'ListId':_0x1d3708['ListId']});_0x118a77[_0xa94655['body'][_0xe2f0('0x36')]]=_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x31')];return db[_0xe2f0('0x2a')]['create'](_0x118a77);}else{throw new Error(_0xe2f0('0x46'));}})[_0xe2f0('0x11')](function(_0x1dba73){_0x35e255[_0xe2f0('0x47')]=_0x1dba73;if(_0x1dba73){if(!_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x48')]){_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x48')]=rs[_0xe2f0('0x49')]()+'\x20'+_0xa94655['body'][_0xe2f0('0x18')][_0xe2f0('0x31')];}var _0xe5df42={'ContactId':_0x1dba73['id'],'MailAccountId':_0xa94655[_0xe2f0('0x37')]['id'],'inReplyTo':_0xa94655['body']['message']['messageId'],'to':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x31')],'cc':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')]['cc'],'subject':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x4a')],'attach':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x4b')],'lastMsgAt':moment()[_0xe2f0('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xe2f0('0x4d')][_0xe2f0('0x26')]({'where':{'closed':![],'MailAccountId':_0xa94655[_0xe2f0('0x37')]['id']},'include':[{'model':db[_0xe2f0('0x4e')],'as':_0xe2f0('0x4f'),'attributes':[_0xe2f0('0x48')],'where':{'messageId':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x50')]}}]})[_0xe2f0('0x11')](function(_0xbda1c7){if(_0xbda1c7){return[_0xbda1c7,![]];}return db['MailInteraction'][_0xe2f0('0x51')](_0xe5df42)[_0xe2f0('0x11')](function(_0x3e4c74){return[_0x3e4c74,!![]];});});}else{throw new Error(_0xe2f0('0x52'));}})[_0xe2f0('0x53')](function(_0x5ce232,_0x430dfb){if(_0x5ce232){_0x2a61e4=_0x430dfb;if(!_0x430dfb){return _0x5ce232[_0xe2f0('0x54')]({'inReplyTo':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x48')],'to':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x31')],'cc':_0xa94655['body'][_0xe2f0('0x18')]['cc'],'subject':_0xa94655[_0xe2f0('0x28')]['message'][_0xe2f0('0x4a')],'attach':_0x5ce232[_0xe2f0('0x4b')]?_0x5ce232['attach']:_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0xe2f0('0x4c')](_0xe2f0('0x55')),'lastMsgAt':moment()[_0xe2f0('0x4c')](_0xe2f0('0x55')),'lastMsgDirection':'in'});}else{return _0x5ce232;}}})[_0xe2f0('0x11')](function(_0x451c5b){_0x35e255[_0xe2f0('0x56')]=_0x451c5b['get']({'plain':!![]});_0x35e255['interaction'][_0xe2f0('0x57')]=_0x2a61e4;return db[_0xe2f0('0x4e')][_0xe2f0('0x51')]({'body':_0xa94655[_0xe2f0('0x28')]['body'],'MailAccountId':_0xa94655[_0xe2f0('0x37')]['id'],'MailInteractionId':_0x451c5b['id'],'direction':'in','ContactId':_0x35e255['contact']['id'],'messageId':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x48')],'from':_0xa94655[_0xe2f0('0x28')]['message'][_0xe2f0('0x31')],'to':_0xa94655['body'][_0xe2f0('0x18')]['to'],'cc':_0xa94655[_0xe2f0('0x28')]['message']['cc'],'subject':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x4a')],'attach':_0xa94655['body'][_0xe2f0('0x18')][_0xe2f0('0x4b')],'Attachments':_0xa94655['body'][_0xe2f0('0x18')][_0xe2f0('0x58')],'originTo':_0xa94655['body'][_0xe2f0('0x18')]['originTo'],'originCc':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x59')],'bcc':_0xa94655[_0xe2f0('0x28')][_0xe2f0('0x18')][_0xe2f0('0x5a')],'ChatWebsiteId':_0xa94655[_0xe2f0('0x28')]['message'][_0xe2f0('0x5b')]||null,'originChannel':_0xa94655[_0xe2f0('0x28')]['message'][_0xe2f0('0x5c')]||_0xe2f0('0x5d'),'ChatOfflineMessageId':_0xa94655['body'][_0xe2f0('0x18')][_0xe2f0('0x5e')]||null},{'include':[{'model':db[_0xe2f0('0x5f')],'as':_0xe2f0('0x60')}]});})[_0xe2f0('0x11')](function(_0x8f4b33){_0x35e255['message']=_0x8f4b33;if(_0x35e255[_0xe2f0('0x56')][_0xe2f0('0x61')]){return db[_0xe2f0('0x62')]['find']({'attributes':['id','name'],'where':{'id':_0x35e255[_0xe2f0('0x56')][_0xe2f0('0x61')]}})[_0xe2f0('0x11')](function(_0x341f1e){if(_0x341f1e){_0x35e255[_0xe2f0('0x3f')][_0xe2f0('0x63')]({'id':0x0,'priority':0x0,'app':_0xe2f0('0x64'),'appdata':_0x341f1e['name']+','+(_0x35e255[_0xe2f0('0x37')]['waitForTheAssignedAgent']||0xa),'interval':_0xe2f0('0x45')});}return respondWithRpcPromise(_0xe2f0('0x65'),_0xe2f0('0x66'),_0x35e255);});}return respondWithRpcPromise(_0xe2f0('0x65'),_0xe2f0('0x66'),_0x35e255);})['then'](function(_0x6df543){_0x294406(_0x6df543);})[_0xe2f0('0x1a')](function(_0x26c56b){_0x3e019f(_0x25dc90['error'](0x1f4,_0x26c56b[_0xe2f0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ac891df..7639b75 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 _0x7e88=['removeListener','register','length','./mailAccount.events','remove','update','emit'];(function(_0xfb08f1,_0x86d4ae){var _0x224406=function(_0x1daa57){while(--_0x1daa57){_0xfb08f1['push'](_0xfb08f1['shift']());}};_0x224406(++_0x86d4ae);}(_0x7e88,0x81));var _0x87e8=function(_0xdff7ce,_0x3e6dbb){_0xdff7ce=_0xdff7ce-0x0;var _0x540d07=_0x7e88[_0xdff7ce];return _0x540d07;};'use strict';var MailAccountEvents=require(_0x87e8('0x0'));var events=['save',_0x87e8('0x1'),_0x87e8('0x2')];function createListener(_0x1e563b,_0x5a64d1){return function(_0xda5fff){_0x5a64d1[_0x87e8('0x3')](_0x1e563b,_0xda5fff);};}function removeListener(_0x47271b,_0x539cd3){return function(){MailAccountEvents[_0x87e8('0x4')](_0x47271b,_0x539cd3);};}exports[_0x87e8('0x5')]=function(_0x3e4844){for(var _0x8859eb=0x0,_0x2c983f=events[_0x87e8('0x6')];_0x8859eb<_0x2c983f;_0x8859eb++){var _0x1ab636=events[_0x8859eb];var _0x2058f2=createListener('mailAccount:'+_0x1ab636,_0x3e4844);MailAccountEvents['on'](_0x1ab636,_0x2058f2);}}; \ No newline at end of file +var _0x9efc=['emit','register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x51eba7,_0x265963){var _0x532bc1=function(_0x15ac6c){while(--_0x15ac6c){_0x51eba7['push'](_0x51eba7['shift']());}};_0x532bc1(++_0x265963);}(_0x9efc,0x19c));var _0xc9ef=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x9efc[_0x4cc492];return _0x1f36b9;};'use strict';var MailAccountEvents=require(_0xc9ef('0x0'));var events=[_0xc9ef('0x1'),_0xc9ef('0x2'),_0xc9ef('0x3')];function createListener(_0x3af123,_0x5a6fac){return function(_0x5475ee){_0x5a6fac[_0xc9ef('0x4')](_0x3af123,_0x5475ee);};}function removeListener(_0x562fa7,_0xd71311){return function(){MailAccountEvents['removeListener'](_0x562fa7,_0xd71311);};}exports[_0xc9ef('0x5')]=function(_0x5eae9a){for(var _0x40bed3=0x0,_0xb3be8b=events[_0xc9ef('0x6')];_0x40bed3<_0xb3be8b;_0x40bed3++){var _0xb1af3a=events[_0x40bed3];var _0x45cc54=createListener(_0xc9ef('0x7')+_0xb1af3a,_0x5eae9a);MailAccountEvents['on'](_0xb1af3a,_0x45cc54);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index edd99f0..e29c952 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 _0x8dc1=['put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x46a563,_0x586712){var _0x10aa22=function(_0x199db8){while(--_0x199db8){_0x46a563['push'](_0x46a563['shift']());}};_0x10aa22(++_0x586712);}(_0x8dc1,0x19c));var _0x18dc=function(_0xcd3e99,_0x25a1d9){_0xcd3e99=_0xcd3e99-0x0;var _0x4afa05=_0x8dc1[_0xcd3e99];return _0x4afa05;};'use strict';var multer=require(_0x18dc('0x0'));var util=require(_0x18dc('0x1'));var path=require(_0x18dc('0x2'));var timeout=require(_0x18dc('0x3'));var express=require('express');var router=express[_0x18dc('0x4')]();var fs_extra=require(_0x18dc('0x5'));var auth=require(_0x18dc('0x6'));var interaction=require(_0x18dc('0x7'));var config=require('../../config/environment');var controller=require(_0x18dc('0x8'));router[_0x18dc('0x9')](_0x18dc('0xa'),auth[_0x18dc('0xb')](),controller[_0x18dc('0xc')]);router[_0x18dc('0xd')]('/:id',auth[_0x18dc('0xb')](),controller[_0x18dc('0xe')]);router[_0x18dc('0xf')]('/:id',auth[_0x18dc('0xb')](),controller[_0x18dc('0x10')]);module['exports']=router; \ No newline at end of file +var _0x53b5=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated','/:id','destroy','exports','util'];(function(_0x4a4940,_0xafc6e2){var _0x82c162=function(_0x528e38){while(--_0x528e38){_0x4a4940['push'](_0x4a4940['shift']());}};_0x82c162(++_0xafc6e2);}(_0x53b5,0xd7));var _0x553b=function(_0xbfa73d,_0x2d969d){_0xbfa73d=_0xbfa73d-0x0;var _0x5e5550=_0x53b5[_0xbfa73d];return _0x5e5550;};'use strict';var multer=require('multer');var util=require(_0x553b('0x0'));var path=require(_0x553b('0x1'));var timeout=require('connect-timeout');var express=require(_0x553b('0x2'));var router=express['Router']();var fs_extra=require(_0x553b('0x3'));var auth=require(_0x553b('0x4'));var interaction=require(_0x553b('0x5'));var config=require('../../config/environment');var controller=require(_0x553b('0x6'));router[_0x553b('0x7')]('/:id',auth[_0x553b('0x8')](),controller['show']);router['put'](_0x553b('0x9'),auth[_0x553b('0x8')](),controller['update']);router['delete']('/:id',auth[_0x553b('0x8')](),controller[_0x553b('0xa')]);module[_0x553b('0xb')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 3b28c29..53137e8 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 _0x4abd=['*,*,*,*','INTEGER','noop','TEXT','STRING'];(function(_0x259cdb,_0x3696ff){var _0x102792=function(_0x59aa1e){while(--_0x59aa1e){_0x259cdb['push'](_0x259cdb['shift']());}};_0x102792(++_0x3696ff);}(_0x4abd,0x1b9));var _0xd4ab=function(_0x867b0a,_0x587ccf){_0x867b0a=_0x867b0a-0x0;var _0x137438=_0x4abd[_0x867b0a];return _0x137438;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xd4ab('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd4ab('0x1')},'appdata':{'type':Sequelize[_0xd4ab('0x2')]()},'description':{'type':Sequelize[_0xd4ab('0x3')]},'interval':{'type':Sequelize[_0xd4ab('0x3')],'defaultValue':_0xd4ab('0x4')}}; \ No newline at end of file +var _0xf74a=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x3d09ba,_0x3c3623){var _0x4b7ed0=function(_0x437b00){while(--_0x437b00){_0x3d09ba['push'](_0x3d09ba['shift']());}};_0x4b7ed0(++_0x3c3623);}(_0xf74a,0xe4));var _0xaf74=function(_0x296194,_0x5d8e5c){_0x296194=_0x296194-0x0;var _0x5718b9=_0xf74a[_0x296194];return _0x5718b9;};'use strict';var Sequelize=require(_0xaf74('0x0'));module[_0xaf74('0x1')]={'priority':{'type':Sequelize[_0xaf74('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaf74('0x3')],'allowNull':![],'defaultValue':_0xaf74('0x4')},'appdata':{'type':Sequelize[_0xaf74('0x5')]()},'description':{'type':Sequelize[_0xaf74('0x3')]},'interval':{'type':Sequelize[_0xaf74('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 10dff37..f7be462 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 _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2ba00c,_0x182642){var _0x21712b=function(_0x1bcf8e){while(--_0x1bcf8e){_0x2ba00c['push'](_0x2ba00c['shift']());}};_0x21712b(++_0x182642);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3d8943,_0x52db79){_0x3d8943=_0x3d8943-0x0;var _0x16f198=_0x9bde[_0x3d8943];return _0x16f198;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file +var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x4fba61,_0x58958a){var _0x3d6bf8=function(_0x2ab8c5){while(--_0x2ab8c5){_0x4fba61['push'](_0x4fba61['shift']());}};_0x3d6bf8(++_0x58958a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4ba9be,_0x41b900){_0x4ba9be=_0x4ba9be-0x0;var _0x49beb7=_0xb43b[_0x4ba9be];return _0x49beb7;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 96007db..9c1d848 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 _0xddee=['utf8mb4_unicode_ci','lodash','../../config/logger','api','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x3fca00,_0x419dab){var _0x490b9b=function(_0x3dffa1){while(--_0x3dffa1){_0x3fca00['push'](_0x3fca00['shift']());}};_0x490b9b(++_0x419dab);}(_0xddee,0x140));var _0xedde=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xddee[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0xedde('0x0'));var util=require('util');var logger=require(_0xedde('0x1'))(_0xedde('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xedde('0x3'));var attributes=require(_0xedde('0x4'));module[_0xedde('0x5')]=function(_0x2c68ce,_0x2daa11){return _0x2c68ce[_0xedde('0x6')](_0xedde('0x7'),attributes,{'tableName':_0xedde('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xedde('0x9'),'collate':_0xedde('0xa')});}; \ No newline at end of file +var _0x2c7d=['./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x23e21e,_0x203589){var _0x131a11=function(_0x436eef){while(--_0x436eef){_0x23e21e['push'](_0x23e21e['shift']());}};_0x131a11(++_0x203589);}(_0x2c7d,0xae));var _0xd2c7=function(_0x30234f,_0x45fd9e){_0x30234f=_0x30234f-0x0;var _0x17f8c9=_0x2c7d[_0x30234f];return _0x17f8c9;};'use strict';var _=require(_0xd2c7('0x0'));var util=require('util');var logger=require(_0xd2c7('0x1'))(_0xd2c7('0x2'));var moment=require(_0xd2c7('0x3'));var BPromise=require(_0xd2c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd2c7('0x5'));var rimraf=require(_0xd2c7('0x6'));var config=require(_0xd2c7('0x7'));var attributes=require(_0xd2c7('0x8'));module[_0xd2c7('0x9')]=function(_0x3dd644,_0x371c11){return _0x3dd644[_0xd2c7('0xa')](_0xd2c7('0xb'),attributes,{'tableName':_0xd2c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd2c7('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 91607ce..ad97b11 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 _0x99d0=['then','UpdateMailApplication','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailApplication','update','body','options','raw','where','attributes','limit'];(function(_0x4a17dc,_0x166b25){var _0x45378f=function(_0x528c15){while(--_0x528c15){_0x4a17dc['push'](_0x4a17dc['shift']());}};_0x45378f(++_0x166b25);}(_0x99d0,0xa8));var _0x099d=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x99d0[_0x46f1a6];return _0x38429a;};'use strict';var _=require('lodash');var util=require(_0x099d('0x0'));var moment=require(_0x099d('0x1'));var BPromise=require(_0x099d('0x2'));var rs=require(_0x099d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x099d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x099d('0x5'))(_0x099d('0x6'));var config=require(_0x099d('0x7'));var jayson=require(_0x099d('0x8'));var client=jayson[_0x099d('0x9')][_0x099d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa27faa,_0x56e03c,_0x4c1f72){return new BPromise(function(_0x1be530,_0x5da27a){return client[_0x099d('0xb')](_0xa27faa,_0x4c1f72)['then'](function(_0x258b6c){logger[_0x099d('0xc')](_0x099d('0xd'),_0x56e03c,_0x099d('0xe'));logger[_0x099d('0xf')](_0x099d('0x10'),_0x56e03c,_0x099d('0xe'),JSON['stringify'](_0x258b6c));if(_0x258b6c[_0x099d('0x11')]){if(_0x258b6c[_0x099d('0x11')][_0x099d('0x12')]===0x1f4){logger['error'](_0x099d('0xd'),_0x56e03c,_0x258b6c[_0x099d('0x11')][_0x099d('0x13')]);return _0x5da27a(_0x258b6c[_0x099d('0x11')][_0x099d('0x13')]);}logger[_0x099d('0x11')](_0x099d('0xd'),_0x56e03c,_0x258b6c[_0x099d('0x11')]['message']);return _0x1be530(_0x258b6c[_0x099d('0x11')][_0x099d('0x13')]);}else{logger[_0x099d('0xc')](_0x099d('0xd'),_0x56e03c,'request\x20sent');_0x1be530(_0x258b6c[_0x099d('0x14')][_0x099d('0x13')]);}})[_0x099d('0x15')](function(_0x19ed78){logger['error'](_0x099d('0xd'),_0x56e03c,_0x19ed78);_0x5da27a(_0x19ed78);});});}exports['UpdateMailApplication']=function(_0xb6635c){var _0x17a36f=this;return new Promise(function(_0x29f7b3,_0x51336b){return db[_0x099d('0x16')][_0x099d('0x17')](_0xb6635c[_0x099d('0x18')],{'raw':_0xb6635c[_0x099d('0x19')]?_0xb6635c[_0x099d('0x19')][_0x099d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb6635c['options']?_0xb6635c[_0x099d('0x19')][_0x099d('0x1b')]||null:null,'attributes':_0xb6635c[_0x099d('0x19')]?_0xb6635c[_0x099d('0x19')][_0x099d('0x1c')]||null:null,'limit':_0xb6635c[_0x099d('0x19')]?_0xb6635c[_0x099d('0x19')][_0x099d('0x1d')]||null:null})[_0x099d('0x1e')](function(_0x1ea695){logger['info']('UpdateMailApplication',_0xb6635c);logger[_0x099d('0xf')](_0x099d('0x1f'),_0xb6635c,JSON[_0x099d('0x20')](_0x1ea695));_0x29f7b3(_0x1ea695);})[_0x099d('0x15')](function(_0x3888ea){logger[_0x099d('0x11')](_0x099d('0x1f'),_0x3888ea[_0x099d('0x13')],_0xb6635c);_0x51336b(_0x17a36f[_0x099d('0x11')](0x1f4,_0x3888ea[_0x099d('0x13')]));});});}; \ No newline at end of file +var _0xea77=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailApplication','update','body','options','raw','attributes','limit','UpdateMailApplication','lodash'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xea77,0xd1));var _0x7ea7=function(_0x17dcd5,_0x5c5b24){_0x17dcd5=_0x17dcd5-0x0;var _0x214160=_0xea77[_0x17dcd5];return _0x214160;};'use strict';var _=require(_0x7ea7('0x0'));var util=require(_0x7ea7('0x1'));var moment=require(_0x7ea7('0x2'));var BPromise=require(_0x7ea7('0x3'));var rs=require(_0x7ea7('0x4'));var fs=require('fs');var Redis=require(_0x7ea7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ea7('0x6'));var logger=require(_0x7ea7('0x7'))(_0x7ea7('0x8'));var config=require(_0x7ea7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe2abbf,_0x44fe0d,_0x507eca){return new BPromise(function(_0x3acc96,_0x202d64){return client[_0x7ea7('0xa')](_0xe2abbf,_0x507eca)[_0x7ea7('0xb')](function(_0x3aa93e){logger[_0x7ea7('0xc')](_0x7ea7('0xd'),_0x44fe0d,_0x7ea7('0xe'));logger[_0x7ea7('0xf')](_0x7ea7('0x10'),_0x44fe0d,_0x7ea7('0xe'),JSON[_0x7ea7('0x11')](_0x3aa93e));if(_0x3aa93e[_0x7ea7('0x12')]){if(_0x3aa93e[_0x7ea7('0x12')]['code']===0x1f4){logger[_0x7ea7('0x12')](_0x7ea7('0xd'),_0x44fe0d,_0x3aa93e[_0x7ea7('0x12')][_0x7ea7('0x13')]);return _0x202d64(_0x3aa93e[_0x7ea7('0x12')][_0x7ea7('0x13')]);}logger[_0x7ea7('0x12')](_0x7ea7('0xd'),_0x44fe0d,_0x3aa93e[_0x7ea7('0x12')]['message']);return _0x3acc96(_0x3aa93e[_0x7ea7('0x12')][_0x7ea7('0x13')]);}else{logger['info'](_0x7ea7('0xd'),_0x44fe0d,_0x7ea7('0xe'));_0x3acc96(_0x3aa93e[_0x7ea7('0x14')][_0x7ea7('0x13')]);}})[_0x7ea7('0x15')](function(_0x52a8df){logger[_0x7ea7('0x12')](_0x7ea7('0xd'),_0x44fe0d,_0x52a8df);_0x202d64(_0x52a8df);});});}exports['UpdateMailApplication']=function(_0x555194){var _0x56f9ac=this;return new Promise(function(_0x16ff76,_0x4ad014){return db[_0x7ea7('0x16')][_0x7ea7('0x17')](_0x555194[_0x7ea7('0x18')],{'raw':_0x555194[_0x7ea7('0x19')]?_0x555194[_0x7ea7('0x19')][_0x7ea7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x555194[_0x7ea7('0x19')]?_0x555194[_0x7ea7('0x19')]['where']||null:null,'attributes':_0x555194[_0x7ea7('0x19')]?_0x555194['options'][_0x7ea7('0x1b')]||null:null,'limit':_0x555194[_0x7ea7('0x19')]?_0x555194[_0x7ea7('0x19')][_0x7ea7('0x1c')]||null:null})[_0x7ea7('0xb')](function(_0x2f6143){logger[_0x7ea7('0xc')](_0x7ea7('0x1d'),_0x555194);logger[_0x7ea7('0xf')](_0x7ea7('0x1d'),_0x555194,JSON['stringify'](_0x2f6143));_0x16ff76(_0x2f6143);})['catch'](function(_0x118f4a){logger[_0x7ea7('0x12')](_0x7ea7('0x1d'),_0x118f4a[_0x7ea7('0x13')],_0x555194);_0x4ad014(_0x56f9ac[_0x7ea7('0x12')](0x1f4,_0x118f4a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index a598fd7..36298a6 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 _0xe0f4=['removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','/:id','show','getMessages','/:id/download','create','post','/:id/messages','addMessage','mailinteraction:addtags','addTags','tracked','update','delete','mail','mailinteraction:destroy','destroy','/:id/tags'];(function(_0x5d0fde,_0x44010f){var _0x513570=function(_0x575a5f){while(--_0x575a5f){_0x5d0fde['push'](_0x5d0fde['shift']());}};_0x513570(++_0x44010f);}(_0xe0f4,0x12d));var _0x4e0f=function(_0x172a35,_0xccb010){_0x172a35=_0x172a35-0x0;var _0x18dad8=_0xe0f4[_0x172a35];return _0x18dad8;};'use strict';var express=require('express');var router=express[_0x4e0f('0x0')]();var auth=require(_0x4e0f('0x1'));var interaction=require(_0x4e0f('0x2'));var controller=require(_0x4e0f('0x3'));router[_0x4e0f('0x4')]('/',auth[_0x4e0f('0x5')](),controller['index']);router[_0x4e0f('0x4')](_0x4e0f('0x6'),auth[_0x4e0f('0x5')](),controller['describe']);router[_0x4e0f('0x4')](_0x4e0f('0x7'),auth[_0x4e0f('0x5')](),controller[_0x4e0f('0x8')]);router[_0x4e0f('0x4')]('/:id/messages',auth[_0x4e0f('0x5')](),controller[_0x4e0f('0x9')]);router[_0x4e0f('0x4')](_0x4e0f('0xa'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x4e0f('0x5')](),controller[_0x4e0f('0xb')]);router[_0x4e0f('0xc')](_0x4e0f('0xd'),auth[_0x4e0f('0x5')](),controller[_0x4e0f('0xe')]);router[_0x4e0f('0xc')]('/:id/tags',auth[_0x4e0f('0x5')](),interaction['tracked']('mail',_0x4e0f('0xf')),controller[_0x4e0f('0x10')]);router['put']('/:id',auth[_0x4e0f('0x5')](),interaction[_0x4e0f('0x11')]('mail','mailinteraction:update'),controller[_0x4e0f('0x12')]);router[_0x4e0f('0x13')](_0x4e0f('0x7'),auth[_0x4e0f('0x5')](),interaction[_0x4e0f('0x11')](_0x4e0f('0x14'),_0x4e0f('0x15')),controller[_0x4e0f('0x16')]);router['delete'](_0x4e0f('0x17'),auth['isAuthenticated'](),controller[_0x4e0f('0x18')]);module['exports']=router; \ No newline at end of file +var _0x6bff=['index','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','mailinteraction:destroy','destroy','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bff,0x90));var _0xf6bf=function(_0xbcf119,_0x3ef7de){_0xbcf119=_0xbcf119-0x0;var _0x799fb3=_0x6bff[_0xbcf119];return _0x799fb3;};'use strict';var express=require(_0xf6bf('0x0'));var router=express[_0xf6bf('0x1')]();var auth=require(_0xf6bf('0x2'));var interaction=require(_0xf6bf('0x3'));var controller=require('./mailInteraction.controller');router[_0xf6bf('0x4')]('/',auth[_0xf6bf('0x5')](),controller[_0xf6bf('0x6')]);router['get']('/describe',auth[_0xf6bf('0x5')](),controller[_0xf6bf('0x7')]);router[_0xf6bf('0x4')](_0xf6bf('0x8'),auth[_0xf6bf('0x5')](),controller[_0xf6bf('0x9')]);router[_0xf6bf('0x4')](_0xf6bf('0xa'),auth['isAuthenticated'](),controller[_0xf6bf('0xb')]);router[_0xf6bf('0x4')]('/:id/download',auth[_0xf6bf('0x5')](),controller[_0xf6bf('0xc')]);router[_0xf6bf('0xd')]('/',auth[_0xf6bf('0x5')](),controller['create']);router[_0xf6bf('0xd')](_0xf6bf('0xa'),auth[_0xf6bf('0x5')](),controller[_0xf6bf('0xe')]);router[_0xf6bf('0xd')](_0xf6bf('0xf'),auth['isAuthenticated'](),interaction[_0xf6bf('0x10')](_0xf6bf('0x11'),_0xf6bf('0x12')),controller[_0xf6bf('0x13')]);router[_0xf6bf('0x14')](_0xf6bf('0x8'),auth[_0xf6bf('0x5')](),interaction['tracked'](_0xf6bf('0x11'),'mailinteraction:update'),controller[_0xf6bf('0x15')]);router[_0xf6bf('0x16')](_0xf6bf('0x8'),auth['isAuthenticated'](),interaction[_0xf6bf('0x10')](_0xf6bf('0x11'),_0xf6bf('0x17')),controller[_0xf6bf('0x18')]);router['delete'](_0xf6bf('0xf'),auth['isAuthenticated'](),controller['removeTags']);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 fa9d169..33d91f6 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 _0x3e67=['out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x3e67,0x88));var _0x73e6=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x3e67[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x73e6('0x0'));var iconv=require(_0x73e6('0x1'));module[_0x73e6('0x2')]={'closed':{'type':Sequelize[_0x73e6('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x73e6('0x4')]},'disposition':{'type':Sequelize[_0x73e6('0x5')]},'secondDisposition':{'type':Sequelize[_0x73e6('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x73e6('0x5')]},'inReplyTo':{'type':Sequelize[_0x73e6('0x5')](0x1fe)},'to':{'type':Sequelize[_0x73e6('0x5')]},'cc':{'type':Sequelize[_0x73e6('0x6')]('long')},'subject':{'type':Sequelize[_0x73e6('0x6')]()},'attach':{'type':Sequelize[_0x73e6('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x73e6('0x4')]},'substatus':{'type':Sequelize[_0x73e6('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x73e6('0x7')]('in',_0x73e6('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x73e6('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x73e6('0x7')]('in',_0x73e6('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x73e6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9ff0=['out','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x9ff0,0x1c1));var _0x09ff=function(_0x2f76bd,_0x4e419c){_0x2f76bd=_0x2f76bd-0x0;var _0x1bdcb3=_0x9ff0[_0x2f76bd];return _0x1bdcb3;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x09ff('0x0'));module[_0x09ff('0x1')]={'closed':{'type':Sequelize[_0x09ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x09ff('0x3')]},'disposition':{'type':Sequelize[_0x09ff('0x4')]},'secondDisposition':{'type':Sequelize[_0x09ff('0x4')]},'thirdDisposition':{'type':Sequelize[_0x09ff('0x4')]},'note':{'type':Sequelize[_0x09ff('0x4')]},'inReplyTo':{'type':Sequelize[_0x09ff('0x4')](0x1fe)},'to':{'type':Sequelize[_0x09ff('0x4')]},'cc':{'type':Sequelize[_0x09ff('0x5')](_0x09ff('0x6'))},'subject':{'type':Sequelize[_0x09ff('0x5')]()},'attach':{'type':Sequelize[_0x09ff('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x09ff('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x09ff('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x09ff('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x09ff('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x09ff('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x09ff('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 5bd0394..7185d21 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 _0xa9e0=['Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','show','includeAll','include','create','body','params','describe','addMessage','ids','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','rows','addTags','setTags','spread','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','attachments','Attachment','Attachments','bcc','subject','Messages','get','mkdirSync','each','format','headers','Bcc','basename','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','talking','unmanaged','total','closed','UserId','index','map','MailInteraction','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','Contact.email'];(function(_0x3074f1,_0x4901aa){var _0x149af8=function(_0x122725){while(--_0x122725){_0x3074f1['push'](_0x3074f1['shift']());}};_0x149af8(++_0x4901aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){return getStateInteraction(_0x66c1d2);})[_0x0a9e('0x1a')](function(_0x40cb85){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x40cb85));}else{_0x3ae878(_0x40cb85);}})[_0x0a9e('0x30')](function(_0x2b45ea){_0x1122db(_0x2b45ea);});});}function getStateInteraction(_0x409319){return new BPromise(function(_0x332d35,_0x39e565){_0x409319['waiting']=0x0;_0x409319[_0x0a9e('0x31')]=0x0;_0x409319['answered']=0x0;_0x409319[_0x0a9e('0x32')]=0x0;_0x409319[_0x0a9e('0x33')]=0x0;if(!_0x409319[_0x0a9e('0x34')]&&!_0x409319[_0x0a9e('0x35')])_0x409319['waiting']+=0x1;if(!_0x409319[_0x0a9e('0x34')]&&_0x409319[_0x0a9e('0x35')])_0x409319[_0x0a9e('0x31')]+=0x1;if(_0x409319[_0x0a9e('0x34')]&&_0x409319['UserId'])_0x409319['answered']+=0x1;if(_0x409319[_0x0a9e('0x34')]&&!_0x409319['UserId'])_0x409319[_0x0a9e('0x32')]+=0x1;_0x409319[_0x0a9e('0x33')]+=0x1;_0x332d35(_0x409319);});}exports[_0x0a9e('0x36')]=function(_0x1ef87a,_0x4f41ae){var _0x31916f={},_0x3bfce8={},_0x3cae={'count':0x0,'rows':[]};var _0x533942=_[_0x0a9e('0x37')](db[_0x0a9e('0x38')][_0x0a9e('0x39')],function(_0x4c1c0e){return{'name':_0x4c1c0e['fieldName'],'type':_0x4c1c0e[_0x0a9e('0x3a')][_0x0a9e('0x3b')]};});_0x3bfce8['model']=_[_0x0a9e('0x37')](_0x533942,_0x0a9e('0x20'));_0x3bfce8[_0x0a9e('0x3c')]=_[_0x0a9e('0x3d')](_0x1ef87a['query']);_0x3bfce8['filters']=_[_0x0a9e('0x3e')](_0x3bfce8[_0x0a9e('0x3f')],_0x3bfce8['query']);_0x31916f[_0x0a9e('0x40')]=_[_0x0a9e('0x3e')](_0x3bfce8[_0x0a9e('0x3f')],qs['fields'](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x41')]));_0x31916f[_0x0a9e('0x40')]=_0x31916f[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x31916f[_0x0a9e('0x40')]:_0x3bfce8[_0x0a9e('0x3f')];if(!_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x31916f[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x15')]);_0x31916f[_0x0a9e('0x13')]=qs['offset'](_0x1ef87a['query'][_0x0a9e('0x13')]);}_0x31916f[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x46')]);_0x31916f[_0x0a9e('0x47')]=qs[_0x0a9e('0x48')](_[_0x0a9e('0x49')](_0x1ef87a[_0x0a9e('0x3c')],_0x3bfce8[_0x0a9e('0x48')]),_0x533942);var _0x2c2cb0=[];var _0x35ed4a=squel['select']()[_0x0a9e('0x4a')]('id')[_0x0a9e('0x4a')](_0x0a9e('0x20'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'))[_0x0a9e('0x4c')](_0x0a9e('0x4d'));var _0x44dd99=squel['select']()[_0x0a9e('0x4a')]('u.id')[_0x0a9e('0x4a')](_0x0a9e('0x4e'))[_0x0a9e('0x4a')]('ui.MailInteractionId')[_0x0a9e('0x4c')](_0x0a9e('0x4f'),'ui')[_0x0a9e('0x50')](_0x0a9e('0x51'),'u',_0x0a9e('0x52'));var _0x37be73=squel[_0x0a9e('0x53')]()['from'](_0x0a9e('0x54'),'i')[_0x0a9e('0x50')](_0x0a9e('0x55'),'c',_0x0a9e('0x56'))[_0x0a9e('0x50')](_0x0a9e('0x51'),'o',_0x0a9e('0x57'))[_0x0a9e('0x50')](_0x0a9e('0x58'),'a','a.id\x20=\x20i.MailAccountId')[_0x0a9e('0x50')](_0x0a9e('0x59'),'me','me.MailInteractionId\x20=\x20i.id')['left_join']('mail_interaction_has_tags','it',_0x0a9e('0x5a'))[_0x0a9e('0x50')](_0x0a9e('0x4d'),'t',_0x0a9e('0x5b'));var _0x61bb17=squel[_0x0a9e('0x5c')]();var _0x2e5165=[];var _0x375c18=squel['expr']();var _0x4b1b9f;if(_0x1ef87a['query'][_0x0a9e('0x5d')]){_0x4b1b9f=as[_0x0a9e('0x5e')](_0x1ef87a[_0x0a9e('0x3c')]['search']);var _0x2b69d9=_0x4b1b9f[_0x0a9e('0x5f')];for(var _0x53d113=0x0;_0x53d113<_0x4b1b9f['conditions'][_0x0a9e('0x42')];_0x53d113++){var _0x59c6ff=_0x4b1b9f[_0x0a9e('0x60')][_0x53d113];var _0x4c3845='i';var _0x2e5e62=_[_0x0a9e('0x61')](_0x533942,[_0x0a9e('0x20'),_0x59c6ff['field']]);if(!_0x2e5e62){switch(_0x59c6ff[_0x0a9e('0x4a')]){case _0x0a9e('0x62'):if(_0x59c6ff['value']==0x1){_0x37be73['having']('`'+_0x59c6ff[_0x0a9e('0x4a')]+_0x0a9e('0x63'));}else{_0x37be73['having']('`'+_0x59c6ff[_0x0a9e('0x4a')]+'`\x20>\x200');}break;case _0x0a9e('0x64'):if(_0x59c6ff['operator']===_0x0a9e('0x65')){if(_0x59c6ff['value']['split']('\x20')['length']>0x1){_0x61bb17[_0x2b69d9](_0x0a9e('0x66'),qs['getFullTextValue'](_0x59c6ff[_0x0a9e('0x67')]),null);}else{var _0x65432='%'+_0x59c6ff[_0x0a9e('0x67')]+'%';_0x61bb17[_0x2b69d9](_0x0a9e('0x68'),_0x65432,_0x65432,_0x65432);}}else{_0x2e5e62=_[_0x0a9e('0x61')](_0x533942,[_0x0a9e('0x20'),_0x0a9e('0x69')]);_0x59c6ff[_0x0a9e('0x4a')]='ContactId';_0x88dcbf=as[_0x0a9e('0x6a')](_0x4c3845,_0x2e5e62[_0x0a9e('0x3a')],_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf[_0x0a9e('0x6b')],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x6c')],_0x88dcbf[_0x0a9e('0x67')]['end']);}break;case _0x0a9e('0x6d'):var _0x26bc80=_0x59c6ff['value'][_0x0a9e('0x25')](',')['map'](function(_0x20c668){return Number(_0x20c668);});_0x26bc80['forEach'](function(_0x4b3c1a){_0x375c18['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4b3c1a+',%');});_0x2e5165=_[_0x0a9e('0x6e')](_0x2e5165,_0x26bc80);break;case'User':if(_0x59c6ff[_0x0a9e('0x6f')]===_0x0a9e('0x65')){_0x61bb17[_0x2b69d9](_0x0a9e('0x70'),'%'+_0x59c6ff[_0x0a9e('0x67')]+'%',null);}else{_0x2e5e62=_[_0x0a9e('0x61')](_0x533942,[_0x0a9e('0x20'),'UserId']);_0x59c6ff[_0x0a9e('0x4a')]='UserId';_0x88dcbf=as[_0x0a9e('0x6a')](_0x4c3845,_0x2e5e62[_0x0a9e('0x3a')],_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf[_0x0a9e('0x6b')],_0x88dcbf['value'][_0x0a9e('0x6c')],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x1c')]);}break;case _0x0a9e('0x2d'):_0x88dcbf=as['buildExpression']('me',null,_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf[_0x0a9e('0x6b')],_0x88dcbf[_0x0a9e('0x67')]['start'],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x1c')]);break;}}else{var _0x88dcbf=as[_0x0a9e('0x6a')](_0x4c3845,_0x2e5e62[_0x0a9e('0x3a')],_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf['text'],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x6c')],_0x88dcbf[_0x0a9e('0x67')]['end']);}}}else{var _0x3528b7=_(_0x1ef87a['query'])['keys']()[_0x0a9e('0x37')](function(_0x4556c5){return _[_0x0a9e('0x71')](_0x533942,[_0x0a9e('0x20'),_0x4556c5])?_0x4556c5:undefined;})[_0x0a9e('0x72')]()[_0x0a9e('0x67')]();if(!_[_0x0a9e('0x73')](_0x3528b7)){_0x3528b7[_0x0a9e('0x26')](function(_0x2d7205){if(_0x2d7205===_0x0a9e('0x74')){_0x37be73[_0x0a9e('0x47')](_0x0a9e('0x75'),[][_0x0a9e('0x76')](_0x1ef87a[_0x0a9e('0x3c')][_0x2d7205]));}else if(_0x2d7205===_0x0a9e('0x77')){var _0x412a72=JSON[_0x0a9e('0x78')](_0x1ef87a[_0x0a9e('0x3c')][_0x2d7205])['$gte'];var _0x1b0b98=JSON[_0x0a9e('0x78')](_0x1ef87a[_0x0a9e('0x3c')][_0x2d7205])['$lte'];_0x37be73[_0x0a9e('0x47')](_0x0a9e('0x79'),_0x412a72,_0x1b0b98);}else{if(_0x1ef87a['query'][_0x2d7205]===_0x0a9e('0x7a')){_0x37be73[_0x0a9e('0x47')]('i.'+_0x2d7205+_0x0a9e('0x7b'));}else{_0x37be73[_0x0a9e('0x47')]('i.'+_0x2d7205+_0x0a9e('0x7c'),_0x1ef87a['query'][_0x2d7205]);}}});}if(_0x1ef87a['query']['read']){if(_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x7d')]==0x1){_0x37be73[_0x0a9e('0x7e')](_0x0a9e('0x7f'));}else{_0x37be73[_0x0a9e('0x7e')](_0x0a9e('0x80'));}}if(_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x81')]){_0x2e5165=_['isArray'](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x81')])?_0x1ef87a[_0x0a9e('0x3c')]['tag']:new Array(_0x1ef87a[_0x0a9e('0x3c')]['tag']);_0x2e5165[_0x0a9e('0x26')](function(_0x44351d){_0x375c18['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x44351d+',%');});}if(_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x82')]){var _0x2cc7a7=_0x1ef87a[_0x0a9e('0x3c')]['filter'][_0x0a9e('0x83')]('\x5c','\x5c\x5c')[_0x0a9e('0x83')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x84')](_0x2cc7a7)){_0x61bb17['or'](_0x0a9e('0x85'),_0x2cc7a7+'%');}else if(qs['isEmail'](_0x2cc7a7)){_0x61bb17['or'](_0x0a9e('0x86'),_0x2cc7a7+'%');}else{_0x61bb17['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x2cc7a7))['or'](_0x0a9e('0x89'),qs['getFullTextValue'](_0x2cc7a7));}}}_0x37be73[_0x0a9e('0x47')](_0x61bb17);_0x37be73[_0x0a9e('0x8a')](_0x0a9e('0x8b'));var _0xf410e5={'type':db[_0x0a9e('0x8c')][_0x0a9e('0x8d')][_0x0a9e('0x8e')],'raw':!![]};var _0x3df0e3=_0x37be73[_0x0a9e('0x8f')]();_0x3df0e3[_0x0a9e('0x4a')](_0x0a9e('0x8b'));_0x3df0e3[_0x0a9e('0x4a')](_0x0a9e('0x90'),_0x0a9e('0x62'));if(_0x31916f['order']){_0x31916f[_0x0a9e('0x45')][_0x0a9e('0x26')](function(_0xc599b3){var _0x563627=_0xc599b3[0x0]===_0x0a9e('0x91')?_0xc599b3[0x0]:'i.'+_0xc599b3[0x0];_0x37be73[_0x0a9e('0x45')](_0x563627,_0xc599b3[0x1]===_0x0a9e('0x92')?![]:!![]);});}if(!_[_0x0a9e('0x73')](_0x2e5165)){_0x37be73['having'](_0x375c18);_0x3df0e3['where'](_0x0a9e('0x93'),_0x2e5165);}BPromise[_0x0a9e('0x94')]()['then'](function(){if(!_0x4b1b9f){if(_0x1ef87a[_0x0a9e('0x3c')]['MailAccountId'])return;_0x3df0e3[_0x0a9e('0x47')](_0x0a9e('0x95'));_0x37be73['where'](_0x0a9e('0x95'));return;}if(_0x1ef87a[_0x0a9e('0x96')][_0x0a9e('0x97')]!==_0x0a9e('0x98'))return;return _0x1ef87a[_0x0a9e('0x96')][_0x0a9e('0x99')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0x482ca2){if(_[_0x0a9e('0x73')](_0x482ca2)){_0x3df0e3[_0x0a9e('0x47')](_0x0a9e('0x9a'));_0x37be73[_0x0a9e('0x47')]('i.MailAccountId\x20IS\x20NULL');}else{_0x3df0e3[_0x0a9e('0x47')](_0x0a9e('0x75'),_['map'](_0x482ca2,'id'));_0x37be73[_0x0a9e('0x47')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0x482ca2,'id'));}});})[_0x0a9e('0x1a')](function(){if(_0x1ef87a[_0x0a9e('0x96')][_0x0a9e('0x97')]==='agent'&&!_0x4b1b9f&&!_0x1ef87a['query'][_0x0a9e('0x74')])return[];return db[_0x0a9e('0x9b')][_0x0a9e('0x3c')](_0x3df0e3['toString'](),_0xf410e5);})[_0x0a9e('0x1a')](function(_0x36e975){_0x3cae['count']=_0x36e975['length'];if(_0x3cae[_0x0a9e('0x16')]===0x0)return[];return db['sequelize']['query'](_0x35ed4a['toString'](),_0xf410e5)[_0x0a9e('0x1a')](function(_0xf3601c){_0x2c2cb0=_[_0x0a9e('0x9c')](_0xf3601c,'id');_0xf410e5=_[_0x0a9e('0x9d')](_0xf410e5,{'model':db[_0x0a9e('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ef87a[_0x0a9e('0x3c')]['fields']){_0x31916f[_0x0a9e('0x40')]['forEach'](function(_0x2871c1){_0x37be73[_0x0a9e('0x4a')]('i.'+_0x2871c1);});}else{_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0x90'),'unreadMessages');_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x37be73['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa2'),_0x0a9e('0x91'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0x8b'));_0x37be73[_0x0a9e('0x4a')]('i.createdAt');_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa3'));_0x37be73['field'](_0x0a9e('0xa4'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa5'));_0x37be73['field'](_0x0a9e('0xa6'));_0x37be73['field'](_0x0a9e('0xa7'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa8'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa9'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xaa'));_0x37be73[_0x0a9e('0x4a')]('i.secondDisposition');_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xab'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xac'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xad'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xae'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xaf'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xb0'));_0x37be73[_0x0a9e('0x4a')]('c.firstName',_0x0a9e('0xb1'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xb2'),_0x0a9e('0xb3'));_0x37be73[_0x0a9e('0x4a')]('c.email',_0x0a9e('0xb4'));_0x37be73[_0x0a9e('0x4a')]('c.phone',_0x0a9e('0xb5'));_0x37be73['field'](_0x0a9e('0xb6'),_0x0a9e('0xb7'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xb8'),'Contact.fax');_0x37be73[_0x0a9e('0x4a')]('o.fullname',_0x0a9e('0xb9'));_0x37be73[_0x0a9e('0x4a')]('o.internal',_0x0a9e('0xba'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xbb'),'TagIds');}if(_0x31916f['limit'])_0x37be73[_0x0a9e('0x15')](_0x31916f[_0x0a9e('0x15')]);if(_0x31916f[_0x0a9e('0x13')])_0x37be73[_0x0a9e('0x13')](_0x31916f[_0x0a9e('0x13')]);return db[_0x0a9e('0x9b')][_0x0a9e('0x3c')](_0x37be73[_0x0a9e('0xbc')](),_0xf410e5);})[_0x0a9e('0x1a')](function(_0x586510){if(_0x586510[_0x0a9e('0x42')]>0x0)_0x44dd99['where'](_0x0a9e('0xbd'),_[_0x0a9e('0x37')](_0x586510,'id'));return db[_0x0a9e('0x9b')][_0x0a9e('0x3c')](_0x44dd99[_0x0a9e('0xbc')](),_0xf410e5)['then'](function(_0x436313){var _0x4667bf=_[_0x0a9e('0xbe')](_0x436313,_0x0a9e('0xbf'));var _0x2263f1=[];return db['Setting']['findOne']({'attributes':[_0x0a9e('0xc0')],'raw':!![]})['then'](function(_0x25eae0){var _0x4658df=_0x25eae0[_0x0a9e('0xc0')];_0x586510[_0x0a9e('0x26')](function(_0x2ad54b){_0x2263f1[_0x0a9e('0x27')](updateMailInteraction(_0x2ad54b,_0x2c2cb0,_0x4667bf,_0x4658df));});return BPromise['all'](_0x2263f1);});});});})['then'](function(_0x1889ed){_0x3cae['rows']=_0x1889ed;return _0x3cae;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x4f41ae,_0x31916f))['catch'](handleError(_0x4f41ae,null));};exports[_0x0a9e('0xc1')]=function(_0x564db2,_0x558d60){var _0x1c49dc={'raw':![],'where':{'id':_0x564db2['params']['id']}},_0xb8db59={};_0xb8db59[_0x0a9e('0x3f')]=_[_0x0a9e('0x3d')](db[_0x0a9e('0x38')][_0x0a9e('0x39')]);_0xb8db59[_0x0a9e('0x3c')]=_['keys'](_0x564db2['query']);_0xb8db59[_0x0a9e('0x48')]=_[_0x0a9e('0x3e')](_0xb8db59[_0x0a9e('0x3f')],_0xb8db59[_0x0a9e('0x3c')]);_0x1c49dc[_0x0a9e('0x40')]=_['intersection'](_0xb8db59[_0x0a9e('0x3f')],qs[_0x0a9e('0x41')](_0x564db2['query'][_0x0a9e('0x41')]));_0x1c49dc[_0x0a9e('0x40')]=_0x1c49dc[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1c49dc[_0x0a9e('0x40')]:_0xb8db59[_0x0a9e('0x3f')];if(_0x564db2[_0x0a9e('0x3c')][_0x0a9e('0xc2')]){_0x1c49dc[_0x0a9e('0xc3')]=[{'all':!![]}];}_0x1c49dc=_[_0x0a9e('0x9d')]({},_0x1c49dc,_0x564db2['options']);return db[_0x0a9e('0x38')][_0x0a9e('0x61')](_0x1c49dc)[_0x0a9e('0x1a')](handleEntityNotFound(_0x558d60,null))[_0x0a9e('0x1a')](respondWithResult(_0x558d60,null))[_0x0a9e('0x30')](handleError(_0x558d60,null));};exports['create']=function(_0x500868,_0x21902c){return db[_0x0a9e('0x38')][_0x0a9e('0xc4')](_0x500868[_0x0a9e('0xc5')],{})[_0x0a9e('0x1a')](respondWithResult(_0x21902c,0xc9))['catch'](handleError(_0x21902c,null));};exports[_0x0a9e('0x19')]=function(_0x3c775a,_0x3450ae){if(_0x3c775a['body']['id']){delete _0x3c775a[_0x0a9e('0xc5')]['id'];}return db['MailInteraction'][_0x0a9e('0x61')]({'where':{'id':_0x3c775a['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x3450ae,null))[_0x0a9e('0x1a')](saveUpdates(_0x3c775a[_0x0a9e('0xc5')],null))['then'](respondWithResult(_0x3450ae,null))[_0x0a9e('0x30')](handleError(_0x3450ae,null));};exports['destroy']=function(_0x4383da,_0x2b1824){return db[_0x0a9e('0x38')][_0x0a9e('0x61')]({'where':{'id':_0x4383da[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2b1824,null))[_0x0a9e('0x1a')](removeEntity(_0x2b1824,null))[_0x0a9e('0x30')](handleError(_0x2b1824,null));};exports[_0x0a9e('0xc7')]=function(_0x27d1f5,_0x4262d0){return db[_0x0a9e('0x38')][_0x0a9e('0xc7')]()[_0x0a9e('0x1a')](respondWithResult(_0x4262d0,null))[_0x0a9e('0x30')](handleError(_0x4262d0,null));};exports[_0x0a9e('0xc8')]=function(_0x5b93dd,_0x556443){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x5b93dd[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x556443,null))['then'](function(_0x1a3754){if(_0x1a3754){return _0x1a3754[_0x0a9e('0xc8')](_0x5b93dd[_0x0a9e('0xc5')][_0x0a9e('0xc9')],_['omit'](_0x5b93dd[_0x0a9e('0xc5')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x556443,null))[_0x0a9e('0x30')](handleError(_0x556443,null));};exports['getMessages']=function(_0x19e9ed,_0x1a0b08){var _0x2b7092={'raw':![],'where':{}};var _0x5c838b={};var _0x2650eb={'count':0x0,'rows':[]};return db[_0x0a9e('0x38')][_0x0a9e('0x2a')]({'where':{'id':_0x19e9ed['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x1a0b08,null))[_0x0a9e('0x1a')](function(_0x1d9b57){if(_0x1d9b57){_0x5c838b[_0x0a9e('0x3f')]=_[_0x0a9e('0x3d')](db['MailMessage'][_0x0a9e('0x39')]);_0x5c838b[_0x0a9e('0x3c')]=_['keys'](_0x19e9ed[_0x0a9e('0x3c')]);_0x5c838b[_0x0a9e('0x48')]=_[_0x0a9e('0x3e')](_0x5c838b['model'],_0x5c838b['query']);_0x2b7092['attributes']=_[_0x0a9e('0x3e')](_0x5c838b[_0x0a9e('0x3f')],qs['fields'](_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x41')]));_0x2b7092[_0x0a9e('0x40')]=_0x2b7092['attributes'][_0x0a9e('0x42')]?_0x2b7092[_0x0a9e('0x40')]:_0x5c838b[_0x0a9e('0x3f')];if(!_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x2b7092[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x19e9ed[_0x0a9e('0x3c')]['limit']);_0x2b7092[_0x0a9e('0x13')]=qs['offset'](_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x13')]);}_0x2b7092[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x46')]);_0x2b7092['where']=qs[_0x0a9e('0x48')](_[_0x0a9e('0x49')](_0x19e9ed[_0x0a9e('0x3c')],_0x5c838b[_0x0a9e('0x48')]));_0x2b7092['where'][_0x0a9e('0xbf')]=_0x1d9b57['id'];if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x82')]){_0x2b7092[_0x0a9e('0x47')]=_[_0x0a9e('0x9d')](_0x2b7092[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x37')](_0x2b7092[_0x0a9e('0x40')],function(_0x3299b7){var _0x3539b7={};_0x3539b7[_0x3299b7]={'$like':'%'+_0x19e9ed['query'][_0x0a9e('0x82')]+'%'};return _0x3539b7;})});}if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xca')]){var _0x26b826=_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xca')][_0x0a9e('0x25')](',');var _0x20ae21={};_0x20ae21[_0x26b826[0x0]]={'$gte':moment(_0x26b826[0x1])['format'](_0x0a9e('0xcb'))};_0x2b7092[_0x0a9e('0x47')]=_[_0x0a9e('0x9d')](_0x2b7092['where'],_0x20ae21);}_0x2b7092=_[_0x0a9e('0x9d')]({},_0x2b7092,_0x19e9ed[_0x0a9e('0xcc')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2b7092[_0x0a9e('0x47')]})[_0x0a9e('0x1a')](function(_0x424f1b){_0x2650eb[_0x0a9e('0x16')]=_0x424f1b;if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xc2')]){_0x2b7092['include']=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xcd')](_0x2b7092);})[_0x0a9e('0x1a')](function(_0x3db98f){if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xce')]==='true'){for(var _0x382687=0x0;_0x382687<_0x3db98f['length'];_0x382687++){_0x3db98f[_0x382687]['body']=juice(_0x3db98f[_0x382687]['body']);}}_0x2650eb[_0x0a9e('0xcf')]=_0x3db98f;return _0x2650eb;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x1a0b08,_0x2b7092))[_0x0a9e('0x30')](handleError(_0x1a0b08,null));};exports[_0x0a9e('0xd0')]=function(_0x4d99a8,_0x4156a5){return db[_0x0a9e('0x38')][_0x0a9e('0x61')]({'where':{'id':_0x4d99a8[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x4156a5,null))['then'](function(_0x57b1b1){if(_0x57b1b1){return _0x57b1b1[_0x0a9e('0xd1')](_0x4d99a8[_0x0a9e('0xc5')][_0x0a9e('0xc9')],_['omit'](_0x4d99a8[_0x0a9e('0xc5')],[_0x0a9e('0xc9'),'id'])||{})[_0x0a9e('0xd2')](function(){return db['Tag'][_0x0a9e('0xcd')]({'attributes':['id',_0x0a9e('0x20'),_0x0a9e('0x4b')],'where':{'id':_0x4d99a8['body'][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x3b7213){socket['emit']('mailInteractionTags:save',{'id':Number(_0x4d99a8['params']['id']),'tags':_0x3b7213||[]});return{'id':Number(_0x4d99a8[_0x0a9e('0xc6')]['id']),'tags':_0x3b7213||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x4156a5,null))[_0x0a9e('0x30')](handleError(_0x4156a5,null));};exports[_0x0a9e('0xd3')]=function(_0x5d83fd,_0x33f22a){return db['MailInteraction'][_0x0a9e('0x61')]({'where':{'id':_0x5d83fd[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x33f22a,null))['then'](function(_0x33b4b3){if(_0x33b4b3){return _0x33b4b3[_0x0a9e('0xd3')](_0x5d83fd[_0x0a9e('0x3c')]['ids']);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x33f22a,null))['catch'](handleError(_0x33f22a,null));};exports[_0x0a9e('0xd4')]=function(_0x5c57e1,_0x41b90a){var _0x57b7d4=moment()[_0x0a9e('0xd5')]()[_0x0a9e('0xbc')]();var _0xa288e4=path[_0x0a9e('0xd6')](config[_0x0a9e('0xd7')],_0x0a9e('0xd8'),_0x0a9e('0xd9'),'tmp');var _0x35ace3=path[_0x0a9e('0xd6')](config['root'],_0x0a9e('0xd8'),_0x0a9e('0xd9'),'attachments');var _0x39070b=path[_0x0a9e('0xd6')](_0xa288e4,_0x57b7d4);var _0x16b578=util['format'](_0x0a9e('0xda'),_0x5c57e1[_0x0a9e('0xc6')]['id'],_0x57b7d4);var _0xdeb5e4=path[_0x0a9e('0xd6')](_0xa288e4,_0x16b578);var _0x2003bc=[];if(_0x5c57e1[_0x0a9e('0x3c')][_0x0a9e('0xdb')]){_0x2003bc[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdc')],'as':_0x0a9e('0xdd'),'raw':!![]});}var _0x56e148=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc5'),_0x0a9e('0x4c'),'to','cc',_0x0a9e('0xde'),_0x0a9e('0xdf'),_0x0a9e('0x77')],'where':{'secret':![]},'order':qs[_0x0a9e('0x46')]('id'),'include':_0x2003bc}];return db['MailInteraction'][_0x0a9e('0x61')]({'where':{'id':_0x5c57e1[_0x0a9e('0xc6')]['id']},'include':_0x56e148})[_0x0a9e('0x1a')](handleEntityNotFound(_0x41b90a,null))['then'](function(_0x11e4e3){if(_0x11e4e3&&_0x11e4e3[_0x0a9e('0xe0')]){var _0x4435d2=_0x11e4e3[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x39070b);return BPromise[_0x0a9e('0xe3')](_0x4435d2[_0x0a9e('0xe0')],function(_0x5f2c51,_0x4e1b3){var _0x228c10={'from':_0x5f2c51[_0x0a9e('0x4c')],'to':_0x5f2c51['to'],'subject':_0x5f2c51[_0x0a9e('0xdf')],'html':_0x5f2c51[_0x0a9e('0xc5')],'headers':{'Date':moment(_0x5f2c51[_0x0a9e('0x77')])[_0x0a9e('0xe4')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5f2c51['cc']){_0x228c10['headers']['Cc']=_0x5f2c51['cc'];}if(_0x5f2c51[_0x0a9e('0xde')]){_0x228c10[_0x0a9e('0xe5')][_0x0a9e('0xe6')]=_0x5f2c51[_0x0a9e('0xde')];}return new BPromise(function(_0x40e2da,_0x131da8){if(_0x5f2c51[_0x0a9e('0xdd')]){for(var _0x584854=0x0;_0x584854<_0x5f2c51[_0x0a9e('0xdd')][_0x0a9e('0x42')];_0x584854++){var _0x2d8e91=_0x5f2c51[_0x0a9e('0xdd')][_0x584854];var _0x1b1757=path[_0x0a9e('0xd6')](_0x35ace3,_0x2d8e91[_0x0a9e('0xe7')]);if(fs['existsSync'](_0x1b1757)){_0x228c10[_0x0a9e('0xdb')][_0x0a9e('0x27')]({'name':_0x2d8e91[_0x0a9e('0x20')],'contentType':_0x2d8e91['type'],'data':fs[_0x0a9e('0xe8')](_0x1b1757)});}}}emlformat[_0x0a9e('0xe9')](_0x228c10,function(_0x2030cf,_0x292f02){if(_0x2030cf)return _0x131da8(_0x2030cf);fs['writeFileSync'](path[_0x0a9e('0xd6')](_0x39070b,util[_0x0a9e('0xe4')](_0x0a9e('0xea'),_0x4e1b3)),_0x292f02);return _0x40e2da(_0x292f02);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x3ea95b,_0x20c130){zipdir(_0x39070b,{'saveTo':_0xdeb5e4},function(_0x3e365c,_0x385e5d){if(_0x3e365c)return _0x20c130(_0x3e365c);return _0x3ea95b(_0x385e5d);});})['then'](function(){return new BPromise(function(_0x3ede01,_0x266aa1){rimraf(_0x39070b,function(_0x25e41f){if(_0x25e41f)_0x266aa1(_0x25e41f);return _0x3ede01();});});})[_0x0a9e('0x1a')](function(){return _0x41b90a['download'](_0xdeb5e4,_0x16b578,function(_0x5de6e5){if(!_0x5de6e5)fs[_0x0a9e('0xeb')](_0xdeb5e4);});});});}else{return _0x41b90a[_0x0a9e('0x1d')](0xc8);}})[_0x0a9e('0x30')](handleError(_0x41b90a,null));}; \ No newline at end of file +var _0xa9e0=['Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','show','includeAll','include','create','body','params','describe','addMessage','ids','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','rows','addTags','setTags','spread','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','attachments','Attachment','Attachments','bcc','subject','Messages','get','mkdirSync','each','format','headers','Bcc','basename','readFileSync','build','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','talking','unmanaged','total','closed','UserId','index','map','MailInteraction','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','u.fullname','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','mail_messages','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','Contact.email'];(function(_0x30123b,_0x2b155d){var _0x24eb6f=function(_0x31e0fd){while(--_0x31e0fd){_0x30123b['push'](_0x30123b['shift']());}};_0x24eb6f(++_0x2b155d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){return getStateInteraction(_0x66c1d2);})[_0x0a9e('0x1a')](function(_0x40cb85){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x40cb85));}else{_0x3ae878(_0x40cb85);}})[_0x0a9e('0x30')](function(_0x2b45ea){_0x1122db(_0x2b45ea);});});}function getStateInteraction(_0x409319){return new BPromise(function(_0x332d35,_0x39e565){_0x409319['waiting']=0x0;_0x409319[_0x0a9e('0x31')]=0x0;_0x409319['answered']=0x0;_0x409319[_0x0a9e('0x32')]=0x0;_0x409319[_0x0a9e('0x33')]=0x0;if(!_0x409319[_0x0a9e('0x34')]&&!_0x409319[_0x0a9e('0x35')])_0x409319['waiting']+=0x1;if(!_0x409319[_0x0a9e('0x34')]&&_0x409319[_0x0a9e('0x35')])_0x409319[_0x0a9e('0x31')]+=0x1;if(_0x409319[_0x0a9e('0x34')]&&_0x409319['UserId'])_0x409319['answered']+=0x1;if(_0x409319[_0x0a9e('0x34')]&&!_0x409319['UserId'])_0x409319[_0x0a9e('0x32')]+=0x1;_0x409319[_0x0a9e('0x33')]+=0x1;_0x332d35(_0x409319);});}exports[_0x0a9e('0x36')]=function(_0x1ef87a,_0x4f41ae){var _0x31916f={},_0x3bfce8={},_0x3cae={'count':0x0,'rows':[]};var _0x533942=_[_0x0a9e('0x37')](db[_0x0a9e('0x38')][_0x0a9e('0x39')],function(_0x4c1c0e){return{'name':_0x4c1c0e['fieldName'],'type':_0x4c1c0e[_0x0a9e('0x3a')][_0x0a9e('0x3b')]};});_0x3bfce8['model']=_[_0x0a9e('0x37')](_0x533942,_0x0a9e('0x20'));_0x3bfce8[_0x0a9e('0x3c')]=_[_0x0a9e('0x3d')](_0x1ef87a['query']);_0x3bfce8['filters']=_[_0x0a9e('0x3e')](_0x3bfce8[_0x0a9e('0x3f')],_0x3bfce8['query']);_0x31916f[_0x0a9e('0x40')]=_[_0x0a9e('0x3e')](_0x3bfce8[_0x0a9e('0x3f')],qs['fields'](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x41')]));_0x31916f[_0x0a9e('0x40')]=_0x31916f[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x31916f[_0x0a9e('0x40')]:_0x3bfce8[_0x0a9e('0x3f')];if(!_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x31916f[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x15')]);_0x31916f[_0x0a9e('0x13')]=qs['offset'](_0x1ef87a['query'][_0x0a9e('0x13')]);}_0x31916f[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x46')]);_0x31916f[_0x0a9e('0x47')]=qs[_0x0a9e('0x48')](_[_0x0a9e('0x49')](_0x1ef87a[_0x0a9e('0x3c')],_0x3bfce8[_0x0a9e('0x48')]),_0x533942);var _0x2c2cb0=[];var _0x35ed4a=squel['select']()[_0x0a9e('0x4a')]('id')[_0x0a9e('0x4a')](_0x0a9e('0x20'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'))[_0x0a9e('0x4c')](_0x0a9e('0x4d'));var _0x44dd99=squel['select']()[_0x0a9e('0x4a')]('u.id')[_0x0a9e('0x4a')](_0x0a9e('0x4e'))[_0x0a9e('0x4a')]('ui.MailInteractionId')[_0x0a9e('0x4c')](_0x0a9e('0x4f'),'ui')[_0x0a9e('0x50')](_0x0a9e('0x51'),'u',_0x0a9e('0x52'));var _0x37be73=squel[_0x0a9e('0x53')]()['from'](_0x0a9e('0x54'),'i')[_0x0a9e('0x50')](_0x0a9e('0x55'),'c',_0x0a9e('0x56'))[_0x0a9e('0x50')](_0x0a9e('0x51'),'o',_0x0a9e('0x57'))[_0x0a9e('0x50')](_0x0a9e('0x58'),'a','a.id\x20=\x20i.MailAccountId')[_0x0a9e('0x50')](_0x0a9e('0x59'),'me','me.MailInteractionId\x20=\x20i.id')['left_join']('mail_interaction_has_tags','it',_0x0a9e('0x5a'))[_0x0a9e('0x50')](_0x0a9e('0x4d'),'t',_0x0a9e('0x5b'));var _0x61bb17=squel[_0x0a9e('0x5c')]();var _0x2e5165=[];var _0x375c18=squel['expr']();var _0x4b1b9f;if(_0x1ef87a['query'][_0x0a9e('0x5d')]){_0x4b1b9f=as[_0x0a9e('0x5e')](_0x1ef87a[_0x0a9e('0x3c')]['search']);var _0x2b69d9=_0x4b1b9f[_0x0a9e('0x5f')];for(var _0x53d113=0x0;_0x53d113<_0x4b1b9f['conditions'][_0x0a9e('0x42')];_0x53d113++){var _0x59c6ff=_0x4b1b9f[_0x0a9e('0x60')][_0x53d113];var _0x4c3845='i';var _0x2e5e62=_[_0x0a9e('0x61')](_0x533942,[_0x0a9e('0x20'),_0x59c6ff['field']]);if(!_0x2e5e62){switch(_0x59c6ff[_0x0a9e('0x4a')]){case _0x0a9e('0x62'):if(_0x59c6ff['value']==0x1){_0x37be73['having']('`'+_0x59c6ff[_0x0a9e('0x4a')]+_0x0a9e('0x63'));}else{_0x37be73['having']('`'+_0x59c6ff[_0x0a9e('0x4a')]+'`\x20>\x200');}break;case _0x0a9e('0x64'):if(_0x59c6ff['operator']===_0x0a9e('0x65')){if(_0x59c6ff['value']['split']('\x20')['length']>0x1){_0x61bb17[_0x2b69d9](_0x0a9e('0x66'),qs['getFullTextValue'](_0x59c6ff[_0x0a9e('0x67')]),null);}else{var _0x65432='%'+_0x59c6ff[_0x0a9e('0x67')]+'%';_0x61bb17[_0x2b69d9](_0x0a9e('0x68'),_0x65432,_0x65432,_0x65432);}}else{_0x2e5e62=_[_0x0a9e('0x61')](_0x533942,[_0x0a9e('0x20'),_0x0a9e('0x69')]);_0x59c6ff[_0x0a9e('0x4a')]='ContactId';_0x88dcbf=as[_0x0a9e('0x6a')](_0x4c3845,_0x2e5e62[_0x0a9e('0x3a')],_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf[_0x0a9e('0x6b')],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x6c')],_0x88dcbf[_0x0a9e('0x67')]['end']);}break;case _0x0a9e('0x6d'):var _0x26bc80=_0x59c6ff['value'][_0x0a9e('0x25')](',')['map'](function(_0x20c668){return Number(_0x20c668);});_0x26bc80['forEach'](function(_0x4b3c1a){_0x375c18['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4b3c1a+',%');});_0x2e5165=_[_0x0a9e('0x6e')](_0x2e5165,_0x26bc80);break;case'User':if(_0x59c6ff[_0x0a9e('0x6f')]===_0x0a9e('0x65')){_0x61bb17[_0x2b69d9](_0x0a9e('0x70'),'%'+_0x59c6ff[_0x0a9e('0x67')]+'%',null);}else{_0x2e5e62=_[_0x0a9e('0x61')](_0x533942,[_0x0a9e('0x20'),'UserId']);_0x59c6ff[_0x0a9e('0x4a')]='UserId';_0x88dcbf=as[_0x0a9e('0x6a')](_0x4c3845,_0x2e5e62[_0x0a9e('0x3a')],_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf[_0x0a9e('0x6b')],_0x88dcbf['value'][_0x0a9e('0x6c')],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x1c')]);}break;case _0x0a9e('0x2d'):_0x88dcbf=as['buildExpression']('me',null,_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf[_0x0a9e('0x6b')],_0x88dcbf[_0x0a9e('0x67')]['start'],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x1c')]);break;}}else{var _0x88dcbf=as[_0x0a9e('0x6a')](_0x4c3845,_0x2e5e62[_0x0a9e('0x3a')],_0x59c6ff);_0x61bb17[_0x2b69d9](_0x88dcbf['text'],_0x88dcbf[_0x0a9e('0x67')][_0x0a9e('0x6c')],_0x88dcbf[_0x0a9e('0x67')]['end']);}}}else{var _0x3528b7=_(_0x1ef87a['query'])['keys']()[_0x0a9e('0x37')](function(_0x4556c5){return _[_0x0a9e('0x71')](_0x533942,[_0x0a9e('0x20'),_0x4556c5])?_0x4556c5:undefined;})[_0x0a9e('0x72')]()[_0x0a9e('0x67')]();if(!_[_0x0a9e('0x73')](_0x3528b7)){_0x3528b7[_0x0a9e('0x26')](function(_0x2d7205){if(_0x2d7205===_0x0a9e('0x74')){_0x37be73[_0x0a9e('0x47')](_0x0a9e('0x75'),[][_0x0a9e('0x76')](_0x1ef87a[_0x0a9e('0x3c')][_0x2d7205]));}else if(_0x2d7205===_0x0a9e('0x77')){var _0x412a72=JSON[_0x0a9e('0x78')](_0x1ef87a[_0x0a9e('0x3c')][_0x2d7205])['$gte'];var _0x1b0b98=JSON[_0x0a9e('0x78')](_0x1ef87a[_0x0a9e('0x3c')][_0x2d7205])['$lte'];_0x37be73[_0x0a9e('0x47')](_0x0a9e('0x79'),_0x412a72,_0x1b0b98);}else{if(_0x1ef87a['query'][_0x2d7205]===_0x0a9e('0x7a')){_0x37be73[_0x0a9e('0x47')]('i.'+_0x2d7205+_0x0a9e('0x7b'));}else{_0x37be73[_0x0a9e('0x47')]('i.'+_0x2d7205+_0x0a9e('0x7c'),_0x1ef87a['query'][_0x2d7205]);}}});}if(_0x1ef87a['query']['read']){if(_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x7d')]==0x1){_0x37be73[_0x0a9e('0x7e')](_0x0a9e('0x7f'));}else{_0x37be73[_0x0a9e('0x7e')](_0x0a9e('0x80'));}}if(_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x81')]){_0x2e5165=_['isArray'](_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x81')])?_0x1ef87a[_0x0a9e('0x3c')]['tag']:new Array(_0x1ef87a[_0x0a9e('0x3c')]['tag']);_0x2e5165[_0x0a9e('0x26')](function(_0x44351d){_0x375c18['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x44351d+',%');});}if(_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x82')]){var _0x2cc7a7=_0x1ef87a[_0x0a9e('0x3c')]['filter'][_0x0a9e('0x83')]('\x5c','\x5c\x5c')[_0x0a9e('0x83')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x84')](_0x2cc7a7)){_0x61bb17['or'](_0x0a9e('0x85'),_0x2cc7a7+'%');}else if(qs['isEmail'](_0x2cc7a7)){_0x61bb17['or'](_0x0a9e('0x86'),_0x2cc7a7+'%');}else{_0x61bb17['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x2cc7a7))['or'](_0x0a9e('0x89'),qs['getFullTextValue'](_0x2cc7a7));}}}_0x37be73[_0x0a9e('0x47')](_0x61bb17);_0x37be73[_0x0a9e('0x8a')](_0x0a9e('0x8b'));var _0xf410e5={'type':db[_0x0a9e('0x8c')][_0x0a9e('0x8d')][_0x0a9e('0x8e')],'raw':!![]};var _0x3df0e3=_0x37be73[_0x0a9e('0x8f')]();_0x3df0e3[_0x0a9e('0x4a')](_0x0a9e('0x8b'));_0x3df0e3[_0x0a9e('0x4a')](_0x0a9e('0x90'),_0x0a9e('0x62'));if(_0x31916f['order']){_0x31916f[_0x0a9e('0x45')][_0x0a9e('0x26')](function(_0xc599b3){var _0x563627=_0xc599b3[0x0]===_0x0a9e('0x91')?_0xc599b3[0x0]:'i.'+_0xc599b3[0x0];_0x37be73[_0x0a9e('0x45')](_0x563627,_0xc599b3[0x1]===_0x0a9e('0x92')?![]:!![]);});}if(!_[_0x0a9e('0x73')](_0x2e5165)){_0x37be73['having'](_0x375c18);_0x3df0e3['where'](_0x0a9e('0x93'),_0x2e5165);}BPromise[_0x0a9e('0x94')]()['then'](function(){if(!_0x4b1b9f){if(_0x1ef87a[_0x0a9e('0x3c')]['MailAccountId'])return;_0x3df0e3[_0x0a9e('0x47')](_0x0a9e('0x95'));_0x37be73['where'](_0x0a9e('0x95'));return;}if(_0x1ef87a[_0x0a9e('0x96')][_0x0a9e('0x97')]!==_0x0a9e('0x98'))return;return _0x1ef87a[_0x0a9e('0x96')][_0x0a9e('0x99')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0x482ca2){if(_[_0x0a9e('0x73')](_0x482ca2)){_0x3df0e3[_0x0a9e('0x47')](_0x0a9e('0x9a'));_0x37be73[_0x0a9e('0x47')]('i.MailAccountId\x20IS\x20NULL');}else{_0x3df0e3[_0x0a9e('0x47')](_0x0a9e('0x75'),_['map'](_0x482ca2,'id'));_0x37be73[_0x0a9e('0x47')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0x482ca2,'id'));}});})[_0x0a9e('0x1a')](function(){if(_0x1ef87a[_0x0a9e('0x96')][_0x0a9e('0x97')]==='agent'&&!_0x4b1b9f&&!_0x1ef87a['query'][_0x0a9e('0x74')])return[];return db[_0x0a9e('0x9b')][_0x0a9e('0x3c')](_0x3df0e3['toString'](),_0xf410e5);})[_0x0a9e('0x1a')](function(_0x36e975){_0x3cae['count']=_0x36e975['length'];if(_0x3cae[_0x0a9e('0x16')]===0x0)return[];return db['sequelize']['query'](_0x35ed4a['toString'](),_0xf410e5)[_0x0a9e('0x1a')](function(_0xf3601c){_0x2c2cb0=_[_0x0a9e('0x9c')](_0xf3601c,'id');_0xf410e5=_[_0x0a9e('0x9d')](_0xf410e5,{'model':db[_0x0a9e('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ef87a[_0x0a9e('0x3c')]['fields']){_0x31916f[_0x0a9e('0x40')]['forEach'](function(_0x2871c1){_0x37be73[_0x0a9e('0x4a')]('i.'+_0x2871c1);});}else{_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0x90'),'unreadMessages');_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x37be73['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa2'),_0x0a9e('0x91'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0x8b'));_0x37be73[_0x0a9e('0x4a')]('i.createdAt');_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa3'));_0x37be73['field'](_0x0a9e('0xa4'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa5'));_0x37be73['field'](_0x0a9e('0xa6'));_0x37be73['field'](_0x0a9e('0xa7'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa8'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xa9'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xaa'));_0x37be73[_0x0a9e('0x4a')]('i.secondDisposition');_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xab'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xac'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xad'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xae'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xaf'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xb0'));_0x37be73[_0x0a9e('0x4a')]('c.firstName',_0x0a9e('0xb1'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xb2'),_0x0a9e('0xb3'));_0x37be73[_0x0a9e('0x4a')]('c.email',_0x0a9e('0xb4'));_0x37be73[_0x0a9e('0x4a')]('c.phone',_0x0a9e('0xb5'));_0x37be73['field'](_0x0a9e('0xb6'),_0x0a9e('0xb7'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xb8'),'Contact.fax');_0x37be73[_0x0a9e('0x4a')]('o.fullname',_0x0a9e('0xb9'));_0x37be73[_0x0a9e('0x4a')]('o.internal',_0x0a9e('0xba'));_0x37be73[_0x0a9e('0x4a')](_0x0a9e('0xbb'),'TagIds');}if(_0x31916f['limit'])_0x37be73[_0x0a9e('0x15')](_0x31916f[_0x0a9e('0x15')]);if(_0x31916f[_0x0a9e('0x13')])_0x37be73[_0x0a9e('0x13')](_0x31916f[_0x0a9e('0x13')]);return db[_0x0a9e('0x9b')][_0x0a9e('0x3c')](_0x37be73[_0x0a9e('0xbc')](),_0xf410e5);})[_0x0a9e('0x1a')](function(_0x586510){if(_0x586510[_0x0a9e('0x42')]>0x0)_0x44dd99['where'](_0x0a9e('0xbd'),_[_0x0a9e('0x37')](_0x586510,'id'));return db[_0x0a9e('0x9b')][_0x0a9e('0x3c')](_0x44dd99[_0x0a9e('0xbc')](),_0xf410e5)['then'](function(_0x436313){var _0x4667bf=_[_0x0a9e('0xbe')](_0x436313,_0x0a9e('0xbf'));var _0x2263f1=[];return db['Setting']['findOne']({'attributes':[_0x0a9e('0xc0')],'raw':!![]})['then'](function(_0x25eae0){var _0x4658df=_0x25eae0[_0x0a9e('0xc0')];_0x586510[_0x0a9e('0x26')](function(_0x2ad54b){_0x2263f1[_0x0a9e('0x27')](updateMailInteraction(_0x2ad54b,_0x2c2cb0,_0x4667bf,_0x4658df));});return BPromise['all'](_0x2263f1);});});});})['then'](function(_0x1889ed){_0x3cae['rows']=_0x1889ed;return _0x3cae;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x4f41ae,_0x31916f))['catch'](handleError(_0x4f41ae,null));};exports[_0x0a9e('0xc1')]=function(_0x564db2,_0x558d60){var _0x1c49dc={'raw':![],'where':{'id':_0x564db2['params']['id']}},_0xb8db59={};_0xb8db59[_0x0a9e('0x3f')]=_[_0x0a9e('0x3d')](db[_0x0a9e('0x38')][_0x0a9e('0x39')]);_0xb8db59[_0x0a9e('0x3c')]=_['keys'](_0x564db2['query']);_0xb8db59[_0x0a9e('0x48')]=_[_0x0a9e('0x3e')](_0xb8db59[_0x0a9e('0x3f')],_0xb8db59[_0x0a9e('0x3c')]);_0x1c49dc[_0x0a9e('0x40')]=_['intersection'](_0xb8db59[_0x0a9e('0x3f')],qs[_0x0a9e('0x41')](_0x564db2['query'][_0x0a9e('0x41')]));_0x1c49dc[_0x0a9e('0x40')]=_0x1c49dc[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1c49dc[_0x0a9e('0x40')]:_0xb8db59[_0x0a9e('0x3f')];if(_0x564db2[_0x0a9e('0x3c')][_0x0a9e('0xc2')]){_0x1c49dc[_0x0a9e('0xc3')]=[{'all':!![]}];}_0x1c49dc=_[_0x0a9e('0x9d')]({},_0x1c49dc,_0x564db2['options']);return db[_0x0a9e('0x38')][_0x0a9e('0x61')](_0x1c49dc)[_0x0a9e('0x1a')](handleEntityNotFound(_0x558d60,null))[_0x0a9e('0x1a')](respondWithResult(_0x558d60,null))[_0x0a9e('0x30')](handleError(_0x558d60,null));};exports['create']=function(_0x500868,_0x21902c){return db[_0x0a9e('0x38')][_0x0a9e('0xc4')](_0x500868[_0x0a9e('0xc5')],{})[_0x0a9e('0x1a')](respondWithResult(_0x21902c,0xc9))['catch'](handleError(_0x21902c,null));};exports[_0x0a9e('0x19')]=function(_0x3c775a,_0x3450ae){if(_0x3c775a['body']['id']){delete _0x3c775a[_0x0a9e('0xc5')]['id'];}return db['MailInteraction'][_0x0a9e('0x61')]({'where':{'id':_0x3c775a['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x3450ae,null))[_0x0a9e('0x1a')](saveUpdates(_0x3c775a[_0x0a9e('0xc5')],null))['then'](respondWithResult(_0x3450ae,null))[_0x0a9e('0x30')](handleError(_0x3450ae,null));};exports['destroy']=function(_0x4383da,_0x2b1824){return db[_0x0a9e('0x38')][_0x0a9e('0x61')]({'where':{'id':_0x4383da[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2b1824,null))[_0x0a9e('0x1a')](removeEntity(_0x2b1824,null))[_0x0a9e('0x30')](handleError(_0x2b1824,null));};exports[_0x0a9e('0xc7')]=function(_0x27d1f5,_0x4262d0){return db[_0x0a9e('0x38')][_0x0a9e('0xc7')]()[_0x0a9e('0x1a')](respondWithResult(_0x4262d0,null))[_0x0a9e('0x30')](handleError(_0x4262d0,null));};exports[_0x0a9e('0xc8')]=function(_0x5b93dd,_0x556443){return db[_0x0a9e('0x29')]['find']({'where':{'id':_0x5b93dd[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x556443,null))['then'](function(_0x1a3754){if(_0x1a3754){return _0x1a3754[_0x0a9e('0xc8')](_0x5b93dd[_0x0a9e('0xc5')][_0x0a9e('0xc9')],_['omit'](_0x5b93dd[_0x0a9e('0xc5')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x556443,null))[_0x0a9e('0x30')](handleError(_0x556443,null));};exports['getMessages']=function(_0x19e9ed,_0x1a0b08){var _0x2b7092={'raw':![],'where':{}};var _0x5c838b={};var _0x2650eb={'count':0x0,'rows':[]};return db[_0x0a9e('0x38')][_0x0a9e('0x2a')]({'where':{'id':_0x19e9ed['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x1a0b08,null))[_0x0a9e('0x1a')](function(_0x1d9b57){if(_0x1d9b57){_0x5c838b[_0x0a9e('0x3f')]=_[_0x0a9e('0x3d')](db['MailMessage'][_0x0a9e('0x39')]);_0x5c838b[_0x0a9e('0x3c')]=_['keys'](_0x19e9ed[_0x0a9e('0x3c')]);_0x5c838b[_0x0a9e('0x48')]=_[_0x0a9e('0x3e')](_0x5c838b['model'],_0x5c838b['query']);_0x2b7092['attributes']=_[_0x0a9e('0x3e')](_0x5c838b[_0x0a9e('0x3f')],qs['fields'](_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x41')]));_0x2b7092[_0x0a9e('0x40')]=_0x2b7092['attributes'][_0x0a9e('0x42')]?_0x2b7092[_0x0a9e('0x40')]:_0x5c838b[_0x0a9e('0x3f')];if(!_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x2b7092[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x19e9ed[_0x0a9e('0x3c')]['limit']);_0x2b7092[_0x0a9e('0x13')]=qs['offset'](_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x13')]);}_0x2b7092[_0x0a9e('0x45')]=qs[_0x0a9e('0x46')](_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x46')]);_0x2b7092['where']=qs[_0x0a9e('0x48')](_[_0x0a9e('0x49')](_0x19e9ed[_0x0a9e('0x3c')],_0x5c838b[_0x0a9e('0x48')]));_0x2b7092['where'][_0x0a9e('0xbf')]=_0x1d9b57['id'];if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0x82')]){_0x2b7092[_0x0a9e('0x47')]=_[_0x0a9e('0x9d')](_0x2b7092[_0x0a9e('0x47')],{'$or':_[_0x0a9e('0x37')](_0x2b7092[_0x0a9e('0x40')],function(_0x3299b7){var _0x3539b7={};_0x3539b7[_0x3299b7]={'$like':'%'+_0x19e9ed['query'][_0x0a9e('0x82')]+'%'};return _0x3539b7;})});}if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xca')]){var _0x26b826=_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xca')][_0x0a9e('0x25')](',');var _0x20ae21={};_0x20ae21[_0x26b826[0x0]]={'$gte':moment(_0x26b826[0x1])['format'](_0x0a9e('0xcb'))};_0x2b7092[_0x0a9e('0x47')]=_[_0x0a9e('0x9d')](_0x2b7092['where'],_0x20ae21);}_0x2b7092=_[_0x0a9e('0x9d')]({},_0x2b7092,_0x19e9ed[_0x0a9e('0xcc')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2b7092[_0x0a9e('0x47')]})[_0x0a9e('0x1a')](function(_0x424f1b){_0x2650eb[_0x0a9e('0x16')]=_0x424f1b;if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xc2')]){_0x2b7092['include']=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xcd')](_0x2b7092);})[_0x0a9e('0x1a')](function(_0x3db98f){if(_0x19e9ed[_0x0a9e('0x3c')][_0x0a9e('0xce')]==='true'){for(var _0x382687=0x0;_0x382687<_0x3db98f['length'];_0x382687++){_0x3db98f[_0x382687]['body']=juice(_0x3db98f[_0x382687]['body']);}}_0x2650eb[_0x0a9e('0xcf')]=_0x3db98f;return _0x2650eb;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x1a0b08,_0x2b7092))[_0x0a9e('0x30')](handleError(_0x1a0b08,null));};exports[_0x0a9e('0xd0')]=function(_0x4d99a8,_0x4156a5){return db[_0x0a9e('0x38')][_0x0a9e('0x61')]({'where':{'id':_0x4d99a8[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x4156a5,null))['then'](function(_0x57b1b1){if(_0x57b1b1){return _0x57b1b1[_0x0a9e('0xd1')](_0x4d99a8[_0x0a9e('0xc5')][_0x0a9e('0xc9')],_['omit'](_0x4d99a8[_0x0a9e('0xc5')],[_0x0a9e('0xc9'),'id'])||{})[_0x0a9e('0xd2')](function(){return db['Tag'][_0x0a9e('0xcd')]({'attributes':['id',_0x0a9e('0x20'),_0x0a9e('0x4b')],'where':{'id':_0x4d99a8['body'][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x3b7213){socket['emit']('mailInteractionTags:save',{'id':Number(_0x4d99a8['params']['id']),'tags':_0x3b7213||[]});return{'id':Number(_0x4d99a8[_0x0a9e('0xc6')]['id']),'tags':_0x3b7213||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x4156a5,null))[_0x0a9e('0x30')](handleError(_0x4156a5,null));};exports[_0x0a9e('0xd3')]=function(_0x5d83fd,_0x33f22a){return db['MailInteraction'][_0x0a9e('0x61')]({'where':{'id':_0x5d83fd[_0x0a9e('0xc6')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x33f22a,null))['then'](function(_0x33b4b3){if(_0x33b4b3){return _0x33b4b3[_0x0a9e('0xd3')](_0x5d83fd[_0x0a9e('0x3c')]['ids']);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x33f22a,null))['catch'](handleError(_0x33f22a,null));};exports[_0x0a9e('0xd4')]=function(_0x5c57e1,_0x41b90a){var _0x57b7d4=moment()[_0x0a9e('0xd5')]()[_0x0a9e('0xbc')]();var _0xa288e4=path[_0x0a9e('0xd6')](config[_0x0a9e('0xd7')],_0x0a9e('0xd8'),_0x0a9e('0xd9'),'tmp');var _0x35ace3=path[_0x0a9e('0xd6')](config['root'],_0x0a9e('0xd8'),_0x0a9e('0xd9'),'attachments');var _0x39070b=path[_0x0a9e('0xd6')](_0xa288e4,_0x57b7d4);var _0x16b578=util['format'](_0x0a9e('0xda'),_0x5c57e1[_0x0a9e('0xc6')]['id'],_0x57b7d4);var _0xdeb5e4=path[_0x0a9e('0xd6')](_0xa288e4,_0x16b578);var _0x2003bc=[];if(_0x5c57e1[_0x0a9e('0x3c')][_0x0a9e('0xdb')]){_0x2003bc[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdc')],'as':_0x0a9e('0xdd'),'raw':!![]});}var _0x56e148=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc5'),_0x0a9e('0x4c'),'to','cc',_0x0a9e('0xde'),_0x0a9e('0xdf'),_0x0a9e('0x77')],'where':{'secret':![]},'order':qs[_0x0a9e('0x46')]('id'),'include':_0x2003bc}];return db['MailInteraction'][_0x0a9e('0x61')]({'where':{'id':_0x5c57e1[_0x0a9e('0xc6')]['id']},'include':_0x56e148})[_0x0a9e('0x1a')](handleEntityNotFound(_0x41b90a,null))['then'](function(_0x11e4e3){if(_0x11e4e3&&_0x11e4e3[_0x0a9e('0xe0')]){var _0x4435d2=_0x11e4e3[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x39070b);return BPromise[_0x0a9e('0xe3')](_0x4435d2[_0x0a9e('0xe0')],function(_0x5f2c51,_0x4e1b3){var _0x228c10={'from':_0x5f2c51[_0x0a9e('0x4c')],'to':_0x5f2c51['to'],'subject':_0x5f2c51[_0x0a9e('0xdf')],'html':_0x5f2c51[_0x0a9e('0xc5')],'headers':{'Date':moment(_0x5f2c51[_0x0a9e('0x77')])[_0x0a9e('0xe4')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5f2c51['cc']){_0x228c10['headers']['Cc']=_0x5f2c51['cc'];}if(_0x5f2c51[_0x0a9e('0xde')]){_0x228c10[_0x0a9e('0xe5')][_0x0a9e('0xe6')]=_0x5f2c51[_0x0a9e('0xde')];}return new BPromise(function(_0x40e2da,_0x131da8){if(_0x5f2c51[_0x0a9e('0xdd')]){for(var _0x584854=0x0;_0x584854<_0x5f2c51[_0x0a9e('0xdd')][_0x0a9e('0x42')];_0x584854++){var _0x2d8e91=_0x5f2c51[_0x0a9e('0xdd')][_0x584854];var _0x1b1757=path[_0x0a9e('0xd6')](_0x35ace3,_0x2d8e91[_0x0a9e('0xe7')]);if(fs['existsSync'](_0x1b1757)){_0x228c10[_0x0a9e('0xdb')][_0x0a9e('0x27')]({'name':_0x2d8e91[_0x0a9e('0x20')],'contentType':_0x2d8e91['type'],'data':fs[_0x0a9e('0xe8')](_0x1b1757)});}}}emlformat[_0x0a9e('0xe9')](_0x228c10,function(_0x2030cf,_0x292f02){if(_0x2030cf)return _0x131da8(_0x2030cf);fs['writeFileSync'](path[_0x0a9e('0xd6')](_0x39070b,util[_0x0a9e('0xe4')](_0x0a9e('0xea'),_0x4e1b3)),_0x292f02);return _0x40e2da(_0x292f02);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x3ea95b,_0x20c130){zipdir(_0x39070b,{'saveTo':_0xdeb5e4},function(_0x3e365c,_0x385e5d){if(_0x3e365c)return _0x20c130(_0x3e365c);return _0x3ea95b(_0x385e5d);});})['then'](function(){return new BPromise(function(_0x3ede01,_0x266aa1){rimraf(_0x39070b,function(_0x25e41f){if(_0x25e41f)_0x266aa1(_0x25e41f);return _0x3ede01();});});})[_0x0a9e('0x1a')](function(){return _0x41b90a['download'](_0xdeb5e4,_0x16b578,function(_0x5de6e5){if(!_0x5de6e5)fs[_0x0a9e('0xeb')](_0xdeb5e4);});});});}else{return _0x41b90a[_0x0a9e('0x1d')](0xc8);}})[_0x0a9e('0x30')](handleError(_0x41b90a,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 710966d..0985de3 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 _0xbc8b=['unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbc8b,0x1a4));var _0xbbc8=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xbc8b[_0x162780];return _0x1ea2dc;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xbbc8('0x0'))['db'][_0xbbc8('0x1')];var MailMessage=require(_0xbbc8('0x0'))['db'][_0xbbc8('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbbc8('0x3')](0x0);var events={'afterCreate':_0xbbc8('0x4'),'afterUpdate':_0xbbc8('0x5'),'afterDestroy':_0xbbc8('0x6')};function emitEvent(_0xad1619){return function(_0x3cba2b,_0xad09a5,_0x1f09a8){_0x3cba2b[_0xbbc8('0x7')]({'attributes':['id'],'raw':!![]})[_0xbbc8('0x8')](function(_0x128754){_0x3cba2b['setDataValue'](_0xbbc8('0x9'),_0x128754[_0xbbc8('0xa')](function(_0x135c90){return{'id':_0x135c90['id']};}));return MailMessage[_0xbbc8('0xb')]({'where':{'MailInteractionId':_0x3cba2b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbbc8('0x8')](function(_0x2c8335){_0x3cba2b['setDataValue'](_0xbbc8('0xc'),_0x2c8335[_0xbbc8('0xd')]);MailInteractionEvents[_0xbbc8('0xe')](_0xad1619+':'+_0x3cba2b['id'],_0x3cba2b);MailInteractionEvents[_0xbbc8('0xe')](_0xad1619,_0x3cba2b);_0x1f09a8(null);})[_0xbbc8('0xf')](_0x1f09a8(null));};}for(var e in events){if(events[_0xbbc8('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xbbc8('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xadcb=['save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','setMaxListeners'];(function(_0x3a1c4a,_0x243aae){var _0x1d22de=function(_0x25320f){while(--_0x25320f){_0x3a1c4a['push'](_0x3a1c4a['shift']());}};_0x1d22de(++_0x243aae);}(_0xadcb,0x1a5));var _0xbadc=function(_0x3cb193,_0x564ebb){_0x3cb193=_0x3cb193-0x0;var _0x17be40=_0xadcb[_0x3cb193];return _0x17be40;};'use strict';var EventEmitter=require(_0xbadc('0x0'));var MailInteraction=require(_0xbadc('0x1'))['db'][_0xbadc('0x2')];var MailMessage=require(_0xbadc('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbadc('0x3')](0x0);var events={'afterCreate':_0xbadc('0x4'),'afterUpdate':_0xbadc('0x5'),'afterDestroy':_0xbadc('0x6')};function emitEvent(_0x56bf4b){return function(_0x8c5189,_0x24d572,_0x9e6391){_0x8c5189['getUsers']({'attributes':['id'],'raw':!![]})[_0xbadc('0x7')](function(_0x44f979){_0x8c5189[_0xbadc('0x8')]('Users',_0x44f979[_0xbadc('0x9')](function(_0x247bda){return{'id':_0x247bda['id']};}));return MailMessage[_0xbadc('0xa')]({'where':{'MailInteractionId':_0x8c5189['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbadc('0x7')](function(_0xf4e447){_0x8c5189['setDataValue'](_0xbadc('0xb'),_0xf4e447[_0xbadc('0xc')]);MailInteractionEvents[_0xbadc('0xd')](_0x56bf4b+':'+_0x8c5189['id'],_0x8c5189);MailInteractionEvents[_0xbadc('0xd')](_0x56bf4b,_0x8c5189);_0x9e6391(null);})[_0xbadc('0xe')](_0x9e6391(null));};}for(var e in events){if(events[_0xbadc('0xf')](e)){var event=events[e];MailInteraction[_0xbadc('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 5d517bb..b102fd1 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 _0x0a0d=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','substatusAt','changed','closedAt','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0x0a0d,0x74));var _0xd0a0=function(_0x20ae13,_0x2a0c8e){_0x20ae13=_0x20ae13-0x0;var _0x533fd5=_0x0a0d[_0x20ae13];return _0x533fd5;};'use strict';var _=require(_0xd0a0('0x0'));var util=require('util');var logger=require(_0xd0a0('0x1'))(_0xd0a0('0x2'));var moment=require(_0xd0a0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0a0('0x4'));var fs=require('fs');var path=require(_0xd0a0('0x5'));var rimraf=require(_0xd0a0('0x6'));var config=require(_0xd0a0('0x7'));var attributes=require(_0xd0a0('0x8'));module[_0xd0a0('0x9')]=function(_0x211c46,_0x59e65e){return _0x211c46[_0xd0a0('0xa')](_0xd0a0('0xb'),attributes,{'tableName':_0xd0a0('0xc'),'paranoid':![],'indexes':[{'name':_0xd0a0('0xd'),'fields':[_0xd0a0('0xe'),'to'],'type':_0xd0a0('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10f4ff,_0x33f380,_0x28d560){if(_0x10f4ff[_0xd0a0('0x10')]){_0x10f4ff['substatusAt']=moment()[_0xd0a0('0x11')](_0xd0a0('0x12'));}if(_0x10f4ff['closed']){_0x10f4ff['closedAt']=moment()[_0xd0a0('0x11')](_0xd0a0('0x12'));}_0x28d560(null,_0x33f380);},'beforeUpdate':function(_0x5180c3,_0x48700d,_0x5c5d65){if(_0x5180c3['changed'](_0xd0a0('0x10'))){_0x5180c3[_0xd0a0('0x13')]=_0x5180c3[_0xd0a0('0x10')]?moment()[_0xd0a0('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x5180c3[_0xd0a0('0x14')]('closed')){_0x5180c3[_0xd0a0('0x15')]=moment()[_0xd0a0('0x11')](_0xd0a0('0x12'));_0x5180c3[_0xd0a0('0x10')]=null;_0x5180c3['substatusAt']=null;}_0x5c5d65(null,_0x5180c3);},'afterUpdate':function(_0x6fd007,_0x461ff8,_0x4e70f5){var _0x283603=_0x211c46[_0xd0a0('0x16')];var _0x6bd998=_0x6fd007[_0xd0a0('0x17')]({'plain':!![]});if(_0x6bd998['closed']){return _0x283603[_0xd0a0('0x18')][_0xd0a0('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x6bd998['id']}})['then'](function(){_0x4e70f5();})[_0xd0a0('0x1a')](function(_0x469511){_0x4e70f5(_0x469511);});}else{_0x4e70f5();}}},'charset':_0xd0a0('0x1b'),'collate':_0xd0a0('0x1c')});}; \ No newline at end of file +var _0x129d=['./mailInteraction.attributes','exports','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','models','get','update','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x46dfc5,_0x3d27b4){var _0xc1dbb2=function(_0x26187f){while(--_0x26187f){_0x46dfc5['push'](_0x46dfc5['shift']());}};_0xc1dbb2(++_0x3d27b4);}(_0x129d,0x7e));var _0xd129=function(_0x4986aa,_0x3d76e7){_0x4986aa=_0x4986aa-0x0;var _0x33ce8f=_0x129d[_0x4986aa];return _0x33ce8f;};'use strict';var _=require(_0xd129('0x0'));var util=require(_0xd129('0x1'));var logger=require(_0xd129('0x2'))(_0xd129('0x3'));var moment=require(_0xd129('0x4'));var BPromise=require(_0xd129('0x5'));var rp=require(_0xd129('0x6'));var fs=require('fs');var path=require(_0xd129('0x7'));var rimraf=require('rimraf');var config=require(_0xd129('0x8'));var attributes=require(_0xd129('0x9'));module[_0xd129('0xa')]=function(_0x1183d6,_0x5ac90a){return _0x1183d6['define']('MailInteraction',attributes,{'tableName':_0xd129('0xb'),'paranoid':![],'indexes':[{'name':_0xd129('0xc'),'fields':[_0xd129('0xd'),'to'],'type':_0xd129('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c27ab,_0x31def9,_0x5151f1){if(_0x3c27ab[_0xd129('0xf')]){_0x3c27ab['substatusAt']=moment()[_0xd129('0x10')](_0xd129('0x11'));}if(_0x3c27ab[_0xd129('0x12')]){_0x3c27ab[_0xd129('0x13')]=moment()[_0xd129('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5151f1(null,_0x31def9);},'beforeUpdate':function(_0x132caf,_0x58bb27,_0x59a5ef){if(_0x132caf[_0xd129('0x14')]('substatus')){_0x132caf[_0xd129('0x15')]=_0x132caf['substatus']?moment()[_0xd129('0x10')](_0xd129('0x11')):null;}if(_0x132caf[_0xd129('0x14')](_0xd129('0x12'))){_0x132caf['closedAt']=moment()[_0xd129('0x10')](_0xd129('0x11'));_0x132caf[_0xd129('0xf')]=null;_0x132caf['substatusAt']=null;}_0x59a5ef(null,_0x132caf);},'afterUpdate':function(_0x2fb81a,_0x544385,_0x45499f){var _0x4f5c47=_0x1183d6[_0xd129('0x16')];var _0x22aa50=_0x2fb81a[_0xd129('0x17')]({'plain':!![]});if(_0x22aa50[_0xd129('0x12')]){return _0x4f5c47['MailMessage'][_0xd129('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x22aa50['id']}})['then'](function(){_0x45499f();})['catch'](function(_0x3cef5d){_0x45499f(_0x3cef5d);});}else{_0x45499f();}}},'charset':_0xd129('0x19'),'collate':_0xd129('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index de6149a..c1331e9 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 _0x4434=['MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','MailInteraction','update','body','options','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','addTags','omit','ids','spread','info','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x416140,_0x5ecf51){var _0x40f96f=function(_0x484c07){while(--_0x484c07){_0x416140['push'](_0x416140['shift']());}};_0x40f96f(++_0x5ecf51);}(_0x4434,0xb4));var _0x4443=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4434[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4443('0x0'));var util=require(_0x4443('0x1'));var moment=require(_0x4443('0x2'));var BPromise=require(_0x4443('0x3'));var rs=require(_0x4443('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4443('0x5'))['db'];var utils=require(_0x4443('0x6'));var logger=require('../../config/logger')(_0x4443('0x7'));var config=require(_0x4443('0x8'));var jayson=require(_0x4443('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x4443('0xa')]=_[_0x4443('0xb')](config['redis'],{'host':_0x4443('0xc'),'port':0x18eb});var socket=require(_0x4443('0xd'))(new Redis(config[_0x4443('0xa')]));require(_0x4443('0xe'))[_0x4443('0xf')](socket);function respondWithRpcPromise(_0x459b44,_0x27a835,_0x4d26a5){return new BPromise(function(_0x48971e,_0x28d628){return client['request'](_0x459b44,_0x4d26a5)[_0x4443('0x10')](function(_0xe5f5e6){logger['info'](_0x4443('0x11'),_0x27a835,_0x4443('0x12'));logger[_0x4443('0x13')](_0x4443('0x14'),_0x27a835,_0x4443('0x12'),JSON[_0x4443('0x15')](_0xe5f5e6));if(_0xe5f5e6[_0x4443('0x16')]){if(_0xe5f5e6[_0x4443('0x16')]['code']===0x1f4){logger[_0x4443('0x16')]('MailInteraction,\x20%s,\x20%s',_0x27a835,_0xe5f5e6[_0x4443('0x16')][_0x4443('0x17')]);return _0x28d628(_0xe5f5e6['error']['message']);}logger[_0x4443('0x16')](_0x4443('0x11'),_0x27a835,_0xe5f5e6[_0x4443('0x16')][_0x4443('0x17')]);return _0x48971e(_0xe5f5e6[_0x4443('0x16')][_0x4443('0x17')]);}else{logger['info'](_0x4443('0x11'),_0x27a835,_0x4443('0x12'));_0x48971e(_0xe5f5e6['result'][_0x4443('0x17')]);}})[_0x4443('0x18')](function(_0x561f03){logger[_0x4443('0x16')]('MailInteraction,\x20%s,\x20%s',_0x27a835,_0x561f03);_0x28d628(_0x561f03);});});}exports['UpdateMailInteraction']=function(_0x2d339b){var _0x3bc2ca=this;return new Promise(function(_0x5310ba,_0x46b9ae){return db[_0x4443('0x19')][_0x4443('0x1a')](_0x2d339b[_0x4443('0x1b')],{'raw':_0x2d339b[_0x4443('0x1c')]?_0x2d339b[_0x4443('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d339b[_0x4443('0x1c')]?_0x2d339b[_0x4443('0x1c')][_0x4443('0x1d')]||null:null,'attributes':_0x2d339b[_0x4443('0x1c')]?_0x2d339b['options'][_0x4443('0x1e')]||null:null,'limit':_0x2d339b[_0x4443('0x1c')]?_0x2d339b['options'][_0x4443('0x1f')]||null:null})[_0x4443('0x10')](function(_0x1fb221){logger['info'](_0x4443('0x20'),_0x2d339b);logger[_0x4443('0x13')](_0x4443('0x20'),_0x2d339b,JSON[_0x4443('0x15')](_0x1fb221));_0x5310ba(_0x1fb221);})[_0x4443('0x18')](function(_0x1cfa87){logger[_0x4443('0x16')](_0x4443('0x20'),_0x1cfa87[_0x4443('0x17')],_0x2d339b);_0x46b9ae(_0x3bc2ca[_0x4443('0x16')](0x1f4,_0x1cfa87[_0x4443('0x17')]));});});};exports[_0x4443('0x21')]=function(_0x45b71e){return new Promise(function(_0x4ae20e,_0xe622fc){return db[_0x4443('0x19')]['find']({'where':_0x45b71e['options']?_0x45b71e[_0x4443('0x1c')][_0x4443('0x1d')]||null:null})[_0x4443('0x10')](function(_0x56506f){if(_0x56506f){return _0x56506f[_0x4443('0x22')](_0x45b71e['body']['ids'],_[_0x4443('0x23')](_0x45b71e[_0x4443('0x1b')],[_0x4443('0x24'),'id'])||{});}})[_0x4443('0x25')](function(_0x5d85fa){logger[_0x4443('0x26')](_0x4443('0x27'),_0x45b71e);logger[_0x4443('0x13')](_0x4443('0x27'),_0x45b71e,JSON['stringify'](_0x5d85fa));_0x4ae20e(_0x5d85fa);})[_0x4443('0x18')](function(_0x2e7fda){logger[_0x4443('0x16')]('AddTags',_0x2e7fda[_0x4443('0x17')],_0x45b71e);_0xe622fc(_this[_0x4443('0x16')](0x1f4,_0x2e7fda[_0x4443('0x17')]));});});}; \ No newline at end of file +var _0xc213=['info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','where','AddTagsToMailInteraction','find','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','then'];(function(_0x45f10b,_0x3c75dc){var _0x7d13e0=function(_0x85381d){while(--_0x85381d){_0x45f10b['push'](_0x45f10b['shift']());}};_0x7d13e0(++_0x3c75dc);}(_0xc213,0x19b));var _0x3c21=function(_0x3882f7,_0x458889){_0x3882f7=_0x3882f7-0x0;var _0x5af714=_0xc213[_0x3882f7];return _0x5af714;};'use strict';var _=require(_0x3c21('0x0'));var util=require(_0x3c21('0x1'));var moment=require(_0x3c21('0x2'));var BPromise=require(_0x3c21('0x3'));var rs=require(_0x3c21('0x4'));var fs=require('fs');var Redis=require(_0x3c21('0x5'));var db=require(_0x3c21('0x6'))['db'];var utils=require(_0x3c21('0x7'));var logger=require(_0x3c21('0x8'))(_0x3c21('0x9'));var config=require('../../config/environment');var jayson=require(_0x3c21('0xa'));var client=jayson[_0x3c21('0xb')][_0x3c21('0xc')]({'port':0x232a});config[_0x3c21('0xd')]=_['defaults'](config[_0x3c21('0xd')],{'host':_0x3c21('0xe'),'port':0x18eb});var socket=require(_0x3c21('0xf'))(new Redis(config[_0x3c21('0xd')]));require(_0x3c21('0x10'))['register'](socket);function respondWithRpcPromise(_0x163e96,_0x479a9b,_0xf6753){return new BPromise(function(_0x3edd70,_0x40bdd4){return client['request'](_0x163e96,_0xf6753)[_0x3c21('0x11')](function(_0x43abbc){logger[_0x3c21('0x12')](_0x3c21('0x13'),_0x479a9b,'request\x20sent');logger[_0x3c21('0x14')](_0x3c21('0x15'),_0x479a9b,_0x3c21('0x16'),JSON[_0x3c21('0x17')](_0x43abbc));if(_0x43abbc['error']){if(_0x43abbc['error'][_0x3c21('0x18')]===0x1f4){logger[_0x3c21('0x19')](_0x3c21('0x13'),_0x479a9b,_0x43abbc[_0x3c21('0x19')][_0x3c21('0x1a')]);return _0x40bdd4(_0x43abbc[_0x3c21('0x19')]['message']);}logger['error'](_0x3c21('0x13'),_0x479a9b,_0x43abbc[_0x3c21('0x19')]['message']);return _0x3edd70(_0x43abbc[_0x3c21('0x19')][_0x3c21('0x1a')]);}else{logger[_0x3c21('0x12')](_0x3c21('0x13'),_0x479a9b,_0x3c21('0x16'));_0x3edd70(_0x43abbc[_0x3c21('0x1b')][_0x3c21('0x1a')]);}})[_0x3c21('0x1c')](function(_0x411536){logger[_0x3c21('0x19')](_0x3c21('0x13'),_0x479a9b,_0x411536);_0x40bdd4(_0x411536);});});}exports[_0x3c21('0x1d')]=function(_0xd90ef5){var _0x254111=this;return new Promise(function(_0x2b83d7,_0x426a45){return db[_0x3c21('0x1e')][_0x3c21('0x1f')](_0xd90ef5['body'],{'raw':_0xd90ef5[_0x3c21('0x20')]?_0xd90ef5[_0x3c21('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd90ef5[_0x3c21('0x20')]?_0xd90ef5[_0x3c21('0x20')][_0x3c21('0x21')]||null:null,'attributes':_0xd90ef5[_0x3c21('0x20')]?_0xd90ef5[_0x3c21('0x20')]['attributes']||null:null,'limit':_0xd90ef5[_0x3c21('0x20')]?_0xd90ef5[_0x3c21('0x20')]['limit']||null:null})[_0x3c21('0x11')](function(_0x22304c){logger[_0x3c21('0x12')]('UpdateMailInteraction',_0xd90ef5);logger[_0x3c21('0x14')]('UpdateMailInteraction',_0xd90ef5,JSON[_0x3c21('0x17')](_0x22304c));_0x2b83d7(_0x22304c);})['catch'](function(_0x563ea0){logger['error'](_0x3c21('0x1d'),_0x563ea0[_0x3c21('0x1a')],_0xd90ef5);_0x426a45(_0x254111[_0x3c21('0x19')](0x1f4,_0x563ea0[_0x3c21('0x1a')]));});});};exports[_0x3c21('0x22')]=function(_0x213564){return new Promise(function(_0x2cbe05,_0x9550b7){return db['MailInteraction'][_0x3c21('0x23')]({'where':_0x213564[_0x3c21('0x20')]?_0x213564[_0x3c21('0x20')][_0x3c21('0x21')]||null:null})['then'](function(_0x3d543a){if(_0x3d543a){return _0x3d543a['addTags'](_0x213564['body'][_0x3c21('0x24')],_['omit'](_0x213564['body'],[_0x3c21('0x24'),'id'])||{});}})[_0x3c21('0x25')](function(_0xf1a602){logger['info'](_0x3c21('0x26'),_0x213564);logger[_0x3c21('0x14')](_0x3c21('0x26'),_0x213564,JSON[_0x3c21('0x17')](_0xf1a602));_0x2cbe05(_0xf1a602);})['catch'](function(_0x498097){logger[_0x3c21('0x19')](_0x3c21('0x26'),_0x498097[_0x3c21('0x1a')],_0x213564);_0x9550b7(_this[_0x3c21('0x19')](0x1f4,_0x498097['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 87aac32..2df749e 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 _0x8c60=['remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x16a317,_0x43d3f7){var _0x1ef1cf=function(_0x35baff){while(--_0x35baff){_0x16a317['push'](_0x16a317['shift']());}};_0x1ef1cf(++_0x43d3f7);}(_0x8c60,0x12f));var _0x08c6=function(_0x116173,_0xba6cb7){_0x116173=_0x116173-0x0;var _0x531334=_0x8c60[_0x116173];return _0x531334;};'use strict';var MailInteractionEvents=require(_0x08c6('0x0'));var events=['save',_0x08c6('0x1'),_0x08c6('0x2')];function createListener(_0x41d5b2,_0x34305c){return function(_0xf8038e){_0x34305c[_0x08c6('0x3')](_0x41d5b2,_0xf8038e);};}function removeListener(_0x497228,_0x4d3da9){return function(){MailInteractionEvents[_0x08c6('0x4')](_0x497228,_0x4d3da9);};}exports[_0x08c6('0x5')]=function(_0x4e25a3){for(var _0x17302d=0x0,_0x406e73=events[_0x08c6('0x6')];_0x17302d<_0x406e73;_0x17302d++){var _0x276c40=events[_0x17302d];var _0x11ba99=createListener(_0x08c6('0x7')+_0x276c40,_0x4e25a3);MailInteractionEvents['on'](_0x276c40,_0x11ba99);}}; \ No newline at end of file +var _0x6fc9=['register','length','mailInteraction:','./mailInteraction.events','remove','update','emit','removeListener'];(function(_0x5b96db,_0x410f91){var _0x39b26c=function(_0x511db6){while(--_0x511db6){_0x5b96db['push'](_0x5b96db['shift']());}};_0x39b26c(++_0x410f91);}(_0x6fc9,0x193));var _0x96fc=function(_0x40f33c,_0x27df83){_0x40f33c=_0x40f33c-0x0;var _0x1f9ef3=_0x6fc9[_0x40f33c];return _0x1f9ef3;};'use strict';var MailInteractionEvents=require(_0x96fc('0x0'));var events=['save',_0x96fc('0x1'),_0x96fc('0x2')];function createListener(_0x89ab59,_0x588f74){return function(_0x54efe5){_0x588f74[_0x96fc('0x3')](_0x89ab59,_0x54efe5);};}function removeListener(_0x5c7e2c,_0x3fcaa8){return function(){MailInteractionEvents[_0x96fc('0x4')](_0x5c7e2c,_0x3fcaa8);};}exports[_0x96fc('0x5')]=function(_0x30e44b){for(var _0xf182c0=0x0,_0x192e8e=events[_0x96fc('0x6')];_0xf182c0<_0x192e8e;_0xf182c0++){var _0x59d3fd=events[_0xf182c0];var _0x20d90f=createListener(_0x96fc('0x7')+_0x59d3fd,_0x30e44b);MailInteractionEvents['on'](_0x59d3fd,_0x20d90f);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 22e5318..a5182ed 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 _0xb11e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','/describe','get','/:id','/:id/download','download','post','tracked','mail','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xb11e,0x7d));var _0xeb11=function(_0x23edb7,_0x190bbd){_0x23edb7=_0x23edb7-0x0;var _0x116de2=_0xb11e[_0x23edb7];return _0x116de2;};'use strict';var multer=require(_0xeb11('0x0'));var util=require(_0xeb11('0x1'));var path=require(_0xeb11('0x2'));var timeout=require(_0xeb11('0x3'));var express=require(_0xeb11('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeb11('0x5'));var interaction=require(_0xeb11('0x6'));var config=require(_0xeb11('0x7'));var controller=require(_0xeb11('0x8'));router['get']('/',auth[_0xeb11('0x9')](),controller['index']);router['get'](_0xeb11('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xeb11('0xb')](_0xeb11('0xc'),auth[_0xeb11('0x9')](),controller['show']);router[_0xeb11('0xb')](_0xeb11('0xd'),auth[_0xeb11('0x9')](),controller[_0xeb11('0xe')]);router[_0xeb11('0xf')]('/',auth[_0xeb11('0x9')](),interaction[_0xeb11('0x10')](_0xeb11('0x11'),'mailmessage:create'),controller[_0xeb11('0x12')]);router[_0xeb11('0x13')](_0xeb11('0xc'),auth['isAuthenticated'](),controller[_0xeb11('0x14')]);router['put'](_0xeb11('0x15'),auth['isAuthenticated'](),controller['accept']);router[_0xeb11('0x13')](_0xeb11('0x16'),auth[_0xeb11('0x9')](),controller[_0xeb11('0x17')]);router['delete']('/:id',auth[_0xeb11('0x9')](),controller[_0xeb11('0x18')]);module[_0xeb11('0x19')]=router; \ No newline at end of file +var _0xaf4c=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','get','/describe','describe','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','put','update','/:id/accept','accept','delete','destroy','exports','util'];(function(_0x61530d,_0x102877){var _0x1edc96=function(_0x283efc){while(--_0x283efc){_0x61530d['push'](_0x61530d['shift']());}};_0x1edc96(++_0x102877);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x5dfe1b,_0x30ea31){_0x5dfe1b=_0x5dfe1b-0x0;var _0x4fdf59=_0xaf4c[_0x5dfe1b];return _0x4fdf59;};'use strict';var multer=require('multer');var util=require(_0xcaf4('0x0'));var path=require(_0xcaf4('0x1'));var timeout=require('connect-timeout');var express=require(_0xcaf4('0x2'));var router=express[_0xcaf4('0x3')]();var fs_extra=require(_0xcaf4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var controller=require(_0xcaf4('0x7'));router['get']('/',auth[_0xcaf4('0x8')](),controller['index']);router[_0xcaf4('0x9')](_0xcaf4('0xa'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0xb')]);router[_0xcaf4('0x9')](_0xcaf4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xcaf4('0x9')](_0xcaf4('0xd'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0xe')]);router[_0xcaf4('0xf')]('/',auth[_0xcaf4('0x8')](),interaction[_0xcaf4('0x10')](_0xcaf4('0x11'),_0xcaf4('0x12')),controller['create']);router[_0xcaf4('0x13')](_0xcaf4('0xc'),auth['isAuthenticated'](),controller[_0xcaf4('0x14')]);router[_0xcaf4('0x13')](_0xcaf4('0x15'),auth['isAuthenticated'](),controller[_0xcaf4('0x16')]);router[_0xcaf4('0x13')]('/:id/reject',auth[_0xcaf4('0x8')](),controller['reject']);router[_0xcaf4('0x17')](_0xcaf4('0xc'),auth[_0xcaf4('0x8')](),controller[_0xcaf4('0x18')]);module[_0xcaf4('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 8a23b56..e328998 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 _0xe83a=['DATE','ENUM','Chat','Email','sequelize','long','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x3ad656,_0x2dfe96){var _0x4540c4=function(_0x3093b0){while(--_0x3093b0){_0x3ad656['push'](_0x3ad656['shift']());}};_0x4540c4(++_0x2dfe96);}(_0xe83a,0x1e8));var _0xae83=function(_0x4f4679,_0x713087){_0x4f4679=_0x4f4679-0x0;var _0x2f7cd0=_0xe83a[_0x4f4679];return _0x2f7cd0;};'use strict';var Sequelize=require(_0xae83('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize['TEXT'](_0xae83('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xae83('0x2')](_0xae83('0x3'))},'read':{'type':Sequelize[_0xae83('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xae83('0x5')),'defaultValue':_0xae83('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xae83('0x6')](0x1fe)},'from':{'type':Sequelize[_0xae83('0x6')]},'to':{'type':Sequelize[_0xae83('0x2')](_0xae83('0x1'))},'cc':{'type':Sequelize[_0xae83('0x2')](_0xae83('0x1'))},'bcc':{'type':Sequelize['TEXT'](_0xae83('0x1'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xae83('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xae83('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xae83('0x7')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize['TEXT'](_0xae83('0x1'))},'originChannel':{'type':Sequelize[_0xae83('0x8')]('Email',_0xae83('0x9')),'defaultValue':_0xae83('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xb1de=['sequelize','lodash','exports','TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email'];(function(_0xedbef7,_0x58443e){var _0x50d4fa=function(_0x5c61bd){while(--_0x5c61bd){_0xedbef7['push'](_0xedbef7['shift']());}};_0x50d4fa(++_0x58443e);}(_0xb1de,0x82));var _0xeb1d=function(_0x27a230,_0x3714e4){_0x27a230=_0x27a230-0x0;var _0x583ce7=_0xb1de[_0x27a230];return _0x583ce7;};'use strict';var Sequelize=require(_0xeb1d('0x0'));var _=require(_0xeb1d('0x1'));module[_0xeb1d('0x2')]={'body':{'type':Sequelize[_0xeb1d('0x3')](_0xeb1d('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xeb1d('0x3')](_0xeb1d('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xeb1d('0x6')]('in',_0xeb1d('0x7')),'defaultValue':_0xeb1d('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xeb1d('0x8')]},'to':{'type':Sequelize[_0xeb1d('0x3')]('long')},'cc':{'type':Sequelize[_0xeb1d('0x3')]('long')},'bcc':{'type':Sequelize[_0xeb1d('0x3')](_0xeb1d('0x4'))},'subject':{'type':Sequelize[_0xeb1d('0x3')]},'sentAt':{'type':Sequelize[_0xeb1d('0x9')]},'attach':{'type':Sequelize[_0xeb1d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xeb1d('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xeb1d('0x9')]},'originTo':{'type':Sequelize[_0xeb1d('0x3')](_0xeb1d('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xeb1d('0x4'))},'originChannel':{'type':Sequelize[_0xeb1d('0x6')](_0xeb1d('0xc'),'Chat'),'defaultValue':_0xeb1d('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c53a605..0454fb8 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 _0xa293=['fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','find','body','destroy','describe','create','direction','out','secret','split','findOne','CmList','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','user','auth','pass','attachments','join','root','basename','List','CmContact','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','mail','readAt','agent','UserId','get','MailInteraction','MailInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','role','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','QueryTypes','reject','fromString','rejectmessage','download','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','jayson/promise','http','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','catch','json','limit','undefined','count','offset','status','Content-Range','update','end','sendStatus','send','index','map','MailMessage'];(function(_0x33aa2e,_0x1a4565){var _0x3e4c5d=function(_0x345080){while(--_0x345080){_0x33aa2e['push'](_0x33aa2e['shift']());}};_0x3e4c5d(++_0x1a4565);}(_0xa293,0x117));var _0x3a29=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa293[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x3a29('0x0'));var moment=require(_0x3a29('0x1'));var BPromise=require(_0x3a29('0x2'));var util=require(_0x3a29('0x3'));var path=require(_0x3a29('0x4'));var fs=require('fs');var _=require(_0x3a29('0x5'));var Redis=require(_0x3a29('0x6'));var htmlToText=require(_0x3a29('0x7'));var qs=require(_0x3a29('0x8'));var logger=require(_0x3a29('0x9'))('api');var interaction_log=require(_0x3a29('0x9'))(_0x3a29('0xa'));var config=require(_0x3a29('0xb'));var db=require(_0x3a29('0xc'))['db'];config[_0x3a29('0xd')]=_[_0x3a29('0xe')](config[_0x3a29('0xd')],{'host':_0x3a29('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a29('0xd')]));require(_0x3a29('0x10'))['register'](socket);var jayson=require(_0x3a29('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson['client'][_0x3a29('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x3a29('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2f8e0d,_0x7923c3,_0x54f4d4,_0x2f506e){return new BPromise(function(_0x2a1190,_0x58f371){var _0x45e91c=_0x2f506e||client;return _0x45e91c['request'](_0x2f8e0d,_0x54f4d4)[_0x3a29('0x13')](function(_0x1f09b9){logger[_0x3a29('0x14')]('MailMessage,\x20%s,\x20%s',_0x7923c3,_0x3a29('0x15'));logger[_0x3a29('0x16')](_0x3a29('0x17'),_0x7923c3,_0x3a29('0x15'),JSON[_0x3a29('0x18')](_0x1f09b9));if(_0x1f09b9[_0x3a29('0x19')]){if(_0x1f09b9[_0x3a29('0x19')]['code']===0x1f4){logger['error'](_0x3a29('0x1a'),_0x7923c3,_0x1f09b9[_0x3a29('0x19')][_0x3a29('0x1b')]);return _0x58f371(_0x1f09b9[_0x3a29('0x19')]['message']);}logger[_0x3a29('0x19')](_0x3a29('0x1a'),_0x7923c3,_0x1f09b9[_0x3a29('0x19')][_0x3a29('0x1b')]);return _0x2a1190(_0x1f09b9[_0x3a29('0x19')][_0x3a29('0x1b')]);}else{logger[_0x3a29('0x14')](_0x3a29('0x1a'),_0x7923c3,'request\x20sent');_0x2a1190(_0x1f09b9['result'][_0x3a29('0x1b')]);}})[_0x3a29('0x1c')](function(_0x350891){logger[_0x3a29('0x19')](_0x3a29('0x1a'),_0x7923c3,_0x350891);_0x58f371(_0x350891);});});}function respondWithResult(_0x3b68bf,_0x7d935){_0x7d935=_0x7d935||0xc8;return function(_0x24abc3){if(_0x24abc3){return _0x3b68bf['status'](_0x7d935)[_0x3a29('0x1d')](_0x24abc3);}};}function respondWithFilteredResult(_0x367133,_0x5bc3a1){return function(_0x2d9e0c){if(_0x2d9e0c){var _0x2aac13=typeof _0x5bc3a1['offset']==='undefined'&&typeof _0x5bc3a1[_0x3a29('0x1e')]===_0x3a29('0x1f');var _0x305075=_0x2d9e0c[_0x3a29('0x20')];var _0x3a6660=_0x2aac13?0x0:_0x5bc3a1[_0x3a29('0x21')];var _0x389294=_0x2aac13?_0x2d9e0c['count']:_0x5bc3a1[_0x3a29('0x21')]+_0x5bc3a1[_0x3a29('0x1e')];var _0x49fda8;if(_0x389294>=_0x305075){_0x389294=_0x305075;_0x49fda8=0xc8;}else{_0x49fda8=0xce;}_0x367133[_0x3a29('0x22')](_0x49fda8);return _0x367133['set'](_0x3a29('0x23'),_0x3a6660+'-'+_0x389294+'/'+_0x305075)[_0x3a29('0x1d')](_0x2d9e0c);}return null;};}function saveUpdates(_0x12f6f1){return function(_0x5ca514){if(_0x5ca514){return _0x5ca514[_0x3a29('0x24')](_0x12f6f1)[_0x3a29('0x13')](function(_0x2d01bc){return _0x2d01bc;});}return null;};}function removeEntity(_0xd8b94d){return function(_0x296736){if(_0x296736){return _0x296736['destroy']()[_0x3a29('0x13')](function(){_0xd8b94d[_0x3a29('0x22')](0xcc)[_0x3a29('0x25')]();});}};}function handleEntityNotFound(_0x2d0f40){return function(_0x5f031c){if(!_0x5f031c){_0x2d0f40[_0x3a29('0x26')](0x194);}return _0x5f031c;};}function handleError(_0x642a1c,_0x42a42e){_0x42a42e=_0x42a42e||0x1f4;return function(_0xb6f56c){logger[_0x3a29('0x19')](_0xb6f56c['stack']);if(_0xb6f56c['name']){delete _0xb6f56c['name'];}_0x642a1c[_0x3a29('0x22')](_0x42a42e)[_0x3a29('0x27')](_0xb6f56c);};}exports[_0x3a29('0x28')]=function(_0xd50740,_0x26558e){var _0x4f7d36={},_0x3edad8={},_0x489beb={'count':0x0,'rows':[]};var _0x355c51=_[_0x3a29('0x29')](db[_0x3a29('0x2a')]['rawAttributes'],function(_0x3246aa){return{'name':_0x3246aa[_0x3a29('0x2b')],'type':_0x3246aa[_0x3a29('0x2c')][_0x3a29('0x2d')]};});_0x3edad8[_0x3a29('0x2e')]=_[_0x3a29('0x29')](_0x355c51,_0x3a29('0x2f'));_0x3edad8[_0x3a29('0x30')]=_[_0x3a29('0x31')](_0xd50740['query']);_0x3edad8[_0x3a29('0x32')]=_[_0x3a29('0x33')](_0x3edad8['model'],_0x3edad8[_0x3a29('0x30')]);_0x4f7d36[_0x3a29('0x34')]=_[_0x3a29('0x33')](_0x3edad8['model'],qs[_0x3a29('0x35')](_0xd50740[_0x3a29('0x30')][_0x3a29('0x35')]));_0x4f7d36['attributes']=_0x4f7d36[_0x3a29('0x34')][_0x3a29('0x36')]?_0x4f7d36['attributes']:_0x3edad8[_0x3a29('0x2e')];if(!_0xd50740['query'][_0x3a29('0x37')](_0x3a29('0x38'))){_0x4f7d36[_0x3a29('0x1e')]=qs[_0x3a29('0x1e')](_0xd50740[_0x3a29('0x30')]['limit']);_0x4f7d36[_0x3a29('0x21')]=qs[_0x3a29('0x21')](_0xd50740[_0x3a29('0x30')][_0x3a29('0x21')]);}_0x4f7d36['order']=qs[_0x3a29('0x39')](_0xd50740[_0x3a29('0x30')][_0x3a29('0x39')]);_0x4f7d36[_0x3a29('0x3a')]=qs['filters'](_[_0x3a29('0x3b')](_0xd50740[_0x3a29('0x30')],_0x3edad8[_0x3a29('0x32')]),_0x355c51);if(_0xd50740[_0x3a29('0x30')][_0x3a29('0x3c')]){_0x4f7d36[_0x3a29('0x3a')]=_[_0x3a29('0x3d')](_0x4f7d36[_0x3a29('0x3a')],{'$or':_[_0x3a29('0x29')](_0x355c51,function(_0x511847){if(_0x511847['type']!==_0x3a29('0x3e')){var _0x2ce3f6={};_0x2ce3f6[_0x511847[_0x3a29('0x2f')]]={'$like':'%'+_0xd50740['query'][_0x3a29('0x3c')]+'%'};return _0x2ce3f6;}})});}_0x4f7d36=_['merge']({},_0x4f7d36,_0xd50740[_0x3a29('0x3f')]);var _0xfe0cd3={'where':_0x4f7d36[_0x3a29('0x3a')]};return db[_0x3a29('0x2a')][_0x3a29('0x20')](_0xfe0cd3)[_0x3a29('0x13')](function(_0x264dab){_0x489beb[_0x3a29('0x20')]=_0x264dab;if(_0xd50740[_0x3a29('0x30')][_0x3a29('0x40')]){_0x4f7d36[_0x3a29('0x41')]=[{'all':!![]}];}return db['MailMessage'][_0x3a29('0x42')](_0x4f7d36);})[_0x3a29('0x13')](function(_0x126bc1){_0x489beb['rows']=_0x126bc1;return _0x489beb;})[_0x3a29('0x13')](respondWithFilteredResult(_0x26558e,_0x4f7d36))[_0x3a29('0x1c')](handleError(_0x26558e,null));};exports['show']=function(_0x11ee19,_0x2e9646){var _0x527413={'raw':!![],'where':{'id':_0x11ee19[_0x3a29('0x43')]['id']}},_0x133bbf={};_0x133bbf[_0x3a29('0x2e')]=_[_0x3a29('0x31')](db[_0x3a29('0x2a')][_0x3a29('0x44')]);_0x133bbf['query']=_['keys'](_0x11ee19[_0x3a29('0x30')]);_0x133bbf[_0x3a29('0x32')]=_[_0x3a29('0x33')](_0x133bbf['model'],_0x133bbf[_0x3a29('0x30')]);_0x527413[_0x3a29('0x34')]=_[_0x3a29('0x33')](_0x133bbf[_0x3a29('0x2e')],qs['fields'](_0x11ee19[_0x3a29('0x30')][_0x3a29('0x35')]));_0x527413[_0x3a29('0x34')]=_0x527413[_0x3a29('0x34')][_0x3a29('0x36')]?_0x527413['attributes']:_0x133bbf[_0x3a29('0x2e')];if(_0x11ee19[_0x3a29('0x30')][_0x3a29('0x40')]){_0x527413[_0x3a29('0x41')]=[{'all':!![]}];}_0x527413=_['merge']({},_0x527413,_0x11ee19[_0x3a29('0x3f')]);return db[_0x3a29('0x2a')][_0x3a29('0x45')](_0x527413)[_0x3a29('0x13')](handleEntityNotFound(_0x2e9646,null))['then'](respondWithResult(_0x2e9646,null))[_0x3a29('0x1c')](handleError(_0x2e9646,null));};exports[_0x3a29('0x24')]=function(_0x1e5350,_0x20bbd8){if(_0x1e5350[_0x3a29('0x46')]['id']){delete _0x1e5350[_0x3a29('0x46')]['id'];}return db['MailMessage'][_0x3a29('0x45')]({'where':{'id':_0x1e5350[_0x3a29('0x43')]['id']}})['then'](handleEntityNotFound(_0x20bbd8,null))[_0x3a29('0x13')](saveUpdates(_0x1e5350[_0x3a29('0x46')],null))[_0x3a29('0x13')](respondWithResult(_0x20bbd8,null))[_0x3a29('0x1c')](handleError(_0x20bbd8,null));};exports[_0x3a29('0x47')]=function(_0x994876,_0x2de45c){return db['MailMessage'][_0x3a29('0x45')]({'where':{'id':_0x994876[_0x3a29('0x43')]['id']}})[_0x3a29('0x13')](handleEntityNotFound(_0x2de45c,null))[_0x3a29('0x13')](removeEntity(_0x2de45c,null))['catch'](handleError(_0x2de45c,null));};exports['describe']=function(_0x17b1fd,_0x396fc9){return db[_0x3a29('0x2a')][_0x3a29('0x48')]()['then'](respondWithResult(_0x396fc9,null))[_0x3a29('0x1c')](handleError(_0x396fc9,null));};exports[_0x3a29('0x49')]=function(_0x2466f5,_0x3f125f){return db['MailMessage']['create'](_0x2466f5['body'])[_0x3a29('0x13')](function(_0x346874){if(_0x346874){if(_0x346874[_0x3a29('0x4a')]===_0x3a29('0x4b')&&!_0x346874[_0x3a29('0x4c')]){var _0x291a4c,_0x589dca,_0x19ac5e;if(_0x2466f5[_0x3a29('0x46')]['to']){_0x589dca=_0x2466f5[_0x3a29('0x46')]['to'][_0x3a29('0x4d')](',')[0x0];}return db['MailAccount'][_0x3a29('0x4e')]({'where':{'id':_0x346874['MailAccountId']},'include':[{'model':db[_0x3a29('0x4f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x3a29('0x50'),'where':{'email':_0x589dca},'limit':0x1,'order':[[_0x3a29('0x51'),_0x3a29('0x52')]]}]},{'model':db['MailServerOut'],'as':_0x3a29('0x53'),'raw':!![]}]})[_0x3a29('0x13')](function(_0x5282fd){_0x291a4c=_0x5282fd;if(_0x291a4c&&_0x291a4c[_0x3a29('0x53')]){var _0x40e151={'tls':{'rejectUnauthorized':![]}};if(_[_0x3a29('0x54')](_0x291a4c[_0x3a29('0x53')][_0x3a29('0x55')])){_0x40e151[_0x3a29('0x56')]=_0x291a4c[_0x3a29('0x53')]['host'];_0x40e151[_0x3a29('0x57')]=_0x291a4c[_0x3a29('0x53')]['port'];_0x40e151[_0x3a29('0x58')]=_0x291a4c['Smtp'][_0x3a29('0x58')];if(_0x291a4c['Smtp'][_0x3a29('0x59')]){_0x40e151['auth']={'user':_0x291a4c['Smtp'][_0x3a29('0x5a')],'pass':_0x291a4c[_0x3a29('0x53')]['pass']};}}else{_0x40e151[_0x3a29('0x55')]=_0x291a4c[_0x3a29('0x53')][_0x3a29('0x55')];_0x40e151[_0x3a29('0x5b')]={'user':_0x291a4c['Smtp']['user'],'pass':_0x291a4c[_0x3a29('0x53')][_0x3a29('0x5c')]};_0x40e151[_0x3a29('0x58')]=_0x291a4c[_0x3a29('0x53')][_0x3a29('0x58')];}if(_0x2466f5[_0x3a29('0x46')]['attachments']&&_0x2466f5[_0x3a29('0x46')]['attachments'][_0x3a29('0x36')]){for(var _0x2c1247=0x0;_0x2c1247<_0x2466f5[_0x3a29('0x46')][_0x3a29('0x5d')][_0x3a29('0x36')];_0x2c1247+=0x1){_0x2466f5['body'][_0x3a29('0x5d')][_0x2c1247]={'filename':_0x2466f5[_0x3a29('0x46')]['attachments'][_0x2c1247][_0x3a29('0x2f')],'path':path[_0x3a29('0x5e')](config[_0x3a29('0x5f')],'server/files/attachments',_0x2466f5[_0x3a29('0x46')][_0x3a29('0x5d')][_0x2c1247][_0x3a29('0x60')])};}}_0x19ac5e={'account':_0x40e151,'message':_0x2466f5[_0x3a29('0x46')]};return;}})[_0x3a29('0x13')](function(){if(_0x291a4c[_0x3a29('0x61')]){if(_0x291a4c['List'][_0x3a29('0x50')][_0x3a29('0x36')]){return _0x291a4c[_0x3a29('0x61')][_0x3a29('0x50')][0x0];}else{return db[_0x3a29('0x62')][_0x3a29('0x49')](_[_0x3a29('0xe')](_0x2466f5[_0x3a29('0x46')],{'firstName':_0x2466f5[_0x3a29('0x46')]['to'],'email':_0x2466f5[_0x3a29('0x46')]['to'],'phone':_0x2466f5['body']['to'],'ListId':_0x291a4c[_0x3a29('0x63')]}));}}else{throw new Error(_0x3a29('0x64'));}})[_0x3a29('0x13')](function(){if(_0x19ac5e){return respondWithRpcPromise(_0x3a29('0x65'),_0x3a29('0x66'),_0x19ac5e,client9003)[_0x3a29('0x13')](function(_0x359865){return _0x346874['update']({'read':!![],'messageId':_0x359865[_0x3a29('0x67')],'sentAt':moment()[_0x3a29('0x68')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x3a29('0x1c')](function(_0x11025b){logger['error']('%s',JSON[_0x3a29('0x18')](_0x11025b));return _0x346874;});}return _0x346874;});}return _0x346874;}})[_0x3a29('0x13')](respondWithResult(_0x3f125f,0xc9))[_0x3a29('0x1c')](handleError(_0x3f125f,null));};exports[_0x3a29('0x69')]=function(_0x522671,_0x416f18){var _0x549859={'agent':{},'channel':_0x3a29('0x6a')};if(_0x522671[_0x3a29('0x46')]['id']){delete _0x522671[_0x3a29('0x46')]['id'];}_0x522671[_0x3a29('0x46')]['read']=!![];_0x522671['body'][_0x3a29('0x6b')]=moment()[_0x3a29('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x522671['body']['UserId']=_0x522671['body']['UserId']||_0x522671['user']['id'];_0x549859[_0x3a29('0x6c')]['id']=_0x522671[_0x3a29('0x46')][_0x3a29('0x6d')];return db[_0x3a29('0x2a')]['find']({'where':{'id':_0x522671['params']['id'],'UserId':null}})[_0x3a29('0x13')](handleEntityNotFound(_0x416f18,null))[_0x3a29('0x13')](saveUpdates(_0x522671[_0x3a29('0x46')],null))[_0x3a29('0x13')](function(_0x3146d9){if(_0x3146d9){_0x549859[_0x3a29('0x1b')]=_0x3146d9[_0x3a29('0x6e')]({'plain':!![]});return db[_0x3a29('0x6f')][_0x3a29('0x45')]({'where':{'id':_0x3146d9[_0x3a29('0x70')]}});}return null;})[_0x3a29('0x13')](handleEntityNotFound(_0x416f18,null))['then'](function(_0x2fd07f){if(_0x2fd07f){return _0x2fd07f[_0x3a29('0x24')]({'UserId':_0x522671['body']['UserId'],'read1stAt':_[_0x3a29('0x54')](_0x2fd07f[_0x3a29('0x71')])?moment()[_0x3a29('0x68')](_0x3a29('0x72')):undefined});}return null;})[_0x3a29('0x13')](function(_0x3f4664){if(_0x3f4664){_0x549859['interaction']=_0x3f4664[_0x3a29('0x6e')]({'plain':!![]});interaction_log[_0x3a29('0x14')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x522671['user']['id'],_0x522671[_0x3a29('0x5a')][_0x3a29('0x2f')],_0x522671[_0x3a29('0x5a')][_0x3a29('0x73')],_0x549859[_0x3a29('0x74')]['id'],_0x522671['body']?JSON[_0x3a29('0x18')](_0x522671[_0x3a29('0x46')]):'null');return respondWithRpcPromise(_0x3a29('0x75'),'acceptMessage',_0x549859);}return null;})[_0x3a29('0x13')](function(_0x1fd79b){var _0x224ec4=_0x3a29('0x76')+_0x1fd79b[_0x3a29('0x1b')][_0x3a29('0x77')];return db[_0x3a29('0x78')][_0x3a29('0x30')](_0x224ec4,{'type':db[_0x3a29('0x79')]['QueryTypes'][_0x3a29('0x7a')],'raw':!![]})['then'](function(_0x29f62b){return _0x29f62b;});})[_0x3a29('0x13')](function(_0x84374b){if(_0x84374b){_0x549859['message'][_0x3a29('0x7b')]=_0x84374b[0x0];if(!_0x522671['body'][_0x3a29('0x6d')])return;return db[_0x3a29('0x7c')][_0x3a29('0x45')]({'where':{'id':_0x522671[_0x3a29('0x46')][_0x3a29('0x6d')],'role':'agent'},'attributes':['id','name',_0x3a29('0x7d'),_0x3a29('0x7e'),_0x3a29('0x7f')],'raw':!![]});}return null;})['then'](function(_0x55a517){if(!_0x55a517)return null;_0x549859[_0x3a29('0x1b')][_0x3a29('0x6c')]=_0x55a517;return _0x549859;})[_0x3a29('0x13')](function(_0x4b567b){if(_0x4b567b){if(_0x522671[_0x3a29('0x46')][_0x3a29('0x80')]){_0x549859[_0x3a29('0x1b')][_0x3a29('0x81')]=util[_0x3a29('0x68')]('SIP/%s',_0x522671[_0x3a29('0x5a')][_0x3a29('0x2f')]);_0x549859[_0x3a29('0x1b')]['channel']=_0x549859[_0x3a29('0x82')];_0x549859[_0x3a29('0x1b')][_0x3a29('0x83')]=_0x549859[_0x3a29('0x82')];_0x549859['message'][_0x3a29('0x84')]=_0x3a29('0x69');_0x549859['message'][_0x3a29('0x46')]=htmlToText['fromString'](_0x549859[_0x3a29('0x1b')][_0x3a29('0x46')]);return respondWithRpcPromise(_0x3a29('0x85'),_0x3a29('0x85'),{'event':_0x3a29('0x86'),'message':_0x549859[_0x3a29('0x1b')]},client9002)[_0x3a29('0x13')](function(){return _0x549859;});}return _0x549859;}return null;})[_0x3a29('0x13')](respondWithResult(_0x416f18,null))['catch'](handleError(_0x416f18,null));};exports['reject']=function(_0x8946c5,_0x39a93b){var _0x19d8dd={'agent':{},'channel':_0x3a29('0x6a')};if(_0x8946c5[_0x3a29('0x46')]['id']){delete _0x8946c5[_0x3a29('0x46')]['id'];}_0x8946c5[_0x3a29('0x46')][_0x3a29('0x6d')]=_0x8946c5['body'][_0x3a29('0x6d')]||_0x8946c5[_0x3a29('0x5a')]['id'];_0x19d8dd[_0x3a29('0x6c')]['id']=_0x8946c5[_0x3a29('0x46')][_0x3a29('0x6d')];return db[_0x3a29('0x2a')][_0x3a29('0x45')]({'where':{'id':_0x8946c5['params']['id'],'UserId':null}})[_0x3a29('0x13')](handleEntityNotFound(_0x39a93b,null))['then'](function(_0x140ed9){if(_0x140ed9){_0x19d8dd[_0x3a29('0x1b')]=_0x140ed9[_0x3a29('0x6e')]({'plain':!![]});return db[_0x3a29('0x6f')][_0x3a29('0x45')]({'where':{'id':_0x140ed9[_0x3a29('0x70')]}});}return null;})[_0x3a29('0x13')](handleEntityNotFound(_0x39a93b,null))[_0x3a29('0x13')](function(_0x4bcc63){if(_0x4bcc63){_0x19d8dd[_0x3a29('0x74')]=_0x4bcc63[_0x3a29('0x6e')]({'plain':!![]});interaction_log[_0x3a29('0x14')](_0x3a29('0x87'),_0x8946c5['user']['id'],_0x8946c5['user']['name'],_0x8946c5[_0x3a29('0x5a')]['role'],_0x19d8dd[_0x3a29('0x74')]['id'],_0x8946c5['body']?JSON[_0x3a29('0x18')](_0x8946c5[_0x3a29('0x46')]):_0x3a29('0x88'));return respondWithRpcPromise(_0x3a29('0x89'),'rejectMessage',_0x19d8dd);}return null;})['then'](function(_0x55aa60){var _0x2883a1=_0x3a29('0x76')+_0x55aa60[_0x3a29('0x1b')][_0x3a29('0x77')];return db[_0x3a29('0x78')][_0x3a29('0x30')](_0x2883a1,{'type':db[_0x3a29('0x79')][_0x3a29('0x8a')][_0x3a29('0x7a')],'raw':!![]})[_0x3a29('0x13')](function(_0x3c44af){return _0x3c44af;});})[_0x3a29('0x13')](function(_0x504992){if(_0x504992){_0x19d8dd[_0x3a29('0x1b')][_0x3a29('0x7b')]=_0x504992[0x0];if(!_0x8946c5[_0x3a29('0x46')][_0x3a29('0x6d')])return;return db[_0x3a29('0x7c')][_0x3a29('0x45')]({'where':{'id':_0x8946c5[_0x3a29('0x46')]['UserId'],'role':_0x3a29('0x6c')},'attributes':['id',_0x3a29('0x2f'),_0x3a29('0x7d'),_0x3a29('0x7e'),'internal'],'raw':!![]});}return null;})[_0x3a29('0x13')](function(_0x37ad4e){if(!_0x37ad4e)return null;_0x19d8dd[_0x3a29('0x1b')][_0x3a29('0x6c')]=_0x37ad4e;return _0x19d8dd;})[_0x3a29('0x13')](function(_0x5e8c64){if(_0x5e8c64){_0x5e8c64[_0x3a29('0x1b')][_0x3a29('0x81')]=util[_0x3a29('0x68')]('SIP/%s',_0x8946c5[_0x3a29('0x5a')][_0x3a29('0x2f')]);_0x5e8c64['message'][_0x3a29('0x82')]=_0x19d8dd[_0x3a29('0x82')];_0x5e8c64[_0x3a29('0x1b')][_0x3a29('0x83')]=_0x19d8dd[_0x3a29('0x82')];_0x5e8c64[_0x3a29('0x1b')]['event']=_0x3a29('0x8b');_0x5e8c64['message']['body']=htmlToText[_0x3a29('0x8c')](_0x19d8dd[_0x3a29('0x1b')]['body']);respondWithRpcPromise(_0x3a29('0x85'),_0x3a29('0x85'),{'event':_0x3a29('0x8d'),'message':_0x5e8c64[_0x3a29('0x1b')]},client9002);return _0x19d8dd;}return null;})[_0x3a29('0x13')](respondWithResult(_0x39a93b,null))['catch'](handleError(_0x39a93b,null));};exports[_0x3a29('0x8e')]=function(_0x3c5a05,_0x3318c3){var _0x1bbc80=moment()['unix']()['toString']();var _0x16a1b3=path[_0x3a29('0x5e')](config[_0x3a29('0x5f')],_0x3a29('0x8f'),_0x3a29('0x90'),_0x3a29('0x91'));var _0x2ff13d=path[_0x3a29('0x5e')](config[_0x3a29('0x5f')],_0x3a29('0x8f'),_0x3a29('0x90'),'attachments');var _0x1d3921=util[_0x3a29('0x68')](_0x3a29('0x92'),_0x1bbc80);return db[_0x3a29('0x2a')][_0x3a29('0x45')]({'where':{'id':_0x3c5a05['params']['id']},'attributes':['id',_0x3a29('0x46'),_0x3a29('0x93'),'to','cc',_0x3a29('0x94'),_0x3a29('0x95'),_0x3a29('0x96')],'include':_0x3c5a05[_0x3a29('0x30')][_0x3a29('0x5d')]?[{'model':db[_0x3a29('0x97')],'as':_0x3a29('0x98')}]:undefined})['then'](handleEntityNotFound(_0x3318c3,null))['then'](function(_0x42f302){if(_0x42f302){var _0x573d9b=_0x42f302;var _0x3be2f6={'from':_0x573d9b[_0x3a29('0x93')],'to':_0x573d9b['to'],'subject':_0x573d9b['subject'],'html':_0x573d9b[_0x3a29('0x46')],'headers':{'Date':moment(_0x573d9b['createdAt'])['format'](_0x3a29('0x99'))},'attachments':[]};if(_0x42f302['cc']){_0x3be2f6['headers']['Cc']=_0x42f302['cc'];}if(_0x42f302['bcc']){_0x3be2f6[_0x3a29('0x9a')][_0x3a29('0x9b')]=_0x42f302[_0x3a29('0x94')];}return new BPromise(function(_0x1d5e6e,_0x558b60){if(_0x42f302['Attachments']){for(var _0x347230=0x0;_0x347230<_0x42f302[_0x3a29('0x98')][_0x3a29('0x36')];_0x347230++){var _0x161852=_0x42f302[_0x3a29('0x98')][_0x347230];var _0x10ff52=path[_0x3a29('0x5e')](_0x2ff13d,_0x161852[_0x3a29('0x60')]);if(fs[_0x3a29('0x9c')](_0x10ff52)){_0x3be2f6[_0x3a29('0x5d')][_0x3a29('0x9d')]({'name':_0x161852[_0x3a29('0x2f')],'contentType':_0x161852['type'],'data':fs[_0x3a29('0x9e')](_0x10ff52)});}}}emlformat['build'](_0x3be2f6,function(_0x186df6,_0x516477){if(_0x186df6)return _0x558b60(_0x186df6);fs[_0x3a29('0x9f')](path[_0x3a29('0x5e')](_0x16a1b3,_0x1d3921),_0x516477);return _0x1d5e6e(_0x516477);});});}})['then'](function(_0x568c33){if(_0x568c33){return _0x3318c3['download'](path[_0x3a29('0x5e')](_0x16a1b3,_0x1d3921),_0x1d3921,function(_0x56915a){if(!_0x56915a)fs[_0x3a29('0xa0')](path[_0x3a29('0x5e')](_0x16a1b3,_0x1d3921));});}})[_0x3a29('0x1c')](handleError(_0x3318c3,null));}; \ No newline at end of file +var _0x1fd5=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','model','fields','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','format','stringify','accept','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','sequelize','interface','fromString','rejectmessage','unix','toString','root','server','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','headers','Bcc','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment','util','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','json','offset','limit','undefined','count','set','update','destroy','then','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1d5e7e,_0x41fe54){var _0x93d29d=function(_0x401020){while(--_0x401020){_0x1d5e7e['push'](_0x1d5e7e['shift']());}};_0x93d29d(++_0x41fe54);}(_0x1fd5,0x67));var _0x51fd=function(_0x5cb990,_0x38831c){_0x5cb990=_0x5cb990-0x0;var _0x353fd2=_0x1fd5[_0x5cb990];return _0x353fd2;};'use strict';var emlformat=require(_0x51fd('0x0'));var moment=require(_0x51fd('0x1'));var BPromise=require('bluebird');var util=require(_0x51fd('0x2'));var path=require(_0x51fd('0x3'));var fs=require('fs');var _=require(_0x51fd('0x4'));var Redis=require(_0x51fd('0x5'));var htmlToText=require(_0x51fd('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x51fd('0x7'))(_0x51fd('0x8'));var interaction_log=require('../../config/logger')(_0x51fd('0x9'));var config=require(_0x51fd('0xa'));var db=require(_0x51fd('0xb'))['db'];config[_0x51fd('0xc')]=_[_0x51fd('0xd')](config[_0x51fd('0xc')],{'host':_0x51fd('0xe'),'port':0x18eb});var socket=require(_0x51fd('0xf'))(new Redis(config[_0x51fd('0xc')]));require(_0x51fd('0x10'))[_0x51fd('0x11')](socket);var jayson=require(_0x51fd('0x12'));var client=jayson[_0x51fd('0x13')][_0x51fd('0x14')]({'port':0x232c});var client9003=jayson[_0x51fd('0x13')]['http']({'port':0x232b});var client9002=jayson[_0x51fd('0x13')][_0x51fd('0x14')]({'port':0x232a});function respondWithRpcPromise(_0xbc7585,_0x2b64dd,_0x19d5aa,_0x53ff44){return new BPromise(function(_0x70c74b,_0x5df8f4){var _0x426a8d=_0x53ff44||client;return _0x426a8d['request'](_0xbc7585,_0x19d5aa)['then'](function(_0x381002){logger[_0x51fd('0x15')](_0x51fd('0x16'),_0x2b64dd,'request\x20sent');logger[_0x51fd('0x17')](_0x51fd('0x18'),_0x2b64dd,'request\x20sent',JSON['stringify'](_0x381002));if(_0x381002[_0x51fd('0x19')]){if(_0x381002['error'][_0x51fd('0x1a')]===0x1f4){logger[_0x51fd('0x19')]('MailMessage,\x20%s,\x20%s',_0x2b64dd,_0x381002[_0x51fd('0x19')][_0x51fd('0x1b')]);return _0x5df8f4(_0x381002[_0x51fd('0x19')]['message']);}logger[_0x51fd('0x19')](_0x51fd('0x16'),_0x2b64dd,_0x381002[_0x51fd('0x19')]['message']);return _0x70c74b(_0x381002[_0x51fd('0x19')][_0x51fd('0x1b')]);}else{logger[_0x51fd('0x15')](_0x51fd('0x16'),_0x2b64dd,_0x51fd('0x1c'));_0x70c74b(_0x381002['result'][_0x51fd('0x1b')]);}})[_0x51fd('0x1d')](function(_0x38c173){logger[_0x51fd('0x19')](_0x51fd('0x16'),_0x2b64dd,_0x38c173);_0x5df8f4(_0x38c173);});});}function respondWithResult(_0x1cd15a,_0x30e89d){_0x30e89d=_0x30e89d||0xc8;return function(_0xea2cb0){if(_0xea2cb0){return _0x1cd15a[_0x51fd('0x1e')](_0x30e89d)[_0x51fd('0x1f')](_0xea2cb0);}};}function respondWithFilteredResult(_0x581f39,_0x581378){return function(_0x49a9a0){if(_0x49a9a0){var _0x4b46d6=typeof _0x581378[_0x51fd('0x20')]==='undefined'&&typeof _0x581378[_0x51fd('0x21')]===_0x51fd('0x22');var _0x3fb7ef=_0x49a9a0[_0x51fd('0x23')];var _0x1da0ea=_0x4b46d6?0x0:_0x581378['offset'];var _0x2313ac=_0x4b46d6?_0x49a9a0[_0x51fd('0x23')]:_0x581378['offset']+_0x581378[_0x51fd('0x21')];var _0x383356;if(_0x2313ac>=_0x3fb7ef){_0x2313ac=_0x3fb7ef;_0x383356=0xc8;}else{_0x383356=0xce;}_0x581f39[_0x51fd('0x1e')](_0x383356);return _0x581f39[_0x51fd('0x24')]('Content-Range',_0x1da0ea+'-'+_0x2313ac+'/'+_0x3fb7ef)['json'](_0x49a9a0);}return null;};}function saveUpdates(_0x43cfc7){return function(_0x4e9733){if(_0x4e9733){return _0x4e9733[_0x51fd('0x25')](_0x43cfc7)['then'](function(_0x5c3b73){return _0x5c3b73;});}return null;};}function removeEntity(_0x3baec6){return function(_0x257d92){if(_0x257d92){return _0x257d92[_0x51fd('0x26')]()[_0x51fd('0x27')](function(){_0x3baec6[_0x51fd('0x1e')](0xcc)[_0x51fd('0x28')]();});}};}function handleEntityNotFound(_0x1b54d7){return function(_0x3434d3){if(!_0x3434d3){_0x1b54d7[_0x51fd('0x29')](0x194);}return _0x3434d3;};}function handleError(_0x4a4bda,_0x5c7841){_0x5c7841=_0x5c7841||0x1f4;return function(_0x23c171){logger['error'](_0x23c171[_0x51fd('0x2a')]);if(_0x23c171[_0x51fd('0x2b')]){delete _0x23c171[_0x51fd('0x2b')];}_0x4a4bda['status'](_0x5c7841)['send'](_0x23c171);};}exports[_0x51fd('0x2c')]=function(_0x1924c3,_0x5f1692){var _0x3e03d6={},_0x5ae442={},_0x11412b={'count':0x0,'rows':[]};var _0x1b3bd4=_[_0x51fd('0x2d')](db[_0x51fd('0x2e')][_0x51fd('0x2f')],function(_0x52047e){return{'name':_0x52047e[_0x51fd('0x30')],'type':_0x52047e[_0x51fd('0x31')]['key']};});_0x5ae442['model']=_[_0x51fd('0x2d')](_0x1b3bd4,_0x51fd('0x2b'));_0x5ae442['query']=_[_0x51fd('0x32')](_0x1924c3[_0x51fd('0x33')]);_0x5ae442[_0x51fd('0x34')]=_['intersection'](_0x5ae442['model'],_0x5ae442[_0x51fd('0x33')]);_0x3e03d6[_0x51fd('0x35')]=_[_0x51fd('0x36')](_0x5ae442['model'],qs['fields'](_0x1924c3[_0x51fd('0x33')]['fields']));_0x3e03d6[_0x51fd('0x35')]=_0x3e03d6[_0x51fd('0x35')][_0x51fd('0x37')]?_0x3e03d6[_0x51fd('0x35')]:_0x5ae442['model'];if(!_0x1924c3[_0x51fd('0x33')][_0x51fd('0x38')](_0x51fd('0x39'))){_0x3e03d6[_0x51fd('0x21')]=qs['limit'](_0x1924c3[_0x51fd('0x33')][_0x51fd('0x21')]);_0x3e03d6[_0x51fd('0x20')]=qs['offset'](_0x1924c3[_0x51fd('0x33')][_0x51fd('0x20')]);}_0x3e03d6[_0x51fd('0x3a')]=qs[_0x51fd('0x3b')](_0x1924c3[_0x51fd('0x33')][_0x51fd('0x3b')]);_0x3e03d6[_0x51fd('0x3c')]=qs['filters'](_[_0x51fd('0x3d')](_0x1924c3[_0x51fd('0x33')],_0x5ae442[_0x51fd('0x34')]),_0x1b3bd4);if(_0x1924c3[_0x51fd('0x33')][_0x51fd('0x3e')]){_0x3e03d6['where']=_[_0x51fd('0x3f')](_0x3e03d6[_0x51fd('0x3c')],{'$or':_[_0x51fd('0x2d')](_0x1b3bd4,function(_0x4ae28f){if(_0x4ae28f[_0x51fd('0x31')]!==_0x51fd('0x40')){var _0x53fd0d={};_0x53fd0d[_0x4ae28f[_0x51fd('0x2b')]]={'$like':'%'+_0x1924c3['query']['filter']+'%'};return _0x53fd0d;}})});}_0x3e03d6=_[_0x51fd('0x3f')]({},_0x3e03d6,_0x1924c3[_0x51fd('0x41')]);var _0x3e6417={'where':_0x3e03d6[_0x51fd('0x3c')]};return db[_0x51fd('0x2e')][_0x51fd('0x23')](_0x3e6417)['then'](function(_0x5257af){_0x11412b[_0x51fd('0x23')]=_0x5257af;if(_0x1924c3[_0x51fd('0x33')][_0x51fd('0x42')]){_0x3e03d6[_0x51fd('0x43')]=[{'all':!![]}];}return db[_0x51fd('0x2e')][_0x51fd('0x44')](_0x3e03d6);})[_0x51fd('0x27')](function(_0x598547){_0x11412b['rows']=_0x598547;return _0x11412b;})['then'](respondWithFilteredResult(_0x5f1692,_0x3e03d6))['catch'](handleError(_0x5f1692,null));};exports['show']=function(_0x15de0d,_0x8da6d1){var _0x45d583={'raw':!![],'where':{'id':_0x15de0d[_0x51fd('0x45')]['id']}},_0x1a89c5={};_0x1a89c5[_0x51fd('0x46')]=_[_0x51fd('0x32')](db[_0x51fd('0x2e')]['rawAttributes']);_0x1a89c5['query']=_[_0x51fd('0x32')](_0x15de0d['query']);_0x1a89c5['filters']=_[_0x51fd('0x36')](_0x1a89c5[_0x51fd('0x46')],_0x1a89c5['query']);_0x45d583['attributes']=_[_0x51fd('0x36')](_0x1a89c5[_0x51fd('0x46')],qs[_0x51fd('0x47')](_0x15de0d[_0x51fd('0x33')][_0x51fd('0x47')]));_0x45d583[_0x51fd('0x35')]=_0x45d583[_0x51fd('0x35')][_0x51fd('0x37')]?_0x45d583['attributes']:_0x1a89c5[_0x51fd('0x46')];if(_0x15de0d[_0x51fd('0x33')][_0x51fd('0x42')]){_0x45d583[_0x51fd('0x43')]=[{'all':!![]}];}_0x45d583=_['merge']({},_0x45d583,_0x15de0d['options']);return db[_0x51fd('0x2e')][_0x51fd('0x48')](_0x45d583)[_0x51fd('0x27')](handleEntityNotFound(_0x8da6d1,null))[_0x51fd('0x27')](respondWithResult(_0x8da6d1,null))[_0x51fd('0x1d')](handleError(_0x8da6d1,null));};exports['update']=function(_0xf94a44,_0x9796c9){if(_0xf94a44[_0x51fd('0x49')]['id']){delete _0xf94a44['body']['id'];}return db[_0x51fd('0x2e')]['find']({'where':{'id':_0xf94a44[_0x51fd('0x45')]['id']}})[_0x51fd('0x27')](handleEntityNotFound(_0x9796c9,null))[_0x51fd('0x27')](saveUpdates(_0xf94a44[_0x51fd('0x49')],null))['then'](respondWithResult(_0x9796c9,null))['catch'](handleError(_0x9796c9,null));};exports[_0x51fd('0x26')]=function(_0x696f82,_0x2b9808){return db[_0x51fd('0x2e')][_0x51fd('0x48')]({'where':{'id':_0x696f82['params']['id']}})[_0x51fd('0x27')](handleEntityNotFound(_0x2b9808,null))[_0x51fd('0x27')](removeEntity(_0x2b9808,null))['catch'](handleError(_0x2b9808,null));};exports['describe']=function(_0x22ee66,_0x420c10){return db['MailMessage'][_0x51fd('0x4a')]()[_0x51fd('0x27')](respondWithResult(_0x420c10,null))[_0x51fd('0x1d')](handleError(_0x420c10,null));};exports[_0x51fd('0x4b')]=function(_0x235025,_0x2220fe){return db[_0x51fd('0x2e')]['create'](_0x235025[_0x51fd('0x49')])[_0x51fd('0x27')](function(_0x3494ba){if(_0x3494ba){if(_0x3494ba[_0x51fd('0x4c')]===_0x51fd('0x4d')&&!_0x3494ba[_0x51fd('0x4e')]){var _0x5ec61d,_0x2a254e,_0x3a12c6;if(_0x235025['body']['to']){_0x2a254e=_0x235025['body']['to'][_0x51fd('0x4f')](',')[0x0];}return db[_0x51fd('0x50')][_0x51fd('0x51')]({'where':{'id':_0x3494ba[_0x51fd('0x52')]},'include':[{'model':db[_0x51fd('0x53')],'as':_0x51fd('0x54'),'include':[{'model':db['CmContact'],'as':_0x51fd('0x55'),'where':{'email':_0x2a254e},'limit':0x1,'order':[[_0x51fd('0x56'),_0x51fd('0x57')]]}]},{'model':db[_0x51fd('0x58')],'as':_0x51fd('0x59'),'raw':!![]}]})[_0x51fd('0x27')](function(_0x325f25){_0x5ec61d=_0x325f25;if(_0x5ec61d&&_0x5ec61d['Smtp']){var _0x595755={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x5ec61d['Smtp'][_0x51fd('0x5a')])){_0x595755[_0x51fd('0x5b')]=_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x5b')];_0x595755['port']=_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x5c')];_0x595755[_0x51fd('0x5d')]=_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x5d')];if(_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x5e')]){_0x595755[_0x51fd('0x5f')]={'user':_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x60')],'pass':_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x61')]};}}else{_0x595755[_0x51fd('0x5a')]=_0x5ec61d['Smtp'][_0x51fd('0x5a')];_0x595755[_0x51fd('0x5f')]={'user':_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x60')],'pass':_0x5ec61d[_0x51fd('0x59')][_0x51fd('0x61')]};_0x595755[_0x51fd('0x5d')]=_0x5ec61d['Smtp'][_0x51fd('0x5d')];}if(_0x235025[_0x51fd('0x49')][_0x51fd('0x62')]&&_0x235025[_0x51fd('0x49')]['attachments'][_0x51fd('0x37')]){for(var _0x2ef776=0x0;_0x2ef776<_0x235025[_0x51fd('0x49')][_0x51fd('0x62')]['length'];_0x2ef776+=0x1){_0x235025[_0x51fd('0x49')]['attachments'][_0x2ef776]={'filename':_0x235025['body'][_0x51fd('0x62')][_0x2ef776][_0x51fd('0x2b')],'path':path[_0x51fd('0x63')](config['root'],_0x51fd('0x64'),_0x235025['body']['attachments'][_0x2ef776][_0x51fd('0x65')])};}}_0x3a12c6={'account':_0x595755,'message':_0x235025[_0x51fd('0x49')]};return;}})[_0x51fd('0x27')](function(){if(_0x5ec61d[_0x51fd('0x54')]){if(_0x5ec61d[_0x51fd('0x54')][_0x51fd('0x55')][_0x51fd('0x37')]){return _0x5ec61d['List'][_0x51fd('0x55')][0x0];}else{return db[_0x51fd('0x66')][_0x51fd('0x4b')](_[_0x51fd('0xd')](_0x235025[_0x51fd('0x49')],{'firstName':_0x235025['body']['to'],'email':_0x235025['body']['to'],'phone':_0x235025['body']['to'],'ListId':_0x5ec61d[_0x51fd('0x67')]}));}}else{throw new Error(_0x51fd('0x68'));}})[_0x51fd('0x27')](function(){if(_0x3a12c6){return respondWithRpcPromise(_0x51fd('0x69'),'sendMail',_0x3a12c6,client9003)[_0x51fd('0x27')](function(_0x5e65db){return _0x3494ba[_0x51fd('0x25')]({'read':!![],'messageId':_0x5e65db['messageId'],'sentAt':moment()[_0x51fd('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x51fd('0x1d')](function(_0xa0dffb){logger['error']('%s',JSON[_0x51fd('0x6b')](_0xa0dffb));return _0x3494ba;});}return _0x3494ba;});}return _0x3494ba;}})[_0x51fd('0x27')](respondWithResult(_0x2220fe,0xc9))[_0x51fd('0x1d')](handleError(_0x2220fe,null));};exports[_0x51fd('0x6c')]=function(_0x4a7615,_0x24dac7){var _0x2d13f1={'agent':{},'channel':_0x51fd('0x6d')};if(_0x4a7615[_0x51fd('0x49')]['id']){delete _0x4a7615[_0x51fd('0x49')]['id'];}_0x4a7615[_0x51fd('0x49')][_0x51fd('0x6e')]=!![];_0x4a7615[_0x51fd('0x49')]['readAt']=moment()[_0x51fd('0x6a')](_0x51fd('0x6f'));_0x4a7615[_0x51fd('0x49')][_0x51fd('0x70')]=_0x4a7615[_0x51fd('0x49')][_0x51fd('0x70')]||_0x4a7615[_0x51fd('0x60')]['id'];_0x2d13f1[_0x51fd('0x71')]['id']=_0x4a7615['body'][_0x51fd('0x70')];return db[_0x51fd('0x2e')]['find']({'where':{'id':_0x4a7615['params']['id'],'UserId':null}})[_0x51fd('0x27')](handleEntityNotFound(_0x24dac7,null))[_0x51fd('0x27')](saveUpdates(_0x4a7615[_0x51fd('0x49')],null))['then'](function(_0x15b9e7){if(_0x15b9e7){_0x2d13f1[_0x51fd('0x1b')]=_0x15b9e7['get']({'plain':!![]});return db[_0x51fd('0x72')][_0x51fd('0x48')]({'where':{'id':_0x15b9e7[_0x51fd('0x73')]}});}return null;})[_0x51fd('0x27')](handleEntityNotFound(_0x24dac7,null))['then'](function(_0xe33372){if(_0xe33372){return _0xe33372[_0x51fd('0x25')]({'UserId':_0x4a7615['body'][_0x51fd('0x70')],'read1stAt':_['isNil'](_0xe33372[_0x51fd('0x74')])?moment()[_0x51fd('0x6a')](_0x51fd('0x6f')):undefined});}return null;})['then'](function(_0x53ace8){if(_0x53ace8){_0x2d13f1[_0x51fd('0x75')]=_0x53ace8['get']({'plain':!![]});interaction_log[_0x51fd('0x15')](_0x51fd('0x76'),_0x4a7615[_0x51fd('0x60')]['id'],_0x4a7615['user'][_0x51fd('0x2b')],_0x4a7615['user'][_0x51fd('0x77')],_0x2d13f1[_0x51fd('0x75')]['id'],_0x4a7615[_0x51fd('0x49')]?JSON[_0x51fd('0x6b')](_0x4a7615[_0x51fd('0x49')]):_0x51fd('0x78'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2d13f1);}return null;})[_0x51fd('0x27')](function(_0x1151e0){var _0x31f9a0=_0x51fd('0x79')+_0x1151e0['message'][_0x51fd('0x7a')];return db['sequelize']['query'](_0x31f9a0,{'type':db[_0x51fd('0x7b')][_0x51fd('0x7c')][_0x51fd('0x7d')],'raw':!![]})[_0x51fd('0x27')](function(_0x474316){return _0x474316;});})['then'](function(_0x1b09e9){if(_0x1b09e9){_0x2d13f1[_0x51fd('0x1b')][_0x51fd('0x7e')]=_0x1b09e9[0x0];if(!_0x4a7615[_0x51fd('0x49')]['UserId'])return;return db[_0x51fd('0x7f')][_0x51fd('0x48')]({'where':{'id':_0x4a7615[_0x51fd('0x49')][_0x51fd('0x70')],'role':_0x51fd('0x71')},'attributes':['id',_0x51fd('0x2b'),_0x51fd('0x80'),_0x51fd('0x81'),_0x51fd('0x82')],'raw':!![]});}return null;})[_0x51fd('0x27')](function(_0x21b99b){if(!_0x21b99b)return null;_0x2d13f1[_0x51fd('0x1b')][_0x51fd('0x71')]=_0x21b99b;return _0x2d13f1;})[_0x51fd('0x27')](function(_0x5d1886){if(_0x5d1886){if(_0x4a7615['body']['manual']){_0x2d13f1[_0x51fd('0x1b')]['interface']=util['format'](_0x51fd('0x83'),_0x4a7615[_0x51fd('0x60')]['name']);_0x2d13f1['message'][_0x51fd('0x84')]=_0x2d13f1[_0x51fd('0x84')];_0x2d13f1['message'][_0x51fd('0x85')]=_0x2d13f1[_0x51fd('0x84')];_0x2d13f1[_0x51fd('0x1b')][_0x51fd('0x86')]=_0x51fd('0x6c');_0x2d13f1[_0x51fd('0x1b')][_0x51fd('0x49')]=htmlToText['fromString'](_0x2d13f1[_0x51fd('0x1b')][_0x51fd('0x49')]);return respondWithRpcPromise(_0x51fd('0x87'),_0x51fd('0x87'),{'event':_0x51fd('0x88'),'message':_0x2d13f1['message']},client9002)[_0x51fd('0x27')](function(){return _0x2d13f1;});}return _0x2d13f1;}return null;})[_0x51fd('0x27')](respondWithResult(_0x24dac7,null))[_0x51fd('0x1d')](handleError(_0x24dac7,null));};exports[_0x51fd('0x89')]=function(_0x28a63f,_0x2b64db){var _0x13a51b={'agent':{},'channel':_0x51fd('0x6d')};if(_0x28a63f[_0x51fd('0x49')]['id']){delete _0x28a63f[_0x51fd('0x49')]['id'];}_0x28a63f[_0x51fd('0x49')][_0x51fd('0x70')]=_0x28a63f[_0x51fd('0x49')][_0x51fd('0x70')]||_0x28a63f['user']['id'];_0x13a51b[_0x51fd('0x71')]['id']=_0x28a63f[_0x51fd('0x49')]['UserId'];return db[_0x51fd('0x2e')][_0x51fd('0x48')]({'where':{'id':_0x28a63f[_0x51fd('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b64db,null))[_0x51fd('0x27')](function(_0x27e80e){if(_0x27e80e){_0x13a51b[_0x51fd('0x1b')]=_0x27e80e[_0x51fd('0x8a')]({'plain':!![]});return db['MailInteraction'][_0x51fd('0x48')]({'where':{'id':_0x27e80e[_0x51fd('0x73')]}});}return null;})[_0x51fd('0x27')](handleEntityNotFound(_0x2b64db,null))[_0x51fd('0x27')](function(_0x339425){if(_0x339425){_0x13a51b[_0x51fd('0x75')]=_0x339425[_0x51fd('0x8a')]({'plain':!![]});interaction_log[_0x51fd('0x15')](_0x51fd('0x8b'),_0x28a63f[_0x51fd('0x60')]['id'],_0x28a63f['user'][_0x51fd('0x2b')],_0x28a63f['user']['role'],_0x13a51b[_0x51fd('0x75')]['id'],_0x28a63f[_0x51fd('0x49')]?JSON[_0x51fd('0x6b')](_0x28a63f[_0x51fd('0x49')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x13a51b);}return null;})[_0x51fd('0x27')](function(_0x49170e){var _0x4c6c62=_0x51fd('0x79')+_0x49170e[_0x51fd('0x1b')][_0x51fd('0x7a')];return db[_0x51fd('0x8c')][_0x51fd('0x33')](_0x4c6c62,{'type':db['Sequelize'][_0x51fd('0x7c')][_0x51fd('0x7d')],'raw':!![]})[_0x51fd('0x27')](function(_0x2fdb9a){return _0x2fdb9a;});})['then'](function(_0x5b18e4){if(_0x5b18e4){_0x13a51b[_0x51fd('0x1b')][_0x51fd('0x7e')]=_0x5b18e4[0x0];if(!_0x28a63f[_0x51fd('0x49')][_0x51fd('0x70')])return;return db[_0x51fd('0x7f')][_0x51fd('0x48')]({'where':{'id':_0x28a63f[_0x51fd('0x49')][_0x51fd('0x70')],'role':_0x51fd('0x71')},'attributes':['id',_0x51fd('0x2b'),'fullname',_0x51fd('0x81'),_0x51fd('0x82')],'raw':!![]});}return null;})[_0x51fd('0x27')](function(_0x3de65b){if(!_0x3de65b)return null;_0x13a51b[_0x51fd('0x1b')][_0x51fd('0x71')]=_0x3de65b;return _0x13a51b;})[_0x51fd('0x27')](function(_0x204f7c){if(_0x204f7c){_0x204f7c[_0x51fd('0x1b')][_0x51fd('0x8d')]=util[_0x51fd('0x6a')]('SIP/%s',_0x28a63f[_0x51fd('0x60')]['name']);_0x204f7c[_0x51fd('0x1b')][_0x51fd('0x84')]=_0x13a51b[_0x51fd('0x84')];_0x204f7c[_0x51fd('0x1b')]['motionChannel']=_0x13a51b[_0x51fd('0x84')];_0x204f7c[_0x51fd('0x1b')][_0x51fd('0x86')]=_0x51fd('0x89');_0x204f7c[_0x51fd('0x1b')][_0x51fd('0x49')]=htmlToText[_0x51fd('0x8e')](_0x13a51b[_0x51fd('0x1b')]['body']);respondWithRpcPromise(_0x51fd('0x87'),_0x51fd('0x87'),{'event':_0x51fd('0x8f'),'message':_0x204f7c[_0x51fd('0x1b')]},client9002);return _0x13a51b;}return null;})[_0x51fd('0x27')](respondWithResult(_0x2b64db,null))[_0x51fd('0x1d')](handleError(_0x2b64db,null));};exports['download']=function(_0x381470,_0x32dfad){var _0x999b0a=moment()[_0x51fd('0x90')]()[_0x51fd('0x91')]();var _0x3b519d=path[_0x51fd('0x63')](config[_0x51fd('0x92')],_0x51fd('0x93'),'files',_0x51fd('0x94'));var _0x47e46a=path[_0x51fd('0x63')](config[_0x51fd('0x92')],_0x51fd('0x93'),'files','attachments');var _0x2f0d6d=util[_0x51fd('0x6a')](_0x51fd('0x95'),_0x999b0a);return db[_0x51fd('0x2e')][_0x51fd('0x48')]({'where':{'id':_0x381470[_0x51fd('0x45')]['id']},'attributes':['id',_0x51fd('0x49'),'from','to','cc',_0x51fd('0x96'),_0x51fd('0x97'),_0x51fd('0x98')],'include':_0x381470[_0x51fd('0x33')][_0x51fd('0x62')]?[{'model':db[_0x51fd('0x99')],'as':_0x51fd('0x9a')}]:undefined})[_0x51fd('0x27')](handleEntityNotFound(_0x32dfad,null))[_0x51fd('0x27')](function(_0x4eff4c){if(_0x4eff4c){var _0x521b31=_0x4eff4c;var _0x29aed8={'from':_0x521b31[_0x51fd('0x9b')],'to':_0x521b31['to'],'subject':_0x521b31[_0x51fd('0x97')],'html':_0x521b31[_0x51fd('0x49')],'headers':{'Date':moment(_0x521b31[_0x51fd('0x98')])[_0x51fd('0x6a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4eff4c['cc']){_0x29aed8[_0x51fd('0x9c')]['Cc']=_0x4eff4c['cc'];}if(_0x4eff4c[_0x51fd('0x96')]){_0x29aed8[_0x51fd('0x9c')][_0x51fd('0x9d')]=_0x4eff4c[_0x51fd('0x96')];}return new BPromise(function(_0x3570fb,_0x40b757){if(_0x4eff4c['Attachments']){for(var _0x130134=0x0;_0x130134<_0x4eff4c[_0x51fd('0x9a')]['length'];_0x130134++){var _0x450b04=_0x4eff4c[_0x51fd('0x9a')][_0x130134];var _0x52115d=path[_0x51fd('0x63')](_0x47e46a,_0x450b04['basename']);if(fs['existsSync'](_0x52115d)){_0x29aed8[_0x51fd('0x62')]['push']({'name':_0x450b04[_0x51fd('0x2b')],'contentType':_0x450b04[_0x51fd('0x31')],'data':fs[_0x51fd('0x9e')](_0x52115d)});}}}emlformat[_0x51fd('0x9f')](_0x29aed8,function(_0x1b9a26,_0x3645a0){if(_0x1b9a26)return _0x40b757(_0x1b9a26);fs[_0x51fd('0xa0')](path['join'](_0x3b519d,_0x2f0d6d),_0x3645a0);return _0x3570fb(_0x3645a0);});});}})[_0x51fd('0x27')](function(_0x16a505){if(_0x16a505){return _0x32dfad[_0x51fd('0xa1')](path['join'](_0x3b519d,_0x2f0d6d),_0x2f0d6d,function(_0x4e9d43){if(!_0x4e9d43)fs[_0x51fd('0xa2')](path[_0x51fd('0x63')](_0x3b519d,_0x2f0d6d));});}})['catch'](handleError(_0x32dfad,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 60abb72..669a8e1 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 _0xdecf=['remove','emit','hasOwnProperty','hook','events','MailMessage','setMaxListeners','save'];(function(_0x698156,_0x57f354){var _0x23eb77=function(_0x521626){while(--_0x521626){_0x698156['push'](_0x698156['shift']());}};_0x23eb77(++_0x57f354);}(_0xdecf,0x15c));var _0xfdec=function(_0x4d8a54,_0x2770d8){_0x4d8a54=_0x4d8a54-0x0;var _0x3eacd6=_0xdecf[_0x4d8a54];return _0x3eacd6;};'use strict';var EventEmitter=require(_0xfdec('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xfdec('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xfdec('0x2')](0x0);var events={'afterCreate':_0xfdec('0x3'),'afterUpdate':'update','afterDestroy':_0xfdec('0x4')};function emitEvent(_0x5f0927){return function(_0x535954,_0xa98b9b,_0x3aedad){MailMessageEvents[_0xfdec('0x5')](_0x5f0927+':'+_0x535954['id'],_0x535954);MailMessageEvents[_0xfdec('0x5')](_0x5f0927,_0x535954);_0x3aedad(null);};}for(var e in events){if(events[_0xfdec('0x6')](e)){var event=events[e];MailMessage[_0xfdec('0x7')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xc1ad=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x27a127,_0x6fa6b5){var _0x47f5c2=function(_0x157c9e){while(--_0x157c9e){_0x27a127['push'](_0x27a127['shift']());}};_0x47f5c2(++_0x6fa6b5);}(_0xc1ad,0xa6));var _0xdc1a=function(_0x184b16,_0x4e101c){_0x184b16=_0x184b16-0x0;var _0x470111=_0xc1ad[_0x184b16];return _0x470111;};'use strict';var EventEmitter=require(_0xdc1a('0x0'));var MailMessage=require(_0xdc1a('0x1'))['db'][_0xdc1a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xdc1a('0x3')](0x0);var events={'afterCreate':_0xdc1a('0x4'),'afterUpdate':_0xdc1a('0x5'),'afterDestroy':_0xdc1a('0x6')};function emitEvent(_0x16232b){return function(_0x434139,_0xf2e086,_0x28667a){MailMessageEvents[_0xdc1a('0x7')](_0x16232b+':'+_0x434139['id'],_0x434139);MailMessageEvents[_0xdc1a('0x7')](_0x16232b,_0x434139);_0x28667a(null);};}for(var e in events){if(events[_0xdc1a('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xdc1a('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 52294fe..ed0d475 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 _0xca71=['MailInteraction','findOne','MailInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','secret','UserId'];(function(_0x5b3a74,_0x48c10b){var _0x262c6e=function(_0x29d32){while(--_0x29d32){_0x5b3a74['push'](_0x5b3a74['shift']());}};_0x262c6e(++_0x48c10b);}(_0xca71,0x13f));var _0x1ca7=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0xca71[_0x3cb7c1];return _0x3f6ffc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1ca7('0x0'))(_0x1ca7('0x1'));var moment=require(_0x1ca7('0x2'));var BPromise=require(_0x1ca7('0x3'));var rp=require('request-promise');var htmlToText=require(_0x1ca7('0x4'));var fs=require('fs');var path=require(_0x1ca7('0x5'));var rimraf=require(_0x1ca7('0x6'));var config=require(_0x1ca7('0x7'));var attributes=require(_0x1ca7('0x8'));module[_0x1ca7('0x9')]=function(_0x7f890e,_0x192a60){return _0x7f890e[_0x1ca7('0xa')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x1ca7('0xb'),'fields':[_0x1ca7('0xc'),_0x1ca7('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5b7786,_0x3f6aa7,_0x2e5f02){if(_0x5b7786[_0x1ca7('0xe')]){_0x5b7786['plainBody']=htmlToText[_0x1ca7('0xf')](_0x5b7786[_0x1ca7('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2e5f02(null,_0x3f6aa7);},'afterCreate':function(_0x8e2e0b,_0x2a94ee,_0x41b950){var _0x3218bd=_0x7f890e[_0x1ca7('0x10')];var _0x256db7=_0x8e2e0b[_0x1ca7('0x11')]({'plain':!![]});if(_0x256db7['direction']['toLowerCase']()==='in'||_0x256db7[_0x1ca7('0x12')][_0x1ca7('0x13')]()==='out'&&!_0x256db7[_0x1ca7('0x14')]&&!_['isNil'](_0x256db7[_0x1ca7('0x15')])){_0x3218bd[_0x1ca7('0x16')][_0x1ca7('0x17')]({'where':{'id':_0x256db7[_0x1ca7('0x18')]}})[_0x1ca7('0x19')](function(_0x2c48cc){if(_0x2c48cc){_0x2c48cc[_0x1ca7('0x1a')]({'lastMsgAt':_0x256db7['createdAt'],'lastMsgDirection':_0x256db7[_0x1ca7('0x12')][_0x1ca7('0x13')]()});}})[_0x1ca7('0x1b')](function(_0x30c251){console[_0x1ca7('0x1c')](_0x30c251);});}_0x41b950();}},'charset':_0x1ca7('0x1d'),'collate':_0x1ca7('0x1e')});}; \ No newline at end of file +var _0x7ee8=['request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','toLowerCase','direction','out','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x7ee8,0x1cf));var _0x87ee=function(_0x446f40,_0x203d4e){_0x446f40=_0x446f40-0x0;var _0x54bef1=_0x7ee8[_0x446f40];return _0x54bef1;};'use strict';var _=require(_0x87ee('0x0'));var util=require(_0x87ee('0x1'));var logger=require(_0x87ee('0x2'))('api');var moment=require(_0x87ee('0x3'));var BPromise=require(_0x87ee('0x4'));var rp=require(_0x87ee('0x5'));var htmlToText=require(_0x87ee('0x6'));var fs=require('fs');var path=require(_0x87ee('0x7'));var rimraf=require(_0x87ee('0x8'));var config=require(_0x87ee('0x9'));var attributes=require(_0x87ee('0xa'));module[_0x87ee('0xb')]=function(_0x1fa15f,_0x5a4dbc){return _0x1fa15f[_0x87ee('0xc')](_0x87ee('0xd'),attributes,{'tableName':_0x87ee('0xe'),'paranoid':![],'indexes':[{'name':_0x87ee('0xf'),'fields':[_0x87ee('0xf')]},{'name':_0x87ee('0x10'),'fields':[_0x87ee('0x11'),_0x87ee('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x14feeb,_0x4d408f,_0x56b2a7){if(_0x14feeb[_0x87ee('0x13')]){_0x14feeb['plainBody']=htmlToText[_0x87ee('0x14')](_0x14feeb[_0x87ee('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x56b2a7(null,_0x4d408f);},'afterCreate':function(_0x1d49c8,_0x13fb55,_0x19ceda){var _0x54c09f=_0x1fa15f[_0x87ee('0x15')];var _0x2739b0=_0x1d49c8[_0x87ee('0x16')]({'plain':!![]});if(_0x2739b0['direction'][_0x87ee('0x17')]()==='in'||_0x2739b0[_0x87ee('0x18')][_0x87ee('0x17')]()===_0x87ee('0x19')&&!_0x2739b0['secret']&&!_[_0x87ee('0x1a')](_0x2739b0[_0x87ee('0x1b')])){_0x54c09f[_0x87ee('0x1c')]['findOne']({'where':{'id':_0x2739b0[_0x87ee('0x1d')]}})[_0x87ee('0x1e')](function(_0x1e0cc8){if(_0x1e0cc8){_0x1e0cc8[_0x87ee('0x1f')]({'lastMsgAt':_0x2739b0[_0x87ee('0x20')],'lastMsgDirection':_0x2739b0[_0x87ee('0x18')][_0x87ee('0x17')]()});}})[_0x87ee('0x21')](function(_0x240b16){console[_0x87ee('0x22')](_0x240b16);});}_0x19ceda();}},'charset':_0x87ee('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 ab92fc3..87e87ed 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 _0x8e3f=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});config[_0xf8e3('0xb')]=_['defaults'](config[_0xf8e3('0xb')],{'host':_0xf8e3('0xc'),'port':0x18eb});var socket=require(_0xf8e3('0xd'))(new Redis(config[_0xf8e3('0xb')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);function respondWithRpcPromise(_0x299a7e,_0x2a3b59,_0x2d914d){return new BPromise(function(_0x2bc3cd,_0x28f5f0){return client[_0xf8e3('0x10')](_0x299a7e,_0x2d914d)['then'](function(_0xb7d14f){logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,'request\x20sent');logger[_0xf8e3('0x13')](_0xf8e3('0x14'),_0x2a3b59,_0xf8e3('0x15'),JSON[_0xf8e3('0x16')](_0xb7d14f));if(_0xb7d14f['error']){if(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x18')]===0x1f4){logger[_0xf8e3('0x17')]('MailMessage,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f[_0xf8e3('0x17')]['message']);return _0x28f5f0(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}logger[_0xf8e3('0x17')]('MailMessage,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f['error'][_0xf8e3('0x19')]);return _0x2bc3cd(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}else{logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,_0xf8e3('0x15'));_0x2bc3cd(_0xb7d14f[_0xf8e3('0x1a')][_0xf8e3('0x19')]);}})[_0xf8e3('0x1b')](function(_0x13fb31){logger['error'](_0xf8e3('0x12'),_0x2a3b59,_0x13fb31);_0x28f5f0(_0x13fb31);});});}exports[_0xf8e3('0x1c')]=function(_0x24e8d6){var _0x31f55d=this;return new Promise(function(_0x3128ad,_0x11c58e){return db[_0xf8e3('0x1d')][_0xf8e3('0x1e')](_0x24e8d6['body'],{'raw':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6[_0xf8e3('0x1f')][_0xf8e3('0x20')]===undefined?!![]:![]:!![]})[_0xf8e3('0x21')](function(_0x4a1e5f){logger[_0xf8e3('0x11')]('CreateMailMessage',_0x24e8d6);logger[_0xf8e3('0x13')](_0xf8e3('0x1c'),_0x24e8d6,JSON[_0xf8e3('0x16')](_0x4a1e5f));_0x3128ad(_0x4a1e5f);})[_0xf8e3('0x1b')](function(_0x1f4b68){logger[_0xf8e3('0x17')]('CreateMailMessage',_0x1f4b68[_0xf8e3('0x19')],_0x24e8d6);_0x11c58e(_0x31f55d[_0xf8e3('0x17')](0x1f4,_0x1f4b68[_0xf8e3('0x19')]));});});}; \ No newline at end of file +var _0x065e=['options','raw','info','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage','body'];(function(_0x2595ed,_0x4d286c){var _0x52ffe0=function(_0x2720b7){while(--_0x2720b7){_0x2595ed['push'](_0x2595ed['shift']());}};_0x52ffe0(++_0x4d286c);}(_0x065e,0x1a7));var _0xe065=function(_0x3450cb,_0x52da1c){_0x3450cb=_0x3450cb-0x0;var _0x57e434=_0x065e[_0x3450cb];return _0x57e434;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe065('0x1'));var fs=require('fs');var Redis=require(_0xe065('0x2'));var db=require(_0xe065('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x4'));var config=require(_0xe065('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe065('0x6')][_0xe065('0x7')]({'port':0x232a});config[_0xe065('0x8')]=_['defaults'](config[_0xe065('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xe065('0x9'))(new Redis(config[_0xe065('0x8')]));require(_0xe065('0xa'))[_0xe065('0xb')](socket);function respondWithRpcPromise(_0x85001e,_0x531ebd,_0x43827c){return new BPromise(function(_0x6c9117,_0x3f59d3){return client[_0xe065('0xc')](_0x85001e,_0x43827c)[_0xe065('0xd')](function(_0x2a6a6e){logger['info']('MailMessage,\x20%s,\x20%s',_0x531ebd,_0xe065('0xe'));logger[_0xe065('0xf')](_0xe065('0x10'),_0x531ebd,'request\x20sent',JSON[_0xe065('0x11')](_0x2a6a6e));if(_0x2a6a6e[_0xe065('0x12')]){if(_0x2a6a6e[_0xe065('0x12')][_0xe065('0x13')]===0x1f4){logger[_0xe065('0x12')]('MailMessage,\x20%s,\x20%s',_0x531ebd,_0x2a6a6e[_0xe065('0x12')][_0xe065('0x14')]);return _0x3f59d3(_0x2a6a6e[_0xe065('0x12')][_0xe065('0x14')]);}logger[_0xe065('0x12')](_0xe065('0x15'),_0x531ebd,_0x2a6a6e[_0xe065('0x12')]['message']);return _0x6c9117(_0x2a6a6e[_0xe065('0x12')][_0xe065('0x14')]);}else{logger['info'](_0xe065('0x15'),_0x531ebd,_0xe065('0xe'));_0x6c9117(_0x2a6a6e[_0xe065('0x16')][_0xe065('0x14')]);}})[_0xe065('0x17')](function(_0x302adf){logger[_0xe065('0x12')]('MailMessage,\x20%s,\x20%s',_0x531ebd,_0x302adf);_0x3f59d3(_0x302adf);});});}exports[_0xe065('0x18')]=function(_0x52e9b2){var _0x2df517=this;return new Promise(function(_0x23233d,_0x55f55c){return db[_0xe065('0x19')]['create'](_0x52e9b2[_0xe065('0x1a')],{'raw':_0x52e9b2[_0xe065('0x1b')]?_0x52e9b2[_0xe065('0x1b')][_0xe065('0x1c')]===undefined?!![]:![]:!![]})[_0xe065('0xd')](function(_0x105cb2){logger[_0xe065('0x1d')](_0xe065('0x18'),_0x52e9b2);logger[_0xe065('0xf')]('CreateMailMessage',_0x52e9b2,JSON[_0xe065('0x11')](_0x105cb2));_0x23233d(_0x105cb2);})[_0xe065('0x17')](function(_0x44ec95){logger[_0xe065('0x12')]('CreateMailMessage',_0x44ec95['message'],_0x52e9b2);_0x55f55c(_0x2df517[_0xe065('0x12')](0x1f4,_0x44ec95['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 8b6a719..8102f1e 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 _0xff33=['save','update','emit','removeListener','register','length','mailMessage:'];(function(_0x43db9b,_0x385e32){var _0x56b11e=function(_0x1a2745){while(--_0x1a2745){_0x43db9b['push'](_0x43db9b['shift']());}};_0x56b11e(++_0x385e32);}(_0xff33,0x70));var _0x3ff3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xff33[_0x1e7b16];return _0x37fadc;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x3ff3('0x0'),'remove',_0x3ff3('0x1')];function createListener(_0x41c9b3,_0xfdd725){return function(_0x58ef66){_0xfdd725[_0x3ff3('0x2')](_0x41c9b3,_0x58ef66);};}function removeListener(_0x2f74a7,_0x59219a){return function(){MailMessageEvents[_0x3ff3('0x3')](_0x2f74a7,_0x59219a);};}exports[_0x3ff3('0x4')]=function(_0x13464a){for(var _0x3f96ef=0x0,_0x58edcc=events[_0x3ff3('0x5')];_0x3f96ef<_0x58edcc;_0x3f96ef++){var _0xd833d0=events[_0x3f96ef];var _0x39deba=createListener(_0x3ff3('0x6')+_0xd833d0,_0x13464a);MailMessageEvents['on'](_0xd833d0,_0x39deba);}}; \ No newline at end of file +var _0xd232=['save','update','removeListener','./mailMessage.events'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0xd232,0x1d7));var _0x2d23=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd232[_0x321bb2];return _0x9c12ed;};'use strict';var MailMessageEvents=require(_0x2d23('0x0'));var events=[_0x2d23('0x1'),'remove',_0x2d23('0x2')];function createListener(_0x4681f8,_0x2709e7){return function(_0x4c62bc){_0x2709e7['emit'](_0x4681f8,_0x4c62bc);};}function removeListener(_0x36eac,_0x39881b){return function(){MailMessageEvents[_0x2d23('0x3')](_0x36eac,_0x39881b);};}exports['register']=function(_0x4e766c){for(var _0x44146c=0x0,_0x3f2d5c=events['length'];_0x44146c<_0x3f2d5c;_0x44146c++){var _0x10a6b7=events[_0x44146c];var _0x44bd5f=createListener('mailMessage:'+_0x10a6b7,_0x4e766c);MailMessageEvents['on'](_0x10a6b7,_0x44bd5f);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6d9a15d..20b8a95 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 _0x5f61=['./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xcf807,_0x4c736b){var _0x2ef9e9=function(_0x33ed42){while(--_0x33ed42){_0xcf807['push'](_0xcf807['shift']());}};_0x2ef9e9(++_0x4c736b);}(_0x5f61,0x137));var _0x15f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f61[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x15f6('0x0'));var util=require(_0x15f6('0x1'));var path=require(_0x15f6('0x2'));var timeout=require(_0x15f6('0x3'));var express=require('express');var router=express[_0x15f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x15f6('0x5'));var interaction=require(_0x15f6('0x6'));var config=require(_0x15f6('0x7'));var controller=require(_0x15f6('0x8'));router[_0x15f6('0x9')]('/',auth[_0x15f6('0xa')](),controller['index']);router[_0x15f6('0x9')](_0x15f6('0xb'),auth[_0x15f6('0xa')](),controller[_0x15f6('0xc')]);router[_0x15f6('0x9')](_0x15f6('0xd'),auth[_0x15f6('0xa')](),controller[_0x15f6('0xe')]);router[_0x15f6('0x9')]('/:id/members',auth[_0x15f6('0xa')](),controller[_0x15f6('0xf')]);router[_0x15f6('0x9')](_0x15f6('0x10'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x11')]);router['get']('/:id/users',auth[_0x15f6('0xa')](),controller[_0x15f6('0x12')]);router[_0x15f6('0x13')]('/',auth['isAuthenticated'](),controller[_0x15f6('0x14')]);router['post'](_0x15f6('0x10'),auth[_0x15f6('0xa')](),controller['addTeams']);router[_0x15f6('0x13')](_0x15f6('0x15'),auth['isAuthenticated'](),controller[_0x15f6('0x16')]);router[_0x15f6('0x17')]('/:id',auth[_0x15f6('0xa')](),controller[_0x15f6('0x18')]);router['delete'](_0x15f6('0xd'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x19')]);router[_0x15f6('0x1a')](_0x15f6('0x10'),auth[_0x15f6('0xa')](),controller['removeTeams']);router['delete'](_0x15f6('0x15'),auth[_0x15f6('0xa')](),controller[_0x15f6('0x1b')]);module[_0x15f6('0x1c')]=router; \ No newline at end of file +var _0xf6dc=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','put','/:id','update','delete','removeTeams','multer','util','path'];(function(_0x24d711,_0x3cdb28){var _0x3491b4=function(_0xd5957e){while(--_0xd5957e){_0x24d711['push'](_0x24d711['shift']());}};_0x3491b4(++_0x3cdb28);}(_0xf6dc,0x1d8));var _0xcf6d=function(_0x33dffc,_0x2be66e){_0x33dffc=_0x33dffc-0x0;var _0x1f5420=_0xf6dc[_0x33dffc];return _0x1f5420;};'use strict';var multer=require(_0xcf6d('0x0'));var util=require(_0xcf6d('0x1'));var path=require(_0xcf6d('0x2'));var timeout=require(_0xcf6d('0x3'));var express=require(_0xcf6d('0x4'));var router=express['Router']();var fs_extra=require(_0xcf6d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcf6d('0x6'));var config=require(_0xcf6d('0x7'));var controller=require(_0xcf6d('0x8'));router[_0xcf6d('0x9')]('/',auth[_0xcf6d('0xa')](),controller[_0xcf6d('0xb')]);router[_0xcf6d('0x9')](_0xcf6d('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xcf6d('0x9')]('/:id',auth[_0xcf6d('0xa')](),controller['show']);router[_0xcf6d('0x9')](_0xcf6d('0xd'),auth['isAuthenticated'](),controller[_0xcf6d('0xe')]);router['get']('/:id/teams',auth[_0xcf6d('0xa')](),controller[_0xcf6d('0xf')]);router[_0xcf6d('0x9')](_0xcf6d('0x10'),auth[_0xcf6d('0xa')](),controller[_0xcf6d('0x11')]);router[_0xcf6d('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcf6d('0x12')](_0xcf6d('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0xcf6d('0x12')](_0xcf6d('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0xcf6d('0x14')](_0xcf6d('0x15'),auth[_0xcf6d('0xa')](),controller[_0xcf6d('0x16')]);router['delete'](_0xcf6d('0x15'),auth[_0xcf6d('0xa')](),controller['destroy']);router[_0xcf6d('0x17')](_0xcf6d('0x13'),auth['isAuthenticated'](),controller[_0xcf6d('0x18')]);router[_0xcf6d('0x17')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);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 28e8d1c..e463b63 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 _0x6a07=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3cfdfc,_0x1171e5){var _0x2863db=function(_0x136111){while(--_0x136111){_0x3cfdfc['push'](_0x3cfdfc['shift']());}};_0x2863db(++_0x1171e5);}(_0x6a07,0xa6));var _0x76a0=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x6a07[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x76a0('0x0'));module[_0x76a0('0x1')]={'name':{'type':Sequelize[_0x76a0('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x76a0('0x2')]},'timeout':{'type':Sequelize[_0x76a0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x76a0('0x4')](_0x76a0('0x5'),_0x76a0('0x6'),_0x76a0('0x7'))}}; \ No newline at end of file +var _0x96bf=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','STRING','name'];(function(_0x5feeb4,_0x508cef){var _0x2712df=function(_0x156de5){while(--_0x156de5){_0x5feeb4['push'](_0x5feeb4['shift']());}};_0x2712df(++_0x508cef);}(_0x96bf,0x1d2));var _0xf96b=function(_0x4e90e3,_0x570a1d){_0x4e90e3=_0x4e90e3-0x0;var _0x295e5b=_0x96bf[_0x4e90e3];return _0x295e5b;};'use strict';var Sequelize=require(_0xf96b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf96b('0x1')],'unique':_0xf96b('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf96b('0x1')]},'timeout':{'type':Sequelize[_0xf96b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf96b('0x4')](_0xf96b('0x5'),'beepall',_0xf96b('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index e8c5527..72a116f 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 _0x831c=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','MailQueue','includeAll','include','rows','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailQueues','UserProfileSection','userProfileId','autoAssociation','error','catch','describe','getMembers','findOne','UserMailQueue','nolimit','pick','MailQueueId','findAll','User','UserId','updatedAt','%s/%s','createdAt','getTeams','Team','ids','online','voicePause','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','transaction','isEmpty','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','userMailQueue:remove','getAgents','eml-format','rimraf'];(function(_0x35a4d5,_0x6ba6ad){var _0x1a5a73=function(_0x348ddc){while(--_0x348ddc){_0x35a4d5['push'](_0x35a4d5['shift']());}};_0x1a5a73(++_0x6ba6ad);}(_0x831c,0x112));var _0xc831=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x831c[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xc831('0x0'));var rimraf=require(_0xc831('0x1'));var zipdir=require(_0xc831('0x2'));var jsonpatch=require(_0xc831('0x3'));var rp=require(_0xc831('0x4'));var moment=require(_0xc831('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc831('0x6'));var util=require(_0xc831('0x7'));var path=require(_0xc831('0x8'));var sox=require(_0xc831('0x9'));var csv=require(_0xc831('0xa'));var ejs=require(_0xc831('0xb'));var fs=require('fs');var fs_extra=require(_0xc831('0xc'));var _=require('lodash');var squel=require(_0xc831('0xd'));var crypto=require(_0xc831('0xe'));var jsforce=require(_0xc831('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc831('0xa'));var querystring=require(_0xc831('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc831('0x11'));var qs=require(_0xc831('0x12'));var as=require(_0xc831('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc831('0x14'));var utils=require(_0xc831('0x15'));var config=require(_0xc831('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc831('0x17'))['db'];config[_0xc831('0x18')]=_[_0xc831('0x19')](config[_0xc831('0x18')],{'host':_0xc831('0x1a'),'port':0x18eb});var socket=require(_0xc831('0x1b'))(new Redis(config[_0xc831('0x18')]));require(_0xc831('0x1c'))[_0xc831('0x1d')](socket);function respondWithStatusCode(_0x194d78,_0x5d216e){_0x5d216e=_0x5d216e||0xcc;return function(_0x4f5b81){if(_0x4f5b81){return _0x194d78[_0xc831('0x1e')](_0x5d216e);}return _0x194d78[_0xc831('0x1f')](_0x5d216e)[_0xc831('0x20')]();};}function respondWithResult(_0xd61a68,_0x4ec60a){_0x4ec60a=_0x4ec60a||0xc8;return function(_0x5efa9c){if(_0x5efa9c){return _0xd61a68['status'](_0x4ec60a)[_0xc831('0x21')](_0x5efa9c);}};}function respondWithFilteredResult(_0x28fcb9,_0xde0f60){return function(_0x354fad){if(_0x354fad){var _0x42fcd0=typeof _0xde0f60[_0xc831('0x22')]===_0xc831('0x23')&&typeof _0xde0f60[_0xc831('0x24')]===_0xc831('0x23');var _0xb0983d=_0x354fad[_0xc831('0x25')];var _0x219a2b=_0x42fcd0?0x0:_0xde0f60[_0xc831('0x22')];var _0x4ca8cf=_0x42fcd0?_0x354fad[_0xc831('0x25')]:_0xde0f60[_0xc831('0x22')]+_0xde0f60[_0xc831('0x24')];var _0x1641a8;if(_0x4ca8cf>=_0xb0983d){_0x4ca8cf=_0xb0983d;_0x1641a8=0xc8;}else{_0x1641a8=0xce;}_0x28fcb9[_0xc831('0x1f')](_0x1641a8);return _0x28fcb9[_0xc831('0x26')](_0xc831('0x27'),_0x219a2b+'-'+_0x4ca8cf+'/'+_0xb0983d)['json'](_0x354fad);}return null;};}function patchUpdates(_0x37983e){return function(_0x4b5ba3){try{jsonpatch['apply'](_0x4b5ba3,_0x37983e,!![]);}catch(_0x14122d){return BPromise[_0xc831('0x28')](_0x14122d);}return _0x4b5ba3[_0xc831('0x29')]();};}function saveUpdates(_0x4d2b4c,_0x447c22){return function(_0xba9f57){if(_0xba9f57){return _0xba9f57['update'](_0x4d2b4c)[_0xc831('0x2a')](function(_0x129dbc){return _0x129dbc;});}return null;};}function removeEntity(_0xcf883e,_0x338543){return function(_0x1e7540){if(_0x1e7540){return _0x1e7540['destroy']()[_0xc831('0x2a')](function(){var _0x275d61=_0x1e7540[_0xc831('0x2b')]({'plain':!![]});var _0x73d199='MailQueues';return db[_0xc831('0x2c')][_0xc831('0x2d')]({'where':{'type':_0x73d199,'resourceId':_0x275d61['id']}})[_0xc831('0x2a')](function(){return _0x1e7540;});})[_0xc831('0x2a')](function(){_0xcf883e[_0xc831('0x1f')](0xcc)[_0xc831('0x20')]();});}};}function handleEntityNotFound(_0x2e61b8,_0x534970){return function(_0x318597){if(!_0x318597){_0x2e61b8[_0xc831('0x1e')](0x194);}return _0x318597;};}function handleError(_0x528520,_0xbfd726){_0xbfd726=_0xbfd726||0x1f4;return function(_0x5c086b){logger['error'](_0x5c086b[_0xc831('0x2e')]);if(_0x5c086b[_0xc831('0x2f')]){delete _0x5c086b[_0xc831('0x2f')];}_0x528520[_0xc831('0x1f')](_0xbfd726)[_0xc831('0x30')](_0x5c086b);};}exports[_0xc831('0x31')]=function(_0x6b8cc3,_0x177e0a){var _0x356ee6={},_0x1a017c={},_0x2c1369={'count':0x0,'rows':[]};var _0x11ae04=_[_0xc831('0x32')](db['MailQueue'][_0xc831('0x33')],function(_0x250798){return{'name':_0x250798[_0xc831('0x34')],'type':_0x250798[_0xc831('0x35')][_0xc831('0x36')]};});_0x1a017c[_0xc831('0x37')]=_[_0xc831('0x32')](_0x11ae04,_0xc831('0x2f'));_0x1a017c[_0xc831('0x38')]=_[_0xc831('0x39')](_0x6b8cc3['query']);_0x1a017c[_0xc831('0x3a')]=_[_0xc831('0x3b')](_0x1a017c[_0xc831('0x37')],_0x1a017c[_0xc831('0x38')]);_0x356ee6[_0xc831('0x3c')]=_['intersection'](_0x1a017c['model'],qs[_0xc831('0x3d')](_0x6b8cc3['query'][_0xc831('0x3d')]));_0x356ee6[_0xc831('0x3c')]=_0x356ee6['attributes'][_0xc831('0x3e')]?_0x356ee6[_0xc831('0x3c')]:_0x1a017c[_0xc831('0x37')];if(!_0x6b8cc3[_0xc831('0x38')][_0xc831('0x3f')]('nolimit')){_0x356ee6[_0xc831('0x24')]=qs[_0xc831('0x24')](_0x6b8cc3[_0xc831('0x38')][_0xc831('0x24')]);_0x356ee6[_0xc831('0x22')]=qs['offset'](_0x6b8cc3['query'][_0xc831('0x22')]);}_0x356ee6[_0xc831('0x40')]=qs[_0xc831('0x41')](_0x6b8cc3[_0xc831('0x38')][_0xc831('0x41')]);_0x356ee6[_0xc831('0x42')]=qs[_0xc831('0x3a')](_['pick'](_0x6b8cc3[_0xc831('0x38')],_0x1a017c[_0xc831('0x3a')]),_0x11ae04);if(_0x6b8cc3[_0xc831('0x38')][_0xc831('0x43')]){_0x356ee6[_0xc831('0x42')]=_[_0xc831('0x44')](_0x356ee6[_0xc831('0x42')],{'$or':_[_0xc831('0x32')](_0x11ae04,function(_0x46c223){if(_0x46c223[_0xc831('0x35')]!=='VIRTUAL'){var _0x21b17d={};_0x21b17d[_0x46c223[_0xc831('0x2f')]]={'$like':'%'+_0x6b8cc3[_0xc831('0x38')][_0xc831('0x43')]+'%'};return _0x21b17d;}})});}_0x356ee6=_[_0xc831('0x44')]({},_0x356ee6,_0x6b8cc3['options']);var _0x579b93={'where':_0x356ee6['where']};return db[_0xc831('0x45')]['count'](_0x579b93)[_0xc831('0x2a')](function(_0x1b1997){_0x2c1369[_0xc831('0x25')]=_0x1b1997;if(_0x6b8cc3[_0xc831('0x38')][_0xc831('0x46')]){_0x356ee6[_0xc831('0x47')]=[{'all':!![]}];}return db[_0xc831('0x45')]['findAll'](_0x356ee6);})[_0xc831('0x2a')](function(_0x13c5a7){_0x2c1369[_0xc831('0x48')]=_0x13c5a7;return _0x2c1369;})[_0xc831('0x2a')](respondWithFilteredResult(_0x177e0a,_0x356ee6))['catch'](handleError(_0x177e0a,null));};exports['show']=function(_0x2972f5,_0xd64b63){var _0x123db3={'raw':!![],'where':{'id':_0x2972f5[_0xc831('0x49')]['id']}},_0x40b793={};_0x40b793[_0xc831('0x37')]=_[_0xc831('0x39')](db[_0xc831('0x45')][_0xc831('0x33')]);_0x40b793[_0xc831('0x38')]=_[_0xc831('0x39')](_0x2972f5[_0xc831('0x38')]);_0x40b793[_0xc831('0x3a')]=_[_0xc831('0x3b')](_0x40b793[_0xc831('0x37')],_0x40b793[_0xc831('0x38')]);_0x123db3['attributes']=_[_0xc831('0x3b')](_0x40b793['model'],qs['fields'](_0x2972f5[_0xc831('0x38')]['fields']));_0x123db3['attributes']=_0x123db3['attributes']['length']?_0x123db3[_0xc831('0x3c')]:_0x40b793[_0xc831('0x37')];if(_0x2972f5['query'][_0xc831('0x46')]){_0x123db3[_0xc831('0x47')]=[{'all':!![]}];}_0x123db3=_[_0xc831('0x44')]({},_0x123db3,_0x2972f5[_0xc831('0x4a')]);return db[_0xc831('0x45')][_0xc831('0x4b')](_0x123db3)['then'](handleEntityNotFound(_0xd64b63,null))[_0xc831('0x2a')](respondWithResult(_0xd64b63,null))['catch'](handleError(_0xd64b63,null));};exports[_0xc831('0x4c')]=function(_0x10335e,_0x27d705){return db['MailQueue'][_0xc831('0x4c')](_0x10335e[_0xc831('0x4d')],{})[_0xc831('0x2a')](function(_0x1c3f8f){var _0x497336=_0x10335e[_0xc831('0x4e')]['get']({'plain':!![]});if(!_0x497336)throw new Error(_0xc831('0x4f'));if(_0x497336['role']==='user'){var _0x40d5ec=_0x1c3f8f['get']({'plain':!![]});var _0x12898d=_0xc831('0x50');return db[_0xc831('0x51')][_0xc831('0x4b')]({'where':{'name':_0x12898d,'userProfileId':_0x497336[_0xc831('0x52')]},'raw':!![]})['then'](function(_0x1cd26a){if(_0x1cd26a&&_0x1cd26a[_0xc831('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x40d5ec[_0xc831('0x2f')],'resourceId':_0x40d5ec['id'],'type':_0x1cd26a[_0xc831('0x2f')],'sectionId':_0x1cd26a['id']},{})['then'](function(){return _0x1c3f8f;});}else{return _0x1c3f8f;}})['catch'](function(_0x270272){logger[_0xc831('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x270272);throw _0x270272;});}return _0x1c3f8f;})[_0xc831('0x2a')](respondWithResult(_0x27d705,0xc9))[_0xc831('0x55')](handleError(_0x27d705,null));};exports['update']=function(_0x4018cf,_0x5af59a){if(_0x4018cf[_0xc831('0x4d')]['id']){delete _0x4018cf[_0xc831('0x4d')]['id'];}return db[_0xc831('0x45')][_0xc831('0x4b')]({'where':{'id':_0x4018cf['params']['id']}})['then'](handleEntityNotFound(_0x5af59a,null))['then'](saveUpdates(_0x4018cf[_0xc831('0x4d')],null))['then'](respondWithResult(_0x5af59a,null))[_0xc831('0x55')](handleError(_0x5af59a,null));};exports[_0xc831('0x2d')]=function(_0x459549,_0x113a70){return db[_0xc831('0x45')][_0xc831('0x4b')]({'where':{'id':_0x459549[_0xc831('0x49')]['id']}})[_0xc831('0x2a')](handleEntityNotFound(_0x113a70,null))[_0xc831('0x2a')](removeEntity(_0x113a70,null))[_0xc831('0x55')](handleError(_0x113a70,null));};exports[_0xc831('0x56')]=function(_0x547402,_0x526a35){return db[_0xc831('0x45')]['describe']()['then'](respondWithResult(_0x526a35,null))['catch'](handleError(_0x526a35,null));};exports[_0xc831('0x57')]=function(_0x173a44,_0x4ee6b3,_0x5a4e04){var _0x40d0c0={'raw':!![],'where':{}},_0x3a5144={},_0x1b75e9;return db[_0xc831('0x45')][_0xc831('0x58')]({'where':{'id':_0x173a44['params']['id']}})['then'](handleEntityNotFound(_0x4ee6b3,null))['then'](function(_0x3a0e42){if(_0x3a0e42){_0x1b75e9=_0x3a0e42[_0xc831('0x2b')]({'plain':!![]});_0x3a5144[_0xc831('0x37')]=_[_0xc831('0x39')](db[_0xc831('0x59')]['rawAttributes']);_0x3a5144[_0xc831('0x38')]=_[_0xc831('0x39')](_0x173a44[_0xc831('0x38')]);_0x3a5144[_0xc831('0x3a')]=_['intersection'](_0x3a5144[_0xc831('0x37')],_0x3a5144['query']);_0x40d0c0['attributes']=_[_0xc831('0x3b')](_0x3a5144[_0xc831('0x37')],qs[_0xc831('0x3d')](_0x173a44[_0xc831('0x38')]['fields']));_0x40d0c0[_0xc831('0x3c')]=_0x40d0c0['attributes'][_0xc831('0x3e')]?_0x40d0c0[_0xc831('0x3c')]:_0x3a5144['model'];if(!_0x173a44[_0xc831('0x38')][_0xc831('0x3f')](_0xc831('0x5a'))){_0x40d0c0[_0xc831('0x24')]=qs[_0xc831('0x24')](_0x173a44[_0xc831('0x38')][_0xc831('0x24')]);_0x40d0c0[_0xc831('0x22')]=qs[_0xc831('0x22')](_0x173a44[_0xc831('0x38')][_0xc831('0x22')]);}_0x40d0c0[_0xc831('0x40')]=qs['sort'](_0x173a44[_0xc831('0x38')][_0xc831('0x41')]);_0x40d0c0[_0xc831('0x42')]=qs[_0xc831('0x3a')](_[_0xc831('0x5b')](_0x173a44[_0xc831('0x38')],_0x3a5144[_0xc831('0x3a')]));_0x40d0c0[_0xc831('0x42')][_0xc831('0x5c')]=_0x3a0e42['id'];if(_0x173a44[_0xc831('0x38')][_0xc831('0x43')]){_0x40d0c0[_0xc831('0x42')]=_['merge'](_0x40d0c0['where'],{'$or':_['map'](_0x40d0c0[_0xc831('0x3c')],function(_0x15b20a){var _0x328ef3={};_0x328ef3[_0x15b20a]={'$like':'%'+_0x173a44[_0xc831('0x38')][_0xc831('0x43')]+'%'};return _0x328ef3;})});}_0x40d0c0=_[_0xc831('0x44')]({},_0x40d0c0,_0x173a44[_0xc831('0x4a')]);return db[_0xc831('0x59')][_0xc831('0x5d')](_0x40d0c0);}})['then'](function(_0x339699){if(_0x339699){return db[_0xc831('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x339699,_0xc831('0x5f')),'role':'agent'},'attributes':['id',_0xc831('0x2f'),'mailPause',_0xc831('0x60'),'createdAt']});}})[_0xc831('0x2a')](function(_0x3e3f6c){if(_0x3e3f6c){return{'count':_0x3e3f6c[_0xc831('0x25')],'rows':_[_0xc831('0x32')](_0x3e3f6c[_0xc831('0x48')],function(_0x16d360){return{'membername':_0x16d360[_0xc831('0x2f')],'UserId':_0x16d360['id'],'queue_name':_0x1b75e9[_0xc831('0x2f')],'MailQueueId':_0x1b75e9['id'],'interface':util['format'](_0xc831('0x61'),'SIP',_0x16d360['name']),'penalty':0x0,'paused':_0x16d360['mailPause'],'createdAt':_0x16d360[_0xc831('0x62')],'updatedAt':_0x16d360['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4ee6b3,_0x40d0c0))[_0xc831('0x55')](handleError(_0x4ee6b3,null));};exports[_0xc831('0x63')]=function(_0x3f9090,_0x149e55,_0xfac03b){var _0x55a5ae={};var _0x588e37={};var _0x17df29;var _0x23e811;return db[_0xc831('0x45')][_0xc831('0x58')]({'where':{'id':_0x3f9090['params']['id']}})[_0xc831('0x2a')](handleEntityNotFound(_0x149e55,null))[_0xc831('0x2a')](function(_0x4abe6c){if(_0x4abe6c){_0x17df29=_0x4abe6c;_0x588e37[_0xc831('0x37')]=_[_0xc831('0x39')](db[_0xc831('0x64')]['rawAttributes']);_0x588e37['query']=_[_0xc831('0x39')](_0x3f9090[_0xc831('0x38')]);_0x588e37[_0xc831('0x3a')]=_[_0xc831('0x3b')](_0x588e37[_0xc831('0x37')],_0x588e37[_0xc831('0x38')]);_0x55a5ae[_0xc831('0x3c')]=_[_0xc831('0x3b')](_0x588e37['model'],qs[_0xc831('0x3d')](_0x3f9090[_0xc831('0x38')]['fields']));_0x55a5ae[_0xc831('0x3c')]=_0x55a5ae[_0xc831('0x3c')][_0xc831('0x3e')]?_0x55a5ae['attributes']:_0x588e37[_0xc831('0x37')];_0x55a5ae[_0xc831('0x40')]=qs[_0xc831('0x41')](_0x3f9090[_0xc831('0x38')]['sort']);_0x55a5ae['where']=qs[_0xc831('0x3a')](_[_0xc831('0x5b')](_0x3f9090[_0xc831('0x38')],_0x588e37[_0xc831('0x3a')]));if(_0x3f9090['query'][_0xc831('0x43')]){_0x55a5ae[_0xc831('0x42')]=_[_0xc831('0x44')](_0x55a5ae[_0xc831('0x42')],{'$or':_['map'](_0x55a5ae[_0xc831('0x3c')],function(_0x3b1391){var _0x32dc63={};_0x32dc63[_0x3b1391]={'$like':'%'+_0x3f9090[_0xc831('0x38')]['filter']+'%'};return _0x32dc63;})});}_0x55a5ae=_[_0xc831('0x44')]({},_0x55a5ae,_0x3f9090['options']);return _0x17df29[_0xc831('0x63')](_0x55a5ae);}})[_0xc831('0x2a')](function(_0x537f52){if(_0x537f52){_0x23e811=_0x537f52['length'];if(!_0x3f9090[_0xc831('0x38')]['hasOwnProperty'](_0xc831('0x5a'))){_0x55a5ae[_0xc831('0x24')]=qs[_0xc831('0x24')](_0x3f9090[_0xc831('0x38')][_0xc831('0x24')]);_0x55a5ae['offset']=qs[_0xc831('0x22')](_0x3f9090[_0xc831('0x38')][_0xc831('0x22')]);}return _0x17df29[_0xc831('0x63')](_0x55a5ae);}})[_0xc831('0x2a')](function(_0x244879){if(_0x244879){return _0x244879?{'count':_0x23e811,'rows':_0x244879}:null;}})[_0xc831('0x2a')](respondWithResult(_0x149e55,null))[_0xc831('0x55')](handleError(_0x149e55,null));};exports['addTeams']=function(_0x12f330,_0x5a3e55,_0x4c2ea8){var _0x2d1a59=_0x12f330[_0xc831('0x4d')][_0xc831('0x65')];return db[_0xc831('0x64')]['findAll']({'where':{'id':_0x2d1a59},'attributes':['id'],'include':[{'model':db[_0xc831('0x5e')],'as':'Agents','attributes':['id','name',_0xc831('0x66'),_0xc831('0x67'),'interface'],'raw':!![]}]})[_0xc831('0x2a')](function(_0x42dd3c){if(_0x42dd3c){var _0x4bf571=_[_0xc831('0x68')](_0x42dd3c,function(_0x2bb2dc){var _0x481472=_0x2bb2dc['get']({'plain':!![]});return _0x481472['Agents'];});return db[_0xc831('0x45')][_0xc831('0x4b')]({'where':{'id':_0x12f330[_0xc831('0x49')]['id']}})['then'](function(_0x4d2252){return db[_0xc831('0x69')]['transaction'](function(_0x4e68bb){return _0x4d2252['addTeams'](_0x2d1a59,{'transaction':_0x4e68bb})[_0xc831('0x2a')](function(){return BPromise[_0xc831('0x6a')](_0x4bf571,function(_0x23e718){return db['UserMailQueue'][_0xc831('0x6b')]({'where':{'UserId':_0x23e718['id'],'MailQueueId':_0x12f330['params']['id']},'transaction':_0x4e68bb});});})['then'](function(){_0x4bf571[_0xc831('0x6c')](function(_0x2e1258){socket[_0xc831('0x6d')]('userMailQueue:save',{'UserId':_0x2e1258['id'],'MailQueueId':_0x4d2252['id']});});});});});}})[_0xc831('0x2a')](respondWithStatusCode(_0x5a3e55,null))[_0xc831('0x55')](handleError(_0x5a3e55,null));};exports[_0xc831('0x6e')]=function(_0x5161a6,_0x57e33d,_0x57f315){return db['Team']['findAll']({'where':{'id':_0x5161a6[_0xc831('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc831('0x5e')],'as':_0xc831('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xc831('0x2a')](handleEntityNotFound(_0x57e33d,null))[_0xc831('0x2a')](function(_0xfd38de){var _0x3a9a41=_[_0xc831('0x32')](_0xfd38de,'id');var _0x2c4d48=[];var _0x47e7df=[];var _0x516048=squel[_0xc831('0x70')]();_0x516048[_0xc831('0x71')](_0xc831('0x72'))[_0xc831('0x73')](_0xc831('0x74'),'tq')[_0xc831('0x75')](_0xc831('0x76'),'ut',_0xc831('0x77'))[_0xc831('0x42')]('MailQueueId\x20=\x20?',_0x5161a6['params']['id']);for(var _0x3fd605=0x0;_0x3fd605<_0xfd38de[_0xc831('0x3e')];_0x3fd605+=0x1){let _0x13b9d7=_0xfd38de[_0x3fd605];for(var _0xc5594f=0x0;_0xc5594f<_0x13b9d7[_0xc831('0x6f')][_0xc831('0x3e')];_0xc5594f+=0x1){let _0xf8303a=_0x13b9d7[_0xc831('0x6f')][_0xc5594f];var _0x3451ef=_0x516048[_0xc831('0x78')]();_0x3451ef[_0xc831('0x42')](_0xc831('0x79'),_0xf8303a['id']);_0x47e7df['push'](db[_0xc831('0x69')][_0xc831('0x38')](_0x3451ef[_0xc831('0x7a')](),{'type':db[_0xc831('0x69')][_0xc831('0x7b')][_0xc831('0x7c')]})[_0xc831('0x2a')](function(_0xc22cfc){if(_0xc22cfc[_0xc831('0x3e')]===0x1){return _0xf8303a['id'];}else{var _0x4ef999=_['every'](_[_0xc831('0x32')](_0xc22cfc,'TeamId'),function(_0x3a1212){return _[_0xc831('0x7d')](_0x3a9a41,_0x3a1212);});if(_0x4ef999){return _0xf8303a['id'];}}}));}}return BPromise[_0xc831('0x7e')](_0x47e7df)[_0xc831('0x2a')](function(_0x45620c){_0x2c4d48=_(_0x2c4d48)[_0xc831('0x7f')](_0x45620c)['compact']()['value']();return db[_0xc831('0x45')]['find']({'where':{'id':_0x5161a6[_0xc831('0x49')]['id']}})['then'](function(_0x4188b0){return db[_0xc831('0x69')][_0xc831('0x80')](function(_0x3642b1){return _0x4188b0[_0xc831('0x6e')](_0x5161a6[_0xc831('0x38')][_0xc831('0x65')],{'transaction':_0x3642b1})[_0xc831('0x2a')](function(){if(!_[_0xc831('0x81')](_0x2c4d48)){return _0x4188b0['removeAgents'](_0x2c4d48,{'transaction':_0x3642b1});}})[_0xc831('0x2a')](function(){_0x2c4d48[_0xc831('0x6c')](function(_0x419736){socket[_0xc831('0x6d')]('userMailQueue:remove',{'UserId':_0x419736,'MailQueueId':_0x4188b0['id']});});});});});});})[_0xc831('0x2a')](respondWithStatusCode(_0x57e33d,null))[_0xc831('0x55')](handleError(_0x57e33d,null));};exports[_0xc831('0x82')]=function(_0x572217,_0x1ab9ee,_0x1f92af){return db['MailQueue'][_0xc831('0x4b')]({'where':{'id':_0x572217[_0xc831('0x49')]['id']}})[_0xc831('0x2a')](handleEntityNotFound(_0x1ab9ee,null))[_0xc831('0x2a')](function(_0x5b4f7c){if(_0x5b4f7c){return _0x5b4f7c[_0xc831('0x82')](_0x572217[_0xc831('0x4d')]['ids'],_[_0xc831('0x83')](_0x572217[_0xc831('0x4d')],['ids','id'])||{})[_0xc831('0x84')](function(_0x5d7260){for(var _0x101d82=0x0;_0x101d82<_0x572217[_0xc831('0x4d')][_0xc831('0x65')][_0xc831('0x3e')];_0x101d82+=0x1){socket[_0xc831('0x6d')](_0xc831('0x85'),{'UserId':Number(_0x572217[_0xc831('0x4d')][_0xc831('0x65')][_0x101d82]),'MailQueueId':Number(_0x572217[_0xc831('0x49')]['id'])});}return _0x5d7260;});}})[_0xc831('0x2a')](respondWithResult(_0x1ab9ee,null))['catch'](handleError(_0x1ab9ee,null));};exports[_0xc831('0x86')]=function(_0x3c8a83,_0x57a846,_0x4e4e8b){return db[_0xc831('0x45')][_0xc831('0x4b')]({'where':{'id':_0x3c8a83[_0xc831('0x49')]['id']}})[_0xc831('0x2a')](handleEntityNotFound(_0x57a846,null))[_0xc831('0x2a')](function(_0x6f0d3b){if(_0x6f0d3b){return _0x6f0d3b[_0xc831('0x86')](_0x3c8a83['query'][_0xc831('0x65')])[_0xc831('0x2a')](function(){if(_[_0xc831('0x87')](_0x3c8a83['query'][_0xc831('0x65')])){for(var _0x114fe0=0x0;_0x114fe0<_0x3c8a83[_0xc831('0x38')][_0xc831('0x65')][_0xc831('0x3e')];_0x114fe0+=0x1){socket[_0xc831('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x3c8a83['query'][_0xc831('0x65')][_0x114fe0]),'MailQueueId':Number(_0x3c8a83[_0xc831('0x49')]['id'])});}}else{socket[_0xc831('0x6d')](_0xc831('0x88'),{'UserId':Number(_0x3c8a83[_0xc831('0x38')][_0xc831('0x65')]),'MailQueueId':Number(_0x3c8a83['params']['id'])});}});}})[_0xc831('0x2a')](respondWithStatusCode(_0x57a846,null))[_0xc831('0x55')](handleError(_0x57a846,null));};exports[_0xc831('0x89')]=function(_0x4126f4,_0x18a472,_0x59b872){var _0x2e29fe={};var _0x4983fc={};var _0x1e791d;var _0x3b2ea3;return db[_0xc831('0x45')][_0xc831('0x58')]({'where':{'id':_0x4126f4['params']['id']}})['then'](handleEntityNotFound(_0x18a472,null))[_0xc831('0x2a')](function(_0x112488){if(_0x112488){_0x1e791d=_0x112488;_0x4983fc['model']=_[_0xc831('0x39')](db['User']['rawAttributes']);_0x4983fc[_0xc831('0x38')]=_[_0xc831('0x39')](_0x4126f4[_0xc831('0x38')]);_0x4983fc['filters']=_['intersection'](_0x4983fc[_0xc831('0x37')],_0x4983fc[_0xc831('0x38')]);_0x2e29fe['attributes']=_['intersection'](_0x4983fc['model'],qs['fields'](_0x4126f4['query'][_0xc831('0x3d')]));_0x2e29fe[_0xc831('0x3c')]=_0x2e29fe[_0xc831('0x3c')][_0xc831('0x3e')]?_0x2e29fe[_0xc831('0x3c')]:_0x4983fc[_0xc831('0x37')];_0x2e29fe[_0xc831('0x40')]=qs[_0xc831('0x41')](_0x4126f4[_0xc831('0x38')][_0xc831('0x41')]);_0x2e29fe[_0xc831('0x42')]=qs[_0xc831('0x3a')](_[_0xc831('0x5b')](_0x4126f4['query'],_0x4983fc[_0xc831('0x3a')]));if(_0x4126f4['query']['filter']){_0x2e29fe['where']=_[_0xc831('0x44')](_0x2e29fe[_0xc831('0x42')],{'$or':_[_0xc831('0x32')](_0x2e29fe['attributes'],function(_0x5d130b){var _0x1d8ab8={};_0x1d8ab8[_0x5d130b]={'$like':'%'+_0x4126f4[_0xc831('0x38')]['filter']+'%'};return _0x1d8ab8;})});}_0x2e29fe=_[_0xc831('0x44')]({},_0x2e29fe,_0x4126f4['options']);return _0x1e791d[_0xc831('0x89')](_0x2e29fe);}})['then'](function(_0x949349){if(_0x949349){_0x3b2ea3=_0x949349[_0xc831('0x3e')];if(!_0x4126f4[_0xc831('0x38')]['hasOwnProperty'](_0xc831('0x5a'))){_0x2e29fe[_0xc831('0x24')]=qs[_0xc831('0x24')](_0x4126f4[_0xc831('0x38')][_0xc831('0x24')]);_0x2e29fe['offset']=qs[_0xc831('0x22')](_0x4126f4[_0xc831('0x38')][_0xc831('0x22')]);}return _0x1e791d[_0xc831('0x89')](_0x2e29fe);}})[_0xc831('0x2a')](function(_0x2154f7){if(_0x2154f7){return _0x2154f7?{'count':_0x3b2ea3,'rows':_0x2154f7}:null;}})[_0xc831('0x2a')](respondWithResult(_0x18a472,null))['catch'](handleError(_0x18a472,null));}; \ No newline at end of file +var _0x7662=['nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','rawAttributes','MailQueueId','options','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','removeTeams','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','get','MailQueues','UserProfileResource','destroy','error','name','index','map','MailQueue','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x1a6894,_0x4df09a){var _0x596207=function(_0x144eb4){while(--_0x144eb4){_0x1a6894['push'](_0x1a6894['shift']());}};_0x596207(++_0x4df09a);}(_0x7662,0xd2));var _0x2766=function(_0x20a621,_0x35aacf){_0x20a621=_0x20a621-0x0;var _0x390c82=_0x7662[_0x20a621];return _0x390c82;};'use strict';var emlformat=require(_0x2766('0x0'));var rimraf=require(_0x2766('0x1'));var zipdir=require(_0x2766('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2766('0x3'));var moment=require(_0x2766('0x4'));var BPromise=require(_0x2766('0x5'));var Mustache=require(_0x2766('0x6'));var util=require('util');var path=require(_0x2766('0x7'));var sox=require(_0x2766('0x8'));var csv=require(_0x2766('0x9'));var ejs=require(_0x2766('0xa'));var fs=require('fs');var fs_extra=require(_0x2766('0xb'));var _=require(_0x2766('0xc'));var squel=require(_0x2766('0xd'));var crypto=require(_0x2766('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2766('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2766('0x10'));var Redis=require(_0x2766('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2766('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2766('0x13'));var logger=require(_0x2766('0x14'))('api');var utils=require(_0x2766('0x15'));var config=require(_0x2766('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2766('0x17')]=_[_0x2766('0x18')](config[_0x2766('0x17')],{'host':_0x2766('0x19'),'port':0x18eb});var socket=require(_0x2766('0x1a'))(new Redis(config['redis']));require('./mailQueue.socket')[_0x2766('0x1b')](socket);function respondWithStatusCode(_0x36d143,_0x45b8e4){_0x45b8e4=_0x45b8e4||0xcc;return function(_0x4e14e2){if(_0x4e14e2){return _0x36d143[_0x2766('0x1c')](_0x45b8e4);}return _0x36d143['status'](_0x45b8e4)['end']();};}function respondWithResult(_0x3abdc8,_0x5e8d2b){_0x5e8d2b=_0x5e8d2b||0xc8;return function(_0x1fb454){if(_0x1fb454){return _0x3abdc8[_0x2766('0x1d')](_0x5e8d2b)['json'](_0x1fb454);}};}function respondWithFilteredResult(_0x230307,_0x1ad6b2){return function(_0x5793a1){if(_0x5793a1){var _0x2bec43=typeof _0x1ad6b2[_0x2766('0x1e')]==='undefined'&&typeof _0x1ad6b2[_0x2766('0x1f')]===_0x2766('0x20');var _0x516498=_0x5793a1[_0x2766('0x21')];var _0x588d8b=_0x2bec43?0x0:_0x1ad6b2[_0x2766('0x1e')];var _0x5182f0=_0x2bec43?_0x5793a1[_0x2766('0x21')]:_0x1ad6b2[_0x2766('0x1e')]+_0x1ad6b2['limit'];var _0x178e39;if(_0x5182f0>=_0x516498){_0x5182f0=_0x516498;_0x178e39=0xc8;}else{_0x178e39=0xce;}_0x230307[_0x2766('0x1d')](_0x178e39);return _0x230307['set'](_0x2766('0x22'),_0x588d8b+'-'+_0x5182f0+'/'+_0x516498)['json'](_0x5793a1);}return null;};}function patchUpdates(_0x210c85){return function(_0x49cee5){try{jsonpatch[_0x2766('0x23')](_0x49cee5,_0x210c85,!![]);}catch(_0x51670f){return BPromise[_0x2766('0x24')](_0x51670f);}return _0x49cee5[_0x2766('0x25')]();};}function saveUpdates(_0x2055a0,_0x3b7941){return function(_0x5d6c38){if(_0x5d6c38){return _0x5d6c38[_0x2766('0x26')](_0x2055a0)[_0x2766('0x27')](function(_0x1d4c95){return _0x1d4c95;});}return null;};}function removeEntity(_0x20d8c,_0x3ff2b1){return function(_0xdf6530){if(_0xdf6530){return _0xdf6530['destroy']()[_0x2766('0x27')](function(){var _0x3ce764=_0xdf6530[_0x2766('0x28')]({'plain':!![]});var _0x9dae91=_0x2766('0x29');return db[_0x2766('0x2a')][_0x2766('0x2b')]({'where':{'type':_0x9dae91,'resourceId':_0x3ce764['id']}})[_0x2766('0x27')](function(){return _0xdf6530;});})[_0x2766('0x27')](function(){_0x20d8c[_0x2766('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9147,_0x508344){return function(_0x4370c0){if(!_0x4370c0){_0x5b9147[_0x2766('0x1c')](0x194);}return _0x4370c0;};}function handleError(_0x5178bf,_0x5e7bd8){_0x5e7bd8=_0x5e7bd8||0x1f4;return function(_0x387e60){logger[_0x2766('0x2c')](_0x387e60['stack']);if(_0x387e60[_0x2766('0x2d')]){delete _0x387e60[_0x2766('0x2d')];}_0x5178bf['status'](_0x5e7bd8)['send'](_0x387e60);};}exports[_0x2766('0x2e')]=function(_0x2c44d9,_0x5bb7ab){var _0x5904ab={},_0x2032a7={},_0x3c4f10={'count':0x0,'rows':[]};var _0x20976a=_[_0x2766('0x2f')](db[_0x2766('0x30')]['rawAttributes'],function(_0x234287){return{'name':_0x234287[_0x2766('0x31')],'type':_0x234287[_0x2766('0x32')]['key']};});_0x2032a7['model']=_['map'](_0x20976a,_0x2766('0x2d'));_0x2032a7[_0x2766('0x33')]=_[_0x2766('0x34')](_0x2c44d9[_0x2766('0x33')]);_0x2032a7[_0x2766('0x35')]=_['intersection'](_0x2032a7[_0x2766('0x36')],_0x2032a7[_0x2766('0x33')]);_0x5904ab[_0x2766('0x37')]=_[_0x2766('0x38')](_0x2032a7['model'],qs[_0x2766('0x39')](_0x2c44d9[_0x2766('0x33')][_0x2766('0x39')]));_0x5904ab[_0x2766('0x37')]=_0x5904ab[_0x2766('0x37')][_0x2766('0x3a')]?_0x5904ab[_0x2766('0x37')]:_0x2032a7['model'];if(!_0x2c44d9[_0x2766('0x33')][_0x2766('0x3b')](_0x2766('0x3c'))){_0x5904ab[_0x2766('0x1f')]=qs[_0x2766('0x1f')](_0x2c44d9[_0x2766('0x33')]['limit']);_0x5904ab[_0x2766('0x1e')]=qs[_0x2766('0x1e')](_0x2c44d9[_0x2766('0x33')][_0x2766('0x1e')]);}_0x5904ab[_0x2766('0x3d')]=qs['sort'](_0x2c44d9[_0x2766('0x33')][_0x2766('0x3e')]);_0x5904ab[_0x2766('0x3f')]=qs[_0x2766('0x35')](_[_0x2766('0x40')](_0x2c44d9['query'],_0x2032a7['filters']),_0x20976a);if(_0x2c44d9[_0x2766('0x33')]['filter']){_0x5904ab['where']=_[_0x2766('0x41')](_0x5904ab['where'],{'$or':_[_0x2766('0x2f')](_0x20976a,function(_0x4bd417){if(_0x4bd417[_0x2766('0x32')]!=='VIRTUAL'){var _0x44735b={};_0x44735b[_0x4bd417['name']]={'$like':'%'+_0x2c44d9[_0x2766('0x33')][_0x2766('0x42')]+'%'};return _0x44735b;}})});}_0x5904ab=_[_0x2766('0x41')]({},_0x5904ab,_0x2c44d9['options']);var _0x552fc5={'where':_0x5904ab[_0x2766('0x3f')]};return db['MailQueue']['count'](_0x552fc5)['then'](function(_0x2b39b6){_0x3c4f10[_0x2766('0x21')]=_0x2b39b6;if(_0x2c44d9[_0x2766('0x33')][_0x2766('0x43')]){_0x5904ab[_0x2766('0x44')]=[{'all':!![]}];}return db['MailQueue'][_0x2766('0x45')](_0x5904ab);})['then'](function(_0x233cee){_0x3c4f10[_0x2766('0x46')]=_0x233cee;return _0x3c4f10;})[_0x2766('0x27')](respondWithFilteredResult(_0x5bb7ab,_0x5904ab))['catch'](handleError(_0x5bb7ab,null));};exports[_0x2766('0x47')]=function(_0x14e4ee,_0x214201){var _0x50064b={'raw':!![],'where':{'id':_0x14e4ee[_0x2766('0x48')]['id']}},_0x3f9c4a={};_0x3f9c4a[_0x2766('0x36')]=_[_0x2766('0x34')](db[_0x2766('0x30')]['rawAttributes']);_0x3f9c4a[_0x2766('0x33')]=_[_0x2766('0x34')](_0x14e4ee['query']);_0x3f9c4a[_0x2766('0x35')]=_[_0x2766('0x38')](_0x3f9c4a[_0x2766('0x36')],_0x3f9c4a[_0x2766('0x33')]);_0x50064b['attributes']=_[_0x2766('0x38')](_0x3f9c4a[_0x2766('0x36')],qs[_0x2766('0x39')](_0x14e4ee['query']['fields']));_0x50064b[_0x2766('0x37')]=_0x50064b[_0x2766('0x37')][_0x2766('0x3a')]?_0x50064b['attributes']:_0x3f9c4a[_0x2766('0x36')];if(_0x14e4ee['query'][_0x2766('0x43')]){_0x50064b[_0x2766('0x44')]=[{'all':!![]}];}_0x50064b=_['merge']({},_0x50064b,_0x14e4ee['options']);return db[_0x2766('0x30')][_0x2766('0x49')](_0x50064b)['then'](handleEntityNotFound(_0x214201,null))[_0x2766('0x27')](respondWithResult(_0x214201,null))[_0x2766('0x4a')](handleError(_0x214201,null));};exports[_0x2766('0x4b')]=function(_0x1de838,_0x4a74f5){return db['MailQueue']['create'](_0x1de838[_0x2766('0x4c')],{})[_0x2766('0x27')](function(_0x4147fd){var _0x198634=_0x1de838[_0x2766('0x4d')][_0x2766('0x28')]({'plain':!![]});if(!_0x198634)throw new Error(_0x2766('0x4e'));if(_0x198634[_0x2766('0x4f')]===_0x2766('0x4d')){var _0xe58e67=_0x4147fd[_0x2766('0x28')]({'plain':!![]});var _0x473a3e=_0x2766('0x29');return db[_0x2766('0x50')][_0x2766('0x49')]({'where':{'name':_0x473a3e,'userProfileId':_0x198634[_0x2766('0x51')]},'raw':!![]})['then'](function(_0x4312b9){if(_0x4312b9&&_0x4312b9[_0x2766('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0xe58e67[_0x2766('0x2d')],'resourceId':_0xe58e67['id'],'type':_0x4312b9[_0x2766('0x2d')],'sectionId':_0x4312b9['id']},{})['then'](function(){return _0x4147fd;});}else{return _0x4147fd;}})[_0x2766('0x4a')](function(_0x1ab9c6){logger[_0x2766('0x2c')](_0x2766('0x53'),_0x1ab9c6);throw _0x1ab9c6;});}return _0x4147fd;})[_0x2766('0x27')](respondWithResult(_0x4a74f5,0xc9))['catch'](handleError(_0x4a74f5,null));};exports['update']=function(_0x5c3efa,_0x387844){if(_0x5c3efa[_0x2766('0x4c')]['id']){delete _0x5c3efa[_0x2766('0x4c')]['id'];}return db[_0x2766('0x30')]['find']({'where':{'id':_0x5c3efa[_0x2766('0x48')]['id']}})['then'](handleEntityNotFound(_0x387844,null))[_0x2766('0x27')](saveUpdates(_0x5c3efa['body'],null))[_0x2766('0x27')](respondWithResult(_0x387844,null))['catch'](handleError(_0x387844,null));};exports[_0x2766('0x2b')]=function(_0x13dfca,_0x4efaed){return db[_0x2766('0x30')][_0x2766('0x49')]({'where':{'id':_0x13dfca['params']['id']}})[_0x2766('0x27')](handleEntityNotFound(_0x4efaed,null))[_0x2766('0x27')](removeEntity(_0x4efaed,null))['catch'](handleError(_0x4efaed,null));};exports[_0x2766('0x54')]=function(_0x8ce94d,_0x221ee3){return db[_0x2766('0x30')]['describe']()[_0x2766('0x27')](respondWithResult(_0x221ee3,null))[_0x2766('0x4a')](handleError(_0x221ee3,null));};exports['getMembers']=function(_0x290dfd,_0x10c13b,_0x5b7a9a){var _0x47e206={'raw':!![],'where':{}},_0x2aa598={},_0x1cfe95;return db['MailQueue'][_0x2766('0x55')]({'where':{'id':_0x290dfd[_0x2766('0x48')]['id']}})['then'](handleEntityNotFound(_0x10c13b,null))[_0x2766('0x27')](function(_0x541aa2){if(_0x541aa2){_0x1cfe95=_0x541aa2['get']({'plain':!![]});_0x2aa598[_0x2766('0x36')]=_[_0x2766('0x34')](db['UserMailQueue'][_0x2766('0x56')]);_0x2aa598['query']=_[_0x2766('0x34')](_0x290dfd[_0x2766('0x33')]);_0x2aa598[_0x2766('0x35')]=_['intersection'](_0x2aa598[_0x2766('0x36')],_0x2aa598[_0x2766('0x33')]);_0x47e206[_0x2766('0x37')]=_[_0x2766('0x38')](_0x2aa598[_0x2766('0x36')],qs[_0x2766('0x39')](_0x290dfd[_0x2766('0x33')][_0x2766('0x39')]));_0x47e206[_0x2766('0x37')]=_0x47e206[_0x2766('0x37')][_0x2766('0x3a')]?_0x47e206[_0x2766('0x37')]:_0x2aa598[_0x2766('0x36')];if(!_0x290dfd[_0x2766('0x33')][_0x2766('0x3b')](_0x2766('0x3c'))){_0x47e206[_0x2766('0x1f')]=qs[_0x2766('0x1f')](_0x290dfd[_0x2766('0x33')][_0x2766('0x1f')]);_0x47e206['offset']=qs[_0x2766('0x1e')](_0x290dfd[_0x2766('0x33')][_0x2766('0x1e')]);}_0x47e206[_0x2766('0x3d')]=qs['sort'](_0x290dfd['query'][_0x2766('0x3e')]);_0x47e206[_0x2766('0x3f')]=qs[_0x2766('0x35')](_[_0x2766('0x40')](_0x290dfd[_0x2766('0x33')],_0x2aa598['filters']));_0x47e206[_0x2766('0x3f')][_0x2766('0x57')]=_0x541aa2['id'];if(_0x290dfd[_0x2766('0x33')]['filter']){_0x47e206[_0x2766('0x3f')]=_[_0x2766('0x41')](_0x47e206[_0x2766('0x3f')],{'$or':_['map'](_0x47e206[_0x2766('0x37')],function(_0x2d740f){var _0x5c980c={};_0x5c980c[_0x2d740f]={'$like':'%'+_0x290dfd[_0x2766('0x33')][_0x2766('0x42')]+'%'};return _0x5c980c;})});}_0x47e206=_['merge']({},_0x47e206,_0x290dfd[_0x2766('0x58')]);return db[_0x2766('0x59')][_0x2766('0x45')](_0x47e206);}})[_0x2766('0x27')](function(_0x467b8c){if(_0x467b8c){return db[_0x2766('0x5a')][_0x2766('0x5b')]({'where':{'id':_['map'](_0x467b8c,_0x2766('0x5c')),'role':_0x2766('0x5d')},'attributes':['id',_0x2766('0x2d'),_0x2766('0x5e'),_0x2766('0x5f'),'createdAt']});}})[_0x2766('0x27')](function(_0x350cfe){if(_0x350cfe){return{'count':_0x350cfe[_0x2766('0x21')],'rows':_['map'](_0x350cfe['rows'],function(_0x2090cf){return{'membername':_0x2090cf[_0x2766('0x2d')],'UserId':_0x2090cf['id'],'queue_name':_0x1cfe95[_0x2766('0x2d')],'MailQueueId':_0x1cfe95['id'],'interface':util[_0x2766('0x60')]('%s/%s',_0x2766('0x61'),_0x2090cf[_0x2766('0x2d')]),'penalty':0x0,'paused':_0x2090cf[_0x2766('0x5e')],'createdAt':_0x2090cf['createdAt'],'updatedAt':_0x2090cf[_0x2766('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2766('0x27')](respondWithFilteredResult(_0x10c13b,_0x47e206))[_0x2766('0x4a')](handleError(_0x10c13b,null));};exports[_0x2766('0x62')]=function(_0x4b224f,_0x4c66d0,_0x21bdbd){var _0x248050={};var _0x3f71bd={};var _0xc61948;var _0x5adefa;return db[_0x2766('0x30')][_0x2766('0x55')]({'where':{'id':_0x4b224f[_0x2766('0x48')]['id']}})[_0x2766('0x27')](handleEntityNotFound(_0x4c66d0,null))['then'](function(_0x1a4641){if(_0x1a4641){_0xc61948=_0x1a4641;_0x3f71bd[_0x2766('0x36')]=_[_0x2766('0x34')](db[_0x2766('0x63')][_0x2766('0x56')]);_0x3f71bd[_0x2766('0x33')]=_[_0x2766('0x34')](_0x4b224f[_0x2766('0x33')]);_0x3f71bd[_0x2766('0x35')]=_[_0x2766('0x38')](_0x3f71bd[_0x2766('0x36')],_0x3f71bd[_0x2766('0x33')]);_0x248050[_0x2766('0x37')]=_[_0x2766('0x38')](_0x3f71bd[_0x2766('0x36')],qs[_0x2766('0x39')](_0x4b224f[_0x2766('0x33')]['fields']));_0x248050[_0x2766('0x37')]=_0x248050['attributes'][_0x2766('0x3a')]?_0x248050['attributes']:_0x3f71bd[_0x2766('0x36')];_0x248050[_0x2766('0x3d')]=qs[_0x2766('0x3e')](_0x4b224f[_0x2766('0x33')][_0x2766('0x3e')]);_0x248050[_0x2766('0x3f')]=qs['filters'](_[_0x2766('0x40')](_0x4b224f['query'],_0x3f71bd[_0x2766('0x35')]));if(_0x4b224f[_0x2766('0x33')][_0x2766('0x42')]){_0x248050[_0x2766('0x3f')]=_['merge'](_0x248050['where'],{'$or':_[_0x2766('0x2f')](_0x248050['attributes'],function(_0x34b233){var _0x1d575e={};_0x1d575e[_0x34b233]={'$like':'%'+_0x4b224f['query'][_0x2766('0x42')]+'%'};return _0x1d575e;})});}_0x248050=_[_0x2766('0x41')]({},_0x248050,_0x4b224f['options']);return _0xc61948['getTeams'](_0x248050);}})[_0x2766('0x27')](function(_0x2b24bd){if(_0x2b24bd){_0x5adefa=_0x2b24bd[_0x2766('0x3a')];if(!_0x4b224f['query'][_0x2766('0x3b')](_0x2766('0x3c'))){_0x248050['limit']=qs[_0x2766('0x1f')](_0x4b224f[_0x2766('0x33')]['limit']);_0x248050['offset']=qs[_0x2766('0x1e')](_0x4b224f[_0x2766('0x33')][_0x2766('0x1e')]);}return _0xc61948[_0x2766('0x62')](_0x248050);}})[_0x2766('0x27')](function(_0x3d6389){if(_0x3d6389){return _0x3d6389?{'count':_0x5adefa,'rows':_0x3d6389}:null;}})[_0x2766('0x27')](respondWithResult(_0x4c66d0,null))['catch'](handleError(_0x4c66d0,null));};exports[_0x2766('0x64')]=function(_0x16ef14,_0x4a27f2,_0x13b86b){var _0x3f4089=_0x16ef14[_0x2766('0x4c')][_0x2766('0x65')];return db[_0x2766('0x63')][_0x2766('0x45')]({'where':{'id':_0x3f4089},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2766('0x66'),'attributes':['id',_0x2766('0x2d'),_0x2766('0x67'),'voicePause',_0x2766('0x68')],'raw':!![]}]})['then'](function(_0x549cdb){if(_0x549cdb){var _0xeaedce=_[_0x2766('0x69')](_0x549cdb,function(_0x36fed9){var _0x64bff6=_0x36fed9['get']({'plain':!![]});return _0x64bff6[_0x2766('0x66')];});return db[_0x2766('0x30')][_0x2766('0x49')]({'where':{'id':_0x16ef14[_0x2766('0x48')]['id']}})['then'](function(_0x192f0f){return db[_0x2766('0x6a')][_0x2766('0x6b')](function(_0x115718){return _0x192f0f[_0x2766('0x64')](_0x3f4089,{'transaction':_0x115718})[_0x2766('0x27')](function(){return BPromise[_0x2766('0x6c')](_0xeaedce,function(_0x155b84){return db[_0x2766('0x59')][_0x2766('0x6d')]({'where':{'UserId':_0x155b84['id'],'MailQueueId':_0x16ef14[_0x2766('0x48')]['id']},'transaction':_0x115718});});})['then'](function(){_0xeaedce[_0x2766('0x6e')](function(_0x512653){socket[_0x2766('0x6f')]('userMailQueue:save',{'UserId':_0x512653['id'],'MailQueueId':_0x192f0f['id']});});});});});}})['then'](respondWithStatusCode(_0x4a27f2,null))[_0x2766('0x4a')](handleError(_0x4a27f2,null));};exports['removeTeams']=function(_0x2ea396,_0x8fa9f5,_0x2cb036){return db['Team'][_0x2766('0x45')]({'where':{'id':_0x2ea396[_0x2766('0x33')][_0x2766('0x65')]},'attributes':['id'],'include':[{'model':db[_0x2766('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2766('0x27')](handleEntityNotFound(_0x8fa9f5,null))[_0x2766('0x27')](function(_0x2aa0c3){var _0x4f2026=_[_0x2766('0x2f')](_0x2aa0c3,'id');var _0x5930c7=[];var _0x2ea071=[];var _0x1860ae=squel[_0x2766('0x70')]();_0x1860ae['field']('tq.TeamId')[_0x2766('0x71')](_0x2766('0x72'),'tq')[_0x2766('0x73')](_0x2766('0x74'),'ut',_0x2766('0x75'))[_0x2766('0x3f')](_0x2766('0x76'),_0x2ea396['params']['id']);for(var _0x220d86=0x0;_0x220d86<_0x2aa0c3['length'];_0x220d86+=0x1){let _0x4b89ae=_0x2aa0c3[_0x220d86];for(var _0x4f8f3f=0x0;_0x4f8f3f<_0x4b89ae[_0x2766('0x66')][_0x2766('0x3a')];_0x4f8f3f+=0x1){let _0x25022d=_0x4b89ae[_0x2766('0x66')][_0x4f8f3f];var _0x4045a3=_0x1860ae['clone']();_0x4045a3['where'](_0x2766('0x77'),_0x25022d['id']);_0x2ea071[_0x2766('0x78')](db['sequelize'][_0x2766('0x33')](_0x4045a3[_0x2766('0x79')](),{'type':db[_0x2766('0x6a')][_0x2766('0x7a')][_0x2766('0x7b')]})[_0x2766('0x27')](function(_0xca7a37){if(_0xca7a37[_0x2766('0x3a')]===0x1){return _0x25022d['id'];}else{var _0xe79032=_[_0x2766('0x7c')](_[_0x2766('0x2f')](_0xca7a37,'TeamId'),function(_0x4ae91d){return _['includes'](_0x4f2026,_0x4ae91d);});if(_0xe79032){return _0x25022d['id'];}}}));}}return BPromise['all'](_0x2ea071)['then'](function(_0x4471f4){_0x5930c7=_(_0x5930c7)[_0x2766('0x7d')](_0x4471f4)['compact']()['value']();return db[_0x2766('0x30')][_0x2766('0x49')]({'where':{'id':_0x2ea396[_0x2766('0x48')]['id']}})[_0x2766('0x27')](function(_0x2cf911){return db[_0x2766('0x6a')][_0x2766('0x6b')](function(_0x565409){return _0x2cf911[_0x2766('0x7e')](_0x2ea396[_0x2766('0x33')][_0x2766('0x65')],{'transaction':_0x565409})['then'](function(){if(!_['isEmpty'](_0x5930c7)){return _0x2cf911[_0x2766('0x7f')](_0x5930c7,{'transaction':_0x565409});}})[_0x2766('0x27')](function(){_0x5930c7[_0x2766('0x6e')](function(_0xd32552){socket[_0x2766('0x6f')](_0x2766('0x80'),{'UserId':_0xd32552,'MailQueueId':_0x2cf911['id']});});});});});});})[_0x2766('0x27')](respondWithStatusCode(_0x8fa9f5,null))[_0x2766('0x4a')](handleError(_0x8fa9f5,null));};exports[_0x2766('0x81')]=function(_0x195d1a,_0xacae35,_0x3b2e1d){return db[_0x2766('0x30')][_0x2766('0x49')]({'where':{'id':_0x195d1a[_0x2766('0x48')]['id']}})[_0x2766('0x27')](handleEntityNotFound(_0xacae35,null))['then'](function(_0x54a01f){if(_0x54a01f){return _0x54a01f[_0x2766('0x81')](_0x195d1a[_0x2766('0x4c')][_0x2766('0x65')],_[_0x2766('0x82')](_0x195d1a['body'],['ids','id'])||{})[_0x2766('0x83')](function(_0x3a82f8){for(var _0x11870d=0x0;_0x11870d<_0x195d1a[_0x2766('0x4c')][_0x2766('0x65')][_0x2766('0x3a')];_0x11870d+=0x1){socket[_0x2766('0x6f')](_0x2766('0x84'),{'UserId':Number(_0x195d1a[_0x2766('0x4c')]['ids'][_0x11870d]),'MailQueueId':Number(_0x195d1a[_0x2766('0x48')]['id'])});}return _0x3a82f8;});}})[_0x2766('0x27')](respondWithResult(_0xacae35,null))[_0x2766('0x4a')](handleError(_0xacae35,null));};exports[_0x2766('0x7f')]=function(_0x3fcae2,_0x573784,_0x45e6ea){return db['MailQueue']['find']({'where':{'id':_0x3fcae2[_0x2766('0x48')]['id']}})[_0x2766('0x27')](handleEntityNotFound(_0x573784,null))[_0x2766('0x27')](function(_0x2cc963){if(_0x2cc963){return _0x2cc963['removeAgents'](_0x3fcae2[_0x2766('0x33')][_0x2766('0x65')])['then'](function(){if(_[_0x2766('0x85')](_0x3fcae2[_0x2766('0x33')][_0x2766('0x65')])){for(var _0x4d9e5f=0x0;_0x4d9e5f<_0x3fcae2['query'][_0x2766('0x65')][_0x2766('0x3a')];_0x4d9e5f+=0x1){socket[_0x2766('0x6f')]('userMailQueue:remove',{'UserId':Number(_0x3fcae2['query'][_0x2766('0x65')][_0x4d9e5f]),'MailQueueId':Number(_0x3fcae2[_0x2766('0x48')]['id'])});}}else{socket[_0x2766('0x6f')]('userMailQueue:remove',{'UserId':Number(_0x3fcae2[_0x2766('0x33')][_0x2766('0x65')]),'MailQueueId':Number(_0x3fcae2['params']['id'])});}});}})[_0x2766('0x27')](respondWithStatusCode(_0x573784,null))['catch'](handleError(_0x573784,null));};exports['getAgents']=function(_0x1c3c80,_0x2cd902,_0x39bf27){var _0x4e6052={};var _0x4cf6f4={};var _0x56f472;var _0x167ca3;return db[_0x2766('0x30')]['findOne']({'where':{'id':_0x1c3c80[_0x2766('0x48')]['id']}})[_0x2766('0x27')](handleEntityNotFound(_0x2cd902,null))[_0x2766('0x27')](function(_0x2b0e14){if(_0x2b0e14){_0x56f472=_0x2b0e14;_0x4cf6f4[_0x2766('0x36')]=_['keys'](db['User'][_0x2766('0x56')]);_0x4cf6f4[_0x2766('0x33')]=_[_0x2766('0x34')](_0x1c3c80[_0x2766('0x33')]);_0x4cf6f4[_0x2766('0x35')]=_['intersection'](_0x4cf6f4['model'],_0x4cf6f4[_0x2766('0x33')]);_0x4e6052[_0x2766('0x37')]=_[_0x2766('0x38')](_0x4cf6f4[_0x2766('0x36')],qs['fields'](_0x1c3c80[_0x2766('0x33')][_0x2766('0x39')]));_0x4e6052[_0x2766('0x37')]=_0x4e6052['attributes'][_0x2766('0x3a')]?_0x4e6052[_0x2766('0x37')]:_0x4cf6f4[_0x2766('0x36')];_0x4e6052['order']=qs[_0x2766('0x3e')](_0x1c3c80[_0x2766('0x33')][_0x2766('0x3e')]);_0x4e6052[_0x2766('0x3f')]=qs[_0x2766('0x35')](_[_0x2766('0x40')](_0x1c3c80[_0x2766('0x33')],_0x4cf6f4['filters']));if(_0x1c3c80[_0x2766('0x33')]['filter']){_0x4e6052[_0x2766('0x3f')]=_[_0x2766('0x41')](_0x4e6052[_0x2766('0x3f')],{'$or':_[_0x2766('0x2f')](_0x4e6052[_0x2766('0x37')],function(_0x38083b){var _0x1a1df2={};_0x1a1df2[_0x38083b]={'$like':'%'+_0x1c3c80[_0x2766('0x33')]['filter']+'%'};return _0x1a1df2;})});}_0x4e6052=_['merge']({},_0x4e6052,_0x1c3c80['options']);return _0x56f472[_0x2766('0x86')](_0x4e6052);}})[_0x2766('0x27')](function(_0x2dfac5){if(_0x2dfac5){_0x167ca3=_0x2dfac5[_0x2766('0x3a')];if(!_0x1c3c80['query'][_0x2766('0x3b')](_0x2766('0x3c'))){_0x4e6052[_0x2766('0x1f')]=qs['limit'](_0x1c3c80['query'][_0x2766('0x1f')]);_0x4e6052[_0x2766('0x1e')]=qs[_0x2766('0x1e')](_0x1c3c80[_0x2766('0x33')][_0x2766('0x1e')]);}return _0x56f472[_0x2766('0x86')](_0x4e6052);}})['then'](function(_0x4a244c){if(_0x4a244c){return _0x4a244c?{'count':_0x167ca3,'rows':_0x4a244c}:null;}})['then'](respondWithResult(_0x2cd902,null))[_0x2766('0x4a')](handleError(_0x2cd902,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 8f0aca5..b91698c 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 _0x61a0=['MailQueue','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x61a0,0xa8));var _0x061a=function(_0x4f04e8,_0x5e3c43){_0x4f04e8=_0x4f04e8-0x0;var _0x20c11d=_0x61a0[_0x4f04e8];return _0x20c11d;};'use strict';var EventEmitter=require(_0x061a('0x0'));var MailQueue=require(_0x061a('0x1'))['db'][_0x061a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x061a('0x3')](0x0);var events={'afterCreate':_0x061a('0x4'),'afterUpdate':_0x061a('0x5'),'afterDestroy':_0x061a('0x6')};function emitEvent(_0x2adc41){return function(_0x385b21,_0x3cc1c9,_0x2de81f){MailQueueEvents[_0x061a('0x7')](_0x2adc41+':'+_0x385b21['id'],_0x385b21);MailQueueEvents['emit'](_0x2adc41,_0x385b21);_0x2de81f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x061a('0x8')](e,emitEvent(event));}}module[_0x061a('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x4bae=['../../mysqldb','MailQueue','setMaxListeners','update','emit','hook','exports','events'];(function(_0x225250,_0x2fe1a6){var _0x32d7ce=function(_0x605d61){while(--_0x605d61){_0x225250['push'](_0x225250['shift']());}};_0x32d7ce(++_0x2fe1a6);}(_0x4bae,0x1df));var _0xe4ba=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x4bae[_0x2b91c5];return _0xbd5531;};'use strict';var EventEmitter=require(_0xe4ba('0x0'));var MailQueue=require(_0xe4ba('0x1'))['db'][_0xe4ba('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe4ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe4ba('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b476a){return function(_0x16eaf2,_0x1d1813,_0x3f5b3f){MailQueueEvents['emit'](_0x3b476a+':'+_0x16eaf2['id'],_0x16eaf2);MailQueueEvents[_0xe4ba('0x5')](_0x3b476a,_0x16eaf2);_0x3f5b3f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xe4ba('0x6')](e,emitEvent(event));}}module[_0xe4ba('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 ae94257..e759f2f 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 _0x0f67=['rimraf','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x24805f,_0x52d653){var _0x5378cc=function(_0x3a560b){while(--_0x3a560b){_0x24805f['push'](_0x24805f['shift']());}};_0x5378cc(++_0x52d653);}(_0x0f67,0x14f));var _0x70f6=function(_0xcfdab8,_0x41ff99){_0xcfdab8=_0xcfdab8-0x0;var _0x6323d=_0x0f67[_0xcfdab8];return _0x6323d;};'use strict';var _=require(_0x70f6('0x0'));var util=require(_0x70f6('0x1'));var logger=require(_0x70f6('0x2'))('api');var moment=require(_0x70f6('0x3'));var BPromise=require(_0x70f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70f6('0x5'));var rimraf=require(_0x70f6('0x6'));var config=require(_0x70f6('0x7'));var attributes=require(_0x70f6('0x8'));module['exports']=function(_0x4ab269,_0x5dc973){return _0x4ab269['define'](_0x70f6('0x9'),attributes,{'tableName':_0x70f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb71a=['rimraf','../../config/environment','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x551be0,_0x3372c1){var _0x112d08=function(_0x4c82b9){while(--_0x4c82b9){_0x551be0['push'](_0x551be0['shift']());}};_0x112d08(++_0x3372c1);}(_0xb71a,0x172));var _0xab71=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0xb71a[_0x4854d6];return _0x3885c0;};'use strict';var _=require(_0xab71('0x0'));var util=require(_0xab71('0x1'));var logger=require(_0xab71('0x2'))(_0xab71('0x3'));var moment=require(_0xab71('0x4'));var BPromise=require(_0xab71('0x5'));var rp=require(_0xab71('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab71('0x7'));var config=require(_0xab71('0x8'));var attributes=require('./mailQueue.attributes');module[_0xab71('0x9')]=function(_0x24547c,_0x162be7){return _0x24547c[_0xab71('0xa')](_0xab71('0xb'),attributes,{'tableName':_0xab71('0xc'),'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 8f6362f..edc679b 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 _0xd594=['error','code','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','include','map','model','debug','ShowMailQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','stringify'];(function(_0x4a02da,_0x2ccee0){var _0x3317d1=function(_0x3bb309){while(--_0x3bb309){_0x4a02da['push'](_0x4a02da['shift']());}};_0x3317d1(++_0x2ccee0);}(_0xd594,0xab));var _0x4d59=function(_0x33f9e9,_0x50665c){_0x33f9e9=_0x33f9e9-0x0;var _0x4e76f8=_0xd594[_0x33f9e9];return _0x4e76f8;};'use strict';var _=require(_0x4d59('0x0'));var util=require(_0x4d59('0x1'));var moment=require(_0x4d59('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d59('0x3'));var fs=require('fs');var Redis=require(_0x4d59('0x4'));var db=require(_0x4d59('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d59('0x6'))(_0x4d59('0x7'));var config=require(_0x4d59('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d59('0x9')][_0x4d59('0xa')]({'port':0x232a});config[_0x4d59('0xb')]=_[_0x4d59('0xc')](config['redis'],{'host':_0x4d59('0xd'),'port':0x18eb});var socket=require(_0x4d59('0xe'))(new Redis(config[_0x4d59('0xb')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0xe59db8,_0x12a58a,_0x6dddc1){return new BPromise(function(_0x2eea9b,_0x2601a6){return client[_0x4d59('0xf')](_0xe59db8,_0x6dddc1)[_0x4d59('0x10')](function(_0x3ca030){logger[_0x4d59('0x11')]('MailQueue,\x20%s,\x20%s',_0x12a58a,'request\x20sent');logger['debug']('MailQueue,\x20%s,\x20%s,\x20%s',_0x12a58a,'request\x20sent',JSON[_0x4d59('0x12')](_0x3ca030));if(_0x3ca030[_0x4d59('0x13')]){if(_0x3ca030[_0x4d59('0x13')][_0x4d59('0x14')]===0x1f4){logger[_0x4d59('0x13')]('MailQueue,\x20%s,\x20%s',_0x12a58a,_0x3ca030[_0x4d59('0x13')][_0x4d59('0x15')]);return _0x2601a6(_0x3ca030[_0x4d59('0x13')][_0x4d59('0x15')]);}logger['error'](_0x4d59('0x16'),_0x12a58a,_0x3ca030['error'][_0x4d59('0x15')]);return _0x2eea9b(_0x3ca030[_0x4d59('0x13')]['message']);}else{logger[_0x4d59('0x11')](_0x4d59('0x16'),_0x12a58a,'request\x20sent');_0x2eea9b(_0x3ca030[_0x4d59('0x17')][_0x4d59('0x15')]);}})[_0x4d59('0x18')](function(_0x3f4b21){logger[_0x4d59('0x13')](_0x4d59('0x16'),_0x12a58a,_0x3f4b21);_0x2601a6(_0x3f4b21);});});}exports[_0x4d59('0x19')]=function(_0x299295){var _0x5d943b=this;return new Promise(function(_0x40f058,_0x5d9294){return db[_0x4d59('0x1a')][_0x4d59('0x1b')]({'raw':_0x299295[_0x4d59('0x1c')]?_0x299295[_0x4d59('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x299295[_0x4d59('0x1c')]?_0x299295[_0x4d59('0x1c')][_0x4d59('0x1d')]||null:null,'attributes':_0x299295[_0x4d59('0x1c')]?_0x299295[_0x4d59('0x1c')][_0x4d59('0x1e')]||null:null,'limit':_0x299295['options']?_0x299295[_0x4d59('0x1c')]['limit']||null:null,'include':_0x299295[_0x4d59('0x1c')]?_0x299295[_0x4d59('0x1c')][_0x4d59('0x1f')]?_[_0x4d59('0x20')](_0x299295[_0x4d59('0x1c')]['include'],function(_0x40228b){return{'model':db[_0x40228b['model']],'as':_0x40228b['as'],'attributes':_0x40228b[_0x4d59('0x1e')],'include':_0x40228b[_0x4d59('0x1f')]?_[_0x4d59('0x20')](_0x40228b[_0x4d59('0x1f')],function(_0x4bb0e8){return{'model':db[_0x4bb0e8[_0x4d59('0x21')]],'as':_0x4bb0e8['as'],'attributes':_0x4bb0e8[_0x4d59('0x1e')],'include':_0x4bb0e8['include']?_[_0x4d59('0x20')](_0x4bb0e8[_0x4d59('0x1f')],function(_0x4b0142){return{'model':db[_0x4b0142[_0x4d59('0x21')]],'as':_0x4b0142['as'],'attributes':_0x4b0142[_0x4d59('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4d59('0x10')](function(_0x14a919){logger[_0x4d59('0x11')](_0x4d59('0x19'),_0x299295);logger[_0x4d59('0x22')](_0x4d59('0x19'),_0x299295,JSON[_0x4d59('0x12')](_0x14a919));_0x40f058(_0x14a919);})[_0x4d59('0x18')](function(_0xaddf57){logger[_0x4d59('0x13')](_0x4d59('0x19'),_0xaddf57[_0x4d59('0x15')],_0x299295);_0x5d9294(_0x5d943b['error'](0x1f4,_0xaddf57['message']));});});};exports[_0x4d59('0x23')]=function(_0x415d7e){var _0x15c592=this;return new Promise(function(_0xe6a73d,_0x4c20e2){return db[_0x4d59('0x1a')][_0x4d59('0x24')]({'raw':_0x415d7e['options']?_0x415d7e['options'][_0x4d59('0x25')]===undefined?!![]:![]:!![],'where':_0x415d7e[_0x4d59('0x1c')]?_0x415d7e[_0x4d59('0x1c')][_0x4d59('0x1d')]||null:null,'attributes':_0x415d7e[_0x4d59('0x1c')]?_0x415d7e[_0x4d59('0x1c')][_0x4d59('0x1e')]||null:null,'include':_0x415d7e[_0x4d59('0x1c')]?_0x415d7e[_0x4d59('0x1c')][_0x4d59('0x1f')]?_['map'](_0x415d7e[_0x4d59('0x1c')][_0x4d59('0x1f')],function(_0xfa6e1e){return{'model':db[_0xfa6e1e[_0x4d59('0x21')]],'as':_0xfa6e1e['as'],'attributes':_0xfa6e1e['attributes'],'include':_0xfa6e1e[_0x4d59('0x1f')]?_['map'](_0xfa6e1e[_0x4d59('0x1f')],function(_0xf9a498){return{'model':db[_0xf9a498['model']],'as':_0xf9a498['as'],'attributes':_0xf9a498[_0x4d59('0x1e')],'include':_0xf9a498[_0x4d59('0x1f')]?_[_0x4d59('0x20')](_0xf9a498['include'],function(_0x1f1d67){return{'model':db[_0x1f1d67[_0x4d59('0x21')]],'as':_0x1f1d67['as'],'attributes':_0x1f1d67[_0x4d59('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4d59('0x10')](function(_0x43a6fa){logger[_0x4d59('0x11')]('ShowMailQueue',_0x415d7e);logger['debug'](_0x4d59('0x23'),_0x415d7e,JSON[_0x4d59('0x12')](_0x43a6fa));_0xe6a73d(_0x43a6fa);})[_0x4d59('0x18')](function(_0x2e131d){logger[_0x4d59('0x13')](_0x4d59('0x23'),_0x2e131d[_0x4d59('0x15')],_0x415d7e);_0x4c20e2(_0x15c592[_0x4d59('0x13')](0x1f4,_0x2e131d[_0x4d59('0x15')]));});});}; \ No newline at end of file +var _0x1abc=['jayson/promise','client','http','redis','defaults','localhost','request','then','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','map','model','where','ShowMailQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ae679,_0x592bd7){var _0x3a699f=function(_0x12ffc1){while(--_0x12ffc1){_0x5ae679['push'](_0x5ae679['shift']());}};_0x3a699f(++_0x592bd7);}(_0x1abc,0x174));var _0xc1ab=function(_0x581d10,_0x15beba){_0x581d10=_0x581d10-0x0;var _0x3ab17f=_0x1abc[_0x581d10];return _0x3ab17f;};'use strict';var _=require(_0xc1ab('0x0'));var util=require(_0xc1ab('0x1'));var moment=require('moment');var BPromise=require(_0xc1ab('0x2'));var rs=require(_0xc1ab('0x3'));var fs=require('fs');var Redis=require(_0xc1ab('0x4'));var db=require(_0xc1ab('0x5'))['db'];var utils=require(_0xc1ab('0x6'));var logger=require(_0xc1ab('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc1ab('0x8'));var client=jayson[_0xc1ab('0x9')][_0xc1ab('0xa')]({'port':0x232a});config[_0xc1ab('0xb')]=_[_0xc1ab('0xc')](config['redis'],{'host':_0xc1ab('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x47a1e3,_0x298626,_0x573d7a){return new BPromise(function(_0x4dc3f5,_0x1daa73){return client[_0xc1ab('0xe')](_0x47a1e3,_0x573d7a)[_0xc1ab('0xf')](function(_0x5b1d1e){logger['info'](_0xc1ab('0x10'),_0x298626,'request\x20sent');logger[_0xc1ab('0x11')](_0xc1ab('0x12'),_0x298626,_0xc1ab('0x13'),JSON[_0xc1ab('0x14')](_0x5b1d1e));if(_0x5b1d1e[_0xc1ab('0x15')]){if(_0x5b1d1e['error'][_0xc1ab('0x16')]===0x1f4){logger[_0xc1ab('0x15')](_0xc1ab('0x10'),_0x298626,_0x5b1d1e[_0xc1ab('0x15')][_0xc1ab('0x17')]);return _0x1daa73(_0x5b1d1e[_0xc1ab('0x15')]['message']);}logger['error'](_0xc1ab('0x10'),_0x298626,_0x5b1d1e[_0xc1ab('0x15')][_0xc1ab('0x17')]);return _0x4dc3f5(_0x5b1d1e[_0xc1ab('0x15')][_0xc1ab('0x17')]);}else{logger[_0xc1ab('0x18')](_0xc1ab('0x10'),_0x298626,'request\x20sent');_0x4dc3f5(_0x5b1d1e[_0xc1ab('0x19')][_0xc1ab('0x17')]);}})[_0xc1ab('0x1a')](function(_0x5680bb){logger[_0xc1ab('0x15')](_0xc1ab('0x10'),_0x298626,_0x5680bb);_0x1daa73(_0x5680bb);});});}exports[_0xc1ab('0x1b')]=function(_0x1c3905){var _0x170861=this;return new Promise(function(_0x35ae67,_0x4a318e){return db[_0xc1ab('0x1c')][_0xc1ab('0x1d')]({'raw':_0x1c3905['options']?_0x1c3905[_0xc1ab('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1c3905[_0xc1ab('0x1e')]?_0x1c3905[_0xc1ab('0x1e')]['where']||null:null,'attributes':_0x1c3905[_0xc1ab('0x1e')]?_0x1c3905[_0xc1ab('0x1e')][_0xc1ab('0x1f')]||null:null,'limit':_0x1c3905['options']?_0x1c3905[_0xc1ab('0x1e')][_0xc1ab('0x20')]||null:null,'include':_0x1c3905['options']?_0x1c3905[_0xc1ab('0x1e')][_0xc1ab('0x21')]?_[_0xc1ab('0x22')](_0x1c3905[_0xc1ab('0x1e')][_0xc1ab('0x21')],function(_0x114378){return{'model':db[_0x114378[_0xc1ab('0x23')]],'as':_0x114378['as'],'attributes':_0x114378[_0xc1ab('0x1f')],'include':_0x114378[_0xc1ab('0x21')]?_[_0xc1ab('0x22')](_0x114378[_0xc1ab('0x21')],function(_0x51dd39){return{'model':db[_0x51dd39['model']],'as':_0x51dd39['as'],'attributes':_0x51dd39['attributes'],'include':_0x51dd39[_0xc1ab('0x21')]?_[_0xc1ab('0x22')](_0x51dd39[_0xc1ab('0x21')],function(_0x4e07fb){return{'model':db[_0x4e07fb['model']],'as':_0x4e07fb['as'],'attributes':_0x4e07fb[_0xc1ab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x215f94){logger[_0xc1ab('0x18')](_0xc1ab('0x1b'),_0x1c3905);logger[_0xc1ab('0x11')](_0xc1ab('0x1b'),_0x1c3905,JSON[_0xc1ab('0x14')](_0x215f94));_0x35ae67(_0x215f94);})['catch'](function(_0x2f1b9e){logger['error'](_0xc1ab('0x1b'),_0x2f1b9e['message'],_0x1c3905);_0x4a318e(_0x170861[_0xc1ab('0x15')](0x1f4,_0x2f1b9e[_0xc1ab('0x17')]));});});};exports['ShowMailQueue']=function(_0x23a513){var _0xad1ab=this;return new Promise(function(_0x3a91d8,_0x19cf59){return db['MailQueue']['find']({'raw':_0x23a513['options']?_0x23a513[_0xc1ab('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x23a513[_0xc1ab('0x1e')]?_0x23a513[_0xc1ab('0x1e')][_0xc1ab('0x24')]||null:null,'attributes':_0x23a513[_0xc1ab('0x1e')]?_0x23a513[_0xc1ab('0x1e')][_0xc1ab('0x1f')]||null:null,'include':_0x23a513[_0xc1ab('0x1e')]?_0x23a513[_0xc1ab('0x1e')]['include']?_[_0xc1ab('0x22')](_0x23a513['options']['include'],function(_0x46cc27){return{'model':db[_0x46cc27[_0xc1ab('0x23')]],'as':_0x46cc27['as'],'attributes':_0x46cc27['attributes'],'include':_0x46cc27[_0xc1ab('0x21')]?_[_0xc1ab('0x22')](_0x46cc27['include'],function(_0x179d81){return{'model':db[_0x179d81[_0xc1ab('0x23')]],'as':_0x179d81['as'],'attributes':_0x179d81[_0xc1ab('0x1f')],'include':_0x179d81['include']?_['map'](_0x179d81['include'],function(_0x3aa2e9){return{'model':db[_0x3aa2e9[_0xc1ab('0x23')]],'as':_0x3aa2e9['as'],'attributes':_0x3aa2e9[_0xc1ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc1ab('0xf')](function(_0x57d223){logger[_0xc1ab('0x18')](_0xc1ab('0x25'),_0x23a513);logger[_0xc1ab('0x11')](_0xc1ab('0x25'),_0x23a513,JSON[_0xc1ab('0x14')](_0x57d223));_0x3a91d8(_0x57d223);})[_0xc1ab('0x1a')](function(_0x3d18d8){logger[_0xc1ab('0x15')](_0xc1ab('0x25'),_0x3d18d8[_0xc1ab('0x17')],_0x23a513);_0x19cf59(_0xad1ab[_0xc1ab('0x15')](0x1f4,_0x3d18d8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index c2d259f..0e22fed 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 _0x1808=['register','length','./mailQueue.events','save','update','emit','removeListener'];(function(_0x23651b,_0x5741ae){var _0xd5c714=function(_0x1d5b0d){while(--_0x1d5b0d){_0x23651b['push'](_0x23651b['shift']());}};_0xd5c714(++_0x5741ae);}(_0x1808,0xe2));var _0x8180=function(_0x375f55,_0x2a53ce){_0x375f55=_0x375f55-0x0;var _0x1c0b23=_0x1808[_0x375f55];return _0x1c0b23;};'use strict';var MailQueueEvents=require(_0x8180('0x0'));var events=[_0x8180('0x1'),'remove',_0x8180('0x2')];function createListener(_0xd93add,_0x48ef84){return function(_0x4dd31d){_0x48ef84[_0x8180('0x3')](_0xd93add,_0x4dd31d);};}function removeListener(_0x226dfb,_0x36acef){return function(){MailQueueEvents[_0x8180('0x4')](_0x226dfb,_0x36acef);};}exports[_0x8180('0x5')]=function(_0x572f14){for(var _0xcde465=0x0,_0x23eaf7=events[_0x8180('0x6')];_0xcde465<_0x23eaf7;_0xcde465++){var _0x34db92=events[_0xcde465];var _0x3a6684=createListener('mailQueue:'+_0x34db92,_0x572f14);MailQueueEvents['on'](_0x34db92,_0x3a6684);}}; \ No newline at end of file +var _0x8185=['./mailQueue.events','save','remove','emit','removeListener','register','length','mailQueue:'];(function(_0x5b5b25,_0x5e172a){var _0x7ee13f=function(_0xe43756){while(--_0xe43756){_0x5b5b25['push'](_0x5b5b25['shift']());}};_0x7ee13f(++_0x5e172a);}(_0x8185,0xb8));var _0x5818=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8185[_0x199572];return _0x13cfa3;};'use strict';var MailQueueEvents=require(_0x5818('0x0'));var events=[_0x5818('0x1'),_0x5818('0x2'),'update'];function createListener(_0x3bb2c9,_0x3a7e3c){return function(_0xd888b3){_0x3a7e3c[_0x5818('0x3')](_0x3bb2c9,_0xd888b3);};}function removeListener(_0x11b518,_0x4f709c){return function(){MailQueueEvents[_0x5818('0x4')](_0x11b518,_0x4f709c);};}exports[_0x5818('0x5')]=function(_0x635812){for(var _0x2e1d94=0x0,_0x412c57=events[_0x5818('0x6')];_0x2e1d94<_0x412c57;_0x2e1d94++){var _0x1e011e=events[_0x2e1d94];var _0x9201ee=createListener(_0x5818('0x7')+_0x1e011e,_0x635812);MailQueueEvents['on'](_0x1e011e,_0x9201ee);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index e4e8264..b2430bb 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 _0x4264=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x273735,_0x2a7ba7){var _0x5a3e1d=function(_0x242c3a){while(--_0x242c3a){_0x273735['push'](_0x273735['shift']());}};_0x5a3e1d(++_0x2a7ba7);}(_0x4264,0x18d));var _0x4426=function(_0x4cb4a0,_0x4efd11){_0x4cb4a0=_0x4cb4a0-0x0;var _0x20f2db=_0x4264[_0x4cb4a0];return _0x20f2db;};'use strict';var multer=require(_0x4426('0x0'));var util=require(_0x4426('0x1'));var path=require(_0x4426('0x2'));var timeout=require(_0x4426('0x3'));var express=require('express');var router=express[_0x4426('0x4')]();var fs_extra=require(_0x4426('0x5'));var auth=require(_0x4426('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4426('0x7'));var controller=require(_0x4426('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4426('0x9')]);router[_0x4426('0xa')](_0x4426('0xb'),auth[_0x4426('0xc')](),controller[_0x4426('0xd')]);router[_0x4426('0xa')](_0x4426('0xe'),auth[_0x4426('0xc')](),controller[_0x4426('0xf')]);router[_0x4426('0x10')]('/',auth['isAuthenticated'](),controller[_0x4426('0x11')]);router['put'](_0x4426('0xe'),auth[_0x4426('0xc')](),controller[_0x4426('0x12')]);router[_0x4426('0x13')](_0x4426('0xe'),auth[_0x4426('0xc')](),controller['destroy']);module[_0x4426('0x14')]=router; \ No newline at end of file +var _0x6371=['./mailQueueReport.controller','isAuthenticated','index','get','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x14aa13,_0x29f803){var _0x6a6a35=function(_0xd40766){while(--_0xd40766){_0x14aa13['push'](_0x14aa13['shift']());}};_0x6a6a35(++_0x29f803);}(_0x6371,0x129));var _0x1637=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0x6371[_0x4ca6a4];return _0x120555;};'use strict';var multer=require(_0x1637('0x0'));var util=require(_0x1637('0x1'));var path=require(_0x1637('0x2'));var timeout=require(_0x1637('0x3'));var express=require(_0x1637('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1637('0x5'));var config=require(_0x1637('0x6'));var controller=require(_0x1637('0x7'));router['get']('/',auth[_0x1637('0x8')](),controller[_0x1637('0x9')]);router[_0x1637('0xa')]('/describe',auth[_0x1637('0x8')](),controller['describe']);router['get']('/:id',auth[_0x1637('0x8')](),controller['show']);router['post']('/',auth[_0x1637('0x8')](),controller['create']);router[_0x1637('0xb')](_0x1637('0xc'),auth[_0x1637('0x8')](),controller['update']);router[_0x1637('0xd')](_0x1637('0xc'),auth[_0x1637('0x8')](),controller[_0x1637('0xe')]);module[_0x1637('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7a7c4a6..bf5085b 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 _0x4aca=['DATE','sequelize','exports','STRING'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4aca,0x195));var _0xa4ac=function(_0x1ebb51,_0x117528){_0x1ebb51=_0x1ebb51-0x0;var _0x10614a=_0x4aca[_0x1ebb51];return _0x10614a;};'use strict';var moment=require('moment');var Sequelize=require(_0xa4ac('0x0'));module[_0xa4ac('0x1')]={'uniqueid':{'type':Sequelize[_0xa4ac('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa4ac('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa4ac('0x3')]},'acceptAt':{'type':Sequelize[_0xa4ac('0x3')]},'exitAt':{'type':Sequelize[_0xa4ac('0x3')]},'reason':{'type':Sequelize[_0xa4ac('0x2')]}}; \ No newline at end of file +var _0x0541=['STRING','DATE','sequelize','exports'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x0541,0x19e));var _0x1054=function(_0xa99357,_0x50ffad){_0xa99357=_0xa99357-0x0;var _0x111875=_0x0541[_0xa99357];return _0x111875;};'use strict';var moment=require('moment');var Sequelize=require(_0x1054('0x0'));module[_0x1054('0x1')]={'uniqueid':{'type':Sequelize[_0x1054('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1054('0x2')]},'joinAt':{'type':Sequelize[_0x1054('0x3')]},'leaveAt':{'type':Sequelize[_0x1054('0x3')]},'acceptAt':{'type':Sequelize[_0x1054('0x3')]},'exitAt':{'type':Sequelize[_0x1054('0x3')]},'reason':{'type':Sequelize[_0x1054('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d3a9c38..902a185 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 _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x2f032a,_0x672107){var _0x3257cc=function(_0x3548be){while(--_0x3548be){_0x2f032a['push'](_0x2f032a['shift']());}};_0x3257cc(++_0x672107);}(_0xf61e,0x191));var _0xef61=function(_0x19ea2b,_0x1652f9){_0x19ea2b=_0x19ea2b-0x0;var _0x3e3edc=_0xf61e[_0x19ea2b];return _0x3e3edc;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['MailQueueReport']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':!![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['MailQueueReport'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));}; \ No newline at end of file +var _0x5b12=['options','includeAll','include','findAll','then','show','params','rawAttributes','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','apply','reject','update','destroy','error','name','index','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x41ca9b,_0xfe19be){var _0x3d0ec3=function(_0x5395ce){while(--_0x5395ce){_0x41ca9b['push'](_0x41ca9b['shift']());}};_0x3d0ec3(++_0xfe19be);}(_0x5b12,0xa3));var _0x25b1=function(_0x19a619,_0x1ca141){_0x19a619=_0x19a619-0x0;var _0x43d8f1=_0x5b12[_0x19a619];return _0x43d8f1;};'use strict';var emlformat=require(_0x25b1('0x0'));var rimraf=require(_0x25b1('0x1'));var zipdir=require(_0x25b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25b1('0x3'));var moment=require('moment');var BPromise=require(_0x25b1('0x4'));var Mustache=require(_0x25b1('0x5'));var util=require('util');var path=require(_0x25b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25b1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x25b1('0x8'));var crypto=require(_0x25b1('0x9'));var jsforce=require(_0x25b1('0xa'));var deskjs=require(_0x25b1('0xb'));var toCsv=require(_0x25b1('0xc'));var querystring=require(_0x25b1('0xd'));var Papa=require(_0x25b1('0xe'));var Redis=require(_0x25b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x25b1('0x10'));var as=require(_0x25b1('0x11'));var hardwareService=require(_0x25b1('0x12'));var logger=require(_0x25b1('0x13'))(_0x25b1('0x14'));var utils=require(_0x25b1('0x15'));var config=require(_0x25b1('0x16'));var licenseUtil=require(_0x25b1('0x17'));var db=require(_0x25b1('0x18'))['db'];function respondWithStatusCode(_0x459070,_0xbdd348){_0xbdd348=_0xbdd348||0xcc;return function(_0x1c5421){if(_0x1c5421){return _0x459070[_0x25b1('0x19')](_0xbdd348);}return _0x459070[_0x25b1('0x1a')](_0xbdd348)[_0x25b1('0x1b')]();};}function respondWithResult(_0x76b5c4,_0x4ee40c){_0x4ee40c=_0x4ee40c||0xc8;return function(_0x2c337a){if(_0x2c337a){return _0x76b5c4[_0x25b1('0x1a')](_0x4ee40c)['json'](_0x2c337a);}};}function respondWithFilteredResult(_0xb5b9cf,_0x4bb1bb){return function(_0xe32e02){if(_0xe32e02){var _0x4a5a58=typeof _0x4bb1bb['offset']===_0x25b1('0x1c')&&typeof _0x4bb1bb['limit']===_0x25b1('0x1c');var _0x2ca567=_0xe32e02[_0x25b1('0x1d')];var _0x27ccc9=_0x4a5a58?0x0:_0x4bb1bb[_0x25b1('0x1e')];var _0x2a7d14=_0x4a5a58?_0xe32e02[_0x25b1('0x1d')]:_0x4bb1bb[_0x25b1('0x1e')]+_0x4bb1bb['limit'];var _0x4ecff1;if(_0x2a7d14>=_0x2ca567){_0x2a7d14=_0x2ca567;_0x4ecff1=0xc8;}else{_0x4ecff1=0xce;}_0xb5b9cf[_0x25b1('0x1a')](_0x4ecff1);return _0xb5b9cf['set'](_0x25b1('0x1f'),_0x27ccc9+'-'+_0x2a7d14+'/'+_0x2ca567)['json'](_0xe32e02);}return null;};}function patchUpdates(_0x3bfd7d){return function(_0x59aa37){try{jsonpatch[_0x25b1('0x20')](_0x59aa37,_0x3bfd7d,!![]);}catch(_0x529310){return BPromise[_0x25b1('0x21')](_0x529310);}return _0x59aa37['save']();};}function saveUpdates(_0x4e3f48,_0x565cfd){return function(_0x3bca9f){if(_0x3bca9f){return _0x3bca9f[_0x25b1('0x22')](_0x4e3f48)['then'](function(_0x19bab8){return _0x19bab8;});}return null;};}function removeEntity(_0x26b555,_0x1e5915){return function(_0x246acd){if(_0x246acd){return _0x246acd[_0x25b1('0x23')]()['then'](function(){_0x26b555[_0x25b1('0x1a')](0xcc)[_0x25b1('0x1b')]();});}};}function handleEntityNotFound(_0xd22469,_0x282187){return function(_0x1f37ed){if(!_0x1f37ed){_0xd22469[_0x25b1('0x19')](0x194);}return _0x1f37ed;};}function handleError(_0x5d9ed7,_0x3c05c6){_0x3c05c6=_0x3c05c6||0x1f4;return function(_0x27dd68){logger[_0x25b1('0x24')](_0x27dd68['stack']);if(_0x27dd68[_0x25b1('0x25')]){delete _0x27dd68[_0x25b1('0x25')];}_0x5d9ed7[_0x25b1('0x1a')](_0x3c05c6)['send'](_0x27dd68);};}exports[_0x25b1('0x26')]=function(_0x54ce2d,_0x19ecd1){var _0x3febb8={},_0x3a4475={},_0x293413={'count':0x0,'rows':[]};var _0x362118=_[_0x25b1('0x27')](db[_0x25b1('0x28')]['rawAttributes'],function(_0x30d455){return{'name':_0x30d455[_0x25b1('0x29')],'type':_0x30d455[_0x25b1('0x2a')][_0x25b1('0x2b')]};});_0x3a4475[_0x25b1('0x2c')]=_['map'](_0x362118,_0x25b1('0x25'));_0x3a4475[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x54ce2d[_0x25b1('0x2d')]);_0x3a4475[_0x25b1('0x2f')]=_['intersection'](_0x3a4475['model'],_0x3a4475[_0x25b1('0x2d')]);_0x3febb8['attributes']=_[_0x25b1('0x30')](_0x3a4475[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x54ce2d['query']['fields']));_0x3febb8[_0x25b1('0x32')]=_0x3febb8[_0x25b1('0x32')][_0x25b1('0x33')]?_0x3febb8['attributes']:_0x3a4475[_0x25b1('0x2c')];if(!_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x34')](_0x25b1('0x35'))){_0x3febb8['limit']=qs[_0x25b1('0x36')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x36')]);_0x3febb8['offset']=qs['offset'](_0x54ce2d[_0x25b1('0x2d')]['offset']);}_0x3febb8[_0x25b1('0x37')]=qs[_0x25b1('0x38')](_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x38')]);_0x3febb8[_0x25b1('0x39')]=qs[_0x25b1('0x2f')](_[_0x25b1('0x3a')](_0x54ce2d[_0x25b1('0x2d')],_0x3a4475[_0x25b1('0x2f')]),_0x362118);if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]){_0x3febb8[_0x25b1('0x39')]=_[_0x25b1('0x3c')](_0x3febb8[_0x25b1('0x39')],{'$or':_[_0x25b1('0x27')](_0x362118,function(_0x4837d5){if(_0x4837d5[_0x25b1('0x2a')]!==_0x25b1('0x3d')){var _0x53423d={};_0x53423d[_0x4837d5[_0x25b1('0x25')]]={'$like':'%'+_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3b')]+'%'};return _0x53423d;}})});}_0x3febb8=_[_0x25b1('0x3c')]({},_0x3febb8,_0x54ce2d[_0x25b1('0x3e')]);var _0x5bdefd={'where':_0x3febb8[_0x25b1('0x39')]};return db['MailQueueReport'][_0x25b1('0x1d')](_0x5bdefd)['then'](function(_0x2e8747){_0x293413[_0x25b1('0x1d')]=_0x2e8747;if(_0x54ce2d[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x3febb8[_0x25b1('0x40')]=[{'all':!![]}];}return db[_0x25b1('0x28')][_0x25b1('0x41')](_0x3febb8);})[_0x25b1('0x42')](function(_0x3f9754){_0x293413['rows']=_0x3f9754;return _0x293413;})[_0x25b1('0x42')](respondWithFilteredResult(_0x19ecd1,_0x3febb8))['catch'](handleError(_0x19ecd1,null));};exports[_0x25b1('0x43')]=function(_0x2f56ac,_0x4d4e32){var _0x52d3f8={'raw':!![],'where':{'id':_0x2f56ac[_0x25b1('0x44')]['id']}},_0x39b4c7={};_0x39b4c7[_0x25b1('0x2c')]=_[_0x25b1('0x2e')](db[_0x25b1('0x28')][_0x25b1('0x45')]);_0x39b4c7[_0x25b1('0x2d')]=_[_0x25b1('0x2e')](_0x2f56ac[_0x25b1('0x2d')]);_0x39b4c7[_0x25b1('0x2f')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],_0x39b4c7[_0x25b1('0x2d')]);_0x52d3f8[_0x25b1('0x32')]=_[_0x25b1('0x30')](_0x39b4c7[_0x25b1('0x2c')],qs[_0x25b1('0x31')](_0x2f56ac['query']['fields']));_0x52d3f8['attributes']=_0x52d3f8[_0x25b1('0x32')]['length']?_0x52d3f8[_0x25b1('0x32')]:_0x39b4c7['model'];if(_0x2f56ac[_0x25b1('0x2d')][_0x25b1('0x3f')]){_0x52d3f8[_0x25b1('0x40')]=[{'all':!![]}];}_0x52d3f8=_[_0x25b1('0x3c')]({},_0x52d3f8,_0x2f56ac[_0x25b1('0x3e')]);return db[_0x25b1('0x28')]['find'](_0x52d3f8)[_0x25b1('0x42')](handleEntityNotFound(_0x4d4e32,null))[_0x25b1('0x42')](respondWithResult(_0x4d4e32,null))[_0x25b1('0x46')](handleError(_0x4d4e32,null));};exports[_0x25b1('0x47')]=function(_0x58ae67,_0x489f73){return db[_0x25b1('0x28')][_0x25b1('0x47')](_0x58ae67['body'],{})[_0x25b1('0x42')](respondWithResult(_0x489f73,0xc9))['catch'](handleError(_0x489f73,null));};exports[_0x25b1('0x22')]=function(_0x4b6181,_0x543f9b){if(_0x4b6181[_0x25b1('0x48')]['id']){delete _0x4b6181[_0x25b1('0x48')]['id'];}return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x4b6181['params']['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x543f9b,null))['then'](saveUpdates(_0x4b6181[_0x25b1('0x48')],null))['then'](respondWithResult(_0x543f9b,null))[_0x25b1('0x46')](handleError(_0x543f9b,null));};exports[_0x25b1('0x23')]=function(_0x1fcc79,_0x4fb92e){return db[_0x25b1('0x28')][_0x25b1('0x49')]({'where':{'id':_0x1fcc79[_0x25b1('0x44')]['id']}})[_0x25b1('0x42')](handleEntityNotFound(_0x4fb92e,null))[_0x25b1('0x42')](removeEntity(_0x4fb92e,null))[_0x25b1('0x46')](handleError(_0x4fb92e,null));};exports['describe']=function(_0x134c64,_0x133f50){return db[_0x25b1('0x28')][_0x25b1('0x4a')]()[_0x25b1('0x42')](respondWithResult(_0x133f50,null))[_0x25b1('0x46')](handleError(_0x133f50,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index d07c7de..b2d98a3 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 _0xc401=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger'];(function(_0x4c4df3,_0x82a06f){var _0x356c8b=function(_0xe27241){while(--_0xe27241){_0x4c4df3['push'](_0x4c4df3['shift']());}};_0x356c8b(++_0x82a06f);}(_0xc401,0x15d));var _0x1c40=function(_0x4dc97f,_0x26c32e){_0x4dc97f=_0x4dc97f-0x0;var _0x4f714e=_0xc401[_0x4dc97f];return _0x4f714e;};'use strict';var _=require('lodash');var util=require(_0x1c40('0x0'));var logger=require(_0x1c40('0x1'))(_0x1c40('0x2'));var moment=require(_0x1c40('0x3'));var BPromise=require(_0x1c40('0x4'));var rp=require(_0x1c40('0x5'));var fs=require('fs');var path=require(_0x1c40('0x6'));var rimraf=require(_0x1c40('0x7'));var config=require(_0x1c40('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x1c40('0x9')]=function(_0x444d05,_0x5920f4){return _0x444d05['define'](_0x1c40('0xa'),attributes,{'tableName':_0x1c40('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1c40('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5295=['./mailQueueReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x5295,0x6c));var _0x5529=function(_0x42bab2,_0x335b27){_0x42bab2=_0x42bab2-0x0;var _0x27e047=_0x5295[_0x42bab2];return _0x27e047;};'use strict';var _=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var logger=require(_0x5529('0x2'))(_0x5529('0x3'));var moment=require(_0x5529('0x4'));var BPromise=require(_0x5529('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5529('0x6'));var rimraf=require(_0x5529('0x7'));var config=require(_0x5529('0x8'));var attributes=require(_0x5529('0x9'));module[_0x5529('0xa')]=function(_0x30390c,_0x597f8f){return _0x30390c[_0x5529('0xb')]('MailQueueReport',attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5529('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 4309841..f3dd33e 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 _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x2c4c3e,_0x380a36){var _0x4a652b=function(_0x5a8796){while(--_0x5a8796){_0x2c4c3e['push'](_0x2c4c3e['shift']());}};_0x4a652b(++_0x380a36);}(_0xdb28,0x106));var _0x8db2=function(_0x960862,_0x2c6dc7){_0x960862=_0x960862-0x0;var _0xdf9562=_0xdb28[_0x960862];return _0xdf9562;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4dd054,_0x53a4a4){var _0x51d7af=function(_0x5c47cf){while(--_0x5c47cf){_0x4dd054['push'](_0x4dd054['shift']());}};_0x51d7af(++_0x53a4a4);}(_0x326f,0xd1));var _0xf326=function(_0x4fab1e,_0x22b725){_0x4fab1e=_0x4fab1e-0x0;var _0x3995e7=_0x326f[_0x4fab1e];return _0x3995e7;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index b1d5f70..128e446 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(_0x3a49a2,_0x53de8d){var _0x45b94f=function(_0x4cead0){while(--_0x4cead0){_0x3a49a2['push'](_0x3a49a2['shift']());}};_0x45b94f(++_0x53de8d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xcb91[_0x495e9f];return _0xb249d2;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2b0d9d,_0xea4013){var _0x124c1d=function(_0x3a6d0c){while(--_0x3a6d0c){_0x2b0d9d['push'](_0x2b0d9d['shift']());}};_0x124c1d(++_0xea4013);}(_0x70e0,0x17b));var _0x070e=function(_0xb67aeb,_0x17b220){_0xb67aeb=_0xb67aeb-0x0;var _0x54a1d0=_0x70e0[_0xb67aeb];return _0x54a1d0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 96d067f..754a1d3 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 _0xe205=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x1ee2da,_0x5743a7){var _0x35ef9f=function(_0x1ef0bb){while(--_0x1ef0bb){_0x1ee2da['push'](_0x1ee2da['shift']());}};_0x35ef9f(++_0x5743a7);}(_0xe205,0xa7));var _0x5e20=function(_0x2f023a,_0x410a3f){_0x2f023a=_0x2f023a-0x0;var _0x24238f=_0xe205[_0x2f023a];return _0x24238f;};'use strict';var Sequelize=require(_0x5e20('0x0'));module[_0x5e20('0x1')]={'description':{'type':Sequelize[_0x5e20('0x2')]},'host':{'type':Sequelize[_0x5e20('0x2')]},'authentication':{'type':Sequelize[_0x5e20('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x5e20('0x2')]},'password':{'type':Sequelize[_0x5e20('0x2')]},'port':{'type':Sequelize[_0x5e20('0x4')]},'tls':{'type':Sequelize[_0x5e20('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x5e20('0x5')},'connTimeout':{'type':Sequelize[_0x5e20('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x5e20('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x5e20('0x2')]}}; \ No newline at end of file +var _0x693f=['INBOX','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3430c7,_0x3fc027){var _0x4e89d4=function(_0x367407){while(--_0x367407){_0x3430c7['push'](_0x3430c7['shift']());}};_0x4e89d4(++_0x3fc027);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xf693('0x0'));module[_0xf693('0x1')]={'description':{'type':Sequelize[_0xf693('0x2')]},'host':{'type':Sequelize[_0xf693('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xf693('0x2')]},'password':{'type':Sequelize[_0xf693('0x2')]},'port':{'type':Sequelize[_0xf693('0x3')]},'tls':{'type':Sequelize[_0xf693('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf693('0x2')],'defaultValue':_0xf693('0x5')},'connTimeout':{'type':Sequelize[_0xf693('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xf693('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index c0f88df..af03967 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 _0x4278=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x64f58,_0x921b3c){var _0x391645=function(_0x3f670b){while(--_0x3f670b){_0x64f58['push'](_0x64f58['shift']());}};_0x391645(++_0x921b3c);}(_0x4278,0xc5));var _0x8427=function(_0x4210e8,_0x156745){_0x4210e8=_0x4210e8-0x0;var _0x5462ae=_0x4278[_0x4210e8];return _0x5462ae;};'use strict';var _=require(_0x8427('0x0'));var util=require(_0x8427('0x1'));var logger=require(_0x8427('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8427('0x3'));var rp=require(_0x8427('0x4'));var fs=require('fs');var path=require(_0x8427('0x5'));var rimraf=require(_0x8427('0x6'));var config=require(_0x8427('0x7'));var attributes=require(_0x8427('0x8'));module[_0x8427('0x9')]=function(_0x42ab48,_0x55f5ad){return _0x42ab48[_0x8427('0xa')](_0x8427('0xb'),attributes,{'tableName':_0x8427('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b93=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2ec049,_0x4eeb0b){var _0x122fe0=function(_0x472823){while(--_0x472823){_0x2ec049['push'](_0x2ec049['shift']());}};_0x122fe0(++_0x4eeb0b);}(_0x3b93,0x7c));var _0x33b9=function(_0x41636c,_0x33d190){_0x41636c=_0x41636c-0x0;var _0x3e8aab=_0x3b93[_0x41636c];return _0x3e8aab;};'use strict';var _=require(_0x33b9('0x0'));var util=require(_0x33b9('0x1'));var logger=require('../../config/logger')(_0x33b9('0x2'));var moment=require(_0x33b9('0x3'));var BPromise=require(_0x33b9('0x4'));var rp=require(_0x33b9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33b9('0x6'));var config=require(_0x33b9('0x7'));var attributes=require(_0x33b9('0x8'));module[_0x33b9('0x9')]=function(_0x52e0a6,_0x122e22){return _0x52e0a6[_0x33b9('0xa')](_0x33b9('0xb'),attributes,{'tableName':_0x33b9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 62a139f..6e0a9ba 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 _0x4c1f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x4ce427,_0x322398){var _0x4965f6=function(_0x4859dd){while(--_0x4859dd){_0x4ce427['push'](_0x4ce427['shift']());}};_0x4965f6(++_0x322398);}(_0x4c1f,0x14f));var _0xf4c1=function(_0x7a677c,_0x464688){_0x7a677c=_0x7a677c-0x0;var _0xf0aa64=_0x4c1f[_0x7a677c];return _0xf0aa64;};'use strict';var _=require(_0xf4c1('0x0'));var util=require(_0xf4c1('0x1'));var moment=require(_0xf4c1('0x2'));var BPromise=require(_0xf4c1('0x3'));var rs=require(_0xf4c1('0x4'));var fs=require('fs');var Redis=require(_0xf4c1('0x5'));var db=require(_0xf4c1('0x6'))['db'];var utils=require(_0xf4c1('0x7'));var logger=require(_0xf4c1('0x8'))(_0xf4c1('0x9'));var config=require('../../config/environment');var jayson=require(_0xf4c1('0xa'));var client=jayson[_0xf4c1('0xb')][_0xf4c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f2ae6,_0x4139e9,_0x43cbfb){return new BPromise(function(_0x3dec35,_0x35eaab){return client['request'](_0x3f2ae6,_0x43cbfb)[_0xf4c1('0xd')](function(_0x174076){logger['info'](_0xf4c1('0xe'),_0x4139e9,_0xf4c1('0xf'));logger[_0xf4c1('0x10')](_0xf4c1('0x11'),_0x4139e9,_0xf4c1('0xf'),JSON['stringify'](_0x174076));if(_0x174076[_0xf4c1('0x12')]){if(_0x174076[_0xf4c1('0x12')]['code']===0x1f4){logger[_0xf4c1('0x12')](_0xf4c1('0xe'),_0x4139e9,_0x174076['error'][_0xf4c1('0x13')]);return _0x35eaab(_0x174076[_0xf4c1('0x12')][_0xf4c1('0x13')]);}logger[_0xf4c1('0x12')](_0xf4c1('0xe'),_0x4139e9,_0x174076['error']['message']);return _0x3dec35(_0x174076[_0xf4c1('0x12')][_0xf4c1('0x13')]);}else{logger[_0xf4c1('0x14')](_0xf4c1('0xe'),_0x4139e9,'request\x20sent');_0x3dec35(_0x174076[_0xf4c1('0x15')][_0xf4c1('0x13')]);}})[_0xf4c1('0x16')](function(_0x1b533c){logger[_0xf4c1('0x12')](_0xf4c1('0xe'),_0x4139e9,_0x1b533c);_0x35eaab(_0x1b533c);});});}exports[_0xf4c1('0x17')]=function(_0x60905f){var _0x3daac2=this;return new Promise(function(_0x28609d,_0x1a8313){return db[_0xf4c1('0x18')][_0xf4c1('0x19')]({'raw':_0x60905f[_0xf4c1('0x1a')]?_0x60905f[_0xf4c1('0x1a')][_0xf4c1('0x1b')]===undefined?!![]:![]:!![],'where':_0x60905f['options']?_0x60905f[_0xf4c1('0x1a')][_0xf4c1('0x1c')]||null:null,'attributes':_0x60905f[_0xf4c1('0x1a')]?_0x60905f[_0xf4c1('0x1a')][_0xf4c1('0x1d')]||null:null,'limit':_0x60905f[_0xf4c1('0x1a')]?_0x60905f[_0xf4c1('0x1a')]['limit']||null:null,'include':_0x60905f['options']?_0x60905f[_0xf4c1('0x1a')][_0xf4c1('0x1e')]?_[_0xf4c1('0x1f')](_0x60905f[_0xf4c1('0x1a')][_0xf4c1('0x1e')],function(_0x2b8626){return{'model':db[_0x2b8626[_0xf4c1('0x20')]],'as':_0x2b8626['as'],'attributes':_0x2b8626['attributes'],'include':_0x2b8626[_0xf4c1('0x1e')]?_[_0xf4c1('0x1f')](_0x2b8626[_0xf4c1('0x1e')],function(_0x11d363){return{'model':db[_0x11d363['model']],'as':_0x11d363['as'],'attributes':_0x11d363['attributes'],'include':_0x11d363[_0xf4c1('0x1e')]?_[_0xf4c1('0x1f')](_0x11d363[_0xf4c1('0x1e')],function(_0x3c7ca5){return{'model':db[_0x3c7ca5['model']],'as':_0x3c7ca5['as'],'attributes':_0x3c7ca5[_0xf4c1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf4c1('0xd')](function(_0x11be20){logger[_0xf4c1('0x14')](_0xf4c1('0x17'),_0x60905f);logger[_0xf4c1('0x10')](_0xf4c1('0x17'),_0x60905f,JSON[_0xf4c1('0x21')](_0x11be20));_0x28609d(_0x11be20);})['catch'](function(_0x4a5fab){logger['error'](_0xf4c1('0x17'),_0x4a5fab[_0xf4c1('0x13')],_0x60905f);_0x1a8313(_0x3daac2[_0xf4c1('0x12')](0x1f4,_0x4a5fab[_0xf4c1('0x13')]));});});}; \ No newline at end of file +var _0x8d53=['MailServerIn','raw','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetMailServerIn'];(function(_0x229ba5,_0x2049e4){var _0x5c8b4e=function(_0x2fb36){while(--_0x2fb36){_0x229ba5['push'](_0x229ba5['shift']());}};_0x5c8b4e(++_0x2049e4);}(_0x8d53,0x1c2));var _0x38d5=function(_0x5ac9b9,_0x1a2212){_0x5ac9b9=_0x5ac9b9-0x0;var _0x4e1ca1=_0x8d53[_0x5ac9b9];return _0x4e1ca1;};'use strict';var _=require(_0x38d5('0x0'));var util=require(_0x38d5('0x1'));var moment=require('moment');var BPromise=require(_0x38d5('0x2'));var rs=require(_0x38d5('0x3'));var fs=require('fs');var Redis=require(_0x38d5('0x4'));var db=require(_0x38d5('0x5'))['db'];var utils=require(_0x38d5('0x6'));var logger=require(_0x38d5('0x7'))(_0x38d5('0x8'));var config=require(_0x38d5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38d5('0xa')][_0x38d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xeb7913,_0x5aa1ca,_0x5ebf9a){return new BPromise(function(_0x284f7b,_0x3883e0){return client[_0x38d5('0xc')](_0xeb7913,_0x5ebf9a)[_0x38d5('0xd')](function(_0x4e18c0){logger[_0x38d5('0xe')](_0x38d5('0xf'),_0x5aa1ca,'request\x20sent');logger[_0x38d5('0x10')](_0x38d5('0x11'),_0x5aa1ca,_0x38d5('0x12'),JSON[_0x38d5('0x13')](_0x4e18c0));if(_0x4e18c0['error']){if(_0x4e18c0['error'][_0x38d5('0x14')]===0x1f4){logger[_0x38d5('0x15')]('MailServerIn,\x20%s,\x20%s',_0x5aa1ca,_0x4e18c0[_0x38d5('0x15')]['message']);return _0x3883e0(_0x4e18c0[_0x38d5('0x15')][_0x38d5('0x16')]);}logger[_0x38d5('0x15')](_0x38d5('0xf'),_0x5aa1ca,_0x4e18c0[_0x38d5('0x15')][_0x38d5('0x16')]);return _0x284f7b(_0x4e18c0['error'][_0x38d5('0x16')]);}else{logger['info'](_0x38d5('0xf'),_0x5aa1ca,'request\x20sent');_0x284f7b(_0x4e18c0[_0x38d5('0x17')][_0x38d5('0x16')]);}})[_0x38d5('0x18')](function(_0x4e98df){logger[_0x38d5('0x15')](_0x38d5('0xf'),_0x5aa1ca,_0x4e98df);_0x3883e0(_0x4e98df);});});}exports[_0x38d5('0x19')]=function(_0xdc1374){var _0x2d1cd9=this;return new Promise(function(_0x380904,_0x519bb1){return db[_0x38d5('0x1a')]['findAll']({'raw':_0xdc1374['options']?_0xdc1374['options'][_0x38d5('0x1b')]===undefined?!![]:![]:!![],'where':_0xdc1374[_0x38d5('0x1c')]?_0xdc1374[_0x38d5('0x1c')]['where']||null:null,'attributes':_0xdc1374['options']?_0xdc1374[_0x38d5('0x1c')][_0x38d5('0x1d')]||null:null,'limit':_0xdc1374[_0x38d5('0x1c')]?_0xdc1374['options'][_0x38d5('0x1e')]||null:null,'include':_0xdc1374['options']?_0xdc1374[_0x38d5('0x1c')][_0x38d5('0x1f')]?_['map'](_0xdc1374['options'][_0x38d5('0x1f')],function(_0x4e1b5f){return{'model':db[_0x4e1b5f[_0x38d5('0x20')]],'as':_0x4e1b5f['as'],'attributes':_0x4e1b5f['attributes'],'include':_0x4e1b5f[_0x38d5('0x1f')]?_[_0x38d5('0x21')](_0x4e1b5f[_0x38d5('0x1f')],function(_0x5b9552){return{'model':db[_0x5b9552[_0x38d5('0x20')]],'as':_0x5b9552['as'],'attributes':_0x5b9552[_0x38d5('0x1d')],'include':_0x5b9552['include']?_[_0x38d5('0x21')](_0x5b9552[_0x38d5('0x1f')],function(_0x12d220){return{'model':db[_0x12d220[_0x38d5('0x20')]],'as':_0x12d220['as'],'attributes':_0x12d220[_0x38d5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x38d5('0xd')](function(_0xbe992b){logger[_0x38d5('0xe')](_0x38d5('0x19'),_0xdc1374);logger[_0x38d5('0x10')](_0x38d5('0x19'),_0xdc1374,JSON[_0x38d5('0x13')](_0xbe992b));_0x380904(_0xbe992b);})[_0x38d5('0x18')](function(_0x5dd0c1){logger['error']('GetMailServerIn',_0x5dd0c1[_0x38d5('0x16')],_0xdc1374);_0x519bb1(_0x2d1cd9[_0x38d5('0x15')](0x1f4,_0x5dd0c1['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e743e53..9ab2956 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(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x7a54,0x106));var _0x47a5=function(_0x1d1536,_0x3a7a19){_0x1d1536=_0x1d1536-0x0;var _0x14fd87=_0x7a54[_0x1d1536];return _0x14fd87;};'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 _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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7a54,0x106));var _0x47a5=function(_0x3b83c5,_0x4e2a01){_0x3b83c5=_0x3b83c5-0x0;var _0x49a3c0=_0x7a54[_0x3b83c5];return _0x49a3c0;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 96859d2..fbbf60e 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 _0x4a20=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x47c666,_0x3ea5c4){var _0x36ef1a=function(_0x3dca19){while(--_0x3dca19){_0x47c666['push'](_0x47c666['shift']());}};_0x36ef1a(++_0x3ea5c4);}(_0x4a20,0x75));var _0x04a2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4a20[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x04a2('0x0')]={'description':{'type':Sequelize[_0x04a2('0x1')]},'host':{'type':Sequelize[_0x04a2('0x1')]},'user':{'type':Sequelize[_0x04a2('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x04a2('0x2')]},'secure':{'type':Sequelize[_0x04a2('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x04a2('0x1')]},'authentication':{'type':Sequelize[_0x04a2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7b75=['sequelize','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b75,0x15c));var _0x57b7=function(_0x4b3ba4,_0x40c247){_0x4b3ba4=_0x4b3ba4-0x0;var _0xda50d5=_0x7b75[_0x4b3ba4];return _0xda50d5;};'use strict';var Sequelize=require(_0x57b7('0x0'));module['exports']={'description':{'type':Sequelize[_0x57b7('0x1')]},'host':{'type':Sequelize[_0x57b7('0x1')]},'user':{'type':Sequelize[_0x57b7('0x1')]},'pass':{'type':Sequelize[_0x57b7('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x57b7('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x57b7('0x1')]},'authentication':{'type':Sequelize[_0x57b7('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index ff7ee7e..9c6774c 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 _0x4f02=['destroy','sendStatus','error','stack','name','send','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','limit','undefined','offset','count','set','apply','save','update','then'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x4f02,0x70));var _0x24f0=function(_0x1e4224,_0xf0bad1){_0x1e4224=_0x1e4224-0x0;var _0x450fdf=_0x4f02[_0x1e4224];return _0x450fdf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x24f0('0x0'));var zipdir=require(_0x24f0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24f0('0x2'));var moment=require(_0x24f0('0x3'));var BPromise=require(_0x24f0('0x4'));var Mustache=require(_0x24f0('0x5'));var util=require(_0x24f0('0x6'));var path=require(_0x24f0('0x7'));var sox=require(_0x24f0('0x8'));var csv=require(_0x24f0('0x9'));var ejs=require(_0x24f0('0xa'));var fs=require('fs');var fs_extra=require(_0x24f0('0xb'));var _=require(_0x24f0('0xc'));var squel=require(_0x24f0('0xd'));var crypto=require(_0x24f0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x24f0('0xf'));var toCsv=require(_0x24f0('0x9'));var querystring=require(_0x24f0('0x10'));var Papa=require(_0x24f0('0x11'));var Redis=require(_0x24f0('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x24f0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24f0('0x14'));var logger=require('../../config/logger')(_0x24f0('0x15'));var utils=require('../../config/utils');var config=require(_0x24f0('0x16'));var licenseUtil=require(_0x24f0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2754d5,_0x46a9c9){_0x46a9c9=_0x46a9c9||0xcc;return function(_0x5c32e0){if(_0x5c32e0){return _0x2754d5['sendStatus'](_0x46a9c9);}return _0x2754d5[_0x24f0('0x18')](_0x46a9c9)[_0x24f0('0x19')]();};}function respondWithResult(_0x577937,_0x26da0d){_0x26da0d=_0x26da0d||0xc8;return function(_0x1250f9){if(_0x1250f9){return _0x577937[_0x24f0('0x18')](_0x26da0d)[_0x24f0('0x1a')](_0x1250f9);}};}function respondWithFilteredResult(_0x250ead,_0x11f8ec){return function(_0x13ad7f){if(_0x13ad7f){var _0x2c9ea2=typeof _0x11f8ec['offset']==='undefined'&&typeof _0x11f8ec[_0x24f0('0x1b')]===_0x24f0('0x1c');var _0x16375e=_0x13ad7f['count'];var _0x10d5e4=_0x2c9ea2?0x0:_0x11f8ec[_0x24f0('0x1d')];var _0x1e523a=_0x2c9ea2?_0x13ad7f[_0x24f0('0x1e')]:_0x11f8ec[_0x24f0('0x1d')]+_0x11f8ec[_0x24f0('0x1b')];var _0x512a26;if(_0x1e523a>=_0x16375e){_0x1e523a=_0x16375e;_0x512a26=0xc8;}else{_0x512a26=0xce;}_0x250ead[_0x24f0('0x18')](_0x512a26);return _0x250ead[_0x24f0('0x1f')]('Content-Range',_0x10d5e4+'-'+_0x1e523a+'/'+_0x16375e)[_0x24f0('0x1a')](_0x13ad7f);}return null;};}function patchUpdates(_0x26cece){return function(_0x44009a){try{jsonpatch[_0x24f0('0x20')](_0x44009a,_0x26cece,!![]);}catch(_0x26e304){return BPromise['reject'](_0x26e304);}return _0x44009a[_0x24f0('0x21')]();};}function saveUpdates(_0x3ba1a1,_0x5e9c1a){return function(_0x2004a7){if(_0x2004a7){return _0x2004a7[_0x24f0('0x22')](_0x3ba1a1)[_0x24f0('0x23')](function(_0x2b37b9){return _0x2b37b9;});}return null;};}function removeEntity(_0x26b95a,_0x575560){return function(_0x61dfa8){if(_0x61dfa8){return _0x61dfa8[_0x24f0('0x24')]()[_0x24f0('0x23')](function(){_0x26b95a[_0x24f0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4cf7,_0x1db0df){return function(_0x5e27c7){if(!_0x5e27c7){_0x5e4cf7[_0x24f0('0x25')](0x194);}return _0x5e27c7;};}function handleError(_0x40930d,_0x4336a8){_0x4336a8=_0x4336a8||0x1f4;return function(_0xa434c1){logger[_0x24f0('0x26')](_0xa434c1[_0x24f0('0x27')]);if(_0xa434c1['name']){delete _0xa434c1[_0x24f0('0x28')];}_0x40930d[_0x24f0('0x18')](_0x4336a8)[_0x24f0('0x29')](_0xa434c1);};}exports['index']=function(_0x20cce8,_0x1a36c4){var _0x4360b0={},_0x3d18ab={},_0x1fe59c={'count':0x0,'rows':[]};var _0x3d6c95=_[_0x24f0('0x2a')](db[_0x24f0('0x2b')][_0x24f0('0x2c')],function(_0x4d0d58){return{'name':_0x4d0d58[_0x24f0('0x2d')],'type':_0x4d0d58['type'][_0x24f0('0x2e')]};});_0x3d18ab[_0x24f0('0x2f')]=_[_0x24f0('0x2a')](_0x3d6c95,'name');_0x3d18ab[_0x24f0('0x30')]=_[_0x24f0('0x31')](_0x20cce8[_0x24f0('0x30')]);_0x3d18ab[_0x24f0('0x32')]=_['intersection'](_0x3d18ab[_0x24f0('0x2f')],_0x3d18ab[_0x24f0('0x30')]);_0x4360b0[_0x24f0('0x33')]=_[_0x24f0('0x34')](_0x3d18ab[_0x24f0('0x2f')],qs[_0x24f0('0x35')](_0x20cce8[_0x24f0('0x30')][_0x24f0('0x35')]));_0x4360b0['attributes']=_0x4360b0[_0x24f0('0x33')][_0x24f0('0x36')]?_0x4360b0[_0x24f0('0x33')]:_0x3d18ab[_0x24f0('0x2f')];if(!_0x20cce8[_0x24f0('0x30')][_0x24f0('0x37')](_0x24f0('0x38'))){_0x4360b0[_0x24f0('0x1b')]=qs['limit'](_0x20cce8[_0x24f0('0x30')]['limit']);_0x4360b0[_0x24f0('0x1d')]=qs[_0x24f0('0x1d')](_0x20cce8[_0x24f0('0x30')][_0x24f0('0x1d')]);}_0x4360b0['order']=qs[_0x24f0('0x39')](_0x20cce8[_0x24f0('0x30')]['sort']);_0x4360b0['where']=qs['filters'](_[_0x24f0('0x3a')](_0x20cce8[_0x24f0('0x30')],_0x3d18ab[_0x24f0('0x32')]),_0x3d6c95);if(_0x20cce8['query'][_0x24f0('0x3b')]){_0x4360b0[_0x24f0('0x3c')]=_[_0x24f0('0x3d')](_0x4360b0['where'],{'$or':_[_0x24f0('0x2a')](_0x3d6c95,function(_0x2c1914){if(_0x2c1914[_0x24f0('0x3e')]!==_0x24f0('0x3f')){var _0x48d855={};_0x48d855[_0x2c1914[_0x24f0('0x28')]]={'$like':'%'+_0x20cce8[_0x24f0('0x30')][_0x24f0('0x3b')]+'%'};return _0x48d855;}})});}_0x4360b0=_[_0x24f0('0x3d')]({},_0x4360b0,_0x20cce8[_0x24f0('0x40')]);var _0x53b20e={'where':_0x4360b0[_0x24f0('0x3c')]};return db[_0x24f0('0x2b')]['count'](_0x53b20e)['then'](function(_0x1b311a){_0x1fe59c['count']=_0x1b311a;if(_0x20cce8['query']['includeAll']){_0x4360b0[_0x24f0('0x41')]=[{'all':!![]}];}return db['MailServerOut'][_0x24f0('0x42')](_0x4360b0);})[_0x24f0('0x23')](function(_0x40c6f7){_0x1fe59c[_0x24f0('0x43')]=_0x40c6f7;return _0x1fe59c;})['then'](respondWithFilteredResult(_0x1a36c4,_0x4360b0))[_0x24f0('0x44')](handleError(_0x1a36c4,null));};exports[_0x24f0('0x45')]=function(_0x2fdd58,_0x3991d0){var _0x36711b={'raw':!![],'where':{'id':_0x2fdd58['params']['id']}},_0x54064e={};_0x54064e[_0x24f0('0x2f')]=_['keys'](db[_0x24f0('0x2b')][_0x24f0('0x2c')]);_0x54064e[_0x24f0('0x30')]=_['keys'](_0x2fdd58[_0x24f0('0x30')]);_0x54064e[_0x24f0('0x32')]=_[_0x24f0('0x34')](_0x54064e[_0x24f0('0x2f')],_0x54064e[_0x24f0('0x30')]);_0x36711b[_0x24f0('0x33')]=_[_0x24f0('0x34')](_0x54064e[_0x24f0('0x2f')],qs[_0x24f0('0x35')](_0x2fdd58[_0x24f0('0x30')][_0x24f0('0x35')]));_0x36711b[_0x24f0('0x33')]=_0x36711b[_0x24f0('0x33')][_0x24f0('0x36')]?_0x36711b['attributes']:_0x54064e[_0x24f0('0x2f')];if(_0x2fdd58[_0x24f0('0x30')][_0x24f0('0x46')]){_0x36711b['include']=[{'all':!![]}];}_0x36711b=_['merge']({},_0x36711b,_0x2fdd58[_0x24f0('0x40')]);return db['MailServerOut']['find'](_0x36711b)['then'](handleEntityNotFound(_0x3991d0,null))[_0x24f0('0x23')](respondWithResult(_0x3991d0,null))[_0x24f0('0x44')](handleError(_0x3991d0,null));};exports[_0x24f0('0x47')]=function(_0x1043bb,_0x46b2c4){return db[_0x24f0('0x2b')][_0x24f0('0x47')](_0x1043bb[_0x24f0('0x48')],{})[_0x24f0('0x23')](respondWithResult(_0x46b2c4,0xc9))[_0x24f0('0x44')](handleError(_0x46b2c4,null));};exports[_0x24f0('0x22')]=function(_0x1ea2ba,_0x5a8710){if(_0x1ea2ba[_0x24f0('0x48')]['id']){delete _0x1ea2ba['body']['id'];}return db[_0x24f0('0x2b')][_0x24f0('0x49')]({'where':{'id':_0x1ea2ba['params']['id']}})[_0x24f0('0x23')](handleEntityNotFound(_0x5a8710,null))['then'](saveUpdates(_0x1ea2ba[_0x24f0('0x48')],null))[_0x24f0('0x23')](respondWithResult(_0x5a8710,null))[_0x24f0('0x44')](handleError(_0x5a8710,null));};exports[_0x24f0('0x24')]=function(_0x284c23,_0x49fdfa){return db[_0x24f0('0x2b')][_0x24f0('0x49')]({'where':{'id':_0x284c23['params']['id']}})[_0x24f0('0x23')](handleEntityNotFound(_0x49fdfa,null))[_0x24f0('0x23')](removeEntity(_0x49fdfa,null))['catch'](handleError(_0x49fdfa,null));}; \ No newline at end of file +var _0x98e1=['rows','catch','show','rawAttributes','create','body','update','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','MailServerOut','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x11853d,_0x57cbcf){var _0x44ef9d=function(_0x5ba5d7){while(--_0x5ba5d7){_0x11853d['push'](_0x11853d['shift']());}};_0x44ef9d(++_0x57cbcf);}(_0x98e1,0x1b9));var _0x198e=function(_0x4df231,_0x179f5d){_0x4df231=_0x4df231-0x0;var _0x391a5e=_0x98e1[_0x4df231];return _0x391a5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x198e('0x0'));var zipdir=require(_0x198e('0x1'));var jsonpatch=require(_0x198e('0x2'));var rp=require(_0x198e('0x3'));var moment=require(_0x198e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x198e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x198e('0x6'));var csv=require(_0x198e('0x7'));var ejs=require(_0x198e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x198e('0x9'));var squel=require('squel');var crypto=require(_0x198e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x198e('0xb'));var Redis=require(_0x198e('0xc'));var authService=require(_0x198e('0xd'));var qs=require(_0x198e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x198e('0xf'));var logger=require(_0x198e('0x10'))(_0x198e('0x11'));var utils=require(_0x198e('0x12'));var config=require(_0x198e('0x13'));var licenseUtil=require(_0x198e('0x14'));var db=require(_0x198e('0x15'))['db'];function respondWithStatusCode(_0x5a298f,_0x557723){_0x557723=_0x557723||0xcc;return function(_0x5efa7b){if(_0x5efa7b){return _0x5a298f[_0x198e('0x16')](_0x557723);}return _0x5a298f[_0x198e('0x17')](_0x557723)['end']();};}function respondWithResult(_0x2f665f,_0x37e782){_0x37e782=_0x37e782||0xc8;return function(_0x163023){if(_0x163023){return _0x2f665f[_0x198e('0x17')](_0x37e782)[_0x198e('0x18')](_0x163023);}};}function respondWithFilteredResult(_0x51c822,_0x209f25){return function(_0x24bf86){if(_0x24bf86){var _0x4f94b1=typeof _0x209f25[_0x198e('0x19')]==='undefined'&&typeof _0x209f25[_0x198e('0x1a')]==='undefined';var _0x522104=_0x24bf86['count'];var _0x1c68a3=_0x4f94b1?0x0:_0x209f25[_0x198e('0x19')];var _0x1f22e3=_0x4f94b1?_0x24bf86[_0x198e('0x1b')]:_0x209f25[_0x198e('0x19')]+_0x209f25['limit'];var _0x446705;if(_0x1f22e3>=_0x522104){_0x1f22e3=_0x522104;_0x446705=0xc8;}else{_0x446705=0xce;}_0x51c822[_0x198e('0x17')](_0x446705);return _0x51c822[_0x198e('0x1c')](_0x198e('0x1d'),_0x1c68a3+'-'+_0x1f22e3+'/'+_0x522104)['json'](_0x24bf86);}return null;};}function patchUpdates(_0x28b001){return function(_0x395c82){try{jsonpatch['apply'](_0x395c82,_0x28b001,!![]);}catch(_0x3bcf50){return BPromise[_0x198e('0x1e')](_0x3bcf50);}return _0x395c82['save']();};}function saveUpdates(_0x5a1d7a,_0x1f471a){return function(_0x4c7ce9){if(_0x4c7ce9){return _0x4c7ce9['update'](_0x5a1d7a)[_0x198e('0x1f')](function(_0x34ef86){return _0x34ef86;});}return null;};}function removeEntity(_0x4f04fb,_0x1d2b40){return function(_0xe6635c){if(_0xe6635c){return _0xe6635c[_0x198e('0x20')]()[_0x198e('0x1f')](function(){_0x4f04fb[_0x198e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdfefab,_0x1fd77e){return function(_0x3da205){if(!_0x3da205){_0xdfefab['sendStatus'](0x194);}return _0x3da205;};}function handleError(_0xc0c83,_0x419784){_0x419784=_0x419784||0x1f4;return function(_0x2691a5){logger[_0x198e('0x21')](_0x2691a5[_0x198e('0x22')]);if(_0x2691a5[_0x198e('0x23')]){delete _0x2691a5[_0x198e('0x23')];}_0xc0c83['status'](_0x419784)[_0x198e('0x24')](_0x2691a5);};}exports[_0x198e('0x25')]=function(_0x3fb64f,_0x5893b9){var _0x4615c3={},_0x417d89={},_0x2cb803={'count':0x0,'rows':[]};var _0x1263d7=_[_0x198e('0x26')](db[_0x198e('0x27')]['rawAttributes'],function(_0x16230c){return{'name':_0x16230c[_0x198e('0x28')],'type':_0x16230c[_0x198e('0x29')]['key']};});_0x417d89[_0x198e('0x2a')]=_[_0x198e('0x26')](_0x1263d7,_0x198e('0x23'));_0x417d89[_0x198e('0x2b')]=_[_0x198e('0x2c')](_0x3fb64f[_0x198e('0x2b')]);_0x417d89[_0x198e('0x2d')]=_[_0x198e('0x2e')](_0x417d89[_0x198e('0x2a')],_0x417d89[_0x198e('0x2b')]);_0x4615c3[_0x198e('0x2f')]=_[_0x198e('0x2e')](_0x417d89[_0x198e('0x2a')],qs[_0x198e('0x30')](_0x3fb64f[_0x198e('0x2b')][_0x198e('0x30')]));_0x4615c3[_0x198e('0x2f')]=_0x4615c3['attributes'][_0x198e('0x31')]?_0x4615c3[_0x198e('0x2f')]:_0x417d89['model'];if(!_0x3fb64f[_0x198e('0x2b')][_0x198e('0x32')](_0x198e('0x33'))){_0x4615c3[_0x198e('0x1a')]=qs[_0x198e('0x1a')](_0x3fb64f[_0x198e('0x2b')]['limit']);_0x4615c3[_0x198e('0x19')]=qs[_0x198e('0x19')](_0x3fb64f[_0x198e('0x2b')][_0x198e('0x19')]);}_0x4615c3[_0x198e('0x34')]=qs[_0x198e('0x35')](_0x3fb64f['query'][_0x198e('0x35')]);_0x4615c3[_0x198e('0x36')]=qs[_0x198e('0x2d')](_[_0x198e('0x37')](_0x3fb64f['query'],_0x417d89['filters']),_0x1263d7);if(_0x3fb64f[_0x198e('0x2b')]['filter']){_0x4615c3['where']=_[_0x198e('0x38')](_0x4615c3[_0x198e('0x36')],{'$or':_[_0x198e('0x26')](_0x1263d7,function(_0x2fa170){if(_0x2fa170['type']!==_0x198e('0x39')){var _0x55d41c={};_0x55d41c[_0x2fa170['name']]={'$like':'%'+_0x3fb64f['query'][_0x198e('0x3a')]+'%'};return _0x55d41c;}})});}_0x4615c3=_[_0x198e('0x38')]({},_0x4615c3,_0x3fb64f[_0x198e('0x3b')]);var _0x49a61b={'where':_0x4615c3[_0x198e('0x36')]};return db[_0x198e('0x27')][_0x198e('0x1b')](_0x49a61b)[_0x198e('0x1f')](function(_0x1aa16f){_0x2cb803[_0x198e('0x1b')]=_0x1aa16f;if(_0x3fb64f['query'][_0x198e('0x3c')]){_0x4615c3[_0x198e('0x3d')]=[{'all':!![]}];}return db['MailServerOut'][_0x198e('0x3e')](_0x4615c3);})['then'](function(_0x18f9bc){_0x2cb803[_0x198e('0x3f')]=_0x18f9bc;return _0x2cb803;})[_0x198e('0x1f')](respondWithFilteredResult(_0x5893b9,_0x4615c3))[_0x198e('0x40')](handleError(_0x5893b9,null));};exports[_0x198e('0x41')]=function(_0x50874b,_0x3be076){var _0xd3c1f4={'raw':!![],'where':{'id':_0x50874b['params']['id']}},_0x5afb56={};_0x5afb56[_0x198e('0x2a')]=_[_0x198e('0x2c')](db[_0x198e('0x27')][_0x198e('0x42')]);_0x5afb56[_0x198e('0x2b')]=_[_0x198e('0x2c')](_0x50874b['query']);_0x5afb56[_0x198e('0x2d')]=_[_0x198e('0x2e')](_0x5afb56[_0x198e('0x2a')],_0x5afb56['query']);_0xd3c1f4['attributes']=_[_0x198e('0x2e')](_0x5afb56['model'],qs[_0x198e('0x30')](_0x50874b[_0x198e('0x2b')][_0x198e('0x30')]));_0xd3c1f4['attributes']=_0xd3c1f4[_0x198e('0x2f')]['length']?_0xd3c1f4[_0x198e('0x2f')]:_0x5afb56[_0x198e('0x2a')];if(_0x50874b[_0x198e('0x2b')][_0x198e('0x3c')]){_0xd3c1f4[_0x198e('0x3d')]=[{'all':!![]}];}_0xd3c1f4=_['merge']({},_0xd3c1f4,_0x50874b['options']);return db[_0x198e('0x27')]['find'](_0xd3c1f4)['then'](handleEntityNotFound(_0x3be076,null))[_0x198e('0x1f')](respondWithResult(_0x3be076,null))[_0x198e('0x40')](handleError(_0x3be076,null));};exports[_0x198e('0x43')]=function(_0x5b2e4a,_0x385b8b){return db[_0x198e('0x27')]['create'](_0x5b2e4a[_0x198e('0x44')],{})[_0x198e('0x1f')](respondWithResult(_0x385b8b,0xc9))[_0x198e('0x40')](handleError(_0x385b8b,null));};exports[_0x198e('0x45')]=function(_0x372d5b,_0x2a43ad){if(_0x372d5b[_0x198e('0x44')]['id']){delete _0x372d5b['body']['id'];}return db[_0x198e('0x27')][_0x198e('0x46')]({'where':{'id':_0x372d5b[_0x198e('0x47')]['id']}})[_0x198e('0x1f')](handleEntityNotFound(_0x2a43ad,null))[_0x198e('0x1f')](saveUpdates(_0x372d5b['body'],null))[_0x198e('0x1f')](respondWithResult(_0x2a43ad,null))[_0x198e('0x40')](handleError(_0x2a43ad,null));};exports[_0x198e('0x20')]=function(_0x29837a,_0x34d7f8){return db['MailServerOut'][_0x198e('0x46')]({'where':{'id':_0x29837a['params']['id']}})[_0x198e('0x1f')](handleEntityNotFound(_0x34d7f8,null))['then'](removeEntity(_0x34d7f8,null))[_0x198e('0x40')](handleError(_0x34d7f8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e8aa265..0c5423b 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 _0xc25f=['path','../../config/environment','exports','MailServerOut','mail_servers_out','util','../../config/logger','moment'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xc25f,0x1c5));var _0xfc25=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc25f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xfc25('0x0'));var logger=require(_0xfc25('0x1'))('api');var moment=require(_0xfc25('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc25('0x3'));var rimraf=require('rimraf');var config=require(_0xfc25('0x4'));var attributes=require('./mailServerOut.attributes');module[_0xfc25('0x5')]=function(_0x5b5f3f,_0x1cedca){return _0x5b5f3f['define'](_0xfc25('0x6'),attributes,{'tableName':_0xfc25('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b4b=['path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3028b3,_0x168305){var _0x4e5ed3=function(_0x47490d){while(--_0x47490d){_0x3028b3['push'](_0x3028b3['shift']());}};_0x4e5ed3(++_0x168305);}(_0x6b4b,0x103));var _0xb6b4=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x6b4b[_0x45f951];return _0x24756c;};'use strict';var _=require('lodash');var util=require(_0xb6b4('0x0'));var logger=require(_0xb6b4('0x1'))('api');var moment=require(_0xb6b4('0x2'));var BPromise=require(_0xb6b4('0x3'));var rp=require(_0xb6b4('0x4'));var fs=require('fs');var path=require(_0xb6b4('0x5'));var rimraf=require(_0xb6b4('0x6'));var config=require(_0xb6b4('0x7'));var attributes=require(_0xb6b4('0x8'));module['exports']=function(_0x191fc9,_0x12bd3b){return _0x191fc9[_0xb6b4('0x9')](_0xb6b4('0xa'),attributes,{'tableName':_0xb6b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 6b1951e..80bcfea 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0xadb5,0xad));var _0x5adb=function(_0x10e444,_0x26b387){_0x10e444=_0x10e444-0x0;var _0x4403f5=_0xadb5[_0x10e444];return _0x4403f5;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x280438,_0x1a2b94){var _0x26c9d6=function(_0x1d369a){while(--_0x1d369a){_0x280438['push'](_0x280438['shift']());}};_0x26c9d6(++_0x1a2b94);}(_0xadb5,0xad));var _0x5adb=function(_0x3644c7,_0x306d34){_0x3644c7=_0x3644c7-0x0;var _0x5a04bd=_0xadb5[_0x3644c7];return _0x5a04bd;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 85caaec..a8bb0ad 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 _0x85cd=['util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','index','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x85cd,0x1b0));var _0xd85c=function(_0x59dee8,_0x155f3a){_0x59dee8=_0x59dee8-0x0;var _0x1697ab=_0x85cd[_0x59dee8];return _0x1697ab;};'use strict';var multer=require('multer');var util=require(_0xd85c('0x0'));var path=require('path');var timeout=require(_0xd85c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd85c('0x2'));var auth=require(_0xd85c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd85c('0x4'));var controller=require(_0xd85c('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd85c('0x6')]);router['get']('/describe',auth[_0xd85c('0x7')](),controller[_0xd85c('0x8')]);router[_0xd85c('0x9')](_0xd85c('0xa'),auth['isAuthenticated'](),controller[_0xd85c('0xb')]);router[_0xd85c('0xc')]('/',auth[_0xd85c('0x7')](),controller[_0xd85c('0xd')]);router[_0xd85c('0xe')](_0xd85c('0xa'),auth['isAuthenticated'](),controller[_0xd85c('0xf')]);router[_0xd85c('0x10')](_0xd85c('0xa'),auth[_0xd85c('0x7')](),controller[_0xd85c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0ab7=['create','delete','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x5e7b69,_0x152194){var _0x5a1234=function(_0x543a73){while(--_0x543a73){_0x5e7b69['push'](_0x5e7b69['shift']());}};_0x5a1234(++_0x152194);}(_0x0ab7,0x102));var _0x70ab=function(_0x494b40,_0x5e3039){_0x494b40=_0x494b40-0x0;var _0xfeaedd=_0x0ab7[_0x494b40];return _0xfeaedd;};'use strict';var multer=require('multer');var util=require(_0x70ab('0x0'));var path=require(_0x70ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x70ab('0x2'));var router=express['Router']();var fs_extra=require(_0x70ab('0x3'));var auth=require(_0x70ab('0x4'));var interaction=require(_0x70ab('0x5'));var config=require(_0x70ab('0x6'));var controller=require(_0x70ab('0x7'));router[_0x70ab('0x8')]('/',auth[_0x70ab('0x9')](),controller[_0x70ab('0xa')]);router[_0x70ab('0x8')](_0x70ab('0xb'),auth[_0x70ab('0x9')](),controller['describe']);router[_0x70ab('0x8')](_0x70ab('0xc'),auth[_0x70ab('0x9')](),controller[_0x70ab('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x70ab('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x70ab('0xf')]('/:id',auth[_0x70ab('0x9')](),controller['destroy']);module[_0x70ab('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index b41bac1..10954b6 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 _0xc7a3=['exports','STRING','name'];(function(_0x4d69d9,_0x4c1451){var _0x4fcf1e=function(_0x171a4e){while(--_0x171a4e){_0x4d69d9['push'](_0x4d69d9['shift']());}};_0x4fcf1e(++_0x4c1451);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x29daff,_0x36ef52){_0x29daff=_0x29daff-0x0;var _0x3c8e79=_0xc7a3[_0x29daff];return _0x3c8e79;};'use strict';var Sequelize=require('sequelize');module[_0x3c7a('0x0')]={'name':{'type':Sequelize[_0x3c7a('0x1')],'unique':_0x3c7a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3c7a('0x1')]}}; \ No newline at end of file +var _0xcde7=['name','STRING'];(function(_0x26782a,_0x22fb1c){var _0x287c30=function(_0x5ef614){while(--_0x5ef614){_0x26782a['push'](_0x26782a['shift']());}};_0x287c30(++_0x22fb1c);}(_0xcde7,0x65));var _0x7cde=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcde7[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7cde('0x0')],'unique':_0x7cde('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7cde('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index cd7abbe..05d37a2 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 _0x9025=['../../mysqldb','status','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','end','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x11ecc1,_0x131312){var _0x3d3d6c=function(_0x228792){while(--_0x228792){_0x11ecc1['push'](_0x11ecc1['shift']());}};_0x3d3d6c(++_0x131312);}(_0x9025,0x1a7));var _0x5902=function(_0x555bd0,_0x2f250f){_0x555bd0=_0x555bd0-0x0;var _0x8df27d=_0x9025[_0x555bd0];return _0x8df27d;};'use strict';var emlformat=require(_0x5902('0x0'));var rimraf=require(_0x5902('0x1'));var zipdir=require(_0x5902('0x2'));var jsonpatch=require(_0x5902('0x3'));var rp=require(_0x5902('0x4'));var moment=require(_0x5902('0x5'));var BPromise=require(_0x5902('0x6'));var Mustache=require('mustache');var util=require(_0x5902('0x7'));var path=require(_0x5902('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5902('0x9'));var squel=require('squel');var crypto=require(_0x5902('0xa'));var jsforce=require(_0x5902('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5902('0xc'));var querystring=require(_0x5902('0xd'));var Papa=require(_0x5902('0xe'));var Redis=require('ioredis');var authService=require(_0x5902('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5902('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5902('0x11'))(_0x5902('0x12'));var utils=require(_0x5902('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5902('0x14'));var db=require(_0x5902('0x15'))['db'];function respondWithStatusCode(_0x266aaa,_0x234824){_0x234824=_0x234824||0xcc;return function(_0x1b6045){if(_0x1b6045){return _0x266aaa['sendStatus'](_0x234824);}return _0x266aaa[_0x5902('0x16')](_0x234824)['end']();};}function respondWithResult(_0x22b637,_0x3b5fb9){_0x3b5fb9=_0x3b5fb9||0xc8;return function(_0x327d1d){if(_0x327d1d){return _0x22b637['status'](_0x3b5fb9)['json'](_0x327d1d);}};}function respondWithFilteredResult(_0x2e1947,_0x372223){return function(_0x36f08f){if(_0x36f08f){var _0x3c9225=typeof _0x372223[_0x5902('0x17')]===_0x5902('0x18')&&typeof _0x372223[_0x5902('0x19')]==='undefined';var _0x3d4cda=_0x36f08f[_0x5902('0x1a')];var _0x69c9d=_0x3c9225?0x0:_0x372223[_0x5902('0x17')];var _0x352b60=_0x3c9225?_0x36f08f['count']:_0x372223[_0x5902('0x17')]+_0x372223['limit'];var _0x530794;if(_0x352b60>=_0x3d4cda){_0x352b60=_0x3d4cda;_0x530794=0xc8;}else{_0x530794=0xce;}_0x2e1947[_0x5902('0x16')](_0x530794);return _0x2e1947[_0x5902('0x1b')]('Content-Range',_0x69c9d+'-'+_0x352b60+'/'+_0x3d4cda)[_0x5902('0x1c')](_0x36f08f);}return null;};}function patchUpdates(_0x39fa44){return function(_0x1b5ef3){try{jsonpatch[_0x5902('0x1d')](_0x1b5ef3,_0x39fa44,!![]);}catch(_0x146f93){return BPromise[_0x5902('0x1e')](_0x146f93);}return _0x1b5ef3['save']();};}function saveUpdates(_0x316e11,_0x4ec5f8){return function(_0x19707f){if(_0x19707f){return _0x19707f[_0x5902('0x1f')](_0x316e11)[_0x5902('0x20')](function(_0x37f6a1){return _0x37f6a1;});}return null;};}function removeEntity(_0x465067,_0x50706e){return function(_0x5e393e){if(_0x5e393e){return _0x5e393e[_0x5902('0x21')]()[_0x5902('0x20')](function(){_0x465067[_0x5902('0x16')](0xcc)[_0x5902('0x22')]();});}};}function handleEntityNotFound(_0x40eb5b,_0x2c8ee1){return function(_0x21f4a6){if(!_0x21f4a6){_0x40eb5b[_0x5902('0x23')](0x194);}return _0x21f4a6;};}function handleError(_0x338512,_0x340014){_0x340014=_0x340014||0x1f4;return function(_0x4f0c92){logger[_0x5902('0x24')](_0x4f0c92['stack']);if(_0x4f0c92[_0x5902('0x25')]){delete _0x4f0c92['name'];}_0x338512[_0x5902('0x16')](_0x340014)['send'](_0x4f0c92);};}exports[_0x5902('0x26')]=function(_0x870c7a,_0x2c83d1){var _0x17e424={},_0x1a1df9={},_0x4a3b3b={'count':0x0,'rows':[]};var _0x14d33b=_[_0x5902('0x27')](db['MailSubstatus'][_0x5902('0x28')],function(_0x3a1be1){return{'name':_0x3a1be1[_0x5902('0x29')],'type':_0x3a1be1[_0x5902('0x2a')][_0x5902('0x2b')]};});_0x1a1df9[_0x5902('0x2c')]=_[_0x5902('0x27')](_0x14d33b,_0x5902('0x25'));_0x1a1df9['query']=_['keys'](_0x870c7a[_0x5902('0x2d')]);_0x1a1df9[_0x5902('0x2e')]=_['intersection'](_0x1a1df9[_0x5902('0x2c')],_0x1a1df9[_0x5902('0x2d')]);_0x17e424[_0x5902('0x2f')]=_[_0x5902('0x30')](_0x1a1df9[_0x5902('0x2c')],qs[_0x5902('0x31')](_0x870c7a['query'][_0x5902('0x31')]));_0x17e424[_0x5902('0x2f')]=_0x17e424[_0x5902('0x2f')]['length']?_0x17e424['attributes']:_0x1a1df9[_0x5902('0x2c')];if(!_0x870c7a[_0x5902('0x2d')][_0x5902('0x32')](_0x5902('0x33'))){_0x17e424[_0x5902('0x19')]=qs[_0x5902('0x19')](_0x870c7a[_0x5902('0x2d')]['limit']);_0x17e424[_0x5902('0x17')]=qs['offset'](_0x870c7a['query']['offset']);}_0x17e424[_0x5902('0x34')]=qs['sort'](_0x870c7a[_0x5902('0x2d')][_0x5902('0x35')]);_0x17e424[_0x5902('0x36')]=qs[_0x5902('0x2e')](_[_0x5902('0x37')](_0x870c7a[_0x5902('0x2d')],_0x1a1df9[_0x5902('0x2e')]),_0x14d33b);if(_0x870c7a[_0x5902('0x2d')][_0x5902('0x38')]){_0x17e424[_0x5902('0x36')]=_[_0x5902('0x39')](_0x17e424[_0x5902('0x36')],{'$or':_[_0x5902('0x27')](_0x14d33b,function(_0x472289){if(_0x472289['type']!==_0x5902('0x3a')){var _0x24fc78={};_0x24fc78[_0x472289[_0x5902('0x25')]]={'$like':'%'+_0x870c7a[_0x5902('0x2d')]['filter']+'%'};return _0x24fc78;}})});}_0x17e424=_[_0x5902('0x39')]({},_0x17e424,_0x870c7a[_0x5902('0x3b')]);var _0x5a0ed3={'where':_0x17e424[_0x5902('0x36')]};return db[_0x5902('0x3c')][_0x5902('0x1a')](_0x5a0ed3)[_0x5902('0x20')](function(_0xd83a3a){_0x4a3b3b[_0x5902('0x1a')]=_0xd83a3a;if(_0x870c7a[_0x5902('0x2d')][_0x5902('0x3d')]){_0x17e424[_0x5902('0x3e')]=[{'all':!![]}];}return db['MailSubstatus'][_0x5902('0x3f')](_0x17e424);})[_0x5902('0x20')](function(_0x175a78){_0x4a3b3b[_0x5902('0x40')]=_0x175a78;return _0x4a3b3b;})['then'](respondWithFilteredResult(_0x2c83d1,_0x17e424))[_0x5902('0x41')](handleError(_0x2c83d1,null));};exports[_0x5902('0x42')]=function(_0x1e0de2,_0x2ebf8f){var _0x111fb6={'raw':!![],'where':{'id':_0x1e0de2[_0x5902('0x43')]['id']}},_0x4e3c74={};_0x4e3c74[_0x5902('0x2c')]=_[_0x5902('0x44')](db[_0x5902('0x3c')]['rawAttributes']);_0x4e3c74['query']=_[_0x5902('0x44')](_0x1e0de2[_0x5902('0x2d')]);_0x4e3c74[_0x5902('0x2e')]=_[_0x5902('0x30')](_0x4e3c74[_0x5902('0x2c')],_0x4e3c74[_0x5902('0x2d')]);_0x111fb6[_0x5902('0x2f')]=_[_0x5902('0x30')](_0x4e3c74[_0x5902('0x2c')],qs[_0x5902('0x31')](_0x1e0de2[_0x5902('0x2d')][_0x5902('0x31')]));_0x111fb6[_0x5902('0x2f')]=_0x111fb6[_0x5902('0x2f')][_0x5902('0x45')]?_0x111fb6[_0x5902('0x2f')]:_0x4e3c74[_0x5902('0x2c')];if(_0x1e0de2[_0x5902('0x2d')][_0x5902('0x3d')]){_0x111fb6['include']=[{'all':!![]}];}_0x111fb6=_[_0x5902('0x39')]({},_0x111fb6,_0x1e0de2[_0x5902('0x3b')]);return db[_0x5902('0x3c')][_0x5902('0x46')](_0x111fb6)[_0x5902('0x20')](handleEntityNotFound(_0x2ebf8f,null))['then'](respondWithResult(_0x2ebf8f,null))[_0x5902('0x41')](handleError(_0x2ebf8f,null));};exports[_0x5902('0x47')]=function(_0x24ac63,_0x195cd7){return db[_0x5902('0x3c')][_0x5902('0x47')](_0x24ac63[_0x5902('0x48')],{})['then'](respondWithResult(_0x195cd7,0xc9))[_0x5902('0x41')](handleError(_0x195cd7,null));};exports[_0x5902('0x1f')]=function(_0x1b6410,_0x435d9e){if(_0x1b6410['body']['id']){delete _0x1b6410['body']['id'];}return db[_0x5902('0x3c')][_0x5902('0x46')]({'where':{'id':_0x1b6410[_0x5902('0x43')]['id']}})[_0x5902('0x20')](handleEntityNotFound(_0x435d9e,null))[_0x5902('0x20')](saveUpdates(_0x1b6410[_0x5902('0x48')],null))[_0x5902('0x20')](respondWithResult(_0x435d9e,null))[_0x5902('0x41')](handleError(_0x435d9e,null));};exports[_0x5902('0x21')]=function(_0x206b48,_0xf4f69f){return db[_0x5902('0x3c')][_0x5902('0x46')]({'where':{'id':_0x206b48['params']['id']}})[_0x5902('0x20')](handleEntityNotFound(_0xf4f69f,null))[_0x5902('0x20')](removeEntity(_0xf4f69f,null))[_0x5902('0x41')](handleError(_0xf4f69f,null));};exports[_0x5902('0x49')]=function(_0x22fd31,_0x303124){return db[_0x5902('0x3c')][_0x5902('0x49')]()[_0x5902('0x20')](respondWithResult(_0x303124,null))['catch'](handleError(_0x303124,null));}; \ No newline at end of file +var _0x28e3=['set','json','apply','save','then','destroy','end','sendStatus','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','status','offset','undefined','limit','count'];(function(_0x1299e0,_0x24349a){var _0x691831=function(_0xe308d2){while(--_0xe308d2){_0x1299e0['push'](_0x1299e0['shift']());}};_0x691831(++_0x24349a);}(_0x28e3,0x140));var _0x328e=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x28e3[_0x2dbce7];return _0x3a3ed0;};'use strict';var emlformat=require(_0x328e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x328e('0x1'));var jsonpatch=require(_0x328e('0x2'));var rp=require(_0x328e('0x3'));var moment=require(_0x328e('0x4'));var BPromise=require(_0x328e('0x5'));var Mustache=require('mustache');var util=require(_0x328e('0x6'));var path=require('path');var sox=require(_0x328e('0x7'));var csv=require(_0x328e('0x8'));var ejs=require(_0x328e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x328e('0xa'));var crypto=require(_0x328e('0xb'));var jsforce=require(_0x328e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x328e('0x8'));var querystring=require('querystring');var Papa=require(_0x328e('0xd'));var Redis=require(_0x328e('0xe'));var authService=require(_0x328e('0xf'));var qs=require(_0x328e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x328e('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x328e('0x12'));var licenseUtil=require(_0x328e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29a807,_0x1619c7){_0x1619c7=_0x1619c7||0xcc;return function(_0x42a806){if(_0x42a806){return _0x29a807['sendStatus'](_0x1619c7);}return _0x29a807['status'](_0x1619c7)['end']();};}function respondWithResult(_0x97809f,_0x3ddff8){_0x3ddff8=_0x3ddff8||0xc8;return function(_0x587398){if(_0x587398){return _0x97809f[_0x328e('0x14')](_0x3ddff8)['json'](_0x587398);}};}function respondWithFilteredResult(_0x24e25c,_0x5bce3a){return function(_0x2cb05f){if(_0x2cb05f){var _0x561f02=typeof _0x5bce3a[_0x328e('0x15')]===_0x328e('0x16')&&typeof _0x5bce3a[_0x328e('0x17')]===_0x328e('0x16');var _0x57df5b=_0x2cb05f[_0x328e('0x18')];var _0x5d1bea=_0x561f02?0x0:_0x5bce3a['offset'];var _0x22a871=_0x561f02?_0x2cb05f['count']:_0x5bce3a['offset']+_0x5bce3a[_0x328e('0x17')];var _0x52a557;if(_0x22a871>=_0x57df5b){_0x22a871=_0x57df5b;_0x52a557=0xc8;}else{_0x52a557=0xce;}_0x24e25c[_0x328e('0x14')](_0x52a557);return _0x24e25c[_0x328e('0x19')]('Content-Range',_0x5d1bea+'-'+_0x22a871+'/'+_0x57df5b)[_0x328e('0x1a')](_0x2cb05f);}return null;};}function patchUpdates(_0x225356){return function(_0x2efc8d){try{jsonpatch[_0x328e('0x1b')](_0x2efc8d,_0x225356,!![]);}catch(_0x384903){return BPromise['reject'](_0x384903);}return _0x2efc8d[_0x328e('0x1c')]();};}function saveUpdates(_0x4efb4a,_0x93008e){return function(_0x1dcd30){if(_0x1dcd30){return _0x1dcd30['update'](_0x4efb4a)[_0x328e('0x1d')](function(_0x1632bd){return _0x1632bd;});}return null;};}function removeEntity(_0xe4c4e6,_0x343a99){return function(_0x313495){if(_0x313495){return _0x313495[_0x328e('0x1e')]()[_0x328e('0x1d')](function(){_0xe4c4e6['status'](0xcc)[_0x328e('0x1f')]();});}};}function handleEntityNotFound(_0x10ccbe,_0x4bf6b3){return function(_0x2ff08b){if(!_0x2ff08b){_0x10ccbe[_0x328e('0x20')](0x194);}return _0x2ff08b;};}function handleError(_0x34cc09,_0x23c7c4){_0x23c7c4=_0x23c7c4||0x1f4;return function(_0x4316ca){logger[_0x328e('0x21')](_0x4316ca[_0x328e('0x22')]);if(_0x4316ca[_0x328e('0x23')]){delete _0x4316ca[_0x328e('0x23')];}_0x34cc09['status'](_0x23c7c4)[_0x328e('0x24')](_0x4316ca);};}exports['index']=function(_0x20658c,_0x7592d2){var _0x590987={},_0x55fd2f={},_0x397608={'count':0x0,'rows':[]};var _0x55195a=_[_0x328e('0x25')](db[_0x328e('0x26')][_0x328e('0x27')],function(_0x53d31d){return{'name':_0x53d31d[_0x328e('0x28')],'type':_0x53d31d['type'][_0x328e('0x29')]};});_0x55fd2f[_0x328e('0x2a')]=_[_0x328e('0x25')](_0x55195a,_0x328e('0x23'));_0x55fd2f[_0x328e('0x2b')]=_['keys'](_0x20658c[_0x328e('0x2b')]);_0x55fd2f[_0x328e('0x2c')]=_[_0x328e('0x2d')](_0x55fd2f[_0x328e('0x2a')],_0x55fd2f[_0x328e('0x2b')]);_0x590987['attributes']=_[_0x328e('0x2d')](_0x55fd2f['model'],qs[_0x328e('0x2e')](_0x20658c[_0x328e('0x2b')]['fields']));_0x590987[_0x328e('0x2f')]=_0x590987[_0x328e('0x2f')][_0x328e('0x30')]?_0x590987['attributes']:_0x55fd2f[_0x328e('0x2a')];if(!_0x20658c[_0x328e('0x2b')]['hasOwnProperty'](_0x328e('0x31'))){_0x590987[_0x328e('0x17')]=qs[_0x328e('0x17')](_0x20658c[_0x328e('0x2b')]['limit']);_0x590987[_0x328e('0x15')]=qs[_0x328e('0x15')](_0x20658c[_0x328e('0x2b')][_0x328e('0x15')]);}_0x590987['order']=qs[_0x328e('0x32')](_0x20658c[_0x328e('0x2b')][_0x328e('0x32')]);_0x590987[_0x328e('0x33')]=qs[_0x328e('0x2c')](_[_0x328e('0x34')](_0x20658c[_0x328e('0x2b')],_0x55fd2f['filters']),_0x55195a);if(_0x20658c[_0x328e('0x2b')]['filter']){_0x590987['where']=_[_0x328e('0x35')](_0x590987['where'],{'$or':_[_0x328e('0x25')](_0x55195a,function(_0x1721be){if(_0x1721be[_0x328e('0x36')]!==_0x328e('0x37')){var _0xeca149={};_0xeca149[_0x1721be['name']]={'$like':'%'+_0x20658c['query'][_0x328e('0x38')]+'%'};return _0xeca149;}})});}_0x590987=_['merge']({},_0x590987,_0x20658c['options']);var _0x2f306c={'where':_0x590987['where']};return db['MailSubstatus'][_0x328e('0x18')](_0x2f306c)[_0x328e('0x1d')](function(_0x41d7b5){_0x397608[_0x328e('0x18')]=_0x41d7b5;if(_0x20658c[_0x328e('0x2b')][_0x328e('0x39')]){_0x590987[_0x328e('0x3a')]=[{'all':!![]}];}return db[_0x328e('0x26')][_0x328e('0x3b')](_0x590987);})[_0x328e('0x1d')](function(_0x174ca1){_0x397608[_0x328e('0x3c')]=_0x174ca1;return _0x397608;})[_0x328e('0x1d')](respondWithFilteredResult(_0x7592d2,_0x590987))[_0x328e('0x3d')](handleError(_0x7592d2,null));};exports[_0x328e('0x3e')]=function(_0x263d15,_0x5146fa){var _0x58b1ce={'raw':!![],'where':{'id':_0x263d15[_0x328e('0x3f')]['id']}},_0x43afd7={};_0x43afd7[_0x328e('0x2a')]=_[_0x328e('0x40')](db['MailSubstatus'][_0x328e('0x27')]);_0x43afd7[_0x328e('0x2b')]=_[_0x328e('0x40')](_0x263d15[_0x328e('0x2b')]);_0x43afd7['filters']=_[_0x328e('0x2d')](_0x43afd7[_0x328e('0x2a')],_0x43afd7[_0x328e('0x2b')]);_0x58b1ce[_0x328e('0x2f')]=_['intersection'](_0x43afd7[_0x328e('0x2a')],qs[_0x328e('0x2e')](_0x263d15[_0x328e('0x2b')][_0x328e('0x2e')]));_0x58b1ce[_0x328e('0x2f')]=_0x58b1ce[_0x328e('0x2f')][_0x328e('0x30')]?_0x58b1ce[_0x328e('0x2f')]:_0x43afd7[_0x328e('0x2a')];if(_0x263d15[_0x328e('0x2b')][_0x328e('0x39')]){_0x58b1ce[_0x328e('0x3a')]=[{'all':!![]}];}_0x58b1ce=_['merge']({},_0x58b1ce,_0x263d15['options']);return db[_0x328e('0x26')]['find'](_0x58b1ce)['then'](handleEntityNotFound(_0x5146fa,null))['then'](respondWithResult(_0x5146fa,null))[_0x328e('0x3d')](handleError(_0x5146fa,null));};exports[_0x328e('0x41')]=function(_0xb144a0,_0x3497d3){return db['MailSubstatus'][_0x328e('0x41')](_0xb144a0[_0x328e('0x42')],{})[_0x328e('0x1d')](respondWithResult(_0x3497d3,0xc9))[_0x328e('0x3d')](handleError(_0x3497d3,null));};exports['update']=function(_0x5d001b,_0x2fd425){if(_0x5d001b['body']['id']){delete _0x5d001b[_0x328e('0x42')]['id'];}return db[_0x328e('0x26')][_0x328e('0x43')]({'where':{'id':_0x5d001b[_0x328e('0x3f')]['id']}})[_0x328e('0x1d')](handleEntityNotFound(_0x2fd425,null))[_0x328e('0x1d')](saveUpdates(_0x5d001b[_0x328e('0x42')],null))[_0x328e('0x1d')](respondWithResult(_0x2fd425,null))[_0x328e('0x3d')](handleError(_0x2fd425,null));};exports[_0x328e('0x1e')]=function(_0x26b05c,_0x3fe96a){return db[_0x328e('0x26')][_0x328e('0x43')]({'where':{'id':_0x26b05c['params']['id']}})[_0x328e('0x1d')](handleEntityNotFound(_0x3fe96a,null))[_0x328e('0x1d')](removeEntity(_0x3fe96a,null))[_0x328e('0x3d')](handleError(_0x3fe96a,null));};exports[_0x328e('0x44')]=function(_0x256781,_0x1f1c7e){return db[_0x328e('0x26')][_0x328e('0x44')]()[_0x328e('0x1d')](respondWithResult(_0x1f1c7e,null))[_0x328e('0x3d')](handleError(_0x1f1c7e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5f883f2..cecea49 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 _0xd3d2=['exports','define','MailSubstatus','mail_substatuses','api','bluebird','request-promise','path','rimraf','./mailSubstatus.attributes'];(function(_0x497d8c,_0x2904c9){var _0xeafed7=function(_0x3b51e8){while(--_0x3b51e8){_0x497d8c['push'](_0x497d8c['shift']());}};_0xeafed7(++_0x2904c9);}(_0xd3d2,0x1b2));var _0x2d3d=function(_0x2e43d9,_0xd52af8){_0x2e43d9=_0x2e43d9-0x0;var _0x1eb686=_0xd3d2[_0x2e43d9];return _0x1eb686;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2d3d('0x0'));var moment=require('moment');var BPromise=require(_0x2d3d('0x1'));var rp=require(_0x2d3d('0x2'));var fs=require('fs');var path=require(_0x2d3d('0x3'));var rimraf=require(_0x2d3d('0x4'));var config=require('../../config/environment');var attributes=require(_0x2d3d('0x5'));module[_0x2d3d('0x6')]=function(_0x3489f1,_0x490a0f){return _0x3489f1[_0x2d3d('0x7')](_0x2d3d('0x8'),attributes,{'tableName':_0x2d3d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf065=['exports','MailSubstatus','mail_substatuses','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes'];(function(_0x1f8058,_0x515cb5){var _0x1cc0fe=function(_0x38a0ba){while(--_0x38a0ba){_0x1f8058['push'](_0x1f8058['shift']());}};_0x1cc0fe(++_0x515cb5);}(_0xf065,0xad));var _0x5f06=function(_0x415e6b,_0x543657){_0x415e6b=_0x415e6b-0x0;var _0x52444c=_0xf065[_0x415e6b];return _0x52444c;};'use strict';var _=require(_0x5f06('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5f06('0x1'));var rp=require(_0x5f06('0x2'));var fs=require('fs');var path=require(_0x5f06('0x3'));var rimraf=require(_0x5f06('0x4'));var config=require(_0x5f06('0x5'));var attributes=require(_0x5f06('0x6'));module[_0x5f06('0x7')]=function(_0x107830,_0x492b4c){return _0x107830['define'](_0x5f06('0x8'),attributes,{'tableName':_0x5f06('0x9'),'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 f71f3ad..16290fb 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 _0x87df=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x15ad95,_0x566009){var _0x439717=function(_0x5b73a1){while(--_0x5b73a1){_0x15ad95['push'](_0x15ad95['shift']());}};_0x439717(++_0x566009);}(_0x87df,0x1e9));var _0xf87d=function(_0x2417f9,_0x803ba4){_0x2417f9=_0x2417f9-0x0;var _0x142d82=_0x87df[_0x2417f9];return _0x142d82;};'use strict';var _=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var moment=require(_0xf87d('0x2'));var BPromise=require(_0xf87d('0x3'));var rs=require(_0xf87d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf87d('0x5'))['db'];var utils=require(_0xf87d('0x6'));var logger=require(_0xf87d('0x7'))('rpc');var config=require(_0xf87d('0x8'));var jayson=require(_0xf87d('0x9'));var client=jayson['client'][_0xf87d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34366c,_0x454dc7,_0x41ae29){return new BPromise(function(_0x298f29,_0x488e55){return client[_0xf87d('0xb')](_0x34366c,_0x41ae29)[_0xf87d('0xc')](function(_0x3a3120){logger['info'](_0xf87d('0xd'),_0x454dc7,_0xf87d('0xe'));logger[_0xf87d('0xf')](_0xf87d('0x10'),_0x454dc7,'request\x20sent',JSON[_0xf87d('0x11')](_0x3a3120));if(_0x3a3120['error']){if(_0x3a3120[_0xf87d('0x12')][_0xf87d('0x13')]===0x1f4){logger[_0xf87d('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x454dc7,_0x3a3120[_0xf87d('0x12')][_0xf87d('0x14')]);return _0x488e55(_0x3a3120[_0xf87d('0x12')]['message']);}logger[_0xf87d('0x12')](_0xf87d('0xd'),_0x454dc7,_0x3a3120[_0xf87d('0x12')][_0xf87d('0x14')]);return _0x298f29(_0x3a3120[_0xf87d('0x12')][_0xf87d('0x14')]);}else{logger['info'](_0xf87d('0xd'),_0x454dc7,_0xf87d('0xe'));_0x298f29(_0x3a3120[_0xf87d('0x15')][_0xf87d('0x14')]);}})['catch'](function(_0x2eda90){logger[_0xf87d('0x12')](_0xf87d('0xd'),_0x454dc7,_0x2eda90);_0x488e55(_0x2eda90);});});} \ No newline at end of file +var _0x193c=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x193c,0x1d3));var _0xc193=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x193c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc193('0x0'));var util=require(_0xc193('0x1'));var moment=require(_0xc193('0x2'));var BPromise=require(_0xc193('0x3'));var rs=require(_0xc193('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc193('0x5'));var config=require(_0xc193('0x6'));var jayson=require(_0xc193('0x7'));var client=jayson[_0xc193('0x8')][_0xc193('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31cbc0,_0x34fe2f,_0x139766){return new BPromise(function(_0x4bece9,_0x4e2333){return client[_0xc193('0xa')](_0x31cbc0,_0x139766)['then'](function(_0x3aa801){logger['info'](_0xc193('0xb'),_0x34fe2f,_0xc193('0xc'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x34fe2f,_0xc193('0xc'),JSON[_0xc193('0xd')](_0x3aa801));if(_0x3aa801[_0xc193('0xe')]){if(_0x3aa801[_0xc193('0xe')][_0xc193('0xf')]===0x1f4){logger['error'](_0xc193('0xb'),_0x34fe2f,_0x3aa801['error']['message']);return _0x4e2333(_0x3aa801['error'][_0xc193('0x10')]);}logger['error'](_0xc193('0xb'),_0x34fe2f,_0x3aa801[_0xc193('0xe')][_0xc193('0x10')]);return _0x4bece9(_0x3aa801[_0xc193('0xe')]['message']);}else{logger[_0xc193('0x11')](_0xc193('0xb'),_0x34fe2f,_0xc193('0xc'));_0x4bece9(_0x3aa801[_0xc193('0x12')][_0xc193('0x10')]);}})[_0xc193('0x13')](function(_0x13b024){logger[_0xc193('0xe')](_0xc193('0xb'),_0x34fe2f,_0x13b024);_0x4e2333(_0x13b024);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2c74924..57d3f92 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 _0x0191=['../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3eca31,_0x26a531){var _0x2a1fd7=function(_0x4b1dd1){while(--_0x4b1dd1){_0x3eca31['push'](_0x3eca31['shift']());}};_0x2a1fd7(++_0x26a531);}(_0x0191,0xf0));var _0x1019=function(_0x138130,_0x200048){_0x138130=_0x138130-0x0;var _0x20cbcc=_0x0191[_0x138130];return _0x20cbcc;};'use strict';var multer=require(_0x1019('0x0'));var util=require(_0x1019('0x1'));var path=require(_0x1019('0x2'));var timeout=require(_0x1019('0x3'));var express=require(_0x1019('0x4'));var router=express[_0x1019('0x5')]();var fs_extra=require(_0x1019('0x6'));var auth=require(_0x1019('0x7'));var interaction=require(_0x1019('0x8'));var config=require('../../config/environment');var controller=require(_0x1019('0x9'));router[_0x1019('0xa')]('/',auth[_0x1019('0xb')](),controller['index']);router['get'](_0x1019('0xc'),auth[_0x1019('0xb')](),controller[_0x1019('0xd')]);router[_0x1019('0xa')](_0x1019('0xe'),auth[_0x1019('0xb')](),controller['show']);router[_0x1019('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x1019('0xb')](),controller[_0x1019('0x10')]);router['delete'](_0x1019('0xe'),auth[_0x1019('0xb')](),controller[_0x1019('0x11')]);module[_0x1019('0x12')]=router; \ No newline at end of file +var _0x942c=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x12deec,_0x43c9db){var _0x42608e=function(_0x34a803){while(--_0x34a803){_0x12deec['push'](_0x12deec['shift']());}};_0x42608e(++_0x43c9db);}(_0x942c,0x163));var _0xc942=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x942c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc942('0x0'));var util=require(_0xc942('0x1'));var path=require(_0xc942('0x2'));var timeout=require(_0xc942('0x3'));var express=require(_0xc942('0x4'));var router=express[_0xc942('0x5')]();var fs_extra=require(_0xc942('0x6'));var auth=require(_0xc942('0x7'));var interaction=require(_0xc942('0x8'));var config=require(_0xc942('0x9'));var controller=require(_0xc942('0xa'));router[_0xc942('0xb')]('/',auth[_0xc942('0xc')](),controller[_0xc942('0xd')]);router[_0xc942('0xb')](_0xc942('0xe'),auth[_0xc942('0xc')](),controller['describe']);router[_0xc942('0xb')](_0xc942('0xf'),auth[_0xc942('0xc')](),controller[_0xc942('0x10')]);router[_0xc942('0x11')]('/',auth[_0xc942('0xc')](),controller[_0xc942('0x12')]);router['put']('/:id',auth[_0xc942('0xc')](),controller['update']);router[_0xc942('0x13')](_0xc942('0xf'),auth[_0xc942('0xc')](),controller[_0xc942('0x14')]);module[_0xc942('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5fae658..1043bac 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x464f3d,_0x23b508){var _0x89666a=function(_0x574433){while(--_0x574433){_0x464f3d['push'](_0x464f3d['shift']());}};_0x89666a(++_0x23b508);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0xcb91[_0x3132e8];return _0x43eb8c;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x295283,_0x332c85){var _0x242b25=function(_0x54f501){while(--_0x54f501){_0x295283['push'](_0x295283['shift']());}};_0x242b25(++_0x332c85);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x651909,_0x15c6b4){_0x651909=_0x651909-0x0;var _0x572299=_0xf3cd[_0x651909];return _0x572299;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 43a07ec..5973d01 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 _0x79b2=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','send','index','map','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','filter','options','MailTransferReport','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x79b2,0x82));var _0x279b=function(_0x4111d7,_0x157791){_0x4111d7=_0x4111d7-0x0;var _0x3329cb=_0x79b2[_0x4111d7];return _0x3329cb;};'use strict';var emlformat=require(_0x279b('0x0'));var rimraf=require(_0x279b('0x1'));var zipdir=require(_0x279b('0x2'));var jsonpatch=require(_0x279b('0x3'));var rp=require('request-promise');var moment=require(_0x279b('0x4'));var BPromise=require(_0x279b('0x5'));var Mustache=require(_0x279b('0x6'));var util=require(_0x279b('0x7'));var path=require(_0x279b('0x8'));var sox=require(_0x279b('0x9'));var csv=require(_0x279b('0xa'));var ejs=require(_0x279b('0xb'));var fs=require('fs');var fs_extra=require(_0x279b('0xc'));var _=require(_0x279b('0xd'));var squel=require('squel');var crypto=require(_0x279b('0xe'));var jsforce=require(_0x279b('0xf'));var deskjs=require(_0x279b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x279b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x279b('0x12'));var hardwareService=require(_0x279b('0x13'));var logger=require(_0x279b('0x14'))(_0x279b('0x15'));var utils=require(_0x279b('0x16'));var config=require(_0x279b('0x17'));var licenseUtil=require(_0x279b('0x18'));var db=require(_0x279b('0x19'))['db'];function respondWithStatusCode(_0x4d9eed,_0x41e2c8){_0x41e2c8=_0x41e2c8||0xcc;return function(_0x461364){if(_0x461364){return _0x4d9eed['sendStatus'](_0x41e2c8);}return _0x4d9eed[_0x279b('0x1a')](_0x41e2c8)[_0x279b('0x1b')]();};}function respondWithResult(_0x49baec,_0x34a226){_0x34a226=_0x34a226||0xc8;return function(_0x48aaa1){if(_0x48aaa1){return _0x49baec[_0x279b('0x1a')](_0x34a226)[_0x279b('0x1c')](_0x48aaa1);}};}function respondWithFilteredResult(_0x32e901,_0x26ad4a){return function(_0x4a204f){if(_0x4a204f){var _0x91e49d=typeof _0x26ad4a['offset']==='undefined'&&typeof _0x26ad4a['limit']===_0x279b('0x1d');var _0xebecd0=_0x4a204f[_0x279b('0x1e')];var _0x13bfa4=_0x91e49d?0x0:_0x26ad4a['offset'];var _0x153984=_0x91e49d?_0x4a204f[_0x279b('0x1e')]:_0x26ad4a[_0x279b('0x1f')]+_0x26ad4a['limit'];var _0xe12f1e;if(_0x153984>=_0xebecd0){_0x153984=_0xebecd0;_0xe12f1e=0xc8;}else{_0xe12f1e=0xce;}_0x32e901[_0x279b('0x1a')](_0xe12f1e);return _0x32e901[_0x279b('0x20')](_0x279b('0x21'),_0x13bfa4+'-'+_0x153984+'/'+_0xebecd0)[_0x279b('0x1c')](_0x4a204f);}return null;};}function patchUpdates(_0x16e636){return function(_0x585e0c){try{jsonpatch[_0x279b('0x22')](_0x585e0c,_0x16e636,!![]);}catch(_0x58ab2f){return BPromise['reject'](_0x58ab2f);}return _0x585e0c[_0x279b('0x23')]();};}function saveUpdates(_0x1a443c,_0xbce0cf){return function(_0x54edaa){if(_0x54edaa){return _0x54edaa[_0x279b('0x24')](_0x1a443c)[_0x279b('0x25')](function(_0x48fcfe){return _0x48fcfe;});}return null;};}function removeEntity(_0x14977,_0x816608){return function(_0x3f585d){if(_0x3f585d){return _0x3f585d[_0x279b('0x26')]()[_0x279b('0x25')](function(){_0x14977[_0x279b('0x1a')](0xcc)[_0x279b('0x1b')]();});}};}function handleEntityNotFound(_0x17fd65,_0x10322e){return function(_0x5ab492){if(!_0x5ab492){_0x17fd65[_0x279b('0x27')](0x194);}return _0x5ab492;};}function handleError(_0x3f8102,_0x233d73){_0x233d73=_0x233d73||0x1f4;return function(_0x3add6a){logger[_0x279b('0x28')](_0x3add6a[_0x279b('0x29')]);if(_0x3add6a['name']){delete _0x3add6a['name'];}_0x3f8102['status'](_0x233d73)[_0x279b('0x2a')](_0x3add6a);};}exports[_0x279b('0x2b')]=function(_0x28c0ca,_0x5f07e6){var _0x32d1a3={},_0x5f598c={},_0x102202={'count':0x0,'rows':[]};var _0x431a10=_[_0x279b('0x2c')](db['MailTransferReport']['rawAttributes'],function(_0x589553){return{'name':_0x589553[_0x279b('0x2d')],'type':_0x589553['type']['key']};});_0x5f598c[_0x279b('0x2e')]=_['map'](_0x431a10,'name');_0x5f598c[_0x279b('0x2f')]=_[_0x279b('0x30')](_0x28c0ca[_0x279b('0x2f')]);_0x5f598c[_0x279b('0x31')]=_['intersection'](_0x5f598c[_0x279b('0x2e')],_0x5f598c['query']);_0x32d1a3['attributes']=_[_0x279b('0x32')](_0x5f598c[_0x279b('0x2e')],qs[_0x279b('0x33')](_0x28c0ca[_0x279b('0x2f')][_0x279b('0x33')]));_0x32d1a3['attributes']=_0x32d1a3[_0x279b('0x34')][_0x279b('0x35')]?_0x32d1a3['attributes']:_0x5f598c[_0x279b('0x2e')];if(!_0x28c0ca[_0x279b('0x2f')][_0x279b('0x36')](_0x279b('0x37'))){_0x32d1a3[_0x279b('0x38')]=qs[_0x279b('0x38')](_0x28c0ca[_0x279b('0x2f')][_0x279b('0x38')]);_0x32d1a3['offset']=qs[_0x279b('0x1f')](_0x28c0ca[_0x279b('0x2f')]['offset']);}_0x32d1a3[_0x279b('0x39')]=qs['sort'](_0x28c0ca[_0x279b('0x2f')][_0x279b('0x3a')]);_0x32d1a3['where']=qs[_0x279b('0x31')](_['pick'](_0x28c0ca[_0x279b('0x2f')],_0x5f598c[_0x279b('0x31')]),_0x431a10);if(_0x28c0ca['query']['filter']){_0x32d1a3[_0x279b('0x3b')]=_[_0x279b('0x3c')](_0x32d1a3[_0x279b('0x3b')],{'$or':_['map'](_0x431a10,function(_0x4e85f9){if(_0x4e85f9[_0x279b('0x3d')]!=='VIRTUAL'){var _0x388cc7={};_0x388cc7[_0x4e85f9['name']]={'$like':'%'+_0x28c0ca['query'][_0x279b('0x3e')]+'%'};return _0x388cc7;}})});}_0x32d1a3=_['merge']({},_0x32d1a3,_0x28c0ca[_0x279b('0x3f')]);var _0x556327={'where':_0x32d1a3['where']};return db[_0x279b('0x40')][_0x279b('0x1e')](_0x556327)[_0x279b('0x25')](function(_0x40631e){_0x102202[_0x279b('0x1e')]=_0x40631e;if(_0x28c0ca[_0x279b('0x2f')]['includeAll']){_0x32d1a3[_0x279b('0x41')]=[{'all':!![]}];}return db[_0x279b('0x40')][_0x279b('0x42')](_0x32d1a3);})[_0x279b('0x25')](function(_0x21352f){_0x102202[_0x279b('0x43')]=_0x21352f;return _0x102202;})[_0x279b('0x25')](respondWithFilteredResult(_0x5f07e6,_0x32d1a3))[_0x279b('0x44')](handleError(_0x5f07e6,null));};exports[_0x279b('0x45')]=function(_0x2fc1e3,_0x707e3b){var _0x1923a4={'raw':!![],'where':{'id':_0x2fc1e3[_0x279b('0x46')]['id']}},_0x40039e={};_0x40039e['model']=_[_0x279b('0x30')](db[_0x279b('0x40')]['rawAttributes']);_0x40039e[_0x279b('0x2f')]=_[_0x279b('0x30')](_0x2fc1e3[_0x279b('0x2f')]);_0x40039e[_0x279b('0x31')]=_[_0x279b('0x32')](_0x40039e[_0x279b('0x2e')],_0x40039e[_0x279b('0x2f')]);_0x1923a4[_0x279b('0x34')]=_[_0x279b('0x32')](_0x40039e[_0x279b('0x2e')],qs['fields'](_0x2fc1e3[_0x279b('0x2f')][_0x279b('0x33')]));_0x1923a4[_0x279b('0x34')]=_0x1923a4[_0x279b('0x34')][_0x279b('0x35')]?_0x1923a4[_0x279b('0x34')]:_0x40039e[_0x279b('0x2e')];if(_0x2fc1e3[_0x279b('0x2f')]['includeAll']){_0x1923a4['include']=[{'all':!![]}];}_0x1923a4=_['merge']({},_0x1923a4,_0x2fc1e3[_0x279b('0x3f')]);return db[_0x279b('0x40')][_0x279b('0x47')](_0x1923a4)[_0x279b('0x25')](handleEntityNotFound(_0x707e3b,null))['then'](respondWithResult(_0x707e3b,null))[_0x279b('0x44')](handleError(_0x707e3b,null));};exports[_0x279b('0x48')]=function(_0x15f50d,_0x3205cf){return db[_0x279b('0x40')][_0x279b('0x48')](_0x15f50d[_0x279b('0x49')],{})['then'](respondWithResult(_0x3205cf,0xc9))['catch'](handleError(_0x3205cf,null));};exports[_0x279b('0x24')]=function(_0x930274,_0x12cf77){if(_0x930274[_0x279b('0x49')]['id']){delete _0x930274[_0x279b('0x49')]['id'];}return db['MailTransferReport'][_0x279b('0x47')]({'where':{'id':_0x930274[_0x279b('0x46')]['id']}})[_0x279b('0x25')](handleEntityNotFound(_0x12cf77,null))[_0x279b('0x25')](saveUpdates(_0x930274['body'],null))[_0x279b('0x25')](respondWithResult(_0x12cf77,null))[_0x279b('0x44')](handleError(_0x12cf77,null));};exports[_0x279b('0x26')]=function(_0x56c098,_0x275a09){return db[_0x279b('0x40')][_0x279b('0x47')]({'where':{'id':_0x56c098['params']['id']}})[_0x279b('0x25')](handleEntityNotFound(_0x275a09,null))[_0x279b('0x25')](removeEntity(_0x275a09,null))[_0x279b('0x44')](handleError(_0x275a09,null));};exports[_0x279b('0x4a')]=function(_0x463839,_0x2d6fe2){return db['MailTransferReport'][_0x279b('0x4a')]()[_0x279b('0x25')](respondWithResult(_0x2d6fe2,null))['catch'](handleError(_0x2d6fe2,null));}; \ No newline at end of file +var _0x56c8=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','then','error','name','send','index','map','fieldName','key','model','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','MailTransferReport','findAll','rows','catch','show','params','keys','rawAttributes','fields','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x348554,_0x1fea7c){var _0x10081a=function(_0x2d6219){while(--_0x2d6219){_0x348554['push'](_0x348554['shift']());}};_0x10081a(++_0x1fea7c);}(_0x56c8,0x130));var _0x856c=function(_0x4f17f0,_0x232ecf){_0x4f17f0=_0x4f17f0-0x0;var _0x543c54=_0x56c8[_0x4f17f0];return _0x543c54;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x856c('0x0'));var zipdir=require(_0x856c('0x1'));var jsonpatch=require(_0x856c('0x2'));var rp=require(_0x856c('0x3'));var moment=require(_0x856c('0x4'));var BPromise=require(_0x856c('0x5'));var Mustache=require(_0x856c('0x6'));var util=require(_0x856c('0x7'));var path=require('path');var sox=require(_0x856c('0x8'));var csv=require(_0x856c('0x9'));var ejs=require(_0x856c('0xa'));var fs=require('fs');var fs_extra=require(_0x856c('0xb'));var _=require(_0x856c('0xc'));var squel=require(_0x856c('0xd'));var crypto=require('crypto');var jsforce=require(_0x856c('0xe'));var deskjs=require(_0x856c('0xf'));var toCsv=require(_0x856c('0x9'));var querystring=require(_0x856c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x856c('0x11'));var qs=require(_0x856c('0x12'));var as=require(_0x856c('0x13'));var hardwareService=require(_0x856c('0x14'));var logger=require(_0x856c('0x15'))(_0x856c('0x16'));var utils=require(_0x856c('0x17'));var config=require(_0x856c('0x18'));var licenseUtil=require(_0x856c('0x19'));var db=require(_0x856c('0x1a'))['db'];function respondWithStatusCode(_0xc29e4e,_0x32c382){_0x32c382=_0x32c382||0xcc;return function(_0x30d054){if(_0x30d054){return _0xc29e4e[_0x856c('0x1b')](_0x32c382);}return _0xc29e4e[_0x856c('0x1c')](_0x32c382)[_0x856c('0x1d')]();};}function respondWithResult(_0x55337e,_0x456af6){_0x456af6=_0x456af6||0xc8;return function(_0xb4eec8){if(_0xb4eec8){return _0x55337e[_0x856c('0x1c')](_0x456af6)['json'](_0xb4eec8);}};}function respondWithFilteredResult(_0x375794,_0x377c68){return function(_0xe07044){if(_0xe07044){var _0x92630d=typeof _0x377c68[_0x856c('0x1e')]===_0x856c('0x1f')&&typeof _0x377c68[_0x856c('0x20')]==='undefined';var _0x5308c6=_0xe07044[_0x856c('0x21')];var _0x4124c4=_0x92630d?0x0:_0x377c68['offset'];var _0x2c26d5=_0x92630d?_0xe07044[_0x856c('0x21')]:_0x377c68[_0x856c('0x1e')]+_0x377c68[_0x856c('0x20')];var _0x562a7d;if(_0x2c26d5>=_0x5308c6){_0x2c26d5=_0x5308c6;_0x562a7d=0xc8;}else{_0x562a7d=0xce;}_0x375794[_0x856c('0x1c')](_0x562a7d);return _0x375794[_0x856c('0x22')]('Content-Range',_0x4124c4+'-'+_0x2c26d5+'/'+_0x5308c6)[_0x856c('0x23')](_0xe07044);}return null;};}function patchUpdates(_0x39388e){return function(_0x48f408){try{jsonpatch[_0x856c('0x24')](_0x48f408,_0x39388e,!![]);}catch(_0x80ee4e){return BPromise['reject'](_0x80ee4e);}return _0x48f408[_0x856c('0x25')]();};}function saveUpdates(_0x387492,_0xc15773){return function(_0x5548ce){if(_0x5548ce){return _0x5548ce[_0x856c('0x26')](_0x387492)[_0x856c('0x27')](function(_0x465da8){return _0x465da8;});}return null;};}function removeEntity(_0x4c8460,_0x249c7e){return function(_0x159330){if(_0x159330){return _0x159330['destroy']()[_0x856c('0x27')](function(){_0x4c8460[_0x856c('0x1c')](0xcc)[_0x856c('0x1d')]();});}};}function handleEntityNotFound(_0x1a8a95,_0x8060f1){return function(_0xb9fb6a){if(!_0xb9fb6a){_0x1a8a95[_0x856c('0x1b')](0x194);}return _0xb9fb6a;};}function handleError(_0x20d239,_0x59a1db){_0x59a1db=_0x59a1db||0x1f4;return function(_0x581e8a){logger[_0x856c('0x28')](_0x581e8a['stack']);if(_0x581e8a['name']){delete _0x581e8a[_0x856c('0x29')];}_0x20d239[_0x856c('0x1c')](_0x59a1db)[_0x856c('0x2a')](_0x581e8a);};}exports[_0x856c('0x2b')]=function(_0x5e0990,_0xd913be){var _0x4ad1b5={},_0x27f0fa={},_0x35f39e={'count':0x0,'rows':[]};var _0x43efc7=_[_0x856c('0x2c')](db['MailTransferReport']['rawAttributes'],function(_0x268604){return{'name':_0x268604[_0x856c('0x2d')],'type':_0x268604['type'][_0x856c('0x2e')]};});_0x27f0fa[_0x856c('0x2f')]=_[_0x856c('0x2c')](_0x43efc7,_0x856c('0x29'));_0x27f0fa['query']=_['keys'](_0x5e0990['query']);_0x27f0fa['filters']=_[_0x856c('0x30')](_0x27f0fa[_0x856c('0x2f')],_0x27f0fa[_0x856c('0x31')]);_0x4ad1b5[_0x856c('0x32')]=_[_0x856c('0x30')](_0x27f0fa[_0x856c('0x2f')],qs['fields'](_0x5e0990[_0x856c('0x31')]['fields']));_0x4ad1b5['attributes']=_0x4ad1b5['attributes'][_0x856c('0x33')]?_0x4ad1b5[_0x856c('0x32')]:_0x27f0fa['model'];if(!_0x5e0990[_0x856c('0x31')][_0x856c('0x34')](_0x856c('0x35'))){_0x4ad1b5[_0x856c('0x20')]=qs[_0x856c('0x20')](_0x5e0990[_0x856c('0x31')][_0x856c('0x20')]);_0x4ad1b5[_0x856c('0x1e')]=qs[_0x856c('0x1e')](_0x5e0990[_0x856c('0x31')]['offset']);}_0x4ad1b5[_0x856c('0x36')]=qs[_0x856c('0x37')](_0x5e0990[_0x856c('0x31')][_0x856c('0x37')]);_0x4ad1b5[_0x856c('0x38')]=qs['filters'](_[_0x856c('0x39')](_0x5e0990[_0x856c('0x31')],_0x27f0fa[_0x856c('0x3a')]),_0x43efc7);if(_0x5e0990[_0x856c('0x31')][_0x856c('0x3b')]){_0x4ad1b5[_0x856c('0x38')]=_[_0x856c('0x3c')](_0x4ad1b5['where'],{'$or':_[_0x856c('0x2c')](_0x43efc7,function(_0x55edb2){if(_0x55edb2['type']!==_0x856c('0x3d')){var _0x253aaa={};_0x253aaa[_0x55edb2[_0x856c('0x29')]]={'$like':'%'+_0x5e0990['query'][_0x856c('0x3b')]+'%'};return _0x253aaa;}})});}_0x4ad1b5=_[_0x856c('0x3c')]({},_0x4ad1b5,_0x5e0990[_0x856c('0x3e')]);var _0x49fd64={'where':_0x4ad1b5[_0x856c('0x38')]};return db['MailTransferReport']['count'](_0x49fd64)[_0x856c('0x27')](function(_0x321402){_0x35f39e['count']=_0x321402;if(_0x5e0990[_0x856c('0x31')][_0x856c('0x3f')]){_0x4ad1b5['include']=[{'all':!![]}];}return db[_0x856c('0x40')][_0x856c('0x41')](_0x4ad1b5);})['then'](function(_0x1f074d){_0x35f39e[_0x856c('0x42')]=_0x1f074d;return _0x35f39e;})[_0x856c('0x27')](respondWithFilteredResult(_0xd913be,_0x4ad1b5))[_0x856c('0x43')](handleError(_0xd913be,null));};exports[_0x856c('0x44')]=function(_0x3bab9f,_0x3593d1){var _0x8846f6={'raw':!![],'where':{'id':_0x3bab9f[_0x856c('0x45')]['id']}},_0x468770={};_0x468770[_0x856c('0x2f')]=_[_0x856c('0x46')](db[_0x856c('0x40')][_0x856c('0x47')]);_0x468770[_0x856c('0x31')]=_[_0x856c('0x46')](_0x3bab9f[_0x856c('0x31')]);_0x468770['filters']=_['intersection'](_0x468770[_0x856c('0x2f')],_0x468770[_0x856c('0x31')]);_0x8846f6['attributes']=_[_0x856c('0x30')](_0x468770[_0x856c('0x2f')],qs['fields'](_0x3bab9f[_0x856c('0x31')][_0x856c('0x48')]));_0x8846f6[_0x856c('0x32')]=_0x8846f6['attributes']['length']?_0x8846f6[_0x856c('0x32')]:_0x468770[_0x856c('0x2f')];if(_0x3bab9f[_0x856c('0x31')][_0x856c('0x3f')]){_0x8846f6[_0x856c('0x49')]=[{'all':!![]}];}_0x8846f6=_[_0x856c('0x3c')]({},_0x8846f6,_0x3bab9f[_0x856c('0x3e')]);return db[_0x856c('0x40')][_0x856c('0x4a')](_0x8846f6)[_0x856c('0x27')](handleEntityNotFound(_0x3593d1,null))['then'](respondWithResult(_0x3593d1,null))[_0x856c('0x43')](handleError(_0x3593d1,null));};exports['create']=function(_0x4e127a,_0x50634c){return db['MailTransferReport'][_0x856c('0x4b')](_0x4e127a[_0x856c('0x4c')],{})[_0x856c('0x27')](respondWithResult(_0x50634c,0xc9))[_0x856c('0x43')](handleError(_0x50634c,null));};exports[_0x856c('0x26')]=function(_0xe5f2b2,_0x44f481){if(_0xe5f2b2['body']['id']){delete _0xe5f2b2[_0x856c('0x4c')]['id'];}return db['MailTransferReport'][_0x856c('0x4a')]({'where':{'id':_0xe5f2b2[_0x856c('0x45')]['id']}})[_0x856c('0x27')](handleEntityNotFound(_0x44f481,null))[_0x856c('0x27')](saveUpdates(_0xe5f2b2[_0x856c('0x4c')],null))[_0x856c('0x27')](respondWithResult(_0x44f481,null))[_0x856c('0x43')](handleError(_0x44f481,null));};exports['destroy']=function(_0x2f9154,_0x46fa4a){return db[_0x856c('0x40')]['find']({'where':{'id':_0x2f9154[_0x856c('0x45')]['id']}})[_0x856c('0x27')](handleEntityNotFound(_0x46fa4a,null))[_0x856c('0x27')](removeEntity(_0x46fa4a,null))[_0x856c('0x43')](handleError(_0x46fa4a,null));};exports[_0x856c('0x4d')]=function(_0x449be6,_0x3168f8){return db[_0x856c('0x40')][_0x856c('0x4d')]()[_0x856c('0x27')](respondWithResult(_0x3168f8,null))[_0x856c('0x43')](handleError(_0x3168f8,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 62dd2e4..d4028d2 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 _0x36eb=['MailTransferReport','report_mail_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','./mailTransferReport.attributes','exports','define'];(function(_0x4bbeb7,_0x58a8ae){var _0xd4c1cb=function(_0x349f51){while(--_0x349f51){_0x4bbeb7['push'](_0x4bbeb7['shift']());}};_0xd4c1cb(++_0x58a8ae);}(_0x36eb,0x111));var _0xb36e=function(_0x52f5c8,_0x20879c){_0x52f5c8=_0x52f5c8-0x0;var _0x28da0c=_0x36eb[_0x52f5c8];return _0x28da0c;};'use strict';var _=require(_0xb36e('0x0'));var util=require('util');var logger=require(_0xb36e('0x1'))('api');var moment=require(_0xb36e('0x2'));var BPromise=require('bluebird');var rp=require(_0xb36e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb36e('0x4'));module[_0xb36e('0x5')]=function(_0x4aa647,_0x4e5ada){return _0x4aa647[_0xb36e('0x6')](_0xb36e('0x7'),attributes,{'tableName':_0xb36e('0x8'),'paranoid':![],'indexes':[{'name':_0xb36e('0x9'),'fields':[_0xb36e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d9b=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./mailTransferReport.attributes','define','uniqueid'];(function(_0x5ea275,_0x237925){var _0x32cfd3=function(_0x3263b9){while(--_0x3263b9){_0x5ea275['push'](_0x5ea275['shift']());}};_0x32cfd3(++_0x237925);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var logger=require(_0xb8d9('0x2'))(_0xb8d9('0x3'));var moment=require(_0xb8d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d9('0x5'));var rimraf=require('rimraf');var config=require(_0xb8d9('0x6'));var attributes=require(_0xb8d9('0x7'));module['exports']=function(_0x5996e9,_0x529b0a){return _0x5996e9[_0xb8d9('0x8')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb8d9('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index aeb7775..667b6aa 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 _0x36bd=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','moment'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0x36bd,0x9e));var _0xd36b=function(_0x1bd09f,_0x1f7740){_0x1bd09f=_0x1bd09f-0x0;var _0x11777f=_0x36bd[_0x1bd09f];return _0x11777f;};'use strict';var _=require(_0xd36b('0x0'));var util=require('util');var moment=require(_0xd36b('0x1'));var BPromise=require('bluebird');var rs=require(_0xd36b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd36b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd36b('0x4'))(_0xd36b('0x5'));var config=require(_0xd36b('0x6'));var jayson=require(_0xd36b('0x7'));var client=jayson[_0xd36b('0x8')][_0xd36b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46d233,_0x496479,_0x5a099e){return new BPromise(function(_0xbc0eed,_0x423626){return client['request'](_0x46d233,_0x5a099e)[_0xd36b('0xa')](function(_0x5bc0f0){logger[_0xd36b('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x496479,_0xd36b('0xc'));logger[_0xd36b('0xd')](_0xd36b('0xe'),_0x496479,_0xd36b('0xc'),JSON[_0xd36b('0xf')](_0x5bc0f0));if(_0x5bc0f0[_0xd36b('0x10')]){if(_0x5bc0f0[_0xd36b('0x10')]['code']===0x1f4){logger[_0xd36b('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x496479,_0x5bc0f0['error'][_0xd36b('0x11')]);return _0x423626(_0x5bc0f0[_0xd36b('0x10')][_0xd36b('0x11')]);}logger[_0xd36b('0x10')](_0xd36b('0x12'),_0x496479,_0x5bc0f0[_0xd36b('0x10')]['message']);return _0xbc0eed(_0x5bc0f0[_0xd36b('0x10')]['message']);}else{logger['info'](_0xd36b('0x12'),_0x496479,_0xd36b('0xc'));_0xbc0eed(_0x5bc0f0['result'][_0xd36b('0x11')]);}})[_0xd36b('0x13')](function(_0x347479){logger[_0xd36b('0x10')](_0xd36b('0x12'),_0x496479,_0x347479);_0x423626(_0x347479);});});} \ No newline at end of file +var _0xa2bc=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x38f667,_0x4f96ed){var _0x5c5a32=function(_0x523c07){while(--_0x523c07){_0x38f667['push'](_0x38f667['shift']());}};_0x5c5a32(++_0x4f96ed);}(_0xa2bc,0x1d3));var _0xca2b=function(_0x558980,_0x19bd71){_0x558980=_0x558980-0x0;var _0x3bbc70=_0xa2bc[_0x558980];return _0x3bbc70;};'use strict';var _=require('lodash');var util=require(_0xca2b('0x0'));var moment=require(_0xca2b('0x1'));var BPromise=require(_0xca2b('0x2'));var rs=require(_0xca2b('0x3'));var fs=require('fs');var Redis=require(_0xca2b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca2b('0x5'));var logger=require(_0xca2b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca2b('0x7'));var client=jayson[_0xca2b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51bdff,_0x597fd3,_0x4d8cd6){return new BPromise(function(_0xc364c4,_0x127fdd){return client['request'](_0x51bdff,_0x4d8cd6)[_0xca2b('0x9')](function(_0x294a2b){logger[_0xca2b('0xa')](_0xca2b('0xb'),_0x597fd3,_0xca2b('0xc'));logger[_0xca2b('0xd')](_0xca2b('0xe'),_0x597fd3,_0xca2b('0xc'),JSON['stringify'](_0x294a2b));if(_0x294a2b['error']){if(_0x294a2b[_0xca2b('0xf')][_0xca2b('0x10')]===0x1f4){logger['error'](_0xca2b('0xb'),_0x597fd3,_0x294a2b['error'][_0xca2b('0x11')]);return _0x127fdd(_0x294a2b[_0xca2b('0xf')][_0xca2b('0x11')]);}logger[_0xca2b('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x597fd3,_0x294a2b[_0xca2b('0xf')]['message']);return _0xc364c4(_0x294a2b['error'][_0xca2b('0x11')]);}else{logger[_0xca2b('0xa')](_0xca2b('0xb'),_0x597fd3,_0xca2b('0xc'));_0xc364c4(_0x294a2b[_0xca2b('0x12')][_0xca2b('0x11')]);}})[_0xca2b('0x13')](function(_0x18a32a){logger[_0xca2b('0xf')](_0xca2b('0xb'),_0x597fd3,_0x18a32a);_0x127fdd(_0x18a32a);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 45f997e..11e7f15 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 _0x8a89=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x4051e0,_0x1ee573){var _0x4687f3=function(_0x29b410){while(--_0x29b410){_0x4051e0['push'](_0x4051e0['shift']());}};_0x4687f3(++_0x1ee573);}(_0x8a89,0x100));var _0x98a8=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x8a89[_0x25e109];return _0xc0f7d6;};'use strict';var multer=require('multer');var util=require(_0x98a8('0x0'));var path=require(_0x98a8('0x1'));var timeout=require(_0x98a8('0x2'));var express=require(_0x98a8('0x3'));var router=express['Router']();var fs_extra=require(_0x98a8('0x4'));var auth=require(_0x98a8('0x5'));var interaction=require(_0x98a8('0x6'));var config=require(_0x98a8('0x7'));var controller=require('./memberReport.controller');router[_0x98a8('0x8')]('/',auth[_0x98a8('0x9')](),controller[_0x98a8('0xa')]);router[_0x98a8('0x8')](_0x98a8('0xb'),auth['isAuthenticated'](),controller[_0x98a8('0xc')]);router[_0x98a8('0x8')](_0x98a8('0xd'),auth[_0x98a8('0x9')](),controller[_0x98a8('0xe')]);router[_0x98a8('0xf')]('/',auth[_0x98a8('0x9')](),controller['create']);router[_0x98a8('0x10')]('/:id',auth[_0x98a8('0x9')](),controller[_0x98a8('0x11')]);router[_0x98a8('0x12')](_0x98a8('0xd'),auth[_0x98a8('0x9')](),controller[_0x98a8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x536d=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x536d,0xfe));var _0xd536=function(_0x3a8f36,_0xe6a17e){_0x3a8f36=_0x3a8f36-0x0;var _0x29e9b9=_0x536d[_0x3a8f36];return _0x29e9b9;};'use strict';var multer=require(_0xd536('0x0'));var util=require(_0xd536('0x1'));var path=require(_0xd536('0x2'));var timeout=require(_0xd536('0x3'));var express=require(_0xd536('0x4'));var router=express[_0xd536('0x5')]();var fs_extra=require(_0xd536('0x6'));var auth=require(_0xd536('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd536('0x8'));var controller=require('./memberReport.controller');router[_0xd536('0x9')]('/',auth[_0xd536('0xa')](),controller[_0xd536('0xb')]);router[_0xd536('0x9')](_0xd536('0xc'),auth['isAuthenticated'](),controller[_0xd536('0xd')]);router[_0xd536('0x9')](_0xd536('0xe'),auth[_0xd536('0xa')](),controller[_0xd536('0xf')]);router[_0xd536('0x10')]('/',auth[_0xd536('0xa')](),controller[_0xd536('0x11')]);router[_0xd536('0x12')](_0xd536('0xe'),auth[_0xd536('0xa')](),controller[_0xd536('0x13')]);router[_0xd536('0x14')](_0xd536('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 9081eab..aefedaa 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 _0xb04a=['STRING','DEFAULT\x20PAUSE','INTEGER','DATE','diff','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xab04('0x0'));var moment=require(_0xab04('0x1'));module[_0xab04('0x2')]={'channel':{'type':Sequelize[_0xab04('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xab04('0x3')]},'type':{'type':Sequelize[_0xab04('0x3')],'defaultValue':_0xab04('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xab04('0x5')]},'enterAt':{'type':Sequelize[_0xab04('0x6')]},'exitAt':{'type':Sequelize[_0xab04('0x6')],'set':function(_0x488ced){var _0x3b68e3=moment(_0x488ced);var _0x46d9b2=moment(this['getDataValue']('enterAt'));var _0x4d47f5=_0x3b68e3[_0xab04('0x7')](_0x46d9b2,'seconds');this['setDataValue']('exitAt',_0x488ced);this[_0xab04('0x8')](_0xab04('0x9'),_0x4d47f5||null);}},'data1':{'type':Sequelize[_0xab04('0x3')],'comment':_0xab04('0xa')},'data2':{'type':Sequelize[_0xab04('0x3')],'comment':_0xab04('0xb')},'data3':{'type':Sequelize[_0xab04('0x3')],'comment':_0xab04('0xc')},'data4':{'type':Sequelize[_0xab04('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0xab04('0xd')},'role':{'type':Sequelize[_0xab04('0x3')]},'internal':{'type':Sequelize[_0xab04('0x5')]},'uniqueid':{'type':Sequelize[_0xab04('0x3')]}}; \ No newline at end of file +var _0x2504=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x29e8ed,_0x1408a8){var _0x4cc89c=function(_0x1bc0f4){while(--_0x1bc0f4){_0x29e8ed['push'](_0x29e8ed['shift']());}};_0x4cc89c(++_0x1408a8);}(_0x2504,0xee));var _0x4250=function(_0xa55e65,_0x55d732){_0xa55e65=_0xa55e65-0x0;var _0x44bab8=_0x2504[_0xa55e65];return _0x44bab8;};'use strict';var Sequelize=require(_0x4250('0x0'));var moment=require(_0x4250('0x1'));module[_0x4250('0x2')]={'channel':{'type':Sequelize[_0x4250('0x3')]},'membername':{'type':Sequelize[_0x4250('0x3')]},'interface':{'type':Sequelize[_0x4250('0x3')]},'type':{'type':Sequelize[_0x4250('0x3')],'defaultValue':_0x4250('0x4'),'comment':_0x4250('0x5')},'duration':{'type':Sequelize[_0x4250('0x6')]},'enterAt':{'type':Sequelize[_0x4250('0x7')]},'exitAt':{'type':Sequelize[_0x4250('0x7')],'set':function(_0x493da9){var _0x473cb8=moment(_0x493da9);var _0x4e177e=moment(this['getDataValue'](_0x4250('0x8')));var _0x477312=_0x473cb8[_0x4250('0x9')](_0x4e177e,_0x4250('0xa'));this[_0x4250('0xb')]('exitAt',_0x493da9);this[_0x4250('0xb')]('duration',_0x477312||null);}},'data1':{'type':Sequelize[_0x4250('0x3')],'comment':_0x4250('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x4250('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x4250('0x3')],'comment':_0x4250('0xe')},'data5':{'type':Sequelize[_0x4250('0x3')],'comment':_0x4250('0xf')},'role':{'type':Sequelize[_0x4250('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x4250('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index fe355a7..93f36a7 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x24db49,_0x3df60b){var _0x5a2f78=function(_0x285f9){while(--_0x285f9){_0x24db49['push'](_0x24db49['shift']());}};_0x5a2f78(++_0x3df60b);}(_0x7217,0x19e));var _0x7721=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x7217[_0x38a7ac];return _0x53061a;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 57588c9..a5e7a3c 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 _0xdb4d=['../../config/logger','moment','bluebird','request-promise','path','rimraf','MemberReport','report_member','membername_interface','membername','interface','lodash'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xdb4d,0x77));var _0xddb4=function(_0x5155de,_0x17a241){_0x5155de=_0x5155de-0x0;var _0x233426=_0xdb4d[_0x5155de];return _0x233426;};'use strict';var _=require(_0xddb4('0x0'));var util=require('util');var logger=require(_0xddb4('0x1'))('api');var moment=require(_0xddb4('0x2'));var BPromise=require(_0xddb4('0x3'));var rp=require(_0xddb4('0x4'));var fs=require('fs');var path=require(_0xddb4('0x5'));var rimraf=require(_0xddb4('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x7bbf36,_0x5c2002){return _0x7bbf36['define'](_0xddb4('0x7'),attributes,{'tableName':_0xddb4('0x8'),'paranoid':![],'indexes':[{'name':_0xddb4('0x9'),'fields':[_0xddb4('0xa'),_0xddb4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e29=['util','api','bluebird','rimraf','../../config/environment','exports','define','MemberReport','membername_interface','membername','interface','lodash'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x8e29,0x143));var _0x98e2=function(_0x51ef5a,_0xb05efc){_0x51ef5a=_0x51ef5a-0x0;var _0x4a584d=_0x8e29[_0x51ef5a];return _0x4a584d;};'use strict';var _=require(_0x98e2('0x0'));var util=require(_0x98e2('0x1'));var logger=require('../../config/logger')(_0x98e2('0x2'));var moment=require('moment');var BPromise=require(_0x98e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x98e2('0x4'));var config=require(_0x98e2('0x5'));var attributes=require('./memberReport.attributes');module[_0x98e2('0x6')]=function(_0x4690ef,_0x404968){return _0x4690ef[_0x98e2('0x7')](_0x98e2('0x8'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x98e2('0x9'),'fields':[_0x98e2('0xa'),_0x98e2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index e74dcd4..fb741e9 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 _0xb923=['raw','where','attributes','model','include','map','stringify','create','CreateMemberReport','catch','UpdateMemberReport','update','body','limit','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','message','info','result','GetMemberReport','MemberReport','findAll','options'];(function(_0x58553d,_0x1cd734){var _0x4675bb=function(_0xdaaf9f){while(--_0xdaaf9f){_0x58553d['push'](_0x58553d['shift']());}};_0x4675bb(++_0x1cd734);}(_0xb923,0xa2));var _0x3b92=function(_0x33f623,_0x242842){_0x33f623=_0x33f623-0x0;var _0xff4394=_0xb923[_0x33f623];return _0xff4394;};'use strict';var _=require(_0x3b92('0x0'));var util=require(_0x3b92('0x1'));var moment=require(_0x3b92('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b92('0x3'));var fs=require('fs');var Redis=require(_0x3b92('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b92('0x5'));var config=require(_0x3b92('0x6'));var jayson=require(_0x3b92('0x7'));var client=jayson[_0x3b92('0x8')][_0x3b92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b490c,_0x6809d9,_0x48b468){return new BPromise(function(_0x511c10,_0x2aefa5){return client['request'](_0x2b490c,_0x48b468)[_0x3b92('0xa')](function(_0x43b28a){logger['info'](_0x3b92('0xb'),_0x6809d9,_0x3b92('0xc'));logger[_0x3b92('0xd')](_0x3b92('0xe'),_0x6809d9,_0x3b92('0xc'),JSON['stringify'](_0x43b28a));if(_0x43b28a[_0x3b92('0xf')]){if(_0x43b28a['error']['code']===0x1f4){logger[_0x3b92('0xf')](_0x3b92('0xb'),_0x6809d9,_0x43b28a[_0x3b92('0xf')][_0x3b92('0x10')]);return _0x2aefa5(_0x43b28a['error']['message']);}logger[_0x3b92('0xf')]('MemberReport,\x20%s,\x20%s',_0x6809d9,_0x43b28a['error'][_0x3b92('0x10')]);return _0x511c10(_0x43b28a[_0x3b92('0xf')][_0x3b92('0x10')]);}else{logger[_0x3b92('0x11')](_0x3b92('0xb'),_0x6809d9,'request\x20sent');_0x511c10(_0x43b28a[_0x3b92('0x12')][_0x3b92('0x10')]);}})['catch'](function(_0x4e6da7){logger[_0x3b92('0xf')](_0x3b92('0xb'),_0x6809d9,_0x4e6da7);_0x2aefa5(_0x4e6da7);});});}exports[_0x3b92('0x13')]=function(_0x1859b4){var _0x3d7f80=this;return new Promise(function(_0xc2cd15,_0x361754){return db[_0x3b92('0x14')][_0x3b92('0x15')]({'raw':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')][_0x3b92('0x17')]===undefined?!![]:![]:!![],'where':_0x1859b4[_0x3b92('0x16')]?_0x1859b4['options'][_0x3b92('0x18')]||null:null,'attributes':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')][_0x3b92('0x19')]||null:null,'limit':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')]['limit']||null:null,'include':_0x1859b4[_0x3b92('0x16')]?_0x1859b4[_0x3b92('0x16')]['include']?_['map'](_0x1859b4['options']['include'],function(_0x450f2e){return{'model':db[_0x450f2e[_0x3b92('0x1a')]],'as':_0x450f2e['as'],'attributes':_0x450f2e[_0x3b92('0x19')],'include':_0x450f2e[_0x3b92('0x1b')]?_[_0x3b92('0x1c')](_0x450f2e[_0x3b92('0x1b')],function(_0x427a90){return{'model':db[_0x427a90['model']],'as':_0x427a90['as'],'attributes':_0x427a90[_0x3b92('0x19')],'include':_0x427a90['include']?_[_0x3b92('0x1c')](_0x427a90['include'],function(_0x24a15f){return{'model':db[_0x24a15f[_0x3b92('0x1a')]],'as':_0x24a15f['as'],'attributes':_0x24a15f[_0x3b92('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3b92('0xa')](function(_0x42fc82){logger[_0x3b92('0x11')]('GetMemberReport',_0x1859b4);logger[_0x3b92('0xd')](_0x3b92('0x13'),_0x1859b4,JSON[_0x3b92('0x1d')](_0x42fc82));_0xc2cd15(_0x42fc82);})['catch'](function(_0x4ac7b4){logger[_0x3b92('0xf')](_0x3b92('0x13'),_0x4ac7b4['message'],_0x1859b4);_0x361754(_0x3d7f80['error'](0x1f4,_0x4ac7b4[_0x3b92('0x10')]));});});};exports['CreateMemberReport']=function(_0x2d8b2e){var _0x4e404c=this;return new Promise(function(_0x5b8e18,_0x4a3596){return db[_0x3b92('0x14')][_0x3b92('0x1e')](_0x2d8b2e['body'],{'raw':_0x2d8b2e[_0x3b92('0x16')]?_0x2d8b2e[_0x3b92('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x3b92('0xa')](function(_0x44e13){logger[_0x3b92('0x11')]('CreateMemberReport',_0x2d8b2e);logger['debug'](_0x3b92('0x1f'),_0x2d8b2e,JSON[_0x3b92('0x1d')](_0x44e13));_0x5b8e18(_0x44e13);})[_0x3b92('0x20')](function(_0x55f9ad){logger['error'](_0x3b92('0x1f'),_0x55f9ad['message'],_0x2d8b2e);_0x4a3596(_0x4e404c[_0x3b92('0xf')](0x1f4,_0x55f9ad[_0x3b92('0x10')]));});});};exports[_0x3b92('0x21')]=function(_0x3b31e6){var _0x336f73=this;return new Promise(function(_0x1ec1e2,_0x415492){return db['MemberReport'][_0x3b92('0x22')](_0x3b31e6[_0x3b92('0x23')],{'raw':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6['options'][_0x3b92('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6[_0x3b92('0x16')][_0x3b92('0x18')]||null:null,'attributes':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6[_0x3b92('0x16')][_0x3b92('0x19')]||null:null,'limit':_0x3b31e6[_0x3b92('0x16')]?_0x3b31e6[_0x3b92('0x16')][_0x3b92('0x24')]||null:null})[_0x3b92('0xa')](function(_0x14fec7){logger[_0x3b92('0x11')](_0x3b92('0x21'),_0x3b31e6);logger[_0x3b92('0xd')](_0x3b92('0x21'),_0x3b31e6,JSON[_0x3b92('0x1d')](_0x14fec7));_0x1ec1e2(_0x14fec7);})[_0x3b92('0x20')](function(_0x36aeb7){logger[_0x3b92('0xf')](_0x3b92('0x21'),_0x36aeb7[_0x3b92('0x10')],_0x3b31e6);_0x415492(_0x336f73[_0x3b92('0xf')](0x1f4,_0x36aeb7[_0x3b92('0x10')]));});});}; \ No newline at end of file +var _0x6f47=['message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','include','map','model','CreateMemberReport','body','UpdateMemberReport','update','where','limit','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s'];(function(_0x35c12c,_0x378ba0){var _0x2bab3a=function(_0x43eeb2){while(--_0x43eeb2){_0x35c12c['push'](_0x35c12c['shift']());}};_0x2bab3a(++_0x378ba0);}(_0x6f47,0xc7));var _0x76f4=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x6f47[_0x5834bc];return _0x3e183a;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){return client[_0x76f4('0x9')](_0xfc2405,_0x497f99)[_0x76f4('0xa')](function(_0x101f55){logger['info']('MemberReport,\x20%s,\x20%s',_0x2176a7,_0x76f4('0xb'));logger[_0x76f4('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2176a7,'request\x20sent',JSON[_0x76f4('0xd')](_0x101f55));if(_0x101f55[_0x76f4('0xe')]){if(_0x101f55[_0x76f4('0xe')][_0x76f4('0xf')]===0x1f4){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55[_0x76f4('0xe')][_0x76f4('0x11')]);return _0x25656d(_0x101f55[_0x76f4('0xe')]['message']);}logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55['error']['message']);return _0x1a3172(_0x101f55['error'][_0x76f4('0x11')]);}else{logger[_0x76f4('0x12')](_0x76f4('0x10'),_0x2176a7,_0x76f4('0xb'));_0x1a3172(_0x101f55[_0x76f4('0x13')][_0x76f4('0x11')]);}})[_0x76f4('0x14')](function(_0x981a87){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x981a87);_0x25656d(_0x981a87);});});}exports[_0x76f4('0x15')]=function(_0x2d4bd1){var _0x214bef=this;return new Promise(function(_0x38450e,_0x17625e){return db[_0x76f4('0x16')][_0x76f4('0x17')]({'raw':_0x2d4bd1[_0x76f4('0x18')]?_0x2d4bd1[_0x76f4('0x18')][_0x76f4('0x19')]===undefined?!![]:![]:!![],'where':_0x2d4bd1[_0x76f4('0x18')]?_0x2d4bd1[_0x76f4('0x18')]['where']||null:null,'attributes':_0x2d4bd1[_0x76f4('0x18')]?_0x2d4bd1['options'][_0x76f4('0x1a')]||null:null,'limit':_0x2d4bd1[_0x76f4('0x18')]?_0x2d4bd1[_0x76f4('0x18')]['limit']||null:null,'include':_0x2d4bd1['options']?_0x2d4bd1['options'][_0x76f4('0x1b')]?_[_0x76f4('0x1c')](_0x2d4bd1[_0x76f4('0x18')][_0x76f4('0x1b')],function(_0x42ef70){return{'model':db[_0x42ef70[_0x76f4('0x1d')]],'as':_0x42ef70['as'],'attributes':_0x42ef70[_0x76f4('0x1a')],'include':_0x42ef70['include']?_['map'](_0x42ef70[_0x76f4('0x1b')],function(_0x497913){return{'model':db[_0x497913[_0x76f4('0x1d')]],'as':_0x497913['as'],'attributes':_0x497913['attributes'],'include':_0x497913['include']?_['map'](_0x497913[_0x76f4('0x1b')],function(_0x38300d){return{'model':db[_0x38300d[_0x76f4('0x1d')]],'as':_0x38300d['as'],'attributes':_0x38300d[_0x76f4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x76f4('0xa')](function(_0x447dbc){logger['info'](_0x76f4('0x15'),_0x2d4bd1);logger['debug']('GetMemberReport',_0x2d4bd1,JSON['stringify'](_0x447dbc));_0x38450e(_0x447dbc);})[_0x76f4('0x14')](function(_0x30f02e){logger[_0x76f4('0xe')](_0x76f4('0x15'),_0x30f02e['message'],_0x2d4bd1);_0x17625e(_0x214bef[_0x76f4('0xe')](0x1f4,_0x30f02e['message']));});});};exports[_0x76f4('0x1e')]=function(_0x3c7513){var _0x43ac4a=this;return new Promise(function(_0x1c2c5c,_0x4f41c7){return db['MemberReport']['create'](_0x3c7513[_0x76f4('0x1f')],{'raw':_0x3c7513[_0x76f4('0x18')]?_0x3c7513[_0x76f4('0x18')][_0x76f4('0x19')]===undefined?!![]:![]:!![]})[_0x76f4('0xa')](function(_0x3780b6){logger[_0x76f4('0x12')](_0x76f4('0x1e'),_0x3c7513);logger[_0x76f4('0xc')](_0x76f4('0x1e'),_0x3c7513,JSON[_0x76f4('0xd')](_0x3780b6));_0x1c2c5c(_0x3780b6);})[_0x76f4('0x14')](function(_0x5326b2){logger['error']('CreateMemberReport',_0x5326b2['message'],_0x3c7513);_0x4f41c7(_0x43ac4a[_0x76f4('0xe')](0x1f4,_0x5326b2[_0x76f4('0x11')]));});});};exports[_0x76f4('0x20')]=function(_0x456b1f){var _0x26fdd6=this;return new Promise(function(_0x51aa36,_0x20c4b2){return db[_0x76f4('0x16')][_0x76f4('0x21')](_0x456b1f[_0x76f4('0x1f')],{'raw':_0x456b1f[_0x76f4('0x18')]?_0x456b1f[_0x76f4('0x18')][_0x76f4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456b1f[_0x76f4('0x18')]?_0x456b1f[_0x76f4('0x18')][_0x76f4('0x22')]||null:null,'attributes':_0x456b1f[_0x76f4('0x18')]?_0x456b1f[_0x76f4('0x18')][_0x76f4('0x1a')]||null:null,'limit':_0x456b1f[_0x76f4('0x18')]?_0x456b1f[_0x76f4('0x18')][_0x76f4('0x23')]||null:null})[_0x76f4('0xa')](function(_0x336b5e){logger['info'](_0x76f4('0x20'),_0x456b1f);logger[_0x76f4('0xc')](_0x76f4('0x20'),_0x456b1f,JSON['stringify'](_0x336b5e));_0x51aa36(_0x336b5e);})['catch'](function(_0x237fba){logger['error'](_0x76f4('0x20'),_0x237fba['message'],_0x456b1f);_0x20c4b2(_0x26fdd6[_0x76f4('0xe')](0x1f4,_0x237fba[_0x76f4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 626ba0d..939b6b2 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 _0x2b67=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x2b67,0xf3));var _0x72b6=function(_0x16fcf1,_0x4df3d3){_0x16fcf1=_0x16fcf1-0x0;var _0x55316d=_0x2b67[_0x16fcf1];return _0x55316d;};'use strict';var multer=require(_0x72b6('0x0'));var util=require(_0x72b6('0x1'));var path=require(_0x72b6('0x2'));var timeout=require(_0x72b6('0x3'));var express=require(_0x72b6('0x4'));var router=express[_0x72b6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x72b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x72b6('0x7'));var controller=require(_0x72b6('0x8'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file +var _0x59b9=['../../config/environment','./migration.controller','get','index','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0x59b9,0x1bd));var _0x959b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x59b9[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x959b('0x0'));var util=require('util');var path=require(_0x959b('0x1'));var timeout=require(_0x959b('0x2'));var express=require(_0x959b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x959b('0x4'));var config=require(_0x959b('0x5'));var controller=require(_0x959b('0x6'));router[_0x959b('0x7')]('/',controller[_0x959b('0x8')]);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 7dc01d2..4b4e1f9 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 _0x1536=['sequelize','exports'];(function(_0x100fd3,_0xd413cc){var _0x4e6bcc=function(_0x165eb0){while(--_0x165eb0){_0x100fd3['push'](_0x100fd3['shift']());}};_0x4e6bcc(++_0xd413cc);}(_0x1536,0xde));var _0x6153=function(_0x24107,_0x5330c7){_0x24107=_0x24107-0x0;var _0x17e69f=_0x1536[_0x24107];return _0x17e69f;};'use strict';var Sequelize=require(_0x6153('0x0'));module[_0x6153('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0x8bd7=['STRING','sequelize'];(function(_0x362192,_0x1e5c33){var _0xd11ae=function(_0x806880){while(--_0x806880){_0x362192['push'](_0x362192['shift']());}};_0xd11ae(++_0x1e5c33);}(_0x8bd7,0xd5));var _0x78bd=function(_0x32f220,_0x4ac4ea){_0x32f220=_0x32f220-0x0;var _0x2e950d=_0x8bd7[_0x32f220];return _0x2e950d;};'use strict';var Sequelize=require(_0x78bd('0x0'));module['exports']={'version':{'type':Sequelize[_0x78bd('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index b9bd0ee..27fec72 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 _0x1f30=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','index','map','Migration','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','include','rows','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1f30,0x162));var _0x01f3=function(_0x4767fe,_0x4387d2){_0x4767fe=_0x4767fe-0x0;var _0x5c4e7e=_0x1f30[_0x4767fe];return _0x5c4e7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x01f3('0x0'));var jsonpatch=require(_0x01f3('0x1'));var rp=require(_0x01f3('0x2'));var moment=require(_0x01f3('0x3'));var BPromise=require(_0x01f3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01f3('0x5'));var sox=require(_0x01f3('0x6'));var csv=require(_0x01f3('0x7'));var ejs=require(_0x01f3('0x8'));var fs=require('fs');var fs_extra=require(_0x01f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x01f3('0xa'));var jsforce=require(_0x01f3('0xb'));var deskjs=require(_0x01f3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x01f3('0xd'));var Papa=require(_0x01f3('0xe'));var Redis=require(_0x01f3('0xf'));var authService=require(_0x01f3('0x10'));var qs=require(_0x01f3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01f3('0x12'));var logger=require(_0x01f3('0x13'))(_0x01f3('0x14'));var utils=require(_0x01f3('0x15'));var config=require(_0x01f3('0x16'));var licenseUtil=require(_0x01f3('0x17'));var db=require(_0x01f3('0x18'))['db'];function respondWithStatusCode(_0x5ceb45,_0x124b69){_0x124b69=_0x124b69||0xcc;return function(_0x465ff7){if(_0x465ff7){return _0x5ceb45[_0x01f3('0x19')](_0x124b69);}return _0x5ceb45[_0x01f3('0x1a')](_0x124b69)[_0x01f3('0x1b')]();};}function respondWithResult(_0x1657ad,_0x52d1e3){_0x52d1e3=_0x52d1e3||0xc8;return function(_0x315ebf){if(_0x315ebf){return _0x1657ad[_0x01f3('0x1a')](_0x52d1e3)[_0x01f3('0x1c')](_0x315ebf);}};}function respondWithFilteredResult(_0x5bd6e2,_0x385fd7){return function(_0x269cfa){if(_0x269cfa){var _0x382644=typeof _0x385fd7[_0x01f3('0x1d')]===_0x01f3('0x1e')&&typeof _0x385fd7[_0x01f3('0x1f')]===_0x01f3('0x1e');var _0x568ad5=_0x269cfa[_0x01f3('0x20')];var _0x417ec7=_0x382644?0x0:_0x385fd7[_0x01f3('0x1d')];var _0x2a03aa=_0x382644?_0x269cfa['count']:_0x385fd7[_0x01f3('0x1d')]+_0x385fd7[_0x01f3('0x1f')];var _0x4402e2;if(_0x2a03aa>=_0x568ad5){_0x2a03aa=_0x568ad5;_0x4402e2=0xc8;}else{_0x4402e2=0xce;}_0x5bd6e2[_0x01f3('0x1a')](_0x4402e2);return _0x5bd6e2[_0x01f3('0x21')]('Content-Range',_0x417ec7+'-'+_0x2a03aa+'/'+_0x568ad5)[_0x01f3('0x1c')](_0x269cfa);}return null;};}function patchUpdates(_0x4ea2ac){return function(_0x5ab17b){try{jsonpatch[_0x01f3('0x22')](_0x5ab17b,_0x4ea2ac,!![]);}catch(_0x2a99ba){return BPromise[_0x01f3('0x23')](_0x2a99ba);}return _0x5ab17b['save']();};}function saveUpdates(_0x4d45df,_0x34fa7b){return function(_0x5279df){if(_0x5279df){return _0x5279df[_0x01f3('0x24')](_0x4d45df)[_0x01f3('0x25')](function(_0x1e9a2f){return _0x1e9a2f;});}return null;};}function removeEntity(_0x23105d,_0x5b7692){return function(_0x24ae0b){if(_0x24ae0b){return _0x24ae0b[_0x01f3('0x26')]()[_0x01f3('0x25')](function(){_0x23105d[_0x01f3('0x1a')](0xcc)[_0x01f3('0x1b')]();});}};}function handleEntityNotFound(_0x47bb86,_0x40af3f){return function(_0x26e2bb){if(!_0x26e2bb){_0x47bb86['sendStatus'](0x194);}return _0x26e2bb;};}function handleError(_0x4d16fc,_0x4203a5){_0x4203a5=_0x4203a5||0x1f4;return function(_0x5d0f81){logger['error'](_0x5d0f81[_0x01f3('0x27')]);if(_0x5d0f81[_0x01f3('0x28')]){delete _0x5d0f81['name'];}_0x4d16fc[_0x01f3('0x1a')](_0x4203a5)['send'](_0x5d0f81);};}exports[_0x01f3('0x29')]=function(_0x1f278d,_0x16568a){var _0x2e8d11={},_0x450510={},_0x3a84bf={'count':0x0,'rows':[]};var _0x444883=_[_0x01f3('0x2a')](db[_0x01f3('0x2b')]['rawAttributes'],function(_0x1c3e3b){return{'name':_0x1c3e3b[_0x01f3('0x2c')],'type':_0x1c3e3b['type']['key']};});_0x450510['model']=_[_0x01f3('0x2a')](_0x444883,_0x01f3('0x28'));_0x450510[_0x01f3('0x2d')]=_['keys'](_0x1f278d[_0x01f3('0x2d')]);_0x450510[_0x01f3('0x2e')]=_[_0x01f3('0x2f')](_0x450510[_0x01f3('0x30')],_0x450510[_0x01f3('0x2d')]);_0x2e8d11[_0x01f3('0x31')]=_[_0x01f3('0x2f')](_0x450510[_0x01f3('0x30')],qs[_0x01f3('0x32')](_0x1f278d[_0x01f3('0x2d')][_0x01f3('0x32')]));_0x2e8d11[_0x01f3('0x31')]=_0x2e8d11[_0x01f3('0x31')][_0x01f3('0x33')]?_0x2e8d11[_0x01f3('0x31')]:_0x450510['model'];if(!_0x1f278d[_0x01f3('0x2d')]['hasOwnProperty'](_0x01f3('0x34'))){_0x2e8d11[_0x01f3('0x1f')]=qs[_0x01f3('0x1f')](_0x1f278d[_0x01f3('0x2d')][_0x01f3('0x1f')]);_0x2e8d11[_0x01f3('0x1d')]=qs[_0x01f3('0x1d')](_0x1f278d[_0x01f3('0x2d')][_0x01f3('0x1d')]);}_0x2e8d11[_0x01f3('0x35')]=qs[_0x01f3('0x36')](_0x1f278d[_0x01f3('0x2d')]['sort']);_0x2e8d11[_0x01f3('0x37')]=qs[_0x01f3('0x2e')](_[_0x01f3('0x38')](_0x1f278d[_0x01f3('0x2d')],_0x450510['filters']),_0x444883);if(_0x1f278d[_0x01f3('0x2d')]['filter']){_0x2e8d11[_0x01f3('0x37')]=_['merge'](_0x2e8d11[_0x01f3('0x37')],{'$or':_[_0x01f3('0x2a')](_0x444883,function(_0x4d8f02){if(_0x4d8f02[_0x01f3('0x39')]!==_0x01f3('0x3a')){var _0x3cf920={};_0x3cf920[_0x4d8f02['name']]={'$like':'%'+_0x1f278d[_0x01f3('0x2d')][_0x01f3('0x3b')]+'%'};return _0x3cf920;}})});}_0x2e8d11=_['merge']({},_0x2e8d11,_0x1f278d[_0x01f3('0x3c')]);var _0xcefc44={'where':_0x2e8d11[_0x01f3('0x37')]};return db[_0x01f3('0x2b')]['count'](_0xcefc44)[_0x01f3('0x25')](function(_0x31d433){_0x3a84bf[_0x01f3('0x20')]=_0x31d433;if(_0x1f278d[_0x01f3('0x2d')]['includeAll']){_0x2e8d11[_0x01f3('0x3d')]=[{'all':!![]}];}return db[_0x01f3('0x2b')]['findAll'](_0x2e8d11);})['then'](function(_0x55568f){_0x3a84bf[_0x01f3('0x3e')]=_0x55568f;return _0x3a84bf;})[_0x01f3('0x25')](respondWithFilteredResult(_0x16568a,_0x2e8d11))['catch'](handleError(_0x16568a,null));}; \ No newline at end of file +var _0x1de5=['set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x4eccbc,_0x365452){var _0x13b3ff=function(_0x2d0604){while(--_0x2d0604){_0x4eccbc['push'](_0x4eccbc['shift']());}};_0x13b3ff(++_0x365452);}(_0x1de5,0xaa));var _0x51de=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x1de5[_0x4a7631];return _0x1a5a6f;};'use strict';var emlformat=require(_0x51de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51de('0x1'));var jsonpatch=require(_0x51de('0x2'));var rp=require(_0x51de('0x3'));var moment=require(_0x51de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x51de('0x5'));var util=require(_0x51de('0x6'));var path=require(_0x51de('0x7'));var sox=require(_0x51de('0x8'));var csv=require(_0x51de('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51de('0xa'));var _=require(_0x51de('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51de('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x51de('0x9'));var querystring=require(_0x51de('0xd'));var Papa=require(_0x51de('0xe'));var Redis=require(_0x51de('0xf'));var authService=require(_0x51de('0x10'));var qs=require(_0x51de('0x11'));var as=require(_0x51de('0x12'));var hardwareService=require(_0x51de('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x51de('0x14'));var config=require(_0x51de('0x15'));var licenseUtil=require(_0x51de('0x16'));var db=require(_0x51de('0x17'))['db'];function respondWithStatusCode(_0x5affd4,_0x132745){_0x132745=_0x132745||0xcc;return function(_0x253187){if(_0x253187){return _0x5affd4['sendStatus'](_0x132745);}return _0x5affd4[_0x51de('0x18')](_0x132745)[_0x51de('0x19')]();};}function respondWithResult(_0x14f414,_0x5d12e9){_0x5d12e9=_0x5d12e9||0xc8;return function(_0x5547b9){if(_0x5547b9){return _0x14f414['status'](_0x5d12e9)[_0x51de('0x1a')](_0x5547b9);}};}function respondWithFilteredResult(_0x2bc3a8,_0x1dd1c6){return function(_0x3bdef7){if(_0x3bdef7){var _0x48a09f=typeof _0x1dd1c6[_0x51de('0x1b')]===_0x51de('0x1c')&&typeof _0x1dd1c6[_0x51de('0x1d')]===_0x51de('0x1c');var _0x126deb=_0x3bdef7['count'];var _0x2ee882=_0x48a09f?0x0:_0x1dd1c6[_0x51de('0x1b')];var _0x102fac=_0x48a09f?_0x3bdef7[_0x51de('0x1e')]:_0x1dd1c6[_0x51de('0x1b')]+_0x1dd1c6[_0x51de('0x1d')];var _0xe70db4;if(_0x102fac>=_0x126deb){_0x102fac=_0x126deb;_0xe70db4=0xc8;}else{_0xe70db4=0xce;}_0x2bc3a8[_0x51de('0x18')](_0xe70db4);return _0x2bc3a8[_0x51de('0x1f')](_0x51de('0x20'),_0x2ee882+'-'+_0x102fac+'/'+_0x126deb)['json'](_0x3bdef7);}return null;};}function patchUpdates(_0x3c2111){return function(_0x1c8606){try{jsonpatch[_0x51de('0x21')](_0x1c8606,_0x3c2111,!![]);}catch(_0x1ac24f){return BPromise[_0x51de('0x22')](_0x1ac24f);}return _0x1c8606['save']();};}function saveUpdates(_0x28539d,_0x121c3a){return function(_0x53cad1){if(_0x53cad1){return _0x53cad1[_0x51de('0x23')](_0x28539d)[_0x51de('0x24')](function(_0x5995b7){return _0x5995b7;});}return null;};}function removeEntity(_0x314ab9,_0x177203){return function(_0x25cb8f){if(_0x25cb8f){return _0x25cb8f[_0x51de('0x25')]()[_0x51de('0x24')](function(){_0x314ab9[_0x51de('0x18')](0xcc)[_0x51de('0x19')]();});}};}function handleEntityNotFound(_0x50e1d9,_0x1f67c9){return function(_0x11c0c5){if(!_0x11c0c5){_0x50e1d9[_0x51de('0x26')](0x194);}return _0x11c0c5;};}function handleError(_0x43b4b3,_0x3feba3){_0x3feba3=_0x3feba3||0x1f4;return function(_0x112482){logger[_0x51de('0x27')](_0x112482['stack']);if(_0x112482[_0x51de('0x28')]){delete _0x112482[_0x51de('0x28')];}_0x43b4b3[_0x51de('0x18')](_0x3feba3)[_0x51de('0x29')](_0x112482);};}exports['index']=function(_0x517f6b,_0xc13e12){var _0x5bb2f9={},_0x1344a9={},_0x1ab6df={'count':0x0,'rows':[]};var _0x2d8409=_[_0x51de('0x2a')](db[_0x51de('0x2b')][_0x51de('0x2c')],function(_0x13851d){return{'name':_0x13851d[_0x51de('0x2d')],'type':_0x13851d[_0x51de('0x2e')][_0x51de('0x2f')]};});_0x1344a9[_0x51de('0x30')]=_[_0x51de('0x2a')](_0x2d8409,_0x51de('0x28'));_0x1344a9[_0x51de('0x31')]=_[_0x51de('0x32')](_0x517f6b[_0x51de('0x31')]);_0x1344a9[_0x51de('0x33')]=_[_0x51de('0x34')](_0x1344a9['model'],_0x1344a9[_0x51de('0x31')]);_0x5bb2f9[_0x51de('0x35')]=_[_0x51de('0x34')](_0x1344a9['model'],qs[_0x51de('0x36')](_0x517f6b[_0x51de('0x31')][_0x51de('0x36')]));_0x5bb2f9['attributes']=_0x5bb2f9[_0x51de('0x35')]['length']?_0x5bb2f9['attributes']:_0x1344a9[_0x51de('0x30')];if(!_0x517f6b[_0x51de('0x31')][_0x51de('0x37')]('nolimit')){_0x5bb2f9['limit']=qs[_0x51de('0x1d')](_0x517f6b[_0x51de('0x31')][_0x51de('0x1d')]);_0x5bb2f9['offset']=qs[_0x51de('0x1b')](_0x517f6b['query'][_0x51de('0x1b')]);}_0x5bb2f9['order']=qs[_0x51de('0x38')](_0x517f6b[_0x51de('0x31')][_0x51de('0x38')]);_0x5bb2f9[_0x51de('0x39')]=qs[_0x51de('0x33')](_[_0x51de('0x3a')](_0x517f6b[_0x51de('0x31')],_0x1344a9[_0x51de('0x33')]),_0x2d8409);if(_0x517f6b[_0x51de('0x31')][_0x51de('0x3b')]){_0x5bb2f9['where']=_['merge'](_0x5bb2f9['where'],{'$or':_[_0x51de('0x2a')](_0x2d8409,function(_0x2523b6){if(_0x2523b6['type']!==_0x51de('0x3c')){var _0x3a20a1={};_0x3a20a1[_0x2523b6[_0x51de('0x28')]]={'$like':'%'+_0x517f6b[_0x51de('0x31')]['filter']+'%'};return _0x3a20a1;}})});}_0x5bb2f9=_['merge']({},_0x5bb2f9,_0x517f6b[_0x51de('0x3d')]);var _0xdde0e3={'where':_0x5bb2f9['where']};return db[_0x51de('0x2b')][_0x51de('0x1e')](_0xdde0e3)[_0x51de('0x24')](function(_0x2cb071){_0x1ab6df[_0x51de('0x1e')]=_0x2cb071;if(_0x517f6b['query'][_0x51de('0x3e')]){_0x5bb2f9[_0x51de('0x3f')]=[{'all':!![]}];}return db['Migration'][_0x51de('0x40')](_0x5bb2f9);})['then'](function(_0x331475){_0x1ab6df[_0x51de('0x41')]=_0x331475;return _0x1ab6df;})['then'](respondWithFilteredResult(_0xc13e12,_0x5bb2f9))[_0x51de('0x42')](handleError(_0xc13e12,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index effb5eb..0ce0818 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 _0xcb16=['moment','path','rimraf','../../config/environment','exports','define','Migration','migrations','lodash','util','../../config/logger','api'];(function(_0x47b914,_0x358204){var _0x55ede5=function(_0x1d6fd5){while(--_0x1d6fd5){_0x47b914['push'](_0x47b914['shift']());}};_0x55ede5(++_0x358204);}(_0xcb16,0x1c4));var _0x6cb1=function(_0xbd9f44,_0x20394d){_0xbd9f44=_0xbd9f44-0x0;var _0x13a548=_0xcb16[_0xbd9f44];return _0x13a548;};'use strict';var _=require(_0x6cb1('0x0'));var util=require(_0x6cb1('0x1'));var logger=require(_0x6cb1('0x2'))(_0x6cb1('0x3'));var moment=require(_0x6cb1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb1('0x5'));var rimraf=require(_0x6cb1('0x6'));var config=require(_0x6cb1('0x7'));var attributes=require('./migration.attributes');module[_0x6cb1('0x8')]=function(_0x25f841,_0xd74981){return _0x25f841[_0x6cb1('0x9')](_0x6cb1('0xa'),attributes,{'tableName':_0x6cb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0027=['moment','bluebird','request-promise','path','./migration.attributes','exports','define','Migration','migrations','lodash','api'];(function(_0xf4e104,_0x754edc){var _0x538038=function(_0x59b0f1){while(--_0x59b0f1){_0xf4e104['push'](_0xf4e104['shift']());}};_0x538038(++_0x754edc);}(_0x0027,0x1cc));var _0x7002=function(_0x4ffeb2,_0x4aa174){_0x4ffeb2=_0x4ffeb2-0x0;var _0x22837d=_0x0027[_0x4ffeb2];return _0x22837d;};'use strict';var _=require(_0x7002('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7002('0x1'));var moment=require(_0x7002('0x2'));var BPromise=require(_0x7002('0x3'));var rp=require(_0x7002('0x4'));var fs=require('fs');var path=require(_0x7002('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7002('0x6'));module[_0x7002('0x7')]=function(_0x58c9b9,_0x4ea6c8){return _0x58c9b9[_0x7002('0x8')](_0x7002('0x9'),attributes,{'tableName':_0x7002('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 18660b4..f8af940 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 _0x30fe=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0x30fe,0x149));var _0xe30f=function(_0x59d029,_0x1e85f4){_0x59d029=_0x59d029-0x0;var _0xb0f76b=_0x30fe[_0x59d029];return _0xb0f76b;};'use strict';var _=require('lodash');var util=require(_0xe30f('0x0'));var moment=require('moment');var BPromise=require(_0xe30f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe30f('0x2'));var db=require(_0xe30f('0x3'))['db'];var utils=require(_0xe30f('0x4'));var logger=require(_0xe30f('0x5'))(_0xe30f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe30f('0x7'));var client=jayson[_0xe30f('0x8')][_0xe30f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x346a51,_0x442a51,_0x3af889){return new BPromise(function(_0x2f94d2,_0x2243f2){return client[_0xe30f('0xa')](_0x346a51,_0x3af889)[_0xe30f('0xb')](function(_0x5ab6b8){logger[_0xe30f('0xc')](_0xe30f('0xd'),_0x442a51,'request\x20sent');logger[_0xe30f('0xe')](_0xe30f('0xf'),_0x442a51,_0xe30f('0x10'),JSON[_0xe30f('0x11')](_0x5ab6b8));if(_0x5ab6b8['error']){if(_0x5ab6b8[_0xe30f('0x12')][_0xe30f('0x13')]===0x1f4){logger[_0xe30f('0x12')]('Migration,\x20%s,\x20%s',_0x442a51,_0x5ab6b8[_0xe30f('0x12')][_0xe30f('0x14')]);return _0x2243f2(_0x5ab6b8[_0xe30f('0x12')]['message']);}logger[_0xe30f('0x12')](_0xe30f('0xd'),_0x442a51,_0x5ab6b8[_0xe30f('0x12')][_0xe30f('0x14')]);return _0x2f94d2(_0x5ab6b8['error']['message']);}else{logger['info'](_0xe30f('0xd'),_0x442a51,_0xe30f('0x10'));_0x2f94d2(_0x5ab6b8[_0xe30f('0x15')][_0xe30f('0x14')]);}})['catch'](function(_0x1f19bf){logger['error'](_0xe30f('0xd'),_0x442a51,_0x1f19bf);_0x2243f2(_0x1f19bf);});});} \ No newline at end of file +var _0x4e34=['error','code','message','Migration,\x20%s,\x20%s','request\x20sent','catch','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x4e34,0x19e));var _0x44e3=function(_0x597ad2,_0x25e795){_0x597ad2=_0x597ad2-0x0;var _0x2ca843=_0x4e34[_0x597ad2];return _0x2ca843;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x44e3('0x0'));var BPromise=require(_0x44e3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44e3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x44e3('0x3'))(_0x44e3('0x4'));var config=require(_0x44e3('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x44e3('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x19e7de,_0x163879,_0x1ca56e){return new BPromise(function(_0x37b7d4,_0x196941){return client[_0x44e3('0x7')](_0x19e7de,_0x1ca56e)['then'](function(_0xf7e448){logger[_0x44e3('0x8')]('Migration,\x20%s,\x20%s',_0x163879,'request\x20sent');logger[_0x44e3('0x9')](_0x44e3('0xa'),_0x163879,'request\x20sent',JSON['stringify'](_0xf7e448));if(_0xf7e448[_0x44e3('0xb')]){if(_0xf7e448[_0x44e3('0xb')][_0x44e3('0xc')]===0x1f4){logger[_0x44e3('0xb')]('Migration,\x20%s,\x20%s',_0x163879,_0xf7e448[_0x44e3('0xb')][_0x44e3('0xd')]);return _0x196941(_0xf7e448[_0x44e3('0xb')][_0x44e3('0xd')]);}logger[_0x44e3('0xb')](_0x44e3('0xe'),_0x163879,_0xf7e448[_0x44e3('0xb')][_0x44e3('0xd')]);return _0x37b7d4(_0xf7e448['error'][_0x44e3('0xd')]);}else{logger['info'](_0x44e3('0xe'),_0x163879,_0x44e3('0xf'));_0x37b7d4(_0xf7e448['result'][_0x44e3('0xd')]);}})[_0x44e3('0x10')](function(_0x103eb0){logger[_0x44e3('0xb')](_0x44e3('0xe'),_0x163879,_0x103eb0);_0x196941(_0x103eb0);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index e065efb..23d7cc6 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 _0x7d5b=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','isAuthenticated','create','update','destroy','exports','multer'];(function(_0x1e4ac0,_0x38401f){var _0x421882=function(_0x31b1fa){while(--_0x31b1fa){_0x1e4ac0['push'](_0x1e4ac0['shift']());}};_0x421882(++_0x38401f);}(_0x7d5b,0x131));var _0xb7d5=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x7d5b[_0xaa0309];return _0x5de7ce;};'use strict';var multer=require(_0xb7d5('0x0'));var util=require(_0xb7d5('0x1'));var path=require('path');var timeout=require(_0xb7d5('0x2'));var express=require(_0xb7d5('0x3'));var router=express[_0xb7d5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb7d5('0x5'));var interaction=require(_0xb7d5('0x6'));var config=require(_0xb7d5('0x7'));var controller=require('./network.controller');router[_0xb7d5('0x8')]('/',auth['isAuthenticated'](),controller[_0xb7d5('0x9')]);router[_0xb7d5('0x8')](_0xb7d5('0xa'),auth['isAuthenticated'](),controller[_0xb7d5('0xb')]);router['post']('/',auth[_0xb7d5('0xc')](),controller[_0xb7d5('0xd')]);router['put'](_0xb7d5('0xa'),auth['isAuthenticated'](),controller[_0xb7d5('0xe')]);router['delete']('/:id',auth[_0xb7d5('0xc')](),controller[_0xb7d5('0xf')]);module[_0xb7d5('0x10')]=router; \ No newline at end of file +var _0x85e6=['show','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85e6,0x1a5));var _0x685e=function(_0x5847d1,_0x5ea75f){_0x5847d1=_0x5847d1-0x0;var _0x221771=_0x85e6[_0x5847d1];return _0x221771;};'use strict';var multer=require(_0x685e('0x0'));var util=require(_0x685e('0x1'));var path=require('path');var timeout=require(_0x685e('0x2'));var express=require(_0x685e('0x3'));var router=express['Router']();var fs_extra=require(_0x685e('0x4'));var auth=require(_0x685e('0x5'));var interaction=require(_0x685e('0x6'));var config=require('../../config/environment');var controller=require(_0x685e('0x7'));router['get']('/',auth[_0x685e('0x8')](),controller[_0x685e('0x9')]);router[_0x685e('0xa')]('/:id',auth[_0x685e('0x8')](),controller[_0x685e('0xb')]);router[_0x685e('0xc')]('/',auth[_0x685e('0x8')](),controller[_0x685e('0xd')]);router['put'](_0x685e('0xe'),auth['isAuthenticated'](),controller[_0x685e('0xf')]);router['delete'](_0x685e('0xe'),auth[_0x685e('0x8')](),controller[_0x685e('0x10')]);module[_0x685e('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 0695434..964da82 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 _0xc223=['STRING','sequelize'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0xc223,0x1d3));var _0x3c22=function(_0x102983,_0x3c356a){_0x102983=_0x102983-0x0;var _0x585de5=_0xc223[_0x102983];return _0x585de5;};'use strict';var Sequelize=require(_0x3c22('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('localnet','externip','stun','turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3c22('0x1')]},'password':{'type':Sequelize[_0x3c22('0x1')]}}; \ No newline at end of file +var _0xde09=['turn','STRING','sequelize','ENUM','localnet','externip'];(function(_0x3650ad,_0x3386bf){var _0x3e4d7b=function(_0x4cbf6b){while(--_0x4cbf6b){_0x3650ad['push'](_0x3650ad['shift']());}};_0x3e4d7b(++_0x3386bf);}(_0xde09,0x1d6));var _0x9de0=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xde09[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x9de0('0x0'));module['exports']={'type':{'type':Sequelize[_0x9de0('0x1')](_0x9de0('0x2'),_0x9de0('0x3'),'stun',_0x9de0('0x4'))},'value':{'type':Sequelize[_0x9de0('0x5')]},'username':{'type':Sequelize[_0x9de0('0x5')]},'password':{'type':Sequelize[_0x9de0('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 22ee0ee..57bf075 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 _0xe79a=['writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','format','toLowerCase','chan_sip.so','STUN','/etc/asterisk/sip_xcally_%s.conf','server/files/templates/stun_multiple.ejs','server/files/templates/network.ejs','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','undefined','offset','count','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','then','includeAll','include','show','params','find','create','transaction','findAll','body','toUpperCase','root','utf8','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','join','server/files/templates/turn_multiple.ejs','render'];(function(_0x2791fe,_0x26e0ab){var _0xf5df77=function(_0x53dbf8){while(--_0x53dbf8){_0x2791fe['push'](_0x2791fe['shift']());}};_0xf5df77(++_0x26e0ab);}(_0xe79a,0x70));var _0xae79=function(_0x1252d9,_0xb59816){_0x1252d9=_0x1252d9-0x0;var _0x76c018=_0xe79a[_0x1252d9];return _0x76c018;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xae79('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae79('0x1'));var moment=require(_0xae79('0x2'));var BPromise=require(_0xae79('0x3'));var Mustache=require(_0xae79('0x4'));var util=require('util');var path=require(_0xae79('0x5'));var sox=require(_0xae79('0x6'));var csv=require(_0xae79('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae79('0x8'));var _=require(_0xae79('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xae79('0xa'));var deskjs=require(_0xae79('0xb'));var toCsv=require('to-csv');var querystring=require(_0xae79('0xc'));var Papa=require('papaparse');var Redis=require(_0xae79('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae79('0xe'));var hardwareService=require(_0xae79('0xf'));var logger=require(_0xae79('0x10'))('api');var utils=require(_0xae79('0x11'));var config=require(_0xae79('0x12'));var licenseUtil=require(_0xae79('0x13'));var db=require(_0xae79('0x14'))['db'];var jayson=require(_0xae79('0x15'));var client=jayson[_0xae79('0x16')][_0xae79('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x12c634,_0x15ed35,_0x471fbf,_0x478937){return new BPromise(function(_0xdbae20,_0x456180){var _0x34fc00=_0x478937||client;return _0x34fc00[_0xae79('0x18')](_0x12c634,_0x471fbf)['then'](function(_0x4e4615){logger[_0xae79('0x19')](_0xae79('0x1a'),_0x15ed35,'request\x20sent');logger[_0xae79('0x1b')]('Network,\x20%s,\x20%s,\x20%s',_0x15ed35,_0xae79('0x1c'),JSON[_0xae79('0x1d')](_0x4e4615));if(_0x4e4615[_0xae79('0x1e')]){if(_0x4e4615[_0xae79('0x1e')][_0xae79('0x1f')]===0x1f4){logger['error'](_0xae79('0x1a'),_0x15ed35,_0x4e4615[_0xae79('0x1e')][_0xae79('0x20')]);return _0x456180(_0x4e4615[_0xae79('0x1e')][_0xae79('0x20')]);}logger[_0xae79('0x1e')]('Network,\x20%s,\x20%s',_0x15ed35,_0x4e4615[_0xae79('0x1e')][_0xae79('0x20')]);return _0xdbae20(_0x4e4615[_0xae79('0x1e')]['message']);}else{logger[_0xae79('0x19')](_0xae79('0x1a'),_0x15ed35,'request\x20sent');_0xdbae20(_0x4e4615[_0xae79('0x21')][_0xae79('0x20')]);}})[_0xae79('0x22')](function(_0x3f8409){logger['error'](_0xae79('0x1a'),_0x15ed35,_0x3f8409);_0x456180(_0x3f8409);});});}function respondWithStatusCode(_0x33f0c5,_0x49c55e){_0x49c55e=_0x49c55e||0xcc;return function(_0x5d4a57){if(_0x5d4a57){return _0x33f0c5[_0xae79('0x23')](_0x49c55e);}return _0x33f0c5[_0xae79('0x24')](_0x49c55e)['end']();};}function respondWithResult(_0x1e5101,_0x6a289b){_0x6a289b=_0x6a289b||0xc8;return function(_0x819255){if(_0x819255){return _0x1e5101[_0xae79('0x24')](_0x6a289b)['json'](_0x819255);}};}function respondWithFilteredResult(_0x1e8618,_0x504d65){return function(_0x3ee7ea){if(_0x3ee7ea){var _0x505b85=typeof _0x504d65['offset']===_0xae79('0x25')&&typeof _0x504d65['limit']===_0xae79('0x25');var _0x1d86be=_0x3ee7ea['count'];var _0x55731c=_0x505b85?0x0:_0x504d65[_0xae79('0x26')];var _0x5b43cd=_0x505b85?_0x3ee7ea[_0xae79('0x27')]:_0x504d65[_0xae79('0x26')]+_0x504d65[_0xae79('0x28')];var _0x3a3e68;if(_0x5b43cd>=_0x1d86be){_0x5b43cd=_0x1d86be;_0x3a3e68=0xc8;}else{_0x3a3e68=0xce;}_0x1e8618['status'](_0x3a3e68);return _0x1e8618['set'](_0xae79('0x29'),_0x55731c+'-'+_0x5b43cd+'/'+_0x1d86be)['json'](_0x3ee7ea);}return null;};}function patchUpdates(_0x4693be){return function(_0x34596b){try{jsonpatch[_0xae79('0x2a')](_0x34596b,_0x4693be,!![]);}catch(_0x271a78){return BPromise[_0xae79('0x2b')](_0x271a78);}return _0x34596b[_0xae79('0x2c')]();};}function saveUpdates(_0x49bd6c,_0xb91d40){return function(_0x34aacf){if(_0x34aacf){return _0x34aacf[_0xae79('0x2d')](_0x49bd6c)['then'](function(_0x1aa76a){return _0x1aa76a;});}return null;};}function removeEntity(_0x40b461,_0x44f0dd){return function(_0x13ee06){if(_0x13ee06){return _0x13ee06[_0xae79('0x2e')]()['then'](function(){_0x40b461[_0xae79('0x24')](0xcc)[_0xae79('0x2f')]();});}};}function handleEntityNotFound(_0x71fabd,_0x59a276){return function(_0x5bc86d){if(!_0x5bc86d){_0x71fabd[_0xae79('0x23')](0x194);}return _0x5bc86d;};}function handleError(_0x9b7026,_0x44c270){_0x44c270=_0x44c270||0x1f4;return function(_0x5a3ff8){logger[_0xae79('0x1e')](_0x5a3ff8[_0xae79('0x30')]);if(_0x5a3ff8['name']){delete _0x5a3ff8[_0xae79('0x31')];}_0x9b7026[_0xae79('0x24')](_0x44c270)[_0xae79('0x32')](_0x5a3ff8);};}exports['index']=function(_0x273396,_0x2b5e69){var _0x17c3a5={},_0x388c5f={},_0x3e4db2={'count':0x0,'rows':[]};var _0x5d4cc9=_[_0xae79('0x33')](db[_0xae79('0x34')][_0xae79('0x35')],function(_0x22b342){return{'name':_0x22b342['fieldName'],'type':_0x22b342[_0xae79('0x36')][_0xae79('0x37')]};});_0x388c5f[_0xae79('0x38')]=_['map'](_0x5d4cc9,_0xae79('0x31'));_0x388c5f[_0xae79('0x39')]=_[_0xae79('0x3a')](_0x273396['query']);_0x388c5f[_0xae79('0x3b')]=_[_0xae79('0x3c')](_0x388c5f['model'],_0x388c5f[_0xae79('0x39')]);_0x17c3a5[_0xae79('0x3d')]=_[_0xae79('0x3c')](_0x388c5f['model'],qs[_0xae79('0x3e')](_0x273396[_0xae79('0x39')][_0xae79('0x3e')]));_0x17c3a5[_0xae79('0x3d')]=_0x17c3a5[_0xae79('0x3d')][_0xae79('0x3f')]?_0x17c3a5[_0xae79('0x3d')]:_0x388c5f[_0xae79('0x38')];if(!_0x273396['query'][_0xae79('0x40')]('nolimit')){_0x17c3a5[_0xae79('0x28')]=qs[_0xae79('0x28')](_0x273396[_0xae79('0x39')][_0xae79('0x28')]);_0x17c3a5[_0xae79('0x26')]=qs[_0xae79('0x26')](_0x273396['query'][_0xae79('0x26')]);}_0x17c3a5[_0xae79('0x41')]=qs[_0xae79('0x42')](_0x273396['query'][_0xae79('0x42')]);_0x17c3a5['where']=qs[_0xae79('0x3b')](_[_0xae79('0x43')](_0x273396[_0xae79('0x39')],_0x388c5f[_0xae79('0x3b')]),_0x5d4cc9);if(_0x273396[_0xae79('0x39')]['filter']){_0x17c3a5[_0xae79('0x44')]=_[_0xae79('0x45')](_0x17c3a5[_0xae79('0x44')],{'$or':_[_0xae79('0x33')](_0x5d4cc9,function(_0x1f66db){if(_0x1f66db[_0xae79('0x36')]!=='VIRTUAL'){var _0x2615fd={};_0x2615fd[_0x1f66db['name']]={'$like':'%'+_0x273396[_0xae79('0x39')][_0xae79('0x46')]+'%'};return _0x2615fd;}})});}_0x17c3a5=_['merge']({},_0x17c3a5,_0x273396[_0xae79('0x47')]);var _0x1fe151={'where':_0x17c3a5['where']};return db['Network'][_0xae79('0x27')](_0x1fe151)[_0xae79('0x48')](function(_0x545ce2){_0x3e4db2['count']=_0x545ce2;if(_0x273396[_0xae79('0x39')][_0xae79('0x49')]){_0x17c3a5[_0xae79('0x4a')]=[{'all':!![]}];}return db[_0xae79('0x34')]['findAll'](_0x17c3a5);})['then'](function(_0x596a2b){_0x3e4db2['rows']=_0x596a2b;return _0x3e4db2;})[_0xae79('0x48')](respondWithFilteredResult(_0x2b5e69,_0x17c3a5))[_0xae79('0x22')](handleError(_0x2b5e69,null));};exports[_0xae79('0x4b')]=function(_0x2ca8b1,_0x166192){var _0x34f1b4={'raw':!![],'where':{'id':_0x2ca8b1[_0xae79('0x4c')]['id']}},_0x2cea67={};_0x2cea67['model']=_[_0xae79('0x3a')](db[_0xae79('0x34')][_0xae79('0x35')]);_0x2cea67[_0xae79('0x39')]=_[_0xae79('0x3a')](_0x2ca8b1[_0xae79('0x39')]);_0x2cea67['filters']=_[_0xae79('0x3c')](_0x2cea67[_0xae79('0x38')],_0x2cea67[_0xae79('0x39')]);_0x34f1b4[_0xae79('0x3d')]=_['intersection'](_0x2cea67['model'],qs[_0xae79('0x3e')](_0x2ca8b1[_0xae79('0x39')]['fields']));_0x34f1b4[_0xae79('0x3d')]=_0x34f1b4['attributes'][_0xae79('0x3f')]?_0x34f1b4[_0xae79('0x3d')]:_0x2cea67[_0xae79('0x38')];if(_0x2ca8b1[_0xae79('0x39')]['includeAll']){_0x34f1b4[_0xae79('0x4a')]=[{'all':!![]}];}_0x34f1b4=_[_0xae79('0x45')]({},_0x34f1b4,_0x2ca8b1['options']);return db[_0xae79('0x34')][_0xae79('0x4d')](_0x34f1b4)[_0xae79('0x48')](handleEntityNotFound(_0x166192,null))[_0xae79('0x48')](respondWithResult(_0x166192,null))['catch'](handleError(_0x166192,null));};exports[_0xae79('0x4e')]=function(_0x2b5bcc,_0xc98b31,_0x5c348a){var _0xb1842e;return db['sequelize'][_0xae79('0x4f')](function(_0x1bff2b){return db['Network']['create'](_0x2b5bcc['body'],{'raw':!![]})[_0xae79('0x48')](function(_0x48c6b5){_0xb1842e=_0x48c6b5;return db[_0xae79('0x34')][_0xae79('0x50')]({'where':{'type':_0x2b5bcc[_0xae79('0x51')][_0xae79('0x36')]},'raw':!![]});})['then'](function(_0x177f36){if(_0xb1842e['type'][_0xae79('0x52')]()=='STUN'){var _0x260305=fs['readFileSync'](path['join'](config[_0xae79('0x53')],'server/files/templates/stun_multiple.ejs'),_0xae79('0x54'));var _0x2397bc=ejs['render'](_0x260305,{'networks':_0x177f36||[]});fs['writeFileSync'](_0xae79('0x55'),_0x2397bc);return respondWithRpcPromise('Reload',_0xae79('0x4e'),{'module':_0xae79('0x56')});}else if(_0xb1842e['type']['toUpperCase']()==_0xae79('0x57')){var _0x4c22bc=fs[_0xae79('0x58')](path[_0xae79('0x59')](config[_0xae79('0x53')],_0xae79('0x5a')),_0xae79('0x54'));var _0x806aee=ejs[_0xae79('0x5b')](_0x4c22bc,{'networks':_0x177f36||[]});fs[_0xae79('0x5c')](_0xae79('0x5d'),_0x806aee);return respondWithRpcPromise(_0xae79('0x5e'),'create',{'module':'res_stun_monitor.so'});}else{var _0x5bdece=fs[_0xae79('0x58')](path[_0xae79('0x59')](config['root'],'server/files/templates/network.ejs'),_0xae79('0x54'));var _0x2e004c=ejs['render'](_0x5bdece,{'networks':_0x177f36||[]});fs[_0xae79('0x5c')](util[_0xae79('0x5f')]('/etc/asterisk/sip_xcally_%s.conf',_0x2b5bcc['body']['type'][_0xae79('0x60')]()),_0x2e004c);return respondWithRpcPromise(_0xae79('0x5e'),_0xae79('0x4e'),{'module':_0xae79('0x61')});}return null;})[_0xae79('0x48')](function(){return _0xb1842e;});})[_0xae79('0x48')](respondWithResult(_0xc98b31,0xc9))[_0xae79('0x22')](handleError(_0xc98b31,null));};exports['update']=function(_0x333a51,_0x2a7e76,_0x9c6627){var _0x132f09;return db['sequelize'][_0xae79('0x4f')](function(_0x53454a){return db[_0xae79('0x34')]['find']({'where':{'id':_0x333a51['params']['id']}})[_0xae79('0x48')](handleEntityNotFound(_0x2a7e76,null))[_0xae79('0x48')](saveUpdates(_0x333a51[_0xae79('0x51')],null))['then'](function(_0x39204d){if(_0x39204d){_0x132f09=_0x39204d;return db[_0xae79('0x34')][_0xae79('0x50')]({'where':{'type':_0x132f09['type']},'raw':!![]});}return null;})[_0xae79('0x48')](function(_0x4259ac){if(_0x132f09[_0xae79('0x36')][_0xae79('0x52')]()==_0xae79('0x62')){var _0x1c28e6=fs['readFileSync'](path['join'](config[_0xae79('0x53')],'server/files/templates/stun_multiple.ejs'),_0xae79('0x54'));var _0x19a61d=ejs[_0xae79('0x5b')](_0x1c28e6,{'networks':_0x4259ac||[]});fs[_0xae79('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x19a61d);return respondWithRpcPromise(_0xae79('0x5e'),_0xae79('0x2d'),{'module':'res_stun_monitor.so'});}else if(_0x132f09[_0xae79('0x36')][_0xae79('0x52')]()=='TURN'){var _0x29f568=fs[_0xae79('0x58')](path[_0xae79('0x59')](config['root'],'server/files/templates/turn_multiple.ejs'),_0xae79('0x54'));var _0x300eaa=ejs[_0xae79('0x5b')](_0x29f568,{'networks':_0x4259ac||[]});fs[_0xae79('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x300eaa);return respondWithRpcPromise(_0xae79('0x5e'),'update',{'module':_0xae79('0x56')});}else{var _0x424680=fs['readFileSync'](path[_0xae79('0x59')](config[_0xae79('0x53')],'server/files/templates/network.ejs'),_0xae79('0x54'));var _0x2f182=ejs[_0xae79('0x5b')](_0x424680,{'networks':_0x4259ac||[]});fs[_0xae79('0x5c')](util[_0xae79('0x5f')](_0xae79('0x63'),_0x333a51[_0xae79('0x51')][_0xae79('0x36')][_0xae79('0x60')]()),_0x2f182);return respondWithRpcPromise(_0xae79('0x5e'),_0xae79('0x2d'),{'module':_0xae79('0x61')});}return null;})['then'](function(_0x4ede92){if(_0x4ede92){return _0x132f09;}return null;});})[_0xae79('0x48')](respondWithResult(_0x2a7e76,null))[_0xae79('0x22')](handleError(_0x2a7e76,null));};exports[_0xae79('0x2e')]=function(_0x2dc106,_0x138c2b,_0x104c3a){var _0x579217;return db['Network'][_0xae79('0x4d')]({'where':{'id':_0x2dc106[_0xae79('0x4c')]['id']}})[_0xae79('0x48')](function(_0x195bcc){_0x579217=_0x195bcc;return _0x195bcc;})[_0xae79('0x48')](handleEntityNotFound(_0x138c2b,null))[_0xae79('0x48')](removeEntity(_0x138c2b,null))[_0xae79('0x48')](function(){if(_0x579217){return db['Network'][_0xae79('0x50')]({'where':{'type':_0x579217[_0xae79('0x36')]},'raw':!![]});}})[_0xae79('0x48')](function(_0x3eadd6){if(_0x579217[_0xae79('0x36')][_0xae79('0x52')]()==_0xae79('0x62')){var _0x493fbc=fs[_0xae79('0x58')](path['join'](config[_0xae79('0x53')],_0xae79('0x64')),_0xae79('0x54'));var _0x3ff70e=ejs[_0xae79('0x5b')](_0x493fbc,{'networks':_0x3eadd6||[]});fs[_0xae79('0x5c')](_0xae79('0x55'),_0x3ff70e);return respondWithRpcPromise(_0xae79('0x5e'),'destroy',{'module':_0xae79('0x56')});}else if(_0x579217['type'][_0xae79('0x52')]()==_0xae79('0x57')){var _0x450d6c=fs[_0xae79('0x58')](path['join'](config['root'],_0xae79('0x5a')),_0xae79('0x54'));var _0x43bd84=ejs['render'](_0x450d6c,{'networks':_0x3eadd6||[]});fs[_0xae79('0x5c')](_0xae79('0x5d'),_0x43bd84);return respondWithRpcPromise(_0xae79('0x5e'),'destroy',{'module':_0xae79('0x56')});}else{var _0x378791=fs[_0xae79('0x58')](path[_0xae79('0x59')](config['root'],_0xae79('0x65')),_0xae79('0x54'));var _0x462a6e=ejs[_0xae79('0x5b')](_0x378791,{'networks':_0x3eadd6||[]});fs[_0xae79('0x5c')](util[_0xae79('0x5f')](_0xae79('0x63'),_0x2dc106[_0xae79('0x51')][_0xae79('0x36')][_0xae79('0x60')]()),_0x462a6e);return respondWithRpcPromise('Reload',_0xae79('0x2e'),{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x138c2b,null));}; \ No newline at end of file +var _0xb555=['rimraf','zip-dir','fast-json-patch','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','Network','rawAttributes','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','rows','params','includeAll','include','options','find','create','transaction','body','STUN','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','format','eml-format'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xb555,0xe5));var _0x5b55=function(_0x512e0d,_0x446393){_0x512e0d=_0x512e0d-0x0;var _0x22ec50=_0xb555[_0x512e0d];return _0x22ec50;};'use strict';var emlformat=require(_0x5b55('0x0'));var rimraf=require(_0x5b55('0x1'));var zipdir=require(_0x5b55('0x2'));var jsonpatch=require(_0x5b55('0x3'));var rp=require('request-promise');var moment=require(_0x5b55('0x4'));var BPromise=require(_0x5b55('0x5'));var Mustache=require(_0x5b55('0x6'));var util=require(_0x5b55('0x7'));var path=require(_0x5b55('0x8'));var sox=require(_0x5b55('0x9'));var csv=require(_0x5b55('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b55('0xb'));var _=require(_0x5b55('0xc'));var squel=require(_0x5b55('0xd'));var crypto=require(_0x5b55('0xe'));var jsforce=require(_0x5b55('0xf'));var deskjs=require(_0x5b55('0x10'));var toCsv=require(_0x5b55('0xa'));var querystring=require(_0x5b55('0x11'));var Papa=require(_0x5b55('0x12'));var Redis=require('ioredis');var authService=require(_0x5b55('0x13'));var qs=require(_0x5b55('0x14'));var as=require(_0x5b55('0x15'));var hardwareService=require(_0x5b55('0x16'));var logger=require(_0x5b55('0x17'))(_0x5b55('0x18'));var utils=require(_0x5b55('0x19'));var config=require(_0x5b55('0x1a'));var licenseUtil=require(_0x5b55('0x1b'));var db=require(_0x5b55('0x1c'))['db'];var jayson=require(_0x5b55('0x1d'));var client=jayson[_0x5b55('0x1e')][_0x5b55('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2cc5f6,_0x282821,_0x463c96,_0x2da06c){return new BPromise(function(_0x42707e,_0xa3acce){var _0x59b959=_0x2da06c||client;return _0x59b959[_0x5b55('0x20')](_0x2cc5f6,_0x463c96)[_0x5b55('0x21')](function(_0x4c6f2b){logger[_0x5b55('0x22')](_0x5b55('0x23'),_0x282821,_0x5b55('0x24'));logger['debug'](_0x5b55('0x25'),_0x282821,_0x5b55('0x24'),JSON[_0x5b55('0x26')](_0x4c6f2b));if(_0x4c6f2b[_0x5b55('0x27')]){if(_0x4c6f2b[_0x5b55('0x27')][_0x5b55('0x28')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x282821,_0x4c6f2b[_0x5b55('0x27')][_0x5b55('0x29')]);return _0xa3acce(_0x4c6f2b['error'][_0x5b55('0x29')]);}logger['error'](_0x5b55('0x23'),_0x282821,_0x4c6f2b['error'][_0x5b55('0x29')]);return _0x42707e(_0x4c6f2b[_0x5b55('0x27')][_0x5b55('0x29')]);}else{logger[_0x5b55('0x22')]('Network,\x20%s,\x20%s',_0x282821,_0x5b55('0x24'));_0x42707e(_0x4c6f2b['result'][_0x5b55('0x29')]);}})[_0x5b55('0x2a')](function(_0x1d6025){logger['error'](_0x5b55('0x23'),_0x282821,_0x1d6025);_0xa3acce(_0x1d6025);});});}function respondWithStatusCode(_0x49febe,_0xb710a3){_0xb710a3=_0xb710a3||0xcc;return function(_0x2843f0){if(_0x2843f0){return _0x49febe[_0x5b55('0x2b')](_0xb710a3);}return _0x49febe[_0x5b55('0x2c')](_0xb710a3)[_0x5b55('0x2d')]();};}function respondWithResult(_0x54c33d,_0x1eb841){_0x1eb841=_0x1eb841||0xc8;return function(_0x1c1b7d){if(_0x1c1b7d){return _0x54c33d[_0x5b55('0x2c')](_0x1eb841)[_0x5b55('0x2e')](_0x1c1b7d);}};}function respondWithFilteredResult(_0x5edd45,_0x217ae5){return function(_0x4ff69f){if(_0x4ff69f){var _0xe1ab54=typeof _0x217ae5[_0x5b55('0x2f')]===_0x5b55('0x30')&&typeof _0x217ae5[_0x5b55('0x31')]===_0x5b55('0x30');var _0x4e7aaa=_0x4ff69f[_0x5b55('0x32')];var _0x4e9895=_0xe1ab54?0x0:_0x217ae5[_0x5b55('0x2f')];var _0xab682=_0xe1ab54?_0x4ff69f[_0x5b55('0x32')]:_0x217ae5[_0x5b55('0x2f')]+_0x217ae5['limit'];var _0x290d23;if(_0xab682>=_0x4e7aaa){_0xab682=_0x4e7aaa;_0x290d23=0xc8;}else{_0x290d23=0xce;}_0x5edd45[_0x5b55('0x2c')](_0x290d23);return _0x5edd45[_0x5b55('0x33')](_0x5b55('0x34'),_0x4e9895+'-'+_0xab682+'/'+_0x4e7aaa)[_0x5b55('0x2e')](_0x4ff69f);}return null;};}function patchUpdates(_0x5e96bc){return function(_0x3b85da){try{jsonpatch[_0x5b55('0x35')](_0x3b85da,_0x5e96bc,!![]);}catch(_0x2879b5){return BPromise['reject'](_0x2879b5);}return _0x3b85da[_0x5b55('0x36')]();};}function saveUpdates(_0x10a577,_0x24daf5){return function(_0x29a3ba){if(_0x29a3ba){return _0x29a3ba[_0x5b55('0x37')](_0x10a577)[_0x5b55('0x21')](function(_0x2a37dc){return _0x2a37dc;});}return null;};}function removeEntity(_0x565e70,_0x53bd74){return function(_0x3c123e){if(_0x3c123e){return _0x3c123e[_0x5b55('0x38')]()[_0x5b55('0x21')](function(){_0x565e70[_0x5b55('0x2c')](0xcc)[_0x5b55('0x2d')]();});}};}function handleEntityNotFound(_0x300ba3,_0x212929){return function(_0x4e5118){if(!_0x4e5118){_0x300ba3[_0x5b55('0x2b')](0x194);}return _0x4e5118;};}function handleError(_0x3080f1,_0x16f6fa){_0x16f6fa=_0x16f6fa||0x1f4;return function(_0x50e4b9){logger[_0x5b55('0x27')](_0x50e4b9[_0x5b55('0x39')]);if(_0x50e4b9[_0x5b55('0x3a')]){delete _0x50e4b9[_0x5b55('0x3a')];}_0x3080f1['status'](_0x16f6fa)[_0x5b55('0x3b')](_0x50e4b9);};}exports[_0x5b55('0x3c')]=function(_0x49e6fd,_0x33bd86){var _0x5c78b0={},_0x2cd588={},_0x130e9e={'count':0x0,'rows':[]};var _0x3c9883=_['map'](db[_0x5b55('0x3d')][_0x5b55('0x3e')],function(_0x3c1399){return{'name':_0x3c1399[_0x5b55('0x3f')],'type':_0x3c1399[_0x5b55('0x40')][_0x5b55('0x41')]};});_0x2cd588[_0x5b55('0x42')]=_[_0x5b55('0x43')](_0x3c9883,_0x5b55('0x3a'));_0x2cd588['query']=_[_0x5b55('0x44')](_0x49e6fd[_0x5b55('0x45')]);_0x2cd588['filters']=_['intersection'](_0x2cd588[_0x5b55('0x42')],_0x2cd588[_0x5b55('0x45')]);_0x5c78b0[_0x5b55('0x46')]=_[_0x5b55('0x47')](_0x2cd588[_0x5b55('0x42')],qs[_0x5b55('0x48')](_0x49e6fd['query'][_0x5b55('0x48')]));_0x5c78b0[_0x5b55('0x46')]=_0x5c78b0['attributes'][_0x5b55('0x49')]?_0x5c78b0[_0x5b55('0x46')]:_0x2cd588['model'];if(!_0x49e6fd[_0x5b55('0x45')][_0x5b55('0x4a')](_0x5b55('0x4b'))){_0x5c78b0[_0x5b55('0x31')]=qs['limit'](_0x49e6fd['query'][_0x5b55('0x31')]);_0x5c78b0[_0x5b55('0x2f')]=qs[_0x5b55('0x2f')](_0x49e6fd['query']['offset']);}_0x5c78b0[_0x5b55('0x4c')]=qs[_0x5b55('0x4d')](_0x49e6fd[_0x5b55('0x45')][_0x5b55('0x4d')]);_0x5c78b0[_0x5b55('0x4e')]=qs[_0x5b55('0x4f')](_[_0x5b55('0x50')](_0x49e6fd[_0x5b55('0x45')],_0x2cd588[_0x5b55('0x4f')]),_0x3c9883);if(_0x49e6fd[_0x5b55('0x45')][_0x5b55('0x51')]){_0x5c78b0[_0x5b55('0x4e')]=_['merge'](_0x5c78b0[_0x5b55('0x4e')],{'$or':_[_0x5b55('0x43')](_0x3c9883,function(_0x136ab1){if(_0x136ab1['type']!==_0x5b55('0x52')){var _0x12847a={};_0x12847a[_0x136ab1[_0x5b55('0x3a')]]={'$like':'%'+_0x49e6fd['query'][_0x5b55('0x51')]+'%'};return _0x12847a;}})});}_0x5c78b0=_[_0x5b55('0x53')]({},_0x5c78b0,_0x49e6fd['options']);var _0x3132da={'where':_0x5c78b0['where']};return db['Network']['count'](_0x3132da)['then'](function(_0x5c2dcd){_0x130e9e['count']=_0x5c2dcd;if(_0x49e6fd[_0x5b55('0x45')]['includeAll']){_0x5c78b0['include']=[{'all':!![]}];}return db['Network'][_0x5b55('0x54')](_0x5c78b0);})[_0x5b55('0x21')](function(_0x884d39){_0x130e9e[_0x5b55('0x55')]=_0x884d39;return _0x130e9e;})['then'](respondWithFilteredResult(_0x33bd86,_0x5c78b0))[_0x5b55('0x2a')](handleError(_0x33bd86,null));};exports['show']=function(_0xe033ad,_0x3c0a57){var _0x3ca1c0={'raw':!![],'where':{'id':_0xe033ad[_0x5b55('0x56')]['id']}},_0x5fc6f7={};_0x5fc6f7[_0x5b55('0x42')]=_[_0x5b55('0x44')](db[_0x5b55('0x3d')][_0x5b55('0x3e')]);_0x5fc6f7[_0x5b55('0x45')]=_[_0x5b55('0x44')](_0xe033ad[_0x5b55('0x45')]);_0x5fc6f7[_0x5b55('0x4f')]=_[_0x5b55('0x47')](_0x5fc6f7[_0x5b55('0x42')],_0x5fc6f7['query']);_0x3ca1c0[_0x5b55('0x46')]=_[_0x5b55('0x47')](_0x5fc6f7[_0x5b55('0x42')],qs[_0x5b55('0x48')](_0xe033ad[_0x5b55('0x45')][_0x5b55('0x48')]));_0x3ca1c0[_0x5b55('0x46')]=_0x3ca1c0[_0x5b55('0x46')][_0x5b55('0x49')]?_0x3ca1c0[_0x5b55('0x46')]:_0x5fc6f7[_0x5b55('0x42')];if(_0xe033ad[_0x5b55('0x45')][_0x5b55('0x57')]){_0x3ca1c0[_0x5b55('0x58')]=[{'all':!![]}];}_0x3ca1c0=_[_0x5b55('0x53')]({},_0x3ca1c0,_0xe033ad[_0x5b55('0x59')]);return db['Network'][_0x5b55('0x5a')](_0x3ca1c0)[_0x5b55('0x21')](handleEntityNotFound(_0x3c0a57,null))['then'](respondWithResult(_0x3c0a57,null))[_0x5b55('0x2a')](handleError(_0x3c0a57,null));};exports[_0x5b55('0x5b')]=function(_0x360055,_0x54878a,_0x5f0098){var _0x5c942d;return db['sequelize'][_0x5b55('0x5c')](function(_0x29b055){return db[_0x5b55('0x3d')][_0x5b55('0x5b')](_0x360055[_0x5b55('0x5d')],{'raw':!![]})[_0x5b55('0x21')](function(_0x502018){_0x5c942d=_0x502018;return db[_0x5b55('0x3d')]['findAll']({'where':{'type':_0x360055[_0x5b55('0x5d')][_0x5b55('0x40')]},'raw':!![]});})[_0x5b55('0x21')](function(_0x1ce2a7){if(_0x5c942d[_0x5b55('0x40')]['toUpperCase']()==_0x5b55('0x5e')){var _0x21dff0=fs['readFileSync'](path[_0x5b55('0x5f')](config[_0x5b55('0x60')],'server/files/templates/stun_multiple.ejs'),_0x5b55('0x61'));var _0x584974=ejs[_0x5b55('0x62')](_0x21dff0,{'networks':_0x1ce2a7||[]});fs[_0x5b55('0x63')](_0x5b55('0x64'),_0x584974);return respondWithRpcPromise(_0x5b55('0x65'),_0x5b55('0x5b'),{'module':_0x5b55('0x66')});}else if(_0x5c942d[_0x5b55('0x40')][_0x5b55('0x67')]()==_0x5b55('0x68')){var _0x287d89=fs[_0x5b55('0x69')](path['join'](config[_0x5b55('0x60')],'server/files/templates/turn_multiple.ejs'),_0x5b55('0x61'));var _0x30de6f=ejs[_0x5b55('0x62')](_0x287d89,{'networks':_0x1ce2a7||[]});fs[_0x5b55('0x63')](_0x5b55('0x6a'),_0x30de6f);return respondWithRpcPromise(_0x5b55('0x65'),_0x5b55('0x5b'),{'module':'res_stun_monitor.so'});}else{var _0x26013a=fs['readFileSync'](path[_0x5b55('0x5f')](config[_0x5b55('0x60')],_0x5b55('0x6b')),'utf8');var _0x134355=ejs['render'](_0x26013a,{'networks':_0x1ce2a7||[]});fs[_0x5b55('0x63')](util['format'](_0x5b55('0x6c'),_0x360055[_0x5b55('0x5d')][_0x5b55('0x40')][_0x5b55('0x6d')]()),_0x134355);return respondWithRpcPromise(_0x5b55('0x65'),_0x5b55('0x5b'),{'module':_0x5b55('0x6e')});}return null;})['then'](function(){return _0x5c942d;});})['then'](respondWithResult(_0x54878a,0xc9))[_0x5b55('0x2a')](handleError(_0x54878a,null));};exports[_0x5b55('0x37')]=function(_0x443d79,_0x6d0e95,_0x5f1637){var _0x222601;return db[_0x5b55('0x6f')]['transaction'](function(_0x60a91d){return db[_0x5b55('0x3d')][_0x5b55('0x5a')]({'where':{'id':_0x443d79[_0x5b55('0x56')]['id']}})[_0x5b55('0x21')](handleEntityNotFound(_0x6d0e95,null))[_0x5b55('0x21')](saveUpdates(_0x443d79['body'],null))[_0x5b55('0x21')](function(_0x28b450){if(_0x28b450){_0x222601=_0x28b450;return db[_0x5b55('0x3d')][_0x5b55('0x54')]({'where':{'type':_0x222601[_0x5b55('0x40')]},'raw':!![]});}return null;})[_0x5b55('0x21')](function(_0x48444c){if(_0x222601[_0x5b55('0x40')]['toUpperCase']()=='STUN'){var _0x5792b3=fs[_0x5b55('0x69')](path[_0x5b55('0x5f')](config[_0x5b55('0x60')],_0x5b55('0x70')),_0x5b55('0x61'));var _0x5babd8=ejs[_0x5b55('0x62')](_0x5792b3,{'networks':_0x48444c||[]});fs[_0x5b55('0x63')](_0x5b55('0x64'),_0x5babd8);return respondWithRpcPromise('Reload',_0x5b55('0x37'),{'module':_0x5b55('0x66')});}else if(_0x222601[_0x5b55('0x40')][_0x5b55('0x67')]()==_0x5b55('0x68')){var _0x3007fa=fs[_0x5b55('0x69')](path[_0x5b55('0x5f')](config[_0x5b55('0x60')],_0x5b55('0x71')),'utf8');var _0x1ea9bf=ejs['render'](_0x3007fa,{'networks':_0x48444c||[]});fs[_0x5b55('0x63')](_0x5b55('0x6a'),_0x1ea9bf);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else{var _0x24a905=fs[_0x5b55('0x69')](path['join'](config['root'],_0x5b55('0x6b')),_0x5b55('0x61'));var _0x3c730e=ejs[_0x5b55('0x62')](_0x24a905,{'networks':_0x48444c||[]});fs[_0x5b55('0x63')](util[_0x5b55('0x72')](_0x5b55('0x6c'),_0x443d79[_0x5b55('0x5d')][_0x5b55('0x40')][_0x5b55('0x6d')]()),_0x3c730e);return respondWithRpcPromise(_0x5b55('0x65'),_0x5b55('0x37'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x5c7181){if(_0x5c7181){return _0x222601;}return null;});})[_0x5b55('0x21')](respondWithResult(_0x6d0e95,null))['catch'](handleError(_0x6d0e95,null));};exports[_0x5b55('0x38')]=function(_0x57a402,_0x9bb4b6,_0x1a95b6){var _0x1da80c;return db['Network']['find']({'where':{'id':_0x57a402['params']['id']}})[_0x5b55('0x21')](function(_0x47050e){_0x1da80c=_0x47050e;return _0x47050e;})[_0x5b55('0x21')](handleEntityNotFound(_0x9bb4b6,null))[_0x5b55('0x21')](removeEntity(_0x9bb4b6,null))['then'](function(){if(_0x1da80c){return db[_0x5b55('0x3d')][_0x5b55('0x54')]({'where':{'type':_0x1da80c[_0x5b55('0x40')]},'raw':!![]});}})[_0x5b55('0x21')](function(_0x54eee4){if(_0x1da80c[_0x5b55('0x40')][_0x5b55('0x67')]()==_0x5b55('0x5e')){var _0x5a3dc7=fs[_0x5b55('0x69')](path[_0x5b55('0x5f')](config[_0x5b55('0x60')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x8021d=ejs[_0x5b55('0x62')](_0x5a3dc7,{'networks':_0x54eee4||[]});fs[_0x5b55('0x63')](_0x5b55('0x64'),_0x8021d);return respondWithRpcPromise(_0x5b55('0x65'),_0x5b55('0x38'),{'module':_0x5b55('0x66')});}else if(_0x1da80c[_0x5b55('0x40')][_0x5b55('0x67')]()==_0x5b55('0x68')){var _0x22bdbd=fs[_0x5b55('0x69')](path[_0x5b55('0x5f')](config['root'],_0x5b55('0x71')),_0x5b55('0x61'));var _0x42cf98=ejs['render'](_0x22bdbd,{'networks':_0x54eee4||[]});fs[_0x5b55('0x63')]('/etc/asterisk/turn_xcally.conf',_0x42cf98);return respondWithRpcPromise(_0x5b55('0x65'),_0x5b55('0x38'),{'module':_0x5b55('0x66')});}else{var _0xac1d5d=fs['readFileSync'](path['join'](config['root'],_0x5b55('0x6b')),_0x5b55('0x61'));var _0x42c984=ejs[_0x5b55('0x62')](_0xac1d5d,{'networks':_0x54eee4||[]});fs[_0x5b55('0x63')](util[_0x5b55('0x72')](_0x5b55('0x6c'),_0x57a402[_0x5b55('0x5d')]['type'][_0x5b55('0x6d')]()),_0x42c984);return respondWithRpcPromise(_0x5b55('0x65'),'destroy',{'module':_0x5b55('0x6e')});}return null;})[_0x5b55('0x2a')](handleError(_0x9bb4b6,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 3ebc3c7..5e20cb2 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 _0xaaa2=['./network.attributes','exports','define','network','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0xd50cdf,_0x27d351){var _0x35b08b=function(_0x79541b){while(--_0x79541b){_0xd50cdf['push'](_0xd50cdf['shift']());}};_0x35b08b(++_0x27d351);}(_0xaaa2,0xac));var _0x2aaa=function(_0x3642a1,_0x440c88){_0x3642a1=_0x3642a1-0x0;var _0x1366dd=_0xaaa2[_0x3642a1];return _0x1366dd;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var logger=require(_0x2aaa('0x2'))(_0x2aaa('0x3'));var moment=require(_0x2aaa('0x4'));var BPromise=require(_0x2aaa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aaa('0x6'));var rimraf=require('rimraf');var config=require(_0x2aaa('0x7'));var attributes=require(_0x2aaa('0x8'));module[_0x2aaa('0x9')]=function(_0x25cb1d,_0x1ef101){return _0x25cb1d[_0x2aaa('0xa')]('Network',attributes,{'tableName':_0x2aaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80df=['../../config/environment','./network.attributes','exports','define','network','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x80df,0x17e));var _0xf80d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x80df[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf80d('0x0'));var util=require(_0xf80d('0x1'));var logger=require(_0xf80d('0x2'))(_0xf80d('0x3'));var moment=require('moment');var BPromise=require(_0xf80d('0x4'));var rp=require(_0xf80d('0x5'));var fs=require('fs');var path=require(_0xf80d('0x6'));var rimraf=require(_0xf80d('0x7'));var config=require(_0xf80d('0x8'));var attributes=require(_0xf80d('0x9'));module[_0xf80d('0xa')]=function(_0xeffeb7,_0x1c9b19){return _0xeffeb7[_0xf80d('0xb')]('Network',attributes,{'tableName':_0xf80d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 24f7505..5af41e8 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x4073cc,_0x237f63){_0x4073cc=_0x4073cc-0x0;var _0x525a17=_0x7a54[_0x4073cc];return _0x525a17;};'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(_0x5571c5,_0xce7520){var _0x53c6b8=function(_0x1386e0){while(--_0x1386e0){_0x5571c5['push'](_0x5571c5['shift']());}};_0x53c6b8(++_0xce7520);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 72102f1..58655a1 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 _0xc33c=['getAgents','post','addDisposition','notify','/:id/applications','/:id/users','/:id/send','send','put','/:id','update','destroy','delete','removeAnswers','removeAgents','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','show','/:id/dispositions','getDispositions','getApplications','/:id/interactions','getInteractions'];(function(_0x173f02,_0x354051){var _0x28f16a=function(_0x107c92){while(--_0x107c92){_0x173f02['push'](_0x173f02['shift']());}};_0x28f16a(++_0x354051);}(_0xc33c,0x1f0));var _0xcc33=function(_0x16f065,_0x3b11f0){_0x16f065=_0x16f065-0x0;var _0xca9c28=_0xc33c[_0x16f065];return _0xca9c28;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcc33('0x0'));var express=require('express');var router=express[_0xcc33('0x1')]();var fs_extra=require(_0xcc33('0x2'));var auth=require(_0xcc33('0x3'));var interaction=require(_0xcc33('0x4'));var config=require(_0xcc33('0x5'));var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcc33('0x6')]);router[_0xcc33('0x7')]('/describe',auth[_0xcc33('0x8')](),controller[_0xcc33('0x9')]);router[_0xcc33('0x7')]('/:id',auth[_0xcc33('0x8')](),controller[_0xcc33('0xa')]);router[_0xcc33('0x7')](_0xcc33('0xb'),auth[_0xcc33('0x8')](),controller[_0xcc33('0xc')]);router['get']('/:id/canned_answers',auth[_0xcc33('0x8')](),controller['getAnswers']);router['get']('/:id/applications',auth[_0xcc33('0x8')](),controller[_0xcc33('0xd')]);router[_0xcc33('0x7')](_0xcc33('0xe'),auth[_0xcc33('0x8')](),controller[_0xcc33('0xf')]);router[_0xcc33('0x7')]('/:id/users',auth[_0xcc33('0x8')](),controller[_0xcc33('0x10')]);router[_0xcc33('0x11')]('/',auth[_0xcc33('0x8')](),controller['create']);router[_0xcc33('0x11')](_0xcc33('0xb'),auth[_0xcc33('0x8')](),controller[_0xcc33('0x12')]);router[_0xcc33('0x11')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router['post']('/:id/notify',controller[_0xcc33('0x13')]);router[_0xcc33('0x11')](_0xcc33('0x14'),auth[_0xcc33('0x8')](),controller['addApplications']);router['post'](_0xcc33('0x15'),auth[_0xcc33('0x8')](),controller['addAgents']);router['post'](_0xcc33('0x16'),auth[_0xcc33('0x8')](),controller[_0xcc33('0x17')]);router[_0xcc33('0x18')](_0xcc33('0x19'),auth['isAuthenticated'](),controller[_0xcc33('0x1a')]);router['delete'](_0xcc33('0x19'),auth[_0xcc33('0x8')](),controller[_0xcc33('0x1b')]);router[_0xcc33('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xcc33('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xcc33('0x1d')]);router[_0xcc33('0x1c')](_0xcc33('0x15'),auth['isAuthenticated'](),controller[_0xcc33('0x1e')]);module[_0xcc33('0x1f')]=router; \ No newline at end of file +var _0xf2fc=['path','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','put','removeAnswers','delete','exports','multer','util'];(function(_0xd98ca3,_0x38fbd9){var _0x35960d=function(_0x52e8ee){while(--_0x52e8ee){_0xd98ca3['push'](_0xd98ca3['shift']());}};_0x35960d(++_0x38fbd9);}(_0xf2fc,0x19e));var _0xcf2f=function(_0x296d1b,_0x1f0bf0){_0x296d1b=_0x296d1b-0x0;var _0x3c747f=_0xf2fc[_0x296d1b];return _0x3c747f;};'use strict';var multer=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var path=require(_0xcf2f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcf2f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcf2f('0x4'));var controller=require(_0xcf2f('0x5'));router[_0xcf2f('0x6')]('/',auth[_0xcf2f('0x7')](),controller[_0xcf2f('0x8')]);router[_0xcf2f('0x6')](_0xcf2f('0x9'),auth[_0xcf2f('0x7')](),controller[_0xcf2f('0xa')]);router[_0xcf2f('0x6')]('/:id',auth[_0xcf2f('0x7')](),controller[_0xcf2f('0xb')]);router[_0xcf2f('0x6')](_0xcf2f('0xc'),auth[_0xcf2f('0x7')](),controller[_0xcf2f('0xd')]);router[_0xcf2f('0x6')](_0xcf2f('0xe'),auth[_0xcf2f('0x7')](),controller[_0xcf2f('0xf')]);router[_0xcf2f('0x6')](_0xcf2f('0x10'),auth['isAuthenticated'](),controller[_0xcf2f('0x11')]);router[_0xcf2f('0x6')](_0xcf2f('0x12'),auth[_0xcf2f('0x7')](),controller['getInteractions']);router[_0xcf2f('0x6')](_0xcf2f('0x13'),auth[_0xcf2f('0x7')](),controller[_0xcf2f('0x14')]);router[_0xcf2f('0x15')]('/',auth[_0xcf2f('0x7')](),controller['create']);router[_0xcf2f('0x15')](_0xcf2f('0xc'),auth[_0xcf2f('0x7')](),controller[_0xcf2f('0x16')]);router[_0xcf2f('0x15')](_0xcf2f('0xe'),auth['isAuthenticated'](),controller[_0xcf2f('0x17')]);router[_0xcf2f('0x15')](_0xcf2f('0x18'),controller[_0xcf2f('0x19')]);router[_0xcf2f('0x15')]('/:id/applications',auth[_0xcf2f('0x7')](),controller[_0xcf2f('0x1a')]);router[_0xcf2f('0x15')](_0xcf2f('0x13'),auth[_0xcf2f('0x7')](),controller[_0xcf2f('0x1b')]);router[_0xcf2f('0x15')]('/:id/send',auth[_0xcf2f('0x7')](),controller['send']);router[_0xcf2f('0x1c')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xcf2f('0x7')](),controller['destroy']);router['delete'](_0xcf2f('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xcf2f('0xe'),auth['isAuthenticated'](),controller[_0xcf2f('0x1d')]);router[_0xcf2f('0x1e')]('/:id/users',auth[_0xcf2f('0x7')](),controller['removeAgents']);module[_0xcf2f('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index b24b9a3..7c88b45 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 _0x0c2d=['exports','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x31677f,_0x19b185){var _0xa2c0c4=function(_0x20440a){while(--_0x20440a){_0x31677f['push'](_0x31677f['shift']());}};_0xa2c0c4(++_0x19b185);}(_0x0c2d,0x153));var _0xd0c2=function(_0x2c1674,_0x1a2889){_0x2c1674=_0x2c1674-0x0;var _0x53649c=_0x0c2d[_0x2c1674];return _0x53649c;};'use strict';var Sequelize=require(_0xd0c2('0x0'));var rs=require(_0xd0c2('0x1'));module[_0xd0c2('0x2')]={'name':{'type':Sequelize[_0xd0c2('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd0c2('0x3')],'defaultValue':function(){return rs[_0xd0c2('0x4')]();}},'replyUri':{'type':Sequelize[_0xd0c2('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd0c2('0x5');}},'notificationSound':{'type':Sequelize[_0xd0c2('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0c2('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd0c2('0x3')]},'queueTransfer':{'type':Sequelize[_0xd0c2('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0c2('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0c2('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0c2('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xd0c2('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5c3507){if(!_0x5c3507)this['setDataValue'](_0xd0c2('0x9'),null);this['setDataValue'](_0xd0c2('0xa'),_0x5c3507);}}}; \ No newline at end of file +var _0x4b56=['INTEGER','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x51911b,_0x16e71f){var _0x1e0552=function(_0x39e68f){while(--_0x39e68f){_0x51911b['push'](_0x51911b['shift']());}};_0x1e0552(++_0x16e71f);}(_0x4b56,0x143));var _0x64b5=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x4b56[_0x319cb9];return _0x1735fc;};'use strict';var Sequelize=require(_0x64b5('0x0'));var rs=require(_0x64b5('0x1'));module[_0x64b5('0x2')]={'name':{'type':Sequelize[_0x64b5('0x3')],'unique':_0x64b5('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x64b5('0x3')]},'token':{'type':Sequelize[_0x64b5('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x64b5('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x64b5('0x5');}},'notificationSound':{'type':Sequelize[_0x64b5('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x64b5('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x64b5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x64b5('0x3')]},'queueTransfer':{'type':Sequelize[_0x64b5('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x64b5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x64b5('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x64b5('0x7')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x64b5('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x342ef4){if(!_0x342ef4)this[_0x64b5('0x8')]('mandatoryDispositionPauseId',null);this[_0x64b5('0x8')](_0x64b5('0x9'),_0x342ef4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 5ae3383..87f02c2 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 _0x0f29=['register','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','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','from','CmList','List','DESC','Applications','account','applications','list','orderBy','priority','Contacts','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','Messages','dataValues','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f29,0xa3));var _0x90f2=function(_0xbf3271,_0x469a11){_0xbf3271=_0xbf3271-0x0;var _0x5dd3c7=_0x0f29[_0xbf3271];return _0x5dd3c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90f2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90f2('0x1'));var rp=require(_0x90f2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x90f2('0x3'));var path=require(_0x90f2('0x4'));var sox=require(_0x90f2('0x5'));var csv=require(_0x90f2('0x6'));var ejs=require(_0x90f2('0x7'));var fs=require('fs');var fs_extra=require(_0x90f2('0x8'));var _=require(_0x90f2('0x9'));var squel=require(_0x90f2('0xa'));var crypto=require(_0x90f2('0xb'));var jsforce=require(_0x90f2('0xc'));var deskjs=require(_0x90f2('0xd'));var toCsv=require(_0x90f2('0x6'));var querystring=require(_0x90f2('0xe'));var Papa=require(_0x90f2('0xf'));var Redis=require(_0x90f2('0x10'));var authService=require(_0x90f2('0x11'));var qs=require(_0x90f2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90f2('0x13'));var logger=require(_0x90f2('0x14'))(_0x90f2('0x15'));var utils=require(_0x90f2('0x16'));var config=require(_0x90f2('0x17'));var licenseUtil=require(_0x90f2('0x18'));var db=require(_0x90f2('0x19'))['db'];config[_0x90f2('0x1a')]=_[_0x90f2('0x1b')](config[_0x90f2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x90f2('0x1c'))[_0x90f2('0x1d')](socket);var jayson=require(_0x90f2('0x1e'));var client=jayson[_0x90f2('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x90f2('0x1f')][_0x90f2('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x38e9f1,_0xe5ebda,_0x44a332,_0x4bb23f){return new BPromise(function(_0xaf721e,_0x4a00b4){var _0x432129=_0x4bb23f||client;return _0x432129[_0x90f2('0x21')](_0x38e9f1,_0x44a332)['then'](function(_0x1ab9ea){logger[_0x90f2('0x22')](_0x90f2('0x23'),_0xe5ebda,_0x90f2('0x24'));logger[_0x90f2('0x25')](_0x90f2('0x26'),_0xe5ebda,_0x90f2('0x24'),JSON[_0x90f2('0x27')](_0x1ab9ea));if(_0x1ab9ea[_0x90f2('0x28')]){if(_0x1ab9ea[_0x90f2('0x28')][_0x90f2('0x29')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0xe5ebda,_0x1ab9ea['error'][_0x90f2('0x2a')]);return _0x4a00b4(_0x1ab9ea[_0x90f2('0x28')][_0x90f2('0x2a')]);}logger[_0x90f2('0x28')](_0x90f2('0x23'),_0xe5ebda,_0x1ab9ea[_0x90f2('0x28')][_0x90f2('0x2a')]);return _0xaf721e(_0x1ab9ea['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0xe5ebda,_0x90f2('0x24'));_0xaf721e(_0x1ab9ea[_0x90f2('0x2b')][_0x90f2('0x2a')]);}})['catch'](function(_0x1d3dac){logger[_0x90f2('0x28')](_0x90f2('0x23'),_0xe5ebda,_0x1d3dac);_0x4a00b4(_0x1d3dac);});});}function respondWithStatusCode(_0x3cf00d,_0x21c9bd){_0x21c9bd=_0x21c9bd||0xcc;return function(_0x397adc){if(_0x397adc){return _0x3cf00d[_0x90f2('0x2c')](_0x21c9bd);}return _0x3cf00d[_0x90f2('0x2d')](_0x21c9bd)[_0x90f2('0x2e')]();};}function respondWithResult(_0x18ae98,_0x3204c1){_0x3204c1=_0x3204c1||0xc8;return function(_0x1db020){if(_0x1db020){return _0x18ae98[_0x90f2('0x2d')](_0x3204c1)[_0x90f2('0x2f')](_0x1db020);}};}function respondWithFilteredResult(_0x53d5c2,_0x3f3993){return function(_0x16f467){if(_0x16f467){var _0x3b099a=typeof _0x3f3993[_0x90f2('0x30')]===_0x90f2('0x31')&&typeof _0x3f3993[_0x90f2('0x32')]===_0x90f2('0x31');var _0x493c32=_0x16f467[_0x90f2('0x33')];var _0x5241e2=_0x3b099a?0x0:_0x3f3993['offset'];var _0x156e1b=_0x3b099a?_0x16f467[_0x90f2('0x33')]:_0x3f3993[_0x90f2('0x30')]+_0x3f3993[_0x90f2('0x32')];var _0x4129c8;if(_0x156e1b>=_0x493c32){_0x156e1b=_0x493c32;_0x4129c8=0xc8;}else{_0x4129c8=0xce;}_0x53d5c2['status'](_0x4129c8);return _0x53d5c2[_0x90f2('0x34')](_0x90f2('0x35'),_0x5241e2+'-'+_0x156e1b+'/'+_0x493c32)[_0x90f2('0x2f')](_0x16f467);}return null;};}function patchUpdates(_0x5c9f91){return function(_0x265e18){try{jsonpatch['apply'](_0x265e18,_0x5c9f91,!![]);}catch(_0x43d454){return BPromise['reject'](_0x43d454);}return _0x265e18['save']();};}function saveUpdates(_0x2cc980,_0x36e1f7){return function(_0x48954f){if(_0x48954f){return _0x48954f[_0x90f2('0x36')](_0x2cc980)[_0x90f2('0x37')](function(_0x3ea07c){return _0x3ea07c;});}return null;};}function removeEntity(_0x370f37,_0x4828f6){return function(_0x1cff70){if(_0x1cff70){return _0x1cff70[_0x90f2('0x38')]()[_0x90f2('0x37')](function(){var _0x1e0cfe=_0x1cff70[_0x90f2('0x39')]({'plain':!![]});var _0x57380e=_0x90f2('0x3a');return db[_0x90f2('0x3b')][_0x90f2('0x38')]({'where':{'type':_0x57380e,'resourceId':_0x1e0cfe['id']}})[_0x90f2('0x37')](function(){return _0x1cff70;});})['then'](function(){_0x370f37[_0x90f2('0x2d')](0xcc)[_0x90f2('0x2e')]();});}};}function handleEntityNotFound(_0x2ac63b,_0x36c259){return function(_0x1dd2d6){if(!_0x1dd2d6){_0x2ac63b['sendStatus'](0x194);}return _0x1dd2d6;};}function handleError(_0x2ef248,_0x5930d6){_0x5930d6=_0x5930d6||0x1f4;return function(_0x3126f3){logger[_0x90f2('0x28')](_0x3126f3[_0x90f2('0x3c')]);if(_0x3126f3[_0x90f2('0x3d')]){delete _0x3126f3[_0x90f2('0x3d')];}_0x2ef248[_0x90f2('0x2d')](_0x5930d6)['send'](_0x3126f3);};}exports[_0x90f2('0x3e')]=function(_0xe32d7c,_0x9f9339){var _0x1f2447={'include':[{'model':db[_0x90f2('0x3f')],'as':_0x90f2('0x40')}]},_0x3e1fe7={},_0x41b342={'count':0x0,'rows':[]};var _0x2aed42=_[_0x90f2('0x41')](db['OpenchannelAccount'][_0x90f2('0x42')],function(_0x3b29c9){return{'name':_0x3b29c9['fieldName'],'type':_0x3b29c9[_0x90f2('0x43')][_0x90f2('0x44')]};});_0x3e1fe7[_0x90f2('0x45')]=_['map'](_0x2aed42,_0x90f2('0x3d'));_0x3e1fe7[_0x90f2('0x46')]=_['keys'](_0xe32d7c['query']);_0x3e1fe7['filters']=_[_0x90f2('0x47')](_0x3e1fe7[_0x90f2('0x45')],_0x3e1fe7[_0x90f2('0x46')]);_0x1f2447[_0x90f2('0x48')]=_['intersection'](_0x3e1fe7[_0x90f2('0x45')],qs[_0x90f2('0x49')](_0xe32d7c['query'][_0x90f2('0x49')]));_0x1f2447[_0x90f2('0x48')]=_0x1f2447[_0x90f2('0x48')][_0x90f2('0x4a')]?_0x1f2447[_0x90f2('0x48')]:_0x3e1fe7[_0x90f2('0x45')];if(!_0xe32d7c[_0x90f2('0x46')][_0x90f2('0x4b')](_0x90f2('0x4c'))){_0x1f2447['limit']=qs[_0x90f2('0x32')](_0xe32d7c['query'][_0x90f2('0x32')]);_0x1f2447['offset']=qs[_0x90f2('0x30')](_0xe32d7c[_0x90f2('0x46')][_0x90f2('0x30')]);}_0x1f2447[_0x90f2('0x4d')]=qs[_0x90f2('0x4e')](_0xe32d7c[_0x90f2('0x46')]['sort']);_0x1f2447[_0x90f2('0x4f')]=qs[_0x90f2('0x50')](_[_0x90f2('0x51')](_0xe32d7c['query'],_0x3e1fe7['filters']),_0x2aed42);if(_0xe32d7c['query'][_0x90f2('0x52')]){_0x1f2447[_0x90f2('0x4f')]=_[_0x90f2('0x53')](_0x1f2447[_0x90f2('0x4f')],{'$or':_[_0x90f2('0x41')](_0x2aed42,function(_0x5d7c2b){if(_0x5d7c2b['type']!=='VIRTUAL'){var _0x13d2b6={};_0x13d2b6[_0x5d7c2b[_0x90f2('0x3d')]]={'$like':'%'+_0xe32d7c[_0x90f2('0x46')][_0x90f2('0x52')]+'%'};return _0x13d2b6;}})});}_0x1f2447=_[_0x90f2('0x53')]({},_0x1f2447,_0xe32d7c[_0x90f2('0x54')]);var _0x55a288={'where':_0x1f2447['where']};return db[_0x90f2('0x55')][_0x90f2('0x33')](_0x55a288)[_0x90f2('0x37')](function(_0x399bf6){_0x41b342[_0x90f2('0x33')]=_0x399bf6;if(_0xe32d7c['query'][_0x90f2('0x56')]){_0x1f2447[_0x90f2('0x57')]=[{'all':!![]}];}return db[_0x90f2('0x55')][_0x90f2('0x58')](_0x1f2447);})[_0x90f2('0x37')](function(_0x779d3f){_0x41b342[_0x90f2('0x59')]=_0x779d3f;return _0x41b342;})[_0x90f2('0x37')](respondWithFilteredResult(_0x9f9339,_0x1f2447))['catch'](handleError(_0x9f9339,null));};exports[_0x90f2('0x5a')]=function(_0xeddcf9,_0x28c5e4){var _0x4d5d6e={'raw':![],'where':{'id':_0xeddcf9[_0x90f2('0x5b')]['id']},'include':[{'model':db[_0x90f2('0x3f')],'as':_0x90f2('0x40')}]},_0xa5fa63={};_0xa5fa63[_0x90f2('0x45')]=_[_0x90f2('0x5c')](db[_0x90f2('0x55')][_0x90f2('0x42')]);_0xa5fa63[_0x90f2('0x46')]=_[_0x90f2('0x5c')](_0xeddcf9[_0x90f2('0x46')]);_0xa5fa63['filters']=_[_0x90f2('0x47')](_0xa5fa63[_0x90f2('0x45')],_0xa5fa63[_0x90f2('0x46')]);_0x4d5d6e[_0x90f2('0x48')]=_[_0x90f2('0x47')](_0xa5fa63[_0x90f2('0x45')],qs[_0x90f2('0x49')](_0xeddcf9[_0x90f2('0x46')][_0x90f2('0x49')]));_0x4d5d6e[_0x90f2('0x48')]=_0x4d5d6e[_0x90f2('0x48')]['length']?_0x4d5d6e[_0x90f2('0x48')]:_0xa5fa63[_0x90f2('0x45')];if(_0xeddcf9['query']['includeAll']){_0x4d5d6e[_0x90f2('0x57')]=[{'all':!![]}];}_0x4d5d6e=_['merge']({},_0x4d5d6e,_0xeddcf9[_0x90f2('0x54')]);return db['OpenchannelAccount'][_0x90f2('0x5d')](_0x4d5d6e)[_0x90f2('0x37')](handleEntityNotFound(_0x28c5e4,null))[_0x90f2('0x37')](respondWithResult(_0x28c5e4,null))[_0x90f2('0x5e')](handleError(_0x28c5e4,null));};exports[_0x90f2('0x5f')]=function(_0x565544,_0x63ccff){return db['OpenchannelAccount']['create'](_0x565544['body'],{})[_0x90f2('0x37')](function(_0x3ef62f){var _0x457144=_0x565544[_0x90f2('0x60')]['get']({'plain':!![]});if(!_0x457144)throw new Error(_0x90f2('0x61'));if(_0x457144[_0x90f2('0x62')]===_0x90f2('0x60')){var _0x2c9319=_0x3ef62f['get']({'plain':!![]});var _0x43fa0e=_0x90f2('0x3a');return db[_0x90f2('0x63')][_0x90f2('0x5d')]({'where':{'name':_0x43fa0e,'userProfileId':_0x457144['userProfileId']},'raw':!![]})[_0x90f2('0x37')](function(_0x3fe815){if(_0x3fe815&&_0x3fe815['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2c9319[_0x90f2('0x3d')],'resourceId':_0x2c9319['id'],'type':_0x3fe815[_0x90f2('0x3d')],'sectionId':_0x3fe815['id']},{})['then'](function(){return _0x3ef62f;});}else{return _0x3ef62f;}})[_0x90f2('0x5e')](function(_0x45a775){logger[_0x90f2('0x28')](_0x90f2('0x64'),_0x45a775);throw _0x45a775;});}return _0x3ef62f;})[_0x90f2('0x37')](respondWithResult(_0x63ccff,0xc9))['catch'](handleError(_0x63ccff,null));};exports['update']=function(_0x546df2,_0x4cc785){if(_0x546df2[_0x90f2('0x65')]['id']){delete _0x546df2[_0x90f2('0x65')]['id'];}return db[_0x90f2('0x55')][_0x90f2('0x5d')]({'where':{'id':_0x546df2[_0x90f2('0x5b')]['id']},'include':[{'model':db[_0x90f2('0x3f')],'as':_0x90f2('0x40')}]})[_0x90f2('0x37')](handleEntityNotFound(_0x4cc785,null))[_0x90f2('0x37')](saveUpdates(_0x546df2[_0x90f2('0x65')],null))[_0x90f2('0x37')](respondWithResult(_0x4cc785,null))[_0x90f2('0x5e')](handleError(_0x4cc785,null));};exports[_0x90f2('0x38')]=function(_0x4e18cb,_0x38ab2e){return db[_0x90f2('0x55')][_0x90f2('0x5d')]({'where':{'id':_0x4e18cb[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x38ab2e,null))[_0x90f2('0x37')](removeEntity(_0x38ab2e,null))[_0x90f2('0x5e')](handleError(_0x38ab2e,null));};exports[_0x90f2('0x66')]=function(_0x3fa9f2,_0x43cd89){return db[_0x90f2('0x55')][_0x90f2('0x66')]()[_0x90f2('0x37')](respondWithResult(_0x43cd89,null))['catch'](handleError(_0x43cd89,null));};exports[_0x90f2('0x67')]=function(_0x352ef8,_0x289532,_0x271adb){if(_0x352ef8[_0x90f2('0x65')]['id']){delete _0x352ef8[_0x90f2('0x65')]['id'];}return db[_0x90f2('0x55')][_0x90f2('0x5d')]({'where':{'id':_0x352ef8[_0x90f2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x289532,null))[_0x90f2('0x37')](function(_0x5746d7){if(_0x5746d7){_0x352ef8[_0x90f2('0x65')][_0x90f2('0x68')]=_0x5746d7['id'];return db[_0x90f2('0x69')]['create'](_0x352ef8[_0x90f2('0x65')]);}})[_0x90f2('0x37')](respondWithResult(_0x289532,null))[_0x90f2('0x5e')](handleError(_0x289532,null));};exports[_0x90f2('0x6a')]=function(_0x2ab5d5,_0x49bd76,_0x7de98e){var _0x18cbac={'raw':![],'where':{}};var _0x41732a={};var _0x3143e6={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x90f2('0x6b')]({'where':{'id':_0x2ab5d5[_0x90f2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x49bd76,null))[_0x90f2('0x37')](function(_0x18f499){if(_0x18f499){_0x41732a[_0x90f2('0x45')]=_[_0x90f2('0x5c')](db[_0x90f2('0x69')]['rawAttributes']);_0x41732a[_0x90f2('0x46')]=_['keys'](_0x2ab5d5[_0x90f2('0x46')]);_0x41732a[_0x90f2('0x50')]=_[_0x90f2('0x47')](_0x41732a[_0x90f2('0x45')],_0x41732a[_0x90f2('0x46')]);_0x18cbac[_0x90f2('0x48')]=_[_0x90f2('0x47')](_0x41732a['model'],qs[_0x90f2('0x49')](_0x2ab5d5[_0x90f2('0x46')][_0x90f2('0x49')]));_0x18cbac[_0x90f2('0x48')]=_0x18cbac[_0x90f2('0x48')]['length']?_0x18cbac[_0x90f2('0x48')]:_0x41732a['model'];if(!_0x2ab5d5[_0x90f2('0x46')]['hasOwnProperty'](_0x90f2('0x4c'))){_0x18cbac['limit']=qs[_0x90f2('0x32')](_0x2ab5d5[_0x90f2('0x46')][_0x90f2('0x32')]);_0x18cbac[_0x90f2('0x30')]=qs[_0x90f2('0x30')](_0x2ab5d5[_0x90f2('0x46')][_0x90f2('0x30')]);}_0x18cbac[_0x90f2('0x4d')]=qs[_0x90f2('0x4e')](_0x2ab5d5[_0x90f2('0x46')]['sort']);_0x18cbac[_0x90f2('0x4f')]=qs[_0x90f2('0x50')](_[_0x90f2('0x51')](_0x2ab5d5['query'],_0x41732a[_0x90f2('0x50')]));_0x18cbac[_0x90f2('0x4f')][_0x90f2('0x68')]=_0x18f499['id'];if(_0x2ab5d5['query'][_0x90f2('0x52')]){_0x18cbac[_0x90f2('0x4f')]=_[_0x90f2('0x53')](_0x18cbac[_0x90f2('0x4f')],{'$or':_[_0x90f2('0x41')](_0x18cbac['attributes'],function(_0x4f2409){var _0x2e10ec={};_0x2e10ec[_0x4f2409]={'$like':'%'+_0x2ab5d5['query'][_0x90f2('0x52')]+'%'};return _0x2e10ec;})});}_0x18cbac=_['merge']({},_0x18cbac,_0x2ab5d5[_0x90f2('0x54')]);return db[_0x90f2('0x69')][_0x90f2('0x33')]({'where':_0x18cbac['where']})['then'](function(_0x117b8a){_0x3143e6[_0x90f2('0x33')]=_0x117b8a;if(_0x2ab5d5[_0x90f2('0x46')][_0x90f2('0x56')]){_0x18cbac[_0x90f2('0x57')]=[{'all':!![]}];}return db[_0x90f2('0x69')][_0x90f2('0x58')](_0x18cbac);})[_0x90f2('0x37')](function(_0xefc27f){_0x3143e6[_0x90f2('0x59')]=_0xefc27f;return _0x3143e6;});}})[_0x90f2('0x37')](respondWithFilteredResult(_0x49bd76,_0x18cbac))['catch'](handleError(_0x49bd76,null));};exports[_0x90f2('0x6c')]=function(_0x3a3734,_0x161940,_0x316396){return db[_0x90f2('0x55')][_0x90f2('0x5d')]({'where':{'id':_0x3a3734[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x161940,null))['then'](function(_0x429273){if(_0x429273){return _0x429273[_0x90f2('0x6c')](_0x3a3734[_0x90f2('0x46')][_0x90f2('0x6d')]);}})['then'](respondWithStatusCode(_0x161940,null))['catch'](handleError(_0x161940,null));};exports[_0x90f2('0x6e')]=function(_0x2a1c93,_0x3b1078,_0x581a28){if(_0x2a1c93[_0x90f2('0x65')]['id']){delete _0x2a1c93[_0x90f2('0x65')]['id'];}return db[_0x90f2('0x55')]['find']({'where':{'id':_0x2a1c93[_0x90f2('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b1078,null))['then'](function(_0x5a90e7){if(_0x5a90e7){_0x2a1c93[_0x90f2('0x65')][_0x90f2('0x68')]=_0x5a90e7['id'];return db[_0x90f2('0x6f')]['create'](_0x2a1c93['body']);}})[_0x90f2('0x37')](respondWithResult(_0x3b1078,null))[_0x90f2('0x5e')](handleError(_0x3b1078,null));};exports[_0x90f2('0x70')]=function(_0x5eeba1,_0x471818,_0x1c2581){var _0xbedc8f={'raw':![],'where':{}};var _0x3af64d={};var _0x4dee2c={'count':0x0,'rows':[]};return db[_0x90f2('0x55')][_0x90f2('0x6b')]({'where':{'id':_0x5eeba1[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x471818,null))[_0x90f2('0x37')](function(_0x6a7037){if(_0x6a7037){_0x3af64d[_0x90f2('0x45')]=_['keys'](db[_0x90f2('0x6f')][_0x90f2('0x42')]);_0x3af64d[_0x90f2('0x46')]=_[_0x90f2('0x5c')](_0x5eeba1['query']);_0x3af64d[_0x90f2('0x50')]=_['intersection'](_0x3af64d[_0x90f2('0x45')],_0x3af64d[_0x90f2('0x46')]);_0xbedc8f['attributes']=_[_0x90f2('0x47')](_0x3af64d[_0x90f2('0x45')],qs['fields'](_0x5eeba1[_0x90f2('0x46')][_0x90f2('0x49')]));_0xbedc8f[_0x90f2('0x48')]=_0xbedc8f[_0x90f2('0x48')][_0x90f2('0x4a')]?_0xbedc8f[_0x90f2('0x48')]:_0x3af64d[_0x90f2('0x45')];if(!_0x5eeba1[_0x90f2('0x46')][_0x90f2('0x4b')](_0x90f2('0x4c'))){_0xbedc8f['limit']=qs[_0x90f2('0x32')](_0x5eeba1[_0x90f2('0x46')][_0x90f2('0x32')]);_0xbedc8f[_0x90f2('0x30')]=qs['offset'](_0x5eeba1[_0x90f2('0x46')]['offset']);}_0xbedc8f['order']=qs['sort'](_0x5eeba1[_0x90f2('0x46')][_0x90f2('0x4e')]);_0xbedc8f[_0x90f2('0x4f')]=qs[_0x90f2('0x50')](_[_0x90f2('0x51')](_0x5eeba1[_0x90f2('0x46')],_0x3af64d[_0x90f2('0x50')]));_0xbedc8f[_0x90f2('0x4f')][_0x90f2('0x68')]=_0x6a7037['id'];if(_0x5eeba1[_0x90f2('0x46')][_0x90f2('0x52')]){_0xbedc8f[_0x90f2('0x4f')]=_[_0x90f2('0x53')](_0xbedc8f[_0x90f2('0x4f')],{'$or':_[_0x90f2('0x41')](_0xbedc8f[_0x90f2('0x48')],function(_0x1037ae){var _0x2b3c6d={};_0x2b3c6d[_0x1037ae]={'$like':'%'+_0x5eeba1['query'][_0x90f2('0x52')]+'%'};return _0x2b3c6d;})});}_0xbedc8f=_[_0x90f2('0x53')]({},_0xbedc8f,_0x5eeba1[_0x90f2('0x54')]);return db[_0x90f2('0x6f')][_0x90f2('0x33')]({'where':_0xbedc8f['where']})['then'](function(_0x597cb4){_0x4dee2c['count']=_0x597cb4;if(_0x5eeba1[_0x90f2('0x46')][_0x90f2('0x56')]){_0xbedc8f['include']=[{'all':!![]}];}return db[_0x90f2('0x6f')][_0x90f2('0x58')](_0xbedc8f);})['then'](function(_0x106b06){_0x4dee2c[_0x90f2('0x59')]=_0x106b06;return _0x4dee2c;});}})['then'](respondWithFilteredResult(_0x471818,_0xbedc8f))[_0x90f2('0x5e')](handleError(_0x471818,null));};exports[_0x90f2('0x71')]=function(_0x237f44,_0x40bbd0,_0x4fac74){return db['OpenchannelAccount'][_0x90f2('0x5d')]({'where':{'id':_0x237f44[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x40bbd0,null))['then'](function(_0x43f9db){if(_0x43f9db){return _0x43f9db['removeAnswers'](_0x237f44[_0x90f2('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x40bbd0,null))[_0x90f2('0x5e')](handleError(_0x40bbd0,null));};exports[_0x90f2('0x72')]=function(_0x2cb6b6,_0x96a403,_0x43a88b){var _0x2c1ad3={'body':_0x2cb6b6[_0x90f2('0x65')],'channel':_0x90f2('0x73')};var _0x5148a8=[];var _0x9d114a=[];var _0x49d209={};var _0x5ebba5=![];return db[_0x90f2('0x74')][_0x90f2('0x66')]()[_0x90f2('0x37')](function(_0x31d40f){if(!_0x31d40f){throw new db[(_0x90f2('0x75'))][(_0x90f2('0x76'))](_0x90f2('0x77'));}_0x5148a8=_['difference'](_['keys'](_0x31d40f),[_0x90f2('0x78'),_0x90f2('0x79')]);_0x9d114a=_[_0x90f2('0x7a')](_[_0x90f2('0x5c')](_0x31d40f),['createdAt',_0x90f2('0x79'),_0x90f2('0x7b'),_0x90f2('0x7c')]);if(_0x2cb6b6['body']['id']){delete _0x2cb6b6[_0x90f2('0x65')]['id'];}if(_[_0x90f2('0x7d')](_0x2cb6b6['body']['from'])){throw new db[(_0x90f2('0x75'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x65')])||_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x65')]===''){throw new db['Sequelize'][(_0x90f2('0x76'))](_0x90f2('0x7e'));}if(_[_0x90f2('0x7d')](_0x2cb6b6['body'][_0x90f2('0x7f')])){throw new db['Sequelize'][(_0x90f2('0x76'))](_0x90f2('0x80')+_0x9d114a);}if(!_[_0x90f2('0x81')](_0x9d114a,_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x7f')])){throw new db[(_0x90f2('0x75'))][(_0x90f2('0x76'))](_0x90f2('0x82')+_0x9d114a);}_0x49d209[_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x7f')]]=_0x2cb6b6['body'][_0x90f2('0x83')];})[_0x90f2('0x37')](function(){return db[_0x90f2('0x55')]['find']({'where':{'id':_0x2cb6b6['params']['id']},'include':[{'model':db[_0x90f2('0x84')],'as':_0x90f2('0x85'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x49d209,'limit':0x1,'order':[[_0x90f2('0x79'),_0x90f2('0x86')]]}]},{'model':db['OpenchannelApplication'],'as':_0x90f2('0x87')}]});})[_0x90f2('0x37')](handleEntityNotFound(_0x96a403,null))[_0x90f2('0x37')](function(_0x2bd5de){if(_0x2bd5de&&_0x2bd5de[_0x90f2('0x85')]){_0x2c1ad3[_0x90f2('0x88')]=_0x2bd5de;_0x2c1ad3[_0x90f2('0x89')]=_0x2bd5de[_0x90f2('0x87')];_0x2c1ad3[_0x90f2('0x8a')]=_0x2bd5de[_0x90f2('0x85')];_0x2c1ad3[_0x90f2('0x89')]=_[_0x90f2('0x8b')](_0x2c1ad3[_0x90f2('0x89')],[_0x90f2('0x8c')],['asc']);if(_0x2c1ad3[_0x90f2('0x88')][_0x90f2('0x87')]){delete _0x2c1ad3[_0x90f2('0x88')]['Applications'];}if(_0x2c1ad3['account'][_0x90f2('0x85')]&&_0x2c1ad3[_0x90f2('0x88')]['List']['Contacts'][_0x90f2('0x4a')]){return _0x2c1ad3[_0x90f2('0x88')][_0x90f2('0x85')][_0x90f2('0x8d')][0x0];}var _0x28d56d=_[_0x90f2('0x1b')](_0x2cb6b6['body'],{'firstName':_0x2cb6b6['body'][_0x90f2('0x83')],'ListId':_0x2bd5de['ListId']});_0x28d56d[_0x2cb6b6['body'][_0x90f2('0x7f')]]=_0x2cb6b6[_0x90f2('0x65')]['from'];return db[_0x90f2('0x74')][_0x90f2('0x5f')](_0x28d56d,{'fields':_0x5148a8,'raw':!![]});}})[_0x90f2('0x37')](handleEntityNotFound(_0x96a403,null))['then'](function(_0x45d747){_0x2c1ad3['contact']=_0x45d747;if(_0x45d747){var _0x541661={'ContactId':_0x45d747['id'],'OpenchannelAccountId':_0x2cb6b6[_0x90f2('0x5b')]['id'],'from':(_0x45d747[_0x90f2('0x8e')]||'')+'\x20'+(_0x45d747['lastName']||'')};var _0x42f5bc={'OpenchannelAccountId':_0x2cb6b6['params']['id'],'closed':![]};if(_0x2cb6b6[_0x90f2('0x65')]['threadId']){_0x42f5bc[_0x90f2('0x8f')]=_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x8f')];return db['OpenchannelInteraction'][_0x90f2('0x5d')]({'where':_0x42f5bc})['then'](function(_0x4072f1){if(_0x4072f1){return[_0x4072f1,![]];}_0x541661['threadId']=_0x2cb6b6[_0x90f2('0x65')]['threadId'];_0x541661[_0x90f2('0x90')]=_0x2cb6b6['body'][_0x90f2('0x90')];return db[_0x90f2('0x91')][_0x90f2('0x5f')](_0x541661)[_0x90f2('0x37')](function(_0x2fb4d9){return[_0x2fb4d9,!![]];});});}else{_0x42f5bc[_0x90f2('0x8f')]=null;}_0x42f5bc[_0x90f2('0x92')]=_0x45d747['id'];return db['OpenchannelInteraction'][_0x90f2('0x5d')]({'where':_0x42f5bc})[_0x90f2('0x37')](function(_0x1dbeae){if(_0x1dbeae){return[_0x1dbeae,![]];}return db[_0x90f2('0x91')]['create'](_0x541661)[_0x90f2('0x37')](function(_0x2a9c58){return[_0x2a9c58,!![]];});});}})[_0x90f2('0x93')](function(_0x45e31e,_0x2599e5){if(_0x45e31e){_0x5ebba5=_0x2599e5;if(!_0x2599e5){var _0x35a521={'from':(_0x2c1ad3['contact']['firstName']||'')+'\x20'+(_0x2c1ad3[_0x90f2('0x94')]['lastName']||'')};if(_0x2cb6b6[_0x90f2('0x65')]['threadId']&&_0x2cb6b6[_0x90f2('0x65')]['messageId']&&_0x2cb6b6[_0x90f2('0x65')]['threadId']!=_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x95')]){_0x35a521[_0x90f2('0x8f')]=_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x95')];}return _0x45e31e[_0x90f2('0x36')](_0x35a521);}else{return _0x45e31e;}}})[_0x90f2('0x37')](function(_0x563030){_0x2c1ad3[_0x90f2('0x96')]=_0x563030[_0x90f2('0x39')]({'plain':!![]});_0x2c1ad3[_0x90f2('0x96')][_0x90f2('0x97')]=_0x5ebba5;if(_0x2c1ad3[_0x90f2('0x96')]['created']){if(_0x2c1ad3[_0x90f2('0x88')][_0x90f2('0x98')]){_0x2c1ad3[_0x90f2('0x89')][_0x90f2('0x99')]({'id':0x0,'priority':_0x2c1ad3[_0x90f2('0x89')]['length']+0x1,'app':_0x90f2('0x9a'),'appdata':_0x90f2('0x9b'),'interval':_0x90f2('0x9c')});}}return db['OpenchannelMessage'][_0x90f2('0x5f')]({'body':_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x65')],'OpenchannelAccountId':_0x2cb6b6[_0x90f2('0x5b')]['id'],'OpenchannelInteractionId':_0x563030['id'],'direction':'in','ContactId':_0x2c1ad3[_0x90f2('0x94')]['id'],'AttachmentId':_0x2cb6b6[_0x90f2('0x65')][_0x90f2('0x9d')]});})['then'](function(_0x55d6c0){_0x2c1ad3[_0x90f2('0x2a')]=_0x55d6c0;if(_0x2c1ad3[_0x90f2('0x96')][_0x90f2('0x9e')]){return db['User'][_0x90f2('0x5d')]({'attributes':['id',_0x90f2('0x3d')],'where':{'id':_0x2c1ad3[_0x90f2('0x96')][_0x90f2('0x9e')]}})['then'](function(_0x19d3dc){if(_0x19d3dc){_0x2c1ad3[_0x90f2('0x89')][_0x90f2('0x9f')]({'id':0x0,'priority':0x0,'app':_0x90f2('0xa0'),'appdata':_0x19d3dc[_0x90f2('0x3d')]+','+(_0x2c1ad3['account'][_0x90f2('0xa1')]||0xa),'interval':_0x90f2('0x9c')});_0x2c1ad3[_0x90f2('0xa2')]=![];}return respondWithRpcPromise('Start',_0x90f2('0xa3'),_0x2c1ad3);});}return respondWithRpcPromise('Start',_0x90f2('0xa3'),_0x2c1ad3);})[_0x90f2('0x37')](function(_0x32b8fd){respondWithRpcPromise(_0x90f2('0xa4'),_0x90f2('0xa4'),{'event':_0x90f2('0x72'),'message':_0x32b8fd},client9002);return _0x32b8fd;})['then'](respondWithResult(_0x96a403,null))[_0x90f2('0x5e')](handleError(_0x96a403,null));};exports[_0x90f2('0xa5')]=function(_0x484f59,_0x10c3a2,_0x11df0e){return db[_0x90f2('0x55')][_0x90f2('0x6b')]({'where':{'id':_0x484f59[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x10c3a2,null))[_0x90f2('0x37')](function(_0x47c611){if(_0x47c611){return db[_0x90f2('0xa6')][_0x90f2('0xa7')](function(_0x3f55df){return db[_0x90f2('0xa8')][_0x90f2('0x38')]({'where':{'OpenchannelAccountId':_0x484f59[_0x90f2('0x5b')]['id']},'transaction':_0x3f55df})['then'](function(_0x4f1437){var _0x580b4e=_[_0x90f2('0x41')](_0x484f59[_0x90f2('0x65')],function(_0x122069){_0x122069[_0x90f2('0x68')]=_0x484f59[_0x90f2('0x5b')]['id'];return _0x122069;});return db[_0x90f2('0xa8')]['bulkCreate'](_0x580b4e,{'transaction':_0x3f55df});});})[_0x90f2('0x37')](function(){return db['OpenchannelApplication'][_0x90f2('0xa9')]({'where':{'OpenchannelAccountId':_0x484f59['params']['id']},'order':_0x90f2('0x8c')});});}})[_0x90f2('0x37')](respondWithResult(_0x10c3a2,null))[_0x90f2('0x5e')](handleError(_0x10c3a2,null));};exports[_0x90f2('0xaa')]=function(_0x3c1eab,_0x23454c,_0x4d1f87){var _0x9a8626={};var _0x399d1c={};var _0x3f63af;var _0x211e14;return db[_0x90f2('0x55')][_0x90f2('0x6b')]({'where':{'id':_0x3c1eab[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x23454c,null))['then'](function(_0x18adc5){if(_0x18adc5){_0x3f63af=_0x18adc5;_0x399d1c[_0x90f2('0x45')]=_['keys'](db[_0x90f2('0xa8')][_0x90f2('0x42')]);_0x399d1c[_0x90f2('0x46')]=_['keys'](_0x3c1eab[_0x90f2('0x46')]);_0x399d1c[_0x90f2('0x50')]=_['intersection'](_0x399d1c['model'],_0x399d1c[_0x90f2('0x46')]);_0x9a8626[_0x90f2('0x48')]=_['intersection'](_0x399d1c[_0x90f2('0x45')],qs[_0x90f2('0x49')](_0x3c1eab[_0x90f2('0x46')][_0x90f2('0x49')]));_0x9a8626[_0x90f2('0x48')]=_0x9a8626[_0x90f2('0x48')]['length']?_0x9a8626[_0x90f2('0x48')]:_0x399d1c[_0x90f2('0x45')];_0x9a8626[_0x90f2('0x4d')]=qs[_0x90f2('0x4e')](_0x3c1eab[_0x90f2('0x46')][_0x90f2('0x4e')]);_0x9a8626[_0x90f2('0x4f')]=qs[_0x90f2('0x50')](_['pick'](_0x3c1eab[_0x90f2('0x46')],_0x399d1c[_0x90f2('0x50')]));if(_0x3c1eab[_0x90f2('0x46')]['filter']){_0x9a8626[_0x90f2('0x4f')]=_[_0x90f2('0x53')](_0x9a8626[_0x90f2('0x4f')],{'$or':_[_0x90f2('0x41')](_0x9a8626[_0x90f2('0x48')],function(_0x52f87){var _0xe16eb={};_0xe16eb[_0x52f87]={'$like':'%'+_0x3c1eab[_0x90f2('0x46')]['filter']+'%'};return _0xe16eb;})});}_0x9a8626=_[_0x90f2('0x53')]({},_0x9a8626,_0x3c1eab[_0x90f2('0x54')]);return _0x3f63af['getApplications'](_0x9a8626);}})[_0x90f2('0x37')](function(_0x296fd9){if(_0x296fd9){_0x211e14=_0x296fd9[_0x90f2('0x4a')];if(!_0x3c1eab['query'][_0x90f2('0x4b')](_0x90f2('0x4c'))){_0x9a8626[_0x90f2('0x32')]=qs[_0x90f2('0x32')](_0x3c1eab[_0x90f2('0x46')][_0x90f2('0x32')]);_0x9a8626[_0x90f2('0x30')]=qs[_0x90f2('0x30')](_0x3c1eab[_0x90f2('0x46')][_0x90f2('0x30')]);}return _0x3f63af[_0x90f2('0xaa')](_0x9a8626);}})[_0x90f2('0x37')](function(_0x3f475c){if(_0x3f475c){return _0x3f475c?{'count':_0x211e14,'rows':_0x3f475c}:null;}})[_0x90f2('0x37')](respondWithResult(_0x23454c,null))['catch'](handleError(_0x23454c,null));};exports[_0x90f2('0xab')]=function(_0x1ee3c2,_0x3951b7,_0x42518a){var _0x1ef824={'raw':![],'where':{}};var _0x2ac62b={};var _0x20b27f={'count':0x0,'rows':[]};return db[_0x90f2('0x55')][_0x90f2('0x6b')]({'where':{'id':_0x1ee3c2[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x3951b7,null))[_0x90f2('0x37')](function(_0x15965e){if(_0x15965e){_0x2ac62b[_0x90f2('0x45')]=_['keys'](db[_0x90f2('0x91')]['rawAttributes']);_0x2ac62b['query']=_[_0x90f2('0x5c')](_0x1ee3c2['query']);_0x2ac62b[_0x90f2('0x50')]=_[_0x90f2('0x47')](_0x2ac62b[_0x90f2('0x45')],_0x2ac62b[_0x90f2('0x46')]);_0x1ef824[_0x90f2('0x48')]=_[_0x90f2('0x47')](_0x2ac62b['model'],qs[_0x90f2('0x49')](_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0x49')]));_0x1ef824[_0x90f2('0x48')]=_0x1ef824[_0x90f2('0x48')]['length']?_0x1ef824['attributes']:_0x2ac62b[_0x90f2('0x45')];if(!_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0x4b')](_0x90f2('0x4c'))){_0x1ef824['limit']=qs['limit'](_0x1ee3c2['query']['limit']);_0x1ef824[_0x90f2('0x30')]=qs[_0x90f2('0x30')](_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0x30')]);}_0x1ef824[_0x90f2('0x4d')]=qs['sort'](_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0x4e')]);_0x1ef824[_0x90f2('0x4f')]=qs[_0x90f2('0x50')](_[_0x90f2('0x51')](_0x1ee3c2[_0x90f2('0x46')],_0x2ac62b[_0x90f2('0x50')]));_0x1ef824[_0x90f2('0x4f')][_0x90f2('0x68')]=_0x15965e['id'];if(_0x1ee3c2[_0x90f2('0x46')]['filter']){_0x1ef824[_0x90f2('0x4f')]=_[_0x90f2('0x53')](_0x1ef824[_0x90f2('0x4f')],{'$or':_['map'](_0x1ef824[_0x90f2('0x48')],function(_0x56fdf4){var _0x2edad4={};_0x2edad4[_0x56fdf4]={'$like':'%'+_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0x52')]+'%'};return _0x2edad4;})});}_0x1ef824=_[_0x90f2('0x53')]({},_0x1ef824,_0x1ee3c2[_0x90f2('0x54')]);return db[_0x90f2('0x91')][_0x90f2('0x33')]({'where':_0x1ef824[_0x90f2('0x4f')]})[_0x90f2('0x37')](function(_0x837ab0){_0x20b27f[_0x90f2('0x33')]=_0x837ab0;if(_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0x56')]){_0x1ef824[_0x90f2('0x57')]=[{'model':db['CmContact'],'as':_0x90f2('0xac'),'required':![]},{'model':db[_0x90f2('0xad')],'as':_0x90f2('0xae'),'attributes':[_0x90f2('0x3d'),_0x90f2('0xaf'),_0x90f2('0xb0')],'required':![]},{'model':db[_0x90f2('0xb1')],'as':_0x90f2('0xb2'),'attributes':['id',_0x90f2('0x3d'),_0x90f2('0xb3')],'where':_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0xb4')]?{'id':_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0xb4')]}:undefined,'required':_0x1ee3c2[_0x90f2('0x46')][_0x90f2('0xb4')]?!![]:![]}];}return db[_0x90f2('0x91')]['findAll'](_0x1ef824);})['then'](function(_0x2936b9){_0x20b27f[_0x90f2('0x59')]=_0x2936b9;return _0x20b27f;});}})[_0x90f2('0x37')](respondWithFilteredResult(_0x3951b7,_0x1ef824))[_0x90f2('0x5e')](handleError(_0x3951b7,null));};exports[_0x90f2('0xb5')]=function(_0x5644f4,_0x3ac708,_0xf5cb28){return db['OpenchannelAccount']['find']({'where':{'id':_0x5644f4[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x3ac708,null))[_0x90f2('0x37')](function(_0x5d83c2){if(_0x5d83c2){return _0x5d83c2['addAgents'](_0x5644f4['body']['ids'],_['omit'](_0x5644f4[_0x90f2('0x65')],[_0x90f2('0x6d'),'id'])||{})[_0x90f2('0x93')](function(_0x13666f){for(var _0x153bb3=0x0;_0x153bb3<_0x5644f4[_0x90f2('0x65')][_0x90f2('0x6d')][_0x90f2('0x4a')];_0x153bb3+=0x1){socket[_0x90f2('0xb6')]('userOpenchannelAccount:save',{'UserId':Number(_0x5644f4['body'][_0x90f2('0x6d')][_0x153bb3]),'OpenchannelAccountId':Number(_0x5644f4[_0x90f2('0x5b')]['id'])});}return _0x13666f;});}})[_0x90f2('0x37')](respondWithResult(_0x3ac708,null))['catch'](handleError(_0x3ac708,null));};exports[_0x90f2('0xb7')]=function(_0x1e0a8d,_0x350d65,_0x5270a2){return db[_0x90f2('0x55')][_0x90f2('0x5d')]({'where':{'id':_0x1e0a8d['params']['id']}})['then'](handleEntityNotFound(_0x350d65,null))[_0x90f2('0x37')](function(_0x4d3eb5){if(_0x4d3eb5){return _0x4d3eb5[_0x90f2('0xb7')](_0x1e0a8d[_0x90f2('0x46')][_0x90f2('0x6d')])[_0x90f2('0x37')](function(){if(_[_0x90f2('0xb8')](_0x1e0a8d[_0x90f2('0x46')][_0x90f2('0x6d')])){for(var _0x4fb6e7=0x0;_0x4fb6e7<_0x1e0a8d[_0x90f2('0x46')]['ids'][_0x90f2('0x4a')];_0x4fb6e7+=0x1){socket['emit'](_0x90f2('0xb9'),{'UserId':Number(_0x1e0a8d[_0x90f2('0x46')]['ids'][_0x4fb6e7]),'OpenchannelAccountId':Number(_0x1e0a8d[_0x90f2('0x5b')]['id'])});}}else{socket[_0x90f2('0xb6')](_0x90f2('0xb9'),{'UserId':Number(_0x1e0a8d['query'][_0x90f2('0x6d')]),'OpenchannelAccountId':Number(_0x1e0a8d['params']['id'])});}});}})[_0x90f2('0x37')](respondWithStatusCode(_0x350d65,null))[_0x90f2('0x5e')](handleError(_0x350d65,null));};exports[_0x90f2('0xba')]=function(_0x4d93c2,_0x2edd4f,_0x503634){var _0x4d1c0a={};var _0x41755f={};var _0x4f841f;var _0x2ef42b;return db['OpenchannelAccount'][_0x90f2('0x6b')]({'where':{'id':_0x4d93c2[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x2edd4f,null))[_0x90f2('0x37')](function(_0x19ee07){if(_0x19ee07){_0x4f841f=_0x19ee07;_0x41755f[_0x90f2('0x45')]=_['keys'](db['User'][_0x90f2('0x42')]);_0x41755f['query']=_['keys'](_0x4d93c2[_0x90f2('0x46')]);_0x41755f['filters']=_[_0x90f2('0x47')](_0x41755f[_0x90f2('0x45')],_0x41755f[_0x90f2('0x46')]);_0x4d1c0a['attributes']=_['intersection'](_0x41755f[_0x90f2('0x45')],qs['fields'](_0x4d93c2[_0x90f2('0x46')][_0x90f2('0x49')]));_0x4d1c0a[_0x90f2('0x48')]=_0x4d1c0a[_0x90f2('0x48')][_0x90f2('0x4a')]?_0x4d1c0a[_0x90f2('0x48')]:_0x41755f['model'];_0x4d1c0a[_0x90f2('0x4d')]=qs[_0x90f2('0x4e')](_0x4d93c2['query'][_0x90f2('0x4e')]);_0x4d1c0a[_0x90f2('0x4f')]=qs[_0x90f2('0x50')](_[_0x90f2('0x51')](_0x4d93c2[_0x90f2('0x46')],_0x41755f['filters']));if(_0x4d93c2[_0x90f2('0x46')][_0x90f2('0x52')]){_0x4d1c0a[_0x90f2('0x4f')]=_[_0x90f2('0x53')](_0x4d1c0a[_0x90f2('0x4f')],{'$or':_[_0x90f2('0x41')](_0x4d1c0a['attributes'],function(_0xf9ba8d){var _0x2a22d2={};_0x2a22d2[_0xf9ba8d]={'$like':'%'+_0x4d93c2[_0x90f2('0x46')][_0x90f2('0x52')]+'%'};return _0x2a22d2;})});}_0x4d1c0a=_[_0x90f2('0x53')]({},_0x4d1c0a,_0x4d93c2[_0x90f2('0x54')]);return _0x4f841f[_0x90f2('0xba')](_0x4d1c0a);}})[_0x90f2('0x37')](function(_0x1f4e29){if(_0x1f4e29){_0x2ef42b=_0x1f4e29['length'];if(!_0x4d93c2['query'][_0x90f2('0x4b')](_0x90f2('0x4c'))){_0x4d1c0a[_0x90f2('0x32')]=qs['limit'](_0x4d93c2[_0x90f2('0x46')][_0x90f2('0x32')]);_0x4d1c0a[_0x90f2('0x30')]=qs[_0x90f2('0x30')](_0x4d93c2[_0x90f2('0x46')][_0x90f2('0x30')]);}return _0x4f841f[_0x90f2('0xba')](_0x4d1c0a);}})['then'](function(_0x3cd60a){if(_0x3cd60a){return _0x3cd60a?{'count':_0x2ef42b,'rows':_0x3cd60a}:null;}})['then'](respondWithResult(_0x2edd4f,null))[_0x90f2('0x5e')](handleError(_0x2edd4f,null));};exports[_0x90f2('0xbb')]=function(_0x614001,_0x5dd5e,_0x28be3d){var _0x4550bb,_0x1cfa8f,_0x1d29ec;if(_[_0x90f2('0x7d')](_0x614001[_0x90f2('0x65')][_0x90f2('0x65')])||_0x614001['body'][_0x90f2('0x65')]===''){throw new db[(_0x90f2('0x75'))][(_0x90f2('0x76'))](_0x90f2('0x7e'));}if(_[_0x90f2('0x7d')](_0x614001[_0x90f2('0x65')]['to'])){}_0x4550bb=_0x614001[_0x90f2('0x65')]['to'];return db[_0x90f2('0x55')][_0x90f2('0x6b')]({'where':{'id':_0x614001[_0x90f2('0x5b')]['id']}})[_0x90f2('0x37')](handleEntityNotFound(_0x5dd5e,null))[_0x90f2('0x37')](function(_0x1a9658){if(_0x1a9658){return db[_0x90f2('0x55')][_0x90f2('0x5d')]({'where':{'id':_0x1a9658['id']},'include':[{'model':db['CmList'],'as':_0x90f2('0x85'),'include':[{'model':db[_0x90f2('0x74')],'as':_0x90f2('0x8d'),'where':{[_0x1a9658['mapKey']]:_0x4550bb},'limit':0x1,'order':[[_0x90f2('0x79'),_0x90f2('0x86')]]}]}]})['then'](handleEntityNotFound(_0x5dd5e,null))['then'](function(_0x30d427){if(_0x30d427&&_0x30d427['List']){_0x1cfa8f=_0x30d427[_0x90f2('0x39')]({'plain':!![]});if(_0x1cfa8f[_0x90f2('0x85')]&&_0x1cfa8f[_0x90f2('0x85')][_0x90f2('0x8d')][_0x90f2('0x4a')]){return _0x1cfa8f[_0x90f2('0x85')][_0x90f2('0x8d')][0x0];}return db[_0x90f2('0x74')][_0x90f2('0x5f')](_[_0x90f2('0x1b')](_0x614001['body'],{'firstName':_0x4550bb,[_0x30d427[_0x90f2('0x7f')]]:_0x4550bb,'phone':_0x4550bb,'ListId':_0x1cfa8f[_0x90f2('0x7c')]}));}})[_0x90f2('0x37')](handleEntityNotFound(_0x5dd5e,null))[_0x90f2('0x37')](function(_0x34f310){if(_0x34f310){_0x1d29ec=_0x34f310;return db[_0x90f2('0x91')][_0x90f2('0x5d')]({'where':{'ContactId':_0x1d29ec['id'],'closed':![],'OpenchannelAccountId':_0x1cfa8f['id']}})['then'](function(_0x5dac02){if(_0x5dac02){return[_0x5dac02,![]];}return db[_0x90f2('0x91')]['create']({'UserId':_0x614001[_0x90f2('0x60')]['id'],'ContactId':_0x1d29ec['id'],'OpenchannelAccountId':_0x1cfa8f['id'],'lastMsgDirection':_0x90f2('0xbc'),'Messages':[_[_0x90f2('0x53')](_0x614001['body'],{'read':![],'body':_0x614001[_0x90f2('0x65')][_0x90f2('0x65')],'OpenchannelAccountId':_0x1cfa8f['id'],'UserId':_0x614001[_0x90f2('0x60')]['id'],'ContactId':_0x1d29ec['id']})]},{'include':[{'model':db[_0x90f2('0xbd')],'as':_0x90f2('0xbe')}]})[_0x90f2('0x37')](function(_0x27c5e7){return[_0x27c5e7,!![]];});});}})[_0x90f2('0x93')](function(_0x27d94b,_0x56d505){if(_0x56d505){return _0x27d94b;}return db[_0x90f2('0xbd')][_0x90f2('0x5f')](_[_0x90f2('0x53')](_0x614001['body'],{'read':![],'body':_0x614001['body']['body'],'OpenchannelAccountId':_0x1cfa8f['id'],'OpenchannelInteractionId':_0x27d94b['id'],'UserId':_0x614001[_0x90f2('0x60')]['id'],'ContactId':_0x1d29ec['id']}))['then'](function(_0x20a667){_0x27d94b[_0x90f2('0xbf')]['Messages']=[];_0x27d94b[_0x90f2('0xbf')]['Messages'][_0x90f2('0x99')](_0x20a667['dataValues']);return _0x27d94b;});});}})[_0x90f2('0x37')](respondWithResult(_0x5dd5e,null))[_0x90f2('0x5e')](handleError(_0x5dd5e,null));}; \ No newline at end of file +var _0xf9c8=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','keys','intersection','query','fields','attributes','order','sort','where','pick','filters','filter','merge','options','include','findAll','show','length','includeAll','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','hasOwnProperty','rows','removeAnswers','ids','CmContact','ValidationError','difference','updatedAt','createdAt','ListId','isNil','from','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','contact','firstName','lastName','OpenchannelInteraction','threadId','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addAgents','omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1b2d57,_0x4fccb7){var _0x5d46dd=function(_0x43616b){while(--_0x43616b){_0x1b2d57['push'](_0x1b2d57['shift']());}};_0x5d46dd(++_0x4fccb7);}(_0xf9c8,0xaa));var _0x8f9c=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0xf9c8[_0x2ecb67];return _0x168079;};'use strict';var emlformat=require(_0x8f9c('0x0'));var rimraf=require(_0x8f9c('0x1'));var zipdir=require(_0x8f9c('0x2'));var jsonpatch=require(_0x8f9c('0x3'));var rp=require(_0x8f9c('0x4'));var moment=require(_0x8f9c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8f9c('0x6'));var util=require(_0x8f9c('0x7'));var path=require(_0x8f9c('0x8'));var sox=require('sox');var csv=require(_0x8f9c('0x9'));var ejs=require(_0x8f9c('0xa'));var fs=require('fs');var fs_extra=require(_0x8f9c('0xb'));var _=require(_0x8f9c('0xc'));var squel=require(_0x8f9c('0xd'));var crypto=require(_0x8f9c('0xe'));var jsforce=require(_0x8f9c('0xf'));var deskjs=require(_0x8f9c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8f9c('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8f9c('0x12'));var qs=require(_0x8f9c('0x13'));var as=require(_0x8f9c('0x14'));var hardwareService=require(_0x8f9c('0x15'));var logger=require(_0x8f9c('0x16'))(_0x8f9c('0x17'));var utils=require(_0x8f9c('0x18'));var config=require(_0x8f9c('0x19'));var licenseUtil=require(_0x8f9c('0x1a'));var db=require(_0x8f9c('0x1b'))['db'];config[_0x8f9c('0x1c')]=_[_0x8f9c('0x1d')](config[_0x8f9c('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x8f9c('0x1e'))(new Redis(config['redis']));require(_0x8f9c('0x1f'))[_0x8f9c('0x20')](socket);var jayson=require(_0x8f9c('0x21'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x8f9c('0x22')]({'port':0x232a});function respondWithRpcPromise(_0xb6331a,_0x430455,_0x5687ff,_0x1513d0){return new BPromise(function(_0x640650,_0x500eea){var _0x52e9d1=_0x1513d0||client;return _0x52e9d1[_0x8f9c('0x23')](_0xb6331a,_0x5687ff)[_0x8f9c('0x24')](function(_0x1a9f95){logger[_0x8f9c('0x25')](_0x8f9c('0x26'),_0x430455,_0x8f9c('0x27'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x430455,'request\x20sent',JSON[_0x8f9c('0x28')](_0x1a9f95));if(_0x1a9f95[_0x8f9c('0x29')]){if(_0x1a9f95[_0x8f9c('0x29')][_0x8f9c('0x2a')]===0x1f4){logger[_0x8f9c('0x29')](_0x8f9c('0x26'),_0x430455,_0x1a9f95[_0x8f9c('0x29')]['message']);return _0x500eea(_0x1a9f95[_0x8f9c('0x29')][_0x8f9c('0x2b')]);}logger['error'](_0x8f9c('0x26'),_0x430455,_0x1a9f95[_0x8f9c('0x29')][_0x8f9c('0x2b')]);return _0x640650(_0x1a9f95['error'][_0x8f9c('0x2b')]);}else{logger['info'](_0x8f9c('0x26'),_0x430455,_0x8f9c('0x27'));_0x640650(_0x1a9f95['result'][_0x8f9c('0x2b')]);}})[_0x8f9c('0x2c')](function(_0x363dc7){logger[_0x8f9c('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x430455,_0x363dc7);_0x500eea(_0x363dc7);});});}function respondWithStatusCode(_0x1d0eea,_0x597f9){_0x597f9=_0x597f9||0xcc;return function(_0x56ba23){if(_0x56ba23){return _0x1d0eea[_0x8f9c('0x2d')](_0x597f9);}return _0x1d0eea[_0x8f9c('0x2e')](_0x597f9)[_0x8f9c('0x2f')]();};}function respondWithResult(_0x4adf57,_0xbc59ec){_0xbc59ec=_0xbc59ec||0xc8;return function(_0xf3ddb1){if(_0xf3ddb1){return _0x4adf57[_0x8f9c('0x2e')](_0xbc59ec)['json'](_0xf3ddb1);}};}function respondWithFilteredResult(_0x211982,_0x5ef3e5){return function(_0x44a8b0){if(_0x44a8b0){var _0x9ab34f=typeof _0x5ef3e5[_0x8f9c('0x30')]===_0x8f9c('0x31')&&typeof _0x5ef3e5[_0x8f9c('0x32')]===_0x8f9c('0x31');var _0x46a0cf=_0x44a8b0[_0x8f9c('0x33')];var _0x366474=_0x9ab34f?0x0:_0x5ef3e5[_0x8f9c('0x30')];var _0x194206=_0x9ab34f?_0x44a8b0[_0x8f9c('0x33')]:_0x5ef3e5[_0x8f9c('0x30')]+_0x5ef3e5['limit'];var _0x724648;if(_0x194206>=_0x46a0cf){_0x194206=_0x46a0cf;_0x724648=0xc8;}else{_0x724648=0xce;}_0x211982[_0x8f9c('0x2e')](_0x724648);return _0x211982[_0x8f9c('0x34')]('Content-Range',_0x366474+'-'+_0x194206+'/'+_0x46a0cf)[_0x8f9c('0x35')](_0x44a8b0);}return null;};}function patchUpdates(_0xc6eecf){return function(_0x4187c3){try{jsonpatch[_0x8f9c('0x36')](_0x4187c3,_0xc6eecf,!![]);}catch(_0x62c7ac){return BPromise[_0x8f9c('0x37')](_0x62c7ac);}return _0x4187c3['save']();};}function saveUpdates(_0xb0bca0,_0x1a95c8){return function(_0x262937){if(_0x262937){return _0x262937[_0x8f9c('0x38')](_0xb0bca0)[_0x8f9c('0x24')](function(_0x411a89){return _0x411a89;});}return null;};}function removeEntity(_0x3b718a,_0x209bff){return function(_0x4f4641){if(_0x4f4641){return _0x4f4641['destroy']()[_0x8f9c('0x24')](function(){var _0xd26afc=_0x4f4641['get']({'plain':!![]});var _0x3dd0d3=_0x8f9c('0x39');return db[_0x8f9c('0x3a')][_0x8f9c('0x3b')]({'where':{'type':_0x3dd0d3,'resourceId':_0xd26afc['id']}})[_0x8f9c('0x24')](function(){return _0x4f4641;});})['then'](function(){_0x3b718a[_0x8f9c('0x2e')](0xcc)[_0x8f9c('0x2f')]();});}};}function handleEntityNotFound(_0x4aaa78,_0xa93918){return function(_0x45bbcd){if(!_0x45bbcd){_0x4aaa78[_0x8f9c('0x2d')](0x194);}return _0x45bbcd;};}function handleError(_0x378315,_0x5e7456){_0x5e7456=_0x5e7456||0x1f4;return function(_0x51c822){logger[_0x8f9c('0x29')](_0x51c822[_0x8f9c('0x3c')]);if(_0x51c822['name']){delete _0x51c822[_0x8f9c('0x3d')];}_0x378315[_0x8f9c('0x2e')](_0x5e7456)[_0x8f9c('0x3e')](_0x51c822);};}exports[_0x8f9c('0x3f')]=function(_0x24ee16,_0x3de9fc){var _0x271600={'include':[{'model':db[_0x8f9c('0x40')],'as':_0x8f9c('0x41')}]},_0x5b797a={},_0x5f2cfa={'count':0x0,'rows':[]};var _0x2a5556=_[_0x8f9c('0x42')](db[_0x8f9c('0x43')][_0x8f9c('0x44')],function(_0xcf33a2){return{'name':_0xcf33a2['fieldName'],'type':_0xcf33a2[_0x8f9c('0x45')][_0x8f9c('0x46')]};});_0x5b797a[_0x8f9c('0x47')]=_['map'](_0x2a5556,'name');_0x5b797a['query']=_[_0x8f9c('0x48')](_0x24ee16['query']);_0x5b797a['filters']=_[_0x8f9c('0x49')](_0x5b797a['model'],_0x5b797a[_0x8f9c('0x4a')]);_0x271600['attributes']=_[_0x8f9c('0x49')](_0x5b797a[_0x8f9c('0x47')],qs[_0x8f9c('0x4b')](_0x24ee16['query'][_0x8f9c('0x4b')]));_0x271600[_0x8f9c('0x4c')]=_0x271600['attributes']['length']?_0x271600[_0x8f9c('0x4c')]:_0x5b797a[_0x8f9c('0x47')];if(!_0x24ee16[_0x8f9c('0x4a')]['hasOwnProperty']('nolimit')){_0x271600[_0x8f9c('0x32')]=qs[_0x8f9c('0x32')](_0x24ee16[_0x8f9c('0x4a')][_0x8f9c('0x32')]);_0x271600[_0x8f9c('0x30')]=qs['offset'](_0x24ee16[_0x8f9c('0x4a')][_0x8f9c('0x30')]);}_0x271600[_0x8f9c('0x4d')]=qs[_0x8f9c('0x4e')](_0x24ee16['query']['sort']);_0x271600[_0x8f9c('0x4f')]=qs['filters'](_[_0x8f9c('0x50')](_0x24ee16[_0x8f9c('0x4a')],_0x5b797a[_0x8f9c('0x51')]),_0x2a5556);if(_0x24ee16[_0x8f9c('0x4a')][_0x8f9c('0x52')]){_0x271600[_0x8f9c('0x4f')]=_[_0x8f9c('0x53')](_0x271600['where'],{'$or':_[_0x8f9c('0x42')](_0x2a5556,function(_0x3ed54c){if(_0x3ed54c[_0x8f9c('0x45')]!=='VIRTUAL'){var _0x26b1b6={};_0x26b1b6[_0x3ed54c['name']]={'$like':'%'+_0x24ee16[_0x8f9c('0x4a')][_0x8f9c('0x52')]+'%'};return _0x26b1b6;}})});}_0x271600=_[_0x8f9c('0x53')]({},_0x271600,_0x24ee16[_0x8f9c('0x54')]);var _0x432880={'where':_0x271600[_0x8f9c('0x4f')]};return db['OpenchannelAccount'][_0x8f9c('0x33')](_0x432880)[_0x8f9c('0x24')](function(_0x1d1f14){_0x5f2cfa[_0x8f9c('0x33')]=_0x1d1f14;if(_0x24ee16[_0x8f9c('0x4a')]['includeAll']){_0x271600[_0x8f9c('0x55')]=[{'all':!![]}];}return db[_0x8f9c('0x43')][_0x8f9c('0x56')](_0x271600);})[_0x8f9c('0x24')](function(_0x2240a2){_0x5f2cfa['rows']=_0x2240a2;return _0x5f2cfa;})[_0x8f9c('0x24')](respondWithFilteredResult(_0x3de9fc,_0x271600))[_0x8f9c('0x2c')](handleError(_0x3de9fc,null));};exports[_0x8f9c('0x57')]=function(_0x53365a,_0x49b1fe){var _0x1ed578={'raw':![],'where':{'id':_0x53365a['params']['id']},'include':[{'model':db[_0x8f9c('0x40')],'as':_0x8f9c('0x41')}]},_0x3f5760={};_0x3f5760[_0x8f9c('0x47')]=_[_0x8f9c('0x48')](db['OpenchannelAccount'][_0x8f9c('0x44')]);_0x3f5760[_0x8f9c('0x4a')]=_[_0x8f9c('0x48')](_0x53365a['query']);_0x3f5760['filters']=_[_0x8f9c('0x49')](_0x3f5760['model'],_0x3f5760[_0x8f9c('0x4a')]);_0x1ed578['attributes']=_['intersection'](_0x3f5760[_0x8f9c('0x47')],qs[_0x8f9c('0x4b')](_0x53365a[_0x8f9c('0x4a')][_0x8f9c('0x4b')]));_0x1ed578[_0x8f9c('0x4c')]=_0x1ed578[_0x8f9c('0x4c')][_0x8f9c('0x58')]?_0x1ed578[_0x8f9c('0x4c')]:_0x3f5760['model'];if(_0x53365a[_0x8f9c('0x4a')][_0x8f9c('0x59')]){_0x1ed578[_0x8f9c('0x55')]=[{'all':!![]}];}_0x1ed578=_[_0x8f9c('0x53')]({},_0x1ed578,_0x53365a[_0x8f9c('0x54')]);return db[_0x8f9c('0x43')]['find'](_0x1ed578)[_0x8f9c('0x24')](handleEntityNotFound(_0x49b1fe,null))[_0x8f9c('0x24')](respondWithResult(_0x49b1fe,null))[_0x8f9c('0x2c')](handleError(_0x49b1fe,null));};exports[_0x8f9c('0x5a')]=function(_0x529704,_0x4dafb5){return db[_0x8f9c('0x43')][_0x8f9c('0x5a')](_0x529704[_0x8f9c('0x5b')],{})[_0x8f9c('0x24')](function(_0x473f8f){var _0x238a62=_0x529704[_0x8f9c('0x5c')][_0x8f9c('0x5d')]({'plain':!![]});if(!_0x238a62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x238a62[_0x8f9c('0x5e')]==='user'){var _0x2d8e70=_0x473f8f[_0x8f9c('0x5d')]({'plain':!![]});var _0x16efbb=_0x8f9c('0x39');return db[_0x8f9c('0x5f')]['find']({'where':{'name':_0x16efbb,'userProfileId':_0x238a62['userProfileId']},'raw':!![]})[_0x8f9c('0x24')](function(_0x149d9b){if(_0x149d9b&&_0x149d9b[_0x8f9c('0x60')]===0x0){return db[_0x8f9c('0x3a')][_0x8f9c('0x5a')]({'name':_0x2d8e70[_0x8f9c('0x3d')],'resourceId':_0x2d8e70['id'],'type':_0x149d9b['name'],'sectionId':_0x149d9b['id']},{})['then'](function(){return _0x473f8f;});}else{return _0x473f8f;}})[_0x8f9c('0x2c')](function(_0x1b884e){logger[_0x8f9c('0x29')](_0x8f9c('0x61'),_0x1b884e);throw _0x1b884e;});}return _0x473f8f;})['then'](respondWithResult(_0x4dafb5,0xc9))[_0x8f9c('0x2c')](handleError(_0x4dafb5,null));};exports['update']=function(_0xe2a236,_0x38a9f7){if(_0xe2a236[_0x8f9c('0x5b')]['id']){delete _0xe2a236[_0x8f9c('0x5b')]['id'];}return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0xe2a236[_0x8f9c('0x63')]['id']},'include':[{'model':db[_0x8f9c('0x40')],'as':'mandatoryDispositionPause'}]})[_0x8f9c('0x24')](handleEntityNotFound(_0x38a9f7,null))[_0x8f9c('0x24')](saveUpdates(_0xe2a236['body'],null))[_0x8f9c('0x24')](respondWithResult(_0x38a9f7,null))['catch'](handleError(_0x38a9f7,null));};exports[_0x8f9c('0x3b')]=function(_0x5108b9,_0x2ecdce){return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0x5108b9[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x2ecdce,null))[_0x8f9c('0x24')](removeEntity(_0x2ecdce,null))[_0x8f9c('0x2c')](handleError(_0x2ecdce,null));};exports[_0x8f9c('0x64')]=function(_0x395161,_0x285aaf){return db[_0x8f9c('0x43')][_0x8f9c('0x64')]()[_0x8f9c('0x24')](respondWithResult(_0x285aaf,null))['catch'](handleError(_0x285aaf,null));};exports[_0x8f9c('0x65')]=function(_0x360862,_0x3f5321,_0x4102d9){if(_0x360862[_0x8f9c('0x5b')]['id']){delete _0x360862[_0x8f9c('0x5b')]['id'];}return db['OpenchannelAccount'][_0x8f9c('0x62')]({'where':{'id':_0x360862[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x3f5321,null))['then'](function(_0x7d8a83){if(_0x7d8a83){_0x360862[_0x8f9c('0x5b')]['OpenchannelAccountId']=_0x7d8a83['id'];return db[_0x8f9c('0x66')]['create'](_0x360862[_0x8f9c('0x5b')]);}})[_0x8f9c('0x24')](respondWithResult(_0x3f5321,null))['catch'](handleError(_0x3f5321,null));};exports[_0x8f9c('0x67')]=function(_0x1d7e08,_0x35829b,_0x1cf7d0){var _0x50b400={'raw':![],'where':{}};var _0x48a4e0={};var _0x3d2677={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8f9c('0x68')]({'where':{'id':_0x1d7e08[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x35829b,null))[_0x8f9c('0x24')](function(_0x238854){if(_0x238854){_0x48a4e0[_0x8f9c('0x47')]=_[_0x8f9c('0x48')](db['Disposition'][_0x8f9c('0x44')]);_0x48a4e0[_0x8f9c('0x4a')]=_['keys'](_0x1d7e08[_0x8f9c('0x4a')]);_0x48a4e0[_0x8f9c('0x51')]=_[_0x8f9c('0x49')](_0x48a4e0[_0x8f9c('0x47')],_0x48a4e0[_0x8f9c('0x4a')]);_0x50b400[_0x8f9c('0x4c')]=_[_0x8f9c('0x49')](_0x48a4e0[_0x8f9c('0x47')],qs[_0x8f9c('0x4b')](_0x1d7e08[_0x8f9c('0x4a')][_0x8f9c('0x4b')]));_0x50b400[_0x8f9c('0x4c')]=_0x50b400[_0x8f9c('0x4c')][_0x8f9c('0x58')]?_0x50b400[_0x8f9c('0x4c')]:_0x48a4e0[_0x8f9c('0x47')];if(!_0x1d7e08[_0x8f9c('0x4a')]['hasOwnProperty'](_0x8f9c('0x69'))){_0x50b400[_0x8f9c('0x32')]=qs[_0x8f9c('0x32')](_0x1d7e08[_0x8f9c('0x4a')][_0x8f9c('0x32')]);_0x50b400[_0x8f9c('0x30')]=qs[_0x8f9c('0x30')](_0x1d7e08['query']['offset']);}_0x50b400[_0x8f9c('0x4d')]=qs[_0x8f9c('0x4e')](_0x1d7e08['query']['sort']);_0x50b400[_0x8f9c('0x4f')]=qs[_0x8f9c('0x51')](_[_0x8f9c('0x50')](_0x1d7e08['query'],_0x48a4e0[_0x8f9c('0x51')]));_0x50b400[_0x8f9c('0x4f')]['OpenchannelAccountId']=_0x238854['id'];if(_0x1d7e08[_0x8f9c('0x4a')][_0x8f9c('0x52')]){_0x50b400[_0x8f9c('0x4f')]=_[_0x8f9c('0x53')](_0x50b400['where'],{'$or':_[_0x8f9c('0x42')](_0x50b400[_0x8f9c('0x4c')],function(_0x4abf09){var _0x580c34={};_0x580c34[_0x4abf09]={'$like':'%'+_0x1d7e08[_0x8f9c('0x4a')][_0x8f9c('0x52')]+'%'};return _0x580c34;})});}_0x50b400=_[_0x8f9c('0x53')]({},_0x50b400,_0x1d7e08['options']);return db['Disposition']['count']({'where':_0x50b400['where']})[_0x8f9c('0x24')](function(_0x50f4ca){_0x3d2677[_0x8f9c('0x33')]=_0x50f4ca;if(_0x1d7e08['query'][_0x8f9c('0x59')]){_0x50b400[_0x8f9c('0x55')]=[{'all':!![]}];}return db[_0x8f9c('0x66')][_0x8f9c('0x56')](_0x50b400);})['then'](function(_0x4cdfed){_0x3d2677['rows']=_0x4cdfed;return _0x3d2677;});}})[_0x8f9c('0x24')](respondWithFilteredResult(_0x35829b,_0x50b400))[_0x8f9c('0x2c')](handleError(_0x35829b,null));};exports[_0x8f9c('0x6a')]=function(_0x52aa93,_0x35c64d,_0x46012e){return db['OpenchannelAccount'][_0x8f9c('0x62')]({'where':{'id':_0x52aa93['params']['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x35c64d,null))[_0x8f9c('0x24')](function(_0x3f69d4){if(_0x3f69d4){return _0x3f69d4[_0x8f9c('0x6a')](_0x52aa93[_0x8f9c('0x4a')]['ids']);}})[_0x8f9c('0x24')](respondWithStatusCode(_0x35c64d,null))['catch'](handleError(_0x35c64d,null));};exports[_0x8f9c('0x6b')]=function(_0x54869c,_0x13cf54,_0x1af57b){if(_0x54869c[_0x8f9c('0x5b')]['id']){delete _0x54869c[_0x8f9c('0x5b')]['id'];}return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0x54869c[_0x8f9c('0x63')]['id']}})['then'](handleEntityNotFound(_0x13cf54,null))['then'](function(_0x26e5f3){if(_0x26e5f3){_0x54869c[_0x8f9c('0x5b')][_0x8f9c('0x6c')]=_0x26e5f3['id'];return db[_0x8f9c('0x6d')]['create'](_0x54869c[_0x8f9c('0x5b')]);}})[_0x8f9c('0x24')](respondWithResult(_0x13cf54,null))[_0x8f9c('0x2c')](handleError(_0x13cf54,null));};exports['getAnswers']=function(_0x480132,_0xf8718d,_0x1e0f93){var _0x5b6753={'raw':![],'where':{}};var _0x5bcc1a={};var _0x40d2ce={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8f9c('0x68')]({'where':{'id':_0x480132[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0xf8718d,null))[_0x8f9c('0x24')](function(_0x1ca12e){if(_0x1ca12e){_0x5bcc1a[_0x8f9c('0x47')]=_[_0x8f9c('0x48')](db['CannedAnswer'][_0x8f9c('0x44')]);_0x5bcc1a[_0x8f9c('0x4a')]=_[_0x8f9c('0x48')](_0x480132[_0x8f9c('0x4a')]);_0x5bcc1a[_0x8f9c('0x51')]=_['intersection'](_0x5bcc1a[_0x8f9c('0x47')],_0x5bcc1a[_0x8f9c('0x4a')]);_0x5b6753[_0x8f9c('0x4c')]=_[_0x8f9c('0x49')](_0x5bcc1a[_0x8f9c('0x47')],qs[_0x8f9c('0x4b')](_0x480132[_0x8f9c('0x4a')][_0x8f9c('0x4b')]));_0x5b6753[_0x8f9c('0x4c')]=_0x5b6753[_0x8f9c('0x4c')][_0x8f9c('0x58')]?_0x5b6753['attributes']:_0x5bcc1a[_0x8f9c('0x47')];if(!_0x480132[_0x8f9c('0x4a')][_0x8f9c('0x6e')](_0x8f9c('0x69'))){_0x5b6753[_0x8f9c('0x32')]=qs['limit'](_0x480132[_0x8f9c('0x4a')][_0x8f9c('0x32')]);_0x5b6753[_0x8f9c('0x30')]=qs[_0x8f9c('0x30')](_0x480132[_0x8f9c('0x4a')]['offset']);}_0x5b6753[_0x8f9c('0x4d')]=qs[_0x8f9c('0x4e')](_0x480132[_0x8f9c('0x4a')][_0x8f9c('0x4e')]);_0x5b6753['where']=qs[_0x8f9c('0x51')](_[_0x8f9c('0x50')](_0x480132[_0x8f9c('0x4a')],_0x5bcc1a[_0x8f9c('0x51')]));_0x5b6753[_0x8f9c('0x4f')][_0x8f9c('0x6c')]=_0x1ca12e['id'];if(_0x480132[_0x8f9c('0x4a')]['filter']){_0x5b6753[_0x8f9c('0x4f')]=_['merge'](_0x5b6753[_0x8f9c('0x4f')],{'$or':_[_0x8f9c('0x42')](_0x5b6753[_0x8f9c('0x4c')],function(_0x167be2){var _0x47fe5d={};_0x47fe5d[_0x167be2]={'$like':'%'+_0x480132[_0x8f9c('0x4a')]['filter']+'%'};return _0x47fe5d;})});}_0x5b6753=_['merge']({},_0x5b6753,_0x480132[_0x8f9c('0x54')]);return db[_0x8f9c('0x6d')][_0x8f9c('0x33')]({'where':_0x5b6753['where']})[_0x8f9c('0x24')](function(_0x42475b){_0x40d2ce[_0x8f9c('0x33')]=_0x42475b;if(_0x480132['query'][_0x8f9c('0x59')]){_0x5b6753[_0x8f9c('0x55')]=[{'all':!![]}];}return db[_0x8f9c('0x6d')][_0x8f9c('0x56')](_0x5b6753);})[_0x8f9c('0x24')](function(_0x34e59e){_0x40d2ce[_0x8f9c('0x6f')]=_0x34e59e;return _0x40d2ce;});}})[_0x8f9c('0x24')](respondWithFilteredResult(_0xf8718d,_0x5b6753))['catch'](handleError(_0xf8718d,null));};exports[_0x8f9c('0x70')]=function(_0x5f2072,_0x287ae3,_0x1e7858){return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0x5f2072[_0x8f9c('0x63')]['id']}})['then'](handleEntityNotFound(_0x287ae3,null))[_0x8f9c('0x24')](function(_0x556794){if(_0x556794){return _0x556794[_0x8f9c('0x70')](_0x5f2072[_0x8f9c('0x4a')][_0x8f9c('0x71')]);}})[_0x8f9c('0x24')](respondWithStatusCode(_0x287ae3,null))[_0x8f9c('0x2c')](handleError(_0x287ae3,null));};exports['notify']=function(_0x2e949e,_0x5eaa5c,_0x59ace4){var _0x1d4616={'body':_0x2e949e[_0x8f9c('0x5b')],'channel':'openchannel'};var _0x414c80=[];var _0x56d2ee=[];var _0x19284f={};var _0x18a0fa=![];return db[_0x8f9c('0x72')][_0x8f9c('0x64')]()[_0x8f9c('0x24')](function(_0x15e81d){if(!_0x15e81d){throw new db['Sequelize'][(_0x8f9c('0x73'))]('no\x20available\x20attributes');}_0x414c80=_[_0x8f9c('0x74')](_[_0x8f9c('0x48')](_0x15e81d),['createdAt',_0x8f9c('0x75')]);_0x56d2ee=_['difference'](_[_0x8f9c('0x48')](_0x15e81d),[_0x8f9c('0x76'),'updatedAt','CompanyId',_0x8f9c('0x77')]);if(_0x2e949e['body']['id']){delete _0x2e949e[_0x8f9c('0x5b')]['id'];}if(_[_0x8f9c('0x78')](_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x79')])){throw new db[(_0x8f9c('0x7a'))][(_0x8f9c('0x73'))]('from\x20is\x20mandatory');}if(_[_0x8f9c('0x78')](_0x2e949e['body']['body'])||_0x2e949e['body'][_0x8f9c('0x5b')]===''){throw new db[(_0x8f9c('0x7a'))][(_0x8f9c('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8f9c('0x78')](_0x2e949e[_0x8f9c('0x5b')]['mapKey'])){throw new db[(_0x8f9c('0x7a'))][(_0x8f9c('0x73'))](_0x8f9c('0x7b')+_0x56d2ee);}if(!_['includes'](_0x56d2ee,_0x2e949e['body'][_0x8f9c('0x7c')])){throw new db[(_0x8f9c('0x7a'))][(_0x8f9c('0x73'))](_0x8f9c('0x7d')+_0x56d2ee);}_0x19284f[_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x7c')]]=_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x79')];})[_0x8f9c('0x24')](function(){return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0x2e949e['params']['id']},'include':[{'model':db[_0x8f9c('0x7e')],'as':_0x8f9c('0x7f'),'include':[{'model':db[_0x8f9c('0x72')],'as':_0x8f9c('0x80'),'where':_0x19284f,'limit':0x1,'order':[[_0x8f9c('0x75'),_0x8f9c('0x81')]]}]},{'model':db[_0x8f9c('0x82')],'as':'Applications'}]});})[_0x8f9c('0x24')](handleEntityNotFound(_0x5eaa5c,null))[_0x8f9c('0x24')](function(_0xe3dd23){if(_0xe3dd23&&_0xe3dd23[_0x8f9c('0x7f')]){_0x1d4616[_0x8f9c('0x83')]=_0xe3dd23;_0x1d4616[_0x8f9c('0x84')]=_0xe3dd23[_0x8f9c('0x85')];_0x1d4616[_0x8f9c('0x86')]=_0xe3dd23[_0x8f9c('0x7f')];_0x1d4616[_0x8f9c('0x84')]=_[_0x8f9c('0x87')](_0x1d4616[_0x8f9c('0x84')],[_0x8f9c('0x88')],['asc']);if(_0x1d4616[_0x8f9c('0x83')]['Applications']){delete _0x1d4616[_0x8f9c('0x83')][_0x8f9c('0x85')];}if(_0x1d4616[_0x8f9c('0x83')]['List']&&_0x1d4616[_0x8f9c('0x83')][_0x8f9c('0x7f')]['Contacts'][_0x8f9c('0x58')]){return _0x1d4616['account'][_0x8f9c('0x7f')][_0x8f9c('0x80')][0x0];}var _0x1bb537=_[_0x8f9c('0x1d')](_0x2e949e[_0x8f9c('0x5b')],{'firstName':_0x2e949e['body'][_0x8f9c('0x79')],'ListId':_0xe3dd23[_0x8f9c('0x77')]});_0x1bb537[_0x2e949e['body'][_0x8f9c('0x7c')]]=_0x2e949e['body'][_0x8f9c('0x79')];return db[_0x8f9c('0x72')][_0x8f9c('0x5a')](_0x1bb537,{'fields':_0x414c80,'raw':!![]});}})[_0x8f9c('0x24')](handleEntityNotFound(_0x5eaa5c,null))[_0x8f9c('0x24')](function(_0x50c181){_0x1d4616[_0x8f9c('0x89')]=_0x50c181;if(_0x50c181){var _0x5534d1={'ContactId':_0x50c181['id'],'OpenchannelAccountId':_0x2e949e[_0x8f9c('0x63')]['id'],'from':(_0x50c181[_0x8f9c('0x8a')]||'')+'\x20'+(_0x50c181[_0x8f9c('0x8b')]||'')};var _0x4efec0={'OpenchannelAccountId':_0x2e949e[_0x8f9c('0x63')]['id'],'closed':![]};if(_0x2e949e['body']['threadId']){_0x4efec0['threadId']=_0x2e949e[_0x8f9c('0x5b')]['threadId'];return db[_0x8f9c('0x8c')][_0x8f9c('0x62')]({'where':_0x4efec0})[_0x8f9c('0x24')](function(_0xf4309e){if(_0xf4309e){return[_0xf4309e,![]];}_0x5534d1[_0x8f9c('0x8d')]=_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x8d')];_0x5534d1['externalUrl']=_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x8e')];return db[_0x8f9c('0x8c')][_0x8f9c('0x5a')](_0x5534d1)[_0x8f9c('0x24')](function(_0x2f09c5){return[_0x2f09c5,!![]];});});}else{_0x4efec0[_0x8f9c('0x8d')]=null;}_0x4efec0[_0x8f9c('0x8f')]=_0x50c181['id'];return db['OpenchannelInteraction'][_0x8f9c('0x62')]({'where':_0x4efec0})[_0x8f9c('0x24')](function(_0xb0b30e){if(_0xb0b30e){return[_0xb0b30e,![]];}return db[_0x8f9c('0x8c')][_0x8f9c('0x5a')](_0x5534d1)[_0x8f9c('0x24')](function(_0x18a666){return[_0x18a666,!![]];});});}})[_0x8f9c('0x90')](function(_0xffe3af,_0x176628){if(_0xffe3af){_0x18a0fa=_0x176628;if(!_0x176628){var _0x5ec497={'from':(_0x1d4616[_0x8f9c('0x89')]['firstName']||'')+'\x20'+(_0x1d4616[_0x8f9c('0x89')][_0x8f9c('0x8b')]||'')};if(_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x8d')]&&_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x91')]&&_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x8d')]!=_0x2e949e[_0x8f9c('0x5b')]['messageId']){_0x5ec497[_0x8f9c('0x8d')]=_0x2e949e[_0x8f9c('0x5b')]['messageId'];}return _0xffe3af[_0x8f9c('0x38')](_0x5ec497);}else{return _0xffe3af;}}})['then'](function(_0x4a1b92){_0x1d4616[_0x8f9c('0x92')]=_0x4a1b92[_0x8f9c('0x5d')]({'plain':!![]});_0x1d4616[_0x8f9c('0x92')][_0x8f9c('0x93')]=_0x18a0fa;if(_0x1d4616['interaction']['created']){if(_0x1d4616[_0x8f9c('0x83')][_0x8f9c('0x94')]){_0x1d4616['applications'][_0x8f9c('0x95')]({'id':0x0,'priority':_0x1d4616['applications'][_0x8f9c('0x58')]+0x1,'app':_0x8f9c('0x96'),'appdata':'unmanaged','interval':_0x8f9c('0x97')});}}return db[_0x8f9c('0x98')][_0x8f9c('0x5a')]({'body':_0x2e949e[_0x8f9c('0x5b')]['body'],'OpenchannelAccountId':_0x2e949e[_0x8f9c('0x63')]['id'],'OpenchannelInteractionId':_0x4a1b92['id'],'direction':'in','ContactId':_0x1d4616['contact']['id'],'AttachmentId':_0x2e949e[_0x8f9c('0x5b')][_0x8f9c('0x99')]});})[_0x8f9c('0x24')](function(_0x272b62){_0x1d4616[_0x8f9c('0x2b')]=_0x272b62;if(_0x1d4616[_0x8f9c('0x92')][_0x8f9c('0x9a')]){return db['User'][_0x8f9c('0x62')]({'attributes':['id','name'],'where':{'id':_0x1d4616[_0x8f9c('0x92')]['UserId']}})[_0x8f9c('0x24')](function(_0x41a8fd){if(_0x41a8fd){_0x1d4616[_0x8f9c('0x84')][_0x8f9c('0x9b')]({'id':0x0,'priority':0x0,'app':_0x8f9c('0x9c'),'appdata':_0x41a8fd[_0x8f9c('0x3d')]+','+(_0x1d4616[_0x8f9c('0x83')][_0x8f9c('0x9d')]||0xa),'interval':_0x8f9c('0x97')});_0x1d4616[_0x8f9c('0x9e')]=![];}return respondWithRpcPromise('Start',_0x8f9c('0x9f'),_0x1d4616);});}return respondWithRpcPromise('Start','startRouting',_0x1d4616);})[_0x8f9c('0x24')](function(_0x1ab279){respondWithRpcPromise('EventManager',_0x8f9c('0xa0'),{'event':'notify','message':_0x1ab279},client9002);return _0x1ab279;})[_0x8f9c('0x24')](respondWithResult(_0x5eaa5c,null))['catch'](handleError(_0x5eaa5c,null));};exports['addApplications']=function(_0x436359,_0x1c428c,_0x353fc7){return db[_0x8f9c('0x43')][_0x8f9c('0x68')]({'where':{'id':_0x436359[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x1c428c,null))[_0x8f9c('0x24')](function(_0x3e106d){if(_0x3e106d){return db[_0x8f9c('0xa1')]['transaction'](function(_0x139956){return db['OpenchannelApplication'][_0x8f9c('0x3b')]({'where':{'OpenchannelAccountId':_0x436359[_0x8f9c('0x63')]['id']},'transaction':_0x139956})[_0x8f9c('0x24')](function(_0x7c7362){var _0x4d8f68=_[_0x8f9c('0x42')](_0x436359[_0x8f9c('0x5b')],function(_0x36ac70){_0x36ac70['OpenchannelAccountId']=_0x436359[_0x8f9c('0x63')]['id'];return _0x36ac70;});return db[_0x8f9c('0x82')][_0x8f9c('0xa2')](_0x4d8f68,{'transaction':_0x139956});});})[_0x8f9c('0x24')](function(){return db[_0x8f9c('0x82')][_0x8f9c('0xa3')]({'where':{'OpenchannelAccountId':_0x436359[_0x8f9c('0x63')]['id']},'order':_0x8f9c('0x88')});});}})[_0x8f9c('0x24')](respondWithResult(_0x1c428c,null))[_0x8f9c('0x2c')](handleError(_0x1c428c,null));};exports[_0x8f9c('0xa4')]=function(_0x54fbdb,_0xfbdeca,_0x1bfe7a){var _0x2fe7c8={};var _0xc3260c={};var _0x1fa708;var _0x3ef1af;return db['OpenchannelAccount'][_0x8f9c('0x68')]({'where':{'id':_0x54fbdb['params']['id']}})['then'](handleEntityNotFound(_0xfbdeca,null))['then'](function(_0x1e96e3){if(_0x1e96e3){_0x1fa708=_0x1e96e3;_0xc3260c['model']=_[_0x8f9c('0x48')](db['OpenchannelApplication'][_0x8f9c('0x44')]);_0xc3260c[_0x8f9c('0x4a')]=_['keys'](_0x54fbdb[_0x8f9c('0x4a')]);_0xc3260c['filters']=_[_0x8f9c('0x49')](_0xc3260c[_0x8f9c('0x47')],_0xc3260c[_0x8f9c('0x4a')]);_0x2fe7c8[_0x8f9c('0x4c')]=_[_0x8f9c('0x49')](_0xc3260c[_0x8f9c('0x47')],qs[_0x8f9c('0x4b')](_0x54fbdb[_0x8f9c('0x4a')][_0x8f9c('0x4b')]));_0x2fe7c8['attributes']=_0x2fe7c8['attributes'][_0x8f9c('0x58')]?_0x2fe7c8[_0x8f9c('0x4c')]:_0xc3260c['model'];_0x2fe7c8['order']=qs[_0x8f9c('0x4e')](_0x54fbdb['query']['sort']);_0x2fe7c8[_0x8f9c('0x4f')]=qs[_0x8f9c('0x51')](_[_0x8f9c('0x50')](_0x54fbdb['query'],_0xc3260c[_0x8f9c('0x51')]));if(_0x54fbdb[_0x8f9c('0x4a')][_0x8f9c('0x52')]){_0x2fe7c8['where']=_[_0x8f9c('0x53')](_0x2fe7c8[_0x8f9c('0x4f')],{'$or':_[_0x8f9c('0x42')](_0x2fe7c8[_0x8f9c('0x4c')],function(_0x3a731d){var _0x4a5d04={};_0x4a5d04[_0x3a731d]={'$like':'%'+_0x54fbdb[_0x8f9c('0x4a')][_0x8f9c('0x52')]+'%'};return _0x4a5d04;})});}_0x2fe7c8=_['merge']({},_0x2fe7c8,_0x54fbdb[_0x8f9c('0x54')]);return _0x1fa708[_0x8f9c('0xa4')](_0x2fe7c8);}})['then'](function(_0x56a99b){if(_0x56a99b){_0x3ef1af=_0x56a99b[_0x8f9c('0x58')];if(!_0x54fbdb['query']['hasOwnProperty'](_0x8f9c('0x69'))){_0x2fe7c8['limit']=qs[_0x8f9c('0x32')](_0x54fbdb[_0x8f9c('0x4a')][_0x8f9c('0x32')]);_0x2fe7c8[_0x8f9c('0x30')]=qs[_0x8f9c('0x30')](_0x54fbdb[_0x8f9c('0x4a')][_0x8f9c('0x30')]);}return _0x1fa708[_0x8f9c('0xa4')](_0x2fe7c8);}})[_0x8f9c('0x24')](function(_0x2cbadf){if(_0x2cbadf){return _0x2cbadf?{'count':_0x3ef1af,'rows':_0x2cbadf}:null;}})[_0x8f9c('0x24')](respondWithResult(_0xfbdeca,null))[_0x8f9c('0x2c')](handleError(_0xfbdeca,null));};exports[_0x8f9c('0xa5')]=function(_0xafb4aa,_0x306bd1,_0x50be3c){var _0x558c74={'raw':![],'where':{}};var _0x43dc42={};var _0x3c2ce7={'count':0x0,'rows':[]};return db[_0x8f9c('0x43')][_0x8f9c('0x68')]({'where':{'id':_0xafb4aa[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x306bd1,null))[_0x8f9c('0x24')](function(_0x1fcaf4){if(_0x1fcaf4){_0x43dc42[_0x8f9c('0x47')]=_[_0x8f9c('0x48')](db['OpenchannelInteraction'][_0x8f9c('0x44')]);_0x43dc42[_0x8f9c('0x4a')]=_[_0x8f9c('0x48')](_0xafb4aa['query']);_0x43dc42['filters']=_[_0x8f9c('0x49')](_0x43dc42[_0x8f9c('0x47')],_0x43dc42[_0x8f9c('0x4a')]);_0x558c74['attributes']=_[_0x8f9c('0x49')](_0x43dc42['model'],qs[_0x8f9c('0x4b')](_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x4b')]));_0x558c74[_0x8f9c('0x4c')]=_0x558c74[_0x8f9c('0x4c')][_0x8f9c('0x58')]?_0x558c74['attributes']:_0x43dc42[_0x8f9c('0x47')];if(!_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x6e')](_0x8f9c('0x69'))){_0x558c74[_0x8f9c('0x32')]=qs[_0x8f9c('0x32')](_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x32')]);_0x558c74[_0x8f9c('0x30')]=qs[_0x8f9c('0x30')](_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x30')]);}_0x558c74[_0x8f9c('0x4d')]=qs[_0x8f9c('0x4e')](_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x4e')]);_0x558c74[_0x8f9c('0x4f')]=qs['filters'](_[_0x8f9c('0x50')](_0xafb4aa[_0x8f9c('0x4a')],_0x43dc42[_0x8f9c('0x51')]));_0x558c74[_0x8f9c('0x4f')][_0x8f9c('0x6c')]=_0x1fcaf4['id'];if(_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x52')]){_0x558c74['where']=_['merge'](_0x558c74[_0x8f9c('0x4f')],{'$or':_[_0x8f9c('0x42')](_0x558c74[_0x8f9c('0x4c')],function(_0x29a8f9){var _0x48aaee={};_0x48aaee[_0x29a8f9]={'$like':'%'+_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0x52')]+'%'};return _0x48aaee;})});}_0x558c74=_['merge']({},_0x558c74,_0xafb4aa[_0x8f9c('0x54')]);return db['OpenchannelInteraction'][_0x8f9c('0x33')]({'where':_0x558c74[_0x8f9c('0x4f')]})[_0x8f9c('0x24')](function(_0x5280bd){_0x3c2ce7[_0x8f9c('0x33')]=_0x5280bd;if(_0xafb4aa['query'][_0x8f9c('0x59')]){_0x558c74[_0x8f9c('0x55')]=[{'model':db['CmContact'],'as':_0x8f9c('0xa6'),'required':![]},{'model':db[_0x8f9c('0xa7')],'as':_0x8f9c('0xa8'),'attributes':[_0x8f9c('0x3d'),_0x8f9c('0xa9'),'internal'],'required':![]},{'model':db[_0x8f9c('0xaa')],'as':_0x8f9c('0xab'),'attributes':['id',_0x8f9c('0x3d'),_0x8f9c('0xac')],'where':_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0xad')]?{'id':_0xafb4aa[_0x8f9c('0x4a')][_0x8f9c('0xad')]}:undefined,'required':_0xafb4aa['query'][_0x8f9c('0xad')]?!![]:![]}];}return db[_0x8f9c('0x8c')]['findAll'](_0x558c74);})[_0x8f9c('0x24')](function(_0x2d6356){_0x3c2ce7[_0x8f9c('0x6f')]=_0x2d6356;return _0x3c2ce7;});}})['then'](respondWithFilteredResult(_0x306bd1,_0x558c74))[_0x8f9c('0x2c')](handleError(_0x306bd1,null));};exports[_0x8f9c('0xae')]=function(_0x5ef20e,_0x115b9a,_0xac057b){return db['OpenchannelAccount'][_0x8f9c('0x62')]({'where':{'id':_0x5ef20e['params']['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x115b9a,null))[_0x8f9c('0x24')](function(_0x41a97d){if(_0x41a97d){return _0x41a97d[_0x8f9c('0xae')](_0x5ef20e[_0x8f9c('0x5b')][_0x8f9c('0x71')],_[_0x8f9c('0xaf')](_0x5ef20e[_0x8f9c('0x5b')],[_0x8f9c('0x71'),'id'])||{})[_0x8f9c('0x90')](function(_0x307af1){for(var _0x53ee31=0x0;_0x53ee31<_0x5ef20e['body'][_0x8f9c('0x71')][_0x8f9c('0x58')];_0x53ee31+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x5ef20e[_0x8f9c('0x5b')][_0x8f9c('0x71')][_0x53ee31]),'OpenchannelAccountId':Number(_0x5ef20e[_0x8f9c('0x63')]['id'])});}return _0x307af1;});}})[_0x8f9c('0x24')](respondWithResult(_0x115b9a,null))[_0x8f9c('0x2c')](handleError(_0x115b9a,null));};exports[_0x8f9c('0xb0')]=function(_0x54422f,_0x505a87,_0xad1f7f){return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0x54422f[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x505a87,null))[_0x8f9c('0x24')](function(_0xa3a730){if(_0xa3a730){return _0xa3a730['removeAgents'](_0x54422f[_0x8f9c('0x4a')][_0x8f9c('0x71')])[_0x8f9c('0x24')](function(){if(_['isArray'](_0x54422f[_0x8f9c('0x4a')][_0x8f9c('0x71')])){for(var _0x37330e=0x0;_0x37330e<_0x54422f['query'][_0x8f9c('0x71')][_0x8f9c('0x58')];_0x37330e+=0x1){socket[_0x8f9c('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x54422f[_0x8f9c('0x4a')]['ids'][_0x37330e]),'OpenchannelAccountId':Number(_0x54422f[_0x8f9c('0x63')]['id'])});}}else{socket['emit'](_0x8f9c('0xb2'),{'UserId':Number(_0x54422f[_0x8f9c('0x4a')]['ids']),'OpenchannelAccountId':Number(_0x54422f['params']['id'])});}});}})[_0x8f9c('0x24')](respondWithStatusCode(_0x505a87,null))[_0x8f9c('0x2c')](handleError(_0x505a87,null));};exports[_0x8f9c('0xb3')]=function(_0x1892f8,_0x4e6029,_0x35fc73){var _0x42c4bf={};var _0x250a8c={};var _0x3a409;var _0x410237;return db[_0x8f9c('0x43')][_0x8f9c('0x68')]({'where':{'id':_0x1892f8[_0x8f9c('0x63')]['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x4e6029,null))[_0x8f9c('0x24')](function(_0x16507c){if(_0x16507c){_0x3a409=_0x16507c;_0x250a8c[_0x8f9c('0x47')]=_[_0x8f9c('0x48')](db[_0x8f9c('0xa7')][_0x8f9c('0x44')]);_0x250a8c[_0x8f9c('0x4a')]=_[_0x8f9c('0x48')](_0x1892f8[_0x8f9c('0x4a')]);_0x250a8c[_0x8f9c('0x51')]=_[_0x8f9c('0x49')](_0x250a8c[_0x8f9c('0x47')],_0x250a8c['query']);_0x42c4bf['attributes']=_[_0x8f9c('0x49')](_0x250a8c[_0x8f9c('0x47')],qs[_0x8f9c('0x4b')](_0x1892f8[_0x8f9c('0x4a')]['fields']));_0x42c4bf[_0x8f9c('0x4c')]=_0x42c4bf[_0x8f9c('0x4c')]['length']?_0x42c4bf[_0x8f9c('0x4c')]:_0x250a8c[_0x8f9c('0x47')];_0x42c4bf[_0x8f9c('0x4d')]=qs[_0x8f9c('0x4e')](_0x1892f8[_0x8f9c('0x4a')][_0x8f9c('0x4e')]);_0x42c4bf[_0x8f9c('0x4f')]=qs[_0x8f9c('0x51')](_[_0x8f9c('0x50')](_0x1892f8[_0x8f9c('0x4a')],_0x250a8c[_0x8f9c('0x51')]));if(_0x1892f8[_0x8f9c('0x4a')]['filter']){_0x42c4bf['where']=_['merge'](_0x42c4bf[_0x8f9c('0x4f')],{'$or':_[_0x8f9c('0x42')](_0x42c4bf[_0x8f9c('0x4c')],function(_0x3005cf){var _0x44e371={};_0x44e371[_0x3005cf]={'$like':'%'+_0x1892f8[_0x8f9c('0x4a')][_0x8f9c('0x52')]+'%'};return _0x44e371;})});}_0x42c4bf=_[_0x8f9c('0x53')]({},_0x42c4bf,_0x1892f8['options']);return _0x3a409[_0x8f9c('0xb3')](_0x42c4bf);}})['then'](function(_0x5cfbc6){if(_0x5cfbc6){_0x410237=_0x5cfbc6[_0x8f9c('0x58')];if(!_0x1892f8[_0x8f9c('0x4a')][_0x8f9c('0x6e')](_0x8f9c('0x69'))){_0x42c4bf[_0x8f9c('0x32')]=qs['limit'](_0x1892f8[_0x8f9c('0x4a')][_0x8f9c('0x32')]);_0x42c4bf[_0x8f9c('0x30')]=qs[_0x8f9c('0x30')](_0x1892f8[_0x8f9c('0x4a')][_0x8f9c('0x30')]);}return _0x3a409['getAgents'](_0x42c4bf);}})[_0x8f9c('0x24')](function(_0x4e888c){if(_0x4e888c){return _0x4e888c?{'count':_0x410237,'rows':_0x4e888c}:null;}})['then'](respondWithResult(_0x4e6029,null))[_0x8f9c('0x2c')](handleError(_0x4e6029,null));};exports[_0x8f9c('0x3e')]=function(_0x58fb2e,_0x3f13d4,_0x47aaa6){var _0x4c330e,_0x354cd8,_0x395ca9;if(_[_0x8f9c('0x78')](_0x58fb2e[_0x8f9c('0x5b')][_0x8f9c('0x5b')])||_0x58fb2e[_0x8f9c('0x5b')][_0x8f9c('0x5b')]===''){throw new db['Sequelize'][(_0x8f9c('0x73'))](_0x8f9c('0xb4'));}if(_['isNil'](_0x58fb2e[_0x8f9c('0x5b')]['to'])){}_0x4c330e=_0x58fb2e['body']['to'];return db[_0x8f9c('0x43')]['findOne']({'where':{'id':_0x58fb2e['params']['id']}})[_0x8f9c('0x24')](handleEntityNotFound(_0x3f13d4,null))[_0x8f9c('0x24')](function(_0x53e543){if(_0x53e543){return db[_0x8f9c('0x43')][_0x8f9c('0x62')]({'where':{'id':_0x53e543['id']},'include':[{'model':db[_0x8f9c('0x7e')],'as':_0x8f9c('0x7f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0x53e543[_0x8f9c('0x7c')]]:_0x4c330e},'limit':0x1,'order':[[_0x8f9c('0x75'),_0x8f9c('0x81')]]}]}]})[_0x8f9c('0x24')](handleEntityNotFound(_0x3f13d4,null))['then'](function(_0x731729){if(_0x731729&&_0x731729['List']){_0x354cd8=_0x731729[_0x8f9c('0x5d')]({'plain':!![]});if(_0x354cd8[_0x8f9c('0x7f')]&&_0x354cd8['List'][_0x8f9c('0x80')][_0x8f9c('0x58')]){return _0x354cd8['List']['Contacts'][0x0];}return db[_0x8f9c('0x72')][_0x8f9c('0x5a')](_['defaults'](_0x58fb2e[_0x8f9c('0x5b')],{'firstName':_0x4c330e,[_0x731729['mapKey']]:_0x4c330e,'phone':_0x4c330e,'ListId':_0x354cd8['ListId']}));}})[_0x8f9c('0x24')](handleEntityNotFound(_0x3f13d4,null))[_0x8f9c('0x24')](function(_0x290bed){if(_0x290bed){_0x395ca9=_0x290bed;return db['OpenchannelInteraction'][_0x8f9c('0x62')]({'where':{'ContactId':_0x395ca9['id'],'closed':![],'OpenchannelAccountId':_0x354cd8['id']}})[_0x8f9c('0x24')](function(_0x1522a3){if(_0x1522a3){return[_0x1522a3,![]];}return db[_0x8f9c('0x8c')]['create']({'UserId':_0x58fb2e[_0x8f9c('0x5c')]['id'],'ContactId':_0x395ca9['id'],'OpenchannelAccountId':_0x354cd8['id'],'lastMsgDirection':_0x8f9c('0xb5'),'Messages':[_['merge'](_0x58fb2e[_0x8f9c('0x5b')],{'read':![],'body':_0x58fb2e[_0x8f9c('0x5b')][_0x8f9c('0x5b')],'OpenchannelAccountId':_0x354cd8['id'],'UserId':_0x58fb2e[_0x8f9c('0x5c')]['id'],'ContactId':_0x395ca9['id']})]},{'include':[{'model':db[_0x8f9c('0x98')],'as':'Messages'}]})[_0x8f9c('0x24')](function(_0x4588fe){return[_0x4588fe,!![]];});});}})['spread'](function(_0x1c618a,_0x5867ad){if(_0x5867ad){return _0x1c618a;}return db[_0x8f9c('0x98')][_0x8f9c('0x5a')](_[_0x8f9c('0x53')](_0x58fb2e['body'],{'read':![],'body':_0x58fb2e[_0x8f9c('0x5b')][_0x8f9c('0x5b')],'OpenchannelAccountId':_0x354cd8['id'],'OpenchannelInteractionId':_0x1c618a['id'],'UserId':_0x58fb2e[_0x8f9c('0x5c')]['id'],'ContactId':_0x395ca9['id']}))['then'](function(_0x3d2a86){_0x1c618a[_0x8f9c('0xb6')][_0x8f9c('0xb7')]=[];_0x1c618a[_0x8f9c('0xb6')][_0x8f9c('0xb7')][_0x8f9c('0x95')](_0x3d2a86[_0x8f9c('0xb6')]);return _0x1c618a;});});}})['then'](respondWithResult(_0x3f13d4,null))[_0x8f9c('0x2c')](handleError(_0x3f13d4,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 071ad2b..5ea31cc 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 _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4483,0x1a3));var _0x3448=function(_0x2f786a,_0x45e7f9){_0x2f786a=_0x2f786a-0x0;var _0xb0f046=_0x4483[_0x2f786a];return _0xb0f046;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x878f=['hook','exports','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x489535,_0x455fc3){var _0x595fc2=function(_0xa44708){while(--_0xa44708){_0x489535['push'](_0x489535['shift']());}};_0x595fc2(++_0x455fc3);}(_0x878f,0x173));var _0xf878=function(_0x12b982,_0x3bf59f){_0x12b982=_0x12b982-0x0;var _0x4f149e=_0x878f[_0x12b982];return _0x4f149e;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xf878('0x0'))['db'][_0xf878('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf878('0x2')](0x0);var events={'afterCreate':_0xf878('0x3'),'afterUpdate':_0xf878('0x4'),'afterDestroy':_0xf878('0x5')};function emitEvent(_0x9e6783){return function(_0x45a37b,_0x240b48,_0xcf1927){OpenchannelAccountEvents[_0xf878('0x6')](_0x9e6783+':'+_0x45a37b['id'],_0x45a37b);OpenchannelAccountEvents['emit'](_0x9e6783,_0x45a37b);_0xcf1927(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xf878('0x7')](e,emitEvent(event));}}module[_0xf878('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 38cdc8f..c335e89 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(_0x2ff34a,_0x5bcbee){var _0xe9bd6=function(_0x44e385){while(--_0x44e385){_0x2ff34a['push'](_0x2ff34a['shift']());}};_0xe9bd6(++_0x5bcbee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x452c86,_0x3eb5c2){var _0x11dde2=function(_0x12268f){while(--_0x12268f){_0x452c86['push'](_0x452c86['shift']());}};_0x11dde2(++_0x3eb5c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 e06b61a..1379f48 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 _0x1c7c=['debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then','info','request\x20sent'];(function(_0x4f4b8d,_0x45ba51){var _0x67101=function(_0x22f5b3){while(--_0x22f5b3){_0x4f4b8d['push'](_0x4f4b8d['shift']());}};_0x67101(++_0x45ba51);}(_0x1c7c,0x164));var _0xc1c7=function(_0xb2e2a2,_0x2aeb9a){_0xb2e2a2=_0xb2e2a2-0x0;var _0x4e415c=_0x1c7c[_0xb2e2a2];return _0x4e415c;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});config[_0xc1c7('0xc')]=_[_0xc1c7('0xd')](config[_0xc1c7('0xc')],{'host':_0xc1c7('0xe'),'port':0x18eb});var socket=require(_0xc1c7('0xf'))(new Redis(config[_0xc1c7('0xc')]));require(_0xc1c7('0x10'))[_0xc1c7('0x11')](socket);function respondWithRpcPromise(_0x301abf,_0x25a669,_0x4df577){return new BPromise(function(_0x3b0748,_0x246ced){return client['request'](_0x301abf,_0x4df577)[_0xc1c7('0x12')](function(_0x5ac140){logger[_0xc1c7('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x25a669,_0xc1c7('0x14'));logger[_0xc1c7('0x15')](_0xc1c7('0x16'),_0x25a669,_0xc1c7('0x14'),JSON[_0xc1c7('0x17')](_0x5ac140));if(_0x5ac140[_0xc1c7('0x18')]){if(_0x5ac140[_0xc1c7('0x18')][_0xc1c7('0x19')]===0x1f4){logger[_0xc1c7('0x18')](_0xc1c7('0x1a'),_0x25a669,_0x5ac140[_0xc1c7('0x18')][_0xc1c7('0x1b')]);return _0x246ced(_0x5ac140['error'][_0xc1c7('0x1b')]);}logger[_0xc1c7('0x18')](_0xc1c7('0x1a'),_0x25a669,_0x5ac140['error'][_0xc1c7('0x1b')]);return _0x3b0748(_0x5ac140[_0xc1c7('0x18')][_0xc1c7('0x1b')]);}else{logger[_0xc1c7('0x13')](_0xc1c7('0x1a'),_0x25a669,_0xc1c7('0x14'));_0x3b0748(_0x5ac140[_0xc1c7('0x1c')][_0xc1c7('0x1b')]);}})['catch'](function(_0x37d748){logger[_0xc1c7('0x18')](_0xc1c7('0x1a'),_0x25a669,_0x37d748);_0x246ced(_0x37d748);});});} \ No newline at end of file +var _0x74f0=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ec522,_0x28b610){var _0x4bb694=function(_0x8426a7){while(--_0x8426a7){_0x3ec522['push'](_0x3ec522['shift']());}};_0x4bb694(++_0x28b610);}(_0x74f0,0xf3));var _0x074f=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x74f0[_0x431ff8];return _0x84ccd4;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x074f('0x1'));var fs=require('fs');var Redis=require(_0x074f('0x2'));var db=require(_0x074f('0x3'))['db'];var utils=require(_0x074f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x074f('0x5'));var jayson=require(_0x074f('0x6'));var client=jayson[_0x074f('0x7')][_0x074f('0x8')]({'port':0x232a});config[_0x074f('0x9')]=_[_0x074f('0xa')](config[_0x074f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x074f('0xb'))(new Redis(config[_0x074f('0x9')]));require('./openchannelAccount.socket')[_0x074f('0xc')](socket);function respondWithRpcPromise(_0x1a778a,_0x4337f9,_0x33d8c4){return new BPromise(function(_0x40179d,_0x4f37e1){return client['request'](_0x1a778a,_0x33d8c4)[_0x074f('0xd')](function(_0x41646d){logger[_0x074f('0xe')](_0x074f('0xf'),_0x4337f9,_0x074f('0x10'));logger[_0x074f('0x11')](_0x074f('0x12'),_0x4337f9,_0x074f('0x10'),JSON[_0x074f('0x13')](_0x41646d));if(_0x41646d['error']){if(_0x41646d[_0x074f('0x14')]['code']===0x1f4){logger[_0x074f('0x14')](_0x074f('0xf'),_0x4337f9,_0x41646d[_0x074f('0x14')][_0x074f('0x15')]);return _0x4f37e1(_0x41646d[_0x074f('0x14')][_0x074f('0x15')]);}logger[_0x074f('0x14')](_0x074f('0xf'),_0x4337f9,_0x41646d[_0x074f('0x14')][_0x074f('0x15')]);return _0x40179d(_0x41646d[_0x074f('0x14')]['message']);}else{logger[_0x074f('0xe')](_0x074f('0xf'),_0x4337f9,_0x074f('0x10'));_0x40179d(_0x41646d[_0x074f('0x16')][_0x074f('0x15')]);}})[_0x074f('0x17')](function(_0x548aab){logger['error'](_0x074f('0xf'),_0x4337f9,_0x548aab);_0x4f37e1(_0x548aab);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index efa93f9..f0d7d36 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 _0xfd2f=['./openchannelAccount.events','save','remove','emit','removeListener','length'];(function(_0x21dd3e,_0x306b9a){var _0x5419f6=function(_0x4f958d){while(--_0x4f958d){_0x21dd3e['push'](_0x21dd3e['shift']());}};_0x5419f6(++_0x306b9a);}(_0xfd2f,0x14a));var _0xffd2=function(_0x2dac82,_0x513961){_0x2dac82=_0x2dac82-0x0;var _0x39781e=_0xfd2f[_0x2dac82];return _0x39781e;};'use strict';var OpenchannelAccountEvents=require(_0xffd2('0x0'));var events=[_0xffd2('0x1'),_0xffd2('0x2'),'update'];function createListener(_0x1e12be,_0x4cf490){return function(_0x320a2a){_0x4cf490[_0xffd2('0x3')](_0x1e12be,_0x320a2a);};}function removeListener(_0x492c33,_0x983987){return function(){OpenchannelAccountEvents[_0xffd2('0x4')](_0x492c33,_0x983987);};}exports['register']=function(_0x5955d2){for(var _0x490a28=0x0,_0xd5e752=events[_0xffd2('0x5')];_0x490a28<_0xd5e752;_0x490a28++){var _0x56a1e2=events[_0x490a28];var _0x35d327=createListener('openchannelAccount:'+_0x56a1e2,_0x5955d2);OpenchannelAccountEvents['on'](_0x56a1e2,_0x35d327);}}; \ No newline at end of file +var _0xc576=['./openchannelAccount.events','save','remove','update','emit','removeListener','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc576,0x1ea));var _0x6c57=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0xc576[_0x3b8f2e];return _0x1433d5;};'use strict';var OpenchannelAccountEvents=require(_0x6c57('0x0'));var events=[_0x6c57('0x1'),_0x6c57('0x2'),_0x6c57('0x3')];function createListener(_0x187b99,_0x48e354){return function(_0x4fc60a){_0x48e354[_0x6c57('0x4')](_0x187b99,_0x4fc60a);};}function removeListener(_0x4e5df7,_0x31ab9f){return function(){OpenchannelAccountEvents[_0x6c57('0x5')](_0x4e5df7,_0x31ab9f);};}exports['register']=function(_0xa6e0c4){for(var _0x5e81a6=0x0,_0x95550a=events[_0x6c57('0x6')];_0x5e81a6<_0x95550a;_0x5e81a6++){var _0x599efc=events[_0x5e81a6];var _0x1b707a=createListener('openchannelAccount:'+_0x599efc,_0xa6e0c4);OpenchannelAccountEvents['on'](_0x599efc,_0x1b707a);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8fc1b1b..99bf907 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 _0xf4e0=['get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller'];(function(_0x4d5535,_0x46f529){var _0x24db31=function(_0x30c927){while(--_0x30c927){_0x4d5535['push'](_0x4d5535['shift']());}};_0x24db31(++_0x46f529);}(_0xf4e0,0x118));var _0x0f4e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf4e0[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x0f4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0f4e('0x1'));var router=express[_0x0f4e('0x2')]();var fs_extra=require(_0x0f4e('0x3'));var auth=require(_0x0f4e('0x4'));var interaction=require(_0x0f4e('0x5'));var config=require(_0x0f4e('0x6'));var controller=require(_0x0f4e('0x7'));router[_0x0f4e('0x8')]('/',auth[_0x0f4e('0x9')](),controller['index']);router[_0x0f4e('0x8')]('/:id',auth[_0x0f4e('0x9')](),controller[_0x0f4e('0xa')]);router[_0x0f4e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0f4e('0xc')](_0x0f4e('0xd'),auth['isAuthenticated'](),controller[_0x0f4e('0xe')]);router[_0x0f4e('0xf')](_0x0f4e('0xd'),auth[_0x0f4e('0x9')](),controller[_0x0f4e('0x10')]);module[_0x0f4e('0x11')]=router; \ No newline at end of file +var _0xf084=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','path'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xf084,0x1a2));var _0x4f08=function(_0x34bd4a,_0x19080f){_0x34bd4a=_0x34bd4a-0x0;var _0x5373e0=_0xf084[_0x34bd4a];return _0x5373e0;};'use strict';var multer=require(_0x4f08('0x0'));var util=require('util');var path=require(_0x4f08('0x1'));var timeout=require(_0x4f08('0x2'));var express=require(_0x4f08('0x3'));var router=express[_0x4f08('0x4')]();var fs_extra=require(_0x4f08('0x5'));var auth=require(_0x4f08('0x6'));var interaction=require(_0x4f08('0x7'));var config=require(_0x4f08('0x8'));var controller=require('./openchannelApplication.controller');router[_0x4f08('0x9')]('/',auth[_0x4f08('0xa')](),controller[_0x4f08('0xb')]);router[_0x4f08('0x9')](_0x4f08('0xc'),auth[_0x4f08('0xa')](),controller[_0x4f08('0xd')]);router[_0x4f08('0xe')]('/',auth[_0x4f08('0xa')](),controller[_0x4f08('0xf')]);router[_0x4f08('0x10')](_0x4f08('0xc'),auth[_0x4f08('0xa')](),controller[_0x4f08('0x11')]);router[_0x4f08('0x12')](_0x4f08('0xc'),auth['isAuthenticated'](),controller[_0x4f08('0x13')]);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 b5d66f9..f9d417e 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 _0xe0e2=['INTEGER','noop','*,*,*,*','exports'];(function(_0x62bf17,_0x2f5e59){var _0x2fa81b=function(_0x189f28){while(--_0x189f28){_0x62bf17['push'](_0x62bf17['shift']());}};_0x2fa81b(++_0x2f5e59);}(_0xe0e2,0x197));var _0x2e0e=function(_0x22889a,_0x4b75f7){_0x22889a=_0x22889a-0x0;var _0x763d34=_0xe0e2[_0x22889a];return _0x763d34;};'use strict';var Sequelize=require('sequelize');module[_0x2e0e('0x0')]={'priority':{'type':Sequelize[_0x2e0e('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e0e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2e0e('0x3')}}; \ No newline at end of file +var _0x88c7=['STRING','noop','*,*,*,*','sequelize'];(function(_0x3d7ebd,_0x212df1){var _0x5d812c=function(_0x14725c){while(--_0x14725c){_0x3d7ebd['push'](_0x3d7ebd['shift']());}};_0x5d812c(++_0x212df1);}(_0x88c7,0x6f));var _0x788c=function(_0x18a0e9,_0x1e12f1){_0x18a0e9=_0x18a0e9-0x0;var _0xdfe359=_0x88c7[_0x18a0e9];return _0xdfe359;};'use strict';var Sequelize=require(_0x788c('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x788c('0x1')],'allowNull':![],'defaultValue':_0x788c('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x788c('0x1')],'defaultValue':_0x788c('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 89c1381..6fd69e0 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 _0x0ce2=['sort','where','filter','merge','options','includeAll','include','findAll','show','params','find','catch','create','update','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','error','stack','send','map','OpenchannelApplication','rawAttributes','type','key','model','name','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x4e18c0,_0x13eddb){var _0x321bc8=function(_0x1098e6){while(--_0x1098e6){_0x4e18c0['push'](_0x4e18c0['shift']());}};_0x321bc8(++_0x13eddb);}(_0x0ce2,0x1b3));var _0x20ce=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0ce2[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x20ce('0x0'));var rimraf=require(_0x20ce('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20ce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x20ce('0x3'));var Mustache=require(_0x20ce('0x4'));var util=require(_0x20ce('0x5'));var path=require(_0x20ce('0x6'));var sox=require(_0x20ce('0x7'));var csv=require('to-csv');var ejs=require(_0x20ce('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20ce('0x9'));var squel=require(_0x20ce('0xa'));var crypto=require(_0x20ce('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x20ce('0xc'));var toCsv=require(_0x20ce('0xd'));var querystring=require(_0x20ce('0xe'));var Papa=require(_0x20ce('0xf'));var Redis=require(_0x20ce('0x10'));var authService=require(_0x20ce('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x20ce('0x12'));var hardwareService=require(_0x20ce('0x13'));var logger=require(_0x20ce('0x14'))(_0x20ce('0x15'));var utils=require('../../config/utils');var config=require(_0x20ce('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x20ce('0x17'))['db'];function respondWithStatusCode(_0x3868bf,_0x421ed3){_0x421ed3=_0x421ed3||0xcc;return function(_0x15b6db){if(_0x15b6db){return _0x3868bf[_0x20ce('0x18')](_0x421ed3);}return _0x3868bf[_0x20ce('0x19')](_0x421ed3)[_0x20ce('0x1a')]();};}function respondWithResult(_0x45b0f4,_0x2770fd){_0x2770fd=_0x2770fd||0xc8;return function(_0x390171){if(_0x390171){return _0x45b0f4[_0x20ce('0x19')](_0x2770fd)[_0x20ce('0x1b')](_0x390171);}};}function respondWithFilteredResult(_0xfcdbbc,_0x5ee356){return function(_0x37bad0){if(_0x37bad0){var _0x30c7c3=typeof _0x5ee356[_0x20ce('0x1c')]===_0x20ce('0x1d')&&typeof _0x5ee356[_0x20ce('0x1e')]===_0x20ce('0x1d');var _0x8bbac3=_0x37bad0['count'];var _0x3fff63=_0x30c7c3?0x0:_0x5ee356['offset'];var _0x5aed74=_0x30c7c3?_0x37bad0[_0x20ce('0x1f')]:_0x5ee356[_0x20ce('0x1c')]+_0x5ee356['limit'];var _0x22166c;if(_0x5aed74>=_0x8bbac3){_0x5aed74=_0x8bbac3;_0x22166c=0xc8;}else{_0x22166c=0xce;}_0xfcdbbc[_0x20ce('0x19')](_0x22166c);return _0xfcdbbc['set'](_0x20ce('0x20'),_0x3fff63+'-'+_0x5aed74+'/'+_0x8bbac3)[_0x20ce('0x1b')](_0x37bad0);}return null;};}function patchUpdates(_0x4def9b){return function(_0x467780){try{jsonpatch[_0x20ce('0x21')](_0x467780,_0x4def9b,!![]);}catch(_0x5421eb){return BPromise['reject'](_0x5421eb);}return _0x467780[_0x20ce('0x22')]();};}function saveUpdates(_0x52bbde,_0x4d3ee7){return function(_0x56b970){if(_0x56b970){return _0x56b970['update'](_0x52bbde)[_0x20ce('0x23')](function(_0x37c89d){return _0x37c89d;});}return null;};}function removeEntity(_0x14c3cb,_0xf30ba8){return function(_0x286116){if(_0x286116){return _0x286116['destroy']()[_0x20ce('0x23')](function(){_0x14c3cb[_0x20ce('0x19')](0xcc)[_0x20ce('0x1a')]();});}};}function handleEntityNotFound(_0x2e435d,_0x14bed3){return function(_0x266007){if(!_0x266007){_0x2e435d[_0x20ce('0x18')](0x194);}return _0x266007;};}function handleError(_0x4e9602,_0x14e6e9){_0x14e6e9=_0x14e6e9||0x1f4;return function(_0x7a9dcd){logger[_0x20ce('0x24')](_0x7a9dcd[_0x20ce('0x25')]);if(_0x7a9dcd['name']){delete _0x7a9dcd['name'];}_0x4e9602[_0x20ce('0x19')](_0x14e6e9)[_0x20ce('0x26')](_0x7a9dcd);};}exports['index']=function(_0x3dd4cd,_0x2b161f){var _0x43679b={},_0x3091ab={},_0x54315d={'count':0x0,'rows':[]};var _0x5479e3=_[_0x20ce('0x27')](db[_0x20ce('0x28')][_0x20ce('0x29')],function(_0x5496f8){return{'name':_0x5496f8['fieldName'],'type':_0x5496f8[_0x20ce('0x2a')][_0x20ce('0x2b')]};});_0x3091ab[_0x20ce('0x2c')]=_['map'](_0x5479e3,_0x20ce('0x2d'));_0x3091ab['query']=_[_0x20ce('0x2e')](_0x3dd4cd[_0x20ce('0x2f')]);_0x3091ab[_0x20ce('0x30')]=_['intersection'](_0x3091ab[_0x20ce('0x2c')],_0x3091ab['query']);_0x43679b[_0x20ce('0x31')]=_[_0x20ce('0x32')](_0x3091ab['model'],qs[_0x20ce('0x33')](_0x3dd4cd[_0x20ce('0x2f')][_0x20ce('0x33')]));_0x43679b[_0x20ce('0x31')]=_0x43679b[_0x20ce('0x31')][_0x20ce('0x34')]?_0x43679b[_0x20ce('0x31')]:_0x3091ab[_0x20ce('0x2c')];if(!_0x3dd4cd[_0x20ce('0x2f')][_0x20ce('0x35')](_0x20ce('0x36'))){_0x43679b[_0x20ce('0x1e')]=qs[_0x20ce('0x1e')](_0x3dd4cd['query']['limit']);_0x43679b[_0x20ce('0x1c')]=qs[_0x20ce('0x1c')](_0x3dd4cd[_0x20ce('0x2f')][_0x20ce('0x1c')]);}_0x43679b['order']=qs[_0x20ce('0x37')](_0x3dd4cd[_0x20ce('0x2f')][_0x20ce('0x37')]);_0x43679b[_0x20ce('0x38')]=qs[_0x20ce('0x30')](_['pick'](_0x3dd4cd[_0x20ce('0x2f')],_0x3091ab[_0x20ce('0x30')]),_0x5479e3);if(_0x3dd4cd['query'][_0x20ce('0x39')]){_0x43679b[_0x20ce('0x38')]=_[_0x20ce('0x3a')](_0x43679b[_0x20ce('0x38')],{'$or':_[_0x20ce('0x27')](_0x5479e3,function(_0x4c357e){if(_0x4c357e[_0x20ce('0x2a')]!=='VIRTUAL'){var _0x1a5c0a={};_0x1a5c0a[_0x4c357e[_0x20ce('0x2d')]]={'$like':'%'+_0x3dd4cd[_0x20ce('0x2f')][_0x20ce('0x39')]+'%'};return _0x1a5c0a;}})});}_0x43679b=_[_0x20ce('0x3a')]({},_0x43679b,_0x3dd4cd[_0x20ce('0x3b')]);var _0x5b66b0={'where':_0x43679b[_0x20ce('0x38')]};return db[_0x20ce('0x28')]['count'](_0x5b66b0)[_0x20ce('0x23')](function(_0x43b3e2){_0x54315d[_0x20ce('0x1f')]=_0x43b3e2;if(_0x3dd4cd[_0x20ce('0x2f')][_0x20ce('0x3c')]){_0x43679b[_0x20ce('0x3d')]=[{'all':!![]}];}return db[_0x20ce('0x28')][_0x20ce('0x3e')](_0x43679b);})['then'](function(_0x36bb0f){_0x54315d['rows']=_0x36bb0f;return _0x54315d;})['then'](respondWithFilteredResult(_0x2b161f,_0x43679b))['catch'](handleError(_0x2b161f,null));};exports[_0x20ce('0x3f')]=function(_0x1b9ae3,_0xb15e36){var _0x248644={'raw':!![],'where':{'id':_0x1b9ae3[_0x20ce('0x40')]['id']}},_0x14d00e={};_0x14d00e[_0x20ce('0x2c')]=_[_0x20ce('0x2e')](db[_0x20ce('0x28')]['rawAttributes']);_0x14d00e[_0x20ce('0x2f')]=_[_0x20ce('0x2e')](_0x1b9ae3[_0x20ce('0x2f')]);_0x14d00e[_0x20ce('0x30')]=_[_0x20ce('0x32')](_0x14d00e[_0x20ce('0x2c')],_0x14d00e[_0x20ce('0x2f')]);_0x248644['attributes']=_[_0x20ce('0x32')](_0x14d00e[_0x20ce('0x2c')],qs[_0x20ce('0x33')](_0x1b9ae3[_0x20ce('0x2f')][_0x20ce('0x33')]));_0x248644[_0x20ce('0x31')]=_0x248644[_0x20ce('0x31')][_0x20ce('0x34')]?_0x248644[_0x20ce('0x31')]:_0x14d00e[_0x20ce('0x2c')];if(_0x1b9ae3[_0x20ce('0x2f')][_0x20ce('0x3c')]){_0x248644['include']=[{'all':!![]}];}_0x248644=_[_0x20ce('0x3a')]({},_0x248644,_0x1b9ae3['options']);return db[_0x20ce('0x28')][_0x20ce('0x41')](_0x248644)['then'](handleEntityNotFound(_0xb15e36,null))[_0x20ce('0x23')](respondWithResult(_0xb15e36,null))[_0x20ce('0x42')](handleError(_0xb15e36,null));};exports[_0x20ce('0x43')]=function(_0x22eb94,_0x4b7379){return db[_0x20ce('0x28')]['create'](_0x22eb94['body'],{})['then'](respondWithResult(_0x4b7379,0xc9))[_0x20ce('0x42')](handleError(_0x4b7379,null));};exports[_0x20ce('0x44')]=function(_0xf5b47a,_0x156c82){if(_0xf5b47a[_0x20ce('0x45')]['id']){delete _0xf5b47a[_0x20ce('0x45')]['id'];}return db[_0x20ce('0x28')][_0x20ce('0x41')]({'where':{'id':_0xf5b47a[_0x20ce('0x40')]['id']}})[_0x20ce('0x23')](handleEntityNotFound(_0x156c82,null))[_0x20ce('0x23')](saveUpdates(_0xf5b47a[_0x20ce('0x45')],null))['then'](respondWithResult(_0x156c82,null))[_0x20ce('0x42')](handleError(_0x156c82,null));};exports['destroy']=function(_0x54dbdf,_0x4539ab){return db[_0x20ce('0x28')][_0x20ce('0x41')]({'where':{'id':_0x54dbdf['params']['id']}})[_0x20ce('0x23')](handleEntityNotFound(_0x4539ab,null))[_0x20ce('0x23')](removeEntity(_0x4539ab,null))[_0x20ce('0x42')](handleError(_0x4539ab,null));}; \ No newline at end of file +var _0xa93c=['end','offset','limit','undefined','Content-Range','json','apply','save','update','then','destroy','error','name','send','index','map','OpenchannelApplication','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','show','params','rawAttributes','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status'];(function(_0x34e1ec,_0x306a61){var _0x3af360=function(_0x4fbf5b){while(--_0x4fbf5b){_0x34e1ec['push'](_0x34e1ec['shift']());}};_0x3af360(++_0x306a61);}(_0xa93c,0xfe));var _0xca93=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xa93c[_0x1e6db3];return _0x1de886;};'use strict';var emlformat=require(_0xca93('0x0'));var rimraf=require(_0xca93('0x1'));var zipdir=require(_0xca93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xca93('0x3'));var BPromise=require(_0xca93('0x4'));var Mustache=require(_0xca93('0x5'));var util=require('util');var path=require(_0xca93('0x6'));var sox=require(_0xca93('0x7'));var csv=require(_0xca93('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca93('0x9'));var _=require('lodash');var squel=require(_0xca93('0xa'));var crypto=require(_0xca93('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xca93('0x8'));var querystring=require(_0xca93('0xc'));var Papa=require('papaparse');var Redis=require(_0xca93('0xd'));var authService=require(_0xca93('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xca93('0xf'));var hardwareService=require(_0xca93('0x10'));var logger=require(_0xca93('0x11'))(_0xca93('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xca93('0x13'))['db'];function respondWithStatusCode(_0x12a4f9,_0x489ddd){_0x489ddd=_0x489ddd||0xcc;return function(_0x4c3d4f){if(_0x4c3d4f){return _0x12a4f9[_0xca93('0x14')](_0x489ddd);}return _0x12a4f9[_0xca93('0x15')](_0x489ddd)[_0xca93('0x16')]();};}function respondWithResult(_0x4a3a01,_0x5ad225){_0x5ad225=_0x5ad225||0xc8;return function(_0x59c96c){if(_0x59c96c){return _0x4a3a01['status'](_0x5ad225)['json'](_0x59c96c);}};}function respondWithFilteredResult(_0x2a6070,_0x28bf26){return function(_0x5d3388){if(_0x5d3388){var _0x462c01=typeof _0x28bf26[_0xca93('0x17')]==='undefined'&&typeof _0x28bf26[_0xca93('0x18')]===_0xca93('0x19');var _0x2fbde2=_0x5d3388['count'];var _0x238a25=_0x462c01?0x0:_0x28bf26[_0xca93('0x17')];var _0x50b75f=_0x462c01?_0x5d3388['count']:_0x28bf26[_0xca93('0x17')]+_0x28bf26[_0xca93('0x18')];var _0x506a5a;if(_0x50b75f>=_0x2fbde2){_0x50b75f=_0x2fbde2;_0x506a5a=0xc8;}else{_0x506a5a=0xce;}_0x2a6070[_0xca93('0x15')](_0x506a5a);return _0x2a6070['set'](_0xca93('0x1a'),_0x238a25+'-'+_0x50b75f+'/'+_0x2fbde2)[_0xca93('0x1b')](_0x5d3388);}return null;};}function patchUpdates(_0x583008){return function(_0x24ffcb){try{jsonpatch[_0xca93('0x1c')](_0x24ffcb,_0x583008,!![]);}catch(_0x4a2f24){return BPromise['reject'](_0x4a2f24);}return _0x24ffcb[_0xca93('0x1d')]();};}function saveUpdates(_0x5ade61,_0x2bacde){return function(_0x10dab7){if(_0x10dab7){return _0x10dab7[_0xca93('0x1e')](_0x5ade61)[_0xca93('0x1f')](function(_0x1609f3){return _0x1609f3;});}return null;};}function removeEntity(_0x17a7f8,_0x1846fc){return function(_0x4b24cf){if(_0x4b24cf){return _0x4b24cf[_0xca93('0x20')]()[_0xca93('0x1f')](function(){_0x17a7f8[_0xca93('0x15')](0xcc)[_0xca93('0x16')]();});}};}function handleEntityNotFound(_0xe298d6,_0x552455){return function(_0x5cdf79){if(!_0x5cdf79){_0xe298d6['sendStatus'](0x194);}return _0x5cdf79;};}function handleError(_0x26a6df,_0x28c312){_0x28c312=_0x28c312||0x1f4;return function(_0x32a215){logger[_0xca93('0x21')](_0x32a215['stack']);if(_0x32a215[_0xca93('0x22')]){delete _0x32a215[_0xca93('0x22')];}_0x26a6df[_0xca93('0x15')](_0x28c312)[_0xca93('0x23')](_0x32a215);};}exports[_0xca93('0x24')]=function(_0x4db774,_0x254530){var _0x2e9820={},_0x294d68={},_0xbda0c6={'count':0x0,'rows':[]};var _0x205254=_[_0xca93('0x25')](db[_0xca93('0x26')]['rawAttributes'],function(_0x208c3e){return{'name':_0x208c3e['fieldName'],'type':_0x208c3e[_0xca93('0x27')][_0xca93('0x28')]};});_0x294d68['model']=_[_0xca93('0x25')](_0x205254,_0xca93('0x22'));_0x294d68[_0xca93('0x29')]=_[_0xca93('0x2a')](_0x4db774['query']);_0x294d68[_0xca93('0x2b')]=_['intersection'](_0x294d68['model'],_0x294d68[_0xca93('0x29')]);_0x2e9820[_0xca93('0x2c')]=_[_0xca93('0x2d')](_0x294d68[_0xca93('0x2e')],qs[_0xca93('0x2f')](_0x4db774[_0xca93('0x29')]['fields']));_0x2e9820[_0xca93('0x2c')]=_0x2e9820['attributes'][_0xca93('0x30')]?_0x2e9820[_0xca93('0x2c')]:_0x294d68[_0xca93('0x2e')];if(!_0x4db774['query']['hasOwnProperty'](_0xca93('0x31'))){_0x2e9820[_0xca93('0x18')]=qs[_0xca93('0x18')](_0x4db774[_0xca93('0x29')][_0xca93('0x18')]);_0x2e9820['offset']=qs[_0xca93('0x17')](_0x4db774['query'][_0xca93('0x17')]);}_0x2e9820[_0xca93('0x32')]=qs[_0xca93('0x33')](_0x4db774[_0xca93('0x29')]['sort']);_0x2e9820[_0xca93('0x34')]=qs[_0xca93('0x2b')](_[_0xca93('0x35')](_0x4db774[_0xca93('0x29')],_0x294d68[_0xca93('0x2b')]),_0x205254);if(_0x4db774[_0xca93('0x29')][_0xca93('0x36')]){_0x2e9820[_0xca93('0x34')]=_[_0xca93('0x37')](_0x2e9820[_0xca93('0x34')],{'$or':_['map'](_0x205254,function(_0x22da94){if(_0x22da94[_0xca93('0x27')]!==_0xca93('0x38')){var _0x24d119={};_0x24d119[_0x22da94['name']]={'$like':'%'+_0x4db774[_0xca93('0x29')][_0xca93('0x36')]+'%'};return _0x24d119;}})});}_0x2e9820=_[_0xca93('0x37')]({},_0x2e9820,_0x4db774[_0xca93('0x39')]);var _0x2904c2={'where':_0x2e9820[_0xca93('0x34')]};return db[_0xca93('0x26')][_0xca93('0x3a')](_0x2904c2)[_0xca93('0x1f')](function(_0x4652f0){_0xbda0c6[_0xca93('0x3a')]=_0x4652f0;if(_0x4db774[_0xca93('0x29')]['includeAll']){_0x2e9820[_0xca93('0x3b')]=[{'all':!![]}];}return db[_0xca93('0x26')][_0xca93('0x3c')](_0x2e9820);})['then'](function(_0x387694){_0xbda0c6['rows']=_0x387694;return _0xbda0c6;})[_0xca93('0x1f')](respondWithFilteredResult(_0x254530,_0x2e9820))['catch'](handleError(_0x254530,null));};exports[_0xca93('0x3d')]=function(_0xb069a,_0x32c2f7){var _0x41acc4={'raw':!![],'where':{'id':_0xb069a[_0xca93('0x3e')]['id']}},_0x1088ea={};_0x1088ea['model']=_[_0xca93('0x2a')](db[_0xca93('0x26')][_0xca93('0x3f')]);_0x1088ea[_0xca93('0x29')]=_[_0xca93('0x2a')](_0xb069a[_0xca93('0x29')]);_0x1088ea[_0xca93('0x2b')]=_[_0xca93('0x2d')](_0x1088ea[_0xca93('0x2e')],_0x1088ea[_0xca93('0x29')]);_0x41acc4[_0xca93('0x2c')]=_['intersection'](_0x1088ea[_0xca93('0x2e')],qs[_0xca93('0x2f')](_0xb069a[_0xca93('0x29')][_0xca93('0x2f')]));_0x41acc4['attributes']=_0x41acc4[_0xca93('0x2c')][_0xca93('0x30')]?_0x41acc4[_0xca93('0x2c')]:_0x1088ea[_0xca93('0x2e')];if(_0xb069a['query'][_0xca93('0x40')]){_0x41acc4[_0xca93('0x3b')]=[{'all':!![]}];}_0x41acc4=_[_0xca93('0x37')]({},_0x41acc4,_0xb069a[_0xca93('0x39')]);return db[_0xca93('0x26')][_0xca93('0x41')](_0x41acc4)['then'](handleEntityNotFound(_0x32c2f7,null))['then'](respondWithResult(_0x32c2f7,null))[_0xca93('0x42')](handleError(_0x32c2f7,null));};exports[_0xca93('0x43')]=function(_0x1e8e6a,_0x4ea56d){return db[_0xca93('0x26')][_0xca93('0x43')](_0x1e8e6a['body'],{})['then'](respondWithResult(_0x4ea56d,0xc9))[_0xca93('0x42')](handleError(_0x4ea56d,null));};exports['update']=function(_0x3b30aa,_0x399264){if(_0x3b30aa[_0xca93('0x44')]['id']){delete _0x3b30aa[_0xca93('0x44')]['id'];}return db['OpenchannelApplication'][_0xca93('0x41')]({'where':{'id':_0x3b30aa['params']['id']}})[_0xca93('0x1f')](handleEntityNotFound(_0x399264,null))['then'](saveUpdates(_0x3b30aa[_0xca93('0x44')],null))[_0xca93('0x1f')](respondWithResult(_0x399264,null))[_0xca93('0x42')](handleError(_0x399264,null));};exports[_0xca93('0x20')]=function(_0xd686b3,_0x28990e){return db['OpenchannelApplication'][_0xca93('0x41')]({'where':{'id':_0xd686b3[_0xca93('0x3e')]['id']}})[_0xca93('0x1f')](handleEntityNotFound(_0x28990e,null))[_0xca93('0x1f')](removeEntity(_0x28990e,null))[_0xca93('0x42')](handleError(_0x28990e,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index a0cde15..2f24c78 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 _0xb700=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x18f032,_0x26d6cc){var _0x1c2e14=function(_0x3dada2){while(--_0x3dada2){_0x18f032['push'](_0x18f032['shift']());}};_0x1c2e14(++_0x26d6cc);}(_0xb700,0xfd));var _0x0b70=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0xb700[_0x10e983];return _0x324138;};'use strict';var _=require(_0x0b70('0x0'));var util=require(_0x0b70('0x1'));var logger=require(_0x0b70('0x2'))(_0x0b70('0x3'));var moment=require(_0x0b70('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b70('0x5'));var rimraf=require('rimraf');var config=require(_0x0b70('0x6'));var attributes=require(_0x0b70('0x7'));module[_0x0b70('0x8')]=function(_0x204e9a,_0x406348){return _0x204e9a[_0x0b70('0x9')](_0x0b70('0xa'),attributes,{'tableName':_0x0b70('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0b70('0xc'),'collate':_0x0b70('0xd')});}; \ No newline at end of file +var _0xb27a=['openchannel_applications','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','OpenchannelApplication'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xb27a,0x105));var _0xab27=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0xb27a[_0x4e21ba];return _0x55b94b;};'use strict';var _=require(_0xab27('0x0'));var util=require('util');var logger=require(_0xab27('0x1'))('api');var moment=require(_0xab27('0x2'));var BPromise=require('bluebird');var rp=require(_0xab27('0x3'));var fs=require('fs');var path=require(_0xab27('0x4'));var rimraf=require(_0xab27('0x5'));var config=require(_0xab27('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xab27('0x7')]=function(_0x4260f4,_0x582ff6){return _0x4260f4['define'](_0xab27('0x8'),attributes,{'tableName':_0xab27('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 d4c8d88..c90ac8b 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 _0x5ea5=['jayson/promise','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x293fa7,_0x1bdf5c){var _0x3f54dc=function(_0x465ae5){while(--_0x465ae5){_0x293fa7['push'](_0x293fa7['shift']());}};_0x3f54dc(++_0x1bdf5c);}(_0x5ea5,0xae));var _0x55ea=function(_0x375efe,_0x27df2d){_0x375efe=_0x375efe-0x0;var _0x1d5db6=_0x5ea5[_0x375efe];return _0x1d5db6;};'use strict';var _=require(_0x55ea('0x0'));var util=require('util');var moment=require(_0x55ea('0x1'));var BPromise=require(_0x55ea('0x2'));var rs=require(_0x55ea('0x3'));var fs=require('fs');var Redis=require(_0x55ea('0x4'));var db=require(_0x55ea('0x5'))['db'];var utils=require(_0x55ea('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x55ea('0x7'));var jayson=require(_0x55ea('0x8'));var client=jayson['client'][_0x55ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3678,_0x14158b,_0xfe8141){return new BPromise(function(_0x1abb4e,_0x8b01e4){return client[_0x55ea('0xa')](_0x5b3678,_0xfe8141)['then'](function(_0x41e436){logger[_0x55ea('0xb')](_0x55ea('0xc'),_0x14158b,'request\x20sent');logger[_0x55ea('0xd')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x14158b,_0x55ea('0xe'),JSON[_0x55ea('0xf')](_0x41e436));if(_0x41e436[_0x55ea('0x10')]){if(_0x41e436['error'][_0x55ea('0x11')]===0x1f4){logger[_0x55ea('0x10')](_0x55ea('0xc'),_0x14158b,_0x41e436[_0x55ea('0x10')][_0x55ea('0x12')]);return _0x8b01e4(_0x41e436[_0x55ea('0x10')][_0x55ea('0x12')]);}logger['error'](_0x55ea('0xc'),_0x14158b,_0x41e436[_0x55ea('0x10')][_0x55ea('0x12')]);return _0x1abb4e(_0x41e436['error']['message']);}else{logger[_0x55ea('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x14158b,_0x55ea('0xe'));_0x1abb4e(_0x41e436[_0x55ea('0x13')]['message']);}})['catch'](function(_0x3bb9b8){logger[_0x55ea('0x10')](_0x55ea('0xc'),_0x14158b,_0x3bb9b8);_0x8b01e4(_0x3bb9b8);});});}exports[_0x55ea('0x14')]=function(_0x54e14d){var _0x52e9e0=this;return new Promise(function(_0x3499e0,_0x68dc0a){return db[_0x55ea('0x15')][_0x55ea('0x16')](_0x54e14d['body'],{'raw':_0x54e14d[_0x55ea('0x17')]?_0x54e14d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54e14d[_0x55ea('0x17')]?_0x54e14d[_0x55ea('0x17')]['where']||null:null,'attributes':_0x54e14d[_0x55ea('0x17')]?_0x54e14d[_0x55ea('0x17')]['attributes']||null:null,'limit':_0x54e14d[_0x55ea('0x17')]?_0x54e14d['options']['limit']||null:null})[_0x55ea('0x18')](function(_0x5e4f68){logger[_0x55ea('0xb')](_0x55ea('0x14'),_0x54e14d);logger[_0x55ea('0xd')](_0x55ea('0x14'),_0x54e14d,JSON[_0x55ea('0xf')](_0x5e4f68));_0x3499e0(_0x5e4f68);})[_0x55ea('0x19')](function(_0x46a56d){logger[_0x55ea('0x10')](_0x55ea('0x14'),_0x46a56d[_0x55ea('0x12')],_0x54e14d);_0x68dc0a(_0x52e9e0[_0x55ea('0x10')](0x1f4,_0x46a56d['message']));});});}; \ No newline at end of file +var _0x5f5f=['code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw','where','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0x5f5f,0x1bd));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5f5('0x0'));var util=require(_0xf5f5('0x1'));var moment=require(_0xf5f5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5f5('0x3'));var db=require(_0xf5f5('0x4'))['db'];var utils=require(_0xf5f5('0x5'));var logger=require('../../config/logger')(_0xf5f5('0x6'));var config=require(_0xf5f5('0x7'));var jayson=require(_0xf5f5('0x8'));var client=jayson[_0xf5f5('0x9')][_0xf5f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57e710,_0x579b5e,_0x1991f9){return new BPromise(function(_0x2f07d2,_0x445696){return client[_0xf5f5('0xb')](_0x57e710,_0x1991f9)[_0xf5f5('0xc')](function(_0x2215e1){logger[_0xf5f5('0xd')](_0xf5f5('0xe'),_0x579b5e,_0xf5f5('0xf'));logger[_0xf5f5('0x10')](_0xf5f5('0x11'),_0x579b5e,_0xf5f5('0xf'),JSON[_0xf5f5('0x12')](_0x2215e1));if(_0x2215e1[_0xf5f5('0x13')]){if(_0x2215e1[_0xf5f5('0x13')][_0xf5f5('0x14')]===0x1f4){logger[_0xf5f5('0x13')](_0xf5f5('0xe'),_0x579b5e,_0x2215e1[_0xf5f5('0x13')][_0xf5f5('0x15')]);return _0x445696(_0x2215e1[_0xf5f5('0x13')]['message']);}logger['error'](_0xf5f5('0xe'),_0x579b5e,_0x2215e1[_0xf5f5('0x13')][_0xf5f5('0x15')]);return _0x2f07d2(_0x2215e1[_0xf5f5('0x13')][_0xf5f5('0x15')]);}else{logger['info'](_0xf5f5('0xe'),_0x579b5e,'request\x20sent');_0x2f07d2(_0x2215e1[_0xf5f5('0x16')][_0xf5f5('0x15')]);}})[_0xf5f5('0x17')](function(_0x392df6){logger[_0xf5f5('0x13')](_0xf5f5('0xe'),_0x579b5e,_0x392df6);_0x445696(_0x392df6);});});}exports[_0xf5f5('0x18')]=function(_0x36169c){var _0x40de8f=this;return new Promise(function(_0x787e2a,_0x1b0bb2){return db[_0xf5f5('0x19')]['update'](_0x36169c[_0xf5f5('0x1a')],{'raw':_0x36169c['options']?_0x36169c[_0xf5f5('0x1b')][_0xf5f5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36169c[_0xf5f5('0x1b')]?_0x36169c[_0xf5f5('0x1b')][_0xf5f5('0x1d')]||null:null,'attributes':_0x36169c[_0xf5f5('0x1b')]?_0x36169c[_0xf5f5('0x1b')]['attributes']||null:null,'limit':_0x36169c[_0xf5f5('0x1b')]?_0x36169c[_0xf5f5('0x1b')][_0xf5f5('0x1e')]||null:null})[_0xf5f5('0xc')](function(_0x276b9c){logger[_0xf5f5('0xd')](_0xf5f5('0x18'),_0x36169c);logger[_0xf5f5('0x10')]('UpdateOpenchannelApplication',_0x36169c,JSON[_0xf5f5('0x12')](_0x276b9c));_0x787e2a(_0x276b9c);})[_0xf5f5('0x17')](function(_0x3a8a78){logger[_0xf5f5('0x13')]('UpdateOpenchannelApplication',_0x3a8a78['message'],_0x36169c);_0x1b0bb2(_0x40de8f[_0xf5f5('0x13')](0x1f4,_0x3a8a78[_0xf5f5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0ebc301..a50452c 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 _0x232c=['put','openchannel','openchannelinteraction:update','openchannelinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x232c,0x1b9));var _0xc232=function(_0x532aec,_0x3ae4a2){_0x532aec=_0x532aec-0x0;var _0x2f47e3=_0x232c[_0x532aec];return _0x2f47e3;};'use strict';var multer=require(_0xc232('0x0'));var util=require('util');var path=require(_0xc232('0x1'));var timeout=require(_0xc232('0x2'));var express=require(_0xc232('0x3'));var router=express[_0xc232('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc232('0x5'));var config=require(_0xc232('0x6'));var controller=require(_0xc232('0x7'));router[_0xc232('0x8')]('/',auth[_0xc232('0x9')](),controller[_0xc232('0xa')]);router[_0xc232('0x8')](_0xc232('0xb'),auth[_0xc232('0x9')](),controller[_0xc232('0xc')]);router[_0xc232('0x8')](_0xc232('0xd'),auth[_0xc232('0x9')](),controller['show']);router[_0xc232('0x8')]('/:id/messages',auth[_0xc232('0x9')](),controller[_0xc232('0xe')]);router[_0xc232('0x8')](_0xc232('0xf'),auth[_0xc232('0x9')](),controller[_0xc232('0x10')]);router[_0xc232('0x11')]('/',auth['isAuthenticated'](),controller[_0xc232('0x12')]);router[_0xc232('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc232('0x13')]);router[_0xc232('0x11')](_0xc232('0x14'),auth[_0xc232('0x9')](),interaction[_0xc232('0x15')]('openchannel','openchannelinteraction:addtags'),controller[_0xc232('0x16')]);router[_0xc232('0x17')](_0xc232('0xd'),auth[_0xc232('0x9')](),interaction[_0xc232('0x15')](_0xc232('0x18'),_0xc232('0x19')),controller['update']);router['delete'](_0xc232('0xd'),auth[_0xc232('0x9')](),interaction['tracked'](_0xc232('0x18'),_0xc232('0x1a')),controller[_0xc232('0x1b')]);router['delete'](_0xc232('0x14'),auth[_0xc232('0x9')](),controller['removeTags']);module[_0xc232('0x1c')]=router; \ No newline at end of file +var _0x0133=['describe','/:id','show','/:id/messages','/:id/download','download','post','create','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0133,0x1e3));var _0x3013=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x0133[_0x174ef5];return _0x1cc379;};'use strict';var multer=require(_0x3013('0x0'));var util=require(_0x3013('0x1'));var path=require(_0x3013('0x2'));var timeout=require(_0x3013('0x3'));var express=require(_0x3013('0x4'));var router=express[_0x3013('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3013('0x6'));var interaction=require(_0x3013('0x7'));var config=require(_0x3013('0x8'));var controller=require(_0x3013('0x9'));router[_0x3013('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3013('0xa')](_0x3013('0xb'),auth[_0x3013('0xc')](),controller[_0x3013('0xd')]);router[_0x3013('0xa')](_0x3013('0xe'),auth[_0x3013('0xc')](),controller[_0x3013('0xf')]);router['get'](_0x3013('0x10'),auth[_0x3013('0xc')](),controller['getMessages']);router[_0x3013('0xa')](_0x3013('0x11'),auth[_0x3013('0xc')](),controller[_0x3013('0x12')]);router[_0x3013('0x13')]('/',auth['isAuthenticated'](),controller[_0x3013('0x14')]);router[_0x3013('0x13')](_0x3013('0x10'),auth[_0x3013('0xc')](),controller['addMessage']);router[_0x3013('0x13')]('/:id/tags',auth[_0x3013('0xc')](),interaction[_0x3013('0x15')](_0x3013('0x16'),_0x3013('0x17')),controller[_0x3013('0x18')]);router['put'](_0x3013('0xe'),auth[_0x3013('0xc')](),interaction['tracked'](_0x3013('0x16'),_0x3013('0x19')),controller[_0x3013('0x1a')]);router['delete'](_0x3013('0xe'),auth[_0x3013('0xc')](),interaction[_0x3013('0x15')]('openchannel',_0x3013('0x1b')),controller['destroy']);router[_0x3013('0x1c')]('/:id/tags',auth[_0x3013('0xc')](),controller[_0x3013('0x1d')]);module[_0x3013('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 35e7f39..e9925a1 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 _0xd943=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x383a9d,_0x298fd3){var _0x150332=function(_0x41fe69){while(--_0x41fe69){_0x383a9d['push'](_0x383a9d['shift']());}};_0x150332(++_0x298fd3);}(_0xd943,0x14a));var _0x3d94=function(_0x4dfc60,_0x2d71de){_0x4dfc60=_0x4dfc60-0x0;var _0x164f69=_0xd943[_0x4dfc60];return _0x164f69;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'closed':{'type':Sequelize[_0x3d94('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d94('0x3')]},'disposition':{'type':Sequelize[_0x3d94('0x4')]},'secondDisposition':{'type':Sequelize[_0x3d94('0x4')]},'thirdDisposition':{'type':Sequelize[_0x3d94('0x4')]},'note':{'type':Sequelize[_0x3d94('0x4')]},'read1stAt':{'type':Sequelize[_0x3d94('0x3')]},'threadId':{'type':Sequelize[_0x3d94('0x4')]},'externalUrl':{'type':Sequelize[_0x3d94('0x4')]},'lastMsgAt':{'type':Sequelize[_0x3d94('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3d94('0x5')]('in',_0x3d94('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3d94('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xd405=['out','BOOLEAN','STRING','DATE'];(function(_0x5b6202,_0x1bfe7e){var _0x52a374=function(_0x3d7978){while(--_0x3d7978){_0x5b6202['push'](_0x5b6202['shift']());}};_0x52a374(++_0x1bfe7e);}(_0xd405,0x1d2));var _0x5d40=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xd405[_0x35181c];return _0xe14bf9;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5d40('0x0')]},'secondDisposition':{'type':Sequelize[_0x5d40('0x0')]},'thirdDisposition':{'type':Sequelize[_0x5d40('0x0')]},'note':{'type':Sequelize[_0x5d40('0x0')]},'read1stAt':{'type':Sequelize[_0x5d40('0x1')]},'threadId':{'type':Sequelize[_0x5d40('0x0')]},'externalUrl':{'type':Sequelize[_0x5d40('0x0')]},'lastMsgAt':{'type':Sequelize[_0x5d40('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5d40('0x2')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0x5d40('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index f48b6e1..14fd2a3 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 _0x48f9=['end','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','keys','some','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','params','includeAll','include','options','create','destroy','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','order','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','openchannelInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','threadId','Public','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','firstName','renderFile','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status'];(function(_0x4a3c92,_0x2b15d9){var _0x211ed0=function(_0x532897){while(--_0x532897){_0x4a3c92['push'](_0x4a3c92['shift']());}};_0x211ed0(++_0x2b15d9);}(_0x48f9,0x1d9));var _0x948f=function(_0x35c9b1,_0x2567e5){_0x35c9b1=_0x35c9b1-0x0;var _0x50f96b=_0x48f9[_0x35c9b1];return _0x50f96b;};'use strict';var emlformat=require(_0x948f('0x0'));var rimraf=require(_0x948f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x948f('0x2'));var rp=require(_0x948f('0x3'));var moment=require(_0x948f('0x4'));var BPromise=require(_0x948f('0x5'));var Mustache=require(_0x948f('0x6'));var util=require('util');var path=require(_0x948f('0x7'));var sox=require(_0x948f('0x8'));var csv=require(_0x948f('0x9'));var ejs=require(_0x948f('0xa'));var fs=require('fs');var fs_extra=require(_0x948f('0xb'));var _=require(_0x948f('0xc'));var squel=require(_0x948f('0xd'));var crypto=require(_0x948f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x948f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x948f('0x10'));var Papa=require(_0x948f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x948f('0x12'));var as=require(_0x948f('0x13'));var pdf=require(_0x948f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x948f('0x15'));var config=require(_0x948f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x948f('0x17'))['db'];config[_0x948f('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x948f('0x19'))(new Redis(config[_0x948f('0x18')]));require(_0x948f('0x1a'))['register'](socket);function respondWithStatusCode(_0x5150c0,_0x504675){_0x504675=_0x504675||0xcc;return function(_0x293020){if(_0x293020){return _0x5150c0[_0x948f('0x1b')](_0x504675);}return _0x5150c0[_0x948f('0x1c')](_0x504675)[_0x948f('0x1d')]();};}function respondWithResult(_0x54da87,_0x20225a){_0x20225a=_0x20225a||0xc8;return function(_0x11cf77){if(_0x11cf77){return _0x54da87[_0x948f('0x1c')](_0x20225a)['json'](_0x11cf77);}};}function respondWithFilteredResult(_0x450f6b,_0x525866){return function(_0x353bef){if(_0x353bef){var _0x3b9f61=typeof _0x525866['offset']==='undefined'&&typeof _0x525866[_0x948f('0x1e')]==='undefined';var _0x31cfa0=_0x353bef['count'];var _0x28a739=_0x3b9f61?0x0:_0x525866[_0x948f('0x1f')];var _0x59a0b4=_0x3b9f61?_0x353bef[_0x948f('0x20')]:_0x525866[_0x948f('0x1f')]+_0x525866[_0x948f('0x1e')];var _0x630f16;if(_0x59a0b4>=_0x31cfa0){_0x59a0b4=_0x31cfa0;_0x630f16=0xc8;}else{_0x630f16=0xce;}_0x450f6b[_0x948f('0x1c')](_0x630f16);return _0x450f6b[_0x948f('0x21')](_0x948f('0x22'),_0x28a739+'-'+_0x59a0b4+'/'+_0x31cfa0)[_0x948f('0x23')](_0x353bef);}return null;};}function patchUpdates(_0x1ee64e){return function(_0x3253fd){try{jsonpatch[_0x948f('0x24')](_0x3253fd,_0x1ee64e,!![]);}catch(_0x2829b5){return BPromise[_0x948f('0x25')](_0x2829b5);}return _0x3253fd[_0x948f('0x26')]();};}function saveUpdates(_0x455f18,_0x674826){return function(_0x1c629f){if(_0x1c629f){return _0x1c629f[_0x948f('0x27')](_0x455f18)[_0x948f('0x28')](function(_0x4a44d6){return _0x4a44d6;});}return null;};}function removeEntity(_0x39dd7a,_0x464ae1){return function(_0x2d6df5){if(_0x2d6df5){return _0x2d6df5['destroy']()['then'](function(){_0x39dd7a['status'](0xcc)[_0x948f('0x1d')]();});}};}function handleEntityNotFound(_0x3aa631,_0x35f363){return function(_0x4fd6ee){if(!_0x4fd6ee){_0x3aa631[_0x948f('0x1b')](0x194);}return _0x4fd6ee;};}function handleError(_0x219b00,_0xe5bfc0){_0xe5bfc0=_0xe5bfc0||0x1f4;return function(_0x196882){logger[_0x948f('0x29')](_0x196882[_0x948f('0x2a')]);if(_0x196882[_0x948f('0x2b')]){delete _0x196882['name'];}_0x219b00[_0x948f('0x1c')](_0xe5bfc0)[_0x948f('0x2c')](_0x196882);};}function getInteractionUsers(_0xb5a0de,_0x250c6f){return new BPromise(function(_0x1fdfac,_0x3ff5c1){try{if(_0x250c6f[_0xb5a0de['id']]){_0xb5a0de['Users']=_[_0x948f('0x2d')](_0x250c6f[_0xb5a0de['id']],function(_0x2b9cef){return{'id':_0x2b9cef['id'],'fullname':_0x2b9cef[_0x948f('0x2e')]};});}}catch(_0x3d8b25){_0x3ff5c1(_0x3d8b25);}_0x1fdfac(_0xb5a0de);});}function getInteractionTags(_0x145d01,_0x15b0d6){return new BPromise(function(_0x1411df,_0x31012b){try{if(_0x145d01[_0x948f('0x2f')]){_0x145d01[_0x948f('0x30')]=[];_0x145d01[_0x948f('0x2f')][_0x948f('0x31')](',')[_0x948f('0x32')](function(_0x4c9b08){_0x145d01[_0x948f('0x30')][_0x948f('0x33')](_0x15b0d6[_0x4c9b08]);});}delete _0x145d01['TagIds'];}catch(_0x30d59e){_0x31012b(_0x30d59e);}_0x1411df(_0x145d01);});}function updateOpenchannelInteraction(_0x4c5fe5,_0x369499,_0x4fc433){return new BPromise(function(_0x1256a7,_0xb9759){return getInteractionUsers(_0x4c5fe5,_0x4fc433)[_0x948f('0x28')](function(_0xbb9005){return getInteractionTags(_0xbb9005,_0x369499);})[_0x948f('0x28')](function(_0x1cee2b){return getStateInteraction(_0x1cee2b);})[_0x948f('0x28')](function(_0x3a17f8){_0x1256a7(_0x3a17f8);})[_0x948f('0x34')](function(_0x1d3af2){_0xb9759(_0x1d3af2);});});}function getStateInteraction(_0x533387){return new BPromise(function(_0x55f999,_0x10c66f){_0x533387[_0x948f('0x35')]=0x0;_0x533387[_0x948f('0x36')]=0x0;_0x533387[_0x948f('0x37')]=0x0;_0x533387[_0x948f('0x38')]=0x0;_0x533387[_0x948f('0x39')]=0x0;if(!_0x533387[_0x948f('0x3a')]&&!_0x533387['UserId'])_0x533387[_0x948f('0x35')]+=0x1;if(!_0x533387[_0x948f('0x3a')]&&_0x533387[_0x948f('0x3b')])_0x533387[_0x948f('0x36')]+=0x1;if(_0x533387[_0x948f('0x3a')]&&_0x533387[_0x948f('0x3b')])_0x533387[_0x948f('0x37')]+=0x1;if(_0x533387['closed']&&!_0x533387[_0x948f('0x3b')])_0x533387[_0x948f('0x38')]+=0x1;_0x533387[_0x948f('0x39')]+=0x1;_0x55f999(_0x533387);});}exports[_0x948f('0x3c')]=function(_0xd69aa5,_0x77674d){var _0x902a4={},_0x1e1972={},_0x2d97f9={'count':0x0,'rows':[]};var _0x239d68=_[_0x948f('0x2d')](db[_0x948f('0x3d')][_0x948f('0x3e')],function(_0x5e948f){return{'name':_0x5e948f['fieldName'],'type':_0x5e948f[_0x948f('0x3f')][_0x948f('0x40')]};});_0x1e1972['model']=_[_0x948f('0x2d')](_0x239d68,_0x948f('0x2b'));_0x1e1972[_0x948f('0x41')]=_['keys'](_0xd69aa5[_0x948f('0x41')]);_0x1e1972[_0x948f('0x42')]=_[_0x948f('0x43')](_0x1e1972[_0x948f('0x44')],_0x1e1972[_0x948f('0x41')]);_0x902a4[_0x948f('0x45')]=_[_0x948f('0x43')](_0x1e1972['model'],qs[_0x948f('0x46')](_0xd69aa5[_0x948f('0x41')][_0x948f('0x46')]));_0x902a4[_0x948f('0x45')]=_0x902a4[_0x948f('0x45')][_0x948f('0x47')]?_0x902a4[_0x948f('0x45')]:_0x1e1972[_0x948f('0x44')];if(!_0xd69aa5[_0x948f('0x41')][_0x948f('0x48')](_0x948f('0x49'))){_0x902a4['limit']=qs[_0x948f('0x1e')](_0xd69aa5['query'][_0x948f('0x1e')]);_0x902a4[_0x948f('0x1f')]=qs[_0x948f('0x1f')](_0xd69aa5['query'][_0x948f('0x1f')]);}_0x902a4['order']=qs[_0x948f('0x4a')](_0xd69aa5['query'][_0x948f('0x4a')]);_0x902a4[_0x948f('0x4b')]=qs[_0x948f('0x42')](_[_0x948f('0x4c')](_0xd69aa5[_0x948f('0x41')],_0x1e1972[_0x948f('0x42')]),_0x239d68);var _0x361cf7=[];var _0x36dbe4=squel[_0x948f('0x4d')]()[_0x948f('0x4e')]('id')[_0x948f('0x4e')](_0x948f('0x2b'))['field'](_0x948f('0x4f'))[_0x948f('0x50')](_0x948f('0x51'));var _0x2fff88=squel[_0x948f('0x4d')]()['field'](_0x948f('0x52'))[_0x948f('0x4e')](_0x948f('0x53'))[_0x948f('0x4e')](_0x948f('0x54'))[_0x948f('0x50')]('user_has_openchannel_interactions','ui')['left_join']('users','u',_0x948f('0x55'));var _0xad3ae1=squel[_0x948f('0x4d')]()[_0x948f('0x50')](_0x948f('0x56'),'i')[_0x948f('0x57')](_0x948f('0x58'),'c',_0x948f('0x59'))[_0x948f('0x57')]('users','o',_0x948f('0x5a'))[_0x948f('0x57')](_0x948f('0x5b'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x948f('0x5c'),'me',_0x948f('0x5d'))[_0x948f('0x57')](_0x948f('0x5e'),'it',_0x948f('0x5f'))[_0x948f('0x57')](_0x948f('0x51'),'t',_0x948f('0x60'));var _0x15921b=squel[_0x948f('0x61')]();var _0x220b30=[];var _0x1ed7a3=squel[_0x948f('0x61')]();var _0x2cfaf9;if(_0xd69aa5[_0x948f('0x41')][_0x948f('0x62')]){_0x2cfaf9=as['parseSearch'](_0xd69aa5[_0x948f('0x41')][_0x948f('0x62')]);var _0x38ab0f=_0x2cfaf9[_0x948f('0x63')];for(var _0x4b91ab=0x0;_0x4b91ab<_0x2cfaf9[_0x948f('0x64')][_0x948f('0x47')];_0x4b91ab++){var _0x6672f5=_0x2cfaf9[_0x948f('0x64')][_0x4b91ab];var _0x1c7c85='i';var _0x49d474=_[_0x948f('0x65')](_0x239d68,[_0x948f('0x2b'),_0x6672f5['field']]);if(!_0x49d474){switch(_0x6672f5[_0x948f('0x4e')]){case _0x948f('0x66'):if(_0x6672f5['value']==0x1){_0xad3ae1[_0x948f('0x67')]('`'+_0x6672f5[_0x948f('0x4e')]+_0x948f('0x68'));}else{_0xad3ae1[_0x948f('0x67')]('`'+_0x6672f5[_0x948f('0x4e')]+_0x948f('0x69'));}break;case _0x948f('0x6a'):if(_0x6672f5[_0x948f('0x6b')]===_0x948f('0x6c')){if(_0x6672f5[_0x948f('0x6d')][_0x948f('0x31')]('\x20')[_0x948f('0x47')]>0x1){_0x15921b[_0x38ab0f](_0x948f('0x6e'),qs['getFullTextValue'](_0x6672f5['value']),null);}else{var _0x19dde5='%'+_0x6672f5[_0x948f('0x6d')]+'%';_0x15921b[_0x38ab0f](_0x948f('0x6f'),_0x19dde5,_0x19dde5,_0x19dde5);}}else{_0x49d474=_[_0x948f('0x65')](_0x239d68,[_0x948f('0x2b'),_0x948f('0x70')]);_0x6672f5[_0x948f('0x4e')]=_0x948f('0x70');_0x7a26d4=as[_0x948f('0x71')](_0x1c7c85,_0x49d474[_0x948f('0x3f')],_0x6672f5);_0x15921b[_0x38ab0f](_0x7a26d4['text'],_0x7a26d4['value'][_0x948f('0x72')],_0x7a26d4[_0x948f('0x6d')]['end']);}break;case _0x948f('0x73'):var _0x304d1b=_0x6672f5['value']['split'](',')[_0x948f('0x2d')](function(_0x7878fe){return Number(_0x7878fe);});_0x304d1b[_0x948f('0x32')](function(_0x2b7a10){_0x1ed7a3['or'](_0x948f('0x74'),'%,'+_0x2b7a10+',%');});_0x220b30=_[_0x948f('0x75')](_0x220b30,_0x304d1b);break;case _0x948f('0x76'):if(_0x6672f5[_0x948f('0x6b')]===_0x948f('0x6c')){_0x15921b[_0x38ab0f](_0x948f('0x77'),'%'+_0x6672f5[_0x948f('0x6d')]+'%',null);}else{_0x49d474=_[_0x948f('0x65')](_0x239d68,[_0x948f('0x2b'),_0x948f('0x3b')]);_0x6672f5[_0x948f('0x4e')]='UserId';_0x7a26d4=as[_0x948f('0x71')](_0x1c7c85,_0x49d474[_0x948f('0x3f')],_0x6672f5);_0x15921b[_0x38ab0f](_0x7a26d4[_0x948f('0x78')],_0x7a26d4['value'][_0x948f('0x72')],_0x7a26d4[_0x948f('0x6d')]['end']);}break;case _0x948f('0x79'):_0x7a26d4=as[_0x948f('0x71')]('me',null,_0x6672f5);_0x15921b[_0x38ab0f](_0x7a26d4[_0x948f('0x78')],_0x7a26d4[_0x948f('0x6d')]['start'],_0x7a26d4['value'][_0x948f('0x1d')]);break;}}else{var _0x7a26d4=as[_0x948f('0x71')](_0x1c7c85,_0x49d474['type'],_0x6672f5);_0x15921b[_0x38ab0f](_0x7a26d4[_0x948f('0x78')],_0x7a26d4[_0x948f('0x6d')][_0x948f('0x72')],_0x7a26d4[_0x948f('0x6d')]['end']);}}}else{var _0x39a2f2=_(_0xd69aa5[_0x948f('0x41')])[_0x948f('0x7a')]()[_0x948f('0x2d')](function(_0x1b82a3){return _[_0x948f('0x7b')](_0x239d68,[_0x948f('0x2b'),_0x1b82a3])?_0x1b82a3:undefined;})[_0x948f('0x7c')]()[_0x948f('0x6d')]();if(!_['isEmpty'](_0x39a2f2)){_0x39a2f2[_0x948f('0x32')](function(_0x40cfd0){if(_0x40cfd0===_0x948f('0x7d')){_0xad3ae1['where'](_0x948f('0x7e'),[][_0x948f('0x7f')](_0xd69aa5[_0x948f('0x41')][_0x40cfd0]));}else if(_0x40cfd0==='createdAt'){var _0x487014=JSON[_0x948f('0x80')](_0xd69aa5['query'][_0x40cfd0])[_0x948f('0x81')];var _0x22845f=JSON[_0x948f('0x80')](_0xd69aa5[_0x948f('0x41')][_0x40cfd0])[_0x948f('0x82')];_0xad3ae1[_0x948f('0x4b')](_0x948f('0x83'),_0x487014,_0x22845f);}else{if(_0xd69aa5[_0x948f('0x41')][_0x40cfd0]===_0x948f('0x84')){_0xad3ae1['where']('i.'+_0x40cfd0+'\x20IS\x20NULL');}else{_0xad3ae1['where']('i.'+_0x40cfd0+'\x20=\x20?',_0xd69aa5[_0x948f('0x41')][_0x40cfd0]);}}});}if(_0xd69aa5[_0x948f('0x41')][_0x948f('0x85')]){if(_0xd69aa5[_0x948f('0x41')][_0x948f('0x85')]==0x1){_0xad3ae1['having']('`unreadMessages`\x20=\x200');}else{_0xad3ae1[_0x948f('0x67')](_0x948f('0x86'));}}if(_0xd69aa5['query'][_0x948f('0x87')]){_0x220b30=_[_0x948f('0x88')](_0xd69aa5[_0x948f('0x41')][_0x948f('0x87')])?_0xd69aa5[_0x948f('0x41')][_0x948f('0x87')]:new Array(_0xd69aa5[_0x948f('0x41')][_0x948f('0x87')]);_0x220b30['forEach'](function(_0x242fb6){_0x1ed7a3['or'](_0x948f('0x74'),'%,'+_0x242fb6+',%');});}if(_0xd69aa5[_0x948f('0x41')]['filter']){var _0x5a8a18=_0xd69aa5[_0x948f('0x41')][_0x948f('0x89')][_0x948f('0x8a')]('\x5c','\x5c\x5c')[_0x948f('0x8a')](/'/g,'\x27\x27');if(qs[_0x948f('0x8b')](_0x5a8a18)){_0x15921b['or'](_0x948f('0x8c'),_0x5a8a18+'%');}else{_0x15921b['or'](_0x948f('0x8d'),qs[_0x948f('0x8e')](_0x5a8a18))['or'](_0x948f('0x8f'),_0x5a8a18+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5a8a18+'%');}}}_0xad3ae1[_0x948f('0x4b')](_0x15921b);_0xad3ae1['group'](_0x948f('0x90'));var _0x3f3be0={'type':db['Sequelize'][_0x948f('0x91')][_0x948f('0x92')],'raw':!![]};var _0x2bc706=_0xad3ae1[_0x948f('0x93')]();_0x2bc706[_0x948f('0x4e')](_0x948f('0x90'));_0x2bc706['field'](_0x948f('0x94'),'unreadMessages');if(_0x902a4['order']){_0x902a4['order']['forEach'](function(_0x668f8c){var _0x83dc9f=_0x668f8c[0x0]===_0x948f('0x95')?_0x668f8c[0x0]:'i.'+_0x668f8c[0x0];_0xad3ae1['order'](_0x83dc9f,_0x668f8c[0x1]===_0x948f('0x96')?![]:!![]);});}if(!_[_0x948f('0x97')](_0x220b30)){_0xad3ae1[_0x948f('0x67')](_0x1ed7a3);_0x2bc706[_0x948f('0x4b')](_0x948f('0x98'),_0x220b30);}BPromise[_0x948f('0x99')]()[_0x948f('0x28')](function(){if(!_0x2cfaf9){if(_0xd69aa5[_0x948f('0x41')][_0x948f('0x7d')])return;_0x2bc706[_0x948f('0x4b')](_0x948f('0x9a'));_0xad3ae1['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0xd69aa5['user'][_0x948f('0x9b')]!=='agent')return;return _0xd69aa5[_0x948f('0x9c')][_0x948f('0x9d')]({'attributes':['id'],'raw':!![]})[_0x948f('0x28')](function(_0x51b186){if(_['isEmpty'](_0x51b186)){_0x2bc706[_0x948f('0x4b')]('i.OpenchannelAccountId\x20IS\x20NULL');_0xad3ae1[_0x948f('0x4b')](_0x948f('0x9e'));}else{_0x2bc706[_0x948f('0x4b')](_0x948f('0x7e'),_[_0x948f('0x2d')](_0x51b186,'id'));_0xad3ae1['where'](_0x948f('0x7e'),_['map'](_0x51b186,'id'));}});})[_0x948f('0x28')](function(){if(_0xd69aa5['user'][_0x948f('0x9b')]==='agent'&&!_0x2cfaf9&&!_0xd69aa5[_0x948f('0x41')][_0x948f('0x7d')])return[];return db[_0x948f('0x9f')][_0x948f('0x41')](_0x2bc706[_0x948f('0xa0')](),_0x3f3be0);})['then'](function(_0x13851b){_0x2d97f9['count']=_0x13851b[_0x948f('0x47')];if(_0x2d97f9[_0x948f('0x20')]===0x0)return[];return db[_0x948f('0x9f')][_0x948f('0x41')](_0x36dbe4[_0x948f('0xa0')](),_0x3f3be0)[_0x948f('0x28')](function(_0x4d513b){_0x361cf7=_[_0x948f('0xa1')](_0x4d513b,'id');_0x3f3be0=_[_0x948f('0xa2')](_0x3f3be0,{'model':db[_0x948f('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd69aa5[_0x948f('0x41')][_0x948f('0x46')]){_0x902a4[_0x948f('0x45')]['forEach'](function(_0x37a412){_0xad3ae1[_0x948f('0x4e')]('i.'+_0x37a412);});}else{_0xad3ae1['field'](_0x948f('0x94'),'unreadMessages');_0xad3ae1[_0x948f('0x4e')](_0x948f('0xa3'),_0x948f('0xa4'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xa5'),_0x948f('0xa6'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xa7'),_0x948f('0x95'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xa8'));_0xad3ae1['field'](_0x948f('0xa9'),_0x948f('0xaa'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xab'),_0x948f('0xac'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xad'),_0x948f('0xae'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xaf'),_0x948f('0xb0'));_0xad3ae1['field'](_0x948f('0xb1'),_0x948f('0xb2'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xb3'),'Contact.fax');_0xad3ae1[_0x948f('0x4e')](_0x948f('0xb4'),_0x948f('0xb5'));_0xad3ae1[_0x948f('0x4e')](_0x948f('0xb6'),_0x948f('0xb7'));_0xad3ae1['field'](_0x948f('0xb8'),_0x948f('0x2f'));}if(_0x902a4[_0x948f('0x1e')])_0xad3ae1[_0x948f('0x1e')](_0x902a4[_0x948f('0x1e')]);if(_0x902a4[_0x948f('0x1f')])_0xad3ae1[_0x948f('0x1f')](_0x902a4[_0x948f('0x1f')]);return db[_0x948f('0x9f')][_0x948f('0x41')](_0xad3ae1[_0x948f('0xa0')](),_0x3f3be0);})[_0x948f('0x28')](function(_0x1c0643){if(_0x1c0643[_0x948f('0x47')]>0x0)_0x2fff88[_0x948f('0x4b')](_0x948f('0xb9'),_['map'](_0x1c0643,'id'));return db['sequelize'][_0x948f('0x41')](_0x2fff88[_0x948f('0xa0')](),_0x3f3be0)['then'](function(_0xe59e70){var _0x548b27=_[_0x948f('0xba')](_0xe59e70,_0x948f('0xbb'));var _0xf16178=[];_0x1c0643[_0x948f('0x32')](function(_0x11f643){_0xf16178[_0x948f('0x33')](updateOpenchannelInteraction(_0x11f643,_0x361cf7,_0x548b27));});return BPromise['all'](_0xf16178);});});})[_0x948f('0x28')](function(_0x2ced31){_0x2d97f9[_0x948f('0xbc')]=_0x2ced31;return _0x2d97f9;})['then'](respondWithFilteredResult(_0x77674d,_0x902a4))[_0x948f('0x34')](handleError(_0x77674d,null));};exports[_0x948f('0xbd')]=function(_0x50852c,_0x142f9c){var _0x266932={};if(_0x50852c['query'][_0x948f('0x3f')]&&_0x50852c['query']['type']===_0x948f('0x50')){_0x266932[_0x948f('0x50')]=_0x50852c[_0x948f('0xbe')]['id'];}else{_0x266932['id']=_0x50852c[_0x948f('0xbe')]['id'];}var _0x56fb5e={'raw':![],'where':_0x266932},_0x426ef9={};_0x426ef9['model']=_[_0x948f('0x7a')](db[_0x948f('0x3d')][_0x948f('0x3e')]);_0x426ef9['query']=_[_0x948f('0x7a')](_0x50852c['query']);_0x426ef9[_0x948f('0x42')]=_[_0x948f('0x43')](_0x426ef9[_0x948f('0x44')],_0x426ef9[_0x948f('0x41')]);_0x56fb5e[_0x948f('0x45')]=_['intersection'](_0x426ef9['model'],qs[_0x948f('0x46')](_0x50852c[_0x948f('0x41')][_0x948f('0x46')]));_0x56fb5e[_0x948f('0x45')]=_0x56fb5e['attributes'][_0x948f('0x47')]?_0x56fb5e[_0x948f('0x45')]:_0x426ef9[_0x948f('0x44')];if(_0x50852c['query'][_0x948f('0xbf')]){_0x56fb5e[_0x948f('0xc0')]=[{'all':!![]}];}_0x56fb5e=_[_0x948f('0xa2')]({},_0x56fb5e,_0x50852c[_0x948f('0xc1')]);return db['OpenchannelInteraction']['find'](_0x56fb5e)[_0x948f('0x28')](handleEntityNotFound(_0x142f9c,null))['then'](respondWithResult(_0x142f9c,null))[_0x948f('0x34')](handleError(_0x142f9c,null));};exports[_0x948f('0xc2')]=function(_0x15ddd0,_0x3734fe){return db['OpenchannelInteraction'][_0x948f('0xc2')](_0x15ddd0[_0x948f('0x79')],{})[_0x948f('0x28')](respondWithResult(_0x3734fe,0xc9))[_0x948f('0x34')](handleError(_0x3734fe,null));};exports['update']=function(_0x9d6391,_0x5ba79a){if(_0x9d6391['body']['id']){delete _0x9d6391['body']['id'];}return db[_0x948f('0x3d')][_0x948f('0x65')]({'where':{'id':_0x9d6391[_0x948f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5ba79a,null))[_0x948f('0x28')](saveUpdates(_0x9d6391[_0x948f('0x79')],null))['then'](respondWithResult(_0x5ba79a,null))[_0x948f('0x34')](handleError(_0x5ba79a,null));};exports[_0x948f('0xc3')]=function(_0x467776,_0x36d32f){return db[_0x948f('0x3d')][_0x948f('0x65')]({'where':{'id':_0x467776[_0x948f('0xbe')]['id']}})[_0x948f('0x28')](handleEntityNotFound(_0x36d32f,null))[_0x948f('0x28')](removeEntity(_0x36d32f,null))['catch'](handleError(_0x36d32f,null));};exports[_0x948f('0xc4')]=function(_0x3d89b2,_0x3ae6cf){return db['OpenchannelInteraction'][_0x948f('0xc4')]()[_0x948f('0x28')](respondWithResult(_0x3ae6cf,null))[_0x948f('0x34')](handleError(_0x3ae6cf,null));};exports['addMessage']=function(_0x66a433,_0x9b1cbe,_0xb321ca){return db[_0x948f('0xc5')][_0x948f('0x65')]({'where':{'id':_0x66a433[_0x948f('0xbe')]['id']}})[_0x948f('0x28')](handleEntityNotFound(_0x9b1cbe,null))[_0x948f('0x28')](function(_0x55555b){if(_0x55555b){return _0x55555b[_0x948f('0xc6')](_0x66a433[_0x948f('0x79')][_0x948f('0xc7')],_[_0x948f('0xc8')](_0x66a433['body'],[_0x948f('0xc7'),'id'])||{});}})[_0x948f('0x28')](respondWithResult(_0x9b1cbe,null))[_0x948f('0x34')](handleError(_0x9b1cbe,null));};exports[_0x948f('0xc9')]=function(_0x3d476e,_0xe2b9a9,_0x1229b9){var _0x562c8c={'raw':![],'where':{}};var _0x4039ec={};var _0x53f6d9={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x948f('0xca')]({'where':{'id':_0x3d476e[_0x948f('0xbe')]['id']}})[_0x948f('0x28')](handleEntityNotFound(_0xe2b9a9,null))[_0x948f('0x28')](function(_0x332273){if(_0x332273){_0x4039ec[_0x948f('0x44')]=_[_0x948f('0x7a')](db[_0x948f('0xc5')][_0x948f('0x3e')]);_0x4039ec[_0x948f('0x41')]=_[_0x948f('0x7a')](_0x3d476e[_0x948f('0x41')]);_0x4039ec['filters']=_[_0x948f('0x43')](_0x4039ec['model'],_0x4039ec[_0x948f('0x41')]);_0x562c8c['attributes']=_[_0x948f('0x43')](_0x4039ec[_0x948f('0x44')],qs['fields'](_0x3d476e[_0x948f('0x41')][_0x948f('0x46')]));_0x562c8c[_0x948f('0x45')]=_0x562c8c[_0x948f('0x45')][_0x948f('0x47')]?_0x562c8c[_0x948f('0x45')]:_0x4039ec[_0x948f('0x44')];if(!_0x3d476e[_0x948f('0x41')][_0x948f('0x48')](_0x948f('0x49'))){_0x562c8c[_0x948f('0x1e')]=qs['limit'](_0x3d476e[_0x948f('0x41')][_0x948f('0x1e')]);_0x562c8c[_0x948f('0x1f')]=qs[_0x948f('0x1f')](_0x3d476e[_0x948f('0x41')][_0x948f('0x1f')]);}_0x562c8c[_0x948f('0xcb')]=qs[_0x948f('0x4a')](_0x3d476e[_0x948f('0x41')][_0x948f('0x4a')]);_0x562c8c[_0x948f('0x4b')]=qs[_0x948f('0x42')](_[_0x948f('0x4c')](_0x3d476e[_0x948f('0x41')],_0x4039ec[_0x948f('0x42')]));_0x562c8c['where'][_0x948f('0xbb')]=_0x332273['id'];if(_0x3d476e['query'][_0x948f('0x89')]){_0x562c8c[_0x948f('0x4b')]=_['merge'](_0x562c8c[_0x948f('0x4b')],{'$or':_[_0x948f('0x2d')](_0x562c8c[_0x948f('0x45')],function(_0x124266){var _0x36441f={};_0x36441f[_0x124266]={'$like':'%'+_0x3d476e['query'][_0x948f('0x89')]+'%'};return _0x36441f;})});}if(_0x3d476e[_0x948f('0x41')][_0x948f('0x81')]){var _0xba33c5=_0x3d476e['query'][_0x948f('0x81')][_0x948f('0x31')](',');var _0x5baeb4={};_0x5baeb4[_0xba33c5[0x0]]={'$gte':moment(_0xba33c5[0x1])[_0x948f('0xcc')](_0x948f('0xcd'))};_0x562c8c[_0x948f('0x4b')]=_[_0x948f('0xa2')](_0x562c8c[_0x948f('0x4b')],_0x5baeb4);}_0x562c8c=_[_0x948f('0xa2')]({},_0x562c8c,_0x3d476e[_0x948f('0xc1')]);return db['OpenchannelMessage']['count']({'where':_0x562c8c[_0x948f('0x4b')]})['then'](function(_0x129acf){_0x53f6d9['count']=_0x129acf;if(_0x3d476e[_0x948f('0x41')][_0x948f('0xbf')]){_0x562c8c[_0x948f('0xc0')]=[{'all':!![]}];}return db[_0x948f('0xc5')][_0x948f('0xce')](_0x562c8c);})[_0x948f('0x28')](function(_0x3a93c3){_0x53f6d9[_0x948f('0xbc')]=_0x3a93c3;return _0x53f6d9;});}})[_0x948f('0x28')](respondWithFilteredResult(_0xe2b9a9,_0x562c8c))['catch'](handleError(_0xe2b9a9,null));};exports[_0x948f('0xcf')]=function(_0x2341e1,_0x1f373c,_0x593bbf){return db[_0x948f('0x3d')][_0x948f('0x65')]({'where':{'id':_0x2341e1['params']['id']}})[_0x948f('0x28')](handleEntityNotFound(_0x1f373c,null))[_0x948f('0x28')](function(_0x1a55f0){if(_0x1a55f0){return _0x1a55f0[_0x948f('0xd0')](_0x2341e1['body']['ids'],_[_0x948f('0xc8')](_0x2341e1['body'],['ids','id'])||{})[_0x948f('0xd1')](function(){return db[_0x948f('0x73')]['findAll']({'attributes':['id',_0x948f('0x2b'),'color'],'where':{'id':_0x2341e1[_0x948f('0x79')][_0x948f('0xc7')]}});})[_0x948f('0x28')](function(_0x2f500a){socket['emit'](_0x948f('0xd2'),{'id':Number(_0x2341e1[_0x948f('0xbe')]['id']),'tags':_0x2f500a||[]});return{'id':Number(_0x2341e1[_0x948f('0xbe')]['id']),'tags':_0x2f500a||[]};});}})[_0x948f('0x28')](respondWithResult(_0x1f373c,null))[_0x948f('0x34')](handleError(_0x1f373c,null));};exports['removeTags']=function(_0x574b01,_0x80c7c5,_0x548f5c){return db[_0x948f('0x3d')][_0x948f('0x65')]({'where':{'id':_0x574b01[_0x948f('0xbe')]['id']}})[_0x948f('0x28')](handleEntityNotFound(_0x80c7c5,null))['then'](function(_0x2e919d){if(_0x2e919d){return _0x2e919d[_0x948f('0xd3')](_0x574b01[_0x948f('0x41')][_0x948f('0xc7')]);}})[_0x948f('0x28')](respondWithStatusCode(_0x80c7c5,null))[_0x948f('0x34')](handleError(_0x80c7c5,null));};exports[_0x948f('0xd4')]=function(_0x3af03f,_0xc82fc1){var _0x393af8=moment()['unix']()[_0x948f('0xa0')]();var _0x9d86d1=path['join'](config[_0x948f('0xd5')],_0x948f('0xd6'),_0x948f('0xd7'),_0x948f('0xd8'));var _0x48bd7d=path[_0x948f('0xd9')](config[_0x948f('0xd5')],_0x948f('0xd6'),_0x948f('0xd7'),_0x948f('0xda'));var _0x1b74fe=path[_0x948f('0xd9')](_0x9d86d1,_0x393af8);var _0x26b71a=util[_0x948f('0xcc')](_0x948f('0xdb'),_0x3af03f[_0x948f('0xbe')]['id'],_0x393af8);var _0xf00c75=path[_0x948f('0xd9')](_0x9d86d1,_0x26b71a);var _0x4d1398=[];_0x4d1398[_0x948f('0x33')]({'model':db[_0x948f('0x76')],'as':_0x948f('0x76'),'attributes':['id',_0x948f('0x2e')],'raw':!![]});_0x4d1398[_0x948f('0x33')]({'model':db[_0x948f('0xdc')],'as':_0x948f('0x6a'),'attributes':['id','firstName',_0x948f('0xdd')],'raw':!![]});if(_0x3af03f[_0x948f('0x41')][_0x948f('0xda')]){_0x4d1398[_0x948f('0x33')]({'model':db[_0x948f('0xde')],'as':'Attachment','raw':!![]});}var _0x19edfb=[{'model':db[_0x948f('0xc5')],'as':_0x948f('0xdf'),'attributes':['id','body',_0x948f('0xe0'),_0x948f('0xe1'),_0x948f('0xe2'),'read'],'include':_0x4d1398}];_0x19edfb['push']({'model':db[_0x948f('0xe3')],'as':_0x948f('0xe4'),'attributes':['id',_0x948f('0x2b')]});_0x19edfb[_0x948f('0x33')]({'model':db['User'],'as':_0x948f('0xe5'),'attributes':['id',_0x948f('0x2e')]});return db['OpenchannelInteraction'][_0x948f('0x65')]({'where':{'id':_0x3af03f[_0x948f('0xbe')]['id']},'include':_0x19edfb})[_0x948f('0x28')](handleEntityNotFound(_0xc82fc1,null))[_0x948f('0x28')](function(_0x3f4c77){if(_0x3f4c77){var _0x2a1d1e=_0x3f4c77[_0x948f('0xe6')]({'plain':!![]});fs[_0x948f('0xe7')](_0x1b74fe);var _0x54e44b={'channel':_0x948f('0xe8'),'account':_0x2a1d1e[_0x948f('0xe4')][_0x948f('0x2b')],'agent':_0x2a1d1e[_0x948f('0xe5')]?_0x2a1d1e[_0x948f('0xe5')]['fullname']:_0x948f('0xe9'),'createdAt':moment(_0x2a1d1e[_0x948f('0xe0')])[_0x948f('0xcc')](_0x948f('0xcd'))['toString'](),'closedAt':_0x2a1d1e[_0x948f('0x3a')]?moment(_0x2a1d1e['closedAt'])[_0x948f('0xcc')](_0x948f('0xcd'))[_0x948f('0xa0')]():'','disposition':_0x2a1d1e['disposition'],'visibility':_0x2a1d1e[_0x948f('0xea')]?_0x948f('0xeb'):'Private','messages':_(_0x2a1d1e['Messages'])[_0x948f('0x89')]({'secret':![]})[_0x948f('0x2d')](function(_0x49468a){if(_0x49468a[_0x948f('0xde')]){var _0x45739e=path[_0x948f('0xd9')](_0x48bd7d,_0x49468a[_0x948f('0xde')][_0x948f('0xec')]);if(fs[_0x948f('0xed')](_0x45739e)){fs[_0x948f('0xee')](_0x45739e)[_0x948f('0xef')](fs[_0x948f('0xf0')](path[_0x948f('0xd9')](_0x1b74fe,_0x49468a[_0x948f('0xde')][_0x948f('0xec')])));}}return{'date':moment(_0x49468a[_0x948f('0xe0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x948f('0xa0')](),'sender':_0x49468a[_0x948f('0xe1')]===_0x948f('0xf1')?_0x49468a['User']?_0x49468a[_0x948f('0x76')]['fullname']:_0x948f('0xf2'):_0x49468a[_0x948f('0x6a')][_0x948f('0xf3')]+(_0x49468a['Contact']['lastName']?'\x20'+_0x49468a[_0x948f('0x6a')]['lastName']:''),'body':_0x49468a['Attachment']?_0x49468a[_0x948f('0xde')][_0x948f('0xec')]:_0x49468a[_0x948f('0x79')],'direction':_0x49468a[_0x948f('0xe1')]===_0x948f('0xf1')?'A':'C','secret':_0x49468a[_0x948f('0xe2')],'read':_0x49468a[_0x948f('0x85')],'attachment':_0x49468a[_0x948f('0xde')]};})['value']()};return ejs[_0x948f('0xf4')](path[_0x948f('0xd9')](config[_0x948f('0xd5')],_0x948f('0xd6'),_0x948f('0xf5'),'downloadInteraction.ejs'),{'interaction':_0x54e44b})[_0x948f('0x28')](function(_0x49515c){var _0x2d3d7d=path[_0x948f('0xd9')](_0x1b74fe,'transcript-'+_0x2a1d1e['id']+'-'+_0x393af8+_0x948f('0xf6'));var _0x204ddd={'path':_0x2d3d7d,'channel':_0x948f('0xe8'),'interactionId':_0x2a1d1e['id']};return pdf[_0x948f('0xf7')](_0x49515c,_0x204ddd);})['then'](function(){return new BPromise(function(_0x90844c,_0x38200d){zipdir(_0x1b74fe,{'saveTo':_0xf00c75},function(_0x4aec9f,_0x5c34f8){if(_0x4aec9f)return _0x38200d(_0x4aec9f);return _0x90844c(_0x5c34f8);});})[_0x948f('0x28')](function(){return new BPromise(function(_0x37060b,_0x4f19f8){rimraf(_0x1b74fe,function(_0x13fb71){if(_0x13fb71)_0x4f19f8(_0x13fb71);return _0x37060b();});});})['then'](function(){return _0xc82fc1[_0x948f('0xd4')](_0xf00c75,_0x26b71a,function(_0x38efe9){if(_0x38efe9){console[_0x948f('0xf8')](_0x948f('0xf9'),_0x38efe9);}else{fs[_0x948f('0xfa')](_0xf00c75);}});});});}else{return _0xc82fc1[_0x948f('0x1b')](0xc8);}})[_0x948f('0x34')](handleError(_0xc82fc1,null));}; \ No newline at end of file +var _0x1776=['closedAt','threadId','Public','basename','existsSync','createReadStream','createWriteStream','firstName','lastName','out','renderFile','.pdf','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','then','status','error','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','total','closed','UserId','index','OpenchannelInteraction','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','field','color','select','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','merge','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','catch','params','includeAll','options','create','describe','addMessage','OpenchannelMessage','omit','getMessages','findOne','hasOwnProperty','$gte','include','rows','setTags','ids','spread','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','files','tmp','root','server','attachments','format','CmContact','Contact','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','fullname','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x1776,0xff));var _0x6177=function(_0x2f4f15,_0x1786f3){_0x2f4f15=_0x2f4f15-0x0;var _0x3f163c=_0x1776[_0x2f4f15];return _0x3f163c;};'use strict';var emlformat=require(_0x6177('0x0'));var rimraf=require(_0x6177('0x1'));var zipdir=require(_0x6177('0x2'));var jsonpatch=require(_0x6177('0x3'));var rp=require(_0x6177('0x4'));var moment=require(_0x6177('0x5'));var BPromise=require(_0x6177('0x6'));var Mustache=require('mustache');var util=require(_0x6177('0x7'));var path=require(_0x6177('0x8'));var sox=require('sox');var csv=require(_0x6177('0x9'));var ejs=require(_0x6177('0xa'));var fs=require('fs');var fs_extra=require(_0x6177('0xb'));var _=require(_0x6177('0xc'));var squel=require(_0x6177('0xd'));var crypto=require(_0x6177('0xe'));var jsforce=require(_0x6177('0xf'));var deskjs=require(_0x6177('0x10'));var toCsv=require(_0x6177('0x9'));var querystring=require(_0x6177('0x11'));var Papa=require(_0x6177('0x12'));var Redis=require(_0x6177('0x13'));var authService=require(_0x6177('0x14'));var qs=require(_0x6177('0x15'));var as=require(_0x6177('0x16'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x6177('0x17'));var logger=require(_0x6177('0x18'))(_0x6177('0x19'));var utils=require('../../config/utils');var config=require(_0x6177('0x1a'));var licenseUtil=require(_0x6177('0x1b'));var db=require(_0x6177('0x1c'))['db'];config[_0x6177('0x1d')]=_[_0x6177('0x1e')](config[_0x6177('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6177('0x1d')]));require('./openchannelInteraction.socket')[_0x6177('0x1f')](socket);function respondWithStatusCode(_0xeb9707,_0x687825){_0x687825=_0x687825||0xcc;return function(_0x4e49e4){if(_0x4e49e4){return _0xeb9707['sendStatus'](_0x687825);}return _0xeb9707['status'](_0x687825)[_0x6177('0x20')]();};}function respondWithResult(_0x32a3ca,_0x3c9520){_0x3c9520=_0x3c9520||0xc8;return function(_0x41e978){if(_0x41e978){return _0x32a3ca['status'](_0x3c9520)[_0x6177('0x21')](_0x41e978);}};}function respondWithFilteredResult(_0x24a4d6,_0x45d799){return function(_0x5a976f){if(_0x5a976f){var _0x3f415c=typeof _0x45d799[_0x6177('0x22')]===_0x6177('0x23')&&typeof _0x45d799['limit']==='undefined';var _0x37d2f5=_0x5a976f[_0x6177('0x24')];var _0x487632=_0x3f415c?0x0:_0x45d799[_0x6177('0x22')];var _0x38f5f2=_0x3f415c?_0x5a976f[_0x6177('0x24')]:_0x45d799[_0x6177('0x22')]+_0x45d799['limit'];var _0x5b0a2e;if(_0x38f5f2>=_0x37d2f5){_0x38f5f2=_0x37d2f5;_0x5b0a2e=0xc8;}else{_0x5b0a2e=0xce;}_0x24a4d6['status'](_0x5b0a2e);return _0x24a4d6[_0x6177('0x25')]('Content-Range',_0x487632+'-'+_0x38f5f2+'/'+_0x37d2f5)[_0x6177('0x21')](_0x5a976f);}return null;};}function patchUpdates(_0xb9c1bb){return function(_0x595419){try{jsonpatch[_0x6177('0x26')](_0x595419,_0xb9c1bb,!![]);}catch(_0x32cda1){return BPromise[_0x6177('0x27')](_0x32cda1);}return _0x595419[_0x6177('0x28')]();};}function saveUpdates(_0x29b327,_0x7c1d30){return function(_0x3867e7){if(_0x3867e7){return _0x3867e7[_0x6177('0x29')](_0x29b327)['then'](function(_0x1a6e73){return _0x1a6e73;});}return null;};}function removeEntity(_0x1c91b9,_0x2c6d9e){return function(_0x4ca872){if(_0x4ca872){return _0x4ca872[_0x6177('0x2a')]()[_0x6177('0x2b')](function(){_0x1c91b9[_0x6177('0x2c')](0xcc)[_0x6177('0x20')]();});}};}function handleEntityNotFound(_0x406df9,_0x5d0f6d){return function(_0x38e9d0){if(!_0x38e9d0){_0x406df9['sendStatus'](0x194);}return _0x38e9d0;};}function handleError(_0x4f5d1c,_0x544e58){_0x544e58=_0x544e58||0x1f4;return function(_0x2291a4){logger[_0x6177('0x2d')](_0x2291a4[_0x6177('0x2e')]);if(_0x2291a4[_0x6177('0x2f')]){delete _0x2291a4[_0x6177('0x2f')];}_0x4f5d1c[_0x6177('0x2c')](_0x544e58)[_0x6177('0x30')](_0x2291a4);};}function getInteractionUsers(_0xce6ae8,_0x58dd86){return new BPromise(function(_0x4e8320,_0x4f2f11){try{if(_0x58dd86[_0xce6ae8['id']]){_0xce6ae8[_0x6177('0x31')]=_[_0x6177('0x32')](_0x58dd86[_0xce6ae8['id']],function(_0xe3b021){return{'id':_0xe3b021['id'],'fullname':_0xe3b021['fullname']};});}}catch(_0x125b36){_0x4f2f11(_0x125b36);}_0x4e8320(_0xce6ae8);});}function getInteractionTags(_0x5dc420,_0x4034c9){return new BPromise(function(_0x3d8b26,_0x6bc566){try{if(_0x5dc420[_0x6177('0x33')]){_0x5dc420[_0x6177('0x34')]=[];_0x5dc420[_0x6177('0x33')][_0x6177('0x35')](',')[_0x6177('0x36')](function(_0xd2f016){_0x5dc420[_0x6177('0x34')][_0x6177('0x37')](_0x4034c9[_0xd2f016]);});}delete _0x5dc420['TagIds'];}catch(_0x2b2538){_0x6bc566(_0x2b2538);}_0x3d8b26(_0x5dc420);});}function updateOpenchannelInteraction(_0x346ff8,_0x271195,_0x2fc409){return new BPromise(function(_0xbea7d9,_0x1cab15){return getInteractionUsers(_0x346ff8,_0x2fc409)['then'](function(_0x3e14c0){return getInteractionTags(_0x3e14c0,_0x271195);})[_0x6177('0x2b')](function(_0x48366c){return getStateInteraction(_0x48366c);})[_0x6177('0x2b')](function(_0x13764e){_0xbea7d9(_0x13764e);})['catch'](function(_0x4ca377){_0x1cab15(_0x4ca377);});});}function getStateInteraction(_0x474793){return new BPromise(function(_0x555ed3,_0x33d350){_0x474793[_0x6177('0x38')]=0x0;_0x474793['talking']=0x0;_0x474793[_0x6177('0x39')]=0x0;_0x474793[_0x6177('0x3a')]=0x0;_0x474793[_0x6177('0x3b')]=0x0;if(!_0x474793[_0x6177('0x3c')]&&!_0x474793[_0x6177('0x3d')])_0x474793[_0x6177('0x38')]+=0x1;if(!_0x474793['closed']&&_0x474793[_0x6177('0x3d')])_0x474793['talking']+=0x1;if(_0x474793[_0x6177('0x3c')]&&_0x474793[_0x6177('0x3d')])_0x474793[_0x6177('0x39')]+=0x1;if(_0x474793[_0x6177('0x3c')]&&!_0x474793[_0x6177('0x3d')])_0x474793[_0x6177('0x3a')]+=0x1;_0x474793['total']+=0x1;_0x555ed3(_0x474793);});}exports[_0x6177('0x3e')]=function(_0x4a0495,_0x4f6982){var _0x16fb7b={},_0x1e977f={},_0x3315cd={'count':0x0,'rows':[]};var _0x2a887d=_[_0x6177('0x32')](db[_0x6177('0x3f')][_0x6177('0x40')],function(_0x96864f){return{'name':_0x96864f['fieldName'],'type':_0x96864f[_0x6177('0x41')][_0x6177('0x42')]};});_0x1e977f[_0x6177('0x43')]=_[_0x6177('0x32')](_0x2a887d,'name');_0x1e977f[_0x6177('0x44')]=_['keys'](_0x4a0495[_0x6177('0x44')]);_0x1e977f['filters']=_[_0x6177('0x45')](_0x1e977f[_0x6177('0x43')],_0x1e977f[_0x6177('0x44')]);_0x16fb7b[_0x6177('0x46')]=_[_0x6177('0x45')](_0x1e977f[_0x6177('0x43')],qs[_0x6177('0x47')](_0x4a0495['query']['fields']));_0x16fb7b[_0x6177('0x46')]=_0x16fb7b[_0x6177('0x46')][_0x6177('0x48')]?_0x16fb7b[_0x6177('0x46')]:_0x1e977f[_0x6177('0x43')];if(!_0x4a0495[_0x6177('0x44')]['hasOwnProperty'](_0x6177('0x49'))){_0x16fb7b[_0x6177('0x4a')]=qs[_0x6177('0x4a')](_0x4a0495[_0x6177('0x44')][_0x6177('0x4a')]);_0x16fb7b[_0x6177('0x22')]=qs['offset'](_0x4a0495[_0x6177('0x44')][_0x6177('0x22')]);}_0x16fb7b[_0x6177('0x4b')]=qs[_0x6177('0x4c')](_0x4a0495[_0x6177('0x44')]['sort']);_0x16fb7b[_0x6177('0x4d')]=qs[_0x6177('0x4e')](_[_0x6177('0x4f')](_0x4a0495['query'],_0x1e977f[_0x6177('0x4e')]),_0x2a887d);var _0xedbf37=[];var _0x34a09f=squel['select']()['field']('id')[_0x6177('0x50')](_0x6177('0x2f'))[_0x6177('0x50')](_0x6177('0x51'))['from']('tools_tags');var _0x87a346=squel[_0x6177('0x52')]()[_0x6177('0x50')](_0x6177('0x53'))[_0x6177('0x50')](_0x6177('0x54'))[_0x6177('0x50')](_0x6177('0x55'))[_0x6177('0x56')](_0x6177('0x57'),'ui')[_0x6177('0x58')](_0x6177('0x59'),'u',_0x6177('0x5a'));var _0x4b6e23=squel[_0x6177('0x52')]()['from'](_0x6177('0x5b'),'i')[_0x6177('0x58')](_0x6177('0x5c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x6177('0x58')](_0x6177('0x59'),'o','o.id\x20=\x20i.UserId')[_0x6177('0x58')](_0x6177('0x5d'),'a',_0x6177('0x5e'))[_0x6177('0x58')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x6177('0x58')]('openchannel_interaction_has_tags','it',_0x6177('0x5f'))[_0x6177('0x58')](_0x6177('0x60'),'t',_0x6177('0x61'));var _0x55b7e7=squel[_0x6177('0x62')]();var _0x10b14b=[];var _0x5d990e=squel[_0x6177('0x62')]();var _0xcec78d;if(_0x4a0495[_0x6177('0x44')][_0x6177('0x63')]){_0xcec78d=as[_0x6177('0x64')](_0x4a0495[_0x6177('0x44')][_0x6177('0x63')]);var _0x49cad4=_0xcec78d[_0x6177('0x65')];for(var _0x4157f7=0x0;_0x4157f7<_0xcec78d['conditions'][_0x6177('0x48')];_0x4157f7++){var _0x21350e=_0xcec78d[_0x6177('0x66')][_0x4157f7];var _0x30ebe4='i';var _0x2e963f=_[_0x6177('0x67')](_0x2a887d,[_0x6177('0x2f'),_0x21350e[_0x6177('0x50')]]);if(!_0x2e963f){switch(_0x21350e[_0x6177('0x50')]){case'unreadMessages':if(_0x21350e[_0x6177('0x68')]==0x1){_0x4b6e23[_0x6177('0x69')]('`'+_0x21350e[_0x6177('0x50')]+_0x6177('0x6a'));}else{_0x4b6e23[_0x6177('0x69')]('`'+_0x21350e[_0x6177('0x50')]+_0x6177('0x6b'));}break;case'Contact':if(_0x21350e[_0x6177('0x6c')]===_0x6177('0x6d')){if(_0x21350e['value'][_0x6177('0x35')]('\x20')[_0x6177('0x48')]>0x1){_0x55b7e7[_0x49cad4](_0x6177('0x6e'),qs['getFullTextValue'](_0x21350e[_0x6177('0x68')]),null);}else{var _0xe5dee3='%'+_0x21350e[_0x6177('0x68')]+'%';_0x55b7e7[_0x49cad4](_0x6177('0x6f'),_0xe5dee3,_0xe5dee3,_0xe5dee3);}}else{_0x2e963f=_['find'](_0x2a887d,[_0x6177('0x2f'),'ContactId']);_0x21350e[_0x6177('0x50')]=_0x6177('0x70');_0x4e3551=as[_0x6177('0x71')](_0x30ebe4,_0x2e963f[_0x6177('0x41')],_0x21350e);_0x55b7e7[_0x49cad4](_0x4e3551[_0x6177('0x72')],_0x4e3551['value'][_0x6177('0x73')],_0x4e3551[_0x6177('0x68')][_0x6177('0x20')]);}break;case _0x6177('0x74'):var _0x593c0d=_0x21350e['value']['split'](',')[_0x6177('0x32')](function(_0x505fa5){return Number(_0x505fa5);});_0x593c0d[_0x6177('0x36')](function(_0x505cfc){_0x5d990e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x505cfc+',%');});_0x10b14b=_['union'](_0x10b14b,_0x593c0d);break;case _0x6177('0x75'):if(_0x21350e[_0x6177('0x6c')]==='$substring'){_0x55b7e7[_0x49cad4](_0x6177('0x76'),'%'+_0x21350e['value']+'%',null);}else{_0x2e963f=_[_0x6177('0x67')](_0x2a887d,[_0x6177('0x2f'),_0x6177('0x3d')]);_0x21350e['field']=_0x6177('0x3d');_0x4e3551=as[_0x6177('0x71')](_0x30ebe4,_0x2e963f['type'],_0x21350e);_0x55b7e7[_0x49cad4](_0x4e3551[_0x6177('0x72')],_0x4e3551[_0x6177('0x68')]['start'],_0x4e3551[_0x6177('0x68')][_0x6177('0x20')]);}break;case _0x6177('0x77'):_0x4e3551=as[_0x6177('0x71')]('me',null,_0x21350e);_0x55b7e7[_0x49cad4](_0x4e3551[_0x6177('0x72')],_0x4e3551[_0x6177('0x68')][_0x6177('0x73')],_0x4e3551['value']['end']);break;}}else{var _0x4e3551=as[_0x6177('0x71')](_0x30ebe4,_0x2e963f[_0x6177('0x41')],_0x21350e);_0x55b7e7[_0x49cad4](_0x4e3551[_0x6177('0x72')],_0x4e3551[_0x6177('0x68')][_0x6177('0x73')],_0x4e3551[_0x6177('0x68')][_0x6177('0x20')]);}}}else{var _0x1494a3=_(_0x4a0495['query'])[_0x6177('0x78')]()['map'](function(_0x20fdca){return _[_0x6177('0x79')](_0x2a887d,[_0x6177('0x2f'),_0x20fdca])?_0x20fdca:undefined;})[_0x6177('0x7a')]()[_0x6177('0x68')]();if(!_[_0x6177('0x7b')](_0x1494a3)){_0x1494a3['forEach'](function(_0x5bbc3f){if(_0x5bbc3f===_0x6177('0x7c')){_0x4b6e23[_0x6177('0x4d')](_0x6177('0x7d'),[][_0x6177('0x7e')](_0x4a0495['query'][_0x5bbc3f]));}else if(_0x5bbc3f==='createdAt'){var _0x29f9ce=JSON['parse'](_0x4a0495['query'][_0x5bbc3f])['$gte'];var _0x555bf6=JSON['parse'](_0x4a0495[_0x6177('0x44')][_0x5bbc3f])[_0x6177('0x7f')];_0x4b6e23['where'](_0x6177('0x80'),_0x29f9ce,_0x555bf6);}else{if(_0x4a0495['query'][_0x5bbc3f]===_0x6177('0x81')){_0x4b6e23[_0x6177('0x4d')]('i.'+_0x5bbc3f+_0x6177('0x82'));}else{_0x4b6e23[_0x6177('0x4d')]('i.'+_0x5bbc3f+'\x20=\x20?',_0x4a0495[_0x6177('0x44')][_0x5bbc3f]);}}});}if(_0x4a0495['query'][_0x6177('0x83')]){if(_0x4a0495[_0x6177('0x44')][_0x6177('0x83')]==0x1){_0x4b6e23[_0x6177('0x69')](_0x6177('0x84'));}else{_0x4b6e23[_0x6177('0x69')](_0x6177('0x85'));}}if(_0x4a0495[_0x6177('0x44')][_0x6177('0x86')]){_0x10b14b=_[_0x6177('0x87')](_0x4a0495[_0x6177('0x44')]['tag'])?_0x4a0495['query'][_0x6177('0x86')]:new Array(_0x4a0495[_0x6177('0x44')][_0x6177('0x86')]);_0x10b14b[_0x6177('0x36')](function(_0x22415e){_0x5d990e['or'](_0x6177('0x88'),'%,'+_0x22415e+',%');});}if(_0x4a0495[_0x6177('0x44')][_0x6177('0x89')]){var _0x55b831=_0x4a0495[_0x6177('0x44')][_0x6177('0x89')]['replace']('\x5c','\x5c\x5c')[_0x6177('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x55b831)){_0x55b7e7['or']('i.id\x20LIKE\x20?',_0x55b831+'%');}else{_0x55b7e7['or'](_0x6177('0x8b'),qs[_0x6177('0x8c')](_0x55b831))['or'](_0x6177('0x8d'),_0x55b831+'%')['or'](_0x6177('0x8e'),_0x55b831+'%');}}}_0x4b6e23[_0x6177('0x4d')](_0x55b7e7);_0x4b6e23[_0x6177('0x8f')](_0x6177('0x90'));var _0x2baad2={'type':db[_0x6177('0x91')]['QueryTypes'][_0x6177('0x92')],'raw':!![]};var _0x1e0628=_0x4b6e23[_0x6177('0x93')]();_0x1e0628[_0x6177('0x50')](_0x6177('0x90'));_0x1e0628[_0x6177('0x50')](_0x6177('0x94'),_0x6177('0x95'));if(_0x16fb7b['order']){_0x16fb7b[_0x6177('0x4b')]['forEach'](function(_0x5049c0){var _0xd7d093=_0x5049c0[0x0]===_0x6177('0x96')?_0x5049c0[0x0]:'i.'+_0x5049c0[0x0];_0x4b6e23['order'](_0xd7d093,_0x5049c0[0x1]==='DESC'?![]:!![]);});}if(!_[_0x6177('0x7b')](_0x10b14b)){_0x4b6e23['having'](_0x5d990e);_0x1e0628[_0x6177('0x4d')](_0x6177('0x97'),_0x10b14b);}BPromise[_0x6177('0x98')]()['then'](function(){if(!_0xcec78d){if(_0x4a0495[_0x6177('0x44')][_0x6177('0x7c')])return;_0x1e0628[_0x6177('0x4d')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x4b6e23[_0x6177('0x4d')](_0x6177('0x99'));return;}if(_0x4a0495[_0x6177('0x9a')]['role']!==_0x6177('0x9b'))return;return _0x4a0495['user'][_0x6177('0x9c')]({'attributes':['id'],'raw':!![]})[_0x6177('0x2b')](function(_0x3a2ab3){if(_[_0x6177('0x7b')](_0x3a2ab3)){_0x1e0628['where'](_0x6177('0x9d'));_0x4b6e23[_0x6177('0x4d')](_0x6177('0x9d'));}else{_0x1e0628[_0x6177('0x4d')](_0x6177('0x7d'),_[_0x6177('0x32')](_0x3a2ab3,'id'));_0x4b6e23[_0x6177('0x4d')](_0x6177('0x7d'),_[_0x6177('0x32')](_0x3a2ab3,'id'));}});})[_0x6177('0x2b')](function(){if(_0x4a0495['user'][_0x6177('0x9e')]===_0x6177('0x9b')&&!_0xcec78d&&!_0x4a0495[_0x6177('0x44')][_0x6177('0x7c')])return[];return db['sequelize'][_0x6177('0x44')](_0x1e0628['toString'](),_0x2baad2);})[_0x6177('0x2b')](function(_0x2cd599){_0x3315cd[_0x6177('0x24')]=_0x2cd599[_0x6177('0x48')];if(_0x3315cd[_0x6177('0x24')]===0x0)return[];return db[_0x6177('0x9f')][_0x6177('0x44')](_0x34a09f[_0x6177('0xa0')](),_0x2baad2)[_0x6177('0x2b')](function(_0x2eb9d4){_0xedbf37=_['keyBy'](_0x2eb9d4,'id');_0x2baad2=_[_0x6177('0xa1')](_0x2baad2,{'model':db[_0x6177('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a0495[_0x6177('0x44')][_0x6177('0x47')]){_0x16fb7b['attributes'][_0x6177('0x36')](function(_0x3c585a){_0x4b6e23[_0x6177('0x50')]('i.'+_0x3c585a);});}else{_0x4b6e23[_0x6177('0x50')](_0x6177('0x94'),_0x6177('0x95'));_0x4b6e23[_0x6177('0x50')]('a.key',_0x6177('0xa2'));_0x4b6e23[_0x6177('0x50')]('a.mandatoryDisposition',_0x6177('0xa3'));_0x4b6e23[_0x6177('0x50')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4b6e23[_0x6177('0x50')](_0x6177('0xa4'));_0x4b6e23[_0x6177('0x50')](_0x6177('0xa5'),_0x6177('0xa6'));_0x4b6e23[_0x6177('0x50')](_0x6177('0xa7'),_0x6177('0xa8'));_0x4b6e23[_0x6177('0x50')]('c.email',_0x6177('0xa9'));_0x4b6e23[_0x6177('0x50')](_0x6177('0xaa'),_0x6177('0xab'));_0x4b6e23['field'](_0x6177('0xac'),_0x6177('0xad'));_0x4b6e23['field']('c.fax',_0x6177('0xae'));_0x4b6e23['field'](_0x6177('0xaf'),_0x6177('0xb0'));_0x4b6e23['field']('o.internal',_0x6177('0xb1'));_0x4b6e23[_0x6177('0x50')](_0x6177('0xb2'),_0x6177('0x33'));}if(_0x16fb7b['limit'])_0x4b6e23['limit'](_0x16fb7b[_0x6177('0x4a')]);if(_0x16fb7b[_0x6177('0x22')])_0x4b6e23[_0x6177('0x22')](_0x16fb7b[_0x6177('0x22')]);return db[_0x6177('0x9f')][_0x6177('0x44')](_0x4b6e23[_0x6177('0xa0')](),_0x2baad2);})[_0x6177('0x2b')](function(_0xd4d879){if(_0xd4d879['length']>0x0)_0x87a346['where'](_0x6177('0xb3'),_[_0x6177('0x32')](_0xd4d879,'id'));return db['sequelize']['query'](_0x87a346['toString'](),_0x2baad2)['then'](function(_0xc1a33e){var _0x34b00c=_['groupBy'](_0xc1a33e,_0x6177('0xb4'));var _0x328d00=[];_0xd4d879[_0x6177('0x36')](function(_0x4bf6a9){_0x328d00[_0x6177('0x37')](updateOpenchannelInteraction(_0x4bf6a9,_0xedbf37,_0x34b00c));});return BPromise['all'](_0x328d00);});});})[_0x6177('0x2b')](function(_0x3c685a){_0x3315cd['rows']=_0x3c685a;return _0x3315cd;})[_0x6177('0x2b')](respondWithFilteredResult(_0x4f6982,_0x16fb7b))[_0x6177('0xb5')](handleError(_0x4f6982,null));};exports['show']=function(_0x1497b3,_0x555531){var _0xe9927f={};if(_0x1497b3[_0x6177('0x44')][_0x6177('0x41')]&&_0x1497b3[_0x6177('0x44')]['type']===_0x6177('0x56')){_0xe9927f[_0x6177('0x56')]=_0x1497b3[_0x6177('0xb6')]['id'];}else{_0xe9927f['id']=_0x1497b3[_0x6177('0xb6')]['id'];}var _0x3dd0d4={'raw':![],'where':_0xe9927f},_0x25f4a7={};_0x25f4a7['model']=_[_0x6177('0x78')](db[_0x6177('0x3f')][_0x6177('0x40')]);_0x25f4a7[_0x6177('0x44')]=_[_0x6177('0x78')](_0x1497b3[_0x6177('0x44')]);_0x25f4a7['filters']=_['intersection'](_0x25f4a7[_0x6177('0x43')],_0x25f4a7[_0x6177('0x44')]);_0x3dd0d4['attributes']=_[_0x6177('0x45')](_0x25f4a7[_0x6177('0x43')],qs[_0x6177('0x47')](_0x1497b3[_0x6177('0x44')][_0x6177('0x47')]));_0x3dd0d4[_0x6177('0x46')]=_0x3dd0d4[_0x6177('0x46')][_0x6177('0x48')]?_0x3dd0d4['attributes']:_0x25f4a7[_0x6177('0x43')];if(_0x1497b3[_0x6177('0x44')][_0x6177('0xb7')]){_0x3dd0d4['include']=[{'all':!![]}];}_0x3dd0d4=_['merge']({},_0x3dd0d4,_0x1497b3[_0x6177('0xb8')]);return db[_0x6177('0x3f')][_0x6177('0x67')](_0x3dd0d4)['then'](handleEntityNotFound(_0x555531,null))[_0x6177('0x2b')](respondWithResult(_0x555531,null))['catch'](handleError(_0x555531,null));};exports[_0x6177('0xb9')]=function(_0xcca61a,_0x4de803){return db[_0x6177('0x3f')][_0x6177('0xb9')](_0xcca61a[_0x6177('0x77')],{})[_0x6177('0x2b')](respondWithResult(_0x4de803,0xc9))[_0x6177('0xb5')](handleError(_0x4de803,null));};exports['update']=function(_0x3ee65f,_0x17a9c9){if(_0x3ee65f[_0x6177('0x77')]['id']){delete _0x3ee65f['body']['id'];}return db[_0x6177('0x3f')]['find']({'where':{'id':_0x3ee65f[_0x6177('0xb6')]['id']}})[_0x6177('0x2b')](handleEntityNotFound(_0x17a9c9,null))[_0x6177('0x2b')](saveUpdates(_0x3ee65f[_0x6177('0x77')],null))[_0x6177('0x2b')](respondWithResult(_0x17a9c9,null))['catch'](handleError(_0x17a9c9,null));};exports[_0x6177('0x2a')]=function(_0x501081,_0x1f4830){return db[_0x6177('0x3f')]['find']({'where':{'id':_0x501081[_0x6177('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1f4830,null))['then'](removeEntity(_0x1f4830,null))[_0x6177('0xb5')](handleError(_0x1f4830,null));};exports[_0x6177('0xba')]=function(_0x11ceb0,_0x252ae3){return db[_0x6177('0x3f')][_0x6177('0xba')]()[_0x6177('0x2b')](respondWithResult(_0x252ae3,null))[_0x6177('0xb5')](handleError(_0x252ae3,null));};exports[_0x6177('0xbb')]=function(_0x41240d,_0x17f279,_0x5ab0e8){return db[_0x6177('0xbc')][_0x6177('0x67')]({'where':{'id':_0x41240d[_0x6177('0xb6')]['id']}})[_0x6177('0x2b')](handleEntityNotFound(_0x17f279,null))[_0x6177('0x2b')](function(_0x21f1bb){if(_0x21f1bb){return _0x21f1bb['addMessage'](_0x41240d[_0x6177('0x77')]['ids'],_[_0x6177('0xbd')](_0x41240d[_0x6177('0x77')],['ids','id'])||{});}})['then'](respondWithResult(_0x17f279,null))[_0x6177('0xb5')](handleError(_0x17f279,null));};exports[_0x6177('0xbe')]=function(_0x825ad4,_0x31a097,_0x581b39){var _0x291df4={'raw':![],'where':{}};var _0x3cd09d={};var _0x57f857={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x6177('0xbf')]({'where':{'id':_0x825ad4[_0x6177('0xb6')]['id']}})[_0x6177('0x2b')](handleEntityNotFound(_0x31a097,null))[_0x6177('0x2b')](function(_0x5a692b){if(_0x5a692b){_0x3cd09d[_0x6177('0x43')]=_[_0x6177('0x78')](db['OpenchannelMessage'][_0x6177('0x40')]);_0x3cd09d[_0x6177('0x44')]=_[_0x6177('0x78')](_0x825ad4[_0x6177('0x44')]);_0x3cd09d[_0x6177('0x4e')]=_['intersection'](_0x3cd09d['model'],_0x3cd09d[_0x6177('0x44')]);_0x291df4[_0x6177('0x46')]=_[_0x6177('0x45')](_0x3cd09d['model'],qs[_0x6177('0x47')](_0x825ad4[_0x6177('0x44')][_0x6177('0x47')]));_0x291df4['attributes']=_0x291df4['attributes'][_0x6177('0x48')]?_0x291df4[_0x6177('0x46')]:_0x3cd09d[_0x6177('0x43')];if(!_0x825ad4[_0x6177('0x44')][_0x6177('0xc0')]('nolimit')){_0x291df4[_0x6177('0x4a')]=qs[_0x6177('0x4a')](_0x825ad4['query']['limit']);_0x291df4[_0x6177('0x22')]=qs[_0x6177('0x22')](_0x825ad4['query'][_0x6177('0x22')]);}_0x291df4['order']=qs[_0x6177('0x4c')](_0x825ad4[_0x6177('0x44')][_0x6177('0x4c')]);_0x291df4[_0x6177('0x4d')]=qs[_0x6177('0x4e')](_['pick'](_0x825ad4[_0x6177('0x44')],_0x3cd09d[_0x6177('0x4e')]));_0x291df4[_0x6177('0x4d')][_0x6177('0xb4')]=_0x5a692b['id'];if(_0x825ad4[_0x6177('0x44')][_0x6177('0x89')]){_0x291df4['where']=_['merge'](_0x291df4[_0x6177('0x4d')],{'$or':_[_0x6177('0x32')](_0x291df4[_0x6177('0x46')],function(_0x367df5){var _0x27edb9={};_0x27edb9[_0x367df5]={'$like':'%'+_0x825ad4[_0x6177('0x44')][_0x6177('0x89')]+'%'};return _0x27edb9;})});}if(_0x825ad4[_0x6177('0x44')][_0x6177('0xc1')]){var _0x40c3c1=_0x825ad4[_0x6177('0x44')][_0x6177('0xc1')][_0x6177('0x35')](',');var _0xc1622a={};_0xc1622a[_0x40c3c1[0x0]]={'$gte':moment(_0x40c3c1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x291df4[_0x6177('0x4d')]=_[_0x6177('0xa1')](_0x291df4['where'],_0xc1622a);}_0x291df4=_[_0x6177('0xa1')]({},_0x291df4,_0x825ad4[_0x6177('0xb8')]);return db[_0x6177('0xbc')]['count']({'where':_0x291df4[_0x6177('0x4d')]})[_0x6177('0x2b')](function(_0x13298e){_0x57f857['count']=_0x13298e;if(_0x825ad4[_0x6177('0x44')][_0x6177('0xb7')]){_0x291df4[_0x6177('0xc2')]=[{'all':!![]}];}return db[_0x6177('0xbc')]['findAll'](_0x291df4);})[_0x6177('0x2b')](function(_0x194dd5){_0x57f857[_0x6177('0xc3')]=_0x194dd5;return _0x57f857;});}})[_0x6177('0x2b')](respondWithFilteredResult(_0x31a097,_0x291df4))[_0x6177('0xb5')](handleError(_0x31a097,null));};exports['addTags']=function(_0x347994,_0x90c7ef,_0x21c227){return db[_0x6177('0x3f')][_0x6177('0x67')]({'where':{'id':_0x347994[_0x6177('0xb6')]['id']}})['then'](handleEntityNotFound(_0x90c7ef,null))['then'](function(_0x2c9c8f){if(_0x2c9c8f){return _0x2c9c8f[_0x6177('0xc4')](_0x347994[_0x6177('0x77')][_0x6177('0xc5')],_[_0x6177('0xbd')](_0x347994['body'],[_0x6177('0xc5'),'id'])||{})[_0x6177('0xc6')](function(){return db[_0x6177('0x74')][_0x6177('0xc7')]({'attributes':['id','name',_0x6177('0x51')],'where':{'id':_0x347994['body']['ids']}});})[_0x6177('0x2b')](function(_0x4f3304){socket[_0x6177('0xc8')](_0x6177('0xc9'),{'id':Number(_0x347994[_0x6177('0xb6')]['id']),'tags':_0x4f3304||[]});return{'id':Number(_0x347994[_0x6177('0xb6')]['id']),'tags':_0x4f3304||[]};});}})[_0x6177('0x2b')](respondWithResult(_0x90c7ef,null))['catch'](handleError(_0x90c7ef,null));};exports[_0x6177('0xca')]=function(_0x3a7af2,_0x38bf27,_0x314c94){return db[_0x6177('0x3f')][_0x6177('0x67')]({'where':{'id':_0x3a7af2[_0x6177('0xb6')]['id']}})[_0x6177('0x2b')](handleEntityNotFound(_0x38bf27,null))[_0x6177('0x2b')](function(_0x2f0aaf){if(_0x2f0aaf){return _0x2f0aaf[_0x6177('0xca')](_0x3a7af2[_0x6177('0x44')][_0x6177('0xc5')]);}})[_0x6177('0x2b')](respondWithStatusCode(_0x38bf27,null))[_0x6177('0xb5')](handleError(_0x38bf27,null));};exports[_0x6177('0xcb')]=function(_0x531634,_0x51be32){var _0x1e3b9f=moment()[_0x6177('0xcc')]()['toString']();var _0x5dc4b0=path[_0x6177('0xcd')](config['root'],'server',_0x6177('0xce'),_0x6177('0xcf'));var _0x5182aa=path[_0x6177('0xcd')](config[_0x6177('0xd0')],_0x6177('0xd1'),'files',_0x6177('0xd2'));var _0xdf6d=path[_0x6177('0xcd')](_0x5dc4b0,_0x1e3b9f);var _0x130e7c=util[_0x6177('0xd3')]('transcript-%d-%s.zip',_0x531634[_0x6177('0xb6')]['id'],_0x1e3b9f);var _0x5a033c=path['join'](_0x5dc4b0,_0x130e7c);var _0x1d3be1=[];_0x1d3be1[_0x6177('0x37')]({'model':db[_0x6177('0x75')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x1d3be1[_0x6177('0x37')]({'model':db[_0x6177('0xd4')],'as':_0x6177('0xd5'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x531634[_0x6177('0x44')][_0x6177('0xd2')]){_0x1d3be1['push']({'model':db['Attachment'],'as':_0x6177('0xd6'),'raw':!![]});}var _0x30b1e7=[{'model':db[_0x6177('0xbc')],'as':_0x6177('0xd7'),'attributes':['id',_0x6177('0x77'),_0x6177('0xd8'),_0x6177('0xd9'),_0x6177('0xda'),_0x6177('0x83')],'include':_0x1d3be1}];_0x30b1e7[_0x6177('0x37')]({'model':db[_0x6177('0xdb')],'as':_0x6177('0xdc'),'attributes':['id',_0x6177('0x2f')]});_0x30b1e7[_0x6177('0x37')]({'model':db[_0x6177('0x75')],'as':_0x6177('0xdd'),'attributes':['id',_0x6177('0xde')]});return db[_0x6177('0x3f')][_0x6177('0x67')]({'where':{'id':_0x531634[_0x6177('0xb6')]['id']},'include':_0x30b1e7})['then'](handleEntityNotFound(_0x51be32,null))[_0x6177('0x2b')](function(_0x354e63){if(_0x354e63){var _0x2dca6d=_0x354e63['get']({'plain':!![]});fs[_0x6177('0xdf')](_0xdf6d);var _0x1a6899={'channel':_0x6177('0xe0'),'account':_0x2dca6d[_0x6177('0xdc')][_0x6177('0x2f')],'agent':_0x2dca6d[_0x6177('0xdd')]?_0x2dca6d[_0x6177('0xdd')][_0x6177('0xde')]:_0x6177('0xe1'),'createdAt':moment(_0x2dca6d[_0x6177('0xd8')])['format'](_0x6177('0xe2'))[_0x6177('0xa0')](),'closedAt':_0x2dca6d['closed']?moment(_0x2dca6d[_0x6177('0xe3')])[_0x6177('0xd3')](_0x6177('0xe2'))[_0x6177('0xa0')]():'','disposition':_0x2dca6d['disposition'],'visibility':_0x2dca6d[_0x6177('0xe4')]?_0x6177('0xe5'):'Private','messages':_(_0x2dca6d[_0x6177('0xd7')])['filter']({'secret':![]})['map'](function(_0x29d6b1){if(_0x29d6b1[_0x6177('0xd6')]){var _0x3cfac2=path[_0x6177('0xcd')](_0x5182aa,_0x29d6b1[_0x6177('0xd6')][_0x6177('0xe6')]);if(fs[_0x6177('0xe7')](_0x3cfac2)){fs[_0x6177('0xe8')](_0x3cfac2)['pipe'](fs[_0x6177('0xe9')](path[_0x6177('0xcd')](_0xdf6d,_0x29d6b1['Attachment'][_0x6177('0xe6')])));}}return{'date':moment(_0x29d6b1['createdAt'])['format'](_0x6177('0xe2'))[_0x6177('0xa0')](),'sender':_0x29d6b1['direction']==='out'?_0x29d6b1[_0x6177('0x75')]?_0x29d6b1['User']['fullname']:'System':_0x29d6b1[_0x6177('0xd5')][_0x6177('0xea')]+(_0x29d6b1[_0x6177('0xd5')][_0x6177('0xeb')]?'\x20'+_0x29d6b1[_0x6177('0xd5')][_0x6177('0xeb')]:''),'body':_0x29d6b1[_0x6177('0xd6')]?_0x29d6b1[_0x6177('0xd6')][_0x6177('0xe6')]:_0x29d6b1[_0x6177('0x77')],'direction':_0x29d6b1[_0x6177('0xd9')]===_0x6177('0xec')?'A':'C','secret':_0x29d6b1['secret'],'read':_0x29d6b1[_0x6177('0x83')],'attachment':_0x29d6b1[_0x6177('0xd6')]};})[_0x6177('0x68')]()};return ejs[_0x6177('0xed')](path['join'](config['root'],'server','views','downloadInteraction.ejs'),{'interaction':_0x1a6899})['then'](function(_0x596698){var _0x3d870d=path[_0x6177('0xcd')](_0xdf6d,'transcript-'+_0x2dca6d['id']+'-'+_0x1e3b9f+_0x6177('0xee'));var _0x1d5573={'path':_0x3d870d,'channel':_0x6177('0xe0'),'interactionId':_0x2dca6d['id']};return pdf[_0x6177('0xef')](_0x596698,_0x1d5573);})[_0x6177('0x2b')](function(){return new BPromise(function(_0xf9ac09,_0x34c688){zipdir(_0xdf6d,{'saveTo':_0x5a033c},function(_0xca5f60,_0x47d7a0){if(_0xca5f60)return _0x34c688(_0xca5f60);return _0xf9ac09(_0x47d7a0);});})[_0x6177('0x2b')](function(){return new BPromise(function(_0x462481,_0x2e12ce){rimraf(_0xdf6d,function(_0x227308){if(_0x227308)_0x2e12ce(_0x227308);return _0x462481();});});})[_0x6177('0x2b')](function(){return _0x51be32[_0x6177('0xcb')](_0x5a033c,_0x130e7c,function(_0x5abf5c){if(_0x5abf5c){console['log'](_0x6177('0xf0'),_0x5abf5c);}else{fs['unlinkSync'](_0x5a033c);}});});});}else{return _0x51be32['sendStatus'](0xc8);}})['catch'](handleError(_0x51be32,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 1e3e556..3eeaadc 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 _0x6e04=['unreadMessages','length','emit','catch','hasOwnProperty','hook','events','OpenchannelInteraction','../../mysqldb','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','then'];(function(_0x22434a,_0x42d7d6){var _0x3113c3=function(_0x1bbc8b){while(--_0x1bbc8b){_0x22434a['push'](_0x22434a['shift']());}};_0x3113c3(++_0x42d7d6);}(_0x6e04,0xde));var _0x46e0=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0x6e04[_0x49f67f];return _0x4779a1;};'use strict';var EventEmitter=require(_0x46e0('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x46e0('0x1')];var OpenchannelMessage=require(_0x46e0('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x46e0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x46e0('0x4'),'afterDestroy':_0x46e0('0x5')};function emitEvent(_0x121094){return function(_0x513807,_0x3d0e6f,_0x34a6bd){_0x513807[_0x46e0('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22a338){_0x513807[_0x46e0('0x7')](_0x46e0('0x8'),_0x22a338[_0x46e0('0x9')](function(_0x55fba0){return{'id':_0x55fba0['id']};}));return OpenchannelMessage[_0x46e0('0xa')]({'where':{'OpenchannelInteractionId':_0x513807['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46e0('0xb')](function(_0x420355){_0x513807[_0x46e0('0x7')](_0x46e0('0xc'),_0x420355[_0x46e0('0xd')]);OpenchannelInteractionEvents[_0x46e0('0xe')](_0x121094+':'+_0x513807['id'],_0x513807);OpenchannelInteractionEvents[_0x46e0('0xe')](_0x121094,_0x513807);_0x34a6bd(null);})[_0x46e0('0xf')](_0x34a6bd(null));};}for(var e in events){if(events[_0x46e0('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x46e0('0x11')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x9eb7=['then','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll'];(function(_0x335126,_0x56aa80){var _0x1c4d92=function(_0xd6a5a){while(--_0xd6a5a){_0x335126['push'](_0x335126['shift']());}};_0x1c4d92(++_0x56aa80);}(_0x9eb7,0xdf));var _0x79eb=function(_0x14ee6c,_0x4031cd){_0x14ee6c=_0x14ee6c-0x0;var _0x2a1bef=_0x9eb7[_0x14ee6c];return _0x2a1bef;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x79eb('0x0'))['db'][_0x79eb('0x1')];var OpenchannelMessage=require(_0x79eb('0x0'))['db'][_0x79eb('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x79eb('0x3'),'afterUpdate':_0x79eb('0x4'),'afterDestroy':_0x79eb('0x5')};function emitEvent(_0x1d8336){return function(_0x355a2e,_0x93a856,_0x3b3779){_0x355a2e[_0x79eb('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1d4137){_0x355a2e[_0x79eb('0x7')](_0x79eb('0x8'),_0x1d4137[_0x79eb('0x9')](function(_0x46563f){return{'id':_0x46563f['id']};}));return OpenchannelMessage[_0x79eb('0xa')]({'where':{'OpenchannelInteractionId':_0x355a2e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x79eb('0xb')](function(_0xf553d8){_0x355a2e[_0x79eb('0x7')](_0x79eb('0xc'),_0xf553d8[_0x79eb('0xd')]);OpenchannelInteractionEvents[_0x79eb('0xe')](_0x1d8336+':'+_0x355a2e['id'],_0x355a2e);OpenchannelInteractionEvents[_0x79eb('0xe')](_0x1d8336,_0x355a2e);_0x3b3779(null);})[_0x79eb('0xf')](_0x3b3779(null));};}for(var e in events){if(events[_0x79eb('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x79eb('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 63db73f..3f37159 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 _0xf706=['request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x51ff7b,_0x1b9560){var _0x133b93=function(_0x44bde9){while(--_0x44bde9){_0x51ff7b['push'](_0x51ff7b['shift']());}};_0x133b93(++_0x1b9560);}(_0xf706,0x16d));var _0x6f70=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xf706[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x6f70('0x0'));var util=require(_0x6f70('0x1'));var logger=require('../../config/logger')(_0x6f70('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f70('0x3'));var fs=require('fs');var path=require(_0x6f70('0x4'));var rimraf=require(_0x6f70('0x5'));var config=require(_0x6f70('0x6'));var attributes=require(_0x6f70('0x7'));module['exports']=function(_0x5417c5,_0x92e315){return _0x5417c5['define'](_0x6f70('0x8'),attributes,{'tableName':_0x6f70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f70('0xa'),'collate':_0x6f70('0xb'),'hooks':{'beforeUpdate':function(_0x2abd26,_0x54adf0,_0x545c1c){if(_0x2abd26[_0x6f70('0xc')]('closed')){_0x2abd26[_0x6f70('0xd')]=moment()[_0x6f70('0xe')](_0x6f70('0xf'));}_0x545c1c(null,_0x2abd26);}}});}; \ No newline at end of file +var _0x1b7e=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x1b7e,0x124));var _0xe1b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1b7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe1b7('0x0'))(_0xe1b7('0x1'));var moment=require(_0xe1b7('0x2'));var BPromise=require(_0xe1b7('0x3'));var rp=require(_0xe1b7('0x4'));var fs=require('fs');var path=require(_0xe1b7('0x5'));var rimraf=require(_0xe1b7('0x6'));var config=require(_0xe1b7('0x7'));var attributes=require(_0xe1b7('0x8'));module['exports']=function(_0x30aa06,_0x1128c1){return _0x30aa06[_0xe1b7('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0xe1b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe1b7('0xb'),'collate':_0xe1b7('0xc'),'hooks':{'beforeUpdate':function(_0x30fd12,_0x439a3f,_0x5a685a){if(_0x30fd12[_0xe1b7('0xd')]('closed')){_0x30fd12[_0xe1b7('0xe')]=moment()[_0xe1b7('0xf')](_0xe1b7('0x10'));}_0x5a685a(null,_0x30fd12);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 6c8f6d7..427faa1 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 _0x1005=['AddTagsToOpenchannelInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','register','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','then','stringify'];(function(_0x3dd614,_0x46f1c5){var _0x6c0c43=function(_0x399b53){while(--_0x399b53){_0x3dd614['push'](_0x3dd614['shift']());}};_0x6c0c43(++_0x46f1c5);}(_0x1005,0x14e));var _0x5100=function(_0x40829d,_0x3c3b07){_0x40829d=_0x40829d-0x0;var _0x20f837=_0x1005[_0x40829d];return _0x20f837;};'use strict';var _=require(_0x5100('0x0'));var util=require(_0x5100('0x1'));var moment=require(_0x5100('0x2'));var BPromise=require(_0x5100('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5100('0x4'));var db=require(_0x5100('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5100('0x6'))(_0x5100('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5100('0x8')]({'port':0x232a});config[_0x5100('0x9')]=_[_0x5100('0xa')](config[_0x5100('0x9')],{'host':_0x5100('0xb'),'port':0x18eb});var socket=require(_0x5100('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x5100('0xd')](socket);function respondWithRpcPromise(_0x3a9450,_0x48c4b7,_0x4ae6ab){return new BPromise(function(_0x4f24b5,_0x498ecd){return client[_0x5100('0xe')](_0x3a9450,_0x4ae6ab)['then'](function(_0x4e0079){logger['info'](_0x5100('0xf'),_0x48c4b7,_0x5100('0x10'));logger[_0x5100('0x11')](_0x5100('0x12'),_0x48c4b7,_0x5100('0x10'),JSON['stringify'](_0x4e0079));if(_0x4e0079[_0x5100('0x13')]){if(_0x4e0079[_0x5100('0x13')][_0x5100('0x14')]===0x1f4){logger[_0x5100('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x48c4b7,_0x4e0079['error'][_0x5100('0x15')]);return _0x498ecd(_0x4e0079[_0x5100('0x13')]['message']);}logger[_0x5100('0x13')](_0x5100('0xf'),_0x48c4b7,_0x4e0079[_0x5100('0x13')][_0x5100('0x15')]);return _0x4f24b5(_0x4e0079['error'][_0x5100('0x15')]);}else{logger[_0x5100('0x16')](_0x5100('0xf'),_0x48c4b7,'request\x20sent');_0x4f24b5(_0x4e0079[_0x5100('0x17')][_0x5100('0x15')]);}})[_0x5100('0x18')](function(_0x2f6a1e){logger['error'](_0x5100('0xf'),_0x48c4b7,_0x2f6a1e);_0x498ecd(_0x2f6a1e);});});}exports[_0x5100('0x19')]=function(_0x1db12d){var _0x5c56df=this;return new Promise(function(_0x4177fd,_0x382ccf){return db[_0x5100('0x1a')]['update'](_0x1db12d[_0x5100('0x1b')],{'raw':_0x1db12d[_0x5100('0x1c')]?_0x1db12d['options'][_0x5100('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1db12d['options']?_0x1db12d[_0x5100('0x1c')][_0x5100('0x1e')]||null:null,'attributes':_0x1db12d['options']?_0x1db12d[_0x5100('0x1c')][_0x5100('0x1f')]||null:null,'limit':_0x1db12d['options']?_0x1db12d['options'][_0x5100('0x20')]||null:null})[_0x5100('0x21')](function(_0xf4918d){logger[_0x5100('0x16')](_0x5100('0x19'),_0x1db12d);logger[_0x5100('0x11')](_0x5100('0x19'),_0x1db12d,JSON[_0x5100('0x22')](_0xf4918d));_0x4177fd(_0xf4918d);})[_0x5100('0x18')](function(_0x305f4a){logger[_0x5100('0x13')](_0x5100('0x19'),_0x305f4a['message'],_0x1db12d);_0x382ccf(_0x5c56df[_0x5100('0x13')](0x1f4,_0x305f4a[_0x5100('0x15')]));});});};exports[_0x5100('0x23')]=function(_0xd721a4){return new Promise(function(_0x157983,_0x11af35){return db[_0x5100('0x1a')][_0x5100('0x24')]({'where':_0xd721a4['options']?_0xd721a4[_0x5100('0x1c')][_0x5100('0x1e')]||null:null})[_0x5100('0x21')](function(_0x4fae16){if(_0x4fae16){return _0x4fae16[_0x5100('0x25')](_0xd721a4['body']['ids'],_[_0x5100('0x26')](_0xd721a4[_0x5100('0x1b')],[_0x5100('0x27'),'id'])||{});}})['spread'](function(_0x50dcbb){logger[_0x5100('0x16')](_0x5100('0x28'),_0xd721a4);logger[_0x5100('0x11')](_0x5100('0x28'),_0xd721a4,JSON['stringify'](_0x50dcbb));_0x157983(_0x50dcbb);})[_0x5100('0x18')](function(_0x48cbf5){logger[_0x5100('0x13')](_0x5100('0x28'),_0x48cbf5[_0x5100('0x15')],_0xd721a4);_0x11af35(_this[_0x5100('0x13')](0x1f4,_0x48cbf5['message']));});});}; \ No newline at end of file +var _0xb553=['info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','then','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request'];(function(_0x3bd784,_0x3b9509){var _0x902bc2=function(_0x149a47){while(--_0x149a47){_0x3bd784['push'](_0x3bd784['shift']());}};_0x902bc2(++_0x3b9509);}(_0xb553,0x180));var _0x3b55=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb553[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x3b55('0x0'));var util=require('util');var moment=require(_0x3b55('0x1'));var BPromise=require(_0x3b55('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b55('0x3'))['db'];var utils=require(_0x3b55('0x4'));var logger=require(_0x3b55('0x5'))(_0x3b55('0x6'));var config=require(_0x3b55('0x7'));var jayson=require(_0x3b55('0x8'));var client=jayson[_0x3b55('0x9')]['http']({'port':0x232a});config[_0x3b55('0xa')]=_[_0x3b55('0xb')](config['redis'],{'host':_0x3b55('0xc'),'port':0x18eb});var socket=require(_0x3b55('0xd'))(new Redis(config['redis']));require(_0x3b55('0xe'))['register'](socket);function respondWithRpcPromise(_0x1d49f8,_0x2b3624,_0x1855cb){return new BPromise(function(_0x14b3f4,_0x2c67d8){return client[_0x3b55('0xf')](_0x1d49f8,_0x1855cb)['then'](function(_0xe3531c){logger[_0x3b55('0x10')](_0x3b55('0x11'),_0x2b3624,_0x3b55('0x12'));logger[_0x3b55('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x2b3624,'request\x20sent',JSON[_0x3b55('0x14')](_0xe3531c));if(_0xe3531c[_0x3b55('0x15')]){if(_0xe3531c[_0x3b55('0x15')][_0x3b55('0x16')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x2b3624,_0xe3531c[_0x3b55('0x15')][_0x3b55('0x17')]);return _0x2c67d8(_0xe3531c[_0x3b55('0x15')][_0x3b55('0x17')]);}logger['error'](_0x3b55('0x11'),_0x2b3624,_0xe3531c['error'][_0x3b55('0x17')]);return _0x14b3f4(_0xe3531c['error'][_0x3b55('0x17')]);}else{logger['info'](_0x3b55('0x11'),_0x2b3624,_0x3b55('0x12'));_0x14b3f4(_0xe3531c[_0x3b55('0x18')]['message']);}})[_0x3b55('0x19')](function(_0x3c695a){logger[_0x3b55('0x15')](_0x3b55('0x11'),_0x2b3624,_0x3c695a);_0x2c67d8(_0x3c695a);});});}exports[_0x3b55('0x1a')]=function(_0x114966){var _0x5bafe7=this;return new Promise(function(_0x30c3a9,_0x1b3087){return db[_0x3b55('0x1b')][_0x3b55('0x1c')](_0x114966[_0x3b55('0x1d')],{'raw':_0x114966[_0x3b55('0x1e')]?_0x114966['options'][_0x3b55('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114966[_0x3b55('0x1e')]?_0x114966['options']['where']||null:null,'attributes':_0x114966[_0x3b55('0x1e')]?_0x114966['options']['attributes']||null:null,'limit':_0x114966[_0x3b55('0x1e')]?_0x114966[_0x3b55('0x1e')][_0x3b55('0x20')]||null:null})[_0x3b55('0x21')](function(_0x24a64a){logger[_0x3b55('0x10')]('UpdateOpenchannelInteraction',_0x114966);logger[_0x3b55('0x13')](_0x3b55('0x1a'),_0x114966,JSON[_0x3b55('0x14')](_0x24a64a));_0x30c3a9(_0x24a64a);})['catch'](function(_0x4bc7a1){logger['error']('UpdateOpenchannelInteraction',_0x4bc7a1[_0x3b55('0x17')],_0x114966);_0x1b3087(_0x5bafe7[_0x3b55('0x15')](0x1f4,_0x4bc7a1[_0x3b55('0x17')]));});});};exports[_0x3b55('0x22')]=function(_0x1e86fe){return new Promise(function(_0x3e2919,_0x2ef7e4){return db['OpenchannelInteraction'][_0x3b55('0x23')]({'where':_0x1e86fe[_0x3b55('0x1e')]?_0x1e86fe[_0x3b55('0x1e')]['where']||null:null})[_0x3b55('0x21')](function(_0x3b6d5d){if(_0x3b6d5d){return _0x3b6d5d['addTags'](_0x1e86fe[_0x3b55('0x1d')][_0x3b55('0x24')],_[_0x3b55('0x25')](_0x1e86fe['body'],['ids','id'])||{});}})[_0x3b55('0x26')](function(_0x26a4d0){logger[_0x3b55('0x10')](_0x3b55('0x27'),_0x1e86fe);logger['debug']('AddTags',_0x1e86fe,JSON[_0x3b55('0x14')](_0x26a4d0));_0x3e2919(_0x26a4d0);})[_0x3b55('0x19')](function(_0x3b5008){logger[_0x3b55('0x15')](_0x3b55('0x27'),_0x3b5008['message'],_0x1e86fe);_0x2ef7e4(_this[_0x3b55('0x15')](0x1f4,_0x3b5008[_0x3b55('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 35c20d1..c7485ff 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 _0xaf91=['save','update','emit','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x3bfd34,_0x386868){var _0x4475c6=function(_0x4a0f01){while(--_0x4a0f01){_0x3bfd34['push'](_0x3bfd34['shift']());}};_0x4475c6(++_0x386868);}(_0xaf91,0xef));var _0x1af9=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xaf91[_0x278e3c];return _0x3e2d9b;};'use strict';var OpenchannelInteractionEvents=require(_0x1af9('0x0'));var events=[_0x1af9('0x1'),'remove',_0x1af9('0x2')];function createListener(_0x523c1e,_0x11a406){return function(_0x471787){_0x11a406[_0x1af9('0x3')](_0x523c1e,_0x471787);};}function removeListener(_0x35e83c,_0x323aa0){return function(){OpenchannelInteractionEvents['removeListener'](_0x35e83c,_0x323aa0);};}exports['register']=function(_0xf0747b){for(var _0x52c4ea=0x0,_0x3a651a=events[_0x1af9('0x4')];_0x52c4ea<_0x3a651a;_0x52c4ea++){var _0xf341a=events[_0x52c4ea];var _0xe0a284=createListener(_0x1af9('0x5')+_0xf341a,_0xf0747b);OpenchannelInteractionEvents['on'](_0xf341a,_0xe0a284);}}; \ No newline at end of file +var _0xb5b0=['save','remove','removeListener','length','openchannelInteraction:'];(function(_0x1bcb15,_0x5c13d2){var _0x42be3e=function(_0x309a96){while(--_0x309a96){_0x1bcb15['push'](_0x1bcb15['shift']());}};_0x42be3e(++_0x5c13d2);}(_0xb5b0,0xcd));var _0x0b5b=function(_0x4c201a,_0x195d50){_0x4c201a=_0x4c201a-0x0;var _0xc9e82f=_0xb5b0[_0x4c201a];return _0xc9e82f;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x0b5b('0x0'),_0x0b5b('0x1'),'update'];function createListener(_0x42043a,_0x94f148){return function(_0xb22626){_0x94f148['emit'](_0x42043a,_0xb22626);};}function removeListener(_0x1a7634,_0x282f66){return function(){OpenchannelInteractionEvents[_0x0b5b('0x2')](_0x1a7634,_0x282f66);};}exports['register']=function(_0x6c579e){for(var _0x252184=0x0,_0x3a94dc=events[_0x0b5b('0x3')];_0x252184<_0x3a94dc;_0x252184++){var _0x3720f8=events[_0x252184];var _0x48be2d=createListener(_0x0b5b('0x4')+_0x3720f8,_0x6c579e);OpenchannelInteractionEvents['on'](_0x3720f8,_0x48be2d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index a36bb12..5bc3afa 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(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x3afe55,_0x39d26f){var _0x56a928=function(_0x563e29){while(--_0x563e29){_0x3afe55['push'](_0x3afe55['shift']());}};_0x56a928(++_0x39d26f);}(_0xe706,0xa3));var _0x6e70=function(_0x23f8c8,_0xb536b9){_0x23f8c8=_0x23f8c8-0x0;var _0x3dc718=_0xe706[_0x23f8c8];return _0x3dc718;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 213ef37..961c4ae 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 _0xfff0=['STRING','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x2c127f,_0x2c99ae){var _0x48e9e5=function(_0x591e6c){while(--_0x591e6c){_0x2c127f['push'](_0x2c127f['shift']());}};_0x48e9e5(++_0x2c99ae);}(_0xfff0,0x139));var _0x0fff=function(_0x15e2f5,_0x2a6928){_0x15e2f5=_0x15e2f5-0x0;var _0x3dbf3a=_0xfff0[_0x15e2f5];return _0x3dbf3a;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'body':{'type':Sequelize[_0x0fff('0x1')](_0x0fff('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0fff('0x4')]('in',_0x0fff('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0fff('0x6')]},'providerName':{'type':Sequelize[_0x0fff('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0972=['out','DATE','STRING','TEXT','exports','medium','BOOLEAN','ENUM'];(function(_0x5af5a8,_0x10ce33){var _0x414545=function(_0xb57b5c){while(--_0xb57b5c){_0x5af5a8['push'](_0x5af5a8['shift']());}};_0x414545(++_0x10ce33);}(_0x0972,0x64));var _0x2097=function(_0x3a188a,_0x487604){_0x3a188a=_0x3a188a-0x0;var _0x5b8c49=_0x0972[_0x3a188a];return _0x5b8c49;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'body':{'type':Sequelize['TEXT'](_0x2097('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2097('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2097('0x3')]('in','out'),'defaultValue':_0x2097('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2097('0x5')]},'providerName':{'type':Sequelize[_0x2097('0x6')]},'providerResponse':{'type':Sequelize[_0x2097('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 192044e..7d32c86 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 _0x398a=['contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','merge','where','VIRTUAL','OpenchannelMessage','rows','show','includeAll','include','options','find','create','body','params','../../config/logger','openchannel-interactions','accept','format','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','interaction','stringify','null','acceptMessage','sequelize','QueryTypes','SELECT'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x398a,0x11a));var _0xa398=function(_0x5b9cbd,_0x5ab9e6){_0x5b9cbd=_0x5b9cbd-0x0;var _0x2c11cf=_0x398a[_0x5b9cbd];return _0x2c11cf;};'use strict';var emlformat=require(_0xa398('0x0'));var rimraf=require(_0xa398('0x1'));var zipdir=require(_0xa398('0x2'));var jsonpatch=require(_0xa398('0x3'));var rp=require(_0xa398('0x4'));var moment=require(_0xa398('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa398('0x6'));var sox=require(_0xa398('0x7'));var csv=require(_0xa398('0x8'));var ejs=require(_0xa398('0x9'));var fs=require('fs');var fs_extra=require(_0xa398('0xa'));var _=require(_0xa398('0xb'));var squel=require(_0xa398('0xc'));var crypto=require(_0xa398('0xd'));var jsforce=require(_0xa398('0xe'));var deskjs=require(_0xa398('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa398('0x10'));var Papa=require(_0xa398('0x11'));var Redis=require(_0xa398('0x12'));var authService=require(_0xa398('0x13'));var qs=require(_0xa398('0x14'));var as=require(_0xa398('0x15'));var hardwareService=require(_0xa398('0x16'));var logger=require('../../config/logger')(_0xa398('0x17'));var utils=require(_0xa398('0x18'));var config=require(_0xa398('0x19'));var licenseUtil=require(_0xa398('0x1a'));var db=require(_0xa398('0x1b'))['db'];config[_0xa398('0x1c')]=_[_0xa398('0x1d')](config[_0xa398('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xa398('0x1e'))(new Redis(config[_0xa398('0x1c')]));require(_0xa398('0x1f'))[_0xa398('0x20')](socket);var jayson=require(_0xa398('0x21'));var client=jayson[_0xa398('0x22')][_0xa398('0x23')]({'port':0x232c});var client9002=jayson[_0xa398('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x264419,_0x1788e5,_0x4a66d3,_0x568781){return new BPromise(function(_0x42a001,_0x36da88){var _0x41edbd=_0x568781||client;return _0x41edbd[_0xa398('0x24')](_0x264419,_0x4a66d3)[_0xa398('0x25')](function(_0x2d7a48){logger[_0xa398('0x26')](_0xa398('0x27'),_0x1788e5,_0xa398('0x28'));logger['debug'](_0xa398('0x29'),_0x1788e5,_0xa398('0x28'),JSON['stringify'](_0x2d7a48));if(_0x2d7a48['error']){if(_0x2d7a48[_0xa398('0x2a')]['code']===0x1f4){logger[_0xa398('0x2a')](_0xa398('0x27'),_0x1788e5,_0x2d7a48[_0xa398('0x2a')][_0xa398('0x2b')]);return _0x36da88(_0x2d7a48[_0xa398('0x2a')]['message']);}logger[_0xa398('0x2a')](_0xa398('0x27'),_0x1788e5,_0x2d7a48['error']['message']);return _0x42a001(_0x2d7a48['error'][_0xa398('0x2b')]);}else{logger[_0xa398('0x26')](_0xa398('0x27'),_0x1788e5,'request\x20sent');_0x42a001(_0x2d7a48[_0xa398('0x2c')][_0xa398('0x2b')]);}})[_0xa398('0x2d')](function(_0x44692d){logger['error'](_0xa398('0x27'),_0x1788e5,_0x44692d);_0x36da88(_0x44692d);});});}function respondWithStatusCode(_0x2e6f7a,_0x4626c1){_0x4626c1=_0x4626c1||0xcc;return function(_0x8db81b){if(_0x8db81b){return _0x2e6f7a[_0xa398('0x2e')](_0x4626c1);}return _0x2e6f7a[_0xa398('0x2f')](_0x4626c1)[_0xa398('0x30')]();};}function respondWithResult(_0x22f27a,_0x498fb4){_0x498fb4=_0x498fb4||0xc8;return function(_0x5b719e){if(_0x5b719e){return _0x22f27a[_0xa398('0x2f')](_0x498fb4)[_0xa398('0x31')](_0x5b719e);}};}function respondWithFilteredResult(_0x215ca6,_0x1fd70d){return function(_0x1cbe2f){if(_0x1cbe2f){var _0x4641e8=typeof _0x1fd70d['offset']===_0xa398('0x32')&&typeof _0x1fd70d['limit']===_0xa398('0x32');var _0x4d60a1=_0x1cbe2f[_0xa398('0x33')];var _0xbb3509=_0x4641e8?0x0:_0x1fd70d[_0xa398('0x34')];var _0x36516b=_0x4641e8?_0x1cbe2f[_0xa398('0x33')]:_0x1fd70d[_0xa398('0x34')]+_0x1fd70d['limit'];var _0x18fea8;if(_0x36516b>=_0x4d60a1){_0x36516b=_0x4d60a1;_0x18fea8=0xc8;}else{_0x18fea8=0xce;}_0x215ca6[_0xa398('0x2f')](_0x18fea8);return _0x215ca6[_0xa398('0x35')](_0xa398('0x36'),_0xbb3509+'-'+_0x36516b+'/'+_0x4d60a1)[_0xa398('0x31')](_0x1cbe2f);}return null;};}function patchUpdates(_0x3e9e6c){return function(_0x2aca3b){try{jsonpatch['apply'](_0x2aca3b,_0x3e9e6c,!![]);}catch(_0x150ffa){return BPromise[_0xa398('0x37')](_0x150ffa);}return _0x2aca3b[_0xa398('0x38')]();};}function saveUpdates(_0x35c6bc,_0x554678){return function(_0x3e0cae){if(_0x3e0cae){return _0x3e0cae[_0xa398('0x39')](_0x35c6bc)[_0xa398('0x25')](function(_0x539409){return _0x539409;});}return null;};}function removeEntity(_0x421dec,_0xbd3d09){return function(_0x167de7){if(_0x167de7){return _0x167de7[_0xa398('0x3a')]()[_0xa398('0x25')](function(){_0x421dec[_0xa398('0x2f')](0xcc)[_0xa398('0x30')]();});}};}function handleEntityNotFound(_0x586223,_0x26cd41){return function(_0x5f4313){if(!_0x5f4313){_0x586223[_0xa398('0x2e')](0x194);}return _0x5f4313;};}function handleError(_0x517fb5,_0x598168){_0x598168=_0x598168||0x1f4;return function(_0x5176a7){logger['error'](_0x5176a7[_0xa398('0x3b')]);if(_0x5176a7[_0xa398('0x3c')]){delete _0x5176a7[_0xa398('0x3c')];}_0x517fb5[_0xa398('0x2f')](_0x598168)[_0xa398('0x3d')](_0x5176a7);};}exports[_0xa398('0x3e')]=function(_0xef4e9e,_0x4a783f){var _0x4b9fec={},_0x1f56db={},_0x1abfd9={'count':0x0,'rows':[]};var _0x16d3d5=_[_0xa398('0x3f')](db['OpenchannelMessage'][_0xa398('0x40')],function(_0x45e84e){return{'name':_0x45e84e['fieldName'],'type':_0x45e84e[_0xa398('0x41')][_0xa398('0x42')]};});_0x1f56db[_0xa398('0x43')]=_[_0xa398('0x3f')](_0x16d3d5,'name');_0x1f56db[_0xa398('0x44')]=_[_0xa398('0x45')](_0xef4e9e[_0xa398('0x44')]);_0x1f56db['filters']=_[_0xa398('0x46')](_0x1f56db[_0xa398('0x43')],_0x1f56db['query']);_0x4b9fec[_0xa398('0x47')]=_[_0xa398('0x46')](_0x1f56db['model'],qs[_0xa398('0x48')](_0xef4e9e[_0xa398('0x44')][_0xa398('0x48')]));_0x4b9fec[_0xa398('0x47')]=_0x4b9fec[_0xa398('0x47')][_0xa398('0x49')]?_0x4b9fec['attributes']:_0x1f56db[_0xa398('0x43')];if(!_0xef4e9e[_0xa398('0x44')][_0xa398('0x4a')](_0xa398('0x4b'))){_0x4b9fec[_0xa398('0x4c')]=qs[_0xa398('0x4c')](_0xef4e9e[_0xa398('0x44')]['limit']);_0x4b9fec['offset']=qs[_0xa398('0x34')](_0xef4e9e[_0xa398('0x44')][_0xa398('0x34')]);}_0x4b9fec[_0xa398('0x4d')]=qs[_0xa398('0x4e')](_0xef4e9e[_0xa398('0x44')]['sort']);_0x4b9fec['where']=qs[_0xa398('0x4f')](_['pick'](_0xef4e9e[_0xa398('0x44')],_0x1f56db['filters']),_0x16d3d5);if(_0xef4e9e[_0xa398('0x44')][_0xa398('0x50')]){_0x4b9fec['where']=_[_0xa398('0x51')](_0x4b9fec[_0xa398('0x52')],{'$or':_[_0xa398('0x3f')](_0x16d3d5,function(_0x275eeb){if(_0x275eeb[_0xa398('0x41')]!==_0xa398('0x53')){var _0x4fcdaf={};_0x4fcdaf[_0x275eeb['name']]={'$like':'%'+_0xef4e9e['query'][_0xa398('0x50')]+'%'};return _0x4fcdaf;}})});}_0x4b9fec=_[_0xa398('0x51')]({},_0x4b9fec,_0xef4e9e['options']);var _0x3cd570={'where':_0x4b9fec[_0xa398('0x52')]};return db[_0xa398('0x54')]['count'](_0x3cd570)[_0xa398('0x25')](function(_0x2b8b1f){_0x1abfd9[_0xa398('0x33')]=_0x2b8b1f;if(_0xef4e9e['query']['includeAll']){_0x4b9fec['include']=[{'all':!![]}];}return db[_0xa398('0x54')]['findAll'](_0x4b9fec);})[_0xa398('0x25')](function(_0x254f14){_0x1abfd9[_0xa398('0x55')]=_0x254f14;return _0x1abfd9;})[_0xa398('0x25')](respondWithFilteredResult(_0x4a783f,_0x4b9fec))['catch'](handleError(_0x4a783f,null));};exports[_0xa398('0x56')]=function(_0x443a14,_0x15b4a3){var _0x5e0124={'raw':!![],'where':{'id':_0x443a14['params']['id']}},_0x5b976f={};_0x5b976f[_0xa398('0x43')]=_[_0xa398('0x45')](db['OpenchannelMessage'][_0xa398('0x40')]);_0x5b976f['query']=_[_0xa398('0x45')](_0x443a14[_0xa398('0x44')]);_0x5b976f[_0xa398('0x4f')]=_['intersection'](_0x5b976f[_0xa398('0x43')],_0x5b976f['query']);_0x5e0124[_0xa398('0x47')]=_[_0xa398('0x46')](_0x5b976f[_0xa398('0x43')],qs[_0xa398('0x48')](_0x443a14['query']['fields']));_0x5e0124['attributes']=_0x5e0124[_0xa398('0x47')]['length']?_0x5e0124[_0xa398('0x47')]:_0x5b976f['model'];if(_0x443a14[_0xa398('0x44')][_0xa398('0x57')]){_0x5e0124[_0xa398('0x58')]=[{'all':!![]}];}_0x5e0124=_[_0xa398('0x51')]({},_0x5e0124,_0x443a14[_0xa398('0x59')]);return db[_0xa398('0x54')][_0xa398('0x5a')](_0x5e0124)['then'](handleEntityNotFound(_0x15b4a3,null))[_0xa398('0x25')](respondWithResult(_0x15b4a3,null))['catch'](handleError(_0x15b4a3,null));};exports[_0xa398('0x5b')]=function(_0x35f290,_0x14a23e){return db['OpenchannelMessage'][_0xa398('0x5b')](_0x35f290[_0xa398('0x5c')],{})[_0xa398('0x25')](respondWithResult(_0x14a23e,0xc9))['catch'](handleError(_0x14a23e,null));};exports['update']=function(_0x2266f8,_0x333ac8){if(_0x2266f8[_0xa398('0x5c')]['id']){delete _0x2266f8[_0xa398('0x5c')]['id'];}return db[_0xa398('0x54')]['find']({'where':{'id':_0x2266f8[_0xa398('0x5d')]['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x333ac8,null))[_0xa398('0x25')](saveUpdates(_0x2266f8[_0xa398('0x5c')],null))[_0xa398('0x25')](respondWithResult(_0x333ac8,null))['catch'](handleError(_0x333ac8,null));};exports[_0xa398('0x3a')]=function(_0x211b82,_0x9fad19){return db[_0xa398('0x54')][_0xa398('0x5a')]({'where':{'id':_0x211b82[_0xa398('0x5d')]['id']}})[_0xa398('0x25')](handleEntityNotFound(_0x9fad19,null))[_0xa398('0x25')](removeEntity(_0x9fad19,null))['catch'](handleError(_0x9fad19,null));};exports['describe']=function(_0x1130c7,_0x325430){return db[_0xa398('0x54')]['describe']()[_0xa398('0x25')](respondWithResult(_0x325430,null))[_0xa398('0x2d')](handleError(_0x325430,null));};var interaction_log=require(_0xa398('0x5e'))(_0xa398('0x5f'));exports[_0xa398('0x60')]=function(_0x39f87c,_0x4f348b,_0x151386){var _0x216309={'agent':{},'channel':'openchannel'};if(_0x39f87c[_0xa398('0x5c')]['id']){delete _0x39f87c['body']['id'];}_0x39f87c[_0xa398('0x5c')]['read']=!![];_0x39f87c['body']['readAt']=moment()[_0xa398('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x39f87c[_0xa398('0x5c')][_0xa398('0x62')]=_0x39f87c[_0xa398('0x5c')][_0xa398('0x62')]||_0x39f87c['user']['id'];_0x216309[_0xa398('0x63')]['id']=_0x39f87c[_0xa398('0x5c')][_0xa398('0x62')];return db[_0xa398('0x54')][_0xa398('0x5a')]({'where':{'id':_0x39f87c[_0xa398('0x5d')]['id'],'UserId':null}})[_0xa398('0x25')](handleEntityNotFound(_0x4f348b,null))[_0xa398('0x25')](saveUpdates(_0x39f87c[_0xa398('0x5c')],null))['then'](function(_0x2fc433){if(_0x2fc433){_0x216309[_0xa398('0x2b')]=_0x2fc433[_0xa398('0x64')]({'plain':!![]});return db[_0xa398('0x65')][_0xa398('0x5a')]({'where':{'id':_0x2fc433[_0xa398('0x66')]}});}return null;})[_0xa398('0x25')](handleEntityNotFound(_0x4f348b,null))[_0xa398('0x25')](function(_0x59d99c){if(_0x59d99c){return _0x59d99c[_0xa398('0x39')]({'UserId':_0x39f87c[_0xa398('0x5c')]['UserId'],'read1stAt':_[_0xa398('0x67')](_0x59d99c[_0xa398('0x68')])?moment()['format'](_0xa398('0x69')):undefined});}return null;})[_0xa398('0x25')](function(_0x3856a3){if(_0x3856a3){_0x216309['interaction']=_0x3856a3[_0xa398('0x64')]({'plain':!![]});interaction_log[_0xa398('0x26')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39f87c[_0xa398('0x6a')]['id'],_0x39f87c[_0xa398('0x6a')][_0xa398('0x3c')],_0x39f87c[_0xa398('0x6a')]['role'],_0x216309[_0xa398('0x6b')]['id'],_0x39f87c[_0xa398('0x5c')]?JSON[_0xa398('0x6c')](_0x39f87c['body']):_0xa398('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xa398('0x6e'),_0x216309);}return null;})['then'](function(_0x36b6ba){var _0x198ace='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x36b6ba[_0xa398('0x2b')]['ContactId'];return db[_0xa398('0x6f')][_0xa398('0x44')](_0x198ace,{'type':db['Sequelize'][_0xa398('0x70')][_0xa398('0x71')],'raw':!![]})[_0xa398('0x25')](function(_0x28ec5b){return _0x28ec5b;});})[_0xa398('0x25')](function(_0x594858){if(_0x594858){_0x216309[_0xa398('0x2b')][_0xa398('0x72')]=_0x594858[0x0];if(!_0x39f87c[_0xa398('0x5c')][_0xa398('0x62')])return;return db[_0xa398('0x73')][_0xa398('0x5a')]({'where':{'id':_0x39f87c['body']['UserId'],'role':_0xa398('0x63')},'attributes':['id',_0xa398('0x3c'),_0xa398('0x74'),'email',_0xa398('0x75')],'raw':!![]});}return null;})[_0xa398('0x25')](function(_0x108ce7){if(!_0x108ce7)return null;_0x216309[_0xa398('0x2b')][_0xa398('0x63')]=_0x108ce7;return _0x216309;})[_0xa398('0x25')](function(_0x48e588){if(_0x48e588){if(_0x39f87c[_0xa398('0x5c')]['manual']){_0x216309[_0xa398('0x2b')][_0xa398('0x76')]=util[_0xa398('0x61')](_0xa398('0x77'),_0x39f87c[_0xa398('0x6a')][_0xa398('0x3c')]);_0x216309[_0xa398('0x2b')][_0xa398('0x78')]=_0x216309['channel'];_0x216309[_0xa398('0x2b')][_0xa398('0x79')]=_0x216309[_0xa398('0x78')];_0x216309[_0xa398('0x2b')][_0xa398('0x7a')]=_0xa398('0x60');return respondWithRpcPromise(_0xa398('0x7b'),_0xa398('0x7b'),{'event':'acceptmessage','message':_0x216309[_0xa398('0x2b')]},client9002)[_0xa398('0x25')](function(){return _0x216309;});}return _0x216309;}return null;})[_0xa398('0x25')](respondWithResult(_0x4f348b,null))[_0xa398('0x2d')](handleError(_0x4f348b,null));};var interaction_log=require('../../config/logger')(_0xa398('0x5f'));exports[_0xa398('0x37')]=function(_0x46a602,_0x4784e6,_0x355f6d){var _0x34aa97={'agent':{},'channel':'openchannel'};if(_0x46a602['body']['id']){delete _0x46a602[_0xa398('0x5c')]['id'];}_0x46a602[_0xa398('0x5c')]['UserId']=_0x46a602[_0xa398('0x5c')][_0xa398('0x62')]||_0x46a602['user']['id'];_0x34aa97[_0xa398('0x63')]['id']=_0x46a602['body'][_0xa398('0x62')];return db[_0xa398('0x54')][_0xa398('0x5a')]({'where':{'id':_0x46a602[_0xa398('0x5d')]['id'],'UserId':null}})[_0xa398('0x25')](handleEntityNotFound(_0x4784e6,null))['then'](function(_0x919dd1){if(_0x919dd1){_0x34aa97[_0xa398('0x2b')]=_0x919dd1[_0xa398('0x64')]({'plain':!![]});return db[_0xa398('0x65')][_0xa398('0x5a')]({'where':{'id':_0x919dd1[_0xa398('0x66')]}});}return null;})[_0xa398('0x25')](handleEntityNotFound(_0x4784e6,null))[_0xa398('0x25')](function(_0x57251f){if(_0x57251f){_0x34aa97['interaction']=_0x57251f[_0xa398('0x64')]({'plain':!![]});interaction_log['info'](_0xa398('0x7c'),_0x46a602[_0xa398('0x6a')]['id'],_0x46a602[_0xa398('0x6a')][_0xa398('0x3c')],_0x46a602[_0xa398('0x6a')][_0xa398('0x7d')],_0x34aa97['interaction']['id'],_0x46a602[_0xa398('0x5c')]?JSON[_0xa398('0x6c')](_0x46a602[_0xa398('0x5c')]):_0xa398('0x6d'));return respondWithRpcPromise(_0xa398('0x7e'),_0xa398('0x7f'),_0x34aa97);}return null;})[_0xa398('0x25')](function(_0x474856){var _0x3b0937=_0xa398('0x80')+_0x474856['message'][_0xa398('0x81')];return db[_0xa398('0x6f')][_0xa398('0x44')](_0x3b0937,{'type':db['Sequelize'][_0xa398('0x70')][_0xa398('0x71')],'raw':!![]})[_0xa398('0x25')](function(_0x2f0f74){return _0x2f0f74;});})['then'](function(_0x5f4bab){if(_0x5f4bab){_0x34aa97[_0xa398('0x2b')]['contact']=_0x5f4bab[0x0];if(!_0x46a602[_0xa398('0x5c')][_0xa398('0x62')])return;return db['User'][_0xa398('0x5a')]({'where':{'id':_0x46a602['body'][_0xa398('0x62')],'role':_0xa398('0x63')},'attributes':['id',_0xa398('0x3c'),_0xa398('0x74'),_0xa398('0x82'),_0xa398('0x75')],'raw':!![]});}return null;})['then'](function(_0x28d2e6){if(!_0x28d2e6)return null;_0x34aa97['message'][_0xa398('0x63')]=_0x28d2e6;return _0x34aa97;})[_0xa398('0x25')](function(_0x48af33){if(_0x48af33){_0x48af33[_0xa398('0x2b')][_0xa398('0x76')]=util[_0xa398('0x61')]('SIP/%s',_0x46a602[_0xa398('0x6a')][_0xa398('0x3c')]);_0x48af33['message'][_0xa398('0x78')]=_0x34aa97['channel'];_0x48af33[_0xa398('0x2b')][_0xa398('0x79')]=_0x34aa97[_0xa398('0x78')];_0x48af33[_0xa398('0x2b')][_0xa398('0x7a')]=_0xa398('0x37');respondWithRpcPromise(_0xa398('0x7b'),'EventManager',{'event':_0xa398('0x83'),'message':_0x48af33[_0xa398('0x2b')]},client9002);return _0x34aa97;}return null;})['then'](respondWithResult(_0x4784e6,null))[_0xa398('0x2d')](handleError(_0x4784e6,null));}; \ No newline at end of file +var _0x6f01=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','http','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelMessage,\x20%s,\x20%s','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','map','OpenchannelMessage','rawAttributes','fieldName','type','key','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','create','body','params','describe','openchannel-interactions','accept','openchannel','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT','contact','User','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x208577,_0x2124a2){var _0x510fca=function(_0x35741f){while(--_0x35741f){_0x208577['push'](_0x208577['shift']());}};_0x510fca(++_0x2124a2);}(_0x6f01,0x1ee));var _0x16f0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6f01[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x16f0('0x0'));var rimraf=require(_0x16f0('0x1'));var zipdir=require(_0x16f0('0x2'));var jsonpatch=require(_0x16f0('0x3'));var rp=require(_0x16f0('0x4'));var moment=require(_0x16f0('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x16f0('0x6'));var path=require('path');var sox=require(_0x16f0('0x7'));var csv=require(_0x16f0('0x8'));var ejs=require(_0x16f0('0x9'));var fs=require('fs');var fs_extra=require(_0x16f0('0xa'));var _=require(_0x16f0('0xb'));var squel=require('squel');var crypto=require(_0x16f0('0xc'));var jsforce=require(_0x16f0('0xd'));var deskjs=require(_0x16f0('0xe'));var toCsv=require(_0x16f0('0x8'));var querystring=require(_0x16f0('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x16f0('0x10'));var qs=require(_0x16f0('0x11'));var as=require(_0x16f0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f0('0x13'))('api');var utils=require(_0x16f0('0x14'));var config=require(_0x16f0('0x15'));var licenseUtil=require(_0x16f0('0x16'));var db=require(_0x16f0('0x17'))['db'];config[_0x16f0('0x18')]=_[_0x16f0('0x19')](config[_0x16f0('0x18')],{'host':_0x16f0('0x1a'),'port':0x18eb});var socket=require(_0x16f0('0x1b'))(new Redis(config['redis']));require(_0x16f0('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x16f0('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x16f0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x116f1e,_0x28a5e5,_0x43e280,_0x3ea738){return new BPromise(function(_0x481bd9,_0x4fbefd){var _0x3cf829=_0x3ea738||client;return _0x3cf829[_0x16f0('0x1e')](_0x116f1e,_0x43e280)['then'](function(_0x234316){logger[_0x16f0('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x28a5e5,_0x16f0('0x20'));logger[_0x16f0('0x21')](_0x16f0('0x22'),_0x28a5e5,_0x16f0('0x20'),JSON[_0x16f0('0x23')](_0x234316));if(_0x234316[_0x16f0('0x24')]){if(_0x234316[_0x16f0('0x24')][_0x16f0('0x25')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x28a5e5,_0x234316[_0x16f0('0x24')][_0x16f0('0x26')]);return _0x4fbefd(_0x234316[_0x16f0('0x24')]['message']);}logger[_0x16f0('0x24')](_0x16f0('0x27'),_0x28a5e5,_0x234316[_0x16f0('0x24')][_0x16f0('0x26')]);return _0x481bd9(_0x234316[_0x16f0('0x24')][_0x16f0('0x26')]);}else{logger[_0x16f0('0x1f')](_0x16f0('0x27'),_0x28a5e5,_0x16f0('0x20'));_0x481bd9(_0x234316['result'][_0x16f0('0x26')]);}})[_0x16f0('0x28')](function(_0x19fabb){logger[_0x16f0('0x24')](_0x16f0('0x27'),_0x28a5e5,_0x19fabb);_0x4fbefd(_0x19fabb);});});}function respondWithStatusCode(_0x1d812d,_0x5882aa){_0x5882aa=_0x5882aa||0xcc;return function(_0x5e0982){if(_0x5e0982){return _0x1d812d[_0x16f0('0x29')](_0x5882aa);}return _0x1d812d['status'](_0x5882aa)[_0x16f0('0x2a')]();};}function respondWithResult(_0x56e5a7,_0x4b913f){_0x4b913f=_0x4b913f||0xc8;return function(_0xfa6895){if(_0xfa6895){return _0x56e5a7[_0x16f0('0x2b')](_0x4b913f)[_0x16f0('0x2c')](_0xfa6895);}};}function respondWithFilteredResult(_0xf31043,_0x2cb343){return function(_0x245be0){if(_0x245be0){var _0x555e66=typeof _0x2cb343[_0x16f0('0x2d')]===_0x16f0('0x2e')&&typeof _0x2cb343[_0x16f0('0x2f')]===_0x16f0('0x2e');var _0x23362d=_0x245be0[_0x16f0('0x30')];var _0x59567c=_0x555e66?0x0:_0x2cb343[_0x16f0('0x2d')];var _0x573217=_0x555e66?_0x245be0['count']:_0x2cb343['offset']+_0x2cb343[_0x16f0('0x2f')];var _0xf2655;if(_0x573217>=_0x23362d){_0x573217=_0x23362d;_0xf2655=0xc8;}else{_0xf2655=0xce;}_0xf31043[_0x16f0('0x2b')](_0xf2655);return _0xf31043['set'](_0x16f0('0x31'),_0x59567c+'-'+_0x573217+'/'+_0x23362d)[_0x16f0('0x2c')](_0x245be0);}return null;};}function patchUpdates(_0x3717e1){return function(_0x3b144d){try{jsonpatch['apply'](_0x3b144d,_0x3717e1,!![]);}catch(_0x4eed06){return BPromise[_0x16f0('0x32')](_0x4eed06);}return _0x3b144d[_0x16f0('0x33')]();};}function saveUpdates(_0x7829e4,_0x5f365f){return function(_0xf601f2){if(_0xf601f2){return _0xf601f2[_0x16f0('0x34')](_0x7829e4)[_0x16f0('0x35')](function(_0x181019){return _0x181019;});}return null;};}function removeEntity(_0x3d6ef1,_0x429e31){return function(_0x2473b4){if(_0x2473b4){return _0x2473b4[_0x16f0('0x36')]()[_0x16f0('0x35')](function(){_0x3d6ef1[_0x16f0('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9547d5,_0x581453){return function(_0x3798c7){if(!_0x3798c7){_0x9547d5['sendStatus'](0x194);}return _0x3798c7;};}function handleError(_0x38cc1d,_0x6445c8){_0x6445c8=_0x6445c8||0x1f4;return function(_0x285fe7){logger[_0x16f0('0x24')](_0x285fe7[_0x16f0('0x37')]);if(_0x285fe7['name']){delete _0x285fe7[_0x16f0('0x38')];}_0x38cc1d['status'](_0x6445c8)['send'](_0x285fe7);};}exports['index']=function(_0x4bf7d5,_0x52a4c6){var _0x150e16={},_0x4377f4={},_0x26f366={'count':0x0,'rows':[]};var _0x117006=_[_0x16f0('0x39')](db[_0x16f0('0x3a')][_0x16f0('0x3b')],function(_0x1e8563){return{'name':_0x1e8563[_0x16f0('0x3c')],'type':_0x1e8563[_0x16f0('0x3d')][_0x16f0('0x3e')]};});_0x4377f4['model']=_[_0x16f0('0x39')](_0x117006,_0x16f0('0x38'));_0x4377f4[_0x16f0('0x3f')]=_['keys'](_0x4bf7d5[_0x16f0('0x3f')]);_0x4377f4['filters']=_[_0x16f0('0x40')](_0x4377f4['model'],_0x4377f4[_0x16f0('0x3f')]);_0x150e16['attributes']=_['intersection'](_0x4377f4[_0x16f0('0x41')],qs[_0x16f0('0x42')](_0x4bf7d5[_0x16f0('0x3f')][_0x16f0('0x42')]));_0x150e16[_0x16f0('0x43')]=_0x150e16[_0x16f0('0x43')][_0x16f0('0x44')]?_0x150e16[_0x16f0('0x43')]:_0x4377f4[_0x16f0('0x41')];if(!_0x4bf7d5['query']['hasOwnProperty'](_0x16f0('0x45'))){_0x150e16['limit']=qs[_0x16f0('0x2f')](_0x4bf7d5[_0x16f0('0x3f')][_0x16f0('0x2f')]);_0x150e16['offset']=qs['offset'](_0x4bf7d5[_0x16f0('0x3f')][_0x16f0('0x2d')]);}_0x150e16[_0x16f0('0x46')]=qs['sort'](_0x4bf7d5['query'][_0x16f0('0x47')]);_0x150e16[_0x16f0('0x48')]=qs[_0x16f0('0x49')](_[_0x16f0('0x4a')](_0x4bf7d5[_0x16f0('0x3f')],_0x4377f4[_0x16f0('0x49')]),_0x117006);if(_0x4bf7d5[_0x16f0('0x3f')][_0x16f0('0x4b')]){_0x150e16[_0x16f0('0x48')]=_[_0x16f0('0x4c')](_0x150e16[_0x16f0('0x48')],{'$or':_[_0x16f0('0x39')](_0x117006,function(_0x512b02){if(_0x512b02[_0x16f0('0x3d')]!==_0x16f0('0x4d')){var _0x7fdc1={};_0x7fdc1[_0x512b02['name']]={'$like':'%'+_0x4bf7d5[_0x16f0('0x3f')][_0x16f0('0x4b')]+'%'};return _0x7fdc1;}})});}_0x150e16=_[_0x16f0('0x4c')]({},_0x150e16,_0x4bf7d5[_0x16f0('0x4e')]);var _0x1e0c89={'where':_0x150e16[_0x16f0('0x48')]};return db[_0x16f0('0x3a')]['count'](_0x1e0c89)[_0x16f0('0x35')](function(_0x39e23d){_0x26f366[_0x16f0('0x30')]=_0x39e23d;if(_0x4bf7d5[_0x16f0('0x3f')][_0x16f0('0x4f')]){_0x150e16[_0x16f0('0x50')]=[{'all':!![]}];}return db[_0x16f0('0x3a')]['findAll'](_0x150e16);})[_0x16f0('0x35')](function(_0x48cebf){_0x26f366[_0x16f0('0x51')]=_0x48cebf;return _0x26f366;})[_0x16f0('0x35')](respondWithFilteredResult(_0x52a4c6,_0x150e16))['catch'](handleError(_0x52a4c6,null));};exports[_0x16f0('0x52')]=function(_0x3fe489,_0x19d34e){var _0x4ce64d={'raw':!![],'where':{'id':_0x3fe489['params']['id']}},_0x1bd581={};_0x1bd581[_0x16f0('0x41')]=_[_0x16f0('0x53')](db[_0x16f0('0x3a')][_0x16f0('0x3b')]);_0x1bd581[_0x16f0('0x3f')]=_[_0x16f0('0x53')](_0x3fe489[_0x16f0('0x3f')]);_0x1bd581[_0x16f0('0x49')]=_[_0x16f0('0x40')](_0x1bd581['model'],_0x1bd581[_0x16f0('0x3f')]);_0x4ce64d['attributes']=_[_0x16f0('0x40')](_0x1bd581['model'],qs['fields'](_0x3fe489[_0x16f0('0x3f')][_0x16f0('0x42')]));_0x4ce64d['attributes']=_0x4ce64d[_0x16f0('0x43')][_0x16f0('0x44')]?_0x4ce64d[_0x16f0('0x43')]:_0x1bd581[_0x16f0('0x41')];if(_0x3fe489['query']['includeAll']){_0x4ce64d[_0x16f0('0x50')]=[{'all':!![]}];}_0x4ce64d=_['merge']({},_0x4ce64d,_0x3fe489[_0x16f0('0x4e')]);return db[_0x16f0('0x3a')][_0x16f0('0x54')](_0x4ce64d)[_0x16f0('0x35')](handleEntityNotFound(_0x19d34e,null))['then'](respondWithResult(_0x19d34e,null))[_0x16f0('0x28')](handleError(_0x19d34e,null));};exports['create']=function(_0x32d09a,_0x1ab548){return db[_0x16f0('0x3a')][_0x16f0('0x55')](_0x32d09a[_0x16f0('0x56')],{})[_0x16f0('0x35')](respondWithResult(_0x1ab548,0xc9))[_0x16f0('0x28')](handleError(_0x1ab548,null));};exports[_0x16f0('0x34')]=function(_0x20f63d,_0x28d95b){if(_0x20f63d[_0x16f0('0x56')]['id']){delete _0x20f63d[_0x16f0('0x56')]['id'];}return db[_0x16f0('0x3a')][_0x16f0('0x54')]({'where':{'id':_0x20f63d['params']['id']}})[_0x16f0('0x35')](handleEntityNotFound(_0x28d95b,null))[_0x16f0('0x35')](saveUpdates(_0x20f63d[_0x16f0('0x56')],null))[_0x16f0('0x35')](respondWithResult(_0x28d95b,null))[_0x16f0('0x28')](handleError(_0x28d95b,null));};exports[_0x16f0('0x36')]=function(_0x2fea0e,_0x1ebe75){return db[_0x16f0('0x3a')][_0x16f0('0x54')]({'where':{'id':_0x2fea0e[_0x16f0('0x57')]['id']}})[_0x16f0('0x35')](handleEntityNotFound(_0x1ebe75,null))[_0x16f0('0x35')](removeEntity(_0x1ebe75,null))[_0x16f0('0x28')](handleError(_0x1ebe75,null));};exports[_0x16f0('0x58')]=function(_0x5c50e9,_0x424001){return db['OpenchannelMessage'][_0x16f0('0x58')]()[_0x16f0('0x35')](respondWithResult(_0x424001,null))[_0x16f0('0x28')](handleError(_0x424001,null));};var interaction_log=require(_0x16f0('0x13'))(_0x16f0('0x59'));exports[_0x16f0('0x5a')]=function(_0x13a0c3,_0x1b7418,_0xbe444d){var _0x4cdbf4={'agent':{},'channel':_0x16f0('0x5b')};if(_0x13a0c3['body']['id']){delete _0x13a0c3[_0x16f0('0x56')]['id'];}_0x13a0c3[_0x16f0('0x56')]['read']=!![];_0x13a0c3[_0x16f0('0x56')]['readAt']=moment()['format'](_0x16f0('0x5c'));_0x13a0c3['body'][_0x16f0('0x5d')]=_0x13a0c3[_0x16f0('0x56')][_0x16f0('0x5d')]||_0x13a0c3[_0x16f0('0x5e')]['id'];_0x4cdbf4['agent']['id']=_0x13a0c3[_0x16f0('0x56')][_0x16f0('0x5d')];return db['OpenchannelMessage']['find']({'where':{'id':_0x13a0c3[_0x16f0('0x57')]['id'],'UserId':null}})[_0x16f0('0x35')](handleEntityNotFound(_0x1b7418,null))[_0x16f0('0x35')](saveUpdates(_0x13a0c3[_0x16f0('0x56')],null))[_0x16f0('0x35')](function(_0x58ff96){if(_0x58ff96){_0x4cdbf4['message']=_0x58ff96[_0x16f0('0x5f')]({'plain':!![]});return db[_0x16f0('0x60')][_0x16f0('0x54')]({'where':{'id':_0x58ff96[_0x16f0('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x1b7418,null))[_0x16f0('0x35')](function(_0xf5f22a){if(_0xf5f22a){return _0xf5f22a['update']({'UserId':_0x13a0c3[_0x16f0('0x56')][_0x16f0('0x5d')],'read1stAt':_[_0x16f0('0x62')](_0xf5f22a[_0x16f0('0x63')])?moment()[_0x16f0('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x16f0('0x35')](function(_0x25ea66){if(_0x25ea66){_0x4cdbf4[_0x16f0('0x65')]=_0x25ea66[_0x16f0('0x5f')]({'plain':!![]});interaction_log[_0x16f0('0x1f')](_0x16f0('0x66'),_0x13a0c3[_0x16f0('0x5e')]['id'],_0x13a0c3['user'][_0x16f0('0x38')],_0x13a0c3['user'][_0x16f0('0x67')],_0x4cdbf4['interaction']['id'],_0x13a0c3['body']?JSON[_0x16f0('0x23')](_0x13a0c3['body']):'null');return respondWithRpcPromise(_0x16f0('0x68'),_0x16f0('0x69'),_0x4cdbf4);}return null;})['then'](function(_0x2b8758){var _0x3f6869='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b8758['message'][_0x16f0('0x6a')];return db[_0x16f0('0x6b')]['query'](_0x3f6869,{'type':db[_0x16f0('0x6c')][_0x16f0('0x6d')]['SELECT'],'raw':!![]})[_0x16f0('0x35')](function(_0x241032){return _0x241032;});})[_0x16f0('0x35')](function(_0xa598ec){if(_0xa598ec){_0x4cdbf4[_0x16f0('0x26')]['contact']=_0xa598ec[0x0];if(!_0x13a0c3['body'][_0x16f0('0x5d')])return;return db['User']['find']({'where':{'id':_0x13a0c3[_0x16f0('0x56')][_0x16f0('0x5d')],'role':_0x16f0('0x6e')},'attributes':['id',_0x16f0('0x38'),_0x16f0('0x6f'),_0x16f0('0x70'),_0x16f0('0x71')],'raw':!![]});}return null;})[_0x16f0('0x35')](function(_0x2bfc07){if(!_0x2bfc07)return null;_0x4cdbf4['message'][_0x16f0('0x6e')]=_0x2bfc07;return _0x4cdbf4;})[_0x16f0('0x35')](function(_0x1e07e1){if(_0x1e07e1){if(_0x13a0c3['body'][_0x16f0('0x72')]){_0x4cdbf4[_0x16f0('0x26')][_0x16f0('0x73')]=util[_0x16f0('0x64')](_0x16f0('0x74'),_0x13a0c3[_0x16f0('0x5e')][_0x16f0('0x38')]);_0x4cdbf4[_0x16f0('0x26')][_0x16f0('0x75')]=_0x4cdbf4['channel'];_0x4cdbf4[_0x16f0('0x26')][_0x16f0('0x76')]=_0x4cdbf4['channel'];_0x4cdbf4[_0x16f0('0x26')][_0x16f0('0x77')]=_0x16f0('0x5a');return respondWithRpcPromise('EventManager',_0x16f0('0x78'),{'event':'acceptmessage','message':_0x4cdbf4[_0x16f0('0x26')]},client9002)[_0x16f0('0x35')](function(){return _0x4cdbf4;});}return _0x4cdbf4;}return null;})[_0x16f0('0x35')](respondWithResult(_0x1b7418,null))[_0x16f0('0x28')](handleError(_0x1b7418,null));};var interaction_log=require(_0x16f0('0x13'))(_0x16f0('0x59'));exports[_0x16f0('0x32')]=function(_0x3fb935,_0x52d98f,_0x538c81){var _0xa8c777={'agent':{},'channel':_0x16f0('0x5b')};if(_0x3fb935[_0x16f0('0x56')]['id']){delete _0x3fb935[_0x16f0('0x56')]['id'];}_0x3fb935['body']['UserId']=_0x3fb935[_0x16f0('0x56')][_0x16f0('0x5d')]||_0x3fb935[_0x16f0('0x5e')]['id'];_0xa8c777[_0x16f0('0x6e')]['id']=_0x3fb935[_0x16f0('0x56')][_0x16f0('0x5d')];return db[_0x16f0('0x3a')][_0x16f0('0x54')]({'where':{'id':_0x3fb935[_0x16f0('0x57')]['id'],'UserId':null}})[_0x16f0('0x35')](handleEntityNotFound(_0x52d98f,null))[_0x16f0('0x35')](function(_0x288639){if(_0x288639){_0xa8c777['message']=_0x288639[_0x16f0('0x5f')]({'plain':!![]});return db[_0x16f0('0x60')]['find']({'where':{'id':_0x288639[_0x16f0('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x52d98f,null))[_0x16f0('0x35')](function(_0x2a5f9b){if(_0x2a5f9b){_0xa8c777['interaction']=_0x2a5f9b[_0x16f0('0x5f')]({'plain':!![]});interaction_log[_0x16f0('0x1f')](_0x16f0('0x79'),_0x3fb935[_0x16f0('0x5e')]['id'],_0x3fb935[_0x16f0('0x5e')][_0x16f0('0x38')],_0x3fb935[_0x16f0('0x5e')][_0x16f0('0x67')],_0xa8c777[_0x16f0('0x65')]['id'],_0x3fb935[_0x16f0('0x56')]?JSON[_0x16f0('0x23')](_0x3fb935[_0x16f0('0x56')]):_0x16f0('0x7a'));return respondWithRpcPromise(_0x16f0('0x7b'),'rejectMessage',_0xa8c777);}return null;})[_0x16f0('0x35')](function(_0x2ac966){var _0x11d3fc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ac966['message'][_0x16f0('0x6a')];return db[_0x16f0('0x6b')][_0x16f0('0x3f')](_0x11d3fc,{'type':db[_0x16f0('0x6c')][_0x16f0('0x6d')][_0x16f0('0x7c')],'raw':!![]})['then'](function(_0x1f4e01){return _0x1f4e01;});})[_0x16f0('0x35')](function(_0x5cbf74){if(_0x5cbf74){_0xa8c777[_0x16f0('0x26')][_0x16f0('0x7d')]=_0x5cbf74[0x0];if(!_0x3fb935['body'][_0x16f0('0x5d')])return;return db[_0x16f0('0x7e')]['find']({'where':{'id':_0x3fb935['body'][_0x16f0('0x5d')],'role':_0x16f0('0x6e')},'attributes':['id',_0x16f0('0x38'),_0x16f0('0x6f'),'email',_0x16f0('0x71')],'raw':!![]});}return null;})[_0x16f0('0x35')](function(_0x10c314){if(!_0x10c314)return null;_0xa8c777[_0x16f0('0x26')][_0x16f0('0x6e')]=_0x10c314;return _0xa8c777;})[_0x16f0('0x35')](function(_0x5938d2){if(_0x5938d2){_0x5938d2['message'][_0x16f0('0x73')]=util[_0x16f0('0x64')](_0x16f0('0x74'),_0x3fb935[_0x16f0('0x5e')][_0x16f0('0x38')]);_0x5938d2[_0x16f0('0x26')][_0x16f0('0x75')]=_0xa8c777['channel'];_0x5938d2[_0x16f0('0x26')][_0x16f0('0x76')]=_0xa8c777['channel'];_0x5938d2[_0x16f0('0x26')][_0x16f0('0x77')]='reject';respondWithRpcPromise(_0x16f0('0x78'),'EventManager',{'event':_0x16f0('0x7f'),'message':_0x5938d2['message']},client9002);return _0xa8c777;}return null;})[_0x16f0('0x35')](respondWithResult(_0x52d98f,null))[_0x16f0('0x28')](handleError(_0x52d98f,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c399bc3..44f1dec 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 _0xf345=['save','remove','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x16e103,_0x1568fd){var _0x37ce71=function(_0x297a83){while(--_0x297a83){_0x16e103['push'](_0x16e103['shift']());}};_0x37ce71(++_0x1568fd);}(_0xf345,0x17c));var _0x5f34=function(_0x4eb7f8,_0x3258ac){_0x4eb7f8=_0x4eb7f8-0x0;var _0x5bae1a=_0xf345[_0x4eb7f8];return _0x5bae1a;};'use strict';var EventEmitter=require(_0x5f34('0x0'));var OpenchannelMessage=require(_0x5f34('0x1'))['db'][_0x5f34('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5f34('0x3')](0x0);var events={'afterCreate':_0x5f34('0x4'),'afterUpdate':'update','afterDestroy':_0x5f34('0x5')};function emitEvent(_0xa74401){return function(_0x1aed45,_0x56b992,_0x1f6e8d){OpenchannelMessageEvents['emit'](_0xa74401+':'+_0x1aed45['id'],_0x1aed45);OpenchannelMessageEvents['emit'](_0xa74401,_0x1aed45);_0x1f6e8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x5f34('0x6')](e,emitEvent(event));}}module[_0x5f34('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xd2a7=['hook','exports','events','OpenchannelMessage','save','update','emit','hasOwnProperty'];(function(_0x6fe76f,_0x1e0e06){var _0x3adcf3=function(_0x206ca8){while(--_0x206ca8){_0x6fe76f['push'](_0x6fe76f['shift']());}};_0x3adcf3(++_0x1e0e06);}(_0xd2a7,0x1da));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x7d2a('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x7d2a('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7d2a('0x2'),'afterUpdate':_0x7d2a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x261a75){return function(_0x3a7074,_0x566339,_0x50dbd8){OpenchannelMessageEvents[_0x7d2a('0x4')](_0x261a75+':'+_0x3a7074['id'],_0x3a7074);OpenchannelMessageEvents[_0x7d2a('0x4')](_0x261a75,_0x3a7074);_0x50dbd8(null);};}for(var e in events){if(events[_0x7d2a('0x5')](e)){var event=events[e];OpenchannelMessage[_0x7d2a('0x6')](e,emitEvent(event));}}module[_0x7d2a('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a24694a..fe1b4c0 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 _0x955f=['openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','info','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','OpenchannelMessage'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x955f,0x1eb));var _0xf955=function(_0x4ebbf8,_0x5492c2){_0x4ebbf8=_0x4ebbf8-0x0;var _0x16dd20=_0x955f[_0x4ebbf8];return _0x16dd20;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf955('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('0x9'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xf955('0xa')],'type':_0xf955('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x168ffb,_0x38b190,_0x134c1b){var _0x421e4a=_0x2caff2[_0xf955('0xc')];var _0x4d213a=_0x168ffb[_0xf955('0xd')]({'plain':!![]});if(_0x4d213a['direction'][_0xf955('0xe')]()==='in'||_0x4d213a[_0xf955('0xf')][_0xf955('0xe')]()==='out'&&!_0x4d213a[_0xf955('0x10')]&&!_['isNil'](_0x4d213a[_0xf955('0x11')])){_0x421e4a['OpenchannelInteraction'][_0xf955('0x12')]({'where':{'id':_0x4d213a[_0xf955('0x13')]}})[_0xf955('0x14')](function(_0x109bc5){if(_0x109bc5){_0x109bc5[_0xf955('0x15')]({'lastMsgAt':_0x4d213a[_0xf955('0x16')],'lastMsgDirection':_0x4d213a[_0xf955('0xf')][_0xf955('0xe')]()});}})[_0xf955('0x17')](function(_0x24e75c){console['error'](_0x24e75c);});}if(_0x4d213a[_0xf955('0xf')]==='out'&&!_0x4d213a[_0xf955('0x10')]){var _0x3a814f;_0x421e4a[_0xf955('0x18')][_0xf955('0x19')]()['then'](function(_0x5ac6cb){return _0x421e4a[_0xf955('0x1a')][_0xf955('0x1b')]({'where':{'id':_0x4d213a[_0xf955('0x1c')]},'include':[{'model':_0x421e4a['OpenchannelInteraction'],'as':_0xf955('0x1d'),'where':{'id':_0x4d213a[_0xf955('0x13')]},'limit':0x1,'include':[{'model':_0x421e4a[_0xf955('0x18')],'as':_0xf955('0x1e'),'attributes':_[_0xf955('0x1f')](_0x5ac6cb)}]}]});})['then'](function(_0x17d86a){_0x3a814f=_0x17d86a[_0xf955('0xd')]({'plain':!![]});if(_0x3a814f&&_0x3a814f[_0xf955('0x20')]){logger['info'](_0xf955('0x21'),'afterCreate',util[_0xf955('0x22')](_0xf955('0x23'),_0x4d213a['id'],_0x3a814f[_0xf955('0x20')]));if(_0x3a814f[_0xf955('0x1d')]&&_0x3a814f[_0xf955('0x1d')]['length']){_0x4d213a[_0xf955('0x24')]=_[_0xf955('0x25')](_0x3a814f[_0xf955('0x1d')][0x0],_0xf955('0x1e'));_0x4d213a[_0xf955('0x1e')]=_0x3a814f[_0xf955('0x1d')][0x0][_0xf955('0x1e')];}var _0x38b190={'method':_0xf955('0x26'),'uri':encodeURI(_0x3a814f[_0xf955('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x38b190[_0xf955('0x27')]){case _0xf955('0x28'):_0x38b190['qs']=_0x4d213a;break;case _0xf955('0x26'):_0x38b190[_0xf955('0xa')]=_0x4d213a;break;}return rp(_0x38b190)[_0xf955('0x14')](function(_0x51f3ab){logger[_0xf955('0x29')](_0xf955('0x21'),_0xf955('0x2a'),util[_0xf955('0x22')](_0xf955('0x2b'),_0x4d213a['id'],_0x3a814f[_0xf955('0x20')]));if(_0x51f3ab['body'][_0xf955('0x2c')]&&_0x51f3ab[_0xf955('0xa')]['threadId']!=_0x4d213a[_0xf955('0x24')][_0xf955('0x2c')]){return _0x421e4a[_0xf955('0x2d')][_0xf955('0x15')]({'threadId':_0x51f3ab['body'][_0xf955('0x2c')]},{'logging':!![],'where':{'id':_0x4d213a['Interaction']['id']}});}else{return;}})[_0xf955('0x14')](function(){return _0x168ffb[_0xf955('0x15')]({'read':!![]});})[_0xf955('0x17')](function(_0x4069fe){logger[_0xf955('0x2e')](_0xf955('0x21'),_0xf955('0x2a'),util[_0xf955('0x2f')](_0x4069fe,{'showHidden':![],'depth':null}));_0x134c1b();});}else{_0x134c1b();}})['finally'](function(){_0x134c1b();});}else{_0x134c1b();}}},'charset':_0xf955('0x30'),'collate':_0xf955('0x31')});}; \ No newline at end of file +var _0xe511=['define','fti_openchannel_messages','body','models','get','toLowerCase','direction','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','POST','info','format','threadId','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports'];(function(_0x1b12df,_0x4cd117){var _0x4bbd92=function(_0x266858){while(--_0x266858){_0x1b12df['push'](_0x1b12df['shift']());}};_0x4bbd92(++_0x4cd117);}(_0xe511,0x16f));var _0x1e51=function(_0x55c99e,_0x46d478){_0x55c99e=_0x55c99e-0x0;var _0x5a89be=_0xe511[_0x55c99e];return _0x5a89be;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x1e51('0xa'),'fields':[_0x1e51('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49d359,_0x658941,_0x2712e0){var _0x29da1f=_0x480cca[_0x1e51('0xc')];var _0x4241a6=_0x49d359[_0x1e51('0xd')]({'plain':!![]});if(_0x4241a6['direction'][_0x1e51('0xe')]()==='in'||_0x4241a6[_0x1e51('0xf')][_0x1e51('0xe')]()===_0x1e51('0x10')&&!_0x4241a6[_0x1e51('0x11')]&&!_[_0x1e51('0x12')](_0x4241a6['UserId'])){_0x29da1f[_0x1e51('0x13')][_0x1e51('0x14')]({'where':{'id':_0x4241a6[_0x1e51('0x15')]}})[_0x1e51('0x16')](function(_0x21bcbd){if(_0x21bcbd){_0x21bcbd[_0x1e51('0x17')]({'lastMsgAt':_0x4241a6[_0x1e51('0x18')],'lastMsgDirection':_0x4241a6[_0x1e51('0xf')][_0x1e51('0xe')]()});}})[_0x1e51('0x19')](function(_0x5a5c07){console[_0x1e51('0x1a')](_0x5a5c07);});}if(_0x4241a6[_0x1e51('0xf')]===_0x1e51('0x10')&&!_0x4241a6['secret']){var _0xa3b410;_0x29da1f['CmContact']['describe']()[_0x1e51('0x16')](function(_0x27dcad){return _0x29da1f[_0x1e51('0x1b')][_0x1e51('0x1c')]({'where':{'id':_0x4241a6[_0x1e51('0x1d')]},'include':[{'model':_0x29da1f[_0x1e51('0x13')],'as':'Interactions','where':{'id':_0x4241a6[_0x1e51('0x15')]},'limit':0x1,'include':[{'model':_0x29da1f['CmContact'],'as':_0x1e51('0x1e'),'attributes':_[_0x1e51('0x1f')](_0x27dcad)}]}]});})[_0x1e51('0x16')](function(_0x183a95){_0xa3b410=_0x183a95['get']({'plain':!![]});if(_0xa3b410&&_0xa3b410['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x1e51('0x20'),util['format'](_0x1e51('0x21'),_0x4241a6['id'],_0xa3b410[_0x1e51('0x22')]));if(_0xa3b410[_0x1e51('0x23')]&&_0xa3b410[_0x1e51('0x23')][_0x1e51('0x24')]){_0x4241a6[_0x1e51('0x25')]=_[_0x1e51('0x26')](_0xa3b410[_0x1e51('0x23')][0x0],'Contact');_0x4241a6['Contact']=_0xa3b410[_0x1e51('0x23')][0x0][_0x1e51('0x1e')];}var _0x658941={'method':_0x1e51('0x27'),'uri':encodeURI(_0xa3b410['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x658941['method']){case'GET':_0x658941['qs']=_0x4241a6;break;case _0x1e51('0x27'):_0x658941[_0x1e51('0xb')]=_0x4241a6;break;}return rp(_0x658941)[_0x1e51('0x16')](function(_0x5412bc){logger[_0x1e51('0x28')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x1e51('0x29')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4241a6['id'],_0xa3b410[_0x1e51('0x22')]));if(_0x5412bc[_0x1e51('0xb')]['threadId']&&_0x5412bc[_0x1e51('0xb')][_0x1e51('0x2a')]!=_0x4241a6[_0x1e51('0x25')][_0x1e51('0x2a')]){return _0x29da1f['OpenchannelInteraction']['update']({'threadId':_0x5412bc['body'][_0x1e51('0x2a')]},{'logging':!![],'where':{'id':_0x4241a6[_0x1e51('0x25')]['id']}});}else{return;}})[_0x1e51('0x16')](function(){return _0x49d359[_0x1e51('0x17')]({'read':!![]});})[_0x1e51('0x19')](function(_0x27d9a2){logger[_0x1e51('0x1a')](_0x1e51('0x2b'),_0x1e51('0x20'),util[_0x1e51('0x2c')](_0x27d9a2,{'showHidden':![],'depth':null}));_0x2712e0();});}else{_0x2712e0();}})[_0x1e51('0x2d')](function(){_0x2712e0();});}else{_0x2712e0();}}},'charset':'utf8mb4','collate':_0x1e51('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 96bc586..fcd49cd 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x2c6361,_0x52478e){var _0x56a642=function(_0x34d0f4){while(--_0x34d0f4){_0x2c6361['push'](_0x2c6361['shift']());}};_0x56a642(++_0x52478e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x102243,_0x2b4dde){_0x102243=_0x102243-0x0;var _0x1d302c=_0x0b0e[_0x102243];return _0x1d302c;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _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(_0x4caa7e,_0x4c6d7a){var _0x513c70=function(_0x25217a){while(--_0x25217a){_0x4caa7e['push'](_0x4caa7e['shift']());}};_0x513c70(++_0x4c6d7a);}(_0x1261,0x144));var _0x1126=function(_0x33c70e,_0xd8cb0b){_0x33c70e=_0x33c70e-0x0;var _0x5a33e5=_0x1261[_0x33c70e];return _0x5a33e5;};'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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1adb73f..5c8cdc1 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 _0x4828=['./openchannelMessage.events','save','remove','update','removeListener','length','openchannelMessage:'];(function(_0x53b8c0,_0x20d60e){var _0x57cd=function(_0x413d1e){while(--_0x413d1e){_0x53b8c0['push'](_0x53b8c0['shift']());}};_0x57cd(++_0x20d60e);}(_0x4828,0x93));var _0x8482=function(_0x137230,_0x23ffb8){_0x137230=_0x137230-0x0;var _0x598476=_0x4828[_0x137230];return _0x598476;};'use strict';var OpenchannelMessageEvents=require(_0x8482('0x0'));var events=[_0x8482('0x1'),_0x8482('0x2'),_0x8482('0x3')];function createListener(_0x5a8318,_0xa5c5a7){return function(_0x31be2b){_0xa5c5a7['emit'](_0x5a8318,_0x31be2b);};}function removeListener(_0x1f716b,_0x3d8c78){return function(){OpenchannelMessageEvents[_0x8482('0x4')](_0x1f716b,_0x3d8c78);};}exports['register']=function(_0x5604ce){for(var _0x484001=0x0,_0x14914c=events[_0x8482('0x5')];_0x484001<_0x14914c;_0x484001++){var _0x1556fc=events[_0x484001];var _0x4a84e3=createListener(_0x8482('0x6')+_0x1556fc,_0x5604ce);OpenchannelMessageEvents['on'](_0x1556fc,_0x4a84e3);}}; \ No newline at end of file +var _0x9ee9=['length','openchannelMessage:','./openchannelMessage.events','remove','emit','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ee9,0x144));var _0x99ee=function(_0x1c0b66,_0x4be6ed){_0x1c0b66=_0x1c0b66-0x0;var _0x546190=_0x9ee9[_0x1c0b66];return _0x546190;};'use strict';var OpenchannelMessageEvents=require(_0x99ee('0x0'));var events=['save',_0x99ee('0x1'),'update'];function createListener(_0x18f498,_0x4f50c1){return function(_0x1ced89){_0x4f50c1[_0x99ee('0x2')](_0x18f498,_0x1ced89);};}function removeListener(_0x43522d,_0xf11ce8){return function(){OpenchannelMessageEvents[_0x99ee('0x3')](_0x43522d,_0xf11ce8);};}exports[_0x99ee('0x4')]=function(_0x4c3543){for(var _0x35ba6e=0x0,_0x1ec306=events[_0x99ee('0x5')];_0x35ba6e<_0x1ec306;_0x35ba6e++){var _0x752e9b=events[_0x35ba6e];var _0x439db4=createListener(_0x99ee('0x6')+_0x752e9b,_0x4c3543);OpenchannelMessageEvents['on'](_0x752e9b,_0x439db4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index fddc814..1f13eac 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 _0xef8f=['get','isAuthenticated','index','describe','/:id/members','getMembers','/:id/users','/:id/teams','post','update','destroy','removeTeams','delete','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2e6247,_0x3b99a7){var _0x7b48de=function(_0x2e76dc){while(--_0x2e76dc){_0x2e6247['push'](_0x2e6247['shift']());}};_0x7b48de(++_0x3b99a7);}(_0xef8f,0x196));var _0xfef8=function(_0x52b37a,_0x100dee){_0x52b37a=_0x52b37a-0x0;var _0x2c1790=_0xef8f[_0x52b37a];return _0x2c1790;};'use strict';var multer=require('multer');var util=require(_0xfef8('0x0'));var path=require(_0xfef8('0x1'));var timeout=require(_0xfef8('0x2'));var express=require(_0xfef8('0x3'));var router=express[_0xfef8('0x4')]();var fs_extra=require(_0xfef8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfef8('0x6'));var config=require(_0xfef8('0x7'));var controller=require('./openchannelQueue.controller');router[_0xfef8('0x8')]('/',auth[_0xfef8('0x9')](),controller[_0xfef8('0xa')]);router[_0xfef8('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xfef8('0xb')]);router[_0xfef8('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfef8('0x8')](_0xfef8('0xc'),auth[_0xfef8('0x9')](),controller[_0xfef8('0xd')]);router[_0xfef8('0x8')]('/:id/teams',auth[_0xfef8('0x9')](),controller['getTeams']);router[_0xfef8('0x8')](_0xfef8('0xe'),auth[_0xfef8('0x9')](),controller['getAgents']);router['post']('/',auth[_0xfef8('0x9')](),controller['create']);router['post'](_0xfef8('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0xfef8('0x10')](_0xfef8('0xe'),auth[_0xfef8('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0xfef8('0x9')](),controller[_0xfef8('0x11')]);router['delete']('/:id',auth[_0xfef8('0x9')](),controller[_0xfef8('0x12')]);router['delete'](_0xfef8('0xf'),auth['isAuthenticated'](),controller[_0xfef8('0x13')]);router[_0xfef8('0x14')](_0xfef8('0xe'),auth[_0xfef8('0x9')](),controller[_0xfef8('0x15')]);module[_0xfef8('0x16')]=router; \ No newline at end of file +var _0xcea2=['/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams'];(function(_0x476eb0,_0x566531){var _0xcabb82=function(_0x4576d8){while(--_0x4576d8){_0x476eb0['push'](_0x476eb0['shift']());}};_0xcabb82(++_0x566531);}(_0xcea2,0x1dc));var _0x2cea=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcea2[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x2cea('0x0'));var util=require(_0x2cea('0x1'));var path=require(_0x2cea('0x2'));var timeout=require(_0x2cea('0x3'));var express=require(_0x2cea('0x4'));var router=express[_0x2cea('0x5')]();var fs_extra=require(_0x2cea('0x6'));var auth=require(_0x2cea('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2cea('0x8'));var controller=require(_0x2cea('0x9'));router['get']('/',auth[_0x2cea('0xa')](),controller[_0x2cea('0xb')]);router[_0x2cea('0xc')](_0x2cea('0xd'),auth['isAuthenticated'](),controller[_0x2cea('0xe')]);router['get'](_0x2cea('0xf'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x10')]);router[_0x2cea('0xc')](_0x2cea('0x11'),auth[_0x2cea('0xa')](),controller['getMembers']);router[_0x2cea('0xc')](_0x2cea('0x12'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x13')]);router[_0x2cea('0xc')](_0x2cea('0x14'),auth[_0x2cea('0xa')](),controller['getAgents']);router[_0x2cea('0x15')]('/',auth[_0x2cea('0xa')](),controller[_0x2cea('0x16')]);router['post'](_0x2cea('0x12'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x17')]);router[_0x2cea('0x15')](_0x2cea('0x14'),auth['isAuthenticated'](),controller[_0x2cea('0x18')]);router[_0x2cea('0x19')](_0x2cea('0xf'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x1a')]);router[_0x2cea('0x1b')](_0x2cea('0xf'),auth['isAuthenticated'](),controller[_0x2cea('0x1c')]);router['delete'](_0x2cea('0x12'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x1d')]);router[_0x2cea('0x1b')](_0x2cea('0x14'),auth[_0x2cea('0xa')](),controller[_0x2cea('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index c7d0468..6e83621 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 _0x4b1b=['STRING','name','beepall','roundrobin','sequelize'];(function(_0x30121a,_0x5f4919){var _0x3c27ad=function(_0x42ebe2){while(--_0x42ebe2){_0x30121a['push'](_0x30121a['shift']());}};_0x3c27ad(++_0x5f4919);}(_0x4b1b,0x15d));var _0xb4b1=function(_0x28182e,_0x5ecd40){_0x28182e=_0x28182e-0x0;var _0x48aec3=_0x4b1b[_0x28182e];return _0x48aec3;};'use strict';var Sequelize=require(_0xb4b1('0x0'));module['exports']={'name':{'type':Sequelize[_0xb4b1('0x1')],'unique':_0xb4b1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb4b1('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xb4b1('0x3'),_0xb4b1('0x4'))}}; \ No newline at end of file +var _0xddf5=['roundrobin','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x2d75b5,_0x4f2d0b){var _0x2a4fc1=function(_0x1375d4){while(--_0x1375d4){_0x2d75b5['push'](_0x2d75b5['shift']());}};_0x2a4fc1(++_0x4f2d0b);}(_0xddf5,0x86));var _0x5ddf=function(_0x16e361,_0x4227ea){_0x16e361=_0x16e361-0x0;var _0xfb94c4=_0xddf5[_0x16e361];return _0xfb94c4;};'use strict';var Sequelize=require(_0x5ddf('0x0'));module[_0x5ddf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5ddf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5ddf('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5ddf('0x4')](_0x5ddf('0x5'),'beepall',_0x5ddf('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0d4fba3..a9f5b73 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 _0x48b3=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','set','save','then','destroy','get','OpenchannelQueues','end','error','stack','name','index','rawAttributes','fieldName','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','limit','sort','where','merge','VIRTUAL','filter','options','OpenchannelQueue','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','order','ids','findAll','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','select','tq.TeamId','from','team_has_openchannel_queues','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash'];(function(_0x12da50,_0x4eab81){var _0x4159b0=function(_0x33e16d){while(--_0x33e16d){_0x12da50['push'](_0x12da50['shift']());}};_0x4159b0(++_0x4eab81);}(_0x48b3,0x10e));var _0x348b=function(_0x8f6fd9,_0x433a74){_0x8f6fd9=_0x8f6fd9-0x0;var _0x3d5784=_0x48b3[_0x8f6fd9];return _0x3d5784;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x348b('0x0'));var zipdir=require(_0x348b('0x1'));var jsonpatch=require(_0x348b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x348b('0x3'));var Mustache=require('mustache');var util=require(_0x348b('0x4'));var path=require(_0x348b('0x5'));var sox=require(_0x348b('0x6'));var csv=require('to-csv');var ejs=require(_0x348b('0x7'));var fs=require('fs');var fs_extra=require(_0x348b('0x8'));var _=require(_0x348b('0x9'));var squel=require(_0x348b('0xa'));var crypto=require(_0x348b('0xb'));var jsforce=require(_0x348b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x348b('0xd'));var querystring=require(_0x348b('0xe'));var Papa=require(_0x348b('0xf'));var Redis=require(_0x348b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x348b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x348b('0x12'))('api');var utils=require(_0x348b('0x13'));var config=require(_0x348b('0x14'));var licenseUtil=require(_0x348b('0x15'));var db=require(_0x348b('0x16'))['db'];config[_0x348b('0x17')]=_[_0x348b('0x18')](config[_0x348b('0x17')],{'host':_0x348b('0x19'),'port':0x18eb});var socket=require(_0x348b('0x1a'))(new Redis(config[_0x348b('0x17')]));require('./openchannelQueue.socket')[_0x348b('0x1b')](socket);function respondWithStatusCode(_0x5d3c18,_0x4af92f){_0x4af92f=_0x4af92f||0xcc;return function(_0x2ae3d9){if(_0x2ae3d9){return _0x5d3c18[_0x348b('0x1c')](_0x4af92f);}return _0x5d3c18[_0x348b('0x1d')](_0x4af92f)['end']();};}function respondWithResult(_0x22402d,_0x56e500){_0x56e500=_0x56e500||0xc8;return function(_0x4cbdee){if(_0x4cbdee){return _0x22402d['status'](_0x56e500)[_0x348b('0x1e')](_0x4cbdee);}};}function respondWithFilteredResult(_0xdec655,_0x3742f2){return function(_0x2fecf4){if(_0x2fecf4){var _0x324830=typeof _0x3742f2['offset']==='undefined'&&typeof _0x3742f2['limit']===_0x348b('0x1f');var _0x280749=_0x2fecf4[_0x348b('0x20')];var _0x4eee1a=_0x324830?0x0:_0x3742f2[_0x348b('0x21')];var _0x54f41b=_0x324830?_0x2fecf4[_0x348b('0x20')]:_0x3742f2[_0x348b('0x21')]+_0x3742f2['limit'];var _0xbd14af;if(_0x54f41b>=_0x280749){_0x54f41b=_0x280749;_0xbd14af=0xc8;}else{_0xbd14af=0xce;}_0xdec655['status'](_0xbd14af);return _0xdec655[_0x348b('0x22')]('Content-Range',_0x4eee1a+'-'+_0x54f41b+'/'+_0x280749)[_0x348b('0x1e')](_0x2fecf4);}return null;};}function patchUpdates(_0x36aa18){return function(_0x163f9b){try{jsonpatch['apply'](_0x163f9b,_0x36aa18,!![]);}catch(_0x217d02){return BPromise['reject'](_0x217d02);}return _0x163f9b[_0x348b('0x23')]();};}function saveUpdates(_0x3be747,_0x1b79cf){return function(_0x8c0507){if(_0x8c0507){return _0x8c0507['update'](_0x3be747)[_0x348b('0x24')](function(_0x53b9c2){return _0x53b9c2;});}return null;};}function removeEntity(_0xd4ac1a,_0x634d22){return function(_0x542a14){if(_0x542a14){return _0x542a14[_0x348b('0x25')]()[_0x348b('0x24')](function(){var _0xd28535=_0x542a14[_0x348b('0x26')]({'plain':!![]});var _0x455392=_0x348b('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x455392,'resourceId':_0xd28535['id']}})[_0x348b('0x24')](function(){return _0x542a14;});})['then'](function(){_0xd4ac1a[_0x348b('0x1d')](0xcc)[_0x348b('0x28')]();});}};}function handleEntityNotFound(_0x3b8ef5,_0x273589){return function(_0x42e2d2){if(!_0x42e2d2){_0x3b8ef5[_0x348b('0x1c')](0x194);}return _0x42e2d2;};}function handleError(_0x56a70c,_0x33d623){_0x33d623=_0x33d623||0x1f4;return function(_0x56b6b0){logger[_0x348b('0x29')](_0x56b6b0[_0x348b('0x2a')]);if(_0x56b6b0[_0x348b('0x2b')]){delete _0x56b6b0[_0x348b('0x2b')];}_0x56a70c[_0x348b('0x1d')](_0x33d623)['send'](_0x56b6b0);};}exports[_0x348b('0x2c')]=function(_0xd3f00d,_0x746f20){var _0x3ea661={},_0x212f6c={},_0x4c98a7={'count':0x0,'rows':[]};var _0xa1d17b=_['map'](db['OpenchannelQueue'][_0x348b('0x2d')],function(_0x429d55){return{'name':_0x429d55[_0x348b('0x2e')],'type':_0x429d55['type']['key']};});_0x212f6c['model']=_[_0x348b('0x2f')](_0xa1d17b,_0x348b('0x2b'));_0x212f6c[_0x348b('0x30')]=_[_0x348b('0x31')](_0xd3f00d[_0x348b('0x30')]);_0x212f6c[_0x348b('0x32')]=_['intersection'](_0x212f6c['model'],_0x212f6c[_0x348b('0x30')]);_0x3ea661[_0x348b('0x33')]=_[_0x348b('0x34')](_0x212f6c[_0x348b('0x35')],qs[_0x348b('0x36')](_0xd3f00d[_0x348b('0x30')][_0x348b('0x36')]));_0x3ea661['attributes']=_0x3ea661[_0x348b('0x33')][_0x348b('0x37')]?_0x3ea661[_0x348b('0x33')]:_0x212f6c[_0x348b('0x35')];if(!_0xd3f00d['query'][_0x348b('0x38')]('nolimit')){_0x3ea661[_0x348b('0x39')]=qs[_0x348b('0x39')](_0xd3f00d[_0x348b('0x30')][_0x348b('0x39')]);_0x3ea661[_0x348b('0x21')]=qs[_0x348b('0x21')](_0xd3f00d[_0x348b('0x30')][_0x348b('0x21')]);}_0x3ea661['order']=qs['sort'](_0xd3f00d[_0x348b('0x30')][_0x348b('0x3a')]);_0x3ea661[_0x348b('0x3b')]=qs['filters'](_['pick'](_0xd3f00d[_0x348b('0x30')],_0x212f6c[_0x348b('0x32')]),_0xa1d17b);if(_0xd3f00d[_0x348b('0x30')]['filter']){_0x3ea661[_0x348b('0x3b')]=_[_0x348b('0x3c')](_0x3ea661['where'],{'$or':_['map'](_0xa1d17b,function(_0x108463){if(_0x108463['type']!==_0x348b('0x3d')){var _0x19946a={};_0x19946a[_0x108463[_0x348b('0x2b')]]={'$like':'%'+_0xd3f00d[_0x348b('0x30')][_0x348b('0x3e')]+'%'};return _0x19946a;}})});}_0x3ea661=_['merge']({},_0x3ea661,_0xd3f00d[_0x348b('0x3f')]);var _0x1c18b2={'where':_0x3ea661[_0x348b('0x3b')]};return db[_0x348b('0x40')][_0x348b('0x20')](_0x1c18b2)[_0x348b('0x24')](function(_0xb46f12){_0x4c98a7[_0x348b('0x20')]=_0xb46f12;if(_0xd3f00d[_0x348b('0x30')]['includeAll']){_0x3ea661['include']=[{'all':!![]}];}return db[_0x348b('0x40')]['findAll'](_0x3ea661);})[_0x348b('0x24')](function(_0x54028a){_0x4c98a7[_0x348b('0x41')]=_0x54028a;return _0x4c98a7;})[_0x348b('0x24')](respondWithFilteredResult(_0x746f20,_0x3ea661))[_0x348b('0x42')](handleError(_0x746f20,null));};exports[_0x348b('0x43')]=function(_0x15eba0,_0x12fc79){var _0x356afa={'raw':!![],'where':{'id':_0x15eba0[_0x348b('0x44')]['id']}},_0x536ba3={};_0x536ba3[_0x348b('0x35')]=_[_0x348b('0x31')](db[_0x348b('0x40')]['rawAttributes']);_0x536ba3[_0x348b('0x30')]=_[_0x348b('0x31')](_0x15eba0[_0x348b('0x30')]);_0x536ba3[_0x348b('0x32')]=_[_0x348b('0x34')](_0x536ba3['model'],_0x536ba3[_0x348b('0x30')]);_0x356afa['attributes']=_[_0x348b('0x34')](_0x536ba3[_0x348b('0x35')],qs[_0x348b('0x36')](_0x15eba0['query'][_0x348b('0x36')]));_0x356afa[_0x348b('0x33')]=_0x356afa[_0x348b('0x33')]['length']?_0x356afa['attributes']:_0x536ba3[_0x348b('0x35')];if(_0x15eba0[_0x348b('0x30')][_0x348b('0x45')]){_0x356afa[_0x348b('0x46')]=[{'all':!![]}];}_0x356afa=_['merge']({},_0x356afa,_0x15eba0[_0x348b('0x3f')]);return db[_0x348b('0x40')][_0x348b('0x47')](_0x356afa)['then'](handleEntityNotFound(_0x12fc79,null))[_0x348b('0x24')](respondWithResult(_0x12fc79,null))[_0x348b('0x42')](handleError(_0x12fc79,null));};exports[_0x348b('0x48')]=function(_0x16556d,_0x64468d){return db['OpenchannelQueue'][_0x348b('0x48')](_0x16556d[_0x348b('0x49')],{})['then'](function(_0x3d52b3){var _0x17530b=_0x16556d[_0x348b('0x4a')]['get']({'plain':!![]});if(!_0x17530b)throw new Error(_0x348b('0x4b'));if(_0x17530b[_0x348b('0x4c')]==='user'){var _0x132ab2=_0x3d52b3['get']({'plain':!![]});var _0x457029=_0x348b('0x27');return db['UserProfileSection'][_0x348b('0x47')]({'where':{'name':_0x457029,'userProfileId':_0x17530b[_0x348b('0x4d')]},'raw':!![]})[_0x348b('0x24')](function(_0x5d66ef){if(_0x5d66ef&&_0x5d66ef[_0x348b('0x4e')]===0x0){return db[_0x348b('0x4f')][_0x348b('0x48')]({'name':_0x132ab2[_0x348b('0x2b')],'resourceId':_0x132ab2['id'],'type':_0x5d66ef[_0x348b('0x2b')],'sectionId':_0x5d66ef['id']},{})[_0x348b('0x24')](function(){return _0x3d52b3;});}else{return _0x3d52b3;}})[_0x348b('0x42')](function(_0x1141bc){logger[_0x348b('0x29')](_0x348b('0x50'),_0x1141bc);throw _0x1141bc;});}return _0x3d52b3;})[_0x348b('0x24')](respondWithResult(_0x64468d,0xc9))[_0x348b('0x42')](handleError(_0x64468d,null));};exports[_0x348b('0x51')]=function(_0x1d06af,_0xf61ab4){if(_0x1d06af[_0x348b('0x49')]['id']){delete _0x1d06af['body']['id'];}return db[_0x348b('0x40')][_0x348b('0x47')]({'where':{'id':_0x1d06af[_0x348b('0x44')]['id']}})[_0x348b('0x24')](handleEntityNotFound(_0xf61ab4,null))[_0x348b('0x24')](saveUpdates(_0x1d06af['body'],null))['then'](respondWithResult(_0xf61ab4,null))[_0x348b('0x42')](handleError(_0xf61ab4,null));};exports['destroy']=function(_0x207ba7,_0x140d1b){return db[_0x348b('0x40')]['find']({'where':{'id':_0x207ba7[_0x348b('0x44')]['id']}})[_0x348b('0x24')](handleEntityNotFound(_0x140d1b,null))[_0x348b('0x24')](removeEntity(_0x140d1b,null))['catch'](handleError(_0x140d1b,null));};exports[_0x348b('0x52')]=function(_0x3b649a,_0x3d2ede){return db[_0x348b('0x40')][_0x348b('0x52')]()['then'](respondWithResult(_0x3d2ede,null))[_0x348b('0x42')](handleError(_0x3d2ede,null));};exports['getMembers']=function(_0x535b4f,_0x2fd421,_0x4f3874){var _0x472164={'raw':!![],'where':{}},_0x523444={},_0x13512a;return db['OpenchannelQueue'][_0x348b('0x53')]({'where':{'id':_0x535b4f[_0x348b('0x44')]['id']}})[_0x348b('0x24')](handleEntityNotFound(_0x2fd421,null))[_0x348b('0x24')](function(_0x2ee2b5){if(_0x2ee2b5){_0x13512a=_0x2ee2b5[_0x348b('0x26')]({'plain':!![]});_0x523444['model']=_['keys'](db[_0x348b('0x54')]['rawAttributes']);_0x523444[_0x348b('0x30')]=_[_0x348b('0x31')](_0x535b4f[_0x348b('0x30')]);_0x523444[_0x348b('0x32')]=_[_0x348b('0x34')](_0x523444[_0x348b('0x35')],_0x523444[_0x348b('0x30')]);_0x472164[_0x348b('0x33')]=_[_0x348b('0x34')](_0x523444[_0x348b('0x35')],qs[_0x348b('0x36')](_0x535b4f[_0x348b('0x30')][_0x348b('0x36')]));_0x472164[_0x348b('0x33')]=_0x472164['attributes']['length']?_0x472164[_0x348b('0x33')]:_0x523444['model'];if(!_0x535b4f[_0x348b('0x30')][_0x348b('0x38')]('nolimit')){_0x472164['limit']=qs[_0x348b('0x39')](_0x535b4f[_0x348b('0x30')][_0x348b('0x39')]);_0x472164[_0x348b('0x21')]=qs['offset'](_0x535b4f[_0x348b('0x30')][_0x348b('0x21')]);}_0x472164['order']=qs['sort'](_0x535b4f[_0x348b('0x30')][_0x348b('0x3a')]);_0x472164[_0x348b('0x3b')]=qs[_0x348b('0x32')](_[_0x348b('0x55')](_0x535b4f[_0x348b('0x30')],_0x523444[_0x348b('0x32')]));_0x472164['where'][_0x348b('0x56')]=_0x2ee2b5['id'];if(_0x535b4f[_0x348b('0x30')][_0x348b('0x3e')]){_0x472164[_0x348b('0x3b')]=_['merge'](_0x472164[_0x348b('0x3b')],{'$or':_[_0x348b('0x2f')](_0x472164[_0x348b('0x33')],function(_0x1a22d9){var _0x4f0825={};_0x4f0825[_0x1a22d9]={'$like':'%'+_0x535b4f[_0x348b('0x30')][_0x348b('0x3e')]+'%'};return _0x4f0825;})});}_0x472164=_[_0x348b('0x3c')]({},_0x472164,_0x535b4f[_0x348b('0x3f')]);return db[_0x348b('0x54')]['findAll'](_0x472164);}})['then'](function(_0x4117d2){if(_0x4117d2){return db[_0x348b('0x57')][_0x348b('0x58')]({'where':{'id':_['map'](_0x4117d2,_0x348b('0x59')),'role':_0x348b('0x5a')},'attributes':['id',_0x348b('0x2b'),_0x348b('0x5b'),_0x348b('0x5c'),_0x348b('0x5d')]});}})[_0x348b('0x24')](function(_0x39b95c){if(_0x39b95c){return{'count':_0x39b95c[_0x348b('0x20')],'rows':_[_0x348b('0x2f')](_0x39b95c['rows'],function(_0x5477af){return{'membername':_0x5477af['name'],'UserId':_0x5477af['id'],'queue_name':_0x13512a[_0x348b('0x2b')],'OpenchannelQueueId':_0x13512a['id'],'interface':util[_0x348b('0x5e')](_0x348b('0x5f'),_0x348b('0x60'),_0x5477af[_0x348b('0x2b')]),'penalty':0x0,'paused':_0x5477af[_0x348b('0x5b')],'createdAt':_0x5477af[_0x348b('0x5d')],'updatedAt':_0x5477af[_0x348b('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x348b('0x24')](respondWithFilteredResult(_0x2fd421,_0x472164))[_0x348b('0x42')](handleError(_0x2fd421,null));};exports[_0x348b('0x61')]=function(_0x34ca2e,_0x4a821a,_0x548d6f){var _0x3c4292={};var _0x14f060={};var _0x573635;var _0x13f491;return db[_0x348b('0x40')][_0x348b('0x53')]({'where':{'id':_0x34ca2e[_0x348b('0x44')]['id']}})[_0x348b('0x24')](handleEntityNotFound(_0x4a821a,null))['then'](function(_0x4aaa17){if(_0x4aaa17){_0x573635=_0x4aaa17;_0x14f060[_0x348b('0x35')]=_[_0x348b('0x31')](db['Team'][_0x348b('0x2d')]);_0x14f060['query']=_[_0x348b('0x31')](_0x34ca2e['query']);_0x14f060[_0x348b('0x32')]=_[_0x348b('0x34')](_0x14f060['model'],_0x14f060[_0x348b('0x30')]);_0x3c4292[_0x348b('0x33')]=_[_0x348b('0x34')](_0x14f060[_0x348b('0x35')],qs['fields'](_0x34ca2e['query'][_0x348b('0x36')]));_0x3c4292[_0x348b('0x33')]=_0x3c4292[_0x348b('0x33')][_0x348b('0x37')]?_0x3c4292[_0x348b('0x33')]:_0x14f060['model'];_0x3c4292[_0x348b('0x62')]=qs['sort'](_0x34ca2e[_0x348b('0x30')][_0x348b('0x3a')]);_0x3c4292['where']=qs[_0x348b('0x32')](_['pick'](_0x34ca2e[_0x348b('0x30')],_0x14f060[_0x348b('0x32')]));if(_0x34ca2e[_0x348b('0x30')][_0x348b('0x3e')]){_0x3c4292[_0x348b('0x3b')]=_['merge'](_0x3c4292['where'],{'$or':_[_0x348b('0x2f')](_0x3c4292[_0x348b('0x33')],function(_0x303479){var _0x5a8f1={};_0x5a8f1[_0x303479]={'$like':'%'+_0x34ca2e['query'][_0x348b('0x3e')]+'%'};return _0x5a8f1;})});}_0x3c4292=_[_0x348b('0x3c')]({},_0x3c4292,_0x34ca2e[_0x348b('0x3f')]);return _0x573635[_0x348b('0x61')](_0x3c4292);}})['then'](function(_0x33e5d5){if(_0x33e5d5){_0x13f491=_0x33e5d5[_0x348b('0x37')];if(!_0x34ca2e['query']['hasOwnProperty']('nolimit')){_0x3c4292[_0x348b('0x39')]=qs['limit'](_0x34ca2e[_0x348b('0x30')][_0x348b('0x39')]);_0x3c4292['offset']=qs['offset'](_0x34ca2e['query'][_0x348b('0x21')]);}return _0x573635[_0x348b('0x61')](_0x3c4292);}})['then'](function(_0x105d9d){if(_0x105d9d){return _0x105d9d?{'count':_0x13f491,'rows':_0x105d9d}:null;}})[_0x348b('0x24')](respondWithResult(_0x4a821a,null))['catch'](handleError(_0x4a821a,null));};exports['addTeams']=function(_0x377382,_0x2423bc,_0xb145f3){var _0x3a1022=_0x377382[_0x348b('0x49')][_0x348b('0x63')];return db['Team'][_0x348b('0x64')]({'where':{'id':_0x3a1022},'attributes':['id'],'include':[{'model':db[_0x348b('0x57')],'as':_0x348b('0x65'),'attributes':['id',_0x348b('0x2b'),'online',_0x348b('0x66'),_0x348b('0x67')],'raw':!![]}]})['then'](function(_0x903597){if(_0x903597){var _0x4a622e=_[_0x348b('0x68')](_0x903597,function(_0x48f1fe){var _0x251394=_0x48f1fe[_0x348b('0x26')]({'plain':!![]});return _0x251394['Agents'];});return db[_0x348b('0x40')][_0x348b('0x47')]({'where':{'id':_0x377382[_0x348b('0x44')]['id']}})['then'](function(_0x53c3c6){return db[_0x348b('0x69')][_0x348b('0x6a')](function(_0x10caea){return _0x53c3c6[_0x348b('0x6b')](_0x3a1022,{'transaction':_0x10caea})[_0x348b('0x24')](function(){return BPromise[_0x348b('0x6c')](_0x4a622e,function(_0x250f37){return db['UserOpenchannelQueue'][_0x348b('0x6d')]({'where':{'UserId':_0x250f37['id'],'OpenchannelQueueId':_0x377382[_0x348b('0x44')]['id']},'transaction':_0x10caea});});})[_0x348b('0x24')](function(){_0x4a622e[_0x348b('0x6e')](function(_0x2ff252){socket[_0x348b('0x6f')](_0x348b('0x70'),{'UserId':_0x2ff252['id'],'OpenchannelQueueId':_0x53c3c6['id']});});});});});}})[_0x348b('0x24')](respondWithStatusCode(_0x2423bc,null))[_0x348b('0x42')](handleError(_0x2423bc,null));};exports[_0x348b('0x71')]=function(_0x688f69,_0x705d2d,_0x41df20){return db[_0x348b('0x72')][_0x348b('0x64')]({'where':{'id':_0x688f69[_0x348b('0x30')][_0x348b('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x348b('0x65'),'attributes':['id'],'raw':!![]}]})[_0x348b('0x24')](handleEntityNotFound(_0x705d2d,null))['then'](function(_0x4f38eb){var _0x480251=_[_0x348b('0x2f')](_0x4f38eb,'id');var _0x452493=[];var _0x106014=[];var _0x4c9150=squel[_0x348b('0x73')]();_0x4c9150['field'](_0x348b('0x74'))[_0x348b('0x75')](_0x348b('0x76'),'tq')['join']('user_has_teams','ut',_0x348b('0x77'))['where'](_0x348b('0x78'),_0x688f69['params']['id']);for(var _0x141226=0x0;_0x141226<_0x4f38eb[_0x348b('0x37')];_0x141226+=0x1){let _0x28cc4f=_0x4f38eb[_0x141226];for(var _0x46daae=0x0;_0x46daae<_0x28cc4f[_0x348b('0x65')][_0x348b('0x37')];_0x46daae+=0x1){let _0x54ca9d=_0x28cc4f['Agents'][_0x46daae];var _0x1a27e4=_0x4c9150[_0x348b('0x79')]();_0x1a27e4[_0x348b('0x3b')](_0x348b('0x7a'),_0x54ca9d['id']);_0x106014[_0x348b('0x7b')](db[_0x348b('0x69')][_0x348b('0x30')](_0x1a27e4[_0x348b('0x7c')](),{'type':db['sequelize'][_0x348b('0x7d')][_0x348b('0x7e')]})[_0x348b('0x24')](function(_0x2f4460){if(_0x2f4460[_0x348b('0x37')]===0x1){return _0x54ca9d['id'];}else{var _0x21d0bf=_['every'](_['map'](_0x2f4460,_0x348b('0x7f')),function(_0x4628dd){return _['includes'](_0x480251,_0x4628dd);});if(_0x21d0bf){return _0x54ca9d['id'];}}}));}}return BPromise[_0x348b('0x80')](_0x106014)[_0x348b('0x24')](function(_0x2b151b){_0x452493=_(_0x452493)[_0x348b('0x81')](_0x2b151b)[_0x348b('0x82')]()[_0x348b('0x83')]();return db[_0x348b('0x40')][_0x348b('0x47')]({'where':{'id':_0x688f69[_0x348b('0x44')]['id']}})[_0x348b('0x24')](function(_0x27dbba){return db[_0x348b('0x69')][_0x348b('0x6a')](function(_0x19f520){return _0x27dbba[_0x348b('0x71')](_0x688f69[_0x348b('0x30')][_0x348b('0x63')],{'transaction':_0x19f520})[_0x348b('0x24')](function(){if(!_[_0x348b('0x84')](_0x452493)){return _0x27dbba['removeAgents'](_0x452493,{'transaction':_0x19f520});}})['then'](function(){_0x452493[_0x348b('0x6e')](function(_0x3edc3d){socket['emit'](_0x348b('0x85'),{'UserId':_0x3edc3d,'OpenchannelQueueId':_0x27dbba['id']});});});});});});})[_0x348b('0x24')](respondWithStatusCode(_0x705d2d,null))[_0x348b('0x42')](handleError(_0x705d2d,null));};exports[_0x348b('0x86')]=function(_0x412546,_0xd0b495,_0x317869){return db[_0x348b('0x40')][_0x348b('0x47')]({'where':{'id':_0x412546['params']['id']}})[_0x348b('0x24')](handleEntityNotFound(_0xd0b495,null))[_0x348b('0x24')](function(_0x4cbcd3){if(_0x4cbcd3){return _0x4cbcd3[_0x348b('0x86')](_0x412546[_0x348b('0x49')][_0x348b('0x63')],_[_0x348b('0x87')](_0x412546[_0x348b('0x49')],[_0x348b('0x63'),'id'])||{})['spread'](function(_0x38e43c){for(var _0x4edd2e=0x0;_0x4edd2e<_0x412546['body']['ids']['length'];_0x4edd2e+=0x1){socket[_0x348b('0x6f')](_0x348b('0x70'),{'UserId':Number(_0x412546[_0x348b('0x49')][_0x348b('0x63')][_0x4edd2e]),'OpenchannelQueueId':Number(_0x412546[_0x348b('0x44')]['id'])});}return _0x38e43c;});}})[_0x348b('0x24')](respondWithResult(_0xd0b495,null))[_0x348b('0x42')](handleError(_0xd0b495,null));};exports['removeAgents']=function(_0x16ef64,_0x5b7337,_0x4fdc39){return db['OpenchannelQueue'][_0x348b('0x47')]({'where':{'id':_0x16ef64[_0x348b('0x44')]['id']}})[_0x348b('0x24')](handleEntityNotFound(_0x5b7337,null))['then'](function(_0x2f75dc){if(_0x2f75dc){return _0x2f75dc[_0x348b('0x88')](_0x16ef64['query'][_0x348b('0x63')])[_0x348b('0x24')](function(){if(_[_0x348b('0x89')](_0x16ef64[_0x348b('0x30')][_0x348b('0x63')])){for(var _0x3f0189=0x0;_0x3f0189<_0x16ef64[_0x348b('0x30')]['ids'][_0x348b('0x37')];_0x3f0189+=0x1){socket[_0x348b('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x16ef64['query'][_0x348b('0x63')][_0x3f0189]),'OpenchannelQueueId':Number(_0x16ef64[_0x348b('0x44')]['id'])});}}else{socket[_0x348b('0x6f')](_0x348b('0x85'),{'UserId':Number(_0x16ef64[_0x348b('0x30')]['ids']),'OpenchannelQueueId':Number(_0x16ef64[_0x348b('0x44')]['id'])});}});}})[_0x348b('0x24')](respondWithStatusCode(_0x5b7337,null))[_0x348b('0x42')](handleError(_0x5b7337,null));};exports['getAgents']=function(_0xcca450,_0x351ca8,_0x4cf71b){var _0x41b702={};var _0x4e5761={};var _0x8e68d4;var _0x36fdc2;return db[_0x348b('0x40')]['findOne']({'where':{'id':_0xcca450['params']['id']}})['then'](handleEntityNotFound(_0x351ca8,null))[_0x348b('0x24')](function(_0x4bd69d){if(_0x4bd69d){_0x8e68d4=_0x4bd69d;_0x4e5761['model']=_['keys'](db[_0x348b('0x57')][_0x348b('0x2d')]);_0x4e5761['query']=_[_0x348b('0x31')](_0xcca450[_0x348b('0x30')]);_0x4e5761[_0x348b('0x32')]=_['intersection'](_0x4e5761['model'],_0x4e5761[_0x348b('0x30')]);_0x41b702[_0x348b('0x33')]=_['intersection'](_0x4e5761[_0x348b('0x35')],qs[_0x348b('0x36')](_0xcca450[_0x348b('0x30')][_0x348b('0x36')]));_0x41b702[_0x348b('0x33')]=_0x41b702[_0x348b('0x33')][_0x348b('0x37')]?_0x41b702[_0x348b('0x33')]:_0x4e5761['model'];_0x41b702[_0x348b('0x62')]=qs[_0x348b('0x3a')](_0xcca450[_0x348b('0x30')][_0x348b('0x3a')]);_0x41b702[_0x348b('0x3b')]=qs['filters'](_['pick'](_0xcca450[_0x348b('0x30')],_0x4e5761['filters']));if(_0xcca450[_0x348b('0x30')][_0x348b('0x3e')]){_0x41b702[_0x348b('0x3b')]=_[_0x348b('0x3c')](_0x41b702[_0x348b('0x3b')],{'$or':_[_0x348b('0x2f')](_0x41b702[_0x348b('0x33')],function(_0x123e72){var _0x551b79={};_0x551b79[_0x123e72]={'$like':'%'+_0xcca450[_0x348b('0x30')][_0x348b('0x3e')]+'%'};return _0x551b79;})});}_0x41b702=_['merge']({},_0x41b702,_0xcca450[_0x348b('0x3f')]);return _0x8e68d4[_0x348b('0x8a')](_0x41b702);}})['then'](function(_0x1de0b9){if(_0x1de0b9){_0x36fdc2=_0x1de0b9[_0x348b('0x37')];if(!_0xcca450[_0x348b('0x30')]['hasOwnProperty'](_0x348b('0x8b'))){_0x41b702[_0x348b('0x39')]=qs[_0x348b('0x39')](_0xcca450['query']['limit']);_0x41b702['offset']=qs[_0x348b('0x21')](_0xcca450[_0x348b('0x30')]['offset']);}return _0x8e68d4[_0x348b('0x8a')](_0x41b702);}})[_0x348b('0x24')](function(_0x18c2d7){if(_0x18c2d7){return _0x18c2d7?{'count':_0x36fdc2,'rows':_0x18c2d7}:null;}})[_0x348b('0x24')](respondWithResult(_0x351ca8,null))['catch'](handleError(_0x351ca8,null));}; \ No newline at end of file +var _0x0f39=['ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','get','destroy','error','stack','name','index','map','rawAttributes','key','model','keys','filters','query','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','attributes','find','create','body','user','role','OpenchannelQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','SIP','updatedAt','Team','options','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','TeamId','all','union','compact','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','to-csv'];(function(_0x49c6f3,_0x4e5f61){var _0x2a88ce=function(_0x458adb){while(--_0x458adb){_0x49c6f3['push'](_0x49c6f3['shift']());}};_0x2a88ce(++_0x4e5f61);}(_0x0f39,0x18d));var _0x90f3=function(_0xfd417f,_0x304962){_0xfd417f=_0xfd417f-0x0;var _0x35e815=_0x0f39[_0xfd417f];return _0x35e815;};'use strict';var emlformat=require(_0x90f3('0x0'));var rimraf=require(_0x90f3('0x1'));var zipdir=require(_0x90f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90f3('0x4'));var util=require(_0x90f3('0x5'));var path=require(_0x90f3('0x6'));var sox=require('sox');var csv=require(_0x90f3('0x7'));var ejs=require(_0x90f3('0x8'));var fs=require('fs');var fs_extra=require(_0x90f3('0x9'));var _=require('lodash');var squel=require(_0x90f3('0xa'));var crypto=require('crypto');var jsforce=require(_0x90f3('0xb'));var deskjs=require(_0x90f3('0xc'));var toCsv=require(_0x90f3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x90f3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x90f3('0xe'));var as=require(_0x90f3('0xf'));var hardwareService=require(_0x90f3('0x10'));var logger=require(_0x90f3('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x90f3('0x12'));var licenseUtil=require(_0x90f3('0x13'));var db=require(_0x90f3('0x14'))['db'];config[_0x90f3('0x15')]=_[_0x90f3('0x16')](config[_0x90f3('0x15')],{'host':_0x90f3('0x17'),'port':0x18eb});var socket=require(_0x90f3('0x18'))(new Redis(config[_0x90f3('0x15')]));require(_0x90f3('0x19'))[_0x90f3('0x1a')](socket);function respondWithStatusCode(_0x4cb833,_0x273d19){_0x273d19=_0x273d19||0xcc;return function(_0x77f93c){if(_0x77f93c){return _0x4cb833[_0x90f3('0x1b')](_0x273d19);}return _0x4cb833[_0x90f3('0x1c')](_0x273d19)[_0x90f3('0x1d')]();};}function respondWithResult(_0x5980a1,_0x587faa){_0x587faa=_0x587faa||0xc8;return function(_0xcaa0e5){if(_0xcaa0e5){return _0x5980a1[_0x90f3('0x1c')](_0x587faa)[_0x90f3('0x1e')](_0xcaa0e5);}};}function respondWithFilteredResult(_0x2a9ee3,_0x2340e6){return function(_0x17d1a2){if(_0x17d1a2){var _0x254943=typeof _0x2340e6[_0x90f3('0x1f')]===_0x90f3('0x20')&&typeof _0x2340e6[_0x90f3('0x21')]==='undefined';var _0x1618cc=_0x17d1a2[_0x90f3('0x22')];var _0x9aae65=_0x254943?0x0:_0x2340e6['offset'];var _0x5c55c7=_0x254943?_0x17d1a2[_0x90f3('0x22')]:_0x2340e6['offset']+_0x2340e6[_0x90f3('0x21')];var _0x27d0a4;if(_0x5c55c7>=_0x1618cc){_0x5c55c7=_0x1618cc;_0x27d0a4=0xc8;}else{_0x27d0a4=0xce;}_0x2a9ee3['status'](_0x27d0a4);return _0x2a9ee3[_0x90f3('0x23')]('Content-Range',_0x9aae65+'-'+_0x5c55c7+'/'+_0x1618cc)['json'](_0x17d1a2);}return null;};}function patchUpdates(_0x23540f){return function(_0x551acd){try{jsonpatch['apply'](_0x551acd,_0x23540f,!![]);}catch(_0xa936b9){return BPromise['reject'](_0xa936b9);}return _0x551acd[_0x90f3('0x24')]();};}function saveUpdates(_0x52f129,_0x1aa7d3){return function(_0x33a588){if(_0x33a588){return _0x33a588[_0x90f3('0x25')](_0x52f129)['then'](function(_0x4786e4){return _0x4786e4;});}return null;};}function removeEntity(_0x1fe759,_0xd94167){return function(_0x215db2){if(_0x215db2){return _0x215db2['destroy']()[_0x90f3('0x26')](function(){var _0x596bfe=_0x215db2[_0x90f3('0x27')]({'plain':!![]});var _0x60170e='OpenchannelQueues';return db['UserProfileResource'][_0x90f3('0x28')]({'where':{'type':_0x60170e,'resourceId':_0x596bfe['id']}})[_0x90f3('0x26')](function(){return _0x215db2;});})[_0x90f3('0x26')](function(){_0x1fe759[_0x90f3('0x1c')](0xcc)[_0x90f3('0x1d')]();});}};}function handleEntityNotFound(_0xe94997,_0x439e80){return function(_0x52aa7d){if(!_0x52aa7d){_0xe94997['sendStatus'](0x194);}return _0x52aa7d;};}function handleError(_0x263857,_0x431464){_0x431464=_0x431464||0x1f4;return function(_0x5664f2){logger[_0x90f3('0x29')](_0x5664f2[_0x90f3('0x2a')]);if(_0x5664f2[_0x90f3('0x2b')]){delete _0x5664f2[_0x90f3('0x2b')];}_0x263857[_0x90f3('0x1c')](_0x431464)['send'](_0x5664f2);};}exports[_0x90f3('0x2c')]=function(_0x33a1de,_0x2eee7f){var _0x47fe52={},_0x34ee9a={},_0x1e572f={'count':0x0,'rows':[]};var _0xf9d9ce=_[_0x90f3('0x2d')](db['OpenchannelQueue'][_0x90f3('0x2e')],function(_0x562f29){return{'name':_0x562f29['fieldName'],'type':_0x562f29['type'][_0x90f3('0x2f')]};});_0x34ee9a[_0x90f3('0x30')]=_[_0x90f3('0x2d')](_0xf9d9ce,_0x90f3('0x2b'));_0x34ee9a['query']=_[_0x90f3('0x31')](_0x33a1de['query']);_0x34ee9a[_0x90f3('0x32')]=_['intersection'](_0x34ee9a[_0x90f3('0x30')],_0x34ee9a[_0x90f3('0x33')]);_0x47fe52['attributes']=_[_0x90f3('0x34')](_0x34ee9a[_0x90f3('0x30')],qs[_0x90f3('0x35')](_0x33a1de[_0x90f3('0x33')][_0x90f3('0x35')]));_0x47fe52['attributes']=_0x47fe52['attributes'][_0x90f3('0x36')]?_0x47fe52['attributes']:_0x34ee9a[_0x90f3('0x30')];if(!_0x33a1de[_0x90f3('0x33')]['hasOwnProperty'](_0x90f3('0x37'))){_0x47fe52[_0x90f3('0x21')]=qs[_0x90f3('0x21')](_0x33a1de[_0x90f3('0x33')][_0x90f3('0x21')]);_0x47fe52[_0x90f3('0x1f')]=qs['offset'](_0x33a1de[_0x90f3('0x33')][_0x90f3('0x1f')]);}_0x47fe52[_0x90f3('0x38')]=qs[_0x90f3('0x39')](_0x33a1de['query'][_0x90f3('0x39')]);_0x47fe52[_0x90f3('0x3a')]=qs[_0x90f3('0x32')](_[_0x90f3('0x3b')](_0x33a1de[_0x90f3('0x33')],_0x34ee9a[_0x90f3('0x32')]),_0xf9d9ce);if(_0x33a1de['query']['filter']){_0x47fe52[_0x90f3('0x3a')]=_[_0x90f3('0x3c')](_0x47fe52[_0x90f3('0x3a')],{'$or':_[_0x90f3('0x2d')](_0xf9d9ce,function(_0x225d07){if(_0x225d07[_0x90f3('0x3d')]!=='VIRTUAL'){var _0x316c91={};_0x316c91[_0x225d07[_0x90f3('0x2b')]]={'$like':'%'+_0x33a1de['query']['filter']+'%'};return _0x316c91;}})});}_0x47fe52=_[_0x90f3('0x3c')]({},_0x47fe52,_0x33a1de['options']);var _0x75d91d={'where':_0x47fe52[_0x90f3('0x3a')]};return db[_0x90f3('0x3e')][_0x90f3('0x22')](_0x75d91d)[_0x90f3('0x26')](function(_0x3cdc33){_0x1e572f[_0x90f3('0x22')]=_0x3cdc33;if(_0x33a1de[_0x90f3('0x33')][_0x90f3('0x3f')]){_0x47fe52[_0x90f3('0x40')]=[{'all':!![]}];}return db[_0x90f3('0x3e')][_0x90f3('0x41')](_0x47fe52);})['then'](function(_0xc5626e){_0x1e572f[_0x90f3('0x42')]=_0xc5626e;return _0x1e572f;})[_0x90f3('0x26')](respondWithFilteredResult(_0x2eee7f,_0x47fe52))[_0x90f3('0x43')](handleError(_0x2eee7f,null));};exports[_0x90f3('0x44')]=function(_0x43f226,_0x3fca8e){var _0x9bbac1={'raw':!![],'where':{'id':_0x43f226[_0x90f3('0x45')]['id']}},_0x59cdff={};_0x59cdff[_0x90f3('0x30')]=_[_0x90f3('0x31')](db[_0x90f3('0x3e')][_0x90f3('0x2e')]);_0x59cdff[_0x90f3('0x33')]=_[_0x90f3('0x31')](_0x43f226[_0x90f3('0x33')]);_0x59cdff[_0x90f3('0x32')]=_['intersection'](_0x59cdff[_0x90f3('0x30')],_0x59cdff['query']);_0x9bbac1[_0x90f3('0x46')]=_[_0x90f3('0x34')](_0x59cdff[_0x90f3('0x30')],qs[_0x90f3('0x35')](_0x43f226[_0x90f3('0x33')][_0x90f3('0x35')]));_0x9bbac1[_0x90f3('0x46')]=_0x9bbac1[_0x90f3('0x46')][_0x90f3('0x36')]?_0x9bbac1[_0x90f3('0x46')]:_0x59cdff[_0x90f3('0x30')];if(_0x43f226[_0x90f3('0x33')][_0x90f3('0x3f')]){_0x9bbac1[_0x90f3('0x40')]=[{'all':!![]}];}_0x9bbac1=_[_0x90f3('0x3c')]({},_0x9bbac1,_0x43f226['options']);return db['OpenchannelQueue'][_0x90f3('0x47')](_0x9bbac1)[_0x90f3('0x26')](handleEntityNotFound(_0x3fca8e,null))[_0x90f3('0x26')](respondWithResult(_0x3fca8e,null))[_0x90f3('0x43')](handleError(_0x3fca8e,null));};exports[_0x90f3('0x48')]=function(_0x80a166,_0x273636){return db[_0x90f3('0x3e')][_0x90f3('0x48')](_0x80a166[_0x90f3('0x49')],{})[_0x90f3('0x26')](function(_0x33126d){var _0x3e2c38=_0x80a166[_0x90f3('0x4a')]['get']({'plain':!![]});if(!_0x3e2c38)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e2c38[_0x90f3('0x4b')]==='user'){var _0x5cda00=_0x33126d[_0x90f3('0x27')]({'plain':!![]});var _0x5e2d3b=_0x90f3('0x4c');return db[_0x90f3('0x4d')]['find']({'where':{'name':_0x5e2d3b,'userProfileId':_0x3e2c38['userProfileId']},'raw':!![]})[_0x90f3('0x26')](function(_0x1b8a4d){if(_0x1b8a4d&&_0x1b8a4d[_0x90f3('0x4e')]===0x0){return db[_0x90f3('0x4f')][_0x90f3('0x48')]({'name':_0x5cda00['name'],'resourceId':_0x5cda00['id'],'type':_0x1b8a4d[_0x90f3('0x2b')],'sectionId':_0x1b8a4d['id']},{})[_0x90f3('0x26')](function(){return _0x33126d;});}else{return _0x33126d;}})['catch'](function(_0x1d75d3){logger['error'](_0x90f3('0x50'),_0x1d75d3);throw _0x1d75d3;});}return _0x33126d;})[_0x90f3('0x26')](respondWithResult(_0x273636,0xc9))['catch'](handleError(_0x273636,null));};exports['update']=function(_0x46a40a,_0x5716e2){if(_0x46a40a[_0x90f3('0x49')]['id']){delete _0x46a40a[_0x90f3('0x49')]['id'];}return db[_0x90f3('0x3e')][_0x90f3('0x47')]({'where':{'id':_0x46a40a[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](handleEntityNotFound(_0x5716e2,null))['then'](saveUpdates(_0x46a40a[_0x90f3('0x49')],null))[_0x90f3('0x26')](respondWithResult(_0x5716e2,null))[_0x90f3('0x43')](handleError(_0x5716e2,null));};exports[_0x90f3('0x28')]=function(_0x2bddd5,_0x1c262c){return db[_0x90f3('0x3e')][_0x90f3('0x47')]({'where':{'id':_0x2bddd5[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](handleEntityNotFound(_0x1c262c,null))['then'](removeEntity(_0x1c262c,null))[_0x90f3('0x43')](handleError(_0x1c262c,null));};exports['describe']=function(_0x2d29a3,_0x562fa2){return db['OpenchannelQueue'][_0x90f3('0x51')]()[_0x90f3('0x26')](respondWithResult(_0x562fa2,null))[_0x90f3('0x43')](handleError(_0x562fa2,null));};exports[_0x90f3('0x52')]=function(_0x52b436,_0x459dbe,_0x5d8e93){var _0xa0b394={'raw':!![],'where':{}},_0x17f58e={},_0x21e297;return db[_0x90f3('0x3e')][_0x90f3('0x53')]({'where':{'id':_0x52b436[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](handleEntityNotFound(_0x459dbe,null))[_0x90f3('0x26')](function(_0x28647c){if(_0x28647c){_0x21e297=_0x28647c[_0x90f3('0x27')]({'plain':!![]});_0x17f58e['model']=_[_0x90f3('0x31')](db[_0x90f3('0x54')][_0x90f3('0x2e')]);_0x17f58e[_0x90f3('0x33')]=_[_0x90f3('0x31')](_0x52b436[_0x90f3('0x33')]);_0x17f58e[_0x90f3('0x32')]=_[_0x90f3('0x34')](_0x17f58e[_0x90f3('0x30')],_0x17f58e[_0x90f3('0x33')]);_0xa0b394[_0x90f3('0x46')]=_[_0x90f3('0x34')](_0x17f58e[_0x90f3('0x30')],qs[_0x90f3('0x35')](_0x52b436[_0x90f3('0x33')][_0x90f3('0x35')]));_0xa0b394[_0x90f3('0x46')]=_0xa0b394[_0x90f3('0x46')][_0x90f3('0x36')]?_0xa0b394[_0x90f3('0x46')]:_0x17f58e[_0x90f3('0x30')];if(!_0x52b436['query'][_0x90f3('0x55')](_0x90f3('0x37'))){_0xa0b394[_0x90f3('0x21')]=qs[_0x90f3('0x21')](_0x52b436['query'][_0x90f3('0x21')]);_0xa0b394[_0x90f3('0x1f')]=qs[_0x90f3('0x1f')](_0x52b436[_0x90f3('0x33')][_0x90f3('0x1f')]);}_0xa0b394[_0x90f3('0x38')]=qs['sort'](_0x52b436[_0x90f3('0x33')][_0x90f3('0x39')]);_0xa0b394[_0x90f3('0x3a')]=qs['filters'](_['pick'](_0x52b436[_0x90f3('0x33')],_0x17f58e['filters']));_0xa0b394[_0x90f3('0x3a')][_0x90f3('0x56')]=_0x28647c['id'];if(_0x52b436[_0x90f3('0x33')]['filter']){_0xa0b394['where']=_[_0x90f3('0x3c')](_0xa0b394['where'],{'$or':_['map'](_0xa0b394[_0x90f3('0x46')],function(_0x3f9404){var _0x41fdcc={};_0x41fdcc[_0x3f9404]={'$like':'%'+_0x52b436['query'][_0x90f3('0x57')]+'%'};return _0x41fdcc;})});}_0xa0b394=_[_0x90f3('0x3c')]({},_0xa0b394,_0x52b436['options']);return db[_0x90f3('0x54')][_0x90f3('0x41')](_0xa0b394);}})[_0x90f3('0x26')](function(_0x31bb81){if(_0x31bb81){return db[_0x90f3('0x58')][_0x90f3('0x59')]({'where':{'id':_[_0x90f3('0x2d')](_0x31bb81,_0x90f3('0x5a')),'role':_0x90f3('0x5b')},'attributes':['id',_0x90f3('0x2b'),_0x90f3('0x5c'),'updatedAt',_0x90f3('0x5d')]});}})[_0x90f3('0x26')](function(_0xd00359){if(_0xd00359){return{'count':_0xd00359['count'],'rows':_[_0x90f3('0x2d')](_0xd00359[_0x90f3('0x42')],function(_0x3d75f9){return{'membername':_0x3d75f9[_0x90f3('0x2b')],'UserId':_0x3d75f9['id'],'queue_name':_0x21e297[_0x90f3('0x2b')],'OpenchannelQueueId':_0x21e297['id'],'interface':util[_0x90f3('0x5e')]('%s/%s',_0x90f3('0x5f'),_0x3d75f9[_0x90f3('0x2b')]),'penalty':0x0,'paused':_0x3d75f9[_0x90f3('0x5c')],'createdAt':_0x3d75f9['createdAt'],'updatedAt':_0x3d75f9[_0x90f3('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x90f3('0x26')](respondWithFilteredResult(_0x459dbe,_0xa0b394))[_0x90f3('0x43')](handleError(_0x459dbe,null));};exports['getTeams']=function(_0x499cbc,_0xbd7016,_0x4eb281){var _0x36565c={};var _0x155ded={};var _0x3221b4;var _0x202caf;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x499cbc['params']['id']}})[_0x90f3('0x26')](handleEntityNotFound(_0xbd7016,null))[_0x90f3('0x26')](function(_0x527e7d){if(_0x527e7d){_0x3221b4=_0x527e7d;_0x155ded[_0x90f3('0x30')]=_[_0x90f3('0x31')](db[_0x90f3('0x61')][_0x90f3('0x2e')]);_0x155ded[_0x90f3('0x33')]=_[_0x90f3('0x31')](_0x499cbc['query']);_0x155ded[_0x90f3('0x32')]=_[_0x90f3('0x34')](_0x155ded['model'],_0x155ded['query']);_0x36565c[_0x90f3('0x46')]=_['intersection'](_0x155ded[_0x90f3('0x30')],qs[_0x90f3('0x35')](_0x499cbc['query'][_0x90f3('0x35')]));_0x36565c[_0x90f3('0x46')]=_0x36565c[_0x90f3('0x46')]['length']?_0x36565c[_0x90f3('0x46')]:_0x155ded[_0x90f3('0x30')];_0x36565c[_0x90f3('0x38')]=qs[_0x90f3('0x39')](_0x499cbc[_0x90f3('0x33')]['sort']);_0x36565c[_0x90f3('0x3a')]=qs[_0x90f3('0x32')](_[_0x90f3('0x3b')](_0x499cbc[_0x90f3('0x33')],_0x155ded['filters']));if(_0x499cbc[_0x90f3('0x33')][_0x90f3('0x57')]){_0x36565c[_0x90f3('0x3a')]=_[_0x90f3('0x3c')](_0x36565c[_0x90f3('0x3a')],{'$or':_[_0x90f3('0x2d')](_0x36565c[_0x90f3('0x46')],function(_0x56bebc){var _0x296b3f={};_0x296b3f[_0x56bebc]={'$like':'%'+_0x499cbc['query'][_0x90f3('0x57')]+'%'};return _0x296b3f;})});}_0x36565c=_[_0x90f3('0x3c')]({},_0x36565c,_0x499cbc[_0x90f3('0x62')]);return _0x3221b4[_0x90f3('0x63')](_0x36565c);}})[_0x90f3('0x26')](function(_0x338669){if(_0x338669){_0x202caf=_0x338669['length'];if(!_0x499cbc[_0x90f3('0x33')]['hasOwnProperty'](_0x90f3('0x37'))){_0x36565c[_0x90f3('0x21')]=qs[_0x90f3('0x21')](_0x499cbc[_0x90f3('0x33')]['limit']);_0x36565c['offset']=qs['offset'](_0x499cbc[_0x90f3('0x33')]['offset']);}return _0x3221b4[_0x90f3('0x63')](_0x36565c);}})[_0x90f3('0x26')](function(_0x3db7a2){if(_0x3db7a2){return _0x3db7a2?{'count':_0x202caf,'rows':_0x3db7a2}:null;}})[_0x90f3('0x26')](respondWithResult(_0xbd7016,null))[_0x90f3('0x43')](handleError(_0xbd7016,null));};exports[_0x90f3('0x64')]=function(_0x53b2f8,_0x14bc6b,_0x14ef87){var _0x576189=_0x53b2f8[_0x90f3('0x49')][_0x90f3('0x65')];return db[_0x90f3('0x61')][_0x90f3('0x41')]({'where':{'id':_0x576189},'attributes':['id'],'include':[{'model':db[_0x90f3('0x58')],'as':'Agents','attributes':['id',_0x90f3('0x2b'),_0x90f3('0x66'),_0x90f3('0x67'),_0x90f3('0x68')],'raw':!![]}]})[_0x90f3('0x26')](function(_0x45cea1){if(_0x45cea1){var _0xdfb074=_[_0x90f3('0x69')](_0x45cea1,function(_0x48339f){var _0x433b06=_0x48339f[_0x90f3('0x27')]({'plain':!![]});return _0x433b06[_0x90f3('0x6a')];});return db[_0x90f3('0x3e')][_0x90f3('0x47')]({'where':{'id':_0x53b2f8[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](function(_0x244ed4){return db['sequelize'][_0x90f3('0x6b')](function(_0x40dc4d){return _0x244ed4[_0x90f3('0x64')](_0x576189,{'transaction':_0x40dc4d})['then'](function(){return BPromise[_0x90f3('0x6c')](_0xdfb074,function(_0x5e84c6){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x5e84c6['id'],'OpenchannelQueueId':_0x53b2f8[_0x90f3('0x45')]['id']},'transaction':_0x40dc4d});});})[_0x90f3('0x26')](function(){_0xdfb074[_0x90f3('0x6d')](function(_0x5298a5){socket[_0x90f3('0x6e')](_0x90f3('0x6f'),{'UserId':_0x5298a5['id'],'OpenchannelQueueId':_0x244ed4['id']});});});});});}})[_0x90f3('0x26')](respondWithStatusCode(_0x14bc6b,null))[_0x90f3('0x43')](handleError(_0x14bc6b,null));};exports[_0x90f3('0x70')]=function(_0x121676,_0x3144f7,_0x2b8254){return db['Team'][_0x90f3('0x41')]({'where':{'id':_0x121676[_0x90f3('0x33')][_0x90f3('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x90f3('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x90f3('0x26')](handleEntityNotFound(_0x3144f7,null))[_0x90f3('0x26')](function(_0x5e7cc3){var _0x1ad638=_[_0x90f3('0x2d')](_0x5e7cc3,'id');var _0x351ddc=[];var _0x226c45=[];var _0x103211=squel[_0x90f3('0x71')]();_0x103211[_0x90f3('0x72')](_0x90f3('0x73'))[_0x90f3('0x74')](_0x90f3('0x75'),'tq')[_0x90f3('0x76')](_0x90f3('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x90f3('0x3a')](_0x90f3('0x78'),_0x121676['params']['id']);for(var _0x4909e2=0x0;_0x4909e2<_0x5e7cc3[_0x90f3('0x36')];_0x4909e2+=0x1){let _0x4c864d=_0x5e7cc3[_0x4909e2];for(var _0x525868=0x0;_0x525868<_0x4c864d[_0x90f3('0x6a')][_0x90f3('0x36')];_0x525868+=0x1){let _0xd8ffe2=_0x4c864d['Agents'][_0x525868];var _0x4d33cf=_0x103211['clone']();_0x4d33cf['where'](_0x90f3('0x79'),_0xd8ffe2['id']);_0x226c45[_0x90f3('0x7a')](db[_0x90f3('0x7b')][_0x90f3('0x33')](_0x4d33cf['toString'](),{'type':db[_0x90f3('0x7b')]['QueryTypes']['SELECT']})[_0x90f3('0x26')](function(_0x1d7107){if(_0x1d7107['length']===0x1){return _0xd8ffe2['id'];}else{var _0x177075=_['every'](_[_0x90f3('0x2d')](_0x1d7107,_0x90f3('0x7c')),function(_0x96067a){return _['includes'](_0x1ad638,_0x96067a);});if(_0x177075){return _0xd8ffe2['id'];}}}));}}return BPromise[_0x90f3('0x7d')](_0x226c45)[_0x90f3('0x26')](function(_0x2f4f60){_0x351ddc=_(_0x351ddc)[_0x90f3('0x7e')](_0x2f4f60)[_0x90f3('0x7f')]()['value']();return db[_0x90f3('0x3e')][_0x90f3('0x47')]({'where':{'id':_0x121676[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](function(_0x48a015){return db['sequelize'][_0x90f3('0x6b')](function(_0x56f11c){return _0x48a015[_0x90f3('0x70')](_0x121676[_0x90f3('0x33')][_0x90f3('0x65')],{'transaction':_0x56f11c})['then'](function(){if(!_['isEmpty'](_0x351ddc)){return _0x48a015[_0x90f3('0x80')](_0x351ddc,{'transaction':_0x56f11c});}})[_0x90f3('0x26')](function(){_0x351ddc[_0x90f3('0x6d')](function(_0x499234){socket['emit'](_0x90f3('0x81'),{'UserId':_0x499234,'OpenchannelQueueId':_0x48a015['id']});});});});});});})[_0x90f3('0x26')](respondWithStatusCode(_0x3144f7,null))[_0x90f3('0x43')](handleError(_0x3144f7,null));};exports[_0x90f3('0x82')]=function(_0x5ef203,_0x17a260,_0xe441ad){return db['OpenchannelQueue'][_0x90f3('0x47')]({'where':{'id':_0x5ef203[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](handleEntityNotFound(_0x17a260,null))['then'](function(_0x4d8111){if(_0x4d8111){return _0x4d8111['addAgents'](_0x5ef203[_0x90f3('0x49')][_0x90f3('0x65')],_[_0x90f3('0x83')](_0x5ef203[_0x90f3('0x49')],[_0x90f3('0x65'),'id'])||{})[_0x90f3('0x84')](function(_0x57c8c7){for(var _0x1de5f2=0x0;_0x1de5f2<_0x5ef203['body']['ids'][_0x90f3('0x36')];_0x1de5f2+=0x1){socket[_0x90f3('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x5ef203[_0x90f3('0x49')][_0x90f3('0x65')][_0x1de5f2]),'OpenchannelQueueId':Number(_0x5ef203['params']['id'])});}return _0x57c8c7;});}})[_0x90f3('0x26')](respondWithResult(_0x17a260,null))[_0x90f3('0x43')](handleError(_0x17a260,null));};exports['removeAgents']=function(_0x3c48cc,_0x12550e,_0xeab8c8){return db[_0x90f3('0x3e')][_0x90f3('0x47')]({'where':{'id':_0x3c48cc[_0x90f3('0x45')]['id']}})['then'](handleEntityNotFound(_0x12550e,null))[_0x90f3('0x26')](function(_0xc4156d){if(_0xc4156d){return _0xc4156d[_0x90f3('0x80')](_0x3c48cc[_0x90f3('0x33')][_0x90f3('0x65')])[_0x90f3('0x26')](function(){if(_[_0x90f3('0x85')](_0x3c48cc[_0x90f3('0x33')][_0x90f3('0x65')])){for(var _0x57d595=0x0;_0x57d595<_0x3c48cc[_0x90f3('0x33')][_0x90f3('0x65')][_0x90f3('0x36')];_0x57d595+=0x1){socket['emit'](_0x90f3('0x81'),{'UserId':Number(_0x3c48cc[_0x90f3('0x33')][_0x90f3('0x65')][_0x57d595]),'OpenchannelQueueId':Number(_0x3c48cc['params']['id'])});}}else{socket[_0x90f3('0x6e')](_0x90f3('0x81'),{'UserId':Number(_0x3c48cc[_0x90f3('0x33')][_0x90f3('0x65')]),'OpenchannelQueueId':Number(_0x3c48cc[_0x90f3('0x45')]['id'])});}});}})[_0x90f3('0x26')](respondWithStatusCode(_0x12550e,null))[_0x90f3('0x43')](handleError(_0x12550e,null));};exports[_0x90f3('0x86')]=function(_0x499d67,_0x12de79,_0x3e5686){var _0x1900fb={};var _0x2551aa={};var _0x44dfef;var _0x27a124;return db['OpenchannelQueue'][_0x90f3('0x53')]({'where':{'id':_0x499d67[_0x90f3('0x45')]['id']}})[_0x90f3('0x26')](handleEntityNotFound(_0x12de79,null))[_0x90f3('0x26')](function(_0x3e6a23){if(_0x3e6a23){_0x44dfef=_0x3e6a23;_0x2551aa[_0x90f3('0x30')]=_[_0x90f3('0x31')](db[_0x90f3('0x58')][_0x90f3('0x2e')]);_0x2551aa[_0x90f3('0x33')]=_[_0x90f3('0x31')](_0x499d67[_0x90f3('0x33')]);_0x2551aa[_0x90f3('0x32')]=_[_0x90f3('0x34')](_0x2551aa[_0x90f3('0x30')],_0x2551aa[_0x90f3('0x33')]);_0x1900fb['attributes']=_['intersection'](_0x2551aa[_0x90f3('0x30')],qs[_0x90f3('0x35')](_0x499d67[_0x90f3('0x33')][_0x90f3('0x35')]));_0x1900fb['attributes']=_0x1900fb[_0x90f3('0x46')][_0x90f3('0x36')]?_0x1900fb['attributes']:_0x2551aa[_0x90f3('0x30')];_0x1900fb[_0x90f3('0x38')]=qs['sort'](_0x499d67[_0x90f3('0x33')][_0x90f3('0x39')]);_0x1900fb[_0x90f3('0x3a')]=qs[_0x90f3('0x32')](_[_0x90f3('0x3b')](_0x499d67[_0x90f3('0x33')],_0x2551aa[_0x90f3('0x32')]));if(_0x499d67[_0x90f3('0x33')][_0x90f3('0x57')]){_0x1900fb[_0x90f3('0x3a')]=_[_0x90f3('0x3c')](_0x1900fb[_0x90f3('0x3a')],{'$or':_[_0x90f3('0x2d')](_0x1900fb[_0x90f3('0x46')],function(_0x282703){var _0x4ca0a5={};_0x4ca0a5[_0x282703]={'$like':'%'+_0x499d67['query'][_0x90f3('0x57')]+'%'};return _0x4ca0a5;})});}_0x1900fb=_[_0x90f3('0x3c')]({},_0x1900fb,_0x499d67[_0x90f3('0x62')]);return _0x44dfef[_0x90f3('0x86')](_0x1900fb);}})[_0x90f3('0x26')](function(_0x1f77b4){if(_0x1f77b4){_0x27a124=_0x1f77b4['length'];if(!_0x499d67[_0x90f3('0x33')]['hasOwnProperty'](_0x90f3('0x37'))){_0x1900fb[_0x90f3('0x21')]=qs[_0x90f3('0x21')](_0x499d67[_0x90f3('0x33')][_0x90f3('0x21')]);_0x1900fb[_0x90f3('0x1f')]=qs[_0x90f3('0x1f')](_0x499d67[_0x90f3('0x33')][_0x90f3('0x1f')]);}return _0x44dfef[_0x90f3('0x86')](_0x1900fb);}})[_0x90f3('0x26')](function(_0x58cc60){if(_0x58cc60){return _0x58cc60?{'count':_0x27a124,'rows':_0x58cc60}:null;}})[_0x90f3('0x26')](respondWithResult(_0x12de79,null))[_0x90f3('0x43')](handleError(_0x12de79,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8964d17..7e03034 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 _0xc596=['../../mysqldb','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc596,0xe0));var _0x6c59=function(_0x24e8db,_0x89fc47){_0x24e8db=_0x24e8db-0x0;var _0x576cc1=_0xc596[_0x24e8db];return _0x576cc1;};'use strict';var EventEmitter=require(_0x6c59('0x0'));var OpenchannelQueue=require(_0x6c59('0x1'))['db'][_0x6c59('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6c59('0x3')](0x0);var events={'afterCreate':_0x6c59('0x4'),'afterUpdate':'update','afterDestroy':_0x6c59('0x5')};function emitEvent(_0x3f92fe){return function(_0x40ae22,_0x51b1ae,_0x9ff633){OpenchannelQueueEvents[_0x6c59('0x6')](_0x3f92fe+':'+_0x40ae22['id'],_0x40ae22);OpenchannelQueueEvents[_0x6c59('0x6')](_0x3f92fe,_0x40ae22);_0x9ff633(null);};}for(var e in events){if(events[_0x6c59('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x6c59('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x3dd8=['emit','hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3dd8,0xbb));var _0x83dd=function(_0xc926b7,_0xa6e261){_0xc926b7=_0xc926b7-0x0;var _0x30aff8=_0x3dd8[_0xc926b7];return _0x30aff8;};'use strict';var EventEmitter=require(_0x83dd('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x83dd('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x83dd('0x2')](0x0);var events={'afterCreate':_0x83dd('0x3'),'afterUpdate':'update','afterDestroy':_0x83dd('0x4')};function emitEvent(_0x48eca6){return function(_0x2abd93,_0x4996e9,_0x4fda85){OpenchannelQueueEvents[_0x83dd('0x5')](_0x48eca6+':'+_0x2abd93['id'],_0x2abd93);OpenchannelQueueEvents[_0x83dd('0x5')](_0x48eca6,_0x2abd93);_0x4fda85(null);};}for(var e in events){if(events[_0x83dd('0x6')](e)){var event=events[e];OpenchannelQueue[_0x83dd('0x7')](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 c362bc1..f7bb637 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 _0x3afa=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x425d40,_0x26049d){var _0x576c14=function(_0x9b1de6){while(--_0x9b1de6){_0x425d40['push'](_0x425d40['shift']());}};_0x576c14(++_0x26049d);}(_0x3afa,0x68));var _0xa3af=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0x3afa[_0x4382bc];return _0x13c82a;};'use strict';var _=require(_0xa3af('0x0'));var util=require(_0xa3af('0x1'));var logger=require(_0xa3af('0x2'))(_0xa3af('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa3af('0x4'));var fs=require('fs');var path=require(_0xa3af('0x5'));var rimraf=require(_0xa3af('0x6'));var config=require(_0xa3af('0x7'));var attributes=require(_0xa3af('0x8'));module['exports']=function(_0x235d80,_0xd4229f){return _0x235d80[_0xa3af('0x9')](_0xa3af('0xa'),attributes,{'tableName':_0xa3af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40d5=['openchannel_queues','lodash','bluebird','request-promise','path','rimraf','../../config/environment','OpenchannelQueue'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x40d5,0xa9));var _0x540d=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x40d5[_0x297eea];return _0x1c42d2;};'use strict';var _=require(_0x540d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x540d('0x1'));var rp=require(_0x540d('0x2'));var fs=require('fs');var path=require(_0x540d('0x3'));var rimraf=require(_0x540d('0x4'));var config=require(_0x540d('0x5'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x41b520,_0x1f2f97){return _0x41b520['define'](_0x540d('0x6'),attributes,{'tableName':_0x540d('0x7'),'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 38280b9..e834e5d 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 _0xa72a=['socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4da56e,_0x49f5e2){var _0x56ceff=function(_0x3f3b4a){while(--_0x3f3b4a){_0x4da56e['push'](_0x4da56e['shift']());}};_0x56ceff(++_0x49f5e2);}(_0xa72a,0x13b));var _0xaa72=function(_0x5b666b,_0x42e34c){_0x5b666b=_0x5b666b-0x0;var _0x2e2323=_0xa72a[_0x5b666b];return _0x2e2323;};'use strict';var _=require(_0xaa72('0x0'));var util=require(_0xaa72('0x1'));var moment=require(_0xaa72('0x2'));var BPromise=require(_0xaa72('0x3'));var rs=require(_0xaa72('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa72('0x5'));var logger=require(_0xaa72('0x6'))(_0xaa72('0x7'));var config=require(_0xaa72('0x8'));var jayson=require(_0xaa72('0x9'));var client=jayson[_0xaa72('0xa')][_0xaa72('0xb')]({'port':0x232a});config[_0xaa72('0xc')]=_['defaults'](config[_0xaa72('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa72('0xd'))(new Redis(config[_0xaa72('0xc')]));require(_0xaa72('0xe'))[_0xaa72('0xf')](socket);function respondWithRpcPromise(_0x59c081,_0x38b01f,_0x2b8534){return new BPromise(function(_0x2cea3e,_0x1eff47){return client[_0xaa72('0x10')](_0x59c081,_0x2b8534)[_0xaa72('0x11')](function(_0x2afa0a){logger[_0xaa72('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x38b01f,_0xaa72('0x13'));logger[_0xaa72('0x14')](_0xaa72('0x15'),_0x38b01f,_0xaa72('0x13'),JSON[_0xaa72('0x16')](_0x2afa0a));if(_0x2afa0a[_0xaa72('0x17')]){if(_0x2afa0a['error']['code']===0x1f4){logger[_0xaa72('0x17')](_0xaa72('0x18'),_0x38b01f,_0x2afa0a[_0xaa72('0x17')][_0xaa72('0x19')]);return _0x1eff47(_0x2afa0a['error'][_0xaa72('0x19')]);}logger[_0xaa72('0x17')](_0xaa72('0x18'),_0x38b01f,_0x2afa0a['error']['message']);return _0x2cea3e(_0x2afa0a[_0xaa72('0x17')][_0xaa72('0x19')]);}else{logger[_0xaa72('0x12')](_0xaa72('0x18'),_0x38b01f,_0xaa72('0x13'));_0x2cea3e(_0x2afa0a[_0xaa72('0x1a')]['message']);}})[_0xaa72('0x1b')](function(_0x337d26){logger[_0xaa72('0x17')](_0xaa72('0x18'),_0x38b01f,_0x337d26);_0x1eff47(_0x337d26);});});}exports[_0xaa72('0x1c')]=function(_0x44b777){var _0xfa1603=this;return new Promise(function(_0x283230,_0x5d36ad){return db[_0xaa72('0x1d')][_0xaa72('0x1e')]({'raw':_0x44b777[_0xaa72('0x1f')]?_0x44b777[_0xaa72('0x1f')][_0xaa72('0x20')]===undefined?!![]:![]:!![],'where':_0x44b777[_0xaa72('0x1f')]?_0x44b777['options'][_0xaa72('0x21')]||null:null,'attributes':_0x44b777[_0xaa72('0x1f')]?_0x44b777['options'][_0xaa72('0x22')]||null:null,'limit':_0x44b777[_0xaa72('0x1f')]?_0x44b777[_0xaa72('0x1f')][_0xaa72('0x23')]||null:null,'include':_0x44b777[_0xaa72('0x1f')]?_0x44b777[_0xaa72('0x1f')][_0xaa72('0x24')]?_[_0xaa72('0x25')](_0x44b777[_0xaa72('0x1f')][_0xaa72('0x24')],function(_0x32a21d){return{'model':db[_0x32a21d[_0xaa72('0x26')]],'as':_0x32a21d['as'],'attributes':_0x32a21d['attributes'],'include':_0x32a21d[_0xaa72('0x24')]?_[_0xaa72('0x25')](_0x32a21d['include'],function(_0x2b4d16){return{'model':db[_0x2b4d16[_0xaa72('0x26')]],'as':_0x2b4d16['as'],'attributes':_0x2b4d16['attributes'],'include':_0x2b4d16[_0xaa72('0x24')]?_[_0xaa72('0x25')](_0x2b4d16['include'],function(_0x5ed7bc){return{'model':db[_0x5ed7bc[_0xaa72('0x26')]],'as':_0x5ed7bc['as'],'attributes':_0x5ed7bc[_0xaa72('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaa72('0x11')](function(_0x26c5c1){logger[_0xaa72('0x12')]('GetOpenchannelQueue',_0x44b777);logger[_0xaa72('0x14')](_0xaa72('0x1c'),_0x44b777,JSON[_0xaa72('0x16')](_0x26c5c1));_0x283230(_0x26c5c1);})[_0xaa72('0x1b')](function(_0x49d6b4){logger['error'](_0xaa72('0x1c'),_0x49d6b4[_0xaa72('0x19')],_0x44b777);_0x5d36ad(_0xfa1603['error'](0x1f4,_0x49d6b4[_0xaa72('0x19')]));});});};exports[_0xaa72('0x27')]=function(_0xf713ce){var _0x24b5ea=this;return new Promise(function(_0x5c82bc,_0x10817c){return db[_0xaa72('0x1d')][_0xaa72('0x28')]({'raw':_0xf713ce['options']?_0xf713ce[_0xaa72('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xf713ce[_0xaa72('0x1f')]?_0xf713ce['options']['where']||null:null,'attributes':_0xf713ce[_0xaa72('0x1f')]?_0xf713ce[_0xaa72('0x1f')][_0xaa72('0x22')]||null:null,'include':_0xf713ce[_0xaa72('0x1f')]?_0xf713ce[_0xaa72('0x1f')][_0xaa72('0x24')]?_['map'](_0xf713ce['options']['include'],function(_0x23a231){return{'model':db[_0x23a231[_0xaa72('0x26')]],'as':_0x23a231['as'],'attributes':_0x23a231[_0xaa72('0x22')],'include':_0x23a231['include']?_[_0xaa72('0x25')](_0x23a231[_0xaa72('0x24')],function(_0x1b9135){return{'model':db[_0x1b9135[_0xaa72('0x26')]],'as':_0x1b9135['as'],'attributes':_0x1b9135[_0xaa72('0x22')],'include':_0x1b9135[_0xaa72('0x24')]?_[_0xaa72('0x25')](_0x1b9135[_0xaa72('0x24')],function(_0x3f659c){return{'model':db[_0x3f659c['model']],'as':_0x3f659c['as'],'attributes':_0x3f659c[_0xaa72('0x22')]};}):[]};}):[]};}):[]:[]})[_0xaa72('0x11')](function(_0x3684cb){logger[_0xaa72('0x12')]('ShowOpenchannelQueue',_0xf713ce);logger[_0xaa72('0x14')]('ShowOpenchannelQueue',_0xf713ce,JSON['stringify'](_0x3684cb));_0x5c82bc(_0x3684cb);})[_0xaa72('0x1b')](function(_0x564f55){logger[_0xaa72('0x17')]('ShowOpenchannelQueue',_0x564f55[_0xaa72('0x19')],_0xf713ce);_0x10817c(_0x24b5ea['error'](0x1f4,_0x564f55['message']));});});}; \ No newline at end of file +var _0x5ffd=['lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','localhost','redis','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','then','ShowOpenchannelQueue','find'];(function(_0x2f0182,_0x1a50e8){var _0x89882a=function(_0x2c3e16){while(--_0x2c3e16){_0x2f0182['push'](_0x2f0182['shift']());}};_0x89882a(++_0x1a50e8);}(_0x5ffd,0x120));var _0xd5ff=function(_0x309e8d,_0x5dd382){_0x309e8d=_0x309e8d-0x0;var _0x56dd24=_0x5ffd[_0x309e8d];return _0x56dd24;};'use strict';var _=require(_0xd5ff('0x0'));var util=require('util');var moment=require(_0xd5ff('0x1'));var BPromise=require('bluebird');var rs=require(_0xd5ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5ff('0x3'))['db'];var utils=require(_0xd5ff('0x4'));var logger=require('../../config/logger')(_0xd5ff('0x5'));var config=require('../../config/environment');var jayson=require(_0xd5ff('0x6'));var client=jayson['client'][_0xd5ff('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xd5ff('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd5ff('0x9')]));require(_0xd5ff('0xa'))[_0xd5ff('0xb')](socket);function respondWithRpcPromise(_0x1617c7,_0x39c91d,_0x32825d){return new BPromise(function(_0x4a81c5,_0x2be67d){return client[_0xd5ff('0xc')](_0x1617c7,_0x32825d)['then'](function(_0x174388){logger[_0xd5ff('0xd')](_0xd5ff('0xe'),_0x39c91d,_0xd5ff('0xf'));logger[_0xd5ff('0x10')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x39c91d,_0xd5ff('0xf'),JSON[_0xd5ff('0x11')](_0x174388));if(_0x174388[_0xd5ff('0x12')]){if(_0x174388[_0xd5ff('0x12')][_0xd5ff('0x13')]===0x1f4){logger['error'](_0xd5ff('0xe'),_0x39c91d,_0x174388[_0xd5ff('0x12')]['message']);return _0x2be67d(_0x174388[_0xd5ff('0x12')][_0xd5ff('0x14')]);}logger[_0xd5ff('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x39c91d,_0x174388[_0xd5ff('0x12')][_0xd5ff('0x14')]);return _0x4a81c5(_0x174388[_0xd5ff('0x12')][_0xd5ff('0x14')]);}else{logger['info'](_0xd5ff('0xe'),_0x39c91d,'request\x20sent');_0x4a81c5(_0x174388[_0xd5ff('0x15')][_0xd5ff('0x14')]);}})[_0xd5ff('0x16')](function(_0x329e80){logger[_0xd5ff('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x39c91d,_0x329e80);_0x2be67d(_0x329e80);});});}exports[_0xd5ff('0x17')]=function(_0x4c5993){var _0x21192d=this;return new Promise(function(_0x5b8a42,_0x25ae82){return db[_0xd5ff('0x18')][_0xd5ff('0x19')]({'raw':_0x4c5993[_0xd5ff('0x1a')]?_0x4c5993[_0xd5ff('0x1a')][_0xd5ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c5993[_0xd5ff('0x1a')]?_0x4c5993['options'][_0xd5ff('0x1c')]||null:null,'attributes':_0x4c5993['options']?_0x4c5993[_0xd5ff('0x1a')][_0xd5ff('0x1d')]||null:null,'limit':_0x4c5993[_0xd5ff('0x1a')]?_0x4c5993['options']['limit']||null:null,'include':_0x4c5993['options']?_0x4c5993[_0xd5ff('0x1a')][_0xd5ff('0x1e')]?_['map'](_0x4c5993[_0xd5ff('0x1a')][_0xd5ff('0x1e')],function(_0x3388a9){return{'model':db[_0x3388a9[_0xd5ff('0x1f')]],'as':_0x3388a9['as'],'attributes':_0x3388a9[_0xd5ff('0x1d')],'include':_0x3388a9[_0xd5ff('0x1e')]?_[_0xd5ff('0x20')](_0x3388a9['include'],function(_0x30182c){return{'model':db[_0x30182c[_0xd5ff('0x1f')]],'as':_0x30182c['as'],'attributes':_0x30182c[_0xd5ff('0x1d')],'include':_0x30182c[_0xd5ff('0x1e')]?_[_0xd5ff('0x20')](_0x30182c[_0xd5ff('0x1e')],function(_0x52ee12){return{'model':db[_0x52ee12[_0xd5ff('0x1f')]],'as':_0x52ee12['as'],'attributes':_0x52ee12[_0xd5ff('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd5ff('0x21')](function(_0x3a5eb9){logger['info']('GetOpenchannelQueue',_0x4c5993);logger[_0xd5ff('0x10')](_0xd5ff('0x17'),_0x4c5993,JSON[_0xd5ff('0x11')](_0x3a5eb9));_0x5b8a42(_0x3a5eb9);})['catch'](function(_0x14e87e){logger[_0xd5ff('0x12')](_0xd5ff('0x17'),_0x14e87e[_0xd5ff('0x14')],_0x4c5993);_0x25ae82(_0x21192d[_0xd5ff('0x12')](0x1f4,_0x14e87e[_0xd5ff('0x14')]));});});};exports[_0xd5ff('0x22')]=function(_0x4677bd){var _0x4cab8b=this;return new Promise(function(_0x50ed8a,_0x15bf1b){return db[_0xd5ff('0x18')][_0xd5ff('0x23')]({'raw':_0x4677bd[_0xd5ff('0x1a')]?_0x4677bd[_0xd5ff('0x1a')][_0xd5ff('0x1b')]===undefined?!![]:![]:!![],'where':_0x4677bd[_0xd5ff('0x1a')]?_0x4677bd['options']['where']||null:null,'attributes':_0x4677bd[_0xd5ff('0x1a')]?_0x4677bd[_0xd5ff('0x1a')]['attributes']||null:null,'include':_0x4677bd[_0xd5ff('0x1a')]?_0x4677bd[_0xd5ff('0x1a')][_0xd5ff('0x1e')]?_[_0xd5ff('0x20')](_0x4677bd[_0xd5ff('0x1a')][_0xd5ff('0x1e')],function(_0xaf6ebb){return{'model':db[_0xaf6ebb[_0xd5ff('0x1f')]],'as':_0xaf6ebb['as'],'attributes':_0xaf6ebb[_0xd5ff('0x1d')],'include':_0xaf6ebb[_0xd5ff('0x1e')]?_[_0xd5ff('0x20')](_0xaf6ebb['include'],function(_0xc216a0){return{'model':db[_0xc216a0[_0xd5ff('0x1f')]],'as':_0xc216a0['as'],'attributes':_0xc216a0[_0xd5ff('0x1d')],'include':_0xc216a0[_0xd5ff('0x1e')]?_[_0xd5ff('0x20')](_0xc216a0['include'],function(_0x3dc564){return{'model':db[_0x3dc564[_0xd5ff('0x1f')]],'as':_0x3dc564['as'],'attributes':_0x3dc564[_0xd5ff('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29a80d){logger['info'](_0xd5ff('0x22'),_0x4677bd);logger[_0xd5ff('0x10')](_0xd5ff('0x22'),_0x4677bd,JSON['stringify'](_0x29a80d));_0x50ed8a(_0x29a80d);})[_0xd5ff('0x16')](function(_0x5dc19d){logger[_0xd5ff('0x12')]('ShowOpenchannelQueue',_0x5dc19d[_0xd5ff('0x14')],_0x4677bd);_0x15bf1b(_0x4cab8b[_0xd5ff('0x12')](0x1f4,_0x5dc19d[_0xd5ff('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 01abbdf..bb08c9c 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 _0xbc95=['save','remove','update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbc95,0x10f));var _0x5bc9=function(_0x2f3d59,_0x5df3de){_0x2f3d59=_0x2f3d59-0x0;var _0x365cd4=_0xbc95[_0x2f3d59];return _0x365cd4;};'use strict';var OpenchannelQueueEvents=require(_0x5bc9('0x0'));var events=[_0x5bc9('0x1'),_0x5bc9('0x2'),_0x5bc9('0x3')];function createListener(_0x28a7bc,_0x3a2dde){return function(_0x337391){_0x3a2dde[_0x5bc9('0x4')](_0x28a7bc,_0x337391);};}function removeListener(_0xfa2d28,_0x4bc6f2){return function(){OpenchannelQueueEvents[_0x5bc9('0x5')](_0xfa2d28,_0x4bc6f2);};}exports['register']=function(_0x221019){for(var _0x558811=0x0,_0x50e2db=events[_0x5bc9('0x6')];_0x558811<_0x50e2db;_0x558811++){var _0x23ca0f=events[_0x558811];var _0x3b24bd=createListener(_0x5bc9('0x7')+_0x23ca0f,_0x221019);OpenchannelQueueEvents['on'](_0x23ca0f,_0x3b24bd);}}; \ No newline at end of file +var _0x6190=['./openchannelQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6190,0x98));var _0x0619=function(_0x1caeae,_0x48cd58){_0x1caeae=_0x1caeae-0x0;var _0x2c5dea=_0x6190[_0x1caeae];return _0x2c5dea;};'use strict';var OpenchannelQueueEvents=require(_0x0619('0x0'));var events=[_0x0619('0x1'),_0x0619('0x2'),_0x0619('0x3')];function createListener(_0x162255,_0x1303e8){return function(_0x37aabe){_0x1303e8[_0x0619('0x4')](_0x162255,_0x37aabe);};}function removeListener(_0x4829db,_0x51755d){return function(){OpenchannelQueueEvents[_0x0619('0x5')](_0x4829db,_0x51755d);};}exports[_0x0619('0x6')]=function(_0x1af50d){for(var _0xb192d0=0x0,_0x2fdf04=events[_0x0619('0x7')];_0xb192d0<_0x2fdf04;_0xb192d0++){var _0x171440=events[_0xb192d0];var _0x19c242=createListener('openchannelQueue:'+_0x171440,_0x1af50d);OpenchannelQueueEvents['on'](_0x171440,_0x19c242);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index ad45653..2d51df6 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 _0x907c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','describe','get','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1faada,_0x2320a7){var _0x4c16a3=function(_0x4e0195){while(--_0x4e0195){_0x1faada['push'](_0x1faada['shift']());}};_0x4c16a3(++_0x2320a7);}(_0x907c,0x11a));var _0xc907=function(_0x11445d,_0x67a7b9){_0x11445d=_0x11445d-0x0;var _0x57acb6=_0x907c[_0x11445d];return _0x57acb6;};'use strict';var multer=require(_0xc907('0x0'));var util=require('util');var path=require(_0xc907('0x1'));var timeout=require(_0xc907('0x2'));var express=require(_0xc907('0x3'));var router=express[_0xc907('0x4')]();var fs_extra=require(_0xc907('0x5'));var auth=require(_0xc907('0x6'));var interaction=require(_0xc907('0x7'));var config=require(_0xc907('0x8'));var controller=require(_0xc907('0x9'));router['get']('/',auth[_0xc907('0xa')](),controller['index']);router['get']('/describe',auth[_0xc907('0xa')](),controller[_0xc907('0xb')]);router[_0xc907('0xc')]('/:id',auth[_0xc907('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc907('0xd')](_0xc907('0xe'),auth[_0xc907('0xa')](),controller['update']);router[_0xc907('0xf')](_0xc907('0xe'),auth[_0xc907('0xa')](),controller[_0xc907('0x10')]);module[_0xc907('0x11')]=router; \ No newline at end of file +var _0xe259=['isAuthenticated','index','/describe','/:id','show','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./openchannelQueueReport.controller','get'];(function(_0x41cc3f,_0x2678a2){var _0x47ff58=function(_0x190d53){while(--_0x190d53){_0x41cc3f['push'](_0x41cc3f['shift']());}};_0x47ff58(++_0x2678a2);}(_0xe259,0x1a7));var _0x9e25=function(_0x54e08a,_0x4b7bb4){_0x54e08a=_0x54e08a-0x0;var _0x6eaa4=_0xe259[_0x54e08a];return _0x6eaa4;};'use strict';var multer=require(_0x9e25('0x0'));var util=require(_0x9e25('0x1'));var path=require(_0x9e25('0x2'));var timeout=require('connect-timeout');var express=require(_0x9e25('0x3'));var router=express[_0x9e25('0x4')]();var fs_extra=require(_0x9e25('0x5'));var auth=require(_0x9e25('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e25('0x7'));router[_0x9e25('0x8')]('/',auth[_0x9e25('0x9')](),controller[_0x9e25('0xa')]);router[_0x9e25('0x8')](_0x9e25('0xb'),auth[_0x9e25('0x9')](),controller['describe']);router[_0x9e25('0x8')](_0x9e25('0xc'),auth[_0x9e25('0x9')](),controller[_0x9e25('0xd')]);router['post']('/',auth[_0x9e25('0x9')](),controller['create']);router[_0x9e25('0xe')]('/:id',auth[_0x9e25('0x9')](),controller[_0x9e25('0xf')]);router[_0x9e25('0x10')](_0x9e25('0xc'),auth[_0x9e25('0x9')](),controller['destroy']);module[_0x9e25('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a24e3ab..171c67a 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 _0x5793=['STRING','DATE','moment','sequelize','exports'];(function(_0x13e535,_0x771664){var _0x3c9412=function(_0x3783ee){while(--_0x3783ee){_0x13e535['push'](_0x13e535['shift']());}};_0x3c9412(++_0x771664);}(_0x5793,0xb1));var _0x3579=function(_0x1b3bc9,_0x9311e0){_0x1b3bc9=_0x1b3bc9-0x0;var _0x3d5595=_0x5793[_0x1b3bc9];return _0x3d5595;};'use strict';var moment=require(_0x3579('0x0'));var Sequelize=require(_0x3579('0x1'));module[_0x3579('0x2')]={'uniqueid':{'type':Sequelize[_0x3579('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3579('0x4')]},'exitAt':{'type':Sequelize[_0x3579('0x4')]},'reason':{'type':Sequelize[_0x3579('0x3')]}}; \ No newline at end of file +var _0x5047=['STRING','DATE','moment','exports'];(function(_0x5285f9,_0x2bd7d7){var _0x6edc0c=function(_0x5ae671){while(--_0x5ae671){_0x5285f9['push'](_0x5285f9['shift']());}};_0x6edc0c(++_0x2bd7d7);}(_0x5047,0xda));var _0x7504=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x5047[_0x2ec461];return _0x28603d;};'use strict';var moment=require(_0x7504('0x0'));var Sequelize=require('sequelize');module[_0x7504('0x1')]={'uniqueid':{'type':Sequelize[_0x7504('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7504('0x3')]},'leaveAt':{'type':Sequelize[_0x7504('0x3')]},'acceptAt':{'type':Sequelize[_0x7504('0x3')]},'exitAt':{'type':Sequelize[_0x7504('0x3')]},'reason':{'type':Sequelize[_0x7504('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2bba935..236c63d 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 _0xcc54=['model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','query','keys','filters','intersection'];(function(_0x50ddb8,_0x2e75c6){var _0x16a28f=function(_0x5a12ef){while(--_0x5a12ef){_0x50ddb8['push'](_0x50ddb8['shift']());}};_0x16a28f(++_0x2e75c6);}(_0xcc54,0x18f));var _0x4cc5=function(_0x2abece,_0x37339a){_0x2abece=_0x2abece-0x0;var _0x2e94f3=_0xcc54[_0x2abece];return _0x2e94f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cc5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cc5('0x1'));var rp=require(_0x4cc5('0x2'));var moment=require(_0x4cc5('0x3'));var BPromise=require(_0x4cc5('0x4'));var Mustache=require(_0x4cc5('0x5'));var util=require(_0x4cc5('0x6'));var path=require('path');var sox=require(_0x4cc5('0x7'));var csv=require(_0x4cc5('0x8'));var ejs=require(_0x4cc5('0x9'));var fs=require('fs');var fs_extra=require(_0x4cc5('0xa'));var _=require(_0x4cc5('0xb'));var squel=require(_0x4cc5('0xc'));var crypto=require(_0x4cc5('0xd'));var jsforce=require(_0x4cc5('0xe'));var deskjs=require(_0x4cc5('0xf'));var toCsv=require(_0x4cc5('0x8'));var querystring=require(_0x4cc5('0x10'));var Papa=require(_0x4cc5('0x11'));var Redis=require('ioredis');var authService=require(_0x4cc5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cc5('0x13'))('api');var utils=require(_0x4cc5('0x14'));var config=require(_0x4cc5('0x15'));var licenseUtil=require(_0x4cc5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ff28,_0x4425bc){_0x4425bc=_0x4425bc||0xcc;return function(_0x1b3a65){if(_0x1b3a65){return _0x42ff28[_0x4cc5('0x17')](_0x4425bc);}return _0x42ff28[_0x4cc5('0x18')](_0x4425bc)['end']();};}function respondWithResult(_0xbe440,_0x1d22f9){_0x1d22f9=_0x1d22f9||0xc8;return function(_0x212484){if(_0x212484){return _0xbe440['status'](_0x1d22f9)[_0x4cc5('0x19')](_0x212484);}};}function respondWithFilteredResult(_0xd72ef8,_0x3a9128){return function(_0x33b2c0){if(_0x33b2c0){var _0x1ebc7d=typeof _0x3a9128[_0x4cc5('0x1a')]==='undefined'&&typeof _0x3a9128['limit']==='undefined';var _0x5e63b8=_0x33b2c0[_0x4cc5('0x1b')];var _0xc19658=_0x1ebc7d?0x0:_0x3a9128[_0x4cc5('0x1a')];var _0x59ef2d=_0x1ebc7d?_0x33b2c0[_0x4cc5('0x1b')]:_0x3a9128[_0x4cc5('0x1a')]+_0x3a9128['limit'];var _0x15c218;if(_0x59ef2d>=_0x5e63b8){_0x59ef2d=_0x5e63b8;_0x15c218=0xc8;}else{_0x15c218=0xce;}_0xd72ef8[_0x4cc5('0x18')](_0x15c218);return _0xd72ef8[_0x4cc5('0x1c')](_0x4cc5('0x1d'),_0xc19658+'-'+_0x59ef2d+'/'+_0x5e63b8)[_0x4cc5('0x19')](_0x33b2c0);}return null;};}function patchUpdates(_0xc3cc44){return function(_0xa14f65){try{jsonpatch[_0x4cc5('0x1e')](_0xa14f65,_0xc3cc44,!![]);}catch(_0x248046){return BPromise[_0x4cc5('0x1f')](_0x248046);}return _0xa14f65[_0x4cc5('0x20')]();};}function saveUpdates(_0x5d1424,_0xc5bf04){return function(_0x1bfcd4){if(_0x1bfcd4){return _0x1bfcd4[_0x4cc5('0x21')](_0x5d1424)[_0x4cc5('0x22')](function(_0x4955f8){return _0x4955f8;});}return null;};}function removeEntity(_0xd79f40,_0x5d1d42){return function(_0x2a6f35){if(_0x2a6f35){return _0x2a6f35[_0x4cc5('0x23')]()[_0x4cc5('0x22')](function(){_0xd79f40[_0x4cc5('0x18')](0xcc)[_0x4cc5('0x24')]();});}};}function handleEntityNotFound(_0x45819e,_0x447882){return function(_0x3226b0){if(!_0x3226b0){_0x45819e[_0x4cc5('0x17')](0x194);}return _0x3226b0;};}function handleError(_0x27f3ce,_0x167b26){_0x167b26=_0x167b26||0x1f4;return function(_0x139c5d){logger[_0x4cc5('0x25')](_0x139c5d[_0x4cc5('0x26')]);if(_0x139c5d[_0x4cc5('0x27')]){delete _0x139c5d['name'];}_0x27f3ce['status'](_0x167b26)[_0x4cc5('0x28')](_0x139c5d);};}exports[_0x4cc5('0x29')]=function(_0x53b61a,_0x21fbde){var _0x223efe={},_0x2163f2={},_0x4baf9c={'count':0x0,'rows':[]};var _0x227352=_[_0x4cc5('0x2a')](db[_0x4cc5('0x2b')][_0x4cc5('0x2c')],function(_0x2b31dd){return{'name':_0x2b31dd['fieldName'],'type':_0x2b31dd[_0x4cc5('0x2d')][_0x4cc5('0x2e')]};});_0x2163f2['model']=_[_0x4cc5('0x2a')](_0x227352,_0x4cc5('0x27'));_0x2163f2[_0x4cc5('0x2f')]=_[_0x4cc5('0x30')](_0x53b61a[_0x4cc5('0x2f')]);_0x2163f2[_0x4cc5('0x31')]=_[_0x4cc5('0x32')](_0x2163f2[_0x4cc5('0x33')],_0x2163f2[_0x4cc5('0x2f')]);_0x223efe[_0x4cc5('0x34')]=_[_0x4cc5('0x32')](_0x2163f2[_0x4cc5('0x33')],qs[_0x4cc5('0x35')](_0x53b61a[_0x4cc5('0x2f')][_0x4cc5('0x35')]));_0x223efe[_0x4cc5('0x34')]=_0x223efe[_0x4cc5('0x34')][_0x4cc5('0x36')]?_0x223efe[_0x4cc5('0x34')]:_0x2163f2[_0x4cc5('0x33')];if(!_0x53b61a[_0x4cc5('0x2f')][_0x4cc5('0x37')](_0x4cc5('0x38'))){_0x223efe[_0x4cc5('0x39')]=qs[_0x4cc5('0x39')](_0x53b61a['query'][_0x4cc5('0x39')]);_0x223efe[_0x4cc5('0x1a')]=qs[_0x4cc5('0x1a')](_0x53b61a[_0x4cc5('0x2f')][_0x4cc5('0x1a')]);}_0x223efe[_0x4cc5('0x3a')]=qs[_0x4cc5('0x3b')](_0x53b61a[_0x4cc5('0x2f')]['sort']);_0x223efe[_0x4cc5('0x3c')]=qs[_0x4cc5('0x31')](_[_0x4cc5('0x3d')](_0x53b61a['query'],_0x2163f2[_0x4cc5('0x31')]),_0x227352);if(_0x53b61a[_0x4cc5('0x2f')][_0x4cc5('0x3e')]){_0x223efe['where']=_[_0x4cc5('0x3f')](_0x223efe[_0x4cc5('0x3c')],{'$or':_[_0x4cc5('0x2a')](_0x227352,function(_0x44eb31){if(_0x44eb31[_0x4cc5('0x2d')]!==_0x4cc5('0x40')){var _0x22eb2a={};_0x22eb2a[_0x44eb31[_0x4cc5('0x27')]]={'$like':'%'+_0x53b61a[_0x4cc5('0x2f')]['filter']+'%'};return _0x22eb2a;}})});}_0x223efe=_['merge']({},_0x223efe,_0x53b61a[_0x4cc5('0x41')]);var _0x3ab509={'where':_0x223efe[_0x4cc5('0x3c')]};return db['OpenchannelQueueReport'][_0x4cc5('0x1b')](_0x3ab509)[_0x4cc5('0x22')](function(_0x279b4c){_0x4baf9c['count']=_0x279b4c;if(_0x53b61a[_0x4cc5('0x2f')][_0x4cc5('0x42')]){_0x223efe['include']=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x223efe);})[_0x4cc5('0x22')](function(_0x25e056){_0x4baf9c[_0x4cc5('0x43')]=_0x25e056;return _0x4baf9c;})[_0x4cc5('0x22')](respondWithFilteredResult(_0x21fbde,_0x223efe))[_0x4cc5('0x44')](handleError(_0x21fbde,null));};exports['show']=function(_0x52543b,_0x23013b){var _0x2d3476={'raw':!![],'where':{'id':_0x52543b[_0x4cc5('0x45')]['id']}},_0x19b774={};_0x19b774[_0x4cc5('0x33')]=_[_0x4cc5('0x30')](db['OpenchannelQueueReport']['rawAttributes']);_0x19b774[_0x4cc5('0x2f')]=_['keys'](_0x52543b[_0x4cc5('0x2f')]);_0x19b774[_0x4cc5('0x31')]=_[_0x4cc5('0x32')](_0x19b774['model'],_0x19b774['query']);_0x2d3476[_0x4cc5('0x34')]=_['intersection'](_0x19b774[_0x4cc5('0x33')],qs['fields'](_0x52543b[_0x4cc5('0x2f')]['fields']));_0x2d3476['attributes']=_0x2d3476[_0x4cc5('0x34')]['length']?_0x2d3476[_0x4cc5('0x34')]:_0x19b774['model'];if(_0x52543b[_0x4cc5('0x2f')]['includeAll']){_0x2d3476[_0x4cc5('0x46')]=[{'all':!![]}];}_0x2d3476=_[_0x4cc5('0x3f')]({},_0x2d3476,_0x52543b[_0x4cc5('0x41')]);return db[_0x4cc5('0x2b')]['find'](_0x2d3476)[_0x4cc5('0x22')](handleEntityNotFound(_0x23013b,null))['then'](respondWithResult(_0x23013b,null))[_0x4cc5('0x44')](handleError(_0x23013b,null));};exports[_0x4cc5('0x47')]=function(_0x26d08b,_0xeae135){return db[_0x4cc5('0x2b')]['create'](_0x26d08b[_0x4cc5('0x48')],{})[_0x4cc5('0x22')](respondWithResult(_0xeae135,0xc9))[_0x4cc5('0x44')](handleError(_0xeae135,null));};exports[_0x4cc5('0x21')]=function(_0x1c81b6,_0x2e6c0e){if(_0x1c81b6[_0x4cc5('0x48')]['id']){delete _0x1c81b6[_0x4cc5('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x4cc5('0x49')]({'where':{'id':_0x1c81b6[_0x4cc5('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e6c0e,null))[_0x4cc5('0x22')](saveUpdates(_0x1c81b6[_0x4cc5('0x48')],null))[_0x4cc5('0x22')](respondWithResult(_0x2e6c0e,null))[_0x4cc5('0x44')](handleError(_0x2e6c0e,null));};exports[_0x4cc5('0x23')]=function(_0x3c0188,_0x5f029c){return db[_0x4cc5('0x2b')][_0x4cc5('0x49')]({'where':{'id':_0x3c0188[_0x4cc5('0x45')]['id']}})[_0x4cc5('0x22')](handleEntityNotFound(_0x5f029c,null))[_0x4cc5('0x22')](removeEntity(_0x5f029c,null))[_0x4cc5('0x44')](handleError(_0x5f029c,null));};exports[_0x4cc5('0x4a')]=function(_0x229023,_0x22aaf8){return db['OpenchannelQueueReport'][_0x4cc5('0x4a')]()[_0x4cc5('0x22')](respondWithResult(_0x22aaf8,null))[_0x4cc5('0x44')](handleError(_0x22aaf8,null));}; \ No newline at end of file +var _0xe7a2=['query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','options','count','includeAll','include','findAll','catch','show','create','body','params','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','reject','save','update','then','error','stack','name','send','map','OpenchannelQueueReport','type','key'];(function(_0x536c8c,_0x5d7f2f){var _0x5494e1=function(_0x14f1dc){while(--_0x14f1dc){_0x536c8c['push'](_0x536c8c['shift']());}};_0x5494e1(++_0x5d7f2f);}(_0xe7a2,0x1c4));var _0x2e7a=function(_0x1d7d68,_0x4a407d){_0x1d7d68=_0x1d7d68-0x0;var _0x456c44=_0xe7a2[_0x1d7d68];return _0x456c44;};'use strict';var emlformat=require(_0x2e7a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e7a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e7a('0x2'));var moment=require('moment');var BPromise=require(_0x2e7a('0x3'));var Mustache=require(_0x2e7a('0x4'));var util=require('util');var path=require(_0x2e7a('0x5'));var sox=require('sox');var csv=require(_0x2e7a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e7a('0x7'));var _=require(_0x2e7a('0x8'));var squel=require(_0x2e7a('0x9'));var crypto=require(_0x2e7a('0xa'));var jsforce=require(_0x2e7a('0xb'));var deskjs=require(_0x2e7a('0xc'));var toCsv=require(_0x2e7a('0x6'));var querystring=require(_0x2e7a('0xd'));var Papa=require(_0x2e7a('0xe'));var Redis=require('ioredis');var authService=require(_0x2e7a('0xf'));var qs=require(_0x2e7a('0x10'));var as=require(_0x2e7a('0x11'));var hardwareService=require(_0x2e7a('0x12'));var logger=require(_0x2e7a('0x13'))('api');var utils=require(_0x2e7a('0x14'));var config=require(_0x2e7a('0x15'));var licenseUtil=require(_0x2e7a('0x16'));var db=require(_0x2e7a('0x17'))['db'];function respondWithStatusCode(_0x3419b2,_0x3b492e){_0x3b492e=_0x3b492e||0xcc;return function(_0x1cde98){if(_0x1cde98){return _0x3419b2[_0x2e7a('0x18')](_0x3b492e);}return _0x3419b2[_0x2e7a('0x19')](_0x3b492e)[_0x2e7a('0x1a')]();};}function respondWithResult(_0x1ee63e,_0x4b5811){_0x4b5811=_0x4b5811||0xc8;return function(_0x47dcdd){if(_0x47dcdd){return _0x1ee63e['status'](_0x4b5811)['json'](_0x47dcdd);}};}function respondWithFilteredResult(_0x1ba802,_0x1110ec){return function(_0x2d5443){if(_0x2d5443){var _0x58a003=typeof _0x1110ec['offset']===_0x2e7a('0x1b')&&typeof _0x1110ec[_0x2e7a('0x1c')]===_0x2e7a('0x1b');var _0x5bce56=_0x2d5443['count'];var _0x5b818e=_0x58a003?0x0:_0x1110ec['offset'];var _0x2b1142=_0x58a003?_0x2d5443['count']:_0x1110ec[_0x2e7a('0x1d')]+_0x1110ec[_0x2e7a('0x1c')];var _0x2cf836;if(_0x2b1142>=_0x5bce56){_0x2b1142=_0x5bce56;_0x2cf836=0xc8;}else{_0x2cf836=0xce;}_0x1ba802[_0x2e7a('0x19')](_0x2cf836);return _0x1ba802[_0x2e7a('0x1e')](_0x2e7a('0x1f'),_0x5b818e+'-'+_0x2b1142+'/'+_0x5bce56)[_0x2e7a('0x20')](_0x2d5443);}return null;};}function patchUpdates(_0x250f4e){return function(_0x265e89){try{jsonpatch['apply'](_0x265e89,_0x250f4e,!![]);}catch(_0x38cea4){return BPromise[_0x2e7a('0x21')](_0x38cea4);}return _0x265e89[_0x2e7a('0x22')]();};}function saveUpdates(_0x285dc2,_0x26f08e){return function(_0x1f01d2){if(_0x1f01d2){return _0x1f01d2[_0x2e7a('0x23')](_0x285dc2)[_0x2e7a('0x24')](function(_0xbff2b3){return _0xbff2b3;});}return null;};}function removeEntity(_0x4a392e,_0x42d978){return function(_0x2bf752){if(_0x2bf752){return _0x2bf752['destroy']()[_0x2e7a('0x24')](function(){_0x4a392e[_0x2e7a('0x19')](0xcc)[_0x2e7a('0x1a')]();});}};}function handleEntityNotFound(_0x264c6f,_0xe5e85e){return function(_0x65ecb2){if(!_0x65ecb2){_0x264c6f[_0x2e7a('0x18')](0x194);}return _0x65ecb2;};}function handleError(_0x8fbd7e,_0x191aa0){_0x191aa0=_0x191aa0||0x1f4;return function(_0x47d654){logger[_0x2e7a('0x25')](_0x47d654[_0x2e7a('0x26')]);if(_0x47d654['name']){delete _0x47d654[_0x2e7a('0x27')];}_0x8fbd7e['status'](_0x191aa0)[_0x2e7a('0x28')](_0x47d654);};}exports['index']=function(_0x45d1ba,_0x37eb89){var _0x46b01e={},_0x17c04f={},_0x50407c={'count':0x0,'rows':[]};var _0x506635=_[_0x2e7a('0x29')](db[_0x2e7a('0x2a')]['rawAttributes'],function(_0x37bb5f){return{'name':_0x37bb5f['fieldName'],'type':_0x37bb5f[_0x2e7a('0x2b')][_0x2e7a('0x2c')]};});_0x17c04f['model']=_[_0x2e7a('0x29')](_0x506635,'name');_0x17c04f[_0x2e7a('0x2d')]=_[_0x2e7a('0x2e')](_0x45d1ba[_0x2e7a('0x2d')]);_0x17c04f[_0x2e7a('0x2f')]=_['intersection'](_0x17c04f[_0x2e7a('0x30')],_0x17c04f[_0x2e7a('0x2d')]);_0x46b01e[_0x2e7a('0x31')]=_[_0x2e7a('0x32')](_0x17c04f[_0x2e7a('0x30')],qs[_0x2e7a('0x33')](_0x45d1ba[_0x2e7a('0x2d')]['fields']));_0x46b01e[_0x2e7a('0x31')]=_0x46b01e[_0x2e7a('0x31')][_0x2e7a('0x34')]?_0x46b01e[_0x2e7a('0x31')]:_0x17c04f[_0x2e7a('0x30')];if(!_0x45d1ba[_0x2e7a('0x2d')]['hasOwnProperty'](_0x2e7a('0x35'))){_0x46b01e['limit']=qs[_0x2e7a('0x1c')](_0x45d1ba[_0x2e7a('0x2d')]['limit']);_0x46b01e[_0x2e7a('0x1d')]=qs[_0x2e7a('0x1d')](_0x45d1ba[_0x2e7a('0x2d')][_0x2e7a('0x1d')]);}_0x46b01e[_0x2e7a('0x36')]=qs[_0x2e7a('0x37')](_0x45d1ba[_0x2e7a('0x2d')][_0x2e7a('0x37')]);_0x46b01e[_0x2e7a('0x38')]=qs[_0x2e7a('0x2f')](_[_0x2e7a('0x39')](_0x45d1ba[_0x2e7a('0x2d')],_0x17c04f[_0x2e7a('0x2f')]),_0x506635);if(_0x45d1ba[_0x2e7a('0x2d')]['filter']){_0x46b01e[_0x2e7a('0x38')]=_['merge'](_0x46b01e[_0x2e7a('0x38')],{'$or':_[_0x2e7a('0x29')](_0x506635,function(_0x15850f){if(_0x15850f[_0x2e7a('0x2b')]!=='VIRTUAL'){var _0x962634={};_0x962634[_0x15850f[_0x2e7a('0x27')]]={'$like':'%'+_0x45d1ba['query']['filter']+'%'};return _0x962634;}})});}_0x46b01e=_[_0x2e7a('0x3a')]({},_0x46b01e,_0x45d1ba[_0x2e7a('0x3b')]);var _0x309a88={'where':_0x46b01e['where']};return db[_0x2e7a('0x2a')][_0x2e7a('0x3c')](_0x309a88)[_0x2e7a('0x24')](function(_0x5cec2d){_0x50407c[_0x2e7a('0x3c')]=_0x5cec2d;if(_0x45d1ba['query'][_0x2e7a('0x3d')]){_0x46b01e[_0x2e7a('0x3e')]=[{'all':!![]}];}return db[_0x2e7a('0x2a')][_0x2e7a('0x3f')](_0x46b01e);})[_0x2e7a('0x24')](function(_0x36e827){_0x50407c['rows']=_0x36e827;return _0x50407c;})[_0x2e7a('0x24')](respondWithFilteredResult(_0x37eb89,_0x46b01e))[_0x2e7a('0x40')](handleError(_0x37eb89,null));};exports[_0x2e7a('0x41')]=function(_0x457036,_0x126a3f){var _0x21df5d={'raw':!![],'where':{'id':_0x457036['params']['id']}},_0x1f31a7={};_0x1f31a7[_0x2e7a('0x30')]=_[_0x2e7a('0x2e')](db['OpenchannelQueueReport']['rawAttributes']);_0x1f31a7[_0x2e7a('0x2d')]=_[_0x2e7a('0x2e')](_0x457036[_0x2e7a('0x2d')]);_0x1f31a7[_0x2e7a('0x2f')]=_[_0x2e7a('0x32')](_0x1f31a7[_0x2e7a('0x30')],_0x1f31a7['query']);_0x21df5d[_0x2e7a('0x31')]=_[_0x2e7a('0x32')](_0x1f31a7[_0x2e7a('0x30')],qs['fields'](_0x457036[_0x2e7a('0x2d')][_0x2e7a('0x33')]));_0x21df5d[_0x2e7a('0x31')]=_0x21df5d[_0x2e7a('0x31')][_0x2e7a('0x34')]?_0x21df5d[_0x2e7a('0x31')]:_0x1f31a7[_0x2e7a('0x30')];if(_0x457036['query'][_0x2e7a('0x3d')]){_0x21df5d[_0x2e7a('0x3e')]=[{'all':!![]}];}_0x21df5d=_[_0x2e7a('0x3a')]({},_0x21df5d,_0x457036[_0x2e7a('0x3b')]);return db['OpenchannelQueueReport']['find'](_0x21df5d)['then'](handleEntityNotFound(_0x126a3f,null))[_0x2e7a('0x24')](respondWithResult(_0x126a3f,null))['catch'](handleError(_0x126a3f,null));};exports[_0x2e7a('0x42')]=function(_0xabf67e,_0xa98255){return db[_0x2e7a('0x2a')][_0x2e7a('0x42')](_0xabf67e[_0x2e7a('0x43')],{})[_0x2e7a('0x24')](respondWithResult(_0xa98255,0xc9))[_0x2e7a('0x40')](handleError(_0xa98255,null));};exports['update']=function(_0x393ec4,_0x1e159f){if(_0x393ec4[_0x2e7a('0x43')]['id']){delete _0x393ec4['body']['id'];}return db[_0x2e7a('0x2a')]['find']({'where':{'id':_0x393ec4[_0x2e7a('0x44')]['id']}})[_0x2e7a('0x24')](handleEntityNotFound(_0x1e159f,null))['then'](saveUpdates(_0x393ec4[_0x2e7a('0x43')],null))[_0x2e7a('0x24')](respondWithResult(_0x1e159f,null))[_0x2e7a('0x40')](handleError(_0x1e159f,null));};exports[_0x2e7a('0x45')]=function(_0x2d63f5,_0x53c393){return db[_0x2e7a('0x2a')]['find']({'where':{'id':_0x2d63f5[_0x2e7a('0x44')]['id']}})[_0x2e7a('0x24')](handleEntityNotFound(_0x53c393,null))[_0x2e7a('0x24')](removeEntity(_0x53c393,null))['catch'](handleError(_0x53c393,null));};exports[_0x2e7a('0x46')]=function(_0x50ed58,_0xf7cce4){return db[_0x2e7a('0x2a')]['describe']()[_0x2e7a('0x24')](respondWithResult(_0xf7cce4,null))[_0x2e7a('0x40')](handleError(_0xf7cce4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4444f84..20dff5d 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(_0x1df141,_0x313333){var _0x3a6df6=function(_0xcb5f6c){while(--_0xcb5f6c){_0x1df141['push'](_0x1df141['shift']());}};_0x3a6df6(++_0x313333);}(_0xe14b,0x93));var _0xbe14=function(_0x3fb3f9,_0x204379){_0x3fb3f9=_0x3fb3f9-0x0;var _0x35f8f7=_0xe14b[_0x3fb3f9];return _0x35f8f7;};'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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x2b5468,_0x3bbcfd){var _0x45f396=function(_0x94beb0){while(--_0x94beb0){_0x2b5468['push'](_0x2b5468['shift']());}};_0x45f396(++_0x3bbcfd);}(_0xe14b,0x93));var _0xbe14=function(_0x2424ba,_0x59dc8f){_0x2424ba=_0x2424ba-0x0;var _0x2188d3=_0xe14b[_0x2424ba];return _0x2188d3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 6a93113..5df0397 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 _0xc7da=['update','body','where','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','stringify','UpdateOpenchannelQueueReport'];(function(_0x3c3698,_0xa0bf08){var _0x4e6637=function(_0x1fc9a4){while(--_0x1fc9a4){_0x3c3698['push'](_0x3c3698['shift']());}};_0x4e6637(++_0xa0bf08);}(_0xc7da,0xf2));var _0xac7d=function(_0x5ca674,_0x58b5fd){_0x5ca674=_0x5ca674-0x0;var _0x4fe980=_0xc7da[_0x5ca674];return _0x4fe980;};'use strict';var _=require(_0xac7d('0x0'));var util=require(_0xac7d('0x1'));var moment=require(_0xac7d('0x2'));var BPromise=require('bluebird');var rs=require(_0xac7d('0x3'));var fs=require('fs');var Redis=require(_0xac7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac7d('0x5'));var logger=require(_0xac7d('0x6'))('rpc');var config=require(_0xac7d('0x7'));var jayson=require(_0xac7d('0x8'));var client=jayson[_0xac7d('0x9')][_0xac7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x268265,_0x153ce5,_0x48ca59){return new BPromise(function(_0x44eb2b,_0x457e2d){return client[_0xac7d('0xb')](_0x268265,_0x48ca59)[_0xac7d('0xc')](function(_0x217811){logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');logger[_0xac7d('0xf')](_0xac7d('0x10'),_0x153ce5,_0xac7d('0x11'),JSON['stringify'](_0x217811));if(_0x217811[_0xac7d('0x12')]){if(_0x217811[_0xac7d('0x12')][_0xac7d('0x13')]===0x1f4){logger[_0xac7d('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);return _0x457e2d(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}logger[_0xac7d('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x153ce5,_0x217811[_0xac7d('0x12')]['message']);return _0x44eb2b(_0x217811[_0xac7d('0x12')][_0xac7d('0x14')]);}else{logger[_0xac7d('0xd')](_0xac7d('0xe'),_0x153ce5,'request\x20sent');_0x44eb2b(_0x217811[_0xac7d('0x15')][_0xac7d('0x14')]);}})[_0xac7d('0x16')](function(_0x12813a){logger[_0xac7d('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x153ce5,_0x12813a);_0x457e2d(_0x12813a);});});}exports[_0xac7d('0x17')]=function(_0x3cb12d){var _0x563634=this;return new Promise(function(_0x2e4790,_0x2d2494){return db[_0xac7d('0x18')][_0xac7d('0x19')](_0x3cb12d['body'],{'raw':_0x3cb12d[_0xac7d('0x1a')]?_0x3cb12d[_0xac7d('0x1a')][_0xac7d('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xd42c40){logger['info'](_0xac7d('0x17'),_0x3cb12d);logger[_0xac7d('0xf')](_0xac7d('0x17'),_0x3cb12d,JSON[_0xac7d('0x1c')](_0xd42c40));_0x2e4790(_0xd42c40);})[_0xac7d('0x16')](function(_0x365269){logger['error']('CreateOpenchannelQueueReport',_0x365269[_0xac7d('0x14')],_0x3cb12d);_0x2d2494(_0x563634[_0xac7d('0x12')](0x1f4,_0x365269['message']));});});};exports[_0xac7d('0x1d')]=function(_0x3966dd){var _0x2a5774=this;return new Promise(function(_0x1c1f88,_0x43aa8e){return db[_0xac7d('0x18')][_0xac7d('0x1e')](_0x3966dd[_0xac7d('0x1f')],{'raw':_0x3966dd[_0xac7d('0x1a')]?_0x3966dd[_0xac7d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3966dd[_0xac7d('0x1a')]?_0x3966dd[_0xac7d('0x1a')][_0xac7d('0x20')]||null:null,'attributes':_0x3966dd[_0xac7d('0x1a')]?_0x3966dd['options']['attributes']||null:null,'limit':_0x3966dd['options']?_0x3966dd[_0xac7d('0x1a')][_0xac7d('0x21')]||null:null})[_0xac7d('0xc')](function(_0x5bd39b){logger[_0xac7d('0xd')]('UpdateOpenchannelQueueReport',_0x3966dd);logger['debug']('UpdateOpenchannelQueueReport',_0x3966dd,JSON['stringify'](_0x5bd39b));_0x1c1f88(_0x5bd39b);})['catch'](function(_0x104186){logger[_0xac7d('0x12')](_0xac7d('0x1d'),_0x104186[_0xac7d('0x14')],_0x3966dd);_0x43aa8e(_0x2a5774[_0xac7d('0x12')](0x1f4,_0x104186['message']));});});}; \ No newline at end of file +var _0x087b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','create','body','options','CreateOpenchannelQueueReport','catch','UpdateOpenchannelQueueReport','raw','where','attributes','limit','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c8b7e,_0x48e2f6){var _0xb87ff7=function(_0x114a21){while(--_0x114a21){_0x1c8b7e['push'](_0x1c8b7e['shift']());}};_0xb87ff7(++_0x48e2f6);}(_0x087b,0x11a));var _0xb087=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x087b[_0x19b3f9];return _0x18c3f6;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['CreateOpenchannelQueueReport']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['OpenchannelQueueReport'][_0xb087('0x16')](_0x330005[_0xb087('0x17')],{'raw':_0x330005[_0xb087('0x18')]?_0x330005[_0xb087('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ea3dc){logger['info'](_0xb087('0x19'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x19'),_0x330005,JSON[_0xb087('0x11')](_0x5ea3dc));_0x17200d(_0x5ea3dc);})[_0xb087('0x1a')](function(_0x258b4c){logger[_0xb087('0x12')]('CreateOpenchannelQueueReport',_0x258b4c[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x258b4c[_0xb087('0x14')]));});});};exports[_0xb087('0x1b')]=function(_0x3ad74e){var _0x4d9028=this;return new Promise(function(_0x183eab,_0xdd4216){return db['OpenchannelQueueReport']['update'](_0x3ad74e['body'],{'raw':_0x3ad74e['options']?_0x3ad74e['options'][_0xb087('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad74e[_0xb087('0x18')]?_0x3ad74e[_0xb087('0x18')][_0xb087('0x1d')]||null:null,'attributes':_0x3ad74e[_0xb087('0x18')]?_0x3ad74e[_0xb087('0x18')][_0xb087('0x1e')]||null:null,'limit':_0x3ad74e[_0xb087('0x18')]?_0x3ad74e[_0xb087('0x18')][_0xb087('0x1f')]||null:null})[_0xb087('0xc')](function(_0x31e3e6){logger[_0xb087('0xd')](_0xb087('0x1b'),_0x3ad74e);logger['debug'](_0xb087('0x1b'),_0x3ad74e,JSON[_0xb087('0x11')](_0x31e3e6));_0x183eab(_0x31e3e6);})[_0xb087('0x1a')](function(_0x15c9ac){logger[_0xb087('0x12')](_0xb087('0x1b'),_0x15c9ac[_0xb087('0x14')],_0x3ad74e);_0xdd4216(_0x4d9028[_0xb087('0x12')](0x1f4,_0x15c9ac['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 3efef22..7a8e992 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 _0x65ca=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0x387b02,_0x20f5ae){var _0x2363a4=function(_0xdd489d){while(--_0xdd489d){_0x387b02['push'](_0x387b02['shift']());}};_0x2363a4(++_0x20f5ae);}(_0x65ca,0xdd));var _0xa65c=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x65ca[_0x466bc5];return _0x138952;};'use strict';var multer=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var path=require(_0xa65c('0x2'));var timeout=require(_0xa65c('0x3'));var express=require(_0xa65c('0x4'));var router=express[_0xa65c('0x5')]();var fs_extra=require(_0xa65c('0x6'));var auth=require(_0xa65c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa65c('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0xa65c('0x9')]('/',auth[_0xa65c('0xa')](),controller[_0xa65c('0xb')]);router[_0xa65c('0x9')]('/describe',auth[_0xa65c('0xa')](),controller[_0xa65c('0xc')]);router[_0xa65c('0x9')](_0xa65c('0xd'),auth[_0xa65c('0xa')](),controller[_0xa65c('0xe')]);router[_0xa65c('0xf')]('/',auth[_0xa65c('0xa')](),controller[_0xa65c('0x10')]);router[_0xa65c('0x11')](_0xa65c('0xd'),auth[_0xa65c('0xa')](),controller[_0xa65c('0x12')]);router[_0xa65c('0x13')](_0xa65c('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4c4b=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x4620fa,_0x4a9f4c){var _0x2ac724=function(_0x336e45){while(--_0x336e45){_0x4620fa['push'](_0x4620fa['shift']());}};_0x2ac724(++_0x4a9f4c);}(_0x4c4b,0xe5));var _0xb4c4=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0x4c4b[_0x405385];return _0x43837b;};'use strict';var multer=require(_0xb4c4('0x0'));var util=require(_0xb4c4('0x1'));var path=require(_0xb4c4('0x2'));var timeout=require(_0xb4c4('0x3'));var express=require(_0xb4c4('0x4'));var router=express[_0xb4c4('0x5')]();var fs_extra=require(_0xb4c4('0x6'));var auth=require(_0xb4c4('0x7'));var interaction=require(_0xb4c4('0x8'));var config=require(_0xb4c4('0x9'));var controller=require(_0xb4c4('0xa'));router[_0xb4c4('0xb')]('/',auth[_0xb4c4('0xc')](),controller[_0xb4c4('0xd')]);router[_0xb4c4('0xb')](_0xb4c4('0xe'),auth[_0xb4c4('0xc')](),controller[_0xb4c4('0xf')]);router[_0xb4c4('0xb')](_0xb4c4('0x10'),auth[_0xb4c4('0xc')](),controller[_0xb4c4('0x11')]);router['post']('/',auth[_0xb4c4('0xc')](),controller[_0xb4c4('0x12')]);router[_0xb4c4('0x13')](_0xb4c4('0x10'),auth[_0xb4c4('0xc')](),controller[_0xb4c4('0x14')]);router[_0xb4c4('0x15')]('/:id',auth[_0xb4c4('0xc')](),controller['destroy']);module[_0xb4c4('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 62d9a66..9ca450e 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x8c3c9e,_0x5669c0){var _0x3ab3ec=function(_0x49b629){while(--_0x49b629){_0x8c3c9e['push'](_0x8c3c9e['shift']());}};_0x3ab3ec(++_0x5669c0);}(_0x4b84,0x1cc));var _0x44b8=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0x4b84[_0x435fa1];return _0x845f9f;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x1f6193,_0x2de9ff){var _0x160297=function(_0x33df3b){while(--_0x33df3b){_0x1f6193['push'](_0x1f6193['shift']());}};_0x160297(++_0x2de9ff);}(_0x54ef,0x112));var _0xf54e=function(_0x1293c1,_0x5d66e8){_0x1293c1=_0x1293c1-0x0;var _0x283692=_0x54ef[_0x1293c1];return _0x283692;};'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/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index ef9f06d..b085c2d 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 _0xce07=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','error','name','send','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','intersection','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../config/license/hardware','../../config/utils'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0xce07,0x188));var _0x7ce0=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xce07[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7ce0('0x0'));var jsonpatch=require(_0x7ce0('0x1'));var rp=require(_0x7ce0('0x2'));var moment=require(_0x7ce0('0x3'));var BPromise=require(_0x7ce0('0x4'));var Mustache=require('mustache');var util=require(_0x7ce0('0x5'));var path=require('path');var sox=require(_0x7ce0('0x6'));var csv=require(_0x7ce0('0x7'));var ejs=require(_0x7ce0('0x8'));var fs=require('fs');var fs_extra=require(_0x7ce0('0x9'));var _=require(_0x7ce0('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7ce0('0xb'));var toCsv=require(_0x7ce0('0x7'));var querystring=require(_0x7ce0('0xc'));var Papa=require('papaparse');var Redis=require(_0x7ce0('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ce0('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x7ce0('0xf'));var config=require(_0x7ce0('0x10'));var licenseUtil=require(_0x7ce0('0x11'));var db=require(_0x7ce0('0x12'))['db'];function respondWithStatusCode(_0x12681b,_0x4c43f7){_0x4c43f7=_0x4c43f7||0xcc;return function(_0x487e51){if(_0x487e51){return _0x12681b[_0x7ce0('0x13')](_0x4c43f7);}return _0x12681b[_0x7ce0('0x14')](_0x4c43f7)[_0x7ce0('0x15')]();};}function respondWithResult(_0x4a4897,_0x2bf015){_0x2bf015=_0x2bf015||0xc8;return function(_0x539a69){if(_0x539a69){return _0x4a4897['status'](_0x2bf015)['json'](_0x539a69);}};}function respondWithFilteredResult(_0x2aa4c9,_0x347e43){return function(_0x479848){if(_0x479848){var _0x2ba668=typeof _0x347e43[_0x7ce0('0x16')]===_0x7ce0('0x17')&&typeof _0x347e43['limit']===_0x7ce0('0x17');var _0x557b1a=_0x479848[_0x7ce0('0x18')];var _0x2a8041=_0x2ba668?0x0:_0x347e43[_0x7ce0('0x16')];var _0x5f3052=_0x2ba668?_0x479848[_0x7ce0('0x18')]:_0x347e43[_0x7ce0('0x16')]+_0x347e43[_0x7ce0('0x19')];var _0x3d7932;if(_0x5f3052>=_0x557b1a){_0x5f3052=_0x557b1a;_0x3d7932=0xc8;}else{_0x3d7932=0xce;}_0x2aa4c9['status'](_0x3d7932);return _0x2aa4c9[_0x7ce0('0x1a')]('Content-Range',_0x2a8041+'-'+_0x5f3052+'/'+_0x557b1a)[_0x7ce0('0x1b')](_0x479848);}return null;};}function patchUpdates(_0x1f9c8e){return function(_0x438730){try{jsonpatch[_0x7ce0('0x1c')](_0x438730,_0x1f9c8e,!![]);}catch(_0x4cfbda){return BPromise[_0x7ce0('0x1d')](_0x4cfbda);}return _0x438730[_0x7ce0('0x1e')]();};}function saveUpdates(_0x2468d7,_0x1701e6){return function(_0x275fc8){if(_0x275fc8){return _0x275fc8['update'](_0x2468d7)[_0x7ce0('0x1f')](function(_0xf3e317){return _0xf3e317;});}return null;};}function removeEntity(_0x1209a1,_0x130aba){return function(_0x5d0e00){if(_0x5d0e00){return _0x5d0e00[_0x7ce0('0x20')]()['then'](function(){_0x1209a1[_0x7ce0('0x14')](0xcc)[_0x7ce0('0x15')]();});}};}function handleEntityNotFound(_0x72f0b,_0x3b7d15){return function(_0x7b0478){if(!_0x7b0478){_0x72f0b[_0x7ce0('0x13')](0x194);}return _0x7b0478;};}function handleError(_0x4b5883,_0x30b721){_0x30b721=_0x30b721||0x1f4;return function(_0x442164){logger[_0x7ce0('0x21')](_0x442164['stack']);if(_0x442164[_0x7ce0('0x22')]){delete _0x442164[_0x7ce0('0x22')];}_0x4b5883[_0x7ce0('0x14')](_0x30b721)[_0x7ce0('0x23')](_0x442164);};}exports['index']=function(_0x55e7b7,_0xeb15b3){var _0x25f2eb={},_0x3d6748={},_0x229474={'count':0x0,'rows':[]};var _0x5cc716=_[_0x7ce0('0x24')](db[_0x7ce0('0x25')]['rawAttributes'],function(_0x58daf3){return{'name':_0x58daf3[_0x7ce0('0x26')],'type':_0x58daf3[_0x7ce0('0x27')][_0x7ce0('0x28')]};});_0x3d6748[_0x7ce0('0x29')]=_[_0x7ce0('0x24')](_0x5cc716,'name');_0x3d6748[_0x7ce0('0x2a')]=_[_0x7ce0('0x2b')](_0x55e7b7[_0x7ce0('0x2a')]);_0x3d6748[_0x7ce0('0x2c')]=_['intersection'](_0x3d6748[_0x7ce0('0x29')],_0x3d6748[_0x7ce0('0x2a')]);_0x25f2eb['attributes']=_['intersection'](_0x3d6748[_0x7ce0('0x29')],qs[_0x7ce0('0x2d')](_0x55e7b7[_0x7ce0('0x2a')][_0x7ce0('0x2d')]));_0x25f2eb['attributes']=_0x25f2eb[_0x7ce0('0x2e')][_0x7ce0('0x2f')]?_0x25f2eb['attributes']:_0x3d6748['model'];if(!_0x55e7b7[_0x7ce0('0x2a')][_0x7ce0('0x30')]('nolimit')){_0x25f2eb[_0x7ce0('0x19')]=qs[_0x7ce0('0x19')](_0x55e7b7[_0x7ce0('0x2a')][_0x7ce0('0x19')]);_0x25f2eb[_0x7ce0('0x16')]=qs[_0x7ce0('0x16')](_0x55e7b7[_0x7ce0('0x2a')][_0x7ce0('0x16')]);}_0x25f2eb['order']=qs[_0x7ce0('0x31')](_0x55e7b7[_0x7ce0('0x2a')]['sort']);_0x25f2eb['where']=qs[_0x7ce0('0x2c')](_[_0x7ce0('0x32')](_0x55e7b7[_0x7ce0('0x2a')],_0x3d6748[_0x7ce0('0x2c')]),_0x5cc716);if(_0x55e7b7[_0x7ce0('0x2a')][_0x7ce0('0x33')]){_0x25f2eb[_0x7ce0('0x34')]=_[_0x7ce0('0x35')](_0x25f2eb[_0x7ce0('0x34')],{'$or':_['map'](_0x5cc716,function(_0x345b41){if(_0x345b41['type']!==_0x7ce0('0x36')){var _0xe4d5a1={};_0xe4d5a1[_0x345b41[_0x7ce0('0x22')]]={'$like':'%'+_0x55e7b7['query'][_0x7ce0('0x33')]+'%'};return _0xe4d5a1;}})});}_0x25f2eb=_[_0x7ce0('0x35')]({},_0x25f2eb,_0x55e7b7[_0x7ce0('0x37')]);var _0x3862de={'where':_0x25f2eb['where']};return db[_0x7ce0('0x25')][_0x7ce0('0x18')](_0x3862de)['then'](function(_0x597256){_0x229474[_0x7ce0('0x18')]=_0x597256;if(_0x55e7b7[_0x7ce0('0x2a')][_0x7ce0('0x38')]){_0x25f2eb['include']=[{'all':!![]}];}return db[_0x7ce0('0x25')][_0x7ce0('0x39')](_0x25f2eb);})[_0x7ce0('0x1f')](function(_0x188e04){_0x229474['rows']=_0x188e04;return _0x229474;})[_0x7ce0('0x1f')](respondWithFilteredResult(_0xeb15b3,_0x25f2eb))[_0x7ce0('0x3a')](handleError(_0xeb15b3,null));};exports[_0x7ce0('0x3b')]=function(_0x2738a,_0x5272b7){var _0x3d9a75={'raw':!![],'where':{'id':_0x2738a[_0x7ce0('0x3c')]['id']}},_0x4c3b22={};_0x4c3b22[_0x7ce0('0x29')]=_[_0x7ce0('0x2b')](db[_0x7ce0('0x25')][_0x7ce0('0x3d')]);_0x4c3b22['query']=_[_0x7ce0('0x2b')](_0x2738a[_0x7ce0('0x2a')]);_0x4c3b22[_0x7ce0('0x2c')]=_['intersection'](_0x4c3b22['model'],_0x4c3b22[_0x7ce0('0x2a')]);_0x3d9a75[_0x7ce0('0x2e')]=_[_0x7ce0('0x3e')](_0x4c3b22[_0x7ce0('0x29')],qs[_0x7ce0('0x2d')](_0x2738a[_0x7ce0('0x2a')][_0x7ce0('0x2d')]));_0x3d9a75[_0x7ce0('0x2e')]=_0x3d9a75['attributes'][_0x7ce0('0x2f')]?_0x3d9a75[_0x7ce0('0x2e')]:_0x4c3b22[_0x7ce0('0x29')];if(_0x2738a[_0x7ce0('0x2a')][_0x7ce0('0x38')]){_0x3d9a75['include']=[{'all':!![]}];}_0x3d9a75=_[_0x7ce0('0x35')]({},_0x3d9a75,_0x2738a[_0x7ce0('0x37')]);return db['OpenchannelTransferReport'][_0x7ce0('0x3f')](_0x3d9a75)[_0x7ce0('0x1f')](handleEntityNotFound(_0x5272b7,null))['then'](respondWithResult(_0x5272b7,null))[_0x7ce0('0x3a')](handleError(_0x5272b7,null));};exports[_0x7ce0('0x40')]=function(_0x3a57ca,_0x57b4eb){return db[_0x7ce0('0x25')][_0x7ce0('0x40')](_0x3a57ca[_0x7ce0('0x41')],{})[_0x7ce0('0x1f')](respondWithResult(_0x57b4eb,0xc9))[_0x7ce0('0x3a')](handleError(_0x57b4eb,null));};exports[_0x7ce0('0x42')]=function(_0x13586f,_0x1040e7){if(_0x13586f[_0x7ce0('0x41')]['id']){delete _0x13586f[_0x7ce0('0x41')]['id'];}return db[_0x7ce0('0x25')][_0x7ce0('0x3f')]({'where':{'id':_0x13586f[_0x7ce0('0x3c')]['id']}})['then'](handleEntityNotFound(_0x1040e7,null))[_0x7ce0('0x1f')](saveUpdates(_0x13586f[_0x7ce0('0x41')],null))[_0x7ce0('0x1f')](respondWithResult(_0x1040e7,null))[_0x7ce0('0x3a')](handleError(_0x1040e7,null));};exports[_0x7ce0('0x20')]=function(_0x58f144,_0x24c2ef){return db['OpenchannelTransferReport'][_0x7ce0('0x3f')]({'where':{'id':_0x58f144['params']['id']}})[_0x7ce0('0x1f')](handleEntityNotFound(_0x24c2ef,null))['then'](removeEntity(_0x24c2ef,null))[_0x7ce0('0x3a')](handleError(_0x24c2ef,null));};exports['describe']=function(_0x293834,_0x343375){return db['OpenchannelTransferReport'][_0x7ce0('0x43')]()[_0x7ce0('0x1f')](respondWithResult(_0x343375,null))[_0x7ce0('0x3a')](handleError(_0x343375,null));}; \ No newline at end of file +var _0x0a43=['options','OpenchannelTransferReport','include','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x53c27a,_0x14d65d){var _0x243b8c=function(_0x1bf74e){while(--_0x1bf74e){_0x53c27a['push'](_0x53c27a['shift']());}};_0x243b8c(++_0x14d65d);}(_0x0a43,0xa2));var _0x30a4=function(_0x4b2104,_0x5f257f){_0x4b2104=_0x4b2104-0x0;var _0x2a7b9a=_0x0a43[_0x4b2104];return _0x2a7b9a;};'use strict';var emlformat=require(_0x30a4('0x0'));var rimraf=require(_0x30a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30a4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x30a4('0x3'));var Mustache=require(_0x30a4('0x4'));var util=require(_0x30a4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x30a4('0x6'));var ejs=require(_0x30a4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30a4('0x8'));var squel=require(_0x30a4('0x9'));var crypto=require(_0x30a4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x30a4('0xb'));var toCsv=require(_0x30a4('0x6'));var querystring=require('querystring');var Papa=require(_0x30a4('0xc'));var Redis=require(_0x30a4('0xd'));var authService=require(_0x30a4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x30a4('0xf'));var hardwareService=require(_0x30a4('0x10'));var logger=require(_0x30a4('0x11'))(_0x30a4('0x12'));var utils=require(_0x30a4('0x13'));var config=require(_0x30a4('0x14'));var licenseUtil=require(_0x30a4('0x15'));var db=require(_0x30a4('0x16'))['db'];function respondWithStatusCode(_0x415be9,_0x39d851){_0x39d851=_0x39d851||0xcc;return function(_0x195c34){if(_0x195c34){return _0x415be9[_0x30a4('0x17')](_0x39d851);}return _0x415be9[_0x30a4('0x18')](_0x39d851)[_0x30a4('0x19')]();};}function respondWithResult(_0x3f0843,_0x2e9597){_0x2e9597=_0x2e9597||0xc8;return function(_0x39a679){if(_0x39a679){return _0x3f0843[_0x30a4('0x18')](_0x2e9597)['json'](_0x39a679);}};}function respondWithFilteredResult(_0x3639fd,_0x39b760){return function(_0x349570){if(_0x349570){var _0x305ab9=typeof _0x39b760[_0x30a4('0x1a')]===_0x30a4('0x1b')&&typeof _0x39b760[_0x30a4('0x1c')]===_0x30a4('0x1b');var _0x3b7346=_0x349570['count'];var _0x52f356=_0x305ab9?0x0:_0x39b760[_0x30a4('0x1a')];var _0xacf9a5=_0x305ab9?_0x349570[_0x30a4('0x1d')]:_0x39b760['offset']+_0x39b760[_0x30a4('0x1c')];var _0x50a95f;if(_0xacf9a5>=_0x3b7346){_0xacf9a5=_0x3b7346;_0x50a95f=0xc8;}else{_0x50a95f=0xce;}_0x3639fd[_0x30a4('0x18')](_0x50a95f);return _0x3639fd[_0x30a4('0x1e')](_0x30a4('0x1f'),_0x52f356+'-'+_0xacf9a5+'/'+_0x3b7346)[_0x30a4('0x20')](_0x349570);}return null;};}function patchUpdates(_0x12461f){return function(_0x421464){try{jsonpatch[_0x30a4('0x21')](_0x421464,_0x12461f,!![]);}catch(_0x5a8dcd){return BPromise[_0x30a4('0x22')](_0x5a8dcd);}return _0x421464['save']();};}function saveUpdates(_0x1ec879,_0x39924f){return function(_0x58d336){if(_0x58d336){return _0x58d336[_0x30a4('0x23')](_0x1ec879)[_0x30a4('0x24')](function(_0x2f8e3b){return _0x2f8e3b;});}return null;};}function removeEntity(_0x266bb1,_0x478a87){return function(_0x232013){if(_0x232013){return _0x232013[_0x30a4('0x25')]()[_0x30a4('0x24')](function(){_0x266bb1[_0x30a4('0x18')](0xcc)[_0x30a4('0x19')]();});}};}function handleEntityNotFound(_0x293a2b,_0x384c2a){return function(_0x2cfb91){if(!_0x2cfb91){_0x293a2b[_0x30a4('0x17')](0x194);}return _0x2cfb91;};}function handleError(_0x5e8644,_0x2019e8){_0x2019e8=_0x2019e8||0x1f4;return function(_0x5761db){logger[_0x30a4('0x26')](_0x5761db['stack']);if(_0x5761db[_0x30a4('0x27')]){delete _0x5761db[_0x30a4('0x27')];}_0x5e8644[_0x30a4('0x18')](_0x2019e8)['send'](_0x5761db);};}exports[_0x30a4('0x28')]=function(_0x1cdb63,_0x5099a4){var _0x11b1a1={},_0x5d808a={},_0x52212f={'count':0x0,'rows':[]};var _0x2c42c7=_[_0x30a4('0x29')](db['OpenchannelTransferReport'][_0x30a4('0x2a')],function(_0x53b9c6){return{'name':_0x53b9c6[_0x30a4('0x2b')],'type':_0x53b9c6[_0x30a4('0x2c')][_0x30a4('0x2d')]};});_0x5d808a[_0x30a4('0x2e')]=_['map'](_0x2c42c7,'name');_0x5d808a[_0x30a4('0x2f')]=_[_0x30a4('0x30')](_0x1cdb63[_0x30a4('0x2f')]);_0x5d808a['filters']=_[_0x30a4('0x31')](_0x5d808a[_0x30a4('0x2e')],_0x5d808a[_0x30a4('0x2f')]);_0x11b1a1[_0x30a4('0x32')]=_['intersection'](_0x5d808a['model'],qs[_0x30a4('0x33')](_0x1cdb63[_0x30a4('0x2f')][_0x30a4('0x33')]));_0x11b1a1[_0x30a4('0x32')]=_0x11b1a1[_0x30a4('0x32')][_0x30a4('0x34')]?_0x11b1a1[_0x30a4('0x32')]:_0x5d808a[_0x30a4('0x2e')];if(!_0x1cdb63['query'][_0x30a4('0x35')](_0x30a4('0x36'))){_0x11b1a1['limit']=qs[_0x30a4('0x1c')](_0x1cdb63['query']['limit']);_0x11b1a1[_0x30a4('0x1a')]=qs[_0x30a4('0x1a')](_0x1cdb63[_0x30a4('0x2f')][_0x30a4('0x1a')]);}_0x11b1a1[_0x30a4('0x37')]=qs['sort'](_0x1cdb63[_0x30a4('0x2f')][_0x30a4('0x38')]);_0x11b1a1[_0x30a4('0x39')]=qs[_0x30a4('0x3a')](_[_0x30a4('0x3b')](_0x1cdb63[_0x30a4('0x2f')],_0x5d808a['filters']),_0x2c42c7);if(_0x1cdb63[_0x30a4('0x2f')][_0x30a4('0x3c')]){_0x11b1a1[_0x30a4('0x39')]=_[_0x30a4('0x3d')](_0x11b1a1[_0x30a4('0x39')],{'$or':_[_0x30a4('0x29')](_0x2c42c7,function(_0x4ef41c){if(_0x4ef41c[_0x30a4('0x2c')]!==_0x30a4('0x3e')){var _0x5245c2={};_0x5245c2[_0x4ef41c['name']]={'$like':'%'+_0x1cdb63[_0x30a4('0x2f')][_0x30a4('0x3c')]+'%'};return _0x5245c2;}})});}_0x11b1a1=_['merge']({},_0x11b1a1,_0x1cdb63[_0x30a4('0x3f')]);var _0x5ec7e2={'where':_0x11b1a1[_0x30a4('0x39')]};return db[_0x30a4('0x40')]['count'](_0x5ec7e2)[_0x30a4('0x24')](function(_0x38e972){_0x52212f[_0x30a4('0x1d')]=_0x38e972;if(_0x1cdb63[_0x30a4('0x2f')]['includeAll']){_0x11b1a1[_0x30a4('0x41')]=[{'all':!![]}];}return db[_0x30a4('0x40')]['findAll'](_0x11b1a1);})[_0x30a4('0x24')](function(_0x5205e7){_0x52212f[_0x30a4('0x42')]=_0x5205e7;return _0x52212f;})[_0x30a4('0x24')](respondWithFilteredResult(_0x5099a4,_0x11b1a1))['catch'](handleError(_0x5099a4,null));};exports[_0x30a4('0x43')]=function(_0x7c3131,_0x1ba2a5){var _0x1dc33f={'raw':!![],'where':{'id':_0x7c3131[_0x30a4('0x44')]['id']}},_0x49079a={};_0x49079a[_0x30a4('0x2e')]=_[_0x30a4('0x30')](db[_0x30a4('0x40')][_0x30a4('0x2a')]);_0x49079a[_0x30a4('0x2f')]=_[_0x30a4('0x30')](_0x7c3131[_0x30a4('0x2f')]);_0x49079a[_0x30a4('0x3a')]=_[_0x30a4('0x31')](_0x49079a[_0x30a4('0x2e')],_0x49079a[_0x30a4('0x2f')]);_0x1dc33f[_0x30a4('0x32')]=_[_0x30a4('0x31')](_0x49079a[_0x30a4('0x2e')],qs['fields'](_0x7c3131[_0x30a4('0x2f')][_0x30a4('0x33')]));_0x1dc33f[_0x30a4('0x32')]=_0x1dc33f[_0x30a4('0x32')][_0x30a4('0x34')]?_0x1dc33f[_0x30a4('0x32')]:_0x49079a[_0x30a4('0x2e')];if(_0x7c3131[_0x30a4('0x2f')][_0x30a4('0x45')]){_0x1dc33f['include']=[{'all':!![]}];}_0x1dc33f=_[_0x30a4('0x3d')]({},_0x1dc33f,_0x7c3131[_0x30a4('0x3f')]);return db['OpenchannelTransferReport'][_0x30a4('0x46')](_0x1dc33f)[_0x30a4('0x24')](handleEntityNotFound(_0x1ba2a5,null))[_0x30a4('0x24')](respondWithResult(_0x1ba2a5,null))[_0x30a4('0x47')](handleError(_0x1ba2a5,null));};exports[_0x30a4('0x48')]=function(_0x1a7210,_0x1c2ef5){return db[_0x30a4('0x40')]['create'](_0x1a7210[_0x30a4('0x49')],{})[_0x30a4('0x24')](respondWithResult(_0x1c2ef5,0xc9))[_0x30a4('0x47')](handleError(_0x1c2ef5,null));};exports[_0x30a4('0x23')]=function(_0x3ff779,_0x29368f){if(_0x3ff779['body']['id']){delete _0x3ff779[_0x30a4('0x49')]['id'];}return db['OpenchannelTransferReport'][_0x30a4('0x46')]({'where':{'id':_0x3ff779[_0x30a4('0x44')]['id']}})[_0x30a4('0x24')](handleEntityNotFound(_0x29368f,null))['then'](saveUpdates(_0x3ff779[_0x30a4('0x49')],null))[_0x30a4('0x24')](respondWithResult(_0x29368f,null))[_0x30a4('0x47')](handleError(_0x29368f,null));};exports[_0x30a4('0x25')]=function(_0x4e1aec,_0x440b5c){return db[_0x30a4('0x40')][_0x30a4('0x46')]({'where':{'id':_0x4e1aec['params']['id']}})[_0x30a4('0x24')](handleEntityNotFound(_0x440b5c,null))[_0x30a4('0x24')](removeEntity(_0x440b5c,null))[_0x30a4('0x47')](handleError(_0x440b5c,null));};exports[_0x30a4('0x4a')]=function(_0x442eb9,_0xeae6db){return db[_0x30a4('0x40')]['describe']()[_0x30a4('0x24')](respondWithResult(_0xeae6db,null))['catch'](handleError(_0xeae6db,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index b23ea14..9831cdf 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 _0x6881=['request-promise','path','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','util'];(function(_0x3d9804,_0x2195f3){var _0x4240a4=function(_0x8cfd43){while(--_0x8cfd43){_0x3d9804['push'](_0x3d9804['shift']());}};_0x4240a4(++_0x2195f3);}(_0x6881,0x12f));var _0x1688=function(_0x7987b8,_0xd6423){_0x7987b8=_0x7987b8-0x0;var _0x5e4a41=_0x6881[_0x7987b8];return _0x5e4a41;};'use strict';var _=require('lodash');var util=require(_0x1688('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1688('0x1'));var fs=require('fs');var path=require(_0x1688('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1688('0x3'));module[_0x1688('0x4')]=function(_0x31ca6c,_0x31fd71){return _0x31ca6c[_0x1688('0x5')]('OpenchannelTransferReport',attributes,{'tableName':_0x1688('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1688('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3468=['moment','bluebird','request-promise','path','rimraf','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x3eb4b3,_0x39e17e){var _0x503102=function(_0x148a33){while(--_0x148a33){_0x3eb4b3['push'](_0x3eb4b3['shift']());}};_0x503102(++_0x39e17e);}(_0x3468,0x15a));var _0x8346=function(_0x4f79ea,_0x2e131b){_0x4f79ea=_0x4f79ea-0x0;var _0x50bf29=_0x3468[_0x4f79ea];return _0x50bf29;};'use strict';var _=require(_0x8346('0x0'));var util=require(_0x8346('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8346('0x2'));var BPromise=require(_0x8346('0x3'));var rp=require(_0x8346('0x4'));var fs=require('fs');var path=require(_0x8346('0x5'));var rimraf=require(_0x8346('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x8346('0x7')]=function(_0x4ae076,_0x580df2){return _0x4ae076[_0x8346('0x8')](_0x8346('0x9'),attributes,{'tableName':_0x8346('0xa'),'paranoid':![],'indexes':[{'name':_0x8346('0xb'),'fields':[_0x8346('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 219e45a..4c9ff93 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 _0x6c84=['../../config/logger','jayson/promise','client','http','then','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x440c5f,_0x10fea1){var _0x35e67b=function(_0x509868){while(--_0x509868){_0x440c5f['push'](_0x440c5f['shift']());}};_0x35e67b(++_0x10fea1);}(_0x6c84,0x112));var _0x46c8=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x6c84[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var moment=require(_0x46c8('0x2'));var BPromise=require(_0x46c8('0x3'));var rs=require(_0x46c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46c8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x46c8('0x7'));var client=jayson[_0x46c8('0x8')][_0x46c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d239a,_0x13bf93,_0x3c1e2a){return new BPromise(function(_0xfe26c8,_0x1727f4){return client['request'](_0x2d239a,_0x3c1e2a)[_0x46c8('0xa')](function(_0x561c61){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x13bf93,_0x46c8('0xb'));logger['debug'](_0x46c8('0xc'),_0x13bf93,_0x46c8('0xb'),JSON[_0x46c8('0xd')](_0x561c61));if(_0x561c61[_0x46c8('0xe')]){if(_0x561c61[_0x46c8('0xe')][_0x46c8('0xf')]===0x1f4){logger[_0x46c8('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x13bf93,_0x561c61['error']['message']);return _0x1727f4(_0x561c61[_0x46c8('0xe')]['message']);}logger[_0x46c8('0xe')](_0x46c8('0x10'),_0x13bf93,_0x561c61[_0x46c8('0xe')][_0x46c8('0x11')]);return _0xfe26c8(_0x561c61[_0x46c8('0xe')]['message']);}else{logger[_0x46c8('0x12')](_0x46c8('0x10'),_0x13bf93,'request\x20sent');_0xfe26c8(_0x561c61[_0x46c8('0x13')][_0x46c8('0x11')]);}})['catch'](function(_0x488eb5){logger[_0x46c8('0xe')](_0x46c8('0x10'),_0x13bf93,_0x488eb5);_0x1727f4(_0x488eb5);});});} \ No newline at end of file +var _0x2975=['http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x24a20d,_0x5b08cb){var _0x13e76f=function(_0x2593b7){while(--_0x2593b7){_0x24a20d['push'](_0x24a20d['shift']());}};_0x13e76f(++_0x5b08cb);}(_0x2975,0x1c5));var _0x5297=function(_0x56ea4f,_0x39873b){_0x56ea4f=_0x56ea4f-0x0;var _0x3cc5fd=_0x2975[_0x56ea4f];return _0x3cc5fd;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var moment=require(_0x5297('0x1'));var BPromise=require(_0x5297('0x2'));var rs=require(_0x5297('0x3'));var fs=require('fs');var Redis=require(_0x5297('0x4'));var db=require(_0x5297('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5297('0x6'));var jayson=require(_0x5297('0x7'));var client=jayson[_0x5297('0x8')][_0x5297('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1d2c,_0x1f6762,_0x1b72a7){return new BPromise(function(_0x4f12b0,_0x2c015c){return client[_0x5297('0xa')](_0x4d1d2c,_0x1b72a7)[_0x5297('0xb')](function(_0x2f3b24){logger[_0x5297('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x5297('0xd'));logger[_0x5297('0xe')](_0x5297('0xf'),_0x1f6762,'request\x20sent',JSON[_0x5297('0x10')](_0x2f3b24));if(_0x2f3b24[_0x5297('0x11')]){if(_0x2f3b24[_0x5297('0x11')]['code']===0x1f4){logger[_0x5297('0x11')](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error']['message']);return _0x2c015c(_0x2f3b24[_0x5297('0x11')][_0x5297('0x13')]);}logger['error'](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error'][_0x5297('0x13')]);return _0x4f12b0(_0x2f3b24[_0x5297('0x11')]['message']);}else{logger[_0x5297('0xc')](_0x5297('0x12'),_0x1f6762,_0x5297('0xd'));_0x4f12b0(_0x2f3b24[_0x5297('0x14')][_0x5297('0x13')]);}})[_0x5297('0x15')](function(_0x1fb138){logger[_0x5297('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x1fb138);_0x2c015c(_0x1fb138);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 963f1b4..3ccfbef 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 _0xb7a7=['multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xb7a7,0xb4));var _0x7b7a=function(_0x59782a,_0x2c99ad){_0x59782a=_0x59782a-0x0;var _0x156192=_0xb7a7[_0x59782a];return _0x156192;};'use strict';var multer=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var path=require(_0x7b7a('0x2'));var timeout=require(_0x7b7a('0x3'));var express=require('express');var router=express[_0x7b7a('0x4')]();var fs_extra=require(_0x7b7a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7b7a('0x6'));var controller=require(_0x7b7a('0x7'));router[_0x7b7a('0x8')]('/',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xa')]);router[_0x7b7a('0x8')](_0x7b7a('0xb'),auth['isAuthenticated'](),controller[_0x7b7a('0xc')]);router[_0x7b7a('0xd')]('/',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xe')]);router[_0x7b7a('0xf')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller[_0x7b7a('0x10')]);router[_0x7b7a('0x11')]('/:id',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0x12')]);module[_0x7b7a('0x13')]=router; \ No newline at end of file +var _0xec3b=['Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','post','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x22d672,_0x187f68){var _0x551624=function(_0x1ff4fa){while(--_0x1ff4fa){_0x22d672['push'](_0x22d672['shift']());}};_0x551624(++_0x187f68);}(_0xec3b,0x93));var _0xbec3=function(_0x432237,_0x2d8ce4){_0x432237=_0x432237-0x0;var _0x3b5072=_0xec3b[_0x432237];return _0x3b5072;};'use strict';var multer=require(_0xbec3('0x0'));var util=require(_0xbec3('0x1'));var path=require(_0xbec3('0x2'));var timeout=require(_0xbec3('0x3'));var express=require(_0xbec3('0x4'));var router=express[_0xbec3('0x5')]();var fs_extra=require(_0xbec3('0x6'));var auth=require(_0xbec3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbec3('0x8'));var controller=require(_0xbec3('0x9'));router[_0xbec3('0xa')]('/',auth[_0xbec3('0xb')](),controller['index']);router[_0xbec3('0xa')]('/:id',auth[_0xbec3('0xb')](),controller['show']);router[_0xbec3('0xc')]('/',auth['isAuthenticated'](),controller[_0xbec3('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xbec3('0xe')]);router[_0xbec3('0xf')](_0xbec3('0x10'),auth['isAuthenticated'](),controller[_0xbec3('0x11')]);module[_0xbec3('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 4107727..2747429 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 _0x4645=['name','STRING','exports'];(function(_0xf16a02,_0x511866){var _0x444d4f=function(_0x25548f){while(--_0x25548f){_0xf16a02['push'](_0xf16a02['shift']());}};_0x444d4f(++_0x511866);}(_0x4645,0x1eb));var _0x5464=function(_0x42be9c,_0x330517){_0x42be9c=_0x42be9c-0x0;var _0x2278a2=_0x4645[_0x42be9c];return _0x2278a2;};'use strict';var Sequelize=require('sequelize');module[_0x5464('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x5464('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x5464('0x2')]}}; \ No newline at end of file +var _0x5aed=['sequelize','exports','STRING'];(function(_0xc9384b,_0x3a7f74){var _0x1db239=function(_0x81fa74){while(--_0x81fa74){_0xc9384b['push'](_0xc9384b['shift']());}};_0x1db239(++_0x3a7f74);}(_0x5aed,0x1c8));var _0xd5ae=function(_0x2eaafb,_0x46b183){_0x2eaafb=_0x2eaafb-0x0;var _0xfd1f6f=_0x5aed[_0x2eaafb];return _0xfd1f6f;};'use strict';var Sequelize=require(_0xd5ae('0x0'));module[_0xd5ae('0x1')]={'name':{'type':Sequelize[_0xd5ae('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd5ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 20ddac1..14f5c60 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 _0x5bab=['json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','get','Pauses','UserProfileResource','name','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','Pause','count','includeAll','include','findAll','rows','show','params','keys','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x1bfd1f,_0x27b6f0){var _0x2d4480=function(_0x1d642d){while(--_0x1d642d){_0x1bfd1f['push'](_0x1bfd1f['shift']());}};_0x2d4480(++_0x27b6f0);}(_0x5bab,0x118));var _0xb5ba=function(_0x355e3d,_0x56808e){_0x355e3d=_0x355e3d-0x0;var _0x1a6f82=_0x5bab[_0x355e3d];return _0x1a6f82;};'use strict';var emlformat=require(_0xb5ba('0x0'));var rimraf=require(_0xb5ba('0x1'));var zipdir=require(_0xb5ba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb5ba('0x3'));var moment=require('moment');var BPromise=require(_0xb5ba('0x4'));var Mustache=require(_0xb5ba('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb5ba('0x6'));var csv=require(_0xb5ba('0x7'));var ejs=require(_0xb5ba('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5ba('0x9'));var crypto=require(_0xb5ba('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb5ba('0xb'));var toCsv=require(_0xb5ba('0x7'));var querystring=require('querystring');var Papa=require(_0xb5ba('0xc'));var Redis=require(_0xb5ba('0xd'));var authService=require(_0xb5ba('0xe'));var qs=require(_0xb5ba('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5ba('0x10'));var logger=require('../../config/logger')(_0xb5ba('0x11'));var utils=require('../../config/utils');var config=require(_0xb5ba('0x12'));var licenseUtil=require(_0xb5ba('0x13'));var db=require(_0xb5ba('0x14'))['db'];function respondWithStatusCode(_0x31bc43,_0x2dd34d){_0x2dd34d=_0x2dd34d||0xcc;return function(_0xbed3e1){if(_0xbed3e1){return _0x31bc43[_0xb5ba('0x15')](_0x2dd34d);}return _0x31bc43[_0xb5ba('0x16')](_0x2dd34d)[_0xb5ba('0x17')]();};}function respondWithResult(_0x506db2,_0x11196e){_0x11196e=_0x11196e||0xc8;return function(_0x30d13e){if(_0x30d13e){return _0x506db2[_0xb5ba('0x16')](_0x11196e)[_0xb5ba('0x18')](_0x30d13e);}};}function respondWithFilteredResult(_0x13afbf,_0x4bbd3d){return function(_0x421464){if(_0x421464){var _0x773d00=typeof _0x4bbd3d[_0xb5ba('0x19')]==='undefined'&&typeof _0x4bbd3d[_0xb5ba('0x1a')]===_0xb5ba('0x1b');var _0x58d635=_0x421464['count'];var _0x151d85=_0x773d00?0x0:_0x4bbd3d[_0xb5ba('0x19')];var _0x10da81=_0x773d00?_0x421464['count']:_0x4bbd3d[_0xb5ba('0x19')]+_0x4bbd3d[_0xb5ba('0x1a')];var _0x4e0ccc;if(_0x10da81>=_0x58d635){_0x10da81=_0x58d635;_0x4e0ccc=0xc8;}else{_0x4e0ccc=0xce;}_0x13afbf[_0xb5ba('0x16')](_0x4e0ccc);return _0x13afbf[_0xb5ba('0x1c')](_0xb5ba('0x1d'),_0x151d85+'-'+_0x10da81+'/'+_0x58d635)[_0xb5ba('0x18')](_0x421464);}return null;};}function patchUpdates(_0x11ec44){return function(_0x44ffe9){try{jsonpatch[_0xb5ba('0x1e')](_0x44ffe9,_0x11ec44,!![]);}catch(_0x5d9ed0){return BPromise[_0xb5ba('0x1f')](_0x5d9ed0);}return _0x44ffe9[_0xb5ba('0x20')]();};}function saveUpdates(_0x8fe6f0,_0x19f388){return function(_0x53f00b){if(_0x53f00b){return _0x53f00b[_0xb5ba('0x21')](_0x8fe6f0)[_0xb5ba('0x22')](function(_0x1074f1){return _0x1074f1;});}return null;};}function removeEntity(_0x200d9d,_0x48820e){return function(_0x36d516){if(_0x36d516){return _0x36d516[_0xb5ba('0x23')]()[_0xb5ba('0x22')](function(){var _0x10c616=_0x36d516[_0xb5ba('0x24')]({'plain':!![]});var _0x3293bc=_0xb5ba('0x25');return db[_0xb5ba('0x26')][_0xb5ba('0x23')]({'where':{'type':_0x3293bc,'resourceId':_0x10c616['id']}})['then'](function(){return _0x36d516;});})[_0xb5ba('0x22')](function(){_0x200d9d[_0xb5ba('0x16')](0xcc)[_0xb5ba('0x17')]();});}};}function handleEntityNotFound(_0x1dda17,_0x642e1c){return function(_0x15e28d){if(!_0x15e28d){_0x1dda17[_0xb5ba('0x15')](0x194);}return _0x15e28d;};}function handleError(_0x476802,_0x39c555){_0x39c555=_0x39c555||0x1f4;return function(_0x56970b){logger['error'](_0x56970b['stack']);if(_0x56970b[_0xb5ba('0x27')]){delete _0x56970b[_0xb5ba('0x27')];}_0x476802['status'](_0x39c555)['send'](_0x56970b);};}exports['index']=function(_0x1a6fea,_0x554682){var _0x8af55d={},_0x34b021={},_0x51a417={'count':0x0,'rows':[]};var _0x10e394=_[_0xb5ba('0x28')](db['Pause'][_0xb5ba('0x29')],function(_0x308875){return{'name':_0x308875[_0xb5ba('0x2a')],'type':_0x308875[_0xb5ba('0x2b')]['key']};});_0x34b021[_0xb5ba('0x2c')]=_['map'](_0x10e394,'name');_0x34b021['query']=_['keys'](_0x1a6fea[_0xb5ba('0x2d')]);_0x34b021[_0xb5ba('0x2e')]=_[_0xb5ba('0x2f')](_0x34b021[_0xb5ba('0x2c')],_0x34b021['query']);_0x8af55d['attributes']=_[_0xb5ba('0x2f')](_0x34b021['model'],qs['fields'](_0x1a6fea['query']['fields']));_0x8af55d[_0xb5ba('0x30')]=_0x8af55d[_0xb5ba('0x30')]['length']?_0x8af55d[_0xb5ba('0x30')]:_0x34b021['model'];if(!_0x1a6fea[_0xb5ba('0x2d')][_0xb5ba('0x31')]('nolimit')){_0x8af55d['limit']=qs['limit'](_0x1a6fea[_0xb5ba('0x2d')]['limit']);_0x8af55d[_0xb5ba('0x19')]=qs['offset'](_0x1a6fea[_0xb5ba('0x2d')][_0xb5ba('0x19')]);}_0x8af55d['order']=qs[_0xb5ba('0x32')](_0x1a6fea['query']['sort']);_0x8af55d[_0xb5ba('0x33')]=qs[_0xb5ba('0x2e')](_['pick'](_0x1a6fea['query'],_0x34b021[_0xb5ba('0x2e')]),_0x10e394);if(_0x1a6fea[_0xb5ba('0x2d')][_0xb5ba('0x34')]){_0x8af55d[_0xb5ba('0x33')]=_['merge'](_0x8af55d['where'],{'$or':_[_0xb5ba('0x28')](_0x10e394,function(_0x1108ff){if(_0x1108ff[_0xb5ba('0x2b')]!==_0xb5ba('0x35')){var _0x2b472e={};_0x2b472e[_0x1108ff[_0xb5ba('0x27')]]={'$like':'%'+_0x1a6fea[_0xb5ba('0x2d')][_0xb5ba('0x34')]+'%'};return _0x2b472e;}})});}_0x8af55d=_[_0xb5ba('0x36')]({},_0x8af55d,_0x1a6fea[_0xb5ba('0x37')]);var _0xf4ff32={'where':_0x8af55d[_0xb5ba('0x33')]};return db[_0xb5ba('0x38')]['count'](_0xf4ff32)[_0xb5ba('0x22')](function(_0x4af36e){_0x51a417[_0xb5ba('0x39')]=_0x4af36e;if(_0x1a6fea[_0xb5ba('0x2d')][_0xb5ba('0x3a')]){_0x8af55d[_0xb5ba('0x3b')]=[{'all':!![]}];}return db[_0xb5ba('0x38')][_0xb5ba('0x3c')](_0x8af55d);})[_0xb5ba('0x22')](function(_0x42bf03){_0x51a417[_0xb5ba('0x3d')]=_0x42bf03;return _0x51a417;})[_0xb5ba('0x22')](respondWithFilteredResult(_0x554682,_0x8af55d))['catch'](handleError(_0x554682,null));};exports[_0xb5ba('0x3e')]=function(_0x5de80e,_0x10ec12){var _0x3386c8={'raw':!![],'where':{'id':_0x5de80e[_0xb5ba('0x3f')]['id']}},_0x4312a1={};_0x4312a1[_0xb5ba('0x2c')]=_[_0xb5ba('0x40')](db[_0xb5ba('0x38')]['rawAttributes']);_0x4312a1[_0xb5ba('0x2d')]=_[_0xb5ba('0x40')](_0x5de80e[_0xb5ba('0x2d')]);_0x4312a1[_0xb5ba('0x2e')]=_[_0xb5ba('0x2f')](_0x4312a1[_0xb5ba('0x2c')],_0x4312a1[_0xb5ba('0x2d')]);_0x3386c8[_0xb5ba('0x30')]=_[_0xb5ba('0x2f')](_0x4312a1[_0xb5ba('0x2c')],qs[_0xb5ba('0x41')](_0x5de80e['query'][_0xb5ba('0x41')]));_0x3386c8[_0xb5ba('0x30')]=_0x3386c8['attributes'][_0xb5ba('0x42')]?_0x3386c8[_0xb5ba('0x30')]:_0x4312a1[_0xb5ba('0x2c')];if(_0x5de80e[_0xb5ba('0x2d')][_0xb5ba('0x3a')]){_0x3386c8[_0xb5ba('0x3b')]=[{'all':!![]}];}_0x3386c8=_['merge']({},_0x3386c8,_0x5de80e[_0xb5ba('0x37')]);return db[_0xb5ba('0x38')][_0xb5ba('0x43')](_0x3386c8)[_0xb5ba('0x22')](handleEntityNotFound(_0x10ec12,null))[_0xb5ba('0x22')](respondWithResult(_0x10ec12,null))['catch'](handleError(_0x10ec12,null));};exports[_0xb5ba('0x44')]=function(_0x151b44,_0x3ac938){return db[_0xb5ba('0x38')][_0xb5ba('0x44')](_0x151b44[_0xb5ba('0x45')],{})[_0xb5ba('0x22')](function(_0x4eaed7){var _0x54ab3f=_0x151b44[_0xb5ba('0x46')]['get']({'plain':!![]});if(!_0x54ab3f)throw new Error(_0xb5ba('0x47'));if(_0x54ab3f[_0xb5ba('0x48')]===_0xb5ba('0x46')){var _0x155ca0=_0x4eaed7[_0xb5ba('0x24')]({'plain':!![]});var _0x147398=_0xb5ba('0x25');return db[_0xb5ba('0x49')][_0xb5ba('0x43')]({'where':{'name':_0x147398,'userProfileId':_0x54ab3f['userProfileId']},'raw':!![]})[_0xb5ba('0x22')](function(_0x4b6a42){if(_0x4b6a42&&_0x4b6a42[_0xb5ba('0x4a')]===0x0){return db[_0xb5ba('0x26')]['create']({'name':_0x155ca0[_0xb5ba('0x27')],'resourceId':_0x155ca0['id'],'type':_0x4b6a42[_0xb5ba('0x27')],'sectionId':_0x4b6a42['id']},{})[_0xb5ba('0x22')](function(){return _0x4eaed7;});}else{return _0x4eaed7;}})[_0xb5ba('0x4b')](function(_0xb6d185){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb6d185);throw _0xb6d185;});}return _0x4eaed7;})['then'](respondWithResult(_0x3ac938,0xc9))[_0xb5ba('0x4b')](handleError(_0x3ac938,null));};exports[_0xb5ba('0x21')]=function(_0x3100b4,_0x419dc8){if(_0x3100b4[_0xb5ba('0x45')]['id']){delete _0x3100b4[_0xb5ba('0x45')]['id'];}return db['Pause'][_0xb5ba('0x43')]({'where':{'id':_0x3100b4['params']['id']}})[_0xb5ba('0x22')](handleEntityNotFound(_0x419dc8,null))[_0xb5ba('0x22')](saveUpdates(_0x3100b4[_0xb5ba('0x45')],null))[_0xb5ba('0x22')](respondWithResult(_0x419dc8,null))[_0xb5ba('0x4b')](handleError(_0x419dc8,null));};exports['destroy']=function(_0x2a7126,_0x1d3f82){return db['Pause'][_0xb5ba('0x43')]({'where':{'id':_0x2a7126['params']['id']}})[_0xb5ba('0x22')](handleEntityNotFound(_0x1d3f82,null))[_0xb5ba('0x22')](removeEntity(_0x1d3f82,null))[_0xb5ba('0x4b')](handleError(_0x1d3f82,null));}; \ No newline at end of file +var _0x7af6=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','Pauses','UserProfileResource','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x7af6,0x1b2));var _0x67af=function(_0x206b9c,_0x4decf3){_0x206b9c=_0x206b9c-0x0;var _0x5d2dce=_0x7af6[_0x206b9c];return _0x5d2dce;};'use strict';var emlformat=require(_0x67af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67af('0x2'));var moment=require(_0x67af('0x3'));var BPromise=require(_0x67af('0x4'));var Mustache=require(_0x67af('0x5'));var util=require(_0x67af('0x6'));var path=require(_0x67af('0x7'));var sox=require(_0x67af('0x8'));var csv=require(_0x67af('0x9'));var ejs=require(_0x67af('0xa'));var fs=require('fs');var fs_extra=require(_0x67af('0xb'));var _=require(_0x67af('0xc'));var squel=require('squel');var crypto=require(_0x67af('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x67af('0xe'));var toCsv=require(_0x67af('0x9'));var querystring=require('querystring');var Papa=require(_0x67af('0xf'));var Redis=require(_0x67af('0x10'));var authService=require(_0x67af('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67af('0x12'));var logger=require(_0x67af('0x13'))(_0x67af('0x14'));var utils=require('../../config/utils');var config=require(_0x67af('0x15'));var licenseUtil=require(_0x67af('0x16'));var db=require(_0x67af('0x17'))['db'];function respondWithStatusCode(_0x743e1d,_0x4e090e){_0x4e090e=_0x4e090e||0xcc;return function(_0x5bec62){if(_0x5bec62){return _0x743e1d['sendStatus'](_0x4e090e);}return _0x743e1d[_0x67af('0x18')](_0x4e090e)['end']();};}function respondWithResult(_0xb0d538,_0x41ec53){_0x41ec53=_0x41ec53||0xc8;return function(_0x2439aa){if(_0x2439aa){return _0xb0d538[_0x67af('0x18')](_0x41ec53)[_0x67af('0x19')](_0x2439aa);}};}function respondWithFilteredResult(_0x2d004a,_0x1fb20d){return function(_0x238a3c){if(_0x238a3c){var _0x48060f=typeof _0x1fb20d['offset']===_0x67af('0x1a')&&typeof _0x1fb20d[_0x67af('0x1b')]===_0x67af('0x1a');var _0x16b4c6=_0x238a3c[_0x67af('0x1c')];var _0x304edf=_0x48060f?0x0:_0x1fb20d[_0x67af('0x1d')];var _0x465e63=_0x48060f?_0x238a3c['count']:_0x1fb20d[_0x67af('0x1d')]+_0x1fb20d[_0x67af('0x1b')];var _0x5a2438;if(_0x465e63>=_0x16b4c6){_0x465e63=_0x16b4c6;_0x5a2438=0xc8;}else{_0x5a2438=0xce;}_0x2d004a['status'](_0x5a2438);return _0x2d004a[_0x67af('0x1e')]('Content-Range',_0x304edf+'-'+_0x465e63+'/'+_0x16b4c6)[_0x67af('0x19')](_0x238a3c);}return null;};}function patchUpdates(_0x169ec4){return function(_0x4bf0c0){try{jsonpatch[_0x67af('0x1f')](_0x4bf0c0,_0x169ec4,!![]);}catch(_0x2b1698){return BPromise[_0x67af('0x20')](_0x2b1698);}return _0x4bf0c0[_0x67af('0x21')]();};}function saveUpdates(_0x4132a4,_0x1e8769){return function(_0x3a53f2){if(_0x3a53f2){return _0x3a53f2['update'](_0x4132a4)[_0x67af('0x22')](function(_0x101b16){return _0x101b16;});}return null;};}function removeEntity(_0x2b5148,_0x4d8c06){return function(_0x4d48a5){if(_0x4d48a5){return _0x4d48a5[_0x67af('0x23')]()[_0x67af('0x22')](function(){var _0x318568=_0x4d48a5['get']({'plain':!![]});var _0x5bcf6b=_0x67af('0x24');return db[_0x67af('0x25')][_0x67af('0x23')]({'where':{'type':_0x5bcf6b,'resourceId':_0x318568['id']}})[_0x67af('0x22')](function(){return _0x4d48a5;});})[_0x67af('0x22')](function(){_0x2b5148[_0x67af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5577,_0x426b56){return function(_0x5925d7){if(!_0x5925d7){_0x4d5577['sendStatus'](0x194);}return _0x5925d7;};}function handleError(_0xe0b79,_0x257904){_0x257904=_0x257904||0x1f4;return function(_0x2a777c){logger['error'](_0x2a777c[_0x67af('0x26')]);if(_0x2a777c['name']){delete _0x2a777c[_0x67af('0x27')];}_0xe0b79['status'](_0x257904)[_0x67af('0x28')](_0x2a777c);};}exports[_0x67af('0x29')]=function(_0x44881b,_0x3ddb7b){var _0x11e2ff={},_0x297276={},_0x14904b={'count':0x0,'rows':[]};var _0x2a6bc4=_[_0x67af('0x2a')](db[_0x67af('0x2b')][_0x67af('0x2c')],function(_0x47c673){return{'name':_0x47c673[_0x67af('0x2d')],'type':_0x47c673[_0x67af('0x2e')][_0x67af('0x2f')]};});_0x297276[_0x67af('0x30')]=_['map'](_0x2a6bc4,'name');_0x297276[_0x67af('0x31')]=_[_0x67af('0x32')](_0x44881b[_0x67af('0x31')]);_0x297276[_0x67af('0x33')]=_[_0x67af('0x34')](_0x297276[_0x67af('0x30')],_0x297276[_0x67af('0x31')]);_0x11e2ff['attributes']=_[_0x67af('0x34')](_0x297276['model'],qs[_0x67af('0x35')](_0x44881b[_0x67af('0x31')][_0x67af('0x35')]));_0x11e2ff[_0x67af('0x36')]=_0x11e2ff['attributes'][_0x67af('0x37')]?_0x11e2ff['attributes']:_0x297276[_0x67af('0x30')];if(!_0x44881b[_0x67af('0x31')][_0x67af('0x38')](_0x67af('0x39'))){_0x11e2ff[_0x67af('0x1b')]=qs['limit'](_0x44881b[_0x67af('0x31')]['limit']);_0x11e2ff[_0x67af('0x1d')]=qs[_0x67af('0x1d')](_0x44881b[_0x67af('0x31')][_0x67af('0x1d')]);}_0x11e2ff[_0x67af('0x3a')]=qs[_0x67af('0x3b')](_0x44881b['query']['sort']);_0x11e2ff[_0x67af('0x3c')]=qs[_0x67af('0x33')](_[_0x67af('0x3d')](_0x44881b['query'],_0x297276[_0x67af('0x33')]),_0x2a6bc4);if(_0x44881b[_0x67af('0x31')][_0x67af('0x3e')]){_0x11e2ff[_0x67af('0x3c')]=_['merge'](_0x11e2ff['where'],{'$or':_[_0x67af('0x2a')](_0x2a6bc4,function(_0xf7b8aa){if(_0xf7b8aa[_0x67af('0x2e')]!==_0x67af('0x3f')){var _0x360bf0={};_0x360bf0[_0xf7b8aa[_0x67af('0x27')]]={'$like':'%'+_0x44881b['query'][_0x67af('0x3e')]+'%'};return _0x360bf0;}})});}_0x11e2ff=_[_0x67af('0x40')]({},_0x11e2ff,_0x44881b[_0x67af('0x41')]);var _0xe55df2={'where':_0x11e2ff[_0x67af('0x3c')]};return db[_0x67af('0x2b')][_0x67af('0x1c')](_0xe55df2)[_0x67af('0x22')](function(_0x3fc54f){_0x14904b[_0x67af('0x1c')]=_0x3fc54f;if(_0x44881b[_0x67af('0x31')][_0x67af('0x42')]){_0x11e2ff[_0x67af('0x43')]=[{'all':!![]}];}return db['Pause'][_0x67af('0x44')](_0x11e2ff);})[_0x67af('0x22')](function(_0x41f79a){_0x14904b[_0x67af('0x45')]=_0x41f79a;return _0x14904b;})[_0x67af('0x22')](respondWithFilteredResult(_0x3ddb7b,_0x11e2ff))[_0x67af('0x46')](handleError(_0x3ddb7b,null));};exports[_0x67af('0x47')]=function(_0x2e0772,_0x467f97){var _0x20e5cf={'raw':!![],'where':{'id':_0x2e0772[_0x67af('0x48')]['id']}},_0x56baac={};_0x56baac[_0x67af('0x30')]=_[_0x67af('0x32')](db['Pause'][_0x67af('0x2c')]);_0x56baac[_0x67af('0x31')]=_[_0x67af('0x32')](_0x2e0772[_0x67af('0x31')]);_0x56baac[_0x67af('0x33')]=_['intersection'](_0x56baac[_0x67af('0x30')],_0x56baac[_0x67af('0x31')]);_0x20e5cf[_0x67af('0x36')]=_['intersection'](_0x56baac[_0x67af('0x30')],qs[_0x67af('0x35')](_0x2e0772[_0x67af('0x31')][_0x67af('0x35')]));_0x20e5cf[_0x67af('0x36')]=_0x20e5cf['attributes']['length']?_0x20e5cf[_0x67af('0x36')]:_0x56baac[_0x67af('0x30')];if(_0x2e0772[_0x67af('0x31')][_0x67af('0x42')]){_0x20e5cf[_0x67af('0x43')]=[{'all':!![]}];}_0x20e5cf=_[_0x67af('0x40')]({},_0x20e5cf,_0x2e0772[_0x67af('0x41')]);return db[_0x67af('0x2b')]['find'](_0x20e5cf)[_0x67af('0x22')](handleEntityNotFound(_0x467f97,null))[_0x67af('0x22')](respondWithResult(_0x467f97,null))['catch'](handleError(_0x467f97,null));};exports[_0x67af('0x49')]=function(_0x52b3ed,_0x36e436){return db[_0x67af('0x2b')][_0x67af('0x49')](_0x52b3ed['body'],{})[_0x67af('0x22')](function(_0x24ad40){var _0x3c0c88=_0x52b3ed[_0x67af('0x4a')][_0x67af('0x4b')]({'plain':!![]});if(!_0x3c0c88)throw new Error(_0x67af('0x4c'));if(_0x3c0c88[_0x67af('0x4d')]===_0x67af('0x4a')){var _0x5f320b=_0x24ad40[_0x67af('0x4b')]({'plain':!![]});var _0x4a4ba2=_0x67af('0x24');return db[_0x67af('0x4e')]['find']({'where':{'name':_0x4a4ba2,'userProfileId':_0x3c0c88[_0x67af('0x4f')]},'raw':!![]})[_0x67af('0x22')](function(_0x4cb85e){if(_0x4cb85e&&_0x4cb85e[_0x67af('0x50')]===0x0){return db['UserProfileResource'][_0x67af('0x49')]({'name':_0x5f320b['name'],'resourceId':_0x5f320b['id'],'type':_0x4cb85e[_0x67af('0x27')],'sectionId':_0x4cb85e['id']},{})[_0x67af('0x22')](function(){return _0x24ad40;});}else{return _0x24ad40;}})[_0x67af('0x46')](function(_0x23eab1){logger[_0x67af('0x51')](_0x67af('0x52'),_0x23eab1);throw _0x23eab1;});}return _0x24ad40;})[_0x67af('0x22')](respondWithResult(_0x36e436,0xc9))[_0x67af('0x46')](handleError(_0x36e436,null));};exports[_0x67af('0x53')]=function(_0x2b0945,_0x301e56){if(_0x2b0945[_0x67af('0x54')]['id']){delete _0x2b0945[_0x67af('0x54')]['id'];}return db[_0x67af('0x2b')][_0x67af('0x55')]({'where':{'id':_0x2b0945[_0x67af('0x48')]['id']}})[_0x67af('0x22')](handleEntityNotFound(_0x301e56,null))[_0x67af('0x22')](saveUpdates(_0x2b0945[_0x67af('0x54')],null))[_0x67af('0x22')](respondWithResult(_0x301e56,null))[_0x67af('0x46')](handleError(_0x301e56,null));};exports[_0x67af('0x23')]=function(_0x5ddb10,_0x5eba76){return db[_0x67af('0x2b')]['find']({'where':{'id':_0x5ddb10[_0x67af('0x48')]['id']}})['then'](handleEntityNotFound(_0x5eba76,null))['then'](removeEntity(_0x5eba76,null))['catch'](handleError(_0x5eba76,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 48b358b..628e42d 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x57dd84,_0x289555){var _0x4b74c1=function(_0x484266){while(--_0x484266){_0x57dd84['push'](_0x57dd84['shift']());}};_0x4b74c1(++_0x289555);}(_0xabce,0x103));var _0xeabc=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xabce[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x20ead0,_0x27a30a){var _0x1c99f5=function(_0x145d8e){while(--_0x145d8e){_0x20ead0['push'](_0x20ead0['shift']());}};_0x1c99f5(++_0x27a30a);}(_0x326f,0xd1));var _0xf326=function(_0x550703,_0x40543a){_0x550703=_0x550703-0x0;var _0x2bc585=_0x326f[_0x550703];return _0x2bc585;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 6a2c250..a4268f7 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x19ef06,_0xd4564a){var _0x59b087=function(_0x202e0e){while(--_0x202e0e){_0x19ef06['push'](_0x19ef06['shift']());}};_0x59b087(++_0xd4564a);}(_0x7a54,0x106));var _0x47a5=function(_0x437e0a,_0x2f607d){_0x437e0a=_0x437e0a-0x0;var _0x3659bd=_0x7a54[_0x437e0a];return _0x3659bd;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x1f551f,_0x1ec42d){var _0x130cbe=function(_0x74526e){while(--_0x74526e){_0x1f551f['push'](_0x1f551f['shift']());}};_0x130cbe(++_0x1ec42d);}(_0xb10b,0x12a));var _0xbb10=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xb10b[_0x231b2e];return _0x3feb2a;};'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 e20d03f..ecf77b8 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 _0x4d9e=['upload','webhookPost','put','delete','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','%s-%s%s','basename','originalname','now','extname','single','file'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x3b86c5,_0x33b651){_0x3b86c5=_0x3b86c5-0x0;var _0x2bc187=_0x4d9e[_0x3b86c5];return _0x2bc187;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),controller['webhookGet']);router[_0xe4d9('0x6')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xb')]);router[_0xe4d9('0x6')](_0xe4d9('0xc'),auth['isAuthenticated'](),controller[_0xe4d9('0xd')]);var upload=multer({'storage':multer[_0xe4d9('0xe')]({'destination':function(_0x32eb8a,_0x3575ac,_0xddd1fb){_0xddd1fb(null,path[_0xe4d9('0xf')](config[_0xe4d9('0x10')],'server/files/plugins'));},'filename':function(_0x5ee099,_0x580c50,_0x4e0d15){_0x580c50['originalname']=_0x580c50['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4e0d15(null,util['format'](_0xe4d9('0x11'),path[_0xe4d9('0x12')](_0x580c50[_0xe4d9('0x13')],path['extname'](_0x580c50[_0xe4d9('0x13')])),Date[_0xe4d9('0x14')](),path[_0xe4d9('0x15')](_0x580c50[_0xe4d9('0x13')])));}})});router['post']('/',upload[_0xe4d9('0x16')](_0xe4d9('0x17')),controller[_0xe4d9('0x18')]);router['post']('/webhook',controller[_0xe4d9('0x19')]);router[_0xe4d9('0x1a')]('/:id',auth[_0xe4d9('0x7')](),controller['update']);router[_0xe4d9('0x1b')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xaba6=['get','webhookGet','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','post','single','file','upload','/webhook','put','/:id','delete','multer','util','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0xaba6,0xe2));var _0x6aba=function(_0x4bc7a8,_0x501829){_0x4bc7a8=_0x4bc7a8-0x0;var _0x2bb25c=_0xaba6[_0x4bc7a8];return _0x2bb25c;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/webhook',controller[_0x6aba('0x7')]);router[_0x6aba('0x6')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xb')]);var upload=multer({'storage':multer[_0x6aba('0xc')]({'destination':function(_0xdbc119,_0x4089c6,_0x181426){_0x181426(null,path['join'](config[_0x6aba('0xd')],_0x6aba('0xe')));},'filename':function(_0x43867b,_0x254007,_0x53e604){_0x254007[_0x6aba('0xf')]=_0x254007[_0x6aba('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x53e604(null,util[_0x6aba('0x10')](_0x6aba('0x11'),path[_0x6aba('0x12')](_0x254007['originalname'],path[_0x6aba('0x13')](_0x254007[_0x6aba('0xf')])),Date[_0x6aba('0x14')](),path['extname'](_0x254007[_0x6aba('0xf')])));}})});router[_0x6aba('0x15')]('/',upload[_0x6aba('0x16')](_0x6aba('0x17')),controller[_0x6aba('0x18')]);router[_0x6aba('0x15')](_0x6aba('0x19'),controller['webhookPost']);router[_0x6aba('0x1a')](_0x6aba('0x1b'),auth[_0x6aba('0x8')](),controller['update']);router[_0x6aba('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x6aba('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 6a3ab41..3f9eb69 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 _0x966c=['exports','STRING','ENUM','html','script','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x26475e,_0xe34ebb){var _0x44d0dc=function(_0x170925){while(--_0x170925){_0x26475e['push'](_0x26475e['shift']());}};_0x44d0dc(++_0xe34ebb);}(_0x966c,0xd8));var _0xc966=function(_0x3da10c,_0x4cf1b3){_0x3da10c=_0x3da10c-0x0;var _0x9ccf1=_0x966c[_0x3da10c];return _0x9ccf1;};'use strict';var Sequelize=require('sequelize');module[_0xc966('0x0')]={'name':{'type':Sequelize[_0xc966('0x1')]},'type':{'type':Sequelize[_0xc966('0x2')](_0xc966('0x3'),_0xc966('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':_0xc966('0x5')},'active':{'type':Sequelize[_0xc966('0x6')],'defaultValue':0x0,'comment':_0xc966('0x7')},'sidebar':{'type':Sequelize[_0xc966('0x2')](_0xc966('0x8'),'agentOnly',_0xc966('0x9'),_0xc966('0xa')),'defaultValue':_0xc966('0x9'),'comment':_0xc966('0xb')},'icon':{'type':Sequelize[_0xc966('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xc966('0x1')]},'scriptName':{'type':Sequelize[_0xc966('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xad04=['STRING','exports','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','never'];(function(_0x4a7962,_0x2482b9){var _0x172921=function(_0x1964f9){while(--_0x1964f9){_0x4a7962['push'](_0x4a7962['shift']());}};_0x172921(++_0x2482b9);}(_0xad04,0x18d));var _0x4ad0=function(_0x4a8fa2,_0x231281){_0x4a8fa2=_0x4a8fa2-0x0;var _0x48d974=_0xad04[_0x4a8fa2];return _0x48d974;};'use strict';var Sequelize=require('sequelize');module[_0x4ad0('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4ad0('0x1')](_0x4ad0('0x2'),_0x4ad0('0x3'))},'description':{'type':Sequelize[_0x4ad0('0x4')]},'version':{'type':Sequelize[_0x4ad0('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x4ad0('0x5')},'active':{'type':Sequelize[_0x4ad0('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x4ad0('0x1')](_0x4ad0('0x7'),_0x4ad0('0x8'),_0x4ad0('0x9'),_0x4ad0('0xa')),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x4ad0('0xb')]},'adminUrl':{'type':Sequelize[_0x4ad0('0xb')]},'agentUrl':{'type':Sequelize[_0x4ad0('0xb')]},'scriptName':{'type':Sequelize[_0x4ad0('0xb')]},'scriptPath':{'type':Sequelize[_0x4ad0('0xb')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 7b9aa13..fd9ab5f 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 _0x3331=['version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','test','scriptName','scriptPath','create','body','role','userProfileId','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','sendStatus','webhookPost','resolve','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','end','status','json','offset','limit','count','set','apply','save','destroy','then','Plugins','UserProfileResource','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','include','rows','params','includeAll','find','catch','download','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','ENOENT','Sequelize','Error','pipe','glob','**/*','join','root','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing'];(function(_0x141ac5,_0x19fa6d){var _0x58f3b5=function(_0x264386){while(--_0x264386){_0x141ac5['push'](_0x141ac5['shift']());}};_0x58f3b5(++_0x19fa6d);}(_0x3331,0x189));var _0x1333=function(_0x34db0d,_0x28210d){_0x34db0d=_0x34db0d-0x0;var _0x29a2fb=_0x3331[_0x34db0d];return _0x29a2fb;};'use strict';var emlformat=require(_0x1333('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1333('0x1'));var jsonpatch=require(_0x1333('0x2'));var rp=require(_0x1333('0x3'));var moment=require(_0x1333('0x4'));var BPromise=require(_0x1333('0x5'));var Mustache=require(_0x1333('0x6'));var util=require(_0x1333('0x7'));var path=require(_0x1333('0x8'));var sox=require(_0x1333('0x9'));var csv=require(_0x1333('0xa'));var ejs=require(_0x1333('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1333('0xc'));var crypto=require(_0x1333('0xd'));var jsforce=require(_0x1333('0xe'));var deskjs=require(_0x1333('0xf'));var toCsv=require(_0x1333('0xa'));var querystring=require(_0x1333('0x10'));var Papa=require(_0x1333('0x11'));var extract=require(_0x1333('0x12'));var rimraf=require(_0x1333('0x13'));var archiver=require(_0x1333('0x14'));var Redis=require(_0x1333('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x1333('0x16'));var as=require(_0x1333('0x17'));var hardwareService=require(_0x1333('0x18'));var logger=require(_0x1333('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x1333('0x1a'));var licenseUtil=require(_0x1333('0x1b'));var db=require(_0x1333('0x1c'))['db'];config[_0x1333('0x1d')]=_[_0x1333('0x1e')](config[_0x1333('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0x1333('0x1f')](socket);function respondWithStatusCode(_0x54d955,_0xe1b008){_0xe1b008=_0xe1b008||0xcc;return function(_0x31e241){if(_0x31e241){return _0x54d955['sendStatus'](_0xe1b008);}return _0x54d955['status'](_0xe1b008)[_0x1333('0x20')]();};}function respondWithResult(_0x1b3ab4,_0x1017f2){_0x1017f2=_0x1017f2||0xc8;return function(_0xff2859){if(_0xff2859){return _0x1b3ab4[_0x1333('0x21')](_0x1017f2)[_0x1333('0x22')](_0xff2859);}};}function respondWithFilteredResult(_0x203bba,_0x501055){return function(_0x536f18){if(_0x536f18){var _0x4c5b96=typeof _0x501055[_0x1333('0x23')]==='undefined'&&typeof _0x501055[_0x1333('0x24')]==='undefined';var _0x593b57=_0x536f18[_0x1333('0x25')];var _0x468ec7=_0x4c5b96?0x0:_0x501055[_0x1333('0x23')];var _0x56ff7d=_0x4c5b96?_0x536f18['count']:_0x501055['offset']+_0x501055['limit'];var _0x39610e;if(_0x56ff7d>=_0x593b57){_0x56ff7d=_0x593b57;_0x39610e=0xc8;}else{_0x39610e=0xce;}_0x203bba[_0x1333('0x21')](_0x39610e);return _0x203bba[_0x1333('0x26')]('Content-Range',_0x468ec7+'-'+_0x56ff7d+'/'+_0x593b57)[_0x1333('0x22')](_0x536f18);}return null;};}function patchUpdates(_0xa3ce35){return function(_0x3b75cc){try{jsonpatch[_0x1333('0x27')](_0x3b75cc,_0xa3ce35,!![]);}catch(_0x6dfb9){return BPromise['reject'](_0x6dfb9);}return _0x3b75cc[_0x1333('0x28')]();};}function saveUpdates(_0x53e4b7,_0x396094){return function(_0x2fd993){if(_0x2fd993){return _0x2fd993['update'](_0x53e4b7)['then'](function(_0x3e1f78){return _0x3e1f78;});}return null;};}function removeEntity(_0x399af9,_0x3a33f0){return function(_0x50ab48){if(_0x50ab48){return _0x50ab48[_0x1333('0x29')]()[_0x1333('0x2a')](function(){var _0x3416f4=_0x50ab48['get']({'plain':!![]});var _0x4ec06f=_0x1333('0x2b');return db[_0x1333('0x2c')]['destroy']({'where':{'type':_0x4ec06f,'resourceId':_0x3416f4['id']}})[_0x1333('0x2a')](function(){return _0x50ab48;});})[_0x1333('0x2a')](function(){_0x399af9[_0x1333('0x21')](0xcc)[_0x1333('0x20')]();});}};}function handleEntityNotFound(_0x33b4af,_0x4b13f7){return function(_0x2e56c5){if(!_0x2e56c5){_0x33b4af['sendStatus'](0x194);}return _0x2e56c5;};}function handleError(_0x8890f4,_0x31e610){_0x31e610=_0x31e610||0x1f4;return function(_0x109ac0){logger[_0x1333('0x2d')](_0x109ac0['stack']);if(_0x109ac0['name']){delete _0x109ac0[_0x1333('0x2e')];}_0x8890f4[_0x1333('0x21')](_0x31e610)[_0x1333('0x2f')](_0x109ac0);};}exports[_0x1333('0x30')]=function(_0x3bce24,_0x4f9b17){var _0x1a1c8d={},_0x3dc32f={},_0x9d14b1={'count':0x0,'rows':[]};var _0x3601f7=_[_0x1333('0x31')](db[_0x1333('0x32')][_0x1333('0x33')],function(_0x1d03fb){return{'name':_0x1d03fb[_0x1333('0x34')],'type':_0x1d03fb[_0x1333('0x35')][_0x1333('0x36')]};});_0x3dc32f['model']=_['map'](_0x3601f7,_0x1333('0x2e'));_0x3dc32f[_0x1333('0x37')]=_[_0x1333('0x38')](_0x3bce24[_0x1333('0x37')]);_0x3dc32f['filters']=_[_0x1333('0x39')](_0x3dc32f[_0x1333('0x3a')],_0x3dc32f['query']);_0x1a1c8d['attributes']=_[_0x1333('0x39')](_0x3dc32f[_0x1333('0x3a')],qs['fields'](_0x3bce24[_0x1333('0x37')][_0x1333('0x3b')]));_0x1a1c8d[_0x1333('0x3c')]=_0x1a1c8d[_0x1333('0x3c')][_0x1333('0x3d')]?_0x1a1c8d['attributes']:_0x3dc32f[_0x1333('0x3a')];if(!_0x3bce24[_0x1333('0x37')][_0x1333('0x3e')]('nolimit')){_0x1a1c8d[_0x1333('0x24')]=qs[_0x1333('0x24')](_0x3bce24['query']['limit']);_0x1a1c8d[_0x1333('0x23')]=qs[_0x1333('0x23')](_0x3bce24[_0x1333('0x37')]['offset']);}_0x1a1c8d[_0x1333('0x3f')]=qs[_0x1333('0x40')](_0x3bce24[_0x1333('0x37')][_0x1333('0x40')]);_0x1a1c8d[_0x1333('0x41')]=qs[_0x1333('0x42')](_['pick'](_0x3bce24[_0x1333('0x37')],_0x3dc32f['filters']),_0x3601f7);if(_0x3bce24[_0x1333('0x37')][_0x1333('0x43')]){_0x1a1c8d[_0x1333('0x41')]=_['merge'](_0x1a1c8d[_0x1333('0x41')],{'$or':_[_0x1333('0x31')](_0x3601f7,function(_0x6bddd2){if(_0x6bddd2[_0x1333('0x35')]!=='VIRTUAL'){var _0x20c6b2={};_0x20c6b2[_0x6bddd2[_0x1333('0x2e')]]={'$like':'%'+_0x3bce24[_0x1333('0x37')][_0x1333('0x43')]+'%'};return _0x20c6b2;}})});}_0x1a1c8d=_[_0x1333('0x44')]({},_0x1a1c8d,_0x3bce24[_0x1333('0x45')]);var _0x35d4b5={'where':_0x1a1c8d[_0x1333('0x41')]};return db[_0x1333('0x32')][_0x1333('0x25')](_0x35d4b5)[_0x1333('0x2a')](function(_0x3851c3){_0x9d14b1[_0x1333('0x25')]=_0x3851c3;if(_0x3bce24[_0x1333('0x37')]['includeAll']){_0x1a1c8d[_0x1333('0x46')]=[{'all':!![]}];}return db[_0x1333('0x32')]['findAll'](_0x1a1c8d);})[_0x1333('0x2a')](function(_0x5dd4e0){_0x9d14b1[_0x1333('0x47')]=_0x5dd4e0;return _0x9d14b1;})[_0x1333('0x2a')](respondWithFilteredResult(_0x4f9b17,_0x1a1c8d))['catch'](handleError(_0x4f9b17,null));};exports['show']=function(_0x16a796,_0x391582){var _0x155733={'raw':!![],'where':{'id':_0x16a796[_0x1333('0x48')]['id']}},_0xb04141={};_0xb04141[_0x1333('0x3a')]=_[_0x1333('0x38')](db[_0x1333('0x32')]['rawAttributes']);_0xb04141['query']=_[_0x1333('0x38')](_0x16a796[_0x1333('0x37')]);_0xb04141['filters']=_[_0x1333('0x39')](_0xb04141[_0x1333('0x3a')],_0xb04141[_0x1333('0x37')]);_0x155733[_0x1333('0x3c')]=_[_0x1333('0x39')](_0xb04141[_0x1333('0x3a')],qs[_0x1333('0x3b')](_0x16a796['query'][_0x1333('0x3b')]));_0x155733['attributes']=_0x155733[_0x1333('0x3c')][_0x1333('0x3d')]?_0x155733[_0x1333('0x3c')]:_0xb04141['model'];if(_0x16a796['query'][_0x1333('0x49')]){_0x155733[_0x1333('0x46')]=[{'all':!![]}];}_0x155733=_['merge']({},_0x155733,_0x16a796[_0x1333('0x45')]);return db[_0x1333('0x32')][_0x1333('0x4a')](_0x155733)['then'](handleEntityNotFound(_0x391582,null))[_0x1333('0x2a')](respondWithResult(_0x391582,null))[_0x1333('0x4b')](handleError(_0x391582,null));};exports[_0x1333('0x4c')]=function(_0x61b58e,_0x201bce,_0x228ba3){return db[_0x1333('0x32')]['find']({'where':{'id':_0x61b58e[_0x1333('0x48')]['id']},'attributes':['name','path'],'raw':!![]})[_0x1333('0x2a')](handleEntityNotFound(_0x201bce,null))[_0x1333('0x2a')](function(_0x14c947){if(_0x14c947){var _0x1a6676=path['join'](config['root'],_0x1333('0x4d'),util[_0x1333('0x4e')](_0x1333('0x4f'),path['basename'](_0x14c947[_0x1333('0x8')])));var _0x24adb0=fs[_0x1333('0x50')](_0x1a6676);var _0x43fc71=archiver(_0x1333('0x51'),{'zlib':{'level':0x9}});_0x43fc71['on'](_0x1333('0x52'),function(_0x4cd369){if(_0x4cd369['code']===_0x1333('0x53')){logger[_0x1333('0x2d')](_0x4cd369);}else{throw new db[(_0x1333('0x54'))][(_0x1333('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x43fc71['on'](_0x1333('0x2d'),function(_0x34e0f1){throw new db[(_0x1333('0x54'))][(_0x1333('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x43fc71[_0x1333('0x56')](_0x24adb0);_0x43fc71[_0x1333('0x57')](_0x1333('0x58'),{'cwd':path[_0x1333('0x59')](config[_0x1333('0x5a')],'server/files/plugins',path[_0x1333('0x5b')](_0x14c947[_0x1333('0x8')])),'ignore':[path[_0x1333('0x59')](path[_0x1333('0x5c')](_0x14c947[_0x1333('0x8')]),_0x1333('0x5d')),path[_0x1333('0x59')](path[_0x1333('0x5c')](_0x14c947['path']),_0x1333('0x5e'))],'nodir':!![]})[_0x1333('0x5f')]();_0x24adb0['on'](_0x1333('0x60'),function(){if(!fs[_0x1333('0x61')](_0x1a6676)){throw new db[(_0x1333('0x54'))]['Error'](_0x1333('0x62'));}return _0x201bce[_0x1333('0x4c')](_0x1a6676,util['format'](_0x1333('0x4f'),path[_0x1333('0x5c')](_0x14c947[_0x1333('0x8')])),function(_0x1067ff){if(_0x1067ff){throw new db[(_0x1333('0x54'))]['Error'](_0x1333('0x63'));}fs[_0x1333('0x64')](_0x1a6676);logger[_0x1333('0x65')](_0x1333('0x66'));logger[_0x1333('0x65')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x201bce,null));};exports[_0x1333('0x67')]=function(_0x3c2f01,_0x40497c,_0xe77b75){var _0x149031=path[_0x1333('0x5c')](_0x3c2f01[_0x1333('0x68')][_0x1333('0x69')],path[_0x1333('0x6a')](_0x3c2f01[_0x1333('0x68')][_0x1333('0x69')]));var _0x123a32=path['join'](config[_0x1333('0x5a')],_0x1333('0x4d'),_0x3c2f01[_0x1333('0x68')][_0x1333('0x69')]);var _0x2dd75a=path['join'](config['root'],'server/files/plugins',_0x149031);logger[_0x1333('0x65')](_0x1333('0x6b'),_0x123a32);logger[_0x1333('0x65')](_0x1333('0x6c'),_0x2dd75a);try{fs[_0x1333('0x6d')](_0x123a32,parseInt(_0x1333('0x6e'),0x8));extract(_0x123a32,{'dir':_0x2dd75a},function(_0x5dd3ce){if(_0x5dd3ce){logger['error'](_0x5dd3ce);handleError(_0x5dd3ce,!![]);};var _0x910254=fs[_0x1333('0x6f')](_0x2dd75a);if(_0x910254[_0x1333('0x3d')]>0x1){removeReferences(_0x123a32,_0x2dd75a);logger['error'](_0x1333('0x70'));return _0xe77b75(new Error('Invalid\x20plugin\x20structure'));}var _0x595ca8=fs[_0x1333('0x71')](path[_0x1333('0x59')](_0x2dd75a,_0x910254[0x0]));if(_0x595ca8[_0x1333('0x72')]()){removeReferences(_0x123a32,_0x2dd75a);logger[_0x1333('0x2d')]('Invalid\x20plugin\x20structure');return _0xe77b75(new Error(_0x1333('0x70')));}if(_0x595ca8[_0x1333('0x73')]()){var _0x3d993d=fs['readdirSync'](path[_0x1333('0x59')](_0x2dd75a,_0x910254[0x0]));if(_0x3d993d['length']===0x0){removeReferences(_0x123a32,_0x2dd75a);logger['error'](_0x1333('0x70'));return _0xe77b75(new Error(_0x1333('0x70')));}var _0x5fdc49=_0x3d993d[_0x1333('0x74')](function(_0x51414b){return _0x51414b===_0x1333('0x75');});if(!_0x5fdc49){return _0xe77b75(new Error(_0x1333('0x76')));}var _0x3ba268=fs[_0x1333('0x77')](path['join'](_0x2dd75a,_0x910254[0x0],_0x1333('0x75')));var _0x8ea1c1=JSON['parse'](_0x3ba268);if(_0x1333('0x78')==typeof _0x8ea1c1[_0x1333('0x2e')]){return _0xe77b75(new Error(_0x1333('0x79')));}if(_0x1333('0x78')==typeof _0x8ea1c1['type']){return _0xe77b75(new Error(_0x1333('0x7a')));}if(_0x1333('0x78')==typeof _0x8ea1c1[_0x1333('0x7b')]){return _0xe77b75(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x8ea1c1[_0x1333('0x7c')]){return _0xe77b75(new Error(_0x1333('0x7d')));}if(_0x8ea1c1['type']===_0x1333('0x7e')){if(_0x1333('0x78')==typeof _0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')]){return _0xe77b75(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x1333('0x78')==typeof _0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')][_0x1333('0x80')]&&_0x1333('0x78')==typeof _0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')][_0x1333('0x81')]){return _0xe77b75(new Error(_0x1333('0x82')));}}else if(_0x8ea1c1[_0x1333('0x35')]===_0x1333('0x83')){if('undefined'==typeof _0x8ea1c1[_0x1333('0x7c')]['scriptName']){return _0xe77b75(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x1333('0x78')==typeof _0x8ea1c1[_0x1333('0x7c')]['scriptPath']){return _0xe77b75(new Error(_0x1333('0x84')));}}else{return _0xe77b75(new Error(_0x1333('0x85')));}var _0x2b12ab=_0x8ea1c1[_0x1333('0x2e')];var _0x3ee8dd=_0x8ea1c1[_0x1333('0x86')];var _0x49fe6b=_0x8ea1c1[_0x1333('0x35')];var _0x49a6bb=_0x8ea1c1[_0x1333('0x87')]?_0x8ea1c1[_0x1333('0x87')]:_0x1333('0x88');var _0x16287b=_0x8ea1c1[_0x1333('0x89')]?_0x8ea1c1[_0x1333('0x89')]:_0x1333('0x8a');var _0x5f1dfc='';var _0x120a6b='';var _0x37a758='';var _0x244d24='';var _0x43efa2=_0x8ea1c1[_0x1333('0x7b')];if(_0x49fe6b===_0x1333('0x7e')){if('undefined'!=typeof _0x8ea1c1['parameters'][_0x1333('0x7f')][_0x1333('0x80')]){var _0x5e82a9=_0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')][_0x1333('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e82a9)){_0x5f1dfc=path['join'](_0x1333('0x8b'),_0x149031,_0x910254[0x0],_0x5e82a9);}else{_0x5f1dfc=_0x5e82a9;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x1333('0x78')!=typeof _0x8ea1c1['parameters'][_0x1333('0x7f')][_0x1333('0x81')]){var _0x49e296=_0x8ea1c1[_0x1333('0x7c')]['views'][_0x1333('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x1333('0x8c')](_0x49e296)){_0x120a6b=path['join'](_0x1333('0x8b'),_0x149031,_0x910254[0x0],_0x49e296);}else{_0x120a6b=_0x49e296;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x49fe6b===_0x1333('0x83')){_0x37a758=_0x8ea1c1[_0x1333('0x7c')][_0x1333('0x8d')];_0x244d24=_0x8ea1c1[_0x1333('0x7c')][_0x1333('0x8e')];if(_0x1333('0x78')!=typeof _0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')]){if('undefined'!=typeof _0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')]['admin']){var _0x5e82a9=_0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e82a9)){_0x5f1dfc=path[_0x1333('0x59')](_0x1333('0x8b'),_0x149031,_0x910254[0x0],_0x5e82a9);}else{_0x5f1dfc=_0x5e82a9;}}if('undefined'!=typeof _0x8ea1c1[_0x1333('0x7c')][_0x1333('0x7f')]['agent']){var _0x49e296=_0x8ea1c1[_0x1333('0x7c')]['views'][_0x1333('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x1333('0x8c')](_0x49e296)){_0x120a6b=path[_0x1333('0x59')](_0x1333('0x8b'),_0x149031,_0x910254[0x0],_0x49e296);}else{_0x120a6b=_0x49e296;}}}}var _0x4bcef5={'name':_0x2b12ab,'description':_0x3ee8dd,'path':path[_0x1333('0x59')](_0x149031,_0x910254[0x0]),'type':_0x49fe6b,'sidebar':_0x49a6bb,'icon':_0x16287b,'adminUrl':_0x5f1dfc,'agentUrl':_0x120a6b,'scriptName':_0x37a758,'scriptPath':_0x244d24,'version':_0x43efa2};removeReferences(_0x123a32,null);return db[_0x1333('0x32')][_0x1333('0x8f')](_0x4bcef5)['then'](function(_0xc9ed41){var _0x295a70={'role':_0x3c2f01[_0x1333('0x90')][_0x1333('0x91')],'userProfileId':_0x3c2f01[_0x1333('0x90')][_0x1333('0x92')]};if(!_0x295a70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x295a70[_0x1333('0x91')]===_0x1333('0x93')){var _0x1c9253=_0xc9ed41[_0x1333('0x94')]({'plain':!![]});return db[_0x1333('0x95')][_0x1333('0x4a')]({'where':{'name':_0x1333('0x2b'),'userProfileId':_0x295a70['userProfileId']},'raw':!![]})[_0x1333('0x2a')](function(_0x4fcdb3){if(_0x4fcdb3&&_0x4fcdb3[_0x1333('0x96')]===0x0){return db[_0x1333('0x2c')]['create']({'name':_0x1c9253['name'],'resourceId':_0x1c9253['id'],'type':_0x4fcdb3['name'],'sectionId':_0x4fcdb3['id']},{})['then'](function(){return _0xc9ed41;});}else{return _0xc9ed41;}})[_0x1333('0x4b')](function(_0x573f03){logger[_0x1333('0x2d')](_0x1333('0x97'),_0x573f03);throw _0x573f03;});}return _0xc9ed41;})[_0x1333('0x2a')](respondWithResult(_0x40497c,null))[_0x1333('0x4b')](handleError(_0x40497c,null));}});}catch(_0x1da584){_0x40497c[_0x1333('0x21')](0x1f4)[_0x1333('0x2f')](_0x1da584);}};function removeReferences(_0x1d34e3,_0x40373e){try{if(_0x1d34e3){fs[_0x1333('0x64')](_0x1d34e3);logger['info'](_0x1333('0x98'));}if(_0x40373e){rimraf(_0x40373e,function(){});logger[_0x1333('0x65')](_0x1333('0x99'));}}catch(_0x3ebdab){logger[_0x1333('0x2d')](_0x3ebdab);}}exports[_0x1333('0x9a')]=function(_0x290db5,_0x27215c,_0x4f253c){return db[_0x1333('0x32')][_0x1333('0x4a')]({'where':{'id':_0x290db5[_0x1333('0x48')]['id']}})['then'](handleEntityNotFound(_0x27215c,null))['then'](saveUpdates(_0x290db5['body'],null))['then'](respondWithResult(_0x27215c,null))[_0x1333('0x4b')](handleError(_0x27215c,null));};exports[_0x1333('0x9b')]=function(_0x312fc8,_0x456fbf,_0x1a011f){return db['Plugin'][_0x1333('0x4a')]({'where':{'id':_0x312fc8[_0x1333('0x48')]['id']}})[_0x1333('0x2a')](function(_0x33068f){if(_0x33068f){return _0x33068f[_0x1333('0x29')]();}})[_0x1333('0x2a')](function(_0x2ea898){rimraf(path[_0x1333('0x59')](config[_0x1333('0x5a')],'server/files/plugins',path[_0x1333('0x5b')](_0x2ea898['path'])),function(){});return _0x2ea898;})[_0x1333('0x2a')](handleEntityNotFound(_0x456fbf,null))['then'](respondWithStatusCode(_0x456fbf,null))[_0x1333('0x4b')](handleError(_0x456fbf,null));};exports[_0x1333('0x9c')]=function(_0x5f28e0,_0x3dc8e0,_0x3226ec){return BPromise['resolve']()[_0x1333('0x2a')](function(){if(!_0x5f28e0['query'][_0x1333('0x8')]){throw new Error(_0x1333('0x9d'));}if(!_0x5f28e0[_0x1333('0x37')]['port']){throw new Error(_0x1333('0x9e'));}var _0x18e8b0=_0x5f28e0[_0x1333('0x37')][_0x1333('0x9f')]?_0x5f28e0[_0x1333('0x37')][_0x1333('0x9f')]+':'+_0x5f28e0['query'][_0x1333('0xa0')]:_0x1333('0xa1')+_0x5f28e0['query'][_0x1333('0xa0')];var _0x2bb2b1=_0x5f28e0['query'][_0x1333('0x22')]?_0x5f28e0['query'][_0x1333('0x22')]:!![];var _0x1d76e3=_0x5f28e0[_0x1333('0x37')]['encoding']?_0x5f28e0['query'][_0x1333('0xa2')]:null;var _0x47fb91={'method':_0x5f28e0[_0x1333('0xa3')],'uri':util[_0x1333('0x4e')]('%s%s',_0x18e8b0,_0x5f28e0['query'][_0x1333('0x8')]),'json':_0x2bb2b1,'resolveWithFullResponse':!![],'encoding':_0x1d76e3,'qs':_0x5f28e0['query']};if(_0x5f28e0[_0x1333('0xa4')]){_0x47fb91[_0x1333('0xa4')]=_0x5f28e0[_0x1333('0xa4')];if(_0x47fb91[_0x1333('0xa4')][_0x1333('0xa5')]){delete _0x47fb91['headers'][_0x1333('0xa5')];}}if(_0x47fb91['headers'][_0x1333('0xa6')]){delete _0x47fb91[_0x1333('0xa4')][_0x1333('0xa6')];}return rp(_0x47fb91);})['then'](function(_0x3be580){if(_0x3be580){_0x3dc8e0['set'](_0x3be580[_0x1333('0xa4')]);logger[_0x1333('0x65')](_0x3be580['body']);if(_[_0x1333('0xa7')](_0x5f28e0['query'][_0x1333('0x8')],_0x1333('0x4c'))&&_0x3be580[_0x1333('0xa8')]==0x1f4){return _0x3dc8e0[_0x1333('0xa9')](_0x3be580[_0x1333('0xa8')]);}else{return _0x3dc8e0['status'](_0x3be580[_0x1333('0xa8')])[_0x1333('0x2f')](_0x3be580[_0x1333('0x90')]);}}else{return _0x3dc8e0[_0x1333('0xa9')](0xc8);}})[_0x1333('0x4b')](handleError(_0x3dc8e0,null));};exports[_0x1333('0xaa')]=function(_0x23a048,_0x353ea5,_0x49d129){return BPromise[_0x1333('0xab')]()[_0x1333('0x2a')](function(){if(!_0x23a048[_0x1333('0x37')][_0x1333('0x8')]){throw new Error(_0x1333('0x9d'));}if(!_0x23a048['query']['port']){throw new Error(_0x1333('0x9e'));}var _0x3e3298=_0x23a048['query']['hostname']?_0x23a048[_0x1333('0x37')]['hostname']+':'+_0x23a048[_0x1333('0x37')]['port']:_0x1333('0xa1')+_0x23a048[_0x1333('0x37')][_0x1333('0xa0')];var _0x2f560d=_0x23a048[_0x1333('0x37')][_0x1333('0x22')]?_0x23a048[_0x1333('0x37')][_0x1333('0x22')]:!![];var _0x489208=_0x23a048[_0x1333('0x37')][_0x1333('0xa2')]?_0x23a048[_0x1333('0x37')][_0x1333('0xa2')]:null;var _0x34286f={'method':_0x23a048[_0x1333('0xa3')],'uri':util[_0x1333('0x4e')]('%s%s',_0x3e3298,_0x23a048[_0x1333('0x37')][_0x1333('0x8')]),'json':_0x2f560d,'resolveWithFullResponse':!![],'encoding':_0x489208,'body':_0x23a048[_0x1333('0x90')]};if(_0x23a048[_0x1333('0xa4')]){_0x34286f[_0x1333('0xa4')]=_0x23a048[_0x1333('0xa4')];if(_0x34286f['headers'][_0x1333('0xa5')]){delete _0x34286f[_0x1333('0xa4')][_0x1333('0xa5')];}}if(_0x34286f[_0x1333('0xa4')][_0x1333('0xa6')]){delete _0x34286f['headers'][_0x1333('0xa6')];}return rp(_0x34286f);})[_0x1333('0x2a')](function(_0x37a562){if(_0x37a562){_0x353ea5[_0x1333('0x26')](_0x37a562[_0x1333('0xa4')]);logger['info'](_0x37a562[_0x1333('0x90')]);return _0x353ea5['status'](_0x37a562[_0x1333('0xa8')])[_0x1333('0x2f')](_0x37a562[_0x1333('0x90')]);}else{return _0x353ea5[_0x1333('0xa9')](0xc8);}})[_0x1333('0x4b')](handleError(_0x353ea5,null));}; \ No newline at end of file +var _0x5723=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Plugins','UserProfileResource','error','stack','name','index','map','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','type','merge','Plugin','includeAll','include','rows','catch','show','params','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','glob','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','user','get','UserProfileSection','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','send','hostname','method','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end'];(function(_0xab667e,_0x476d6d){var _0x28d477=function(_0x2543e8){while(--_0x2543e8){_0xab667e['push'](_0xab667e['shift']());}};_0x28d477(++_0x476d6d);}(_0x5723,0x12f));var _0x3572=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5723[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x3572('0x0'));var rimraf=require(_0x3572('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3572('0x2'));var rp=require(_0x3572('0x3'));var moment=require('moment');var BPromise=require(_0x3572('0x4'));var Mustache=require(_0x3572('0x5'));var util=require(_0x3572('0x6'));var path=require(_0x3572('0x7'));var sox=require(_0x3572('0x8'));var csv=require(_0x3572('0x9'));var ejs=require(_0x3572('0xa'));var fs=require('fs');var fs_extra=require(_0x3572('0xb'));var _=require(_0x3572('0xc'));var squel=require(_0x3572('0xd'));var crypto=require(_0x3572('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3572('0x9'));var querystring=require('querystring');var Papa=require(_0x3572('0xf'));var extract=require(_0x3572('0x10'));var rimraf=require(_0x3572('0x1'));var archiver=require(_0x3572('0x11'));var Redis=require(_0x3572('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3572('0x13'));var as=require(_0x3572('0x14'));var hardwareService=require(_0x3572('0x15'));var logger=require('../../config/logger')(_0x3572('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3572('0x17'));var db=require(_0x3572('0x18'))['db'];config['redis']=_['defaults'](config[_0x3572('0x19')],{'host':_0x3572('0x1a'),'port':0x18eb});var socket=require(_0x3572('0x1b'))(new Redis(config['redis']));require(_0x3572('0x1c'))[_0x3572('0x1d')](socket);function respondWithStatusCode(_0x14b068,_0x336be9){_0x336be9=_0x336be9||0xcc;return function(_0x3bed48){if(_0x3bed48){return _0x14b068[_0x3572('0x1e')](_0x336be9);}return _0x14b068[_0x3572('0x1f')](_0x336be9)[_0x3572('0x20')]();};}function respondWithResult(_0x67be4b,_0x12db3c){_0x12db3c=_0x12db3c||0xc8;return function(_0x1c1a51){if(_0x1c1a51){return _0x67be4b['status'](_0x12db3c)[_0x3572('0x21')](_0x1c1a51);}};}function respondWithFilteredResult(_0x352aae,_0x4ae714){return function(_0x16d5d2){if(_0x16d5d2){var _0x35a464=typeof _0x4ae714[_0x3572('0x22')]===_0x3572('0x23')&&typeof _0x4ae714['limit']==='undefined';var _0xa3fca4=_0x16d5d2[_0x3572('0x24')];var _0x3a8d93=_0x35a464?0x0:_0x4ae714[_0x3572('0x22')];var _0x9c71e9=_0x35a464?_0x16d5d2[_0x3572('0x24')]:_0x4ae714[_0x3572('0x22')]+_0x4ae714[_0x3572('0x25')];var _0x1628ec;if(_0x9c71e9>=_0xa3fca4){_0x9c71e9=_0xa3fca4;_0x1628ec=0xc8;}else{_0x1628ec=0xce;}_0x352aae[_0x3572('0x1f')](_0x1628ec);return _0x352aae[_0x3572('0x26')](_0x3572('0x27'),_0x3a8d93+'-'+_0x9c71e9+'/'+_0xa3fca4)[_0x3572('0x21')](_0x16d5d2);}return null;};}function patchUpdates(_0x32be83){return function(_0x594dd4){try{jsonpatch[_0x3572('0x28')](_0x594dd4,_0x32be83,!![]);}catch(_0x30e16a){return BPromise[_0x3572('0x29')](_0x30e16a);}return _0x594dd4[_0x3572('0x2a')]();};}function saveUpdates(_0x1175c9,_0x4bc8ee){return function(_0x26a0a9){if(_0x26a0a9){return _0x26a0a9[_0x3572('0x2b')](_0x1175c9)[_0x3572('0x2c')](function(_0x20621a){return _0x20621a;});}return null;};}function removeEntity(_0x5a8fe0,_0x4cfb62){return function(_0x1e7ceb){if(_0x1e7ceb){return _0x1e7ceb[_0x3572('0x2d')]()['then'](function(){var _0x27e224=_0x1e7ceb['get']({'plain':!![]});var _0x466ac9=_0x3572('0x2e');return db[_0x3572('0x2f')][_0x3572('0x2d')]({'where':{'type':_0x466ac9,'resourceId':_0x27e224['id']}})['then'](function(){return _0x1e7ceb;});})[_0x3572('0x2c')](function(){_0x5a8fe0[_0x3572('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c32a7,_0x2aeb3f){return function(_0x1a7b18){if(!_0x1a7b18){_0x1c32a7['sendStatus'](0x194);}return _0x1a7b18;};}function handleError(_0x53bf0f,_0x55dece){_0x55dece=_0x55dece||0x1f4;return function(_0x9d8c2a){logger[_0x3572('0x30')](_0x9d8c2a[_0x3572('0x31')]);if(_0x9d8c2a[_0x3572('0x32')]){delete _0x9d8c2a[_0x3572('0x32')];}_0x53bf0f[_0x3572('0x1f')](_0x55dece)['send'](_0x9d8c2a);};}exports[_0x3572('0x33')]=function(_0x328e7b,_0xd5201b){var _0x272983={},_0xef4922={},_0x2fddbc={'count':0x0,'rows':[]};var _0x1062db=_[_0x3572('0x34')](db['Plugin'][_0x3572('0x35')],function(_0x19f2b5){return{'name':_0x19f2b5['fieldName'],'type':_0x19f2b5['type']['key']};});_0xef4922[_0x3572('0x36')]=_[_0x3572('0x34')](_0x1062db,'name');_0xef4922[_0x3572('0x37')]=_[_0x3572('0x38')](_0x328e7b[_0x3572('0x37')]);_0xef4922['filters']=_[_0x3572('0x39')](_0xef4922[_0x3572('0x36')],_0xef4922[_0x3572('0x37')]);_0x272983['attributes']=_[_0x3572('0x39')](_0xef4922[_0x3572('0x36')],qs['fields'](_0x328e7b[_0x3572('0x37')][_0x3572('0x3a')]));_0x272983[_0x3572('0x3b')]=_0x272983[_0x3572('0x3b')][_0x3572('0x3c')]?_0x272983[_0x3572('0x3b')]:_0xef4922[_0x3572('0x36')];if(!_0x328e7b[_0x3572('0x37')][_0x3572('0x3d')]('nolimit')){_0x272983[_0x3572('0x25')]=qs['limit'](_0x328e7b[_0x3572('0x37')][_0x3572('0x25')]);_0x272983[_0x3572('0x22')]=qs[_0x3572('0x22')](_0x328e7b[_0x3572('0x37')][_0x3572('0x22')]);}_0x272983['order']=qs['sort'](_0x328e7b[_0x3572('0x37')][_0x3572('0x3e')]);_0x272983[_0x3572('0x3f')]=qs[_0x3572('0x40')](_[_0x3572('0x41')](_0x328e7b[_0x3572('0x37')],_0xef4922[_0x3572('0x40')]),_0x1062db);if(_0x328e7b[_0x3572('0x37')][_0x3572('0x42')]){_0x272983['where']=_['merge'](_0x272983[_0x3572('0x3f')],{'$or':_[_0x3572('0x34')](_0x1062db,function(_0x389d02){if(_0x389d02[_0x3572('0x43')]!=='VIRTUAL'){var _0x14b4b1={};_0x14b4b1[_0x389d02[_0x3572('0x32')]]={'$like':'%'+_0x328e7b[_0x3572('0x37')][_0x3572('0x42')]+'%'};return _0x14b4b1;}})});}_0x272983=_[_0x3572('0x44')]({},_0x272983,_0x328e7b['options']);var _0x41699f={'where':_0x272983['where']};return db[_0x3572('0x45')][_0x3572('0x24')](_0x41699f)['then'](function(_0x36fd7f){_0x2fddbc[_0x3572('0x24')]=_0x36fd7f;if(_0x328e7b[_0x3572('0x37')][_0x3572('0x46')]){_0x272983[_0x3572('0x47')]=[{'all':!![]}];}return db[_0x3572('0x45')]['findAll'](_0x272983);})[_0x3572('0x2c')](function(_0x32dbe0){_0x2fddbc[_0x3572('0x48')]=_0x32dbe0;return _0x2fddbc;})[_0x3572('0x2c')](respondWithFilteredResult(_0xd5201b,_0x272983))[_0x3572('0x49')](handleError(_0xd5201b,null));};exports[_0x3572('0x4a')]=function(_0x517452,_0x4ef01b){var _0x3bbfdd={'raw':!![],'where':{'id':_0x517452[_0x3572('0x4b')]['id']}},_0x191130={};_0x191130[_0x3572('0x36')]=_[_0x3572('0x38')](db[_0x3572('0x45')][_0x3572('0x35')]);_0x191130[_0x3572('0x37')]=_[_0x3572('0x38')](_0x517452['query']);_0x191130[_0x3572('0x40')]=_[_0x3572('0x39')](_0x191130[_0x3572('0x36')],_0x191130['query']);_0x3bbfdd[_0x3572('0x3b')]=_[_0x3572('0x39')](_0x191130[_0x3572('0x36')],qs[_0x3572('0x3a')](_0x517452[_0x3572('0x37')][_0x3572('0x3a')]));_0x3bbfdd[_0x3572('0x3b')]=_0x3bbfdd[_0x3572('0x3b')][_0x3572('0x3c')]?_0x3bbfdd[_0x3572('0x3b')]:_0x191130[_0x3572('0x36')];if(_0x517452[_0x3572('0x37')][_0x3572('0x46')]){_0x3bbfdd[_0x3572('0x47')]=[{'all':!![]}];}_0x3bbfdd=_[_0x3572('0x44')]({},_0x3bbfdd,_0x517452['options']);return db[_0x3572('0x45')][_0x3572('0x4c')](_0x3bbfdd)[_0x3572('0x2c')](handleEntityNotFound(_0x4ef01b,null))[_0x3572('0x2c')](respondWithResult(_0x4ef01b,null))['catch'](handleError(_0x4ef01b,null));};exports[_0x3572('0x4d')]=function(_0x1eb4b1,_0x232cd2,_0x646b3b){return db[_0x3572('0x45')][_0x3572('0x4c')]({'where':{'id':_0x1eb4b1['params']['id']},'attributes':[_0x3572('0x32'),_0x3572('0x7')],'raw':!![]})[_0x3572('0x2c')](handleEntityNotFound(_0x232cd2,null))['then'](function(_0x49ba6e){if(_0x49ba6e){var _0x11eba5=path[_0x3572('0x4e')](config[_0x3572('0x4f')],_0x3572('0x50'),util[_0x3572('0x51')](_0x3572('0x52'),path[_0x3572('0x53')](_0x49ba6e[_0x3572('0x7')])));var _0x47c75f=fs[_0x3572('0x54')](_0x11eba5);var _0x1c5ec7=archiver(_0x3572('0x55'),{'zlib':{'level':0x9}});_0x1c5ec7['on']('warning',function(_0x74d21d){if(_0x74d21d[_0x3572('0x56')]==='ENOENT'){logger[_0x3572('0x30')](_0x74d21d);}else{throw new db['Sequelize'][(_0x3572('0x57'))](_0x3572('0x58'));}});_0x1c5ec7['on']('error',function(_0x4da471){throw new db[(_0x3572('0x59'))]['Error'](_0x3572('0x58'));});_0x1c5ec7['pipe'](_0x47c75f);_0x1c5ec7[_0x3572('0x5a')]('**/*',{'cwd':path[_0x3572('0x4e')](config[_0x3572('0x4f')],'server/files/plugins',path['dirname'](_0x49ba6e['path'])),'ignore':[path['join'](path[_0x3572('0x53')](_0x49ba6e['path']),_0x3572('0x5b')),path[_0x3572('0x4e')](path[_0x3572('0x53')](_0x49ba6e[_0x3572('0x7')]),_0x3572('0x5c'))],'nodir':!![]})[_0x3572('0x5d')]();_0x47c75f['on'](_0x3572('0x5e'),function(){if(!fs['existsSync'](_0x11eba5)){throw new db[(_0x3572('0x59'))]['Error'](_0x3572('0x5f'));}return _0x232cd2['download'](_0x11eba5,util[_0x3572('0x51')](_0x3572('0x52'),path[_0x3572('0x53')](_0x49ba6e[_0x3572('0x7')])),function(_0x29046b){if(_0x29046b){throw new db[(_0x3572('0x59'))][(_0x3572('0x57'))](_0x3572('0x60'));}fs['unlinkSync'](_0x11eba5);logger[_0x3572('0x61')](_0x3572('0x62'));logger['info'](_0x3572('0x63'));});});}return null;})[_0x3572('0x49')](handleError(_0x232cd2,null));};exports['upload']=function(_0x1b6729,_0x1b2289,_0x55ffdd){var _0x3a9a0f=path[_0x3572('0x53')](_0x1b6729[_0x3572('0x64')][_0x3572('0x65')],path[_0x3572('0x66')](_0x1b6729[_0x3572('0x64')]['filename']));var _0x5ce954=path[_0x3572('0x4e')](config[_0x3572('0x4f')],'server/files/plugins',_0x1b6729['file'][_0x3572('0x65')]);var _0x1f9527=path['join'](config[_0x3572('0x4f')],_0x3572('0x50'),_0x3a9a0f);logger[_0x3572('0x61')]('Plugin\x20upload\x20filepath:\x20%s',_0x5ce954);logger[_0x3572('0x61')](_0x3572('0x67'),_0x1f9527);try{fs['chmodSync'](_0x5ce954,parseInt(_0x3572('0x68'),0x8));extract(_0x5ce954,{'dir':_0x1f9527},function(_0x988d9d){if(_0x988d9d){logger[_0x3572('0x30')](_0x988d9d);handleError(_0x988d9d,!![]);};var _0x290fc9=fs[_0x3572('0x69')](_0x1f9527);if(_0x290fc9[_0x3572('0x3c')]>0x1){removeReferences(_0x5ce954,_0x1f9527);logger[_0x3572('0x30')]('Invalid\x20plugin\x20structure');return _0x55ffdd(new Error(_0x3572('0x6a')));}var _0xde04a=fs[_0x3572('0x6b')](path['join'](_0x1f9527,_0x290fc9[0x0]));if(_0xde04a[_0x3572('0x6c')]()){removeReferences(_0x5ce954,_0x1f9527);logger[_0x3572('0x30')](_0x3572('0x6a'));return _0x55ffdd(new Error(_0x3572('0x6a')));}if(_0xde04a[_0x3572('0x6d')]()){var _0xf3235f=fs['readdirSync'](path[_0x3572('0x4e')](_0x1f9527,_0x290fc9[0x0]));if(_0xf3235f[_0x3572('0x3c')]===0x0){removeReferences(_0x5ce954,_0x1f9527);logger[_0x3572('0x30')](_0x3572('0x6a'));return _0x55ffdd(new Error('Invalid\x20plugin\x20structure'));}var _0x588dda=_0xf3235f[_0x3572('0x6e')](function(_0x4a8d0f){return _0x4a8d0f===_0x3572('0x6f');});if(!_0x588dda){return _0x55ffdd(new Error(_0x3572('0x70')));}var _0x2d7ae3=fs[_0x3572('0x71')](path[_0x3572('0x4e')](_0x1f9527,_0x290fc9[0x0],'manifest.json'));var _0x28207d=JSON[_0x3572('0x72')](_0x2d7ae3);if(_0x3572('0x23')==typeof _0x28207d[_0x3572('0x32')]){return _0x55ffdd(new Error(_0x3572('0x73')));}if(_0x3572('0x23')==typeof _0x28207d[_0x3572('0x43')]){return _0x55ffdd(new Error(_0x3572('0x74')));}if('undefined'==typeof _0x28207d['version']){return _0x55ffdd(new Error(_0x3572('0x75')));}if(_0x3572('0x23')==typeof _0x28207d[_0x3572('0x76')]){return _0x55ffdd(new Error(_0x3572('0x77')));}if(_0x28207d[_0x3572('0x43')]===_0x3572('0x78')){if(_0x3572('0x23')==typeof _0x28207d[_0x3572('0x76')][_0x3572('0x79')]){return _0x55ffdd(new Error(_0x3572('0x7a')));}if(_0x3572('0x23')==typeof _0x28207d[_0x3572('0x76')][_0x3572('0x79')][_0x3572('0x7b')]&&_0x3572('0x23')==typeof _0x28207d[_0x3572('0x76')][_0x3572('0x79')][_0x3572('0x7c')]){return _0x55ffdd(new Error(_0x3572('0x7d')));}}else if(_0x28207d[_0x3572('0x43')]===_0x3572('0x7e')){if('undefined'==typeof _0x28207d[_0x3572('0x76')][_0x3572('0x7f')]){return _0x55ffdd(new Error(_0x3572('0x80')));}if(_0x3572('0x23')==typeof _0x28207d[_0x3572('0x76')]['scriptPath']){return _0x55ffdd(new Error(_0x3572('0x81')));}}else{return _0x55ffdd(new Error(_0x3572('0x82')));}var _0x54b0e0=_0x28207d['name'];var _0x332b44=_0x28207d[_0x3572('0x83')];var _0x392c00=_0x28207d[_0x3572('0x43')];var _0x52919d=_0x28207d[_0x3572('0x84')]?_0x28207d['sidebar']:'always';var _0x42caa8=_0x28207d[_0x3572('0x85')]?_0x28207d[_0x3572('0x85')]:_0x3572('0x86');var _0x204808='';var _0x132e57='';var _0x436962='';var _0x5231cd='';var _0x17b7e5=_0x28207d['version'];if(_0x392c00==='html'){if(_0x3572('0x23')!=typeof _0x28207d['parameters'][_0x3572('0x79')][_0x3572('0x7b')]){var _0x364ba0=_0x28207d[_0x3572('0x76')][_0x3572('0x79')][_0x3572('0x7b')];if(!/^(f|ht)tps?:\/\//i['test'](_0x364ba0)){_0x204808=path[_0x3572('0x4e')](_0x3572('0x87'),_0x3a9a0f,_0x290fc9[0x0],_0x364ba0);}else{_0x204808=_0x364ba0;}}else{logger['info'](_0x3572('0x88'));}if(_0x3572('0x23')!=typeof _0x28207d[_0x3572('0x76')]['views'][_0x3572('0x7c')]){var _0x574ece=_0x28207d['parameters'][_0x3572('0x79')][_0x3572('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0x3572('0x89')](_0x574ece)){_0x132e57=path[_0x3572('0x4e')](_0x3572('0x87'),_0x3a9a0f,_0x290fc9[0x0],_0x574ece);}else{_0x132e57=_0x574ece;}}else{logger[_0x3572('0x61')](_0x3572('0x8a'));}}else if(_0x392c00===_0x3572('0x7e')){_0x436962=_0x28207d[_0x3572('0x76')][_0x3572('0x7f')];_0x5231cd=_0x28207d[_0x3572('0x76')][_0x3572('0x8b')];if('undefined'!=typeof _0x28207d[_0x3572('0x76')]['views']){if(_0x3572('0x23')!=typeof _0x28207d[_0x3572('0x76')]['views'][_0x3572('0x7b')]){var _0x364ba0=_0x28207d[_0x3572('0x76')][_0x3572('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x3572('0x89')](_0x364ba0)){_0x204808=path['join'](_0x3572('0x87'),_0x3a9a0f,_0x290fc9[0x0],_0x364ba0);}else{_0x204808=_0x364ba0;}}if(_0x3572('0x23')!=typeof _0x28207d['parameters'][_0x3572('0x79')][_0x3572('0x7c')]){var _0x574ece=_0x28207d[_0x3572('0x76')][_0x3572('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x3572('0x89')](_0x574ece)){_0x132e57=path[_0x3572('0x4e')](_0x3572('0x87'),_0x3a9a0f,_0x290fc9[0x0],_0x574ece);}else{_0x132e57=_0x574ece;}}}}var _0x16b902={'name':_0x54b0e0,'description':_0x332b44,'path':path[_0x3572('0x4e')](_0x3a9a0f,_0x290fc9[0x0]),'type':_0x392c00,'sidebar':_0x52919d,'icon':_0x42caa8,'adminUrl':_0x204808,'agentUrl':_0x132e57,'scriptName':_0x436962,'scriptPath':_0x5231cd,'version':_0x17b7e5};removeReferences(_0x5ce954,null);return db[_0x3572('0x45')][_0x3572('0x8c')](_0x16b902)[_0x3572('0x2c')](function(_0x42579d){var _0x52c083={'role':_0x1b6729[_0x3572('0x8d')][_0x3572('0x8e')],'userProfileId':_0x1b6729[_0x3572('0x8d')][_0x3572('0x8f')]};if(!_0x52c083)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52c083[_0x3572('0x8e')]===_0x3572('0x90')){var _0x353683=_0x42579d[_0x3572('0x91')]({'plain':!![]});return db[_0x3572('0x92')][_0x3572('0x4c')]({'where':{'name':_0x3572('0x2e'),'userProfileId':_0x52c083[_0x3572('0x8f')]},'raw':!![]})[_0x3572('0x2c')](function(_0x53fe74){if(_0x53fe74&&_0x53fe74['autoAssociation']===0x0){return db[_0x3572('0x2f')][_0x3572('0x8c')]({'name':_0x353683[_0x3572('0x32')],'resourceId':_0x353683['id'],'type':_0x53fe74['name'],'sectionId':_0x53fe74['id']},{})['then'](function(){return _0x42579d;});}else{return _0x42579d;}})[_0x3572('0x49')](function(_0x381c4f){logger[_0x3572('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x381c4f);throw _0x381c4f;});}return _0x42579d;})[_0x3572('0x2c')](respondWithResult(_0x1b2289,null))[_0x3572('0x49')](handleError(_0x1b2289,null));}});}catch(_0x26292f){_0x1b2289[_0x3572('0x1f')](0x1f4)['send'](_0x26292f);}};function removeReferences(_0x5b4469,_0x2ffd82){try{if(_0x5b4469){fs[_0x3572('0x93')](_0x5b4469);logger[_0x3572('0x61')](_0x3572('0x94'));}if(_0x2ffd82){rimraf(_0x2ffd82,function(){});logger[_0x3572('0x61')](_0x3572('0x95'));}}catch(_0x4d0ddd){logger[_0x3572('0x30')](_0x4d0ddd);}}exports[_0x3572('0x2b')]=function(_0x7be52b,_0x11132e,_0x5c0302){return db[_0x3572('0x45')][_0x3572('0x4c')]({'where':{'id':_0x7be52b[_0x3572('0x4b')]['id']}})[_0x3572('0x2c')](handleEntityNotFound(_0x11132e,null))[_0x3572('0x2c')](saveUpdates(_0x7be52b['body'],null))[_0x3572('0x2c')](respondWithResult(_0x11132e,null))[_0x3572('0x49')](handleError(_0x11132e,null));};exports[_0x3572('0x96')]=function(_0x178e50,_0x5eed67,_0x2ab436){return db[_0x3572('0x45')][_0x3572('0x4c')]({'where':{'id':_0x178e50['params']['id']}})['then'](function(_0xf8c771){if(_0xf8c771){return _0xf8c771[_0x3572('0x2d')]();}})[_0x3572('0x2c')](function(_0x1dff21){rimraf(path['join'](config[_0x3572('0x4f')],_0x3572('0x50'),path[_0x3572('0x97')](_0x1dff21['path'])),function(){});return _0x1dff21;})[_0x3572('0x2c')](handleEntityNotFound(_0x5eed67,null))[_0x3572('0x2c')](respondWithStatusCode(_0x5eed67,null))[_0x3572('0x49')](handleError(_0x5eed67,null));};exports[_0x3572('0x98')]=function(_0x20f1a2,_0x5d3c84,_0x288546){return BPromise[_0x3572('0x99')]()[_0x3572('0x2c')](function(){if(!_0x20f1a2[_0x3572('0x37')][_0x3572('0x7')]){throw new Error(_0x3572('0x9a'));}if(!_0x20f1a2['query'][_0x3572('0x9b')]){throw new Error(_0x3572('0x9c'));}var _0x58da9d=_0x20f1a2['query']['hostname']?_0x20f1a2['query']['hostname']+':'+_0x20f1a2['query'][_0x3572('0x9b')]:_0x3572('0x9d')+_0x20f1a2['query'][_0x3572('0x9b')];var _0x4d7db5=_0x20f1a2[_0x3572('0x37')][_0x3572('0x21')]?_0x20f1a2[_0x3572('0x37')]['json']:!![];var _0x2103b1=_0x20f1a2['query'][_0x3572('0x9e')]?_0x20f1a2[_0x3572('0x37')][_0x3572('0x9e')]:null;var _0x5b2dfb={'method':_0x20f1a2['method'],'uri':util['format'](_0x3572('0x9f'),_0x58da9d,_0x20f1a2['query']['path']),'json':_0x4d7db5,'resolveWithFullResponse':!![],'encoding':_0x2103b1,'qs':_0x20f1a2[_0x3572('0x37')]};if(_0x20f1a2[_0x3572('0xa0')]){_0x5b2dfb['headers']=_0x20f1a2[_0x3572('0xa0')];if(_0x5b2dfb[_0x3572('0xa0')][_0x3572('0xa1')]){delete _0x5b2dfb['headers'][_0x3572('0xa1')];}}if(_0x5b2dfb[_0x3572('0xa0')][_0x3572('0xa2')]){delete _0x5b2dfb['headers'][_0x3572('0xa2')];}return rp(_0x5b2dfb);})[_0x3572('0x2c')](function(_0x3f9271){if(_0x3f9271){_0x5d3c84['set'](_0x3f9271[_0x3572('0xa0')]);logger[_0x3572('0x61')](_0x3f9271[_0x3572('0x8d')]);if(_[_0x3572('0xa3')](_0x20f1a2['query'][_0x3572('0x7')],_0x3572('0x4d'))&&_0x3f9271['statusCode']==0x1f4){return _0x5d3c84['sendStatus'](_0x3f9271[_0x3572('0xa4')]);}else{return _0x5d3c84['status'](_0x3f9271[_0x3572('0xa4')])[_0x3572('0xa5')](_0x3f9271[_0x3572('0x8d')]);}}else{return _0x5d3c84['sendStatus'](0xc8);}})[_0x3572('0x49')](handleError(_0x5d3c84,null));};exports['webhookPost']=function(_0x1f734a,_0x2d32f2,_0x595745){return BPromise['resolve']()[_0x3572('0x2c')](function(){if(!_0x1f734a[_0x3572('0x37')][_0x3572('0x7')]){throw new Error(_0x3572('0x9a'));}if(!_0x1f734a[_0x3572('0x37')][_0x3572('0x9b')]){throw new Error(_0x3572('0x9c'));}var _0x36683f=_0x1f734a[_0x3572('0x37')]['hostname']?_0x1f734a[_0x3572('0x37')][_0x3572('0xa6')]+':'+_0x1f734a[_0x3572('0x37')]['port']:_0x3572('0x9d')+_0x1f734a[_0x3572('0x37')]['port'];var _0x46d05b=_0x1f734a[_0x3572('0x37')][_0x3572('0x21')]?_0x1f734a['query'][_0x3572('0x21')]:!![];var _0x34caa9=_0x1f734a['query'][_0x3572('0x9e')]?_0x1f734a['query'][_0x3572('0x9e')]:null;var _0x5c7a90={'method':_0x1f734a[_0x3572('0xa7')],'uri':util[_0x3572('0x51')]('%s%s',_0x36683f,_0x1f734a[_0x3572('0x37')]['path']),'json':_0x46d05b,'resolveWithFullResponse':!![],'encoding':_0x34caa9,'body':_0x1f734a[_0x3572('0x8d')]};if(_0x1f734a[_0x3572('0xa0')]){_0x5c7a90['headers']=_0x1f734a[_0x3572('0xa0')];if(_0x5c7a90[_0x3572('0xa0')][_0x3572('0xa1')]){delete _0x5c7a90[_0x3572('0xa0')][_0x3572('0xa1')];}}if(_0x5c7a90[_0x3572('0xa0')]['content-type']){delete _0x5c7a90['headers']['content-type'];}return rp(_0x5c7a90);})[_0x3572('0x2c')](function(_0x5abb21){if(_0x5abb21){_0x2d32f2[_0x3572('0x26')](_0x5abb21[_0x3572('0xa0')]);logger[_0x3572('0x61')](_0x5abb21[_0x3572('0x8d')]);return _0x2d32f2[_0x3572('0x1f')](_0x5abb21['statusCode'])['send'](_0x5abb21[_0x3572('0x8d')]);}else{return _0x2d32f2['sendStatus'](0xc8);}})[_0x3572('0x49')](handleError(_0x2d32f2,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 82aed89..a728f21 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 _0xd819=['exports','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hook'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0xd819,0x181));var _0x9d81=function(_0x5807d4,_0x29306b){_0x5807d4=_0x5807d4-0x0;var _0x5ddf9b=_0xd819[_0x5807d4];return _0x5ddf9b;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x9d81('0x0'))['db'][_0x9d81('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x9d81('0x2')](0x0);var events={'afterCreate':_0x9d81('0x3'),'afterUpdate':'update','afterDestroy':_0x9d81('0x4')};function emitEvent(_0x5591a5){return function(_0x301265,_0x53ff09,_0x382cc1){PluginEvents[_0x9d81('0x5')](_0x5591a5+':'+_0x301265['id'],_0x301265);PluginEvents[_0x9d81('0x5')](_0x5591a5,_0x301265);_0x382cc1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x9d81('0x6')](e,emitEvent(event));}}module[_0x9d81('0x7')]=PluginEvents; \ No newline at end of file +var _0xf693=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x41eef5,_0x8bffa9){var _0x2308d8=function(_0x29bdab){while(--_0x29bdab){_0x41eef5['push'](_0x41eef5['shift']());}};_0x2308d8(++_0x8bffa9);}(_0xf693,0x181));var _0x3f69=function(_0x527c70,_0x24b571){_0x527c70=_0x527c70-0x0;var _0x5e92b8=_0xf693[_0x527c70];return _0x5e92b8;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x3f69('0x0'))['db'][_0x3f69('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x3f69('0x2')](0x0);var events={'afterCreate':_0x3f69('0x3'),'afterUpdate':_0x3f69('0x4'),'afterDestroy':_0x3f69('0x5')};function emitEvent(_0x414ca5){return function(_0x527646,_0xf2fdd8,_0x300282){PluginEvents[_0x3f69('0x6')](_0x414ca5+':'+_0x527646['id'],_0x527646);PluginEvents[_0x3f69('0x6')](_0x414ca5,_0x527646);_0x300282(null);};}for(var e in events){if(events[_0x3f69('0x7')](e)){var event=events[e];Plugin[_0x3f69('0x8')](e,emitEvent(event));}}module[_0x3f69('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 13b71bc..368e6f6 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 _0x9a14=['define','Plugin','plugins','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a14,0xa8));var _0x49a1=function(_0x596853,_0x13a1da){_0x596853=_0x596853-0x0;var _0x1fa06b=_0x9a14[_0x596853];return _0x1fa06b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49a1('0x0'))(_0x49a1('0x1'));var moment=require(_0x49a1('0x2'));var BPromise=require(_0x49a1('0x3'));var rp=require(_0x49a1('0x4'));var fs=require('fs');var path=require(_0x49a1('0x5'));var rimraf=require(_0x49a1('0x6'));var config=require(_0x49a1('0x7'));var attributes=require('./plugin.attributes');module['exports']=function(_0x479018,_0x5283aa){return _0x479018[_0x49a1('0x8')](_0x49a1('0x9'),attributes,{'tableName':_0x49a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe806=['../../config/logger','request-promise','path','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xe806,0x15c));var _0x6e80=function(_0x21107e,_0x1ed944){_0x21107e=_0x21107e-0x0;var _0x33744a=_0xe806[_0x21107e];return _0x33744a;};'use strict';var _=require(_0x6e80('0x0'));var util=require(_0x6e80('0x1'));var logger=require(_0x6e80('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e80('0x3'));var fs=require('fs');var path=require(_0x6e80('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6e80('0x5'));module[_0x6e80('0x6')]=function(_0x292922,_0x2c58f7){return _0x292922[_0x6e80('0x7')](_0x6e80('0x8'),attributes,{'tableName':_0x6e80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 408a1ee..cac86b7 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 _0xcebc=['create','raw','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreatePlugin'];(function(_0x37b2f7,_0x394a57){var _0x3006b3=function(_0x2af197){while(--_0x2af197){_0x37b2f7['push'](_0x37b2f7['shift']());}};_0x3006b3(++_0x394a57);}(_0xcebc,0x76));var _0xcceb=function(_0x2382df,_0x5514d9){_0x2382df=_0x2382df-0x0;var _0x85f05a=_0xcebc[_0x2382df];return _0x85f05a;};'use strict';var _=require(_0xcceb('0x0'));var util=require('util');var moment=require(_0xcceb('0x1'));var BPromise=require(_0xcceb('0x2'));var rs=require(_0xcceb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcceb('0x4'));var logger=require(_0xcceb('0x5'))(_0xcceb('0x6'));var config=require(_0xcceb('0x7'));var jayson=require(_0xcceb('0x8'));var client=jayson[_0xcceb('0x9')]['http']({'port':0x232a});config[_0xcceb('0xa')]=_['defaults'](config['redis'],{'host':_0xcceb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcceb('0xc'))[_0xcceb('0xd')](socket);function respondWithRpcPromise(_0x198b9c,_0x606529,_0x34d573){return new BPromise(function(_0x2bd895,_0x3bf4f2){return client[_0xcceb('0xe')](_0x198b9c,_0x34d573)[_0xcceb('0xf')](function(_0x378159){logger[_0xcceb('0x10')](_0xcceb('0x11'),_0x606529,_0xcceb('0x12'));logger[_0xcceb('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0x606529,_0xcceb('0x12'),JSON[_0xcceb('0x14')](_0x378159));if(_0x378159[_0xcceb('0x15')]){if(_0x378159[_0xcceb('0x15')][_0xcceb('0x16')]===0x1f4){logger[_0xcceb('0x15')]('Plugin,\x20%s,\x20%s',_0x606529,_0x378159['error'][_0xcceb('0x17')]);return _0x3bf4f2(_0x378159[_0xcceb('0x15')][_0xcceb('0x17')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x606529,_0x378159[_0xcceb('0x15')][_0xcceb('0x17')]);return _0x2bd895(_0x378159[_0xcceb('0x15')]['message']);}else{logger[_0xcceb('0x10')](_0xcceb('0x11'),_0x606529,'request\x20sent');_0x2bd895(_0x378159[_0xcceb('0x18')][_0xcceb('0x17')]);}})[_0xcceb('0x19')](function(_0x3409fd){logger[_0xcceb('0x15')](_0xcceb('0x11'),_0x606529,_0x3409fd);_0x3bf4f2(_0x3409fd);});});}exports[_0xcceb('0x1a')]=function(_0xdca7d9){var _0x2531c9=this;return new Promise(function(_0x48b3a8,_0x179f29){return db['Plugin'][_0xcceb('0x1b')](_0xdca7d9['body'],{'raw':_0xdca7d9['options']?_0xdca7d9['options'][_0xcceb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x16df9b){logger[_0xcceb('0x10')](_0xcceb('0x1a'),_0xdca7d9);logger[_0xcceb('0x13')](_0xcceb('0x1a'),_0xdca7d9,JSON['stringify'](_0x16df9b));_0x48b3a8(_0x16df9b);})[_0xcceb('0x19')](function(_0x5292f4){logger[_0xcceb('0x15')](_0xcceb('0x1a'),_0x5292f4[_0xcceb('0x17')],_0xdca7d9);_0x179f29(_0x2531c9[_0xcceb('0x15')](0x1f4,_0x5292f4[_0xcceb('0x17')]));});});}; \ No newline at end of file +var _0xbaca=['http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','then','CreatePlugin','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1bf23a,_0xfef992){var _0x291927=function(_0x43919f){while(--_0x43919f){_0x1bf23a['push'](_0x1bf23a['shift']());}};_0x291927(++_0xfef992);}(_0xbaca,0x15d));var _0xabac=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0xbaca[_0xcd5a3d];return _0xd43207;};'use strict';var _=require('lodash');var util=require(_0xabac('0x0'));var moment=require(_0xabac('0x1'));var BPromise=require(_0xabac('0x2'));var rs=require(_0xabac('0x3'));var fs=require('fs');var Redis=require(_0xabac('0x4'));var db=require(_0xabac('0x5'))['db'];var utils=require(_0xabac('0x6'));var logger=require(_0xabac('0x7'))(_0xabac('0x8'));var config=require(_0xabac('0x9'));var jayson=require(_0xabac('0xa'));var client=jayson['client'][_0xabac('0xb')]({'port':0x232a});config[_0xabac('0xc')]=_[_0xabac('0xd')](config['redis'],{'host':_0xabac('0xe'),'port':0x18eb});var socket=require(_0xabac('0xf'))(new Redis(config[_0xabac('0xc')]));require(_0xabac('0x10'))[_0xabac('0x11')](socket);function respondWithRpcPromise(_0x36a33f,_0x48644f,_0x178a56){return new BPromise(function(_0x1d7b10,_0x21c12a){return client[_0xabac('0x12')](_0x36a33f,_0x178a56)['then'](function(_0x211b83){logger[_0xabac('0x13')](_0xabac('0x14'),_0x48644f,_0xabac('0x15'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x48644f,_0xabac('0x15'),JSON[_0xabac('0x16')](_0x211b83));if(_0x211b83[_0xabac('0x17')]){if(_0x211b83[_0xabac('0x17')][_0xabac('0x18')]===0x1f4){logger['error'](_0xabac('0x14'),_0x48644f,_0x211b83['error'][_0xabac('0x19')]);return _0x21c12a(_0x211b83[_0xabac('0x17')]['message']);}logger['error'](_0xabac('0x14'),_0x48644f,_0x211b83['error'][_0xabac('0x19')]);return _0x1d7b10(_0x211b83[_0xabac('0x17')][_0xabac('0x19')]);}else{logger['info'](_0xabac('0x14'),_0x48644f,'request\x20sent');_0x1d7b10(_0x211b83[_0xabac('0x1a')][_0xabac('0x19')]);}})[_0xabac('0x1b')](function(_0x47e5da){logger[_0xabac('0x17')](_0xabac('0x14'),_0x48644f,_0x47e5da);_0x21c12a(_0x47e5da);});});}exports['CreatePlugin']=function(_0x3613a7){var _0x3d9868=this;return new Promise(function(_0x185a01,_0x226127){return db[_0xabac('0x1c')][_0xabac('0x1d')](_0x3613a7[_0xabac('0x1e')],{'raw':_0x3613a7[_0xabac('0x1f')]?_0x3613a7['options'][_0xabac('0x20')]===undefined?!![]:![]:!![]})[_0xabac('0x21')](function(_0x429517){logger[_0xabac('0x13')](_0xabac('0x22'),_0x3613a7);logger[_0xabac('0x23')](_0xabac('0x22'),_0x3613a7,JSON[_0xabac('0x16')](_0x429517));_0x185a01(_0x429517);})[_0xabac('0x1b')](function(_0x5acfe2){logger[_0xabac('0x17')]('CreatePlugin',_0x5acfe2[_0xabac('0x19')],_0x3613a7);_0x226127(_0x3d9868['error'](0x1f4,_0x5acfe2[_0xabac('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 6f45a2d..95393c1 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 _0x654a=['removeListener','./plugin.events','remove','update'];(function(_0x1ebd08,_0x15e378){var _0x1af28e=function(_0x1830a1){while(--_0x1830a1){_0x1ebd08['push'](_0x1ebd08['shift']());}};_0x1af28e(++_0x15e378);}(_0x654a,0xc1));var _0xa654=function(_0x5cd70a,_0x51f70a){_0x5cd70a=_0x5cd70a-0x0;var _0x28d47e=_0x654a[_0x5cd70a];return _0x28d47e;};'use strict';var PluginEvents=require(_0xa654('0x0'));var events=['save',_0xa654('0x1'),_0xa654('0x2')];function createListener(_0x4521e4,_0x210e0b){return function(_0x4b1bc2){_0x210e0b['emit'](_0x4521e4,_0x4b1bc2);};}function removeListener(_0x1909e1,_0x45127c){return function(){PluginEvents[_0xa654('0x3')](_0x1909e1,_0x45127c);};}exports['register']=function(_0x65e709){for(var _0x11f13d=0x0,_0x429823=events['length'];_0x11f13d<_0x429823;_0x11f13d++){var _0x4d6c77=events[_0x11f13d];var _0x538ee8=createListener('plugin:'+_0x4d6c77,_0x65e709);PluginEvents['on'](_0x4d6c77,_0x538ee8);}}; \ No newline at end of file +var _0x97a3=['update','emit','removeListener','length','plugin:','./plugin.events','save','remove'];(function(_0x526d45,_0x375eaf){var _0x1c7c0e=function(_0x511267){while(--_0x511267){_0x526d45['push'](_0x526d45['shift']());}};_0x1c7c0e(++_0x375eaf);}(_0x97a3,0x18d));var _0x397a=function(_0x4ffd2a,_0x4fe625){_0x4ffd2a=_0x4ffd2a-0x0;var _0x3107c4=_0x97a3[_0x4ffd2a];return _0x3107c4;};'use strict';var PluginEvents=require(_0x397a('0x0'));var events=[_0x397a('0x1'),_0x397a('0x2'),_0x397a('0x3')];function createListener(_0x42909f,_0x55e2aa){return function(_0x57c6df){_0x55e2aa[_0x397a('0x4')](_0x42909f,_0x57c6df);};}function removeListener(_0x5a8228,_0x397029){return function(){PluginEvents[_0x397a('0x5')](_0x5a8228,_0x397029);};}exports['register']=function(_0x5efcc3){for(var _0x4d802b=0x0,_0xd57c9a=events[_0x397a('0x6')];_0x4d802b<_0xd57c9a;_0x4d802b++){var _0x25dc0d=events[_0x4d802b];var _0x239959=createListener(_0x397a('0x7')+_0x25dc0d,_0x5efcc3);PluginEvents['on'](_0x25dc0d,_0x239959);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7d17bf7..c935438 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(_0x5e8c9a,_0xdedff1){var _0x23f55b=function(_0xcdb3b8){while(--_0xcdb3b8){_0x5e8c9a['push'](_0x5e8c9a['shift']());}};_0x23f55b(++_0xdedff1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x2ab4fa,_0x232091){var _0x53d007=function(_0xf2b0c9){while(--_0xf2b0c9){_0x2ab4fa['push'](_0x2ab4fa['shift']());}};_0x53d007(++_0x232091);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 ad05dcf..8600ff0 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 _0x9aea=['join','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','params','create','body','script'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x9aea,0xdd));var _0xa9ae=function(_0x2167a8,_0x11c8cf){_0x2167a8=_0x2167a8-0x0;var _0x3ecca6=_0x9aea[_0x2167a8];return _0x3ecca6;};'use strict';var _=require(_0xa9ae('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xa9ae('0x1'))('api');var path=require(_0xa9ae('0x2'));var exec=require(_0xa9ae('0x3'))['exec'];var BPromise=require(_0xa9ae('0x4'));function handleEntityNotFound(_0x115593,_0x41fb71){return function(_0x10f91d){if(!_0x10f91d){_0x115593[_0xa9ae('0x5')](0x194);;}return _0x10f91d;};}function respondWithResult(_0x56f942,_0x1aa3b9){_0x1aa3b9=_0x1aa3b9||0xc8;return function(_0x22734b){if(_0x22734b){return _0x56f942[_0xa9ae('0x6')](_0x1aa3b9)['json'](_0x22734b);}return null;};}function handleError(_0x1f2e4b,_0x3917f0){_0x3917f0=_0x3917f0||0x1f4;return function(_0x465bd2){logger[_0xa9ae('0x7')](_0x465bd2[_0xa9ae('0x8')]);if(_0x465bd2[_0xa9ae('0x9')]){delete _0x465bd2[_0xa9ae('0x9')];}_0x1f2e4b[_0xa9ae('0x6')](_0x3917f0)[_0xa9ae('0xa')](_0x465bd2);};}function execChildProcess(){return new BPromise(function(_0x5a8178,_0x3d400c){exec('npm\x20install',function(_0x2addd2,_0x226cf7,_0x112ab5){logger[_0xa9ae('0xb')](_0x226cf7);logger[_0xa9ae('0xb')](_0x112ab5);if(_0x2addd2){logger[_0xa9ae('0x7')](_0x2addd2);return _0x3d400c(_0x2addd2);}return _0x5a8178(_0x226cf7);});});}exports[_0xa9ae('0xc')]=function(_0x2b511a,_0x56de45){return pm2[_0xa9ae('0xd')]()[_0xa9ae('0xe')](function(_0x10882e){if(_0x10882e){var _0x3f7f61=_['reject'](_0x10882e,function(_0x28ce2d){return _0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0xf')||_0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0x10');});return{'rows':_0x3f7f61,'count':_0x3f7f61[_0xa9ae('0x11')]};}return null;})['then'](respondWithResult(_0x56de45,null))[_0xa9ae('0x12')](handleError(_0x56de45,null));};exports[_0xa9ae('0x13')]=function(_0x3e31d9,_0x4ac5a6){return pm2['describe'](_0x3e31d9[_0xa9ae('0x14')]['id'])['then'](respondWithResult(_0x4ac5a6,null))['then'](handleEntityNotFound(_0x4ac5a6,null))[_0xa9ae('0x12')](handleError(_0x4ac5a6,null));};exports[_0xa9ae('0x15')]=function(_0xbfd2ff,_0x42f961){if(_0xbfd2ff['body'][_0xa9ae('0x9')]&&_0xbfd2ff[_0xa9ae('0x16')][_0xa9ae('0x17')]){var _0x688153=path[_0xa9ae('0x18')](__dirname,_0xa9ae('0x19'),_0xbfd2ff[_0xa9ae('0x16')]['script']);var _0xc021cf=process['cwd']();process['chdir'](path['dirname'](_0x688153));return execChildProcess()['then'](function(_0x1afd07){process['chdir'](_0xc021cf);return pm2[_0xa9ae('0x1a')]({'name':_0xbfd2ff['body'][_0xa9ae('0x9')],'script':_0x688153});})[_0xa9ae('0xe')](function(_0x93d637){pm2[_0xa9ae('0x1b')]();return _0x93d637[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x42f961,0xc9))[_0xa9ae('0x12')](handleError(_0x42f961,null));}else{return _0x42f961[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x1c')});}};exports[_0xa9ae('0x1d')]=function(_0x2aac9e,_0xfe9ef1){if(_0x2aac9e[_0xa9ae('0x16')]['id']){delete _0x2aac9e[_0xa9ae('0x16')]['id'];}var _0xb12fa8={'online':'restart','stopped':'stop'};if(_0xb12fa8[_0xa9ae('0x1e')](_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')])){return pm2[_0xb12fa8[_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')]]](_0x2aac9e['params']['id'])['then'](respondWithResult(_0xfe9ef1,0xc8))[_0xa9ae('0x12')](handleError(_0xfe9ef1,null));}else{return _0xfe9ef1[_0xa9ae('0x6')](0x1f4)[_0xa9ae('0xa')]({'message':_0xa9ae('0x1f')});}};exports[_0xa9ae('0x20')]=function(_0x36bc28,_0x5d0c84){if(_0x36bc28['body']['id']){delete _0x36bc28[_0xa9ae('0x16')]['id'];}if(_0x36bc28[_0xa9ae('0x14')]['id']){return pm2[_0xa9ae('0x21')](_0x36bc28[_0xa9ae('0x14')]['id'])[_0xa9ae('0xe')](function(_0x231152){pm2[_0xa9ae('0x1b')]();return _0x231152[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x5d0c84,null))['catch'](handleError(_0x5d0c84,null));}else{return _0x5d0c84[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x22')});}}; \ No newline at end of file +var _0x750a=['restart','stop','Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','index','list','then','reject','express','length','describe','params','body','../../files/plugins','chdir','start','dump','catch','Missing\x20name\x20and/or\x20path','update'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x750a,0x140));var _0xa750=function(_0x5a5a3a,_0xb99151){_0x5a5a3a=_0x5a5a3a-0x0;var _0x5680e0=_0x750a[_0x5a5a3a];return _0x5680e0;};'use strict';var _=require('lodash');var pm2=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xa750('0x1'));var exec=require(_0xa750('0x2'))[_0xa750('0x3')];var BPromise=require(_0xa750('0x4'));function handleEntityNotFound(_0x457cae,_0x43d704){return function(_0x562911){if(!_0x562911){_0x457cae[_0xa750('0x5')](0x194);;}return _0x562911;};}function respondWithResult(_0x10b4d9,_0x2497df){_0x2497df=_0x2497df||0xc8;return function(_0x197299){if(_0x197299){return _0x10b4d9[_0xa750('0x6')](_0x2497df)[_0xa750('0x7')](_0x197299);}return null;};}function handleError(_0x47a4dd,_0x53f2cb){_0x53f2cb=_0x53f2cb||0x1f4;return function(_0x2678ff){logger['error'](_0x2678ff[_0xa750('0x8')]);if(_0x2678ff[_0xa750('0x9')]){delete _0x2678ff['name'];}_0x47a4dd[_0xa750('0x6')](_0x53f2cb)[_0xa750('0xa')](_0x2678ff);};}function execChildProcess(){return new BPromise(function(_0x5870f0,_0x5aca9c){exec(_0xa750('0xb'),function(_0x4b19a1,_0x174fd0,_0x5adaae){logger['info'](_0x174fd0);logger[_0xa750('0xc')](_0x5adaae);if(_0x4b19a1){logger[_0xa750('0xd')](_0x4b19a1);return _0x5aca9c(_0x4b19a1);}return _0x5870f0(_0x174fd0);});});}exports[_0xa750('0xe')]=function(_0x567c51,_0x2f670f){return pm2[_0xa750('0xf')]()[_0xa750('0x10')](function(_0x24e48a){if(_0x24e48a){var _0xa66181=_[_0xa750('0x11')](_0x24e48a,function(_0x5806ed){return _0x5806ed[_0xa750('0x9')]===_0xa750('0x12')||_0x5806ed[_0xa750('0x9')]==='motion2';});return{'rows':_0xa66181,'count':_0xa66181[_0xa750('0x13')]};}return null;})[_0xa750('0x10')](respondWithResult(_0x2f670f,null))['catch'](handleError(_0x2f670f,null));};exports['show']=function(_0x321eb2,_0x5b1e6b){return pm2[_0xa750('0x14')](_0x321eb2[_0xa750('0x15')]['id'])['then'](respondWithResult(_0x5b1e6b,null))[_0xa750('0x10')](handleEntityNotFound(_0x5b1e6b,null))['catch'](handleError(_0x5b1e6b,null));};exports['create']=function(_0x25e335,_0x5d0935){if(_0x25e335[_0xa750('0x16')]['name']&&_0x25e335[_0xa750('0x16')]['script']){var _0x3dc7f1=path['join'](__dirname,_0xa750('0x17'),_0x25e335['body']['script']);var _0xaa9d3e=process['cwd']();process[_0xa750('0x18')](path['dirname'](_0x3dc7f1));return execChildProcess()['then'](function(_0x5b433d){process['chdir'](_0xaa9d3e);return pm2[_0xa750('0x19')]({'name':_0x25e335[_0xa750('0x16')][_0xa750('0x9')],'script':_0x3dc7f1});})[_0xa750('0x10')](function(_0x1b80a5){pm2[_0xa750('0x1a')]();return _0x1b80a5[0x0];})[_0xa750('0x10')](respondWithResult(_0x5d0935,0xc9))[_0xa750('0x1b')](handleError(_0x5d0935,null));}else{return _0x5d0935[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x1c')});}};exports[_0xa750('0x1d')]=function(_0x31ea63,_0x3f7d6d){if(_0x31ea63[_0xa750('0x16')]['id']){delete _0x31ea63['body']['id'];}var _0x3d3923={'online':_0xa750('0x1e'),'stopped':_0xa750('0x1f')};if(_0x3d3923['hasOwnProperty'](_0x31ea63[_0xa750('0x16')][_0xa750('0x6')])){return pm2[_0x3d3923[_0x31ea63[_0xa750('0x16')][_0xa750('0x6')]]](_0x31ea63['params']['id'])[_0xa750('0x10')](respondWithResult(_0x3f7d6d,0xc8))[_0xa750('0x1b')](handleError(_0x3f7d6d,null));}else{return _0x3f7d6d[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x20')});}};exports['destroy']=function(_0x46cc11,_0x4c2c9e){if(_0x46cc11[_0xa750('0x16')]['id']){delete _0x46cc11[_0xa750('0x16')]['id'];}if(_0x46cc11['params']['id']){return pm2[_0xa750('0x21')](_0x46cc11[_0xa750('0x15')]['id'])[_0xa750('0x10')](function(_0x314f88){pm2[_0xa750('0x1a')]();return _0x314f88[0x0];})[_0xa750('0x10')](respondWithResult(_0x4c2c9e,null))[_0xa750('0x1b')](handleError(_0x4c2c9e,null));}else{return _0x4c2c9e[_0xa750('0x6')](0x1f4)['send']({'message':_0xa750('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 3ecb6fc..10928af 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 _0x72d7=['../../components/auth/service','./realtime.controller','get','/queues','getQueues','express','Router'];(function(_0x12d26b,_0x50028d){var _0x223fe0=function(_0x838498){while(--_0x838498){_0x12d26b['push'](_0x12d26b['shift']());}};_0x223fe0(++_0x50028d);}(_0x72d7,0x19b));var _0x772d=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x72d7[_0x5037ab];return _0x512adb;};'use strict';var express=require(_0x772d('0x0'));var router=express[_0x772d('0x1')]();var auth=require(_0x772d('0x2'));var controller=require(_0x772d('0x3'));router[_0x772d('0x4')](_0x772d('0x5'),auth['isAuthenticated'](),controller[_0x772d('0x6')]);module['exports']=router; \ No newline at end of file +var _0x32b6=['get','getQueues','exports','express','Router','./realtime.controller'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x32b6,0x1d1));var _0x632b=function(_0x5e38ec,_0x2bf2a4){_0x5e38ec=_0x5e38ec-0x0;var _0x124f41=_0x32b6[_0x5e38ec];return _0x124f41;};'use strict';var express=require(_0x632b('0x0'));var router=express[_0x632b('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x632b('0x2'));router[_0x632b('0x3')]('/queues',auth['isAuthenticated'](),controller[_0x632b('0x4')]);module[_0x632b('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 6c3b9b4..715f0ce 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 _0xeda8=['find','merge','getAgents','online','then','length','UserId','User','findAll','agent','catch','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','offset','status','Content-Range','json','error','stack','name','send','getQueues','mail','sms','fax','voice','query','channel','includes','toLowerCase','Invalid\x20channel','Queue','map','fieldName','user','role','type','outbound','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','request','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','loggedIn','available','waiting','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','paused','loggedInDb','talking','agents'];(function(_0x4bbdd5,_0x1560f3){var _0x1e7fb2=function(_0x26e084){while(--_0x26e084){_0x4bbdd5['push'](_0x4bbdd5['shift']());}};_0x1e7fb2(++_0x1560f3);}(_0xeda8,0x104));var _0x8eda=function(_0x3ba49d,_0x2d52cb){_0x3ba49d=_0x3ba49d-0x0;var _0x2c0cfd=_0xeda8[_0x3ba49d];return _0x2c0cfd;};'use strict';var util=require(_0x8eda('0x0'));var _=require(_0x8eda('0x1'));var jayson=require('jayson/promise');var qs=require(_0x8eda('0x2'));var logger=require(_0x8eda('0x3'))(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var client=jayson[_0x8eda('0x6')][_0x8eda('0x7')]({'port':0x232a});var routingClient=jayson[_0x8eda('0x6')][_0x8eda('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x22dee9,_0x1f3556){return function(_0x349361){if(_0x349361){var _0x32abe8=typeof _0x1f3556['offset']===_0x8eda('0x8')&&typeof _0x1f3556[_0x8eda('0x9')]===_0x8eda('0x8');var _0x6b544f=_0x349361['count'];var _0x4f7893=_0x32abe8?0x0:_0x1f3556['offset'];var _0x4fbf0a=_0x32abe8?_0x349361[_0x8eda('0xa')]:_0x1f3556[_0x8eda('0xb')]+_0x1f3556[_0x8eda('0x9')];var _0x515c63;if(_0x4fbf0a>=_0x6b544f){_0x4fbf0a=_0x6b544f;_0x515c63=0xc8;}else{_0x515c63=0xce;}_0x22dee9[_0x8eda('0xc')](_0x515c63);return _0x22dee9['set'](_0x8eda('0xd'),_0x4f7893+'-'+_0x4fbf0a+'/'+_0x6b544f)[_0x8eda('0xe')](_0x349361);}return null;};}function handleError(_0x2fdec0,_0x1ad3df){_0x1ad3df=_0x1ad3df||0x1f4;return function(_0x337573){logger[_0x8eda('0xf')](_0x337573[_0x8eda('0x10')]);if(_0x337573[_0x8eda('0x11')]){delete _0x337573['name'];}_0x2fdec0['status'](_0x1ad3df)[_0x8eda('0x12')](_0x337573);};}exports[_0x8eda('0x13')]=function(_0x4fa040,_0x106a04){var _0x34b1ee=[_0x8eda('0x14'),'chat',_0x8eda('0x15'),'openchannel',_0x8eda('0x16'),'whatsapp',_0x8eda('0x17')];var _0x58023b={'count':0x0,'rows':[]},_0x38a6a0={},_0x2a4d2b;Promise['resolve']()['then'](function(){if(_0x4fa040[_0x8eda('0x18')][_0x8eda('0x19')]){if(!_[_0x8eda('0x1a')](_0x34b1ee,_0x4fa040[_0x8eda('0x18')][_0x8eda('0x19')][_0x8eda('0x1b')]()))throw new Error(_0x8eda('0x1c'));_0x2a4d2b=_0x4fa040[_0x8eda('0x18')][_0x8eda('0x19')][_0x8eda('0x1b')]();}var _0x279ade=_['startCase'](_0x2a4d2b)+_0x8eda('0x1d');var _0x4f8483=_[_0x8eda('0x1e')](db[_0x279ade]['rawAttributes'],function(_0x1033d6){return{'name':_0x1033d6[_0x8eda('0x1f')],'type':_0x1033d6['type']['key']};});_0x38a6a0=qs['getOptions'](_0x4f8483,_0x4fa040);if(_0x4fa040[_0x8eda('0x20')][_0x8eda('0x21')]==='user'){var _0x978502={'params':{'id':_0x4fa040[_0x8eda('0x20')]['userProfileId']},'query':{'section':_0x2a4d2b===_0x8eda('0x17')&&_0x4fa040[_0x8eda('0x18')][_0x8eda('0x22')]===_0x8eda('0x23')?_0x8eda('0x24'):_['startCase'](_0x2a4d2b)+_0x8eda('0x25'),'type':_0x4fa040['query'][_0x8eda('0x22')],'nolimit':!![],'sort':_0x8eda('0x11'),'filter':_0x4fa040[_0x8eda('0x18')]['filter']}};return db[_0x8eda('0x26')][_0x8eda('0x27')](_0x978502);}return db[_0x279ade][_0x8eda('0x28')](_0x38a6a0);})['then'](function(_0x1616ea){_0x58023b[_0x8eda('0xa')]=_0x1616ea['count'];var _0x27d2ce=_0x2a4d2b===_0x8eda('0x17')?client:routingClient;return _0x27d2ce[_0x8eda('0x29')](_[_0x8eda('0x2a')](_0x2a4d2b)+'Queues',_0x4fa040)['then'](function(_0x54513c){if(_0x54513c[_0x8eda('0xf')])throw new Error(util[_0x8eda('0x2b')](_0x8eda('0x2c'),_0x2a4d2b));var _0x540690=_0x54513c['result'];var _0x5b45c1=[_0x8eda('0x2d'),_0x8eda('0x2e'),_0x8eda('0x2f'),'talking','paused'];if(_0x2a4d2b==='voice'&&_0x4fa040[_0x8eda('0x18')][_0x8eda('0x22')]===_0x8eda('0x23')){_0x5b45c1[_0x8eda('0x30')](_0x8eda('0x31'),_0x8eda('0x32'),_0x8eda('0x33'),_0x8eda('0x34'),_0x8eda('0x35'),_0x8eda('0x36'),_0x8eda('0x37'),_0x8eda('0x38'),_0x8eda('0x39'),_0x8eda('0x3a'),'erlangAbandonmentRate',_0x8eda('0x3b'),_0x8eda('0x3c'),_0x8eda('0x3d'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x8eda('0x3e'),_0x8eda('0x3f'),_0x8eda('0x40'),_0x8eda('0x41'),'predictiveIntervalAvgHoldtime',_0x8eda('0x42'));}var _0x40efe7=_0x1616ea[_0x8eda('0x43')][_0x8eda('0x1e')](function(_0x567aa6){var _0x29a706=_0x567aa6['get']({'plain':!![]});_0x29a706[_0x8eda('0x44')]=0x0;_0x29a706[_0x8eda('0x45')]=0x0;_0x29a706[_0x8eda('0x2d')]=0x0;_0x29a706[_0x8eda('0x2e')]=0x0;_0x29a706[_0x8eda('0x44')]=0x0;_0x29a706[_0x8eda('0x2f')]=0x0;if(_0x2a4d2b==='voice'){_0x29a706[_0x8eda('0x46')]=0x0;if(_0x4fa040[_0x8eda('0x18')][_0x8eda('0x22')]===_0x8eda('0x23')){_0x29a706[_0x8eda('0x31')]=0x0;_0x29a706['originated']=0x0;}}_0x29a706[_0x8eda('0x47')]=[];var _0x3481ea=_[_0x8eda('0x48')](_0x540690['rows'],['id',_0x29a706['id']]);if(_0x3481ea)_[_0x8eda('0x49')](_0x29a706,_['pick'](_0x3481ea,_0x5b45c1));if(_0x2a4d2b===_0x8eda('0x17')){return _0x567aa6[_0x8eda('0x4a')]({'attributes':['id',_0x8eda('0x11'),_0x8eda('0x4b')],'joinTableAttributes':[],'raw':!![]})[_0x8eda('0x4c')](function(_0x5cdc89){return _0x567aa6['getMembers']({'raw':!![]})[_0x8eda('0x4c')](function(_0xfcb278){for(var _0x80927d=0x0;_0x80927d<_0x5cdc89[_0x8eda('0x4d')];_0x80927d++){var _0x2fd79a=_[_0x8eda('0x48')](_0xfcb278,[_0x8eda('0x4e'),_0x5cdc89[_0x80927d]['id']]);var _0xcb6164={'id':_0x5cdc89[_0x80927d]['id'],'name':_0x5cdc89[_0x80927d][_0x8eda('0x11')],'online':Boolean(_0x5cdc89[_0x80927d][_0x8eda('0x4b')]),'paused':_0x2fd79a?Boolean(_0x2fd79a[_0x8eda('0x44')]):![]};if(_0xcb6164[_0x8eda('0x4b')])_0x29a706[_0x8eda('0x45')]++;if(_0xcb6164[_0x8eda('0x44')])_0x29a706[_0x8eda('0x44')]++;_0x29a706[_0x8eda('0x47')][_0x8eda('0x30')](_0xcb6164);}return _0x29a706;});});}else{var _0x106232=_0x8eda('0x4f')+_['startCase'](_0x2a4d2b)+_0x8eda('0x1d');var _0x16b9a3=_0x2a4d2b+'Pause';return db[_0x106232][_0x8eda('0x50')]({'where':{[_[_0x8eda('0x2a')](_0x2a4d2b)+'QueueId']:_0x567aa6['id']},'raw':!![]})[_0x8eda('0x4c')](function(_0x1fff77){return db['User'][_0x8eda('0x50')]({'attributes':['id',_0x8eda('0x11'),_0x8eda('0x4b'),_0x16b9a3],'where':{'id':_['map'](_0x1fff77,_0x8eda('0x4e')),'role':_0x8eda('0x51')},'raw':!![]});})[_0x8eda('0x4c')](function(_0xd8b8f4){for(var _0x1fb1a8=0x0;_0x1fb1a8<_0xd8b8f4[_0x8eda('0x4d')];_0x1fb1a8++){var _0x2ce641={'id':_0xd8b8f4[_0x1fb1a8]['id'],'name':_0xd8b8f4[_0x1fb1a8]['name'],'online':Boolean(_0xd8b8f4[_0x1fb1a8][_0x8eda('0x4b')]),'paused':Boolean(_0xd8b8f4[_0x1fb1a8][_0x16b9a3])};if(_0x2ce641['online'])_0x29a706[_0x8eda('0x45')]++;if(_0x2ce641['paused'])_0x29a706[_0x8eda('0x44')]++;_0x29a706['agents'][_0x8eda('0x30')](_0x2ce641);}return _0x29a706;});}});return Promise['all'](_0x40efe7);});})[_0x8eda('0x4c')](function(_0x3aca19){_0x58023b[_0x8eda('0x43')]=_0x3aca19;return _0x58023b;})[_0x8eda('0x4c')](respondWithFilteredResult(_0x106a04,_0x38a6a0))[_0x8eda('0x52')](handleError(_0x106a04,null));}; \ No newline at end of file +var _0x6a55=['map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','waiting','talking','paused','message','dialActive','dialMethod','startPredictive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','rows','loggedInDb','loggedIn','available','outbound','pTalking','originated','agents','find','merge','pick','getAgents','name','length','online','push','User','Queue','findAll','QueueId','UserId','catch','util','../../config/logger','client','offset','undefined','limit','count','status','json','error','stack','send','getQueues','mail','sms','fax','voice','resolve','then','query','includes','channel','toLowerCase','startCase'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x6a55,0xdb));var _0x56a5=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x6a55[_0x1a4a06];return _0x49ec08;};'use strict';var util=require(_0x56a5('0x0'));var _=require('lodash');var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x56a5('0x1'))('api');var db=require('../../mysqldb')['db'];var client=jayson[_0x56a5('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x56a5('0x2')]['http']({'port':0x232c});function respondWithFilteredResult(_0x28bb2b,_0x380b1b){return function(_0x42d164){if(_0x42d164){var _0x293ea1=typeof _0x380b1b[_0x56a5('0x3')]===_0x56a5('0x4')&&typeof _0x380b1b[_0x56a5('0x5')]===_0x56a5('0x4');var _0x586f7a=_0x42d164[_0x56a5('0x6')];var _0xf15490=_0x293ea1?0x0:_0x380b1b[_0x56a5('0x3')];var _0x4370c2=_0x293ea1?_0x42d164[_0x56a5('0x6')]:_0x380b1b[_0x56a5('0x3')]+_0x380b1b[_0x56a5('0x5')];var _0x258c20;if(_0x4370c2>=_0x586f7a){_0x4370c2=_0x586f7a;_0x258c20=0xc8;}else{_0x258c20=0xce;}_0x28bb2b[_0x56a5('0x7')](_0x258c20);return _0x28bb2b['set']('Content-Range',_0xf15490+'-'+_0x4370c2+'/'+_0x586f7a)[_0x56a5('0x8')](_0x42d164);}return null;};}function handleError(_0x21dfee,_0x2b9d7d){_0x2b9d7d=_0x2b9d7d||0x1f4;return function(_0x1a9bf0){logger[_0x56a5('0x9')](_0x1a9bf0[_0x56a5('0xa')]);if(_0x1a9bf0['name']){delete _0x1a9bf0['name'];}_0x21dfee[_0x56a5('0x7')](_0x2b9d7d)[_0x56a5('0xb')](_0x1a9bf0);};}exports[_0x56a5('0xc')]=function(_0x1d7aac,_0x310c32){var _0x2db112=[_0x56a5('0xd'),'chat',_0x56a5('0xe'),'openchannel',_0x56a5('0xf'),'whatsapp',_0x56a5('0x10')];var _0x3f3e5b={'count':0x0,'rows':[]},_0x173c65={},_0x28fe74;Promise[_0x56a5('0x11')]()[_0x56a5('0x12')](function(){if(_0x1d7aac[_0x56a5('0x13')]['channel']){if(!_[_0x56a5('0x14')](_0x2db112,_0x1d7aac[_0x56a5('0x13')][_0x56a5('0x15')][_0x56a5('0x16')]()))throw new Error('Invalid\x20channel');_0x28fe74=_0x1d7aac[_0x56a5('0x13')][_0x56a5('0x15')][_0x56a5('0x16')]();}var _0x15e469=_[_0x56a5('0x17')](_0x28fe74)+'Queue';var _0x55579d=_[_0x56a5('0x18')](db[_0x15e469][_0x56a5('0x19')],function(_0x487505){return{'name':_0x487505[_0x56a5('0x1a')],'type':_0x487505[_0x56a5('0x1b')][_0x56a5('0x1c')]};});_0x173c65=qs[_0x56a5('0x1d')](_0x55579d,_0x1d7aac);if(_0x1d7aac[_0x56a5('0x1e')][_0x56a5('0x1f')]===_0x56a5('0x1e')){var _0x8431df={'params':{'id':_0x1d7aac[_0x56a5('0x1e')][_0x56a5('0x20')]},'query':{'section':_0x28fe74===_0x56a5('0x10')&&_0x1d7aac[_0x56a5('0x13')][_0x56a5('0x1b')]==='outbound'?_0x56a5('0x21'):_[_0x56a5('0x17')](_0x28fe74)+_0x56a5('0x22'),'type':_0x1d7aac[_0x56a5('0x13')][_0x56a5('0x1b')],'nolimit':!![],'sort':'name','filter':_0x1d7aac[_0x56a5('0x13')]['filter']}};return db[_0x56a5('0x23')][_0x56a5('0x24')](_0x8431df);}return db[_0x15e469][_0x56a5('0x25')](_0x173c65);})[_0x56a5('0x12')](function(_0x4e7afd){_0x3f3e5b[_0x56a5('0x6')]=_0x4e7afd[_0x56a5('0x6')];var _0x178f11=_0x28fe74==='voice'?client:routingClient;return _0x178f11[_0x56a5('0x26')](_[_0x56a5('0x17')](_0x28fe74)+_0x56a5('0x22'),_0x1d7aac)[_0x56a5('0x12')](function(_0x55978e){if(_0x55978e['error'])throw new Error(util[_0x56a5('0x27')](_0x56a5('0x28'),_0x28fe74));var _0x19e354=_0x55978e[_0x56a5('0x29')];var _0x643937=['loggedIn','available',_0x56a5('0x2a'),_0x56a5('0x2b'),_0x56a5('0x2c')];if(_0x28fe74==='voice'&&_0x1d7aac[_0x56a5('0x13')][_0x56a5('0x1b')]==='outbound'){_0x643937['push']('pTalking','originated',_0x56a5('0x2d'),_0x56a5('0x2e'),_0x56a5('0x2f'),'Trunk',_0x56a5('0x30'),'startProgressive',_0x56a5('0x31'),_0x56a5('0x32'),'erlangAbandonmentRate',_0x56a5('0x33'),'dialPredictiveInterval',_0x56a5('0x34'),_0x56a5('0x35'),_0x56a5('0x36'),'predictiveIntervalTotalCalls',_0x56a5('0x37'),_0x56a5('0x38'),_0x56a5('0x39'),'predictiveIntervalAvgHoldtime',_0x56a5('0x3a'));}var _0x2b4fc7=_0x4e7afd[_0x56a5('0x3b')][_0x56a5('0x18')](function(_0x2633f6){var _0x594b14=_0x2633f6['get']({'plain':!![]});_0x594b14[_0x56a5('0x2c')]=0x0;_0x594b14[_0x56a5('0x3c')]=0x0;_0x594b14[_0x56a5('0x3d')]=0x0;_0x594b14[_0x56a5('0x3e')]=0x0;_0x594b14[_0x56a5('0x2c')]=0x0;_0x594b14[_0x56a5('0x2a')]=0x0;if(_0x28fe74===_0x56a5('0x10')){_0x594b14[_0x56a5('0x2b')]=0x0;if(_0x1d7aac[_0x56a5('0x13')][_0x56a5('0x1b')]===_0x56a5('0x3f')){_0x594b14[_0x56a5('0x40')]=0x0;_0x594b14[_0x56a5('0x41')]=0x0;}}_0x594b14[_0x56a5('0x42')]=[];var _0x102242=_[_0x56a5('0x43')](_0x19e354[_0x56a5('0x3b')],['id',_0x594b14['id']]);if(_0x102242)_[_0x56a5('0x44')](_0x594b14,_[_0x56a5('0x45')](_0x102242,_0x643937));if(_0x28fe74===_0x56a5('0x10')){return _0x2633f6[_0x56a5('0x46')]({'attributes':['id',_0x56a5('0x47'),'online'],'joinTableAttributes':[],'raw':!![]})['then'](function(_0xe63fd5){return _0x2633f6['getMembers']({'raw':!![]})[_0x56a5('0x12')](function(_0x3cba63){for(var _0x480cfb=0x0;_0x480cfb<_0xe63fd5[_0x56a5('0x48')];_0x480cfb++){var _0x1753cc=_[_0x56a5('0x43')](_0x3cba63,['UserId',_0xe63fd5[_0x480cfb]['id']]);var _0x5c565a={'id':_0xe63fd5[_0x480cfb]['id'],'name':_0xe63fd5[_0x480cfb][_0x56a5('0x47')],'online':Boolean(_0xe63fd5[_0x480cfb][_0x56a5('0x49')]),'paused':_0x1753cc?Boolean(_0x1753cc[_0x56a5('0x2c')]):![]};if(_0x5c565a[_0x56a5('0x49')])_0x594b14[_0x56a5('0x3c')]++;if(_0x5c565a[_0x56a5('0x2c')])_0x594b14['paused']++;_0x594b14[_0x56a5('0x42')][_0x56a5('0x4a')](_0x5c565a);}return _0x594b14;});});}else{var _0x5a3e7b=_0x56a5('0x4b')+_[_0x56a5('0x17')](_0x28fe74)+_0x56a5('0x4c');var _0x30ea07=_0x28fe74+'Pause';return db[_0x5a3e7b][_0x56a5('0x4d')]({'where':{[_['startCase'](_0x28fe74)+_0x56a5('0x4e')]:_0x2633f6['id']},'raw':!![]})[_0x56a5('0x12')](function(_0x59e400){return db[_0x56a5('0x4b')]['findAll']({'attributes':['id',_0x56a5('0x47'),_0x56a5('0x49'),_0x30ea07],'where':{'id':_['map'](_0x59e400,_0x56a5('0x4f')),'role':'agent'},'raw':!![]});})[_0x56a5('0x12')](function(_0x4ac7b9){for(var _0x35f045=0x0;_0x35f045<_0x4ac7b9['length'];_0x35f045++){var _0x1b6bc9={'id':_0x4ac7b9[_0x35f045]['id'],'name':_0x4ac7b9[_0x35f045][_0x56a5('0x47')],'online':Boolean(_0x4ac7b9[_0x35f045][_0x56a5('0x49')]),'paused':Boolean(_0x4ac7b9[_0x35f045][_0x30ea07])};if(_0x1b6bc9[_0x56a5('0x49')])_0x594b14[_0x56a5('0x3c')]++;if(_0x1b6bc9[_0x56a5('0x2c')])_0x594b14[_0x56a5('0x2c')]++;_0x594b14['agents']['push'](_0x1b6bc9);}return _0x594b14;});}});return Promise['all'](_0x2b4fc7);});})[_0x56a5('0x12')](function(_0x1bec14){_0x3f3e5b[_0x56a5('0x3b')]=_0x1bec14;return _0x3f3e5b;})['then'](respondWithFilteredResult(_0x310c32,_0x173c65))[_0x56a5('0x50')](handleError(_0x310c32,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 5f5e61b..7eb36d8 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x242152,_0x2f7b09){var _0x167a0d=function(_0x569821){while(--_0x569821){_0x242152['push'](_0x242152['shift']());}};_0x167a0d(++_0x2f7b09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xe50f65,_0x381350){var _0x541fb3=function(_0x46c353){while(--_0x46c353){_0xe50f65['push'](_0xe50f65['shift']());}};_0x541fb3(++_0x381350);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 2749612..12c1afa 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 _0x938d=['sequelize','exports','STRING','DATE','INTEGER'];(function(_0x53fe4d,_0x90990c){var _0x57b293=function(_0x234d27){while(--_0x234d27){_0x53fe4d['push'](_0x53fe4d['shift']());}};_0x57b293(++_0x90990c);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd938('0x0'));module[_0xd938('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd938('0x2')]},'scheduledat':{'type':Sequelize[_0xd938('0x3')]},'uniqueid':{'type':Sequelize[_0xd938('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xd938('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xd938('0x2')]},'campaigntype':{'type':Sequelize[_0xd938('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe548=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0xd43763,_0xfaf71b){var _0x53e1e8=function(_0x417b52){while(--_0x417b52){_0xd43763['push'](_0xd43763['shift']());}};_0x53e1e8(++_0xfaf71b);}(_0xe548,0x184));var _0x8e54=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0xe548[_0xb24fad];return _0x173226;};'use strict';var Sequelize=require(_0x8e54('0x0'));module[_0x8e54('0x1')]={'state':{'type':Sequelize[_0x8e54('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8e54('0x3')]},'scheduledat':{'type':Sequelize[_0x8e54('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x8e54('0x3')]},'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 ffe0f11..169c5c6 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 _0x8acc=['bluebird','request-promise','path','rimraf','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x1471cc,_0x43e681){var _0x2dbbbe=function(_0xc17897){while(--_0xc17897){_0x1471cc['push'](_0x1471cc['shift']());}};_0x2dbbbe(++_0x43e681);}(_0x8acc,0x194));var _0xc8ac=function(_0xbd865c,_0x4d7cc3){_0xbd865c=_0xbd865c-0x0;var _0x1d5f12=_0x8acc[_0xbd865c];return _0x1d5f12;};'use strict';var _=require(_0xc8ac('0x0'));var util=require(_0xc8ac('0x1'));var logger=require(_0xc8ac('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc8ac('0x3'));var rp=require(_0xc8ac('0x4'));var fs=require('fs');var path=require(_0xc8ac('0x5'));var rimraf=require(_0xc8ac('0x6'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xc8ac('0x7')]=function(_0x5803cc,_0x52c3ec){return _0x5803cc[_0xc8ac('0x8')](_0xc8ac('0x9'),attributes,{'tableName':_0xc8ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb60=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x54f4d3,_0x15569b){var _0x52e4ab=function(_0x438dad){while(--_0x438dad){_0x54f4d3['push'](_0x54f4d3['shift']());}};_0x52e4ab(++_0x15569b);}(_0xeb60,0xcf));var _0x0eb6=function(_0x2a6113,_0x53685e){_0x2a6113=_0x2a6113-0x0;var _0x5e7331=_0xeb60[_0x2a6113];return _0x5e7331;};'use strict';var _=require(_0x0eb6('0x0'));var util=require(_0x0eb6('0x1'));var logger=require(_0x0eb6('0x2'))(_0x0eb6('0x3'));var moment=require(_0x0eb6('0x4'));var BPromise=require(_0x0eb6('0x5'));var rp=require(_0x0eb6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0eb6('0x7'));var config=require(_0x0eb6('0x8'));var attributes=require(_0x0eb6('0x9'));module['exports']=function(_0xbc817c,_0x166382){return _0xbc817c[_0x0eb6('0xa')](_0x0eb6('0xb'),attributes,{'tableName':_0x0eb6('0xc'),'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 587bd86..5ef0915 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 _0x7544=['catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then'];(function(_0x23f938,_0x10944f){var _0x244922=function(_0x330bcb){while(--_0x330bcb){_0x23f938['push'](_0x23f938['shift']());}};_0x244922(++_0x10944f);}(_0x7544,0x15d));var _0x4754=function(_0x38b961,_0x314793){_0x38b961=_0x38b961-0x0;var _0x372e06=_0x7544[_0x38b961];return _0x372e06;};'use strict';var _=require('lodash');var util=require(_0x4754('0x0'));var moment=require(_0x4754('0x1'));var BPromise=require(_0x4754('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4754('0x3'));var db=require(_0x4754('0x4'))['db'];var utils=require(_0x4754('0x5'));var logger=require(_0x4754('0x6'))('rpc');var config=require(_0x4754('0x7'));var jayson=require(_0x4754('0x8'));var client=jayson['client'][_0x4754('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2da46c,_0x20a042,_0x1b67ac){return new BPromise(function(_0xf415e6,_0x1a8cde){return client[_0x4754('0xa')](_0x2da46c,_0x1b67ac)['then'](function(_0x5740a9){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x20a042,_0x4754('0xb'));logger[_0x4754('0xc')](_0x4754('0xd'),_0x20a042,_0x4754('0xb'),JSON[_0x4754('0xe')](_0x5740a9));if(_0x5740a9[_0x4754('0xf')]){if(_0x5740a9['error'][_0x4754('0x10')]===0x1f4){logger[_0x4754('0xf')](_0x4754('0x11'),_0x20a042,_0x5740a9['error']['message']);return _0x1a8cde(_0x5740a9[_0x4754('0xf')]['message']);}logger[_0x4754('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x20a042,_0x5740a9[_0x4754('0xf')][_0x4754('0x12')]);return _0xf415e6(_0x5740a9[_0x4754('0xf')][_0x4754('0x12')]);}else{logger[_0x4754('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x20a042,_0x4754('0xb'));_0xf415e6(_0x5740a9[_0x4754('0x14')]['message']);}})['catch'](function(_0x1b7cd8){logger[_0x4754('0xf')](_0x4754('0x11'),_0x20a042,_0x1b7cd8);_0x1a8cde(_0x1b7cd8);});});}exports[_0x4754('0x15')]=function(_0x44f933){var _0x54f3f2=this;return new Promise(function(_0x5a7798,_0x3ad29e){return db[_0x4754('0x16')][_0x4754('0x17')](_0x44f933[_0x4754('0x18')],{'raw':_0x44f933[_0x4754('0x19')]?_0x44f933[_0x4754('0x19')][_0x4754('0x1a')]===undefined?!![]:![]:!![]})[_0x4754('0x1b')](function(_0x293be7){logger[_0x4754('0x13')](_0x4754('0x15'),_0x44f933);logger[_0x4754('0xc')]('CreateReportAgentPreview',_0x44f933,JSON[_0x4754('0xe')](_0x293be7));_0x5a7798(_0x293be7);})[_0x4754('0x1c')](function(_0x392cf5){logger[_0x4754('0xf')](_0x4754('0x15'),_0x392cf5[_0x4754('0x12')],_0x44f933);_0x3ad29e(_0x54f3f2[_0x4754('0xf')](0x1f4,_0x392cf5['message']));});});}; \ No newline at end of file +var _0x9bf8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9bf8,0x162));var _0x89bf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9bf8[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x89bf('0x0'));var util=require(_0x89bf('0x1'));var moment=require(_0x89bf('0x2'));var BPromise=require(_0x89bf('0x3'));var rs=require(_0x89bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89bf('0x6'))(_0x89bf('0x7'));var config=require(_0x89bf('0x8'));var jayson=require(_0x89bf('0x9'));var client=jayson[_0x89bf('0xa')][_0x89bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f09dc,_0x35e039,_0x1a34cf){return new BPromise(function(_0x49c480,_0xb62cf7){return client[_0x89bf('0xc')](_0x5f09dc,_0x1a34cf)['then'](function(_0x2b3730){logger[_0x89bf('0xd')](_0x89bf('0xe'),_0x35e039,_0x89bf('0xf'));logger['debug'](_0x89bf('0x10'),_0x35e039,_0x89bf('0xf'),JSON['stringify'](_0x2b3730));if(_0x2b3730[_0x89bf('0x11')]){if(_0x2b3730[_0x89bf('0x11')][_0x89bf('0x12')]===0x1f4){logger[_0x89bf('0x11')](_0x89bf('0xe'),_0x35e039,_0x2b3730[_0x89bf('0x11')][_0x89bf('0x13')]);return _0xb62cf7(_0x2b3730[_0x89bf('0x11')][_0x89bf('0x13')]);}logger[_0x89bf('0x11')](_0x89bf('0xe'),_0x35e039,_0x2b3730['error'][_0x89bf('0x13')]);return _0x49c480(_0x2b3730['error'][_0x89bf('0x13')]);}else{logger['info'](_0x89bf('0xe'),_0x35e039,_0x89bf('0xf'));_0x49c480(_0x2b3730[_0x89bf('0x14')]['message']);}})[_0x89bf('0x15')](function(_0x5ac3b5){logger[_0x89bf('0x11')](_0x89bf('0xe'),_0x35e039,_0x5ac3b5);_0xb62cf7(_0x5ac3b5);});});}exports[_0x89bf('0x16')]=function(_0x3c5198){var _0x52dd00=this;return new Promise(function(_0xc7e70d,_0x3a0b36){return db[_0x89bf('0x17')][_0x89bf('0x18')](_0x3c5198[_0x89bf('0x19')],{'raw':_0x3c5198[_0x89bf('0x1a')]?_0x3c5198[_0x89bf('0x1a')][_0x89bf('0x1b')]===undefined?!![]:![]:!![]})[_0x89bf('0x1c')](function(_0x29bf47){logger[_0x89bf('0xd')]('CreateReportAgentPreview',_0x3c5198);logger['debug'](_0x89bf('0x16'),_0x3c5198,JSON[_0x89bf('0x1d')](_0x29bf47));_0xc7e70d(_0x29bf47);})['catch'](function(_0xc3d05e){logger['error'](_0x89bf('0x16'),_0xc3d05e[_0x89bf('0x13')],_0x3c5198);_0x3a0b36(_0x52dd00[_0x89bf('0x11')](0x1f4,_0xc3d05e[_0x89bf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index b77de10..3e4016e 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 _0x606b=['isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0x606b,0x9d));var _0xb606=function(_0x2406b8,_0x104782){_0x2406b8=_0x2406b8-0x0;var _0x4ca215=_0x606b[_0x2406b8];return _0x4ca215;};'use strict';var multer=require(_0xb606('0x0'));var util=require('util');var path=require(_0xb606('0x1'));var express=require(_0xb606('0x2'));var router=express['Router']();var auth=require(_0xb606('0x3'));var controller=require(_0xb606('0x4'));router[_0xb606('0x5')](_0xb606('0x6'),auth[_0xb606('0x7')](),controller[_0xb606('0x8')]);router['get'](_0xb606('0x9'),auth[_0xb606('0x7')](),controller[_0xb606('0xa')]);router[_0xb606('0x5')](_0xb606('0xb'),auth[_0xb606('0x7')](),controller[_0xb606('0xc')]);router[_0xb606('0x5')](_0xb606('0xd'),auth[_0xb606('0x7')](),controller[_0xb606('0xe')]);router[_0xb606('0x5')](_0xb606('0xf'),auth[_0xb606('0x7')](),controller['chatQueues']);router['get'](_0xb606('0x10'),auth[_0xb606('0x7')](),controller[_0xb606('0x11')]);router[_0xb606('0x5')]('/mail/accounts',auth[_0xb606('0x7')](),controller['mailAccounts']);router['get'](_0xb606('0x12'),auth[_0xb606('0x7')](),controller[_0xb606('0x13')]);router[_0xb606('0x5')]('/sms/queues',auth[_0xb606('0x7')](),controller[_0xb606('0x14')]);router[_0xb606('0x5')](_0xb606('0x15'),auth[_0xb606('0x7')](),controller[_0xb606('0x16')]);router['get'](_0xb606('0x17'),auth[_0xb606('0x7')](),controller['faxQueues']);router[_0xb606('0x5')](_0xb606('0x18'),auth[_0xb606('0x7')](),controller['voiceQueuesPreview']);router[_0xb606('0x5')](_0xb606('0x19'),auth[_0xb606('0x7')](),controller[_0xb606('0x1a')]);router[_0xb606('0x5')](_0xb606('0x1b'),auth[_0xb606('0x7')](),controller['voiceQueuesChannel']);router[_0xb606('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xb606('0x7')](),controller['voiceQueuesChannelHangup']);router[_0xb606('0x5')](_0xb606('0x1c'),auth[_0xb606('0x7')](),controller[_0xb606('0x1d')]);router[_0xb606('0x5')](_0xb606('0x1e'),auth[_0xb606('0x7')](),controller[_0xb606('0x1f')]);router[_0xb606('0x20')](_0xb606('0x1e'),auth[_0xb606('0x7')](),controller['updateVoiceQueue']);router['get'](_0xb606('0x21'),auth[_0xb606('0x7')](),controller['outbound']);router[_0xb606('0x5')](_0xb606('0x22'),auth['isAuthenticated'](),controller[_0xb606('0x23')]);router[_0xb606('0x5')]('/agents',auth[_0xb606('0x7')](),controller[_0xb606('0x24')]);router[_0xb606('0x20')](_0xb606('0x25'),auth[_0xb606('0x7')](),controller[_0xb606('0x26')]);router[_0xb606('0x5')](_0xb606('0x27'),auth[_0xb606('0x7')](),controller[_0xb606('0x28')]);router['get'](_0xb606('0x29'),auth[_0xb606('0x7')](),controller[_0xb606('0x2a')]);router[_0xb606('0x5')]('/campaigns',auth['isAuthenticated'](),controller[_0xb606('0x2b')]);router['get'](_0xb606('0x2c'),auth[_0xb606('0x7')](),controller[_0xb606('0x2d')]);router[_0xb606('0x5')]('/chat/queues/waitinginteractions',auth[_0xb606('0x7')](),controller[_0xb606('0x2e')]);router[_0xb606('0x5')]('/mail/queues/waitinginteractions',auth[_0xb606('0x7')](),controller[_0xb606('0x2f')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0xb606('0x7')](),controller[_0xb606('0x30')]);router['get'](_0xb606('0x31'),auth[_0xb606('0x7')](),controller[_0xb606('0x32')]);router['get']('/sms/queues/waitinginteractions',auth[_0xb606('0x7')](),controller[_0xb606('0x33')]);router[_0xb606('0x5')](_0xb606('0x34'),auth['isAuthenticated'](),controller[_0xb606('0x35')]);router['get'](_0xb606('0x36'),auth[_0xb606('0x7')](),controller[_0xb606('0x37')]);router[_0xb606('0x38')](_0xb606('0x39'),auth[_0xb606('0x7')](),controller[_0xb606('0x3a')](_0xb606('0x3b')));router['get']('/mail/queues/:id',auth['isAuthenticated'](),controller[_0xb606('0x3c')]);router[_0xb606('0x38')](_0xb606('0x3d'),auth['isAuthenticated'](),controller[_0xb606('0x3a')](_0xb606('0x3e')));router['get'](_0xb606('0x3f'),auth[_0xb606('0x7')](),controller[_0xb606('0x40')]);router['post']('/fax/queues/:id/notify',auth[_0xb606('0x7')](),controller[_0xb606('0x3a')](_0xb606('0x41')));router[_0xb606('0x5')](_0xb606('0x42'),auth['isAuthenticated'](),controller[_0xb606('0x43')]);router[_0xb606('0x38')](_0xb606('0x44'),auth[_0xb606('0x7')](),controller['queueNotify'](_0xb606('0x45')));router['get'](_0xb606('0x46'),auth[_0xb606('0x7')](),controller[_0xb606('0x47')]);router['post'](_0xb606('0x48'),auth[_0xb606('0x7')](),controller[_0xb606('0x3a')](_0xb606('0x49')));router[_0xb606('0x38')](_0xb606('0x4a'),auth[_0xb606('0x7')](),controller['queueNotify'](_0xb606('0x4b')));router[_0xb606('0x5')]('/sms/queues/:id',auth[_0xb606('0x7')](),controller[_0xb606('0x4c')]);router[_0xb606('0x5')](_0xb606('0x4d'),auth[_0xb606('0x7')](),controller[_0xb606('0x4e')]);router[_0xb606('0x38')](_0xb606('0x4f'),auth[_0xb606('0x7')](),controller[_0xb606('0x50')]);module[_0xb606('0x51')]=router; \ No newline at end of file +var _0x24f1=['/trunks','trunks','/campaigns','/fax/accounts','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','express','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x24f1,0xb5));var _0x124f=function(_0x573bbf,_0x77ec64){_0x573bbf=_0x573bbf-0x0;var _0x5cb856=_0x24f1[_0x573bbf];return _0x5cb856;};'use strict';var multer=require(_0x124f('0x0'));var util=require(_0x124f('0x1'));var path=require('path');var express=require(_0x124f('0x2'));var router=express['Router']();var auth=require(_0x124f('0x3'));var controller=require('./rpc.controller');router[_0x124f('0x4')](_0x124f('0x5'),auth[_0x124f('0x6')](),controller[_0x124f('0x7')]);router[_0x124f('0x4')](_0x124f('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x124f('0x4')](_0x124f('0x9'),auth[_0x124f('0x6')](),controller[_0x124f('0xa')]);router['get'](_0x124f('0xb'),auth[_0x124f('0x6')](),controller[_0x124f('0xc')]);router[_0x124f('0x4')]('/chat/queues',auth[_0x124f('0x6')](),controller[_0x124f('0xd')]);router['get'](_0x124f('0xe'),auth['isAuthenticated'](),controller[_0x124f('0xf')]);router[_0x124f('0x4')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x124f('0x10')]);router[_0x124f('0x4')](_0x124f('0x11'),auth[_0x124f('0x6')](),controller[_0x124f('0x12')]);router[_0x124f('0x4')](_0x124f('0x13'),auth[_0x124f('0x6')](),controller['smsQueues']);router[_0x124f('0x4')](_0x124f('0x14'),auth['isAuthenticated'](),controller['whatsappQueues']);router['get'](_0x124f('0x15'),auth[_0x124f('0x6')](),controller[_0x124f('0x16')]);router['get'](_0x124f('0x17'),auth[_0x124f('0x6')](),controller[_0x124f('0x18')]);router[_0x124f('0x4')]('/voice/queues/channels',auth[_0x124f('0x6')](),controller[_0x124f('0x19')]);router[_0x124f('0x4')](_0x124f('0x1a'),auth[_0x124f('0x6')](),controller[_0x124f('0x1b')]);router['get'](_0x124f('0x1c'),auth[_0x124f('0x6')](),controller[_0x124f('0x1d')]);router[_0x124f('0x4')](_0x124f('0x1e'),auth[_0x124f('0x6')](),controller[_0x124f('0x1f')]);router[_0x124f('0x4')](_0x124f('0x20'),auth[_0x124f('0x6')](),controller[_0x124f('0x21')]);router[_0x124f('0x22')]('/voice/queues/:id',auth[_0x124f('0x6')](),controller[_0x124f('0x23')]);router['get']('/outbound',auth[_0x124f('0x6')](),controller[_0x124f('0x24')]);router[_0x124f('0x4')](_0x124f('0x25'),auth[_0x124f('0x6')](),controller[_0x124f('0x26')]);router[_0x124f('0x4')](_0x124f('0x27'),auth[_0x124f('0x6')](),controller[_0x124f('0x28')]);router[_0x124f('0x22')](_0x124f('0x29'),auth[_0x124f('0x6')](),controller[_0x124f('0x2a')]);router[_0x124f('0x4')]('/telephones',auth[_0x124f('0x6')](),controller[_0x124f('0x2b')]);router[_0x124f('0x4')](_0x124f('0x2c'),auth[_0x124f('0x6')](),controller[_0x124f('0x2d')]);router[_0x124f('0x4')](_0x124f('0x2e'),auth[_0x124f('0x6')](),controller['campaigns']);router[_0x124f('0x4')](_0x124f('0x2f'),auth[_0x124f('0x6')](),controller['faxAccounts']);router[_0x124f('0x4')]('/chat/queues/waitinginteractions',auth[_0x124f('0x6')](),controller[_0x124f('0x30')]);router['get']('/mail/queues/waitinginteractions',auth[_0x124f('0x6')](),controller['mailQueuesWaitingInteractions']);router[_0x124f('0x4')]('/openchannel/queues/waitinginteractions',auth[_0x124f('0x6')](),controller[_0x124f('0x31')]);router[_0x124f('0x4')](_0x124f('0x32'),auth[_0x124f('0x6')](),controller[_0x124f('0x33')]);router[_0x124f('0x4')]('/sms/queues/waitinginteractions',auth[_0x124f('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x124f('0x4')](_0x124f('0x34'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x124f('0x35'),auth[_0x124f('0x6')](),controller[_0x124f('0x36')]);router[_0x124f('0x37')](_0x124f('0x38'),auth[_0x124f('0x6')](),controller['queueNotify']('mail'));router[_0x124f('0x4')](_0x124f('0x39'),auth[_0x124f('0x6')](),controller[_0x124f('0x3a')]);router[_0x124f('0x37')](_0x124f('0x3b'),auth[_0x124f('0x6')](),controller[_0x124f('0x3c')](_0x124f('0x3d')));router['get'](_0x124f('0x3e'),auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x124f('0x3f'),auth['isAuthenticated'](),controller[_0x124f('0x3c')]('fax'));router[_0x124f('0x4')](_0x124f('0x40'),auth[_0x124f('0x6')](),controller[_0x124f('0x41')]);router[_0x124f('0x37')]('/openchannel/queues/:id/notify',auth[_0x124f('0x6')](),controller[_0x124f('0x3c')](_0x124f('0x42')));router[_0x124f('0x4')](_0x124f('0x43'),auth[_0x124f('0x6')](),controller[_0x124f('0x44')]);router['post']('/sms/queues/:id/notify',auth[_0x124f('0x6')](),controller[_0x124f('0x3c')](_0x124f('0x45')));router[_0x124f('0x37')]('/whatsapp/queues/:id/notify',auth[_0x124f('0x6')](),controller['queueNotify']('whatsapp'));router[_0x124f('0x4')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x124f('0x46')]);router[_0x124f('0x4')](_0x124f('0x47'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x124f('0x37')](_0x124f('0x48'),auth['isAuthenticated'](),controller[_0x124f('0x49')]);module[_0x124f('0x4a')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 07ddf7e..2156eff 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 _0x81bd=['client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','Message','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','agent','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api'];(function(_0x55deb9,_0x5e40d8){var _0x16e107=function(_0x18ec25){while(--_0x18ec25){_0x55deb9['push'](_0x55deb9['shift']());}};_0x16e107(++_0x5e40d8);}(_0x81bd,0x7c));var _0xd81b=function(_0x2fe85a,_0x28c346){_0x2fe85a=_0x2fe85a-0x0;var _0x468e0f=_0x81bd[_0x2fe85a];return _0x468e0f;};'use strict';var BPromise=require(_0xd81b('0x0'));var moment=require(_0xd81b('0x1'));var _=require(_0xd81b('0x2'));var util=require(_0xd81b('0x3'));var db=require(_0xd81b('0x4'))['db'];var logger=require(_0xd81b('0x5'))(_0xd81b('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0xd81b('0x7')][_0xd81b('0x8')]({'port':0x232a});var mailClient=jayson[_0xd81b('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xd81b('0x7')][_0xd81b('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){var _0x223515=_0x5e14e8?_0x5e14e8:amiClient;return _0x223515[_0xd81b('0x9')](_0x1f3f2c,_0x562084)[_0xd81b('0xa')](function(_0x86dab6){if(_0x86dab6[_0xd81b('0xb')]){if(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xc')]===0x1f4){return _0x5468d5(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xd')]);}return _0xa4cf97(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xd')]);}else{_0xa4cf97(_0x86dab6[_0xd81b('0xe')]);}})[_0xd81b('0xf')](function(_0x560530){_0x5468d5(_0x560530);});});}function respondWithResult(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xc8;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x10')](_0x57f71d)['json'](_0x3f2405);}return _0x21dfff[_0xd81b('0x11')](0x194);};}function handleError(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0x1f4;return function(_0x41bf7a){logger[_0xd81b('0xb')](_0x41bf7a[_0xd81b('0x12')]);if(_0x41bf7a[_0xd81b('0x13')]){delete _0x41bf7a['name'];}_0x47dd04[_0xd81b('0x10')](_0x13dd00)[_0xd81b('0x14')](_0x41bf7a);};}function findById(_0x5c2863){return function(_0x2abef4){if(!_[_0xd81b('0x15')](_0x5c2863)&&!_[_0xd81b('0x15')](_0x2abef4)&&!_[_0xd81b('0x15')](_0x2abef4[_0xd81b('0x16')])){return _[_0xd81b('0x17')](_0x2abef4[_0xd81b('0x16')],function(_0x3d4d34){return _0x3d4d34['id']==_0x5c2863;});}return null;};}exports[_0xd81b('0x18')]=function(_0x285164,_0x1ff3c6){return respondWithRpcPromise(_0xd81b('0x19'),_0x285164[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x1ff3c6,null))[_0xd81b('0xf')](handleError(_0x1ff3c6,null));};exports[_0xd81b('0x1b')]=function(_0x5f101a,_0x4d566e){return respondWithRpcPromise(_0xd81b('0x1c'),_[_0xd81b('0x1d')](_0x5f101a[_0xd81b('0x1a')],_0x5f101a['params']))[_0xd81b('0xa')](respondWithResult(_0x4d566e,null))[_0xd81b('0xf')](handleError(_0x4d566e,null));};exports['voiceChannelStopMixMonitor']=function(_0xcd6474,_0x13d687){return respondWithRpcPromise(_0xd81b('0x1e'),_[_0xd81b('0x1d')](_0xcd6474[_0xd81b('0x1a')],_0xcd6474[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0x13d687,null))[_0xd81b('0xf')](handleError(_0x13d687,null));};exports[_0xd81b('0x20')]=function(_0x212c4e,_0x2ccedf){return respondWithRpcPromise(_0xd81b('0x21'),_0x212c4e['query'])[_0xd81b('0xa')](respondWithResult(_0x2ccedf,null))[_0xd81b('0xf')](handleError(_0x2ccedf,null));};exports[_0xd81b('0x22')]=function(_0x31b9fd,_0x3266c2){return respondWithRpcPromise(_0xd81b('0x21'),_0x31b9fd[_0xd81b('0x1a')])[_0xd81b('0xa')](findById(_0x31b9fd[_0xd81b('0x1f')]['id']))['then'](respondWithResult(_0x3266c2,null))[_0xd81b('0xf')](handleError(_0x3266c2,null));};exports['updateVoiceQueue']=function(_0x5c8aee,_0xb9ff9f){return respondWithRpcPromise(_0xd81b('0x23'),_['merge'](_0x5c8aee['body'],_0x5c8aee[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0xb9ff9f,null))[_0xd81b('0xf')](handleError(_0xb9ff9f,null));};exports[_0xd81b('0x24')]=function(_0x1a1572,_0x4654ba){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xd81b('0x1d')](_0x1a1572[_0xd81b('0x1a')],_0x1a1572['params']))['then'](respondWithResult(_0x4654ba,null))[_0xd81b('0xf')](handleError(_0x4654ba,null));};exports[_0xd81b('0x25')]=function(_0x50472a,_0x50ce25){return respondWithRpcPromise('VoiceQueuesChannels',_0x50472a[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x50ce25,null))[_0xd81b('0xf')](handleError(_0x50ce25,null));};exports[_0xd81b('0x26')]=function(_0xa56339,_0x12ee8f){return respondWithRpcPromise(_0xd81b('0x27'),_['merge'](_0xa56339[_0xd81b('0x1a')],_0xa56339['params']))[_0xd81b('0xa')](respondWithResult(_0x12ee8f,null))[_0xd81b('0xf')](handleError(_0x12ee8f,null));};exports[_0xd81b('0x28')]=function(_0xcd9e86,_0x36c69f){return respondWithRpcPromise(_0xd81b('0x29'),_[_0xd81b('0x1d')](_0xcd9e86[_0xd81b('0x1a')],_0xcd9e86[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0x36c69f,null))[_0xd81b('0xf')](handleError(_0x36c69f,null));};exports[_0xd81b('0x2a')]=function(_0x346038,_0x57bc0c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd81b('0x1d')](_0x346038[_0xd81b('0x1a')],_0x346038[_0xd81b('0x1f')]))['then'](respondWithResult(_0x57bc0c,null))[_0xd81b('0xf')](handleError(_0x57bc0c,null));};exports[_0xd81b('0x2b')]=function(_0x5a236a,_0x46f058){return respondWithRpcPromise(_0xd81b('0x2c'),_0x5a236a['query'])[_0xd81b('0xa')](respondWithResult(_0x46f058,null))['catch'](handleError(_0x46f058,null));};exports[_0xd81b('0x2d')]=function(_0x2502d1,_0x203365){return respondWithRpcPromise(_0xd81b('0x2e'),_0x2502d1['query'])[_0xd81b('0xa')](respondWithResult(_0x203365,null))[_0xd81b('0xf')](handleError(_0x203365,null));};exports[_0xd81b('0x2f')]=function(_0x67fbe5,_0x3abd60){var _0x466e98;return respondWithRpcPromise(_0xd81b('0x30'),_0x67fbe5['query'])[_0xd81b('0xa')](function(_0x35a295){_0x466e98=_0x35a295;return respondWithRpcPromise(_0xd81b('0x30'),_0x67fbe5['query'],routingClient);})[_0xd81b('0xa')](function(_0x3a05f4){return _[_0xd81b('0x1d')]({},_0x3a05f4,_0x466e98);})[_0xd81b('0xa')](respondWithResult(_0x3abd60,null))[_0xd81b('0xf')](handleError(_0x3abd60,null));};exports['agentCapacity']=function(_0x3dfba7,_0x11d617){if(_0x3dfba7[_0xd81b('0x31')]&&_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')]&&_0x3dfba7[_0xd81b('0x33')]&&_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')]){for(var _0x4405a8 in _0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')]){if(_0x3dfba7['body'][_0xd81b('0x32')][_0xd81b('0x34')](_0x4405a8)){db[_0xd81b('0x35')][_0xd81b('0x36')]({'where':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'type':_0xd81b('0x37'),'exitAt':null,'uniqueid':_0x3dfba7[_0xd81b('0x31')]['interaction'][_0x4405a8]&&_0x3dfba7['body'][_0xd81b('0x32')][_0x4405a8][_0xd81b('0x38')]?{'$notIn':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8]}:{'$ne':null}}})[_0xd81b('0xa')](function(_0x37031b){var _0x334bd0=moment()[_0xd81b('0x39')](_0xd81b('0x3a'));for(var _0xcfbbc2=0x0,_0x41e2e6=_0x37031b[_0xd81b('0x38')];_0xcfbbc2<_0x41e2e6;_0xcfbbc2+=0x1){_0x37031b[_0xcfbbc2]['updateAttributes']({'exitAt':_0x334bd0});}});for(var _0x27d18a=0x0;_0x27d18a<_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8][_0xd81b('0x38')];_0x27d18a+=0x1){db[_0xd81b('0x35')][_0xd81b('0x3b')]({'where':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'type':_0xd81b('0x37'),'uniqueid':_0x3dfba7['body'][_0xd81b('0x32')][_0x4405a8][_0x27d18a],'exitAt':null},'defaults':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'interface':_[_0xd81b('0x15')](_0x3dfba7['user'][_0xd81b('0x3c')])?util[_0xd81b('0x39')](_0xd81b('0x3d'),_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')]):_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x3c')],'type':_0xd81b('0x37'),'enterAt':moment()[_0xd81b('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x3e')],'uniqueid':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8][_0x27d18a]}});}}}}return respondWithRpcPromise(_0xd81b('0x3f'),{'id':_0x3dfba7[_0xd81b('0x1f')]['id'],'capacity':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x40')]},routingClient)['then'](respondWithResult(_0x11d617,null))[_0xd81b('0xf')](handleError(_0x11d617,null));};exports[_0xd81b('0x41')]=function(_0x1b523c,_0x3d171a){return respondWithRpcPromise(_0xd81b('0x42'),_0x1b523c['query'])[_0xd81b('0xa')](respondWithResult(_0x3d171a,null))[_0xd81b('0xf')](handleError(_0x3d171a,null));};exports['trunks']=function(_0x1f13c3,_0x315bd5){return respondWithRpcPromise(_0xd81b('0x43'),_0x1f13c3[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x315bd5,null))[_0xd81b('0xf')](handleError(_0x315bd5,null));};exports[_0xd81b('0x44')]=function(_0x22f588,_0x3ed626){return respondWithRpcPromise(_0xd81b('0x45'),_0x22f588[_0xd81b('0x1a')])['then'](respondWithResult(_0x3ed626,null))[_0xd81b('0xf')](handleError(_0x3ed626,null));};exports['chatQueues']=function(_0x1800fa,_0x7b438c){return respondWithRpcPromise(_0xd81b('0x46'),_0x1800fa[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x7b438c,null))[_0xd81b('0xf')](handleError(_0x7b438c,null));};exports['showChatQueues']=function(_0x2d978d,_0xe0c9c6){return respondWithRpcPromise('ChatQueues',_0x2d978d['query'],routingClient)[_0xd81b('0xa')](findById(_0x2d978d['params']['id']))[_0xd81b('0xa')](respondWithResult(_0xe0c9c6,null))['catch'](handleError(_0xe0c9c6,null));};exports[_0xd81b('0x47')]=function(_0x315a66,_0x3d97ba){return respondWithRpcPromise('MailQueues',_0x315a66[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x3d97ba,null))['catch'](handleError(_0x3d97ba,null));};exports[_0xd81b('0x48')]=function(_0x108aaf,_0x5951ec){return respondWithRpcPromise(_0xd81b('0x49'),_0x108aaf['query'],routingClient)[_0xd81b('0xa')](findById(_0x108aaf[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5951ec,null))[_0xd81b('0xf')](handleError(_0x5951ec,null));};exports[_0xd81b('0x4a')]=function(_0x32eab4,_0x2f2afe){return respondWithRpcPromise(_0xd81b('0x4b'),_0x32eab4[_0xd81b('0x1a')],mailClient)[_0xd81b('0xa')](respondWithResult(_0x2f2afe,null))['catch'](handleError(_0x2f2afe,null));};exports[_0xd81b('0x4c')]=function(_0x434434,_0x385841){return respondWithRpcPromise(_0xd81b('0x4d'),_0x434434[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x385841,null))[_0xd81b('0xf')](handleError(_0x385841,null));};exports['showOpenchannelQueues']=function(_0x57f0fb,_0x5de22d){return respondWithRpcPromise(_0xd81b('0x4d'),_0x57f0fb[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x57f0fb[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5de22d,null))[_0xd81b('0xf')](handleError(_0x5de22d,null));};exports[_0xd81b('0x4e')]=function(_0x5afecf,_0x3fcd8c){return respondWithRpcPromise(_0xd81b('0x4f'),_0x5afecf[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x3fcd8c,null))[_0xd81b('0xf')](handleError(_0x3fcd8c,null));};exports[_0xd81b('0x50')]=function(_0xb5fca8,_0x4ed17d){return respondWithRpcPromise(_0xd81b('0x4f'),_0xb5fca8[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0xb5fca8[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x4ed17d,null))[_0xd81b('0xf')](handleError(_0x4ed17d,null));};exports[_0xd81b('0x51')]=function(_0x19d4f0,_0x8fa8cd){return respondWithRpcPromise(_0xd81b('0x52'),_0x19d4f0[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x8fa8cd,null))['catch'](handleError(_0x8fa8cd,null));};exports[_0xd81b('0x53')]=function(_0x5358a6,_0x2e7141){return respondWithRpcPromise(_0xd81b('0x52'),_0x5358a6[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x5358a6[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x2e7141,null))[_0xd81b('0xf')](handleError(_0x2e7141,null));};exports[_0xd81b('0x54')]=function(_0x10d6d2,_0x36fb7a){return respondWithRpcPromise('FaxQueues',_0x10d6d2[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x36fb7a,null))[_0xd81b('0xf')](handleError(_0x36fb7a,null));};exports[_0xd81b('0x55')]=function(_0x7720d3,_0x5abbb4){return respondWithRpcPromise('FaxQueues',_0x7720d3[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x7720d3[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5abbb4,null))[_0xd81b('0xf')](handleError(_0x5abbb4,null));};exports[_0xd81b('0x56')]=function(_0xaee7e3,_0x539132){return respondWithRpcPromise(_0xd81b('0x57'),_0xaee7e3[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x539132,null))[_0xd81b('0xf')](handleError(_0x539132,null));};exports[_0xd81b('0x58')]=function(_0x21d039,_0x1e0da3){return respondWithRpcPromise(_0xd81b('0x59'),_0x21d039[_0xd81b('0x1a')],routingClient)['then'](respondWithResult(_0x1e0da3,null))[_0xd81b('0xf')](handleError(_0x1e0da3,null));};exports[_0xd81b('0x5a')]=function(_0x3858eb,_0x9c30e7){return respondWithRpcPromise(_0xd81b('0x5b'),_0x3858eb['query'],routingClient)[_0xd81b('0xa')](respondWithResult(_0x9c30e7,null))[_0xd81b('0xf')](handleError(_0x9c30e7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xa00645,_0x43e593){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0xa00645[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x43e593,null))[_0xd81b('0xf')](handleError(_0x43e593,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2aff4b,_0x3db4d7){return respondWithRpcPromise(_0xd81b('0x5c'),_0x2aff4b['query'],routingClient)['then'](function(_0xdd970d){if(_0x2aff4b[_0xd81b('0x1a')][_0xd81b('0x5d')]!==undefined){var _0x5d601d=_(_0xdd970d[_0xd81b('0x16')])[_0xd81b('0x5e')]([_0x2aff4b[_0xd81b('0x1a')][_0xd81b('0x5d')],_0x2aff4b['params']['id']])['map'](_0xd81b('0x5f'))[_0xd81b('0x60')]()[_0xd81b('0x61')]();return _0xdd970d[_0xd81b('0x16')]['filter'](function(_0x1b8b17){return _0x5d601d[_0xd81b('0x62')](_0x1b8b17['queue_id'])>-0x1;});}else{return _0xdd970d[_0xd81b('0x16')]['filter'](function(_0x32a8f4){return _0x32a8f4[_0xd81b('0x5f')]===parseInt(_0x2aff4b['params']['id']);});}})[_0xd81b('0xa')](respondWithResult(_0x3db4d7,null))[_0xd81b('0xf')](handleError(_0x3db4d7,null));};exports[_0xd81b('0x63')]=function(_0x2490f1,_0x2b0fe4){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2490f1[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x2b0fe4,null))[_0xd81b('0xf')](handleError(_0x2b0fe4,null));};exports[_0xd81b('0x64')]=function(_0x1919b2,_0x2b1d96){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x1919b2['query'],routingClient)[_0xd81b('0xa')](respondWithResult(_0x2b1d96,null))[_0xd81b('0xf')](handleError(_0x2b1d96,null));};exports[_0xd81b('0x65')]=function(_0x15aed5,_0x4dd8ac){return respondWithRpcPromise(_0xd81b('0x66'),_0x15aed5[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x4dd8ac,null))[_0xd81b('0xf')](handleError(_0x4dd8ac,null));};exports[_0xd81b('0x67')]=function(_0x589882){return function(_0x3744bf,_0x374ac0){var _0x159b28,_0x40b468;var _0x1d596c=_[_0xd81b('0x68')](_0x589882);var _0x402eb9=_0x589882==='chat'?_0xd81b('0x69'):_0xd81b('0x6a');return db[_0x1d596c+_0xd81b('0x6b')][_0xd81b('0x6c')]({'raw':!![],'where':{'id':_0x3744bf[_0xd81b('0x1f')]['id']}})[_0xd81b('0xa')](function(_0x59bee6){if(_[_0xd81b('0x15')](_0x59bee6)){throw new Error(_0x1d596c+'\x20Queue\x20not\x20found');}_0x159b28=_0x59bee6;return db[_0x1d596c+_0xd81b('0x6d')][_0xd81b('0x6c')]({'where':{'id':_0x3744bf[_0xd81b('0x31')]['messageId']},'include':[{'model':db[_0x1d596c+_0xd81b('0x6e')],'as':_0xd81b('0x6e')},{'model':db[_0x1d596c+_0x402eb9],'as':_0xd81b('0x6a')}]});})[_0xd81b('0xa')](function(_0x254105){if(_[_0xd81b('0x15')](_0x254105)){throw new Error(_0x1d596c+'\x20Message\x20not\x20found');}_0x40b468=_0x254105;return _0x254105[_0xd81b('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5f5514={'uniqueid':_0x589882+'.'+_0x40b468['id']+'.'+_0x40b468[_0xd81b('0x6e')]['id'],'FromUserId':_0x3744bf[_0xd81b('0x33')]['id'],'type':_0xd81b('0x70')};_0x5f5514[_0x1d596c+'MessageId']=_0x40b468['id'];_0x5f5514[_0x1d596c+_0xd81b('0x71')]=_0x40b468[_0xd81b('0x6e')]['id'];_0x5f5514[_0xd81b('0x72')+_0x1d596c+_0x402eb9+'Id']=_0x40b468[_0xd81b('0x6a')]['id'];_0x5f5514['To'+_0x1d596c+_0xd81b('0x73')]=_0x159b28['id'];return db[_0x1d596c+_0xd81b('0x74')]['create'](_0x5f5514);})[_0xd81b('0xa')](function(){return respondWithRpcPromise(_0xd81b('0x75'),{'channel':_0x589882,'interaction':_0x40b468[_0xd81b('0x6e')],'message':_0x40b468,'account':_0x40b468[_0xd81b('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd81b('0x70'),'appdata':_0x159b28[_0xd81b('0x13')]+','+(_0x40b468[_0xd81b('0x6a')][_0xd81b('0x76')]||0x12c),'interval':_0xd81b('0x77')}]},routingClient);})[_0xd81b('0xa')](respondWithResult(_0x374ac0,null))[_0xd81b('0xf')](handleError(_0x374ac0,null));};};exports[_0xd81b('0x78')]=function(_0x42eb62,_0x2c19fd){var _0x36d8fd,_0x5adfe4;if(_[_0xd81b('0x15')](_0x42eb62['body'][_0xd81b('0x79')])){throw new Error(_0xd81b('0x7a'));}var _0x1ca94b=_0x42eb62[_0xd81b('0x31')][_0xd81b('0x79')];var _0x115805=_['capitalize'](_0x1ca94b);var _0x3a41e6=_0x1ca94b===_0xd81b('0x7b')?_0xd81b('0x69'):_0xd81b('0x6a');return db[_0xd81b('0x7c')][_0xd81b('0x6c')]({'raw':!![],'where':{'id':_0x42eb62[_0xd81b('0x1f')]['id'],'role':_0xd81b('0x7d')}})[_0xd81b('0xa')](function(_0xfacc8f){if(_[_0xd81b('0x15')](_0xfacc8f)){throw new Error(_0xd81b('0x7e'));}_0x36d8fd=_0xfacc8f;return db[_0x115805+'Message'][_0xd81b('0x6c')]({'where':{'id':_0x42eb62[_0xd81b('0x31')][_0xd81b('0x7f')]},'include':[{'model':db[_0x115805+_0xd81b('0x6e')],'as':_0xd81b('0x6e')},{'model':db[_0x115805+_0x3a41e6],'as':'Account'}]});})[_0xd81b('0xa')](function(_0x1e61d8){if(_[_0xd81b('0x15')](_0x1e61d8)){throw new Error(_0x115805+_0xd81b('0x80'));}_0x5adfe4=_0x1e61d8;return _0x1e61d8[_0xd81b('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd81b('0xa')](function(){var _0x4e4919={'uniqueid':_0x1ca94b+'.'+_0x5adfe4['id']+'.'+_0x5adfe4[_0xd81b('0x6e')]['id'],'FromUserId':_0x42eb62['user']['id'],'type':_0xd81b('0x70'),'ToUserId':_0x36d8fd['id']};_0x4e4919[_0x115805+_0xd81b('0x81')]=_0x5adfe4['id'];_0x4e4919[_0x115805+_0xd81b('0x71')]=_0x5adfe4[_0xd81b('0x6e')]['id'];_0x4e4919['From'+_0x115805+_0x3a41e6+'Id']=_0x5adfe4[_0xd81b('0x6a')]['id'];return db[_0x115805+_0xd81b('0x74')]['create'](_0x4e4919);})[_0xd81b('0xa')](function(){return respondWithRpcPromise(_0xd81b('0x75'),{'channel':_0x1ca94b,'interaction':_0x5adfe4[_0xd81b('0x6e')],'message':_0x5adfe4,'account':_0x5adfe4[_0xd81b('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd81b('0x7d'),'appdata':_0x36d8fd['name']+','+(_0x5adfe4['Account'][_0xd81b('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd81b('0xa')](respondWithResult(_0x2c19fd,null))['catch'](handleError(_0x2c19fd,null));}; \ No newline at end of file +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(_0x511ee8,_0x1934be){var _0x4386d6=function(_0x3dfc6f){while(--_0x3dfc6f){_0x511ee8['push'](_0x511ee8['shift']());}};_0x4386d6(++_0x1934be);}(_0x55ca,0x126));var _0xa55c=function(_0x3af6d3,_0xd6ff2e){_0x3af6d3=_0x3af6d3-0x0;var _0xf0c5a8=_0x55ca[_0x3af6d3];return _0xf0c5a8;};'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 diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4806621..77ad61d 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 _0xf450=['./schedule.controller','index','get','show','isAuthenticated','run','post','create','put','/:id','update','delete','destroy','multer','connect-timeout','Router','../../components/auth/service'];(function(_0x5f9480,_0x5a43eb){var _0x1cb4bc=function(_0x473f1b){while(--_0x473f1b){_0x5f9480['push'](_0x5f9480['shift']());}};_0x1cb4bc(++_0x5a43eb);}(_0xf450,0x172));var _0x0f45=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf450[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0f45('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f45('0x1'));var express=require('express');var router=express[_0x0f45('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0f45('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0f45('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x0f45('0x5')]);router[_0x0f45('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x0f45('0x7')]);router['get']('/:id/run',auth[_0x0f45('0x8')](),controller[_0x0f45('0x9')]);router[_0x0f45('0xa')]('/',auth[_0x0f45('0x8')](),controller[_0x0f45('0xb')]);router[_0x0f45('0xc')](_0x0f45('0xd'),auth[_0x0f45('0x8')](),controller[_0x0f45('0xe')]);router[_0x0f45('0xf')](_0x0f45('0xd'),auth[_0x0f45('0x8')](),controller[_0x0f45('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb7cd=['../../components/interaction/service','./schedule.controller','isAuthenticated','index','get','/:id','run','post','create','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xe3899f,_0x5094ce){var _0x413400=function(_0x9196dc){while(--_0x9196dc){_0xe3899f['push'](_0xe3899f['shift']());}};_0x413400(++_0x5094ce);}(_0xb7cd,0x89));var _0xdb7c=function(_0x18170b,_0xa0b3f6){_0x18170b=_0x18170b-0x0;var _0x166fa3=_0xb7cd[_0x18170b];return _0x166fa3;};'use strict';var multer=require('multer');var util=require(_0xdb7c('0x0'));var path=require(_0xdb7c('0x1'));var timeout=require(_0xdb7c('0x2'));var express=require(_0xdb7c('0x3'));var router=express[_0xdb7c('0x4')]();var fs_extra=require(_0xdb7c('0x5'));var auth=require(_0xdb7c('0x6'));var interaction=require(_0xdb7c('0x7'));var config=require('../../config/environment');var controller=require(_0xdb7c('0x8'));router['get']('/',auth[_0xdb7c('0x9')](),controller[_0xdb7c('0xa')]);router[_0xdb7c('0xb')](_0xdb7c('0xc'),auth[_0xdb7c('0x9')](),controller['show']);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0xdb7c('0xd')]);router[_0xdb7c('0xe')]('/',auth[_0xdb7c('0x9')](),controller[_0xdb7c('0xf')]);router['put'](_0xdb7c('0xc'),auth[_0xdb7c('0x9')](),controller[_0xdb7c('0x10')]);router[_0xdb7c('0x11')](_0xdb7c('0xc'),auth[_0xdb7c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index f637c92..39355e9 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 _0xba30=['sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','days','minutes','pdf','csv','custom','default','TEXT'];(function(_0x28dda5,_0x115002){var _0x935c9c=function(_0x50d76c){while(--_0x50d76c){_0x28dda5['push'](_0x28dda5['shift']());}};_0x935c9c(++_0x115002);}(_0xba30,0x17a));var _0x0ba3=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0xba30[_0x5111a9];return _0x59a15a;};'use strict';var Sequelize=require(_0x0ba3('0x0'));module[_0x0ba3('0x1')]={'name':{'type':Sequelize[_0x0ba3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0ba3('0x2')]},'active':{'type':Sequelize[_0x0ba3('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0ba3('0x4')},'startAt':{'type':Sequelize[_0x0ba3('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x0ba3('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x0ba3('0x6')](_0x0ba3('0x7'),_0x0ba3('0x8'),_0x0ba3('0x9'),_0x0ba3('0xa'),_0x0ba3('0xb'),'hours',_0x0ba3('0xc')),'allowNull':![],'defaultValue':_0x0ba3('0xb')},'output':{'type':Sequelize[_0x0ba3('0x6')]('csv',_0x0ba3('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x0ba3('0xe')},'type':{'type':Sequelize[_0x0ba3('0x6')](_0x0ba3('0xf'),_0x0ba3('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x0ba3('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x0ba3('0x11')]},'bcc':{'type':Sequelize[_0x0ba3('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x209c=['DATE','INTEGER','ENUM','years','quarters','months','hours','minutes','days','csv','pdf','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x209c,0x18b));var _0xc209=function(_0x253790,_0x4d118c){_0x253790=_0x253790-0x0;var _0x468785=_0x209c[_0x253790];return _0x468785;};'use strict';var Sequelize=require('sequelize');module[_0xc209('0x0')]={'name':{'type':Sequelize[_0xc209('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc209('0x1')]},'active':{'type':Sequelize[_0xc209('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc209('0x1')],'allowNull':![],'defaultValue':_0xc209('0x3')},'startAt':{'type':Sequelize[_0xc209('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xc209('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc209('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc209('0x6')](_0xc209('0x7'),_0xc209('0x8'),_0xc209('0x9'),'weeks','days',_0xc209('0xa'),_0xc209('0xb')),'allowNull':![],'defaultValue':_0xc209('0xc')},'output':{'type':Sequelize[_0xc209('0x6')](_0xc209('0xd'),_0xc209('0xe'),_0xc209('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xc209('0x10'),_0xc209('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xc209('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xc209('0x1')]},'cc':{'type':Sequelize[_0xc209('0x12')]},'bcc':{'type':Sequelize[_0xc209('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xc209('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index f38b07e..23519df 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 _0x7cb6=['fieldName','type','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','catch','show','params','keys','length','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','bluebird','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','Scheduler','destroy','error','name','send','index','Schedule','rawAttributes'];(function(_0x176765,_0x203ba2){var _0x5db122=function(_0x46d2d0){while(--_0x46d2d0){_0x176765['push'](_0x176765['shift']());}};_0x5db122(++_0x203ba2);}(_0x7cb6,0x76));var _0x67cb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7cb6[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67cb('0x0'));var zipdir=require(_0x67cb('0x1'));var jsonpatch=require(_0x67cb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x67cb('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x67cb('0x4'));var fs=require('fs');var fs_extra=require(_0x67cb('0x5'));var _=require(_0x67cb('0x6'));var squel=require(_0x67cb('0x7'));var crypto=require(_0x67cb('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x67cb('0x9'));var querystring=require(_0x67cb('0xa'));var Papa=require(_0x67cb('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x67cb('0xc'));var as=require(_0x67cb('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67cb('0xe'))(_0x67cb('0xf'));var utils=require(_0x67cb('0x10'));var config=require(_0x67cb('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x67cb('0x12'))['db'];function respondWithStatusCode(_0x37393d,_0x4ba52c){_0x4ba52c=_0x4ba52c||0xcc;return function(_0x3aeb76){if(_0x3aeb76){return _0x37393d[_0x67cb('0x13')](_0x4ba52c);}return _0x37393d[_0x67cb('0x14')](_0x4ba52c)[_0x67cb('0x15')]();};}function respondWithResult(_0x563934,_0x52f2d7){_0x52f2d7=_0x52f2d7||0xc8;return function(_0x21d83a){if(_0x21d83a){return _0x563934['status'](_0x52f2d7)[_0x67cb('0x16')](_0x21d83a);}};}function respondWithFilteredResult(_0x18687e,_0x5e5483){return function(_0x1a38ce){if(_0x1a38ce){var _0x32328e=typeof _0x5e5483['offset']===_0x67cb('0x17')&&typeof _0x5e5483['limit']===_0x67cb('0x17');var _0x37176a=_0x1a38ce[_0x67cb('0x18')];var _0x54daf7=_0x32328e?0x0:_0x5e5483[_0x67cb('0x19')];var _0x3cc163=_0x32328e?_0x1a38ce[_0x67cb('0x18')]:_0x5e5483['offset']+_0x5e5483[_0x67cb('0x1a')];var _0x4044ac;if(_0x3cc163>=_0x37176a){_0x3cc163=_0x37176a;_0x4044ac=0xc8;}else{_0x4044ac=0xce;}_0x18687e[_0x67cb('0x14')](_0x4044ac);return _0x18687e[_0x67cb('0x1b')](_0x67cb('0x1c'),_0x54daf7+'-'+_0x3cc163+'/'+_0x37176a)[_0x67cb('0x16')](_0x1a38ce);}return null;};}function patchUpdates(_0x1ceccc){return function(_0x692cf3){try{jsonpatch[_0x67cb('0x1d')](_0x692cf3,_0x1ceccc,!![]);}catch(_0xdf78c4){return BPromise[_0x67cb('0x1e')](_0xdf78c4);}return _0x692cf3[_0x67cb('0x1f')]();};}function saveUpdates(_0x1cc148,_0x2e9280){return function(_0x2c1a69){if(_0x2c1a69){return _0x2c1a69[_0x67cb('0x20')](_0x1cc148)[_0x67cb('0x21')](function(_0xdd7396){return _0xdd7396;});}return null;};}function removeEntity(_0x4dc221,_0x2b8f7e){return function(_0x1603ab){if(_0x1603ab){return _0x1603ab['destroy']()[_0x67cb('0x21')](function(){var _0x2bae59=_0x1603ab['get']({'plain':!![]});var _0xfb7a71=_0x67cb('0x22');return db['UserProfileResource'][_0x67cb('0x23')]({'where':{'type':_0xfb7a71,'resourceId':_0x2bae59['id']}})[_0x67cb('0x21')](function(){return _0x1603ab;});})['then'](function(){_0x4dc221[_0x67cb('0x14')](0xcc)[_0x67cb('0x15')]();});}};}function handleEntityNotFound(_0x25e10e,_0x17dec2){return function(_0x7b5620){if(!_0x7b5620){_0x25e10e[_0x67cb('0x13')](0x194);}return _0x7b5620;};}function handleError(_0x3ec562,_0x15aeb7){_0x15aeb7=_0x15aeb7||0x1f4;return function(_0x4cda8b){logger[_0x67cb('0x24')](_0x4cda8b['stack']);if(_0x4cda8b[_0x67cb('0x25')]){delete _0x4cda8b[_0x67cb('0x25')];}_0x3ec562[_0x67cb('0x14')](_0x15aeb7)[_0x67cb('0x26')](_0x4cda8b);};}exports[_0x67cb('0x27')]=function(_0x19cf4f,_0x579545){var _0x2d2d0f={},_0x457162={},_0x39bcb4={'count':0x0,'rows':[]};var _0x1ee58b=_['map'](db[_0x67cb('0x28')][_0x67cb('0x29')],function(_0x1e9058){return{'name':_0x1e9058[_0x67cb('0x2a')],'type':_0x1e9058[_0x67cb('0x2b')]['key']};});_0x457162[_0x67cb('0x2c')]=_[_0x67cb('0x2d')](_0x1ee58b,_0x67cb('0x25'));_0x457162[_0x67cb('0x2e')]=_['keys'](_0x19cf4f[_0x67cb('0x2e')]);_0x457162[_0x67cb('0x2f')]=_[_0x67cb('0x30')](_0x457162[_0x67cb('0x2c')],_0x457162['query']);_0x2d2d0f[_0x67cb('0x31')]=_[_0x67cb('0x30')](_0x457162['model'],qs[_0x67cb('0x32')](_0x19cf4f[_0x67cb('0x2e')]['fields']));_0x2d2d0f[_0x67cb('0x31')]=_0x2d2d0f[_0x67cb('0x31')]['length']?_0x2d2d0f[_0x67cb('0x31')]:_0x457162[_0x67cb('0x2c')];if(!_0x19cf4f[_0x67cb('0x2e')]['hasOwnProperty'](_0x67cb('0x33'))){_0x2d2d0f['limit']=qs[_0x67cb('0x1a')](_0x19cf4f[_0x67cb('0x2e')]['limit']);_0x2d2d0f[_0x67cb('0x19')]=qs[_0x67cb('0x19')](_0x19cf4f[_0x67cb('0x2e')][_0x67cb('0x19')]);}_0x2d2d0f[_0x67cb('0x34')]=qs[_0x67cb('0x35')](_0x19cf4f[_0x67cb('0x2e')][_0x67cb('0x35')]);_0x2d2d0f[_0x67cb('0x36')]=qs[_0x67cb('0x2f')](_[_0x67cb('0x37')](_0x19cf4f[_0x67cb('0x2e')],_0x457162[_0x67cb('0x2f')]),_0x1ee58b);if(_0x19cf4f[_0x67cb('0x2e')]['filter']){_0x2d2d0f[_0x67cb('0x36')]=_[_0x67cb('0x38')](_0x2d2d0f[_0x67cb('0x36')],{'$or':_['map'](_0x1ee58b,function(_0x1ff326){if(_0x1ff326['type']!==_0x67cb('0x39')){var _0x32cbb2={};_0x32cbb2[_0x1ff326[_0x67cb('0x25')]]={'$like':'%'+_0x19cf4f[_0x67cb('0x2e')][_0x67cb('0x3a')]+'%'};return _0x32cbb2;}})});}_0x2d2d0f=_[_0x67cb('0x38')]({},_0x2d2d0f,_0x19cf4f['options']);var _0x470fb6={'where':_0x2d2d0f[_0x67cb('0x36')]};return db[_0x67cb('0x28')][_0x67cb('0x18')](_0x470fb6)[_0x67cb('0x21')](function(_0x1e7145){_0x39bcb4[_0x67cb('0x18')]=_0x1e7145;if(_0x19cf4f[_0x67cb('0x2e')]['includeAll']){_0x2d2d0f[_0x67cb('0x3b')]=[{'all':!![]}];}return db[_0x67cb('0x28')]['findAll'](_0x2d2d0f);})[_0x67cb('0x21')](function(_0x398def){_0x39bcb4['rows']=_0x398def;return _0x39bcb4;})[_0x67cb('0x21')](respondWithFilteredResult(_0x579545,_0x2d2d0f))[_0x67cb('0x3c')](handleError(_0x579545,null));};exports[_0x67cb('0x3d')]=function(_0x56924c,_0x309104){var _0x269473={'raw':![],'where':{'id':_0x56924c[_0x67cb('0x3e')]['id']}},_0x3ebfc5={};_0x3ebfc5['model']=_[_0x67cb('0x3f')](db[_0x67cb('0x28')][_0x67cb('0x29')]);_0x3ebfc5[_0x67cb('0x2e')]=_['keys'](_0x56924c['query']);_0x3ebfc5[_0x67cb('0x2f')]=_[_0x67cb('0x30')](_0x3ebfc5[_0x67cb('0x2c')],_0x3ebfc5[_0x67cb('0x2e')]);_0x269473['attributes']=_[_0x67cb('0x30')](_0x3ebfc5[_0x67cb('0x2c')],qs[_0x67cb('0x32')](_0x56924c[_0x67cb('0x2e')][_0x67cb('0x32')]));_0x269473[_0x67cb('0x31')]=_0x269473[_0x67cb('0x31')][_0x67cb('0x40')]?_0x269473[_0x67cb('0x31')]:_0x3ebfc5[_0x67cb('0x2c')];if(_0x56924c[_0x67cb('0x2e')][_0x67cb('0x41')]){_0x269473[_0x67cb('0x3b')]=[{'all':!![]}];}_0x269473=_[_0x67cb('0x38')]({},_0x269473,_0x56924c[_0x67cb('0x42')]);return db[_0x67cb('0x28')]['find'](_0x269473)[_0x67cb('0x21')](handleEntityNotFound(_0x309104,null))[_0x67cb('0x21')](respondWithResult(_0x309104,null))[_0x67cb('0x3c')](handleError(_0x309104,null));};exports['create']=function(_0x2eb074,_0x3ed57d){return db[_0x67cb('0x28')][_0x67cb('0x43')](_0x2eb074[_0x67cb('0x44')],{})[_0x67cb('0x21')](function(_0x336de1){var _0x14b2ab=_0x2eb074[_0x67cb('0x45')]['get']({'plain':!![]});if(!_0x14b2ab)throw new Error(_0x67cb('0x46'));if(_0x14b2ab[_0x67cb('0x47')]===_0x67cb('0x45')){var _0x5752d5=_0x336de1[_0x67cb('0x48')]({'plain':!![]});var _0x4d210f=_0x67cb('0x22');return db['UserProfileSection'][_0x67cb('0x49')]({'where':{'name':_0x4d210f,'userProfileId':_0x14b2ab[_0x67cb('0x4a')]},'raw':!![]})[_0x67cb('0x21')](function(_0x8828b1){if(_0x8828b1&&_0x8828b1[_0x67cb('0x4b')]===0x0){return db[_0x67cb('0x4c')]['create']({'name':_0x5752d5[_0x67cb('0x25')],'resourceId':_0x5752d5['id'],'type':_0x8828b1[_0x67cb('0x25')],'sectionId':_0x8828b1['id']},{})[_0x67cb('0x21')](function(){return _0x336de1;});}else{return _0x336de1;}})['catch'](function(_0x5e5d5e){logger['error'](_0x67cb('0x4d'),_0x5e5d5e);throw _0x5e5d5e;});}return _0x336de1;})['then'](respondWithResult(_0x3ed57d,0xc9))['catch'](handleError(_0x3ed57d,null));};exports[_0x67cb('0x20')]=function(_0x1d9cf0,_0x20cbbc){if(_0x1d9cf0[_0x67cb('0x44')]['id']){delete _0x1d9cf0[_0x67cb('0x44')]['id'];}return db['Schedule']['find']({'where':{'id':_0x1d9cf0[_0x67cb('0x3e')]['id']}})[_0x67cb('0x21')](handleEntityNotFound(_0x20cbbc,null))[_0x67cb('0x21')](saveUpdates(_0x1d9cf0[_0x67cb('0x44')],null))['then'](respondWithResult(_0x20cbbc,null))['catch'](handleError(_0x20cbbc,null));};exports[_0x67cb('0x23')]=function(_0x2d7c2d,_0x440d68){return db[_0x67cb('0x28')][_0x67cb('0x49')]({'where':{'id':_0x2d7c2d['params']['id']}})[_0x67cb('0x21')](handleEntityNotFound(_0x440d68,null))[_0x67cb('0x21')](removeEntity(_0x440d68,null))[_0x67cb('0x3c')](handleError(_0x440d68,null));};exports[_0x67cb('0x4e')]=function(_0xe6651,_0x47c16e,_0x5a4dae){var _0x24c9d0=require(_0x67cb('0x4f'));return db['Schedule']['find']({'where':{'id':_0xe6651['params']['id']},'raw':!![]})[_0x67cb('0x21')](handleEntityNotFound(_0x47c16e,null))[_0x67cb('0x21')](function(){_0x24c9d0[_0x67cb('0x4e')](_0xe6651['params']['id']);})[_0x67cb('0x21')](respondWithStatusCode(_0x47c16e,null))[_0x67cb('0x3c')](handleError(_0x47c16e,null));}; \ No newline at end of file +var _0x369d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','apply','reject','destroy','then','get','Scheduler','sendStatus','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','run','../../config/schedule','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4dcef2,_0x52845d){var _0xe80f33=function(_0x510b1c){while(--_0x510b1c){_0x4dcef2['push'](_0x4dcef2['shift']());}};_0xe80f33(++_0x52845d);}(_0x369d,0x1f2));var _0xd369=function(_0x540be6,_0x172410){_0x540be6=_0x540be6-0x0;var _0x103af9=_0x369d[_0x540be6];return _0x103af9;};'use strict';var emlformat=require(_0xd369('0x0'));var rimraf=require(_0xd369('0x1'));var zipdir=require(_0xd369('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd369('0x3'));var moment=require(_0xd369('0x4'));var BPromise=require(_0xd369('0x5'));var Mustache=require(_0xd369('0x6'));var util=require('util');var path=require(_0xd369('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd369('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd369('0x9'));var squel=require('squel');var crypto=require(_0xd369('0xa'));var jsforce=require(_0xd369('0xb'));var deskjs=require(_0xd369('0xc'));var toCsv=require(_0xd369('0xd'));var querystring=require(_0xd369('0xe'));var Papa=require(_0xd369('0xf'));var Redis=require(_0xd369('0x10'));var authService=require(_0xd369('0x11'));var qs=require(_0xd369('0x12'));var as=require(_0xd369('0x13'));var hardwareService=require(_0xd369('0x14'));var logger=require('../../config/logger')(_0xd369('0x15'));var utils=require(_0xd369('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd369('0x17'));var db=require(_0xd369('0x18'))['db'];function respondWithStatusCode(_0x20154e,_0x471987){_0x471987=_0x471987||0xcc;return function(_0x3327de){if(_0x3327de){return _0x20154e['sendStatus'](_0x471987);}return _0x20154e[_0xd369('0x19')](_0x471987)[_0xd369('0x1a')]();};}function respondWithResult(_0x2170cf,_0x2b4dfc){_0x2b4dfc=_0x2b4dfc||0xc8;return function(_0x2afa11){if(_0x2afa11){return _0x2170cf[_0xd369('0x19')](_0x2b4dfc)[_0xd369('0x1b')](_0x2afa11);}};}function respondWithFilteredResult(_0x5a3ce8,_0x42608a){return function(_0x2547be){if(_0x2547be){var _0x11fd13=typeof _0x42608a[_0xd369('0x1c')]===_0xd369('0x1d')&&typeof _0x42608a['limit']===_0xd369('0x1d');var _0x55d601=_0x2547be['count'];var _0xeab83d=_0x11fd13?0x0:_0x42608a['offset'];var _0x3ca9a5=_0x11fd13?_0x2547be['count']:_0x42608a[_0xd369('0x1c')]+_0x42608a[_0xd369('0x1e')];var _0x2cba01;if(_0x3ca9a5>=_0x55d601){_0x3ca9a5=_0x55d601;_0x2cba01=0xc8;}else{_0x2cba01=0xce;}_0x5a3ce8[_0xd369('0x19')](_0x2cba01);return _0x5a3ce8['set']('Content-Range',_0xeab83d+'-'+_0x3ca9a5+'/'+_0x55d601)[_0xd369('0x1b')](_0x2547be);}return null;};}function patchUpdates(_0x22e6b2){return function(_0x42f629){try{jsonpatch[_0xd369('0x1f')](_0x42f629,_0x22e6b2,!![]);}catch(_0x38a43c){return BPromise[_0xd369('0x20')](_0x38a43c);}return _0x42f629['save']();};}function saveUpdates(_0x188677,_0x2deddf){return function(_0x43c346){if(_0x43c346){return _0x43c346['update'](_0x188677)['then'](function(_0x9102e8){return _0x9102e8;});}return null;};}function removeEntity(_0x2f278e,_0x1eb558){return function(_0xec2151){if(_0xec2151){return _0xec2151[_0xd369('0x21')]()[_0xd369('0x22')](function(){var _0xe0761b=_0xec2151[_0xd369('0x23')]({'plain':!![]});var _0x3e986a=_0xd369('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e986a,'resourceId':_0xe0761b['id']}})[_0xd369('0x22')](function(){return _0xec2151;});})[_0xd369('0x22')](function(){_0x2f278e[_0xd369('0x19')](0xcc)[_0xd369('0x1a')]();});}};}function handleEntityNotFound(_0x2f46df,_0xa83ec7){return function(_0x2cbaaa){if(!_0x2cbaaa){_0x2f46df[_0xd369('0x25')](0x194);}return _0x2cbaaa;};}function handleError(_0x447653,_0x4f5b2f){_0x4f5b2f=_0x4f5b2f||0x1f4;return function(_0x2b5702){logger[_0xd369('0x26')](_0x2b5702[_0xd369('0x27')]);if(_0x2b5702[_0xd369('0x28')]){delete _0x2b5702['name'];}_0x447653[_0xd369('0x19')](_0x4f5b2f)[_0xd369('0x29')](_0x2b5702);};}exports['index']=function(_0x3ef23a,_0x3b2ccb){var _0x31a98d={},_0x3d0b2e={},_0x5649b2={'count':0x0,'rows':[]};var _0x3fa29d=_[_0xd369('0x2a')](db[_0xd369('0x2b')][_0xd369('0x2c')],function(_0x2c60d5){return{'name':_0x2c60d5[_0xd369('0x2d')],'type':_0x2c60d5[_0xd369('0x2e')][_0xd369('0x2f')]};});_0x3d0b2e[_0xd369('0x30')]=_[_0xd369('0x2a')](_0x3fa29d,'name');_0x3d0b2e[_0xd369('0x31')]=_[_0xd369('0x32')](_0x3ef23a[_0xd369('0x31')]);_0x3d0b2e[_0xd369('0x33')]=_[_0xd369('0x34')](_0x3d0b2e['model'],_0x3d0b2e[_0xd369('0x31')]);_0x31a98d[_0xd369('0x35')]=_['intersection'](_0x3d0b2e['model'],qs[_0xd369('0x36')](_0x3ef23a['query'][_0xd369('0x36')]));_0x31a98d['attributes']=_0x31a98d[_0xd369('0x35')][_0xd369('0x37')]?_0x31a98d[_0xd369('0x35')]:_0x3d0b2e['model'];if(!_0x3ef23a[_0xd369('0x31')][_0xd369('0x38')](_0xd369('0x39'))){_0x31a98d[_0xd369('0x1e')]=qs['limit'](_0x3ef23a['query'][_0xd369('0x1e')]);_0x31a98d[_0xd369('0x1c')]=qs[_0xd369('0x1c')](_0x3ef23a['query']['offset']);}_0x31a98d[_0xd369('0x3a')]=qs[_0xd369('0x3b')](_0x3ef23a[_0xd369('0x31')]['sort']);_0x31a98d[_0xd369('0x3c')]=qs[_0xd369('0x33')](_[_0xd369('0x3d')](_0x3ef23a[_0xd369('0x31')],_0x3d0b2e[_0xd369('0x33')]),_0x3fa29d);if(_0x3ef23a['query'][_0xd369('0x3e')]){_0x31a98d[_0xd369('0x3c')]=_[_0xd369('0x3f')](_0x31a98d[_0xd369('0x3c')],{'$or':_[_0xd369('0x2a')](_0x3fa29d,function(_0xd54d2b){if(_0xd54d2b[_0xd369('0x2e')]!==_0xd369('0x40')){var _0x3fd875={};_0x3fd875[_0xd54d2b[_0xd369('0x28')]]={'$like':'%'+_0x3ef23a[_0xd369('0x31')][_0xd369('0x3e')]+'%'};return _0x3fd875;}})});}_0x31a98d=_[_0xd369('0x3f')]({},_0x31a98d,_0x3ef23a[_0xd369('0x41')]);var _0x52094b={'where':_0x31a98d[_0xd369('0x3c')]};return db[_0xd369('0x2b')][_0xd369('0x42')](_0x52094b)['then'](function(_0x2f13b0){_0x5649b2[_0xd369('0x42')]=_0x2f13b0;if(_0x3ef23a[_0xd369('0x31')]['includeAll']){_0x31a98d['include']=[{'all':!![]}];}return db[_0xd369('0x2b')][_0xd369('0x43')](_0x31a98d);})[_0xd369('0x22')](function(_0x4e3959){_0x5649b2[_0xd369('0x44')]=_0x4e3959;return _0x5649b2;})[_0xd369('0x22')](respondWithFilteredResult(_0x3b2ccb,_0x31a98d))[_0xd369('0x45')](handleError(_0x3b2ccb,null));};exports[_0xd369('0x46')]=function(_0x43654e,_0x244eb7){var _0x52d5a3={'raw':![],'where':{'id':_0x43654e[_0xd369('0x47')]['id']}},_0x40a688={};_0x40a688['model']=_[_0xd369('0x32')](db[_0xd369('0x2b')][_0xd369('0x2c')]);_0x40a688[_0xd369('0x31')]=_['keys'](_0x43654e[_0xd369('0x31')]);_0x40a688[_0xd369('0x33')]=_['intersection'](_0x40a688[_0xd369('0x30')],_0x40a688['query']);_0x52d5a3[_0xd369('0x35')]=_[_0xd369('0x34')](_0x40a688[_0xd369('0x30')],qs[_0xd369('0x36')](_0x43654e[_0xd369('0x31')][_0xd369('0x36')]));_0x52d5a3[_0xd369('0x35')]=_0x52d5a3[_0xd369('0x35')][_0xd369('0x37')]?_0x52d5a3[_0xd369('0x35')]:_0x40a688[_0xd369('0x30')];if(_0x43654e[_0xd369('0x31')][_0xd369('0x48')]){_0x52d5a3['include']=[{'all':!![]}];}_0x52d5a3=_[_0xd369('0x3f')]({},_0x52d5a3,_0x43654e[_0xd369('0x41')]);return db[_0xd369('0x2b')][_0xd369('0x49')](_0x52d5a3)[_0xd369('0x22')](handleEntityNotFound(_0x244eb7,null))['then'](respondWithResult(_0x244eb7,null))[_0xd369('0x45')](handleError(_0x244eb7,null));};exports['create']=function(_0x4b4a3d,_0x2772d1){return db[_0xd369('0x2b')][_0xd369('0x4a')](_0x4b4a3d[_0xd369('0x4b')],{})[_0xd369('0x22')](function(_0x3864cb){var _0xb8a98d=_0x4b4a3d['user'][_0xd369('0x23')]({'plain':!![]});if(!_0xb8a98d)throw new Error(_0xd369('0x4c'));if(_0xb8a98d[_0xd369('0x4d')]===_0xd369('0x4e')){var _0x7ce509=_0x3864cb[_0xd369('0x23')]({'plain':!![]});var _0x5f4af0=_0xd369('0x24');return db[_0xd369('0x4f')][_0xd369('0x49')]({'where':{'name':_0x5f4af0,'userProfileId':_0xb8a98d[_0xd369('0x50')]},'raw':!![]})[_0xd369('0x22')](function(_0x297cc2){if(_0x297cc2&&_0x297cc2[_0xd369('0x51')]===0x0){return db[_0xd369('0x52')]['create']({'name':_0x7ce509[_0xd369('0x28')],'resourceId':_0x7ce509['id'],'type':_0x297cc2[_0xd369('0x28')],'sectionId':_0x297cc2['id']},{})['then'](function(){return _0x3864cb;});}else{return _0x3864cb;}})['catch'](function(_0x113b36){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x113b36);throw _0x113b36;});}return _0x3864cb;})[_0xd369('0x22')](respondWithResult(_0x2772d1,0xc9))[_0xd369('0x45')](handleError(_0x2772d1,null));};exports[_0xd369('0x53')]=function(_0x549b78,_0x4397fa){if(_0x549b78[_0xd369('0x4b')]['id']){delete _0x549b78[_0xd369('0x4b')]['id'];}return db[_0xd369('0x2b')][_0xd369('0x49')]({'where':{'id':_0x549b78[_0xd369('0x47')]['id']}})[_0xd369('0x22')](handleEntityNotFound(_0x4397fa,null))['then'](saveUpdates(_0x549b78[_0xd369('0x4b')],null))[_0xd369('0x22')](respondWithResult(_0x4397fa,null))[_0xd369('0x45')](handleError(_0x4397fa,null));};exports[_0xd369('0x21')]=function(_0x1ac682,_0x597a3a){return db[_0xd369('0x2b')][_0xd369('0x49')]({'where':{'id':_0x1ac682['params']['id']}})[_0xd369('0x22')](handleEntityNotFound(_0x597a3a,null))[_0xd369('0x22')](removeEntity(_0x597a3a,null))[_0xd369('0x45')](handleError(_0x597a3a,null));};exports[_0xd369('0x54')]=function(_0x19af6b,_0xfe62e3,_0x59d845){var _0x408e48=require(_0xd369('0x55'));return db['Schedule'][_0xd369('0x49')]({'where':{'id':_0x19af6b['params']['id']},'raw':!![]})[_0xd369('0x22')](handleEntityNotFound(_0xfe62e3,null))[_0xd369('0x22')](function(){_0x408e48[_0xd369('0x54')](_0x19af6b[_0xd369('0x47')]['id']);})['then'](respondWithStatusCode(_0xfe62e3,null))[_0xd369('0x45')](handleError(_0xfe62e3,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index ac38cd1..7e74b08 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 _0x1a3f=['./schedule.attributes','exports','define','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x465feb,_0x1cc380){var _0x48b9e7=function(_0x38d6db){while(--_0x38d6db){_0x465feb['push'](_0x465feb['shift']());}};_0x48b9e7(++_0x1cc380);}(_0x1a3f,0x92));var _0xf1a3=function(_0x1adf7e,_0x40bf6f){_0x1adf7e=_0x1adf7e-0x0;var _0x14d490=_0x1a3f[_0x1adf7e];return _0x14d490;};'use strict';var _=require('lodash');var util=require(_0xf1a3('0x0'));var logger=require(_0xf1a3('0x1'))(_0xf1a3('0x2'));var moment=require(_0xf1a3('0x3'));var BPromise=require(_0xf1a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1a3('0x5'));var rimraf=require(_0xf1a3('0x6'));var config=require(_0xf1a3('0x7'));var attributes=require(_0xf1a3('0x8'));module[_0xf1a3('0x9')]=function(_0x4cd9c5,_0x6e50d1){return _0x4cd9c5[_0xf1a3('0xa')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe98f=['exports','define','Schedule','tools_schedules','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2997ea,_0x1e25e0){var _0x4a6c39=function(_0x12d7c7){while(--_0x12d7c7){_0x2997ea['push'](_0x2997ea['shift']());}};_0x4a6c39(++_0x1e25e0);}(_0xe98f,0x1bc));var _0xfe98=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe98f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xfe98('0x0'));var util=require(_0xfe98('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe98('0x2'));var BPromise=require(_0xfe98('0x3'));var rp=require(_0xfe98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe98('0x5'));var config=require(_0xfe98('0x6'));var attributes=require('./schedule.attributes');module[_0xfe98('0x7')]=function(_0x57c579,_0x12f61d){return _0x57c579[_0xfe98('0x8')](_0xfe98('0x9'),attributes,{'tableName':_0xfe98('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 7277d02..1581b59 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 _0x561d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message','result','util','randomstring'];(function(_0x32967c,_0x2f9b19){var _0x1f35a4=function(_0x12c466){while(--_0x12c466){_0x32967c['push'](_0x32967c['shift']());}};_0x1f35a4(++_0x2f9b19);}(_0x561d,0x82));var _0xd561=function(_0x4554c0,_0x486ed1){_0x4554c0=_0x4554c0-0x0;var _0x4491bf=_0x561d[_0x4554c0];return _0x4491bf;};'use strict';var _=require('lodash');var util=require(_0xd561('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd561('0x1'));var fs=require('fs');var Redis=require(_0xd561('0x2'));var db=require(_0xd561('0x3'))['db'];var utils=require(_0xd561('0x4'));var logger=require(_0xd561('0x5'))(_0xd561('0x6'));var config=require(_0xd561('0x7'));var jayson=require(_0xd561('0x8'));var client=jayson['client'][_0xd561('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47159a,_0x34d32b,_0x39964f){return new BPromise(function(_0x918c90,_0x221988){return client[_0xd561('0xa')](_0x47159a,_0x39964f)[_0xd561('0xb')](function(_0x348cfb){logger[_0xd561('0xc')]('Schedule,\x20%s,\x20%s',_0x34d32b,_0xd561('0xd'));logger[_0xd561('0xe')](_0xd561('0xf'),_0x34d32b,_0xd561('0xd'),JSON[_0xd561('0x10')](_0x348cfb));if(_0x348cfb[_0xd561('0x11')]){if(_0x348cfb[_0xd561('0x11')][_0xd561('0x12')]===0x1f4){logger[_0xd561('0x11')](_0xd561('0x13'),_0x34d32b,_0x348cfb[_0xd561('0x11')]['message']);return _0x221988(_0x348cfb[_0xd561('0x11')][_0xd561('0x14')]);}logger[_0xd561('0x11')](_0xd561('0x13'),_0x34d32b,_0x348cfb[_0xd561('0x11')]['message']);return _0x918c90(_0x348cfb[_0xd561('0x11')]['message']);}else{logger['info'](_0xd561('0x13'),_0x34d32b,_0xd561('0xd'));_0x918c90(_0x348cfb[_0xd561('0x15')][_0xd561('0x14')]);}})['catch'](function(_0xeffc89){logger[_0xd561('0x11')](_0xd561('0x13'),_0x34d32b,_0xeffc89);_0x221988(_0xeffc89);});});} \ No newline at end of file +var _0x05ab=['request','then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','Schedule,\x20%s,\x20%s','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x05ab,0x16c));var _0xb05a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x05ab[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require(_0xb05a('0x0'));var moment=require('moment');var BPromise=require(_0xb05a('0x1'));var rs=require(_0xb05a('0x2'));var fs=require('fs');var Redis=require(_0xb05a('0x3'));var db=require(_0xb05a('0x4'))['db'];var utils=require(_0xb05a('0x5'));var logger=require(_0xb05a('0x6'))('rpc');var config=require(_0xb05a('0x7'));var jayson=require(_0xb05a('0x8'));var client=jayson[_0xb05a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4e7a,_0xae4483,_0x113ea8){return new BPromise(function(_0x4cc6a9,_0x3c11e4){return client[_0xb05a('0xa')](_0x5d4e7a,_0x113ea8)[_0xb05a('0xb')](function(_0x17ab10){logger['info']('Schedule,\x20%s,\x20%s',_0xae4483,_0xb05a('0xc'));logger[_0xb05a('0xd')](_0xb05a('0xe'),_0xae4483,_0xb05a('0xc'),JSON[_0xb05a('0xf')](_0x17ab10));if(_0x17ab10[_0xb05a('0x10')]){if(_0x17ab10['error']['code']===0x1f4){logger[_0xb05a('0x10')]('Schedule,\x20%s,\x20%s',_0xae4483,_0x17ab10[_0xb05a('0x10')]['message']);return _0x3c11e4(_0x17ab10[_0xb05a('0x10')][_0xb05a('0x11')]);}logger[_0xb05a('0x10')](_0xb05a('0x12'),_0xae4483,_0x17ab10[_0xb05a('0x10')][_0xb05a('0x11')]);return _0x4cc6a9(_0x17ab10[_0xb05a('0x10')][_0xb05a('0x11')]);}else{logger[_0xb05a('0x13')]('Schedule,\x20%s,\x20%s',_0xae4483,_0xb05a('0xc'));_0x4cc6a9(_0x17ab10[_0xb05a('0x14')]['message']);}})[_0xb05a('0x15')](function(_0x15b8c0){logger[_0xb05a('0x10')](_0xb05a('0x12'),_0xae4483,_0x15b8c0);_0x3c11e4(_0x15b8c0);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 72dc38d..f7ec178 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 _0xde15=['destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','put','delete'];(function(_0x20335d,_0x55e2dc){var _0x35ec99=function(_0x357bbf){while(--_0x357bbf){_0x20335d['push'](_0x20335d['shift']());}};_0x35ec99(++_0x55e2dc);}(_0xde15,0x15a));var _0x5de1=function(_0x53f324,_0x45ad73){_0x53f324=_0x53f324-0x0;var _0x262caf=_0xde15[_0x53f324];return _0x262caf;};'use strict';var multer=require(_0x5de1('0x0'));var util=require(_0x5de1('0x1'));var path=require('path');var timeout=require(_0x5de1('0x2'));var express=require(_0x5de1('0x3'));var router=express[_0x5de1('0x4')]();var fs_extra=require(_0x5de1('0x5'));var auth=require(_0x5de1('0x6'));var interaction=require(_0x5de1('0x7'));var config=require(_0x5de1('0x8'));var controller=require('./screenRecording.controller');router[_0x5de1('0x9')]('/',auth[_0x5de1('0xa')](),controller[_0x5de1('0xb')]);router[_0x5de1('0x9')](_0x5de1('0xc'),auth[_0x5de1('0xa')](),controller[_0x5de1('0xd')]);router['get'](_0x5de1('0xe'),auth['isAuthenticated'](),controller[_0x5de1('0xf')]);router[_0x5de1('0x9')](_0x5de1('0x10'),auth[_0x5de1('0xa')](),controller[_0x5de1('0x11')]);router[_0x5de1('0x12')]('/',auth[_0x5de1('0xa')](),controller[_0x5de1('0x13')]);router[_0x5de1('0x14')]('/:id',auth[_0x5de1('0xa')](),controller['update']);router[_0x5de1('0x15')](_0x5de1('0xe'),auth[_0x5de1('0xa')](),controller[_0x5de1('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd8e4=['get','isAuthenticated','describe','/:id','show','download','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd8e4,0x13f));var _0x4d8e=function(_0x410e22,_0xebec50){_0x410e22=_0x410e22-0x0;var _0x57458e=_0xd8e4[_0x410e22];return _0x57458e;};'use strict';var multer=require(_0x4d8e('0x0'));var util=require(_0x4d8e('0x1'));var path=require(_0x4d8e('0x2'));var timeout=require(_0x4d8e('0x3'));var express=require(_0x4d8e('0x4'));var router=express[_0x4d8e('0x5')]();var fs_extra=require(_0x4d8e('0x6'));var auth=require(_0x4d8e('0x7'));var interaction=require(_0x4d8e('0x8'));var config=require(_0x4d8e('0x9'));var controller=require(_0x4d8e('0xa'));router[_0x4d8e('0xb')]('/',auth[_0x4d8e('0xc')](),controller['index']);router[_0x4d8e('0xb')]('/describe',auth[_0x4d8e('0xc')](),controller[_0x4d8e('0xd')]);router[_0x4d8e('0xb')](_0x4d8e('0xe'),auth['isAuthenticated'](),controller[_0x4d8e('0xf')]);router[_0x4d8e('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x4d8e('0x10')]);router[_0x4d8e('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4d8e('0xe'),auth['isAuthenticated'](),controller[_0x4d8e('0x12')]);router[_0x4d8e('0x13')]('/:id',auth[_0x4d8e('0xc')](),controller[_0x4d8e('0x14')]);module[_0x4d8e('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 58bd6e3..4e7bc81 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 _0xfa25=['moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','createdAt'];(function(_0x52e45d,_0x3d1ca6){var _0x33b914=function(_0x5d442e){while(--_0x5d442e){_0x52e45d['push'](_0x52e45d['shift']());}};_0x33b914(++_0x3d1ca6);}(_0xfa25,0xd1));var _0x5fa2=function(_0x4cc48c,_0xb2a9c0){_0x4cc48c=_0x4cc48c-0x0;var _0x25665e=_0xfa25[_0x4cc48c];return _0x25665e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5fa2('0x0'));var path=require(_0x5fa2('0x1'));var config=require(_0x5fa2('0x2'));module[_0x5fa2('0x3')]={'format':{'type':Sequelize[_0x5fa2('0x4')],'get':function(){return this[_0x5fa2('0x5')](_0x5fa2('0x6'))?path[_0x5fa2('0x7')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x5fa2('0x8')]},'channel':{'type':Sequelize[_0x5fa2('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x53a560){var _0x2a9a69=_0x53a560['replace'](/\\/g,'/');this[_0x5fa2('0x9')](_0x5fa2('0x6'),_0x2a9a69);}},'rating':{'type':Sequelize[_0x5fa2('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x36778e){this[_0x5fa2('0x9')](_0x5fa2('0xb'),moment()['subtract'](_0x36778e,'ms'));this[_0x5fa2('0x9')]('closedAt',moment());this['setDataValue'](_0x5fa2('0xc'),_0x36778e);}},'startedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this['getDataValue'](_0x5fa2('0xb')))[_0x5fa2('0xe')](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}},'closedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')](_0x5fa2('0x11')))[_0x5fa2('0xe')](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}},'createdAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')](_0x5fa2('0x12')))[_0x5fa2('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x5fa2('0x10')]();}},'updatedAt':{'type':Sequelize[_0x5fa2('0xd')],'get':function(){return moment(this[_0x5fa2('0x5')]('updatedAt'))['format'](_0x5fa2('0xf'))[_0x5fa2('0x10')]();}}}; \ No newline at end of file +var _0x36fe=['updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x5b739d,_0x3bce5c){var _0x528dcc=function(_0x242749){while(--_0x242749){_0x5b739d['push'](_0x5b739d['shift']());}};_0x528dcc(++_0x3bce5c);}(_0x36fe,0x127));var _0xe36f=function(_0x491cbe,_0x45c8ba){_0x491cbe=_0x491cbe-0x0;var _0x59449d=_0x36fe[_0x491cbe];return _0x59449d;};'use strict';var Sequelize=require(_0xe36f('0x0'));var moment=require(_0xe36f('0x1'));var path=require(_0xe36f('0x2'));var config=require(_0xe36f('0x3'));module[_0xe36f('0x4')]={'format':{'type':Sequelize[_0xe36f('0x5')],'get':function(){return this[_0xe36f('0x6')](_0xe36f('0x7'))?path[_0xe36f('0x8')](this[_0xe36f('0x6')](_0xe36f('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe36f('0x9')]},'value':{'type':Sequelize['STRING'],'set':function(_0x349c9e){var _0xdae131=_0x349c9e['replace'](/\\/g,'/');this[_0xe36f('0xa')](_0xe36f('0x7'),_0xdae131);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe36f('0xb')],'set':function(_0x386c00){this[_0xe36f('0xa')](_0xe36f('0xc'),moment()[_0xe36f('0xd')](_0x386c00,'ms'));this['setDataValue'](_0xe36f('0xe'),moment());this['setDataValue'](_0xe36f('0xf'),_0x386c00);}},'startedAt':{'type':Sequelize[_0xe36f('0x10')],'get':function(){return moment(this[_0xe36f('0x6')]('startedAt'))[_0xe36f('0x11')](_0xe36f('0x12'))['toString']();}},'closedAt':{'type':Sequelize[_0xe36f('0x10')],'get':function(){return moment(this[_0xe36f('0x6')](_0xe36f('0xe')))[_0xe36f('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xe36f('0x13')]();}},'createdAt':{'type':Sequelize[_0xe36f('0x10')],'get':function(){return moment(this[_0xe36f('0x6')]('createdAt'))[_0xe36f('0x11')](_0xe36f('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0xe36f('0x10')],'get':function(){return moment(this[_0xe36f('0x6')](_0xe36f('0x14')))[_0xe36f('0x11')](_0xe36f('0x12'))[_0xe36f('0x13')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index c713ffa..58f1cd5 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 _0xed1f=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','show','params','merge','options','catch','create','body','duration','createdAt','closedAt','value','find','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf'];(function(_0x1e1ba6,_0x316a66){var _0x578132=function(_0x2e8538){while(--_0x2e8538){_0x1e1ba6['push'](_0x1e1ba6['shift']());}};_0x578132(++_0x316a66);}(_0xed1f,0x6a));var _0xfed1=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xed1f[_0x62c958];return _0x57ec61;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require(_0xfed1('0x2'));var jsonpatch=require(_0xfed1('0x3'));var rp=require(_0xfed1('0x4'));var moment=require(_0xfed1('0x5'));var BPromise=require(_0xfed1('0x6'));var Mustache=require(_0xfed1('0x7'));var util=require(_0xfed1('0x8'));var path=require(_0xfed1('0x9'));var sox=require(_0xfed1('0xa'));var csv=require(_0xfed1('0xb'));var ejs=require(_0xfed1('0xc'));var fs=require('fs');var fs_extra=require(_0xfed1('0xd'));var _=require(_0xfed1('0xe'));var squel=require(_0xfed1('0xf'));var crypto=require(_0xfed1('0x10'));var jsforce=require(_0xfed1('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0xb'));var querystring=require(_0xfed1('0x12'));var Papa=require('papaparse');var Redis=require(_0xfed1('0x13'));var authService=require(_0xfed1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfed1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed1('0x16'))(_0xfed1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfed1('0x18'));var db=require(_0xfed1('0x19'))['db'];function respondWithStatusCode(_0x569a6e,_0x17f4fe){_0x17f4fe=_0x17f4fe||0xcc;return function(_0x5a3469){if(_0x5a3469){return _0x569a6e['sendStatus'](_0x17f4fe);}return _0x569a6e[_0xfed1('0x1a')](_0x17f4fe)[_0xfed1('0x1b')]();};}function respondWithResult(_0x532537,_0x2dde3a){_0x2dde3a=_0x2dde3a||0xc8;return function(_0x5b9455){if(_0x5b9455){return _0x532537['status'](_0x2dde3a)[_0xfed1('0x1c')](_0x5b9455);}};}function respondWithFilteredResult(_0x39aa0c,_0x1fbb7a){return function(_0x123c46){if(_0x123c46){var _0x582e67=typeof _0x1fbb7a[_0xfed1('0x1d')]==='undefined'&&typeof _0x1fbb7a[_0xfed1('0x1e')]===_0xfed1('0x1f');var _0x489a0f=_0x123c46[_0xfed1('0x20')];var _0xa72a20=_0x582e67?0x0:_0x1fbb7a['offset'];var _0x59509b=_0x582e67?_0x123c46['count']:_0x1fbb7a[_0xfed1('0x1d')]+_0x1fbb7a['limit'];var _0x201f18;if(_0x59509b>=_0x489a0f){_0x59509b=_0x489a0f;_0x201f18=0xc8;}else{_0x201f18=0xce;}_0x39aa0c[_0xfed1('0x1a')](_0x201f18);return _0x39aa0c['set'](_0xfed1('0x21'),_0xa72a20+'-'+_0x59509b+'/'+_0x489a0f)[_0xfed1('0x1c')](_0x123c46);}return null;};}function patchUpdates(_0x59ee9d){return function(_0x3ce944){try{jsonpatch[_0xfed1('0x22')](_0x3ce944,_0x59ee9d,!![]);}catch(_0xff4842){return BPromise[_0xfed1('0x23')](_0xff4842);}return _0x3ce944['save']();};}function saveUpdates(_0x203cec,_0x59333e){return function(_0x446558){if(_0x446558){return _0x446558[_0xfed1('0x24')](_0x203cec)[_0xfed1('0x25')](function(_0x532ec2){return _0x532ec2;});}return null;};}function removeEntity(_0x41d22c,_0x594917){return function(_0x460555){if(_0x460555){return _0x460555[_0xfed1('0x26')]()[_0xfed1('0x25')](function(){_0x41d22c[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();});}};}function handleEntityNotFound(_0x1199b7,_0x527fc7){return function(_0x465ce6){if(!_0x465ce6){_0x1199b7[_0xfed1('0x27')](0x194);}return _0x465ce6;};}function handleError(_0x49072b,_0x1d6c72){_0x1d6c72=_0x1d6c72||0x1f4;return function(_0x2b9dd2){logger[_0xfed1('0x28')](_0x2b9dd2[_0xfed1('0x29')]);if(_0x2b9dd2[_0xfed1('0x2a')]){delete _0x2b9dd2[_0xfed1('0x2a')];}_0x49072b['status'](_0x1d6c72)[_0xfed1('0x2b')](_0x2b9dd2);};}exports['index']=function(_0x3106ee,_0x4e5249){var _0x53b0c9={},_0x1cec64={},_0x42c950={'count':0x0,'rows':[]};var _0x2d334e=_['map'](db[_0xfed1('0x2c')][_0xfed1('0x2d')],function(_0x13f414){return{'name':_0x13f414[_0xfed1('0x2e')],'type':_0x13f414[_0xfed1('0x2f')][_0xfed1('0x30')]};});_0x1cec64['model']=_[_0xfed1('0x31')](_[_0xfed1('0x32')](_0x2d334e,'name'),['format']);_0x1cec64[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0x3106ee[_0xfed1('0x33')]);_0x1cec64[_0xfed1('0x35')]=_[_0xfed1('0x36')](_0x1cec64['model'],_0x1cec64[_0xfed1('0x33')]);_0x53b0c9[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1cec64[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0x3106ee['query'][_0xfed1('0x39')]));_0x53b0c9['attributes']=_0x53b0c9[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x53b0c9[_0xfed1('0x37')]:_0x1cec64[_0xfed1('0x38')];if(!_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3b')](_0xfed1('0x3c'))){_0x53b0c9[_0xfed1('0x1e')]=qs['limit'](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x1e')]);_0x53b0c9[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x3106ee['query']['offset']);}_0x53b0c9[_0xfed1('0x3d')]=qs[_0xfed1('0x3e')](_0x3106ee[_0xfed1('0x33')][_0xfed1('0x3e')]);_0x53b0c9[_0xfed1('0x3f')]=qs[_0xfed1('0x35')](_[_0xfed1('0x40')](_0x3106ee[_0xfed1('0x33')],_0x1cec64['filters']),_0x2d334e);if(_0x3106ee['query'][_0xfed1('0x41')]){_0x53b0c9[_0xfed1('0x3f')]=_['merge'](_0x53b0c9[_0xfed1('0x3f')],{'$or':_[_0xfed1('0x32')](_0x2d334e,function(_0x3b0973){if(_0x3b0973[_0xfed1('0x2f')]!==_0xfed1('0x42')){var _0x31ffeb={};_0x31ffeb[_0x3b0973[_0xfed1('0x2a')]]={'$like':'%'+_0x3106ee[_0xfed1('0x33')][_0xfed1('0x41')]+'%'};return _0x31ffeb;}})});}_0x53b0c9=_['merge']({},_0x53b0c9,_0x3106ee['options']);var _0x5598dc={'where':_0x53b0c9[_0xfed1('0x3f')]};return db[_0xfed1('0x2c')][_0xfed1('0x20')](_0x5598dc)['then'](function(_0x3454e6){_0x42c950['count']=_0x3454e6;if(_0x3106ee[_0xfed1('0x33')][_0xfed1('0x43')]){_0x53b0c9[_0xfed1('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0xfed1('0x45')](_0x53b0c9);})[_0xfed1('0x25')](function(_0x422433){_0x42c950['rows']=_0x422433;return _0x42c950;})[_0xfed1('0x25')](respondWithFilteredResult(_0x4e5249,_0x53b0c9))['catch'](handleError(_0x4e5249,null));};exports[_0xfed1('0x46')]=function(_0xf1f739,_0x229fc7){var _0x13c087={'raw':![],'where':{'id':_0xf1f739[_0xfed1('0x47')]['id']}},_0x1bfbe8={};_0x1bfbe8[_0xfed1('0x38')]=_[_0xfed1('0x34')](db[_0xfed1('0x2c')]['rawAttributes']);_0x1bfbe8[_0xfed1('0x33')]=_[_0xfed1('0x34')](_0xf1f739[_0xfed1('0x33')]);_0x1bfbe8['filters']=_['intersection'](_0x1bfbe8[_0xfed1('0x38')],_0x1bfbe8[_0xfed1('0x33')]);_0x13c087[_0xfed1('0x37')]=_[_0xfed1('0x36')](_0x1bfbe8[_0xfed1('0x38')],qs[_0xfed1('0x39')](_0xf1f739[_0xfed1('0x33')][_0xfed1('0x39')]));_0x13c087[_0xfed1('0x37')]=_0x13c087[_0xfed1('0x37')][_0xfed1('0x3a')]?_0x13c087[_0xfed1('0x37')]:_0x1bfbe8['model'];if(_0xf1f739[_0xfed1('0x33')][_0xfed1('0x43')]){_0x13c087[_0xfed1('0x44')]=[{'all':!![]}];}_0x13c087=_[_0xfed1('0x48')]({},_0x13c087,_0xf1f739[_0xfed1('0x49')]);return db[_0xfed1('0x2c')]['find'](_0x13c087)[_0xfed1('0x25')](handleEntityNotFound(_0x229fc7,null))[_0xfed1('0x25')](respondWithResult(_0x229fc7,null))[_0xfed1('0x4a')](handleError(_0x229fc7,null));};exports['create']=function(_0x22874a,_0x10f98d){return db[_0xfed1('0x2c')][_0xfed1('0x4b')](_0x22874a['body'],{})[_0xfed1('0x25')](respondWithResult(_0x10f98d,0xc9))[_0xfed1('0x4a')](handleError(_0x10f98d,null));};exports[_0xfed1('0x24')]=function(_0x42761f,_0x14745e){if(_0x42761f[_0xfed1('0x4c')]['id']){delete _0x42761f[_0xfed1('0x4c')]['id'];}delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4d')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4e')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x4f')];delete _0x42761f[_0xfed1('0x4c')][_0xfed1('0x50')];return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x42761f[_0xfed1('0x47')]['id']}})['then'](handleEntityNotFound(_0x14745e,null))['then'](saveUpdates(_0x42761f[_0xfed1('0x4c')],null))[_0xfed1('0x25')](respondWithResult(_0x14745e,null))[_0xfed1('0x4a')](handleError(_0x14745e,null));};exports[_0xfed1('0x52')]=function(_0x5da599,_0x3c2534){return db[_0xfed1('0x2c')]['describe']()['then'](respondWithResult(_0x3c2534,null))['catch'](handleError(_0x3c2534,null));};exports[_0xfed1('0x53')]=function(_0x1aaa3d,_0x15e90f,_0x1d8ef2){var _0x2665c8=require(_0xfed1('0x54'));var _0x1a9f22=![];var _0x144102={};if(_0x1aaa3d[_0xfed1('0x33')][_0xfed1('0x2f')]&&_0x1aaa3d['query']['type']===_0xfed1('0x55')){_0x144102[_0xfed1('0x55')]=_0x1aaa3d[_0xfed1('0x47')]['id'];}else{_0x144102['id']=_0x1aaa3d[_0xfed1('0x47')]['id'];}return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':_0x144102,'attributes':['id',_0xfed1('0x50')],'raw':!![]})[_0xfed1('0x25')](handleEntityNotFound(_0x15e90f,null))[_0xfed1('0x25')](function(_0x427fa6){if(_0x427fa6){var _0xbd49dc=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x427fa6[_0xfed1('0x50')]);var _0x3a7a42=util[_0xfed1('0x59')]('%s.cypher',_0xbd49dc);if(fs['existsSync'](_0x3a7a42)){_0x1a9f22=!![];return _0x2665c8[_0xfed1('0x5a')](_0x3a7a42,_0xbd49dc,config[_0xfed1('0x5b')][_0xfed1('0x5c')])[_0xfed1('0x25')](function(){return _0x427fa6;});}return _0x427fa6;}})[_0xfed1('0x25')](function(_0x41a22a){if(_0x41a22a){var _0x2ccdc3=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x41a22a[_0xfed1('0x50')]);if(!fs[_0xfed1('0x5d')](_0x2ccdc3)){throw new db[(_0xfed1('0x5e'))][(_0xfed1('0x5f'))]('ScreenRecording\x20not\x20found');}if(_0x41a22a[_0xfed1('0x60')]){return _0x15e90f['download'](_0x2ccdc3,_0x41a22a['filename']+path[_0xfed1('0x61')](_0x2ccdc3),function(){if(_0x1a9f22){fs['unlink'](_0x2ccdc3);}});}else{return _0x15e90f[_0xfed1('0x53')](_0x2ccdc3,function(_0x5acc45){if(_0x1a9f22){fs[_0xfed1('0x62')](_0x2ccdc3);}});}}})[_0xfed1('0x4a')](function(_0x53f0ab){if(_0x53f0ab[_0xfed1('0x63')]===_0xfed1('0x64')){_0x15e90f['status'](0x194)[_0xfed1('0x2b')](_0xfed1('0x65'));}else{return handleError(_0x15e90f,null);}});};exports[_0xfed1('0x26')]=function(_0x2f37b9,_0x59a23a){return db[_0xfed1('0x2c')][_0xfed1('0x51')]({'where':{'id':_0x2f37b9[_0xfed1('0x47')]['id']}})[_0xfed1('0x25')](function(_0x23347a){if(_[_0xfed1('0x66')](_0x23347a)){throw new ReferenceError(_0xfed1('0x67'));}return _0x23347a;})[_0xfed1('0x25')](function(_0x5c043d){var _0x2d66ec=path[_0xfed1('0x56')](config[_0xfed1('0x57')],_0xfed1('0x58'),_0x5c043d[_0xfed1('0x50')]);logger[_0xfed1('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d66ec);if(!_['isNil'](_0x5c043d['value'])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}_0x2d66ec=_0x2d66ec+_0xfed1('0x6b');if(!_['isNil'](_0x5c043d[_0xfed1('0x50')])&&fs[_0xfed1('0x5d')](_0x2d66ec)){logger[_0xfed1('0x68')](_0xfed1('0x69')+_0x2d66ec+_0xfed1('0x6a'));fs['unlinkSync'](_0x2d66ec);}return _0x5c043d;})[_0xfed1('0x25')](function(_0x6b74cb){if(!_0x6b74cb)throw new InternalError();return _0x6b74cb[_0xfed1('0x26')]();})['then'](function(){_0x59a23a[_0xfed1('0x1a')](0xcc)[_0xfed1('0x1b')]();})[_0xfed1('0x4a')](handleError(_0x59a23a,null));}; \ No newline at end of file +var _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../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','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x53b2d1,_0x367d31){var _0x294064=function(_0x1244d4){while(--_0x1244d4){_0x53b2d1['push'](_0x53b2d1['shift']());}};_0x294064(++_0x367d31);}(_0xee14,0x13a));var _0x4ee1=function(_0x3c69fa,_0x1cea62){_0x3c69fa=_0x3c69fa-0x0;var _0x51c2ef=_0xee14[_0x3c69fa];return _0x51c2ef;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 79b1cc5..bc52d90 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 _0x5c42=['util','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x430100,_0x31114d){var _0x437b96=function(_0x577f04){while(--_0x577f04){_0x430100['push'](_0x430100['shift']());}};_0x437b96(++_0x31114d);}(_0x5c42,0x1e0));var _0x25c4=function(_0xb4fd1e,_0x2db689){_0xb4fd1e=_0xb4fd1e-0x0;var _0x208e8d=_0x5c42[_0xb4fd1e];return _0x208e8d;};'use strict';var _=require(_0x25c4('0x0'));var util=require(_0x25c4('0x1'));var logger=require('../../config/logger')(_0x25c4('0x2'));var moment=require(_0x25c4('0x3'));var BPromise=require(_0x25c4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25c4('0x5'));var rimraf=require(_0x25c4('0x6'));var config=require(_0x25c4('0x7'));var attributes=require(_0x25c4('0x8'));module[_0x25c4('0x9')]=function(_0x43f506,_0x39d311){return _0x43f506['define'](_0x25c4('0xa'),attributes,{'tableName':_0x25c4('0xb'),'paranoid':![],'indexes':[{'name':_0x25c4('0xc'),'fields':[_0x25c4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4a4=['rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','bluebird','request-promise','path'];(function(_0x11cab3,_0xb965de){var _0x12e5ee=function(_0x56b14e){while(--_0x56b14e){_0x11cab3['push'](_0x11cab3['shift']());}};_0x12e5ee(++_0xb965de);}(_0xb4a4,0x1b4));var _0x4b4a=function(_0x4273d7,_0x1a67a2){_0x4273d7=_0x4273d7-0x0;var _0x188ee0=_0xb4a4[_0x4273d7];return _0x188ee0;};'use strict';var _=require(_0x4b4a('0x0'));var util=require(_0x4b4a('0x1'));var logger=require('../../config/logger')(_0x4b4a('0x2'));var moment=require('moment');var BPromise=require(_0x4b4a('0x3'));var rp=require(_0x4b4a('0x4'));var fs=require('fs');var path=require(_0x4b4a('0x5'));var rimraf=require(_0x4b4a('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b4a('0x7'));module[_0x4b4a('0x8')]=function(_0x2a661f,_0x103bd9){return _0x2a661f[_0x4b4a('0x9')](_0x4b4a('0xa'),attributes,{'tableName':_0x4b4a('0xb'),'paranoid':![],'indexes':[{'name':_0x4b4a('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index fdb3452..d370fc5 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 _0x2342=['info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','ScreenRecording,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x3832f9,_0x59c443){var _0x37418c=function(_0x133ee9){while(--_0x133ee9){_0x3832f9['push'](_0x3832f9['shift']());}};_0x37418c(++_0x59c443);}(_0x2342,0x185));var _0x2234=function(_0x45bb6a,_0x149896){_0x45bb6a=_0x45bb6a-0x0;var _0x2db45b=_0x2342[_0x45bb6a];return _0x2db45b;};'use strict';var _=require(_0x2234('0x0'));var util=require('util');var moment=require(_0x2234('0x1'));var BPromise=require(_0x2234('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2234('0x3'));var db=require(_0x2234('0x4'))['db'];var utils=require(_0x2234('0x5'));var logger=require(_0x2234('0x6'))(_0x2234('0x7'));var config=require('../../config/environment');var jayson=require(_0x2234('0x8'));var client=jayson['client'][_0x2234('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1deb0d,_0x33e8f8,_0x2e4edc){return new BPromise(function(_0x2a80f9,_0x2b2767){return client[_0x2234('0xa')](_0x1deb0d,_0x2e4edc)['then'](function(_0x49c8bc){logger[_0x2234('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x33e8f8,_0x2234('0xc'));logger[_0x2234('0xd')](_0x2234('0xe'),_0x33e8f8,_0x2234('0xc'),JSON['stringify'](_0x49c8bc));if(_0x49c8bc[_0x2234('0xf')]){if(_0x49c8bc[_0x2234('0xf')][_0x2234('0x10')]===0x1f4){logger['error'](_0x2234('0x11'),_0x33e8f8,_0x49c8bc[_0x2234('0xf')][_0x2234('0x12')]);return _0x2b2767(_0x49c8bc[_0x2234('0xf')][_0x2234('0x12')]);}logger[_0x2234('0xf')](_0x2234('0x11'),_0x33e8f8,_0x49c8bc[_0x2234('0xf')][_0x2234('0x12')]);return _0x2a80f9(_0x49c8bc[_0x2234('0xf')][_0x2234('0x12')]);}else{logger['info'](_0x2234('0x11'),_0x33e8f8,'request\x20sent');_0x2a80f9(_0x49c8bc[_0x2234('0x13')][_0x2234('0x12')]);}})['catch'](function(_0x3c67dc){logger[_0x2234('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x33e8f8,_0x3c67dc);_0x2b2767(_0x3c67dc);});});} \ No newline at end of file +var _0xc13b=['lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc13b,0x1b8));var _0xbc13=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc13b[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xbc13('0x0'));var util=require(_0xbc13('0x1'));var moment=require('moment');var BPromise=require(_0xbc13('0x2'));var rs=require(_0xbc13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc13('0x4'));var logger=require(_0xbc13('0x5'))('rpc');var config=require(_0xbc13('0x6'));var jayson=require(_0xbc13('0x7'));var client=jayson[_0xbc13('0x8')][_0xbc13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b51c3,_0xc41ad5,_0x1e3cc5){return new BPromise(function(_0x2dd026,_0x3872ae){return client[_0xbc13('0xa')](_0x2b51c3,_0x1e3cc5)[_0xbc13('0xb')](function(_0x21e903){logger[_0xbc13('0xc')](_0xbc13('0xd'),_0xc41ad5,_0xbc13('0xe'));logger[_0xbc13('0xf')](_0xbc13('0x10'),_0xc41ad5,_0xbc13('0xe'),JSON['stringify'](_0x21e903));if(_0x21e903[_0xbc13('0x11')]){if(_0x21e903[_0xbc13('0x11')]['code']===0x1f4){logger[_0xbc13('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xc41ad5,_0x21e903[_0xbc13('0x11')][_0xbc13('0x12')]);return _0x3872ae(_0x21e903[_0xbc13('0x11')][_0xbc13('0x12')]);}logger[_0xbc13('0x11')](_0xbc13('0xd'),_0xc41ad5,_0x21e903[_0xbc13('0x11')][_0xbc13('0x12')]);return _0x2dd026(_0x21e903[_0xbc13('0x11')][_0xbc13('0x12')]);}else{logger[_0xbc13('0xc')](_0xbc13('0xd'),_0xc41ad5,_0xbc13('0xe'));_0x2dd026(_0x21e903['result'][_0xbc13('0x12')]);}})[_0xbc13('0x13')](function(_0x192094){logger[_0xbc13('0x11')](_0xbc13('0xd'),_0xc41ad5,_0x192094);_0x3872ae(_0x192094);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index afcde83..ff845a2 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 _0xb7d1=['format','extname','single','file','addLogo','server/files/images/logos/','%s%s','logologin','post','addLogoLogin','preferred','originalname','/:id/preferred','addPreferred','favicon','addFavicon','update','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x17b617,_0x46211b){var _0x5984a7=function(_0x273fc6){while(--_0x273fc6){_0x17b617['push'](_0x17b617['shift']());}};_0x5984a7(++_0x46211b);}(_0xb7d1,0x18e));var _0x1b7d=function(_0x554105,_0x49a515){_0x554105=_0x554105-0x0;var _0x49d42e=_0xb7d1[_0x554105];return _0x49d42e;};'use strict';var multer=require(_0x1b7d('0x0'));var util=require(_0x1b7d('0x1'));var path=require(_0x1b7d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b7d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b7d('0x4'));var config=require(_0x1b7d('0x5'));var controller=require('./setting.controller');router[_0x1b7d('0x6')]('/',auth[_0x1b7d('0x7')](),controller['index']);router[_0x1b7d('0x6')]('/now',controller[_0x1b7d('0x8')]);router[_0x1b7d('0x6')](_0x1b7d('0x9'),controller[_0x1b7d('0xa')]);router[_0x1b7d('0x6')](_0x1b7d('0xb'),controller['getLogo']);router[_0x1b7d('0x6')](_0x1b7d('0xc'),controller['getLogoLogin']);router[_0x1b7d('0x6')](_0x1b7d('0xd'),controller[_0x1b7d('0xe')]);router[_0x1b7d('0x6')]('/:id/preferred',controller['getPreferred']);router[_0x1b7d('0x6')](_0x1b7d('0xf'),controller[_0x1b7d('0x10')]);var upload=multer({'storage':multer[_0x1b7d('0x11')]({'destination':function(_0x4c0539,_0x57ca14,_0x714c3e){_0x714c3e(null,path[_0x1b7d('0x12')](config[_0x1b7d('0x13')],'server/files/images/logos/'));},'filename':function(_0x2944f8,_0x4aec18,_0x3780de){_0x3780de(null,util[_0x1b7d('0x14')]('%s%s','logo',path[_0x1b7d('0x15')](_0x4aec18['originalname'])));}})});router['post'](_0x1b7d('0xb'),upload[_0x1b7d('0x16')](_0x1b7d('0x17')),controller[_0x1b7d('0x18')]);var upload=multer({'storage':multer[_0x1b7d('0x11')]({'destination':function(_0xa86483,_0x55b62a,_0x29ce1e){_0x29ce1e(null,path['join'](config['root'],_0x1b7d('0x19')));},'filename':function(_0x4f44f8,_0x597c44,_0x2c5006){_0x2c5006(null,util[_0x1b7d('0x14')](_0x1b7d('0x1a'),_0x1b7d('0x1b'),path[_0x1b7d('0x15')](_0x597c44['originalname'])));}})});router[_0x1b7d('0x1c')]('/:id/logo_login',upload[_0x1b7d('0x16')](_0x1b7d('0x17')),controller[_0x1b7d('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e070e,_0x137859,_0x5155ae){_0x5155ae(null,path[_0x1b7d('0x12')](config[_0x1b7d('0x13')],_0x1b7d('0x19')));},'filename':function(_0x539ed8,_0x10df91,_0x3adefb){_0x3adefb(null,util[_0x1b7d('0x14')](_0x1b7d('0x1a'),_0x1b7d('0x1e'),path['extname'](_0x10df91[_0x1b7d('0x1f')])));}})});router[_0x1b7d('0x1c')](_0x1b7d('0x20'),upload['single'](_0x1b7d('0x17')),controller[_0x1b7d('0x21')]);var upload=multer({'storage':multer[_0x1b7d('0x11')]({'destination':function(_0x26440d,_0x23ce9c,_0x235729){_0x235729(null,path[_0x1b7d('0x12')](config[_0x1b7d('0x13')],_0x1b7d('0x19')));},'filename':function(_0x56bfc6,_0x5b7668,_0x2832d9){_0x2832d9(null,util[_0x1b7d('0x14')](_0x1b7d('0x1a'),_0x1b7d('0x22'),path[_0x1b7d('0x15')](_0x5b7668[_0x1b7d('0x1f')])));}})});router[_0x1b7d('0x1c')](_0x1b7d('0xf'),upload[_0x1b7d('0x16')]('file'),controller[_0x1b7d('0x23')]);router['put'](_0x1b7d('0x9'),auth[_0x1b7d('0x7')](),controller[_0x1b7d('0x24')]);module[_0x1b7d('0x25')]=router; \ No newline at end of file +var _0x2d9c=['favicon','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','join','root','format','%s%s','logo','extname','post','single','file','addLogo','diskStorage','logologin','originalname','addLogoLogin','server/files/images/logos/','/:id/preferred','addPreferred'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d9c,0xb8));var _0xc2d9=function(_0x32c2bc,_0x57d8e4){_0x32c2bc=_0x32c2bc-0x0;var _0x9f2cf9=_0x2d9c[_0x32c2bc];return _0x9f2cf9;};'use strict';var multer=require('multer');var util=require(_0xc2d9('0x0'));var path=require(_0xc2d9('0x1'));var timeout=require(_0xc2d9('0x2'));var express=require(_0xc2d9('0x3'));var router=express[_0xc2d9('0x4')]();var fs_extra=require(_0xc2d9('0x5'));var auth=require(_0xc2d9('0x6'));var interaction=require(_0xc2d9('0x7'));var config=require(_0xc2d9('0x8'));var controller=require('./setting.controller');router[_0xc2d9('0x9')]('/',auth[_0xc2d9('0xa')](),controller[_0xc2d9('0xb')]);router[_0xc2d9('0x9')](_0xc2d9('0xc'),controller[_0xc2d9('0xd')]);router[_0xc2d9('0x9')](_0xc2d9('0xe'),controller[_0xc2d9('0xf')]);router[_0xc2d9('0x9')](_0xc2d9('0x10'),controller['getLogo']);router[_0xc2d9('0x9')](_0xc2d9('0x11'),controller[_0xc2d9('0x12')]);router[_0xc2d9('0x9')](_0xc2d9('0x13'),controller[_0xc2d9('0x14')]);router[_0xc2d9('0x9')]('/:id/preferred',controller[_0xc2d9('0x15')]);router[_0xc2d9('0x9')](_0xc2d9('0x16'),controller[_0xc2d9('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x208026,_0x1724e6,_0x5b7b42){_0x5b7b42(null,path[_0xc2d9('0x18')](config[_0xc2d9('0x19')],'server/files/images/logos/'));},'filename':function(_0x63d63b,_0x35286f,_0x423dc1){_0x423dc1(null,util[_0xc2d9('0x1a')](_0xc2d9('0x1b'),_0xc2d9('0x1c'),path[_0xc2d9('0x1d')](_0x35286f['originalname'])));}})});router[_0xc2d9('0x1e')](_0xc2d9('0x10'),upload[_0xc2d9('0x1f')](_0xc2d9('0x20')),controller[_0xc2d9('0x21')]);var upload=multer({'storage':multer[_0xc2d9('0x22')]({'destination':function(_0x3bd13a,_0x4d1bda,_0x6e24be){_0x6e24be(null,path[_0xc2d9('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x6be9eb,_0x613d25,_0x163e1e){_0x163e1e(null,util[_0xc2d9('0x1a')](_0xc2d9('0x1b'),_0xc2d9('0x23'),path[_0xc2d9('0x1d')](_0x613d25[_0xc2d9('0x24')])));}})});router['post'](_0xc2d9('0x11'),upload[_0xc2d9('0x1f')](_0xc2d9('0x20')),controller[_0xc2d9('0x25')]);var upload=multer({'storage':multer[_0xc2d9('0x22')]({'destination':function(_0x177698,_0x1f0fd4,_0x2637ba){_0x2637ba(null,path[_0xc2d9('0x18')](config[_0xc2d9('0x19')],_0xc2d9('0x26')));},'filename':function(_0x1f6191,_0x1a6b35,_0x4389b7){_0x4389b7(null,util[_0xc2d9('0x1a')](_0xc2d9('0x1b'),'preferred',path[_0xc2d9('0x1d')](_0x1a6b35[_0xc2d9('0x24')])));}})});router[_0xc2d9('0x1e')](_0xc2d9('0x27'),upload[_0xc2d9('0x1f')](_0xc2d9('0x20')),controller[_0xc2d9('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16a889,_0x4717b6,_0x4f1300){_0x4f1300(null,path[_0xc2d9('0x18')](config[_0xc2d9('0x19')],_0xc2d9('0x26')));},'filename':function(_0x2056f7,_0x1100bc,_0x4355ac){_0x4355ac(null,util[_0xc2d9('0x1a')]('%s%s',_0xc2d9('0x29'),path[_0xc2d9('0x1d')](_0x1100bc[_0xc2d9('0x24')])));}})});router[_0xc2d9('0x1e')](_0xc2d9('0x16'),upload[_0xc2d9('0x1f')](_0xc2d9('0x20')),controller['addFavicon']);router[_0xc2d9('0x2a')](_0xc2d9('0xe'),auth['isAuthenticated'](),controller[_0xc2d9('0x2b')]);module[_0xc2d9('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 328b112..0b96411 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 _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x38f078,_0x104bbe){var _0x3855ef=function(_0x4eb09b){while(--_0x4eb09b){_0x38f078['push'](_0x38f078['shift']());}};_0x3855ef(++_0x104bbe);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x0b0e[_0x2ed8f3];return _0x525a55;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x2ef3=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','exports','INTEGER','min_internal'];(function(_0x51d8e0,_0x318b64){var _0x30e635=function(_0x288a45){while(--_0x288a45){_0x51d8e0['push'](_0x51d8e0['shift']());}};_0x30e635(++_0x318b64);}(_0x2ef3,0xba));var _0x32ef=function(_0x237c09,_0x77d337){_0x237c09=_0x237c09-0x0;var _0x4ef3e7=_0x2ef3[_0x237c09];return _0x4ef3e7;};'use strict';var Sequelize=require(_0x32ef('0x0'));module[_0x32ef('0x1')]={'min_internal':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x32ef('0x2')](0xb),'unique':_0x32ef('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x32ef('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnaddr':{'type':Sequelize[_0x32ef('0x5')]},'turnusername':{'type':Sequelize[_0x32ef('0x5')]},'turnpassword':{'type':Sequelize[_0x32ef('0x5')]},'pageTitle':{'type':Sequelize[_0x32ef('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':_0x32ef('0x8')},'enableEmailPreview':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x32ef('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x32ef('0x5')]},'defaultFavicon':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x32ef('0x2')]},'transcribeRegion':{'type':Sequelize[_0x32ef('0x5')]},'sentiment':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x32ef('0x5')]},'language':{'type':Sequelize[_0x32ef('0x5')]},'bucket':{'type':Sequelize[_0x32ef('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x32ef('0x2')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x32ef('0x2')](0x2)[_0x32ef('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x32ef('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x32ef('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 335cf73..201c29a 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 _0x508f=['client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Setting','includeAll','findAll','params','keys','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','toLower','root','default','upperFirst','custom','existsSync','ValidationError','download','getLogoLogin','default_loginLogo.svg','Sequelize','\x20not\x20found','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','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','../../mysqldb','jayson/promise'];(function(_0x4e9680,_0x15dc45){var _0x5cbc22=function(_0x2e1738){while(--_0x2e1738){_0x4e9680['push'](_0x4e9680['shift']());}};_0x5cbc22(++_0x15dc45);}(_0x508f,0x15e));var _0xf508=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x508f[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xf508('0x0'));var rimraf=require(_0xf508('0x1'));var zipdir=require(_0xf508('0x2'));var jsonpatch=require(_0xf508('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf508('0x4'));var Mustache=require(_0xf508('0x5'));var util=require(_0xf508('0x6'));var path=require(_0xf508('0x7'));var sox=require(_0xf508('0x8'));var csv=require(_0xf508('0x9'));var ejs=require(_0xf508('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf508('0xb'));var squel=require('squel');var crypto=require(_0xf508('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf508('0xd'));var toCsv=require(_0xf508('0x9'));var querystring=require(_0xf508('0xe'));var Papa=require(_0xf508('0xf'));var Redis=require(_0xf508('0x10'));var authService=require(_0xf508('0x11'));var qs=require(_0xf508('0x12'));var as=require(_0xf508('0x13'));var hardwareService=require(_0xf508('0x14'));var logger=require(_0xf508('0x15'))(_0xf508('0x16'));var utils=require(_0xf508('0x17'));var config=require(_0xf508('0x18'));var licenseUtil=require(_0xf508('0x19'));var db=require(_0xf508('0x1a'))['db'];var jayson=require(_0xf508('0x1b'));var client=jayson[_0xf508('0x1c')][_0xf508('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2319db,_0x5b2f07,_0x85fd6b,_0x55377b){return new BPromise(function(_0x487509,_0x36c9bd){var _0x2c1070=_0x55377b||client;return _0x2c1070[_0xf508('0x1e')](_0x2319db,_0x85fd6b)[_0xf508('0x1f')](function(_0x41c575){logger[_0xf508('0x20')](_0xf508('0x21'),_0x5b2f07,_0xf508('0x22'));logger[_0xf508('0x23')]('Setting,\x20%s,\x20%s,\x20%s',_0x5b2f07,_0xf508('0x22'),JSON[_0xf508('0x24')](_0x41c575));if(_0x41c575['error']){if(_0x41c575['error'][_0xf508('0x25')]===0x1f4){logger[_0xf508('0x26')]('Setting,\x20%s,\x20%s',_0x5b2f07,_0x41c575['error']['message']);return _0x36c9bd(_0x41c575[_0xf508('0x26')][_0xf508('0x27')]);}logger['error']('Setting,\x20%s,\x20%s',_0x5b2f07,_0x41c575[_0xf508('0x26')][_0xf508('0x27')]);return _0x487509(_0x41c575['error'][_0xf508('0x27')]);}else{logger['info'](_0xf508('0x21'),_0x5b2f07,_0xf508('0x22'));_0x487509(_0x41c575['result']['message']);}})[_0xf508('0x28')](function(_0x591757){logger[_0xf508('0x26')]('Setting,\x20%s,\x20%s',_0x5b2f07,_0x591757);_0x36c9bd(_0x591757);});});}function respondWithStatusCode(_0x4f81c9,_0x50c786){_0x50c786=_0x50c786||0xcc;return function(_0x850f8){if(_0x850f8){return _0x4f81c9[_0xf508('0x29')](_0x50c786);}return _0x4f81c9[_0xf508('0x2a')](_0x50c786)[_0xf508('0x2b')]();};}function respondWithResult(_0x1273ca,_0x4959a9){_0x4959a9=_0x4959a9||0xc8;return function(_0xce6ecb){if(_0xce6ecb){return _0x1273ca[_0xf508('0x2a')](_0x4959a9)[_0xf508('0x2c')](_0xce6ecb);}};}function respondWithFilteredResult(_0x25e941,_0x5c0486){return function(_0x488297){if(_0x488297){var _0x41d226=typeof _0x5c0486['offset']===_0xf508('0x2d')&&typeof _0x5c0486[_0xf508('0x2e')]===_0xf508('0x2d');var _0x1ae2ad=_0x488297[_0xf508('0x2f')];var _0x68db94=_0x41d226?0x0:_0x5c0486[_0xf508('0x30')];var _0x143a9b=_0x41d226?_0x488297['count']:_0x5c0486[_0xf508('0x30')]+_0x5c0486[_0xf508('0x2e')];var _0x4ca59b;if(_0x143a9b>=_0x1ae2ad){_0x143a9b=_0x1ae2ad;_0x4ca59b=0xc8;}else{_0x4ca59b=0xce;}_0x25e941[_0xf508('0x2a')](_0x4ca59b);return _0x25e941[_0xf508('0x31')](_0xf508('0x32'),_0x68db94+'-'+_0x143a9b+'/'+_0x1ae2ad)['json'](_0x488297);}return null;};}function patchUpdates(_0x22b482){return function(_0x120c8e){try{jsonpatch[_0xf508('0x33')](_0x120c8e,_0x22b482,!![]);}catch(_0x420840){return BPromise[_0xf508('0x34')](_0x420840);}return _0x120c8e[_0xf508('0x35')]();};}function saveUpdates(_0x1e780a,_0x10f7b3){return function(_0x283ee2){if(_0x283ee2){return _0x283ee2[_0xf508('0x36')](_0x1e780a)['then'](function(_0x543e65){return _0x543e65;});}return null;};}function removeEntity(_0x2dbe6b,_0x50ebe8){return function(_0x484024){if(_0x484024){return _0x484024[_0xf508('0x37')]()[_0xf508('0x1f')](function(){_0x2dbe6b[_0xf508('0x2a')](0xcc)[_0xf508('0x2b')]();});}};}function handleEntityNotFound(_0x1997de,_0x58a1a3){return function(_0x52a401){if(!_0x52a401){_0x1997de['sendStatus'](0x194);}return _0x52a401;};}function handleError(_0x3068a5,_0xb7d0d1){_0xb7d0d1=_0xb7d0d1||0x1f4;return function(_0x50f4d9){logger[_0xf508('0x26')](_0x50f4d9[_0xf508('0x38')]);if(_0x50f4d9[_0xf508('0x39')]){delete _0x50f4d9['name'];}_0x3068a5[_0xf508('0x2a')](_0xb7d0d1)[_0xf508('0x3a')](_0x50f4d9);};}exports[_0xf508('0x3b')]=function(_0x555c24,_0x439cd2){var _0x3ab1e1={},_0x24ac55={},_0x36aa70={'count':0x0,'rows':[]};var _0x34b242=_['map'](db['Setting'][_0xf508('0x3c')],function(_0x2a8e27){return{'name':_0x2a8e27['fieldName'],'type':_0x2a8e27['type'][_0xf508('0x3d')]};});_0x24ac55['model']=_[_0xf508('0x3e')](_0x34b242,_0xf508('0x39'));_0x24ac55[_0xf508('0x3f')]=_['keys'](_0x555c24[_0xf508('0x3f')]);_0x24ac55['filters']=_[_0xf508('0x40')](_0x24ac55[_0xf508('0x41')],_0x24ac55['query']);_0x3ab1e1['attributes']=_[_0xf508('0x40')](_0x24ac55[_0xf508('0x41')],qs['fields'](_0x555c24['query'][_0xf508('0x42')]));_0x3ab1e1[_0xf508('0x43')]=_0x3ab1e1[_0xf508('0x43')][_0xf508('0x44')]?_0x3ab1e1['attributes']:_0x24ac55[_0xf508('0x41')];if(!_0x555c24[_0xf508('0x3f')][_0xf508('0x45')](_0xf508('0x46'))){_0x3ab1e1[_0xf508('0x2e')]=qs[_0xf508('0x2e')](_0x555c24[_0xf508('0x3f')]['limit']);_0x3ab1e1[_0xf508('0x30')]=qs[_0xf508('0x30')](_0x555c24[_0xf508('0x3f')][_0xf508('0x30')]);}_0x3ab1e1[_0xf508('0x47')]=qs[_0xf508('0x48')](_0x555c24[_0xf508('0x3f')][_0xf508('0x48')]);_0x3ab1e1[_0xf508('0x49')]=qs[_0xf508('0x4a')](_[_0xf508('0x4b')](_0x555c24['query'],_0x24ac55['filters']),_0x34b242);if(_0x555c24['query'][_0xf508('0x4c')]){_0x3ab1e1['where']=_[_0xf508('0x4d')](_0x3ab1e1['where'],{'$or':_[_0xf508('0x3e')](_0x34b242,function(_0x5fa042){if(_0x5fa042[_0xf508('0x4e')]!==_0xf508('0x4f')){var _0x150aa4={};_0x150aa4[_0x5fa042['name']]={'$like':'%'+_0x555c24[_0xf508('0x3f')][_0xf508('0x4c')]+'%'};return _0x150aa4;}})});}_0x3ab1e1=_[_0xf508('0x4d')]({},_0x3ab1e1,_0x555c24[_0xf508('0x50')]);var _0x477ec7={'where':_0x3ab1e1[_0xf508('0x49')]};return db[_0xf508('0x51')][_0xf508('0x2f')](_0x477ec7)[_0xf508('0x1f')](function(_0xe50b3b){_0x36aa70[_0xf508('0x2f')]=_0xe50b3b;if(_0x555c24['query'][_0xf508('0x52')]){_0x3ab1e1['include']=[{'all':!![]}];}return db[_0xf508('0x51')][_0xf508('0x53')](_0x3ab1e1);})[_0xf508('0x1f')](function(_0x5f4005){_0x36aa70['rows']=_0x5f4005;return _0x36aa70;})[_0xf508('0x1f')](respondWithFilteredResult(_0x439cd2,_0x3ab1e1))['catch'](handleError(_0x439cd2,null));};exports['show']=function(_0x56e047,_0x59d28f){var _0xd3e2b8={'raw':![],'where':{'id':_0x56e047[_0xf508('0x54')]['id']}},_0x50138f={};_0x50138f['model']=_[_0xf508('0x55')](db['Setting']['rawAttributes']);_0x50138f[_0xf508('0x3f')]=_[_0xf508('0x55')](_0x56e047[_0xf508('0x3f')]);_0x50138f[_0xf508('0x4a')]=_[_0xf508('0x40')](_0x50138f[_0xf508('0x41')],_0x50138f['query']);_0xd3e2b8[_0xf508('0x43')]=_[_0xf508('0x40')](_0x50138f[_0xf508('0x41')],qs[_0xf508('0x42')](_0x56e047['query'][_0xf508('0x42')]));_0xd3e2b8[_0xf508('0x43')]=_0xd3e2b8[_0xf508('0x43')]['length']?_0xd3e2b8['attributes']:_0x50138f['model'];if(_0x56e047[_0xf508('0x3f')]['includeAll']){_0xd3e2b8[_0xf508('0x56')]=[{'all':!![]}];}_0xd3e2b8=_[_0xf508('0x4d')]({},_0xd3e2b8,_0x56e047[_0xf508('0x50')]);return db[_0xf508('0x51')][_0xf508('0x57')](_0xd3e2b8)['then'](handleEntityNotFound(_0x59d28f,null))[_0xf508('0x1f')](respondWithResult(_0x59d28f,null))['catch'](handleError(_0x59d28f,null));};exports[_0xf508('0x36')]=function(_0x26be85,_0x1696d7){if(_0x26be85['body']['id']){delete _0x26be85[_0xf508('0x58')]['id'];}return db['Setting'][_0xf508('0x57')]({'where':{'id':_0x26be85['params']['id']}})[_0xf508('0x1f')](handleEntityNotFound(_0x1696d7,null))[_0xf508('0x1f')](saveUpdates(_0x26be85['body'],null))[_0xf508('0x1f')](respondWithResult(_0x1696d7,null))['catch'](handleError(_0x1696d7,null));};exports[_0xf508('0x59')]=function(_0x3b5966,_0xb49aca,_0xa5979c){if(_0x3b5966[_0xf508('0x5a')]&&_0x3b5966[_0xf508('0x5a')][_0xf508('0x5b')]){_0x3b5966['body'][_0xf508('0x5c')]=_0x3b5966[_0xf508('0x5a')]['filename'];}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x3b5966['params']['id']}})['then'](handleEntityNotFound(_0xb49aca,null))[_0xf508('0x1f')](saveUpdates(_0x3b5966['body'],null))[_0xf508('0x1f')](respondWithResult(_0xb49aca,null))[_0xf508('0x28')](handleError(_0xb49aca,null));};exports[_0xf508('0x5d')]=function(_0x5afbfe,_0x419ac5,_0x35ff41){if(_0x5afbfe[_0xf508('0x5a')]&&_0x5afbfe[_0xf508('0x5a')][_0xf508('0x5b')]){_0x5afbfe[_0xf508('0x58')][_0xf508('0x5e')]=_0x5afbfe[_0xf508('0x5a')]['filename'];}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x5afbfe['params']['id']}})['then'](handleEntityNotFound(_0x419ac5,null))[_0xf508('0x1f')](saveUpdates(_0x5afbfe['body'],null))[_0xf508('0x1f')](respondWithResult(_0x419ac5,null))['catch'](handleError(_0x419ac5,null));};var utilLicense=require(_0xf508('0x19'));exports['getLogo']=function(_0x36e05a,_0x2326e8,_0x305af8){var _0x10e68a=_0xf508('0x5f');var _0xf114fd={'custom':![]};return utilLicense[_0xf508('0x60')]()[_0xf508('0x1f')](function(_0x378507){if(_0x378507){_0xf114fd=_0x378507;}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x36e05a[_0xf508('0x54')]['id']},'attributes':[_0xf508('0x5c'),_0xf508('0x5e'),_0xf508('0x61'),_0xf508('0x62'),_0xf508('0x63'),_0xf508('0x64'),_0xf508('0x65'),_0xf508('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x2326e8,null))['then'](function(_0x409c32){if(_0x409c32){var _0xae04b3=_0x409c32[_0xf508('0x5c')]&&fs['existsSync'](path[_0xf508('0x67')](config['root'],_0x10e68a,_[_0xf508('0x68')](_0x409c32[_0xf508('0x5c')])))?path[_0xf508('0x67')](config[_0xf508('0x69')],_0x10e68a,_[_0xf508('0x68')](_0x409c32[_0xf508('0x5c')])):path[_0xf508('0x67')](config[_0xf508('0x69')],_0x10e68a,_[_0xf508('0x68')]('default_logo.svg'));var _0x5100ce=_0xf508('0x6a')+_[_0xf508('0x6b')](_0xf508('0x5c'));if(_0x409c32[_0x5100ce]||!_0xf114fd[_0xf508('0x6c')]){_0xae04b3=path['join'](config['root'],_0x10e68a,_[_0xf508('0x68')]('default_logo.svg'));}if(!fs[_0xf508('0x6d')](_0xae04b3)){throw new db['Sequelize'][(_0xf508('0x6e'))](_[_0xf508('0x6b')](_0xf508('0x5c'))+'\x20not\x20found');}return _0x2326e8[_0xf508('0x6f')](_0xae04b3);}})[_0xf508('0x28')](handleError(_0x2326e8,null));};var utilLicense=require(_0xf508('0x19'));exports[_0xf508('0x70')]=function(_0x3d8dee,_0x112151,_0x372534){var _0x1f0422=_0xf508('0x5f');var _0x51a3d3={'custom':![]};return utilLicense[_0xf508('0x60')]()[_0xf508('0x1f')](function(_0x58ee9a){if(_0x58ee9a){_0x51a3d3=_0x58ee9a;}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x3d8dee[_0xf508('0x54')]['id']},'attributes':['logo',_0xf508('0x5e'),'preferred','favicon',_0xf508('0x63'),_0xf508('0x64'),_0xf508('0x65'),'defaultFavicon'],'raw':!![]});})[_0xf508('0x1f')](handleEntityNotFound(_0x112151,null))['then'](function(_0xef66f8){if(_0xef66f8){var _0x4e76e7=_0xef66f8[_0xf508('0x5e')]&&fs['existsSync'](path['join'](config[_0xf508('0x69')],_0x1f0422,_['toLower'](_0xef66f8['loginLogo'])))?path[_0xf508('0x67')](config[_0xf508('0x69')],_0x1f0422,_[_0xf508('0x68')](_0xef66f8[_0xf508('0x5e')])):path['join'](config[_0xf508('0x69')],_0x1f0422,_[_0xf508('0x68')](_0xf508('0x71')));var _0x1477cd='default'+_[_0xf508('0x6b')](_0xf508('0x5e'));if(_0xef66f8[_0x1477cd]||!_0x51a3d3[_0xf508('0x6c')]){_0x4e76e7=path['join'](config[_0xf508('0x69')],_0x1f0422,_[_0xf508('0x68')](_0xf508('0x71')));}if(!fs[_0xf508('0x6d')](_0x4e76e7)){throw new db[(_0xf508('0x72'))][(_0xf508('0x6e'))](_[_0xf508('0x6b')](_0xf508('0x5e'))+_0xf508('0x73'));}return _0x112151[_0xf508('0x6f')](_0x4e76e7);}})[_0xf508('0x28')](handleError(_0x112151,null));};exports[_0xf508('0x74')]=function(_0x325599,_0xe3affc){return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x325599['params']['id']},'attributes':['securePassword']})[_0xf508('0x1f')](respondWithResult(_0xe3affc,null))[_0xf508('0x28')](handleError(_0xe3affc,null));};exports[_0xf508('0x75')]=function(_0x40294e,_0x3062a9,_0x2e7e7d){if(_0x40294e['file']&&_0x40294e[_0xf508('0x5a')][_0xf508('0x5b')]){_0x40294e[_0xf508('0x58')]['preferred']=_0x40294e[_0xf508('0x5a')][_0xf508('0x5b')];}return db[_0xf508('0x51')]['find']({'where':{'id':_0x40294e[_0xf508('0x54')]['id']}})[_0xf508('0x1f')](handleEntityNotFound(_0x3062a9,null))[_0xf508('0x1f')](saveUpdates(_0x40294e[_0xf508('0x58')],null))['then'](respondWithResult(_0x3062a9,null))[_0xf508('0x28')](handleError(_0x3062a9,null));};var utilLicense=require(_0xf508('0x19'));exports[_0xf508('0x76')]=function(_0x2743b2,_0x1d7f91,_0x4bc00b){var _0x45446b=_0xf508('0x5f');var _0x58b625={'custom':![]};return utilLicense[_0xf508('0x60')]()['then'](function(_0x2d9920){if(_0x2d9920){_0x58b625=_0x2d9920;}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x2743b2[_0xf508('0x54')]['id']},'attributes':['logo','loginLogo',_0xf508('0x61'),_0xf508('0x62'),_0xf508('0x63'),_0xf508('0x64'),_0xf508('0x65'),_0xf508('0x66')],'raw':!![]});})['then'](handleEntityNotFound(_0x1d7f91,null))[_0xf508('0x1f')](function(_0x798f31){if(_0x798f31){var _0x4ed018=_0x798f31['preferred']&&fs[_0xf508('0x6d')](path[_0xf508('0x67')](config[_0xf508('0x69')],_0x45446b,_[_0xf508('0x68')](_0x798f31[_0xf508('0x61')])))?path[_0xf508('0x67')](config[_0xf508('0x69')],_0x45446b,_[_0xf508('0x68')](_0x798f31[_0xf508('0x61')])):path[_0xf508('0x67')](config[_0xf508('0x69')],_0x45446b,_[_0xf508('0x68')]('default_preferred.png'));var _0x1fd4b7='default'+_['upperFirst'](_0xf508('0x61'));if(_0x798f31[_0x1fd4b7]||!_0x58b625[_0xf508('0x6c')]||!_0x58b625[_0xf508('0x61')]){_0x4ed018=path['join'](config['root'],_0x45446b,_[_0xf508('0x68')](_0xf508('0x77')));}if(!fs[_0xf508('0x6d')](_0x4ed018)){throw new db['Sequelize']['ValidationError'](_[_0xf508('0x6b')]('preferred')+'\x20not\x20found');}return _0x1d7f91['download'](_0x4ed018);}})[_0xf508('0x28')](handleError(_0x1d7f91,null));};exports[_0xf508('0x78')]=function(_0x5d7730,_0x5c281d,_0x17a45a){if(_0x5d7730['file']&&_0x5d7730[_0xf508('0x5a')]['filename']){_0x5d7730[_0xf508('0x58')][_0xf508('0x62')]=_0x5d7730['file']['filename'];}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x5d7730[_0xf508('0x54')]['id']}})['then'](handleEntityNotFound(_0x5c281d,null))[_0xf508('0x1f')](saveUpdates(_0x5d7730[_0xf508('0x58')],null))[_0xf508('0x1f')](respondWithResult(_0x5c281d,null))[_0xf508('0x28')](handleError(_0x5c281d,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x46833e,_0x4748c6,_0x3afd09){var _0x25d555='server/files/images/logos';var _0x7fd841={'custom':![]};return utilLicense[_0xf508('0x60')]()[_0xf508('0x1f')](function(_0x211e57){if(_0x211e57){_0x7fd841=_0x211e57;}return db[_0xf508('0x51')][_0xf508('0x57')]({'where':{'id':_0x46833e[_0xf508('0x54')]['id']},'attributes':[_0xf508('0x5c'),_0xf508('0x5e'),'preferred','favicon',_0xf508('0x63'),'defaultLoginLogo',_0xf508('0x65'),_0xf508('0x66')],'raw':!![]});})[_0xf508('0x1f')](handleEntityNotFound(_0x4748c6,null))['then'](function(_0x7c9e2f){if(_0x7c9e2f){var _0x253c85=_0x7c9e2f[_0xf508('0x62')]&&fs[_0xf508('0x6d')](path[_0xf508('0x67')](config[_0xf508('0x69')],_0x25d555,_[_0xf508('0x68')](_0x7c9e2f[_0xf508('0x62')])))?path[_0xf508('0x67')](config[_0xf508('0x69')],_0x25d555,_['toLower'](_0x7c9e2f[_0xf508('0x62')])):path[_0xf508('0x67')](config[_0xf508('0x69')],_0x25d555,_[_0xf508('0x68')]('default_favicon.ico'));var _0x3f7cc8=_0xf508('0x6a')+_['upperFirst']('favicon');if(_0x7c9e2f[_0x3f7cc8]||!_0x7fd841[_0xf508('0x6c')]){_0x253c85=path[_0xf508('0x67')](config[_0xf508('0x69')],_0x25d555,_[_0xf508('0x68')](_0xf508('0x79')));}if(!fs['existsSync'](_0x253c85)){throw new db['Sequelize'][(_0xf508('0x6e'))](_['upperFirst'](_0xf508('0x62'))+'\x20not\x20found');}return _0x4748c6[_0xf508('0x6f')](_0x253c85);}})[_0xf508('0x28')](handleError(_0x4748c6,null));};exports[_0xf508('0x7a')]=function(_0x2d9b83,_0xd94b1f){var _0x44f010={'offset':moment()[_0xf508('0x7b')]()};_0x44f010['now']=moment()[_0xf508('0x7b')](_0x44f010[_0xf508('0x30')])[_0xf508('0x7c')](_0xf508('0x7d'));return _0xd94b1f['status'](0xc8)[_0xf508('0x3a')](_0x44f010);}; \ No newline at end of file +var _0xe0d6=['end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','stack','name','map','Setting','rawAttributes','fieldName','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','type','options','includeAll','include','findAll','params','merge','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','custom','existsSync','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLicense','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','sendStatus','status'];(function(_0x174282,_0x11a47f){var _0x42bb26=function(_0x4963b6){while(--_0x4963b6){_0x174282['push'](_0x174282['shift']());}};_0x42bb26(++_0x11a47f);}(_0xe0d6,0x13f));var _0x6e0d=function(_0x3e61fe,_0x425255){_0x3e61fe=_0x3e61fe-0x0;var _0x561b43=_0xe0d6[_0x3e61fe];return _0x561b43;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e0d('0x0'));var zipdir=require(_0x6e0d('0x1'));var jsonpatch=require(_0x6e0d('0x2'));var rp=require(_0x6e0d('0x3'));var moment=require(_0x6e0d('0x4'));var BPromise=require(_0x6e0d('0x5'));var Mustache=require(_0x6e0d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6e0d('0x7'));var csv=require(_0x6e0d('0x8'));var ejs=require(_0x6e0d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e0d('0xa'));var crypto=require(_0x6e0d('0xb'));var jsforce=require(_0x6e0d('0xc'));var deskjs=require(_0x6e0d('0xd'));var toCsv=require(_0x6e0d('0x8'));var querystring=require(_0x6e0d('0xe'));var Papa=require(_0x6e0d('0xf'));var Redis=require(_0x6e0d('0x10'));var authService=require(_0x6e0d('0x11'));var qs=require(_0x6e0d('0x12'));var as=require(_0x6e0d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e0d('0x14'))(_0x6e0d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6e0d('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6e0d('0x17'));var client=jayson[_0x6e0d('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ce1d8,_0x12f528,_0x121d40,_0x4f1c7c){return new BPromise(function(_0x1f9432,_0x28da41){var _0x45f453=_0x4f1c7c||client;return _0x45f453[_0x6e0d('0x19')](_0x5ce1d8,_0x121d40)[_0x6e0d('0x1a')](function(_0x51630b){logger[_0x6e0d('0x1b')](_0x6e0d('0x1c'),_0x12f528,_0x6e0d('0x1d'));logger[_0x6e0d('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x12f528,_0x6e0d('0x1d'),JSON[_0x6e0d('0x1f')](_0x51630b));if(_0x51630b['error']){if(_0x51630b['error'][_0x6e0d('0x20')]===0x1f4){logger[_0x6e0d('0x21')](_0x6e0d('0x1c'),_0x12f528,_0x51630b[_0x6e0d('0x21')][_0x6e0d('0x22')]);return _0x28da41(_0x51630b[_0x6e0d('0x21')][_0x6e0d('0x22')]);}logger[_0x6e0d('0x21')](_0x6e0d('0x1c'),_0x12f528,_0x51630b[_0x6e0d('0x21')]['message']);return _0x1f9432(_0x51630b['error'][_0x6e0d('0x22')]);}else{logger[_0x6e0d('0x1b')](_0x6e0d('0x1c'),_0x12f528,_0x6e0d('0x1d'));_0x1f9432(_0x51630b['result']['message']);}})[_0x6e0d('0x23')](function(_0xd65edd){logger['error'](_0x6e0d('0x1c'),_0x12f528,_0xd65edd);_0x28da41(_0xd65edd);});});}function respondWithStatusCode(_0x5f0806,_0x592c27){_0x592c27=_0x592c27||0xcc;return function(_0x326f3b){if(_0x326f3b){return _0x5f0806[_0x6e0d('0x24')](_0x592c27);}return _0x5f0806[_0x6e0d('0x25')](_0x592c27)[_0x6e0d('0x26')]();};}function respondWithResult(_0x35325a,_0x13539d){_0x13539d=_0x13539d||0xc8;return function(_0x2c8f79){if(_0x2c8f79){return _0x35325a['status'](_0x13539d)['json'](_0x2c8f79);}};}function respondWithFilteredResult(_0x4442a1,_0x19f63a){return function(_0x40a3ce){if(_0x40a3ce){var _0x57b677=typeof _0x19f63a[_0x6e0d('0x27')]==='undefined'&&typeof _0x19f63a[_0x6e0d('0x28')]===_0x6e0d('0x29');var _0x5cefa9=_0x40a3ce['count'];var _0x1edd1d=_0x57b677?0x0:_0x19f63a[_0x6e0d('0x27')];var _0x316f9c=_0x57b677?_0x40a3ce[_0x6e0d('0x2a')]:_0x19f63a[_0x6e0d('0x27')]+_0x19f63a[_0x6e0d('0x28')];var _0x140f02;if(_0x316f9c>=_0x5cefa9){_0x316f9c=_0x5cefa9;_0x140f02=0xc8;}else{_0x140f02=0xce;}_0x4442a1[_0x6e0d('0x25')](_0x140f02);return _0x4442a1[_0x6e0d('0x2b')](_0x6e0d('0x2c'),_0x1edd1d+'-'+_0x316f9c+'/'+_0x5cefa9)[_0x6e0d('0x2d')](_0x40a3ce);}return null;};}function patchUpdates(_0x2c35a8){return function(_0x4a664f){try{jsonpatch[_0x6e0d('0x2e')](_0x4a664f,_0x2c35a8,!![]);}catch(_0x2a3f8d){return BPromise[_0x6e0d('0x2f')](_0x2a3f8d);}return _0x4a664f['save']();};}function saveUpdates(_0x4402df,_0x35e908){return function(_0x106ed6){if(_0x106ed6){return _0x106ed6[_0x6e0d('0x30')](_0x4402df)[_0x6e0d('0x1a')](function(_0x3768a3){return _0x3768a3;});}return null;};}function removeEntity(_0xd4505f,_0x1f4d83){return function(_0x52822c){if(_0x52822c){return _0x52822c[_0x6e0d('0x31')]()[_0x6e0d('0x1a')](function(){_0xd4505f[_0x6e0d('0x25')](0xcc)[_0x6e0d('0x26')]();});}};}function handleEntityNotFound(_0x30533a,_0x25f4e1){return function(_0x131cc6){if(!_0x131cc6){_0x30533a['sendStatus'](0x194);}return _0x131cc6;};}function handleError(_0x374a1f,_0x2dae84){_0x2dae84=_0x2dae84||0x1f4;return function(_0x4bd2b2){logger[_0x6e0d('0x21')](_0x4bd2b2[_0x6e0d('0x32')]);if(_0x4bd2b2[_0x6e0d('0x33')]){delete _0x4bd2b2[_0x6e0d('0x33')];}_0x374a1f[_0x6e0d('0x25')](_0x2dae84)['send'](_0x4bd2b2);};}exports['index']=function(_0x227251,_0x745864){var _0x34cf50={},_0x97397e={},_0xf0a296={'count':0x0,'rows':[]};var _0x111ac5=_[_0x6e0d('0x34')](db[_0x6e0d('0x35')][_0x6e0d('0x36')],function(_0x4e7eb3){return{'name':_0x4e7eb3[_0x6e0d('0x37')],'type':_0x4e7eb3['type'][_0x6e0d('0x38')]};});_0x97397e['model']=_[_0x6e0d('0x34')](_0x111ac5,'name');_0x97397e[_0x6e0d('0x39')]=_['keys'](_0x227251['query']);_0x97397e['filters']=_['intersection'](_0x97397e[_0x6e0d('0x3a')],_0x97397e[_0x6e0d('0x39')]);_0x34cf50[_0x6e0d('0x3b')]=_[_0x6e0d('0x3c')](_0x97397e[_0x6e0d('0x3a')],qs[_0x6e0d('0x3d')](_0x227251['query']['fields']));_0x34cf50[_0x6e0d('0x3b')]=_0x34cf50[_0x6e0d('0x3b')][_0x6e0d('0x3e')]?_0x34cf50['attributes']:_0x97397e[_0x6e0d('0x3a')];if(!_0x227251[_0x6e0d('0x39')][_0x6e0d('0x3f')](_0x6e0d('0x40'))){_0x34cf50[_0x6e0d('0x28')]=qs[_0x6e0d('0x28')](_0x227251[_0x6e0d('0x39')]['limit']);_0x34cf50[_0x6e0d('0x27')]=qs['offset'](_0x227251[_0x6e0d('0x39')][_0x6e0d('0x27')]);}_0x34cf50[_0x6e0d('0x41')]=qs['sort'](_0x227251[_0x6e0d('0x39')]['sort']);_0x34cf50[_0x6e0d('0x42')]=qs[_0x6e0d('0x43')](_[_0x6e0d('0x44')](_0x227251[_0x6e0d('0x39')],_0x97397e[_0x6e0d('0x43')]),_0x111ac5);if(_0x227251['query'][_0x6e0d('0x45')]){_0x34cf50[_0x6e0d('0x42')]=_['merge'](_0x34cf50[_0x6e0d('0x42')],{'$or':_['map'](_0x111ac5,function(_0x4704d7){if(_0x4704d7[_0x6e0d('0x46')]!=='VIRTUAL'){var _0x6da380={};_0x6da380[_0x4704d7[_0x6e0d('0x33')]]={'$like':'%'+_0x227251[_0x6e0d('0x39')][_0x6e0d('0x45')]+'%'};return _0x6da380;}})});}_0x34cf50=_['merge']({},_0x34cf50,_0x227251[_0x6e0d('0x47')]);var _0x3379c5={'where':_0x34cf50[_0x6e0d('0x42')]};return db[_0x6e0d('0x35')][_0x6e0d('0x2a')](_0x3379c5)[_0x6e0d('0x1a')](function(_0x1399b2){_0xf0a296[_0x6e0d('0x2a')]=_0x1399b2;if(_0x227251[_0x6e0d('0x39')][_0x6e0d('0x48')]){_0x34cf50[_0x6e0d('0x49')]=[{'all':!![]}];}return db[_0x6e0d('0x35')][_0x6e0d('0x4a')](_0x34cf50);})['then'](function(_0x22a4e3){_0xf0a296['rows']=_0x22a4e3;return _0xf0a296;})[_0x6e0d('0x1a')](respondWithFilteredResult(_0x745864,_0x34cf50))[_0x6e0d('0x23')](handleError(_0x745864,null));};exports['show']=function(_0x4c38b0,_0x427e96){var _0x2c1f96={'raw':![],'where':{'id':_0x4c38b0[_0x6e0d('0x4b')]['id']}},_0x2cc787={};_0x2cc787[_0x6e0d('0x3a')]=_['keys'](db[_0x6e0d('0x35')]['rawAttributes']);_0x2cc787[_0x6e0d('0x39')]=_['keys'](_0x4c38b0[_0x6e0d('0x39')]);_0x2cc787[_0x6e0d('0x43')]=_[_0x6e0d('0x3c')](_0x2cc787['model'],_0x2cc787[_0x6e0d('0x39')]);_0x2c1f96[_0x6e0d('0x3b')]=_['intersection'](_0x2cc787[_0x6e0d('0x3a')],qs[_0x6e0d('0x3d')](_0x4c38b0['query'][_0x6e0d('0x3d')]));_0x2c1f96[_0x6e0d('0x3b')]=_0x2c1f96[_0x6e0d('0x3b')][_0x6e0d('0x3e')]?_0x2c1f96[_0x6e0d('0x3b')]:_0x2cc787[_0x6e0d('0x3a')];if(_0x4c38b0[_0x6e0d('0x39')][_0x6e0d('0x48')]){_0x2c1f96['include']=[{'all':!![]}];}_0x2c1f96=_[_0x6e0d('0x4c')]({},_0x2c1f96,_0x4c38b0[_0x6e0d('0x47')]);return db['Setting'][_0x6e0d('0x4d')](_0x2c1f96)[_0x6e0d('0x1a')](handleEntityNotFound(_0x427e96,null))[_0x6e0d('0x1a')](respondWithResult(_0x427e96,null))['catch'](handleError(_0x427e96,null));};exports[_0x6e0d('0x30')]=function(_0x69f4ca,_0x2bddd2){if(_0x69f4ca[_0x6e0d('0x4e')]['id']){delete _0x69f4ca[_0x6e0d('0x4e')]['id'];}return db[_0x6e0d('0x35')][_0x6e0d('0x4d')]({'where':{'id':_0x69f4ca[_0x6e0d('0x4b')]['id']}})[_0x6e0d('0x1a')](handleEntityNotFound(_0x2bddd2,null))[_0x6e0d('0x1a')](saveUpdates(_0x69f4ca['body'],null))[_0x6e0d('0x1a')](respondWithResult(_0x2bddd2,null))[_0x6e0d('0x23')](handleError(_0x2bddd2,null));};exports[_0x6e0d('0x4f')]=function(_0x22f994,_0x41511a,_0x4387f9){if(_0x22f994[_0x6e0d('0x50')]&&_0x22f994['file'][_0x6e0d('0x51')]){_0x22f994[_0x6e0d('0x4e')]['logo']=_0x22f994[_0x6e0d('0x50')]['filename'];}return db[_0x6e0d('0x35')]['find']({'where':{'id':_0x22f994[_0x6e0d('0x4b')]['id']}})[_0x6e0d('0x1a')](handleEntityNotFound(_0x41511a,null))[_0x6e0d('0x1a')](saveUpdates(_0x22f994[_0x6e0d('0x4e')],null))['then'](respondWithResult(_0x41511a,null))[_0x6e0d('0x23')](handleError(_0x41511a,null));};exports[_0x6e0d('0x52')]=function(_0x4c12be,_0x1b5a7d,_0xef16c5){if(_0x4c12be[_0x6e0d('0x50')]&&_0x4c12be[_0x6e0d('0x50')][_0x6e0d('0x51')]){_0x4c12be[_0x6e0d('0x4e')][_0x6e0d('0x53')]=_0x4c12be[_0x6e0d('0x50')]['filename'];}return db[_0x6e0d('0x35')][_0x6e0d('0x4d')]({'where':{'id':_0x4c12be['params']['id']}})[_0x6e0d('0x1a')](handleEntityNotFound(_0x1b5a7d,null))['then'](saveUpdates(_0x4c12be[_0x6e0d('0x4e')],null))[_0x6e0d('0x1a')](respondWithResult(_0x1b5a7d,null))[_0x6e0d('0x23')](handleError(_0x1b5a7d,null));};var utilLicense=require(_0x6e0d('0x16'));exports[_0x6e0d('0x54')]=function(_0x2fd0b2,_0x3047df,_0x331759){var _0x40f119=_0x6e0d('0x55');var _0x1cb3d9={'custom':![]};return utilLicense['getLicense']()[_0x6e0d('0x1a')](function(_0x19b6cb){if(_0x19b6cb){_0x1cb3d9=_0x19b6cb;}return db[_0x6e0d('0x35')][_0x6e0d('0x4d')]({'where':{'id':_0x2fd0b2[_0x6e0d('0x4b')]['id']},'attributes':[_0x6e0d('0x56'),'loginLogo',_0x6e0d('0x57'),_0x6e0d('0x58'),_0x6e0d('0x59'),_0x6e0d('0x5a'),_0x6e0d('0x5b'),_0x6e0d('0x5c')],'raw':!![]});})[_0x6e0d('0x1a')](handleEntityNotFound(_0x3047df,null))['then'](function(_0x583fd1){if(_0x583fd1){var _0x56dbdf=_0x583fd1[_0x6e0d('0x56')]&&fs['existsSync'](path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x40f119,_[_0x6e0d('0x5f')](_0x583fd1[_0x6e0d('0x56')])))?path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x40f119,_[_0x6e0d('0x5f')](_0x583fd1[_0x6e0d('0x56')])):path[_0x6e0d('0x5d')](config['root'],_0x40f119,_[_0x6e0d('0x5f')](_0x6e0d('0x60')));var _0x29e869=_0x6e0d('0x61')+_['upperFirst']('logo');if(_0x583fd1[_0x29e869]||!_0x1cb3d9[_0x6e0d('0x62')]){_0x56dbdf=path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x40f119,_['toLower'](_0x6e0d('0x60')));}if(!fs[_0x6e0d('0x63')](_0x56dbdf)){throw new db[(_0x6e0d('0x64'))][(_0x6e0d('0x65'))](_[_0x6e0d('0x66')]('logo')+_0x6e0d('0x67'));}return _0x3047df[_0x6e0d('0x68')](_0x56dbdf);}})[_0x6e0d('0x23')](handleError(_0x3047df,null));};var utilLicense=require(_0x6e0d('0x16'));exports['getLogoLogin']=function(_0x55658e,_0x21cc0e,_0x224dc0){var _0x3cca97=_0x6e0d('0x55');var _0x243cb8={'custom':![]};return utilLicense[_0x6e0d('0x69')]()[_0x6e0d('0x1a')](function(_0x3b703c){if(_0x3b703c){_0x243cb8=_0x3b703c;}return db['Setting'][_0x6e0d('0x4d')]({'where':{'id':_0x55658e[_0x6e0d('0x4b')]['id']},'attributes':[_0x6e0d('0x56'),_0x6e0d('0x53'),'preferred',_0x6e0d('0x58'),_0x6e0d('0x59'),_0x6e0d('0x5a'),_0x6e0d('0x5b'),_0x6e0d('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x21cc0e,null))[_0x6e0d('0x1a')](function(_0x3a22cb){if(_0x3a22cb){var _0x44a890=_0x3a22cb[_0x6e0d('0x53')]&&fs[_0x6e0d('0x63')](path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x3cca97,_[_0x6e0d('0x5f')](_0x3a22cb[_0x6e0d('0x53')])))?path['join'](config[_0x6e0d('0x5e')],_0x3cca97,_[_0x6e0d('0x5f')](_0x3a22cb['loginLogo'])):path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x3cca97,_[_0x6e0d('0x5f')]('default_loginLogo.svg'));var _0xa09d2c=_0x6e0d('0x61')+_['upperFirst']('loginLogo');if(_0x3a22cb[_0xa09d2c]||!_0x243cb8[_0x6e0d('0x62')]){_0x44a890=path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x3cca97,_[_0x6e0d('0x5f')](_0x6e0d('0x6a')));}if(!fs[_0x6e0d('0x63')](_0x44a890)){throw new db[(_0x6e0d('0x64'))]['ValidationError'](_[_0x6e0d('0x66')](_0x6e0d('0x53'))+'\x20not\x20found');}return _0x21cc0e[_0x6e0d('0x68')](_0x44a890);}})[_0x6e0d('0x23')](handleError(_0x21cc0e,null));};exports[_0x6e0d('0x6b')]=function(_0x3399aa,_0x31e10b){return db['Setting'][_0x6e0d('0x4d')]({'where':{'id':_0x3399aa[_0x6e0d('0x4b')]['id']},'attributes':[_0x6e0d('0x6c')]})['then'](respondWithResult(_0x31e10b,null))[_0x6e0d('0x23')](handleError(_0x31e10b,null));};exports[_0x6e0d('0x6d')]=function(_0x402b28,_0x1c9bc9,_0x3a5a45){if(_0x402b28[_0x6e0d('0x50')]&&_0x402b28[_0x6e0d('0x50')][_0x6e0d('0x51')]){_0x402b28[_0x6e0d('0x4e')]['preferred']=_0x402b28['file']['filename'];}return db['Setting'][_0x6e0d('0x4d')]({'where':{'id':_0x402b28['params']['id']}})[_0x6e0d('0x1a')](handleEntityNotFound(_0x1c9bc9,null))['then'](saveUpdates(_0x402b28[_0x6e0d('0x4e')],null))['then'](respondWithResult(_0x1c9bc9,null))[_0x6e0d('0x23')](handleError(_0x1c9bc9,null));};var utilLicense=require('../../config/license/util');exports[_0x6e0d('0x6e')]=function(_0x518a0f,_0x506a3f,_0x3fd510){var _0x288b6f=_0x6e0d('0x55');var _0x2341a7={'custom':![]};return utilLicense[_0x6e0d('0x69')]()[_0x6e0d('0x1a')](function(_0x5137df){if(_0x5137df){_0x2341a7=_0x5137df;}return db[_0x6e0d('0x35')][_0x6e0d('0x4d')]({'where':{'id':_0x518a0f['params']['id']},'attributes':[_0x6e0d('0x56'),_0x6e0d('0x53'),_0x6e0d('0x57'),_0x6e0d('0x58'),_0x6e0d('0x59'),_0x6e0d('0x5a'),_0x6e0d('0x5b'),_0x6e0d('0x5c')],'raw':!![]});})[_0x6e0d('0x1a')](handleEntityNotFound(_0x506a3f,null))['then'](function(_0x38acd6){if(_0x38acd6){var _0x52a05f=_0x38acd6['preferred']&&fs[_0x6e0d('0x63')](path['join'](config['root'],_0x288b6f,_[_0x6e0d('0x5f')](_0x38acd6['preferred'])))?path['join'](config[_0x6e0d('0x5e')],_0x288b6f,_[_0x6e0d('0x5f')](_0x38acd6[_0x6e0d('0x57')])):path['join'](config[_0x6e0d('0x5e')],_0x288b6f,_[_0x6e0d('0x5f')](_0x6e0d('0x6f')));var _0x398342=_0x6e0d('0x61')+_[_0x6e0d('0x66')]('preferred');if(_0x38acd6[_0x398342]||!_0x2341a7[_0x6e0d('0x62')]||!_0x2341a7[_0x6e0d('0x57')]){_0x52a05f=path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x288b6f,_[_0x6e0d('0x5f')](_0x6e0d('0x6f')));}if(!fs[_0x6e0d('0x63')](_0x52a05f)){throw new db['Sequelize'][(_0x6e0d('0x65'))](_['upperFirst'](_0x6e0d('0x57'))+_0x6e0d('0x67'));}return _0x506a3f[_0x6e0d('0x68')](_0x52a05f);}})[_0x6e0d('0x23')](handleError(_0x506a3f,null));};exports[_0x6e0d('0x70')]=function(_0x5944fc,_0x4303e0,_0x434d5d){if(_0x5944fc[_0x6e0d('0x50')]&&_0x5944fc[_0x6e0d('0x50')][_0x6e0d('0x51')]){_0x5944fc[_0x6e0d('0x4e')][_0x6e0d('0x58')]=_0x5944fc[_0x6e0d('0x50')]['filename'];}return db['Setting'][_0x6e0d('0x4d')]({'where':{'id':_0x5944fc[_0x6e0d('0x4b')]['id']}})[_0x6e0d('0x1a')](handleEntityNotFound(_0x4303e0,null))[_0x6e0d('0x1a')](saveUpdates(_0x5944fc[_0x6e0d('0x4e')],null))[_0x6e0d('0x1a')](respondWithResult(_0x4303e0,null))[_0x6e0d('0x23')](handleError(_0x4303e0,null));};var utilLicense=require('../../config/license/util');exports[_0x6e0d('0x71')]=function(_0x24b781,_0x643578,_0x55c15e){var _0x465745='server/files/images/logos';var _0x358727={'custom':![]};return utilLicense[_0x6e0d('0x69')]()[_0x6e0d('0x1a')](function(_0x3d544b){if(_0x3d544b){_0x358727=_0x3d544b;}return db[_0x6e0d('0x35')][_0x6e0d('0x4d')]({'where':{'id':_0x24b781[_0x6e0d('0x4b')]['id']},'attributes':['logo',_0x6e0d('0x53'),_0x6e0d('0x57'),_0x6e0d('0x58'),_0x6e0d('0x59'),_0x6e0d('0x5a'),_0x6e0d('0x5b'),_0x6e0d('0x5c')],'raw':!![]});})[_0x6e0d('0x1a')](handleEntityNotFound(_0x643578,null))[_0x6e0d('0x1a')](function(_0x4f4d15){if(_0x4f4d15){var _0x140d9e=_0x4f4d15[_0x6e0d('0x58')]&&fs[_0x6e0d('0x63')](path['join'](config[_0x6e0d('0x5e')],_0x465745,_['toLower'](_0x4f4d15[_0x6e0d('0x58')])))?path[_0x6e0d('0x5d')](config['root'],_0x465745,_[_0x6e0d('0x5f')](_0x4f4d15['favicon'])):path[_0x6e0d('0x5d')](config[_0x6e0d('0x5e')],_0x465745,_[_0x6e0d('0x5f')](_0x6e0d('0x72')));var _0x1cd14b=_0x6e0d('0x61')+_['upperFirst'](_0x6e0d('0x58'));if(_0x4f4d15[_0x1cd14b]||!_0x358727[_0x6e0d('0x62')]){_0x140d9e=path['join'](config[_0x6e0d('0x5e')],_0x465745,_[_0x6e0d('0x5f')](_0x6e0d('0x72')));}if(!fs['existsSync'](_0x140d9e)){throw new db[(_0x6e0d('0x64'))][(_0x6e0d('0x65'))](_[_0x6e0d('0x66')]('favicon')+_0x6e0d('0x67'));}return _0x643578[_0x6e0d('0x68')](_0x140d9e);}})['catch'](handleError(_0x643578,null));};exports[_0x6e0d('0x73')]=function(_0x263798,_0xa31a7d){var _0x1fc59e={'offset':moment()[_0x6e0d('0x74')]()};_0x1fc59e[_0x6e0d('0x75')]=moment()[_0x6e0d('0x74')](_0x1fc59e[_0x6e0d('0x27')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0xa31a7d[_0x6e0d('0x25')](0xc8)[_0x6e0d('0x76')](_0x1fc59e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 952cba9..c93c730 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x43cb80,_0x1819cc){var _0x5190d4=function(_0x53e183){while(--_0x53e183){_0x43cb80['push'](_0x43cb80['shift']());}};_0x5190d4(++_0x1819cc);}(_0x34e8,0x12c));var _0x834e=function(_0x5ce9ef,_0x28a015){_0x5ce9ef=_0x5ce9ef-0x0;var _0x51022e=_0x34e8[_0x5ce9ef];return _0x51022e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'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 1d29080..0a0c65c 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 _0x2e78=['../../config/logger','rpc','jayson/promise','client','http','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','Setting','options','raw','where','map','include','model','attributes','ShowSetting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2e78,0x1c7));var _0x82e7=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2e78[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x82e7('0x0'));var util=require(_0x82e7('0x1'));var moment=require(_0x82e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x82e7('0x3'));var fs=require('fs');var Redis=require(_0x82e7('0x4'));var db=require(_0x82e7('0x5'))['db'];var utils=require(_0x82e7('0x6'));var logger=require(_0x82e7('0x7'))(_0x82e7('0x8'));var config=require('../../config/environment');var jayson=require(_0x82e7('0x9'));var client=jayson[_0x82e7('0xa')][_0x82e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4789cd,_0x24eaee,_0x7115d1){return new BPromise(function(_0x4ccc89,_0x5a2654){return client['request'](_0x4789cd,_0x7115d1)[_0x82e7('0xc')](function(_0x4a110e){logger[_0x82e7('0xd')]('Setting,\x20%s,\x20%s',_0x24eaee,'request\x20sent');logger[_0x82e7('0xe')](_0x82e7('0xf'),_0x24eaee,_0x82e7('0x10'),JSON[_0x82e7('0x11')](_0x4a110e));if(_0x4a110e[_0x82e7('0x12')]){if(_0x4a110e['error'][_0x82e7('0x13')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x24eaee,_0x4a110e[_0x82e7('0x12')]['message']);return _0x5a2654(_0x4a110e[_0x82e7('0x12')][_0x82e7('0x14')]);}logger['error'](_0x82e7('0x15'),_0x24eaee,_0x4a110e['error'][_0x82e7('0x14')]);return _0x4ccc89(_0x4a110e[_0x82e7('0x12')][_0x82e7('0x14')]);}else{logger[_0x82e7('0xd')](_0x82e7('0x15'),_0x24eaee,'request\x20sent');_0x4ccc89(_0x4a110e[_0x82e7('0x16')][_0x82e7('0x14')]);}})[_0x82e7('0x17')](function(_0x180407){logger[_0x82e7('0x12')](_0x82e7('0x15'),_0x24eaee,_0x180407);_0x5a2654(_0x180407);});});}exports['ShowSetting']=function(_0x537d6d){var _0x536245=this;return new Promise(function(_0x4f7271,_0x157f53){return db[_0x82e7('0x18')]['find']({'raw':_0x537d6d[_0x82e7('0x19')]?_0x537d6d[_0x82e7('0x19')][_0x82e7('0x1a')]===undefined?!![]:![]:!![],'where':_0x537d6d[_0x82e7('0x19')]?_0x537d6d[_0x82e7('0x19')][_0x82e7('0x1b')]||null:null,'attributes':_0x537d6d['options']?_0x537d6d[_0x82e7('0x19')]['attributes']||null:null,'include':_0x537d6d[_0x82e7('0x19')]?_0x537d6d[_0x82e7('0x19')]['include']?_[_0x82e7('0x1c')](_0x537d6d[_0x82e7('0x19')][_0x82e7('0x1d')],function(_0x4e8359){return{'model':db[_0x4e8359[_0x82e7('0x1e')]],'as':_0x4e8359['as'],'attributes':_0x4e8359[_0x82e7('0x1f')],'include':_0x4e8359['include']?_[_0x82e7('0x1c')](_0x4e8359[_0x82e7('0x1d')],function(_0x223f87){return{'model':db[_0x223f87['model']],'as':_0x223f87['as'],'attributes':_0x223f87[_0x82e7('0x1f')],'include':_0x223f87[_0x82e7('0x1d')]?_[_0x82e7('0x1c')](_0x223f87[_0x82e7('0x1d')],function(_0x1d1d96){return{'model':db[_0x1d1d96[_0x82e7('0x1e')]],'as':_0x1d1d96['as'],'attributes':_0x1d1d96[_0x82e7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x82e7('0xc')](function(_0x3c627){logger['info']('ShowSetting',_0x537d6d);logger[_0x82e7('0xe')](_0x82e7('0x20'),_0x537d6d,JSON[_0x82e7('0x11')](_0x3c627));_0x4f7271(_0x3c627);})['catch'](function(_0x152c9e){logger['error'](_0x82e7('0x20'),_0x152c9e[_0x82e7('0x14')],_0x537d6d);_0x157f53(_0x536245[_0x82e7('0x12')](0x1f4,_0x152c9e[_0x82e7('0x14')]));});});}; \ No newline at end of file +var _0x74d7=['ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','lodash','randomstring'];(function(_0x5edd05,_0x8ac1d3){var _0x19b62e=function(_0x2a25d5){while(--_0x2a25d5){_0x5edd05['push'](_0x5edd05['shift']());}};_0x19b62e(++_0x8ac1d3);}(_0x74d7,0x72));var _0x774d=function(_0x96f74c,_0xfc30a4){_0x96f74c=_0x96f74c-0x0;var _0x379222=_0x74d7[_0x96f74c];return _0x379222;};'use strict';var _=require(_0x774d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x774d('0x1'));var fs=require('fs');var Redis=require(_0x774d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x774d('0x3'));var logger=require('../../config/logger')(_0x774d('0x4'));var config=require(_0x774d('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x774d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3fe0e4,_0xe01255,_0x4f01ab){return new BPromise(function(_0x5b60b4,_0x47467b){return client[_0x774d('0x7')](_0x3fe0e4,_0x4f01ab)[_0x774d('0x8')](function(_0x3fa91f){logger[_0x774d('0x9')](_0x774d('0xa'),_0xe01255,'request\x20sent');logger[_0x774d('0xb')](_0x774d('0xc'),_0xe01255,'request\x20sent',JSON['stringify'](_0x3fa91f));if(_0x3fa91f[_0x774d('0xd')]){if(_0x3fa91f['error'][_0x774d('0xe')]===0x1f4){logger[_0x774d('0xd')]('Setting,\x20%s,\x20%s',_0xe01255,_0x3fa91f[_0x774d('0xd')][_0x774d('0xf')]);return _0x47467b(_0x3fa91f[_0x774d('0xd')][_0x774d('0xf')]);}logger[_0x774d('0xd')]('Setting,\x20%s,\x20%s',_0xe01255,_0x3fa91f[_0x774d('0xd')][_0x774d('0xf')]);return _0x5b60b4(_0x3fa91f[_0x774d('0xd')][_0x774d('0xf')]);}else{logger['info'](_0x774d('0xa'),_0xe01255,_0x774d('0x10'));_0x5b60b4(_0x3fa91f[_0x774d('0x11')][_0x774d('0xf')]);}})[_0x774d('0x12')](function(_0x539046){logger[_0x774d('0xd')](_0x774d('0xa'),_0xe01255,_0x539046);_0x47467b(_0x539046);});});}exports[_0x774d('0x13')]=function(_0x479e4d){var _0x54721=this;return new Promise(function(_0x837c7d,_0x2ea8d2){return db[_0x774d('0x14')][_0x774d('0x15')]({'raw':_0x479e4d[_0x774d('0x16')]?_0x479e4d[_0x774d('0x16')][_0x774d('0x17')]===undefined?!![]:![]:!![],'where':_0x479e4d[_0x774d('0x16')]?_0x479e4d[_0x774d('0x16')][_0x774d('0x18')]||null:null,'attributes':_0x479e4d[_0x774d('0x16')]?_0x479e4d[_0x774d('0x16')][_0x774d('0x19')]||null:null,'include':_0x479e4d[_0x774d('0x16')]?_0x479e4d[_0x774d('0x16')][_0x774d('0x1a')]?_[_0x774d('0x1b')](_0x479e4d[_0x774d('0x16')][_0x774d('0x1a')],function(_0x22bb39){return{'model':db[_0x22bb39[_0x774d('0x1c')]],'as':_0x22bb39['as'],'attributes':_0x22bb39[_0x774d('0x19')],'include':_0x22bb39[_0x774d('0x1a')]?_[_0x774d('0x1b')](_0x22bb39[_0x774d('0x1a')],function(_0x43338d){return{'model':db[_0x43338d[_0x774d('0x1c')]],'as':_0x43338d['as'],'attributes':_0x43338d[_0x774d('0x19')],'include':_0x43338d['include']?_[_0x774d('0x1b')](_0x43338d[_0x774d('0x1a')],function(_0x12df15){return{'model':db[_0x12df15[_0x774d('0x1c')]],'as':_0x12df15['as'],'attributes':_0x12df15[_0x774d('0x19')]};}):[]};}):[]};}):[]:[]})[_0x774d('0x8')](function(_0x3ddc65){logger[_0x774d('0x9')](_0x774d('0x13'),_0x479e4d);logger['debug']('ShowSetting',_0x479e4d,JSON['stringify'](_0x3ddc65));_0x837c7d(_0x3ddc65);})['catch'](function(_0x17aa6a){logger[_0x774d('0xd')](_0x774d('0x13'),_0x17aa6a[_0x774d('0xf')],_0x479e4d);_0x2ea8d2(_0x54721[_0x774d('0xd')](0x1f4,_0x17aa6a[_0x774d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b71130b..7a0859c 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 _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x598a6f,_0x263c42){var _0x47c368=function(_0x432628){while(--_0x432628){_0x598a6f['push'](_0x598a6f['shift']());}};_0x47c368(++_0x263c42);}(_0x326f,0xd1));var _0xf326=function(_0x360f34,_0x17ead9){_0x360f34=_0x360f34-0x0;var _0x3cf6ff=_0x326f[_0x360f34];return _0x3cf6ff;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x2b8ec2,_0x46cf3f){var _0x56ff64=function(_0x5ce2b7){while(--_0x5ce2b7){_0x2b8ec2['push'](_0x2b8ec2['shift']());}};_0x56ff64(++_0x46cf3f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index ae0f918..e3021c1 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 _0x8200=['ENUM','twilio','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate'];(function(_0x250032,_0x1e5be1){var _0x80f0e9=function(_0x254ffe){while(--_0x254ffe){_0x250032['push'](_0x250032['shift']());}};_0x80f0e9(++_0x1e5be1);}(_0x8200,0xa9));var _0x0820=function(_0x3a8290,_0xc98e9f){_0x3a8290=_0x3a8290-0x0;var _0x514651=_0x8200[_0x3a8290];return _0x514651;};'use strict';var Sequelize=require(_0x0820('0x0'));var rs=require(_0x0820('0x1'));module[_0x0820('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x0820('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x0820('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x0820('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x0820('0x4')],'defaultValue':function(){return rs[_0x0820('0x5')]();}},'phone':{'type':Sequelize[_0x0820('0x4')]},'type':{'type':Sequelize[_0x0820('0x6')](_0x0820('0x7'),'skebby',_0x0820('0x8'),_0x0820('0x9'),_0x0820('0xa'),_0x0820('0xb'),_0x0820('0xc'),_0x0820('0xd'),_0x0820('0xe'),_0x0820('0xf'))},'accountSid':{'type':Sequelize[_0x0820('0x4')]},'authId':{'type':Sequelize[_0x0820('0x4')]},'authToken':{'type':Sequelize[_0x0820('0x4')]},'smsMethod':{'type':Sequelize[_0x0820('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x0820('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x0820('0x4')]},'applicationId':{'type':Sequelize[_0x0820('0x4')]},'accountId':{'type':Sequelize[_0x0820('0x4')]},'senderString':{'type':Sequelize[_0x0820('0x4')]},'deliveryReport':{'type':Sequelize[_0x0820('0x10')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0820('0x11')],'defaultValue':function(){return _0x0820('0x12');}},'notificationSound':{'type':Sequelize[_0x0820('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0820('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0820('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0820('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0820('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0820('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0820('0x13')],'comment':_0x0820('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x0820('0x10')],'defaultValue':![],'comment':_0x0820('0x15'),'set':function(_0x3d3581){if(!_0x3d3581)this[_0x0820('0x16')](_0x0820('0x17'),null);this[_0x0820('0x16')](_0x0820('0x18'),_0x3d3581);}}}; \ No newline at end of file +var _0xa434=['plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio'];(function(_0x5349a7,_0x15a974){var _0x457d31=function(_0x55fd05){while(--_0x55fd05){_0x5349a7['push'](_0x5349a7['shift']());}};_0x457d31(++_0x15a974);}(_0xa434,0x1e8));var _0x4a43=function(_0x3d11be,_0x1b9a8c){_0x3d11be=_0x3d11be-0x0;var _0x4b657b=_0xa434[_0x3d11be];return _0x4b657b;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4a43('0x0'));module[_0x4a43('0x1')]={'name':{'type':Sequelize[_0x4a43('0x2')],'unique':_0x4a43('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x4a43('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4a43('0x2')],'defaultValue':function(){return rs[_0x4a43('0x4')]();}},'phone':{'type':Sequelize[_0x4a43('0x2')]},'type':{'type':Sequelize['ENUM'](_0x4a43('0x5'),'skebby','connectel','clicksend',_0x4a43('0x6'),_0x4a43('0x7'),'bandwidth',_0x4a43('0x8'),_0x4a43('0x9'),_0x4a43('0xa'))},'accountSid':{'type':Sequelize[_0x4a43('0x2')]},'authId':{'type':Sequelize[_0x4a43('0x2')]},'authToken':{'type':Sequelize[_0x4a43('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x4a43('0x2')]},'applicationId':{'type':Sequelize[_0x4a43('0x2')]},'accountId':{'type':Sequelize[_0x4a43('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x4a43('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4a43('0xc')],'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[_0x4a43('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4a43('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4a43('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4a43('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4a43('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4a43('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x4a43('0xb')],'defaultValue':![],'comment':_0x4a43('0xf'),'set':function(_0x4ddb71){if(!_0x4ddb71)this['setDataValue'](_0x4a43('0x10'),null);this[_0x4a43('0x11')](_0x4a43('0x12'),_0x4ddb71);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index b04680a..835b7c4 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 _0xa010=['set','Content-Range','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','include','removeAnswers','notify','sms','SmsApplication','account','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','From','Body','messageId','skebby','sender','text','connectel','from','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','defaults','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','twilio','Content-Type','text/xml','findOne','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','bandwidth','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','clickatell','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','User','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','jayson/promise','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x5e7acf,_0x582ec4){var _0xc8aab4=function(_0x2187e2){while(--_0x2187e2){_0x5e7acf['push'](_0x5e7acf['shift']());}};_0xc8aab4(++_0x582ec4);}(_0xa010,0x199));var _0x0a01=function(_0x2e7d42,_0x16c6b9){_0x2e7d42=_0x2e7d42-0x0;var _0x1c5197=_0xa010[_0x2e7d42];return _0x1c5197;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a01('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a01('0x1'));var rp=require(_0x0a01('0x2'));var moment=require(_0x0a01('0x3'));var BPromise=require(_0x0a01('0x4'));var Mustache=require('mustache');var util=require(_0x0a01('0x5'));var path=require(_0x0a01('0x6'));var sox=require(_0x0a01('0x7'));var csv=require(_0x0a01('0x8'));var ejs=require(_0x0a01('0x9'));var fs=require('fs');var fs_extra=require(_0x0a01('0xa'));var _=require(_0x0a01('0xb'));var squel=require(_0x0a01('0xc'));var crypto=require(_0x0a01('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0a01('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0a01('0xf'));var Papa=require(_0x0a01('0x10'));var Redis=require(_0x0a01('0x11'));var authService=require(_0x0a01('0x12'));var qs=require(_0x0a01('0x13'));var as=require(_0x0a01('0x14'));var hardwareService=require(_0x0a01('0x15'));var logger=require(_0x0a01('0x16'))(_0x0a01('0x17'));var utils=require('../../config/utils');var config=require(_0x0a01('0x18'));var licenseUtil=require(_0x0a01('0x19'));var db=require(_0x0a01('0x1a'))['db'];config[_0x0a01('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a01('0x1c'))(new Redis(config[_0x0a01('0x1b')]));require('./smsAccount.socket')[_0x0a01('0x1d')](socket);var jayson=require(_0x0a01('0x1e'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x52d1f7,_0x5cfb09,_0x105128,_0x37dd18){return new BPromise(function(_0x3bbf51,_0x4ef57f){var _0xd84b6b=_0x37dd18||client;return _0xd84b6b[_0x0a01('0x1f')](_0x52d1f7,_0x105128)[_0x0a01('0x20')](function(_0x2604eb){logger['info'](_0x0a01('0x21'),_0x5cfb09,_0x0a01('0x22'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5cfb09,'request\x20sent',JSON[_0x0a01('0x23')](_0x2604eb));if(_0x2604eb[_0x0a01('0x24')]){if(_0x2604eb[_0x0a01('0x24')]['code']===0x1f4){logger[_0x0a01('0x24')](_0x0a01('0x21'),_0x5cfb09,_0x2604eb[_0x0a01('0x24')]['message']);return _0x4ef57f(_0x2604eb[_0x0a01('0x24')][_0x0a01('0x25')]);}logger[_0x0a01('0x24')](_0x0a01('0x21'),_0x5cfb09,_0x2604eb[_0x0a01('0x24')]['message']);return _0x3bbf51(_0x2604eb[_0x0a01('0x24')][_0x0a01('0x25')]);}else{logger[_0x0a01('0x26')](_0x0a01('0x21'),_0x5cfb09,'request\x20sent');_0x3bbf51(_0x2604eb[_0x0a01('0x27')][_0x0a01('0x25')]);}})[_0x0a01('0x28')](function(_0x2898b6){logger[_0x0a01('0x24')](_0x0a01('0x21'),_0x5cfb09,_0x2898b6);_0x4ef57f(_0x2898b6);});});}function respondWithStatusCode(_0x53612a,_0x40fc67){_0x40fc67=_0x40fc67||0xcc;return function(_0x352f38){if(_0x352f38){return _0x53612a[_0x0a01('0x29')](_0x40fc67);}return _0x53612a[_0x0a01('0x2a')](_0x40fc67)[_0x0a01('0x2b')]();};}function respondWithResult(_0x412397,_0x50b59b){_0x50b59b=_0x50b59b||0xc8;return function(_0x2bb5ec){if(_0x2bb5ec){return _0x412397[_0x0a01('0x2a')](_0x50b59b)[_0x0a01('0x2c')](_0x2bb5ec);}};}function respondWithFilteredResult(_0x2dc379,_0x79a02e){return function(_0x28c4ca){if(_0x28c4ca){var _0x222a45=typeof _0x79a02e[_0x0a01('0x2d')]===_0x0a01('0x2e')&&typeof _0x79a02e[_0x0a01('0x2f')]===_0x0a01('0x2e');var _0x49ede5=_0x28c4ca[_0x0a01('0x30')];var _0x3aa11f=_0x222a45?0x0:_0x79a02e[_0x0a01('0x2d')];var _0x2c91b2=_0x222a45?_0x28c4ca[_0x0a01('0x30')]:_0x79a02e['offset']+_0x79a02e['limit'];var _0x470fab;if(_0x2c91b2>=_0x49ede5){_0x2c91b2=_0x49ede5;_0x470fab=0xc8;}else{_0x470fab=0xce;}_0x2dc379[_0x0a01('0x2a')](_0x470fab);return _0x2dc379[_0x0a01('0x31')](_0x0a01('0x32'),_0x3aa11f+'-'+_0x2c91b2+'/'+_0x49ede5)[_0x0a01('0x2c')](_0x28c4ca);}return null;};}function patchUpdates(_0x36dd08){return function(_0x582e6b){try{jsonpatch['apply'](_0x582e6b,_0x36dd08,!![]);}catch(_0x347435){return BPromise[_0x0a01('0x33')](_0x347435);}return _0x582e6b[_0x0a01('0x34')]();};}function saveUpdates(_0x5a8163,_0x20a707){return function(_0x458631){if(_0x458631){return _0x458631['update'](_0x5a8163)[_0x0a01('0x20')](function(_0x267b19){return _0x267b19;});}return null;};}function removeEntity(_0x3d46ad,_0x8fe470){return function(_0x12f5ad){if(_0x12f5ad){return _0x12f5ad[_0x0a01('0x35')]()['then'](function(){var _0x23593b=_0x12f5ad[_0x0a01('0x36')]({'plain':!![]});var _0x26900f=_0x0a01('0x37');return db[_0x0a01('0x38')][_0x0a01('0x35')]({'where':{'type':_0x26900f,'resourceId':_0x23593b['id']}})[_0x0a01('0x20')](function(){return _0x12f5ad;});})[_0x0a01('0x20')](function(){_0x3d46ad[_0x0a01('0x2a')](0xcc)[_0x0a01('0x2b')]();});}};}function handleEntityNotFound(_0x48301e,_0x15aded){return function(_0xbded43){if(!_0xbded43){_0x48301e[_0x0a01('0x29')](0x194);}return _0xbded43;};}function handleError(_0x5023b2,_0x233923){_0x233923=_0x233923||0x1f4;return function(_0xe508b6){logger[_0x0a01('0x24')](_0xe508b6[_0x0a01('0x39')]);if(_0xe508b6[_0x0a01('0x3a')]){delete _0xe508b6[_0x0a01('0x3a')];}_0x5023b2['status'](_0x233923)[_0x0a01('0x3b')](_0xe508b6);};}exports[_0x0a01('0x3c')]=function(_0x33239f,_0x4c1b8b){var _0x3be77a={'include':[{'model':db[_0x0a01('0x3d')],'as':_0x0a01('0x3e')}]},_0x2af6cd={},_0x34cdd6={'count':0x0,'rows':[]};var _0x4dd577=_[_0x0a01('0x3f')](db[_0x0a01('0x40')][_0x0a01('0x41')],function(_0x127193){return{'name':_0x127193['fieldName'],'type':_0x127193[_0x0a01('0x42')]['key']};});_0x2af6cd[_0x0a01('0x43')]=_[_0x0a01('0x3f')](_0x4dd577,'name');_0x2af6cd[_0x0a01('0x44')]=_['keys'](_0x33239f[_0x0a01('0x44')]);_0x2af6cd[_0x0a01('0x45')]=_[_0x0a01('0x46')](_0x2af6cd[_0x0a01('0x43')],_0x2af6cd['query']);_0x3be77a[_0x0a01('0x47')]=_[_0x0a01('0x46')](_0x2af6cd[_0x0a01('0x43')],qs[_0x0a01('0x48')](_0x33239f['query']['fields']));_0x3be77a[_0x0a01('0x47')]=_0x3be77a['attributes'][_0x0a01('0x49')]?_0x3be77a['attributes']:_0x2af6cd['model'];if(!_0x33239f[_0x0a01('0x44')][_0x0a01('0x4a')]('nolimit')){_0x3be77a[_0x0a01('0x2f')]=qs[_0x0a01('0x2f')](_0x33239f['query'][_0x0a01('0x2f')]);_0x3be77a[_0x0a01('0x2d')]=qs['offset'](_0x33239f[_0x0a01('0x44')][_0x0a01('0x2d')]);}_0x3be77a['order']=qs[_0x0a01('0x4b')](_0x33239f[_0x0a01('0x44')]['sort']);_0x3be77a['where']=qs[_0x0a01('0x45')](_[_0x0a01('0x4c')](_0x33239f[_0x0a01('0x44')],_0x2af6cd[_0x0a01('0x45')]),_0x4dd577);if(_0x33239f[_0x0a01('0x44')][_0x0a01('0x4d')]){_0x3be77a[_0x0a01('0x4e')]=_[_0x0a01('0x4f')](_0x3be77a[_0x0a01('0x4e')],{'$or':_[_0x0a01('0x3f')](_0x4dd577,function(_0xd5b440){if(_0xd5b440['type']!==_0x0a01('0x50')){var _0x58546b={};_0x58546b[_0xd5b440[_0x0a01('0x3a')]]={'$like':'%'+_0x33239f[_0x0a01('0x44')][_0x0a01('0x4d')]+'%'};return _0x58546b;}})});}_0x3be77a=_[_0x0a01('0x4f')]({},_0x3be77a,_0x33239f['options']);var _0x2fd678={'where':_0x3be77a['where']};return db[_0x0a01('0x40')]['count'](_0x2fd678)[_0x0a01('0x20')](function(_0x3cd218){_0x34cdd6['count']=_0x3cd218;if(_0x33239f['query'][_0x0a01('0x51')]){_0x3be77a['include']=[{'all':!![]}];}return db[_0x0a01('0x40')][_0x0a01('0x52')](_0x3be77a);})['then'](function(_0x438ad1){_0x34cdd6[_0x0a01('0x53')]=_0x438ad1;return _0x34cdd6;})['then'](respondWithFilteredResult(_0x4c1b8b,_0x3be77a))[_0x0a01('0x28')](handleError(_0x4c1b8b,null));};exports[_0x0a01('0x54')]=function(_0x2b2202,_0x2b0d95){var _0x50dcf0={'raw':![],'where':{'id':_0x2b2202[_0x0a01('0x55')]['id']},'include':[{'model':db[_0x0a01('0x3d')],'as':_0x0a01('0x3e')}]},_0x1b946a={};_0x1b946a[_0x0a01('0x43')]=_[_0x0a01('0x56')](db[_0x0a01('0x40')][_0x0a01('0x41')]);_0x1b946a['query']=_[_0x0a01('0x56')](_0x2b2202[_0x0a01('0x44')]);_0x1b946a['filters']=_[_0x0a01('0x46')](_0x1b946a[_0x0a01('0x43')],_0x1b946a[_0x0a01('0x44')]);_0x50dcf0['attributes']=_[_0x0a01('0x46')](_0x1b946a['model'],qs[_0x0a01('0x48')](_0x2b2202['query'][_0x0a01('0x48')]));_0x50dcf0[_0x0a01('0x47')]=_0x50dcf0[_0x0a01('0x47')]['length']?_0x50dcf0[_0x0a01('0x47')]:_0x1b946a['model'];if(_0x2b2202[_0x0a01('0x44')][_0x0a01('0x51')]){_0x50dcf0['include']=[{'all':!![]}];}_0x50dcf0=_[_0x0a01('0x4f')]({},_0x50dcf0,_0x2b2202[_0x0a01('0x57')]);return db[_0x0a01('0x40')][_0x0a01('0x58')](_0x50dcf0)['then'](handleEntityNotFound(_0x2b0d95,null))[_0x0a01('0x20')](respondWithResult(_0x2b0d95,null))[_0x0a01('0x28')](handleError(_0x2b0d95,null));};exports[_0x0a01('0x59')]=function(_0x46474b,_0x18bf81){return db[_0x0a01('0x40')]['create'](_0x46474b[_0x0a01('0x5a')],{})[_0x0a01('0x20')](function(_0x4bc1a8){var _0xf0ea6=_0x46474b[_0x0a01('0x5b')][_0x0a01('0x36')]({'plain':!![]});if(!_0xf0ea6)throw new Error(_0x0a01('0x5c'));if(_0xf0ea6[_0x0a01('0x5d')]===_0x0a01('0x5b')){var _0x44aac4=_0x4bc1a8[_0x0a01('0x36')]({'plain':!![]});var _0x3e5cb4=_0x0a01('0x37');return db[_0x0a01('0x5e')][_0x0a01('0x58')]({'where':{'name':_0x3e5cb4,'userProfileId':_0xf0ea6[_0x0a01('0x5f')]},'raw':!![]})[_0x0a01('0x20')](function(_0x46829a){if(_0x46829a&&_0x46829a[_0x0a01('0x60')]===0x0){return db[_0x0a01('0x38')][_0x0a01('0x59')]({'name':_0x44aac4[_0x0a01('0x3a')],'resourceId':_0x44aac4['id'],'type':_0x46829a[_0x0a01('0x3a')],'sectionId':_0x46829a['id']},{})[_0x0a01('0x20')](function(){return _0x4bc1a8;});}else{return _0x4bc1a8;}})[_0x0a01('0x28')](function(_0x3a4e5c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a4e5c);throw _0x3a4e5c;});}return _0x4bc1a8;})['then'](respondWithResult(_0x18bf81,0xc9))['catch'](handleError(_0x18bf81,null));};exports[_0x0a01('0x61')]=function(_0x3ee2a1,_0x4c3437){if(_0x3ee2a1['body']['id']){delete _0x3ee2a1[_0x0a01('0x5a')]['id'];}return db[_0x0a01('0x40')][_0x0a01('0x58')]({'where':{'id':_0x3ee2a1[_0x0a01('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4c3437,null))[_0x0a01('0x20')](saveUpdates(_0x3ee2a1['body'],null))['then'](respondWithResult(_0x4c3437,null))[_0x0a01('0x28')](handleError(_0x4c3437,null));};exports[_0x0a01('0x35')]=function(_0x3f59b2,_0x201f4b){return db[_0x0a01('0x40')][_0x0a01('0x58')]({'where':{'id':_0x3f59b2[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x201f4b,null))[_0x0a01('0x20')](removeEntity(_0x201f4b,null))[_0x0a01('0x28')](handleError(_0x201f4b,null));};exports[_0x0a01('0x62')]=function(_0x46d259,_0x18a3f7){return db['SmsAccount'][_0x0a01('0x62')]()[_0x0a01('0x20')](respondWithResult(_0x18a3f7,null))['catch'](handleError(_0x18a3f7,null));};exports[_0x0a01('0x63')]=function(_0x19fee3,_0x156be3,_0x478f77){if(_0x19fee3[_0x0a01('0x5a')]['id']){delete _0x19fee3['body']['id'];}return db['SmsAccount'][_0x0a01('0x58')]({'where':{'id':_0x19fee3[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x156be3,null))['then'](function(_0x202527){if(_0x202527){_0x19fee3[_0x0a01('0x5a')][_0x0a01('0x64')]=_0x202527['id'];return db[_0x0a01('0x65')][_0x0a01('0x59')](_0x19fee3[_0x0a01('0x5a')]);}})[_0x0a01('0x20')](respondWithResult(_0x156be3,null))[_0x0a01('0x28')](handleError(_0x156be3,null));};exports[_0x0a01('0x66')]=function(_0x1a44fd,_0x984518,_0x1dbb8d){var _0x39746d={'raw':![],'where':{}};var _0xf4d030={};var _0x300310={'count':0x0,'rows':[]};return db[_0x0a01('0x40')]['findOne']({'where':{'id':_0x1a44fd[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x984518,null))['then'](function(_0x14eab7){if(_0x14eab7){_0xf4d030[_0x0a01('0x43')]=_[_0x0a01('0x56')](db[_0x0a01('0x65')]['rawAttributes']);_0xf4d030['query']=_[_0x0a01('0x56')](_0x1a44fd[_0x0a01('0x44')]);_0xf4d030[_0x0a01('0x45')]=_[_0x0a01('0x46')](_0xf4d030[_0x0a01('0x43')],_0xf4d030[_0x0a01('0x44')]);_0x39746d[_0x0a01('0x47')]=_[_0x0a01('0x46')](_0xf4d030['model'],qs[_0x0a01('0x48')](_0x1a44fd[_0x0a01('0x44')][_0x0a01('0x48')]));_0x39746d[_0x0a01('0x47')]=_0x39746d['attributes']['length']?_0x39746d[_0x0a01('0x47')]:_0xf4d030[_0x0a01('0x43')];if(!_0x1a44fd['query'][_0x0a01('0x4a')]('nolimit')){_0x39746d[_0x0a01('0x2f')]=qs[_0x0a01('0x2f')](_0x1a44fd['query']['limit']);_0x39746d[_0x0a01('0x2d')]=qs[_0x0a01('0x2d')](_0x1a44fd[_0x0a01('0x44')][_0x0a01('0x2d')]);}_0x39746d[_0x0a01('0x67')]=qs[_0x0a01('0x4b')](_0x1a44fd[_0x0a01('0x44')][_0x0a01('0x4b')]);_0x39746d[_0x0a01('0x4e')]=qs['filters'](_[_0x0a01('0x4c')](_0x1a44fd[_0x0a01('0x44')],_0xf4d030[_0x0a01('0x45')]));_0x39746d[_0x0a01('0x4e')][_0x0a01('0x64')]=_0x14eab7['id'];if(_0x1a44fd[_0x0a01('0x44')][_0x0a01('0x4d')]){_0x39746d[_0x0a01('0x4e')]=_[_0x0a01('0x4f')](_0x39746d[_0x0a01('0x4e')],{'$or':_['map'](_0x39746d['attributes'],function(_0x5a9ad6){var _0x2e0edd={};_0x2e0edd[_0x5a9ad6]={'$like':'%'+_0x1a44fd[_0x0a01('0x44')][_0x0a01('0x4d')]+'%'};return _0x2e0edd;})});}_0x39746d=_[_0x0a01('0x4f')]({},_0x39746d,_0x1a44fd['options']);return db['Disposition'][_0x0a01('0x30')]({'where':_0x39746d[_0x0a01('0x4e')]})['then'](function(_0x1e0a97){_0x300310['count']=_0x1e0a97;if(_0x1a44fd[_0x0a01('0x44')][_0x0a01('0x51')]){_0x39746d['include']=[{'all':!![]}];}return db[_0x0a01('0x65')][_0x0a01('0x52')](_0x39746d);})['then'](function(_0x2a70cb){_0x300310[_0x0a01('0x53')]=_0x2a70cb;return _0x300310;});}})['then'](respondWithFilteredResult(_0x984518,_0x39746d))[_0x0a01('0x28')](handleError(_0x984518,null));};exports[_0x0a01('0x68')]=function(_0x23c2d2,_0x50aaa3,_0x5a24aa){return db[_0x0a01('0x40')]['find']({'where':{'id':_0x23c2d2['params']['id']}})['then'](handleEntityNotFound(_0x50aaa3,null))[_0x0a01('0x20')](function(_0x476d9f){if(_0x476d9f){return _0x476d9f[_0x0a01('0x68')](_0x23c2d2[_0x0a01('0x44')][_0x0a01('0x69')]);}})[_0x0a01('0x20')](respondWithStatusCode(_0x50aaa3,null))['catch'](handleError(_0x50aaa3,null));};exports[_0x0a01('0x6a')]=function(_0x374d27,_0x1b7783,_0x912887){if(_0x374d27[_0x0a01('0x5a')]['id']){delete _0x374d27['body']['id'];}return db[_0x0a01('0x40')]['find']({'where':{'id':_0x374d27[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x1b7783,null))[_0x0a01('0x20')](function(_0x4d29aa){if(_0x4d29aa){_0x374d27[_0x0a01('0x5a')][_0x0a01('0x64')]=_0x4d29aa['id'];return db[_0x0a01('0x6b')][_0x0a01('0x59')](_0x374d27[_0x0a01('0x5a')]);}})[_0x0a01('0x20')](respondWithResult(_0x1b7783,null))[_0x0a01('0x28')](handleError(_0x1b7783,null));};exports[_0x0a01('0x6c')]=function(_0x5c0fda,_0x4437b9,_0x56ddcb){var _0x24ba29={'raw':![],'where':{}};var _0x534995={};var _0x4d85e2={'count':0x0,'rows':[]};return db[_0x0a01('0x40')]['findOne']({'where':{'id':_0x5c0fda[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x4437b9,null))['then'](function(_0x5578ae){if(_0x5578ae){_0x534995[_0x0a01('0x43')]=_[_0x0a01('0x56')](db[_0x0a01('0x6b')][_0x0a01('0x41')]);_0x534995[_0x0a01('0x44')]=_['keys'](_0x5c0fda[_0x0a01('0x44')]);_0x534995['filters']=_[_0x0a01('0x46')](_0x534995[_0x0a01('0x43')],_0x534995[_0x0a01('0x44')]);_0x24ba29[_0x0a01('0x47')]=_[_0x0a01('0x46')](_0x534995[_0x0a01('0x43')],qs[_0x0a01('0x48')](_0x5c0fda[_0x0a01('0x44')][_0x0a01('0x48')]));_0x24ba29[_0x0a01('0x47')]=_0x24ba29[_0x0a01('0x47')][_0x0a01('0x49')]?_0x24ba29[_0x0a01('0x47')]:_0x534995[_0x0a01('0x43')];if(!_0x5c0fda[_0x0a01('0x44')][_0x0a01('0x4a')](_0x0a01('0x6d'))){_0x24ba29[_0x0a01('0x2f')]=qs[_0x0a01('0x2f')](_0x5c0fda[_0x0a01('0x44')][_0x0a01('0x2f')]);_0x24ba29[_0x0a01('0x2d')]=qs['offset'](_0x5c0fda[_0x0a01('0x44')][_0x0a01('0x2d')]);}_0x24ba29[_0x0a01('0x67')]=qs['sort'](_0x5c0fda[_0x0a01('0x44')][_0x0a01('0x4b')]);_0x24ba29['where']=qs['filters'](_[_0x0a01('0x4c')](_0x5c0fda[_0x0a01('0x44')],_0x534995['filters']));_0x24ba29[_0x0a01('0x4e')][_0x0a01('0x64')]=_0x5578ae['id'];if(_0x5c0fda[_0x0a01('0x44')][_0x0a01('0x4d')]){_0x24ba29[_0x0a01('0x4e')]=_[_0x0a01('0x4f')](_0x24ba29[_0x0a01('0x4e')],{'$or':_[_0x0a01('0x3f')](_0x24ba29['attributes'],function(_0x4d6c89){var _0x466318={};_0x466318[_0x4d6c89]={'$like':'%'+_0x5c0fda['query']['filter']+'%'};return _0x466318;})});}_0x24ba29=_[_0x0a01('0x4f')]({},_0x24ba29,_0x5c0fda[_0x0a01('0x57')]);return db[_0x0a01('0x6b')][_0x0a01('0x30')]({'where':_0x24ba29[_0x0a01('0x4e')]})['then'](function(_0x11d75b){_0x4d85e2[_0x0a01('0x30')]=_0x11d75b;if(_0x5c0fda[_0x0a01('0x44')]['includeAll']){_0x24ba29[_0x0a01('0x6e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0a01('0x52')](_0x24ba29);})[_0x0a01('0x20')](function(_0x4ece6e){_0x4d85e2[_0x0a01('0x53')]=_0x4ece6e;return _0x4d85e2;});}})['then'](respondWithFilteredResult(_0x4437b9,_0x24ba29))[_0x0a01('0x28')](handleError(_0x4437b9,null));};exports[_0x0a01('0x6f')]=function(_0x477507,_0x90fb91,_0x152fc2){return db[_0x0a01('0x40')][_0x0a01('0x58')]({'where':{'id':_0x477507[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x90fb91,null))['then'](function(_0x214834){if(_0x214834){return _0x214834[_0x0a01('0x6f')](_0x477507['query'][_0x0a01('0x69')]);}})['then'](respondWithStatusCode(_0x90fb91,null))[_0x0a01('0x28')](handleError(_0x90fb91,null));};exports[_0x0a01('0x70')]=function(_0x5dfe25,_0x24d494,_0x29d255){var _0x5cbc8e={'channel':_0x0a01('0x71')};var _0x9512c0=[];var _0x3a403f=[];var _0xaffc82={};return db['SmsAccount']['find']({'where':{'id':_0x5dfe25[_0x0a01('0x55')]['id']},'include':[{'model':db[_0x0a01('0x72')],'as':'Applications'}]})[_0x0a01('0x20')](handleEntityNotFound(_0x24d494,null))['then'](function(_0x1f323c){_0x5cbc8e[_0x0a01('0x73')]=_0x1f323c;_0x5cbc8e['applications']=_[_0x0a01('0x74')](_0x1f323c[_0x0a01('0x75')],['priority'],[_0x0a01('0x76')]);if(_0x5cbc8e[_0x0a01('0x73')]['Applications']){delete _0x5cbc8e[_0x0a01('0x73')][_0x0a01('0x75')];}return db[_0x0a01('0x77')][_0x0a01('0x62')]();})['then'](function(_0x51bfc2){if(!_0x51bfc2){throw new db[(_0x0a01('0x78'))][(_0x0a01('0x79'))](_0x0a01('0x7a'));}_0x9512c0=_[_0x0a01('0x7b')](_[_0x0a01('0x56')](_0x51bfc2),[_0x0a01('0x7c'),_0x0a01('0x7d')]);_0x3a403f=_[_0x0a01('0x7b')](_['keys'](_0x51bfc2),[_0x0a01('0x7c'),_0x0a01('0x7d'),_0x0a01('0x7e'),_0x0a01('0x7f')]);_0x5cbc8e[_0x0a01('0x5a')]={'mapKey':_0x0a01('0x80')};if(_0x5cbc8e['account'][_0x0a01('0x42')]){switch(_0x5cbc8e['account'][_0x0a01('0x42')]){case'twilio':_0x5cbc8e[_0x0a01('0x5a')]['from']=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x81')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x82')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x83')]=_0x5dfe25[_0x0a01('0x5a')]['MessageSid'];break;case _0x0a01('0x84'):_0x5cbc8e['body']['from']='+'+_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x85')];_0x5cbc8e[_0x0a01('0x5a')]['body']=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x86')];break;case _0x0a01('0x87'):_0x5cbc8e['body'][_0x0a01('0x88')]=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x88')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]=_0x5dfe25[_0x0a01('0x5a')]['message'];break;case'clicksend':_0x5cbc8e['body'][_0x0a01('0x88')]=_0x5dfe25[_0x0a01('0x5a')]['from'];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]=_0x5dfe25['body'][_0x0a01('0x5a')];_0x5cbc8e['body']['messageId']=_0x5dfe25['body'][_0x0a01('0x89')];break;case _0x0a01('0x8a'):_0x5cbc8e[_0x0a01('0x5a')]['from']=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x81')];_0x5cbc8e[_0x0a01('0x5a')]['body']=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x8b')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x83')]=_0x5dfe25[_0x0a01('0x5a')]['MessageUUID'];break;case _0x0a01('0x8c'):_0x5cbc8e[_0x0a01('0x5a')]['from']='+'+_0x5dfe25['body'][_0x0a01('0x8d')][0x0][_0x0a01('0x88')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]=_0x5dfe25['body']['results'][0x0][_0x0a01('0x86')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x83')]=_0x5dfe25['body'][_0x0a01('0x8d')][0x0][_0x0a01('0x83')];break;case _0x0a01('0x8e'):_0x5cbc8e[_0x0a01('0x5a')]['from']=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x8f')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x90')][_0x0a01('0x25')];break;case'clickatell':_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x88')]=_0x5dfe25[_0x0a01('0x5a')]['fromNumber'];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x86')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x83')]=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x91')];break;case'bandwidth':_0x5cbc8e['body'][_0x0a01('0x83')]=_0x5dfe25[_0x0a01('0x5a')][0x0]['message']['id'];_0x5cbc8e['body']['from']=_0x5dfe25[_0x0a01('0x5a')][0x0][_0x0a01('0x25')][_0x0a01('0x88')];_0x5cbc8e['body'][_0x0a01('0x5a')]=_0x5dfe25['body'][0x0][_0x0a01('0x25')]['text'];break;case'intelepeer':_0x5cbc8e[_0x0a01('0x5a')]['from']=_0x5dfe25[_0x0a01('0x5a')][_0x0a01('0x88')];_0x5cbc8e[_0x0a01('0x5a')]['body']=_0x5dfe25['body'][_0x0a01('0x25')];_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x83')]=_0x5dfe25[_0x0a01('0x5a')]['refid'];break;}}if(_0x5cbc8e[_0x0a01('0x5a')]['id']){delete _0x5cbc8e['body']['id'];}if(_[_0x0a01('0x92')](_0x5cbc8e['body'][_0x0a01('0x88')])){throw new db[(_0x0a01('0x78'))][(_0x0a01('0x79'))](_0x0a01('0x93'));}if(_['isNil'](_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')])||_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a01('0x92')](_0x5cbc8e['body'][_0x0a01('0x94')])){throw new db[(_0x0a01('0x78'))][(_0x0a01('0x79'))](_0x0a01('0x95')+_0x3a403f);}if(!_[_0x0a01('0x96')](_0x3a403f,_0x5cbc8e['body'][_0x0a01('0x94')])){throw new db[(_0x0a01('0x78'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a403f);}_0xaffc82[_0x5cbc8e[_0x0a01('0x5a')]['mapKey']]=_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x88')];return db[_0x0a01('0x97')][_0x0a01('0x58')]({'where':{'id':_0x5cbc8e['account'][_0x0a01('0x7f')]},'include':[{'model':db[_0x0a01('0x77')],'as':_0x0a01('0x98'),'where':_0xaffc82,'limit':0x1,'order':[[_0x0a01('0x7d'),_0x0a01('0x99')]]}]});})[_0x0a01('0x20')](handleEntityNotFound(_0x24d494,null))[_0x0a01('0x20')](function(_0x80b797){if(_0x80b797){_0x5cbc8e[_0x0a01('0x9a')]=_[_0x0a01('0x9b')](_0x80b797,[_0x0a01('0x98')]);if(_0x80b797['Contacts'][_0x0a01('0x49')]){return _0x80b797[_0x0a01('0x98')][0x0];}var _0x3a18a0=_[_0x0a01('0x9c')](_0x5cbc8e[_0x0a01('0x5a')],{'firstName':_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x88')],'ListId':_0x80b797['id']});_0x3a18a0[_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x94')]]=_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x88')];return db['CmContact'][_0x0a01('0x59')](_0x3a18a0,{'fields':_0x9512c0,'raw':!![]});}})[_0x0a01('0x20')](handleEntityNotFound(_0x24d494,null))[_0x0a01('0x20')](function(_0x38245d){if(_0x38245d){_0x5cbc8e['contact']=_0x38245d;var _0x43744c={'ContactId':_0x38245d['id'],'phone':_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x88')],'SmsAccountId':_0x5dfe25['params']['id']};var _0x562e96={'ContactId':_0x38245d['id'],'SmsAccountId':_0x5dfe25['params']['id'],'closed':![]};return db[_0x0a01('0x9d')][_0x0a01('0x58')]({'where':_0x562e96})[_0x0a01('0x20')](function(_0x5c1b49){if(_0x5c1b49){return[_0x5c1b49,![]];}return db[_0x0a01('0x9d')]['create'](_0x43744c)['then'](function(_0x5901f3){return[_0x5901f3,!![]];});});}})[_0x0a01('0x9e')](function(_0x1a944f,_0x3fa95d){_0x5cbc8e[_0x0a01('0x9f')]=_0x1a944f[_0x0a01('0x36')]({'plain':!![]});_0x5cbc8e[_0x0a01('0x9f')][_0x0a01('0xa0')]=![];if(_0x3fa95d){if(_0x5cbc8e[_0x0a01('0x73')][_0x0a01('0xa1')]){_0x5cbc8e['applications'][_0x0a01('0xa2')]({'id':0x0,'priority':_0x5cbc8e[_0x0a01('0xa3')]['length']+0x1,'app':_0x0a01('0xa4'),'appdata':_0x0a01('0xa5'),'interval':'*,*,*,*'});}_0x5cbc8e[_0x0a01('0x9f')][_0x0a01('0xa0')]=!![];}return db[_0x0a01('0xa6')][_0x0a01('0x59')]({'phone':_0x5cbc8e[_0x0a01('0x5a')]['from'],'messageId':_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x83')],'body':_0x5cbc8e[_0x0a01('0x5a')][_0x0a01('0x5a')],'SmsAccountId':_0x5dfe25['params']['id'],'SmsInteractionId':_0x1a944f['id'],'direction':'in','ContactId':_0x1a944f[_0x0a01('0xa7')],'AttachmentId':_0x5cbc8e['body'][_0x0a01('0xa8')]});})[_0x0a01('0x20')](function(_0x1fa255){_0x5cbc8e['message']=_0x1fa255;if(_0x5cbc8e[_0x0a01('0x9f')][_0x0a01('0xa9')]){return db['User'][_0x0a01('0x58')]({'attributes':['id',_0x0a01('0x3a')],'where':{'id':_0x5cbc8e[_0x0a01('0x9f')][_0x0a01('0xa9')]}})[_0x0a01('0x20')](function(_0x1a6a18){if(_0x1a6a18){_0x5cbc8e[_0x0a01('0xa3')][_0x0a01('0xaa')]({'id':0x0,'priority':0x0,'app':_0x0a01('0xab'),'appdata':_0x1a6a18[_0x0a01('0x3a')]+','+(_0x5cbc8e['account'][_0x0a01('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x0a01('0xad'),_0x5cbc8e);});}return respondWithRpcPromise('Start','startRouting',_0x5cbc8e);})['then'](function(_0x36e2bf){if(_0x36e2bf){var _0x59778a=0xc8;var _0x266be9=_0x0a01('0xae');logger[_0x0a01('0x26')](_0x0a01('0xaf'),_0x266be9,_0x59778a,_0x0a01('0xb0'));logger[_0x0a01('0xb1')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x266be9,_0x59778a,_0x0a01('0xb0'),JSON[_0x0a01('0x23')](_0x36e2bf));if(_0x5cbc8e[_0x0a01('0x73')][_0x0a01('0x42')]===_0x0a01('0xb2')){return _0x24d494['status'](_0x59778a)[_0x0a01('0x31')](_0x0a01('0xb3'),_0x0a01('0xb4'))[_0x0a01('0x3b')]('\x0a');}else{return _0x24d494[_0x0a01('0x2a')](_0x59778a)[_0x0a01('0x2c')](_0x36e2bf);}}})[_0x0a01('0x28')](handleError(_0x24d494,null));};exports['addApplications']=function(_0x5c5a41,_0x6bdd3d,_0xeeb795){return db['SmsAccount'][_0x0a01('0xb5')]({'where':{'id':_0x5c5a41[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x6bdd3d,null))[_0x0a01('0x20')](function(_0x27967a){if(_0x27967a){return db['sequelize'][_0x0a01('0xb6')](function(_0x1b1202){return db[_0x0a01('0x72')][_0x0a01('0x35')]({'where':{'SmsAccountId':_0x5c5a41['params']['id']},'transaction':_0x1b1202})[_0x0a01('0x20')](function(_0x52d610){var _0x3c5bd8=_['map'](_0x5c5a41[_0x0a01('0x5a')],function(_0x428881){_0x428881['SmsAccountId']=_0x5c5a41['params']['id'];return _0x428881;});return db['SmsApplication'][_0x0a01('0xb7')](_0x3c5bd8,{'transaction':_0x1b1202});});})[_0x0a01('0x20')](function(){return db[_0x0a01('0x72')][_0x0a01('0xb8')]({'where':{'SmsAccountId':_0x5c5a41[_0x0a01('0x55')]['id']},'order':_0x0a01('0xb9')});});}})[_0x0a01('0x20')](respondWithResult(_0x6bdd3d,null))['catch'](handleError(_0x6bdd3d,null));};exports[_0x0a01('0xba')]=function(_0x2bdd88,_0x3b6b07,_0x3663a8){var _0x95b164={};var _0x175f01={};var _0x411ee0;var _0x2382da;return db['SmsAccount'][_0x0a01('0xb5')]({'where':{'id':_0x2bdd88['params']['id']}})['then'](handleEntityNotFound(_0x3b6b07,null))[_0x0a01('0x20')](function(_0x8c466){if(_0x8c466){_0x411ee0=_0x8c466;_0x175f01[_0x0a01('0x43')]=_['keys'](db[_0x0a01('0x72')][_0x0a01('0x41')]);_0x175f01['query']=_[_0x0a01('0x56')](_0x2bdd88['query']);_0x175f01[_0x0a01('0x45')]=_['intersection'](_0x175f01[_0x0a01('0x43')],_0x175f01[_0x0a01('0x44')]);_0x95b164[_0x0a01('0x47')]=_[_0x0a01('0x46')](_0x175f01['model'],qs[_0x0a01('0x48')](_0x2bdd88[_0x0a01('0x44')][_0x0a01('0x48')]));_0x95b164[_0x0a01('0x47')]=_0x95b164[_0x0a01('0x47')][_0x0a01('0x49')]?_0x95b164[_0x0a01('0x47')]:_0x175f01[_0x0a01('0x43')];_0x95b164[_0x0a01('0x67')]=qs[_0x0a01('0x4b')](_0x2bdd88[_0x0a01('0x44')][_0x0a01('0x4b')]);_0x95b164[_0x0a01('0x4e')]=qs[_0x0a01('0x45')](_[_0x0a01('0x4c')](_0x2bdd88['query'],_0x175f01[_0x0a01('0x45')]));if(_0x2bdd88[_0x0a01('0x44')]['filter']){_0x95b164[_0x0a01('0x4e')]=_[_0x0a01('0x4f')](_0x95b164[_0x0a01('0x4e')],{'$or':_['map'](_0x95b164['attributes'],function(_0x4636bd){var _0xc011c7={};_0xc011c7[_0x4636bd]={'$like':'%'+_0x2bdd88[_0x0a01('0x44')][_0x0a01('0x4d')]+'%'};return _0xc011c7;})});}_0x95b164=_[_0x0a01('0x4f')]({},_0x95b164,_0x2bdd88[_0x0a01('0x57')]);return _0x411ee0[_0x0a01('0xba')](_0x95b164);}})[_0x0a01('0x20')](function(_0x18847e){if(_0x18847e){_0x2382da=_0x18847e['length'];if(!_0x2bdd88[_0x0a01('0x44')][_0x0a01('0x4a')](_0x0a01('0x6d'))){_0x95b164[_0x0a01('0x2f')]=qs[_0x0a01('0x2f')](_0x2bdd88[_0x0a01('0x44')][_0x0a01('0x2f')]);_0x95b164[_0x0a01('0x2d')]=qs[_0x0a01('0x2d')](_0x2bdd88[_0x0a01('0x44')][_0x0a01('0x2d')]);}return _0x411ee0['getApplications'](_0x95b164);}})['then'](function(_0xf0fea6){if(_0xf0fea6){return _0xf0fea6?{'count':_0x2382da,'rows':_0xf0fea6}:null;}})[_0x0a01('0x20')](respondWithResult(_0x3b6b07,null))['catch'](handleError(_0x3b6b07,null));};exports[_0x0a01('0xbb')]=function(_0x45701a,_0x35547d,_0x1ad167){var _0x567fc3={'raw':![],'where':{}};var _0x21dfe4={};var _0x89d9c6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x0a01('0xb5')]({'where':{'id':_0x45701a['params']['id']}})['then'](handleEntityNotFound(_0x35547d,null))['then'](function(_0x4aa8f4){if(_0x4aa8f4){_0x21dfe4['model']=_[_0x0a01('0x56')](db[_0x0a01('0x9d')][_0x0a01('0x41')]);_0x21dfe4[_0x0a01('0x44')]=_['keys'](_0x45701a[_0x0a01('0x44')]);_0x21dfe4[_0x0a01('0x45')]=_[_0x0a01('0x46')](_0x21dfe4['model'],_0x21dfe4[_0x0a01('0x44')]);_0x567fc3['attributes']=_[_0x0a01('0x46')](_0x21dfe4[_0x0a01('0x43')],qs[_0x0a01('0x48')](_0x45701a['query'][_0x0a01('0x48')]));_0x567fc3['attributes']=_0x567fc3[_0x0a01('0x47')][_0x0a01('0x49')]?_0x567fc3[_0x0a01('0x47')]:_0x21dfe4['model'];if(!_0x45701a['query'][_0x0a01('0x4a')](_0x0a01('0x6d'))){_0x567fc3[_0x0a01('0x2f')]=qs[_0x0a01('0x2f')](_0x45701a[_0x0a01('0x44')]['limit']);_0x567fc3[_0x0a01('0x2d')]=qs[_0x0a01('0x2d')](_0x45701a['query'][_0x0a01('0x2d')]);}_0x567fc3[_0x0a01('0x67')]=qs['sort'](_0x45701a['query'][_0x0a01('0x4b')]);_0x567fc3[_0x0a01('0x4e')]=qs['filters'](_['pick'](_0x45701a[_0x0a01('0x44')],_0x21dfe4[_0x0a01('0x45')]));_0x567fc3[_0x0a01('0x4e')]['SmsAccountId']=_0x4aa8f4['id'];if(_0x45701a[_0x0a01('0x44')][_0x0a01('0x4d')]){_0x567fc3[_0x0a01('0x4e')]=_[_0x0a01('0x4f')](_0x567fc3['where'],{'$or':_[_0x0a01('0x3f')](_0x567fc3[_0x0a01('0x47')],function(_0x4b3c27){var _0x1e2755={};_0x1e2755[_0x4b3c27]={'$like':'%'+_0x45701a[_0x0a01('0x44')][_0x0a01('0x4d')]+'%'};return _0x1e2755;})});}_0x567fc3=_[_0x0a01('0x4f')]({},_0x567fc3,_0x45701a[_0x0a01('0x57')]);return db['SmsInteraction']['count']({'where':_0x567fc3[_0x0a01('0x4e')]})[_0x0a01('0x20')](function(_0x3e122c){_0x89d9c6[_0x0a01('0x30')]=_0x3e122c;if(_0x45701a['query'][_0x0a01('0x51')]){_0x567fc3[_0x0a01('0x6e')]=[{'model':db['CmContact'],'as':_0x0a01('0xbc'),'required':![]},{'model':db['User'],'as':_0x0a01('0xbd'),'attributes':[_0x0a01('0x3a'),_0x0a01('0xbe'),_0x0a01('0xbf')],'required':![]},{'model':db[_0x0a01('0xc0')],'as':'Tags','attributes':['id','name','color'],'where':_0x45701a[_0x0a01('0x44')]['tag']?{'id':_0x45701a['query'][_0x0a01('0xc1')]}:undefined,'required':_0x45701a[_0x0a01('0x44')][_0x0a01('0xc1')]?!![]:![]}];}return db[_0x0a01('0x9d')][_0x0a01('0x52')](_0x567fc3);})[_0x0a01('0x20')](function(_0x4cf3e8){_0x89d9c6[_0x0a01('0x53')]=_0x4cf3e8;return _0x89d9c6;});}})[_0x0a01('0x20')](respondWithFilteredResult(_0x35547d,_0x567fc3))[_0x0a01('0x28')](handleError(_0x35547d,null));};exports['send']=function(_0x4cff8d,_0x3dfa8f,_0x326f9c){var _0x2344bb,_0x4b084e,_0x5a9688;if(_[_0x0a01('0x92')](_0x4cff8d[_0x0a01('0x5a')][_0x0a01('0x5a')])||_0x4cff8d[_0x0a01('0x5a')]['body']===''){throw new db['Sequelize'][(_0x0a01('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a01('0x92')](_0x4cff8d[_0x0a01('0x5a')]['to'])){throw new db[(_0x0a01('0x78'))][(_0x0a01('0x79'))](_0x0a01('0xc2'));}_0x2344bb=_0x4cff8d[_0x0a01('0x5a')]['to'];return db['SmsAccount'][_0x0a01('0x58')]({'where':{'id':_0x4cff8d[_0x0a01('0x55')]['id']},'include':[{'model':db[_0x0a01('0x97')],'as':_0x0a01('0xc3'),'include':[{'model':db[_0x0a01('0x77')],'as':_0x0a01('0x98'),'where':{'mobile':_0x2344bb},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x0a01('0x20')](handleEntityNotFound(_0x3dfa8f,null))[_0x0a01('0x20')](function(_0x38e63d){if(_0x38e63d&&_0x38e63d[_0x0a01('0xc3')]){_0x4b084e=_0x38e63d[_0x0a01('0x36')]({'plain':!![]});if(_0x4b084e['List']&&_0x4b084e[_0x0a01('0xc3')][_0x0a01('0x98')][_0x0a01('0x49')]){return _0x4b084e[_0x0a01('0xc3')][_0x0a01('0x98')][0x0];}return db[_0x0a01('0x77')][_0x0a01('0x59')](_[_0x0a01('0x9c')](_0x4cff8d[_0x0a01('0x5a')],{'firstName':_0x2344bb,'mobile':_0x2344bb,'phone':_0x2344bb,'ListId':_0x4b084e['ListId']}));}})[_0x0a01('0x20')](handleEntityNotFound(_0x3dfa8f,null))[_0x0a01('0x20')](function(_0x2748bc){if(_0x2748bc){_0x5a9688=_0x2748bc;return db[_0x0a01('0x9d')][_0x0a01('0x58')]({'where':{'ContactId':_0x5a9688['id'],'closed':![],'SmsAccountId':_0x4b084e['id']}})[_0x0a01('0x20')](function(_0x512699){if(_0x512699){return[_0x512699,![]];}return db[_0x0a01('0x9d')]['create']({'UserId':_0x4cff8d[_0x0a01('0x5b')]['id'],'ContactId':_0x5a9688['id'],'SmsAccountId':_0x4b084e['id'],'phone':_0x2344bb,'firstMsgDirection':_0x0a01('0xc4'),'Messages':[_['merge'](_0x4cff8d[_0x0a01('0x5a')],{'read':![],'body':_0x4cff8d[_0x0a01('0x5a')][_0x0a01('0x5a')],'phone':_0x2344bb,'SmsAccountId':_0x4b084e['id'],'UserId':_0x4cff8d[_0x0a01('0x5b')]['id'],'ContactId':_0x5a9688['id']})]},{'include':[{'model':db[_0x0a01('0xa6')],'as':_0x0a01('0xc5')}]})['then'](function(_0x461080){return[_0x461080,!![]];});});}})[_0x0a01('0x9e')](function(_0x141460,_0x162d6b){if(_0x162d6b){return _0x141460;}return db[_0x0a01('0xa6')]['create'](_['merge'](_0x4cff8d[_0x0a01('0x5a')],{'read':![],'body':_0x4cff8d[_0x0a01('0x5a')][_0x0a01('0x5a')],'phone':_0x2344bb,'SmsAccountId':_0x4b084e['id'],'SmsInteractionId':_0x141460['id'],'UserId':_0x4cff8d['user']['id'],'ContactId':_0x5a9688['id']}))[_0x0a01('0x20')](function(_0x2e189f){_0x141460['dataValues'][_0x0a01('0xc5')]=[];_0x141460[_0x0a01('0xc6')]['Messages'][_0x0a01('0xa2')](_0x2e189f[_0x0a01('0xc6')]);return _0x141460;});})[_0x0a01('0x20')](respondWithResult(_0x3dfa8f,null))['catch'](handleError(_0x3dfa8f,null));};exports['status']=function(_0x2af39f,_0x570a27,_0x54df68){if(_0x2af39f['body']['id']){delete _0x2af39f[_0x0a01('0x5a')]['id'];}var _0x45e91b,_0x10b634,_0x2fbecd;return db[_0x0a01('0x40')][_0x0a01('0x58')]({'where':{'id':_0x2af39f['params']['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x570a27,null))[_0x0a01('0x20')](function(_0x3f9ec3){if(_0x3f9ec3){_0x2fbecd=_0x3f9ec3;logger[_0x0a01('0xb1')](_0x0a01('0xaf'),_0x0a01('0x2a'),_0x0a01('0xc7'),_0x3f9ec3['type'],util[_0x0a01('0xc8')](_0x2af39f['body'],{'showHidden':![],'depth':null}));switch(_0x3f9ec3[_0x0a01('0x42')]){case'skebby':if(_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xc9')]&&_0x2af39f[_0x0a01('0x5a')][_0x0a01('0x2a')]){_0x10b634=_0x2af39f[_0x0a01('0x5a')]['status'];return db[_0x0a01('0xa6')][_0x0a01('0x58')]({'where':{'messageId':_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xc9')]}});}break;case _0x0a01('0x87'):if(_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xca')]&&_0x2af39f['body'][_0x0a01('0xcb')]){_0x10b634=_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xcb')];return db[_0x0a01('0xa6')]['find']({'where':{'messageId':_0x2af39f[_0x0a01('0x5a')]['requestid']}});}break;case _0x0a01('0xcc'):if(_0x2af39f['body'][_0x0a01('0x89')]&&_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xcd')]){_0x10b634=_0x2af39f['body'][_0x0a01('0xcd')];return db[_0x0a01('0xa6')][_0x0a01('0x58')]({'where':{'messageId':_0x2af39f['body'][_0x0a01('0x89')]}});}break;case _0x0a01('0x8c'):var _0x569d39=_0x2af39f[_0x0a01('0x5a')][_0x0a01('0x8d')][0x0];if(_0x569d39[_0x0a01('0x83')]&&_0x569d39['status'][_0x0a01('0xce')]===_0x0a01('0xcf')){_0x10b634=_0x569d39[_0x0a01('0x2a')][_0x0a01('0xce')];return db[_0x0a01('0xa6')][_0x0a01('0x58')]({'where':{'messageId':_0x569d39['messageId']}});}break;case'clickatell':if(_0x2af39f[_0x0a01('0x5a')][_0x0a01('0x83')]&&_0x2af39f['body'][_0x0a01('0x2a')]){_0x10b634=_0x2af39f[_0x0a01('0x5a')][_0x0a01('0x2a')];return db[_0x0a01('0xa6')][_0x0a01('0x58')]({'where':{'messageId':_0x2af39f[_0x0a01('0x5a')][_0x0a01('0x83')]}});}break;case _0x0a01('0xd0'):if(_0x2af39f[_0x0a01('0x5a')][0x0]['message']['id']){_0x10b634=_0x2af39f['body'][0x0][_0x0a01('0x42')];return db['SmsMessage'][_0x0a01('0x58')]({'where':{'messageId':_0x2af39f[_0x0a01('0x5a')][0x0][_0x0a01('0x25')]['id']}});}break;case _0x0a01('0xd1'):if(_0x2af39f[_0x0a01('0x5a')]['redif']&&_0x2af39f[_0x0a01('0x5a')]['status']){_0x10b634=_0x2af39f[_0x0a01('0x5a')][_0x0a01('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xd2')]}});}break;}}})['then'](handleEntityNotFound(_0x570a27,null))[_0x0a01('0x20')](function(_0xa2946f){if(_0xa2946f){_0x45e91b=_0xa2946f;switch(_0x2fbecd[_0x0a01('0x42')]){case _0x0a01('0x84'):if(_0x10b634===_0x0a01('0xcf')){return _0x45e91b[_0x0a01('0x61')]({'read':!![]});}else{logger[_0x0a01('0x24')](_0x0a01('0xaf'),'status',_0x0a01('0x84'),util[_0x0a01('0xc8')](_0x2af39f[_0x0a01('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0a01('0x87'):if(_0x10b634==='1'){return _0x45e91b['update']({'read':!![]});}else{logger[_0x0a01('0x24')](_0x0a01('0xaf'),_0x0a01('0x2a'),_0x0a01('0x84'),util['inspect'](_0x2af39f['body'],{'showHidden':![],'depth':null}));}break;case _0x0a01('0xcc'):if(!_0x2af39f[_0x0a01('0x5a')][_0x0a01('0xd3')]&&_0x10b634>=0xc8&&_0x10b634<=0xce){return _0x45e91b[_0x0a01('0x61')]({'read':!![]});}else{logger[_0x0a01('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0a01('0x2a'),_0x0a01('0xcc'),util[_0x0a01('0xc8')](_0x2af39f[_0x0a01('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0a01('0x8c'):var _0x441c8b=_0x2af39f['body']['results'][0x0];if(_0x441c8b[_0x0a01('0x2a')]['groupName']===_0x0a01('0xcf')){return _0x45e91b['update']({'read':!![]});}else{logger[_0x0a01('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0a01('0x8c'),util[_0x0a01('0xc8')](_0x2af39f[_0x0a01('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x10b634==_0x0a01('0xd4')||_0x10b634==_0x0a01('0xd5')){return _0x45e91b[_0x0a01('0x61')]({'read':!![]});}else{logger['error'](_0x0a01('0xaf'),_0x0a01('0x2a'),_0x0a01('0xd6'),util[_0x0a01('0xc8')](_0x2af39f[_0x0a01('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x0a01('0xd0'):if(_0x10b634==_0x0a01('0xd7')){return _0x45e91b[_0x0a01('0x61')]({'read':!![]});}else{logger['error'](_0x0a01('0xaf'),_0x0a01('0x2a'),_0x0a01('0xd0'),util[_0x0a01('0xc8')](_0x2af39f['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x10b634===_0x0a01('0xd8')||_0x10b634===_0x0a01('0xd9')){return _0x45e91b['update']({'read':!![]});}else{logger[_0x0a01('0x24')](_0x0a01('0xaf'),'status',_0x0a01('0xd1'),util[_0x0a01('0xc8')](_0x2af39f['body'],{'showHidden':![],'depth':null}));}break;}return _0x45e91b;}})[_0x0a01('0x20')](respondWithResult(_0x570a27,null))[_0x0a01('0x28')](handleError(_0x570a27,null));};exports[_0x0a01('0xda')]=function(_0x884f0b,_0x1cdd23,_0x538440){var _0x24b7a3,_0x549255,_0x19a7b4;return db[_0x0a01('0x40')][_0x0a01('0x58')]({'where':{'id':_0x884f0b['params']['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x1cdd23,null))['then'](function(_0x59c4d6){if(_0x59c4d6){_0x19a7b4=_0x59c4d6;logger[_0x0a01('0xb1')](_0x0a01('0xaf'),_0x0a01('0x2a'),'received\x20delivery\x20report\x20from',_0x59c4d6[_0x0a01('0x42')],util[_0x0a01('0xc8')](_0x884f0b[_0x0a01('0x44')],{'showHidden':![],'depth':null}));switch(_0x59c4d6[_0x0a01('0x42')]){case'csc':if(_0x884f0b[_0x0a01('0x44')][_0x0a01('0xdb')]&&_0x884f0b[_0x0a01('0x44')]['state']){_0x549255=_0x884f0b[_0x0a01('0x44')][_0x0a01('0xdc')];return db[_0x0a01('0xa6')][_0x0a01('0x58')]({'where':{'messageId':_0x884f0b['query']['message-id']}});}break;}}})[_0x0a01('0x20')](handleEntityNotFound(_0x1cdd23,null))[_0x0a01('0x20')](function(_0x5d7d06){if(_0x5d7d06){_0x24b7a3=_0x5d7d06;switch(_0x19a7b4[_0x0a01('0x42')]){case _0x0a01('0x8e'):if(_0x549255==='2'||_0x549255==='6'){return _0x24b7a3[_0x0a01('0x61')]({'read':!![]});}else{logger['error'](_0x0a01('0xaf'),_0x0a01('0x2a'),_0x0a01('0x8e'),util[_0x0a01('0xc8')](_0x884f0b[_0x0a01('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x24b7a3;}})[_0x0a01('0x20')](respondWithResult(_0x1cdd23,null))['catch'](handleError(_0x1cdd23,null));};exports['addAgents']=function(_0x14ae33,_0x3f8491,_0x445064){return db['SmsAccount'][_0x0a01('0x58')]({'where':{'id':_0x14ae33[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x3f8491,null))['then'](function(_0x1a5c0a){if(_0x1a5c0a){return _0x1a5c0a[_0x0a01('0xdd')](_0x14ae33[_0x0a01('0x5a')][_0x0a01('0x69')],_[_0x0a01('0x9b')](_0x14ae33['body'],['ids','id'])||{})[_0x0a01('0x9e')](function(_0xb687a5){for(var _0x509ef0=0x0;_0x509ef0<_0x14ae33[_0x0a01('0x5a')][_0x0a01('0x69')]['length'];_0x509ef0+=0x1){socket['emit'](_0x0a01('0xde'),{'UserId':Number(_0x14ae33[_0x0a01('0x5a')][_0x0a01('0x69')][_0x509ef0]),'SmsAccountId':Number(_0x14ae33[_0x0a01('0x55')]['id'])});}return _0xb687a5;});}})[_0x0a01('0x20')](respondWithResult(_0x3f8491,null))[_0x0a01('0x28')](handleError(_0x3f8491,null));};exports[_0x0a01('0xdf')]=function(_0x5527ed,_0x361b5f,_0x5aa1de){return db[_0x0a01('0x40')]['find']({'where':{'id':_0x5527ed[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x361b5f,null))['then'](function(_0x4f0055){if(_0x4f0055){return _0x4f0055[_0x0a01('0xdf')](_0x5527ed[_0x0a01('0x44')]['ids'])[_0x0a01('0x20')](function(){if(_[_0x0a01('0xe0')](_0x5527ed['query'][_0x0a01('0x69')])){for(var _0x3d5210=0x0;_0x3d5210<_0x5527ed['query']['ids'][_0x0a01('0x49')];_0x3d5210+=0x1){socket[_0x0a01('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x5527ed['query'][_0x0a01('0x69')][_0x3d5210]),'SmsAccountId':Number(_0x5527ed[_0x0a01('0x55')]['id'])});}}else{socket[_0x0a01('0xe1')](_0x0a01('0xe2'),{'UserId':Number(_0x5527ed[_0x0a01('0x44')][_0x0a01('0x69')]),'SmsAccountId':Number(_0x5527ed[_0x0a01('0x55')]['id'])});}});}})[_0x0a01('0x20')](respondWithStatusCode(_0x361b5f,null))[_0x0a01('0x28')](handleError(_0x361b5f,null));};exports[_0x0a01('0xe3')]=function(_0x4d60d5,_0x44b824,_0x229113){var _0x66c5cf={};var _0x1bb5e5={};var _0x33660e;var _0x48c7b2;return db[_0x0a01('0x40')]['findOne']({'where':{'id':_0x4d60d5[_0x0a01('0x55')]['id']}})[_0x0a01('0x20')](handleEntityNotFound(_0x44b824,null))[_0x0a01('0x20')](function(_0x5ea540){if(_0x5ea540){_0x33660e=_0x5ea540;_0x1bb5e5[_0x0a01('0x43')]=_[_0x0a01('0x56')](db[_0x0a01('0xe4')][_0x0a01('0x41')]);_0x1bb5e5['query']=_[_0x0a01('0x56')](_0x4d60d5['query']);_0x1bb5e5[_0x0a01('0x45')]=_['intersection'](_0x1bb5e5['model'],_0x1bb5e5[_0x0a01('0x44')]);_0x66c5cf[_0x0a01('0x47')]=_[_0x0a01('0x46')](_0x1bb5e5[_0x0a01('0x43')],qs[_0x0a01('0x48')](_0x4d60d5[_0x0a01('0x44')][_0x0a01('0x48')]));_0x66c5cf[_0x0a01('0x47')]=_0x66c5cf['attributes'][_0x0a01('0x49')]?_0x66c5cf[_0x0a01('0x47')]:_0x1bb5e5['model'];_0x66c5cf['order']=qs[_0x0a01('0x4b')](_0x4d60d5[_0x0a01('0x44')][_0x0a01('0x4b')]);_0x66c5cf[_0x0a01('0x4e')]=qs[_0x0a01('0x45')](_[_0x0a01('0x4c')](_0x4d60d5[_0x0a01('0x44')],_0x1bb5e5[_0x0a01('0x45')]));if(_0x4d60d5['query'][_0x0a01('0x4d')]){_0x66c5cf['where']=_[_0x0a01('0x4f')](_0x66c5cf[_0x0a01('0x4e')],{'$or':_['map'](_0x66c5cf[_0x0a01('0x47')],function(_0x25ef6a){var _0x402ae8={};_0x402ae8[_0x25ef6a]={'$like':'%'+_0x4d60d5[_0x0a01('0x44')][_0x0a01('0x4d')]+'%'};return _0x402ae8;})});}_0x66c5cf=_[_0x0a01('0x4f')]({},_0x66c5cf,_0x4d60d5[_0x0a01('0x57')]);return _0x33660e[_0x0a01('0xe3')](_0x66c5cf);}})['then'](function(_0x24174e){if(_0x24174e){_0x48c7b2=_0x24174e[_0x0a01('0x49')];if(!_0x4d60d5['query'][_0x0a01('0x4a')](_0x0a01('0x6d'))){_0x66c5cf[_0x0a01('0x2f')]=qs[_0x0a01('0x2f')](_0x4d60d5[_0x0a01('0x44')][_0x0a01('0x2f')]);_0x66c5cf['offset']=qs[_0x0a01('0x2d')](_0x4d60d5['query'][_0x0a01('0x2d')]);}return _0x33660e[_0x0a01('0xe3')](_0x66c5cf);}})['then'](function(_0x3004cc){if(_0x3004cc){return _0x3004cc?{'count':_0x48c7b2,'rows':_0x3004cc}:null;}})[_0x0a01('0x20')](respondWithResult(_0x44b824,null))[_0x0a01('0x28')](handleError(_0x44b824,null));}; \ No newline at end of file +var _0x9958=['receiveMessage','entity\x20found','stringify','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../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','./smsAccount.socket','register','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','SmsAccount','findAll','rows','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','messageId','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','startRouting'];(function(_0xab39a8,_0x573d91){var _0x4ccf16=function(_0x2be5cb){while(--_0x2be5cb){_0xab39a8['push'](_0xab39a8['shift']());}};_0x4ccf16(++_0x573d91);}(_0x9958,0x110));var _0x8995=function(_0x30d7f5,_0x2417e6){_0x30d7f5=_0x30d7f5-0x0;var _0x59abfe=_0x9958[_0x30d7f5];return _0x59abfe;};'use strict';var emlformat=require(_0x8995('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8995('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8995('0x2'));var BPromise=require(_0x8995('0x3'));var Mustache=require(_0x8995('0x4'));var util=require('util');var path=require(_0x8995('0x5'));var sox=require(_0x8995('0x6'));var csv=require(_0x8995('0x7'));var ejs=require(_0x8995('0x8'));var fs=require('fs');var fs_extra=require(_0x8995('0x9'));var _=require(_0x8995('0xa'));var squel=require(_0x8995('0xb'));var crypto=require('crypto');var jsforce=require(_0x8995('0xc'));var deskjs=require(_0x8995('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8995('0xe'));var qs=require(_0x8995('0xf'));var as=require(_0x8995('0x10'));var hardwareService=require(_0x8995('0x11'));var logger=require(_0x8995('0x12'))(_0x8995('0x13'));var utils=require(_0x8995('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8995('0x15'));var db=require(_0x8995('0x16'))['db'];config[_0x8995('0x17')]=_[_0x8995('0x18')](config[_0x8995('0x17')],{'host':_0x8995('0x19'),'port':0x18eb});var socket=require(_0x8995('0x1a'))(new Redis(config['redis']));require(_0x8995('0x1b'))[_0x8995('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8995('0x1d')][_0x8995('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x51ba7b,_0x5bff07,_0x3915aa,_0x487f51){return new BPromise(function(_0x3593e7,_0x349386){var _0xc883ac=_0x487f51||client;return _0xc883ac[_0x8995('0x1f')](_0x51ba7b,_0x3915aa)[_0x8995('0x20')](function(_0x3501df){logger[_0x8995('0x21')](_0x8995('0x22'),_0x5bff07,_0x8995('0x23'));logger[_0x8995('0x24')](_0x8995('0x25'),_0x5bff07,'request\x20sent',JSON['stringify'](_0x3501df));if(_0x3501df[_0x8995('0x26')]){if(_0x3501df[_0x8995('0x26')][_0x8995('0x27')]===0x1f4){logger[_0x8995('0x26')](_0x8995('0x22'),_0x5bff07,_0x3501df[_0x8995('0x26')][_0x8995('0x28')]);return _0x349386(_0x3501df['error']['message']);}logger['error'](_0x8995('0x22'),_0x5bff07,_0x3501df[_0x8995('0x26')][_0x8995('0x28')]);return _0x3593e7(_0x3501df[_0x8995('0x26')]['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x5bff07,'request\x20sent');_0x3593e7(_0x3501df['result'][_0x8995('0x28')]);}})[_0x8995('0x29')](function(_0x371434){logger[_0x8995('0x26')](_0x8995('0x22'),_0x5bff07,_0x371434);_0x349386(_0x371434);});});}function respondWithStatusCode(_0x4a304b,_0x5fb4ea){_0x5fb4ea=_0x5fb4ea||0xcc;return function(_0x216f5a){if(_0x216f5a){return _0x4a304b['sendStatus'](_0x5fb4ea);}return _0x4a304b[_0x8995('0x2a')](_0x5fb4ea)[_0x8995('0x2b')]();};}function respondWithResult(_0x55b590,_0x41ac38){_0x41ac38=_0x41ac38||0xc8;return function(_0x4dba8a){if(_0x4dba8a){return _0x55b590[_0x8995('0x2a')](_0x41ac38)[_0x8995('0x2c')](_0x4dba8a);}};}function respondWithFilteredResult(_0x57f9ea,_0x1cf5c0){return function(_0x3c944a){if(_0x3c944a){var _0x593409=typeof _0x1cf5c0[_0x8995('0x2d')]===_0x8995('0x2e')&&typeof _0x1cf5c0[_0x8995('0x2f')]==='undefined';var _0x33e886=_0x3c944a[_0x8995('0x30')];var _0xa0b649=_0x593409?0x0:_0x1cf5c0[_0x8995('0x2d')];var _0x4c1bcb=_0x593409?_0x3c944a[_0x8995('0x30')]:_0x1cf5c0[_0x8995('0x2d')]+_0x1cf5c0['limit'];var _0x1e6ddc;if(_0x4c1bcb>=_0x33e886){_0x4c1bcb=_0x33e886;_0x1e6ddc=0xc8;}else{_0x1e6ddc=0xce;}_0x57f9ea[_0x8995('0x2a')](_0x1e6ddc);return _0x57f9ea[_0x8995('0x31')](_0x8995('0x32'),_0xa0b649+'-'+_0x4c1bcb+'/'+_0x33e886)['json'](_0x3c944a);}return null;};}function patchUpdates(_0x314a5a){return function(_0x22183e){try{jsonpatch[_0x8995('0x33')](_0x22183e,_0x314a5a,!![]);}catch(_0x486fd8){return BPromise[_0x8995('0x34')](_0x486fd8);}return _0x22183e[_0x8995('0x35')]();};}function saveUpdates(_0x6a0dcb,_0x361b65){return function(_0xbd553c){if(_0xbd553c){return _0xbd553c[_0x8995('0x36')](_0x6a0dcb)['then'](function(_0x131ea2){return _0x131ea2;});}return null;};}function removeEntity(_0x2b29b6,_0x1b1672){return function(_0x416eb1){if(_0x416eb1){return _0x416eb1[_0x8995('0x37')]()[_0x8995('0x20')](function(){var _0x2b222a=_0x416eb1[_0x8995('0x38')]({'plain':!![]});var _0x47af18=_0x8995('0x39');return db[_0x8995('0x3a')][_0x8995('0x37')]({'where':{'type':_0x47af18,'resourceId':_0x2b222a['id']}})[_0x8995('0x20')](function(){return _0x416eb1;});})[_0x8995('0x20')](function(){_0x2b29b6['status'](0xcc)[_0x8995('0x2b')]();});}};}function handleEntityNotFound(_0x10ec6d,_0x4564c1){return function(_0x448aa7){if(!_0x448aa7){_0x10ec6d[_0x8995('0x3b')](0x194);}return _0x448aa7;};}function handleError(_0x949cc6,_0xca9667){_0xca9667=_0xca9667||0x1f4;return function(_0xbbb93f){logger[_0x8995('0x26')](_0xbbb93f[_0x8995('0x3c')]);if(_0xbbb93f[_0x8995('0x3d')]){delete _0xbbb93f['name'];}_0x949cc6[_0x8995('0x2a')](_0xca9667)[_0x8995('0x3e')](_0xbbb93f);};}exports['index']=function(_0x30d458,_0x543f86){var _0x401973={'include':[{'model':db[_0x8995('0x3f')],'as':_0x8995('0x40')}]},_0x2d86c9={},_0x31cf6d={'count':0x0,'rows':[]};var _0x5aa674=_[_0x8995('0x41')](db['SmsAccount'][_0x8995('0x42')],function(_0xccd511){return{'name':_0xccd511[_0x8995('0x43')],'type':_0xccd511[_0x8995('0x44')]['key']};});_0x2d86c9[_0x8995('0x45')]=_[_0x8995('0x41')](_0x5aa674,'name');_0x2d86c9[_0x8995('0x46')]=_[_0x8995('0x47')](_0x30d458[_0x8995('0x46')]);_0x2d86c9['filters']=_[_0x8995('0x48')](_0x2d86c9[_0x8995('0x45')],_0x2d86c9[_0x8995('0x46')]);_0x401973[_0x8995('0x49')]=_[_0x8995('0x48')](_0x2d86c9[_0x8995('0x45')],qs[_0x8995('0x4a')](_0x30d458[_0x8995('0x46')][_0x8995('0x4a')]));_0x401973[_0x8995('0x49')]=_0x401973['attributes'][_0x8995('0x4b')]?_0x401973['attributes']:_0x2d86c9['model'];if(!_0x30d458['query'][_0x8995('0x4c')](_0x8995('0x4d'))){_0x401973[_0x8995('0x2f')]=qs[_0x8995('0x2f')](_0x30d458[_0x8995('0x46')][_0x8995('0x2f')]);_0x401973[_0x8995('0x2d')]=qs['offset'](_0x30d458[_0x8995('0x46')][_0x8995('0x2d')]);}_0x401973[_0x8995('0x4e')]=qs[_0x8995('0x4f')](_0x30d458[_0x8995('0x46')]['sort']);_0x401973['where']=qs[_0x8995('0x50')](_[_0x8995('0x51')](_0x30d458[_0x8995('0x46')],_0x2d86c9[_0x8995('0x50')]),_0x5aa674);if(_0x30d458[_0x8995('0x46')][_0x8995('0x52')]){_0x401973[_0x8995('0x53')]=_[_0x8995('0x54')](_0x401973[_0x8995('0x53')],{'$or':_['map'](_0x5aa674,function(_0x5303a3){if(_0x5303a3[_0x8995('0x44')]!==_0x8995('0x55')){var _0x59330b={};_0x59330b[_0x5303a3[_0x8995('0x3d')]]={'$like':'%'+_0x30d458[_0x8995('0x46')][_0x8995('0x52')]+'%'};return _0x59330b;}})});}_0x401973=_['merge']({},_0x401973,_0x30d458[_0x8995('0x56')]);var _0x13f319={'where':_0x401973[_0x8995('0x53')]};return db['SmsAccount'][_0x8995('0x30')](_0x13f319)['then'](function(_0x5ef844){_0x31cf6d[_0x8995('0x30')]=_0x5ef844;if(_0x30d458[_0x8995('0x46')][_0x8995('0x57')]){_0x401973[_0x8995('0x58')]=[{'all':!![]}];}return db[_0x8995('0x59')][_0x8995('0x5a')](_0x401973);})[_0x8995('0x20')](function(_0x514d6c){_0x31cf6d[_0x8995('0x5b')]=_0x514d6c;return _0x31cf6d;})[_0x8995('0x20')](respondWithFilteredResult(_0x543f86,_0x401973))[_0x8995('0x29')](handleError(_0x543f86,null));};exports['show']=function(_0x2806ee,_0xd9952a){var _0x2e1173={'raw':![],'where':{'id':_0x2806ee[_0x8995('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0x8995('0x40')}]},_0x2e4365={};_0x2e4365['model']=_[_0x8995('0x47')](db[_0x8995('0x59')]['rawAttributes']);_0x2e4365[_0x8995('0x46')]=_[_0x8995('0x47')](_0x2806ee['query']);_0x2e4365[_0x8995('0x50')]=_[_0x8995('0x48')](_0x2e4365[_0x8995('0x45')],_0x2e4365[_0x8995('0x46')]);_0x2e1173[_0x8995('0x49')]=_['intersection'](_0x2e4365[_0x8995('0x45')],qs[_0x8995('0x4a')](_0x2806ee[_0x8995('0x46')][_0x8995('0x4a')]));_0x2e1173[_0x8995('0x49')]=_0x2e1173[_0x8995('0x49')]['length']?_0x2e1173['attributes']:_0x2e4365[_0x8995('0x45')];if(_0x2806ee[_0x8995('0x46')][_0x8995('0x57')]){_0x2e1173['include']=[{'all':!![]}];}_0x2e1173=_[_0x8995('0x54')]({},_0x2e1173,_0x2806ee[_0x8995('0x56')]);return db[_0x8995('0x59')]['find'](_0x2e1173)[_0x8995('0x20')](handleEntityNotFound(_0xd9952a,null))[_0x8995('0x20')](respondWithResult(_0xd9952a,null))[_0x8995('0x29')](handleError(_0xd9952a,null));};exports[_0x8995('0x5d')]=function(_0x2ecc54,_0x196a7a){return db['SmsAccount'][_0x8995('0x5d')](_0x2ecc54[_0x8995('0x5e')],{})[_0x8995('0x20')](function(_0x5ef98c){var _0x8ce2af=_0x2ecc54['user'][_0x8995('0x38')]({'plain':!![]});if(!_0x8ce2af)throw new Error(_0x8995('0x5f'));if(_0x8ce2af['role']===_0x8995('0x60')){var _0x3338c9=_0x5ef98c[_0x8995('0x38')]({'plain':!![]});var _0x41da10=_0x8995('0x39');return db[_0x8995('0x61')][_0x8995('0x62')]({'where':{'name':_0x41da10,'userProfileId':_0x8ce2af[_0x8995('0x63')]},'raw':!![]})[_0x8995('0x20')](function(_0x42045c){if(_0x42045c&&_0x42045c[_0x8995('0x64')]===0x0){return db[_0x8995('0x3a')]['create']({'name':_0x3338c9[_0x8995('0x3d')],'resourceId':_0x3338c9['id'],'type':_0x42045c[_0x8995('0x3d')],'sectionId':_0x42045c['id']},{})[_0x8995('0x20')](function(){return _0x5ef98c;});}else{return _0x5ef98c;}})['catch'](function(_0x46568c){logger[_0x8995('0x26')](_0x8995('0x65'),_0x46568c);throw _0x46568c;});}return _0x5ef98c;})[_0x8995('0x20')](respondWithResult(_0x196a7a,0xc9))[_0x8995('0x29')](handleError(_0x196a7a,null));};exports[_0x8995('0x36')]=function(_0x1e704d,_0x2eed21){if(_0x1e704d[_0x8995('0x5e')]['id']){delete _0x1e704d[_0x8995('0x5e')]['id'];}return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0x1e704d[_0x8995('0x5c')]['id']},'include':[{'model':db[_0x8995('0x3f')],'as':_0x8995('0x40')}]})['then'](handleEntityNotFound(_0x2eed21,null))['then'](saveUpdates(_0x1e704d[_0x8995('0x5e')],null))[_0x8995('0x20')](respondWithResult(_0x2eed21,null))[_0x8995('0x29')](handleError(_0x2eed21,null));};exports[_0x8995('0x37')]=function(_0x230b67,_0x4e6297){return db['SmsAccount']['find']({'where':{'id':_0x230b67['params']['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x4e6297,null))[_0x8995('0x20')](removeEntity(_0x4e6297,null))[_0x8995('0x29')](handleError(_0x4e6297,null));};exports['describe']=function(_0x9e8c4f,_0x5c8410){return db[_0x8995('0x59')][_0x8995('0x66')]()[_0x8995('0x20')](respondWithResult(_0x5c8410,null))[_0x8995('0x29')](handleError(_0x5c8410,null));};exports[_0x8995('0x67')]=function(_0x45cd84,_0xbed8,_0xd100ec){if(_0x45cd84[_0x8995('0x5e')]['id']){delete _0x45cd84[_0x8995('0x5e')]['id'];}return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0x45cd84[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0xbed8,null))[_0x8995('0x20')](function(_0x5f44b1){if(_0x5f44b1){_0x45cd84[_0x8995('0x5e')][_0x8995('0x68')]=_0x5f44b1['id'];return db['Disposition'][_0x8995('0x5d')](_0x45cd84[_0x8995('0x5e')]);}})['then'](respondWithResult(_0xbed8,null))['catch'](handleError(_0xbed8,null));};exports[_0x8995('0x69')]=function(_0x259feb,_0x238904,_0x16a4de){var _0x1bdd00={'raw':![],'where':{}};var _0x2cf18f={};var _0x681902={'count':0x0,'rows':[]};return db[_0x8995('0x59')][_0x8995('0x6a')]({'where':{'id':_0x259feb[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x238904,null))[_0x8995('0x20')](function(_0x3451ca){if(_0x3451ca){_0x2cf18f[_0x8995('0x45')]=_[_0x8995('0x47')](db['Disposition']['rawAttributes']);_0x2cf18f[_0x8995('0x46')]=_[_0x8995('0x47')](_0x259feb[_0x8995('0x46')]);_0x2cf18f[_0x8995('0x50')]=_[_0x8995('0x48')](_0x2cf18f['model'],_0x2cf18f[_0x8995('0x46')]);_0x1bdd00[_0x8995('0x49')]=_[_0x8995('0x48')](_0x2cf18f[_0x8995('0x45')],qs[_0x8995('0x4a')](_0x259feb[_0x8995('0x46')]['fields']));_0x1bdd00[_0x8995('0x49')]=_0x1bdd00[_0x8995('0x49')][_0x8995('0x4b')]?_0x1bdd00[_0x8995('0x49')]:_0x2cf18f['model'];if(!_0x259feb[_0x8995('0x46')]['hasOwnProperty'](_0x8995('0x4d'))){_0x1bdd00[_0x8995('0x2f')]=qs[_0x8995('0x2f')](_0x259feb[_0x8995('0x46')]['limit']);_0x1bdd00[_0x8995('0x2d')]=qs[_0x8995('0x2d')](_0x259feb[_0x8995('0x46')][_0x8995('0x2d')]);}_0x1bdd00['order']=qs['sort'](_0x259feb[_0x8995('0x46')][_0x8995('0x4f')]);_0x1bdd00['where']=qs['filters'](_['pick'](_0x259feb[_0x8995('0x46')],_0x2cf18f[_0x8995('0x50')]));_0x1bdd00[_0x8995('0x53')][_0x8995('0x68')]=_0x3451ca['id'];if(_0x259feb[_0x8995('0x46')]['filter']){_0x1bdd00[_0x8995('0x53')]=_[_0x8995('0x54')](_0x1bdd00[_0x8995('0x53')],{'$or':_[_0x8995('0x41')](_0x1bdd00['attributes'],function(_0x2bc0ae){var _0x139cab={};_0x139cab[_0x2bc0ae]={'$like':'%'+_0x259feb['query']['filter']+'%'};return _0x139cab;})});}_0x1bdd00=_[_0x8995('0x54')]({},_0x1bdd00,_0x259feb[_0x8995('0x56')]);return db[_0x8995('0x6b')][_0x8995('0x30')]({'where':_0x1bdd00[_0x8995('0x53')]})['then'](function(_0x54213f){_0x681902[_0x8995('0x30')]=_0x54213f;if(_0x259feb[_0x8995('0x46')][_0x8995('0x57')]){_0x1bdd00[_0x8995('0x58')]=[{'all':!![]}];}return db[_0x8995('0x6b')][_0x8995('0x5a')](_0x1bdd00);})[_0x8995('0x20')](function(_0x4caea8){_0x681902[_0x8995('0x5b')]=_0x4caea8;return _0x681902;});}})['then'](respondWithFilteredResult(_0x238904,_0x1bdd00))['catch'](handleError(_0x238904,null));};exports['removeDispositions']=function(_0x2dbbd7,_0x451120,_0x42157e){return db[_0x8995('0x59')]['find']({'where':{'id':_0x2dbbd7['params']['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x451120,null))[_0x8995('0x20')](function(_0x31e27b){if(_0x31e27b){return _0x31e27b[_0x8995('0x6c')](_0x2dbbd7['query'][_0x8995('0x6d')]);}})[_0x8995('0x20')](respondWithStatusCode(_0x451120,null))[_0x8995('0x29')](handleError(_0x451120,null));};exports[_0x8995('0x6e')]=function(_0x547ba6,_0x598791,_0x124d5b){if(_0x547ba6[_0x8995('0x5e')]['id']){delete _0x547ba6[_0x8995('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x547ba6['params']['id']}})['then'](handleEntityNotFound(_0x598791,null))['then'](function(_0x1e0672){if(_0x1e0672){_0x547ba6[_0x8995('0x5e')]['SmsAccountId']=_0x1e0672['id'];return db[_0x8995('0x6f')][_0x8995('0x5d')](_0x547ba6[_0x8995('0x5e')]);}})[_0x8995('0x20')](respondWithResult(_0x598791,null))[_0x8995('0x29')](handleError(_0x598791,null));};exports['getAnswers']=function(_0x384ee8,_0x59fdb7,_0x23a736){var _0x1456ee={'raw':![],'where':{}};var _0x4c9080={};var _0x57d833={'count':0x0,'rows':[]};return db[_0x8995('0x59')][_0x8995('0x6a')]({'where':{'id':_0x384ee8['params']['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x59fdb7,null))[_0x8995('0x20')](function(_0x16d301){if(_0x16d301){_0x4c9080[_0x8995('0x45')]=_['keys'](db[_0x8995('0x6f')][_0x8995('0x42')]);_0x4c9080['query']=_['keys'](_0x384ee8[_0x8995('0x46')]);_0x4c9080[_0x8995('0x50')]=_[_0x8995('0x48')](_0x4c9080['model'],_0x4c9080[_0x8995('0x46')]);_0x1456ee[_0x8995('0x49')]=_['intersection'](_0x4c9080[_0x8995('0x45')],qs[_0x8995('0x4a')](_0x384ee8[_0x8995('0x46')][_0x8995('0x4a')]));_0x1456ee[_0x8995('0x49')]=_0x1456ee[_0x8995('0x49')][_0x8995('0x4b')]?_0x1456ee['attributes']:_0x4c9080[_0x8995('0x45')];if(!_0x384ee8[_0x8995('0x46')][_0x8995('0x4c')](_0x8995('0x4d'))){_0x1456ee[_0x8995('0x2f')]=qs['limit'](_0x384ee8[_0x8995('0x46')]['limit']);_0x1456ee['offset']=qs[_0x8995('0x2d')](_0x384ee8[_0x8995('0x46')]['offset']);}_0x1456ee[_0x8995('0x4e')]=qs['sort'](_0x384ee8['query'][_0x8995('0x4f')]);_0x1456ee[_0x8995('0x53')]=qs['filters'](_['pick'](_0x384ee8[_0x8995('0x46')],_0x4c9080[_0x8995('0x50')]));_0x1456ee[_0x8995('0x53')][_0x8995('0x68')]=_0x16d301['id'];if(_0x384ee8[_0x8995('0x46')][_0x8995('0x52')]){_0x1456ee[_0x8995('0x53')]=_['merge'](_0x1456ee['where'],{'$or':_[_0x8995('0x41')](_0x1456ee['attributes'],function(_0x52dc18){var _0x5ed45b={};_0x5ed45b[_0x52dc18]={'$like':'%'+_0x384ee8['query'][_0x8995('0x52')]+'%'};return _0x5ed45b;})});}_0x1456ee=_[_0x8995('0x54')]({},_0x1456ee,_0x384ee8[_0x8995('0x56')]);return db[_0x8995('0x6f')][_0x8995('0x30')]({'where':_0x1456ee[_0x8995('0x53')]})[_0x8995('0x20')](function(_0x58b88f){_0x57d833['count']=_0x58b88f;if(_0x384ee8[_0x8995('0x46')][_0x8995('0x57')]){_0x1456ee[_0x8995('0x58')]=[{'all':!![]}];}return db[_0x8995('0x6f')][_0x8995('0x5a')](_0x1456ee);})['then'](function(_0x45c384){_0x57d833[_0x8995('0x5b')]=_0x45c384;return _0x57d833;});}})[_0x8995('0x20')](respondWithFilteredResult(_0x59fdb7,_0x1456ee))['catch'](handleError(_0x59fdb7,null));};exports[_0x8995('0x70')]=function(_0x4cfba7,_0x25272b,_0x2028ac){return db['SmsAccount'][_0x8995('0x62')]({'where':{'id':_0x4cfba7[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x25272b,null))[_0x8995('0x20')](function(_0x3c4bba){if(_0x3c4bba){return _0x3c4bba[_0x8995('0x70')](_0x4cfba7[_0x8995('0x46')][_0x8995('0x6d')]);}})['then'](respondWithStatusCode(_0x25272b,null))[_0x8995('0x29')](handleError(_0x25272b,null));};exports['notify']=function(_0x1c2606,_0x3acc70,_0x48331c){var _0x2ae6b8={'channel':'sms'};var _0x35ca08=[];var _0x3cd0c3=[];var _0x5eb53a={};return db['SmsAccount'][_0x8995('0x62')]({'where':{'id':_0x1c2606['params']['id']},'include':[{'model':db[_0x8995('0x71')],'as':_0x8995('0x72')}]})['then'](handleEntityNotFound(_0x3acc70,null))['then'](function(_0x710ee9){_0x2ae6b8['account']=_0x710ee9;_0x2ae6b8[_0x8995('0x73')]=_[_0x8995('0x74')](_0x710ee9['Applications'],[_0x8995('0x75')],[_0x8995('0x76')]);if(_0x2ae6b8[_0x8995('0x77')][_0x8995('0x72')]){delete _0x2ae6b8['account'][_0x8995('0x72')];}return db[_0x8995('0x78')]['describe']();})[_0x8995('0x20')](function(_0x5e2928){if(!_0x5e2928){throw new db[(_0x8995('0x79'))][(_0x8995('0x7a'))](_0x8995('0x7b'));}_0x35ca08=_[_0x8995('0x7c')](_[_0x8995('0x47')](_0x5e2928),[_0x8995('0x7d'),_0x8995('0x7e')]);_0x3cd0c3=_[_0x8995('0x7c')](_['keys'](_0x5e2928),['createdAt',_0x8995('0x7e'),_0x8995('0x7f'),_0x8995('0x80')]);_0x2ae6b8['body']={'mapKey':'mobile'};if(_0x2ae6b8[_0x8995('0x77')][_0x8995('0x44')]){switch(_0x2ae6b8['account'][_0x8995('0x44')]){case _0x8995('0x81'):_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')]=_0x1c2606['body'][_0x8995('0x83')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606[_0x8995('0x5e')]['Body'];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x84')]=_0x1c2606[_0x8995('0x5e')]['MessageSid'];break;case'skebby':_0x2ae6b8['body'][_0x8995('0x82')]='+'+_0x1c2606[_0x8995('0x5e')]['sender'];_0x2ae6b8[_0x8995('0x5e')]['body']=_0x1c2606[_0x8995('0x5e')][_0x8995('0x85')];break;case _0x8995('0x86'):_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x82')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x28')];break;case _0x8995('0x87'):_0x2ae6b8[_0x8995('0x5e')]['from']=_0x1c2606[_0x8995('0x5e')][_0x8995('0x82')];_0x2ae6b8['body'][_0x8995('0x5e')]=_0x1c2606['body']['body'];_0x2ae6b8['body'][_0x8995('0x84')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x88')];break;case _0x8995('0x89'):_0x2ae6b8['body'][_0x8995('0x82')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x83')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606['body'][_0x8995('0x8a')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x84')]=_0x1c2606['body'][_0x8995('0x8b')];break;case _0x8995('0x8c'):_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')]='+'+_0x1c2606[_0x8995('0x5e')][_0x8995('0x8d')][0x0][_0x8995('0x82')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606[_0x8995('0x5e')]['results'][0x0][_0x8995('0x85')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x84')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x8d')][0x0][_0x8995('0x84')];break;case _0x8995('0x8e'):_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')]=_0x1c2606['body'][_0x8995('0x8f')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606['body'][_0x8995('0x90')][_0x8995('0x28')];break;case'clickatell':_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x91')];_0x2ae6b8[_0x8995('0x5e')]['body']=_0x1c2606[_0x8995('0x5e')][_0x8995('0x85')];_0x2ae6b8['body'][_0x8995('0x84')]=_0x1c2606[_0x8995('0x5e')][_0x8995('0x92')];break;case _0x8995('0x93'):_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x84')]=_0x1c2606[_0x8995('0x5e')][0x0][_0x8995('0x28')]['id'];_0x2ae6b8['body'][_0x8995('0x82')]=_0x1c2606[_0x8995('0x5e')][0x0][_0x8995('0x28')]['from'];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606[_0x8995('0x5e')][0x0][_0x8995('0x28')][_0x8995('0x85')];break;case _0x8995('0x94'):_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')]=_0x1c2606['body'][_0x8995('0x82')];_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')]=_0x1c2606['body'][_0x8995('0x28')];_0x2ae6b8[_0x8995('0x5e')]['messageId']=_0x1c2606[_0x8995('0x5e')][_0x8995('0x95')];break;}}if(_0x2ae6b8[_0x8995('0x5e')]['id']){delete _0x2ae6b8[_0x8995('0x5e')]['id'];}if(_[_0x8995('0x96')](_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')])){throw new db['Sequelize'][(_0x8995('0x7a'))](_0x8995('0x97'));}if(_['isNil'](_0x2ae6b8[_0x8995('0x5e')]['body'])||_0x2ae6b8['body']['body']===''){throw new db[(_0x8995('0x79'))][(_0x8995('0x7a'))](_0x8995('0x98'));}if(_[_0x8995('0x96')](_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x99')])){throw new db[(_0x8995('0x79'))][(_0x8995('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cd0c3);}if(!_[_0x8995('0x9a')](_0x3cd0c3,_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x99')])){throw new db[(_0x8995('0x79'))][(_0x8995('0x7a'))](_0x8995('0x9b')+_0x3cd0c3);}_0x5eb53a[_0x2ae6b8['body'][_0x8995('0x99')]]=_0x2ae6b8[_0x8995('0x5e')]['from'];return db[_0x8995('0x9c')][_0x8995('0x62')]({'where':{'id':_0x2ae6b8[_0x8995('0x77')]['ListId']},'include':[{'model':db[_0x8995('0x78')],'as':'Contacts','where':_0x5eb53a,'limit':0x1,'order':[['updatedAt',_0x8995('0x9d')]]}]});})[_0x8995('0x20')](handleEntityNotFound(_0x3acc70,null))[_0x8995('0x20')](function(_0xcf6fd9){if(_0xcf6fd9){_0x2ae6b8[_0x8995('0x9e')]=_[_0x8995('0x9f')](_0xcf6fd9,[_0x8995('0xa0')]);if(_0xcf6fd9[_0x8995('0xa0')][_0x8995('0x4b')]){return _0xcf6fd9[_0x8995('0xa0')][0x0];}var _0x47813a=_['defaults'](_0x2ae6b8[_0x8995('0x5e')],{'firstName':_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')],'ListId':_0xcf6fd9['id']});_0x47813a[_0x2ae6b8['body'][_0x8995('0x99')]]=_0x2ae6b8['body'][_0x8995('0x82')];return db[_0x8995('0x78')][_0x8995('0x5d')](_0x47813a,{'fields':_0x35ca08,'raw':!![]});}})['then'](handleEntityNotFound(_0x3acc70,null))[_0x8995('0x20')](function(_0x119c65){if(_0x119c65){_0x2ae6b8['contact']=_0x119c65;var _0x124188={'ContactId':_0x119c65['id'],'phone':_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x82')],'SmsAccountId':_0x1c2606[_0x8995('0x5c')]['id']};var _0x21e379={'ContactId':_0x119c65['id'],'SmsAccountId':_0x1c2606['params']['id'],'closed':![]};return db[_0x8995('0xa1')][_0x8995('0x62')]({'where':_0x21e379})[_0x8995('0x20')](function(_0x19f734){if(_0x19f734){return[_0x19f734,![]];}return db[_0x8995('0xa1')][_0x8995('0x5d')](_0x124188)[_0x8995('0x20')](function(_0x106011){return[_0x106011,!![]];});});}})[_0x8995('0xa2')](function(_0x3050a7,_0x1defa0){_0x2ae6b8[_0x8995('0xa3')]=_0x3050a7[_0x8995('0x38')]({'plain':!![]});_0x2ae6b8['interaction'][_0x8995('0xa4')]=![];if(_0x1defa0){if(_0x2ae6b8[_0x8995('0x77')][_0x8995('0xa5')]){_0x2ae6b8[_0x8995('0x73')][_0x8995('0xa6')]({'id':0x0,'priority':_0x2ae6b8[_0x8995('0x73')][_0x8995('0x4b')]+0x1,'app':_0x8995('0xa7'),'appdata':_0x8995('0xa8'),'interval':_0x8995('0xa9')});}_0x2ae6b8['interaction'][_0x8995('0xa4')]=!![];}return db[_0x8995('0xaa')][_0x8995('0x5d')]({'phone':_0x2ae6b8[_0x8995('0x5e')]['from'],'messageId':_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x84')],'body':_0x2ae6b8[_0x8995('0x5e')][_0x8995('0x5e')],'SmsAccountId':_0x1c2606[_0x8995('0x5c')]['id'],'SmsInteractionId':_0x3050a7['id'],'direction':'in','ContactId':_0x3050a7[_0x8995('0xab')],'AttachmentId':_0x2ae6b8[_0x8995('0x5e')][_0x8995('0xac')]});})[_0x8995('0x20')](function(_0x15de8c){_0x2ae6b8[_0x8995('0x28')]=_0x15de8c;if(_0x2ae6b8[_0x8995('0xa3')][_0x8995('0xad')]){return db[_0x8995('0xae')][_0x8995('0x62')]({'attributes':['id',_0x8995('0x3d')],'where':{'id':_0x2ae6b8['interaction'][_0x8995('0xad')]}})[_0x8995('0x20')](function(_0x240eb1){if(_0x240eb1){_0x2ae6b8['applications'][_0x8995('0xaf')]({'id':0x0,'priority':0x0,'app':_0x8995('0xb0'),'appdata':_0x240eb1['name']+','+(_0x2ae6b8[_0x8995('0x77')]['waitForTheAssignedAgent']||0xa),'interval':_0x8995('0xa9')});}return respondWithRpcPromise('Start',_0x8995('0xb1'),_0x2ae6b8);});}return respondWithRpcPromise('Start','startRouting',_0x2ae6b8);})['then'](function(_0x3c6751){if(_0x3c6751){var _0x4a78ab=0xc8;var _0x1c6251=_0x8995('0xb2');logger[_0x8995('0x21')](_0x8995('0x25'),_0x1c6251,_0x4a78ab,'entity\x20found');logger[_0x8995('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1c6251,_0x4a78ab,_0x8995('0xb3'),JSON[_0x8995('0xb4')](_0x3c6751));if(_0x2ae6b8[_0x8995('0x77')]['type']===_0x8995('0x81')){return _0x3acc70[_0x8995('0x2a')](_0x4a78ab)[_0x8995('0x31')]('Content-Type',_0x8995('0xb5'))[_0x8995('0x3e')](_0x8995('0xb6'));}else{return _0x3acc70[_0x8995('0x2a')](_0x4a78ab)[_0x8995('0x2c')](_0x3c6751);}}})[_0x8995('0x29')](handleError(_0x3acc70,null));};exports[_0x8995('0xb7')]=function(_0x5f47f8,_0x163260,_0x51681a){return db[_0x8995('0x59')][_0x8995('0x6a')]({'where':{'id':_0x5f47f8[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x163260,null))[_0x8995('0x20')](function(_0x3876e5){if(_0x3876e5){return db[_0x8995('0xb8')][_0x8995('0xb9')](function(_0x2f61ce){return db[_0x8995('0x71')][_0x8995('0x37')]({'where':{'SmsAccountId':_0x5f47f8['params']['id']},'transaction':_0x2f61ce})['then'](function(_0x26b413){var _0x963c4f=_[_0x8995('0x41')](_0x5f47f8[_0x8995('0x5e')],function(_0x94f1a6){_0x94f1a6[_0x8995('0x68')]=_0x5f47f8[_0x8995('0x5c')]['id'];return _0x94f1a6;});return db[_0x8995('0x71')][_0x8995('0xba')](_0x963c4f,{'transaction':_0x2f61ce});});})['then'](function(){return db['SmsApplication'][_0x8995('0xbb')]({'where':{'SmsAccountId':_0x5f47f8['params']['id']},'order':_0x8995('0x75')});});}})[_0x8995('0x20')](respondWithResult(_0x163260,null))[_0x8995('0x29')](handleError(_0x163260,null));};exports['getApplications']=function(_0x5ee04f,_0x3308bc,_0x34b2a9){var _0x21f399={};var _0x16ccfe={};var _0x52fa95;var _0x5a0425;return db[_0x8995('0x59')][_0x8995('0x6a')]({'where':{'id':_0x5ee04f[_0x8995('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3308bc,null))['then'](function(_0x573879){if(_0x573879){_0x52fa95=_0x573879;_0x16ccfe[_0x8995('0x45')]=_[_0x8995('0x47')](db['SmsApplication']['rawAttributes']);_0x16ccfe[_0x8995('0x46')]=_[_0x8995('0x47')](_0x5ee04f[_0x8995('0x46')]);_0x16ccfe[_0x8995('0x50')]=_[_0x8995('0x48')](_0x16ccfe[_0x8995('0x45')],_0x16ccfe[_0x8995('0x46')]);_0x21f399[_0x8995('0x49')]=_[_0x8995('0x48')](_0x16ccfe['model'],qs[_0x8995('0x4a')](_0x5ee04f['query'][_0x8995('0x4a')]));_0x21f399[_0x8995('0x49')]=_0x21f399['attributes'][_0x8995('0x4b')]?_0x21f399[_0x8995('0x49')]:_0x16ccfe[_0x8995('0x45')];_0x21f399['order']=qs[_0x8995('0x4f')](_0x5ee04f['query'][_0x8995('0x4f')]);_0x21f399['where']=qs[_0x8995('0x50')](_[_0x8995('0x51')](_0x5ee04f[_0x8995('0x46')],_0x16ccfe['filters']));if(_0x5ee04f[_0x8995('0x46')][_0x8995('0x52')]){_0x21f399['where']=_[_0x8995('0x54')](_0x21f399[_0x8995('0x53')],{'$or':_[_0x8995('0x41')](_0x21f399[_0x8995('0x49')],function(_0x3512e1){var _0x37ead3={};_0x37ead3[_0x3512e1]={'$like':'%'+_0x5ee04f[_0x8995('0x46')][_0x8995('0x52')]+'%'};return _0x37ead3;})});}_0x21f399=_['merge']({},_0x21f399,_0x5ee04f[_0x8995('0x56')]);return _0x52fa95[_0x8995('0xbc')](_0x21f399);}})['then'](function(_0x170906){if(_0x170906){_0x5a0425=_0x170906[_0x8995('0x4b')];if(!_0x5ee04f[_0x8995('0x46')]['hasOwnProperty'](_0x8995('0x4d'))){_0x21f399[_0x8995('0x2f')]=qs[_0x8995('0x2f')](_0x5ee04f[_0x8995('0x46')][_0x8995('0x2f')]);_0x21f399[_0x8995('0x2d')]=qs['offset'](_0x5ee04f[_0x8995('0x46')][_0x8995('0x2d')]);}return _0x52fa95[_0x8995('0xbc')](_0x21f399);}})['then'](function(_0x407538){if(_0x407538){return _0x407538?{'count':_0x5a0425,'rows':_0x407538}:null;}})[_0x8995('0x20')](respondWithResult(_0x3308bc,null))[_0x8995('0x29')](handleError(_0x3308bc,null));};exports[_0x8995('0xbd')]=function(_0x1dc351,_0x398cf2,_0x274974){var _0x299613={'raw':![],'where':{}};var _0x16a797={};var _0x11f351={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8995('0x6a')]({'where':{'id':_0x1dc351[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x398cf2,null))[_0x8995('0x20')](function(_0x4bb654){if(_0x4bb654){_0x16a797['model']=_[_0x8995('0x47')](db['SmsInteraction']['rawAttributes']);_0x16a797[_0x8995('0x46')]=_[_0x8995('0x47')](_0x1dc351[_0x8995('0x46')]);_0x16a797[_0x8995('0x50')]=_['intersection'](_0x16a797[_0x8995('0x45')],_0x16a797[_0x8995('0x46')]);_0x299613[_0x8995('0x49')]=_[_0x8995('0x48')](_0x16a797['model'],qs[_0x8995('0x4a')](_0x1dc351['query']['fields']));_0x299613[_0x8995('0x49')]=_0x299613[_0x8995('0x49')][_0x8995('0x4b')]?_0x299613[_0x8995('0x49')]:_0x16a797[_0x8995('0x45')];if(!_0x1dc351[_0x8995('0x46')][_0x8995('0x4c')](_0x8995('0x4d'))){_0x299613['limit']=qs[_0x8995('0x2f')](_0x1dc351['query'][_0x8995('0x2f')]);_0x299613['offset']=qs[_0x8995('0x2d')](_0x1dc351[_0x8995('0x46')][_0x8995('0x2d')]);}_0x299613[_0x8995('0x4e')]=qs[_0x8995('0x4f')](_0x1dc351[_0x8995('0x46')]['sort']);_0x299613[_0x8995('0x53')]=qs[_0x8995('0x50')](_[_0x8995('0x51')](_0x1dc351[_0x8995('0x46')],_0x16a797[_0x8995('0x50')]));_0x299613[_0x8995('0x53')][_0x8995('0x68')]=_0x4bb654['id'];if(_0x1dc351[_0x8995('0x46')]['filter']){_0x299613[_0x8995('0x53')]=_['merge'](_0x299613[_0x8995('0x53')],{'$or':_[_0x8995('0x41')](_0x299613[_0x8995('0x49')],function(_0x3476c4){var _0x5c8036={};_0x5c8036[_0x3476c4]={'$like':'%'+_0x1dc351[_0x8995('0x46')][_0x8995('0x52')]+'%'};return _0x5c8036;})});}_0x299613=_[_0x8995('0x54')]({},_0x299613,_0x1dc351[_0x8995('0x56')]);return db[_0x8995('0xa1')][_0x8995('0x30')]({'where':_0x299613[_0x8995('0x53')]})[_0x8995('0x20')](function(_0x85ab54){_0x11f351[_0x8995('0x30')]=_0x85ab54;if(_0x1dc351[_0x8995('0x46')][_0x8995('0x57')]){_0x299613['include']=[{'model':db[_0x8995('0x78')],'as':_0x8995('0xbe'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8995('0x3d'),_0x8995('0xbf'),_0x8995('0xc0')],'required':![]},{'model':db[_0x8995('0xc1')],'as':_0x8995('0xc2'),'attributes':['id',_0x8995('0x3d'),_0x8995('0xc3')],'where':_0x1dc351['query'][_0x8995('0xc4')]?{'id':_0x1dc351[_0x8995('0x46')][_0x8995('0xc4')]}:undefined,'required':_0x1dc351[_0x8995('0x46')]['tag']?!![]:![]}];}return db[_0x8995('0xa1')][_0x8995('0x5a')](_0x299613);})[_0x8995('0x20')](function(_0x3e7a38){_0x11f351[_0x8995('0x5b')]=_0x3e7a38;return _0x11f351;});}})[_0x8995('0x20')](respondWithFilteredResult(_0x398cf2,_0x299613))[_0x8995('0x29')](handleError(_0x398cf2,null));};exports[_0x8995('0x3e')]=function(_0x2d57e6,_0x5900a2,_0x1dd35a){var _0x292626,_0x14428a,_0x4567a9;if(_[_0x8995('0x96')](_0x2d57e6[_0x8995('0x5e')][_0x8995('0x5e')])||_0x2d57e6['body'][_0x8995('0x5e')]===''){throw new db[(_0x8995('0x79'))][(_0x8995('0x7a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8995('0x96')](_0x2d57e6[_0x8995('0x5e')]['to'])){throw new db[(_0x8995('0x79'))][(_0x8995('0x7a'))]('to\x20is\x20mandatory');}_0x292626=_0x2d57e6[_0x8995('0x5e')]['to'];return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0x2d57e6[_0x8995('0x5c')]['id']},'include':[{'model':db[_0x8995('0x9c')],'as':_0x8995('0xc5'),'include':[{'model':db[_0x8995('0x78')],'as':_0x8995('0xa0'),'where':{'mobile':_0x292626},'limit':0x1,'order':[['updatedAt',_0x8995('0x9d')]]}]}]})[_0x8995('0x20')](handleEntityNotFound(_0x5900a2,null))[_0x8995('0x20')](function(_0x2388d4){if(_0x2388d4&&_0x2388d4[_0x8995('0xc5')]){_0x14428a=_0x2388d4[_0x8995('0x38')]({'plain':!![]});if(_0x14428a[_0x8995('0xc5')]&&_0x14428a[_0x8995('0xc5')][_0x8995('0xa0')][_0x8995('0x4b')]){return _0x14428a['List']['Contacts'][0x0];}return db['CmContact']['create'](_[_0x8995('0x18')](_0x2d57e6[_0x8995('0x5e')],{'firstName':_0x292626,'mobile':_0x292626,'phone':_0x292626,'ListId':_0x14428a['ListId']}));}})['then'](handleEntityNotFound(_0x5900a2,null))[_0x8995('0x20')](function(_0x1208de){if(_0x1208de){_0x4567a9=_0x1208de;return db[_0x8995('0xa1')]['find']({'where':{'ContactId':_0x4567a9['id'],'closed':![],'SmsAccountId':_0x14428a['id']}})[_0x8995('0x20')](function(_0xd592ab){if(_0xd592ab){return[_0xd592ab,![]];}return db[_0x8995('0xa1')]['create']({'UserId':_0x2d57e6[_0x8995('0x60')]['id'],'ContactId':_0x4567a9['id'],'SmsAccountId':_0x14428a['id'],'phone':_0x292626,'firstMsgDirection':_0x8995('0xc6'),'Messages':[_['merge'](_0x2d57e6['body'],{'read':![],'body':_0x2d57e6[_0x8995('0x5e')][_0x8995('0x5e')],'phone':_0x292626,'SmsAccountId':_0x14428a['id'],'UserId':_0x2d57e6[_0x8995('0x60')]['id'],'ContactId':_0x4567a9['id']})]},{'include':[{'model':db[_0x8995('0xaa')],'as':_0x8995('0xc7')}]})[_0x8995('0x20')](function(_0xff623a){return[_0xff623a,!![]];});});}})[_0x8995('0xa2')](function(_0x292f89,_0x86d91e){if(_0x86d91e){return _0x292f89;}return db[_0x8995('0xaa')][_0x8995('0x5d')](_[_0x8995('0x54')](_0x2d57e6['body'],{'read':![],'body':_0x2d57e6[_0x8995('0x5e')]['body'],'phone':_0x292626,'SmsAccountId':_0x14428a['id'],'SmsInteractionId':_0x292f89['id'],'UserId':_0x2d57e6[_0x8995('0x60')]['id'],'ContactId':_0x4567a9['id']}))[_0x8995('0x20')](function(_0x1f2ddd){_0x292f89[_0x8995('0xc8')][_0x8995('0xc7')]=[];_0x292f89[_0x8995('0xc8')][_0x8995('0xc7')][_0x8995('0xa6')](_0x1f2ddd[_0x8995('0xc8')]);return _0x292f89;});})[_0x8995('0x20')](respondWithResult(_0x5900a2,null))[_0x8995('0x29')](handleError(_0x5900a2,null));};exports[_0x8995('0x2a')]=function(_0x1f55c7,_0x3356b9,_0x152ba6){if(_0x1f55c7[_0x8995('0x5e')]['id']){delete _0x1f55c7[_0x8995('0x5e')]['id'];}var _0x366dbb,_0x52eaa8,_0x25c3bb;return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0x1f55c7[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x3356b9,null))[_0x8995('0x20')](function(_0x1c80df){if(_0x1c80df){_0x25c3bb=_0x1c80df;logger[_0x8995('0x24')](_0x8995('0x25'),_0x8995('0x2a'),_0x8995('0xc9'),_0x1c80df['type'],util[_0x8995('0xca')](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));switch(_0x1c80df[_0x8995('0x44')]){case _0x8995('0xcb'):if(_0x1f55c7[_0x8995('0x5e')][_0x8995('0xcc')]&&_0x1f55c7[_0x8995('0x5e')][_0x8995('0x2a')]){_0x52eaa8=_0x1f55c7[_0x8995('0x5e')][_0x8995('0x2a')];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0x1f55c7[_0x8995('0x5e')][_0x8995('0xcc')]}});}break;case'connectel':if(_0x1f55c7[_0x8995('0x5e')][_0x8995('0xcd')]&&_0x1f55c7['body'][_0x8995('0xce')]){_0x52eaa8=_0x1f55c7[_0x8995('0x5e')]['statusInt'];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0x1f55c7[_0x8995('0x5e')][_0x8995('0xcd')]}});}break;case _0x8995('0x87'):if(_0x1f55c7[_0x8995('0x5e')]['message_id']&&_0x1f55c7['body'][_0x8995('0xcf')]){_0x52eaa8=_0x1f55c7['body'][_0x8995('0xcf')];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0x1f55c7[_0x8995('0x5e')]['message_id']}});}break;case'infobip':var _0x51481f=_0x1f55c7[_0x8995('0x5e')][_0x8995('0x8d')][0x0];if(_0x51481f[_0x8995('0x84')]&&_0x51481f[_0x8995('0x2a')][_0x8995('0xd0')]===_0x8995('0xd1')){_0x52eaa8=_0x51481f[_0x8995('0x2a')]['groupName'];return db['SmsMessage'][_0x8995('0x62')]({'where':{'messageId':_0x51481f[_0x8995('0x84')]}});}break;case'clickatell':if(_0x1f55c7[_0x8995('0x5e')][_0x8995('0x84')]&&_0x1f55c7[_0x8995('0x5e')][_0x8995('0x2a')]){_0x52eaa8=_0x1f55c7[_0x8995('0x5e')][_0x8995('0x2a')];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0x1f55c7['body'][_0x8995('0x84')]}});}break;case _0x8995('0x93'):if(_0x1f55c7['body'][0x0][_0x8995('0x28')]['id']){_0x52eaa8=_0x1f55c7['body'][0x0][_0x8995('0x44')];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0x1f55c7['body'][0x0][_0x8995('0x28')]['id']}});}break;case'intelepeer':if(_0x1f55c7['body']['redif']&&_0x1f55c7['body'][_0x8995('0x2a')]){_0x52eaa8=_0x1f55c7[_0x8995('0x5e')][_0x8995('0x2a')];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0x1f55c7[_0x8995('0x5e')][_0x8995('0xd2')]}});}break;}}})[_0x8995('0x20')](handleEntityNotFound(_0x3356b9,null))[_0x8995('0x20')](function(_0x458853){if(_0x458853){_0x366dbb=_0x458853;switch(_0x25c3bb[_0x8995('0x44')]){case _0x8995('0xcb'):if(_0x52eaa8===_0x8995('0xd1')){return _0x366dbb['update']({'read':!![]});}else{logger[_0x8995('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8995('0x2a'),_0x8995('0xcb'),util[_0x8995('0xca')](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8995('0x86'):if(_0x52eaa8==='1'){return _0x366dbb[_0x8995('0x36')]({'read':!![]});}else{logger[_0x8995('0x26')](_0x8995('0x25'),'status',_0x8995('0xcb'),util[_0x8995('0xca')](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x1f55c7['body'][_0x8995('0xd3')]&&_0x52eaa8>=0xc8&&_0x52eaa8<=0xce){return _0x366dbb[_0x8995('0x36')]({'read':!![]});}else{logger[_0x8995('0x26')](_0x8995('0x25'),_0x8995('0x2a'),_0x8995('0x87'),util[_0x8995('0xca')](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8995('0x8c'):var _0x2b5930=_0x1f55c7[_0x8995('0x5e')][_0x8995('0x8d')][0x0];if(_0x2b5930[_0x8995('0x2a')]['groupName']===_0x8995('0xd1')){return _0x366dbb[_0x8995('0x36')]({'read':!![]});}else{logger[_0x8995('0x26')](_0x8995('0x25'),_0x8995('0x2a'),_0x8995('0x8c'),util[_0x8995('0xca')](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8995('0xd4'):if(_0x52eaa8==_0x8995('0xd5')||_0x52eaa8==_0x8995('0xd6')){return _0x366dbb['update']({'read':!![]});}else{logger[_0x8995('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8995('0x2a'),_0x8995('0xd4'),util['inspect'](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8995('0x93'):if(_0x52eaa8==_0x8995('0xd7')){return _0x366dbb[_0x8995('0x36')]({'read':!![]});}else{logger[_0x8995('0x26')](_0x8995('0x25'),_0x8995('0x2a'),_0x8995('0x93'),util['inspect'](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x8995('0x94'):if(_0x52eaa8==='DELIVRD'||_0x52eaa8===_0x8995('0xd8')){return _0x366dbb['update']({'read':!![]});}else{logger['error'](_0x8995('0x25'),_0x8995('0x2a'),_0x8995('0x94'),util[_0x8995('0xca')](_0x1f55c7[_0x8995('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x366dbb;}})[_0x8995('0x20')](respondWithResult(_0x3356b9,null))[_0x8995('0x29')](handleError(_0x3356b9,null));};exports[_0x8995('0xd9')]=function(_0xa339af,_0x5aa32f,_0x195dec){var _0x2bbaa7,_0x1a5263,_0x11dfcd;return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0xa339af[_0x8995('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5aa32f,null))['then'](function(_0x16ecf9){if(_0x16ecf9){_0x11dfcd=_0x16ecf9;logger[_0x8995('0x24')](_0x8995('0x25'),_0x8995('0x2a'),_0x8995('0xc9'),_0x16ecf9[_0x8995('0x44')],util['inspect'](_0xa339af['query'],{'showHidden':![],'depth':null}));switch(_0x16ecf9[_0x8995('0x44')]){case'csc':if(_0xa339af[_0x8995('0x46')][_0x8995('0xda')]&&_0xa339af[_0x8995('0x46')][_0x8995('0xdb')]){_0x1a5263=_0xa339af[_0x8995('0x46')][_0x8995('0xdb')];return db[_0x8995('0xaa')][_0x8995('0x62')]({'where':{'messageId':_0xa339af[_0x8995('0x46')][_0x8995('0xda')]}});}break;}}})[_0x8995('0x20')](handleEntityNotFound(_0x5aa32f,null))[_0x8995('0x20')](function(_0xaa56d0){if(_0xaa56d0){_0x2bbaa7=_0xaa56d0;switch(_0x11dfcd['type']){case _0x8995('0x8e'):if(_0x1a5263==='2'||_0x1a5263==='6'){return _0x2bbaa7[_0x8995('0x36')]({'read':!![]});}else{logger[_0x8995('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8995('0x8e'),util[_0x8995('0xca')](_0xa339af[_0x8995('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x2bbaa7;}})['then'](respondWithResult(_0x5aa32f,null))[_0x8995('0x29')](handleError(_0x5aa32f,null));};exports[_0x8995('0xdc')]=function(_0x29e4d7,_0x42e0d4,_0x1a3342){return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0x29e4d7[_0x8995('0x5c')]['id']}})[_0x8995('0x20')](handleEntityNotFound(_0x42e0d4,null))[_0x8995('0x20')](function(_0x49adc2){if(_0x49adc2){return _0x49adc2[_0x8995('0xdc')](_0x29e4d7[_0x8995('0x5e')][_0x8995('0x6d')],_[_0x8995('0x9f')](_0x29e4d7[_0x8995('0x5e')],[_0x8995('0x6d'),'id'])||{})[_0x8995('0xa2')](function(_0x3cd393){for(var _0x24f0c3=0x0;_0x24f0c3<_0x29e4d7['body'][_0x8995('0x6d')][_0x8995('0x4b')];_0x24f0c3+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x29e4d7['body'][_0x8995('0x6d')][_0x24f0c3]),'SmsAccountId':Number(_0x29e4d7['params']['id'])});}return _0x3cd393;});}})['then'](respondWithResult(_0x42e0d4,null))[_0x8995('0x29')](handleError(_0x42e0d4,null));};exports[_0x8995('0xdd')]=function(_0x2b6ad2,_0xaa6fe4,_0x540440){return db[_0x8995('0x59')][_0x8995('0x62')]({'where':{'id':_0x2b6ad2[_0x8995('0x5c')]['id']}})['then'](handleEntityNotFound(_0xaa6fe4,null))[_0x8995('0x20')](function(_0x221d84){if(_0x221d84){return _0x221d84['removeAgents'](_0x2b6ad2[_0x8995('0x46')][_0x8995('0x6d')])[_0x8995('0x20')](function(){if(_[_0x8995('0xde')](_0x2b6ad2['query'][_0x8995('0x6d')])){for(var _0x4aa467=0x0;_0x4aa467<_0x2b6ad2['query'][_0x8995('0x6d')][_0x8995('0x4b')];_0x4aa467+=0x1){socket['emit'](_0x8995('0xdf'),{'UserId':Number(_0x2b6ad2[_0x8995('0x46')][_0x8995('0x6d')][_0x4aa467]),'SmsAccountId':Number(_0x2b6ad2[_0x8995('0x5c')]['id'])});}}else{socket['emit'](_0x8995('0xdf'),{'UserId':Number(_0x2b6ad2[_0x8995('0x46')][_0x8995('0x6d')]),'SmsAccountId':Number(_0x2b6ad2['params']['id'])});}});}})[_0x8995('0x20')](respondWithStatusCode(_0xaa6fe4,null))['catch'](handleError(_0xaa6fe4,null));};exports[_0x8995('0xe0')]=function(_0x39800d,_0x35db02,_0x557185){var _0x5b0ce6={};var _0x2ac95f={};var _0x13deef;var _0x3a5ce3;return db[_0x8995('0x59')][_0x8995('0x6a')]({'where':{'id':_0x39800d[_0x8995('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35db02,null))['then'](function(_0x2dba82){if(_0x2dba82){_0x13deef=_0x2dba82;_0x2ac95f[_0x8995('0x45')]=_[_0x8995('0x47')](db[_0x8995('0xae')]['rawAttributes']);_0x2ac95f[_0x8995('0x46')]=_['keys'](_0x39800d[_0x8995('0x46')]);_0x2ac95f[_0x8995('0x50')]=_[_0x8995('0x48')](_0x2ac95f[_0x8995('0x45')],_0x2ac95f['query']);_0x5b0ce6[_0x8995('0x49')]=_['intersection'](_0x2ac95f[_0x8995('0x45')],qs['fields'](_0x39800d[_0x8995('0x46')]['fields']));_0x5b0ce6[_0x8995('0x49')]=_0x5b0ce6['attributes']['length']?_0x5b0ce6['attributes']:_0x2ac95f[_0x8995('0x45')];_0x5b0ce6[_0x8995('0x4e')]=qs[_0x8995('0x4f')](_0x39800d['query']['sort']);_0x5b0ce6[_0x8995('0x53')]=qs[_0x8995('0x50')](_[_0x8995('0x51')](_0x39800d[_0x8995('0x46')],_0x2ac95f['filters']));if(_0x39800d['query'][_0x8995('0x52')]){_0x5b0ce6[_0x8995('0x53')]=_[_0x8995('0x54')](_0x5b0ce6['where'],{'$or':_[_0x8995('0x41')](_0x5b0ce6[_0x8995('0x49')],function(_0xd98dc5){var _0x580e47={};_0x580e47[_0xd98dc5]={'$like':'%'+_0x39800d[_0x8995('0x46')][_0x8995('0x52')]+'%'};return _0x580e47;})});}_0x5b0ce6=_[_0x8995('0x54')]({},_0x5b0ce6,_0x39800d[_0x8995('0x56')]);return _0x13deef[_0x8995('0xe0')](_0x5b0ce6);}})[_0x8995('0x20')](function(_0x59af4e){if(_0x59af4e){_0x3a5ce3=_0x59af4e['length'];if(!_0x39800d[_0x8995('0x46')][_0x8995('0x4c')](_0x8995('0x4d'))){_0x5b0ce6[_0x8995('0x2f')]=qs['limit'](_0x39800d[_0x8995('0x46')][_0x8995('0x2f')]);_0x5b0ce6[_0x8995('0x2d')]=qs[_0x8995('0x2d')](_0x39800d[_0x8995('0x46')][_0x8995('0x2d')]);}return _0x13deef['getAgents'](_0x5b0ce6);}})[_0x8995('0x20')](function(_0x550f15){if(_0x550f15){return _0x550f15?{'count':_0x3a5ce3,'rows':_0x550f15}:null;}})['then'](respondWithResult(_0x35db02,null))[_0x8995('0x29')](handleError(_0x35db02,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 4ffb57b..dd69746 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 _0xdbb7=['hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x370589,_0x578672){var _0x2fec2c=function(_0x586e03){while(--_0x586e03){_0x370589['push'](_0x370589['shift']());}};_0x2fec2c(++_0x578672);}(_0xdbb7,0x174));var _0x7dbb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdbb7[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7dbb('0x0'));var SmsAccount=require(_0x7dbb('0x1'))['db'][_0x7dbb('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7dbb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7dbb('0x4'),'afterDestroy':_0x7dbb('0x5')};function emitEvent(_0x11901f){return function(_0x266d01,_0x113696,_0x26f5cd){SmsAccountEvents[_0x7dbb('0x6')](_0x11901f+':'+_0x266d01['id'],_0x266d01);SmsAccountEvents[_0x7dbb('0x6')](_0x11901f,_0x266d01);_0x26f5cd(null);};}for(var e in events){if(events[_0x7dbb('0x7')](e)){var event=events[e];SmsAccount[_0x7dbb('0x8')](e,emitEvent(event));}}module[_0x7dbb('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x714f=['../../mysqldb','SmsAccount','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0x714f,0x19d));var _0xf714=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x714f[_0x2576d7];return _0x16a08c;};'use strict';var EventEmitter=require(_0xf714('0x0'));var SmsAccount=require(_0xf714('0x1'))['db'][_0xf714('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf714('0x3'),'afterDestroy':_0xf714('0x4')};function emitEvent(_0x19e3c8){return function(_0xf0b2fa,_0x3fed07,_0x12936d){SmsAccountEvents[_0xf714('0x5')](_0x19e3c8+':'+_0xf0b2fa['id'],_0xf0b2fa);SmsAccountEvents['emit'](_0x19e3c8,_0xf0b2fa);_0x12936d(null);};}for(var e in events){if(events[_0xf714('0x6')](e)){var event=events[e];SmsAccount[_0xf714('0x7')](e,emitEvent(event));}}module[_0xf714('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5fe3087..56f3afe 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 _0xc769=['rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc769,0x165));var _0x9c76=function(_0x1da345,_0x380f78){_0x1da345=_0x1da345-0x0;var _0x278084=_0xc769[_0x1da345];return _0x278084;};'use strict';var _=require(_0x9c76('0x0'));var util=require(_0x9c76('0x1'));var logger=require(_0x9c76('0x2'))(_0x9c76('0x3'));var moment=require('moment');var BPromise=require(_0x9c76('0x4'));var rp=require(_0x9c76('0x5'));var fs=require('fs');var path=require(_0x9c76('0x6'));var rimraf=require(_0x9c76('0x7'));var config=require(_0x9c76('0x8'));var attributes=require(_0x9c76('0x9'));module[_0x9c76('0xa')]=function(_0x3f106a,_0x55af23){return _0x3f106a['define'](_0x9c76('0xb'),attributes,{'tableName':_0x9c76('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07ee=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts','lodash','util'];(function(_0xd1fefc,_0x37144b){var _0x4d3e82=function(_0x547bae){while(--_0x547bae){_0xd1fefc['push'](_0xd1fefc['shift']());}};_0x4d3e82(++_0x37144b);}(_0x07ee,0xe8));var _0xe07e=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x07ee[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xe07e('0x0'));var util=require(_0xe07e('0x1'));var logger=require(_0xe07e('0x2'))(_0xe07e('0x3'));var moment=require(_0xe07e('0x4'));var BPromise=require('bluebird');var rp=require(_0xe07e('0x5'));var fs=require('fs');var path=require(_0xe07e('0x6'));var rimraf=require(_0xe07e('0x7'));var config=require(_0xe07e('0x8'));var attributes=require(_0xe07e('0x9'));module[_0xe07e('0xa')]=function(_0x1ede9e,_0x14afd7){return _0x1ede9e[_0xe07e('0xb')]('SmsAccount',attributes,{'tableName':_0xe07e('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 12518a7..c03d430 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 _0x05d4=['info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','where','include','map','model','attributes','ShowSmsAccount','moment','bluebird','randomstring','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then'];(function(_0x44d0ea,_0x1bf3b5){var _0x59a294=function(_0x4aa6f0){while(--_0x4aa6f0){_0x44d0ea['push'](_0x44d0ea['shift']());}};_0x59a294(++_0x1bf3b5);}(_0x05d4,0x103));var _0x405d=function(_0x27edb1,_0x49b445){_0x27edb1=_0x27edb1-0x0;var _0x2deb9f=_0x05d4[_0x27edb1];return _0x2deb9f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x405d('0x0'));var BPromise=require(_0x405d('0x1'));var rs=require(_0x405d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x405d('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x405d('0x4')][_0x405d('0x5')]({'port':0x232a});config[_0x405d('0x6')]=_[_0x405d('0x7')](config[_0x405d('0x6')],{'host':_0x405d('0x8'),'port':0x18eb});var socket=require(_0x405d('0x9'))(new Redis(config[_0x405d('0x6')]));require(_0x405d('0xa'))['register'](socket);function respondWithRpcPromise(_0x136c77,_0x29cb43,_0xbf7b86){return new BPromise(function(_0x1cd309,_0x56b969){return client[_0x405d('0xb')](_0x136c77,_0xbf7b86)[_0x405d('0xc')](function(_0xa7a387){logger[_0x405d('0xd')](_0x405d('0xe'),_0x29cb43,_0x405d('0xf'));logger[_0x405d('0x10')](_0x405d('0x11'),_0x29cb43,_0x405d('0xf'),JSON[_0x405d('0x12')](_0xa7a387));if(_0xa7a387['error']){if(_0xa7a387[_0x405d('0x13')][_0x405d('0x14')]===0x1f4){logger[_0x405d('0x13')](_0x405d('0xe'),_0x29cb43,_0xa7a387[_0x405d('0x13')][_0x405d('0x15')]);return _0x56b969(_0xa7a387[_0x405d('0x13')][_0x405d('0x15')]);}logger[_0x405d('0x13')](_0x405d('0xe'),_0x29cb43,_0xa7a387[_0x405d('0x13')][_0x405d('0x15')]);return _0x1cd309(_0xa7a387[_0x405d('0x13')][_0x405d('0x15')]);}else{logger[_0x405d('0xd')](_0x405d('0xe'),_0x29cb43,_0x405d('0xf'));_0x1cd309(_0xa7a387[_0x405d('0x16')][_0x405d('0x15')]);}})[_0x405d('0x17')](function(_0x360bcb){logger[_0x405d('0x13')](_0x405d('0xe'),_0x29cb43,_0x360bcb);_0x56b969(_0x360bcb);});});}exports['ShowSmsAccount']=function(_0x3a3ea2){var _0x4b2cb9=this;return new Promise(function(_0x131b02,_0x347fc6){return db[_0x405d('0x18')][_0x405d('0x19')]({'raw':_0x3a3ea2[_0x405d('0x1a')]?_0x3a3ea2['options'][_0x405d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a3ea2[_0x405d('0x1a')]?_0x3a3ea2[_0x405d('0x1a')][_0x405d('0x1c')]||null:null,'attributes':_0x3a3ea2[_0x405d('0x1a')]?_0x3a3ea2['options']['attributes']||null:null,'include':_0x3a3ea2[_0x405d('0x1a')]?_0x3a3ea2[_0x405d('0x1a')][_0x405d('0x1d')]?_[_0x405d('0x1e')](_0x3a3ea2[_0x405d('0x1a')][_0x405d('0x1d')],function(_0x1f5683){return{'model':db[_0x1f5683[_0x405d('0x1f')]],'as':_0x1f5683['as'],'attributes':_0x1f5683['attributes'],'include':_0x1f5683[_0x405d('0x1d')]?_[_0x405d('0x1e')](_0x1f5683[_0x405d('0x1d')],function(_0x1c1d7e){return{'model':db[_0x1c1d7e[_0x405d('0x1f')]],'as':_0x1c1d7e['as'],'attributes':_0x1c1d7e[_0x405d('0x20')],'include':_0x1c1d7e[_0x405d('0x1d')]?_[_0x405d('0x1e')](_0x1c1d7e[_0x405d('0x1d')],function(_0xc9a0d1){return{'model':db[_0xc9a0d1[_0x405d('0x1f')]],'as':_0xc9a0d1['as'],'attributes':_0xc9a0d1[_0x405d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x405d('0xc')](function(_0x39e103){logger['info'](_0x405d('0x21'),_0x3a3ea2);logger[_0x405d('0x10')](_0x405d('0x21'),_0x3a3ea2,JSON['stringify'](_0x39e103));_0x131b02(_0x39e103);})[_0x405d('0x17')](function(_0x24ffa6){logger[_0x405d('0x13')](_0x405d('0x21'),_0x24ffa6['message'],_0x3a3ea2);_0x347fc6(_0x4b2cb9[_0x405d('0x13')](0x1f4,_0x24ffa6[_0x405d('0x15')]));});});}; \ No newline at end of file +var _0xab8b=['redis','localhost','request','then','request\x20sent','debug','stringify','error','message','SmsAccount,\x20%s,\x20%s','info','result','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','model','map','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x569eea,_0x21b9e8){var _0x23c4b3=function(_0x578596){while(--_0x578596){_0x569eea['push'](_0x569eea['shift']());}};_0x23c4b3(++_0x21b9e8);}(_0xab8b,0x1ba));var _0xbab8=function(_0x16d3fe,_0x3eefdb){_0x16d3fe=_0x16d3fe-0x0;var _0x35d5b8=_0xab8b[_0x16d3fe];return _0x35d5b8;};'use strict';var _=require(_0xbab8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbab8('0x1'));var rs=require(_0xbab8('0x2'));var fs=require('fs');var Redis=require(_0xbab8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbab8('0x4'));var logger=require(_0xbab8('0x5'))(_0xbab8('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbab8('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xbab8('0x8')],{'host':_0xbab8('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1dfa6a,_0x1834d8,_0x3a4618){return new BPromise(function(_0x472da5,_0x331bc3){return client[_0xbab8('0xa')](_0x1dfa6a,_0x3a4618)[_0xbab8('0xb')](function(_0x5ea0c0){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1834d8,_0xbab8('0xc'));logger[_0xbab8('0xd')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1834d8,_0xbab8('0xc'),JSON[_0xbab8('0xe')](_0x5ea0c0));if(_0x5ea0c0['error']){if(_0x5ea0c0[_0xbab8('0xf')]['code']===0x1f4){logger[_0xbab8('0xf')]('SmsAccount,\x20%s,\x20%s',_0x1834d8,_0x5ea0c0[_0xbab8('0xf')][_0xbab8('0x10')]);return _0x331bc3(_0x5ea0c0[_0xbab8('0xf')][_0xbab8('0x10')]);}logger['error'](_0xbab8('0x11'),_0x1834d8,_0x5ea0c0[_0xbab8('0xf')][_0xbab8('0x10')]);return _0x472da5(_0x5ea0c0[_0xbab8('0xf')][_0xbab8('0x10')]);}else{logger[_0xbab8('0x12')](_0xbab8('0x11'),_0x1834d8,_0xbab8('0xc'));_0x472da5(_0x5ea0c0[_0xbab8('0x13')][_0xbab8('0x10')]);}})['catch'](function(_0x31f064){logger[_0xbab8('0xf')](_0xbab8('0x11'),_0x1834d8,_0x31f064);_0x331bc3(_0x31f064);});});}exports[_0xbab8('0x14')]=function(_0x2db4f9){var _0x3d1c2c=this;return new Promise(function(_0xfb82cd,_0x8d2ea0){return db[_0xbab8('0x15')]['find']({'raw':_0x2db4f9[_0xbab8('0x16')]?_0x2db4f9[_0xbab8('0x16')][_0xbab8('0x17')]===undefined?!![]:![]:!![],'where':_0x2db4f9[_0xbab8('0x16')]?_0x2db4f9['options'][_0xbab8('0x18')]||null:null,'attributes':_0x2db4f9[_0xbab8('0x16')]?_0x2db4f9[_0xbab8('0x16')][_0xbab8('0x19')]||null:null,'include':_0x2db4f9[_0xbab8('0x16')]?_0x2db4f9[_0xbab8('0x16')]['include']?_['map'](_0x2db4f9['options'][_0xbab8('0x1a')],function(_0x341385){return{'model':db[_0x341385[_0xbab8('0x1b')]],'as':_0x341385['as'],'attributes':_0x341385[_0xbab8('0x19')],'include':_0x341385[_0xbab8('0x1a')]?_[_0xbab8('0x1c')](_0x341385[_0xbab8('0x1a')],function(_0x2b12bb){return{'model':db[_0x2b12bb[_0xbab8('0x1b')]],'as':_0x2b12bb['as'],'attributes':_0x2b12bb[_0xbab8('0x19')],'include':_0x2b12bb[_0xbab8('0x1a')]?_[_0xbab8('0x1c')](_0x2b12bb['include'],function(_0x34e6d4){return{'model':db[_0x34e6d4[_0xbab8('0x1b')]],'as':_0x34e6d4['as'],'attributes':_0x34e6d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x323bf0){logger['info'](_0xbab8('0x14'),_0x2db4f9);logger[_0xbab8('0xd')](_0xbab8('0x14'),_0x2db4f9,JSON[_0xbab8('0xe')](_0x323bf0));_0xfb82cd(_0x323bf0);})[_0xbab8('0x1d')](function(_0x3b7095){logger[_0xbab8('0xf')](_0xbab8('0x14'),_0x3b7095[_0xbab8('0x10')],_0x2db4f9);_0x8d2ea0(_0x3d1c2c[_0xbab8('0xf')](0x1f4,_0x3b7095[_0xbab8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bb47d41..29cd3fc 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(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 4c409e2..1782dbe 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 _0xe14b=['/:id','create','put','exports','multer','util','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index'];(function(_0x5270ff,_0x2795a3){var _0xae0dca=function(_0x4b0c7f){while(--_0x4b0c7f){_0x5270ff['push'](_0x5270ff['shift']());}};_0xae0dca(++_0x2795a3);}(_0xe14b,0x93));var _0xbe14=function(_0x3b8286,_0x1bf969){_0x3b8286=_0x3b8286-0x0;var _0xde5be5=_0xe14b[_0x3b8286];return _0xde5be5;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['update']);router['delete'](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['destroy']);module[_0xbe14('0xc')]=router; \ No newline at end of file +var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x393e98,_0x336255){var _0x461aed=function(_0x4349d8){while(--_0x4349d8){_0x393e98['push'](_0x393e98['shift']());}};_0x461aed(++_0x336255);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 024cb67..63e2b02 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 _0x1809=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x6755e9,_0x68faff){var _0x3c1107=function(_0x2f5611){while(--_0x2f5611){_0x6755e9['push'](_0x6755e9['shift']());}};_0x3c1107(++_0x68faff);}(_0x1809,0x15f));var _0x9180=function(_0xc2cf04,_0x5a75db){_0xc2cf04=_0xc2cf04-0x0;var _0x1bed31=_0x1809[_0xc2cf04];return _0x1bed31;};'use strict';var Sequelize=require(_0x9180('0x0'));module[_0x9180('0x1')]={'priority':{'type':Sequelize[_0x9180('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9180('0x3')},'appdata':{'type':Sequelize[_0x9180('0x4')]()},'description':{'type':Sequelize[_0x9180('0x5')]},'interval':{'type':Sequelize[_0x9180('0x5')],'defaultValue':_0x9180('0x6')}}; \ No newline at end of file +var _0xefd8=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0x264e7d,_0xffcf03){var _0x323641=function(_0x4c3cc){while(--_0x4c3cc){_0x264e7d['push'](_0x264e7d['shift']());}};_0x323641(++_0xffcf03);}(_0xefd8,0x1b5));var _0x8efd=function(_0x54daf5,_0x528643){_0x54daf5=_0x54daf5-0x0;var _0xf70158=_0xefd8[_0x54daf5];return _0xf70158;};'use strict';var Sequelize=require(_0x8efd('0x0'));module[_0x8efd('0x1')]={'priority':{'type':Sequelize[_0x8efd('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8efd('0x3')},'appdata':{'type':Sequelize[_0x8efd('0x4')]()},'description':{'type':Sequelize[_0x8efd('0x5')]},'interval':{'type':Sequelize[_0x8efd('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 49267b7..0668b3f 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 _0x2cfb=['json','undefined','limit','count','offset','set','Content-Range','apply','update','then','stack','name','send','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','SmsApplication','includeAll','findAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x179388,_0x4c4ce3){var _0xaa9a2f=function(_0xd50d1b){while(--_0xd50d1b){_0x179388['push'](_0x179388['shift']());}};_0xaa9a2f(++_0x4c4ce3);}(_0x2cfb,0x194));var _0xb2cf=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x2cfb[_0xef4cf0];return _0x497ad2;};'use strict';var emlformat=require(_0xb2cf('0x0'));var rimraf=require(_0xb2cf('0x1'));var zipdir=require(_0xb2cf('0x2'));var jsonpatch=require(_0xb2cf('0x3'));var rp=require(_0xb2cf('0x4'));var moment=require('moment');var BPromise=require(_0xb2cf('0x5'));var Mustache=require('mustache');var util=require(_0xb2cf('0x6'));var path=require(_0xb2cf('0x7'));var sox=require(_0xb2cf('0x8'));var csv=require('to-csv');var ejs=require(_0xb2cf('0x9'));var fs=require('fs');var fs_extra=require(_0xb2cf('0xa'));var _=require(_0xb2cf('0xb'));var squel=require(_0xb2cf('0xc'));var crypto=require('crypto');var jsforce=require(_0xb2cf('0xd'));var deskjs=require(_0xb2cf('0xe'));var toCsv=require(_0xb2cf('0xf'));var querystring=require(_0xb2cf('0x10'));var Papa=require(_0xb2cf('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb2cf('0x12'));var as=require(_0xb2cf('0x13'));var hardwareService=require(_0xb2cf('0x14'));var logger=require(_0xb2cf('0x15'))(_0xb2cf('0x16'));var utils=require(_0xb2cf('0x17'));var config=require(_0xb2cf('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7894,_0x118cfc){_0x118cfc=_0x118cfc||0xcc;return function(_0x2d5f8f){if(_0x2d5f8f){return _0x5a7894[_0xb2cf('0x19')](_0x118cfc);}return _0x5a7894[_0xb2cf('0x1a')](_0x118cfc)[_0xb2cf('0x1b')]();};}function respondWithResult(_0x5f0fd9,_0x522b84){_0x522b84=_0x522b84||0xc8;return function(_0x2fdfc2){if(_0x2fdfc2){return _0x5f0fd9[_0xb2cf('0x1a')](_0x522b84)[_0xb2cf('0x1c')](_0x2fdfc2);}};}function respondWithFilteredResult(_0x24c0af,_0x5dc697){return function(_0x1613c7){if(_0x1613c7){var _0x1e7302=typeof _0x5dc697['offset']===_0xb2cf('0x1d')&&typeof _0x5dc697[_0xb2cf('0x1e')]===_0xb2cf('0x1d');var _0x1735d4=_0x1613c7[_0xb2cf('0x1f')];var _0x180788=_0x1e7302?0x0:_0x5dc697[_0xb2cf('0x20')];var _0x5d51a1=_0x1e7302?_0x1613c7['count']:_0x5dc697[_0xb2cf('0x20')]+_0x5dc697[_0xb2cf('0x1e')];var _0x5cd3b5;if(_0x5d51a1>=_0x1735d4){_0x5d51a1=_0x1735d4;_0x5cd3b5=0xc8;}else{_0x5cd3b5=0xce;}_0x24c0af[_0xb2cf('0x1a')](_0x5cd3b5);return _0x24c0af[_0xb2cf('0x21')](_0xb2cf('0x22'),_0x180788+'-'+_0x5d51a1+'/'+_0x1735d4)[_0xb2cf('0x1c')](_0x1613c7);}return null;};}function patchUpdates(_0xafe23f){return function(_0xb77b74){try{jsonpatch[_0xb2cf('0x23')](_0xb77b74,_0xafe23f,!![]);}catch(_0xb6c659){return BPromise['reject'](_0xb6c659);}return _0xb77b74['save']();};}function saveUpdates(_0x161d48,_0x5f8cba){return function(_0x354b81){if(_0x354b81){return _0x354b81[_0xb2cf('0x24')](_0x161d48)[_0xb2cf('0x25')](function(_0x39c984){return _0x39c984;});}return null;};}function removeEntity(_0x560cfd,_0x463880){return function(_0x3b8775){if(_0x3b8775){return _0x3b8775['destroy']()['then'](function(){_0x560cfd[_0xb2cf('0x1a')](0xcc)[_0xb2cf('0x1b')]();});}};}function handleEntityNotFound(_0x24d69c,_0x5b89c1){return function(_0x2aeca3){if(!_0x2aeca3){_0x24d69c[_0xb2cf('0x19')](0x194);}return _0x2aeca3;};}function handleError(_0x257f9a,_0xfd1a8){_0xfd1a8=_0xfd1a8||0x1f4;return function(_0x355bfa){logger['error'](_0x355bfa[_0xb2cf('0x26')]);if(_0x355bfa['name']){delete _0x355bfa[_0xb2cf('0x27')];}_0x257f9a[_0xb2cf('0x1a')](_0xfd1a8)[_0xb2cf('0x28')](_0x355bfa);};}exports['index']=function(_0x202937,_0x3362be){var _0x332423={},_0x3f1d97={},_0x7bcb88={'count':0x0,'rows':[]};var _0xdf8fbe=_['map'](db['SmsApplication']['rawAttributes'],function(_0x2a1d6f){return{'name':_0x2a1d6f[_0xb2cf('0x29')],'type':_0x2a1d6f['type'][_0xb2cf('0x2a')]};});_0x3f1d97[_0xb2cf('0x2b')]=_['map'](_0xdf8fbe,_0xb2cf('0x27'));_0x3f1d97[_0xb2cf('0x2c')]=_[_0xb2cf('0x2d')](_0x202937[_0xb2cf('0x2c')]);_0x3f1d97['filters']=_[_0xb2cf('0x2e')](_0x3f1d97[_0xb2cf('0x2b')],_0x3f1d97[_0xb2cf('0x2c')]);_0x332423[_0xb2cf('0x2f')]=_[_0xb2cf('0x2e')](_0x3f1d97[_0xb2cf('0x2b')],qs[_0xb2cf('0x30')](_0x202937['query'][_0xb2cf('0x30')]));_0x332423[_0xb2cf('0x2f')]=_0x332423[_0xb2cf('0x2f')][_0xb2cf('0x31')]?_0x332423['attributes']:_0x3f1d97['model'];if(!_0x202937[_0xb2cf('0x2c')][_0xb2cf('0x32')](_0xb2cf('0x33'))){_0x332423[_0xb2cf('0x1e')]=qs['limit'](_0x202937['query'][_0xb2cf('0x1e')]);_0x332423[_0xb2cf('0x20')]=qs[_0xb2cf('0x20')](_0x202937[_0xb2cf('0x2c')][_0xb2cf('0x20')]);}_0x332423[_0xb2cf('0x34')]=qs[_0xb2cf('0x35')](_0x202937[_0xb2cf('0x2c')][_0xb2cf('0x35')]);_0x332423[_0xb2cf('0x36')]=qs[_0xb2cf('0x37')](_[_0xb2cf('0x38')](_0x202937['query'],_0x3f1d97[_0xb2cf('0x37')]),_0xdf8fbe);if(_0x202937[_0xb2cf('0x2c')][_0xb2cf('0x39')]){_0x332423[_0xb2cf('0x36')]=_[_0xb2cf('0x3a')](_0x332423[_0xb2cf('0x36')],{'$or':_[_0xb2cf('0x3b')](_0xdf8fbe,function(_0x51c528){if(_0x51c528[_0xb2cf('0x3c')]!=='VIRTUAL'){var _0xaafc28={};_0xaafc28[_0x51c528[_0xb2cf('0x27')]]={'$like':'%'+_0x202937[_0xb2cf('0x2c')][_0xb2cf('0x39')]+'%'};return _0xaafc28;}})});}_0x332423=_['merge']({},_0x332423,_0x202937['options']);var _0x38b905={'where':_0x332423[_0xb2cf('0x36')]};return db[_0xb2cf('0x3d')][_0xb2cf('0x1f')](_0x38b905)[_0xb2cf('0x25')](function(_0x4e8d6e){_0x7bcb88[_0xb2cf('0x1f')]=_0x4e8d6e;if(_0x202937[_0xb2cf('0x2c')][_0xb2cf('0x3e')]){_0x332423['include']=[{'all':!![]}];}return db[_0xb2cf('0x3d')][_0xb2cf('0x3f')](_0x332423);})[_0xb2cf('0x25')](function(_0x1098c6){_0x7bcb88[_0xb2cf('0x40')]=_0x1098c6;return _0x7bcb88;})['then'](respondWithFilteredResult(_0x3362be,_0x332423))[_0xb2cf('0x41')](handleError(_0x3362be,null));};exports[_0xb2cf('0x42')]=function(_0xe30776,_0x583d65){var _0x2562f1={'raw':!![],'where':{'id':_0xe30776[_0xb2cf('0x43')]['id']}},_0x4b19da={};_0x4b19da[_0xb2cf('0x2b')]=_[_0xb2cf('0x2d')](db[_0xb2cf('0x3d')]['rawAttributes']);_0x4b19da['query']=_[_0xb2cf('0x2d')](_0xe30776[_0xb2cf('0x2c')]);_0x4b19da[_0xb2cf('0x37')]=_['intersection'](_0x4b19da[_0xb2cf('0x2b')],_0x4b19da[_0xb2cf('0x2c')]);_0x2562f1['attributes']=_[_0xb2cf('0x2e')](_0x4b19da['model'],qs['fields'](_0xe30776['query']['fields']));_0x2562f1[_0xb2cf('0x2f')]=_0x2562f1['attributes'][_0xb2cf('0x31')]?_0x2562f1[_0xb2cf('0x2f')]:_0x4b19da[_0xb2cf('0x2b')];if(_0xe30776[_0xb2cf('0x2c')][_0xb2cf('0x3e')]){_0x2562f1[_0xb2cf('0x44')]=[{'all':!![]}];}_0x2562f1=_['merge']({},_0x2562f1,_0xe30776['options']);return db['SmsApplication']['find'](_0x2562f1)[_0xb2cf('0x25')](handleEntityNotFound(_0x583d65,null))['then'](respondWithResult(_0x583d65,null))[_0xb2cf('0x41')](handleError(_0x583d65,null));};exports[_0xb2cf('0x45')]=function(_0x450546,_0x5f0953){return db[_0xb2cf('0x3d')][_0xb2cf('0x45')](_0x450546[_0xb2cf('0x46')],{})['then'](respondWithResult(_0x5f0953,0xc9))[_0xb2cf('0x41')](handleError(_0x5f0953,null));};exports[_0xb2cf('0x24')]=function(_0xf8e17e,_0x2d1d15){if(_0xf8e17e['body']['id']){delete _0xf8e17e[_0xb2cf('0x46')]['id'];}return db[_0xb2cf('0x3d')][_0xb2cf('0x47')]({'where':{'id':_0xf8e17e[_0xb2cf('0x43')]['id']}})[_0xb2cf('0x25')](handleEntityNotFound(_0x2d1d15,null))['then'](saveUpdates(_0xf8e17e[_0xb2cf('0x46')],null))[_0xb2cf('0x25')](respondWithResult(_0x2d1d15,null))[_0xb2cf('0x41')](handleError(_0x2d1d15,null));};exports['destroy']=function(_0x24d306,_0x33adac){return db['SmsApplication'][_0xb2cf('0x47')]({'where':{'id':_0x24d306[_0xb2cf('0x43')]['id']}})['then'](handleEntityNotFound(_0x33adac,null))[_0xb2cf('0x25')](removeEntity(_0x33adac,null))[_0xb2cf('0x41')](handleError(_0x33adac,null));}; \ No newline at end of file +var _0xf621=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','count','limit','status','apply','reject','save','update','then','destroy','stack','send','map','rawAttributes','fieldName','type','key','name','query','filters','model','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x21bf3e,_0x82e5f2){var _0x3fdb5a=function(_0x283a53){while(--_0x283a53){_0x21bf3e['push'](_0x21bf3e['shift']());}};_0x3fdb5a(++_0x82e5f2);}(_0xf621,0x121));var _0x1f62=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xf621[_0x421725];return _0x51b322;};'use strict';var emlformat=require(_0x1f62('0x0'));var rimraf=require(_0x1f62('0x1'));var zipdir=require(_0x1f62('0x2'));var jsonpatch=require(_0x1f62('0x3'));var rp=require(_0x1f62('0x4'));var moment=require(_0x1f62('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1f62('0x6'));var path=require(_0x1f62('0x7'));var sox=require(_0x1f62('0x8'));var csv=require(_0x1f62('0x9'));var ejs=require(_0x1f62('0xa'));var fs=require('fs');var fs_extra=require(_0x1f62('0xb'));var _=require(_0x1f62('0xc'));var squel=require(_0x1f62('0xd'));var crypto=require(_0x1f62('0xe'));var jsforce=require(_0x1f62('0xf'));var deskjs=require(_0x1f62('0x10'));var toCsv=require(_0x1f62('0x9'));var querystring=require('querystring');var Papa=require(_0x1f62('0x11'));var Redis=require('ioredis');var authService=require(_0x1f62('0x12'));var qs=require(_0x1f62('0x13'));var as=require(_0x1f62('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f62('0x15'))('api');var utils=require(_0x1f62('0x16'));var config=require(_0x1f62('0x17'));var licenseUtil=require(_0x1f62('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x469005,_0x42bac8){_0x42bac8=_0x42bac8||0xcc;return function(_0x45c2dc){if(_0x45c2dc){return _0x469005['sendStatus'](_0x42bac8);}return _0x469005['status'](_0x42bac8)[_0x1f62('0x19')]();};}function respondWithResult(_0xc19fd2,_0x493d5b){_0x493d5b=_0x493d5b||0xc8;return function(_0x55407e){if(_0x55407e){return _0xc19fd2['status'](_0x493d5b)[_0x1f62('0x1a')](_0x55407e);}};}function respondWithFilteredResult(_0x52d3ea,_0x4818ab){return function(_0x409ef9){if(_0x409ef9){var _0x41baa9=typeof _0x4818ab[_0x1f62('0x1b')]===_0x1f62('0x1c')&&typeof _0x4818ab['limit']===_0x1f62('0x1c');var _0x597d05=_0x409ef9['count'];var _0x379b8c=_0x41baa9?0x0:_0x4818ab[_0x1f62('0x1b')];var _0x29a55f=_0x41baa9?_0x409ef9[_0x1f62('0x1d')]:_0x4818ab['offset']+_0x4818ab[_0x1f62('0x1e')];var _0x2899f2;if(_0x29a55f>=_0x597d05){_0x29a55f=_0x597d05;_0x2899f2=0xc8;}else{_0x2899f2=0xce;}_0x52d3ea[_0x1f62('0x1f')](_0x2899f2);return _0x52d3ea['set']('Content-Range',_0x379b8c+'-'+_0x29a55f+'/'+_0x597d05)['json'](_0x409ef9);}return null;};}function patchUpdates(_0x56a994){return function(_0x34f7c8){try{jsonpatch[_0x1f62('0x20')](_0x34f7c8,_0x56a994,!![]);}catch(_0x59396c){return BPromise[_0x1f62('0x21')](_0x59396c);}return _0x34f7c8[_0x1f62('0x22')]();};}function saveUpdates(_0x5d5ca7,_0x3dc0d3){return function(_0x35431b){if(_0x35431b){return _0x35431b[_0x1f62('0x23')](_0x5d5ca7)[_0x1f62('0x24')](function(_0x489568){return _0x489568;});}return null;};}function removeEntity(_0x43cc08,_0x23ab03){return function(_0xa024e4){if(_0xa024e4){return _0xa024e4[_0x1f62('0x25')]()['then'](function(){_0x43cc08[_0x1f62('0x1f')](0xcc)[_0x1f62('0x19')]();});}};}function handleEntityNotFound(_0x3a2117,_0x1a59b7){return function(_0x2dcbbc){if(!_0x2dcbbc){_0x3a2117['sendStatus'](0x194);}return _0x2dcbbc;};}function handleError(_0x155e5a,_0x126bda){_0x126bda=_0x126bda||0x1f4;return function(_0x37c024){logger['error'](_0x37c024[_0x1f62('0x26')]);if(_0x37c024['name']){delete _0x37c024['name'];}_0x155e5a['status'](_0x126bda)[_0x1f62('0x27')](_0x37c024);};}exports['index']=function(_0x3cdac3,_0x390fd7){var _0x2022f8={},_0x58e534={},_0x408134={'count':0x0,'rows':[]};var _0x2f1533=_[_0x1f62('0x28')](db['SmsApplication'][_0x1f62('0x29')],function(_0x59ddfb){return{'name':_0x59ddfb[_0x1f62('0x2a')],'type':_0x59ddfb[_0x1f62('0x2b')][_0x1f62('0x2c')]};});_0x58e534['model']=_[_0x1f62('0x28')](_0x2f1533,_0x1f62('0x2d'));_0x58e534['query']=_['keys'](_0x3cdac3[_0x1f62('0x2e')]);_0x58e534[_0x1f62('0x2f')]=_['intersection'](_0x58e534[_0x1f62('0x30')],_0x58e534[_0x1f62('0x2e')]);_0x2022f8[_0x1f62('0x31')]=_[_0x1f62('0x32')](_0x58e534[_0x1f62('0x30')],qs['fields'](_0x3cdac3[_0x1f62('0x2e')]['fields']));_0x2022f8[_0x1f62('0x31')]=_0x2022f8[_0x1f62('0x31')]['length']?_0x2022f8[_0x1f62('0x31')]:_0x58e534[_0x1f62('0x30')];if(!_0x3cdac3['query'][_0x1f62('0x33')](_0x1f62('0x34'))){_0x2022f8['limit']=qs[_0x1f62('0x1e')](_0x3cdac3[_0x1f62('0x2e')][_0x1f62('0x1e')]);_0x2022f8['offset']=qs[_0x1f62('0x1b')](_0x3cdac3[_0x1f62('0x2e')]['offset']);}_0x2022f8[_0x1f62('0x35')]=qs[_0x1f62('0x36')](_0x3cdac3[_0x1f62('0x2e')][_0x1f62('0x36')]);_0x2022f8[_0x1f62('0x37')]=qs['filters'](_[_0x1f62('0x38')](_0x3cdac3['query'],_0x58e534[_0x1f62('0x2f')]),_0x2f1533);if(_0x3cdac3['query'][_0x1f62('0x39')]){_0x2022f8[_0x1f62('0x37')]=_[_0x1f62('0x3a')](_0x2022f8[_0x1f62('0x37')],{'$or':_[_0x1f62('0x28')](_0x2f1533,function(_0x4a915a){if(_0x4a915a[_0x1f62('0x2b')]!==_0x1f62('0x3b')){var _0x415d9d={};_0x415d9d[_0x4a915a[_0x1f62('0x2d')]]={'$like':'%'+_0x3cdac3[_0x1f62('0x2e')]['filter']+'%'};return _0x415d9d;}})});}_0x2022f8=_[_0x1f62('0x3a')]({},_0x2022f8,_0x3cdac3[_0x1f62('0x3c')]);var _0x247733={'where':_0x2022f8[_0x1f62('0x37')]};return db[_0x1f62('0x3d')]['count'](_0x247733)[_0x1f62('0x24')](function(_0x18c95c){_0x408134[_0x1f62('0x1d')]=_0x18c95c;if(_0x3cdac3[_0x1f62('0x2e')][_0x1f62('0x3e')]){_0x2022f8[_0x1f62('0x3f')]=[{'all':!![]}];}return db[_0x1f62('0x3d')][_0x1f62('0x40')](_0x2022f8);})['then'](function(_0x2c8886){_0x408134[_0x1f62('0x41')]=_0x2c8886;return _0x408134;})[_0x1f62('0x24')](respondWithFilteredResult(_0x390fd7,_0x2022f8))[_0x1f62('0x42')](handleError(_0x390fd7,null));};exports[_0x1f62('0x43')]=function(_0x2e356a,_0x33018a){var _0x41e559={'raw':!![],'where':{'id':_0x2e356a[_0x1f62('0x44')]['id']}},_0x462004={};_0x462004['model']=_[_0x1f62('0x45')](db[_0x1f62('0x3d')][_0x1f62('0x29')]);_0x462004[_0x1f62('0x2e')]=_[_0x1f62('0x45')](_0x2e356a[_0x1f62('0x2e')]);_0x462004[_0x1f62('0x2f')]=_['intersection'](_0x462004[_0x1f62('0x30')],_0x462004[_0x1f62('0x2e')]);_0x41e559[_0x1f62('0x31')]=_['intersection'](_0x462004[_0x1f62('0x30')],qs[_0x1f62('0x46')](_0x2e356a['query'][_0x1f62('0x46')]));_0x41e559[_0x1f62('0x31')]=_0x41e559[_0x1f62('0x31')]['length']?_0x41e559['attributes']:_0x462004['model'];if(_0x2e356a[_0x1f62('0x2e')][_0x1f62('0x3e')]){_0x41e559[_0x1f62('0x3f')]=[{'all':!![]}];}_0x41e559=_[_0x1f62('0x3a')]({},_0x41e559,_0x2e356a[_0x1f62('0x3c')]);return db['SmsApplication'][_0x1f62('0x47')](_0x41e559)[_0x1f62('0x24')](handleEntityNotFound(_0x33018a,null))[_0x1f62('0x24')](respondWithResult(_0x33018a,null))[_0x1f62('0x42')](handleError(_0x33018a,null));};exports[_0x1f62('0x48')]=function(_0x561dfd,_0x445099){return db[_0x1f62('0x3d')][_0x1f62('0x48')](_0x561dfd['body'],{})['then'](respondWithResult(_0x445099,0xc9))[_0x1f62('0x42')](handleError(_0x445099,null));};exports[_0x1f62('0x23')]=function(_0x4f8607,_0x59a1d7){if(_0x4f8607[_0x1f62('0x49')]['id']){delete _0x4f8607['body']['id'];}return db[_0x1f62('0x3d')][_0x1f62('0x47')]({'where':{'id':_0x4f8607[_0x1f62('0x44')]['id']}})[_0x1f62('0x24')](handleEntityNotFound(_0x59a1d7,null))[_0x1f62('0x24')](saveUpdates(_0x4f8607['body'],null))[_0x1f62('0x24')](respondWithResult(_0x59a1d7,null))['catch'](handleError(_0x59a1d7,null));};exports[_0x1f62('0x25')]=function(_0x5ae016,_0xac995e){return db[_0x1f62('0x3d')][_0x1f62('0x47')]({'where':{'id':_0x5ae016[_0x1f62('0x44')]['id']}})['then'](handleEntityNotFound(_0xac995e,null))[_0x1f62('0x24')](removeEntity(_0xac995e,null))['catch'](handleError(_0xac995e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ae620bb..666087c 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 _0x1458=['bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','../../config/logger','moment'];(function(_0x38a29d,_0x4d8edd){var _0x2e5fb5=function(_0x2b06d2){while(--_0x2b06d2){_0x38a29d['push'](_0x38a29d['shift']());}};_0x2e5fb5(++_0x4d8edd);}(_0x1458,0x98));var _0x8145=function(_0x2f9cbc,_0x42cf1b){_0x2f9cbc=_0x2f9cbc-0x0;var _0xd91e8=_0x1458[_0x2f9cbc];return _0xd91e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8145('0x0'))('api');var moment=require(_0x8145('0x1'));var BPromise=require(_0x8145('0x2'));var rp=require(_0x8145('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8145('0x4'));var config=require(_0x8145('0x5'));var attributes=require('./smsApplication.attributes');module[_0x8145('0x6')]=function(_0x291f6a,_0x25a4a2){return _0x291f6a[_0x8145('0x7')](_0x8145('0x8'),attributes,{'tableName':_0x8145('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8145('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x8b8d=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci'];(function(_0x23527c,_0x3e1630){var _0x2e6c2c=function(_0x501504){while(--_0x501504){_0x23527c['push'](_0x23527c['shift']());}};_0x2e6c2c(++_0x3e1630);}(_0x8b8d,0x111));var _0xd8b8=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x8b8d[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0xd8b8('0x0'));var util=require(_0xd8b8('0x1'));var logger=require(_0xd8b8('0x2'))(_0xd8b8('0x3'));var moment=require(_0xd8b8('0x4'));var BPromise=require(_0xd8b8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8b8('0x6'));var config=require(_0xd8b8('0x7'));var attributes=require(_0xd8b8('0x8'));module['exports']=function(_0x1c2931,_0x3a3b59){return _0x1c2931[_0xd8b8('0x9')](_0xd8b8('0xa'),attributes,{'tableName':_0xd8b8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd8b8('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 87caa1c..de266ca 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 _0x3e22=['http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsApplication,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x1277a3,_0xfa0e66){var _0x3c6822=function(_0x367b65){while(--_0x367b65){_0x1277a3['push'](_0x1277a3['shift']());}};_0x3c6822(++_0xfa0e66);}(_0x3e22,0xa8));var _0x23e2=function(_0x584098,_0x16cb1d){_0x584098=_0x584098-0x0;var _0x242bb6=_0x3e22[_0x584098];return _0x242bb6;};'use strict';var _=require('lodash');var util=require(_0x23e2('0x0'));var moment=require('moment');var BPromise=require(_0x23e2('0x1'));var rs=require(_0x23e2('0x2'));var fs=require('fs');var Redis=require(_0x23e2('0x3'));var db=require(_0x23e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23e2('0x5'));var config=require(_0x23e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23e2('0x7')][_0x23e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a8351,_0x927fbb,_0xb71434){return new BPromise(function(_0x4c13ae,_0x64c91b){return client[_0x23e2('0x9')](_0x3a8351,_0xb71434)[_0x23e2('0xa')](function(_0x75da0a){logger[_0x23e2('0xb')]('SmsApplication,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));logger[_0x23e2('0xd')](_0x23e2('0xe'),_0x927fbb,_0x23e2('0xc'),JSON[_0x23e2('0xf')](_0x75da0a));if(_0x75da0a['error']){if(_0x75da0a['error'][_0x23e2('0x10')]===0x1f4){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x64c91b(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);return _0x4c13ae(_0x75da0a[_0x23e2('0x11')][_0x23e2('0x13')]);}else{logger[_0x23e2('0xb')]('SmsApplication,\x20%s,\x20%s',_0x927fbb,_0x23e2('0xc'));_0x4c13ae(_0x75da0a[_0x23e2('0x14')][_0x23e2('0x13')]);}})[_0x23e2('0x15')](function(_0x276c2d){logger[_0x23e2('0x11')](_0x23e2('0x12'),_0x927fbb,_0x276c2d);_0x64c91b(_0x276c2d);});});} \ No newline at end of file +var _0xa0a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','randomstring','ioredis'];(function(_0x32f9a6,_0x30824d){var _0x7031e5=function(_0x8e6583){while(--_0x8e6583){_0x32f9a6['push'](_0x32f9a6['shift']());}};_0x7031e5(++_0x30824d);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x2bfdd0,_0x539519){_0x2bfdd0=_0x2bfdd0-0x0;var _0x1ef3c7=_0xa0a3[_0x2bfdd0];return _0x1ef3c7;};'use strict';var _=require('lodash');var util=require(_0x3a0a('0x0'));var moment=require(_0x3a0a('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a0a('0x2'));var fs=require('fs');var Redis=require(_0x3a0a('0x3'));var db=require(_0x3a0a('0x4'))['db'];var utils=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var config=require(_0x3a0a('0x8'));var jayson=require(_0x3a0a('0x9'));var client=jayson[_0x3a0a('0xa')][_0x3a0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4719d,_0x451873,_0x1766c1){return new BPromise(function(_0x5d98d3,_0x56ee1b){return client[_0x3a0a('0xc')](_0x4719d,_0x1766c1)[_0x3a0a('0xd')](function(_0x29207e){logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));logger[_0x3a0a('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x451873,'request\x20sent',JSON[_0x3a0a('0x12')](_0x29207e));if(_0x29207e[_0x3a0a('0x13')]){if(_0x29207e['error']['code']===0x1f4){logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e['error'][_0x3a0a('0x14')]);return _0x56ee1b(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}logger[_0x3a0a('0x13')](_0x3a0a('0xf'),_0x451873,_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);return _0x5d98d3(_0x29207e[_0x3a0a('0x13')][_0x3a0a('0x14')]);}else{logger[_0x3a0a('0xe')](_0x3a0a('0xf'),_0x451873,_0x3a0a('0x10'));_0x5d98d3(_0x29207e[_0x3a0a('0x15')][_0x3a0a('0x14')]);}})['catch'](function(_0x41a6b0){logger['error'](_0x3a0a('0xf'),_0x451873,_0x41a6b0);_0x56ee1b(_0x41a6b0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 2136659..eba3d9e 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 _0x0713=['put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','smsinteraction:addtags','addTags'];(function(_0x31839c,_0x4a1a81){var _0x2640d7=function(_0x2fc3a5){while(--_0x2fc3a5){_0x31839c['push'](_0x31839c['shift']());}};_0x2640d7(++_0x4a1a81);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x8')]('/:id/download',auth[_0x3071('0x9')](),controller[_0x3071('0x10')]);router[_0x3071('0x11')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['post']('/:id/messages',auth[_0x3071('0x9')](),controller['addMessage']);router[_0x3071('0x11')](_0x3071('0x13'),auth['isAuthenticated'](),interaction[_0x3071('0x14')]('sms',_0x3071('0x15')),controller[_0x3071('0x16')]);router[_0x3071('0x17')](_0x3071('0xd'),auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x19')),controller[_0x3071('0x1a')]);router[_0x3071('0x1b')]('/:id',auth[_0x3071('0x9')](),interaction[_0x3071('0x14')](_0x3071('0x18'),_0x3071('0x1c')),controller[_0x3071('0x1d')]);router[_0x3071('0x1b')](_0x3071('0x13'),auth[_0x3071('0x9')](),controller['removeTags']);module[_0x3071('0x1e')]=router; \ No newline at end of file +var _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3a031f,_0x3d1ba3){var _0xb32f01=function(_0x35e6e2){while(--_0x35e6e2){_0x3a031f['push'](_0x3a031f['shift']());}};_0xb32f01(++_0x3d1ba3);}(_0x2547,0x1cd));var _0x7254=function(_0x565bb0,_0x1ea802){_0x565bb0=_0x565bb0-0x0;var _0x564490=_0x2547[_0x565bb0];return _0x564490;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index cf0df5e..dc87956 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 _0x9879=['sequelize','moment','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0x9879,0x98));var _0x9987=function(_0x3b58a7,_0x535481){_0x3b58a7=_0x3b58a7-0x0;var _0x1c2172=_0x9879[_0x3b58a7];return _0x1c2172;};'use strict';var Sequelize=require(_0x9987('0x0'));var moment=require(_0x9987('0x1'));module[_0x9987('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9987('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9987('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9987('0x4')]},'note':{'type':Sequelize[_0x9987('0x4')]},'phone':{'type':Sequelize[_0x9987('0x4')]},'read1stAt':{'type':Sequelize[_0x9987('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x9987('0x5')]('in',_0x9987('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x9987('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9987('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xabe8=['STRING','ENUM','out','BOOLEAN','sequelize','moment','exports','DATE'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xabe8,0x8c));var _0x8abe=function(_0x633d7a,_0x44a62d){_0x633d7a=_0x633d7a-0x0;var _0x2f9d86=_0xabe8[_0x633d7a];return _0x2f9d86;};'use strict';var Sequelize=require(_0x8abe('0x0'));var moment=require(_0x8abe('0x1'));module[_0x8abe('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8abe('0x3')]},'disposition':{'type':Sequelize[_0x8abe('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8abe('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8abe('0x4')]},'read1stAt':{'type':Sequelize[_0x8abe('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8abe('0x5')]('in',_0x8abe('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8abe('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8abe('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f7433c6..0ee0a3d 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 _0x10b8=['buildExpression','text','start','Tag','User','operator','$substring','body','some','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','SmsInteraction','unreadMessages','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','params','include','create','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','server','root','files','attachments','join','format','transcript-%d-%s.zip','fullname','CmContact','Contact','Messages','createdAt','direction','secret','SmsAccount','Account','Owner','get','closedAt','disposition','out','System','lastName','renderFile','views','Sms','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','update','destroy','error','stack','name','send','Users','TagIds','split','forEach','Tags','push','then','catch','talking','answered','unmanaged','total','UserId','waiting','closed','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','user_has_sms_interactions','sms_interactions','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20>\x200','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId'];(function(_0x319a03,_0x4456d4){var _0x3b6704=function(_0x1f3476){while(--_0x1f3476){_0x319a03['push'](_0x319a03['shift']());}};_0x3b6704(++_0x4456d4);}(_0x10b8,0x166));var _0x810b=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x10b8[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x810b('0x0'));var rimraf=require(_0x810b('0x1'));var zipdir=require(_0x810b('0x2'));var jsonpatch=require(_0x810b('0x3'));var rp=require(_0x810b('0x4'));var moment=require(_0x810b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x810b('0x6'));var util=require(_0x810b('0x7'));var path=require(_0x810b('0x8'));var sox=require('sox');var csv=require(_0x810b('0x9'));var ejs=require(_0x810b('0xa'));var fs=require('fs');var fs_extra=require(_0x810b('0xb'));var _=require(_0x810b('0xc'));var squel=require(_0x810b('0xd'));var crypto=require(_0x810b('0xe'));var jsforce=require(_0x810b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x810b('0x9'));var querystring=require('querystring');var Papa=require(_0x810b('0x10'));var Redis=require(_0x810b('0x11'));var authService=require(_0x810b('0x12'));var qs=require(_0x810b('0x13'));var as=require(_0x810b('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x810b('0x15'));var logger=require(_0x810b('0x16'))(_0x810b('0x17'));var utils=require(_0x810b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x810b('0x19'));var db=require(_0x810b('0x1a'))['db'];config[_0x810b('0x1b')]=_[_0x810b('0x1c')](config[_0x810b('0x1b')],{'host':_0x810b('0x1d'),'port':0x18eb});var socket=require(_0x810b('0x1e'))(new Redis(config[_0x810b('0x1b')]));require(_0x810b('0x1f'))[_0x810b('0x20')](socket);function respondWithStatusCode(_0x4d7dcd,_0x5cce48){_0x5cce48=_0x5cce48||0xcc;return function(_0x249f8a){if(_0x249f8a){return _0x4d7dcd[_0x810b('0x21')](_0x5cce48);}return _0x4d7dcd[_0x810b('0x22')](_0x5cce48)[_0x810b('0x23')]();};}function respondWithResult(_0x3a8115,_0x31bd51){_0x31bd51=_0x31bd51||0xc8;return function(_0x6370c){if(_0x6370c){return _0x3a8115[_0x810b('0x22')](_0x31bd51)[_0x810b('0x24')](_0x6370c);}};}function respondWithFilteredResult(_0x1cdcee,_0x4a31a6){return function(_0x3424bc){if(_0x3424bc){var _0x540741=typeof _0x4a31a6[_0x810b('0x25')]===_0x810b('0x26')&&typeof _0x4a31a6[_0x810b('0x27')]==='undefined';var _0x350e1f=_0x3424bc['count'];var _0x1ee0a0=_0x540741?0x0:_0x4a31a6['offset'];var _0x2906df=_0x540741?_0x3424bc['count']:_0x4a31a6[_0x810b('0x25')]+_0x4a31a6[_0x810b('0x27')];var _0x288ceb;if(_0x2906df>=_0x350e1f){_0x2906df=_0x350e1f;_0x288ceb=0xc8;}else{_0x288ceb=0xce;}_0x1cdcee['status'](_0x288ceb);return _0x1cdcee[_0x810b('0x28')]('Content-Range',_0x1ee0a0+'-'+_0x2906df+'/'+_0x350e1f)[_0x810b('0x24')](_0x3424bc);}return null;};}function patchUpdates(_0x214610){return function(_0x199acf){try{jsonpatch[_0x810b('0x29')](_0x199acf,_0x214610,!![]);}catch(_0x4fdf04){return BPromise[_0x810b('0x2a')](_0x4fdf04);}return _0x199acf['save']();};}function saveUpdates(_0x6284c7,_0x26e8c9){return function(_0x37bed2){if(_0x37bed2){return _0x37bed2[_0x810b('0x2b')](_0x6284c7)['then'](function(_0x2cf6e4){return _0x2cf6e4;});}return null;};}function removeEntity(_0x4bd4f9,_0x8fa638){return function(_0x466211){if(_0x466211){return _0x466211[_0x810b('0x2c')]()['then'](function(){_0x4bd4f9[_0x810b('0x22')](0xcc)[_0x810b('0x23')]();});}};}function handleEntityNotFound(_0x430a8e,_0x2e03a1){return function(_0x1e6ebf){if(!_0x1e6ebf){_0x430a8e[_0x810b('0x21')](0x194);}return _0x1e6ebf;};}function handleError(_0x4f1770,_0x4eb0f3){_0x4eb0f3=_0x4eb0f3||0x1f4;return function(_0x190f9d){logger[_0x810b('0x2d')](_0x190f9d[_0x810b('0x2e')]);if(_0x190f9d['name']){delete _0x190f9d[_0x810b('0x2f')];}_0x4f1770['status'](_0x4eb0f3)[_0x810b('0x30')](_0x190f9d);};}function getInteractionUsers(_0xa52aa8,_0x387221){return new BPromise(function(_0x34f72c,_0x83448b){try{if(_0x387221[_0xa52aa8['id']]){_0xa52aa8[_0x810b('0x31')]=_['map'](_0x387221[_0xa52aa8['id']],function(_0x435b45){return{'id':_0x435b45['id'],'fullname':_0x435b45['fullname']};});}}catch(_0xd00df){_0x83448b(_0xd00df);}_0x34f72c(_0xa52aa8);});}function getInteractionTags(_0x46582e,_0x450925){return new BPromise(function(_0x551209,_0x41264c){try{if(_0x46582e[_0x810b('0x32')]){_0x46582e['Tags']=[];_0x46582e[_0x810b('0x32')][_0x810b('0x33')](',')[_0x810b('0x34')](function(_0x5cead3){_0x46582e[_0x810b('0x35')][_0x810b('0x36')](_0x450925[_0x5cead3]);});}delete _0x46582e[_0x810b('0x32')];}catch(_0x5286c1){_0x41264c(_0x5286c1);}_0x551209(_0x46582e);});}function updateSmsInteraction(_0x16b723,_0x5e760f,_0xd35d3){return new BPromise(function(_0x5c30cd,_0x1a1626){return getInteractionUsers(_0x16b723,_0xd35d3)[_0x810b('0x37')](function(_0x9224cd){return getInteractionTags(_0x9224cd,_0x5e760f);})['then'](function(_0x3cbe75){return getStateInteraction(_0x3cbe75);})[_0x810b('0x37')](function(_0x44e5a9){_0x5c30cd(_0x44e5a9);})[_0x810b('0x38')](function(_0x22a7c2){_0x1a1626(_0x22a7c2);});});}function getStateInteraction(_0x399fe9){return new BPromise(function(_0x3e8ffd,_0x32f3f){_0x399fe9['waiting']=0x0;_0x399fe9[_0x810b('0x39')]=0x0;_0x399fe9[_0x810b('0x3a')]=0x0;_0x399fe9[_0x810b('0x3b')]=0x0;_0x399fe9[_0x810b('0x3c')]=0x0;if(!_0x399fe9['closed']&&!_0x399fe9[_0x810b('0x3d')])_0x399fe9[_0x810b('0x3e')]+=0x1;if(!_0x399fe9[_0x810b('0x3f')]&&_0x399fe9[_0x810b('0x3d')])_0x399fe9[_0x810b('0x39')]+=0x1;if(_0x399fe9[_0x810b('0x3f')]&&_0x399fe9['UserId'])_0x399fe9[_0x810b('0x3a')]+=0x1;if(_0x399fe9[_0x810b('0x3f')]&&!_0x399fe9[_0x810b('0x3d')])_0x399fe9[_0x810b('0x3b')]+=0x1;_0x399fe9[_0x810b('0x3c')]+=0x1;_0x3e8ffd(_0x399fe9);});}exports['index']=function(_0x5ca785,_0x2710e5){var _0x575dbb={},_0x40c72d={},_0x1a2093={'count':0x0,'rows':[]};var _0x39fa08=_[_0x810b('0x40')](db['SmsInteraction'][_0x810b('0x41')],function(_0x59bed3){return{'name':_0x59bed3[_0x810b('0x42')],'type':_0x59bed3[_0x810b('0x43')][_0x810b('0x44')]};});_0x40c72d[_0x810b('0x45')]=_[_0x810b('0x40')](_0x39fa08,_0x810b('0x2f'));_0x40c72d[_0x810b('0x46')]=_[_0x810b('0x47')](_0x5ca785['query']);_0x40c72d[_0x810b('0x48')]=_[_0x810b('0x49')](_0x40c72d[_0x810b('0x45')],_0x40c72d['query']);_0x575dbb[_0x810b('0x4a')]=_[_0x810b('0x49')](_0x40c72d['model'],qs[_0x810b('0x4b')](_0x5ca785['query'][_0x810b('0x4b')]));_0x575dbb[_0x810b('0x4a')]=_0x575dbb[_0x810b('0x4a')][_0x810b('0x4c')]?_0x575dbb[_0x810b('0x4a')]:_0x40c72d[_0x810b('0x45')];if(!_0x5ca785[_0x810b('0x46')][_0x810b('0x4d')](_0x810b('0x4e'))){_0x575dbb[_0x810b('0x27')]=qs[_0x810b('0x27')](_0x5ca785[_0x810b('0x46')][_0x810b('0x27')]);_0x575dbb['offset']=qs[_0x810b('0x25')](_0x5ca785['query'][_0x810b('0x25')]);}_0x575dbb[_0x810b('0x4f')]=qs['sort'](_0x5ca785[_0x810b('0x46')][_0x810b('0x50')]);_0x575dbb[_0x810b('0x51')]=qs[_0x810b('0x48')](_[_0x810b('0x52')](_0x5ca785[_0x810b('0x46')],_0x40c72d[_0x810b('0x48')]),_0x39fa08);var _0x28d295=[];var _0x414130=squel['select']()[_0x810b('0x53')]('id')[_0x810b('0x53')]('name')[_0x810b('0x53')](_0x810b('0x54'))[_0x810b('0x55')](_0x810b('0x56'));var _0x32198e=squel[_0x810b('0x57')]()[_0x810b('0x53')](_0x810b('0x58'))[_0x810b('0x53')](_0x810b('0x59'))[_0x810b('0x53')]('ui.SmsInteractionId')['from'](_0x810b('0x5a'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x221a52=squel[_0x810b('0x57')]()[_0x810b('0x55')](_0x810b('0x5b'),'i')[_0x810b('0x5c')](_0x810b('0x5d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x810b('0x5c')](_0x810b('0x5e'),'o',_0x810b('0x5f'))[_0x810b('0x5c')](_0x810b('0x60'),'a',_0x810b('0x61'))[_0x810b('0x5c')]('sms_messages','me',_0x810b('0x62'))[_0x810b('0x5c')](_0x810b('0x63'),'it',_0x810b('0x64'))['left_join']('tools_tags','t',_0x810b('0x65'));var _0x5e4392=squel[_0x810b('0x66')]();var _0x2daf51=[];var _0x1dbc6a=squel[_0x810b('0x66')]();var _0x1c3a0;if(_0x5ca785[_0x810b('0x46')][_0x810b('0x67')]){_0x1c3a0=as[_0x810b('0x68')](_0x5ca785[_0x810b('0x46')][_0x810b('0x67')]);var _0x295b1f=_0x1c3a0[_0x810b('0x69')];for(var _0x3b45af=0x0;_0x3b45af<_0x1c3a0[_0x810b('0x6a')][_0x810b('0x4c')];_0x3b45af++){var _0x22ae26=_0x1c3a0[_0x810b('0x6a')][_0x3b45af];var _0x5ea523='i';var _0x4578ce=_[_0x810b('0x6b')](_0x39fa08,['name',_0x22ae26[_0x810b('0x53')]]);if(!_0x4578ce){switch(_0x22ae26['field']){case'unreadMessages':if(_0x22ae26[_0x810b('0x6c')]==0x1){_0x221a52[_0x810b('0x6d')]('`'+_0x22ae26[_0x810b('0x53')]+'`\x20=\x200');}else{_0x221a52[_0x810b('0x6d')]('`'+_0x22ae26[_0x810b('0x53')]+_0x810b('0x6e'));}break;case'Contact':if(_0x22ae26['operator']==='$substring'){if(_0x22ae26[_0x810b('0x6c')][_0x810b('0x33')]('\x20')[_0x810b('0x4c')]>0x1){_0x5e4392[_0x295b1f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x810b('0x6f')](_0x22ae26[_0x810b('0x6c')]),null);}else{var _0x2fe653='%'+_0x22ae26[_0x810b('0x6c')]+'%';_0x5e4392[_0x295b1f](_0x810b('0x70'),_0x2fe653,_0x2fe653,_0x2fe653);}}else{_0x4578ce=_['find'](_0x39fa08,[_0x810b('0x2f'),'ContactId']);_0x22ae26[_0x810b('0x53')]=_0x810b('0x71');_0x3b2448=as[_0x810b('0x72')](_0x5ea523,_0x4578ce[_0x810b('0x43')],_0x22ae26);_0x5e4392[_0x295b1f](_0x3b2448[_0x810b('0x73')],_0x3b2448[_0x810b('0x6c')][_0x810b('0x74')],_0x3b2448['value']['end']);}break;case _0x810b('0x75'):var _0xca30dd=_0x22ae26[_0x810b('0x6c')][_0x810b('0x33')](',')['map'](function(_0x248ae0){return Number(_0x248ae0);});_0xca30dd[_0x810b('0x34')](function(_0x1b68ee){_0x1dbc6a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b68ee+',%');});_0x2daf51=_['union'](_0x2daf51,_0xca30dd);break;case _0x810b('0x76'):if(_0x22ae26[_0x810b('0x77')]===_0x810b('0x78')){_0x5e4392[_0x295b1f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x22ae26[_0x810b('0x6c')]+'%',null);}else{_0x4578ce=_['find'](_0x39fa08,[_0x810b('0x2f'),_0x810b('0x3d')]);_0x22ae26[_0x810b('0x53')]=_0x810b('0x3d');_0x3b2448=as[_0x810b('0x72')](_0x5ea523,_0x4578ce[_0x810b('0x43')],_0x22ae26);_0x5e4392[_0x295b1f](_0x3b2448['text'],_0x3b2448[_0x810b('0x6c')][_0x810b('0x74')],_0x3b2448[_0x810b('0x6c')][_0x810b('0x23')]);}break;case _0x810b('0x79'):_0x3b2448=as[_0x810b('0x72')]('me',null,_0x22ae26);_0x5e4392[_0x295b1f](_0x3b2448[_0x810b('0x73')],_0x3b2448[_0x810b('0x6c')][_0x810b('0x74')],_0x3b2448[_0x810b('0x6c')]['end']);break;}}else{var _0x3b2448=as[_0x810b('0x72')](_0x5ea523,_0x4578ce[_0x810b('0x43')],_0x22ae26);_0x5e4392[_0x295b1f](_0x3b2448[_0x810b('0x73')],_0x3b2448[_0x810b('0x6c')][_0x810b('0x74')],_0x3b2448['value'][_0x810b('0x23')]);}}}else{var _0x4d3447=_(_0x5ca785[_0x810b('0x46')])[_0x810b('0x47')]()[_0x810b('0x40')](function(_0x565797){return _[_0x810b('0x7a')](_0x39fa08,['name',_0x565797])?_0x565797:undefined;})[_0x810b('0x7b')]()[_0x810b('0x6c')]();if(!_['isEmpty'](_0x4d3447)){_0x4d3447[_0x810b('0x34')](function(_0x2a94d9){if(_0x2a94d9===_0x810b('0x7c')){_0x221a52[_0x810b('0x51')](_0x810b('0x7d'),[][_0x810b('0x7e')](_0x5ca785[_0x810b('0x46')][_0x2a94d9]));}else if(_0x2a94d9==='createdAt'){var _0x28a0d4=JSON[_0x810b('0x7f')](_0x5ca785[_0x810b('0x46')][_0x2a94d9])[_0x810b('0x80')];var _0x2c20cc=JSON[_0x810b('0x7f')](_0x5ca785['query'][_0x2a94d9])[_0x810b('0x81')];_0x221a52[_0x810b('0x51')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x28a0d4,_0x2c20cc);}else{if(_0x5ca785['query'][_0x2a94d9]===_0x810b('0x82')){_0x221a52[_0x810b('0x51')]('i.'+_0x2a94d9+'\x20IS\x20NULL');}else{_0x221a52[_0x810b('0x51')]('i.'+_0x2a94d9+_0x810b('0x83'),_0x5ca785[_0x810b('0x46')][_0x2a94d9]);}}});}if(_0x5ca785['query']['read']){if(_0x5ca785[_0x810b('0x46')][_0x810b('0x84')]==0x1){_0x221a52[_0x810b('0x6d')](_0x810b('0x85'));}else{_0x221a52[_0x810b('0x6d')]('`unreadMessages`\x20>\x200');}}if(_0x5ca785['query']['tag']){_0x2daf51=_[_0x810b('0x86')](_0x5ca785[_0x810b('0x46')][_0x810b('0x87')])?_0x5ca785[_0x810b('0x46')][_0x810b('0x87')]:new Array(_0x5ca785[_0x810b('0x46')][_0x810b('0x87')]);_0x2daf51[_0x810b('0x34')](function(_0x1430ad){_0x1dbc6a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1430ad+',%');});}if(_0x5ca785[_0x810b('0x46')][_0x810b('0x88')]){var _0x48f89f=_0x5ca785[_0x810b('0x46')][_0x810b('0x88')][_0x810b('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x810b('0x8a')](_0x48f89f)){_0x5e4392['or']('i.id\x20LIKE\x20?',_0x48f89f+'%')['or']('i.phone\x20LIKE\x20?',_0x48f89f+'%');}else{_0x5e4392['or'](_0x810b('0x8b'),qs[_0x810b('0x6f')](_0x48f89f))['or'](_0x810b('0x8c'),_0x48f89f+'%');}}}_0x221a52['where'](_0x5e4392);_0x221a52[_0x810b('0x8d')](_0x810b('0x8e'));var _0xd1d77={'type':db[_0x810b('0x8f')][_0x810b('0x90')][_0x810b('0x91')],'raw':!![]};var _0x568e08=_0x221a52['clone']();_0x568e08[_0x810b('0x53')](_0x810b('0x8e'));_0x568e08[_0x810b('0x53')](_0x810b('0x92'),'unreadMessages');if(_0x575dbb[_0x810b('0x4f')]){_0x575dbb[_0x810b('0x4f')][_0x810b('0x34')](function(_0x7c3eb7){var _0x1f5081=_0x7c3eb7[0x0]===_0x810b('0x93')?_0x7c3eb7[0x0]:'i.'+_0x7c3eb7[0x0];_0x221a52[_0x810b('0x4f')](_0x1f5081,_0x7c3eb7[0x1]===_0x810b('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x2daf51)){_0x221a52[_0x810b('0x6d')](_0x1dbc6a);_0x568e08[_0x810b('0x51')]('t.id\x20IN\x20?',_0x2daf51);}BPromise[_0x810b('0x95')]()[_0x810b('0x37')](function(){if(!_0x1c3a0){if(_0x5ca785[_0x810b('0x46')]['SmsAccountId'])return;_0x568e08[_0x810b('0x51')](_0x810b('0x96'));_0x221a52[_0x810b('0x51')](_0x810b('0x96'));return;}if(_0x5ca785[_0x810b('0x97')][_0x810b('0x98')]!==_0x810b('0x99'))return;return _0x5ca785[_0x810b('0x97')][_0x810b('0x9a')]({'attributes':['id'],'raw':!![]})[_0x810b('0x37')](function(_0x4c82d2){if(_[_0x810b('0x9b')](_0x4c82d2)){_0x568e08[_0x810b('0x51')](_0x810b('0x9c'));_0x221a52['where'](_0x810b('0x9c'));}else{_0x568e08[_0x810b('0x51')]('i.SmsAccountId\x20IN\x20?',_[_0x810b('0x40')](_0x4c82d2,'id'));_0x221a52[_0x810b('0x51')](_0x810b('0x7d'),_[_0x810b('0x40')](_0x4c82d2,'id'));}});})['then'](function(){if(_0x5ca785['user'][_0x810b('0x98')]===_0x810b('0x99')&&!_0x1c3a0&&!_0x5ca785[_0x810b('0x46')][_0x810b('0x7c')])return[];return db[_0x810b('0x9d')][_0x810b('0x46')](_0x568e08[_0x810b('0x9e')](),_0xd1d77);})[_0x810b('0x37')](function(_0x424d61){_0x1a2093[_0x810b('0x9f')]=_0x424d61[_0x810b('0x4c')];if(_0x1a2093[_0x810b('0x9f')]===0x0)return[];return db[_0x810b('0x9d')][_0x810b('0x46')](_0x414130[_0x810b('0x9e')](),_0xd1d77)[_0x810b('0x37')](function(_0x578e30){_0x28d295=_[_0x810b('0xa0')](_0x578e30,'id');_0xd1d77=_[_0x810b('0xa1')](_0xd1d77,{'model':db[_0x810b('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ca785[_0x810b('0x46')]['fields']){_0x575dbb[_0x810b('0x4a')]['forEach'](function(_0x48a267){_0x221a52[_0x810b('0x53')]('i.'+_0x48a267);});}else{_0x221a52[_0x810b('0x53')](_0x810b('0x92'),_0x810b('0xa3'));_0x221a52['field'](_0x810b('0xa4'),'Account.key');_0x221a52[_0x810b('0x53')](_0x810b('0xa5'),'Account.mandatoryDisposition');_0x221a52[_0x810b('0x53')](_0x810b('0xa6'),_0x810b('0x93'));_0x221a52[_0x810b('0x53')]('i.*');_0x221a52[_0x810b('0x53')](_0x810b('0xa7'),_0x810b('0xa8'));_0x221a52['field'](_0x810b('0xa9'),_0x810b('0xaa'));_0x221a52['field'](_0x810b('0xab'),_0x810b('0xac'));_0x221a52[_0x810b('0x53')](_0x810b('0xad'),'Contact.phone');_0x221a52[_0x810b('0x53')](_0x810b('0xae'),_0x810b('0xaf'));_0x221a52[_0x810b('0x53')](_0x810b('0xb0'),'Contact.fax');_0x221a52[_0x810b('0x53')](_0x810b('0xb1'),'Owner.fullname');_0x221a52[_0x810b('0x53')](_0x810b('0xb2'),'Owner.internal');_0x221a52['field'](_0x810b('0xb3'),_0x810b('0x32'));}if(_0x575dbb[_0x810b('0x27')])_0x221a52['limit'](_0x575dbb[_0x810b('0x27')]);if(_0x575dbb['offset'])_0x221a52[_0x810b('0x25')](_0x575dbb[_0x810b('0x25')]);return db['sequelize'][_0x810b('0x46')](_0x221a52[_0x810b('0x9e')](),_0xd1d77);})['then'](function(_0x512b89){if(_0x512b89[_0x810b('0x4c')]>0x0)_0x32198e[_0x810b('0x51')](_0x810b('0xb4'),_['map'](_0x512b89,'id'));return db[_0x810b('0x9d')][_0x810b('0x46')](_0x32198e[_0x810b('0x9e')](),_0xd1d77)[_0x810b('0x37')](function(_0x20d233){var _0x35af0b=_[_0x810b('0xb5')](_0x20d233,_0x810b('0xb6'));var _0xcd64f4=[];_0x512b89[_0x810b('0x34')](function(_0x25657c){_0xcd64f4[_0x810b('0x36')](updateSmsInteraction(_0x25657c,_0x28d295,_0x35af0b));});return BPromise[_0x810b('0xb7')](_0xcd64f4);});});})[_0x810b('0x37')](function(_0xecbeab){_0x1a2093['rows']=_0xecbeab;return _0x1a2093;})['then'](respondWithFilteredResult(_0x2710e5,_0x575dbb))[_0x810b('0x38')](handleError(_0x2710e5,null));};exports['show']=function(_0x4935b9,_0x4c8ca2){var _0x54d3df={'raw':![],'where':{'id':_0x4935b9[_0x810b('0xb8')]['id']}},_0x2808c3={};_0x2808c3[_0x810b('0x45')]=_[_0x810b('0x47')](db[_0x810b('0xa2')]['rawAttributes']);_0x2808c3[_0x810b('0x46')]=_[_0x810b('0x47')](_0x4935b9[_0x810b('0x46')]);_0x2808c3[_0x810b('0x48')]=_['intersection'](_0x2808c3[_0x810b('0x45')],_0x2808c3['query']);_0x54d3df['attributes']=_[_0x810b('0x49')](_0x2808c3[_0x810b('0x45')],qs['fields'](_0x4935b9[_0x810b('0x46')][_0x810b('0x4b')]));_0x54d3df[_0x810b('0x4a')]=_0x54d3df[_0x810b('0x4a')][_0x810b('0x4c')]?_0x54d3df[_0x810b('0x4a')]:_0x2808c3[_0x810b('0x45')];if(_0x4935b9[_0x810b('0x46')]['includeAll']){_0x54d3df[_0x810b('0xb9')]=[{'all':!![]}];}_0x54d3df=_[_0x810b('0xa1')]({},_0x54d3df,_0x4935b9['options']);return db[_0x810b('0xa2')]['find'](_0x54d3df)[_0x810b('0x37')](handleEntityNotFound(_0x4c8ca2,null))[_0x810b('0x37')](respondWithResult(_0x4c8ca2,null))['catch'](handleError(_0x4c8ca2,null));};exports[_0x810b('0xba')]=function(_0x1fe365,_0x530fe0){return db[_0x810b('0xa2')][_0x810b('0xba')](_0x1fe365['body'],{})['then'](respondWithResult(_0x530fe0,0xc9))['catch'](handleError(_0x530fe0,null));};exports[_0x810b('0x2b')]=function(_0x6b7af4,_0x3bf3bf){if(_0x6b7af4[_0x810b('0x79')]['id']){delete _0x6b7af4[_0x810b('0x79')]['id'];}return db[_0x810b('0xa2')][_0x810b('0x6b')]({'where':{'id':_0x6b7af4[_0x810b('0xb8')]['id']}})[_0x810b('0x37')](handleEntityNotFound(_0x3bf3bf,null))[_0x810b('0x37')](saveUpdates(_0x6b7af4[_0x810b('0x79')],null))[_0x810b('0x37')](respondWithResult(_0x3bf3bf,null))[_0x810b('0x38')](handleError(_0x3bf3bf,null));};exports[_0x810b('0x2c')]=function(_0x554798,_0x158b09){return db[_0x810b('0xa2')][_0x810b('0x6b')]({'where':{'id':_0x554798[_0x810b('0xb8')]['id']}})[_0x810b('0x37')](handleEntityNotFound(_0x158b09,null))[_0x810b('0x37')](removeEntity(_0x158b09,null))[_0x810b('0x38')](handleError(_0x158b09,null));};exports[_0x810b('0xbb')]=function(_0x416ffd,_0x118099){return db[_0x810b('0xa2')][_0x810b('0xbb')]()[_0x810b('0x37')](respondWithResult(_0x118099,null))[_0x810b('0x38')](handleError(_0x118099,null));};exports[_0x810b('0xbc')]=function(_0x4d0e25,_0x4d79b8,_0x46e875){return db[_0x810b('0xbd')][_0x810b('0x6b')]({'where':{'id':_0x4d0e25['params']['id']}})[_0x810b('0x37')](handleEntityNotFound(_0x4d79b8,null))[_0x810b('0x37')](function(_0x1d726d){if(_0x1d726d){return _0x1d726d[_0x810b('0xbc')](_0x4d0e25[_0x810b('0x79')]['ids'],_[_0x810b('0xbe')](_0x4d0e25['body'],[_0x810b('0xbf'),'id'])||{});}})[_0x810b('0x37')](respondWithResult(_0x4d79b8,null))[_0x810b('0x38')](handleError(_0x4d79b8,null));};exports[_0x810b('0xc0')]=function(_0x305ae7,_0x375d79,_0x328b05){var _0x6c1213={'raw':![],'where':{}};var _0x48be7b={};var _0x247183={'count':0x0,'rows':[]};return db[_0x810b('0xa2')][_0x810b('0xc1')]({'where':{'id':_0x305ae7['params']['id']}})[_0x810b('0x37')](handleEntityNotFound(_0x375d79,null))[_0x810b('0x37')](function(_0x1606c5){if(_0x1606c5){_0x48be7b[_0x810b('0x45')]=_['keys'](db[_0x810b('0xbd')][_0x810b('0x41')]);_0x48be7b[_0x810b('0x46')]=_[_0x810b('0x47')](_0x305ae7[_0x810b('0x46')]);_0x48be7b[_0x810b('0x48')]=_[_0x810b('0x49')](_0x48be7b[_0x810b('0x45')],_0x48be7b['query']);_0x6c1213[_0x810b('0x4a')]=_[_0x810b('0x49')](_0x48be7b['model'],qs[_0x810b('0x4b')](_0x305ae7[_0x810b('0x46')][_0x810b('0x4b')]));_0x6c1213['attributes']=_0x6c1213['attributes'][_0x810b('0x4c')]?_0x6c1213['attributes']:_0x48be7b['model'];if(!_0x305ae7[_0x810b('0x46')][_0x810b('0x4d')](_0x810b('0x4e'))){_0x6c1213['limit']=qs[_0x810b('0x27')](_0x305ae7[_0x810b('0x46')][_0x810b('0x27')]);_0x6c1213[_0x810b('0x25')]=qs[_0x810b('0x25')](_0x305ae7['query'][_0x810b('0x25')]);}_0x6c1213[_0x810b('0x4f')]=qs[_0x810b('0x50')](_0x305ae7[_0x810b('0x46')][_0x810b('0x50')]);_0x6c1213['where']=qs[_0x810b('0x48')](_['pick'](_0x305ae7[_0x810b('0x46')],_0x48be7b['filters']));_0x6c1213[_0x810b('0x51')][_0x810b('0xb6')]=_0x1606c5['id'];if(_0x305ae7['query'][_0x810b('0x88')]){_0x6c1213[_0x810b('0x51')]=_[_0x810b('0xa1')](_0x6c1213['where'],{'$or':_[_0x810b('0x40')](_0x6c1213[_0x810b('0x4a')],function(_0x31ffc8){var _0x649b01={};_0x649b01[_0x31ffc8]={'$like':'%'+_0x305ae7[_0x810b('0x46')][_0x810b('0x88')]+'%'};return _0x649b01;})});}if(_0x305ae7['query'][_0x810b('0x80')]){var _0x3a12d4=_0x305ae7[_0x810b('0x46')][_0x810b('0x80')][_0x810b('0x33')](',');var _0x608906={};_0x608906[_0x3a12d4[0x0]]={'$gte':moment(_0x3a12d4[0x1])['format'](_0x810b('0xc2'))};_0x6c1213[_0x810b('0x51')]=_['merge'](_0x6c1213[_0x810b('0x51')],_0x608906);}_0x6c1213=_[_0x810b('0xa1')]({},_0x6c1213,_0x305ae7[_0x810b('0xc3')]);return db[_0x810b('0xbd')][_0x810b('0x9f')]({'where':_0x6c1213[_0x810b('0x51')]})[_0x810b('0x37')](function(_0x2a9cbc){_0x247183[_0x810b('0x9f')]=_0x2a9cbc;if(_0x305ae7[_0x810b('0x46')][_0x810b('0xc4')]){_0x6c1213[_0x810b('0xb9')]=[{'all':!![]}];}return db[_0x810b('0xbd')][_0x810b('0xc5')](_0x6c1213);})[_0x810b('0x37')](function(_0x52d140){_0x247183['rows']=_0x52d140;return _0x247183;});}})['then'](respondWithFilteredResult(_0x375d79,_0x6c1213))[_0x810b('0x38')](handleError(_0x375d79,null));};exports[_0x810b('0xc6')]=function(_0x5a26d8,_0x5ca352,_0x42a19f){return db['SmsInteraction'][_0x810b('0x6b')]({'where':{'id':_0x5a26d8[_0x810b('0xb8')]['id']}})[_0x810b('0x37')](handleEntityNotFound(_0x5ca352,null))[_0x810b('0x37')](function(_0x1c009f){if(_0x1c009f){return _0x1c009f[_0x810b('0xc7')](_0x5a26d8[_0x810b('0x79')]['ids'],_[_0x810b('0xbe')](_0x5a26d8[_0x810b('0x79')],[_0x810b('0xbf'),'id'])||{})[_0x810b('0xc8')](function(){return db[_0x810b('0x75')][_0x810b('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0x5a26d8[_0x810b('0x79')][_0x810b('0xbf')]}});})[_0x810b('0x37')](function(_0x344246){socket[_0x810b('0xc9')](_0x810b('0xca'),{'id':Number(_0x5a26d8[_0x810b('0xb8')]['id']),'tags':_0x344246||[]});return{'id':Number(_0x5a26d8[_0x810b('0xb8')]['id']),'tags':_0x344246||[]};});}})[_0x810b('0x37')](respondWithResult(_0x5ca352,null))['catch'](handleError(_0x5ca352,null));};exports[_0x810b('0xcb')]=function(_0x31c485,_0x326134,_0x1e73f5){return db[_0x810b('0xa2')][_0x810b('0x6b')]({'where':{'id':_0x31c485[_0x810b('0xb8')]['id']}})['then'](handleEntityNotFound(_0x326134,null))[_0x810b('0x37')](function(_0x36d7ac){if(_0x36d7ac){return _0x36d7ac[_0x810b('0xcb')](_0x31c485[_0x810b('0x46')][_0x810b('0xbf')]);}})[_0x810b('0x37')](respondWithStatusCode(_0x326134,null))['catch'](handleError(_0x326134,null));};exports[_0x810b('0xcc')]=function(_0xb9d2e4,_0x29e7be){var _0x104380=moment()[_0x810b('0xcd')]()[_0x810b('0x9e')]();var _0x54ca46=path['join'](config['root'],_0x810b('0xce'),'files','tmp');var _0x53fa7a=path['join'](config[_0x810b('0xcf')],_0x810b('0xce'),_0x810b('0xd0'),_0x810b('0xd1'));var _0x144a9b=path[_0x810b('0xd2')](_0x54ca46,_0x104380);var _0x285c08=util[_0x810b('0xd3')](_0x810b('0xd4'),_0xb9d2e4[_0x810b('0xb8')]['id'],_0x104380);var _0x3f7967=path['join'](_0x54ca46,_0x285c08);var _0x541514=[];_0x541514[_0x810b('0x36')]({'model':db['User'],'as':_0x810b('0x76'),'attributes':['id',_0x810b('0xd5')],'raw':!![]});_0x541514[_0x810b('0x36')]({'model':db[_0x810b('0xd6')],'as':_0x810b('0xd7'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x2ed952=[{'model':db['SmsMessage'],'as':_0x810b('0xd8'),'attributes':['id',_0x810b('0x79'),_0x810b('0xd9'),_0x810b('0xda'),_0x810b('0xdb'),_0x810b('0x84')],'include':_0x541514}];_0x2ed952['push']({'model':db[_0x810b('0xdc')],'as':_0x810b('0xdd'),'attributes':['id','name']});_0x2ed952['push']({'model':db['User'],'as':_0x810b('0xde'),'attributes':['id',_0x810b('0xd5')]});return db[_0x810b('0xa2')][_0x810b('0x6b')]({'where':{'id':_0xb9d2e4[_0x810b('0xb8')]['id']},'include':_0x2ed952})[_0x810b('0x37')](handleEntityNotFound(_0x29e7be,null))['then'](function(_0x2c7479){if(_0x2c7479){var _0x54ed2d=_0x2c7479[_0x810b('0xdf')]({'plain':!![]});fs['mkdirSync'](_0x144a9b);var _0x374669={'channel':'Sms','account':_0x54ed2d[_0x810b('0xdd')][_0x810b('0x2f')],'agent':_0x54ed2d[_0x810b('0xde')]?_0x54ed2d[_0x810b('0xde')][_0x810b('0xd5')]:'N.A.','createdAt':moment(_0x54ed2d[_0x810b('0xd9')])[_0x810b('0xd3')](_0x810b('0xc2'))['toString'](),'closedAt':_0x54ed2d[_0x810b('0x3f')]?moment(_0x54ed2d[_0x810b('0xe0')])[_0x810b('0xd3')](_0x810b('0xc2'))['toString']():'','disposition':_0x54ed2d[_0x810b('0xe1')],'messages':_(_0x54ed2d[_0x810b('0xd8')])[_0x810b('0x88')]({'secret':![]})['map'](function(_0x3d960a){return{'date':moment(_0x3d960a[_0x810b('0xd9')])[_0x810b('0xd3')](_0x810b('0xc2'))['toString'](),'sender':_0x3d960a[_0x810b('0xda')]===_0x810b('0xe2')?_0x3d960a[_0x810b('0x76')]?_0x3d960a['User'][_0x810b('0xd5')]:_0x810b('0xe3'):_0x3d960a[_0x810b('0xd7')]['firstName']+(_0x3d960a[_0x810b('0xd7')][_0x810b('0xe4')]?'\x20'+_0x3d960a[_0x810b('0xd7')]['lastName']:''),'body':_0x3d960a['body'],'direction':_0x3d960a[_0x810b('0xda')]===_0x810b('0xe2')?'A':'C','secret':_0x3d960a[_0x810b('0xdb')],'read':_0x3d960a[_0x810b('0x84')]};})['value']()};return ejs[_0x810b('0xe5')](path[_0x810b('0xd2')](config[_0x810b('0xcf')],_0x810b('0xce'),_0x810b('0xe6'),'downloadInteraction.ejs'),{'interaction':_0x374669})['then'](function(_0x454033){var _0x2240c9=path['join'](_0x144a9b,'transcript-'+_0x54ed2d['id']+'-'+_0x104380+'.pdf');var _0x4a986d={'path':_0x2240c9,'channel':_0x810b('0xe7'),'interactionId':_0x54ed2d['id']};return pdf[_0x810b('0xe8')](_0x454033,_0x4a986d);})[_0x810b('0x37')](function(){return new BPromise(function(_0x3071c6,_0x46b763){zipdir(_0x144a9b,{'saveTo':_0x3f7967},function(_0x283e28,_0x8e594b){if(_0x283e28)return _0x46b763(_0x283e28);return _0x3071c6(_0x8e594b);});})['then'](function(){return new BPromise(function(_0xb242b9,_0x2ffafa){rimraf(_0x144a9b,function(_0xf1bc0e){if(_0xf1bc0e)_0x2ffafa(_0xf1bc0e);return _0xb242b9();});});})[_0x810b('0x37')](function(){return _0x29e7be['download'](_0x3f7967,_0x285c08,function(_0x29e07c){if(_0x29e07c){console[_0x810b('0xe9')](_0x810b('0xea'),_0x29e07c);}else{fs[_0x810b('0xeb')](_0x3f7967);}});});});}else{return _0x29e7be[_0x810b('0x21')](0xc8);}})['catch'](handleError(_0x29e7be,null));}; \ No newline at end of file +var _0x6bf9=['fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','then','name','Users','map','fullname','TagIds','split','forEach','catch','waiting','answered','total','UserId','closed','talking','unmanaged','index','SmsInteraction','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','some','isEmpty','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','push','all','rows','params','includeAll','include','create','body','update','describe','SmsMessage','addMessage','ids','omit','getMessages','SmsInteractionId','options','findAll','addTags','setTags','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','files','server','attachments','format','transcript-%d-%s.zip','User','firstName','Messages','secret','SmsAccount','Owner','get','mkdirSync','Sms','Account','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','direction','out','System','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x2b6d46,_0x11867e){var _0x555bdb=function(_0x11122d){while(--_0x11122d){_0x2b6d46['push'](_0x2b6d46['shift']());}};_0x555bdb(++_0x11867e);}(_0x6bf9,0x1cd));var _0x96bf=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0x6bf9[_0x29d2d2];return _0x3f6476;};'use strict';var emlformat=require(_0x96bf('0x0'));var rimraf=require(_0x96bf('0x1'));var zipdir=require(_0x96bf('0x2'));var jsonpatch=require(_0x96bf('0x3'));var rp=require(_0x96bf('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96bf('0x5'));var path=require(_0x96bf('0x6'));var sox=require(_0x96bf('0x7'));var csv=require(_0x96bf('0x8'));var ejs=require(_0x96bf('0x9'));var fs=require('fs');var fs_extra=require(_0x96bf('0xa'));var _=require('lodash');var squel=require(_0x96bf('0xb'));var crypto=require('crypto');var jsforce=require(_0x96bf('0xc'));var deskjs=require(_0x96bf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x96bf('0xe'));var Papa=require(_0x96bf('0xf'));var Redis=require(_0x96bf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x96bf('0x11'));var as=require(_0x96bf('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x96bf('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x96bf('0x14'));var licenseUtil=require(_0x96bf('0x15'));var db=require(_0x96bf('0x16'))['db'];config['redis']=_[_0x96bf('0x17')](config[_0x96bf('0x18')],{'host':_0x96bf('0x19'),'port':0x18eb});var socket=require(_0x96bf('0x1a'))(new Redis(config[_0x96bf('0x18')]));require('./smsInteraction.socket')[_0x96bf('0x1b')](socket);function respondWithStatusCode(_0x155a41,_0x2abb41){_0x2abb41=_0x2abb41||0xcc;return function(_0x5851a1){if(_0x5851a1){return _0x155a41[_0x96bf('0x1c')](_0x2abb41);}return _0x155a41['status'](_0x2abb41)[_0x96bf('0x1d')]();};}function respondWithResult(_0x480e50,_0x44bc50){_0x44bc50=_0x44bc50||0xc8;return function(_0x43bc49){if(_0x43bc49){return _0x480e50[_0x96bf('0x1e')](_0x44bc50)[_0x96bf('0x1f')](_0x43bc49);}};}function respondWithFilteredResult(_0x1efa52,_0x37ec0d){return function(_0x3cd855){if(_0x3cd855){var _0x3b9d3b=typeof _0x37ec0d[_0x96bf('0x20')]==='undefined'&&typeof _0x37ec0d['limit']===_0x96bf('0x21');var _0x3b84bc=_0x3cd855[_0x96bf('0x22')];var _0x4de532=_0x3b9d3b?0x0:_0x37ec0d[_0x96bf('0x20')];var _0x2b6de8=_0x3b9d3b?_0x3cd855[_0x96bf('0x22')]:_0x37ec0d[_0x96bf('0x20')]+_0x37ec0d[_0x96bf('0x23')];var _0x1e4d1f;if(_0x2b6de8>=_0x3b84bc){_0x2b6de8=_0x3b84bc;_0x1e4d1f=0xc8;}else{_0x1e4d1f=0xce;}_0x1efa52['status'](_0x1e4d1f);return _0x1efa52['set'](_0x96bf('0x24'),_0x4de532+'-'+_0x2b6de8+'/'+_0x3b84bc)[_0x96bf('0x1f')](_0x3cd855);}return null;};}function patchUpdates(_0x3748ae){return function(_0x5abb83){try{jsonpatch[_0x96bf('0x25')](_0x5abb83,_0x3748ae,!![]);}catch(_0x3ba1f5){return BPromise[_0x96bf('0x26')](_0x3ba1f5);}return _0x5abb83[_0x96bf('0x27')]();};}function saveUpdates(_0x1a753a,_0x287155){return function(_0x9f1ab4){if(_0x9f1ab4){return _0x9f1ab4['update'](_0x1a753a)['then'](function(_0x308e81){return _0x308e81;});}return null;};}function removeEntity(_0x1b7311,_0x289770){return function(_0x3a5585){if(_0x3a5585){return _0x3a5585[_0x96bf('0x28')]()[_0x96bf('0x29')](function(){_0x1b7311[_0x96bf('0x1e')](0xcc)[_0x96bf('0x1d')]();});}};}function handleEntityNotFound(_0x1c3252,_0x3e6bfc){return function(_0x279d7){if(!_0x279d7){_0x1c3252[_0x96bf('0x1c')](0x194);}return _0x279d7;};}function handleError(_0x441aaa,_0x188c91){_0x188c91=_0x188c91||0x1f4;return function(_0x5de521){logger['error'](_0x5de521['stack']);if(_0x5de521[_0x96bf('0x2a')]){delete _0x5de521[_0x96bf('0x2a')];}_0x441aaa[_0x96bf('0x1e')](_0x188c91)['send'](_0x5de521);};}function getInteractionUsers(_0x162063,_0x455e34){return new BPromise(function(_0x57931e,_0x49ea2e){try{if(_0x455e34[_0x162063['id']]){_0x162063[_0x96bf('0x2b')]=_[_0x96bf('0x2c')](_0x455e34[_0x162063['id']],function(_0x3c4c68){return{'id':_0x3c4c68['id'],'fullname':_0x3c4c68[_0x96bf('0x2d')]};});}}catch(_0x3a5c57){_0x49ea2e(_0x3a5c57);}_0x57931e(_0x162063);});}function getInteractionTags(_0x5d3481,_0x20e7c4){return new BPromise(function(_0x138fec,_0x5f4910){try{if(_0x5d3481[_0x96bf('0x2e')]){_0x5d3481['Tags']=[];_0x5d3481[_0x96bf('0x2e')][_0x96bf('0x2f')](',')[_0x96bf('0x30')](function(_0x578920){_0x5d3481['Tags']['push'](_0x20e7c4[_0x578920]);});}delete _0x5d3481[_0x96bf('0x2e')];}catch(_0x126eeb){_0x5f4910(_0x126eeb);}_0x138fec(_0x5d3481);});}function updateSmsInteraction(_0x3fd1b3,_0x393ac9,_0x120661){return new BPromise(function(_0x40b160,_0x30e71e){return getInteractionUsers(_0x3fd1b3,_0x120661)[_0x96bf('0x29')](function(_0x362599){return getInteractionTags(_0x362599,_0x393ac9);})[_0x96bf('0x29')](function(_0x590be3){return getStateInteraction(_0x590be3);})[_0x96bf('0x29')](function(_0x27c10c){_0x40b160(_0x27c10c);})[_0x96bf('0x31')](function(_0x5d98d9){_0x30e71e(_0x5d98d9);});});}function getStateInteraction(_0x36f3e3){return new BPromise(function(_0x28bb68,_0x3835bd){_0x36f3e3[_0x96bf('0x32')]=0x0;_0x36f3e3['talking']=0x0;_0x36f3e3[_0x96bf('0x33')]=0x0;_0x36f3e3['unmanaged']=0x0;_0x36f3e3[_0x96bf('0x34')]=0x0;if(!_0x36f3e3['closed']&&!_0x36f3e3[_0x96bf('0x35')])_0x36f3e3[_0x96bf('0x32')]+=0x1;if(!_0x36f3e3[_0x96bf('0x36')]&&_0x36f3e3[_0x96bf('0x35')])_0x36f3e3[_0x96bf('0x37')]+=0x1;if(_0x36f3e3[_0x96bf('0x36')]&&_0x36f3e3[_0x96bf('0x35')])_0x36f3e3[_0x96bf('0x33')]+=0x1;if(_0x36f3e3[_0x96bf('0x36')]&&!_0x36f3e3['UserId'])_0x36f3e3[_0x96bf('0x38')]+=0x1;_0x36f3e3['total']+=0x1;_0x28bb68(_0x36f3e3);});}exports[_0x96bf('0x39')]=function(_0x50714a,_0x5d8784){var _0x3ba906={},_0x107c4f={},_0x347f5c={'count':0x0,'rows':[]};var _0xa50602=_['map'](db[_0x96bf('0x3a')][_0x96bf('0x3b')],function(_0x5a3dd8){return{'name':_0x5a3dd8[_0x96bf('0x3c')],'type':_0x5a3dd8['type'][_0x96bf('0x3d')]};});_0x107c4f['model']=_[_0x96bf('0x2c')](_0xa50602,_0x96bf('0x2a'));_0x107c4f[_0x96bf('0x3e')]=_[_0x96bf('0x3f')](_0x50714a['query']);_0x107c4f[_0x96bf('0x40')]=_[_0x96bf('0x41')](_0x107c4f[_0x96bf('0x42')],_0x107c4f[_0x96bf('0x3e')]);_0x3ba906[_0x96bf('0x43')]=_[_0x96bf('0x41')](_0x107c4f['model'],qs[_0x96bf('0x44')](_0x50714a[_0x96bf('0x3e')][_0x96bf('0x44')]));_0x3ba906[_0x96bf('0x43')]=_0x3ba906[_0x96bf('0x43')]['length']?_0x3ba906['attributes']:_0x107c4f[_0x96bf('0x42')];if(!_0x50714a[_0x96bf('0x3e')][_0x96bf('0x45')](_0x96bf('0x46'))){_0x3ba906[_0x96bf('0x23')]=qs[_0x96bf('0x23')](_0x50714a[_0x96bf('0x3e')][_0x96bf('0x23')]);_0x3ba906[_0x96bf('0x20')]=qs[_0x96bf('0x20')](_0x50714a['query'][_0x96bf('0x20')]);}_0x3ba906[_0x96bf('0x47')]=qs[_0x96bf('0x48')](_0x50714a[_0x96bf('0x3e')][_0x96bf('0x48')]);_0x3ba906[_0x96bf('0x49')]=qs[_0x96bf('0x40')](_[_0x96bf('0x4a')](_0x50714a['query'],_0x107c4f[_0x96bf('0x40')]),_0xa50602);var _0x5cbe50=[];var _0x167fd1=squel['select']()[_0x96bf('0x4b')]('id')[_0x96bf('0x4b')](_0x96bf('0x2a'))[_0x96bf('0x4b')]('color')[_0x96bf('0x4c')](_0x96bf('0x4d'));var _0x382522=squel[_0x96bf('0x4e')]()[_0x96bf('0x4b')](_0x96bf('0x4f'))[_0x96bf('0x4b')](_0x96bf('0x50'))[_0x96bf('0x4b')]('ui.SmsInteractionId')[_0x96bf('0x4c')](_0x96bf('0x51'),'ui')[_0x96bf('0x52')](_0x96bf('0x53'),'u','u.id\x20=\x20ui.UserId');var _0x3ae7c1=squel[_0x96bf('0x4e')]()['from'](_0x96bf('0x54'),'i')[_0x96bf('0x52')](_0x96bf('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x96bf('0x52')]('users','o',_0x96bf('0x56'))['left_join']('sms_accounts','a',_0x96bf('0x57'))[_0x96bf('0x52')](_0x96bf('0x58'),'me',_0x96bf('0x59'))[_0x96bf('0x52')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x96bf('0x52')](_0x96bf('0x4d'),'t',_0x96bf('0x5a'));var _0x22008c=squel[_0x96bf('0x5b')]();var _0x45087c=[];var _0x12ef1d=squel[_0x96bf('0x5b')]();var _0x4a0af8;if(_0x50714a[_0x96bf('0x3e')][_0x96bf('0x5c')]){_0x4a0af8=as[_0x96bf('0x5d')](_0x50714a[_0x96bf('0x3e')][_0x96bf('0x5c')]);var _0x16f6aa=_0x4a0af8[_0x96bf('0x5e')];for(var _0xac459c=0x0;_0xac459c<_0x4a0af8['conditions'][_0x96bf('0x5f')];_0xac459c++){var _0x374d2f=_0x4a0af8[_0x96bf('0x60')][_0xac459c];var _0x8224c='i';var _0x5d98c0=_[_0x96bf('0x61')](_0xa50602,[_0x96bf('0x2a'),_0x374d2f[_0x96bf('0x4b')]]);if(!_0x5d98c0){switch(_0x374d2f[_0x96bf('0x4b')]){case _0x96bf('0x62'):if(_0x374d2f[_0x96bf('0x63')]==0x1){_0x3ae7c1[_0x96bf('0x64')]('`'+_0x374d2f[_0x96bf('0x4b')]+'`\x20=\x200');}else{_0x3ae7c1[_0x96bf('0x64')]('`'+_0x374d2f[_0x96bf('0x4b')]+_0x96bf('0x65'));}break;case _0x96bf('0x66'):if(_0x374d2f[_0x96bf('0x67')]===_0x96bf('0x68')){if(_0x374d2f[_0x96bf('0x63')][_0x96bf('0x2f')]('\x20')[_0x96bf('0x5f')]>0x1){_0x22008c[_0x16f6aa](_0x96bf('0x69'),qs['getFullTextValue'](_0x374d2f[_0x96bf('0x63')]),null);}else{var _0xd86e59='%'+_0x374d2f[_0x96bf('0x63')]+'%';_0x22008c[_0x16f6aa](_0x96bf('0x6a'),_0xd86e59,_0xd86e59,_0xd86e59);}}else{_0x5d98c0=_[_0x96bf('0x61')](_0xa50602,[_0x96bf('0x2a'),_0x96bf('0x6b')]);_0x374d2f[_0x96bf('0x4b')]=_0x96bf('0x6b');_0x3214e6=as[_0x96bf('0x6c')](_0x8224c,_0x5d98c0[_0x96bf('0x6d')],_0x374d2f);_0x22008c[_0x16f6aa](_0x3214e6[_0x96bf('0x6e')],_0x3214e6[_0x96bf('0x63')][_0x96bf('0x6f')],_0x3214e6['value'][_0x96bf('0x1d')]);}break;case _0x96bf('0x70'):var _0x55d5a2=_0x374d2f[_0x96bf('0x63')]['split'](',')[_0x96bf('0x2c')](function(_0x3c8314){return Number(_0x3c8314);});_0x55d5a2[_0x96bf('0x30')](function(_0x2c9179){_0x12ef1d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c9179+',%');});_0x45087c=_[_0x96bf('0x71')](_0x45087c,_0x55d5a2);break;case'User':if(_0x374d2f['operator']===_0x96bf('0x68')){_0x22008c[_0x16f6aa]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x374d2f[_0x96bf('0x63')]+'%',null);}else{_0x5d98c0=_[_0x96bf('0x61')](_0xa50602,[_0x96bf('0x2a'),'UserId']);_0x374d2f[_0x96bf('0x4b')]=_0x96bf('0x35');_0x3214e6=as[_0x96bf('0x6c')](_0x8224c,_0x5d98c0['type'],_0x374d2f);_0x22008c[_0x16f6aa](_0x3214e6[_0x96bf('0x6e')],_0x3214e6[_0x96bf('0x63')][_0x96bf('0x6f')],_0x3214e6[_0x96bf('0x63')][_0x96bf('0x1d')]);}break;case'body':_0x3214e6=as[_0x96bf('0x6c')]('me',null,_0x374d2f);_0x22008c[_0x16f6aa](_0x3214e6[_0x96bf('0x6e')],_0x3214e6['value'][_0x96bf('0x6f')],_0x3214e6[_0x96bf('0x63')][_0x96bf('0x1d')]);break;}}else{var _0x3214e6=as['buildExpression'](_0x8224c,_0x5d98c0[_0x96bf('0x6d')],_0x374d2f);_0x22008c[_0x16f6aa](_0x3214e6[_0x96bf('0x6e')],_0x3214e6[_0x96bf('0x63')][_0x96bf('0x6f')],_0x3214e6[_0x96bf('0x63')][_0x96bf('0x1d')]);}}}else{var _0x3d3842=_(_0x50714a[_0x96bf('0x3e')])[_0x96bf('0x3f')]()['map'](function(_0x2b2931){return _[_0x96bf('0x72')](_0xa50602,[_0x96bf('0x2a'),_0x2b2931])?_0x2b2931:undefined;})['compact']()[_0x96bf('0x63')]();if(!_[_0x96bf('0x73')](_0x3d3842)){_0x3d3842[_0x96bf('0x30')](function(_0x2b326b){if(_0x2b326b==='SmsAccountId'){_0x3ae7c1[_0x96bf('0x49')](_0x96bf('0x74'),[]['concat'](_0x50714a['query'][_0x2b326b]));}else if(_0x2b326b===_0x96bf('0x75')){var _0xfa144c=JSON[_0x96bf('0x76')](_0x50714a[_0x96bf('0x3e')][_0x2b326b])[_0x96bf('0x77')];var _0x4a07c5=JSON[_0x96bf('0x76')](_0x50714a[_0x96bf('0x3e')][_0x2b326b])[_0x96bf('0x78')];_0x3ae7c1['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xfa144c,_0x4a07c5);}else{if(_0x50714a['query'][_0x2b326b]==='null'){_0x3ae7c1[_0x96bf('0x49')]('i.'+_0x2b326b+_0x96bf('0x79'));}else{_0x3ae7c1[_0x96bf('0x49')]('i.'+_0x2b326b+_0x96bf('0x7a'),_0x50714a[_0x96bf('0x3e')][_0x2b326b]);}}});}if(_0x50714a['query'][_0x96bf('0x7b')]){if(_0x50714a[_0x96bf('0x3e')][_0x96bf('0x7b')]==0x1){_0x3ae7c1[_0x96bf('0x64')](_0x96bf('0x7c'));}else{_0x3ae7c1[_0x96bf('0x64')](_0x96bf('0x7d'));}}if(_0x50714a['query'][_0x96bf('0x7e')]){_0x45087c=_[_0x96bf('0x7f')](_0x50714a[_0x96bf('0x3e')][_0x96bf('0x7e')])?_0x50714a[_0x96bf('0x3e')][_0x96bf('0x7e')]:new Array(_0x50714a['query'][_0x96bf('0x7e')]);_0x45087c[_0x96bf('0x30')](function(_0x4dffea){_0x12ef1d['or'](_0x96bf('0x80'),'%,'+_0x4dffea+',%');});}if(_0x50714a[_0x96bf('0x3e')][_0x96bf('0x81')]){var _0x45ad97=_0x50714a[_0x96bf('0x3e')]['filter'][_0x96bf('0x82')]('\x5c','\x5c\x5c')[_0x96bf('0x82')](/'/g,'\x27\x27');if(qs[_0x96bf('0x83')](_0x45ad97)){_0x22008c['or'](_0x96bf('0x84'),_0x45ad97+'%')['or']('i.phone\x20LIKE\x20?',_0x45ad97+'%');}else{_0x22008c['or'](_0x96bf('0x85'),qs[_0x96bf('0x86')](_0x45ad97))['or'](_0x96bf('0x87'),_0x45ad97+'%');}}}_0x3ae7c1[_0x96bf('0x49')](_0x22008c);_0x3ae7c1[_0x96bf('0x88')](_0x96bf('0x89'));var _0x34b4ff={'type':db[_0x96bf('0x8a')][_0x96bf('0x8b')][_0x96bf('0x8c')],'raw':!![]};var _0x2015c0=_0x3ae7c1[_0x96bf('0x8d')]();_0x2015c0['field'](_0x96bf('0x89'));_0x2015c0[_0x96bf('0x4b')](_0x96bf('0x8e'),_0x96bf('0x62'));if(_0x3ba906[_0x96bf('0x47')]){_0x3ba906[_0x96bf('0x47')][_0x96bf('0x30')](function(_0x3bf1a){var _0xa67019=_0x3bf1a[0x0]===_0x96bf('0x8f')?_0x3bf1a[0x0]:'i.'+_0x3bf1a[0x0];_0x3ae7c1[_0x96bf('0x47')](_0xa67019,_0x3bf1a[0x1]===_0x96bf('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45087c)){_0x3ae7c1['having'](_0x12ef1d);_0x2015c0[_0x96bf('0x49')](_0x96bf('0x91'),_0x45087c);}BPromise[_0x96bf('0x92')]()['then'](function(){if(!_0x4a0af8){if(_0x50714a['query'][_0x96bf('0x93')])return;_0x2015c0['where']('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x3ae7c1[_0x96bf('0x49')](_0x96bf('0x94'));return;}if(_0x50714a[_0x96bf('0x95')][_0x96bf('0x96')]!=='agent')return;return _0x50714a[_0x96bf('0x95')][_0x96bf('0x97')]({'attributes':['id'],'raw':!![]})[_0x96bf('0x29')](function(_0xcb8539){if(_[_0x96bf('0x73')](_0xcb8539)){_0x2015c0['where'](_0x96bf('0x98'));_0x3ae7c1[_0x96bf('0x49')](_0x96bf('0x98'));}else{_0x2015c0[_0x96bf('0x49')](_0x96bf('0x74'),_[_0x96bf('0x2c')](_0xcb8539,'id'));_0x3ae7c1['where']('i.SmsAccountId\x20IN\x20?',_['map'](_0xcb8539,'id'));}});})['then'](function(){if(_0x50714a[_0x96bf('0x95')][_0x96bf('0x96')]==='agent'&&!_0x4a0af8&&!_0x50714a[_0x96bf('0x3e')][_0x96bf('0x93')])return[];return db[_0x96bf('0x99')]['query'](_0x2015c0[_0x96bf('0x9a')](),_0x34b4ff);})['then'](function(_0x3504a8){_0x347f5c[_0x96bf('0x22')]=_0x3504a8[_0x96bf('0x5f')];if(_0x347f5c['count']===0x0)return[];return db['sequelize'][_0x96bf('0x3e')](_0x167fd1[_0x96bf('0x9a')](),_0x34b4ff)[_0x96bf('0x29')](function(_0x42b8ec){_0x5cbe50=_['keyBy'](_0x42b8ec,'id');_0x34b4ff=_[_0x96bf('0x9b')](_0x34b4ff,{'model':db[_0x96bf('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50714a[_0x96bf('0x3e')][_0x96bf('0x44')]){_0x3ba906[_0x96bf('0x43')][_0x96bf('0x30')](function(_0x476367){_0x3ae7c1[_0x96bf('0x4b')]('i.'+_0x476367);});}else{_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0x8e'),_0x96bf('0x62'));_0x3ae7c1[_0x96bf('0x4b')]('a.key',_0x96bf('0x9c'));_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0x9d'),_0x96bf('0x9e'));_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0x9f'),_0x96bf('0x8f'));_0x3ae7c1['field'](_0x96bf('0xa0'));_0x3ae7c1['field'](_0x96bf('0xa1'),_0x96bf('0xa2'));_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0xa3'),_0x96bf('0xa4'));_0x3ae7c1[_0x96bf('0x4b')]('c.email',_0x96bf('0xa5'));_0x3ae7c1['field']('c.phone','Contact.phone');_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0xa6'),_0x96bf('0xa7'));_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0xa8'),'Contact.fax');_0x3ae7c1['field'](_0x96bf('0xa9'),_0x96bf('0xaa'));_0x3ae7c1[_0x96bf('0x4b')]('o.internal',_0x96bf('0xab'));_0x3ae7c1[_0x96bf('0x4b')](_0x96bf('0xac'),'TagIds');}if(_0x3ba906['limit'])_0x3ae7c1['limit'](_0x3ba906['limit']);if(_0x3ba906['offset'])_0x3ae7c1[_0x96bf('0x20')](_0x3ba906[_0x96bf('0x20')]);return db['sequelize']['query'](_0x3ae7c1[_0x96bf('0x9a')](),_0x34b4ff);})[_0x96bf('0x29')](function(_0x4f8653){if(_0x4f8653['length']>0x0)_0x382522[_0x96bf('0x49')](_0x96bf('0xad'),_['map'](_0x4f8653,'id'));return db[_0x96bf('0x99')][_0x96bf('0x3e')](_0x382522['toString'](),_0x34b4ff)[_0x96bf('0x29')](function(_0x2c39de){var _0x3a174f=_[_0x96bf('0xae')](_0x2c39de,'SmsInteractionId');var _0x520abe=[];_0x4f8653[_0x96bf('0x30')](function(_0x18ad1d){_0x520abe[_0x96bf('0xaf')](updateSmsInteraction(_0x18ad1d,_0x5cbe50,_0x3a174f));});return BPromise[_0x96bf('0xb0')](_0x520abe);});});})[_0x96bf('0x29')](function(_0x24930d){_0x347f5c[_0x96bf('0xb1')]=_0x24930d;return _0x347f5c;})['then'](respondWithFilteredResult(_0x5d8784,_0x3ba906))['catch'](handleError(_0x5d8784,null));};exports['show']=function(_0x596327,_0x40a27b){var _0x12ed47={'raw':![],'where':{'id':_0x596327[_0x96bf('0xb2')]['id']}},_0x545144={};_0x545144[_0x96bf('0x42')]=_[_0x96bf('0x3f')](db[_0x96bf('0x3a')][_0x96bf('0x3b')]);_0x545144['query']=_['keys'](_0x596327[_0x96bf('0x3e')]);_0x545144[_0x96bf('0x40')]=_[_0x96bf('0x41')](_0x545144[_0x96bf('0x42')],_0x545144[_0x96bf('0x3e')]);_0x12ed47[_0x96bf('0x43')]=_[_0x96bf('0x41')](_0x545144[_0x96bf('0x42')],qs[_0x96bf('0x44')](_0x596327[_0x96bf('0x3e')]['fields']));_0x12ed47[_0x96bf('0x43')]=_0x12ed47[_0x96bf('0x43')][_0x96bf('0x5f')]?_0x12ed47[_0x96bf('0x43')]:_0x545144[_0x96bf('0x42')];if(_0x596327['query'][_0x96bf('0xb3')]){_0x12ed47[_0x96bf('0xb4')]=[{'all':!![]}];}_0x12ed47=_[_0x96bf('0x9b')]({},_0x12ed47,_0x596327['options']);return db['SmsInteraction'][_0x96bf('0x61')](_0x12ed47)[_0x96bf('0x29')](handleEntityNotFound(_0x40a27b,null))['then'](respondWithResult(_0x40a27b,null))[_0x96bf('0x31')](handleError(_0x40a27b,null));};exports['create']=function(_0x4838d4,_0x58bd46){return db['SmsInteraction'][_0x96bf('0xb5')](_0x4838d4[_0x96bf('0xb6')],{})[_0x96bf('0x29')](respondWithResult(_0x58bd46,0xc9))[_0x96bf('0x31')](handleError(_0x58bd46,null));};exports[_0x96bf('0xb7')]=function(_0x5c41e2,_0x203728){if(_0x5c41e2['body']['id']){delete _0x5c41e2['body']['id'];}return db[_0x96bf('0x3a')][_0x96bf('0x61')]({'where':{'id':_0x5c41e2[_0x96bf('0xb2')]['id']}})['then'](handleEntityNotFound(_0x203728,null))[_0x96bf('0x29')](saveUpdates(_0x5c41e2[_0x96bf('0xb6')],null))[_0x96bf('0x29')](respondWithResult(_0x203728,null))[_0x96bf('0x31')](handleError(_0x203728,null));};exports[_0x96bf('0x28')]=function(_0x12f729,_0x73013b){return db[_0x96bf('0x3a')][_0x96bf('0x61')]({'where':{'id':_0x12f729[_0x96bf('0xb2')]['id']}})[_0x96bf('0x29')](handleEntityNotFound(_0x73013b,null))[_0x96bf('0x29')](removeEntity(_0x73013b,null))[_0x96bf('0x31')](handleError(_0x73013b,null));};exports[_0x96bf('0xb8')]=function(_0x4b4d6e,_0x54206d){return db[_0x96bf('0x3a')]['describe']()[_0x96bf('0x29')](respondWithResult(_0x54206d,null))['catch'](handleError(_0x54206d,null));};exports['addMessage']=function(_0xc240a5,_0x257b9d,_0x33fc63){return db[_0x96bf('0xb9')][_0x96bf('0x61')]({'where':{'id':_0xc240a5[_0x96bf('0xb2')]['id']}})[_0x96bf('0x29')](handleEntityNotFound(_0x257b9d,null))[_0x96bf('0x29')](function(_0x3a5322){if(_0x3a5322){return _0x3a5322[_0x96bf('0xba')](_0xc240a5[_0x96bf('0xb6')][_0x96bf('0xbb')],_[_0x96bf('0xbc')](_0xc240a5[_0x96bf('0xb6')],['ids','id'])||{});}})['then'](respondWithResult(_0x257b9d,null))[_0x96bf('0x31')](handleError(_0x257b9d,null));};exports[_0x96bf('0xbd')]=function(_0x5f53ce,_0xb86b21,_0x156c23){var _0x341d92={'raw':![],'where':{}};var _0x4dbbbd={};var _0x5efac0={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x5f53ce[_0x96bf('0xb2')]['id']}})[_0x96bf('0x29')](handleEntityNotFound(_0xb86b21,null))[_0x96bf('0x29')](function(_0x2b3067){if(_0x2b3067){_0x4dbbbd[_0x96bf('0x42')]=_[_0x96bf('0x3f')](db['SmsMessage'][_0x96bf('0x3b')]);_0x4dbbbd[_0x96bf('0x3e')]=_[_0x96bf('0x3f')](_0x5f53ce[_0x96bf('0x3e')]);_0x4dbbbd[_0x96bf('0x40')]=_[_0x96bf('0x41')](_0x4dbbbd[_0x96bf('0x42')],_0x4dbbbd[_0x96bf('0x3e')]);_0x341d92['attributes']=_[_0x96bf('0x41')](_0x4dbbbd[_0x96bf('0x42')],qs[_0x96bf('0x44')](_0x5f53ce[_0x96bf('0x3e')]['fields']));_0x341d92[_0x96bf('0x43')]=_0x341d92[_0x96bf('0x43')][_0x96bf('0x5f')]?_0x341d92[_0x96bf('0x43')]:_0x4dbbbd[_0x96bf('0x42')];if(!_0x5f53ce[_0x96bf('0x3e')][_0x96bf('0x45')]('nolimit')){_0x341d92['limit']=qs['limit'](_0x5f53ce[_0x96bf('0x3e')][_0x96bf('0x23')]);_0x341d92['offset']=qs[_0x96bf('0x20')](_0x5f53ce[_0x96bf('0x3e')]['offset']);}_0x341d92[_0x96bf('0x47')]=qs[_0x96bf('0x48')](_0x5f53ce['query']['sort']);_0x341d92[_0x96bf('0x49')]=qs[_0x96bf('0x40')](_[_0x96bf('0x4a')](_0x5f53ce[_0x96bf('0x3e')],_0x4dbbbd[_0x96bf('0x40')]));_0x341d92[_0x96bf('0x49')][_0x96bf('0xbe')]=_0x2b3067['id'];if(_0x5f53ce[_0x96bf('0x3e')][_0x96bf('0x81')]){_0x341d92[_0x96bf('0x49')]=_[_0x96bf('0x9b')](_0x341d92[_0x96bf('0x49')],{'$or':_[_0x96bf('0x2c')](_0x341d92[_0x96bf('0x43')],function(_0x3da8c8){var _0x3eee35={};_0x3eee35[_0x3da8c8]={'$like':'%'+_0x5f53ce['query'][_0x96bf('0x81')]+'%'};return _0x3eee35;})});}if(_0x5f53ce['query'][_0x96bf('0x77')]){var _0x2a1975=_0x5f53ce[_0x96bf('0x3e')][_0x96bf('0x77')][_0x96bf('0x2f')](',');var _0x1226ae={};_0x1226ae[_0x2a1975[0x0]]={'$gte':moment(_0x2a1975[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x341d92[_0x96bf('0x49')]=_[_0x96bf('0x9b')](_0x341d92[_0x96bf('0x49')],_0x1226ae);}_0x341d92=_[_0x96bf('0x9b')]({},_0x341d92,_0x5f53ce[_0x96bf('0xbf')]);return db[_0x96bf('0xb9')][_0x96bf('0x22')]({'where':_0x341d92['where']})[_0x96bf('0x29')](function(_0x2ab986){_0x5efac0[_0x96bf('0x22')]=_0x2ab986;if(_0x5f53ce['query'][_0x96bf('0xb3')]){_0x341d92[_0x96bf('0xb4')]=[{'all':!![]}];}return db[_0x96bf('0xb9')][_0x96bf('0xc0')](_0x341d92);})[_0x96bf('0x29')](function(_0x355253){_0x5efac0[_0x96bf('0xb1')]=_0x355253;return _0x5efac0;});}})[_0x96bf('0x29')](respondWithFilteredResult(_0xb86b21,_0x341d92))['catch'](handleError(_0xb86b21,null));};exports[_0x96bf('0xc1')]=function(_0x48523a,_0x9eb979,_0x58f79f){return db[_0x96bf('0x3a')]['find']({'where':{'id':_0x48523a[_0x96bf('0xb2')]['id']}})[_0x96bf('0x29')](handleEntityNotFound(_0x9eb979,null))[_0x96bf('0x29')](function(_0x1e820b){if(_0x1e820b){return _0x1e820b[_0x96bf('0xc2')](_0x48523a[_0x96bf('0xb6')][_0x96bf('0xbb')],_[_0x96bf('0xbc')](_0x48523a[_0x96bf('0xb6')],[_0x96bf('0xbb'),'id'])||{})['spread'](function(){return db[_0x96bf('0x70')][_0x96bf('0xc0')]({'attributes':['id',_0x96bf('0x2a'),_0x96bf('0xc3')],'where':{'id':_0x48523a['body'][_0x96bf('0xbb')]}});})['then'](function(_0x3c8649){socket[_0x96bf('0xc4')](_0x96bf('0xc5'),{'id':Number(_0x48523a['params']['id']),'tags':_0x3c8649||[]});return{'id':Number(_0x48523a[_0x96bf('0xb2')]['id']),'tags':_0x3c8649||[]};});}})[_0x96bf('0x29')](respondWithResult(_0x9eb979,null))[_0x96bf('0x31')](handleError(_0x9eb979,null));};exports[_0x96bf('0xc6')]=function(_0x16e938,_0x5b2f9e,_0x16692a){return db[_0x96bf('0x3a')]['find']({'where':{'id':_0x16e938[_0x96bf('0xb2')]['id']}})[_0x96bf('0x29')](handleEntityNotFound(_0x5b2f9e,null))[_0x96bf('0x29')](function(_0x5dbfbd){if(_0x5dbfbd){return _0x5dbfbd['removeTags'](_0x16e938['query'][_0x96bf('0xbb')]);}})[_0x96bf('0x29')](respondWithStatusCode(_0x5b2f9e,null))['catch'](handleError(_0x5b2f9e,null));};exports[_0x96bf('0xc7')]=function(_0x466a2a,_0x598b6f){var _0x311e6d=moment()[_0x96bf('0xc8')]()[_0x96bf('0x9a')]();var _0x33a4e8=path[_0x96bf('0xc9')](config[_0x96bf('0xca')],'server',_0x96bf('0xcb'),'tmp');var _0x1be460=path[_0x96bf('0xc9')](config[_0x96bf('0xca')],_0x96bf('0xcc'),_0x96bf('0xcb'),_0x96bf('0xcd'));var _0x16860d=path[_0x96bf('0xc9')](_0x33a4e8,_0x311e6d);var _0x33f98d=util[_0x96bf('0xce')](_0x96bf('0xcf'),_0x466a2a[_0x96bf('0xb2')]['id'],_0x311e6d);var _0x7cdedc=path[_0x96bf('0xc9')](_0x33a4e8,_0x33f98d);var _0x5b6d59=[];_0x5b6d59[_0x96bf('0xaf')]({'model':db[_0x96bf('0xd0')],'as':_0x96bf('0xd0'),'attributes':['id',_0x96bf('0x2d')],'raw':!![]});_0x5b6d59['push']({'model':db['CmContact'],'as':_0x96bf('0x66'),'attributes':['id',_0x96bf('0xd1'),'lastName'],'raw':!![]});var _0x1e7974=[{'model':db['SmsMessage'],'as':_0x96bf('0xd2'),'attributes':['id',_0x96bf('0xb6'),'createdAt','direction',_0x96bf('0xd3'),_0x96bf('0x7b')],'include':_0x5b6d59}];_0x1e7974[_0x96bf('0xaf')]({'model':db[_0x96bf('0xd4')],'as':'Account','attributes':['id','name']});_0x1e7974[_0x96bf('0xaf')]({'model':db[_0x96bf('0xd0')],'as':_0x96bf('0xd5'),'attributes':['id',_0x96bf('0x2d')]});return db[_0x96bf('0x3a')][_0x96bf('0x61')]({'where':{'id':_0x466a2a[_0x96bf('0xb2')]['id']},'include':_0x1e7974})[_0x96bf('0x29')](handleEntityNotFound(_0x598b6f,null))[_0x96bf('0x29')](function(_0x4feadc){if(_0x4feadc){var _0x562a3f=_0x4feadc[_0x96bf('0xd6')]({'plain':!![]});fs[_0x96bf('0xd7')](_0x16860d);var _0x3c19b7={'channel':_0x96bf('0xd8'),'account':_0x562a3f[_0x96bf('0xd9')]['name'],'agent':_0x562a3f[_0x96bf('0xd5')]?_0x562a3f[_0x96bf('0xd5')][_0x96bf('0x2d')]:_0x96bf('0xda'),'createdAt':moment(_0x562a3f[_0x96bf('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x562a3f['closed']?moment(_0x562a3f[_0x96bf('0xdb')])[_0x96bf('0xce')](_0x96bf('0xdc'))[_0x96bf('0x9a')]():'','disposition':_0x562a3f['disposition'],'messages':_(_0x562a3f['Messages'])[_0x96bf('0x81')]({'secret':![]})[_0x96bf('0x2c')](function(_0x40636b){return{'date':moment(_0x40636b[_0x96bf('0x75')])[_0x96bf('0xce')]('YYYY-MM-DD\x20HH:mm:ss')[_0x96bf('0x9a')](),'sender':_0x40636b[_0x96bf('0xdd')]===_0x96bf('0xde')?_0x40636b[_0x96bf('0xd0')]?_0x40636b[_0x96bf('0xd0')][_0x96bf('0x2d')]:_0x96bf('0xdf'):_0x40636b[_0x96bf('0x66')]['firstName']+(_0x40636b[_0x96bf('0x66')]['lastName']?'\x20'+_0x40636b['Contact'][_0x96bf('0xe0')]:''),'body':_0x40636b['body'],'direction':_0x40636b[_0x96bf('0xdd')]===_0x96bf('0xde')?'A':'C','secret':_0x40636b[_0x96bf('0xd3')],'read':_0x40636b['read']};})[_0x96bf('0x63')]()};return ejs[_0x96bf('0xe1')](path[_0x96bf('0xc9')](config[_0x96bf('0xca')],'server',_0x96bf('0xe2'),'downloadInteraction.ejs'),{'interaction':_0x3c19b7})[_0x96bf('0x29')](function(_0x5416a9){var _0x17ecb4=path[_0x96bf('0xc9')](_0x16860d,_0x96bf('0xe3')+_0x562a3f['id']+'-'+_0x311e6d+_0x96bf('0xe4'));var _0x140456={'path':_0x17ecb4,'channel':_0x96bf('0xd8'),'interactionId':_0x562a3f['id']};return pdf[_0x96bf('0xe5')](_0x5416a9,_0x140456);})[_0x96bf('0x29')](function(){return new BPromise(function(_0x428267,_0xa0b52f){zipdir(_0x16860d,{'saveTo':_0x7cdedc},function(_0x4c7076,_0x555063){if(_0x4c7076)return _0xa0b52f(_0x4c7076);return _0x428267(_0x555063);});})[_0x96bf('0x29')](function(){return new BPromise(function(_0x29793b,_0x1c0a43){rimraf(_0x16860d,function(_0x4b29d5){if(_0x4b29d5)_0x1c0a43(_0x4b29d5);return _0x29793b();});});})[_0x96bf('0x29')](function(){return _0x598b6f[_0x96bf('0xc7')](_0x7cdedc,_0x33f98d,function(_0x3d23a9){if(_0x3d23a9){console['log'](_0x96bf('0xe6'),_0x3d23a9);}else{fs[_0x96bf('0xe7')](_0x7cdedc);}});});});}else{return _0x598b6f[_0x96bf('0x1c')](0xc8);}})[_0x96bf('0x31')](handleError(_0x598b6f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 94af431..9242732 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 _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x144c88,_0x3fa081){var _0x20a7bd=function(_0x47ab4d){while(--_0x47ab4d){_0x144c88['push'](_0x144c88['shift']());}};_0x20a7bd(++_0x3fa081);}(_0x93e9,0xcc));var _0x993e=function(_0x3018cc,_0x4999cf){_0x3018cc=_0x3018cc-0x0;var _0x5b9bda=_0x93e9[_0x3018cc];return _0x5b9bda;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x32b6=['exports','events','../../mysqldb','SmsMessage','update','remove','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x3c4b57,_0x311577){var _0x2a88eb=function(_0x1808fc){while(--_0x1808fc){_0x3c4b57['push'](_0x3c4b57['shift']());}};_0x2a88eb(++_0x311577);}(_0x32b6,0x1d1));var _0x632b=function(_0x21483f,_0x525229){_0x21483f=_0x21483f-0x0;var _0x53d6f8=_0x32b6[_0x21483f];return _0x53d6f8;};'use strict';var EventEmitter=require(_0x632b('0x0'));var SmsInteraction=require(_0x632b('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x632b('0x1'))['db'][_0x632b('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x632b('0x3'),'afterDestroy':_0x632b('0x4')};function emitEvent(_0x3ba3a7){return function(_0x3a0e0e,_0x1adfe6,_0x122768){_0x3a0e0e[_0x632b('0x5')]({'attributes':['id'],'raw':!![]})[_0x632b('0x6')](function(_0x3bbf43){_0x3a0e0e[_0x632b('0x7')]('Users',_0x3bbf43[_0x632b('0x8')](function(_0x173270){return{'id':_0x173270['id']};}));return SmsMessage[_0x632b('0x9')]({'where':{'SmsInteractionId':_0x3a0e0e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x632b('0x6')](function(_0x4961b1){_0x3a0e0e['setDataValue']('unreadMessages',_0x4961b1[_0x632b('0xa')]);SmsInteractionEvents['emit'](_0x3ba3a7+':'+_0x3a0e0e['id'],_0x3a0e0e);SmsInteractionEvents[_0x632b('0xb')](_0x3ba3a7,_0x3a0e0e);_0x122768(null);})[_0x632b('0xc')](_0x122768(null));};}for(var e in events){if(events[_0x632b('0xd')](e)){var event=events[e];SmsInteraction[_0x632b('0xe')](e,emitEvent(event));}}module[_0x632b('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index e8cc469..4436d30 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 _0xc69b=['api','moment','request-promise','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x598e77,_0xef2bf2){var _0x5940fc=function(_0x2d3398){while(--_0x2d3398){_0x598e77['push'](_0x598e77['shift']());}};_0x5940fc(++_0xef2bf2);}(_0xc69b,0x1ce));var _0xbc69=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xc69b[_0x9b3efc];return _0x200f05;};'use strict';var _=require(_0xbc69('0x0'));var util=require(_0xbc69('0x1'));var logger=require(_0xbc69('0x2'))(_0xbc69('0x3'));var moment=require(_0xbc69('0x4'));var BPromise=require('bluebird');var rp=require(_0xbc69('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbc69('0x6'));var attributes=require(_0xbc69('0x7'));module[_0xbc69('0x8')]=function(_0x481209,_0x4201fb){return _0x481209[_0xbc69('0x9')](_0xbc69('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3688b4,_0xe080ab,_0x4f9c03){if(_0x3688b4[_0xbc69('0xb')](_0xbc69('0xc'))){_0x3688b4[_0xbc69('0xd')]=moment()['format'](_0xbc69('0xe'));}_0x4f9c03(null,_0x3688b4);}}});}; \ No newline at end of file +var _0x7d1d=['SmsInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7d1d,0x79));var _0xd7d1=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0x7d1d[_0x4733d3];return _0x1b9a44;};'use strict';var _=require(_0xd7d1('0x0'));var util=require(_0xd7d1('0x1'));var logger=require(_0xd7d1('0x2'))('api');var moment=require(_0xd7d1('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7d1('0x4'));var fs=require('fs');var path=require(_0xd7d1('0x5'));var rimraf=require(_0xd7d1('0x6'));var config=require(_0xd7d1('0x7'));var attributes=require(_0xd7d1('0x8'));module['exports']=function(_0xf1b41d,_0x5d2f44){return _0xf1b41d['define'](_0xd7d1('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x559dea,_0x365d33,_0x3772e0){if(_0x559dea[_0xd7d1('0xa')](_0xd7d1('0xb'))){_0x559dea['closedAt']=moment()['format'](_0xd7d1('0xc'));}_0x3772e0(null,_0x559dea);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2f19d91..3c10edf 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 _0xca6b=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','where','attributes','limit','stringify','AddTagsToSmsInteraction','addTags','body','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xca6b,0x122));var _0xbca6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xca6b[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xbca6('0x0'));var util=require(_0xbca6('0x1'));var moment=require(_0xbca6('0x2'));var BPromise=require(_0xbca6('0x3'));var rs=require(_0xbca6('0x4'));var fs=require('fs');var Redis=require(_0xbca6('0x5'));var db=require(_0xbca6('0x6'))['db'];var utils=require(_0xbca6('0x7'));var logger=require(_0xbca6('0x8'))(_0xbca6('0x9'));var config=require(_0xbca6('0xa'));var jayson=require(_0xbca6('0xb'));var client=jayson['client'][_0xbca6('0xc')]({'port':0x232a});config[_0xbca6('0xd')]=_[_0xbca6('0xe')](config['redis'],{'host':_0xbca6('0xf'),'port':0x18eb});var socket=require(_0xbca6('0x10'))(new Redis(config[_0xbca6('0xd')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4feb77,_0x18d8f7,_0xf04d0a){return new BPromise(function(_0x4893f0,_0x2f14d6){return client[_0xbca6('0x11')](_0x4feb77,_0xf04d0a)[_0xbca6('0x12')](function(_0x402b91){logger[_0xbca6('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x18d8f7,_0xbca6('0x14'));logger[_0xbca6('0x15')](_0xbca6('0x16'),_0x18d8f7,_0xbca6('0x14'),JSON['stringify'](_0x402b91));if(_0x402b91[_0xbca6('0x17')]){if(_0x402b91[_0xbca6('0x17')][_0xbca6('0x18')]===0x1f4){logger[_0xbca6('0x17')](_0xbca6('0x19'),_0x18d8f7,_0x402b91[_0xbca6('0x17')][_0xbca6('0x1a')]);return _0x2f14d6(_0x402b91[_0xbca6('0x17')][_0xbca6('0x1a')]);}logger['error'](_0xbca6('0x19'),_0x18d8f7,_0x402b91[_0xbca6('0x17')][_0xbca6('0x1a')]);return _0x4893f0(_0x402b91[_0xbca6('0x17')][_0xbca6('0x1a')]);}else{logger['info'](_0xbca6('0x19'),_0x18d8f7,_0xbca6('0x14'));_0x4893f0(_0x402b91[_0xbca6('0x1b')][_0xbca6('0x1a')]);}})[_0xbca6('0x1c')](function(_0x1669e6){logger[_0xbca6('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x18d8f7,_0x1669e6);_0x2f14d6(_0x1669e6);});});}exports[_0xbca6('0x1d')]=function(_0x3388fb){var _0x13a4d1=this;return new Promise(function(_0x1dd694,_0x5d720a){return db[_0xbca6('0x1e')][_0xbca6('0x1f')](_0x3388fb['body'],{'raw':_0x3388fb[_0xbca6('0x20')]?_0x3388fb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3388fb[_0xbca6('0x20')]?_0x3388fb[_0xbca6('0x20')][_0xbca6('0x21')]||null:null,'attributes':_0x3388fb[_0xbca6('0x20')]?_0x3388fb['options'][_0xbca6('0x22')]||null:null,'limit':_0x3388fb[_0xbca6('0x20')]?_0x3388fb[_0xbca6('0x20')][_0xbca6('0x23')]||null:null})['then'](function(_0x14bda8){logger[_0xbca6('0x13')]('UpdateSmsInteraction',_0x3388fb);logger[_0xbca6('0x15')]('UpdateSmsInteraction',_0x3388fb,JSON[_0xbca6('0x24')](_0x14bda8));_0x1dd694(_0x14bda8);})[_0xbca6('0x1c')](function(_0x3d5a84){logger['error'](_0xbca6('0x1d'),_0x3d5a84['message'],_0x3388fb);_0x5d720a(_0x13a4d1['error'](0x1f4,_0x3d5a84[_0xbca6('0x1a')]));});});};exports[_0xbca6('0x25')]=function(_0x241d08){return new Promise(function(_0x38d650,_0x3f70af){return db['SmsInteraction']['find']({'where':_0x241d08[_0xbca6('0x20')]?_0x241d08[_0xbca6('0x20')][_0xbca6('0x21')]||null:null})['then'](function(_0x59979f){if(_0x59979f){return _0x59979f[_0xbca6('0x26')](_0x241d08[_0xbca6('0x27')][_0xbca6('0x28')],_[_0xbca6('0x29')](_0x241d08[_0xbca6('0x27')],[_0xbca6('0x28'),'id'])||{});}})['spread'](function(_0x443abb){logger['info'](_0xbca6('0x2a'),_0x241d08);logger['debug']('AddTags',_0x241d08,JSON[_0xbca6('0x24')](_0x443abb));_0x38d650(_0x443abb);})[_0xbca6('0x1c')](function(_0x26d6eb){logger[_0xbca6('0x17')](_0xbca6('0x2a'),_0x26d6eb[_0xbca6('0x1a')],_0x241d08);_0x3f70af(_this[_0xbca6('0x17')](0x1f4,_0x26d6eb[_0xbca6('0x1a')]));});});}; \ No newline at end of file +var _0xffb8=['then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsInteraction','body','options','raw','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','where','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','request'];(function(_0x4132b8,_0x1a0761){var _0x32dd72=function(_0x5c497d){while(--_0x5c497d){_0x4132b8['push'](_0x4132b8['shift']());}};_0x32dd72(++_0x1a0761);}(_0xffb8,0x109));var _0x8ffb=function(_0x3bd9f8,_0x1eee3d){_0x3bd9f8=_0x3bd9f8-0x0;var _0x2105e1=_0xffb8[_0x3bd9f8];return _0x2105e1;};'use strict';var _=require('lodash');var util=require(_0x8ffb('0x0'));var moment=require(_0x8ffb('0x1'));var BPromise=require(_0x8ffb('0x2'));var rs=require(_0x8ffb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8ffb('0x4'));var logger=require('../../config/logger')(_0x8ffb('0x5'));var config=require(_0x8ffb('0x6'));var jayson=require(_0x8ffb('0x7'));var client=jayson[_0x8ffb('0x8')][_0x8ffb('0x9')]({'port':0x232a});config[_0x8ffb('0xa')]=_[_0x8ffb('0xb')](config[_0x8ffb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ffb('0xc'))(new Redis(config[_0x8ffb('0xa')]));require(_0x8ffb('0xd'))['register'](socket);function respondWithRpcPromise(_0x4cec49,_0x406393,_0x46f735){return new BPromise(function(_0x5126d8,_0x5e2b8d){return client[_0x8ffb('0xe')](_0x4cec49,_0x46f735)[_0x8ffb('0xf')](function(_0x126e9e){logger[_0x8ffb('0x10')](_0x8ffb('0x11'),_0x406393,_0x8ffb('0x12'));logger[_0x8ffb('0x13')](_0x8ffb('0x14'),_0x406393,_0x8ffb('0x12'),JSON[_0x8ffb('0x15')](_0x126e9e));if(_0x126e9e[_0x8ffb('0x16')]){if(_0x126e9e[_0x8ffb('0x16')][_0x8ffb('0x17')]===0x1f4){logger[_0x8ffb('0x16')](_0x8ffb('0x11'),_0x406393,_0x126e9e[_0x8ffb('0x16')]['message']);return _0x5e2b8d(_0x126e9e[_0x8ffb('0x16')][_0x8ffb('0x18')]);}logger[_0x8ffb('0x16')](_0x8ffb('0x11'),_0x406393,_0x126e9e[_0x8ffb('0x16')][_0x8ffb('0x18')]);return _0x5126d8(_0x126e9e[_0x8ffb('0x16')][_0x8ffb('0x18')]);}else{logger[_0x8ffb('0x10')](_0x8ffb('0x11'),_0x406393,_0x8ffb('0x12'));_0x5126d8(_0x126e9e[_0x8ffb('0x19')][_0x8ffb('0x18')]);}})[_0x8ffb('0x1a')](function(_0x412f06){logger[_0x8ffb('0x16')](_0x8ffb('0x11'),_0x406393,_0x412f06);_0x5e2b8d(_0x412f06);});});}exports['UpdateSmsInteraction']=function(_0x40cadd){var _0x3d414b=this;return new Promise(function(_0x183559,_0x1db9f2){return db[_0x8ffb('0x1b')]['update'](_0x40cadd[_0x8ffb('0x1c')],{'raw':_0x40cadd['options']?_0x40cadd[_0x8ffb('0x1d')][_0x8ffb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40cadd[_0x8ffb('0x1d')]?_0x40cadd[_0x8ffb('0x1d')]['where']||null:null,'attributes':_0x40cadd[_0x8ffb('0x1d')]?_0x40cadd[_0x8ffb('0x1d')][_0x8ffb('0x1f')]||null:null,'limit':_0x40cadd[_0x8ffb('0x1d')]?_0x40cadd[_0x8ffb('0x1d')][_0x8ffb('0x20')]||null:null})[_0x8ffb('0xf')](function(_0x511ac9){logger['info']('UpdateSmsInteraction',_0x40cadd);logger[_0x8ffb('0x13')](_0x8ffb('0x21'),_0x40cadd,JSON[_0x8ffb('0x15')](_0x511ac9));_0x183559(_0x511ac9);})[_0x8ffb('0x1a')](function(_0x4cb33c){logger[_0x8ffb('0x16')](_0x8ffb('0x21'),_0x4cb33c[_0x8ffb('0x18')],_0x40cadd);_0x1db9f2(_0x3d414b[_0x8ffb('0x16')](0x1f4,_0x4cb33c[_0x8ffb('0x18')]));});});};exports[_0x8ffb('0x22')]=function(_0x517923){return new Promise(function(_0x3f9afb,_0x1644ac){return db[_0x8ffb('0x1b')]['find']({'where':_0x517923['options']?_0x517923[_0x8ffb('0x1d')][_0x8ffb('0x23')]||null:null})['then'](function(_0x511e8b){if(_0x511e8b){return _0x511e8b[_0x8ffb('0x24')](_0x517923['body'][_0x8ffb('0x25')],_['omit'](_0x517923[_0x8ffb('0x1c')],['ids','id'])||{});}})[_0x8ffb('0x26')](function(_0x222265){logger[_0x8ffb('0x10')]('AddTags',_0x517923);logger[_0x8ffb('0x13')](_0x8ffb('0x27'),_0x517923,JSON[_0x8ffb('0x15')](_0x222265));_0x3f9afb(_0x222265);})[_0x8ffb('0x1a')](function(_0x1a28fa){logger[_0x8ffb('0x16')](_0x8ffb('0x27'),_0x1a28fa[_0x8ffb('0x18')],_0x517923);_0x1644ac(_this['error'](0x1f4,_0x1a28fa[_0x8ffb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ae039c8..b658443 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 _0x7de9=['./smsInteraction.events','save','emit','register','length','smsInteraction:'];(function(_0x3a8cd6,_0x414671){var _0x36170c=function(_0xa8bd05){while(--_0xa8bd05){_0x3a8cd6['push'](_0x3a8cd6['shift']());}};_0x36170c(++_0x414671);}(_0x7de9,0xea));var _0x97de=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x7de9[_0x58dc25];return _0x21b0a7;};'use strict';var SmsInteractionEvents=require(_0x97de('0x0'));var events=[_0x97de('0x1'),'remove','update'];function createListener(_0x2c9d7e,_0x56485b){return function(_0x421a91){_0x56485b[_0x97de('0x2')](_0x2c9d7e,_0x421a91);};}function removeListener(_0x3b3b6f,_0x3077c0){return function(){SmsInteractionEvents['removeListener'](_0x3b3b6f,_0x3077c0);};}exports[_0x97de('0x3')]=function(_0x3b0855){for(var _0x332ecd=0x0,_0x1a3562=events[_0x97de('0x4')];_0x332ecd<_0x1a3562;_0x332ecd++){var _0x508d6e=events[_0x332ecd];var _0x3f63e1=createListener(_0x97de('0x5')+_0x508d6e,_0x3b0855);SmsInteractionEvents['on'](_0x508d6e,_0x3f63e1);}}; \ No newline at end of file +var _0x6a15=['update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x488c60,_0x130839){var _0xc1501f=function(_0x57acad){while(--_0x57acad){_0x488c60['push'](_0x488c60['shift']());}};_0xc1501f(++_0x130839);}(_0x6a15,0x8e));var _0x56a1=function(_0x1aed32,_0x179151){_0x1aed32=_0x1aed32-0x0;var _0x3ebf53=_0x6a15[_0x1aed32];return _0x3ebf53;};'use strict';var SmsInteractionEvents=require(_0x56a1('0x0'));var events=[_0x56a1('0x1'),'remove',_0x56a1('0x2')];function createListener(_0x1d322e,_0x244688){return function(_0x519ac2){_0x244688[_0x56a1('0x3')](_0x1d322e,_0x519ac2);};}function removeListener(_0x570349,_0x9a3a10){return function(){SmsInteractionEvents[_0x56a1('0x4')](_0x570349,_0x9a3a10);};}exports[_0x56a1('0x5')]=function(_0x2e2532){for(var _0x5e54ec=0x0,_0x1d85b7=events[_0x56a1('0x6')];_0x5e54ec<_0x1d85b7;_0x5e54ec++){var _0x179d0d=events[_0x5e54ec];var _0x38850e=createListener(_0x56a1('0x7')+_0x179d0d,_0x2e2532);SmsInteractionEvents['on'](_0x179d0d,_0x38850e);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index c745526..0b8bbf0 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 _0x41e0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','tracked','sms','smsmessage:create','post','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x30ce9a,_0xa219d){var _0x102761=function(_0x2cb836){while(--_0x2cb836){_0x30ce9a['push'](_0x30ce9a['shift']());}};_0x102761(++_0xa219d);}(_0x41e0,0x18f));var _0x041e=function(_0x5a2fbf,_0x13c8da){_0x5a2fbf=_0x5a2fbf-0x0;var _0x2c916b=_0x41e0[_0x5a2fbf];return _0x2c916b;};'use strict';var multer=require(_0x041e('0x0'));var util=require(_0x041e('0x1'));var path=require(_0x041e('0x2'));var timeout=require(_0x041e('0x3'));var express=require(_0x041e('0x4'));var router=express[_0x041e('0x5')]();var fs_extra=require(_0x041e('0x6'));var auth=require(_0x041e('0x7'));var interaction=require(_0x041e('0x8'));var config=require(_0x041e('0x9'));var controller=require(_0x041e('0xa'));router[_0x041e('0xb')]('/',auth[_0x041e('0xc')](),controller[_0x041e('0xd')]);router[_0x041e('0xb')](_0x041e('0xe'),auth[_0x041e('0xc')](),controller['describe']);router[_0x041e('0xb')](_0x041e('0xf'),auth[_0x041e('0xc')](),controller[_0x041e('0x10')]);router['post']('/',auth[_0x041e('0xc')](),interaction[_0x041e('0x11')](_0x041e('0x12'),_0x041e('0x13')),controller['create']);router[_0x041e('0x14')]('/:id/status',controller[_0x041e('0x15')]);router[_0x041e('0x16')](_0x041e('0xf'),auth['isAuthenticated'](),controller[_0x041e('0x17')]);router[_0x041e('0x16')](_0x041e('0x18'),auth['isAuthenticated'](),controller[_0x041e('0x19')]);router[_0x041e('0x16')](_0x041e('0x1a'),auth[_0x041e('0xc')](),controller['reject']);router[_0x041e('0x1b')](_0x041e('0xf'),auth[_0x041e('0xc')](),controller[_0x041e('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x275f=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./smsMessage.controller','get','index','/describe','isAuthenticated','/:id','show','tracked','smsmessage:create','create','post','/:id/status','status','put','accept','reject'];(function(_0x3e7178,_0x3f8c44){var _0x1b94cd=function(_0x3f0bb4){while(--_0x3f0bb4){_0x3e7178['push'](_0x3e7178['shift']());}};_0x1b94cd(++_0x3f8c44);}(_0x275f,0x1e2));var _0xf275=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x275f[_0x333767];return _0x51661b;};'use strict';var multer=require(_0xf275('0x0'));var util=require('util');var path=require(_0xf275('0x1'));var timeout=require(_0xf275('0x2'));var express=require(_0xf275('0x3'));var router=express[_0xf275('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf275('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf275('0x6'));router[_0xf275('0x7')]('/',auth['isAuthenticated'](),controller[_0xf275('0x8')]);router['get'](_0xf275('0x9'),auth[_0xf275('0xa')](),controller['describe']);router['get'](_0xf275('0xb'),auth['isAuthenticated'](),controller[_0xf275('0xc')]);router['post']('/',auth[_0xf275('0xa')](),interaction[_0xf275('0xd')]('sms',_0xf275('0xe')),controller[_0xf275('0xf')]);router[_0xf275('0x10')](_0xf275('0x11'),controller[_0xf275('0x12')]);router['put'](_0xf275('0xb'),auth[_0xf275('0xa')](),controller['update']);router[_0xf275('0x13')]('/:id/accept',auth[_0xf275('0xa')](),controller[_0xf275('0x14')]);router[_0xf275('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xf275('0x15')]);router['delete'](_0xf275('0xb'),auth['isAuthenticated'](),controller[_0xf275('0x16')]);module[_0xf275('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index cf8cba7..b23dd72 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 _0x03e2=['STRING','sequelize','medium','BOOLEAN','ENUM','out'];(function(_0x2700d5,_0x1b113b){var _0xdc3338=function(_0x1d07ed){while(--_0x1d07ed){_0x2700d5['push'](_0x2700d5['shift']());}};_0xdc3338(++_0x1b113b);}(_0x03e2,0xcd));var _0x203e=function(_0x4b369e,_0x574bc7){_0x4b369e=_0x4b369e-0x0;var _0x176fae=_0x03e2[_0x4b369e];return _0x176fae;};'use strict';var Sequelize=require(_0x203e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x203e('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x203e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x203e('0x3')]('in',_0x203e('0x4')),'defaultValue':_0x203e('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x203e('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x203e('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x203e('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb85f=['exports','TEXT','medium','ENUM','STRING','BOOLEAN'];(function(_0x5b16eb,_0x5c9b13){var _0x3d9016=function(_0x4fbd6e){while(--_0x4fbd6e){_0x5b16eb['push'](_0x5b16eb['shift']());}};_0x3d9016(++_0x5c9b13);}(_0xb85f,0x132));var _0xfb85=function(_0x341b6f,_0x5cbcba){_0x341b6f=_0x341b6f-0x0;var _0x59fa0a=_0xb85f[_0x341b6f];return _0x59fa0a;};'use strict';var Sequelize=require('sequelize');module[_0xfb85('0x0')]={'body':{'type':Sequelize[_0xfb85('0x1')](_0xfb85('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb85('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xfb85('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xfb85('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xfb85('0x4')]},'providerResponse':{'type':Sequelize[_0xfb85('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index a2346e8..719de21 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 _0x25a9=['end','json','undefined','limit','count','offset','set','apply','reject','update','then','stack','name','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SmsMessage','includeAll','findAll','show','params','include','create','body','destroy','describe','sms-interactions','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','SmsInteraction','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','agent','fullname','internal','interface','SIP/%s','channel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','email','motionChannel','event','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','delivered','Status','plivio','infobip','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status'];(function(_0x4016fb,_0x5507a4){var _0x36990f=function(_0x25c8b8){while(--_0x25c8b8){_0x4016fb['push'](_0x4016fb['shift']());}};_0x36990f(++_0x5507a4);}(_0x25a9,0xf1));var _0x925a=function(_0x5ddda9,_0x43e558){_0x5ddda9=_0x5ddda9-0x0;var _0x53a004=_0x25a9[_0x5ddda9];return _0x53a004;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x925a('0x0'));var zipdir=require(_0x925a('0x1'));var jsonpatch=require(_0x925a('0x2'));var rp=require(_0x925a('0x3'));var moment=require(_0x925a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x925a('0x5'));var util=require(_0x925a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x925a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x925a('0x8'));var _=require(_0x925a('0x9'));var squel=require(_0x925a('0xa'));var crypto=require(_0x925a('0xb'));var jsforce=require(_0x925a('0xc'));var deskjs=require(_0x925a('0xd'));var toCsv=require(_0x925a('0x7'));var querystring=require('querystring');var Papa=require(_0x925a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x925a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x925a('0x10'))(_0x925a('0x11'));var utils=require(_0x925a('0x12'));var config=require(_0x925a('0x13'));var licenseUtil=require(_0x925a('0x14'));var db=require(_0x925a('0x15'))['db'];config['redis']=_[_0x925a('0x16')](config[_0x925a('0x17')],{'host':_0x925a('0x18'),'port':0x18eb});var socket=require(_0x925a('0x19'))(new Redis(config[_0x925a('0x17')]));require(_0x925a('0x1a'))[_0x925a('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x925a('0x1c')][_0x925a('0x1d')]({'port':0x232c});var client9002=jayson[_0x925a('0x1c')][_0x925a('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x494bc5,_0xa915f0,_0x308baf,_0x5c6ed6){return new BPromise(function(_0x425afe,_0x1d1f17){var _0x3a08f0=_0x5c6ed6||client;return _0x3a08f0[_0x925a('0x1e')](_0x494bc5,_0x308baf)['then'](function(_0xc05d6f){logger[_0x925a('0x1f')](_0x925a('0x20'),_0xa915f0,_0x925a('0x21'));logger[_0x925a('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa915f0,'request\x20sent',JSON[_0x925a('0x23')](_0xc05d6f));if(_0xc05d6f[_0x925a('0x24')]){if(_0xc05d6f['error'][_0x925a('0x25')]===0x1f4){logger[_0x925a('0x24')](_0x925a('0x20'),_0xa915f0,_0xc05d6f[_0x925a('0x24')][_0x925a('0x26')]);return _0x1d1f17(_0xc05d6f[_0x925a('0x24')][_0x925a('0x26')]);}logger[_0x925a('0x24')]('SmsMessage,\x20%s,\x20%s',_0xa915f0,_0xc05d6f[_0x925a('0x24')][_0x925a('0x26')]);return _0x425afe(_0xc05d6f[_0x925a('0x24')]['message']);}else{logger[_0x925a('0x1f')](_0x925a('0x20'),_0xa915f0,'request\x20sent');_0x425afe(_0xc05d6f[_0x925a('0x27')]['message']);}})[_0x925a('0x28')](function(_0x30fb0e){logger[_0x925a('0x24')](_0x925a('0x20'),_0xa915f0,_0x30fb0e);_0x1d1f17(_0x30fb0e);});});}function respondWithStatusCode(_0x3d7729,_0x126aa5){_0x126aa5=_0x126aa5||0xcc;return function(_0x12c76e){if(_0x12c76e){return _0x3d7729[_0x925a('0x29')](_0x126aa5);}return _0x3d7729[_0x925a('0x2a')](_0x126aa5)[_0x925a('0x2b')]();};}function respondWithResult(_0x47f8a8,_0xb1a056){_0xb1a056=_0xb1a056||0xc8;return function(_0x43683c){if(_0x43683c){return _0x47f8a8[_0x925a('0x2a')](_0xb1a056)[_0x925a('0x2c')](_0x43683c);}};}function respondWithFilteredResult(_0x5cb909,_0x296337){return function(_0x495bff){if(_0x495bff){var _0x2e3ad9=typeof _0x296337['offset']===_0x925a('0x2d')&&typeof _0x296337[_0x925a('0x2e')]===_0x925a('0x2d');var _0x2ad0ca=_0x495bff[_0x925a('0x2f')];var _0x156372=_0x2e3ad9?0x0:_0x296337[_0x925a('0x30')];var _0x34e311=_0x2e3ad9?_0x495bff['count']:_0x296337[_0x925a('0x30')]+_0x296337['limit'];var _0x4291ea;if(_0x34e311>=_0x2ad0ca){_0x34e311=_0x2ad0ca;_0x4291ea=0xc8;}else{_0x4291ea=0xce;}_0x5cb909[_0x925a('0x2a')](_0x4291ea);return _0x5cb909[_0x925a('0x31')]('Content-Range',_0x156372+'-'+_0x34e311+'/'+_0x2ad0ca)[_0x925a('0x2c')](_0x495bff);}return null;};}function patchUpdates(_0x113a16){return function(_0x593401){try{jsonpatch[_0x925a('0x32')](_0x593401,_0x113a16,!![]);}catch(_0x2af120){return BPromise[_0x925a('0x33')](_0x2af120);}return _0x593401['save']();};}function saveUpdates(_0x352e9b,_0x4143e0){return function(_0x37c74c){if(_0x37c74c){return _0x37c74c[_0x925a('0x34')](_0x352e9b)['then'](function(_0x4fe591){return _0x4fe591;});}return null;};}function removeEntity(_0x3df454,_0x259cab){return function(_0x315ae7){if(_0x315ae7){return _0x315ae7['destroy']()[_0x925a('0x35')](function(){_0x3df454[_0x925a('0x2a')](0xcc)[_0x925a('0x2b')]();});}};}function handleEntityNotFound(_0xaa84a6,_0x4cc6e1){return function(_0x56d1d3){if(!_0x56d1d3){_0xaa84a6[_0x925a('0x29')](0x194);}return _0x56d1d3;};}function handleError(_0xf48380,_0x3af324){_0x3af324=_0x3af324||0x1f4;return function(_0xd3a716){logger[_0x925a('0x24')](_0xd3a716[_0x925a('0x36')]);if(_0xd3a716['name']){delete _0xd3a716[_0x925a('0x37')];}_0xf48380['status'](_0x3af324)['send'](_0xd3a716);};}exports[_0x925a('0x38')]=function(_0x42b756,_0x5b1289){var _0x438f39={},_0x10cfef={},_0x5527f0={'count':0x0,'rows':[]};var _0x2cea95=_['map'](db['SmsMessage']['rawAttributes'],function(_0x2717dd){return{'name':_0x2717dd[_0x925a('0x39')],'type':_0x2717dd[_0x925a('0x3a')][_0x925a('0x3b')]};});_0x10cfef[_0x925a('0x3c')]=_[_0x925a('0x3d')](_0x2cea95,'name');_0x10cfef[_0x925a('0x3e')]=_[_0x925a('0x3f')](_0x42b756[_0x925a('0x3e')]);_0x10cfef[_0x925a('0x40')]=_[_0x925a('0x41')](_0x10cfef[_0x925a('0x3c')],_0x10cfef[_0x925a('0x3e')]);_0x438f39[_0x925a('0x42')]=_[_0x925a('0x41')](_0x10cfef[_0x925a('0x3c')],qs[_0x925a('0x43')](_0x42b756[_0x925a('0x3e')]['fields']));_0x438f39['attributes']=_0x438f39[_0x925a('0x42')][_0x925a('0x44')]?_0x438f39[_0x925a('0x42')]:_0x10cfef['model'];if(!_0x42b756[_0x925a('0x3e')][_0x925a('0x45')](_0x925a('0x46'))){_0x438f39[_0x925a('0x2e')]=qs['limit'](_0x42b756[_0x925a('0x3e')]['limit']);_0x438f39['offset']=qs[_0x925a('0x30')](_0x42b756[_0x925a('0x3e')]['offset']);}_0x438f39['order']=qs[_0x925a('0x47')](_0x42b756['query']['sort']);_0x438f39[_0x925a('0x48')]=qs[_0x925a('0x40')](_[_0x925a('0x49')](_0x42b756['query'],_0x10cfef[_0x925a('0x40')]),_0x2cea95);if(_0x42b756[_0x925a('0x3e')][_0x925a('0x4a')]){_0x438f39[_0x925a('0x48')]=_[_0x925a('0x4b')](_0x438f39[_0x925a('0x48')],{'$or':_[_0x925a('0x3d')](_0x2cea95,function(_0x613c50){if(_0x613c50['type']!==_0x925a('0x4c')){var _0x2f7a50={};_0x2f7a50[_0x613c50[_0x925a('0x37')]]={'$like':'%'+_0x42b756[_0x925a('0x3e')][_0x925a('0x4a')]+'%'};return _0x2f7a50;}})});}_0x438f39=_['merge']({},_0x438f39,_0x42b756[_0x925a('0x4d')]);var _0x439fa1={'where':_0x438f39[_0x925a('0x48')]};return db[_0x925a('0x4e')][_0x925a('0x2f')](_0x439fa1)[_0x925a('0x35')](function(_0x59736c){_0x5527f0[_0x925a('0x2f')]=_0x59736c;if(_0x42b756[_0x925a('0x3e')][_0x925a('0x4f')]){_0x438f39['include']=[{'all':!![]}];}return db[_0x925a('0x4e')][_0x925a('0x50')](_0x438f39);})[_0x925a('0x35')](function(_0x5d0cee){_0x5527f0['rows']=_0x5d0cee;return _0x5527f0;})['then'](respondWithFilteredResult(_0x5b1289,_0x438f39))[_0x925a('0x28')](handleError(_0x5b1289,null));};exports[_0x925a('0x51')]=function(_0x128e38,_0x13bd73){var _0x238a6d={'raw':!![],'where':{'id':_0x128e38[_0x925a('0x52')]['id']}},_0x4e1603={};_0x4e1603[_0x925a('0x3c')]=_[_0x925a('0x3f')](db[_0x925a('0x4e')]['rawAttributes']);_0x4e1603[_0x925a('0x3e')]=_[_0x925a('0x3f')](_0x128e38[_0x925a('0x3e')]);_0x4e1603[_0x925a('0x40')]=_[_0x925a('0x41')](_0x4e1603['model'],_0x4e1603[_0x925a('0x3e')]);_0x238a6d[_0x925a('0x42')]=_[_0x925a('0x41')](_0x4e1603['model'],qs[_0x925a('0x43')](_0x128e38[_0x925a('0x3e')]['fields']));_0x238a6d[_0x925a('0x42')]=_0x238a6d[_0x925a('0x42')][_0x925a('0x44')]?_0x238a6d['attributes']:_0x4e1603[_0x925a('0x3c')];if(_0x128e38['query'][_0x925a('0x4f')]){_0x238a6d[_0x925a('0x53')]=[{'all':!![]}];}_0x238a6d=_[_0x925a('0x4b')]({},_0x238a6d,_0x128e38['options']);return db['SmsMessage']['find'](_0x238a6d)['then'](handleEntityNotFound(_0x13bd73,null))[_0x925a('0x35')](respondWithResult(_0x13bd73,null))['catch'](handleError(_0x13bd73,null));};exports[_0x925a('0x54')]=function(_0x1db19b,_0xf94ca1){return db[_0x925a('0x4e')][_0x925a('0x54')](_0x1db19b[_0x925a('0x55')],{})[_0x925a('0x35')](respondWithResult(_0xf94ca1,0xc9))['catch'](handleError(_0xf94ca1,null));};exports[_0x925a('0x34')]=function(_0x180d05,_0x3c26d1){if(_0x180d05[_0x925a('0x55')]['id']){delete _0x180d05[_0x925a('0x55')]['id'];}return db['SmsMessage']['find']({'where':{'id':_0x180d05[_0x925a('0x52')]['id']}})[_0x925a('0x35')](handleEntityNotFound(_0x3c26d1,null))['then'](saveUpdates(_0x180d05[_0x925a('0x55')],null))[_0x925a('0x35')](respondWithResult(_0x3c26d1,null))[_0x925a('0x28')](handleError(_0x3c26d1,null));};exports[_0x925a('0x56')]=function(_0x2b3133,_0x484097){return db[_0x925a('0x4e')]['find']({'where':{'id':_0x2b3133['params']['id']}})[_0x925a('0x35')](handleEntityNotFound(_0x484097,null))[_0x925a('0x35')](removeEntity(_0x484097,null))['catch'](handleError(_0x484097,null));};exports[_0x925a('0x57')]=function(_0x4678cf,_0x405d3a){return db[_0x925a('0x4e')][_0x925a('0x57')]()[_0x925a('0x35')](respondWithResult(_0x405d3a,null))[_0x925a('0x28')](handleError(_0x405d3a,null));};var interaction_log=require(_0x925a('0x10'))(_0x925a('0x58'));exports[_0x925a('0x59')]=function(_0x9ac02b,_0x43aec8,_0x57ac88){var _0x47536d={'agent':{},'channel':_0x925a('0x5a')};if(_0x9ac02b['body']['id']){delete _0x9ac02b[_0x925a('0x55')]['id'];}_0x9ac02b[_0x925a('0x55')]['read']=!![];_0x9ac02b[_0x925a('0x55')][_0x925a('0x5b')]=moment()[_0x925a('0x5c')](_0x925a('0x5d'));_0x9ac02b[_0x925a('0x55')]['UserId']=_0x9ac02b['body'][_0x925a('0x5e')]||_0x9ac02b[_0x925a('0x5f')]['id'];_0x47536d['agent']['id']=_0x9ac02b['body'][_0x925a('0x5e')];return db[_0x925a('0x4e')][_0x925a('0x60')]({'where':{'id':_0x9ac02b['params']['id'],'UserId':null}})[_0x925a('0x35')](handleEntityNotFound(_0x43aec8,null))[_0x925a('0x35')](saveUpdates(_0x9ac02b[_0x925a('0x55')],null))[_0x925a('0x35')](function(_0x52a1d8){if(_0x52a1d8){_0x47536d[_0x925a('0x26')]=_0x52a1d8['get']({'plain':!![]});return db[_0x925a('0x61')][_0x925a('0x60')]({'where':{'id':_0x52a1d8[_0x925a('0x62')]}});}return null;})[_0x925a('0x35')](handleEntityNotFound(_0x43aec8,null))[_0x925a('0x35')](function(_0x5d0e2c){if(_0x5d0e2c){return _0x5d0e2c[_0x925a('0x34')]({'UserId':_0x9ac02b[_0x925a('0x55')]['UserId'],'read1stAt':_[_0x925a('0x63')](_0x5d0e2c['read1stAt'])?moment()[_0x925a('0x5c')](_0x925a('0x5d')):undefined});}return null;})[_0x925a('0x35')](function(_0x280410){if(_0x280410){_0x47536d[_0x925a('0x64')]=_0x280410[_0x925a('0x65')]({'plain':!![]});interaction_log[_0x925a('0x1f')](_0x925a('0x66'),_0x9ac02b[_0x925a('0x5f')]['id'],_0x9ac02b['user'][_0x925a('0x37')],_0x9ac02b[_0x925a('0x5f')][_0x925a('0x67')],_0x47536d[_0x925a('0x64')]['id'],_0x9ac02b['body']?JSON[_0x925a('0x23')](_0x9ac02b[_0x925a('0x55')]):_0x925a('0x68'));return respondWithRpcPromise(_0x925a('0x69'),_0x925a('0x6a'),_0x47536d);}return null;})['then'](function(_0x27a170){var _0x3c83b6=_0x925a('0x6b')+_0x27a170['message']['ContactId'];return db[_0x925a('0x6c')][_0x925a('0x3e')](_0x3c83b6,{'type':db[_0x925a('0x6d')][_0x925a('0x6e')]['SELECT'],'raw':!![]})[_0x925a('0x35')](function(_0x2e1b5b){return _0x2e1b5b;});})['then'](function(_0x20462b){if(_0x20462b){_0x47536d[_0x925a('0x26')][_0x925a('0x6f')]=_0x20462b[0x0];if(!_0x9ac02b['body']['UserId'])return;return db[_0x925a('0x70')][_0x925a('0x60')]({'where':{'id':_0x9ac02b[_0x925a('0x55')][_0x925a('0x5e')],'role':_0x925a('0x71')},'attributes':['id',_0x925a('0x37'),_0x925a('0x72'),'email',_0x925a('0x73')],'raw':!![]});}return null;})[_0x925a('0x35')](function(_0x3e7d61){if(!_0x3e7d61)return null;_0x47536d[_0x925a('0x26')][_0x925a('0x71')]=_0x3e7d61;return _0x47536d;})[_0x925a('0x35')](function(_0x35f0e7){if(_0x35f0e7){if(_0x9ac02b['body']['manual']){_0x47536d[_0x925a('0x26')][_0x925a('0x74')]=util['format'](_0x925a('0x75'),_0x9ac02b['user']['name']);_0x47536d[_0x925a('0x26')]['channel']=_0x47536d[_0x925a('0x76')];_0x47536d[_0x925a('0x26')]['motionChannel']=_0x47536d[_0x925a('0x76')];_0x47536d[_0x925a('0x26')]['event']=_0x925a('0x59');return respondWithRpcPromise(_0x925a('0x77'),_0x925a('0x77'),{'event':_0x925a('0x78'),'message':_0x47536d[_0x925a('0x26')]},client9002)[_0x925a('0x35')](function(){return _0x47536d;});}return _0x47536d;}return null;})[_0x925a('0x35')](respondWithResult(_0x43aec8,null))[_0x925a('0x28')](handleError(_0x43aec8,null));};var interaction_log=require('../../config/logger')(_0x925a('0x58'));exports[_0x925a('0x33')]=function(_0x5579e2,_0x5ad0b1,_0x239720){var _0x4696ec={'agent':{},'channel':_0x925a('0x5a')};if(_0x5579e2[_0x925a('0x55')]['id']){delete _0x5579e2[_0x925a('0x55')]['id'];}_0x5579e2[_0x925a('0x55')][_0x925a('0x5e')]=_0x5579e2[_0x925a('0x55')][_0x925a('0x5e')]||_0x5579e2[_0x925a('0x5f')]['id'];_0x4696ec[_0x925a('0x71')]['id']=_0x5579e2[_0x925a('0x55')][_0x925a('0x5e')];return db[_0x925a('0x4e')]['find']({'where':{'id':_0x5579e2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ad0b1,null))['then'](function(_0x574622){if(_0x574622){_0x4696ec['message']=_0x574622[_0x925a('0x65')]({'plain':!![]});return db[_0x925a('0x61')][_0x925a('0x60')]({'where':{'id':_0x574622[_0x925a('0x62')]}});}return null;})[_0x925a('0x35')](handleEntityNotFound(_0x5ad0b1,null))['then'](function(_0x29da5a){if(_0x29da5a){_0x4696ec[_0x925a('0x64')]=_0x29da5a[_0x925a('0x65')]({'plain':!![]});interaction_log[_0x925a('0x1f')](_0x925a('0x79'),_0x5579e2[_0x925a('0x5f')]['id'],_0x5579e2[_0x925a('0x5f')][_0x925a('0x37')],_0x5579e2[_0x925a('0x5f')]['role'],_0x4696ec['interaction']['id'],_0x5579e2[_0x925a('0x55')]?JSON['stringify'](_0x5579e2[_0x925a('0x55')]):_0x925a('0x68'));return respondWithRpcPromise(_0x925a('0x7a'),'rejectMessage',_0x4696ec);}return null;})['then'](function(_0x46ffd2){var _0x301633=_0x925a('0x6b')+_0x46ffd2[_0x925a('0x26')][_0x925a('0x7b')];return db['sequelize']['query'](_0x301633,{'type':db[_0x925a('0x6d')][_0x925a('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x55f979){return _0x55f979;});})[_0x925a('0x35')](function(_0x29a8a5){if(_0x29a8a5){_0x4696ec[_0x925a('0x26')][_0x925a('0x6f')]=_0x29a8a5[0x0];if(!_0x5579e2[_0x925a('0x55')][_0x925a('0x5e')])return;return db[_0x925a('0x70')]['find']({'where':{'id':_0x5579e2[_0x925a('0x55')][_0x925a('0x5e')],'role':_0x925a('0x71')},'attributes':['id',_0x925a('0x37'),_0x925a('0x72'),_0x925a('0x7c'),_0x925a('0x73')],'raw':!![]});}return null;})[_0x925a('0x35')](function(_0x3e72ca){if(!_0x3e72ca)return null;_0x4696ec[_0x925a('0x26')]['agent']=_0x3e72ca;return _0x4696ec;})['then'](function(_0x5b5df0){if(_0x5b5df0){_0x5b5df0[_0x925a('0x26')]['interface']=util[_0x925a('0x5c')](_0x925a('0x75'),_0x5579e2[_0x925a('0x5f')][_0x925a('0x37')]);_0x5b5df0['message'][_0x925a('0x76')]=_0x4696ec['channel'];_0x5b5df0[_0x925a('0x26')][_0x925a('0x7d')]=_0x4696ec[_0x925a('0x76')];_0x5b5df0[_0x925a('0x26')][_0x925a('0x7e')]=_0x925a('0x33');respondWithRpcPromise(_0x925a('0x77'),_0x925a('0x77'),{'event':_0x925a('0x7f'),'message':_0x5b5df0[_0x925a('0x26')]},client9002);return _0x4696ec;}return null;})[_0x925a('0x35')](respondWithResult(_0x5ad0b1,null))['catch'](handleError(_0x5ad0b1,null));};exports[_0x925a('0x2a')]=function(_0x39cd1a,_0x50d198,_0x30c386){if(_0x39cd1a[_0x925a('0x55')]['id']){delete _0x39cd1a[_0x925a('0x55')]['id'];}var _0x3ee273;return db[_0x925a('0x4e')][_0x925a('0x60')]({'where':{'id':_0x39cd1a['params']['id']}})[_0x925a('0x35')](handleEntityNotFound(_0x50d198,null))[_0x925a('0x35')](function(_0xcc0fba){if(_0xcc0fba){_0x3ee273=_0xcc0fba;return db[_0x925a('0x80')][_0x925a('0x60')]({'where':{'id':_0xcc0fba['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x50d198,null))[_0x925a('0x35')](function(_0x28b65f){if(_0x28b65f){logger[_0x925a('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x925a('0x2a'),_0x925a('0x81'),_0x28b65f['type'],util[_0x925a('0x82')](_0x39cd1a['body'],{'showHidden':![],'depth':null}));switch(_0x28b65f[_0x925a('0x3a')]){case _0x925a('0x83'):if(_0x39cd1a[_0x925a('0x55')][_0x925a('0x84')]&&_0x39cd1a[_0x925a('0x55')][_0x925a('0x84')]===_0x3ee273[_0x925a('0x85')]){return _0x3ee273['update']({'read':!![]});}else{logger[_0x925a('0x24')](_0x925a('0x86'),'status',_0x925a('0x83'),util[_0x925a('0x82')](_0x39cd1a[_0x925a('0x55')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x39cd1a[_0x925a('0x55')]['MessageUUID']&&_0x39cd1a['body'][_0x925a('0x87')]===_0x3ee273[_0x925a('0x85')]&&_['indexOf'](['sent',_0x925a('0x88')],_0x39cd1a[_0x925a('0x55')][_0x925a('0x89')])>=0x0){return _0x3ee273[_0x925a('0x34')]({'read':!![]});}else{logger['error'](_0x925a('0x86'),'status',_0x925a('0x8a'),util[_0x925a('0x82')](_0x39cd1a['body'],{'showHidden':![],'depth':null}));}break;case _0x925a('0x8b'):var _0x4d569b=_0x39cd1a[_0x925a('0x55')]['results'][0x0];if(_0x4d569b[_0x925a('0x2a')][_0x925a('0x8c')]===_0x925a('0x8d')){return _0x3ee273[_0x925a('0x34')]({'read':!![]});}else{logger[_0x925a('0x24')](_0x925a('0x86'),'status',_0x925a('0x8b'),util['inspect'](_0x39cd1a['body'],{'showHidden':![],'depth':null}));}break;}return _0x3ee273;}})['then'](respondWithResult(_0x50d198,null))[_0x925a('0x28')](handleError(_0x50d198,null));}; \ No newline at end of file +var _0xe11d=['null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','fullname','internal','SIP/%s','channel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','QueryTypes','interface','motionChannel','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','inspect','infobip','results','groupName','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','SmsMessage','options','find','create','update','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify'];(function(_0x569fd8,_0x4d2ce7){var _0x36991b=function(_0xbd8842){while(--_0xbd8842){_0x569fd8['push'](_0x569fd8['shift']());}};_0x36991b(++_0x4d2ce7);}(_0xe11d,0x1eb));var _0xde11=function(_0xfb5088,_0x65d39f){_0xfb5088=_0xfb5088-0x0;var _0x5cc4d9=_0xe11d[_0xfb5088];return _0x5cc4d9;};'use strict';var emlformat=require(_0xde11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xde11('0x1'));var jsonpatch=require(_0xde11('0x2'));var rp=require(_0xde11('0x3'));var moment=require('moment');var BPromise=require(_0xde11('0x4'));var Mustache=require(_0xde11('0x5'));var util=require(_0xde11('0x6'));var path=require(_0xde11('0x7'));var sox=require(_0xde11('0x8'));var csv=require(_0xde11('0x9'));var ejs=require(_0xde11('0xa'));var fs=require('fs');var fs_extra=require(_0xde11('0xb'));var _=require('lodash');var squel=require(_0xde11('0xc'));var crypto=require(_0xde11('0xd'));var jsforce=require(_0xde11('0xe'));var deskjs=require(_0xde11('0xf'));var toCsv=require(_0xde11('0x9'));var querystring=require('querystring');var Papa=require(_0xde11('0x10'));var Redis=require(_0xde11('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde11('0x12'));var hardwareService=require(_0xde11('0x13'));var logger=require(_0xde11('0x14'))(_0xde11('0x15'));var utils=require(_0xde11('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xde11('0x17'));var db=require(_0xde11('0x18'))['db'];config[_0xde11('0x19')]=_['defaults'](config['redis'],{'host':_0xde11('0x1a'),'port':0x18eb});var socket=require(_0xde11('0x1b'))(new Redis(config[_0xde11('0x19')]));require(_0xde11('0x1c'))[_0xde11('0x1d')](socket);var jayson=require(_0xde11('0x1e'));var client=jayson[_0xde11('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xde11('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57dd88,_0x17c1ea,_0x5c1986,_0x4da1c9){return new BPromise(function(_0x995da1,_0x328d0c){var _0x4fb962=_0x4da1c9||client;return _0x4fb962['request'](_0x57dd88,_0x5c1986)['then'](function(_0x4ae170){logger[_0xde11('0x20')](_0xde11('0x21'),_0x17c1ea,_0xde11('0x22'));logger[_0xde11('0x23')](_0xde11('0x24'),_0x17c1ea,'request\x20sent',JSON['stringify'](_0x4ae170));if(_0x4ae170[_0xde11('0x25')]){if(_0x4ae170['error'][_0xde11('0x26')]===0x1f4){logger[_0xde11('0x25')](_0xde11('0x21'),_0x17c1ea,_0x4ae170[_0xde11('0x25')][_0xde11('0x27')]);return _0x328d0c(_0x4ae170['error'][_0xde11('0x27')]);}logger[_0xde11('0x25')](_0xde11('0x21'),_0x17c1ea,_0x4ae170[_0xde11('0x25')][_0xde11('0x27')]);return _0x995da1(_0x4ae170[_0xde11('0x25')][_0xde11('0x27')]);}else{logger[_0xde11('0x20')]('SmsMessage,\x20%s,\x20%s',_0x17c1ea,'request\x20sent');_0x995da1(_0x4ae170[_0xde11('0x28')][_0xde11('0x27')]);}})['catch'](function(_0x1a3600){logger[_0xde11('0x25')](_0xde11('0x21'),_0x17c1ea,_0x1a3600);_0x328d0c(_0x1a3600);});});}function respondWithStatusCode(_0x27e93a,_0x502e48){_0x502e48=_0x502e48||0xcc;return function(_0x24da1c){if(_0x24da1c){return _0x27e93a[_0xde11('0x29')](_0x502e48);}return _0x27e93a[_0xde11('0x2a')](_0x502e48)['end']();};}function respondWithResult(_0x1918f9,_0x3e8fb9){_0x3e8fb9=_0x3e8fb9||0xc8;return function(_0x5925f1){if(_0x5925f1){return _0x1918f9[_0xde11('0x2a')](_0x3e8fb9)[_0xde11('0x2b')](_0x5925f1);}};}function respondWithFilteredResult(_0x1976a3,_0x213b9d){return function(_0x283ede){if(_0x283ede){var _0x2dabd4=typeof _0x213b9d[_0xde11('0x2c')]===_0xde11('0x2d')&&typeof _0x213b9d['limit']===_0xde11('0x2d');var _0x4e576e=_0x283ede[_0xde11('0x2e')];var _0x24e573=_0x2dabd4?0x0:_0x213b9d[_0xde11('0x2c')];var _0x2ff130=_0x2dabd4?_0x283ede['count']:_0x213b9d[_0xde11('0x2c')]+_0x213b9d[_0xde11('0x2f')];var _0x32b224;if(_0x2ff130>=_0x4e576e){_0x2ff130=_0x4e576e;_0x32b224=0xc8;}else{_0x32b224=0xce;}_0x1976a3[_0xde11('0x2a')](_0x32b224);return _0x1976a3[_0xde11('0x30')](_0xde11('0x31'),_0x24e573+'-'+_0x2ff130+'/'+_0x4e576e)[_0xde11('0x2b')](_0x283ede);}return null;};}function patchUpdates(_0x1797aa){return function(_0x56307a){try{jsonpatch[_0xde11('0x32')](_0x56307a,_0x1797aa,!![]);}catch(_0x17dcd8){return BPromise[_0xde11('0x33')](_0x17dcd8);}return _0x56307a['save']();};}function saveUpdates(_0x201948,_0x31efe4){return function(_0x4c3f27){if(_0x4c3f27){return _0x4c3f27['update'](_0x201948)[_0xde11('0x34')](function(_0x4fe19c){return _0x4fe19c;});}return null;};}function removeEntity(_0x2c1741,_0x471c3b){return function(_0x485f17){if(_0x485f17){return _0x485f17[_0xde11('0x35')]()['then'](function(){_0x2c1741['status'](0xcc)[_0xde11('0x36')]();});}};}function handleEntityNotFound(_0x49461c,_0x41795d){return function(_0x5cd767){if(!_0x5cd767){_0x49461c['sendStatus'](0x194);}return _0x5cd767;};}function handleError(_0x7cb51c,_0x3b09f3){_0x3b09f3=_0x3b09f3||0x1f4;return function(_0x3c5743){logger[_0xde11('0x25')](_0x3c5743[_0xde11('0x37')]);if(_0x3c5743['name']){delete _0x3c5743[_0xde11('0x38')];}_0x7cb51c['status'](_0x3b09f3)[_0xde11('0x39')](_0x3c5743);};}exports[_0xde11('0x3a')]=function(_0xbbf08b,_0x34c49d){var _0x2e5d4a={},_0x2d8e94={},_0x42e728={'count':0x0,'rows':[]};var _0x596875=_[_0xde11('0x3b')](db['SmsMessage'][_0xde11('0x3c')],function(_0x267202){return{'name':_0x267202[_0xde11('0x3d')],'type':_0x267202[_0xde11('0x3e')][_0xde11('0x3f')]};});_0x2d8e94['model']=_['map'](_0x596875,'name');_0x2d8e94[_0xde11('0x40')]=_[_0xde11('0x41')](_0xbbf08b[_0xde11('0x40')]);_0x2d8e94[_0xde11('0x42')]=_[_0xde11('0x43')](_0x2d8e94[_0xde11('0x44')],_0x2d8e94[_0xde11('0x40')]);_0x2e5d4a[_0xde11('0x45')]=_['intersection'](_0x2d8e94[_0xde11('0x44')],qs[_0xde11('0x46')](_0xbbf08b[_0xde11('0x40')][_0xde11('0x46')]));_0x2e5d4a[_0xde11('0x45')]=_0x2e5d4a['attributes'][_0xde11('0x47')]?_0x2e5d4a[_0xde11('0x45')]:_0x2d8e94[_0xde11('0x44')];if(!_0xbbf08b[_0xde11('0x40')][_0xde11('0x48')](_0xde11('0x49'))){_0x2e5d4a['limit']=qs[_0xde11('0x2f')](_0xbbf08b[_0xde11('0x40')]['limit']);_0x2e5d4a[_0xde11('0x2c')]=qs[_0xde11('0x2c')](_0xbbf08b[_0xde11('0x40')][_0xde11('0x2c')]);}_0x2e5d4a['order']=qs[_0xde11('0x4a')](_0xbbf08b['query'][_0xde11('0x4a')]);_0x2e5d4a[_0xde11('0x4b')]=qs['filters'](_['pick'](_0xbbf08b[_0xde11('0x40')],_0x2d8e94[_0xde11('0x42')]),_0x596875);if(_0xbbf08b['query'][_0xde11('0x4c')]){_0x2e5d4a[_0xde11('0x4b')]=_[_0xde11('0x4d')](_0x2e5d4a['where'],{'$or':_[_0xde11('0x3b')](_0x596875,function(_0x1e25b8){if(_0x1e25b8[_0xde11('0x3e')]!==_0xde11('0x4e')){var _0x22bbfa={};_0x22bbfa[_0x1e25b8[_0xde11('0x38')]]={'$like':'%'+_0xbbf08b[_0xde11('0x40')]['filter']+'%'};return _0x22bbfa;}})});}_0x2e5d4a=_[_0xde11('0x4d')]({},_0x2e5d4a,_0xbbf08b['options']);var _0x1d4b1e={'where':_0x2e5d4a['where']};return db['SmsMessage'][_0xde11('0x2e')](_0x1d4b1e)[_0xde11('0x34')](function(_0x30f7bc){_0x42e728[_0xde11('0x2e')]=_0x30f7bc;if(_0xbbf08b[_0xde11('0x40')][_0xde11('0x4f')]){_0x2e5d4a[_0xde11('0x50')]=[{'all':!![]}];}return db['SmsMessage'][_0xde11('0x51')](_0x2e5d4a);})[_0xde11('0x34')](function(_0x2fcbd5){_0x42e728[_0xde11('0x52')]=_0x2fcbd5;return _0x42e728;})[_0xde11('0x34')](respondWithFilteredResult(_0x34c49d,_0x2e5d4a))[_0xde11('0x53')](handleError(_0x34c49d,null));};exports['show']=function(_0x1cb76d,_0xf43ee2){var _0x3d53dc={'raw':!![],'where':{'id':_0x1cb76d[_0xde11('0x54')]['id']}},_0x19b631={};_0x19b631[_0xde11('0x44')]=_[_0xde11('0x41')](db[_0xde11('0x55')]['rawAttributes']);_0x19b631[_0xde11('0x40')]=_[_0xde11('0x41')](_0x1cb76d[_0xde11('0x40')]);_0x19b631[_0xde11('0x42')]=_[_0xde11('0x43')](_0x19b631[_0xde11('0x44')],_0x19b631[_0xde11('0x40')]);_0x3d53dc[_0xde11('0x45')]=_[_0xde11('0x43')](_0x19b631[_0xde11('0x44')],qs[_0xde11('0x46')](_0x1cb76d[_0xde11('0x40')]['fields']));_0x3d53dc['attributes']=_0x3d53dc['attributes']['length']?_0x3d53dc['attributes']:_0x19b631[_0xde11('0x44')];if(_0x1cb76d[_0xde11('0x40')][_0xde11('0x4f')]){_0x3d53dc[_0xde11('0x50')]=[{'all':!![]}];}_0x3d53dc=_[_0xde11('0x4d')]({},_0x3d53dc,_0x1cb76d[_0xde11('0x56')]);return db[_0xde11('0x55')][_0xde11('0x57')](_0x3d53dc)[_0xde11('0x34')](handleEntityNotFound(_0xf43ee2,null))['then'](respondWithResult(_0xf43ee2,null))[_0xde11('0x53')](handleError(_0xf43ee2,null));};exports[_0xde11('0x58')]=function(_0x512c47,_0x22327b){return db['SmsMessage'][_0xde11('0x58')](_0x512c47['body'],{})['then'](respondWithResult(_0x22327b,0xc9))[_0xde11('0x53')](handleError(_0x22327b,null));};exports[_0xde11('0x59')]=function(_0x5e7be4,_0x2a0d90){if(_0x5e7be4[_0xde11('0x5a')]['id']){delete _0x5e7be4['body']['id'];}return db['SmsMessage'][_0xde11('0x57')]({'where':{'id':_0x5e7be4[_0xde11('0x54')]['id']}})[_0xde11('0x34')](handleEntityNotFound(_0x2a0d90,null))[_0xde11('0x34')](saveUpdates(_0x5e7be4[_0xde11('0x5a')],null))[_0xde11('0x34')](respondWithResult(_0x2a0d90,null))[_0xde11('0x53')](handleError(_0x2a0d90,null));};exports[_0xde11('0x35')]=function(_0x58b360,_0x326dbe){return db[_0xde11('0x55')]['find']({'where':{'id':_0x58b360[_0xde11('0x54')]['id']}})[_0xde11('0x34')](handleEntityNotFound(_0x326dbe,null))[_0xde11('0x34')](removeEntity(_0x326dbe,null))[_0xde11('0x53')](handleError(_0x326dbe,null));};exports[_0xde11('0x5b')]=function(_0x1eb1de,_0x397a29){return db[_0xde11('0x55')][_0xde11('0x5b')]()[_0xde11('0x34')](respondWithResult(_0x397a29,null))[_0xde11('0x53')](handleError(_0x397a29,null));};var interaction_log=require(_0xde11('0x14'))(_0xde11('0x5c'));exports[_0xde11('0x5d')]=function(_0x51d9cc,_0x87e1d9,_0x147df9){var _0xac0a6d={'agent':{},'channel':_0xde11('0x5e')};if(_0x51d9cc['body']['id']){delete _0x51d9cc['body']['id'];}_0x51d9cc[_0xde11('0x5a')][_0xde11('0x5f')]=!![];_0x51d9cc[_0xde11('0x5a')][_0xde11('0x60')]=moment()[_0xde11('0x61')](_0xde11('0x62'));_0x51d9cc[_0xde11('0x5a')][_0xde11('0x63')]=_0x51d9cc[_0xde11('0x5a')][_0xde11('0x63')]||_0x51d9cc[_0xde11('0x64')]['id'];_0xac0a6d['agent']['id']=_0x51d9cc[_0xde11('0x5a')][_0xde11('0x63')];return db[_0xde11('0x55')][_0xde11('0x57')]({'where':{'id':_0x51d9cc[_0xde11('0x54')]['id'],'UserId':null}})[_0xde11('0x34')](handleEntityNotFound(_0x87e1d9,null))[_0xde11('0x34')](saveUpdates(_0x51d9cc[_0xde11('0x5a')],null))[_0xde11('0x34')](function(_0x2ab735){if(_0x2ab735){_0xac0a6d[_0xde11('0x27')]=_0x2ab735[_0xde11('0x65')]({'plain':!![]});return db[_0xde11('0x66')][_0xde11('0x57')]({'where':{'id':_0x2ab735[_0xde11('0x67')]}});}return null;})[_0xde11('0x34')](handleEntityNotFound(_0x87e1d9,null))['then'](function(_0x1dddd0){if(_0x1dddd0){return _0x1dddd0[_0xde11('0x59')]({'UserId':_0x51d9cc[_0xde11('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x1dddd0[_0xde11('0x68')])?moment()[_0xde11('0x61')](_0xde11('0x62')):undefined});}return null;})[_0xde11('0x34')](function(_0x2b201a){if(_0x2b201a){_0xac0a6d[_0xde11('0x69')]=_0x2b201a[_0xde11('0x65')]({'plain':!![]});interaction_log[_0xde11('0x20')](_0xde11('0x6a'),_0x51d9cc[_0xde11('0x64')]['id'],_0x51d9cc[_0xde11('0x64')][_0xde11('0x38')],_0x51d9cc[_0xde11('0x64')][_0xde11('0x6b')],_0xac0a6d[_0xde11('0x69')]['id'],_0x51d9cc['body']?JSON[_0xde11('0x6c')](_0x51d9cc[_0xde11('0x5a')]):_0xde11('0x6d'));return respondWithRpcPromise(_0xde11('0x6e'),_0xde11('0x6f'),_0xac0a6d);}return null;})[_0xde11('0x34')](function(_0x381e2f){var _0x874688=_0xde11('0x70')+_0x381e2f[_0xde11('0x27')][_0xde11('0x71')];return db[_0xde11('0x72')]['query'](_0x874688,{'type':db[_0xde11('0x73')]['QueryTypes'][_0xde11('0x74')],'raw':!![]})['then'](function(_0x2ee3de){return _0x2ee3de;});})['then'](function(_0x46f2f9){if(_0x46f2f9){_0xac0a6d[_0xde11('0x27')][_0xde11('0x75')]=_0x46f2f9[0x0];if(!_0x51d9cc['body'][_0xde11('0x63')])return;return db[_0xde11('0x76')][_0xde11('0x57')]({'where':{'id':_0x51d9cc[_0xde11('0x5a')][_0xde11('0x63')],'role':_0xde11('0x77')},'attributes':['id',_0xde11('0x38'),_0xde11('0x78'),'email',_0xde11('0x79')],'raw':!![]});}return null;})[_0xde11('0x34')](function(_0x34627e){if(!_0x34627e)return null;_0xac0a6d[_0xde11('0x27')][_0xde11('0x77')]=_0x34627e;return _0xac0a6d;})[_0xde11('0x34')](function(_0x169e54){if(_0x169e54){if(_0x51d9cc[_0xde11('0x5a')]['manual']){_0xac0a6d[_0xde11('0x27')]['interface']=util[_0xde11('0x61')](_0xde11('0x7a'),_0x51d9cc[_0xde11('0x64')][_0xde11('0x38')]);_0xac0a6d['message']['channel']=_0xac0a6d[_0xde11('0x7b')];_0xac0a6d[_0xde11('0x27')]['motionChannel']=_0xac0a6d[_0xde11('0x7b')];_0xac0a6d[_0xde11('0x27')][_0xde11('0x7c')]=_0xde11('0x5d');return respondWithRpcPromise(_0xde11('0x7d'),'EventManager',{'event':_0xde11('0x7e'),'message':_0xac0a6d[_0xde11('0x27')]},client9002)['then'](function(){return _0xac0a6d;});}return _0xac0a6d;}return null;})['then'](respondWithResult(_0x87e1d9,null))['catch'](handleError(_0x87e1d9,null));};var interaction_log=require(_0xde11('0x14'))(_0xde11('0x5c'));exports[_0xde11('0x33')]=function(_0x55c9a8,_0xf61785,_0x4ecc19){var _0x217918={'agent':{},'channel':_0xde11('0x5e')};if(_0x55c9a8[_0xde11('0x5a')]['id']){delete _0x55c9a8[_0xde11('0x5a')]['id'];}_0x55c9a8[_0xde11('0x5a')][_0xde11('0x63')]=_0x55c9a8['body'][_0xde11('0x63')]||_0x55c9a8[_0xde11('0x64')]['id'];_0x217918[_0xde11('0x77')]['id']=_0x55c9a8[_0xde11('0x5a')][_0xde11('0x63')];return db[_0xde11('0x55')]['find']({'where':{'id':_0x55c9a8['params']['id'],'UserId':null}})[_0xde11('0x34')](handleEntityNotFound(_0xf61785,null))[_0xde11('0x34')](function(_0x16145c){if(_0x16145c){_0x217918[_0xde11('0x27')]=_0x16145c[_0xde11('0x65')]({'plain':!![]});return db[_0xde11('0x66')]['find']({'where':{'id':_0x16145c['SmsInteractionId']}});}return null;})[_0xde11('0x34')](handleEntityNotFound(_0xf61785,null))[_0xde11('0x34')](function(_0x17be12){if(_0x17be12){_0x217918[_0xde11('0x69')]=_0x17be12[_0xde11('0x65')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55c9a8[_0xde11('0x64')]['id'],_0x55c9a8[_0xde11('0x64')][_0xde11('0x38')],_0x55c9a8[_0xde11('0x64')][_0xde11('0x6b')],_0x217918[_0xde11('0x69')]['id'],_0x55c9a8['body']?JSON[_0xde11('0x6c')](_0x55c9a8[_0xde11('0x5a')]):_0xde11('0x6d'));return respondWithRpcPromise(_0xde11('0x7f'),_0xde11('0x80'),_0x217918);}return null;})[_0xde11('0x34')](function(_0x3cd889){var _0x5bea6b=_0xde11('0x70')+_0x3cd889[_0xde11('0x27')][_0xde11('0x71')];return db[_0xde11('0x72')][_0xde11('0x40')](_0x5bea6b,{'type':db[_0xde11('0x73')][_0xde11('0x81')][_0xde11('0x74')],'raw':!![]})[_0xde11('0x34')](function(_0x1bae20){return _0x1bae20;});})['then'](function(_0x351ec0){if(_0x351ec0){_0x217918[_0xde11('0x27')]['contact']=_0x351ec0[0x0];if(!_0x55c9a8[_0xde11('0x5a')][_0xde11('0x63')])return;return db[_0xde11('0x76')][_0xde11('0x57')]({'where':{'id':_0x55c9a8[_0xde11('0x5a')][_0xde11('0x63')],'role':_0xde11('0x77')},'attributes':['id',_0xde11('0x38'),_0xde11('0x78'),'email',_0xde11('0x79')],'raw':!![]});}return null;})[_0xde11('0x34')](function(_0x335551){if(!_0x335551)return null;_0x217918[_0xde11('0x27')][_0xde11('0x77')]=_0x335551;return _0x217918;})['then'](function(_0x5ce538){if(_0x5ce538){_0x5ce538[_0xde11('0x27')][_0xde11('0x82')]=util[_0xde11('0x61')](_0xde11('0x7a'),_0x55c9a8[_0xde11('0x64')]['name']);_0x5ce538['message'][_0xde11('0x7b')]=_0x217918['channel'];_0x5ce538[_0xde11('0x27')][_0xde11('0x83')]=_0x217918['channel'];_0x5ce538[_0xde11('0x27')]['event']=_0xde11('0x33');respondWithRpcPromise(_0xde11('0x7d'),_0xde11('0x7d'),{'event':_0xde11('0x84'),'message':_0x5ce538[_0xde11('0x27')]},client9002);return _0x217918;}return null;})[_0xde11('0x34')](respondWithResult(_0xf61785,null))[_0xde11('0x53')](handleError(_0xf61785,null));};exports['status']=function(_0x372816,_0x222f12,_0x33265f){if(_0x372816[_0xde11('0x5a')]['id']){delete _0x372816[_0xde11('0x5a')]['id'];}var _0x1173cb;return db[_0xde11('0x55')][_0xde11('0x57')]({'where':{'id':_0x372816['params']['id']}})['then'](handleEntityNotFound(_0x222f12,null))[_0xde11('0x34')](function(_0x3ac4d1){if(_0x3ac4d1){_0x1173cb=_0x3ac4d1;return db[_0xde11('0x85')][_0xde11('0x57')]({'where':{'id':_0x3ac4d1[_0xde11('0x86')]}});}})[_0xde11('0x34')](handleEntityNotFound(_0x222f12,null))[_0xde11('0x34')](function(_0x5e9b1d){if(_0x5e9b1d){logger[_0xde11('0x23')](_0xde11('0x24'),_0xde11('0x2a'),_0xde11('0x87'),_0x5e9b1d['type'],util['inspect'](_0x372816[_0xde11('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5e9b1d['type']){case _0xde11('0x88'):if(_0x372816[_0xde11('0x5a')][_0xde11('0x89')]&&_0x372816[_0xde11('0x5a')][_0xde11('0x89')]===_0x1173cb[_0xde11('0x8a')]){return _0x1173cb[_0xde11('0x59')]({'read':!![]});}else{logger[_0xde11('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xde11('0x2a'),'twilio',util['inspect'](_0x372816[_0xde11('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xde11('0x8b'):if(_0x372816['body']['MessageUUID']&&_0x372816['body'][_0xde11('0x8c')]===_0x1173cb['messageId']&&_[_0xde11('0x8d')]([_0xde11('0x8e'),_0xde11('0x8f')],_0x372816[_0xde11('0x5a')][_0xde11('0x90')])>=0x0){return _0x1173cb[_0xde11('0x59')]({'read':!![]});}else{logger[_0xde11('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xde11('0x2a'),_0xde11('0x91'),util[_0xde11('0x92')](_0x372816[_0xde11('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xde11('0x93'):var _0x4d2ba3=_0x372816[_0xde11('0x5a')][_0xde11('0x94')][0x0];if(_0x4d2ba3[_0xde11('0x2a')][_0xde11('0x95')]==='DELIVERED'){return _0x1173cb[_0xde11('0x59')]({'read':!![]});}else{logger[_0xde11('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xde11('0x93'),util['inspect'](_0x372816[_0xde11('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x1173cb;}})['then'](respondWithResult(_0x222f12,null))['catch'](handleError(_0x222f12,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2fa7e7c..349876b 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 _0x8bec=['hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x2c9636,_0x25e85a){var _0x4dd4a3=function(_0x4ea988){while(--_0x4ea988){_0x2c9636['push'](_0x2c9636['shift']());}};_0x4dd4a3(++_0x25e85a);}(_0x8bec,0xeb));var _0xc8be=function(_0xb643c2,_0x24f626){_0xb643c2=_0xb643c2-0x0;var _0xbb337c=_0x8bec[_0xb643c2];return _0xbb337c;};'use strict';var EventEmitter=require(_0xc8be('0x0'));var SmsMessage=require(_0xc8be('0x1'))['db'][_0xc8be('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc8be('0x3')](0x0);var events={'afterCreate':_0xc8be('0x4'),'afterUpdate':_0xc8be('0x5'),'afterDestroy':_0xc8be('0x6')};function emitEvent(_0x3574fb){return function(_0xa612b3,_0xb3c4e1,_0x365ce1){SmsMessageEvents[_0xc8be('0x7')](_0x3574fb+':'+_0xa612b3['id'],_0xa612b3);SmsMessageEvents[_0xc8be('0x7')](_0x3574fb,_0xa612b3);_0x365ce1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xc8be('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x19e9=['../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x16fdeb,_0x252b59){var _0x41dd64=function(_0x3607ff){while(--_0x3607ff){_0x16fdeb['push'](_0x16fdeb['shift']());}};_0x41dd64(++_0x252b59);}(_0x19e9,0xb3));var _0x919e=function(_0x52531f,_0x46500e){_0x52531f=_0x52531f-0x0;var _0x162cb9=_0x19e9[_0x52531f];return _0x162cb9;};'use strict';var EventEmitter=require(_0x919e('0x0'));var SmsMessage=require(_0x919e('0x1'))['db'][_0x919e('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x919e('0x3')](0x0);var events={'afterCreate':_0x919e('0x4'),'afterUpdate':_0x919e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x269b1a){return function(_0x2464a5,_0x1efdb2,_0x42f3ec){SmsMessageEvents[_0x919e('0x6')](_0x269b1a+':'+_0x2464a5['id'],_0x2464a5);SmsMessageEvents[_0x919e('0x6')](_0x269b1a,_0x2464a5);_0x42f3ec(null);};}for(var e in events){if(events[_0x919e('0x7')](e)){var event=events[e];SmsMessage[_0x919e('0x8')](e,emitEvent(event));}}module[_0x919e('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index d6ae496..8a7c0d4 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 _0x9990=['./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','direction','catch','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','GET','split','sms','user_key','session_key','total_sent','deliveryReport','read','afterCreate','connectel','senderString','POST','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','queued_count','head','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','text','timestamp','sort','length','apiKey','createHash','hex','signature=','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','accountId','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xb1703f,_0x5e5540){var _0x4abbd3=function(_0x1fad2b){while(--_0x1fad2b){_0xb1703f['push'](_0xb1703f['shift']());}};_0x4abbd3(++_0x5e5540);}(_0x9990,0xf6));var _0x0999=function(_0x35c718,_0x33a696){_0x35c718=_0x35c718-0x0;var _0x5c3099=_0x9990[_0x35c718];return _0x5c3099;};'use strict';var _=require('lodash');var util=require(_0x0999('0x0'));var logger=require(_0x0999('0x1'))(_0x0999('0x2'));var moment=require(_0x0999('0x3'));var BPromise=require(_0x0999('0x4'));var rp=require(_0x0999('0x5'));var fs=require('fs');var path=require(_0x0999('0x6'));var rimraf=require(_0x0999('0x7'));var config=require('../../config/environment');var attributes=require(_0x0999('0x8'));module[_0x0999('0x9')]=function(_0x45d3e0,_0x4c606f){return _0x45d3e0[_0x0999('0xa')](_0x0999('0xb'),attributes,{'tableName':_0x0999('0xc'),'paranoid':![],'indexes':[{'name':_0x0999('0xd'),'fields':[_0x0999('0xd')]},{'name':_0x0999('0xe'),'fields':[_0x0999('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf6a77f,_0x3073d3,_0x161b44){var _0x5f1333=_0x45d3e0[_0x0999('0x10')];var _0x471d9c=_0xf6a77f[_0x0999('0x11')]({'plain':!![]});if(_0x471d9c['direction'][_0x0999('0x12')]()==='in'||_0x471d9c['direction'][_0x0999('0x12')]()===_0x0999('0x13')&&!_0x471d9c[_0x0999('0x14')]&&!_[_0x0999('0x15')](_0x471d9c[_0x0999('0x16')])){_0x5f1333['SmsInteraction'][_0x0999('0x17')]({'where':{'id':_0x471d9c[_0x0999('0x18')]}})[_0x0999('0x19')](function(_0x4011bf){if(_0x4011bf){_0x4011bf[_0x0999('0x1a')]({'lastMsgAt':_0x471d9c['createdAt'],'lastMsgDirection':_0x471d9c[_0x0999('0x1b')][_0x0999('0x12')]()});}})[_0x0999('0x1c')](function(_0x4e4e53){console[_0x0999('0x1d')](_0x4e4e53);});}if(_0x471d9c[_0x0999('0x1b')]===_0x0999('0x13')&&!_0x471d9c['secret']){var _0xa82828;_0x5f1333[_0x0999('0x1e')]['find']({'where':{'id':_0x471d9c[_0x0999('0x1f')]},'raw':!![]})[_0x0999('0x19')](function(_0x56373e){_0xa82828=_0x56373e;if(_0xa82828&&_0xa82828[_0x0999('0x20')]){switch(_0xa82828[_0x0999('0x20')]){case _0x0999('0x21'):var _0x470c84=require(_0x0999('0x21'));if(_0xa82828[_0x0999('0x22')]&&_0xa82828[_0x0999('0x23')]&&_0xa82828[_0x0999('0x24')]){var _0x8a5ef6=new _0x470c84(_0xa82828['accountSid'],_0xa82828[_0x0999('0x23')]);_0x8a5ef6[_0x0999('0x25')]['create']({'body':_0x471d9c['body'],'to':_0x471d9c[_0x0999('0x24')],'from':_0xa82828[_0x0999('0x24')],'statusCallback':_0xa82828[_0x0999('0x26')]+_0x0999('0x27')+_0x471d9c['id']+_0x0999('0x28')+_0xa82828[_0x0999('0x29')]})['then'](function(_0x20ba88){if(_0x20ba88['sid']){return _0xf6a77f[_0x0999('0x1a')]({'messageId':_0x20ba88['sid']});}})[_0x0999('0x1c')](function(_0x106669){logger[_0x0999('0x1d')](_0x0999('0x2a'),'afterCreate','twilio',util[_0x0999('0x2b')](_0x106669,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0999('0x2a'),'afterCreate',_0x0999('0x21'),_0x0999('0x2c'));}break;case _0x0999('0x2d'):var _0xf63dc7=_0x0999('0x2e');if(_0xa82828[_0x0999('0x2f')]&&_0xa82828[_0x0999('0x30')]){var _0x5c9fb4={'recipient':[_0x471d9c[_0x0999('0x24')]],'message':_0x471d9c[_0x0999('0xf')],'message_type':_0xa82828[_0x0999('0x31')]};if(_0xa82828[_0x0999('0x31')]&&_0xa82828[_0x0999('0x31')]!=='SI'){_0x5c9fb4['sender']=_0xa82828[_0x0999('0x24')];}var _0x505994={'url':_0xf63dc7+_0x0999('0x32')+_0xa82828['username']+'&password='+_0xa82828[_0x0999('0x30')],'method':_0x0999('0x33')};rp(_0x505994)['then'](function(_0xdf8b8b){var _0x153f0c=_0xdf8b8b[_0x0999('0x34')](';');var _0x4ede8e={'user_key':_0x153f0c[0x0],'session_key':_0x153f0c[0x1]};_0x505994={'url':_0xf63dc7+_0x0999('0x35'),'method':'POST','headers':{'user_key':_0x4ede8e[_0x0999('0x36')],'Session_key':_0x4ede8e[_0x0999('0x37')]},'json':!![],'body':_0x5c9fb4};return rp(_0x505994);})[_0x0999('0x19')](function(_0x45b1ee){if(_0x45b1ee[_0x0999('0x38')]>=0x1){var _0x53f08d={'messageId':_0x45b1ee['internal_order_id']};if(_0xa82828[_0x0999('0x31')]!=='GP'||!_0xa82828[_0x0999('0x39')]){_0x53f08d[_0x0999('0x3a')]=!![];}return _0xf6a77f[_0x0999('0x1a')](_0x53f08d);}else{return logger['error'](_0x0999('0x2a'),_0x0999('0x3b'),'skebby',util[_0x0999('0x2b')](_0x45b1ee,{'showHidden':![],'depth':null}));}})[_0x0999('0x1c')](function(_0x4611f9){return logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),'skebby',util[_0x0999('0x2b')](_0x4611f9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x0999('0x3c'):if(_0xa82828[_0x0999('0x23')]){var _0x4e3bd3={'recipient':_0x471d9c[_0x0999('0x24')],'message':_0x471d9c[_0x0999('0xf')],'sender':_0xa82828[_0x0999('0x3d')]||_0xa82828[_0x0999('0x24')],'authorization':_0xa82828[_0x0999('0x23')]};var _0x3073d3={'method':_0x0999('0x3e'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x4e3bd3,'json':!![]};rp(_0x3073d3)[_0x0999('0x19')](function(_0x22da38){var _0x557358={'messageId':_0x22da38[_0x0999('0x3f')]};if(!_0xa82828[_0x0999('0x39')]){_0x557358[_0x0999('0x3a')]=!![];}return _0xf6a77f[_0x0999('0x1a')](_0x557358);})[_0x0999('0x1c')](function(_0x47ab00){logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),'connectel',util[_0x0999('0x2b')](_0x47ab00,{'showHidden':![],'depth':null}));});}else{logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x3c'),_0x0999('0x40'));}break;case _0x0999('0x41'):if(_0xa82828[_0x0999('0x2f')]&&_0xa82828[_0x0999('0x30')]){var _0x4e3bd3={'messages':[{'source':_0x0999('0x42'),'to':_0x471d9c[_0x0999('0x24')],'body':_0x471d9c['body'],'from':_0xa82828[_0x0999('0x3d')]||_0xa82828[_0x0999('0x24')]}]};var _0x4d3d7b=util['format'](_0x0999('0x43'),_0xa82828['username'],_0xa82828['password']);var _0x3073d3={'method':_0x0999('0x3e'),'uri':_0x0999('0x44'),'body':_0x4e3bd3,'headers':{'Authorization':util[_0x0999('0x45')](_0x0999('0x46'),new Buffer(_0x4d3d7b)[_0x0999('0x47')](_0x0999('0x48')))},'json':!![]};rp(_0x3073d3)[_0x0999('0x19')](function(_0x336c19){if(_0x336c19[_0x0999('0x49')]>=0xc8&&_0x336c19[_0x0999('0x49')]<=0xce){if(_0x336c19['data']&&_0x336c19['data'][_0x0999('0x4a')]>0x0){var _0x185fbe=_[_0x0999('0x4b')](_0x336c19[_0x0999('0x4c')][_0x0999('0x25')]);var _0xd6a019={'messageId':_0x185fbe[_0x0999('0x4d')]};if(!_0xa82828[_0x0999('0x39')]){_0xd6a019['read']=!![];}return _0xf6a77f['update'](_0xd6a019);}else{logger[_0x0999('0x1d')](_0x0999('0x2a'),'afterCreate',_0x0999('0x4e'),util['inspect'](_0x336c19,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x4e'),util[_0x0999('0x2b')](_0x336c19,{'showHidden':![],'depth':null}));}})[_0x0999('0x1c')](function(_0x6ae41b){logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),'clickSend',util[_0x0999('0x2b')](_0x6ae41b,{'showHidden':![],'depth':null}));});}else{logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x4e'),_0x0999('0x4f'));}break;case _0x0999('0x50'):if(_0xa82828[_0x0999('0x51')]&&_0xa82828[_0x0999('0x23')]){var _0x4e3bd3={'dst':_0x471d9c[_0x0999('0x24')],'text':_0x471d9c['body'],'src':_0xa82828[_0x0999('0x3d')]||_0xa82828[_0x0999('0x24')],'url':_0xa82828[_0x0999('0x26')]+_0x0999('0x27')+_0x471d9c['id']+_0x0999('0x28')+_0xa82828['token']};var _0x4d3d7b=util[_0x0999('0x45')](_0x0999('0x43'),_0xa82828[_0x0999('0x51')],_0xa82828[_0x0999('0x23')]);var _0x3073d3={'method':'POST','uri':util[_0x0999('0x45')](_0x0999('0x52'),_0xa82828[_0x0999('0x51')]),'body':_0x4e3bd3,'headers':{'Authorization':util[_0x0999('0x45')](_0x0999('0x46'),new Buffer(_0x4d3d7b)[_0x0999('0x47')](_0x0999('0x48')))},'json':!![]};rp(_0x3073d3)['then'](function(_0x10829d){var _0x1df925={'messageId':_0x10829d[_0x0999('0x53')][0x0]};return _0xf6a77f[_0x0999('0x1a')](_0x1df925);})['catch'](function(_0x2a1769){logger[_0x0999('0x1d')](_0x0999('0x2a'),'afterCreate',_0x0999('0x50'),util[_0x0999('0x2b')](_0x2a1769,{'showHidden':![],'depth':null}));});}else{logger[_0x0999('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0999('0x3b'),_0x0999('0x50'),_0x0999('0x54'));}break;case _0x0999('0x55'):if(_0xa82828[_0x0999('0x2f')]&&_0xa82828[_0x0999('0x30')]){if(_0xa82828[_0x0999('0x56')]){var _0x1607f1={'method':_0x0999('0x3e'),'uri':_0xa82828['baseUrl']+_0x0999('0x57'),'body':{'username':_0xa82828[_0x0999('0x2f')],'password':_0xa82828[_0x0999('0x30')]},'json':!![]};return rp(_0x1607f1)[_0x0999('0x19')](function(_0x239ee5){var _0x4d86d4={'method':'POST','uri':_0xa82828[_0x0999('0x56')]+_0x0999('0x58'),'body':{'messages':[{'from':_0xa82828['phone'],'destinations':[{'to':_0x471d9c['phone']}],'text':_0x471d9c['body'],'notifyUrl':_0xa82828[_0x0999('0x26')]+_0x0999('0x27')+_0x471d9c['id']+_0x0999('0x28')+_0xa82828[_0x0999('0x29')],'notifyContentType':_0x0999('0x59'),'callbackData':_0xa82828[_0x0999('0x24')]+';'+_0x471d9c[_0x0999('0xf')]}]},'headers':{'Authorization':_0x0999('0x5a')+_0x239ee5[_0x0999('0x29')]},'json':!![]};return rp(_0x4d86d4)['then'](function(_0x12e759){if(_0x12e759['messages']){var _0x2a3f46={'messageId':_0x12e759[_0x0999('0x25')][0x0][_0x0999('0xd')]};if(!_0xa82828[_0x0999('0x39')]){_0x2a3f46[_0x0999('0x3a')]=!![];}return _0xf6a77f['update'](_0x2a3f46);}else{return logger['error'](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x55'),util[_0x0999('0x2b')](_0x12e759,{'showHidden':![],'depth':null}));}});})[_0x0999('0x1c')](function(_0x495047){return logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x55'),util[_0x0999('0x2b')](_0x495047,{'showHidden':![],'depth':null}));});}else{logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x55'),_0x0999('0x5b'));}}else{logger['error'](_0x0999('0x2a'),_0x0999('0x3b'),'infobip',_0x0999('0x4f'));}break;case _0x0999('0x5c'):var _0x2b85a5=require(_0x0999('0x5d'));if(_0xa82828['apiKey']){var _0x30f751={};_0x30f751[_0x0999('0x5e')]=_0xa82828[_0x0999('0x2f')];_0x30f751['phone']=_0x471d9c['phone'];_0x30f751[_0x0999('0x5f')]=_0xa82828[_0x0999('0x24')];_0x30f751[_0x0999('0x60')]=_0x471d9c['body'];_0x30f751[_0x0999('0x61')]=+new Date();var _0xbe138f='';var _0x353a8f='';var _0x49a856=Object['keys'](_0x30f751);_0x49a856[_0x0999('0x62')]();for(var _0x9f943=0x0;_0x9f943<_0x49a856[_0x0999('0x63')];_0x9f943++){if(_0xbe138f!=''){_0xbe138f+='&';}_0xbe138f+=_0x49a856[_0x9f943]+'='+encodeURIComponent(_0x30f751[_0x49a856[_0x9f943]]);_0x353a8f+=_0x30f751[_0x49a856[_0x9f943]];}_0x353a8f+=_0xa82828[_0x0999('0x64')];_0x353a8f=_0x2b85a5[_0x0999('0x65')]('md5')['update'](_0x353a8f)['digest'](_0x0999('0x66'));if(_0xbe138f!==''){_0xbe138f+='&';}_0xbe138f+=_0x0999('0x67')+_0x353a8f;var _0x505994={'method':'GET','uri':_0xa82828[_0x0999('0x56')]+_0x0999('0x68')+_0xbe138f,'json':!![]};return rp(_0x505994)[_0x0999('0x19')](function(_0x4e57e2){var _0x310508=Object[_0x0999('0x69')](_0x4e57e2);if(_0x4e57e2[_0x310508[0x0]][_0x0999('0x1d')]&&parseInt(_0x4e57e2[_0x310508[0x0]]['error'])===0x0){var _0x50753e={'messageId':_0x4e57e2[_0x310508[0x0]][_0x0999('0x6a')]};if(!_0xa82828['deliveryReport']){_0x50753e[_0x0999('0x3a')]=!![];}return _0xf6a77f['update'](_0x50753e);}else{return logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),'csc',util[_0x0999('0x2b')](_0x4e57e2['error'],{'showHidden':![],'depth':null}));}})[_0x0999('0x1c')](function(_0x3a2e00){return logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x5c'),util[_0x0999('0x2b')](_0x3a2e00,{'showHidden':![],'depth':null}));});}else{logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x5c'),_0x0999('0x6b'));}break;case'clickatell':if(_0xa82828[_0x0999('0x64')]){var _0x27fca9={'method':'POST','uri':_0x0999('0x6c'),'headers':{'Authorization':_0xa82828[_0x0999('0x64')]},'body':{'content':_0x471d9c[_0x0999('0xf')],'to':[_0x471d9c[_0x0999('0x24')]],'from':_0xa82828[_0x0999('0x24')],'binary':![],'clientMessageId':_0x0999('0x6d'),'charset':_0x0999('0x6e')},'json':!![]};rp(_0x27fca9)[_0x0999('0x19')](function(_0x344675){if(!_0x344675['error']){var _0x3e866d={'messageId':_0x344675['messages'][0x0][_0x0999('0x6f')]};if(!_0xa82828[_0x0999('0x39')]){_0x3e866d[_0x0999('0x3a')]=!![];}return _0xf6a77f[_0x0999('0x1a')](_0x3e866d);}else{return logger[_0x0999('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0999('0x3b'),'clickatell',util[_0x0999('0x2b')](_0x344675[_0x0999('0x1d')],{'showHidden':![],'depth':null}));}})[_0x0999('0x1c')](function(_0x46fabd){return logger[_0x0999('0x1d')](_0x0999('0x2a'),'afterCreate','clickatell',util[_0x0999('0x2b')](_0x46fabd,{'showHidden':![],'depth':null}));});}else{logger[_0x0999('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0999('0x3b'),_0x0999('0x70'),_0x0999('0x6b'));}break;case'bandwidth':if(_0xa82828[_0x0999('0x2f')]&&_0xa82828[_0x0999('0x30')]){var _0x4d3d7b=util[_0x0999('0x45')](_0x0999('0x43'),_0xa82828['username'],_0xa82828[_0x0999('0x30')]);var _0x3073d3={'method':_0x0999('0x3e'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0xa82828[_0x0999('0x71')]+'/messages','body':{'to':[_0x471d9c['phone']],'text':_0x471d9c[_0x0999('0xf')],'from':_0xa82828['phone'],'applicationId':_0xa82828[_0x0999('0x72')]},'headers':{'Authorization':util[_0x0999('0x45')](_0x0999('0x46'),new Buffer(_0x4d3d7b)[_0x0999('0x47')](_0x0999('0x48')))},'json':!![]};rp(_0x3073d3)[_0x0999('0x19')](function(_0x776b81){if(_0x776b81['id']){var _0x5d4de3={'messageId':_0x776b81['id']};return _0xf6a77f[_0x0999('0x1a')](_0x5d4de3);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0999('0x3b'),_0x0999('0x73'),util[_0x0999('0x2b')](_0x776b81,{'showHidden':![],'depth':null}));}})['catch'](function(_0x57ba52){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0999('0x3b'),_0x0999('0x73'),util[_0x0999('0x2b')](_0x57ba52,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x73'),_0x0999('0x4f'));}break;case _0x0999('0x74'):if(_0xa82828['apiKey']){var _0x1645b2={};var _0x505994={'method':_0x0999('0x3e'),'uri':_0x0999('0x75'),'headers':{'Authorization':_0x0999('0x76')+_0xa82828[_0x0999('0x64')],'Content-Type':_0x0999('0x59')},'body':{'from':_0xa82828[_0x0999('0x24')],'to':_0x471d9c[_0x0999('0x24')],'text':_0x471d9c[_0x0999('0xf')]},'json':!![]};return rp(_0x505994)[_0x0999('0x19')](function(_0x1daa8f){if(_0x1daa8f['code']==0xca){_0x1645b2[_0x0999('0x77')]=_0x1daa8f;var _0x37e1b2={'method':_0x0999('0x3e'),'uri':_0x0999('0x78'),'headers':{'Authorization':_0x0999('0x76')+_0xa82828[_0x0999('0x64')],'Content-Type':_0x0999('0x59')},'body':{'refid':_0x1645b2[_0x0999('0x77')][_0x0999('0x79')]},'json':!![]};return rp(_0x37e1b2)[_0x0999('0x19')](function(_0x429111){_0x1645b2[_0x0999('0x7a')]=_0x429111;var _0x18327f={'messageId':_0x1645b2[_0x0999('0x77')][_0x0999('0x79')],'read':!![]};return _0xf6a77f['update'](_0x18327f);});}else{return logger[_0x0999('0x1d')](_0x0999('0x2a'),'afterCreate',_0x0999('0x74'),util[_0x0999('0x2b')](_0x1daa8f,{'showHidden':![],'depth':null}));}})[_0x0999('0x1c')](function(_0x441eb3){return logger[_0x0999('0x1d')](_0x0999('0x2a'),_0x0999('0x3b'),_0x0999('0x74'),util['inspect'](_0x441eb3,{'showHidden':![],'depth':null}));});}else{return logger[_0x0999('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0999('0x3b'),'intelepeer',_0x0999('0x7b'));}break;}}})[_0x0999('0x7c')](function(){_0x161b44();});}else{_0x161b44();}}},'charset':_0x0999('0x7d'),'collate':_0x0999('0x7e')});}; \ No newline at end of file +var _0xd382=['password','GET','split','sms','POST','user_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','head','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','hex','signature=','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','sms_messages','messageId','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','messages','create','body','remote','/api/sms/messages/','/status?token=','token','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username='];(function(_0x17e616,_0x46637b){var _0x2a62f9=function(_0x380d16){while(--_0x380d16){_0x17e616['push'](_0x17e616['shift']());}};_0x2a62f9(++_0x46637b);}(_0xd382,0x1b6));var _0x2d38=function(_0x5cf389,_0x273e52){_0x5cf389=_0x5cf389-0x0;var _0xdbf976=_0xd382[_0x5cf389];return _0xdbf976;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var logger=require(_0x2d38('0x2'))(_0x2d38('0x3'));var moment=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var rp=require(_0x2d38('0x6'));var fs=require('fs');var path=require(_0x2d38('0x7'));var rimraf=require(_0x2d38('0x8'));var config=require(_0x2d38('0x9'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x5a8219,_0x30106c){return _0x5a8219[_0x2d38('0xa')]('SmsMessage',attributes,{'tableName':_0x2d38('0xb'),'paranoid':![],'indexes':[{'name':_0x2d38('0xc'),'fields':[_0x2d38('0xc')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x2d38('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25e9a7,_0x12a9bf,_0x495903){var _0x29a847=_0x5a8219['models'];var _0x18dfd8=_0x25e9a7[_0x2d38('0xe')]({'plain':!![]});if(_0x18dfd8[_0x2d38('0xf')][_0x2d38('0x10')]()==='in'||_0x18dfd8[_0x2d38('0xf')][_0x2d38('0x10')]()===_0x2d38('0x11')&&!_0x18dfd8['secret']&&!_[_0x2d38('0x12')](_0x18dfd8[_0x2d38('0x13')])){_0x29a847[_0x2d38('0x14')][_0x2d38('0x15')]({'where':{'id':_0x18dfd8[_0x2d38('0x16')]}})['then'](function(_0x1c7c1d){if(_0x1c7c1d){_0x1c7c1d[_0x2d38('0x17')]({'lastMsgAt':_0x18dfd8[_0x2d38('0x18')],'lastMsgDirection':_0x18dfd8[_0x2d38('0xf')][_0x2d38('0x10')]()});}})[_0x2d38('0x19')](function(_0xc6de5a){console[_0x2d38('0x1a')](_0xc6de5a);});}if(_0x18dfd8[_0x2d38('0xf')]===_0x2d38('0x11')&&!_0x18dfd8[_0x2d38('0x1b')]){var _0x13b3fd;_0x29a847[_0x2d38('0x1c')][_0x2d38('0x1d')]({'where':{'id':_0x18dfd8[_0x2d38('0x1e')]},'raw':!![]})[_0x2d38('0x1f')](function(_0x56016e){_0x13b3fd=_0x56016e;if(_0x13b3fd&&_0x13b3fd[_0x2d38('0x20')]){switch(_0x13b3fd[_0x2d38('0x20')]){case'twilio':var _0x42c23e=require(_0x2d38('0x21'));if(_0x13b3fd[_0x2d38('0x22')]&&_0x13b3fd['authToken']&&_0x13b3fd[_0x2d38('0x23')]){var _0x5ed42e=new _0x42c23e(_0x13b3fd['accountSid'],_0x13b3fd[_0x2d38('0x24')]);_0x5ed42e[_0x2d38('0x25')][_0x2d38('0x26')]({'body':_0x18dfd8[_0x2d38('0x27')],'to':_0x18dfd8[_0x2d38('0x23')],'from':_0x13b3fd[_0x2d38('0x23')],'statusCallback':_0x13b3fd[_0x2d38('0x28')]+_0x2d38('0x29')+_0x18dfd8['id']+_0x2d38('0x2a')+_0x13b3fd[_0x2d38('0x2b')]})['then'](function(_0x3283b4){if(_0x3283b4['sid']){return _0x25e9a7[_0x2d38('0x17')]({'messageId':_0x3283b4['sid']});}})[_0x2d38('0x19')](function(_0xfa9bd){logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x21'),util[_0x2d38('0x2e')](_0xfa9bd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x21'),_0x2d38('0x2f'));}break;case _0x2d38('0x30'):var _0xe73710=_0x2d38('0x31');if(_0x13b3fd[_0x2d38('0x32')]&&_0x13b3fd['password']){var _0x5953e6={'recipient':[_0x18dfd8['phone']],'message':_0x18dfd8[_0x2d38('0x27')],'message_type':_0x13b3fd[_0x2d38('0x33')]};if(_0x13b3fd[_0x2d38('0x33')]&&_0x13b3fd['smsMethod']!=='SI'){_0x5953e6[_0x2d38('0x34')]=_0x13b3fd['phone'];}var _0x4451b7={'url':_0xe73710+_0x2d38('0x35')+_0x13b3fd[_0x2d38('0x32')]+'&password='+_0x13b3fd[_0x2d38('0x36')],'method':_0x2d38('0x37')};rp(_0x4451b7)[_0x2d38('0x1f')](function(_0x52a3ce){var _0x1fa9c2=_0x52a3ce[_0x2d38('0x38')](';');var _0x81fff7={'user_key':_0x1fa9c2[0x0],'session_key':_0x1fa9c2[0x1]};_0x4451b7={'url':_0xe73710+_0x2d38('0x39'),'method':_0x2d38('0x3a'),'headers':{'user_key':_0x81fff7[_0x2d38('0x3b')],'Session_key':_0x81fff7['session_key']},'json':!![],'body':_0x5953e6};return rp(_0x4451b7);})[_0x2d38('0x1f')](function(_0x240d02){if(_0x240d02[_0x2d38('0x3c')]>=0x1){var _0x435a4a={'messageId':_0x240d02['internal_order_id']};if(_0x13b3fd[_0x2d38('0x33')]!=='GP'||!_0x13b3fd[_0x2d38('0x3d')]){_0x435a4a[_0x2d38('0x3e')]=!![];}return _0x25e9a7[_0x2d38('0x17')](_0x435a4a);}else{return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x30'),util[_0x2d38('0x2e')](_0x240d02,{'showHidden':![],'depth':null}));}})[_0x2d38('0x19')](function(_0x5b8ae7){return logger['error'](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x30'),util[_0x2d38('0x2e')](_0x5b8ae7,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x30'),_0x2d38('0x3f'));}break;case _0x2d38('0x40'):if(_0x13b3fd[_0x2d38('0x24')]){var _0x582679={'recipient':_0x18dfd8[_0x2d38('0x23')],'message':_0x18dfd8['body'],'sender':_0x13b3fd[_0x2d38('0x41')]||_0x13b3fd[_0x2d38('0x23')],'authorization':_0x13b3fd[_0x2d38('0x24')]};var _0x12a9bf={'method':'POST','uri':_0x2d38('0x42'),'body':_0x582679,'json':!![]};rp(_0x12a9bf)[_0x2d38('0x1f')](function(_0x213b07){var _0x11e58c={'messageId':_0x213b07[_0x2d38('0x43')]};if(!_0x13b3fd[_0x2d38('0x3d')]){_0x11e58c[_0x2d38('0x3e')]=!![];}return _0x25e9a7[_0x2d38('0x17')](_0x11e58c);})[_0x2d38('0x19')](function(_0x2af2c3){logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x40'),util['inspect'](_0x2af2c3,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),'afterCreate','connectel',_0x2d38('0x44'));}break;case _0x2d38('0x45'):if(_0x13b3fd[_0x2d38('0x32')]&&_0x13b3fd['password']){var _0x582679={'messages':[{'source':_0x2d38('0x46'),'to':_0x18dfd8[_0x2d38('0x23')],'body':_0x18dfd8['body'],'from':_0x13b3fd['senderString']||_0x13b3fd[_0x2d38('0x23')]}]};var _0x152c2f=util[_0x2d38('0x47')](_0x2d38('0x48'),_0x13b3fd[_0x2d38('0x32')],_0x13b3fd['password']);var _0x12a9bf={'method':_0x2d38('0x3a'),'uri':_0x2d38('0x49'),'body':_0x582679,'headers':{'Authorization':util[_0x2d38('0x47')]('Basic\x20%s',new Buffer(_0x152c2f)[_0x2d38('0x4a')](_0x2d38('0x4b')))},'json':!![]};rp(_0x12a9bf)[_0x2d38('0x1f')](function(_0x57d36e){if(_0x57d36e[_0x2d38('0x4c')]>=0xc8&&_0x57d36e[_0x2d38('0x4c')]<=0xce){if(_0x57d36e[_0x2d38('0x4d')]&&_0x57d36e['data']['queued_count']>0x0){var _0x3828ef=_[_0x2d38('0x4e')](_0x57d36e[_0x2d38('0x4d')][_0x2d38('0x25')]);var _0x49e418={'messageId':_0x3828ef[_0x2d38('0x4f')]};if(!_0x13b3fd[_0x2d38('0x3d')]){_0x49e418[_0x2d38('0x3e')]=!![];}return _0x25e9a7['update'](_0x49e418);}else{logger[_0x2d38('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2d38('0x50'),util[_0x2d38('0x2e')](_0x57d36e,{'showHidden':![],'depth':null}));}}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),'afterCreate','clickSend',util[_0x2d38('0x2e')](_0x57d36e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x9c67cb){logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x50'),util[_0x2d38('0x2e')](_0x9c67cb,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),'clickSend',_0x2d38('0x3f'));}break;case'plivo':if(_0x13b3fd[_0x2d38('0x51')]&&_0x13b3fd[_0x2d38('0x24')]){var _0x582679={'dst':_0x18dfd8[_0x2d38('0x23')],'text':_0x18dfd8[_0x2d38('0x27')],'src':_0x13b3fd[_0x2d38('0x41')]||_0x13b3fd[_0x2d38('0x23')],'url':_0x13b3fd[_0x2d38('0x28')]+_0x2d38('0x29')+_0x18dfd8['id']+_0x2d38('0x2a')+_0x13b3fd[_0x2d38('0x2b')]};var _0x152c2f=util[_0x2d38('0x47')](_0x2d38('0x48'),_0x13b3fd[_0x2d38('0x51')],_0x13b3fd[_0x2d38('0x24')]);var _0x12a9bf={'method':_0x2d38('0x3a'),'uri':util[_0x2d38('0x47')](_0x2d38('0x52'),_0x13b3fd[_0x2d38('0x51')]),'body':_0x582679,'headers':{'Authorization':util['format'](_0x2d38('0x53'),new Buffer(_0x152c2f)[_0x2d38('0x4a')]('base64'))},'json':!![]};rp(_0x12a9bf)['then'](function(_0x3e81f2){var _0x5ba127={'messageId':_0x3e81f2[_0x2d38('0x54')][0x0]};return _0x25e9a7[_0x2d38('0x17')](_0x5ba127);})['catch'](function(_0x4a7450){logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x55'),util[_0x2d38('0x2e')](_0x4a7450,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x55'),_0x2d38('0x56'));}break;case _0x2d38('0x57'):if(_0x13b3fd['username']&&_0x13b3fd[_0x2d38('0x36')]){if(_0x13b3fd['baseUrl']){var _0x4f7443={'method':_0x2d38('0x3a'),'uri':_0x13b3fd[_0x2d38('0x58')]+_0x2d38('0x59'),'body':{'username':_0x13b3fd['username'],'password':_0x13b3fd['password']},'json':!![]};return rp(_0x4f7443)[_0x2d38('0x1f')](function(_0xc95ec5){var _0x5a8820={'method':_0x2d38('0x3a'),'uri':_0x13b3fd[_0x2d38('0x58')]+_0x2d38('0x5a'),'body':{'messages':[{'from':_0x13b3fd[_0x2d38('0x23')],'destinations':[{'to':_0x18dfd8[_0x2d38('0x23')]}],'text':_0x18dfd8['body'],'notifyUrl':_0x13b3fd['remote']+_0x2d38('0x29')+_0x18dfd8['id']+'/status?token='+_0x13b3fd[_0x2d38('0x2b')],'notifyContentType':_0x2d38('0x5b'),'callbackData':_0x13b3fd[_0x2d38('0x23')]+';'+_0x18dfd8[_0x2d38('0x27')]}]},'headers':{'Authorization':'IBSSO\x20'+_0xc95ec5[_0x2d38('0x2b')]},'json':!![]};return rp(_0x5a8820)[_0x2d38('0x1f')](function(_0x5487af){if(_0x5487af[_0x2d38('0x25')]){var _0x2fa092={'messageId':_0x5487af['messages'][0x0][_0x2d38('0xc')]};if(!_0x13b3fd['deliveryReport']){_0x2fa092['read']=!![];}return _0x25e9a7[_0x2d38('0x17')](_0x2fa092);}else{return logger[_0x2d38('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2d38('0x57'),util['inspect'](_0x5487af,{'showHidden':![],'depth':null}));}});})[_0x2d38('0x19')](function(_0x1d9494){return logger[_0x2d38('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2d38('0x57'),util[_0x2d38('0x2e')](_0x1d9494,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x57'),_0x2d38('0x5c'));}}else{logger[_0x2d38('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d38('0x2d'),'infobip',_0x2d38('0x3f'));}break;case _0x2d38('0x5d'):var _0x4b2d93=require('crypto');if(_0x13b3fd[_0x2d38('0x5e')]){var _0x356a45={};_0x356a45[_0x2d38('0x5f')]=_0x13b3fd[_0x2d38('0x32')];_0x356a45['phone']=_0x18dfd8[_0x2d38('0x23')];_0x356a45['sender']=_0x13b3fd['phone'];_0x356a45[_0x2d38('0x60')]=_0x18dfd8[_0x2d38('0x27')];_0x356a45[_0x2d38('0x61')]=+new Date();var _0x103070='';var _0x5bc714='';var _0x453fff=Object[_0x2d38('0x62')](_0x356a45);_0x453fff[_0x2d38('0x63')]();for(var _0x9be561=0x0;_0x9be561<_0x453fff['length'];_0x9be561++){if(_0x103070!=''){_0x103070+='&';}_0x103070+=_0x453fff[_0x9be561]+'='+encodeURIComponent(_0x356a45[_0x453fff[_0x9be561]]);_0x5bc714+=_0x356a45[_0x453fff[_0x9be561]];}_0x5bc714+=_0x13b3fd['apiKey'];_0x5bc714=_0x4b2d93['createHash']('md5')['update'](_0x5bc714)['digest'](_0x2d38('0x64'));if(_0x103070!==''){_0x103070+='&';}_0x103070+=_0x2d38('0x65')+_0x5bc714;var _0x4451b7={'method':_0x2d38('0x37'),'uri':_0x13b3fd[_0x2d38('0x58')]+'/external/get/send.php?'+_0x103070,'json':!![]};return rp(_0x4451b7)[_0x2d38('0x1f')](function(_0x4229d7){var _0x4015cc=Object[_0x2d38('0x62')](_0x4229d7);if(_0x4229d7[_0x4015cc[0x0]]['error']&&parseInt(_0x4229d7[_0x4015cc[0x0]][_0x2d38('0x1a')])===0x0){var _0x30e985={'messageId':_0x4229d7[_0x4015cc[0x0]][_0x2d38('0x66')]};if(!_0x13b3fd[_0x2d38('0x3d')]){_0x30e985[_0x2d38('0x3e')]=!![];}return _0x25e9a7[_0x2d38('0x17')](_0x30e985);}else{return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),'csc',util[_0x2d38('0x2e')](_0x4229d7[_0x2d38('0x1a')],{'showHidden':![],'depth':null}));}})[_0x2d38('0x19')](function(_0x597376){return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x5d'),util[_0x2d38('0x2e')](_0x597376,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d38('0x2d'),_0x2d38('0x5d'),_0x2d38('0x67'));}break;case _0x2d38('0x68'):if(_0x13b3fd[_0x2d38('0x5e')]){var _0x50e943={'method':_0x2d38('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x13b3fd[_0x2d38('0x5e')]},'body':{'content':_0x18dfd8['body'],'to':[_0x18dfd8[_0x2d38('0x23')]],'from':_0x13b3fd[_0x2d38('0x23')],'binary':![],'clientMessageId':'uuid','charset':_0x2d38('0x69')},'json':!![]};rp(_0x50e943)[_0x2d38('0x1f')](function(_0x3eaba0){if(!_0x3eaba0[_0x2d38('0x1a')]){var _0x3002a8={'messageId':_0x3eaba0[_0x2d38('0x25')][0x0][_0x2d38('0x6a')]};if(!_0x13b3fd[_0x2d38('0x3d')]){_0x3002a8[_0x2d38('0x3e')]=!![];}return _0x25e9a7[_0x2d38('0x17')](_0x3002a8);}else{return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x68'),util[_0x2d38('0x2e')](_0x3eaba0['error'],{'showHidden':![],'depth':null}));}})[_0x2d38('0x19')](function(_0x38713d){return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x68'),util[_0x2d38('0x2e')](_0x38713d,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x68'),_0x2d38('0x67'));}break;case _0x2d38('0x6b'):if(_0x13b3fd['username']&&_0x13b3fd[_0x2d38('0x36')]){var _0x152c2f=util[_0x2d38('0x47')](_0x2d38('0x48'),_0x13b3fd[_0x2d38('0x32')],_0x13b3fd[_0x2d38('0x36')]);var _0x12a9bf={'method':_0x2d38('0x3a'),'uri':_0x2d38('0x6c')+_0x13b3fd[_0x2d38('0x6d')]+_0x2d38('0x6e'),'body':{'to':[_0x18dfd8['phone']],'text':_0x18dfd8['body'],'from':_0x13b3fd[_0x2d38('0x23')],'applicationId':_0x13b3fd[_0x2d38('0x6f')]},'headers':{'Authorization':util[_0x2d38('0x47')](_0x2d38('0x53'),new Buffer(_0x152c2f)[_0x2d38('0x4a')](_0x2d38('0x4b')))},'json':!![]};rp(_0x12a9bf)[_0x2d38('0x1f')](function(_0x15d1eb){if(_0x15d1eb['id']){var _0x5a4017={'messageId':_0x15d1eb['id']};return _0x25e9a7['update'](_0x5a4017);}else{logger['error'](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x6b'),util[_0x2d38('0x2e')](_0x15d1eb,{'showHidden':![],'depth':null}));}})[_0x2d38('0x19')](function(_0x39e37c){logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x6b'),util['inspect'](_0x39e37c,{'showHidden':![],'depth':null}));});}else{logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x13b3fd[_0x2d38('0x5e')]){var _0x1a93c4={};var _0x4451b7={'method':_0x2d38('0x3a'),'uri':_0x2d38('0x70'),'headers':{'Authorization':_0x2d38('0x71')+_0x13b3fd['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x13b3fd[_0x2d38('0x23')],'to':_0x18dfd8[_0x2d38('0x23')],'text':_0x18dfd8['body']},'json':!![]};return rp(_0x4451b7)[_0x2d38('0x1f')](function(_0x3bb57d){if(_0x3bb57d[_0x2d38('0x72')]==0xca){_0x1a93c4[_0x2d38('0x73')]=_0x3bb57d;var _0x1fafad={'method':'POST','uri':_0x2d38('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x13b3fd[_0x2d38('0x5e')],'Content-Type':_0x2d38('0x5b')},'body':{'refid':_0x1a93c4['message'][_0x2d38('0x75')]},'json':!![]};return rp(_0x1fafad)[_0x2d38('0x1f')](function(_0x37e7f9){_0x1a93c4[_0x2d38('0x76')]=_0x37e7f9;var _0x8bb6c9={'messageId':_0x1a93c4[_0x2d38('0x73')][_0x2d38('0x75')],'read':!![]};return _0x25e9a7[_0x2d38('0x17')](_0x8bb6c9);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2d38('0x2d'),_0x2d38('0x77'),util[_0x2d38('0x2e')](_0x3bb57d,{'showHidden':![],'depth':null}));}})[_0x2d38('0x19')](function(_0x429373){return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),_0x2d38('0x2d'),_0x2d38('0x77'),util[_0x2d38('0x2e')](_0x429373,{'showHidden':![],'depth':null}));});}else{return logger[_0x2d38('0x1a')](_0x2d38('0x2c'),'afterCreate',_0x2d38('0x77'),_0x2d38('0x78'));}break;}}})['finally'](function(){_0x495903();});}else{_0x495903();}}},'charset':_0x2d38('0x79'),'collate':_0x2d38('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 9960543..6514fb9 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 _0x843a=['SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateSmsMessage','create','body','options','raw','debug','stringify','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsMessage.socket','register','then','info'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x843a,0x125));var _0xa843=function(_0x20f0a5,_0x34a7a5){_0x20f0a5=_0x20f0a5-0x0;var _0x33339c=_0x843a[_0x20f0a5];return _0x33339c;};'use strict';var _=require('lodash');var util=require(_0xa843('0x0'));var moment=require('moment');var BPromise=require(_0xa843('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa843('0x2'));var db=require(_0xa843('0x3'))['db'];var utils=require(_0xa843('0x4'));var logger=require(_0xa843('0x5'))('rpc');var config=require(_0xa843('0x6'));var jayson=require(_0xa843('0x7'));var client=jayson[_0xa843('0x8')][_0xa843('0x9')]({'port':0x232a});config['redis']=_[_0xa843('0xa')](config[_0xa843('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa843('0xc'))(new Redis(config[_0xa843('0xb')]));require(_0xa843('0xd'))[_0xa843('0xe')](socket);function respondWithRpcPromise(_0x4ead1f,_0x252b61,_0x4f6114){return new BPromise(function(_0x351567,_0x2e5016){return client['request'](_0x4ead1f,_0x4f6114)[_0xa843('0xf')](function(_0x4c7958){logger[_0xa843('0x10')](_0xa843('0x11'),_0x252b61,'request\x20sent');logger['debug'](_0xa843('0x12'),_0x252b61,_0xa843('0x13'),JSON['stringify'](_0x4c7958));if(_0x4c7958[_0xa843('0x14')]){if(_0x4c7958[_0xa843('0x14')][_0xa843('0x15')]===0x1f4){logger['error'](_0xa843('0x11'),_0x252b61,_0x4c7958[_0xa843('0x14')][_0xa843('0x16')]);return _0x2e5016(_0x4c7958[_0xa843('0x14')][_0xa843('0x16')]);}logger[_0xa843('0x14')](_0xa843('0x11'),_0x252b61,_0x4c7958['error'][_0xa843('0x16')]);return _0x351567(_0x4c7958[_0xa843('0x14')][_0xa843('0x16')]);}else{logger[_0xa843('0x10')](_0xa843('0x11'),_0x252b61,_0xa843('0x13'));_0x351567(_0x4c7958[_0xa843('0x17')][_0xa843('0x16')]);}})['catch'](function(_0x20f9e7){logger[_0xa843('0x14')]('SmsMessage,\x20%s,\x20%s',_0x252b61,_0x20f9e7);_0x2e5016(_0x20f9e7);});});}exports[_0xa843('0x18')]=function(_0x2eea13){var _0xa4fc39=this;return new Promise(function(_0x19f134,_0x14d07c){return db['SmsMessage'][_0xa843('0x19')](_0x2eea13[_0xa843('0x1a')],{'raw':_0x2eea13[_0xa843('0x1b')]?_0x2eea13['options'][_0xa843('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4975d9){logger[_0xa843('0x10')](_0xa843('0x18'),_0x2eea13);logger[_0xa843('0x1d')](_0xa843('0x18'),_0x2eea13,JSON[_0xa843('0x1e')](_0x4975d9));_0x19f134(_0x4975d9);})['catch'](function(_0x544df9){logger[_0xa843('0x14')](_0xa843('0x18'),_0x544df9[_0xa843('0x16')],_0x2eea13);_0x14d07c(_0xa4fc39[_0xa843('0x14')](0x1f4,_0x544df9[_0xa843('0x16')]));});});}; \ No newline at end of file +var _0xf18f=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSmsMessage','SmsMessage','body','options','raw','debug','lodash','util','moment'];(function(_0xa2dd22,_0x44345c){var _0x3858f5=function(_0x5dce7d){while(--_0x5dce7d){_0xa2dd22['push'](_0xa2dd22['shift']());}};_0x3858f5(++_0x44345c);}(_0xf18f,0x190));var _0xff18=function(_0x48a5c6,_0x4fbc73){_0x48a5c6=_0x48a5c6-0x0;var _0x43962c=_0xf18f[_0x48a5c6];return _0x43962c;};'use strict';var _=require(_0xff18('0x0'));var util=require(_0xff18('0x1'));var moment=require(_0xff18('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff18('0x3'))['db'];var utils=require(_0xff18('0x4'));var logger=require(_0xff18('0x5'))(_0xff18('0x6'));var config=require(_0xff18('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff18('0x8')][_0xff18('0x9')]({'port':0x232a});config[_0xff18('0xa')]=_[_0xff18('0xb')](config[_0xff18('0xa')],{'host':_0xff18('0xc'),'port':0x18eb});var socket=require(_0xff18('0xd'))(new Redis(config[_0xff18('0xa')]));require(_0xff18('0xe'))[_0xff18('0xf')](socket);function respondWithRpcPromise(_0x1404ed,_0x68d843,_0x53c2bd){return new BPromise(function(_0x2ad1fb,_0x29d03d){return client[_0xff18('0x10')](_0x1404ed,_0x53c2bd)[_0xff18('0x11')](function(_0x3fe8bf){logger[_0xff18('0x12')](_0xff18('0x13'),_0x68d843,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x68d843,_0xff18('0x14'),JSON['stringify'](_0x3fe8bf));if(_0x3fe8bf[_0xff18('0x15')]){if(_0x3fe8bf[_0xff18('0x15')][_0xff18('0x16')]===0x1f4){logger[_0xff18('0x15')]('SmsMessage,\x20%s,\x20%s',_0x68d843,_0x3fe8bf['error']['message']);return _0x29d03d(_0x3fe8bf[_0xff18('0x15')][_0xff18('0x17')]);}logger['error'](_0xff18('0x13'),_0x68d843,_0x3fe8bf[_0xff18('0x15')][_0xff18('0x17')]);return _0x2ad1fb(_0x3fe8bf[_0xff18('0x15')][_0xff18('0x17')]);}else{logger[_0xff18('0x12')](_0xff18('0x13'),_0x68d843,_0xff18('0x14'));_0x2ad1fb(_0x3fe8bf['result'][_0xff18('0x17')]);}})[_0xff18('0x18')](function(_0x5ec6ba){logger[_0xff18('0x15')](_0xff18('0x13'),_0x68d843,_0x5ec6ba);_0x29d03d(_0x5ec6ba);});});}exports[_0xff18('0x19')]=function(_0x37bc03){var _0x11bf6b=this;return new Promise(function(_0x1ab703,_0x2285e8){return db[_0xff18('0x1a')]['create'](_0x37bc03[_0xff18('0x1b')],{'raw':_0x37bc03[_0xff18('0x1c')]?_0x37bc03[_0xff18('0x1c')][_0xff18('0x1d')]===undefined?!![]:![]:!![]})[_0xff18('0x11')](function(_0x23d266){logger['info'](_0xff18('0x19'),_0x37bc03);logger[_0xff18('0x1e')](_0xff18('0x19'),_0x37bc03,JSON['stringify'](_0x23d266));_0x1ab703(_0x23d266);})['catch'](function(_0x3026b2){logger[_0xff18('0x15')](_0xff18('0x19'),_0x3026b2[_0xff18('0x17')],_0x37bc03);_0x2285e8(_0x11bf6b[_0xff18('0x15')](0x1f4,_0x3026b2['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 0f28130..a1a9019 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 _0xcf59=['smsMessage:','./smsMessage.events','remove','update','emit','removeListener','register'];(function(_0xbfb59c,_0x4ba324){var _0x245250=function(_0x13bb0a){while(--_0x13bb0a){_0xbfb59c['push'](_0xbfb59c['shift']());}};_0x245250(++_0x4ba324);}(_0xcf59,0x71));var _0x9cf5=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0xcf59[_0x2f0057];return _0x17f2c3;};'use strict';var SmsMessageEvents=require(_0x9cf5('0x0'));var events=['save',_0x9cf5('0x1'),_0x9cf5('0x2')];function createListener(_0x4a4a74,_0x1cd89a){return function(_0x504b5f){_0x1cd89a[_0x9cf5('0x3')](_0x4a4a74,_0x504b5f);};}function removeListener(_0x2b043b,_0x568e17){return function(){SmsMessageEvents[_0x9cf5('0x4')](_0x2b043b,_0x568e17);};}exports[_0x9cf5('0x5')]=function(_0x31aa15){for(var _0x227ca6=0x0,_0xb8a157=events['length'];_0x227ca6<_0xb8a157;_0x227ca6++){var _0x3ddded=events[_0x227ca6];var _0x1a7dfb=createListener(_0x9cf5('0x6')+_0x3ddded,_0x31aa15);SmsMessageEvents['on'](_0x3ddded,_0x1a7dfb);}}; \ No newline at end of file +var _0x79e8=['emit','removeListener','register','smsMessage:','./smsMessage.events','save','remove','update'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0x79e8,0x84));var _0x879e=function(_0x42a075,_0x36af11){_0x42a075=_0x42a075-0x0;var _0x230759=_0x79e8[_0x42a075];return _0x230759;};'use strict';var SmsMessageEvents=require(_0x879e('0x0'));var events=[_0x879e('0x1'),_0x879e('0x2'),_0x879e('0x3')];function createListener(_0x493e52,_0x21341e){return function(_0x551580){_0x21341e[_0x879e('0x4')](_0x493e52,_0x551580);};}function removeListener(_0x265f78,_0x184e17){return function(){SmsMessageEvents[_0x879e('0x5')](_0x265f78,_0x184e17);};}exports[_0x879e('0x6')]=function(_0x1a1b1e){for(var _0x3c5732=0x0,_0xecdb61=events['length'];_0x3c5732<_0xecdb61;_0x3c5732++){var _0x51d3ff=events[_0x3c5732];var _0x1f3a42=createListener(_0x879e('0x7')+_0x51d3ff,_0x1a1b1e);SmsMessageEvents['on'](_0x51d3ff,_0x1f3a42);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 695003b..8665584 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 _0x46f8=['/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','put','/:id','update','delete','removeTeams','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers'];(function(_0x234df9,_0x38ec1d){var _0x1db4ab=function(_0x2a0682){while(--_0x2a0682){_0x234df9['push'](_0x234df9['shift']());}};_0x1db4ab(++_0x38ec1d);}(_0x46f8,0x12e));var _0x846f=function(_0x12f947,_0x5b88f1){_0x12f947=_0x12f947-0x0;var _0x14ccc2=_0x46f8[_0x12f947];return _0x14ccc2;};'use strict';var multer=require('multer');var util=require(_0x846f('0x0'));var path=require(_0x846f('0x1'));var timeout=require(_0x846f('0x2'));var express=require(_0x846f('0x3'));var router=express[_0x846f('0x4')]();var fs_extra=require(_0x846f('0x5'));var auth=require(_0x846f('0x6'));var interaction=require(_0x846f('0x7'));var config=require(_0x846f('0x8'));var controller=require(_0x846f('0x9'));router[_0x846f('0xa')]('/',auth[_0x846f('0xb')](),controller[_0x846f('0xc')]);router[_0x846f('0xa')](_0x846f('0xd'),auth[_0x846f('0xb')](),controller[_0x846f('0xe')]);router['get']('/:id',auth[_0x846f('0xb')](),controller[_0x846f('0xf')]);router[_0x846f('0xa')](_0x846f('0x10'),auth[_0x846f('0xb')](),controller[_0x846f('0x11')]);router[_0x846f('0xa')](_0x846f('0x12'),auth[_0x846f('0xb')](),controller[_0x846f('0x13')]);router[_0x846f('0xa')]('/:id/users',auth[_0x846f('0xb')](),controller[_0x846f('0x14')]);router['post']('/',auth[_0x846f('0xb')](),controller[_0x846f('0x15')]);router[_0x846f('0x16')]('/:id/teams',auth[_0x846f('0xb')](),controller[_0x846f('0x17')]);router[_0x846f('0x16')](_0x846f('0x18'),auth['isAuthenticated'](),controller[_0x846f('0x19')]);router[_0x846f('0x1a')](_0x846f('0x1b'),auth[_0x846f('0xb')](),controller[_0x846f('0x1c')]);router[_0x846f('0x1d')](_0x846f('0x1b'),auth[_0x846f('0xb')](),controller['destroy']);router[_0x846f('0x1d')](_0x846f('0x12'),auth[_0x846f('0xb')](),controller[_0x846f('0x1e')]);router[_0x846f('0x1d')](_0x846f('0x18'),auth[_0x846f('0xb')](),controller[_0x846f('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x9613=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x9613,0x1de));var _0x3961=function(_0x37800d,_0xd1f92d){_0x37800d=_0x37800d-0x0;var _0x2f7f26=_0x9613[_0x37800d];return _0x2f7f26;};'use strict';var multer=require(_0x3961('0x0'));var util=require(_0x3961('0x1'));var path=require(_0x3961('0x2'));var timeout=require(_0x3961('0x3'));var express=require(_0x3961('0x4'));var router=express[_0x3961('0x5')]();var fs_extra=require(_0x3961('0x6'));var auth=require(_0x3961('0x7'));var interaction=require(_0x3961('0x8'));var config=require(_0x3961('0x9'));var controller=require(_0x3961('0xa'));router[_0x3961('0xb')]('/',auth[_0x3961('0xc')](),controller[_0x3961('0xd')]);router[_0x3961('0xb')](_0x3961('0xe'),auth[_0x3961('0xc')](),controller['describe']);router[_0x3961('0xb')](_0x3961('0xf'),auth['isAuthenticated'](),controller[_0x3961('0x10')]);router['get']('/:id/members',auth[_0x3961('0xc')](),controller[_0x3961('0x11')]);router[_0x3961('0xb')]('/:id/teams',auth[_0x3961('0xc')](),controller['getTeams']);router['get'](_0x3961('0x12'),auth[_0x3961('0xc')](),controller[_0x3961('0x13')]);router[_0x3961('0x14')]('/',auth[_0x3961('0xc')](),controller[_0x3961('0x15')]);router[_0x3961('0x14')](_0x3961('0x16'),auth[_0x3961('0xc')](),controller[_0x3961('0x17')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x3961('0x18')]);router[_0x3961('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x3961('0x1a')]);router[_0x3961('0x1b')](_0x3961('0xf'),auth[_0x3961('0xc')](),controller[_0x3961('0x1c')]);router['delete'](_0x3961('0x16'),auth[_0x3961('0xc')](),controller[_0x3961('0x1d')]);router[_0x3961('0x1b')](_0x3961('0x12'),auth[_0x3961('0xc')](),controller[_0x3961('0x1e')]);module[_0x3961('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index bfbf414..ffdc8db 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 _0x9911=['sequelize','exports','STRING','name','INTEGER','beepall'];(function(_0x12c539,_0x2dbe22){var _0xb79581=function(_0x5be461){while(--_0x5be461){_0x12c539['push'](_0x12c539['shift']());}};_0xb79581(++_0x2dbe22);}(_0x9911,0x16e));var _0x1991=function(_0x407da9,_0x20b02e){_0x407da9=_0x407da9-0x0;var _0x2cdd4b=_0x9911[_0x407da9];return _0x2cdd4b;};'use strict';var Sequelize=require(_0x1991('0x0'));module[_0x1991('0x1')]={'name':{'type':Sequelize[_0x1991('0x2')],'unique':_0x1991('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1991('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1991('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x7358=['STRING','INTEGER','rrmemory','roundrobin','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7358,0xae));var _0x8735=function(_0x52da32,_0x94d59f){_0x52da32=_0x52da32-0x0;var _0x5eb09f=_0x7358[_0x52da32];return _0x5eb09f;};'use strict';var Sequelize=require(_0x8735('0x0'));module['exports']={'name':{'type':Sequelize[_0x8735('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8735('0x1')]},'timeout':{'type':Sequelize[_0x8735('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8735('0x3'),'beepall',_0x8735('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 72dc95c..81df850 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 _0xa105=['SmsQueue','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','nolimit','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send'];(function(_0x4b19b3,_0x59b162){var _0x2780e7=function(_0x5edd11){while(--_0x5edd11){_0x4b19b3['push'](_0x4b19b3['shift']());}};_0x2780e7(++_0x59b162);}(_0xa105,0xe8));var _0x5a10=function(_0x360e42,_0x7bab70){_0x360e42=_0x360e42-0x0;var _0x7f213d=_0xa105[_0x360e42];return _0x7f213d;};'use strict';var emlformat=require(_0x5a10('0x0'));var rimraf=require(_0x5a10('0x1'));var zipdir=require(_0x5a10('0x2'));var jsonpatch=require(_0x5a10('0x3'));var rp=require(_0x5a10('0x4'));var moment=require(_0x5a10('0x5'));var BPromise=require(_0x5a10('0x6'));var Mustache=require(_0x5a10('0x7'));var util=require(_0x5a10('0x8'));var path=require(_0x5a10('0x9'));var sox=require(_0x5a10('0xa'));var csv=require(_0x5a10('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a10('0xc'));var _=require(_0x5a10('0xd'));var squel=require(_0x5a10('0xe'));var crypto=require(_0x5a10('0xf'));var jsforce=require(_0x5a10('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a10('0x11'));var Papa=require(_0x5a10('0x12'));var Redis=require('ioredis');var authService=require(_0x5a10('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5a10('0x14'));var hardwareService=require(_0x5a10('0x15'));var logger=require(_0x5a10('0x16'))(_0x5a10('0x17'));var utils=require('../../config/utils');var config=require(_0x5a10('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a10('0x19'))['db'];config['redis']=_['defaults'](config[_0x5a10('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a10('0x1b'))(new Redis(config[_0x5a10('0x1a')]));require('./smsQueue.socket')[_0x5a10('0x1c')](socket);function respondWithStatusCode(_0x1579c4,_0x1ced52){_0x1ced52=_0x1ced52||0xcc;return function(_0x3e3df8){if(_0x3e3df8){return _0x1579c4[_0x5a10('0x1d')](_0x1ced52);}return _0x1579c4[_0x5a10('0x1e')](_0x1ced52)[_0x5a10('0x1f')]();};}function respondWithResult(_0x1d5c04,_0x43ea02){_0x43ea02=_0x43ea02||0xc8;return function(_0x48f267){if(_0x48f267){return _0x1d5c04[_0x5a10('0x1e')](_0x43ea02)['json'](_0x48f267);}};}function respondWithFilteredResult(_0x3c29a9,_0x32bd31){return function(_0x58ab56){if(_0x58ab56){var _0x41c2b6=typeof _0x32bd31[_0x5a10('0x20')]===_0x5a10('0x21')&&typeof _0x32bd31[_0x5a10('0x22')]===_0x5a10('0x21');var _0x1901a2=_0x58ab56[_0x5a10('0x23')];var _0x578522=_0x41c2b6?0x0:_0x32bd31['offset'];var _0x13c69c=_0x41c2b6?_0x58ab56['count']:_0x32bd31['offset']+_0x32bd31[_0x5a10('0x22')];var _0xeb6dea;if(_0x13c69c>=_0x1901a2){_0x13c69c=_0x1901a2;_0xeb6dea=0xc8;}else{_0xeb6dea=0xce;}_0x3c29a9[_0x5a10('0x1e')](_0xeb6dea);return _0x3c29a9[_0x5a10('0x24')](_0x5a10('0x25'),_0x578522+'-'+_0x13c69c+'/'+_0x1901a2)['json'](_0x58ab56);}return null;};}function patchUpdates(_0xd3637e){return function(_0x395b7c){try{jsonpatch[_0x5a10('0x26')](_0x395b7c,_0xd3637e,!![]);}catch(_0x352a07){return BPromise[_0x5a10('0x27')](_0x352a07);}return _0x395b7c[_0x5a10('0x28')]();};}function saveUpdates(_0x1b5b6a,_0x47934f){return function(_0xb45b6d){if(_0xb45b6d){return _0xb45b6d['update'](_0x1b5b6a)[_0x5a10('0x29')](function(_0xb3039c){return _0xb3039c;});}return null;};}function removeEntity(_0xeabedf,_0x484202){return function(_0x4be10d){if(_0x4be10d){return _0x4be10d['destroy']()[_0x5a10('0x29')](function(){var _0x1e76cc=_0x4be10d[_0x5a10('0x2a')]({'plain':!![]});var _0x1b6c52='SmsQueues';return db[_0x5a10('0x2b')][_0x5a10('0x2c')]({'where':{'type':_0x1b6c52,'resourceId':_0x1e76cc['id']}})['then'](function(){return _0x4be10d;});})['then'](function(){_0xeabedf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x584062,_0x971a77){return function(_0x166844){if(!_0x166844){_0x584062['sendStatus'](0x194);}return _0x166844;};}function handleError(_0x402226,_0x545c50){_0x545c50=_0x545c50||0x1f4;return function(_0x4b5efa){logger['error'](_0x4b5efa[_0x5a10('0x2d')]);if(_0x4b5efa[_0x5a10('0x2e')]){delete _0x4b5efa[_0x5a10('0x2e')];}_0x402226[_0x5a10('0x1e')](_0x545c50)[_0x5a10('0x2f')](_0x4b5efa);};}exports['index']=function(_0x40a2be,_0x2c660b){var _0x265ef3={},_0x9b85da={},_0x4f4d3e={'count':0x0,'rows':[]};var _0x374b5d=_['map'](db[_0x5a10('0x30')][_0x5a10('0x31')],function(_0x45114c){return{'name':_0x45114c['fieldName'],'type':_0x45114c['type'][_0x5a10('0x32')]};});_0x9b85da[_0x5a10('0x33')]=_[_0x5a10('0x34')](_0x374b5d,_0x5a10('0x2e'));_0x9b85da[_0x5a10('0x35')]=_[_0x5a10('0x36')](_0x40a2be[_0x5a10('0x35')]);_0x9b85da[_0x5a10('0x37')]=_[_0x5a10('0x38')](_0x9b85da[_0x5a10('0x33')],_0x9b85da[_0x5a10('0x35')]);_0x265ef3[_0x5a10('0x39')]=_[_0x5a10('0x38')](_0x9b85da[_0x5a10('0x33')],qs[_0x5a10('0x3a')](_0x40a2be['query'][_0x5a10('0x3a')]));_0x265ef3[_0x5a10('0x39')]=_0x265ef3[_0x5a10('0x39')][_0x5a10('0x3b')]?_0x265ef3[_0x5a10('0x39')]:_0x9b85da['model'];if(!_0x40a2be['query'][_0x5a10('0x3c')]('nolimit')){_0x265ef3[_0x5a10('0x22')]=qs[_0x5a10('0x22')](_0x40a2be[_0x5a10('0x35')][_0x5a10('0x22')]);_0x265ef3['offset']=qs[_0x5a10('0x20')](_0x40a2be[_0x5a10('0x35')][_0x5a10('0x20')]);}_0x265ef3[_0x5a10('0x3d')]=qs[_0x5a10('0x3e')](_0x40a2be[_0x5a10('0x35')]['sort']);_0x265ef3['where']=qs[_0x5a10('0x37')](_[_0x5a10('0x3f')](_0x40a2be[_0x5a10('0x35')],_0x9b85da[_0x5a10('0x37')]),_0x374b5d);if(_0x40a2be[_0x5a10('0x35')][_0x5a10('0x40')]){_0x265ef3[_0x5a10('0x41')]=_['merge'](_0x265ef3[_0x5a10('0x41')],{'$or':_[_0x5a10('0x34')](_0x374b5d,function(_0x361fff){if(_0x361fff[_0x5a10('0x42')]!==_0x5a10('0x43')){var _0x3c6f85={};_0x3c6f85[_0x361fff[_0x5a10('0x2e')]]={'$like':'%'+_0x40a2be[_0x5a10('0x35')][_0x5a10('0x40')]+'%'};return _0x3c6f85;}})});}_0x265ef3=_['merge']({},_0x265ef3,_0x40a2be[_0x5a10('0x44')]);var _0xea30d2={'where':_0x265ef3[_0x5a10('0x41')]};return db[_0x5a10('0x30')][_0x5a10('0x23')](_0xea30d2)[_0x5a10('0x29')](function(_0x4d8897){_0x4f4d3e[_0x5a10('0x23')]=_0x4d8897;if(_0x40a2be['query'][_0x5a10('0x45')]){_0x265ef3['include']=[{'all':!![]}];}return db[_0x5a10('0x30')][_0x5a10('0x46')](_0x265ef3);})[_0x5a10('0x29')](function(_0x16ad51){_0x4f4d3e[_0x5a10('0x47')]=_0x16ad51;return _0x4f4d3e;})[_0x5a10('0x29')](respondWithFilteredResult(_0x2c660b,_0x265ef3))[_0x5a10('0x48')](handleError(_0x2c660b,null));};exports[_0x5a10('0x49')]=function(_0x593809,_0x353f82){var _0x3816f7={'raw':!![],'where':{'id':_0x593809[_0x5a10('0x4a')]['id']}},_0x5888e3={};_0x5888e3[_0x5a10('0x33')]=_[_0x5a10('0x36')](db[_0x5a10('0x30')][_0x5a10('0x31')]);_0x5888e3[_0x5a10('0x35')]=_['keys'](_0x593809[_0x5a10('0x35')]);_0x5888e3['filters']=_[_0x5a10('0x38')](_0x5888e3[_0x5a10('0x33')],_0x5888e3[_0x5a10('0x35')]);_0x3816f7['attributes']=_[_0x5a10('0x38')](_0x5888e3[_0x5a10('0x33')],qs[_0x5a10('0x3a')](_0x593809[_0x5a10('0x35')][_0x5a10('0x3a')]));_0x3816f7[_0x5a10('0x39')]=_0x3816f7[_0x5a10('0x39')]['length']?_0x3816f7[_0x5a10('0x39')]:_0x5888e3['model'];if(_0x593809[_0x5a10('0x35')][_0x5a10('0x45')]){_0x3816f7[_0x5a10('0x4b')]=[{'all':!![]}];}_0x3816f7=_[_0x5a10('0x4c')]({},_0x3816f7,_0x593809[_0x5a10('0x44')]);return db[_0x5a10('0x30')][_0x5a10('0x4d')](_0x3816f7)[_0x5a10('0x29')](handleEntityNotFound(_0x353f82,null))[_0x5a10('0x29')](respondWithResult(_0x353f82,null))[_0x5a10('0x48')](handleError(_0x353f82,null));};exports[_0x5a10('0x4e')]=function(_0x47b0fd,_0x152f22){return db[_0x5a10('0x30')][_0x5a10('0x4e')](_0x47b0fd[_0x5a10('0x4f')],{})['then'](function(_0x4f3958){var _0x5b6acc=_0x47b0fd[_0x5a10('0x50')][_0x5a10('0x2a')]({'plain':!![]});if(!_0x5b6acc)throw new Error(_0x5a10('0x51'));if(_0x5b6acc[_0x5a10('0x52')]===_0x5a10('0x50')){var _0x2f97f1=_0x4f3958[_0x5a10('0x2a')]({'plain':!![]});var _0x1e8c2a=_0x5a10('0x53');return db[_0x5a10('0x54')][_0x5a10('0x4d')]({'where':{'name':_0x1e8c2a,'userProfileId':_0x5b6acc['userProfileId']},'raw':!![]})['then'](function(_0x34fd36){if(_0x34fd36&&_0x34fd36['autoAssociation']===0x0){return db[_0x5a10('0x2b')][_0x5a10('0x4e')]({'name':_0x2f97f1[_0x5a10('0x2e')],'resourceId':_0x2f97f1['id'],'type':_0x34fd36[_0x5a10('0x2e')],'sectionId':_0x34fd36['id']},{})['then'](function(){return _0x4f3958;});}else{return _0x4f3958;}})[_0x5a10('0x48')](function(_0x56b958){logger[_0x5a10('0x55')](_0x5a10('0x56'),_0x56b958);throw _0x56b958;});}return _0x4f3958;})['then'](respondWithResult(_0x152f22,0xc9))[_0x5a10('0x48')](handleError(_0x152f22,null));};exports[_0x5a10('0x57')]=function(_0x4925f4,_0x48a682){if(_0x4925f4[_0x5a10('0x4f')]['id']){delete _0x4925f4[_0x5a10('0x4f')]['id'];}return db[_0x5a10('0x30')][_0x5a10('0x4d')]({'where':{'id':_0x4925f4[_0x5a10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48a682,null))[_0x5a10('0x29')](saveUpdates(_0x4925f4['body'],null))[_0x5a10('0x29')](respondWithResult(_0x48a682,null))[_0x5a10('0x48')](handleError(_0x48a682,null));};exports['destroy']=function(_0x2fb8b7,_0x552873){return db['SmsQueue'][_0x5a10('0x4d')]({'where':{'id':_0x2fb8b7[_0x5a10('0x4a')]['id']}})[_0x5a10('0x29')](handleEntityNotFound(_0x552873,null))[_0x5a10('0x29')](removeEntity(_0x552873,null))[_0x5a10('0x48')](handleError(_0x552873,null));};exports[_0x5a10('0x58')]=function(_0x1814fb,_0x114acf){return db[_0x5a10('0x30')][_0x5a10('0x58')]()[_0x5a10('0x29')](respondWithResult(_0x114acf,null))[_0x5a10('0x48')](handleError(_0x114acf,null));};exports[_0x5a10('0x59')]=function(_0x5c3661,_0x29cba5,_0x41fe6f){var _0x1bb8f0={'raw':!![],'where':{}},_0x109c2b={},_0x4d1047;return db[_0x5a10('0x30')][_0x5a10('0x5a')]({'where':{'id':_0x5c3661[_0x5a10('0x4a')]['id']}})['then'](handleEntityNotFound(_0x29cba5,null))[_0x5a10('0x29')](function(_0x18607b){if(_0x18607b){_0x4d1047=_0x18607b[_0x5a10('0x2a')]({'plain':!![]});_0x109c2b[_0x5a10('0x33')]=_[_0x5a10('0x36')](db['UserSmsQueue'][_0x5a10('0x31')]);_0x109c2b[_0x5a10('0x35')]=_[_0x5a10('0x36')](_0x5c3661['query']);_0x109c2b['filters']=_[_0x5a10('0x38')](_0x109c2b[_0x5a10('0x33')],_0x109c2b['query']);_0x1bb8f0[_0x5a10('0x39')]=_['intersection'](_0x109c2b[_0x5a10('0x33')],qs[_0x5a10('0x3a')](_0x5c3661[_0x5a10('0x35')][_0x5a10('0x3a')]));_0x1bb8f0[_0x5a10('0x39')]=_0x1bb8f0[_0x5a10('0x39')][_0x5a10('0x3b')]?_0x1bb8f0['attributes']:_0x109c2b[_0x5a10('0x33')];if(!_0x5c3661[_0x5a10('0x35')]['hasOwnProperty'](_0x5a10('0x5b'))){_0x1bb8f0[_0x5a10('0x22')]=qs[_0x5a10('0x22')](_0x5c3661[_0x5a10('0x35')][_0x5a10('0x22')]);_0x1bb8f0[_0x5a10('0x20')]=qs[_0x5a10('0x20')](_0x5c3661[_0x5a10('0x35')][_0x5a10('0x20')]);}_0x1bb8f0[_0x5a10('0x3d')]=qs['sort'](_0x5c3661[_0x5a10('0x35')][_0x5a10('0x3e')]);_0x1bb8f0['where']=qs[_0x5a10('0x37')](_[_0x5a10('0x3f')](_0x5c3661[_0x5a10('0x35')],_0x109c2b['filters']));_0x1bb8f0[_0x5a10('0x41')][_0x5a10('0x5c')]=_0x18607b['id'];if(_0x5c3661['query'][_0x5a10('0x40')]){_0x1bb8f0[_0x5a10('0x41')]=_[_0x5a10('0x4c')](_0x1bb8f0[_0x5a10('0x41')],{'$or':_[_0x5a10('0x34')](_0x1bb8f0['attributes'],function(_0x822580){var _0x1e4688={};_0x1e4688[_0x822580]={'$like':'%'+_0x5c3661[_0x5a10('0x35')][_0x5a10('0x40')]+'%'};return _0x1e4688;})});}_0x1bb8f0=_[_0x5a10('0x4c')]({},_0x1bb8f0,_0x5c3661[_0x5a10('0x44')]);return db[_0x5a10('0x5d')][_0x5a10('0x46')](_0x1bb8f0);}})[_0x5a10('0x29')](function(_0x1a376d){if(_0x1a376d){return db[_0x5a10('0x5e')][_0x5a10('0x5f')]({'where':{'id':_[_0x5a10('0x34')](_0x1a376d,_0x5a10('0x60')),'role':_0x5a10('0x61')},'attributes':['id',_0x5a10('0x2e'),'smsPause',_0x5a10('0x62'),_0x5a10('0x63')]});}})['then'](function(_0x2b8dc6){if(_0x2b8dc6){return{'count':_0x2b8dc6[_0x5a10('0x23')],'rows':_[_0x5a10('0x34')](_0x2b8dc6[_0x5a10('0x47')],function(_0x33f0bb){return{'membername':_0x33f0bb['name'],'UserId':_0x33f0bb['id'],'queue_name':_0x4d1047[_0x5a10('0x2e')],'SmsQueueId':_0x4d1047['id'],'interface':util[_0x5a10('0x64')](_0x5a10('0x65'),_0x5a10('0x66'),_0x33f0bb[_0x5a10('0x2e')]),'penalty':0x0,'paused':_0x33f0bb['smsPause'],'createdAt':_0x33f0bb['createdAt'],'updatedAt':_0x33f0bb[_0x5a10('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x29cba5,_0x1bb8f0))[_0x5a10('0x48')](handleError(_0x29cba5,null));};exports[_0x5a10('0x67')]=function(_0x3ebd19,_0x3b963c,_0x2214d2){var _0x41e120={};var _0x40352d={};var _0xf66880;var _0x46bfeb;return db[_0x5a10('0x30')][_0x5a10('0x5a')]({'where':{'id':_0x3ebd19[_0x5a10('0x4a')]['id']}})[_0x5a10('0x29')](handleEntityNotFound(_0x3b963c,null))[_0x5a10('0x29')](function(_0x5bd2de){if(_0x5bd2de){_0xf66880=_0x5bd2de;_0x40352d[_0x5a10('0x33')]=_[_0x5a10('0x36')](db[_0x5a10('0x68')][_0x5a10('0x31')]);_0x40352d[_0x5a10('0x35')]=_[_0x5a10('0x36')](_0x3ebd19[_0x5a10('0x35')]);_0x40352d['filters']=_[_0x5a10('0x38')](_0x40352d[_0x5a10('0x33')],_0x40352d[_0x5a10('0x35')]);_0x41e120[_0x5a10('0x39')]=_[_0x5a10('0x38')](_0x40352d[_0x5a10('0x33')],qs[_0x5a10('0x3a')](_0x3ebd19[_0x5a10('0x35')][_0x5a10('0x3a')]));_0x41e120[_0x5a10('0x39')]=_0x41e120[_0x5a10('0x39')][_0x5a10('0x3b')]?_0x41e120[_0x5a10('0x39')]:_0x40352d['model'];_0x41e120[_0x5a10('0x3d')]=qs['sort'](_0x3ebd19[_0x5a10('0x35')][_0x5a10('0x3e')]);_0x41e120[_0x5a10('0x41')]=qs[_0x5a10('0x37')](_[_0x5a10('0x3f')](_0x3ebd19[_0x5a10('0x35')],_0x40352d[_0x5a10('0x37')]));if(_0x3ebd19['query'][_0x5a10('0x40')]){_0x41e120[_0x5a10('0x41')]=_[_0x5a10('0x4c')](_0x41e120[_0x5a10('0x41')],{'$or':_['map'](_0x41e120['attributes'],function(_0x40521b){var _0x2ceaef={};_0x2ceaef[_0x40521b]={'$like':'%'+_0x3ebd19['query'][_0x5a10('0x40')]+'%'};return _0x2ceaef;})});}_0x41e120=_[_0x5a10('0x4c')]({},_0x41e120,_0x3ebd19['options']);return _0xf66880['getTeams'](_0x41e120);}})[_0x5a10('0x29')](function(_0x5b8aaa){if(_0x5b8aaa){_0x46bfeb=_0x5b8aaa['length'];if(!_0x3ebd19[_0x5a10('0x35')]['hasOwnProperty'](_0x5a10('0x5b'))){_0x41e120['limit']=qs[_0x5a10('0x22')](_0x3ebd19[_0x5a10('0x35')][_0x5a10('0x22')]);_0x41e120[_0x5a10('0x20')]=qs['offset'](_0x3ebd19[_0x5a10('0x35')][_0x5a10('0x20')]);}return _0xf66880[_0x5a10('0x67')](_0x41e120);}})[_0x5a10('0x29')](function(_0x5bbcf4){if(_0x5bbcf4){return _0x5bbcf4?{'count':_0x46bfeb,'rows':_0x5bbcf4}:null;}})[_0x5a10('0x29')](respondWithResult(_0x3b963c,null))[_0x5a10('0x48')](handleError(_0x3b963c,null));};exports[_0x5a10('0x69')]=function(_0x22cfd7,_0x1461ee,_0x593cd9){var _0x39a76a=_0x22cfd7['body'][_0x5a10('0x6a')];return db[_0x5a10('0x68')][_0x5a10('0x46')]({'where':{'id':_0x39a76a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5a10('0x6b'),'attributes':['id','name',_0x5a10('0x6c'),'voicePause','interface'],'raw':!![]}]})[_0x5a10('0x29')](function(_0x4fb984){if(_0x4fb984){var _0x1dc8a6=_[_0x5a10('0x6d')](_0x4fb984,function(_0x444baf){var _0x15a4ce=_0x444baf['get']({'plain':!![]});return _0x15a4ce[_0x5a10('0x6b')];});return db[_0x5a10('0x30')][_0x5a10('0x4d')]({'where':{'id':_0x22cfd7['params']['id']}})[_0x5a10('0x29')](function(_0x46cb9a){return db[_0x5a10('0x6e')]['transaction'](function(_0xb44b55){return _0x46cb9a[_0x5a10('0x69')](_0x39a76a,{'transaction':_0xb44b55})[_0x5a10('0x29')](function(){return BPromise[_0x5a10('0x6f')](_0x1dc8a6,function(_0x18f90a){return db[_0x5a10('0x5d')][_0x5a10('0x70')]({'where':{'UserId':_0x18f90a['id'],'SmsQueueId':_0x22cfd7['params']['id']},'transaction':_0xb44b55});});})['then'](function(){_0x1dc8a6[_0x5a10('0x71')](function(_0x5c3607){socket[_0x5a10('0x72')](_0x5a10('0x73'),{'UserId':_0x5c3607['id'],'SmsQueueId':_0x46cb9a['id']});});});});});}})[_0x5a10('0x29')](respondWithStatusCode(_0x1461ee,null))[_0x5a10('0x48')](handleError(_0x1461ee,null));};exports[_0x5a10('0x74')]=function(_0x122575,_0x134354,_0x341342){return db[_0x5a10('0x68')][_0x5a10('0x46')]({'where':{'id':_0x122575['query'][_0x5a10('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x5a10('0x5e')],'as':_0x5a10('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x5a10('0x29')](handleEntityNotFound(_0x134354,null))[_0x5a10('0x29')](function(_0x4b88ed){var _0x4c395b=_[_0x5a10('0x34')](_0x4b88ed,'id');var _0x1434f6=[];var _0x3af44a=[];var _0x11211f=squel['select']();_0x11211f['field'](_0x5a10('0x75'))[_0x5a10('0x76')]('team_has_sms_queues','tq')[_0x5a10('0x77')]('user_has_teams','ut',_0x5a10('0x78'))['where']('SmsQueueId\x20=\x20?',_0x122575[_0x5a10('0x4a')]['id']);for(var _0x5d0aa4=0x0;_0x5d0aa4<_0x4b88ed[_0x5a10('0x3b')];_0x5d0aa4+=0x1){let _0x47dbad=_0x4b88ed[_0x5d0aa4];for(var _0x142cae=0x0;_0x142cae<_0x47dbad[_0x5a10('0x6b')]['length'];_0x142cae+=0x1){let _0x325a87=_0x47dbad['Agents'][_0x142cae];var _0x3e113b=_0x11211f[_0x5a10('0x79')]();_0x3e113b[_0x5a10('0x41')]('ut.UserId\x20=\x20?',_0x325a87['id']);_0x3af44a[_0x5a10('0x7a')](db['sequelize']['query'](_0x3e113b[_0x5a10('0x7b')](),{'type':db[_0x5a10('0x6e')][_0x5a10('0x7c')][_0x5a10('0x7d')]})['then'](function(_0x3d552c){if(_0x3d552c['length']===0x1){return _0x325a87['id'];}else{var _0x190c8f=_[_0x5a10('0x7e')](_[_0x5a10('0x34')](_0x3d552c,_0x5a10('0x7f')),function(_0x323481){return _[_0x5a10('0x80')](_0x4c395b,_0x323481);});if(_0x190c8f){return _0x325a87['id'];}}}));}}return BPromise['all'](_0x3af44a)[_0x5a10('0x29')](function(_0x434221){_0x1434f6=_(_0x1434f6)[_0x5a10('0x81')](_0x434221)['compact']()[_0x5a10('0x82')]();return db[_0x5a10('0x30')][_0x5a10('0x4d')]({'where':{'id':_0x122575[_0x5a10('0x4a')]['id']}})[_0x5a10('0x29')](function(_0x4878f9){return db[_0x5a10('0x6e')][_0x5a10('0x83')](function(_0x51615c){return _0x4878f9['removeTeams'](_0x122575[_0x5a10('0x35')][_0x5a10('0x6a')],{'transaction':_0x51615c})['then'](function(){if(!_[_0x5a10('0x84')](_0x1434f6)){return _0x4878f9[_0x5a10('0x85')](_0x1434f6,{'transaction':_0x51615c});}})[_0x5a10('0x29')](function(){_0x1434f6[_0x5a10('0x71')](function(_0x5309ea){socket[_0x5a10('0x72')](_0x5a10('0x86'),{'UserId':_0x5309ea,'SmsQueueId':_0x4878f9['id']});});});});});});})[_0x5a10('0x29')](respondWithStatusCode(_0x134354,null))[_0x5a10('0x48')](handleError(_0x134354,null));};exports['addAgents']=function(_0x36bc14,_0x2bf54b,_0x2c55f3){return db[_0x5a10('0x30')]['find']({'where':{'id':_0x36bc14['params']['id']}})[_0x5a10('0x29')](handleEntityNotFound(_0x2bf54b,null))[_0x5a10('0x29')](function(_0x384795){if(_0x384795){return _0x384795[_0x5a10('0x87')](_0x36bc14['body'][_0x5a10('0x6a')],_[_0x5a10('0x88')](_0x36bc14[_0x5a10('0x4f')],[_0x5a10('0x6a'),'id'])||{})[_0x5a10('0x89')](function(_0x5748fd){for(var _0x506cd5=0x0;_0x506cd5<_0x36bc14['body'][_0x5a10('0x6a')]['length'];_0x506cd5+=0x1){socket[_0x5a10('0x72')](_0x5a10('0x73'),{'UserId':Number(_0x36bc14[_0x5a10('0x4f')][_0x5a10('0x6a')][_0x506cd5]),'SmsQueueId':Number(_0x36bc14[_0x5a10('0x4a')]['id'])});}return _0x5748fd;});}})[_0x5a10('0x29')](respondWithResult(_0x2bf54b,null))[_0x5a10('0x48')](handleError(_0x2bf54b,null));};exports['removeAgents']=function(_0x48536d,_0x2ffdfd,_0x1d29a1){return db['SmsQueue'][_0x5a10('0x4d')]({'where':{'id':_0x48536d[_0x5a10('0x4a')]['id']}})[_0x5a10('0x29')](handleEntityNotFound(_0x2ffdfd,null))[_0x5a10('0x29')](function(_0x1aeba6){if(_0x1aeba6){return _0x1aeba6[_0x5a10('0x85')](_0x48536d[_0x5a10('0x35')][_0x5a10('0x6a')])[_0x5a10('0x29')](function(){if(_[_0x5a10('0x8a')](_0x48536d[_0x5a10('0x35')][_0x5a10('0x6a')])){for(var _0x54ce5c=0x0;_0x54ce5c<_0x48536d[_0x5a10('0x35')][_0x5a10('0x6a')]['length'];_0x54ce5c+=0x1){socket[_0x5a10('0x72')](_0x5a10('0x86'),{'UserId':Number(_0x48536d[_0x5a10('0x35')]['ids'][_0x54ce5c]),'SmsQueueId':Number(_0x48536d[_0x5a10('0x4a')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x48536d[_0x5a10('0x35')]['ids']),'SmsQueueId':Number(_0x48536d[_0x5a10('0x4a')]['id'])});}});}})[_0x5a10('0x29')](respondWithStatusCode(_0x2ffdfd,null))[_0x5a10('0x48')](handleError(_0x2ffdfd,null));};exports[_0x5a10('0x8b')]=function(_0x519cfe,_0x11756d,_0x1defe6){var _0x597166={};var _0x2e1dc5={};var _0x69159b;var _0x94f2dc;return db['SmsQueue'][_0x5a10('0x5a')]({'where':{'id':_0x519cfe[_0x5a10('0x4a')]['id']}})[_0x5a10('0x29')](handleEntityNotFound(_0x11756d,null))[_0x5a10('0x29')](function(_0x33635e){if(_0x33635e){_0x69159b=_0x33635e;_0x2e1dc5[_0x5a10('0x33')]=_[_0x5a10('0x36')](db[_0x5a10('0x5e')][_0x5a10('0x31')]);_0x2e1dc5[_0x5a10('0x35')]=_[_0x5a10('0x36')](_0x519cfe[_0x5a10('0x35')]);_0x2e1dc5[_0x5a10('0x37')]=_[_0x5a10('0x38')](_0x2e1dc5[_0x5a10('0x33')],_0x2e1dc5[_0x5a10('0x35')]);_0x597166[_0x5a10('0x39')]=_[_0x5a10('0x38')](_0x2e1dc5[_0x5a10('0x33')],qs[_0x5a10('0x3a')](_0x519cfe['query'][_0x5a10('0x3a')]));_0x597166['attributes']=_0x597166['attributes'][_0x5a10('0x3b')]?_0x597166[_0x5a10('0x39')]:_0x2e1dc5[_0x5a10('0x33')];_0x597166[_0x5a10('0x3d')]=qs[_0x5a10('0x3e')](_0x519cfe[_0x5a10('0x35')]['sort']);_0x597166['where']=qs[_0x5a10('0x37')](_[_0x5a10('0x3f')](_0x519cfe[_0x5a10('0x35')],_0x2e1dc5['filters']));if(_0x519cfe[_0x5a10('0x35')][_0x5a10('0x40')]){_0x597166[_0x5a10('0x41')]=_[_0x5a10('0x4c')](_0x597166['where'],{'$or':_[_0x5a10('0x34')](_0x597166['attributes'],function(_0x1fa77c){var _0x316440={};_0x316440[_0x1fa77c]={'$like':'%'+_0x519cfe['query'][_0x5a10('0x40')]+'%'};return _0x316440;})});}_0x597166=_[_0x5a10('0x4c')]({},_0x597166,_0x519cfe[_0x5a10('0x44')]);return _0x69159b[_0x5a10('0x8b')](_0x597166);}})[_0x5a10('0x29')](function(_0x3bcb70){if(_0x3bcb70){_0x94f2dc=_0x3bcb70[_0x5a10('0x3b')];if(!_0x519cfe[_0x5a10('0x35')][_0x5a10('0x3c')](_0x5a10('0x5b'))){_0x597166[_0x5a10('0x22')]=qs['limit'](_0x519cfe[_0x5a10('0x35')][_0x5a10('0x22')]);_0x597166[_0x5a10('0x20')]=qs[_0x5a10('0x20')](_0x519cfe['query'][_0x5a10('0x20')]);}return _0x69159b['getAgents'](_0x597166);}})[_0x5a10('0x29')](function(_0x384709){if(_0x384709){return _0x384709?{'count':_0x94f2dc,'rows':_0x384709}:null;}})[_0x5a10('0x29')](respondWithResult(_0x11756d,null))[_0x5a10('0x48')](handleError(_0x11756d,null));}; \ No newline at end of file +var _0x5aaa=['../../mysqldb','defaults','redis','socket.io-emitter','./smsQueue.socket','register','end','status','offset','undefined','Content-Range','json','apply','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','UserId','smsPause','rows','format','SIP','updatedAt','getTeams','Team','ids','User','Agents','online','interface','sequelize','addTeams','forEach','removeTeams','select','field','team_has_sms_queues','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','union','compact','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x128b02,_0x381f0f){var _0x1f2ba8=function(_0x2b5099){while(--_0x2b5099){_0x128b02['push'](_0x128b02['shift']());}};_0x1f2ba8(++_0x381f0f);}(_0x5aaa,0xeb));var _0xa5aa=function(_0x55059c,_0x4a4ae7){_0x55059c=_0x55059c-0x0;var _0x18c13f=_0x5aaa[_0x55059c];return _0x18c13f;};'use strict';var emlformat=require(_0xa5aa('0x0'));var rimraf=require(_0xa5aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa5aa('0x2'));var moment=require(_0xa5aa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa5aa('0x4'));var util=require(_0xa5aa('0x5'));var path=require('path');var sox=require(_0xa5aa('0x6'));var csv=require('to-csv');var ejs=require(_0xa5aa('0x7'));var fs=require('fs');var fs_extra=require(_0xa5aa('0x8'));var _=require('lodash');var squel=require(_0xa5aa('0x9'));var crypto=require(_0xa5aa('0xa'));var jsforce=require(_0xa5aa('0xb'));var deskjs=require(_0xa5aa('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5aa('0xd'));var Redis=require('ioredis');var authService=require(_0xa5aa('0xe'));var qs=require(_0xa5aa('0xf'));var as=require(_0xa5aa('0x10'));var hardwareService=require(_0xa5aa('0x11'));var logger=require(_0xa5aa('0x12'))(_0xa5aa('0x13'));var utils=require(_0xa5aa('0x14'));var config=require(_0xa5aa('0x15'));var licenseUtil=require(_0xa5aa('0x16'));var db=require(_0xa5aa('0x17'))['db'];config['redis']=_[_0xa5aa('0x18')](config[_0xa5aa('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5aa('0x1a'))(new Redis(config['redis']));require(_0xa5aa('0x1b'))[_0xa5aa('0x1c')](socket);function respondWithStatusCode(_0x48a2d2,_0x1072bb){_0x1072bb=_0x1072bb||0xcc;return function(_0x5d5e26){if(_0x5d5e26){return _0x48a2d2['sendStatus'](_0x1072bb);}return _0x48a2d2['status'](_0x1072bb)[_0xa5aa('0x1d')]();};}function respondWithResult(_0x1a31d8,_0x5a9c4f){_0x5a9c4f=_0x5a9c4f||0xc8;return function(_0x29dfba){if(_0x29dfba){return _0x1a31d8[_0xa5aa('0x1e')](_0x5a9c4f)['json'](_0x29dfba);}};}function respondWithFilteredResult(_0x900680,_0x218bd5){return function(_0x13d868){if(_0x13d868){var _0x2af0a8=typeof _0x218bd5[_0xa5aa('0x1f')]===_0xa5aa('0x20')&&typeof _0x218bd5['limit']==='undefined';var _0x4eba99=_0x13d868['count'];var _0x1c7374=_0x2af0a8?0x0:_0x218bd5[_0xa5aa('0x1f')];var _0x46fc48=_0x2af0a8?_0x13d868['count']:_0x218bd5[_0xa5aa('0x1f')]+_0x218bd5['limit'];var _0x12d6d0;if(_0x46fc48>=_0x4eba99){_0x46fc48=_0x4eba99;_0x12d6d0=0xc8;}else{_0x12d6d0=0xce;}_0x900680[_0xa5aa('0x1e')](_0x12d6d0);return _0x900680['set'](_0xa5aa('0x21'),_0x1c7374+'-'+_0x46fc48+'/'+_0x4eba99)[_0xa5aa('0x22')](_0x13d868);}return null;};}function patchUpdates(_0x300086){return function(_0x3d2bd5){try{jsonpatch[_0xa5aa('0x23')](_0x3d2bd5,_0x300086,!![]);}catch(_0x8ae231){return BPromise['reject'](_0x8ae231);}return _0x3d2bd5['save']();};}function saveUpdates(_0x3235c1,_0x371252){return function(_0xc9ea9b){if(_0xc9ea9b){return _0xc9ea9b['update'](_0x3235c1)[_0xa5aa('0x24')](function(_0x340baa){return _0x340baa;});}return null;};}function removeEntity(_0x55959e,_0x4b65d6){return function(_0x4eb6af){if(_0x4eb6af){return _0x4eb6af[_0xa5aa('0x25')]()[_0xa5aa('0x24')](function(){var _0x52976e=_0x4eb6af[_0xa5aa('0x26')]({'plain':!![]});var _0x2131b7=_0xa5aa('0x27');return db[_0xa5aa('0x28')][_0xa5aa('0x25')]({'where':{'type':_0x2131b7,'resourceId':_0x52976e['id']}})['then'](function(){return _0x4eb6af;});})['then'](function(){_0x55959e[_0xa5aa('0x1e')](0xcc)[_0xa5aa('0x1d')]();});}};}function handleEntityNotFound(_0x1ba3cc,_0x39e9de){return function(_0x3b6ea6){if(!_0x3b6ea6){_0x1ba3cc[_0xa5aa('0x29')](0x194);}return _0x3b6ea6;};}function handleError(_0x546efa,_0x2d0b68){_0x2d0b68=_0x2d0b68||0x1f4;return function(_0x29dbf5){logger[_0xa5aa('0x2a')](_0x29dbf5[_0xa5aa('0x2b')]);if(_0x29dbf5[_0xa5aa('0x2c')]){delete _0x29dbf5[_0xa5aa('0x2c')];}_0x546efa['status'](_0x2d0b68)['send'](_0x29dbf5);};}exports[_0xa5aa('0x2d')]=function(_0x474099,_0x23975a){var _0x5aac22={},_0x269460={},_0x32e879={'count':0x0,'rows':[]};var _0x269175=_[_0xa5aa('0x2e')](db[_0xa5aa('0x2f')][_0xa5aa('0x30')],function(_0x5367e7){return{'name':_0x5367e7[_0xa5aa('0x31')],'type':_0x5367e7[_0xa5aa('0x32')][_0xa5aa('0x33')]};});_0x269460[_0xa5aa('0x34')]=_[_0xa5aa('0x2e')](_0x269175,_0xa5aa('0x2c'));_0x269460[_0xa5aa('0x35')]=_[_0xa5aa('0x36')](_0x474099[_0xa5aa('0x35')]);_0x269460[_0xa5aa('0x37')]=_[_0xa5aa('0x38')](_0x269460['model'],_0x269460['query']);_0x5aac22[_0xa5aa('0x39')]=_[_0xa5aa('0x38')](_0x269460[_0xa5aa('0x34')],qs['fields'](_0x474099['query'][_0xa5aa('0x3a')]));_0x5aac22[_0xa5aa('0x39')]=_0x5aac22[_0xa5aa('0x39')][_0xa5aa('0x3b')]?_0x5aac22[_0xa5aa('0x39')]:_0x269460['model'];if(!_0x474099[_0xa5aa('0x35')][_0xa5aa('0x3c')](_0xa5aa('0x3d'))){_0x5aac22[_0xa5aa('0x3e')]=qs['limit'](_0x474099['query']['limit']);_0x5aac22[_0xa5aa('0x1f')]=qs[_0xa5aa('0x1f')](_0x474099[_0xa5aa('0x35')][_0xa5aa('0x1f')]);}_0x5aac22[_0xa5aa('0x3f')]=qs[_0xa5aa('0x40')](_0x474099[_0xa5aa('0x35')][_0xa5aa('0x40')]);_0x5aac22[_0xa5aa('0x41')]=qs[_0xa5aa('0x37')](_[_0xa5aa('0x42')](_0x474099[_0xa5aa('0x35')],_0x269460[_0xa5aa('0x37')]),_0x269175);if(_0x474099[_0xa5aa('0x35')][_0xa5aa('0x43')]){_0x5aac22[_0xa5aa('0x41')]=_[_0xa5aa('0x44')](_0x5aac22[_0xa5aa('0x41')],{'$or':_[_0xa5aa('0x2e')](_0x269175,function(_0x3c7911){if(_0x3c7911[_0xa5aa('0x32')]!==_0xa5aa('0x45')){var _0x5238ad={};_0x5238ad[_0x3c7911[_0xa5aa('0x2c')]]={'$like':'%'+_0x474099['query'][_0xa5aa('0x43')]+'%'};return _0x5238ad;}})});}_0x5aac22=_[_0xa5aa('0x44')]({},_0x5aac22,_0x474099[_0xa5aa('0x46')]);var _0xb52b5d={'where':_0x5aac22[_0xa5aa('0x41')]};return db[_0xa5aa('0x2f')]['count'](_0xb52b5d)[_0xa5aa('0x24')](function(_0x255de3){_0x32e879[_0xa5aa('0x47')]=_0x255de3;if(_0x474099[_0xa5aa('0x35')]['includeAll']){_0x5aac22[_0xa5aa('0x48')]=[{'all':!![]}];}return db[_0xa5aa('0x2f')][_0xa5aa('0x49')](_0x5aac22);})[_0xa5aa('0x24')](function(_0x5452c1){_0x32e879['rows']=_0x5452c1;return _0x32e879;})[_0xa5aa('0x24')](respondWithFilteredResult(_0x23975a,_0x5aac22))[_0xa5aa('0x4a')](handleError(_0x23975a,null));};exports[_0xa5aa('0x4b')]=function(_0x29133c,_0x23d3cd){var _0x296c84={'raw':!![],'where':{'id':_0x29133c[_0xa5aa('0x4c')]['id']}},_0x849a7d={};_0x849a7d[_0xa5aa('0x34')]=_[_0xa5aa('0x36')](db[_0xa5aa('0x2f')]['rawAttributes']);_0x849a7d['query']=_[_0xa5aa('0x36')](_0x29133c[_0xa5aa('0x35')]);_0x849a7d[_0xa5aa('0x37')]=_[_0xa5aa('0x38')](_0x849a7d[_0xa5aa('0x34')],_0x849a7d[_0xa5aa('0x35')]);_0x296c84[_0xa5aa('0x39')]=_[_0xa5aa('0x38')](_0x849a7d['model'],qs[_0xa5aa('0x3a')](_0x29133c[_0xa5aa('0x35')][_0xa5aa('0x3a')]));_0x296c84[_0xa5aa('0x39')]=_0x296c84[_0xa5aa('0x39')][_0xa5aa('0x3b')]?_0x296c84[_0xa5aa('0x39')]:_0x849a7d[_0xa5aa('0x34')];if(_0x29133c[_0xa5aa('0x35')]['includeAll']){_0x296c84[_0xa5aa('0x48')]=[{'all':!![]}];}_0x296c84=_[_0xa5aa('0x44')]({},_0x296c84,_0x29133c['options']);return db[_0xa5aa('0x2f')][_0xa5aa('0x4d')](_0x296c84)[_0xa5aa('0x24')](handleEntityNotFound(_0x23d3cd,null))['then'](respondWithResult(_0x23d3cd,null))['catch'](handleError(_0x23d3cd,null));};exports['create']=function(_0x226694,_0x234e97){return db[_0xa5aa('0x2f')][_0xa5aa('0x4e')](_0x226694[_0xa5aa('0x4f')],{})[_0xa5aa('0x24')](function(_0x3a1919){var _0x4a69d6=_0x226694[_0xa5aa('0x50')][_0xa5aa('0x26')]({'plain':!![]});if(!_0x4a69d6)throw new Error(_0xa5aa('0x51'));if(_0x4a69d6[_0xa5aa('0x52')]===_0xa5aa('0x50')){var _0x348680=_0x3a1919[_0xa5aa('0x26')]({'plain':!![]});var _0x3fdd3c=_0xa5aa('0x27');return db[_0xa5aa('0x53')][_0xa5aa('0x4d')]({'where':{'name':_0x3fdd3c,'userProfileId':_0x4a69d6[_0xa5aa('0x54')]},'raw':!![]})[_0xa5aa('0x24')](function(_0x52a889){if(_0x52a889&&_0x52a889[_0xa5aa('0x55')]===0x0){return db[_0xa5aa('0x28')][_0xa5aa('0x4e')]({'name':_0x348680[_0xa5aa('0x2c')],'resourceId':_0x348680['id'],'type':_0x52a889[_0xa5aa('0x2c')],'sectionId':_0x52a889['id']},{})['then'](function(){return _0x3a1919;});}else{return _0x3a1919;}})[_0xa5aa('0x4a')](function(_0x36257e){logger[_0xa5aa('0x2a')](_0xa5aa('0x56'),_0x36257e);throw _0x36257e;});}return _0x3a1919;})[_0xa5aa('0x24')](respondWithResult(_0x234e97,0xc9))[_0xa5aa('0x4a')](handleError(_0x234e97,null));};exports[_0xa5aa('0x57')]=function(_0x250c92,_0x8195e5){if(_0x250c92[_0xa5aa('0x4f')]['id']){delete _0x250c92[_0xa5aa('0x4f')]['id'];}return db[_0xa5aa('0x2f')][_0xa5aa('0x4d')]({'where':{'id':_0x250c92[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](handleEntityNotFound(_0x8195e5,null))['then'](saveUpdates(_0x250c92[_0xa5aa('0x4f')],null))['then'](respondWithResult(_0x8195e5,null))[_0xa5aa('0x4a')](handleError(_0x8195e5,null));};exports[_0xa5aa('0x25')]=function(_0xa9fde1,_0x34e9e2){return db[_0xa5aa('0x2f')][_0xa5aa('0x4d')]({'where':{'id':_0xa9fde1['params']['id']}})[_0xa5aa('0x24')](handleEntityNotFound(_0x34e9e2,null))[_0xa5aa('0x24')](removeEntity(_0x34e9e2,null))[_0xa5aa('0x4a')](handleError(_0x34e9e2,null));};exports['describe']=function(_0x55e7de,_0x5ba65f){return db[_0xa5aa('0x2f')][_0xa5aa('0x58')]()[_0xa5aa('0x24')](respondWithResult(_0x5ba65f,null))[_0xa5aa('0x4a')](handleError(_0x5ba65f,null));};exports[_0xa5aa('0x59')]=function(_0x118586,_0x1918a1,_0x2254e4){var _0x215fc1={'raw':!![],'where':{}},_0x1493e4={},_0xc9ac85;return db['SmsQueue'][_0xa5aa('0x5a')]({'where':{'id':_0x118586[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](handleEntityNotFound(_0x1918a1,null))['then'](function(_0x21656e){if(_0x21656e){_0xc9ac85=_0x21656e['get']({'plain':!![]});_0x1493e4[_0xa5aa('0x34')]=_[_0xa5aa('0x36')](db['UserSmsQueue']['rawAttributes']);_0x1493e4[_0xa5aa('0x35')]=_[_0xa5aa('0x36')](_0x118586[_0xa5aa('0x35')]);_0x1493e4[_0xa5aa('0x37')]=_[_0xa5aa('0x38')](_0x1493e4[_0xa5aa('0x34')],_0x1493e4[_0xa5aa('0x35')]);_0x215fc1[_0xa5aa('0x39')]=_['intersection'](_0x1493e4[_0xa5aa('0x34')],qs[_0xa5aa('0x3a')](_0x118586[_0xa5aa('0x35')][_0xa5aa('0x3a')]));_0x215fc1[_0xa5aa('0x39')]=_0x215fc1[_0xa5aa('0x39')][_0xa5aa('0x3b')]?_0x215fc1[_0xa5aa('0x39')]:_0x1493e4['model'];if(!_0x118586[_0xa5aa('0x35')][_0xa5aa('0x3c')](_0xa5aa('0x3d'))){_0x215fc1[_0xa5aa('0x3e')]=qs['limit'](_0x118586[_0xa5aa('0x35')][_0xa5aa('0x3e')]);_0x215fc1[_0xa5aa('0x1f')]=qs[_0xa5aa('0x1f')](_0x118586[_0xa5aa('0x35')][_0xa5aa('0x1f')]);}_0x215fc1['order']=qs[_0xa5aa('0x40')](_0x118586['query'][_0xa5aa('0x40')]);_0x215fc1['where']=qs[_0xa5aa('0x37')](_[_0xa5aa('0x42')](_0x118586[_0xa5aa('0x35')],_0x1493e4[_0xa5aa('0x37')]));_0x215fc1[_0xa5aa('0x41')]['SmsQueueId']=_0x21656e['id'];if(_0x118586[_0xa5aa('0x35')][_0xa5aa('0x43')]){_0x215fc1[_0xa5aa('0x41')]=_[_0xa5aa('0x44')](_0x215fc1['where'],{'$or':_[_0xa5aa('0x2e')](_0x215fc1[_0xa5aa('0x39')],function(_0x23fcce){var _0x2c8349={};_0x2c8349[_0x23fcce]={'$like':'%'+_0x118586[_0xa5aa('0x35')][_0xa5aa('0x43')]+'%'};return _0x2c8349;})});}_0x215fc1=_[_0xa5aa('0x44')]({},_0x215fc1,_0x118586['options']);return db[_0xa5aa('0x5b')][_0xa5aa('0x49')](_0x215fc1);}})[_0xa5aa('0x24')](function(_0x31db36){if(_0x31db36){return db['User']['findAndCountAll']({'where':{'id':_[_0xa5aa('0x2e')](_0x31db36,_0xa5aa('0x5c')),'role':'agent'},'attributes':['id',_0xa5aa('0x2c'),_0xa5aa('0x5d'),'updatedAt','createdAt']});}})[_0xa5aa('0x24')](function(_0x1de086){if(_0x1de086){return{'count':_0x1de086[_0xa5aa('0x47')],'rows':_[_0xa5aa('0x2e')](_0x1de086[_0xa5aa('0x5e')],function(_0x3cb023){return{'membername':_0x3cb023[_0xa5aa('0x2c')],'UserId':_0x3cb023['id'],'queue_name':_0xc9ac85['name'],'SmsQueueId':_0xc9ac85['id'],'interface':util[_0xa5aa('0x5f')]('%s/%s',_0xa5aa('0x60'),_0x3cb023['name']),'penalty':0x0,'paused':_0x3cb023[_0xa5aa('0x5d')],'createdAt':_0x3cb023['createdAt'],'updatedAt':_0x3cb023[_0xa5aa('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1918a1,_0x215fc1))['catch'](handleError(_0x1918a1,null));};exports[_0xa5aa('0x62')]=function(_0x36e960,_0x408e09,_0x10d24a){var _0x2d7c98={};var _0x4a308c={};var _0x5b44d9;var _0x16d57d;return db[_0xa5aa('0x2f')][_0xa5aa('0x5a')]({'where':{'id':_0x36e960[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](handleEntityNotFound(_0x408e09,null))[_0xa5aa('0x24')](function(_0x5c7ee7){if(_0x5c7ee7){_0x5b44d9=_0x5c7ee7;_0x4a308c['model']=_[_0xa5aa('0x36')](db[_0xa5aa('0x63')][_0xa5aa('0x30')]);_0x4a308c[_0xa5aa('0x35')]=_[_0xa5aa('0x36')](_0x36e960[_0xa5aa('0x35')]);_0x4a308c['filters']=_[_0xa5aa('0x38')](_0x4a308c[_0xa5aa('0x34')],_0x4a308c[_0xa5aa('0x35')]);_0x2d7c98[_0xa5aa('0x39')]=_[_0xa5aa('0x38')](_0x4a308c[_0xa5aa('0x34')],qs['fields'](_0x36e960[_0xa5aa('0x35')][_0xa5aa('0x3a')]));_0x2d7c98[_0xa5aa('0x39')]=_0x2d7c98[_0xa5aa('0x39')]['length']?_0x2d7c98[_0xa5aa('0x39')]:_0x4a308c[_0xa5aa('0x34')];_0x2d7c98['order']=qs[_0xa5aa('0x40')](_0x36e960[_0xa5aa('0x35')][_0xa5aa('0x40')]);_0x2d7c98[_0xa5aa('0x41')]=qs[_0xa5aa('0x37')](_[_0xa5aa('0x42')](_0x36e960[_0xa5aa('0x35')],_0x4a308c[_0xa5aa('0x37')]));if(_0x36e960['query']['filter']){_0x2d7c98[_0xa5aa('0x41')]=_[_0xa5aa('0x44')](_0x2d7c98[_0xa5aa('0x41')],{'$or':_['map'](_0x2d7c98[_0xa5aa('0x39')],function(_0x1b3090){var _0x40ff0c={};_0x40ff0c[_0x1b3090]={'$like':'%'+_0x36e960[_0xa5aa('0x35')][_0xa5aa('0x43')]+'%'};return _0x40ff0c;})});}_0x2d7c98=_['merge']({},_0x2d7c98,_0x36e960[_0xa5aa('0x46')]);return _0x5b44d9[_0xa5aa('0x62')](_0x2d7c98);}})[_0xa5aa('0x24')](function(_0x1ad4b2){if(_0x1ad4b2){_0x16d57d=_0x1ad4b2[_0xa5aa('0x3b')];if(!_0x36e960[_0xa5aa('0x35')][_0xa5aa('0x3c')]('nolimit')){_0x2d7c98[_0xa5aa('0x3e')]=qs[_0xa5aa('0x3e')](_0x36e960[_0xa5aa('0x35')][_0xa5aa('0x3e')]);_0x2d7c98['offset']=qs[_0xa5aa('0x1f')](_0x36e960[_0xa5aa('0x35')]['offset']);}return _0x5b44d9[_0xa5aa('0x62')](_0x2d7c98);}})[_0xa5aa('0x24')](function(_0x3d0c5a){if(_0x3d0c5a){return _0x3d0c5a?{'count':_0x16d57d,'rows':_0x3d0c5a}:null;}})[_0xa5aa('0x24')](respondWithResult(_0x408e09,null))[_0xa5aa('0x4a')](handleError(_0x408e09,null));};exports['addTeams']=function(_0x422504,_0x18364d,_0x42c41e){var _0x5f465e=_0x422504['body'][_0xa5aa('0x64')];return db[_0xa5aa('0x63')]['findAll']({'where':{'id':_0x5f465e},'attributes':['id'],'include':[{'model':db[_0xa5aa('0x65')],'as':_0xa5aa('0x66'),'attributes':['id',_0xa5aa('0x2c'),_0xa5aa('0x67'),'voicePause',_0xa5aa('0x68')],'raw':!![]}]})[_0xa5aa('0x24')](function(_0x1edcb5){if(_0x1edcb5){var _0x3ff123=_['flatMap'](_0x1edcb5,function(_0x21415e){var _0x34a9e1=_0x21415e[_0xa5aa('0x26')]({'plain':!![]});return _0x34a9e1['Agents'];});return db[_0xa5aa('0x2f')]['find']({'where':{'id':_0x422504[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](function(_0x115569){return db[_0xa5aa('0x69')]['transaction'](function(_0x5b0204){return _0x115569[_0xa5aa('0x6a')](_0x5f465e,{'transaction':_0x5b0204})['then'](function(){return BPromise['each'](_0x3ff123,function(_0xa86b55){return db[_0xa5aa('0x5b')]['findOrCreate']({'where':{'UserId':_0xa86b55['id'],'SmsQueueId':_0x422504['params']['id']},'transaction':_0x5b0204});});})['then'](function(){_0x3ff123[_0xa5aa('0x6b')](function(_0x4853a3){socket['emit']('userSmsQueue:save',{'UserId':_0x4853a3['id'],'SmsQueueId':_0x115569['id']});});});});});}})[_0xa5aa('0x24')](respondWithStatusCode(_0x18364d,null))[_0xa5aa('0x4a')](handleError(_0x18364d,null));};exports[_0xa5aa('0x6c')]=function(_0xd6eec2,_0x1632cc,_0x9a17a5){return db[_0xa5aa('0x63')][_0xa5aa('0x49')]({'where':{'id':_0xd6eec2[_0xa5aa('0x35')][_0xa5aa('0x64')]},'attributes':['id'],'include':[{'model':db[_0xa5aa('0x65')],'as':_0xa5aa('0x66'),'attributes':['id'],'raw':!![]}]})[_0xa5aa('0x24')](handleEntityNotFound(_0x1632cc,null))[_0xa5aa('0x24')](function(_0x3fcebf){var _0x3b95ff=_['map'](_0x3fcebf,'id');var _0x266832=[];var _0x47e9f8=[];var _0x49f136=squel[_0xa5aa('0x6d')]();_0x49f136[_0xa5aa('0x6e')]('tq.TeamId')['from'](_0xa5aa('0x6f'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa5aa('0x70'),_0xd6eec2[_0xa5aa('0x4c')]['id']);for(var _0x80edd7=0x0;_0x80edd7<_0x3fcebf[_0xa5aa('0x3b')];_0x80edd7+=0x1){let _0x1386bc=_0x3fcebf[_0x80edd7];for(var _0x242967=0x0;_0x242967<_0x1386bc[_0xa5aa('0x66')]['length'];_0x242967+=0x1){let _0x4976fa=_0x1386bc[_0xa5aa('0x66')][_0x242967];var _0x8efa37=_0x49f136[_0xa5aa('0x71')]();_0x8efa37[_0xa5aa('0x41')](_0xa5aa('0x72'),_0x4976fa['id']);_0x47e9f8['push'](db[_0xa5aa('0x69')][_0xa5aa('0x35')](_0x8efa37['toString'](),{'type':db[_0xa5aa('0x69')][_0xa5aa('0x73')][_0xa5aa('0x74')]})['then'](function(_0x50d68b){if(_0x50d68b[_0xa5aa('0x3b')]===0x1){return _0x4976fa['id'];}else{var _0x448ac8=_[_0xa5aa('0x75')](_[_0xa5aa('0x2e')](_0x50d68b,'TeamId'),function(_0x4bd27a){return _['includes'](_0x3b95ff,_0x4bd27a);});if(_0x448ac8){return _0x4976fa['id'];}}}));}}return BPromise['all'](_0x47e9f8)[_0xa5aa('0x24')](function(_0x41cb84){_0x266832=_(_0x266832)[_0xa5aa('0x76')](_0x41cb84)[_0xa5aa('0x77')]()['value']();return db[_0xa5aa('0x2f')][_0xa5aa('0x4d')]({'where':{'id':_0xd6eec2[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](function(_0x3ba545){return db['sequelize']['transaction'](function(_0x5a742f){return _0x3ba545[_0xa5aa('0x6c')](_0xd6eec2[_0xa5aa('0x35')][_0xa5aa('0x64')],{'transaction':_0x5a742f})[_0xa5aa('0x24')](function(){if(!_[_0xa5aa('0x78')](_0x266832)){return _0x3ba545[_0xa5aa('0x79')](_0x266832,{'transaction':_0x5a742f});}})[_0xa5aa('0x24')](function(){_0x266832[_0xa5aa('0x6b')](function(_0x2dd849){socket[_0xa5aa('0x7a')](_0xa5aa('0x7b'),{'UserId':_0x2dd849,'SmsQueueId':_0x3ba545['id']});});});});});});})['then'](respondWithStatusCode(_0x1632cc,null))[_0xa5aa('0x4a')](handleError(_0x1632cc,null));};exports[_0xa5aa('0x7c')]=function(_0x3d1998,_0x1b4960,_0x21896f){return db[_0xa5aa('0x2f')][_0xa5aa('0x4d')]({'where':{'id':_0x3d1998[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](handleEntityNotFound(_0x1b4960,null))[_0xa5aa('0x24')](function(_0x1e33b8){if(_0x1e33b8){return _0x1e33b8[_0xa5aa('0x7c')](_0x3d1998[_0xa5aa('0x4f')][_0xa5aa('0x64')],_[_0xa5aa('0x7d')](_0x3d1998[_0xa5aa('0x4f')],['ids','id'])||{})[_0xa5aa('0x7e')](function(_0x173288){for(var _0x4c4cb6=0x0;_0x4c4cb6<_0x3d1998['body'][_0xa5aa('0x64')][_0xa5aa('0x3b')];_0x4c4cb6+=0x1){socket[_0xa5aa('0x7a')]('userSmsQueue:save',{'UserId':Number(_0x3d1998[_0xa5aa('0x4f')]['ids'][_0x4c4cb6]),'SmsQueueId':Number(_0x3d1998[_0xa5aa('0x4c')]['id'])});}return _0x173288;});}})[_0xa5aa('0x24')](respondWithResult(_0x1b4960,null))[_0xa5aa('0x4a')](handleError(_0x1b4960,null));};exports['removeAgents']=function(_0x2f0237,_0x25d7ef,_0x333a05){return db['SmsQueue'][_0xa5aa('0x4d')]({'where':{'id':_0x2f0237[_0xa5aa('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25d7ef,null))['then'](function(_0x5a3d17){if(_0x5a3d17){return _0x5a3d17[_0xa5aa('0x79')](_0x2f0237['query'][_0xa5aa('0x64')])[_0xa5aa('0x24')](function(){if(_[_0xa5aa('0x7f')](_0x2f0237[_0xa5aa('0x35')][_0xa5aa('0x64')])){for(var _0x159b63=0x0;_0x159b63<_0x2f0237[_0xa5aa('0x35')]['ids']['length'];_0x159b63+=0x1){socket['emit'](_0xa5aa('0x7b'),{'UserId':Number(_0x2f0237[_0xa5aa('0x35')][_0xa5aa('0x64')][_0x159b63]),'SmsQueueId':Number(_0x2f0237['params']['id'])});}}else{socket[_0xa5aa('0x7a')](_0xa5aa('0x7b'),{'UserId':Number(_0x2f0237[_0xa5aa('0x35')][_0xa5aa('0x64')]),'SmsQueueId':Number(_0x2f0237[_0xa5aa('0x4c')]['id'])});}});}})[_0xa5aa('0x24')](respondWithStatusCode(_0x25d7ef,null))[_0xa5aa('0x4a')](handleError(_0x25d7ef,null));};exports[_0xa5aa('0x80')]=function(_0x2ea1e2,_0x38c3ad,_0x40a459){var _0x5b17d8={};var _0xf95096={};var _0x58f9d1;var _0x317552;return db[_0xa5aa('0x2f')][_0xa5aa('0x5a')]({'where':{'id':_0x2ea1e2[_0xa5aa('0x4c')]['id']}})[_0xa5aa('0x24')](handleEntityNotFound(_0x38c3ad,null))[_0xa5aa('0x24')](function(_0x4b737c){if(_0x4b737c){_0x58f9d1=_0x4b737c;_0xf95096[_0xa5aa('0x34')]=_[_0xa5aa('0x36')](db['User'][_0xa5aa('0x30')]);_0xf95096[_0xa5aa('0x35')]=_[_0xa5aa('0x36')](_0x2ea1e2[_0xa5aa('0x35')]);_0xf95096[_0xa5aa('0x37')]=_[_0xa5aa('0x38')](_0xf95096[_0xa5aa('0x34')],_0xf95096[_0xa5aa('0x35')]);_0x5b17d8[_0xa5aa('0x39')]=_[_0xa5aa('0x38')](_0xf95096[_0xa5aa('0x34')],qs[_0xa5aa('0x3a')](_0x2ea1e2['query']['fields']));_0x5b17d8[_0xa5aa('0x39')]=_0x5b17d8['attributes'][_0xa5aa('0x3b')]?_0x5b17d8[_0xa5aa('0x39')]:_0xf95096[_0xa5aa('0x34')];_0x5b17d8['order']=qs[_0xa5aa('0x40')](_0x2ea1e2[_0xa5aa('0x35')][_0xa5aa('0x40')]);_0x5b17d8[_0xa5aa('0x41')]=qs[_0xa5aa('0x37')](_[_0xa5aa('0x42')](_0x2ea1e2[_0xa5aa('0x35')],_0xf95096[_0xa5aa('0x37')]));if(_0x2ea1e2[_0xa5aa('0x35')][_0xa5aa('0x43')]){_0x5b17d8[_0xa5aa('0x41')]=_[_0xa5aa('0x44')](_0x5b17d8[_0xa5aa('0x41')],{'$or':_[_0xa5aa('0x2e')](_0x5b17d8['attributes'],function(_0x450be6){var _0x2e01c4={};_0x2e01c4[_0x450be6]={'$like':'%'+_0x2ea1e2[_0xa5aa('0x35')]['filter']+'%'};return _0x2e01c4;})});}_0x5b17d8=_[_0xa5aa('0x44')]({},_0x5b17d8,_0x2ea1e2[_0xa5aa('0x46')]);return _0x58f9d1[_0xa5aa('0x80')](_0x5b17d8);}})[_0xa5aa('0x24')](function(_0x4629b0){if(_0x4629b0){_0x317552=_0x4629b0['length'];if(!_0x2ea1e2[_0xa5aa('0x35')][_0xa5aa('0x3c')](_0xa5aa('0x3d'))){_0x5b17d8[_0xa5aa('0x3e')]=qs[_0xa5aa('0x3e')](_0x2ea1e2['query'][_0xa5aa('0x3e')]);_0x5b17d8['offset']=qs[_0xa5aa('0x1f')](_0x2ea1e2[_0xa5aa('0x35')][_0xa5aa('0x1f')]);}return _0x58f9d1[_0xa5aa('0x80')](_0x5b17d8);}})[_0xa5aa('0x24')](function(_0x2a8248){if(_0x2a8248){return _0x2a8248?{'count':_0x317552,'rows':_0x2a8248}:null;}})[_0xa5aa('0x24')](respondWithResult(_0x38c3ad,null))[_0xa5aa('0x4a')](handleError(_0x38c3ad,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index e9ee321..8a3683f 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 _0x556b=['save','update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x556b,0x1a9));var _0xb556=function(_0x434d18,_0x27f45c){_0x434d18=_0x434d18-0x0;var _0x3a5f1a=_0x556b[_0x434d18];return _0x3a5f1a;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xb556('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb556('0x1')](0x0);var events={'afterCreate':_0xb556('0x2'),'afterUpdate':_0xb556('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3559f5){return function(_0xc694c1,_0x1ad80d,_0x3521fe){SmsQueueEvents[_0xb556('0x4')](_0x3559f5+':'+_0xc694c1['id'],_0xc694c1);SmsQueueEvents[_0xb556('0x4')](_0x3559f5,_0xc694c1);_0x3521fe(null);};}for(var e in events){if(events[_0xb556('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xb556('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x1879=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1879,0x10a));var _0x9187=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x1879[_0xa388a2];return _0x7ce7f6;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9187('0x0')](0x0);var events={'afterCreate':_0x9187('0x1'),'afterUpdate':_0x9187('0x2'),'afterDestroy':_0x9187('0x3')};function emitEvent(_0x553e6a){return function(_0x422deb,_0x126a1d,_0x493867){SmsQueueEvents['emit'](_0x553e6a+':'+_0x422deb['id'],_0x422deb);SmsQueueEvents['emit'](_0x553e6a,_0x422deb);_0x493867(null);};}for(var e in events){if(events[_0x9187('0x4')](e)){var event=events[e];SmsQueue[_0x9187('0x5')](e,emitEvent(event));}}module[_0x9187('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 66cd474..ee5570c 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 _0xc5be=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','path','../../config/environment','./smsQueue.attributes','exports'];(function(_0x45b2ac,_0x3010da){var _0x304bf3=function(_0x486ac1){while(--_0x486ac1){_0x45b2ac['push'](_0x45b2ac['shift']());}};_0x304bf3(++_0x3010da);}(_0xc5be,0x1c5));var _0xec5b=function(_0x3b1b23,_0x21bccd){_0x3b1b23=_0x3b1b23-0x0;var _0x1efc85=_0xc5be[_0x3b1b23];return _0x1efc85;};'use strict';var _=require(_0xec5b('0x0'));var util=require(_0xec5b('0x1'));var logger=require(_0xec5b('0x2'))(_0xec5b('0x3'));var moment=require(_0xec5b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xec5b('0x5'));var rimraf=require('rimraf');var config=require(_0xec5b('0x6'));var attributes=require(_0xec5b('0x7'));module[_0xec5b('0x8')]=function(_0x567b29,_0x1996fc){return _0x567b29['define'](_0xec5b('0x9'),attributes,{'tableName':_0xec5b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f04=['exports','SmsQueue','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./smsQueue.attributes'];(function(_0x20daac,_0x3250ac){var _0x278491=function(_0x443857){while(--_0x443857){_0x20daac['push'](_0x20daac['shift']());}};_0x278491(++_0x3250ac);}(_0x8f04,0x12e));var _0x48f0=function(_0x2dc621,_0x1c3969){_0x2dc621=_0x2dc621-0x0;var _0x2a1369=_0x8f04[_0x2dc621];return _0x2a1369;};'use strict';var _=require(_0x48f0('0x0'));var util=require(_0x48f0('0x1'));var logger=require(_0x48f0('0x2'))('api');var moment=require(_0x48f0('0x3'));var BPromise=require(_0x48f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48f0('0x5'));var rimraf=require(_0x48f0('0x6'));var config=require('../../config/environment');var attributes=require(_0x48f0('0x7'));module[_0x48f0('0x8')]=function(_0x176c28,_0x2392ed){return _0x176c28['define'](_0x48f0('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 6d04921..c3c639f 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 _0x2c87=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowSmsQueue','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x3f79c4,_0x2740e2){var _0x107d83=function(_0x1729b5){while(--_0x1729b5){_0x3f79c4['push'](_0x3f79c4['shift']());}};_0x107d83(++_0x2740e2);}(_0x2c87,0x76));var _0x72c8=function(_0x78baf6,_0x23b9b7){_0x78baf6=_0x78baf6-0x0;var _0x1c04a3=_0x2c87[_0x78baf6];return _0x1c04a3;};'use strict';var _=require(_0x72c8('0x0'));var util=require(_0x72c8('0x1'));var moment=require(_0x72c8('0x2'));var BPromise=require(_0x72c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72c8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x72c8('0x5'))('rpc');var config=require(_0x72c8('0x6'));var jayson=require(_0x72c8('0x7'));var client=jayson[_0x72c8('0x8')][_0x72c8('0x9')]({'port':0x232a});config[_0x72c8('0xa')]=_[_0x72c8('0xb')](config['redis'],{'host':_0x72c8('0xc'),'port':0x18eb});var socket=require(_0x72c8('0xd'))(new Redis(config[_0x72c8('0xa')]));require(_0x72c8('0xe'))[_0x72c8('0xf')](socket);function respondWithRpcPromise(_0x56ee5b,_0x238ff1,_0x784ec9){return new BPromise(function(_0x4d2606,_0x233785){return client[_0x72c8('0x10')](_0x56ee5b,_0x784ec9)[_0x72c8('0x11')](function(_0x10afc9){logger[_0x72c8('0x12')](_0x72c8('0x13'),_0x238ff1,_0x72c8('0x14'));logger[_0x72c8('0x15')](_0x72c8('0x16'),_0x238ff1,_0x72c8('0x14'),JSON[_0x72c8('0x17')](_0x10afc9));if(_0x10afc9[_0x72c8('0x18')]){if(_0x10afc9[_0x72c8('0x18')][_0x72c8('0x19')]===0x1f4){logger[_0x72c8('0x18')](_0x72c8('0x13'),_0x238ff1,_0x10afc9[_0x72c8('0x18')][_0x72c8('0x1a')]);return _0x233785(_0x10afc9[_0x72c8('0x18')][_0x72c8('0x1a')]);}logger[_0x72c8('0x18')](_0x72c8('0x13'),_0x238ff1,_0x10afc9['error'][_0x72c8('0x1a')]);return _0x4d2606(_0x10afc9[_0x72c8('0x18')]['message']);}else{logger[_0x72c8('0x12')](_0x72c8('0x13'),_0x238ff1,'request\x20sent');_0x4d2606(_0x10afc9[_0x72c8('0x1b')][_0x72c8('0x1a')]);}})['catch'](function(_0x10ba8f){logger['error']('SmsQueue,\x20%s,\x20%s',_0x238ff1,_0x10ba8f);_0x233785(_0x10ba8f);});});}exports[_0x72c8('0x1c')]=function(_0x2f9fd8){var _0x49152b=this;return new Promise(function(_0x415ca8,_0x20961c){return db[_0x72c8('0x1d')][_0x72c8('0x1e')]({'raw':_0x2f9fd8[_0x72c8('0x1f')]?_0x2f9fd8[_0x72c8('0x1f')][_0x72c8('0x20')]===undefined?!![]:![]:!![],'where':_0x2f9fd8['options']?_0x2f9fd8[_0x72c8('0x1f')][_0x72c8('0x21')]||null:null,'attributes':_0x2f9fd8['options']?_0x2f9fd8[_0x72c8('0x1f')]['attributes']||null:null,'limit':_0x2f9fd8[_0x72c8('0x1f')]?_0x2f9fd8[_0x72c8('0x1f')][_0x72c8('0x22')]||null:null,'include':_0x2f9fd8[_0x72c8('0x1f')]?_0x2f9fd8[_0x72c8('0x1f')][_0x72c8('0x23')]?_[_0x72c8('0x24')](_0x2f9fd8[_0x72c8('0x1f')][_0x72c8('0x23')],function(_0x34c9a2){return{'model':db[_0x34c9a2[_0x72c8('0x25')]],'as':_0x34c9a2['as'],'attributes':_0x34c9a2[_0x72c8('0x26')],'include':_0x34c9a2['include']?_[_0x72c8('0x24')](_0x34c9a2[_0x72c8('0x23')],function(_0x192ead){return{'model':db[_0x192ead['model']],'as':_0x192ead['as'],'attributes':_0x192ead[_0x72c8('0x26')],'include':_0x192ead[_0x72c8('0x23')]?_['map'](_0x192ead[_0x72c8('0x23')],function(_0x3090ba){return{'model':db[_0x3090ba['model']],'as':_0x3090ba['as'],'attributes':_0x3090ba[_0x72c8('0x26')]};}):[]};}):[]};}):[]:[]})[_0x72c8('0x11')](function(_0x309bad){logger[_0x72c8('0x12')](_0x72c8('0x1c'),_0x2f9fd8);logger[_0x72c8('0x15')](_0x72c8('0x1c'),_0x2f9fd8,JSON[_0x72c8('0x17')](_0x309bad));_0x415ca8(_0x309bad);})['catch'](function(_0xbe5b6a){logger[_0x72c8('0x18')](_0x72c8('0x1c'),_0xbe5b6a[_0x72c8('0x1a')],_0x2f9fd8);_0x20961c(_0x49152b[_0x72c8('0x18')](0x1f4,_0xbe5b6a[_0x72c8('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x1143e4){var _0x15ca7d=this;return new Promise(function(_0x5ffc5,_0x38652a){return db['SmsQueue'][_0x72c8('0x27')]({'raw':_0x1143e4[_0x72c8('0x1f')]?_0x1143e4['options'][_0x72c8('0x20')]===undefined?!![]:![]:!![],'where':_0x1143e4['options']?_0x1143e4['options'][_0x72c8('0x21')]||null:null,'attributes':_0x1143e4[_0x72c8('0x1f')]?_0x1143e4[_0x72c8('0x1f')]['attributes']||null:null,'include':_0x1143e4[_0x72c8('0x1f')]?_0x1143e4['options'][_0x72c8('0x23')]?_[_0x72c8('0x24')](_0x1143e4[_0x72c8('0x1f')][_0x72c8('0x23')],function(_0x37ac48){return{'model':db[_0x37ac48['model']],'as':_0x37ac48['as'],'attributes':_0x37ac48[_0x72c8('0x26')],'include':_0x37ac48[_0x72c8('0x23')]?_[_0x72c8('0x24')](_0x37ac48['include'],function(_0x434107){return{'model':db[_0x434107[_0x72c8('0x25')]],'as':_0x434107['as'],'attributes':_0x434107[_0x72c8('0x26')],'include':_0x434107['include']?_[_0x72c8('0x24')](_0x434107[_0x72c8('0x23')],function(_0x3d101e){return{'model':db[_0x3d101e[_0x72c8('0x25')]],'as':_0x3d101e['as'],'attributes':_0x3d101e[_0x72c8('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b3bbb){logger['info'](_0x72c8('0x28'),_0x1143e4);logger['debug']('ShowSmsQueue',_0x1143e4,JSON[_0x72c8('0x17')](_0x5b3bbb));_0x5ffc5(_0x5b3bbb);})['catch'](function(_0x38c947){logger[_0x72c8('0x18')]('ShowSmsQueue',_0x38c947['message'],_0x1143e4);_0x38652a(_0x15ca7d[_0x72c8('0x18')](0x1f4,_0x38c947[_0x72c8('0x1a')]));});});}; \ No newline at end of file +var _0x7eb7=['localhost','socket.io-emitter','./smsQueue.socket','request','then','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','message','error','info','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','find','ShowSmsQueue','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x4353b9,_0x1e8c39){var _0x4ccfa3=function(_0x4d3fde){while(--_0x4d3fde){_0x4353b9['push'](_0x4353b9['shift']());}};_0x4ccfa3(++_0x1e8c39);}(_0x7eb7,0x83));var _0x77eb=function(_0x3af2d7,_0x4b4633){_0x3af2d7=_0x3af2d7-0x0;var _0xe445ac=_0x7eb7[_0x3af2d7];return _0xe445ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x77eb('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x77eb('0x1'));var logger=require(_0x77eb('0x2'))(_0x77eb('0x3'));var config=require(_0x77eb('0x4'));var jayson=require(_0x77eb('0x5'));var client=jayson[_0x77eb('0x6')]['http']({'port':0x232a});config[_0x77eb('0x7')]=_[_0x77eb('0x8')](config[_0x77eb('0x7')],{'host':_0x77eb('0x9'),'port':0x18eb});var socket=require(_0x77eb('0xa'))(new Redis(config[_0x77eb('0x7')]));require(_0x77eb('0xb'))['register'](socket);function respondWithRpcPromise(_0x36faff,_0x5f2ec0,_0x4e9ed5){return new BPromise(function(_0x3f05ed,_0x5441ec){return client[_0x77eb('0xc')](_0x36faff,_0x4e9ed5)[_0x77eb('0xd')](function(_0x43c2cf){logger['info'](_0x77eb('0xe'),_0x5f2ec0,'request\x20sent');logger[_0x77eb('0xf')](_0x77eb('0x10'),_0x5f2ec0,_0x77eb('0x11'),JSON[_0x77eb('0x12')](_0x43c2cf));if(_0x43c2cf['error']){if(_0x43c2cf['error']['code']===0x1f4){logger['error'](_0x77eb('0xe'),_0x5f2ec0,_0x43c2cf['error'][_0x77eb('0x13')]);return _0x5441ec(_0x43c2cf[_0x77eb('0x14')][_0x77eb('0x13')]);}logger[_0x77eb('0x14')](_0x77eb('0xe'),_0x5f2ec0,_0x43c2cf['error']['message']);return _0x3f05ed(_0x43c2cf[_0x77eb('0x14')][_0x77eb('0x13')]);}else{logger[_0x77eb('0x15')](_0x77eb('0xe'),_0x5f2ec0,_0x77eb('0x11'));_0x3f05ed(_0x43c2cf['result']['message']);}})[_0x77eb('0x16')](function(_0x46258e){logger['error']('SmsQueue,\x20%s,\x20%s',_0x5f2ec0,_0x46258e);_0x5441ec(_0x46258e);});});}exports[_0x77eb('0x17')]=function(_0x534355){var _0x2614f5=this;return new Promise(function(_0xe3b470,_0x2356fa){return db[_0x77eb('0x18')]['findAll']({'raw':_0x534355[_0x77eb('0x19')]?_0x534355['options'][_0x77eb('0x1a')]===undefined?!![]:![]:!![],'where':_0x534355[_0x77eb('0x19')]?_0x534355[_0x77eb('0x19')][_0x77eb('0x1b')]||null:null,'attributes':_0x534355[_0x77eb('0x19')]?_0x534355[_0x77eb('0x19')][_0x77eb('0x1c')]||null:null,'limit':_0x534355[_0x77eb('0x19')]?_0x534355[_0x77eb('0x19')][_0x77eb('0x1d')]||null:null,'include':_0x534355[_0x77eb('0x19')]?_0x534355['options'][_0x77eb('0x1e')]?_['map'](_0x534355[_0x77eb('0x19')][_0x77eb('0x1e')],function(_0x216328){return{'model':db[_0x216328['model']],'as':_0x216328['as'],'attributes':_0x216328['attributes'],'include':_0x216328[_0x77eb('0x1e')]?_[_0x77eb('0x1f')](_0x216328[_0x77eb('0x1e')],function(_0x4ccbea){return{'model':db[_0x4ccbea[_0x77eb('0x20')]],'as':_0x4ccbea['as'],'attributes':_0x4ccbea['attributes'],'include':_0x4ccbea['include']?_[_0x77eb('0x1f')](_0x4ccbea[_0x77eb('0x1e')],function(_0x55d829){return{'model':db[_0x55d829[_0x77eb('0x20')]],'as':_0x55d829['as'],'attributes':_0x55d829['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1943de){logger['info'](_0x77eb('0x17'),_0x534355);logger[_0x77eb('0xf')](_0x77eb('0x17'),_0x534355,JSON[_0x77eb('0x12')](_0x1943de));_0xe3b470(_0x1943de);})[_0x77eb('0x16')](function(_0x4d9018){logger[_0x77eb('0x14')](_0x77eb('0x17'),_0x4d9018[_0x77eb('0x13')],_0x534355);_0x2356fa(_0x2614f5['error'](0x1f4,_0x4d9018[_0x77eb('0x13')]));});});};exports['ShowSmsQueue']=function(_0x21a529){var _0x17ce19=this;return new Promise(function(_0xe2d44a,_0x4f4fbd){return db[_0x77eb('0x18')][_0x77eb('0x21')]({'raw':_0x21a529[_0x77eb('0x19')]?_0x21a529[_0x77eb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x21a529['options']?_0x21a529[_0x77eb('0x19')][_0x77eb('0x1b')]||null:null,'attributes':_0x21a529[_0x77eb('0x19')]?_0x21a529[_0x77eb('0x19')][_0x77eb('0x1c')]||null:null,'include':_0x21a529[_0x77eb('0x19')]?_0x21a529[_0x77eb('0x19')][_0x77eb('0x1e')]?_[_0x77eb('0x1f')](_0x21a529[_0x77eb('0x19')][_0x77eb('0x1e')],function(_0x1025e1){return{'model':db[_0x1025e1[_0x77eb('0x20')]],'as':_0x1025e1['as'],'attributes':_0x1025e1[_0x77eb('0x1c')],'include':_0x1025e1[_0x77eb('0x1e')]?_['map'](_0x1025e1[_0x77eb('0x1e')],function(_0x3876e6){return{'model':db[_0x3876e6[_0x77eb('0x20')]],'as':_0x3876e6['as'],'attributes':_0x3876e6[_0x77eb('0x1c')],'include':_0x3876e6[_0x77eb('0x1e')]?_[_0x77eb('0x1f')](_0x3876e6[_0x77eb('0x1e')],function(_0x163beb){return{'model':db[_0x163beb['model']],'as':_0x163beb['as'],'attributes':_0x163beb[_0x77eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x77eb('0xd')](function(_0x1c4add){logger[_0x77eb('0x15')]('ShowSmsQueue',_0x21a529);logger[_0x77eb('0xf')](_0x77eb('0x22'),_0x21a529,JSON[_0x77eb('0x12')](_0x1c4add));_0xe2d44a(_0x1c4add);})['catch'](function(_0x3fd2fa){logger['error'](_0x77eb('0x22'),_0x3fd2fa[_0x77eb('0x13')],_0x21a529);_0x4f4fbd(_0x17ce19[_0x77eb('0x14')](0x1f4,_0x3fd2fa[_0x77eb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index cd44c6e..e3e30f0 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 _0x605a=['smsQueue:','./smsQueue.events','remove','update','removeListener','register','length'];(function(_0x2ce92a,_0x1cadb0){var _0x25ef8b=function(_0x2394c5){while(--_0x2394c5){_0x2ce92a['push'](_0x2ce92a['shift']());}};_0x25ef8b(++_0x1cadb0);}(_0x605a,0xf6));var _0xa605=function(_0x1b2b8a,_0x221a9a){_0x1b2b8a=_0x1b2b8a-0x0;var _0xfe9ce2=_0x605a[_0x1b2b8a];return _0xfe9ce2;};'use strict';var SmsQueueEvents=require(_0xa605('0x0'));var events=['save',_0xa605('0x1'),_0xa605('0x2')];function createListener(_0x22c434,_0x3cd06a){return function(_0x29ede4){_0x3cd06a['emit'](_0x22c434,_0x29ede4);};}function removeListener(_0x4b3b36,_0x408864){return function(){SmsQueueEvents[_0xa605('0x3')](_0x4b3b36,_0x408864);};}exports[_0xa605('0x4')]=function(_0x55c0f3){for(var _0x421ade=0x0,_0x45802f=events[_0xa605('0x5')];_0x421ade<_0x45802f;_0x421ade++){var _0x289993=events[_0x421ade];var _0x204097=createListener(_0xa605('0x6')+_0x289993,_0x55c0f3);SmsQueueEvents['on'](_0x289993,_0x204097);}}; \ No newline at end of file +var _0x95b6=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x95b6,0xc2));var _0x695b=function(_0x47e777,_0x513eff){_0x47e777=_0x47e777-0x0;var _0xc7dd85=_0x95b6[_0x47e777];return _0xc7dd85;};'use strict';var SmsQueueEvents=require(_0x695b('0x0'));var events=[_0x695b('0x1'),_0x695b('0x2'),_0x695b('0x3')];function createListener(_0x276e39,_0x13991f){return function(_0x52218a){_0x13991f[_0x695b('0x4')](_0x276e39,_0x52218a);};}function removeListener(_0x10f6e3,_0x4c2a74){return function(){SmsQueueEvents[_0x695b('0x5')](_0x10f6e3,_0x4c2a74);};}exports[_0x695b('0x6')]=function(_0x53b61a){for(var _0x39edd0=0x0,_0x3c25f1=events[_0x695b('0x7')];_0x39edd0<_0x3c25f1;_0x39edd0++){var _0x58e05b=events[_0x39edd0];var _0x112e58=createListener(_0x695b('0x8')+_0x58e05b,_0x53b61a);SmsQueueEvents['on'](_0x58e05b,_0x112e58);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index bd39eec..cd1b896 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 _0x41d7=['/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsQueueReport.controller','get','index','/describe','describe','isAuthenticated','show','post','put'];(function(_0xb54672,_0x2cf1e3){var _0x39f265=function(_0x1ec256){while(--_0x1ec256){_0xb54672['push'](_0xb54672['shift']());}};_0x39f265(++_0x2cf1e3);}(_0x41d7,0x194));var _0x741d=function(_0x3bd558,_0x233368){_0x3bd558=_0x3bd558-0x0;var _0x1cfe3a=_0x41d7[_0x3bd558];return _0x1cfe3a;};'use strict';var multer=require('multer');var util=require(_0x741d('0x0'));var path=require(_0x741d('0x1'));var timeout=require(_0x741d('0x2'));var express=require(_0x741d('0x3'));var router=express[_0x741d('0x4')]();var fs_extra=require(_0x741d('0x5'));var auth=require(_0x741d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x741d('0x7'));router[_0x741d('0x8')]('/',auth['isAuthenticated'](),controller[_0x741d('0x9')]);router[_0x741d('0x8')](_0x741d('0xa'),auth['isAuthenticated'](),controller[_0x741d('0xb')]);router[_0x741d('0x8')]('/:id',auth[_0x741d('0xc')](),controller[_0x741d('0xd')]);router[_0x741d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x741d('0xf')](_0x741d('0x10'),auth[_0x741d('0xc')](),controller['update']);router[_0x741d('0x11')](_0x741d('0x10'),auth['isAuthenticated'](),controller[_0x741d('0x12')]);module[_0x741d('0x13')]=router; \ No newline at end of file +var _0xc57c=['show','post','update','delete','destroy','exports','multer','express','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x45a2b7,_0x6a3ed){var _0x206b29=function(_0x9c2069){while(--_0x9c2069){_0x45a2b7['push'](_0x45a2b7['shift']());}};_0x206b29(++_0x6a3ed);}(_0xc57c,0x149));var _0xcc57=function(_0x2a1558,_0x509c80){_0x2a1558=_0x2a1558-0x0;var _0x3917ca=_0xc57c[_0x2a1558];return _0x3917ca;};'use strict';var multer=require(_0xcc57('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc57('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcc57('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xcc57('0x3'));var controller=require(_0xcc57('0x4'));router[_0xcc57('0x5')]('/',auth[_0xcc57('0x6')](),controller[_0xcc57('0x7')]);router[_0xcc57('0x5')](_0xcc57('0x8'),auth['isAuthenticated'](),controller[_0xcc57('0x9')]);router[_0xcc57('0x5')](_0xcc57('0xa'),auth[_0xcc57('0x6')](),controller[_0xcc57('0xb')]);router[_0xcc57('0xc')]('/',auth[_0xcc57('0x6')](),controller['create']);router['put']('/:id',auth[_0xcc57('0x6')](),controller[_0xcc57('0xd')]);router[_0xcc57('0xe')](_0xcc57('0xa'),auth[_0xcc57('0x6')](),controller[_0xcc57('0xf')]);module[_0xcc57('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 2ab46cf..aa766c3 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 _0xc385=['exports','STRING','DATE','moment','sequelize'];(function(_0xcfa7b9,_0xa1cc20){var _0x8d0e7c=function(_0x3b0d0d){while(--_0x3b0d0d){_0xcfa7b9['push'](_0xcfa7b9['shift']());}};_0x8d0e7c(++_0xa1cc20);}(_0xc385,0x8a));var _0x5c38=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xc385[_0x39e283];return _0x7de89f;};'use strict';var moment=require(_0x5c38('0x0'));var Sequelize=require(_0x5c38('0x1'));module[_0x5c38('0x2')]={'uniqueid':{'type':Sequelize[_0x5c38('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5c38('0x3')]},'joinAt':{'type':Sequelize[_0x5c38('0x4')]},'leaveAt':{'type':Sequelize[_0x5c38('0x4')]},'acceptAt':{'type':Sequelize[_0x5c38('0x4')]},'exitAt':{'type':Sequelize[_0x5c38('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdbef=['sequelize','exports','STRING','DATE','moment'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xdbef,0xc2));var _0xfdbe=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xdbef[_0xf0bcac];return _0x4e4c65;};'use strict';var moment=require(_0xfdbe('0x0'));var Sequelize=require(_0xfdbe('0x1'));module[_0xfdbe('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfdbe('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfdbe('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'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 ba85eff..7804e30 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 _0x10e8=['sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0xed7856,_0xa09073){var _0x35c56f=function(_0x97fe93){while(--_0x97fe93){_0xed7856['push'](_0xed7856['shift']());}};_0x35c56f(++_0xa09073);}(_0x10e8,0x161));var _0x810e=function(_0xe86b69,_0x4c8c7a){_0xe86b69=_0xe86b69-0x0;var _0x274568=_0x10e8[_0xe86b69];return _0x274568;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x810e('0x0'));var jsonpatch=require(_0x810e('0x1'));var rp=require(_0x810e('0x2'));var moment=require(_0x810e('0x3'));var BPromise=require(_0x810e('0x4'));var Mustache=require(_0x810e('0x5'));var util=require(_0x810e('0x6'));var path=require('path');var sox=require(_0x810e('0x7'));var csv=require('to-csv');var ejs=require(_0x810e('0x8'));var fs=require('fs');var fs_extra=require(_0x810e('0x9'));var _=require(_0x810e('0xa'));var squel=require(_0x810e('0xb'));var crypto=require(_0x810e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x810e('0xd'));var querystring=require('querystring');var Papa=require(_0x810e('0xe'));var Redis=require(_0x810e('0xf'));var authService=require(_0x810e('0x10'));var qs=require(_0x810e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x810e('0x12'))(_0x810e('0x13'));var utils=require(_0x810e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x810e('0x15'))['db'];function respondWithStatusCode(_0x3da468,_0x380e0a){_0x380e0a=_0x380e0a||0xcc;return function(_0x2786e7){if(_0x2786e7){return _0x3da468[_0x810e('0x16')](_0x380e0a);}return _0x3da468[_0x810e('0x17')](_0x380e0a)[_0x810e('0x18')]();};}function respondWithResult(_0x289b1c,_0x2387e1){_0x2387e1=_0x2387e1||0xc8;return function(_0x2cef5a){if(_0x2cef5a){return _0x289b1c[_0x810e('0x17')](_0x2387e1)[_0x810e('0x19')](_0x2cef5a);}};}function respondWithFilteredResult(_0x3c2fec,_0x373ba1){return function(_0x234c13){if(_0x234c13){var _0x47ec3e=typeof _0x373ba1[_0x810e('0x1a')]==='undefined'&&typeof _0x373ba1[_0x810e('0x1b')]===_0x810e('0x1c');var _0x2f7eb1=_0x234c13[_0x810e('0x1d')];var _0x1e4d8a=_0x47ec3e?0x0:_0x373ba1['offset'];var _0x575559=_0x47ec3e?_0x234c13['count']:_0x373ba1[_0x810e('0x1a')]+_0x373ba1[_0x810e('0x1b')];var _0x3ba553;if(_0x575559>=_0x2f7eb1){_0x575559=_0x2f7eb1;_0x3ba553=0xc8;}else{_0x3ba553=0xce;}_0x3c2fec[_0x810e('0x17')](_0x3ba553);return _0x3c2fec['set'](_0x810e('0x1e'),_0x1e4d8a+'-'+_0x575559+'/'+_0x2f7eb1)[_0x810e('0x19')](_0x234c13);}return null;};}function patchUpdates(_0x3ac1e3){return function(_0x20def4){try{jsonpatch[_0x810e('0x1f')](_0x20def4,_0x3ac1e3,!![]);}catch(_0x494a80){return BPromise['reject'](_0x494a80);}return _0x20def4[_0x810e('0x20')]();};}function saveUpdates(_0x4c313c,_0x2b23d8){return function(_0xbb271e){if(_0xbb271e){return _0xbb271e[_0x810e('0x21')](_0x4c313c)['then'](function(_0x146713){return _0x146713;});}return null;};}function removeEntity(_0x195c50,_0x46e3b2){return function(_0xdb3bfb){if(_0xdb3bfb){return _0xdb3bfb[_0x810e('0x22')]()[_0x810e('0x23')](function(){_0x195c50[_0x810e('0x17')](0xcc)[_0x810e('0x18')]();});}};}function handleEntityNotFound(_0x2958f7,_0x58defb){return function(_0x31f8af){if(!_0x31f8af){_0x2958f7[_0x810e('0x16')](0x194);}return _0x31f8af;};}function handleError(_0x35e7d0,_0x2e94f9){_0x2e94f9=_0x2e94f9||0x1f4;return function(_0x26d837){logger[_0x810e('0x24')](_0x26d837[_0x810e('0x25')]);if(_0x26d837[_0x810e('0x26')]){delete _0x26d837[_0x810e('0x26')];}_0x35e7d0[_0x810e('0x17')](_0x2e94f9)[_0x810e('0x27')](_0x26d837);};}exports[_0x810e('0x28')]=function(_0x4114c2,_0x1ae0ad){var _0x36979e={},_0x10eb49={},_0x3aaf20={'count':0x0,'rows':[]};var _0x120cc0=_[_0x810e('0x29')](db[_0x810e('0x2a')][_0x810e('0x2b')],function(_0x297fcd){return{'name':_0x297fcd[_0x810e('0x2c')],'type':_0x297fcd[_0x810e('0x2d')][_0x810e('0x2e')]};});_0x10eb49['model']=_['map'](_0x120cc0,_0x810e('0x26'));_0x10eb49[_0x810e('0x2f')]=_[_0x810e('0x30')](_0x4114c2['query']);_0x10eb49[_0x810e('0x31')]=_[_0x810e('0x32')](_0x10eb49['model'],_0x10eb49['query']);_0x36979e[_0x810e('0x33')]=_[_0x810e('0x32')](_0x10eb49[_0x810e('0x34')],qs[_0x810e('0x35')](_0x4114c2[_0x810e('0x2f')][_0x810e('0x35')]));_0x36979e[_0x810e('0x33')]=_0x36979e['attributes'][_0x810e('0x36')]?_0x36979e['attributes']:_0x10eb49[_0x810e('0x34')];if(!_0x4114c2[_0x810e('0x2f')][_0x810e('0x37')](_0x810e('0x38'))){_0x36979e[_0x810e('0x1b')]=qs[_0x810e('0x1b')](_0x4114c2[_0x810e('0x2f')][_0x810e('0x1b')]);_0x36979e[_0x810e('0x1a')]=qs['offset'](_0x4114c2[_0x810e('0x2f')][_0x810e('0x1a')]);}_0x36979e[_0x810e('0x39')]=qs[_0x810e('0x3a')](_0x4114c2[_0x810e('0x2f')][_0x810e('0x3a')]);_0x36979e[_0x810e('0x3b')]=qs[_0x810e('0x31')](_[_0x810e('0x3c')](_0x4114c2[_0x810e('0x2f')],_0x10eb49[_0x810e('0x31')]),_0x120cc0);if(_0x4114c2[_0x810e('0x2f')]['filter']){_0x36979e[_0x810e('0x3b')]=_['merge'](_0x36979e[_0x810e('0x3b')],{'$or':_[_0x810e('0x29')](_0x120cc0,function(_0x50ff0b){if(_0x50ff0b['type']!==_0x810e('0x3d')){var _0x226b06={};_0x226b06[_0x50ff0b[_0x810e('0x26')]]={'$like':'%'+_0x4114c2[_0x810e('0x2f')][_0x810e('0x3e')]+'%'};return _0x226b06;}})});}_0x36979e=_[_0x810e('0x3f')]({},_0x36979e,_0x4114c2[_0x810e('0x40')]);var _0x3f80f9={'where':_0x36979e['where']};return db[_0x810e('0x2a')][_0x810e('0x1d')](_0x3f80f9)[_0x810e('0x23')](function(_0x1685d6){_0x3aaf20[_0x810e('0x1d')]=_0x1685d6;if(_0x4114c2[_0x810e('0x2f')][_0x810e('0x41')]){_0x36979e[_0x810e('0x42')]=[{'all':!![]}];}return db[_0x810e('0x2a')][_0x810e('0x43')](_0x36979e);})['then'](function(_0x41e8d8){_0x3aaf20['rows']=_0x41e8d8;return _0x3aaf20;})[_0x810e('0x23')](respondWithFilteredResult(_0x1ae0ad,_0x36979e))[_0x810e('0x44')](handleError(_0x1ae0ad,null));};exports[_0x810e('0x45')]=function(_0x4900a2,_0x22294f){var _0x1c2845={'raw':!![],'where':{'id':_0x4900a2['params']['id']}},_0x1ba0d4={};_0x1ba0d4['model']=_[_0x810e('0x30')](db[_0x810e('0x2a')][_0x810e('0x2b')]);_0x1ba0d4[_0x810e('0x2f')]=_['keys'](_0x4900a2[_0x810e('0x2f')]);_0x1ba0d4[_0x810e('0x31')]=_['intersection'](_0x1ba0d4['model'],_0x1ba0d4[_0x810e('0x2f')]);_0x1c2845[_0x810e('0x33')]=_[_0x810e('0x32')](_0x1ba0d4[_0x810e('0x34')],qs['fields'](_0x4900a2['query'][_0x810e('0x35')]));_0x1c2845[_0x810e('0x33')]=_0x1c2845['attributes']['length']?_0x1c2845[_0x810e('0x33')]:_0x1ba0d4['model'];if(_0x4900a2['query'][_0x810e('0x41')]){_0x1c2845[_0x810e('0x42')]=[{'all':!![]}];}_0x1c2845=_[_0x810e('0x3f')]({},_0x1c2845,_0x4900a2[_0x810e('0x40')]);return db[_0x810e('0x2a')][_0x810e('0x46')](_0x1c2845)['then'](handleEntityNotFound(_0x22294f,null))['then'](respondWithResult(_0x22294f,null))[_0x810e('0x44')](handleError(_0x22294f,null));};exports[_0x810e('0x47')]=function(_0x45f70b,_0x2c88e4){return db[_0x810e('0x2a')][_0x810e('0x47')](_0x45f70b[_0x810e('0x48')],{})['then'](respondWithResult(_0x2c88e4,0xc9))[_0x810e('0x44')](handleError(_0x2c88e4,null));};exports['update']=function(_0x39d238,_0x5dccbb){if(_0x39d238[_0x810e('0x48')]['id']){delete _0x39d238[_0x810e('0x48')]['id'];}return db[_0x810e('0x2a')]['find']({'where':{'id':_0x39d238[_0x810e('0x49')]['id']}})[_0x810e('0x23')](handleEntityNotFound(_0x5dccbb,null))['then'](saveUpdates(_0x39d238[_0x810e('0x48')],null))['then'](respondWithResult(_0x5dccbb,null))['catch'](handleError(_0x5dccbb,null));};exports[_0x810e('0x22')]=function(_0x3bffbd,_0x2e1527){return db[_0x810e('0x2a')]['find']({'where':{'id':_0x3bffbd[_0x810e('0x49')]['id']}})[_0x810e('0x23')](handleEntityNotFound(_0x2e1527,null))[_0x810e('0x23')](removeEntity(_0x2e1527,null))['catch'](handleError(_0x2e1527,null));};exports[_0x810e('0x4a')]=function(_0x29ab0e,_0x68055f){return db[_0x810e('0x2a')][_0x810e('0x4a')]()[_0x810e('0x23')](respondWithResult(_0x68055f,null))[_0x810e('0x44')](handleError(_0x68055f,null));}; \ No newline at end of file +var _0xd7a2=['options','includeAll','include','rows','then','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','stack','name','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x4ab294,_0xe14962){var _0x3cb95b=function(_0x8fdaed){while(--_0x8fdaed){_0x4ab294['push'](_0x4ab294['shift']());}};_0x3cb95b(++_0xe14962);}(_0xd7a2,0xa9));var _0x2d7a=function(_0x1d42d5,_0x94275){_0x1d42d5=_0x1d42d5-0x0;var _0x36b734=_0xd7a2[_0x1d42d5];return _0x36b734;};'use strict';var emlformat=require(_0x2d7a('0x0'));var rimraf=require(_0x2d7a('0x1'));var zipdir=require(_0x2d7a('0x2'));var jsonpatch=require(_0x2d7a('0x3'));var rp=require(_0x2d7a('0x4'));var moment=require(_0x2d7a('0x5'));var BPromise=require(_0x2d7a('0x6'));var Mustache=require(_0x2d7a('0x7'));var util=require(_0x2d7a('0x8'));var path=require(_0x2d7a('0x9'));var sox=require(_0x2d7a('0xa'));var csv=require(_0x2d7a('0xb'));var ejs=require(_0x2d7a('0xc'));var fs=require('fs');var fs_extra=require(_0x2d7a('0xd'));var _=require(_0x2d7a('0xe'));var squel=require(_0x2d7a('0xf'));var crypto=require(_0x2d7a('0x10'));var jsforce=require(_0x2d7a('0x11'));var deskjs=require(_0x2d7a('0x12'));var toCsv=require(_0x2d7a('0xb'));var querystring=require('querystring');var Papa=require(_0x2d7a('0x13'));var Redis=require('ioredis');var authService=require(_0x2d7a('0x14'));var qs=require(_0x2d7a('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d7a('0x16'));var logger=require(_0x2d7a('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x2d7a('0x18'));var licenseUtil=require(_0x2d7a('0x19'));var db=require(_0x2d7a('0x1a'))['db'];function respondWithStatusCode(_0x42b2a4,_0x420dd6){_0x420dd6=_0x420dd6||0xcc;return function(_0xe972b6){if(_0xe972b6){return _0x42b2a4[_0x2d7a('0x1b')](_0x420dd6);}return _0x42b2a4[_0x2d7a('0x1c')](_0x420dd6)[_0x2d7a('0x1d')]();};}function respondWithResult(_0x43bc5b,_0x6a5920){_0x6a5920=_0x6a5920||0xc8;return function(_0x557cb){if(_0x557cb){return _0x43bc5b[_0x2d7a('0x1c')](_0x6a5920)[_0x2d7a('0x1e')](_0x557cb);}};}function respondWithFilteredResult(_0x21c063,_0x1106fa){return function(_0x519050){if(_0x519050){var _0x5b427d=typeof _0x1106fa[_0x2d7a('0x1f')]===_0x2d7a('0x20')&&typeof _0x1106fa['limit']===_0x2d7a('0x20');var _0x37ece5=_0x519050[_0x2d7a('0x21')];var _0x4cf5ff=_0x5b427d?0x0:_0x1106fa['offset'];var _0x4aaabb=_0x5b427d?_0x519050[_0x2d7a('0x21')]:_0x1106fa[_0x2d7a('0x1f')]+_0x1106fa['limit'];var _0x5a0b08;if(_0x4aaabb>=_0x37ece5){_0x4aaabb=_0x37ece5;_0x5a0b08=0xc8;}else{_0x5a0b08=0xce;}_0x21c063[_0x2d7a('0x1c')](_0x5a0b08);return _0x21c063[_0x2d7a('0x22')](_0x2d7a('0x23'),_0x4cf5ff+'-'+_0x4aaabb+'/'+_0x37ece5)[_0x2d7a('0x1e')](_0x519050);}return null;};}function patchUpdates(_0x2acf0e){return function(_0x14df89){try{jsonpatch[_0x2d7a('0x24')](_0x14df89,_0x2acf0e,!![]);}catch(_0x23c03e){return BPromise[_0x2d7a('0x25')](_0x23c03e);}return _0x14df89[_0x2d7a('0x26')]();};}function saveUpdates(_0x41f8fd,_0x56890f){return function(_0x1d32e2){if(_0x1d32e2){return _0x1d32e2[_0x2d7a('0x27')](_0x41f8fd)['then'](function(_0x5d310a){return _0x5d310a;});}return null;};}function removeEntity(_0x11981f,_0x534fce){return function(_0x5cc3c4){if(_0x5cc3c4){return _0x5cc3c4['destroy']()['then'](function(){_0x11981f[_0x2d7a('0x1c')](0xcc)[_0x2d7a('0x1d')]();});}};}function handleEntityNotFound(_0xe3a359,_0x5c9732){return function(_0x2e682a){if(!_0x2e682a){_0xe3a359[_0x2d7a('0x1b')](0x194);}return _0x2e682a;};}function handleError(_0x504b28,_0x50e4c5){_0x50e4c5=_0x50e4c5||0x1f4;return function(_0x556983){logger['error'](_0x556983[_0x2d7a('0x28')]);if(_0x556983[_0x2d7a('0x29')]){delete _0x556983[_0x2d7a('0x29')];}_0x504b28[_0x2d7a('0x1c')](_0x50e4c5)['send'](_0x556983);};}exports[_0x2d7a('0x2a')]=function(_0x5cb481,_0x14105c){var _0x347a97={},_0x1035dd={},_0x3eaf29={'count':0x0,'rows':[]};var _0x3e3b93=_[_0x2d7a('0x2b')](db[_0x2d7a('0x2c')][_0x2d7a('0x2d')],function(_0x2b8627){return{'name':_0x2b8627[_0x2d7a('0x2e')],'type':_0x2b8627[_0x2d7a('0x2f')][_0x2d7a('0x30')]};});_0x1035dd[_0x2d7a('0x31')]=_[_0x2d7a('0x2b')](_0x3e3b93,_0x2d7a('0x29'));_0x1035dd[_0x2d7a('0x32')]=_[_0x2d7a('0x33')](_0x5cb481[_0x2d7a('0x32')]);_0x1035dd['filters']=_[_0x2d7a('0x34')](_0x1035dd[_0x2d7a('0x31')],_0x1035dd[_0x2d7a('0x32')]);_0x347a97['attributes']=_['intersection'](_0x1035dd[_0x2d7a('0x31')],qs[_0x2d7a('0x35')](_0x5cb481['query'][_0x2d7a('0x35')]));_0x347a97[_0x2d7a('0x36')]=_0x347a97[_0x2d7a('0x36')][_0x2d7a('0x37')]?_0x347a97[_0x2d7a('0x36')]:_0x1035dd[_0x2d7a('0x31')];if(!_0x5cb481[_0x2d7a('0x32')][_0x2d7a('0x38')](_0x2d7a('0x39'))){_0x347a97[_0x2d7a('0x3a')]=qs[_0x2d7a('0x3a')](_0x5cb481[_0x2d7a('0x32')][_0x2d7a('0x3a')]);_0x347a97[_0x2d7a('0x1f')]=qs['offset'](_0x5cb481['query'][_0x2d7a('0x1f')]);}_0x347a97['order']=qs['sort'](_0x5cb481[_0x2d7a('0x32')][_0x2d7a('0x3b')]);_0x347a97[_0x2d7a('0x3c')]=qs[_0x2d7a('0x3d')](_['pick'](_0x5cb481[_0x2d7a('0x32')],_0x1035dd[_0x2d7a('0x3d')]),_0x3e3b93);if(_0x5cb481[_0x2d7a('0x32')][_0x2d7a('0x3e')]){_0x347a97[_0x2d7a('0x3c')]=_[_0x2d7a('0x3f')](_0x347a97[_0x2d7a('0x3c')],{'$or':_[_0x2d7a('0x2b')](_0x3e3b93,function(_0x42ed4c){if(_0x42ed4c['type']!==_0x2d7a('0x40')){var _0x71f89f={};_0x71f89f[_0x42ed4c[_0x2d7a('0x29')]]={'$like':'%'+_0x5cb481['query']['filter']+'%'};return _0x71f89f;}})});}_0x347a97=_[_0x2d7a('0x3f')]({},_0x347a97,_0x5cb481[_0x2d7a('0x41')]);var _0x112b98={'where':_0x347a97[_0x2d7a('0x3c')]};return db['SmsQueueReport'][_0x2d7a('0x21')](_0x112b98)['then'](function(_0x5e53ec){_0x3eaf29['count']=_0x5e53ec;if(_0x5cb481[_0x2d7a('0x32')][_0x2d7a('0x42')]){_0x347a97[_0x2d7a('0x43')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x347a97);})['then'](function(_0x338353){_0x3eaf29[_0x2d7a('0x44')]=_0x338353;return _0x3eaf29;})[_0x2d7a('0x45')](respondWithFilteredResult(_0x14105c,_0x347a97))[_0x2d7a('0x46')](handleError(_0x14105c,null));};exports[_0x2d7a('0x47')]=function(_0x234508,_0x388677){var _0x2a20d6={'raw':!![],'where':{'id':_0x234508[_0x2d7a('0x48')]['id']}},_0xc58f8f={};_0xc58f8f[_0x2d7a('0x31')]=_[_0x2d7a('0x33')](db['SmsQueueReport'][_0x2d7a('0x2d')]);_0xc58f8f[_0x2d7a('0x32')]=_[_0x2d7a('0x33')](_0x234508[_0x2d7a('0x32')]);_0xc58f8f[_0x2d7a('0x3d')]=_[_0x2d7a('0x34')](_0xc58f8f['model'],_0xc58f8f[_0x2d7a('0x32')]);_0x2a20d6[_0x2d7a('0x36')]=_[_0x2d7a('0x34')](_0xc58f8f[_0x2d7a('0x31')],qs[_0x2d7a('0x35')](_0x234508[_0x2d7a('0x32')][_0x2d7a('0x35')]));_0x2a20d6[_0x2d7a('0x36')]=_0x2a20d6[_0x2d7a('0x36')]['length']?_0x2a20d6['attributes']:_0xc58f8f['model'];if(_0x234508[_0x2d7a('0x32')][_0x2d7a('0x42')]){_0x2a20d6['include']=[{'all':!![]}];}_0x2a20d6=_[_0x2d7a('0x3f')]({},_0x2a20d6,_0x234508[_0x2d7a('0x41')]);return db[_0x2d7a('0x2c')][_0x2d7a('0x49')](_0x2a20d6)[_0x2d7a('0x45')](handleEntityNotFound(_0x388677,null))[_0x2d7a('0x45')](respondWithResult(_0x388677,null))[_0x2d7a('0x46')](handleError(_0x388677,null));};exports[_0x2d7a('0x4a')]=function(_0x53715d,_0x244a67){return db[_0x2d7a('0x2c')][_0x2d7a('0x4a')](_0x53715d[_0x2d7a('0x4b')],{})[_0x2d7a('0x45')](respondWithResult(_0x244a67,0xc9))['catch'](handleError(_0x244a67,null));};exports['update']=function(_0x362656,_0x27cdd1){if(_0x362656[_0x2d7a('0x4b')]['id']){delete _0x362656[_0x2d7a('0x4b')]['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0x362656[_0x2d7a('0x48')]['id']}})['then'](handleEntityNotFound(_0x27cdd1,null))[_0x2d7a('0x45')](saveUpdates(_0x362656[_0x2d7a('0x4b')],null))[_0x2d7a('0x45')](respondWithResult(_0x27cdd1,null))[_0x2d7a('0x46')](handleError(_0x27cdd1,null));};exports[_0x2d7a('0x4c')]=function(_0x4b8ed0,_0x352865){return db[_0x2d7a('0x2c')][_0x2d7a('0x49')]({'where':{'id':_0x4b8ed0[_0x2d7a('0x48')]['id']}})['then'](handleEntityNotFound(_0x352865,null))[_0x2d7a('0x45')](removeEntity(_0x352865,null))[_0x2d7a('0x46')](handleError(_0x352865,null));};exports[_0x2d7a('0x4d')]=function(_0x21cbd6,_0x1d0b19){return db[_0x2d7a('0x2c')][_0x2d7a('0x4d')]()['then'](respondWithResult(_0x1d0b19,null))['catch'](handleError(_0x1d0b19,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 4bdcdfb..456f53a 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3490d0,_0x329ac4){var _0x1f0dd0=function(_0x5a5ce8){while(--_0x5a5ce8){_0x3490d0['push'](_0x3490d0['shift']());}};_0x1f0dd0(++_0x329ac4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x533f1a,_0x4c6c86){var _0x5cf6eb=function(_0x45be72){while(--_0x45be72){_0x533f1a['push'](_0x533f1a['shift']());}};_0x5cf6eb(++_0x4c6c86);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xb7e7[_0x42bc91];return _0x3f5507;};'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_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a8bb7b6..474b8ad 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 _0xf84b=['jayson/promise','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','UpdateSmsQueueReport','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b4975,_0x4687b6){var _0x468d3d=function(_0x1ccd0f){while(--_0x1ccd0f){_0x3b4975['push'](_0x3b4975['shift']());}};_0x468d3d(++_0x4687b6);}(_0xf84b,0x72));var _0xbf84=function(_0x47bd13,_0x19e67f){_0x47bd13=_0x47bd13-0x0;var _0x286e5f=_0xf84b[_0x47bd13];return _0x286e5f;};'use strict';var _=require(_0xbf84('0x0'));var util=require(_0xbf84('0x1'));var moment=require(_0xbf84('0x2'));var BPromise=require(_0xbf84('0x3'));var rs=require(_0xbf84('0x4'));var fs=require('fs');var Redis=require(_0xbf84('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf84('0x6'));var logger=require(_0xbf84('0x7'))(_0xbf84('0x8'));var config=require(_0xbf84('0x9'));var jayson=require(_0xbf84('0xa'));var client=jayson['client'][_0xbf84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9323c3,_0x16c799,_0x245c38){return new BPromise(function(_0x46363f,_0x189545){return client['request'](_0x9323c3,_0x245c38)[_0xbf84('0xc')](function(_0xb1522d){logger['info'](_0xbf84('0xd'),_0x16c799,_0xbf84('0xe'));logger[_0xbf84('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x16c799,_0xbf84('0xe'),JSON[_0xbf84('0x10')](_0xb1522d));if(_0xb1522d[_0xbf84('0x11')]){if(_0xb1522d[_0xbf84('0x11')][_0xbf84('0x12')]===0x1f4){logger['error'](_0xbf84('0xd'),_0x16c799,_0xb1522d['error']['message']);return _0x189545(_0xb1522d[_0xbf84('0x11')]['message']);}logger[_0xbf84('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x16c799,_0xb1522d[_0xbf84('0x11')]['message']);return _0x46363f(_0xb1522d[_0xbf84('0x11')][_0xbf84('0x13')]);}else{logger[_0xbf84('0x14')](_0xbf84('0xd'),_0x16c799,'request\x20sent');_0x46363f(_0xb1522d[_0xbf84('0x15')][_0xbf84('0x13')]);}})[_0xbf84('0x16')](function(_0x5784d5){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x16c799,_0x5784d5);_0x189545(_0x5784d5);});});}exports[_0xbf84('0x17')]=function(_0x50adcd){var _0x272925=this;return new Promise(function(_0x524b5f,_0x38f78d){return db[_0xbf84('0x18')][_0xbf84('0x19')](_0x50adcd[_0xbf84('0x1a')],{'raw':_0x50adcd[_0xbf84('0x1b')]?_0x50adcd['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2dccf0){logger[_0xbf84('0x14')](_0xbf84('0x17'),_0x50adcd);logger[_0xbf84('0xf')]('CreateSmsQueueReport',_0x50adcd,JSON[_0xbf84('0x10')](_0x2dccf0));_0x524b5f(_0x2dccf0);})[_0xbf84('0x16')](function(_0x4f944c){logger[_0xbf84('0x11')]('CreateSmsQueueReport',_0x4f944c[_0xbf84('0x13')],_0x50adcd);_0x38f78d(_0x272925[_0xbf84('0x11')](0x1f4,_0x4f944c[_0xbf84('0x13')]));});});};exports[_0xbf84('0x1c')]=function(_0x185c71){var _0x309efe=this;return new Promise(function(_0x304219,_0x48dc0f){return db[_0xbf84('0x18')]['update'](_0x185c71[_0xbf84('0x1a')],{'raw':_0x185c71[_0xbf84('0x1b')]?_0x185c71['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x185c71[_0xbf84('0x1b')]?_0x185c71[_0xbf84('0x1b')][_0xbf84('0x1d')]||null:null,'attributes':_0x185c71[_0xbf84('0x1b')]?_0x185c71[_0xbf84('0x1b')][_0xbf84('0x1e')]||null:null,'limit':_0x185c71[_0xbf84('0x1b')]?_0x185c71[_0xbf84('0x1b')]['limit']||null:null})[_0xbf84('0xc')](function(_0x1724bd){logger['info'](_0xbf84('0x1c'),_0x185c71);logger[_0xbf84('0xf')]('UpdateSmsQueueReport',_0x185c71,JSON[_0xbf84('0x10')](_0x1724bd));_0x304219(_0x1724bd);})['catch'](function(_0x4c67f6){logger[_0xbf84('0x11')](_0xbf84('0x1c'),_0x4c67f6[_0xbf84('0x13')],_0x185c71);_0x48dc0f(_0x309efe[_0xbf84('0x11')](0x1f4,_0x4c67f6[_0xbf84('0x13')]));});});}; \ No newline at end of file +var _0x56ec=['request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','SmsQueueReport','create','options','raw','catch','update','body','where','attributes','limit','UpdateSmsQueueReport','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x56ec,0x1e5));var _0xc56e=function(_0x87c527,_0x1152c8){_0x87c527=_0x87c527-0x0;var _0x533594=_0x56ec[_0x87c527];return _0x533594;};'use strict';var _=require(_0xc56e('0x0'));var util=require(_0xc56e('0x1'));var moment=require('moment');var BPromise=require(_0xc56e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc56e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc56e('0x4'))(_0xc56e('0x5'));var config=require(_0xc56e('0x6'));var jayson=require(_0xc56e('0x7'));var client=jayson[_0xc56e('0x8')][_0xc56e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x399b5c,_0x27dbc9,_0x558b45){return new BPromise(function(_0x27faf9,_0x1a5604){return client[_0xc56e('0xa')](_0x399b5c,_0x558b45)[_0xc56e('0xb')](function(_0x33496c){logger[_0xc56e('0xc')](_0xc56e('0xd'),_0x27dbc9,'request\x20sent');logger[_0xc56e('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x27dbc9,_0xc56e('0xf'),JSON[_0xc56e('0x10')](_0x33496c));if(_0x33496c['error']){if(_0x33496c[_0xc56e('0x11')][_0xc56e('0x12')]===0x1f4){logger[_0xc56e('0x11')](_0xc56e('0xd'),_0x27dbc9,_0x33496c[_0xc56e('0x11')][_0xc56e('0x13')]);return _0x1a5604(_0x33496c[_0xc56e('0x11')][_0xc56e('0x13')]);}logger[_0xc56e('0x11')](_0xc56e('0xd'),_0x27dbc9,_0x33496c['error'][_0xc56e('0x13')]);return _0x27faf9(_0x33496c[_0xc56e('0x11')][_0xc56e('0x13')]);}else{logger[_0xc56e('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x27dbc9,_0xc56e('0xf'));_0x27faf9(_0x33496c[_0xc56e('0x14')][_0xc56e('0x13')]);}})['catch'](function(_0x46e1c7){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x27dbc9,_0x46e1c7);_0x1a5604(_0x46e1c7);});});}exports[_0xc56e('0x15')]=function(_0x191fa2){var _0x53cd9f=this;return new Promise(function(_0x20ab64,_0x2bde68){return db[_0xc56e('0x16')][_0xc56e('0x17')](_0x191fa2['body'],{'raw':_0x191fa2[_0xc56e('0x18')]?_0x191fa2[_0xc56e('0x18')][_0xc56e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x204776){logger[_0xc56e('0xc')](_0xc56e('0x15'),_0x191fa2);logger['debug'](_0xc56e('0x15'),_0x191fa2,JSON['stringify'](_0x204776));_0x20ab64(_0x204776);})[_0xc56e('0x1a')](function(_0x24910b){logger[_0xc56e('0x11')]('CreateSmsQueueReport',_0x24910b[_0xc56e('0x13')],_0x191fa2);_0x2bde68(_0x53cd9f[_0xc56e('0x11')](0x1f4,_0x24910b[_0xc56e('0x13')]));});});};exports['UpdateSmsQueueReport']=function(_0x28b996){var _0x545f0c=this;return new Promise(function(_0x3e7e59,_0x49c69b){return db[_0xc56e('0x16')][_0xc56e('0x1b')](_0x28b996[_0xc56e('0x1c')],{'raw':_0x28b996['options']?_0x28b996[_0xc56e('0x18')][_0xc56e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28b996[_0xc56e('0x18')]?_0x28b996[_0xc56e('0x18')][_0xc56e('0x1d')]||null:null,'attributes':_0x28b996['options']?_0x28b996[_0xc56e('0x18')][_0xc56e('0x1e')]||null:null,'limit':_0x28b996[_0xc56e('0x18')]?_0x28b996[_0xc56e('0x18')][_0xc56e('0x1f')]||null:null})['then'](function(_0x5d4d41){logger[_0xc56e('0xc')](_0xc56e('0x20'),_0x28b996);logger[_0xc56e('0xe')](_0xc56e('0x20'),_0x28b996,JSON[_0xc56e('0x10')](_0x5d4d41));_0x3e7e59(_0x5d4d41);})[_0xc56e('0x1a')](function(_0x51c41e){logger['error'](_0xc56e('0x20'),_0x51c41e[_0xc56e('0x13')],_0x28b996);_0x49c69b(_0x545f0c[_0xc56e('0x11')](0x1f4,_0x51c41e[_0xc56e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 3ea5b1e..d274a32 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 _0x0faf=['./smsTransferReport.controller','isAuthenticated','index','get','/describe','/:id','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3cfaea,_0x59581c){var _0x5131f6=function(_0x57deeb){while(--_0x57deeb){_0x3cfaea['push'](_0x3cfaea['shift']());}};_0x5131f6(++_0x59581c);}(_0x0faf,0x132));var _0xf0fa=function(_0x4c06ac,_0x568788){_0x4c06ac=_0x4c06ac-0x0;var _0x2333cb=_0x0faf[_0x4c06ac];return _0x2333cb;};'use strict';var multer=require(_0xf0fa('0x0'));var util=require('util');var path=require(_0xf0fa('0x1'));var timeout=require(_0xf0fa('0x2'));var express=require(_0xf0fa('0x3'));var router=express[_0xf0fa('0x4')]();var fs_extra=require(_0xf0fa('0x5'));var auth=require(_0xf0fa('0x6'));var interaction=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var controller=require(_0xf0fa('0x9'));router['get']('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0xb')]);router[_0xf0fa('0xc')](_0xf0fa('0xd'),auth[_0xf0fa('0xa')](),controller['describe']);router[_0xf0fa('0xc')](_0xf0fa('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xf0fa('0xf')]('/',auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x10')]);router[_0xf0fa('0x11')](_0xf0fa('0xe'),auth[_0xf0fa('0xa')](),controller[_0xf0fa('0x12')]);router[_0xf0fa('0x13')]('/:id',auth[_0xf0fa('0xa')](),controller['destroy']);module[_0xf0fa('0x14')]=router; \ No newline at end of file +var _0xf987=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3d300c,_0x453e88){var _0x2cc832=function(_0x3542d4){while(--_0x3542d4){_0x3d300c['push'](_0x3d300c['shift']());}};_0x2cc832(++_0x453e88);}(_0xf987,0x18a));var _0x7f98=function(_0x34c317,_0x39ffdf){_0x34c317=_0x34c317-0x0;var _0x2ca441=_0xf987[_0x34c317];return _0x2ca441;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f98('0x0'));var timeout=require(_0x7f98('0x1'));var express=require('express');var router=express[_0x7f98('0x2')]();var fs_extra=require(_0x7f98('0x3'));var auth=require(_0x7f98('0x4'));var interaction=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var controller=require(_0x7f98('0x7'));router[_0x7f98('0x8')]('/',auth[_0x7f98('0x9')](),controller[_0x7f98('0xa')]);router[_0x7f98('0x8')](_0x7f98('0xb'),auth[_0x7f98('0x9')](),controller['describe']);router[_0x7f98('0x8')](_0x7f98('0xc'),auth[_0x7f98('0x9')](),controller[_0x7f98('0xd')]);router[_0x7f98('0xe')]('/',auth['isAuthenticated'](),controller[_0x7f98('0xf')]);router['put']('/:id',auth[_0x7f98('0x9')](),controller[_0x7f98('0x10')]);router[_0x7f98('0x11')](_0x7f98('0xc'),auth['isAuthenticated'](),controller[_0x7f98('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index deec9f7..5cdb3b3 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x485c12,_0x63ee16){var _0x5c87ad=function(_0x5bb3cf){while(--_0x5bb3cf){_0x485c12['push'](_0x485c12['shift']());}};_0x5c87ad(++_0x63ee16);}(_0x54ef,0x112));var _0xf54e=function(_0x540014,_0x28a34a){_0x540014=_0x540014-0x0;var _0x4e990b=_0x54ef[_0x540014];return _0x4e990b;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index bcac2a7..ba4b402 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 _0x749e=['end','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','SmsTransferReport','rows','catch','params','attributes','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','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','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then'];(function(_0x1dc18a,_0x5687f4){var _0x112df4=function(_0x485cbe){while(--_0x485cbe){_0x1dc18a['push'](_0x1dc18a['shift']());}};_0x112df4(++_0x5687f4);}(_0x749e,0x1a6));var _0xe749=function(_0x25bfa4,_0x52edad){_0x25bfa4=_0x25bfa4-0x0;var _0x4dfb99=_0x749e[_0x25bfa4];return _0x4dfb99;};'use strict';var emlformat=require(_0xe749('0x0'));var rimraf=require(_0xe749('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe749('0x2'));var rp=require(_0xe749('0x3'));var moment=require(_0xe749('0x4'));var BPromise=require(_0xe749('0x5'));var Mustache=require('mustache');var util=require(_0xe749('0x6'));var path=require(_0xe749('0x7'));var sox=require(_0xe749('0x8'));var csv=require('to-csv');var ejs=require(_0xe749('0x9'));var fs=require('fs');var fs_extra=require(_0xe749('0xa'));var _=require(_0xe749('0xb'));var squel=require('squel');var crypto=require(_0xe749('0xc'));var jsforce=require(_0xe749('0xd'));var deskjs=require(_0xe749('0xe'));var toCsv=require(_0xe749('0xf'));var querystring=require(_0xe749('0x10'));var Papa=require(_0xe749('0x11'));var Redis=require(_0xe749('0x12'));var authService=require(_0xe749('0x13'));var qs=require(_0xe749('0x14'));var as=require(_0xe749('0x15'));var hardwareService=require(_0xe749('0x16'));var logger=require(_0xe749('0x17'))(_0xe749('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe749('0x19'));var db=require(_0xe749('0x1a'))['db'];function respondWithStatusCode(_0x223bc1,_0x51f3ef){_0x51f3ef=_0x51f3ef||0xcc;return function(_0x1f4275){if(_0x1f4275){return _0x223bc1[_0xe749('0x1b')](_0x51f3ef);}return _0x223bc1[_0xe749('0x1c')](_0x51f3ef)['end']();};}function respondWithResult(_0x1807fd,_0x373c18){_0x373c18=_0x373c18||0xc8;return function(_0x167b86){if(_0x167b86){return _0x1807fd['status'](_0x373c18)[_0xe749('0x1d')](_0x167b86);}};}function respondWithFilteredResult(_0x1b0215,_0x126027){return function(_0x275bcd){if(_0x275bcd){var _0x3f0125=typeof _0x126027[_0xe749('0x1e')]===_0xe749('0x1f')&&typeof _0x126027['limit']===_0xe749('0x1f');var _0x52adbc=_0x275bcd[_0xe749('0x20')];var _0x38e539=_0x3f0125?0x0:_0x126027['offset'];var _0x113557=_0x3f0125?_0x275bcd[_0xe749('0x20')]:_0x126027[_0xe749('0x1e')]+_0x126027[_0xe749('0x21')];var _0x2b82d0;if(_0x113557>=_0x52adbc){_0x113557=_0x52adbc;_0x2b82d0=0xc8;}else{_0x2b82d0=0xce;}_0x1b0215[_0xe749('0x1c')](_0x2b82d0);return _0x1b0215[_0xe749('0x22')](_0xe749('0x23'),_0x38e539+'-'+_0x113557+'/'+_0x52adbc)[_0xe749('0x1d')](_0x275bcd);}return null;};}function patchUpdates(_0xe6bb4d){return function(_0x2442b7){try{jsonpatch[_0xe749('0x24')](_0x2442b7,_0xe6bb4d,!![]);}catch(_0x5db44e){return BPromise[_0xe749('0x25')](_0x5db44e);}return _0x2442b7['save']();};}function saveUpdates(_0x263476,_0x1f7b13){return function(_0x3cb923){if(_0x3cb923){return _0x3cb923[_0xe749('0x26')](_0x263476)[_0xe749('0x27')](function(_0x192f4e){return _0x192f4e;});}return null;};}function removeEntity(_0x3e3649,_0x4b5aa5){return function(_0x3b1aef){if(_0x3b1aef){return _0x3b1aef['destroy']()['then'](function(){_0x3e3649[_0xe749('0x1c')](0xcc)[_0xe749('0x28')]();});}};}function handleEntityNotFound(_0x546791,_0x2c4363){return function(_0x17d6e9){if(!_0x17d6e9){_0x546791[_0xe749('0x1b')](0x194);}return _0x17d6e9;};}function handleError(_0x118f95,_0x13c40f){_0x13c40f=_0x13c40f||0x1f4;return function(_0x20960f){logger[_0xe749('0x29')](_0x20960f[_0xe749('0x2a')]);if(_0x20960f['name']){delete _0x20960f[_0xe749('0x2b')];}_0x118f95[_0xe749('0x1c')](_0x13c40f)[_0xe749('0x2c')](_0x20960f);};}exports['index']=function(_0x221001,_0x20c059){var _0x215c60={},_0x95c1f8={},_0x3bcae5={'count':0x0,'rows':[]};var _0x429a9d=_[_0xe749('0x2d')](db['SmsTransferReport']['rawAttributes'],function(_0x43fb3c){return{'name':_0x43fb3c[_0xe749('0x2e')],'type':_0x43fb3c[_0xe749('0x2f')][_0xe749('0x30')]};});_0x95c1f8[_0xe749('0x31')]=_[_0xe749('0x2d')](_0x429a9d,_0xe749('0x2b'));_0x95c1f8[_0xe749('0x32')]=_[_0xe749('0x33')](_0x221001[_0xe749('0x32')]);_0x95c1f8[_0xe749('0x34')]=_[_0xe749('0x35')](_0x95c1f8[_0xe749('0x31')],_0x95c1f8[_0xe749('0x32')]);_0x215c60['attributes']=_[_0xe749('0x35')](_0x95c1f8['model'],qs[_0xe749('0x36')](_0x221001[_0xe749('0x32')]['fields']));_0x215c60['attributes']=_0x215c60['attributes'][_0xe749('0x37')]?_0x215c60['attributes']:_0x95c1f8[_0xe749('0x31')];if(!_0x221001['query']['hasOwnProperty'](_0xe749('0x38'))){_0x215c60['limit']=qs[_0xe749('0x21')](_0x221001[_0xe749('0x32')][_0xe749('0x21')]);_0x215c60['offset']=qs[_0xe749('0x1e')](_0x221001[_0xe749('0x32')][_0xe749('0x1e')]);}_0x215c60[_0xe749('0x39')]=qs[_0xe749('0x3a')](_0x221001[_0xe749('0x32')]['sort']);_0x215c60[_0xe749('0x3b')]=qs['filters'](_[_0xe749('0x3c')](_0x221001[_0xe749('0x32')],_0x95c1f8[_0xe749('0x34')]),_0x429a9d);if(_0x221001[_0xe749('0x32')][_0xe749('0x3d')]){_0x215c60[_0xe749('0x3b')]=_[_0xe749('0x3e')](_0x215c60[_0xe749('0x3b')],{'$or':_['map'](_0x429a9d,function(_0x301373){if(_0x301373[_0xe749('0x2f')]!==_0xe749('0x3f')){var _0x18230c={};_0x18230c[_0x301373[_0xe749('0x2b')]]={'$like':'%'+_0x221001['query']['filter']+'%'};return _0x18230c;}})});}_0x215c60=_['merge']({},_0x215c60,_0x221001[_0xe749('0x40')]);var _0x38aac2={'where':_0x215c60[_0xe749('0x3b')]};return db['SmsTransferReport'][_0xe749('0x20')](_0x38aac2)[_0xe749('0x27')](function(_0x487607){_0x3bcae5['count']=_0x487607;if(_0x221001[_0xe749('0x32')]['includeAll']){_0x215c60[_0xe749('0x41')]=[{'all':!![]}];}return db[_0xe749('0x42')]['findAll'](_0x215c60);})['then'](function(_0x4df6f2){_0x3bcae5[_0xe749('0x43')]=_0x4df6f2;return _0x3bcae5;})[_0xe749('0x27')](respondWithFilteredResult(_0x20c059,_0x215c60))[_0xe749('0x44')](handleError(_0x20c059,null));};exports['show']=function(_0x254d86,_0x350391){var _0x54b040={'raw':!![],'where':{'id':_0x254d86[_0xe749('0x45')]['id']}},_0x1d31e0={};_0x1d31e0['model']=_[_0xe749('0x33')](db[_0xe749('0x42')]['rawAttributes']);_0x1d31e0[_0xe749('0x32')]=_[_0xe749('0x33')](_0x254d86[_0xe749('0x32')]);_0x1d31e0[_0xe749('0x34')]=_[_0xe749('0x35')](_0x1d31e0[_0xe749('0x31')],_0x1d31e0[_0xe749('0x32')]);_0x54b040[_0xe749('0x46')]=_[_0xe749('0x35')](_0x1d31e0['model'],qs[_0xe749('0x36')](_0x254d86['query'][_0xe749('0x36')]));_0x54b040[_0xe749('0x46')]=_0x54b040[_0xe749('0x46')][_0xe749('0x37')]?_0x54b040['attributes']:_0x1d31e0['model'];if(_0x254d86[_0xe749('0x32')][_0xe749('0x47')]){_0x54b040[_0xe749('0x41')]=[{'all':!![]}];}_0x54b040=_[_0xe749('0x3e')]({},_0x54b040,_0x254d86[_0xe749('0x40')]);return db[_0xe749('0x42')][_0xe749('0x48')](_0x54b040)['then'](handleEntityNotFound(_0x350391,null))[_0xe749('0x27')](respondWithResult(_0x350391,null))[_0xe749('0x44')](handleError(_0x350391,null));};exports[_0xe749('0x49')]=function(_0x42938c,_0x2dd95d){return db[_0xe749('0x42')][_0xe749('0x49')](_0x42938c[_0xe749('0x4a')],{})[_0xe749('0x27')](respondWithResult(_0x2dd95d,0xc9))[_0xe749('0x44')](handleError(_0x2dd95d,null));};exports[_0xe749('0x26')]=function(_0x2ba002,_0x3e5471){if(_0x2ba002['body']['id']){delete _0x2ba002[_0xe749('0x4a')]['id'];}return db[_0xe749('0x42')][_0xe749('0x48')]({'where':{'id':_0x2ba002['params']['id']}})[_0xe749('0x27')](handleEntityNotFound(_0x3e5471,null))[_0xe749('0x27')](saveUpdates(_0x2ba002['body'],null))['then'](respondWithResult(_0x3e5471,null))['catch'](handleError(_0x3e5471,null));};exports[_0xe749('0x4b')]=function(_0x170e1a,_0x16fe1c){return db[_0xe749('0x42')]['find']({'where':{'id':_0x170e1a[_0xe749('0x45')]['id']}})[_0xe749('0x27')](handleEntityNotFound(_0x16fe1c,null))['then'](removeEntity(_0x16fe1c,null))[_0xe749('0x44')](handleError(_0x16fe1c,null));};exports[_0xe749('0x4c')]=function(_0x2090c8,_0x3c7f75){return db[_0xe749('0x42')][_0xe749('0x4c')]()[_0xe749('0x27')](respondWithResult(_0x3c7f75,null))[_0xe749('0x44')](handleError(_0x3c7f75,null));}; \ No newline at end of file +var _0x7ddf=['map','SmsTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index'];(function(_0x45d776,_0x1eed1d){var _0x38992c=function(_0x190663){while(--_0x190663){_0x45d776['push'](_0x45d776['shift']());}};_0x38992c(++_0x1eed1d);}(_0x7ddf,0x1a6));var _0xf7dd=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7ddf[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0xf7dd('0x0'));var rimraf=require(_0xf7dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7dd('0x2'));var rp=require(_0xf7dd('0x3'));var moment=require(_0xf7dd('0x4'));var BPromise=require(_0xf7dd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf7dd('0x6'));var sox=require(_0xf7dd('0x7'));var csv=require(_0xf7dd('0x8'));var ejs=require(_0xf7dd('0x9'));var fs=require('fs');var fs_extra=require(_0xf7dd('0xa'));var _=require(_0xf7dd('0xb'));var squel=require(_0xf7dd('0xc'));var crypto=require(_0xf7dd('0xd'));var jsforce=require(_0xf7dd('0xe'));var deskjs=require(_0xf7dd('0xf'));var toCsv=require(_0xf7dd('0x8'));var querystring=require(_0xf7dd('0x10'));var Papa=require('papaparse');var Redis=require(_0xf7dd('0x11'));var authService=require(_0xf7dd('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf7dd('0x13'));var hardwareService=require(_0xf7dd('0x14'));var logger=require(_0xf7dd('0x15'))('api');var utils=require(_0xf7dd('0x16'));var config=require(_0xf7dd('0x17'));var licenseUtil=require(_0xf7dd('0x18'));var db=require(_0xf7dd('0x19'))['db'];function respondWithStatusCode(_0x5e3577,_0x209a47){_0x209a47=_0x209a47||0xcc;return function(_0x52e0c2){if(_0x52e0c2){return _0x5e3577[_0xf7dd('0x1a')](_0x209a47);}return _0x5e3577[_0xf7dd('0x1b')](_0x209a47)['end']();};}function respondWithResult(_0x2fee52,_0x51ffda){_0x51ffda=_0x51ffda||0xc8;return function(_0x2918f5){if(_0x2918f5){return _0x2fee52[_0xf7dd('0x1b')](_0x51ffda)[_0xf7dd('0x1c')](_0x2918f5);}};}function respondWithFilteredResult(_0x3ea445,_0x3f4166){return function(_0x38025a){if(_0x38025a){var _0x5954ee=typeof _0x3f4166[_0xf7dd('0x1d')]==='undefined'&&typeof _0x3f4166[_0xf7dd('0x1e')]===_0xf7dd('0x1f');var _0x376bd0=_0x38025a['count'];var _0x5d3cf6=_0x5954ee?0x0:_0x3f4166[_0xf7dd('0x1d')];var _0x2be28a=_0x5954ee?_0x38025a[_0xf7dd('0x20')]:_0x3f4166[_0xf7dd('0x1d')]+_0x3f4166['limit'];var _0x101100;if(_0x2be28a>=_0x376bd0){_0x2be28a=_0x376bd0;_0x101100=0xc8;}else{_0x101100=0xce;}_0x3ea445[_0xf7dd('0x1b')](_0x101100);return _0x3ea445[_0xf7dd('0x21')](_0xf7dd('0x22'),_0x5d3cf6+'-'+_0x2be28a+'/'+_0x376bd0)[_0xf7dd('0x1c')](_0x38025a);}return null;};}function patchUpdates(_0xa19b2d){return function(_0x3f35ee){try{jsonpatch[_0xf7dd('0x23')](_0x3f35ee,_0xa19b2d,!![]);}catch(_0x456f5d){return BPromise[_0xf7dd('0x24')](_0x456f5d);}return _0x3f35ee[_0xf7dd('0x25')]();};}function saveUpdates(_0x49e377,_0x22a748){return function(_0x4b9821){if(_0x4b9821){return _0x4b9821[_0xf7dd('0x26')](_0x49e377)[_0xf7dd('0x27')](function(_0x549ba4){return _0x549ba4;});}return null;};}function removeEntity(_0x4e284c,_0x52261d){return function(_0x51f07a){if(_0x51f07a){return _0x51f07a[_0xf7dd('0x28')]()[_0xf7dd('0x27')](function(){_0x4e284c[_0xf7dd('0x1b')](0xcc)[_0xf7dd('0x29')]();});}};}function handleEntityNotFound(_0xb8029f,_0x48d5a3){return function(_0x7a110c){if(!_0x7a110c){_0xb8029f['sendStatus'](0x194);}return _0x7a110c;};}function handleError(_0x468231,_0x234416){_0x234416=_0x234416||0x1f4;return function(_0x1e62b6){logger[_0xf7dd('0x2a')](_0x1e62b6[_0xf7dd('0x2b')]);if(_0x1e62b6[_0xf7dd('0x2c')]){delete _0x1e62b6[_0xf7dd('0x2c')];}_0x468231['status'](_0x234416)['send'](_0x1e62b6);};}exports[_0xf7dd('0x2d')]=function(_0x40e072,_0x35e0b8){var _0x236ac5={},_0x3950c3={},_0x1d5d24={'count':0x0,'rows':[]};var _0x318977=_[_0xf7dd('0x2e')](db[_0xf7dd('0x2f')][_0xf7dd('0x30')],function(_0x2acabd){return{'name':_0x2acabd['fieldName'],'type':_0x2acabd[_0xf7dd('0x31')][_0xf7dd('0x32')]};});_0x3950c3[_0xf7dd('0x33')]=_[_0xf7dd('0x2e')](_0x318977,_0xf7dd('0x2c'));_0x3950c3[_0xf7dd('0x34')]=_[_0xf7dd('0x35')](_0x40e072['query']);_0x3950c3[_0xf7dd('0x36')]=_[_0xf7dd('0x37')](_0x3950c3['model'],_0x3950c3[_0xf7dd('0x34')]);_0x236ac5[_0xf7dd('0x38')]=_[_0xf7dd('0x37')](_0x3950c3[_0xf7dd('0x33')],qs[_0xf7dd('0x39')](_0x40e072[_0xf7dd('0x34')][_0xf7dd('0x39')]));_0x236ac5[_0xf7dd('0x38')]=_0x236ac5[_0xf7dd('0x38')][_0xf7dd('0x3a')]?_0x236ac5[_0xf7dd('0x38')]:_0x3950c3[_0xf7dd('0x33')];if(!_0x40e072[_0xf7dd('0x34')]['hasOwnProperty'](_0xf7dd('0x3b'))){_0x236ac5[_0xf7dd('0x1e')]=qs[_0xf7dd('0x1e')](_0x40e072['query'][_0xf7dd('0x1e')]);_0x236ac5[_0xf7dd('0x1d')]=qs['offset'](_0x40e072[_0xf7dd('0x34')]['offset']);}_0x236ac5[_0xf7dd('0x3c')]=qs[_0xf7dd('0x3d')](_0x40e072[_0xf7dd('0x34')][_0xf7dd('0x3d')]);_0x236ac5[_0xf7dd('0x3e')]=qs[_0xf7dd('0x36')](_['pick'](_0x40e072['query'],_0x3950c3[_0xf7dd('0x36')]),_0x318977);if(_0x40e072[_0xf7dd('0x34')]['filter']){_0x236ac5[_0xf7dd('0x3e')]=_[_0xf7dd('0x3f')](_0x236ac5[_0xf7dd('0x3e')],{'$or':_[_0xf7dd('0x2e')](_0x318977,function(_0x4b8dea){if(_0x4b8dea[_0xf7dd('0x31')]!==_0xf7dd('0x40')){var _0x5cb82b={};_0x5cb82b[_0x4b8dea[_0xf7dd('0x2c')]]={'$like':'%'+_0x40e072[_0xf7dd('0x34')][_0xf7dd('0x41')]+'%'};return _0x5cb82b;}})});}_0x236ac5=_[_0xf7dd('0x3f')]({},_0x236ac5,_0x40e072[_0xf7dd('0x42')]);var _0x39ec12={'where':_0x236ac5[_0xf7dd('0x3e')]};return db['SmsTransferReport']['count'](_0x39ec12)[_0xf7dd('0x27')](function(_0x357493){_0x1d5d24['count']=_0x357493;if(_0x40e072[_0xf7dd('0x34')]['includeAll']){_0x236ac5[_0xf7dd('0x43')]=[{'all':!![]}];}return db[_0xf7dd('0x2f')][_0xf7dd('0x44')](_0x236ac5);})[_0xf7dd('0x27')](function(_0x1a48ff){_0x1d5d24[_0xf7dd('0x45')]=_0x1a48ff;return _0x1d5d24;})[_0xf7dd('0x27')](respondWithFilteredResult(_0x35e0b8,_0x236ac5))[_0xf7dd('0x46')](handleError(_0x35e0b8,null));};exports[_0xf7dd('0x47')]=function(_0x3d0649,_0x15cffb){var _0x260d85={'raw':!![],'where':{'id':_0x3d0649[_0xf7dd('0x48')]['id']}},_0x2795bc={};_0x2795bc[_0xf7dd('0x33')]=_[_0xf7dd('0x35')](db[_0xf7dd('0x2f')]['rawAttributes']);_0x2795bc[_0xf7dd('0x34')]=_[_0xf7dd('0x35')](_0x3d0649[_0xf7dd('0x34')]);_0x2795bc[_0xf7dd('0x36')]=_[_0xf7dd('0x37')](_0x2795bc[_0xf7dd('0x33')],_0x2795bc[_0xf7dd('0x34')]);_0x260d85[_0xf7dd('0x38')]=_[_0xf7dd('0x37')](_0x2795bc['model'],qs['fields'](_0x3d0649['query'][_0xf7dd('0x39')]));_0x260d85[_0xf7dd('0x38')]=_0x260d85['attributes'][_0xf7dd('0x3a')]?_0x260d85[_0xf7dd('0x38')]:_0x2795bc[_0xf7dd('0x33')];if(_0x3d0649[_0xf7dd('0x34')][_0xf7dd('0x49')]){_0x260d85[_0xf7dd('0x43')]=[{'all':!![]}];}_0x260d85=_[_0xf7dd('0x3f')]({},_0x260d85,_0x3d0649[_0xf7dd('0x42')]);return db[_0xf7dd('0x2f')][_0xf7dd('0x4a')](_0x260d85)[_0xf7dd('0x27')](handleEntityNotFound(_0x15cffb,null))['then'](respondWithResult(_0x15cffb,null))['catch'](handleError(_0x15cffb,null));};exports[_0xf7dd('0x4b')]=function(_0x4a0ed6,_0x55ac2e){return db[_0xf7dd('0x2f')][_0xf7dd('0x4b')](_0x4a0ed6[_0xf7dd('0x4c')],{})[_0xf7dd('0x27')](respondWithResult(_0x55ac2e,0xc9))['catch'](handleError(_0x55ac2e,null));};exports[_0xf7dd('0x26')]=function(_0xff86ab,_0xb8c6){if(_0xff86ab[_0xf7dd('0x4c')]['id']){delete _0xff86ab[_0xf7dd('0x4c')]['id'];}return db['SmsTransferReport'][_0xf7dd('0x4a')]({'where':{'id':_0xff86ab[_0xf7dd('0x48')]['id']}})[_0xf7dd('0x27')](handleEntityNotFound(_0xb8c6,null))['then'](saveUpdates(_0xff86ab['body'],null))[_0xf7dd('0x27')](respondWithResult(_0xb8c6,null))['catch'](handleError(_0xb8c6,null));};exports['destroy']=function(_0x1344eb,_0x1fb430){return db[_0xf7dd('0x2f')][_0xf7dd('0x4a')]({'where':{'id':_0x1344eb[_0xf7dd('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fb430,null))[_0xf7dd('0x27')](removeEntity(_0x1fb430,null))['catch'](handleError(_0x1fb430,null));};exports[_0xf7dd('0x4d')]=function(_0x36d9dc,_0x95fd2){return db[_0xf7dd('0x2f')]['describe']()[_0xf7dd('0x27')](respondWithResult(_0x95fd2,null))[_0xf7dd('0x46')](handleError(_0x95fd2,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 10488fa..3a74df2 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 _0x7707=['exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path'];(function(_0x1d3c2f,_0x54d313){var _0x360a6c=function(_0xbbf0b0){while(--_0xbbf0b0){_0x1d3c2f['push'](_0x1d3c2f['shift']());}};_0x360a6c(++_0x54d313);}(_0x7707,0x158));var _0x7770=function(_0x12bea6,_0x1bd067){_0x12bea6=_0x12bea6-0x0;var _0x5da1b4=_0x7707[_0x12bea6];return _0x5da1b4;};'use strict';var _=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var logger=require(_0x7770('0x2'))(_0x7770('0x3'));var moment=require(_0x7770('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7770('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0x7770('0x6')]=function(_0x251dae,_0x115d50){return _0x251dae['define'](_0x7770('0x7'),attributes,{'tableName':_0x7770('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7770('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x416d=['./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3a9da8,_0x4a6ba2){var _0x5d3ee1=function(_0x3f2348){while(--_0x3f2348){_0x3a9da8['push'](_0x3a9da8['shift']());}};_0x5d3ee1(++_0x4a6ba2);}(_0x416d,0x1b7));var _0xd416=function(_0x1c445a,_0xea7543){_0x1c445a=_0x1c445a-0x0;var _0x33e4ad=_0x416d[_0x1c445a];return _0x33e4ad;};'use strict';var _=require(_0xd416('0x0'));var util=require(_0xd416('0x1'));var logger=require('../../config/logger')(_0xd416('0x2'));var moment=require(_0xd416('0x3'));var BPromise=require(_0xd416('0x4'));var rp=require(_0xd416('0x5'));var fs=require('fs');var path=require(_0xd416('0x6'));var rimraf=require(_0xd416('0x7'));var config=require(_0xd416('0x8'));var attributes=require(_0xd416('0x9'));module[_0xd416('0xa')]=function(_0x21dce9,_0x4d8bd7){return _0x21dce9['define'](_0xd416('0xb'),attributes,{'tableName':_0xd416('0xc'),'paranoid':![],'indexes':[{'name':_0xd416('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 2ac23e0..4315dcd 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 _0xe5d5=['request\x20sent','result','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0xe5d5,0x156));var _0x5e5d=function(_0x4e5deb,_0x128a26){_0x4e5deb=_0x4e5deb-0x0;var _0x22cde3=_0xe5d5[_0x4e5deb];return _0x22cde3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5e5d('0x0'));var BPromise=require('bluebird');var rs=require(_0x5e5d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e5d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e5d('0x3'))(_0x5e5d('0x4'));var config=require(_0x5e5d('0x5'));var jayson=require(_0x5e5d('0x6'));var client=jayson[_0x5e5d('0x7')][_0x5e5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3200d5,_0xab446c,_0x23de8d){return new BPromise(function(_0x131a59,_0x11973c){return client[_0x5e5d('0x9')](_0x3200d5,_0x23de8d)[_0x5e5d('0xa')](function(_0x5d3a3b){logger['info'](_0x5e5d('0xb'),_0xab446c,'request\x20sent');logger[_0x5e5d('0xc')](_0x5e5d('0xd'),_0xab446c,'request\x20sent',JSON[_0x5e5d('0xe')](_0x5d3a3b));if(_0x5d3a3b[_0x5e5d('0xf')]){if(_0x5d3a3b[_0x5e5d('0xf')][_0x5e5d('0x10')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xab446c,_0x5d3a3b[_0x5e5d('0xf')][_0x5e5d('0x11')]);return _0x11973c(_0x5d3a3b['error'][_0x5e5d('0x11')]);}logger[_0x5e5d('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0xab446c,_0x5d3a3b[_0x5e5d('0xf')][_0x5e5d('0x11')]);return _0x131a59(_0x5d3a3b['error']['message']);}else{logger['info'](_0x5e5d('0xb'),_0xab446c,_0x5e5d('0x12'));_0x131a59(_0x5d3a3b[_0x5e5d('0x13')][_0x5e5d('0x11')]);}})['catch'](function(_0x132532){logger[_0x5e5d('0xf')](_0x5e5d('0xb'),_0xab446c,_0x132532);_0x11973c(_0x132532);});});} \ No newline at end of file +var _0x4300=['stringify','error','code','message','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2eaad5,_0x2df3b4){var _0x142f0b=function(_0x136eed){while(--_0x136eed){_0x2eaad5['push'](_0x2eaad5['shift']());}};_0x142f0b(++_0x2df3b4);}(_0x4300,0x1a6));var _0x0430=function(_0x476a55,_0x2315ee){_0x476a55=_0x476a55-0x0;var _0x559314=_0x4300[_0x476a55];return _0x559314;};'use strict';var _=require(_0x0430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0430('0x1'));var db=require(_0x0430('0x2'))['db'];var utils=require(_0x0430('0x3'));var logger=require(_0x0430('0x4'))(_0x0430('0x5'));var config=require('../../config/environment');var jayson=require(_0x0430('0x6'));var client=jayson['client'][_0x0430('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5b03ef,_0x2388b9,_0xc83312){return new BPromise(function(_0x408b14,_0x31964e){return client[_0x0430('0x8')](_0x5b03ef,_0xc83312)[_0x0430('0x9')](function(_0x3a9dc1){logger[_0x0430('0xa')](_0x0430('0xb'),_0x2388b9,'request\x20sent');logger[_0x0430('0xc')](_0x0430('0xd'),_0x2388b9,_0x0430('0xe'),JSON[_0x0430('0xf')](_0x3a9dc1));if(_0x3a9dc1[_0x0430('0x10')]){if(_0x3a9dc1[_0x0430('0x10')][_0x0430('0x11')]===0x1f4){logger[_0x0430('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x2388b9,_0x3a9dc1['error'][_0x0430('0x12')]);return _0x31964e(_0x3a9dc1[_0x0430('0x10')][_0x0430('0x12')]);}logger[_0x0430('0x10')](_0x0430('0xb'),_0x2388b9,_0x3a9dc1[_0x0430('0x10')][_0x0430('0x12')]);return _0x408b14(_0x3a9dc1['error'][_0x0430('0x12')]);}else{logger[_0x0430('0xa')](_0x0430('0xb'),_0x2388b9,_0x0430('0xe'));_0x408b14(_0x3a9dc1['result']['message']);}})['catch'](function(_0x54fbf8){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2388b9,_0x54fbf8);_0x31964e(_0x54fbf8);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 312a27e..baa5482 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 _0x138b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','/:id/download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','basename','extname','now','single','file','create','put','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x229532,_0x1c0e67){var _0x598c8a=function(_0x3e25ac){while(--_0x3e25ac){_0x229532['push'](_0x229532['shift']());}};_0x598c8a(++_0x1c0e67);}(_0x138b,0xb5));var _0xb138=function(_0x3fc4e9,_0x5a0973){_0x3fc4e9=_0x3fc4e9-0x0;var _0x5a2714=_0x138b[_0x3fc4e9];return _0x5a2714;};'use strict';var multer=require(_0xb138('0x0'));var util=require(_0xb138('0x1'));var path=require('path');var timeout=require(_0xb138('0x2'));var express=require(_0xb138('0x3'));var router=express[_0xb138('0x4')]();var fs_extra=require(_0xb138('0x5'));var auth=require(_0xb138('0x6'));var interaction=require(_0xb138('0x7'));var config=require(_0xb138('0x8'));var controller=require(_0xb138('0x9'));router[_0xb138('0xa')]('/',auth[_0xb138('0xb')](),controller['index']);router[_0xb138('0xa')](_0xb138('0xc'),auth['isAuthenticated'](),controller[_0xb138('0xd')]);router[_0xb138('0xa')](_0xb138('0xe'),auth[_0xb138('0xb')](),controller['download']);var upload=multer({'storage':multer[_0xb138('0xf')]({'destination':function(_0x4bd10b,_0x135c84,_0x6a4ddb){_0x6a4ddb(null,path[_0xb138('0x10')](config['root'],_0xb138('0x11')));},'filename':function(_0x9193a2,_0x1d1135,_0x21dbc9){_0x1d1135[_0xb138('0x12')]=_0x1d1135['originalname'][_0xb138('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x21dbc9(null,util[_0xb138('0x14')]('%s-%s%s',path[_0xb138('0x15')](_0x1d1135[_0xb138('0x12')],path[_0xb138('0x16')](_0x1d1135['originalname'])),Date[_0xb138('0x17')](),path[_0xb138('0x16')](_0x1d1135[_0xb138('0x12')])));}})});router['post']('/',upload[_0xb138('0x18')](_0xb138('0x19')),controller[_0xb138('0x1a')]);router[_0xb138('0x1b')]('/:id',auth[_0xb138('0xb')](),controller[_0xb138('0x1c')]);router['delete'](_0xb138('0xc'),auth['isAuthenticated'](),controller[_0xb138('0x1d')]);module[_0xb138('0x1e')]=router; \ No newline at end of file +var _0x7551=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','/:id/download','isAuthenticated','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','put','update','delete','exports','util','path'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0x7551,0xd0));var _0x1755=function(_0x2fcb77,_0x1010b3){_0x2fcb77=_0x2fcb77-0x0;var _0x32b232=_0x7551[_0x2fcb77];return _0x32b232;};'use strict';var multer=require('multer');var util=require(_0x1755('0x0'));var path=require(_0x1755('0x1'));var timeout=require(_0x1755('0x2'));var express=require(_0x1755('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1755('0x4'));var interaction=require(_0x1755('0x5'));var config=require(_0x1755('0x6'));var controller=require(_0x1755('0x7'));router[_0x1755('0x8')]('/',auth['isAuthenticated'](),controller[_0x1755('0x9')]);router['get'](_0x1755('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1755('0x8')](_0x1755('0xb'),auth[_0x1755('0xc')](),controller[_0x1755('0xd')]);var upload=multer({'storage':multer[_0x1755('0xe')]({'destination':function(_0x3e2500,_0x575894,_0x344ab8){_0x344ab8(null,path[_0x1755('0xf')](config[_0x1755('0x10')],'server/files/sounds/original/'));},'filename':function(_0x556eba,_0x1de13c,_0x1ca5ba){_0x1de13c[_0x1755('0x11')]=_0x1de13c[_0x1755('0x11')][_0x1755('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1ca5ba(null,util[_0x1755('0x13')](_0x1755('0x14'),path[_0x1755('0x15')](_0x1de13c[_0x1755('0x11')],path[_0x1755('0x16')](_0x1de13c[_0x1755('0x11')])),Date[_0x1755('0x17')](),path[_0x1755('0x16')](_0x1de13c['originalname'])));}})});router[_0x1755('0x18')]('/',upload[_0x1755('0x19')]('file'),controller['create']);router[_0x1755('0x1a')](_0x1755('0xa'),auth[_0x1755('0xc')](),controller[_0x1755('0x1b')]);router[_0x1755('0x1c')]('/:id',auth[_0x1755('0xc')](),controller[_0x1755('0x1c')]);module[_0x1755('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 739175f..1c815db 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 _0x9ab7=['BIGINT','sequelize','exports','STRING','name','INTEGER','FLOAT'];(function(_0x22afd5,_0x1b69a2){var _0x5aef1b=function(_0x5c4a0f){while(--_0x5c4a0f){_0x22afd5['push'](_0x22afd5['shift']());}};_0x5aef1b(++_0x1b69a2);}(_0x9ab7,0x1b3));var _0x79ab=function(_0x3c5cfb,_0x638f43){_0x3c5cfb=_0x3c5cfb-0x0;var _0x2fdbb0=_0x9ab7[_0x3c5cfb];return _0x2fdbb0;};'use strict';var Sequelize=require(_0x79ab('0x0'));module[_0x79ab('0x1')]={'name':{'type':Sequelize[_0x79ab('0x2')],'unique':_0x79ab('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x79ab('0x2')]},'display_name':{'type':Sequelize[_0x79ab('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x79ab('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x79ab('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x79ab('0x4')]},'converted_format':{'type':Sequelize[_0x79ab('0x2')]},'converted_duration':{'type':Sequelize[_0x79ab('0x5')]},'converted_sampleCount':{'type':Sequelize[_0x79ab('0x6')]},'converted_channelCount':{'type':Sequelize[_0x79ab('0x4')]},'converted_bitRate':{'type':Sequelize[_0x79ab('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x79ab('0x4')]}}; \ No newline at end of file +var _0x9a08=['sequelize','exports','name','STRING','FLOAT','INTEGER'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x9a08,0xae));var _0x89a0=function(_0x3654c5,_0x2f4ecd){_0x3654c5=_0x3654c5-0x0;var _0xf5f082=_0x9a08[_0x3654c5];return _0xf5f082;};'use strict';var Sequelize=require(_0x89a0('0x0'));module[_0x89a0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x89a0('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x89a0('0x3')]},'display_name':{'type':Sequelize[_0x89a0('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x89a0('0x3')]},'original_format':{'type':Sequelize[_0x89a0('0x3')]},'original_duration':{'type':Sequelize[_0x89a0('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x89a0('0x5')]},'converted_format':{'type':Sequelize[_0x89a0('0x3')]},'converted_duration':{'type':Sequelize[_0x89a0('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x89a0('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x89a0('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d460ece..dd7fc14 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 _0xe482=['status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','get','Sounds','sendStatus','error','name','send','index','map','Sound','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','download','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','%s.%s','basename','file','extname','filename','originalname','substring','wav','server/files/sounds/original','format','info','chmodSync','0777','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','channelCount','converted_bitRate','converted_sampleRate','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end'];(function(_0xf99fa5,_0x344738){var _0x2bce29=function(_0x4dd184){while(--_0x4dd184){_0xf99fa5['push'](_0xf99fa5['shift']());}};_0x2bce29(++_0x344738);}(_0xe482,0x1e4));var _0x2e48=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xe482[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0x2e48('0x0'));var rimraf=require(_0x2e48('0x1'));var zipdir=require(_0x2e48('0x2'));var jsonpatch=require(_0x2e48('0x3'));var rp=require(_0x2e48('0x4'));var moment=require(_0x2e48('0x5'));var BPromise=require(_0x2e48('0x6'));var Mustache=require(_0x2e48('0x7'));var util=require('util');var path=require(_0x2e48('0x8'));var sox=require(_0x2e48('0x9'));var csv=require('to-csv');var ejs=require(_0x2e48('0xa'));var fs=require('fs');var fs_extra=require(_0x2e48('0xb'));var _=require(_0x2e48('0xc'));var squel=require(_0x2e48('0xd'));var crypto=require(_0x2e48('0xe'));var jsforce=require(_0x2e48('0xf'));var deskjs=require(_0x2e48('0x10'));var toCsv=require(_0x2e48('0x11'));var querystring=require(_0x2e48('0x12'));var Papa=require('papaparse');var Redis=require(_0x2e48('0x13'));var authService=require(_0x2e48('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2e48('0x15'));var hardwareService=require(_0x2e48('0x16'));var logger=require(_0x2e48('0x17'))('api');var utils=require(_0x2e48('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2e48('0x19'));var db=require(_0x2e48('0x1a'))['db'];function respondWithStatusCode(_0x1e8afb,_0x18547d){_0x18547d=_0x18547d||0xcc;return function(_0x1bddf8){if(_0x1bddf8){return _0x1e8afb['sendStatus'](_0x18547d);}return _0x1e8afb['status'](_0x18547d)[_0x2e48('0x1b')]();};}function respondWithResult(_0x591073,_0x5bc57c){_0x5bc57c=_0x5bc57c||0xc8;return function(_0x306bb4){if(_0x306bb4){return _0x591073[_0x2e48('0x1c')](_0x5bc57c)['json'](_0x306bb4);}};}function respondWithFilteredResult(_0x4e262f,_0x59e607){return function(_0x10dc36){if(_0x10dc36){var _0x4f9311=typeof _0x59e607[_0x2e48('0x1d')]===_0x2e48('0x1e')&&typeof _0x59e607[_0x2e48('0x1f')]==='undefined';var _0x53f8c5=_0x10dc36[_0x2e48('0x20')];var _0x2366d8=_0x4f9311?0x0:_0x59e607['offset'];var _0x4a4049=_0x4f9311?_0x10dc36['count']:_0x59e607[_0x2e48('0x1d')]+_0x59e607['limit'];var _0x4dac2c;if(_0x4a4049>=_0x53f8c5){_0x4a4049=_0x53f8c5;_0x4dac2c=0xc8;}else{_0x4dac2c=0xce;}_0x4e262f[_0x2e48('0x1c')](_0x4dac2c);return _0x4e262f[_0x2e48('0x21')](_0x2e48('0x22'),_0x2366d8+'-'+_0x4a4049+'/'+_0x53f8c5)[_0x2e48('0x23')](_0x10dc36);}return null;};}function patchUpdates(_0xc59a54){return function(_0x1a70cb){try{jsonpatch['apply'](_0x1a70cb,_0xc59a54,!![]);}catch(_0x244895){return BPromise[_0x2e48('0x24')](_0x244895);}return _0x1a70cb['save']();};}function saveUpdates(_0x479c60,_0x556cdd){return function(_0x340d9f){if(_0x340d9f){return _0x340d9f[_0x2e48('0x25')](_0x479c60)[_0x2e48('0x26')](function(_0x93ff8f){return _0x93ff8f;});}return null;};}function removeEntity(_0x24e168,_0x39265f){return function(_0x1dfc1b){if(_0x1dfc1b){return _0x1dfc1b[_0x2e48('0x27')]()['then'](function(){var _0x432f28=_0x1dfc1b[_0x2e48('0x28')]({'plain':!![]});var _0x1f3d01=_0x2e48('0x29');return db['UserProfileResource'][_0x2e48('0x27')]({'where':{'type':_0x1f3d01,'resourceId':_0x432f28['id']}})[_0x2e48('0x26')](function(){return _0x1dfc1b;});})['then'](function(){_0x24e168[_0x2e48('0x1c')](0xcc)[_0x2e48('0x1b')]();});}};}function handleEntityNotFound(_0x1fac71,_0x330893){return function(_0x58827c){if(!_0x58827c){_0x1fac71[_0x2e48('0x2a')](0x194);}return _0x58827c;};}function handleError(_0x3efe36,_0x5e200f){_0x5e200f=_0x5e200f||0x1f4;return function(_0x5d201b){logger[_0x2e48('0x2b')](_0x5d201b['stack']);if(_0x5d201b['name']){delete _0x5d201b[_0x2e48('0x2c')];}_0x3efe36[_0x2e48('0x1c')](_0x5e200f)[_0x2e48('0x2d')](_0x5d201b);};}exports[_0x2e48('0x2e')]=function(_0xbb25a4,_0x103685){var _0x3932b1={},_0x92d6e={},_0x5dad68={'count':0x0,'rows':[]};var _0x1abf77=_[_0x2e48('0x2f')](db[_0x2e48('0x30')][_0x2e48('0x31')],function(_0x371e26){return{'name':_0x371e26['fieldName'],'type':_0x371e26[_0x2e48('0x32')][_0x2e48('0x33')]};});_0x92d6e['model']=_['map'](_0x1abf77,_0x2e48('0x2c'));_0x92d6e[_0x2e48('0x34')]=_[_0x2e48('0x35')](_0xbb25a4['query']);_0x92d6e[_0x2e48('0x36')]=_[_0x2e48('0x37')](_0x92d6e[_0x2e48('0x38')],_0x92d6e[_0x2e48('0x34')]);_0x3932b1['attributes']=_[_0x2e48('0x37')](_0x92d6e['model'],qs[_0x2e48('0x39')](_0xbb25a4[_0x2e48('0x34')][_0x2e48('0x39')]));_0x3932b1[_0x2e48('0x3a')]=_0x3932b1[_0x2e48('0x3a')][_0x2e48('0x3b')]?_0x3932b1[_0x2e48('0x3a')]:_0x92d6e[_0x2e48('0x38')];if(!_0xbb25a4[_0x2e48('0x34')][_0x2e48('0x3c')](_0x2e48('0x3d'))){_0x3932b1[_0x2e48('0x1f')]=qs[_0x2e48('0x1f')](_0xbb25a4[_0x2e48('0x34')][_0x2e48('0x1f')]);_0x3932b1[_0x2e48('0x1d')]=qs[_0x2e48('0x1d')](_0xbb25a4[_0x2e48('0x34')][_0x2e48('0x1d')]);}_0x3932b1[_0x2e48('0x3e')]=qs[_0x2e48('0x3f')](_0xbb25a4[_0x2e48('0x34')]['sort']);_0x3932b1[_0x2e48('0x40')]=qs[_0x2e48('0x36')](_[_0x2e48('0x41')](_0xbb25a4[_0x2e48('0x34')],_0x92d6e[_0x2e48('0x36')]),_0x1abf77);if(_0xbb25a4[_0x2e48('0x34')][_0x2e48('0x42')]){_0x3932b1['where']=_[_0x2e48('0x43')](_0x3932b1[_0x2e48('0x40')],{'$or':_['map'](_0x1abf77,function(_0x1da74c){if(_0x1da74c[_0x2e48('0x32')]!==_0x2e48('0x44')){var _0x36ef79={};_0x36ef79[_0x1da74c[_0x2e48('0x2c')]]={'$like':'%'+_0xbb25a4[_0x2e48('0x34')]['filter']+'%'};return _0x36ef79;}})});}_0x3932b1=_[_0x2e48('0x43')]({},_0x3932b1,_0xbb25a4['options']);var _0x5e3bd1={'where':_0x3932b1['where']};return db['Sound'][_0x2e48('0x20')](_0x5e3bd1)[_0x2e48('0x26')](function(_0x41e872){_0x5dad68['count']=_0x41e872;if(_0xbb25a4[_0x2e48('0x34')][_0x2e48('0x45')]){_0x3932b1[_0x2e48('0x46')]=[{'all':!![]}];}return db['Sound'][_0x2e48('0x47')](_0x3932b1);})[_0x2e48('0x26')](function(_0x40f146){_0x5dad68[_0x2e48('0x48')]=_0x40f146;return _0x5dad68;})[_0x2e48('0x26')](respondWithFilteredResult(_0x103685,_0x3932b1))[_0x2e48('0x49')](handleError(_0x103685,null));};exports[_0x2e48('0x4a')]=function(_0x4e7129,_0x501abc){var _0x7efebc={'raw':!![],'where':{'id':_0x4e7129['params']['id']}},_0x587968={};_0x587968[_0x2e48('0x38')]=_[_0x2e48('0x35')](db[_0x2e48('0x30')]['rawAttributes']);_0x587968[_0x2e48('0x34')]=_['keys'](_0x4e7129[_0x2e48('0x34')]);_0x587968['filters']=_[_0x2e48('0x37')](_0x587968[_0x2e48('0x38')],_0x587968['query']);_0x7efebc['attributes']=_[_0x2e48('0x37')](_0x587968['model'],qs[_0x2e48('0x39')](_0x4e7129[_0x2e48('0x34')][_0x2e48('0x39')]));_0x7efebc['attributes']=_0x7efebc[_0x2e48('0x3a')][_0x2e48('0x3b')]?_0x7efebc['attributes']:_0x587968[_0x2e48('0x38')];if(_0x4e7129[_0x2e48('0x34')][_0x2e48('0x45')]){_0x7efebc['include']=[{'all':!![]}];}_0x7efebc=_[_0x2e48('0x43')]({},_0x7efebc,_0x4e7129[_0x2e48('0x4b')]);return db[_0x2e48('0x30')][_0x2e48('0x4c')](_0x7efebc)[_0x2e48('0x26')](handleEntityNotFound(_0x501abc,null))[_0x2e48('0x26')](respondWithResult(_0x501abc,null))['catch'](handleError(_0x501abc,null));};exports[_0x2e48('0x4d')]=function(_0x359f9b,_0x739589,_0x46069f){return db[_0x2e48('0x30')][_0x2e48('0x4c')]({'where':{'id':_0x359f9b['params']['id']},'attributes':[_0x2e48('0x2c'),_0x2e48('0x4e'),_0x2e48('0x4f')],'raw':!![]})[_0x2e48('0x26')](handleEntityNotFound(_0x739589,null))[_0x2e48('0x26')](function(_0x2a1164){if(_0x2a1164){if(!fs['existsSync'](path[_0x2e48('0x50')](config['root'],_0x2e48('0x51'),_0x2a1164[_0x2e48('0x4e')]+'.'+_0x2a1164[_0x2e48('0x4f')]))){throw new db[(_0x2e48('0x52'))][(_0x2e48('0x53'))](_0x2e48('0x54'));}return _0x739589['download'](path[_0x2e48('0x50')](config[_0x2e48('0x55')],_0x2e48('0x51'),util['format'](_0x2e48('0x56'),_0x2a1164['save_name'],_0x2a1164[_0x2e48('0x4f')])),util['format'](_0x2e48('0x56'),_0x2a1164['name'],_0x2a1164[_0x2e48('0x4f')]));}return null;})[_0x2e48('0x49')](handleError(_0x739589,null));};exports['create']=function(_0x435b06,_0x38cb9a,_0x338b84){var _0x3220dd={'name':path[_0x2e48('0x57')](_0x435b06[_0x2e48('0x58')]['originalname'],path[_0x2e48('0x59')](_0x435b06[_0x2e48('0x58')]['originalname'])),'save_name':path[_0x2e48('0x57')](_0x435b06['file'][_0x2e48('0x5a')],path[_0x2e48('0x59')](_0x435b06[_0x2e48('0x58')]['filename'])),'original_format':path['extname'](_0x435b06[_0x2e48('0x58')][_0x2e48('0x5b')])[_0x2e48('0x5c')](0x1),'converted_format':_0x2e48('0x5d')};var _0x24b155=path[_0x2e48('0x50')](config[_0x2e48('0x55')],_0x2e48('0x5e'),_0x435b06[_0x2e48('0x58')][_0x2e48('0x5a')]);var _0x103468=path[_0x2e48('0x50')](config['root'],_0x2e48('0x51'),util[_0x2e48('0x5f')]('%s.%s',path[_0x2e48('0x57')](_0x435b06[_0x2e48('0x58')][_0x2e48('0x5a')],path[_0x2e48('0x59')](_0x435b06[_0x2e48('0x58')][_0x2e48('0x5a')])),_0x3220dd[_0x2e48('0x4f')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x24b155);logger[_0x2e48('0x60')]('Sound\x20upload\x20destination:\x20%s',_0x103468);try{fs[_0x2e48('0x61')](_0x24b155,parseInt(_0x2e48('0x62'),0x8));var _0x144530=sox[_0x2e48('0x63')](_0x24b155,_0x103468,{'sampleRate':0x1f40,'format':_0x2e48('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x144530['on'](_0x2e48('0x2b'),function(_0x27f4c5){fs[_0x2e48('0x64')](_0x24b155);_0x38cb9a[_0x2e48('0x1c')](0x1f4)[_0x2e48('0x2d')](_0x27f4c5);});_0x144530['on']('src',function(_0x40abd2){_0x3220dd['original_duration']=isNaN(_0x40abd2['duration'])?null:_0x40abd2[_0x2e48('0x65')]*0x3e8;_0x3220dd[_0x2e48('0x66')]=isNaN(_0x40abd2['sampleCount'])?null:_0x40abd2[_0x2e48('0x67')];_0x3220dd[_0x2e48('0x68')]=isNaN(_0x40abd2['channelCount'])?null:_0x40abd2['channelCount'];_0x3220dd['original_bitRate']=isNaN(_0x40abd2[_0x2e48('0x69')])?null:_0x40abd2[_0x2e48('0x69')];_0x3220dd[_0x2e48('0x6a')]=isNaN(_0x40abd2[_0x2e48('0x6b')])?null:_0x40abd2[_0x2e48('0x6b')];});_0x144530['on'](_0x2e48('0x6c'),function(_0x29362f){_0x3220dd[_0x2e48('0x6d')]=isNaN(_0x29362f[_0x2e48('0x65')])?null:_0x29362f['duration']*0x3e8;_0x3220dd[_0x2e48('0x6e')]=isNaN(_0x29362f[_0x2e48('0x67')])?null:_0x29362f[_0x2e48('0x67')];_0x3220dd[_0x2e48('0x6f')]=isNaN(_0x29362f[_0x2e48('0x70')])?null:_0x29362f['channelCount'];_0x3220dd[_0x2e48('0x71')]=isNaN(_0x29362f[_0x2e48('0x69')])?null:_0x29362f[_0x2e48('0x69')];_0x3220dd[_0x2e48('0x72')]=isNaN(_0x29362f[_0x2e48('0x6b')])?null:_0x29362f['sampleRate'];});_0x144530['on'](_0x2e48('0x1b'),function(){fs['chmodSync'](_0x103468,parseInt('0777',0x8));return db[_0x2e48('0x30')][_0x2e48('0x73')](_0x3220dd)[_0x2e48('0x26')](function(_0x379794){var _0x33b6b4={'role':_0x435b06[_0x2e48('0x74')][_0x2e48('0x75')],'userProfileId':_0x435b06[_0x2e48('0x74')]['userProfileId']};if(!_0x33b6b4)throw new Error(_0x2e48('0x76'));if(_0x33b6b4[_0x2e48('0x75')]===_0x2e48('0x77')){var _0x477a8a=_0x379794[_0x2e48('0x28')]({'plain':!![]});return db[_0x2e48('0x78')]['find']({'where':{'name':_0x2e48('0x29'),'userProfileId':_0x33b6b4[_0x2e48('0x79')]},'raw':!![]})[_0x2e48('0x26')](function(_0x3e2301){if(_0x3e2301&&_0x3e2301['autoAssociation']===0x0){return db[_0x2e48('0x7a')][_0x2e48('0x73')]({'name':_0x477a8a[_0x2e48('0x2c')],'resourceId':_0x477a8a['id'],'type':_0x3e2301[_0x2e48('0x2c')],'sectionId':_0x3e2301['id']},{})[_0x2e48('0x26')](function(){return _0x379794;});}else{return _0x379794;}})[_0x2e48('0x49')](function(_0x4202b7){logger[_0x2e48('0x2b')](_0x2e48('0x7b'),_0x4202b7);throw _0x4202b7;});}return _0x379794;})[_0x2e48('0x26')](respondWithResult(_0x38cb9a,null))[_0x2e48('0x49')](handleError(_0x38cb9a,null));});_0x144530['start']();}catch(_0x4c146d){_0x38cb9a[_0x2e48('0x1c')](0x1f4)['send'](_0x4c146d);}};exports[_0x2e48('0x25')]=function(_0x581b93,_0x32fc0d,_0x1f8952){return db['Sound']['find']({'where':{'id':_0x581b93[_0x2e48('0x7c')]['id']}})[_0x2e48('0x26')](handleEntityNotFound(_0x32fc0d,null))['then'](saveUpdates(_[_0x2e48('0x41')](_0x581b93[_0x2e48('0x74')],[_0x2e48('0x2c'),_0x2e48('0x7d')]),null))[_0x2e48('0x26')](respondWithResult(_0x32fc0d,null))[_0x2e48('0x49')](handleError(_0x32fc0d,null));};exports[_0x2e48('0x7e')]=function(_0x2cbffd,_0x5b2f88,_0x40c2d4){return db[_0x2e48('0x30')][_0x2e48('0x4c')]({'where':{'id':_0x2cbffd['params']['id']}})['then'](function(_0x40436e){if(_0x40436e){return _0x40436e[_0x2e48('0x27')]();}})[_0x2e48('0x26')](function(_0x39555e){var _0x8560a9=path[_0x2e48('0x50')](config[_0x2e48('0x55')],_0x2e48('0x5e'),util[_0x2e48('0x5f')](_0x2e48('0x56'),_0x39555e[_0x2e48('0x4e')],_0x39555e[_0x2e48('0x7f')]));var _0x5723b7=path[_0x2e48('0x50')](config[_0x2e48('0x55')],_0x2e48('0x51'),util[_0x2e48('0x5f')](_0x2e48('0x56'),_0x39555e[_0x2e48('0x4e')],_0x39555e[_0x2e48('0x4f')]));fs[_0x2e48('0x64')](_0x8560a9);fs[_0x2e48('0x64')](_0x5723b7);return _0x39555e;})[_0x2e48('0x26')](function(_0x41bd9b){if(_0x41bd9b){return _0x5b2f88[_0x2e48('0x1c')](0xcc)[_0x2e48('0x1b')]();}})[_0x2e48('0x26')](handleEntityNotFound(_0x5b2f88,null))[_0x2e48('0x49')](handleError(_0x5b2f88,null));}; \ No newline at end of file +var _0x0792=['ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','basename','file','originalname','extname','filename','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','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','start','send','params','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','end','error','name','index','map','Sound','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','show','keys','find','catch','save_name','converted_format','existsSync','join','server/files/sounds/converted'];(function(_0x59016a,_0x4d07a7){var _0x5c112c=function(_0x132066){while(--_0x132066){_0x59016a['push'](_0x59016a['shift']());}};_0x5c112c(++_0x4d07a7);}(_0x0792,0x18b));var _0x2079=function(_0x59f97a,_0x511696){_0x59f97a=_0x59f97a-0x0;var _0x411b33=_0x0792[_0x59f97a];return _0x411b33;};'use strict';var emlformat=require(_0x2079('0x0'));var rimraf=require(_0x2079('0x1'));var zipdir=require(_0x2079('0x2'));var jsonpatch=require(_0x2079('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2079('0x4'));var Mustache=require(_0x2079('0x5'));var util=require('util');var path=require(_0x2079('0x6'));var sox=require(_0x2079('0x7'));var csv=require('to-csv');var ejs=require(_0x2079('0x8'));var fs=require('fs');var fs_extra=require(_0x2079('0x9'));var _=require(_0x2079('0xa'));var squel=require(_0x2079('0xb'));var crypto=require(_0x2079('0xc'));var jsforce=require(_0x2079('0xd'));var deskjs=require(_0x2079('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2079('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2079('0x10'));var qs=require(_0x2079('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2079('0x12'));var utils=require(_0x2079('0x13'));var config=require(_0x2079('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2079('0x15'))['db'];function respondWithStatusCode(_0x31362c,_0x597ec5){_0x597ec5=_0x597ec5||0xcc;return function(_0x4757e4){if(_0x4757e4){return _0x31362c[_0x2079('0x16')](_0x597ec5);}return _0x31362c[_0x2079('0x17')](_0x597ec5)['end']();};}function respondWithResult(_0x46f704,_0x4af203){_0x4af203=_0x4af203||0xc8;return function(_0x3a7348){if(_0x3a7348){return _0x46f704[_0x2079('0x17')](_0x4af203)[_0x2079('0x18')](_0x3a7348);}};}function respondWithFilteredResult(_0x3d5ee7,_0xc953fc){return function(_0xe1f305){if(_0xe1f305){var _0x4b14e5=typeof _0xc953fc[_0x2079('0x19')]===_0x2079('0x1a')&&typeof _0xc953fc[_0x2079('0x1b')]===_0x2079('0x1a');var _0x2917eb=_0xe1f305['count'];var _0x4406c4=_0x4b14e5?0x0:_0xc953fc[_0x2079('0x19')];var _0x361414=_0x4b14e5?_0xe1f305[_0x2079('0x1c')]:_0xc953fc['offset']+_0xc953fc[_0x2079('0x1b')];var _0x1159bc;if(_0x361414>=_0x2917eb){_0x361414=_0x2917eb;_0x1159bc=0xc8;}else{_0x1159bc=0xce;}_0x3d5ee7[_0x2079('0x17')](_0x1159bc);return _0x3d5ee7[_0x2079('0x1d')](_0x2079('0x1e'),_0x4406c4+'-'+_0x361414+'/'+_0x2917eb)[_0x2079('0x18')](_0xe1f305);}return null;};}function patchUpdates(_0x56d4e1){return function(_0x23d4aa){try{jsonpatch['apply'](_0x23d4aa,_0x56d4e1,!![]);}catch(_0x1514fe){return BPromise[_0x2079('0x1f')](_0x1514fe);}return _0x23d4aa['save']();};}function saveUpdates(_0x2a66c1,_0x2d4022){return function(_0x4de690){if(_0x4de690){return _0x4de690[_0x2079('0x20')](_0x2a66c1)['then'](function(_0x40946c){return _0x40946c;});}return null;};}function removeEntity(_0x2b8d3c,_0x52a67e){return function(_0x11dc6d){if(_0x11dc6d){return _0x11dc6d[_0x2079('0x21')]()[_0x2079('0x22')](function(){var _0x257cc7=_0x11dc6d[_0x2079('0x23')]({'plain':!![]});var _0x33ad89='Sounds';return db[_0x2079('0x24')][_0x2079('0x21')]({'where':{'type':_0x33ad89,'resourceId':_0x257cc7['id']}})[_0x2079('0x22')](function(){return _0x11dc6d;});})['then'](function(){_0x2b8d3c[_0x2079('0x17')](0xcc)[_0x2079('0x25')]();});}};}function handleEntityNotFound(_0x21a949,_0x391250){return function(_0x2e24ed){if(!_0x2e24ed){_0x21a949['sendStatus'](0x194);}return _0x2e24ed;};}function handleError(_0x204d70,_0xc286b8){_0xc286b8=_0xc286b8||0x1f4;return function(_0x1abfaf){logger[_0x2079('0x26')](_0x1abfaf['stack']);if(_0x1abfaf[_0x2079('0x27')]){delete _0x1abfaf[_0x2079('0x27')];}_0x204d70[_0x2079('0x17')](_0xc286b8)['send'](_0x1abfaf);};}exports[_0x2079('0x28')]=function(_0x443833,_0xd27189){var _0x5a76d4={},_0x2190f5={},_0x203a4d={'count':0x0,'rows':[]};var _0x149720=_[_0x2079('0x29')](db[_0x2079('0x2a')]['rawAttributes'],function(_0x3a2441){return{'name':_0x3a2441['fieldName'],'type':_0x3a2441['type'][_0x2079('0x2b')]};});_0x2190f5['model']=_['map'](_0x149720,'name');_0x2190f5[_0x2079('0x2c')]=_['keys'](_0x443833[_0x2079('0x2c')]);_0x2190f5[_0x2079('0x2d')]=_['intersection'](_0x2190f5['model'],_0x2190f5[_0x2079('0x2c')]);_0x5a76d4['attributes']=_[_0x2079('0x2e')](_0x2190f5[_0x2079('0x2f')],qs[_0x2079('0x30')](_0x443833['query'][_0x2079('0x30')]));_0x5a76d4[_0x2079('0x31')]=_0x5a76d4[_0x2079('0x31')][_0x2079('0x32')]?_0x5a76d4['attributes']:_0x2190f5[_0x2079('0x2f')];if(!_0x443833[_0x2079('0x2c')]['hasOwnProperty'](_0x2079('0x33'))){_0x5a76d4[_0x2079('0x1b')]=qs[_0x2079('0x1b')](_0x443833[_0x2079('0x2c')]['limit']);_0x5a76d4[_0x2079('0x19')]=qs[_0x2079('0x19')](_0x443833[_0x2079('0x2c')][_0x2079('0x19')]);}_0x5a76d4[_0x2079('0x34')]=qs['sort'](_0x443833[_0x2079('0x2c')][_0x2079('0x35')]);_0x5a76d4[_0x2079('0x36')]=qs['filters'](_[_0x2079('0x37')](_0x443833[_0x2079('0x2c')],_0x2190f5[_0x2079('0x2d')]),_0x149720);if(_0x443833[_0x2079('0x2c')]['filter']){_0x5a76d4[_0x2079('0x36')]=_[_0x2079('0x38')](_0x5a76d4[_0x2079('0x36')],{'$or':_[_0x2079('0x29')](_0x149720,function(_0x12f00d){if(_0x12f00d['type']!=='VIRTUAL'){var _0x5e8d52={};_0x5e8d52[_0x12f00d[_0x2079('0x27')]]={'$like':'%'+_0x443833[_0x2079('0x2c')][_0x2079('0x39')]+'%'};return _0x5e8d52;}})});}_0x5a76d4=_[_0x2079('0x38')]({},_0x5a76d4,_0x443833['options']);var _0x18cd95={'where':_0x5a76d4[_0x2079('0x36')]};return db[_0x2079('0x2a')]['count'](_0x18cd95)['then'](function(_0x5cfc45){_0x203a4d['count']=_0x5cfc45;if(_0x443833['query'][_0x2079('0x3a')]){_0x5a76d4[_0x2079('0x3b')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x5a76d4);})[_0x2079('0x22')](function(_0x4e0efb){_0x203a4d['rows']=_0x4e0efb;return _0x203a4d;})[_0x2079('0x22')](respondWithFilteredResult(_0xd27189,_0x5a76d4))['catch'](handleError(_0xd27189,null));};exports[_0x2079('0x3c')]=function(_0x327bd5,_0x1cd9ba){var _0x50c424={'raw':!![],'where':{'id':_0x327bd5['params']['id']}},_0xc6b69e={};_0xc6b69e[_0x2079('0x2f')]=_['keys'](db[_0x2079('0x2a')]['rawAttributes']);_0xc6b69e['query']=_[_0x2079('0x3d')](_0x327bd5[_0x2079('0x2c')]);_0xc6b69e[_0x2079('0x2d')]=_['intersection'](_0xc6b69e[_0x2079('0x2f')],_0xc6b69e['query']);_0x50c424[_0x2079('0x31')]=_[_0x2079('0x2e')](_0xc6b69e[_0x2079('0x2f')],qs['fields'](_0x327bd5[_0x2079('0x2c')][_0x2079('0x30')]));_0x50c424[_0x2079('0x31')]=_0x50c424[_0x2079('0x31')][_0x2079('0x32')]?_0x50c424['attributes']:_0xc6b69e[_0x2079('0x2f')];if(_0x327bd5['query'][_0x2079('0x3a')]){_0x50c424[_0x2079('0x3b')]=[{'all':!![]}];}_0x50c424=_[_0x2079('0x38')]({},_0x50c424,_0x327bd5['options']);return db[_0x2079('0x2a')][_0x2079('0x3e')](_0x50c424)['then'](handleEntityNotFound(_0x1cd9ba,null))[_0x2079('0x22')](respondWithResult(_0x1cd9ba,null))[_0x2079('0x3f')](handleError(_0x1cd9ba,null));};exports['download']=function(_0x466030,_0x23385f,_0x1be0ed){return db[_0x2079('0x2a')][_0x2079('0x3e')]({'where':{'id':_0x466030['params']['id']},'attributes':[_0x2079('0x27'),_0x2079('0x40'),_0x2079('0x41')],'raw':!![]})['then'](handleEntityNotFound(_0x23385f,null))[_0x2079('0x22')](function(_0x5abc37){if(_0x5abc37){if(!fs[_0x2079('0x42')](path[_0x2079('0x43')](config['root'],_0x2079('0x44'),_0x5abc37[_0x2079('0x40')]+'.'+_0x5abc37[_0x2079('0x41')]))){throw new db['Sequelize'][(_0x2079('0x45'))](_0x2079('0x46'));}return _0x23385f[_0x2079('0x47')](path[_0x2079('0x43')](config[_0x2079('0x48')],_0x2079('0x44'),util[_0x2079('0x49')](_0x2079('0x4a'),_0x5abc37['save_name'],_0x5abc37['converted_format'])),util['format'](_0x2079('0x4a'),_0x5abc37[_0x2079('0x27')],_0x5abc37['converted_format']));}return null;})[_0x2079('0x3f')](handleError(_0x23385f,null));};exports['create']=function(_0x211c97,_0x2e68fa,_0x4b849f){var _0x3307a3={'name':path[_0x2079('0x4b')](_0x211c97[_0x2079('0x4c')][_0x2079('0x4d')],path[_0x2079('0x4e')](_0x211c97[_0x2079('0x4c')][_0x2079('0x4d')])),'save_name':path[_0x2079('0x4b')](_0x211c97[_0x2079('0x4c')][_0x2079('0x4f')],path[_0x2079('0x4e')](_0x211c97['file'][_0x2079('0x4f')])),'original_format':path[_0x2079('0x4e')](_0x211c97['file'][_0x2079('0x4d')])['substring'](0x1),'converted_format':_0x2079('0x50')};var _0x2aeb86=path[_0x2079('0x43')](config['root'],_0x2079('0x51'),_0x211c97[_0x2079('0x4c')]['filename']);var _0x4b2354=path['join'](config['root'],_0x2079('0x44'),util[_0x2079('0x49')](_0x2079('0x4a'),path['basename'](_0x211c97[_0x2079('0x4c')][_0x2079('0x4f')],path[_0x2079('0x4e')](_0x211c97[_0x2079('0x4c')][_0x2079('0x4f')])),_0x3307a3[_0x2079('0x41')]));logger['info'](_0x2079('0x52'),_0x2aeb86);logger[_0x2079('0x53')](_0x2079('0x54'),_0x4b2354);try{fs[_0x2079('0x55')](_0x2aeb86,parseInt(_0x2079('0x56'),0x8));var _0x3e9293=sox[_0x2079('0x57')](_0x2aeb86,_0x4b2354,{'sampleRate':0x1f40,'format':_0x2079('0x50'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e9293['on'](_0x2079('0x26'),function(_0x4a9972){fs[_0x2079('0x58')](_0x2aeb86);_0x2e68fa['status'](0x1f4)['send'](_0x4a9972);});_0x3e9293['on'](_0x2079('0x59'),function(_0x498e0e){_0x3307a3['original_duration']=isNaN(_0x498e0e['duration'])?null:_0x498e0e[_0x2079('0x5a')]*0x3e8;_0x3307a3[_0x2079('0x5b')]=isNaN(_0x498e0e['sampleCount'])?null:_0x498e0e[_0x2079('0x5c')];_0x3307a3[_0x2079('0x5d')]=isNaN(_0x498e0e[_0x2079('0x5e')])?null:_0x498e0e[_0x2079('0x5e')];_0x3307a3[_0x2079('0x5f')]=isNaN(_0x498e0e[_0x2079('0x60')])?null:_0x498e0e[_0x2079('0x60')];_0x3307a3[_0x2079('0x61')]=isNaN(_0x498e0e[_0x2079('0x62')])?null:_0x498e0e[_0x2079('0x62')];});_0x3e9293['on'](_0x2079('0x63'),function(_0x5e4af6){_0x3307a3[_0x2079('0x64')]=isNaN(_0x5e4af6['duration'])?null:_0x5e4af6[_0x2079('0x5a')]*0x3e8;_0x3307a3[_0x2079('0x65')]=isNaN(_0x5e4af6[_0x2079('0x5c')])?null:_0x5e4af6[_0x2079('0x5c')];_0x3307a3[_0x2079('0x66')]=isNaN(_0x5e4af6[_0x2079('0x5e')])?null:_0x5e4af6[_0x2079('0x5e')];_0x3307a3['converted_bitRate']=isNaN(_0x5e4af6['bitRate'])?null:_0x5e4af6[_0x2079('0x60')];_0x3307a3[_0x2079('0x67')]=isNaN(_0x5e4af6[_0x2079('0x62')])?null:_0x5e4af6['sampleRate'];});_0x3e9293['on'](_0x2079('0x25'),function(){fs[_0x2079('0x55')](_0x4b2354,parseInt('0777',0x8));return db[_0x2079('0x2a')]['create'](_0x3307a3)[_0x2079('0x22')](function(_0x14c027){var _0x5270a7={'role':_0x211c97[_0x2079('0x68')]['role'],'userProfileId':_0x211c97[_0x2079('0x68')]['userProfileId']};if(!_0x5270a7)throw new Error(_0x2079('0x69'));if(_0x5270a7['role']===_0x2079('0x6a')){var _0x4943fb=_0x14c027[_0x2079('0x23')]({'plain':!![]});return db[_0x2079('0x6b')][_0x2079('0x3e')]({'where':{'name':_0x2079('0x6c'),'userProfileId':_0x5270a7[_0x2079('0x6d')]},'raw':!![]})[_0x2079('0x22')](function(_0x2264c4){if(_0x2264c4&&_0x2264c4[_0x2079('0x6e')]===0x0){return db[_0x2079('0x24')]['create']({'name':_0x4943fb['name'],'resourceId':_0x4943fb['id'],'type':_0x2264c4[_0x2079('0x27')],'sectionId':_0x2264c4['id']},{})[_0x2079('0x22')](function(){return _0x14c027;});}else{return _0x14c027;}})[_0x2079('0x3f')](function(_0xd1872){logger[_0x2079('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd1872);throw _0xd1872;});}return _0x14c027;})[_0x2079('0x22')](respondWithResult(_0x2e68fa,null))['catch'](handleError(_0x2e68fa,null));});_0x3e9293[_0x2079('0x6f')]();}catch(_0x5b5c7c){_0x2e68fa[_0x2079('0x17')](0x1f4)[_0x2079('0x70')](_0x5b5c7c);}};exports[_0x2079('0x20')]=function(_0x2a0606,_0x4c0886,_0x50e307){return db[_0x2079('0x2a')][_0x2079('0x3e')]({'where':{'id':_0x2a0606[_0x2079('0x71')]['id']}})[_0x2079('0x22')](handleEntityNotFound(_0x4c0886,null))[_0x2079('0x22')](saveUpdates(_['pick'](_0x2a0606[_0x2079('0x68')],[_0x2079('0x27'),'description']),null))[_0x2079('0x22')](respondWithResult(_0x4c0886,null))[_0x2079('0x3f')](handleError(_0x4c0886,null));};exports[_0x2079('0x72')]=function(_0x16875d,_0x3fdcff,_0x1ca53a){return db['Sound'][_0x2079('0x3e')]({'where':{'id':_0x16875d['params']['id']}})[_0x2079('0x22')](function(_0x43c835){if(_0x43c835){return _0x43c835[_0x2079('0x21')]();}})['then'](function(_0x1b3e2b){var _0x2c02e2=path['join'](config[_0x2079('0x48')],'server/files/sounds/original',util['format'](_0x2079('0x4a'),_0x1b3e2b[_0x2079('0x40')],_0x1b3e2b[_0x2079('0x73')]));var _0x4346be=path['join'](config[_0x2079('0x48')],_0x2079('0x44'),util[_0x2079('0x49')](_0x2079('0x4a'),_0x1b3e2b['save_name'],_0x1b3e2b[_0x2079('0x41')]));fs[_0x2079('0x58')](_0x2c02e2);fs[_0x2079('0x58')](_0x4346be);return _0x1b3e2b;})[_0x2079('0x22')](function(_0x1068fa){if(_0x1068fa){return _0x3fdcff[_0x2079('0x17')](0xcc)[_0x2079('0x25')]();}})[_0x2079('0x22')](handleEntityNotFound(_0x3fdcff,null))[_0x2079('0x3f')](handleError(_0x3fdcff,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 11f0f52..5cbcece 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 _0x09fa=['../../config/environment','./sound.attributes','exports','Sound','tools_sounds','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x09fa,0x1f1));var _0xa09f=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x09fa[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xa09f('0x0'));var util=require(_0xa09f('0x1'));var logger=require(_0xa09f('0x2'))(_0xa09f('0x3'));var moment=require('moment');var BPromise=require(_0xa09f('0x4'));var rp=require(_0xa09f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa09f('0x6'));var config=require(_0xa09f('0x7'));var attributes=require(_0xa09f('0x8'));module[_0xa09f('0x9')]=function(_0x3505bf,_0x671a27){return _0x3505bf['define'](_0xa09f('0xa'),attributes,{'tableName':_0xa09f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcaa9=['./sound.attributes','define','Sound','tools_sounds','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a8bd1,_0x57046e){var _0x2142b7=function(_0x3da3ea){while(--_0x3da3ea){_0x4a8bd1['push'](_0x4a8bd1['shift']());}};_0x2142b7(++_0x57046e);}(_0xcaa9,0x64));var _0x9caa=function(_0x261203,_0x5a896a){_0x261203=_0x261203-0x0;var _0x5aa992=_0xcaa9[_0x261203];return _0x5aa992;};'use strict';var _=require(_0x9caa('0x0'));var util=require(_0x9caa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9caa('0x2'));var BPromise=require(_0x9caa('0x3'));var rp=require(_0x9caa('0x4'));var fs=require('fs');var path=require(_0x9caa('0x5'));var rimraf=require(_0x9caa('0x6'));var config=require(_0x9caa('0x7'));var attributes=require(_0x9caa('0x8'));module['exports']=function(_0x1c80b9,_0x2a49bf){return _0x1c80b9[_0x9caa('0x9')](_0x9caa('0xa'),attributes,{'tableName':_0x9caa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 1d9d68e..62e5114 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 _0x6e80=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Sound','find','options','raw','map','include','model','attributes','ShowSound','stringify','util','moment','bluebird','randomstring','ioredis'];(function(_0x120e81,_0x1dd1e5){var _0x2008b9=function(_0x10a7c4){while(--_0x10a7c4){_0x120e81['push'](_0x120e81['shift']());}};_0x2008b9(++_0x1dd1e5);}(_0x6e80,0x171));var _0x06e8=function(_0x9ba257,_0x142e71){_0x9ba257=_0x9ba257-0x0;var _0xf298bd=_0x6e80[_0x9ba257];return _0xf298bd;};'use strict';var _=require('lodash');var util=require(_0x06e8('0x0'));var moment=require(_0x06e8('0x1'));var BPromise=require(_0x06e8('0x2'));var rs=require(_0x06e8('0x3'));var fs=require('fs');var Redis=require(_0x06e8('0x4'));var db=require(_0x06e8('0x5'))['db'];var utils=require(_0x06e8('0x6'));var logger=require(_0x06e8('0x7'))(_0x06e8('0x8'));var config=require('../../config/environment');var jayson=require(_0x06e8('0x9'));var client=jayson[_0x06e8('0xa')][_0x06e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39da08,_0xe451f7,_0x1a9fd7){return new BPromise(function(_0x2ba781,_0x217bfc){return client[_0x06e8('0xc')](_0x39da08,_0x1a9fd7)[_0x06e8('0xd')](function(_0x502c68){logger['info'](_0x06e8('0xe'),_0xe451f7,_0x06e8('0xf'));logger[_0x06e8('0x10')](_0x06e8('0x11'),_0xe451f7,_0x06e8('0xf'),JSON['stringify'](_0x502c68));if(_0x502c68[_0x06e8('0x12')]){if(_0x502c68[_0x06e8('0x12')][_0x06e8('0x13')]===0x1f4){logger['error'](_0x06e8('0xe'),_0xe451f7,_0x502c68[_0x06e8('0x12')]['message']);return _0x217bfc(_0x502c68[_0x06e8('0x12')][_0x06e8('0x14')]);}logger[_0x06e8('0x12')](_0x06e8('0xe'),_0xe451f7,_0x502c68[_0x06e8('0x12')][_0x06e8('0x14')]);return _0x2ba781(_0x502c68[_0x06e8('0x12')][_0x06e8('0x14')]);}else{logger[_0x06e8('0x15')]('Sound,\x20%s,\x20%s',_0xe451f7,'request\x20sent');_0x2ba781(_0x502c68[_0x06e8('0x16')]['message']);}})[_0x06e8('0x17')](function(_0x3db34a){logger[_0x06e8('0x12')](_0x06e8('0xe'),_0xe451f7,_0x3db34a);_0x217bfc(_0x3db34a);});});}exports['ShowSound']=function(_0x24cd4f){var _0x4fa622=this;return new Promise(function(_0x2830b5,_0x10ec70){return db[_0x06e8('0x18')][_0x06e8('0x19')]({'raw':_0x24cd4f[_0x06e8('0x1a')]?_0x24cd4f[_0x06e8('0x1a')][_0x06e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x24cd4f[_0x06e8('0x1a')]?_0x24cd4f['options']['where']||null:null,'attributes':_0x24cd4f[_0x06e8('0x1a')]?_0x24cd4f[_0x06e8('0x1a')]['attributes']||null:null,'include':_0x24cd4f[_0x06e8('0x1a')]?_0x24cd4f['options']['include']?_[_0x06e8('0x1c')](_0x24cd4f['options'][_0x06e8('0x1d')],function(_0x516cb0){return{'model':db[_0x516cb0[_0x06e8('0x1e')]],'as':_0x516cb0['as'],'attributes':_0x516cb0[_0x06e8('0x1f')],'include':_0x516cb0[_0x06e8('0x1d')]?_['map'](_0x516cb0[_0x06e8('0x1d')],function(_0x33503e){return{'model':db[_0x33503e[_0x06e8('0x1e')]],'as':_0x33503e['as'],'attributes':_0x33503e['attributes'],'include':_0x33503e['include']?_[_0x06e8('0x1c')](_0x33503e[_0x06e8('0x1d')],function(_0x4449d8){return{'model':db[_0x4449d8[_0x06e8('0x1e')]],'as':_0x4449d8['as'],'attributes':_0x4449d8[_0x06e8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x06e8('0xd')](function(_0x3c8579){logger[_0x06e8('0x15')]('ShowSound',_0x24cd4f);logger[_0x06e8('0x10')](_0x06e8('0x20'),_0x24cd4f,JSON[_0x06e8('0x21')](_0x3c8579));_0x2830b5(_0x3c8579);})[_0x06e8('0x17')](function(_0x1fa8a7){logger[_0x06e8('0x12')]('ShowSound',_0x1fa8a7[_0x06e8('0x14')],_0x24cd4f);_0x10ec70(_0x4fa622['error'](0x1f4,_0x1fa8a7[_0x06e8('0x14')]));});});}; \ No newline at end of file +var _0x0e42=['attributes','include','model','map','debug','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSound','options','where'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x0e42,0x1f3));var _0x20e4=function(_0xb4fcbe,_0x30eb8a){_0xb4fcbe=_0xb4fcbe-0x0;var _0xe71e51=_0x0e42[_0xb4fcbe];return _0xe71e51;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x20e4('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20e4('0x1'));var db=require(_0x20e4('0x2'))['db'];var utils=require(_0x20e4('0x3'));var logger=require(_0x20e4('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x20e4('0x5')][_0x20e4('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2c7d3f,_0x4c9788,_0x5965ce){return new BPromise(function(_0x50aa89,_0x1beefb){return client[_0x20e4('0x7')](_0x2c7d3f,_0x5965ce)[_0x20e4('0x8')](function(_0x4c59fa){logger[_0x20e4('0x9')](_0x20e4('0xa'),_0x4c9788,'request\x20sent');logger['debug'](_0x20e4('0xb'),_0x4c9788,_0x20e4('0xc'),JSON[_0x20e4('0xd')](_0x4c59fa));if(_0x4c59fa['error']){if(_0x4c59fa[_0x20e4('0xe')][_0x20e4('0xf')]===0x1f4){logger['error'](_0x20e4('0xa'),_0x4c9788,_0x4c59fa[_0x20e4('0xe')][_0x20e4('0x10')]);return _0x1beefb(_0x4c59fa[_0x20e4('0xe')]['message']);}logger[_0x20e4('0xe')](_0x20e4('0xa'),_0x4c9788,_0x4c59fa[_0x20e4('0xe')]['message']);return _0x50aa89(_0x4c59fa[_0x20e4('0xe')][_0x20e4('0x10')]);}else{logger[_0x20e4('0x9')](_0x20e4('0xa'),_0x4c9788,_0x20e4('0xc'));_0x50aa89(_0x4c59fa['result']['message']);}})[_0x20e4('0x11')](function(_0x47c9e4){logger[_0x20e4('0xe')](_0x20e4('0xa'),_0x4c9788,_0x47c9e4);_0x1beefb(_0x47c9e4);});});}exports[_0x20e4('0x12')]=function(_0x493c5d){var _0x55d6e2=this;return new Promise(function(_0x318513,_0x459559){return db['Sound']['find']({'raw':_0x493c5d[_0x20e4('0x13')]?_0x493c5d['options']['raw']===undefined?!![]:![]:!![],'where':_0x493c5d[_0x20e4('0x13')]?_0x493c5d[_0x20e4('0x13')][_0x20e4('0x14')]||null:null,'attributes':_0x493c5d[_0x20e4('0x13')]?_0x493c5d[_0x20e4('0x13')][_0x20e4('0x15')]||null:null,'include':_0x493c5d[_0x20e4('0x13')]?_0x493c5d[_0x20e4('0x13')][_0x20e4('0x16')]?_['map'](_0x493c5d[_0x20e4('0x13')]['include'],function(_0x1cc410){return{'model':db[_0x1cc410[_0x20e4('0x17')]],'as':_0x1cc410['as'],'attributes':_0x1cc410[_0x20e4('0x15')],'include':_0x1cc410[_0x20e4('0x16')]?_[_0x20e4('0x18')](_0x1cc410[_0x20e4('0x16')],function(_0x4e76e3){return{'model':db[_0x4e76e3[_0x20e4('0x17')]],'as':_0x4e76e3['as'],'attributes':_0x4e76e3[_0x20e4('0x15')],'include':_0x4e76e3[_0x20e4('0x16')]?_['map'](_0x4e76e3[_0x20e4('0x16')],function(_0x1ec929){return{'model':db[_0x1ec929[_0x20e4('0x17')]],'as':_0x1ec929['as'],'attributes':_0x1ec929[_0x20e4('0x15')]};}):[]};}):[]};}):[]:[]})[_0x20e4('0x8')](function(_0x4fb6aa){logger[_0x20e4('0x9')](_0x20e4('0x12'),_0x493c5d);logger[_0x20e4('0x19')](_0x20e4('0x12'),_0x493c5d,JSON[_0x20e4('0xd')](_0x4fb6aa));_0x318513(_0x4fb6aa);})['catch'](function(_0x434845){logger[_0x20e4('0xe')](_0x20e4('0x12'),_0x434845[_0x20e4('0x10')],_0x493c5d);_0x459559(_0x55d6e2[_0x20e4('0xe')](0x1f4,_0x434845[_0x20e4('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 9234962..c6e997a 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x4130bd,_0x43c118){var _0x4c9085=function(_0x2db30d){while(--_0x2db30d){_0x4130bd['push'](_0x4130bd['shift']());}};_0x4c9085(++_0x43c118);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x5eb8[_0x2f0057];return _0x17f2c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0xfe4a32,_0x6ad009){var _0x370186=function(_0x215110){while(--_0x215110){_0xfe4a32['push'](_0xfe4a32['shift']());}};_0x370186(++_0x6ad009);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xb7e7[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index f30c55a..1086416 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 _0xa00d=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0x25ddcd,_0x1525d4){var _0x4471dc=function(_0x5101fd){while(--_0x5101fd){_0x25ddcd['push'](_0x25ddcd['shift']());}};_0x4471dc(++_0x1525d4);}(_0xa00d,0xd3));var _0xda00=function(_0x19ee0d,_0x3a909d){_0x19ee0d=_0x19ee0d-0x0;var _0x341ff5=_0xa00d[_0x19ee0d];return _0x341ff5;};'use strict';var Sequelize=require(_0xda00('0x0'));module[_0xda00('0x1')]={'uniqueid':{'type':Sequelize[_0xda00('0x2')]},'body':{'type':Sequelize[_0xda00('0x3')](_0xda00('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xda00('0x5')),'defaultValue':_0xda00('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xda00('0x3')]}}; \ No newline at end of file +var _0xe31e=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0x405904,_0x404fa0){var _0xf2fb32=function(_0x1adc32){while(--_0x1adc32){_0x405904['push'](_0x405904['shift']());}};_0xf2fb32(++_0x404fa0);}(_0xe31e,0x79));var _0xee31=function(_0x4fc055,_0x360e05){_0x4fc055=_0x4fc055-0x0;var _0x294a39=_0xe31e[_0x4fc055];return _0x294a39;};'use strict';var Sequelize=require(_0xee31('0x0'));module[_0xee31('0x1')]={'uniqueid':{'type':Sequelize[_0xee31('0x2')]},'body':{'type':Sequelize[_0xee31('0x3')](_0xee31('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xee31('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xee31('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 607deb2..d45b037 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 _0xb1ee=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','SquareMessage','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','map','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xb1ee,0x11e));var _0xeb1e=function(_0x379799,_0x4ccf16){_0x379799=_0x379799-0x0;var _0x46e431=_0xb1ee[_0x379799];return _0x46e431;};'use strict';var emlformat=require(_0xeb1e('0x0'));var rimraf=require(_0xeb1e('0x1'));var zipdir=require(_0xeb1e('0x2'));var jsonpatch=require(_0xeb1e('0x3'));var rp=require(_0xeb1e('0x4'));var moment=require(_0xeb1e('0x5'));var BPromise=require(_0xeb1e('0x6'));var Mustache=require(_0xeb1e('0x7'));var util=require(_0xeb1e('0x8'));var path=require(_0xeb1e('0x9'));var sox=require('sox');var csv=require(_0xeb1e('0xa'));var ejs=require(_0xeb1e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb1e('0xc'));var squel=require(_0xeb1e('0xd'));var crypto=require('crypto');var jsforce=require(_0xeb1e('0xe'));var deskjs=require(_0xeb1e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeb1e('0x10'));var Papa=require(_0xeb1e('0x11'));var Redis=require(_0xeb1e('0x12'));var authService=require(_0xeb1e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb1e('0x14'));var logger=require(_0xeb1e('0x15'))(_0xeb1e('0x16'));var utils=require(_0xeb1e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeb1e('0x18'))['db'];function respondWithStatusCode(_0x198db9,_0x5c3c12){_0x5c3c12=_0x5c3c12||0xcc;return function(_0x58471b){if(_0x58471b){return _0x198db9[_0xeb1e('0x19')](_0x5c3c12);}return _0x198db9[_0xeb1e('0x1a')](_0x5c3c12)['end']();};}function respondWithResult(_0x1c9722,_0x8a5e14){_0x8a5e14=_0x8a5e14||0xc8;return function(_0x5c37ac){if(_0x5c37ac){return _0x1c9722[_0xeb1e('0x1a')](_0x8a5e14)[_0xeb1e('0x1b')](_0x5c37ac);}};}function respondWithFilteredResult(_0x5f246e,_0x5b381f){return function(_0xa268aa){if(_0xa268aa){var _0x170056=typeof _0x5b381f[_0xeb1e('0x1c')]===_0xeb1e('0x1d')&&typeof _0x5b381f[_0xeb1e('0x1e')]==='undefined';var _0x443f79=_0xa268aa[_0xeb1e('0x1f')];var _0x183197=_0x170056?0x0:_0x5b381f[_0xeb1e('0x1c')];var _0x3b73e3=_0x170056?_0xa268aa[_0xeb1e('0x1f')]:_0x5b381f[_0xeb1e('0x1c')]+_0x5b381f[_0xeb1e('0x1e')];var _0x272241;if(_0x3b73e3>=_0x443f79){_0x3b73e3=_0x443f79;_0x272241=0xc8;}else{_0x272241=0xce;}_0x5f246e[_0xeb1e('0x1a')](_0x272241);return _0x5f246e[_0xeb1e('0x20')](_0xeb1e('0x21'),_0x183197+'-'+_0x3b73e3+'/'+_0x443f79)['json'](_0xa268aa);}return null;};}function patchUpdates(_0x3875bd){return function(_0x581955){try{jsonpatch[_0xeb1e('0x22')](_0x581955,_0x3875bd,!![]);}catch(_0x2f1ce5){return BPromise['reject'](_0x2f1ce5);}return _0x581955[_0xeb1e('0x23')]();};}function saveUpdates(_0x1672e1,_0x347b7c){return function(_0x4fc8b0){if(_0x4fc8b0){return _0x4fc8b0[_0xeb1e('0x24')](_0x1672e1)[_0xeb1e('0x25')](function(_0x25999e){return _0x25999e;});}return null;};}function removeEntity(_0x1e23ae,_0xf867ec){return function(_0x495f35){if(_0x495f35){return _0x495f35['destroy']()['then'](function(){_0x1e23ae[_0xeb1e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29873e,_0x440f07){return function(_0xf2b0f){if(!_0xf2b0f){_0x29873e[_0xeb1e('0x19')](0x194);}return _0xf2b0f;};}function handleError(_0x227083,_0x4f3fc8){_0x4f3fc8=_0x4f3fc8||0x1f4;return function(_0x598be4){logger[_0xeb1e('0x26')](_0x598be4['stack']);if(_0x598be4[_0xeb1e('0x27')]){delete _0x598be4['name'];}_0x227083[_0xeb1e('0x1a')](_0x4f3fc8)[_0xeb1e('0x28')](_0x598be4);};}exports[_0xeb1e('0x29')]=function(_0x192e70,_0xb4f1a2){var _0x33a721={},_0x5b6d1c={},_0x2e61b6={'count':0x0,'rows':[]};var _0x4a7334=_['map'](db[_0xeb1e('0x2a')][_0xeb1e('0x2b')],function(_0x2de83e){return{'name':_0x2de83e[_0xeb1e('0x2c')],'type':_0x2de83e['type'][_0xeb1e('0x2d')]};});_0x5b6d1c[_0xeb1e('0x2e')]=_['map'](_0x4a7334,_0xeb1e('0x27'));_0x5b6d1c['query']=_[_0xeb1e('0x2f')](_0x192e70['query']);_0x5b6d1c[_0xeb1e('0x30')]=_[_0xeb1e('0x31')](_0x5b6d1c['model'],_0x5b6d1c[_0xeb1e('0x32')]);_0x33a721[_0xeb1e('0x33')]=_[_0xeb1e('0x31')](_0x5b6d1c[_0xeb1e('0x2e')],qs[_0xeb1e('0x34')](_0x192e70[_0xeb1e('0x32')][_0xeb1e('0x34')]));_0x33a721[_0xeb1e('0x33')]=_0x33a721['attributes'][_0xeb1e('0x35')]?_0x33a721[_0xeb1e('0x33')]:_0x5b6d1c['model'];if(!_0x192e70[_0xeb1e('0x32')][_0xeb1e('0x36')]('nolimit')){_0x33a721[_0xeb1e('0x1e')]=qs[_0xeb1e('0x1e')](_0x192e70[_0xeb1e('0x32')]['limit']);_0x33a721['offset']=qs[_0xeb1e('0x1c')](_0x192e70[_0xeb1e('0x32')]['offset']);}_0x33a721['order']=qs[_0xeb1e('0x37')](_0x192e70[_0xeb1e('0x32')][_0xeb1e('0x37')]);_0x33a721[_0xeb1e('0x38')]=qs[_0xeb1e('0x30')](_['pick'](_0x192e70[_0xeb1e('0x32')],_0x5b6d1c[_0xeb1e('0x30')]),_0x4a7334);if(_0x192e70[_0xeb1e('0x32')][_0xeb1e('0x39')]){_0x33a721[_0xeb1e('0x38')]=_[_0xeb1e('0x3a')](_0x33a721[_0xeb1e('0x38')],{'$or':_[_0xeb1e('0x3b')](_0x4a7334,function(_0x3e8a23){if(_0x3e8a23[_0xeb1e('0x3c')]!==_0xeb1e('0x3d')){var _0x2e9f64={};_0x2e9f64[_0x3e8a23[_0xeb1e('0x27')]]={'$like':'%'+_0x192e70[_0xeb1e('0x32')]['filter']+'%'};return _0x2e9f64;}})});}_0x33a721=_[_0xeb1e('0x3a')]({},_0x33a721,_0x192e70['options']);var _0x262fa0={'where':_0x33a721[_0xeb1e('0x38')]};return db['SquareMessage'][_0xeb1e('0x1f')](_0x262fa0)['then'](function(_0x53e1aa){_0x2e61b6['count']=_0x53e1aa;if(_0x192e70[_0xeb1e('0x32')][_0xeb1e('0x3e')]){_0x33a721['include']=[{'all':!![]}];}return db[_0xeb1e('0x2a')][_0xeb1e('0x3f')](_0x33a721);})[_0xeb1e('0x25')](function(_0x52e751){_0x2e61b6[_0xeb1e('0x40')]=_0x52e751;return _0x2e61b6;})[_0xeb1e('0x25')](respondWithFilteredResult(_0xb4f1a2,_0x33a721))[_0xeb1e('0x41')](handleError(_0xb4f1a2,null));};exports[_0xeb1e('0x42')]=function(_0x14a0b2,_0x4f48ac){var _0x16bf76={'raw':!![],'where':{'id':_0x14a0b2[_0xeb1e('0x43')]['id']}},_0x1dd541={};_0x1dd541[_0xeb1e('0x2e')]=_[_0xeb1e('0x2f')](db[_0xeb1e('0x2a')][_0xeb1e('0x2b')]);_0x1dd541[_0xeb1e('0x32')]=_[_0xeb1e('0x2f')](_0x14a0b2[_0xeb1e('0x32')]);_0x1dd541[_0xeb1e('0x30')]=_[_0xeb1e('0x31')](_0x1dd541[_0xeb1e('0x2e')],_0x1dd541[_0xeb1e('0x32')]);_0x16bf76[_0xeb1e('0x33')]=_[_0xeb1e('0x31')](_0x1dd541[_0xeb1e('0x2e')],qs['fields'](_0x14a0b2[_0xeb1e('0x32')][_0xeb1e('0x34')]));_0x16bf76[_0xeb1e('0x33')]=_0x16bf76['attributes']['length']?_0x16bf76[_0xeb1e('0x33')]:_0x1dd541['model'];if(_0x14a0b2[_0xeb1e('0x32')][_0xeb1e('0x3e')]){_0x16bf76[_0xeb1e('0x44')]=[{'all':!![]}];}_0x16bf76=_[_0xeb1e('0x3a')]({},_0x16bf76,_0x14a0b2[_0xeb1e('0x45')]);return db[_0xeb1e('0x2a')][_0xeb1e('0x46')](_0x16bf76)[_0xeb1e('0x25')](handleEntityNotFound(_0x4f48ac,null))[_0xeb1e('0x25')](respondWithResult(_0x4f48ac,null))[_0xeb1e('0x41')](handleError(_0x4f48ac,null));};exports[_0xeb1e('0x47')]=function(_0x150ea8,_0x69cc28){return db[_0xeb1e('0x2a')][_0xeb1e('0x47')](_0x150ea8[_0xeb1e('0x48')],{})['then'](respondWithResult(_0x69cc28,0xc9))[_0xeb1e('0x41')](handleError(_0x69cc28,null));};exports[_0xeb1e('0x24')]=function(_0x3d499a,_0xbe8a3c){if(_0x3d499a[_0xeb1e('0x48')]['id']){delete _0x3d499a['body']['id'];}return db[_0xeb1e('0x2a')][_0xeb1e('0x46')]({'where':{'id':_0x3d499a[_0xeb1e('0x43')]['id']}})[_0xeb1e('0x25')](handleEntityNotFound(_0xbe8a3c,null))[_0xeb1e('0x25')](saveUpdates(_0x3d499a[_0xeb1e('0x48')],null))[_0xeb1e('0x25')](respondWithResult(_0xbe8a3c,null))[_0xeb1e('0x41')](handleError(_0xbe8a3c,null));};exports['destroy']=function(_0x2eaafc,_0x216df8){return db[_0xeb1e('0x2a')][_0xeb1e('0x46')]({'where':{'id':_0x2eaafc[_0xeb1e('0x43')]['id']}})[_0xeb1e('0x25')](handleEntityNotFound(_0x216df8,null))[_0xeb1e('0x25')](removeEntity(_0x216df8,null))['catch'](handleError(_0x216df8,null));}; \ No newline at end of file +var _0x955f=['undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0x955f,0x1eb));var _0xf955=function(_0x308a27,_0x335279){_0x308a27=_0x308a27-0x0;var _0x3251c2=_0x955f[_0x308a27];return _0x3251c2;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];function respondWithStatusCode(_0x542347,_0x23e0c6){_0x23e0c6=_0x23e0c6||0xcc;return function(_0x50d9a9){if(_0x50d9a9){return _0x542347[_0xf955('0x17')](_0x23e0c6);}return _0x542347[_0xf955('0x18')](_0x23e0c6)[_0xf955('0x19')]();};}function respondWithResult(_0x109bc5,_0x2080c4){_0x2080c4=_0x2080c4||0xc8;return function(_0x341b8c){if(_0x341b8c){return _0x109bc5[_0xf955('0x18')](_0x2080c4)[_0xf955('0x1a')](_0x341b8c);}};}function respondWithFilteredResult(_0x3c6af7,_0x24e75c){return function(_0x5350e4){if(_0x5350e4){var _0xc29b35=typeof _0x24e75c['offset']===_0xf955('0x1b')&&typeof _0x24e75c[_0xf955('0x1c')]===_0xf955('0x1b');var _0x15c07c=_0x5350e4['count'];var _0x5ac6cb=_0xc29b35?0x0:_0x24e75c[_0xf955('0x1d')];var _0xe6de5c=_0xc29b35?_0x5350e4[_0xf955('0x1e')]:_0x24e75c['offset']+_0x24e75c[_0xf955('0x1c')];var _0x3576fa;if(_0xe6de5c>=_0x15c07c){_0xe6de5c=_0x15c07c;_0x3576fa=0xc8;}else{_0x3576fa=0xce;}_0x3c6af7[_0xf955('0x18')](_0x3576fa);return _0x3c6af7[_0xf955('0x1f')](_0xf955('0x20'),_0x5ac6cb+'-'+_0xe6de5c+'/'+_0x15c07c)['json'](_0x5350e4);}return null;};}function patchUpdates(_0x17d86a){return function(_0x3dbbe8){try{jsonpatch[_0xf955('0x21')](_0x3dbbe8,_0x17d86a,!![]);}catch(_0x488d04){return BPromise[_0xf955('0x22')](_0x488d04);}return _0x3dbbe8['save']();};}function saveUpdates(_0x21ae24,_0x43b078){return function(_0x37143d){if(_0x37143d){return _0x37143d[_0xf955('0x23')](_0x21ae24)[_0xf955('0x24')](function(_0x565641){return _0x565641;});}return null;};}function removeEntity(_0x25f4f2,_0x5fab1c){return function(_0x3585c7){if(_0x3585c7){return _0x3585c7[_0xf955('0x25')]()[_0xf955('0x24')](function(){_0x25f4f2[_0xf955('0x18')](0xcc)[_0xf955('0x19')]();});}};}function handleEntityNotFound(_0x552cf3,_0x18f435){return function(_0x1acf33){if(!_0x1acf33){_0x552cf3[_0xf955('0x17')](0x194);}return _0x1acf33;};}function handleError(_0x406632,_0x2dcd55){_0x2dcd55=_0x2dcd55||0x1f4;return function(_0x13a86d){logger[_0xf955('0x26')](_0x13a86d['stack']);if(_0x13a86d[_0xf955('0x27')]){delete _0x13a86d[_0xf955('0x27')];}_0x406632[_0xf955('0x18')](_0x2dcd55)[_0xf955('0x28')](_0x13a86d);};}exports[_0xf955('0x29')]=function(_0x264f6d,_0x4d4af0){var _0x2232a7={},_0x1e5d37={},_0x4ec3e8={'count':0x0,'rows':[]};var _0x256df5=_[_0xf955('0x2a')](db[_0xf955('0x2b')][_0xf955('0x2c')],function(_0x59bfb5){return{'name':_0x59bfb5[_0xf955('0x2d')],'type':_0x59bfb5['type'][_0xf955('0x2e')]};});_0x1e5d37[_0xf955('0x2f')]=_[_0xf955('0x2a')](_0x256df5,_0xf955('0x27'));_0x1e5d37[_0xf955('0x30')]=_[_0xf955('0x31')](_0x264f6d[_0xf955('0x30')]);_0x1e5d37[_0xf955('0x32')]=_['intersection'](_0x1e5d37[_0xf955('0x2f')],_0x1e5d37[_0xf955('0x30')]);_0x2232a7[_0xf955('0x33')]=_[_0xf955('0x34')](_0x1e5d37['model'],qs[_0xf955('0x35')](_0x264f6d[_0xf955('0x30')][_0xf955('0x35')]));_0x2232a7[_0xf955('0x33')]=_0x2232a7[_0xf955('0x33')]['length']?_0x2232a7['attributes']:_0x1e5d37['model'];if(!_0x264f6d[_0xf955('0x30')][_0xf955('0x36')](_0xf955('0x37'))){_0x2232a7[_0xf955('0x1c')]=qs[_0xf955('0x1c')](_0x264f6d[_0xf955('0x30')]['limit']);_0x2232a7[_0xf955('0x1d')]=qs['offset'](_0x264f6d[_0xf955('0x30')][_0xf955('0x1d')]);}_0x2232a7[_0xf955('0x38')]=qs['sort'](_0x264f6d[_0xf955('0x30')]['sort']);_0x2232a7[_0xf955('0x39')]=qs[_0xf955('0x32')](_[_0xf955('0x3a')](_0x264f6d[_0xf955('0x30')],_0x1e5d37['filters']),_0x256df5);if(_0x264f6d[_0xf955('0x30')][_0xf955('0x3b')]){_0x2232a7['where']=_[_0xf955('0x3c')](_0x2232a7[_0xf955('0x39')],{'$or':_[_0xf955('0x2a')](_0x256df5,function(_0x547ed9){if(_0x547ed9[_0xf955('0x3d')]!==_0xf955('0x3e')){var _0x11b7e2={};_0x11b7e2[_0x547ed9['name']]={'$like':'%'+_0x264f6d[_0xf955('0x30')][_0xf955('0x3b')]+'%'};return _0x11b7e2;}})});}_0x2232a7=_[_0xf955('0x3c')]({},_0x2232a7,_0x264f6d[_0xf955('0x3f')]);var _0x2bfbe4={'where':_0x2232a7[_0xf955('0x39')]};return db[_0xf955('0x2b')][_0xf955('0x1e')](_0x2bfbe4)['then'](function(_0x8fa41b){_0x4ec3e8[_0xf955('0x1e')]=_0x8fa41b;if(_0x264f6d[_0xf955('0x30')][_0xf955('0x40')]){_0x2232a7[_0xf955('0x41')]=[{'all':!![]}];}return db[_0xf955('0x2b')][_0xf955('0x42')](_0x2232a7);})[_0xf955('0x24')](function(_0x47651b){_0x4ec3e8[_0xf955('0x43')]=_0x47651b;return _0x4ec3e8;})[_0xf955('0x24')](respondWithFilteredResult(_0x4d4af0,_0x2232a7))[_0xf955('0x44')](handleError(_0x4d4af0,null));};exports[_0xf955('0x45')]=function(_0x159ae3,_0x3557b5){var _0x248f60={'raw':!![],'where':{'id':_0x159ae3[_0xf955('0x46')]['id']}},_0x356ec2={};_0x356ec2[_0xf955('0x2f')]=_['keys'](db[_0xf955('0x2b')][_0xf955('0x2c')]);_0x356ec2[_0xf955('0x30')]=_['keys'](_0x159ae3[_0xf955('0x30')]);_0x356ec2['filters']=_[_0xf955('0x34')](_0x356ec2['model'],_0x356ec2[_0xf955('0x30')]);_0x248f60[_0xf955('0x33')]=_[_0xf955('0x34')](_0x356ec2[_0xf955('0x2f')],qs['fields'](_0x159ae3[_0xf955('0x30')][_0xf955('0x35')]));_0x248f60[_0xf955('0x33')]=_0x248f60['attributes']['length']?_0x248f60[_0xf955('0x33')]:_0x356ec2[_0xf955('0x2f')];if(_0x159ae3[_0xf955('0x30')][_0xf955('0x40')]){_0x248f60['include']=[{'all':!![]}];}_0x248f60=_[_0xf955('0x3c')]({},_0x248f60,_0x159ae3[_0xf955('0x3f')]);return db[_0xf955('0x2b')]['find'](_0x248f60)[_0xf955('0x24')](handleEntityNotFound(_0x3557b5,null))['then'](respondWithResult(_0x3557b5,null))[_0xf955('0x44')](handleError(_0x3557b5,null));};exports[_0xf955('0x47')]=function(_0x2c867f,_0x4dd592){return db[_0xf955('0x2b')][_0xf955('0x47')](_0x2c867f[_0xf955('0x48')],{})[_0xf955('0x24')](respondWithResult(_0x4dd592,0xc9))['catch'](handleError(_0x4dd592,null));};exports[_0xf955('0x23')]=function(_0x4ff0f1,_0x1c6d76){if(_0x4ff0f1[_0xf955('0x48')]['id']){delete _0x4ff0f1[_0xf955('0x48')]['id'];}return db['SquareMessage'][_0xf955('0x49')]({'where':{'id':_0x4ff0f1['params']['id']}})[_0xf955('0x24')](handleEntityNotFound(_0x1c6d76,null))['then'](saveUpdates(_0x4ff0f1[_0xf955('0x48')],null))['then'](respondWithResult(_0x1c6d76,null))['catch'](handleError(_0x1c6d76,null));};exports[_0xf955('0x25')]=function(_0x45c7fe,_0x4961cc){return db[_0xf955('0x2b')]['find']({'where':{'id':_0x45c7fe['params']['id']}})['then'](handleEntityNotFound(_0x4961cc,null))['then'](removeEntity(_0x4961cc,null))[_0xf955('0x44')](handleError(_0x4961cc,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3cf0373..4d94264 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 _0x8da4=['../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','util','moment','bluebird','path','rimraf'];(function(_0x22205c,_0x473493){var _0x3f5efe=function(_0x153dbb){while(--_0x153dbb){_0x22205c['push'](_0x22205c['shift']());}};_0x3f5efe(++_0x473493);}(_0x8da4,0x1a7));var _0x48da=function(_0x44ce7b,_0x221b6c){_0x44ce7b=_0x44ce7b-0x0;var _0x35e73c=_0x8da4[_0x44ce7b];return _0x35e73c;};'use strict';var _=require(_0x48da('0x0'));var util=require(_0x48da('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x48da('0x2'));var BPromise=require(_0x48da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48da('0x4'));var rimraf=require(_0x48da('0x5'));var config=require(_0x48da('0x6'));var attributes=require(_0x48da('0x7'));module[_0x48da('0x8')]=function(_0x5c464a,_0x50233d){return _0x5c464a[_0x48da('0x9')](_0x48da('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x300c=['./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x300c,0x1a8));var _0xc300=function(_0xd5955b,_0x1b5aa4){_0xd5955b=_0xd5955b-0x0;var _0x46e4ef=_0x300c[_0xd5955b];return _0x46e4ef;};'use strict';var _=require(_0xc300('0x0'));var util=require(_0xc300('0x1'));var logger=require('../../config/logger')(_0xc300('0x2'));var moment=require(_0xc300('0x3'));var BPromise=require(_0xc300('0x4'));var rp=require(_0xc300('0x5'));var fs=require('fs');var path=require(_0xc300('0x6'));var rimraf=require('rimraf');var config=require(_0xc300('0x7'));var attributes=require(_0xc300('0x8'));module['exports']=function(_0x3a239d,_0x18b424){return _0x3a239d[_0xc300('0x9')](_0xc300('0xa'),attributes,{'tableName':_0xc300('0xb'),'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 04c2133..79d4dfa 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 _0x9931=['code','error','SquareMessage,\x20%s,\x20%s','message','CreateSquareMessage','SquareMessage','body','options','raw','debug','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9931,0xe3));var _0x1993=function(_0x49a1e3,_0x47ac4d){_0x49a1e3=_0x49a1e3-0x0;var _0x48a8f8=_0x9931[_0x49a1e3];return _0x48a8f8;};'use strict';var _=require(_0x1993('0x0'));var util=require(_0x1993('0x1'));var moment=require('moment');var BPromise=require(_0x1993('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1993('0x3'));var logger=require(_0x1993('0x4'))(_0x1993('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1993('0x6')][_0x1993('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x703dd4,_0x4ace7f,_0x11809f){return new BPromise(function(_0x7bb018,_0x109519){return client[_0x1993('0x8')](_0x703dd4,_0x11809f)[_0x1993('0x9')](function(_0x34263c){logger[_0x1993('0xa')]('SquareMessage,\x20%s,\x20%s',_0x4ace7f,_0x1993('0xb'));logger['debug'](_0x1993('0xc'),_0x4ace7f,_0x1993('0xb'),JSON['stringify'](_0x34263c));if(_0x34263c['error']){if(_0x34263c['error'][_0x1993('0xd')]===0x1f4){logger[_0x1993('0xe')](_0x1993('0xf'),_0x4ace7f,_0x34263c['error'][_0x1993('0x10')]);return _0x109519(_0x34263c[_0x1993('0xe')][_0x1993('0x10')]);}logger['error'](_0x1993('0xf'),_0x4ace7f,_0x34263c[_0x1993('0xe')]['message']);return _0x7bb018(_0x34263c['error'][_0x1993('0x10')]);}else{logger[_0x1993('0xa')](_0x1993('0xf'),_0x4ace7f,_0x1993('0xb'));_0x7bb018(_0x34263c['result'][_0x1993('0x10')]);}})['catch'](function(_0x2b581e){logger[_0x1993('0xe')](_0x1993('0xf'),_0x4ace7f,_0x2b581e);_0x109519(_0x2b581e);});});}exports[_0x1993('0x11')]=function(_0x2af80b){var _0x306e89=this;return new Promise(function(_0x4f4ebd,_0x42a63f){return db[_0x1993('0x12')]['create'](_0x2af80b[_0x1993('0x13')],{'raw':_0x2af80b[_0x1993('0x14')]?_0x2af80b['options'][_0x1993('0x15')]===undefined?!![]:![]:!![]})[_0x1993('0x9')](function(_0x124df7){logger[_0x1993('0xa')](_0x1993('0x11'),_0x2af80b);logger[_0x1993('0x16')]('CreateSquareMessage',_0x2af80b,JSON['stringify'](_0x124df7));_0x4f4ebd(_0x124df7);})[_0x1993('0x17')](function(_0x30296c){logger[_0x1993('0xe')](_0x1993('0x11'),_0x30296c[_0x1993('0x10')],_0x2af80b);_0x42a63f(_0x306e89['error'](0x1f4,_0x30296c[_0x1993('0x10')]));});});}; \ No newline at end of file +var _0xd5e5=['SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug','code','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5e5,0x128));var _0x5d5e=function(_0xd4edf8,_0x3b7119){_0xd4edf8=_0xd4edf8-0x0;var _0x157cc3=_0xd5e5[_0xd4edf8];return _0x157cc3;};'use strict';var _=require('lodash');var util=require(_0x5d5e('0x0'));var moment=require(_0x5d5e('0x1'));var BPromise=require(_0x5d5e('0x2'));var rs=require(_0x5d5e('0x3'));var fs=require('fs');var Redis=require(_0x5d5e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d5e('0x5'));var logger=require('../../config/logger')(_0x5d5e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5d5e('0x7')][_0x5d5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x457b21,_0x470af5,_0x2b97c7){return new BPromise(function(_0x5ae8e8,_0x565b8e){return client[_0x5d5e('0x9')](_0x457b21,_0x2b97c7)[_0x5d5e('0xa')](function(_0x18333d){logger[_0x5d5e('0xb')]('SquareMessage,\x20%s,\x20%s',_0x470af5,_0x5d5e('0xc'));logger[_0x5d5e('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x470af5,_0x5d5e('0xc'),JSON['stringify'](_0x18333d));if(_0x18333d['error']){if(_0x18333d['error'][_0x5d5e('0xe')]===0x1f4){logger[_0x5d5e('0xf')](_0x5d5e('0x10'),_0x470af5,_0x18333d[_0x5d5e('0xf')][_0x5d5e('0x11')]);return _0x565b8e(_0x18333d['error'][_0x5d5e('0x11')]);}logger[_0x5d5e('0xf')]('SquareMessage,\x20%s,\x20%s',_0x470af5,_0x18333d[_0x5d5e('0xf')][_0x5d5e('0x11')]);return _0x5ae8e8(_0x18333d[_0x5d5e('0xf')][_0x5d5e('0x11')]);}else{logger[_0x5d5e('0xb')]('SquareMessage,\x20%s,\x20%s',_0x470af5,_0x5d5e('0xc'));_0x5ae8e8(_0x18333d[_0x5d5e('0x12')][_0x5d5e('0x11')]);}})[_0x5d5e('0x13')](function(_0xa87ee4){logger[_0x5d5e('0xf')](_0x5d5e('0x10'),_0x470af5,_0xa87ee4);_0x565b8e(_0xa87ee4);});});}exports[_0x5d5e('0x14')]=function(_0x4b1354){var _0x3bc7bc=this;return new Promise(function(_0x22a49c,_0x3ec07b){return db['SquareMessage'][_0x5d5e('0x15')](_0x4b1354[_0x5d5e('0x16')],{'raw':_0x4b1354[_0x5d5e('0x17')]?_0x4b1354[_0x5d5e('0x17')][_0x5d5e('0x18')]===undefined?!![]:![]:!![]})[_0x5d5e('0xa')](function(_0x3322b5){logger[_0x5d5e('0xb')]('CreateSquareMessage',_0x4b1354);logger[_0x5d5e('0xd')]('CreateSquareMessage',_0x4b1354,JSON[_0x5d5e('0x19')](_0x3322b5));_0x22a49c(_0x3322b5);})[_0x5d5e('0x13')](function(_0x5cba8f){logger[_0x5d5e('0xf')](_0x5d5e('0x14'),_0x5cba8f[_0x5d5e('0x11')],_0x4b1354);_0x3ec07b(_0x3bc7bc[_0x5d5e('0xf')](0x1f4,_0x5cba8f[_0x5d5e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c3c3333..71f8847 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 _0xd63d=['delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','update'];(function(_0x97cdb3,_0x938d4d){var _0x3f5816=function(_0x31ad29){while(--_0x31ad29){_0x97cdb3['push'](_0x97cdb3['shift']());}};_0x3f5816(++_0x938d4d);}(_0xd63d,0x80));var _0xdd63=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0xd63d[_0x211fef];return _0x5447bf;};'use strict';var multer=require('multer');var util=require(_0xdd63('0x0'));var path=require(_0xdd63('0x1'));var timeout=require('connect-timeout');var express=require(_0xdd63('0x2'));var router=express[_0xdd63('0x3')]();var fs_extra=require(_0xdd63('0x4'));var auth=require(_0xdd63('0x5'));var interaction=require(_0xdd63('0x6'));var config=require(_0xdd63('0x7'));var controller=require('./squareOdbc.controller');router[_0xdd63('0x8')]('/',auth[_0xdd63('0x9')](),controller[_0xdd63('0xa')]);router[_0xdd63('0x8')](_0xdd63('0xb'),auth['isAuthenticated'](),controller[_0xdd63('0xc')]);router['get'](_0xdd63('0xd'),auth[_0xdd63('0x9')](),timeout(_0xdd63('0xe')),controller[_0xdd63('0xf')]);router[_0xdd63('0x10')]('/',auth['isAuthenticated'](),controller[_0xdd63('0x11')]);router['put'](_0xdd63('0xb'),auth[_0xdd63('0x9')](),controller[_0xdd63('0x12')]);router[_0xdd63('0x13')](_0xdd63('0xb'),auth[_0xdd63('0x9')](),controller['destroy']);module[_0xdd63('0x14')]=router; \ No newline at end of file +var _0x5190=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','test','put','update','destroy','exports'];(function(_0x3c0070,_0x3b158c){var _0x287d90=function(_0x188662){while(--_0x188662){_0x3c0070['push'](_0x3c0070['shift']());}};_0x287d90(++_0x3b158c);}(_0x5190,0x78));var _0x0519=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0x5190[_0x1abeb2];return _0x48da20;};'use strict';var multer=require(_0x0519('0x0'));var util=require(_0x0519('0x1'));var path=require('path');var timeout=require(_0x0519('0x2'));var express=require(_0x0519('0x3'));var router=express[_0x0519('0x4')]();var fs_extra=require(_0x0519('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0519('0x6'));var config=require(_0x0519('0x7'));var controller=require(_0x0519('0x8'));router[_0x0519('0x9')]('/',auth['isAuthenticated'](),controller[_0x0519('0xa')]);router[_0x0519('0x9')](_0x0519('0xb'),auth[_0x0519('0xc')](),controller[_0x0519('0xd')]);router[_0x0519('0x9')](_0x0519('0xe'),auth[_0x0519('0xc')](),timeout('15s'),controller[_0x0519('0xf')]);router['post']('/',auth[_0x0519('0xc')](),controller['create']);router[_0x0519('0x10')](_0x0519('0xb'),auth['isAuthenticated'](),controller[_0x0519('0x11')]);router['delete'](_0x0519('0xb'),auth['isAuthenticated'](),controller[_0x0519('0x12')]);module[_0x0519('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 9849851..eca2844 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 _0x5373=['STRING','exports'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x5373,0x6b));var _0x3537=function(_0x4e54c4,_0x424136){_0x4e54c4=_0x4e54c4-0x0;var _0x58ad3a=_0x5373[_0x4e54c4];return _0x58ad3a;};'use strict';var Sequelize=require('sequelize');module[_0x3537('0x0')]={'name':{'type':Sequelize[_0x3537('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x3537('0x1')]},'description':{'type':Sequelize[_0x3537('0x1')]}}; \ No newline at end of file +var _0x0a7f=['STRING','sequelize'];(function(_0x3cb889,_0x2eefe6){var _0x13fe9a=function(_0x3e160a){while(--_0x3e160a){_0x3cb889['push'](_0x3cb889['shift']());}};_0x13fe9a(++_0x2eefe6);}(_0x0a7f,0x1b5));var _0xf0a7=function(_0x3a8bf9,_0x5f2c5e){_0x3a8bf9=_0x3a8bf9-0x0;var _0x1f9611=_0x0a7f[_0x3a8bf9];return _0x1f9611;};'use strict';var Sequelize=require(_0xf0a7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xf0a7('0x1')]},'description':{'type':Sequelize[_0xf0a7('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index a8ea8a3..e67a9c6 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 _0x853e=['status','json','offset','undefined','count','limit','apply','reject','save','then','destroy','get','ODBC','UserProfileResource','error','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x57de7f,_0x321fa6){var _0xe17e41=function(_0x4317ac){while(--_0x4317ac){_0x57de7f['push'](_0x57de7f['shift']());}};_0xe17e41(++_0x321fa6);}(_0x853e,0x199));var _0xe853=function(_0x2c6f25,_0xf392a1){_0x2c6f25=_0x2c6f25-0x0;var _0x5af365=_0x853e[_0x2c6f25];return _0x5af365;};'use strict';var emlformat=require(_0xe853('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe853('0x1'));var jsonpatch=require(_0xe853('0x2'));var rp=require(_0xe853('0x3'));var moment=require(_0xe853('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe853('0x5'));var util=require(_0xe853('0x6'));var path=require('path');var sox=require(_0xe853('0x7'));var csv=require('to-csv');var ejs=require(_0xe853('0x8'));var fs=require('fs');var fs_extra=require(_0xe853('0x9'));var _=require(_0xe853('0xa'));var squel=require(_0xe853('0xb'));var crypto=require('crypto');var jsforce=require(_0xe853('0xc'));var deskjs=require(_0xe853('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe853('0xe'));var Redis=require(_0xe853('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe853('0x10'));var as=require(_0xe853('0x11'));var hardwareService=require(_0xe853('0x12'));var logger=require(_0xe853('0x13'))(_0xe853('0x14'));var utils=require('../../config/utils');var config=require(_0xe853('0x15'));var licenseUtil=require(_0xe853('0x16'));var db=require(_0xe853('0x17'))['db'];function respondWithStatusCode(_0x47a077,_0x16fa75){_0x16fa75=_0x16fa75||0xcc;return function(_0x446d01){if(_0x446d01){return _0x47a077[_0xe853('0x18')](_0x16fa75);}return _0x47a077['status'](_0x16fa75)[_0xe853('0x19')]();};}function respondWithResult(_0x1dfe28,_0x355320){_0x355320=_0x355320||0xc8;return function(_0x5e7899){if(_0x5e7899){return _0x1dfe28[_0xe853('0x1a')](_0x355320)[_0xe853('0x1b')](_0x5e7899);}};}function respondWithFilteredResult(_0x578387,_0x4b24ed){return function(_0x172d55){if(_0x172d55){var _0x4ff7a1=typeof _0x4b24ed[_0xe853('0x1c')]==='undefined'&&typeof _0x4b24ed['limit']===_0xe853('0x1d');var _0x2ab360=_0x172d55[_0xe853('0x1e')];var _0x5e1b63=_0x4ff7a1?0x0:_0x4b24ed[_0xe853('0x1c')];var _0x4a7d64=_0x4ff7a1?_0x172d55[_0xe853('0x1e')]:_0x4b24ed[_0xe853('0x1c')]+_0x4b24ed[_0xe853('0x1f')];var _0x42cef6;if(_0x4a7d64>=_0x2ab360){_0x4a7d64=_0x2ab360;_0x42cef6=0xc8;}else{_0x42cef6=0xce;}_0x578387[_0xe853('0x1a')](_0x42cef6);return _0x578387['set']('Content-Range',_0x5e1b63+'-'+_0x4a7d64+'/'+_0x2ab360)[_0xe853('0x1b')](_0x172d55);}return null;};}function patchUpdates(_0x3b81c4){return function(_0x604998){try{jsonpatch[_0xe853('0x20')](_0x604998,_0x3b81c4,!![]);}catch(_0x2dc5e5){return BPromise[_0xe853('0x21')](_0x2dc5e5);}return _0x604998[_0xe853('0x22')]();};}function saveUpdates(_0x52e477,_0x1e16f0){return function(_0x403d81){if(_0x403d81){return _0x403d81['update'](_0x52e477)[_0xe853('0x23')](function(_0x2f0d77){return _0x2f0d77;});}return null;};}function removeEntity(_0x393536,_0x340c9f){return function(_0x231bd4){if(_0x231bd4){return _0x231bd4[_0xe853('0x24')]()[_0xe853('0x23')](function(){var _0x5451de=_0x231bd4[_0xe853('0x25')]({'plain':!![]});var _0x5be9ac=_0xe853('0x26');return db[_0xe853('0x27')]['destroy']({'where':{'type':_0x5be9ac,'resourceId':_0x5451de['id']}})[_0xe853('0x23')](function(){return _0x231bd4;});})[_0xe853('0x23')](function(){_0x393536[_0xe853('0x1a')](0xcc)[_0xe853('0x19')]();});}};}function handleEntityNotFound(_0x22a788,_0x4f4c31){return function(_0x1e0f01){if(!_0x1e0f01){_0x22a788['sendStatus'](0x194);}return _0x1e0f01;};}function handleError(_0x9e6a1e,_0x2eec4c){_0x2eec4c=_0x2eec4c||0x1f4;return function(_0x3d48b6){logger[_0xe853('0x28')](_0x3d48b6['stack']);if(_0x3d48b6[_0xe853('0x29')]){delete _0x3d48b6['name'];}_0x9e6a1e[_0xe853('0x1a')](_0x2eec4c)[_0xe853('0x2a')](_0x3d48b6);};}exports[_0xe853('0x2b')]=function(_0x30b8a5,_0x43b4af){var _0x307b34={},_0x2e33ac={},_0x2dc492={'count':0x0,'rows':[]};var _0x3bf7ed=_[_0xe853('0x2c')](db[_0xe853('0x2d')][_0xe853('0x2e')],function(_0x52e802){return{'name':_0x52e802[_0xe853('0x2f')],'type':_0x52e802[_0xe853('0x30')]['key']};});_0x2e33ac[_0xe853('0x31')]=_[_0xe853('0x2c')](_0x3bf7ed,_0xe853('0x29'));_0x2e33ac['query']=_[_0xe853('0x32')](_0x30b8a5[_0xe853('0x33')]);_0x2e33ac['filters']=_[_0xe853('0x34')](_0x2e33ac['model'],_0x2e33ac[_0xe853('0x33')]);_0x307b34[_0xe853('0x35')]=_[_0xe853('0x34')](_0x2e33ac[_0xe853('0x31')],qs[_0xe853('0x36')](_0x30b8a5[_0xe853('0x33')][_0xe853('0x36')]));_0x307b34['attributes']=_0x307b34[_0xe853('0x35')]['length']?_0x307b34[_0xe853('0x35')]:_0x2e33ac[_0xe853('0x31')];if(!_0x30b8a5[_0xe853('0x33')][_0xe853('0x37')](_0xe853('0x38'))){_0x307b34['limit']=qs[_0xe853('0x1f')](_0x30b8a5[_0xe853('0x33')][_0xe853('0x1f')]);_0x307b34[_0xe853('0x1c')]=qs['offset'](_0x30b8a5['query'][_0xe853('0x1c')]);}_0x307b34[_0xe853('0x39')]=qs[_0xe853('0x3a')](_0x30b8a5['query'][_0xe853('0x3a')]);_0x307b34[_0xe853('0x3b')]=qs[_0xe853('0x3c')](_[_0xe853('0x3d')](_0x30b8a5[_0xe853('0x33')],_0x2e33ac[_0xe853('0x3c')]),_0x3bf7ed);if(_0x30b8a5[_0xe853('0x33')][_0xe853('0x3e')]){_0x307b34[_0xe853('0x3b')]=_[_0xe853('0x3f')](_0x307b34[_0xe853('0x3b')],{'$or':_[_0xe853('0x2c')](_0x3bf7ed,function(_0x115423){if(_0x115423[_0xe853('0x30')]!==_0xe853('0x40')){var _0x5b4fa7={};_0x5b4fa7[_0x115423[_0xe853('0x29')]]={'$like':'%'+_0x30b8a5[_0xe853('0x33')][_0xe853('0x3e')]+'%'};return _0x5b4fa7;}})});}_0x307b34=_['merge']({},_0x307b34,_0x30b8a5[_0xe853('0x41')]);var _0x56de13={'where':_0x307b34['where']};return db[_0xe853('0x2d')][_0xe853('0x1e')](_0x56de13)[_0xe853('0x23')](function(_0x57c7ea){_0x2dc492['count']=_0x57c7ea;if(_0x30b8a5['query'][_0xe853('0x42')]){_0x307b34['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xe853('0x43')](_0x307b34);})['then'](function(_0x59d052){_0x2dc492[_0xe853('0x44')]=_0x59d052;return _0x2dc492;})[_0xe853('0x23')](respondWithFilteredResult(_0x43b4af,_0x307b34))['catch'](handleError(_0x43b4af,null));};exports[_0xe853('0x45')]=function(_0x539fe1,_0x37e014){var _0x4204a2={'raw':!![],'where':{'id':_0x539fe1[_0xe853('0x46')]['id']}},_0x5c7b3a={};_0x5c7b3a[_0xe853('0x31')]=_[_0xe853('0x32')](db['SquareOdbc'][_0xe853('0x2e')]);_0x5c7b3a[_0xe853('0x33')]=_['keys'](_0x539fe1[_0xe853('0x33')]);_0x5c7b3a['filters']=_['intersection'](_0x5c7b3a['model'],_0x5c7b3a['query']);_0x4204a2['attributes']=_[_0xe853('0x34')](_0x5c7b3a[_0xe853('0x31')],qs[_0xe853('0x36')](_0x539fe1[_0xe853('0x33')]['fields']));_0x4204a2[_0xe853('0x35')]=_0x4204a2[_0xe853('0x35')][_0xe853('0x47')]?_0x4204a2[_0xe853('0x35')]:_0x5c7b3a[_0xe853('0x31')];if(_0x539fe1[_0xe853('0x33')][_0xe853('0x42')]){_0x4204a2[_0xe853('0x48')]=[{'all':!![]}];}_0x4204a2=_['merge']({},_0x4204a2,_0x539fe1[_0xe853('0x41')]);return db[_0xe853('0x2d')][_0xe853('0x49')](_0x4204a2)[_0xe853('0x23')](handleEntityNotFound(_0x37e014,null))['then'](respondWithResult(_0x37e014,null))['catch'](handleError(_0x37e014,null));};exports[_0xe853('0x4a')]=function(_0x15d0ff,_0x55bc26){return db[_0xe853('0x2d')]['create'](_0x15d0ff[_0xe853('0x4b')],{})['then'](function(_0x105b39){var _0x1bf1fb=_0x15d0ff['user']['get']({'plain':!![]});if(!_0x1bf1fb)throw new Error(_0xe853('0x4c'));if(_0x1bf1fb[_0xe853('0x4d')]===_0xe853('0x4e')){var _0x38a118=_0x105b39['get']({'plain':!![]});var _0x49930a=_0xe853('0x26');return db[_0xe853('0x4f')][_0xe853('0x49')]({'where':{'name':_0x49930a,'userProfileId':_0x1bf1fb[_0xe853('0x50')]},'raw':!![]})[_0xe853('0x23')](function(_0x4cc8fd){if(_0x4cc8fd&&_0x4cc8fd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x38a118[_0xe853('0x29')],'resourceId':_0x38a118['id'],'type':_0x4cc8fd[_0xe853('0x29')],'sectionId':_0x4cc8fd['id']},{})['then'](function(){return _0x105b39;});}else{return _0x105b39;}})[_0xe853('0x51')](function(_0x525c20){logger[_0xe853('0x28')](_0xe853('0x52'),_0x525c20);throw _0x525c20;});}return _0x105b39;})['then'](respondWithResult(_0x55bc26,0xc9))['catch'](handleError(_0x55bc26,null));};exports['update']=function(_0x580f42,_0x32810c){if(_0x580f42['body']['id']){delete _0x580f42[_0xe853('0x4b')]['id'];}return db[_0xe853('0x2d')][_0xe853('0x49')]({'where':{'id':_0x580f42[_0xe853('0x46')]['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x32810c,null))['then'](saveUpdates(_0x580f42[_0xe853('0x4b')],null))[_0xe853('0x23')](respondWithResult(_0x32810c,null))[_0xe853('0x51')](handleError(_0x32810c,null));};exports[_0xe853('0x24')]=function(_0x407fc5,_0x19f51a){return db[_0xe853('0x2d')][_0xe853('0x49')]({'where':{'id':_0x407fc5[_0xe853('0x46')]['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x19f51a,null))[_0xe853('0x23')](removeEntity(_0x19f51a,null))[_0xe853('0x51')](handleError(_0x19f51a,null));};exports[_0xe853('0x53')]=function(_0x2e46de,_0x2bd5a3,_0x29b255){var _0x37f21d;return db[_0xe853('0x2d')]['find']({'where':{'id':_0x2e46de['params']['id']},'attributes':['id',_0xe853('0x54')]})[_0xe853('0x23')](handleEntityNotFound(_0x2bd5a3,null))[_0xe853('0x23')](function(_0x2e6946){if(_0x2e6946){var _0x5bc865=require(_0xe853('0x55'))();_0x5bc865[_0xe853('0x56')](_0x2e6946[_0xe853('0x54')]);_0x5bc865['closeSync']();return _0x2e6946;}})[_0xe853('0x23')](respondWithResult(_0x2bd5a3,null))[_0xe853('0x51')](handleError(_0x2bd5a3,null));}; \ No newline at end of file +var _0xb25e=['findAll','rows','show','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','openSync','dsn','closeSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','apply','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','map','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','SquareOdbc','count','include'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0xb25e,0x1d7));var _0xeb25=function(_0x55bc86,_0x9f8c7a){_0x55bc86=_0x55bc86-0x0;var _0x19dc20=_0xb25e[_0x55bc86];return _0x19dc20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xeb25('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb25('0x1'));var moment=require(_0xeb25('0x2'));var BPromise=require(_0xeb25('0x3'));var Mustache=require(_0xeb25('0x4'));var util=require(_0xeb25('0x5'));var path=require(_0xeb25('0x6'));var sox=require('sox');var csv=require(_0xeb25('0x7'));var ejs=require(_0xeb25('0x8'));var fs=require('fs');var fs_extra=require(_0xeb25('0x9'));var _=require(_0xeb25('0xa'));var squel=require(_0xeb25('0xb'));var crypto=require(_0xeb25('0xc'));var jsforce=require(_0xeb25('0xd'));var deskjs=require(_0xeb25('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb25('0xf'));var Papa=require(_0xeb25('0x10'));var Redis=require(_0xeb25('0x11'));var authService=require(_0xeb25('0x12'));var qs=require(_0xeb25('0x13'));var as=require(_0xeb25('0x14'));var hardwareService=require(_0xeb25('0x15'));var logger=require(_0xeb25('0x16'))(_0xeb25('0x17'));var utils=require('../../config/utils');var config=require(_0xeb25('0x18'));var licenseUtil=require(_0xeb25('0x19'));var db=require(_0xeb25('0x1a'))['db'];function respondWithStatusCode(_0x590c89,_0x2735a5){_0x2735a5=_0x2735a5||0xcc;return function(_0x138195){if(_0x138195){return _0x590c89[_0xeb25('0x1b')](_0x2735a5);}return _0x590c89[_0xeb25('0x1c')](_0x2735a5)[_0xeb25('0x1d')]();};}function respondWithResult(_0x8b50e2,_0x16d7f3){_0x16d7f3=_0x16d7f3||0xc8;return function(_0x4f7cdc){if(_0x4f7cdc){return _0x8b50e2[_0xeb25('0x1c')](_0x16d7f3)[_0xeb25('0x1e')](_0x4f7cdc);}};}function respondWithFilteredResult(_0x9a6ef,_0x46db08){return function(_0x4fe52b){if(_0x4fe52b){var _0x5b1adc=typeof _0x46db08[_0xeb25('0x1f')]===_0xeb25('0x20')&&typeof _0x46db08['limit']===_0xeb25('0x20');var _0x34f3a1=_0x4fe52b['count'];var _0x1b9cf5=_0x5b1adc?0x0:_0x46db08['offset'];var _0x4349f4=_0x5b1adc?_0x4fe52b['count']:_0x46db08[_0xeb25('0x1f')]+_0x46db08['limit'];var _0x1b5f6b;if(_0x4349f4>=_0x34f3a1){_0x4349f4=_0x34f3a1;_0x1b5f6b=0xc8;}else{_0x1b5f6b=0xce;}_0x9a6ef['status'](_0x1b5f6b);return _0x9a6ef[_0xeb25('0x21')]('Content-Range',_0x1b9cf5+'-'+_0x4349f4+'/'+_0x34f3a1)['json'](_0x4fe52b);}return null;};}function patchUpdates(_0x3ed06a){return function(_0x34e4ae){try{jsonpatch[_0xeb25('0x22')](_0x34e4ae,_0x3ed06a,!![]);}catch(_0x1130da){return BPromise['reject'](_0x1130da);}return _0x34e4ae[_0xeb25('0x23')]();};}function saveUpdates(_0x49b992,_0x4287ab){return function(_0x3a2f73){if(_0x3a2f73){return _0x3a2f73['update'](_0x49b992)[_0xeb25('0x24')](function(_0x58cdc3){return _0x58cdc3;});}return null;};}function removeEntity(_0x22c3a4,_0x80e88d){return function(_0x2830e3){if(_0x2830e3){return _0x2830e3[_0xeb25('0x25')]()[_0xeb25('0x24')](function(){var _0x2f9f7b=_0x2830e3[_0xeb25('0x26')]({'plain':!![]});var _0x52b050=_0xeb25('0x27');return db[_0xeb25('0x28')][_0xeb25('0x25')]({'where':{'type':_0x52b050,'resourceId':_0x2f9f7b['id']}})[_0xeb25('0x24')](function(){return _0x2830e3;});})[_0xeb25('0x24')](function(){_0x22c3a4[_0xeb25('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15a342,_0x48cf31){return function(_0x45611a){if(!_0x45611a){_0x15a342[_0xeb25('0x1b')](0x194);}return _0x45611a;};}function handleError(_0xf37a21,_0x2851fe){_0x2851fe=_0x2851fe||0x1f4;return function(_0x2497d6){logger[_0xeb25('0x29')](_0x2497d6[_0xeb25('0x2a')]);if(_0x2497d6[_0xeb25('0x2b')]){delete _0x2497d6[_0xeb25('0x2b')];}_0xf37a21['status'](_0x2851fe)['send'](_0x2497d6);};}exports[_0xeb25('0x2c')]=function(_0x1b37b5,_0x3006c4){var _0x475d16={},_0x4361c2={},_0xe57f25={'count':0x0,'rows':[]};var _0x269026=_[_0xeb25('0x2d')](db['SquareOdbc'][_0xeb25('0x2e')],function(_0x1b5bd7){return{'name':_0x1b5bd7['fieldName'],'type':_0x1b5bd7['type'][_0xeb25('0x2f')]};});_0x4361c2['model']=_[_0xeb25('0x2d')](_0x269026,_0xeb25('0x2b'));_0x4361c2[_0xeb25('0x30')]=_[_0xeb25('0x31')](_0x1b37b5['query']);_0x4361c2[_0xeb25('0x32')]=_[_0xeb25('0x33')](_0x4361c2[_0xeb25('0x34')],_0x4361c2[_0xeb25('0x30')]);_0x475d16['attributes']=_['intersection'](_0x4361c2['model'],qs['fields'](_0x1b37b5[_0xeb25('0x30')]['fields']));_0x475d16[_0xeb25('0x35')]=_0x475d16[_0xeb25('0x35')][_0xeb25('0x36')]?_0x475d16[_0xeb25('0x35')]:_0x4361c2[_0xeb25('0x34')];if(!_0x1b37b5[_0xeb25('0x30')][_0xeb25('0x37')](_0xeb25('0x38'))){_0x475d16[_0xeb25('0x39')]=qs['limit'](_0x1b37b5[_0xeb25('0x30')][_0xeb25('0x39')]);_0x475d16[_0xeb25('0x1f')]=qs['offset'](_0x1b37b5[_0xeb25('0x30')][_0xeb25('0x1f')]);}_0x475d16[_0xeb25('0x3a')]=qs['sort'](_0x1b37b5['query'][_0xeb25('0x3b')]);_0x475d16[_0xeb25('0x3c')]=qs[_0xeb25('0x32')](_['pick'](_0x1b37b5[_0xeb25('0x30')],_0x4361c2[_0xeb25('0x32')]),_0x269026);if(_0x1b37b5[_0xeb25('0x30')][_0xeb25('0x3d')]){_0x475d16[_0xeb25('0x3c')]=_[_0xeb25('0x3e')](_0x475d16[_0xeb25('0x3c')],{'$or':_[_0xeb25('0x2d')](_0x269026,function(_0x5c5fbf){if(_0x5c5fbf[_0xeb25('0x3f')]!==_0xeb25('0x40')){var _0x2827e5={};_0x2827e5[_0x5c5fbf[_0xeb25('0x2b')]]={'$like':'%'+_0x1b37b5[_0xeb25('0x30')][_0xeb25('0x3d')]+'%'};return _0x2827e5;}})});}_0x475d16=_[_0xeb25('0x3e')]({},_0x475d16,_0x1b37b5[_0xeb25('0x41')]);var _0x4b5713={'where':_0x475d16[_0xeb25('0x3c')]};return db[_0xeb25('0x42')]['count'](_0x4b5713)['then'](function(_0x1e400c){_0xe57f25[_0xeb25('0x43')]=_0x1e400c;if(_0x1b37b5[_0xeb25('0x30')]['includeAll']){_0x475d16[_0xeb25('0x44')]=[{'all':!![]}];}return db['SquareOdbc'][_0xeb25('0x45')](_0x475d16);})['then'](function(_0x2caf8b){_0xe57f25[_0xeb25('0x46')]=_0x2caf8b;return _0xe57f25;})['then'](respondWithFilteredResult(_0x3006c4,_0x475d16))['catch'](handleError(_0x3006c4,null));};exports[_0xeb25('0x47')]=function(_0x2e0d3d,_0x346480){var _0x393cd1={'raw':!![],'where':{'id':_0x2e0d3d[_0xeb25('0x48')]['id']}},_0x39db2f={};_0x39db2f[_0xeb25('0x34')]=_[_0xeb25('0x31')](db[_0xeb25('0x42')]['rawAttributes']);_0x39db2f[_0xeb25('0x30')]=_[_0xeb25('0x31')](_0x2e0d3d[_0xeb25('0x30')]);_0x39db2f[_0xeb25('0x32')]=_[_0xeb25('0x33')](_0x39db2f[_0xeb25('0x34')],_0x39db2f[_0xeb25('0x30')]);_0x393cd1['attributes']=_['intersection'](_0x39db2f[_0xeb25('0x34')],qs[_0xeb25('0x49')](_0x2e0d3d[_0xeb25('0x30')][_0xeb25('0x49')]));_0x393cd1[_0xeb25('0x35')]=_0x393cd1['attributes'][_0xeb25('0x36')]?_0x393cd1[_0xeb25('0x35')]:_0x39db2f[_0xeb25('0x34')];if(_0x2e0d3d[_0xeb25('0x30')][_0xeb25('0x4a')]){_0x393cd1[_0xeb25('0x44')]=[{'all':!![]}];}_0x393cd1=_[_0xeb25('0x3e')]({},_0x393cd1,_0x2e0d3d[_0xeb25('0x41')]);return db[_0xeb25('0x42')][_0xeb25('0x4b')](_0x393cd1)[_0xeb25('0x24')](handleEntityNotFound(_0x346480,null))[_0xeb25('0x24')](respondWithResult(_0x346480,null))['catch'](handleError(_0x346480,null));};exports[_0xeb25('0x4c')]=function(_0x584fc5,_0x36f322){return db[_0xeb25('0x42')]['create'](_0x584fc5[_0xeb25('0x4d')],{})['then'](function(_0xa8eac5){var _0x3e9fd8=_0x584fc5[_0xeb25('0x4e')][_0xeb25('0x26')]({'plain':!![]});if(!_0x3e9fd8)throw new Error(_0xeb25('0x4f'));if(_0x3e9fd8[_0xeb25('0x50')]===_0xeb25('0x4e')){var _0x215968=_0xa8eac5[_0xeb25('0x26')]({'plain':!![]});var _0x1f20bc=_0xeb25('0x27');return db[_0xeb25('0x51')][_0xeb25('0x4b')]({'where':{'name':_0x1f20bc,'userProfileId':_0x3e9fd8[_0xeb25('0x52')]},'raw':!![]})[_0xeb25('0x24')](function(_0x3e8184){if(_0x3e8184&&_0x3e8184['autoAssociation']===0x0){return db[_0xeb25('0x28')][_0xeb25('0x4c')]({'name':_0x215968[_0xeb25('0x2b')],'resourceId':_0x215968['id'],'type':_0x3e8184[_0xeb25('0x2b')],'sectionId':_0x3e8184['id']},{})['then'](function(){return _0xa8eac5;});}else{return _0xa8eac5;}})[_0xeb25('0x53')](function(_0x3b0384){logger['error'](_0xeb25('0x54'),_0x3b0384);throw _0x3b0384;});}return _0xa8eac5;})['then'](respondWithResult(_0x36f322,0xc9))[_0xeb25('0x53')](handleError(_0x36f322,null));};exports[_0xeb25('0x55')]=function(_0x340042,_0x428c81){if(_0x340042[_0xeb25('0x4d')]['id']){delete _0x340042['body']['id'];}return db['SquareOdbc'][_0xeb25('0x4b')]({'where':{'id':_0x340042[_0xeb25('0x48')]['id']}})[_0xeb25('0x24')](handleEntityNotFound(_0x428c81,null))[_0xeb25('0x24')](saveUpdates(_0x340042[_0xeb25('0x4d')],null))[_0xeb25('0x24')](respondWithResult(_0x428c81,null))[_0xeb25('0x53')](handleError(_0x428c81,null));};exports['destroy']=function(_0x1d636a,_0x242347){return db[_0xeb25('0x42')]['find']({'where':{'id':_0x1d636a[_0xeb25('0x48')]['id']}})[_0xeb25('0x24')](handleEntityNotFound(_0x242347,null))[_0xeb25('0x24')](removeEntity(_0x242347,null))[_0xeb25('0x53')](handleError(_0x242347,null));};exports[_0xeb25('0x56')]=function(_0x519ec0,_0x130055,_0x2af3a0){var _0x2e613e;return db[_0xeb25('0x42')]['find']({'where':{'id':_0x519ec0[_0xeb25('0x48')]['id']},'attributes':['id','dsn']})[_0xeb25('0x24')](handleEntityNotFound(_0x130055,null))['then'](function(_0x3cfe3e){if(_0x3cfe3e){var _0x1787b8=require('odbc')();_0x1787b8[_0xeb25('0x57')](_0x3cfe3e[_0xeb25('0x58')]);_0x1787b8[_0xeb25('0x59')]();return _0x3cfe3e;}})['then'](respondWithResult(_0x130055,null))[_0xeb25('0x53')](handleError(_0x130055,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 772852f..3100c62 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 _0x827d=['bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','lodash','util','../../config/logger','api','moment'];(function(_0x5a9ad1,_0x188510){var _0x204a71=function(_0x4eb894){while(--_0x4eb894){_0x5a9ad1['push'](_0x5a9ad1['shift']());}};_0x204a71(++_0x188510);}(_0x827d,0x157));var _0xd827=function(_0x3d8344,_0x2dd086){_0x3d8344=_0x3d8344-0x0;var _0x4e7c87=_0x827d[_0x3d8344];return _0x4e7c87;};'use strict';var _=require(_0xd827('0x0'));var util=require(_0xd827('0x1'));var logger=require(_0xd827('0x2'))(_0xd827('0x3'));var moment=require(_0xd827('0x4'));var BPromise=require(_0xd827('0x5'));var rp=require(_0xd827('0x6'));var fs=require('fs');var path=require(_0xd827('0x7'));var rimraf=require(_0xd827('0x8'));var config=require(_0xd827('0x9'));var attributes=require(_0xd827('0xa'));module['exports']=function(_0x4e0457,_0x3b90ef){return _0x4e0457['define'](_0xd827('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87ba=['./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x18a9a1,_0x9123a8){var _0x152644=function(_0xd7258a){while(--_0xd7258a){_0x18a9a1['push'](_0x18a9a1['shift']());}};_0x152644(++_0x9123a8);}(_0x87ba,0x1d6));var _0xa87b=function(_0x35cc24,_0x299db6){_0x35cc24=_0x35cc24-0x0;var _0x137359=_0x87ba[_0x35cc24];return _0x137359;};'use strict';var _=require(_0xa87b('0x0'));var util=require(_0xa87b('0x1'));var logger=require(_0xa87b('0x2'))(_0xa87b('0x3'));var moment=require(_0xa87b('0x4'));var BPromise=require(_0xa87b('0x5'));var rp=require(_0xa87b('0x6'));var fs=require('fs');var path=require(_0xa87b('0x7'));var rimraf=require(_0xa87b('0x8'));var config=require(_0xa87b('0x9'));var attributes=require(_0xa87b('0xa'));module[_0xa87b('0xb')]=function(_0x1cebb9,_0x38ed7e){return _0x1cebb9[_0xa87b('0xc')](_0xa87b('0xd'),attributes,{'tableName':_0xa87b('0xe'),'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 647147f..790a04a 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 _0x725e=['request','then','info','SquareOdbc,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','ShowSquareOdbc','SquareOdbc','options','raw','where','include','model','attributes','map','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x38a901,_0x1dda8e){var _0x5973d3=function(_0x3da84d){while(--_0x3da84d){_0x38a901['push'](_0x38a901['shift']());}};_0x5973d3(++_0x1dda8e);}(_0x725e,0x71));var _0xe725=function(_0x157053,_0x134981){_0x157053=_0x157053-0x0;var _0x2d3024=_0x725e[_0x157053];return _0x2d3024;};'use strict';var _=require(_0xe725('0x0'));var util=require('util');var moment=require(_0xe725('0x1'));var BPromise=require('bluebird');var rs=require(_0xe725('0x2'));var fs=require('fs');var Redis=require(_0xe725('0x3'));var db=require(_0xe725('0x4'))['db'];var utils=require(_0xe725('0x5'));var logger=require(_0xe725('0x6'))(_0xe725('0x7'));var config=require(_0xe725('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe725('0x9')][_0xe725('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x502226,_0xc8fd69,_0x362587){return new BPromise(function(_0x4a7c57,_0xf3d7cc){return client[_0xe725('0xb')](_0x502226,_0x362587)[_0xe725('0xc')](function(_0x2d9302){logger[_0xe725('0xd')](_0xe725('0xe'),_0xc8fd69,'request\x20sent');logger[_0xe725('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xc8fd69,_0xe725('0x10'),JSON[_0xe725('0x11')](_0x2d9302));if(_0x2d9302[_0xe725('0x12')]){if(_0x2d9302[_0xe725('0x12')][_0xe725('0x13')]===0x1f4){logger['error'](_0xe725('0xe'),_0xc8fd69,_0x2d9302['error'][_0xe725('0x14')]);return _0xf3d7cc(_0x2d9302[_0xe725('0x12')][_0xe725('0x14')]);}logger[_0xe725('0x12')](_0xe725('0xe'),_0xc8fd69,_0x2d9302[_0xe725('0x12')]['message']);return _0x4a7c57(_0x2d9302[_0xe725('0x12')][_0xe725('0x14')]);}else{logger[_0xe725('0xd')](_0xe725('0xe'),_0xc8fd69,_0xe725('0x10'));_0x4a7c57(_0x2d9302['result'][_0xe725('0x14')]);}})['catch'](function(_0x48fe25){logger[_0xe725('0x12')](_0xe725('0xe'),_0xc8fd69,_0x48fe25);_0xf3d7cc(_0x48fe25);});});}exports[_0xe725('0x15')]=function(_0x10b126){var _0x216a0c=this;return new Promise(function(_0x1c87b2,_0x1d5557){return db[_0xe725('0x16')]['find']({'raw':_0x10b126[_0xe725('0x17')]?_0x10b126[_0xe725('0x17')][_0xe725('0x18')]===undefined?!![]:![]:!![],'where':_0x10b126[_0xe725('0x17')]?_0x10b126[_0xe725('0x17')][_0xe725('0x19')]||null:null,'attributes':_0x10b126['options']?_0x10b126[_0xe725('0x17')]['attributes']||null:null,'include':_0x10b126['options']?_0x10b126[_0xe725('0x17')][_0xe725('0x1a')]?_['map'](_0x10b126[_0xe725('0x17')]['include'],function(_0x585082){return{'model':db[_0x585082[_0xe725('0x1b')]],'as':_0x585082['as'],'attributes':_0x585082[_0xe725('0x1c')],'include':_0x585082['include']?_[_0xe725('0x1d')](_0x585082[_0xe725('0x1a')],function(_0xb90a90){return{'model':db[_0xb90a90['model']],'as':_0xb90a90['as'],'attributes':_0xb90a90[_0xe725('0x1c')],'include':_0xb90a90[_0xe725('0x1a')]?_['map'](_0xb90a90[_0xe725('0x1a')],function(_0x35defe){return{'model':db[_0x35defe[_0xe725('0x1b')]],'as':_0x35defe['as'],'attributes':_0x35defe[_0xe725('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x578a29){logger['info'](_0xe725('0x15'),_0x10b126);logger['debug'](_0xe725('0x15'),_0x10b126,JSON[_0xe725('0x11')](_0x578a29));_0x1c87b2(_0x578a29);})[_0xe725('0x1e')](function(_0xe73245){logger[_0xe725('0x12')](_0xe725('0x15'),_0xe73245[_0xe725('0x14')],_0x10b126);_0x1d5557(_0x216a0c[_0xe725('0x12')](0x1f4,_0xe73245['message']));});});}; \ No newline at end of file +var _0xd5d5=['message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x936562,_0x3507ba){var _0x1345c9=function(_0x1f1600){while(--_0x1f1600){_0x936562['push'](_0x936562['shift']());}};_0x1345c9(++_0x3507ba);}(_0xd5d5,0x1be));var _0x5d5d=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0xd5d5[_0xa98302];return _0x1ad8e3;};'use strict';var _=require(_0x5d5d('0x0'));var util=require(_0x5d5d('0x1'));var moment=require('moment');var BPromise=require(_0x5d5d('0x2'));var rs=require(_0x5d5d('0x3'));var fs=require('fs');var Redis=require(_0x5d5d('0x4'));var db=require(_0x5d5d('0x5'))['db'];var utils=require(_0x5d5d('0x6'));var logger=require(_0x5d5d('0x7'))(_0x5d5d('0x8'));var config=require(_0x5d5d('0x9'));var jayson=require(_0x5d5d('0xa'));var client=jayson[_0x5d5d('0xb')][_0x5d5d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c4b5e,_0x373d6e,_0x187529){return new BPromise(function(_0x245683,_0x549b56){return client[_0x5d5d('0xd')](_0x3c4b5e,_0x187529)['then'](function(_0x4e262e){logger[_0x5d5d('0xe')](_0x5d5d('0xf'),_0x373d6e,'request\x20sent');logger[_0x5d5d('0x10')](_0x5d5d('0x11'),_0x373d6e,_0x5d5d('0x12'),JSON[_0x5d5d('0x13')](_0x4e262e));if(_0x4e262e[_0x5d5d('0x14')]){if(_0x4e262e[_0x5d5d('0x14')][_0x5d5d('0x15')]===0x1f4){logger[_0x5d5d('0x14')](_0x5d5d('0xf'),_0x373d6e,_0x4e262e[_0x5d5d('0x14')][_0x5d5d('0x16')]);return _0x549b56(_0x4e262e[_0x5d5d('0x14')][_0x5d5d('0x16')]);}logger[_0x5d5d('0x14')](_0x5d5d('0xf'),_0x373d6e,_0x4e262e[_0x5d5d('0x14')][_0x5d5d('0x16')]);return _0x245683(_0x4e262e[_0x5d5d('0x14')]['message']);}else{logger[_0x5d5d('0xe')](_0x5d5d('0xf'),_0x373d6e,_0x5d5d('0x12'));_0x245683(_0x4e262e[_0x5d5d('0x17')][_0x5d5d('0x16')]);}})[_0x5d5d('0x18')](function(_0x5d5799){logger[_0x5d5d('0x14')](_0x5d5d('0xf'),_0x373d6e,_0x5d5799);_0x549b56(_0x5d5799);});});}exports[_0x5d5d('0x19')]=function(_0x3bcba3){var _0x1fa5c8=this;return new Promise(function(_0x1c1b89,_0xb31431){return db[_0x5d5d('0x1a')][_0x5d5d('0x1b')]({'raw':_0x3bcba3[_0x5d5d('0x1c')]?_0x3bcba3['options'][_0x5d5d('0x1d')]===undefined?!![]:![]:!![],'where':_0x3bcba3[_0x5d5d('0x1c')]?_0x3bcba3[_0x5d5d('0x1c')][_0x5d5d('0x1e')]||null:null,'attributes':_0x3bcba3[_0x5d5d('0x1c')]?_0x3bcba3[_0x5d5d('0x1c')][_0x5d5d('0x1f')]||null:null,'include':_0x3bcba3['options']?_0x3bcba3[_0x5d5d('0x1c')][_0x5d5d('0x20')]?_[_0x5d5d('0x21')](_0x3bcba3[_0x5d5d('0x1c')][_0x5d5d('0x20')],function(_0x4d8ed9){return{'model':db[_0x4d8ed9[_0x5d5d('0x22')]],'as':_0x4d8ed9['as'],'attributes':_0x4d8ed9['attributes'],'include':_0x4d8ed9[_0x5d5d('0x20')]?_['map'](_0x4d8ed9[_0x5d5d('0x20')],function(_0x168b29){return{'model':db[_0x168b29['model']],'as':_0x168b29['as'],'attributes':_0x168b29[_0x5d5d('0x1f')],'include':_0x168b29[_0x5d5d('0x20')]?_[_0x5d5d('0x21')](_0x168b29[_0x5d5d('0x20')],function(_0x13e698){return{'model':db[_0x13e698[_0x5d5d('0x22')]],'as':_0x13e698['as'],'attributes':_0x13e698[_0x5d5d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5d5d('0x23')](function(_0xd670e9){logger[_0x5d5d('0xe')](_0x5d5d('0x19'),_0x3bcba3);logger['debug'](_0x5d5d('0x19'),_0x3bcba3,JSON[_0x5d5d('0x13')](_0xd670e9));_0x1c1b89(_0xd670e9);})[_0x5d5d('0x18')](function(_0x3f9f2e){logger[_0x5d5d('0x14')](_0x5d5d('0x19'),_0x3f9f2e[_0x5d5d('0x16')],_0x3bcba3);_0xb31431(_0x1fa5c8['error'](0x1f4,_0x3f9f2e[_0x5d5d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f70a087..786f435 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 _0x2cfd=['Router','fs-extra','./squareProject.controller','get','index','/:id','isAuthenticated','/:id/users','create','post','addUsers','put','delete','destroy','removeUsers','exports','util','path','connect-timeout'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xd2cf('0x0'));var path=require(_0xd2cf('0x1'));var timeout=require(_0xd2cf('0x2'));var express=require('express');var router=express[_0xd2cf('0x3')]();var fs_extra=require(_0xd2cf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2cf('0x5'));router[_0xd2cf('0x6')]('/',auth['isAuthenticated'](),controller[_0xd2cf('0x7')]);router[_0xd2cf('0x6')](_0xd2cf('0x8'),auth[_0xd2cf('0x9')](),controller['show']);router['get'](_0xd2cf('0xa'),auth[_0xd2cf('0x9')](),controller['getUsers']);router['post']('/',auth[_0xd2cf('0x9')](),controller[_0xd2cf('0xb')]);router[_0xd2cf('0xc')]('/:id/users',auth[_0xd2cf('0x9')](),controller[_0xd2cf('0xd')]);router[_0xd2cf('0xe')](_0xd2cf('0x8'),auth[_0xd2cf('0x9')](),controller['update']);router[_0xd2cf('0xf')](_0xd2cf('0x8'),auth[_0xd2cf('0x9')](),controller[_0xd2cf('0x10')]);router['delete'](_0xd2cf('0xa'),auth['isAuthenticated'](),controller[_0xd2cf('0x11')]);module[_0xd2cf('0x12')]=router; \ No newline at end of file +var _0xbc5e=['show','/:id/users','post','create','addUsers','put','/:id','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index'];(function(_0x4ec728,_0x342eed){var _0x4c1c2c=function(_0x3b81b8){while(--_0x3b81b8){_0x4ec728['push'](_0x4ec728['shift']());}};_0x4c1c2c(++_0x342eed);}(_0xbc5e,0x7d));var _0xebc5=function(_0x11cebc,_0xfeec23){_0x11cebc=_0x11cebc-0x0;var _0x34a952=_0xbc5e[_0x11cebc];return _0x34a952;};'use strict';var multer=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var path=require(_0xebc5('0x2'));var timeout=require(_0xebc5('0x3'));var express=require(_0xebc5('0x4'));var router=express[_0xebc5('0x5')]();var fs_extra=require(_0xebc5('0x6'));var auth=require(_0xebc5('0x7'));var interaction=require(_0xebc5('0x8'));var config=require('../../config/environment');var controller=require(_0xebc5('0x9'));router[_0xebc5('0xa')]('/',auth[_0xebc5('0xb')](),controller[_0xebc5('0xc')]);router[_0xebc5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xebc5('0xd')]);router[_0xebc5('0xa')](_0xebc5('0xe'),auth[_0xebc5('0xb')](),controller['getUsers']);router[_0xebc5('0xf')]('/',auth['isAuthenticated'](),controller[_0xebc5('0x10')]);router[_0xebc5('0xf')]('/:id/users',auth[_0xebc5('0xb')](),controller[_0xebc5('0x11')]);router[_0xebc5('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xebc5('0x13'),auth[_0xebc5('0xb')](),controller[_0xebc5('0x14')]);router[_0xebc5('0x15')](_0xebc5('0xe'),auth[_0xebc5('0xb')](),controller['removeUsers']);module[_0xebc5('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 505f9fa..76cb473 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 _0x439c=['toString','utf8','production','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x46723a,_0x4ebe49){var _0x1d8846=function(_0x66d0ef){while(--_0x66d0ef){_0x46723a['push'](_0x46723a['shift']());}};_0x1d8846(++_0x4ebe49);}(_0x439c,0x86));var _0xc439=function(_0x4df08a,_0x285e1e){_0x4df08a=_0x4df08a-0x0;var _0x369135=_0x439c[_0x4df08a];return _0x369135;};'use strict';var Sequelize=require(_0xc439('0x0'));module[_0xc439('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc439('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc439('0x3')]},'notes':{'type':Sequelize[_0xc439('0x4')]},'preproduction':{'type':Sequelize[_0xc439('0x5')](_0xc439('0x6')),'get':function(){if(this[_0xc439('0x7')](_0xc439('0x8'))){return this[_0xc439('0x7')](_0xc439('0x8'))[_0xc439('0x9')](_0xc439('0xa'));}}},'production':{'type':Sequelize[_0xc439('0x5')](_0xc439('0x6')),'get':function(){if(this[_0xc439('0x7')](_0xc439('0xb'))){return this['getDataValue'](_0xc439('0xb'))['toString'](_0xc439('0xa'));}}},'savedAt':{'type':Sequelize[_0xc439('0xc')]},'publishedAt':{'type':Sequelize[_0xc439('0xc')]}}; \ No newline at end of file +var _0xa0c8=['getDataValue','DATE','sequelize','exports','name','STRING','TEXT','BLOB','long','preproduction','toString','utf8'];(function(_0x104b47,_0x491eff){var _0x34a3f1=function(_0x467a15){while(--_0x467a15){_0x104b47['push'](_0x104b47['shift']());}};_0x34a3f1(++_0x491eff);}(_0xa0c8,0xf2));var _0x8a0c=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xa0c8[_0x1602ef];return _0x5870ee;};'use strict';var Sequelize=require(_0x8a0c('0x0'));module[_0x8a0c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8a0c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x8a0c('0x3')]},'notes':{'type':Sequelize[_0x8a0c('0x4')]},'preproduction':{'type':Sequelize[_0x8a0c('0x5')](_0x8a0c('0x6')),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue'](_0x8a0c('0x7'))[_0x8a0c('0x8')](_0x8a0c('0x9'));}}},'production':{'type':Sequelize[_0x8a0c('0x5')](_0x8a0c('0x6')),'get':function(){if(this[_0x8a0c('0xa')]('production')){return this[_0x8a0c('0xa')]('production')[_0x8a0c('0x8')](_0x8a0c('0x9'));}}},'savedAt':{'type':Sequelize[_0x8a0c('0xb')]},'publishedAt':{'type':Sequelize[_0x8a0c('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0d84e63..1b6e466 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 _0x9433=['fieldName','type','key','map','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','keys','User','sort','eml-format','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','get','SquareProjects','error','name','SquareProject'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0x9433,0x195));var _0x3943=function(_0x49fb23,_0x5340d4){_0x49fb23=_0x49fb23-0x0;var _0x4ef27b=_0x9433[_0x49fb23];return _0x4ef27b;};'use strict';var emlformat=require(_0x3943('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3943('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3943('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3943('0x3'));var util=require('util');var path=require(_0x3943('0x4'));var sox=require(_0x3943('0x5'));var csv=require(_0x3943('0x6'));var ejs=require(_0x3943('0x7'));var fs=require('fs');var fs_extra=require(_0x3943('0x8'));var _=require('lodash');var squel=require(_0x3943('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3943('0x6'));var querystring=require('querystring');var Papa=require(_0x3943('0xa'));var Redis=require(_0x3943('0xb'));var authService=require(_0x3943('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x3943('0xd'));var hardwareService=require(_0x3943('0xe'));var logger=require(_0x3943('0xf'))(_0x3943('0x10'));var utils=require(_0x3943('0x11'));var config=require(_0x3943('0x12'));var licenseUtil=require(_0x3943('0x13'));var db=require(_0x3943('0x14'))['db'];config[_0x3943('0x15')]=_[_0x3943('0x16')](config[_0x3943('0x15')],{'host':_0x3943('0x17'),'port':0x18eb});var socket=require(_0x3943('0x18'))(new Redis(config[_0x3943('0x15')]));require(_0x3943('0x19'))['register'](socket);function respondWithStatusCode(_0x256731,_0x40d77e){_0x40d77e=_0x40d77e||0xcc;return function(_0xccd973){if(_0xccd973){return _0x256731[_0x3943('0x1a')](_0x40d77e);}return _0x256731[_0x3943('0x1b')](_0x40d77e)[_0x3943('0x1c')]();};}function respondWithResult(_0x182010,_0x12cb06){_0x12cb06=_0x12cb06||0xc8;return function(_0x260afc){if(_0x260afc){return _0x182010['status'](_0x12cb06)['json'](_0x260afc);}};}function respondWithFilteredResult(_0x2f027c,_0x4b0cc2){return function(_0x10810d){if(_0x10810d){var _0xa68e35=typeof _0x4b0cc2[_0x3943('0x1d')]===_0x3943('0x1e')&&typeof _0x4b0cc2[_0x3943('0x1f')]===_0x3943('0x1e');var _0x18fbf3=_0x10810d[_0x3943('0x20')];var _0x4c8111=_0xa68e35?0x0:_0x4b0cc2[_0x3943('0x1d')];var _0x5a7869=_0xa68e35?_0x10810d[_0x3943('0x20')]:_0x4b0cc2[_0x3943('0x1d')]+_0x4b0cc2[_0x3943('0x1f')];var _0x59574e;if(_0x5a7869>=_0x18fbf3){_0x5a7869=_0x18fbf3;_0x59574e=0xc8;}else{_0x59574e=0xce;}_0x2f027c[_0x3943('0x1b')](_0x59574e);return _0x2f027c['set']('Content-Range',_0x4c8111+'-'+_0x5a7869+'/'+_0x18fbf3)[_0x3943('0x21')](_0x10810d);}return null;};}function patchUpdates(_0x5172cb){return function(_0x1232ec){try{jsonpatch[_0x3943('0x22')](_0x1232ec,_0x5172cb,!![]);}catch(_0x3e66ab){return BPromise[_0x3943('0x23')](_0x3e66ab);}return _0x1232ec[_0x3943('0x24')]();};}function saveUpdates(_0xfab0ec,_0xd18879){return function(_0x452743){if(_0x452743){return _0x452743[_0x3943('0x25')](_0xfab0ec)[_0x3943('0x26')](function(_0x81d367){return _0x81d367;});}return null;};}function removeEntity(_0x355cd4,_0xb7dc53){return function(_0x558d32){if(_0x558d32){return _0x558d32[_0x3943('0x27')]()[_0x3943('0x26')](function(){var _0x18e415=_0x558d32[_0x3943('0x28')]({'plain':!![]});var _0x50c519=_0x3943('0x29');return db['UserProfileResource'][_0x3943('0x27')]({'where':{'type':_0x50c519,'resourceId':_0x18e415['id']}})['then'](function(){return _0x558d32;});})[_0x3943('0x26')](function(){_0x355cd4[_0x3943('0x1b')](0xcc)[_0x3943('0x1c')]();});}};}function handleEntityNotFound(_0x297f16,_0x1dccde){return function(_0x46c63b){if(!_0x46c63b){_0x297f16[_0x3943('0x1a')](0x194);}return _0x46c63b;};}function handleError(_0x218383,_0x3cd768){_0x3cd768=_0x3cd768||0x1f4;return function(_0x888b4b){logger[_0x3943('0x2a')](_0x888b4b['stack']);if(_0x888b4b[_0x3943('0x2b')]){delete _0x888b4b[_0x3943('0x2b')];}_0x218383[_0x3943('0x1b')](_0x3cd768)['send'](_0x888b4b);};}exports['index']=function(_0x2d7ee9,_0x595e51){var _0x592650={},_0x59754b={},_0x45a879={'count':0x0,'rows':[]};var _0x27f663=_['map'](db[_0x3943('0x2c')]['rawAttributes'],function(_0x2d0120){return{'name':_0x2d0120[_0x3943('0x2d')],'type':_0x2d0120[_0x3943('0x2e')][_0x3943('0x2f')]};});_0x59754b['model']=_[_0x3943('0x30')](_0x27f663,'name');_0x59754b[_0x3943('0x31')]=_['keys'](_0x2d7ee9[_0x3943('0x31')]);_0x59754b['filters']=_['intersection'](_0x59754b[_0x3943('0x32')],_0x59754b['query']);_0x592650[_0x3943('0x33')]=_['intersection'](_0x59754b[_0x3943('0x32')],qs[_0x3943('0x34')](_0x2d7ee9[_0x3943('0x31')][_0x3943('0x34')]));_0x592650[_0x3943('0x33')]=_0x592650[_0x3943('0x33')][_0x3943('0x35')]?_0x592650[_0x3943('0x33')]:_0x59754b[_0x3943('0x32')];if(!_0x2d7ee9[_0x3943('0x31')][_0x3943('0x36')](_0x3943('0x37'))){_0x592650[_0x3943('0x1f')]=qs[_0x3943('0x1f')](_0x2d7ee9[_0x3943('0x31')][_0x3943('0x1f')]);_0x592650[_0x3943('0x1d')]=qs['offset'](_0x2d7ee9[_0x3943('0x31')][_0x3943('0x1d')]);}_0x592650[_0x3943('0x38')]=qs['sort'](_0x2d7ee9[_0x3943('0x31')]['sort']);_0x592650[_0x3943('0x39')]=qs[_0x3943('0x3a')](_[_0x3943('0x3b')](_0x2d7ee9[_0x3943('0x31')],_0x59754b[_0x3943('0x3a')]),_0x27f663);if(_0x2d7ee9['query']['filter']){_0x592650[_0x3943('0x39')]=_['merge'](_0x592650[_0x3943('0x39')],{'$or':_['map'](_0x27f663,function(_0x299378){if(_0x299378[_0x3943('0x2e')]!=='VIRTUAL'){var _0x16bb42={};_0x16bb42[_0x299378['name']]={'$like':'%'+_0x2d7ee9[_0x3943('0x31')][_0x3943('0x3c')]+'%'};return _0x16bb42;}})});}_0x592650=_[_0x3943('0x3d')]({},_0x592650,_0x2d7ee9[_0x3943('0x3e')]);var _0x2b9309={'where':_0x592650['where']};return db[_0x3943('0x2c')]['count'](_0x2b9309)[_0x3943('0x26')](function(_0x247c97){_0x45a879[_0x3943('0x20')]=_0x247c97;if(_0x2d7ee9[_0x3943('0x31')][_0x3943('0x3f')]){_0x592650['include']=[{'all':!![]}];}return db[_0x3943('0x2c')]['findAll'](_0x592650);})[_0x3943('0x26')](function(_0x2fd548){_0x45a879[_0x3943('0x40')]=_0x2fd548;return _0x45a879;})[_0x3943('0x26')](respondWithFilteredResult(_0x595e51,_0x592650))[_0x3943('0x41')](handleError(_0x595e51,null));};exports['show']=function(_0x31db7f,_0x5e68c0){var _0x91a59f={'raw':![],'where':{'id':_0x31db7f[_0x3943('0x42')]['id']}},_0x382f37={};_0x382f37[_0x3943('0x32')]=_['keys'](db[_0x3943('0x2c')][_0x3943('0x43')]);_0x382f37[_0x3943('0x31')]=_['keys'](_0x31db7f['query']);_0x382f37['filters']=_[_0x3943('0x44')](_0x382f37[_0x3943('0x32')],_0x382f37[_0x3943('0x31')]);_0x91a59f['attributes']=_[_0x3943('0x44')](_0x382f37['model'],qs[_0x3943('0x34')](_0x31db7f[_0x3943('0x31')]['fields']));_0x91a59f[_0x3943('0x33')]=_0x91a59f[_0x3943('0x33')][_0x3943('0x35')]?_0x91a59f[_0x3943('0x33')]:_0x382f37['model'];if(_0x31db7f[_0x3943('0x31')][_0x3943('0x3f')]){_0x91a59f['include']=[{'all':!![]}];}_0x91a59f=_[_0x3943('0x3d')]({},_0x91a59f,_0x31db7f[_0x3943('0x3e')]);return db[_0x3943('0x2c')][_0x3943('0x45')](_0x91a59f)[_0x3943('0x26')](handleEntityNotFound(_0x5e68c0,null))[_0x3943('0x26')](respondWithResult(_0x5e68c0,null))[_0x3943('0x41')](handleError(_0x5e68c0,null));};exports[_0x3943('0x46')]=function(_0x4eeb67,_0x52ea55){return db[_0x3943('0x2c')][_0x3943('0x46')](_0x4eeb67[_0x3943('0x47')],{})[_0x3943('0x26')](function(_0x47777b){var _0x2b3426=_0x4eeb67['user'][_0x3943('0x28')]({'plain':!![]});if(!_0x2b3426)throw new Error(_0x3943('0x48'));if(_0x2b3426['role']===_0x3943('0x49')){var _0x235bd4=_0x47777b[_0x3943('0x28')]({'plain':!![]});var _0x220172='SquareProjects';return db[_0x3943('0x4a')][_0x3943('0x45')]({'where':{'name':_0x220172,'userProfileId':_0x2b3426[_0x3943('0x4b')]},'raw':!![]})[_0x3943('0x26')](function(_0x1c8552){if(_0x1c8552&&_0x1c8552['autoAssociation']===0x0){return db[_0x3943('0x4c')][_0x3943('0x46')]({'name':_0x235bd4[_0x3943('0x2b')],'resourceId':_0x235bd4['id'],'type':_0x1c8552['name'],'sectionId':_0x1c8552['id']},{})[_0x3943('0x26')](function(){return _0x47777b;});}else{return _0x47777b;}})[_0x3943('0x41')](function(_0x9a562a){logger[_0x3943('0x2a')](_0x3943('0x4d'),_0x9a562a);throw _0x9a562a;});}return _0x47777b;})[_0x3943('0x26')](respondWithResult(_0x52ea55,0xc9))['catch'](handleError(_0x52ea55,null));};exports[_0x3943('0x25')]=function(_0x2bf391,_0x3b888c){if(_0x2bf391[_0x3943('0x47')]['id']){delete _0x2bf391[_0x3943('0x47')]['id'];}return db[_0x3943('0x2c')]['find']({'where':{'id':_0x2bf391[_0x3943('0x42')]['id']}})[_0x3943('0x26')](handleEntityNotFound(_0x3b888c,null))[_0x3943('0x26')](saveUpdates(_0x2bf391[_0x3943('0x47')],null))[_0x3943('0x26')](respondWithResult(_0x3b888c,null))['catch'](handleError(_0x3b888c,null));};exports[_0x3943('0x27')]=function(_0xcc74c6,_0xb19797){return db['SquareProject']['find']({'where':{'id':_0xcc74c6['params']['id']}})['then'](handleEntityNotFound(_0xb19797,null))['then'](removeEntity(_0xb19797,null))[_0x3943('0x41')](handleError(_0xb19797,null));};exports['addUsers']=function(_0x24e22e,_0x132b3e,_0x3e25b6){return db[_0x3943('0x2c')]['find']({'where':{'id':_0x24e22e[_0x3943('0x42')]['id']}})['then'](handleEntityNotFound(_0x132b3e,null))[_0x3943('0x26')](function(_0x439873){if(_0x439873){return _0x439873[_0x3943('0x4e')](_0x24e22e[_0x3943('0x47')][_0x3943('0x4f')],_[_0x3943('0x50')](_0x24e22e[_0x3943('0x47')],[_0x3943('0x4f'),'id'])||{});}})[_0x3943('0x26')](respondWithResult(_0x132b3e,null))['catch'](handleError(_0x132b3e,null));};exports[_0x3943('0x51')]=function(_0x109cee,_0x192da1,_0x76a074){return db[_0x3943('0x2c')][_0x3943('0x45')]({'where':{'id':_0x109cee[_0x3943('0x42')]['id']}})[_0x3943('0x26')](handleEntityNotFound(_0x192da1,null))[_0x3943('0x26')](function(_0x285f89){if(_0x285f89){return _0x285f89[_0x3943('0x51')](_0x109cee[_0x3943('0x31')][_0x3943('0x4f')])[_0x3943('0x26')](function(){if(_[_0x3943('0x52')](_0x109cee['query'][_0x3943('0x4f')])){for(var _0x410b90=0x0;_0x410b90<_0x109cee['query'][_0x3943('0x4f')][_0x3943('0x35')];_0x410b90+=0x1){socket[_0x3943('0x53')]('userSquareProject:remove',{'UserId':Number(_0x109cee[_0x3943('0x31')][_0x3943('0x4f')][_0x410b90]),'SquareProjectId':Number(_0x109cee[_0x3943('0x42')]['id'])});}}else{socket[_0x3943('0x53')](_0x3943('0x54'),{'UserId':Number(_0x109cee[_0x3943('0x31')][_0x3943('0x4f')]),'SquareProjectId':Number(_0x109cee['params']['id'])});}});}})[_0x3943('0x26')](respondWithStatusCode(_0x192da1,null))[_0x3943('0x41')](handleError(_0x192da1,null));};exports[_0x3943('0x55')]=function(_0x5aee75,_0x207cf5,_0x30f549){var _0xc76c21={};var _0x30b273={};var _0x3c9382;var _0x25fbfb;return db[_0x3943('0x2c')][_0x3943('0x56')]({'where':{'id':_0x5aee75['params']['id']}})['then'](handleEntityNotFound(_0x207cf5,null))[_0x3943('0x26')](function(_0x15ae90){if(_0x15ae90){_0x3c9382=_0x15ae90;_0x30b273[_0x3943('0x32')]=_[_0x3943('0x57')](db[_0x3943('0x58')][_0x3943('0x43')]);_0x30b273[_0x3943('0x31')]=_[_0x3943('0x57')](_0x5aee75['query']);_0x30b273['filters']=_[_0x3943('0x44')](_0x30b273[_0x3943('0x32')],_0x30b273[_0x3943('0x31')]);_0xc76c21['attributes']=_[_0x3943('0x44')](_0x30b273['model'],qs['fields'](_0x5aee75[_0x3943('0x31')]['fields']));_0xc76c21[_0x3943('0x33')]=_0xc76c21[_0x3943('0x33')][_0x3943('0x35')]?_0xc76c21[_0x3943('0x33')]:_0x30b273[_0x3943('0x32')];_0xc76c21['order']=qs[_0x3943('0x59')](_0x5aee75[_0x3943('0x31')][_0x3943('0x59')]);_0xc76c21['where']=qs[_0x3943('0x3a')](_[_0x3943('0x3b')](_0x5aee75[_0x3943('0x31')],_0x30b273[_0x3943('0x3a')]));if(_0x5aee75[_0x3943('0x31')][_0x3943('0x3c')]){_0xc76c21['where']=_[_0x3943('0x3d')](_0xc76c21['where'],{'$or':_[_0x3943('0x30')](_0xc76c21[_0x3943('0x33')],function(_0x4379b3){var _0x257d46={};_0x257d46[_0x4379b3]={'$like':'%'+_0x5aee75[_0x3943('0x31')]['filter']+'%'};return _0x257d46;})});}_0xc76c21=_[_0x3943('0x3d')]({},_0xc76c21,_0x5aee75[_0x3943('0x3e')]);return _0x3c9382[_0x3943('0x55')](_0xc76c21);}})[_0x3943('0x26')](function(_0x2951a5){if(_0x2951a5){_0x25fbfb=_0x2951a5[_0x3943('0x35')];if(!_0x5aee75[_0x3943('0x31')][_0x3943('0x36')](_0x3943('0x37'))){_0xc76c21[_0x3943('0x1f')]=qs[_0x3943('0x1f')](_0x5aee75[_0x3943('0x31')][_0x3943('0x1f')]);_0xc76c21[_0x3943('0x1d')]=qs[_0x3943('0x1d')](_0x5aee75[_0x3943('0x31')][_0x3943('0x1d')]);}return _0x3c9382[_0x3943('0x55')](_0xc76c21);}})[_0x3943('0x26')](function(_0xded096){if(_0xded096){return _0xded096?{'count':_0x25fbfb,'rows':_0xded096}:null;}})[_0x3943('0x26')](respondWithResult(_0x207cf5,null))[_0x3943('0x41')](handleError(_0x207cf5,null));}; \ No newline at end of file +var _0x0586=['destroy','end','error','name','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','SquareProject','includeAll','params','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','SquareProjects','UserProfileResource'];(function(_0x5de38b,_0x2cbd80){var _0x51db74=function(_0x3ecd6e){while(--_0x3ecd6e){_0x5de38b['push'](_0x5de38b['shift']());}};_0x51db74(++_0x2cbd80);}(_0x0586,0x8c));var _0x6058=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0586[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6058('0x0'));var jsonpatch=require(_0x6058('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6058('0x2'));var Mustache=require('mustache');var util=require(_0x6058('0x3'));var path=require('path');var sox=require(_0x6058('0x4'));var csv=require(_0x6058('0x5'));var ejs=require(_0x6058('0x6'));var fs=require('fs');var fs_extra=require(_0x6058('0x7'));var _=require('lodash');var squel=require(_0x6058('0x8'));var crypto=require(_0x6058('0x9'));var jsforce=require(_0x6058('0xa'));var deskjs=require(_0x6058('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6058('0xc'));var Papa=require('papaparse');var Redis=require(_0x6058('0xd'));var authService=require(_0x6058('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6058('0xf'));var hardwareService=require(_0x6058('0x10'));var logger=require(_0x6058('0x11'))(_0x6058('0x12'));var utils=require('../../config/utils');var config=require(_0x6058('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6058('0x14'))['db'];config[_0x6058('0x15')]=_['defaults'](config[_0x6058('0x15')],{'host':_0x6058('0x16'),'port':0x18eb});var socket=require(_0x6058('0x17'))(new Redis(config[_0x6058('0x15')]));require(_0x6058('0x18'))[_0x6058('0x19')](socket);function respondWithStatusCode(_0x465aba,_0x3e8063){_0x3e8063=_0x3e8063||0xcc;return function(_0x1d94c3){if(_0x1d94c3){return _0x465aba[_0x6058('0x1a')](_0x3e8063);}return _0x465aba['status'](_0x3e8063)['end']();};}function respondWithResult(_0x5ae488,_0xfd2dc5){_0xfd2dc5=_0xfd2dc5||0xc8;return function(_0x54ea73){if(_0x54ea73){return _0x5ae488[_0x6058('0x1b')](_0xfd2dc5)['json'](_0x54ea73);}};}function respondWithFilteredResult(_0x547ca2,_0x311e08){return function(_0x3e7ab7){if(_0x3e7ab7){var _0x49e2ae=typeof _0x311e08[_0x6058('0x1c')]==='undefined'&&typeof _0x311e08[_0x6058('0x1d')]===_0x6058('0x1e');var _0x407962=_0x3e7ab7['count'];var _0x500c58=_0x49e2ae?0x0:_0x311e08[_0x6058('0x1c')];var _0x1e8c29=_0x49e2ae?_0x3e7ab7[_0x6058('0x1f')]:_0x311e08[_0x6058('0x1c')]+_0x311e08[_0x6058('0x1d')];var _0x37cc68;if(_0x1e8c29>=_0x407962){_0x1e8c29=_0x407962;_0x37cc68=0xc8;}else{_0x37cc68=0xce;}_0x547ca2[_0x6058('0x1b')](_0x37cc68);return _0x547ca2[_0x6058('0x20')](_0x6058('0x21'),_0x500c58+'-'+_0x1e8c29+'/'+_0x407962)['json'](_0x3e7ab7);}return null;};}function patchUpdates(_0x3459a4){return function(_0x18e8ca){try{jsonpatch[_0x6058('0x22')](_0x18e8ca,_0x3459a4,!![]);}catch(_0x148680){return BPromise[_0x6058('0x23')](_0x148680);}return _0x18e8ca[_0x6058('0x24')]();};}function saveUpdates(_0x32e426,_0x425d40){return function(_0x7b882c){if(_0x7b882c){return _0x7b882c[_0x6058('0x25')](_0x32e426)[_0x6058('0x26')](function(_0x9431a9){return _0x9431a9;});}return null;};}function removeEntity(_0x34e2c8,_0x57efb0){return function(_0x3ee5fe){if(_0x3ee5fe){return _0x3ee5fe['destroy']()[_0x6058('0x26')](function(){var _0x3e81e9=_0x3ee5fe[_0x6058('0x27')]({'plain':!![]});var _0x15a585=_0x6058('0x28');return db[_0x6058('0x29')][_0x6058('0x2a')]({'where':{'type':_0x15a585,'resourceId':_0x3e81e9['id']}})[_0x6058('0x26')](function(){return _0x3ee5fe;});})[_0x6058('0x26')](function(){_0x34e2c8[_0x6058('0x1b')](0xcc)[_0x6058('0x2b')]();});}};}function handleEntityNotFound(_0x5dba0f,_0x210fbb){return function(_0x50cee9){if(!_0x50cee9){_0x5dba0f[_0x6058('0x1a')](0x194);}return _0x50cee9;};}function handleError(_0x130b15,_0x1a5abd){_0x1a5abd=_0x1a5abd||0x1f4;return function(_0x3f2cfa){logger[_0x6058('0x2c')](_0x3f2cfa['stack']);if(_0x3f2cfa['name']){delete _0x3f2cfa[_0x6058('0x2d')];}_0x130b15['status'](_0x1a5abd)['send'](_0x3f2cfa);};}exports[_0x6058('0x2e')]=function(_0x38cc6d,_0x2a1860){var _0x210cb8={},_0x5d2bf1={},_0x4d2522={'count':0x0,'rows':[]};var _0x2676e6=_['map'](db['SquareProject'][_0x6058('0x2f')],function(_0x343928){return{'name':_0x343928[_0x6058('0x30')],'type':_0x343928['type'][_0x6058('0x31')]};});_0x5d2bf1[_0x6058('0x32')]=_['map'](_0x2676e6,'name');_0x5d2bf1[_0x6058('0x33')]=_[_0x6058('0x34')](_0x38cc6d[_0x6058('0x33')]);_0x5d2bf1[_0x6058('0x35')]=_[_0x6058('0x36')](_0x5d2bf1[_0x6058('0x32')],_0x5d2bf1[_0x6058('0x33')]);_0x210cb8[_0x6058('0x37')]=_[_0x6058('0x36')](_0x5d2bf1[_0x6058('0x32')],qs[_0x6058('0x38')](_0x38cc6d[_0x6058('0x33')]['fields']));_0x210cb8['attributes']=_0x210cb8['attributes'][_0x6058('0x39')]?_0x210cb8[_0x6058('0x37')]:_0x5d2bf1[_0x6058('0x32')];if(!_0x38cc6d[_0x6058('0x33')][_0x6058('0x3a')](_0x6058('0x3b'))){_0x210cb8[_0x6058('0x1d')]=qs[_0x6058('0x1d')](_0x38cc6d[_0x6058('0x33')]['limit']);_0x210cb8['offset']=qs['offset'](_0x38cc6d['query'][_0x6058('0x1c')]);}_0x210cb8['order']=qs[_0x6058('0x3c')](_0x38cc6d[_0x6058('0x33')][_0x6058('0x3c')]);_0x210cb8[_0x6058('0x3d')]=qs['filters'](_[_0x6058('0x3e')](_0x38cc6d['query'],_0x5d2bf1['filters']),_0x2676e6);if(_0x38cc6d['query'][_0x6058('0x3f')]){_0x210cb8[_0x6058('0x3d')]=_[_0x6058('0x40')](_0x210cb8[_0x6058('0x3d')],{'$or':_[_0x6058('0x41')](_0x2676e6,function(_0x5c3eb9){if(_0x5c3eb9[_0x6058('0x42')]!==_0x6058('0x43')){var _0x2bb290={};_0x2bb290[_0x5c3eb9[_0x6058('0x2d')]]={'$like':'%'+_0x38cc6d['query'][_0x6058('0x3f')]+'%'};return _0x2bb290;}})});}_0x210cb8=_['merge']({},_0x210cb8,_0x38cc6d[_0x6058('0x44')]);var _0xfce02f={'where':_0x210cb8[_0x6058('0x3d')]};return db[_0x6058('0x45')][_0x6058('0x1f')](_0xfce02f)[_0x6058('0x26')](function(_0x4c4b5d){_0x4d2522[_0x6058('0x1f')]=_0x4c4b5d;if(_0x38cc6d[_0x6058('0x33')][_0x6058('0x46')]){_0x210cb8['include']=[{'all':!![]}];}return db[_0x6058('0x45')]['findAll'](_0x210cb8);})['then'](function(_0x1eb385){_0x4d2522['rows']=_0x1eb385;return _0x4d2522;})['then'](respondWithFilteredResult(_0x2a1860,_0x210cb8))['catch'](handleError(_0x2a1860,null));};exports['show']=function(_0x4c9a95,_0x4eb97a){var _0x30eb78={'raw':![],'where':{'id':_0x4c9a95[_0x6058('0x47')]['id']}},_0x438bca={};_0x438bca[_0x6058('0x32')]=_[_0x6058('0x34')](db[_0x6058('0x45')][_0x6058('0x2f')]);_0x438bca[_0x6058('0x33')]=_['keys'](_0x4c9a95[_0x6058('0x33')]);_0x438bca[_0x6058('0x35')]=_[_0x6058('0x36')](_0x438bca[_0x6058('0x32')],_0x438bca[_0x6058('0x33')]);_0x30eb78[_0x6058('0x37')]=_[_0x6058('0x36')](_0x438bca[_0x6058('0x32')],qs[_0x6058('0x38')](_0x4c9a95[_0x6058('0x33')][_0x6058('0x38')]));_0x30eb78['attributes']=_0x30eb78[_0x6058('0x37')]['length']?_0x30eb78[_0x6058('0x37')]:_0x438bca[_0x6058('0x32')];if(_0x4c9a95['query'][_0x6058('0x46')]){_0x30eb78[_0x6058('0x48')]=[{'all':!![]}];}_0x30eb78=_[_0x6058('0x40')]({},_0x30eb78,_0x4c9a95[_0x6058('0x44')]);return db[_0x6058('0x45')][_0x6058('0x49')](_0x30eb78)[_0x6058('0x26')](handleEntityNotFound(_0x4eb97a,null))[_0x6058('0x26')](respondWithResult(_0x4eb97a,null))[_0x6058('0x4a')](handleError(_0x4eb97a,null));};exports['create']=function(_0x301e32,_0x1ccb57){return db[_0x6058('0x45')][_0x6058('0x4b')](_0x301e32[_0x6058('0x4c')],{})['then'](function(_0x4a6394){var _0x235f3c=_0x301e32['user'][_0x6058('0x27')]({'plain':!![]});if(!_0x235f3c)throw new Error(_0x6058('0x4d'));if(_0x235f3c['role']===_0x6058('0x4e')){var _0x4d52c0=_0x4a6394['get']({'plain':!![]});var _0x5d471f=_0x6058('0x28');return db['UserProfileSection'][_0x6058('0x49')]({'where':{'name':_0x5d471f,'userProfileId':_0x235f3c[_0x6058('0x4f')]},'raw':!![]})[_0x6058('0x26')](function(_0x2099b9){if(_0x2099b9&&_0x2099b9[_0x6058('0x50')]===0x0){return db[_0x6058('0x29')]['create']({'name':_0x4d52c0[_0x6058('0x2d')],'resourceId':_0x4d52c0['id'],'type':_0x2099b9[_0x6058('0x2d')],'sectionId':_0x2099b9['id']},{})[_0x6058('0x26')](function(){return _0x4a6394;});}else{return _0x4a6394;}})[_0x6058('0x4a')](function(_0xad8bce){logger['error'](_0x6058('0x51'),_0xad8bce);throw _0xad8bce;});}return _0x4a6394;})[_0x6058('0x26')](respondWithResult(_0x1ccb57,0xc9))['catch'](handleError(_0x1ccb57,null));};exports['update']=function(_0x429a2f,_0x39346){if(_0x429a2f['body']['id']){delete _0x429a2f[_0x6058('0x4c')]['id'];}return db[_0x6058('0x45')][_0x6058('0x49')]({'where':{'id':_0x429a2f[_0x6058('0x47')]['id']}})[_0x6058('0x26')](handleEntityNotFound(_0x39346,null))[_0x6058('0x26')](saveUpdates(_0x429a2f[_0x6058('0x4c')],null))[_0x6058('0x26')](respondWithResult(_0x39346,null))[_0x6058('0x4a')](handleError(_0x39346,null));};exports[_0x6058('0x2a')]=function(_0x4a4f7a,_0x307e88){return db['SquareProject'][_0x6058('0x49')]({'where':{'id':_0x4a4f7a[_0x6058('0x47')]['id']}})['then'](handleEntityNotFound(_0x307e88,null))[_0x6058('0x26')](removeEntity(_0x307e88,null))[_0x6058('0x4a')](handleError(_0x307e88,null));};exports[_0x6058('0x52')]=function(_0x1a638a,_0x2871cc,_0x471b0b){return db['SquareProject'][_0x6058('0x49')]({'where':{'id':_0x1a638a[_0x6058('0x47')]['id']}})[_0x6058('0x26')](handleEntityNotFound(_0x2871cc,null))[_0x6058('0x26')](function(_0x4cad36){if(_0x4cad36){return _0x4cad36[_0x6058('0x52')](_0x1a638a['body'][_0x6058('0x53')],_[_0x6058('0x54')](_0x1a638a[_0x6058('0x4c')],[_0x6058('0x53'),'id'])||{});}})[_0x6058('0x26')](respondWithResult(_0x2871cc,null))[_0x6058('0x4a')](handleError(_0x2871cc,null));};exports['removeUsers']=function(_0x3c1cd8,_0x25a9ae,_0x1b4e59){return db[_0x6058('0x45')][_0x6058('0x49')]({'where':{'id':_0x3c1cd8[_0x6058('0x47')]['id']}})['then'](handleEntityNotFound(_0x25a9ae,null))['then'](function(_0x58d15e){if(_0x58d15e){return _0x58d15e[_0x6058('0x55')](_0x3c1cd8[_0x6058('0x33')]['ids'])[_0x6058('0x26')](function(){if(_['isArray'](_0x3c1cd8[_0x6058('0x33')][_0x6058('0x53')])){for(var _0x35f4e5=0x0;_0x35f4e5<_0x3c1cd8[_0x6058('0x33')][_0x6058('0x53')][_0x6058('0x39')];_0x35f4e5+=0x1){socket[_0x6058('0x56')](_0x6058('0x57'),{'UserId':Number(_0x3c1cd8[_0x6058('0x33')][_0x6058('0x53')][_0x35f4e5]),'SquareProjectId':Number(_0x3c1cd8[_0x6058('0x47')]['id'])});}}else{socket[_0x6058('0x56')]('userSquareProject:remove',{'UserId':Number(_0x3c1cd8['query'][_0x6058('0x53')]),'SquareProjectId':Number(_0x3c1cd8[_0x6058('0x47')]['id'])});}});}})[_0x6058('0x26')](respondWithStatusCode(_0x25a9ae,null))[_0x6058('0x4a')](handleError(_0x25a9ae,null));};exports[_0x6058('0x58')]=function(_0x148eb2,_0x2ec585,_0x4b81f8){var _0x19f054={};var _0x2c6b5d={};var _0x200cb1;var _0x9237cc;return db['SquareProject'][_0x6058('0x59')]({'where':{'id':_0x148eb2[_0x6058('0x47')]['id']}})[_0x6058('0x26')](handleEntityNotFound(_0x2ec585,null))[_0x6058('0x26')](function(_0x45eee6){if(_0x45eee6){_0x200cb1=_0x45eee6;_0x2c6b5d[_0x6058('0x32')]=_[_0x6058('0x34')](db[_0x6058('0x5a')][_0x6058('0x2f')]);_0x2c6b5d[_0x6058('0x33')]=_[_0x6058('0x34')](_0x148eb2[_0x6058('0x33')]);_0x2c6b5d[_0x6058('0x35')]=_['intersection'](_0x2c6b5d[_0x6058('0x32')],_0x2c6b5d['query']);_0x19f054['attributes']=_['intersection'](_0x2c6b5d['model'],qs[_0x6058('0x38')](_0x148eb2[_0x6058('0x33')][_0x6058('0x38')]));_0x19f054[_0x6058('0x37')]=_0x19f054[_0x6058('0x37')][_0x6058('0x39')]?_0x19f054[_0x6058('0x37')]:_0x2c6b5d[_0x6058('0x32')];_0x19f054['order']=qs[_0x6058('0x3c')](_0x148eb2[_0x6058('0x33')][_0x6058('0x3c')]);_0x19f054[_0x6058('0x3d')]=qs[_0x6058('0x35')](_[_0x6058('0x3e')](_0x148eb2[_0x6058('0x33')],_0x2c6b5d[_0x6058('0x35')]));if(_0x148eb2[_0x6058('0x33')][_0x6058('0x3f')]){_0x19f054['where']=_[_0x6058('0x40')](_0x19f054['where'],{'$or':_[_0x6058('0x41')](_0x19f054[_0x6058('0x37')],function(_0x1e1fcb){var _0x795d0d={};_0x795d0d[_0x1e1fcb]={'$like':'%'+_0x148eb2['query'][_0x6058('0x3f')]+'%'};return _0x795d0d;})});}_0x19f054=_[_0x6058('0x40')]({},_0x19f054,_0x148eb2[_0x6058('0x44')]);return _0x200cb1[_0x6058('0x58')](_0x19f054);}})[_0x6058('0x26')](function(_0x3c7885){if(_0x3c7885){_0x9237cc=_0x3c7885[_0x6058('0x39')];if(!_0x148eb2[_0x6058('0x33')][_0x6058('0x3a')]('nolimit')){_0x19f054[_0x6058('0x1d')]=qs['limit'](_0x148eb2['query'][_0x6058('0x1d')]);_0x19f054['offset']=qs[_0x6058('0x1c')](_0x148eb2[_0x6058('0x33')][_0x6058('0x1c')]);}return _0x200cb1[_0x6058('0x58')](_0x19f054);}})['then'](function(_0x3a3086){if(_0x3a3086){return _0x3a3086?{'count':_0x9237cc,'rows':_0x3a3086}:null;}})[_0x6058('0x26')](respondWithResult(_0x2ec585,null))[_0x6058('0x4a')](handleError(_0x2ec585,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 7c29649..14cd389 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 _0x0406=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject'];(function(_0x348d8d,_0x25a6dd){var _0x2a7d1f=function(_0x32fed7){while(--_0x32fed7){_0x348d8d['push'](_0x348d8d['shift']());}};_0x2a7d1f(++_0x25a6dd);}(_0x0406,0xe5));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6040('0x0'));var SquareProject=require(_0x6040('0x1'))['db'][_0x6040('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x6040('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6040('0x4')};function emitEvent(_0x14ce53){return function(_0x37280a,_0x530c90,_0x4876d4){SquareProjectEvents[_0x6040('0x5')](_0x14ce53+':'+_0x37280a['id'],_0x37280a);SquareProjectEvents[_0x6040('0x5')](_0x14ce53,_0x37280a);_0x4876d4(null);};}for(var e in events){if(events[_0x6040('0x6')](e)){var event=events[e];SquareProject[_0x6040('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x7e00=['setMaxListeners','update','remove','emit','events','SquareProject'];(function(_0x35bb4b,_0xe773f4){var _0x48c0a0=function(_0x3f9b1){while(--_0x3f9b1){_0x35bb4b['push'](_0x35bb4b['shift']());}};_0x48c0a0(++_0xe773f4);}(_0x7e00,0x11e));var _0x07e0=function(_0x341cea,_0x4a04e3){_0x341cea=_0x341cea-0x0;var _0x10ac73=_0x7e00[_0x341cea];return _0x10ac73;};'use strict';var EventEmitter=require(_0x07e0('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x07e0('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x07e0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x07e0('0x3'),'afterDestroy':_0x07e0('0x4')};function emitEvent(_0x239327){return function(_0x3afc02,_0x52187e,_0xe6a5b3){SquareProjectEvents[_0x07e0('0x5')](_0x239327+':'+_0x3afc02['id'],_0x3afc02);SquareProjectEvents[_0x07e0('0x5')](_0x239327,_0x3afc02);_0xe6a5b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index cc497c2..c277b33 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 _0xdd90=['../../config/environment','exports','define','SquareProject','format','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','lodash','util','api','moment','path','rimraf'];(function(_0x249e67,_0x5826f6){var _0x419c58=function(_0x447e60){while(--_0x447e60){_0x249e67['push'](_0x249e67['shift']());}};_0x419c58(++_0x5826f6);}(_0xdd90,0x19e));var _0x0dd9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdd90[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x0dd9('0x0'));var util=require(_0x0dd9('0x1'));var logger=require('../../config/logger')(_0x0dd9('0x2'));var moment=require(_0x0dd9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0dd9('0x4'));var rimraf=require(_0x0dd9('0x5'));var config=require(_0x0dd9('0x6'));var attributes=require('./squareProject.attributes');module[_0x0dd9('0x7')]=function(_0x51c9bc,_0x533576){return _0x51c9bc[_0x0dd9('0x8')](_0x0dd9('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x80d646,_0x4c0fd5,_0x589227){if(_0x80d646['changed']('preproduction')){_0x80d646['savedAt']=moment()[_0x0dd9('0xa')](_0x0dd9('0xb'));}if(_0x80d646[_0x0dd9('0xc')](_0x0dd9('0xd'))){_0x80d646[_0x0dd9('0xe')]=moment()['format'](_0x0dd9('0xb'));}_0x589227(null,_0x80d646);}}});}; \ No newline at end of file +var _0xc518=['bluebird','request-promise','path','./squareProject.attributes','exports','define','square_projects','changed','preproduction','format','production','publishedAt','lodash','util','../../config/logger','api','moment'];(function(_0x1b3256,_0x3f0be3){var _0x3e46e3=function(_0xc64db3){while(--_0xc64db3){_0x1b3256['push'](_0x1b3256['shift']());}};_0x3e46e3(++_0x3f0be3);}(_0xc518,0xe9));var _0x8c51=function(_0x51bd64,_0x1c8850){_0x51bd64=_0x51bd64-0x0;var _0x2c7ee4=_0xc518[_0x51bd64];return _0x2c7ee4;};'use strict';var _=require(_0x8c51('0x0'));var util=require(_0x8c51('0x1'));var logger=require(_0x8c51('0x2'))(_0x8c51('0x3'));var moment=require(_0x8c51('0x4'));var BPromise=require(_0x8c51('0x5'));var rp=require(_0x8c51('0x6'));var fs=require('fs');var path=require(_0x8c51('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8c51('0x8'));module[_0x8c51('0x9')]=function(_0x36c661,_0x329db1){return _0x36c661[_0x8c51('0xa')]('SquareProject',attributes,{'tableName':_0x8c51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x79a7f9,_0x332c4c,_0x44c064){if(_0x79a7f9[_0x8c51('0xc')](_0x8c51('0xd'))){_0x79a7f9['savedAt']=moment()[_0x8c51('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x79a7f9[_0x8c51('0xc')](_0x8c51('0xf'))){_0x79a7f9[_0x8c51('0x10')]=moment()[_0x8c51('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x44c064(null,_0x79a7f9);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index c501f9e..9ada3ec 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 _0x9d64=['then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','SquareProject','find','raw','where','options','map','model','attributes','include','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./squareProject.socket','request'];(function(_0x44c2dd,_0x2e19a0){var _0x1b1af4=function(_0x418ea0){while(--_0x418ea0){_0x44c2dd['push'](_0x44c2dd['shift']());}};_0x1b1af4(++_0x2e19a0);}(_0x9d64,0x1a6));var _0x49d6=function(_0x1a3868,_0x313869){_0x1a3868=_0x1a3868-0x0;var _0x22f963=_0x9d64[_0x1a3868];return _0x22f963;};'use strict';var _=require(_0x49d6('0x0'));var util=require(_0x49d6('0x1'));var moment=require(_0x49d6('0x2'));var BPromise=require(_0x49d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49d6('0x4'));var db=require(_0x49d6('0x5'))['db'];var utils=require(_0x49d6('0x6'));var logger=require(_0x49d6('0x7'))(_0x49d6('0x8'));var config=require(_0x49d6('0x9'));var jayson=require(_0x49d6('0xa'));var client=jayson[_0x49d6('0xb')][_0x49d6('0xc')]({'port':0x232a});config[_0x49d6('0xd')]=_[_0x49d6('0xe')](config[_0x49d6('0xd')],{'host':_0x49d6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x49d6('0x10'))['register'](socket);function respondWithRpcPromise(_0x1f0258,_0x545c65,_0x480b60){return new BPromise(function(_0x4115ed,_0x163467){return client[_0x49d6('0x11')](_0x1f0258,_0x480b60)[_0x49d6('0x12')](function(_0x18c2e3){logger[_0x49d6('0x13')]('SquareProject,\x20%s,\x20%s',_0x545c65,_0x49d6('0x14'));logger[_0x49d6('0x15')](_0x49d6('0x16'),_0x545c65,_0x49d6('0x14'),JSON['stringify'](_0x18c2e3));if(_0x18c2e3['error']){if(_0x18c2e3[_0x49d6('0x17')][_0x49d6('0x18')]===0x1f4){logger[_0x49d6('0x17')](_0x49d6('0x19'),_0x545c65,_0x18c2e3[_0x49d6('0x17')][_0x49d6('0x1a')]);return _0x163467(_0x18c2e3['error'][_0x49d6('0x1a')]);}logger['error'](_0x49d6('0x19'),_0x545c65,_0x18c2e3[_0x49d6('0x17')][_0x49d6('0x1a')]);return _0x4115ed(_0x18c2e3[_0x49d6('0x17')][_0x49d6('0x1a')]);}else{logger[_0x49d6('0x13')]('SquareProject,\x20%s,\x20%s',_0x545c65,_0x49d6('0x14'));_0x4115ed(_0x18c2e3[_0x49d6('0x1b')]['message']);}})[_0x49d6('0x1c')](function(_0x3f5c04){logger[_0x49d6('0x17')](_0x49d6('0x19'),_0x545c65,_0x3f5c04);_0x163467(_0x3f5c04);});});}exports[_0x49d6('0x1d')]=function(_0xb9a5b8){var _0x4fb3e0=this;return new Promise(function(_0x88b18d,_0x516099){return db[_0x49d6('0x1e')][_0x49d6('0x1f')]({'raw':_0xb9a5b8['options']?_0xb9a5b8['options'][_0x49d6('0x20')]===undefined?!![]:![]:!![],'where':_0xb9a5b8['options']?_0xb9a5b8['options'][_0x49d6('0x21')]||null:null,'attributes':_0xb9a5b8[_0x49d6('0x22')]?_0xb9a5b8[_0x49d6('0x22')]['attributes']||null:null,'include':_0xb9a5b8[_0x49d6('0x22')]?_0xb9a5b8['options']['include']?_[_0x49d6('0x23')](_0xb9a5b8[_0x49d6('0x22')]['include'],function(_0x45f121){return{'model':db[_0x45f121[_0x49d6('0x24')]],'as':_0x45f121['as'],'attributes':_0x45f121[_0x49d6('0x25')],'include':_0x45f121[_0x49d6('0x26')]?_['map'](_0x45f121[_0x49d6('0x26')],function(_0x3e95ad){return{'model':db[_0x3e95ad[_0x49d6('0x24')]],'as':_0x3e95ad['as'],'attributes':_0x3e95ad[_0x49d6('0x25')],'include':_0x3e95ad['include']?_['map'](_0x3e95ad[_0x49d6('0x26')],function(_0x55120d){return{'model':db[_0x55120d[_0x49d6('0x24')]],'as':_0x55120d['as'],'attributes':_0x55120d[_0x49d6('0x25')]};}):[]};}):[]};}):[]:[]})[_0x49d6('0x12')](function(_0x476eec){logger[_0x49d6('0x13')](_0x49d6('0x1d'),_0xb9a5b8);logger['debug'](_0x49d6('0x1d'),_0xb9a5b8,JSON[_0x49d6('0x27')](_0x476eec));_0x88b18d(_0x476eec);})[_0x49d6('0x1c')](function(_0x4ee62a){logger[_0x49d6('0x17')](_0x49d6('0x1d'),_0x4ee62a['message'],_0xb9a5b8);_0x516099(_0x4fb3e0[_0x49d6('0x17')](0x1f4,_0x4ee62a[_0x49d6('0x1a')]));});});}; \ No newline at end of file +var _0xde7e=['rpc','client','http','localhost','socket.io-emitter','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x360e72,_0x524b5b){var _0x388cbb=function(_0x4977fc){while(--_0x4977fc){_0x360e72['push'](_0x360e72['shift']());}};_0x388cbb(++_0x524b5b);}(_0xde7e,0x69));var _0xede7=function(_0x10b2bc,_0x50e9a0){_0x10b2bc=_0x10b2bc-0x0;var _0x9f640c=_0xde7e[_0x10b2bc];return _0x9f640c;};'use strict';var _=require(_0xede7('0x0'));var util=require(_0xede7('0x1'));var moment=require(_0xede7('0x2'));var BPromise=require(_0xede7('0x3'));var rs=require(_0xede7('0x4'));var fs=require('fs');var Redis=require(_0xede7('0x5'));var db=require(_0xede7('0x6'))['db'];var utils=require(_0xede7('0x7'));var logger=require(_0xede7('0x8'))(_0xede7('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xede7('0xa')][_0xede7('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xede7('0xc'),'port':0x18eb});var socket=require(_0xede7('0xd'))(new Redis(config[_0xede7('0xe')]));require(_0xede7('0xf'))[_0xede7('0x10')](socket);function respondWithRpcPromise(_0x1829d7,_0x46ed65,_0x2f349c){return new BPromise(function(_0x162538,_0x4790a1){return client[_0xede7('0x11')](_0x1829d7,_0x2f349c)[_0xede7('0x12')](function(_0x36fa73){logger[_0xede7('0x13')](_0xede7('0x14'),_0x46ed65,'request\x20sent');logger[_0xede7('0x15')](_0xede7('0x16'),_0x46ed65,_0xede7('0x17'),JSON[_0xede7('0x18')](_0x36fa73));if(_0x36fa73['error']){if(_0x36fa73[_0xede7('0x19')]['code']===0x1f4){logger[_0xede7('0x19')](_0xede7('0x14'),_0x46ed65,_0x36fa73[_0xede7('0x19')]['message']);return _0x4790a1(_0x36fa73['error']['message']);}logger[_0xede7('0x19')](_0xede7('0x14'),_0x46ed65,_0x36fa73['error'][_0xede7('0x1a')]);return _0x162538(_0x36fa73[_0xede7('0x19')][_0xede7('0x1a')]);}else{logger[_0xede7('0x13')](_0xede7('0x14'),_0x46ed65,_0xede7('0x17'));_0x162538(_0x36fa73[_0xede7('0x1b')][_0xede7('0x1a')]);}})[_0xede7('0x1c')](function(_0x270ca2){logger['error']('SquareProject,\x20%s,\x20%s',_0x46ed65,_0x270ca2);_0x4790a1(_0x270ca2);});});}exports[_0xede7('0x1d')]=function(_0x4904a7){var _0x5932bf=this;return new Promise(function(_0x24b8f9,_0x530d97){return db['SquareProject'][_0xede7('0x1e')]({'raw':_0x4904a7[_0xede7('0x1f')]?_0x4904a7['options'][_0xede7('0x20')]===undefined?!![]:![]:!![],'where':_0x4904a7[_0xede7('0x1f')]?_0x4904a7[_0xede7('0x1f')][_0xede7('0x21')]||null:null,'attributes':_0x4904a7['options']?_0x4904a7['options'][_0xede7('0x22')]||null:null,'include':_0x4904a7[_0xede7('0x1f')]?_0x4904a7['options'][_0xede7('0x23')]?_[_0xede7('0x24')](_0x4904a7[_0xede7('0x1f')][_0xede7('0x23')],function(_0x2d33fa){return{'model':db[_0x2d33fa[_0xede7('0x25')]],'as':_0x2d33fa['as'],'attributes':_0x2d33fa['attributes'],'include':_0x2d33fa[_0xede7('0x23')]?_['map'](_0x2d33fa[_0xede7('0x23')],function(_0x35dd2f){return{'model':db[_0x35dd2f['model']],'as':_0x35dd2f['as'],'attributes':_0x35dd2f[_0xede7('0x22')],'include':_0x35dd2f[_0xede7('0x23')]?_[_0xede7('0x24')](_0x35dd2f[_0xede7('0x23')],function(_0x21ee87){return{'model':db[_0x21ee87[_0xede7('0x25')]],'as':_0x21ee87['as'],'attributes':_0x21ee87[_0xede7('0x22')]};}):[]};}):[]};}):[]:[]})[_0xede7('0x12')](function(_0x3c4f53){logger['info'](_0xede7('0x1d'),_0x4904a7);logger[_0xede7('0x15')](_0xede7('0x1d'),_0x4904a7,JSON[_0xede7('0x18')](_0x3c4f53));_0x24b8f9(_0x3c4f53);})[_0xede7('0x1c')](function(_0x5ee2e0){logger[_0xede7('0x19')](_0xede7('0x1d'),_0x5ee2e0[_0xede7('0x1a')],_0x4904a7);_0x530d97(_0x5932bf['error'](0x1f4,_0x5ee2e0[_0xede7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 8f3ff72..ff2b8b3 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 _0x420b=['register','length','./squareProject.events','save','remove','update','emit'];(function(_0xa3292f,_0x2651f3){var _0x3c2a2f=function(_0x16b2ae){while(--_0x16b2ae){_0xa3292f['push'](_0xa3292f['shift']());}};_0x3c2a2f(++_0x2651f3);}(_0x420b,0x113));var _0xb420=function(_0x2a47fa,_0x2283dc){_0x2a47fa=_0x2a47fa-0x0;var _0x1749db=_0x420b[_0x2a47fa];return _0x1749db;};'use strict';var SquareProjectEvents=require(_0xb420('0x0'));var events=[_0xb420('0x1'),_0xb420('0x2'),_0xb420('0x3')];function createListener(_0x86614c,_0x46db06){return function(_0x52f93b){_0x46db06[_0xb420('0x4')](_0x86614c,_0x52f93b);};}function removeListener(_0x256062,_0x1620c3){return function(){SquareProjectEvents['removeListener'](_0x256062,_0x1620c3);};}exports[_0xb420('0x5')]=function(_0x3e5c2e){for(var _0x1097f7=0x0,_0x4ab012=events[_0xb420('0x6')];_0x1097f7<_0x4ab012;_0x1097f7++){var _0x32ae61=events[_0x1097f7];var _0x25b9e3=createListener('squareProject:'+_0x32ae61,_0x3e5c2e);SquareProjectEvents['on'](_0x32ae61,_0x25b9e3);}}; \ No newline at end of file +var _0x4d09=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener'];(function(_0x321bd5,_0x2f7ad1){var _0x2fe008=function(_0x21b7a1){while(--_0x21b7a1){_0x321bd5['push'](_0x321bd5['shift']());}};_0x2fe008(++_0x2f7ad1);}(_0x4d09,0xcc));var _0x94d0=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x4d09[_0x37ffea];return _0x2e2615;};'use strict';var SquareProjectEvents=require(_0x94d0('0x0'));var events=[_0x94d0('0x1'),_0x94d0('0x2'),_0x94d0('0x3')];function createListener(_0x18bbe7,_0x477d9c){return function(_0x5d05fd){_0x477d9c[_0x94d0('0x4')](_0x18bbe7,_0x5d05fd);};}function removeListener(_0x387ae1,_0x4d76e2){return function(){SquareProjectEvents[_0x94d0('0x5')](_0x387ae1,_0x4d76e2);};}exports['register']=function(_0x47f6ea){for(var _0x305873=0x0,_0x6c682c=events['length'];_0x305873<_0x6c682c;_0x305873++){var _0x151835=events[_0x305873];var _0x10d308=createListener(_0x94d0('0x6')+_0x151835,_0x47f6ea);SquareProjectEvents['on'](_0x151835,_0x10d308);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 386ef06..720bc1a 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x231a08,_0x469037){var _0x98c8ab=function(_0x4ae0ac){while(--_0x4ae0ac){_0x231a08['push'](_0x231a08['shift']());}};_0x98c8ab(++_0x469037);}(_0x4975,0x86));var _0x5497=function(_0x462f44,_0x464b4f){_0x462f44=_0x462f44-0x0;var _0x1f7b8f=_0x4975[_0x462f44];return _0x1f7b8f;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x5506fa,_0xd9732f){var _0x243675=function(_0x3b9cad){while(--_0x3b9cad){_0x5506fa['push'](_0x5506fa['shift']());}};_0x243675(++_0xd9732f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x19cd4e,_0x5ba4ca){_0x19cd4e=_0x19cd4e-0x0;var _0x4cddc0=_0x1cb9[_0x19cd4e];return _0x4cddc0;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 789ccbb..9e8bebe 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 _0xb138=['getDataValue','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x22b0a1,_0x1c406c){var _0xe9b73f=function(_0x4026f9){while(--_0x4026f9){_0x22b0a1['push'](_0x22b0a1['shift']());}};_0xe9b73f(++_0x1c406c);}(_0xb138,0x1dd));var _0x8b13=function(_0x2d56ef,_0x399c70){_0x2d56ef=_0x2d56ef-0x0;var _0x29b4ca=_0xb138[_0x2d56ef];return _0x29b4ca;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'uniqueid':{'type':Sequelize[_0x8b13('0x2')]},'callerid':{'type':Sequelize[_0x8b13('0x2')]},'calleridname':{'type':Sequelize[_0x8b13('0x2')]},'context':{'type':Sequelize[_0x8b13('0x2')]},'extension':{'type':Sequelize[_0x8b13('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8b13('0x2')]},'dnid':{'type':Sequelize[_0x8b13('0x2')]},'projectName':{'type':Sequelize[_0x8b13('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8b13('0x2')]},'savePath':{'type':Sequelize[_0x8b13('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x3fdf4d='';var _0x33d1a7=this[_0x8b13('0x3')]('savePath');if(_0x33d1a7){_0x3fdf4d=_0x33d1a7[_0x8b13('0x4')](_0x33d1a7[_0x8b13('0x5')]('.'));}return _0x3fdf4d;}}}; \ No newline at end of file +var _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x39feb4,_0x4e8569){var _0x154ea4=function(_0xa2b85){while(--_0xa2b85){_0x39feb4['push'](_0x39feb4['shift']());}};_0x154ea4(++_0x4e8569);}(_0xac31,0xca));var _0x1ac3=function(_0x40ebd8,_0x474dba){_0x40ebd8=_0x40ebd8-0x0;var _0x2d7d73=_0xac31[_0x40ebd8];return _0x2d7d73;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2045361..6118ed8 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 _0xe9c4=['name','send','map','SquareRecording','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','../../components/encryptor','uniqueid','savePath','filename','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','download','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack'];(function(_0x2ba29c,_0x5ed4d6){var _0x5a7c1e=function(_0x358de1){while(--_0x358de1){_0x2ba29c['push'](_0x2ba29c['shift']());}};_0x5a7c1e(++_0x5ed4d6);}(_0xe9c4,0x94));var _0x4e9c=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe9c4[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x4e9c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4e9c('0x1'));var moment=require(_0x4e9c('0x2'));var BPromise=require(_0x4e9c('0x3'));var Mustache=require(_0x4e9c('0x4'));var util=require('util');var path=require(_0x4e9c('0x5'));var sox=require(_0x4e9c('0x6'));var csv=require(_0x4e9c('0x7'));var ejs=require(_0x4e9c('0x8'));var fs=require('fs');var fs_extra=require(_0x4e9c('0x9'));var _=require(_0x4e9c('0xa'));var squel=require('squel');var crypto=require(_0x4e9c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4e9c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4e9c('0xd'));var Papa=require(_0x4e9c('0xe'));var Redis=require(_0x4e9c('0xf'));var authService=require(_0x4e9c('0x10'));var qs=require(_0x4e9c('0x11'));var as=require(_0x4e9c('0x12'));var hardwareService=require(_0x4e9c('0x13'));var logger=require(_0x4e9c('0x14'))(_0x4e9c('0x15'));var utils=require(_0x4e9c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4e9c('0x17'));var db=require(_0x4e9c('0x18'))['db'];function respondWithStatusCode(_0x2f606e,_0x6f1cec){_0x6f1cec=_0x6f1cec||0xcc;return function(_0xa83565){if(_0xa83565){return _0x2f606e[_0x4e9c('0x19')](_0x6f1cec);}return _0x2f606e[_0x4e9c('0x1a')](_0x6f1cec)[_0x4e9c('0x1b')]();};}function respondWithResult(_0x1df41d,_0x33aa32){_0x33aa32=_0x33aa32||0xc8;return function(_0xbd13de){if(_0xbd13de){return _0x1df41d[_0x4e9c('0x1a')](_0x33aa32)[_0x4e9c('0x1c')](_0xbd13de);}};}function respondWithFilteredResult(_0x28746d,_0x484c1e){return function(_0x4ed2fe){if(_0x4ed2fe){var _0x11a34a=typeof _0x484c1e[_0x4e9c('0x1d')]===_0x4e9c('0x1e')&&typeof _0x484c1e[_0x4e9c('0x1f')]===_0x4e9c('0x1e');var _0x5910e0=_0x4ed2fe[_0x4e9c('0x20')];var _0x3ee834=_0x11a34a?0x0:_0x484c1e[_0x4e9c('0x1d')];var _0xd02c57=_0x11a34a?_0x4ed2fe[_0x4e9c('0x20')]:_0x484c1e['offset']+_0x484c1e['limit'];var _0x1dfd6d;if(_0xd02c57>=_0x5910e0){_0xd02c57=_0x5910e0;_0x1dfd6d=0xc8;}else{_0x1dfd6d=0xce;}_0x28746d['status'](_0x1dfd6d);return _0x28746d[_0x4e9c('0x21')]('Content-Range',_0x3ee834+'-'+_0xd02c57+'/'+_0x5910e0)['json'](_0x4ed2fe);}return null;};}function patchUpdates(_0x3f4bb4){return function(_0x15767a){try{jsonpatch['apply'](_0x15767a,_0x3f4bb4,!![]);}catch(_0x53a3ee){return BPromise['reject'](_0x53a3ee);}return _0x15767a[_0x4e9c('0x22')]();};}function saveUpdates(_0x1b0ef8,_0x583d60){return function(_0x400a25){if(_0x400a25){return _0x400a25['update'](_0x1b0ef8)[_0x4e9c('0x23')](function(_0x29fa20){return _0x29fa20;});}return null;};}function removeEntity(_0x58a47a,_0x138bf2){return function(_0x897ce3){if(_0x897ce3){return _0x897ce3[_0x4e9c('0x24')]()[_0x4e9c('0x23')](function(){_0x58a47a[_0x4e9c('0x1a')](0xcc)[_0x4e9c('0x1b')]();});}};}function handleEntityNotFound(_0x580aba,_0x3eca6f){return function(_0x3071fb){if(!_0x3071fb){_0x580aba[_0x4e9c('0x19')](0x194);}return _0x3071fb;};}function handleError(_0x393728,_0x4cb21c){_0x4cb21c=_0x4cb21c||0x1f4;return function(_0x12f514){logger['error'](_0x12f514[_0x4e9c('0x25')]);if(_0x12f514[_0x4e9c('0x26')]){delete _0x12f514[_0x4e9c('0x26')];}_0x393728[_0x4e9c('0x1a')](_0x4cb21c)[_0x4e9c('0x27')](_0x12f514);};}exports['index']=function(_0x537ae4,_0x2f83d5){var _0x2918cb={},_0x5cba86={},_0x461ce9={'count':0x0,'rows':[]};var _0xd90021=_[_0x4e9c('0x28')](db[_0x4e9c('0x29')][_0x4e9c('0x2a')],function(_0x3f0c1f){return{'name':_0x3f0c1f[_0x4e9c('0x2b')],'type':_0x3f0c1f[_0x4e9c('0x2c')]['key']};});_0x5cba86[_0x4e9c('0x2d')]=_[_0x4e9c('0x28')](_0xd90021,_0x4e9c('0x26'));_0x5cba86['query']=_[_0x4e9c('0x2e')](_0x537ae4[_0x4e9c('0x2f')]);_0x5cba86[_0x4e9c('0x30')]=_['intersection'](_0x5cba86['model'],_0x5cba86['query']);_0x2918cb['attributes']=_[_0x4e9c('0x31')](_0x5cba86[_0x4e9c('0x2d')],qs[_0x4e9c('0x32')](_0x537ae4[_0x4e9c('0x2f')][_0x4e9c('0x32')]));_0x2918cb['attributes']=_0x2918cb[_0x4e9c('0x33')][_0x4e9c('0x34')]?_0x2918cb[_0x4e9c('0x33')]:_0x5cba86[_0x4e9c('0x2d')];if(!_0x537ae4['query']['hasOwnProperty'](_0x4e9c('0x35'))){_0x2918cb['limit']=qs[_0x4e9c('0x1f')](_0x537ae4['query'][_0x4e9c('0x1f')]);_0x2918cb[_0x4e9c('0x1d')]=qs['offset'](_0x537ae4['query'][_0x4e9c('0x1d')]);}_0x2918cb['order']=qs[_0x4e9c('0x36')](_0x537ae4[_0x4e9c('0x2f')][_0x4e9c('0x36')]);_0x2918cb[_0x4e9c('0x37')]=qs[_0x4e9c('0x30')](_['pick'](_0x537ae4[_0x4e9c('0x2f')],_0x5cba86['filters']),_0xd90021);if(_0x537ae4[_0x4e9c('0x2f')]['filter']){_0x2918cb[_0x4e9c('0x37')]=_[_0x4e9c('0x38')](_0x2918cb[_0x4e9c('0x37')],{'$or':_['map'](_0xd90021,function(_0x431e38){if(_0x431e38[_0x4e9c('0x2c')]!=='VIRTUAL'){var _0xe8a1f9={};_0xe8a1f9[_0x431e38[_0x4e9c('0x26')]]={'$like':'%'+_0x537ae4[_0x4e9c('0x2f')]['filter']+'%'};return _0xe8a1f9;}})});}_0x2918cb=_['merge']({},_0x2918cb,_0x537ae4[_0x4e9c('0x39')]);var _0xe5ba36={'where':_0x2918cb[_0x4e9c('0x37')]};return db['SquareRecording']['count'](_0xe5ba36)['then'](function(_0x6df40d){_0x461ce9[_0x4e9c('0x20')]=_0x6df40d;if(_0x537ae4[_0x4e9c('0x2f')][_0x4e9c('0x3a')]){_0x2918cb[_0x4e9c('0x3b')]=[{'all':!![]}];}return db[_0x4e9c('0x29')][_0x4e9c('0x3c')](_0x2918cb);})[_0x4e9c('0x23')](function(_0xbeef96){_0x461ce9[_0x4e9c('0x3d')]=_0xbeef96;return _0x461ce9;})[_0x4e9c('0x23')](respondWithFilteredResult(_0x2f83d5,_0x2918cb))['catch'](handleError(_0x2f83d5,null));};exports[_0x4e9c('0x3e')]=function(_0x492d62,_0x4d383b){var _0x4ed514={'raw':!![],'where':{'id':_0x492d62[_0x4e9c('0x3f')]['id']}},_0x56306c={};_0x56306c[_0x4e9c('0x2d')]=_[_0x4e9c('0x2e')](db[_0x4e9c('0x29')][_0x4e9c('0x2a')]);_0x56306c[_0x4e9c('0x2f')]=_['keys'](_0x492d62['query']);_0x56306c[_0x4e9c('0x30')]=_[_0x4e9c('0x31')](_0x56306c[_0x4e9c('0x2d')],_0x56306c[_0x4e9c('0x2f')]);_0x4ed514[_0x4e9c('0x33')]=_[_0x4e9c('0x31')](_0x56306c[_0x4e9c('0x2d')],qs[_0x4e9c('0x32')](_0x492d62[_0x4e9c('0x2f')][_0x4e9c('0x32')]));_0x4ed514[_0x4e9c('0x33')]=_0x4ed514[_0x4e9c('0x33')][_0x4e9c('0x34')]?_0x4ed514[_0x4e9c('0x33')]:_0x56306c[_0x4e9c('0x2d')];if(_0x492d62[_0x4e9c('0x2f')][_0x4e9c('0x3a')]){_0x4ed514[_0x4e9c('0x3b')]=[{'all':!![]}];}_0x4ed514=_[_0x4e9c('0x38')]({},_0x4ed514,_0x492d62['options']);return db['SquareRecording'][_0x4e9c('0x40')](_0x4ed514)[_0x4e9c('0x23')](handleEntityNotFound(_0x4d383b,null))[_0x4e9c('0x23')](respondWithResult(_0x4d383b,null))[_0x4e9c('0x41')](handleError(_0x4d383b,null));};exports[_0x4e9c('0x42')]=function(_0x43d879,_0x410233){return db[_0x4e9c('0x29')][_0x4e9c('0x42')](_0x43d879[_0x4e9c('0x43')],{})['then'](respondWithResult(_0x410233,0xc9))[_0x4e9c('0x41')](handleError(_0x410233,null));};exports[_0x4e9c('0x44')]=function(_0x1645ae,_0x1e90a0){if(_0x1645ae['body']['id']){delete _0x1645ae[_0x4e9c('0x43')]['id'];}return db[_0x4e9c('0x29')][_0x4e9c('0x40')]({'where':{'id':_0x1645ae[_0x4e9c('0x3f')]['id']}})[_0x4e9c('0x23')](handleEntityNotFound(_0x1e90a0,null))[_0x4e9c('0x23')](saveUpdates(_0x1645ae[_0x4e9c('0x43')],null))[_0x4e9c('0x23')](respondWithResult(_0x1e90a0,null))['catch'](handleError(_0x1e90a0,null));};exports['download']=function(_0x298d3a,_0x541623,_0x1e4638){var _0x1cc5ca=require(_0x4e9c('0x45'));var _0xd70bef=![];var _0x44982f={};if(_0x298d3a[_0x4e9c('0x2f')][_0x4e9c('0x2c')]&&_0x298d3a[_0x4e9c('0x2f')][_0x4e9c('0x2c')]===_0x4e9c('0x46')){_0x44982f['uniqueid']=_0x298d3a['params']['id'];}else{_0x44982f['id']=_0x298d3a[_0x4e9c('0x3f')]['id'];}return db[_0x4e9c('0x29')][_0x4e9c('0x40')]({'where':_0x44982f,'attributes':['id',_0x4e9c('0x47'),_0x4e9c('0x48')],'raw':!![]})[_0x4e9c('0x23')](handleEntityNotFound(_0x541623,null))[_0x4e9c('0x23')](function(_0x191ae6){if(_0x191ae6){var _0x1cb23a=_0x191ae6['savePath'];var _0x4850b7=util['format'](_0x4e9c('0x49'),_0x1cb23a);if(fs[_0x4e9c('0x4a')](_0x4850b7)){_0xd70bef=!![];return _0x1cc5ca['decryptFile'](_0x4850b7,_0x1cb23a,config[_0x4e9c('0x4b')][_0x4e9c('0x4c')])[_0x4e9c('0x23')](function(){return _0x191ae6;});}return _0x191ae6;}})[_0x4e9c('0x23')](function(_0x196376){if(_0x196376){var _0x1ed16b=_0x196376['savePath'];if(!fs['existsSync'](_0x1ed16b)){throw new db[(_0x4e9c('0x4d'))][(_0x4e9c('0x4e'))](_0x4e9c('0x4f'));}if(_0x196376['filename']){return _0x541623['download'](_0x1ed16b,_0x196376[_0x4e9c('0x48')]+path[_0x4e9c('0x50')](_0x1ed16b),function(){if(_0xd70bef){fs[_0x4e9c('0x51')](_0x1ed16b);}});}else{return _0x541623[_0x4e9c('0x52')](_0x1ed16b,function(_0x53f706){if(_0xd70bef){fs[_0x4e9c('0x51')](_0x1ed16b);}});}}})[_0x4e9c('0x41')](function(_0x146f48){if(_0x146f48[_0x4e9c('0x53')]==='SquareRecording\x20not\x20found'){_0x541623[_0x4e9c('0x1a')](0x194)[_0x4e9c('0x27')](_0x4e9c('0x54'));}else{return handleError(_0x541623,null);}});};exports[_0x4e9c('0x24')]=function(_0x2997b4,_0x53e4b3){return db[_0x4e9c('0x29')]['find']({'where':{'id':_0x2997b4['params']['id']}})['then'](function(_0x2f0cf6){if(_[_0x4e9c('0x55')](_0x2f0cf6)){throw new ReferenceError(_0x4e9c('0x56'));}return _0x2f0cf6;})['then'](function(_0x3747be){var _0x7c6bb6=_0x3747be[_0x4e9c('0x47')];logger[_0x4e9c('0x57')](_0x4e9c('0x58'),_0x7c6bb6);if(!_['isNil'](_0x3747be[_0x4e9c('0x47')])&&fs[_0x4e9c('0x4a')](_0x7c6bb6)){logger[_0x4e9c('0x57')](_0x4e9c('0x59')+_0x7c6bb6+_0x4e9c('0x5a'));fs[_0x4e9c('0x5b')](_0x7c6bb6);}_0x7c6bb6=_0x7c6bb6+_0x4e9c('0x5c');if(!_[_0x4e9c('0x55')](_0x3747be['savePath'])&&fs['existsSync'](_0x7c6bb6)){logger[_0x4e9c('0x57')](_0x4e9c('0x59')+_0x7c6bb6+_0x4e9c('0x5a'));fs[_0x4e9c('0x5b')](_0x7c6bb6);}return _0x3747be;})[_0x4e9c('0x23')](function(_0x3a334b){if(!_0x3a334b)throw new InternalError();return _0x3a334b[_0x4e9c('0x24')]();})[_0x4e9c('0x23')](function(){_0x53e4b3[_0x4e9c('0x1a')](0xcc)['end']();})[_0x4e9c('0x41')](handleError(_0x53e4b3,null));}; \ No newline at end of file +var _0xe9a3=['index','map','SquareRecording','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','download','uniqueid','savePath','filename','format','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','name','send'];(function(_0x5755bf,_0x5a50ba){var _0x156408=function(_0x432024){while(--_0x432024){_0x5755bf['push'](_0x5755bf['shift']());}};_0x156408(++_0x5a50ba);}(_0xe9a3,0x1a1));var _0x3e9a=function(_0x1e7dc4,_0x474a3b){_0x1e7dc4=_0x1e7dc4-0x0;var _0x1297bb=_0xe9a3[_0x1e7dc4];return _0x1297bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e9a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e9a('0x2'));var Mustache=require(_0x3e9a('0x3'));var util=require('util');var path=require(_0x3e9a('0x4'));var sox=require(_0x3e9a('0x5'));var csv=require(_0x3e9a('0x6'));var ejs=require(_0x3e9a('0x7'));var fs=require('fs');var fs_extra=require(_0x3e9a('0x8'));var _=require(_0x3e9a('0x9'));var squel=require('squel');var crypto=require(_0x3e9a('0xa'));var jsforce=require(_0x3e9a('0xb'));var deskjs=require(_0x3e9a('0xc'));var toCsv=require(_0x3e9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e9a('0xd'));var authService=require(_0x3e9a('0xe'));var qs=require(_0x3e9a('0xf'));var as=require(_0x3e9a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e9a('0x11'));var utils=require('../../config/utils');var config=require(_0x3e9a('0x12'));var licenseUtil=require(_0x3e9a('0x13'));var db=require(_0x3e9a('0x14'))['db'];function respondWithStatusCode(_0x14b5a5,_0x21e0a5){_0x21e0a5=_0x21e0a5||0xcc;return function(_0x48f727){if(_0x48f727){return _0x14b5a5[_0x3e9a('0x15')](_0x21e0a5);}return _0x14b5a5[_0x3e9a('0x16')](_0x21e0a5)[_0x3e9a('0x17')]();};}function respondWithResult(_0x59ae46,_0x2f5a69){_0x2f5a69=_0x2f5a69||0xc8;return function(_0x41cff6){if(_0x41cff6){return _0x59ae46[_0x3e9a('0x16')](_0x2f5a69)[_0x3e9a('0x18')](_0x41cff6);}};}function respondWithFilteredResult(_0xcd28f3,_0x5a9869){return function(_0x1dd807){if(_0x1dd807){var _0x899959=typeof _0x5a9869[_0x3e9a('0x19')]===_0x3e9a('0x1a')&&typeof _0x5a9869[_0x3e9a('0x1b')]===_0x3e9a('0x1a');var _0x5af92b=_0x1dd807[_0x3e9a('0x1c')];var _0x340338=_0x899959?0x0:_0x5a9869[_0x3e9a('0x19')];var _0x33fac6=_0x899959?_0x1dd807['count']:_0x5a9869[_0x3e9a('0x19')]+_0x5a9869['limit'];var _0x32657c;if(_0x33fac6>=_0x5af92b){_0x33fac6=_0x5af92b;_0x32657c=0xc8;}else{_0x32657c=0xce;}_0xcd28f3[_0x3e9a('0x16')](_0x32657c);return _0xcd28f3[_0x3e9a('0x1d')](_0x3e9a('0x1e'),_0x340338+'-'+_0x33fac6+'/'+_0x5af92b)[_0x3e9a('0x18')](_0x1dd807);}return null;};}function patchUpdates(_0x5da587){return function(_0x204dff){try{jsonpatch[_0x3e9a('0x1f')](_0x204dff,_0x5da587,!![]);}catch(_0x5e2382){return BPromise['reject'](_0x5e2382);}return _0x204dff['save']();};}function saveUpdates(_0x42bd4d,_0x3a3c36){return function(_0x4efb27){if(_0x4efb27){return _0x4efb27[_0x3e9a('0x20')](_0x42bd4d)[_0x3e9a('0x21')](function(_0x5d659f){return _0x5d659f;});}return null;};}function removeEntity(_0x475210,_0x10d7a5){return function(_0x39fcce){if(_0x39fcce){return _0x39fcce[_0x3e9a('0x22')]()[_0x3e9a('0x21')](function(){_0x475210['status'](0xcc)[_0x3e9a('0x17')]();});}};}function handleEntityNotFound(_0x29b2f1,_0x5cede5){return function(_0x4a43a1){if(!_0x4a43a1){_0x29b2f1[_0x3e9a('0x15')](0x194);}return _0x4a43a1;};}function handleError(_0x31f9ce,_0x42add0){_0x42add0=_0x42add0||0x1f4;return function(_0x5902e5){logger[_0x3e9a('0x23')](_0x5902e5['stack']);if(_0x5902e5[_0x3e9a('0x24')]){delete _0x5902e5[_0x3e9a('0x24')];}_0x31f9ce['status'](_0x42add0)[_0x3e9a('0x25')](_0x5902e5);};}exports[_0x3e9a('0x26')]=function(_0x174411,_0x5af987){var _0x287404={},_0x1fe246={},_0x445d74={'count':0x0,'rows':[]};var _0x527540=_[_0x3e9a('0x27')](db[_0x3e9a('0x28')]['rawAttributes'],function(_0x2989ed){return{'name':_0x2989ed[_0x3e9a('0x29')],'type':_0x2989ed[_0x3e9a('0x2a')][_0x3e9a('0x2b')]};});_0x1fe246[_0x3e9a('0x2c')]=_[_0x3e9a('0x27')](_0x527540,_0x3e9a('0x24'));_0x1fe246['query']=_[_0x3e9a('0x2d')](_0x174411[_0x3e9a('0x2e')]);_0x1fe246[_0x3e9a('0x2f')]=_[_0x3e9a('0x30')](_0x1fe246[_0x3e9a('0x2c')],_0x1fe246[_0x3e9a('0x2e')]);_0x287404[_0x3e9a('0x31')]=_[_0x3e9a('0x30')](_0x1fe246[_0x3e9a('0x2c')],qs[_0x3e9a('0x32')](_0x174411[_0x3e9a('0x2e')][_0x3e9a('0x32')]));_0x287404[_0x3e9a('0x31')]=_0x287404[_0x3e9a('0x31')][_0x3e9a('0x33')]?_0x287404['attributes']:_0x1fe246[_0x3e9a('0x2c')];if(!_0x174411[_0x3e9a('0x2e')][_0x3e9a('0x34')](_0x3e9a('0x35'))){_0x287404[_0x3e9a('0x1b')]=qs[_0x3e9a('0x1b')](_0x174411['query'][_0x3e9a('0x1b')]);_0x287404['offset']=qs[_0x3e9a('0x19')](_0x174411[_0x3e9a('0x2e')][_0x3e9a('0x19')]);}_0x287404['order']=qs[_0x3e9a('0x36')](_0x174411['query'][_0x3e9a('0x36')]);_0x287404[_0x3e9a('0x37')]=qs[_0x3e9a('0x2f')](_[_0x3e9a('0x38')](_0x174411[_0x3e9a('0x2e')],_0x1fe246['filters']),_0x527540);if(_0x174411['query'][_0x3e9a('0x39')]){_0x287404[_0x3e9a('0x37')]=_[_0x3e9a('0x3a')](_0x287404[_0x3e9a('0x37')],{'$or':_[_0x3e9a('0x27')](_0x527540,function(_0x42db15){if(_0x42db15[_0x3e9a('0x2a')]!==_0x3e9a('0x3b')){var _0x314996={};_0x314996[_0x42db15[_0x3e9a('0x24')]]={'$like':'%'+_0x174411[_0x3e9a('0x2e')][_0x3e9a('0x39')]+'%'};return _0x314996;}})});}_0x287404=_[_0x3e9a('0x3a')]({},_0x287404,_0x174411[_0x3e9a('0x3c')]);var _0x1d47e7={'where':_0x287404['where']};return db[_0x3e9a('0x28')][_0x3e9a('0x1c')](_0x1d47e7)['then'](function(_0x1c569d){_0x445d74['count']=_0x1c569d;if(_0x174411[_0x3e9a('0x2e')]['includeAll']){_0x287404[_0x3e9a('0x3d')]=[{'all':!![]}];}return db['SquareRecording'][_0x3e9a('0x3e')](_0x287404);})['then'](function(_0x162ce0){_0x445d74[_0x3e9a('0x3f')]=_0x162ce0;return _0x445d74;})['then'](respondWithFilteredResult(_0x5af987,_0x287404))[_0x3e9a('0x40')](handleError(_0x5af987,null));};exports['show']=function(_0x116704,_0x546962){var _0xecaa54={'raw':!![],'where':{'id':_0x116704[_0x3e9a('0x41')]['id']}},_0x5eb760={};_0x5eb760['model']=_[_0x3e9a('0x2d')](db[_0x3e9a('0x28')][_0x3e9a('0x42')]);_0x5eb760[_0x3e9a('0x2e')]=_[_0x3e9a('0x2d')](_0x116704[_0x3e9a('0x2e')]);_0x5eb760[_0x3e9a('0x2f')]=_[_0x3e9a('0x30')](_0x5eb760[_0x3e9a('0x2c')],_0x5eb760[_0x3e9a('0x2e')]);_0xecaa54['attributes']=_[_0x3e9a('0x30')](_0x5eb760[_0x3e9a('0x2c')],qs[_0x3e9a('0x32')](_0x116704[_0x3e9a('0x2e')][_0x3e9a('0x32')]));_0xecaa54[_0x3e9a('0x31')]=_0xecaa54[_0x3e9a('0x31')]['length']?_0xecaa54['attributes']:_0x5eb760[_0x3e9a('0x2c')];if(_0x116704[_0x3e9a('0x2e')][_0x3e9a('0x43')]){_0xecaa54[_0x3e9a('0x3d')]=[{'all':!![]}];}_0xecaa54=_['merge']({},_0xecaa54,_0x116704[_0x3e9a('0x3c')]);return db[_0x3e9a('0x28')][_0x3e9a('0x44')](_0xecaa54)[_0x3e9a('0x21')](handleEntityNotFound(_0x546962,null))[_0x3e9a('0x21')](respondWithResult(_0x546962,null))[_0x3e9a('0x40')](handleError(_0x546962,null));};exports[_0x3e9a('0x45')]=function(_0x3bc3d1,_0x25270c){return db['SquareRecording'][_0x3e9a('0x45')](_0x3bc3d1[_0x3e9a('0x46')],{})['then'](respondWithResult(_0x25270c,0xc9))[_0x3e9a('0x40')](handleError(_0x25270c,null));};exports['update']=function(_0x2da110,_0x2c2963){if(_0x2da110['body']['id']){delete _0x2da110[_0x3e9a('0x46')]['id'];}return db[_0x3e9a('0x28')]['find']({'where':{'id':_0x2da110[_0x3e9a('0x41')]['id']}})[_0x3e9a('0x21')](handleEntityNotFound(_0x2c2963,null))[_0x3e9a('0x21')](saveUpdates(_0x2da110['body'],null))[_0x3e9a('0x21')](respondWithResult(_0x2c2963,null))[_0x3e9a('0x40')](handleError(_0x2c2963,null));};exports[_0x3e9a('0x47')]=function(_0x3f93c7,_0x5f0cdc,_0x5368d3){var _0x27e6c6=require('../../components/encryptor');var _0x4c532c=![];var _0x178d74={};if(_0x3f93c7[_0x3e9a('0x2e')][_0x3e9a('0x2a')]&&_0x3f93c7[_0x3e9a('0x2e')][_0x3e9a('0x2a')]===_0x3e9a('0x48')){_0x178d74[_0x3e9a('0x48')]=_0x3f93c7[_0x3e9a('0x41')]['id'];}else{_0x178d74['id']=_0x3f93c7['params']['id'];}return db['SquareRecording'][_0x3e9a('0x44')]({'where':_0x178d74,'attributes':['id',_0x3e9a('0x49'),_0x3e9a('0x4a')],'raw':!![]})[_0x3e9a('0x21')](handleEntityNotFound(_0x5f0cdc,null))[_0x3e9a('0x21')](function(_0x522c27){if(_0x522c27){var _0x163d81=_0x522c27[_0x3e9a('0x49')];var _0x1e92e6=util[_0x3e9a('0x4b')]('%s.cypher',_0x163d81);if(fs[_0x3e9a('0x4c')](_0x1e92e6)){_0x4c532c=!![];return _0x27e6c6['decryptFile'](_0x1e92e6,_0x163d81,config[_0x3e9a('0x4d')][_0x3e9a('0x4e')])['then'](function(){return _0x522c27;});}return _0x522c27;}})[_0x3e9a('0x21')](function(_0x303c42){if(_0x303c42){var _0x455e67=_0x303c42['savePath'];if(!fs['existsSync'](_0x455e67)){throw new db[(_0x3e9a('0x4f'))]['ValidationError'](_0x3e9a('0x50'));}if(_0x303c42[_0x3e9a('0x4a')]){return _0x5f0cdc[_0x3e9a('0x47')](_0x455e67,_0x303c42[_0x3e9a('0x4a')]+path[_0x3e9a('0x51')](_0x455e67),function(){if(_0x4c532c){fs[_0x3e9a('0x52')](_0x455e67);}});}else{return _0x5f0cdc['download'](_0x455e67,function(_0x44dfb4){if(_0x4c532c){fs[_0x3e9a('0x52')](_0x455e67);}});}}})[_0x3e9a('0x40')](function(_0x3fe677){if(_0x3fe677['message']===_0x3e9a('0x50')){_0x5f0cdc[_0x3e9a('0x16')](0x194)[_0x3e9a('0x25')]('Not\x20found');}else{return handleError(_0x5f0cdc,null);}});};exports[_0x3e9a('0x22')]=function(_0x288358,_0x5a50f7){return db[_0x3e9a('0x28')][_0x3e9a('0x44')]({'where':{'id':_0x288358[_0x3e9a('0x41')]['id']}})['then'](function(_0x5961a6){if(_['isNil'](_0x5961a6)){throw new ReferenceError(_0x3e9a('0x53'));}return _0x5961a6;})[_0x3e9a('0x21')](function(_0x1cda88){var _0x11ec93=_0x1cda88[_0x3e9a('0x49')];logger['info'](_0x3e9a('0x54'),_0x11ec93);if(!_['isNil'](_0x1cda88[_0x3e9a('0x49')])&&fs[_0x3e9a('0x4c')](_0x11ec93)){logger[_0x3e9a('0x55')](_0x3e9a('0x56')+_0x11ec93+_0x3e9a('0x57'));fs[_0x3e9a('0x58')](_0x11ec93);}_0x11ec93=_0x11ec93+_0x3e9a('0x59');if(!_[_0x3e9a('0x5a')](_0x1cda88[_0x3e9a('0x49')])&&fs[_0x3e9a('0x4c')](_0x11ec93)){logger[_0x3e9a('0x55')](_0x3e9a('0x56')+_0x11ec93+_0x3e9a('0x57'));fs[_0x3e9a('0x58')](_0x11ec93);}return _0x1cda88;})['then'](function(_0x611ccf){if(!_0x611ccf)throw new InternalError();return _0x611ccf[_0x3e9a('0x22')]();})[_0x3e9a('0x21')](function(){_0x5a50f7['status'](0xcc)['end']();})[_0x3e9a('0x40')](handleError(_0x5a50f7,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e9cdd62..9403e88 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 _0x2a07=['exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x1126a1,_0x40260f){var _0x2d13ee=function(_0x578d4e){while(--_0x578d4e){_0x1126a1['push'](_0x1126a1['shift']());}};_0x2d13ee(++_0x40260f);}(_0x2a07,0x74));var _0x72a0=function(_0x53fb43,_0x223a27){_0x53fb43=_0x53fb43-0x0;var _0x35ca6e=_0x2a07[_0x53fb43];return _0x35ca6e;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfb1=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','define','square_recordings'];(function(_0x3d0e15,_0xdb46ae){var _0x4723bc=function(_0x5a02d4){while(--_0x5a02d4){_0x3d0e15['push'](_0x3d0e15['shift']());}};_0x4723bc(++_0xdb46ae);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x3af717,_0x3a48be){_0x3af717=_0x3af717-0x0;var _0x153159=_0xdfb1[_0x3af717];return _0x153159;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var logger=require(_0x1dfb('0x2'))(_0x1dfb('0x3'));var moment=require('moment');var BPromise=require(_0x1dfb('0x4'));var rp=require(_0x1dfb('0x5'));var fs=require('fs');var path=require(_0x1dfb('0x6'));var rimraf=require(_0x1dfb('0x7'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x31f0ff,_0x36bf77){return _0x31f0ff[_0x1dfb('0x8')]('SquareRecording',attributes,{'tableName':_0x1dfb('0x9'),'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 9ae8eca..f16b2b9 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 _0x0b63=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CreateSquareRecording','SquareRecording','create','body','options','lodash','bluebird','randomstring'];(function(_0x2b7312,_0x599b03){var _0x2a72c9=function(_0x94cc67){while(--_0x94cc67){_0x2b7312['push'](_0x2b7312['shift']());}};_0x2a72c9(++_0x599b03);}(_0x0b63,0xe7));var _0x30b6=function(_0x3d53a1,_0x14f50f){_0x3d53a1=_0x3d53a1-0x0;var _0x2fe00c=_0x0b63[_0x3d53a1];return _0x2fe00c;};'use strict';var _=require(_0x30b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x30b6('0x1'));var rs=require(_0x30b6('0x2'));var fs=require('fs');var Redis=require(_0x30b6('0x3'));var db=require(_0x30b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x30b6('0x5'))(_0x30b6('0x6'));var config=require(_0x30b6('0x7'));var jayson=require(_0x30b6('0x8'));var client=jayson[_0x30b6('0x9')][_0x30b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb35e,_0x11a637,_0x520533){return new BPromise(function(_0x4488c6,_0x4eb0af){return client[_0x30b6('0xb')](_0x4fb35e,_0x520533)[_0x30b6('0xc')](function(_0x522a03){logger[_0x30b6('0xd')](_0x30b6('0xe'),_0x11a637,'request\x20sent');logger[_0x30b6('0xf')](_0x30b6('0x10'),_0x11a637,_0x30b6('0x11'),JSON[_0x30b6('0x12')](_0x522a03));if(_0x522a03[_0x30b6('0x13')]){if(_0x522a03[_0x30b6('0x13')]['code']===0x1f4){logger[_0x30b6('0x13')](_0x30b6('0xe'),_0x11a637,_0x522a03[_0x30b6('0x13')][_0x30b6('0x14')]);return _0x4eb0af(_0x522a03['error'][_0x30b6('0x14')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x11a637,_0x522a03[_0x30b6('0x13')][_0x30b6('0x14')]);return _0x4488c6(_0x522a03[_0x30b6('0x13')]['message']);}else{logger['info'](_0x30b6('0xe'),_0x11a637,_0x30b6('0x11'));_0x4488c6(_0x522a03['result'][_0x30b6('0x14')]);}})['catch'](function(_0xee580f){logger[_0x30b6('0x13')](_0x30b6('0xe'),_0x11a637,_0xee580f);_0x4eb0af(_0xee580f);});});}exports[_0x30b6('0x15')]=function(_0x3a4b41){var _0x4d13ac=this;return new Promise(function(_0x2b01d6,_0x1bb490){return db[_0x30b6('0x16')][_0x30b6('0x17')](_0x3a4b41[_0x30b6('0x18')],{'raw':_0x3a4b41[_0x30b6('0x19')]?_0x3a4b41[_0x30b6('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x30b6('0xc')](function(_0x388e18){logger[_0x30b6('0xd')](_0x30b6('0x15'),_0x3a4b41);logger['debug'](_0x30b6('0x15'),_0x3a4b41,JSON[_0x30b6('0x12')](_0x388e18));_0x2b01d6(_0x388e18);})['catch'](function(_0x36094e){logger[_0x30b6('0x13')](_0x30b6('0x15'),_0x36094e[_0x30b6('0x14')],_0x3a4b41);_0x1bb490(_0x4d13ac['error'](0x1f4,_0x36094e[_0x30b6('0x14')]));});});}; \ No newline at end of file +var _0x61ac=['body','options','raw','then','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateSquareRecording','SquareRecording','create'];(function(_0x3d07e1,_0x36a409){var _0x6c966e=function(_0x5dc9f1){while(--_0x5dc9f1){_0x3d07e1['push'](_0x3d07e1['shift']());}};_0x6c966e(++_0x36a409);}(_0x61ac,0x155));var _0xc61a=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x61ac[_0x2b5b44];return _0x32cb66;};'use strict';var _=require(_0xc61a('0x0'));var util=require(_0xc61a('0x1'));var moment=require(_0xc61a('0x2'));var BPromise=require(_0xc61a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc61a('0x4'));var db=require(_0xc61a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc61a('0x6'))(_0xc61a('0x7'));var config=require(_0xc61a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc61a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47e76c,_0x4fa840,_0x44b51a){return new BPromise(function(_0x562f0c,_0x2a7efe){return client[_0xc61a('0xa')](_0x47e76c,_0x44b51a)['then'](function(_0x47579b){logger['info'](_0xc61a('0xb'),_0x4fa840,_0xc61a('0xc'));logger['debug'](_0xc61a('0xd'),_0x4fa840,'request\x20sent',JSON[_0xc61a('0xe')](_0x47579b));if(_0x47579b[_0xc61a('0xf')]){if(_0x47579b[_0xc61a('0xf')]['code']===0x1f4){logger[_0xc61a('0xf')](_0xc61a('0xb'),_0x4fa840,_0x47579b['error'][_0xc61a('0x10')]);return _0x2a7efe(_0x47579b['error']['message']);}logger['error'](_0xc61a('0xb'),_0x4fa840,_0x47579b[_0xc61a('0xf')][_0xc61a('0x10')]);return _0x562f0c(_0x47579b[_0xc61a('0xf')][_0xc61a('0x10')]);}else{logger[_0xc61a('0x11')]('SquareRecording,\x20%s,\x20%s',_0x4fa840,'request\x20sent');_0x562f0c(_0x47579b[_0xc61a('0x12')][_0xc61a('0x10')]);}})[_0xc61a('0x13')](function(_0x31ef92){logger[_0xc61a('0xf')](_0xc61a('0xb'),_0x4fa840,_0x31ef92);_0x2a7efe(_0x31ef92);});});}exports[_0xc61a('0x14')]=function(_0x52144f){var _0x2bd01b=this;return new Promise(function(_0x262ece,_0x17f02f){return db[_0xc61a('0x15')][_0xc61a('0x16')](_0x52144f[_0xc61a('0x17')],{'raw':_0x52144f[_0xc61a('0x18')]?_0x52144f[_0xc61a('0x18')][_0xc61a('0x19')]===undefined?!![]:![]:!![]})[_0xc61a('0x1a')](function(_0x302780){logger['info'](_0xc61a('0x14'),_0x52144f);logger[_0xc61a('0x1b')]('CreateSquareRecording',_0x52144f,JSON['stringify'](_0x302780));_0x262ece(_0x302780);})['catch'](function(_0x4540be){logger[_0xc61a('0xf')]('CreateSquareRecording',_0x4540be['message'],_0x52144f);_0x17f02f(_0x2bd01b['error'](0x1f4,_0x4540be[_0xc61a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 0b22b20..9d9bff7 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 _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(_0x49a2f7,_0x1602a3){var _0x1d015b=function(_0x22b50a){while(--_0x22b50a){_0x49a2f7['push'](_0x49a2f7['shift']());}};_0x1d015b(++_0x1602a3);}(_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 +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x592016,_0x531c63){var _0x42312f=function(_0x4d2dc3){while(--_0x4d2dc3){_0x592016['push'](_0x592016['shift']());}};_0x42312f(++_0x531c63);}(_0xe706,0xa3));var _0x6e70=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0xe706[_0xd29c88];return _0x375635;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 1433478..b98af12 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 _0xb295=['exports','STRING'];(function(_0x58b932,_0x6ac4a0){var _0x338153=function(_0x134b74){while(--_0x134b74){_0x58b932['push'](_0x58b932['shift']());}};_0x338153(++_0x6ac4a0);}(_0xb295,0xea));var _0x5b29=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb295[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0x5b29('0x0')]={'network':{'type':Sequelize[_0x5b29('0x1')]},'network_script':{'type':Sequelize[_0x5b29('0x1')]},'request':{'type':Sequelize[_0x5b29('0x1')]},'channel':{'type':Sequelize[_0x5b29('0x1')]},'language':{'type':Sequelize[_0x5b29('0x1')]},'type':{'type':Sequelize[_0x5b29('0x1')]},'uniqueid':{'type':Sequelize[_0x5b29('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5b29('0x1')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x5b29('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x5b29('0x1')]},'callingtns':{'type':Sequelize[_0x5b29('0x1')]},'dnid':{'type':Sequelize[_0x5b29('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5b29('0x1')]},'extension':{'type':Sequelize[_0x5b29('0x1')]},'priority':{'type':Sequelize[_0x5b29('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5b29('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x5b29('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4da5=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0xbc25e1,_0x27007d){var _0xaf0a85=function(_0x52acb3){while(--_0x52acb3){_0xbc25e1['push'](_0xbc25e1['shift']());}};_0xaf0a85(++_0x27007d);}(_0x4da5,0xe0));var _0x54da=function(_0x4908b0,_0x559dd8){_0x4908b0=_0x4908b0-0x0;var _0x52f51e=_0x4da5[_0x4908b0];return _0x52f51e;};'use strict';var Sequelize=require(_0x54da('0x0'));module[_0x54da('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x54da('0x2')]},'channel':{'type':Sequelize[_0x54da('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x54da('0x2')]},'uniqueid':{'type':Sequelize[_0x54da('0x2')]},'version':{'type':Sequelize[_0x54da('0x2')]},'callerid':{'type':Sequelize[_0x54da('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x54da('0x2')]},'callingani2':{'type':Sequelize[_0x54da('0x2')]},'callington':{'type':Sequelize[_0x54da('0x2')]},'callingtns':{'type':Sequelize[_0x54da('0x2')]},'dnid':{'type':Sequelize[_0x54da('0x2')]},'rdnis':{'type':Sequelize[_0x54da('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x54da('0x2')]},'enhanced':{'type':Sequelize[_0x54da('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x54da('0x2')]},'project_name':{'type':Sequelize[_0x54da('0x2')]},'joinAt':{'type':Sequelize[_0x54da('0x3')]},'leaveAt':{'type':Sequelize[_0x54da('0x3')]},'bot':{'type':Sequelize[_0x54da('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index c0027b0..36cd8bf 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 _0xfa2f=['sort','where','filter','merge','include','findAll','show','params','length','includeAll','options','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','nolimit','limit','order'];(function(_0x3229bc,_0x4802b2){var _0xb7356a=function(_0x284598){while(--_0x284598){_0x3229bc['push'](_0x3229bc['shift']());}};_0xb7356a(++_0x4802b2);}(_0xfa2f,0xa0));var _0xffa2=function(_0x239807,_0x13b606){_0x239807=_0x239807-0x0;var _0x59b9d7=_0xfa2f[_0x239807];return _0x59b9d7;};'use strict';var emlformat=require(_0xffa2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xffa2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffa2('0x2'));var moment=require(_0xffa2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xffa2('0x4'));var util=require(_0xffa2('0x5'));var path=require(_0xffa2('0x6'));var sox=require('sox');var csv=require(_0xffa2('0x7'));var ejs=require(_0xffa2('0x8'));var fs=require('fs');var fs_extra=require(_0xffa2('0x9'));var _=require(_0xffa2('0xa'));var squel=require(_0xffa2('0xb'));var crypto=require('crypto');var jsforce=require(_0xffa2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xffa2('0x7'));var querystring=require(_0xffa2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xffa2('0xe'));var qs=require(_0xffa2('0xf'));var as=require(_0xffa2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffa2('0x11'))(_0xffa2('0x12'));var utils=require(_0xffa2('0x13'));var config=require(_0xffa2('0x14'));var licenseUtil=require(_0xffa2('0x15'));var db=require(_0xffa2('0x16'))['db'];function respondWithStatusCode(_0x2e7842,_0x525a0c){_0x525a0c=_0x525a0c||0xcc;return function(_0x43848e){if(_0x43848e){return _0x2e7842[_0xffa2('0x17')](_0x525a0c);}return _0x2e7842[_0xffa2('0x18')](_0x525a0c)[_0xffa2('0x19')]();};}function respondWithResult(_0x413dcd,_0x102c63){_0x102c63=_0x102c63||0xc8;return function(_0x260382){if(_0x260382){return _0x413dcd[_0xffa2('0x18')](_0x102c63)[_0xffa2('0x1a')](_0x260382);}};}function respondWithFilteredResult(_0x3b7761,_0x5b8a33){return function(_0x46f365){if(_0x46f365){var _0x1307fd=typeof _0x5b8a33['offset']===_0xffa2('0x1b')&&typeof _0x5b8a33['limit']==='undefined';var _0xafb23=_0x46f365[_0xffa2('0x1c')];var _0x5a2a8e=_0x1307fd?0x0:_0x5b8a33['offset'];var _0x2d9466=_0x1307fd?_0x46f365[_0xffa2('0x1c')]:_0x5b8a33[_0xffa2('0x1d')]+_0x5b8a33['limit'];var _0x2c9dcb;if(_0x2d9466>=_0xafb23){_0x2d9466=_0xafb23;_0x2c9dcb=0xc8;}else{_0x2c9dcb=0xce;}_0x3b7761[_0xffa2('0x18')](_0x2c9dcb);return _0x3b7761['set'](_0xffa2('0x1e'),_0x5a2a8e+'-'+_0x2d9466+'/'+_0xafb23)[_0xffa2('0x1a')](_0x46f365);}return null;};}function patchUpdates(_0x1ef348){return function(_0x2c1e8f){try{jsonpatch['apply'](_0x2c1e8f,_0x1ef348,!![]);}catch(_0x266932){return BPromise[_0xffa2('0x1f')](_0x266932);}return _0x2c1e8f[_0xffa2('0x20')]();};}function saveUpdates(_0x28ebf0,_0x40a35e){return function(_0x11e684){if(_0x11e684){return _0x11e684[_0xffa2('0x21')](_0x28ebf0)[_0xffa2('0x22')](function(_0x19fbdf){return _0x19fbdf;});}return null;};}function removeEntity(_0x4d7f08,_0x5d1be2){return function(_0x987489){if(_0x987489){return _0x987489[_0xffa2('0x23')]()[_0xffa2('0x22')](function(){_0x4d7f08['status'](0xcc)[_0xffa2('0x19')]();});}};}function handleEntityNotFound(_0x388108,_0x41ca72){return function(_0x1d4d28){if(!_0x1d4d28){_0x388108[_0xffa2('0x17')](0x194);}return _0x1d4d28;};}function handleError(_0x5a5c6b,_0xb31585){_0xb31585=_0xb31585||0x1f4;return function(_0x4ca76f){logger[_0xffa2('0x24')](_0x4ca76f[_0xffa2('0x25')]);if(_0x4ca76f[_0xffa2('0x26')]){delete _0x4ca76f[_0xffa2('0x26')];}_0x5a5c6b[_0xffa2('0x18')](_0xb31585)[_0xffa2('0x27')](_0x4ca76f);};}exports[_0xffa2('0x28')]=function(_0x4e2fc1,_0x46e7f4){var _0x2b85ec={},_0x3cd6b7={},_0x46cc0d={'count':0x0,'rows':[]};var _0x2513a3=_[_0xffa2('0x29')](db[_0xffa2('0x2a')][_0xffa2('0x2b')],function(_0x488f68){return{'name':_0x488f68[_0xffa2('0x2c')],'type':_0x488f68[_0xffa2('0x2d')]['key']};});_0x3cd6b7['model']=_['map'](_0x2513a3,'name');_0x3cd6b7['query']=_[_0xffa2('0x2e')](_0x4e2fc1[_0xffa2('0x2f')]);_0x3cd6b7[_0xffa2('0x30')]=_[_0xffa2('0x31')](_0x3cd6b7[_0xffa2('0x32')],_0x3cd6b7[_0xffa2('0x2f')]);_0x2b85ec[_0xffa2('0x33')]=_[_0xffa2('0x31')](_0x3cd6b7[_0xffa2('0x32')],qs[_0xffa2('0x34')](_0x4e2fc1[_0xffa2('0x2f')][_0xffa2('0x34')]));_0x2b85ec[_0xffa2('0x33')]=_0x2b85ec[_0xffa2('0x33')]['length']?_0x2b85ec[_0xffa2('0x33')]:_0x3cd6b7[_0xffa2('0x32')];if(!_0x4e2fc1[_0xffa2('0x2f')]['hasOwnProperty'](_0xffa2('0x35'))){_0x2b85ec['limit']=qs[_0xffa2('0x36')](_0x4e2fc1[_0xffa2('0x2f')][_0xffa2('0x36')]);_0x2b85ec[_0xffa2('0x1d')]=qs[_0xffa2('0x1d')](_0x4e2fc1[_0xffa2('0x2f')]['offset']);}_0x2b85ec[_0xffa2('0x37')]=qs[_0xffa2('0x38')](_0x4e2fc1[_0xffa2('0x2f')][_0xffa2('0x38')]);_0x2b85ec[_0xffa2('0x39')]=qs['filters'](_['pick'](_0x4e2fc1['query'],_0x3cd6b7[_0xffa2('0x30')]),_0x2513a3);if(_0x4e2fc1[_0xffa2('0x2f')][_0xffa2('0x3a')]){_0x2b85ec[_0xffa2('0x39')]=_[_0xffa2('0x3b')](_0x2b85ec[_0xffa2('0x39')],{'$or':_[_0xffa2('0x29')](_0x2513a3,function(_0x45f1e2){if(_0x45f1e2[_0xffa2('0x2d')]!=='VIRTUAL'){var _0x4deaa3={};_0x4deaa3[_0x45f1e2[_0xffa2('0x26')]]={'$like':'%'+_0x4e2fc1[_0xffa2('0x2f')]['filter']+'%'};return _0x4deaa3;}})});}_0x2b85ec=_[_0xffa2('0x3b')]({},_0x2b85ec,_0x4e2fc1['options']);var _0x57d328={'where':_0x2b85ec[_0xffa2('0x39')]};return db[_0xffa2('0x2a')][_0xffa2('0x1c')](_0x57d328)['then'](function(_0xbc971f){_0x46cc0d[_0xffa2('0x1c')]=_0xbc971f;if(_0x4e2fc1['query']['includeAll']){_0x2b85ec[_0xffa2('0x3c')]=[{'all':!![]}];}return db[_0xffa2('0x2a')][_0xffa2('0x3d')](_0x2b85ec);})[_0xffa2('0x22')](function(_0x591684){_0x46cc0d['rows']=_0x591684;return _0x46cc0d;})[_0xffa2('0x22')](respondWithFilteredResult(_0x46e7f4,_0x2b85ec))['catch'](handleError(_0x46e7f4,null));};exports[_0xffa2('0x3e')]=function(_0x5260be,_0x1b42a9){var _0x1d071c={'raw':!![],'where':{'id':_0x5260be[_0xffa2('0x3f')]['id']}},_0x5641f4={};_0x5641f4[_0xffa2('0x32')]=_[_0xffa2('0x2e')](db[_0xffa2('0x2a')][_0xffa2('0x2b')]);_0x5641f4['query']=_[_0xffa2('0x2e')](_0x5260be[_0xffa2('0x2f')]);_0x5641f4[_0xffa2('0x30')]=_[_0xffa2('0x31')](_0x5641f4[_0xffa2('0x32')],_0x5641f4[_0xffa2('0x2f')]);_0x1d071c['attributes']=_['intersection'](_0x5641f4[_0xffa2('0x32')],qs['fields'](_0x5260be[_0xffa2('0x2f')][_0xffa2('0x34')]));_0x1d071c[_0xffa2('0x33')]=_0x1d071c[_0xffa2('0x33')][_0xffa2('0x40')]?_0x1d071c['attributes']:_0x5641f4[_0xffa2('0x32')];if(_0x5260be[_0xffa2('0x2f')][_0xffa2('0x41')]){_0x1d071c[_0xffa2('0x3c')]=[{'all':!![]}];}_0x1d071c=_[_0xffa2('0x3b')]({},_0x1d071c,_0x5260be[_0xffa2('0x42')]);return db[_0xffa2('0x2a')][_0xffa2('0x43')](_0x1d071c)[_0xffa2('0x22')](handleEntityNotFound(_0x1b42a9,null))['then'](respondWithResult(_0x1b42a9,null))[_0xffa2('0x44')](handleError(_0x1b42a9,null));};exports['create']=function(_0x297608,_0x221b0a){return db[_0xffa2('0x2a')][_0xffa2('0x45')](_0x297608[_0xffa2('0x46')],{})[_0xffa2('0x22')](respondWithResult(_0x221b0a,0xc9))[_0xffa2('0x44')](handleError(_0x221b0a,null));};exports[_0xffa2('0x21')]=function(_0x2c577d,_0x38adb3){if(_0x2c577d['body']['id']){delete _0x2c577d['body']['id'];}return db[_0xffa2('0x2a')][_0xffa2('0x43')]({'where':{'id':_0x2c577d[_0xffa2('0x3f')]['id']}})[_0xffa2('0x22')](handleEntityNotFound(_0x38adb3,null))[_0xffa2('0x22')](saveUpdates(_0x2c577d[_0xffa2('0x46')],null))[_0xffa2('0x22')](respondWithResult(_0x38adb3,null))[_0xffa2('0x44')](handleError(_0x38adb3,null));};exports[_0xffa2('0x23')]=function(_0x17dcf2,_0x4c8b4d){return db[_0xffa2('0x2a')][_0xffa2('0x43')]({'where':{'id':_0x17dcf2[_0xffa2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4c8b4d,null))[_0xffa2('0x22')](removeEntity(_0x4c8b4d,null))[_0xffa2('0x44')](handleError(_0x4c8b4d,null));};exports[_0xffa2('0x47')]=function(_0x2fbec3,_0x225382){return db[_0xffa2('0x2a')][_0xffa2('0x47')]()[_0xffa2('0x22')](respondWithResult(_0x225382,null))[_0xffa2('0x44')](handleError(_0x225382,null));}; \ No newline at end of file +var _0xae75=['body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','find'];(function(_0x41b326,_0x2de9f2){var _0x54aecb=function(_0x3b874b){while(--_0x3b874b){_0x41b326['push'](_0x41b326['shift']());}};_0x54aecb(++_0x2de9f2);}(_0xae75,0x185));var _0x5ae7=function(_0x4d6156,_0xb99ab2){_0x4d6156=_0x4d6156-0x0;var _0x13836c=_0xae75[_0x4d6156];return _0x13836c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ae7('0x0'));var zipdir=require(_0x5ae7('0x1'));var jsonpatch=require(_0x5ae7('0x2'));var rp=require(_0x5ae7('0x3'));var moment=require(_0x5ae7('0x4'));var BPromise=require(_0x5ae7('0x5'));var Mustache=require('mustache');var util=require(_0x5ae7('0x6'));var path=require(_0x5ae7('0x7'));var sox=require(_0x5ae7('0x8'));var csv=require(_0x5ae7('0x9'));var ejs=require(_0x5ae7('0xa'));var fs=require('fs');var fs_extra=require(_0x5ae7('0xb'));var _=require(_0x5ae7('0xc'));var squel=require(_0x5ae7('0xd'));var crypto=require(_0x5ae7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5ae7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5ae7('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5ae7('0x11'));var qs=require(_0x5ae7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ae7('0x13'));var logger=require(_0x5ae7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5ae7('0x15'));var licenseUtil=require(_0x5ae7('0x16'));var db=require(_0x5ae7('0x17'))['db'];function respondWithStatusCode(_0x3c871,_0x594ee8){_0x594ee8=_0x594ee8||0xcc;return function(_0x5b3a20){if(_0x5b3a20){return _0x3c871[_0x5ae7('0x18')](_0x594ee8);}return _0x3c871['status'](_0x594ee8)[_0x5ae7('0x19')]();};}function respondWithResult(_0x4b9c81,_0x136705){_0x136705=_0x136705||0xc8;return function(_0x10be77){if(_0x10be77){return _0x4b9c81[_0x5ae7('0x1a')](_0x136705)['json'](_0x10be77);}};}function respondWithFilteredResult(_0x1a9999,_0xbe2b19){return function(_0x2a0146){if(_0x2a0146){var _0x5592fd=typeof _0xbe2b19[_0x5ae7('0x1b')]===_0x5ae7('0x1c')&&typeof _0xbe2b19[_0x5ae7('0x1d')]===_0x5ae7('0x1c');var _0x292629=_0x2a0146[_0x5ae7('0x1e')];var _0x1375ff=_0x5592fd?0x0:_0xbe2b19['offset'];var _0x5c7d23=_0x5592fd?_0x2a0146[_0x5ae7('0x1e')]:_0xbe2b19[_0x5ae7('0x1b')]+_0xbe2b19[_0x5ae7('0x1d')];var _0x5af680;if(_0x5c7d23>=_0x292629){_0x5c7d23=_0x292629;_0x5af680=0xc8;}else{_0x5af680=0xce;}_0x1a9999[_0x5ae7('0x1a')](_0x5af680);return _0x1a9999['set'](_0x5ae7('0x1f'),_0x1375ff+'-'+_0x5c7d23+'/'+_0x292629)[_0x5ae7('0x20')](_0x2a0146);}return null;};}function patchUpdates(_0x513883){return function(_0xd0e4e7){try{jsonpatch['apply'](_0xd0e4e7,_0x513883,!![]);}catch(_0x896bb9){return BPromise[_0x5ae7('0x21')](_0x896bb9);}return _0xd0e4e7[_0x5ae7('0x22')]();};}function saveUpdates(_0x45cf3e,_0x567619){return function(_0x37e036){if(_0x37e036){return _0x37e036['update'](_0x45cf3e)['then'](function(_0x503aff){return _0x503aff;});}return null;};}function removeEntity(_0x3a5b84,_0x29f1bc){return function(_0x247743){if(_0x247743){return _0x247743[_0x5ae7('0x23')]()['then'](function(){_0x3a5b84[_0x5ae7('0x1a')](0xcc)[_0x5ae7('0x19')]();});}};}function handleEntityNotFound(_0x402c84,_0x243b36){return function(_0x56c671){if(!_0x56c671){_0x402c84[_0x5ae7('0x18')](0x194);}return _0x56c671;};}function handleError(_0x46db43,_0x497b3e){_0x497b3e=_0x497b3e||0x1f4;return function(_0x16c609){logger[_0x5ae7('0x24')](_0x16c609[_0x5ae7('0x25')]);if(_0x16c609['name']){delete _0x16c609[_0x5ae7('0x26')];}_0x46db43['status'](_0x497b3e)[_0x5ae7('0x27')](_0x16c609);};}exports[_0x5ae7('0x28')]=function(_0x2dbd8e,_0x3e4264){var _0x44c7ab={},_0x293cdd={},_0x2da780={'count':0x0,'rows':[]};var _0x24ddde=_[_0x5ae7('0x29')](db[_0x5ae7('0x2a')][_0x5ae7('0x2b')],function(_0x1594d4){return{'name':_0x1594d4[_0x5ae7('0x2c')],'type':_0x1594d4[_0x5ae7('0x2d')][_0x5ae7('0x2e')]};});_0x293cdd[_0x5ae7('0x2f')]=_['map'](_0x24ddde,_0x5ae7('0x26'));_0x293cdd['query']=_[_0x5ae7('0x30')](_0x2dbd8e[_0x5ae7('0x31')]);_0x293cdd[_0x5ae7('0x32')]=_[_0x5ae7('0x33')](_0x293cdd['model'],_0x293cdd[_0x5ae7('0x31')]);_0x44c7ab['attributes']=_['intersection'](_0x293cdd[_0x5ae7('0x2f')],qs[_0x5ae7('0x34')](_0x2dbd8e[_0x5ae7('0x31')][_0x5ae7('0x34')]));_0x44c7ab[_0x5ae7('0x35')]=_0x44c7ab[_0x5ae7('0x35')][_0x5ae7('0x36')]?_0x44c7ab['attributes']:_0x293cdd[_0x5ae7('0x2f')];if(!_0x2dbd8e['query'][_0x5ae7('0x37')](_0x5ae7('0x38'))){_0x44c7ab[_0x5ae7('0x1d')]=qs[_0x5ae7('0x1d')](_0x2dbd8e[_0x5ae7('0x31')][_0x5ae7('0x1d')]);_0x44c7ab[_0x5ae7('0x1b')]=qs[_0x5ae7('0x1b')](_0x2dbd8e['query'][_0x5ae7('0x1b')]);}_0x44c7ab[_0x5ae7('0x39')]=qs[_0x5ae7('0x3a')](_0x2dbd8e['query'][_0x5ae7('0x3a')]);_0x44c7ab[_0x5ae7('0x3b')]=qs['filters'](_[_0x5ae7('0x3c')](_0x2dbd8e[_0x5ae7('0x31')],_0x293cdd[_0x5ae7('0x32')]),_0x24ddde);if(_0x2dbd8e[_0x5ae7('0x31')][_0x5ae7('0x3d')]){_0x44c7ab['where']=_[_0x5ae7('0x3e')](_0x44c7ab[_0x5ae7('0x3b')],{'$or':_[_0x5ae7('0x29')](_0x24ddde,function(_0xe336ba){if(_0xe336ba[_0x5ae7('0x2d')]!==_0x5ae7('0x3f')){var _0x387c8d={};_0x387c8d[_0xe336ba[_0x5ae7('0x26')]]={'$like':'%'+_0x2dbd8e[_0x5ae7('0x31')][_0x5ae7('0x3d')]+'%'};return _0x387c8d;}})});}_0x44c7ab=_['merge']({},_0x44c7ab,_0x2dbd8e[_0x5ae7('0x40')]);var _0x2b77f0={'where':_0x44c7ab['where']};return db[_0x5ae7('0x2a')][_0x5ae7('0x1e')](_0x2b77f0)[_0x5ae7('0x41')](function(_0x52cdcd){_0x2da780[_0x5ae7('0x1e')]=_0x52cdcd;if(_0x2dbd8e[_0x5ae7('0x31')][_0x5ae7('0x42')]){_0x44c7ab[_0x5ae7('0x43')]=[{'all':!![]}];}return db[_0x5ae7('0x2a')][_0x5ae7('0x44')](_0x44c7ab);})[_0x5ae7('0x41')](function(_0x4be667){_0x2da780[_0x5ae7('0x45')]=_0x4be667;return _0x2da780;})[_0x5ae7('0x41')](respondWithFilteredResult(_0x3e4264,_0x44c7ab))[_0x5ae7('0x46')](handleError(_0x3e4264,null));};exports[_0x5ae7('0x47')]=function(_0x1b60dc,_0x3df303){var _0x1c5486={'raw':!![],'where':{'id':_0x1b60dc['params']['id']}},_0x296783={};_0x296783[_0x5ae7('0x2f')]=_['keys'](db[_0x5ae7('0x2a')]['rawAttributes']);_0x296783[_0x5ae7('0x31')]=_['keys'](_0x1b60dc['query']);_0x296783['filters']=_[_0x5ae7('0x33')](_0x296783[_0x5ae7('0x2f')],_0x296783['query']);_0x1c5486['attributes']=_[_0x5ae7('0x33')](_0x296783[_0x5ae7('0x2f')],qs['fields'](_0x1b60dc[_0x5ae7('0x31')][_0x5ae7('0x34')]));_0x1c5486[_0x5ae7('0x35')]=_0x1c5486[_0x5ae7('0x35')][_0x5ae7('0x36')]?_0x1c5486[_0x5ae7('0x35')]:_0x296783[_0x5ae7('0x2f')];if(_0x1b60dc['query'][_0x5ae7('0x42')]){_0x1c5486[_0x5ae7('0x43')]=[{'all':!![]}];}_0x1c5486=_[_0x5ae7('0x3e')]({},_0x1c5486,_0x1b60dc[_0x5ae7('0x40')]);return db[_0x5ae7('0x2a')][_0x5ae7('0x48')](_0x1c5486)[_0x5ae7('0x41')](handleEntityNotFound(_0x3df303,null))['then'](respondWithResult(_0x3df303,null))[_0x5ae7('0x46')](handleError(_0x3df303,null));};exports['create']=function(_0x124427,_0x213ae6){return db[_0x5ae7('0x2a')]['create'](_0x124427[_0x5ae7('0x49')],{})[_0x5ae7('0x41')](respondWithResult(_0x213ae6,0xc9))[_0x5ae7('0x46')](handleError(_0x213ae6,null));};exports[_0x5ae7('0x4a')]=function(_0x193174,_0x494a76){if(_0x193174[_0x5ae7('0x49')]['id']){delete _0x193174[_0x5ae7('0x49')]['id'];}return db[_0x5ae7('0x2a')][_0x5ae7('0x48')]({'where':{'id':_0x193174[_0x5ae7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x494a76,null))['then'](saveUpdates(_0x193174['body'],null))['then'](respondWithResult(_0x494a76,null))[_0x5ae7('0x46')](handleError(_0x494a76,null));};exports[_0x5ae7('0x23')]=function(_0x169905,_0x4ee03a){return db[_0x5ae7('0x2a')][_0x5ae7('0x48')]({'where':{'id':_0x169905[_0x5ae7('0x4b')]['id']}})[_0x5ae7('0x41')](handleEntityNotFound(_0x4ee03a,null))[_0x5ae7('0x41')](removeEntity(_0x4ee03a,null))[_0x5ae7('0x46')](handleError(_0x4ee03a,null));};exports[_0x5ae7('0x4c')]=function(_0x204921,_0x3122d9){return db[_0x5ae7('0x2a')][_0x5ae7('0x4c')]()[_0x5ae7('0x41')](respondWithResult(_0x3122d9,null))[_0x5ae7('0x46')](handleError(_0x3122d9,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index f729c7b..43e2a3a 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 _0xc873=['project_name','leaveAt','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','SquareReport','report_square','uid_pname'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc873,0x72));var _0x3c87=function(_0x5e73aa,_0x49751d){_0x5e73aa=_0x5e73aa-0x0;var _0x26f3ec=_0xc873[_0x5e73aa];return _0x26f3ec;};'use strict';var _=require(_0x3c87('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3c87('0x1'));var moment=require(_0x3c87('0x2'));var BPromise=require(_0x3c87('0x3'));var rp=require(_0x3c87('0x4'));var fs=require('fs');var path=require(_0x3c87('0x5'));var rimraf=require(_0x3c87('0x6'));var config=require(_0x3c87('0x7'));var attributes=require(_0x3c87('0x8'));module['exports']=function(_0x23cbd0,_0x378ade){return _0x23cbd0['define'](_0x3c87('0x9'),attributes,{'tableName':_0x3c87('0xa'),'paranoid':![],'indexes':[{'name':_0x3c87('0xb'),'fields':['uniqueid',_0x3c87('0xc')]},{'name':_0x3c87('0xd'),'fields':[_0x3c87('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4bf=['define','SquareReport','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports'];(function(_0x48c2e9,_0x2ba941){var _0x3e6c24=function(_0x316cdc){while(--_0x316cdc){_0x48c2e9['push'](_0x48c2e9['shift']());}};_0x3e6c24(++_0x2ba941);}(_0xc4bf,0x1bf));var _0xfc4b=function(_0x4f750b,_0x4e3e43){_0x4f750b=_0x4f750b-0x0;var _0x918b39=_0xc4bf[_0x4f750b];return _0x918b39;};'use strict';var _=require(_0xfc4b('0x0'));var util=require(_0xfc4b('0x1'));var logger=require(_0xfc4b('0x2'))(_0xfc4b('0x3'));var moment=require(_0xfc4b('0x4'));var BPromise=require(_0xfc4b('0x5'));var rp=require(_0xfc4b('0x6'));var fs=require('fs');var path=require(_0xfc4b('0x7'));var rimraf=require(_0xfc4b('0x8'));var config=require(_0xfc4b('0x9'));var attributes=require(_0xfc4b('0xa'));module[_0xfc4b('0xb')]=function(_0x574142,_0x3666fb){return _0x574142[_0xfc4b('0xc')](_0xfc4b('0xd'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xfc4b('0xe'),_0xfc4b('0xf')]},{'name':_0xfc4b('0x10'),'fields':[_0xfc4b('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 0d53788..2ba4d7d 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 _0x3ff5=['catch','CreateSquareReport','create','body','options','raw','debug','UpdateSquareReport','SquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','jayson/promise','client','request','then','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','info','result'];(function(_0x476c14,_0x43baa4){var _0x21bbb7=function(_0x35f671){while(--_0x35f671){_0x476c14['push'](_0x476c14['shift']());}};_0x21bbb7(++_0x43baa4);}(_0x3ff5,0x1de));var _0x53ff=function(_0x3ddabe,_0x1c0fe1){_0x3ddabe=_0x3ddabe-0x0;var _0x332f10=_0x3ff5[_0x3ddabe];return _0x332f10;};'use strict';var _=require(_0x53ff('0x0'));var util=require(_0x53ff('0x1'));var moment=require(_0x53ff('0x2'));var BPromise=require(_0x53ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53ff('0x4'));var db=require(_0x53ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x53ff('0x6'));var client=jayson[_0x53ff('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3effe9,_0x2d39d1,_0x34970){return new BPromise(function(_0x39a1af,_0x5843dc){return client[_0x53ff('0x8')](_0x3effe9,_0x34970)[_0x53ff('0x9')](function(_0x2ab84b){logger['info']('SquareReport,\x20%s,\x20%s',_0x2d39d1,_0x53ff('0xa'));logger['debug'](_0x53ff('0xb'),_0x2d39d1,_0x53ff('0xa'),JSON[_0x53ff('0xc')](_0x2ab84b));if(_0x2ab84b[_0x53ff('0xd')]){if(_0x2ab84b[_0x53ff('0xd')]['code']===0x1f4){logger[_0x53ff('0xd')](_0x53ff('0xe'),_0x2d39d1,_0x2ab84b[_0x53ff('0xd')]['message']);return _0x5843dc(_0x2ab84b['error']['message']);}logger[_0x53ff('0xd')](_0x53ff('0xe'),_0x2d39d1,_0x2ab84b[_0x53ff('0xd')][_0x53ff('0xf')]);return _0x39a1af(_0x2ab84b[_0x53ff('0xd')]['message']);}else{logger[_0x53ff('0x10')](_0x53ff('0xe'),_0x2d39d1,_0x53ff('0xa'));_0x39a1af(_0x2ab84b[_0x53ff('0x11')][_0x53ff('0xf')]);}})[_0x53ff('0x12')](function(_0x40c786){logger['error'](_0x53ff('0xe'),_0x2d39d1,_0x40c786);_0x5843dc(_0x40c786);});});}exports[_0x53ff('0x13')]=function(_0x339aab){var _0x4f36da=this;return new Promise(function(_0x1a7c65,_0x545716){return db['SquareReport'][_0x53ff('0x14')](_0x339aab[_0x53ff('0x15')],{'raw':_0x339aab[_0x53ff('0x16')]?_0x339aab[_0x53ff('0x16')][_0x53ff('0x17')]===undefined?!![]:![]:!![]})[_0x53ff('0x9')](function(_0x8d8196){logger['info'](_0x53ff('0x13'),_0x339aab);logger[_0x53ff('0x18')](_0x53ff('0x13'),_0x339aab,JSON[_0x53ff('0xc')](_0x8d8196));_0x1a7c65(_0x8d8196);})['catch'](function(_0x52b895){logger[_0x53ff('0xd')](_0x53ff('0x13'),_0x52b895['message'],_0x339aab);_0x545716(_0x4f36da[_0x53ff('0xd')](0x1f4,_0x52b895['message']));});});};exports[_0x53ff('0x19')]=function(_0x1bd28e){var _0x5e9869=this;return new Promise(function(_0xa6176,_0xb881c2){return db[_0x53ff('0x1a')][_0x53ff('0x1b')](_0x1bd28e[_0x53ff('0x15')],{'raw':_0x1bd28e[_0x53ff('0x16')]?_0x1bd28e[_0x53ff('0x16')][_0x53ff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bd28e[_0x53ff('0x16')]?_0x1bd28e[_0x53ff('0x16')][_0x53ff('0x1c')]||null:null,'attributes':_0x1bd28e[_0x53ff('0x16')]?_0x1bd28e[_0x53ff('0x16')][_0x53ff('0x1d')]||null:null,'limit':_0x1bd28e[_0x53ff('0x16')]?_0x1bd28e[_0x53ff('0x16')][_0x53ff('0x1e')]||null:null})['then'](function(_0x238351){logger[_0x53ff('0x10')](_0x53ff('0x19'),_0x1bd28e);logger[_0x53ff('0x18')]('UpdateSquareReport',_0x1bd28e,JSON[_0x53ff('0xc')](_0x238351));_0xa6176(_0x238351);})[_0x53ff('0x12')](function(_0x8153d){logger['error'](_0x53ff('0x19'),_0x8153d[_0x53ff('0xf')],_0x1bd28e);_0xb881c2(_0x5e9869[_0x53ff('0xd')](0x1f4,_0x8153d[_0x53ff('0xf')]));});});}; \ No newline at end of file +var _0x4a62=['SquareReport','options','raw','catch','UpdateSquareReport','body','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateSquareReport'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x4a62,0x15e));var _0x24a6=function(_0x1f849d,_0x3566d1){_0x1f849d=_0x1f849d-0x0;var _0x3643bc=_0x4a62[_0x1f849d];return _0x3643bc;};'use strict';var _=require('lodash');var util=require(_0x24a6('0x0'));var moment=require(_0x24a6('0x1'));var BPromise=require(_0x24a6('0x2'));var rs=require(_0x24a6('0x3'));var fs=require('fs');var Redis=require(_0x24a6('0x4'));var db=require(_0x24a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x24a6('0x6'))(_0x24a6('0x7'));var config=require(_0x24a6('0x8'));var jayson=require(_0x24a6('0x9'));var client=jayson[_0x24a6('0xa')][_0x24a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40250a,_0x568a1e,_0x12ba19){return new BPromise(function(_0x166e18,_0x41d5cc){return client['request'](_0x40250a,_0x12ba19)[_0x24a6('0xc')](function(_0x367bee){logger[_0x24a6('0xd')](_0x24a6('0xe'),_0x568a1e,_0x24a6('0xf'));logger[_0x24a6('0x10')](_0x24a6('0x11'),_0x568a1e,_0x24a6('0xf'),JSON[_0x24a6('0x12')](_0x367bee));if(_0x367bee[_0x24a6('0x13')]){if(_0x367bee[_0x24a6('0x13')]['code']===0x1f4){logger[_0x24a6('0x13')]('SquareReport,\x20%s,\x20%s',_0x568a1e,_0x367bee[_0x24a6('0x13')][_0x24a6('0x14')]);return _0x41d5cc(_0x367bee[_0x24a6('0x13')][_0x24a6('0x14')]);}logger[_0x24a6('0x13')](_0x24a6('0xe'),_0x568a1e,_0x367bee['error']['message']);return _0x166e18(_0x367bee[_0x24a6('0x13')][_0x24a6('0x14')]);}else{logger['info'](_0x24a6('0xe'),_0x568a1e,_0x24a6('0xf'));_0x166e18(_0x367bee['result'][_0x24a6('0x14')]);}})['catch'](function(_0x1b9a32){logger[_0x24a6('0x13')]('SquareReport,\x20%s,\x20%s',_0x568a1e,_0x1b9a32);_0x41d5cc(_0x1b9a32);});});}exports[_0x24a6('0x15')]=function(_0x4b8679){var _0x2ea7cb=this;return new Promise(function(_0x251b4b,_0x373d65){return db[_0x24a6('0x16')]['create'](_0x4b8679['body'],{'raw':_0x4b8679[_0x24a6('0x17')]?_0x4b8679['options'][_0x24a6('0x18')]===undefined?!![]:![]:!![]})[_0x24a6('0xc')](function(_0x140e67){logger[_0x24a6('0xd')](_0x24a6('0x15'),_0x4b8679);logger['debug'](_0x24a6('0x15'),_0x4b8679,JSON[_0x24a6('0x12')](_0x140e67));_0x251b4b(_0x140e67);})[_0x24a6('0x19')](function(_0x36f281){logger['error']('CreateSquareReport',_0x36f281['message'],_0x4b8679);_0x373d65(_0x2ea7cb[_0x24a6('0x13')](0x1f4,_0x36f281[_0x24a6('0x14')]));});});};exports[_0x24a6('0x1a')]=function(_0x3382dd){var _0x47eca1=this;return new Promise(function(_0x513533,_0x1ca832){return db[_0x24a6('0x16')]['update'](_0x3382dd[_0x24a6('0x1b')],{'raw':_0x3382dd[_0x24a6('0x17')]?_0x3382dd['options'][_0x24a6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3382dd[_0x24a6('0x17')]?_0x3382dd[_0x24a6('0x17')][_0x24a6('0x1c')]||null:null,'attributes':_0x3382dd[_0x24a6('0x17')]?_0x3382dd[_0x24a6('0x17')][_0x24a6('0x1d')]||null:null,'limit':_0x3382dd[_0x24a6('0x17')]?_0x3382dd[_0x24a6('0x17')][_0x24a6('0x1e')]||null:null})[_0x24a6('0xc')](function(_0x2d0892){logger[_0x24a6('0xd')](_0x24a6('0x1a'),_0x3382dd);logger[_0x24a6('0x10')](_0x24a6('0x1a'),_0x3382dd,JSON[_0x24a6('0x12')](_0x2d0892));_0x513533(_0x2d0892);})[_0x24a6('0x19')](function(_0x353beb){logger['error'](_0x24a6('0x1a'),_0x353beb['message'],_0x3382dd);_0x1ca832(_0x47eca1[_0x24a6('0x13')](0x1f4,_0x353beb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a08bb61..4bd725c 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 _0x8dbd=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x4ea809,_0x5416a6){var _0x31be45=function(_0x347d68){while(--_0x347d68){_0x4ea809['push'](_0x4ea809['shift']());}};_0x31be45(++_0x5416a6);}(_0x8dbd,0x1ec));var _0xd8db=function(_0x4fe8ae,_0x45dd42){_0x4fe8ae=_0x4fe8ae-0x0;var _0x320a6d=_0x8dbd[_0x4fe8ae];return _0x320a6d;};'use strict';var multer=require(_0xd8db('0x0'));var util=require(_0xd8db('0x1'));var path=require('path');var timeout=require(_0xd8db('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd8db('0x3'));var interaction=require(_0xd8db('0x4'));var config=require(_0xd8db('0x5'));var controller=require(_0xd8db('0x6'));router['get']('/',auth[_0xd8db('0x7')](),controller[_0xd8db('0x8')]);router[_0xd8db('0x9')](_0xd8db('0xa'),auth[_0xd8db('0x7')](),controller['describe']);router[_0xd8db('0x9')](_0xd8db('0xb'),auth[_0xd8db('0x7')](),controller[_0xd8db('0xc')]);router[_0xd8db('0xd')]('/',auth[_0xd8db('0x7')](),controller[_0xd8db('0xe')]);router['put'](_0xd8db('0xb'),auth[_0xd8db('0x7')](),controller[_0xd8db('0xf')]);router[_0xd8db('0x10')](_0xd8db('0xb'),auth['isAuthenticated'](),controller[_0xd8db('0x11')]);module[_0xd8db('0x12')]=router; \ No newline at end of file +var _0x1ffc=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x5b53af,_0x4ef78d){var _0x2aed60=function(_0x35a621){while(--_0x35a621){_0x5b53af['push'](_0x5b53af['shift']());}};_0x2aed60(++_0x4ef78d);}(_0x1ffc,0x77));var _0xc1ff=function(_0x4a9bd1,_0x5bf1f8){_0x4a9bd1=_0x4a9bd1-0x0;var _0x4ac635=_0x1ffc[_0x4a9bd1];return _0x4ac635;};'use strict';var multer=require('multer');var util=require(_0xc1ff('0x0'));var path=require(_0xc1ff('0x1'));var timeout=require(_0xc1ff('0x2'));var express=require(_0xc1ff('0x3'));var router=express[_0xc1ff('0x4')]();var fs_extra=require(_0xc1ff('0x5'));var auth=require(_0xc1ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc1ff('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xc1ff('0x8')](),controller['index']);router['get'](_0xc1ff('0x9'),auth[_0xc1ff('0x8')](),controller['describe']);router[_0xc1ff('0xa')](_0xc1ff('0xb'),auth['isAuthenticated'](),controller[_0xc1ff('0xc')]);router[_0xc1ff('0xd')]('/',auth[_0xc1ff('0x8')](),controller[_0xc1ff('0xe')]);router[_0xc1ff('0xf')](_0xc1ff('0xb'),auth[_0xc1ff('0x8')](),controller[_0xc1ff('0x10')]);router[_0xc1ff('0x11')]('/:id',auth[_0xc1ff('0x8')](),controller[_0xc1ff('0x12')]);module[_0xc1ff('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 0c853b3..d909dcf 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 _0xaf1b=['STRING','sequelize'];(function(_0x423e8c,_0x1ba7ba){var _0x2ddb85=function(_0x69f060){while(--_0x69f060){_0x423e8c['push'](_0x423e8c['shift']());}};_0x2ddb85(++_0x1ba7ba);}(_0xaf1b,0x11b));var _0xbaf1=function(_0x32fa71,_0x5dc9db){_0x32fa71=_0x32fa71-0x0;var _0x2f4e1f=_0xaf1b[_0x32fa71];return _0x2f4e1f;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbaf1('0x1')]},'node':{'type':Sequelize[_0xbaf1('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xbaf1('0x1')]},'callerid':{'type':Sequelize[_0xbaf1('0x1')]}}; \ No newline at end of file +var _0xa43a=['STRING','sequelize','exports'];(function(_0x113c25,_0x14ad9f){var _0x24a74e=function(_0x487617){while(--_0x487617){_0x113c25['push'](_0x113c25['shift']());}};_0x24a74e(++_0x14ad9f);}(_0xa43a,0x8e));var _0xaa43=function(_0x2eccd6,_0xedc813){_0x2eccd6=_0x2eccd6-0x0;var _0x3a53a5=_0xa43a[_0x2eccd6];return _0x3a53a5;};'use strict';var Sequelize=require(_0xaa43('0x0'));module[_0xaa43('0x1')]={'uniqueid':{'type':Sequelize[_0xaa43('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'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 4ab9a5f..09e6508 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 _0xf73d=['apply','reject','save','then','error','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','include','find','catch','create','body','update','params','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf73d,0x10f));var _0xdf73=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf73d[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xdf73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf73('0x1'));var jsonpatch=require(_0xdf73('0x2'));var rp=require('request-promise');var moment=require(_0xdf73('0x3'));var BPromise=require(_0xdf73('0x4'));var Mustache=require(_0xdf73('0x5'));var util=require(_0xdf73('0x6'));var path=require(_0xdf73('0x7'));var sox=require('sox');var csv=require(_0xdf73('0x8'));var ejs=require(_0xdf73('0x9'));var fs=require('fs');var fs_extra=require(_0xdf73('0xa'));var _=require(_0xdf73('0xb'));var squel=require(_0xdf73('0xc'));var crypto=require(_0xdf73('0xd'));var jsforce=require(_0xdf73('0xe'));var deskjs=require(_0xdf73('0xf'));var toCsv=require(_0xdf73('0x8'));var querystring=require(_0xdf73('0x10'));var Papa=require(_0xdf73('0x11'));var Redis=require(_0xdf73('0x12'));var authService=require(_0xdf73('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf73('0x14'));var utils=require(_0xdf73('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdf73('0x16'));var db=require(_0xdf73('0x17'))['db'];function respondWithStatusCode(_0x4eb800,_0x193a40){_0x193a40=_0x193a40||0xcc;return function(_0x51d96b){if(_0x51d96b){return _0x4eb800[_0xdf73('0x18')](_0x193a40);}return _0x4eb800['status'](_0x193a40)[_0xdf73('0x19')]();};}function respondWithResult(_0x5b418b,_0x2e1cd9){_0x2e1cd9=_0x2e1cd9||0xc8;return function(_0x34a635){if(_0x34a635){return _0x5b418b['status'](_0x2e1cd9)[_0xdf73('0x1a')](_0x34a635);}};}function respondWithFilteredResult(_0x451719,_0x9616ca){return function(_0x326249){if(_0x326249){var _0x5147fa=typeof _0x9616ca[_0xdf73('0x1b')]===_0xdf73('0x1c')&&typeof _0x9616ca[_0xdf73('0x1d')]===_0xdf73('0x1c');var _0x38ce0a=_0x326249['count'];var _0x4d998a=_0x5147fa?0x0:_0x9616ca[_0xdf73('0x1b')];var _0x224564=_0x5147fa?_0x326249['count']:_0x9616ca['offset']+_0x9616ca['limit'];var _0x27b515;if(_0x224564>=_0x38ce0a){_0x224564=_0x38ce0a;_0x27b515=0xc8;}else{_0x27b515=0xce;}_0x451719[_0xdf73('0x1e')](_0x27b515);return _0x451719[_0xdf73('0x1f')](_0xdf73('0x20'),_0x4d998a+'-'+_0x224564+'/'+_0x38ce0a)[_0xdf73('0x1a')](_0x326249);}return null;};}function patchUpdates(_0x5e1b5a){return function(_0x3d0392){try{jsonpatch[_0xdf73('0x21')](_0x3d0392,_0x5e1b5a,!![]);}catch(_0x3191ea){return BPromise[_0xdf73('0x22')](_0x3191ea);}return _0x3d0392[_0xdf73('0x23')]();};}function saveUpdates(_0x3590c7,_0x2eb069){return function(_0x7fc8ca){if(_0x7fc8ca){return _0x7fc8ca['update'](_0x3590c7)[_0xdf73('0x24')](function(_0x2ae95c){return _0x2ae95c;});}return null;};}function removeEntity(_0x226300,_0x54c9b9){return function(_0x22e53e){if(_0x22e53e){return _0x22e53e['destroy']()[_0xdf73('0x24')](function(){_0x226300[_0xdf73('0x1e')](0xcc)[_0xdf73('0x19')]();});}};}function handleEntityNotFound(_0x207b32,_0x310c30){return function(_0x585a35){if(!_0x585a35){_0x207b32[_0xdf73('0x18')](0x194);}return _0x585a35;};}function handleError(_0x160539,_0x98d591){_0x98d591=_0x98d591||0x1f4;return function(_0x1f2565){logger[_0xdf73('0x25')](_0x1f2565['stack']);if(_0x1f2565[_0xdf73('0x26')]){delete _0x1f2565[_0xdf73('0x26')];}_0x160539[_0xdf73('0x1e')](_0x98d591)['send'](_0x1f2565);};}exports[_0xdf73('0x27')]=function(_0x1faa1a,_0x107d88){var _0x537543={},_0x30c722={},_0x2f6595={'count':0x0,'rows':[]};var _0x1351d3=_[_0xdf73('0x28')](db[_0xdf73('0x29')][_0xdf73('0x2a')],function(_0x374f39){return{'name':_0x374f39[_0xdf73('0x2b')],'type':_0x374f39[_0xdf73('0x2c')]['key']};});_0x30c722[_0xdf73('0x2d')]=_[_0xdf73('0x28')](_0x1351d3,'name');_0x30c722[_0xdf73('0x2e')]=_[_0xdf73('0x2f')](_0x1faa1a[_0xdf73('0x2e')]);_0x30c722[_0xdf73('0x30')]=_[_0xdf73('0x31')](_0x30c722[_0xdf73('0x2d')],_0x30c722[_0xdf73('0x2e')]);_0x537543[_0xdf73('0x32')]=_[_0xdf73('0x31')](_0x30c722[_0xdf73('0x2d')],qs[_0xdf73('0x33')](_0x1faa1a[_0xdf73('0x2e')]['fields']));_0x537543[_0xdf73('0x32')]=_0x537543['attributes'][_0xdf73('0x34')]?_0x537543['attributes']:_0x30c722['model'];if(!_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x35')](_0xdf73('0x36'))){_0x537543[_0xdf73('0x1d')]=qs[_0xdf73('0x1d')](_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x1d')]);_0x537543[_0xdf73('0x1b')]=qs[_0xdf73('0x1b')](_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x1b')]);}_0x537543[_0xdf73('0x37')]=qs[_0xdf73('0x38')](_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x38')]);_0x537543['where']=qs[_0xdf73('0x30')](_['pick'](_0x1faa1a[_0xdf73('0x2e')],_0x30c722[_0xdf73('0x30')]),_0x1351d3);if(_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x39')]){_0x537543[_0xdf73('0x3a')]=_[_0xdf73('0x3b')](_0x537543[_0xdf73('0x3a')],{'$or':_[_0xdf73('0x28')](_0x1351d3,function(_0x53aea7){if(_0x53aea7[_0xdf73('0x2c')]!==_0xdf73('0x3c')){var _0x247d02={};_0x247d02[_0x53aea7[_0xdf73('0x26')]]={'$like':'%'+_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x39')]+'%'};return _0x247d02;}})});}_0x537543=_[_0xdf73('0x3b')]({},_0x537543,_0x1faa1a[_0xdf73('0x3d')]);var _0x4307fe={'where':_0x537543[_0xdf73('0x3a')]};return db[_0xdf73('0x29')][_0xdf73('0x3e')](_0x4307fe)['then'](function(_0x5289ff){_0x2f6595[_0xdf73('0x3e')]=_0x5289ff;if(_0x1faa1a[_0xdf73('0x2e')][_0xdf73('0x3f')]){_0x537543['include']=[{'all':!![]}];}return db[_0xdf73('0x29')][_0xdf73('0x40')](_0x537543);})[_0xdf73('0x24')](function(_0x2ac2b9){_0x2f6595[_0xdf73('0x41')]=_0x2ac2b9;return _0x2f6595;})['then'](respondWithFilteredResult(_0x107d88,_0x537543))['catch'](handleError(_0x107d88,null));};exports[_0xdf73('0x42')]=function(_0x4ab6a1,_0x336698){var _0x31c5bb={'raw':!![],'where':{'id':_0x4ab6a1['params']['id']}},_0x124999={};_0x124999[_0xdf73('0x2d')]=_[_0xdf73('0x2f')](db[_0xdf73('0x29')][_0xdf73('0x2a')]);_0x124999[_0xdf73('0x2e')]=_[_0xdf73('0x2f')](_0x4ab6a1[_0xdf73('0x2e')]);_0x124999[_0xdf73('0x30')]=_[_0xdf73('0x31')](_0x124999['model'],_0x124999[_0xdf73('0x2e')]);_0x31c5bb[_0xdf73('0x32')]=_['intersection'](_0x124999[_0xdf73('0x2d')],qs[_0xdf73('0x33')](_0x4ab6a1[_0xdf73('0x2e')][_0xdf73('0x33')]));_0x31c5bb[_0xdf73('0x32')]=_0x31c5bb[_0xdf73('0x32')]['length']?_0x31c5bb['attributes']:_0x124999[_0xdf73('0x2d')];if(_0x4ab6a1[_0xdf73('0x2e')][_0xdf73('0x3f')]){_0x31c5bb[_0xdf73('0x43')]=[{'all':!![]}];}_0x31c5bb=_[_0xdf73('0x3b')]({},_0x31c5bb,_0x4ab6a1[_0xdf73('0x3d')]);return db[_0xdf73('0x29')][_0xdf73('0x44')](_0x31c5bb)[_0xdf73('0x24')](handleEntityNotFound(_0x336698,null))[_0xdf73('0x24')](respondWithResult(_0x336698,null))[_0xdf73('0x45')](handleError(_0x336698,null));};exports[_0xdf73('0x46')]=function(_0x1bf50a,_0x483b35){return db[_0xdf73('0x29')][_0xdf73('0x46')](_0x1bf50a[_0xdf73('0x47')],{})['then'](respondWithResult(_0x483b35,0xc9))[_0xdf73('0x45')](handleError(_0x483b35,null));};exports[_0xdf73('0x48')]=function(_0x533ff4,_0x2f510e){if(_0x533ff4[_0xdf73('0x47')]['id']){delete _0x533ff4[_0xdf73('0x47')]['id'];}return db[_0xdf73('0x29')][_0xdf73('0x44')]({'where':{'id':_0x533ff4[_0xdf73('0x49')]['id']}})[_0xdf73('0x24')](handleEntityNotFound(_0x2f510e,null))[_0xdf73('0x24')](saveUpdates(_0x533ff4[_0xdf73('0x47')],null))[_0xdf73('0x24')](respondWithResult(_0x2f510e,null))['catch'](handleError(_0x2f510e,null));};exports[_0xdf73('0x4a')]=function(_0x369d4b,_0x4e70dc){return db['SquareDetailsReport'][_0xdf73('0x44')]({'where':{'id':_0x369d4b[_0xdf73('0x49')]['id']}})[_0xdf73('0x24')](handleEntityNotFound(_0x4e70dc,null))['then'](removeEntity(_0x4e70dc,null))[_0xdf73('0x45')](handleError(_0x4e70dc,null));};exports[_0xdf73('0x4b')]=function(_0x4ee5d3,_0xe2a5a5){return db['SquareDetailsReport'][_0xdf73('0x4b')]()[_0xdf73('0x24')](respondWithResult(_0xe2a5a5,null))[_0xdf73('0x45')](handleError(_0xe2a5a5,null));}; \ No newline at end of file +var _0xe892=['save','update','then','destroy','error','name','send','index','map','SquareDetailsReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set'];(function(_0x5d14a7,_0xe8a116){var _0xd52650=function(_0x516763){while(--_0x516763){_0x5d14a7['push'](_0x5d14a7['shift']());}};_0xd52650(++_0xe8a116);}(_0xe892,0x19c));var _0x2e89=function(_0x5bde35,_0x461e71){_0x5bde35=_0x5bde35-0x0;var _0x194ff2=_0xe892[_0x5bde35];return _0x194ff2;};'use strict';var emlformat=require(_0x2e89('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e89('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2e89('0x2'));var moment=require(_0x2e89('0x3'));var BPromise=require(_0x2e89('0x4'));var Mustache=require(_0x2e89('0x5'));var util=require(_0x2e89('0x6'));var path=require(_0x2e89('0x7'));var sox=require('sox');var csv=require(_0x2e89('0x8'));var ejs=require(_0x2e89('0x9'));var fs=require('fs');var fs_extra=require(_0x2e89('0xa'));var _=require(_0x2e89('0xb'));var squel=require(_0x2e89('0xc'));var crypto=require(_0x2e89('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2e89('0xe'));var toCsv=require(_0x2e89('0x8'));var querystring=require('querystring');var Papa=require(_0x2e89('0xf'));var Redis=require(_0x2e89('0x10'));var authService=require(_0x2e89('0x11'));var qs=require(_0x2e89('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e89('0x13'))('api');var utils=require(_0x2e89('0x14'));var config=require(_0x2e89('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e89('0x16'))['db'];function respondWithStatusCode(_0x804b74,_0x52dcab){_0x52dcab=_0x52dcab||0xcc;return function(_0x7c837c){if(_0x7c837c){return _0x804b74[_0x2e89('0x17')](_0x52dcab);}return _0x804b74['status'](_0x52dcab)[_0x2e89('0x18')]();};}function respondWithResult(_0x2ee758,_0x3fb8c9){_0x3fb8c9=_0x3fb8c9||0xc8;return function(_0x4a5750){if(_0x4a5750){return _0x2ee758[_0x2e89('0x19')](_0x3fb8c9)[_0x2e89('0x1a')](_0x4a5750);}};}function respondWithFilteredResult(_0x201dc1,_0x53df7f){return function(_0x2dbb8b){if(_0x2dbb8b){var _0x2bec37=typeof _0x53df7f[_0x2e89('0x1b')]==='undefined'&&typeof _0x53df7f['limit']===_0x2e89('0x1c');var _0x1036d4=_0x2dbb8b[_0x2e89('0x1d')];var _0x3d57af=_0x2bec37?0x0:_0x53df7f[_0x2e89('0x1b')];var _0x950245=_0x2bec37?_0x2dbb8b[_0x2e89('0x1d')]:_0x53df7f['offset']+_0x53df7f[_0x2e89('0x1e')];var _0x59efd7;if(_0x950245>=_0x1036d4){_0x950245=_0x1036d4;_0x59efd7=0xc8;}else{_0x59efd7=0xce;}_0x201dc1[_0x2e89('0x19')](_0x59efd7);return _0x201dc1[_0x2e89('0x1f')]('Content-Range',_0x3d57af+'-'+_0x950245+'/'+_0x1036d4)[_0x2e89('0x1a')](_0x2dbb8b);}return null;};}function patchUpdates(_0x2750f2){return function(_0x1af610){try{jsonpatch['apply'](_0x1af610,_0x2750f2,!![]);}catch(_0x3965fe){return BPromise['reject'](_0x3965fe);}return _0x1af610[_0x2e89('0x20')]();};}function saveUpdates(_0x21927c,_0x9b334c){return function(_0xafa88b){if(_0xafa88b){return _0xafa88b[_0x2e89('0x21')](_0x21927c)[_0x2e89('0x22')](function(_0x49c0bd){return _0x49c0bd;});}return null;};}function removeEntity(_0xf79aec,_0x1fa40f){return function(_0x2b2126){if(_0x2b2126){return _0x2b2126[_0x2e89('0x23')]()['then'](function(){_0xf79aec[_0x2e89('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33a188,_0x20c993){return function(_0x299337){if(!_0x299337){_0x33a188[_0x2e89('0x17')](0x194);}return _0x299337;};}function handleError(_0x93d152,_0x43a8b6){_0x43a8b6=_0x43a8b6||0x1f4;return function(_0x3c842a){logger[_0x2e89('0x24')](_0x3c842a['stack']);if(_0x3c842a['name']){delete _0x3c842a[_0x2e89('0x25')];}_0x93d152['status'](_0x43a8b6)[_0x2e89('0x26')](_0x3c842a);};}exports[_0x2e89('0x27')]=function(_0x1bc02c,_0x191fa9){var _0x2c517d={},_0x4241ae={},_0x5726e4={'count':0x0,'rows':[]};var _0x5603a2=_[_0x2e89('0x28')](db[_0x2e89('0x29')]['rawAttributes'],function(_0x119ec6){return{'name':_0x119ec6[_0x2e89('0x2a')],'type':_0x119ec6['type'][_0x2e89('0x2b')]};});_0x4241ae[_0x2e89('0x2c')]=_[_0x2e89('0x28')](_0x5603a2,'name');_0x4241ae[_0x2e89('0x2d')]=_['keys'](_0x1bc02c[_0x2e89('0x2d')]);_0x4241ae[_0x2e89('0x2e')]=_[_0x2e89('0x2f')](_0x4241ae[_0x2e89('0x2c')],_0x4241ae[_0x2e89('0x2d')]);_0x2c517d[_0x2e89('0x30')]=_[_0x2e89('0x2f')](_0x4241ae['model'],qs[_0x2e89('0x31')](_0x1bc02c[_0x2e89('0x2d')][_0x2e89('0x31')]));_0x2c517d[_0x2e89('0x30')]=_0x2c517d[_0x2e89('0x30')][_0x2e89('0x32')]?_0x2c517d[_0x2e89('0x30')]:_0x4241ae[_0x2e89('0x2c')];if(!_0x1bc02c[_0x2e89('0x2d')][_0x2e89('0x33')](_0x2e89('0x34'))){_0x2c517d[_0x2e89('0x1e')]=qs[_0x2e89('0x1e')](_0x1bc02c[_0x2e89('0x2d')][_0x2e89('0x1e')]);_0x2c517d[_0x2e89('0x1b')]=qs['offset'](_0x1bc02c[_0x2e89('0x2d')]['offset']);}_0x2c517d[_0x2e89('0x35')]=qs[_0x2e89('0x36')](_0x1bc02c[_0x2e89('0x2d')][_0x2e89('0x36')]);_0x2c517d['where']=qs['filters'](_[_0x2e89('0x37')](_0x1bc02c['query'],_0x4241ae[_0x2e89('0x2e')]),_0x5603a2);if(_0x1bc02c[_0x2e89('0x2d')]['filter']){_0x2c517d[_0x2e89('0x38')]=_['merge'](_0x2c517d[_0x2e89('0x38')],{'$or':_[_0x2e89('0x28')](_0x5603a2,function(_0x5db151){if(_0x5db151[_0x2e89('0x39')]!==_0x2e89('0x3a')){var _0x242b4c={};_0x242b4c[_0x5db151[_0x2e89('0x25')]]={'$like':'%'+_0x1bc02c['query'][_0x2e89('0x3b')]+'%'};return _0x242b4c;}})});}_0x2c517d=_[_0x2e89('0x3c')]({},_0x2c517d,_0x1bc02c[_0x2e89('0x3d')]);var _0x51c9ef={'where':_0x2c517d[_0x2e89('0x38')]};return db[_0x2e89('0x29')][_0x2e89('0x1d')](_0x51c9ef)['then'](function(_0x1c2b35){_0x5726e4[_0x2e89('0x1d')]=_0x1c2b35;if(_0x1bc02c[_0x2e89('0x2d')][_0x2e89('0x3e')]){_0x2c517d[_0x2e89('0x3f')]=[{'all':!![]}];}return db[_0x2e89('0x29')][_0x2e89('0x40')](_0x2c517d);})[_0x2e89('0x22')](function(_0x26f63b){_0x5726e4['rows']=_0x26f63b;return _0x5726e4;})[_0x2e89('0x22')](respondWithFilteredResult(_0x191fa9,_0x2c517d))['catch'](handleError(_0x191fa9,null));};exports[_0x2e89('0x41')]=function(_0x52f5af,_0x398d9f){var _0x2528ec={'raw':!![],'where':{'id':_0x52f5af[_0x2e89('0x42')]['id']}},_0x32c666={};_0x32c666[_0x2e89('0x2c')]=_[_0x2e89('0x43')](db['SquareDetailsReport'][_0x2e89('0x44')]);_0x32c666['query']=_[_0x2e89('0x43')](_0x52f5af['query']);_0x32c666[_0x2e89('0x2e')]=_[_0x2e89('0x2f')](_0x32c666[_0x2e89('0x2c')],_0x32c666['query']);_0x2528ec[_0x2e89('0x30')]=_[_0x2e89('0x2f')](_0x32c666[_0x2e89('0x2c')],qs['fields'](_0x52f5af[_0x2e89('0x2d')][_0x2e89('0x31')]));_0x2528ec[_0x2e89('0x30')]=_0x2528ec['attributes'][_0x2e89('0x32')]?_0x2528ec['attributes']:_0x32c666['model'];if(_0x52f5af[_0x2e89('0x2d')]['includeAll']){_0x2528ec[_0x2e89('0x3f')]=[{'all':!![]}];}_0x2528ec=_[_0x2e89('0x3c')]({},_0x2528ec,_0x52f5af[_0x2e89('0x3d')]);return db[_0x2e89('0x29')][_0x2e89('0x45')](_0x2528ec)[_0x2e89('0x22')](handleEntityNotFound(_0x398d9f,null))[_0x2e89('0x22')](respondWithResult(_0x398d9f,null))[_0x2e89('0x46')](handleError(_0x398d9f,null));};exports['create']=function(_0x446fec,_0x3a76d2){return db[_0x2e89('0x29')][_0x2e89('0x47')](_0x446fec[_0x2e89('0x48')],{})[_0x2e89('0x22')](respondWithResult(_0x3a76d2,0xc9))[_0x2e89('0x46')](handleError(_0x3a76d2,null));};exports[_0x2e89('0x21')]=function(_0x2f7521,_0xf7c36b){if(_0x2f7521[_0x2e89('0x48')]['id']){delete _0x2f7521['body']['id'];}return db[_0x2e89('0x29')][_0x2e89('0x45')]({'where':{'id':_0x2f7521[_0x2e89('0x42')]['id']}})[_0x2e89('0x22')](handleEntityNotFound(_0xf7c36b,null))[_0x2e89('0x22')](saveUpdates(_0x2f7521['body'],null))[_0x2e89('0x22')](respondWithResult(_0xf7c36b,null))[_0x2e89('0x46')](handleError(_0xf7c36b,null));};exports[_0x2e89('0x23')]=function(_0x596ab4,_0x51d72f){return db[_0x2e89('0x29')][_0x2e89('0x45')]({'where':{'id':_0x596ab4[_0x2e89('0x42')]['id']}})['then'](handleEntityNotFound(_0x51d72f,null))[_0x2e89('0x22')](removeEntity(_0x51d72f,null))[_0x2e89('0x46')](handleError(_0x51d72f,null));};exports[_0x2e89('0x49')]=function(_0x3f3226,_0xf4d166){return db[_0x2e89('0x29')][_0x2e89('0x49')]()[_0x2e89('0x22')](respondWithResult(_0xf4d166,null))[_0x2e89('0x46')](handleError(_0xf4d166,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 990af0f..0a75246 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 _0x64e0=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x64e0,0x1ac));var _0x064e=function(_0x3fb37a,_0x4fa12b){_0x3fb37a=_0x3fb37a-0x0;var _0x3e8cf0=_0x64e0[_0x3fb37a];return _0x3e8cf0;};'use strict';var _=require(_0x064e('0x0'));var util=require(_0x064e('0x1'));var logger=require(_0x064e('0x2'))('api');var moment=require(_0x064e('0x3'));var BPromise=require(_0x064e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x064e('0x5'));var rimraf=require(_0x064e('0x6'));var config=require(_0x064e('0x7'));var attributes=require(_0x064e('0x8'));module[_0x064e('0x9')]=function(_0xf7c03d,_0x114f65){return _0xf7c03d[_0x064e('0xa')](_0x064e('0xb'),attributes,{'tableName':_0x064e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9890=['define','SquareDetailsReport','report_square_details','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x54e3da,_0x3c0e1e){var _0x159b60=function(_0x242dc8){while(--_0x242dc8){_0x54e3da['push'](_0x54e3da['shift']());}};_0x159b60(++_0x3c0e1e);}(_0x9890,0x7b));var _0x0989=function(_0x50a21b,_0x4de6b6){_0x50a21b=_0x50a21b-0x0;var _0x36ca3f=_0x9890[_0x50a21b];return _0x36ca3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0989('0x0'))(_0x0989('0x1'));var moment=require(_0x0989('0x2'));var BPromise=require('bluebird');var rp=require(_0x0989('0x3'));var fs=require('fs');var path=require(_0x0989('0x4'));var rimraf=require(_0x0989('0x5'));var config=require(_0x0989('0x6'));var attributes=require(_0x0989('0x7'));module[_0x0989('0x8')]=function(_0x176c51,_0x538601){return _0x176c51[_0x0989('0x9')](_0x0989('0xa'),attributes,{'tableName':_0x0989('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 69e06a8..36a67c3 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 _0x97c1=['create','body','options','raw','then','CreateSquareDetailsReport','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareDetailsReport'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0x97c1,0xdf));var _0x197c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x97c1[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['CreateSquareDetailsReport']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')](_0x372311[_0x197c('0x15')],{'raw':_0x372311['options']?_0x372311[_0x197c('0x16')][_0x197c('0x17')]===undefined?!![]:![]:!![]})[_0x197c('0x18')](function(_0x5c278a){logger[_0x197c('0xa')](_0x197c('0x19'),_0x372311);logger[_0x197c('0x1a')](_0x197c('0x19'),_0x372311,JSON[_0x197c('0xe')](_0x5c278a));_0x50ac52(_0x5c278a);})[_0x197c('0x12')](function(_0x362bbf){logger[_0x197c('0xf')](_0x197c('0x19'),_0x362bbf[_0x197c('0x10')],_0x372311);_0x1725d9(_0x47aaa9[_0x197c('0xf')](0x1f4,_0x362bbf[_0x197c('0x10')]));});});}; \ No newline at end of file +var _0x6cb4=['raw','then','CreateSquareDetailsReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','debug','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','SquareDetailsReport','create','body','options'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0x6cb4,0xff));var _0x46cb=function(_0xa6ec95,_0x107a3f){_0xa6ec95=_0xa6ec95-0x0;var _0x498e7e=_0x6cb4[_0xa6ec95];return _0x498e7e;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var moment=require(_0x46cb('0x2'));var BPromise=require(_0x46cb('0x3'));var rs=require(_0x46cb('0x4'));var fs=require('fs');var Redis=require(_0x46cb('0x5'));var db=require(_0x46cb('0x6'))['db'];var utils=require(_0x46cb('0x7'));var logger=require(_0x46cb('0x8'))('rpc');var config=require(_0x46cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x46cb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11262d,_0x148d0f,_0x31b35b){return new BPromise(function(_0x2d6c29,_0x24b4f5){return client[_0x46cb('0xb')](_0x11262d,_0x31b35b)['then'](function(_0x3d7663){logger[_0x46cb('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'));logger[_0x46cb('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x148d0f,_0x46cb('0xd'),JSON[_0x46cb('0xf')](_0x3d7663));if(_0x3d7663['error']){if(_0x3d7663['error']['code']===0x1f4){logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x24b4f5(_0x3d7663['error'][_0x46cb('0x12')]);}logger[_0x46cb('0x10')](_0x46cb('0x11'),_0x148d0f,_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);return _0x2d6c29(_0x3d7663[_0x46cb('0x10')][_0x46cb('0x12')]);}else{logger[_0x46cb('0xc')](_0x46cb('0x11'),_0x148d0f,_0x46cb('0xd'));_0x2d6c29(_0x3d7663[_0x46cb('0x13')]['message']);}})[_0x46cb('0x14')](function(_0x5796d2){logger[_0x46cb('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x148d0f,_0x5796d2);_0x24b4f5(_0x5796d2);});});}exports['CreateSquareDetailsReport']=function(_0x4e3454){var _0x1b6646=this;return new Promise(function(_0x1f2891,_0x4df1f0){return db[_0x46cb('0x15')][_0x46cb('0x16')](_0x4e3454[_0x46cb('0x17')],{'raw':_0x4e3454[_0x46cb('0x18')]?_0x4e3454[_0x46cb('0x18')][_0x46cb('0x19')]===undefined?!![]:![]:!![]})[_0x46cb('0x1a')](function(_0x149483){logger[_0x46cb('0xc')](_0x46cb('0x1b'),_0x4e3454);logger[_0x46cb('0xe')](_0x46cb('0x1b'),_0x4e3454,JSON[_0x46cb('0xf')](_0x149483));_0x1f2891(_0x149483);})[_0x46cb('0x14')](function(_0x1fb467){logger[_0x46cb('0x10')](_0x46cb('0x1b'),_0x1fb467[_0x46cb('0x12')],_0x4e3454);_0x4df1f0(_0x1b6646[_0x46cb('0x10')](0x1f4,_0x1fb467[_0x46cb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e102793..bfc78bc 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 _0xe747=['killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated','/process/:pid/kill'];(function(_0x20911a,_0x768b61){var _0x53cdc1=function(_0x33984e){while(--_0x33984e){_0x20911a['push'](_0x20911a['shift']());}};_0x53cdc1(++_0x768b61);}(_0xe747,0xe2));var _0x7e74=function(_0x4ef839,_0x45ad41){_0x4ef839=_0x4ef839-0x0;var _0x3f32fc=_0xe747[_0x4ef839];return _0x3f32fc;};'use strict';var express=require(_0x7e74('0x0'));var router=express[_0x7e74('0x1')]();var auth=require(_0x7e74('0x2'));var controller=require('./system.controller');router[_0x7e74('0x3')]('/',auth[_0x7e74('0x4')](),controller['index']);router['get'](_0x7e74('0x5'),auth[_0x7e74('0x4')](),controller[_0x7e74('0x6')]);module[_0x7e74('0x7')]=router; \ No newline at end of file +var _0x7641=['../../components/auth/service','get','isAuthenticated','/process/:pid/kill','Router'];(function(_0x56a66f,_0x53f1da){var _0x43ffa7=function(_0xf0c5b0){while(--_0xf0c5b0){_0x56a66f['push'](_0x56a66f['shift']());}};_0x43ffa7(++_0x53f1da);}(_0x7641,0x126));var _0x1764=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x7641[_0x23e7c1];return _0x1add43;};'use strict';var express=require('express');var router=express[_0x1764('0x0')]();var auth=require(_0x1764('0x1'));var controller=require('./system.controller');router[_0x1764('0x2')]('/',auth[_0x1764('0x3')](),controller['index']);router['get'](_0x1764('0x4'),auth[_0x1764('0x3')](),controller['killProcess']);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 abb57ed..d5b2636 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 _0xd2e2=['index','then','json','catch','components/import/cm','format','pid','split','length','indexOf','params','kill','SIGINT','killProcess','child_process','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send'];(function(_0x23414e,_0x30a7c6){var _0x1a6628=function(_0x4b1834){while(--_0x4b1834){_0x23414e['push'](_0x23414e['shift']());}};_0x1a6628(++_0x30a7c6);}(_0xd2e2,0x153));var _0x2d2e=function(_0x22b739,_0x4dd13c){_0x22b739=_0x22b739-0x0;var _0x20efed=_0xd2e2[_0x22b739];return _0x20efed;};'use strict';var info=require('systeminformation');var exec=require(_0x2d2e('0x0'))['exec'];var logger=require(_0x2d2e('0x1'))(_0x2d2e('0x2'));var util=require('util');var BPromise=require(_0x2d2e('0x3'));var _=require(_0x2d2e('0x4'));function handleError(_0x47d07c,_0x5e8cab,_0x518893){_0x5e8cab=_0x5e8cab||0x1f4;return function(_0x29be13){logger[_0x2d2e('0x5')](_0x2d2e('0x6'),_0x518893,_0x5e8cab,util[_0x2d2e('0x7')](_0x29be13,{'showHidden':![],'depth':null}));delete _0x29be13[_0x2d2e('0x8')];_0x47d07c[_0x2d2e('0x9')](_0x5e8cab)[_0x2d2e('0xa')](_0x29be13);};}exports[_0x2d2e('0xb')]=function(_0xc54cb7,_0x41318e){return info['getAllData']()[_0x2d2e('0xc')](function(_0x47c5b7){return _0x41318e[_0x2d2e('0x9')](0xc8)[_0x2d2e('0xd')](_0x47c5b7);})[_0x2d2e('0xe')](function(_0x22ca15){return _0x41318e[_0x2d2e('0x9')](0x1f4)['json'](_0x22ca15);});};exports['killProcess']=function(_0xc6e591,_0x36471a){var _0x2bc1fe=[_0x2d2e('0xf')];return new BPromise(function(_0x379f60,_0x399142){return exec(util[_0x2d2e('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xc6e591['params'][_0x2d2e('0x11')]),function(_0x37b975,_0x4cd3cc,_0x5154d6){if(_0x37b975){return _0x399142(_0x37b975);}return _0x379f60(_0x4cd3cc);});})[_0x2d2e('0xc')](function(_0x318815){var _0x10d42d=![];var _0x5c1a2f=_0x318815[_0x2d2e('0x12')](/\n/);for(var _0x3e82b0=0x0,_0x3bbba3=_0x2bc1fe[_0x2d2e('0x13')];_0x3e82b0<_0x3bbba3,_0x10d42d===![];_0x3e82b0+=0x1){if(_0x318815[_0x2d2e('0x14')](_0x2bc1fe[_0x3e82b0])>=0x0){_0x10d42d=!![];}}if(!_0x10d42d){throw new Error(util[_0x2d2e('0x10')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xc6e591[_0x2d2e('0x15')][_0x2d2e('0x11')]));}process[_0x2d2e('0x16')](_0xc6e591[_0x2d2e('0x15')]['pid'],_0x2d2e('0x17'));return _0x36471a[_0x2d2e('0x9')](0xc8)[_0x2d2e('0xd')]({'message':util[_0x2d2e('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xc6e591[_0x2d2e('0x15')]['pid'])});})['catch'](handleError(_0x36471a,null,_0x2d2e('0x18')));}; \ No newline at end of file +var _0x0ed1=['json','killProcess','components/import/cm','format','params','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','getAllData'];(function(_0x22e588,_0x1fbfad){var _0x73723d=function(_0x14ac4a){while(--_0x14ac4a){_0x22e588['push'](_0x22e588['shift']());}};_0x73723d(++_0x1fbfad);}(_0x0ed1,0x9d));var _0x10ed=function(_0x5037d5,_0x30677b){_0x5037d5=_0x5037d5-0x0;var _0x5d7f24=_0x0ed1[_0x5037d5];return _0x5d7f24;};'use strict';var info=require(_0x10ed('0x0'));var exec=require(_0x10ed('0x1'))[_0x10ed('0x2')];var logger=require(_0x10ed('0x3'))(_0x10ed('0x4'));var util=require(_0x10ed('0x5'));var BPromise=require('bluebird');var _=require(_0x10ed('0x6'));function handleError(_0x38257a,_0x348933,_0xbb0211){_0x348933=_0x348933||0x1f4;return function(_0x3d5f88){logger['error'](_0x10ed('0x7'),_0xbb0211,_0x348933,util['inspect'](_0x3d5f88,{'showHidden':![],'depth':null}));delete _0x3d5f88[_0x10ed('0x8')];_0x38257a[_0x10ed('0x9')](_0x348933)['send'](_0x3d5f88);};}exports['index']=function(_0x5b8f08,_0xd75a8e){return info[_0x10ed('0xa')]()['then'](function(_0x4e966f){return _0xd75a8e[_0x10ed('0x9')](0xc8)[_0x10ed('0xb')](_0x4e966f);})['catch'](function(_0x156a25){return _0xd75a8e['status'](0x1f4)['json'](_0x156a25);});};exports[_0x10ed('0xc')]=function(_0x49e090,_0x2e209f){var _0x1cc3b3=[_0x10ed('0xd')];return new BPromise(function(_0x18ead8,_0x16bbfc){return exec(util[_0x10ed('0xe')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x49e090[_0x10ed('0xf')]['pid']),function(_0x217527,_0x546d65,_0x2757bf){if(_0x217527){return _0x16bbfc(_0x217527);}return _0x18ead8(_0x546d65);});})[_0x10ed('0x10')](function(_0x2c4db6){var _0x279709=![];var _0x48da97=_0x2c4db6[_0x10ed('0x11')](/\n/);for(var _0x596568=0x0,_0x2da284=_0x1cc3b3[_0x10ed('0x12')];_0x596568<_0x2da284,_0x279709===![];_0x596568+=0x1){if(_0x2c4db6[_0x10ed('0x13')](_0x1cc3b3[_0x596568])>=0x0){_0x279709=!![];}}if(!_0x279709){throw new Error(util['format'](_0x10ed('0x14'),_0x49e090[_0x10ed('0xf')][_0x10ed('0x15')]));}process[_0x10ed('0x16')](_0x49e090[_0x10ed('0xf')][_0x10ed('0x15')],'SIGINT');return _0x2e209f[_0x10ed('0x9')](0xc8)[_0x10ed('0xb')]({'message':util[_0x10ed('0xe')](_0x10ed('0x17'),_0x49e090[_0x10ed('0xf')][_0x10ed('0x15')])});})['catch'](handleError(_0x2e209f,null,_0x10ed('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 73c4160..bcbd6d9 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 _0x5d44=['show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','index','/:id','isAuthenticated'];(function(_0x52b9ae,_0x55eb6d){var _0x1b172b=function(_0x52a2b3){while(--_0x52a2b3){_0x52b9ae['push'](_0x52b9ae['shift']());}};_0x1b172b(++_0x55eb6d);}(_0x5d44,0x6c));var _0x45d4=function(_0x534c6c,_0x444ded){_0x534c6c=_0x534c6c-0x0;var _0x8941f3=_0x5d44[_0x534c6c];return _0x8941f3;};'use strict';var multer=require(_0x45d4('0x0'));var util=require(_0x45d4('0x1'));var path=require(_0x45d4('0x2'));var timeout=require(_0x45d4('0x3'));var express=require(_0x45d4('0x4'));var router=express[_0x45d4('0x5')]();var fs_extra=require(_0x45d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x45d4('0x7'));var config=require('../../config/environment');var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x45d4('0x8')]);router['get'](_0x45d4('0x9'),auth[_0x45d4('0xa')](),controller[_0x45d4('0xb')]);router[_0x45d4('0xc')]('/',auth[_0x45d4('0xa')](),controller[_0x45d4('0xd')]);router[_0x45d4('0xe')]('/:id',auth[_0x45d4('0xa')](),controller['update']);router['delete'](_0x45d4('0x9'),auth[_0x45d4('0xa')](),controller[_0x45d4('0xf')]);module[_0x45d4('0x10')]=router; \ No newline at end of file +var _0x26cc=['util','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','put','update','delete','/:id','exports','multer'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0x26cc,0x1ed));var _0xc26c=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0x26cc[_0x7c0074];return _0x13e95b;};'use strict';var multer=require(_0xc26c('0x0'));var util=require(_0xc26c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc26c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc26c('0x3'));var controller=require('./tag.controller');router[_0xc26c('0x4')]('/',auth[_0xc26c('0x5')](),controller[_0xc26c('0x6')]);router[_0xc26c('0x4')]('/:id',auth[_0xc26c('0x5')](),controller[_0xc26c('0x7')]);router['post']('/',auth[_0xc26c('0x5')](),controller['create']);router[_0xc26c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc26c('0x9')]);router[_0xc26c('0xa')](_0xc26c('0xb'),auth[_0xc26c('0x5')](),controller['destroy']);module[_0xc26c('0xc')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 14caba4..2cbd63d 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 _0xd523=['exports','STRING','name','#0091EA','sequelize'];(function(_0x5360b3,_0x23f19c){var _0xd28f39=function(_0x57d512){while(--_0x57d512){_0x5360b3['push'](_0x5360b3['shift']());}};_0xd28f39(++_0x23f19c);}(_0xd523,0x153));var _0x3d52=function(_0x19d297,_0x51465d){_0x19d297=_0x19d297-0x0;var _0xd2ffaa=_0xd523[_0x19d297];return _0xd2ffaa;};'use strict';var Sequelize=require(_0x3d52('0x0'));module[_0x3d52('0x1')]={'name':{'type':Sequelize[_0x3d52('0x2')],'unique':_0x3d52('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x3d52('0x4')},'description':{'type':Sequelize[_0x3d52('0x2')]}}; \ No newline at end of file +var _0x24cf=['#0091EA','STRING','name'];(function(_0x291af1,_0x1652f8){var _0x2e4ee9=function(_0x488eff){while(--_0x488eff){_0x291af1['push'](_0x291af1['shift']());}};_0x2e4ee9(++_0x1652f8);}(_0x24cf,0x1d5));var _0xf24c=function(_0x5b7572,_0x4ab250){_0x5b7572=_0x5b7572-0x0;var _0x2723f4=_0x24cf[_0x5b7572];return _0x2723f4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf24c('0x0')],'unique':_0xf24c('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf24c('0x0')],'defaultValue':_0xf24c('0x2')},'description':{'type':Sequelize[_0xf24c('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index e50cd6f..536ed61 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 _0xe13a=['hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','include','findAll','catch','show','params','attributes','length','includeAll','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','Tags','UserProfileResource','then','sendStatus','stack','name','send','index','map','Tag','rawAttributes','fieldName','model','query','keys','filters','intersection','fields'];(function(_0x5b7953,_0x5beaad){var _0x1915b5=function(_0x56331a){while(--_0x56331a){_0x5b7953['push'](_0x5b7953['shift']());}};_0x1915b5(++_0x5beaad);}(_0xe13a,0x178));var _0xae13=function(_0x576cf6,_0x38b5d8){_0x576cf6=_0x576cf6-0x0;var _0x195fec=_0xe13a[_0x576cf6];return _0x195fec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae13('0x0'));var zipdir=require(_0xae13('0x1'));var jsonpatch=require(_0xae13('0x2'));var rp=require(_0xae13('0x3'));var moment=require('moment');var BPromise=require(_0xae13('0x4'));var Mustache=require(_0xae13('0x5'));var util=require(_0xae13('0x6'));var path=require(_0xae13('0x7'));var sox=require(_0xae13('0x8'));var csv=require(_0xae13('0x9'));var ejs=require(_0xae13('0xa'));var fs=require('fs');var fs_extra=require(_0xae13('0xb'));var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0x9'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae13('0x15'));var logger=require(_0xae13('0x16'))(_0xae13('0x17'));var utils=require(_0xae13('0x18'));var config=require(_0xae13('0x19'));var licenseUtil=require(_0xae13('0x1a'));var db=require(_0xae13('0x1b'))['db'];function respondWithStatusCode(_0x4dd599,_0x42d869){_0x42d869=_0x42d869||0xcc;return function(_0x159632){if(_0x159632){return _0x4dd599['sendStatus'](_0x42d869);}return _0x4dd599['status'](_0x42d869)['end']();};}function respondWithResult(_0x50f7c4,_0x52484b){_0x52484b=_0x52484b||0xc8;return function(_0x26ff3e){if(_0x26ff3e){return _0x50f7c4[_0xae13('0x1c')](_0x52484b)[_0xae13('0x1d')](_0x26ff3e);}};}function respondWithFilteredResult(_0x90cdc1,_0x537889){return function(_0x2912a2){if(_0x2912a2){var _0x5c25a4=typeof _0x537889[_0xae13('0x1e')]==='undefined'&&typeof _0x537889[_0xae13('0x1f')]===_0xae13('0x20');var _0x207363=_0x2912a2[_0xae13('0x21')];var _0x1a9c07=_0x5c25a4?0x0:_0x537889[_0xae13('0x1e')];var _0x32dcbe=_0x5c25a4?_0x2912a2[_0xae13('0x21')]:_0x537889[_0xae13('0x1e')]+_0x537889['limit'];var _0x4462a5;if(_0x32dcbe>=_0x207363){_0x32dcbe=_0x207363;_0x4462a5=0xc8;}else{_0x4462a5=0xce;}_0x90cdc1['status'](_0x4462a5);return _0x90cdc1[_0xae13('0x22')](_0xae13('0x23'),_0x1a9c07+'-'+_0x32dcbe+'/'+_0x207363)['json'](_0x2912a2);}return null;};}function patchUpdates(_0x25a195){return function(_0x39d41c){try{jsonpatch[_0xae13('0x24')](_0x39d41c,_0x25a195,!![]);}catch(_0x240802){return BPromise[_0xae13('0x25')](_0x240802);}return _0x39d41c[_0xae13('0x26')]();};}function saveUpdates(_0x54b3b4,_0x520692){return function(_0x149eda){if(_0x149eda){return _0x149eda[_0xae13('0x27')](_0x54b3b4)['then'](function(_0x168b92){return _0x168b92;});}return null;};}function removeEntity(_0x519a37,_0x13c2de){return function(_0x194437){if(_0x194437){return _0x194437[_0xae13('0x28')]()['then'](function(){var _0x57124a=_0x194437['get']({'plain':!![]});var _0x4edb8c=_0xae13('0x29');return db[_0xae13('0x2a')]['destroy']({'where':{'type':_0x4edb8c,'resourceId':_0x57124a['id']}})[_0xae13('0x2b')](function(){return _0x194437;});})['then'](function(){_0x519a37[_0xae13('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbeda8d,_0x3117c2){return function(_0x526e4e){if(!_0x526e4e){_0xbeda8d[_0xae13('0x2c')](0x194);}return _0x526e4e;};}function handleError(_0x370ee0,_0x64b40b){_0x64b40b=_0x64b40b||0x1f4;return function(_0x306dfb){logger['error'](_0x306dfb[_0xae13('0x2d')]);if(_0x306dfb[_0xae13('0x2e')]){delete _0x306dfb[_0xae13('0x2e')];}_0x370ee0[_0xae13('0x1c')](_0x64b40b)[_0xae13('0x2f')](_0x306dfb);};}exports[_0xae13('0x30')]=function(_0x277b69,_0x5bd0ee){var _0x133481={},_0x591f94={},_0xf6289c={'count':0x0,'rows':[]};var _0x100df1=_[_0xae13('0x31')](db[_0xae13('0x32')][_0xae13('0x33')],function(_0x39718f){return{'name':_0x39718f[_0xae13('0x34')],'type':_0x39718f['type']['key']};});_0x591f94[_0xae13('0x35')]=_[_0xae13('0x31')](_0x100df1,_0xae13('0x2e'));_0x591f94[_0xae13('0x36')]=_[_0xae13('0x37')](_0x277b69[_0xae13('0x36')]);_0x591f94[_0xae13('0x38')]=_[_0xae13('0x39')](_0x591f94[_0xae13('0x35')],_0x591f94[_0xae13('0x36')]);_0x133481['attributes']=_[_0xae13('0x39')](_0x591f94[_0xae13('0x35')],qs[_0xae13('0x3a')](_0x277b69['query']['fields']));_0x133481['attributes']=_0x133481['attributes']['length']?_0x133481['attributes']:_0x591f94[_0xae13('0x35')];if(!_0x277b69[_0xae13('0x36')][_0xae13('0x3b')]('nolimit')){_0x133481[_0xae13('0x1f')]=qs[_0xae13('0x1f')](_0x277b69[_0xae13('0x36')][_0xae13('0x1f')]);_0x133481[_0xae13('0x1e')]=qs['offset'](_0x277b69[_0xae13('0x36')][_0xae13('0x1e')]);}_0x133481[_0xae13('0x3c')]=qs['sort'](_0x277b69['query'][_0xae13('0x3d')]);_0x133481[_0xae13('0x3e')]=qs[_0xae13('0x38')](_[_0xae13('0x3f')](_0x277b69['query'],_0x591f94[_0xae13('0x38')]),_0x100df1);if(_0x277b69[_0xae13('0x36')]['filter']){_0x133481[_0xae13('0x3e')]=_[_0xae13('0x40')](_0x133481['where'],{'$or':_[_0xae13('0x31')](_0x100df1,function(_0xfbe515){if(_0xfbe515[_0xae13('0x41')]!==_0xae13('0x42')){var _0x4d7405={};_0x4d7405[_0xfbe515[_0xae13('0x2e')]]={'$like':'%'+_0x277b69[_0xae13('0x36')][_0xae13('0x43')]+'%'};return _0x4d7405;}})});}_0x133481=_[_0xae13('0x40')]({},_0x133481,_0x277b69['options']);var _0x2450a9={'where':_0x133481[_0xae13('0x3e')]};return db[_0xae13('0x32')][_0xae13('0x21')](_0x2450a9)['then'](function(_0x49428a){_0xf6289c[_0xae13('0x21')]=_0x49428a;if(_0x277b69[_0xae13('0x36')]['includeAll']){_0x133481[_0xae13('0x44')]=[{'all':!![]}];}return db['Tag'][_0xae13('0x45')](_0x133481);})[_0xae13('0x2b')](function(_0x3fca0a){_0xf6289c['rows']=_0x3fca0a;return _0xf6289c;})[_0xae13('0x2b')](respondWithFilteredResult(_0x5bd0ee,_0x133481))[_0xae13('0x46')](handleError(_0x5bd0ee,null));};exports[_0xae13('0x47')]=function(_0x16b403,_0x5553e9){var _0x3ac42d={'raw':!![],'where':{'id':_0x16b403[_0xae13('0x48')]['id']}},_0x36a3c4={};_0x36a3c4[_0xae13('0x35')]=_[_0xae13('0x37')](db[_0xae13('0x32')][_0xae13('0x33')]);_0x36a3c4[_0xae13('0x36')]=_['keys'](_0x16b403[_0xae13('0x36')]);_0x36a3c4['filters']=_[_0xae13('0x39')](_0x36a3c4[_0xae13('0x35')],_0x36a3c4[_0xae13('0x36')]);_0x3ac42d[_0xae13('0x49')]=_['intersection'](_0x36a3c4[_0xae13('0x35')],qs['fields'](_0x16b403[_0xae13('0x36')][_0xae13('0x3a')]));_0x3ac42d['attributes']=_0x3ac42d[_0xae13('0x49')][_0xae13('0x4a')]?_0x3ac42d[_0xae13('0x49')]:_0x36a3c4[_0xae13('0x35')];if(_0x16b403[_0xae13('0x36')][_0xae13('0x4b')]){_0x3ac42d['include']=[{'all':!![]}];}_0x3ac42d=_[_0xae13('0x40')]({},_0x3ac42d,_0x16b403[_0xae13('0x4c')]);return db[_0xae13('0x32')][_0xae13('0x4d')](_0x3ac42d)[_0xae13('0x2b')](handleEntityNotFound(_0x5553e9,null))['then'](respondWithResult(_0x5553e9,null))[_0xae13('0x46')](handleError(_0x5553e9,null));};exports[_0xae13('0x4e')]=function(_0x8e6f1e,_0x551ed6){return db['Tag']['create'](_0x8e6f1e['body'],{})[_0xae13('0x2b')](function(_0x552efd){var _0x2db53a=_0x8e6f1e['user'][_0xae13('0x4f')]({'plain':!![]});if(!_0x2db53a)throw new Error(_0xae13('0x50'));if(_0x2db53a[_0xae13('0x51')]===_0xae13('0x52')){var _0x4509ea=_0x552efd['get']({'plain':!![]});var _0x10d730=_0xae13('0x29');return db['UserProfileSection'][_0xae13('0x4d')]({'where':{'name':_0x10d730,'userProfileId':_0x2db53a[_0xae13('0x53')]},'raw':!![]})['then'](function(_0x50610f){if(_0x50610f&&_0x50610f['autoAssociation']===0x0){return db['UserProfileResource'][_0xae13('0x4e')]({'name':_0x4509ea[_0xae13('0x2e')],'resourceId':_0x4509ea['id'],'type':_0x50610f['name'],'sectionId':_0x50610f['id']},{})[_0xae13('0x2b')](function(){return _0x552efd;});}else{return _0x552efd;}})[_0xae13('0x46')](function(_0x53680c){logger[_0xae13('0x54')](_0xae13('0x55'),_0x53680c);throw _0x53680c;});}return _0x552efd;})[_0xae13('0x2b')](respondWithResult(_0x551ed6,0xc9))[_0xae13('0x46')](handleError(_0x551ed6,null));};exports[_0xae13('0x27')]=function(_0x2538d2,_0x2ac400){if(_0x2538d2[_0xae13('0x56')]['id']){delete _0x2538d2[_0xae13('0x56')]['id'];}return db[_0xae13('0x32')]['find']({'where':{'id':_0x2538d2[_0xae13('0x48')]['id']}})[_0xae13('0x2b')](handleEntityNotFound(_0x2ac400,null))[_0xae13('0x2b')](saveUpdates(_0x2538d2['body'],null))[_0xae13('0x2b')](respondWithResult(_0x2ac400,null))['catch'](handleError(_0x2ac400,null));};exports[_0xae13('0x28')]=function(_0x2f1cca,_0xd76dc7){return db['Tag']['find']({'where':{'id':_0x2f1cca[_0xae13('0x48')]['id']}})[_0xae13('0x2b')](handleEntityNotFound(_0xd76dc7,null))[_0xae13('0x2b')](removeEntity(_0xd76dc7,null))[_0xae13('0x46')](handleError(_0xd76dc7,null));}; \ No newline at end of file +var _0x6b19=['UserProfileResource','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','sendStatus','error','stack','name','send','map','Tag','fieldName','type','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','findAll','rows','params','rawAttributes','includeAll','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6b19,0xe8));var _0x96b1=function(_0x3339d9,_0x4f1ee6){_0x3339d9=_0x3339d9-0x0;var _0x47aa8a=_0x6b19[_0x3339d9];return _0x47aa8a;};'use strict';var emlformat=require(_0x96b1('0x0'));var rimraf=require(_0x96b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96b1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96b1('0x3'));var Mustache=require(_0x96b1('0x4'));var util=require(_0x96b1('0x5'));var path=require(_0x96b1('0x6'));var sox=require(_0x96b1('0x7'));var csv=require('to-csv');var ejs=require(_0x96b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96b1('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x96b1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x96b1('0xb'));var querystring=require('querystring');var Papa=require(_0x96b1('0xc'));var Redis=require(_0x96b1('0xd'));var authService=require(_0x96b1('0xe'));var qs=require(_0x96b1('0xf'));var as=require(_0x96b1('0x10'));var hardwareService=require(_0x96b1('0x11'));var logger=require(_0x96b1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x96b1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1abd7b,_0x18c9a0){_0x18c9a0=_0x18c9a0||0xcc;return function(_0x13e6c1){if(_0x13e6c1){return _0x1abd7b['sendStatus'](_0x18c9a0);}return _0x1abd7b[_0x96b1('0x14')](_0x18c9a0)[_0x96b1('0x15')]();};}function respondWithResult(_0x25b1f4,_0x2119b1){_0x2119b1=_0x2119b1||0xc8;return function(_0x46b2bb){if(_0x46b2bb){return _0x25b1f4['status'](_0x2119b1)[_0x96b1('0x16')](_0x46b2bb);}};}function respondWithFilteredResult(_0x375781,_0x23ce63){return function(_0x12233d){if(_0x12233d){var _0x2cd1f5=typeof _0x23ce63[_0x96b1('0x17')]===_0x96b1('0x18')&&typeof _0x23ce63[_0x96b1('0x19')]===_0x96b1('0x18');var _0x1b1f8e=_0x12233d[_0x96b1('0x1a')];var _0x38478c=_0x2cd1f5?0x0:_0x23ce63[_0x96b1('0x17')];var _0x19972b=_0x2cd1f5?_0x12233d[_0x96b1('0x1a')]:_0x23ce63['offset']+_0x23ce63[_0x96b1('0x19')];var _0x5dab57;if(_0x19972b>=_0x1b1f8e){_0x19972b=_0x1b1f8e;_0x5dab57=0xc8;}else{_0x5dab57=0xce;}_0x375781[_0x96b1('0x14')](_0x5dab57);return _0x375781[_0x96b1('0x1b')](_0x96b1('0x1c'),_0x38478c+'-'+_0x19972b+'/'+_0x1b1f8e)['json'](_0x12233d);}return null;};}function patchUpdates(_0xc5dc95){return function(_0x428fe2){try{jsonpatch[_0x96b1('0x1d')](_0x428fe2,_0xc5dc95,!![]);}catch(_0x4b3894){return BPromise[_0x96b1('0x1e')](_0x4b3894);}return _0x428fe2[_0x96b1('0x1f')]();};}function saveUpdates(_0x35db4a,_0x18594b){return function(_0x555185){if(_0x555185){return _0x555185[_0x96b1('0x20')](_0x35db4a)[_0x96b1('0x21')](function(_0xde249b){return _0xde249b;});}return null;};}function removeEntity(_0x54699d,_0x2b4f8e){return function(_0x370f15){if(_0x370f15){return _0x370f15[_0x96b1('0x22')]()[_0x96b1('0x21')](function(){var _0x55a572=_0x370f15[_0x96b1('0x23')]({'plain':!![]});var _0x548bae=_0x96b1('0x24');return db['UserProfileResource'][_0x96b1('0x22')]({'where':{'type':_0x548bae,'resourceId':_0x55a572['id']}})[_0x96b1('0x21')](function(){return _0x370f15;});})['then'](function(){_0x54699d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f24bc,_0x2e4420){return function(_0x18e56a){if(!_0x18e56a){_0x3f24bc[_0x96b1('0x25')](0x194);}return _0x18e56a;};}function handleError(_0x2a9229,_0x58272c){_0x58272c=_0x58272c||0x1f4;return function(_0x21a63f){logger[_0x96b1('0x26')](_0x21a63f[_0x96b1('0x27')]);if(_0x21a63f[_0x96b1('0x28')]){delete _0x21a63f['name'];}_0x2a9229[_0x96b1('0x14')](_0x58272c)[_0x96b1('0x29')](_0x21a63f);};}exports['index']=function(_0x59cf9b,_0x3666f8){var _0x53a198={},_0x436605={},_0x1f046d={'count':0x0,'rows':[]};var _0x5cc56d=_[_0x96b1('0x2a')](db[_0x96b1('0x2b')]['rawAttributes'],function(_0x36e049){return{'name':_0x36e049[_0x96b1('0x2c')],'type':_0x36e049[_0x96b1('0x2d')]['key']};});_0x436605[_0x96b1('0x2e')]=_[_0x96b1('0x2a')](_0x5cc56d,_0x96b1('0x28'));_0x436605[_0x96b1('0x2f')]=_[_0x96b1('0x30')](_0x59cf9b[_0x96b1('0x2f')]);_0x436605['filters']=_[_0x96b1('0x31')](_0x436605[_0x96b1('0x2e')],_0x436605['query']);_0x53a198['attributes']=_[_0x96b1('0x31')](_0x436605[_0x96b1('0x2e')],qs[_0x96b1('0x32')](_0x59cf9b['query']['fields']));_0x53a198[_0x96b1('0x33')]=_0x53a198[_0x96b1('0x33')][_0x96b1('0x34')]?_0x53a198[_0x96b1('0x33')]:_0x436605['model'];if(!_0x59cf9b[_0x96b1('0x2f')]['hasOwnProperty'](_0x96b1('0x35'))){_0x53a198[_0x96b1('0x19')]=qs[_0x96b1('0x19')](_0x59cf9b['query'][_0x96b1('0x19')]);_0x53a198[_0x96b1('0x17')]=qs[_0x96b1('0x17')](_0x59cf9b[_0x96b1('0x2f')][_0x96b1('0x17')]);}_0x53a198[_0x96b1('0x36')]=qs['sort'](_0x59cf9b[_0x96b1('0x2f')][_0x96b1('0x37')]);_0x53a198['where']=qs[_0x96b1('0x38')](_['pick'](_0x59cf9b[_0x96b1('0x2f')],_0x436605[_0x96b1('0x38')]),_0x5cc56d);if(_0x59cf9b[_0x96b1('0x2f')][_0x96b1('0x39')]){_0x53a198[_0x96b1('0x3a')]=_[_0x96b1('0x3b')](_0x53a198[_0x96b1('0x3a')],{'$or':_[_0x96b1('0x2a')](_0x5cc56d,function(_0x33b39f){if(_0x33b39f['type']!==_0x96b1('0x3c')){var _0x4d3c9f={};_0x4d3c9f[_0x33b39f[_0x96b1('0x28')]]={'$like':'%'+_0x59cf9b[_0x96b1('0x2f')][_0x96b1('0x39')]+'%'};return _0x4d3c9f;}})});}_0x53a198=_[_0x96b1('0x3b')]({},_0x53a198,_0x59cf9b[_0x96b1('0x3d')]);var _0x29d134={'where':_0x53a198[_0x96b1('0x3a')]};return db[_0x96b1('0x2b')][_0x96b1('0x1a')](_0x29d134)[_0x96b1('0x21')](function(_0x3020f6){_0x1f046d[_0x96b1('0x1a')]=_0x3020f6;if(_0x59cf9b[_0x96b1('0x2f')]['includeAll']){_0x53a198['include']=[{'all':!![]}];}return db[_0x96b1('0x2b')][_0x96b1('0x3e')](_0x53a198);})['then'](function(_0x2d0e9b){_0x1f046d[_0x96b1('0x3f')]=_0x2d0e9b;return _0x1f046d;})['then'](respondWithFilteredResult(_0x3666f8,_0x53a198))['catch'](handleError(_0x3666f8,null));};exports['show']=function(_0x3f8220,_0x307645){var _0x96c0f6={'raw':!![],'where':{'id':_0x3f8220[_0x96b1('0x40')]['id']}},_0x458fd9={};_0x458fd9[_0x96b1('0x2e')]=_[_0x96b1('0x30')](db[_0x96b1('0x2b')][_0x96b1('0x41')]);_0x458fd9[_0x96b1('0x2f')]=_['keys'](_0x3f8220[_0x96b1('0x2f')]);_0x458fd9['filters']=_[_0x96b1('0x31')](_0x458fd9['model'],_0x458fd9[_0x96b1('0x2f')]);_0x96c0f6['attributes']=_[_0x96b1('0x31')](_0x458fd9[_0x96b1('0x2e')],qs[_0x96b1('0x32')](_0x3f8220[_0x96b1('0x2f')][_0x96b1('0x32')]));_0x96c0f6['attributes']=_0x96c0f6[_0x96b1('0x33')][_0x96b1('0x34')]?_0x96c0f6[_0x96b1('0x33')]:_0x458fd9['model'];if(_0x3f8220[_0x96b1('0x2f')][_0x96b1('0x42')]){_0x96c0f6[_0x96b1('0x43')]=[{'all':!![]}];}_0x96c0f6=_[_0x96b1('0x3b')]({},_0x96c0f6,_0x3f8220['options']);return db[_0x96b1('0x2b')][_0x96b1('0x44')](_0x96c0f6)['then'](handleEntityNotFound(_0x307645,null))[_0x96b1('0x21')](respondWithResult(_0x307645,null))[_0x96b1('0x45')](handleError(_0x307645,null));};exports[_0x96b1('0x46')]=function(_0xc7b84b,_0x2d6446){return db[_0x96b1('0x2b')]['create'](_0xc7b84b[_0x96b1('0x47')],{})['then'](function(_0x451f53){var _0x23a1a4=_0xc7b84b['user'][_0x96b1('0x23')]({'plain':!![]});if(!_0x23a1a4)throw new Error(_0x96b1('0x48'));if(_0x23a1a4['role']===_0x96b1('0x49')){var _0xa66f17=_0x451f53[_0x96b1('0x23')]({'plain':!![]});var _0x3a7301=_0x96b1('0x24');return db[_0x96b1('0x4a')][_0x96b1('0x44')]({'where':{'name':_0x3a7301,'userProfileId':_0x23a1a4[_0x96b1('0x4b')]},'raw':!![]})[_0x96b1('0x21')](function(_0xfeeadf){if(_0xfeeadf&&_0xfeeadf['autoAssociation']===0x0){return db[_0x96b1('0x4c')][_0x96b1('0x46')]({'name':_0xa66f17[_0x96b1('0x28')],'resourceId':_0xa66f17['id'],'type':_0xfeeadf[_0x96b1('0x28')],'sectionId':_0xfeeadf['id']},{})[_0x96b1('0x21')](function(){return _0x451f53;});}else{return _0x451f53;}})[_0x96b1('0x45')](function(_0x420d36){logger[_0x96b1('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x420d36);throw _0x420d36;});}return _0x451f53;})['then'](respondWithResult(_0x2d6446,0xc9))[_0x96b1('0x45')](handleError(_0x2d6446,null));};exports[_0x96b1('0x20')]=function(_0x594d3c,_0x1f8719){if(_0x594d3c[_0x96b1('0x47')]['id']){delete _0x594d3c[_0x96b1('0x47')]['id'];}return db['Tag'][_0x96b1('0x44')]({'where':{'id':_0x594d3c[_0x96b1('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f8719,null))['then'](saveUpdates(_0x594d3c[_0x96b1('0x47')],null))[_0x96b1('0x21')](respondWithResult(_0x1f8719,null))[_0x96b1('0x45')](handleError(_0x1f8719,null));};exports[_0x96b1('0x22')]=function(_0x22aa61,_0x3dc040){return db[_0x96b1('0x2b')][_0x96b1('0x44')]({'where':{'id':_0x22aa61[_0x96b1('0x40')]['id']}})[_0x96b1('0x21')](handleEntityNotFound(_0x3dc040,null))[_0x96b1('0x21')](removeEntity(_0x3dc040,null))[_0x96b1('0x45')](handleError(_0x3dc040,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 49ed53a..8fb7894 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 _0xbf9a=['exports','Tag','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x297496,_0x19b11f){var _0x4fcef9=function(_0x6c9fde){while(--_0x6c9fde){_0x297496['push'](_0x297496['shift']());}};_0x4fcef9(++_0x19b11f);}(_0xbf9a,0x116));var _0xabf9=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0xbf9a[_0x527824];return _0xc8b8ed;};'use strict';var _=require(_0xabf9('0x0'));var util=require(_0xabf9('0x1'));var logger=require('../../config/logger')(_0xabf9('0x2'));var moment=require(_0xabf9('0x3'));var BPromise=require(_0xabf9('0x4'));var rp=require(_0xabf9('0x5'));var fs=require('fs');var path=require(_0xabf9('0x6'));var rimraf=require(_0xabf9('0x7'));var config=require(_0xabf9('0x8'));var attributes=require(_0xabf9('0x9'));module[_0xabf9('0xa')]=function(_0xbeeeea,_0x3ed85d){return _0xbeeeea['define'](_0xabf9('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9309=['../../config/environment','define','Tag','tools_tags','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x1bec94,_0x6ceb61){var _0x1030c9=function(_0x35cb86){while(--_0x35cb86){_0x1bec94['push'](_0x1bec94['shift']());}};_0x1030c9(++_0x6ceb61);}(_0x9309,0xb8));var _0x9930=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9309[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9930('0x0'));var util=require(_0x9930('0x1'));var logger=require(_0x9930('0x2'))(_0x9930('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9930('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9930('0x5'));var config=require(_0x9930('0x6'));var attributes=require('./tag.attributes');module['exports']=function(_0x21d276,_0xa0012a){return _0x21d276[_0x9930('0x7')](_0x9930('0x8'),attributes,{'tableName':_0x9930('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index a86d758..b3c8ff7 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 _0x0a9a=['Tag,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x4b4950,_0x103d19){var _0x401a6e=function(_0x5e2d58){while(--_0x5e2d58){_0x4b4950['push'](_0x4b4950['shift']());}};_0x401a6e(++_0x103d19);}(_0x0a9a,0x183));var _0xa0a9=function(_0x2c9900,_0x1b7e6b){_0x2c9900=_0x2c9900-0x0;var _0x37625e=_0x0a9a[_0x2c9900];return _0x37625e;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('Tag,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('Tag,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0x6b19=['error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b19,0xe8));var _0x96b1=function(_0x358cee,_0x52afee){_0x358cee=_0x358cee-0x0;var _0x486746=_0x6b19[_0x358cee];return _0x486746;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var moment=require('moment');var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96b1('0x3'))['db'];var utils=require(_0x96b1('0x4'));var logger=require(_0x96b1('0x5'))(_0x96b1('0x6'));var config=require(_0x96b1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x96b1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3e1a,_0x572fde,_0x57a23a){return new BPromise(function(_0x307e65,_0x535cc9){return client[_0x96b1('0x9')](_0x3e3e1a,_0x57a23a)['then'](function(_0x36ea50){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));logger[_0x96b1('0xd')](_0x96b1('0xe'),_0x572fde,_0x96b1('0xc'),JSON['stringify'](_0x36ea50));if(_0x36ea50['error']){if(_0x36ea50[_0x96b1('0xf')]['code']===0x1f4){logger['error'](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x535cc9(_0x36ea50['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x36ea50[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x307e65(_0x36ea50['error'][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x572fde,_0x96b1('0xc'));_0x307e65(_0x36ea50[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x2d5a32){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x572fde,_0x2d5a32);_0x535cc9(_0x2d5a32);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 320583c..301eea2 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'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 37ce6da..b8784fb 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_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 +var _0x2032=['name','exports','STRING'];(function(_0x551441,_0x4ce7c6){var _0x232e40=function(_0x4be344){while(--_0x4be344){_0x551441['push'](_0x551441['shift']());}};_0x232e40(++_0x4ce7c6);}(_0x2032,0xd9));var _0x2203=function(_0x17384a,_0x5c6eff){_0x17384a=_0x17384a-0x0;var _0x29f923=_0x2032[_0x17384a];return _0x29f923;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 546a425..24e0522 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 _0x50d3=['order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','getQueues','findOne','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Sms','Openchannel','Whatsapp','sequelize','transaction','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','UserVoicePrefix','spread','removeAgents','isArray','Mail','Fax','Queue:remove','VoicePrefixId','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','sendStatus','offset','limit','undefined','count','status','set','Content-Range','apply','then','destroy','get','Teams','error','name','index','map','Team','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x541225,_0x53742e){var _0x3d5cc2=function(_0x579629){while(--_0x579629){_0x541225['push'](_0x541225['shift']());}};_0x3d5cc2(++_0x53742e);}(_0x50d3,0x1d2));var _0x350d=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x50d3[_0x1e2080];return _0x260111;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x350d('0x0'));var jsonpatch=require(_0x350d('0x1'));var rp=require(_0x350d('0x2'));var moment=require(_0x350d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x350d('0x4'));var util=require(_0x350d('0x5'));var path=require('path');var sox=require(_0x350d('0x6'));var csv=require(_0x350d('0x7'));var ejs=require(_0x350d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x350d('0x9'));var squel=require(_0x350d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x350d('0xb'));var toCsv=require(_0x350d('0x7'));var querystring=require(_0x350d('0xc'));var Papa=require(_0x350d('0xd'));var Redis=require(_0x350d('0xe'));var authService=require(_0x350d('0xf'));var qs=require(_0x350d('0x10'));var as=require(_0x350d('0x11'));var hardwareService=require(_0x350d('0x12'));var logger=require('../../config/logger')(_0x350d('0x13'));var utils=require(_0x350d('0x14'));var config=require(_0x350d('0x15'));var licenseUtil=require(_0x350d('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x350d('0x17')](config[_0x350d('0x18')],{'host':_0x350d('0x19'),'port':0x18eb});var socket=require(_0x350d('0x1a'))(new Redis(config['redis']));require(_0x350d('0x1b'))['register'](socket);function respondWithStatusCode(_0x1899bc,_0xe6552f){_0xe6552f=_0xe6552f||0xcc;return function(_0x5cf0db){if(_0x5cf0db){return _0x1899bc[_0x350d('0x1c')](_0xe6552f);}return _0x1899bc['status'](_0xe6552f)['end']();};}function respondWithResult(_0x1fd0d9,_0x36de61){_0x36de61=_0x36de61||0xc8;return function(_0x3dc025){if(_0x3dc025){return _0x1fd0d9['status'](_0x36de61)['json'](_0x3dc025);}};}function respondWithFilteredResult(_0x30ec16,_0x5d6973){return function(_0x2a22b8){if(_0x2a22b8){var _0x44fc3c=typeof _0x5d6973[_0x350d('0x1d')]==='undefined'&&typeof _0x5d6973[_0x350d('0x1e')]===_0x350d('0x1f');var _0xa3f596=_0x2a22b8[_0x350d('0x20')];var _0x89e625=_0x44fc3c?0x0:_0x5d6973[_0x350d('0x1d')];var _0x45506c=_0x44fc3c?_0x2a22b8['count']:_0x5d6973[_0x350d('0x1d')]+_0x5d6973[_0x350d('0x1e')];var _0x21d044;if(_0x45506c>=_0xa3f596){_0x45506c=_0xa3f596;_0x21d044=0xc8;}else{_0x21d044=0xce;}_0x30ec16[_0x350d('0x21')](_0x21d044);return _0x30ec16[_0x350d('0x22')](_0x350d('0x23'),_0x89e625+'-'+_0x45506c+'/'+_0xa3f596)['json'](_0x2a22b8);}return null;};}function patchUpdates(_0x2905e2){return function(_0x43ea9f){try{jsonpatch[_0x350d('0x24')](_0x43ea9f,_0x2905e2,!![]);}catch(_0x295208){return BPromise['reject'](_0x295208);}return _0x43ea9f['save']();};}function saveUpdates(_0x24c0b0,_0x299d20){return function(_0x3966d9){if(_0x3966d9){return _0x3966d9['update'](_0x24c0b0)[_0x350d('0x25')](function(_0x382e94){return _0x382e94;});}return null;};}function removeEntity(_0x2235c8,_0x1153a4){return function(_0x45c2c2){if(_0x45c2c2){return _0x45c2c2[_0x350d('0x26')]()['then'](function(){var _0x1bbc7d=_0x45c2c2[_0x350d('0x27')]({'plain':!![]});var _0x352fdd=_0x350d('0x28');return db['UserProfileResource'][_0x350d('0x26')]({'where':{'type':_0x352fdd,'resourceId':_0x1bbc7d['id']}})['then'](function(){return _0x45c2c2;});})[_0x350d('0x25')](function(){_0x2235c8[_0x350d('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc9b2a,_0x31f8b1){return function(_0xb35e84){if(!_0xb35e84){_0xdc9b2a['sendStatus'](0x194);}return _0xb35e84;};}function handleError(_0x2f987b,_0x503109){_0x503109=_0x503109||0x1f4;return function(_0x1d84bb){logger[_0x350d('0x29')](_0x1d84bb['stack']);if(_0x1d84bb['name']){delete _0x1d84bb[_0x350d('0x2a')];}_0x2f987b['status'](_0x503109)['send'](_0x1d84bb);};}exports[_0x350d('0x2b')]=function(_0x2fe7db,_0x49fb23){var _0x1d84ce={},_0x533c76={},_0x4356ec={'count':0x0,'rows':[]};var _0x1a7e79=_[_0x350d('0x2c')](db[_0x350d('0x2d')][_0x350d('0x2e')],function(_0x48e141){return{'name':_0x48e141['fieldName'],'type':_0x48e141[_0x350d('0x2f')]['key']};});_0x533c76['model']=_[_0x350d('0x2c')](_0x1a7e79,_0x350d('0x2a'));_0x533c76[_0x350d('0x30')]=_[_0x350d('0x31')](_0x2fe7db[_0x350d('0x30')]);_0x533c76[_0x350d('0x32')]=_[_0x350d('0x33')](_0x533c76[_0x350d('0x34')],_0x533c76[_0x350d('0x30')]);_0x1d84ce['attributes']=_[_0x350d('0x33')](_0x533c76[_0x350d('0x34')],qs[_0x350d('0x35')](_0x2fe7db[_0x350d('0x30')][_0x350d('0x35')]));_0x1d84ce[_0x350d('0x36')]=_0x1d84ce[_0x350d('0x36')][_0x350d('0x37')]?_0x1d84ce[_0x350d('0x36')]:_0x533c76[_0x350d('0x34')];if(!_0x2fe7db[_0x350d('0x30')][_0x350d('0x38')](_0x350d('0x39'))){_0x1d84ce['limit']=qs[_0x350d('0x1e')](_0x2fe7db['query'][_0x350d('0x1e')]);_0x1d84ce[_0x350d('0x1d')]=qs[_0x350d('0x1d')](_0x2fe7db[_0x350d('0x30')][_0x350d('0x1d')]);}_0x1d84ce[_0x350d('0x3a')]=qs[_0x350d('0x3b')](_0x2fe7db[_0x350d('0x30')][_0x350d('0x3b')]);_0x1d84ce[_0x350d('0x3c')]=qs[_0x350d('0x32')](_[_0x350d('0x3d')](_0x2fe7db[_0x350d('0x30')],_0x533c76[_0x350d('0x32')]),_0x1a7e79);if(_0x2fe7db[_0x350d('0x30')]['filter']){_0x1d84ce[_0x350d('0x3c')]=_[_0x350d('0x3e')](_0x1d84ce[_0x350d('0x3c')],{'$or':_[_0x350d('0x2c')](_0x1a7e79,function(_0x543674){if(_0x543674[_0x350d('0x2f')]!==_0x350d('0x3f')){var _0x3081da={};_0x3081da[_0x543674['name']]={'$like':'%'+_0x2fe7db[_0x350d('0x30')][_0x350d('0x40')]+'%'};return _0x3081da;}})});}_0x1d84ce=_[_0x350d('0x3e')]({},_0x1d84ce,_0x2fe7db[_0x350d('0x41')]);var _0x42eb3f={'where':_0x1d84ce[_0x350d('0x3c')]};return db[_0x350d('0x2d')]['count'](_0x42eb3f)[_0x350d('0x25')](function(_0x49b681){_0x4356ec[_0x350d('0x20')]=_0x49b681;if(_0x2fe7db[_0x350d('0x30')][_0x350d('0x42')]){_0x1d84ce[_0x350d('0x43')]=[{'all':!![]}];}return db[_0x350d('0x2d')]['findAll'](_0x1d84ce);})[_0x350d('0x25')](function(_0x248be8){_0x4356ec['rows']=_0x248be8;return _0x4356ec;})[_0x350d('0x25')](respondWithFilteredResult(_0x49fb23,_0x1d84ce))['catch'](handleError(_0x49fb23,null));};exports[_0x350d('0x44')]=function(_0x2d39a6,_0x1ab2f2){var _0x422d31={'raw':![],'where':{'id':_0x2d39a6[_0x350d('0x45')]['id']}},_0x39ccf6={};_0x39ccf6[_0x350d('0x34')]=_['keys'](db['Team'][_0x350d('0x2e')]);_0x39ccf6[_0x350d('0x30')]=_[_0x350d('0x31')](_0x2d39a6[_0x350d('0x30')]);_0x39ccf6[_0x350d('0x32')]=_[_0x350d('0x33')](_0x39ccf6['model'],_0x39ccf6[_0x350d('0x30')]);_0x422d31[_0x350d('0x36')]=_['intersection'](_0x39ccf6['model'],qs[_0x350d('0x35')](_0x2d39a6[_0x350d('0x30')][_0x350d('0x35')]));_0x422d31['attributes']=_0x422d31[_0x350d('0x36')][_0x350d('0x37')]?_0x422d31['attributes']:_0x39ccf6['model'];if(_0x2d39a6['query'][_0x350d('0x42')]){_0x422d31[_0x350d('0x43')]=[{'all':!![]}];}_0x422d31=_[_0x350d('0x3e')]({},_0x422d31,_0x2d39a6[_0x350d('0x41')]);return db[_0x350d('0x2d')]['find'](_0x422d31)['then'](handleEntityNotFound(_0x1ab2f2,null))[_0x350d('0x25')](respondWithResult(_0x1ab2f2,null))[_0x350d('0x46')](handleError(_0x1ab2f2,null));};exports['create']=function(_0x355293,_0x3fd14e){return db[_0x350d('0x2d')]['create'](_0x355293['body'],{})[_0x350d('0x25')](function(_0x1887b7){var _0x2f0759=_0x355293['user'][_0x350d('0x27')]({'plain':!![]});if(!_0x2f0759)throw new Error(_0x350d('0x47'));if(_0x2f0759[_0x350d('0x48')]===_0x350d('0x49')){var _0x5be897=_0x1887b7[_0x350d('0x27')]({'plain':!![]});var _0x8279d7=_0x350d('0x28');return db[_0x350d('0x4a')][_0x350d('0x4b')]({'where':{'name':_0x8279d7,'userProfileId':_0x2f0759['userProfileId']},'raw':!![]})['then'](function(_0x5e550c){if(_0x5e550c&&_0x5e550c['autoAssociation']===0x0){return db['UserProfileResource'][_0x350d('0x4c')]({'name':_0x5be897[_0x350d('0x2a')],'resourceId':_0x5be897['id'],'type':_0x5e550c[_0x350d('0x2a')],'sectionId':_0x5e550c['id']},{})['then'](function(){return _0x1887b7;});}else{return _0x1887b7;}})[_0x350d('0x46')](function(_0x50d28b){logger['error'](_0x350d('0x4d'),_0x50d28b);throw _0x50d28b;});}return _0x1887b7;})[_0x350d('0x25')](respondWithResult(_0x3fd14e,0xc9))[_0x350d('0x46')](handleError(_0x3fd14e,null));};exports[_0x350d('0x4e')]=function(_0x48c700,_0x29434f){if(_0x48c700[_0x350d('0x4f')]['id']){delete _0x48c700['body']['id'];}return db[_0x350d('0x2d')][_0x350d('0x4b')]({'where':{'id':_0x48c700[_0x350d('0x45')]['id']}})['then'](handleEntityNotFound(_0x29434f,null))[_0x350d('0x25')](saveUpdates(_0x48c700['body'],null))[_0x350d('0x25')](respondWithResult(_0x29434f,null))[_0x350d('0x46')](handleError(_0x29434f,null));};exports[_0x350d('0x26')]=function(_0x1b60bc,_0x498603){return db[_0x350d('0x2d')][_0x350d('0x4b')]({'where':{'id':_0x1b60bc['params']['id']}})[_0x350d('0x25')](handleEntityNotFound(_0x498603,null))[_0x350d('0x25')](removeEntity(_0x498603,null))['catch'](handleError(_0x498603,null));};exports[_0x350d('0x50')]=function(_0x5e159e,_0x30de96,_0x5ed4d5){return db[_0x350d('0x2d')][_0x350d('0x51')]({'where':{'id':_0x5e159e[_0x350d('0x45')]['id']}})[_0x350d('0x25')](handleEntityNotFound(_0x30de96,null))[_0x350d('0x25')](function(_0x59170e){if(!_0x5e159e[_0x350d('0x30')]['channel']||!utils[_0x350d('0x52')](_0x5e159e[_0x350d('0x30')][_0x350d('0x53')])){throw new db[(_0x350d('0x54'))][(_0x350d('0x55'))](_0x350d('0x56'));}var _0x14a2f3={};var _0x361045={};_0x361045[_0x350d('0x34')]=_['keys'](db[_[_0x350d('0x57')](_0x5e159e[_0x350d('0x30')]['channel'][_0x350d('0x58')]())+_0x350d('0x59')]['rawAttributes']);_0x361045[_0x350d('0x30')]=_[_0x350d('0x31')](_0x5e159e[_0x350d('0x30')]);_0x361045['filters']=_[_0x350d('0x33')](_0x361045[_0x350d('0x34')],_0x361045[_0x350d('0x30')]);_0x14a2f3['attributes']=_[_0x350d('0x33')](_0x361045[_0x350d('0x34')],qs[_0x350d('0x35')](_0x5e159e[_0x350d('0x30')][_0x350d('0x35')]));_0x14a2f3['attributes']=_0x14a2f3['attributes'][_0x350d('0x37')]?_0x14a2f3[_0x350d('0x36')]:_0x361045[_0x350d('0x34')];_0x14a2f3[_0x350d('0x1e')]=qs[_0x350d('0x1e')](_0x5e159e[_0x350d('0x30')][_0x350d('0x1e')]);_0x14a2f3[_0x350d('0x1d')]=qs[_0x350d('0x1d')](_0x5e159e[_0x350d('0x30')][_0x350d('0x1d')]);_0x14a2f3[_0x350d('0x3a')]=qs[_0x350d('0x3b')](_0x5e159e['query'][_0x350d('0x3b')]);_0x14a2f3[_0x350d('0x3c')]=qs[_0x350d('0x32')](_[_0x350d('0x3d')](_0x5e159e[_0x350d('0x30')],_0x361045['filters']));_0x14a2f3=_['merge']({},_0x14a2f3,_0x5e159e[_0x350d('0x41')]);return _0x59170e[_0x350d('0x27')+_[_0x350d('0x57')](_0x5e159e[_0x350d('0x30')]['channel'][_0x350d('0x58')]())+_0x350d('0x5a')](_0x14a2f3);})[_0x350d('0x25')](respondWithResult(_0x30de96,null))['catch'](handleError(_0x30de96,null));};exports[_0x350d('0x5b')]=function(_0x385cea,_0x1e2239,_0x1425e0){return db['Team']['findOne']({'where':{'id':_0x385cea[_0x350d('0x45')]['id']}})[_0x350d('0x25')](function(_0x2e0b8a){if(_0x2e0b8a){if(!_0x385cea[_0x350d('0x4f')][_0x350d('0x53')]||!utils['isValidChannel'](_0x385cea[_0x350d('0x4f')][_0x350d('0x53')])){throw new db['Sequelize'][(_0x350d('0x55'))](_0x350d('0x56'));}return _0x2e0b8a[_0x350d('0x5c')+_[_0x350d('0x57')](_0x385cea[_0x350d('0x4f')]['channel'][_0x350d('0x58')]())+_0x350d('0x5a')](_0x385cea['body'][_0x350d('0x5d')]);}return null;})['then'](handleEntityNotFound(_0x1e2239,null))[_0x350d('0x25')](respondWithStatusCode(_0x1e2239,null))[_0x350d('0x46')](handleError(_0x1e2239,null));};exports[_0x350d('0x5e')]=function(_0x3ea75d,_0x372e0e,_0x4be9e2){return db[_0x350d('0x2d')][_0x350d('0x51')]({'where':{'id':_0x3ea75d[_0x350d('0x45')]['id']}})[_0x350d('0x25')](function(_0x578689){if(_0x578689){if(!_0x3ea75d['query'][_0x350d('0x53')]||!utils[_0x350d('0x52')](_0x3ea75d[_0x350d('0x30')][_0x350d('0x53')])){throw new db[(_0x350d('0x54'))][(_0x350d('0x55'))]('Unknown\x20channel');}return _0x578689[_0x350d('0x5f')+_[_0x350d('0x57')](_0x3ea75d[_0x350d('0x30')]['channel'][_0x350d('0x58')]())+_0x350d('0x5a')](_0x3ea75d[_0x350d('0x30')][_0x350d('0x5d')]);}return null;})[_0x350d('0x25')](handleEntityNotFound(_0x372e0e,null))['then'](respondWithStatusCode(_0x372e0e,null))['catch'](handleError(_0x372e0e,null));};exports[_0x350d('0x60')]=function(_0x12a12c,_0x23bc29){var _0x627c79=_['isArray'](_0x12a12c[_0x350d('0x4f')][_0x350d('0x5d')])?_0x12a12c[_0x350d('0x4f')][_0x350d('0x5d')]:[_0x12a12c[_0x350d('0x4f')]['ids']];var _0x6783ca=_0x12a12c[_0x350d('0x45')]['id'];return db[_0x350d('0x2d')][_0x350d('0x4b')]({'where':{'id':_0x6783ca}})[_0x350d('0x25')](handleEntityNotFound(_0x23bc29,null))[_0x350d('0x25')](function(_0x9d6f55){if(_0x9d6f55){var _0x2c44d9=[_0x350d('0x61'),_0x350d('0x62'),'Mail',_0x350d('0x63'),'Fax',_0x350d('0x64'),_0x350d('0x65')];return db[_0x350d('0x66')][_0x350d('0x67')](function(_0x9e7196){var _0x47d343=_[_0x350d('0x2c')](_0x2c44d9,function(_0x4dbf9a){var _0x1d3c43={'attributes':['id',_0x350d('0x2a')]};if(_0x4dbf9a===_0x350d('0x61')){_0x1d3c43[_0x350d('0x68')]={'attributes':[_0x350d('0x69')]};}return _0x9d6f55[_0x350d('0x27')+_0x4dbf9a+_0x350d('0x5a')](_0x1d3c43)[_0x350d('0x25')](function(_0x57c556){var _0x5e7ae4=_[_0x350d('0x2c')](_0x57c556,function(_0x1f083d){var _0x659900=_['map'](_0x627c79,function(_0x35e5e1){var _0x36ea46={'where':{'UserId':_0x35e5e1,[_0x4dbf9a+'QueueId']:_0x1f083d['id']},'transaction':_0x9e7196};if(_0x4dbf9a===_0x350d('0x61')){_0x36ea46['defaults']={'penalty':_0x1f083d[_0x350d('0x6a')][_0x350d('0x69')]};}return db[_0x350d('0x6b')+_0x4dbf9a+_0x350d('0x59')][_0x350d('0x6c')](_0x36ea46)['then'](function(){socket[_0x350d('0x6d')](_0x350d('0x49')+_0x4dbf9a+_0x350d('0x6e'),{'UserId':_0x35e5e1,[_0x4dbf9a+'QueueId']:_0x1f083d['id']});if(_0x4dbf9a!=='Voice'){return;}return db['User'][_0x350d('0x6f')]({'where':{'id':_0x627c79,'online':0x1},'attributes':['id',_0x350d('0x2a'),_0x350d('0x70'),_0x350d('0x71'),'interface'],'raw':!![]})['then'](function(_0xf4ee20){var _0x2eac70=_[_0x350d('0x2c')](_0xf4ee20,function(_0x4958cf){return db[_0x350d('0x72')][_0x350d('0x73')]({'membername':_0x4958cf[_0x350d('0x2a')],'UserId':_0x4958cf['id'],'queue_name':_0x1f083d[_0x350d('0x2a')],'VoiceQueueId':_0x1f083d['id'],'interface':_[_0x350d('0x74')](_0x4958cf[_0x350d('0x75')])?util[_0x350d('0x76')](_0x350d('0x77'),_0x4958cf[_0x350d('0x2a')]):_0x4958cf['interface'],'paused':_0x4958cf[_0x350d('0x71')]||![],'penalty':_0x1f083d[_0x350d('0x6a')][_0x350d('0x69')]},{'transaction':_0x9e7196});});return Promise['all'](_0x2eac70);});});});return Promise[_0x350d('0x78')](_0x659900);});return Promise['all'](_0x5e7ae4);})['then'](function(){return db[_0x350d('0x79')][_0x350d('0x51')]({'where':{'teamId':_0x6783ca}})['then'](function(_0x496491){if(_0x496491){var _0x23c1da=_['map'](_0x627c79,function(_0x3ad3b0){db[_0x350d('0x7a')]['upsert']({'UserId':_0x3ad3b0,'VoicePrefixId':_0x496491['VoicePrefixId']});});return Promise[_0x350d('0x78')](_0x23c1da);}});});});return Promise[_0x350d('0x78')](_0x47d343)['then'](function(){return _0x9d6f55[_0x350d('0x60')](_0x627c79,{'transaction':_0x9e7196})[_0x350d('0x7b')](function(_0x30690d){return _0x30690d;});});});}})[_0x350d('0x25')](respondWithResult(_0x23bc29,null))[_0x350d('0x46')](handleError(_0x23bc29,null));};exports[_0x350d('0x7c')]=function(_0x1af8ff,_0x4023d3){var _0x177718=_[_0x350d('0x7d')](_0x1af8ff['query'][_0x350d('0x5d')])?_0x1af8ff[_0x350d('0x30')]['ids']:[_0x1af8ff['query'][_0x350d('0x5d')]];var _0x4b4ab9=_0x1af8ff[_0x350d('0x45')]['id'];return db['Team'][_0x350d('0x4b')]({'where':{'id':_0x4b4ab9}})[_0x350d('0x25')](handleEntityNotFound(_0x4023d3,null))[_0x350d('0x25')](function(_0x24e550){if(_0x24e550){var _0xf90210=[_0x350d('0x61'),_0x350d('0x62'),_0x350d('0x7e'),_0x350d('0x63'),_0x350d('0x7f'),_0x350d('0x64'),_0x350d('0x65')];return db[_0x350d('0x66')][_0x350d('0x67')](function(_0x3b84e0){var _0x4bf24d=_[_0x350d('0x2c')](_0xf90210,function(_0x5c83c8){var _0xde6d9={'attributes':['id',_0x350d('0x2a')]};return _0x24e550['get'+_0x5c83c8+_0x350d('0x5a')](_0xde6d9)[_0x350d('0x25')](function(_0x1d10b0){var _0x18af30=_[_0x350d('0x2c')](_0x1d10b0,function(_0x3b08fe){return _0x3b08fe[_0x350d('0x7c')](_0x177718,{'transaction':_0x3b84e0})[_0x350d('0x25')](function(){var _0x3c5a87=_[_0x350d('0x2c')](_0x177718,function(_0x53f2da){socket[_0x350d('0x6d')](_0x350d('0x49')+_0x5c83c8+_0x350d('0x80'),{'UserId':Number(_0x53f2da),[_0x5c83c8+'QueueId']:_0x3b08fe['id']});if(_0x5c83c8!==_0x350d('0x61')){return;}return db['UserVoiceQueueRt'][_0x350d('0x26')]({'where':{'VoiceQueueId':_0x3b08fe['id'],'UserId':_0x53f2da},'transaction':_0x3b84e0});});return Promise['all'](_0x3c5a87);});});return Promise['all'](_0x18af30);});});return Promise[_0x350d('0x78')](_0x4bf24d)['then'](function(){return _0x24e550[_0x350d('0x7c')](_0x177718,{'transaction':_0x3b84e0});})[_0x350d('0x25')](function(){return db[_0x350d('0x79')][_0x350d('0x51')]({'where':{'teamId':_0x4b4ab9}})[_0x350d('0x25')](function(_0x43b8d6){if(_0x43b8d6){var _0x1cf790=_[_0x350d('0x2c')](_0x177718,function(_0xfb7c1e){db[_0x350d('0x7a')][_0x350d('0x26')]({'where':{'UserId':_0xfb7c1e,'VoicePrefixId':_0x43b8d6[_0x350d('0x81')]}});});return Promise[_0x350d('0x78')](_0x1cf790);}});});});}})[_0x350d('0x25')](respondWithStatusCode(_0x4023d3,null))['catch'](handleError(_0x4023d3,null));};exports[_0x350d('0x82')]=function(_0x1866ff,_0x4db3e1,_0x1ffee1){var _0x4a0815={};var _0x5b5bec={};var _0x3e0913;var _0x34461f;return db[_0x350d('0x2d')]['findOne']({'where':{'id':_0x1866ff['params']['id']}})[_0x350d('0x25')](handleEntityNotFound(_0x4db3e1,null))[_0x350d('0x25')](function(_0x3531a6){if(_0x3531a6){_0x3e0913=_0x3531a6;_0x5b5bec['model']=_[_0x350d('0x31')](db['User'][_0x350d('0x2e')]);_0x5b5bec[_0x350d('0x30')]=_['keys'](_0x1866ff[_0x350d('0x30')]);_0x5b5bec[_0x350d('0x32')]=_[_0x350d('0x33')](_0x5b5bec[_0x350d('0x34')],_0x5b5bec[_0x350d('0x30')]);_0x4a0815['attributes']=_[_0x350d('0x33')](_0x5b5bec['model'],qs[_0x350d('0x35')](_0x1866ff[_0x350d('0x30')][_0x350d('0x35')]));_0x4a0815[_0x350d('0x36')]=_0x4a0815[_0x350d('0x36')][_0x350d('0x37')]?_0x4a0815['attributes']:_0x5b5bec['model'];_0x4a0815[_0x350d('0x3a')]=qs[_0x350d('0x3b')](_0x1866ff[_0x350d('0x30')][_0x350d('0x3b')]);_0x4a0815[_0x350d('0x3c')]=qs[_0x350d('0x32')](_[_0x350d('0x3d')](_0x1866ff[_0x350d('0x30')],_0x5b5bec[_0x350d('0x32')]));if(_0x1866ff[_0x350d('0x30')][_0x350d('0x40')]){_0x4a0815[_0x350d('0x3c')]=_['merge'](_0x4a0815[_0x350d('0x3c')],{'$or':_[_0x350d('0x2c')](_0x4a0815[_0x350d('0x36')],function(_0x30fa28){var _0x24a972={};_0x24a972[_0x30fa28]={'$like':'%'+_0x1866ff[_0x350d('0x30')][_0x350d('0x40')]+'%'};return _0x24a972;})});}_0x4a0815=_[_0x350d('0x3e')]({},_0x4a0815,_0x1866ff['options']);return _0x3e0913[_0x350d('0x82')](_0x4a0815);}})[_0x350d('0x25')](function(_0x99400c){if(_0x99400c){_0x34461f=_0x99400c[_0x350d('0x37')];if(!_0x1866ff['query']['hasOwnProperty']('nolimit')){_0x4a0815[_0x350d('0x1e')]=qs[_0x350d('0x1e')](_0x1866ff[_0x350d('0x30')][_0x350d('0x1e')]);_0x4a0815['offset']=qs[_0x350d('0x1d')](_0x1866ff['query'][_0x350d('0x1d')]);}return _0x3e0913[_0x350d('0x82')](_0x4a0815);}})[_0x350d('0x25')](function(_0x304721){if(_0x304721){return _0x304721?{'count':_0x34461f,'rows':_0x304721}:null;}})[_0x350d('0x25')](respondWithResult(_0x4db3e1,null))['catch'](handleError(_0x4db3e1,null));}; \ No newline at end of file +var _0x9488=['include','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','getQueues','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','Queue','pick','toLowerCase','Queues','addQueues','ValidationError','ids','removeQueues','remove','Voice','Chat','Mail','Openchannel','Whatsapp','sequelize','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','upsert','isNil','all','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','addAgents','spread','removeAgents','Fax','transaction','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Team'];(function(_0x573730,_0x3cbbd6){var _0x3743bc=function(_0x5e131d){while(--_0x5e131d){_0x573730['push'](_0x573730['shift']());}};_0x3743bc(++_0x3cbbd6);}(_0x9488,0xc3));var _0x8948=function(_0x1e63a7,_0x422dd2){_0x1e63a7=_0x1e63a7-0x0;var _0x528684=_0x9488[_0x1e63a7];return _0x528684;};'use strict';var emlformat=require(_0x8948('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8948('0x1'));var rp=require('request-promise');var moment=require(_0x8948('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8948('0x3'));var util=require(_0x8948('0x4'));var path=require('path');var sox=require(_0x8948('0x5'));var csv=require('to-csv');var ejs=require(_0x8948('0x6'));var fs=require('fs');var fs_extra=require(_0x8948('0x7'));var _=require(_0x8948('0x8'));var squel=require(_0x8948('0x9'));var crypto=require(_0x8948('0xa'));var jsforce=require(_0x8948('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8948('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8948('0xd'));var authService=require(_0x8948('0xe'));var qs=require(_0x8948('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8948('0x10'));var logger=require(_0x8948('0x11'))(_0x8948('0x12'));var utils=require(_0x8948('0x13'));var config=require(_0x8948('0x14'));var licenseUtil=require(_0x8948('0x15'));var db=require(_0x8948('0x16'))['db'];config['redis']=_[_0x8948('0x17')](config[_0x8948('0x18')],{'host':_0x8948('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8948('0x18')]));require(_0x8948('0x1a'))[_0x8948('0x1b')](socket);function respondWithStatusCode(_0x2c99be,_0x314dac){_0x314dac=_0x314dac||0xcc;return function(_0x2c1a00){if(_0x2c1a00){return _0x2c99be[_0x8948('0x1c')](_0x314dac);}return _0x2c99be[_0x8948('0x1d')](_0x314dac)[_0x8948('0x1e')]();};}function respondWithResult(_0x3b09a8,_0x284432){_0x284432=_0x284432||0xc8;return function(_0x49e026){if(_0x49e026){return _0x3b09a8['status'](_0x284432)[_0x8948('0x1f')](_0x49e026);}};}function respondWithFilteredResult(_0x1388e7,_0x3df45d){return function(_0x506bb9){if(_0x506bb9){var _0x3aa9ca=typeof _0x3df45d[_0x8948('0x20')]===_0x8948('0x21')&&typeof _0x3df45d[_0x8948('0x22')]===_0x8948('0x21');var _0xe9179=_0x506bb9[_0x8948('0x23')];var _0x85f620=_0x3aa9ca?0x0:_0x3df45d['offset'];var _0x4df865=_0x3aa9ca?_0x506bb9[_0x8948('0x23')]:_0x3df45d[_0x8948('0x20')]+_0x3df45d[_0x8948('0x22')];var _0x6137be;if(_0x4df865>=_0xe9179){_0x4df865=_0xe9179;_0x6137be=0xc8;}else{_0x6137be=0xce;}_0x1388e7[_0x8948('0x1d')](_0x6137be);return _0x1388e7['set'](_0x8948('0x24'),_0x85f620+'-'+_0x4df865+'/'+_0xe9179)[_0x8948('0x1f')](_0x506bb9);}return null;};}function patchUpdates(_0x406c28){return function(_0xe36d2){try{jsonpatch[_0x8948('0x25')](_0xe36d2,_0x406c28,!![]);}catch(_0xe8444e){return BPromise[_0x8948('0x26')](_0xe8444e);}return _0xe36d2['save']();};}function saveUpdates(_0x2f2bba,_0x5bc821){return function(_0x56d287){if(_0x56d287){return _0x56d287[_0x8948('0x27')](_0x2f2bba)[_0x8948('0x28')](function(_0x2a0005){return _0x2a0005;});}return null;};}function removeEntity(_0x333a6f,_0x1cd924){return function(_0xebcf0f){if(_0xebcf0f){return _0xebcf0f[_0x8948('0x29')]()[_0x8948('0x28')](function(){var _0x101624=_0xebcf0f[_0x8948('0x2a')]({'plain':!![]});var _0x4beaec=_0x8948('0x2b');return db[_0x8948('0x2c')][_0x8948('0x29')]({'where':{'type':_0x4beaec,'resourceId':_0x101624['id']}})['then'](function(){return _0xebcf0f;});})[_0x8948('0x28')](function(){_0x333a6f['status'](0xcc)[_0x8948('0x1e')]();});}};}function handleEntityNotFound(_0x47713a,_0x209462){return function(_0x19e35e){if(!_0x19e35e){_0x47713a[_0x8948('0x1c')](0x194);}return _0x19e35e;};}function handleError(_0x46000b,_0x8f0b6b){_0x8f0b6b=_0x8f0b6b||0x1f4;return function(_0x3ee162){logger[_0x8948('0x2d')](_0x3ee162[_0x8948('0x2e')]);if(_0x3ee162['name']){delete _0x3ee162[_0x8948('0x2f')];}_0x46000b['status'](_0x8f0b6b)[_0x8948('0x30')](_0x3ee162);};}exports[_0x8948('0x31')]=function(_0x4388de,_0x334eba){var _0x350c54={},_0x29eb41={},_0x56a42c={'count':0x0,'rows':[]};var _0x159a45=_[_0x8948('0x32')](db['Team'][_0x8948('0x33')],function(_0x253aa2){return{'name':_0x253aa2[_0x8948('0x34')],'type':_0x253aa2[_0x8948('0x35')][_0x8948('0x36')]};});_0x29eb41['model']=_[_0x8948('0x32')](_0x159a45,'name');_0x29eb41[_0x8948('0x37')]=_[_0x8948('0x38')](_0x4388de[_0x8948('0x37')]);_0x29eb41[_0x8948('0x39')]=_[_0x8948('0x3a')](_0x29eb41[_0x8948('0x3b')],_0x29eb41['query']);_0x350c54['attributes']=_[_0x8948('0x3a')](_0x29eb41[_0x8948('0x3b')],qs[_0x8948('0x3c')](_0x4388de['query'][_0x8948('0x3c')]));_0x350c54[_0x8948('0x3d')]=_0x350c54[_0x8948('0x3d')][_0x8948('0x3e')]?_0x350c54['attributes']:_0x29eb41[_0x8948('0x3b')];if(!_0x4388de[_0x8948('0x37')][_0x8948('0x3f')](_0x8948('0x40'))){_0x350c54[_0x8948('0x22')]=qs[_0x8948('0x22')](_0x4388de[_0x8948('0x37')][_0x8948('0x22')]);_0x350c54[_0x8948('0x20')]=qs['offset'](_0x4388de[_0x8948('0x37')][_0x8948('0x20')]);}_0x350c54[_0x8948('0x41')]=qs[_0x8948('0x42')](_0x4388de['query'][_0x8948('0x42')]);_0x350c54[_0x8948('0x43')]=qs['filters'](_['pick'](_0x4388de[_0x8948('0x37')],_0x29eb41[_0x8948('0x39')]),_0x159a45);if(_0x4388de[_0x8948('0x37')][_0x8948('0x44')]){_0x350c54[_0x8948('0x43')]=_['merge'](_0x350c54['where'],{'$or':_[_0x8948('0x32')](_0x159a45,function(_0x1b3ab6){if(_0x1b3ab6[_0x8948('0x35')]!==_0x8948('0x45')){var _0x405240={};_0x405240[_0x1b3ab6['name']]={'$like':'%'+_0x4388de[_0x8948('0x37')][_0x8948('0x44')]+'%'};return _0x405240;}})});}_0x350c54=_[_0x8948('0x46')]({},_0x350c54,_0x4388de[_0x8948('0x47')]);var _0x5adfb5={'where':_0x350c54[_0x8948('0x43')]};return db[_0x8948('0x48')][_0x8948('0x23')](_0x5adfb5)['then'](function(_0x8b0c01){_0x56a42c['count']=_0x8b0c01;if(_0x4388de[_0x8948('0x37')]['includeAll']){_0x350c54[_0x8948('0x49')]=[{'all':!![]}];}return db['Team']['findAll'](_0x350c54);})[_0x8948('0x28')](function(_0x1d7cb4){_0x56a42c['rows']=_0x1d7cb4;return _0x56a42c;})[_0x8948('0x28')](respondWithFilteredResult(_0x334eba,_0x350c54))[_0x8948('0x4a')](handleError(_0x334eba,null));};exports['show']=function(_0x59416a,_0x4101d7){var _0x3a698a={'raw':![],'where':{'id':_0x59416a[_0x8948('0x4b')]['id']}},_0x2ac352={};_0x2ac352['model']=_['keys'](db[_0x8948('0x48')][_0x8948('0x33')]);_0x2ac352[_0x8948('0x37')]=_[_0x8948('0x38')](_0x59416a['query']);_0x2ac352[_0x8948('0x39')]=_[_0x8948('0x3a')](_0x2ac352[_0x8948('0x3b')],_0x2ac352[_0x8948('0x37')]);_0x3a698a[_0x8948('0x3d')]=_[_0x8948('0x3a')](_0x2ac352[_0x8948('0x3b')],qs[_0x8948('0x3c')](_0x59416a['query'][_0x8948('0x3c')]));_0x3a698a['attributes']=_0x3a698a[_0x8948('0x3d')][_0x8948('0x3e')]?_0x3a698a[_0x8948('0x3d')]:_0x2ac352[_0x8948('0x3b')];if(_0x59416a[_0x8948('0x37')][_0x8948('0x4c')]){_0x3a698a[_0x8948('0x49')]=[{'all':!![]}];}_0x3a698a=_['merge']({},_0x3a698a,_0x59416a[_0x8948('0x47')]);return db[_0x8948('0x48')][_0x8948('0x4d')](_0x3a698a)[_0x8948('0x28')](handleEntityNotFound(_0x4101d7,null))['then'](respondWithResult(_0x4101d7,null))['catch'](handleError(_0x4101d7,null));};exports[_0x8948('0x4e')]=function(_0x49e2a2,_0x5937e6){return db['Team'][_0x8948('0x4e')](_0x49e2a2[_0x8948('0x4f')],{})['then'](function(_0x434f2a){var _0x1054fc=_0x49e2a2[_0x8948('0x50')]['get']({'plain':!![]});if(!_0x1054fc)throw new Error(_0x8948('0x51'));if(_0x1054fc[_0x8948('0x52')]===_0x8948('0x50')){var _0x53b2c1=_0x434f2a[_0x8948('0x2a')]({'plain':!![]});var _0x43a16e=_0x8948('0x2b');return db[_0x8948('0x53')][_0x8948('0x4d')]({'where':{'name':_0x43a16e,'userProfileId':_0x1054fc[_0x8948('0x54')]},'raw':!![]})[_0x8948('0x28')](function(_0x366cb9){if(_0x366cb9&&_0x366cb9[_0x8948('0x55')]===0x0){return db[_0x8948('0x2c')][_0x8948('0x4e')]({'name':_0x53b2c1['name'],'resourceId':_0x53b2c1['id'],'type':_0x366cb9[_0x8948('0x2f')],'sectionId':_0x366cb9['id']},{})['then'](function(){return _0x434f2a;});}else{return _0x434f2a;}})[_0x8948('0x4a')](function(_0x173158){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x173158);throw _0x173158;});}return _0x434f2a;})['then'](respondWithResult(_0x5937e6,0xc9))[_0x8948('0x4a')](handleError(_0x5937e6,null));};exports[_0x8948('0x27')]=function(_0x4e2ee3,_0x2175d0){if(_0x4e2ee3['body']['id']){delete _0x4e2ee3['body']['id'];}return db['Team'][_0x8948('0x4d')]({'where':{'id':_0x4e2ee3[_0x8948('0x4b')]['id']}})[_0x8948('0x28')](handleEntityNotFound(_0x2175d0,null))[_0x8948('0x28')](saveUpdates(_0x4e2ee3[_0x8948('0x4f')],null))[_0x8948('0x28')](respondWithResult(_0x2175d0,null))[_0x8948('0x4a')](handleError(_0x2175d0,null));};exports['destroy']=function(_0x1e7ad1,_0x1e6968){return db[_0x8948('0x48')][_0x8948('0x4d')]({'where':{'id':_0x1e7ad1[_0x8948('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e6968,null))[_0x8948('0x28')](removeEntity(_0x1e6968,null))['catch'](handleError(_0x1e6968,null));};exports[_0x8948('0x56')]=function(_0x32d3df,_0x4daf1c,_0x40fc69){return db[_0x8948('0x48')][_0x8948('0x57')]({'where':{'id':_0x32d3df[_0x8948('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4daf1c,null))[_0x8948('0x28')](function(_0x59af01){if(!_0x32d3df[_0x8948('0x37')][_0x8948('0x58')]||!utils[_0x8948('0x59')](_0x32d3df[_0x8948('0x37')][_0x8948('0x58')])){throw new db[(_0x8948('0x5a'))]['ValidationError'](_0x8948('0x5b'));}var _0x2aab4f={};var _0x280150={};_0x280150[_0x8948('0x3b')]=_[_0x8948('0x38')](db[_[_0x8948('0x5c')](_0x32d3df[_0x8948('0x37')]['channel']['toLowerCase']())+_0x8948('0x5d')]['rawAttributes']);_0x280150['query']=_[_0x8948('0x38')](_0x32d3df[_0x8948('0x37')]);_0x280150[_0x8948('0x39')]=_[_0x8948('0x3a')](_0x280150[_0x8948('0x3b')],_0x280150['query']);_0x2aab4f[_0x8948('0x3d')]=_['intersection'](_0x280150[_0x8948('0x3b')],qs[_0x8948('0x3c')](_0x32d3df[_0x8948('0x37')][_0x8948('0x3c')]));_0x2aab4f[_0x8948('0x3d')]=_0x2aab4f['attributes'][_0x8948('0x3e')]?_0x2aab4f['attributes']:_0x280150[_0x8948('0x3b')];_0x2aab4f[_0x8948('0x22')]=qs[_0x8948('0x22')](_0x32d3df[_0x8948('0x37')][_0x8948('0x22')]);_0x2aab4f[_0x8948('0x20')]=qs[_0x8948('0x20')](_0x32d3df['query'][_0x8948('0x20')]);_0x2aab4f[_0x8948('0x41')]=qs[_0x8948('0x42')](_0x32d3df[_0x8948('0x37')]['sort']);_0x2aab4f['where']=qs['filters'](_[_0x8948('0x5e')](_0x32d3df[_0x8948('0x37')],_0x280150[_0x8948('0x39')]));_0x2aab4f=_['merge']({},_0x2aab4f,_0x32d3df['options']);return _0x59af01['get'+_[_0x8948('0x5c')](_0x32d3df[_0x8948('0x37')][_0x8948('0x58')][_0x8948('0x5f')]())+_0x8948('0x60')](_0x2aab4f);})[_0x8948('0x28')](respondWithResult(_0x4daf1c,null))[_0x8948('0x4a')](handleError(_0x4daf1c,null));};exports[_0x8948('0x61')]=function(_0x5032cc,_0x1f41de,_0x3f661b){return db[_0x8948('0x48')]['findOne']({'where':{'id':_0x5032cc[_0x8948('0x4b')]['id']}})[_0x8948('0x28')](function(_0x4b8048){if(_0x4b8048){if(!_0x5032cc[_0x8948('0x4f')][_0x8948('0x58')]||!utils['isValidChannel'](_0x5032cc[_0x8948('0x4f')][_0x8948('0x58')])){throw new db[(_0x8948('0x5a'))][(_0x8948('0x62'))](_0x8948('0x5b'));}return _0x4b8048['add'+_[_0x8948('0x5c')](_0x5032cc[_0x8948('0x4f')]['channel'][_0x8948('0x5f')]())+_0x8948('0x60')](_0x5032cc['body'][_0x8948('0x63')]);}return null;})[_0x8948('0x28')](handleEntityNotFound(_0x1f41de,null))[_0x8948('0x28')](respondWithStatusCode(_0x1f41de,null))[_0x8948('0x4a')](handleError(_0x1f41de,null));};exports[_0x8948('0x64')]=function(_0x4a03be,_0x3bb32c,_0x3407ed){return db[_0x8948('0x48')]['findOne']({'where':{'id':_0x4a03be[_0x8948('0x4b')]['id']}})[_0x8948('0x28')](function(_0xb57d42){if(_0xb57d42){if(!_0x4a03be[_0x8948('0x37')][_0x8948('0x58')]||!utils[_0x8948('0x59')](_0x4a03be[_0x8948('0x37')]['channel'])){throw new db[(_0x8948('0x5a'))][(_0x8948('0x62'))]('Unknown\x20channel');}return _0xb57d42[_0x8948('0x65')+_[_0x8948('0x5c')](_0x4a03be[_0x8948('0x37')][_0x8948('0x58')]['toLowerCase']())+_0x8948('0x60')](_0x4a03be['query'][_0x8948('0x63')]);}return null;})['then'](handleEntityNotFound(_0x3bb32c,null))[_0x8948('0x28')](respondWithStatusCode(_0x3bb32c,null))[_0x8948('0x4a')](handleError(_0x3bb32c,null));};exports['addAgents']=function(_0x56f3ec,_0x5c0e4d){var _0x2bfde8=_['isArray'](_0x56f3ec[_0x8948('0x4f')][_0x8948('0x63')])?_0x56f3ec[_0x8948('0x4f')][_0x8948('0x63')]:[_0x56f3ec['body'][_0x8948('0x63')]];var _0x4bab53=_0x56f3ec[_0x8948('0x4b')]['id'];return db[_0x8948('0x48')]['find']({'where':{'id':_0x4bab53}})[_0x8948('0x28')](handleEntityNotFound(_0x5c0e4d,null))[_0x8948('0x28')](function(_0x3f6806){if(_0x3f6806){var _0x20abf0=[_0x8948('0x66'),_0x8948('0x67'),_0x8948('0x68'),'Sms','Fax',_0x8948('0x69'),_0x8948('0x6a')];return db[_0x8948('0x6b')]['transaction'](function(_0x55d418){var _0x2e5baf=_['map'](_0x20abf0,function(_0x23eb93){var _0x21b939={'attributes':['id',_0x8948('0x2f')]};if(_0x23eb93===_0x8948('0x66')){_0x21b939[_0x8948('0x6c')]={'attributes':['penalty']};}return _0x3f6806[_0x8948('0x2a')+_0x23eb93+_0x8948('0x60')](_0x21b939)[_0x8948('0x28')](function(_0x1ec4ed){var _0x95ccf6=_[_0x8948('0x32')](_0x1ec4ed,function(_0x3ed408){var _0x10a983=_[_0x8948('0x32')](_0x2bfde8,function(_0x175ee0){var _0x34eda3={'where':{'UserId':_0x175ee0,[_0x23eb93+_0x8948('0x6d')]:_0x3ed408['id']},'transaction':_0x55d418};if(_0x23eb93===_0x8948('0x66')){_0x34eda3['defaults']={'penalty':_0x3ed408[_0x8948('0x6e')][_0x8948('0x6f')]};}return db[_0x8948('0x70')+_0x23eb93+'Queue'][_0x8948('0x71')](_0x34eda3)[_0x8948('0x28')](function(){socket[_0x8948('0x72')](_0x8948('0x50')+_0x23eb93+_0x8948('0x73'),{'UserId':_0x175ee0,[_0x23eb93+_0x8948('0x6d')]:_0x3ed408['id']});if(_0x23eb93!==_0x8948('0x66')){return;}return db[_0x8948('0x70')][_0x8948('0x74')]({'where':{'id':_0x2bfde8,'online':0x1},'attributes':['id',_0x8948('0x2f'),_0x8948('0x75'),_0x8948('0x76'),_0x8948('0x77')],'raw':!![]})[_0x8948('0x28')](function(_0x97ba11){var _0x44e8f7=_['map'](_0x97ba11,function(_0x582aa8){return db['UserVoiceQueueRt'][_0x8948('0x78')]({'membername':_0x582aa8[_0x8948('0x2f')],'UserId':_0x582aa8['id'],'queue_name':_0x3ed408['name'],'VoiceQueueId':_0x3ed408['id'],'interface':_[_0x8948('0x79')](_0x582aa8[_0x8948('0x77')])?util['format']('SIP/%s',_0x582aa8[_0x8948('0x2f')]):_0x582aa8[_0x8948('0x77')],'paused':_0x582aa8['voicePause']||![],'penalty':_0x3ed408[_0x8948('0x6e')][_0x8948('0x6f')]},{'transaction':_0x55d418});});return Promise['all'](_0x44e8f7);});});});return Promise[_0x8948('0x7a')](_0x10a983);});return Promise['all'](_0x95ccf6);})['then'](function(){return db[_0x8948('0x7b')]['findOne']({'where':{'teamId':_0x4bab53}})[_0x8948('0x28')](function(_0x488d58){if(_0x488d58){var _0x55544d=_[_0x8948('0x32')](_0x2bfde8,function(_0x9e5230){db[_0x8948('0x7c')][_0x8948('0x78')]({'UserId':_0x9e5230,'VoicePrefixId':_0x488d58[_0x8948('0x7d')]});});return Promise[_0x8948('0x7a')](_0x55544d);}});});});return Promise[_0x8948('0x7a')](_0x2e5baf)[_0x8948('0x28')](function(){return _0x3f6806[_0x8948('0x7e')](_0x2bfde8,{'transaction':_0x55d418})[_0x8948('0x7f')](function(_0x5e49c3){return _0x5e49c3;});});});}})[_0x8948('0x28')](respondWithResult(_0x5c0e4d,null))[_0x8948('0x4a')](handleError(_0x5c0e4d,null));};exports[_0x8948('0x80')]=function(_0x531d67,_0x14e3cf){var _0x3cc5a9=_['isArray'](_0x531d67[_0x8948('0x37')][_0x8948('0x63')])?_0x531d67[_0x8948('0x37')][_0x8948('0x63')]:[_0x531d67[_0x8948('0x37')]['ids']];var _0x5619a7=_0x531d67['params']['id'];return db[_0x8948('0x48')]['find']({'where':{'id':_0x5619a7}})[_0x8948('0x28')](handleEntityNotFound(_0x14e3cf,null))['then'](function(_0x9a3861){if(_0x9a3861){var _0x3ac85b=[_0x8948('0x66'),_0x8948('0x67'),_0x8948('0x68'),'Sms',_0x8948('0x81'),_0x8948('0x69'),'Whatsapp'];return db[_0x8948('0x6b')][_0x8948('0x82')](function(_0x48bcbd){var _0x2094ab=_['map'](_0x3ac85b,function(_0xc23288){var _0x46d6b8={'attributes':['id',_0x8948('0x2f')]};return _0x9a3861['get'+_0xc23288+_0x8948('0x60')](_0x46d6b8)[_0x8948('0x28')](function(_0x57bdd7){var _0x34722a=_['map'](_0x57bdd7,function(_0x49ab2c){return _0x49ab2c['removeAgents'](_0x3cc5a9,{'transaction':_0x48bcbd})[_0x8948('0x28')](function(){var _0x3533fd=_[_0x8948('0x32')](_0x3cc5a9,function(_0x3c72c2){socket['emit'](_0x8948('0x50')+_0xc23288+_0x8948('0x83'),{'UserId':Number(_0x3c72c2),[_0xc23288+'QueueId']:_0x49ab2c['id']});if(_0xc23288!==_0x8948('0x66')){return;}return db[_0x8948('0x84')]['destroy']({'where':{'VoiceQueueId':_0x49ab2c['id'],'UserId':_0x3c72c2},'transaction':_0x48bcbd});});return Promise['all'](_0x3533fd);});});return Promise[_0x8948('0x7a')](_0x34722a);});});return Promise[_0x8948('0x7a')](_0x2094ab)[_0x8948('0x28')](function(){return _0x9a3861['removeAgents'](_0x3cc5a9,{'transaction':_0x48bcbd});})['then'](function(){return db['TeamVoicePrefix'][_0x8948('0x57')]({'where':{'teamId':_0x5619a7}})[_0x8948('0x28')](function(_0xb39950){if(_0xb39950){var _0x4a937f=_[_0x8948('0x32')](_0x3cc5a9,function(_0x5a422f){db['UserVoicePrefix'][_0x8948('0x29')]({'where':{'UserId':_0x5a422f,'VoicePrefixId':_0xb39950[_0x8948('0x7d')]}});});return Promise['all'](_0x4a937f);}});});});}})[_0x8948('0x28')](respondWithStatusCode(_0x14e3cf,null))[_0x8948('0x4a')](handleError(_0x14e3cf,null));};exports[_0x8948('0x85')]=function(_0x3a449a,_0x3ebf2b,_0x240c6c){var _0x4b75ac={};var _0x4e5018={};var _0x381fbe;var _0x1b81c1;return db[_0x8948('0x48')][_0x8948('0x57')]({'where':{'id':_0x3a449a[_0x8948('0x4b')]['id']}})[_0x8948('0x28')](handleEntityNotFound(_0x3ebf2b,null))[_0x8948('0x28')](function(_0x9ffa9d){if(_0x9ffa9d){_0x381fbe=_0x9ffa9d;_0x4e5018[_0x8948('0x3b')]=_[_0x8948('0x38')](db[_0x8948('0x70')][_0x8948('0x33')]);_0x4e5018['query']=_[_0x8948('0x38')](_0x3a449a[_0x8948('0x37')]);_0x4e5018[_0x8948('0x39')]=_[_0x8948('0x3a')](_0x4e5018[_0x8948('0x3b')],_0x4e5018['query']);_0x4b75ac[_0x8948('0x3d')]=_[_0x8948('0x3a')](_0x4e5018[_0x8948('0x3b')],qs[_0x8948('0x3c')](_0x3a449a[_0x8948('0x37')][_0x8948('0x3c')]));_0x4b75ac[_0x8948('0x3d')]=_0x4b75ac['attributes'][_0x8948('0x3e')]?_0x4b75ac[_0x8948('0x3d')]:_0x4e5018['model'];_0x4b75ac['order']=qs[_0x8948('0x42')](_0x3a449a[_0x8948('0x37')]['sort']);_0x4b75ac['where']=qs['filters'](_[_0x8948('0x5e')](_0x3a449a['query'],_0x4e5018[_0x8948('0x39')]));if(_0x3a449a['query']['filter']){_0x4b75ac['where']=_['merge'](_0x4b75ac[_0x8948('0x43')],{'$or':_[_0x8948('0x32')](_0x4b75ac[_0x8948('0x3d')],function(_0x51729a){var _0x49767f={};_0x49767f[_0x51729a]={'$like':'%'+_0x3a449a[_0x8948('0x37')][_0x8948('0x44')]+'%'};return _0x49767f;})});}_0x4b75ac=_[_0x8948('0x46')]({},_0x4b75ac,_0x3a449a['options']);return _0x381fbe[_0x8948('0x85')](_0x4b75ac);}})[_0x8948('0x28')](function(_0x172cfc){if(_0x172cfc){_0x1b81c1=_0x172cfc['length'];if(!_0x3a449a[_0x8948('0x37')][_0x8948('0x3f')](_0x8948('0x40'))){_0x4b75ac['limit']=qs[_0x8948('0x22')](_0x3a449a[_0x8948('0x37')]['limit']);_0x4b75ac[_0x8948('0x20')]=qs[_0x8948('0x20')](_0x3a449a[_0x8948('0x37')]['offset']);}return _0x381fbe[_0x8948('0x85')](_0x4b75ac);}})[_0x8948('0x28')](function(_0x8d7a07){if(_0x8d7a07){return _0x8d7a07?{'count':_0x1b81c1,'rows':_0x8d7a07}:null;}})['then'](respondWithResult(_0x3ebf2b,null))[_0x8948('0x4a')](handleError(_0x3ebf2b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index dfae87c..fbf6a54 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 _0x33c5=['hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x95b18e,_0x16f45f){var _0x3bde94=function(_0xa23ee3){while(--_0xa23ee3){_0x95b18e['push'](_0x95b18e['shift']());}};_0x3bde94(++_0x16f45f);}(_0x33c5,0xdf));var _0x533c=function(_0x53b93b,_0x1bfab1){_0x53b93b=_0x53b93b-0x0;var _0x485761=_0x33c5[_0x53b93b];return _0x485761;};'use strict';var EventEmitter=require(_0x533c('0x0'));var Team=require(_0x533c('0x1'))['db'][_0x533c('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x533c('0x3')](0x0);var events={'afterCreate':_0x533c('0x4'),'afterUpdate':_0x533c('0x5'),'afterDestroy':_0x533c('0x6')};function emitEvent(_0x4b6b5c){return function(_0x4fc0ae,_0x24970c,_0x57fa42){TeamEvents[_0x533c('0x7')](_0x4b6b5c+':'+_0x4fc0ae['id'],_0x4fc0ae);TeamEvents[_0x533c('0x7')](_0x4b6b5c,_0x4fc0ae);_0x57fa42(null);};}for(var e in events){if(events[_0x533c('0x8')](e)){var event=events[e];Team[_0x533c('0x9')](e,emitEvent(event));}}module[_0x533c('0xa')]=TeamEvents; \ No newline at end of file +var _0xea63=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x432812,_0x104e3c){var _0x2d2383=function(_0x2ac0cf){while(--_0x2ac0cf){_0x432812['push'](_0x432812['shift']());}};_0x2d2383(++_0x104e3c);}(_0xea63,0x14e));var _0x3ea6=function(_0x22cccd,_0x1aac3e){_0x22cccd=_0x22cccd-0x0;var _0x4af3a8=_0xea63[_0x22cccd];return _0x4af3a8;};'use strict';var EventEmitter=require(_0x3ea6('0x0'));var Team=require(_0x3ea6('0x1'))['db'][_0x3ea6('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x3ea6('0x3')](0x0);var events={'afterCreate':_0x3ea6('0x4'),'afterUpdate':_0x3ea6('0x5'),'afterDestroy':_0x3ea6('0x6')};function emitEvent(_0x1e7db6){return function(_0x27317d,_0x3ee72f,_0x32a992){TeamEvents[_0x3ea6('0x7')](_0x1e7db6+':'+_0x27317d['id'],_0x27317d);TeamEvents[_0x3ea6('0x7')](_0x1e7db6,_0x27317d);_0x32a992(null);};}for(var e in events){if(events[_0x3ea6('0x8')](e)){var event=events[e];Team[_0x3ea6('0x9')](e,emitEvent(event));}}module[_0x3ea6('0xa')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 8448ed5..7b88903 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 _0x0d17=['../../config/logger','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams','lodash','util'];(function(_0x5af8af,_0x6df2cd){var _0x59da8f=function(_0x525ae4){while(--_0x525ae4){_0x5af8af['push'](_0x5af8af['shift']());}};_0x59da8f(++_0x6df2cd);}(_0x0d17,0x132));var _0x70d1=function(_0x91d487,_0x8588f7){_0x91d487=_0x91d487-0x0;var _0x12f8d9=_0x0d17[_0x91d487];return _0x12f8d9;};'use strict';var _=require(_0x70d1('0x0'));var util=require(_0x70d1('0x1'));var logger=require(_0x70d1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x70d1('0x3'));var fs=require('fs');var path=require(_0x70d1('0x4'));var rimraf=require(_0x70d1('0x5'));var config=require(_0x70d1('0x6'));var attributes=require(_0x70d1('0x7'));module[_0x70d1('0x8')]=function(_0x90271f,_0x416745){return _0x90271f['define'](_0x70d1('0x9'),attributes,{'tableName':_0x70d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7d7=['api','moment','bluebird','request-promise','path','rimraf','./team.attributes','exports','define','teams','lodash','util','../../config/logger'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xa7d7,0x135));var _0x7a7d=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xa7d7[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x7a7d('0x0'));var util=require(_0x7a7d('0x1'));var logger=require(_0x7a7d('0x2'))(_0x7a7d('0x3'));var moment=require(_0x7a7d('0x4'));var BPromise=require(_0x7a7d('0x5'));var rp=require(_0x7a7d('0x6'));var fs=require('fs');var path=require(_0x7a7d('0x7'));var rimraf=require(_0x7a7d('0x8'));var config=require('../../config/environment');var attributes=require(_0x7a7d('0x9'));module[_0x7a7d('0xa')]=function(_0x5f4963,_0x558001){return _0x5f4963[_0x7a7d('0xb')]('Team',attributes,{'tableName':_0x7a7d('0xc'),'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 50e6037..6d0b476 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 _0x9652=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result'];(function(_0xeadc11,_0x27e378){var _0x4257b6=function(_0x38bb40){while(--_0x38bb40){_0xeadc11['push'](_0xeadc11['shift']());}};_0x4257b6(++_0x27e378);}(_0x9652,0xf4));var _0x2965=function(_0x13f5fe,_0x460a12){_0x13f5fe=_0x13f5fe-0x0;var _0x481c05=_0x9652[_0x13f5fe];return _0x481c05;};'use strict';var _=require(_0x2965('0x0'));var util=require(_0x2965('0x1'));var moment=require(_0x2965('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2965('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2965('0x4'));var logger=require(_0x2965('0x5'))(_0x2965('0x6'));var config=require(_0x2965('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2965('0x8')]['http']({'port':0x232a});config[_0x2965('0x9')]=_[_0x2965('0xa')](config[_0x2965('0x9')],{'host':_0x2965('0xb'),'port':0x18eb});var socket=require(_0x2965('0xc'))(new Redis(config[_0x2965('0x9')]));require(_0x2965('0xd'))[_0x2965('0xe')](socket);function respondWithRpcPromise(_0x5bddf4,_0x14346b,_0x561b0b){return new BPromise(function(_0x2e8828,_0xe776ba){return client['request'](_0x5bddf4,_0x561b0b)[_0x2965('0xf')](function(_0x577e3f){logger[_0x2965('0x10')]('Team,\x20%s,\x20%s',_0x14346b,_0x2965('0x11'));logger[_0x2965('0x12')](_0x2965('0x13'),_0x14346b,_0x2965('0x11'),JSON[_0x2965('0x14')](_0x577e3f));if(_0x577e3f[_0x2965('0x15')]){if(_0x577e3f[_0x2965('0x15')][_0x2965('0x16')]===0x1f4){logger['error'](_0x2965('0x17'),_0x14346b,_0x577e3f[_0x2965('0x15')]['message']);return _0xe776ba(_0x577e3f[_0x2965('0x15')][_0x2965('0x18')]);}logger[_0x2965('0x15')]('Team,\x20%s,\x20%s',_0x14346b,_0x577e3f[_0x2965('0x15')][_0x2965('0x18')]);return _0x2e8828(_0x577e3f[_0x2965('0x15')]['message']);}else{logger['info'](_0x2965('0x17'),_0x14346b,_0x2965('0x11'));_0x2e8828(_0x577e3f[_0x2965('0x19')][_0x2965('0x18')]);}})[_0x2965('0x1a')](function(_0x3e1049){logger[_0x2965('0x15')](_0x2965('0x17'),_0x14346b,_0x3e1049);_0xe776ba(_0x3e1049);});});} \ No newline at end of file +var _0x536e=['http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4c70c4,_0x963969){var _0x437865=function(_0x54e323){while(--_0x54e323){_0x4c70c4['push'](_0x4c70c4['shift']());}};_0x437865(++_0x963969);}(_0x536e,0x171));var _0xe536=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x536e[_0x135a1c];return _0x295c98;};'use strict';var _=require(_0xe536('0x0'));var util=require(_0xe536('0x1'));var moment=require('moment');var BPromise=require(_0xe536('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe536('0x3'))['db'];var utils=require(_0xe536('0x4'));var logger=require(_0xe536('0x5'))(_0xe536('0x6'));var config=require(_0xe536('0x7'));var jayson=require(_0xe536('0x8'));var client=jayson['client'][_0xe536('0x9')]({'port':0x232a});config[_0xe536('0xa')]=_[_0xe536('0xb')](config[_0xe536('0xa')],{'host':_0xe536('0xc'),'port':0x18eb});var socket=require(_0xe536('0xd'))(new Redis(config[_0xe536('0xa')]));require(_0xe536('0xe'))[_0xe536('0xf')](socket);function respondWithRpcPromise(_0x534afc,_0x12f29d,_0x12cf1c){return new BPromise(function(_0x56f3de,_0x58b68f){return client[_0xe536('0x10')](_0x534afc,_0x12cf1c)['then'](function(_0x43a45b){logger[_0xe536('0x11')](_0xe536('0x12'),_0x12f29d,_0xe536('0x13'));logger[_0xe536('0x14')](_0xe536('0x15'),_0x12f29d,_0xe536('0x13'),JSON[_0xe536('0x16')](_0x43a45b));if(_0x43a45b[_0xe536('0x17')]){if(_0x43a45b[_0xe536('0x17')]['code']===0x1f4){logger[_0xe536('0x17')]('Team,\x20%s,\x20%s',_0x12f29d,_0x43a45b[_0xe536('0x17')]['message']);return _0x58b68f(_0x43a45b[_0xe536('0x17')][_0xe536('0x18')]);}logger[_0xe536('0x17')]('Team,\x20%s,\x20%s',_0x12f29d,_0x43a45b['error'][_0xe536('0x18')]);return _0x56f3de(_0x43a45b['error'][_0xe536('0x18')]);}else{logger[_0xe536('0x11')](_0xe536('0x12'),_0x12f29d,'request\x20sent');_0x56f3de(_0x43a45b[_0xe536('0x19')]['message']);}})[_0xe536('0x1a')](function(_0x1b8d38){logger[_0xe536('0x17')](_0xe536('0x12'),_0x12f29d,_0x1b8d38);_0x58b68f(_0x1b8d38);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c6dee2c..d7a8d8a 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 _0x4c71=['register','length','team:','./team.events','save','update','emit','removeListener'];(function(_0x4f32b4,_0x279b5d){var _0x2ce940=function(_0x146212){while(--_0x146212){_0x4f32b4['push'](_0x4f32b4['shift']());}};_0x2ce940(++_0x279b5d);}(_0x4c71,0x12b));var _0x14c7=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4c71[_0x5d2803];return _0xdcad2c;};'use strict';var TeamEvents=require(_0x14c7('0x0'));var events=[_0x14c7('0x1'),'remove',_0x14c7('0x2')];function createListener(_0x348462,_0x3a0e7c){return function(_0x2b1786){_0x3a0e7c[_0x14c7('0x3')](_0x348462,_0x2b1786);};}function removeListener(_0x4bbb43,_0x10a777){return function(){TeamEvents[_0x14c7('0x4')](_0x4bbb43,_0x10a777);};}exports[_0x14c7('0x5')]=function(_0x3c6929){for(var _0x5b50b6=0x0,_0x493824=events[_0x14c7('0x6')];_0x5b50b6<_0x493824;_0x5b50b6++){var _0x38b0fb=events[_0x5b50b6];var _0x33ffc6=createListener(_0x14c7('0x7')+_0x38b0fb,_0x3c6929);TeamEvents['on'](_0x38b0fb,_0x33ffc6);}}; \ No newline at end of file +var _0xac0e=['save','remove','update','emit','removeListener','length','team:','./team.events'];(function(_0x506172,_0xbc3a3){var _0x2723c0=function(_0x57c3d9){while(--_0x57c3d9){_0x506172['push'](_0x506172['shift']());}};_0x2723c0(++_0xbc3a3);}(_0xac0e,0x13f));var _0xeac0=function(_0x489544,_0x1c54b5){_0x489544=_0x489544-0x0;var _0x42f404=_0xac0e[_0x489544];return _0x42f404;};'use strict';var TeamEvents=require(_0xeac0('0x0'));var events=[_0xeac0('0x1'),_0xeac0('0x2'),_0xeac0('0x3')];function createListener(_0xbeadb7,_0x24f979){return function(_0x17f29f){_0x24f979[_0xeac0('0x4')](_0xbeadb7,_0x17f29f);};}function removeListener(_0x3ef42d,_0x240da4){return function(){TeamEvents[_0xeac0('0x5')](_0x3ef42d,_0x240da4);};}exports['register']=function(_0x1bf74b){for(var _0x3b4802=0x0,_0x30988e=events[_0xeac0('0x6')];_0x3b4802<_0x30988e;_0x3b4802++){var _0xba595d=events[_0x3b4802];var _0x4c279e=createListener(_0xeac0('0x7')+_0xba595d,_0x1bf74b);TeamEvents['on'](_0xba595d,_0x4c279e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index a2c1172..1270c25 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 _0xaa53=['exports','INTEGER','sequelize'];(function(_0x4ce9e7,_0x5a7232){var _0x1a3092=function(_0x3d982e){while(--_0x3d982e){_0x4ce9e7['push'](_0x4ce9e7['shift']());}};_0x1a3092(++_0x5a7232);}(_0xaa53,0xb0));var _0x3aa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa53[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x3aa5('0x0'));module[_0x3aa5('0x1')]={'TeamId':{'type':Sequelize[_0x3aa5('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x692e=['exports'];(function(_0x338662,_0x58daca){var _0x7e495e=function(_0x152cb2){while(--_0x152cb2){_0x338662['push'](_0x338662['shift']());}};_0x7e495e(++_0x58daca);}(_0x692e,0x6c));var _0xe692=function(_0x3b3acd,_0x32c49c){_0x3b3acd=_0x3b3acd-0x0;var _0x3cc864=_0x692e[_0x3b3acd];return _0x3cc864;};'use strict';var Sequelize=require('sequelize');module[_0xe692('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 678979d..21508be 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 _0xa20a=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','../../config/logger','api','moment','bluebird'];(function(_0x4aacb2,_0x2e0c2f){var _0x3fdb70=function(_0x47fc46){while(--_0x47fc46){_0x4aacb2['push'](_0x4aacb2['shift']());}};_0x3fdb70(++_0x2e0c2f);}(_0xa20a,0x74));var _0xaa20=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xa20a[_0x101e7b];return _0x4995c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaa20('0x0'))(_0xaa20('0x1'));var moment=require(_0xaa20('0x2'));var BPromise=require(_0xaa20('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa20('0x4'));var rimraf=require(_0xaa20('0x5'));var config=require(_0xaa20('0x6'));var attributes=require(_0xaa20('0x7'));module[_0xaa20('0x8')]=function(_0x5ac74e,_0x54ecbc){return _0x5ac74e[_0xaa20('0x9')](_0xaa20('0xa'),attributes,{'tableName':_0xaa20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be0=['moment','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x2be0,0x128));var _0x02be=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2be0[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x02be('0x0'));var util=require(_0x02be('0x1'));var logger=require(_0x02be('0x2'))(_0x02be('0x3'));var moment=require(_0x02be('0x4'));var BPromise=require('bluebird');var rp=require(_0x02be('0x5'));var fs=require('fs');var path=require(_0x02be('0x6'));var rimraf=require(_0x02be('0x7'));var config=require('../../config/environment');var attributes=require(_0x02be('0x8'));module[_0x02be('0x9')]=function(_0x46392d,_0x184bf6){return _0x46392d['define'](_0x02be('0xa'),attributes,{'tableName':_0x02be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 4720d89..285cd3b 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b2aeb,_0x37fc00){var _0x10e3c6=function(_0x4f57af){while(--_0x4f57af){_0x4b2aeb['push'](_0x4b2aeb['shift']());}};_0x10e3c6(++_0x37fc00);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5d9675,_0xdceabd){var _0x1fd2f6=function(_0x51606c){while(--_0x51606c){_0x5d9675['push'](_0x5d9675['shift']());}};_0x1fd2f6(++_0xdceabd);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 3579efb..ee75d42 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 _0x9964=['INTEGER'];(function(_0x25fbe7,_0x60350b){var _0x331393=function(_0x4fc7a4){while(--_0x4fc7a4){_0x25fbe7['push'](_0x25fbe7['shift']());}};_0x331393(++_0x60350b);}(_0x9964,0x1d7));var _0x4996=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x9964[_0x538c70];return _0x42ae01;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x4996('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3c34=['INTEGER','sequelize','exports'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x3c34,0xf7));var _0x43c3=function(_0x547456,_0x1de17e){_0x547456=_0x547456-0x0;var _0xc1fd7b=_0x3c34[_0x547456];return _0xc1fd7b;};'use strict';var Sequelize=require(_0x43c3('0x0'));module[_0x43c3('0x1')]={'penalty':{'type':Sequelize[_0x43c3('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 50f949d..9e623b2 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 _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues'];(function(_0x3563d5,_0x39f541){var _0x545161=function(_0x8a8f6f){while(--_0x8a8f6f){_0x3563d5['push'](_0x3563d5['shift']());}};_0x545161(++_0x39f541);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x3f6dfc,_0x2aae58){_0x3f6dfc=_0x3f6dfc-0x0;var _0x32cfa1=_0x4fdb[_0x3f6dfc];return _0x32cfa1;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x782e=['rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','team_has_voice_queues','../../config/logger','api','bluebird','request-promise'];(function(_0x760f6,_0x182ead){var _0x53097d=function(_0x17f0d4){while(--_0x17f0d4){_0x760f6['push'](_0x760f6['shift']());}};_0x53097d(++_0x182ead);}(_0x782e,0xb9));var _0xe782=function(_0x26912d,_0xfe849d){_0x26912d=_0x26912d-0x0;var _0x26c7a6=_0x782e[_0x26912d];return _0x26c7a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe782('0x0'))(_0xe782('0x1'));var moment=require('moment');var BPromise=require(_0xe782('0x2'));var rp=require(_0xe782('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var attributes=require(_0xe782('0x6'));module[_0xe782('0x7')]=function(_0x5a75ef,_0x1b934f){return _0x5a75ef['define']('TeamVoiceQueue',attributes,{'tableName':_0xe782('0x8'),'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 54113cf..9bc3032 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 _0x5ee7=['info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x2fb926,_0x57d607){var _0x4dcc1c=function(_0x139e25){while(--_0x139e25){_0x2fb926['push'](_0x2fb926['shift']());}};_0x4dcc1c(++_0x57d607);}(_0x5ee7,0xdc));var _0x75ee=function(_0x269955,_0x233b08){_0x269955=_0x269955-0x0;var _0x46ba7d=_0x5ee7[_0x269955];return _0x46ba7d;};'use strict';var _=require(_0x75ee('0x0'));var util=require(_0x75ee('0x1'));var moment=require(_0x75ee('0x2'));var BPromise=require('bluebird');var rs=require(_0x75ee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75ee('0x4'))['db'];var utils=require(_0x75ee('0x5'));var logger=require(_0x75ee('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x75ee('0x7')][_0x75ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x227178,_0x5a3126,_0x677dd2){return new BPromise(function(_0x2c5537,_0xeee87){return client[_0x75ee('0x9')](_0x227178,_0x677dd2)[_0x75ee('0xa')](function(_0x1e1f97){logger[_0x75ee('0xb')](_0x75ee('0xc'),_0x5a3126,_0x75ee('0xd'));logger[_0x75ee('0xe')](_0x75ee('0xf'),_0x5a3126,_0x75ee('0xd'),JSON[_0x75ee('0x10')](_0x1e1f97));if(_0x1e1f97[_0x75ee('0x11')]){if(_0x1e1f97['error']['code']===0x1f4){logger[_0x75ee('0x11')](_0x75ee('0xc'),_0x5a3126,_0x1e1f97[_0x75ee('0x11')]['message']);return _0xeee87(_0x1e1f97[_0x75ee('0x11')]['message']);}logger[_0x75ee('0x11')](_0x75ee('0xc'),_0x5a3126,_0x1e1f97[_0x75ee('0x11')]['message']);return _0x2c5537(_0x1e1f97[_0x75ee('0x11')][_0x75ee('0x12')]);}else{logger[_0x75ee('0xb')](_0x75ee('0xc'),_0x5a3126,'request\x20sent');_0x2c5537(_0x1e1f97[_0x75ee('0x13')][_0x75ee('0x12')]);}})[_0x75ee('0x14')](function(_0x47c4c3){logger[_0x75ee('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5a3126,_0x47c4c3);_0xeee87(_0x47c4c3);});});} \ No newline at end of file +var _0x303a=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x303a,0x1a0));var _0xa303=function(_0x83420c,_0x50fd91){_0x83420c=_0x83420c-0x0;var _0x1057d7=_0x303a[_0x83420c];return _0x1057d7;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 7a7e12f..829b261 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 _0x1574=['show','post','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x29a7ad,_0x4cacf4){var _0x4ab412=function(_0x25b235){while(--_0x25b235){_0x29a7ad['push'](_0x29a7ad['shift']());}};_0x4ab412(++_0x4cacf4);}(_0x1574,0x148));var _0x4157=function(_0x3cac9b,_0x140e32){_0x3cac9b=_0x3cac9b-0x0;var _0x1ea4a9=_0x1574[_0x3cac9b];return _0x1ea4a9;};'use strict';var multer=require(_0x4157('0x0'));var util=require(_0x4157('0x1'));var path=require(_0x4157('0x2'));var timeout=require(_0x4157('0x3'));var express=require('express');var router=express[_0x4157('0x4')]();var fs_extra=require(_0x4157('0x5'));var auth=require(_0x4157('0x6'));var interaction=require(_0x4157('0x7'));var config=require(_0x4157('0x8'));var controller=require(_0x4157('0x9'));router[_0x4157('0xa')]('/',auth[_0x4157('0xb')](),controller[_0x4157('0xc')]);router[_0x4157('0xa')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller[_0x4157('0xe')]);router[_0x4157('0xf')]('/',auth[_0x4157('0xb')](),controller['create']);router[_0x4157('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4157('0x11')](_0x4157('0xd'),auth[_0x4157('0xb')](),controller['destroy']);module[_0x4157('0x12')]=router; \ No newline at end of file +var _0x15ef=['create','put','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','/:id','show','isAuthenticated'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x15ef,0x80));var _0xf15e=function(_0x3ba7c7,_0x1924eb){_0x3ba7c7=_0x3ba7c7-0x0;var _0x139f54=_0x15ef[_0x3ba7c7];return _0x139f54;};'use strict';var multer=require('multer');var util=require(_0xf15e('0x0'));var path=require(_0xf15e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf15e('0x2'));var router=express[_0xf15e('0x3')]();var fs_extra=require(_0xf15e('0x4'));var auth=require(_0xf15e('0x5'));var interaction=require(_0xf15e('0x6'));var config=require('../../config/environment');var controller=require(_0xf15e('0x7'));router[_0xf15e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf15e('0x8')](_0xf15e('0x9'),auth['isAuthenticated'](),controller[_0xf15e('0xa')]);router['post']('/',auth[_0xf15e('0xb')](),controller[_0xf15e('0xc')]);router[_0xf15e('0xd')](_0xf15e('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf15e('0x9'),auth[_0xf15e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index c1c3758..48ad5ff 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 _0x218d=['STRING','TEXT','sequelize','exports'];(function(_0x43c206,_0x56b5a9){var _0x57319f=function(_0x2b7239){while(--_0x2b7239){_0x43c206['push'](_0x43c206['shift']());}};_0x57319f(++_0x56b5a9);}(_0x218d,0x72));var _0xd218=function(_0x20c5e6,_0x1f39e8){_0x20c5e6=_0x20c5e6-0x0;var _0x311490=_0x218d[_0x20c5e6];return _0x311490;};'use strict';var Sequelize=require(_0xd218('0x0'));module[_0xd218('0x1')]={'name':{'type':Sequelize[_0xd218('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xd218('0x3')]}}; \ No newline at end of file +var _0xfb95=['exports','STRING','TEXT','sequelize'];(function(_0x38fbdb,_0x151c7a){var _0x2921be=function(_0x4ae456){while(--_0x4ae456){_0x38fbdb['push'](_0x38fbdb['shift']());}};_0x2921be(++_0x151c7a);}(_0xfb95,0x193));var _0x5fb9=function(_0x105045,_0x2e471e){_0x105045=_0x105045-0x0;var _0x2487d0=_0xfb95[_0x105045];return _0x2487d0;};'use strict';var Sequelize=require(_0x5fb9('0x0'));module[_0x5fb9('0x1')]={'name':{'type':Sequelize[_0x5fb9('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x5fb9('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 32a802d..999e217 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 _0x748a=['where','pick','filter','VIRTUAL','merge','Template','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','reject','save','update','destroy','get','Templates','UserProfileResource','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','query','sort'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0x748a,0xbf));var _0xa748=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x748a[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xa748('0x0'));var rimraf=require(_0xa748('0x1'));var zipdir=require(_0xa748('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa748('0x3'));var BPromise=require(_0xa748('0x4'));var Mustache=require(_0xa748('0x5'));var util=require(_0xa748('0x6'));var path=require(_0xa748('0x7'));var sox=require(_0xa748('0x8'));var csv=require(_0xa748('0x9'));var ejs=require(_0xa748('0xa'));var fs=require('fs');var fs_extra=require(_0xa748('0xb'));var _=require(_0xa748('0xc'));var squel=require(_0xa748('0xd'));var crypto=require(_0xa748('0xe'));var jsforce=require(_0xa748('0xf'));var deskjs=require(_0xa748('0x10'));var toCsv=require(_0xa748('0x9'));var querystring=require(_0xa748('0x11'));var Papa=require(_0xa748('0x12'));var Redis=require(_0xa748('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa748('0x14'));var logger=require(_0xa748('0x15'))(_0xa748('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa748('0x17'));var db=require(_0xa748('0x18'))['db'];function respondWithStatusCode(_0x3061e3,_0xf8137a){_0xf8137a=_0xf8137a||0xcc;return function(_0x1d767c){if(_0x1d767c){return _0x3061e3[_0xa748('0x19')](_0xf8137a);}return _0x3061e3[_0xa748('0x1a')](_0xf8137a)[_0xa748('0x1b')]();};}function respondWithResult(_0x1603b1,_0x38e03c){_0x38e03c=_0x38e03c||0xc8;return function(_0x42f7e1){if(_0x42f7e1){return _0x1603b1[_0xa748('0x1a')](_0x38e03c)[_0xa748('0x1c')](_0x42f7e1);}};}function respondWithFilteredResult(_0x58cbd7,_0x3ea5d8){return function(_0x32fa47){if(_0x32fa47){var _0x55a7cd=typeof _0x3ea5d8['offset']==='undefined'&&typeof _0x3ea5d8[_0xa748('0x1d')]==='undefined';var _0x345556=_0x32fa47[_0xa748('0x1e')];var _0x2a5dae=_0x55a7cd?0x0:_0x3ea5d8[_0xa748('0x1f')];var _0x2ced6b=_0x55a7cd?_0x32fa47[_0xa748('0x1e')]:_0x3ea5d8[_0xa748('0x1f')]+_0x3ea5d8[_0xa748('0x1d')];var _0xbb86dd;if(_0x2ced6b>=_0x345556){_0x2ced6b=_0x345556;_0xbb86dd=0xc8;}else{_0xbb86dd=0xce;}_0x58cbd7[_0xa748('0x1a')](_0xbb86dd);return _0x58cbd7[_0xa748('0x20')]('Content-Range',_0x2a5dae+'-'+_0x2ced6b+'/'+_0x345556)[_0xa748('0x1c')](_0x32fa47);}return null;};}function patchUpdates(_0x5b0257){return function(_0x2a8e2b){try{jsonpatch['apply'](_0x2a8e2b,_0x5b0257,!![]);}catch(_0xabb989){return BPromise[_0xa748('0x21')](_0xabb989);}return _0x2a8e2b[_0xa748('0x22')]();};}function saveUpdates(_0x533e49,_0x51b5af){return function(_0x2ecf8e){if(_0x2ecf8e){return _0x2ecf8e[_0xa748('0x23')](_0x533e49)['then'](function(_0x10f4d8){return _0x10f4d8;});}return null;};}function removeEntity(_0x35eb4c,_0x4a3630){return function(_0x4c66cf){if(_0x4c66cf){return _0x4c66cf[_0xa748('0x24')]()['then'](function(){var _0x809283=_0x4c66cf[_0xa748('0x25')]({'plain':!![]});var _0x3dfafc=_0xa748('0x26');return db[_0xa748('0x27')][_0xa748('0x24')]({'where':{'type':_0x3dfafc,'resourceId':_0x809283['id']}})['then'](function(){return _0x4c66cf;});})[_0xa748('0x28')](function(){_0x35eb4c[_0xa748('0x1a')](0xcc)[_0xa748('0x1b')]();});}};}function handleEntityNotFound(_0x205321,_0x1f09ea){return function(_0x563088){if(!_0x563088){_0x205321['sendStatus'](0x194);}return _0x563088;};}function handleError(_0x58c04d,_0x422715){_0x422715=_0x422715||0x1f4;return function(_0x56067d){logger[_0xa748('0x29')](_0x56067d[_0xa748('0x2a')]);if(_0x56067d[_0xa748('0x2b')]){delete _0x56067d['name'];}_0x58c04d['status'](_0x422715)['send'](_0x56067d);};}exports[_0xa748('0x2c')]=function(_0x487770,_0x4314d5){var _0x3e8700={},_0x2b3c43={},_0x48f8bc={'count':0x0,'rows':[]};var _0x502ef8=_[_0xa748('0x2d')](db['Template'][_0xa748('0x2e')],function(_0x369b5c){return{'name':_0x369b5c[_0xa748('0x2f')],'type':_0x369b5c[_0xa748('0x30')][_0xa748('0x31')]};});_0x2b3c43['model']=_['map'](_0x502ef8,_0xa748('0x2b'));_0x2b3c43['query']=_[_0xa748('0x32')](_0x487770['query']);_0x2b3c43[_0xa748('0x33')]=_[_0xa748('0x34')](_0x2b3c43['model'],_0x2b3c43['query']);_0x3e8700[_0xa748('0x35')]=_[_0xa748('0x34')](_0x2b3c43[_0xa748('0x36')],qs['fields'](_0x487770['query'][_0xa748('0x37')]));_0x3e8700['attributes']=_0x3e8700[_0xa748('0x35')][_0xa748('0x38')]?_0x3e8700[_0xa748('0x35')]:_0x2b3c43[_0xa748('0x36')];if(!_0x487770['query'][_0xa748('0x39')](_0xa748('0x3a'))){_0x3e8700[_0xa748('0x1d')]=qs[_0xa748('0x1d')](_0x487770[_0xa748('0x3b')][_0xa748('0x1d')]);_0x3e8700[_0xa748('0x1f')]=qs[_0xa748('0x1f')](_0x487770['query']['offset']);}_0x3e8700['order']=qs['sort'](_0x487770[_0xa748('0x3b')][_0xa748('0x3c')]);_0x3e8700[_0xa748('0x3d')]=qs['filters'](_[_0xa748('0x3e')](_0x487770[_0xa748('0x3b')],_0x2b3c43[_0xa748('0x33')]),_0x502ef8);if(_0x487770[_0xa748('0x3b')][_0xa748('0x3f')]){_0x3e8700['where']=_['merge'](_0x3e8700[_0xa748('0x3d')],{'$or':_[_0xa748('0x2d')](_0x502ef8,function(_0x6fe4ed){if(_0x6fe4ed[_0xa748('0x30')]!==_0xa748('0x40')){var _0x5c59f2={};_0x5c59f2[_0x6fe4ed[_0xa748('0x2b')]]={'$like':'%'+_0x487770['query'][_0xa748('0x3f')]+'%'};return _0x5c59f2;}})});}_0x3e8700=_[_0xa748('0x41')]({},_0x3e8700,_0x487770['options']);var _0x4acb9b={'where':_0x3e8700[_0xa748('0x3d')]};return db[_0xa748('0x42')][_0xa748('0x1e')](_0x4acb9b)[_0xa748('0x28')](function(_0x2a504d){_0x48f8bc[_0xa748('0x1e')]=_0x2a504d;if(_0x487770[_0xa748('0x3b')][_0xa748('0x43')]){_0x3e8700[_0xa748('0x44')]=[{'all':!![]}];}return db[_0xa748('0x42')][_0xa748('0x45')](_0x3e8700);})[_0xa748('0x28')](function(_0x194dad){_0x48f8bc[_0xa748('0x46')]=_0x194dad;return _0x48f8bc;})[_0xa748('0x28')](respondWithFilteredResult(_0x4314d5,_0x3e8700))[_0xa748('0x47')](handleError(_0x4314d5,null));};exports[_0xa748('0x48')]=function(_0x46d1ea,_0x3f6d85){var _0x322e74={'raw':!![],'where':{'id':_0x46d1ea[_0xa748('0x49')]['id']}},_0x40c380={};_0x40c380[_0xa748('0x36')]=_[_0xa748('0x32')](db[_0xa748('0x42')][_0xa748('0x2e')]);_0x40c380[_0xa748('0x3b')]=_[_0xa748('0x32')](_0x46d1ea[_0xa748('0x3b')]);_0x40c380[_0xa748('0x33')]=_['intersection'](_0x40c380[_0xa748('0x36')],_0x40c380[_0xa748('0x3b')]);_0x322e74[_0xa748('0x35')]=_[_0xa748('0x34')](_0x40c380['model'],qs[_0xa748('0x37')](_0x46d1ea[_0xa748('0x3b')][_0xa748('0x37')]));_0x322e74[_0xa748('0x35')]=_0x322e74[_0xa748('0x35')][_0xa748('0x38')]?_0x322e74[_0xa748('0x35')]:_0x40c380[_0xa748('0x36')];if(_0x46d1ea[_0xa748('0x3b')][_0xa748('0x43')]){_0x322e74[_0xa748('0x44')]=[{'all':!![]}];}_0x322e74=_[_0xa748('0x41')]({},_0x322e74,_0x46d1ea[_0xa748('0x4a')]);return db[_0xa748('0x42')][_0xa748('0x4b')](_0x322e74)[_0xa748('0x28')](handleEntityNotFound(_0x3f6d85,null))[_0xa748('0x28')](respondWithResult(_0x3f6d85,null))[_0xa748('0x47')](handleError(_0x3f6d85,null));};exports[_0xa748('0x4c')]=function(_0x3f0dcb,_0x48c17c){return db[_0xa748('0x42')]['create'](_0x3f0dcb[_0xa748('0x4d')],{})[_0xa748('0x28')](function(_0x47c933){var _0x52797c=_0x3f0dcb[_0xa748('0x4e')][_0xa748('0x25')]({'plain':!![]});if(!_0x52797c)throw new Error(_0xa748('0x4f'));if(_0x52797c[_0xa748('0x50')]===_0xa748('0x4e')){var _0x283911=_0x47c933[_0xa748('0x25')]({'plain':!![]});var _0x361a50=_0xa748('0x26');return db[_0xa748('0x51')][_0xa748('0x4b')]({'where':{'name':_0x361a50,'userProfileId':_0x52797c[_0xa748('0x52')]},'raw':!![]})[_0xa748('0x28')](function(_0x54d9f6){if(_0x54d9f6&&_0x54d9f6[_0xa748('0x53')]===0x0){return db[_0xa748('0x27')][_0xa748('0x4c')]({'name':_0x283911[_0xa748('0x2b')],'resourceId':_0x283911['id'],'type':_0x54d9f6[_0xa748('0x2b')],'sectionId':_0x54d9f6['id']},{})[_0xa748('0x28')](function(){return _0x47c933;});}else{return _0x47c933;}})['catch'](function(_0x18ae4c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18ae4c);throw _0x18ae4c;});}return _0x47c933;})[_0xa748('0x28')](respondWithResult(_0x48c17c,0xc9))[_0xa748('0x47')](handleError(_0x48c17c,null));};exports[_0xa748('0x23')]=function(_0x1d4c64,_0xb1f4e){if(_0x1d4c64[_0xa748('0x4d')]['id']){delete _0x1d4c64[_0xa748('0x4d')]['id'];}return db['Template'][_0xa748('0x4b')]({'where':{'id':_0x1d4c64['params']['id']}})[_0xa748('0x28')](handleEntityNotFound(_0xb1f4e,null))['then'](saveUpdates(_0x1d4c64[_0xa748('0x4d')],null))[_0xa748('0x28')](respondWithResult(_0xb1f4e,null))[_0xa748('0x47')](handleError(_0xb1f4e,null));};exports['destroy']=function(_0x18f8f6,_0x51492b){return db['Template'][_0xa748('0x4b')]({'where':{'id':_0x18f8f6[_0xa748('0x49')]['id']}})[_0xa748('0x28')](handleEntityNotFound(_0x51492b,null))[_0xa748('0x28')](removeEntity(_0x51492b,null))[_0xa748('0x47')](handleError(_0x51492b,null));}; \ No newline at end of file +var _0x3a6a=['to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','index','type','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Template','rows','show','params','keys','rawAttributes','includeAll','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Templates','userProfileId','autoAssociation','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x3af3b3,_0x545689){var _0x5bd063=function(_0x4245ee){while(--_0x4245ee){_0x3af3b3['push'](_0x3af3b3['shift']());}};_0x5bd063(++_0x545689);}(_0x3a6a,0x188));var _0xa3a6=function(_0x390733,_0x1e3d32){_0x390733=_0x390733-0x0;var _0x33beb9=_0x3a6a[_0x390733];return _0x33beb9;};'use strict';var emlformat=require(_0xa3a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3a6('0x1'));var jsonpatch=require(_0xa3a6('0x2'));var rp=require(_0xa3a6('0x3'));var moment=require(_0xa3a6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa3a6('0x5'));var util=require(_0xa3a6('0x6'));var path=require(_0xa3a6('0x7'));var sox=require('sox');var csv=require(_0xa3a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa3a6('0x9'));var squel=require('squel');var crypto=require(_0xa3a6('0xa'));var jsforce=require(_0xa3a6('0xb'));var deskjs=require(_0xa3a6('0xc'));var toCsv=require(_0xa3a6('0x8'));var querystring=require(_0xa3a6('0xd'));var Papa=require(_0xa3a6('0xe'));var Redis=require(_0xa3a6('0xf'));var authService=require(_0xa3a6('0x10'));var qs=require(_0xa3a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa3a6('0x12'));var logger=require(_0xa3a6('0x13'))(_0xa3a6('0x14'));var utils=require(_0xa3a6('0x15'));var config=require(_0xa3a6('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d29e2,_0x29eb4f){_0x29eb4f=_0x29eb4f||0xcc;return function(_0x246b74){if(_0x246b74){return _0x5d29e2[_0xa3a6('0x17')](_0x29eb4f);}return _0x5d29e2[_0xa3a6('0x18')](_0x29eb4f)[_0xa3a6('0x19')]();};}function respondWithResult(_0x2c4a72,_0x3be928){_0x3be928=_0x3be928||0xc8;return function(_0x4485ef){if(_0x4485ef){return _0x2c4a72[_0xa3a6('0x18')](_0x3be928)[_0xa3a6('0x1a')](_0x4485ef);}};}function respondWithFilteredResult(_0x578b1c,_0x3a7d59){return function(_0x1b324e){if(_0x1b324e){var _0x7df7d9=typeof _0x3a7d59[_0xa3a6('0x1b')]===_0xa3a6('0x1c')&&typeof _0x3a7d59[_0xa3a6('0x1d')]==='undefined';var _0x2b45a5=_0x1b324e[_0xa3a6('0x1e')];var _0x58cfb5=_0x7df7d9?0x0:_0x3a7d59[_0xa3a6('0x1b')];var _0x87579d=_0x7df7d9?_0x1b324e[_0xa3a6('0x1e')]:_0x3a7d59['offset']+_0x3a7d59[_0xa3a6('0x1d')];var _0x4cf2a9;if(_0x87579d>=_0x2b45a5){_0x87579d=_0x2b45a5;_0x4cf2a9=0xc8;}else{_0x4cf2a9=0xce;}_0x578b1c['status'](_0x4cf2a9);return _0x578b1c[_0xa3a6('0x1f')](_0xa3a6('0x20'),_0x58cfb5+'-'+_0x87579d+'/'+_0x2b45a5)[_0xa3a6('0x1a')](_0x1b324e);}return null;};}function patchUpdates(_0x36aaa5){return function(_0x2cf40b){try{jsonpatch[_0xa3a6('0x21')](_0x2cf40b,_0x36aaa5,!![]);}catch(_0x268fe4){return BPromise[_0xa3a6('0x22')](_0x268fe4);}return _0x2cf40b[_0xa3a6('0x23')]();};}function saveUpdates(_0xfd152a,_0xbcaff4){return function(_0xebfd29){if(_0xebfd29){return _0xebfd29['update'](_0xfd152a)[_0xa3a6('0x24')](function(_0x383539){return _0x383539;});}return null;};}function removeEntity(_0x5474ff,_0x4ef1da){return function(_0x1abd82){if(_0x1abd82){return _0x1abd82[_0xa3a6('0x25')]()[_0xa3a6('0x24')](function(){var _0x271086=_0x1abd82['get']({'plain':!![]});var _0x5e4486='Templates';return db[_0xa3a6('0x26')][_0xa3a6('0x25')]({'where':{'type':_0x5e4486,'resourceId':_0x271086['id']}})['then'](function(){return _0x1abd82;});})[_0xa3a6('0x24')](function(){_0x5474ff[_0xa3a6('0x18')](0xcc)[_0xa3a6('0x19')]();});}};}function handleEntityNotFound(_0x28461a,_0x48c8c5){return function(_0xc5a87a){if(!_0xc5a87a){_0x28461a[_0xa3a6('0x17')](0x194);}return _0xc5a87a;};}function handleError(_0xa72add,_0x4863f8){_0x4863f8=_0x4863f8||0x1f4;return function(_0x408a43){logger[_0xa3a6('0x27')](_0x408a43[_0xa3a6('0x28')]);if(_0x408a43[_0xa3a6('0x29')]){delete _0x408a43[_0xa3a6('0x29')];}_0xa72add['status'](_0x4863f8)['send'](_0x408a43);};}exports[_0xa3a6('0x2a')]=function(_0x7a420,_0x560d32){var _0xebc530={},_0x45d4ac={},_0x32b098={'count':0x0,'rows':[]};var _0xad4bc1=_['map'](db['Template']['rawAttributes'],function(_0x5edc01){return{'name':_0x5edc01['fieldName'],'type':_0x5edc01[_0xa3a6('0x2b')]['key']};});_0x45d4ac['model']=_[_0xa3a6('0x2c')](_0xad4bc1,_0xa3a6('0x29'));_0x45d4ac['query']=_['keys'](_0x7a420[_0xa3a6('0x2d')]);_0x45d4ac[_0xa3a6('0x2e')]=_[_0xa3a6('0x2f')](_0x45d4ac[_0xa3a6('0x30')],_0x45d4ac[_0xa3a6('0x2d')]);_0xebc530[_0xa3a6('0x31')]=_[_0xa3a6('0x2f')](_0x45d4ac[_0xa3a6('0x30')],qs[_0xa3a6('0x32')](_0x7a420[_0xa3a6('0x2d')]['fields']));_0xebc530[_0xa3a6('0x31')]=_0xebc530[_0xa3a6('0x31')][_0xa3a6('0x33')]?_0xebc530['attributes']:_0x45d4ac[_0xa3a6('0x30')];if(!_0x7a420[_0xa3a6('0x2d')]['hasOwnProperty'](_0xa3a6('0x34'))){_0xebc530['limit']=qs[_0xa3a6('0x1d')](_0x7a420[_0xa3a6('0x2d')][_0xa3a6('0x1d')]);_0xebc530['offset']=qs[_0xa3a6('0x1b')](_0x7a420[_0xa3a6('0x2d')][_0xa3a6('0x1b')]);}_0xebc530[_0xa3a6('0x35')]=qs[_0xa3a6('0x36')](_0x7a420[_0xa3a6('0x2d')][_0xa3a6('0x36')]);_0xebc530[_0xa3a6('0x37')]=qs['filters'](_[_0xa3a6('0x38')](_0x7a420['query'],_0x45d4ac['filters']),_0xad4bc1);if(_0x7a420[_0xa3a6('0x2d')][_0xa3a6('0x39')]){_0xebc530[_0xa3a6('0x37')]=_[_0xa3a6('0x3a')](_0xebc530[_0xa3a6('0x37')],{'$or':_['map'](_0xad4bc1,function(_0x7a9fea){if(_0x7a9fea[_0xa3a6('0x2b')]!==_0xa3a6('0x3b')){var _0x518fd1={};_0x518fd1[_0x7a9fea[_0xa3a6('0x29')]]={'$like':'%'+_0x7a420[_0xa3a6('0x2d')][_0xa3a6('0x39')]+'%'};return _0x518fd1;}})});}_0xebc530=_[_0xa3a6('0x3a')]({},_0xebc530,_0x7a420[_0xa3a6('0x3c')]);var _0x20f6dc={'where':_0xebc530[_0xa3a6('0x37')]};return db[_0xa3a6('0x3d')][_0xa3a6('0x1e')](_0x20f6dc)[_0xa3a6('0x24')](function(_0x1a6c1d){_0x32b098[_0xa3a6('0x1e')]=_0x1a6c1d;if(_0x7a420[_0xa3a6('0x2d')]['includeAll']){_0xebc530['include']=[{'all':!![]}];}return db[_0xa3a6('0x3d')]['findAll'](_0xebc530);})[_0xa3a6('0x24')](function(_0x142b1b){_0x32b098[_0xa3a6('0x3e')]=_0x142b1b;return _0x32b098;})['then'](respondWithFilteredResult(_0x560d32,_0xebc530))['catch'](handleError(_0x560d32,null));};exports[_0xa3a6('0x3f')]=function(_0x4624a1,_0x426add){var _0x3e7537={'raw':!![],'where':{'id':_0x4624a1[_0xa3a6('0x40')]['id']}},_0x1cdbeb={};_0x1cdbeb[_0xa3a6('0x30')]=_[_0xa3a6('0x41')](db[_0xa3a6('0x3d')][_0xa3a6('0x42')]);_0x1cdbeb[_0xa3a6('0x2d')]=_[_0xa3a6('0x41')](_0x4624a1[_0xa3a6('0x2d')]);_0x1cdbeb[_0xa3a6('0x2e')]=_[_0xa3a6('0x2f')](_0x1cdbeb['model'],_0x1cdbeb[_0xa3a6('0x2d')]);_0x3e7537[_0xa3a6('0x31')]=_[_0xa3a6('0x2f')](_0x1cdbeb['model'],qs[_0xa3a6('0x32')](_0x4624a1[_0xa3a6('0x2d')][_0xa3a6('0x32')]));_0x3e7537[_0xa3a6('0x31')]=_0x3e7537[_0xa3a6('0x31')][_0xa3a6('0x33')]?_0x3e7537[_0xa3a6('0x31')]:_0x1cdbeb[_0xa3a6('0x30')];if(_0x4624a1[_0xa3a6('0x2d')][_0xa3a6('0x43')]){_0x3e7537[_0xa3a6('0x44')]=[{'all':!![]}];}_0x3e7537=_['merge']({},_0x3e7537,_0x4624a1['options']);return db[_0xa3a6('0x3d')][_0xa3a6('0x45')](_0x3e7537)['then'](handleEntityNotFound(_0x426add,null))[_0xa3a6('0x24')](respondWithResult(_0x426add,null))[_0xa3a6('0x46')](handleError(_0x426add,null));};exports[_0xa3a6('0x47')]=function(_0x12d686,_0x2c0112){return db[_0xa3a6('0x3d')][_0xa3a6('0x47')](_0x12d686[_0xa3a6('0x48')],{})[_0xa3a6('0x24')](function(_0x55b039){var _0x1dd3cb=_0x12d686[_0xa3a6('0x49')][_0xa3a6('0x4a')]({'plain':!![]});if(!_0x1dd3cb)throw new Error(_0xa3a6('0x4b'));if(_0x1dd3cb['role']==='user'){var _0x1e194a=_0x55b039[_0xa3a6('0x4a')]({'plain':!![]});var _0x4026ee=_0xa3a6('0x4c');return db['UserProfileSection']['find']({'where':{'name':_0x4026ee,'userProfileId':_0x1dd3cb[_0xa3a6('0x4d')]},'raw':!![]})['then'](function(_0x4617a3){if(_0x4617a3&&_0x4617a3[_0xa3a6('0x4e')]===0x0){return db[_0xa3a6('0x26')][_0xa3a6('0x47')]({'name':_0x1e194a[_0xa3a6('0x29')],'resourceId':_0x1e194a['id'],'type':_0x4617a3[_0xa3a6('0x29')],'sectionId':_0x4617a3['id']},{})[_0xa3a6('0x24')](function(){return _0x55b039;});}else{return _0x55b039;}})['catch'](function(_0x4a168d){logger[_0xa3a6('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a168d);throw _0x4a168d;});}return _0x55b039;})[_0xa3a6('0x24')](respondWithResult(_0x2c0112,0xc9))[_0xa3a6('0x46')](handleError(_0x2c0112,null));};exports[_0xa3a6('0x4f')]=function(_0x1f12df,_0x4f72af){if(_0x1f12df[_0xa3a6('0x48')]['id']){delete _0x1f12df['body']['id'];}return db[_0xa3a6('0x3d')][_0xa3a6('0x45')]({'where':{'id':_0x1f12df[_0xa3a6('0x40')]['id']}})[_0xa3a6('0x24')](handleEntityNotFound(_0x4f72af,null))[_0xa3a6('0x24')](saveUpdates(_0x1f12df[_0xa3a6('0x48')],null))[_0xa3a6('0x24')](respondWithResult(_0x4f72af,null))[_0xa3a6('0x46')](handleError(_0x4f72af,null));};exports[_0xa3a6('0x25')]=function(_0x35eade,_0x20ed11){return db[_0xa3a6('0x3d')][_0xa3a6('0x45')]({'where':{'id':_0x35eade['params']['id']}})[_0xa3a6('0x24')](handleEntityNotFound(_0x20ed11,null))[_0xa3a6('0x24')](removeEntity(_0x20ed11,null))[_0xa3a6('0x46')](handleError(_0x20ed11,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 91a638c..0981738 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 _0x0456=['Template','tools_templates','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x0456,0xf2));var _0x6045=function(_0x5957fe,_0x3c52ee){_0x5957fe=_0x5957fe-0x0;var _0x5ef70b=_0x0456[_0x5957fe];return _0x5ef70b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6045('0x0'))(_0x6045('0x1'));var moment=require(_0x6045('0x2'));var BPromise=require('bluebird');var rp=require(_0x6045('0x3'));var fs=require('fs');var path=require(_0x6045('0x4'));var rimraf=require(_0x6045('0x5'));var config=require(_0x6045('0x6'));var attributes=require(_0x6045('0x7'));module[_0x6045('0x8')]=function(_0x4c9d27,_0x3af6c3){return _0x4c9d27[_0x6045('0x9')](_0x6045('0xa'),attributes,{'tableName':_0x6045('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc540=['exports','Template','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x342c40,_0x596d30){var _0x12f3ca=function(_0x30e725){while(--_0x30e725){_0x342c40['push'](_0x342c40['shift']());}};_0x12f3ca(++_0x596d30);}(_0xc540,0x15a));var _0x0c54=function(_0x3f8f09,_0x8554bd){_0x3f8f09=_0x3f8f09-0x0;var _0x31bff2=_0xc540[_0x3f8f09];return _0x31bff2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c54('0x0'))(_0x0c54('0x1'));var moment=require(_0x0c54('0x2'));var BPromise=require(_0x0c54('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c54('0x4'));var rimraf=require('rimraf');var config=require(_0x0c54('0x5'));var attributes=require('./template.attributes');module[_0x0c54('0x6')]=function(_0xdfb03d,_0x2325eb){return _0xdfb03d['define'](_0x0c54('0x7'),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 9410d56..f5e7a8c 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 _0x6e7d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','raw','where','limit','include','map','model','attributes','GetTemplate','lodash','util','moment','bluebird'];(function(_0x2f71e4,_0x53d701){var _0x4b4037=function(_0x61a373){while(--_0x61a373){_0x2f71e4['push'](_0x2f71e4['shift']());}};_0x4b4037(++_0x53d701);}(_0x6e7d,0x1a0));var _0xd6e7=function(_0x3fa5f3,_0x53ccb9){_0x3fa5f3=_0x3fa5f3-0x0;var _0x450bb9=_0x6e7d[_0x3fa5f3];return _0x450bb9;};'use strict';var _=require(_0xd6e7('0x0'));var util=require(_0xd6e7('0x1'));var moment=require(_0xd6e7('0x2'));var BPromise=require(_0xd6e7('0x3'));var rs=require(_0xd6e7('0x4'));var fs=require('fs');var Redis=require(_0xd6e7('0x5'));var db=require(_0xd6e7('0x6'))['db'];var utils=require(_0xd6e7('0x7'));var logger=require(_0xd6e7('0x8'))(_0xd6e7('0x9'));var config=require(_0xd6e7('0xa'));var jayson=require(_0xd6e7('0xb'));var client=jayson[_0xd6e7('0xc')][_0xd6e7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f44fb,_0x5e1626,_0x45acb6){return new BPromise(function(_0x2e5004,_0x21460e){return client[_0xd6e7('0xe')](_0x3f44fb,_0x45acb6)[_0xd6e7('0xf')](function(_0x48d616){logger[_0xd6e7('0x10')](_0xd6e7('0x11'),_0x5e1626,_0xd6e7('0x12'));logger[_0xd6e7('0x13')](_0xd6e7('0x14'),_0x5e1626,_0xd6e7('0x12'),JSON[_0xd6e7('0x15')](_0x48d616));if(_0x48d616[_0xd6e7('0x16')]){if(_0x48d616[_0xd6e7('0x16')][_0xd6e7('0x17')]===0x1f4){logger[_0xd6e7('0x16')]('Template,\x20%s,\x20%s',_0x5e1626,_0x48d616[_0xd6e7('0x16')][_0xd6e7('0x18')]);return _0x21460e(_0x48d616[_0xd6e7('0x16')][_0xd6e7('0x18')]);}logger[_0xd6e7('0x16')](_0xd6e7('0x11'),_0x5e1626,_0x48d616[_0xd6e7('0x16')][_0xd6e7('0x18')]);return _0x2e5004(_0x48d616[_0xd6e7('0x16')]['message']);}else{logger['info'](_0xd6e7('0x11'),_0x5e1626,_0xd6e7('0x12'));_0x2e5004(_0x48d616['result'][_0xd6e7('0x18')]);}})[_0xd6e7('0x19')](function(_0x3ac94e){logger[_0xd6e7('0x16')](_0xd6e7('0x11'),_0x5e1626,_0x3ac94e);_0x21460e(_0x3ac94e);});});}exports['GetTemplate']=function(_0x43eba7){var _0x2e0f14=this;return new Promise(function(_0x3baacf,_0xa606cb){return db['Template']['findAll']({'raw':_0x43eba7[_0xd6e7('0x1a')]?_0x43eba7[_0xd6e7('0x1a')][_0xd6e7('0x1b')]===undefined?!![]:![]:!![],'where':_0x43eba7[_0xd6e7('0x1a')]?_0x43eba7['options'][_0xd6e7('0x1c')]||null:null,'attributes':_0x43eba7[_0xd6e7('0x1a')]?_0x43eba7[_0xd6e7('0x1a')]['attributes']||null:null,'limit':_0x43eba7[_0xd6e7('0x1a')]?_0x43eba7[_0xd6e7('0x1a')][_0xd6e7('0x1d')]||null:null,'include':_0x43eba7[_0xd6e7('0x1a')]?_0x43eba7['options'][_0xd6e7('0x1e')]?_[_0xd6e7('0x1f')](_0x43eba7[_0xd6e7('0x1a')][_0xd6e7('0x1e')],function(_0x37a91d){return{'model':db[_0x37a91d[_0xd6e7('0x20')]],'as':_0x37a91d['as'],'attributes':_0x37a91d[_0xd6e7('0x21')],'include':_0x37a91d[_0xd6e7('0x1e')]?_[_0xd6e7('0x1f')](_0x37a91d['include'],function(_0x3a79b8){return{'model':db[_0x3a79b8['model']],'as':_0x3a79b8['as'],'attributes':_0x3a79b8[_0xd6e7('0x21')],'include':_0x3a79b8[_0xd6e7('0x1e')]?_[_0xd6e7('0x1f')](_0x3a79b8['include'],function(_0x1deea6){return{'model':db[_0x1deea6[_0xd6e7('0x20')]],'as':_0x1deea6['as'],'attributes':_0x1deea6[_0xd6e7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xd6e7('0xf')](function(_0x59e673){logger['info'](_0xd6e7('0x22'),_0x43eba7);logger[_0xd6e7('0x13')](_0xd6e7('0x22'),_0x43eba7,JSON['stringify'](_0x59e673));_0x3baacf(_0x59e673);})[_0xd6e7('0x19')](function(_0x1979d1){logger[_0xd6e7('0x16')](_0xd6e7('0x22'),_0x1979d1[_0xd6e7('0x18')],_0x43eba7);_0xa606cb(_0x2e0f14[_0xd6e7('0x16')](0x1f4,_0x1979d1[_0xd6e7('0x18')]));});});}; \ No newline at end of file +var _0x578c=['findAll','options','where','attributes','include','model','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','GetTemplate','Template'];(function(_0x826626,_0x52bade){var _0x17e43d=function(_0xd3cb96){while(--_0xd3cb96){_0x826626['push'](_0x826626['shift']());}};_0x17e43d(++_0x52bade);}(_0x578c,0x1e8));var _0xc578=function(_0x23e504,_0x48a37b){_0x23e504=_0x23e504-0x0;var _0x1650a6=_0x578c[_0x23e504];return _0x1650a6;};'use strict';var _=require(_0xc578('0x0'));var util=require(_0xc578('0x1'));var moment=require(_0xc578('0x2'));var BPromise=require(_0xc578('0x3'));var rs=require(_0xc578('0x4'));var fs=require('fs');var Redis=require(_0xc578('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc578('0x6'));var logger=require(_0xc578('0x7'))(_0xc578('0x8'));var config=require(_0xc578('0x9'));var jayson=require(_0xc578('0xa'));var client=jayson[_0xc578('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2be6a7,_0x475daa,_0x308eb2){return new BPromise(function(_0xe8792a,_0x5b667c){return client[_0xc578('0xc')](_0x2be6a7,_0x308eb2)[_0xc578('0xd')](function(_0x2f05c0){logger[_0xc578('0xe')](_0xc578('0xf'),_0x475daa,_0xc578('0x10'));logger[_0xc578('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x475daa,_0xc578('0x10'),JSON[_0xc578('0x12')](_0x2f05c0));if(_0x2f05c0['error']){if(_0x2f05c0['error'][_0xc578('0x13')]===0x1f4){logger['error'](_0xc578('0xf'),_0x475daa,_0x2f05c0['error']['message']);return _0x5b667c(_0x2f05c0[_0xc578('0x14')][_0xc578('0x15')]);}logger[_0xc578('0x14')](_0xc578('0xf'),_0x475daa,_0x2f05c0[_0xc578('0x14')][_0xc578('0x15')]);return _0xe8792a(_0x2f05c0['error'][_0xc578('0x15')]);}else{logger[_0xc578('0xe')](_0xc578('0xf'),_0x475daa,_0xc578('0x10'));_0xe8792a(_0x2f05c0['result']['message']);}})['catch'](function(_0x688791){logger[_0xc578('0x14')](_0xc578('0xf'),_0x475daa,_0x688791);_0x5b667c(_0x688791);});});}exports[_0xc578('0x16')]=function(_0x1bd6f6){var _0x16a83c=this;return new Promise(function(_0x23aed8,_0x532824){return db[_0xc578('0x17')][_0xc578('0x18')]({'raw':_0x1bd6f6[_0xc578('0x19')]?_0x1bd6f6[_0xc578('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1bd6f6[_0xc578('0x19')]?_0x1bd6f6['options'][_0xc578('0x1a')]||null:null,'attributes':_0x1bd6f6['options']?_0x1bd6f6[_0xc578('0x19')][_0xc578('0x1b')]||null:null,'limit':_0x1bd6f6[_0xc578('0x19')]?_0x1bd6f6[_0xc578('0x19')]['limit']||null:null,'include':_0x1bd6f6[_0xc578('0x19')]?_0x1bd6f6[_0xc578('0x19')][_0xc578('0x1c')]?_['map'](_0x1bd6f6[_0xc578('0x19')][_0xc578('0x1c')],function(_0x4914a2){return{'model':db[_0x4914a2[_0xc578('0x1d')]],'as':_0x4914a2['as'],'attributes':_0x4914a2[_0xc578('0x1b')],'include':_0x4914a2[_0xc578('0x1c')]?_[_0xc578('0x1e')](_0x4914a2['include'],function(_0x35ca28){return{'model':db[_0x35ca28[_0xc578('0x1d')]],'as':_0x35ca28['as'],'attributes':_0x35ca28[_0xc578('0x1b')],'include':_0x35ca28[_0xc578('0x1c')]?_[_0xc578('0x1e')](_0x35ca28[_0xc578('0x1c')],function(_0x424f2d){return{'model':db[_0x424f2d[_0xc578('0x1d')]],'as':_0x424f2d['as'],'attributes':_0x424f2d['attributes']};}):[]};}):[]};}):[]:[]})[_0xc578('0xd')](function(_0x336481){logger[_0xc578('0xe')](_0xc578('0x16'),_0x1bd6f6);logger[_0xc578('0x11')]('GetTemplate',_0x1bd6f6,JSON[_0xc578('0x12')](_0x336481));_0x23aed8(_0x336481);})[_0xc578('0x1f')](function(_0x4d8116){logger[_0xc578('0x14')](_0xc578('0x16'),_0x4d8116['message'],_0x1bd6f6);_0x532824(_0x16a83c[_0xc578('0x14')](0x1f4,_0x4d8116[_0xc578('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 24f3531..cf166a5 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 _0x6ea1=['isAuthenticated','index','get','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./trigger.controller'];(function(_0x3c2e0c,_0x62ca5f){var _0xa67634=function(_0x7fe4b5){while(--_0x7fe4b5){_0x3c2e0c['push'](_0x3c2e0c['shift']());}};_0xa67634(++_0x62ca5f);}(_0x6ea1,0x1c2));var _0x16ea=function(_0x1e4dc7,_0x17d571){_0x1e4dc7=_0x1e4dc7-0x0;var _0xa67384=_0x6ea1[_0x1e4dc7];return _0xa67384;};'use strict';var multer=require(_0x16ea('0x0'));var util=require(_0x16ea('0x1'));var path=require(_0x16ea('0x2'));var timeout=require(_0x16ea('0x3'));var express=require(_0x16ea('0x4'));var router=express[_0x16ea('0x5')]();var fs_extra=require(_0x16ea('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x16ea('0x7'));var controller=require(_0x16ea('0x8'));router['get']('/',auth[_0x16ea('0x9')](),controller[_0x16ea('0xa')]);router[_0x16ea('0xb')](_0x16ea('0xc'),auth[_0x16ea('0x9')](),controller['show']);router[_0x16ea('0xb')](_0x16ea('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x16ea('0xb')](_0x16ea('0xe'),auth[_0x16ea('0x9')](),controller[_0x16ea('0xf')]);router['get'](_0x16ea('0x10'),auth[_0x16ea('0x9')](),controller['getActions']);router[_0x16ea('0x11')]('/',auth['isAuthenticated'](),controller[_0x16ea('0x12')]);router[_0x16ea('0x11')](_0x16ea('0xd'),auth[_0x16ea('0x9')](),controller[_0x16ea('0x13')]);router[_0x16ea('0x11')](_0x16ea('0xe'),auth[_0x16ea('0x9')](),controller[_0x16ea('0x14')]);router[_0x16ea('0x11')]('/:id/actions',auth[_0x16ea('0x9')](),controller[_0x16ea('0x15')]);router[_0x16ea('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x16ea('0x17')]);router[_0x16ea('0x18')]('/:id',auth[_0x16ea('0x9')](),controller[_0x16ea('0x19')]);module[_0x16ea('0x1a')]=router; \ No newline at end of file +var _0x4965=['/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show'];(function(_0x4eefe6,_0x1202ce){var _0x22b387=function(_0xb34c64){while(--_0xb34c64){_0x4eefe6['push'](_0x4eefe6['shift']());}};_0x22b387(++_0x1202ce);}(_0x4965,0x16e));var _0x5496=function(_0xec74fe,_0x2dce88){_0xec74fe=_0xec74fe-0x0;var _0x50bda2=_0x4965[_0xec74fe];return _0x50bda2;};'use strict';var multer=require(_0x5496('0x0'));var util=require(_0x5496('0x1'));var path=require(_0x5496('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5496('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5496('0x4'));var config=require(_0x5496('0x5'));var controller=require(_0x5496('0x6'));router['get']('/',auth[_0x5496('0x7')](),controller[_0x5496('0x8')]);router[_0x5496('0x9')](_0x5496('0xa'),auth['isAuthenticated'](),controller[_0x5496('0xb')]);router['get'](_0x5496('0xc'),auth[_0x5496('0x7')](),controller[_0x5496('0xd')]);router['get'](_0x5496('0xe'),auth[_0x5496('0x7')](),controller[_0x5496('0xf')]);router[_0x5496('0x9')](_0x5496('0x10'),auth[_0x5496('0x7')](),controller[_0x5496('0x11')]);router[_0x5496('0x12')]('/',auth[_0x5496('0x7')](),controller[_0x5496('0x13')]);router[_0x5496('0x12')](_0x5496('0xc'),auth[_0x5496('0x7')](),controller[_0x5496('0x14')]);router[_0x5496('0x12')]('/:id/any_conditions',auth[_0x5496('0x7')](),controller[_0x5496('0x15')]);router[_0x5496('0x12')](_0x5496('0x10'),auth[_0x5496('0x7')](),controller[_0x5496('0x16')]);router[_0x5496('0x17')](_0x5496('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x5496('0x18')](_0x5496('0xa'),auth[_0x5496('0x7')](),controller[_0x5496('0x19')]);module[_0x5496('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 5a23669..71f6a6e 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 _0x2542=['sequelize','STRING','BOOLEAN'];(function(_0x81249a,_0x23f625){var _0x2d7204=function(_0x417aaf){while(--_0x417aaf){_0x81249a['push'](_0x81249a['shift']());}};_0x2d7204(++_0x23f625);}(_0x2542,0x16e));var _0x2254=function(_0x5eec4c,_0x45b1bd){_0x5eec4c=_0x5eec4c-0x0;var _0x46ba52=_0x2542[_0x5eec4c];return _0x46ba52;};'use strict';var Sequelize=require(_0x2254('0x0'));module['exports']={'name':{'type':Sequelize[_0x2254('0x1')]},'channel':{'type':Sequelize[_0x2254('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2254('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xf504=['STRING'];(function(_0x526bf5,_0x1ad107){var _0x209214=function(_0x280bf9){while(--_0x280bf9){_0x526bf5['push'](_0x526bf5['shift']());}};_0x209214(++_0x1ad107);}(_0xf504,0x101));var _0x4f50=function(_0x114dae,_0xb2342d){_0x114dae=_0x114dae-0x0;var _0x3e4ace=_0xf504[_0x114dae];return _0x3e4ace;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4f50('0x0')]},'description':{'type':Sequelize[_0x4f50('0x0')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index e89d084..68cff8d 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 _0x52c4=['TriggerId','Action','getActions','findOne','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','UserProfileResource','sendStatus','error','name','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','Trigger','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Triggers','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','pick','getAnyConditions','addAction'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0x52c4,0x184));var _0x452c=function(_0x7ea24a,_0x51d2e3){_0x7ea24a=_0x7ea24a-0x0;var _0x3b5e7f=_0x52c4[_0x7ea24a];return _0x3b5e7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x452c('0x0'));var zipdir=require(_0x452c('0x1'));var jsonpatch=require(_0x452c('0x2'));var rp=require(_0x452c('0x3'));var moment=require(_0x452c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x452c('0x5'));var util=require('util');var path=require(_0x452c('0x6'));var sox=require(_0x452c('0x7'));var csv=require(_0x452c('0x8'));var ejs=require(_0x452c('0x9'));var fs=require('fs');var fs_extra=require(_0x452c('0xa'));var _=require(_0x452c('0xb'));var squel=require('squel');var crypto=require(_0x452c('0xc'));var jsforce=require(_0x452c('0xd'));var deskjs=require(_0x452c('0xe'));var toCsv=require(_0x452c('0x8'));var querystring=require(_0x452c('0xf'));var Papa=require(_0x452c('0x10'));var Redis=require(_0x452c('0x11'));var authService=require(_0x452c('0x12'));var qs=require(_0x452c('0x13'));var as=require(_0x452c('0x14'));var hardwareService=require(_0x452c('0x15'));var logger=require(_0x452c('0x16'))(_0x452c('0x17'));var utils=require(_0x452c('0x18'));var config=require(_0x452c('0x19'));var licenseUtil=require(_0x452c('0x1a'));var db=require(_0x452c('0x1b'))['db'];function respondWithStatusCode(_0x229050,_0x3108cd){_0x3108cd=_0x3108cd||0xcc;return function(_0x55a965){if(_0x55a965){return _0x229050['sendStatus'](_0x3108cd);}return _0x229050['status'](_0x3108cd)[_0x452c('0x1c')]();};}function respondWithResult(_0x304551,_0x46718c){_0x46718c=_0x46718c||0xc8;return function(_0x56fe74){if(_0x56fe74){return _0x304551[_0x452c('0x1d')](_0x46718c)['json'](_0x56fe74);}};}function respondWithFilteredResult(_0x228b51,_0x44d0a4){return function(_0xa14a13){if(_0xa14a13){var _0x1c94a9=typeof _0x44d0a4[_0x452c('0x1e')]===_0x452c('0x1f')&&typeof _0x44d0a4[_0x452c('0x20')]===_0x452c('0x1f');var _0x30f462=_0xa14a13['count'];var _0x422993=_0x1c94a9?0x0:_0x44d0a4[_0x452c('0x1e')];var _0xe25321=_0x1c94a9?_0xa14a13[_0x452c('0x21')]:_0x44d0a4[_0x452c('0x1e')]+_0x44d0a4[_0x452c('0x20')];var _0x70658e;if(_0xe25321>=_0x30f462){_0xe25321=_0x30f462;_0x70658e=0xc8;}else{_0x70658e=0xce;}_0x228b51['status'](_0x70658e);return _0x228b51[_0x452c('0x22')](_0x452c('0x23'),_0x422993+'-'+_0xe25321+'/'+_0x30f462)['json'](_0xa14a13);}return null;};}function patchUpdates(_0x4bea11){return function(_0x124bef){try{jsonpatch[_0x452c('0x24')](_0x124bef,_0x4bea11,!![]);}catch(_0x128ef1){return BPromise['reject'](_0x128ef1);}return _0x124bef[_0x452c('0x25')]();};}function saveUpdates(_0x58c6bd,_0x48bb98){return function(_0x309b01){if(_0x309b01){return _0x309b01['update'](_0x58c6bd)[_0x452c('0x26')](function(_0x2d1a45){return _0x2d1a45;});}return null;};}function removeEntity(_0x4687d3,_0x72cf37){return function(_0x30d223){if(_0x30d223){return _0x30d223[_0x452c('0x27')]()[_0x452c('0x26')](function(){var _0x40df14=_0x30d223['get']({'plain':!![]});var _0x39e107='Triggers';return db[_0x452c('0x28')][_0x452c('0x27')]({'where':{'type':_0x39e107,'resourceId':_0x40df14['id']}})[_0x452c('0x26')](function(){return _0x30d223;});})['then'](function(){_0x4687d3[_0x452c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13be15,_0x1cf4e8){return function(_0x1c7c0d){if(!_0x1c7c0d){_0x13be15[_0x452c('0x29')](0x194);}return _0x1c7c0d;};}function handleError(_0x5773ed,_0x5e696c){_0x5e696c=_0x5e696c||0x1f4;return function(_0xe2c69e){logger[_0x452c('0x2a')](_0xe2c69e['stack']);if(_0xe2c69e[_0x452c('0x2b')]){delete _0xe2c69e[_0x452c('0x2b')];}_0x5773ed['status'](_0x5e696c)['send'](_0xe2c69e);};}exports['index']=function(_0x134652,_0x33b47d){var _0x58d04b={},_0x2e3ca6={},_0x5e4841={'count':0x0,'rows':[]};var _0x1d9be4=_[_0x452c('0x2c')](db['Trigger'][_0x452c('0x2d')],function(_0x19c74e){return{'name':_0x19c74e[_0x452c('0x2e')],'type':_0x19c74e[_0x452c('0x2f')]['key']};});_0x2e3ca6['model']=_[_0x452c('0x2c')](_0x1d9be4,_0x452c('0x2b'));_0x2e3ca6[_0x452c('0x30')]=_[_0x452c('0x31')](_0x134652[_0x452c('0x30')]);_0x2e3ca6[_0x452c('0x32')]=_[_0x452c('0x33')](_0x2e3ca6[_0x452c('0x34')],_0x2e3ca6['query']);_0x58d04b[_0x452c('0x35')]=_[_0x452c('0x33')](_0x2e3ca6[_0x452c('0x34')],qs[_0x452c('0x36')](_0x134652['query']['fields']));_0x58d04b[_0x452c('0x35')]=_0x58d04b[_0x452c('0x35')][_0x452c('0x37')]?_0x58d04b[_0x452c('0x35')]:_0x2e3ca6[_0x452c('0x34')];if(!_0x134652[_0x452c('0x30')][_0x452c('0x38')](_0x452c('0x39'))){_0x58d04b[_0x452c('0x20')]=qs[_0x452c('0x20')](_0x134652[_0x452c('0x30')][_0x452c('0x20')]);_0x58d04b[_0x452c('0x1e')]=qs[_0x452c('0x1e')](_0x134652['query'][_0x452c('0x1e')]);}_0x58d04b[_0x452c('0x3a')]=qs['sort'](_0x134652[_0x452c('0x30')][_0x452c('0x3b')]);_0x58d04b[_0x452c('0x3c')]=qs[_0x452c('0x32')](_['pick'](_0x134652['query'],_0x2e3ca6['filters']),_0x1d9be4);if(_0x134652[_0x452c('0x30')][_0x452c('0x3d')]){_0x58d04b[_0x452c('0x3c')]=_[_0x452c('0x3e')](_0x58d04b['where'],{'$or':_[_0x452c('0x2c')](_0x1d9be4,function(_0x21d193){if(_0x21d193[_0x452c('0x2f')]!==_0x452c('0x3f')){var _0x25ecd0={};_0x25ecd0[_0x21d193[_0x452c('0x2b')]]={'$like':'%'+_0x134652[_0x452c('0x30')][_0x452c('0x3d')]+'%'};return _0x25ecd0;}})});}_0x58d04b=_['merge']({},_0x58d04b,_0x134652[_0x452c('0x40')]);var _0x942e91={'where':_0x58d04b[_0x452c('0x3c')]};return db['Trigger'][_0x452c('0x21')](_0x942e91)['then'](function(_0x26c95f){_0x5e4841[_0x452c('0x21')]=_0x26c95f;if(_0x134652[_0x452c('0x30')][_0x452c('0x41')]){_0x58d04b[_0x452c('0x42')]=[{'all':!![]}];}return db['Trigger'][_0x452c('0x43')](_0x58d04b);})['then'](function(_0x5a4428){_0x5e4841[_0x452c('0x44')]=_0x5a4428;return _0x5e4841;})[_0x452c('0x26')](respondWithFilteredResult(_0x33b47d,_0x58d04b))[_0x452c('0x45')](handleError(_0x33b47d,null));};exports[_0x452c('0x46')]=function(_0x2c7330,_0x219e44){var _0x4045eb={'raw':![],'where':{'id':_0x2c7330['params']['id']}},_0xfc4a72={};_0xfc4a72['model']=_[_0x452c('0x31')](db[_0x452c('0x47')][_0x452c('0x2d')]);_0xfc4a72['query']=_[_0x452c('0x31')](_0x2c7330[_0x452c('0x30')]);_0xfc4a72[_0x452c('0x32')]=_[_0x452c('0x33')](_0xfc4a72[_0x452c('0x34')],_0xfc4a72['query']);_0x4045eb[_0x452c('0x35')]=_[_0x452c('0x33')](_0xfc4a72[_0x452c('0x34')],qs[_0x452c('0x36')](_0x2c7330[_0x452c('0x30')][_0x452c('0x36')]));_0x4045eb[_0x452c('0x35')]=_0x4045eb['attributes']['length']?_0x4045eb['attributes']:_0xfc4a72[_0x452c('0x34')];if(_0x2c7330['query'][_0x452c('0x41')]){_0x4045eb[_0x452c('0x42')]=[{'all':!![]}];}_0x4045eb=_[_0x452c('0x3e')]({},_0x4045eb,_0x2c7330[_0x452c('0x40')]);return db['Trigger'][_0x452c('0x48')](_0x4045eb)[_0x452c('0x26')](handleEntityNotFound(_0x219e44,null))[_0x452c('0x26')](respondWithResult(_0x219e44,null))[_0x452c('0x45')](handleError(_0x219e44,null));};exports[_0x452c('0x49')]=function(_0x1a6ff4,_0x50f655){return db[_0x452c('0x47')][_0x452c('0x49')](_0x1a6ff4[_0x452c('0x4a')],{})[_0x452c('0x26')](function(_0x5ca336){var _0xfa5cc=_0x1a6ff4[_0x452c('0x4b')][_0x452c('0x4c')]({'plain':!![]});if(!_0xfa5cc)throw new Error(_0x452c('0x4d'));if(_0xfa5cc['role']===_0x452c('0x4b')){var _0xed3db8=_0x5ca336[_0x452c('0x4c')]({'plain':!![]});var _0x2e4b31=_0x452c('0x4e');return db[_0x452c('0x4f')][_0x452c('0x48')]({'where':{'name':_0x2e4b31,'userProfileId':_0xfa5cc[_0x452c('0x50')]},'raw':!![]})['then'](function(_0x21817f){if(_0x21817f&&_0x21817f[_0x452c('0x51')]===0x0){return db[_0x452c('0x28')][_0x452c('0x49')]({'name':_0xed3db8[_0x452c('0x2b')],'resourceId':_0xed3db8['id'],'type':_0x21817f['name'],'sectionId':_0x21817f['id']},{})[_0x452c('0x26')](function(){return _0x5ca336;});}else{return _0x5ca336;}})[_0x452c('0x45')](function(_0x2f2386){logger[_0x452c('0x2a')](_0x452c('0x52'),_0x2f2386);throw _0x2f2386;});}return _0x5ca336;})['then'](respondWithResult(_0x50f655,0xc9))['catch'](handleError(_0x50f655,null));};exports['update']=function(_0x37dde5,_0xb004fd){if(_0x37dde5[_0x452c('0x4a')]['id']){delete _0x37dde5[_0x452c('0x4a')]['id'];}return db[_0x452c('0x47')]['find']({'where':{'id':_0x37dde5[_0x452c('0x53')]['id']}})[_0x452c('0x26')](handleEntityNotFound(_0xb004fd,null))[_0x452c('0x26')](saveUpdates(_0x37dde5[_0x452c('0x4a')],null))[_0x452c('0x26')](respondWithResult(_0xb004fd,null))[_0x452c('0x45')](handleError(_0xb004fd,null));};exports['destroy']=function(_0x4253a4,_0x186682){return db[_0x452c('0x47')][_0x452c('0x48')]({'where':{'id':_0x4253a4[_0x452c('0x53')]['id']}})[_0x452c('0x26')](handleEntityNotFound(_0x186682,null))[_0x452c('0x26')](removeEntity(_0x186682,null))[_0x452c('0x45')](handleError(_0x186682,null));};exports[_0x452c('0x54')]=function(_0x2c3a67,_0x29d7f2,_0x1c36f0){if(_0x2c3a67[_0x452c('0x4a')]['id']){delete _0x2c3a67['body']['id'];}return db[_0x452c('0x47')]['find']({'where':{'id':_0x2c3a67[_0x452c('0x53')]['id']}})[_0x452c('0x26')](handleEntityNotFound(_0x29d7f2,null))[_0x452c('0x26')](function(_0x4956ab){if(_0x4956ab){_0x2c3a67[_0x452c('0x4a')]['TriggerAllId']=_0x4956ab['id'];return db['Condition'][_0x452c('0x49')](_0x2c3a67['body']);}})['then'](respondWithResult(_0x29d7f2,null))[_0x452c('0x45')](handleError(_0x29d7f2,null));};exports[_0x452c('0x55')]=function(_0x55a209,_0x252d61,_0x3d5766){if(_0x55a209['body']['id']){delete _0x55a209[_0x452c('0x4a')]['id'];}return db[_0x452c('0x47')]['find']({'where':{'id':_0x55a209[_0x452c('0x53')]['id']}})['then'](handleEntityNotFound(_0x252d61,null))[_0x452c('0x26')](function(_0x2c1b15){if(_0x2c1b15){_0x55a209[_0x452c('0x4a')][_0x452c('0x56')]=_0x2c1b15['id'];return db[_0x452c('0x57')]['create'](_0x55a209[_0x452c('0x4a')]);}})[_0x452c('0x26')](respondWithResult(_0x252d61,null))[_0x452c('0x45')](handleError(_0x252d61,null));};exports[_0x452c('0x58')]=function(_0x17acb8,_0x9d2792,_0x5c3f32){var _0x3e4ebb={};var _0xac96a3={};var _0xa50f96;var _0x12daae;return db[_0x452c('0x47')]['findOne']({'where':{'id':_0x17acb8['params']['id']}})[_0x452c('0x26')](handleEntityNotFound(_0x9d2792,null))[_0x452c('0x26')](function(_0x1c06c2){if(_0x1c06c2){_0xa50f96=_0x1c06c2;_0xac96a3[_0x452c('0x34')]=_['keys'](db['Condition'][_0x452c('0x2d')]);_0xac96a3[_0x452c('0x30')]=_[_0x452c('0x31')](_0x17acb8[_0x452c('0x30')]);_0xac96a3[_0x452c('0x32')]=_[_0x452c('0x33')](_0xac96a3[_0x452c('0x34')],_0xac96a3['query']);_0x3e4ebb[_0x452c('0x35')]=_[_0x452c('0x33')](_0xac96a3[_0x452c('0x34')],qs['fields'](_0x17acb8[_0x452c('0x30')][_0x452c('0x36')]));_0x3e4ebb['attributes']=_0x3e4ebb[_0x452c('0x35')][_0x452c('0x37')]?_0x3e4ebb[_0x452c('0x35')]:_0xac96a3[_0x452c('0x34')];_0x3e4ebb['order']=qs[_0x452c('0x3b')](_0x17acb8[_0x452c('0x30')]['sort']);_0x3e4ebb[_0x452c('0x3c')]=qs[_0x452c('0x32')](_[_0x452c('0x59')](_0x17acb8[_0x452c('0x30')],_0xac96a3[_0x452c('0x32')]));if(_0x17acb8[_0x452c('0x30')]['filter']){_0x3e4ebb[_0x452c('0x3c')]=_['merge'](_0x3e4ebb[_0x452c('0x3c')],{'$or':_[_0x452c('0x2c')](_0x3e4ebb[_0x452c('0x35')],function(_0x21eee2){var _0x595489={};_0x595489[_0x21eee2]={'$like':'%'+_0x17acb8[_0x452c('0x30')][_0x452c('0x3d')]+'%'};return _0x595489;})});}_0x3e4ebb=_['merge']({},_0x3e4ebb,_0x17acb8[_0x452c('0x40')]);return _0xa50f96['getAllConditions'](_0x3e4ebb);}})[_0x452c('0x26')](function(_0x1a7334){if(_0x1a7334){_0x12daae=_0x1a7334['length'];if(!_0x17acb8['query']['hasOwnProperty'](_0x452c('0x39'))){_0x3e4ebb[_0x452c('0x20')]=qs[_0x452c('0x20')](_0x17acb8['query']['limit']);_0x3e4ebb[_0x452c('0x1e')]=qs[_0x452c('0x1e')](_0x17acb8[_0x452c('0x30')][_0x452c('0x1e')]);}return _0xa50f96[_0x452c('0x58')](_0x3e4ebb);}})[_0x452c('0x26')](function(_0x29777d){if(_0x29777d){return _0x29777d?{'count':_0x12daae,'rows':_0x29777d}:null;}})[_0x452c('0x26')](respondWithResult(_0x9d2792,null))['catch'](handleError(_0x9d2792,null));};exports[_0x452c('0x5a')]=function(_0x4ea11e,_0x2c80d3,_0x1f916f){var _0x33b7d3={};var _0x2ba06a={};var _0x26d688;var _0x22455f;return db[_0x452c('0x47')]['findOne']({'where':{'id':_0x4ea11e['params']['id']}})[_0x452c('0x26')](handleEntityNotFound(_0x2c80d3,null))[_0x452c('0x26')](function(_0x16f670){if(_0x16f670){_0x26d688=_0x16f670;_0x2ba06a['model']=_[_0x452c('0x31')](db[_0x452c('0x57')][_0x452c('0x2d')]);_0x2ba06a['query']=_[_0x452c('0x31')](_0x4ea11e[_0x452c('0x30')]);_0x2ba06a['filters']=_['intersection'](_0x2ba06a[_0x452c('0x34')],_0x2ba06a['query']);_0x33b7d3['attributes']=_[_0x452c('0x33')](_0x2ba06a[_0x452c('0x34')],qs[_0x452c('0x36')](_0x4ea11e[_0x452c('0x30')][_0x452c('0x36')]));_0x33b7d3[_0x452c('0x35')]=_0x33b7d3[_0x452c('0x35')][_0x452c('0x37')]?_0x33b7d3[_0x452c('0x35')]:_0x2ba06a[_0x452c('0x34')];_0x33b7d3[_0x452c('0x3a')]=qs['sort'](_0x4ea11e[_0x452c('0x30')][_0x452c('0x3b')]);_0x33b7d3[_0x452c('0x3c')]=qs[_0x452c('0x32')](_['pick'](_0x4ea11e[_0x452c('0x30')],_0x2ba06a[_0x452c('0x32')]));if(_0x4ea11e[_0x452c('0x30')]['filter']){_0x33b7d3[_0x452c('0x3c')]=_[_0x452c('0x3e')](_0x33b7d3[_0x452c('0x3c')],{'$or':_[_0x452c('0x2c')](_0x33b7d3[_0x452c('0x35')],function(_0x30a972){var _0x3f5a76={};_0x3f5a76[_0x30a972]={'$like':'%'+_0x4ea11e[_0x452c('0x30')][_0x452c('0x3d')]+'%'};return _0x3f5a76;})});}_0x33b7d3=_['merge']({},_0x33b7d3,_0x4ea11e[_0x452c('0x40')]);return _0x26d688[_0x452c('0x5a')](_0x33b7d3);}})[_0x452c('0x26')](function(_0x1fc1bd){if(_0x1fc1bd){_0x22455f=_0x1fc1bd[_0x452c('0x37')];if(!_0x4ea11e['query'][_0x452c('0x38')](_0x452c('0x39'))){_0x33b7d3[_0x452c('0x20')]=qs['limit'](_0x4ea11e[_0x452c('0x30')][_0x452c('0x20')]);_0x33b7d3['offset']=qs[_0x452c('0x1e')](_0x4ea11e[_0x452c('0x30')][_0x452c('0x1e')]);}return _0x26d688['getAnyConditions'](_0x33b7d3);}})[_0x452c('0x26')](function(_0x56070a){if(_0x56070a){return _0x56070a?{'count':_0x22455f,'rows':_0x56070a}:null;}})['then'](respondWithResult(_0x2c80d3,null))[_0x452c('0x45')](handleError(_0x2c80d3,null));};exports[_0x452c('0x5b')]=function(_0x523ab1,_0xc5d514,_0x6fef63){if(_0x523ab1[_0x452c('0x4a')]['id']){delete _0x523ab1[_0x452c('0x4a')]['id'];}return db[_0x452c('0x47')][_0x452c('0x48')]({'where':{'id':_0x523ab1[_0x452c('0x53')]['id']}})[_0x452c('0x26')](handleEntityNotFound(_0xc5d514,null))['then'](function(_0x5846c9){if(_0x5846c9){_0x523ab1['body'][_0x452c('0x5c')]=_0x5846c9['id'];return db[_0x452c('0x5d')]['create'](_0x523ab1[_0x452c('0x4a')]);}})[_0x452c('0x26')](respondWithResult(_0xc5d514,null))[_0x452c('0x45')](handleError(_0xc5d514,null));};exports[_0x452c('0x5e')]=function(_0x42addf,_0x201e54,_0x169b8b){var _0x1109cf={};var _0x473246={};var _0x535530;var _0x20348b;return db[_0x452c('0x47')][_0x452c('0x5f')]({'where':{'id':_0x42addf['params']['id']}})['then'](handleEntityNotFound(_0x201e54,null))[_0x452c('0x26')](function(_0x27c2fd){if(_0x27c2fd){_0x535530=_0x27c2fd;_0x473246['model']=_[_0x452c('0x31')](db['Action'][_0x452c('0x2d')]);_0x473246[_0x452c('0x30')]=_['keys'](_0x42addf[_0x452c('0x30')]);_0x473246['filters']=_[_0x452c('0x33')](_0x473246[_0x452c('0x34')],_0x473246[_0x452c('0x30')]);_0x1109cf[_0x452c('0x35')]=_['intersection'](_0x473246[_0x452c('0x34')],qs[_0x452c('0x36')](_0x42addf[_0x452c('0x30')][_0x452c('0x36')]));_0x1109cf[_0x452c('0x35')]=_0x1109cf[_0x452c('0x35')][_0x452c('0x37')]?_0x1109cf[_0x452c('0x35')]:_0x473246[_0x452c('0x34')];_0x1109cf['order']=qs[_0x452c('0x3b')](_0x42addf[_0x452c('0x30')]['sort']);_0x1109cf['where']=qs[_0x452c('0x32')](_[_0x452c('0x59')](_0x42addf[_0x452c('0x30')],_0x473246[_0x452c('0x32')]));if(_0x42addf['query']['filter']){_0x1109cf['where']=_[_0x452c('0x3e')](_0x1109cf[_0x452c('0x3c')],{'$or':_[_0x452c('0x2c')](_0x1109cf[_0x452c('0x35')],function(_0x13e8c2){var _0x5aeae2={};_0x5aeae2[_0x13e8c2]={'$like':'%'+_0x42addf[_0x452c('0x30')]['filter']+'%'};return _0x5aeae2;})});}_0x1109cf=_['merge']({},_0x1109cf,_0x42addf['options']);return _0x535530[_0x452c('0x5e')](_0x1109cf);}})['then'](function(_0xfa0589){if(_0xfa0589){_0x20348b=_0xfa0589[_0x452c('0x37')];if(!_0x42addf[_0x452c('0x30')][_0x452c('0x38')](_0x452c('0x39'))){_0x1109cf[_0x452c('0x20')]=qs[_0x452c('0x20')](_0x42addf[_0x452c('0x30')][_0x452c('0x20')]);_0x1109cf[_0x452c('0x1e')]=qs[_0x452c('0x1e')](_0x42addf[_0x452c('0x30')]['offset']);}return _0x535530['getActions'](_0x1109cf);}})[_0x452c('0x26')](function(_0x9c439b){if(_0x9c439b){return _0x9c439b?{'count':_0x20348b,'rows':_0x9c439b}:null;}})[_0x452c('0x26')](respondWithResult(_0x201e54,null))[_0x452c('0x45')](handleError(_0x201e54,null));}; \ No newline at end of file +var _0x6fb2=['rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','addAction','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','sendStatus','error','name','send','index','map','Trigger'];(function(_0x1cfa06,_0x375be9){var _0x32d79b=function(_0x5d180c){while(--_0x5d180c){_0x1cfa06['push'](_0x1cfa06['shift']());}};_0x32d79b(++_0x375be9);}(_0x6fb2,0xf2));var _0x26fb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6fb2[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x26fb('0x0'));var jsonpatch=require(_0x26fb('0x1'));var rp=require(_0x26fb('0x2'));var moment=require(_0x26fb('0x3'));var BPromise=require(_0x26fb('0x4'));var Mustache=require(_0x26fb('0x5'));var util=require('util');var path=require(_0x26fb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x26fb('0x7'));var fs=require('fs');var fs_extra=require(_0x26fb('0x8'));var _=require(_0x26fb('0x9'));var squel=require(_0x26fb('0xa'));var crypto=require(_0x26fb('0xb'));var jsforce=require(_0x26fb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x26fb('0xd'));var querystring=require(_0x26fb('0xe'));var Papa=require(_0x26fb('0xf'));var Redis=require(_0x26fb('0x10'));var authService=require(_0x26fb('0x11'));var qs=require(_0x26fb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26fb('0x13'));var logger=require(_0x26fb('0x14'))(_0x26fb('0x15'));var utils=require(_0x26fb('0x16'));var config=require(_0x26fb('0x17'));var licenseUtil=require(_0x26fb('0x18'));var db=require(_0x26fb('0x19'))['db'];function respondWithStatusCode(_0x11660a,_0x24824d){_0x24824d=_0x24824d||0xcc;return function(_0x56da30){if(_0x56da30){return _0x11660a['sendStatus'](_0x24824d);}return _0x11660a[_0x26fb('0x1a')](_0x24824d)[_0x26fb('0x1b')]();};}function respondWithResult(_0x405dcb,_0x48dfee){_0x48dfee=_0x48dfee||0xc8;return function(_0x54487c){if(_0x54487c){return _0x405dcb[_0x26fb('0x1a')](_0x48dfee)[_0x26fb('0x1c')](_0x54487c);}};}function respondWithFilteredResult(_0x22a01c,_0x30117f){return function(_0x4a20f0){if(_0x4a20f0){var _0xe90423=typeof _0x30117f[_0x26fb('0x1d')]===_0x26fb('0x1e')&&typeof _0x30117f['limit']==='undefined';var _0xde5bbb=_0x4a20f0[_0x26fb('0x1f')];var _0x315bfb=_0xe90423?0x0:_0x30117f[_0x26fb('0x1d')];var _0x1e1977=_0xe90423?_0x4a20f0[_0x26fb('0x1f')]:_0x30117f[_0x26fb('0x1d')]+_0x30117f['limit'];var _0x1b108d;if(_0x1e1977>=_0xde5bbb){_0x1e1977=_0xde5bbb;_0x1b108d=0xc8;}else{_0x1b108d=0xce;}_0x22a01c['status'](_0x1b108d);return _0x22a01c[_0x26fb('0x20')](_0x26fb('0x21'),_0x315bfb+'-'+_0x1e1977+'/'+_0xde5bbb)[_0x26fb('0x1c')](_0x4a20f0);}return null;};}function patchUpdates(_0x56c27f){return function(_0x2897ec){try{jsonpatch[_0x26fb('0x22')](_0x2897ec,_0x56c27f,!![]);}catch(_0x314711){return BPromise[_0x26fb('0x23')](_0x314711);}return _0x2897ec[_0x26fb('0x24')]();};}function saveUpdates(_0x4305de,_0x2c5826){return function(_0x2baf31){if(_0x2baf31){return _0x2baf31[_0x26fb('0x25')](_0x4305de)[_0x26fb('0x26')](function(_0x43cfba){return _0x43cfba;});}return null;};}function removeEntity(_0x49470b,_0x3a15fa){return function(_0x472af0){if(_0x472af0){return _0x472af0[_0x26fb('0x27')]()[_0x26fb('0x26')](function(){var _0x3ff088=_0x472af0['get']({'plain':!![]});var _0x5b0fc7=_0x26fb('0x28');return db[_0x26fb('0x29')][_0x26fb('0x27')]({'where':{'type':_0x5b0fc7,'resourceId':_0x3ff088['id']}})[_0x26fb('0x26')](function(){return _0x472af0;});})[_0x26fb('0x26')](function(){_0x49470b[_0x26fb('0x1a')](0xcc)[_0x26fb('0x1b')]();});}};}function handleEntityNotFound(_0x2765bd,_0x257529){return function(_0x35227c){if(!_0x35227c){_0x2765bd[_0x26fb('0x2a')](0x194);}return _0x35227c;};}function handleError(_0x321cf4,_0x2ed082){_0x2ed082=_0x2ed082||0x1f4;return function(_0x57b20a){logger[_0x26fb('0x2b')](_0x57b20a['stack']);if(_0x57b20a['name']){delete _0x57b20a[_0x26fb('0x2c')];}_0x321cf4[_0x26fb('0x1a')](_0x2ed082)[_0x26fb('0x2d')](_0x57b20a);};}exports[_0x26fb('0x2e')]=function(_0x3ea7eb,_0x194a32){var _0x1977ad={},_0x376c84={},_0x562752={'count':0x0,'rows':[]};var _0x1e7a73=_[_0x26fb('0x2f')](db[_0x26fb('0x30')][_0x26fb('0x31')],function(_0x2c6b68){return{'name':_0x2c6b68[_0x26fb('0x32')],'type':_0x2c6b68[_0x26fb('0x33')]['key']};});_0x376c84[_0x26fb('0x34')]=_['map'](_0x1e7a73,_0x26fb('0x2c'));_0x376c84['query']=_[_0x26fb('0x35')](_0x3ea7eb[_0x26fb('0x36')]);_0x376c84[_0x26fb('0x37')]=_[_0x26fb('0x38')](_0x376c84[_0x26fb('0x34')],_0x376c84['query']);_0x1977ad['attributes']=_[_0x26fb('0x38')](_0x376c84[_0x26fb('0x34')],qs[_0x26fb('0x39')](_0x3ea7eb[_0x26fb('0x36')]['fields']));_0x1977ad[_0x26fb('0x3a')]=_0x1977ad[_0x26fb('0x3a')][_0x26fb('0x3b')]?_0x1977ad[_0x26fb('0x3a')]:_0x376c84[_0x26fb('0x34')];if(!_0x3ea7eb[_0x26fb('0x36')][_0x26fb('0x3c')](_0x26fb('0x3d'))){_0x1977ad['limit']=qs['limit'](_0x3ea7eb[_0x26fb('0x36')][_0x26fb('0x3e')]);_0x1977ad[_0x26fb('0x1d')]=qs[_0x26fb('0x1d')](_0x3ea7eb[_0x26fb('0x36')][_0x26fb('0x1d')]);}_0x1977ad[_0x26fb('0x3f')]=qs[_0x26fb('0x40')](_0x3ea7eb['query'][_0x26fb('0x40')]);_0x1977ad['where']=qs['filters'](_[_0x26fb('0x41')](_0x3ea7eb[_0x26fb('0x36')],_0x376c84[_0x26fb('0x37')]),_0x1e7a73);if(_0x3ea7eb[_0x26fb('0x36')][_0x26fb('0x42')]){_0x1977ad[_0x26fb('0x43')]=_[_0x26fb('0x44')](_0x1977ad['where'],{'$or':_[_0x26fb('0x2f')](_0x1e7a73,function(_0x40851e){if(_0x40851e[_0x26fb('0x33')]!=='VIRTUAL'){var _0x14da36={};_0x14da36[_0x40851e[_0x26fb('0x2c')]]={'$like':'%'+_0x3ea7eb[_0x26fb('0x36')][_0x26fb('0x42')]+'%'};return _0x14da36;}})});}_0x1977ad=_[_0x26fb('0x44')]({},_0x1977ad,_0x3ea7eb[_0x26fb('0x45')]);var _0x1027b2={'where':_0x1977ad[_0x26fb('0x43')]};return db[_0x26fb('0x30')][_0x26fb('0x1f')](_0x1027b2)[_0x26fb('0x26')](function(_0x3006dd){_0x562752[_0x26fb('0x1f')]=_0x3006dd;if(_0x3ea7eb[_0x26fb('0x36')][_0x26fb('0x46')]){_0x1977ad['include']=[{'all':!![]}];}return db[_0x26fb('0x30')][_0x26fb('0x47')](_0x1977ad);})[_0x26fb('0x26')](function(_0x213975){_0x562752[_0x26fb('0x48')]=_0x213975;return _0x562752;})['then'](respondWithFilteredResult(_0x194a32,_0x1977ad))[_0x26fb('0x49')](handleError(_0x194a32,null));};exports[_0x26fb('0x4a')]=function(_0x35a3f0,_0x5894f2){var _0x48c2d2={'raw':![],'where':{'id':_0x35a3f0['params']['id']}},_0x1f16ed={};_0x1f16ed[_0x26fb('0x34')]=_['keys'](db['Trigger'][_0x26fb('0x31')]);_0x1f16ed[_0x26fb('0x36')]=_[_0x26fb('0x35')](_0x35a3f0[_0x26fb('0x36')]);_0x1f16ed[_0x26fb('0x37')]=_['intersection'](_0x1f16ed[_0x26fb('0x34')],_0x1f16ed[_0x26fb('0x36')]);_0x48c2d2['attributes']=_[_0x26fb('0x38')](_0x1f16ed[_0x26fb('0x34')],qs[_0x26fb('0x39')](_0x35a3f0[_0x26fb('0x36')][_0x26fb('0x39')]));_0x48c2d2['attributes']=_0x48c2d2[_0x26fb('0x3a')][_0x26fb('0x3b')]?_0x48c2d2[_0x26fb('0x3a')]:_0x1f16ed[_0x26fb('0x34')];if(_0x35a3f0[_0x26fb('0x36')][_0x26fb('0x46')]){_0x48c2d2[_0x26fb('0x4b')]=[{'all':!![]}];}_0x48c2d2=_['merge']({},_0x48c2d2,_0x35a3f0[_0x26fb('0x45')]);return db['Trigger'][_0x26fb('0x4c')](_0x48c2d2)[_0x26fb('0x26')](handleEntityNotFound(_0x5894f2,null))[_0x26fb('0x26')](respondWithResult(_0x5894f2,null))[_0x26fb('0x49')](handleError(_0x5894f2,null));};exports[_0x26fb('0x4d')]=function(_0x4e1234,_0x23f40b){return db['Trigger']['create'](_0x4e1234[_0x26fb('0x4e')],{})['then'](function(_0x307404){var _0x4e0de2=_0x4e1234[_0x26fb('0x4f')][_0x26fb('0x50')]({'plain':!![]});if(!_0x4e0de2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e0de2[_0x26fb('0x51')]==='user'){var _0x5c61ab=_0x307404['get']({'plain':!![]});var _0x5f4eb2=_0x26fb('0x28');return db[_0x26fb('0x52')][_0x26fb('0x4c')]({'where':{'name':_0x5f4eb2,'userProfileId':_0x4e0de2[_0x26fb('0x53')]},'raw':!![]})[_0x26fb('0x26')](function(_0x292272){if(_0x292272&&_0x292272[_0x26fb('0x54')]===0x0){return db['UserProfileResource'][_0x26fb('0x4d')]({'name':_0x5c61ab[_0x26fb('0x2c')],'resourceId':_0x5c61ab['id'],'type':_0x292272['name'],'sectionId':_0x292272['id']},{})[_0x26fb('0x26')](function(){return _0x307404;});}else{return _0x307404;}})[_0x26fb('0x49')](function(_0x5c683d){logger[_0x26fb('0x2b')](_0x26fb('0x55'),_0x5c683d);throw _0x5c683d;});}return _0x307404;})['then'](respondWithResult(_0x23f40b,0xc9))[_0x26fb('0x49')](handleError(_0x23f40b,null));};exports[_0x26fb('0x25')]=function(_0x2a9288,_0x4eede8){if(_0x2a9288['body']['id']){delete _0x2a9288[_0x26fb('0x4e')]['id'];}return db[_0x26fb('0x30')]['find']({'where':{'id':_0x2a9288['params']['id']}})['then'](handleEntityNotFound(_0x4eede8,null))[_0x26fb('0x26')](saveUpdates(_0x2a9288['body'],null))['then'](respondWithResult(_0x4eede8,null))[_0x26fb('0x49')](handleError(_0x4eede8,null));};exports['destroy']=function(_0x2f3053,_0x11a463){return db[_0x26fb('0x30')][_0x26fb('0x4c')]({'where':{'id':_0x2f3053['params']['id']}})['then'](handleEntityNotFound(_0x11a463,null))[_0x26fb('0x26')](removeEntity(_0x11a463,null))['catch'](handleError(_0x11a463,null));};exports['addAllCondition']=function(_0x5e1d28,_0x494801,_0x5bfceb){if(_0x5e1d28[_0x26fb('0x4e')]['id']){delete _0x5e1d28['body']['id'];}return db[_0x26fb('0x30')][_0x26fb('0x4c')]({'where':{'id':_0x5e1d28[_0x26fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x494801,null))[_0x26fb('0x26')](function(_0xd506b7){if(_0xd506b7){_0x5e1d28[_0x26fb('0x4e')][_0x26fb('0x57')]=_0xd506b7['id'];return db[_0x26fb('0x58')][_0x26fb('0x4d')](_0x5e1d28[_0x26fb('0x4e')]);}})['then'](respondWithResult(_0x494801,null))['catch'](handleError(_0x494801,null));};exports[_0x26fb('0x59')]=function(_0x298ee5,_0x4167bc,_0x1e4ab8){if(_0x298ee5[_0x26fb('0x4e')]['id']){delete _0x298ee5['body']['id'];}return db[_0x26fb('0x30')][_0x26fb('0x4c')]({'where':{'id':_0x298ee5['params']['id']}})[_0x26fb('0x26')](handleEntityNotFound(_0x4167bc,null))[_0x26fb('0x26')](function(_0x42bcea){if(_0x42bcea){_0x298ee5['body'][_0x26fb('0x5a')]=_0x42bcea['id'];return db['Condition'][_0x26fb('0x4d')](_0x298ee5[_0x26fb('0x4e')]);}})['then'](respondWithResult(_0x4167bc,null))['catch'](handleError(_0x4167bc,null));};exports[_0x26fb('0x5b')]=function(_0x52476a,_0x23d942,_0x310f46){var _0x4ea868={};var _0x425169={};var _0x58635b;var _0x481bb5;return db['Trigger']['findOne']({'where':{'id':_0x52476a['params']['id']}})['then'](handleEntityNotFound(_0x23d942,null))[_0x26fb('0x26')](function(_0x3c8e6e){if(_0x3c8e6e){_0x58635b=_0x3c8e6e;_0x425169['model']=_[_0x26fb('0x35')](db[_0x26fb('0x58')]['rawAttributes']);_0x425169['query']=_[_0x26fb('0x35')](_0x52476a[_0x26fb('0x36')]);_0x425169[_0x26fb('0x37')]=_['intersection'](_0x425169[_0x26fb('0x34')],_0x425169['query']);_0x4ea868[_0x26fb('0x3a')]=_['intersection'](_0x425169[_0x26fb('0x34')],qs[_0x26fb('0x39')](_0x52476a['query'][_0x26fb('0x39')]));_0x4ea868[_0x26fb('0x3a')]=_0x4ea868['attributes'][_0x26fb('0x3b')]?_0x4ea868['attributes']:_0x425169['model'];_0x4ea868[_0x26fb('0x3f')]=qs[_0x26fb('0x40')](_0x52476a[_0x26fb('0x36')]['sort']);_0x4ea868[_0x26fb('0x43')]=qs[_0x26fb('0x37')](_['pick'](_0x52476a[_0x26fb('0x36')],_0x425169[_0x26fb('0x37')]));if(_0x52476a[_0x26fb('0x36')]['filter']){_0x4ea868[_0x26fb('0x43')]=_[_0x26fb('0x44')](_0x4ea868[_0x26fb('0x43')],{'$or':_[_0x26fb('0x2f')](_0x4ea868['attributes'],function(_0x19b2c0){var _0x36b6eb={};_0x36b6eb[_0x19b2c0]={'$like':'%'+_0x52476a[_0x26fb('0x36')][_0x26fb('0x42')]+'%'};return _0x36b6eb;})});}_0x4ea868=_['merge']({},_0x4ea868,_0x52476a[_0x26fb('0x45')]);return _0x58635b[_0x26fb('0x5b')](_0x4ea868);}})[_0x26fb('0x26')](function(_0x2e25cd){if(_0x2e25cd){_0x481bb5=_0x2e25cd['length'];if(!_0x52476a[_0x26fb('0x36')]['hasOwnProperty'](_0x26fb('0x3d'))){_0x4ea868[_0x26fb('0x3e')]=qs['limit'](_0x52476a[_0x26fb('0x36')][_0x26fb('0x3e')]);_0x4ea868[_0x26fb('0x1d')]=qs[_0x26fb('0x1d')](_0x52476a[_0x26fb('0x36')][_0x26fb('0x1d')]);}return _0x58635b[_0x26fb('0x5b')](_0x4ea868);}})['then'](function(_0x252f4c){if(_0x252f4c){return _0x252f4c?{'count':_0x481bb5,'rows':_0x252f4c}:null;}})[_0x26fb('0x26')](respondWithResult(_0x23d942,null))[_0x26fb('0x49')](handleError(_0x23d942,null));};exports[_0x26fb('0x5c')]=function(_0x2a35bf,_0x7609d2,_0x54cf35){var _0x5d9dbe={};var _0x64e1e3={};var _0x23c195;var _0x3d3754;return db['Trigger'][_0x26fb('0x5d')]({'where':{'id':_0x2a35bf[_0x26fb('0x56')]['id']}})['then'](handleEntityNotFound(_0x7609d2,null))['then'](function(_0x224f84){if(_0x224f84){_0x23c195=_0x224f84;_0x64e1e3['model']=_[_0x26fb('0x35')](db[_0x26fb('0x58')][_0x26fb('0x31')]);_0x64e1e3[_0x26fb('0x36')]=_[_0x26fb('0x35')](_0x2a35bf[_0x26fb('0x36')]);_0x64e1e3[_0x26fb('0x37')]=_[_0x26fb('0x38')](_0x64e1e3[_0x26fb('0x34')],_0x64e1e3[_0x26fb('0x36')]);_0x5d9dbe['attributes']=_[_0x26fb('0x38')](_0x64e1e3[_0x26fb('0x34')],qs[_0x26fb('0x39')](_0x2a35bf['query'][_0x26fb('0x39')]));_0x5d9dbe[_0x26fb('0x3a')]=_0x5d9dbe[_0x26fb('0x3a')]['length']?_0x5d9dbe[_0x26fb('0x3a')]:_0x64e1e3['model'];_0x5d9dbe[_0x26fb('0x3f')]=qs[_0x26fb('0x40')](_0x2a35bf[_0x26fb('0x36')][_0x26fb('0x40')]);_0x5d9dbe[_0x26fb('0x43')]=qs['filters'](_[_0x26fb('0x41')](_0x2a35bf[_0x26fb('0x36')],_0x64e1e3['filters']));if(_0x2a35bf[_0x26fb('0x36')][_0x26fb('0x42')]){_0x5d9dbe[_0x26fb('0x43')]=_[_0x26fb('0x44')](_0x5d9dbe[_0x26fb('0x43')],{'$or':_[_0x26fb('0x2f')](_0x5d9dbe[_0x26fb('0x3a')],function(_0x1e0741){var _0x51e0d4={};_0x51e0d4[_0x1e0741]={'$like':'%'+_0x2a35bf['query'][_0x26fb('0x42')]+'%'};return _0x51e0d4;})});}_0x5d9dbe=_[_0x26fb('0x44')]({},_0x5d9dbe,_0x2a35bf['options']);return _0x23c195['getAnyConditions'](_0x5d9dbe);}})[_0x26fb('0x26')](function(_0x14b5ff){if(_0x14b5ff){_0x3d3754=_0x14b5ff[_0x26fb('0x3b')];if(!_0x2a35bf[_0x26fb('0x36')]['hasOwnProperty'](_0x26fb('0x3d'))){_0x5d9dbe['limit']=qs[_0x26fb('0x3e')](_0x2a35bf[_0x26fb('0x36')][_0x26fb('0x3e')]);_0x5d9dbe['offset']=qs[_0x26fb('0x1d')](_0x2a35bf[_0x26fb('0x36')][_0x26fb('0x1d')]);}return _0x23c195[_0x26fb('0x5c')](_0x5d9dbe);}})[_0x26fb('0x26')](function(_0x4ecec3){if(_0x4ecec3){return _0x4ecec3?{'count':_0x3d3754,'rows':_0x4ecec3}:null;}})[_0x26fb('0x26')](respondWithResult(_0x7609d2,null))[_0x26fb('0x49')](handleError(_0x7609d2,null));};exports[_0x26fb('0x5e')]=function(_0x11c3f0,_0x4dfed3,_0x58f001){if(_0x11c3f0['body']['id']){delete _0x11c3f0['body']['id'];}return db['Trigger'][_0x26fb('0x4c')]({'where':{'id':_0x11c3f0['params']['id']}})[_0x26fb('0x26')](handleEntityNotFound(_0x4dfed3,null))[_0x26fb('0x26')](function(_0x36512c){if(_0x36512c){_0x11c3f0[_0x26fb('0x4e')]['TriggerId']=_0x36512c['id'];return db[_0x26fb('0x5f')][_0x26fb('0x4d')](_0x11c3f0[_0x26fb('0x4e')]);}})['then'](respondWithResult(_0x4dfed3,null))[_0x26fb('0x49')](handleError(_0x4dfed3,null));};exports[_0x26fb('0x60')]=function(_0x7b0668,_0x33d198,_0x39651d){var _0x2b6c59={};var _0x2331af={};var _0x5ebb6f;var _0x2eaa59;return db[_0x26fb('0x30')][_0x26fb('0x5d')]({'where':{'id':_0x7b0668[_0x26fb('0x56')]['id']}})[_0x26fb('0x26')](handleEntityNotFound(_0x33d198,null))[_0x26fb('0x26')](function(_0x52c0b1){if(_0x52c0b1){_0x5ebb6f=_0x52c0b1;_0x2331af[_0x26fb('0x34')]=_[_0x26fb('0x35')](db['Action'][_0x26fb('0x31')]);_0x2331af['query']=_['keys'](_0x7b0668[_0x26fb('0x36')]);_0x2331af[_0x26fb('0x37')]=_['intersection'](_0x2331af[_0x26fb('0x34')],_0x2331af[_0x26fb('0x36')]);_0x2b6c59[_0x26fb('0x3a')]=_[_0x26fb('0x38')](_0x2331af[_0x26fb('0x34')],qs[_0x26fb('0x39')](_0x7b0668[_0x26fb('0x36')][_0x26fb('0x39')]));_0x2b6c59['attributes']=_0x2b6c59['attributes'][_0x26fb('0x3b')]?_0x2b6c59['attributes']:_0x2331af[_0x26fb('0x34')];_0x2b6c59[_0x26fb('0x3f')]=qs[_0x26fb('0x40')](_0x7b0668[_0x26fb('0x36')][_0x26fb('0x40')]);_0x2b6c59[_0x26fb('0x43')]=qs['filters'](_[_0x26fb('0x41')](_0x7b0668[_0x26fb('0x36')],_0x2331af[_0x26fb('0x37')]));if(_0x7b0668[_0x26fb('0x36')][_0x26fb('0x42')]){_0x2b6c59[_0x26fb('0x43')]=_[_0x26fb('0x44')](_0x2b6c59[_0x26fb('0x43')],{'$or':_['map'](_0x2b6c59[_0x26fb('0x3a')],function(_0x47f407){var _0x377b0e={};_0x377b0e[_0x47f407]={'$like':'%'+_0x7b0668[_0x26fb('0x36')]['filter']+'%'};return _0x377b0e;})});}_0x2b6c59=_[_0x26fb('0x44')]({},_0x2b6c59,_0x7b0668[_0x26fb('0x45')]);return _0x5ebb6f[_0x26fb('0x60')](_0x2b6c59);}})[_0x26fb('0x26')](function(_0xdca6da){if(_0xdca6da){_0x2eaa59=_0xdca6da['length'];if(!_0x7b0668['query'][_0x26fb('0x3c')](_0x26fb('0x3d'))){_0x2b6c59['limit']=qs[_0x26fb('0x3e')](_0x7b0668[_0x26fb('0x36')][_0x26fb('0x3e')]);_0x2b6c59[_0x26fb('0x1d')]=qs[_0x26fb('0x1d')](_0x7b0668[_0x26fb('0x36')][_0x26fb('0x1d')]);}return _0x5ebb6f['getActions'](_0x2b6c59);}})[_0x26fb('0x26')](function(_0xedf6a8){if(_0xedf6a8){return _0xedf6a8?{'count':_0x2eaa59,'rows':_0xedf6a8}:null;}})[_0x26fb('0x26')](respondWithResult(_0x33d198,null))['catch'](handleError(_0x33d198,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 776dbcd..d82d309 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 _0x502a=['path','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','util','api','moment'];(function(_0x1d1f2c,_0xe8f779){var _0xfd8140=function(_0x44cc83){while(--_0x44cc83){_0x1d1f2c['push'](_0x1d1f2c['shift']());}};_0xfd8140(++_0xe8f779);}(_0x502a,0xd8));var _0xa502=function(_0x1a558f,_0x141a39){_0x1a558f=_0x1a558f-0x0;var _0x188675=_0x502a[_0x1a558f];return _0x188675;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var logger=require('../../config/logger')(_0xa502('0x2'));var moment=require(_0xa502('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa502('0x4'));var rimraf=require('rimraf');var config=require(_0xa502('0x5'));var attributes=require(_0xa502('0x6'));module[_0xa502('0x7')]=function(_0x1cb2e4,_0x136d51){return _0x1cb2e4['define'](_0xa502('0x8'),attributes,{'tableName':_0xa502('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37dc=['define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x318bbd,_0x2ec345){var _0x46175a=function(_0x53b2ef){while(--_0x53b2ef){_0x318bbd['push'](_0x318bbd['shift']());}};_0x46175a(++_0x2ec345);}(_0x37dc,0x1e9));var _0xc37d=function(_0x43ae11,_0x393eac){_0x43ae11=_0x43ae11-0x0;var _0x10ef0f=_0x37dc[_0x43ae11];return _0x10ef0f;};'use strict';var _=require(_0xc37d('0x0'));var util=require(_0xc37d('0x1'));var logger=require(_0xc37d('0x2'))(_0xc37d('0x3'));var moment=require('moment');var BPromise=require(_0xc37d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc37d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./trigger.attributes');module['exports']=function(_0x33c9db,_0xa63f50){return _0x33c9db[_0xc37d('0x6')](_0xc37d('0x7'),attributes,{'tableName':_0xc37d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 8173f97..dadeae4 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 _0x925b=['Trigger','options','raw','where','attributes','limit','include','map','model','GetTrigger','debug','stringify','ShowTrigger','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Trigger,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x266f39,_0x2cd662){var _0xefa763=function(_0x340a40){while(--_0x340a40){_0x266f39['push'](_0x266f39['shift']());}};_0xefa763(++_0x2cd662);}(_0x925b,0x1d5));var _0xb925=function(_0x83af7f,_0x49c6fd){_0x83af7f=_0x83af7f-0x0;var _0x32d85c=_0x925b[_0x83af7f];return _0x32d85c;};'use strict';var _=require(_0xb925('0x0'));var util=require(_0xb925('0x1'));var moment=require(_0xb925('0x2'));var BPromise=require(_0xb925('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb925('0x4'));var db=require(_0xb925('0x5'))['db'];var utils=require(_0xb925('0x6'));var logger=require(_0xb925('0x7'))(_0xb925('0x8'));var config=require(_0xb925('0x9'));var jayson=require(_0xb925('0xa'));var client=jayson[_0xb925('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fd857,_0x4df3b2,_0x1104c9){return new BPromise(function(_0x2cfcbb,_0x1794df){return client['request'](_0x1fd857,_0x1104c9)[_0xb925('0xc')](function(_0x40e655){logger[_0xb925('0xd')](_0xb925('0xe'),_0x4df3b2,_0xb925('0xf'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x4df3b2,_0xb925('0xf'),JSON['stringify'](_0x40e655));if(_0x40e655[_0xb925('0x10')]){if(_0x40e655[_0xb925('0x10')][_0xb925('0x11')]===0x1f4){logger['error'](_0xb925('0xe'),_0x4df3b2,_0x40e655[_0xb925('0x10')]['message']);return _0x1794df(_0x40e655[_0xb925('0x10')][_0xb925('0x12')]);}logger[_0xb925('0x10')](_0xb925('0xe'),_0x4df3b2,_0x40e655[_0xb925('0x10')][_0xb925('0x12')]);return _0x2cfcbb(_0x40e655[_0xb925('0x10')]['message']);}else{logger[_0xb925('0xd')](_0xb925('0xe'),_0x4df3b2,_0xb925('0xf'));_0x2cfcbb(_0x40e655[_0xb925('0x13')][_0xb925('0x12')]);}})[_0xb925('0x14')](function(_0x5cdf3e){logger[_0xb925('0x10')](_0xb925('0xe'),_0x4df3b2,_0x5cdf3e);_0x1794df(_0x5cdf3e);});});}exports['GetTrigger']=function(_0x4b1a78){var _0x54665c=this;return new Promise(function(_0x1b0d15,_0x4c6b16){return db[_0xb925('0x15')]['findAll']({'raw':_0x4b1a78['options']?_0x4b1a78[_0xb925('0x16')][_0xb925('0x17')]===undefined?!![]:![]:!![],'where':_0x4b1a78[_0xb925('0x16')]?_0x4b1a78[_0xb925('0x16')][_0xb925('0x18')]||null:null,'attributes':_0x4b1a78[_0xb925('0x16')]?_0x4b1a78[_0xb925('0x16')][_0xb925('0x19')]||null:null,'limit':_0x4b1a78[_0xb925('0x16')]?_0x4b1a78[_0xb925('0x16')][_0xb925('0x1a')]||null:null,'include':_0x4b1a78[_0xb925('0x16')]?_0x4b1a78[_0xb925('0x16')][_0xb925('0x1b')]?_[_0xb925('0x1c')](_0x4b1a78['options'][_0xb925('0x1b')],function(_0x2a6561){return{'model':db[_0x2a6561[_0xb925('0x1d')]],'as':_0x2a6561['as'],'attributes':_0x2a6561[_0xb925('0x19')],'include':_0x2a6561['include']?_[_0xb925('0x1c')](_0x2a6561[_0xb925('0x1b')],function(_0x2f9f20){return{'model':db[_0x2f9f20['model']],'as':_0x2f9f20['as'],'attributes':_0x2f9f20[_0xb925('0x19')],'include':_0x2f9f20[_0xb925('0x1b')]?_[_0xb925('0x1c')](_0x2f9f20['include'],function(_0x4000e8){return{'model':db[_0x4000e8['model']],'as':_0x4000e8['as'],'attributes':_0x4000e8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb925('0xc')](function(_0x5ef393){logger[_0xb925('0xd')](_0xb925('0x1e'),_0x4b1a78);logger[_0xb925('0x1f')](_0xb925('0x1e'),_0x4b1a78,JSON[_0xb925('0x20')](_0x5ef393));_0x1b0d15(_0x5ef393);})[_0xb925('0x14')](function(_0x817fef){logger[_0xb925('0x10')]('GetTrigger',_0x817fef[_0xb925('0x12')],_0x4b1a78);_0x4c6b16(_0x54665c['error'](0x1f4,_0x817fef['message']));});});};exports[_0xb925('0x21')]=function(_0x59b2fb){var _0x69c8cc=this;return new Promise(function(_0xc142ca,_0x1f6dee){return db[_0xb925('0x15')][_0xb925('0x22')]({'raw':_0x59b2fb['options']?_0x59b2fb[_0xb925('0x16')][_0xb925('0x17')]===undefined?!![]:![]:!![],'where':_0x59b2fb[_0xb925('0x16')]?_0x59b2fb['options']['where']||null:null,'attributes':_0x59b2fb[_0xb925('0x16')]?_0x59b2fb[_0xb925('0x16')][_0xb925('0x19')]||null:null,'include':_0x59b2fb[_0xb925('0x16')]?_0x59b2fb['options'][_0xb925('0x1b')]?_[_0xb925('0x1c')](_0x59b2fb['options']['include'],function(_0xd71ba6){return{'model':db[_0xd71ba6[_0xb925('0x1d')]],'as':_0xd71ba6['as'],'attributes':_0xd71ba6[_0xb925('0x19')],'include':_0xd71ba6[_0xb925('0x1b')]?_[_0xb925('0x1c')](_0xd71ba6['include'],function(_0x30c8b7){return{'model':db[_0x30c8b7[_0xb925('0x1d')]],'as':_0x30c8b7['as'],'attributes':_0x30c8b7[_0xb925('0x19')],'include':_0x30c8b7['include']?_[_0xb925('0x1c')](_0x30c8b7['include'],function(_0x33ea75){return{'model':db[_0x33ea75[_0xb925('0x1d')]],'as':_0x33ea75['as'],'attributes':_0x33ea75[_0xb925('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a0762){logger['info'](_0xb925('0x21'),_0x59b2fb);logger[_0xb925('0x1f')](_0xb925('0x21'),_0x59b2fb,JSON[_0xb925('0x20')](_0x3a0762));_0xc142ca(_0x3a0762);})[_0xb925('0x14')](function(_0x2b721a){logger[_0xb925('0x10')]('ShowTrigger',_0x2b721a[_0xb925('0x12')],_0x59b2fb);_0x1f6dee(_0x69c8cc[_0xb925('0x10')](0x1f4,_0x2b721a[_0xb925('0x12')]));});});}; \ No newline at end of file +var _0xac93=['Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrigger','Trigger','options','attributes','limit','include','model','map','info','debug','ShowTrigger','find','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xac93,0x126));var _0x3ac9=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xac93[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x3ac9('0x0'));var util=require(_0x3ac9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ac9('0x2'));var db=require(_0x3ac9('0x3'))['db'];var utils=require(_0x3ac9('0x4'));var logger=require(_0x3ac9('0x5'))(_0x3ac9('0x6'));var config=require(_0x3ac9('0x7'));var jayson=require(_0x3ac9('0x8'));var client=jayson[_0x3ac9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x453749,_0x401947,_0x11d6a0){return new BPromise(function(_0x466652,_0x70a079){return client[_0x3ac9('0xa')](_0x453749,_0x11d6a0)[_0x3ac9('0xb')](function(_0x22f7f0){logger['info'](_0x3ac9('0xc'),_0x401947,_0x3ac9('0xd'));logger['debug'](_0x3ac9('0xe'),_0x401947,'request\x20sent',JSON[_0x3ac9('0xf')](_0x22f7f0));if(_0x22f7f0[_0x3ac9('0x10')]){if(_0x22f7f0['error']['code']===0x1f4){logger[_0x3ac9('0x10')](_0x3ac9('0xc'),_0x401947,_0x22f7f0['error'][_0x3ac9('0x11')]);return _0x70a079(_0x22f7f0[_0x3ac9('0x10')][_0x3ac9('0x11')]);}logger['error'](_0x3ac9('0xc'),_0x401947,_0x22f7f0['error']['message']);return _0x466652(_0x22f7f0[_0x3ac9('0x10')][_0x3ac9('0x11')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x401947,_0x3ac9('0xd'));_0x466652(_0x22f7f0[_0x3ac9('0x12')][_0x3ac9('0x11')]);}})[_0x3ac9('0x13')](function(_0xe13a7d){logger[_0x3ac9('0x10')](_0x3ac9('0xc'),_0x401947,_0xe13a7d);_0x70a079(_0xe13a7d);});});}exports[_0x3ac9('0x14')]=function(_0x133f50){var _0x2fd664=this;return new Promise(function(_0x5d1cd3,_0x485351){return db[_0x3ac9('0x15')]['findAll']({'raw':_0x133f50[_0x3ac9('0x16')]?_0x133f50[_0x3ac9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x133f50[_0x3ac9('0x16')]?_0x133f50[_0x3ac9('0x16')]['where']||null:null,'attributes':_0x133f50[_0x3ac9('0x16')]?_0x133f50[_0x3ac9('0x16')][_0x3ac9('0x17')]||null:null,'limit':_0x133f50[_0x3ac9('0x16')]?_0x133f50[_0x3ac9('0x16')][_0x3ac9('0x18')]||null:null,'include':_0x133f50[_0x3ac9('0x16')]?_0x133f50[_0x3ac9('0x16')][_0x3ac9('0x19')]?_['map'](_0x133f50[_0x3ac9('0x16')]['include'],function(_0x25efac){return{'model':db[_0x25efac[_0x3ac9('0x1a')]],'as':_0x25efac['as'],'attributes':_0x25efac[_0x3ac9('0x17')],'include':_0x25efac[_0x3ac9('0x19')]?_['map'](_0x25efac[_0x3ac9('0x19')],function(_0xb1436f){return{'model':db[_0xb1436f['model']],'as':_0xb1436f['as'],'attributes':_0xb1436f[_0x3ac9('0x17')],'include':_0xb1436f['include']?_[_0x3ac9('0x1b')](_0xb1436f[_0x3ac9('0x19')],function(_0x363984){return{'model':db[_0x363984['model']],'as':_0x363984['as'],'attributes':_0x363984[_0x3ac9('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3ac9('0xb')](function(_0x5165e0){logger[_0x3ac9('0x1c')]('GetTrigger',_0x133f50);logger[_0x3ac9('0x1d')](_0x3ac9('0x14'),_0x133f50,JSON[_0x3ac9('0xf')](_0x5165e0));_0x5d1cd3(_0x5165e0);})[_0x3ac9('0x13')](function(_0x53b399){logger[_0x3ac9('0x10')](_0x3ac9('0x14'),_0x53b399['message'],_0x133f50);_0x485351(_0x2fd664['error'](0x1f4,_0x53b399[_0x3ac9('0x11')]));});});};exports[_0x3ac9('0x1e')]=function(_0x2498d7){var _0x4979c1=this;return new Promise(function(_0x29698d,_0x11d9a7){return db[_0x3ac9('0x15')][_0x3ac9('0x1f')]({'raw':_0x2498d7[_0x3ac9('0x16')]?_0x2498d7[_0x3ac9('0x16')][_0x3ac9('0x20')]===undefined?!![]:![]:!![],'where':_0x2498d7[_0x3ac9('0x16')]?_0x2498d7['options'][_0x3ac9('0x21')]||null:null,'attributes':_0x2498d7[_0x3ac9('0x16')]?_0x2498d7['options'][_0x3ac9('0x17')]||null:null,'include':_0x2498d7['options']?_0x2498d7[_0x3ac9('0x16')][_0x3ac9('0x19')]?_[_0x3ac9('0x1b')](_0x2498d7['options']['include'],function(_0x5d6862){return{'model':db[_0x5d6862['model']],'as':_0x5d6862['as'],'attributes':_0x5d6862[_0x3ac9('0x17')],'include':_0x5d6862[_0x3ac9('0x19')]?_[_0x3ac9('0x1b')](_0x5d6862[_0x3ac9('0x19')],function(_0x3747af){return{'model':db[_0x3747af[_0x3ac9('0x1a')]],'as':_0x3747af['as'],'attributes':_0x3747af[_0x3ac9('0x17')],'include':_0x3747af['include']?_[_0x3ac9('0x1b')](_0x3747af['include'],function(_0x15e57c){return{'model':db[_0x15e57c['model']],'as':_0x15e57c['as'],'attributes':_0x15e57c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x144975){logger['info']('ShowTrigger',_0x2498d7);logger[_0x3ac9('0x1d')](_0x3ac9('0x1e'),_0x2498d7,JSON[_0x3ac9('0xf')](_0x144975));_0x29698d(_0x144975);})[_0x3ac9('0x13')](function(_0x4b2cd1){logger['error']('ShowTrigger',_0x4b2cd1[_0x3ac9('0x11')],_0x2498d7);_0x11d9a7(_0x4979c1[_0x3ac9('0x10')](0x1f4,_0x4b2cd1['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index bd33451..1395821 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 _0xaad7=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','create'];(function(_0x451353,_0x19710b){var _0x102315=function(_0x51204c){while(--_0x51204c){_0x451353['push'](_0x451353['shift']());}};_0x102315(++_0x19710b);}(_0xaad7,0x1a6));var _0x7aad=function(_0x579c88,_0xfb5e4e){_0x579c88=_0x579c88-0x0;var _0x2afef=_0xaad7[_0x579c88];return _0x2afef;};'use strict';var multer=require(_0x7aad('0x0'));var util=require(_0x7aad('0x1'));var path=require(_0x7aad('0x2'));var timeout=require(_0x7aad('0x3'));var express=require(_0x7aad('0x4'));var router=express[_0x7aad('0x5')]();var fs_extra=require(_0x7aad('0x6'));var auth=require(_0x7aad('0x7'));var interaction=require(_0x7aad('0x8'));var config=require(_0x7aad('0x9'));var controller=require(_0x7aad('0xa'));router[_0x7aad('0xb')]('/',auth[_0x7aad('0xc')](),controller['index']);router[_0x7aad('0xb')](_0x7aad('0xd'),auth[_0x7aad('0xc')](),controller[_0x7aad('0xe')]);router[_0x7aad('0xf')](_0x7aad('0x10'),auth[_0x7aad('0xc')](),controller['clone']);router[_0x7aad('0xf')]('/',auth[_0x7aad('0xc')](),controller[_0x7aad('0x11')]);router[_0x7aad('0x12')](_0x7aad('0xd'),auth[_0x7aad('0xc')](),controller[_0x7aad('0x13')]);router['delete'](_0x7aad('0xd'),auth[_0x7aad('0xc')](),controller[_0x7aad('0x14')]);module[_0x7aad('0x15')]=router; \ No newline at end of file +var _0xd03f=['../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd03f,0xc3));var _0xfd03=function(_0x407683,_0x44fc49){_0x407683=_0x407683-0x0;var _0x292776=_0xd03f[_0x407683];return _0x292776;};'use strict';var multer=require('multer');var util=require(_0xfd03('0x0'));var path=require('path');var timeout=require(_0xfd03('0x1'));var express=require(_0xfd03('0x2'));var router=express['Router']();var fs_extra=require(_0xfd03('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd03('0x4'));var config=require(_0xfd03('0x5'));var controller=require(_0xfd03('0x6'));router[_0xfd03('0x7')]('/',auth[_0xfd03('0x8')](),controller[_0xfd03('0x9')]);router[_0xfd03('0x7')](_0xfd03('0xa'),auth[_0xfd03('0x8')](),controller[_0xfd03('0xb')]);router[_0xfd03('0xc')](_0xfd03('0xd'),auth[_0xfd03('0x8')](),controller[_0xfd03('0xe')]);router['post']('/',auth[_0xfd03('0x8')](),controller['create']);router[_0xfd03('0xf')](_0xfd03('0xa'),auth[_0xfd03('0x8')](),controller[_0xfd03('0x10')]);router[_0xfd03('0x11')](_0xfd03('0xa'),auth[_0xfd03('0x8')](),controller[_0xfd03('0x12')]);module[_0xfd03('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 31b835b..37725e2 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 _0xa627=['name','ENUM','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','inband','rfc2833','yes','update','outgoing','join','nat','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','certificate','passive','nonat','update,nonat','sequelize','exports','STRING'];(function(_0x1f08fa,_0x326d68){var _0x2a3e47=function(_0x1be1a9){while(--_0x1be1a9){_0x1f08fa['push'](_0x1f08fa['shift']());}};_0x2a3e47(++_0x326d68);}(_0xa627,0xb1));var _0x7a62=function(_0xe54e21,_0x3cedeb){_0xe54e21=_0xe54e21-0x0;var _0x464602=_0xa627[_0xe54e21];return _0x464602;};'use strict';var Sequelize=require(_0x7a62('0x0'));module[_0x7a62('0x1')]={'name':{'type':Sequelize[_0x7a62('0x2')],'allowNull':![],'unique':_0x7a62('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x5'),'user','peer'),'allowNull':![],'defaultValue':_0x7a62('0x5')},'context':{'type':Sequelize[_0x7a62('0x2')],'allowNull':![],'defaultValue':_0x7a62('0x6')},'callingpres':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x7'),_0x7a62('0x8'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x7a62('0x9'),_0x7a62('0xa'),_0x7a62('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x7a62('0x2')]},'permit':{'type':Sequelize[_0x7a62('0x2')]},'secret':{'type':Sequelize[_0x7a62('0x2')]},'md5secret':{'type':Sequelize[_0x7a62('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x7a62('0x2')],'defaultValue':_0x7a62('0xc'),'set':function(_0x28773a){this[_0x7a62('0xd')](_0x7a62('0xe'),_0x28773a?_0x28773a['join'](','):null);},'get':function(){return this['getDataValue'](_0x7a62('0xe'))?this['getDataValue'](_0x7a62('0xe'))['split'](','):null;},'comment':_0x7a62('0xf')},'dtmfmode':{'type':Sequelize[_0x7a62('0x4')]('rfc2833','info','shortinfo',_0x7a62('0x10'),'auto'),'defaultValue':_0x7a62('0x11')},'directmedia':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no','nonat',_0x7a62('0x13'),_0x7a62('0x14')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x7a62('0x12'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7a62('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x7a62('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x81f71d){this['setDataValue']('nat',_0x81f71d?_0x81f71d[_0x7a62('0x15')](','):null);},'get':function(){return this['getDataValue'](_0x7a62('0x16'))?this[_0x7a62('0x17')](_0x7a62('0x16'))[_0x7a62('0x18')](','):null;},'comment':_0x7a62('0x19')},'callgroup':{'type':Sequelize[_0x7a62('0x2')]},'namedcallgroup':{'type':Sequelize[_0x7a62('0x2')]},'pickupgroup':{'type':Sequelize[_0x7a62('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x7a62('0x2')]},'language':{'type':Sequelize[_0x7a62('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x7a62('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x7a62('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1a7621){this[_0x7a62('0xd')](_0x7a62('0x1a'),_0x1a7621?_0x1a7621[_0x7a62('0x15')](';'):_0x7a62('0x1b'));},'get':function(){return this[_0x7a62('0x17')](_0x7a62('0x1a'))?this[_0x7a62('0x17')](_0x7a62('0x1a'))[_0x7a62('0x18')](';'):null;},'comment':_0x7a62('0x1c')},'autoframing':{'type':Sequelize['ENUM'](_0x7a62('0x12'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x7a62('0x1d'),'set':function(_0x25a689){this[_0x7a62('0xd')]('insecure',_0x25a689?_0x25a689[_0x7a62('0x15')](','):null);},'get':function(){return this['getDataValue'](_0x7a62('0x1e'))?this[_0x7a62('0x17')](_0x7a62('0x1e'))['split'](','):null;},'comment':_0x7a62('0x1f')},'trustrpid':{'type':Sequelize[_0x7a62('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no',_0x7a62('0x20'))},'promiscredir':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x7a62('0x12'),'no')},'accountcode':{'type':Sequelize[_0x7a62('0x21')](0xb)},'setvar':{'type':Sequelize[_0x7a62('0x2')]},'callerid':{'type':Sequelize[_0x7a62('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x7a62('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x7a62('0x12')},'busylevel':{'type':Sequelize[_0x7a62('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'allowsubscribe':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'allowtransfer':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'ignoresdpversion':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'subscribecontext':{'type':Sequelize[_0x7a62('0x2')]},'template':{'type':Sequelize[_0x7a62('0x2')]},'videosupport':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no',_0x7a62('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7a62('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'mailbox':{'type':Sequelize[_0x7a62('0x2')]},'session_timers':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x23'),_0x7a62('0x24'),_0x7a62('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x7a62('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x26'),_0x7a62('0x27')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x7a62('0x2')]},'fromuser':{'type':Sequelize[_0x7a62('0x2')]},'port':{'type':Sequelize[_0x7a62('0x21')](0x5)},'qualify':{'type':Sequelize[_0x7a62('0x4')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7a62('0x21')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x7a62('0x2')]},'rtptimeout':{'type':Sequelize[_0x7a62('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no',_0x7a62('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7a62('0x2')]},'callbackextension':{'type':Sequelize[_0x7a62('0x2')]},'timert1':{'type':Sequelize[_0x7a62('0x21')](0xb)},'timerb':{'type':Sequelize[_0x7a62('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x7a62('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x7a62('0x2')]},'contactdeny':{'type':Sequelize[_0x7a62('0x2')]},'contactacl':{'type':Sequelize[_0x7a62('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x7a62('0x2')]},'maxforwards':{'type':Sequelize[_0x7a62('0x21')](0xb)},'encryption':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'force_avp':{'type':Sequelize[_0x7a62('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'dtlsenable':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'dtlsverify':{'type':Sequelize[_0x7a62('0x4')]('yes','no','fingerprint',_0x7a62('0x29'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x7a62('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x7a62('0x2')]},'dtlscipher':{'type':Sequelize[_0x7a62('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x7a62('0x2')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x7a62('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7a62('0x2')]},'usereqphone':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x7a62('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'subscribemwi':{'type':Sequelize[_0x7a62('0x4')](_0x7a62('0x12'),'no')},'vmexten':{'type':Sequelize[_0x7a62('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x7a62('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x7a62('0x4')]('yes','no',_0x7a62('0x2b'),'update',_0x7a62('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x7a62('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x7a62('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x3a10=['setDataValue','transport','join','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uac','certificate','active','dynamic','update,nonat','sequelize','exports','name','ENUM','friend','user','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp'];(function(_0x1bd8ea,_0x5d86fa){var _0x6fda4f=function(_0x4a2c8d){while(--_0x4a2c8d){_0x1bd8ea['push'](_0x1bd8ea['shift']());}};_0x6fda4f(++_0x5d86fa);}(_0x3a10,0x1c8));var _0x03a1=function(_0x4d33e1,_0x358623){_0x4d33e1=_0x4d33e1-0x0;var _0x46433e=_0x3a10[_0x4d33e1];return _0x46433e;};'use strict';var Sequelize=require(_0x03a1('0x0'));module[_0x03a1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x03a1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x4'),_0x03a1('0x5'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x03a1('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x7'),_0x03a1('0x8'),_0x03a1('0x9'),'ALLOWED',_0x03a1('0xa'),_0x03a1('0xb'),'PROHIB_FAILED_SCREEN',_0x03a1('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x03a1('0x6')]},'secret':{'type':Sequelize[_0x03a1('0x6')]},'md5secret':{'type':Sequelize[_0x03a1('0x6')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':_0x03a1('0xd'),'set':function(_0x277067){this[_0x03a1('0xe')](_0x03a1('0xf'),_0x277067?_0x277067[_0x03a1('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x03a1('0xf'))?this['getDataValue'](_0x03a1('0xf'))[_0x03a1('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x12'),_0x03a1('0x13'),_0x03a1('0x14'),_0x03a1('0x15'),_0x03a1('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no',_0x03a1('0x18'),_0x03a1('0x19'),_0x03a1('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x03a1('0x6')]},'nat':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':_0x03a1('0x1b'),'set':function(_0x32cc2c){this[_0x03a1('0xe')](_0x03a1('0x1c'),_0x32cc2c?_0x32cc2c[_0x03a1('0x10')](','):null);},'get':function(){return this[_0x03a1('0x1d')](_0x03a1('0x1c'))?this[_0x03a1('0x1d')]('nat')[_0x03a1('0x11')](','):null;},'comment':_0x03a1('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x03a1('0x6')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x03a1('0x6')]},'language':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x03a1('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':_0x03a1('0x1f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x03a1('0x20'),'set':function(_0x34f379){this[_0x03a1('0xe')](_0x03a1('0x21'),_0x34f379?_0x34f379[_0x03a1('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x03a1('0x1d')](_0x03a1('0x21'))?this['getDataValue']('allow')[_0x03a1('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'insecure':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':_0x03a1('0x22'),'set':function(_0x361c3c){this[_0x03a1('0xe')](_0x03a1('0x23'),_0x361c3c?_0x361c3c['join'](','):null);},'get':function(){return this['getDataValue'](_0x03a1('0x23'))?this[_0x03a1('0x1d')]('insecure')[_0x03a1('0x11')](','):null;},'comment':_0x03a1('0x24')},'trustrpid':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x03a1('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no',_0x03a1('0x25'))},'promiscredir':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'accountcode':{'type':Sequelize[_0x03a1('0x26')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x03a1('0x3')]('yes','no'),'defaultValue':_0x03a1('0x17')},'busylevel':{'type':Sequelize[_0x03a1('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x03a1('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x03a1('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x03a1('0x6')]},'videosupport':{'type':Sequelize[_0x03a1('0x3')]('yes','no',_0x03a1('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x03a1('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'mailbox':{'type':Sequelize[_0x03a1('0x6')]},'session_timers':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x28'),_0x03a1('0x29'),'originate')},'session_expires':{'type':Sequelize[_0x03a1('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x03a1('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x2a'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x03a1('0x6')]},'regexten':{'type':Sequelize[_0x03a1('0x6')]},'fromdomain':{'type':Sequelize[_0x03a1('0x6')]},'fromuser':{'type':Sequelize[_0x03a1('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x03a1('0x3')]('yes','no'),'defaultValue':_0x03a1('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x03a1('0x6')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x03a1('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x03a1('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x03a1('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x03a1('0x6')]},'callbackextension':{'type':Sequelize[_0x03a1('0x6')]},'timert1':{'type':Sequelize[_0x03a1('0x26')](0xb)},'timerb':{'type':Sequelize[_0x03a1('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x03a1('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x03a1('0x6')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x03a1('0x6')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x03a1('0x26')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x03a1('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'force_avp':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x03a1('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no','fingerprint',_0x03a1('0x2b'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x03a1('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x03a1('0x6')]},'dtlscipher':{'type':Sequelize[_0x03a1('0x6')]},'dtlscafile':{'type':Sequelize[_0x03a1('0x6')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0x03a1('0x2c'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x03a1('0x6')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x03a1('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x03a1('0x3')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x03a1('0x6')]},'mohsuggest':{'type':Sequelize[_0x03a1('0x6')]},'parkinglot':{'type':Sequelize[_0x03a1('0x6')]},'description':{'type':Sequelize[_0x03a1('0x6')]},'host':{'type':Sequelize[_0x03a1('0x6')],'defaultValue':_0x03a1('0x2d')},'canreinvite':{'type':Sequelize[_0x03a1('0x3')](_0x03a1('0x17'),'no','nonat',_0x03a1('0x19'),_0x03a1('0x2e')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x03a1('0x6')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 4204776..1eb487c 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 _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','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','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x3d25f8,_0x1b4e2f){var _0xef1418=function(_0x215edb){while(--_0x215edb){_0x3d25f8['push'](_0x3d25f8['shift']());}};_0xef1418(++_0x1b4e2f);}(_0x3e74,0x175));var _0x43e7=function(_0x43040b,_0x2c269e){_0x43040b=_0x43040b-0x0;var _0x2b43f7=_0x3e74[_0x43040b];return _0x2b43f7;};'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'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));}; \ No newline at end of file +var _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x586df4,_0x561239){var _0x80632c=function(_0xa67207){while(--_0xa67207){_0x586df4['push'](_0x586df4['shift']());}};_0x80632c(++_0x561239);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x00bb[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index b3a5768..e22adfa 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 _0xbff6=['../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','util','../../config/logger','api','path'];(function(_0x15c85b,_0x5c9a9a){var _0x521c48=function(_0x4bc911){while(--_0x4bc911){_0x15c85b['push'](_0x15c85b['shift']());}};_0x521c48(++_0x5c9a9a);}(_0xbff6,0x140));var _0x6bff=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0xbff6[_0x631a3c];return _0x2bdfa3;};'use strict';var _=require('lodash');var util=require(_0x6bff('0x0'));var logger=require(_0x6bff('0x1'))(_0x6bff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bff('0x3'));var rimraf=require('rimraf');var config=require(_0x6bff('0x4'));var attributes=require(_0x6bff('0x5'));module['exports']=function(_0x75531,_0x2e30da){return _0x75531[_0x6bff('0x6')](_0x6bff('0x7'),attributes,{'tableName':_0x6bff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e38=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger'];(function(_0xf6649a,_0xebc357){var _0x520e67=function(_0x3ac43d){while(--_0x3ac43d){_0xf6649a['push'](_0xf6649a['shift']());}};_0x520e67(++_0xebc357);}(_0x3e38,0x189));var _0x83e3=function(_0xc1a7a1,_0x5f21f8){_0xc1a7a1=_0xc1a7a1-0x0;var _0x18a491=_0x3e38[_0xc1a7a1];return _0x18a491;};'use strict';var _=require(_0x83e3('0x0'));var util=require(_0x83e3('0x1'));var logger=require(_0x83e3('0x2'))(_0x83e3('0x3'));var moment=require(_0x83e3('0x4'));var BPromise=require(_0x83e3('0x5'));var rp=require(_0x83e3('0x6'));var fs=require('fs');var path=require(_0x83e3('0x7'));var rimraf=require(_0x83e3('0x8'));var config=require(_0x83e3('0x9'));var attributes=require('./trunk.attributes');module[_0x83e3('0xa')]=function(_0x3aa254,_0x590d4a){return _0x3aa254[_0x83e3('0xb')]('Trunk',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 950b9e5..15863b7 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 _0x311c=['options','raw','attributes','limit','include','map','model','then','info','stringify','ShowTrunk','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetTrunk','Trunk'];(function(_0x389fb1,_0x431673){var _0x3d3520=function(_0x2dcab7){while(--_0x2dcab7){_0x389fb1['push'](_0x389fb1['shift']());}};_0x3d3520(++_0x431673);}(_0x311c,0x11c));var _0xc311=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0x311c[_0x5f25b3];return _0x4ab9bf;};'use strict';var _=require('lodash');var util=require(_0xc311('0x0'));var moment=require(_0xc311('0x1'));var BPromise=require(_0xc311('0x2'));var rs=require(_0xc311('0x3'));var fs=require('fs');var Redis=require(_0xc311('0x4'));var db=require(_0xc311('0x5'))['db'];var utils=require(_0xc311('0x6'));var logger=require('../../config/logger')(_0xc311('0x7'));var config=require('../../config/environment');var jayson=require(_0xc311('0x8'));var client=jayson[_0xc311('0x9')][_0xc311('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5afa96,_0xccf2e4,_0x156502){return new BPromise(function(_0x450943,_0x43f042){return client['request'](_0x5afa96,_0x156502)['then'](function(_0x22370c){logger['info'](_0xc311('0xb'),_0xccf2e4,_0xc311('0xc'));logger[_0xc311('0xd')](_0xc311('0xe'),_0xccf2e4,_0xc311('0xc'),JSON['stringify'](_0x22370c));if(_0x22370c[_0xc311('0xf')]){if(_0x22370c[_0xc311('0xf')][_0xc311('0x10')]===0x1f4){logger[_0xc311('0xf')](_0xc311('0xb'),_0xccf2e4,_0x22370c[_0xc311('0xf')]['message']);return _0x43f042(_0x22370c['error']['message']);}logger[_0xc311('0xf')]('Trunk,\x20%s,\x20%s',_0xccf2e4,_0x22370c[_0xc311('0xf')][_0xc311('0x11')]);return _0x450943(_0x22370c[_0xc311('0xf')][_0xc311('0x11')]);}else{logger['info'](_0xc311('0xb'),_0xccf2e4,'request\x20sent');_0x450943(_0x22370c[_0xc311('0x12')][_0xc311('0x11')]);}})[_0xc311('0x13')](function(_0x123e21){logger['error'](_0xc311('0xb'),_0xccf2e4,_0x123e21);_0x43f042(_0x123e21);});});}exports[_0xc311('0x14')]=function(_0x4eb7a8){var _0x1a53a5=this;return new Promise(function(_0x502c58,_0x2b5831){return db[_0xc311('0x15')]['findAll']({'raw':_0x4eb7a8[_0xc311('0x16')]?_0x4eb7a8['options'][_0xc311('0x17')]===undefined?!![]:![]:!![],'where':_0x4eb7a8[_0xc311('0x16')]?_0x4eb7a8[_0xc311('0x16')]['where']||null:null,'attributes':_0x4eb7a8['options']?_0x4eb7a8['options'][_0xc311('0x18')]||null:null,'limit':_0x4eb7a8[_0xc311('0x16')]?_0x4eb7a8[_0xc311('0x16')][_0xc311('0x19')]||null:null,'include':_0x4eb7a8['options']?_0x4eb7a8[_0xc311('0x16')][_0xc311('0x1a')]?_[_0xc311('0x1b')](_0x4eb7a8[_0xc311('0x16')][_0xc311('0x1a')],function(_0x393e2e){return{'model':db[_0x393e2e['model']],'as':_0x393e2e['as'],'attributes':_0x393e2e['attributes'],'include':_0x393e2e['include']?_['map'](_0x393e2e['include'],function(_0x48dfb8){return{'model':db[_0x48dfb8['model']],'as':_0x48dfb8['as'],'attributes':_0x48dfb8[_0xc311('0x18')],'include':_0x48dfb8[_0xc311('0x1a')]?_[_0xc311('0x1b')](_0x48dfb8[_0xc311('0x1a')],function(_0x1ed7c1){return{'model':db[_0x1ed7c1[_0xc311('0x1c')]],'as':_0x1ed7c1['as'],'attributes':_0x1ed7c1[_0xc311('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc311('0x1d')](function(_0x20fbbe){logger[_0xc311('0x1e')](_0xc311('0x14'),_0x4eb7a8);logger[_0xc311('0xd')]('GetTrunk',_0x4eb7a8,JSON[_0xc311('0x1f')](_0x20fbbe));_0x502c58(_0x20fbbe);})[_0xc311('0x13')](function(_0x2610e6){logger[_0xc311('0xf')](_0xc311('0x14'),_0x2610e6['message'],_0x4eb7a8);_0x2b5831(_0x1a53a5['error'](0x1f4,_0x2610e6[_0xc311('0x11')]));});});};exports[_0xc311('0x20')]=function(_0xca17f){var _0x4fb057=this;return new Promise(function(_0x27e620,_0x4846b8){return db[_0xc311('0x15')]['find']({'raw':_0xca17f['options']?_0xca17f[_0xc311('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xca17f['options']?_0xca17f['options'][_0xc311('0x21')]||null:null,'attributes':_0xca17f['options']?_0xca17f[_0xc311('0x16')]['attributes']||null:null,'include':_0xca17f[_0xc311('0x16')]?_0xca17f[_0xc311('0x16')]['include']?_['map'](_0xca17f[_0xc311('0x16')][_0xc311('0x1a')],function(_0x2a2ec6){return{'model':db[_0x2a2ec6[_0xc311('0x1c')]],'as':_0x2a2ec6['as'],'attributes':_0x2a2ec6[_0xc311('0x18')],'include':_0x2a2ec6[_0xc311('0x1a')]?_[_0xc311('0x1b')](_0x2a2ec6['include'],function(_0x3b32ee){return{'model':db[_0x3b32ee[_0xc311('0x1c')]],'as':_0x3b32ee['as'],'attributes':_0x3b32ee['attributes'],'include':_0x3b32ee[_0xc311('0x1a')]?_['map'](_0x3b32ee['include'],function(_0x12bc2a){return{'model':db[_0x12bc2a[_0xc311('0x1c')]],'as':_0x12bc2a['as'],'attributes':_0x12bc2a[_0xc311('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9ab4cd){logger['info'](_0xc311('0x20'),_0xca17f);logger[_0xc311('0xd')]('ShowTrunk',_0xca17f,JSON[_0xc311('0x1f')](_0x9ab4cd));_0x27e620(_0x9ab4cd);})[_0xc311('0x13')](function(_0x4013a1){logger['error'](_0xc311('0x20'),_0x4013a1[_0xc311('0x11')],_0xca17f);_0x4846b8(_0x4fb057[_0xc311('0xf')](0x1f4,_0x4013a1[_0xc311('0x11')]));});});}; \ No newline at end of file +var _0xdd00=['request\x20sent','debug','error','Trunk,\x20%s,\x20%s','message','catch','Trunk','findAll','options','where','attributes','limit','map','include','model','GetTrunk','stringify','ShowTrunk','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x13c6d7,_0x3f8b37){var _0x586468=function(_0x4f7c96){while(--_0x4f7c96){_0x13c6d7['push'](_0x13c6d7['shift']());}};_0x586468(++_0x3f8b37);}(_0xdd00,0x12c));var _0x0dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd00[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0dd0('0x0'));var util=require(_0x0dd0('0x1'));var moment=require(_0x0dd0('0x2'));var BPromise=require(_0x0dd0('0x3'));var rs=require(_0x0dd0('0x4'));var fs=require('fs');var Redis=require(_0x0dd0('0x5'));var db=require(_0x0dd0('0x6'))['db'];var utils=require(_0x0dd0('0x7'));var logger=require(_0x0dd0('0x8'))('rpc');var config=require(_0x0dd0('0x9'));var jayson=require(_0x0dd0('0xa'));var client=jayson['client'][_0x0dd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30d335,_0x50c9e7,_0x2d7059){return new BPromise(function(_0xbc0dca,_0x2bc296){return client[_0x0dd0('0xc')](_0x30d335,_0x2d7059)[_0x0dd0('0xd')](function(_0x1cf607){logger[_0x0dd0('0xe')]('Trunk,\x20%s,\x20%s',_0x50c9e7,_0x0dd0('0xf'));logger[_0x0dd0('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x50c9e7,_0x0dd0('0xf'),JSON['stringify'](_0x1cf607));if(_0x1cf607[_0x0dd0('0x11')]){if(_0x1cf607[_0x0dd0('0x11')]['code']===0x1f4){logger[_0x0dd0('0x11')](_0x0dd0('0x12'),_0x50c9e7,_0x1cf607[_0x0dd0('0x11')][_0x0dd0('0x13')]);return _0x2bc296(_0x1cf607[_0x0dd0('0x11')][_0x0dd0('0x13')]);}logger[_0x0dd0('0x11')](_0x0dd0('0x12'),_0x50c9e7,_0x1cf607[_0x0dd0('0x11')][_0x0dd0('0x13')]);return _0xbc0dca(_0x1cf607[_0x0dd0('0x11')][_0x0dd0('0x13')]);}else{logger['info'](_0x0dd0('0x12'),_0x50c9e7,_0x0dd0('0xf'));_0xbc0dca(_0x1cf607['result'][_0x0dd0('0x13')]);}})[_0x0dd0('0x14')](function(_0x4b7d2a){logger[_0x0dd0('0x11')](_0x0dd0('0x12'),_0x50c9e7,_0x4b7d2a);_0x2bc296(_0x4b7d2a);});});}exports['GetTrunk']=function(_0x1b89b1){var _0x510446=this;return new Promise(function(_0x30c470,_0x2507ba){return db[_0x0dd0('0x15')][_0x0dd0('0x16')]({'raw':_0x1b89b1[_0x0dd0('0x17')]?_0x1b89b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b89b1[_0x0dd0('0x17')]?_0x1b89b1[_0x0dd0('0x17')][_0x0dd0('0x18')]||null:null,'attributes':_0x1b89b1[_0x0dd0('0x17')]?_0x1b89b1[_0x0dd0('0x17')][_0x0dd0('0x19')]||null:null,'limit':_0x1b89b1[_0x0dd0('0x17')]?_0x1b89b1[_0x0dd0('0x17')][_0x0dd0('0x1a')]||null:null,'include':_0x1b89b1['options']?_0x1b89b1['options']['include']?_[_0x0dd0('0x1b')](_0x1b89b1[_0x0dd0('0x17')][_0x0dd0('0x1c')],function(_0x2b31be){return{'model':db[_0x2b31be['model']],'as':_0x2b31be['as'],'attributes':_0x2b31be[_0x0dd0('0x19')],'include':_0x2b31be[_0x0dd0('0x1c')]?_['map'](_0x2b31be[_0x0dd0('0x1c')],function(_0x55124a){return{'model':db[_0x55124a[_0x0dd0('0x1d')]],'as':_0x55124a['as'],'attributes':_0x55124a[_0x0dd0('0x19')],'include':_0x55124a[_0x0dd0('0x1c')]?_[_0x0dd0('0x1b')](_0x55124a[_0x0dd0('0x1c')],function(_0x2f2330){return{'model':db[_0x2f2330[_0x0dd0('0x1d')]],'as':_0x2f2330['as'],'attributes':_0x2f2330[_0x0dd0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8a120){logger[_0x0dd0('0xe')](_0x0dd0('0x1e'),_0x1b89b1);logger[_0x0dd0('0x10')]('GetTrunk',_0x1b89b1,JSON[_0x0dd0('0x1f')](_0x8a120));_0x30c470(_0x8a120);})[_0x0dd0('0x14')](function(_0xfee35c){logger[_0x0dd0('0x11')](_0x0dd0('0x1e'),_0xfee35c[_0x0dd0('0x13')],_0x1b89b1);_0x2507ba(_0x510446[_0x0dd0('0x11')](0x1f4,_0xfee35c[_0x0dd0('0x13')]));});});};exports[_0x0dd0('0x20')]=function(_0x130448){var _0x1b682b=this;return new Promise(function(_0x28a2c1,_0x5b510b){return db[_0x0dd0('0x15')][_0x0dd0('0x21')]({'raw':_0x130448[_0x0dd0('0x17')]?_0x130448['options'][_0x0dd0('0x22')]===undefined?!![]:![]:!![],'where':_0x130448['options']?_0x130448[_0x0dd0('0x17')][_0x0dd0('0x18')]||null:null,'attributes':_0x130448[_0x0dd0('0x17')]?_0x130448[_0x0dd0('0x17')][_0x0dd0('0x19')]||null:null,'include':_0x130448['options']?_0x130448[_0x0dd0('0x17')][_0x0dd0('0x1c')]?_[_0x0dd0('0x1b')](_0x130448['options'][_0x0dd0('0x1c')],function(_0x5ad7b0){return{'model':db[_0x5ad7b0[_0x0dd0('0x1d')]],'as':_0x5ad7b0['as'],'attributes':_0x5ad7b0[_0x0dd0('0x19')],'include':_0x5ad7b0[_0x0dd0('0x1c')]?_[_0x0dd0('0x1b')](_0x5ad7b0[_0x0dd0('0x1c')],function(_0x5b57d5){return{'model':db[_0x5b57d5[_0x0dd0('0x1d')]],'as':_0x5b57d5['as'],'attributes':_0x5b57d5['attributes'],'include':_0x5b57d5[_0x0dd0('0x1c')]?_[_0x0dd0('0x1b')](_0x5b57d5[_0x0dd0('0x1c')],function(_0x1ff12b){return{'model':db[_0x1ff12b[_0x0dd0('0x1d')]],'as':_0x1ff12b['as'],'attributes':_0x1ff12b[_0x0dd0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0dd0('0xd')](function(_0x43ae99){logger['info'](_0x0dd0('0x20'),_0x130448);logger['debug'](_0x0dd0('0x20'),_0x130448,JSON[_0x0dd0('0x1f')](_0x43ae99));_0x28a2c1(_0x43ae99);})[_0x0dd0('0x14')](function(_0x11a26f){logger[_0x0dd0('0x11')]('ShowTrunk',_0x11a26f[_0x0dd0('0x13')],_0x130448);_0x5b510b(_0x1b682b[_0x0dd0('0x11')](0x1f4,_0x11a26f[_0x0dd0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 152b246..8fe4d52 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 _0x2b4c=['removeOpenchannelAccounts','removeWhatsappAccounts','removeApiKey','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','/describe','describe','get','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getWhatsappInteractions','/:id/teams','getTeams','/: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','getScheduledCalls','getApiKey','post','create','/create_many','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','login','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions'];(function(_0x1516f6,_0x4f5304){var _0x3f1026=function(_0x499b85){while(--_0x499b85){_0x1516f6['push'](_0x1516f6['shift']());}};_0x3f1026(++_0x4f5304);}(_0x2b4c,0xe1));var _0xc2b4=function(_0x54d3cb,_0x3c4e26){_0x54d3cb=_0x54d3cb-0x0;var _0x45fcf9=_0x2b4c[_0x54d3cb];return _0x45fcf9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc2b4('0x0'));var express=require('express');var router=express[_0xc2b4('0x1')]();var fs_extra=require(_0xc2b4('0x2'));var auth=require(_0xc2b4('0x3'));var interaction=require(_0xc2b4('0x4'));var config=require('../../config/environment');var controller=require(_0xc2b4('0x5'));router['get']('/',auth[_0xc2b4('0x6')](),controller['index']);router['get'](_0xc2b4('0x7'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x8')]);router[_0xc2b4('0x9')](_0xc2b4('0xa'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0xb')]);router[_0xc2b4('0x9')](_0xc2b4('0xc'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0xd')]);router[_0xc2b4('0x9')](_0xc2b4('0xe'),auth['isAuthenticated'](),controller[_0xc2b4('0xf')]);router[_0xc2b4('0x9')](_0xc2b4('0x10'),controller[_0xc2b4('0x11')]);router[_0xc2b4('0x9')]('/:id/open_tabs',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x12')]);router[_0xc2b4('0x9')](_0xc2b4('0x13'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x14')]);router[_0xc2b4('0x9')](_0xc2b4('0x15'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x16')]);router['get']('/:id/queues_rt',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x17')]);router[_0xc2b4('0x9')]('/:id/groups',auth['isAuthenticated'](),controller[_0xc2b4('0x18')]);router[_0xc2b4('0x9')](_0xc2b4('0x19'),auth['isAuthenticated'](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xc2b4('0x1a')]);router[_0xc2b4('0x9')](_0xc2b4('0x1b'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x1c')]);router[_0xc2b4('0x9')]('/:id/openchannel/interactions',auth[_0xc2b4('0x6')](),controller['getOpenchannelInteractions']);router[_0xc2b4('0x9')](_0xc2b4('0x1d'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x1e')]);router[_0xc2b4('0x9')](_0xc2b4('0x1f'),auth[_0xc2b4('0x6')](),controller['getSmsInteractions']);router[_0xc2b4('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0xc2b4('0x20')]);router['get'](_0xc2b4('0x21'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x22')]);router['get'](_0xc2b4('0x23'),auth['isAuthenticated'](),controller[_0xc2b4('0x24')]);router[_0xc2b4('0x9')](_0xc2b4('0x25'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x26')]);router[_0xc2b4('0x9')](_0xc2b4('0x27'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x28')]);router[_0xc2b4('0x9')](_0xc2b4('0x29'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x2a')]);router[_0xc2b4('0x9')](_0xc2b4('0x2b'),auth['isAuthenticated'](),controller[_0xc2b4('0x2c')]);router['get'](_0xc2b4('0x2d'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x2e')]);router[_0xc2b4('0x9')](_0xc2b4('0x2f'),auth['isAuthenticated'](),controller[_0xc2b4('0x30')]);router[_0xc2b4('0x9')](_0xc2b4('0x31'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x32')]);router[_0xc2b4('0x9')](_0xc2b4('0x33'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x34')]);router[_0xc2b4('0x9')](_0xc2b4('0x35'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x36')]);router[_0xc2b4('0x9')]('/:id/scheduled_calls',auth['isAuthenticated'](),controller[_0xc2b4('0x37')]);router[_0xc2b4('0x9')]('/:id/api_key',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x38')]);router[_0xc2b4('0x39')](_0xc2b4('0x13'),auth[_0xc2b4('0x6')](),controller['addContacts']);router[_0xc2b4('0x39')]('/',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x3a')]);router['post'](_0xc2b4('0x3b'),auth[_0xc2b4('0x6')](),controller['bulkCreate']);router[_0xc2b4('0x39')](_0xc2b4('0x15'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x3c')]);var upload=multer({'storage':multer[_0xc2b4('0x3d')]({'destination':function(_0x3b877f,_0x148128,_0x5d956c){_0x5d956c(null,path['join'](config[_0xc2b4('0x3e')],_0xc2b4('0x3f')));},'filename':function(_0x405441,_0x47f1c6,_0x52af6d){_0x52af6d(null,util[_0xc2b4('0x40')](_0xc2b4('0x41'),Date['now'](),_0x47f1c6[_0xc2b4('0x42')]));}})});router[_0xc2b4('0x39')](_0xc2b4('0x10'),upload[_0xc2b4('0x43')](_0xc2b4('0x44')),controller[_0xc2b4('0x45')]);router[_0xc2b4('0x39')]('/:id/login',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x46')]);router['post']('/:id/logout',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x47')]);router[_0xc2b4('0x39')](_0xc2b4('0x48'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x49')]);router[_0xc2b4('0x39')](_0xc2b4('0x4a'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x4b')]);router[_0xc2b4('0x39')]('/:id/teams',auth[_0xc2b4('0x6')](),controller['addTeams']);router[_0xc2b4('0x39')](_0xc2b4('0x4c'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x4d')]);router[_0xc2b4('0x39')]('/:id/mail_interactions',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x4e')]);router[_0xc2b4('0x39')](_0xc2b4('0x4f'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x50')]);router['post'](_0xc2b4('0x51'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x52')]);router[_0xc2b4('0x39')](_0xc2b4('0x53'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x54')]);router[_0xc2b4('0x39')](_0xc2b4('0x55'),auth[_0xc2b4('0x6')](),controller['addWhatsappInteractions']);router[_0xc2b4('0x39')]('/:id/fax_accounts',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x56')]);router['post'](_0xc2b4('0x2b'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x57')]);router[_0xc2b4('0x39')](_0xc2b4('0x2d'),auth['isAuthenticated'](),controller[_0xc2b4('0x58')]);router[_0xc2b4('0x39')]('/:id/sms_accounts',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x59')]);router[_0xc2b4('0x39')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xc2b4('0x5a')]);router[_0xc2b4('0x39')](_0xc2b4('0x33'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x5b')]);router['post'](_0xc2b4('0x35'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x5c')]);router[_0xc2b4('0x39')](_0xc2b4('0x5d'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x5e')]);router[_0xc2b4('0x5f')](_0xc2b4('0xe'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x60')]);router[_0xc2b4('0x5f')](_0xc2b4('0x61'),auth[_0xc2b4('0x6')](),controller['changePassword']);router[_0xc2b4('0x62')](_0xc2b4('0x15'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x63')]);router[_0xc2b4('0x62')](_0xc2b4('0x21'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x64')]);router[_0xc2b4('0x62')](_0xc2b4('0xe'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x65')]);router[_0xc2b4('0x62')](_0xc2b4('0x4c'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x66')]);router[_0xc2b4('0x62')](_0xc2b4('0x67'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x68')]);router[_0xc2b4('0x62')](_0xc2b4('0x4f'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0xc2b4('0x62')](_0xc2b4('0x51'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x69')]);router[_0xc2b4('0x62')](_0xc2b4('0x53'),auth['isAuthenticated'](),controller[_0xc2b4('0x6a')]);router[_0xc2b4('0x62')](_0xc2b4('0x55'),auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x6b')]);router['delete'](_0xc2b4('0x29'),auth[_0xc2b4('0x6')](),controller['removeFaxAccounts']);router[_0xc2b4('0x62')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0xc2b4('0x62')]('/:id/openchannel_accounts',auth[_0xc2b4('0x6')](),controller[_0xc2b4('0x6c')]);router[_0xc2b4('0x62')]('/:id/sms_accounts',auth[_0xc2b4('0x6')](),controller['removeSmsAccounts']);router[_0xc2b4('0x62')](_0xc2b4('0x31'),auth[_0xc2b4('0x6')](),controller['removeChatWebsites']);router[_0xc2b4('0x62')](_0xc2b4('0x33'),auth['isAuthenticated'](),controller[_0xc2b4('0x6d')]);router[_0xc2b4('0x62')]('/:id/square_projects',auth[_0xc2b4('0x6')](),controller['removeSquareProjects']);router['delete'](_0xc2b4('0x5d'),auth['isAuthenticated'](),controller[_0xc2b4('0x6e')]);module['exports']=router; \ No newline at end of file +var _0xa431=['removeQueues','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','format','now','single','file','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete'];(function(_0x1cd037,_0x4d368f){var _0x51f3b8=function(_0x33c8b0){while(--_0x33c8b0){_0x1cd037['push'](_0x1cd037['shift']());}};_0x51f3b8(++_0x4d368f);}(_0xa431,0x169));var _0x1a43=function(_0xfb3992,_0x21d585){_0xfb3992=_0xfb3992-0x0;var _0x1d61fe=_0xa431[_0xfb3992];return _0x1d61fe;};'use strict';var multer=require(_0x1a43('0x0'));var util=require(_0x1a43('0x1'));var path=require(_0x1a43('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a43('0x3'));var router=express[_0x1a43('0x4')]();var fs_extra=require(_0x1a43('0x5'));var auth=require(_0x1a43('0x6'));var interaction=require(_0x1a43('0x7'));var config=require(_0x1a43('0x8'));var controller=require(_0x1a43('0x9'));router[_0x1a43('0xa')]('/',auth[_0x1a43('0xb')](),controller[_0x1a43('0xc')]);router[_0x1a43('0xa')](_0x1a43('0xd'),auth[_0x1a43('0xb')](),controller[_0x1a43('0xe')]);router[_0x1a43('0xa')](_0x1a43('0xf'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x10')]);router[_0x1a43('0xa')]('/presence',auth[_0x1a43('0xb')](),controller['getPresence']);router[_0x1a43('0xa')](_0x1a43('0x11'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x12')]);router['get'](_0x1a43('0x13'),controller[_0x1a43('0x14')]);router['get'](_0x1a43('0x15'),auth[_0x1a43('0xb')](),controller['getOpenTabs']);router['get'](_0x1a43('0x16'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x17')]);router[_0x1a43('0xa')](_0x1a43('0x18'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x19')]);router[_0x1a43('0xa')]('/:id/queues_rt',auth[_0x1a43('0xb')](),controller['getVoiceQueuesRt']);router[_0x1a43('0xa')](_0x1a43('0x1a'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x1b')]);router[_0x1a43('0xa')](_0x1a43('0x1c'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x1d')]);router[_0x1a43('0xa')]('/:id/screen_recordings',auth[_0x1a43('0xb')](),controller[_0x1a43('0x1e')]);router[_0x1a43('0xa')](_0x1a43('0x1f'),auth['isAuthenticated'](),controller[_0x1a43('0x20')]);router['get'](_0x1a43('0x21'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x22')]);router[_0x1a43('0xa')](_0x1a43('0x23'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x1a43('0xa')](_0x1a43('0x24'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x25')]);router[_0x1a43('0xa')](_0x1a43('0x26'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x27')]);router[_0x1a43('0xa')]('/:id/whatsapp/interactions',auth[_0x1a43('0xb')](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0x1a43('0xb')](),controller[_0x1a43('0x28')]);router[_0x1a43('0xa')](_0x1a43('0x29'),auth[_0x1a43('0xb')](),controller['getLists']);router[_0x1a43('0xa')](_0x1a43('0x2a'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x2b')]);router[_0x1a43('0xa')](_0x1a43('0x2c'),auth['isAuthenticated'](),controller[_0x1a43('0x2d')]);router['get'](_0x1a43('0x2e'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x2f')]);router[_0x1a43('0xa')](_0x1a43('0x30'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x31')]);router[_0x1a43('0xa')](_0x1a43('0x32'),auth[_0x1a43('0xb')](),controller['getOpenchannelAccounts']);router['get'](_0x1a43('0x33'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x34')]);router[_0x1a43('0xa')](_0x1a43('0x35'),auth[_0x1a43('0xb')](),controller['getChatWebsites']);router[_0x1a43('0xa')](_0x1a43('0x36'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x37')]);router[_0x1a43('0xa')](_0x1a43('0x38'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x39')]);router['get'](_0x1a43('0x3a'),auth['isAuthenticated'](),controller[_0x1a43('0x3b')]);router[_0x1a43('0xa')](_0x1a43('0x3c'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x3d')]);router[_0x1a43('0x3e')](_0x1a43('0x16'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x3f')]);router['post']('/',auth[_0x1a43('0xb')](),controller[_0x1a43('0x40')]);router[_0x1a43('0x3e')]('/create_many',auth[_0x1a43('0xb')](),controller[_0x1a43('0x41')]);router[_0x1a43('0x3e')](_0x1a43('0x18'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x42')]);var upload=multer({'storage':multer[_0x1a43('0x43')]({'destination':function(_0x517a80,_0x51dd01,_0x57f2d7){_0x57f2d7(null,path[_0x1a43('0x44')](config['root'],'server/files/images/'));},'filename':function(_0x1766e4,_0x232bc7,_0x41b955){_0x41b955(null,util[_0x1a43('0x45')]('%s-%s',Date[_0x1a43('0x46')](),_0x232bc7['originalname']));}})});router['post'](_0x1a43('0x13'),upload[_0x1a43('0x47')](_0x1a43('0x48')),controller['addAvatar']);router[_0x1a43('0x3e')](_0x1a43('0x49'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x4a')]);router[_0x1a43('0x3e')](_0x1a43('0x4b'),auth[_0x1a43('0xb')](),controller['logout']);router['post'](_0x1a43('0x4c'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x4d')]);router[_0x1a43('0x3e')](_0x1a43('0x4e'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x4f')]);router['post'](_0x1a43('0x50'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x51')]);router[_0x1a43('0x3e')](_0x1a43('0x52'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x53')]);router['post'](_0x1a43('0x54'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x55')]);router[_0x1a43('0x3e')](_0x1a43('0x56'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x57')]);router[_0x1a43('0x3e')](_0x1a43('0x58'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x59')]);router[_0x1a43('0x3e')](_0x1a43('0x5a'),auth['isAuthenticated'](),controller[_0x1a43('0x5b')]);router[_0x1a43('0x3e')](_0x1a43('0x5c'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x5d')]);router['post'](_0x1a43('0x2e'),auth[_0x1a43('0xb')](),controller['addFaxAccounts']);router[_0x1a43('0x3e')](_0x1a43('0x30'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x5e')]);router[_0x1a43('0x3e')]('/:id/openchannel_accounts',auth[_0x1a43('0xb')](),controller[_0x1a43('0x5f')]);router[_0x1a43('0x3e')](_0x1a43('0x33'),auth[_0x1a43('0xb')](),controller['addSmsAccounts']);router[_0x1a43('0x3e')]('/:id/chat_websites',auth[_0x1a43('0xb')](),controller[_0x1a43('0x60')]);router[_0x1a43('0x3e')](_0x1a43('0x36'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x61')]);router[_0x1a43('0x3e')](_0x1a43('0x38'),auth[_0x1a43('0xb')](),controller['addSquareProjects']);router[_0x1a43('0x3e')]('/:id/api_key',auth[_0x1a43('0xb')](),controller[_0x1a43('0x62')]);router['put'](_0x1a43('0x11'),auth[_0x1a43('0xb')](),controller['update']);router[_0x1a43('0x63')](_0x1a43('0x64'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x65')]);router[_0x1a43('0x66')](_0x1a43('0x18'),auth['isAuthenticated'](),controller[_0x1a43('0x67')]);router[_0x1a43('0x66')](_0x1a43('0x50'),auth[_0x1a43('0xb')](),controller['removeTeams']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1a43('0x68')]);router[_0x1a43('0x66')](_0x1a43('0x52'),auth['isAuthenticated'](),controller[_0x1a43('0x69')]);router['delete']('/:id/mail_interactions',auth[_0x1a43('0xb')](),controller[_0x1a43('0x6a')]);router[_0x1a43('0x66')](_0x1a43('0x56'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x6b')]);router[_0x1a43('0x66')](_0x1a43('0x58'),auth[_0x1a43('0xb')](),controller['removeSmsInteractions']);router['delete'](_0x1a43('0x5a'),auth[_0x1a43('0xb')](),controller['removeOpenchannelInteractions']);router['delete'](_0x1a43('0x5c'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x6c')]);router[_0x1a43('0x66')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x1a43('0x6d')]);router['delete'](_0x1a43('0x30'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x6e')]);router[_0x1a43('0x66')]('/:id/openchannel_accounts',auth[_0x1a43('0xb')](),controller[_0x1a43('0x6f')]);router['delete']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x1a43('0x70')]);router[_0x1a43('0x66')](_0x1a43('0x35'),auth[_0x1a43('0xb')](),controller[_0x1a43('0x71')]);router[_0x1a43('0x66')](_0x1a43('0x36'),auth[_0x1a43('0xb')](),controller['removeWhatsappAccounts']);router[_0x1a43('0x66')](_0x1a43('0x38'),auth['isAuthenticated'](),controller[_0x1a43('0x72')]);router[_0x1a43('0x66')](_0x1a43('0x3c'),auth['isAuthenticated'](),controller[_0x1a43('0x73')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 11f8bbd..c5c5677 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 _0x0adf=['false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','admin','user','agent','telephone','local','accountcode','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','info','shortinfo','inband','auto','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','accept','refuse','uac','uas','fingerprint','passive','actpass','update','update,nonat','showWebBar','isArray','udp','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true'];(function(_0x247282,_0x7a92cf){var _0x5a116e=function(_0x16bbb4){while(--_0x16bbb4){_0x247282['push'](_0x247282['shift']());}};_0x5a116e(++_0x7a92cf);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x421c41,_0xd07014){_0x421c41=_0x421c41-0x0;var _0x23c5bb=_0x0adf[_0x421c41];return _0x23c5bb;};'use strict';var Sequelize=require(_0xf0ad('0x0'));var moment=require(_0xf0ad('0x1'));var util=require(_0xf0ad('0x2'));var _=require('lodash');module[_0xf0ad('0x3')]={'name':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':![],'unique':_0xf0ad('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x187aa4){this[_0xf0ad('0x6')](_0xf0ad('0x5'),_0x187aa4);this[_0xf0ad('0x6')]('defaultuser',_0x187aa4);},'comment':_0xf0ad('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2eca0e){this[_0xf0ad('0x6')](_0xf0ad('0x8'),_0x2eca0e);this[_0xf0ad('0x6')](_0xf0ad('0x9'),util[_0xf0ad('0xa')](_0xf0ad('0xb'),_0x2eca0e,this['getDataValue'](_0xf0ad('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':![],'unique':_0xf0ad('0xd'),'validate':{'isEmail':!![]},'set':function(_0x43fb01){if(_0x43fb01){this[_0xf0ad('0x6')](_0xf0ad('0xd'),_0x43fb01['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xf0ad('0xe'),_0xf0ad('0xf'),_0xf0ad('0x10'),_0xf0ad('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf0ad('0x4')],'defaultValue':_0xf0ad('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x5332e9){this[_0xf0ad('0x6')]('internal',_0x5332e9);this[_0xf0ad('0x6')](_0xf0ad('0x13'),_0x5332e9);this[_0xf0ad('0x6')](_0xf0ad('0x9'),util[_0xf0ad('0xa')]('\x22%s\x22\x20<%s>',this[_0xf0ad('0x14')](_0xf0ad('0x8')),_0x5332e9));}},'salt':{'type':Sequelize[_0xf0ad('0x4')]},'phone':{'type':Sequelize[_0xf0ad('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xf0ad('0x4')]},'userpic':{'type':Sequelize[_0xf0ad('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xf0ad('0x4')]},'online':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xf0ad('0x16')]},'voicePause':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf0ad('0x4')],'defaultValue':_0xf0ad('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf0ad('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf0ad('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![],'defaultValue':_0xf0ad('0x19')},'ipaddr':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xf0ad('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x1b'),_0xf0ad('0xf'),_0xf0ad('0x1c')),'allowNull':!![],'defaultValue':_0xf0ad('0x1b')},'context':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![],'defaultValue':_0xf0ad('0x1d')},'callingpres':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x1e'),'ALLOWED_PASSED_SCREEN',_0xf0ad('0x1f'),'ALLOWED',_0xf0ad('0x20'),'PROHIB_PASSED_SCREEN',_0xf0ad('0x21'),_0xf0ad('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x4fd680){this[_0xf0ad('0x6')](_0xf0ad('0x23'),_0x4fd680?_0x4fd680[_0xf0ad('0x24')](','):null);},'get':function(){return this[_0xf0ad('0x14')]('transport')?this[_0xf0ad('0x14')]('transport')[_0xf0ad('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xf0ad('0x1a')]('rfc2833',_0xf0ad('0x26'),_0xf0ad('0x27'),_0xf0ad('0x28'),_0xf0ad('0x29')),'allowNull':!![],'defaultValue':_0xf0ad('0x2a')},'directmedia':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no',_0xf0ad('0x2c'),'update',_0xf0ad('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![],'defaultValue':_0xf0ad('0x2e'),'set':function(_0x2eeb3f){this[_0xf0ad('0x6')]('nat',_0x2eeb3f?_0x2eeb3f[_0xf0ad('0x24')](','):null);},'get':function(){return this[_0xf0ad('0x14')](_0xf0ad('0x2f'))?this[_0xf0ad('0x14')](_0xf0ad('0x2f'))[_0xf0ad('0x25')](','):null;},'comment':_0xf0ad('0x30')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf0ad('0x4')]},'pickupgroup':{'type':Sequelize[_0xf0ad('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xf0ad('0x4')]},'language':{'type':Sequelize[_0xf0ad('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf0ad('0x4')]},'disallow':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':![],'defaultValue':_0xf0ad('0x31')},'allow':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':![],'defaultValue':_0xf0ad('0x32'),'set':function(_0x5dd631){this[_0xf0ad('0x6')](_0xf0ad('0x33'),_0x5dd631?_0x5dd631[_0xf0ad('0x24')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0xf0ad('0x14')](_0xf0ad('0x33'))[_0xf0ad('0x25')](';'):null;},'comment':_0xf0ad('0x34')},'autoframing':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![],'set':function(_0x1dcbd0){this[_0xf0ad('0x6')](_0xf0ad('0x35'),_0x1dcbd0?_0x1dcbd0[_0xf0ad('0x24')](','):null);},'get':function(){return this['getDataValue']('insecure')?this['getDataValue'](_0xf0ad('0x35'))[_0xf0ad('0x25')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no',_0xf0ad('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![],'defaultValue':_0xf0ad('0x37')},'amaflags':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xf0ad('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf0ad('0x1a')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x38'),_0xf0ad('0x39'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x3a'),_0xf0ad('0x3b')),'allowNull':!![],'defaultValue':_0xf0ad('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xf0ad('0x2b')},'keepalive':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf0ad('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xf0ad('0x2b'),'no',_0xf0ad('0x3c'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xf0ad('0x3d'),_0xf0ad('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf0ad('0x1a')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no',_0xf0ad('0x2c'),_0xf0ad('0x3f'),_0xf0ad('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xf0ad('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xf0ad('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0,'set':function(_0x14487a){this['setDataValue'](_0xf0ad('0x41'),_0x14487a);var _0x17d24c=this['get']({'plain':!![]});switch(_0x14487a){case 0x0:case 0x1:var _0xecfee9=_0x17d24c[_0xf0ad('0x23')]?_[_0xf0ad('0x42')](_0x17d24c['transport'])?_0x17d24c[_0xf0ad('0x23')][_0xf0ad('0x24')]():_0x17d24c[_0xf0ad('0x23')]:_0xf0ad('0x43');if(_0xecfee9===_0xf0ad('0x44')){_0xecfee9=_0xf0ad('0x43');}this[_0xf0ad('0x6')](_0xf0ad('0x23'),_0xecfee9);this['setDataValue'](_0xf0ad('0x45'),'no');this['setDataValue'](_0xf0ad('0x46'),null);this[_0xf0ad('0x6')](_0xf0ad('0x47'),null);this['setDataValue'](_0xf0ad('0x48'),null);this['setDataValue'](_0xf0ad('0x49'),null);this[_0xf0ad('0x6')](_0xf0ad('0x4a'),null);this[_0xf0ad('0x6')](_0xf0ad('0x4b'),null);this[_0xf0ad('0x6')](_0xf0ad('0x4c'),null);this['setDataValue'](_0xf0ad('0x4d'),null);this[_0xf0ad('0x6')]('rtcp_mux','no');break;case 0x2:this[_0xf0ad('0x6')](_0xf0ad('0x23'),_0xf0ad('0x44'));this[_0xf0ad('0x6')](_0xf0ad('0x45'),_0xf0ad('0x2b'));this[_0xf0ad('0x6')](_0xf0ad('0x46'),_0xf0ad('0x2b'));this[_0xf0ad('0x6')](_0xf0ad('0x47'),_0xf0ad('0x2b'));this[_0xf0ad('0x6')]('icesupport',_0xf0ad('0x2b'));this[_0xf0ad('0x6')](_0xf0ad('0x49'),_0xf0ad('0x2b'));this['setDataValue'](_0xf0ad('0x4a'),'no');this[_0xf0ad('0x6')](_0xf0ad('0x4b'),'actpass');this[_0xf0ad('0x6')]('dtlscertfile',_0x17d24c[_0xf0ad('0x4c')]||_0xf0ad('0x4e'));this[_0xf0ad('0x6')](_0xf0ad('0x4d'),_0x17d24c['dtlsprivatekey']||_0xf0ad('0x4f'));this['setDataValue']('rtcp_mux',_0xf0ad('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0xf0ad('0x50')],'set':function(_0x119b0d){this[_0xf0ad('0x6')](_0xf0ad('0x51'),_0x119b0d?_0x119b0d['join'](','):[]);},'get':function(){return this['getDataValue'](_0xf0ad('0x51'))?_[_0xf0ad('0x52')](this[_0xf0ad('0x14')](_0xf0ad('0x51'))[_0xf0ad('0x25')](','),function(_0x1d9e1f){return parseInt(_0x1d9e1f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xf0ad('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xf0ad('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf0ad('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf0ad('0x1a')](_0xf0ad('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xf0ad('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf0ad('0x53')],'get':function(){return this['getDataValue'](_0xf0ad('0x54'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xf0ad('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf0ad('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![],'set':function(_0x53d4c5){if(typeof _0x53d4c5==='string'){var _0x51225e=_0x53d4c5==='1'?!![]:_0x53d4c5==='0'?![]:_0x53d4c5===_0xf0ad('0x55')?!![]:_0x53d4c5===_0xf0ad('0x56')?![]:![];this['setDataValue'](_0xf0ad('0x57'),_0x51225e);}else{this[_0xf0ad('0x6')](_0xf0ad('0x57'),_0x53d4c5);}}},'blocked':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![],'set':function(_0x238011){this[_0xf0ad('0x6')](_0xf0ad('0x58'),_0x238011);if(_0x238011===!![]){this[_0xf0ad('0x6')](_0xf0ad('0x59'),moment());this['setDataValue'](_0xf0ad('0x5a'),0x0);}else{this[_0xf0ad('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xf0ad('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xf0ad('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf0ad('0x18')](0x5)[_0xf0ad('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf0ad('0x15')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4cb5=['rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','dtlscertfile','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x9ed129,_0x4a3d9c){var _0x100eb6=function(_0x356fcc){while(--_0x356fcc){_0x9ed129['push'](_0x9ed129['shift']());}};_0x100eb6(++_0x4a3d9c);}(_0x4cb5,0x8f));var _0x54cb=function(_0x4f3297,_0xb5f9b){_0x4f3297=_0x4f3297-0x0;var _0x389d05=_0x4cb5[_0x4f3297];return _0x389d05;};'use strict';var Sequelize=require(_0x54cb('0x0'));var moment=require(_0x54cb('0x1'));var util=require(_0x54cb('0x2'));var _=require(_0x54cb('0x3'));module['exports']={'name':{'type':Sequelize[_0x54cb('0x4')],'allowNull':![],'unique':_0x54cb('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x240a36){this[_0x54cb('0x6')](_0x54cb('0x5'),_0x240a36);this[_0x54cb('0x6')](_0x54cb('0x7'),_0x240a36);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x54cb('0x4')],'allowNull':![],'set':function(_0x2a3817){this['setDataValue'](_0x54cb('0x8'),_0x2a3817);this['setDataValue'](_0x54cb('0x9'),util[_0x54cb('0xa')](_0x54cb('0xb'),_0x2a3817,this[_0x54cb('0xc')](_0x54cb('0xd'))));}},'alias':{'type':Sequelize[_0x54cb('0x4')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x931085){if(_0x931085){this[_0x54cb('0x6')]('email',_0x931085[_0x54cb('0xe')]());}}},'role':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x10'),_0x54cb('0x11'),_0x54cb('0x12'),_0x54cb('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x54cb('0x4')],'defaultValue':_0x54cb('0x14')},'internal':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':![],'unique':_0x54cb('0xd'),'set':function(_0x203b6b){this[_0x54cb('0x6')]('internal',_0x203b6b);this[_0x54cb('0x6')](_0x54cb('0x16'),_0x203b6b);this[_0x54cb('0x6')](_0x54cb('0x9'),util[_0x54cb('0xa')]('\x22%s\x22\x20<%s>',this[_0x54cb('0xc')](_0x54cb('0x8')),_0x203b6b));}},'salt':{'type':Sequelize[_0x54cb('0x4')]},'phone':{'type':Sequelize[_0x54cb('0x4')]},'mobile':{'type':Sequelize[_0x54cb('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x54cb('0x4')]},'city':{'type':Sequelize[_0x54cb('0x4')]},'country':{'type':Sequelize[_0x54cb('0x4')]},'online':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x54cb('0x18')]},'voicePause':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x54cb('0x19')},'lastPauseAt':{'type':Sequelize[_0x54cb('0x18')]},'chatCapacity':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x54cb('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x54cb('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![],'defaultValue':_0x54cb('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x54cb('0x1b'),_0x54cb('0x11'),'peer'),'allowNull':!![],'defaultValue':_0x54cb('0x1b')},'context':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![],'defaultValue':_0x54cb('0x1c')},'callingpres':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x1d'),_0x54cb('0x1e'),_0x54cb('0x1f'),'ALLOWED',_0x54cb('0x20'),_0x54cb('0x21'),_0x54cb('0x22'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x54cb('0x23'),'set':function(_0x134ab5){this['setDataValue']('transport',_0x134ab5?_0x134ab5[_0x54cb('0x24')](','):null);},'get':function(){return this[_0x54cb('0xc')](_0x54cb('0x25'))?this['getDataValue'](_0x54cb('0x25'))['split'](','):null;},'comment':_0x54cb('0x26')},'dtmfmode':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x27'),_0x54cb('0x28'),_0x54cb('0x29'),_0x54cb('0x2a'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no',_0x54cb('0x2c'),_0x54cb('0x2d'),_0x54cb('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x54cb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x44e5d6){this[_0x54cb('0x6')]('nat',_0x44e5d6?_0x44e5d6[_0x54cb('0x24')](','):null);},'get':function(){return this[_0x54cb('0xc')]('nat')?this[_0x54cb('0xc')]('nat')['split'](','):null;},'comment':_0x54cb('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x54cb('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x54cb('0x4')]},'language':{'type':Sequelize[_0x54cb('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x54cb('0x4')]},'disallow':{'type':Sequelize[_0x54cb('0x4')],'allowNull':![],'defaultValue':_0x54cb('0x30')},'allow':{'type':Sequelize[_0x54cb('0x4')],'allowNull':![],'defaultValue':_0x54cb('0x31'),'set':function(_0x213f57){this[_0x54cb('0x6')](_0x54cb('0x32'),_0x213f57?_0x213f57[_0x54cb('0x24')](';'):_0x54cb('0x31'));},'get':function(){return this[_0x54cb('0xc')](_0x54cb('0x32'))?this['getDataValue'](_0x54cb('0x32'))['split'](';'):null;},'comment':_0x54cb('0x33')},'autoframing':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![],'set':function(_0x5c2b9f){this[_0x54cb('0x6')]('insecure',_0x5c2b9f?_0x5c2b9f['join'](','):null);},'get':function(){return this[_0x54cb('0xc')](_0x54cb('0x34'))?this[_0x54cb('0xc')]('insecure')[_0x54cb('0x35')](','):null;},'comment':_0x54cb('0x36')},'trustrpid':{'type':Sequelize[_0x54cb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x54cb('0xf')]('yes','no',_0x54cb('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![],'defaultValue':_0x54cb('0x38')},'amaflags':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x54cb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x54cb('0x2b')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x54cb('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no',_0x54cb('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x54cb('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x3a'),_0x54cb('0x3b'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x54cb('0x3c'),_0x54cb('0x3d')),'allowNull':!![],'defaultValue':_0x54cb('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x54cb('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x54cb('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x54cb('0xf')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x54cb('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x54cb('0x2b'),'no',_0x54cb('0x3e'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x3f'),_0x54cb('0x40'),_0x54cb('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x54cb('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no',_0x54cb('0x2c'),_0x54cb('0x2d'),_0x54cb('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x54cb('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x54cb('0x18')]},'passwordResetAt':{'type':Sequelize[_0x54cb('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x54cb('0x43')]},'showWebBar':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0,'set':function(_0x1d60fd){this[_0x54cb('0x6')](_0x54cb('0x44'),_0x1d60fd);var _0xea433c=this[_0x54cb('0x45')]({'plain':!![]});switch(_0x1d60fd){case 0x0:case 0x1:var _0xff117c=_0xea433c['transport']?_[_0x54cb('0x46')](_0xea433c[_0x54cb('0x25')])?_0xea433c[_0x54cb('0x25')]['join']():_0xea433c['transport']:_0x54cb('0x23');if(_0xff117c===_0x54cb('0x47')){_0xff117c='udp';}this[_0x54cb('0x6')](_0x54cb('0x25'),_0xff117c);this['setDataValue'](_0x54cb('0x48'),'no');this[_0x54cb('0x6')](_0x54cb('0x49'),null);this[_0x54cb('0x6')](_0x54cb('0x4a'),null);this[_0x54cb('0x6')](_0x54cb('0x4b'),null);this[_0x54cb('0x6')](_0x54cb('0x4c'),null);this['setDataValue'](_0x54cb('0x4d'),null);this['setDataValue'](_0x54cb('0x4e'),null);this[_0x54cb('0x6')]('dtlscertfile',null);this[_0x54cb('0x6')](_0x54cb('0x4f'),null);this[_0x54cb('0x6')](_0x54cb('0x50'),'no');break;case 0x2:this['setDataValue']('transport',_0x54cb('0x47'));this[_0x54cb('0x6')](_0x54cb('0x48'),_0x54cb('0x2b'));this[_0x54cb('0x6')](_0x54cb('0x49'),'yes');this[_0x54cb('0x6')](_0x54cb('0x4a'),_0x54cb('0x2b'));this[_0x54cb('0x6')](_0x54cb('0x4b'),_0x54cb('0x2b'));this[_0x54cb('0x6')](_0x54cb('0x4c'),_0x54cb('0x2b'));this[_0x54cb('0x6')](_0x54cb('0x4d'),'no');this['setDataValue'](_0x54cb('0x4e'),_0x54cb('0x41'));this[_0x54cb('0x6')](_0x54cb('0x51'),_0xea433c[_0x54cb('0x51')]||'/etc/pki/tls/certs/motion.crt');this[_0x54cb('0x6')](_0x54cb('0x4f'),_0xea433c[_0x54cb('0x4f')]||'/etc/pki/tls/private/motion.key');this[_0x54cb('0x6')]('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x139572){this[_0x54cb('0x6')](_0x54cb('0x52'),_0x139572?_0x139572[_0x54cb('0x24')](','):[]);},'get':function(){return this[_0x54cb('0xc')](_0x54cb('0x52'))?_['map'](this[_0x54cb('0xc')]('permissions')[_0x54cb('0x35')](','),function(_0x386147){return parseInt(_0x386147,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x54cb('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x54cb('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x54cb('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x54cb('0xf')](_0x54cb('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x54cb('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x54cb('0x53')],'get':function(){return this[_0x54cb('0xc')](_0x54cb('0x54'))?this['getDataValue'](_0x54cb('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x54cb('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x2e7dbd){if(typeof _0x2e7dbd===_0x54cb('0x55')){var _0x26c035=_0x2e7dbd==='1'?!![]:_0x2e7dbd==='0'?![]:_0x2e7dbd===_0x54cb('0x56')?!![]:_0x2e7dbd===_0x54cb('0x57')?![]:![];this[_0x54cb('0x6')](_0x54cb('0x58'),_0x26c035);}else{this[_0x54cb('0x6')](_0x54cb('0x58'),_0x2e7dbd);}}},'blocked':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':![],'set':function(_0x184496){this[_0x54cb('0x6')](_0x54cb('0x59'),_0x184496);if(_0x184496===!![]){this['setDataValue'](_0x54cb('0x5a'),moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0x54cb('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x54cb('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x54cb('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x54cb('0x17')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 7c94513..27ab224 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 _0x9536=['status','end','json','offset','undefined','count','Content-Range','update','then','admin','Users','user','Agents','Telephones','filter','value','includes','UserProfileResource','destroy','stack','name','send','index','User','rawAttributes','map','fieldName','type','key','where','query','includeAll','include','attributes','findAll','rows','openTabs','true','length','push','sms','dataValues','fax','mail','openchannel','whatsapp','all','params','model','differenceBy','keys','password','salt','intersection','fields','find','body','role','describe','addContacts','ids','omit','Setting','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','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)','sequelize','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','102','110','104','107','108','109','100','114','115','create','agent','Unauthorized','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','each','telephone','isEmpty','autoAssociation','compact','changePassword','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','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','add','toLowerCase','Queues','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','get','format','SIP/%s','penalty','upsert','removeQueues','isValidChannel','remove','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','file','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','chat','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','order','sort','filters','pick','merge','options','CmList','List','tag','hasOwnProperty','nolimit','limit','getContacts','getQueues','Queue','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','phone','mobile','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','smsPause','whatsapppause','pauseType','manual','set','%s%s','Pause','getTeams','addTeams','Team','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','Fax','getOpenchannelQueues','Openchannel','flatten','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','transaction','removeAgent','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$gt','$lt','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contained','$any','firstName','CmContact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','queues','resolve','inbound','getAgents','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','client','http','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4db3da,_0x3e8243){var _0x4cea8b=function(_0x25fe9d){while(--_0x25fe9d){_0x4db3da['push'](_0x4db3da['shift']());}};_0x4cea8b(++_0x3e8243);}(_0x9536,0x179));var _0x6953=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0x9536[_0xd8a8af];return _0x5b7278;};'use strict';var moment=require(_0x6953('0x0'));var BPromise=require(_0x6953('0x1'));var util=require(_0x6953('0x2'));var path=require(_0x6953('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6953('0x4'));var jayson=require('jayson/promise');var Redis=require(_0x6953('0x5'));var authService=require(_0x6953('0x6'));var qs=require(_0x6953('0x7'));var logger=require(_0x6953('0x8'))(_0x6953('0x9'));var utils=require('../../config/utils');var config=require(_0x6953('0xa'));var licenseUtil=require(_0x6953('0xb'));var db=require(_0x6953('0xc'))['db'];var socket=require(_0x6953('0xd'))(new Redis(config[_0x6953('0xe')]));require('./user.socket')[_0x6953('0xf')](socket);config[_0x6953('0xe')]=_[_0x6953('0x10')](config['redis'],{'host':_0x6953('0x11'),'port':0x18eb});var client=jayson[_0x6953('0x12')][_0x6953('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0xb13f2c,_0x448c89,_0x1f3062,_0x246534){return new BPromise(function(_0x2144c5,_0xdd0b40){var _0x57652e=_0x246534||client;return _0x57652e[_0x6953('0x14')](_0xb13f2c,_0x1f3062)['then'](function(_0x8de91e){logger[_0x6953('0x15')](_0x6953('0x16'),_0x448c89,_0x6953('0x17'));logger[_0x6953('0x18')](_0x6953('0x19'),_0x448c89,_0x6953('0x17'),JSON[_0x6953('0x1a')](_0x8de91e));if(_0x8de91e[_0x6953('0x1b')]){if(_0x8de91e[_0x6953('0x1b')][_0x6953('0x1c')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x448c89,_0x8de91e[_0x6953('0x1b')][_0x6953('0x1d')]);return _0xdd0b40(_0x8de91e[_0x6953('0x1b')][_0x6953('0x1d')]);}logger['error'](_0x6953('0x16'),_0x448c89,_0x8de91e[_0x6953('0x1b')]['message']);return _0x2144c5(_0x8de91e[_0x6953('0x1b')][_0x6953('0x1d')]);}else{logger[_0x6953('0x15')](_0x6953('0x16'),_0x448c89,_0x6953('0x17'));_0x2144c5(_0x8de91e['result'][_0x6953('0x1d')]);}})[_0x6953('0x1e')](function(_0x31d5fd){logger[_0x6953('0x1b')](_0x6953('0x16'),_0x448c89,_0x31d5fd);_0xdd0b40(_0x31d5fd);});});}function respondWithStatusCode(_0x5e33ec,_0xf96d07){_0xf96d07=_0xf96d07||0xcc;return function(_0x1388b7){if(_0x1388b7){return _0x5e33ec['sendStatus'](_0xf96d07);}return _0x5e33ec[_0x6953('0x1f')](_0xf96d07)[_0x6953('0x20')]();};}function respondWithResult(_0xb92529,_0x171dd8){_0x171dd8=_0x171dd8||0xc8;return function(_0x53640a){if(_0x53640a){return _0xb92529[_0x6953('0x1f')](_0x171dd8)[_0x6953('0x21')](_0x53640a);}};}function respondWithFilteredResult(_0x2a7f6a,_0x508ea7){return function(_0x495ebd){if(_0x495ebd){var _0x5a4cd7=typeof _0x508ea7[_0x6953('0x22')]===_0x6953('0x23')&&typeof _0x508ea7['limit']===_0x6953('0x23');var _0x587df0=_0x495ebd[_0x6953('0x24')];var _0x2bf39b=_0x5a4cd7?0x0:_0x508ea7[_0x6953('0x22')];var _0x2cc01e=_0x5a4cd7?_0x495ebd[_0x6953('0x24')]:_0x508ea7[_0x6953('0x22')]+_0x508ea7['limit'];var _0x3dd890;if(_0x2cc01e>=_0x587df0){_0x2cc01e=_0x587df0;_0x3dd890=0xc8;}else{_0x3dd890=0xce;}_0x2a7f6a[_0x6953('0x1f')](_0x3dd890);return _0x2a7f6a['set'](_0x6953('0x25'),_0x2bf39b+'-'+_0x2cc01e+'/'+_0x587df0)['json'](_0x495ebd);}return null;};}function saveUpdates(_0x173b3c){return function(_0x3b1175){if(_0x3b1175){return _0x3b1175[_0x6953('0x26')](_0x173b3c)['then'](function(_0x131992){return _0x131992;});}return null;};}function removeEntity(_0x3d7b04){return function(_0xf78141){if(_0xf78141){return _0xf78141['destroy']()[_0x6953('0x27')](function(){var _0x132a71=_0xf78141['get']({'plain':!![]});if(_0x132a71['role']===_0x6953('0x28'))return;var _0x44389b=[{'name':_0x6953('0x29'),'value':_0x6953('0x2a'),'ignore':!![]},{'name':_0x6953('0x2b'),'value':'agent','ignore':![]},{'name':_0x6953('0x2c'),'value':'telephone','ignore':![]}];var _0x2d5e76=_(_0x44389b)[_0x6953('0x2d')]('ignore')['map'](_0x6953('0x2e'))[_0x6953('0x2e')]();if(_[_0x6953('0x2f')](_0x2d5e76,_0x132a71['role'])){return;}var _0x28cb92=_['find'](_0x44389b,['value',_0x132a71['role']])['name'];return db[_0x6953('0x30')][_0x6953('0x31')]({'where':{'type':_0x28cb92,'resourceId':_0x132a71['id']}})[_0x6953('0x27')](function(){return _0xf78141;});})[_0x6953('0x27')](function(){_0x3d7b04[_0x6953('0x1f')](0xcc)[_0x6953('0x20')]();});}};}function handleEntityNotFound(_0x4f6e06){return function(_0x2b76a5){if(!_0x2b76a5){_0x4f6e06['sendStatus'](0x194);}return _0x2b76a5;};}function handleError(_0x199c67,_0x5c9a4e){_0x5c9a4e=_0x5c9a4e||0x1f4;return function(_0xc63da7){logger[_0x6953('0x1b')](_0xc63da7[_0x6953('0x32')]);if(_0xc63da7[_0x6953('0x33')]){delete _0xc63da7['name'];}_0x199c67[_0x6953('0x1f')](_0x5c9a4e)[_0x6953('0x34')](_0xc63da7);};}exports[_0x6953('0x35')]=function(_0xba2c1d,_0x40b6ea){var _0x475ea8={},_0x37b2b3={'count':0x0,'rows':[]};var _0x81428b=_(db[_0x6953('0x36')][_0x6953('0x37')])[_0x6953('0x38')](function(_0x483a33){return{'name':_0x483a33[_0x6953('0x39')],'type':_0x483a33[_0x6953('0x3a')][_0x6953('0x3b')]};})['filter'](function(_0x47e7e7){return!_[_0x6953('0x2f')](['password','salt'],_0x47e7e7[_0x6953('0x33')]);})[_0x6953('0x2e')]();_0x475ea8=qs['getOptions'](_0x81428b,_0xba2c1d);var _0x3434d6={'where':_0x475ea8[_0x6953('0x3c')]};return db[_0x6953('0x36')][_0x6953('0x24')](_0x3434d6)[_0x6953('0x27')](function(_0x4d7f59){_0x37b2b3['count']=_0x4d7f59;if(_0xba2c1d[_0x6953('0x3d')][_0x6953('0x3e')]){_0x475ea8[_0x6953('0x3f')]=[{'all':!![]}];}if(!_[_0x6953('0x2f')](_0x475ea8[_0x6953('0x40')],'id')){_0x475ea8[_0x6953('0x40')]['push']('id');}return db['User'][_0x6953('0x41')](_0x475ea8);})['then'](function(_0x588ff8){_0x37b2b3[_0x6953('0x42')]=_0x588ff8;if(_0xba2c1d[_0x6953('0x3d')][_0x6953('0x43')]===_0x6953('0x44')){var _0x139a84=[];for(var _0x5ac8f7=0x0;_0x5ac8f7<_0x37b2b3['rows'][_0x6953('0x45')];_0x5ac8f7++){_0x139a84[_0x6953('0x46')](get_open_tabs('chat',_0x37b2b3[_0x6953('0x42')][_0x5ac8f7]['dataValues']));_0x139a84[_0x6953('0x46')](get_open_tabs(_0x6953('0x47'),_0x37b2b3[_0x6953('0x42')][_0x5ac8f7][_0x6953('0x48')]));_0x139a84['push'](get_open_tabs(_0x6953('0x49'),_0x37b2b3[_0x6953('0x42')][_0x5ac8f7]['dataValues']));_0x139a84[_0x6953('0x46')](get_open_tabs(_0x6953('0x4a'),_0x37b2b3[_0x6953('0x42')][_0x5ac8f7][_0x6953('0x48')]));_0x139a84[_0x6953('0x46')](get_open_tabs(_0x6953('0x4b'),_0x37b2b3[_0x6953('0x42')][_0x5ac8f7][_0x6953('0x48')]));_0x139a84[_0x6953('0x46')](get_open_tabs(_0x6953('0x4c'),_0x37b2b3[_0x6953('0x42')][_0x5ac8f7]['dataValues']));}return BPromise[_0x6953('0x4d')](_0x139a84)['then'](function(_0x15c142){return _0x37b2b3;});}else{return _0x37b2b3;}})[_0x6953('0x27')](respondWithFilteredResult(_0x40b6ea,_0x475ea8))[_0x6953('0x1e')](handleError(_0x40b6ea,null));};exports['show']=function(_0xfb9613,_0x2a4e54){var _0x506561={'raw':![],'where':{'id':_0xfb9613[_0x6953('0x4e')]['id']}},_0x525145={};_0x525145[_0x6953('0x4f')]=_[_0x6953('0x50')](_[_0x6953('0x51')](db[_0x6953('0x36')][_0x6953('0x37')]),[_0x6953('0x52'),_0x6953('0x53')]);_0x525145[_0x6953('0x3d')]=_[_0x6953('0x51')](_0xfb9613[_0x6953('0x3d')]);_0x525145['filters']=_['intersection'](_0x525145[_0x6953('0x4f')],_0x525145[_0x6953('0x3d')]);_0x506561[_0x6953('0x40')]=_[_0x6953('0x54')](_0x525145[_0x6953('0x4f')],qs[_0x6953('0x55')](_0xfb9613[_0x6953('0x3d')][_0x6953('0x55')]));_0x506561[_0x6953('0x40')]=_0x506561['attributes']['length']?_0x506561['attributes']:_0x525145['model'];if(_0xfb9613[_0x6953('0x3d')][_0x6953('0x3e')]){_0x506561[_0x6953('0x3f')]=[{'all':!![]}];}_0x506561=_['merge']({},_0x506561,_0xfb9613['options']);if(!_[_0x6953('0x2f')](_0x506561[_0x6953('0x40')],'id')){_0x506561[_0x6953('0x40')]['push']('id');}return db['User'][_0x6953('0x56')](_0x506561)[_0x6953('0x27')](handleEntityNotFound(_0x2a4e54,null))['then'](function(_0x58fcb3){var _0x29937b=[];values=_0x58fcb3;if(_0xfb9613[_0x6953('0x3d')][_0x6953('0x43')]===_0x6953('0x44')){_0x29937b[_0x6953('0x46')](get_open_tabs('chat',_0x58fcb3[_0x6953('0x48')]));_0x29937b[_0x6953('0x46')](get_open_tabs('sms',_0x58fcb3[_0x6953('0x48')]));_0x29937b['push'](get_open_tabs(_0x6953('0x4b'),_0x58fcb3[_0x6953('0x48')]));_0x29937b[_0x6953('0x46')](get_open_tabs(_0x6953('0x4c'),_0x58fcb3['dataValues']));_0x29937b[_0x6953('0x46')](get_open_tabs(_0x6953('0x49'),_0x58fcb3[_0x6953('0x48')]));_0x29937b['push'](get_open_tabs('mail',_0x58fcb3[_0x6953('0x48')]));return BPromise[_0x6953('0x4d')](_0x29937b);}else{return values;}})[_0x6953('0x27')](function(_0x482f3b){return values;})['then'](respondWithResult(_0x2a4e54,null))[_0x6953('0x1e')](handleError(_0x2a4e54,null));};exports[_0x6953('0x26')]=function(_0x4c0f1c,_0x4f3df2){if(_0x4c0f1c[_0x6953('0x57')]['id']){delete _0x4c0f1c['body']['id'];}delete _0x4c0f1c[_0x6953('0x57')][_0x6953('0x58')];return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0x4c0f1c[_0x6953('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f3df2,null))[_0x6953('0x27')](saveUpdates(_0x4c0f1c[_0x6953('0x57')],null))[_0x6953('0x27')](respondWithResult(_0x4f3df2,null))['catch'](handleError(_0x4f3df2,null));};exports['describe']=function(_0x1c0678,_0x2bf359){return db[_0x6953('0x36')][_0x6953('0x59')]()[_0x6953('0x27')](respondWithResult(_0x2bf359,null))['catch'](handleError(_0x2bf359,null));};exports[_0x6953('0x5a')]=function(_0x2df49c,_0xe93bf2){return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0x2df49c[_0x6953('0x4e')]['id']}})[_0x6953('0x27')](handleEntityNotFound(_0xe93bf2,null))[_0x6953('0x27')](function(_0x1cbc70){if(_0x1cbc70){return _0x1cbc70[_0x6953('0x5a')](_0x2df49c[_0x6953('0x57')][_0x6953('0x5b')],_[_0x6953('0x5c')](_0x2df49c['body'],[_0x6953('0x5b'),'id'])||{});}})[_0x6953('0x27')](respondWithResult(_0xe93bf2,null))[_0x6953('0x1e')](handleError(_0xe93bf2,null));};function validateUser(_0x20efa9){return new BPromise(function(_0x38674d,_0x523a4a){if(_0x20efa9['internal'])return _0x38674d(_0x20efa9);return db[_0x6953('0x5d')]['findById'](0x1)[_0x6953('0x27')](function(_0x2b5de2){if(_0x2b5de2[_0x6953('0x5e')])authService[_0x6953('0x5f')](_0x20efa9['password']);db[_0x6953('0x36')][_0x6953('0x60')](_0x6953('0x61'))[_0x6953('0x27')](function(_0x1c3190){if(_[_0x6953('0x62')](_0x1c3190)){_0x20efa9[_0x6953('0x61')]=_0x2b5de2[_0x6953('0x63')]||0x1;return;}if(_[_0x6953('0x62')](_0x2b5de2[_0x6953('0x63')])||_0x2b5de2[_0x6953('0x63')]===_0x1c3190){_0x20efa9[_0x6953('0x61')]=_0x1c3190+0x1;return;}if(_0x2b5de2[_0x6953('0x63')]>_0x1c3190){_0x20efa9[_0x6953('0x61')]=_0x2b5de2[_0x6953('0x63')];return;}return db['sequelize'][_0x6953('0x3d')](_0x6953('0x64'),{'type':db[_0x6953('0x65')][_0x6953('0x66')][_0x6953('0x67')]})[_0x6953('0x27')](function(_0x3e19f1){if(_0x3e19f1&&_0x3e19f1['length']){for(var _0x3bb873=0x0,_0x403d81=_0x3e19f1['length'];_0x3bb873<_0x403d81&&_[_0x6953('0x62')](_0x20efa9[_0x6953('0x61')]);_0x3bb873++){if(_0x2b5de2[_0x6953('0x63')]<=_0x3e19f1[_0x3bb873]['from']){_0x20efa9['internal']=_0x3e19f1[_0x3bb873][_0x6953('0x68')];}else if(_0x2b5de2[_0x6953('0x63')]>_0x3e19f1[_0x3bb873][_0x6953('0x68')]&&_0x2b5de2[_0x6953('0x63')]<=_0x3e19f1[_0x3bb873]['to']){_0x20efa9[_0x6953('0x61')]=_0x2b5de2[_0x6953('0x63')];}}}if(_[_0x6953('0x62')](_0x20efa9[_0x6953('0x61')])){_0x20efa9[_0x6953('0x61')]=_0x1c3190+0x1;}return _0x38674d(_0x20efa9);});});})['catch'](function(_0x78eb85){_0x523a4a(_0x78eb85);});});}function updateUser(_0x729812){return new BPromise(function(_0x1b641e,_0x3bdb47){try{if(_0x729812['voicemail']){_0x729812[_0x6953('0x69')]=_0x729812[_0x6953('0x61')];_0x729812[_0x6953('0x6a')]={'mailbox':_0x729812['internal'],'password':_0x729812[_0x6953('0x52')],'fullname':_0x729812[_0x6953('0x6b')],'email':_0x729812[_0x6953('0x6c')]};}if(_0x729812[_0x6953('0x58')]==='agent'){if(!_0x729812[_0x6953('0x6d')])_0x729812[_0x6953('0x6d')]=[_0x6953('0x6e'),_0x6953('0x6f'),'103','113',_0x6953('0x70'),_0x6953('0x71'),'105','106',_0x6953('0x72'),_0x6953('0x73'),_0x6953('0x74'),_0x6953('0x75'),'111',_0x6953('0x76'),_0x6953('0x77')];}_0x1b641e(_0x729812);}catch(_0x574606){_0x3bdb47(_0x574606);}});}exports[_0x6953('0x78')]=function(_0xd2aae9,_0x491bae){if(_0xd2aae9['user']['role']===_0x6953('0x79'))throw new Error(_0x6953('0x7a'));if(_0xd2aae9[_0x6953('0x57')][_0x6953('0x58')]===_0x6953('0x2a')&&_0xd2aae9[_0x6953('0x2a')][_0x6953('0x58')]!==_0x6953('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xd2aae9[_0x6953('0x57')][_0x6953('0x58')]===_0x6953('0x28')&&_0xd2aae9[_0x6953('0x2a')][_0x6953('0x58')]!==_0x6953('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x6953('0x7b')]([_0xd2aae9['body']])[_0x6953('0x27')](function(){return validateUser(_0xd2aae9['body']);})[_0x6953('0x27')](function(_0x9de87a){return updateUser(_0x9de87a)[_0x6953('0x27')](function(_0x50d2e0){if(_0x50d2e0[_0x6953('0x58')]===_0x6953('0x28')){_0x50d2e0[_0x6953('0x7c')]=_0xd2aae9[_0x6953('0x2a')][_0x6953('0x7c')];delete _0x50d2e0[_0x6953('0x7d')];}return _0x50d2e0;});})['then'](function(_0x24a666){return db[_0x6953('0x36')][_0x6953('0x78')](_0x24a666,{'include':[{'model':db[_0x6953('0x6a')],'as':_0x6953('0x6a')}]});})[_0x6953('0x27')](function(_0x19716d){if(_0xd2aae9[_0x6953('0x57')][_0x6953('0x58')]===_0x6953('0x2a'))return _0x19716d;if(_0xd2aae9[_0x6953('0x2a')]['role']!==_0x6953('0x2a'))return _0x19716d;return db[_0x6953('0x7e')][_0x6953('0x56')]({'where':{'name':_0x19716d[_0x6953('0x58')]===_0x6953('0x79')?_0x6953('0x2b'):_0x6953('0x2c'),'userProfileId':_0xd2aae9[_0x6953('0x2a')][_0x6953('0x7d')]},'raw':!![]})[_0x6953('0x27')](function(_0x2feda2){if(!_0x2feda2||_0x2feda2['autoAssociation']!=0x0)return _0x19716d;return db[_0x6953('0x30')][_0x6953('0x78')]({'name':_0x19716d[_0x6953('0x33')],'resourceId':_0x19716d['id'],'type':_0x2feda2['name'],'sectionId':_0x2feda2['id']},{})[_0x6953('0x27')](function(){return _0x19716d;});})['catch'](function(_0x5c2078){logger[_0x6953('0x1b')](_0x6953('0x7f'),_0x5c2078);throw _0x5c2078;});})[_0x6953('0x27')](respondWithResult(_0x491bae,0xc9))[_0x6953('0x1e')](handleError(_0x491bae,null));};exports[_0x6953('0x80')]=function(_0x2928c3,_0x228544){var _0x5e34b6=_0x2928c3[_0x6953('0x57')];var _0x3113c0=[];if(_0x2928c3[_0x6953('0x2a')]['role']===_0x6953('0x79'))throw new Error(_0x6953('0x7a'));if(_['some'](_0x5e34b6,[_0x6953('0x58'),'user'])&&_0x2928c3['user'][_0x6953('0x58')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x6953('0x81')](_0x5e34b6,[_0x6953('0x58'),_0x6953('0x28')])&&_0x2928c3['user'][_0x6953('0x58')]!==_0x6953('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x6953('0x7b')](_0x5e34b6)[_0x6953('0x27')](function(){return validateUser(_0x5e34b6[0x0]);})[_0x6953('0x27')](function(){for(var _0x200599=0x1;_0x200599<_0x5e34b6[_0x6953('0x45')];_0x200599++){var _0x31d847=_0x5e34b6[_0x200599-0x1][_0x6953('0x61')];if(!_0x5e34b6[_0x200599][_0x6953('0x61')])_0x5e34b6[_0x200599][_0x6953('0x61')]=_0x31d847+0x1;_0x3113c0['push'](validateUser(_0x5e34b6[_0x200599]));}return BPromise[_0x6953('0x4d')](_0x3113c0);})[_0x6953('0x27')](function(){_0x3113c0=[];for(var _0x52ba59=0x0;_0x52ba59<_0x5e34b6[_0x6953('0x45')];_0x52ba59++){_0x3113c0[_0x6953('0x46')](updateUser(_0x5e34b6[_0x52ba59]));}return BPromise[_0x6953('0x4d')](_0x3113c0);})[_0x6953('0x27')](function(){return BPromise[_0x6953('0x82')](_0x5e34b6,function(_0x300be9){return db[_0x6953('0x36')]['create'](_0x300be9,{'include':[{'model':db[_0x6953('0x6a')],'as':_0x6953('0x6a')}]})[_0x6953('0x27')](function(_0x12e2ec){_0x300be9['id']=_0x12e2ec['id'];return _0x300be9;});});})[_0x6953('0x27')](function(_0xa54eb8){if(_0x2928c3[_0x6953('0x57')][_0x6953('0x58')]===_0x6953('0x2a'))return _0xa54eb8;if(_0x2928c3['user'][_0x6953('0x58')]!=='user')return _0xa54eb8;var _0x476893=_['some'](_0xa54eb8,function(_0x2c8907){return _0x2c8907[_0x6953('0x58')]===_0x6953('0x79')||_0x2c8907[_0x6953('0x58')]===_0x6953('0x83');});if(!_0x476893)return _0xa54eb8;return db['UserProfileSection'][_0x6953('0x41')]({'where':{'name':{'$or':['Agents',_0x6953('0x2c')]},'userProfileId':_0x2928c3[_0x6953('0x2a')][_0x6953('0x7d')]},'raw':!![]})[_0x6953('0x27')](function(_0x564a73){if(_[_0x6953('0x84')](_0x564a73)||!_[_0x6953('0x81')](_0x564a73,[_0x6953('0x85'),0x0]))return _0xa54eb8;_0x3113c0=[];var _0x2e5191=_(_0x564a73)[_0x6953('0x38')](function(_0x1b3658){if(_0x1b3658[_0x6953('0x85')]===0x1)return;return _0x1b3658['name']===_0x6953('0x2b')?_0x6953('0x79'):_0x6953('0x83');})[_0x6953('0x86')]()[_0x6953('0x2e')]();for(var _0x575b5f=0x0;_0x575b5f<_0xa54eb8['length'];_0x575b5f++){if(!_['includes'](_0x2e5191,_0xa54eb8[_0x575b5f][_0x6953('0x58')]))return;var _0xe578d4=_0xa54eb8[_0x575b5f][_0x6953('0x58')]==='agent'?_0x6953('0x2b'):'Telephones';_0x3113c0[_0x6953('0x46')](db[_0x6953('0x30')]['create']({'name':_0xa54eb8[_0x575b5f][_0x6953('0x33')],'resourceId':_0xa54eb8[_0x575b5f]['id'],'type':_0xe578d4,'sectionId':_['find'](_0x564a73,[_0x6953('0x33'),_0xe578d4])['id']},{}));}return BPromise['all'](_0x3113c0);});})['then'](respondWithResult(_0x228544,0xc9))[_0x6953('0x1e')](handleError(_0x228544,null));};exports[_0x6953('0x87')]=function(_0xbf0da2,_0x14ad16){if(_0xbf0da2[_0x6953('0x57')]['id']){delete _0xbf0da2[_0x6953('0x57')]['id'];}return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0xbf0da2['params']['id']}})['then'](function(_0x49fefc){if(!_0x49fefc)return null;if(_0x49fefc['id']===_0xbf0da2[_0x6953('0x2a')]['id']){if(!_0xbf0da2[_0x6953('0x57')][_0x6953('0x88')]||!_0xbf0da2[_0x6953('0x57')][_0x6953('0x89')]){throw new db['Sequelize'][(_0x6953('0x8a'))](_0x6953('0x8b'));}if(!_0x49fefc[_0x6953('0x8c')](_0xbf0da2[_0x6953('0x57')][_0x6953('0x88')])){throw new db[(_0x6953('0x8d'))][(_0x6953('0x8a'))](_0x6953('0x8e'));}if(_0xbf0da2['body'][_0x6953('0x88')]===_0xbf0da2['body'][_0x6953('0x89')]){throw new db[(_0x6953('0x8d'))][(_0x6953('0x8a'))](_0x6953('0x8f'));}}else if(_0xbf0da2[_0x6953('0x2a')][_0x6953('0x58')]==='admin'){if(!_0xbf0da2[_0x6953('0x57')]['newPassword']){throw new db[(_0x6953('0x8d'))][(_0x6953('0x8a'))](_0x6953('0x90'));}}else if(_0xbf0da2[_0x6953('0x2a')][_0x6953('0x58')]===_0x6953('0x2a')){if(!_0xbf0da2[_0x6953('0x57')][_0x6953('0x89')]){throw new db[(_0x6953('0x8d'))][(_0x6953('0x8a'))](_0x6953('0x90'));}if(_0x49fefc[_0x6953('0x58')]!==_0x6953('0x79')){throw new db[(_0x6953('0x8d'))]['ValidationError'](_0x6953('0x7a'));}}else{throw new db['Sequelize']['ValidationError']('Unauthorized');}return _0x49fefc;})[_0x6953('0x27')](handleEntityNotFound(_0x14ad16,null))[_0x6953('0x27')](function(_0x17cd4b){return db[_0x6953('0x5d')][_0x6953('0x91')]({'attributes':['id',_0x6953('0x5e'),_0x6953('0x92'),_0x6953('0x93')]})[_0x6953('0x27')](function(_0x2a9080){if(_0x2a9080[_0x6953('0x5e')])authService[_0x6953('0x5f')](_0xbf0da2[_0x6953('0x57')]['newPassword']);if(!_0x2a9080[_0x6953('0x92')]||!_0x17cd4b[_0x6953('0x94')])return _0x17cd4b;authService[_0x6953('0x95')](_0xbf0da2[_0x6953('0x57')]['newPassword'],_0x17cd4b[_0x6953('0x94')],_0x2a9080[_0x6953('0x93')]);return _0x17cd4b;})['then'](saveUpdates({'password':_0xbf0da2[_0x6953('0x57')][_0x6953('0x89')],'passwordResetAt':_0xbf0da2[_0x6953('0x2a')]['id']==_0xbf0da2[_0x6953('0x4e')]['id']?moment():null,'previousPasswords':authService[_0x6953('0x96')](_0xbf0da2['body'][_0x6953('0x89')],_0x17cd4b[_0x6953('0x94')])},null));})[_0x6953('0x27')](respondWithResult(_0x14ad16,null))[_0x6953('0x1e')](handleError(_0x14ad16,null));};exports[_0x6953('0x97')]=function(_0x4769f9,_0xedf35d){var _0x37aa51=_0x4769f9[_0x6953('0x57')][_0x6953('0x98')];return db[_0x6953('0x36')]['find']({'where':{'id':_0x4769f9['params']['id']},'attributes':['id',_0x6953('0x33'),_0x6953('0x58'),_0x6953('0x99'),_0x6953('0x9a'),_0x6953('0x9b'),_0x6953('0x9c')]})[_0x6953('0x27')](handleEntityNotFound(_0xedf35d,null))[_0x6953('0x27')](function(_0x56cf6f){if(_0x56cf6f){if(!utils['isValidChannel'](_0x37aa51)){throw new db[(_0x6953('0x8d'))]['ValidationError'](_0x6953('0x9d'));}return _0x56cf6f[_0x6953('0x9e')+_['capitalize'](_0x37aa51[_0x6953('0x9f')]())+_0x6953('0xa0')](_0x4769f9[_0x6953('0x57')][_0x6953('0x5b')],{'penalty':_0x4769f9[_0x6953('0x57')]['penalty']||0x0})[_0x6953('0xa1')](function(_0x5229b8){for(var _0x4eeecf=0x0;_0x4eeecf<_0x4769f9[_0x6953('0x57')]['ids'][_0x6953('0x45')];_0x4eeecf+=0x1){var _0x355497={'UserId':Number(_0x4769f9['params']['id'])};_0x355497[_[_0x6953('0xa2')](_0x37aa51[_0x6953('0x9f')]())+_0x6953('0xa3')]=Number(_0x4769f9[_0x6953('0x57')][_0x6953('0x5b')][_0x4eeecf]);socket[_0x6953('0xa4')](_0x6953('0x2a')+_[_0x6953('0xa2')](_0x37aa51['toLowerCase']())+_0x6953('0xa5'),_0x355497);}return _0x5229b8;})[_0x6953('0x27')](function(){if(_0x37aa51===_0x6953('0xa6')){return db[_0x6953('0xa7')][_0x6953('0x41')]({'where':{'id':_0x4769f9[_0x6953('0x57')][_0x6953('0x5b')]||[]},'raw':!![],'attributes':['id',_0x6953('0x33')]});}})['then'](function(_0x2d0702){var _0xdbd3db=_0x56cf6f[_0x6953('0xa8')]({'plain':!![]});var _0x3661ce=[];if(_0x37aa51===_0x6953('0xa6')&&_0xdbd3db[_0x6953('0x58')]===_0x6953('0x79')&&_0xdbd3db['online']){for(var _0x4c2505=0x0;_0x4c2505<_0x2d0702[_0x6953('0x45')];_0x4c2505+=0x1){_0x3661ce[_0x6953('0x46')]({'membername':_0xdbd3db[_0x6953('0x33')],'UserId':_0xdbd3db['id'],'queue_name':_0x2d0702[_0x4c2505][_0x6953('0x33')],'VoiceQueueId':_0x2d0702[_0x4c2505]['id'],'interface':_[_0x6953('0x62')](_0xdbd3db[_0x6953('0x9c')])?util[_0x6953('0xa9')](_0x6953('0xaa'),_0xdbd3db[_0x6953('0x33')]):_0xdbd3db[_0x6953('0x9c')],'paused':_0xdbd3db[_0x6953('0x9b')]||![],'penalty':_0x4769f9[_0x6953('0x57')][_0x6953('0xab')]||0x0});}return BPromise[_0x6953('0x82')](_0x3661ce,function(_0x1dcbd2){return db['UserVoiceQueueRt'][_0x6953('0xac')](_0x1dcbd2);});}return _0x56cf6f;});}})['then'](respondWithStatusCode(_0xedf35d,null))['catch'](handleError(_0xedf35d,null));};exports[_0x6953('0xad')]=function(_0x4ca574,_0x1cedb8){var _0x128748;return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0x4ca574[_0x6953('0x4e')]['id']},'attributes':['id',_0x6953('0x33'),'role']})[_0x6953('0x27')](handleEntityNotFound(_0x1cedb8,null))[_0x6953('0x27')](function(_0x7cd620){if(_0x7cd620){_0x128748=_0x7cd620;if(!_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')]||!utils[_0x6953('0xae')](_0x4ca574['query'][_0x6953('0x98')])){throw new db[(_0x6953('0x8d'))][(_0x6953('0x8a'))](_0x6953('0x9d'));}return _0x7cd620[_0x6953('0xaf')+_['capitalize'](_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')][_0x6953('0x9f')]())+_0x6953('0xa0')](_0x4ca574[_0x6953('0x3d')][_0x6953('0x5b')]);}})[_0x6953('0x27')](function(_0x2e68d0){if(_[_0x6953('0xb0')](_0x4ca574[_0x6953('0x3d')][_0x6953('0x5b')])){for(var _0xb74ca4=0x0;_0xb74ca4<_0x4ca574[_0x6953('0x3d')]['ids'][_0x6953('0x45')];_0xb74ca4+=0x1){var _0xcd7f7c={'UserId':Number(_0x4ca574[_0x6953('0x4e')]['id'])};_0xcd7f7c[_[_0x6953('0xa2')](_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')]['toLowerCase']())+'QueueId']=Number(_0x4ca574[_0x6953('0x3d')]['ids'][_0xb74ca4]);socket[_0x6953('0xa4')](_0x6953('0x2a')+_[_0x6953('0xa2')](_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')][_0x6953('0x9f')]())+'Queue:remove',_0xcd7f7c);}}else{var _0xcd7f7c={'UserId':Number(_0x4ca574[_0x6953('0x4e')]['id'])};_0xcd7f7c[_[_0x6953('0xa2')](_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')][_0x6953('0x9f')]())+_0x6953('0xa3')]=Number(_0x4ca574[_0x6953('0x3d')]['ids']);socket[_0x6953('0xa4')](_0x6953('0x2a')+_['capitalize'](_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')][_0x6953('0x9f')]())+_0x6953('0xb1'),_0xcd7f7c);}return _0x2e68d0;})[_0x6953('0x27')](function(){if(_0x4ca574[_0x6953('0x3d')][_0x6953('0x98')]===_0x6953('0xa6')){return db[_0x6953('0xb2')][_0x6953('0x31')]({'where':{'UserId':_0x4ca574['params']['id'],'VoiceQueueId':_0x4ca574[_0x6953('0x3d')]['ids']},'individualHooks':!![]})['then'](function(){return _0x128748;});}return _0x128748;})[_0x6953('0x27')](respondWithStatusCode(_0x1cedb8,null))[_0x6953('0x1e')](handleError(_0x1cedb8,null));};exports[_0x6953('0xb3')]=function(_0x49b41d,_0x487e1d){_0x49b41d[_0x6953('0x57')]['userpic']=_0x49b41d[_0x6953('0xb4')]['filename'];return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0x49b41d['params']['id']}})['then'](handleEntityNotFound(_0x487e1d,null))[_0x6953('0x27')](saveUpdates(_0x49b41d[_0x6953('0x57')],null))[_0x6953('0x27')](respondWithResult(_0x487e1d,null))[_0x6953('0x1e')](handleError(_0x487e1d,null));};exports['getAvatar']=function(_0x5ef901,_0x43fa2f){var _0xbeda4b=path[_0x6953('0xb5')](config[_0x6953('0xb6')],_0x6953('0xb7'));return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0x5ef901[_0x6953('0x4e')]['id']},'attributes':['id',_0x6953('0xb8')],'raw':!![]})['then'](handleEntityNotFound(_0x43fa2f,null))[_0x6953('0x27')](function(_0x46e1a0){if(_0x46e1a0){if(_[_0x6953('0x62')](_0x46e1a0[_0x6953('0xb8')])){return _0x43fa2f[_0x6953('0xb9')](_0xbeda4b);}else{if(!fs[_0x6953('0xba')](path[_0x6953('0xb5')](config[_0x6953('0xb6')],_0x6953('0xbb'),_0x46e1a0[_0x6953('0xb8')]))){return _0x43fa2f[_0x6953('0xb9')](_0xbeda4b);}return _0x43fa2f[_0x6953('0xb9')](path[_0x6953('0xb5')](config[_0x6953('0xb6')],_0x6953('0xbb'),_0x46e1a0[_0x6953('0xb8')]));}}})[_0x6953('0x1e')](handleError(_0x43fa2f,null));};exports[_0x6953('0xbc')]=function(_0xb8b49b,_0x2b52ef){return db[_0x6953('0x36')][_0x6953('0x56')]({'where':{'id':_0xb8b49b[_0x6953('0x4e')]['id']},'attributes':['id']})[_0x6953('0x27')](handleEntityNotFound(_0x2b52ef,null))[_0x6953('0x27')](function(_0x51ea38){var _0x11aece=[];values=_0x51ea38['dataValues'];_0x11aece[_0x6953('0x46')](get_open_tabs(_0x6953('0xbd'),_0x51ea38[_0x6953('0x48')]));_0x11aece[_0x6953('0x46')](get_open_tabs(_0x6953('0x47'),_0x51ea38[_0x6953('0x48')]));_0x11aece[_0x6953('0x46')](get_open_tabs('openchannel',_0x51ea38[_0x6953('0x48')]));_0x11aece[_0x6953('0x46')](get_open_tabs(_0x6953('0x4c'),_0x51ea38[_0x6953('0x48')]));_0x11aece[_0x6953('0x46')](get_open_tabs(_0x6953('0x49'),_0x51ea38[_0x6953('0x48')]));_0x11aece[_0x6953('0x46')](get_open_tabs(_0x6953('0x4a'),_0x51ea38[_0x6953('0x48')]));return BPromise[_0x6953('0x4d')](_0x11aece);})[_0x6953('0x27')](function(_0x481206){var _0x392c3d=[];if(_0x481206){for(var _0x36d3ef=0x0;_0x36d3ef=_0x51093c){_0x36d810=_0x51093c;_0x5e45c4=0xc8;}else{_0x5e45c4=0xce;}_0x125c26[_0x5029('0x1b')](_0x5e45c4);return _0x125c26[_0x5029('0x20')](_0x5029('0x21'),_0x181da0+'-'+_0x36d810+'/'+_0x51093c)['json'](_0x3e857d);}return null;};}function saveUpdates(_0x32da06){return function(_0x251f99){if(_0x251f99){return _0x251f99[_0x5029('0x22')](_0x32da06)['then'](function(_0x2cedf6){return _0x2cedf6;});}return null;};}function removeEntity(_0x2bb398){return function(_0x4cc16a){if(_0x4cc16a){return _0x4cc16a[_0x5029('0x23')]()[_0x5029('0x24')](function(){var _0x4434ff=_0x4cc16a[_0x5029('0x25')]({'plain':!![]});if(_0x4434ff[_0x5029('0x26')]===_0x5029('0x27'))return;var _0x44255a=[{'name':_0x5029('0x28'),'value':_0x5029('0x29'),'ignore':!![]},{'name':_0x5029('0x2a'),'value':_0x5029('0x2b'),'ignore':![]},{'name':_0x5029('0x2c'),'value':'telephone','ignore':![]}];var _0x11ae38=_(_0x44255a)['filter'](_0x5029('0x2d'))['map']('value')[_0x5029('0x2e')]();if(_[_0x5029('0x2f')](_0x11ae38,_0x4434ff[_0x5029('0x26')])){return;}var _0x4b7330=_[_0x5029('0x30')](_0x44255a,[_0x5029('0x2e'),_0x4434ff[_0x5029('0x26')]])[_0x5029('0x31')];return db[_0x5029('0x32')][_0x5029('0x23')]({'where':{'type':_0x4b7330,'resourceId':_0x4434ff['id']}})[_0x5029('0x24')](function(){return _0x4cc16a;});})[_0x5029('0x24')](function(){_0x2bb398[_0x5029('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db45c){return function(_0xa4a432){if(!_0xa4a432){_0x1db45c[_0x5029('0x19')](0x194);}return _0xa4a432;};}function handleError(_0x1b3817,_0x5ecd00){_0x5ecd00=_0x5ecd00||0x1f4;return function(_0x184b8d){logger[_0x5029('0x14')](_0x184b8d[_0x5029('0x33')]);if(_0x184b8d['name']){delete _0x184b8d['name'];}_0x1b3817[_0x5029('0x1b')](_0x5ecd00)[_0x5029('0x34')](_0x184b8d);};}exports['index']=function(_0x57784c,_0x9656f2){var _0x157969={},_0x270d66={'count':0x0,'rows':[]};var _0x3210cb=_(db[_0x5029('0x35')][_0x5029('0x36')])[_0x5029('0x37')](function(_0x2f13b1){return{'name':_0x2f13b1[_0x5029('0x38')],'type':_0x2f13b1[_0x5029('0x39')][_0x5029('0x3a')]};})[_0x5029('0x3b')](function(_0x46314a){return!_[_0x5029('0x2f')](['password','salt'],_0x46314a[_0x5029('0x31')]);})[_0x5029('0x2e')]();_0x157969=qs[_0x5029('0x3c')](_0x3210cb,_0x57784c);var _0x48c9eb={'where':_0x157969[_0x5029('0x3d')]};return db[_0x5029('0x35')]['count'](_0x48c9eb)[_0x5029('0x24')](function(_0x4c3e11){_0x270d66[_0x5029('0x3e')]=_0x4c3e11;if(_0x57784c['query'][_0x5029('0x3f')]){_0x157969[_0x5029('0x40')]=[{'all':!![]}];}if(!_[_0x5029('0x2f')](_0x157969[_0x5029('0x41')],'id')){_0x157969[_0x5029('0x41')][_0x5029('0x42')]('id');}return db[_0x5029('0x35')][_0x5029('0x43')](_0x157969);})[_0x5029('0x24')](function(_0x5a3e4d){_0x270d66[_0x5029('0x44')]=_0x5a3e4d;if(_0x57784c[_0x5029('0x45')][_0x5029('0x46')]===_0x5029('0x47')){var _0x3525bc=[];for(var _0x11ac2e=0x0;_0x11ac2e<_0x270d66['rows'][_0x5029('0x48')];_0x11ac2e++){_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x49'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc['push'](get_open_tabs(_0x5029('0x4b'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4c'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x270d66['rows'][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x270d66[_0x5029('0x44')][_0x11ac2e]['dataValues']));_0x3525bc['push'](get_open_tabs(_0x5029('0x4f'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));}return BPromise[_0x5029('0x50')](_0x3525bc)[_0x5029('0x24')](function(_0x3dfc08){return _0x270d66;});}else{return _0x270d66;}})[_0x5029('0x24')](respondWithFilteredResult(_0x9656f2,_0x157969))[_0x5029('0x51')](handleError(_0x9656f2,null));};exports[_0x5029('0x52')]=function(_0x2790e4,_0x2c2e0e){var _0x39370b={'raw':![],'where':{'id':_0x2790e4[_0x5029('0x53')]['id']}},_0x449ef5={};_0x449ef5[_0x5029('0x54')]=_[_0x5029('0x55')](_[_0x5029('0x56')](db[_0x5029('0x35')][_0x5029('0x36')]),[_0x5029('0x57'),_0x5029('0x58')]);_0x449ef5['query']=_[_0x5029('0x56')](_0x2790e4['query']);_0x449ef5[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x449ef5['model'],_0x449ef5['query']);_0x39370b[_0x5029('0x41')]=_['intersection'](_0x449ef5['model'],qs[_0x5029('0x5b')](_0x2790e4[_0x5029('0x45')][_0x5029('0x5b')]));_0x39370b['attributes']=_0x39370b['attributes'][_0x5029('0x48')]?_0x39370b[_0x5029('0x41')]:_0x449ef5['model'];if(_0x2790e4[_0x5029('0x45')]['includeAll']){_0x39370b[_0x5029('0x40')]=[{'all':!![]}];}_0x39370b=_['merge']({},_0x39370b,_0x2790e4[_0x5029('0x5c')]);if(!_[_0x5029('0x2f')](_0x39370b[_0x5029('0x41')],'id')){_0x39370b[_0x5029('0x41')][_0x5029('0x42')]('id');}return db[_0x5029('0x35')][_0x5029('0x30')](_0x39370b)[_0x5029('0x24')](handleEntityNotFound(_0x2c2e0e,null))['then'](function(_0x1df044){var _0x5dd466=[];values=_0x1df044;if(_0x2790e4[_0x5029('0x45')][_0x5029('0x46')]==='true'){_0x5dd466[_0x5029('0x42')](get_open_tabs('chat',_0x1df044['dataValues']));_0x5dd466['push'](get_open_tabs(_0x5029('0x4b'),_0x1df044['dataValues']));_0x5dd466[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x1df044[_0x5029('0x4a')]));_0x5dd466['push'](get_open_tabs(_0x5029('0x4f'),_0x1df044['dataValues']));_0x5dd466['push'](get_open_tabs(_0x5029('0x4c'),_0x1df044[_0x5029('0x4a')]));_0x5dd466[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x1df044[_0x5029('0x4a')]));return BPromise['all'](_0x5dd466);}else{return values;}})[_0x5029('0x24')](function(_0x124634){return values;})[_0x5029('0x24')](respondWithResult(_0x2c2e0e,null))[_0x5029('0x51')](handleError(_0x2c2e0e,null));};exports['update']=function(_0x33812b,_0xfffc0d){if(_0x33812b['body']['id']){delete _0x33812b['body']['id'];}delete _0x33812b[_0x5029('0x5d')][_0x5029('0x26')];return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x33812b['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xfffc0d,null))[_0x5029('0x24')](saveUpdates(_0x33812b[_0x5029('0x5d')],null))[_0x5029('0x24')](respondWithResult(_0xfffc0d,null))[_0x5029('0x51')](handleError(_0xfffc0d,null));};exports[_0x5029('0x5e')]=function(_0x59a718,_0x560324){return db[_0x5029('0x35')][_0x5029('0x5e')]()[_0x5029('0x24')](respondWithResult(_0x560324,null))['catch'](handleError(_0x560324,null));};exports[_0x5029('0x5f')]=function(_0x2d439a,_0x105638){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x2d439a['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x105638,null))[_0x5029('0x24')](function(_0x11637e){if(_0x11637e){return _0x11637e['addContacts'](_0x2d439a[_0x5029('0x5d')]['ids'],_[_0x5029('0x60')](_0x2d439a['body'],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x105638,null))[_0x5029('0x51')](handleError(_0x105638,null));};function validateUser(_0x2f5301){return new BPromise(function(_0x1d2a67,_0x2ab5cf){if(_0x2f5301['internal'])return _0x1d2a67(_0x2f5301);return db[_0x5029('0x62')][_0x5029('0x63')](0x1)[_0x5029('0x24')](function(_0x151562){if(_0x151562[_0x5029('0x64')])authService['validatePasswordPattern'](_0x2f5301[_0x5029('0x57')]);db['User'][_0x5029('0x65')]('internal')[_0x5029('0x24')](function(_0x512392){if(_[_0x5029('0x66')](_0x512392)){_0x2f5301['internal']=_0x151562['min_internal']||0x1;return;}if(_[_0x5029('0x66')](_0x151562['min_internal'])||_0x151562[_0x5029('0x67')]===_0x512392){_0x2f5301[_0x5029('0x68')]=_0x512392+0x1;return;}if(_0x151562[_0x5029('0x67')]>_0x512392){_0x2f5301['internal']=_0x151562[_0x5029('0x67')];return;}return db['sequelize'][_0x5029('0x45')](_0x5029('0x69'),{'type':db[_0x5029('0x6a')][_0x5029('0x6b')][_0x5029('0x6c')]})['then'](function(_0x409034){if(_0x409034&&_0x409034[_0x5029('0x48')]){for(var _0x5890ac=0x0,_0x6500bb=_0x409034[_0x5029('0x48')];_0x5890ac<_0x6500bb&&_[_0x5029('0x66')](_0x2f5301[_0x5029('0x68')]);_0x5890ac++){if(_0x151562[_0x5029('0x67')]<=_0x409034[_0x5890ac][_0x5029('0x6d')]){_0x2f5301['internal']=_0x409034[_0x5890ac]['from'];}else if(_0x151562[_0x5029('0x67')]>_0x409034[_0x5890ac]['from']&&_0x151562[_0x5029('0x67')]<=_0x409034[_0x5890ac]['to']){_0x2f5301[_0x5029('0x68')]=_0x151562['min_internal'];}}}if(_[_0x5029('0x66')](_0x2f5301['internal'])){_0x2f5301['internal']=_0x512392+0x1;}return _0x1d2a67(_0x2f5301);});});})[_0x5029('0x51')](function(_0x340db9){_0x2ab5cf(_0x340db9);});});}function updateUser(_0x3aa169){return new BPromise(function(_0x3efc4b,_0x57874c){try{if(_0x3aa169[_0x5029('0x6e')]){_0x3aa169[_0x5029('0x6f')]=_0x3aa169['internal'];_0x3aa169[_0x5029('0x70')]={'mailbox':_0x3aa169[_0x5029('0x68')],'password':_0x3aa169['password'],'fullname':_0x3aa169['fullname'],'email':_0x3aa169['email']};}if(_0x3aa169[_0x5029('0x26')]===_0x5029('0x2b')){if(!_0x3aa169[_0x5029('0x71')])_0x3aa169[_0x5029('0x71')]=[_0x5029('0x72'),_0x5029('0x73'),_0x5029('0x74'),_0x5029('0x75'),_0x5029('0x76'),'104','105',_0x5029('0x77'),_0x5029('0x78'),_0x5029('0x79'),_0x5029('0x7a'),_0x5029('0x7b'),_0x5029('0x7c'),_0x5029('0x7d'),'115'];}_0x3efc4b(_0x3aa169);}catch(_0x31a1fd){_0x57874c(_0x31a1fd);}});}exports[_0x5029('0x7e')]=function(_0xc1be70,_0x4b61a6){if(_0xc1be70[_0x5029('0x29')][_0x5029('0x26')]===_0x5029('0x2b'))throw new Error('Unauthorized');if(_0xc1be70[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x29')&&_0xc1be70['user'][_0x5029('0x26')]!==_0x5029('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xc1be70[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x27')&&_0xc1be70[_0x5029('0x29')][_0x5029('0x26')]!=='admin'){throw new Error(_0x5029('0x7f'));}return licenseUtil[_0x5029('0x80')]([_0xc1be70[_0x5029('0x5d')]])[_0x5029('0x24')](function(){return validateUser(_0xc1be70[_0x5029('0x5d')]);})['then'](function(_0x455464){return updateUser(_0x455464)[_0x5029('0x24')](function(_0x344203){if(_0x344203['role']===_0x5029('0x27')){_0x344203[_0x5029('0x81')]=_0xc1be70[_0x5029('0x29')][_0x5029('0x81')];delete _0x344203[_0x5029('0x82')];}return _0x344203;});})[_0x5029('0x24')](function(_0x1e075c){return db['User'][_0x5029('0x7e')](_0x1e075c,{'include':[{'model':db[_0x5029('0x70')],'as':_0x5029('0x70')}]});})[_0x5029('0x24')](function(_0x2dcfee){if(_0xc1be70['body'][_0x5029('0x26')]===_0x5029('0x29'))return _0x2dcfee;if(_0xc1be70[_0x5029('0x29')]['role']!==_0x5029('0x29'))return _0x2dcfee;return db[_0x5029('0x83')]['find']({'where':{'name':_0x2dcfee['role']==='agent'?_0x5029('0x2a'):_0x5029('0x2c'),'userProfileId':_0xc1be70[_0x5029('0x29')][_0x5029('0x82')]},'raw':!![]})[_0x5029('0x24')](function(_0x4c742f){if(!_0x4c742f||_0x4c742f[_0x5029('0x84')]!=0x0)return _0x2dcfee;return db[_0x5029('0x32')][_0x5029('0x7e')]({'name':_0x2dcfee['name'],'resourceId':_0x2dcfee['id'],'type':_0x4c742f['name'],'sectionId':_0x4c742f['id']},{})[_0x5029('0x24')](function(){return _0x2dcfee;});})[_0x5029('0x51')](function(_0x1eb1ff){logger[_0x5029('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1eb1ff);throw _0x1eb1ff;});})[_0x5029('0x24')](respondWithResult(_0x4b61a6,0xc9))[_0x5029('0x51')](handleError(_0x4b61a6,null));};exports[_0x5029('0x85')]=function(_0x3295ba,_0x49f6b8){var _0xcc5fcf=_0x3295ba[_0x5029('0x5d')];var _0xe4b730=[];if(_0x3295ba['user'][_0x5029('0x26')]==='agent')throw new Error('Unauthorized');if(_[_0x5029('0x86')](_0xcc5fcf,['role',_0x5029('0x29')])&&_0x3295ba[_0x5029('0x29')][_0x5029('0x26')]!==_0x5029('0x27')){throw new Error(_0x5029('0x87'));}if(_[_0x5029('0x86')](_0xcc5fcf,[_0x5029('0x26'),_0x5029('0x27')])&&_0x3295ba['user']['role']!==_0x5029('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0xcc5fcf)[_0x5029('0x24')](function(){return validateUser(_0xcc5fcf[0x0]);})['then'](function(){for(var _0x4b25ed=0x1;_0x4b25ed<_0xcc5fcf[_0x5029('0x48')];_0x4b25ed++){var _0xb8da0b=_0xcc5fcf[_0x4b25ed-0x1][_0x5029('0x68')];if(!_0xcc5fcf[_0x4b25ed][_0x5029('0x68')])_0xcc5fcf[_0x4b25ed][_0x5029('0x68')]=_0xb8da0b+0x1;_0xe4b730['push'](validateUser(_0xcc5fcf[_0x4b25ed]));}return BPromise[_0x5029('0x50')](_0xe4b730);})[_0x5029('0x24')](function(){_0xe4b730=[];for(var _0x7c87a2=0x0;_0x7c87a2<_0xcc5fcf['length'];_0x7c87a2++){_0xe4b730[_0x5029('0x42')](updateUser(_0xcc5fcf[_0x7c87a2]));}return BPromise[_0x5029('0x50')](_0xe4b730);})[_0x5029('0x24')](function(){return BPromise[_0x5029('0x88')](_0xcc5fcf,function(_0x3867a1){return db['User']['create'](_0x3867a1,{'include':[{'model':db[_0x5029('0x70')],'as':_0x5029('0x70')}]})['then'](function(_0x43fa13){_0x3867a1['id']=_0x43fa13['id'];return _0x3867a1;});});})[_0x5029('0x24')](function(_0x3d0d7a){if(_0x3295ba[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x29'))return _0x3d0d7a;if(_0x3295ba[_0x5029('0x29')][_0x5029('0x26')]!=='user')return _0x3d0d7a;var _0x523bee=_[_0x5029('0x86')](_0x3d0d7a,function(_0x57b4e7){return _0x57b4e7[_0x5029('0x26')]==='agent'||_0x57b4e7[_0x5029('0x26')]===_0x5029('0x89');});if(!_0x523bee)return _0x3d0d7a;return db[_0x5029('0x83')]['findAll']({'where':{'name':{'$or':[_0x5029('0x2a'),_0x5029('0x2c')]},'userProfileId':_0x3295ba[_0x5029('0x29')]['userProfileId']},'raw':!![]})[_0x5029('0x24')](function(_0x362a08){if(_[_0x5029('0x8a')](_0x362a08)||!_[_0x5029('0x86')](_0x362a08,[_0x5029('0x84'),0x0]))return _0x3d0d7a;_0xe4b730=[];var _0x2899e6=_(_0x362a08)[_0x5029('0x37')](function(_0x32779f){if(_0x32779f[_0x5029('0x84')]===0x1)return;return _0x32779f[_0x5029('0x31')]===_0x5029('0x2a')?_0x5029('0x2b'):_0x5029('0x89');})[_0x5029('0x8b')]()[_0x5029('0x2e')]();for(var _0x15435d=0x0;_0x15435d<_0x3d0d7a[_0x5029('0x48')];_0x15435d++){if(!_[_0x5029('0x2f')](_0x2899e6,_0x3d0d7a[_0x15435d]['role']))return;var _0x7007a0=_0x3d0d7a[_0x15435d][_0x5029('0x26')]===_0x5029('0x2b')?_0x5029('0x2a'):_0x5029('0x2c');_0xe4b730['push'](db[_0x5029('0x32')][_0x5029('0x7e')]({'name':_0x3d0d7a[_0x15435d][_0x5029('0x31')],'resourceId':_0x3d0d7a[_0x15435d]['id'],'type':_0x7007a0,'sectionId':_[_0x5029('0x30')](_0x362a08,[_0x5029('0x31'),_0x7007a0])['id']},{}));}return BPromise['all'](_0xe4b730);});})[_0x5029('0x24')](respondWithResult(_0x49f6b8,0xc9))[_0x5029('0x51')](handleError(_0x49f6b8,null));};exports[_0x5029('0x8c')]=function(_0x139971,_0x3c601c){if(_0x139971['body']['id']){delete _0x139971[_0x5029('0x5d')]['id'];}return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x139971[_0x5029('0x53')]['id']}})[_0x5029('0x24')](function(_0x12cfe5){if(!_0x12cfe5)return null;if(_0x12cfe5['id']===_0x139971[_0x5029('0x29')]['id']){if(!_0x139971[_0x5029('0x5d')]['oldPassword']||!_0x139971['body'][_0x5029('0x8d')]){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0x90'));}if(!_0x12cfe5[_0x5029('0x91')](_0x139971['body'][_0x5029('0x92')])){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x93'));}if(_0x139971[_0x5029('0x5d')][_0x5029('0x92')]===_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x94'));}}else if(_0x139971['user'][_0x5029('0x26')]===_0x5029('0x27')){if(!_0x139971['body'][_0x5029('0x8d')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x139971['user'][_0x5029('0x26')]==='user'){if(!_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x95'));}if(_0x12cfe5['role']!==_0x5029('0x2b')){throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0x96'));}}else{throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0x96'));}return _0x12cfe5;})[_0x5029('0x24')](handleEntityNotFound(_0x3c601c,null))[_0x5029('0x24')](function(_0x24c55f){return db[_0x5029('0x62')][_0x5029('0x97')]({'attributes':['id','securePassword',_0x5029('0x98'),'passwordHistoryLimit']})[_0x5029('0x24')](function(_0x271d63){if(_0x271d63[_0x5029('0x64')])authService[_0x5029('0x99')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]);if(!_0x271d63[_0x5029('0x98')]||!_0x24c55f[_0x5029('0x9a')])return _0x24c55f;authService[_0x5029('0x9b')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],_0x24c55f[_0x5029('0x9a')],_0x271d63[_0x5029('0x9c')]);return _0x24c55f;})[_0x5029('0x24')](saveUpdates({'password':_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],'passwordResetAt':_0x139971['user']['id']==_0x139971[_0x5029('0x53')]['id']?moment():null,'previousPasswords':authService[_0x5029('0x9d')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],_0x24c55f[_0x5029('0x9a')])},null));})[_0x5029('0x24')](respondWithResult(_0x3c601c,null))['catch'](handleError(_0x3c601c,null));};exports[_0x5029('0x9e')]=function(_0x41108f,_0x137559){var _0x36dabf=_0x41108f[_0x5029('0x5d')]['channel'];return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x41108f[_0x5029('0x53')]['id']},'attributes':['id',_0x5029('0x31'),_0x5029('0x26'),_0x5029('0x9f'),_0x5029('0xa0'),_0x5029('0xa1'),_0x5029('0xa2')]})[_0x5029('0x24')](handleEntityNotFound(_0x137559,null))['then'](function(_0xb26cc0){if(_0xb26cc0){if(!utils['isValidChannel'](_0x36dabf)){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0xa3'));}return _0xb26cc0[_0x5029('0xa4')+_['capitalize'](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xa6')](_0x41108f['body'][_0x5029('0x61')],{'penalty':_0x41108f[_0x5029('0x5d')]['penalty']||0x0})[_0x5029('0xa7')](function(_0x14d53c){for(var _0x5b290f=0x0;_0x5b290f<_0x41108f['body'][_0x5029('0x61')]['length'];_0x5b290f+=0x1){var _0x512082={'UserId':Number(_0x41108f[_0x5029('0x53')]['id'])};_0x512082[_['capitalize'](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xa8')]=Number(_0x41108f['body'][_0x5029('0x61')][_0x5b290f]);socket[_0x5029('0xa9')]('user'+_[_0x5029('0xaa')](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xab'),_0x512082);}return _0x14d53c;})['then'](function(){if(_0x36dabf===_0x5029('0xac')){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x41108f[_0x5029('0x5d')][_0x5029('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x5029('0x24')](function(_0x44e198){var _0x5aa480=_0xb26cc0[_0x5029('0x25')]({'plain':!![]});var _0x294ddc=[];if(_0x36dabf==='voice'&&_0x5aa480['role']===_0x5029('0x2b')&&_0x5aa480[_0x5029('0x9f')]){for(var _0x587f24=0x0;_0x587f24<_0x44e198['length'];_0x587f24+=0x1){_0x294ddc['push']({'membername':_0x5aa480[_0x5029('0x31')],'UserId':_0x5aa480['id'],'queue_name':_0x44e198[_0x587f24][_0x5029('0x31')],'VoiceQueueId':_0x44e198[_0x587f24]['id'],'interface':_[_0x5029('0x66')](_0x5aa480['interface'])?util[_0x5029('0xad')]('SIP/%s',_0x5aa480[_0x5029('0x31')]):_0x5aa480['interface'],'paused':_0x5aa480['voicePause']||![],'penalty':_0x41108f['body']['penalty']||0x0});}return BPromise[_0x5029('0x88')](_0x294ddc,function(_0x1f8811){return db[_0x5029('0xae')][_0x5029('0xaf')](_0x1f8811);});}return _0xb26cc0;});}})[_0x5029('0x24')](respondWithStatusCode(_0x137559,null))['catch'](handleError(_0x137559,null));};exports[_0x5029('0xb0')]=function(_0x7258ac,_0x31e03c){var _0x42b5eb;return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x7258ac['params']['id']},'attributes':['id',_0x5029('0x31'),_0x5029('0x26')]})[_0x5029('0x24')](handleEntityNotFound(_0x31e03c,null))['then'](function(_0x5a4988){if(_0x5a4988){_0x42b5eb=_0x5a4988;if(!_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]||!utils[_0x5029('0xb2')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')])){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0xa3'));}return _0x5a4988['remove'+_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]['toLowerCase']())+_0x5029('0xa6')](_0x7258ac['query'][_0x5029('0x61')]);}})[_0x5029('0x24')](function(_0x100ae3){if(_[_0x5029('0xb3')](_0x7258ac[_0x5029('0x45')][_0x5029('0x61')])){for(var _0xcf928a=0x0;_0xcf928a<_0x7258ac[_0x5029('0x45')]['ids']['length'];_0xcf928a+=0x1){var _0x1cf583={'UserId':Number(_0x7258ac[_0x5029('0x53')]['id'])};_0x1cf583[_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')][_0x5029('0xa5')]())+'QueueId']=Number(_0x7258ac[_0x5029('0x45')][_0x5029('0x61')][_0xcf928a]);socket[_0x5029('0xa9')](_0x5029('0x29')+_[_0x5029('0xaa')](_0x7258ac['query'][_0x5029('0xb1')][_0x5029('0xa5')]())+_0x5029('0xb4'),_0x1cf583);}}else{var _0x1cf583={'UserId':Number(_0x7258ac[_0x5029('0x53')]['id'])};_0x1cf583[_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')][_0x5029('0xa5')]())+_0x5029('0xa8')]=Number(_0x7258ac[_0x5029('0x45')][_0x5029('0x61')]);socket[_0x5029('0xa9')]('user'+_['capitalize'](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]['toLowerCase']())+_0x5029('0xb4'),_0x1cf583);}return _0x100ae3;})[_0x5029('0x24')](function(){if(_0x7258ac['query'][_0x5029('0xb1')]===_0x5029('0xac')){return db[_0x5029('0xae')]['destroy']({'where':{'UserId':_0x7258ac[_0x5029('0x53')]['id'],'VoiceQueueId':_0x7258ac[_0x5029('0x45')]['ids']},'individualHooks':!![]})[_0x5029('0x24')](function(){return _0x42b5eb;});}return _0x42b5eb;})['then'](respondWithStatusCode(_0x31e03c,null))['catch'](handleError(_0x31e03c,null));};exports[_0x5029('0xb5')]=function(_0x548735,_0x3c22c5){_0x548735[_0x5029('0x5d')][_0x5029('0xb6')]=_0x548735['file'][_0x5029('0xb7')];return db['User']['find']({'where':{'id':_0x548735[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c22c5,null))[_0x5029('0x24')](saveUpdates(_0x548735[_0x5029('0x5d')],null))[_0x5029('0x24')](respondWithResult(_0x3c22c5,null))['catch'](handleError(_0x3c22c5,null));};exports[_0x5029('0xb8')]=function(_0x1caa56,_0xfea081){var _0x1415df=path[_0x5029('0xb9')](config[_0x5029('0xba')],'server/files/images/logos/default_profile.png');return db['User'][_0x5029('0x30')]({'where':{'id':_0x1caa56[_0x5029('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x5029('0x24')](handleEntityNotFound(_0xfea081,null))['then'](function(_0x4d4ae3){if(_0x4d4ae3){if(_[_0x5029('0x66')](_0x4d4ae3[_0x5029('0xb6')])){return _0xfea081[_0x5029('0xbb')](_0x1415df);}else{if(!fs[_0x5029('0xbc')](path[_0x5029('0xb9')](config[_0x5029('0xba')],_0x5029('0xbd'),_0x4d4ae3[_0x5029('0xb6')]))){return _0xfea081[_0x5029('0xbb')](_0x1415df);}return _0xfea081[_0x5029('0xbb')](path[_0x5029('0xb9')](config[_0x5029('0xba')],_0x5029('0xbd'),_0x4d4ae3[_0x5029('0xb6')]));}}})[_0x5029('0x51')](handleError(_0xfea081,null));};exports[_0x5029('0xbe')]=function(_0x14c4fe,_0x77cbcf){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x14c4fe[_0x5029('0x53')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x77cbcf,null))[_0x5029('0x24')](function(_0x4390cf){var _0x32270e=[];values=_0x4390cf['dataValues'];_0x32270e[_0x5029('0x42')](get_open_tabs('chat',_0x4390cf['dataValues']));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4b'),_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs('whatsapp',_0x4390cf[_0x5029('0x4a')]));_0x32270e['push'](get_open_tabs('fax',_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x4390cf[_0x5029('0x4a')]));return BPromise[_0x5029('0x50')](_0x32270e);})['then'](function(_0x58564f){var _0x53a135=[];if(_0x58564f){for(var _0x4595b5=0x0;_0x4595b5=_0x271ad7['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x22cb('0xf')](function(){if(_0x4b52ec){return db[_0x22cb('0x2b')][_0x22cb('0x4a')]({'where':{'membername':_0x4b52ec[_0x22cb('0x27')]},'individualHooks':!![]});}})[_0x22cb('0xf')](function(){if(_0x4b52ec){return _0x4b52ec['getVoiceQueues']({'raw':!![]});}})[_0x22cb('0xf')](function(_0x4e2d78){if(_0x4b52ec){if(_0x4e2d78){var _0x30ab17=[];_0x3b3fbd=_0x4e2d78;if(_0x3b3fbd[_0x22cb('0x30')]){for(var _0x5503c3=0x0;_0x5503c3<_0x3b3fbd[_0x22cb('0x30')];_0x5503c3++){_0x30ab17[_0x22cb('0x34')](db[_0x22cb('0x2b')][_0x22cb('0x52')]({'membername':_0x4b52ec[_0x22cb('0x27')],'UserId':_0x4b52ec['id'],'queue_name':_0x3b3fbd[_0x5503c3][_0x22cb('0x27')],'VoiceQueueId':_0x3b3fbd[_0x5503c3]['id'],'interface':_0x65fb3c,'paused':_0x4b52ec[_0x22cb('0x4e')]||![],'penalty':_0x3b3fbd[_0x5503c3][_0x22cb('0x53')]||0x0}));}return BPromise[_0x22cb('0x48')](_0x30ab17);}}}})[_0x22cb('0xf')](function(){if(_0x4b52ec){return db[_0x22cb('0x2d')][_0x22cb('0x2e')]({'where':{'membername':_0x4b52ec[_0x22cb('0x27')],'exitAt':null}});}})[_0x22cb('0xf')](function(_0x49cb1b){if(_0x4b52ec){if(_0x49cb1b&&_0x49cb1b['length']){var _0x201103=[];_0x49cb1b['forEach'](function(_0xe90e85){_0x201103[_0x22cb('0x34')](_0xe90e85[_0x22cb('0x2c')]({'exitAt':moment()[_0x22cb('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x22cb('0x48')](_0x201103);}}})[_0x22cb('0xf')](function(_0x410307){if(_0x4b52ec){var _0x47e70c=[];var _0xbd0476=[];var _0x1d03a6=utils[_0x22cb('0x32')]();var _0x552310={'membername':_0x4b52ec[_0x22cb('0x27')],'interface':_0x65fb3c,'enterAt':moment()[_0x22cb('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4b52ec[_0x22cb('0x28')],'internal':_0x4b52ec['internal']};_0x1d03a6[_0x22cb('0x33')](function(_0x5a9f21){_0x47e70c[_0x22cb('0x34')](_[_0x22cb('0x54')]({'channel':_0x5a9f21,'type':_0x22cb('0x55'),'data1':'callysquare','data2':_0x65fb3c},_0x552310));if(_0x4b52ec[_0x22cb('0x4e')]){_0xbd0476[_0x22cb('0x34')](_['merge']({'channel':_0x5a9f21,'type':_0x22cb('0x36'),'data1':_0x22cb('0x56')},_0x552310));}});return db[_0x22cb('0x2d')][_0x22cb('0x57')](_0x47e70c[_0x22cb('0x58')](_0xbd0476),{'individualHooks':!![]});}})[_0x22cb('0xf')](function(){if(_0x4b52ec){return _0x4b52ec[_0x22cb('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x22cb('0x2f')](_0x22cb('0x37')),'voicePause':_0x4b52ec[_0x22cb('0x4e')]||![],'mailPause':_0x4b52ec[_0x22cb('0x4e')]||![],'chatPause':_0x4b52ec['loginInPause']||![],'faxPause':_0x4b52ec[_0x22cb('0x4e')]||![],'smsPause':_0x4b52ec[_0x22cb('0x4e')]||![],'openchannelPause':_0x4b52ec[_0x22cb('0x4e')]||![],'pauseType':_0x4b52ec[_0x22cb('0x4e')]?_0x22cb('0x56'):null,'lastPauseAt':moment()[_0x22cb('0x2f')](_0x22cb('0x37')),'interface':_0x65fb3c});}})[_0x22cb('0xf')](function(_0x1de5cc){_0x594a6f(_0x1de5cc);})[_0x22cb('0x22')](function(_0x2b6c8b){_0x4e53db(_0x5686c5[_0x22cb('0x16')](0x1f4,_0x2b6c8b[_0x22cb('0x17')]));});});}; \ No newline at end of file +var _0x6ef4=['LogoutUser','destroy','mobile','loginInPause','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','getChannels','merge','LOGIN','callysquare','concat','LOGININPAUSE','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./user.socket','register','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','GetUser','User','findAll','options','raw','where','attributes','map','include','model','debug','ShowUser','find','catch','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','forEach','push','isNil','SIP/%s','body','DEFAULT\x20PAUSE','bulkCreate','type','findOne','isValidChannel','channel','system','chat','fax','sms','openchannel','whatsapp','%s%s','Pause','all'];(function(_0x3ef55e,_0xae8c6c){var _0x1df0d4=function(_0x5dd3f7){while(--_0x5dd3f7){_0x3ef55e['push'](_0x3ef55e['shift']());}};_0x1df0d4(++_0xae8c6c);}(_0x6ef4,0xc0));var _0x46ef=function(_0x4aae85,_0x1a0e3e){_0x4aae85=_0x4aae85-0x0;var _0x2f8d92=_0x6ef4[_0x4aae85];return _0x2f8d92;};'use strict';var _=require(_0x46ef('0x0'));var util=require('util');var moment=require(_0x46ef('0x1'));var BPromise=require(_0x46ef('0x2'));var rs=require(_0x46ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46ef('0x4'))['db'];var utils=require(_0x46ef('0x5'));var logger=require('../../config/logger')(_0x46ef('0x6'));var config=require(_0x46ef('0x7'));var jayson=require(_0x46ef('0x8'));var client=jayson['client'][_0x46ef('0x9')]({'port':0x232a});config[_0x46ef('0xa')]=_[_0x46ef('0xb')](config[_0x46ef('0xa')],{'host':_0x46ef('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46ef('0xa')]));require(_0x46ef('0xd'))[_0x46ef('0xe')](socket);function respondWithRpcPromise(_0xf30868,_0x123c88,_0xd3dc85){return new BPromise(function(_0x2cc496,_0x29b558){return client[_0x46ef('0xf')](_0xf30868,_0xd3dc85)[_0x46ef('0x10')](function(_0x4929c2){logger[_0x46ef('0x11')](_0x46ef('0x12'),_0x123c88,'request\x20sent');logger['debug'](_0x46ef('0x13'),_0x123c88,'request\x20sent',JSON[_0x46ef('0x14')](_0x4929c2));if(_0x4929c2[_0x46ef('0x15')]){if(_0x4929c2[_0x46ef('0x15')][_0x46ef('0x16')]===0x1f4){logger['error'](_0x46ef('0x12'),_0x123c88,_0x4929c2[_0x46ef('0x15')][_0x46ef('0x17')]);return _0x29b558(_0x4929c2['error'][_0x46ef('0x17')]);}logger['error'](_0x46ef('0x12'),_0x123c88,_0x4929c2[_0x46ef('0x15')]['message']);return _0x2cc496(_0x4929c2[_0x46ef('0x15')][_0x46ef('0x17')]);}else{logger['info'](_0x46ef('0x12'),_0x123c88,_0x46ef('0x18'));_0x2cc496(_0x4929c2['result'][_0x46ef('0x17')]);}})['catch'](function(_0x153bc8){logger['error'](_0x46ef('0x12'),_0x123c88,_0x153bc8);_0x29b558(_0x153bc8);});});}exports[_0x46ef('0x19')]=function(_0x5ad11a){var _0x1ab774=this;return new Promise(function(_0x548e10,_0x133a52){return db[_0x46ef('0x1a')][_0x46ef('0x1b')]({'raw':_0x5ad11a[_0x46ef('0x1c')]?_0x5ad11a[_0x46ef('0x1c')][_0x46ef('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ad11a[_0x46ef('0x1c')]?_0x5ad11a[_0x46ef('0x1c')][_0x46ef('0x1e')]||null:null,'attributes':_0x5ad11a[_0x46ef('0x1c')]?_0x5ad11a[_0x46ef('0x1c')][_0x46ef('0x1f')]||null:null,'limit':_0x5ad11a[_0x46ef('0x1c')]?_0x5ad11a[_0x46ef('0x1c')]['limit']||null:null,'include':_0x5ad11a[_0x46ef('0x1c')]?_0x5ad11a[_0x46ef('0x1c')]['include']?_[_0x46ef('0x20')](_0x5ad11a[_0x46ef('0x1c')][_0x46ef('0x21')],function(_0x202074){return{'model':db[_0x202074[_0x46ef('0x22')]],'as':_0x202074['as'],'attributes':_0x202074[_0x46ef('0x1f')],'include':_0x202074[_0x46ef('0x21')]?_[_0x46ef('0x20')](_0x202074[_0x46ef('0x21')],function(_0x17c929){return{'model':db[_0x17c929[_0x46ef('0x22')]],'as':_0x17c929['as'],'attributes':_0x17c929[_0x46ef('0x1f')],'include':_0x17c929['include']?_[_0x46ef('0x20')](_0x17c929[_0x46ef('0x21')],function(_0x53dc78){return{'model':db[_0x53dc78[_0x46ef('0x22')]],'as':_0x53dc78['as'],'attributes':_0x53dc78[_0x46ef('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46ef('0x10')](function(_0x456f02){logger['info']('GetUser',_0x5ad11a);logger[_0x46ef('0x23')](_0x46ef('0x19'),_0x5ad11a,JSON[_0x46ef('0x14')](_0x456f02));_0x548e10(_0x456f02);})['catch'](function(_0x325174){logger['error'](_0x46ef('0x19'),_0x325174['message'],_0x5ad11a);_0x133a52(_0x1ab774[_0x46ef('0x15')](0x1f4,_0x325174['message']));});});};exports[_0x46ef('0x24')]=function(_0x40095e){var _0x2d8664=this;return new Promise(function(_0x225914,_0x14be0d){return db['User'][_0x46ef('0x25')]({'raw':_0x40095e[_0x46ef('0x1c')]?_0x40095e[_0x46ef('0x1c')][_0x46ef('0x1d')]===undefined?!![]:![]:!![],'where':_0x40095e['options']?_0x40095e[_0x46ef('0x1c')][_0x46ef('0x1e')]||null:null,'attributes':_0x40095e[_0x46ef('0x1c')]?_0x40095e[_0x46ef('0x1c')]['attributes']||null:null,'include':_0x40095e[_0x46ef('0x1c')]?_0x40095e[_0x46ef('0x1c')]['include']?_[_0x46ef('0x20')](_0x40095e[_0x46ef('0x1c')]['include'],function(_0x2ff95b){return{'model':db[_0x2ff95b[_0x46ef('0x22')]],'as':_0x2ff95b['as'],'attributes':_0x2ff95b[_0x46ef('0x1f')],'include':_0x2ff95b['include']?_[_0x46ef('0x20')](_0x2ff95b[_0x46ef('0x21')],function(_0x21a0c5){return{'model':db[_0x21a0c5['model']],'as':_0x21a0c5['as'],'attributes':_0x21a0c5['attributes'],'include':_0x21a0c5[_0x46ef('0x21')]?_['map'](_0x21a0c5[_0x46ef('0x21')],function(_0x3c3457){return{'model':db[_0x3c3457[_0x46ef('0x22')]],'as':_0x3c3457['as'],'attributes':_0x3c3457[_0x46ef('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46ef('0x10')](function(_0x530630){logger[_0x46ef('0x11')]('ShowUser',_0x40095e);logger[_0x46ef('0x23')](_0x46ef('0x24'),_0x40095e,JSON[_0x46ef('0x14')](_0x530630));_0x225914(_0x530630);})[_0x46ef('0x26')](function(_0x588d4e){logger[_0x46ef('0x15')](_0x46ef('0x24'),_0x588d4e[_0x46ef('0x17')],_0x40095e);_0x14be0d(_0x2d8664[_0x46ef('0x15')](0x1f4,_0x588d4e[_0x46ef('0x17')]));});});};exports[_0x46ef('0x27')]=function(_0x218c79){var _0x3cd9a5=this;return new Promise(function(_0x3652af,_0x47ede9){var _0x4f76ee;return db['User']['find']({'where':_0x218c79['options']['where']||{},'attributes':['id',_0x46ef('0x28'),_0x46ef('0x29'),_0x46ef('0x2a'),_0x46ef('0x2b')]})[_0x46ef('0x10')](function(_0x204a68){if(_0x204a68){_0x4f76ee=_0x204a68;return db[_0x46ef('0x2c')][_0x46ef('0x2d')]({'paused':0x1},{'where':{'UserId':_0x4f76ee['id']},'individualHooks':!![]});}})[_0x46ef('0x10')](function(){if(_0x4f76ee){return db[_0x46ef('0x2e')][_0x46ef('0x1b')]({'where':{'membername':_0x4f76ee[_0x46ef('0x28')],'type':_0x46ef('0x2f'),'exitAt':null}});}})['then'](function(_0x263137){if(_0x4f76ee){if(_0x263137&&_0x263137['length']){var _0x214b99=moment()[_0x46ef('0x30')](_0x46ef('0x31'));for(var _0x62540c=0x0,_0x229570=_0x263137[_0x46ef('0x32')];_0x62540c<_0x229570;_0x62540c++){_0x263137[_0x62540c][_0x46ef('0x33')]({'exitAt':_0x214b99});}}}})[_0x46ef('0x10')](function(){if(_0x4f76ee){var _0x3e3b6b=[];var _0x1b1e99=utils['getChannels']();_0x1b1e99[_0x46ef('0x34')](function(_0x3f58d4){_0x3e3b6b[_0x46ef('0x35')]({'channel':_0x3f58d4,'membername':_0x4f76ee[_0x46ef('0x28')],'interface':_[_0x46ef('0x36')](_0x4f76ee[_0x46ef('0x2b')])?util['format'](_0x46ef('0x37'),_0x4f76ee[_0x46ef('0x28')]):_0x4f76ee[_0x46ef('0x2b')],'type':_0x46ef('0x2f'),'enterAt':moment()['format'](_0x46ef('0x31')),'data1':_0x218c79[_0x46ef('0x38')]['type']||_0x46ef('0x39'),'role':_0x4f76ee[_0x46ef('0x29')],'internal':_0x4f76ee[_0x46ef('0x2a')],'uniqueid':_0x218c79['body']['uniqueid']||null});});return db[_0x46ef('0x2e')][_0x46ef('0x3a')](_0x3e3b6b,{'individualHooks':!![]});}})[_0x46ef('0x10')](function(){if(_0x4f76ee){return _0x4f76ee[_0x46ef('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x218c79[_0x46ef('0x38')][_0x46ef('0x3b')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x46ef('0x30')](_0x46ef('0x31'))});}})[_0x46ef('0x10')](function(_0x433a0a){_0x3652af(_0x433a0a);})[_0x46ef('0x26')](function(_0x3d58f4){_0x47ede9(_0x3cd9a5[_0x46ef('0x15')](0x1f4,_0x3d58f4[_0x46ef('0x17')]));});});};exports['UnpauseUser']=function(_0x2d7da5){var _0x36c09e=this;return new Promise(function(_0x5cd2da,_0x3a2b07){var _0x504fea;return db[_0x46ef('0x1a')][_0x46ef('0x3c')]({'where':_0x2d7da5[_0x46ef('0x1c')][_0x46ef('0x1e')]||{},'attributes':['id',_0x46ef('0x28')]})[_0x46ef('0x10')](function(_0x41c59b){if(_0x41c59b){_0x504fea=_0x41c59b;if(_0x2d7da5['body']['channel']&&!utils[_0x46ef('0x3d')](_0x2d7da5[_0x46ef('0x38')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x2d7da5[_0x46ef('0x38')][_0x46ef('0x3e')]){case'voice':return db[_0x46ef('0x2c')][_0x46ef('0x2d')]({'paused':0x0},{'where':{'UserId':_0x504fea['id']}})['then'](function(){return db[_0x46ef('0x2e')][_0x46ef('0x25')]({'where':{'channel':_0x2d7da5[_0x46ef('0x38')][_0x46ef('0x3e')],'membername':_0x504fea['name'],'type':_0x46ef('0x2f'),'exitAt':null}});})[_0x46ef('0x10')](function(_0x586723){if(_0x586723){return _0x586723[_0x46ef('0x2d')]({'exitAt':moment()[_0x46ef('0x30')](_0x46ef('0x31')),'data2':_0x46ef('0x3f')},{'individualHooks':!![]});}return null;})[_0x46ef('0x10')](function(){return _0x504fea[_0x46ef('0x2d')]({'voicePause':![]});});case'mail':case _0x46ef('0x40'):case _0x46ef('0x41'):case _0x46ef('0x42'):case _0x46ef('0x43'):case _0x46ef('0x44'):return db[_0x46ef('0x2e')][_0x46ef('0x25')]({'where':{'channel':_0x2d7da5[_0x46ef('0x38')][_0x46ef('0x3e')],'membername':_0x504fea[_0x46ef('0x28')],'type':_0x46ef('0x2f'),'exitAt':null}})[_0x46ef('0x10')](function(_0xf1958a){return _0xf1958a[_0x46ef('0x2d')]({'exitAt':moment()[_0x46ef('0x30')](_0x46ef('0x31')),'data2':_0x46ef('0x3f')},{'individualHooks':!![]});})[_0x46ef('0x10')](function(){var _0x396c52={};_['set'](_0x396c52,util[_0x46ef('0x30')](_0x46ef('0x45'),_0x2d7da5[_0x46ef('0x38')][_0x46ef('0x3e')],_0x46ef('0x46')),![]);return _0x504fea[_0x46ef('0x2d')](_0x396c52);});default:return db[_0x46ef('0x2c')][_0x46ef('0x2d')]({'paused':0x0},{'where':{'UserId':_0x504fea['id']}})[_0x46ef('0x10')](function(){return db[_0x46ef('0x2e')][_0x46ef('0x1b')]({'where':{'membername':_0x504fea[_0x46ef('0x28')],'type':'PAUSE','exitAt':null}});})[_0x46ef('0x10')](function(_0x64d244){var _0x3bd189=[];_0x64d244['forEach'](function(_0x5b0a97){_0x3bd189[_0x46ef('0x35')](_0x5b0a97['update']({'exitAt':moment()[_0x46ef('0x30')](_0x46ef('0x31')),'data2':_0x46ef('0x3f')}));});return BPromise[_0x46ef('0x47')](_0x3bd189);})[_0x46ef('0x10')](function(){return _0x504fea[_0x46ef('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x46ef('0x10')](function(_0x394c8b){_0x5cd2da(_0x394c8b);})[_0x46ef('0x26')](function(_0x57307a){_0x3a2b07(_0x36c09e['error'](0x1f4,_0x57307a[_0x46ef('0x17')]));});});};exports[_0x46ef('0x48')]=function(_0x112560){var _0x2cf364=this;return new Promise(function(_0x3e2076,_0x4d97d6){var _0x1b0785;return db[_0x46ef('0x1a')][_0x46ef('0x3c')]({'where':_0x112560['options']['where']||{},'attributes':['id',_0x46ef('0x28')]})[_0x46ef('0x10')](function(_0x45449a){if(_0x45449a){_0x1b0785=_0x45449a;return db[_0x46ef('0x2c')][_0x46ef('0x49')]({'where':{'membername':_0x1b0785['name']},'individualHooks':!![]});}})[_0x46ef('0x10')](function(){if(_0x1b0785){return db[_0x46ef('0x2e')][_0x46ef('0x1b')]({'where':{'membername':_0x1b0785[_0x46ef('0x28')],'exitAt':null}});}})['then'](function(_0x4e0a66){if(_0x1b0785){if(_0x4e0a66&&_0x4e0a66[_0x46ef('0x32')]){var _0x40b5d3=[];_0x4e0a66[_0x46ef('0x34')](function(_0x2ed020){_0x40b5d3[_0x46ef('0x35')](_0x2ed020[_0x46ef('0x2d')]({'exitAt':moment()[_0x46ef('0x30')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x46ef('0x47')](_0x40b5d3);}}})[_0x46ef('0x10')](function(){if(_0x1b0785){return _0x1b0785[_0x46ef('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x46ef('0x10')](function(_0x10f2a3){_0x3e2076(_0x10f2a3);})[_0x46ef('0x26')](function(_0x48cb09){_0x4d97d6(_0x2cf364[_0x46ef('0x15')](0x1f4,_0x48cb09[_0x46ef('0x17')]));});});};exports['LoginUser']=function(_0x14aaa9){var _0x37fc6f=this;return new Promise(function(_0x831ef4,_0x4a7b51){var _0x5cc22f;var _0x453e4d;var _0x30a601;var _0x2a13d0;return db[_0x46ef('0x1a')][_0x46ef('0x3c')]({'where':_0x14aaa9[_0x46ef('0x1c')]['where']||{},'attributes':['id',_0x46ef('0x28'),_0x46ef('0x29'),_0x46ef('0x4a'),'phone','internal',_0x46ef('0x4b'),'interface']})[_0x46ef('0x10')](function(_0x2346c0){if(_0x2346c0){_0x5cc22f=_0x2346c0;_0x2a13d0=_0x14aaa9[_0x46ef('0x38')][_0x46ef('0x2b')]?_0x14aaa9[_0x46ef('0x38')]['interface']:util['format'](_0x46ef('0x37'),_0x5cc22f['name']);return db[_0x46ef('0x1a')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5cc22f['id']}}});}})[_0x46ef('0x10')](function(_0xb0f6e8){if(_0xb0f6e8){_0x30a601=_0xb0f6e8;return require(_0x46ef('0x4c'))[_0x46ef('0x4d')]();}})[_0x46ef('0x10')](function(_0x2cdd02){if(_0x2cdd02&&_0x2cdd02['agents']&&_0x30a601>=_0x2cdd02[_0x46ef('0x4e')]){throw new Error(_0x46ef('0x4f'));}})[_0x46ef('0x10')](function(){if(_0x5cc22f){return db[_0x46ef('0x2c')]['destroy']({'where':{'membername':_0x5cc22f[_0x46ef('0x28')]},'individualHooks':!![]});}})[_0x46ef('0x10')](function(){if(_0x5cc22f){return _0x5cc22f[_0x46ef('0x50')]({'raw':!![]});}})[_0x46ef('0x10')](function(_0xad2734){if(_0x5cc22f){if(_0xad2734){var _0x542d94=[];_0x453e4d=_0xad2734;if(_0x453e4d[_0x46ef('0x32')]){for(var _0x2cdbac=0x0;_0x2cdbac<_0x453e4d[_0x46ef('0x32')];_0x2cdbac++){_0x542d94[_0x46ef('0x35')](db[_0x46ef('0x2c')][_0x46ef('0x51')]({'membername':_0x5cc22f[_0x46ef('0x28')],'UserId':_0x5cc22f['id'],'queue_name':_0x453e4d[_0x2cdbac]['name'],'VoiceQueueId':_0x453e4d[_0x2cdbac]['id'],'interface':_0x2a13d0,'paused':_0x5cc22f['loginInPause']||![],'penalty':_0x453e4d[_0x2cdbac]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x46ef('0x47')](_0x542d94);}}}})[_0x46ef('0x10')](function(){if(_0x5cc22f){return db[_0x46ef('0x2e')][_0x46ef('0x1b')]({'where':{'membername':_0x5cc22f[_0x46ef('0x28')],'exitAt':null}});}})['then'](function(_0x2e3770){if(_0x5cc22f){if(_0x2e3770&&_0x2e3770[_0x46ef('0x32')]){var _0x49a60e=[];_0x2e3770[_0x46ef('0x34')](function(_0x260bfc){_0x49a60e[_0x46ef('0x35')](_0x260bfc[_0x46ef('0x2d')]({'exitAt':moment()['format'](_0x46ef('0x31'))}));});return BPromise[_0x46ef('0x47')](_0x49a60e);}}})[_0x46ef('0x10')](function(_0x4eee21){if(_0x5cc22f){var _0x2649bb=[];var _0x45746a=[];var _0x44dab8=utils[_0x46ef('0x52')]();var _0x2e73cd={'membername':_0x5cc22f[_0x46ef('0x28')],'interface':_0x2a13d0,'enterAt':moment()[_0x46ef('0x30')](_0x46ef('0x31')),'role':_0x5cc22f[_0x46ef('0x29')],'internal':_0x5cc22f[_0x46ef('0x2a')]};_0x44dab8[_0x46ef('0x34')](function(_0x5ed8b7){_0x2649bb['push'](_[_0x46ef('0x53')]({'channel':_0x5ed8b7,'type':_0x46ef('0x54'),'data1':_0x46ef('0x55'),'data2':_0x2a13d0},_0x2e73cd));if(_0x5cc22f[_0x46ef('0x4b')]){_0x45746a[_0x46ef('0x35')](_[_0x46ef('0x53')]({'channel':_0x5ed8b7,'type':_0x46ef('0x2f'),'data1':'LOGININPAUSE'},_0x2e73cd));}});return db['MemberReport'][_0x46ef('0x3a')](_0x2649bb[_0x46ef('0x56')](_0x45746a),{'individualHooks':!![]});}})[_0x46ef('0x10')](function(){if(_0x5cc22f){return _0x5cc22f['update']({'online':!![],'lastLoginAt':moment()[_0x46ef('0x30')](_0x46ef('0x31')),'voicePause':_0x5cc22f[_0x46ef('0x4b')]||![],'mailPause':_0x5cc22f['loginInPause']||![],'chatPause':_0x5cc22f[_0x46ef('0x4b')]||![],'faxPause':_0x5cc22f[_0x46ef('0x4b')]||![],'smsPause':_0x5cc22f[_0x46ef('0x4b')]||![],'openchannelPause':_0x5cc22f['loginInPause']||![],'pauseType':_0x5cc22f[_0x46ef('0x4b')]?_0x46ef('0x57'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2a13d0});}})[_0x46ef('0x10')](function(_0x439893){_0x831ef4(_0x439893);})[_0x46ef('0x26')](function(_0x1a0af3){_0x4a7b51(_0x37fc6f[_0x46ef('0x15')](0x1f4,_0x1a0af3['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 486d676..3eaa405 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 _0x4b14=['emit','removeListener','register','length','user:','./user.events','save','remove','update'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x4b14,0xb9));var _0x44b1=function(_0x33d36c,_0x5a4237){_0x33d36c=_0x33d36c-0x0;var _0x284a31=_0x4b14[_0x33d36c];return _0x284a31;};'use strict';var UserEvents=require(_0x44b1('0x0'));var events=[_0x44b1('0x1'),_0x44b1('0x2'),_0x44b1('0x3')];function createListener(_0x3fa2ad,_0x588f44){return function(_0x2b565e){_0x588f44[_0x44b1('0x4')](_0x3fa2ad,_0x2b565e);};}function removeListener(_0xde954e,_0x3d1557){return function(){UserEvents[_0x44b1('0x5')](_0xde954e,_0x3d1557);};}exports[_0x44b1('0x6')]=function(_0x435b58){for(var _0x3ee427=0x0,_0x71b151=events[_0x44b1('0x7')];_0x3ee427<_0x71b151;_0x3ee427++){var _0x6d0a46=events[_0x3ee427];var _0x3c8caf=createListener(_0x44b1('0x8')+_0x6d0a46,_0x435b58);UserEvents['on'](_0x6d0a46,_0x3c8caf);}}; \ No newline at end of file +var _0x2966=['length','user:','save','remove','emit','register'];(function(_0x4f35f4,_0x51a8c3){var _0x2e9a70=function(_0x110aca){while(--_0x110aca){_0x4f35f4['push'](_0x4f35f4['shift']());}};_0x2e9a70(++_0x51a8c3);}(_0x2966,0x1b8));var _0x6296=function(_0x178180,_0x421dc1){_0x178180=_0x178180-0x0;var _0x49c66b=_0x2966[_0x178180];return _0x49c66b;};'use strict';var UserEvents=require('./user.events');var events=[_0x6296('0x0'),_0x6296('0x1'),'update'];function createListener(_0x4ef050,_0x3383d2){return function(_0x3a6d1e){_0x3383d2[_0x6296('0x2')](_0x4ef050,_0x3a6d1e);};}function removeListener(_0x3b3476,_0x1b5763){return function(){UserEvents['removeListener'](_0x3b3476,_0x1b5763);};}exports[_0x6296('0x3')]=function(_0x44d1bf){for(var _0x1da1ca=0x0,_0x4a2275=events[_0x6296('0x4')];_0x1da1ca<_0x4a2275;_0x1da1ca++){var _0x195714=events[_0x1da1ca];var _0x23e0d7=createListener(_0x6296('0x5')+_0x195714,_0x44d1bf);UserEvents['on'](_0x195714,_0x23e0d7);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 11dadd8..357eae6 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(_0x27d8a2,_0x3700ef){var _0x299b7c=function(_0x34d5f9){while(--_0x34d5f9){_0x27d8a2['push'](_0x27d8a2['shift']());}};_0x299b7c(++_0x3700ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x40124e,_0x47920b){var _0x2e8dc2=function(_0x3a6674){while(--_0x3a6674){_0x40124e['push'](_0x40124e['shift']());}};_0x2e8dc2(++_0x47920b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index d062c64..179842f 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 _0x3eda=['sequelize'];(function(_0x327075,_0xfe9509){var _0x275317=function(_0x5e0f7e){while(--_0x5e0f7e){_0x327075['push'](_0x327075['shift']());}};_0x275317(++_0xfe9509);}(_0x3eda,0x69));var _0xa3ed=function(_0x291ea5,_0x3fcea0){_0x291ea5=_0x291ea5-0x0;var _0x151afa=_0x3eda[_0x291ea5];return _0x151afa;};'use strict';var Sequelize=require(_0xa3ed('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x019f=['exports'];(function(_0x5219e4,_0x50cdef){var _0x390418=function(_0x589678){while(--_0x589678){_0x5219e4['push'](_0x5219e4['shift']());}};_0x390418(++_0x50cdef);}(_0x019f,0xfc));var _0xf019=function(_0x49bf38,_0x42c116){_0x49bf38=_0x49bf38-0x0;var _0xb76377=_0x019f[_0x49bf38];return _0xb76377;};'use strict';var Sequelize=require('sequelize');module[_0xf019('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index bdea724..634f567 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 _0x6bda=['rimraf','../../config/environment','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4f25f1,_0x35e84b){var _0x1799f7=function(_0x1b93ba){while(--_0x1b93ba){_0x4f25f1['push'](_0x4f25f1['shift']());}};_0x1799f7(++_0x35e84b);}(_0x6bda,0x19e));var _0xa6bd=function(_0x2d2c68,_0x7af994){_0x2d2c68=_0x2d2c68-0x0;var _0x57aff7=_0x6bda[_0x2d2c68];return _0x57aff7;};'use strict';var _=require('lodash');var util=require(_0xa6bd('0x0'));var logger=require(_0xa6bd('0x1'))(_0xa6bd('0x2'));var moment=require(_0xa6bd('0x3'));var BPromise=require('bluebird');var rp=require(_0xa6bd('0x4'));var fs=require('fs');var path=require(_0xa6bd('0x5'));var rimraf=require(_0xa6bd('0x6'));var config=require(_0xa6bd('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x1252b0,_0x3b22df){return _0x1252b0['define'](_0xa6bd('0x8'),attributes,{'tableName':_0xa6bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x318c=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x2b6452,_0x28b46b){var _0x1d585d=function(_0x112953){while(--_0x112953){_0x2b6452['push'](_0x2b6452['shift']());}};_0x1d585d(++_0x28b46b);}(_0x318c,0x83));var _0xc318=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x318c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc318('0x0'));var util=require(_0xc318('0x1'));var logger=require(_0xc318('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc318('0x3'));var rp=require(_0xc318('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc318('0x5'));var config=require(_0xc318('0x6'));var attributes=require(_0xc318('0x7'));module[_0xc318('0x8')]=function(_0x3fe51a,_0x327ccb){return _0x3fe51a[_0xc318('0x9')](_0xc318('0xa'),attributes,{'tableName':_0xc318('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index cd07ef3..9ecf90c 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 _0xb057=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb057,0xb5));var _0x7b05=function(_0xab7b7f,_0x4115fa){_0xab7b7f=_0xab7b7f-0x0;var _0x55b3ce=_0xb057[_0xab7b7f];return _0x55b3ce;};'use strict';var _=require(_0x7b05('0x0'));var util=require(_0x7b05('0x1'));var moment=require(_0x7b05('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b05('0x3'));var db=require(_0x7b05('0x4'))['db'];var utils=require(_0x7b05('0x5'));var logger=require('../../config/logger')(_0x7b05('0x6'));var config=require(_0x7b05('0x7'));var jayson=require(_0x7b05('0x8'));var client=jayson[_0x7b05('0x9')][_0x7b05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ada5c,_0x11273a,_0x4294be){return new BPromise(function(_0x36fffa,_0x54793d){return client[_0x7b05('0xb')](_0x5ada5c,_0x4294be)['then'](function(_0x32058a){logger[_0x7b05('0xc')](_0x7b05('0xd'),_0x11273a,_0x7b05('0xe'));logger[_0x7b05('0xf')](_0x7b05('0x10'),_0x11273a,_0x7b05('0xe'),JSON[_0x7b05('0x11')](_0x32058a));if(_0x32058a['error']){if(_0x32058a[_0x7b05('0x12')][_0x7b05('0x13')]===0x1f4){logger['error'](_0x7b05('0xd'),_0x11273a,_0x32058a[_0x7b05('0x12')][_0x7b05('0x14')]);return _0x54793d(_0x32058a['error'][_0x7b05('0x14')]);}logger[_0x7b05('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x11273a,_0x32058a[_0x7b05('0x12')][_0x7b05('0x14')]);return _0x36fffa(_0x32058a[_0x7b05('0x12')][_0x7b05('0x14')]);}else{logger[_0x7b05('0xc')](_0x7b05('0xd'),_0x11273a,_0x7b05('0xe'));_0x36fffa(_0x32058a[_0x7b05('0x15')][_0x7b05('0x14')]);}})[_0x7b05('0x16')](function(_0x2dcb00){logger[_0x7b05('0x12')](_0x7b05('0xd'),_0x11273a,_0x2dcb00);_0x54793d(_0x2dcb00);});});} \ No newline at end of file +var _0x1c57=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','ioredis'];(function(_0x571339,_0x5bcafb){var _0x5af8a6=function(_0x389251){while(--_0x389251){_0x571339['push'](_0x571339['shift']());}};_0x5af8a6(++_0x5bcafb);}(_0x1c57,0x1bf));var _0x71c5=function(_0x3547d5,_0x502e71){_0x3547d5=_0x3547d5-0x0;var _0x4fb28f=_0x1c57[_0x3547d5];return _0x4fb28f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x71c5('0x0'));var BPromise=require(_0x71c5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71c5('0x2'));var db=require(_0x71c5('0x3'))['db'];var utils=require(_0x71c5('0x4'));var logger=require(_0x71c5('0x5'))(_0x71c5('0x6'));var config=require(_0x71c5('0x7'));var jayson=require(_0x71c5('0x8'));var client=jayson[_0x71c5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4628ec,_0x210b4b,_0x41fc0d){return new BPromise(function(_0xf8fea2,_0x34d2de){return client['request'](_0x4628ec,_0x41fc0d)['then'](function(_0x308247){logger[_0x71c5('0xa')](_0x71c5('0xb'),_0x210b4b,_0x71c5('0xc'));logger['debug'](_0x71c5('0xd'),_0x210b4b,_0x71c5('0xc'),JSON[_0x71c5('0xe')](_0x308247));if(_0x308247[_0x71c5('0xf')]){if(_0x308247[_0x71c5('0xf')]['code']===0x1f4){logger[_0x71c5('0xf')](_0x71c5('0xb'),_0x210b4b,_0x308247[_0x71c5('0xf')][_0x71c5('0x10')]);return _0x34d2de(_0x308247[_0x71c5('0xf')]['message']);}logger[_0x71c5('0xf')](_0x71c5('0xb'),_0x210b4b,_0x308247[_0x71c5('0xf')][_0x71c5('0x10')]);return _0xf8fea2(_0x308247['error'][_0x71c5('0x10')]);}else{logger[_0x71c5('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x210b4b,_0x71c5('0xc'));_0xf8fea2(_0x308247[_0x71c5('0x11')][_0x71c5('0x10')]);}})['catch'](function(_0x1ec1c4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x210b4b,_0x1ec1c4);_0x34d2de(_0x1ec1c4);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index dee4c0f..e3b4529 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(_0x4fa2da,_0x8ab535){var _0xd6958a=function(_0x30477f){while(--_0x30477f){_0x4fa2da['push'](_0x4fa2da['shift']());}};_0xd6958a(++_0x8ab535);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3d8fff,_0x5669b0){var _0x2f88eb=function(_0x25a474){while(--_0x25a474){_0x3d8fff['push'](_0x3d8fff['shift']());}};_0x2f88eb(++_0x5669b0);}(_0x70e0,0x17b));var _0x070e=function(_0x5a91ed,_0x180e37){_0x5a91ed=_0x5a91ed-0x0;var _0x302e3f=_0x70e0[_0x5a91ed];return _0x302e3f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index d7c960f..2dbcbbe 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 _0x128c=['INTEGER','STRING','sequelize','exports'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x128c,0xc6));var _0xc128=function(_0x507103,_0x28ebed){_0x507103=_0x507103-0x0;var _0x493d73=_0x128c[_0x507103];return _0x493d73;};'use strict';var Sequelize=require(_0xc128('0x0'));module[_0xc128('0x1')]={'penalty':{'type':Sequelize[_0xc128('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc128('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc128('0x3')]}}; \ No newline at end of file +var _0x9df1=['exports','INTEGER','STRING'];(function(_0x2b55df,_0x4bd469){var _0x2cdb3b=function(_0x12faa0){while(--_0x12faa0){_0x2b55df['push'](_0x2b55df['shift']());}};_0x2cdb3b(++_0x4bd469);}(_0x9df1,0x1f2));var _0x19df=function(_0x2b3ae8,_0x5216b){_0x2b3ae8=_0x2b3ae8-0x0;var _0x2fc1d3=_0x9df1[_0x2b3ae8];return _0x2fc1d3;};'use strict';var Sequelize=require('sequelize');module[_0x19df('0x0')]={'penalty':{'type':Sequelize[_0x19df('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x19df('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x19df('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index f0cd670..44de8f4 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 _0xd58f=['moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define','UserFaxQueue','util','../../config/logger'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0xd58f,0x82));var _0xfd58=function(_0x5dc7bb,_0x3c2edc){_0x5dc7bb=_0x5dc7bb-0x0;var _0x3569c3=_0xd58f[_0x5dc7bb];return _0x3569c3;};'use strict';var _=require('lodash');var util=require(_0xfd58('0x0'));var logger=require(_0xfd58('0x1'))('api');var moment=require(_0xfd58('0x2'));var BPromise=require(_0xfd58('0x3'));var rp=require(_0xfd58('0x4'));var fs=require('fs');var path=require(_0xfd58('0x5'));var rimraf=require(_0xfd58('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd58('0x7'));module[_0xfd58('0x8')]=function(_0x4cfd4d,_0x262eca){return _0x4cfd4d[_0xfd58('0x9')](_0xfd58('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecc6=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0xecc6,0x191));var _0x6ecc=function(_0x78e890,_0x5152ef){_0x78e890=_0x78e890-0x0;var _0x27cecc=_0xecc6[_0x78e890];return _0x27cecc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ecc('0x0'))('api');var moment=require(_0x6ecc('0x1'));var BPromise=require(_0x6ecc('0x2'));var rp=require(_0x6ecc('0x3'));var fs=require('fs');var path=require(_0x6ecc('0x4'));var rimraf=require(_0x6ecc('0x5'));var config=require(_0x6ecc('0x6'));var attributes=require(_0x6ecc('0x7'));module[_0x6ecc('0x8')]=function(_0x1d2399,_0x4aaf1c){return _0x1d2399[_0x6ecc('0x9')](_0x6ecc('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index d180f1a..2a223ed 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 _0x96be=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x184b73,_0x1c7199){var _0x301e92=function(_0x198e1e){while(--_0x198e1e){_0x184b73['push'](_0x184b73['shift']());}};_0x301e92(++_0x1c7199);}(_0x96be,0x1c9));var _0xe96b=function(_0x1bb43d,_0x323fe9){_0x1bb43d=_0x1bb43d-0x0;var _0x45ab4f=_0x96be[_0x1bb43d];return _0x45ab4f;};'use strict';var _=require(_0xe96b('0x0'));var util=require(_0xe96b('0x1'));var moment=require(_0xe96b('0x2'));var BPromise=require(_0xe96b('0x3'));var rs=require(_0xe96b('0x4'));var fs=require('fs');var Redis=require(_0xe96b('0x5'));var db=require(_0xe96b('0x6'))['db'];var utils=require(_0xe96b('0x7'));var logger=require(_0xe96b('0x8'))(_0xe96b('0x9'));var config=require(_0xe96b('0xa'));var jayson=require(_0xe96b('0xb'));var client=jayson[_0xe96b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ba98b,_0x4ffa3b,_0x57656b){return new BPromise(function(_0x18e309,_0x332b95){return client['request'](_0x5ba98b,_0x57656b)['then'](function(_0x48b02c){logger[_0xe96b('0xd')](_0xe96b('0xe'),_0x4ffa3b,_0xe96b('0xf'));logger[_0xe96b('0x10')](_0xe96b('0x11'),_0x4ffa3b,_0xe96b('0xf'),JSON[_0xe96b('0x12')](_0x48b02c));if(_0x48b02c[_0xe96b('0x13')]){if(_0x48b02c['error'][_0xe96b('0x14')]===0x1f4){logger[_0xe96b('0x13')](_0xe96b('0xe'),_0x4ffa3b,_0x48b02c[_0xe96b('0x13')][_0xe96b('0x15')]);return _0x332b95(_0x48b02c['error'][_0xe96b('0x15')]);}logger[_0xe96b('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x4ffa3b,_0x48b02c[_0xe96b('0x13')][_0xe96b('0x15')]);return _0x18e309(_0x48b02c[_0xe96b('0x13')][_0xe96b('0x15')]);}else{logger[_0xe96b('0xd')](_0xe96b('0xe'),_0x4ffa3b,'request\x20sent');_0x18e309(_0x48b02c[_0xe96b('0x16')][_0xe96b('0x15')]);}})[_0xe96b('0x17')](function(_0x189296){logger['error'](_0xe96b('0xe'),_0x4ffa3b,_0x189296);_0x332b95(_0x189296);});});} \ No newline at end of file +var _0x22bf=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x22bf,0x1e9));var _0xf22b=function(_0x256310,_0x3150c2){_0x256310=_0x256310-0x0;var _0x5cdd23=_0x22bf[_0x256310];return _0x5cdd23;};'use strict';var _=require(_0xf22b('0x0'));var util=require(_0xf22b('0x1'));var moment=require(_0xf22b('0x2'));var BPromise=require(_0xf22b('0x3'));var rs=require(_0xf22b('0x4'));var fs=require('fs');var Redis=require(_0xf22b('0x5'));var db=require(_0xf22b('0x6'))['db'];var utils=require(_0xf22b('0x7'));var logger=require('../../config/logger')(_0xf22b('0x8'));var config=require(_0xf22b('0x9'));var jayson=require(_0xf22b('0xa'));var client=jayson[_0xf22b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43d6c2,_0x3e4fe4,_0x50cbe5){return new BPromise(function(_0x4c99ff,_0x44f280){return client[_0xf22b('0xc')](_0x43d6c2,_0x50cbe5)[_0xf22b('0xd')](function(_0x50ed2d){logger['info'](_0xf22b('0xe'),_0x3e4fe4,_0xf22b('0xf'));logger[_0xf22b('0x10')](_0xf22b('0x11'),_0x3e4fe4,_0xf22b('0xf'),JSON[_0xf22b('0x12')](_0x50ed2d));if(_0x50ed2d[_0xf22b('0x13')]){if(_0x50ed2d['error']['code']===0x1f4){logger[_0xf22b('0x13')](_0xf22b('0xe'),_0x3e4fe4,_0x50ed2d[_0xf22b('0x13')][_0xf22b('0x14')]);return _0x44f280(_0x50ed2d[_0xf22b('0x13')][_0xf22b('0x14')]);}logger[_0xf22b('0x13')](_0xf22b('0xe'),_0x3e4fe4,_0x50ed2d['error'][_0xf22b('0x14')]);return _0x4c99ff(_0x50ed2d['error'][_0xf22b('0x14')]);}else{logger[_0xf22b('0x15')](_0xf22b('0xe'),_0x3e4fe4,_0xf22b('0xf'));_0x4c99ff(_0x50ed2d['result'][_0xf22b('0x14')]);}})[_0xf22b('0x16')](function(_0x473238){logger[_0xf22b('0x13')](_0xf22b('0xe'),_0x3e4fe4,_0x473238);_0x44f280(_0x473238);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ed16fc1..8aed63c 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x203f90,_0x1f112d){var _0x3f8714=function(_0x541065){while(--_0x541065){_0x203f90['push'](_0x203f90['shift']());}};_0x3f8714(++_0x1f112d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xc6fd38,_0x470eca){var _0x37ff8a=function(_0x16f8dc){while(--_0x16f8dc){_0xc6fd38['push'](_0xc6fd38['shift']());}};_0x37ff8a(++_0x470eca);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0xcb91[_0x398294];return _0x2a872d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 95fb74f..a42b376 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 _0xafe8=['INTEGER','sequelize','exports'];(function(_0x488c02,_0x556605){var _0x3cad29=function(_0x3b3146){while(--_0x3b3146){_0x488c02['push'](_0x488c02['shift']());}};_0x3cad29(++_0x556605);}(_0xafe8,0x166));var _0x8afe=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0xafe8[_0x2af29a];return _0x5ef02f;};'use strict';var Sequelize=require(_0x8afe('0x0'));module[_0x8afe('0x1')]={'penalty':{'type':Sequelize[_0x8afe('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5692=['sequelize','exports','INTEGER'];(function(_0x5da0fd,_0x18a7c7){var _0x5a2412=function(_0x21374b){while(--_0x21374b){_0x5da0fd['push'](_0x5da0fd['shift']());}};_0x5a2412(++_0x18a7c7);}(_0x5692,0x14a));var _0x2569=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5692[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x2569('0x0'));module[_0x2569('0x1')]={'penalty':{'type':Sequelize[_0x2569('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 1f2b26e..14ad2a7 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 _0x1a45=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x1a45,0x169));var _0x51a4=function(_0x337aa5,_0x4d7e18){_0x337aa5=_0x337aa5-0x0;var _0x18f65f=_0x1a45[_0x337aa5];return _0x18f65f;};'use strict';var _=require(_0x51a4('0x0'));var util=require(_0x51a4('0x1'));var logger=require(_0x51a4('0x2'))(_0x51a4('0x3'));var moment=require('moment');var BPromise=require(_0x51a4('0x4'));var rp=require(_0x51a4('0x5'));var fs=require('fs');var path=require(_0x51a4('0x6'));var rimraf=require(_0x51a4('0x7'));var config=require(_0x51a4('0x8'));var attributes=require('./userMailQueue.attributes');module[_0x51a4('0x9')]=function(_0x2333f7,_0x3df2c7){return _0x2333f7[_0x51a4('0xa')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0eef=['define','user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./userMailQueue.attributes'];(function(_0x5a7ba5,_0x3dbc83){var _0x10b06f=function(_0x4b1ecc){while(--_0x4b1ecc){_0x5a7ba5['push'](_0x5a7ba5['shift']());}};_0x10b06f(++_0x3dbc83);}(_0x0eef,0x98));var _0xf0ee=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0eef[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xf0ee('0x0'));var util=require(_0xf0ee('0x1'));var logger=require(_0xf0ee('0x2'))('api');var moment=require(_0xf0ee('0x3'));var BPromise=require(_0xf0ee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf0ee('0x5'));var config=require(_0xf0ee('0x6'));var attributes=require(_0xf0ee('0x7'));module['exports']=function(_0x2806d0,_0x5a4471){return _0x2806d0[_0xf0ee('0x8')]('UserMailQueue',attributes,{'tableName':_0xf0ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 8ed19b5..092510b 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2ea0e1,_0x735a6f){var _0x39331e=function(_0x24eebb){while(--_0x24eebb){_0x2ea0e1['push'](_0x2ea0e1['shift']());}};_0x39331e(++_0x735a6f);}(_0x3e74,0x175));var _0x43e7=function(_0x59441a,_0x14f8c4){_0x59441a=_0x59441a-0x0;var _0x8ceda0=_0x3e74[_0x59441a];return _0x8ceda0;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4071e9,_0xe9d586){var _0x211a60=function(_0x107d07){while(--_0x107d07){_0x4071e9['push'](_0x4071e9['shift']());}};_0x211a60(++_0xe9d586);}(_0x8ef6,0xf2));var _0x68ef=function(_0x308c55,_0x552767){_0x308c55=_0x308c55-0x0;var _0x70293e=_0x8ef6[_0x308c55];return _0x70293e;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 7590790..7df859f 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 _0x8deb=['Router','../../components/interaction/service','./userNotification.controller','post','sendUserNotification','exports','connect-timeout','express'];(function(_0x435e86,_0x14156b){var _0x39852e=function(_0x384c2e){while(--_0x384c2e){_0x435e86['push'](_0x435e86['shift']());}};_0x39852e(++_0x14156b);}(_0x8deb,0x176));var _0xb8de=function(_0x5dfec0,_0x138016){_0x5dfec0=_0x5dfec0-0x0;var _0x422da9=_0x8deb[_0x5dfec0];return _0x422da9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb8de('0x0'));var express=require(_0xb8de('0x1'));var router=express[_0xb8de('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb8de('0x3'));var config=require('../../config/environment');var controller=require(_0xb8de('0x4'));router[_0xb8de('0x5')]('/',auth['isAuthenticated'](),controller[_0xb8de('0x6')]);module[_0xb8de('0x7')]=router; \ No newline at end of file +var _0x0a2c=['./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0a2c,0x1a5));var _0xc0a2=function(_0x44bb3c,_0x2cb3dc){_0x44bb3c=_0x44bb3c-0x0;var _0x3ac2fc=_0x0a2c[_0x44bb3c];return _0x3ac2fc;};'use strict';var multer=require('multer');var util=require(_0xc0a2('0x0'));var path=require('path');var timeout=require(_0xc0a2('0x1'));var express=require(_0xc0a2('0x2'));var router=express[_0xc0a2('0x3')]();var fs_extra=require(_0xc0a2('0x4'));var auth=require(_0xc0a2('0x5'));var interaction=require(_0xc0a2('0x6'));var config=require(_0xc0a2('0x7'));var controller=require(_0xc0a2('0x8'));router[_0xc0a2('0x9')]('/',auth[_0xc0a2('0xa')](),controller[_0xc0a2('0xb')]);module[_0xc0a2('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 8ba5d6b..7c0ddc6 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 _0xd7f5=['STRING','BOOLEAN','TEXT'];(function(_0x135632,_0x540d57){var _0x481cd3=function(_0x3ff522){while(--_0x3ff522){_0x135632['push'](_0x135632['shift']());}};_0x481cd3(++_0x540d57);}(_0xd7f5,0x65));var _0x5d7f=function(_0x5076ae,_0x4d9525){_0x5076ae=_0x5076ae-0x0;var _0x1b936f=_0xd7f5[_0x5076ae];return _0x1b936f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5d7f('0x0')]},'senderName':{'type':Sequelize[_0x5d7f('0x1')]},'recipientsId':{'type':Sequelize[_0x5d7f('0x0')]},'recipientsDescription':{'type':Sequelize[_0x5d7f('0x1')]},'beep':{'type':Sequelize[_0x5d7f('0x2')]}}; \ No newline at end of file +var _0x25ff=['STRING','sequelize','TEXT'];(function(_0x1281ab,_0x293f23){var _0xda35e0=function(_0x57a978){while(--_0x57a978){_0x1281ab['push'](_0x1281ab['shift']());}};_0xda35e0(++_0x293f23);}(_0x25ff,0x88));var _0xf25f=function(_0x2c2a30,_0x43d9e6){_0x2c2a30=_0x2c2a30-0x0;var _0x2c0020=_0x25ff[_0x2c2a30];return _0x2c0020;};'use strict';var Sequelize=require(_0xf25f('0x0'));module['exports']={'body':{'type':Sequelize[_0xf25f('0x1')]},'senderName':{'type':Sequelize[_0xf25f('0x2')]},'recipientsId':{'type':Sequelize[_0xf25f('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 17edaad..e30abc6 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 _0x3b5e=['toLowerCase','User','replace','Queue','ids','all','union','getAgents','map','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','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','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','sendUserNotification','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase'];(function(_0x567fd4,_0x367e70){var _0x47c9bc=function(_0x3cad06){while(--_0x3cad06){_0x567fd4['push'](_0x567fd4['shift']());}};_0x47c9bc(++_0x367e70);}(_0x3b5e,0x144));var _0xe3b5=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x3b5e[_0x5f309e];return _0x487b5e;};'use strict';var emlformat=require(_0xe3b5('0x0'));var rimraf=require(_0xe3b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3b5('0x2'));var rp=require(_0xe3b5('0x3'));var moment=require(_0xe3b5('0x4'));var BPromise=require(_0xe3b5('0x5'));var Mustache=require(_0xe3b5('0x6'));var util=require(_0xe3b5('0x7'));var path=require(_0xe3b5('0x8'));var sox=require(_0xe3b5('0x9'));var csv=require('to-csv');var ejs=require(_0xe3b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3b5('0xb'));var squel=require(_0xe3b5('0xc'));var crypto=require(_0xe3b5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe3b5('0xe'));var querystring=require(_0xe3b5('0xf'));var Papa=require(_0xe3b5('0x10'));var Redis=require(_0xe3b5('0x11'));var authService=require(_0xe3b5('0x12'));var qs=require(_0xe3b5('0x13'));var as=require(_0xe3b5('0x14'));var hardwareService=require(_0xe3b5('0x15'));var logger=require(_0xe3b5('0x16'))(_0xe3b5('0x17'));var utils=require(_0xe3b5('0x18'));var config=require(_0xe3b5('0x19'));var licenseUtil=require(_0xe3b5('0x1a'));var db=require(_0xe3b5('0x1b'))['db'];config[_0xe3b5('0x1c')]=_[_0xe3b5('0x1d')](config[_0xe3b5('0x1c')],{'host':_0xe3b5('0x1e'),'port':0x18eb});var socket=require(_0xe3b5('0x1f'))(new Redis(config[_0xe3b5('0x1c')]));require(_0xe3b5('0x20'))[_0xe3b5('0x21')](socket);function respondWithStatusCode(_0x11f3f1,_0x4f35e0){_0x4f35e0=_0x4f35e0||0xcc;return function(_0x5306e7){if(_0x5306e7){return _0x11f3f1[_0xe3b5('0x22')](_0x4f35e0);}return _0x11f3f1[_0xe3b5('0x23')](_0x4f35e0)[_0xe3b5('0x24')]();};}function respondWithResult(_0x4cab14,_0x398eb9){_0x398eb9=_0x398eb9||0xc8;return function(_0x447148){if(_0x447148){return _0x4cab14[_0xe3b5('0x23')](_0x398eb9)[_0xe3b5('0x25')](_0x447148);}};}function respondWithFilteredResult(_0x21c489,_0x2b3a6f){return function(_0x3a400d){if(_0x3a400d){var _0x140d08=typeof _0x2b3a6f[_0xe3b5('0x26')]===_0xe3b5('0x27')&&typeof _0x2b3a6f[_0xe3b5('0x28')]===_0xe3b5('0x27');var _0x221b30=_0x3a400d[_0xe3b5('0x29')];var _0x4304bc=_0x140d08?0x0:_0x2b3a6f[_0xe3b5('0x26')];var _0x148f63=_0x140d08?_0x3a400d['count']:_0x2b3a6f[_0xe3b5('0x26')]+_0x2b3a6f[_0xe3b5('0x28')];var _0x5e4c7a;if(_0x148f63>=_0x221b30){_0x148f63=_0x221b30;_0x5e4c7a=0xc8;}else{_0x5e4c7a=0xce;}_0x21c489[_0xe3b5('0x23')](_0x5e4c7a);return _0x21c489[_0xe3b5('0x2a')](_0xe3b5('0x2b'),_0x4304bc+'-'+_0x148f63+'/'+_0x221b30)['json'](_0x3a400d);}return null;};}function patchUpdates(_0x559882){return function(_0x2a6a36){try{jsonpatch['apply'](_0x2a6a36,_0x559882,!![]);}catch(_0x1bf5d8){return BPromise[_0xe3b5('0x2c')](_0x1bf5d8);}return _0x2a6a36[_0xe3b5('0x2d')]();};}function saveUpdates(_0x41cd8e,_0x32713b){return function(_0x22204b){if(_0x22204b){return _0x22204b['update'](_0x41cd8e)[_0xe3b5('0x2e')](function(_0x539d9e){return _0x539d9e;});}return null;};}function removeEntity(_0x3a40fb,_0x46cd53){return function(_0x518472){if(_0x518472){return _0x518472[_0xe3b5('0x2f')]()['then'](function(){_0x3a40fb[_0xe3b5('0x23')](0xcc)[_0xe3b5('0x24')]();});}};}function handleEntityNotFound(_0x2722c7,_0x163301){return function(_0x339db1){if(!_0x339db1){_0x2722c7[_0xe3b5('0x22')](0x194);}return _0x339db1;};}function handleError(_0x4f5851,_0x53534c){_0x53534c=_0x53534c||0x1f4;return function(_0x41754e){logger[_0xe3b5('0x30')](_0x41754e[_0xe3b5('0x31')]);if(_0x41754e[_0xe3b5('0x32')]){delete _0x41754e[_0xe3b5('0x32')];}_0x4f5851[_0xe3b5('0x23')](_0x53534c)['send'](_0x41754e);};}exports[_0xe3b5('0x33')]=function(_0x4acfeb,_0x5c985e,_0x4a0856){if(!_0x4acfeb['body']['hasOwnProperty'](_0xe3b5('0x34'))&&!_0x4acfeb[_0xe3b5('0x35')]['hasOwnProperty'](_0xe3b5('0x36'))){throw new db[(_0xe3b5('0x37'))][(_0xe3b5('0x38'))](_0xe3b5('0x39'));}else{if(_0x4acfeb[_0xe3b5('0x35')][_0xe3b5('0x3a')](_0xe3b5('0x36'))&&!_0x4acfeb['body']['hasOwnProperty'](_0xe3b5('0x3b'))){throw new db[(_0xe3b5('0x37'))][(_0xe3b5('0x38'))](_0xe3b5('0x3c'));}if(!_0x4acfeb[_0xe3b5('0x35')][_0xe3b5('0x3a')](_0xe3b5('0x3d'))){throw new db['Sequelize'][(_0xe3b5('0x38'))](_0xe3b5('0x3e'));}else{try{var _0x3eedf1=JSON['parse'](_0x4acfeb[_0xe3b5('0x35')][_0xe3b5('0x3d')]);}catch(_0x27b96c){logger[_0xe3b5('0x30')](_0x27b96c);throw new db[(_0xe3b5('0x37'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x18393b=[_0xe3b5('0x3f'),_0xe3b5('0x40'),_0xe3b5('0x41'),_0xe3b5('0x42'),_0xe3b5('0x43'),_0xe3b5('0x44'),'whatsappqueue',_0xe3b5('0x45'),_0xe3b5('0x46')];if(_[_0xe3b5('0x47')](_0x3eedf1,function(_0x487096){return!_[_0xe3b5('0x48')](_0x18393b,_0x487096[_0xe3b5('0x49')]['toLowerCase']());})){throw new db[(_0xe3b5('0x37'))][(_0xe3b5('0x38'))](_0xe3b5('0x4a'));}}}var _0x5bb8ba={};_0x5bb8ba['senderName']=_0x4acfeb['body'][_0xe3b5('0x3a')](_0xe3b5('0x4b'))?_0x4acfeb[_0xe3b5('0x35')][_0xe3b5('0x4b')]:_0x4acfeb['user'][_0xe3b5('0x4c')];_0x5bb8ba[_0xe3b5('0x4d')]=_['isEmpty'](_0x4acfeb[_0xe3b5('0x35')]['recipientsDescription'])?null:_0x4acfeb[_0xe3b5('0x35')][_0xe3b5('0x4d')];_0x5bb8ba[_0xe3b5('0x4e')]=_0x4acfeb[_0xe3b5('0x35')]['beep']||![];_0x5bb8ba[_0xe3b5('0x4f')]=_0x4acfeb[_0xe3b5('0x46')]['id'];return getContent(_0x4acfeb[_0xe3b5('0x35')])[_0xe3b5('0x2e')](function(_0x56f9bd){_0x5bb8ba[_0xe3b5('0x35')]=_0x56f9bd;return getRecipients(_0x3eedf1);})['then'](function(_0x3bab32){_0x5bb8ba['recipientsId']=_[_0xe3b5('0x50')](_0x3bab32)[_0xe3b5('0x51')](',');return db[_0xe3b5('0x52')][_0xe3b5('0x53')](function(_0x149ac4){return db[_0xe3b5('0x54')][_0xe3b5('0x55')](_0x5bb8ba,{'raw':!![],'transaction':_0x149ac4})[_0xe3b5('0x2e')](function(_0x36179b){var _0x2f65e4={'sender':_0x5bb8ba['senderName'],'description':_0x5bb8ba[_0xe3b5('0x4d')],'content':_0x5bb8ba[_0xe3b5('0x35')],'beep':_0x5bb8ba[_0xe3b5('0x4e')]};_0x3bab32[_0xe3b5('0x56')](function(_0x4ef8a6){_0x2f65e4[_0xe3b5('0x57')]=_0x4ef8a6;socket[_0xe3b5('0x58')](_0xe3b5('0x59'),_0x2f65e4);});return _0x36179b;});});})[_0xe3b5('0x2e')](respondWithResult(_0x5c985e,0xc9))[_0xe3b5('0x5a')](handleError(_0x5c985e,null));};function getContent(_0x435e5b){return new BPromise(function(_0x5ed711,_0x85549f){if(_0x435e5b[_0xe3b5('0x34')]){_0x5ed711(_0x435e5b[_0xe3b5('0x34')]);return;}return db['Template'][_0xe3b5('0x5b')]({'attributes':[_0xe3b5('0x5c')],'where':{'id':_0x435e5b[_0xe3b5('0x36')]},'raw':!![]})[_0xe3b5('0x2e')](function(_0x28d203){if(!_0x28d203)throw new db[(_0xe3b5('0x37'))][(_0xe3b5('0x38'))](_0xe3b5('0x5d'));var _0x160c04=Mustache[_0xe3b5('0x5e')](_0x28d203[_0xe3b5('0x5c')],_0x435e5b[_0xe3b5('0x3b')]);_0x5ed711(_0x160c04);})[_0xe3b5('0x5a')](function(_0x283d72){_0x85549f(_0x283d72);});});}function getRecipients(_0x4f83a6){return new BPromise(function(_0x2164a9,_0x3c0bd2){var _0x230db3=[];var _0x2e5100=[];_0x4f83a6['forEach'](function(_0x15a10e){var _0x2543bf=_[_0xe3b5('0x5f')](_0x15a10e['model'][_0xe3b5('0x60')]());if(_0x2543bf===_0xe3b5('0x61')){_0x230db3=_['union'](_0x230db3,_0x15a10e['ids']);}else{if(_[_0xe3b5('0x48')](_0x2543bf,'queue'))_0x2543bf=_0x2543bf[_0xe3b5('0x62')]('queue',_0xe3b5('0x63'));_0x15a10e[_0xe3b5('0x64')][_0xe3b5('0x56')](function(_0x5783a2){_0x2e5100['push'](getAgents(_0x2543bf,_0x5783a2));});}});return BPromise[_0xe3b5('0x65')](_0x2e5100)[_0xe3b5('0x2e')](function(_0x325c4c){_0x230db3=_[_0xe3b5('0x66')](_0x230db3,_['flatten'](_0x325c4c));_0x2164a9(_0x230db3);})['catch'](function(_0x43f15f){_0x3c0bd2(_0x43f15f);});});}function getAgents(_0x371efa,_0x1137d5){return new BPromise(function(_0x45712e,_0x57b542){return db[_0x371efa][_0xe3b5('0x5b')]({'where':{'id':_0x1137d5}})[_0xe3b5('0x2e')](function(_0x4c3f2d){return _0x4c3f2d[_0xe3b5('0x67')]({'attributes':['id'],'raw':!![]})[_0xe3b5('0x2e')](function(_0x3dd916){var _0x1d3d96=_[_0xe3b5('0x68')](_0x3dd916,'id');_0x45712e(_0x1d3d96);});})[_0xe3b5('0x5a')](function(_0x55bba6){_0x57b542(_0x55bba6);});});} \ No newline at end of file +var _0xb12e=['register','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','whatsappqueue','user','some','model','toLowerCase','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','startCase','User','union','ids','includes','queue','replace','Queue','push','all','flatten','findOne','map','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x23f683,_0x205963){var _0x127653=function(_0x359f56){while(--_0x359f56){_0x23f683['push'](_0x23f683['shift']());}};_0x127653(++_0x205963);}(_0xb12e,0x1c0));var _0xeb12=function(_0x58c649,_0x22d90e){_0x58c649=_0x58c649-0x0;var _0x1c80f2=_0xb12e[_0x58c649];return _0x1c80f2;};'use strict';var emlformat=require(_0xeb12('0x0'));var rimraf=require(_0xeb12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb12('0x2'));var rp=require('request-promise');var moment=require(_0xeb12('0x3'));var BPromise=require(_0xeb12('0x4'));var Mustache=require(_0xeb12('0x5'));var util=require('util');var path=require(_0xeb12('0x6'));var sox=require('sox');var csv=require(_0xeb12('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeb12('0x8'));var _=require(_0xeb12('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeb12('0xa'));var deskjs=require(_0xeb12('0xb'));var toCsv=require('to-csv');var querystring=require(_0xeb12('0xc'));var Papa=require('papaparse');var Redis=require(_0xeb12('0xd'));var authService=require(_0xeb12('0xe'));var qs=require(_0xeb12('0xf'));var as=require(_0xeb12('0x10'));var hardwareService=require(_0xeb12('0x11'));var logger=require(_0xeb12('0x12'))(_0xeb12('0x13'));var utils=require(_0xeb12('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeb12('0x15'))['db'];config['redis']=_[_0xeb12('0x16')](config[_0xeb12('0x17')],{'host':_0xeb12('0x18'),'port':0x18eb});var socket=require(_0xeb12('0x19'))(new Redis(config[_0xeb12('0x17')]));require(_0xeb12('0x1a'))[_0xeb12('0x1b')](socket);function respondWithStatusCode(_0x510b74,_0x5cc9fa){_0x5cc9fa=_0x5cc9fa||0xcc;return function(_0xc512b6){if(_0xc512b6){return _0x510b74['sendStatus'](_0x5cc9fa);}return _0x510b74['status'](_0x5cc9fa)[_0xeb12('0x1c')]();};}function respondWithResult(_0x272526,_0x18d812){_0x18d812=_0x18d812||0xc8;return function(_0x2afb63){if(_0x2afb63){return _0x272526['status'](_0x18d812)[_0xeb12('0x1d')](_0x2afb63);}};}function respondWithFilteredResult(_0x3e231e,_0x5799c8){return function(_0x17d4de){if(_0x17d4de){var _0x33abed=typeof _0x5799c8[_0xeb12('0x1e')]===_0xeb12('0x1f')&&typeof _0x5799c8[_0xeb12('0x20')]===_0xeb12('0x1f');var _0x5bfcc3=_0x17d4de[_0xeb12('0x21')];var _0x5dfb1c=_0x33abed?0x0:_0x5799c8[_0xeb12('0x1e')];var _0x594c1b=_0x33abed?_0x17d4de['count']:_0x5799c8[_0xeb12('0x1e')]+_0x5799c8[_0xeb12('0x20')];var _0x2cf0de;if(_0x594c1b>=_0x5bfcc3){_0x594c1b=_0x5bfcc3;_0x2cf0de=0xc8;}else{_0x2cf0de=0xce;}_0x3e231e['status'](_0x2cf0de);return _0x3e231e[_0xeb12('0x22')](_0xeb12('0x23'),_0x5dfb1c+'-'+_0x594c1b+'/'+_0x5bfcc3)[_0xeb12('0x1d')](_0x17d4de);}return null;};}function patchUpdates(_0x36ec9c){return function(_0x2df6e6){try{jsonpatch[_0xeb12('0x24')](_0x2df6e6,_0x36ec9c,!![]);}catch(_0x3b2e4d){return BPromise[_0xeb12('0x25')](_0x3b2e4d);}return _0x2df6e6[_0xeb12('0x26')]();};}function saveUpdates(_0x3d0fc0,_0x598d1a){return function(_0x4203fe){if(_0x4203fe){return _0x4203fe[_0xeb12('0x27')](_0x3d0fc0)[_0xeb12('0x28')](function(_0x2a78b3){return _0x2a78b3;});}return null;};}function removeEntity(_0xfcbecf,_0x599d38){return function(_0x18f95c){if(_0x18f95c){return _0x18f95c[_0xeb12('0x29')]()[_0xeb12('0x28')](function(){_0xfcbecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a25fb,_0x5b4491){return function(_0x4c05d9){if(!_0x4c05d9){_0x3a25fb[_0xeb12('0x2a')](0x194);}return _0x4c05d9;};}function handleError(_0x5e212f,_0xa04b63){_0xa04b63=_0xa04b63||0x1f4;return function(_0x219df7){logger[_0xeb12('0x2b')](_0x219df7[_0xeb12('0x2c')]);if(_0x219df7[_0xeb12('0x2d')]){delete _0x219df7[_0xeb12('0x2d')];}_0x5e212f['status'](_0xa04b63)['send'](_0x219df7);};}exports[_0xeb12('0x2e')]=function(_0x234aa6,_0x31ad20,_0x186090){if(!_0x234aa6['body'][_0xeb12('0x2f')](_0xeb12('0x30'))&&!_0x234aa6[_0xeb12('0x31')][_0xeb12('0x2f')](_0xeb12('0x32'))){throw new db[(_0xeb12('0x33'))][(_0xeb12('0x34'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x234aa6['body'][_0xeb12('0x2f')](_0xeb12('0x32'))&&!_0x234aa6['body'][_0xeb12('0x2f')]('view')){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x234aa6[_0xeb12('0x31')][_0xeb12('0x2f')]('recipients')){throw new db['Sequelize'][(_0xeb12('0x34'))](_0xeb12('0x35'));}else{try{var _0x1c16da=JSON[_0xeb12('0x36')](_0x234aa6[_0xeb12('0x31')][_0xeb12('0x37')]);}catch(_0x3dea1d){logger[_0xeb12('0x2b')](_0x3dea1d);throw new db[(_0xeb12('0x33'))][(_0xeb12('0x34'))](_0xeb12('0x38'));}var _0x4d86c4=['chatqueue','faxqueue',_0xeb12('0x39'),_0xeb12('0x3a'),_0xeb12('0x3b'),'voicequeue',_0xeb12('0x3c'),'team',_0xeb12('0x3d')];if(_[_0xeb12('0x3e')](_0x1c16da,function(_0x49e6bc){return!_['includes'](_0x4d86c4,_0x49e6bc[_0xeb12('0x3f')][_0xeb12('0x40')]());})){throw new db[(_0xeb12('0x33'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x2344fa={};_0x2344fa['senderName']=_0x234aa6['body'][_0xeb12('0x2f')]('senderName')?_0x234aa6[_0xeb12('0x31')]['senderName']:_0x234aa6[_0xeb12('0x3d')]['fullname'];_0x2344fa[_0xeb12('0x41')]=_['isEmpty'](_0x234aa6['body'][_0xeb12('0x41')])?null:_0x234aa6[_0xeb12('0x31')][_0xeb12('0x41')];_0x2344fa['beep']=_0x234aa6[_0xeb12('0x31')][_0xeb12('0x42')]||![];_0x2344fa[_0xeb12('0x43')]=_0x234aa6['user']['id'];return getContent(_0x234aa6['body'])[_0xeb12('0x28')](function(_0x14697d){_0x2344fa[_0xeb12('0x31')]=_0x14697d;return getRecipients(_0x1c16da);})[_0xeb12('0x28')](function(_0x4deefe){_0x2344fa[_0xeb12('0x44')]=_[_0xeb12('0x45')](_0x4deefe)['join'](',');return db[_0xeb12('0x46')][_0xeb12('0x47')](function(_0x350373){return db[_0xeb12('0x48')][_0xeb12('0x49')](_0x2344fa,{'raw':!![],'transaction':_0x350373})['then'](function(_0x22dfd1){var _0x3c927d={'sender':_0x2344fa['senderName'],'description':_0x2344fa[_0xeb12('0x41')],'content':_0x2344fa[_0xeb12('0x31')],'beep':_0x2344fa[_0xeb12('0x42')]};_0x4deefe[_0xeb12('0x4a')](function(_0x104879){_0x3c927d[_0xeb12('0x4b')]=_0x104879;socket['emit'](_0xeb12('0x4c'),_0x3c927d);});return _0x22dfd1;});});})['then'](respondWithResult(_0x31ad20,0xc9))[_0xeb12('0x4d')](handleError(_0x31ad20,null));};function getContent(_0x363283){return new BPromise(function(_0x41356a,_0x46d3b8){if(_0x363283[_0xeb12('0x30')]){_0x41356a(_0x363283[_0xeb12('0x30')]);return;}return db['Template']['findOne']({'attributes':['html'],'where':{'id':_0x363283[_0xeb12('0x32')]},'raw':!![]})['then'](function(_0x33e42d){if(!_0x33e42d)throw new db[(_0xeb12('0x33'))][(_0xeb12('0x34'))](_0xeb12('0x4e'));var _0x3841d0=Mustache[_0xeb12('0x4f')](_0x33e42d[_0xeb12('0x50')],_0x363283[_0xeb12('0x51')]);_0x41356a(_0x3841d0);})[_0xeb12('0x4d')](function(_0x4d6814){_0x46d3b8(_0x4d6814);});});}function getRecipients(_0x191e19){return new BPromise(function(_0xa16e36,_0x42ee9f){var _0x3a8c63=[];var _0x3427d7=[];_0x191e19['forEach'](function(_0x4ba9d5){var _0x3ce81c=_[_0xeb12('0x52')](_0x4ba9d5[_0xeb12('0x3f')][_0xeb12('0x40')]());if(_0x3ce81c===_0xeb12('0x53')){_0x3a8c63=_[_0xeb12('0x54')](_0x3a8c63,_0x4ba9d5[_0xeb12('0x55')]);}else{if(_[_0xeb12('0x56')](_0x3ce81c,_0xeb12('0x57')))_0x3ce81c=_0x3ce81c[_0xeb12('0x58')](_0xeb12('0x57'),_0xeb12('0x59'));_0x4ba9d5['ids'][_0xeb12('0x4a')](function(_0x1b47d1){_0x3427d7[_0xeb12('0x5a')](getAgents(_0x3ce81c,_0x1b47d1));});}});return BPromise[_0xeb12('0x5b')](_0x3427d7)[_0xeb12('0x28')](function(_0xd96fcb){_0x3a8c63=_[_0xeb12('0x54')](_0x3a8c63,_[_0xeb12('0x5c')](_0xd96fcb));_0xa16e36(_0x3a8c63);})[_0xeb12('0x4d')](function(_0x22efff){_0x42ee9f(_0x22efff);});});}function getAgents(_0x2599b5,_0x4b9ae5){return new BPromise(function(_0x552c72,_0x16f519){return db[_0x2599b5][_0xeb12('0x5d')]({'where':{'id':_0x4b9ae5}})[_0xeb12('0x28')](function(_0x1f16db){return _0x1f16db['getAgents']({'attributes':['id'],'raw':!![]})[_0xeb12('0x28')](function(_0x4d85ef){var _0x9e98c1=_[_0xeb12('0x5e')](_0x4d85ef,'id');_0x552c72(_0x9e98c1);});})[_0xeb12('0x4d')](function(_0x3bfac3){_0x16f519(_0x3bfac3);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 0e456e7..0e7e69a 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 _0xfad5=['exports','events','../../mysqldb','save','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfad5,0x128));var _0x5fad=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0xfad5[_0x1ac120];return _0x19b703;};'use strict';var EventEmitter=require(_0x5fad('0x0'));var UserNotification=require(_0x5fad('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5fad('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3bfdc6){return function(_0x4fa4c8,_0x3be327,_0x43365f){UserNotificationEvents['emit'](_0x3bfdc6+':'+_0x4fa4c8['id'],_0x4fa4c8);UserNotificationEvents['emit'](_0x3bfdc6,_0x4fa4c8);_0x43365f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x5fad('0x3')](e,emitEvent(event));}}module[_0x5fad('0x4')]=UserNotificationEvents; \ No newline at end of file +var _0x8714=['update','remove','emit','hasOwnProperty','hook','events','setMaxListeners','save'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x8714,0xb5));var _0x4871=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x8714[_0x3ff085];return _0x2b68c3;};'use strict';var EventEmitter=require(_0x4871('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4871('0x1')](0x0);var events={'afterCreate':_0x4871('0x2'),'afterUpdate':_0x4871('0x3'),'afterDestroy':_0x4871('0x4')};function emitEvent(_0x21df71){return function(_0x565155,_0x2e5167,_0x1da6b6){UserNotificationEvents[_0x4871('0x5')](_0x21df71+':'+_0x565155['id'],_0x565155);UserNotificationEvents[_0x4871('0x5')](_0x21df71,_0x565155);_0x1da6b6(null);};}for(var e in events){if(events[_0x4871('0x6')](e)){var event=events[e];UserNotification[_0x4871('0x7')](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 011aa17..23d9316 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 _0x54a1=['request-promise','path','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2496da,_0x3fe1fc){var _0x4caae0=function(_0x378012){while(--_0x378012){_0x2496da['push'](_0x2496da['shift']());}};_0x4caae0(++_0x3fe1fc);}(_0x54a1,0x1ba));var _0x154a=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x54a1[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x154a('0x0'));var util=require(_0x154a('0x1'));var logger=require(_0x154a('0x2'))(_0x154a('0x3'));var moment=require(_0x154a('0x4'));var BPromise=require(_0x154a('0x5'));var rp=require(_0x154a('0x6'));var fs=require('fs');var path=require(_0x154a('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x154a('0x8'));module[_0x154a('0x9')]=function(_0x2b8843,_0x277b09){return _0x2b8843[_0x154a('0xa')]('UserNotification',attributes,{'tableName':_0x154a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x154a('0xc'),'collate':_0x154a('0xd')});}; \ No newline at end of file +var _0x8af4=['moment','bluebird','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','lodash','util','../../config/logger','api'];(function(_0x4702ee,_0xaf6a45){var _0x62ca7d=function(_0x5b3af7){while(--_0x5b3af7){_0x4702ee['push'](_0x4702ee['shift']());}};_0x62ca7d(++_0xaf6a45);}(_0x8af4,0x88));var _0x48af=function(_0x4314c9,_0x1a6d36){_0x4314c9=_0x4314c9-0x0;var _0x1f8798=_0x8af4[_0x4314c9];return _0x1f8798;};'use strict';var _=require(_0x48af('0x0'));var util=require(_0x48af('0x1'));var logger=require(_0x48af('0x2'))(_0x48af('0x3'));var moment=require(_0x48af('0x4'));var BPromise=require(_0x48af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48af('0x6'));var rimraf=require(_0x48af('0x7'));var config=require(_0x48af('0x8'));var attributes=require(_0x48af('0x9'));module[_0x48af('0xa')]=function(_0x4f0027,_0x1879fe){return _0x4f0027[_0x48af('0xb')](_0x48af('0xc'),attributes,{'tableName':_0x48af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 8e7afb7..9db0028 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 _0xe192=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1fd9e7,_0x24cdbe){var _0x1781f2=function(_0x2bd0a3){while(--_0x2bd0a3){_0x1fd9e7['push'](_0x1fd9e7['shift']());}};_0x1781f2(++_0x24cdbe);}(_0xe192,0x149));var _0x2e19=function(_0x42076e,_0x10969a){_0x42076e=_0x42076e-0x0;var _0x3a7971=_0xe192[_0x42076e];return _0x3a7971;};'use strict';var _=require('lodash');var util=require(_0x2e19('0x0'));var moment=require(_0x2e19('0x1'));var BPromise=require(_0x2e19('0x2'));var rs=require(_0x2e19('0x3'));var fs=require('fs');var Redis=require(_0x2e19('0x4'));var db=require(_0x2e19('0x5'))['db'];var utils=require(_0x2e19('0x6'));var logger=require(_0x2e19('0x7'))('rpc');var config=require(_0x2e19('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2e19('0x9')]=_[_0x2e19('0xa')](config[_0x2e19('0x9')],{'host':_0x2e19('0xb'),'port':0x18eb});var socket=require(_0x2e19('0xc'))(new Redis(config[_0x2e19('0x9')]));require(_0x2e19('0xd'))['register'](socket);function respondWithRpcPromise(_0x324e94,_0x239361,_0x61dadc){return new BPromise(function(_0x3ee754,_0x5613c6){return client['request'](_0x324e94,_0x61dadc)[_0x2e19('0xe')](function(_0x333dce){logger[_0x2e19('0xf')](_0x2e19('0x10'),_0x239361,_0x2e19('0x11'));logger[_0x2e19('0x12')](_0x2e19('0x13'),_0x239361,_0x2e19('0x11'),JSON[_0x2e19('0x14')](_0x333dce));if(_0x333dce[_0x2e19('0x15')]){if(_0x333dce[_0x2e19('0x15')]['code']===0x1f4){logger[_0x2e19('0x15')](_0x2e19('0x10'),_0x239361,_0x333dce[_0x2e19('0x15')][_0x2e19('0x16')]);return _0x5613c6(_0x333dce['error'][_0x2e19('0x16')]);}logger[_0x2e19('0x15')](_0x2e19('0x10'),_0x239361,_0x333dce[_0x2e19('0x15')][_0x2e19('0x16')]);return _0x3ee754(_0x333dce[_0x2e19('0x15')][_0x2e19('0x16')]);}else{logger[_0x2e19('0xf')]('UserNotification,\x20%s,\x20%s',_0x239361,_0x2e19('0x11'));_0x3ee754(_0x333dce[_0x2e19('0x17')]['message']);}})[_0x2e19('0x18')](function(_0x2bec9d){logger[_0x2e19('0x15')](_0x2e19('0x10'),_0x239361,_0x2bec9d);_0x5613c6(_0x2bec9d);});});} \ No newline at end of file +var _0xed7d=['UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info'];(function(_0xd10d51,_0x37eb56){var _0x5e7b61=function(_0x296125){while(--_0x296125){_0xd10d51['push'](_0xd10d51['shift']());}};_0x5e7b61(++_0x37eb56);}(_0xed7d,0x67));var _0xded7=function(_0x159c2f,_0xd39d20){_0x159c2f=_0x159c2f-0x0;var _0x591f68=_0xed7d[_0x159c2f];return _0x591f68;};'use strict';var _=require(_0xded7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xded7('0x1'));var rs=require(_0xded7('0x2'));var fs=require('fs');var Redis=require(_0xded7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xded7('0x4'));var logger=require(_0xded7('0x5'))(_0xded7('0x6'));var config=require(_0xded7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xded7('0x8')]({'port':0x232a});config[_0xded7('0x9')]=_[_0xded7('0xa')](config[_0xded7('0x9')],{'host':_0xded7('0xb'),'port':0x18eb});var socket=require(_0xded7('0xc'))(new Redis(config['redis']));require(_0xded7('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f6e30,_0x2d644f,_0x1ccc62){return new BPromise(function(_0x4a9cab,_0x58213e){return client[_0xded7('0xe')](_0x2f6e30,_0x1ccc62)[_0xded7('0xf')](function(_0x350d1f){logger[_0xded7('0x10')](_0xded7('0x11'),_0x2d644f,_0xded7('0x12'));logger[_0xded7('0x13')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x2d644f,_0xded7('0x12'),JSON[_0xded7('0x14')](_0x350d1f));if(_0x350d1f['error']){if(_0x350d1f[_0xded7('0x15')]['code']===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x2d644f,_0x350d1f['error'][_0xded7('0x16')]);return _0x58213e(_0x350d1f['error']['message']);}logger['error'](_0xded7('0x11'),_0x2d644f,_0x350d1f[_0xded7('0x15')][_0xded7('0x16')]);return _0x4a9cab(_0x350d1f[_0xded7('0x15')][_0xded7('0x16')]);}else{logger[_0xded7('0x10')](_0xded7('0x11'),_0x2d644f,_0xded7('0x12'));_0x4a9cab(_0x350d1f[_0xded7('0x17')]['message']);}})['catch'](function(_0x3651ee){logger['error'](_0xded7('0x11'),_0x2d644f,_0x3651ee);_0x58213e(_0x3651ee);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index abaf2ae..3b19a35 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 _0xa4ea=['./userNotification.events','remove','update','emit','removeListener','register','length'];(function(_0x26a8c6,_0x438d3f){var _0x375fe1=function(_0x504d15){while(--_0x504d15){_0x26a8c6['push'](_0x26a8c6['shift']());}};_0x375fe1(++_0x438d3f);}(_0xa4ea,0xcb));var _0xaa4e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa4ea[_0x31e29a];return _0x32d892;};'use strict';var UserNotificationEvents=require(_0xaa4e('0x0'));var events=['save',_0xaa4e('0x1'),_0xaa4e('0x2')];function createListener(_0x375e73,_0x3db100){return function(_0x53cdd3){_0x3db100[_0xaa4e('0x3')](_0x375e73,_0x53cdd3);};}function removeListener(_0x58f11d,_0x30c50d){return function(){UserNotificationEvents[_0xaa4e('0x4')](_0x58f11d,_0x30c50d);};}exports[_0xaa4e('0x5')]=function(_0x4e86a1){for(var _0x48ac80=0x0,_0x2aec75=events[_0xaa4e('0x6')];_0x48ac80<_0x2aec75;_0x48ac80++){var _0x2995c1=events[_0x48ac80];var _0x23f1e7=createListener('userNotification:'+_0x2995c1,_0x4e86a1);UserNotificationEvents['on'](_0x2995c1,_0x23f1e7);}}; \ No newline at end of file +var _0xed56=['./userNotification.events','update','emit','removeListener','length'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xed56,0x16d));var _0x6ed5=function(_0x33825f,_0x4eb960){_0x33825f=_0x33825f-0x0;var _0x143b64=_0xed56[_0x33825f];return _0x143b64;};'use strict';var UserNotificationEvents=require(_0x6ed5('0x0'));var events=['save','remove',_0x6ed5('0x1')];function createListener(_0x3b1b96,_0x5f4a2c){return function(_0x36f07f){_0x5f4a2c[_0x6ed5('0x2')](_0x3b1b96,_0x36f07f);};}function removeListener(_0x379c5e,_0x464eb5){return function(){UserNotificationEvents[_0x6ed5('0x3')](_0x379c5e,_0x464eb5);};}exports['register']=function(_0x188ef3){for(var _0x662785=0x0,_0x339ff7=events[_0x6ed5('0x4')];_0x662785<_0x339ff7;_0x662785++){var _0x540a19=events[_0x662785];var _0x19d5f0=createListener('userNotification:'+_0x540a19,_0x188ef3);UserNotificationEvents['on'](_0x540a19,_0x19d5f0);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index d8fa72d..5ee63fc 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5c59a8,_0x502926){var _0x79069d=function(_0x5e8329){while(--_0x5e8329){_0x5c59a8['push'](_0x5c59a8['shift']());}};_0x79069d(++_0x502926);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x134bc5,_0x380db2){var _0x16bce2=function(_0x5db76d){while(--_0x5db76d){_0x134bc5['push'](_0x134bc5['shift']());}};_0x16bce2(++_0x380db2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 7e0a464..6c870b5 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 _0x50d6=['INTEGER','sequelize'];(function(_0x2b8427,_0x1e883d){var _0x2f7ed0=function(_0xe38861){while(--_0xe38861){_0x2b8427['push'](_0x2b8427['shift']());}};_0x2f7ed0(++_0x1e883d);}(_0x50d6,0xc5));var _0x650d=function(_0x394739,_0x19ce1e){_0x394739=_0x394739-0x0;var _0x48d11e=_0x50d6[_0x394739];return _0x48d11e;};'use strict';var Sequelize=require(_0x650d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x650d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9567=['INTEGER','exports'];(function(_0x4e1cc3,_0xad530b){var _0x2f1fe4=function(_0x61b216){while(--_0x61b216){_0x4e1cc3['push'](_0x4e1cc3['shift']());}};_0x2f1fe4(++_0xad530b);}(_0x9567,0x67));var _0x7956=function(_0x2d7ba8,_0x29837d){_0x2d7ba8=_0x2d7ba8-0x0;var _0x8bafbb=_0x9567[_0x2d7ba8];return _0x8bafbb;};'use strict';var Sequelize=require('sequelize');module[_0x7956('0x0')]={'penalty':{'type':Sequelize[_0x7956('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 6abef0b..a345789 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 _0xaa29=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5a8709,_0x4ef872){var _0x24c807=function(_0x5dc0a7){while(--_0x5dc0a7){_0x5a8709['push'](_0x5a8709['shift']());}};_0x24c807(++_0x4ef872);}(_0xaa29,0xd1));var _0x9aa2=function(_0x32302e,_0x44914c){_0x32302e=_0x32302e-0x0;var _0x4841e4=_0xaa29[_0x32302e];return _0x4841e4;};'use strict';var _=require(_0x9aa2('0x0'));var util=require(_0x9aa2('0x1'));var logger=require(_0x9aa2('0x2'))('api');var moment=require(_0x9aa2('0x3'));var BPromise=require('bluebird');var rp=require(_0x9aa2('0x4'));var fs=require('fs');var path=require(_0x9aa2('0x5'));var rimraf=require(_0x9aa2('0x6'));var config=require(_0x9aa2('0x7'));var attributes=require(_0x9aa2('0x8'));module[_0x9aa2('0x9')]=function(_0x2ac7ea,_0x268c23){return _0x2ac7ea[_0x9aa2('0xa')](_0x9aa2('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x914c=['./userOpenchannelQueue.attributes','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4b09f8,_0x4971ea){var _0x17a334=function(_0x4ecc61){while(--_0x4ecc61){_0x4b09f8['push'](_0x4b09f8['shift']());}};_0x17a334(++_0x4971ea);}(_0x914c,0x122));var _0xc914=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x914c[_0x29ae80];return _0x5d6d71;};'use strict';var _=require(_0xc914('0x0'));var util=require(_0xc914('0x1'));var logger=require(_0xc914('0x2'))(_0xc914('0x3'));var moment=require(_0xc914('0x4'));var BPromise=require(_0xc914('0x5'));var rp=require(_0xc914('0x6'));var fs=require('fs');var path=require(_0xc914('0x7'));var rimraf=require(_0xc914('0x8'));var config=require(_0xc914('0x9'));var attributes=require(_0xc914('0xa'));module['exports']=function(_0x21b3f3,_0x222006){return _0x21b3f3['define'](_0xc914('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index b5c63ec..ae7501d 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 _0x5ff3=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3e778e,_0x4a8ccf){var _0x333b98=function(_0x109c33){while(--_0x109c33){_0x3e778e['push'](_0x3e778e['shift']());}};_0x333b98(++_0x4a8ccf);}(_0x5ff3,0x1a2));var _0x35ff=function(_0x3e423f,_0x4b5c87){_0x3e423f=_0x3e423f-0x0;var _0x346291=_0x5ff3[_0x3e423f];return _0x346291;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require(_0x35ff('0x1'));var BPromise=require(_0x35ff('0x2'));var rs=require(_0x35ff('0x3'));var fs=require('fs');var Redis=require(_0x35ff('0x4'));var db=require(_0x35ff('0x5'))['db'];var utils=require(_0x35ff('0x6'));var logger=require(_0x35ff('0x7'))('rpc');var config=require(_0x35ff('0x8'));var jayson=require(_0x35ff('0x9'));var client=jayson[_0x35ff('0xa')][_0x35ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27ac29,_0x59a264,_0x5448ca){return new BPromise(function(_0x349f18,_0x235bfd){return client[_0x35ff('0xc')](_0x27ac29,_0x5448ca)[_0x35ff('0xd')](function(_0x4a442b){logger['info'](_0x35ff('0xe'),_0x59a264,_0x35ff('0xf'));logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x59a264,_0x35ff('0xf'),JSON[_0x35ff('0x12')](_0x4a442b));if(_0x4a442b[_0x35ff('0x13')]){if(_0x4a442b['error'][_0x35ff('0x14')]===0x1f4){logger['error'](_0x35ff('0xe'),_0x59a264,_0x4a442b[_0x35ff('0x13')][_0x35ff('0x15')]);return _0x235bfd(_0x4a442b[_0x35ff('0x13')][_0x35ff('0x15')]);}logger[_0x35ff('0x13')](_0x35ff('0xe'),_0x59a264,_0x4a442b[_0x35ff('0x13')][_0x35ff('0x15')]);return _0x349f18(_0x4a442b['error'][_0x35ff('0x15')]);}else{logger[_0x35ff('0x16')](_0x35ff('0xe'),_0x59a264,'request\x20sent');_0x349f18(_0x4a442b[_0x35ff('0x17')]['message']);}})[_0x35ff('0x18')](function(_0x43b102){logger[_0x35ff('0x13')](_0x35ff('0xe'),_0x59a264,_0x43b102);_0x235bfd(_0x43b102);});});} \ No newline at end of file +var _0xdd9a=['jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2f35ce,_0x56dd4a){var _0x11bd3e=function(_0x5b4d5a){while(--_0x5b4d5a){_0x2f35ce['push'](_0x2f35ce['shift']());}};_0x11bd3e(++_0x56dd4a);}(_0xdd9a,0x1d5));var _0xadd9=function(_0x11894a,_0x14e583){_0x11894a=_0x11894a-0x0;var _0x33bb55=_0xdd9a[_0x11894a];return _0x33bb55;};'use strict';var _=require('lodash');var util=require(_0xadd9('0x0'));var moment=require('moment');var BPromise=require(_0xadd9('0x1'));var rs=require(_0xadd9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xadd9('0x3'));var logger=require(_0xadd9('0x4'))('rpc');var config=require(_0xadd9('0x5'));var jayson=require(_0xadd9('0x6'));var client=jayson[_0xadd9('0x7')][_0xadd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1997bc,_0x5424dd,_0x47d84b){return new BPromise(function(_0x3a1c39,_0x993e80){return client[_0xadd9('0x9')](_0x1997bc,_0x47d84b)['then'](function(_0x663323){logger[_0xadd9('0xa')](_0xadd9('0xb'),_0x5424dd,_0xadd9('0xc'));logger[_0xadd9('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5424dd,_0xadd9('0xc'),JSON[_0xadd9('0xe')](_0x663323));if(_0x663323[_0xadd9('0xf')]){if(_0x663323['error'][_0xadd9('0x10')]===0x1f4){logger[_0xadd9('0xf')](_0xadd9('0xb'),_0x5424dd,_0x663323['error']['message']);return _0x993e80(_0x663323[_0xadd9('0xf')][_0xadd9('0x11')]);}logger[_0xadd9('0xf')](_0xadd9('0xb'),_0x5424dd,_0x663323[_0xadd9('0xf')]['message']);return _0x3a1c39(_0x663323[_0xadd9('0xf')]['message']);}else{logger['info'](_0xadd9('0xb'),_0x5424dd,'request\x20sent');_0x3a1c39(_0x663323[_0xadd9('0x12')][_0xadd9('0x11')]);}})['catch'](function(_0x3c4e32){logger[_0xadd9('0xf')](_0xadd9('0xb'),_0x5424dd,_0x3c4e32);_0x993e80(_0x3c4e32);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index a03fe90..ad99a65 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 _0x316b=['../../components/interaction/service','./userProfile.controller','get','index','/describe','describe','isAuthenticated','show','/:id/sections','getSections','getResources','create','post','/:id/resources','addResources','put','/:id','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x399deb,_0x3a8918){var _0x55f404=function(_0x1e9443){while(--_0x1e9443){_0x399deb['push'](_0x399deb['shift']());}};_0x55f404(++_0x3a8918);}(_0x316b,0x1bd));var _0xb316=function(_0x24f870,_0x2c8a88){_0x24f870=_0x24f870-0x0;var _0x5d065b=_0x316b[_0x24f870];return _0x5d065b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb316('0x0'));var express=require(_0xb316('0x1'));var router=express[_0xb316('0x2')]();var fs_extra=require(_0xb316('0x3'));var auth=require(_0xb316('0x4'));var interaction=require(_0xb316('0x5'));var config=require('../../config/environment');var controller=require(_0xb316('0x6'));router[_0xb316('0x7')]('/',auth['isAuthenticated'](),controller[_0xb316('0x8')]);router[_0xb316('0x7')](_0xb316('0x9'),auth['isAuthenticated'](),controller[_0xb316('0xa')]);router[_0xb316('0x7')]('/:id',auth[_0xb316('0xb')](),controller[_0xb316('0xc')]);router[_0xb316('0x7')](_0xb316('0xd'),auth[_0xb316('0xb')](),controller[_0xb316('0xe')]);router[_0xb316('0x7')]('/:id/resources',auth[_0xb316('0xb')](),controller[_0xb316('0xf')]);router['post']('/',auth[_0xb316('0xb')](),controller[_0xb316('0x10')]);router[_0xb316('0x11')]('/:id/clone',auth[_0xb316('0xb')](),controller['clone']);router['post']('/:id/sections',auth[_0xb316('0xb')](),controller['addSections']);router[_0xb316('0x11')](_0xb316('0x12'),auth[_0xb316('0xb')](),controller[_0xb316('0x13')]);router[_0xb316('0x14')](_0xb316('0x15'),auth[_0xb316('0xb')](),controller[_0xb316('0x16')]);router[_0xb316('0x17')](_0xb316('0x15'),auth[_0xb316('0xb')](),controller[_0xb316('0x18')]);router[_0xb316('0x17')]('/:id/sections',auth[_0xb316('0xb')](),controller['removeSections']);router[_0xb316('0x17')](_0xb316('0x12'),auth[_0xb316('0xb')](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0xbb57=['../../components/interaction/service','isAuthenticated','get','describe','/:id','show','getSections','getResources','post','/:id/clone','clone','/:id/sections','addSections','/:id/resources','put','update','destroy','removeSections','removeResources','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x8f75c4,_0x5dac6f){var _0x37c2d4=function(_0x3cdb8f){while(--_0x3cdb8f){_0x8f75c4['push'](_0x8f75c4['shift']());}};_0x37c2d4(++_0x5dac6f);}(_0xbb57,0xc3));var _0x7bb5=function(_0x51d136,_0x2201f4){_0x51d136=_0x51d136-0x0;var _0xb6904d=_0xbb57[_0x51d136];return _0xb6904d;};'use strict';var multer=require('multer');var util=require(_0x7bb5('0x0'));var path=require(_0x7bb5('0x1'));var timeout=require(_0x7bb5('0x2'));var express=require(_0x7bb5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7bb5('0x4'));var interaction=require(_0x7bb5('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0x7bb5('0x6')](),controller['index']);router[_0x7bb5('0x7')]('/describe',auth[_0x7bb5('0x6')](),controller[_0x7bb5('0x8')]);router[_0x7bb5('0x7')](_0x7bb5('0x9'),auth[_0x7bb5('0x6')](),controller[_0x7bb5('0xa')]);router[_0x7bb5('0x7')]('/:id/sections',auth[_0x7bb5('0x6')](),controller[_0x7bb5('0xb')]);router['get']('/:id/resources',auth[_0x7bb5('0x6')](),controller[_0x7bb5('0xc')]);router[_0x7bb5('0xd')]('/',auth[_0x7bb5('0x6')](),controller['create']);router[_0x7bb5('0xd')](_0x7bb5('0xe'),auth[_0x7bb5('0x6')](),controller[_0x7bb5('0xf')]);router[_0x7bb5('0xd')](_0x7bb5('0x10'),auth[_0x7bb5('0x6')](),controller[_0x7bb5('0x11')]);router[_0x7bb5('0xd')](_0x7bb5('0x12'),auth['isAuthenticated'](),controller['addResources']);router[_0x7bb5('0x13')]('/:id',auth[_0x7bb5('0x6')](),controller[_0x7bb5('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7bb5('0x15')]);router['delete'](_0x7bb5('0x10'),auth[_0x7bb5('0x6')](),controller[_0x7bb5('0x16')]);router['delete'](_0x7bb5('0x12'),auth[_0x7bb5('0x6')](),controller[_0x7bb5('0x17')]);module[_0x7bb5('0x18')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 738cd64..1a163d7 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 _0x0f56=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x3ff204,_0xed3d62){var _0x5b1456=function(_0x31e4fd){while(--_0x31e4fd){_0x3ff204['push'](_0x3ff204['shift']());}};_0x5b1456(++_0xed3d62);}(_0x0f56,0x8e));var _0x60f5=function(_0x14cf78,_0x35d736){_0x14cf78=_0x14cf78-0x0;var _0x36dc10=_0x0f56[_0x14cf78];return _0x36dc10;};'use strict';var Sequelize=require('sequelize');module[_0x60f5('0x0')]={'name':{'type':Sequelize[_0x60f5('0x1')],'allowNull':![],'unique':_0x60f5('0x2')},'crudPermissions':{'type':Sequelize[_0x60f5('0x1')],'set':function(_0x261d14){this[_0x60f5('0x3')](_0x60f5('0x4'),_0x261d14?_0x261d14['join'](''):[]);},'get':function(){return this['getDataValue'](_0x60f5('0x4'))?this[_0x60f5('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x60f5('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x60f5('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x60f5('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x60f5('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x60f5('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x60f5('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x60f5('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9b69=['join','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x5ac7d7,_0x109040){var _0x23955f=function(_0x52a2ac){while(--_0x52a2ac){_0x5ac7d7['push'](_0x5ac7d7['shift']());}};_0x23955f(++_0x109040);}(_0x9b69,0x17e));var _0x99b6=function(_0x5240ff,_0x581998){_0x5240ff=_0x5240ff-0x0;var _0x3dd81e=_0x9b69[_0x5240ff];return _0x3dd81e;};'use strict';var Sequelize=require('sequelize');module[_0x99b6('0x0')]={'name':{'type':Sequelize[_0x99b6('0x1')],'allowNull':![],'unique':_0x99b6('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x50239b){this[_0x99b6('0x3')](_0x99b6('0x4'),_0x50239b?_0x50239b[_0x99b6('0x5')](''):[]);},'get':function(){return this[_0x99b6('0x6')](_0x99b6('0x4'))?this[_0x99b6('0x6')](_0x99b6('0x4'))[_0x99b6('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x99b6('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x99b6('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x99b6('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x99b6('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x99b6('0x8')],'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 c747df2..c0b5366 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 _0x186d=['getResources','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','show','include','find','catch','body','clone','params','get','omit','createdAt','updatedAt','sequelize','transaction','create','each','autoAssociation','userProfileId','Resources','UserProfileSection','describe','addSections','sectionId','UserProfileResource','push','removeSections','ids','getSections','isEmpty','includes','subsections','enabled','filter','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x186d,0x1ca));var _0xd186=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x186d[_0x3522c8];return _0x22f498;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd186('0x0'));var zipdir=require(_0xd186('0x1'));var jsonpatch=require(_0xd186('0x2'));var rp=require(_0xd186('0x3'));var moment=require(_0xd186('0x4'));var BPromise=require(_0xd186('0x5'));var Mustache=require('mustache');var util=require(_0xd186('0x6'));var path=require(_0xd186('0x7'));var sox=require(_0xd186('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd186('0x9'));var _=require(_0xd186('0xa'));var squel=require(_0xd186('0xb'));var crypto=require('crypto');var jsforce=require(_0xd186('0xc'));var deskjs=require(_0xd186('0xd'));var toCsv=require(_0xd186('0xe'));var querystring=require('querystring');var Papa=require(_0xd186('0xf'));var Redis=require(_0xd186('0x10'));var authService=require(_0xd186('0x11'));var qs=require(_0xd186('0x12'));var as=require(_0xd186('0x13'));var hardwareService=require(_0xd186('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd186('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd186('0x16'));var db=require(_0xd186('0x17'))['db'];config[_0xd186('0x18')]=_['defaults'](config[_0xd186('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd186('0x19'))(new Redis(config[_0xd186('0x18')]));require(_0xd186('0x1a'))[_0xd186('0x1b')](socket);function respondWithStatusCode(_0x32c917,_0x177f73){_0x177f73=_0x177f73||0xcc;return function(_0x3e0bda){if(_0x3e0bda){return _0x32c917[_0xd186('0x1c')](_0x177f73);}return _0x32c917[_0xd186('0x1d')](_0x177f73)[_0xd186('0x1e')]();};}function respondWithResult(_0x207d6a,_0x4ad92c){_0x4ad92c=_0x4ad92c||0xc8;return function(_0x3b4656){if(_0x3b4656){return _0x207d6a[_0xd186('0x1d')](_0x4ad92c)[_0xd186('0x1f')](_0x3b4656);}};}function respondWithFilteredResult(_0x1ff34e,_0x25e2e0){return function(_0x45fc9f){if(_0x45fc9f){var _0x23a1b0=typeof _0x25e2e0['offset']===_0xd186('0x20')&&typeof _0x25e2e0[_0xd186('0x21')]==='undefined';var _0xcded5d=_0x45fc9f[_0xd186('0x22')];var _0x4f6f63=_0x23a1b0?0x0:_0x25e2e0['offset'];var _0x4111a8=_0x23a1b0?_0x45fc9f[_0xd186('0x22')]:_0x25e2e0[_0xd186('0x23')]+_0x25e2e0[_0xd186('0x21')];var _0x363693;if(_0x4111a8>=_0xcded5d){_0x4111a8=_0xcded5d;_0x363693=0xc8;}else{_0x363693=0xce;}_0x1ff34e['status'](_0x363693);return _0x1ff34e[_0xd186('0x24')](_0xd186('0x25'),_0x4f6f63+'-'+_0x4111a8+'/'+_0xcded5d)[_0xd186('0x1f')](_0x45fc9f);}return null;};}function patchUpdates(_0x4a9db0){return function(_0x5551a2){try{jsonpatch[_0xd186('0x26')](_0x5551a2,_0x4a9db0,!![]);}catch(_0x1b5aae){return BPromise[_0xd186('0x27')](_0x1b5aae);}return _0x5551a2['save']();};}function saveUpdates(_0x5c4dc5,_0x2b117b){return function(_0x26e54e){if(_0x26e54e){return _0x26e54e['update'](_0x5c4dc5)['then'](function(_0x116618){return _0x116618;});}return null;};}function removeEntity(_0x379db6,_0x3c0a37){return function(_0x2bbf4e){if(_0x2bbf4e){return _0x2bbf4e[_0xd186('0x28')]()[_0xd186('0x29')](function(){_0x379db6[_0xd186('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a40b8,_0x110509){return function(_0x1e2cce){if(!_0x1e2cce){_0x5a40b8[_0xd186('0x1c')](0x194);}return _0x1e2cce;};}function handleError(_0x24cf30,_0x17cce9){_0x17cce9=_0x17cce9||0x1f4;return function(_0x5962c9){logger[_0xd186('0x2a')](_0x5962c9[_0xd186('0x2b')]);if(_0x5962c9[_0xd186('0x2c')]){delete _0x5962c9[_0xd186('0x2c')];}_0x24cf30[_0xd186('0x1d')](_0x17cce9)[_0xd186('0x2d')](_0x5962c9);};}exports[_0xd186('0x2e')]=function(_0x1e9c47,_0x43be30){var _0x2dbedd={},_0x37c08f={},_0x3e6d60={'count':0x0,'rows':[]};var _0x4493b9=_[_0xd186('0x2f')](db[_0xd186('0x30')][_0xd186('0x31')],function(_0x303551){return{'name':_0x303551[_0xd186('0x32')],'type':_0x303551[_0xd186('0x33')][_0xd186('0x34')]};});_0x37c08f[_0xd186('0x35')]=_[_0xd186('0x2f')](_0x4493b9,_0xd186('0x2c'));_0x37c08f[_0xd186('0x36')]=_[_0xd186('0x37')](_0x1e9c47[_0xd186('0x36')]);_0x37c08f[_0xd186('0x38')]=_[_0xd186('0x39')](_0x37c08f[_0xd186('0x35')],_0x37c08f[_0xd186('0x36')]);_0x2dbedd[_0xd186('0x3a')]=_[_0xd186('0x39')](_0x37c08f['model'],qs[_0xd186('0x3b')](_0x1e9c47[_0xd186('0x36')][_0xd186('0x3b')]));_0x2dbedd[_0xd186('0x3a')]=_0x2dbedd[_0xd186('0x3a')][_0xd186('0x3c')]?_0x2dbedd[_0xd186('0x3a')]:_0x37c08f[_0xd186('0x35')];if(!_0x1e9c47['query'][_0xd186('0x3d')](_0xd186('0x3e'))){_0x2dbedd[_0xd186('0x21')]=qs[_0xd186('0x21')](_0x1e9c47[_0xd186('0x36')][_0xd186('0x21')]);_0x2dbedd[_0xd186('0x23')]=qs[_0xd186('0x23')](_0x1e9c47[_0xd186('0x36')][_0xd186('0x23')]);}_0x2dbedd[_0xd186('0x3f')]=qs[_0xd186('0x40')](_0x1e9c47['query'][_0xd186('0x40')]);_0x2dbedd[_0xd186('0x41')]=qs['filters'](_[_0xd186('0x42')](_0x1e9c47[_0xd186('0x36')],_0x37c08f[_0xd186('0x38')]),_0x4493b9);if(_0x1e9c47[_0xd186('0x36')]['filter']){_0x2dbedd[_0xd186('0x41')]=_['merge'](_0x2dbedd[_0xd186('0x41')],{'$or':_[_0xd186('0x2f')](_0x4493b9,function(_0x131792){if(_0x131792['type']!=='VIRTUAL'){var _0x38d001={};_0x38d001[_0x131792[_0xd186('0x2c')]]={'$like':'%'+_0x1e9c47['query']['filter']+'%'};return _0x38d001;}})});}_0x2dbedd=_[_0xd186('0x43')]({},_0x2dbedd,_0x1e9c47[_0xd186('0x44')]);var _0x549b18={'where':_0x2dbedd[_0xd186('0x41')]};return db[_0xd186('0x30')][_0xd186('0x22')](_0x549b18)[_0xd186('0x29')](function(_0x4a0be7){_0x3e6d60[_0xd186('0x22')]=_0x4a0be7;if(_0x1e9c47['query'][_0xd186('0x45')]){_0x2dbedd['include']=[{'all':!![]}];}return db[_0xd186('0x30')][_0xd186('0x46')](_0x2dbedd);})[_0xd186('0x29')](function(_0x536b05){_0x3e6d60[_0xd186('0x47')]=_0x536b05;return _0x3e6d60;})[_0xd186('0x29')](respondWithFilteredResult(_0x43be30,_0x2dbedd))['catch'](handleError(_0x43be30,null));};exports[_0xd186('0x48')]=function(_0x325992,_0x4d1fbe){var _0x55d2ef={'raw':![],'where':{'id':_0x325992['params']['id']}},_0x1c9cd5={};_0x1c9cd5[_0xd186('0x35')]=_['keys'](db['UserProfile'][_0xd186('0x31')]);_0x1c9cd5[_0xd186('0x36')]=_['keys'](_0x325992[_0xd186('0x36')]);_0x1c9cd5[_0xd186('0x38')]=_['intersection'](_0x1c9cd5['model'],_0x1c9cd5[_0xd186('0x36')]);_0x55d2ef[_0xd186('0x3a')]=_[_0xd186('0x39')](_0x1c9cd5[_0xd186('0x35')],qs[_0xd186('0x3b')](_0x325992[_0xd186('0x36')][_0xd186('0x3b')]));_0x55d2ef['attributes']=_0x55d2ef[_0xd186('0x3a')]['length']?_0x55d2ef[_0xd186('0x3a')]:_0x1c9cd5[_0xd186('0x35')];if(_0x325992[_0xd186('0x36')][_0xd186('0x45')]){_0x55d2ef[_0xd186('0x49')]=[{'all':!![]}];}_0x55d2ef=_[_0xd186('0x43')]({},_0x55d2ef,_0x325992['options']);return db[_0xd186('0x30')][_0xd186('0x4a')](_0x55d2ef)[_0xd186('0x29')](handleEntityNotFound(_0x4d1fbe,null))[_0xd186('0x29')](respondWithResult(_0x4d1fbe,null))[_0xd186('0x4b')](handleError(_0x4d1fbe,null));};exports['create']=function(_0x5414c8,_0x18a213){return db[_0xd186('0x30')]['create'](_0x5414c8[_0xd186('0x4c')],{})[_0xd186('0x29')](respondWithResult(_0x18a213,0xc9))['catch'](handleError(_0x18a213,null));};exports[_0xd186('0x4d')]=function(_0x4a39e4,_0x9bc3e0){var _0x5696e4={'where':{'id':_0x4a39e4[_0xd186('0x4e')]['id']}},_0x3c41e1={};_0x3c41e1[_0xd186('0x35')]=_[_0xd186('0x37')](db['UserProfile'][_0xd186('0x31')]);_0x5696e4[_0xd186('0x3a')]=_[_0xd186('0x39')](_0x3c41e1['model'],qs['fields'](_0x4a39e4[_0xd186('0x36')][_0xd186('0x3b')]));_0x5696e4[_0xd186('0x3a')]=_0x5696e4[_0xd186('0x3a')]['length']?_0x5696e4[_0xd186('0x3a')]:_0x3c41e1[_0xd186('0x35')];if(_0x4a39e4[_0xd186('0x36')][_0xd186('0x45')]){_0x5696e4['include']=[{'all':!![]}];}_0x5696e4=_[_0xd186('0x43')]({},_0x5696e4,_0x4a39e4[_0xd186('0x44')]);return db[_0xd186('0x30')][_0xd186('0x4a')](_0x5696e4)['then'](handleEntityNotFound(_0x9bc3e0,null))[_0xd186('0x29')](function(_0x20489c){if(_0x20489c){var _0x5a0113=_0x20489c[_0xd186('0x4f')]({'plain':!![]});_0x5a0113=qs[_0xd186('0x50')](_0x5a0113,['id',_0xd186('0x51'),_0xd186('0x52'),'crudPermissions']);_0x4a39e4[_0xd186('0x4c')]=_[_0xd186('0x50')](_0x4a39e4[_0xd186('0x4c')],['id',_0xd186('0x51'),'updatedAt']);return db[_0xd186('0x53')][_0xd186('0x54')](function(_0x5ee268){return db[_0xd186('0x30')][_0xd186('0x55')](_['merge'](_0x5a0113,_0x4a39e4[_0xd186('0x4c')]),{'include':_0x4a39e4[_0xd186('0x36')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5ee268})[_0xd186('0x29')](function(_0x1fa433){var _0x2bad68=_0x1fa433[_0xd186('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0xd186('0x46')]({'where':{'userProfileId':_0x4a39e4[_0xd186('0x4e')]['id']},'raw':!![]})[_0xd186('0x29')](function(_0x45053b){if(_0x45053b){return BPromise[_0xd186('0x56')](_0x45053b,function(_0x774f01){return new BPromise(function(_0x16171a,_0x2b7d0e){if(_0x774f01['autoAssociation']===null||_0x774f01[_0xd186('0x57')]===0x1)_0x16171a(null);return db['UserProfileResource'][_0xd186('0x46')]({'where':{'sectionId':_0x774f01['id']},'raw':!![]})[_0xd186('0x29')](function(_0x3b24b0){var _0x1413d8=_[_0xd186('0x2f')](_0x3b24b0,function(_0x14670b){return qs[_0xd186('0x50')](_0x14670b,['id','createdAt',_0xd186('0x52'),'sectionId']);});_0x16171a(_0x1413d8);})[_0xd186('0x4b')](function(_0x1aabe){_0x2b7d0e(_0x1aabe);});})[_0xd186('0x29')](function(_0x512792){var _0x48419=qs[_0xd186('0x50')](_0x774f01,['id','createdAt',_0xd186('0x52')]);_0x48419[_0xd186('0x58')]=_0x2bad68['id'];if(_0x512792)_0x48419[_0xd186('0x59')]=_0x512792;return _0x48419;})[_0xd186('0x29')](function(_0x276f15){return db[_0xd186('0x5a')][_0xd186('0x55')](_0x276f15,{'include':[{'model':db['UserProfileResource'],'as':_0xd186('0x59')}],'raw':!![],'transaction':_0x5ee268});});})[_0xd186('0x29')](function(){return _0x2bad68;});}});});});}})[_0xd186('0x29')](respondWithResult(_0x9bc3e0,0xc9))[_0xd186('0x4b')](handleError(_0x9bc3e0,null));};exports['update']=function(_0x2c10ca,_0x2211eb){if(_0x2c10ca[_0xd186('0x4c')]['id']){delete _0x2c10ca[_0xd186('0x4c')]['id'];}return db[_0xd186('0x30')]['find']({'where':{'id':_0x2c10ca['params']['id']}})[_0xd186('0x29')](handleEntityNotFound(_0x2211eb,null))[_0xd186('0x29')](saveUpdates(_0x2c10ca[_0xd186('0x4c')],null))[_0xd186('0x29')](respondWithResult(_0x2211eb,null))['catch'](handleError(_0x2211eb,null));};exports[_0xd186('0x28')]=function(_0x63c545,_0x187970){return db[_0xd186('0x30')][_0xd186('0x4a')]({'where':{'id':_0x63c545[_0xd186('0x4e')]['id']}})[_0xd186('0x29')](handleEntityNotFound(_0x187970,null))[_0xd186('0x29')](removeEntity(_0x187970,null))[_0xd186('0x4b')](handleError(_0x187970,null));};exports[_0xd186('0x5b')]=function(_0x3c4e1b,_0x464705){return db[_0xd186('0x30')][_0xd186('0x5b')]()[_0xd186('0x29')](respondWithResult(_0x464705,null))[_0xd186('0x4b')](handleError(_0x464705,null));};exports[_0xd186('0x5c')]=function(_0x4874e5,_0x252075){var _0x5d6157=_0x4874e5[_0xd186('0x4c')];return db[_0xd186('0x30')][_0xd186('0x4a')]({'where':{'id':_0x4874e5[_0xd186('0x4e')]['id']}})[_0xd186('0x29')](handleEntityNotFound(_0x252075,null))[_0xd186('0x29')](function(_0x2cf1de){if(_0x2cf1de){return db['sequelize'][_0xd186('0x54')](function(_0x443654){return db[_0xd186('0x5a')][_0xd186('0x28')]({'where':{'userProfileId':_0x4874e5[_0xd186('0x4e')]['id'],'sectionId':_[_0xd186('0x2f')](_0x5d6157,function(_0x547a27){return _0x547a27[_0xd186('0x5d')];})},'transaction':_0x443654})[_0xd186('0x29')](function(){var _0x2c47a7=_['map'](_0x5d6157,function(_0x208dad){_0x208dad['userProfileId']=_0x4874e5[_0xd186('0x4e')]['id'];return _0x208dad;});var _0x4bf073=[];return BPromise[_0xd186('0x56')](_0x2c47a7,function(_0x4fccf1){return db[_0xd186('0x5a')][_0xd186('0x55')](_0x4fccf1,{'include':[{'model':db[_0xd186('0x5e')],'as':_0xd186('0x59')}],'raw':!![],'transaction':_0x443654})[_0xd186('0x29')](function(_0x404204){_0x4bf073[_0xd186('0x5f')](_0x404204[_0xd186('0x4f')]({'plain':!![]}));});})[_0xd186('0x29')](function(){return _0x4bf073;});});});}})[_0xd186('0x29')](function(_0x224061){return _0x224061;})[_0xd186('0x29')](respondWithResult(_0x252075,null))[_0xd186('0x4b')](handleError(_0x252075,null));};exports[_0xd186('0x60')]=function(_0x55ce91,_0x55d2d){var _0x51cb9a;return db['UserProfile']['find']({'where':{'id':_0x55ce91['params']['id']},'attributes':['id','name']})[_0xd186('0x29')](handleEntityNotFound(_0x55d2d,null))[_0xd186('0x29')](function(_0x1e2ddb){if(_0x1e2ddb){_0x51cb9a=_0x1e2ddb;return db[_0xd186('0x5a')][_0xd186('0x28')]({'where':{'userProfileId':_0x55ce91[_0xd186('0x4e')]['id'],'sectionId':_0x55ce91[_0xd186('0x36')][_0xd186('0x61')]}});}})[_0xd186('0x29')](function(){return _0x51cb9a;})['then'](respondWithStatusCode(_0x55d2d,null))['catch'](handleError(_0x55d2d,null));};exports[_0xd186('0x62')]=function(_0x454a67,_0x564b1f){var _0x21f6ea=[];var _0x33f265=[];return db[_0xd186('0x5a')][_0xd186('0x46')]({'where':{'userProfileId':_0x454a67[_0xd186('0x4e')]['id']},'raw':!![]})[_0xd186('0x29')](function(_0x6f61a0){_0x21f6ea=_['filter'](_0x6f61a0,function(_0xc6ca76){return _0xc6ca76['enabled']===0x1||_['includes']([0x3eb,0x709],_0xc6ca76[_0xd186('0x5d')]);});if(!_[_0xd186('0x63')](_0x21f6ea)){return _[_0xd186('0x2f')](_0x21f6ea,function(_0x3ffbf2){return _0x3ffbf2[_0xd186('0x5d')];});}else{return;}})[_0xd186('0x29')](function(_0x72956d){if(_0x72956d)_0x33f265=_0x72956d;if(_[_0xd186('0x64')](_0x33f265,0x64)){var _0xcece4a=_[_0xd186('0x4a')](_0x21f6ea,{'sectionId':0x64});return hasDefaultDashboard(_0xcece4a)[_0xd186('0x29')](function(_0x2e519c){return _[_0xd186('0x2f')](_0x21f6ea,function(_0x55a05d){if(_0x55a05d[_0xd186('0x5d')]===0x64){_0x55a05d[_0xd186('0x65')]=_0x2e519c;}return _0x55a05d;});});}else{return;}})[_0xd186('0x29')](function(_0x48ce96){if(_0x48ce96)_0x21f6ea=_0x48ce96;if(_[_0xd186('0x64')](_0x33f265,0x3eb)){var _0x4cf4c4=_['find'](_0x21f6ea,{'sectionId':0x3eb});return getCustomDashboards(_0x4cf4c4)['then'](function(_0x161fb4){return _[_0xd186('0x2f')](_0x21f6ea,function(_0x47fea2){if(_0x4cf4c4[_0xd186('0x66')]){if(_0x47fea2['sectionId']===0x3eb){_0x47fea2[_0xd186('0x65')]=_0x161fb4;}}else{if(_0x47fea2[_0xd186('0x5d')]===0x64){_0x47fea2[_0xd186('0x65')]=_0x161fb4;}}return _0x47fea2;});});}else{return;}})[_0xd186('0x29')](function(_0x33078){if(_0x33078)_0x21f6ea=_0x33078;if(_[_0xd186('0x64')](_0x33f265,0x709)){var _0x4c9692=_[_0xd186('0x4a')](_0x21f6ea,{'sectionId':0x709});return getPlugins(_0x4c9692)[_0xd186('0x29')](function(_0x66d476){if(_0x4c9692[_0xd186('0x66')]){return _[_0xd186('0x2f')](_0x21f6ea,function(_0xcc7d47){if(_0xcc7d47[_0xd186('0x5d')]===0x709){_0xcc7d47[_0xd186('0x65')]=_0x66d476;}return _0xcc7d47;});}else{var _0x238bf9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x66d476};var _0x5aa460=_[_0xd186('0x2f')](_0x21f6ea);_0x5aa460[_0xd186('0x5f')](_0x238bf9);return _0x5aa460;}});}else{return;}})[_0xd186('0x29')](function(_0x3beaa0){if(_0x3beaa0)_0x21f6ea=_0x3beaa0;return _[_0xd186('0x67')](_0x21f6ea,[_0xd186('0x66'),0x1]);})[_0xd186('0x29')](respondWithResult(_0x564b1f,null))['catch'](handleError(_0x564b1f,null));};function hasDefaultDashboard(_0x5c68ef){var _0x125f9c=[0x65];return new BPromise(function(_0x5abd1b,_0x531878){try{if(_0x5c68ef['autoAssociation']){_0x5abd1b(_0x125f9c);}else{return db[_0xd186('0x5e')][_0xd186('0x68')]({'where':{'sectionId':_0x5c68ef['id']},'raw':!![]})[_0xd186('0x29')](function(_0x429f81){_0x429f81?_0x5abd1b(_0x125f9c):_0x5abd1b();});}}catch(_0x25c2bc){_0x531878(_0x25c2bc);}});}function getCustomDashboards(_0x1112fe){var _0x581a8e=[];return new BPromise(function(_0x3a3810,_0x745254){try{if(_0x1112fe[_0xd186('0x57')]){return db[_0xd186('0x69')][_0xd186('0x46')]({'raw':!![]})[_0xd186('0x29')](function(_0x178e30){_0x178e30['forEach'](function(_0x30628d){_0x581a8e[_0xd186('0x5f')](_0x30628d['id']+0x1869f);});_0x3a3810(_0x581a8e);});}else{return db[_0xd186('0x5e')][_0xd186('0x46')]({'where':{'sectionId':_0x1112fe['id']},'raw':!![]})[_0xd186('0x29')](function(_0x5f03e5){_0x5f03e5[_0xd186('0x6a')](function(_0x50aa4c){_0x581a8e['push'](_0x50aa4c[_0xd186('0x6b')]+0x1869f);});_0x3a3810(_0x581a8e);});}}catch(_0x491522){_0x745254(_0x491522);}});}function getPlugins(_0x268e7c){var _0x289027=[];return new BPromise(function(_0xa4dc65,_0x2aa7e2){try{if(_0x268e7c['autoAssociation']){return db[_0xd186('0x6c')][_0xd186('0x46')]({'raw':!![]})[_0xd186('0x29')](function(_0x2c955e){_0x2c955e[_0xd186('0x6a')](function(_0x138e81){_0x289027[_0xd186('0x5f')](_0x138e81['id']+0x15b38);});_0xa4dc65(_0x289027);});}else{return db[_0xd186('0x5e')][_0xd186('0x46')]({'where':{'sectionId':_0x268e7c['id']},'raw':!![]})[_0xd186('0x29')](function(_0x1a911c){_0x1a911c[_0xd186('0x6a')](function(_0x1c4c8e){_0x289027['push'](_0x1c4c8e['resourceId']+0x15b38);});_0xa4dc65(_0x289027);});}}catch(_0x307445){_0x2aa7e2(_0x307445);}});}exports[_0xd186('0x6d')]=function(_0x337690,_0x639b01){return db[_0xd186('0x30')][_0xd186('0x4a')]({'where':{'id':_0x337690[_0xd186('0x4e')]['id']}})['then'](handleEntityNotFound(_0x639b01,null))[_0xd186('0x29')](function(_0x490bc3){if(_0x490bc3){return db[_0xd186('0x53')]['transaction'](function(_0x12f33e){return db[_0xd186('0x5a')][_0xd186('0x46')]({'where':{'userProfileId':_0x337690[_0xd186('0x4e')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x124765){if(_0x124765){return db[_0xd186('0x5a')][_0xd186('0x28')]({'where':{'userProfileId':_0x337690[_0xd186('0x4e')]['id'],'id':_['map'](_0x124765,function(_0x39e516){return _0x39e516['id'];})},'transaction':_0x12f33e});}})['then'](function(_0x2356eb){var _0x5556e8=_['map'](_0x337690[_0xd186('0x4c')],function(_0x5ba85d){_0x5ba85d[_0xd186('0x58')]=_0x337690[_0xd186('0x4e')]['id'];return _0x5ba85d;});return db[_0xd186('0x5a')]['bulkCreate'](_0x5556e8,{'raw':!![],'transaction':_0x12f33e});})[_0xd186('0x29')](function(_0x25c022){var _0x58dc96=_[_0xd186('0x67')](_[_0xd186('0x2f')](_0x25c022,function(_0x111e0b){return _0x111e0b[_0xd186('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x58dc96){return db[_0xd186('0x5a')][_0xd186('0x46')]({'where':{'userProfileId':_0x337690[_0xd186('0x4e')]['id'],'sectionId':_[_0xd186('0x2f')](_0x58dc96,function(_0x144b9d){return _0x144b9d[_0xd186('0x5d')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd186('0x29')](function(_0x454b22){var _0x3b6f77=_['map'](_0x337690[_0xd186('0x4c')],function(_0x273be1){_0x273be1[_0xd186('0x58')]=_0x337690['params']['id'];return _0x273be1;});return db[_0xd186('0x5e')][_0xd186('0x6e')](_0x3b6f77,{'raw':!![],'transaction':_0x12f33e});});}})['catch'](handleError(_0x639b01,null));});}})[_0xd186('0x29')](function(_0x33828f){var _0x5c873a=_[_0xd186('0x2f')](_0x33828f,function(_0x555415){return _0x555415['get']({'plain':!![]});});})[_0xd186('0x29')](respondWithResult(_0x639b01,null))[_0xd186('0x4b')](handleError(_0x639b01,null));};exports[_0xd186('0x6f')]=function(_0x3433fa,_0x5e8a8d,_0xb2c0d7){return db['UserProfile'][_0xd186('0x4a')]({'where':{'id':_0x3433fa[_0xd186('0x4e')]['id']}})[_0xd186('0x29')](handleEntityNotFound(_0x5e8a8d,null))[_0xd186('0x29')](function(_0x5af279){if(_0x5af279){return _0x5af279[_0xd186('0x6f')](_0x3433fa[_0xd186('0x36')]['ids']);}})[_0xd186('0x29')](respondWithStatusCode(_0x5e8a8d,null))[_0xd186('0x4b')](handleError(_0x5e8a8d,null));};exports[_0xd186('0x70')]=function(_0x17dd84,_0x2c0a7b){var _0x3f890e={};if(!_0x17dd84[_0xd186('0x36')]['section'])throw new Error(_0xd186('0x71'));if(!_0x17dd84[_0xd186('0x36')][_0xd186('0x3d')](_0xd186('0x3e'))){_0x3f890e[_0xd186('0x21')]=qs[_0xd186('0x21')](_0x17dd84[_0xd186('0x36')]['limit']);_0x3f890e[_0xd186('0x23')]=qs[_0xd186('0x23')](_0x17dd84[_0xd186('0x36')][_0xd186('0x23')]);}return db[_0xd186('0x30')][_0xd186('0x4a')]({'where':{'id':_0x17dd84[_0xd186('0x4e')]['id']}})[_0xd186('0x29')](function(_0x296ac){if(!_0x296ac)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x17dd84[_0xd186('0x4e')]['id']);return db['UserProfile'][_0xd186('0x70')](_0x17dd84);})['then'](respondWithFilteredResult(_0x2c0a7b,_0x3f890e))['catch'](handleError(_0x2c0a7b,null));}; \ No newline at end of file +var _0x3e94=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','name','send','map','UserProfile','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','clone','omit','createdAt','crudPermissions','updatedAt','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','sequelize','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','findOne','Dashboard','resourceId','Plugin','forEach','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel'];(function(_0x29189e,_0x65c683){var _0x27feff=function(_0x3a427b){while(--_0x3a427b){_0x29189e['push'](_0x29189e['shift']());}};_0x27feff(++_0x65c683);}(_0x3e94,0x67));var _0x43e9=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3e94[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x43e9('0x0'));var rimraf=require(_0x43e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x43e9('0x2'));var rp=require(_0x43e9('0x3'));var moment=require(_0x43e9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x43e9('0x5'));var util=require(_0x43e9('0x6'));var path=require(_0x43e9('0x7'));var sox=require('sox');var csv=require(_0x43e9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43e9('0x9'));var _=require('lodash');var squel=require(_0x43e9('0xa'));var crypto=require(_0x43e9('0xb'));var jsforce=require(_0x43e9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x43e9('0x8'));var querystring=require(_0x43e9('0xd'));var Papa=require(_0x43e9('0xe'));var Redis=require(_0x43e9('0xf'));var authService=require(_0x43e9('0x10'));var qs=require(_0x43e9('0x11'));var as=require(_0x43e9('0x12'));var hardwareService=require(_0x43e9('0x13'));var logger=require(_0x43e9('0x14'))('api');var utils=require(_0x43e9('0x15'));var config=require(_0x43e9('0x16'));var licenseUtil=require(_0x43e9('0x17'));var db=require('../../mysqldb')['db'];config[_0x43e9('0x18')]=_[_0x43e9('0x19')](config[_0x43e9('0x18')],{'host':_0x43e9('0x1a'),'port':0x18eb});var socket=require(_0x43e9('0x1b'))(new Redis(config['redis']));require('./userProfile.socket')[_0x43e9('0x1c')](socket);function respondWithStatusCode(_0x510232,_0x146106){_0x146106=_0x146106||0xcc;return function(_0x471cb8){if(_0x471cb8){return _0x510232[_0x43e9('0x1d')](_0x146106);}return _0x510232[_0x43e9('0x1e')](_0x146106)[_0x43e9('0x1f')]();};}function respondWithResult(_0x199e16,_0x329add){_0x329add=_0x329add||0xc8;return function(_0x1fb993){if(_0x1fb993){return _0x199e16[_0x43e9('0x1e')](_0x329add)[_0x43e9('0x20')](_0x1fb993);}};}function respondWithFilteredResult(_0x2636df,_0x21ceda){return function(_0x310476){if(_0x310476){var _0x31614e=typeof _0x21ceda['offset']==='undefined'&&typeof _0x21ceda[_0x43e9('0x21')]===_0x43e9('0x22');var _0x663c43=_0x310476[_0x43e9('0x23')];var _0x2f7f0d=_0x31614e?0x0:_0x21ceda['offset'];var _0x2bf4d4=_0x31614e?_0x310476['count']:_0x21ceda[_0x43e9('0x24')]+_0x21ceda[_0x43e9('0x21')];var _0x777e8f;if(_0x2bf4d4>=_0x663c43){_0x2bf4d4=_0x663c43;_0x777e8f=0xc8;}else{_0x777e8f=0xce;}_0x2636df[_0x43e9('0x1e')](_0x777e8f);return _0x2636df[_0x43e9('0x25')]('Content-Range',_0x2f7f0d+'-'+_0x2bf4d4+'/'+_0x663c43)[_0x43e9('0x20')](_0x310476);}return null;};}function patchUpdates(_0x3d604e){return function(_0x49e9b4){try{jsonpatch[_0x43e9('0x26')](_0x49e9b4,_0x3d604e,!![]);}catch(_0x25a8f9){return BPromise[_0x43e9('0x27')](_0x25a8f9);}return _0x49e9b4[_0x43e9('0x28')]();};}function saveUpdates(_0x4a74b1,_0x1025a6){return function(_0x4ba987){if(_0x4ba987){return _0x4ba987[_0x43e9('0x29')](_0x4a74b1)['then'](function(_0x486539){return _0x486539;});}return null;};}function removeEntity(_0x5cbe99,_0x5e9b50){return function(_0x2fac99){if(_0x2fac99){return _0x2fac99['destroy']()[_0x43e9('0x2a')](function(){_0x5cbe99[_0x43e9('0x1e')](0xcc)[_0x43e9('0x1f')]();});}};}function handleEntityNotFound(_0x55a298,_0x50cf61){return function(_0xf64426){if(!_0xf64426){_0x55a298['sendStatus'](0x194);}return _0xf64426;};}function handleError(_0x5f1aa2,_0x44a616){_0x44a616=_0x44a616||0x1f4;return function(_0x506ff4){logger['error'](_0x506ff4['stack']);if(_0x506ff4[_0x43e9('0x2b')]){delete _0x506ff4[_0x43e9('0x2b')];}_0x5f1aa2['status'](_0x44a616)[_0x43e9('0x2c')](_0x506ff4);};}exports['index']=function(_0x4191ff,_0x5777a8){var _0x24dfff={},_0x580bd0={},_0x4cd81b={'count':0x0,'rows':[]};var _0x128b56=_[_0x43e9('0x2d')](db[_0x43e9('0x2e')][_0x43e9('0x2f')],function(_0x3f9892){return{'name':_0x3f9892['fieldName'],'type':_0x3f9892[_0x43e9('0x30')]['key']};});_0x580bd0['model']=_[_0x43e9('0x2d')](_0x128b56,_0x43e9('0x2b'));_0x580bd0[_0x43e9('0x31')]=_[_0x43e9('0x32')](_0x4191ff['query']);_0x580bd0[_0x43e9('0x33')]=_[_0x43e9('0x34')](_0x580bd0[_0x43e9('0x35')],_0x580bd0[_0x43e9('0x31')]);_0x24dfff['attributes']=_[_0x43e9('0x34')](_0x580bd0[_0x43e9('0x35')],qs[_0x43e9('0x36')](_0x4191ff[_0x43e9('0x31')][_0x43e9('0x36')]));_0x24dfff[_0x43e9('0x37')]=_0x24dfff[_0x43e9('0x37')]['length']?_0x24dfff[_0x43e9('0x37')]:_0x580bd0[_0x43e9('0x35')];if(!_0x4191ff[_0x43e9('0x31')][_0x43e9('0x38')](_0x43e9('0x39'))){_0x24dfff['limit']=qs[_0x43e9('0x21')](_0x4191ff[_0x43e9('0x31')][_0x43e9('0x21')]);_0x24dfff['offset']=qs[_0x43e9('0x24')](_0x4191ff[_0x43e9('0x31')][_0x43e9('0x24')]);}_0x24dfff[_0x43e9('0x3a')]=qs[_0x43e9('0x3b')](_0x4191ff['query'][_0x43e9('0x3b')]);_0x24dfff[_0x43e9('0x3c')]=qs[_0x43e9('0x33')](_[_0x43e9('0x3d')](_0x4191ff[_0x43e9('0x31')],_0x580bd0[_0x43e9('0x33')]),_0x128b56);if(_0x4191ff[_0x43e9('0x31')][_0x43e9('0x3e')]){_0x24dfff[_0x43e9('0x3c')]=_[_0x43e9('0x3f')](_0x24dfff[_0x43e9('0x3c')],{'$or':_[_0x43e9('0x2d')](_0x128b56,function(_0x300c83){if(_0x300c83[_0x43e9('0x30')]!=='VIRTUAL'){var _0x414c97={};_0x414c97[_0x300c83[_0x43e9('0x2b')]]={'$like':'%'+_0x4191ff[_0x43e9('0x31')]['filter']+'%'};return _0x414c97;}})});}_0x24dfff=_[_0x43e9('0x3f')]({},_0x24dfff,_0x4191ff[_0x43e9('0x40')]);var _0x192aca={'where':_0x24dfff[_0x43e9('0x3c')]};return db[_0x43e9('0x2e')][_0x43e9('0x23')](_0x192aca)['then'](function(_0x164db1){_0x4cd81b[_0x43e9('0x23')]=_0x164db1;if(_0x4191ff[_0x43e9('0x31')][_0x43e9('0x41')]){_0x24dfff[_0x43e9('0x42')]=[{'all':!![]}];}return db[_0x43e9('0x2e')][_0x43e9('0x43')](_0x24dfff);})[_0x43e9('0x2a')](function(_0x30eace){_0x4cd81b[_0x43e9('0x44')]=_0x30eace;return _0x4cd81b;})['then'](respondWithFilteredResult(_0x5777a8,_0x24dfff))['catch'](handleError(_0x5777a8,null));};exports[_0x43e9('0x45')]=function(_0x15d96b,_0x235236){var _0x1a3156={'raw':![],'where':{'id':_0x15d96b[_0x43e9('0x46')]['id']}},_0x41f250={};_0x41f250[_0x43e9('0x35')]=_['keys'](db[_0x43e9('0x2e')]['rawAttributes']);_0x41f250[_0x43e9('0x31')]=_[_0x43e9('0x32')](_0x15d96b[_0x43e9('0x31')]);_0x41f250[_0x43e9('0x33')]=_[_0x43e9('0x34')](_0x41f250[_0x43e9('0x35')],_0x41f250[_0x43e9('0x31')]);_0x1a3156[_0x43e9('0x37')]=_[_0x43e9('0x34')](_0x41f250['model'],qs[_0x43e9('0x36')](_0x15d96b[_0x43e9('0x31')][_0x43e9('0x36')]));_0x1a3156[_0x43e9('0x37')]=_0x1a3156[_0x43e9('0x37')][_0x43e9('0x47')]?_0x1a3156['attributes']:_0x41f250[_0x43e9('0x35')];if(_0x15d96b[_0x43e9('0x31')]['includeAll']){_0x1a3156[_0x43e9('0x42')]=[{'all':!![]}];}_0x1a3156=_[_0x43e9('0x3f')]({},_0x1a3156,_0x15d96b[_0x43e9('0x40')]);return db[_0x43e9('0x2e')][_0x43e9('0x48')](_0x1a3156)[_0x43e9('0x2a')](handleEntityNotFound(_0x235236,null))[_0x43e9('0x2a')](respondWithResult(_0x235236,null))[_0x43e9('0x49')](handleError(_0x235236,null));};exports[_0x43e9('0x4a')]=function(_0x55c45a,_0x5a5ed7){return db[_0x43e9('0x2e')][_0x43e9('0x4a')](_0x55c45a[_0x43e9('0x4b')],{})['then'](respondWithResult(_0x5a5ed7,0xc9))[_0x43e9('0x49')](handleError(_0x5a5ed7,null));};exports[_0x43e9('0x4c')]=function(_0x44f60c,_0x4b5652){var _0x5d8c11={'where':{'id':_0x44f60c[_0x43e9('0x46')]['id']}},_0x3e2f51={};_0x3e2f51[_0x43e9('0x35')]=_[_0x43e9('0x32')](db['UserProfile'][_0x43e9('0x2f')]);_0x5d8c11[_0x43e9('0x37')]=_['intersection'](_0x3e2f51[_0x43e9('0x35')],qs[_0x43e9('0x36')](_0x44f60c['query'][_0x43e9('0x36')]));_0x5d8c11[_0x43e9('0x37')]=_0x5d8c11['attributes'][_0x43e9('0x47')]?_0x5d8c11[_0x43e9('0x37')]:_0x3e2f51[_0x43e9('0x35')];if(_0x44f60c[_0x43e9('0x31')]['includeAll']){_0x5d8c11[_0x43e9('0x42')]=[{'all':!![]}];}_0x5d8c11=_[_0x43e9('0x3f')]({},_0x5d8c11,_0x44f60c[_0x43e9('0x40')]);return db[_0x43e9('0x2e')]['find'](_0x5d8c11)['then'](handleEntityNotFound(_0x4b5652,null))[_0x43e9('0x2a')](function(_0x59c03d){if(_0x59c03d){var _0x310abe=_0x59c03d['get']({'plain':!![]});_0x310abe=qs[_0x43e9('0x4d')](_0x310abe,['id',_0x43e9('0x4e'),'updatedAt',_0x43e9('0x4f')]);_0x44f60c[_0x43e9('0x4b')]=_[_0x43e9('0x4d')](_0x44f60c[_0x43e9('0x4b')],['id','createdAt',_0x43e9('0x50')]);return db['sequelize'][_0x43e9('0x51')](function(_0x33d61a){return db[_0x43e9('0x2e')]['create'](_['merge'](_0x310abe,_0x44f60c['body']),{'include':_0x44f60c[_0x43e9('0x31')][_0x43e9('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x33d61a})['then'](function(_0x59a787){var _0xed51e4=_0x59a787[_0x43e9('0x52')]({'plain':!![]});return db[_0x43e9('0x53')][_0x43e9('0x43')]({'where':{'userProfileId':_0x44f60c[_0x43e9('0x46')]['id']},'raw':!![]})[_0x43e9('0x2a')](function(_0x445b85){if(_0x445b85){return BPromise[_0x43e9('0x54')](_0x445b85,function(_0xffe161){return new BPromise(function(_0x16d742,_0x54e2a2){if(_0xffe161[_0x43e9('0x55')]===null||_0xffe161[_0x43e9('0x55')]===0x1)_0x16d742(null);return db[_0x43e9('0x56')]['findAll']({'where':{'sectionId':_0xffe161['id']},'raw':!![]})[_0x43e9('0x2a')](function(_0x5166cb){var _0x12b417=_[_0x43e9('0x2d')](_0x5166cb,function(_0xf830cc){return qs[_0x43e9('0x4d')](_0xf830cc,['id','createdAt',_0x43e9('0x50'),_0x43e9('0x57')]);});_0x16d742(_0x12b417);})[_0x43e9('0x49')](function(_0x239743){_0x54e2a2(_0x239743);});})[_0x43e9('0x2a')](function(_0x3349eb){var _0x5703a5=qs[_0x43e9('0x4d')](_0xffe161,['id',_0x43e9('0x4e'),_0x43e9('0x50')]);_0x5703a5[_0x43e9('0x58')]=_0xed51e4['id'];if(_0x3349eb)_0x5703a5[_0x43e9('0x59')]=_0x3349eb;return _0x5703a5;})[_0x43e9('0x2a')](function(_0x21d7a2){return db['UserProfileSection'][_0x43e9('0x4a')](_0x21d7a2,{'include':[{'model':db['UserProfileResource'],'as':_0x43e9('0x59')}],'raw':!![],'transaction':_0x33d61a});});})[_0x43e9('0x2a')](function(){return _0xed51e4;});}});});});}})['then'](respondWithResult(_0x4b5652,0xc9))[_0x43e9('0x49')](handleError(_0x4b5652,null));};exports['update']=function(_0x1874ac,_0x4bef9d){if(_0x1874ac['body']['id']){delete _0x1874ac[_0x43e9('0x4b')]['id'];}return db['UserProfile'][_0x43e9('0x48')]({'where':{'id':_0x1874ac[_0x43e9('0x46')]['id']}})[_0x43e9('0x2a')](handleEntityNotFound(_0x4bef9d,null))[_0x43e9('0x2a')](saveUpdates(_0x1874ac['body'],null))[_0x43e9('0x2a')](respondWithResult(_0x4bef9d,null))[_0x43e9('0x49')](handleError(_0x4bef9d,null));};exports[_0x43e9('0x5a')]=function(_0x4fb0c7,_0x3dc355){return db[_0x43e9('0x2e')][_0x43e9('0x48')]({'where':{'id':_0x4fb0c7[_0x43e9('0x46')]['id']}})[_0x43e9('0x2a')](handleEntityNotFound(_0x3dc355,null))['then'](removeEntity(_0x3dc355,null))['catch'](handleError(_0x3dc355,null));};exports[_0x43e9('0x5b')]=function(_0x1299fe,_0x3177ed){return db[_0x43e9('0x2e')]['describe']()['then'](respondWithResult(_0x3177ed,null))['catch'](handleError(_0x3177ed,null));};exports[_0x43e9('0x5c')]=function(_0x5a9c30,_0x2ba0e3){var _0x4c181b=_0x5a9c30[_0x43e9('0x4b')];return db[_0x43e9('0x2e')][_0x43e9('0x48')]({'where':{'id':_0x5a9c30[_0x43e9('0x46')]['id']}})[_0x43e9('0x2a')](handleEntityNotFound(_0x2ba0e3,null))[_0x43e9('0x2a')](function(_0x3a974f){if(_0x3a974f){return db[_0x43e9('0x5d')]['transaction'](function(_0x38dec5){return db['UserProfileSection'][_0x43e9('0x5a')]({'where':{'userProfileId':_0x5a9c30[_0x43e9('0x46')]['id'],'sectionId':_[_0x43e9('0x2d')](_0x4c181b,function(_0x3f759a){return _0x3f759a[_0x43e9('0x57')];})},'transaction':_0x38dec5})[_0x43e9('0x2a')](function(){var _0x554f83=_['map'](_0x4c181b,function(_0x44e71a){_0x44e71a[_0x43e9('0x58')]=_0x5a9c30[_0x43e9('0x46')]['id'];return _0x44e71a;});var _0x39d400=[];return BPromise[_0x43e9('0x54')](_0x554f83,function(_0x1f5dba){return db[_0x43e9('0x53')][_0x43e9('0x4a')](_0x1f5dba,{'include':[{'model':db[_0x43e9('0x56')],'as':_0x43e9('0x59')}],'raw':!![],'transaction':_0x38dec5})[_0x43e9('0x2a')](function(_0x1871ee){_0x39d400['push'](_0x1871ee[_0x43e9('0x52')]({'plain':!![]}));});})[_0x43e9('0x2a')](function(){return _0x39d400;});});});}})[_0x43e9('0x2a')](function(_0x34e2d1){return _0x34e2d1;})[_0x43e9('0x2a')](respondWithResult(_0x2ba0e3,null))['catch'](handleError(_0x2ba0e3,null));};exports[_0x43e9('0x5e')]=function(_0x49e63b,_0x1f089c){var _0x178a30;return db[_0x43e9('0x2e')][_0x43e9('0x48')]({'where':{'id':_0x49e63b[_0x43e9('0x46')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x1f089c,null))[_0x43e9('0x2a')](function(_0x45ed51){if(_0x45ed51){_0x178a30=_0x45ed51;return db[_0x43e9('0x53')]['destroy']({'where':{'userProfileId':_0x49e63b[_0x43e9('0x46')]['id'],'sectionId':_0x49e63b[_0x43e9('0x31')][_0x43e9('0x5f')]}});}})['then'](function(){return _0x178a30;})[_0x43e9('0x2a')](respondWithStatusCode(_0x1f089c,null))['catch'](handleError(_0x1f089c,null));};exports[_0x43e9('0x60')]=function(_0x3d91e5,_0x42b340){var _0x54c625=[];var _0x36c661=[];return db[_0x43e9('0x53')][_0x43e9('0x43')]({'where':{'userProfileId':_0x3d91e5[_0x43e9('0x46')]['id']},'raw':!![]})['then'](function(_0x314a1d){_0x54c625=_[_0x43e9('0x3e')](_0x314a1d,function(_0xadd1b6){return _0xadd1b6[_0x43e9('0x61')]===0x1||_['includes']([0x3eb,0x709],_0xadd1b6[_0x43e9('0x57')]);});if(!_[_0x43e9('0x62')](_0x54c625)){return _[_0x43e9('0x2d')](_0x54c625,function(_0x77e5e6){return _0x77e5e6[_0x43e9('0x57')];});}else{return;}})[_0x43e9('0x2a')](function(_0x2a7f1a){if(_0x2a7f1a)_0x36c661=_0x2a7f1a;if(_[_0x43e9('0x63')](_0x36c661,0x64)){var _0x116c27=_[_0x43e9('0x48')](_0x54c625,{'sectionId':0x64});return hasDefaultDashboard(_0x116c27)['then'](function(_0x2ea772){return _[_0x43e9('0x2d')](_0x54c625,function(_0x5e086a){if(_0x5e086a['sectionId']===0x64){_0x5e086a[_0x43e9('0x64')]=_0x2ea772;}return _0x5e086a;});});}else{return;}})[_0x43e9('0x2a')](function(_0x5bcfec){if(_0x5bcfec)_0x54c625=_0x5bcfec;if(_['includes'](_0x36c661,0x3eb)){var _0x38211b=_[_0x43e9('0x48')](_0x54c625,{'sectionId':0x3eb});return getCustomDashboards(_0x38211b)[_0x43e9('0x2a')](function(_0x560a51){return _[_0x43e9('0x2d')](_0x54c625,function(_0x3fe286){if(_0x38211b[_0x43e9('0x61')]){if(_0x3fe286['sectionId']===0x3eb){_0x3fe286[_0x43e9('0x64')]=_0x560a51;}}else{if(_0x3fe286[_0x43e9('0x57')]===0x64){_0x3fe286[_0x43e9('0x64')]=_0x560a51;}}return _0x3fe286;});});}else{return;}})['then'](function(_0x3096a9){if(_0x3096a9)_0x54c625=_0x3096a9;if(_['includes'](_0x36c661,0x709)){var _0x2ea63f=_[_0x43e9('0x48')](_0x54c625,{'sectionId':0x709});return getPlugins(_0x2ea63f)[_0x43e9('0x2a')](function(_0x47f8dd){if(_0x2ea63f['enabled']){return _[_0x43e9('0x2d')](_0x54c625,function(_0x80395f){if(_0x80395f['sectionId']===0x709){_0x80395f[_0x43e9('0x64')]=_0x47f8dd;}return _0x80395f;});}else{var _0x1e05ff={'sectionId':0x76c,'enabled':0x1,'subsections':_0x47f8dd};var _0x5b9f10=_['map'](_0x54c625);_0x5b9f10[_0x43e9('0x65')](_0x1e05ff);return _0x5b9f10;}});}else{return;}})[_0x43e9('0x2a')](function(_0x3129ee){if(_0x3129ee)_0x54c625=_0x3129ee;return _['filter'](_0x54c625,[_0x43e9('0x61'),0x1]);})['then'](respondWithResult(_0x42b340,null))['catch'](handleError(_0x42b340,null));};function hasDefaultDashboard(_0x3e7122){var _0x2f2927=[0x65];return new BPromise(function(_0x101bb3,_0x2f413b){try{if(_0x3e7122[_0x43e9('0x55')]){_0x101bb3(_0x2f2927);}else{return db[_0x43e9('0x56')][_0x43e9('0x66')]({'where':{'sectionId':_0x3e7122['id']},'raw':!![]})[_0x43e9('0x2a')](function(_0x1f7cf9){_0x1f7cf9?_0x101bb3(_0x2f2927):_0x101bb3();});}}catch(_0x532b1d){_0x2f413b(_0x532b1d);}});}function getCustomDashboards(_0x5b33d6){var _0x42de3e=[];return new BPromise(function(_0x312414,_0x2fb5dc){try{if(_0x5b33d6[_0x43e9('0x55')]){return db[_0x43e9('0x67')]['findAll']({'raw':!![]})['then'](function(_0x20cd20){_0x20cd20['forEach'](function(_0x4308f5){_0x42de3e['push'](_0x4308f5['id']+0x1869f);});_0x312414(_0x42de3e);});}else{return db[_0x43e9('0x56')]['findAll']({'where':{'sectionId':_0x5b33d6['id']},'raw':!![]})[_0x43e9('0x2a')](function(_0x3d9be5){_0x3d9be5['forEach'](function(_0x54e772){_0x42de3e[_0x43e9('0x65')](_0x54e772[_0x43e9('0x68')]+0x1869f);});_0x312414(_0x42de3e);});}}catch(_0x26be00){_0x2fb5dc(_0x26be00);}});}function getPlugins(_0x5a0502){var _0x1e7785=[];return new BPromise(function(_0x25cd40,_0x4e9777){try{if(_0x5a0502['autoAssociation']){return db[_0x43e9('0x69')][_0x43e9('0x43')]({'raw':!![]})[_0x43e9('0x2a')](function(_0x5e52c9){_0x5e52c9[_0x43e9('0x6a')](function(_0x2b134d){_0x1e7785['push'](_0x2b134d['id']+0x15b38);});_0x25cd40(_0x1e7785);});}else{return db[_0x43e9('0x56')]['findAll']({'where':{'sectionId':_0x5a0502['id']},'raw':!![]})['then'](function(_0x20e58b){_0x20e58b[_0x43e9('0x6a')](function(_0x1c9ce3){_0x1e7785[_0x43e9('0x65')](_0x1c9ce3[_0x43e9('0x68')]+0x15b38);});_0x25cd40(_0x1e7785);});}}catch(_0x56bc88){_0x4e9777(_0x56bc88);}});}exports[_0x43e9('0x6b')]=function(_0x7f99ab,_0x1c602f){return db[_0x43e9('0x2e')]['find']({'where':{'id':_0x7f99ab[_0x43e9('0x46')]['id']}})[_0x43e9('0x2a')](handleEntityNotFound(_0x1c602f,null))[_0x43e9('0x2a')](function(_0x54b71d){if(_0x54b71d){return db[_0x43e9('0x5d')][_0x43e9('0x51')](function(_0x3c63b2){return db['UserProfileSection'][_0x43e9('0x43')]({'where':{'userProfileId':_0x7f99ab[_0x43e9('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x43e9('0x2a')](function(_0x1bd6f9){if(_0x1bd6f9){return db['UserProfileSection'][_0x43e9('0x5a')]({'where':{'userProfileId':_0x7f99ab['params']['id'],'id':_[_0x43e9('0x2d')](_0x1bd6f9,function(_0x5e6752){return _0x5e6752['id'];})},'transaction':_0x3c63b2});}})[_0x43e9('0x2a')](function(_0x4ebffc){var _0x3aa100=_[_0x43e9('0x2d')](_0x7f99ab[_0x43e9('0x4b')],function(_0x2785bf){_0x2785bf['userProfileId']=_0x7f99ab[_0x43e9('0x46')]['id'];return _0x2785bf;});return db[_0x43e9('0x53')][_0x43e9('0x6c')](_0x3aa100,{'raw':!![],'transaction':_0x3c63b2});})[_0x43e9('0x2a')](function(_0x6fb0c9){var _0x24e13e=_[_0x43e9('0x3e')](_[_0x43e9('0x2d')](_0x6fb0c9,function(_0x22dd28){return _0x22dd28['get']({'plain':!![]});}),{'includeAll':![]});if(_0x24e13e){return db[_0x43e9('0x53')][_0x43e9('0x43')]({'where':{'userProfileId':_0x7f99ab[_0x43e9('0x46')]['id'],'sectionId':_['map'](_0x24e13e,function(_0x40b3f8){return _0x40b3f8[_0x43e9('0x57')];})},'attributes':['id',_0x43e9('0x57')],'raw':!![]})['then'](function(_0x46d3ba){var _0x325664=_['map'](_0x7f99ab[_0x43e9('0x4b')],function(_0x2ed078){_0x2ed078['userProfileId']=_0x7f99ab[_0x43e9('0x46')]['id'];return _0x2ed078;});return db[_0x43e9('0x56')][_0x43e9('0x6c')](_0x325664,{'raw':!![],'transaction':_0x3c63b2});});}})['catch'](handleError(_0x1c602f,null));});}})[_0x43e9('0x2a')](function(_0x3a41ad){var _0x4bc6b2=_['map'](_0x3a41ad,function(_0x476288){return _0x476288[_0x43e9('0x52')]({'plain':!![]});});})[_0x43e9('0x2a')](respondWithResult(_0x1c602f,null))[_0x43e9('0x49')](handleError(_0x1c602f,null));};exports[_0x43e9('0x6d')]=function(_0x53f7bd,_0x495b4f,_0x14dd94){return db[_0x43e9('0x2e')][_0x43e9('0x48')]({'where':{'id':_0x53f7bd[_0x43e9('0x46')]['id']}})[_0x43e9('0x2a')](handleEntityNotFound(_0x495b4f,null))[_0x43e9('0x2a')](function(_0x525c4b){if(_0x525c4b){return _0x525c4b['removeResources'](_0x53f7bd[_0x43e9('0x31')]['ids']);}})['then'](respondWithStatusCode(_0x495b4f,null))[_0x43e9('0x49')](handleError(_0x495b4f,null));};exports['getResources']=function(_0x4819a6,_0x25d462){var _0x12c309={};if(!_0x4819a6[_0x43e9('0x31')][_0x43e9('0x6e')])throw new Error(_0x43e9('0x6f'));if(!_0x4819a6[_0x43e9('0x31')][_0x43e9('0x38')](_0x43e9('0x39'))){_0x12c309['limit']=qs[_0x43e9('0x21')](_0x4819a6[_0x43e9('0x31')][_0x43e9('0x21')]);_0x12c309['offset']=qs[_0x43e9('0x24')](_0x4819a6['query'][_0x43e9('0x24')]);}return db[_0x43e9('0x2e')][_0x43e9('0x48')]({'where':{'id':_0x4819a6[_0x43e9('0x46')]['id']}})[_0x43e9('0x2a')](function(_0x5b8129){if(!_0x5b8129)throw new Error(_0x43e9('0x70')+_0x4819a6[_0x43e9('0x46')]['id']);return db[_0x43e9('0x2e')][_0x43e9('0x71')](_0x4819a6);})[_0x43e9('0x2a')](respondWithFilteredResult(_0x25d462,_0x12c309))[_0x43e9('0x49')](handleError(_0x25d462,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4912939..d37888c 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 _0xb6a6=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x155f4f,_0x459f4d){var _0x3f0800=function(_0x4f644f){while(--_0x4f644f){_0x155f4f['push'](_0x155f4f['shift']());}};_0x3f0800(++_0x459f4d);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x397d60,_0x3dea76){_0x397d60=_0x397d60-0x0;var _0x4a0523=_0xb6a6[_0x397d60];return _0x4a0523;};'use strict';var EventEmitter=require(_0x6b6a('0x0'));var UserProfile=require(_0x6b6a('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b6a('0x2'),'afterUpdate':_0x6b6a('0x3'),'afterDestroy':_0x6b6a('0x4')};function emitEvent(_0x8abe65){return function(_0xe80650,_0x494fb4,_0x15a57d){UserProfileEvents[_0x6b6a('0x5')](_0x8abe65+':'+_0xe80650['id'],_0xe80650);UserProfileEvents[_0x6b6a('0x5')](_0x8abe65,_0xe80650);_0x15a57d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6b6a('0x6')](e,emitEvent(event));}}module[_0x6b6a('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x8daf=['save','update','emit','hasOwnProperty','hook','exports'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x8daf,0x15c));var _0xf8da=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x8daf[_0x2b55b5];return _0x103d28;};'use strict';var EventEmitter=require('events');var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8da('0x0'),'afterUpdate':_0xf8da('0x1'),'afterDestroy':'remove'};function emitEvent(_0x3a62fe){return function(_0x109758,_0x258561,_0x3357f6){UserProfileEvents[_0xf8da('0x2')](_0x3a62fe+':'+_0x109758['id'],_0x109758);UserProfileEvents[_0xf8da('0x2')](_0x3a62fe,_0x109758);_0x3357f6(null);};}for(var e in events){if(events[_0xf8da('0x3')](e)){var event=events[e];UserProfile[_0xf8da('0x4')](e,emitEvent(event));}}module[_0xf8da('0x5')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 9d61d63..9a396ca 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 _0xc4aa=['Sequelize','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','ui.UserId\x20=\x20?','query','OpenTabs','define','UserProfile','user_profiles','section','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','autoAssociation','keys','filters','intersection','fields','attributes','limit','offset','sort','where','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','openTabs','chat','dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','findAll','then','map','catch','value','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','membername','User','role','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','admin','Agents','zendeskaccounts','ZendeskAccount','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice'];(function(_0x247a93,_0x43ae67){var _0x185c09=function(_0x8d64e0){while(--_0x8d64e0){_0x247a93['push'](_0x247a93['shift']());}};_0x185c09(++_0x43ae67);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xac4a('0x0'));var attributes=require(_0xac4a('0x1'));var qs=require(_0xac4a('0x2'));var squel=require(_0xac4a('0x3'));module[_0xac4a('0x4')]=function(_0x22469d){var _0x58634e=_0x22469d['models'];function _0x47d4f6(_0x2f48ed,_0x15b967){return new Promise(function(_0x730a38,_0x215f39){if(!_0x15b967)return _0x730a38(null);var _0x96be2b=_0x15b967[_0xac4a('0x5')]?{[_0x15b967[_0xac4a('0x5')][_0xac4a('0x6')]]:_0x15b967['filter']['value']}:undefined;return _0x58634e[_0x2f48ed][_0xac4a('0x7')]({'where':_0x96be2b,'raw':!![]})[_0xac4a('0x8')](function(_0x26ec84){_0x15b967['associatedResources']=_[_0xac4a('0x9')](_0x26ec84,'id');_0x730a38(_0x15b967);})[_0xac4a('0xa')](function(_0x3e64f5){_0x215f39(_0x3e64f5);});});}function _0x4d4acc(_0x30135d,_0x488e3c){return new Promise(function(_0x2f062c,_0x4855b6){var _0x333ca5=_0x30135d[_0xac4a('0x5')]?{[_0x30135d[_0xac4a('0x5')]['field']]:_0x30135d[_0xac4a('0x5')][_0xac4a('0xb')]}:undefined;return _0x58634e[_0x30135d[_0xac4a('0xc')]][_0xac4a('0x7')]({'where':_0x333ca5,'raw':!![]})[_0xac4a('0x8')](function(_0x3b71c0){_0x488e3c[_0xac4a('0xd')]=_[_0xac4a('0x9')](_0x3b71c0,function(_0x190418){return _0x190418[_0xac4a('0xe')];});_0x2f062c(_0x488e3c);})[_0xac4a('0xa')](function(_0x26dbb8){_0x4855b6(_0x26dbb8);});});}function _0x4a2119(_0x402fff,_0x34d797,_0x23eb66){if(!_0x34d797)return Promise[_0xac4a('0xf')](null);return new Promise(function(_0x3e88e3,_0x387a54){return _0x58634e[_0xac4a('0x10')][_0xac4a('0x7')]({'where':{'sectionId':_0x34d797['id']},'raw':!![]})['then'](function(_0x5ac21e){if(_0x402fff[_0xac4a('0x6')]&&_0x402fff[_0xac4a('0x6')]!=='id'){_0x34d797[_0xac4a('0xd')]=_['map'](_0x5ac21e,function(_0x39e83e){return _0x39e83e[_0x402fff[_0xac4a('0x6')]];});}else{if(_0x23eb66===_0xac4a('0x11')){_0x34d797[_0xac4a('0xd')]=_[_0xac4a('0x9')](_0x5ac21e,function(_0x3e829c){return{'id':_0x3e829c[_0xac4a('0x12')],'type':_0x3e829c[_0xac4a('0x13')]};});}else{_0x34d797['associatedResources']=_[_0xac4a('0x9')](_0x5ac21e,function(_0x3204ad){return _0x3204ad['resourceId'];});}}_0x3e88e3(_0x34d797);})[_0xac4a('0xa')](function(_0x4169c0){_0x387a54(_0x4169c0);});});}function _0x3eacd3(_0x947d8e,_0x4d2d6c){var _0x1b7998={'parentSections':[]};switch(_0x947d8e[_0xac4a('0x14')]()){case _0xac4a('0x15'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x17');break;case _0xac4a('0x18'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x19');break;case _0xac4a('0x1a'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x1b');_0x1b7998[_0xac4a('0x1c')]=[{'name':_0xac4a('0x1d'),'field':_0xac4a('0xe'),'foreignKey':_0xac4a('0x1e')}];break;case _0xac4a('0x1f'):_0x1b7998['childModel']=_0xac4a('0x20');break;case _0xac4a('0x21'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x22');_0x1b7998[_0xac4a('0x1c')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xac4a('0x23'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x24');break;case'companies':_0x1b7998['childModel']=_0xac4a('0x25');break;case _0xac4a('0x26'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x27');break;case _0xac4a('0x28'):_0x1b7998['childModel']=_0xac4a('0x29');break;case'chatwebsites':_0x1b7998[_0xac4a('0x16')]='ChatWebsite';break;case _0xac4a('0x2a'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x2b');break;case _0xac4a('0x2c'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x2d');break;case _0xac4a('0x2e'):case _0xac4a('0x2f'):case _0xac4a('0x30'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x31');break;case _0xac4a('0x32'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x33');break;case'voicemails':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x34');break;case'voicerecordings':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x35');_0x1b7998['parentSections']=[{'name':'Agents','field':_0xac4a('0xe'),'foreignKey':_0xac4a('0x36'),'model':_0xac4a('0x37'),'filter':{'field':_0xac4a('0x38'),'value':['agent']}},{'name':_0xac4a('0x39'),'field':_0xac4a('0xe'),'foreignKey':'membername','model':_0xac4a('0x37'),'filter':{'field':_0xac4a('0x38'),'value':[_0xac4a('0x3a')]}},{'name':'VoiceQueues','field':_0xac4a('0xe'),'foreignKey':_0xac4a('0x3b'),'model':_0xac4a('0x3c'),'filter':{'field':'type','value':[_0xac4a('0x3d')]}},{'name':_0xac4a('0x3e'),'field':'name','foreignKey':'queue','model':_0xac4a('0x3c'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x1b7998['childModel']=_0xac4a('0x3f');break;case _0xac4a('0x40'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x41');break;case _0xac4a('0x42'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x43');break;case _0xac4a('0x44'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x45');break;case _0xac4a('0x46'):_0x1b7998[_0xac4a('0x16')]='MailQueue';break;case'mailaccounts':_0x1b7998['childModel']=_0xac4a('0x47');break;case _0xac4a('0x48'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x49');break;case _0xac4a('0x4a'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x4b');break;case _0xac4a('0x4c'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x4d');break;case'smsqueues':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x4e');break;case _0xac4a('0x4f'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x50');break;case'whatsappqueues':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x51');break;case'whatsappaccounts':_0x1b7998[_0xac4a('0x16')]='WhatsappAccount';break;case _0xac4a('0x52'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x53');break;case _0xac4a('0x54'):case _0xac4a('0x55'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x3c');if(_0x4d2d6c){_0x1b7998[_0xac4a('0x1c')]=[{'name':_0xac4a('0x56')},{'name':_0xac4a('0x3e')}];}break;case _0xac4a('0x57'):case _0xac4a('0x58'):case'telephones':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x37');if(_0x4d2d6c){_0x1b7998[_0xac4a('0x1c')]=[{'name':'Users','filter':{'field':_0xac4a('0x38'),'value':[_0xac4a('0x59'),'user']},'ignore':!![]},{'name':_0xac4a('0x5a')},{'name':'Telephones'}];}break;case _0xac4a('0x5b'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x5c');break;case'salesforceaccounts':_0x1b7998['childModel']=_0xac4a('0x5d');break;case'freshdeskaccounts':_0x1b7998[_0xac4a('0x16')]='FreshdeskAccount';break;case _0xac4a('0x5e'):_0x1b7998['childModel']=_0xac4a('0x5f');break;case _0xac4a('0x60'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x61');break;case'zohoaccounts':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x62');break;case _0xac4a('0x63'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x37');break;case _0xac4a('0x64'):_0x1b7998[_0xac4a('0x16')]='CannedAnswer';break;case _0xac4a('0x65'):_0x1b7998[_0xac4a('0x16')]='Disposition';break;case _0xac4a('0x66'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x67');break;case _0xac4a('0x68'):_0x1b7998['childModel']=_0xac4a('0x69');break;case _0xac4a('0x6a'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x6b');break;case _0xac4a('0x6c'):_0x1b7998['childModel']=_0xac4a('0x6d');break;case'sounds':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x6e');break;case'tags':_0x1b7998['childModel']=_0xac4a('0x6f');break;case _0xac4a('0x70'):_0x1b7998['childModel']=_0xac4a('0x71');break;case _0xac4a('0x72'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x73');break;case'trunks':_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x74');break;case _0xac4a('0x75'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x76');break;case _0xac4a('0x77'):_0x1b7998[_0xac4a('0x16')]='Plugin';break;case _0xac4a('0x78'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x11');_0x1b7998[_0xac4a('0x1c')]=[{'name':_0xac4a('0x79'),'field':'id','foreignKey':_0xac4a('0x7a')}];break;case _0xac4a('0x7b'):_0x1b7998[_0xac4a('0x16')]=_0xac4a('0x7c');break;}return _0x1b7998;}function _0x786d9(_0x3b175a,_0x38dd4f){var _0x400ac4=_0x3b175a[_0xac4a('0x7d')](0x0)[_0xac4a('0x7e')]()+_0x3b175a[_0xac4a('0x7f')](0x1);var _0x492aae={'type':_0x58634e[_0xac4a('0x80')]['QueryTypes'][_0xac4a('0x81')],'raw':!![]};return new Promise(function(_0x4b7f79,_0x2a30e8){var _0x50595a=squel[_0xac4a('0x82')]()['field']('ui.'+_0x400ac4+_0xac4a('0x83'),'id')[_0xac4a('0x6')](_0xac4a('0x84'))[_0xac4a('0x85')](_0xac4a('0x86')+_0x3b175a+_0xac4a('0x87'),'ui')['where'](_0xac4a('0x88'),_0x38dd4f['id']);return _0x58634e['sequelize'][_0xac4a('0x89')](_0x50595a['toString'](),_0x492aae)[_0xac4a('0x8')](function(_0x19ce2c){_0x38dd4f[_0x400ac4+_0xac4a('0x8a')]=_0x19ce2c;_0x4b7f79(_0x19ce2c);})[_0xac4a('0xa')](function(_0x429273){_0x2a30e8(_0x429273);});});}return _0x22469d[_0xac4a('0x8b')](_0xac4a('0x8c'),attributes,{'tableName':_0xac4a('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2ff07a){var _0x430dd0={'raw':![],'where':{}};var _0x42e503={};var _0x2498ad={'count':0x0,'rows':[]};var _0x1fe05a=_0x2ff07a[_0xac4a('0x89')][_0xac4a('0x8e')];var _0xf07212=_0x2ff07a[_0xac4a('0x89')]['mergeResources']||![];var _0xa90d71=_0x3eacd3(_0x1fe05a,_0xf07212);if(!_0xa90d71[_0xac4a('0x16')])throw new Error('Invalid\x20section\x20\x27'+_0x1fe05a+'\x27');var _0x3c3576=[{'name':_0x1fe05a}];if(!_[_0xac4a('0x8f')](_0xa90d71[_0xac4a('0x1c')]))_0x3c3576=_0xa90d71[_0xac4a('0x1c')];var _0x357cac=[];for(var _0x4d1440=0x0;_0x4d1440<_0x3c3576['length'];_0x4d1440++){_0x357cac[_0xac4a('0x90')](_0x58634e[_0xac4a('0x91')][_0xac4a('0x92')]({'where':{'userProfileId':_0x2ff07a[_0xac4a('0x93')]['id'],'name':_0x3c3576[_0x4d1440][_0xac4a('0xe')]},'raw':!![]}));}return Promise[_0xac4a('0x94')](_0x357cac)[_0xac4a('0x8')](function(_0x2988d7){var _0x44c60b=_[_0xac4a('0x5')](_0x2988d7,function(_0x278c09){return _0x278c09?_0x278c09:undefined;});var _0x49e5f5=_['filter'](_0x3c3576,[_0xac4a('0x95'),!![]]);var _0x1febff=_[_0xac4a('0x8f')](_0x44c60b)&&_[_0xac4a('0x8f')](_0x49e5f5)?null:_[_0xac4a('0x96')](_0x49e5f5,_0x44c60b);if(!_0x1febff)return null;var _0x283107=[];for(var _0x1d24bb=0x0;_0x1d24bb<_0x1febff[_0xac4a('0x97')];_0x1d24bb++){var _0x453d62=_[_0xac4a('0x92')](_0x3c3576,function(_0xb09b89){return _0x1febff[_0x1d24bb]?_0xb09b89[_0xac4a('0xe')]===_0x1febff[_0x1d24bb]['name']:null;});if(_0x453d62){if(_0x1febff[_0x1d24bb][_0xac4a('0x95')]){_0x283107[_0xac4a('0x90')](_0x47d4f6(_0xa90d71[_0xac4a('0x16')],_0x1febff[_0x1d24bb]));}else{if(!_0x1febff[_0x1d24bb][_0xac4a('0x98')]){_0x283107['push'](_0x4a2119(_0x453d62,_0x1febff[_0x1d24bb],_0xa90d71[_0xac4a('0x16')]));}else{if(_0x453d62['model']){_0x283107[_0xac4a('0x90')](_0x4d4acc(_0x453d62,_0x1febff[_0x1d24bb]));}}}}}return Promise[_0xac4a('0x94')](_0x283107);})['then'](function(_0x5bd95b){var _0x17eac2=_0x5bd95b;var _0x3b8974=null;if(_0x17eac2){_0x3b8974=_0x17eac2[_0xac4a('0x97')]===0x1?_0x17eac2[0x0]:null;}if(!_0x3b8974&&!_0x17eac2)return _0x2498ad;var _0x5dc373=_0x58634e[_0xa90d71[_0xac4a('0x16')]]['rawAttributes'];_0x42e503[_0xac4a('0xc')]=_['keys'](_0x5dc373);_0x42e503['query']=_[_0xac4a('0x99')](_0x2ff07a['query']);_0x42e503[_0xac4a('0x9a')]=_['intersection'](_0x42e503[_0xac4a('0xc')],_0x42e503[_0xac4a('0x89')]);_0x430dd0['attributes']=_[_0xac4a('0x9b')](_0x42e503['model'],qs[_0xac4a('0x9c')](_0x2ff07a[_0xac4a('0x89')]['fields']));_0x430dd0[_0xac4a('0x9d')]=_0x430dd0['attributes']['length']?_0x430dd0[_0xac4a('0x9d')]:_0x42e503['model'];if(!_0x2ff07a[_0xac4a('0x89')]['hasOwnProperty']('nolimit')){_0x430dd0[_0xac4a('0x9e')]=qs[_0xac4a('0x9e')](_0x2ff07a[_0xac4a('0x89')]['limit']);_0x430dd0['offset']=qs[_0xac4a('0x9f')](_0x2ff07a[_0xac4a('0x89')]['offset']);}_0x430dd0['order']=qs[_0xac4a('0xa0')](_0x2ff07a[_0xac4a('0x89')][_0xac4a('0xa0')]);_0x430dd0[_0xac4a('0xa1')]=qs[_0xac4a('0x9a')](_[_0xac4a('0xa2')](_0x2ff07a[_0xac4a('0x89')],_0x42e503[_0xac4a('0x9a')]));if(_0x2ff07a[_0xac4a('0x89')]['filter']){_0x430dd0[_0xac4a('0xa1')]=_[_0xac4a('0xa3')](_0x430dd0[_0xac4a('0xa1')],{'$or':_['map'](_0x5dc373,function(_0x1d310c){if(_0x1d310c[_0xac4a('0x13')][_0xac4a('0xa4')]!==_0xac4a('0xa5')){var _0x3d2b5c={};_0x3d2b5c[_0x1d310c['field']]={'$like':'%'+_0x2ff07a[_0xac4a('0x89')][_0xac4a('0x5')]+'%'};return _0x3d2b5c;}})});}var _0xc9d040=[];var _0x37e519=null;var _0x72c90c={};if(_0x3b8974){_0x37e519=_[_0xac4a('0x92')](_0x3c3576,[_0xac4a('0xe'),_0x3b8974['name']]);if(_0x37e519[_0xac4a('0x6')]){_0x72c90c={};if(_0xa90d71[_0xac4a('0x16')]===_0xac4a('0x11')){_0x72c90c[_0x37e519[_0xac4a('0xa6')]]=_[_0xac4a('0x9')](_0x3b8974[_0xac4a('0xd')],'id');}else{_0x72c90c[_0x37e519['foreignKey']]=_0x3b8974[_0xac4a('0xd')];}_0xc9d040[_0xac4a('0x90')](_0x72c90c);}else{_0x430dd0[_0xac4a('0xa1')]['id']=_0x3b8974[_0xac4a('0xd')];}}else{for(var _0x5bb389=0x0;_0x5bb389<_0x17eac2[_0xac4a('0x97')];_0x5bb389++){_0x37e519=_['find'](_0x3c3576,[_0xac4a('0xe'),_0x17eac2[_0x5bb389][_0xac4a('0xe')]]);if(_0x37e519['field']){_0x72c90c={};_0x72c90c[_0x37e519['foreignKey']]=_0x17eac2[_0x5bb389][_0xac4a('0xd')];_0xc9d040[_0xac4a('0x90')](_0x72c90c);}else{if(!_0x430dd0[_0xac4a('0xa1')]['id'])_0x430dd0['where']['id']=[];_0x17eac2[_0x5bb389][_0xac4a('0xd')]['forEach'](function(_0x2fd565){_0x430dd0[_0xac4a('0xa1')]['id'][_0xac4a('0x90')](_0x2fd565);});}}}if(!_[_0xac4a('0x8f')](_0xc9d040)){_0x430dd0[_0xac4a('0xa1')]=_['merge'](_0x430dd0['where'],{'$and':{'$or':_0xc9d040}});}_0x430dd0=_[_0xac4a('0xa3')]({},_0x430dd0,_0x2ff07a[_0xac4a('0xa7')]);if(_0x3b8974&&!_0x3b8974[_0xac4a('0x98')]&&_0xa90d71[_0xac4a('0x16')]===_0xac4a('0x11')){if(_0x2ff07a[_0xac4a('0x89')][_0xac4a('0xa8')]){_0x430dd0[_0xac4a('0xa9')]=[{'all':!![]}];}return _0x58634e[_0xa90d71['childModel']]['findAll'](_0x430dd0)[_0xac4a('0x8')](function(_0x31cc9a){var _0x247eee=[];_0x31cc9a[_0xac4a('0xaa')](function(_0x1353af){var _0x2ea4a4;switch(_0x1353af[_0xac4a('0xab')]){case _0xac4a('0xac'):_0x2ea4a4=_['find'](_0x3b8974['associatedResources'],function(_0x32fd0c){return _0x32fd0c['id']===_0x1353af[_0xac4a('0x7a')]&&_0x32fd0c[_0xac4a('0x13')]===_0xac4a('0xad');});break;case _0xac4a('0xae'):_0x2ea4a4=_[_0xac4a('0x92')](_0x3b8974[_0xac4a('0xd')],function(_0x51c3ef){return _0x51c3ef['id']===_0x1353af[_0xac4a('0x7a')]&&_0x51c3ef[_0xac4a('0x13')]===_0xac4a('0xaf');});break;}if(_0x2ea4a4)_0x247eee['push'](_0x1353af);});_0x2498ad[_0xac4a('0xb0')]=_0x247eee[_0xac4a('0x97')];_0x2498ad[_0xac4a('0xb1')]=_0x247eee;return _0x2498ad;});}else{return _0x58634e[_0xa90d71[_0xac4a('0x16')]][_0xac4a('0xb0')]({'where':_0x430dd0[_0xac4a('0xa1')]})[_0xac4a('0x8')](function(_0x2ef42a){_0x2498ad[_0xac4a('0xb0')]=_0x2ef42a;if(_0x2ff07a['query'][_0xac4a('0xa8')]){if(_0xa90d71['childModel']===_0xac4a('0x22')){_0x430dd0[_0xac4a('0xa9')]=[{'model':_0x58634e[_0xac4a('0x6f')],'as':_0xac4a('0xb2'),'attributes':['id',_0xac4a('0xe'),_0xac4a('0xb3')],'required':_0x2ff07a[_0xac4a('0x89')]['tag']?!![]:![]},{'model':_0x58634e[_0xac4a('0x6f')],'as':_0xac4a('0xb4'),'attributes':['id',_0xac4a('0xe'),_0xac4a('0xb3')],'through':_0x2ff07a[_0xac4a('0x89')]['tag']?{'attributes':[],'where':{'TagId':_0x2ff07a[_0xac4a('0x89')][_0xac4a('0xb5')]||undefined}}:{},'required':_0x2ff07a['query']['tag']?!![]:![]}];}else{_0x430dd0[_0xac4a('0xa9')]=[{'all':!![]}];}}return _0x58634e[_0xa90d71[_0xac4a('0x16')]]['findAll'](_0x430dd0);})[_0xac4a('0x8')](function(_0x217d8b){_0x2498ad[_0xac4a('0xb1')]=_0x217d8b;if(_0x1fe05a===_0xac4a('0x5a')&&_0x2ff07a[_0xac4a('0x89')][_0xac4a('0xb6')]==='true'){var _0xbdff4b=[];for(var _0x1eddc1=0x0;_0x1eddc1<_0x2498ad[_0xac4a('0xb1')]['length'];_0x1eddc1++){_0xbdff4b[_0xac4a('0x90')](_0x786d9(_0xac4a('0xb7'),_0x2498ad[_0xac4a('0xb1')][_0x1eddc1][_0xac4a('0xb8')]));_0xbdff4b[_0xac4a('0x90')](_0x786d9(_0xac4a('0xb9'),_0x2498ad['rows'][_0x1eddc1][_0xac4a('0xb8')]));_0xbdff4b[_0xac4a('0x90')](_0x786d9('fax',_0x2498ad[_0xac4a('0xb1')][_0x1eddc1]['dataValues']));_0xbdff4b[_0xac4a('0x90')](_0x786d9(_0xac4a('0xba'),_0x2498ad['rows'][_0x1eddc1][_0xac4a('0xb8')]));_0xbdff4b['push'](_0x786d9(_0xac4a('0xbb'),_0x2498ad['rows'][_0x1eddc1][_0xac4a('0xb8')]));_0xbdff4b[_0xac4a('0x90')](_0x786d9(_0xac4a('0xbc'),_0x2498ad[_0xac4a('0xb1')][_0x1eddc1][_0xac4a('0xb8')]));}return Promise[_0xac4a('0x94')](_0xbdff4b)[_0xac4a('0x8')](function(){return _0x2498ad;});}return _0x2498ad;});}});}}});}; \ No newline at end of file +var _0x687b=['chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceContext','VoiceMail','Agents','membername','User','role','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','type','chanspies','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Plugin','Reports','AnalyticMetric','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','nolimit','offset','order','sort','pick','merge','key','foreignKey','options','includeAll','include','findAll','forEach','reportType','reportId','custom','CustomReports','count','rows','color','tag','ThroughTags','openTabs','true','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','then','associatedResources','map','catch','model','name','UserProfileResource','field','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField'];(function(_0xb32c3f,_0x3fff3b){var _0x55eb6e=function(_0x12addb){while(--_0x12addb){_0xb32c3f['push'](_0xb32c3f['shift']());}};_0x55eb6e(++_0x3fff3b);}(_0x687b,0x14a));var _0xb687=function(_0x229a03,_0x36fefc){_0x229a03=_0x229a03-0x0;var _0x2d6e11=_0x687b[_0x229a03];return _0x2d6e11;};'use strict';var _=require(_0xb687('0x0'));var attributes=require(_0xb687('0x1'));var qs=require(_0xb687('0x2'));var squel=require(_0xb687('0x3'));module['exports']=function(_0x5e5f06){var _0x35069a=_0x5e5f06[_0xb687('0x4')];function _0x36c468(_0x31bd0d,_0x46e5b3){return new Promise(function(_0x194c55,_0x16ccf3){if(!_0x46e5b3)return _0x194c55(null);var _0xf43a1f=_0x46e5b3[_0xb687('0x5')]?{[_0x46e5b3[_0xb687('0x5')]['field']]:_0x46e5b3[_0xb687('0x5')][_0xb687('0x6')]}:undefined;return _0x35069a[_0x31bd0d]['findAll']({'where':_0xf43a1f,'raw':!![]})[_0xb687('0x7')](function(_0x21e3ab){_0x46e5b3[_0xb687('0x8')]=_[_0xb687('0x9')](_0x21e3ab,'id');_0x194c55(_0x46e5b3);})[_0xb687('0xa')](function(_0x309d84){_0x16ccf3(_0x309d84);});});}function _0x3e6271(_0xaf4727,_0x5e61e){return new Promise(function(_0x5103b9,_0x226e56){var _0xbeb5cc=_0xaf4727[_0xb687('0x5')]?{[_0xaf4727[_0xb687('0x5')]['field']]:_0xaf4727['filter'][_0xb687('0x6')]}:undefined;return _0x35069a[_0xaf4727[_0xb687('0xb')]]['findAll']({'where':_0xbeb5cc,'raw':!![]})[_0xb687('0x7')](function(_0x2f1ac0){_0x5e61e[_0xb687('0x8')]=_[_0xb687('0x9')](_0x2f1ac0,function(_0x838dd4){return _0x838dd4[_0xb687('0xc')];});_0x5103b9(_0x5e61e);})[_0xb687('0xa')](function(_0x141375){_0x226e56(_0x141375);});});}function _0x263085(_0x2c7a18,_0x25124a,_0x19bb29){if(!_0x25124a)return Promise['resolve'](null);return new Promise(function(_0x214b06,_0x328301){return _0x35069a[_0xb687('0xd')]['findAll']({'where':{'sectionId':_0x25124a['id']},'raw':!![]})['then'](function(_0x12eff1){if(_0x2c7a18[_0xb687('0xe')]&&_0x2c7a18[_0xb687('0xe')]!=='id'){_0x25124a['associatedResources']=_[_0xb687('0x9')](_0x12eff1,function(_0x481f1d){return _0x481f1d[_0x2c7a18[_0xb687('0xe')]];});}else{if(_0x19bb29===_0xb687('0xf')){_0x25124a[_0xb687('0x8')]=_[_0xb687('0x9')](_0x12eff1,function(_0x49d5a1){return{'id':_0x49d5a1[_0xb687('0x10')],'type':_0x49d5a1['type']};});}else{_0x25124a[_0xb687('0x8')]=_[_0xb687('0x9')](_0x12eff1,function(_0x274241){return _0x274241['resourceId'];});}}_0x214b06(_0x25124a);})[_0xb687('0xa')](function(_0x491623){_0x328301(_0x491623);});});}function _0xa95e91(_0x16cdcb,_0xbf6c58){var _0x38866c={'parentSections':[]};switch(_0x16cdcb[_0xb687('0x11')]()){case _0xb687('0x12'):_0x38866c['childModel']=_0xb687('0x13');break;case _0xb687('0x14'):_0x38866c[_0xb687('0x15')]=_0xb687('0x16');break;case _0xb687('0x17'):_0x38866c[_0xb687('0x15')]=_0xb687('0x18');_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x1a'),'field':_0xb687('0xc'),'foreignKey':'projectName'}];break;case _0xb687('0x1b'):_0x38866c[_0xb687('0x15')]=_0xb687('0x1c');break;case _0xb687('0x1d'):_0x38866c[_0xb687('0x15')]=_0xb687('0x1e');_0x38866c['parentSections']=[{'name':_0xb687('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0xb687('0x20'):_0x38866c[_0xb687('0x15')]=_0xb687('0x21');break;case _0xb687('0x22'):_0x38866c[_0xb687('0x15')]=_0xb687('0x23');break;case _0xb687('0x24'):_0x38866c['childModel']=_0xb687('0x25');break;case _0xb687('0x26'):_0x38866c[_0xb687('0x15')]=_0xb687('0x27');break;case _0xb687('0x28'):_0x38866c[_0xb687('0x15')]=_0xb687('0x29');break;case _0xb687('0x2a'):_0x38866c[_0xb687('0x15')]=_0xb687('0x2b');break;case _0xb687('0x2c'):_0x38866c['childModel']='FaxAccount';break;case _0xb687('0x2d'):case _0xb687('0x2e'):case _0xb687('0x2f'):_0x38866c[_0xb687('0x15')]='VoiceExtension';break;case'contexts':_0x38866c[_0xb687('0x15')]=_0xb687('0x30');break;case'voicemails':_0x38866c[_0xb687('0x15')]=_0xb687('0x31');break;case'voicerecordings':_0x38866c[_0xb687('0x15')]='VoiceRecording';_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x32'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x33'),'model':_0xb687('0x34'),'filter':{'field':_0xb687('0x35'),'value':['agent']}},{'name':_0xb687('0x36'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x33'),'model':_0xb687('0x34'),'filter':{'field':'role','value':[_0xb687('0x37')]}},{'name':_0xb687('0x38'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x39'),'model':_0xb687('0x3a'),'filter':{'field':'type','value':[_0xb687('0x3b')]}},{'name':_0xb687('0x3c'),'field':_0xb687('0xc'),'foreignKey':_0xb687('0x39'),'model':_0xb687('0x3a'),'filter':{'field':_0xb687('0x3d'),'value':['outbound']}}];break;case'musiconholds':_0x38866c[_0xb687('0x15')]='VoiceMusicOnHold';break;case _0xb687('0x3e'):_0x38866c[_0xb687('0x15')]='VoiceChanSpy';break;case _0xb687('0x3f'):_0x38866c[_0xb687('0x15')]='VoicePrefix';break;case _0xb687('0x40'):_0x38866c[_0xb687('0x15')]=_0xb687('0x41');break;case'mailqueues':_0x38866c[_0xb687('0x15')]=_0xb687('0x42');break;case _0xb687('0x43'):_0x38866c[_0xb687('0x15')]=_0xb687('0x44');break;case _0xb687('0x45'):_0x38866c[_0xb687('0x15')]='MailSubstatus';break;case _0xb687('0x46'):_0x38866c['childModel']='OpenchannelQueue';break;case _0xb687('0x47'):_0x38866c[_0xb687('0x15')]='OpenchannelAccount';break;case _0xb687('0x48'):_0x38866c['childModel']=_0xb687('0x49');break;case _0xb687('0x4a'):_0x38866c['childModel']=_0xb687('0x4b');break;case _0xb687('0x4c'):_0x38866c['childModel']=_0xb687('0x4d');break;case _0xb687('0x4e'):_0x38866c[_0xb687('0x15')]=_0xb687('0x4f');break;case _0xb687('0x50'):_0x38866c[_0xb687('0x15')]=_0xb687('0x51');break;case _0xb687('0x52'):case _0xb687('0x53'):_0x38866c[_0xb687('0x15')]=_0xb687('0x3a');if(_0xbf6c58){_0x38866c[_0xb687('0x19')]=[{'name':'VoiceQueues'},{'name':_0xb687('0x3c')}];}break;case'users':case _0xb687('0x54'):case _0xb687('0x55'):_0x38866c[_0xb687('0x15')]=_0xb687('0x34');if(_0xbf6c58){_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x56'),'filter':{'field':'role','value':['admin',_0xb687('0x57')]},'ignore':!![]},{'name':_0xb687('0x32')},{'name':_0xb687('0x36')}];}break;case _0xb687('0x58'):_0x38866c['childModel']=_0xb687('0x59');break;case _0xb687('0x5a'):_0x38866c[_0xb687('0x15')]=_0xb687('0x5b');break;case'freshdeskaccounts':_0x38866c[_0xb687('0x15')]=_0xb687('0x5c');break;case _0xb687('0x5d'):_0x38866c[_0xb687('0x15')]='SugarcrmAccount';break;case'deskaccounts':_0x38866c[_0xb687('0x15')]=_0xb687('0x5e');break;case _0xb687('0x5f'):_0x38866c['childModel']='ZohoAccount';break;case _0xb687('0x60'):_0x38866c[_0xb687('0x15')]=_0xb687('0x34');break;case _0xb687('0x61'):_0x38866c[_0xb687('0x15')]=_0xb687('0x62');break;case _0xb687('0x63'):_0x38866c[_0xb687('0x15')]='Disposition';break;case _0xb687('0x64'):_0x38866c[_0xb687('0x15')]=_0xb687('0x65');break;case'intervals':_0x38866c['childModel']='Interval';break;case'pauses':_0x38866c[_0xb687('0x15')]=_0xb687('0x66');break;case _0xb687('0x67'):_0x38866c[_0xb687('0x15')]=_0xb687('0x68');break;case _0xb687('0x69'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6a');break;case _0xb687('0x6b'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6c');break;case _0xb687('0x6d'):_0x38866c[_0xb687('0x15')]=_0xb687('0x6e');break;case _0xb687('0x6f'):_0x38866c[_0xb687('0x15')]=_0xb687('0x70');break;case'trunks':_0x38866c['childModel']=_0xb687('0x71');break;case _0xb687('0x72'):_0x38866c[_0xb687('0x15')]=_0xb687('0x73');break;case'plugins':_0x38866c[_0xb687('0x15')]=_0xb687('0x74');break;case'extractedreports':_0x38866c[_0xb687('0x15')]='AnalyticExtractedReport';_0x38866c[_0xb687('0x19')]=[{'name':_0xb687('0x75'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x38866c[_0xb687('0x15')]=_0xb687('0x76');break;}return _0x38866c;}function _0x5ea8fd(_0x1da4d1,_0x318be6){var _0x3cd364=_0x1da4d1['charAt'](0x0)[_0xb687('0x77')]()+_0x1da4d1['slice'](0x1);var _0xb20c08={'type':_0x35069a[_0xb687('0x78')][_0xb687('0x79')][_0xb687('0x7a')],'raw':!![]};return new Promise(function(_0x819b63,_0x49b403){var _0x4e163c=squel[_0xb687('0x7b')]()['field']('ui.'+_0x3cd364+'InteractionId','id')['field'](_0xb687('0x7c'))[_0xb687('0x7d')](_0xb687('0x7e')+_0x1da4d1+_0xb687('0x7f'),'ui')[_0xb687('0x80')](_0xb687('0x81'),_0x318be6['id']);return _0x35069a[_0xb687('0x82')][_0xb687('0x83')](_0x4e163c[_0xb687('0x84')](),_0xb20c08)[_0xb687('0x7')](function(_0x132e3a){_0x318be6[_0x3cd364+'OpenTabs']=_0x132e3a;_0x819b63(_0x132e3a);})['catch'](function(_0x2714c6){_0x49b403(_0x2714c6);});});}return _0x5e5f06['define'](_0xb687('0x85'),attributes,{'tableName':_0xb687('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1c031f){var _0x3ebaa2={'raw':![],'where':{}};var _0x3475cc={};var _0x4b5f75={'count':0x0,'rows':[]};var _0x22da49=_0x1c031f['query'][_0xb687('0x87')];var _0x293281=_0x1c031f[_0xb687('0x83')][_0xb687('0x88')]||![];var _0x3fe455=_0xa95e91(_0x22da49,_0x293281);if(!_0x3fe455[_0xb687('0x15')])throw new Error(_0xb687('0x89')+_0x22da49+'\x27');var _0x5deb7a=[{'name':_0x22da49}];if(!_[_0xb687('0x8a')](_0x3fe455[_0xb687('0x19')]))_0x5deb7a=_0x3fe455[_0xb687('0x19')];var _0x36bb4b=[];for(var _0x258caf=0x0;_0x258caf<_0x5deb7a['length'];_0x258caf++){_0x36bb4b[_0xb687('0x8b')](_0x35069a[_0xb687('0x8c')][_0xb687('0x8d')]({'where':{'userProfileId':_0x1c031f[_0xb687('0x8e')]['id'],'name':_0x5deb7a[_0x258caf][_0xb687('0xc')]},'raw':!![]}));}return Promise[_0xb687('0x8f')](_0x36bb4b)[_0xb687('0x7')](function(_0x377456){var _0x177ea4=_[_0xb687('0x5')](_0x377456,function(_0x1c167c){return _0x1c167c?_0x1c167c:undefined;});var _0x48838a=_[_0xb687('0x5')](_0x5deb7a,[_0xb687('0x90'),!![]]);var _0x1915da=_[_0xb687('0x8a')](_0x177ea4)&&_['isEmpty'](_0x48838a)?null:_[_0xb687('0x91')](_0x48838a,_0x177ea4);if(!_0x1915da)return null;var _0x1a6075=[];for(var _0x53b00a=0x0;_0x53b00a<_0x1915da[_0xb687('0x92')];_0x53b00a++){var _0x1acfed=_[_0xb687('0x8d')](_0x5deb7a,function(_0x5eeb75){return _0x1915da[_0x53b00a]?_0x5eeb75[_0xb687('0xc')]===_0x1915da[_0x53b00a][_0xb687('0xc')]:null;});if(_0x1acfed){if(_0x1915da[_0x53b00a]['ignore']){_0x1a6075[_0xb687('0x8b')](_0x36c468(_0x3fe455[_0xb687('0x15')],_0x1915da[_0x53b00a]));}else{if(!_0x1915da[_0x53b00a][_0xb687('0x93')]){_0x1a6075[_0xb687('0x8b')](_0x263085(_0x1acfed,_0x1915da[_0x53b00a],_0x3fe455['childModel']));}else{if(_0x1acfed[_0xb687('0xb')]){_0x1a6075[_0xb687('0x8b')](_0x3e6271(_0x1acfed,_0x1915da[_0x53b00a]));}}}}}return Promise['all'](_0x1a6075);})[_0xb687('0x7')](function(_0x1736ef){var _0x52285e=_0x1736ef;var _0x533837=null;if(_0x52285e){_0x533837=_0x52285e[_0xb687('0x92')]===0x1?_0x52285e[0x0]:null;}if(!_0x533837&&!_0x52285e)return _0x4b5f75;var _0x5370bc=_0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0x94')];_0x3475cc[_0xb687('0xb')]=_[_0xb687('0x95')](_0x5370bc);_0x3475cc[_0xb687('0x83')]=_[_0xb687('0x95')](_0x1c031f[_0xb687('0x83')]);_0x3475cc[_0xb687('0x96')]=_['intersection'](_0x3475cc[_0xb687('0xb')],_0x3475cc[_0xb687('0x83')]);_0x3ebaa2[_0xb687('0x97')]=_[_0xb687('0x98')](_0x3475cc[_0xb687('0xb')],qs[_0xb687('0x99')](_0x1c031f['query'][_0xb687('0x99')]));_0x3ebaa2[_0xb687('0x97')]=_0x3ebaa2['attributes'][_0xb687('0x92')]?_0x3ebaa2[_0xb687('0x97')]:_0x3475cc[_0xb687('0xb')];if(!_0x1c031f[_0xb687('0x83')]['hasOwnProperty'](_0xb687('0x9a'))){_0x3ebaa2['limit']=qs['limit'](_0x1c031f[_0xb687('0x83')]['limit']);_0x3ebaa2['offset']=qs[_0xb687('0x9b')](_0x1c031f['query'][_0xb687('0x9b')]);}_0x3ebaa2[_0xb687('0x9c')]=qs['sort'](_0x1c031f[_0xb687('0x83')][_0xb687('0x9d')]);_0x3ebaa2['where']=qs[_0xb687('0x96')](_[_0xb687('0x9e')](_0x1c031f[_0xb687('0x83')],_0x3475cc[_0xb687('0x96')]));if(_0x1c031f[_0xb687('0x83')][_0xb687('0x5')]){_0x3ebaa2[_0xb687('0x80')]=_[_0xb687('0x9f')](_0x3ebaa2[_0xb687('0x80')],{'$or':_[_0xb687('0x9')](_0x5370bc,function(_0x3a7a4a){if(_0x3a7a4a['type'][_0xb687('0xa0')]!=='VIRTUAL'){var _0x5a00c7={};_0x5a00c7[_0x3a7a4a[_0xb687('0xe')]]={'$like':'%'+_0x1c031f[_0xb687('0x83')][_0xb687('0x5')]+'%'};return _0x5a00c7;}})});}var _0xfecb8d=[];var _0x3a7339=null;var _0x594254={};if(_0x533837){_0x3a7339=_['find'](_0x5deb7a,[_0xb687('0xc'),_0x533837[_0xb687('0xc')]]);if(_0x3a7339[_0xb687('0xe')]){_0x594254={};if(_0x3fe455[_0xb687('0x15')]==='AnalyticExtractedReport'){_0x594254[_0x3a7339[_0xb687('0xa1')]]=_[_0xb687('0x9')](_0x533837[_0xb687('0x8')],'id');}else{_0x594254[_0x3a7339[_0xb687('0xa1')]]=_0x533837[_0xb687('0x8')];}_0xfecb8d[_0xb687('0x8b')](_0x594254);}else{_0x3ebaa2[_0xb687('0x80')]['id']=_0x533837[_0xb687('0x8')];}}else{for(var _0xfc0eee=0x0;_0xfc0eee<_0x52285e['length'];_0xfc0eee++){_0x3a7339=_[_0xb687('0x8d')](_0x5deb7a,[_0xb687('0xc'),_0x52285e[_0xfc0eee][_0xb687('0xc')]]);if(_0x3a7339[_0xb687('0xe')]){_0x594254={};_0x594254[_0x3a7339[_0xb687('0xa1')]]=_0x52285e[_0xfc0eee]['associatedResources'];_0xfecb8d[_0xb687('0x8b')](_0x594254);}else{if(!_0x3ebaa2[_0xb687('0x80')]['id'])_0x3ebaa2['where']['id']=[];_0x52285e[_0xfc0eee][_0xb687('0x8')]['forEach'](function(_0x32760c){_0x3ebaa2[_0xb687('0x80')]['id']['push'](_0x32760c);});}}}if(!_[_0xb687('0x8a')](_0xfecb8d)){_0x3ebaa2[_0xb687('0x80')]=_['merge'](_0x3ebaa2[_0xb687('0x80')],{'$and':{'$or':_0xfecb8d}});}_0x3ebaa2=_[_0xb687('0x9f')]({},_0x3ebaa2,_0x1c031f[_0xb687('0xa2')]);if(_0x533837&&!_0x533837[_0xb687('0x93')]&&_0x3fe455[_0xb687('0x15')]===_0xb687('0xf')){if(_0x1c031f['query'][_0xb687('0xa3')]){_0x3ebaa2[_0xb687('0xa4')]=[{'all':!![]}];}return _0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0xa5')](_0x3ebaa2)[_0xb687('0x7')](function(_0x465b81){var _0x233230=[];_0x465b81[_0xb687('0xa6')](function(_0x801bf9){var _0x361222;switch(_0x801bf9[_0xb687('0xa7')]){case'default':_0x361222=_[_0xb687('0x8d')](_0x533837['associatedResources'],function(_0x3d98e2){return _0x3d98e2['id']===_0x801bf9[_0xb687('0xa8')]&&_0x3d98e2['type']==='DefaultReports';});break;case _0xb687('0xa9'):_0x361222=_[_0xb687('0x8d')](_0x533837[_0xb687('0x8')],function(_0x33c3f4){return _0x33c3f4['id']===_0x801bf9[_0xb687('0xa8')]&&_0x33c3f4[_0xb687('0x3d')]===_0xb687('0xaa');});break;}if(_0x361222)_0x233230[_0xb687('0x8b')](_0x801bf9);});_0x4b5f75[_0xb687('0xab')]=_0x233230[_0xb687('0x92')];_0x4b5f75[_0xb687('0xac')]=_0x233230;return _0x4b5f75;});}else{return _0x35069a[_0x3fe455[_0xb687('0x15')]][_0xb687('0xab')]({'where':_0x3ebaa2[_0xb687('0x80')]})[_0xb687('0x7')](function(_0x3f45b7){_0x4b5f75['count']=_0x3f45b7;if(_0x1c031f['query'][_0xb687('0xa3')]){if(_0x3fe455['childModel']==='CmContact'){_0x3ebaa2[_0xb687('0xa4')]=[{'model':_0x35069a[_0xb687('0x6c')],'as':'Tags','attributes':['id',_0xb687('0xc'),_0xb687('0xad')],'required':_0x1c031f['query'][_0xb687('0xae')]?!![]:![]},{'model':_0x35069a[_0xb687('0x6c')],'as':_0xb687('0xaf'),'attributes':['id',_0xb687('0xc'),_0xb687('0xad')],'through':_0x1c031f[_0xb687('0x83')][_0xb687('0xae')]?{'attributes':[],'where':{'TagId':_0x1c031f[_0xb687('0x83')][_0xb687('0xae')]||undefined}}:{},'required':_0x1c031f['query'][_0xb687('0xae')]?!![]:![]}];}else{_0x3ebaa2[_0xb687('0xa4')]=[{'all':!![]}];}}return _0x35069a[_0x3fe455['childModel']][_0xb687('0xa5')](_0x3ebaa2);})['then'](function(_0x37af7e){_0x4b5f75[_0xb687('0xac')]=_0x37af7e;if(_0x22da49==='Agents'&&_0x1c031f[_0xb687('0x83')][_0xb687('0xb0')]===_0xb687('0xb1')){var _0x45d0ab=[];for(var _0x446b2b=0x0;_0x446b2b<_0x4b5f75[_0xb687('0xac')][_0xb687('0x92')];_0x446b2b++){_0x45d0ab['push'](_0x5ea8fd('chat',_0x4b5f75[_0xb687('0xac')][_0x446b2b]['dataValues']));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb2'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab['push'](_0x5ea8fd(_0xb687('0xb4'),_0x4b5f75[_0xb687('0xac')][_0x446b2b]['dataValues']));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb5'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb6'),_0x4b5f75['rows'][_0x446b2b][_0xb687('0xb3')]));_0x45d0ab[_0xb687('0x8b')](_0x5ea8fd(_0xb687('0xb7'),_0x4b5f75[_0xb687('0xac')][_0x446b2b][_0xb687('0xb3')]));}return Promise[_0xb687('0x8f')](_0x45d0ab)[_0xb687('0x7')](function(){return _0x4b5f75;});}return _0x4b5f75;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 7bc5697..835fb79 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 _0xf31b=['then','info','UserProfile,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xf31b,0x1a0));var _0xbf31=function(_0x365143,_0x3bb255){_0x365143=_0x365143-0x0;var _0x14ae01=_0xf31b[_0x365143];return _0x14ae01;};'use strict';var _=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var moment=require(_0xbf31('0x2'));var BPromise=require(_0xbf31('0x3'));var rs=require(_0xbf31('0x4'));var fs=require('fs');var Redis=require(_0xbf31('0x5'));var db=require(_0xbf31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf31('0x7'))(_0xbf31('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf31('0x9')]['http']({'port':0x232a});config[_0xbf31('0xa')]=_[_0xbf31('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbf31('0xc'))(new Redis(config['redis']));require(_0xbf31('0xd'))[_0xbf31('0xe')](socket);function respondWithRpcPromise(_0x11cdd6,_0x1cf8cc,_0x132946){return new BPromise(function(_0x77d991,_0x45df48){return client[_0xbf31('0xf')](_0x11cdd6,_0x132946)[_0xbf31('0x10')](function(_0x1e175d){logger[_0xbf31('0x11')](_0xbf31('0x12'),_0x1cf8cc,_0xbf31('0x13'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x1cf8cc,'request\x20sent',JSON['stringify'](_0x1e175d));if(_0x1e175d[_0xbf31('0x14')]){if(_0x1e175d[_0xbf31('0x14')][_0xbf31('0x15')]===0x1f4){logger[_0xbf31('0x14')]('UserProfile,\x20%s,\x20%s',_0x1cf8cc,_0x1e175d['error'][_0xbf31('0x16')]);return _0x45df48(_0x1e175d[_0xbf31('0x14')][_0xbf31('0x16')]);}logger[_0xbf31('0x14')](_0xbf31('0x12'),_0x1cf8cc,_0x1e175d['error'][_0xbf31('0x16')]);return _0x77d991(_0x1e175d['error']['message']);}else{logger[_0xbf31('0x11')](_0xbf31('0x12'),_0x1cf8cc,_0xbf31('0x13'));_0x77d991(_0x1e175d[_0xbf31('0x17')][_0xbf31('0x16')]);}})['catch'](function(_0x492ac3){logger[_0xbf31('0x14')](_0xbf31('0x12'),_0x1cf8cc,_0x492ac3);_0x45df48(_0x492ac3);});});} \ No newline at end of file +var _0x62f1=['register','request','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x403e7f,_0x4912f0){var _0x18eef0=function(_0x2b62d2){while(--_0x2b62d2){_0x403e7f['push'](_0x403e7f['shift']());}};_0x18eef0(++_0x4912f0);}(_0x62f1,0x112));var _0x162f=function(_0x48d12f,_0x5b66db){_0x48d12f=_0x48d12f-0x0;var _0x47fadc=_0x62f1[_0x48d12f];return _0x47fadc;};'use strict';var _=require(_0x162f('0x0'));var util=require('util');var moment=require(_0x162f('0x1'));var BPromise=require(_0x162f('0x2'));var rs=require(_0x162f('0x3'));var fs=require('fs');var Redis=require(_0x162f('0x4'));var db=require(_0x162f('0x5'))['db'];var utils=require(_0x162f('0x6'));var logger=require(_0x162f('0x7'))(_0x162f('0x8'));var config=require(_0x162f('0x9'));var jayson=require(_0x162f('0xa'));var client=jayson['client'][_0x162f('0xb')]({'port':0x232a});config[_0x162f('0xc')]=_['defaults'](config[_0x162f('0xc')],{'host':_0x162f('0xd'),'port':0x18eb});var socket=require(_0x162f('0xe'))(new Redis(config['redis']));require(_0x162f('0xf'))[_0x162f('0x10')](socket);function respondWithRpcPromise(_0x16938e,_0x2107d1,_0x54c970){return new BPromise(function(_0x1eeef3,_0x14aaa6){return client[_0x162f('0x11')](_0x16938e,_0x54c970)['then'](function(_0x577238){logger['info'](_0x162f('0x12'),_0x2107d1,'request\x20sent');logger[_0x162f('0x13')](_0x162f('0x14'),_0x2107d1,_0x162f('0x15'),JSON[_0x162f('0x16')](_0x577238));if(_0x577238['error']){if(_0x577238[_0x162f('0x17')][_0x162f('0x18')]===0x1f4){logger[_0x162f('0x17')](_0x162f('0x12'),_0x2107d1,_0x577238['error'][_0x162f('0x19')]);return _0x14aaa6(_0x577238['error'][_0x162f('0x19')]);}logger[_0x162f('0x17')](_0x162f('0x12'),_0x2107d1,_0x577238[_0x162f('0x17')]['message']);return _0x1eeef3(_0x577238['error'][_0x162f('0x19')]);}else{logger[_0x162f('0x1a')](_0x162f('0x12'),_0x2107d1,_0x162f('0x15'));_0x1eeef3(_0x577238[_0x162f('0x1b')][_0x162f('0x19')]);}})[_0x162f('0x1c')](function(_0x5723f3){logger[_0x162f('0x17')]('UserProfile,\x20%s,\x20%s',_0x2107d1,_0x5723f3);_0x14aaa6(_0x5723f3);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index a1bc7d7..a9e7f21 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 _0x860b=['update','emit','removeListener','length','userProfile:','./userProfile.events','save','remove'];(function(_0x31ba73,_0x3d51b9){var _0x1b04ae=function(_0x429fda){while(--_0x429fda){_0x31ba73['push'](_0x31ba73['shift']());}};_0x1b04ae(++_0x3d51b9);}(_0x860b,0x175));var _0xb860=function(_0x10623b,_0x4ca76a){_0x10623b=_0x10623b-0x0;var _0x2212e8=_0x860b[_0x10623b];return _0x2212e8;};'use strict';var UserProfileEvents=require(_0xb860('0x0'));var events=[_0xb860('0x1'),_0xb860('0x2'),_0xb860('0x3')];function createListener(_0x5b4e29,_0x5b1964){return function(_0x41fa66){_0x5b1964[_0xb860('0x4')](_0x5b4e29,_0x41fa66);};}function removeListener(_0x20ab7d,_0x4abda5){return function(){UserProfileEvents[_0xb860('0x5')](_0x20ab7d,_0x4abda5);};}exports['register']=function(_0x66428a){for(var _0x3c2e5e=0x0,_0x5a019a=events[_0xb860('0x6')];_0x3c2e5e<_0x5a019a;_0x3c2e5e++){var _0x43e0b5=events[_0x3c2e5e];var _0x23b35c=createListener(_0xb860('0x7')+_0x43e0b5,_0x66428a);UserProfileEvents['on'](_0x43e0b5,_0x23b35c);}}; \ No newline at end of file +var _0xc1ab=['remove','update','emit','removeListener','length','userProfile:','save'];(function(_0x322efb,_0x539552){var _0x4245ca=function(_0x456790){while(--_0x456790){_0x322efb['push'](_0x322efb['shift']());}};_0x4245ca(++_0x539552);}(_0xc1ab,0x18e));var _0xbc1a=function(_0xa9e51c,_0xf06e99){_0xa9e51c=_0xa9e51c-0x0;var _0x27c8f0=_0xc1ab[_0xa9e51c];return _0x27c8f0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xbc1a('0x0'),_0xbc1a('0x1'),_0xbc1a('0x2')];function createListener(_0x54a7ed,_0x4fcf6c){return function(_0x2609d9){_0x4fcf6c[_0xbc1a('0x3')](_0x54a7ed,_0x2609d9);};}function removeListener(_0x6cd66a,_0x348d64){return function(){UserProfileEvents[_0xbc1a('0x4')](_0x6cd66a,_0x348d64);};}exports['register']=function(_0x547105){for(var _0x959760=0x0,_0x425c87=events[_0xbc1a('0x5')];_0x959760<_0x425c87;_0x959760++){var _0x1d4367=events[_0x959760];var _0x163806=createListener(_0xbc1a('0x6')+_0x1d4367,_0x547105);UserProfileEvents['on'](_0x1d4367,_0x163806);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index cca1d38..0ef46ca 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 _0x58b7=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x147925,_0x3de269){var _0x1a8cc2=function(_0x310ab2){while(--_0x310ab2){_0x147925['push'](_0x147925['shift']());}};_0x1a8cc2(++_0x3de269);}(_0x58b7,0x18e));var _0x758b=function(_0xcc4c5f,_0xbe3942){_0xcc4c5f=_0xcc4c5f-0x0;var _0x3f3e38=_0x58b7[_0xcc4c5f];return _0x3f3e38;};'use strict';var multer=require(_0x758b('0x0'));var util=require(_0x758b('0x1'));var path=require(_0x758b('0x2'));var timeout=require('connect-timeout');var express=require(_0x758b('0x3'));var router=express[_0x758b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x758b('0x5'));var interaction=require(_0x758b('0x6'));var config=require(_0x758b('0x7'));var controller=require(_0x758b('0x8'));router[_0x758b('0x9')]('/',auth[_0x758b('0xa')](),controller['index']);router['get']('/describe',auth[_0x758b('0xa')](),controller[_0x758b('0xb')]);router[_0x758b('0x9')]('/:id',auth[_0x758b('0xa')](),controller[_0x758b('0xc')]);router[_0x758b('0xd')]('/',auth[_0x758b('0xa')](),controller[_0x758b('0xe')]);router[_0x758b('0xf')](_0x758b('0x10'),auth['isAuthenticated'](),controller[_0x758b('0x11')]);router['delete'](_0x758b('0x10'),auth[_0x758b('0xa')](),controller[_0x758b('0x12')]);module[_0x758b('0x13')]=router; \ No newline at end of file +var _0x74cf=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete','exports','multer','util','path','express'];(function(_0x1affc0,_0x14f15b){var _0x21637a=function(_0x321158){while(--_0x321158){_0x1affc0['push'](_0x1affc0['shift']());}};_0x21637a(++_0x14f15b);}(_0x74cf,0x1ea));var _0xf74c=function(_0x1a4134,_0x110ba3){_0x1a4134=_0x1a4134-0x0;var _0xce32ce=_0x74cf[_0x1a4134];return _0xce32ce;};'use strict';var multer=require(_0xf74c('0x0'));var util=require(_0xf74c('0x1'));var path=require(_0xf74c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf74c('0x3'));var router=express[_0xf74c('0x4')]();var fs_extra=require(_0xf74c('0x5'));var auth=require(_0xf74c('0x6'));var interaction=require(_0xf74c('0x7'));var config=require('../../config/environment');var controller=require(_0xf74c('0x8'));router[_0xf74c('0x9')]('/',auth[_0xf74c('0xa')](),controller[_0xf74c('0xb')]);router[_0xf74c('0x9')](_0xf74c('0xc'),auth['isAuthenticated'](),controller[_0xf74c('0xd')]);router['get'](_0xf74c('0xe'),auth['isAuthenticated'](),controller[_0xf74c('0xf')]);router['post']('/',auth[_0xf74c('0xa')](),controller[_0xf74c('0x10')]);router['put'](_0xf74c('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xf74c('0x11')](_0xf74c('0xe'),auth[_0xf74c('0xa')](),controller['destroy']);module[_0xf74c('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index e3df962..1c02f76 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 _0x4afb=['sequelize','exports','STRING'];(function(_0x326862,_0x29271d){var _0x2399ad=function(_0x3045a5){while(--_0x3045a5){_0x326862['push'](_0x326862['shift']());}};_0x2399ad(++_0x29271d);}(_0x4afb,0x99));var _0xb4af=function(_0x562b70,_0xb10d4a){_0x562b70=_0x562b70-0x0;var _0xec7fd5=_0x4afb[_0x562b70];return _0xec7fd5;};'use strict';var Sequelize=require(_0xb4af('0x0'));module[_0xb4af('0x1')]={'name':{'type':Sequelize[_0xb4af('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xe06c=['STRING','sequelize'];(function(_0x11d684,_0x4d4123){var _0x78a301=function(_0x1a1966){while(--_0x1a1966){_0x11d684['push'](_0x11d684['shift']());}};_0x78a301(++_0x4d4123);}(_0xe06c,0x1cb));var _0xce06=function(_0x39d839,_0x5d7c6e){_0x39d839=_0x39d839-0x0;var _0x33b598=_0xe06c[_0x39d839];return _0x33b598;};'use strict';var Sequelize=require(_0xce06('0x0'));module['exports']={'name':{'type':Sequelize[_0xce06('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 59950df..7569519 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 _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','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','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x1a37[_0x4c440b];return _0x2d48cf;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));}; \ No newline at end of file +var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x4c7d8b,_0x572388){var _0x187158=function(_0x5e956d){while(--_0x5e956d){_0x4c7d8b['push'](_0x4c7d8b['shift']());}};_0x187158(++_0x572388);}(_0x687b,0x14a));var _0xb687=function(_0x44799d,_0x26c23a){_0x44799d=_0x44799d-0x0;var _0x4f4a20=_0x687b[_0x44799d];return _0x4f4a20;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 21e6034..5ddfd6e 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 _0x5f57=['exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userProfileResource.attributes'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x5f57,0xf4));var _0x75f5=function(_0x16c316,_0x44e8e9){_0x16c316=_0x16c316-0x0;var _0x416b0c=_0x5f57[_0x16c316];return _0x416b0c;};'use strict';var _=require(_0x75f5('0x0'));var util=require(_0x75f5('0x1'));var logger=require(_0x75f5('0x2'))(_0x75f5('0x3'));var moment=require(_0x75f5('0x4'));var BPromise=require(_0x75f5('0x5'));var rp=require(_0x75f5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x75f5('0x7'));module[_0x75f5('0x8')]=function(_0x621df7,_0x33cbd9){return _0x621df7[_0x75f5('0x9')](_0x75f5('0xa'),attributes,{'tableName':_0x75f5('0xb'),'paranoid':![],'indexes':[{'name':_0x75f5('0xc'),'fields':['resourceId',_0x75f5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa4a=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','moment','bluebird','request-promise','./userProfileResource.attributes','exports','define','UserProfileResource'];(function(_0x4e88aa,_0x437f7a){var _0x15c210=function(_0x194a40){while(--_0x194a40){_0x4e88aa['push'](_0x4e88aa['shift']());}};_0x15c210(++_0x437f7a);}(_0xaa4a,0x1b1));var _0xaaa4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaa4a[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xaaa4('0x0'));var util=require('util');var logger=require(_0xaaa4('0x1'))('api');var moment=require(_0xaaa4('0x2'));var BPromise=require(_0xaaa4('0x3'));var rp=require(_0xaaa4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaaa4('0x5'));module[_0xaaa4('0x6')]=function(_0x1aca27,_0x5bda75){return _0x1aca27[_0xaaa4('0x7')](_0xaaa4('0x8'),attributes,{'tableName':_0xaaa4('0x9'),'paranoid':![],'indexes':[{'name':_0xaaa4('0xa'),'fields':[_0xaaa4('0xb'),_0xaaa4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 8b53360..6bc4363 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 _0x777d=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x552d3b,_0x60cd4){var _0x3584a6=function(_0xc7d577){while(--_0xc7d577){_0x552d3b['push'](_0x552d3b['shift']());}};_0x3584a6(++_0x60cd4);}(_0x777d,0xe9));var _0xd777=function(_0x1e271f,_0xf14504){_0x1e271f=_0x1e271f-0x0;var _0x2b2ac5=_0x777d[_0x1e271f];return _0x2b2ac5;};'use strict';var _=require('lodash');var util=require(_0xd777('0x0'));var moment=require(_0xd777('0x1'));var BPromise=require(_0xd777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd777('0x3'));var db=require(_0xd777('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd777('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd777('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7c954,_0x5d1a5f,_0x57d67f){return new BPromise(function(_0x49d55d,_0x197296){return client[_0xd777('0x7')](_0xc7c954,_0x57d67f)[_0xd777('0x8')](function(_0x25450d){logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));logger[_0xd777('0xc')](_0xd777('0xd'),_0x5d1a5f,_0xd777('0xb'),JSON[_0xd777('0xe')](_0x25450d));if(_0x25450d[_0xd777('0xf')]){if(_0x25450d[_0xd777('0xf')]['code']===0x1f4){logger['error'](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x197296(_0x25450d[_0xd777('0xf')][_0xd777('0x10')]);}logger[_0xd777('0xf')](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x49d55d(_0x25450d['error'][_0xd777('0x10')]);}else{logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));_0x49d55d(_0x25450d[_0xd777('0x11')]['message']);}})[_0xd777('0x12')](function(_0x4b3d52){logger[_0xd777('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x5d1a5f,_0x4b3d52);_0x197296(_0x4b3d52);});});} \ No newline at end of file +var _0xc89f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring'];(function(_0x2f0533,_0xb90e1e){var _0xbec36b=function(_0x1e81f6){while(--_0x1e81f6){_0x2f0533['push'](_0x2f0533['shift']());}};_0xbec36b(++_0xb90e1e);}(_0xc89f,0xf9));var _0xfc89=function(_0x185e12,_0x5aa1ee){_0x185e12=_0x185e12-0x0;var _0x1562f1=_0xc89f[_0x185e12];return _0x1562f1;};'use strict';var _=require(_0xfc89('0x0'));var util=require(_0xfc89('0x1'));var moment=require('moment');var BPromise=require(_0xfc89('0x2'));var rs=require(_0xfc89('0x3'));var fs=require('fs');var Redis=require(_0xfc89('0x4'));var db=require(_0xfc89('0x5'))['db'];var utils=require(_0xfc89('0x6'));var logger=require(_0xfc89('0x7'))(_0xfc89('0x8'));var config=require(_0xfc89('0x9'));var jayson=require(_0xfc89('0xa'));var client=jayson[_0xfc89('0xb')][_0xfc89('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42c762,_0x54a735,_0x33bb9c){return new BPromise(function(_0x39ee36,_0x3c1f75){return client['request'](_0x42c762,_0x33bb9c)['then'](function(_0x166d5b){logger[_0xfc89('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x54a735,'request\x20sent');logger[_0xfc89('0xe')](_0xfc89('0xf'),_0x54a735,'request\x20sent',JSON['stringify'](_0x166d5b));if(_0x166d5b[_0xfc89('0x10')]){if(_0x166d5b[_0xfc89('0x10')][_0xfc89('0x11')]===0x1f4){logger['error'](_0xfc89('0x12'),_0x54a735,_0x166d5b[_0xfc89('0x10')][_0xfc89('0x13')]);return _0x3c1f75(_0x166d5b[_0xfc89('0x10')][_0xfc89('0x13')]);}logger[_0xfc89('0x10')](_0xfc89('0x12'),_0x54a735,_0x166d5b[_0xfc89('0x10')]['message']);return _0x39ee36(_0x166d5b[_0xfc89('0x10')][_0xfc89('0x13')]);}else{logger[_0xfc89('0xd')](_0xfc89('0x12'),_0x54a735,_0xfc89('0x14'));_0x39ee36(_0x166d5b[_0xfc89('0x15')][_0xfc89('0x13')]);}})[_0xfc89('0x16')](function(_0x933ecc){logger[_0xfc89('0x10')](_0xfc89('0x12'),_0x54a735,_0x933ecc);_0x3c1f75(_0x933ecc);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index d4ec398..ea27067 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 _0x241f=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x490a13,_0x588d58){var _0x31595f=function(_0x3990bc){while(--_0x3990bc){_0x490a13['push'](_0x490a13['shift']());}};_0x31595f(++_0x588d58);}(_0x241f,0x151));var _0xf241=function(_0x138b2c,_0x142181){_0x138b2c=_0x138b2c-0x0;var _0xa8b921=_0x241f[_0x138b2c];return _0xa8b921;};'use strict';var multer=require(_0xf241('0x0'));var util=require(_0xf241('0x1'));var path=require(_0xf241('0x2'));var timeout=require(_0xf241('0x3'));var express=require(_0xf241('0x4'));var router=express['Router']();var fs_extra=require(_0xf241('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf241('0x6'));var config=require(_0xf241('0x7'));var controller=require(_0xf241('0x8'));router[_0xf241('0x9')]('/',auth[_0xf241('0xa')](),controller['index']);router[_0xf241('0x9')](_0xf241('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf241('0x9')](_0xf241('0xc'),auth[_0xf241('0xa')](),controller[_0xf241('0xd')]);router[_0xf241('0xe')]('/',auth[_0xf241('0xa')](),controller[_0xf241('0xf')]);router[_0xf241('0x10')](_0xf241('0xc'),auth[_0xf241('0xa')](),controller['update']);router[_0xf241('0x11')](_0xf241('0xc'),auth['isAuthenticated'](),controller[_0xf241('0x12')]);module['exports']=router; \ No newline at end of file +var _0x38fc=['update','delete','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put'];(function(_0xecd2ca,_0x1efd43){var _0x5488f0=function(_0x4419c0){while(--_0x4419c0){_0xecd2ca['push'](_0xecd2ca['shift']());}};_0x5488f0(++_0x1efd43);}(_0x38fc,0x7b));var _0xc38f=function(_0x542b1a,_0xe14d53){_0x542b1a=_0x542b1a-0x0;var _0x227da8=_0x38fc[_0x542b1a];return _0x227da8;};'use strict';var multer=require(_0xc38f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc38f('0x1'));var express=require('express');var router=express[_0xc38f('0x2')]();var fs_extra=require(_0xc38f('0x3'));var auth=require(_0xc38f('0x4'));var interaction=require(_0xc38f('0x5'));var config=require(_0xc38f('0x6'));var controller=require(_0xc38f('0x7'));router['get']('/',auth[_0xc38f('0x8')](),controller[_0xc38f('0x9')]);router[_0xc38f('0xa')]('/describe',auth[_0xc38f('0x8')](),controller[_0xc38f('0xb')]);router[_0xc38f('0xa')](_0xc38f('0xc'),auth[_0xc38f('0x8')](),controller[_0xc38f('0xd')]);router[_0xc38f('0xe')]('/',auth[_0xc38f('0x8')](),controller[_0xc38f('0xf')]);router[_0xc38f('0x10')](_0xc38f('0xc'),auth[_0xc38f('0x8')](),controller[_0xc38f('0x11')]);router[_0xc38f('0x12')](_0xc38f('0xc'),auth[_0xc38f('0x8')](),controller['destroy']);module[_0xc38f('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 7384980..44e1bbd 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 _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x392fb0,_0xe5ad08){var _0x16a1f5=function(_0x385484){while(--_0x385484){_0x392fb0['push'](_0x392fb0['shift']());}};_0x16a1f5(++_0xe5ad08);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}}; \ No newline at end of file +var _0x8f4c=['setDataValue','join','crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x509e63,_0x53d3c7){var _0x1fe50f=function(_0x587f8c){while(--_0x587f8c){_0x509e63['push'](_0x509e63['shift']());}};_0x1fe50f(++_0x53d3c7);}(_0x8f4c,0x113));var _0xc8f4=function(_0x92da37,_0x28d8a8){_0x92da37=_0x92da37-0x0;var _0x1a595c=_0x8f4c[_0x92da37];return _0x1a595c;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'name':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc8f4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc8f4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc8f4('0x2')],'set':function(_0x47350d){this[_0xc8f4('0x5')]('crudPermissions',_0x47350d?_0x47350d[_0xc8f4('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0xc8f4('0x7'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a42da31..f8e6741 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 _0x2c45=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','offset','limit','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','UserProfileSection','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','merge','find','create','body','describe'];(function(_0x4cff3a,_0x362902){var _0x35b3c2=function(_0x407bc9){while(--_0x407bc9){_0x4cff3a['push'](_0x4cff3a['shift']());}};_0x35b3c2(++_0x362902);}(_0x2c45,0x16d));var _0x52c4=function(_0x277d36,_0x16d692){_0x277d36=_0x277d36-0x0;var _0x5a1066=_0x2c45[_0x277d36];return _0x5a1066;};'use strict';var emlformat=require(_0x52c4('0x0'));var rimraf=require(_0x52c4('0x1'));var zipdir=require(_0x52c4('0x2'));var jsonpatch=require(_0x52c4('0x3'));var rp=require('request-promise');var moment=require(_0x52c4('0x4'));var BPromise=require(_0x52c4('0x5'));var Mustache=require(_0x52c4('0x6'));var util=require(_0x52c4('0x7'));var path=require(_0x52c4('0x8'));var sox=require(_0x52c4('0x9'));var csv=require(_0x52c4('0xa'));var ejs=require(_0x52c4('0xb'));var fs=require('fs');var fs_extra=require(_0x52c4('0xc'));var _=require('lodash');var squel=require(_0x52c4('0xd'));var crypto=require('crypto');var jsforce=require(_0x52c4('0xe'));var deskjs=require(_0x52c4('0xf'));var toCsv=require(_0x52c4('0xa'));var querystring=require(_0x52c4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x52c4('0x11'));var qs=require(_0x52c4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52c4('0x13'));var logger=require('../../config/logger')(_0x52c4('0x14'));var utils=require(_0x52c4('0x15'));var config=require(_0x52c4('0x16'));var licenseUtil=require(_0x52c4('0x17'));var db=require(_0x52c4('0x18'))['db'];function respondWithStatusCode(_0x29ffbb,_0x42e517){_0x42e517=_0x42e517||0xcc;return function(_0x4d354d){if(_0x4d354d){return _0x29ffbb['sendStatus'](_0x42e517);}return _0x29ffbb['status'](_0x42e517)[_0x52c4('0x19')]();};}function respondWithResult(_0x510c19,_0x356b36){_0x356b36=_0x356b36||0xc8;return function(_0x10e2b2){if(_0x10e2b2){return _0x510c19[_0x52c4('0x1a')](_0x356b36)['json'](_0x10e2b2);}};}function respondWithFilteredResult(_0x49d197,_0x1c4d76){return function(_0x25d3f0){if(_0x25d3f0){var _0x47a777=typeof _0x1c4d76['offset']===_0x52c4('0x1b')&&typeof _0x1c4d76['limit']===_0x52c4('0x1b');var _0x299729=_0x25d3f0['count'];var _0x1b8faf=_0x47a777?0x0:_0x1c4d76[_0x52c4('0x1c')];var _0x2351a0=_0x47a777?_0x25d3f0['count']:_0x1c4d76['offset']+_0x1c4d76[_0x52c4('0x1d')];var _0x3c24bb;if(_0x2351a0>=_0x299729){_0x2351a0=_0x299729;_0x3c24bb=0xc8;}else{_0x3c24bb=0xce;}_0x49d197[_0x52c4('0x1a')](_0x3c24bb);return _0x49d197[_0x52c4('0x1e')](_0x52c4('0x1f'),_0x1b8faf+'-'+_0x2351a0+'/'+_0x299729)[_0x52c4('0x20')](_0x25d3f0);}return null;};}function patchUpdates(_0x5b408e){return function(_0x587245){try{jsonpatch[_0x52c4('0x21')](_0x587245,_0x5b408e,!![]);}catch(_0x2ac612){return BPromise[_0x52c4('0x22')](_0x2ac612);}return _0x587245['save']();};}function saveUpdates(_0x4af18b,_0x444e90){return function(_0x5e9703){if(_0x5e9703){return _0x5e9703['update'](_0x4af18b)[_0x52c4('0x23')](function(_0xf52488){return _0xf52488;});}return null;};}function removeEntity(_0x1dd3d9,_0xd53044){return function(_0x43e0f0){if(_0x43e0f0){return _0x43e0f0[_0x52c4('0x24')]()['then'](function(){_0x1dd3d9[_0x52c4('0x1a')](0xcc)[_0x52c4('0x19')]();});}};}function handleEntityNotFound(_0x5b3adc,_0x41f35e){return function(_0x10e8d8){if(!_0x10e8d8){_0x5b3adc[_0x52c4('0x25')](0x194);}return _0x10e8d8;};}function handleError(_0x2a86f8,_0x44ca82){_0x44ca82=_0x44ca82||0x1f4;return function(_0x3ce8d4){logger[_0x52c4('0x26')](_0x3ce8d4[_0x52c4('0x27')]);if(_0x3ce8d4[_0x52c4('0x28')]){delete _0x3ce8d4['name'];}_0x2a86f8['status'](_0x44ca82)['send'](_0x3ce8d4);};}exports['index']=function(_0x9f69d6,_0x4c4ba9){var _0xbea7fa={},_0x155df8={},_0x268d2d={'count':0x0,'rows':[]};var _0x180dd4=_['map'](db[_0x52c4('0x29')]['rawAttributes'],function(_0x428948){return{'name':_0x428948[_0x52c4('0x2a')],'type':_0x428948[_0x52c4('0x2b')][_0x52c4('0x2c')]};});_0x155df8[_0x52c4('0x2d')]=_[_0x52c4('0x2e')](_0x180dd4,_0x52c4('0x28'));_0x155df8['query']=_[_0x52c4('0x2f')](_0x9f69d6[_0x52c4('0x30')]);_0x155df8['filters']=_[_0x52c4('0x31')](_0x155df8[_0x52c4('0x2d')],_0x155df8[_0x52c4('0x30')]);_0xbea7fa[_0x52c4('0x32')]=_['intersection'](_0x155df8[_0x52c4('0x2d')],qs[_0x52c4('0x33')](_0x9f69d6['query'][_0x52c4('0x33')]));_0xbea7fa[_0x52c4('0x32')]=_0xbea7fa['attributes'][_0x52c4('0x34')]?_0xbea7fa[_0x52c4('0x32')]:_0x155df8[_0x52c4('0x2d')];if(!_0x9f69d6[_0x52c4('0x30')][_0x52c4('0x35')]('nolimit')){_0xbea7fa[_0x52c4('0x1d')]=qs[_0x52c4('0x1d')](_0x9f69d6[_0x52c4('0x30')][_0x52c4('0x1d')]);_0xbea7fa['offset']=qs[_0x52c4('0x1c')](_0x9f69d6['query'][_0x52c4('0x1c')]);}_0xbea7fa['order']=qs[_0x52c4('0x36')](_0x9f69d6['query'][_0x52c4('0x36')]);_0xbea7fa[_0x52c4('0x37')]=qs[_0x52c4('0x38')](_['pick'](_0x9f69d6[_0x52c4('0x30')],_0x155df8[_0x52c4('0x38')]),_0x180dd4);if(_0x9f69d6[_0x52c4('0x30')]['filter']){_0xbea7fa['where']=_['merge'](_0xbea7fa['where'],{'$or':_[_0x52c4('0x2e')](_0x180dd4,function(_0xb2b3b6){if(_0xb2b3b6['type']!==_0x52c4('0x39')){var _0x2eddb2={};_0x2eddb2[_0xb2b3b6[_0x52c4('0x28')]]={'$like':'%'+_0x9f69d6[_0x52c4('0x30')][_0x52c4('0x3a')]+'%'};return _0x2eddb2;}})});}_0xbea7fa=_['merge']({},_0xbea7fa,_0x9f69d6[_0x52c4('0x3b')]);var _0x3a3c25={'where':_0xbea7fa[_0x52c4('0x37')]};return db[_0x52c4('0x29')][_0x52c4('0x3c')](_0x3a3c25)[_0x52c4('0x23')](function(_0x512bf5){_0x268d2d[_0x52c4('0x3c')]=_0x512bf5;if(_0x9f69d6[_0x52c4('0x30')][_0x52c4('0x3d')]){_0xbea7fa[_0x52c4('0x3e')]=[{'all':!![]}];}return db[_0x52c4('0x29')][_0x52c4('0x3f')](_0xbea7fa);})[_0x52c4('0x23')](function(_0x5a014e){_0x268d2d[_0x52c4('0x40')]=_0x5a014e;return _0x268d2d;})[_0x52c4('0x23')](respondWithFilteredResult(_0x4c4ba9,_0xbea7fa))[_0x52c4('0x41')](handleError(_0x4c4ba9,null));};exports[_0x52c4('0x42')]=function(_0x1bba16,_0x19101c){var _0x4836aa={'raw':![],'where':{'id':_0x1bba16['params']['id']}},_0x119fdc={};_0x119fdc['model']=_['keys'](db[_0x52c4('0x29')][_0x52c4('0x43')]);_0x119fdc[_0x52c4('0x30')]=_[_0x52c4('0x2f')](_0x1bba16['query']);_0x119fdc[_0x52c4('0x38')]=_[_0x52c4('0x31')](_0x119fdc['model'],_0x119fdc['query']);_0x4836aa[_0x52c4('0x32')]=_['intersection'](_0x119fdc[_0x52c4('0x2d')],qs['fields'](_0x1bba16['query'][_0x52c4('0x33')]));_0x4836aa['attributes']=_0x4836aa['attributes'][_0x52c4('0x34')]?_0x4836aa[_0x52c4('0x32')]:_0x119fdc[_0x52c4('0x2d')];if(_0x1bba16[_0x52c4('0x30')]['includeAll']){_0x4836aa['include']=[{'all':!![]}];}_0x4836aa=_[_0x52c4('0x44')]({},_0x4836aa,_0x1bba16['options']);return db['UserProfileSection'][_0x52c4('0x45')](_0x4836aa)[_0x52c4('0x23')](handleEntityNotFound(_0x19101c,null))[_0x52c4('0x23')](respondWithResult(_0x19101c,null))[_0x52c4('0x41')](handleError(_0x19101c,null));};exports[_0x52c4('0x46')]=function(_0x5aceaf,_0x477fc9){return db[_0x52c4('0x29')][_0x52c4('0x46')](_0x5aceaf[_0x52c4('0x47')],{})[_0x52c4('0x23')](respondWithResult(_0x477fc9,0xc9))['catch'](handleError(_0x477fc9,null));};exports['update']=function(_0x55edaf,_0x333f28){if(_0x55edaf[_0x52c4('0x47')]['id']){delete _0x55edaf['body']['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x55edaf['params']['id']}})[_0x52c4('0x23')](handleEntityNotFound(_0x333f28,null))[_0x52c4('0x23')](saveUpdates(_0x55edaf['body'],null))[_0x52c4('0x23')](respondWithResult(_0x333f28,null))['catch'](handleError(_0x333f28,null));};exports['destroy']=function(_0x141aea,_0x2b8b16){return db[_0x52c4('0x29')]['find']({'where':{'id':_0x141aea['params']['id']}})[_0x52c4('0x23')](handleEntityNotFound(_0x2b8b16,null))[_0x52c4('0x23')](removeEntity(_0x2b8b16,null))[_0x52c4('0x41')](handleError(_0x2b8b16,null));};exports[_0x52c4('0x48')]=function(_0x55adb8,_0x1d2159){return db[_0x52c4('0x29')][_0x52c4('0x48')]()['then'](respondWithResult(_0x1d2159,null))[_0x52c4('0x41')](handleError(_0x1d2159,null));}; \ No newline at end of file +var _0x946c=['filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','params','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x946c,0x1a8));var _0xc946=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x946c[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc946('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc946('0x1'));var rp=require(_0xc946('0x2'));var moment=require(_0xc946('0x3'));var BPromise=require(_0xc946('0x4'));var Mustache=require(_0xc946('0x5'));var util=require(_0xc946('0x6'));var path=require(_0xc946('0x7'));var sox=require(_0xc946('0x8'));var csv=require('to-csv');var ejs=require(_0xc946('0x9'));var fs=require('fs');var fs_extra=require(_0xc946('0xa'));var _=require(_0xc946('0xb'));var squel=require(_0xc946('0xc'));var crypto=require(_0xc946('0xd'));var jsforce=require(_0xc946('0xe'));var deskjs=require(_0xc946('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc946('0x10'));var Papa=require(_0xc946('0x11'));var Redis=require(_0xc946('0x12'));var authService=require(_0xc946('0x13'));var qs=require(_0xc946('0x14'));var as=require(_0xc946('0x15'));var hardwareService=require(_0xc946('0x16'));var logger=require(_0xc946('0x17'))(_0xc946('0x18'));var utils=require(_0xc946('0x19'));var config=require(_0xc946('0x1a'));var licenseUtil=require(_0xc946('0x1b'));var db=require(_0xc946('0x1c'))['db'];function respondWithStatusCode(_0x218059,_0x15ce7c){_0x15ce7c=_0x15ce7c||0xcc;return function(_0xf29d91){if(_0xf29d91){return _0x218059['sendStatus'](_0x15ce7c);}return _0x218059[_0xc946('0x1d')](_0x15ce7c)[_0xc946('0x1e')]();};}function respondWithResult(_0x29c9f0,_0x29d478){_0x29d478=_0x29d478||0xc8;return function(_0x51634d){if(_0x51634d){return _0x29c9f0[_0xc946('0x1d')](_0x29d478)[_0xc946('0x1f')](_0x51634d);}};}function respondWithFilteredResult(_0x5eb0c8,_0x51bd6f){return function(_0x37494f){if(_0x37494f){var _0x54d503=typeof _0x51bd6f[_0xc946('0x20')]==='undefined'&&typeof _0x51bd6f[_0xc946('0x21')]===_0xc946('0x22');var _0x492590=_0x37494f['count'];var _0x1973fc=_0x54d503?0x0:_0x51bd6f[_0xc946('0x20')];var _0x57d91d=_0x54d503?_0x37494f['count']:_0x51bd6f[_0xc946('0x20')]+_0x51bd6f['limit'];var _0x45866a;if(_0x57d91d>=_0x492590){_0x57d91d=_0x492590;_0x45866a=0xc8;}else{_0x45866a=0xce;}_0x5eb0c8['status'](_0x45866a);return _0x5eb0c8[_0xc946('0x23')](_0xc946('0x24'),_0x1973fc+'-'+_0x57d91d+'/'+_0x492590)[_0xc946('0x1f')](_0x37494f);}return null;};}function patchUpdates(_0x362661){return function(_0x41826d){try{jsonpatch[_0xc946('0x25')](_0x41826d,_0x362661,!![]);}catch(_0x58fbaf){return BPromise[_0xc946('0x26')](_0x58fbaf);}return _0x41826d[_0xc946('0x27')]();};}function saveUpdates(_0x3f55eb,_0x35c2a7){return function(_0x49dccf){if(_0x49dccf){return _0x49dccf['update'](_0x3f55eb)[_0xc946('0x28')](function(_0x200a95){return _0x200a95;});}return null;};}function removeEntity(_0x444b82,_0x9697a1){return function(_0x37fbc6){if(_0x37fbc6){return _0x37fbc6[_0xc946('0x29')]()['then'](function(){_0x444b82['status'](0xcc)[_0xc946('0x1e')]();});}};}function handleEntityNotFound(_0x78f927,_0x5ebb20){return function(_0x122239){if(!_0x122239){_0x78f927[_0xc946('0x2a')](0x194);}return _0x122239;};}function handleError(_0x23d27b,_0x74c459){_0x74c459=_0x74c459||0x1f4;return function(_0x4e443d){logger[_0xc946('0x2b')](_0x4e443d['stack']);if(_0x4e443d[_0xc946('0x2c')]){delete _0x4e443d[_0xc946('0x2c')];}_0x23d27b[_0xc946('0x1d')](_0x74c459)[_0xc946('0x2d')](_0x4e443d);};}exports[_0xc946('0x2e')]=function(_0x7355f7,_0x10ccb8){var _0x5b0ee9={},_0x3782bf={},_0x2a5963={'count':0x0,'rows':[]};var _0x46d6ab=_[_0xc946('0x2f')](db[_0xc946('0x30')][_0xc946('0x31')],function(_0x501a4c){return{'name':_0x501a4c[_0xc946('0x32')],'type':_0x501a4c[_0xc946('0x33')][_0xc946('0x34')]};});_0x3782bf[_0xc946('0x35')]=_[_0xc946('0x2f')](_0x46d6ab,'name');_0x3782bf[_0xc946('0x36')]=_[_0xc946('0x37')](_0x7355f7[_0xc946('0x36')]);_0x3782bf[_0xc946('0x38')]=_[_0xc946('0x39')](_0x3782bf[_0xc946('0x35')],_0x3782bf[_0xc946('0x36')]);_0x5b0ee9['attributes']=_[_0xc946('0x39')](_0x3782bf[_0xc946('0x35')],qs[_0xc946('0x3a')](_0x7355f7['query'][_0xc946('0x3a')]));_0x5b0ee9[_0xc946('0x3b')]=_0x5b0ee9['attributes'][_0xc946('0x3c')]?_0x5b0ee9[_0xc946('0x3b')]:_0x3782bf[_0xc946('0x35')];if(!_0x7355f7[_0xc946('0x36')]['hasOwnProperty'](_0xc946('0x3d'))){_0x5b0ee9['limit']=qs[_0xc946('0x21')](_0x7355f7[_0xc946('0x36')]['limit']);_0x5b0ee9[_0xc946('0x20')]=qs[_0xc946('0x20')](_0x7355f7[_0xc946('0x36')]['offset']);}_0x5b0ee9[_0xc946('0x3e')]=qs[_0xc946('0x3f')](_0x7355f7['query'][_0xc946('0x3f')]);_0x5b0ee9['where']=qs[_0xc946('0x38')](_[_0xc946('0x40')](_0x7355f7[_0xc946('0x36')],_0x3782bf[_0xc946('0x38')]),_0x46d6ab);if(_0x7355f7['query']['filter']){_0x5b0ee9[_0xc946('0x41')]=_[_0xc946('0x42')](_0x5b0ee9[_0xc946('0x41')],{'$or':_[_0xc946('0x2f')](_0x46d6ab,function(_0x364011){if(_0x364011[_0xc946('0x33')]!==_0xc946('0x43')){var _0x2fb309={};_0x2fb309[_0x364011['name']]={'$like':'%'+_0x7355f7['query'][_0xc946('0x44')]+'%'};return _0x2fb309;}})});}_0x5b0ee9=_[_0xc946('0x42')]({},_0x5b0ee9,_0x7355f7[_0xc946('0x45')]);var _0x1370f8={'where':_0x5b0ee9[_0xc946('0x41')]};return db[_0xc946('0x30')][_0xc946('0x46')](_0x1370f8)[_0xc946('0x28')](function(_0x198920){_0x2a5963[_0xc946('0x46')]=_0x198920;if(_0x7355f7[_0xc946('0x36')][_0xc946('0x47')]){_0x5b0ee9[_0xc946('0x48')]=[{'all':!![]}];}return db['UserProfileSection'][_0xc946('0x49')](_0x5b0ee9);})[_0xc946('0x28')](function(_0x126981){_0x2a5963['rows']=_0x126981;return _0x2a5963;})[_0xc946('0x28')](respondWithFilteredResult(_0x10ccb8,_0x5b0ee9))[_0xc946('0x4a')](handleError(_0x10ccb8,null));};exports['show']=function(_0xb9718e,_0x552e17){var _0x340a3e={'raw':![],'where':{'id':_0xb9718e[_0xc946('0x4b')]['id']}},_0x271e79={};_0x271e79[_0xc946('0x35')]=_[_0xc946('0x37')](db['UserProfileSection']['rawAttributes']);_0x271e79['query']=_['keys'](_0xb9718e['query']);_0x271e79['filters']=_[_0xc946('0x39')](_0x271e79[_0xc946('0x35')],_0x271e79[_0xc946('0x36')]);_0x340a3e[_0xc946('0x3b')]=_[_0xc946('0x39')](_0x271e79['model'],qs[_0xc946('0x3a')](_0xb9718e[_0xc946('0x36')][_0xc946('0x3a')]));_0x340a3e['attributes']=_0x340a3e[_0xc946('0x3b')][_0xc946('0x3c')]?_0x340a3e[_0xc946('0x3b')]:_0x271e79[_0xc946('0x35')];if(_0xb9718e['query'][_0xc946('0x47')]){_0x340a3e[_0xc946('0x48')]=[{'all':!![]}];}_0x340a3e=_[_0xc946('0x42')]({},_0x340a3e,_0xb9718e[_0xc946('0x45')]);return db[_0xc946('0x30')]['find'](_0x340a3e)['then'](handleEntityNotFound(_0x552e17,null))[_0xc946('0x28')](respondWithResult(_0x552e17,null))[_0xc946('0x4a')](handleError(_0x552e17,null));};exports[_0xc946('0x4c')]=function(_0x19a156,_0x4bac6e){return db[_0xc946('0x30')][_0xc946('0x4c')](_0x19a156[_0xc946('0x4d')],{})['then'](respondWithResult(_0x4bac6e,0xc9))['catch'](handleError(_0x4bac6e,null));};exports['update']=function(_0x28819c,_0x204be3){if(_0x28819c['body']['id']){delete _0x28819c['body']['id'];}return db[_0xc946('0x30')]['find']({'where':{'id':_0x28819c['params']['id']}})['then'](handleEntityNotFound(_0x204be3,null))[_0xc946('0x28')](saveUpdates(_0x28819c[_0xc946('0x4d')],null))[_0xc946('0x28')](respondWithResult(_0x204be3,null))[_0xc946('0x4a')](handleError(_0x204be3,null));};exports['destroy']=function(_0x35a693,_0x319bb0){return db[_0xc946('0x30')][_0xc946('0x4e')]({'where':{'id':_0x35a693[_0xc946('0x4b')]['id']}})[_0xc946('0x28')](handleEntityNotFound(_0x319bb0,null))[_0xc946('0x28')](removeEntity(_0x319bb0,null))[_0xc946('0x4a')](handleError(_0x319bb0,null));};exports[_0xc946('0x4f')]=function(_0x26ac9a,_0x4faad0){return db[_0xc946('0x30')][_0xc946('0x4f')]()[_0xc946('0x28')](respondWithResult(_0x4faad0,null))[_0xc946('0x4a')](handleError(_0x4faad0,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 7e445d2..1fbd1bc 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 _0x02d5=['api','moment','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x02d5,0x17d));var _0x502d=function(_0x1fc034,_0x56fd41){_0x1fc034=_0x1fc034-0x0;var _0xfbc45e=_0x02d5[_0x1fc034];return _0xfbc45e;};'use strict';var _=require(_0x502d('0x0'));var util=require(_0x502d('0x1'));var logger=require(_0x502d('0x2'))(_0x502d('0x3'));var moment=require(_0x502d('0x4'));var BPromise=require('bluebird');var rp=require(_0x502d('0x5'));var fs=require('fs');var path=require(_0x502d('0x6'));var rimraf=require('rimraf');var config=require(_0x502d('0x7'));var attributes=require(_0x502d('0x8'));module[_0x502d('0x9')]=function(_0x4367d1,_0x4bf47d){return _0x4367d1[_0x502d('0xa')](_0x502d('0xb'),attributes,{'tableName':_0x502d('0xc'),'paranoid':![],'indexes':[{'name':_0x502d('0xd'),'fields':[_0x502d('0xe'),_0x502d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdf4=['api','moment','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId','lodash','util'];(function(_0x382bdf,_0xaed0d){var _0x5dc04f=function(_0x5b2097){while(--_0x5b2097){_0x382bdf['push'](_0x382bdf['shift']());}};_0x5dc04f(++_0xaed0d);}(_0xfdf4,0x1c6));var _0x4fdf=function(_0x581731,_0x5fc92e){_0x581731=_0x581731-0x0;var _0x4ce694=_0xfdf4[_0x581731];return _0x4ce694;};'use strict';var _=require(_0x4fdf('0x0'));var util=require(_0x4fdf('0x1'));var logger=require('../../config/logger')(_0x4fdf('0x2'));var moment=require(_0x4fdf('0x3'));var BPromise=require('bluebird');var rp=require(_0x4fdf('0x4'));var fs=require('fs');var path=require(_0x4fdf('0x5'));var rimraf=require(_0x4fdf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4fdf('0x7'));module[_0x4fdf('0x8')]=function(_0x1c8454,_0x227902){return _0x1c8454[_0x4fdf('0x9')]('UserProfileSection',attributes,{'tableName':_0x4fdf('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4fdf('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ec43468..df96d19 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 _0xc6e1=['rpc','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','util','bluebird','ioredis','../../config/logger'];(function(_0xc308b9,_0x4a02dd){var _0x4e4db8=function(_0x354363){while(--_0x354363){_0xc308b9['push'](_0xc308b9['shift']());}};_0x4e4db8(++_0x4a02dd);}(_0xc6e1,0x164));var _0x1c6e=function(_0x1c18f1,_0x1312f1){_0x1c18f1=_0x1c18f1-0x0;var _0x556de6=_0xc6e1[_0x1c18f1];return _0x556de6;};'use strict';var _=require('lodash');var util=require(_0x1c6e('0x0'));var moment=require('moment');var BPromise=require(_0x1c6e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c6e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1c6e('0x3'))(_0x1c6e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c6e('0x5')][_0x1c6e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x10b0b2,_0x5340cb,_0x673186){return new BPromise(function(_0x33992a,_0x30b9c2){return client[_0x1c6e('0x7')](_0x10b0b2,_0x673186)['then'](function(_0x4d5699){logger[_0x1c6e('0x8')](_0x1c6e('0x9'),_0x5340cb,_0x1c6e('0xa'));logger['debug'](_0x1c6e('0xb'),_0x5340cb,'request\x20sent',JSON[_0x1c6e('0xc')](_0x4d5699));if(_0x4d5699['error']){if(_0x4d5699['error'][_0x1c6e('0xd')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5340cb,_0x4d5699['error'][_0x1c6e('0xe')]);return _0x30b9c2(_0x4d5699[_0x1c6e('0xf')][_0x1c6e('0xe')]);}logger[_0x1c6e('0xf')](_0x1c6e('0x9'),_0x5340cb,_0x4d5699[_0x1c6e('0xf')][_0x1c6e('0xe')]);return _0x33992a(_0x4d5699[_0x1c6e('0xf')][_0x1c6e('0xe')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x5340cb,_0x1c6e('0xa'));_0x33992a(_0x4d5699[_0x1c6e('0x10')][_0x1c6e('0xe')]);}})[_0x1c6e('0x11')](function(_0xc19c3d){logger[_0x1c6e('0xf')](_0x1c6e('0x9'),_0x5340cb,_0xc19c3d);_0x30b9c2(_0xc19c3d);});});} \ No newline at end of file +var _0x1b21=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','randomstring'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1b21,0x1b6));var _0x11b2=function(_0x119ab3,_0x32eef8){_0x119ab3=_0x119ab3-0x0;var _0x4418a1=_0x1b21[_0x119ab3];return _0x4418a1;};'use strict';var _=require(_0x11b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x11b2('0x1'));var fs=require('fs');var Redis=require(_0x11b2('0x2'));var db=require(_0x11b2('0x3'))['db'];var utils=require(_0x11b2('0x4'));var logger=require(_0x11b2('0x5'))('rpc');var config=require(_0x11b2('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x11b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2bfecf,_0x30a64c,_0x4b6229){return new BPromise(function(_0x4b8a16,_0x3ad3c5){return client[_0x11b2('0x8')](_0x2bfecf,_0x4b6229)[_0x11b2('0x9')](function(_0x40c6ab){logger['info'](_0x11b2('0xa'),_0x30a64c,_0x11b2('0xb'));logger[_0x11b2('0xc')](_0x11b2('0xd'),_0x30a64c,_0x11b2('0xb'),JSON[_0x11b2('0xe')](_0x40c6ab));if(_0x40c6ab[_0x11b2('0xf')]){if(_0x40c6ab[_0x11b2('0xf')][_0x11b2('0x10')]===0x1f4){logger['error'](_0x11b2('0xa'),_0x30a64c,_0x40c6ab[_0x11b2('0xf')][_0x11b2('0x11')]);return _0x3ad3c5(_0x40c6ab[_0x11b2('0xf')][_0x11b2('0x11')]);}logger[_0x11b2('0xf')](_0x11b2('0xa'),_0x30a64c,_0x40c6ab[_0x11b2('0xf')][_0x11b2('0x11')]);return _0x4b8a16(_0x40c6ab[_0x11b2('0xf')][_0x11b2('0x11')]);}else{logger[_0x11b2('0x12')](_0x11b2('0xa'),_0x30a64c,'request\x20sent');_0x4b8a16(_0x40c6ab[_0x11b2('0x13')]['message']);}})['catch'](function(_0x963003){logger[_0x11b2('0xf')](_0x11b2('0xa'),_0x30a64c,_0x963003);_0x3ad3c5(_0x963003);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bbfe275..27a9ca4 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4ffa11,_0x120051){var _0x1f669d=function(_0x44b3ab){while(--_0x44b3ab){_0x4ffa11['push'](_0x4ffa11['shift']());}};_0x1f669d(++_0x120051);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index fcaa460..b36219d 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 _0x6acc=['INTEGER','exports'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x6acc,0x1f3));var _0xc6ac=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x6acc[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require('sequelize');module[_0xc6ac('0x0')]={'penalty':{'type':Sequelize[_0xc6ac('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae46=['INTEGER','exports'];(function(_0x46fbb2,_0x405e02){var _0x5ea2c7=function(_0xccc4e4){while(--_0xccc4e4){_0x46fbb2['push'](_0x46fbb2['shift']());}};_0x5ea2c7(++_0x405e02);}(_0xae46,0x127));var _0x6ae4=function(_0x1e0d4b,_0xf3e602){_0x1e0d4b=_0x1e0d4b-0x0;var _0x1eb7e6=_0xae46[_0x1e0d4b];return _0x1eb7e6;};'use strict';var Sequelize=require('sequelize');module[_0x6ae4('0x0')]={'penalty':{'type':Sequelize[_0x6ae4('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 434c537..e366c6f 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 _0xaf1b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','util','../../config/logger','api'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x3aa029,_0x3cd035){_0x3aa029=_0x3aa029-0x0;var _0x4cb9a5=_0xaf1b[_0x3aa029];return _0x4cb9a5;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var logger=require(_0xbaf1('0x2'))(_0xbaf1('0x3'));var moment=require(_0xbaf1('0x4'));var BPromise=require(_0xbaf1('0x5'));var rp=require(_0xbaf1('0x6'));var fs=require('fs');var path=require(_0xbaf1('0x7'));var rimraf=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var attributes=require(_0xbaf1('0xa'));module[_0xbaf1('0xb')]=function(_0x7dd657,_0x2f05ad){return _0x7dd657['define'](_0xbaf1('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf06c=['request-promise','path','rimraf','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3902ac,_0x199a80){var _0x350582=function(_0x2ff7ab){while(--_0x2ff7ab){_0x3902ac['push'](_0x3902ac['shift']());}};_0x350582(++_0x199a80);}(_0xf06c,0xc7));var _0xcf06=function(_0x1b4459,_0x1a4409){_0x1b4459=_0x1b4459-0x0;var _0x588834=_0xf06c[_0x1b4459];return _0x588834;};'use strict';var _=require(_0xcf06('0x0'));var util=require(_0xcf06('0x1'));var logger=require(_0xcf06('0x2'))(_0xcf06('0x3'));var moment=require(_0xcf06('0x4'));var BPromise=require('bluebird');var rp=require(_0xcf06('0x5'));var fs=require('fs');var path=require(_0xcf06('0x6'));var rimraf=require(_0xcf06('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf06('0x8'));module[_0xcf06('0x9')]=function(_0x3de2dc,_0x4e6799){return _0x3de2dc[_0xcf06('0xa')]('UserSmsQueue',attributes,{'tableName':_0xcf06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index d6f68cf..55534e4 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 _0x7ea5=['http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x59cf87,_0xa3a405){var _0x4f66da=function(_0x3de85f){while(--_0x3de85f){_0x59cf87['push'](_0x59cf87['shift']());}};_0x4f66da(++_0xa3a405);}(_0x7ea5,0x114));var _0x57ea=function(_0x13e5e5,_0x55b0cb){_0x13e5e5=_0x13e5e5-0x0;var _0x408d8c=_0x7ea5[_0x13e5e5];return _0x408d8c;};'use strict';var _=require(_0x57ea('0x0'));var util=require('util');var moment=require(_0x57ea('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57ea('0x2'));var db=require(_0x57ea('0x3'))['db'];var utils=require(_0x57ea('0x4'));var logger=require(_0x57ea('0x5'))(_0x57ea('0x6'));var config=require(_0x57ea('0x7'));var jayson=require(_0x57ea('0x8'));var client=jayson[_0x57ea('0x9')][_0x57ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1444b8,_0x30a432,_0x388a4b){return new BPromise(function(_0xcb9f9a,_0x469eee){return client[_0x57ea('0xb')](_0x1444b8,_0x388a4b)[_0x57ea('0xc')](function(_0x50f09d){logger[_0x57ea('0xd')](_0x57ea('0xe'),_0x30a432,_0x57ea('0xf'));logger['debug'](_0x57ea('0x10'),_0x30a432,'request\x20sent',JSON[_0x57ea('0x11')](_0x50f09d));if(_0x50f09d[_0x57ea('0x12')]){if(_0x50f09d[_0x57ea('0x12')]['code']===0x1f4){logger[_0x57ea('0x12')](_0x57ea('0xe'),_0x30a432,_0x50f09d[_0x57ea('0x12')][_0x57ea('0x13')]);return _0x469eee(_0x50f09d[_0x57ea('0x12')][_0x57ea('0x13')]);}logger[_0x57ea('0x12')](_0x57ea('0xe'),_0x30a432,_0x50f09d[_0x57ea('0x12')]['message']);return _0xcb9f9a(_0x50f09d['error']['message']);}else{logger[_0x57ea('0xd')](_0x57ea('0xe'),_0x30a432,_0x57ea('0xf'));_0xcb9f9a(_0x50f09d[_0x57ea('0x14')][_0x57ea('0x13')]);}})[_0x57ea('0x15')](function(_0x4de783){logger['error'](_0x57ea('0xe'),_0x30a432,_0x4de783);_0x469eee(_0x4de783);});});} \ No newline at end of file +var _0x51dc=['UserSmsQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d7e11,_0x10c2ed){var _0x1931ee=function(_0x41a201){while(--_0x41a201){_0x1d7e11['push'](_0x1d7e11['shift']());}};_0x1931ee(++_0x10c2ed);}(_0x51dc,0x1bb));var _0xc51d=function(_0x2bdf1c,_0x357108){_0x2bdf1c=_0x2bdf1c-0x0;var _0x4285b6=_0x51dc[_0x2bdf1c];return _0x4285b6;};'use strict';var _=require(_0xc51d('0x0'));var util=require(_0xc51d('0x1'));var moment=require(_0xc51d('0x2'));var BPromise=require(_0xc51d('0x3'));var rs=require(_0xc51d('0x4'));var fs=require('fs');var Redis=require(_0xc51d('0x5'));var db=require(_0xc51d('0x6'))['db'];var utils=require(_0xc51d('0x7'));var logger=require(_0xc51d('0x8'))('rpc');var config=require(_0xc51d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc51d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29a0d3,_0x291e21,_0x49bb7b){return new BPromise(function(_0x3e147c,_0x340f79){return client[_0xc51d('0xb')](_0x29a0d3,_0x49bb7b)[_0xc51d('0xc')](function(_0x5b5d79){logger[_0xc51d('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x291e21,_0xc51d('0xe'));logger['debug'](_0xc51d('0xf'),_0x291e21,_0xc51d('0xe'),JSON[_0xc51d('0x10')](_0x5b5d79));if(_0x5b5d79[_0xc51d('0x11')]){if(_0x5b5d79[_0xc51d('0x11')][_0xc51d('0x12')]===0x1f4){logger[_0xc51d('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x291e21,_0x5b5d79['error']['message']);return _0x340f79(_0x5b5d79[_0xc51d('0x11')]['message']);}logger['error'](_0xc51d('0x13'),_0x291e21,_0x5b5d79[_0xc51d('0x11')][_0xc51d('0x14')]);return _0x3e147c(_0x5b5d79[_0xc51d('0x11')][_0xc51d('0x14')]);}else{logger[_0xc51d('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x291e21,_0xc51d('0xe'));_0x3e147c(_0x5b5d79[_0xc51d('0x15')]['message']);}})['catch'](function(_0x2202ee){logger[_0xc51d('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x291e21,_0x2202ee);_0x340f79(_0x2202ee);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2395f02..e87984a 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 _0x3d39=['exports','INTEGER'];(function(_0xcea1c7,_0x379a06){var _0x4ce3ba=function(_0x100223){while(--_0x100223){_0xcea1c7['push'](_0xcea1c7['shift']());}};_0x4ce3ba(++_0x379a06);}(_0x3d39,0x14c));var _0x93d3=function(_0x44025e,_0x512d72){_0x44025e=_0x44025e-0x0;var _0x3686c6=_0x3d39[_0x44025e];return _0x3686c6;};'use strict';var Sequelize=require('sequelize');module[_0x93d3('0x0')]={'UserId':{'type':Sequelize[_0x93d3('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x93d3('0x1')]}}; \ No newline at end of file +var _0xdc58=['INTEGER','sequelize','exports'];(function(_0x339ffc,_0x310a81){var _0x5571f7=function(_0x5ca2e5){while(--_0x5ca2e5){_0x339ffc['push'](_0x339ffc['shift']());}};_0x5571f7(++_0x310a81);}(_0xdc58,0xb5));var _0x8dc5=function(_0x47ad83,_0x585e31){_0x47ad83=_0x47ad83-0x0;var _0x336dd0=_0xdc58[_0x47ad83];return _0x336dd0;};'use strict';var Sequelize=require(_0x8dc5('0x0'));module[_0x8dc5('0x1')]={'UserId':{'type':Sequelize[_0x8dc5('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 1fcddc9..9ada013 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(_0xc8566b,_0x388315){var _0x1b8d23=function(_0x5bb8f3){while(--_0x5bb8f3){_0xc8566b['push'](_0xc8566b['shift']());}};_0x1b8d23(++_0x388315);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x5c669d,_0xfc0796){var _0x24247c=function(_0x7dc864){while(--_0x7dc864){_0x5c669d['push'](_0x5c669d['shift']());}};_0x24247c(++_0xfc0796);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 3a4e426..67db605 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5b9547,_0x302b50){var _0x3d33ed=function(_0xc939fa){while(--_0xc939fa){_0x5b9547['push'](_0x5b9547['shift']());}};_0x3d33ed(++_0x302b50);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5e174f,_0x44f7c4){var _0x79c856=function(_0xa1231){while(--_0xa1231){_0x5e174f['push'](_0x5e174f['shift']());}};_0x79c856(++_0x44f7c4);}(_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 fdc2da5..eccde14 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 _0x1856=['INTEGER','sequelize','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1856,0x121));var _0x6185=function(_0x43d061,_0x56f696){_0x43d061=_0x43d061-0x0;var _0x127915=_0x1856[_0x43d061];return _0x127915;};'use strict';var Sequelize=require(_0x6185('0x0'));module[_0x6185('0x1')]={'penalty':{'type':Sequelize[_0x6185('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe85c=['INTEGER','sequelize','exports'];(function(_0x368d9e,_0x554b97){var _0x16232a=function(_0x596f19){while(--_0x596f19){_0x368d9e['push'](_0x368d9e['shift']());}};_0x16232a(++_0x554b97);}(_0xe85c,0x103));var _0xce85=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe85c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xce85('0x0'));module[_0xce85('0x1')]={'penalty':{'type':Sequelize[_0xce85('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index c1ae43b..201138d 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 _0x355e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x355e,0x1a1));var _0xe355=function(_0x156282,_0x15aa54){_0x156282=_0x156282-0x0;var _0x401672=_0x355e[_0x156282];return _0x401672;};'use strict';var _=require(_0xe355('0x0'));var util=require('util');var logger=require(_0xe355('0x1'))(_0xe355('0x2'));var moment=require(_0xe355('0x3'));var BPromise=require(_0xe355('0x4'));var rp=require(_0xe355('0x5'));var fs=require('fs');var path=require(_0xe355('0x6'));var rimraf=require(_0xe355('0x7'));var config=require(_0xe355('0x8'));var attributes=require(_0xe355('0x9'));module[_0xe355('0xa')]=function(_0x45edb3,_0xa2193c){return _0x45edb3[_0xe355('0xb')](_0xe355('0xc'),attributes,{'tableName':_0xe355('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x605d=['rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5f1a7e,_0x5938d5){var _0x3eff0d=function(_0x161b4d){while(--_0x161b4d){_0x5f1a7e['push'](_0x5f1a7e['shift']());}};_0x3eff0d(++_0x5938d5);}(_0x605d,0x187));var _0xd605=function(_0x3356c5,_0x20a150){_0x3356c5=_0x3356c5-0x0;var _0x556859=_0x605d[_0x3356c5];return _0x556859;};'use strict';var _=require(_0xd605('0x0'));var util=require('util');var logger=require(_0xd605('0x1'))(_0xd605('0x2'));var moment=require(_0xd605('0x3'));var BPromise=require(_0xd605('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd605('0x5'));var config=require(_0xd605('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xd605('0x7')]=function(_0x2037b0,_0x410728){return _0x2037b0[_0xd605('0x8')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 62e6a60..f8030a7 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 _0xffea=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x229746,_0x3b85a4){var _0x36dc15=function(_0x3cb167){while(--_0x3cb167){_0x229746['push'](_0x229746['shift']());}};_0x36dc15(++_0x3b85a4);}(_0xffea,0x138));var _0xaffe=function(_0x59935f,_0x448b53){_0x59935f=_0x59935f-0x0;var _0x25387a=_0xffea[_0x59935f];return _0x25387a;};'use strict';var _=require(_0xaffe('0x0'));var util=require(_0xaffe('0x1'));var moment=require(_0xaffe('0x2'));var BPromise=require(_0xaffe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaffe('0x4'))['db'];var utils=require(_0xaffe('0x5'));var logger=require(_0xaffe('0x6'))(_0xaffe('0x7'));var config=require(_0xaffe('0x8'));var jayson=require(_0xaffe('0x9'));var client=jayson['client'][_0xaffe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x457dae,_0x3bac73,_0x160e0e){return new BPromise(function(_0x3ee4fa,_0x19e107){return client[_0xaffe('0xb')](_0x457dae,_0x160e0e)[_0xaffe('0xc')](function(_0x2e5a57){logger[_0xaffe('0xd')](_0xaffe('0xe'),_0x3bac73,_0xaffe('0xf'));logger[_0xaffe('0x10')](_0xaffe('0x11'),_0x3bac73,'request\x20sent',JSON[_0xaffe('0x12')](_0x2e5a57));if(_0x2e5a57[_0xaffe('0x13')]){if(_0x2e5a57['error'][_0xaffe('0x14')]===0x1f4){logger[_0xaffe('0x13')](_0xaffe('0xe'),_0x3bac73,_0x2e5a57[_0xaffe('0x13')][_0xaffe('0x15')]);return _0x19e107(_0x2e5a57[_0xaffe('0x13')][_0xaffe('0x15')]);}logger['error'](_0xaffe('0xe'),_0x3bac73,_0x2e5a57[_0xaffe('0x13')]['message']);return _0x3ee4fa(_0x2e5a57[_0xaffe('0x13')][_0xaffe('0x15')]);}else{logger[_0xaffe('0xd')](_0xaffe('0xe'),_0x3bac73,_0xaffe('0xf'));_0x3ee4fa(_0x2e5a57[_0xaffe('0x16')][_0xaffe('0x15')]);}})['catch'](function(_0x189f30){logger[_0xaffe('0x13')](_0xaffe('0xe'),_0x3bac73,_0x189f30);_0x19e107(_0x189f30);});});} \ No newline at end of file +var _0x9546=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x270d43,_0x2febef){var _0xa7d6cf=function(_0x5836ba){while(--_0x5836ba){_0x270d43['push'](_0x270d43['shift']());}};_0xa7d6cf(++_0x2febef);}(_0x9546,0x114));var _0x6954=function(_0x74f24e,_0x520033){_0x74f24e=_0x74f24e-0x0;var _0x13376d=_0x9546[_0x74f24e];return _0x13376d;};'use strict';var _=require(_0x6954('0x0'));var util=require(_0x6954('0x1'));var moment=require(_0x6954('0x2'));var BPromise=require('bluebird');var rs=require(_0x6954('0x3'));var fs=require('fs');var Redis=require(_0x6954('0x4'));var db=require(_0x6954('0x5'))['db'];var utils=require(_0x6954('0x6'));var logger=require(_0x6954('0x7'))(_0x6954('0x8'));var config=require(_0x6954('0x9'));var jayson=require(_0x6954('0xa'));var client=jayson[_0x6954('0xb')][_0x6954('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5aa0a7,_0x463b39,_0x99b6d5){return new BPromise(function(_0x53f476,_0x1ecd6f){return client[_0x6954('0xd')](_0x5aa0a7,_0x99b6d5)['then'](function(_0x61c861){logger['info'](_0x6954('0xe'),_0x463b39,'request\x20sent');logger[_0x6954('0xf')](_0x6954('0x10'),_0x463b39,_0x6954('0x11'),JSON[_0x6954('0x12')](_0x61c861));if(_0x61c861[_0x6954('0x13')]){if(_0x61c861['error'][_0x6954('0x14')]===0x1f4){logger[_0x6954('0x13')](_0x6954('0xe'),_0x463b39,_0x61c861[_0x6954('0x13')][_0x6954('0x15')]);return _0x1ecd6f(_0x61c861['error'][_0x6954('0x15')]);}logger[_0x6954('0x13')](_0x6954('0xe'),_0x463b39,_0x61c861[_0x6954('0x13')]['message']);return _0x53f476(_0x61c861[_0x6954('0x13')][_0x6954('0x15')]);}else{logger[_0x6954('0x16')]('UserVoiceQueue,\x20%s,\x20%s',_0x463b39,'request\x20sent');_0x53f476(_0x61c861[_0x6954('0x17')]['message']);}})[_0x6954('0x18')](function(_0x55ff1c){logger['error'](_0x6954('0xe'),_0x463b39,_0x55ff1c);_0x1ecd6f(_0x55ff1c);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3efc223..3b7b7b3 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x490bf3,_0x45afa6){var _0x3c5145=function(_0x481a3c){while(--_0x481a3c){_0x490bf3['push'](_0x490bf3['shift']());}};_0x3c5145(++_0x45afa6);}(_0xe706,0xa3));var _0x6e70=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0xe706[_0x43dc7e];return _0x21e12d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3fb731,_0x2baf6d){var _0x139aac=function(_0x1c835e){while(--_0x1c835e){_0x3fb731['push'](_0x3fb731['shift']());}};_0x139aac(++_0x2baf6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 912f47a..42c767c 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 _0x9256=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0xabf1b4,_0x10b2ab){var _0x439ea2=function(_0x5d9465){while(--_0x5d9465){_0xabf1b4['push'](_0xabf1b4['shift']());}};_0x439ea2(++_0x10b2ab);}(_0x9256,0x128));var _0x6925=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9256[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6925('0x0'));module[_0x6925('0x1')]={'uniqueid':{'type':Sequelize[_0x6925('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6925('0x3')},'membername':{'type':Sequelize[_0x6925('0x4')],'allowNull':![],'comment':_0x6925('0x3')},'UserId':{'type':Sequelize[_0x6925('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x6925('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x6925('0x4')],'allowNull':![],'unique':_0x6925('0x5'),'comment':_0x6925('0x3')},'penalty':{'type':Sequelize[_0x6925('0x2')](0xb),'defaultValue':0x0,'comment':_0x6925('0x3')},'paused':{'type':Sequelize[_0x6925('0x2')](0xb),'defaultValue':0x0,'comment':_0x6925('0x3')}}; \ No newline at end of file +var _0xf2c7=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING'];(function(_0x4a1469,_0x77a660){var _0x112a00=function(_0x4e8319){while(--_0x4e8319){_0x4a1469['push'](_0x4a1469['shift']());}};_0x112a00(++_0x77a660);}(_0xf2c7,0x168));var _0x7f2c=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xf2c7[_0x4ba380];return _0x4b111b;};'use strict';var Sequelize=require(_0x7f2c('0x0'));module[_0x7f2c('0x1')]={'uniqueid':{'type':Sequelize[_0x7f2c('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7f2c('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x7f2c('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7f2c('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x7f2c('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x7f2c('0x5')],'allowNull':![],'unique':_0x7f2c('0x4'),'comment':_0x7f2c('0x3')},'penalty':{'type':Sequelize[_0x7f2c('0x2')](0xb),'defaultValue':0x0,'comment':_0x7f2c('0x3')},'paused':{'type':Sequelize[_0x7f2c('0x2')](0xb),'defaultValue':0x0,'comment':_0x7f2c('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 62d16fa..34bf62d 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 _0x61a8=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x11c58e,_0x430ed9){var _0x259517=function(_0x320c54){while(--_0x320c54){_0x11c58e['push'](_0x11c58e['shift']());}};_0x259517(++_0x430ed9);}(_0x61a8,0x1c8));var _0x861a=function(_0x52a58c,_0x102224){_0x52a58c=_0x52a58c-0x0;var _0x3e826a=_0x61a8[_0x52a58c];return _0x3e826a;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x861a('0x0'))['db'][_0x861a('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x861a('0x2')](0x0);var events={'afterCreate':_0x861a('0x3'),'afterUpdate':_0x861a('0x4'),'afterDestroy':_0x861a('0x5')};function emitEvent(_0x4a3ef7){return function(_0x103f65,_0x1a0dff,_0x36cbb1){UserVoiceQueueRtEvents['emit'](_0x4a3ef7+':'+_0x103f65['id'],_0x103f65);UserVoiceQueueRtEvents[_0x861a('0x6')](_0x4a3ef7,_0x103f65);_0x36cbb1(null);};}for(var e in events){if(events[_0x861a('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x861a('0x8')](e,emitEvent(event));}}module[_0x861a('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x639a=['UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x5cb517,_0x3bf161){var _0x34db3f=function(_0x168433){while(--_0x168433){_0x5cb517['push'](_0x5cb517['shift']());}};_0x34db3f(++_0x3bf161);}(_0x639a,0x1c6));var _0xa639=function(_0x189b69,_0x124beb){_0x189b69=_0x189b69-0x0;var _0xf5d41e=_0x639a[_0x189b69];return _0xf5d41e;};'use strict';var EventEmitter=require(_0xa639('0x0'));var UserVoiceQueueRt=require(_0xa639('0x1'))['db'][_0xa639('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa639('0x3')](0x0);var events={'afterCreate':_0xa639('0x4'),'afterUpdate':_0xa639('0x5'),'afterDestroy':'remove'};function emitEvent(_0x57df89){return function(_0x2a00c0,_0xa8ec18,_0x34241f){UserVoiceQueueRtEvents[_0xa639('0x6')](_0x57df89+':'+_0x2a00c0['id'],_0x2a00c0);UserVoiceQueueRtEvents[_0xa639('0x6')](_0x57df89,_0x2a00c0);_0x34241f(null);};}for(var e in events){if(events[_0xa639('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](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 0dac122..37360a2 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 _0x04dd=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger'];(function(_0x4a7dde,_0x38c909){var _0x2ae792=function(_0x145ae9){while(--_0x145ae9){_0x4a7dde['push'](_0x4a7dde['shift']());}};_0x2ae792(++_0x38c909);}(_0x04dd,0x76));var _0xd04d=function(_0x57d00d,_0x3bb282){_0x57d00d=_0x57d00d-0x0;var _0x2d2b37=_0x04dd[_0x57d00d];return _0x2d2b37;};'use strict';var _=require(_0xd04d('0x0'));var util=require('util');var logger=require(_0xd04d('0x1'))(_0xd04d('0x2'));var moment=require(_0xd04d('0x3'));var BPromise=require(_0xd04d('0x4'));var rp=require(_0xd04d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd04d('0x6'));var config=require(_0xd04d('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xd04d('0x8')]=function(_0x12f239,_0xf8a7c2){return _0x12f239[_0xd04d('0x9')](_0xd04d('0xa'),attributes,{'tableName':_0xd04d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd548=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0xd548,0x192));var _0x8d54=function(_0x2a2499,_0x42643c){_0x2a2499=_0x2a2499-0x0;var _0x4b4951=_0xd548[_0x2a2499];return _0x4b4951;};'use strict';var _=require('lodash');var util=require(_0x8d54('0x0'));var logger=require(_0x8d54('0x1'))(_0x8d54('0x2'));var moment=require(_0x8d54('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d54('0x4'));var fs=require('fs');var path=require(_0x8d54('0x5'));var rimraf=require(_0x8d54('0x6'));var config=require(_0x8d54('0x7'));var attributes=require(_0x8d54('0x8'));module['exports']=function(_0x2b7647,_0x13bbde){return _0x2b7647[_0x8d54('0x9')](_0x8d54('0xa'),attributes,{'tableName':_0x8d54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 23b3f0b..a2216b4 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 _0x9088=['jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x450e22,_0x3ba125){var _0x5e3b1d=function(_0x50f77c){while(--_0x50f77c){_0x450e22['push'](_0x450e22['shift']());}};_0x5e3b1d(++_0x3ba125);}(_0x9088,0xe0));var _0x8908=function(_0x2732a8,_0x135c7d){_0x2732a8=_0x2732a8-0x0;var _0x115b0c=_0x9088[_0x2732a8];return _0x115b0c;};'use strict';var _=require(_0x8908('0x0'));var util=require(_0x8908('0x1'));var moment=require('moment');var BPromise=require(_0x8908('0x2'));var rs=require(_0x8908('0x3'));var fs=require('fs');var Redis=require(_0x8908('0x4'));var db=require(_0x8908('0x5'))['db'];var utils=require(_0x8908('0x6'));var logger=require(_0x8908('0x7'))(_0x8908('0x8'));var config=require(_0x8908('0x9'));var jayson=require(_0x8908('0xa'));var client=jayson[_0x8908('0xb')]['http']({'port':0x232a});config[_0x8908('0xc')]=_[_0x8908('0xd')](config[_0x8908('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8908('0xe'))(new Redis(config[_0x8908('0xc')]));require('./userVoiceQueueRt.socket')[_0x8908('0xf')](socket);function respondWithRpcPromise(_0x30a003,_0xf87c45,_0x4243ae){return new BPromise(function(_0x5921f5,_0x24d8f8){return client[_0x8908('0x10')](_0x30a003,_0x4243ae)['then'](function(_0x1ee768){logger[_0x8908('0x11')](_0x8908('0x12'),_0xf87c45,'request\x20sent');logger['debug'](_0x8908('0x13'),_0xf87c45,_0x8908('0x14'),JSON[_0x8908('0x15')](_0x1ee768));if(_0x1ee768[_0x8908('0x16')]){if(_0x1ee768[_0x8908('0x16')][_0x8908('0x17')]===0x1f4){logger['error'](_0x8908('0x12'),_0xf87c45,_0x1ee768[_0x8908('0x16')][_0x8908('0x18')]);return _0x24d8f8(_0x1ee768['error']['message']);}logger[_0x8908('0x16')](_0x8908('0x12'),_0xf87c45,_0x1ee768[_0x8908('0x16')][_0x8908('0x18')]);return _0x5921f5(_0x1ee768[_0x8908('0x16')][_0x8908('0x18')]);}else{logger[_0x8908('0x11')](_0x8908('0x12'),_0xf87c45,_0x8908('0x14'));_0x5921f5(_0x1ee768[_0x8908('0x19')][_0x8908('0x18')]);}})[_0x8908('0x1a')](function(_0x542f39){logger[_0x8908('0x16')](_0x8908('0x12'),_0xf87c45,_0x542f39);_0x24d8f8(_0x542f39);});});}exports[_0x8908('0x1b')]=function(_0x53f037){var _0x3cabd1=this;return new Promise(function(_0x589a98,_0x8802b5){return db[_0x8908('0x1c')][_0x8908('0x1d')]({'raw':_0x53f037['options']?_0x53f037[_0x8908('0x1e')][_0x8908('0x1f')]===undefined?!![]:![]:!![],'where':_0x53f037[_0x8908('0x1e')]?_0x53f037[_0x8908('0x1e')]['where']||null:null,'attributes':[[db[_0x8908('0x20')]['fn'](_0x8908('0x21'),db['sequelize']['fn']('IF',db[_0x8908('0x20')][_0x8908('0x22')](_0x8908('0x23')))),_0x8908('0x24')]]})[_0x8908('0x25')](function(_0x4f2f26){logger[_0x8908('0x11')](_0x8908('0x1b'),_0x53f037);logger[_0x8908('0x26')](_0x8908('0x1b'),_0x53f037,JSON[_0x8908('0x15')](_0x4f2f26));_0x589a98(_0x4f2f26);})[_0x8908('0x1a')](function(_0x2beb94){logger[_0x8908('0x16')]('GetVoiceQueueRtPauses',_0x2beb94['message'],_0x53f037);_0x8802b5(_0x3cabd1['error'](0x1f4,_0x2beb94[_0x8908('0x18')]));});});}; \ No newline at end of file +var _0x9337=['register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','stringify','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./userVoiceQueueRt.socket'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9337,0x9a));var _0x7933=function(_0x116ea7,_0x596670){_0x116ea7=_0x116ea7-0x0;var _0x17ded3=_0x9337[_0x116ea7];return _0x17ded3;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x7933('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7933('0x1'));var db=require(_0x7933('0x2'))['db'];var utils=require(_0x7933('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x7933('0x4'));var jayson=require(_0x7933('0x5'));var client=jayson[_0x7933('0x6')][_0x7933('0x7')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x7933('0x8'),'port':0x18eb});var socket=require(_0x7933('0x9'))(new Redis(config['redis']));require(_0x7933('0xa'))[_0x7933('0xb')](socket);function respondWithRpcPromise(_0x11ff1c,_0x50a1e0,_0x1faf92){return new BPromise(function(_0x360fcf,_0x2394ff){return client[_0x7933('0xc')](_0x11ff1c,_0x1faf92)[_0x7933('0xd')](function(_0x46cdb0){logger[_0x7933('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x50a1e0,_0x7933('0xf'));logger[_0x7933('0x10')](_0x7933('0x11'),_0x50a1e0,_0x7933('0xf'),JSON['stringify'](_0x46cdb0));if(_0x46cdb0[_0x7933('0x12')]){if(_0x46cdb0[_0x7933('0x12')][_0x7933('0x13')]===0x1f4){logger[_0x7933('0x12')](_0x7933('0x14'),_0x50a1e0,_0x46cdb0[_0x7933('0x12')][_0x7933('0x15')]);return _0x2394ff(_0x46cdb0[_0x7933('0x12')][_0x7933('0x15')]);}logger[_0x7933('0x12')](_0x7933('0x14'),_0x50a1e0,_0x46cdb0[_0x7933('0x12')][_0x7933('0x15')]);return _0x360fcf(_0x46cdb0[_0x7933('0x12')]['message']);}else{logger[_0x7933('0xe')](_0x7933('0x14'),_0x50a1e0,_0x7933('0xf'));_0x360fcf(_0x46cdb0['result'][_0x7933('0x15')]);}})[_0x7933('0x16')](function(_0x9a945a){logger[_0x7933('0x12')](_0x7933('0x14'),_0x50a1e0,_0x9a945a);_0x2394ff(_0x9a945a);});});}exports[_0x7933('0x17')]=function(_0x694656){var _0x439944=this;return new Promise(function(_0x322d6f,_0x575d15){return db[_0x7933('0x18')][_0x7933('0x19')]({'raw':_0x694656['options']?_0x694656[_0x7933('0x1a')][_0x7933('0x1b')]===undefined?!![]:![]:!![],'where':_0x694656[_0x7933('0x1a')]?_0x694656[_0x7933('0x1a')][_0x7933('0x1c')]||null:null,'attributes':[[db[_0x7933('0x1d')]['fn']('COUNT',db[_0x7933('0x1d')]['fn']('IF',db[_0x7933('0x1d')][_0x7933('0x1e')](_0x7933('0x1f')))),'outboundQueuePauses']]})[_0x7933('0xd')](function(_0x33e912){logger[_0x7933('0xe')](_0x7933('0x17'),_0x694656);logger['debug']('GetVoiceQueueRtPauses',_0x694656,JSON[_0x7933('0x20')](_0x33e912));_0x322d6f(_0x33e912);})[_0x7933('0x16')](function(_0x307d1f){logger[_0x7933('0x12')](_0x7933('0x17'),_0x307d1f[_0x7933('0x15')],_0x694656);_0x575d15(_0x439944[_0x7933('0x12')](0x1f4,_0x307d1f[_0x7933('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 1a0284d..0322897 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 _0x7217=['userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update','removeListener','register','length'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0x7217,0x19e));var _0x7721=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7217[_0x2bf141];return _0x48277b;};'use strict';var UserVoiceQueueRtEvents=require(_0x7721('0x0'));var events=['save',_0x7721('0x1'),_0x7721('0x2')];function createListener(_0x1de988,_0x2a78d8){return function(_0x115ab3){_0x2a78d8['emit'](_0x1de988,_0x115ab3);};}function removeListener(_0x5bf160,_0x472a96){return function(){UserVoiceQueueRtEvents[_0x7721('0x3')](_0x5bf160,_0x472a96);};}exports[_0x7721('0x4')]=function(_0x3fe47c){for(var _0xb239e0=0x0,_0xf7ff37=events[_0x7721('0x5')];_0xb239e0<_0xf7ff37;_0xb239e0++){var _0x21f680=events[_0xb239e0];var _0x225610=createListener(_0x7721('0x6')+_0x21f680,_0x3fe47c);UserVoiceQueueRtEvents['on'](_0x21f680,_0x225610);}}; \ No newline at end of file +var _0x8a5c=['userVoiceQueueRt:','save','remove','update','emit','removeListener','length'];(function(_0x420c0d,_0x534daf){var _0x45889d=function(_0x2261ec){while(--_0x2261ec){_0x420c0d['push'](_0x420c0d['shift']());}};_0x45889d(++_0x534daf);}(_0x8a5c,0x112));var _0xc8a5=function(_0x101505,_0xbc4985){_0x101505=_0x101505-0x0;var _0x432938=_0x8a5c[_0x101505];return _0x432938;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xc8a5('0x0'),_0xc8a5('0x1'),_0xc8a5('0x2')];function createListener(_0x21c90d,_0x2ce23b){return function(_0x4d1b58){_0x2ce23b[_0xc8a5('0x3')](_0x21c90d,_0x4d1b58);};}function removeListener(_0x2f628e,_0x5e4dda){return function(){UserVoiceQueueRtEvents[_0xc8a5('0x4')](_0x2f628e,_0x5e4dda);};}exports['register']=function(_0x1df46a){for(var _0x275e6a=0x0,_0x2c4b32=events[_0xc8a5('0x5')];_0x275e6a<_0x2c4b32;_0x275e6a++){var _0x276c15=events[_0x275e6a];var _0x3a03af=createListener(_0xc8a5('0x6')+_0x276c15,_0x1df46a);UserVoiceQueueRtEvents['on'](_0x276c15,_0x3a03af);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 1a871f1..489533f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xacd1fd,_0x24f8ea){var _0x3d370b=function(_0x2f8eb4){while(--_0x2f8eb4){_0xacd1fd['push'](_0xacd1fd['shift']());}};_0x3d370b(++_0x24f8ea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x32a7c0,_0x45fc51){var _0xc454a9=function(_0x1d8a05){while(--_0x1d8a05){_0x32a7c0['push'](_0x32a7c0['shift']());}};_0xc454a9(++_0x45fc51);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xcb91[_0x4cce65];return _0x4d1b45;};'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 b53d133..b212c9d 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 _0xa58a=['sequelize','exports'];(function(_0x3d5570,_0x5d863a){var _0x59f67a=function(_0x1ad52a){while(--_0x1ad52a){_0x3d5570['push'](_0x3d5570['shift']());}};_0x59f67a(++_0x5d863a);}(_0xa58a,0x104));var _0xaa58=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xa58a[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0xaa58('0x0'));module[_0xaa58('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3645=['exports','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x3645,0x154));var _0x5364=function(_0x17c8cc,_0x5e5647){_0x17c8cc=_0x17c8cc-0x0;var _0x3db4eb=_0x3645[_0x17c8cc];return _0x3db4eb;};'use strict';var Sequelize=require('sequelize');module[_0x5364('0x0')]={'penalty':{'type':Sequelize[_0x5364('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index ddb5c2c..86c8252 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 _0xbf49=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x53e1a4,_0xd3c0b2){var _0x238617=function(_0x5f2c53){while(--_0x5f2c53){_0x53e1a4['push'](_0x53e1a4['shift']());}};_0x238617(++_0xd3c0b2);}(_0xbf49,0xa8));var _0x9bf4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf49[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9bf4('0x0'));var util=require(_0x9bf4('0x1'));var logger=require(_0x9bf4('0x2'))(_0x9bf4('0x3'));var moment=require(_0x9bf4('0x4'));var BPromise=require(_0x9bf4('0x5'));var rp=require(_0x9bf4('0x6'));var fs=require('fs');var path=require(_0x9bf4('0x7'));var rimraf=require(_0x9bf4('0x8'));var config=require(_0x9bf4('0x9'));var attributes=require(_0x9bf4('0xa'));module['exports']=function(_0x55ae62,_0x2c38a8){return _0x55ae62['define'](_0x9bf4('0xb'),attributes,{'tableName':_0x9bf4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea61=['request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15ac45,_0x475ca0){var _0x11dbf4=function(_0x485893){while(--_0x485893){_0x15ac45['push'](_0x15ac45['shift']());}};_0x11dbf4(++_0x475ca0);}(_0xea61,0x1ac));var _0x1ea6=function(_0x400b08,_0x163a70){_0x400b08=_0x400b08-0x0;var _0x2d4720=_0xea61[_0x400b08];return _0x2d4720;};'use strict';var _=require(_0x1ea6('0x0'));var util=require(_0x1ea6('0x1'));var logger=require(_0x1ea6('0x2'))(_0x1ea6('0x3'));var moment=require(_0x1ea6('0x4'));var BPromise=require(_0x1ea6('0x5'));var rp=require(_0x1ea6('0x6'));var fs=require('fs');var path=require(_0x1ea6('0x7'));var rimraf=require(_0x1ea6('0x8'));var config=require(_0x1ea6('0x9'));var attributes=require(_0x1ea6('0xa'));module['exports']=function(_0x202c62,_0xc3a68a){return _0x202c62[_0x1ea6('0xb')](_0x1ea6('0xc'),attributes,{'tableName':_0x1ea6('0xd'),'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 cbc03d2..0226ad8 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 _0xe9a9=['error','code','message','info','result','catch','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x59c9ba,_0x491d57){var _0x582d01=function(_0x131929){while(--_0x131929){_0x59c9ba['push'](_0x59c9ba['shift']());}};_0x582d01(++_0x491d57);}(_0xe9a9,0xc4));var _0x9e9a=function(_0x9f53a2,_0x26dd8f){_0x9f53a2=_0x9f53a2-0x0;var _0x2ccd3f=_0xe9a9[_0x9f53a2];return _0x2ccd3f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e9a('0x0'));var BPromise=require(_0x9e9a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e9a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e9a('0x3'))(_0x9e9a('0x4'));var config=require(_0x9e9a('0x5'));var jayson=require(_0x9e9a('0x6'));var client=jayson['client'][_0x9e9a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x517d72,_0x19b919,_0x3a1daf){return new BPromise(function(_0x994867,_0x2177f3){return client[_0x9e9a('0x8')](_0x517d72,_0x3a1daf)['then'](function(_0x17b550){logger['info'](_0x9e9a('0x9'),_0x19b919,_0x9e9a('0xa'));logger['debug'](_0x9e9a('0xb'),_0x19b919,_0x9e9a('0xa'),JSON[_0x9e9a('0xc')](_0x17b550));if(_0x17b550[_0x9e9a('0xd')]){if(_0x17b550[_0x9e9a('0xd')][_0x9e9a('0xe')]===0x1f4){logger[_0x9e9a('0xd')](_0x9e9a('0x9'),_0x19b919,_0x17b550[_0x9e9a('0xd')][_0x9e9a('0xf')]);return _0x2177f3(_0x17b550[_0x9e9a('0xd')][_0x9e9a('0xf')]);}logger['error'](_0x9e9a('0x9'),_0x19b919,_0x17b550['error'][_0x9e9a('0xf')]);return _0x994867(_0x17b550['error'][_0x9e9a('0xf')]);}else{logger[_0x9e9a('0x10')](_0x9e9a('0x9'),_0x19b919,_0x9e9a('0xa'));_0x994867(_0x17b550[_0x9e9a('0x11')][_0x9e9a('0xf')]);}})[_0x9e9a('0x12')](function(_0x49a518){logger[_0x9e9a('0xd')](_0x9e9a('0x9'),_0x19b919,_0x49a518);_0x2177f3(_0x49a518);});});} \ No newline at end of file +var _0xdc58=['../../config/environment','jayson/promise','client','http','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x39cb64,_0x34a4d9){var _0x232ed3=function(_0x424fe1){while(--_0x424fe1){_0x39cb64['push'](_0x39cb64['shift']());}};_0x232ed3(++_0x34a4d9);}(_0xdc58,0x176));var _0x8dc5=function(_0x297283,_0x2352b9){_0x297283=_0x297283-0x0;var _0x27a8cf=_0xdc58[_0x297283];return _0x27a8cf;};'use strict';var _=require('lodash');var util=require(_0x8dc5('0x0'));var moment=require('moment');var BPromise=require(_0x8dc5('0x1'));var rs=require(_0x8dc5('0x2'));var fs=require('fs');var Redis=require(_0x8dc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8dc5('0x4'));var jayson=require(_0x8dc5('0x5'));var client=jayson[_0x8dc5('0x6')][_0x8dc5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40e154,_0x16c779,_0x9a8d86){return new BPromise(function(_0x4946e1,_0x3afc6f){return client['request'](_0x40e154,_0x9a8d86)['then'](function(_0x2aba85){logger['info'](_0x8dc5('0x8'),_0x16c779,_0x8dc5('0x9'));logger[_0x8dc5('0xa')](_0x8dc5('0xb'),_0x16c779,'request\x20sent',JSON[_0x8dc5('0xc')](_0x2aba85));if(_0x2aba85['error']){if(_0x2aba85[_0x8dc5('0xd')][_0x8dc5('0xe')]===0x1f4){logger[_0x8dc5('0xd')](_0x8dc5('0x8'),_0x16c779,_0x2aba85[_0x8dc5('0xd')][_0x8dc5('0xf')]);return _0x3afc6f(_0x2aba85[_0x8dc5('0xd')][_0x8dc5('0xf')]);}logger[_0x8dc5('0xd')](_0x8dc5('0x8'),_0x16c779,_0x2aba85['error']['message']);return _0x4946e1(_0x2aba85[_0x8dc5('0xd')][_0x8dc5('0xf')]);}else{logger['info'](_0x8dc5('0x8'),_0x16c779,_0x8dc5('0x9'));_0x4946e1(_0x2aba85[_0x8dc5('0x10')][_0x8dc5('0xf')]);}})[_0x8dc5('0x11')](function(_0x4db022){logger[_0x8dc5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x16c779,_0x4db022);_0x3afc6f(_0x4db022);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 7979831..89dc040 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 _0x7b83=['destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','update','delete','/:id'];(function(_0x49c5d0,_0x1372de){var _0x503ca0=function(_0x50a399){while(--_0x50a399){_0x49c5d0['push'](_0x49c5d0['shift']());}};_0x503ca0(++_0x1372de);}(_0x7b83,0xa1));var _0x37b8=function(_0x8bfb61,_0x3c4286){_0x8bfb61=_0x8bfb61-0x0;var _0x3f629d=_0x7b83[_0x8bfb61];return _0x3f629d;};'use strict';var multer=require(_0x37b8('0x0'));var util=require(_0x37b8('0x1'));var path=require(_0x37b8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x37b8('0x3')]();var fs_extra=require(_0x37b8('0x4'));var auth=require(_0x37b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x37b8('0x6'));var controller=require(_0x37b8('0x7'));router[_0x37b8('0x8')]('/',auth[_0x37b8('0x9')](),controller[_0x37b8('0xa')]);router[_0x37b8('0x8')]('/:id',auth[_0x37b8('0x9')](),controller[_0x37b8('0xb')]);router['post']('/',auth[_0x37b8('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x37b8('0xc')]);router[_0x37b8('0xd')](_0x37b8('0xe'),auth[_0x37b8('0x9')](),controller[_0x37b8('0xf')]);module['exports']=router; \ No newline at end of file +var _0x6597=['show','post','create','/:id','delete','exports','multer','util','path','express','fs-extra','./variable.controller','get','isAuthenticated','index'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0x6597,0x16e));var _0x7659=function(_0x5981c2,_0x23ea7d){_0x5981c2=_0x5981c2-0x0;var _0x52409d=_0x6597[_0x5981c2];return _0x52409d;};'use strict';var multer=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var path=require(_0x7659('0x2'));var timeout=require('connect-timeout');var express=require(_0x7659('0x3'));var router=express['Router']();var fs_extra=require(_0x7659('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7659('0x5'));router[_0x7659('0x6')]('/',auth[_0x7659('0x7')](),controller[_0x7659('0x8')]);router[_0x7659('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7659('0x9')]);router[_0x7659('0xa')]('/',auth[_0x7659('0x7')](),controller[_0x7659('0xb')]);router['put'](_0x7659('0xc'),auth[_0x7659('0x7')](),controller['update']);router[_0x7659('0xd')]('/:id',auth[_0x7659('0x7')](),controller['destroy']);module[_0x7659('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 86a8ca0..e55d32c 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 _0x7ad9=['exports','name','STRING','sequelize'];(function(_0x5be8e2,_0x1c72ee){var _0x27d613=function(_0x346354){while(--_0x346354){_0x5be8e2['push'](_0x5be8e2['shift']());}};_0x27d613(++_0x1c72ee);}(_0x7ad9,0x16f));var _0x97ad=function(_0xeab133,_0x240c1e){_0xeab133=_0xeab133-0x0;var _0x39d424=_0x7ad9[_0xeab133];return _0x39d424;};'use strict';var Sequelize=require(_0x97ad('0x0'));module[_0x97ad('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x97ad('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x97ad('0x3')]}}; \ No newline at end of file +var _0x749a=['STRING','sequelize','exports'];(function(_0x5597b4,_0x2da63f){var _0x34f896=function(_0xe6e753){while(--_0xe6e753){_0x5597b4['push'](_0x5597b4['shift']());}};_0x34f896(++_0x2da63f);}(_0x749a,0xbe));var _0xa749=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x749a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xa749('0x0'));module[_0xa749('0x1')]={'name':{'type':Sequelize[_0xa749('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa749('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index d90b8b4..7f4f939 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 _0xfd34=['body','user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','save','destroy','then','Variables','end','error','stack','name','send','index','map','Variable','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','find'];(function(_0x5ce3ac,_0x5e8d1e){var _0x591033=function(_0x6bef1){while(--_0x6bef1){_0x5ce3ac['push'](_0x5ce3ac['shift']());}};_0x591033(++_0x5e8d1e);}(_0xfd34,0x15d));var _0x4fd3=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0xfd34[_0x2c27ed];return _0x597bd1;};'use strict';var emlformat=require(_0x4fd3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4fd3('0x1'));var jsonpatch=require(_0x4fd3('0x2'));var rp=require(_0x4fd3('0x3'));var moment=require(_0x4fd3('0x4'));var BPromise=require(_0x4fd3('0x5'));var Mustache=require(_0x4fd3('0x6'));var util=require(_0x4fd3('0x7'));var path=require(_0x4fd3('0x8'));var sox=require(_0x4fd3('0x9'));var csv=require(_0x4fd3('0xa'));var ejs=require(_0x4fd3('0xb'));var fs=require('fs');var fs_extra=require(_0x4fd3('0xc'));var _=require(_0x4fd3('0xd'));var squel=require(_0x4fd3('0xe'));var crypto=require(_0x4fd3('0xf'));var jsforce=require(_0x4fd3('0x10'));var deskjs=require(_0x4fd3('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4fd3('0x12'));var authService=require(_0x4fd3('0x13'));var qs=require(_0x4fd3('0x14'));var as=require(_0x4fd3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fd3('0x16'))('api');var utils=require(_0x4fd3('0x17'));var config=require(_0x4fd3('0x18'));var licenseUtil=require(_0x4fd3('0x19'));var db=require(_0x4fd3('0x1a'))['db'];function respondWithStatusCode(_0x476b42,_0x16ac40){_0x16ac40=_0x16ac40||0xcc;return function(_0x220075){if(_0x220075){return _0x476b42[_0x4fd3('0x1b')](_0x16ac40);}return _0x476b42[_0x4fd3('0x1c')](_0x16ac40)['end']();};}function respondWithResult(_0x4ec5ec,_0x5cc0c5){_0x5cc0c5=_0x5cc0c5||0xc8;return function(_0x4be56a){if(_0x4be56a){return _0x4ec5ec[_0x4fd3('0x1c')](_0x5cc0c5)[_0x4fd3('0x1d')](_0x4be56a);}};}function respondWithFilteredResult(_0x498443,_0x30c0bd){return function(_0x8b0832){if(_0x8b0832){var _0x351c19=typeof _0x30c0bd['offset']===_0x4fd3('0x1e')&&typeof _0x30c0bd[_0x4fd3('0x1f')]===_0x4fd3('0x1e');var _0x4854f5=_0x8b0832[_0x4fd3('0x20')];var _0x1a8ca7=_0x351c19?0x0:_0x30c0bd[_0x4fd3('0x21')];var _0x25c346=_0x351c19?_0x8b0832[_0x4fd3('0x20')]:_0x30c0bd[_0x4fd3('0x21')]+_0x30c0bd[_0x4fd3('0x1f')];var _0x1935c7;if(_0x25c346>=_0x4854f5){_0x25c346=_0x4854f5;_0x1935c7=0xc8;}else{_0x1935c7=0xce;}_0x498443[_0x4fd3('0x1c')](_0x1935c7);return _0x498443['set'](_0x4fd3('0x22'),_0x1a8ca7+'-'+_0x25c346+'/'+_0x4854f5)['json'](_0x8b0832);}return null;};}function patchUpdates(_0xfb32f4){return function(_0x337381){try{jsonpatch['apply'](_0x337381,_0xfb32f4,!![]);}catch(_0x23a607){return BPromise[_0x4fd3('0x23')](_0x23a607);}return _0x337381[_0x4fd3('0x24')]();};}function saveUpdates(_0x2332c1,_0x12854c){return function(_0x47d2fd){if(_0x47d2fd){return _0x47d2fd['update'](_0x2332c1)['then'](function(_0x469962){return _0x469962;});}return null;};}function removeEntity(_0x3e04a0,_0x4e4d20){return function(_0x165051){if(_0x165051){return _0x165051[_0x4fd3('0x25')]()[_0x4fd3('0x26')](function(){var _0xaff21e=_0x165051['get']({'plain':!![]});var _0x34a66d=_0x4fd3('0x27');return db['UserProfileResource'][_0x4fd3('0x25')]({'where':{'type':_0x34a66d,'resourceId':_0xaff21e['id']}})['then'](function(){return _0x165051;});})[_0x4fd3('0x26')](function(){_0x3e04a0[_0x4fd3('0x1c')](0xcc)[_0x4fd3('0x28')]();});}};}function handleEntityNotFound(_0x43da61,_0x33b639){return function(_0x56e70d){if(!_0x56e70d){_0x43da61[_0x4fd3('0x1b')](0x194);}return _0x56e70d;};}function handleError(_0x2a2c9a,_0x3ba1e0){_0x3ba1e0=_0x3ba1e0||0x1f4;return function(_0x19847e){logger[_0x4fd3('0x29')](_0x19847e[_0x4fd3('0x2a')]);if(_0x19847e[_0x4fd3('0x2b')]){delete _0x19847e['name'];}_0x2a2c9a[_0x4fd3('0x1c')](_0x3ba1e0)[_0x4fd3('0x2c')](_0x19847e);};}exports[_0x4fd3('0x2d')]=function(_0x22a467,_0x5c5620){var _0x1c42b8={},_0x489a56={},_0x74c5a8={'count':0x0,'rows':[]};var _0x113a79=_[_0x4fd3('0x2e')](db[_0x4fd3('0x2f')]['rawAttributes'],function(_0x3298e5){return{'name':_0x3298e5[_0x4fd3('0x30')],'type':_0x3298e5[_0x4fd3('0x31')]['key']};});_0x489a56[_0x4fd3('0x32')]=_['map'](_0x113a79,_0x4fd3('0x2b'));_0x489a56[_0x4fd3('0x33')]=_['keys'](_0x22a467[_0x4fd3('0x33')]);_0x489a56[_0x4fd3('0x34')]=_[_0x4fd3('0x35')](_0x489a56[_0x4fd3('0x32')],_0x489a56['query']);_0x1c42b8['attributes']=_['intersection'](_0x489a56['model'],qs[_0x4fd3('0x36')](_0x22a467[_0x4fd3('0x33')]['fields']));_0x1c42b8[_0x4fd3('0x37')]=_0x1c42b8['attributes']['length']?_0x1c42b8[_0x4fd3('0x37')]:_0x489a56[_0x4fd3('0x32')];if(!_0x22a467[_0x4fd3('0x33')][_0x4fd3('0x38')](_0x4fd3('0x39'))){_0x1c42b8[_0x4fd3('0x1f')]=qs['limit'](_0x22a467[_0x4fd3('0x33')]['limit']);_0x1c42b8[_0x4fd3('0x21')]=qs['offset'](_0x22a467[_0x4fd3('0x33')][_0x4fd3('0x21')]);}_0x1c42b8[_0x4fd3('0x3a')]=qs[_0x4fd3('0x3b')](_0x22a467[_0x4fd3('0x33')][_0x4fd3('0x3b')]);_0x1c42b8[_0x4fd3('0x3c')]=qs[_0x4fd3('0x34')](_[_0x4fd3('0x3d')](_0x22a467[_0x4fd3('0x33')],_0x489a56[_0x4fd3('0x34')]),_0x113a79);if(_0x22a467[_0x4fd3('0x33')][_0x4fd3('0x3e')]){_0x1c42b8['where']=_[_0x4fd3('0x3f')](_0x1c42b8[_0x4fd3('0x3c')],{'$or':_[_0x4fd3('0x2e')](_0x113a79,function(_0x1b7ff0){if(_0x1b7ff0[_0x4fd3('0x31')]!==_0x4fd3('0x40')){var _0x4272a7={};_0x4272a7[_0x1b7ff0[_0x4fd3('0x2b')]]={'$like':'%'+_0x22a467[_0x4fd3('0x33')][_0x4fd3('0x3e')]+'%'};return _0x4272a7;}})});}_0x1c42b8=_[_0x4fd3('0x3f')]({},_0x1c42b8,_0x22a467[_0x4fd3('0x41')]);var _0x49efd3={'where':_0x1c42b8['where']};return db[_0x4fd3('0x2f')][_0x4fd3('0x20')](_0x49efd3)[_0x4fd3('0x26')](function(_0xf2632f){_0x74c5a8[_0x4fd3('0x20')]=_0xf2632f;if(_0x22a467[_0x4fd3('0x33')]['includeAll']){_0x1c42b8[_0x4fd3('0x42')]=[{'all':!![]}];}return db[_0x4fd3('0x2f')][_0x4fd3('0x43')](_0x1c42b8);})['then'](function(_0x2c65c1){_0x74c5a8[_0x4fd3('0x44')]=_0x2c65c1;return _0x74c5a8;})[_0x4fd3('0x26')](respondWithFilteredResult(_0x5c5620,_0x1c42b8))[_0x4fd3('0x45')](handleError(_0x5c5620,null));};exports[_0x4fd3('0x46')]=function(_0x506194,_0x428435){var _0x361239={'raw':!![],'where':{'id':_0x506194[_0x4fd3('0x47')]['id']}},_0x3b4a92={};_0x3b4a92[_0x4fd3('0x32')]=_[_0x4fd3('0x48')](db[_0x4fd3('0x2f')]['rawAttributes']);_0x3b4a92[_0x4fd3('0x33')]=_[_0x4fd3('0x48')](_0x506194[_0x4fd3('0x33')]);_0x3b4a92['filters']=_[_0x4fd3('0x35')](_0x3b4a92[_0x4fd3('0x32')],_0x3b4a92['query']);_0x361239[_0x4fd3('0x37')]=_[_0x4fd3('0x35')](_0x3b4a92[_0x4fd3('0x32')],qs[_0x4fd3('0x36')](_0x506194['query'][_0x4fd3('0x36')]));_0x361239['attributes']=_0x361239[_0x4fd3('0x37')][_0x4fd3('0x49')]?_0x361239[_0x4fd3('0x37')]:_0x3b4a92[_0x4fd3('0x32')];if(_0x506194[_0x4fd3('0x33')][_0x4fd3('0x4a')]){_0x361239['include']=[{'all':!![]}];}_0x361239=_['merge']({},_0x361239,_0x506194[_0x4fd3('0x41')]);return db[_0x4fd3('0x2f')][_0x4fd3('0x4b')](_0x361239)['then'](handleEntityNotFound(_0x428435,null))[_0x4fd3('0x26')](respondWithResult(_0x428435,null))[_0x4fd3('0x45')](handleError(_0x428435,null));};exports['create']=function(_0x509ca7,_0x131abc){return db[_0x4fd3('0x2f')]['create'](_0x509ca7[_0x4fd3('0x4c')],{})[_0x4fd3('0x26')](function(_0x68d35a){var _0x5efba2=_0x509ca7[_0x4fd3('0x4d')]['get']({'plain':!![]});if(!_0x5efba2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5efba2['role']===_0x4fd3('0x4d')){var _0x1419d1=_0x68d35a[_0x4fd3('0x4e')]({'plain':!![]});var _0x1c6475=_0x4fd3('0x27');return db[_0x4fd3('0x4f')][_0x4fd3('0x4b')]({'where':{'name':_0x1c6475,'userProfileId':_0x5efba2[_0x4fd3('0x50')]},'raw':!![]})[_0x4fd3('0x26')](function(_0x12ee9e){if(_0x12ee9e&&_0x12ee9e[_0x4fd3('0x51')]===0x0){return db[_0x4fd3('0x52')][_0x4fd3('0x53')]({'name':_0x1419d1[_0x4fd3('0x2b')],'resourceId':_0x1419d1['id'],'type':_0x12ee9e[_0x4fd3('0x2b')],'sectionId':_0x12ee9e['id']},{})[_0x4fd3('0x26')](function(){return _0x68d35a;});}else{return _0x68d35a;}})['catch'](function(_0x13beb7){logger[_0x4fd3('0x29')](_0x4fd3('0x54'),_0x13beb7);throw _0x13beb7;});}return _0x68d35a;})[_0x4fd3('0x26')](respondWithResult(_0x131abc,0xc9))[_0x4fd3('0x45')](handleError(_0x131abc,null));};exports['update']=function(_0x5f498b,_0x22bdac){if(_0x5f498b[_0x4fd3('0x4c')]['id']){delete _0x5f498b[_0x4fd3('0x4c')]['id'];}return db[_0x4fd3('0x2f')]['find']({'where':{'id':_0x5f498b[_0x4fd3('0x47')]['id']}})[_0x4fd3('0x26')](handleEntityNotFound(_0x22bdac,null))[_0x4fd3('0x26')](saveUpdates(_0x5f498b[_0x4fd3('0x4c')],null))[_0x4fd3('0x26')](respondWithResult(_0x22bdac,null))[_0x4fd3('0x45')](handleError(_0x22bdac,null));};exports['destroy']=function(_0x55fdc1,_0x583be9){return db['Variable'][_0x4fd3('0x4b')]({'where':{'id':_0x55fdc1['params']['id']}})[_0x4fd3('0x26')](handleEntityNotFound(_0x583be9,null))[_0x4fd3('0x26')](removeEntity(_0x583be9,null))['catch'](handleError(_0x583be9,null));}; \ No newline at end of file +var _0x999b=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','Variable','includeAll','show','params','length','include','create','user','role','Variables','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x18be5e,_0x5c1565){var _0x1f5518=function(_0x593d73){while(--_0x593d73){_0x18be5e['push'](_0x18be5e['shift']());}};_0x1f5518(++_0x5c1565);}(_0x999b,0x181));var _0xb999=function(_0x18a062,_0x3c7f6d){_0x18a062=_0x18a062-0x0;var _0x461726=_0x999b[_0x18a062];return _0x461726;};'use strict';var emlformat=require(_0xb999('0x0'));var rimraf=require(_0xb999('0x1'));var zipdir=require(_0xb999('0x2'));var jsonpatch=require(_0xb999('0x3'));var rp=require(_0xb999('0x4'));var moment=require('moment');var BPromise=require(_0xb999('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb999('0x6'));var csv=require(_0xb999('0x7'));var ejs=require(_0xb999('0x8'));var fs=require('fs');var fs_extra=require(_0xb999('0x9'));var _=require(_0xb999('0xa'));var squel=require(_0xb999('0xb'));var crypto=require(_0xb999('0xc'));var jsforce=require(_0xb999('0xd'));var deskjs=require(_0xb999('0xe'));var toCsv=require(_0xb999('0x7'));var querystring=require(_0xb999('0xf'));var Papa=require(_0xb999('0x10'));var Redis=require(_0xb999('0x11'));var authService=require(_0xb999('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb999('0x13'));var logger=require(_0xb999('0x14'))(_0xb999('0x15'));var utils=require(_0xb999('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb999('0x17'))['db'];function respondWithStatusCode(_0x36aeba,_0x31ad82){_0x31ad82=_0x31ad82||0xcc;return function(_0x4fd51d){if(_0x4fd51d){return _0x36aeba[_0xb999('0x18')](_0x31ad82);}return _0x36aeba[_0xb999('0x19')](_0x31ad82)[_0xb999('0x1a')]();};}function respondWithResult(_0x2149a3,_0x470b32){_0x470b32=_0x470b32||0xc8;return function(_0x150302){if(_0x150302){return _0x2149a3[_0xb999('0x19')](_0x470b32)[_0xb999('0x1b')](_0x150302);}};}function respondWithFilteredResult(_0x413421,_0x1996df){return function(_0x3c4d07){if(_0x3c4d07){var _0x5a9d34=typeof _0x1996df[_0xb999('0x1c')]===_0xb999('0x1d')&&typeof _0x1996df[_0xb999('0x1e')]===_0xb999('0x1d');var _0x14eba9=_0x3c4d07['count'];var _0x531216=_0x5a9d34?0x0:_0x1996df[_0xb999('0x1c')];var _0x5cb4f0=_0x5a9d34?_0x3c4d07[_0xb999('0x1f')]:_0x1996df['offset']+_0x1996df[_0xb999('0x1e')];var _0x229276;if(_0x5cb4f0>=_0x14eba9){_0x5cb4f0=_0x14eba9;_0x229276=0xc8;}else{_0x229276=0xce;}_0x413421[_0xb999('0x19')](_0x229276);return _0x413421[_0xb999('0x20')](_0xb999('0x21'),_0x531216+'-'+_0x5cb4f0+'/'+_0x14eba9)[_0xb999('0x1b')](_0x3c4d07);}return null;};}function patchUpdates(_0x56a322){return function(_0x180560){try{jsonpatch['apply'](_0x180560,_0x56a322,!![]);}catch(_0x11151b){return BPromise[_0xb999('0x22')](_0x11151b);}return _0x180560[_0xb999('0x23')]();};}function saveUpdates(_0x21035f,_0x547c6f){return function(_0x141099){if(_0x141099){return _0x141099[_0xb999('0x24')](_0x21035f)[_0xb999('0x25')](function(_0x248fef){return _0x248fef;});}return null;};}function removeEntity(_0x1c84f3,_0x3b720f){return function(_0x5887fa){if(_0x5887fa){return _0x5887fa[_0xb999('0x26')]()['then'](function(){var _0x4e3f44=_0x5887fa[_0xb999('0x27')]({'plain':!![]});var _0x3eea96='Variables';return db[_0xb999('0x28')]['destroy']({'where':{'type':_0x3eea96,'resourceId':_0x4e3f44['id']}})[_0xb999('0x25')](function(){return _0x5887fa;});})['then'](function(){_0x1c84f3[_0xb999('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8e55,_0x24b309){return function(_0x32afd7){if(!_0x32afd7){_0x3b8e55[_0xb999('0x18')](0x194);}return _0x32afd7;};}function handleError(_0x1fbe0a,_0x3b74bb){_0x3b74bb=_0x3b74bb||0x1f4;return function(_0xebdeb3){logger[_0xb999('0x29')](_0xebdeb3['stack']);if(_0xebdeb3[_0xb999('0x2a')]){delete _0xebdeb3[_0xb999('0x2a')];}_0x1fbe0a[_0xb999('0x19')](_0x3b74bb)[_0xb999('0x2b')](_0xebdeb3);};}exports['index']=function(_0x5229dd,_0x36bb70){var _0x488617={},_0x217d3b={},_0x219ee4={'count':0x0,'rows':[]};var _0x512e99=_[_0xb999('0x2c')](db['Variable']['rawAttributes'],function(_0x3911f8){return{'name':_0x3911f8[_0xb999('0x2d')],'type':_0x3911f8['type'][_0xb999('0x2e')]};});_0x217d3b['model']=_['map'](_0x512e99,_0xb999('0x2a'));_0x217d3b[_0xb999('0x2f')]=_[_0xb999('0x30')](_0x5229dd[_0xb999('0x2f')]);_0x217d3b[_0xb999('0x31')]=_[_0xb999('0x32')](_0x217d3b[_0xb999('0x33')],_0x217d3b['query']);_0x488617[_0xb999('0x34')]=_[_0xb999('0x32')](_0x217d3b[_0xb999('0x33')],qs[_0xb999('0x35')](_0x5229dd[_0xb999('0x2f')]['fields']));_0x488617[_0xb999('0x34')]=_0x488617[_0xb999('0x34')]['length']?_0x488617[_0xb999('0x34')]:_0x217d3b['model'];if(!_0x5229dd[_0xb999('0x2f')]['hasOwnProperty'](_0xb999('0x36'))){_0x488617[_0xb999('0x1e')]=qs['limit'](_0x5229dd[_0xb999('0x2f')]['limit']);_0x488617['offset']=qs[_0xb999('0x1c')](_0x5229dd[_0xb999('0x2f')]['offset']);}_0x488617[_0xb999('0x37')]=qs[_0xb999('0x38')](_0x5229dd['query'][_0xb999('0x38')]);_0x488617[_0xb999('0x39')]=qs[_0xb999('0x31')](_['pick'](_0x5229dd[_0xb999('0x2f')],_0x217d3b['filters']),_0x512e99);if(_0x5229dd['query'][_0xb999('0x3a')]){_0x488617[_0xb999('0x39')]=_['merge'](_0x488617[_0xb999('0x39')],{'$or':_[_0xb999('0x2c')](_0x512e99,function(_0x4004d2){if(_0x4004d2[_0xb999('0x3b')]!==_0xb999('0x3c')){var _0x3da9aa={};_0x3da9aa[_0x4004d2[_0xb999('0x2a')]]={'$like':'%'+_0x5229dd['query'][_0xb999('0x3a')]+'%'};return _0x3da9aa;}})});}_0x488617=_[_0xb999('0x3d')]({},_0x488617,_0x5229dd[_0xb999('0x3e')]);var _0x377c71={'where':_0x488617[_0xb999('0x39')]};return db[_0xb999('0x3f')][_0xb999('0x1f')](_0x377c71)[_0xb999('0x25')](function(_0x3be272){_0x219ee4[_0xb999('0x1f')]=_0x3be272;if(_0x5229dd[_0xb999('0x2f')][_0xb999('0x40')]){_0x488617['include']=[{'all':!![]}];}return db['Variable']['findAll'](_0x488617);})[_0xb999('0x25')](function(_0x477fd5){_0x219ee4['rows']=_0x477fd5;return _0x219ee4;})['then'](respondWithFilteredResult(_0x36bb70,_0x488617))['catch'](handleError(_0x36bb70,null));};exports[_0xb999('0x41')]=function(_0x165a9c,_0xd4204b){var _0x1acff0={'raw':!![],'where':{'id':_0x165a9c[_0xb999('0x42')]['id']}},_0x3bf18d={};_0x3bf18d[_0xb999('0x33')]=_[_0xb999('0x30')](db[_0xb999('0x3f')]['rawAttributes']);_0x3bf18d[_0xb999('0x2f')]=_[_0xb999('0x30')](_0x165a9c[_0xb999('0x2f')]);_0x3bf18d['filters']=_[_0xb999('0x32')](_0x3bf18d['model'],_0x3bf18d[_0xb999('0x2f')]);_0x1acff0[_0xb999('0x34')]=_[_0xb999('0x32')](_0x3bf18d[_0xb999('0x33')],qs[_0xb999('0x35')](_0x165a9c[_0xb999('0x2f')][_0xb999('0x35')]));_0x1acff0[_0xb999('0x34')]=_0x1acff0['attributes'][_0xb999('0x43')]?_0x1acff0[_0xb999('0x34')]:_0x3bf18d['model'];if(_0x165a9c[_0xb999('0x2f')][_0xb999('0x40')]){_0x1acff0[_0xb999('0x44')]=[{'all':!![]}];}_0x1acff0=_[_0xb999('0x3d')]({},_0x1acff0,_0x165a9c['options']);return db['Variable']['find'](_0x1acff0)[_0xb999('0x25')](handleEntityNotFound(_0xd4204b,null))[_0xb999('0x25')](respondWithResult(_0xd4204b,null))['catch'](handleError(_0xd4204b,null));};exports['create']=function(_0x127fe0,_0x34b14f){return db[_0xb999('0x3f')][_0xb999('0x45')](_0x127fe0['body'],{})[_0xb999('0x25')](function(_0x357c6c){var _0x78ba58=_0x127fe0[_0xb999('0x46')][_0xb999('0x27')]({'plain':!![]});if(!_0x78ba58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x78ba58[_0xb999('0x47')]===_0xb999('0x46')){var _0x34a07e=_0x357c6c[_0xb999('0x27')]({'plain':!![]});var _0x4ac507=_0xb999('0x48');return db[_0xb999('0x49')][_0xb999('0x4a')]({'where':{'name':_0x4ac507,'userProfileId':_0x78ba58[_0xb999('0x4b')]},'raw':!![]})[_0xb999('0x25')](function(_0x31f47e){if(_0x31f47e&&_0x31f47e[_0xb999('0x4c')]===0x0){return db[_0xb999('0x28')][_0xb999('0x45')]({'name':_0x34a07e[_0xb999('0x2a')],'resourceId':_0x34a07e['id'],'type':_0x31f47e[_0xb999('0x2a')],'sectionId':_0x31f47e['id']},{})[_0xb999('0x25')](function(){return _0x357c6c;});}else{return _0x357c6c;}})['catch'](function(_0x31243a){logger[_0xb999('0x29')](_0xb999('0x4d'),_0x31243a);throw _0x31243a;});}return _0x357c6c;})['then'](respondWithResult(_0x34b14f,0xc9))[_0xb999('0x4e')](handleError(_0x34b14f,null));};exports['update']=function(_0x49bab3,_0x5d35fe){if(_0x49bab3['body']['id']){delete _0x49bab3[_0xb999('0x4f')]['id'];}return db['Variable']['find']({'where':{'id':_0x49bab3[_0xb999('0x42')]['id']}})[_0xb999('0x25')](handleEntityNotFound(_0x5d35fe,null))[_0xb999('0x25')](saveUpdates(_0x49bab3[_0xb999('0x4f')],null))[_0xb999('0x25')](respondWithResult(_0x5d35fe,null))[_0xb999('0x4e')](handleError(_0x5d35fe,null));};exports[_0xb999('0x26')]=function(_0x47db8f,_0x1a964a){return db['Variable']['find']({'where':{'id':_0x47db8f['params']['id']}})[_0xb999('0x25')](handleEntityNotFound(_0x1a964a,null))[_0xb999('0x25')](removeEntity(_0x1a964a,null))[_0xb999('0x4e')](handleError(_0x1a964a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6f7f732..e9f9354 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 _0xbf8d=['../../config/logger','api','moment','bluebird','../../config/environment','exports','define','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xbf8d,0x1d7));var _0xdbf8=function(_0x44ae0f,_0x57de66){_0x44ae0f=_0x44ae0f-0x0;var _0x5b6909=_0xbf8d[_0x44ae0f];return _0x5b6909;};'use strict';var _=require(_0xdbf8('0x0'));var util=require('util');var logger=require(_0xdbf8('0x1'))(_0xdbf8('0x2'));var moment=require(_0xdbf8('0x3'));var BPromise=require(_0xdbf8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdbf8('0x5'));var attributes=require('./variable.attributes');module[_0xdbf8('0x6')]=function(_0xe8c3f,_0x415473){return _0xe8c3f[_0xdbf8('0x7')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa969=['util','../../config/logger','path','rimraf','../../config/environment','./variable.attributes','define','lodash'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xa969,0xf7));var _0x9a96=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa969[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x9a96('0x0'));var util=require(_0x9a96('0x1'));var logger=require(_0x9a96('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a96('0x3'));var rimraf=require(_0x9a96('0x4'));var config=require(_0x9a96('0x5'));var attributes=require(_0x9a96('0x6'));module['exports']=function(_0x35a1d1,_0x577d73){return _0x35a1d1[_0x9a96('0x7')]('Variable',attributes,{'tableName':'tools_variables','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 b91ea21..21b76d9 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x238837,_0xe5f1d9){var _0x33b3c0=function(_0x174583){while(--_0x174583){_0x238837['push'](_0x238837['shift']());}};_0x33b3c0(++_0xe5f1d9);}(_0xe14b,0x93));var _0xbe14=function(_0x1f3810,_0x5029a9){_0x1f3810=_0x1f3810-0x0;var _0x420bf6=_0xe14b[_0x1f3810];return _0x420bf6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x5150d2,_0x44d26f){var _0x580e8b=function(_0x1f79b1){while(--_0x1f79b1){_0x5150d2['push'](_0x5150d2['shift']());}};_0x580e8b(++_0x44d26f);}(_0x7217,0x19e));var _0x7721=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x7217[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index b14a89a..3d1efa8 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 _0xf027=['migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','/pull','pull','/restart'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xf027,0x14c));var _0x7f02=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf027[_0x3ab51d];return _0x29a04e;};'use strict';var express=require(_0x7f02('0x0'));var router=express[_0x7f02('0x1')]();var auth=require(_0x7f02('0x2'));var controller=require(_0x7f02('0x3'));router[_0x7f02('0x4')]('/',controller[_0x7f02('0x5')]);router[_0x7f02('0x4')]('/fetch',auth[_0x7f02('0x6')](),auth[_0x7f02('0x7')](),controller[_0x7f02('0x8')]);router[_0x7f02('0x4')](_0x7f02('0x9'),auth[_0x7f02('0x6')](),auth[_0x7f02('0x7')](),controller['reset']);router[_0x7f02('0x4')](_0x7f02('0xa'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x7f02('0xb')]);router['get'](_0x7f02('0xc'),auth[_0x7f02('0x6')](),controller['restart']);router[_0x7f02('0x4')]('/migrations',controller[_0x7f02('0xd')]);module[_0x7f02('0xe')]=router; \ No newline at end of file +var _0x087c=['/pull','pull','/restart','restart','exports','express','Router','../../components/auth/service','./version.controller','index','/fetch','isAuthenticated','canUpdate','fetch','get','/reset','reset'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x087c,0x1bf));var _0xc087=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x087c[_0x321bb2];return _0x9c12ed;};'use strict';var express=require(_0xc087('0x0'));var router=express[_0xc087('0x1')]();var auth=require(_0xc087('0x2'));var controller=require(_0xc087('0x3'));router['get']('/',controller[_0xc087('0x4')]);router['get'](_0xc087('0x5'),auth[_0xc087('0x6')](),auth[_0xc087('0x7')](),controller[_0xc087('0x8')]);router[_0xc087('0x9')](_0xc087('0xa'),auth[_0xc087('0x6')](),auth['canUpdate'](),controller[_0xc087('0xb')]);router[_0xc087('0x9')](_0xc087('0xc'),auth[_0xc087('0x6')](),auth['canUpdate'](),controller[_0xc087('0xd')]);router[_0xc087('0x9')](_0xc087('0xe'),auth[_0xc087('0x6')](),controller[_0xc087('0xf')]);router[_0xc087('0x9')]('/migrations',controller['migrations']);module[_0xc087('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index d7613aa..ccd0673 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 _0x5e24=['last','UniqueConstraintError','Database\x20already\x20up-to-date','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','fetch','tags','latest','2.0.0','json','status','origin','master','info','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','.js','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'];(function(_0x37b95a,_0x1b14ea){var _0x263698=function(_0x3ca590){while(--_0x3ca590){_0x37b95a['push'](_0x37b95a['shift']());}};_0x263698(++_0x1b14ea);}(_0x5e24,0x102));var _0x45e2=function(_0x487526,_0x13e2c0){_0x487526=_0x487526-0x0;var _0x31a95e=_0x5e24[_0x487526];return _0x31a95e;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require(_0x45e2('0x0'));var pkginfo=require(_0x45e2('0x1'))(module,_0x45e2('0x2'));var compareVersions=require(_0x45e2('0x3'));var exec=require(_0x45e2('0x4'))[_0x45e2('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x45e2('0x6'));var pm2=require(_0x45e2('0x7'));var logger=require('../../config/logger')(_0x45e2('0x8'));var git=require(_0x45e2('0x9'))(config[_0x45e2('0xa')]);exports[_0x45e2('0xb')]=function(_0x1522c8,_0x525627){var _0x39f8da={'current':module[_0x45e2('0xc')][_0x45e2('0x2')],'phonebar':0x2};if(_0x1522c8['query']&&_0x1522c8[_0x45e2('0xd')]['latest']){return git[_0x45e2('0xe')]()[_0x45e2('0xf')](function(_0x3b1017,_0x3a26c4){_0x39f8da[_0x45e2('0x10')]=(_0x3b1017?module['exports']['version']:_0x3a26c4[_0x45e2('0x10')])||_0x45e2('0x11');return _0x525627['status'](0xc8)[_0x45e2('0x12')](_0x39f8da);});}else{return _0x525627[_0x45e2('0x13')](0xc8)[_0x45e2('0x12')](_0x39f8da);}};exports[_0x45e2('0xe')]=function(_0x3e4ded,_0x2b3f3c){return git['fetch']([_0x45e2('0x14'),_0x45e2('0x15')],function(_0x27697d){if(_0x27697d){logger['error'](_0x27697d);return _0x2b3f3c['status'](0x1f4)['json'](_0x27697d);}logger[_0x45e2('0x16')]('git\x20fetch');return _0x2b3f3c[_0x45e2('0x13')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x45e2('0x17')]=function(_0x4e70f9,_0x2ab4c6){return git['reset']([_0x45e2('0x18'),'FETCH_HEAD'],function(_0x45bbc9){if(_0x45bbc9){logger[_0x45e2('0x19')](_0x45bbc9);return _0x2ab4c6[_0x45e2('0x13')](0x1f4)[_0x45e2('0x12')](_0x45bbc9);}logger['info'](_0x45e2('0x1a'));return _0x2ab4c6[_0x45e2('0x13')](0xc8)[_0x45e2('0x12')]({'output':_0x45e2('0x1b')});});};exports[_0x45e2('0x1c')]=function(_0xbad46a,_0x2d342b){exec(_0x45e2('0x1d'),function(_0x4d6e54,_0x338118,_0x238d2a){logger['info'](_0x338118);logger[_0x45e2('0x16')](_0x238d2a);if(_0x4d6e54){logger[_0x45e2('0x19')](_0x4d6e54);return _0x2d342b[_0x45e2('0x13')](0x1f4)[_0x45e2('0x12')](_0x4d6e54);}return _0x2d342b[_0x45e2('0x13')](0xc8)[_0x45e2('0x12')]({'output':_0x338118});});};exports[_0x45e2('0x1e')]=function(_0x345e72,_0x484e43){return pm2['restart'](_0x45e2('0x1f'))[_0x45e2('0x20')](function(_0x37376c){logger['info']('pm2\x20restart\x20motion\x20%s',_0x37376c);return _0x484e43[_0x45e2('0x13')](0xc8)[_0x45e2('0x12')]({'output':_0x45e2('0x21')});})[_0x45e2('0x22')](function(_0x2e5628){logger[_0x45e2('0x19')](_0x2e5628);return _0x484e43['status'](0x1f4)[_0x45e2('0x12')](_0x2e5628);});};exports['migrations']=function(_0xb6067a,_0x442242){var _0x2e4084=fs[_0x45e2('0x23')](path[_0x45e2('0x24')](config['root'],_0x45e2('0x25'),_0x45e2('0x26')));var _0x2bb9a8=[];for(var _0x226d71=0x0;_0x226d71<_0x2e4084[_0x45e2('0x27')];_0x226d71++){var _0x397fd9=_0x2e4084[_0x226d71]['replace'](_0x45e2('0x28'),'');if(compareVersions(module[_0x45e2('0xc')][_0x45e2('0x2')],_0x397fd9)===-0x1){_0x2bb9a8['push'](_0x397fd9);}}if(_0x2bb9a8['length']){var _0x1c6e06=_0x2bb9a8['sort'](compareVersions);var _0x11adff=new Umzug({'storage':_0x45e2('0x29'),'storageOptions':{'model':db[_0x45e2('0x2a')],'modelName':_0x45e2('0x2a'),'columnName':_0x45e2('0x2')},'migrations':{'params':[db[_0x45e2('0x29')][_0x45e2('0x2b')](),db[_0x45e2('0x29')]['constructor'],function(){throw new Error(_0x45e2('0x2c'));}],'path':path[_0x45e2('0x24')](config[_0x45e2('0xa')],_0x45e2('0x25'),_0x45e2('0x26')),'pattern':/\.js$/}});_0x11adff['up']({'migrations':_[_0x45e2('0x2d')](_0x1c6e06,function(_0x342810){return _0x342810+_0x45e2('0x28');})})[_0x45e2('0x20')](function(){return _0x442242[_0x45e2('0x13')](0xc8)['json']({'output':_0x45e2('0x2e')+module['exports']['version']+_0x45e2('0x2f')+_[_0x45e2('0x30')](_0x1c6e06),'migrations':_['join'](_0x1c6e06)});})[_0x45e2('0x22')](function(_0x93fa7f){if(_0x93fa7f instanceof db['sequelize'][_0x45e2('0x31')]){return _0x442242[_0x45e2('0x13')](0xc8)[_0x45e2('0x12')]({'output':_0x45e2('0x32')});}else{return _0x442242[_0x45e2('0x13')](0x1f4)[_0x45e2('0x12')](_0x93fa7f);}});}else{return _0x442242['status'](0xc8)[_0x45e2('0x12')]({'output':_0x45e2('0x32')});}}; \ No newline at end of file +var _0xc31d=['motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','root','server','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.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','index','exports','version','query','latest','tags','2.0.0','status','json','fetch','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart'];(function(_0x58e5a9,_0x392bc2){var _0x565e70=function(_0x5d57bc){while(--_0x5d57bc){_0x58e5a9['push'](_0x58e5a9['shift']());}};_0x565e70(++_0x392bc2);}(_0xc31d,0x154));var _0xdc31=function(_0x55ef8b,_0x5deb5e){_0x55ef8b=_0x55ef8b-0x0;var _0x359c84=_0xc31d[_0x55ef8b];return _0x359c84;};'use strict';var Umzug=require(_0xdc31('0x0'));var path=require(_0xdc31('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xdc31('0x2'))(module,'version');var compareVersions=require(_0xdc31('0x3'));var exec=require(_0xdc31('0x4'))[_0xdc31('0x5')];var db=require(_0xdc31('0x6'))['db'];var config=require(_0xdc31('0x7'));var pm2=require(_0xdc31('0x8'));var logger=require('../../config/logger')(_0xdc31('0x9'));var git=require('simple-git')(config['root']);exports[_0xdc31('0xa')]=function(_0x5a5123,_0x1ff7c){var _0x4636b5={'current':module[_0xdc31('0xb')][_0xdc31('0xc')],'phonebar':0x2};if(_0x5a5123['query']&&_0x5a5123[_0xdc31('0xd')][_0xdc31('0xe')]){return git['fetch']()[_0xdc31('0xf')](function(_0x14c500,_0x19b172){_0x4636b5['latest']=(_0x14c500?module[_0xdc31('0xb')][_0xdc31('0xc')]:_0x19b172['latest'])||_0xdc31('0x10');return _0x1ff7c[_0xdc31('0x11')](0xc8)[_0xdc31('0x12')](_0x4636b5);});}else{return _0x1ff7c['status'](0xc8)[_0xdc31('0x12')](_0x4636b5);}};exports[_0xdc31('0x13')]=function(_0x4aab40,_0xb4cbf0){return git[_0xdc31('0x13')]([_0xdc31('0x14'),'master'],function(_0x117f17){if(_0x117f17){logger[_0xdc31('0x15')](_0x117f17);return _0xb4cbf0['status'](0x1f4)[_0xdc31('0x12')](_0x117f17);}logger[_0xdc31('0x16')](_0xdc31('0x17'));return _0xb4cbf0[_0xdc31('0x11')](0xc8)[_0xdc31('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xdc31('0x18')]=function(_0x1aa9eb,_0x4ec648){return git[_0xdc31('0x18')]([_0xdc31('0x19'),_0xdc31('0x1a')],function(_0x4f29dd){if(_0x4f29dd){logger[_0xdc31('0x15')](_0x4f29dd);return _0x4ec648[_0xdc31('0x11')](0x1f4)[_0xdc31('0x12')](_0x4f29dd);}logger[_0xdc31('0x16')](_0xdc31('0x1b'));return _0x4ec648[_0xdc31('0x11')](0xc8)[_0xdc31('0x12')]({'output':_0xdc31('0x1c')});});};exports['pull']=function(_0x2253f4,_0x160943){exec(_0xdc31('0x1d'),function(_0xa4442,_0x4f1d3c,_0x3eb272){logger[_0xdc31('0x16')](_0x4f1d3c);logger[_0xdc31('0x16')](_0x3eb272);if(_0xa4442){logger[_0xdc31('0x15')](_0xa4442);return _0x160943[_0xdc31('0x11')](0x1f4)[_0xdc31('0x12')](_0xa4442);}return _0x160943[_0xdc31('0x11')](0xc8)['json']({'output':_0x4f1d3c});});};exports[_0xdc31('0x1e')]=function(_0x1ee34c,_0x2cb26a){return pm2[_0xdc31('0x1e')](_0xdc31('0x1f'))[_0xdc31('0x20')](function(_0x5d3c58){logger[_0xdc31('0x16')](_0xdc31('0x21'),_0x5d3c58);return _0x2cb26a['status'](0xc8)[_0xdc31('0x12')]({'output':_0xdc31('0x22')});})[_0xdc31('0x23')](function(_0xde62e4){logger[_0xdc31('0x15')](_0xde62e4);return _0x2cb26a[_0xdc31('0x11')](0x1f4)['json'](_0xde62e4);});};exports[_0xdc31('0x24')]=function(_0x33dedc,_0x1cee41){var _0x4efd06=fs[_0xdc31('0x25')](path['join'](config[_0xdc31('0x26')],_0xdc31('0x27'),_0xdc31('0x24')));var _0x473e52=[];for(var _0x3b38c4=0x0;_0x3b38c4<_0x4efd06['length'];_0x3b38c4++){var _0x2b4c4b=_0x4efd06[_0x3b38c4][_0xdc31('0x28')](_0xdc31('0x29'),'');if(compareVersions(module[_0xdc31('0xb')][_0xdc31('0xc')],_0x2b4c4b)===-0x1){_0x473e52[_0xdc31('0x2a')](_0x2b4c4b);}}if(_0x473e52['length']){var _0x20fbb6=_0x473e52['sort'](compareVersions);var _0x35982c=new Umzug({'storage':_0xdc31('0x2b'),'storageOptions':{'model':db[_0xdc31('0x2c')],'modelName':_0xdc31('0x2c'),'columnName':_0xdc31('0xc')},'migrations':{'params':[db[_0xdc31('0x2b')][_0xdc31('0x2d')](),db[_0xdc31('0x2b')][_0xdc31('0x2e')],function(){throw new Error(_0xdc31('0x2f'));}],'path':path[_0xdc31('0x30')](config[_0xdc31('0x26')],_0xdc31('0x27'),_0xdc31('0x24')),'pattern':/\.js$/}});_0x35982c['up']({'migrations':_['map'](_0x20fbb6,function(_0x2d3709){return _0x2d3709+_0xdc31('0x29');})})[_0xdc31('0x20')](function(){return _0x1cee41[_0xdc31('0x11')](0xc8)['json']({'output':_0xdc31('0x31')+module[_0xdc31('0xb')][_0xdc31('0xc')]+'\x20to\x20'+_[_0xdc31('0x32')](_0x20fbb6),'migrations':_[_0xdc31('0x30')](_0x20fbb6)});})[_0xdc31('0x23')](function(_0x3c6b61){if(_0x3c6b61 instanceof db[_0xdc31('0x2b')][_0xdc31('0x33')]){return _0x1cee41[_0xdc31('0x11')](0xc8)['json']({'output':_0xdc31('0x34')});}else{return _0x1cee41[_0xdc31('0x11')](0x1f4)[_0xdc31('0x12')](_0x3c6b61);}});}else{return _0x1cee41[_0xdc31('0x11')](0xc8)[_0xdc31('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 7e53096..c45d218 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 _0x79c1=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','update','delete','/:id'];(function(_0x4d20ca,_0x282102){var _0xbc8a90=function(_0xd3b278){while(--_0xd3b278){_0x4d20ca['push'](_0x4d20ca['shift']());}};_0xbc8a90(++_0x282102);}(_0x79c1,0x1a4));var _0x179c=function(_0x308eb3,_0x4bc21b){_0x308eb3=_0x308eb3-0x0;var _0x2fbf0a=_0x79c1[_0x308eb3];return _0x2fbf0a;};'use strict';var multer=require(_0x179c('0x0'));var util=require(_0x179c('0x1'));var path=require(_0x179c('0x2'));var timeout=require(_0x179c('0x3'));var express=require(_0x179c('0x4'));var router=express[_0x179c('0x5')]();var fs_extra=require(_0x179c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x179c('0x7'));var config=require(_0x179c('0x8'));var controller=require('./voiceAgentReport.controller');router[_0x179c('0x9')]('/',auth[_0x179c('0xa')](),controller[_0x179c('0xb')]);router['get'](_0x179c('0xc'),auth[_0x179c('0xa')](),controller[_0x179c('0xd')]);router[_0x179c('0x9')]('/:id',auth[_0x179c('0xa')](),controller[_0x179c('0xe')]);router['post']('/',auth[_0x179c('0xa')](),controller[_0x179c('0xf')]);router[_0x179c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x179c('0x11')]);router[_0x179c('0x12')](_0x179c('0x13'),auth['isAuthenticated'](),controller[_0x179c('0x14')]);module[_0x179c('0x15')]=router; \ No newline at end of file +var _0xb055=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x34147a,_0x197be3){var _0x86635c=function(_0x582bce){while(--_0x582bce){_0x34147a['push'](_0x34147a['shift']());}};_0x86635c(++_0x197be3);}(_0xb055,0x18b));var _0x5b05=function(_0x36673b,_0x46840c){_0x36673b=_0x36673b-0x0;var _0x631f23=_0xb055[_0x36673b];return _0x631f23;};'use strict';var multer=require(_0x5b05('0x0'));var util=require(_0x5b05('0x1'));var path=require(_0x5b05('0x2'));var timeout=require(_0x5b05('0x3'));var express=require(_0x5b05('0x4'));var router=express[_0x5b05('0x5')]();var fs_extra=require(_0x5b05('0x6'));var auth=require(_0x5b05('0x7'));var interaction=require(_0x5b05('0x8'));var config=require('../../config/environment');var controller=require(_0x5b05('0x9'));router[_0x5b05('0xa')]('/',auth[_0x5b05('0xb')](),controller[_0x5b05('0xc')]);router[_0x5b05('0xa')](_0x5b05('0xd'),auth[_0x5b05('0xb')](),controller[_0x5b05('0xe')]);router[_0x5b05('0xa')]('/:id',auth[_0x5b05('0xb')](),controller[_0x5b05('0xf')]);router[_0x5b05('0x10')]('/',auth['isAuthenticated'](),controller[_0x5b05('0x11')]);router[_0x5b05('0x12')](_0x5b05('0x13'),auth[_0x5b05('0xb')](),controller[_0x5b05('0x14')]);router[_0x5b05('0x15')]('/:id',auth[_0x5b05('0xb')](),controller['destroy']);module[_0x5b05('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index c0e2439..126a127 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 _0x373d=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','INTEGER'];(function(_0x203708,_0x49df8f){var _0x509c4d=function(_0x237897){while(--_0x237897){_0x203708['push'](_0x203708['shift']());}};_0x509c4d(++_0x49df8f);}(_0x373d,0x1e2));var _0xd373=function(_0x115d1f,_0xc8262){_0x115d1f=_0x115d1f-0x0;var _0x357a9e=_0x373d[_0x115d1f];return _0x357a9e;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'type':{'type':Sequelize[_0xd373('0x1')]},'uniqueid':{'type':Sequelize[_0xd373('0x1')]},'calleridnum':{'type':Sequelize[_0xd373('0x1')]},'calleridname':{'type':Sequelize[_0xd373('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd373('0x1')]},'membername':{'type':Sequelize[_0xd373('0x1')]},'agentcalledAt':{'type':Sequelize[_0xd373('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xd373('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd373('0x2')]},'holdtime':{'type':Sequelize[_0xd373('0x3')]},'agentcomplete':{'type':Sequelize[_0xd373('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd373('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xd373('0x1')]},'lastevent':{'type':Sequelize[_0xd373('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xd373('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd373('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd373('0x1')]},'accountcode':{'type':Sequelize[_0xd373('0x1')]},'context':{'type':Sequelize[_0xd373('0x1')]},'exten':{'type':Sequelize[_0xd373('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd373('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd373('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xd373('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd373('0x1')]},'destlanguage':{'type':Sequelize[_0xd373('0x1')]},'destaccountcode':{'type':Sequelize[_0xd373('0x1')]},'destcontext':{'type':Sequelize[_0xd373('0x1')]},'destexten':{'type':Sequelize[_0xd373('0x1')]},'destpriority':{'type':Sequelize[_0xd373('0x1')]},'destuniqueid':{'type':Sequelize[_0xd373('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd373('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd373('0x1')]},'transfer':{'type':Sequelize[_0xd373('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd373('0x1')],'comment':_0xd373('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xd373('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c1a=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2240d8,_0x413b9f){var _0x12509f=function(_0x42dc08){while(--_0x42dc08){_0x2240d8['push'](_0x2240d8['shift']());}};_0x12509f(++_0x413b9f);}(_0x0c1a,0x127));var _0xa0c1=function(_0x26fa5d,_0x4aa009){_0x26fa5d=_0x26fa5d-0x0;var _0x23a88d=_0x0c1a[_0x26fa5d];return _0x23a88d;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'type':{'type':Sequelize[_0xa0c1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa0c1('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xa0c1('0x2')]},'membername':{'type':Sequelize[_0xa0c1('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentconnectAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xa0c1('0x3')]},'agentdumpAt':{'type':Sequelize[_0xa0c1('0x3')]},'holdtime':{'type':Sequelize[_0xa0c1('0x4')]},'agentcomplete':{'type':Sequelize[_0xa0c1('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa0c1('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xa0c1('0x4')]},'agentacw':{'type':Sequelize[_0xa0c1('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa0c1('0x4')]},'reason':{'type':Sequelize[_0xa0c1('0x2')]},'lastevent':{'type':Sequelize[_0xa0c1('0x2')]},'channel':{'type':Sequelize[_0xa0c1('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xa0c1('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa0c1('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa0c1('0x2')]},'exten':{'type':Sequelize[_0xa0c1('0x2')]},'priority':{'type':Sequelize[_0xa0c1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa0c1('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xa0c1('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa0c1('0x2')]},'destcalleridname':{'type':Sequelize[_0xa0c1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa0c1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa0c1('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xa0c1('0x2')]},'destexten':{'type':Sequelize[_0xa0c1('0x2')]},'destpriority':{'type':Sequelize[_0xa0c1('0x2')]},'destuniqueid':{'type':Sequelize[_0xa0c1('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa0c1('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa0c1('0x2')],'comment':_0xa0c1('0x6')},'transferexten':{'type':Sequelize[_0xa0c1('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa0c1('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 112688f..de753fc 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(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 7cbdc00..fa6a598 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 _0x165d=['request-promise','rimraf','../../config/environment','define','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3934fd,_0x4b3112){var _0xdd27ab=function(_0x357117){while(--_0x357117){_0x3934fd['push'](_0x3934fd['shift']());}};_0xdd27ab(++_0x4b3112);}(_0x165d,0x14a));var _0xd165=function(_0x4ef780,_0x3c837c){_0x4ef780=_0x4ef780-0x0;var _0x245e80=_0x165d[_0x4ef780];return _0x245e80;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var logger=require(_0xd165('0x2'))(_0xd165('0x3'));var moment=require(_0xd165('0x4'));var BPromise=require(_0xd165('0x5'));var rp=require(_0xd165('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x5435f9,_0x42d256){return _0x5435f9[_0xd165('0x9')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd165('0xa'),_0xd165('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd6e=['moment','bluebird','../../config/environment','define','VoiceAgentReport','report_agent','lodash','../../config/logger'];(function(_0x322fe5,_0x348c12){var _0x15af2e=function(_0x2fe63a){while(--_0x2fe63a){_0x322fe5['push'](_0x322fe5['shift']());}};_0x15af2e(++_0x348c12);}(_0xfd6e,0x16e));var _0xefd6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfd6e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xefd6('0x0'));var util=require('util');var logger=require(_0xefd6('0x1'))('api');var moment=require(_0xefd6('0x2'));var BPromise=require(_0xefd6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xefd6('0x4'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x24af45,_0x23f8c3){return _0x24af45[_0xefd6('0x5')](_0xefd6('0x6'),attributes,{'tableName':_0xefd6('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 6803ec5..ed7025e 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 _0x8c2b=['then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','debug','UpdateVoiceAgentReport','update','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x2a566f,_0x19a56a){var _0x298923=function(_0x94ae08){while(--_0x94ae08){_0x2a566f['push'](_0x2a566f['shift']());}};_0x298923(++_0x19a56a);}(_0x8c2b,0xdb));var _0xb8c2=function(_0x39770f,_0xd17465){_0x39770f=_0x39770f-0x0;var _0x58b918=_0x8c2b[_0x39770f];return _0x58b918;};'use strict';var _=require(_0xb8c2('0x0'));var util=require(_0xb8c2('0x1'));var moment=require(_0xb8c2('0x2'));var BPromise=require('bluebird');var rs=require(_0xb8c2('0x3'));var fs=require('fs');var Redis=require(_0xb8c2('0x4'));var db=require(_0xb8c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8c2('0x6'))('rpc');var config=require(_0xb8c2('0x7'));var jayson=require(_0xb8c2('0x8'));var client=jayson[_0xb8c2('0x9')][_0xb8c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x490a95,_0xc45547,_0x225b91){return new BPromise(function(_0x54d62e,_0x36b5c6){return client[_0xb8c2('0xb')](_0x490a95,_0x225b91)[_0xb8c2('0xc')](function(_0x1ea95f){logger[_0xb8c2('0xd')](_0xb8c2('0xe'),_0xc45547,_0xb8c2('0xf'));logger['debug'](_0xb8c2('0x10'),_0xc45547,_0xb8c2('0xf'),JSON[_0xb8c2('0x11')](_0x1ea95f));if(_0x1ea95f['error']){if(_0x1ea95f[_0xb8c2('0x12')][_0xb8c2('0x13')]===0x1f4){logger[_0xb8c2('0x12')](_0xb8c2('0xe'),_0xc45547,_0x1ea95f[_0xb8c2('0x12')]['message']);return _0x36b5c6(_0x1ea95f['error']['message']);}logger[_0xb8c2('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0xc45547,_0x1ea95f[_0xb8c2('0x12')][_0xb8c2('0x14')]);return _0x54d62e(_0x1ea95f[_0xb8c2('0x12')][_0xb8c2('0x14')]);}else{logger[_0xb8c2('0xd')](_0xb8c2('0xe'),_0xc45547,_0xb8c2('0xf'));_0x54d62e(_0x1ea95f['result']['message']);}})[_0xb8c2('0x15')](function(_0x1928ab){logger[_0xb8c2('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0xc45547,_0x1928ab);_0x36b5c6(_0x1928ab);});});}exports['CreateVoiceAgentReport']=function(_0x1135b8){var _0x5db97f=this;return new Promise(function(_0xb595d6,_0x21ae50){return db[_0xb8c2('0x16')][_0xb8c2('0x17')](_0x1135b8[_0xb8c2('0x18')],{'raw':_0x1135b8[_0xb8c2('0x19')]?_0x1135b8[_0xb8c2('0x19')][_0xb8c2('0x1a')]===undefined?!![]:![]:!![]})[_0xb8c2('0xc')](function(_0x5bbac0){logger[_0xb8c2('0xd')](_0xb8c2('0x1b'),_0x1135b8);logger[_0xb8c2('0x1c')]('CreateVoiceAgentReport',_0x1135b8,JSON[_0xb8c2('0x11')](_0x5bbac0));_0xb595d6(_0x5bbac0);})['catch'](function(_0x4d79a1){logger[_0xb8c2('0x12')](_0xb8c2('0x1b'),_0x4d79a1[_0xb8c2('0x14')],_0x1135b8);_0x21ae50(_0x5db97f[_0xb8c2('0x12')](0x1f4,_0x4d79a1['message']));});});};exports[_0xb8c2('0x1d')]=function(_0x107b80){var _0x3796d6=this;return new Promise(function(_0x3e019b,_0x2ed61c){return db[_0xb8c2('0x16')][_0xb8c2('0x1e')](_0x107b80[_0xb8c2('0x18')],{'raw':_0x107b80[_0xb8c2('0x19')]?_0x107b80[_0xb8c2('0x19')][_0xb8c2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x107b80['options']?_0x107b80[_0xb8c2('0x19')][_0xb8c2('0x1f')]||null:null,'attributes':_0x107b80[_0xb8c2('0x19')]?_0x107b80[_0xb8c2('0x19')][_0xb8c2('0x20')]||null:null,'limit':_0x107b80[_0xb8c2('0x19')]?_0x107b80[_0xb8c2('0x19')]['limit']||null:null})['then'](function(_0x5c5a08){logger[_0xb8c2('0xd')](_0xb8c2('0x1d'),_0x107b80);logger[_0xb8c2('0x1c')](_0xb8c2('0x1d'),_0x107b80,JSON[_0xb8c2('0x11')](_0x5c5a08));_0x3e019b(_0x5c5a08);})[_0xb8c2('0x15')](function(_0xf79930){logger[_0xb8c2('0x12')](_0xb8c2('0x1d'),_0xf79930[_0xb8c2('0x14')],_0x107b80);_0x2ed61c(_0x3796d6[_0xb8c2('0x12')](0x1f4,_0xf79930['message']));});});}; \ No newline at end of file +var _0x901e=['catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','UpdateVoiceAgentReport','update','body','raw','where','attributes','debug','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message'];(function(_0x24eb2f,_0x361426){var _0x231c1b=function(_0x49cc7d){while(--_0x49cc7d){_0x24eb2f['push'](_0x24eb2f['shift']());}};_0x231c1b(++_0x361426);}(_0x901e,0x1a2));var _0xe901=function(_0x8935ce,_0x3621c3){_0x8935ce=_0x8935ce-0x0;var _0x1a422f=_0x901e[_0x8935ce];return _0x1a422f;};'use strict';var _=require(_0xe901('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe901('0x1'));var rs=require(_0xe901('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe901('0x3'));var logger=require(_0xe901('0x4'))(_0xe901('0x5'));var config=require(_0xe901('0x6'));var jayson=require(_0xe901('0x7'));var client=jayson[_0xe901('0x8')][_0xe901('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3efffb,_0x3aa075,_0x1c3edf){return new BPromise(function(_0xcb6144,_0x4da617){return client['request'](_0x3efffb,_0x1c3edf)[_0xe901('0xa')](function(_0x45ea7d){logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x3aa075,_0xe901('0xb'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x3aa075,_0xe901('0xb'),JSON[_0xe901('0xc')](_0x45ea7d));if(_0x45ea7d[_0xe901('0xd')]){if(_0x45ea7d[_0xe901('0xd')][_0xe901('0xe')]===0x1f4){logger['error'](_0xe901('0xf'),_0x3aa075,_0x45ea7d['error']['message']);return _0x4da617(_0x45ea7d[_0xe901('0xd')][_0xe901('0x10')]);}logger[_0xe901('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x3aa075,_0x45ea7d[_0xe901('0xd')]['message']);return _0xcb6144(_0x45ea7d[_0xe901('0xd')][_0xe901('0x10')]);}else{logger['info'](_0xe901('0xf'),_0x3aa075,_0xe901('0xb'));_0xcb6144(_0x45ea7d['result'][_0xe901('0x10')]);}})[_0xe901('0x11')](function(_0x5d4498){logger[_0xe901('0xd')](_0xe901('0xf'),_0x3aa075,_0x5d4498);_0x4da617(_0x5d4498);});});}exports[_0xe901('0x12')]=function(_0x4d60d8){var _0x1745d6=this;return new Promise(function(_0x5c35f3,_0x18e0e7){return db[_0xe901('0x13')][_0xe901('0x14')](_0x4d60d8['body'],{'raw':_0x4d60d8[_0xe901('0x15')]?_0x4d60d8[_0xe901('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xe901('0xa')](function(_0x5872f4){logger['info'](_0xe901('0x12'),_0x4d60d8);logger['debug'](_0xe901('0x12'),_0x4d60d8,JSON['stringify'](_0x5872f4));_0x5c35f3(_0x5872f4);})[_0xe901('0x11')](function(_0x4b3df9){logger[_0xe901('0xd')]('CreateVoiceAgentReport',_0x4b3df9[_0xe901('0x10')],_0x4d60d8);_0x18e0e7(_0x1745d6[_0xe901('0xd')](0x1f4,_0x4b3df9[_0xe901('0x10')]));});});};exports[_0xe901('0x16')]=function(_0x43b9af){var _0x43d3d3=this;return new Promise(function(_0x3b7556,_0x1f1b0a){return db['VoiceAgentReport'][_0xe901('0x17')](_0x43b9af[_0xe901('0x18')],{'raw':_0x43b9af[_0xe901('0x15')]?_0x43b9af[_0xe901('0x15')][_0xe901('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43b9af['options']?_0x43b9af[_0xe901('0x15')][_0xe901('0x1a')]||null:null,'attributes':_0x43b9af[_0xe901('0x15')]?_0x43b9af[_0xe901('0x15')][_0xe901('0x1b')]||null:null,'limit':_0x43b9af['options']?_0x43b9af[_0xe901('0x15')]['limit']||null:null})['then'](function(_0x4b9ee0){logger['info'](_0xe901('0x16'),_0x43b9af);logger[_0xe901('0x1c')]('UpdateVoiceAgentReport',_0x43b9af,JSON[_0xe901('0xc')](_0x4b9ee0));_0x3b7556(_0x4b9ee0);})['catch'](function(_0x577386){logger['error'](_0xe901('0x16'),_0x577386['message'],_0x43b9af);_0x1f1b0a(_0x43d3d3[_0xe901('0xd')](0x1f4,_0x577386[_0xe901('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 8cee675..904d10f 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 _0x84e7=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x84e7,0x122));var _0x784e=function(_0x437da0,_0x2cdea7){_0x437da0=_0x437da0-0x0;var _0x7a0f3a=_0x84e7[_0x437da0];return _0x7a0f3a;};'use strict';var multer=require('multer');var util=require(_0x784e('0x0'));var path=require(_0x784e('0x1'));var timeout=require('connect-timeout');var express=require(_0x784e('0x2'));var router=express[_0x784e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x784e('0x4'));var interaction=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var controller=require(_0x784e('0x7'));router[_0x784e('0x8')]('/',auth[_0x784e('0x9')](),controller['index']);router[_0x784e('0x8')]('/describe',auth[_0x784e('0x9')](),controller[_0x784e('0xa')]);router['get'](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0xc')]);router[_0x784e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x784e('0xe')](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0xf')]);router['delete'](_0x784e('0xb'),auth[_0x784e('0x9')](),controller[_0x784e('0x10')]);module[_0x784e('0x11')]=router; \ No newline at end of file +var _0x50a6=['create','/:id','update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show'];(function(_0x79ce22,_0x47281e){var _0x6a1cd4=function(_0x16804d){while(--_0x16804d){_0x79ce22['push'](_0x79ce22['shift']());}};_0x6a1cd4(++_0x47281e);}(_0x50a6,0xa4));var _0x650a=function(_0x4ec612,_0x57dfd6){_0x4ec612=_0x4ec612-0x0;var _0x52a015=_0x50a6[_0x4ec612];return _0x52a015;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),auth[_0x650a('0xa')](),controller['describe']);router[_0x650a('0x8')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0xb')]);router['post']('/',auth[_0x650a('0xa')](),controller[_0x650a('0xc')]);router['put'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xe')]);router['delete'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 6698afe..6ee2764 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 _0xab95=['exports','STRING','inbound','internal','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x38a94c,_0x5316f5){var _0x161c6c=function(_0xf9bd1){while(--_0xf9bd1){_0x38a94c['push'](_0x38a94c['shift']());}};_0x161c6c(++_0x5316f5);}(_0xab95,0x1d5));var _0x5ab9=function(_0x248cda,_0x76bbbe){_0x248cda=_0x248cda-0x0;var _0x481df7=_0xab95[_0x248cda];return _0x481df7;};'use strict';var Sequelize=require(_0x5ab9('0x0'));module[_0x5ab9('0x1')]={'uniqueid':{'type':Sequelize[_0x5ab9('0x2')]},'type':{'type':Sequelize['ENUM'](_0x5ab9('0x3'),_0x5ab9('0x4'),'outbound','inbound-fax',_0x5ab9('0x5'),_0x5ab9('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5ab9('0x2')]},'source':{'type':Sequelize[_0x5ab9('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x5ab9('0x2')]},'callerid':{'type':Sequelize[_0x5ab9('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x5ab9('0x2')]},'lastapplication':{'type':Sequelize[_0x5ab9('0x2')]},'lastdata':{'type':Sequelize[_0x5ab9('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5ab9('0x8')]},'endtime':{'type':Sequelize[_0x5ab9('0x8')]},'duration':{'type':Sequelize[_0x5ab9('0x9')]},'billableseconds':{'type':Sequelize[_0x5ab9('0x9')]},'mohtime':{'type':Sequelize[_0x5ab9('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x5ab9('0x2')]},'userDisposition':{'type':Sequelize[_0x5ab9('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x5ab9('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5ab9('0x2')]},'routeid':{'type':Sequelize[_0x5ab9('0x9')]},'sipcallid':{'type':Sequelize[_0x5ab9('0x2')]}}; \ No newline at end of file +var _0x6208=['inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound','internal','outbound'];(function(_0xc26ee9,_0x125f39){var _0x989625=function(_0x20a366){while(--_0x20a366){_0xc26ee9['push'](_0xc26ee9['shift']());}};_0x989625(++_0x125f39);}(_0x6208,0x192));var _0x8620=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0x6208[_0x4370c7];return _0xce78a9;};'use strict';var Sequelize=require('sequelize');module[_0x8620('0x0')]={'uniqueid':{'type':Sequelize[_0x8620('0x1')]},'type':{'type':Sequelize[_0x8620('0x2')](_0x8620('0x3'),_0x8620('0x4'),_0x8620('0x5'),_0x8620('0x6'),_0x8620('0x7'),_0x8620('0x8'))},'tag':{'type':Sequelize[_0x8620('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x8620('0x1')]},'destination':{'type':Sequelize[_0x8620('0x1')]},'destinationcontext':{'type':Sequelize[_0x8620('0x1')]},'callerid':{'type':Sequelize[_0x8620('0x1')]},'channel':{'type':Sequelize[_0x8620('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x8620('0x1')]},'lastdata':{'type':Sequelize[_0x8620('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x8620('0xa')]},'answertime':{'type':Sequelize[_0x8620('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x8620('0xb')]},'billableseconds':{'type':Sequelize[_0x8620('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8620('0x1')]},'amaflags':{'type':Sequelize[_0x8620('0x1')]},'userfield':{'type':Sequelize[_0x8620('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x8620('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x8620('0x1')]},'note':{'type':Sequelize[_0x8620('0x1')]},'prefix':{'type':Sequelize[_0x8620('0x1')]},'routeid':{'type':Sequelize[_0x8620('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 788d469..c025331 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 _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','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','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2f2d70,_0x1063a2){_0x2f2d70=_0x2f2d70-0x0;var _0x28aefa=_0x5f2f[_0x2f2d70];return _0x28aefa;};'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')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,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(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0xadb5,0xad));var _0x5adb=function(_0x4effc9,_0x56d324){_0x4effc9=_0x4effc9-0x0;var _0x164d26=_0xadb5[_0x4effc9];return _0x164d26;};'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 3562a87..2dad164 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 _0x3d4f=['report_call','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x3d4f,0x1bb));var _0xf3d4=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x3d4f[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0xf3d4('0x0'));var util=require(_0xf3d4('0x1'));var logger=require(_0xf3d4('0x2'))(_0xf3d4('0x3'));var moment=require(_0xf3d4('0x4'));var BPromise=require('bluebird');var rp=require(_0xf3d4('0x5'));var fs=require('fs');var path=require(_0xf3d4('0x6'));var rimraf=require(_0xf3d4('0x7'));var config=require(_0xf3d4('0x8'));var attributes=require('./voiceCallReport.attributes');module[_0xf3d4('0x9')]=function(_0x34c138,_0x2c1afc){return _0x34c138[_0xf3d4('0xa')](_0xf3d4('0xb'),attributes,{'tableName':_0xf3d4('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf7a=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x500112,_0x10e0c2){var _0x2d3ed1=function(_0x43fd40){while(--_0x43fd40){_0x500112['push'](_0x500112['shift']());}};_0x2d3ed1(++_0x10e0c2);}(_0xaf7a,0x85));var _0xaaf7=function(_0x49ba97,_0x49e689){_0x49ba97=_0x49ba97-0x0;var _0x259b60=_0xaf7a[_0x49ba97];return _0x259b60;};'use strict';var _=require(_0xaaf7('0x0'));var util=require(_0xaaf7('0x1'));var logger=require(_0xaaf7('0x2'))(_0xaaf7('0x3'));var moment=require(_0xaaf7('0x4'));var BPromise=require(_0xaaf7('0x5'));var rp=require(_0xaaf7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaf7('0x7'));var config=require(_0xaaf7('0x8'));var attributes=require(_0xaaf7('0x9'));module[_0xaaf7('0xa')]=function(_0x222ca2,_0x47c823){return _0x222ca2['define'](_0xaaf7('0xb'),attributes,{'tableName':_0xaaf7('0xc'),'paranoid':![],'indexes':[{'fields':[_0xaaf7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 27d5e37..85a3355 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 _0xea45=['VoiceCallReport','findAll','options','raw','where','attributes','limit','map','model','include','catch','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetVoiceCallReport'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xea45,0xa4));var _0x5ea4=function(_0x433191,_0x521385){_0x433191=_0x433191-0x0;var _0x3b92e7=_0xea45[_0x433191];return _0x3b92e7;};'use strict';var _=require(_0x5ea4('0x0'));var util=require(_0x5ea4('0x1'));var moment=require('moment');var BPromise=require(_0x5ea4('0x2'));var rs=require(_0x5ea4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ea4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ea4('0x5'))(_0x5ea4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5ea4('0x7')][_0x5ea4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x36dda5,_0x152ad5,_0x2af699){return new BPromise(function(_0x3b4555,_0x37b009){return client[_0x5ea4('0x9')](_0x36dda5,_0x2af699)[_0x5ea4('0xa')](function(_0x4ac92d){logger[_0x5ea4('0xb')](_0x5ea4('0xc'),_0x152ad5,'request\x20sent');logger[_0x5ea4('0xd')](_0x5ea4('0xe'),_0x152ad5,_0x5ea4('0xf'),JSON[_0x5ea4('0x10')](_0x4ac92d));if(_0x4ac92d[_0x5ea4('0x11')]){if(_0x4ac92d[_0x5ea4('0x11')][_0x5ea4('0x12')]===0x1f4){logger[_0x5ea4('0x11')](_0x5ea4('0xc'),_0x152ad5,_0x4ac92d['error'][_0x5ea4('0x13')]);return _0x37b009(_0x4ac92d['error'][_0x5ea4('0x13')]);}logger[_0x5ea4('0x11')](_0x5ea4('0xc'),_0x152ad5,_0x4ac92d[_0x5ea4('0x11')][_0x5ea4('0x13')]);return _0x3b4555(_0x4ac92d[_0x5ea4('0x11')][_0x5ea4('0x13')]);}else{logger[_0x5ea4('0xb')](_0x5ea4('0xc'),_0x152ad5,_0x5ea4('0xf'));_0x3b4555(_0x4ac92d['result']['message']);}})['catch'](function(_0x47c230){logger[_0x5ea4('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x152ad5,_0x47c230);_0x37b009(_0x47c230);});});}exports[_0x5ea4('0x14')]=function(_0x1c87b0){var _0x1badfa=this;return new Promise(function(_0x4386d2,_0x1cf038){return db[_0x5ea4('0x15')][_0x5ea4('0x16')]({'raw':_0x1c87b0[_0x5ea4('0x17')]?_0x1c87b0['options'][_0x5ea4('0x18')]===undefined?!![]:![]:!![],'where':_0x1c87b0[_0x5ea4('0x17')]?_0x1c87b0['options'][_0x5ea4('0x19')]||null:null,'attributes':_0x1c87b0['options']?_0x1c87b0[_0x5ea4('0x17')][_0x5ea4('0x1a')]||null:null,'limit':_0x1c87b0[_0x5ea4('0x17')]?_0x1c87b0[_0x5ea4('0x17')][_0x5ea4('0x1b')]||null:null,'include':_0x1c87b0[_0x5ea4('0x17')]?_0x1c87b0[_0x5ea4('0x17')]['include']?_[_0x5ea4('0x1c')](_0x1c87b0[_0x5ea4('0x17')]['include'],function(_0x2b2fdb){return{'model':db[_0x2b2fdb[_0x5ea4('0x1d')]],'as':_0x2b2fdb['as'],'attributes':_0x2b2fdb[_0x5ea4('0x1a')],'include':_0x2b2fdb['include']?_['map'](_0x2b2fdb['include'],function(_0x354f0a){return{'model':db[_0x354f0a[_0x5ea4('0x1d')]],'as':_0x354f0a['as'],'attributes':_0x354f0a[_0x5ea4('0x1a')],'include':_0x354f0a[_0x5ea4('0x1e')]?_['map'](_0x354f0a[_0x5ea4('0x1e')],function(_0x35c618){return{'model':db[_0x35c618[_0x5ea4('0x1d')]],'as':_0x35c618['as'],'attributes':_0x35c618[_0x5ea4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3359ce){logger[_0x5ea4('0xb')](_0x5ea4('0x14'),_0x1c87b0);logger[_0x5ea4('0xd')](_0x5ea4('0x14'),_0x1c87b0,JSON[_0x5ea4('0x10')](_0x3359ce));_0x4386d2(_0x3359ce);})[_0x5ea4('0x1f')](function(_0x49a94d){logger[_0x5ea4('0x11')](_0x5ea4('0x14'),_0x49a94d['message'],_0x1c87b0);_0x1cf038(_0x1badfa[_0x5ea4('0x11')](0x1f4,_0x49a94d[_0x5ea4('0x13')]));});});};exports[_0x5ea4('0x20')]=function(_0x4e6525){var _0x5e1c40=this;return new Promise(function(_0x436e50,_0x5701bc){return db[_0x5ea4('0x15')][_0x5ea4('0x21')](_0x4e6525[_0x5ea4('0x22')],{'raw':_0x4e6525['options']?_0x4e6525[_0x5ea4('0x17')][_0x5ea4('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x422a22){logger[_0x5ea4('0xb')](_0x5ea4('0x20'),_0x4e6525);logger[_0x5ea4('0xd')]('CreateVoiceCallReport',_0x4e6525,JSON[_0x5ea4('0x10')](_0x422a22));_0x436e50(_0x422a22);})[_0x5ea4('0x1f')](function(_0x41bac8){logger[_0x5ea4('0x11')](_0x5ea4('0x20'),_0x41bac8['message'],_0x4e6525);_0x5701bc(_0x5e1c40[_0x5ea4('0x11')](0x1f4,_0x41bac8['message']));});});};exports[_0x5ea4('0x23')]=function(_0x5461fd){var _0x1aab22=this;return new Promise(function(_0x2a56ca,_0x4f64e9){return db[_0x5ea4('0x15')][_0x5ea4('0x24')](_0x5461fd[_0x5ea4('0x22')],{'raw':_0x5461fd[_0x5ea4('0x17')]?_0x5461fd[_0x5ea4('0x17')][_0x5ea4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5461fd['options']?_0x5461fd[_0x5ea4('0x17')]['where']||null:null,'attributes':_0x5461fd['options']?_0x5461fd['options'][_0x5ea4('0x1a')]||null:null,'limit':_0x5461fd[_0x5ea4('0x17')]?_0x5461fd['options']['limit']||null:null})[_0x5ea4('0xa')](function(_0xaf4bc2){logger[_0x5ea4('0xb')]('UpdateVoiceCallReport',_0x5461fd);logger[_0x5ea4('0xd')](_0x5ea4('0x23'),_0x5461fd,JSON[_0x5ea4('0x10')](_0xaf4bc2));_0x2a56ca(_0xaf4bc2);})[_0x5ea4('0x1f')](function(_0x49ed13){logger[_0x5ea4('0x11')](_0x5ea4('0x23'),_0x49ed13[_0x5ea4('0x13')],_0x5461fd);_0x4f64e9(_0x1aab22['error'](0x1f4,_0x49ed13[_0x5ea4('0x13')]));});});}; \ No newline at end of file +var _0x2e0a=['request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','attributes','limit','include','map','model','debug','CreateVoiceCallReport','create','body','where','UpdateVoiceCallReport','lodash','util','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s'];(function(_0x122260,_0x2ddb23){var _0x3efb13=function(_0x1fb5a8){while(--_0x1fb5a8){_0x122260['push'](_0x122260['shift']());}};_0x3efb13(++_0x2ddb23);}(_0x2e0a,0x148));var _0xa2e0=function(_0x4966b5,_0x4c8934){_0x4966b5=_0x4966b5-0x0;var _0x2db608=_0x2e0a[_0x4966b5];return _0x2db608;};'use strict';var _=require(_0xa2e0('0x0'));var util=require(_0xa2e0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa2e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2e0('0x3'));var logger=require('../../config/logger')(_0xa2e0('0x4'));var config=require('../../config/environment');var jayson=require(_0xa2e0('0x5'));var client=jayson[_0xa2e0('0x6')][_0xa2e0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x319771,_0x20e05c,_0x411278){return new BPromise(function(_0x4140a2,_0x3e0cab){return client['request'](_0x319771,_0x411278)[_0xa2e0('0x8')](function(_0x35de98){logger[_0xa2e0('0x9')](_0xa2e0('0xa'),_0x20e05c,'request\x20sent');logger['debug'](_0xa2e0('0xb'),_0x20e05c,_0xa2e0('0xc'),JSON[_0xa2e0('0xd')](_0x35de98));if(_0x35de98[_0xa2e0('0xe')]){if(_0x35de98['error'][_0xa2e0('0xf')]===0x1f4){logger['error'](_0xa2e0('0xa'),_0x20e05c,_0x35de98[_0xa2e0('0xe')]['message']);return _0x3e0cab(_0x35de98[_0xa2e0('0xe')]['message']);}logger[_0xa2e0('0xe')](_0xa2e0('0xa'),_0x20e05c,_0x35de98[_0xa2e0('0xe')][_0xa2e0('0x10')]);return _0x4140a2(_0x35de98[_0xa2e0('0xe')]['message']);}else{logger[_0xa2e0('0x9')](_0xa2e0('0xa'),_0x20e05c,_0xa2e0('0xc'));_0x4140a2(_0x35de98[_0xa2e0('0x11')][_0xa2e0('0x10')]);}})[_0xa2e0('0x12')](function(_0x1d832d){logger[_0xa2e0('0xe')](_0xa2e0('0xa'),_0x20e05c,_0x1d832d);_0x3e0cab(_0x1d832d);});});}exports[_0xa2e0('0x13')]=function(_0x10e03f){var _0x4d5de2=this;return new Promise(function(_0x26f183,_0x59e19a){return db[_0xa2e0('0x14')]['findAll']({'raw':_0x10e03f[_0xa2e0('0x15')]?_0x10e03f[_0xa2e0('0x15')][_0xa2e0('0x16')]===undefined?!![]:![]:!![],'where':_0x10e03f['options']?_0x10e03f['options']['where']||null:null,'attributes':_0x10e03f[_0xa2e0('0x15')]?_0x10e03f[_0xa2e0('0x15')][_0xa2e0('0x17')]||null:null,'limit':_0x10e03f[_0xa2e0('0x15')]?_0x10e03f[_0xa2e0('0x15')][_0xa2e0('0x18')]||null:null,'include':_0x10e03f[_0xa2e0('0x15')]?_0x10e03f[_0xa2e0('0x15')][_0xa2e0('0x19')]?_[_0xa2e0('0x1a')](_0x10e03f[_0xa2e0('0x15')][_0xa2e0('0x19')],function(_0x5896e6){return{'model':db[_0x5896e6[_0xa2e0('0x1b')]],'as':_0x5896e6['as'],'attributes':_0x5896e6['attributes'],'include':_0x5896e6[_0xa2e0('0x19')]?_[_0xa2e0('0x1a')](_0x5896e6[_0xa2e0('0x19')],function(_0x5988fd){return{'model':db[_0x5988fd[_0xa2e0('0x1b')]],'as':_0x5988fd['as'],'attributes':_0x5988fd[_0xa2e0('0x17')],'include':_0x5988fd[_0xa2e0('0x19')]?_[_0xa2e0('0x1a')](_0x5988fd[_0xa2e0('0x19')],function(_0x5a7f28){return{'model':db[_0x5a7f28[_0xa2e0('0x1b')]],'as':_0x5a7f28['as'],'attributes':_0x5a7f28['attributes']};}):[]};}):[]};}):[]:[]})[_0xa2e0('0x8')](function(_0x5453f2){logger[_0xa2e0('0x9')]('GetVoiceCallReport',_0x10e03f);logger[_0xa2e0('0x1c')](_0xa2e0('0x13'),_0x10e03f,JSON['stringify'](_0x5453f2));_0x26f183(_0x5453f2);})[_0xa2e0('0x12')](function(_0x14b11a){logger[_0xa2e0('0xe')](_0xa2e0('0x13'),_0x14b11a[_0xa2e0('0x10')],_0x10e03f);_0x59e19a(_0x4d5de2[_0xa2e0('0xe')](0x1f4,_0x14b11a[_0xa2e0('0x10')]));});});};exports[_0xa2e0('0x1d')]=function(_0x17a167){var _0x5cc293=this;return new Promise(function(_0xe7365c,_0x2367ec){return db[_0xa2e0('0x14')][_0xa2e0('0x1e')](_0x17a167['body'],{'raw':_0x17a167[_0xa2e0('0x15')]?_0x17a167[_0xa2e0('0x15')][_0xa2e0('0x16')]===undefined?!![]:![]:!![]})[_0xa2e0('0x8')](function(_0x4b6b3b){logger[_0xa2e0('0x9')](_0xa2e0('0x1d'),_0x17a167);logger['debug']('CreateVoiceCallReport',_0x17a167,JSON['stringify'](_0x4b6b3b));_0xe7365c(_0x4b6b3b);})['catch'](function(_0x21a807){logger['error'](_0xa2e0('0x1d'),_0x21a807[_0xa2e0('0x10')],_0x17a167);_0x2367ec(_0x5cc293[_0xa2e0('0xe')](0x1f4,_0x21a807[_0xa2e0('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0xdfbfb4){var _0x37d1ce=this;return new Promise(function(_0x200d54,_0x2dd662){return db[_0xa2e0('0x14')]['update'](_0xdfbfb4[_0xa2e0('0x1f')],{'raw':_0xdfbfb4[_0xa2e0('0x15')]?_0xdfbfb4[_0xa2e0('0x15')][_0xa2e0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdfbfb4[_0xa2e0('0x15')]?_0xdfbfb4[_0xa2e0('0x15')][_0xa2e0('0x20')]||null:null,'attributes':_0xdfbfb4['options']?_0xdfbfb4[_0xa2e0('0x15')][_0xa2e0('0x17')]||null:null,'limit':_0xdfbfb4[_0xa2e0('0x15')]?_0xdfbfb4[_0xa2e0('0x15')]['limit']||null:null})[_0xa2e0('0x8')](function(_0x3988a3){logger['info'](_0xa2e0('0x21'),_0xdfbfb4);logger[_0xa2e0('0x1c')](_0xa2e0('0x21'),_0xdfbfb4,JSON[_0xa2e0('0xd')](_0x3988a3));_0x200d54(_0x3988a3);})[_0xa2e0('0x12')](function(_0x225108){logger['error']('UpdateVoiceCallReport',_0x225108['message'],_0xdfbfb4);_0x2dd662(_0x37d1ce['error'](0x1f4,_0x225108[_0xa2e0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 40f88d3..b0b19b3 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 _0xf831=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','/:id','update','delete','destroy'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xf831,0x157));var _0x1f83=function(_0x544fc9,_0xd2ae6d){_0x544fc9=_0x544fc9-0x0;var _0x446f87=_0xf831[_0x544fc9];return _0x446f87;};'use strict';var multer=require('multer');var util=require(_0x1f83('0x0'));var path=require(_0x1f83('0x1'));var timeout=require(_0x1f83('0x2'));var express=require(_0x1f83('0x3'));var router=express['Router']();var fs_extra=require(_0x1f83('0x4'));var auth=require(_0x1f83('0x5'));var interaction=require(_0x1f83('0x6'));var config=require(_0x1f83('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x1f83('0x8')](),controller[_0x1f83('0x9')]);router[_0x1f83('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1f83('0xb')]);router[_0x1f83('0xc')]('/',auth[_0x1f83('0x8')](),controller['create']);router['put'](_0x1f83('0xd'),auth[_0x1f83('0x8')](),controller[_0x1f83('0xe')]);router[_0x1f83('0xf')](_0x1f83('0xd'),auth[_0x1f83('0x8')](),controller[_0x1f83('0x10')]);module[_0x1f83('0x11')]=router; \ No newline at end of file +var _0xfb06=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xfb06,0xd9));var _0x6fb0=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0xfb06[_0x54e4ec];return _0x44ef91;};'use strict';var multer=require(_0x6fb0('0x0'));var util=require(_0x6fb0('0x1'));var path=require('path');var timeout=require(_0x6fb0('0x2'));var express=require(_0x6fb0('0x3'));var router=express['Router']();var fs_extra=require(_0x6fb0('0x4'));var auth=require(_0x6fb0('0x5'));var interaction=require(_0x6fb0('0x6'));var config=require(_0x6fb0('0x7'));var controller=require(_0x6fb0('0x8'));router[_0x6fb0('0x9')]('/',auth[_0x6fb0('0xa')](),controller[_0x6fb0('0xb')]);router[_0x6fb0('0x9')]('/:id',auth[_0x6fb0('0xa')](),controller[_0x6fb0('0xc')]);router['post']('/',auth[_0x6fb0('0xa')](),controller[_0x6fb0('0xd')]);router[_0x6fb0('0xe')](_0x6fb0('0xf'),auth[_0x6fb0('0xa')](),controller[_0x6fb0('0x10')]);router[_0x6fb0('0x11')]('/:id',auth[_0x6fb0('0xa')](),controller[_0x6fb0('0x12')]);module[_0x6fb0('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index d60b957..ae19d43 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 _0x0ee7=['split','BOOLEAN','sequelize','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x538eda,_0x1ff39c){var _0x525cc8=function(_0x500b7b){while(--_0x500b7b){_0x538eda['push'](_0x538eda['shift']());}};_0x525cc8(++_0x1ff39c);}(_0x0ee7,0x1e8));var _0x70ee=function(_0x2d3260,_0x17df82){_0x2d3260=_0x2d3260-0x0;var _0x5f516f=_0x0ee7[_0x2d3260];return _0x5f516f;};'use strict';var Sequelize=require(_0x70ee('0x0'));module['exports']={'name':{'type':Sequelize[_0x70ee('0x1')]},'prefix':{'type':Sequelize[_0x70ee('0x1')],'unique':_0x70ee('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x70ee('0x1')],'set':function(_0x447615){this[_0x70ee('0x3')](_0x70ee('0x4'),_0x447615?_0x447615[_0x70ee('0x5')](''):[]);},'get':function(){return this[_0x70ee('0x6')](_0x70ee('0x4'))?this['getDataValue'](_0x70ee('0x4'))[_0x70ee('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x70ee('0x1')]},'record':{'type':Sequelize[_0x70ee('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x70ee('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x07e7=['setDataValue','getDataValue','options','split','BOOLEAN','exports','STRING'];(function(_0x505eb9,_0x4469e3){var _0x12cfa0=function(_0x3bff0a){while(--_0x3bff0a){_0x505eb9['push'](_0x505eb9['shift']());}};_0x12cfa0(++_0x4469e3);}(_0x07e7,0x171));var _0x707e=function(_0x2ad8b1,_0x575311){_0x2ad8b1=_0x2ad8b1-0x0;var _0x59cdba=_0x07e7[_0x2ad8b1];return _0x59cdba;};'use strict';var Sequelize=require('sequelize');module[_0x707e('0x0')]={'name':{'type':Sequelize[_0x707e('0x1')]},'prefix':{'type':Sequelize[_0x707e('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x707e('0x1')],'set':function(_0x27b37f){this[_0x707e('0x2')]('options',_0x27b37f?_0x27b37f['join'](''):[]);},'get':function(){return this[_0x707e('0x3')](_0x707e('0x4'))?this['getDataValue'](_0x707e('0x4'))[_0x707e('0x5')](''):[];}},'auth':{'type':Sequelize[_0x707e('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x707e('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x707e('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9971cdd..a172e9e 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 _0x2a41=['filter','includeAll','include','findAll','rows','catch','show','params','options','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','ChanSpies','sendStatus','error','stack','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0x2a41,0x126));var _0x12a4=function(_0x382ca6,_0x1aaf79){_0x382ca6=_0x382ca6-0x0;var _0x295a6c=_0x2a41[_0x382ca6];return _0x295a6c;};'use strict';var emlformat=require(_0x12a4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12a4('0x1'));var jsonpatch=require(_0x12a4('0x2'));var rp=require(_0x12a4('0x3'));var moment=require(_0x12a4('0x4'));var BPromise=require(_0x12a4('0x5'));var Mustache=require(_0x12a4('0x6'));var util=require(_0x12a4('0x7'));var path=require(_0x12a4('0x8'));var sox=require(_0x12a4('0x9'));var csv=require('to-csv');var ejs=require(_0x12a4('0xa'));var fs=require('fs');var fs_extra=require(_0x12a4('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a4('0xd'));var toCsv=require(_0x12a4('0xe'));var querystring=require(_0x12a4('0xf'));var Papa=require(_0x12a4('0x10'));var Redis=require(_0x12a4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x12a4('0x12'));var as=require(_0x12a4('0x13'));var hardwareService=require(_0x12a4('0x14'));var logger=require(_0x12a4('0x15'))(_0x12a4('0x16'));var utils=require(_0x12a4('0x17'));var config=require(_0x12a4('0x18'));var licenseUtil=require(_0x12a4('0x19'));var db=require(_0x12a4('0x1a'))['db'];function respondWithStatusCode(_0x197554,_0x28059a){_0x28059a=_0x28059a||0xcc;return function(_0x2c939e){if(_0x2c939e){return _0x197554['sendStatus'](_0x28059a);}return _0x197554[_0x12a4('0x1b')](_0x28059a)[_0x12a4('0x1c')]();};}function respondWithResult(_0x1af5f8,_0x22cfde){_0x22cfde=_0x22cfde||0xc8;return function(_0x2b6e72){if(_0x2b6e72){return _0x1af5f8['status'](_0x22cfde)['json'](_0x2b6e72);}};}function respondWithFilteredResult(_0x257d27,_0x2ccfce){return function(_0x2428ba){if(_0x2428ba){var _0x1cce66=typeof _0x2ccfce['offset']===_0x12a4('0x1d')&&typeof _0x2ccfce[_0x12a4('0x1e')]===_0x12a4('0x1d');var _0x25d54f=_0x2428ba[_0x12a4('0x1f')];var _0xe274e1=_0x1cce66?0x0:_0x2ccfce['offset'];var _0x1a6bbe=_0x1cce66?_0x2428ba[_0x12a4('0x1f')]:_0x2ccfce[_0x12a4('0x20')]+_0x2ccfce['limit'];var _0x569763;if(_0x1a6bbe>=_0x25d54f){_0x1a6bbe=_0x25d54f;_0x569763=0xc8;}else{_0x569763=0xce;}_0x257d27[_0x12a4('0x1b')](_0x569763);return _0x257d27[_0x12a4('0x21')](_0x12a4('0x22'),_0xe274e1+'-'+_0x1a6bbe+'/'+_0x25d54f)[_0x12a4('0x23')](_0x2428ba);}return null;};}function patchUpdates(_0x1a35d3){return function(_0x5c92e8){try{jsonpatch[_0x12a4('0x24')](_0x5c92e8,_0x1a35d3,!![]);}catch(_0x5617d6){return BPromise[_0x12a4('0x25')](_0x5617d6);}return _0x5c92e8[_0x12a4('0x26')]();};}function saveUpdates(_0x40bf8e,_0x475939){return function(_0x17a4cc){if(_0x17a4cc){return _0x17a4cc['update'](_0x40bf8e)[_0x12a4('0x27')](function(_0x188930){return _0x188930;});}return null;};}function removeEntity(_0x35e966,_0x1c4255){return function(_0x499b22){if(_0x499b22){return _0x499b22[_0x12a4('0x28')]()[_0x12a4('0x27')](function(){var _0x376a74=_0x499b22['get']({'plain':!![]});var _0x395749=_0x12a4('0x29');return db['UserProfileResource'][_0x12a4('0x28')]({'where':{'type':_0x395749,'resourceId':_0x376a74['id']}})[_0x12a4('0x27')](function(){return _0x499b22;});})['then'](function(){_0x35e966['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41e832,_0x6ac80c){return function(_0x3314da){if(!_0x3314da){_0x41e832[_0x12a4('0x2a')](0x194);}return _0x3314da;};}function handleError(_0x4843f8,_0x443c90){_0x443c90=_0x443c90||0x1f4;return function(_0x56c3da){logger[_0x12a4('0x2b')](_0x56c3da[_0x12a4('0x2c')]);if(_0x56c3da[_0x12a4('0x2d')]){delete _0x56c3da[_0x12a4('0x2d')];}_0x4843f8['status'](_0x443c90)[_0x12a4('0x2e')](_0x56c3da);};}exports[_0x12a4('0x2f')]=function(_0x4e38f7,_0x283668){var _0x4cff97={},_0x36edf3={},_0x2de4d5={'count':0x0,'rows':[]};var _0x534ab5=_[_0x12a4('0x30')](db[_0x12a4('0x31')][_0x12a4('0x32')],function(_0x5ce983){return{'name':_0x5ce983[_0x12a4('0x33')],'type':_0x5ce983['type'][_0x12a4('0x34')]};});_0x36edf3[_0x12a4('0x35')]=_[_0x12a4('0x30')](_0x534ab5,_0x12a4('0x2d'));_0x36edf3[_0x12a4('0x36')]=_[_0x12a4('0x37')](_0x4e38f7['query']);_0x36edf3[_0x12a4('0x38')]=_[_0x12a4('0x39')](_0x36edf3[_0x12a4('0x35')],_0x36edf3['query']);_0x4cff97['attributes']=_[_0x12a4('0x39')](_0x36edf3['model'],qs[_0x12a4('0x3a')](_0x4e38f7[_0x12a4('0x36')]['fields']));_0x4cff97[_0x12a4('0x3b')]=_0x4cff97[_0x12a4('0x3b')][_0x12a4('0x3c')]?_0x4cff97[_0x12a4('0x3b')]:_0x36edf3['model'];if(!_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x3d')](_0x12a4('0x3e'))){_0x4cff97[_0x12a4('0x1e')]=qs[_0x12a4('0x1e')](_0x4e38f7['query']['limit']);_0x4cff97[_0x12a4('0x20')]=qs['offset'](_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x20')]);}_0x4cff97[_0x12a4('0x3f')]=qs[_0x12a4('0x40')](_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x40')]);_0x4cff97[_0x12a4('0x41')]=qs[_0x12a4('0x38')](_[_0x12a4('0x42')](_0x4e38f7[_0x12a4('0x36')],_0x36edf3['filters']),_0x534ab5);if(_0x4e38f7['query']['filter']){_0x4cff97[_0x12a4('0x41')]=_[_0x12a4('0x43')](_0x4cff97['where'],{'$or':_[_0x12a4('0x30')](_0x534ab5,function(_0x1841c){if(_0x1841c[_0x12a4('0x44')]!==_0x12a4('0x45')){var _0x146713={};_0x146713[_0x1841c[_0x12a4('0x2d')]]={'$like':'%'+_0x4e38f7[_0x12a4('0x36')][_0x12a4('0x46')]+'%'};return _0x146713;}})});}_0x4cff97=_[_0x12a4('0x43')]({},_0x4cff97,_0x4e38f7['options']);var _0x9f6fa8={'where':_0x4cff97['where']};return db[_0x12a4('0x31')][_0x12a4('0x1f')](_0x9f6fa8)[_0x12a4('0x27')](function(_0x2826fb){_0x2de4d5[_0x12a4('0x1f')]=_0x2826fb;if(_0x4e38f7['query'][_0x12a4('0x47')]){_0x4cff97[_0x12a4('0x48')]=[{'all':!![]}];}return db[_0x12a4('0x31')][_0x12a4('0x49')](_0x4cff97);})[_0x12a4('0x27')](function(_0xf2751e){_0x2de4d5[_0x12a4('0x4a')]=_0xf2751e;return _0x2de4d5;})['then'](respondWithFilteredResult(_0x283668,_0x4cff97))[_0x12a4('0x4b')](handleError(_0x283668,null));};exports[_0x12a4('0x4c')]=function(_0x44c499,_0x2745b7){var _0x33143b={'raw':![],'where':{'id':_0x44c499[_0x12a4('0x4d')]['id']}},_0x331605={};_0x331605[_0x12a4('0x35')]=_[_0x12a4('0x37')](db[_0x12a4('0x31')][_0x12a4('0x32')]);_0x331605['query']=_[_0x12a4('0x37')](_0x44c499[_0x12a4('0x36')]);_0x331605[_0x12a4('0x38')]=_['intersection'](_0x331605['model'],_0x331605[_0x12a4('0x36')]);_0x33143b[_0x12a4('0x3b')]=_[_0x12a4('0x39')](_0x331605['model'],qs[_0x12a4('0x3a')](_0x44c499[_0x12a4('0x36')][_0x12a4('0x3a')]));_0x33143b[_0x12a4('0x3b')]=_0x33143b['attributes']['length']?_0x33143b['attributes']:_0x331605['model'];if(_0x44c499[_0x12a4('0x36')][_0x12a4('0x47')]){_0x33143b[_0x12a4('0x48')]=[{'all':!![]}];}_0x33143b=_[_0x12a4('0x43')]({},_0x33143b,_0x44c499[_0x12a4('0x4e')]);return db['VoiceChanSpy'][_0x12a4('0x4f')](_0x33143b)[_0x12a4('0x27')](handleEntityNotFound(_0x2745b7,null))[_0x12a4('0x27')](respondWithResult(_0x2745b7,null))['catch'](handleError(_0x2745b7,null));};exports['create']=function(_0x41516b,_0x11ef07){return db['VoiceChanSpy']['create'](_0x41516b['body'],{})[_0x12a4('0x27')](function(_0x3ad94c){var _0x417ad5=_0x41516b['user'][_0x12a4('0x50')]({'plain':!![]});if(!_0x417ad5)throw new Error(_0x12a4('0x51'));if(_0x417ad5['role']===_0x12a4('0x52')){var _0x10f12e=_0x3ad94c[_0x12a4('0x50')]({'plain':!![]});var _0x2688c5=_0x12a4('0x29');return db[_0x12a4('0x53')]['find']({'where':{'name':_0x2688c5,'userProfileId':_0x417ad5[_0x12a4('0x54')]},'raw':!![]})['then'](function(_0x33a817){if(_0x33a817&&_0x33a817[_0x12a4('0x55')]===0x0){return db[_0x12a4('0x56')][_0x12a4('0x57')]({'name':_0x10f12e[_0x12a4('0x2d')],'resourceId':_0x10f12e['id'],'type':_0x33a817[_0x12a4('0x2d')],'sectionId':_0x33a817['id']},{})[_0x12a4('0x27')](function(){return _0x3ad94c;});}else{return _0x3ad94c;}})['catch'](function(_0xc5669b){logger[_0x12a4('0x2b')](_0x12a4('0x58'),_0xc5669b);throw _0xc5669b;});}return _0x3ad94c;})[_0x12a4('0x27')](respondWithResult(_0x11ef07,0xc9))[_0x12a4('0x4b')](handleError(_0x11ef07,null));};exports[_0x12a4('0x59')]=function(_0x2e2e07,_0x3521cb){if(_0x2e2e07[_0x12a4('0x5a')]['id']){delete _0x2e2e07[_0x12a4('0x5a')]['id'];}return db[_0x12a4('0x31')][_0x12a4('0x4f')]({'where':{'id':_0x2e2e07[_0x12a4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3521cb,null))[_0x12a4('0x27')](saveUpdates(_0x2e2e07[_0x12a4('0x5a')],null))[_0x12a4('0x27')](respondWithResult(_0x3521cb,null))[_0x12a4('0x4b')](handleError(_0x3521cb,null));};exports['destroy']=function(_0x2c95a8,_0x5720cf){return db[_0x12a4('0x31')][_0x12a4('0x4f')]({'where':{'id':_0x2c95a8[_0x12a4('0x4d')]['id']}})[_0x12a4('0x27')](handleEntityNotFound(_0x5720cf,null))[_0x12a4('0x27')](removeEntity(_0x5720cf,null))[_0x12a4('0x4b')](handleError(_0x5720cf,null));}; \ No newline at end of file +var _0xd64b=['ChanSpies','stack','name','send','index','map','VoiceChanSpy','rawAttributes','type','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','where','pick','merge','filter','options','includeAll','include','findAll','catch','params','filters','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','apply','reject','update','then','destroy','get'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xd64b,0xc1));var _0xbd64=function(_0x16db18,_0x43fd3f){_0x16db18=_0x16db18-0x0;var _0x48cc3a=_0xd64b[_0x16db18];return _0x48cc3a;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136f60,_0x2729d8){_0x2729d8=_0x2729d8||0xcc;return function(_0x3a941c){if(_0x3a941c){return _0x136f60[_0xbd64('0x16')](_0x2729d8);}return _0x136f60[_0xbd64('0x17')](_0x2729d8)[_0xbd64('0x18')]();};}function respondWithResult(_0x2e23f2,_0x269e2f){_0x269e2f=_0x269e2f||0xc8;return function(_0x2b5808){if(_0x2b5808){return _0x2e23f2['status'](_0x269e2f)[_0xbd64('0x19')](_0x2b5808);}};}function respondWithFilteredResult(_0x13e7a4,_0x3ff550){return function(_0x32fd34){if(_0x32fd34){var _0x29fc16=typeof _0x3ff550['offset']===_0xbd64('0x1a')&&typeof _0x3ff550['limit']===_0xbd64('0x1a');var _0x1432a6=_0x32fd34[_0xbd64('0x1b')];var _0x1d7a14=_0x29fc16?0x0:_0x3ff550[_0xbd64('0x1c')];var _0x2f4554=_0x29fc16?_0x32fd34[_0xbd64('0x1b')]:_0x3ff550[_0xbd64('0x1c')]+_0x3ff550['limit'];var _0x305545;if(_0x2f4554>=_0x1432a6){_0x2f4554=_0x1432a6;_0x305545=0xc8;}else{_0x305545=0xce;}_0x13e7a4[_0xbd64('0x17')](_0x305545);return _0x13e7a4['set']('Content-Range',_0x1d7a14+'-'+_0x2f4554+'/'+_0x1432a6)[_0xbd64('0x19')](_0x32fd34);}return null;};}function patchUpdates(_0x42b328){return function(_0x196d21){try{jsonpatch[_0xbd64('0x1d')](_0x196d21,_0x42b328,!![]);}catch(_0x2c5551){return BPromise[_0xbd64('0x1e')](_0x2c5551);}return _0x196d21['save']();};}function saveUpdates(_0x4d4a16,_0x6038f){return function(_0x41f2f){if(_0x41f2f){return _0x41f2f[_0xbd64('0x1f')](_0x4d4a16)[_0xbd64('0x20')](function(_0x55e74c){return _0x55e74c;});}return null;};}function removeEntity(_0x51d118,_0x28497c){return function(_0x4afaff){if(_0x4afaff){return _0x4afaff[_0xbd64('0x21')]()['then'](function(){var _0x33452d=_0x4afaff[_0xbd64('0x22')]({'plain':!![]});var _0x3d12a0=_0xbd64('0x23');return db['UserProfileResource'][_0xbd64('0x21')]({'where':{'type':_0x3d12a0,'resourceId':_0x33452d['id']}})[_0xbd64('0x20')](function(){return _0x4afaff;});})[_0xbd64('0x20')](function(){_0x51d118[_0xbd64('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e8719,_0x29c9c8){return function(_0x49eac5){if(!_0x49eac5){_0x4e8719['sendStatus'](0x194);}return _0x49eac5;};}function handleError(_0xfa918,_0x5aacdd){_0x5aacdd=_0x5aacdd||0x1f4;return function(_0x3cf5b7){logger['error'](_0x3cf5b7[_0xbd64('0x24')]);if(_0x3cf5b7['name']){delete _0x3cf5b7[_0xbd64('0x25')];}_0xfa918[_0xbd64('0x17')](_0x5aacdd)[_0xbd64('0x26')](_0x3cf5b7);};}exports[_0xbd64('0x27')]=function(_0x306f19,_0x207ffc){var _0x4ed44a={},_0x35bdd5={},_0xe876c9={'count':0x0,'rows':[]};var _0xc44280=_[_0xbd64('0x28')](db[_0xbd64('0x29')][_0xbd64('0x2a')],function(_0x5e70d3){return{'name':_0x5e70d3['fieldName'],'type':_0x5e70d3[_0xbd64('0x2b')]['key']};});_0x35bdd5[_0xbd64('0x2c')]=_[_0xbd64('0x28')](_0xc44280,'name');_0x35bdd5['query']=_[_0xbd64('0x2d')](_0x306f19['query']);_0x35bdd5['filters']=_[_0xbd64('0x2e')](_0x35bdd5[_0xbd64('0x2c')],_0x35bdd5[_0xbd64('0x2f')]);_0x4ed44a['attributes']=_[_0xbd64('0x2e')](_0x35bdd5['model'],qs[_0xbd64('0x30')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x30')]));_0x4ed44a[_0xbd64('0x31')]=_0x4ed44a[_0xbd64('0x31')][_0xbd64('0x32')]?_0x4ed44a['attributes']:_0x35bdd5['model'];if(!_0x306f19[_0xbd64('0x2f')][_0xbd64('0x33')](_0xbd64('0x34'))){_0x4ed44a[_0xbd64('0x35')]=qs[_0xbd64('0x35')](_0x306f19[_0xbd64('0x2f')]['limit']);_0x4ed44a['offset']=qs[_0xbd64('0x1c')](_0x306f19[_0xbd64('0x2f')][_0xbd64('0x1c')]);}_0x4ed44a['order']=qs['sort'](_0x306f19[_0xbd64('0x2f')]['sort']);_0x4ed44a[_0xbd64('0x36')]=qs['filters'](_[_0xbd64('0x37')](_0x306f19[_0xbd64('0x2f')],_0x35bdd5['filters']),_0xc44280);if(_0x306f19[_0xbd64('0x2f')]['filter']){_0x4ed44a['where']=_[_0xbd64('0x38')](_0x4ed44a[_0xbd64('0x36')],{'$or':_[_0xbd64('0x28')](_0xc44280,function(_0x52f401){if(_0x52f401['type']!=='VIRTUAL'){var _0x344d46={};_0x344d46[_0x52f401[_0xbd64('0x25')]]={'$like':'%'+_0x306f19['query'][_0xbd64('0x39')]+'%'};return _0x344d46;}})});}_0x4ed44a=_[_0xbd64('0x38')]({},_0x4ed44a,_0x306f19[_0xbd64('0x3a')]);var _0x27fd12={'where':_0x4ed44a['where']};return db['VoiceChanSpy'][_0xbd64('0x1b')](_0x27fd12)['then'](function(_0x595a91){_0xe876c9[_0xbd64('0x1b')]=_0x595a91;if(_0x306f19[_0xbd64('0x2f')][_0xbd64('0x3b')]){_0x4ed44a[_0xbd64('0x3c')]=[{'all':!![]}];}return db[_0xbd64('0x29')][_0xbd64('0x3d')](_0x4ed44a);})[_0xbd64('0x20')](function(_0x762380){_0xe876c9['rows']=_0x762380;return _0xe876c9;})[_0xbd64('0x20')](respondWithFilteredResult(_0x207ffc,_0x4ed44a))[_0xbd64('0x3e')](handleError(_0x207ffc,null));};exports['show']=function(_0x41b27a,_0x1e4983){var _0xe5b069={'raw':![],'where':{'id':_0x41b27a[_0xbd64('0x3f')]['id']}},_0x2bc972={};_0x2bc972[_0xbd64('0x2c')]=_[_0xbd64('0x2d')](db['VoiceChanSpy'][_0xbd64('0x2a')]);_0x2bc972['query']=_[_0xbd64('0x2d')](_0x41b27a['query']);_0x2bc972[_0xbd64('0x40')]=_[_0xbd64('0x2e')](_0x2bc972[_0xbd64('0x2c')],_0x2bc972['query']);_0xe5b069[_0xbd64('0x31')]=_['intersection'](_0x2bc972['model'],qs['fields'](_0x41b27a[_0xbd64('0x2f')][_0xbd64('0x30')]));_0xe5b069[_0xbd64('0x31')]=_0xe5b069[_0xbd64('0x31')][_0xbd64('0x32')]?_0xe5b069[_0xbd64('0x31')]:_0x2bc972[_0xbd64('0x2c')];if(_0x41b27a['query'][_0xbd64('0x3b')]){_0xe5b069[_0xbd64('0x3c')]=[{'all':!![]}];}_0xe5b069=_[_0xbd64('0x38')]({},_0xe5b069,_0x41b27a['options']);return db[_0xbd64('0x29')][_0xbd64('0x41')](_0xe5b069)[_0xbd64('0x20')](handleEntityNotFound(_0x1e4983,null))[_0xbd64('0x20')](respondWithResult(_0x1e4983,null))[_0xbd64('0x3e')](handleError(_0x1e4983,null));};exports['create']=function(_0x283699,_0x1a9ec8){return db[_0xbd64('0x29')][_0xbd64('0x42')](_0x283699['body'],{})['then'](function(_0x1e008f){var _0x2a7eec=_0x283699[_0xbd64('0x43')][_0xbd64('0x22')]({'plain':!![]});if(!_0x2a7eec)throw new Error(_0xbd64('0x44'));if(_0x2a7eec[_0xbd64('0x45')]===_0xbd64('0x43')){var _0x3807a7=_0x1e008f[_0xbd64('0x22')]({'plain':!![]});var _0x2709b2=_0xbd64('0x23');return db[_0xbd64('0x46')][_0xbd64('0x41')]({'where':{'name':_0x2709b2,'userProfileId':_0x2a7eec[_0xbd64('0x47')]},'raw':!![]})[_0xbd64('0x20')](function(_0x5bd444){if(_0x5bd444&&_0x5bd444[_0xbd64('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x3807a7['name'],'resourceId':_0x3807a7['id'],'type':_0x5bd444['name'],'sectionId':_0x5bd444['id']},{})[_0xbd64('0x20')](function(){return _0x1e008f;});}else{return _0x1e008f;}})[_0xbd64('0x3e')](function(_0x5480f5){logger[_0xbd64('0x49')](_0xbd64('0x4a'),_0x5480f5);throw _0x5480f5;});}return _0x1e008f;})[_0xbd64('0x20')](respondWithResult(_0x1a9ec8,0xc9))['catch'](handleError(_0x1a9ec8,null));};exports[_0xbd64('0x1f')]=function(_0x371bad,_0x44cd4f){if(_0x371bad[_0xbd64('0x4b')]['id']){delete _0x371bad[_0xbd64('0x4b')]['id'];}return db[_0xbd64('0x29')]['find']({'where':{'id':_0x371bad['params']['id']}})['then'](handleEntityNotFound(_0x44cd4f,null))[_0xbd64('0x20')](saveUpdates(_0x371bad[_0xbd64('0x4b')],null))[_0xbd64('0x20')](respondWithResult(_0x44cd4f,null))[_0xbd64('0x3e')](handleError(_0x44cd4f,null));};exports['destroy']=function(_0x1d0d9f,_0x20b275){return db[_0xbd64('0x29')][_0xbd64('0x41')]({'where':{'id':_0x1d0d9f[_0xbd64('0x3f')]['id']}})[_0xbd64('0x20')](handleEntityNotFound(_0x20b275,null))['then'](removeEntity(_0x20b275,null))[_0xbd64('0x3e')](handleError(_0x20b275,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 24d6686..274f7eb 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 _0x725b=['bulkCreate','catch','VoiceExtension','destroy','lodash','util','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','name','options','join','length','internal','concat','findAll','agent','then','exports','define','VoiceChanSpy'];(function(_0x3e9c3a,_0x2f0eac){var _0x191bf7=function(_0x16a71e){while(--_0x16a71e){_0x3e9c3a['push'](_0x3e9c3a['shift']());}};_0x191bf7(++_0x2f0eac);}(_0x725b,0x90));var _0xb725=function(_0x5f2f93,_0x1d772b){_0x5f2f93=_0x5f2f93-0x0;var _0x2a3d1b=_0x725b[_0x5f2f93];return _0x2a3d1b;};'use strict';var _=require(_0xb725('0x0'));var util=require(_0xb725('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x5b0919,_0x341d06,_0x1ea47e){var _0x2acf5d=0x1;var _0x33281e=[];var _0x1caf3e={'context':_0x341d06[_0xb725('0x2')]||_0xb725('0x3'),'exten':util[_0xb725('0x4')](_0xb725('0x5'),_0x5b0919[_0xb725('0x6')],_0x1ea47e),'type':_0xb725('0x7'),'isApp':![],'ChanSpyId':_0x5b0919['id'],'UserId':_0x341d06['id']};_0x33281e[_0xb725('0x8')](_[_0xb725('0x9')]({'app':'Set','appdata':util['format'](_0xb725('0xa'),_0xb725('0xb')),'priority':_0x2acf5d++},_0x1caf3e));if(_0x5b0919[_0xb725('0xc')]){_0x33281e[_0xb725('0x8')](_[_0xb725('0x9')]({'app':_0xb725('0xd'),'appdata':util['format'](_0xb725('0xe'),_0x5b0919[_0xb725('0xf')]),'priority':_0x2acf5d++},_0x1caf3e));}if(_0x5b0919[_0xb725('0x10')]){_0x33281e[_0xb725('0x8')](_['merge']({'app':_0xb725('0x11'),'appdata':_0x5b0919['password'],'priority':_0x2acf5d++},_0x1caf3e));}_0x33281e[_0xb725('0x8')](_[_0xb725('0x9')]({'app':_0xb725('0x12'),'appdata':util[_0xb725('0x4')]('SIP/%s,%s',_0x341d06[_0xb725('0x13')],_0x5b0919[_0xb725('0x14')]?_0x5b0919['options'][_0xb725('0x15')](''):''),'priority':_0x2acf5d++},_0x1caf3e));if(_0x5b0919[_0xb725('0xc')]){_0x33281e[_0xb725('0x8')](_['merge']({'app':'StopMixMonitor','priority':_0x2acf5d++},_0x1caf3e));}return _0x33281e;};var getChanSpyApplications=function(_0x4bf16d,_0x3c7915){var _0x335d99=[];for(var _0x29eebf=0x0,_0x477b27=0x1;_0x29eebf<_0x3c7915[_0xb725('0x16')];_0x29eebf++,_0x477b27=0x1){_0x335d99=_0x335d99['concat'](getUserApplications(_0x4bf16d,_0x3c7915[_0x29eebf],_0x3c7915[_0x29eebf]['internal']));if(_0x3c7915[_0x29eebf][_0xb725('0x17')]!=_0x3c7915[_0x29eebf]['name']){_0x335d99=_0x335d99[_0xb725('0x18')](getUserApplications(_0x4bf16d,_0x3c7915[_0x29eebf],_0x3c7915[_0x29eebf]['name']));}}return _0x335d99;};var getChanSpyPromise=function(_0x6948f5,_0x37b2ea){return new BPromise(function(_0x33f898,_0x8940a9){return _0x6948f5['User'][_0xb725('0x19')]({'attributes':['id',_0xb725('0x13'),_0xb725('0x17')],'where':{'role':_0xb725('0x1a'),'chanspy':!![]},'raw':!![]})[_0xb725('0x1b')](function(_0x135c26){if(_0x135c26){return _0x33f898(getChanSpyApplications(_0x37b2ea,_0x135c26));}return _0x33f898([]);})['catch'](function(_0x5a6638){_0x8940a9(_0x5a6638);});});};module[_0xb725('0x1c')]=function(_0x43c6b3,_0x2cd188){var _0x225f7c=_0x43c6b3['models'];return _0x43c6b3[_0xb725('0x1d')](_0xb725('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d0324,_0x147398,_0x3f011b){return getChanSpyPromise(_0x225f7c,_0x4d0324)['then'](function(_0x1271c6){if(_0x1271c6&&_0x1271c6[_0xb725('0x16')]){return _0x225f7c['VoiceExtension'][_0xb725('0x1f')](_0x1271c6);}})[_0xb725('0x1b')](function(){_0x3f011b();})[_0xb725('0x20')](function(_0xe8fa90){_0x3f011b(_0xe8fa90);});},'afterUpdate':function(_0x4922e5,_0x5bebf0,_0x1a87a8){return _0x225f7c[_0xb725('0x21')][_0xb725('0x22')]({'where':{'ChanSpyId':_0x4922e5['id']}})[_0xb725('0x1b')](function(){return getChanSpyPromise(_0x225f7c,_0x4922e5);})['then'](function(_0x117010){if(_0x117010&&_0x117010['length']){return _0x225f7c[_0xb725('0x21')][_0xb725('0x1f')](_0x117010);}})['then'](function(){_0x1a87a8();})[_0xb725('0x20')](function(_0x1c0f4f){_0x1a87a8(_0x1c0f4f);});},'afterDestroy':function(_0x31721a,_0x1c84aa,_0x3e1a9){return _0x225f7c['VoiceExtension'][_0xb725('0x22')]({'where':{'ChanSpyId':_0x31721a['id']}})[_0xb725('0x1b')](function(){_0x3e1a9();})[_0xb725('0x20')](function(_0x184d17){_0x3e1a9(_0x184d17);});}}});}; \ No newline at end of file +var _0x9353=['findAll','then','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','push','merge','CDR(type)=%s','chanspy','MixMonitor','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','length','concat','internal'];(function(_0x42384f,_0x2aec5b){var _0x38b2de=function(_0x30c07e){while(--_0x30c07e){_0x42384f['push'](_0x42384f['shift']());}};_0x38b2de(++_0x2aec5b);}(_0x9353,0xb9));var _0x3935=function(_0x4bad84,_0x418639){_0x4bad84=_0x4bad84-0x0;var _0x57c671=_0x9353[_0x4bad84];return _0x57c671;};'use strict';var _=require(_0x3935('0x0'));var util=require(_0x3935('0x1'));var BPromise=require('bluebird');var attributes=require(_0x3935('0x2'));var getUserApplications=function(_0x1ab08f,_0x4f02bb,_0x5def16){var _0x4011a9=0x1;var _0x24f224=[];var _0x5085b8={'context':_0x4f02bb[_0x3935('0x3')]||_0x3935('0x4'),'exten':util[_0x3935('0x5')](_0x3935('0x6'),_0x1ab08f['prefix'],_0x5def16),'type':'system','isApp':![],'ChanSpyId':_0x1ab08f['id'],'UserId':_0x4f02bb['id']};_0x24f224[_0x3935('0x7')](_[_0x3935('0x8')]({'app':'Set','appdata':util['format'](_0x3935('0x9'),_0x3935('0xa')),'priority':_0x4011a9++},_0x5085b8));if(_0x1ab08f['record']){_0x24f224[_0x3935('0x7')](_[_0x3935('0x8')]({'app':_0x3935('0xb'),'appdata':util[_0x3935('0x5')]('${UNIQUEID}.%s,a',_0x1ab08f['recordingFormat']),'priority':_0x4011a9++},_0x5085b8));}if(_0x1ab08f[_0x3935('0xc')]){_0x24f224['push'](_[_0x3935('0x8')]({'app':_0x3935('0xd'),'appdata':_0x1ab08f[_0x3935('0xe')],'priority':_0x4011a9++},_0x5085b8));}_0x24f224[_0x3935('0x7')](_[_0x3935('0x8')]({'app':_0x3935('0xf'),'appdata':util[_0x3935('0x5')](_0x3935('0x10'),_0x4f02bb[_0x3935('0x11')],_0x1ab08f[_0x3935('0x12')]?_0x1ab08f[_0x3935('0x12')][_0x3935('0x13')](''):''),'priority':_0x4011a9++},_0x5085b8));if(_0x1ab08f[_0x3935('0x14')]){_0x24f224[_0x3935('0x7')](_['merge']({'app':_0x3935('0x15'),'priority':_0x4011a9++},_0x5085b8));}return _0x24f224;};var getChanSpyApplications=function(_0x144d09,_0x488088){var _0x574f18=[];for(var _0x246302=0x0,_0x1d9487=0x1;_0x246302<_0x488088[_0x3935('0x16')];_0x246302++,_0x1d9487=0x1){_0x574f18=_0x574f18[_0x3935('0x17')](getUserApplications(_0x144d09,_0x488088[_0x246302],_0x488088[_0x246302][_0x3935('0x18')]));if(_0x488088[_0x246302][_0x3935('0x18')]!=_0x488088[_0x246302][_0x3935('0x11')]){_0x574f18=_0x574f18[_0x3935('0x17')](getUserApplications(_0x144d09,_0x488088[_0x246302],_0x488088[_0x246302]['name']));}}return _0x574f18;};var getChanSpyPromise=function(_0xd9c925,_0x11c6cb){return new BPromise(function(_0x2f2f33,_0x33e8a9){return _0xd9c925['User'][_0x3935('0x19')]({'attributes':['id',_0x3935('0x11'),_0x3935('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x3935('0x1a')](function(_0x2a3a76){if(_0x2a3a76){return _0x2f2f33(getChanSpyApplications(_0x11c6cb,_0x2a3a76));}return _0x2f2f33([]);})['catch'](function(_0x51cf91){_0x33e8a9(_0x51cf91);});});};module[_0x3935('0x1b')]=function(_0x49ed4e,_0x2fafa4){var _0x10b823=_0x49ed4e['models'];return _0x49ed4e[_0x3935('0x1c')](_0x3935('0x1d'),attributes,{'tableName':_0x3935('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4dfebb,_0x4dfb5a,_0x18bca7){return getChanSpyPromise(_0x10b823,_0x4dfebb)[_0x3935('0x1a')](function(_0x17cfbd){if(_0x17cfbd&&_0x17cfbd[_0x3935('0x16')]){return _0x10b823[_0x3935('0x1f')]['bulkCreate'](_0x17cfbd);}})[_0x3935('0x1a')](function(){_0x18bca7();})[_0x3935('0x20')](function(_0x21af94){_0x18bca7(_0x21af94);});},'afterUpdate':function(_0x141950,_0x3ff54d,_0x432da5){return _0x10b823[_0x3935('0x1f')][_0x3935('0x21')]({'where':{'ChanSpyId':_0x141950['id']}})[_0x3935('0x1a')](function(){return getChanSpyPromise(_0x10b823,_0x141950);})['then'](function(_0x59a9b8){if(_0x59a9b8&&_0x59a9b8[_0x3935('0x16')]){return _0x10b823[_0x3935('0x1f')][_0x3935('0x22')](_0x59a9b8);}})['then'](function(){_0x432da5();})[_0x3935('0x20')](function(_0x488fa2){_0x432da5(_0x488fa2);});},'afterDestroy':function(_0x312eb0,_0x2c5b49,_0x19f666){return _0x10b823['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x312eb0['id']}})[_0x3935('0x1a')](function(){_0x19f666();})[_0x3935('0x20')](function(_0x2eedd6){_0x19f666(_0x2eedd6);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 61c2fa4..1373b58 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 _0xad95=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','then'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0xad95,0x70));var _0x5ad9=function(_0x334ae9,_0x5e791a){_0x334ae9=_0x334ae9-0x0;var _0x527c09=_0xad95[_0x334ae9];return _0x527c09;};'use strict';var _=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var moment=require(_0x5ad9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ad9('0x3'));var db=require(_0x5ad9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ad9('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bef4e,_0x117fde,_0x2a0915){return new BPromise(function(_0x3d937a,_0x404b33){return client['request'](_0x2bef4e,_0x2a0915)[_0x5ad9('0x6')](function(_0x4fdb7b){logger['info'](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));logger[_0x5ad9('0x9')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x117fde,_0x5ad9('0x8'),JSON[_0x5ad9('0xa')](_0x4fdb7b));if(_0x4fdb7b['error']){if(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xc')]===0x1f4){logger[_0x5ad9('0xb')](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);return _0x404b33(_0x4fdb7b['error']['message']);}logger['error'](_0x5ad9('0x7'),_0x117fde,_0x4fdb7b[_0x5ad9('0xb')]['message']);return _0x3d937a(_0x4fdb7b[_0x5ad9('0xb')][_0x5ad9('0xd')]);}else{logger[_0x5ad9('0xe')](_0x5ad9('0x7'),_0x117fde,_0x5ad9('0x8'));_0x3d937a(_0x4fdb7b[_0x5ad9('0xf')][_0x5ad9('0xd')]);}})[_0x5ad9('0x10')](function(_0x36e61f){logger[_0x5ad9('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x117fde,_0x36e61f);_0x404b33(_0x36e61f);});});} \ No newline at end of file +var _0x1b32=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x13810d,_0x3fcdc5){var _0x42924a=function(_0x2002a9){while(--_0x2002a9){_0x13810d['push'](_0x13810d['shift']());}};_0x42924a(++_0x3fcdc5);}(_0x1b32,0x85));var _0x21b3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1b32[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0x21e881,_0x5c0f36){return new BPromise(function(_0x45b1b7,_0x5639eb){return client['request'](_0x47516a,_0x5c0f36)['then'](function(_0xd7a981){logger[_0x21b3('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x21e881,'request\x20sent');logger[_0x21b3('0xe')](_0x21b3('0xf'),_0x21e881,_0x21b3('0x10'),JSON['stringify'](_0xd7a981));if(_0xd7a981[_0x21b3('0x11')]){if(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x12')]===0x1f4){logger[_0x21b3('0x11')](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x5639eb(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);}logger['error'](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x45b1b7(_0xd7a981['error'][_0x21b3('0x14')]);}else{logger['info'](_0x21b3('0x13'),_0x21e881,'request\x20sent');_0x45b1b7(_0xd7a981[_0x21b3('0x15')][_0x21b3('0x14')]);}})[_0x21b3('0x16')](function(_0x4217d6){logger['error'](_0x21b3('0x13'),_0x21e881,_0x4217d6);_0x5639eb(_0x4217d6);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9f3ddb0..87cde68 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 _0x66af=['put','/:id','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','index','get','post','isAuthenticated','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x66af,0x136));var _0xf66a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x66af[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require(_0xf66a('0x0'));var path=require(_0xf66a('0x1'));var timeout=require(_0xf66a('0x2'));var express=require(_0xf66a('0x3'));var router=express[_0xf66a('0x4')]();var fs_extra=require(_0xf66a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf66a('0x6'));var config=require(_0xf66a('0x7'));var controller=require(_0xf66a('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf66a('0x9')]);router[_0xf66a('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf66a('0xb')]('/',auth[_0xf66a('0xc')](),controller[_0xf66a('0xd')]);router[_0xf66a('0xe')](_0xf66a('0xf'),auth[_0xf66a('0xc')](),controller['update']);router[_0xf66a('0x10')]('/:id',auth[_0xf66a('0xc')](),controller[_0xf66a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf841=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceContext.controller','isAuthenticated','index','get','/:id','post','create','update','delete','destroy','exports','path'];(function(_0x50d450,_0x4a4238){var _0x30fa53=function(_0xd9614d){while(--_0xd9614d){_0x50d450['push'](_0x50d450['shift']());}};_0x30fa53(++_0x4a4238);}(_0xf841,0x98));var _0x1f84=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0xf841[_0x284609];return _0x55116b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f84('0x0'));var timeout=require(_0x1f84('0x1'));var express=require(_0x1f84('0x2'));var router=express[_0x1f84('0x3')]();var fs_extra=require(_0x1f84('0x4'));var auth=require(_0x1f84('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1f84('0x6'));router['get']('/',auth[_0x1f84('0x7')](),controller[_0x1f84('0x8')]);router[_0x1f84('0x9')](_0x1f84('0xa'),auth[_0x1f84('0x7')](),controller['show']);router[_0x1f84('0xb')]('/',auth[_0x1f84('0x7')](),controller[_0x1f84('0xc')]);router['put'](_0x1f84('0xa'),auth[_0x1f84('0x7')](),controller[_0x1f84('0xd')]);router[_0x1f84('0xe')](_0x1f84('0xa'),auth[_0x1f84('0x7')](),controller[_0x1f84('0xf')]);module[_0x1f84('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index d555bc9..fa4186f 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 _0x23da=['name','STRING','BOOLEAN','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x23da,0x1bf));var _0xa23d=function(_0x4c5fdf,_0x593020){_0x4c5fdf=_0x4c5fdf-0x0;var _0x3347c2=_0x23da[_0x4c5fdf];return _0x3347c2;};'use strict';var Sequelize=require('sequelize');module[_0xa23d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xa23d('0x1')},'description':{'type':Sequelize[_0xa23d('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa23d('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x400a=['BOOLEAN','sequelize','exports','STRING'];(function(_0x396ad9,_0x1675b7){var _0x2a4c07=function(_0x31311e){while(--_0x31311e){_0x396ad9['push'](_0x396ad9['shift']());}};_0x2a4c07(++_0x1675b7);}(_0x400a,0x1a1));var _0xa400=function(_0xcbceb,_0x124c5d){_0xcbceb=_0xcbceb-0x0;var _0x1236c3=_0x400a[_0xcbceb];return _0x1236c3;};'use strict';var Sequelize=require(_0xa400('0x0'));module[_0xa400('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xa400('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa400('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index fdc7d30..5cd6ce9 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 _0x82c8=['/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','options','VoiceContext','includeAll','include','rows','catch','show','params','create','body','findAll','join','root','server/files/templates/context.ejs','utf8','render','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','readFileSync','writeFileSync'];(function(_0x523219,_0x2ca8f9){var _0x593fc7=function(_0x43f543){while(--_0x43f543){_0x523219['push'](_0x523219['shift']());}};_0x593fc7(++_0x2ca8f9);}(_0x82c8,0x1a7));var _0x882c=function(_0x424cd8,_0x1b7b3d){_0x424cd8=_0x424cd8-0x0;var _0x1ed80c=_0x82c8[_0x424cd8];return _0x1ed80c;};'use strict';var emlformat=require(_0x882c('0x0'));var rimraf=require(_0x882c('0x1'));var zipdir=require(_0x882c('0x2'));var jsonpatch=require(_0x882c('0x3'));var rp=require(_0x882c('0x4'));var moment=require(_0x882c('0x5'));var BPromise=require(_0x882c('0x6'));var Mustache=require(_0x882c('0x7'));var util=require('util');var path=require(_0x882c('0x8'));var sox=require('sox');var csv=require(_0x882c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x882c('0xa'));var _=require(_0x882c('0xb'));var squel=require(_0x882c('0xc'));var crypto=require(_0x882c('0xd'));var jsforce=require(_0x882c('0xe'));var deskjs=require(_0x882c('0xf'));var toCsv=require(_0x882c('0x9'));var querystring=require(_0x882c('0x10'));var Papa=require('papaparse');var Redis=require(_0x882c('0x11'));var authService=require(_0x882c('0x12'));var qs=require(_0x882c('0x13'));var as=require(_0x882c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x882c('0x15'));var utils=require(_0x882c('0x16'));var config=require(_0x882c('0x17'));var licenseUtil=require(_0x882c('0x18'));var db=require(_0x882c('0x19'))['db'];var jayson=require(_0x882c('0x1a'));var client=jayson[_0x882c('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2968d5,_0x403afc,_0x249ecb,_0x5bf7a3){return new BPromise(function(_0x3cc17e,_0x48c98f){var _0x1fcc15=_0x5bf7a3||client;return _0x1fcc15['request'](_0x2968d5,_0x249ecb)['then'](function(_0x3caf63){logger[_0x882c('0x1c')](_0x882c('0x1d'),_0x403afc,_0x882c('0x1e'));logger[_0x882c('0x1f')](_0x882c('0x20'),_0x403afc,'request\x20sent',JSON['stringify'](_0x3caf63));if(_0x3caf63[_0x882c('0x21')]){if(_0x3caf63[_0x882c('0x21')][_0x882c('0x22')]===0x1f4){logger[_0x882c('0x21')](_0x882c('0x1d'),_0x403afc,_0x3caf63[_0x882c('0x21')][_0x882c('0x23')]);return _0x48c98f(_0x3caf63[_0x882c('0x21')]['message']);}logger[_0x882c('0x21')](_0x882c('0x1d'),_0x403afc,_0x3caf63[_0x882c('0x21')]['message']);return _0x3cc17e(_0x3caf63[_0x882c('0x21')]['message']);}else{logger['info'](_0x882c('0x1d'),_0x403afc,_0x882c('0x1e'));_0x3cc17e(_0x3caf63['result'][_0x882c('0x23')]);}})['catch'](function(_0x25a5ac){logger[_0x882c('0x21')](_0x882c('0x1d'),_0x403afc,_0x25a5ac);_0x48c98f(_0x25a5ac);});});}function respondWithStatusCode(_0x1cd36a,_0x5b4ed8){_0x5b4ed8=_0x5b4ed8||0xcc;return function(_0x28327c){if(_0x28327c){return _0x1cd36a[_0x882c('0x24')](_0x5b4ed8);}return _0x1cd36a['status'](_0x5b4ed8)[_0x882c('0x25')]();};}function respondWithResult(_0x332004,_0x5ab73f){_0x5ab73f=_0x5ab73f||0xc8;return function(_0x525867){if(_0x525867){return _0x332004[_0x882c('0x26')](_0x5ab73f)[_0x882c('0x27')](_0x525867);}};}function respondWithFilteredResult(_0x32ce1b,_0x153e50){return function(_0xe7fdcb){if(_0xe7fdcb){var _0x471ab9=typeof _0x153e50[_0x882c('0x28')]===_0x882c('0x29')&&typeof _0x153e50[_0x882c('0x2a')]===_0x882c('0x29');var _0x42343b=_0xe7fdcb['count'];var _0x173229=_0x471ab9?0x0:_0x153e50[_0x882c('0x28')];var _0x1a8544=_0x471ab9?_0xe7fdcb[_0x882c('0x2b')]:_0x153e50[_0x882c('0x28')]+_0x153e50[_0x882c('0x2a')];var _0x219600;if(_0x1a8544>=_0x42343b){_0x1a8544=_0x42343b;_0x219600=0xc8;}else{_0x219600=0xce;}_0x32ce1b[_0x882c('0x26')](_0x219600);return _0x32ce1b[_0x882c('0x2c')](_0x882c('0x2d'),_0x173229+'-'+_0x1a8544+'/'+_0x42343b)[_0x882c('0x27')](_0xe7fdcb);}return null;};}function patchUpdates(_0x151bc6){return function(_0x1fc503){try{jsonpatch['apply'](_0x1fc503,_0x151bc6,!![]);}catch(_0x160983){return BPromise[_0x882c('0x2e')](_0x160983);}return _0x1fc503[_0x882c('0x2f')]();};}function saveUpdates(_0x468206,_0x59c129){return function(_0x1e6b99){if(_0x1e6b99){return _0x1e6b99[_0x882c('0x30')](_0x468206)[_0x882c('0x31')](function(_0x44786b){return _0x44786b;});}return null;};}function removeEntity(_0x427bff,_0x145a38){return function(_0x54f54e){if(_0x54f54e){return _0x54f54e[_0x882c('0x32')]()[_0x882c('0x31')](function(){var _0x143d4a=_0x54f54e[_0x882c('0x33')]({'plain':!![]});var _0x1c63fb=_0x882c('0x34');return db[_0x882c('0x35')][_0x882c('0x32')]({'where':{'type':_0x1c63fb,'resourceId':_0x143d4a['id']}})[_0x882c('0x31')](function(){return _0x54f54e;});})['then'](function(){_0x427bff[_0x882c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f3044,_0x2a3767){return function(_0x4731fb){if(!_0x4731fb){_0x2f3044[_0x882c('0x24')](0x194);}return _0x4731fb;};}function handleError(_0x4e5b8a,_0x4f006f){_0x4f006f=_0x4f006f||0x1f4;return function(_0x526b0a){logger[_0x882c('0x21')](_0x526b0a[_0x882c('0x36')]);if(_0x526b0a['name']){delete _0x526b0a[_0x882c('0x37')];}_0x4e5b8a['status'](_0x4f006f)[_0x882c('0x38')](_0x526b0a);};}exports[_0x882c('0x39')]=function(_0x44f462,_0x218b07){var _0x5ce153={},_0x21d2d6={},_0x11162a={'count':0x0,'rows':[]};var _0x4202ad=_[_0x882c('0x3a')](db['VoiceContext']['rawAttributes'],function(_0x272415){return{'name':_0x272415['fieldName'],'type':_0x272415['type'][_0x882c('0x3b')]};});_0x21d2d6[_0x882c('0x3c')]=_[_0x882c('0x3a')](_0x4202ad,_0x882c('0x37'));_0x21d2d6[_0x882c('0x3d')]=_[_0x882c('0x3e')](_0x44f462[_0x882c('0x3d')]);_0x21d2d6['filters']=_['intersection'](_0x21d2d6[_0x882c('0x3c')],_0x21d2d6[_0x882c('0x3d')]);_0x5ce153[_0x882c('0x3f')]=_[_0x882c('0x40')](_0x21d2d6[_0x882c('0x3c')],qs['fields'](_0x44f462['query'][_0x882c('0x41')]));_0x5ce153[_0x882c('0x3f')]=_0x5ce153[_0x882c('0x3f')][_0x882c('0x42')]?_0x5ce153[_0x882c('0x3f')]:_0x21d2d6[_0x882c('0x3c')];if(!_0x44f462[_0x882c('0x3d')][_0x882c('0x43')](_0x882c('0x44'))){_0x5ce153['limit']=qs['limit'](_0x44f462[_0x882c('0x3d')][_0x882c('0x2a')]);_0x5ce153['offset']=qs[_0x882c('0x28')](_0x44f462[_0x882c('0x3d')][_0x882c('0x28')]);}_0x5ce153[_0x882c('0x45')]=qs['sort'](_0x44f462[_0x882c('0x3d')][_0x882c('0x46')]);_0x5ce153['where']=qs[_0x882c('0x47')](_['pick'](_0x44f462['query'],_0x21d2d6['filters']),_0x4202ad);if(_0x44f462['query'][_0x882c('0x48')]){_0x5ce153[_0x882c('0x49')]=_[_0x882c('0x4a')](_0x5ce153[_0x882c('0x49')],{'$or':_[_0x882c('0x3a')](_0x4202ad,function(_0xad7dd7){if(_0xad7dd7[_0x882c('0x4b')]!=='VIRTUAL'){var _0x3aefd3={};_0x3aefd3[_0xad7dd7['name']]={'$like':'%'+_0x44f462[_0x882c('0x3d')][_0x882c('0x48')]+'%'};return _0x3aefd3;}})});}_0x5ce153=_[_0x882c('0x4a')]({},_0x5ce153,_0x44f462[_0x882c('0x4c')]);var _0x47bb88={'where':_0x5ce153[_0x882c('0x49')]};return db[_0x882c('0x4d')]['count'](_0x47bb88)['then'](function(_0x35562c){_0x11162a[_0x882c('0x2b')]=_0x35562c;if(_0x44f462['query'][_0x882c('0x4e')]){_0x5ce153[_0x882c('0x4f')]=[{'all':!![]}];}return db[_0x882c('0x4d')]['findAll'](_0x5ce153);})['then'](function(_0x46bb3b){_0x11162a[_0x882c('0x50')]=_0x46bb3b;return _0x11162a;})[_0x882c('0x31')](respondWithFilteredResult(_0x218b07,_0x5ce153))[_0x882c('0x51')](handleError(_0x218b07,null));};exports[_0x882c('0x52')]=function(_0x145939,_0x333832){var _0x5a20a2={'raw':![],'where':{'id':_0x145939[_0x882c('0x53')]['id']}},_0x1f7279={};_0x1f7279[_0x882c('0x3c')]=_[_0x882c('0x3e')](db[_0x882c('0x4d')]['rawAttributes']);_0x1f7279[_0x882c('0x3d')]=_[_0x882c('0x3e')](_0x145939['query']);_0x1f7279[_0x882c('0x47')]=_[_0x882c('0x40')](_0x1f7279[_0x882c('0x3c')],_0x1f7279[_0x882c('0x3d')]);_0x5a20a2[_0x882c('0x3f')]=_['intersection'](_0x1f7279[_0x882c('0x3c')],qs[_0x882c('0x41')](_0x145939[_0x882c('0x3d')]['fields']));_0x5a20a2['attributes']=_0x5a20a2[_0x882c('0x3f')][_0x882c('0x42')]?_0x5a20a2['attributes']:_0x1f7279[_0x882c('0x3c')];if(_0x145939['query']['includeAll']){_0x5a20a2[_0x882c('0x4f')]=[{'all':!![]}];}_0x5a20a2=_[_0x882c('0x4a')]({},_0x5a20a2,_0x145939[_0x882c('0x4c')]);return db[_0x882c('0x4d')]['find'](_0x5a20a2)[_0x882c('0x31')](handleEntityNotFound(_0x333832,null))[_0x882c('0x31')](respondWithResult(_0x333832,null))[_0x882c('0x51')](handleError(_0x333832,null));};exports[_0x882c('0x54')]=function(_0x57bc48,_0x5c9f0d,_0xd4ea64){var _0x2ea727;return db['VoiceContext']['create'](_0x57bc48[_0x882c('0x55')],{'raw':!![]})[_0x882c('0x31')](function(_0x2304cc){_0x2ea727=_0x2304cc;return db[_0x882c('0x4d')][_0x882c('0x56')]({'raw':!![]});})[_0x882c('0x31')](function(_0x26c5a3){var _0x2245ea=fs['readFileSync'](path[_0x882c('0x57')](config[_0x882c('0x58')],_0x882c('0x59')),_0x882c('0x5a'));var _0x45aaae=ejs[_0x882c('0x5b')](_0x2245ea,{'contexts':_0x26c5a3||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x45aaae);})[_0x882c('0x31')](function(){return respondWithRpcPromise('Reload',_0x882c('0x54'),{'module':'chan_sip.so'});})[_0x882c('0x31')](function(){var _0x133540=_0x57bc48[_0x882c('0x5c')]['get']({'plain':!![]});if(!_0x133540)throw new Error(_0x882c('0x5d'));if(_0x133540[_0x882c('0x5e')]===_0x882c('0x5c')){var _0x497010=_0x2ea727[_0x882c('0x33')]({'plain':!![]});return db[_0x882c('0x5f')]['find']({'where':{'name':_0x882c('0x34'),'userProfileId':_0x133540[_0x882c('0x60')]},'raw':!![]})[_0x882c('0x31')](function(_0x491aea){if(_0x491aea&&_0x491aea[_0x882c('0x61')]===0x0){return db[_0x882c('0x35')][_0x882c('0x54')]({'name':_0x497010[_0x882c('0x37')],'resourceId':_0x497010['id'],'type':_0x491aea[_0x882c('0x37')],'sectionId':_0x491aea['id']},{})[_0x882c('0x31')](function(){return _0x2ea727;});}else{return _0x2ea727;}})[_0x882c('0x51')](function(_0x1dd035){logger['error'](_0x882c('0x62'),_0x1dd035);throw _0x1dd035;});}return _0x2ea727;})[_0x882c('0x31')](respondWithResult(_0x5c9f0d,0xc9))['catch'](handleError(_0x5c9f0d,null));};exports[_0x882c('0x30')]=function(_0x1dd884,_0x201cbb,_0x11ee85){var _0xd82ee1;return db[_0x882c('0x4d')][_0x882c('0x63')]({'where':{'id':_0x1dd884[_0x882c('0x53')]['id']}})['then'](handleEntityNotFound(_0x201cbb,null))[_0x882c('0x31')](saveUpdates(_0x1dd884['body'],null))[_0x882c('0x31')](function(_0x839491){if(_0x839491){_0xd82ee1=_0x839491;return db[_0x882c('0x4d')][_0x882c('0x56')]({'raw':!![]});}})[_0x882c('0x31')](function(_0x4744ac){var _0x1344ef=fs[_0x882c('0x64')](path['join'](config[_0x882c('0x58')],_0x882c('0x59')),_0x882c('0x5a'));var _0x48a35f=ejs[_0x882c('0x5b')](_0x1344ef,{'contexts':_0x4744ac||[]});fs[_0x882c('0x65')](_0x882c('0x66'),_0x48a35f);})[_0x882c('0x31')](function(){return respondWithRpcPromise(_0x882c('0x67'),_0x882c('0x30'),{'module':'chan_sip.so'});})['then'](function(){return _0xd82ee1;})[_0x882c('0x31')](respondWithResult(_0x201cbb,null))[_0x882c('0x51')](handleError(_0x201cbb,null));};exports[_0x882c('0x32')]=function(_0x1c3899,_0x33e56f,_0x4aed2d){var _0x5f444d;return db[_0x882c('0x4d')][_0x882c('0x63')]({'where':{'id':_0x1c3899[_0x882c('0x53')]['id']}})[_0x882c('0x31')](handleEntityNotFound(_0x33e56f,null))[_0x882c('0x31')](removeEntity(_0x33e56f,null))['then'](function(){return db[_0x882c('0x4d')]['findAll']({'raw':!![]});})['then'](function(_0x3b8f69){var _0x12c26a=fs[_0x882c('0x64')](path[_0x882c('0x57')](config[_0x882c('0x58')],_0x882c('0x59')),_0x882c('0x5a'));var _0x17f99d=ejs[_0x882c('0x5b')](_0x12c26a,{'contexts':_0x3b8f69});fs[_0x882c('0x65')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x17f99d);return respondWithRpcPromise(_0x882c('0x67'),'destroy',{'module':_0x882c('0x68')});})['catch'](handleError(_0x33e56f,null));}; \ No newline at end of file +var _0x5927=['includeAll','include','rows','show','params','create','body','findAll','readFileSync','join','server/files/templates/context.ejs','utf8','render','Reload','chan_sip.so','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','root','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','jayson/promise','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','UserProfileResource','stack','name','send','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','map','VIRTUAL','options','VoiceContext'];(function(_0x5cbb30,_0x15d4f2){var _0x4b69c6=function(_0x56ac03){while(--_0x56ac03){_0x5cbb30['push'](_0x5cbb30['shift']());}};_0x4b69c6(++_0x15d4f2);}(_0x5927,0x7d));var _0x7592=function(_0x324fe8,_0x1ccb46){_0x324fe8=_0x324fe8-0x0;var _0x4a1cd9=_0x5927[_0x324fe8];return _0x4a1cd9;};'use strict';var emlformat=require(_0x7592('0x0'));var rimraf=require(_0x7592('0x1'));var zipdir=require(_0x7592('0x2'));var jsonpatch=require(_0x7592('0x3'));var rp=require(_0x7592('0x4'));var moment=require(_0x7592('0x5'));var BPromise=require(_0x7592('0x6'));var Mustache=require(_0x7592('0x7'));var util=require(_0x7592('0x8'));var path=require('path');var sox=require(_0x7592('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7592('0xa'));var _=require(_0x7592('0xb'));var squel=require(_0x7592('0xc'));var crypto=require(_0x7592('0xd'));var jsforce=require(_0x7592('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7592('0xf'));var querystring=require(_0x7592('0x10'));var Papa=require(_0x7592('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7592('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7592('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7592('0x14'));var db=require(_0x7592('0x15'))['db'];var jayson=require(_0x7592('0x16'));var client=jayson['client'][_0x7592('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x49dab4,_0xd68c3a,_0x18032e,_0x18613c){return new BPromise(function(_0x5357aa,_0x4fb2bb){var _0x637ff2=_0x18613c||client;return _0x637ff2[_0x7592('0x18')](_0x49dab4,_0x18032e)['then'](function(_0x33d61a){logger['info'](_0x7592('0x19'),_0xd68c3a,_0x7592('0x1a'));logger[_0x7592('0x1b')](_0x7592('0x1c'),_0xd68c3a,_0x7592('0x1a'),JSON[_0x7592('0x1d')](_0x33d61a));if(_0x33d61a[_0x7592('0x1e')]){if(_0x33d61a[_0x7592('0x1e')][_0x7592('0x1f')]===0x1f4){logger[_0x7592('0x1e')](_0x7592('0x19'),_0xd68c3a,_0x33d61a[_0x7592('0x1e')][_0x7592('0x20')]);return _0x4fb2bb(_0x33d61a[_0x7592('0x1e')][_0x7592('0x20')]);}logger[_0x7592('0x1e')](_0x7592('0x19'),_0xd68c3a,_0x33d61a[_0x7592('0x1e')][_0x7592('0x20')]);return _0x5357aa(_0x33d61a['error'][_0x7592('0x20')]);}else{logger[_0x7592('0x21')]('VoiceContext,\x20%s,\x20%s',_0xd68c3a,_0x7592('0x1a'));_0x5357aa(_0x33d61a['result'][_0x7592('0x20')]);}})[_0x7592('0x22')](function(_0x210447){logger['error'](_0x7592('0x19'),_0xd68c3a,_0x210447);_0x4fb2bb(_0x210447);});});}function respondWithStatusCode(_0x458647,_0x1dac09){_0x1dac09=_0x1dac09||0xcc;return function(_0x2a59e3){if(_0x2a59e3){return _0x458647[_0x7592('0x23')](_0x1dac09);}return _0x458647[_0x7592('0x24')](_0x1dac09)[_0x7592('0x25')]();};}function respondWithResult(_0x2f52a6,_0x19f1fd){_0x19f1fd=_0x19f1fd||0xc8;return function(_0x39708d){if(_0x39708d){return _0x2f52a6[_0x7592('0x24')](_0x19f1fd)[_0x7592('0x26')](_0x39708d);}};}function respondWithFilteredResult(_0x34723a,_0x2b6d46){return function(_0x4c007e){if(_0x4c007e){var _0x504363=typeof _0x2b6d46[_0x7592('0x27')]==='undefined'&&typeof _0x2b6d46[_0x7592('0x28')]===_0x7592('0x29');var _0x3e882a=_0x4c007e[_0x7592('0x2a')];var _0x10f1be=_0x504363?0x0:_0x2b6d46[_0x7592('0x27')];var _0x55fb34=_0x504363?_0x4c007e[_0x7592('0x2a')]:_0x2b6d46['offset']+_0x2b6d46[_0x7592('0x28')];var _0x142538;if(_0x55fb34>=_0x3e882a){_0x55fb34=_0x3e882a;_0x142538=0xc8;}else{_0x142538=0xce;}_0x34723a['status'](_0x142538);return _0x34723a[_0x7592('0x2b')](_0x7592('0x2c'),_0x10f1be+'-'+_0x55fb34+'/'+_0x3e882a)[_0x7592('0x26')](_0x4c007e);}return null;};}function patchUpdates(_0x2be15e){return function(_0x532560){try{jsonpatch[_0x7592('0x2d')](_0x532560,_0x2be15e,!![]);}catch(_0x2e4e0b){return BPromise['reject'](_0x2e4e0b);}return _0x532560['save']();};}function saveUpdates(_0x483f34,_0x101266){return function(_0x24c703){if(_0x24c703){return _0x24c703[_0x7592('0x2e')](_0x483f34)[_0x7592('0x2f')](function(_0x29de9e){return _0x29de9e;});}return null;};}function removeEntity(_0x191dd9,_0x3c9a77){return function(_0x1bebc5){if(_0x1bebc5){return _0x1bebc5[_0x7592('0x30')]()[_0x7592('0x2f')](function(){var _0x6d768e=_0x1bebc5['get']({'plain':!![]});var _0x3bea1f='Contexts';return db[_0x7592('0x31')][_0x7592('0x30')]({'where':{'type':_0x3bea1f,'resourceId':_0x6d768e['id']}})[_0x7592('0x2f')](function(){return _0x1bebc5;});})['then'](function(){_0x191dd9[_0x7592('0x24')](0xcc)[_0x7592('0x25')]();});}};}function handleEntityNotFound(_0x3025eb,_0x4a4e42){return function(_0x2b34b8){if(!_0x2b34b8){_0x3025eb[_0x7592('0x23')](0x194);}return _0x2b34b8;};}function handleError(_0x5d7b3f,_0xb98eac){_0xb98eac=_0xb98eac||0x1f4;return function(_0x14013f){logger[_0x7592('0x1e')](_0x14013f[_0x7592('0x32')]);if(_0x14013f[_0x7592('0x33')]){delete _0x14013f[_0x7592('0x33')];}_0x5d7b3f[_0x7592('0x24')](_0xb98eac)[_0x7592('0x34')](_0x14013f);};}exports['index']=function(_0xaa759,_0x4c5ea3){var _0x2b96e7={},_0x1a9703={},_0x136225={'count':0x0,'rows':[]};var _0x45a042=_['map'](db['VoiceContext'][_0x7592('0x35')],function(_0x199063){return{'name':_0x199063['fieldName'],'type':_0x199063[_0x7592('0x36')][_0x7592('0x37')]};});_0x1a9703[_0x7592('0x38')]=_['map'](_0x45a042,_0x7592('0x33'));_0x1a9703[_0x7592('0x39')]=_[_0x7592('0x3a')](_0xaa759['query']);_0x1a9703['filters']=_[_0x7592('0x3b')](_0x1a9703['model'],_0x1a9703['query']);_0x2b96e7['attributes']=_[_0x7592('0x3b')](_0x1a9703['model'],qs[_0x7592('0x3c')](_0xaa759[_0x7592('0x39')]['fields']));_0x2b96e7[_0x7592('0x3d')]=_0x2b96e7[_0x7592('0x3d')][_0x7592('0x3e')]?_0x2b96e7[_0x7592('0x3d')]:_0x1a9703[_0x7592('0x38')];if(!_0xaa759[_0x7592('0x39')][_0x7592('0x3f')](_0x7592('0x40'))){_0x2b96e7[_0x7592('0x28')]=qs[_0x7592('0x28')](_0xaa759[_0x7592('0x39')][_0x7592('0x28')]);_0x2b96e7[_0x7592('0x27')]=qs[_0x7592('0x27')](_0xaa759['query'][_0x7592('0x27')]);}_0x2b96e7[_0x7592('0x41')]=qs[_0x7592('0x42')](_0xaa759[_0x7592('0x39')][_0x7592('0x42')]);_0x2b96e7['where']=qs[_0x7592('0x43')](_[_0x7592('0x44')](_0xaa759[_0x7592('0x39')],_0x1a9703['filters']),_0x45a042);if(_0xaa759[_0x7592('0x39')]['filter']){_0x2b96e7['where']=_[_0x7592('0x45')](_0x2b96e7[_0x7592('0x46')],{'$or':_[_0x7592('0x47')](_0x45a042,function(_0x682764){if(_0x682764[_0x7592('0x36')]!==_0x7592('0x48')){var _0x5055c5={};_0x5055c5[_0x682764[_0x7592('0x33')]]={'$like':'%'+_0xaa759[_0x7592('0x39')]['filter']+'%'};return _0x5055c5;}})});}_0x2b96e7=_[_0x7592('0x45')]({},_0x2b96e7,_0xaa759[_0x7592('0x49')]);var _0xb21f60={'where':_0x2b96e7[_0x7592('0x46')]};return db[_0x7592('0x4a')][_0x7592('0x2a')](_0xb21f60)[_0x7592('0x2f')](function(_0x13ef0e){_0x136225[_0x7592('0x2a')]=_0x13ef0e;if(_0xaa759[_0x7592('0x39')][_0x7592('0x4b')]){_0x2b96e7[_0x7592('0x4c')]=[{'all':!![]}];}return db[_0x7592('0x4a')]['findAll'](_0x2b96e7);})[_0x7592('0x2f')](function(_0x4795b4){_0x136225[_0x7592('0x4d')]=_0x4795b4;return _0x136225;})[_0x7592('0x2f')](respondWithFilteredResult(_0x4c5ea3,_0x2b96e7))[_0x7592('0x22')](handleError(_0x4c5ea3,null));};exports[_0x7592('0x4e')]=function(_0x196317,_0x255d9e){var _0x2b113c={'raw':![],'where':{'id':_0x196317[_0x7592('0x4f')]['id']}},_0x18371c={};_0x18371c[_0x7592('0x38')]=_[_0x7592('0x3a')](db[_0x7592('0x4a')][_0x7592('0x35')]);_0x18371c[_0x7592('0x39')]=_[_0x7592('0x3a')](_0x196317[_0x7592('0x39')]);_0x18371c[_0x7592('0x43')]=_['intersection'](_0x18371c[_0x7592('0x38')],_0x18371c[_0x7592('0x39')]);_0x2b113c[_0x7592('0x3d')]=_[_0x7592('0x3b')](_0x18371c[_0x7592('0x38')],qs[_0x7592('0x3c')](_0x196317[_0x7592('0x39')][_0x7592('0x3c')]));_0x2b113c[_0x7592('0x3d')]=_0x2b113c['attributes'][_0x7592('0x3e')]?_0x2b113c[_0x7592('0x3d')]:_0x18371c[_0x7592('0x38')];if(_0x196317[_0x7592('0x39')]['includeAll']){_0x2b113c['include']=[{'all':!![]}];}_0x2b113c=_['merge']({},_0x2b113c,_0x196317[_0x7592('0x49')]);return db[_0x7592('0x4a')]['find'](_0x2b113c)['then'](handleEntityNotFound(_0x255d9e,null))['then'](respondWithResult(_0x255d9e,null))[_0x7592('0x22')](handleError(_0x255d9e,null));};exports[_0x7592('0x50')]=function(_0x2c3db6,_0x17f014,_0x39cd23){var _0x5e2a93;return db[_0x7592('0x4a')]['create'](_0x2c3db6[_0x7592('0x51')],{'raw':!![]})[_0x7592('0x2f')](function(_0x31844c){_0x5e2a93=_0x31844c;return db[_0x7592('0x4a')][_0x7592('0x52')]({'raw':!![]});})['then'](function(_0x40158a){var _0x3217d8=fs[_0x7592('0x53')](path[_0x7592('0x54')](config['root'],_0x7592('0x55')),_0x7592('0x56'));var _0x45ed5e=ejs[_0x7592('0x57')](_0x3217d8,{'contexts':_0x40158a||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x45ed5e);})['then'](function(){return respondWithRpcPromise(_0x7592('0x58'),_0x7592('0x50'),{'module':_0x7592('0x59')});})[_0x7592('0x2f')](function(){var _0x3c275b=_0x2c3db6['user'][_0x7592('0x5a')]({'plain':!![]});if(!_0x3c275b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c275b[_0x7592('0x5b')]===_0x7592('0x5c')){var _0x3e8d42=_0x5e2a93[_0x7592('0x5a')]({'plain':!![]});return db[_0x7592('0x5d')][_0x7592('0x5e')]({'where':{'name':'Contexts','userProfileId':_0x3c275b[_0x7592('0x5f')]},'raw':!![]})[_0x7592('0x2f')](function(_0x14c9b9){if(_0x14c9b9&&_0x14c9b9[_0x7592('0x60')]===0x0){return db[_0x7592('0x31')]['create']({'name':_0x3e8d42[_0x7592('0x33')],'resourceId':_0x3e8d42['id'],'type':_0x14c9b9[_0x7592('0x33')],'sectionId':_0x14c9b9['id']},{})[_0x7592('0x2f')](function(){return _0x5e2a93;});}else{return _0x5e2a93;}})[_0x7592('0x22')](function(_0x3187ca){logger[_0x7592('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3187ca);throw _0x3187ca;});}return _0x5e2a93;})[_0x7592('0x2f')](respondWithResult(_0x17f014,0xc9))['catch'](handleError(_0x17f014,null));};exports[_0x7592('0x2e')]=function(_0x18987a,_0x5ee52a,_0xd43041){var _0x11eb05;return db['VoiceContext'][_0x7592('0x5e')]({'where':{'id':_0x18987a[_0x7592('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5ee52a,null))[_0x7592('0x2f')](saveUpdates(_0x18987a[_0x7592('0x51')],null))[_0x7592('0x2f')](function(_0x188ad2){if(_0x188ad2){_0x11eb05=_0x188ad2;return db[_0x7592('0x4a')][_0x7592('0x52')]({'raw':!![]});}})['then'](function(_0x2f2524){var _0x1121b1=fs[_0x7592('0x53')](path[_0x7592('0x54')](config[_0x7592('0x61')],'server/files/templates/context.ejs'),'utf8');var _0x475c7f=ejs[_0x7592('0x57')](_0x1121b1,{'contexts':_0x2f2524||[]});fs[_0x7592('0x62')](_0x7592('0x63'),_0x475c7f);})['then'](function(){return respondWithRpcPromise(_0x7592('0x58'),_0x7592('0x2e'),{'module':_0x7592('0x59')});})[_0x7592('0x2f')](function(){return _0x11eb05;})[_0x7592('0x2f')](respondWithResult(_0x5ee52a,null))[_0x7592('0x22')](handleError(_0x5ee52a,null));};exports[_0x7592('0x30')]=function(_0x1ae1e0,_0x792f45,_0x19fd07){var _0xd56d51;return db[_0x7592('0x4a')][_0x7592('0x5e')]({'where':{'id':_0x1ae1e0['params']['id']}})['then'](handleEntityNotFound(_0x792f45,null))[_0x7592('0x2f')](removeEntity(_0x792f45,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})['then'](function(_0x545c27){var _0x5c7bbe=fs[_0x7592('0x53')](path[_0x7592('0x54')](config[_0x7592('0x61')],'server/files/templates/context.ejs'),_0x7592('0x56'));var _0x3883ad=ejs[_0x7592('0x57')](_0x5c7bbe,{'contexts':_0x545c27});fs[_0x7592('0x62')](_0x7592('0x63'),_0x3883ad);return respondWithRpcPromise(_0x7592('0x58'),_0x7592('0x30'),{'module':_0x7592('0x59')});})['catch'](handleError(_0x792f45,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 18b2360..0ed1a45 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 _0x590c=['util','../../config/logger','api','moment','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash'];(function(_0x3c07d7,_0x346802){var _0x150ec=function(_0x5ec08f){while(--_0x5ec08f){_0x3c07d7['push'](_0x3c07d7['shift']());}};_0x150ec(++_0x346802);}(_0x590c,0x12b));var _0xc590=function(_0x4449a8,_0x79adf3){_0x4449a8=_0x4449a8-0x0;var _0x4783b6=_0x590c[_0x4449a8];return _0x4783b6;};'use strict';var _=require(_0xc590('0x0'));var util=require(_0xc590('0x1'));var logger=require(_0xc590('0x2'))(_0xc590('0x3'));var moment=require(_0xc590('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc590('0x5'));var config=require(_0xc590('0x6'));var attributes=require(_0xc590('0x7'));module[_0xc590('0x8')]=function(_0x5d712b,_0x27a33a){return _0x5d712b[_0xc590('0x9')](_0xc590('0xa'),attributes,{'tableName':_0xc590('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2723=['path','rimraf','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xba37dc,_0x85d6a2){var _0x58fed2=function(_0x1c0f0d){while(--_0x1c0f0d){_0xba37dc['push'](_0xba37dc['shift']());}};_0x58fed2(++_0x85d6a2);}(_0x2723,0xbc));var _0x3272=function(_0x312fc8,_0x5ef3c4){_0x312fc8=_0x312fc8-0x0;var _0x5a8a60=_0x2723[_0x312fc8];return _0x5a8a60;};'use strict';var _=require(_0x3272('0x0'));var util=require(_0x3272('0x1'));var logger=require(_0x3272('0x2'))(_0x3272('0x3'));var moment=require(_0x3272('0x4'));var BPromise=require(_0x3272('0x5'));var rp=require(_0x3272('0x6'));var fs=require('fs');var path=require(_0x3272('0x7'));var rimraf=require(_0x3272('0x8'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x3272('0x9')]=function(_0x3f9b6d,_0x533352){return _0x3f9b6d[_0x3272('0xa')](_0x3272('0xb'),attributes,{'tableName':_0x3272('0xc'),'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 ef9ea2b..43487bd 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 _0x00f4=['http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x00f4,0x137));var _0x400f=function(_0x38f710,_0x6f8db0){_0x38f710=_0x38f710-0x0;var _0xd6fa44=_0x00f4[_0x38f710];return _0xd6fa44;};'use strict';var _=require(_0x400f('0x0'));var util=require('util');var moment=require(_0x400f('0x1'));var BPromise=require(_0x400f('0x2'));var rs=require(_0x400f('0x3'));var fs=require('fs');var Redis=require(_0x400f('0x4'));var db=require(_0x400f('0x5'))['db'];var utils=require(_0x400f('0x6'));var logger=require(_0x400f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x400f('0x8'));var client=jayson['client'][_0x400f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x360f0e,_0x2efbc4,_0x1b9b4f){return new BPromise(function(_0x32a24e,_0x3e2cfb){return client[_0x400f('0xa')](_0x360f0e,_0x1b9b4f)['then'](function(_0x4c4174){logger[_0x400f('0xb')](_0x400f('0xc'),_0x2efbc4,_0x400f('0xd'));logger['debug'](_0x400f('0xe'),_0x2efbc4,_0x400f('0xd'),JSON['stringify'](_0x4c4174));if(_0x4c4174[_0x400f('0xf')]){if(_0x4c4174['error'][_0x400f('0x10')]===0x1f4){logger[_0x400f('0xf')](_0x400f('0xc'),_0x2efbc4,_0x4c4174[_0x400f('0xf')]['message']);return _0x3e2cfb(_0x4c4174['error']['message']);}logger[_0x400f('0xf')](_0x400f('0xc'),_0x2efbc4,_0x4c4174[_0x400f('0xf')][_0x400f('0x11')]);return _0x32a24e(_0x4c4174['error'][_0x400f('0x11')]);}else{logger[_0x400f('0xb')](_0x400f('0xc'),_0x2efbc4,_0x400f('0xd'));_0x32a24e(_0x4c4174[_0x400f('0x12')]['message']);}})[_0x400f('0x13')](function(_0x133f24){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2efbc4,_0x133f24);_0x3e2cfb(_0x133f24);});});} \ No newline at end of file +var _0x4639=['client','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x28899e,_0x46e496){var _0x51e4f8=function(_0x12a504){while(--_0x12a504){_0x28899e['push'](_0x28899e['shift']());}};_0x51e4f8(++_0x46e496);}(_0x4639,0x115));var _0x9463=function(_0x538acc,_0x47e62){_0x538acc=_0x538acc-0x0;var _0x3b985a=_0x4639[_0x538acc];return _0x3b985a;};'use strict';var _=require(_0x9463('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9463('0x1'));var rs=require(_0x9463('0x2'));var fs=require('fs');var Redis=require(_0x9463('0x3'));var db=require(_0x9463('0x4'))['db'];var utils=require(_0x9463('0x5'));var logger=require(_0x9463('0x6'))(_0x9463('0x7'));var config=require('../../config/environment');var jayson=require(_0x9463('0x8'));var client=jayson[_0x9463('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494a02,_0x3b5e95,_0x500f5d){return new BPromise(function(_0x58d09c,_0x465758){return client[_0x9463('0xa')](_0x494a02,_0x500f5d)[_0x9463('0xb')](function(_0x49e617){logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));logger[_0x9463('0xf')](_0x9463('0x10'),_0x3b5e95,_0x9463('0xe'),JSON[_0x9463('0x11')](_0x49e617));if(_0x49e617[_0x9463('0x12')]){if(_0x49e617[_0x9463('0x12')][_0x9463('0x13')]===0x1f4){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);return _0x465758(_0x49e617[_0x9463('0x12')][_0x9463('0x14')]);}logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x49e617[_0x9463('0x12')]['message']);return _0x58d09c(_0x49e617[_0x9463('0x12')]['message']);}else{logger[_0x9463('0xc')](_0x9463('0xd'),_0x3b5e95,_0x9463('0xe'));_0x58d09c(_0x49e617[_0x9463('0x15')][_0x9463('0x14')]);}})['catch'](function(_0x3d5a81){logger[_0x9463('0x12')](_0x9463('0xd'),_0x3b5e95,_0x3d5a81);_0x465758(_0x3d5a81);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 152dead..5555113 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 _0x487d=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x53aaf8,_0x863bcb){var _0x1fedb1=function(_0x5696f4){while(--_0x5696f4){_0x53aaf8['push'](_0x53aaf8['shift']());}};_0x1fedb1(++_0x863bcb);}(_0x487d,0x1b4));var _0xd487=function(_0x1a5796,_0x38cfa6){_0x1a5796=_0x1a5796-0x0;var _0x1e45ca=_0x487d[_0x1a5796];return _0x1e45ca;};'use strict';var multer=require(_0xd487('0x0'));var util=require(_0xd487('0x1'));var path=require(_0xd487('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd487('0x3')]();var fs_extra=require(_0xd487('0x4'));var auth=require(_0xd487('0x5'));var interaction=require(_0xd487('0x6'));var config=require(_0xd487('0x7'));var controller=require('./voiceDialReport.controller');router[_0xd487('0x8')]('/',auth[_0xd487('0x9')](),controller['index']);router[_0xd487('0x8')](_0xd487('0xa'),auth[_0xd487('0x9')](),controller[_0xd487('0xb')]);router['get'](_0xd487('0xc'),auth[_0xd487('0x9')](),controller[_0xd487('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd487('0xe')](_0xd487('0xc'),auth['isAuthenticated'](),controller[_0xd487('0xf')]);router[_0xd487('0x10')](_0xd487('0xc'),auth[_0xd487('0x9')](),controller[_0xd487('0x11')]);module[_0xd487('0x12')]=router; \ No newline at end of file +var _0xb664=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb664,0x192));var _0x4b66=function(_0x2df6d9,_0x7cf0da){_0x2df6d9=_0x2df6d9-0x0;var _0x2cb4e3=_0xb664[_0x2df6d9];return _0x2cb4e3;};'use strict';var multer=require(_0x4b66('0x0'));var util=require(_0x4b66('0x1'));var path=require(_0x4b66('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b66('0x3'));var router=express[_0x4b66('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4b66('0x5'));var interaction=require(_0x4b66('0x6'));var config=require('../../config/environment');var controller=require(_0x4b66('0x7'));router['get']('/',auth[_0x4b66('0x8')](),controller[_0x4b66('0x9')]);router[_0x4b66('0xa')](_0x4b66('0xb'),auth[_0x4b66('0x8')](),controller[_0x4b66('0xc')]);router[_0x4b66('0xa')](_0x4b66('0xd'),auth[_0x4b66('0x8')](),controller[_0x4b66('0xe')]);router[_0x4b66('0xf')]('/',auth[_0x4b66('0x8')](),controller[_0x4b66('0x10')]);router[_0x4b66('0x11')](_0x4b66('0xd'),auth[_0x4b66('0x8')](),controller[_0x4b66('0x12')]);router[_0x4b66('0x13')](_0x4b66('0xd'),auth[_0x4b66('0x8')](),controller[_0x4b66('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index cfddb49..f551b30 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 _0x9957=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x4959d0,_0x17ec00){var _0xd9d39d=function(_0x166890){while(--_0x166890){_0x4959d0['push'](_0x4959d0['shift']());}};_0xd9d39d(++_0x17ec00);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'privilege':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize[_0x7995('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7995('0x2')]},'calleridnum':{'type':Sequelize[_0x7995('0x2')]},'calleridname':{'type':Sequelize[_0x7995('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'context':{'type':Sequelize[_0x7995('0x2')]},'exten':{'type':Sequelize[_0x7995('0x2')]},'priority':{'type':Sequelize[_0x7995('0x3')]},'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x7995('0x2')]},'destchannelstate':{'type':Sequelize[_0x7995('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7995('0x2')]},'destcalleridname':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7995('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7995('0x2')]},'destlanguage':{'type':Sequelize[_0x7995('0x2')]},'destaccountcode':{'type':Sequelize[_0x7995('0x2')]},'destcontext':{'type':Sequelize[_0x7995('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x7995('0x3')]},'destuniqueid':{'type':Sequelize[_0x7995('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7995('0x2')]},'dialstatus':{'type':Sequelize[_0x7995('0x2')]},'starttime':{'type':Sequelize[_0x7995('0x4')]},'answertime':{'type':Sequelize[_0x7995('0x4')]},'endtime':{'type':Sequelize[_0x7995('0x4')]},'lastevent':{'type':Sequelize[_0x7995('0x2')],'comment':_0x7995('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x7995('0x3')]},'billableseconds':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x5e8dec,_0x5227b9){var _0x3b3d4c=function(_0xfac644){while(--_0xfac644){_0x5e8dec['push'](_0x5e8dec['shift']());}};_0x3b3d4c(++_0x5227b9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0xf3cd[_0xaf29da];return _0x295c51;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'privilege':{'type':Sequelize[_0xdf3c('0x2')]},'channel':{'type':Sequelize[_0xdf3c('0x2')]},'channelstate':{'type':Sequelize[_0xdf3c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xdf3c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdf3c('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdf3c('0x2')]},'context':{'type':Sequelize[_0xdf3c('0x2')]},'exten':{'type':Sequelize[_0xdf3c('0x2')]},'priority':{'type':Sequelize[_0xdf3c('0x3')]},'uniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'linkedid':{'type':Sequelize[_0xdf3c('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdf3c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdf3c('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xdf3c('0x2')]},'destaccountcode':{'type':Sequelize[_0xdf3c('0x2')]},'destcontext':{'type':Sequelize[_0xdf3c('0x2')]},'destexten':{'type':Sequelize[_0xdf3c('0x2')]},'destpriority':{'type':Sequelize[_0xdf3c('0x3')]},'destuniqueid':{'type':Sequelize[_0xdf3c('0x2')]},'destlinkedid':{'type':Sequelize[_0xdf3c('0x2')]},'dialstring':{'type':Sequelize[_0xdf3c('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf3c('0x4')]},'answertime':{'type':Sequelize[_0xdf3c('0x4')]},'endtime':{'type':Sequelize[_0xdf3c('0x4')]},'lastevent':{'type':Sequelize[_0xdf3c('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xdf3c('0x3')]},'duration':{'type':Sequelize[_0xdf3c('0x3')]},'holdtime':{'type':Sequelize[_0xdf3c('0x3')]},'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 2ab0f59..4229cf0 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 _0x70c6=['undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','then','include','VoiceDialReport','findAll','rows','catch','show','params','keys','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json'];(function(_0x2e4f89,_0xd6044){var _0x527fa1=function(_0x32b8de){while(--_0x32b8de){_0x2e4f89['push'](_0x2e4f89['shift']());}};_0x527fa1(++_0xd6044);}(_0x70c6,0x10a));var _0x670c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x70c6[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x670c('0x0'));var rimraf=require(_0x670c('0x1'));var zipdir=require(_0x670c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x670c('0x3'));var path=require(_0x670c('0x4'));var sox=require(_0x670c('0x5'));var csv=require(_0x670c('0x6'));var ejs=require(_0x670c('0x7'));var fs=require('fs');var fs_extra=require(_0x670c('0x8'));var _=require(_0x670c('0x9'));var squel=require('squel');var crypto=require(_0x670c('0xa'));var jsforce=require(_0x670c('0xb'));var deskjs=require(_0x670c('0xc'));var toCsv=require(_0x670c('0x6'));var querystring=require(_0x670c('0xd'));var Papa=require(_0x670c('0xe'));var Redis=require(_0x670c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x670c('0x10'));var as=require(_0x670c('0x11'));var hardwareService=require(_0x670c('0x12'));var logger=require('../../config/logger')(_0x670c('0x13'));var utils=require('../../config/utils');var config=require(_0x670c('0x14'));var licenseUtil=require(_0x670c('0x15'));var db=require(_0x670c('0x16'))['db'];function respondWithStatusCode(_0x54c093,_0x7fdfda){_0x7fdfda=_0x7fdfda||0xcc;return function(_0x2b80a2){if(_0x2b80a2){return _0x54c093['sendStatus'](_0x7fdfda);}return _0x54c093['status'](_0x7fdfda)[_0x670c('0x17')]();};}function respondWithResult(_0x365b06,_0x177990){_0x177990=_0x177990||0xc8;return function(_0x54e01b){if(_0x54e01b){return _0x365b06[_0x670c('0x18')](_0x177990)[_0x670c('0x19')](_0x54e01b);}};}function respondWithFilteredResult(_0x4461b7,_0x302168){return function(_0x137260){if(_0x137260){var _0x1debb1=typeof _0x302168['offset']===_0x670c('0x1a')&&typeof _0x302168[_0x670c('0x1b')]==='undefined';var _0x43dc34=_0x137260[_0x670c('0x1c')];var _0x3183c9=_0x1debb1?0x0:_0x302168['offset'];var _0x4d511b=_0x1debb1?_0x137260['count']:_0x302168['offset']+_0x302168[_0x670c('0x1b')];var _0x588ba3;if(_0x4d511b>=_0x43dc34){_0x4d511b=_0x43dc34;_0x588ba3=0xc8;}else{_0x588ba3=0xce;}_0x4461b7[_0x670c('0x18')](_0x588ba3);return _0x4461b7[_0x670c('0x1d')](_0x670c('0x1e'),_0x3183c9+'-'+_0x4d511b+'/'+_0x43dc34)[_0x670c('0x19')](_0x137260);}return null;};}function patchUpdates(_0x42af5b){return function(_0x27c98a){try{jsonpatch[_0x670c('0x1f')](_0x27c98a,_0x42af5b,!![]);}catch(_0x16f9c9){return BPromise['reject'](_0x16f9c9);}return _0x27c98a[_0x670c('0x20')]();};}function saveUpdates(_0x44e700,_0x1221fe){return function(_0x404550){if(_0x404550){return _0x404550[_0x670c('0x21')](_0x44e700)['then'](function(_0x5e3937){return _0x5e3937;});}return null;};}function removeEntity(_0x39ecc8,_0x54fff1){return function(_0x365744){if(_0x365744){return _0x365744[_0x670c('0x22')]()['then'](function(){_0x39ecc8[_0x670c('0x18')](0xcc)[_0x670c('0x17')]();});}};}function handleEntityNotFound(_0x48fe5a,_0x2a3dba){return function(_0x1f8598){if(!_0x1f8598){_0x48fe5a[_0x670c('0x23')](0x194);}return _0x1f8598;};}function handleError(_0x19c15e,_0x53d1e1){_0x53d1e1=_0x53d1e1||0x1f4;return function(_0x1d1a90){logger[_0x670c('0x24')](_0x1d1a90[_0x670c('0x25')]);if(_0x1d1a90[_0x670c('0x26')]){delete _0x1d1a90[_0x670c('0x26')];}_0x19c15e[_0x670c('0x18')](_0x53d1e1)['send'](_0x1d1a90);};}exports['index']=function(_0x10d591,_0x15f2e6){var _0x38d981={},_0x50f4f2={},_0xb41b8a={'count':0x0,'rows':[]};var _0x210a40=_['map'](db['VoiceDialReport'][_0x670c('0x27')],function(_0x388a98){return{'name':_0x388a98[_0x670c('0x28')],'type':_0x388a98[_0x670c('0x29')]['key']};});_0x50f4f2['model']=_[_0x670c('0x2a')](_0x210a40,'name');_0x50f4f2[_0x670c('0x2b')]=_['keys'](_0x10d591[_0x670c('0x2b')]);_0x50f4f2[_0x670c('0x2c')]=_[_0x670c('0x2d')](_0x50f4f2[_0x670c('0x2e')],_0x50f4f2['query']);_0x38d981[_0x670c('0x2f')]=_['intersection'](_0x50f4f2['model'],qs[_0x670c('0x30')](_0x10d591[_0x670c('0x2b')]['fields']));_0x38d981[_0x670c('0x2f')]=_0x38d981[_0x670c('0x2f')][_0x670c('0x31')]?_0x38d981[_0x670c('0x2f')]:_0x50f4f2['model'];if(!_0x10d591[_0x670c('0x2b')][_0x670c('0x32')]('nolimit')){_0x38d981[_0x670c('0x1b')]=qs[_0x670c('0x1b')](_0x10d591[_0x670c('0x2b')][_0x670c('0x1b')]);_0x38d981['offset']=qs['offset'](_0x10d591[_0x670c('0x2b')]['offset']);}_0x38d981[_0x670c('0x33')]=qs[_0x670c('0x34')](_0x10d591[_0x670c('0x2b')]['sort']);_0x38d981['where']=qs[_0x670c('0x2c')](_[_0x670c('0x35')](_0x10d591[_0x670c('0x2b')],_0x50f4f2[_0x670c('0x2c')]),_0x210a40);if(_0x10d591[_0x670c('0x2b')][_0x670c('0x36')]){_0x38d981[_0x670c('0x37')]=_['merge'](_0x38d981[_0x670c('0x37')],{'$or':_[_0x670c('0x2a')](_0x210a40,function(_0x1ac80c){if(_0x1ac80c[_0x670c('0x29')]!==_0x670c('0x38')){var _0x1c37d4={};_0x1c37d4[_0x1ac80c[_0x670c('0x26')]]={'$like':'%'+_0x10d591[_0x670c('0x2b')][_0x670c('0x36')]+'%'};return _0x1c37d4;}})});}_0x38d981=_[_0x670c('0x39')]({},_0x38d981,_0x10d591[_0x670c('0x3a')]);var _0x2b6ee2={'where':_0x38d981[_0x670c('0x37')]};return db['VoiceDialReport'][_0x670c('0x1c')](_0x2b6ee2)[_0x670c('0x3b')](function(_0x4d49c0){_0xb41b8a[_0x670c('0x1c')]=_0x4d49c0;if(_0x10d591[_0x670c('0x2b')]['includeAll']){_0x38d981[_0x670c('0x3c')]=[{'all':!![]}];}return db[_0x670c('0x3d')][_0x670c('0x3e')](_0x38d981);})[_0x670c('0x3b')](function(_0x38c44b){_0xb41b8a[_0x670c('0x3f')]=_0x38c44b;return _0xb41b8a;})['then'](respondWithFilteredResult(_0x15f2e6,_0x38d981))[_0x670c('0x40')](handleError(_0x15f2e6,null));};exports[_0x670c('0x41')]=function(_0x5ba42b,_0x25f624){var _0x312295={'raw':!![],'where':{'id':_0x5ba42b[_0x670c('0x42')]['id']}},_0x6acb87={};_0x6acb87[_0x670c('0x2e')]=_[_0x670c('0x43')](db['VoiceDialReport'][_0x670c('0x27')]);_0x6acb87[_0x670c('0x2b')]=_[_0x670c('0x43')](_0x5ba42b[_0x670c('0x2b')]);_0x6acb87[_0x670c('0x2c')]=_[_0x670c('0x2d')](_0x6acb87[_0x670c('0x2e')],_0x6acb87[_0x670c('0x2b')]);_0x312295[_0x670c('0x2f')]=_['intersection'](_0x6acb87[_0x670c('0x2e')],qs['fields'](_0x5ba42b[_0x670c('0x2b')][_0x670c('0x30')]));_0x312295[_0x670c('0x2f')]=_0x312295['attributes'][_0x670c('0x31')]?_0x312295[_0x670c('0x2f')]:_0x6acb87['model'];if(_0x5ba42b[_0x670c('0x2b')][_0x670c('0x44')]){_0x312295[_0x670c('0x3c')]=[{'all':!![]}];}_0x312295=_[_0x670c('0x39')]({},_0x312295,_0x5ba42b['options']);return db[_0x670c('0x3d')]['find'](_0x312295)[_0x670c('0x3b')](handleEntityNotFound(_0x25f624,null))[_0x670c('0x3b')](respondWithResult(_0x25f624,null))['catch'](handleError(_0x25f624,null));};exports[_0x670c('0x45')]=function(_0x515371,_0x8e22c6){return db[_0x670c('0x3d')][_0x670c('0x45')](_0x515371[_0x670c('0x46')],{})['then'](respondWithResult(_0x8e22c6,0xc9))[_0x670c('0x40')](handleError(_0x8e22c6,null));};exports[_0x670c('0x21')]=function(_0x168881,_0x562dec){if(_0x168881[_0x670c('0x46')]['id']){delete _0x168881[_0x670c('0x46')]['id'];}return db['VoiceDialReport'][_0x670c('0x47')]({'where':{'id':_0x168881[_0x670c('0x42')]['id']}})[_0x670c('0x3b')](handleEntityNotFound(_0x562dec,null))['then'](saveUpdates(_0x168881[_0x670c('0x46')],null))[_0x670c('0x3b')](respondWithResult(_0x562dec,null))[_0x670c('0x40')](handleError(_0x562dec,null));};exports['destroy']=function(_0x26d865,_0x191419){return db['VoiceDialReport']['find']({'where':{'id':_0x26d865[_0x670c('0x42')]['id']}})['then'](handleEntityNotFound(_0x191419,null))[_0x670c('0x3b')](removeEntity(_0x191419,null))[_0x670c('0x40')](handleError(_0x191419,null));};exports[_0x670c('0x48')]=function(_0x325931,_0x4ca5d8){return db[_0x670c('0x3d')][_0x670c('0x48')]()[_0x670c('0x3b')](respondWithResult(_0x4ca5d8,null))[_0x670c('0x40')](handleError(_0x4ca5d8,null));}; \ No newline at end of file +var _0x33d1=['fast-json-patch','request-promise','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','show','keys','length','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir'];(function(_0x2c81dc,_0x23ff18){var _0x2fcb21=function(_0x1e0fdb){while(--_0x1e0fdb){_0x2c81dc['push'](_0x2c81dc['shift']());}};_0x2fcb21(++_0x23ff18);}(_0x33d1,0x1cb));var _0x133d=function(_0x14d5c4,_0x53a9b4){_0x14d5c4=_0x14d5c4-0x0;var _0xf54981=_0x33d1[_0x14d5c4];return _0xf54981;};'use strict';var emlformat=require(_0x133d('0x0'));var rimraf=require(_0x133d('0x1'));var zipdir=require(_0x133d('0x2'));var jsonpatch=require(_0x133d('0x3'));var rp=require(_0x133d('0x4'));var moment=require(_0x133d('0x5'));var BPromise=require(_0x133d('0x6'));var Mustache=require(_0x133d('0x7'));var util=require('util');var path=require('path');var sox=require(_0x133d('0x8'));var csv=require(_0x133d('0x9'));var ejs=require(_0x133d('0xa'));var fs=require('fs');var fs_extra=require(_0x133d('0xb'));var _=require(_0x133d('0xc'));var squel=require(_0x133d('0xd'));var crypto=require(_0x133d('0xe'));var jsforce=require(_0x133d('0xf'));var deskjs=require(_0x133d('0x10'));var toCsv=require(_0x133d('0x9'));var querystring=require(_0x133d('0x11'));var Papa=require(_0x133d('0x12'));var Redis=require('ioredis');var authService=require(_0x133d('0x13'));var qs=require(_0x133d('0x14'));var as=require(_0x133d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x133d('0x16'))(_0x133d('0x17'));var utils=require(_0x133d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x133d('0x19'));var db=require(_0x133d('0x1a'))['db'];function respondWithStatusCode(_0x205fd9,_0x3059fe){_0x3059fe=_0x3059fe||0xcc;return function(_0x4730d3){if(_0x4730d3){return _0x205fd9[_0x133d('0x1b')](_0x3059fe);}return _0x205fd9['status'](_0x3059fe)['end']();};}function respondWithResult(_0xac19e7,_0x184f26){_0x184f26=_0x184f26||0xc8;return function(_0xe30f1){if(_0xe30f1){return _0xac19e7[_0x133d('0x1c')](_0x184f26)[_0x133d('0x1d')](_0xe30f1);}};}function respondWithFilteredResult(_0x23257e,_0x242c5d){return function(_0x274a22){if(_0x274a22){var _0x66b870=typeof _0x242c5d[_0x133d('0x1e')]==='undefined'&&typeof _0x242c5d[_0x133d('0x1f')]===_0x133d('0x20');var _0xb202f4=_0x274a22[_0x133d('0x21')];var _0x3df5dc=_0x66b870?0x0:_0x242c5d[_0x133d('0x1e')];var _0x6381f5=_0x66b870?_0x274a22[_0x133d('0x21')]:_0x242c5d[_0x133d('0x1e')]+_0x242c5d['limit'];var _0x33953c;if(_0x6381f5>=_0xb202f4){_0x6381f5=_0xb202f4;_0x33953c=0xc8;}else{_0x33953c=0xce;}_0x23257e['status'](_0x33953c);return _0x23257e[_0x133d('0x22')](_0x133d('0x23'),_0x3df5dc+'-'+_0x6381f5+'/'+_0xb202f4)[_0x133d('0x1d')](_0x274a22);}return null;};}function patchUpdates(_0x50f8ae){return function(_0x122634){try{jsonpatch['apply'](_0x122634,_0x50f8ae,!![]);}catch(_0x34effa){return BPromise[_0x133d('0x24')](_0x34effa);}return _0x122634['save']();};}function saveUpdates(_0x4161e1,_0x44a80b){return function(_0x244266){if(_0x244266){return _0x244266[_0x133d('0x25')](_0x4161e1)[_0x133d('0x26')](function(_0x1b960b){return _0x1b960b;});}return null;};}function removeEntity(_0x371fd7,_0x4faa44){return function(_0x256e34){if(_0x256e34){return _0x256e34[_0x133d('0x27')]()[_0x133d('0x26')](function(){_0x371fd7['status'](0xcc)[_0x133d('0x28')]();});}};}function handleEntityNotFound(_0x161ca5,_0x37f7c9){return function(_0x4638f0){if(!_0x4638f0){_0x161ca5[_0x133d('0x1b')](0x194);}return _0x4638f0;};}function handleError(_0xc9cdbb,_0x2522d3){_0x2522d3=_0x2522d3||0x1f4;return function(_0x4c9007){logger[_0x133d('0x29')](_0x4c9007[_0x133d('0x2a')]);if(_0x4c9007[_0x133d('0x2b')]){delete _0x4c9007[_0x133d('0x2b')];}_0xc9cdbb[_0x133d('0x1c')](_0x2522d3)[_0x133d('0x2c')](_0x4c9007);};}exports[_0x133d('0x2d')]=function(_0x4eb30b,_0x3d642a){var _0xa78bbb={},_0x19a7e2={},_0x3f1fba={'count':0x0,'rows':[]};var _0x479324=_[_0x133d('0x2e')](db[_0x133d('0x2f')][_0x133d('0x30')],function(_0x7747e9){return{'name':_0x7747e9[_0x133d('0x31')],'type':_0x7747e9[_0x133d('0x32')][_0x133d('0x33')]};});_0x19a7e2[_0x133d('0x34')]=_['map'](_0x479324,_0x133d('0x2b'));_0x19a7e2[_0x133d('0x35')]=_['keys'](_0x4eb30b[_0x133d('0x35')]);_0x19a7e2[_0x133d('0x36')]=_[_0x133d('0x37')](_0x19a7e2[_0x133d('0x34')],_0x19a7e2['query']);_0xa78bbb[_0x133d('0x38')]=_[_0x133d('0x37')](_0x19a7e2['model'],qs['fields'](_0x4eb30b[_0x133d('0x35')][_0x133d('0x39')]));_0xa78bbb['attributes']=_0xa78bbb[_0x133d('0x38')]['length']?_0xa78bbb[_0x133d('0x38')]:_0x19a7e2[_0x133d('0x34')];if(!_0x4eb30b['query']['hasOwnProperty'](_0x133d('0x3a'))){_0xa78bbb[_0x133d('0x1f')]=qs['limit'](_0x4eb30b[_0x133d('0x35')][_0x133d('0x1f')]);_0xa78bbb[_0x133d('0x1e')]=qs[_0x133d('0x1e')](_0x4eb30b['query']['offset']);}_0xa78bbb['order']=qs[_0x133d('0x3b')](_0x4eb30b[_0x133d('0x35')][_0x133d('0x3b')]);_0xa78bbb['where']=qs['filters'](_[_0x133d('0x3c')](_0x4eb30b['query'],_0x19a7e2[_0x133d('0x36')]),_0x479324);if(_0x4eb30b['query'][_0x133d('0x3d')]){_0xa78bbb[_0x133d('0x3e')]=_[_0x133d('0x3f')](_0xa78bbb[_0x133d('0x3e')],{'$or':_[_0x133d('0x2e')](_0x479324,function(_0x5d98b5){if(_0x5d98b5[_0x133d('0x32')]!==_0x133d('0x40')){var _0x121816={};_0x121816[_0x5d98b5[_0x133d('0x2b')]]={'$like':'%'+_0x4eb30b[_0x133d('0x35')]['filter']+'%'};return _0x121816;}})});}_0xa78bbb=_[_0x133d('0x3f')]({},_0xa78bbb,_0x4eb30b['options']);var _0x18c4b2={'where':_0xa78bbb[_0x133d('0x3e')]};return db[_0x133d('0x2f')][_0x133d('0x21')](_0x18c4b2)[_0x133d('0x26')](function(_0x3bac98){_0x3f1fba[_0x133d('0x21')]=_0x3bac98;if(_0x4eb30b[_0x133d('0x35')][_0x133d('0x41')]){_0xa78bbb[_0x133d('0x42')]=[{'all':!![]}];}return db[_0x133d('0x2f')]['findAll'](_0xa78bbb);})['then'](function(_0x412399){_0x3f1fba['rows']=_0x412399;return _0x3f1fba;})[_0x133d('0x26')](respondWithFilteredResult(_0x3d642a,_0xa78bbb))['catch'](handleError(_0x3d642a,null));};exports[_0x133d('0x43')]=function(_0x181d69,_0x5c2400){var _0x28c9e8={'raw':!![],'where':{'id':_0x181d69['params']['id']}},_0x1dd5bc={};_0x1dd5bc[_0x133d('0x34')]=_[_0x133d('0x44')](db['VoiceDialReport']['rawAttributes']);_0x1dd5bc['query']=_[_0x133d('0x44')](_0x181d69[_0x133d('0x35')]);_0x1dd5bc[_0x133d('0x36')]=_['intersection'](_0x1dd5bc[_0x133d('0x34')],_0x1dd5bc[_0x133d('0x35')]);_0x28c9e8['attributes']=_[_0x133d('0x37')](_0x1dd5bc[_0x133d('0x34')],qs['fields'](_0x181d69['query'][_0x133d('0x39')]));_0x28c9e8[_0x133d('0x38')]=_0x28c9e8[_0x133d('0x38')][_0x133d('0x45')]?_0x28c9e8[_0x133d('0x38')]:_0x1dd5bc[_0x133d('0x34')];if(_0x181d69[_0x133d('0x35')]['includeAll']){_0x28c9e8[_0x133d('0x42')]=[{'all':!![]}];}_0x28c9e8=_[_0x133d('0x3f')]({},_0x28c9e8,_0x181d69[_0x133d('0x46')]);return db['VoiceDialReport'][_0x133d('0x47')](_0x28c9e8)['then'](handleEntityNotFound(_0x5c2400,null))[_0x133d('0x26')](respondWithResult(_0x5c2400,null))[_0x133d('0x48')](handleError(_0x5c2400,null));};exports['create']=function(_0x23c79f,_0xc524c2){return db['VoiceDialReport'][_0x133d('0x49')](_0x23c79f[_0x133d('0x4a')],{})[_0x133d('0x26')](respondWithResult(_0xc524c2,0xc9))[_0x133d('0x48')](handleError(_0xc524c2,null));};exports['update']=function(_0x170220,_0x413cbe){if(_0x170220['body']['id']){delete _0x170220[_0x133d('0x4a')]['id'];}return db[_0x133d('0x2f')][_0x133d('0x47')]({'where':{'id':_0x170220[_0x133d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x413cbe,null))['then'](saveUpdates(_0x170220[_0x133d('0x4a')],null))[_0x133d('0x26')](respondWithResult(_0x413cbe,null))['catch'](handleError(_0x413cbe,null));};exports[_0x133d('0x27')]=function(_0xc2e78d,_0x1263e2){return db[_0x133d('0x2f')]['find']({'where':{'id':_0xc2e78d[_0x133d('0x4b')]['id']}})[_0x133d('0x26')](handleEntityNotFound(_0x1263e2,null))['then'](removeEntity(_0x1263e2,null))[_0x133d('0x48')](handleError(_0x1263e2,null));};exports[_0x133d('0x4c')]=function(_0x12b57d,_0x518bbc){return db[_0x133d('0x2f')][_0x133d('0x4c')]()[_0x133d('0x26')](respondWithResult(_0x518bbc,null))[_0x133d('0x48')](handleError(_0x518bbc,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 43da2b2..ff936d0 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 _0x9688=['VoiceDialReport','report_dial','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x25ced1,_0x5402a3){var _0xf76b31=function(_0x4587c4){while(--_0x4587c4){_0x25ced1['push'](_0x25ced1['shift']());}};_0xf76b31(++_0x5402a3);}(_0x9688,0xce));var _0x8968=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x9688[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var util=require(_0x8968('0x0'));var logger=require(_0x8968('0x1'))(_0x8968('0x2'));var moment=require(_0x8968('0x3'));var BPromise=require(_0x8968('0x4'));var rp=require(_0x8968('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8968('0x6'));var config=require(_0x8968('0x7'));var attributes=require(_0x8968('0x8'));module[_0x8968('0x9')]=function(_0x223495,_0x523c81){return _0x223495['define'](_0x8968('0xa'),attributes,{'tableName':_0x8968('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2600=['define','VoiceDialReport','report_dial','uniqueid','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x14e52e,_0x1a8d5a){var _0x45bdc1=function(_0x46d34a){while(--_0x46d34a){_0x14e52e['push'](_0x14e52e['shift']());}};_0x45bdc1(++_0x1a8d5a);}(_0x2600,0x64));var _0x0260=function(_0x438e12,_0x4995e5){_0x438e12=_0x438e12-0x0;var _0x341a23=_0x2600[_0x438e12];return _0x341a23;};'use strict';var _=require('lodash');var util=require(_0x0260('0x0'));var logger=require(_0x0260('0x1'))('api');var moment=require(_0x0260('0x2'));var BPromise=require(_0x0260('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0260('0x4'));var rimraf=require(_0x0260('0x5'));var config=require(_0x0260('0x6'));var attributes=require(_0x0260('0x7'));module['exports']=function(_0xdaed84,_0x1670f1){return _0xdaed84[_0x0260('0x8')](_0x0260('0x9'),attributes,{'tableName':_0x0260('0xa'),'paranoid':![],'indexes':[{'fields':[_0x0260('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 55d91eb..d9920ec 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 _0x975f=['debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0xebf984,_0x814fdf){var _0x59d6c9=function(_0x274ddb){while(--_0x274ddb){_0xebf984['push'](_0xebf984['shift']());}};_0x59d6c9(++_0x814fdf);}(_0x975f,0x17d));var _0xf975=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x975f[_0x56daff];return _0x132c82;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var moment=require('moment');var BPromise=require(_0xf975('0x2'));var rs=require(_0xf975('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf975('0x4'))['db'];var utils=require(_0xf975('0x5'));var logger=require(_0xf975('0x6'))(_0xf975('0x7'));var config=require(_0xf975('0x8'));var jayson=require(_0xf975('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x265c9a,_0x2ae97f,_0xaf41f3){return new BPromise(function(_0x58f07a,_0x245891){return client[_0xf975('0xa')](_0x265c9a,_0xaf41f3)[_0xf975('0xb')](function(_0x566d5e){logger[_0xf975('0xc')](_0xf975('0xd'),_0x2ae97f,_0xf975('0xe'));logger[_0xf975('0xf')](_0xf975('0x10'),_0x2ae97f,_0xf975('0xe'),JSON[_0xf975('0x11')](_0x566d5e));if(_0x566d5e[_0xf975('0x12')]){if(_0x566d5e[_0xf975('0x12')][_0xf975('0x13')]===0x1f4){logger[_0xf975('0x12')](_0xf975('0xd'),_0x2ae97f,_0x566d5e['error']['message']);return _0x245891(_0x566d5e[_0xf975('0x12')][_0xf975('0x14')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2ae97f,_0x566d5e[_0xf975('0x12')][_0xf975('0x14')]);return _0x58f07a(_0x566d5e['error']['message']);}else{logger[_0xf975('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x2ae97f,_0xf975('0xe'));_0x58f07a(_0x566d5e['result']['message']);}})[_0xf975('0x15')](function(_0x5d0869){logger[_0xf975('0x12')](_0xf975('0xd'),_0x2ae97f,_0x5d0869);_0x245891(_0x5d0869);});});}exports[_0xf975('0x16')]=function(_0x3ea471){var _0x27a858=this;return new Promise(function(_0x415e3f,_0x17c747){return db[_0xf975('0x17')][_0xf975('0x18')](_0x3ea471[_0xf975('0x19')],{'raw':_0x3ea471[_0xf975('0x1a')]?_0x3ea471[_0xf975('0x1a')][_0xf975('0x1b')]===undefined?!![]:![]:!![]})[_0xf975('0xb')](function(_0x343774){logger[_0xf975('0xc')](_0xf975('0x16'),_0x3ea471);logger[_0xf975('0xf')](_0xf975('0x16'),_0x3ea471,JSON[_0xf975('0x11')](_0x343774));_0x415e3f(_0x343774);})[_0xf975('0x15')](function(_0x4aed5f){logger[_0xf975('0x12')](_0xf975('0x16'),_0x4aed5f['message'],_0x3ea471);_0x17c747(_0x27a858[_0xf975('0x12')](0x1f4,_0x4aed5f[_0xf975('0x14')]));});});};exports[_0xf975('0x1c')]=function(_0x3e7000){var _0x24aa3f=this;return new Promise(function(_0x1c1a54,_0x2e1267){return db[_0xf975('0x17')][_0xf975('0x1d')](_0x3e7000[_0xf975('0x19')],{'raw':_0x3e7000[_0xf975('0x1a')]?_0x3e7000[_0xf975('0x1a')][_0xf975('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7000[_0xf975('0x1a')]?_0x3e7000[_0xf975('0x1a')][_0xf975('0x1e')]||null:null,'attributes':_0x3e7000[_0xf975('0x1a')]?_0x3e7000['options'][_0xf975('0x1f')]||null:null,'limit':_0x3e7000[_0xf975('0x1a')]?_0x3e7000[_0xf975('0x1a')][_0xf975('0x20')]||null:null})['then'](function(_0x36d775){logger[_0xf975('0xc')](_0xf975('0x1c'),_0x3e7000);logger[_0xf975('0xf')](_0xf975('0x1c'),_0x3e7000,JSON[_0xf975('0x11')](_0x36d775));_0x1c1a54(_0x36d775);})[_0xf975('0x15')](function(_0x1d21e2){logger['error'](_0xf975('0x1c'),_0x1d21e2[_0xf975('0x14')],_0x3e7000);_0x2e1267(_0x24aa3f[_0xf975('0x12')](0x1f4,_0x1d21e2[_0xf975('0x14')]));});});}; \ No newline at end of file +var _0x7b7e=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','raw','update','body','where','attributes','limit','UpdateVoiceDialReport','moment','randomstring'];(function(_0x5503e3,_0xd05730){var _0x3d5d22=function(_0x17d50b){while(--_0x17d50b){_0x5503e3['push'](_0x5503e3['shift']());}};_0x3d5d22(++_0xd05730);}(_0x7b7e,0x15a));var _0xe7b7=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x7b7e[_0x8e9386];return _0x4abf26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7b7('0x0'));var BPromise=require('bluebird');var rs=require(_0xe7b7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7b7('0x2'))['db'];var utils=require(_0xe7b7('0x3'));var logger=require(_0xe7b7('0x4'))('rpc');var config=require(_0xe7b7('0x5'));var jayson=require(_0xe7b7('0x6'));var client=jayson[_0xe7b7('0x7')][_0xe7b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bbde0,_0x16cdab,_0x18adf6){return new BPromise(function(_0x10bbe5,_0x26515b){return client['request'](_0x2bbde0,_0x18adf6)[_0xe7b7('0x9')](function(_0x555d1a){logger[_0xe7b7('0xa')](_0xe7b7('0xb'),_0x16cdab,'request\x20sent');logger[_0xe7b7('0xc')](_0xe7b7('0xd'),_0x16cdab,_0xe7b7('0xe'),JSON['stringify'](_0x555d1a));if(_0x555d1a[_0xe7b7('0xf')]){if(_0x555d1a[_0xe7b7('0xf')]['code']===0x1f4){logger['error'](_0xe7b7('0xb'),_0x16cdab,_0x555d1a[_0xe7b7('0xf')][_0xe7b7('0x10')]);return _0x26515b(_0x555d1a['error']['message']);}logger[_0xe7b7('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x16cdab,_0x555d1a[_0xe7b7('0xf')]['message']);return _0x10bbe5(_0x555d1a[_0xe7b7('0xf')][_0xe7b7('0x10')]);}else{logger[_0xe7b7('0xa')](_0xe7b7('0xb'),_0x16cdab,_0xe7b7('0xe'));_0x10bbe5(_0x555d1a[_0xe7b7('0x11')][_0xe7b7('0x10')]);}})[_0xe7b7('0x12')](function(_0x1250ab){logger[_0xe7b7('0xf')](_0xe7b7('0xb'),_0x16cdab,_0x1250ab);_0x26515b(_0x1250ab);});});}exports[_0xe7b7('0x13')]=function(_0x5b58da){var _0x148d9a=this;return new Promise(function(_0x17ce54,_0xd3fe4b){return db[_0xe7b7('0x14')]['create'](_0x5b58da['body'],{'raw':_0x5b58da[_0xe7b7('0x15')]?_0x5b58da[_0xe7b7('0x15')][_0xe7b7('0x16')]===undefined?!![]:![]:!![]})[_0xe7b7('0x9')](function(_0x4d7141){logger[_0xe7b7('0xa')](_0xe7b7('0x13'),_0x5b58da);logger[_0xe7b7('0xc')]('CreateVoiceDialReport',_0x5b58da,JSON['stringify'](_0x4d7141));_0x17ce54(_0x4d7141);})[_0xe7b7('0x12')](function(_0x5f58a8){logger[_0xe7b7('0xf')](_0xe7b7('0x13'),_0x5f58a8[_0xe7b7('0x10')],_0x5b58da);_0xd3fe4b(_0x148d9a[_0xe7b7('0xf')](0x1f4,_0x5f58a8[_0xe7b7('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x5179ae){var _0x28b801=this;return new Promise(function(_0x4dc7e6,_0x501289){return db['VoiceDialReport'][_0xe7b7('0x17')](_0x5179ae[_0xe7b7('0x18')],{'raw':_0x5179ae['options']?_0x5179ae['options'][_0xe7b7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5179ae[_0xe7b7('0x15')]?_0x5179ae[_0xe7b7('0x15')][_0xe7b7('0x19')]||null:null,'attributes':_0x5179ae[_0xe7b7('0x15')]?_0x5179ae[_0xe7b7('0x15')][_0xe7b7('0x1a')]||null:null,'limit':_0x5179ae[_0xe7b7('0x15')]?_0x5179ae[_0xe7b7('0x15')][_0xe7b7('0x1b')]||null:null})['then'](function(_0x4f6504){logger[_0xe7b7('0xa')](_0xe7b7('0x1c'),_0x5179ae);logger['debug']('UpdateVoiceDialReport',_0x5179ae,JSON['stringify'](_0x4f6504));_0x4dc7e6(_0x4f6504);})['catch'](function(_0x8c2be3){logger['error']('UpdateVoiceDialReport',_0x8c2be3[_0xe7b7('0x10')],_0x5179ae);_0x501289(_0x28b801[_0xe7b7('0xf')](0x1f4,_0x8c2be3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 75bc040..6db04f0 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 _0x70a6=['get','isAuthenticated','/:id','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller'];(function(_0x3e6647,_0x2c0d09){var _0x46bddd=function(_0xad96c0){while(--_0xad96c0){_0x3e6647['push'](_0x3e6647['shift']());}};_0x46bddd(++_0x2c0d09);}(_0x70a6,0x1c5));var _0x670a=function(_0x1b0070,_0x290498){_0x1b0070=_0x1b0070-0x0;var _0x564f02=_0x70a6[_0x1b0070];return _0x564f02;};'use strict';var multer=require(_0x670a('0x0'));var util=require(_0x670a('0x1'));var path=require(_0x670a('0x2'));var timeout=require(_0x670a('0x3'));var express=require('express');var router=express[_0x670a('0x4')]();var fs_extra=require(_0x670a('0x5'));var auth=require(_0x670a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x670a('0x7'));var controller=require(_0x670a('0x8'));router[_0x670a('0x9')]('/',auth[_0x670a('0xa')](),controller['index']);router[_0x670a('0x9')](_0x670a('0xb'),auth[_0x670a('0xa')](),controller[_0x670a('0xc')]);router[_0x670a('0xd')]('/',auth[_0x670a('0xa')](),controller[_0x670a('0xe')]);router['post'](_0x670a('0xf'),auth[_0x670a('0xa')](),controller[_0x670a('0x10')]);router[_0x670a('0x11')](_0x670a('0xb'),auth['isAuthenticated'](),controller[_0x670a('0x12')]);router[_0x670a('0x13')](_0x670a('0xb'),auth['isAuthenticated'](),controller[_0x670a('0x14')]);module[_0x670a('0x15')]=router; \ No newline at end of file +var _0x0636=['create','/:id/applications','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','/:id','isAuthenticated','post'];(function(_0x339540,_0x14b5b4){var _0x53096f=function(_0xff992){while(--_0xff992){_0x339540['push'](_0x339540['shift']());}};_0x53096f(++_0x14b5b4);}(_0x0636,0xa8));var _0x6063=function(_0x11c550,_0x2b5baa){_0x11c550=_0x11c550-0x0;var _0x1bbcf0=_0x0636[_0x11c550];return _0x1bbcf0;};'use strict';var multer=require(_0x6063('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6063('0x1'));var express=require(_0x6063('0x2'));var router=express[_0x6063('0x3')]();var fs_extra=require(_0x6063('0x4'));var auth=require(_0x6063('0x5'));var interaction=require(_0x6063('0x6'));var config=require('../../config/environment');var controller=require(_0x6063('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6063('0x8')](_0x6063('0x9'),auth[_0x6063('0xa')](),controller['show']);router[_0x6063('0xb')]('/',auth[_0x6063('0xa')](),controller[_0x6063('0xc')]);router[_0x6063('0xb')](_0x6063('0xd'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x6063('0x9'),auth[_0x6063('0xa')](),controller[_0x6063('0xe')]);router[_0x6063('0xf')](_0x6063('0x9'),auth[_0x6063('0xa')](),controller[_0x6063('0x10')]);module[_0x6063('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 40c6515..723c169 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 _0x066f=['outbound','internal','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x306778,_0xaa0b1b){var _0x29d88e=function(_0x2aecf6){while(--_0x2aecf6){_0x306778['push'](_0x306778['shift']());}};_0x29d88e(++_0xaa0b1b);}(_0x066f,0x8f));var _0xf066=function(_0x2d4294,_0x54a63a){_0x2d4294=_0x2d4294-0x0;var _0x4016b3=_0x066f[_0x2d4294];return _0x4016b3;};'use strict';var Sequelize=require(_0xf066('0x0'));module[_0xf066('0x1')]={'context':{'type':Sequelize[_0xf066('0x2')],'allowNull':![],'unique':_0xf066('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf066('0x2')],'allowNull':![],'unique':_0xf066('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xf066('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf066('0x2')],'allowNull':![],'defaultValue':_0xf066('0x4')},'appdata':{'type':Sequelize[_0xf066('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf066('0x5')](_0xf066('0x6'),_0xf066('0x7'),_0xf066('0x8'),_0xf066('0x9'),_0xf066('0xa'),_0xf066('0xb'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xf066('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xf066('0xc')]},'isApp':{'type':Sequelize[_0xf066('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf066('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf066('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xf066('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf066('0xc')]},'recordingFormat':{'type':Sequelize[_0xf066('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xf066('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3fa9e8){return this['getDataValue'](_0xf066('0xe'));}},'alias':{'type':Sequelize[_0xf066('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xf946=['internal','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound'];(function(_0x4c6302,_0x311370){var _0x58bc5c=function(_0x51f64d){while(--_0x51f64d){_0x4c6302['push'](_0x4c6302['shift']());}};_0x58bc5c(++_0x311370);}(_0xf946,0x191));var _0x6f94=function(_0x51125e,_0x56df44){_0x51125e=_0x51125e-0x0;var _0x39a92c=_0xf946[_0x51125e];return _0x39a92c;};'use strict';var Sequelize=require(_0x6f94('0x0'));module[_0x6f94('0x1')]={'context':{'type':Sequelize[_0x6f94('0x2')],'allowNull':![],'unique':_0x6f94('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6f94('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6f94('0x3')},'tag':{'type':Sequelize[_0x6f94('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6f94('0x2')],'allowNull':![],'defaultValue':_0x6f94('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6f94('0x5')]('inbound',_0x6f94('0x6'),_0x6f94('0x7'),'inbound-fax',_0x6f94('0x8'),_0x6f94('0x9'),_0x6f94('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f94('0xb')},'IntervalId':{'type':Sequelize[_0x6f94('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x6f94('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x6f94('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x6f94('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6f94('0xc')]},'recordingFormat':{'type':Sequelize[_0x6f94('0x2')],'defaultValue':_0x6f94('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x6f94('0xf')],'get':function(_0x339dd){return this['getDataValue'](_0x6f94('0x10'));}},'alias':{'type':Sequelize[_0x6f94('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 db165a0..3fa6602 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 _0x3892=['catch','show','params','create','body','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes','InternalRoutes','UserProfileSection','autoAssociation','context','recordingFormat','mandatoryDisposition','alias','findOne','sequelize','transaction','isApp','rewriteDial','toLowerCase','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','destroy','inbound','OutboundRoutes','outbound','filter','map','value','type','find','name','UserProfileResource','then','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3c988a,_0x33841c){var _0x7f05f7=function(_0x554131){while(--_0x554131){_0x3c988a['push'](_0x3c988a['shift']());}};_0x7f05f7(++_0x33841c);}(_0x3892,0x159));var _0x2389=function(_0x5712cc,_0x5db7dd){_0x5712cc=_0x5712cc-0x0;var _0x15561a=_0x3892[_0x5712cc];return _0x15561a;};'use strict';var emlformat=require(_0x2389('0x0'));var rimraf=require(_0x2389('0x1'));var zipdir=require(_0x2389('0x2'));var jsonpatch=require(_0x2389('0x3'));var rp=require('request-promise');var moment=require(_0x2389('0x4'));var BPromise=require(_0x2389('0x5'));var Mustache=require(_0x2389('0x6'));var util=require(_0x2389('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2389('0x8'));var ejs=require(_0x2389('0x9'));var fs=require('fs');var fs_extra=require(_0x2389('0xa'));var _=require('lodash');var squel=require(_0x2389('0xb'));var crypto=require(_0x2389('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2389('0xd'));var toCsv=require(_0x2389('0x8'));var querystring=require('querystring');var Papa=require(_0x2389('0xe'));var Redis=require(_0x2389('0xf'));var authService=require(_0x2389('0x10'));var qs=require(_0x2389('0x11'));var as=require(_0x2389('0x12'));var hardwareService=require(_0x2389('0x13'));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'];config[_0x2389('0x14')]=_[_0x2389('0x15')](config[_0x2389('0x14')],{'host':_0x2389('0x16'),'port':0x18eb});var socket=require(_0x2389('0x17'))(new Redis(config['redis']));require(_0x2389('0x18'))[_0x2389('0x19')](socket);function respondWithStatusCode(_0x1016d5,_0x43a3a0){_0x43a3a0=_0x43a3a0||0xcc;return function(_0x598769){if(_0x598769){return _0x1016d5[_0x2389('0x1a')](_0x43a3a0);}return _0x1016d5[_0x2389('0x1b')](_0x43a3a0)[_0x2389('0x1c')]();};}function respondWithResult(_0x4b394f,_0x6bde16){_0x6bde16=_0x6bde16||0xc8;return function(_0x1db7ae){if(_0x1db7ae){return _0x4b394f[_0x2389('0x1b')](_0x6bde16)['json'](_0x1db7ae);}};}function respondWithFilteredResult(_0x23dd9f,_0x2a34ec){return function(_0x55d297){if(_0x55d297){var _0x48a12e=typeof _0x2a34ec[_0x2389('0x1d')]===_0x2389('0x1e')&&typeof _0x2a34ec['limit']===_0x2389('0x1e');var _0x2fe4d7=_0x55d297[_0x2389('0x1f')];var _0x5e60af=_0x48a12e?0x0:_0x2a34ec['offset'];var _0x22af64=_0x48a12e?_0x55d297[_0x2389('0x1f')]:_0x2a34ec['offset']+_0x2a34ec[_0x2389('0x20')];var _0xb27ec6;if(_0x22af64>=_0x2fe4d7){_0x22af64=_0x2fe4d7;_0xb27ec6=0xc8;}else{_0xb27ec6=0xce;}_0x23dd9f[_0x2389('0x1b')](_0xb27ec6);return _0x23dd9f[_0x2389('0x21')](_0x2389('0x22'),_0x5e60af+'-'+_0x22af64+'/'+_0x2fe4d7)[_0x2389('0x23')](_0x55d297);}return null;};}function patchUpdates(_0xde932f){return function(_0x3b2454){try{jsonpatch['apply'](_0x3b2454,_0xde932f,!![]);}catch(_0x5a332d){return BPromise['reject'](_0x5a332d);}return _0x3b2454[_0x2389('0x24')]();};}function saveUpdates(_0x4b5dc9,_0x18b7f0){return function(_0x10338d){if(_0x10338d){return _0x10338d[_0x2389('0x25')](_0x4b5dc9)['then'](function(_0x26da87){return _0x26da87;});}return null;};}function removeEntity(_0x156938,_0x65e6ac){return function(_0x242760){if(_0x242760){return _0x242760[_0x2389('0x26')]()['then'](function(){var _0x27a4d2=_0x242760['get']({'plain':!![]});var _0x546e6b=[{'name':'InboundRoutes','value':_0x2389('0x27'),'ignore':![]},{'name':_0x2389('0x28'),'value':_0x2389('0x29'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x4ff276=_(_0x546e6b)[_0x2389('0x2a')]('ignore')[_0x2389('0x2b')]('value')[_0x2389('0x2c')]();if(_['includes'](_0x4ff276,_0x27a4d2[_0x2389('0x2d')])){return;}var _0x3a9efc=_[_0x2389('0x2e')](_0x546e6b,[_0x2389('0x2c'),_0x27a4d2['type']])[_0x2389('0x2f')];return db[_0x2389('0x30')]['destroy']({'where':{'type':_0x3a9efc,'resourceId':_0x27a4d2['id']}})[_0x2389('0x31')](function(){return _0x242760;});})[_0x2389('0x31')](function(){_0x156938[_0x2389('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2404d9,_0x1cbe20){return function(_0x1c5115){if(!_0x1c5115){_0x2404d9['sendStatus'](0x194);}return _0x1c5115;};}function handleError(_0x155f4a,_0x11d54e){_0x11d54e=_0x11d54e||0x1f4;return function(_0x1584ec){logger[_0x2389('0x32')](_0x1584ec[_0x2389('0x33')]);if(_0x1584ec[_0x2389('0x2f')]){delete _0x1584ec[_0x2389('0x2f')];}_0x155f4a[_0x2389('0x1b')](_0x11d54e)[_0x2389('0x34')](_0x1584ec);};}exports[_0x2389('0x35')]=function(_0x1f8950,_0x18659d){var _0x43a28e={},_0x283955={},_0x5507d5={'count':0x0,'rows':[]};var _0xdabda3=_[_0x2389('0x2b')](db[_0x2389('0x36')][_0x2389('0x37')],function(_0x2b9d03){return{'name':_0x2b9d03[_0x2389('0x38')],'type':_0x2b9d03[_0x2389('0x2d')][_0x2389('0x39')]};});_0x283955[_0x2389('0x3a')]=_[_0x2389('0x2b')](_0xdabda3,_0x2389('0x2f'));_0x283955['query']=_[_0x2389('0x3b')](_0x1f8950[_0x2389('0x3c')]);_0x283955['filters']=_[_0x2389('0x3d')](_0x283955[_0x2389('0x3a')],_0x283955[_0x2389('0x3c')]);_0x43a28e[_0x2389('0x3e')]=_[_0x2389('0x3d')](_0x283955[_0x2389('0x3a')],qs[_0x2389('0x3f')](_0x1f8950[_0x2389('0x3c')][_0x2389('0x3f')]));_0x43a28e[_0x2389('0x3e')]=_0x43a28e[_0x2389('0x3e')][_0x2389('0x40')]?_0x43a28e[_0x2389('0x3e')]:_0x283955[_0x2389('0x3a')];if(!_0x1f8950[_0x2389('0x3c')][_0x2389('0x41')](_0x2389('0x42'))){_0x43a28e[_0x2389('0x20')]=qs[_0x2389('0x20')](_0x1f8950[_0x2389('0x3c')][_0x2389('0x20')]);_0x43a28e[_0x2389('0x1d')]=qs['offset'](_0x1f8950[_0x2389('0x3c')][_0x2389('0x1d')]);}_0x43a28e[_0x2389('0x43')]=qs['sort'](_0x1f8950[_0x2389('0x3c')][_0x2389('0x44')]);_0x43a28e['where']=qs[_0x2389('0x45')](_[_0x2389('0x46')](_0x1f8950['query'],_0x283955[_0x2389('0x45')]),_0xdabda3);if(_0x1f8950[_0x2389('0x3c')][_0x2389('0x2a')]){_0x43a28e['where']=_[_0x2389('0x47')](_0x43a28e[_0x2389('0x48')],{'$or':_[_0x2389('0x2b')](_0xdabda3,function(_0x27799f){if(_0x27799f[_0x2389('0x2d')]!==_0x2389('0x49')){var _0x2e9767={};_0x2e9767[_0x27799f[_0x2389('0x2f')]]={'$like':'%'+_0x1f8950[_0x2389('0x3c')]['filter']+'%'};return _0x2e9767;}})});}_0x43a28e=_[_0x2389('0x47')]({},_0x43a28e,_0x1f8950[_0x2389('0x4a')]);var _0x2a4b33={'where':_0x43a28e[_0x2389('0x48')]};return db[_0x2389('0x36')]['count'](_0x2a4b33)[_0x2389('0x31')](function(_0x1ed5b7){_0x5507d5['count']=_0x1ed5b7;if(_0x1f8950[_0x2389('0x3c')][_0x2389('0x4b')]){_0x43a28e[_0x2389('0x4c')]=[{'all':!![]}];}return db[_0x2389('0x36')][_0x2389('0x4d')](_0x43a28e);})['then'](function(_0x5300bf){_0x5507d5[_0x2389('0x4e')]=_0x5300bf;return _0x5507d5;})['then'](respondWithFilteredResult(_0x18659d,_0x43a28e))[_0x2389('0x4f')](handleError(_0x18659d,null));};exports[_0x2389('0x50')]=function(_0x2f84a0,_0x41673a){var _0xdf842f={'raw':![],'where':{'id':_0x2f84a0[_0x2389('0x51')]['id']}},_0x55b44c={};_0x55b44c[_0x2389('0x3a')]=_[_0x2389('0x3b')](db[_0x2389('0x36')][_0x2389('0x37')]);_0x55b44c[_0x2389('0x3c')]=_[_0x2389('0x3b')](_0x2f84a0[_0x2389('0x3c')]);_0x55b44c[_0x2389('0x45')]=_['intersection'](_0x55b44c[_0x2389('0x3a')],_0x55b44c[_0x2389('0x3c')]);_0xdf842f['attributes']=_[_0x2389('0x3d')](_0x55b44c[_0x2389('0x3a')],qs[_0x2389('0x3f')](_0x2f84a0[_0x2389('0x3c')][_0x2389('0x3f')]));_0xdf842f[_0x2389('0x3e')]=_0xdf842f[_0x2389('0x3e')][_0x2389('0x40')]?_0xdf842f[_0x2389('0x3e')]:_0x55b44c['model'];if(_0x2f84a0[_0x2389('0x3c')][_0x2389('0x4b')]){_0xdf842f['include']=[{'all':!![]}];}_0xdf842f=_[_0x2389('0x47')]({},_0xdf842f,_0x2f84a0['options']);return db[_0x2389('0x36')][_0x2389('0x2e')](_0xdf842f)[_0x2389('0x31')](handleEntityNotFound(_0x41673a,null))['then'](respondWithResult(_0x41673a,null))[_0x2389('0x4f')](handleError(_0x41673a,null));};exports[_0x2389('0x26')]=function(_0x1f1457,_0x252a36){return db[_0x2389('0x36')][_0x2389('0x2e')]({'where':{'id':_0x1f1457['params']['id']}})[_0x2389('0x31')](handleEntityNotFound(_0x252a36,null))['then'](removeEntity(_0x252a36,null))[_0x2389('0x4f')](handleError(_0x252a36,null));};exports[_0x2389('0x52')]=function(_0x35f942,_0x48a576){if(_0x35f942[_0x2389('0x53')][_0x2389('0x2d')]===_0x2389('0x29')&&!_[_0x2389('0x54')](_0x35f942[_0x2389('0x53')][_0x2389('0x55')],'_')){_0x35f942[_0x2389('0x53')][_0x2389('0x55')]='_'[_0x2389('0x56')](_0x35f942[_0x2389('0x53')][_0x2389('0x55')]);}return db[_0x2389('0x36')][_0x2389('0x52')](_0x35f942[_0x2389('0x53')],{'raw':![]})[_0x2389('0x31')](function(_0x346585){var _0x577bfc=_0x35f942[_0x2389('0x57')][_0x2389('0x58')]({'plain':!![]});if(!_0x577bfc)throw new Error(_0x2389('0x59'));if(_0x577bfc['role']===_0x2389('0x57')){var _0x18535f=_0x346585[_0x2389('0x58')]({'plain':!![]});var _0x294a63=[{'name':_0x2389('0x5a'),'value':_0x2389('0x27')},{'name':_0x2389('0x28'),'value':_0x2389('0x29')},{'name':_0x2389('0x5b'),'value':'internal'}];var _0x3eba01=_[_0x2389('0x2e')](_0x294a63,[_0x2389('0x2c'),_0x18535f[_0x2389('0x2d')]])[_0x2389('0x2f')];return db[_0x2389('0x5c')]['find']({'where':{'name':_0x3eba01,'userProfileId':_0x577bfc['userProfileId']},'raw':!![]})[_0x2389('0x31')](function(_0xd96b8c){if(_0xd96b8c&&_0xd96b8c[_0x2389('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x18535f[_0x2389('0x2f')],'resourceId':_0x18535f['id'],'type':_0xd96b8c[_0x2389('0x2f')],'sectionId':_0xd96b8c['id']},{})['then'](function(){return _0x346585;});}else{return _0x346585;}})[_0x2389('0x4f')](function(_0x506f9c){logger[_0x2389('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x506f9c);throw _0x506f9c;});}return _0x346585;})[_0x2389('0x31')](respondWithResult(_0x48a576,0xc9))[_0x2389('0x4f')](handleError(_0x48a576,null));};exports[_0x2389('0x25')]=function(_0x22887a,_0x2436ff){if(_0x22887a[_0x2389('0x53')]['id']){delete _0x22887a[_0x2389('0x53')]['id'];}return db[_0x2389('0x36')][_0x2389('0x2e')]({'where':{'id':_0x22887a['params']['id']}})[_0x2389('0x31')](handleEntityNotFound(_0x2436ff,null))[_0x2389('0x31')](function(_0x39445e){if(_0x39445e){return db[_0x2389('0x36')]['update'](_[_0x2389('0x46')](_0x22887a[_0x2389('0x53')],[_0x2389('0x55'),_0x2389('0x5e'),'description',_0x2389('0x5f'),'cutdigits',_0x2389('0x60'),_0x2389('0x61')]),{'where':{'context':_0x39445e[_0x2389('0x5e')],'exten':_0x39445e[_0x2389('0x55')]},'individualHooks':!![]})[_0x2389('0x31')](function(_0x2ddffd){return _0x2ddffd;});}return null;})['then'](respondWithStatusCode(_0x2436ff,null))['catch'](handleError(_0x2436ff,null));};exports['addApplications']=function(_0x53dfc8,_0x3e5ba5){return db['VoiceExtension'][_0x2389('0x62')]({'where':{'id':_0x53dfc8[_0x2389('0x51')]['id']}})[_0x2389('0x31')](function(_0x2cc0de){if(_0x2cc0de){return db[_0x2389('0x63')][_0x2389('0x64')](function(_0x1d65f7){return db[_0x2389('0x36')][_0x2389('0x26')]({'where':{'VoiceExtensionId':_0x53dfc8[_0x2389('0x51')]['id']},'transaction':_0x1d65f7})[_0x2389('0x31')](function(){var _0x11241d=_[_0x2389('0x2b')](_0x53dfc8[_0x2389('0x53')],function(_0x16cde5){_0x16cde5['VoiceExtensionId']=_0x53dfc8[_0x2389('0x51')]['id'];_0x16cde5[_0x2389('0x65')]=!![];return _0x16cde5;});var _0x4169c8=_0x53dfc8[_0x2389('0x3c')][_0x2389('0x66')]&&_0x53dfc8['query'][_0x2389('0x66')][_0x2389('0x67')]()==='true'?!![]:![];return _0x2cc0de['createRouting'](_0x11241d,_0x4169c8);})[_0x2389('0x31')](function(_0x482a6d){return db[_0x2389('0x36')]['bulkCreate'](_0x482a6d,{'transaction':_0x1d65f7});});})[_0x2389('0x31')](function(){return db[_0x2389('0x36')][_0x2389('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x53dfc8[_0x2389('0x51')]['id']},'order':_0x2389('0x69')});});}})[_0x2389('0x31')](respondWithResult(_0x3e5ba5,null))[_0x2389('0x4f')](handleError(_0x3e5ba5,null));}; \ No newline at end of file +var _0x0fd1=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','includes','type','value','UserProfileResource','error','stack','name','index','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','inbound','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','addApplications','findOne','isApp','rewriteDial','toLowerCase','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x40c405,_0x273a64){var _0xbfc3a0=function(_0x19534c){while(--_0x19534c){_0x40c405['push'](_0x40c405['shift']());}};_0xbfc3a0(++_0x273a64);}(_0x0fd1,0x1a2));var _0x10fd=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0fd1[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x10fd('0x0'));var rimraf=require(_0x10fd('0x1'));var zipdir=require(_0x10fd('0x2'));var jsonpatch=require(_0x10fd('0x3'));var rp=require(_0x10fd('0x4'));var moment=require(_0x10fd('0x5'));var BPromise=require(_0x10fd('0x6'));var Mustache=require(_0x10fd('0x7'));var util=require(_0x10fd('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x10fd('0x9'));var fs=require('fs');var fs_extra=require(_0x10fd('0xa'));var _=require('lodash');var squel=require(_0x10fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x10fd('0xc'));var deskjs=require(_0x10fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x10fd('0xe'));var Papa=require(_0x10fd('0xf'));var Redis=require(_0x10fd('0x10'));var authService=require(_0x10fd('0x11'));var qs=require(_0x10fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10fd('0x13'));var logger=require(_0x10fd('0x14'))(_0x10fd('0x15'));var utils=require('../../config/utils');var config=require(_0x10fd('0x16'));var licenseUtil=require(_0x10fd('0x17'));var db=require(_0x10fd('0x18'))['db'];config[_0x10fd('0x19')]=_[_0x10fd('0x1a')](config['redis'],{'host':_0x10fd('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x10fd('0x19')]));require('./voiceExtension.socket')[_0x10fd('0x1c')](socket);function respondWithStatusCode(_0x4cf588,_0x38e921){_0x38e921=_0x38e921||0xcc;return function(_0x5dd114){if(_0x5dd114){return _0x4cf588[_0x10fd('0x1d')](_0x38e921);}return _0x4cf588[_0x10fd('0x1e')](_0x38e921)[_0x10fd('0x1f')]();};}function respondWithResult(_0xc04993,_0x2444e3){_0x2444e3=_0x2444e3||0xc8;return function(_0x27b258){if(_0x27b258){return _0xc04993[_0x10fd('0x1e')](_0x2444e3)[_0x10fd('0x20')](_0x27b258);}};}function respondWithFilteredResult(_0x25e92b,_0x200dae){return function(_0x4defa2){if(_0x4defa2){var _0x1b2673=typeof _0x200dae['offset']===_0x10fd('0x21')&&typeof _0x200dae[_0x10fd('0x22')]==='undefined';var _0x233469=_0x4defa2[_0x10fd('0x23')];var _0x2e37de=_0x1b2673?0x0:_0x200dae[_0x10fd('0x24')];var _0x337ba5=_0x1b2673?_0x4defa2[_0x10fd('0x23')]:_0x200dae[_0x10fd('0x24')]+_0x200dae[_0x10fd('0x22')];var _0x502c4c;if(_0x337ba5>=_0x233469){_0x337ba5=_0x233469;_0x502c4c=0xc8;}else{_0x502c4c=0xce;}_0x25e92b[_0x10fd('0x1e')](_0x502c4c);return _0x25e92b['set'](_0x10fd('0x25'),_0x2e37de+'-'+_0x337ba5+'/'+_0x233469)[_0x10fd('0x20')](_0x4defa2);}return null;};}function patchUpdates(_0xd709d0){return function(_0x15d34d){try{jsonpatch[_0x10fd('0x26')](_0x15d34d,_0xd709d0,!![]);}catch(_0x59b675){return BPromise['reject'](_0x59b675);}return _0x15d34d[_0x10fd('0x27')]();};}function saveUpdates(_0x24c762,_0x36dd70){return function(_0x32f260){if(_0x32f260){return _0x32f260[_0x10fd('0x28')](_0x24c762)[_0x10fd('0x29')](function(_0x52002c){return _0x52002c;});}return null;};}function removeEntity(_0x106301,_0x4ca3f5){return function(_0xa01004){if(_0xa01004){return _0xa01004[_0x10fd('0x2a')]()['then'](function(){var _0x40af79=_0xa01004['get']({'plain':!![]});var _0x57e277=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0x10fd('0x2b'),'value':_0x10fd('0x2c'),'ignore':![]},{'name':_0x10fd('0x2d'),'value':_0x10fd('0x2e'),'ignore':![]}];var _0x570e6b=_(_0x57e277)[_0x10fd('0x2f')](_0x10fd('0x30'))[_0x10fd('0x31')]('value')['value']();if(_[_0x10fd('0x32')](_0x570e6b,_0x40af79[_0x10fd('0x33')])){return;}var _0x17ae2f=_['find'](_0x57e277,[_0x10fd('0x34'),_0x40af79[_0x10fd('0x33')]])['name'];return db[_0x10fd('0x35')][_0x10fd('0x2a')]({'where':{'type':_0x17ae2f,'resourceId':_0x40af79['id']}})['then'](function(){return _0xa01004;});})[_0x10fd('0x29')](function(){_0x106301[_0x10fd('0x1e')](0xcc)[_0x10fd('0x1f')]();});}};}function handleEntityNotFound(_0x2997ba,_0x22eb17){return function(_0x2ed2c8){if(!_0x2ed2c8){_0x2997ba[_0x10fd('0x1d')](0x194);}return _0x2ed2c8;};}function handleError(_0x5a7aaf,_0x19eade){_0x19eade=_0x19eade||0x1f4;return function(_0x1362d5){logger[_0x10fd('0x36')](_0x1362d5[_0x10fd('0x37')]);if(_0x1362d5[_0x10fd('0x38')]){delete _0x1362d5[_0x10fd('0x38')];}_0x5a7aaf[_0x10fd('0x1e')](_0x19eade)['send'](_0x1362d5);};}exports[_0x10fd('0x39')]=function(_0x126223,_0x26a8db){var _0x4e68d0={},_0x328b04={},_0x1138f2={'count':0x0,'rows':[]};var _0x2d97a7=_[_0x10fd('0x31')](db[_0x10fd('0x3a')][_0x10fd('0x3b')],function(_0x27ab75){return{'name':_0x27ab75[_0x10fd('0x3c')],'type':_0x27ab75['type'][_0x10fd('0x3d')]};});_0x328b04[_0x10fd('0x3e')]=_['map'](_0x2d97a7,'name');_0x328b04['query']=_[_0x10fd('0x3f')](_0x126223[_0x10fd('0x40')]);_0x328b04['filters']=_[_0x10fd('0x41')](_0x328b04['model'],_0x328b04[_0x10fd('0x40')]);_0x4e68d0[_0x10fd('0x42')]=_[_0x10fd('0x41')](_0x328b04[_0x10fd('0x3e')],qs[_0x10fd('0x43')](_0x126223[_0x10fd('0x40')]['fields']));_0x4e68d0['attributes']=_0x4e68d0['attributes'][_0x10fd('0x44')]?_0x4e68d0[_0x10fd('0x42')]:_0x328b04[_0x10fd('0x3e')];if(!_0x126223[_0x10fd('0x40')][_0x10fd('0x45')]('nolimit')){_0x4e68d0[_0x10fd('0x22')]=qs[_0x10fd('0x22')](_0x126223[_0x10fd('0x40')][_0x10fd('0x22')]);_0x4e68d0[_0x10fd('0x24')]=qs[_0x10fd('0x24')](_0x126223[_0x10fd('0x40')][_0x10fd('0x24')]);}_0x4e68d0[_0x10fd('0x46')]=qs['sort'](_0x126223['query'][_0x10fd('0x47')]);_0x4e68d0[_0x10fd('0x48')]=qs[_0x10fd('0x49')](_[_0x10fd('0x4a')](_0x126223[_0x10fd('0x40')],_0x328b04[_0x10fd('0x49')]),_0x2d97a7);if(_0x126223[_0x10fd('0x40')][_0x10fd('0x2f')]){_0x4e68d0[_0x10fd('0x48')]=_[_0x10fd('0x4b')](_0x4e68d0[_0x10fd('0x48')],{'$or':_[_0x10fd('0x31')](_0x2d97a7,function(_0x117548){if(_0x117548[_0x10fd('0x33')]!=='VIRTUAL'){var _0x520a2f={};_0x520a2f[_0x117548[_0x10fd('0x38')]]={'$like':'%'+_0x126223[_0x10fd('0x40')]['filter']+'%'};return _0x520a2f;}})});}_0x4e68d0=_[_0x10fd('0x4b')]({},_0x4e68d0,_0x126223[_0x10fd('0x4c')]);var _0x185430={'where':_0x4e68d0['where']};return db[_0x10fd('0x3a')]['count'](_0x185430)[_0x10fd('0x29')](function(_0x10d95b){_0x1138f2[_0x10fd('0x23')]=_0x10d95b;if(_0x126223[_0x10fd('0x40')]['includeAll']){_0x4e68d0[_0x10fd('0x4d')]=[{'all':!![]}];}return db[_0x10fd('0x3a')][_0x10fd('0x4e')](_0x4e68d0);})[_0x10fd('0x29')](function(_0x46e8d8){_0x1138f2[_0x10fd('0x4f')]=_0x46e8d8;return _0x1138f2;})['then'](respondWithFilteredResult(_0x26a8db,_0x4e68d0))[_0x10fd('0x50')](handleError(_0x26a8db,null));};exports[_0x10fd('0x51')]=function(_0x240c75,_0x5dff33){var _0x26213b={'raw':![],'where':{'id':_0x240c75[_0x10fd('0x52')]['id']}},_0x279aaa={};_0x279aaa[_0x10fd('0x3e')]=_[_0x10fd('0x3f')](db['VoiceExtension'][_0x10fd('0x3b')]);_0x279aaa['query']=_[_0x10fd('0x3f')](_0x240c75[_0x10fd('0x40')]);_0x279aaa[_0x10fd('0x49')]=_['intersection'](_0x279aaa[_0x10fd('0x3e')],_0x279aaa[_0x10fd('0x40')]);_0x26213b['attributes']=_[_0x10fd('0x41')](_0x279aaa['model'],qs[_0x10fd('0x43')](_0x240c75['query']['fields']));_0x26213b[_0x10fd('0x42')]=_0x26213b[_0x10fd('0x42')][_0x10fd('0x44')]?_0x26213b[_0x10fd('0x42')]:_0x279aaa[_0x10fd('0x3e')];if(_0x240c75[_0x10fd('0x40')][_0x10fd('0x53')]){_0x26213b[_0x10fd('0x4d')]=[{'all':!![]}];}_0x26213b=_[_0x10fd('0x4b')]({},_0x26213b,_0x240c75[_0x10fd('0x4c')]);return db[_0x10fd('0x3a')]['find'](_0x26213b)['then'](handleEntityNotFound(_0x5dff33,null))[_0x10fd('0x29')](respondWithResult(_0x5dff33,null))['catch'](handleError(_0x5dff33,null));};exports['destroy']=function(_0x547869,_0x389343){return db['VoiceExtension'][_0x10fd('0x54')]({'where':{'id':_0x547869[_0x10fd('0x52')]['id']}})[_0x10fd('0x29')](handleEntityNotFound(_0x389343,null))['then'](removeEntity(_0x389343,null))[_0x10fd('0x50')](handleError(_0x389343,null));};exports['create']=function(_0x36f1e2,_0x255d3e){if(_0x36f1e2[_0x10fd('0x55')][_0x10fd('0x33')]===_0x10fd('0x2c')&&!_['startsWith'](_0x36f1e2[_0x10fd('0x55')][_0x10fd('0x56')],'_')){_0x36f1e2[_0x10fd('0x55')][_0x10fd('0x56')]='_'[_0x10fd('0x57')](_0x36f1e2[_0x10fd('0x55')][_0x10fd('0x56')]);}return db['VoiceExtension'][_0x10fd('0x58')](_0x36f1e2[_0x10fd('0x55')],{'raw':![]})[_0x10fd('0x29')](function(_0x11d95d){var _0xcdb62b=_0x36f1e2[_0x10fd('0x59')][_0x10fd('0x5a')]({'plain':!![]});if(!_0xcdb62b)throw new Error(_0x10fd('0x5b'));if(_0xcdb62b[_0x10fd('0x5c')]==='user'){var _0x5d6986=_0x11d95d[_0x10fd('0x5a')]({'plain':!![]});var _0x50901c=[{'name':_0x10fd('0x5d'),'value':_0x10fd('0x5e')},{'name':_0x10fd('0x2b'),'value':'outbound'},{'name':_0x10fd('0x2d'),'value':_0x10fd('0x2e')}];var _0x454047=_['find'](_0x50901c,[_0x10fd('0x34'),_0x5d6986[_0x10fd('0x33')]])[_0x10fd('0x38')];return db['UserProfileSection'][_0x10fd('0x54')]({'where':{'name':_0x454047,'userProfileId':_0xcdb62b[_0x10fd('0x5f')]},'raw':!![]})[_0x10fd('0x29')](function(_0x455b3e){if(_0x455b3e&&_0x455b3e[_0x10fd('0x60')]===0x0){return db[_0x10fd('0x35')]['create']({'name':_0x5d6986[_0x10fd('0x38')],'resourceId':_0x5d6986['id'],'type':_0x455b3e[_0x10fd('0x38')],'sectionId':_0x455b3e['id']},{})['then'](function(){return _0x11d95d;});}else{return _0x11d95d;}})['catch'](function(_0x4568b9){logger[_0x10fd('0x36')](_0x10fd('0x61'),_0x4568b9);throw _0x4568b9;});}return _0x11d95d;})[_0x10fd('0x29')](respondWithResult(_0x255d3e,0xc9))['catch'](handleError(_0x255d3e,null));};exports[_0x10fd('0x28')]=function(_0x255ab7,_0x149d5b){if(_0x255ab7[_0x10fd('0x55')]['id']){delete _0x255ab7[_0x10fd('0x55')]['id'];}return db[_0x10fd('0x3a')]['find']({'where':{'id':_0x255ab7[_0x10fd('0x52')]['id']}})[_0x10fd('0x29')](handleEntityNotFound(_0x149d5b,null))[_0x10fd('0x29')](function(_0x411a1e){if(_0x411a1e){return db[_0x10fd('0x3a')][_0x10fd('0x28')](_[_0x10fd('0x4a')](_0x255ab7['body'],[_0x10fd('0x56'),_0x10fd('0x62'),'description',_0x10fd('0x63'),_0x10fd('0x64'),'mandatoryDisposition','alias']),{'where':{'context':_0x411a1e[_0x10fd('0x62')],'exten':_0x411a1e[_0x10fd('0x56')]},'individualHooks':!![]})['then'](function(_0x1e90dd){return _0x1e90dd;});}return null;})[_0x10fd('0x29')](respondWithStatusCode(_0x149d5b,null))[_0x10fd('0x50')](handleError(_0x149d5b,null));};exports[_0x10fd('0x65')]=function(_0x839b31,_0x5c723d){return db[_0x10fd('0x3a')][_0x10fd('0x66')]({'where':{'id':_0x839b31[_0x10fd('0x52')]['id']}})['then'](function(_0xd6a535){if(_0xd6a535){return db['sequelize']['transaction'](function(_0x15bac7){return db[_0x10fd('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x839b31[_0x10fd('0x52')]['id']},'transaction':_0x15bac7})[_0x10fd('0x29')](function(){var _0x5a105c=_[_0x10fd('0x31')](_0x839b31[_0x10fd('0x55')],function(_0x123f82){_0x123f82['VoiceExtensionId']=_0x839b31[_0x10fd('0x52')]['id'];_0x123f82[_0x10fd('0x67')]=!![];return _0x123f82;});var _0x486d54=_0x839b31[_0x10fd('0x40')][_0x10fd('0x68')]&&_0x839b31[_0x10fd('0x40')]['rewriteDial'][_0x10fd('0x69')]()==='true'?!![]:![];return _0xd6a535[_0x10fd('0x6a')](_0x5a105c,_0x486d54);})[_0x10fd('0x29')](function(_0x1f3392){return db[_0x10fd('0x3a')][_0x10fd('0x6b')](_0x1f3392,{'transaction':_0x15bac7});});})[_0x10fd('0x29')](function(){return db[_0x10fd('0x3a')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x839b31['params']['id']},'order':_0x10fd('0x6c')});});}})[_0x10fd('0x29')](respondWithResult(_0x5c723d,null))[_0x10fd('0x50')](handleError(_0x5c723d,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 7fe0536..9e44c9f 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 _0x76b5=['hasOwnProperty','hook','exports','../../mysqldb','VoiceExtension','save','update','remove','emit'];(function(_0x5517c7,_0x4c13f9){var _0x2cdbe8=function(_0x14e96f){while(--_0x14e96f){_0x5517c7['push'](_0x5517c7['shift']());}};_0x2cdbe8(++_0x4c13f9);}(_0x76b5,0x1aa));var _0x576b=function(_0x3fd455,_0x1f7c5b){_0x3fd455=_0x3fd455-0x0;var _0x1c259f=_0x76b5[_0x3fd455];return _0x1c259f;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x576b('0x0'))['db'][_0x576b('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x576b('0x2'),'afterUpdate':_0x576b('0x3'),'afterDestroy':_0x576b('0x4')};function emitEvent(_0x4b3b82){return function(_0x540db5,_0x209869,_0xecfd73){VoiceExtensionEvents[_0x576b('0x5')](_0x4b3b82+':'+_0x540db5['id'],_0x540db5);VoiceExtensionEvents[_0x576b('0x5')](_0x4b3b82,_0x540db5);_0xecfd73(null);};}for(var e in events){if(events[_0x576b('0x6')](e)){var event=events[e];VoiceExtension[_0x576b('0x7')](e,emitEvent(event));}}module[_0x576b('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x1d31=['../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x1d31,0xe9));var _0x11d3=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x1d31[_0x24f31b];return _0x488401;};'use strict';var EventEmitter=require(_0x11d3('0x0'));var VoiceExtension=require(_0x11d3('0x1'))['db'][_0x11d3('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x11d3('0x3')](0x0);var events={'afterCreate':_0x11d3('0x4'),'afterUpdate':_0x11d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x15d5b2){return function(_0x54826b,_0x15e00b,_0x11507a){VoiceExtensionEvents['emit'](_0x15d5b2+':'+_0x54826b['id'],_0x54826b);VoiceExtensionEvents[_0x11d3('0x6')](_0x15d5b2,_0x54826b);_0x11507a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x11d3('0x7')](e,emitEvent(event));}}module[_0x11d3('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 076cdc8..6ac6244 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 _0x792d=['${EXTEN:','cutdigits','${EXTEN}','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url','split','length','name','trunk','phone','prefix','param','join','indexOf','replace','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','hasOwnProperty','tag','toLowerCase','CDR(tag)=','ExecIf','callerID','answer','playback','includes','app','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','Hangup','util','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','NoOp','outbound','CDR(destination)='];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x792d,0xcf));var _0xd792=function(_0x7a07fb,_0x149b98){_0x7a07fb=_0x7a07fb-0x0;var _0x16bb3d=_0x792d[_0x7a07fb];return _0x16bb3d;};'use strict';var util=require(_0xd792('0x0'));var _=require('lodash');var attributes=require(_0xd792('0x1'));module[_0xd792('0x2')]=function(_0x8bd3d3){var _0x547924=_0x8bd3d3[_0xd792('0x3')];function _0x219244(_0x5d216c){var _0x342794=0x2;var _0x52f848=[{'type':_0x5d216c[_0xd792('0x4')],'app':_0xd792('0x5'),'appdata':_0xd792('0x6')+_0x5d216c[_0xd792('0x4')],'context':_0x5d216c[_0xd792('0x7')],'exten':_0x5d216c[_0xd792('0x8')],'priority':_0x342794++,'VoiceExtensionId':_0x5d216c['id']},{'type':_0x5d216c[_0xd792('0x4')],'app':_0x5d216c[_0xd792('0x9')]?_0xd792('0x5'):'NoOp','appdata':_0x5d216c[_0xd792('0x9')]?_0xd792('0xa')+_0x5d216c[_0xd792('0x9')]:_0xd792('0xb'),'context':_0x5d216c[_0xd792('0x7')],'exten':_0x5d216c['exten'],'priority':_0x342794++,'VoiceExtensionId':_0x5d216c['id']}];if(_0x5d216c[_0xd792('0x4')]==='inbound'){_0x52f848[_0xd792('0xc')]({'type':_0xd792('0xd'),'app':'Set','appdata':_0xd792('0xe')+_0x5d216c['id'],'context':_0x5d216c[_0xd792('0x7')],'exten':_0x5d216c['exten'],'priority':_0x342794++,'VoiceExtensionId':_0x5d216c['id']});}_0x52f848[_0xd792('0xc')]({'type':_0x5d216c[_0xd792('0x4')],'app':_0xd792('0x5'),'appdata':_0xd792('0xf'),'context':_0x5d216c[_0xd792('0x7')],'exten':_0x5d216c['exten'],'priority':_0x342794++,'VoiceExtensionId':_0x5d216c['id']},{'type':_0x5d216c[_0xd792('0x4')],'app':'Set','appdata':_0xd792('0x10'),'context':_0x5d216c['context'],'exten':_0x5d216c[_0xd792('0x8')],'priority':_0x342794++,'VoiceExtensionId':_0x5d216c['id']},{'type':_0x5d216c[_0xd792('0x4')],'app':_0xd792('0x5'),'appdata':_0xd792('0x11'),'context':_0x5d216c[_0xd792('0x7')],'exten':_0x5d216c[_0xd792('0x8')],'priority':_0x342794++,'VoiceExtensionId':_0x5d216c['id']});return _0x52f848;}function _0x157893(_0x378b2f){var _0x17b186=0x2;var _0x25422b=[{'type':'outbound','app':_0xd792('0x5'),'appdata':'CDR(type)=outbound','context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f['exten'],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':'outbound','app':_0x378b2f[_0xd792('0x9')]?'Set':_0xd792('0x12'),'appdata':_0x378b2f[_0xd792('0x9')]?_0xd792('0xa')+_0x378b2f[_0xd792('0x9')]:'No\x20alias\x20set','context':_0x378b2f['context'],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':_0xd792('0x14')+(_0x378b2f['cutdigits']?_0xd792('0x15')+_0x378b2f[_0xd792('0x16')]+'}':_0xd792('0x17')),'context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f['exten'],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':_0xd792('0xe')+_0x378b2f['id'],'context':_0x378b2f['context'],'exten':_0x378b2f['exten'],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x17b186+0x2)+_0xd792('0x18')+(_0x17b186+0x1)+')','context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':_0x378b2f['cutdigits']?_0xd792('0x19')+_0x378b2f['cutdigits']+'}':_0xd792('0x1a'),'context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f['exten'],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':_0xd792('0xf'),'context':_0x378b2f['context'],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':'outbound','app':'Set','appdata':_0xd792('0x10'),'context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':_0xd792('0x1b')+_0x378b2f['id'],'context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']}];if(_0x378b2f['hasOwnProperty']('recordingFormat')&&_0x378b2f[_0xd792('0x1c')]!==_0xd792('0x1d')){_0x25422b[_0xd792('0xc')]({'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']},{'type':_0xd792('0x13'),'app':_0xd792('0x5'),'appdata':_0xd792('0x1e')+_0x378b2f[_0xd792('0x1c')]||_0xd792('0x1f'),'context':_0x378b2f[_0xd792('0x7')],'exten':_0x378b2f[_0xd792('0x8')],'priority':_0x17b186++,'VoiceExtensionId':_0x378b2f['id']});}return _0x25422b;}function _0x14c063(_0x3ed907){var _0x1d369d=[{'name':'trunk','param':0x0},{'name':_0xd792('0x20'),'param':0x1},{'name':_0xd792('0x21'),'param':0x2},{'name':_0xd792('0x22'),'param':0x3}];var _0x507219={};var _0x51caf7=_0x3ed907[_0xd792('0x23')](',');var _0x334810=[];for(var _0x529d01=0x0;_0x529d01<_0x1d369d[_0xd792('0x24')];_0x529d01++){switch(_0x1d369d[_0x529d01][_0xd792('0x25')]){case _0xd792('0x26'):_0x507219[_0xd792('0x26')]=_0x51caf7[_0x1d369d[_0x529d01]['param']][_0xd792('0x23')]('/')[0x1];_0x507219[_0xd792('0x27')]=_0x51caf7[_0x1d369d[_0x529d01]['param']]['split']('/')[0x2];_0x507219[_0xd792('0x28')]=_0x507219[_0xd792('0x27')]?_0x507219[_0xd792('0x27')]['split']('$')[0x0]:undefined;_0x507219[_0xd792('0x27')]=route[_0xd792('0x16')]?(_0x507219[_0xd792('0x28')]||'')+_0xd792('0x15')+route[_0xd792('0x16')]+'}':(_0x507219[_0xd792('0x28')]||'')+_0xd792('0x17');_0x334810[_0x1d369d[_0x529d01][_0xd792('0x29')]]=['SIP',_0x507219[_0xd792('0x26')],_0x507219[_0xd792('0x27')]][_0xd792('0x2a')]('/');break;case _0xd792('0x21'):_0x507219[_0xd792('0x21')]=_0x51caf7[_0x1d369d[_0x529d01][_0xd792('0x29')]];if(route['recordingFormat']!=='none'){if(_0x507219[_0xd792('0x21')][_0xd792('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x507219[_0xd792('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x507219[_0xd792('0x21')]=_0x507219['options'][_0xd792('0x2c')](_0xd792('0x2d'),'');}_0x334810[_0x1d369d[_0x529d01][_0xd792('0x29')]]=_0x507219[_0xd792('0x21')];break;default:_0x334810[_0x1d369d[_0x529d01][_0xd792('0x29')]]=_0x51caf7[_0x1d369d[_0x529d01][_0xd792('0x29')]];}}return _0x334810[_0xd792('0x2a')](',');}function _0x5b45ed(_0x178492,_0x2961ab,_0x53f920,_0x1fbd30){return new Promise(function(_0x19f6a3,_0x51fcbc){var _0x191cc0=[];if(_['isEmpty'](_0x2961ab))return _0x19f6a3(_0x191cc0);_0x547924[_0xd792('0x2e')][_0xd792('0x2f')]({'attributes':['id',_0xd792('0x30'),_0xd792('0x31')],'raw':!![]})[_0xd792('0x32')](function(_0x5e496c){for(var _0x45234a=0x0,_0x4f88a8=0x0;_0x45234a<_0x2961ab[_0xd792('0x24')];_0x45234a++,_0x4f88a8=0x0){var _0x595880=_0x2961ab[_0x45234a];var _0x31348c=[];var _0x30b418=[];if(_0x595880[_0xd792('0x30')]!==_0xd792('0x33')){_0x595880[_0xd792('0x34')]=[_0x595880[_0xd792('0x30')]];}else{_0x595880[_0xd792('0x34')]=_0x595880[_0xd792('0x31')]?_[_0xd792('0x35')](_['filter'](_0x5e496c,{'IntervalId':_0x595880[_0xd792('0x31')]}),_0xd792('0x30')):[];}_0x595880[_0xd792('0x7')]=_0x178492[_0xd792('0x7')];_0x595880[_0xd792('0x8')]=_0x178492[_0xd792('0x8')];if(_0x595880[_0xd792('0x4')])_0x595880[_0xd792('0x4')]=_0x595880['type']['toLowerCase']();if(_0x178492[_0xd792('0x4')]===_0xd792('0x13')){if(_0x595880[_0xd792('0x36')]('tag')&&_0x595880[_0xd792('0x37')]&&_0x595880[_0xd792('0x37')]!=='--'){_0x31348c[_0xd792('0xc')]({'type':_0x595880['type'][_0xd792('0x38')](),'app':_0xd792('0x5'),'appdata':_0xd792('0x39')+_0x595880[_0xd792('0x37')],'context':_0x178492[_0xd792('0x7')],'exten':_0x178492[_0xd792('0x8')],'priority':_0x595880[_0xd792('0x34')][_0xd792('0x24')]+_0x53f920+_0x4f88a8++,'VoiceExtensionId':_0x178492['id']});}_0x31348c['push']({'type':_0x595880['type'][_0xd792('0x38')](),'app':_0xd792('0x3a'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x595880[_0xd792('0x3b')]?'Set(CALLERID(all)='+_0x595880[_0xd792('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x178492[_0xd792('0x7')],'exten':_0x178492[_0xd792('0x8')],'priority':_0x595880[_0xd792('0x34')]['length']+_0x53f920+_0x4f88a8++,'VoiceExtensionId':_0x178492['id']});}else{if(_0x595880[_0xd792('0x36')](_0xd792('0x3c'))){if(['queue',_0xd792('0x3d')][_0xd792('0x3e')](_0x595880[_0xd792('0x3f')][_0xd792('0x38')]())&&_0x595880['appType']!=='custom'){if(_0x595880[_0xd792('0x3c')]){_0x31348c[_0xd792('0xc')]({'type':_0x595880[_0xd792('0x4')]['toLowerCase'](),'app':_0xd792('0x3a'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x178492[_0xd792('0x7')],'exten':_0x178492[_0xd792('0x8')],'priority':_0x595880[_0xd792('0x34')][_0xd792('0x24')]+_0x53f920+_0x4f88a8++,'VoiceExtensionId':_0x178492['id']});_0x31348c[_0xd792('0xc')]({'type':_0x595880[_0xd792('0x4')][_0xd792('0x38')](),'app':_0xd792('0x5'),'appdata':_0xd792('0x40'),'context':_0x178492['context'],'exten':_0x178492[_0xd792('0x8')],'priority':_0x595880[_0xd792('0x34')][_0xd792('0x24')]+_0x53f920+_0x4f88a8++,'VoiceExtensionId':_0x178492['id']});}else{_0x31348c['push']({'type':_0x595880[_0xd792('0x4')][_0xd792('0x38')](),'app':_0xd792('0x3a'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x178492['context'],'exten':_0x178492[_0xd792('0x8')],'priority':_0x595880[_0xd792('0x34')][_0xd792('0x24')]+_0x53f920+_0x4f88a8++,'VoiceExtensionId':_0x178492['id']});_0x31348c[_0xd792('0xc')]({'type':_0x595880[_0xd792('0x4')][_0xd792('0x38')](),'app':_0xd792('0x5'),'appdata':_0xd792('0x41'),'context':_0x178492[_0xd792('0x7')],'exten':_0x178492[_0xd792('0x8')],'priority':_0x595880[_0xd792('0x34')][_0xd792('0x24')]+_0x53f920+_0x4f88a8++,'VoiceExtensionId':_0x178492['id']});}}}}for(var _0x4d981f=0x0;_0x4d981f<_0x595880[_0xd792('0x34')]['length'];_0x4d981f++){var _0x35173a=_0x53f920+_0x595880[_0xd792('0x34')]['length'];var _0x5543bd=_0x4d981f===_0x595880[_0xd792('0x34')]['length']-0x1?_0x53f920+_0x31348c['length']+_0x30b418[_0xd792('0x24')]+0x2:_0x53f920+_0x4d981f+0x1;_0x31348c['splice'](_0x4d981f,0x0,{'type':_0x178492[_0xd792('0x4')],'app':_0xd792('0x42'),'appdata':_0x595880[_0xd792('0x34')][_0x4d981f]+'?'+_0x178492['context']+_0xd792('0x43')+_0x35173a+':'+_0x178492[_0xd792('0x7')]+_0xd792('0x43')+_0x5543bd,'exten':_0x178492[_0xd792('0x8')],'context':_0x178492[_0xd792('0x7')],'priority':_0x53f920+_0x4d981f,'VoiceExtensionId':_0x178492['id']});}if(_0x1fbd30&&_0x595880['appType']===_0xd792('0x44'))_0x595880[_0xd792('0x45')]=_0x14c063(_0x595880['appdata']);_0x595880[_0xd792('0x46')]=_0x31348c[_0xd792('0x24')]?_[_0xd792('0x47')](_0x31348c)[_0xd792('0x46')]+0x1:_0x53f920;_0x191cc0=_[_0xd792('0x48')](_0x191cc0,_0x31348c,[_0x595880],_0x30b418);_0x53f920=_[_0xd792('0x47')](_0x191cc0)['priority']+0x1;}return _0x19f6a3(_0x191cc0);})[_0xd792('0x49')](function(_0x3a9625){_0x51fcbc(_0x3a9625);});});}return _0x8bd3d3['define'](_0xd792('0x4a'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37b2ca,_0x57d68b){var _0x10b803=this;var _0x266454=_0x10b803[_0xd792('0x4')]===_0xd792('0x13')?_0x157893(_0x10b803):_0x219244(_0x10b803);return _0x5b45ed(_0x10b803,_0x37b2ca,_[_0xd792('0x47')](_0x266454)[_0xd792('0x46')]+0x1,_0x57d68b)[_0xd792('0x32')](function(_0x4a45aa){var _0x1306f1=_[_0xd792('0x48')](_0x266454,_0x4a45aa);_0x1306f1[_0xd792('0xc')]({'type':_0x10b803[_0xd792('0x4')],'app':_0xd792('0x4b'),'exten':_0x10b803[_0xd792('0x8')],'context':_0x10b803[_0xd792('0x7')],'priority':_[_0xd792('0x47')](_0x1306f1)[_0xd792('0x46')]+0x1,'VoiceExtensionId':_0x10b803['id']});return _0x1306f1;});}}});}; \ No newline at end of file +var _0x6e01=['SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','length','intervals','interval','IntervalId','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','priority','concat','define','voice_extensions','last','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','NoOp','CDR(routeAlias)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','split','name','phone','param','prefix','${EXTEN}'];(function(_0x46b0f6,_0x14fcf5){var _0x499245=function(_0x4b70da){while(--_0x4b70da){_0x46b0f6['push'](_0x46b0f6['shift']());}};_0x499245(++_0x14fcf5);}(_0x6e01,0x1b8));var _0x16e0=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0x6e01[_0x435fa1];return _0x845f9f;};'use strict';var util=require('util');var _=require(_0x16e0('0x0'));var attributes=require(_0x16e0('0x1'));module[_0x16e0('0x2')]=function(_0x2455bc){var _0x1de1fb=_0x2455bc[_0x16e0('0x3')];function _0x59c914(_0x29927e){var _0x6a3288=0x2;var _0xe3bdca=[{'type':_0x29927e[_0x16e0('0x4')],'app':_0x16e0('0x5'),'appdata':_0x16e0('0x6')+_0x29927e[_0x16e0('0x4')],'context':_0x29927e[_0x16e0('0x7')],'exten':_0x29927e[_0x16e0('0x8')],'priority':_0x6a3288++,'VoiceExtensionId':_0x29927e['id']},{'type':_0x29927e[_0x16e0('0x4')],'app':_0x29927e[_0x16e0('0x9')]?'Set':'NoOp','appdata':_0x29927e[_0x16e0('0x9')]?'CDR(routeAlias)='+_0x29927e[_0x16e0('0x9')]:_0x16e0('0xa'),'context':_0x29927e['context'],'exten':_0x29927e[_0x16e0('0x8')],'priority':_0x6a3288++,'VoiceExtensionId':_0x29927e['id']}];if(_0x29927e[_0x16e0('0x4')]===_0x16e0('0xb')){_0xe3bdca[_0x16e0('0xc')]({'type':_0x16e0('0xb'),'app':_0x16e0('0x5'),'appdata':_0x16e0('0xd')+_0x29927e['id'],'context':_0x29927e[_0x16e0('0x7')],'exten':_0x29927e[_0x16e0('0x8')],'priority':_0x6a3288++,'VoiceExtensionId':_0x29927e['id']});}_0xe3bdca[_0x16e0('0xc')]({'type':_0x29927e[_0x16e0('0x4')],'app':_0x16e0('0x5'),'appdata':_0x16e0('0xe'),'context':_0x29927e[_0x16e0('0x7')],'exten':_0x29927e[_0x16e0('0x8')],'priority':_0x6a3288++,'VoiceExtensionId':_0x29927e['id']},{'type':_0x29927e['type'],'app':'Set','appdata':_0x16e0('0xf'),'context':_0x29927e[_0x16e0('0x7')],'exten':_0x29927e['exten'],'priority':_0x6a3288++,'VoiceExtensionId':_0x29927e['id']},{'type':_0x29927e['type'],'app':'Set','appdata':_0x16e0('0x10'),'context':_0x29927e['context'],'exten':_0x29927e[_0x16e0('0x8')],'priority':_0x6a3288++,'VoiceExtensionId':_0x29927e['id']});return _0xe3bdca;}function _0x19f918(_0x447cd8){var _0x24c00c=0x2;var _0x175299=[{'type':'outbound','app':'Set','appdata':_0x16e0('0x11'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8['exten'],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x447cd8['alias']?_0x16e0('0x5'):_0x16e0('0x13'),'appdata':_0x447cd8[_0x16e0('0x9')]?_0x16e0('0x14')+_0x447cd8['alias']:_0x16e0('0xa'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x5'),'appdata':'CDR(destination)='+(_0x447cd8[_0x16e0('0x15')]?_0x16e0('0x16')+_0x447cd8[_0x16e0('0x15')]+'}':'${EXTEN}'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x5'),'appdata':_0x16e0('0xd')+_0x447cd8['id'],'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8['exten'],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x17'),'appdata':_0x16e0('0x18')+(_0x24c00c+0x2)+'):Goto('+(_0x24c00c+0x1)+')','context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x5'),'appdata':_0x447cd8[_0x16e0('0x15')]?_0x16e0('0x19')+_0x447cd8[_0x16e0('0x15')]+'}':_0x16e0('0x1a'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x5'),'appdata':_0x16e0('0xe'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':'Set','appdata':_0x16e0('0xf'),'context':_0x447cd8['context'],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x5'),'appdata':_0x16e0('0x10'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':'outbound','app':_0x16e0('0x5'),'appdata':_0x16e0('0x1b')+_0x447cd8['id'],'context':_0x447cd8['context'],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']}];if(_0x447cd8[_0x16e0('0x1c')](_0x16e0('0x1d'))&&_0x447cd8[_0x16e0('0x1d')]!==_0x16e0('0x1e')){_0x175299[_0x16e0('0xc')]({'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8[_0x16e0('0x8')],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']},{'type':_0x16e0('0x12'),'app':_0x16e0('0x5'),'appdata':_0x16e0('0x1f')+_0x447cd8[_0x16e0('0x1d')]||_0x16e0('0x20'),'context':_0x447cd8[_0x16e0('0x7')],'exten':_0x447cd8['exten'],'priority':_0x24c00c++,'VoiceExtensionId':_0x447cd8['id']});}return _0x175299;}function _0x434e03(_0x447b88){var _0x4971f3=[{'name':_0x16e0('0x21'),'param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x40de50={};var _0x46756d=_0x447b88[_0x16e0('0x22')](',');var _0x36a1de=[];for(var _0x174350=0x0;_0x174350<_0x4971f3['length'];_0x174350++){switch(_0x4971f3[_0x174350][_0x16e0('0x23')]){case _0x16e0('0x21'):_0x40de50[_0x16e0('0x21')]=_0x46756d[_0x4971f3[_0x174350]['param']]['split']('/')[0x1];_0x40de50[_0x16e0('0x24')]=_0x46756d[_0x4971f3[_0x174350][_0x16e0('0x25')]][_0x16e0('0x22')]('/')[0x2];_0x40de50['prefix']=_0x40de50[_0x16e0('0x24')]?_0x40de50[_0x16e0('0x24')]['split']('$')[0x0]:undefined;_0x40de50[_0x16e0('0x24')]=route[_0x16e0('0x15')]?(_0x40de50[_0x16e0('0x26')]||'')+_0x16e0('0x16')+route[_0x16e0('0x15')]+'}':(_0x40de50[_0x16e0('0x26')]||'')+_0x16e0('0x27');_0x36a1de[_0x4971f3[_0x174350][_0x16e0('0x25')]]=[_0x16e0('0x28'),_0x40de50['trunk'],_0x40de50['phone']][_0x16e0('0x29')]('/');break;case'options':_0x40de50[_0x16e0('0x2a')]=_0x46756d[_0x4971f3[_0x174350]['param']];if(route[_0x16e0('0x1d')]!=='none'){if(_0x40de50[_0x16e0('0x2a')][_0x16e0('0x2b')](_0x16e0('0x2c'))<0x0){_0x40de50[_0x16e0('0x2a')]+=_0x16e0('0x2c');}}else{_0x40de50[_0x16e0('0x2a')]=_0x40de50[_0x16e0('0x2a')][_0x16e0('0x2d')](_0x16e0('0x2c'),'');}_0x36a1de[_0x4971f3[_0x174350][_0x16e0('0x25')]]=_0x40de50[_0x16e0('0x2a')];break;default:_0x36a1de[_0x4971f3[_0x174350][_0x16e0('0x25')]]=_0x46756d[_0x4971f3[_0x174350][_0x16e0('0x25')]];}}return _0x36a1de['join'](',');}function _0x875a0a(_0x29fd6d,_0x43fc44,_0x43f2c2,_0x1b26c1){return new Promise(function(_0x2defbd,_0x22ab9a){var _0x3edef8=[];if(_[_0x16e0('0x2e')](_0x43fc44))return _0x2defbd(_0x3edef8);_0x1de1fb['Interval'][_0x16e0('0x2f')]({'attributes':['id','interval','IntervalId'],'raw':!![]})['then'](function(_0x325c53){for(var _0x3e01fd=0x0,_0x18d85a=0x0;_0x3e01fd<_0x43fc44[_0x16e0('0x30')];_0x3e01fd++,_0x18d85a=0x0){var _0x41bcfe=_0x43fc44[_0x3e01fd];var _0x35c0cd=[];var _0x37dfad=[];if(_0x41bcfe['interval']!=='*,*,*,*'){_0x41bcfe[_0x16e0('0x31')]=[_0x41bcfe[_0x16e0('0x32')]];}else{_0x41bcfe['intervals']=_0x41bcfe[_0x16e0('0x33')]?_[_0x16e0('0x34')](_[_0x16e0('0x35')](_0x325c53,{'IntervalId':_0x41bcfe[_0x16e0('0x33')]}),_0x16e0('0x32')):[];}_0x41bcfe['context']=_0x29fd6d['context'];_0x41bcfe[_0x16e0('0x8')]=_0x29fd6d['exten'];if(_0x41bcfe[_0x16e0('0x4')])_0x41bcfe[_0x16e0('0x4')]=_0x41bcfe[_0x16e0('0x4')][_0x16e0('0x36')]();if(_0x29fd6d['type']===_0x16e0('0x12')){if(_0x41bcfe[_0x16e0('0x1c')](_0x16e0('0x37'))&&_0x41bcfe[_0x16e0('0x37')]&&_0x41bcfe[_0x16e0('0x37')]!=='--'){_0x35c0cd[_0x16e0('0xc')]({'type':_0x41bcfe[_0x16e0('0x4')][_0x16e0('0x36')](),'app':_0x16e0('0x5'),'appdata':_0x16e0('0x38')+_0x41bcfe['tag'],'context':_0x29fd6d[_0x16e0('0x7')],'exten':_0x29fd6d[_0x16e0('0x8')],'priority':_0x41bcfe[_0x16e0('0x31')][_0x16e0('0x30')]+_0x43f2c2+_0x18d85a++,'VoiceExtensionId':_0x29fd6d['id']});}_0x35c0cd[_0x16e0('0xc')]({'type':_0x41bcfe[_0x16e0('0x4')][_0x16e0('0x36')](),'app':_0x16e0('0x17'),'appdata':_0x16e0('0x39')+(_0x41bcfe[_0x16e0('0x3a')]?'Set(CALLERID(all)='+_0x41bcfe[_0x16e0('0x3a')]+')':_0x16e0('0x3b')),'context':_0x29fd6d[_0x16e0('0x7')],'exten':_0x29fd6d['exten'],'priority':_0x41bcfe[_0x16e0('0x31')][_0x16e0('0x30')]+_0x43f2c2+_0x18d85a++,'VoiceExtensionId':_0x29fd6d['id']});}else{if(_0x41bcfe[_0x16e0('0x1c')](_0x16e0('0x3c'))){if([_0x16e0('0x3d'),_0x16e0('0x3e')][_0x16e0('0x3f')](_0x41bcfe[_0x16e0('0x40')]['toLowerCase']())&&_0x41bcfe['appType']!==_0x16e0('0x41')){if(_0x41bcfe[_0x16e0('0x3c')]){_0x35c0cd[_0x16e0('0xc')]({'type':_0x41bcfe[_0x16e0('0x4')][_0x16e0('0x36')](),'app':_0x16e0('0x17'),'appdata':_0x16e0('0x42'),'context':_0x29fd6d[_0x16e0('0x7')],'exten':_0x29fd6d[_0x16e0('0x8')],'priority':_0x41bcfe['intervals']['length']+_0x43f2c2+_0x18d85a++,'VoiceExtensionId':_0x29fd6d['id']});_0x35c0cd[_0x16e0('0xc')]({'type':_0x41bcfe[_0x16e0('0x4')][_0x16e0('0x36')](),'app':_0x16e0('0x5'),'appdata':_0x16e0('0x43'),'context':_0x29fd6d[_0x16e0('0x7')],'exten':_0x29fd6d[_0x16e0('0x8')],'priority':_0x41bcfe[_0x16e0('0x31')][_0x16e0('0x30')]+_0x43f2c2+_0x18d85a++,'VoiceExtensionId':_0x29fd6d['id']});}else{_0x35c0cd['push']({'type':_0x41bcfe[_0x16e0('0x4')][_0x16e0('0x36')](),'app':_0x16e0('0x17'),'appdata':_0x16e0('0x44'),'context':_0x29fd6d[_0x16e0('0x7')],'exten':_0x29fd6d['exten'],'priority':_0x41bcfe[_0x16e0('0x31')][_0x16e0('0x30')]+_0x43f2c2+_0x18d85a++,'VoiceExtensionId':_0x29fd6d['id']});_0x35c0cd[_0x16e0('0xc')]({'type':_0x41bcfe['type'][_0x16e0('0x36')](),'app':'Set','appdata':_0x16e0('0x45'),'context':_0x29fd6d[_0x16e0('0x7')],'exten':_0x29fd6d[_0x16e0('0x8')],'priority':_0x41bcfe[_0x16e0('0x31')][_0x16e0('0x30')]+_0x43f2c2+_0x18d85a++,'VoiceExtensionId':_0x29fd6d['id']});}}}}for(var _0x5ade8e=0x0;_0x5ade8e<_0x41bcfe[_0x16e0('0x31')]['length'];_0x5ade8e++){var _0x301c3e=_0x43f2c2+_0x41bcfe[_0x16e0('0x31')][_0x16e0('0x30')];var _0x3e4b44=_0x5ade8e===_0x41bcfe['intervals']['length']-0x1?_0x43f2c2+_0x35c0cd[_0x16e0('0x30')]+_0x37dfad[_0x16e0('0x30')]+0x2:_0x43f2c2+_0x5ade8e+0x1;_0x35c0cd[_0x16e0('0x46')](_0x5ade8e,0x0,{'type':_0x29fd6d[_0x16e0('0x4')],'app':'GotoIfTime','appdata':_0x41bcfe['intervals'][_0x5ade8e]+'?'+_0x29fd6d[_0x16e0('0x7')]+_0x16e0('0x47')+_0x301c3e+':'+_0x29fd6d['context']+_0x16e0('0x47')+_0x3e4b44,'exten':_0x29fd6d[_0x16e0('0x8')],'context':_0x29fd6d['context'],'priority':_0x43f2c2+_0x5ade8e,'VoiceExtensionId':_0x29fd6d['id']});}if(_0x1b26c1&&_0x41bcfe['appType']===_0x16e0('0x48'))_0x41bcfe['appdata']=_0x434e03(_0x41bcfe['appdata']);_0x41bcfe[_0x16e0('0x49')]=_0x35c0cd[_0x16e0('0x30')]?_['last'](_0x35c0cd)[_0x16e0('0x49')]+0x1:_0x43f2c2;_0x3edef8=_[_0x16e0('0x4a')](_0x3edef8,_0x35c0cd,[_0x41bcfe],_0x37dfad);_0x43f2c2=_['last'](_0x3edef8)[_0x16e0('0x49')]+0x1;}return _0x2defbd(_0x3edef8);})['catch'](function(_0x56e3df){_0x22ab9a(_0x56e3df);});});}return _0x2455bc[_0x16e0('0x4b')]('VoiceExtension',attributes,{'tableName':_0x16e0('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x22f052,_0x4f013e){var _0x8dfb26=this;var _0x404aeb=_0x8dfb26[_0x16e0('0x4')]===_0x16e0('0x12')?_0x19f918(_0x8dfb26):_0x59c914(_0x8dfb26);return _0x875a0a(_0x8dfb26,_0x22f052,_[_0x16e0('0x4d')](_0x404aeb)[_0x16e0('0x49')]+0x1,_0x4f013e)[_0x16e0('0x4e')](function(_0x1ff4b2){var _0x2a505a=_['concat'](_0x404aeb,_0x1ff4b2);_0x2a505a[_0x16e0('0xc')]({'type':_0x8dfb26[_0x16e0('0x4')],'app':_0x16e0('0x4f'),'exten':_0x8dfb26[_0x16e0('0x8')],'context':_0x8dfb26[_0x16e0('0x7')],'priority':_[_0x16e0('0x4d')](_0x2a505a)['priority']+0x1,'VoiceExtensionId':_0x8dfb26['id']});return _0x2a505a;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 4ff132a..33d1791 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 _0x975f=['VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceExtension','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','register','request','then'];(function(_0x438927,_0x18ec8b){var _0x41f65b=function(_0x2c779d){while(--_0x2c779d){_0x438927['push'](_0x438927['shift']());}};_0x41f65b(++_0x18ec8b);}(_0x975f,0x191));var _0xf975=function(_0x4521e3,_0x10a8a4){_0x4521e3=_0x4521e3-0x0;var _0x46a272=_0x975f[_0x4521e3];return _0x46a272;};'use strict';var _=require(_0xf975('0x0'));var util=require('util');var moment=require(_0xf975('0x1'));var BPromise=require(_0xf975('0x2'));var rs=require(_0xf975('0x3'));var fs=require('fs');var Redis=require(_0xf975('0x4'));var db=require(_0xf975('0x5'))['db'];var utils=require(_0xf975('0x6'));var logger=require('../../config/logger')(_0xf975('0x7'));var config=require(_0xf975('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf975('0x9')][_0xf975('0xa')]({'port':0x232a});config[_0xf975('0xb')]=_[_0xf975('0xc')](config[_0xf975('0xb')],{'host':_0xf975('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf975('0xb')]));require('./voiceExtension.socket')[_0xf975('0xe')](socket);function respondWithRpcPromise(_0x4b1029,_0x32e936,_0x30e02d){return new BPromise(function(_0x56a124,_0x472fc7){return client[_0xf975('0xf')](_0x4b1029,_0x30e02d)[_0xf975('0x10')](function(_0x5444b2){logger['info'](_0xf975('0x11'),_0x32e936,_0xf975('0x12'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x32e936,_0xf975('0x12'),JSON[_0xf975('0x13')](_0x5444b2));if(_0x5444b2[_0xf975('0x14')]){if(_0x5444b2[_0xf975('0x14')][_0xf975('0x15')]===0x1f4){logger[_0xf975('0x14')](_0xf975('0x11'),_0x32e936,_0x5444b2[_0xf975('0x14')]['message']);return _0x472fc7(_0x5444b2[_0xf975('0x14')][_0xf975('0x16')]);}logger[_0xf975('0x14')](_0xf975('0x11'),_0x32e936,_0x5444b2[_0xf975('0x14')][_0xf975('0x16')]);return _0x56a124(_0x5444b2[_0xf975('0x14')][_0xf975('0x16')]);}else{logger[_0xf975('0x17')](_0xf975('0x11'),_0x32e936,_0xf975('0x12'));_0x56a124(_0x5444b2[_0xf975('0x18')][_0xf975('0x16')]);}})['catch'](function(_0x211f52){logger[_0xf975('0x14')](_0xf975('0x11'),_0x32e936,_0x211f52);_0x472fc7(_0x211f52);});});}exports['GetVoiceExtension']=function(_0xa4ae6f){var _0x5447a3=this;return new Promise(function(_0x51b9d3,_0x242742){return db[_0xf975('0x19')][_0xf975('0x1a')]({'raw':_0xa4ae6f[_0xf975('0x1b')]?_0xa4ae6f[_0xf975('0x1b')][_0xf975('0x1c')]===undefined?!![]:![]:!![],'where':_0xa4ae6f[_0xf975('0x1b')]?_0xa4ae6f[_0xf975('0x1b')][_0xf975('0x1d')]||null:null,'attributes':_0xa4ae6f[_0xf975('0x1b')]?_0xa4ae6f[_0xf975('0x1b')][_0xf975('0x1e')]||null:null,'limit':_0xa4ae6f[_0xf975('0x1b')]?_0xa4ae6f[_0xf975('0x1b')][_0xf975('0x1f')]||null:null,'include':_0xa4ae6f[_0xf975('0x1b')]?_0xa4ae6f['options'][_0xf975('0x20')]?_[_0xf975('0x21')](_0xa4ae6f[_0xf975('0x1b')][_0xf975('0x20')],function(_0x2ee75b){return{'model':db[_0x2ee75b[_0xf975('0x22')]],'as':_0x2ee75b['as'],'attributes':_0x2ee75b[_0xf975('0x1e')],'include':_0x2ee75b[_0xf975('0x20')]?_[_0xf975('0x21')](_0x2ee75b[_0xf975('0x20')],function(_0x54db6f){return{'model':db[_0x54db6f['model']],'as':_0x54db6f['as'],'attributes':_0x54db6f['attributes'],'include':_0x54db6f[_0xf975('0x20')]?_[_0xf975('0x21')](_0x54db6f[_0xf975('0x20')],function(_0x3ddd47){return{'model':db[_0x3ddd47[_0xf975('0x22')]],'as':_0x3ddd47['as'],'attributes':_0x3ddd47[_0xf975('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf975('0x10')](function(_0xeb87a8){logger[_0xf975('0x17')](_0xf975('0x23'),_0xa4ae6f);logger[_0xf975('0x24')](_0xf975('0x23'),_0xa4ae6f,JSON[_0xf975('0x13')](_0xeb87a8));_0x51b9d3(_0xeb87a8);})[_0xf975('0x25')](function(_0x2f724a){logger[_0xf975('0x14')](_0xf975('0x23'),_0x2f724a[_0xf975('0x16')],_0xa4ae6f);_0x242742(_0x5447a3[_0xf975('0x14')](0x1f4,_0x2f724a[_0xf975('0x16')]));});});}; \ No newline at end of file +var _0x8e20=['socket.io-emitter','./voiceExtension.socket','register','request','then','request\x20sent','error','code','message','info','VoiceExtension,\x20%s,\x20%s','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','include','map','model','debug','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8e20,0x1af));var _0x08e2=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0x8e20[_0x39106e];return _0x892aec;};'use strict';var _=require(_0x08e2('0x0'));var util=require(_0x08e2('0x1'));var moment=require(_0x08e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x08e2('0x3'));var fs=require('fs');var Redis=require(_0x08e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x08e2('0x5'));var logger=require(_0x08e2('0x6'))(_0x08e2('0x7'));var config=require(_0x08e2('0x8'));var jayson=require(_0x08e2('0x9'));var client=jayson['client'][_0x08e2('0xa')]({'port':0x232a});config[_0x08e2('0xb')]=_['defaults'](config[_0x08e2('0xb')],{'host':_0x08e2('0xc'),'port':0x18eb});var socket=require(_0x08e2('0xd'))(new Redis(config[_0x08e2('0xb')]));require(_0x08e2('0xe'))[_0x08e2('0xf')](socket);function respondWithRpcPromise(_0x59365f,_0x127f5f,_0x4eb644){return new BPromise(function(_0x4b66b8,_0x1ae554){return client[_0x08e2('0x10')](_0x59365f,_0x4eb644)[_0x08e2('0x11')](function(_0x2538c8){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x127f5f,_0x08e2('0x12'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x127f5f,_0x08e2('0x12'),JSON['stringify'](_0x2538c8));if(_0x2538c8[_0x08e2('0x13')]){if(_0x2538c8['error'][_0x08e2('0x14')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x127f5f,_0x2538c8['error'][_0x08e2('0x15')]);return _0x1ae554(_0x2538c8[_0x08e2('0x13')][_0x08e2('0x15')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x127f5f,_0x2538c8['error']['message']);return _0x4b66b8(_0x2538c8['error']['message']);}else{logger[_0x08e2('0x16')](_0x08e2('0x17'),_0x127f5f,_0x08e2('0x12'));_0x4b66b8(_0x2538c8[_0x08e2('0x18')][_0x08e2('0x15')]);}})[_0x08e2('0x19')](function(_0x38f6d1){logger[_0x08e2('0x13')](_0x08e2('0x17'),_0x127f5f,_0x38f6d1);_0x1ae554(_0x38f6d1);});});}exports[_0x08e2('0x1a')]=function(_0x2384a3){var _0x5d1568=this;return new Promise(function(_0x5e3cba,_0x52787e){return db[_0x08e2('0x1b')][_0x08e2('0x1c')]({'raw':_0x2384a3['options']?_0x2384a3[_0x08e2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2384a3[_0x08e2('0x1d')]?_0x2384a3['options'][_0x08e2('0x1e')]||null:null,'attributes':_0x2384a3[_0x08e2('0x1d')]?_0x2384a3[_0x08e2('0x1d')][_0x08e2('0x1f')]||null:null,'limit':_0x2384a3[_0x08e2('0x1d')]?_0x2384a3['options']['limit']||null:null,'include':_0x2384a3['options']?_0x2384a3[_0x08e2('0x1d')][_0x08e2('0x20')]?_[_0x08e2('0x21')](_0x2384a3[_0x08e2('0x1d')][_0x08e2('0x20')],function(_0x4dbf2c){return{'model':db[_0x4dbf2c['model']],'as':_0x4dbf2c['as'],'attributes':_0x4dbf2c[_0x08e2('0x1f')],'include':_0x4dbf2c[_0x08e2('0x20')]?_[_0x08e2('0x21')](_0x4dbf2c[_0x08e2('0x20')],function(_0x4d1b29){return{'model':db[_0x4d1b29[_0x08e2('0x22')]],'as':_0x4d1b29['as'],'attributes':_0x4d1b29['attributes'],'include':_0x4d1b29[_0x08e2('0x20')]?_[_0x08e2('0x21')](_0x4d1b29[_0x08e2('0x20')],function(_0x5cdfb2){return{'model':db[_0x5cdfb2[_0x08e2('0x22')]],'as':_0x5cdfb2['as'],'attributes':_0x5cdfb2[_0x08e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x08e2('0x11')](function(_0x24a633){logger['info'](_0x08e2('0x1a'),_0x2384a3);logger[_0x08e2('0x23')](_0x08e2('0x1a'),_0x2384a3,JSON[_0x08e2('0x24')](_0x24a633));_0x5e3cba(_0x24a633);})['catch'](function(_0x2ab732){logger[_0x08e2('0x13')]('GetVoiceExtension',_0x2ab732[_0x08e2('0x15')],_0x2384a3);_0x52787e(_0x5d1568['error'](0x1f4,_0x2ab732['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 4096685..1ed3d75 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x814b,0x1a2));var _0xb814=function(_0x465aa9,_0x1bf1c8){_0x465aa9=_0x465aa9-0x0;var _0x4104e4=_0x814b[_0x465aa9];return _0x4104e4;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x12b2c3,_0x16ea36){var _0x575c89=function(_0x55e41c){while(--_0x55e41c){_0x12b2c3['push'](_0x12b2c3['shift']());}};_0x575c89(++_0x16ea36);}(_0xe14b,0x93));var _0xbe14=function(_0x289799,_0x41d5a8){_0x289799=_0x289799-0x0;var _0x39a88e=_0xe14b[_0x289799];return _0x39a88e;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index fb0d12f..8067f01 100644 --- a/server/api/voiceMail/index.js +++ b/server/api/voiceMail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x627e=['show','/:id/messages','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id'];(function(_0x508a03,_0x1d6832){var _0x256791=function(_0x340759){while(--_0x340759){_0x508a03['push'](_0x508a03['shift']());}};_0x256791(++_0x1d6832);}(_0x627e,0x14a));var _0xe627=function(_0x1bf9aa,_0x34a960){_0x1bf9aa=_0x1bf9aa-0x0;var _0x5ea5cd=_0x627e[_0x1bf9aa];return _0x5ea5cd;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var fs_extra=require(_0xe627('0x5'));var auth=require(_0xe627('0x6'));var interaction=require(_0xe627('0x7'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router['get']('/',auth[_0xe627('0x8')](),controller[_0xe627('0x9')]);router[_0xe627('0xa')](_0xe627('0xb'),auth[_0xe627('0x8')](),controller[_0xe627('0xc')]);router['get'](_0xe627('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xe627('0xe')]('/',auth[_0xe627('0x8')](),controller['create']);router['put'](_0xe627('0xb'),auth[_0xe627('0x8')](),controller[_0xe627('0xf')]);router[_0xe627('0x10')](_0xe627('0xb'),auth[_0xe627('0x8')](),controller[_0xe627('0x11')]);module[_0xe627('0x12')]=router; \ No newline at end of file +var _0x7ee1=['fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','/:id/messages','create','/:id','update','delete','exports','multer','express','Router'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x7ee1,0x8d));var _0x17ee=function(_0x548385,_0x18587e){_0x548385=_0x548385-0x0;var _0x1c7da3=_0x7ee1[_0x548385];return _0x1c7da3;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/:id',auth[_0x17ee('0x9')](),controller['show']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x17ee('0xb')]);router['put'](_0x17ee('0xc'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xd')]);router[_0x17ee('0xe')]('/:id',auth[_0x17ee('0x9')](),controller['destroy']);module[_0x17ee('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 649f78e..fef4678 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 _0xb235=['yes','ENUM','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim'];(function(_0x276fc6,_0x3f4bfa){var _0x3d3d4e=function(_0x47bcd9){while(--_0x47bcd9){_0x276fc6['push'](_0x276fc6['shift']());}};_0x3d3d4e(++_0x3f4bfa);}(_0xb235,0xb2));var _0x5b23=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xb235[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0x5b23('0x0'));module[_0x5b23('0x1')]={'customer_id':{'type':Sequelize[_0x5b23('0x2')]},'context':{'type':Sequelize[_0x5b23('0x2')],'defaultValue':_0x5b23('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x5b23('0x4')},'password':{'type':Sequelize[_0x5b23('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5b23('0x2')],'validate':{'isEmail':!![]},'set':function(_0x238a54){this[_0x5b23('0x5')](_0x5b23('0x6'),typeof _0x238a54===_0x5b23('0x7')&&_0x238a54[_0x5b23('0x8')]()?_0x238a54[_0x5b23('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x5b23('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x5b23('0x9'),'no'),'defaultValue':_0x5b23('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x5b23('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5b23('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5b23('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5b23('0xa')](_0x5b23('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x5b23('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x5b23('0x2')]},'maxsecs':{'type':Sequelize[_0x5b23('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5b23('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5b23('0xc')],'get':function(){return this[_0x5b23('0xd')](_0x5b23('0xe'))+_0x5b23('0xf')+this[_0x5b23('0xd')](_0x5b23('0x10'));}}}; \ No newline at end of file +var _0x2b54=['getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x771af9,_0x35afb6){var _0x45b6cc=function(_0x1abe19){while(--_0x1abe19){_0x771af9['push'](_0x771af9['shift']());}};_0x45b6cc(++_0x35afb6);}(_0x2b54,0x190));var _0x42b5=function(_0x39b5c2,_0x141f06){_0x39b5c2=_0x39b5c2-0x0;var _0x4cecef=_0x2b54[_0x39b5c2];return _0x4cecef;};'use strict';var Sequelize=require(_0x42b5('0x0'));module[_0x42b5('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x42b5('0x2')],'defaultValue':'from-voicemail','unique':_0x42b5('0x3')},'mailbox':{'type':Sequelize[_0x42b5('0x2')],'defaultValue':'','allowNull':![],'unique':_0x42b5('0x3')},'password':{'type':Sequelize[_0x42b5('0x2')]},'fullname':{'type':Sequelize[_0x42b5('0x2')]},'email':{'type':Sequelize[_0x42b5('0x2')],'validate':{'isEmail':!![]},'set':function(_0x571e68){this[_0x42b5('0x4')](_0x42b5('0x5'),typeof _0x571e68===_0x42b5('0x6')&&_0x571e68[_0x42b5('0x7')]()?_0x571e68[_0x42b5('0x7')]():null);}},'pager':{'type':Sequelize[_0x42b5('0x2')]},'tz':{'type':Sequelize[_0x42b5('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x42b5('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':_0x42b5('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x42b5('0x2')]},'callback':{'type':Sequelize[_0x42b5('0x2')]},'review':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x42b5('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x42b5('0x8')](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x42b5('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x42b5('0x8')]('yes','no'),'defaultValue':_0x42b5('0x9'),'allowNull':![]},'stamp':{'type':_0x42b5('0xb')},'emailsubject':{'type':Sequelize[_0x42b5('0x2')]},'emailbody':{'type':Sequelize[_0x42b5('0x2')]},'maxsecs':{'type':Sequelize[_0x42b5('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x42b5('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x42b5('0xd')],'get':function(){return this[_0x42b5('0xe')](_0x42b5('0xf'))+_0x42b5('0x10')+this[_0x42b5('0xe')](_0x42b5('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index ed6bd1a..bef3741 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 _0x69d3=['Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','catch','show','params','include','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','VoiceMailMessage','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x21771e,_0x5c1be2){var _0x48f8fb=function(_0x59ae4f){while(--_0x59ae4f){_0x21771e['push'](_0x21771e['shift']());}};_0x48f8fb(++_0x5c1be2);}(_0x69d3,0xda));var _0x369d=function(_0x52bc44,_0x5adaee){_0x52bc44=_0x52bc44-0x0;var _0x2cf61a=_0x69d3[_0x52bc44];return _0x2cf61a;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){var _0x36cf04=_0xcae58['get']({'plain':!![]});var _0x4dfe83=_0x369d('0x25');return db[_0x369d('0x26')][_0x369d('0x23')]({'where':{'type':_0x4dfe83,'resourceId':_0x36cf04['id']}})[_0x369d('0x24')](function(){return _0xcae58;});})[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)[_0x369d('0x19')]();});}};}function handleEntityNotFound(_0x570db4,_0x23656b){return function(_0xe95742){if(!_0xe95742){_0x570db4[_0x369d('0x17')](0x194);}return _0xe95742;};}function handleError(_0xf952a3,_0x345be5){_0x345be5=_0x345be5||0x1f4;return function(_0x41367a){logger[_0x369d('0x27')](_0x41367a['stack']);if(_0x41367a[_0x369d('0x28')]){delete _0x41367a['name'];}_0xf952a3['status'](_0x345be5)[_0x369d('0x29')](_0x41367a);};}exports[_0x369d('0x2a')]=function(_0x5844c7,_0x104540){var _0x5a14ce={},_0x37274f={},_0x39d656={'count':0x0,'rows':[]};var _0xe45219=_[_0x369d('0x2b')](db[_0x369d('0x2c')][_0x369d('0x2d')],function(_0x119c00){return{'name':_0x119c00['fieldName'],'type':_0x119c00[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x37274f[_0x369d('0x30')]=_[_0x369d('0x2b')](_0xe45219,_0x369d('0x28'));_0x37274f[_0x369d('0x31')]=_[_0x369d('0x32')](_0x5844c7[_0x369d('0x31')]);_0x37274f['filters']=_[_0x369d('0x33')](_0x37274f[_0x369d('0x30')],_0x37274f[_0x369d('0x31')]);_0x5a14ce[_0x369d('0x34')]=_[_0x369d('0x33')](_0x37274f['model'],qs[_0x369d('0x35')](_0x5844c7[_0x369d('0x31')][_0x369d('0x35')]));_0x5a14ce[_0x369d('0x34')]=_0x5a14ce[_0x369d('0x34')][_0x369d('0x36')]?_0x5a14ce['attributes']:_0x37274f[_0x369d('0x30')];if(!_0x5844c7[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x5a14ce[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x5844c7[_0x369d('0x31')][_0x369d('0x39')]);_0x5a14ce[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x1b')]);}_0x5a14ce[_0x369d('0x3a')]=qs[_0x369d('0x3b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x3b')]);_0x5a14ce[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x5844c7[_0x369d('0x31')],_0x37274f[_0x369d('0x3d')]),_0xe45219);if(_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]){_0x5a14ce[_0x369d('0x3c')]=_['merge'](_0x5a14ce['where'],{'$or':_[_0x369d('0x2b')](_0xe45219,function(_0x319e5d){if(_0x319e5d[_0x369d('0x2e')]!==_0x369d('0x40')){var _0x3afa89={};_0x3afa89[_0x319e5d[_0x369d('0x28')]]={'$like':'%'+_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]+'%'};return _0x3afa89;}})});}_0x5a14ce=_[_0x369d('0x41')]({},_0x5a14ce,_0x5844c7['options']);var _0x322b13={'where':_0x5a14ce[_0x369d('0x3c')]};return db[_0x369d('0x2c')][_0x369d('0x1d')](_0x322b13)[_0x369d('0x24')](function(_0x25cf4e){_0x39d656[_0x369d('0x1d')]=_0x25cf4e;if(_0x5844c7[_0x369d('0x31')]['includeAll']){_0x5a14ce['include']=[{'all':!![]}];}return db[_0x369d('0x2c')][_0x369d('0x42')](_0x5a14ce);})[_0x369d('0x24')](function(_0x4dad71){_0x39d656['rows']=_0x4dad71;return _0x39d656;})['then'](respondWithFilteredResult(_0x104540,_0x5a14ce))[_0x369d('0x43')](handleError(_0x104540,null));};exports[_0x369d('0x44')]=function(_0x55dfde,_0xe7ba64){var _0x430040={'raw':!![],'where':{'id':_0x55dfde[_0x369d('0x45')]['id']}},_0x102a65={};_0x102a65['model']=_[_0x369d('0x32')](db['VoiceMail'][_0x369d('0x2d')]);_0x102a65['query']=_[_0x369d('0x32')](_0x55dfde[_0x369d('0x31')]);_0x102a65[_0x369d('0x3d')]=_['intersection'](_0x102a65['model'],_0x102a65[_0x369d('0x31')]);_0x430040[_0x369d('0x34')]=_[_0x369d('0x33')](_0x102a65['model'],qs[_0x369d('0x35')](_0x55dfde[_0x369d('0x31')][_0x369d('0x35')]));_0x430040[_0x369d('0x34')]=_0x430040[_0x369d('0x34')][_0x369d('0x36')]?_0x430040[_0x369d('0x34')]:_0x102a65[_0x369d('0x30')];if(_0x55dfde[_0x369d('0x31')]['includeAll']){_0x430040[_0x369d('0x46')]=[{'all':!![]}];}_0x430040=_[_0x369d('0x41')]({},_0x430040,_0x55dfde[_0x369d('0x47')]);return db[_0x369d('0x2c')][_0x369d('0x48')](_0x430040)[_0x369d('0x24')](handleEntityNotFound(_0xe7ba64,null))['then'](respondWithResult(_0xe7ba64,null))[_0x369d('0x43')](handleError(_0xe7ba64,null));};exports[_0x369d('0x49')]=function(_0x16dd8f,_0x44a357){return db[_0x369d('0x2c')][_0x369d('0x49')](_0x16dd8f[_0x369d('0x4a')],{})[_0x369d('0x24')](function(_0x3f8a54){var _0x3c15cb=_0x16dd8f[_0x369d('0x4b')][_0x369d('0x4c')]({'plain':!![]});if(!_0x3c15cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c15cb[_0x369d('0x4d')]===_0x369d('0x4b')){var _0x289eb8=_0x3f8a54[_0x369d('0x4c')]({'plain':!![]});var _0x648a0d='Voicemails';return db[_0x369d('0x4e')]['find']({'where':{'name':_0x648a0d,'userProfileId':_0x3c15cb[_0x369d('0x4f')]},'raw':!![]})[_0x369d('0x24')](function(_0x22b594){if(_0x22b594&&_0x22b594[_0x369d('0x50')]===0x0){return db[_0x369d('0x26')][_0x369d('0x49')]({'name':_0x289eb8[_0x369d('0x28')],'resourceId':_0x289eb8['id'],'type':_0x22b594[_0x369d('0x28')],'sectionId':_0x22b594['id']},{})[_0x369d('0x24')](function(){return _0x3f8a54;});}else{return _0x3f8a54;}})[_0x369d('0x43')](function(_0x4d582a){logger['error'](_0x369d('0x51'),_0x4d582a);throw _0x4d582a;});}return _0x3f8a54;})[_0x369d('0x24')](respondWithResult(_0x44a357,0xc9))[_0x369d('0x43')](handleError(_0x44a357,null));};exports[_0x369d('0x52')]=function(_0x347df4,_0x5cd43f){if(_0x347df4['body']['id']){delete _0x347df4[_0x369d('0x4a')]['id'];}return db[_0x369d('0x2c')]['find']({'where':{'id':_0x347df4[_0x369d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd43f,null))[_0x369d('0x24')](saveUpdates(_0x347df4[_0x369d('0x4a')],null))[_0x369d('0x24')](respondWithResult(_0x5cd43f,null))['catch'](handleError(_0x5cd43f,null));};exports[_0x369d('0x23')]=function(_0x145ba8,_0x45ac3c){return db[_0x369d('0x2c')]['find']({'where':{'id':_0x145ba8['params']['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x45ac3c,null))[_0x369d('0x24')](removeEntity(_0x45ac3c,null))[_0x369d('0x43')](handleError(_0x45ac3c,null));};exports['getMessages']=function(_0x43afd7,_0x2dbbee,_0x402aae){return db['VoiceMail']['findOne']({'where':{'id':_0x43afd7[_0x369d('0x45')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x2dbbee,null))[_0x369d('0x24')](function(_0x158ce7){var _0x5408b3;var _0x33bba6={},_0x1fa6bb={};_0x1fa6bb[_0x369d('0x30')]=_[_0x369d('0x32')](db[_0x369d('0x53')]['rawAttributes']);_0x1fa6bb[_0x369d('0x31')]=_[_0x369d('0x32')](_0x43afd7[_0x369d('0x31')]);_0x1fa6bb['filters']=_[_0x369d('0x33')](_0x1fa6bb['model'],_0x1fa6bb[_0x369d('0x31')]);_0x33bba6['attributes']=_['intersection'](_0x1fa6bb['model'],qs['fields'](_0x43afd7[_0x369d('0x31')]['fields']));_0x33bba6[_0x369d('0x34')]=_0x33bba6['attributes'][_0x369d('0x36')]?_0x33bba6[_0x369d('0x34')]:_0x1fa6bb[_0x369d('0x30')];if(!_0x43afd7['query'][_0x369d('0x37')](_0x369d('0x38'))){_0x33bba6[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x43afd7[_0x369d('0x31')][_0x369d('0x39')]);_0x33bba6['offset']=qs[_0x369d('0x1b')](_0x43afd7['query']['offset']);}_0x33bba6['order']=qs[_0x369d('0x3b')](_0x43afd7[_0x369d('0x31')][_0x369d('0x3b')]);_0x33bba6[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x43afd7[_0x369d('0x31')],_0x1fa6bb[_0x369d('0x3d')]));if(_0x43afd7[_0x369d('0x31')][_0x369d('0x3f')]){_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'$or':_[_0x369d('0x2b')](_0x33bba6[_0x369d('0x34')],function(_0x46f58a){var _0x4fe1b6={};_0x4fe1b6[_0x46f58a]={'$like':'%'+_0x43afd7[_0x369d('0x31')]['filter']+'%'};return _0x4fe1b6;})});}_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'mailboxuser':_0x158ce7[_0x369d('0x54')]});_0x33bba6=_[_0x369d('0x41')]({},_0x33bba6,_0x43afd7['options']);return db[_0x369d('0x53')]['findAndCountAll'](_0x33bba6)['then'](respondWithFilteredResult(_0x2dbbee,_0x33bba6));})[_0x369d('0x43')](handleError(_0x2dbbee,null));}; \ No newline at end of file +var _0xf4eb=['fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','getMessages','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','eml-format','moment','util','path','sox','to-csv','ejs'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0xf4eb,0xec));var _0xbf4e=function(_0x20d8c5,_0x3107f4){_0x20d8c5=_0x20d8c5-0x0;var _0x2972af=_0xf4eb[_0x20d8c5];return _0x2972af;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['VoiceMail'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['VoiceMail'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));};exports[_0xbf4e('0x4c')]=function(_0x3e60e7,_0x16592f,_0xfd54c){return db['VoiceMail']['findOne']({'where':{'id':_0x3e60e7['params']['id']}})['then'](handleEntityNotFound(_0x16592f,null))[_0xbf4e('0x1f')](function(_0x453411){var _0x5cfc26;var _0x200096={},_0x23c335={};_0x23c335[_0xbf4e('0x2c')]=_[_0xbf4e('0x2d')](db[_0xbf4e('0x4d')][_0xbf4e('0x41')]);_0x23c335[_0xbf4e('0x32')]=_['keys'](_0x3e60e7[_0xbf4e('0x32')]);_0x23c335[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x23c335['model'],_0x23c335['query']);_0x200096[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x23c335[_0xbf4e('0x2c')],qs['fields'](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x200096[_0xbf4e('0x30')]=_0x200096[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x200096[_0xbf4e('0x30')]:_0x23c335[_0xbf4e('0x2c')];if(!_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x4e')](_0xbf4e('0x4f'))){_0x200096[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x3e60e7['query'][_0xbf4e('0x18')]);_0x200096['offset']=qs[_0xbf4e('0x16')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x200096[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x35')]);_0x200096[_0xbf4e('0x37')]=qs['filters'](_[_0xbf4e('0x36')](_0x3e60e7[_0xbf4e('0x32')],_0x23c335[_0xbf4e('0x2e')]));if(_0x3e60e7[_0xbf4e('0x32')][_0xbf4e('0x3b')]){_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0x200096[_0xbf4e('0x30')],function(_0x12f19f){var _0x2c606b={};_0x2c606b[_0x12f19f]={'$like':'%'+_0x3e60e7['query'][_0xbf4e('0x3b')]+'%'};return _0x2c606b;})});}_0x200096['where']=_[_0xbf4e('0x38')](_0x200096[_0xbf4e('0x37')],{'mailboxuser':_0x453411[_0xbf4e('0x50')]});_0x200096=_[_0xbf4e('0x38')]({},_0x200096,_0x3e60e7['options']);return db[_0xbf4e('0x4d')]['findAndCountAll'](_0x200096)['then'](respondWithFilteredResult(_0x16592f,_0x200096));})[_0xbf4e('0x3f')](handleError(_0x16592f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 30c6e53..e5dd644 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 _0x7326=['exports','voice_voicemail','mailbox_context','lodash','../../config/logger','api','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x396b53,_0x3c8d93){var _0x1bb54c=function(_0x3a598b){while(--_0x3a598b){_0x396b53['push'](_0x396b53['shift']());}};_0x1bb54c(++_0x3c8d93);}(_0x7326,0x16b));var _0x6732=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7326[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x6732('0x0'));var util=require('util');var logger=require(_0x6732('0x1'))(_0x6732('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(_0x6732('0x3'));var config=require(_0x6732('0x4'));var attributes=require(_0x6732('0x5'));module[_0x6732('0x6')]=function(_0x22b354,_0x1ea98b){return _0x22b354['define']('VoiceMail',attributes,{'tableName':_0x6732('0x7'),'paranoid':![],'indexes':[{'name':_0x6732('0x8'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x95d1=['request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3386fd,_0x8596f4){var _0x19e6f6=function(_0x4bd4ec){while(--_0x4bd4ec){_0x3386fd['push'](_0x3386fd['shift']());}};_0x19e6f6(++_0x8596f4);}(_0x95d1,0x81));var _0x195d=function(_0x123d3f,_0x142172){_0x123d3f=_0x123d3f-0x0;var _0x496808=_0x95d1[_0x123d3f];return _0x496808;};'use strict';var _=require(_0x195d('0x0'));var util=require(_0x195d('0x1'));var logger=require(_0x195d('0x2'))(_0x195d('0x3'));var moment=require(_0x195d('0x4'));var BPromise=require(_0x195d('0x5'));var rp=require(_0x195d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x195d('0x7'));var config=require(_0x195d('0x8'));var attributes=require(_0x195d('0x9'));module[_0x195d('0xa')]=function(_0x324504,_0x26a8ab){return _0x324504[_0x195d('0xb')](_0x195d('0xc'),attributes,{'tableName':_0x195d('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x195d('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 4c17c18..32ed31a 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 _0x99f7=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x41e123,_0x4413ec){var _0xfb5b52=function(_0x49282c){while(--_0x49282c){_0x41e123['push'](_0x41e123['shift']());}};_0xfb5b52(++_0x4413ec);}(_0x99f7,0x1ba));var _0x799f=function(_0x26f682,_0x238baa){_0x26f682=_0x26f682-0x0;var _0x54a818=_0x99f7[_0x26f682];return _0x54a818;};'use strict';var _=require(_0x799f('0x0'));var util=require('util');var moment=require(_0x799f('0x1'));var BPromise=require(_0x799f('0x2'));var rs=require(_0x799f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x799f('0x4'))['db'];var utils=require(_0x799f('0x5'));var logger=require(_0x799f('0x6'))(_0x799f('0x7'));var config=require(_0x799f('0x8'));var jayson=require(_0x799f('0x9'));var client=jayson[_0x799f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a7ceb,_0x584b9d,_0x5536eb){return new BPromise(function(_0x50c689,_0x31d9aa){return client[_0x799f('0xb')](_0x5a7ceb,_0x5536eb)['then'](function(_0x34f75b){logger['info'](_0x799f('0xc'),_0x584b9d,'request\x20sent');logger[_0x799f('0xd')](_0x799f('0xe'),_0x584b9d,_0x799f('0xf'),JSON[_0x799f('0x10')](_0x34f75b));if(_0x34f75b['error']){if(_0x34f75b[_0x799f('0x11')][_0x799f('0x12')]===0x1f4){logger[_0x799f('0x11')](_0x799f('0xc'),_0x584b9d,_0x34f75b['error']['message']);return _0x31d9aa(_0x34f75b[_0x799f('0x11')][_0x799f('0x13')]);}logger[_0x799f('0x11')](_0x799f('0xc'),_0x584b9d,_0x34f75b[_0x799f('0x11')][_0x799f('0x13')]);return _0x50c689(_0x34f75b['error']['message']);}else{logger['info'](_0x799f('0xc'),_0x584b9d,_0x799f('0xf'));_0x50c689(_0x34f75b[_0x799f('0x14')][_0x799f('0x13')]);}})[_0x799f('0x15')](function(_0x750b53){logger[_0x799f('0x11')]('VoiceMail,\x20%s,\x20%s',_0x584b9d,_0x750b53);_0x31d9aa(_0x750b53);});});} \ No newline at end of file +var _0x820c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x2d6197,_0x82ebfb){var _0x4d0e75=function(_0x577e7a){while(--_0x577e7a){_0x2d6197['push'](_0x2d6197['shift']());}};_0x4d0e75(++_0x82ebfb);}(_0x820c,0xb7));var _0xc820=function(_0x3380f8,_0x1de8dc){_0x3380f8=_0x3380f8-0x0;var _0x534a0b=_0x820c[_0x3380f8];return _0x534a0b;};'use strict';var _=require(_0xc820('0x0'));var util=require(_0xc820('0x1'));var moment=require('moment');var BPromise=require(_0xc820('0x2'));var rs=require(_0xc820('0x3'));var fs=require('fs');var Redis=require(_0xc820('0x4'));var db=require(_0xc820('0x5'))['db'];var utils=require(_0xc820('0x6'));var logger=require(_0xc820('0x7'))(_0xc820('0x8'));var config=require(_0xc820('0x9'));var jayson=require(_0xc820('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x899f64,_0x11c3f7,_0x259cdb){return new BPromise(function(_0x14ef05,_0x521c53){return client[_0xc820('0xb')](_0x899f64,_0x259cdb)[_0xc820('0xc')](function(_0x69504b){logger[_0xc820('0xd')](_0xc820('0xe'),_0x11c3f7,_0xc820('0xf'));logger[_0xc820('0x10')](_0xc820('0x11'),_0x11c3f7,_0xc820('0xf'),JSON[_0xc820('0x12')](_0x69504b));if(_0x69504b[_0xc820('0x13')]){if(_0x69504b[_0xc820('0x13')]['code']===0x1f4){logger[_0xc820('0x13')]('VoiceMail,\x20%s,\x20%s',_0x11c3f7,_0x69504b[_0xc820('0x13')][_0xc820('0x14')]);return _0x521c53(_0x69504b[_0xc820('0x13')][_0xc820('0x14')]);}logger[_0xc820('0x13')](_0xc820('0xe'),_0x11c3f7,_0x69504b[_0xc820('0x13')][_0xc820('0x14')]);return _0x14ef05(_0x69504b[_0xc820('0x13')][_0xc820('0x14')]);}else{logger[_0xc820('0xd')]('VoiceMail,\x20%s,\x20%s',_0x11c3f7,_0xc820('0xf'));_0x14ef05(_0x69504b[_0xc820('0x15')][_0xc820('0x14')]);}})[_0xc820('0x16')](function(_0x12c101){logger[_0xc820('0x13')](_0xc820('0xe'),_0x11c3f7,_0x12c101);_0x521c53(_0x12c101);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index d6da03a..357e69b 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 _0xfb06=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','index','isAuthenticated','/:id/download','download','/:id','update','delete','destroy','exports'];(function(_0x126e25,_0x43059c){var _0x46243f=function(_0x1a50dc){while(--_0x1a50dc){_0x126e25['push'](_0x126e25['shift']());}};_0x46243f(++_0x43059c);}(_0xfb06,0x85));var _0x6fb0=function(_0x13be43,_0x1261e8){_0x13be43=_0x13be43-0x0;var _0x2b5d2f=_0xfb06[_0x13be43];return _0x2b5d2f;};'use strict';var multer=require(_0x6fb0('0x0'));var util=require(_0x6fb0('0x1'));var path=require(_0x6fb0('0x2'));var timeout=require(_0x6fb0('0x3'));var express=require(_0x6fb0('0x4'));var router=express[_0x6fb0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6fb0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6fb0('0x7'));var controller=require(_0x6fb0('0x8'));router[_0x6fb0('0x9')]('/',auth['isAuthenticated'](),controller[_0x6fb0('0xa')]);router[_0x6fb0('0x9')]('/:id',auth[_0x6fb0('0xb')](),controller['show']);router[_0x6fb0('0x9')](_0x6fb0('0xc'),auth['isAuthenticated'](),controller[_0x6fb0('0xd')]);router['post']('/',auth[_0x6fb0('0xb')](),controller['create']);router['put'](_0x6fb0('0xe'),auth['isAuthenticated'](),controller[_0x6fb0('0xf')]);router[_0x6fb0('0x10')]('/:id',auth[_0x6fb0('0xb')](),controller[_0x6fb0('0x11')]);module[_0x6fb0('0x12')]=router; \ No newline at end of file +var _0x241e=['/:id/download','download','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','isAuthenticated','show'];(function(_0x582b0f,_0x35a9de){var _0x4658f0=function(_0x106924){while(--_0x106924){_0x582b0f['push'](_0x582b0f['shift']());}};_0x4658f0(++_0x35a9de);}(_0x241e,0x70));var _0xe241=function(_0x3bfbe0,_0x38fc96){_0x3bfbe0=_0x3bfbe0-0x0;var _0x185aca=_0x241e[_0x3bfbe0];return _0x185aca;};'use strict';var multer=require(_0xe241('0x0'));var util=require(_0xe241('0x1'));var path=require(_0xe241('0x2'));var timeout=require(_0xe241('0x3'));var express=require('express');var router=express[_0xe241('0x4')]();var fs_extra=require(_0xe241('0x5'));var auth=require(_0xe241('0x6'));var interaction=require(_0xe241('0x7'));var config=require(_0xe241('0x8'));var controller=require(_0xe241('0x9'));router[_0xe241('0xa')]('/',auth['isAuthenticated'](),controller[_0xe241('0xb')]);router['get']('/:id',auth[_0xe241('0xc')](),controller[_0xe241('0xd')]);router[_0xe241('0xa')](_0xe241('0xe'),auth[_0xe241('0xc')](),controller[_0xe241('0xf')]);router['post']('/',auth[_0xe241('0xc')](),controller['create']);router[_0xe241('0x10')](_0xe241('0x11'),auth[_0xe241('0xc')](),controller[_0xe241('0x12')]);router[_0xe241('0x13')](_0xe241('0x11'),auth[_0xe241('0xc')](),controller[_0xe241('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f4371b6..0385173 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 _0x99d4=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x57dfdf,_0x2b7fac){var _0x278071=function(_0x1f8521){while(--_0x1f8521){_0x57dfdf['push'](_0x57dfdf['shift']());}};_0x278071(++_0x2b7fac);}(_0x99d4,0x118));var _0x499d=function(_0x2dce7d,_0xdbd6e8){_0x2dce7d=_0x2dce7d-0x0;var _0x2e6f14=_0x99d4[_0x2dce7d];return _0x2e6f14;};'use strict';var Sequelize=require(_0x499d('0x0'));module[_0x499d('0x1')]={'name':{'type':Sequelize[_0x499d('0x2')],'get':function(_0x463605){return this[_0x499d('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x499d('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x499d('0x6')](_0x499d('0x7')),'defaultValue':null},'flag':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x499d('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x499d('0x8')](_0x499d('0x9'))}}; \ No newline at end of file +var _0x0b96=['exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x62386,_0x43c158){var _0x196632=function(_0x20a117){while(--_0x20a117){_0x62386['push'](_0x62386['shift']());}};_0x196632(++_0x43c158);}(_0x0b96,0x1e6));var _0x60b9=function(_0x49ab20,_0x204482){_0x49ab20=_0x49ab20-0x0;var _0x3c10b4=_0x0b96[_0x49ab20];return _0x3c10b4;};'use strict';var Sequelize=require('sequelize');module[_0x60b9('0x0')]={'name':{'type':Sequelize[_0x60b9('0x1')],'get':function(_0x542925){return this[_0x60b9('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x60b9('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x60b9('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x60b9('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x60b9('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x60b9('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x60b9('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x60b9('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x60b9('0x5')](_0x60b9('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x60b9('0x7'),'defaultValue':Sequelize[_0x60b9('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 2473811..4b4150f 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 _0x3255=['pick','filter','merge','includeAll','include','findAll','catch','show','params','find','body','update','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','then','destroy','end','stack','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters'];(function(_0xb57734,_0x1fc1e4){var _0x1e5b7e=function(_0x10eb5f){while(--_0x10eb5f){_0xb57734['push'](_0xb57734['shift']());}};_0x1e5b7e(++_0x1fc1e4);}(_0x3255,0xfe));var _0x5325=function(_0x218f34,_0x86dd36){_0x218f34=_0x218f34-0x0;var _0x3e5238=_0x3255[_0x218f34];return _0x3e5238;};'use strict';var emlformat=require(_0x5325('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5325('0x1'));var jsonpatch=require(_0x5325('0x2'));var rp=require(_0x5325('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5325('0x4'));var util=require('util');var path=require(_0x5325('0x5'));var sox=require('sox');var csv=require(_0x5325('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5325('0x7'));var _=require('lodash');var squel=require(_0x5325('0x8'));var crypto=require(_0x5325('0x9'));var jsforce=require(_0x5325('0xa'));var deskjs=require(_0x5325('0xb'));var toCsv=require(_0x5325('0x6'));var querystring=require('querystring');var Papa=require(_0x5325('0xc'));var Redis=require(_0x5325('0xd'));var authService=require(_0x5325('0xe'));var qs=require(_0x5325('0xf'));var as=require(_0x5325('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5325('0x11'))(_0x5325('0x12'));var utils=require(_0x5325('0x13'));var config=require(_0x5325('0x14'));var licenseUtil=require(_0x5325('0x15'));var db=require(_0x5325('0x16'))['db'];function respondWithStatusCode(_0x4d6cb5,_0x487f69){_0x487f69=_0x487f69||0xcc;return function(_0x40450c){if(_0x40450c){return _0x4d6cb5[_0x5325('0x17')](_0x487f69);}return _0x4d6cb5[_0x5325('0x18')](_0x487f69)['end']();};}function respondWithResult(_0x251cf2,_0x3bb8df){_0x3bb8df=_0x3bb8df||0xc8;return function(_0x737697){if(_0x737697){return _0x251cf2[_0x5325('0x18')](_0x3bb8df)[_0x5325('0x19')](_0x737697);}};}function respondWithFilteredResult(_0x4add21,_0x27f588){return function(_0x3a3934){if(_0x3a3934){var _0x77a35f=typeof _0x27f588['offset']==='undefined'&&typeof _0x27f588[_0x5325('0x1a')]===_0x5325('0x1b');var _0x3319ca=_0x3a3934[_0x5325('0x1c')];var _0x4317e9=_0x77a35f?0x0:_0x27f588[_0x5325('0x1d')];var _0x368305=_0x77a35f?_0x3a3934[_0x5325('0x1c')]:_0x27f588[_0x5325('0x1d')]+_0x27f588['limit'];var _0x38ca6e;if(_0x368305>=_0x3319ca){_0x368305=_0x3319ca;_0x38ca6e=0xc8;}else{_0x38ca6e=0xce;}_0x4add21['status'](_0x38ca6e);return _0x4add21[_0x5325('0x1e')](_0x5325('0x1f'),_0x4317e9+'-'+_0x368305+'/'+_0x3319ca)[_0x5325('0x19')](_0x3a3934);}return null;};}function patchUpdates(_0x2f6feb){return function(_0x3670e9){try{jsonpatch[_0x5325('0x20')](_0x3670e9,_0x2f6feb,!![]);}catch(_0x4e1a22){return BPromise['reject'](_0x4e1a22);}return _0x3670e9['save']();};}function saveUpdates(_0x15407d,_0x5caea7){return function(_0x3368a6){if(_0x3368a6){return _0x3368a6['update'](_0x15407d)[_0x5325('0x21')](function(_0x13f382){return _0x13f382;});}return null;};}function removeEntity(_0x42c256,_0x1efe8f){return function(_0x221670){if(_0x221670){return _0x221670[_0x5325('0x22')]()[_0x5325('0x21')](function(){_0x42c256[_0x5325('0x18')](0xcc)[_0x5325('0x23')]();});}};}function handleEntityNotFound(_0x4b1525,_0x24b8f9){return function(_0x366671){if(!_0x366671){_0x4b1525[_0x5325('0x17')](0x194);}return _0x366671;};}function handleError(_0xf7e7d4,_0x4393df){_0x4393df=_0x4393df||0x1f4;return function(_0x4364da){logger['error'](_0x4364da[_0x5325('0x24')]);if(_0x4364da[_0x5325('0x25')]){delete _0x4364da['name'];}_0xf7e7d4[_0x5325('0x18')](_0x4393df)[_0x5325('0x26')](_0x4364da);};}exports[_0x5325('0x27')]=function(_0x2cebca,_0x3d74af){var _0x2027d3={},_0x220b9d={},_0x5dd8fc={'count':0x0,'rows':[]};var _0x422f8c=_['map'](db[_0x5325('0x28')][_0x5325('0x29')],function(_0x537d84){return{'name':_0x537d84[_0x5325('0x2a')],'type':_0x537d84[_0x5325('0x2b')]['key']};});_0x220b9d[_0x5325('0x2c')]=_[_0x5325('0x2d')](_[_0x5325('0x2e')](_0x422f8c,_0x5325('0x25')),[_0x5325('0x25')]);_0x220b9d[_0x5325('0x2f')]=_[_0x5325('0x30')](_0x2cebca[_0x5325('0x2f')]);_0x220b9d['filters']=_[_0x5325('0x31')](_0x220b9d[_0x5325('0x2c')],_0x220b9d[_0x5325('0x2f')]);_0x2027d3['attributes']=_[_0x5325('0x31')](_0x220b9d[_0x5325('0x2c')],qs[_0x5325('0x32')](_0x2cebca['query'][_0x5325('0x32')]));_0x2027d3[_0x5325('0x33')]=_0x2027d3[_0x5325('0x33')][_0x5325('0x34')]?_0x2027d3['attributes']:_0x220b9d[_0x5325('0x2c')];if(!_0x2cebca['query']['hasOwnProperty'](_0x5325('0x35'))){_0x2027d3['limit']=qs[_0x5325('0x1a')](_0x2cebca[_0x5325('0x2f')][_0x5325('0x1a')]);_0x2027d3[_0x5325('0x1d')]=qs[_0x5325('0x1d')](_0x2cebca['query'][_0x5325('0x1d')]);}_0x2027d3[_0x5325('0x36')]=qs[_0x5325('0x37')](_0x2cebca['query'][_0x5325('0x37')]);_0x2027d3[_0x5325('0x38')]=qs[_0x5325('0x39')](_[_0x5325('0x3a')](_0x2cebca[_0x5325('0x2f')],_0x220b9d[_0x5325('0x39')]),_0x422f8c);if(_0x2cebca[_0x5325('0x2f')][_0x5325('0x3b')]){_0x2027d3['where']=_[_0x5325('0x3c')](_0x2027d3['where'],{'$or':_[_0x5325('0x2e')](_0x422f8c,function(_0x312192){if(_0x312192[_0x5325('0x2b')]!=='VIRTUAL'){var _0x2f6035={};_0x2f6035[_0x312192[_0x5325('0x25')]]={'$like':'%'+_0x2cebca[_0x5325('0x2f')]['filter']+'%'};return _0x2f6035;}})});}_0x2027d3=_['merge']({},_0x2027d3,_0x2cebca['options']);var _0x3e6052={'where':_0x2027d3[_0x5325('0x38')]};return db[_0x5325('0x28')][_0x5325('0x1c')](_0x3e6052)[_0x5325('0x21')](function(_0x231670){_0x5dd8fc['count']=_0x231670;if(_0x2cebca[_0x5325('0x2f')][_0x5325('0x3d')]){_0x2027d3[_0x5325('0x3e')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x5325('0x3f')](_0x2027d3);})[_0x5325('0x21')](function(_0x2717fd){_0x5dd8fc['rows']=_0x2717fd;return _0x5dd8fc;})[_0x5325('0x21')](respondWithFilteredResult(_0x3d74af,_0x2027d3))[_0x5325('0x40')](handleError(_0x3d74af,null));};exports[_0x5325('0x41')]=function(_0x23f69a,_0xf4917b){var _0xd23d9d={'raw':!![],'where':{'id':_0x23f69a[_0x5325('0x42')]['id']}},_0x325880={};_0x325880[_0x5325('0x2c')]=_[_0x5325('0x30')](db['VoiceMailMessage'][_0x5325('0x29')]);_0x325880[_0x5325('0x2f')]=_[_0x5325('0x30')](_0x23f69a['query']);_0x325880[_0x5325('0x39')]=_[_0x5325('0x31')](_0x325880[_0x5325('0x2c')],_0x325880['query']);_0xd23d9d[_0x5325('0x33')]=_[_0x5325('0x31')](_0x325880[_0x5325('0x2c')],qs[_0x5325('0x32')](_0x23f69a[_0x5325('0x2f')][_0x5325('0x32')]));_0xd23d9d['attributes']=_0xd23d9d[_0x5325('0x33')]['length']?_0xd23d9d['attributes']:_0x325880[_0x5325('0x2c')];if(_0x23f69a[_0x5325('0x2f')][_0x5325('0x3d')]){_0xd23d9d['include']=[{'all':!![]}];}_0xd23d9d=_[_0x5325('0x3c')]({},_0xd23d9d,_0x23f69a['options']);return db['VoiceMailMessage'][_0x5325('0x43')](_0xd23d9d)[_0x5325('0x21')](handleEntityNotFound(_0xf4917b,null))[_0x5325('0x21')](respondWithResult(_0xf4917b,null))[_0x5325('0x40')](handleError(_0xf4917b,null));};exports['create']=function(_0x5350e2,_0x58bf0d){return db[_0x5325('0x28')]['create'](_0x5350e2[_0x5325('0x44')],{})[_0x5325('0x21')](respondWithResult(_0x58bf0d,0xc9))[_0x5325('0x40')](handleError(_0x58bf0d,null));};exports[_0x5325('0x45')]=function(_0x9b5e5d,_0x457f3a){if(_0x9b5e5d[_0x5325('0x44')]['id']){delete _0x9b5e5d[_0x5325('0x44')]['id'];}return db['VoiceMailMessage'][_0x5325('0x43')]({'where':{'id':_0x9b5e5d[_0x5325('0x42')]['id']}})['then'](handleEntityNotFound(_0x457f3a,null))['then'](saveUpdates(_0x9b5e5d[_0x5325('0x44')],null))[_0x5325('0x21')](respondWithResult(_0x457f3a,null))[_0x5325('0x40')](handleError(_0x457f3a,null));};exports[_0x5325('0x22')]=function(_0xb6c653,_0x3a0922){return db[_0x5325('0x28')]['find']({'where':{'id':_0xb6c653[_0x5325('0x42')]['id']}})[_0x5325('0x21')](handleEntityNotFound(_0x3a0922,null))[_0x5325('0x21')](removeEntity(_0x3a0922,null))[_0x5325('0x40')](handleError(_0x3a0922,null));};exports['download']=function(_0x503128,_0xae8991,_0x2b3bfb){return db['VoiceMailMessage'][_0x5325('0x43')]({'where':{'id':_0x503128['params']['id']},'attributes':['id',_0x5325('0x46'),'msg_id']})['then'](handleEntityNotFound(_0xae8991,null))['then'](function(_0xa0097e){if(_0xa0097e){if(!_0xa0097e[_0x5325('0x46')]){throw new db[(_0x5325('0x47'))][(_0x5325('0x48'))](_0x5325('0x49'));}var _0x974d14={'Content-Type':_0x5325('0x4a'),'Content-Disposition':_0x5325('0x4b')};if(_0xa0097e[_0x5325('0x4c')]){_0x974d14['Content-Disposition']='attachment;\x20filename=\x22'+_0xa0097e[_0x5325('0x4c')]+_0x5325('0x4d');}_0xae8991[_0x5325('0x1e')](_0x974d14);return _0xae8991[_0x5325('0x26')](new Buffer(_0xa0097e['recording']));}})['catch'](handleError(_0xae8991,null));}; \ No newline at end of file +var _0x3296=['crypto','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','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','params','include','find','catch','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x35a632,_0x5a944b){var _0x5cc2dc=function(_0x3b7982){while(--_0x3b7982){_0x35a632['push'](_0x35a632['shift']());}};_0x5cc2dc(++_0x5a944b);}(_0x3296,0x9c));var _0x6329=function(_0x90a39a,_0x32020d){_0x90a39a=_0x90a39a-0x0;var _0x2b62f7=_0x3296[_0x90a39a];return _0x2b62f7;};'use strict';var emlformat=require(_0x6329('0x0'));var rimraf=require(_0x6329('0x1'));var zipdir=require(_0x6329('0x2'));var jsonpatch=require(_0x6329('0x3'));var rp=require('request-promise');var moment=require(_0x6329('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6329('0x5'));var util=require(_0x6329('0x6'));var path=require(_0x6329('0x7'));var sox=require(_0x6329('0x8'));var csv=require(_0x6329('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6329('0xa'));var _=require('lodash');var squel=require(_0x6329('0xb'));var crypto=require(_0x6329('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6329('0x9'));var querystring=require('querystring');var Papa=require(_0x6329('0xd'));var Redis=require(_0x6329('0xe'));var authService=require(_0x6329('0xf'));var qs=require(_0x6329('0x10'));var as=require(_0x6329('0x11'));var hardwareService=require(_0x6329('0x12'));var logger=require(_0x6329('0x13'))(_0x6329('0x14'));var utils=require(_0x6329('0x15'));var config=require(_0x6329('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6329('0x17'))['db'];function respondWithStatusCode(_0x43a6e7,_0x3bc5b3){_0x3bc5b3=_0x3bc5b3||0xcc;return function(_0x7d752){if(_0x7d752){return _0x43a6e7[_0x6329('0x18')](_0x3bc5b3);}return _0x43a6e7['status'](_0x3bc5b3)['end']();};}function respondWithResult(_0x1faf26,_0xdcd2fd){_0xdcd2fd=_0xdcd2fd||0xc8;return function(_0x2046bc){if(_0x2046bc){return _0x1faf26[_0x6329('0x19')](_0xdcd2fd)[_0x6329('0x1a')](_0x2046bc);}};}function respondWithFilteredResult(_0x26037f,_0x30cb87){return function(_0x2f35e4){if(_0x2f35e4){var _0x11cf10=typeof _0x30cb87[_0x6329('0x1b')]===_0x6329('0x1c')&&typeof _0x30cb87['limit']===_0x6329('0x1c');var _0x1a9283=_0x2f35e4[_0x6329('0x1d')];var _0x126b22=_0x11cf10?0x0:_0x30cb87[_0x6329('0x1b')];var _0x826b6a=_0x11cf10?_0x2f35e4[_0x6329('0x1d')]:_0x30cb87[_0x6329('0x1b')]+_0x30cb87[_0x6329('0x1e')];var _0x3a052d;if(_0x826b6a>=_0x1a9283){_0x826b6a=_0x1a9283;_0x3a052d=0xc8;}else{_0x3a052d=0xce;}_0x26037f[_0x6329('0x19')](_0x3a052d);return _0x26037f[_0x6329('0x1f')](_0x6329('0x20'),_0x126b22+'-'+_0x826b6a+'/'+_0x1a9283)[_0x6329('0x1a')](_0x2f35e4);}return null;};}function patchUpdates(_0x3be1bd){return function(_0x2c5eb7){try{jsonpatch[_0x6329('0x21')](_0x2c5eb7,_0x3be1bd,!![]);}catch(_0x280f7f){return BPromise[_0x6329('0x22')](_0x280f7f);}return _0x2c5eb7[_0x6329('0x23')]();};}function saveUpdates(_0x26f4f2,_0xa72f40){return function(_0x310ab2){if(_0x310ab2){return _0x310ab2[_0x6329('0x24')](_0x26f4f2)['then'](function(_0x51df3c){return _0x51df3c;});}return null;};}function removeEntity(_0x50b1ac,_0x1d71dd){return function(_0x2e5174){if(_0x2e5174){return _0x2e5174[_0x6329('0x25')]()[_0x6329('0x26')](function(){_0x50b1ac[_0x6329('0x19')](0xcc)[_0x6329('0x27')]();});}};}function handleEntityNotFound(_0x2ef972,_0x15d8df){return function(_0x38b49a){if(!_0x38b49a){_0x2ef972[_0x6329('0x18')](0x194);}return _0x38b49a;};}function handleError(_0x5f7ffd,_0x1a110b){_0x1a110b=_0x1a110b||0x1f4;return function(_0x274331){logger[_0x6329('0x28')](_0x274331['stack']);if(_0x274331[_0x6329('0x29')]){delete _0x274331[_0x6329('0x29')];}_0x5f7ffd[_0x6329('0x19')](_0x1a110b)[_0x6329('0x2a')](_0x274331);};}exports[_0x6329('0x2b')]=function(_0x4dc889,_0xdde5d6){var _0x51e6a1={},_0x2c8944={},_0x2ff9a1={'count':0x0,'rows':[]};var _0x1b50fa=_[_0x6329('0x2c')](db[_0x6329('0x2d')]['rawAttributes'],function(_0x36abcb){return{'name':_0x36abcb[_0x6329('0x2e')],'type':_0x36abcb[_0x6329('0x2f')][_0x6329('0x30')]};});_0x2c8944['model']=_[_0x6329('0x31')](_[_0x6329('0x2c')](_0x1b50fa,'name'),['name']);_0x2c8944[_0x6329('0x32')]=_[_0x6329('0x33')](_0x4dc889[_0x6329('0x32')]);_0x2c8944['filters']=_[_0x6329('0x34')](_0x2c8944[_0x6329('0x35')],_0x2c8944[_0x6329('0x32')]);_0x51e6a1['attributes']=_[_0x6329('0x34')](_0x2c8944[_0x6329('0x35')],qs[_0x6329('0x36')](_0x4dc889['query']['fields']));_0x51e6a1['attributes']=_0x51e6a1[_0x6329('0x37')][_0x6329('0x38')]?_0x51e6a1[_0x6329('0x37')]:_0x2c8944[_0x6329('0x35')];if(!_0x4dc889[_0x6329('0x32')][_0x6329('0x39')](_0x6329('0x3a'))){_0x51e6a1[_0x6329('0x1e')]=qs[_0x6329('0x1e')](_0x4dc889['query'][_0x6329('0x1e')]);_0x51e6a1[_0x6329('0x1b')]=qs[_0x6329('0x1b')](_0x4dc889[_0x6329('0x32')][_0x6329('0x1b')]);}_0x51e6a1[_0x6329('0x3b')]=qs[_0x6329('0x3c')](_0x4dc889['query'][_0x6329('0x3c')]);_0x51e6a1[_0x6329('0x3d')]=qs['filters'](_[_0x6329('0x3e')](_0x4dc889['query'],_0x2c8944['filters']),_0x1b50fa);if(_0x4dc889[_0x6329('0x32')][_0x6329('0x3f')]){_0x51e6a1[_0x6329('0x3d')]=_[_0x6329('0x40')](_0x51e6a1[_0x6329('0x3d')],{'$or':_[_0x6329('0x2c')](_0x1b50fa,function(_0x1d4646){if(_0x1d4646[_0x6329('0x2f')]!=='VIRTUAL'){var _0x44a08f={};_0x44a08f[_0x1d4646[_0x6329('0x29')]]={'$like':'%'+_0x4dc889[_0x6329('0x32')][_0x6329('0x3f')]+'%'};return _0x44a08f;}})});}_0x51e6a1=_[_0x6329('0x40')]({},_0x51e6a1,_0x4dc889[_0x6329('0x41')]);var _0x5bdad7={'where':_0x51e6a1['where']};return db[_0x6329('0x2d')][_0x6329('0x1d')](_0x5bdad7)['then'](function(_0x573635){_0x2ff9a1['count']=_0x573635;if(_0x4dc889[_0x6329('0x32')][_0x6329('0x42')]){_0x51e6a1['include']=[{'all':!![]}];}return db[_0x6329('0x2d')][_0x6329('0x43')](_0x51e6a1);})[_0x6329('0x26')](function(_0x4d07d2){_0x2ff9a1[_0x6329('0x44')]=_0x4d07d2;return _0x2ff9a1;})['then'](respondWithFilteredResult(_0xdde5d6,_0x51e6a1))['catch'](handleError(_0xdde5d6,null));};exports['show']=function(_0xb6cc4b,_0x37e26d){var _0x2ac4ce={'raw':!![],'where':{'id':_0xb6cc4b[_0x6329('0x45')]['id']}},_0x3d3331={};_0x3d3331['model']=_[_0x6329('0x33')](db[_0x6329('0x2d')]['rawAttributes']);_0x3d3331[_0x6329('0x32')]=_[_0x6329('0x33')](_0xb6cc4b[_0x6329('0x32')]);_0x3d3331['filters']=_[_0x6329('0x34')](_0x3d3331['model'],_0x3d3331[_0x6329('0x32')]);_0x2ac4ce[_0x6329('0x37')]=_[_0x6329('0x34')](_0x3d3331[_0x6329('0x35')],qs['fields'](_0xb6cc4b[_0x6329('0x32')][_0x6329('0x36')]));_0x2ac4ce[_0x6329('0x37')]=_0x2ac4ce[_0x6329('0x37')][_0x6329('0x38')]?_0x2ac4ce[_0x6329('0x37')]:_0x3d3331[_0x6329('0x35')];if(_0xb6cc4b[_0x6329('0x32')][_0x6329('0x42')]){_0x2ac4ce[_0x6329('0x46')]=[{'all':!![]}];}_0x2ac4ce=_[_0x6329('0x40')]({},_0x2ac4ce,_0xb6cc4b[_0x6329('0x41')]);return db[_0x6329('0x2d')][_0x6329('0x47')](_0x2ac4ce)[_0x6329('0x26')](handleEntityNotFound(_0x37e26d,null))[_0x6329('0x26')](respondWithResult(_0x37e26d,null))[_0x6329('0x48')](handleError(_0x37e26d,null));};exports[_0x6329('0x49')]=function(_0x38cf25,_0x59a321){return db['VoiceMailMessage']['create'](_0x38cf25['body'],{})[_0x6329('0x26')](respondWithResult(_0x59a321,0xc9))[_0x6329('0x48')](handleError(_0x59a321,null));};exports[_0x6329('0x24')]=function(_0x10f313,_0x528843){if(_0x10f313['body']['id']){delete _0x10f313[_0x6329('0x4a')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x10f313[_0x6329('0x45')]['id']}})['then'](handleEntityNotFound(_0x528843,null))[_0x6329('0x26')](saveUpdates(_0x10f313['body'],null))['then'](respondWithResult(_0x528843,null))['catch'](handleError(_0x528843,null));};exports[_0x6329('0x25')]=function(_0x2948ca,_0xb73ebe){return db[_0x6329('0x2d')][_0x6329('0x47')]({'where':{'id':_0x2948ca[_0x6329('0x45')]['id']}})[_0x6329('0x26')](handleEntityNotFound(_0xb73ebe,null))['then'](removeEntity(_0xb73ebe,null))['catch'](handleError(_0xb73ebe,null));};exports[_0x6329('0x4b')]=function(_0x391036,_0x27e7d8,_0x1cb7a2){return db[_0x6329('0x2d')][_0x6329('0x47')]({'where':{'id':_0x391036[_0x6329('0x45')]['id']},'attributes':['id',_0x6329('0x4c'),'msg_id']})['then'](handleEntityNotFound(_0x27e7d8,null))[_0x6329('0x26')](function(_0x1329b0){if(_0x1329b0){if(!_0x1329b0[_0x6329('0x4c')]){throw new db[(_0x6329('0x4d'))][(_0x6329('0x4e'))](_0x6329('0x4f'));}var _0x429c77={'Content-Type':_0x6329('0x50'),'Content-Disposition':_0x6329('0x51')};if(_0x1329b0[_0x6329('0x52')]){_0x429c77['Content-Disposition']='attachment;\x20filename=\x22'+_0x1329b0[_0x6329('0x52')]+_0x6329('0x53');}_0x27e7d8[_0x6329('0x1f')](_0x429c77);return _0x27e7d8[_0x6329('0x2a')](new Buffer(_0x1329b0[_0x6329('0x4c')]));}})[_0x6329('0x48')](handleError(_0x27e7d8,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4560729..642b9d0 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 _0x6d0c=['voice_voicemail_messages','dir','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x843708,_0x501446){var _0x24f2dd=function(_0x12f8ba){while(--_0x12f8ba){_0x843708['push'](_0x843708['shift']());}};_0x24f2dd(++_0x501446);}(_0x6d0c,0x1e3));var _0xc6d0=function(_0x517c82,_0x33c532){_0x517c82=_0x517c82-0x0;var _0x3be9a9=_0x6d0c[_0x517c82];return _0x3be9a9;};'use strict';var _=require(_0xc6d0('0x0'));var util=require(_0xc6d0('0x1'));var logger=require(_0xc6d0('0x2'))(_0xc6d0('0x3'));var moment=require('moment');var BPromise=require(_0xc6d0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6d0('0x5'));var rimraf=require('rimraf');var config=require(_0xc6d0('0x6'));var attributes=require(_0xc6d0('0x7'));module[_0xc6d0('0x8')]=function(_0x3c0356,_0x2fc793){return _0x3c0356[_0xc6d0('0x9')](_0xc6d0('0xa'),attributes,{'tableName':_0xc6d0('0xb'),'paranoid':![],'indexes':[{'name':_0xc6d0('0xc'),'fields':[_0xc6d0('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4b34=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash','util'];(function(_0x2ddccf,_0x4e42e7){var _0x40d7e6=function(_0x5da8e3){while(--_0x5da8e3){_0x2ddccf['push'](_0x2ddccf['shift']());}};_0x40d7e6(++_0x4e42e7);}(_0x4b34,0x15d));var _0x44b3=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x4b34[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x44b3('0x0'));var util=require(_0x44b3('0x1'));var logger=require(_0x44b3('0x2'))(_0x44b3('0x3'));var moment=require(_0x44b3('0x4'));var BPromise=require(_0x44b3('0x5'));var rp=require(_0x44b3('0x6'));var fs=require('fs');var path=require(_0x44b3('0x7'));var rimraf=require(_0x44b3('0x8'));var config=require('../../config/environment');var attributes=require(_0x44b3('0x9'));module['exports']=function(_0x152375,_0x20282c){return _0x152375[_0x44b3('0xa')](_0x44b3('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x44b3('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index f027216..ea457e5 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 _0x2913=['http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x2913,0xd3));var _0x3291=function(_0x5a836c,_0x408add){_0x5a836c=_0x5a836c-0x0;var _0x322cbb=_0x2913[_0x5a836c];return _0x322cbb;};'use strict';var _=require('lodash');var util=require(_0x3291('0x0'));var moment=require('moment');var BPromise=require(_0x3291('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3291('0x2'))['db'];var utils=require(_0x3291('0x3'));var logger=require(_0x3291('0x4'))(_0x3291('0x5'));var config=require(_0x3291('0x6'));var jayson=require(_0x3291('0x7'));var client=jayson[_0x3291('0x8')][_0x3291('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a6089,_0x1c34dd,_0x528b62){return new BPromise(function(_0x51344c,_0x5b860f){return client[_0x3291('0xa')](_0x5a6089,_0x528b62)[_0x3291('0xb')](function(_0x525630){logger[_0x3291('0xc')](_0x3291('0xd'),_0x1c34dd,_0x3291('0xe'));logger[_0x3291('0xf')](_0x3291('0x10'),_0x1c34dd,_0x3291('0xe'),JSON['stringify'](_0x525630));if(_0x525630[_0x3291('0x11')]){if(_0x525630[_0x3291('0x11')][_0x3291('0x12')]===0x1f4){logger['error'](_0x3291('0xd'),_0x1c34dd,_0x525630[_0x3291('0x11')]['message']);return _0x5b860f(_0x525630['error'][_0x3291('0x13')]);}logger[_0x3291('0x11')](_0x3291('0xd'),_0x1c34dd,_0x525630[_0x3291('0x11')][_0x3291('0x13')]);return _0x51344c(_0x525630[_0x3291('0x11')]['message']);}else{logger['info'](_0x3291('0xd'),_0x1c34dd,_0x3291('0xe'));_0x51344c(_0x525630[_0x3291('0x14')][_0x3291('0x13')]);}})[_0x3291('0x15')](function(_0x449d78){logger['error'](_0x3291('0xd'),_0x1c34dd,_0x449d78);_0x5b860f(_0x449d78);});});} \ No newline at end of file +var _0x466d=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','code','VoiceMailMessage,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils'];(function(_0x3bbb40,_0x57bf4c){var _0x374d49=function(_0x1f29ee){while(--_0x1f29ee){_0x3bbb40['push'](_0x3bbb40['shift']());}};_0x374d49(++_0x57bf4c);}(_0x466d,0x1b4));var _0xd466=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0x466d[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0xd466('0x0'));var util=require(_0xd466('0x1'));var moment=require(_0xd466('0x2'));var BPromise=require('bluebird');var rs=require(_0xd466('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd466('0x4'));var logger=require(_0xd466('0x5'))(_0xd466('0x6'));var config=require(_0xd466('0x7'));var jayson=require(_0xd466('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4fa0c2,_0x3ec5a7,_0x1079bc){return new BPromise(function(_0x12aaa4,_0x23f9f7){return client[_0xd466('0x9')](_0x4fa0c2,_0x1079bc)[_0xd466('0xa')](function(_0x1bea40){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x3ec5a7,_0xd466('0xb'));logger[_0xd466('0xc')](_0xd466('0xd'),_0x3ec5a7,_0xd466('0xb'),JSON['stringify'](_0x1bea40));if(_0x1bea40['error']){if(_0x1bea40['error'][_0xd466('0xe')]===0x1f4){logger['error'](_0xd466('0xf'),_0x3ec5a7,_0x1bea40['error']['message']);return _0x23f9f7(_0x1bea40[_0xd466('0x10')][_0xd466('0x11')]);}logger[_0xd466('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x3ec5a7,_0x1bea40[_0xd466('0x10')][_0xd466('0x11')]);return _0x12aaa4(_0x1bea40[_0xd466('0x10')]['message']);}else{logger[_0xd466('0x12')](_0xd466('0xf'),_0x3ec5a7,_0xd466('0xb'));_0x12aaa4(_0x1bea40[_0xd466('0x13')][_0xd466('0x11')]);}})[_0xd466('0x14')](function(_0x352cd5){logger[_0xd466('0x10')](_0xd466('0xf'),_0x3ec5a7,_0x352cd5);_0x23f9f7(_0x352cd5);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 4c1e157..7bb0aa8 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 _0xf098=['put','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','addSound'];(function(_0xa97e6,_0x12528d){var _0x51bd72=function(_0x3bfcbc){while(--_0x3bfcbc){_0xa97e6['push'](_0xa97e6['shift']());}};_0x51bd72(++_0x12528d);}(_0xf098,0x18d));var _0x8f09=function(_0x5efc22,_0x34a5bd){_0x5efc22=_0x5efc22-0x0;var _0x542008=_0xf098[_0x5efc22];return _0x542008;};'use strict';var multer=require(_0x8f09('0x0'));var util=require(_0x8f09('0x1'));var path=require(_0x8f09('0x2'));var timeout=require(_0x8f09('0x3'));var express=require(_0x8f09('0x4'));var router=express['Router']();var fs_extra=require(_0x8f09('0x5'));var auth=require(_0x8f09('0x6'));var interaction=require(_0x8f09('0x7'));var config=require(_0x8f09('0x8'));var controller=require('./voiceMusicOnHold.controller');router[_0x8f09('0x9')]('/',auth[_0x8f09('0xa')](),controller[_0x8f09('0xb')]);router[_0x8f09('0x9')](_0x8f09('0xc'),auth[_0x8f09('0xa')](),controller['show']);router[_0x8f09('0x9')](_0x8f09('0xd'),auth[_0x8f09('0xa')](),controller[_0x8f09('0xe')]);router['post']('/',auth[_0x8f09('0xa')](),controller['create']);router[_0x8f09('0xf')](_0x8f09('0xd'),auth[_0x8f09('0xa')](),controller[_0x8f09('0x10')]);router[_0x8f09('0x11')](_0x8f09('0xc'),auth[_0x8f09('0xa')](),controller[_0x8f09('0x12')]);router[_0x8f09('0x13')](_0x8f09('0xc'),auth['isAuthenticated'](),controller[_0x8f09('0x14')]);router['delete']('/:id/sounds/:id2',auth[_0x8f09('0xa')](),controller[_0x8f09('0x15')]);module[_0x8f09('0x16')]=router; \ No newline at end of file +var _0x7226=['delete','destroy','/:id/sounds/:id2','removeSound','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','show','getSounds','post','create','put','update'];(function(_0xbd18d4,_0x112df4){var _0xec2e4a=function(_0x451491){while(--_0x451491){_0xbd18d4['push'](_0xbd18d4['shift']());}};_0xec2e4a(++_0x112df4);}(_0x7226,0x14e));var _0x6722=function(_0x33319a,_0x3fb700){_0x33319a=_0x33319a-0x0;var _0x333b15=_0x7226[_0x33319a];return _0x333b15;};'use strict';var multer=require(_0x6722('0x0'));var util=require('util');var path=require(_0x6722('0x1'));var timeout=require(_0x6722('0x2'));var express=require(_0x6722('0x3'));var router=express[_0x6722('0x4')]();var fs_extra=require(_0x6722('0x5'));var auth=require(_0x6722('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6722('0x7'));var controller=require(_0x6722('0x8'));router[_0x6722('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6722('0x9')](_0x6722('0xa'),auth[_0x6722('0xb')](),controller[_0x6722('0xc')]);router[_0x6722('0x9')]('/:id/sounds',auth[_0x6722('0xb')](),controller[_0x6722('0xd')]);router[_0x6722('0xe')]('/',auth['isAuthenticated'](),controller[_0x6722('0xf')]);router[_0x6722('0xe')]('/:id/sounds',auth[_0x6722('0xb')](),controller['addSound']);router[_0x6722('0x10')](_0x6722('0xa'),auth[_0x6722('0xb')](),controller[_0x6722('0x11')]);router[_0x6722('0x12')](_0x6722('0xa'),auth[_0x6722('0xb')](),controller[_0x6722('0x13')]);router[_0x6722('0x12')](_0x6722('0x14'),auth['isAuthenticated'](),controller[_0x6722('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 2443f86..f62866d 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 _0x0867=['mp3','TIMESTAMP','sequelize','exports','STRING','ENUM','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x165763,_0x2f3ab3){var _0x13d012=function(_0x3dfee3){while(--_0x3dfee3){_0x165763['push'](_0x165763['shift']());}};_0x13d012(++_0x2f3ab3);}(_0x0867,0x192));var _0x7086=function(_0x4a70d7,_0x90108e){_0x4a70d7=_0x4a70d7-0x0;var _0x4eb51b=_0x0867[_0x4a70d7];return _0x4eb51b;};'use strict';var Sequelize=require(_0x7086('0x0'));module[_0x7086('0x1')]={'name':{'type':Sequelize[_0x7086('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x7086('0x3')]('custom',_0x7086('0x4'),_0x7086('0x5'),_0x7086('0x6'),_0x7086('0x7'),_0x7086('0x8')),'allowNull':!![],'defaultValue':_0x7086('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x7086('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7086('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7086('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x7086('0x2')],'allowNull':!![]},'stamp':{'type':_0x7086('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x812c=['mp3nb','quietmp3nb','quietmp3','mp3','STRING','alpha','TIMESTAMP','sequelize','exports','name','ENUM','files'];(function(_0x4eacb1,_0x548d2e){var _0x21355f=function(_0x5c8640){while(--_0x5c8640){_0x4eacb1['push'](_0x4eacb1['shift']());}};_0x21355f(++_0x548d2e);}(_0x812c,0x1e7));var _0xc812=function(_0x2e47c1,_0x1bed12){_0x2e47c1=_0x2e47c1-0x0;var _0x1a0364=_0x812c[_0x2e47c1];return _0x1a0364;};'use strict';var Sequelize=require(_0xc812('0x0'));module[_0xc812('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc812('0x2')},'mode':{'type':Sequelize[_0xc812('0x3')]('custom',_0xc812('0x4'),_0xc812('0x5'),_0xc812('0x6'),_0xc812('0x7'),_0xc812('0x8')),'allowNull':!![],'defaultValue':_0xc812('0x4')},'directory':{'type':Sequelize[_0xc812('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xc812('0x9')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xc812('0x9')],'allowNull':!![],'defaultValue':_0xc812('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xc812('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index f637bca..673ed6e 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 _0x9a50=['includeAll','include','findAll','rows','catch','params','fields','update','body','find','sequelize','transaction','files','join','mode','mkdirSync','directory','0777','get','role','user','UserProfileSection','userProfileId','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','basename','extname','server/files/moh','removeSound','id2','%s.%s','getSounds','map','options','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x318a51,_0x125540){var _0x453920=function(_0x29ac77){while(--_0x29ac77){_0x318a51['push'](_0x318a51['shift']());}};_0x453920(++_0x125540);}(_0x9a50,0x1de));var _0x09a5=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0x9a50[_0x3ec122];return _0x4ecf41;};'use strict';var emlformat=require(_0x09a5('0x0'));var rimraf=require(_0x09a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09a5('0x2'));var moment=require(_0x09a5('0x3'));var BPromise=require(_0x09a5('0x4'));var Mustache=require('mustache');var util=require(_0x09a5('0x5'));var path=require(_0x09a5('0x6'));var sox=require(_0x09a5('0x7'));var csv=require('to-csv');var ejs=require(_0x09a5('0x8'));var fs=require('fs');var fs_extra=require(_0x09a5('0x9'));var _=require(_0x09a5('0xa'));var squel=require('squel');var crypto=require(_0x09a5('0xb'));var jsforce=require(_0x09a5('0xc'));var deskjs=require(_0x09a5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09a5('0xe'));var Papa=require(_0x09a5('0xf'));var Redis=require(_0x09a5('0x10'));var authService=require(_0x09a5('0x11'));var qs=require(_0x09a5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x09a5('0x13'))(_0x09a5('0x14'));var utils=require(_0x09a5('0x15'));var config=require(_0x09a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x342dba,_0x229250){_0x229250=_0x229250||0xcc;return function(_0x4d2d6a){if(_0x4d2d6a){return _0x342dba[_0x09a5('0x17')](_0x229250);}return _0x342dba[_0x09a5('0x18')](_0x229250)[_0x09a5('0x19')]();};}function respondWithResult(_0xd590ac,_0x3559f8){_0x3559f8=_0x3559f8||0xc8;return function(_0x30ab59){if(_0x30ab59){return _0xd590ac[_0x09a5('0x18')](_0x3559f8)[_0x09a5('0x1a')](_0x30ab59);}};}function respondWithFilteredResult(_0x226393,_0x4d03db){return function(_0x25cc3d){if(_0x25cc3d){var _0x2588f0=typeof _0x4d03db[_0x09a5('0x1b')]===_0x09a5('0x1c')&&typeof _0x4d03db[_0x09a5('0x1d')]===_0x09a5('0x1c');var _0x1cc8ca=_0x25cc3d[_0x09a5('0x1e')];var _0x7b98ea=_0x2588f0?0x0:_0x4d03db['offset'];var _0x302e41=_0x2588f0?_0x25cc3d[_0x09a5('0x1e')]:_0x4d03db[_0x09a5('0x1b')]+_0x4d03db[_0x09a5('0x1d')];var _0x2f30cc;if(_0x302e41>=_0x1cc8ca){_0x302e41=_0x1cc8ca;_0x2f30cc=0xc8;}else{_0x2f30cc=0xce;}_0x226393[_0x09a5('0x18')](_0x2f30cc);return _0x226393[_0x09a5('0x1f')](_0x09a5('0x20'),_0x7b98ea+'-'+_0x302e41+'/'+_0x1cc8ca)[_0x09a5('0x1a')](_0x25cc3d);}return null;};}function patchUpdates(_0x5c13c1){return function(_0x113d02){try{jsonpatch[_0x09a5('0x21')](_0x113d02,_0x5c13c1,!![]);}catch(_0x2c725e){return BPromise[_0x09a5('0x22')](_0x2c725e);}return _0x113d02['save']();};}function saveUpdates(_0x550b20,_0x568e9d){return function(_0x3082d6){if(_0x3082d6){return _0x3082d6['update'](_0x550b20)[_0x09a5('0x23')](function(_0x436d31){return _0x436d31;});}return null;};}function removeEntity(_0x52f2c8,_0x5c1450){return function(_0xbbcf33){if(_0xbbcf33){return _0xbbcf33[_0x09a5('0x24')]()[_0x09a5('0x23')](function(){var _0x14bf3f=_0xbbcf33['get']({'plain':!![]});var _0x7d1066=_0x09a5('0x25');return db[_0x09a5('0x26')][_0x09a5('0x24')]({'where':{'type':_0x7d1066,'resourceId':_0x14bf3f['id']}})[_0x09a5('0x23')](function(){return _0xbbcf33;});})[_0x09a5('0x23')](function(){_0x52f2c8[_0x09a5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x213cb5,_0x1c3923){return function(_0x2dec08){if(!_0x2dec08){_0x213cb5['sendStatus'](0x194);}return _0x2dec08;};}function handleError(_0x5cff9b,_0x260596){_0x260596=_0x260596||0x1f4;return function(_0xde775c){logger[_0x09a5('0x27')](_0xde775c[_0x09a5('0x28')]);if(_0xde775c['name']){delete _0xde775c[_0x09a5('0x29')];}_0x5cff9b[_0x09a5('0x18')](_0x260596)['send'](_0xde775c);};}exports[_0x09a5('0x2a')]=function(_0x434c9d,_0x5d9974){var _0x57e023={},_0x423e06={},_0x705ee3={'count':0x0,'rows':[]};var _0x3e232b=_['map'](db[_0x09a5('0x2b')][_0x09a5('0x2c')],function(_0x24eb93){return{'name':_0x24eb93[_0x09a5('0x2d')],'type':_0x24eb93[_0x09a5('0x2e')]['key']};});_0x423e06[_0x09a5('0x2f')]=_['map'](_0x3e232b,_0x09a5('0x29'));_0x423e06[_0x09a5('0x30')]=_[_0x09a5('0x31')](_0x434c9d[_0x09a5('0x30')]);_0x423e06[_0x09a5('0x32')]=_[_0x09a5('0x33')](_0x423e06['model'],_0x423e06[_0x09a5('0x30')]);_0x57e023[_0x09a5('0x34')]=_['intersection'](_0x423e06[_0x09a5('0x2f')],qs['fields'](_0x434c9d[_0x09a5('0x30')]['fields']));_0x57e023['attributes']=_0x57e023[_0x09a5('0x34')][_0x09a5('0x35')]?_0x57e023[_0x09a5('0x34')]:_0x423e06[_0x09a5('0x2f')];if(!_0x434c9d[_0x09a5('0x30')][_0x09a5('0x36')](_0x09a5('0x37'))){_0x57e023[_0x09a5('0x1d')]=qs[_0x09a5('0x1d')](_0x434c9d[_0x09a5('0x30')][_0x09a5('0x1d')]);_0x57e023[_0x09a5('0x1b')]=qs[_0x09a5('0x1b')](_0x434c9d['query']['offset']);}_0x57e023['order']=qs[_0x09a5('0x38')](_0x434c9d[_0x09a5('0x30')][_0x09a5('0x38')]);delete _0x434c9d[_0x09a5('0x30')]['sort'];_0x57e023[_0x09a5('0x39')]=qs[_0x09a5('0x32')](_[_0x09a5('0x3a')](_0x434c9d[_0x09a5('0x30')],_0x423e06[_0x09a5('0x32')]),_0x3e232b);if(_0x434c9d[_0x09a5('0x30')]['filter']){_0x57e023[_0x09a5('0x39')]=_[_0x09a5('0x3b')](_0x57e023['where'],{'$or':_['map'](_0x3e232b,function(_0x17b102){if(_0x17b102['type']!==_0x09a5('0x3c')){var _0x54efec={};_0x54efec[_0x17b102[_0x09a5('0x29')]]={'$like':'%'+_0x434c9d[_0x09a5('0x30')][_0x09a5('0x3d')]+'%'};return _0x54efec;}})});}_0x57e023=_['merge']({},_0x57e023,_0x434c9d['options']);var _0x7f4ab7={'where':_0x57e023[_0x09a5('0x39')]};return db['VoiceMusicOnHold']['count'](_0x7f4ab7)[_0x09a5('0x23')](function(_0x56743f){_0x705ee3['count']=_0x56743f;if(_0x434c9d[_0x09a5('0x30')][_0x09a5('0x3e')]){_0x57e023[_0x09a5('0x3f')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x09a5('0x40')](_0x57e023);})[_0x09a5('0x23')](function(_0x4d7c58){_0x705ee3[_0x09a5('0x41')]=_0x4d7c58;return _0x705ee3;})['then'](respondWithFilteredResult(_0x5d9974,_0x57e023))[_0x09a5('0x42')](handleError(_0x5d9974,null));};exports['show']=function(_0x49c6cf,_0x4a7467){var _0x4f480c={'raw':![],'where':{'id':_0x49c6cf[_0x09a5('0x43')]['id']}},_0x4c5c82={};_0x4c5c82[_0x09a5('0x2f')]=_['keys'](db['VoiceMusicOnHold'][_0x09a5('0x2c')]);_0x4c5c82[_0x09a5('0x30')]=_['keys'](_0x49c6cf[_0x09a5('0x30')]);_0x4c5c82['filters']=_[_0x09a5('0x33')](_0x4c5c82[_0x09a5('0x2f')],_0x4c5c82[_0x09a5('0x30')]);_0x4f480c[_0x09a5('0x34')]=_[_0x09a5('0x33')](_0x4c5c82[_0x09a5('0x2f')],qs['fields'](_0x49c6cf[_0x09a5('0x30')][_0x09a5('0x44')]));_0x4f480c[_0x09a5('0x34')]=_0x4f480c[_0x09a5('0x34')]['length']?_0x4f480c[_0x09a5('0x34')]:_0x4c5c82[_0x09a5('0x2f')];if(_0x49c6cf[_0x09a5('0x30')]['includeAll']){_0x4f480c[_0x09a5('0x3f')]=[{'all':!![]}];}_0x4f480c=_[_0x09a5('0x3b')]({},_0x4f480c,_0x49c6cf['options']);return db['VoiceMusicOnHold']['find'](_0x4f480c)['then'](handleEntityNotFound(_0x4a7467,null))[_0x09a5('0x23')](respondWithResult(_0x4a7467,null))[_0x09a5('0x42')](handleError(_0x4a7467,null));};exports[_0x09a5('0x45')]=function(_0x40b852,_0x2860f6){if(_0x40b852[_0x09a5('0x46')]['id']){delete _0x40b852['body']['id'];}return db[_0x09a5('0x2b')][_0x09a5('0x47')]({'where':{'id':_0x40b852[_0x09a5('0x43')]['id']}})['then'](handleEntityNotFound(_0x2860f6,null))[_0x09a5('0x23')](saveUpdates(_0x40b852[_0x09a5('0x46')],null))[_0x09a5('0x23')](respondWithResult(_0x2860f6,null))[_0x09a5('0x42')](handleError(_0x2860f6,null));};exports['create']=function(_0xe3d07a,_0x52b156,_0x3044ec){return db[_0x09a5('0x48')][_0x09a5('0x49')](function(_0x34df4d){if(_0xe3d07a[_0x09a5('0x46')]['mode']===_0x09a5('0x4a')){_0xe3d07a[_0x09a5('0x46')]['directory']=path[_0x09a5('0x4b')](config['root'],'server/files/moh',_0xe3d07a[_0x09a5('0x46')][_0x09a5('0x29')]);}return db[_0x09a5('0x2b')]['create'](_0xe3d07a[_0x09a5('0x46')],{'transaction':_0x34df4d})[_0x09a5('0x23')](function(_0x21f069){if(_0xe3d07a[_0x09a5('0x46')][_0x09a5('0x4c')]===_0x09a5('0x4a')){fs[_0x09a5('0x4d')](_0x21f069[_0x09a5('0x4e')],parseInt(_0x09a5('0x4f'),0x8));}var _0x5b2191=_0xe3d07a['user'][_0x09a5('0x50')]({'plain':!![]});if(!_0x5b2191)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b2191[_0x09a5('0x51')]===_0x09a5('0x52')){var _0x248fae=_0x21f069[_0x09a5('0x50')]({'plain':!![]});return db[_0x09a5('0x53')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x5b2191[_0x09a5('0x54')]},'raw':!![]})[_0x09a5('0x23')](function(_0x33692c){if(_0x33692c&&_0x33692c['autoAssociation']===0x0){return db[_0x09a5('0x26')]['create']({'name':_0x248fae[_0x09a5('0x29')],'resourceId':_0x248fae['id'],'type':_0x33692c['name'],'sectionId':_0x33692c['id']},{})[_0x09a5('0x23')](function(){return _0x21f069;});}else{return _0x21f069;}})[_0x09a5('0x42')](function(_0x5d9f80){logger[_0x09a5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d9f80);});}return _0x21f069;});})[_0x09a5('0x23')](respondWithResult(_0x52b156,0xc9))[_0x09a5('0x42')](handleError(_0x52b156,null));};exports[_0x09a5('0x24')]=function(_0x786b97,_0x395fdd,_0x248fa4){var _0x12200f;return db[_0x09a5('0x2b')][_0x09a5('0x47')]({'where':{'id':_0x786b97[_0x09a5('0x43')]['id']}})[_0x09a5('0x23')](function(_0x59ee7c){if(_0x59ee7c){return db[_0x09a5('0x48')][_0x09a5('0x49')](function(_0x13aacd){return _0x59ee7c['destroy']({'transaction':_0x13aacd,'raw':!![]})['then'](function(_0x3439ad){if(_0x3439ad[_0x09a5('0x4e')]){fs[_0x09a5('0x55')](_0x3439ad[_0x09a5('0x4e')])['forEach'](function(_0x4e7ee2){fs[_0x09a5('0x56')](path[_0x09a5('0x4b')](_0x3439ad[_0x09a5('0x4e')],_0x4e7ee2));});fs[_0x09a5('0x57')](_0x3439ad[_0x09a5('0x4e')]);}return _0x3439ad;});})[_0x09a5('0x42')](function(_0x27fc72){throw new db[(_0x09a5('0x58'))][(_0x09a5('0x59'))](_0x27fc72[_0x09a5('0x5a')]);});}})['then'](handleEntityNotFound(_0x395fdd,null))[_0x09a5('0x23')](removeEntity(_0x395fdd,null))[_0x09a5('0x42')](handleError(_0x395fdd,null));};exports['addSound']=function(_0x293cbb,_0x4d15bb,_0xbcbb5e){return db[_0x09a5('0x48')]['transaction'](function(_0x235418){var _0x5ab246;return db[_0x09a5('0x2b')][_0x09a5('0x47')]({'where':{'id':_0x293cbb[_0x09a5('0x43')]['id']}})[_0x09a5('0x23')](function(_0x224f7c){if(_0x224f7c){_0x5ab246=_0x224f7c;return _0x224f7c['addSound'](_0x293cbb['body']['id'],{'transaction':_0x235418});}})['then'](function(_0x2c3584){if(_0x2c3584){return db[_0x09a5('0x5b')][_0x09a5('0x5c')]({'where':{'id':_0x293cbb['body']['id']},'attributes':['id',_0x09a5('0x29'),_0x09a5('0x5d'),_0x09a5('0x5e'),_0x09a5('0x5f')],'raw':!![]});}})['then'](function(_0x296fe6){if(_0x296fe6){var _0x5864cc=path[_0x09a5('0x4b')](config[_0x09a5('0x60')],_0x09a5('0x61'),util[_0x09a5('0x62')]('%s.%s',path[_0x09a5('0x63')](_0x296fe6['save_name'],path[_0x09a5('0x64')](_0x296fe6[_0x09a5('0x5d')])),_0x296fe6[_0x09a5('0x5e')]));var _0x1b66b4=path[_0x09a5('0x4b')](config['root'],_0x09a5('0x65'),_0x5ab246['name'],util[_0x09a5('0x62')]('%s.%s',_0x296fe6[_0x09a5('0x29')],_0x296fe6[_0x09a5('0x5e')]));fs['symlinkSync'](_0x5864cc,_0x1b66b4);return _0x296fe6;}})['catch'](function(_0x1072c3){throw new db[(_0x09a5('0x58'))][(_0x09a5('0x59'))](_0x1072c3[_0x09a5('0x5a')]);});})[_0x09a5('0x23')](handleEntityNotFound(_0x4d15bb,null))['then'](respondWithResult(_0x4d15bb,0xc9))[_0x09a5('0x42')](handleError(_0x4d15bb,null));};exports[_0x09a5('0x66')]=function(_0x25f241,_0x44474d,_0x59d390){return db['sequelize'][_0x09a5('0x49')](function(_0x570208){var _0x212cfb;return db[_0x09a5('0x2b')][_0x09a5('0x5c')]({'where':{'id':_0x25f241['params']['id']}})[_0x09a5('0x23')](handleEntityNotFound(_0x44474d,null))[_0x09a5('0x23')](function(_0x52a53c){if(_0x52a53c){_0x212cfb=_0x52a53c;return _0x52a53c[_0x09a5('0x66')](_0x25f241[_0x09a5('0x43')][_0x09a5('0x67')]);}})[_0x09a5('0x23')](function(_0x2685d6){if(_0x2685d6){return db[_0x09a5('0x5b')][_0x09a5('0x5c')]({'where':{'id':_0x25f241[_0x09a5('0x43')][_0x09a5('0x67')]},'attributes':['id',_0x09a5('0x29'),_0x09a5('0x5d'),_0x09a5('0x5e'),'createdAt'],'raw':!![]});}})[_0x09a5('0x23')](function(_0x27789f){if(_0x27789f){fs['unlinkSync'](path['join'](_0x212cfb[_0x09a5('0x4e')],util[_0x09a5('0x62')](_0x09a5('0x68'),_0x27789f[_0x09a5('0x29')],_0x27789f[_0x09a5('0x5e')])));return _0x27789f;}})[_0x09a5('0x42')](function(_0x3da5ce){throw new db[(_0x09a5('0x58'))]['ValidationError'](_0x3da5ce[_0x09a5('0x5a')]);});})[_0x09a5('0x23')](handleEntityNotFound(_0x44474d,null))[_0x09a5('0x23')](respondWithStatusCode(_0x44474d,0xcc))[_0x09a5('0x42')](handleError(_0x44474d,null));};exports[_0x09a5('0x69')]=function(_0x2a2aad,_0x86fd6c,_0x262aad){var _0x43c9d0={};var _0x51bfda={};var _0x1c5c5c;var _0x38b184;return db[_0x09a5('0x2b')][_0x09a5('0x5c')]({'where':{'id':_0x2a2aad[_0x09a5('0x43')]['id']}})[_0x09a5('0x23')](handleEntityNotFound(_0x86fd6c,null))['then'](function(_0x2fab44){if(_0x2fab44){_0x1c5c5c=_0x2fab44;_0x51bfda[_0x09a5('0x2f')]=_[_0x09a5('0x31')](db[_0x09a5('0x5b')]['rawAttributes']);_0x51bfda['query']=_['keys'](_0x2a2aad[_0x09a5('0x30')]);_0x51bfda['filters']=_['intersection'](_0x51bfda[_0x09a5('0x2f')],_0x51bfda[_0x09a5('0x30')]);_0x43c9d0[_0x09a5('0x34')]=_['intersection'](_0x51bfda['model'],qs[_0x09a5('0x44')](_0x2a2aad['query'][_0x09a5('0x44')]));_0x43c9d0[_0x09a5('0x34')]=_0x43c9d0['attributes'][_0x09a5('0x35')]?_0x43c9d0[_0x09a5('0x34')]:_0x51bfda[_0x09a5('0x2f')];_0x43c9d0['order']=qs[_0x09a5('0x38')](_0x2a2aad[_0x09a5('0x30')]['sort']);_0x43c9d0[_0x09a5('0x39')]=qs[_0x09a5('0x32')](_[_0x09a5('0x3a')](_0x2a2aad[_0x09a5('0x30')],_0x51bfda['filters']));if(_0x2a2aad[_0x09a5('0x30')][_0x09a5('0x3d')]){_0x43c9d0['where']=_['merge'](_0x43c9d0[_0x09a5('0x39')],{'$or':_[_0x09a5('0x6a')](_0x43c9d0['attributes'],function(_0x31198a){var _0x107b39={};_0x107b39[_0x31198a]={'$like':'%'+_0x2a2aad[_0x09a5('0x30')][_0x09a5('0x3d')]+'%'};return _0x107b39;})});}_0x43c9d0=_['merge']({},_0x43c9d0,_0x2a2aad[_0x09a5('0x6b')]);return _0x1c5c5c[_0x09a5('0x69')](_0x43c9d0);}})[_0x09a5('0x23')](function(_0x32ab5d){if(_0x32ab5d){_0x38b184=_0x32ab5d['length'];if(!_0x2a2aad['query'][_0x09a5('0x36')]('nolimit')){_0x43c9d0['limit']=qs[_0x09a5('0x1d')](_0x2a2aad[_0x09a5('0x30')][_0x09a5('0x1d')]);_0x43c9d0[_0x09a5('0x1b')]=qs[_0x09a5('0x1b')](_0x2a2aad[_0x09a5('0x30')][_0x09a5('0x1b')]);}return _0x1c5c5c[_0x09a5('0x69')](_0x43c9d0);}})[_0x09a5('0x23')](function(_0x194348){if(_0x194348){return _0x194348?{'count':_0x38b184,'rows':_0x194348}:null;}})['then'](respondWithResult(_0x86fd6c,null))[_0x09a5('0x42')](handleError(_0x86fd6c,null));}; \ No newline at end of file +var _0x5aab=['create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','removeSound','id2','getSounds','hasOwnProperty','eml-format','rimraf','fast-json-patch','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','MusicOnHolds','UserProfileResource','sendStatus','error','stack','name','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','params','rawAttributes','find','update','body','sequelize','mode','join','root','server/files/moh','files','directory','0777','role','user','userProfileId','autoAssociation'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x5aab,0xef));var _0xb5aa=function(_0x590e8a,_0x3ab8c3){_0x590e8a=_0x590e8a-0x0;var _0x56382b=_0x5aab[_0x590e8a];return _0x56382b;};'use strict';var emlformat=require(_0xb5aa('0x0'));var rimraf=require(_0xb5aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5aa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5aa('0x3'));var Mustache=require(_0xb5aa('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb5aa('0x5'));var csv=require(_0xb5aa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5aa('0x7'));var squel=require(_0xb5aa('0x8'));var crypto=require('crypto');var jsforce=require(_0xb5aa('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xb5aa('0x6'));var querystring=require(_0xb5aa('0xa'));var Papa=require('papaparse');var Redis=require(_0xb5aa('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xb5aa('0xc'));var as=require(_0xb5aa('0xd'));var hardwareService=require(_0xb5aa('0xe'));var logger=require(_0xb5aa('0xf'))(_0xb5aa('0x10'));var utils=require(_0xb5aa('0x11'));var config=require(_0xb5aa('0x12'));var licenseUtil=require(_0xb5aa('0x13'));var db=require(_0xb5aa('0x14'))['db'];function respondWithStatusCode(_0x4c2541,_0x519f2f){_0x519f2f=_0x519f2f||0xcc;return function(_0x112d23){if(_0x112d23){return _0x4c2541['sendStatus'](_0x519f2f);}return _0x4c2541[_0xb5aa('0x15')](_0x519f2f)[_0xb5aa('0x16')]();};}function respondWithResult(_0x93bd12,_0x428b7a){_0x428b7a=_0x428b7a||0xc8;return function(_0x2b4588){if(_0x2b4588){return _0x93bd12['status'](_0x428b7a)[_0xb5aa('0x17')](_0x2b4588);}};}function respondWithFilteredResult(_0x597065,_0x2ccdc6){return function(_0x460851){if(_0x460851){var _0xce486c=typeof _0x2ccdc6[_0xb5aa('0x18')]===_0xb5aa('0x19')&&typeof _0x2ccdc6[_0xb5aa('0x1a')]==='undefined';var _0x5262c3=_0x460851[_0xb5aa('0x1b')];var _0x47f400=_0xce486c?0x0:_0x2ccdc6[_0xb5aa('0x18')];var _0x1bba5f=_0xce486c?_0x460851['count']:_0x2ccdc6[_0xb5aa('0x18')]+_0x2ccdc6[_0xb5aa('0x1a')];var _0x2723bd;if(_0x1bba5f>=_0x5262c3){_0x1bba5f=_0x5262c3;_0x2723bd=0xc8;}else{_0x2723bd=0xce;}_0x597065[_0xb5aa('0x15')](_0x2723bd);return _0x597065['set'](_0xb5aa('0x1c'),_0x47f400+'-'+_0x1bba5f+'/'+_0x5262c3)['json'](_0x460851);}return null;};}function patchUpdates(_0x299b26){return function(_0x43b146){try{jsonpatch['apply'](_0x43b146,_0x299b26,!![]);}catch(_0x4fb278){return BPromise[_0xb5aa('0x1d')](_0x4fb278);}return _0x43b146['save']();};}function saveUpdates(_0x32a89c,_0x5ae1d0){return function(_0x3e0f0f){if(_0x3e0f0f){return _0x3e0f0f['update'](_0x32a89c)[_0xb5aa('0x1e')](function(_0x540a77){return _0x540a77;});}return null;};}function removeEntity(_0x48fddb,_0x44a8a9){return function(_0x3e81c0){if(_0x3e81c0){return _0x3e81c0[_0xb5aa('0x1f')]()[_0xb5aa('0x1e')](function(){var _0x1ae959=_0x3e81c0[_0xb5aa('0x20')]({'plain':!![]});var _0x514e07=_0xb5aa('0x21');return db[_0xb5aa('0x22')]['destroy']({'where':{'type':_0x514e07,'resourceId':_0x1ae959['id']}})[_0xb5aa('0x1e')](function(){return _0x3e81c0;});})[_0xb5aa('0x1e')](function(){_0x48fddb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14cf72,_0x2e4450){return function(_0x2c32e3){if(!_0x2c32e3){_0x14cf72[_0xb5aa('0x23')](0x194);}return _0x2c32e3;};}function handleError(_0x6ac666,_0xd5286b){_0xd5286b=_0xd5286b||0x1f4;return function(_0x372096){logger[_0xb5aa('0x24')](_0x372096[_0xb5aa('0x25')]);if(_0x372096[_0xb5aa('0x26')]){delete _0x372096['name'];}_0x6ac666['status'](_0xd5286b)['send'](_0x372096);};}exports['index']=function(_0x54aa75,_0x13936b){var _0x271294={},_0x24b5db={},_0x605869={'count':0x0,'rows':[]};var _0x27aff1=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x55c63e){return{'name':_0x55c63e['fieldName'],'type':_0x55c63e[_0xb5aa('0x27')][_0xb5aa('0x28')]};});_0x24b5db[_0xb5aa('0x29')]=_[_0xb5aa('0x2a')](_0x27aff1,_0xb5aa('0x26'));_0x24b5db[_0xb5aa('0x2b')]=_[_0xb5aa('0x2c')](_0x54aa75[_0xb5aa('0x2b')]);_0x24b5db[_0xb5aa('0x2d')]=_[_0xb5aa('0x2e')](_0x24b5db['model'],_0x24b5db[_0xb5aa('0x2b')]);_0x271294['attributes']=_[_0xb5aa('0x2e')](_0x24b5db[_0xb5aa('0x29')],qs[_0xb5aa('0x2f')](_0x54aa75[_0xb5aa('0x2b')]['fields']));_0x271294[_0xb5aa('0x30')]=_0x271294[_0xb5aa('0x30')][_0xb5aa('0x31')]?_0x271294[_0xb5aa('0x30')]:_0x24b5db[_0xb5aa('0x29')];if(!_0x54aa75[_0xb5aa('0x2b')]['hasOwnProperty'](_0xb5aa('0x32'))){_0x271294[_0xb5aa('0x1a')]=qs['limit'](_0x54aa75[_0xb5aa('0x2b')]['limit']);_0x271294[_0xb5aa('0x18')]=qs['offset'](_0x54aa75[_0xb5aa('0x2b')][_0xb5aa('0x18')]);}_0x271294[_0xb5aa('0x33')]=qs[_0xb5aa('0x34')](_0x54aa75['query'][_0xb5aa('0x34')]);delete _0x54aa75['query'][_0xb5aa('0x34')];_0x271294[_0xb5aa('0x35')]=qs[_0xb5aa('0x2d')](_[_0xb5aa('0x36')](_0x54aa75[_0xb5aa('0x2b')],_0x24b5db[_0xb5aa('0x2d')]),_0x27aff1);if(_0x54aa75['query']['filter']){_0x271294[_0xb5aa('0x35')]=_[_0xb5aa('0x37')](_0x271294[_0xb5aa('0x35')],{'$or':_[_0xb5aa('0x2a')](_0x27aff1,function(_0x52fcf6){if(_0x52fcf6[_0xb5aa('0x27')]!==_0xb5aa('0x38')){var _0x40735f={};_0x40735f[_0x52fcf6[_0xb5aa('0x26')]]={'$like':'%'+_0x54aa75[_0xb5aa('0x2b')][_0xb5aa('0x39')]+'%'};return _0x40735f;}})});}_0x271294=_[_0xb5aa('0x37')]({},_0x271294,_0x54aa75[_0xb5aa('0x3a')]);var _0x4e6139={'where':_0x271294[_0xb5aa('0x35')]};return db['VoiceMusicOnHold'][_0xb5aa('0x1b')](_0x4e6139)[_0xb5aa('0x1e')](function(_0x1cf7e0){_0x605869[_0xb5aa('0x1b')]=_0x1cf7e0;if(_0x54aa75['query'][_0xb5aa('0x3b')]){_0x271294[_0xb5aa('0x3c')]=[{'all':!![]}];}return db[_0xb5aa('0x3d')][_0xb5aa('0x3e')](_0x271294);})[_0xb5aa('0x1e')](function(_0x23cc14){_0x605869[_0xb5aa('0x3f')]=_0x23cc14;return _0x605869;})[_0xb5aa('0x1e')](respondWithFilteredResult(_0x13936b,_0x271294))[_0xb5aa('0x40')](handleError(_0x13936b,null));};exports['show']=function(_0x9d9f5c,_0x4774ba){var _0x35285b={'raw':![],'where':{'id':_0x9d9f5c[_0xb5aa('0x41')]['id']}},_0x350ebf={};_0x350ebf['model']=_[_0xb5aa('0x2c')](db['VoiceMusicOnHold'][_0xb5aa('0x42')]);_0x350ebf[_0xb5aa('0x2b')]=_['keys'](_0x9d9f5c[_0xb5aa('0x2b')]);_0x350ebf[_0xb5aa('0x2d')]=_[_0xb5aa('0x2e')](_0x350ebf['model'],_0x350ebf['query']);_0x35285b[_0xb5aa('0x30')]=_[_0xb5aa('0x2e')](_0x350ebf['model'],qs['fields'](_0x9d9f5c[_0xb5aa('0x2b')][_0xb5aa('0x2f')]));_0x35285b[_0xb5aa('0x30')]=_0x35285b[_0xb5aa('0x30')]['length']?_0x35285b[_0xb5aa('0x30')]:_0x350ebf[_0xb5aa('0x29')];if(_0x9d9f5c[_0xb5aa('0x2b')][_0xb5aa('0x3b')]){_0x35285b[_0xb5aa('0x3c')]=[{'all':!![]}];}_0x35285b=_[_0xb5aa('0x37')]({},_0x35285b,_0x9d9f5c['options']);return db[_0xb5aa('0x3d')][_0xb5aa('0x43')](_0x35285b)[_0xb5aa('0x1e')](handleEntityNotFound(_0x4774ba,null))[_0xb5aa('0x1e')](respondWithResult(_0x4774ba,null))[_0xb5aa('0x40')](handleError(_0x4774ba,null));};exports[_0xb5aa('0x44')]=function(_0x426d21,_0x17f1b2){if(_0x426d21[_0xb5aa('0x45')]['id']){delete _0x426d21[_0xb5aa('0x45')]['id'];}return db[_0xb5aa('0x3d')]['find']({'where':{'id':_0x426d21[_0xb5aa('0x41')]['id']}})[_0xb5aa('0x1e')](handleEntityNotFound(_0x17f1b2,null))['then'](saveUpdates(_0x426d21[_0xb5aa('0x45')],null))[_0xb5aa('0x1e')](respondWithResult(_0x17f1b2,null))[_0xb5aa('0x40')](handleError(_0x17f1b2,null));};exports['create']=function(_0x40a867,_0x36f7b3,_0x569e9a){return db[_0xb5aa('0x46')]['transaction'](function(_0x22560b){if(_0x40a867[_0xb5aa('0x45')][_0xb5aa('0x47')]==='files'){_0x40a867[_0xb5aa('0x45')]['directory']=path[_0xb5aa('0x48')](config[_0xb5aa('0x49')],_0xb5aa('0x4a'),_0x40a867[_0xb5aa('0x45')][_0xb5aa('0x26')]);}return db['VoiceMusicOnHold']['create'](_0x40a867[_0xb5aa('0x45')],{'transaction':_0x22560b})[_0xb5aa('0x1e')](function(_0x3f40dc){if(_0x40a867[_0xb5aa('0x45')]['mode']===_0xb5aa('0x4b')){fs['mkdirSync'](_0x3f40dc[_0xb5aa('0x4c')],parseInt(_0xb5aa('0x4d'),0x8));}var _0x2ccf23=_0x40a867['user'][_0xb5aa('0x20')]({'plain':!![]});if(!_0x2ccf23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ccf23[_0xb5aa('0x4e')]===_0xb5aa('0x4f')){var _0x2f2f4a=_0x3f40dc[_0xb5aa('0x20')]({'plain':!![]});return db['UserProfileSection'][_0xb5aa('0x43')]({'where':{'name':_0xb5aa('0x21'),'userProfileId':_0x2ccf23[_0xb5aa('0x50')]},'raw':!![]})[_0xb5aa('0x1e')](function(_0x1f8596){if(_0x1f8596&&_0x1f8596[_0xb5aa('0x51')]===0x0){return db[_0xb5aa('0x22')][_0xb5aa('0x52')]({'name':_0x2f2f4a[_0xb5aa('0x26')],'resourceId':_0x2f2f4a['id'],'type':_0x1f8596['name'],'sectionId':_0x1f8596['id']},{})[_0xb5aa('0x1e')](function(){return _0x3f40dc;});}else{return _0x3f40dc;}})[_0xb5aa('0x40')](function(_0x2fcd42){logger['error'](_0xb5aa('0x53'),_0x2fcd42);});}return _0x3f40dc;});})['then'](respondWithResult(_0x36f7b3,0xc9))['catch'](handleError(_0x36f7b3,null));};exports[_0xb5aa('0x1f')]=function(_0x1ac0a4,_0x1855be,_0x21512f){var _0x995f1b;return db[_0xb5aa('0x3d')][_0xb5aa('0x43')]({'where':{'id':_0x1ac0a4['params']['id']}})[_0xb5aa('0x1e')](function(_0xa4a272){if(_0xa4a272){return db[_0xb5aa('0x46')][_0xb5aa('0x54')](function(_0x81a592){return _0xa4a272[_0xb5aa('0x1f')]({'transaction':_0x81a592,'raw':!![]})[_0xb5aa('0x1e')](function(_0x49324d){if(_0x49324d[_0xb5aa('0x4c')]){fs[_0xb5aa('0x55')](_0x49324d[_0xb5aa('0x4c')])[_0xb5aa('0x56')](function(_0xed5d73){fs['unlinkSync'](path['join'](_0x49324d[_0xb5aa('0x4c')],_0xed5d73));});fs[_0xb5aa('0x57')](_0x49324d[_0xb5aa('0x4c')]);}return _0x49324d;});})[_0xb5aa('0x40')](function(_0x3680b2){throw new db[(_0xb5aa('0x58'))][(_0xb5aa('0x59'))](_0x3680b2[_0xb5aa('0x5a')]);});}})[_0xb5aa('0x1e')](handleEntityNotFound(_0x1855be,null))[_0xb5aa('0x1e')](removeEntity(_0x1855be,null))['catch'](handleError(_0x1855be,null));};exports[_0xb5aa('0x5b')]=function(_0x249386,_0x830af,_0x4737fa){return db['sequelize'][_0xb5aa('0x54')](function(_0xc10327){var _0x327ad3;return db[_0xb5aa('0x3d')][_0xb5aa('0x43')]({'where':{'id':_0x249386[_0xb5aa('0x41')]['id']}})[_0xb5aa('0x1e')](function(_0x161c25){if(_0x161c25){_0x327ad3=_0x161c25;return _0x161c25['addSound'](_0x249386[_0xb5aa('0x45')]['id'],{'transaction':_0xc10327});}})['then'](function(_0x18fca9){if(_0x18fca9){return db[_0xb5aa('0x5c')][_0xb5aa('0x5d')]({'where':{'id':_0x249386[_0xb5aa('0x45')]['id']},'attributes':['id',_0xb5aa('0x26'),_0xb5aa('0x5e'),_0xb5aa('0x5f'),_0xb5aa('0x60')],'raw':!![]});}})[_0xb5aa('0x1e')](function(_0x3131c4){if(_0x3131c4){var _0x311f99=path[_0xb5aa('0x48')](config['root'],_0xb5aa('0x61'),util['format'](_0xb5aa('0x62'),path[_0xb5aa('0x63')](_0x3131c4[_0xb5aa('0x5e')],path[_0xb5aa('0x64')](_0x3131c4['save_name'])),_0x3131c4[_0xb5aa('0x5f')]));var _0x4c5f4b=path[_0xb5aa('0x48')](config[_0xb5aa('0x49')],_0xb5aa('0x4a'),_0x327ad3[_0xb5aa('0x26')],util[_0xb5aa('0x65')](_0xb5aa('0x62'),_0x3131c4['name'],_0x3131c4[_0xb5aa('0x5f')]));fs[_0xb5aa('0x66')](_0x311f99,_0x4c5f4b);return _0x3131c4;}})[_0xb5aa('0x40')](function(_0x348e21){throw new db['Sequelize'][(_0xb5aa('0x59'))](_0x348e21[_0xb5aa('0x5a')]);});})[_0xb5aa('0x1e')](handleEntityNotFound(_0x830af,null))[_0xb5aa('0x1e')](respondWithResult(_0x830af,0xc9))[_0xb5aa('0x40')](handleError(_0x830af,null));};exports[_0xb5aa('0x67')]=function(_0x8825d4,_0x29779e,_0x2292c3){return db['sequelize'][_0xb5aa('0x54')](function(_0x5a4952){var _0x1b63fa;return db[_0xb5aa('0x3d')][_0xb5aa('0x5d')]({'where':{'id':_0x8825d4[_0xb5aa('0x41')]['id']}})[_0xb5aa('0x1e')](handleEntityNotFound(_0x29779e,null))[_0xb5aa('0x1e')](function(_0x2c071f){if(_0x2c071f){_0x1b63fa=_0x2c071f;return _0x2c071f[_0xb5aa('0x67')](_0x8825d4[_0xb5aa('0x41')][_0xb5aa('0x68')]);}})['then'](function(_0x18d91f){if(_0x18d91f){return db[_0xb5aa('0x5c')]['findOne']({'where':{'id':_0x8825d4[_0xb5aa('0x41')][_0xb5aa('0x68')]},'attributes':['id',_0xb5aa('0x26'),'save_name','converted_format','createdAt'],'raw':!![]});}})[_0xb5aa('0x1e')](function(_0x2b02de){if(_0x2b02de){fs['unlinkSync'](path[_0xb5aa('0x48')](_0x1b63fa[_0xb5aa('0x4c')],util['format']('%s.%s',_0x2b02de[_0xb5aa('0x26')],_0x2b02de[_0xb5aa('0x5f')])));return _0x2b02de;}})[_0xb5aa('0x40')](function(_0x142f68){throw new db['Sequelize'][(_0xb5aa('0x59'))](_0x142f68[_0xb5aa('0x5a')]);});})[_0xb5aa('0x1e')](handleEntityNotFound(_0x29779e,null))[_0xb5aa('0x1e')](respondWithStatusCode(_0x29779e,0xcc))[_0xb5aa('0x40')](handleError(_0x29779e,null));};exports[_0xb5aa('0x69')]=function(_0x4a651e,_0x3d7fea,_0xc07922){var _0x20a459={};var _0x44b7e3={};var _0x2e53fb;var _0x4bc597;return db['VoiceMusicOnHold'][_0xb5aa('0x5d')]({'where':{'id':_0x4a651e[_0xb5aa('0x41')]['id']}})[_0xb5aa('0x1e')](handleEntityNotFound(_0x3d7fea,null))['then'](function(_0x506eea){if(_0x506eea){_0x2e53fb=_0x506eea;_0x44b7e3[_0xb5aa('0x29')]=_[_0xb5aa('0x2c')](db['Sound']['rawAttributes']);_0x44b7e3[_0xb5aa('0x2b')]=_['keys'](_0x4a651e['query']);_0x44b7e3[_0xb5aa('0x2d')]=_[_0xb5aa('0x2e')](_0x44b7e3[_0xb5aa('0x29')],_0x44b7e3[_0xb5aa('0x2b')]);_0x20a459[_0xb5aa('0x30')]=_[_0xb5aa('0x2e')](_0x44b7e3[_0xb5aa('0x29')],qs[_0xb5aa('0x2f')](_0x4a651e[_0xb5aa('0x2b')][_0xb5aa('0x2f')]));_0x20a459[_0xb5aa('0x30')]=_0x20a459[_0xb5aa('0x30')]['length']?_0x20a459[_0xb5aa('0x30')]:_0x44b7e3[_0xb5aa('0x29')];_0x20a459[_0xb5aa('0x33')]=qs[_0xb5aa('0x34')](_0x4a651e[_0xb5aa('0x2b')]['sort']);_0x20a459[_0xb5aa('0x35')]=qs[_0xb5aa('0x2d')](_[_0xb5aa('0x36')](_0x4a651e[_0xb5aa('0x2b')],_0x44b7e3[_0xb5aa('0x2d')]));if(_0x4a651e[_0xb5aa('0x2b')]['filter']){_0x20a459['where']=_[_0xb5aa('0x37')](_0x20a459[_0xb5aa('0x35')],{'$or':_[_0xb5aa('0x2a')](_0x20a459[_0xb5aa('0x30')],function(_0x32fc74){var _0x884851={};_0x884851[_0x32fc74]={'$like':'%'+_0x4a651e[_0xb5aa('0x2b')][_0xb5aa('0x39')]+'%'};return _0x884851;})});}_0x20a459=_['merge']({},_0x20a459,_0x4a651e['options']);return _0x2e53fb['getSounds'](_0x20a459);}})[_0xb5aa('0x1e')](function(_0x23b045){if(_0x23b045){_0x4bc597=_0x23b045[_0xb5aa('0x31')];if(!_0x4a651e[_0xb5aa('0x2b')][_0xb5aa('0x6a')](_0xb5aa('0x32'))){_0x20a459['limit']=qs[_0xb5aa('0x1a')](_0x4a651e[_0xb5aa('0x2b')][_0xb5aa('0x1a')]);_0x20a459[_0xb5aa('0x18')]=qs[_0xb5aa('0x18')](_0x4a651e[_0xb5aa('0x2b')][_0xb5aa('0x18')]);}return _0x2e53fb[_0xb5aa('0x69')](_0x20a459);}})[_0xb5aa('0x1e')](function(_0x280fe4){if(_0x280fe4){return _0x280fe4?{'count':_0x4bc597,'rows':_0x280fe4}:null;}})[_0xb5aa('0x1e')](respondWithResult(_0x3d7fea,null))[_0xb5aa('0x40')](handleError(_0x3d7fea,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 25919e9..e0bf155 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 _0x2de6=['voice_musiconhold','lodash','util','../../config/logger','api','moment','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x3f3f5e,_0xc696a5){var _0x15031f=function(_0x158428){while(--_0x158428){_0x3f3f5e['push'](_0x3f3f5e['shift']());}};_0x15031f(++_0xc696a5);}(_0x2de6,0x139));var _0x62de=function(_0x26888e,_0x1e3ebd){_0x26888e=_0x26888e-0x0;var _0x4f3eaf=_0x2de6[_0x26888e];return _0x4f3eaf;};'use strict';var _=require(_0x62de('0x0'));var util=require(_0x62de('0x1'));var logger=require(_0x62de('0x2'))(_0x62de('0x3'));var moment=require(_0x62de('0x4'));var BPromise=require('bluebird');var rp=require(_0x62de('0x5'));var fs=require('fs');var path=require(_0x62de('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x62de('0x7'));module[_0x62de('0x8')]=function(_0x28a315,_0x40e955){return _0x28a315[_0x62de('0x9')](_0x62de('0xa'),attributes,{'tableName':_0x62de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7c2=['../../config/environment','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5c17d8,_0x51cc20){var _0x1841de=function(_0x128311){while(--_0x128311){_0x5c17d8['push'](_0x5c17d8['shift']());}};_0x1841de(++_0x51cc20);}(_0xe7c2,0x156));var _0x2e7c=function(_0x149889,_0x2c22c9){_0x149889=_0x149889-0x0;var _0x25c5d7=_0xe7c2[_0x149889];return _0x25c5d7;};'use strict';var _=require(_0x2e7c('0x0'));var util=require(_0x2e7c('0x1'));var logger=require(_0x2e7c('0x2'))(_0x2e7c('0x3'));var moment=require(_0x2e7c('0x4'));var BPromise=require(_0x2e7c('0x5'));var rp=require(_0x2e7c('0x6'));var fs=require('fs');var path=require(_0x2e7c('0x7'));var rimraf=require(_0x2e7c('0x8'));var config=require(_0x2e7c('0x9'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0xbbd49f,_0x523033){return _0xbbd49f[_0x2e7c('0xa')](_0x2e7c('0xb'),attributes,{'tableName':_0x2e7c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 3c77a16..c813371 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x117dec,_0x25cfa5){var _0xe925ee=function(_0x2a8dcf){while(--_0x2a8dcf){_0x117dec['push'](_0x117dec['shift']());}};_0xe925ee(++_0x25cfa5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x2770c4,_0x101ecf){var _0x30fbb0=function(_0x2b37ea){while(--_0x2b37ea){_0x2770c4['push'](_0x2770c4['shift']());}};_0x30fbb0(++_0x101ecf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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/voicePrefix/index.js b/server/api/voicePrefix/index.js index 3455dba..60c45f4 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 _0x406f=['index','/describe','describe','/:id','getAgents','/:id/teams','getTeams','post','create','addAgents','update','delete','destroy','/:id/users','removeAgents','removeTeams','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x22a565,_0x3bda93){var _0x140562=function(_0x4f666e){while(--_0x4f666e){_0x22a565['push'](_0x22a565['shift']());}};_0x140562(++_0x3bda93);}(_0x406f,0xe8));var _0xf406=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x406f[_0x1cb18a];return _0x22442e;};'use strict';var multer=require(_0xf406('0x0'));var util=require('util');var path=require(_0xf406('0x1'));var timeout=require('connect-timeout');var express=require(_0xf406('0x2'));var router=express[_0xf406('0x3')]();var fs_extra=require(_0xf406('0x4'));var auth=require(_0xf406('0x5'));var interaction=require(_0xf406('0x6'));var config=require(_0xf406('0x7'));var controller=require(_0xf406('0x8'));router[_0xf406('0x9')]('/',auth[_0xf406('0xa')](),controller[_0xf406('0xb')]);router['get'](_0xf406('0xc'),auth[_0xf406('0xa')](),controller[_0xf406('0xd')]);router['get'](_0xf406('0xe'),auth[_0xf406('0xa')](),controller['show']);router[_0xf406('0x9')]('/:id/users',auth[_0xf406('0xa')](),controller[_0xf406('0xf')]);router[_0xf406('0x9')](_0xf406('0x10'),auth[_0xf406('0xa')](),controller[_0xf406('0x11')]);router[_0xf406('0x12')]('/',auth[_0xf406('0xa')](),controller[_0xf406('0x13')]);router[_0xf406('0x12')]('/:id/users',auth[_0xf406('0xa')](),controller[_0xf406('0x14')]);router['post'](_0xf406('0x10'),auth[_0xf406('0xa')](),controller['addTeams']);router['put']('/:id',auth[_0xf406('0xa')](),controller[_0xf406('0x15')]);router[_0xf406('0x16')](_0xf406('0xe'),auth[_0xf406('0xa')](),controller[_0xf406('0x17')]);router[_0xf406('0x16')](_0xf406('0x18'),auth['isAuthenticated'](),controller[_0xf406('0x19')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xf406('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x102b=['show','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','/:id/users','removeAgents','removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe'];(function(_0x3bc1bf,_0x48b60e){var _0x346b52=function(_0x6f84e9){while(--_0x6f84e9){_0x3bc1bf['push'](_0x3bc1bf['shift']());}};_0x346b52(++_0x48b60e);}(_0x102b,0x1be));var _0xb102=function(_0x1dce39,_0x582c1e){_0x1dce39=_0x1dce39-0x0;var _0x4d1326=_0x102b[_0x1dce39];return _0x4d1326;};'use strict';var multer=require('multer');var util=require(_0xb102('0x0'));var path=require('path');var timeout=require(_0xb102('0x1'));var express=require(_0xb102('0x2'));var router=express[_0xb102('0x3')]();var fs_extra=require(_0xb102('0x4'));var auth=require(_0xb102('0x5'));var interaction=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var controller=require(_0xb102('0x8'));router['get']('/',auth[_0xb102('0x9')](),controller[_0xb102('0xa')]);router[_0xb102('0xb')](_0xb102('0xc'),auth[_0xb102('0x9')](),controller['describe']);router[_0xb102('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb102('0xd')]);router['get']('/:id/users',auth[_0xb102('0x9')](),controller[_0xb102('0xe')]);router['get'](_0xb102('0xf'),auth[_0xb102('0x9')](),controller[_0xb102('0x10')]);router[_0xb102('0x11')]('/',auth[_0xb102('0x9')](),controller[_0xb102('0x12')]);router[_0xb102('0x11')]('/:id/users',auth[_0xb102('0x9')](),controller['addAgents']);router[_0xb102('0x11')](_0xb102('0xf'),auth['isAuthenticated'](),controller[_0xb102('0x13')]);router[_0xb102('0x14')]('/:id',auth[_0xb102('0x9')](),controller[_0xb102('0x15')]);router[_0xb102('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xb102('0x16')](_0xb102('0x17'),auth[_0xb102('0x9')](),controller[_0xb102('0x18')]);router['delete']('/:id/teams',auth[_0xb102('0x9')](),controller[_0xb102('0x19')]);module[_0xb102('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 32cecff..468d368 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 _0x3c38=['name','VIRTUAL','system-','getDataValue','INTEGER','sequelize','STRING'];(function(_0x59c272,_0x1b9f24){var _0x5d0c06=function(_0x492a8e){while(--_0x492a8e){_0x59c272['push'](_0x59c272['shift']());}};_0x5d0c06(++_0x1b9f24);}(_0x3c38,0x186));var _0x83c3=function(_0x50447e,_0x1b9a00){_0x50447e=_0x50447e-0x0;var _0x2d55a8=_0x3c38[_0x50447e];return _0x2d55a8;};'use strict';var Sequelize=require(_0x83c3('0x0'));module['exports']={'name':{'type':Sequelize[_0x83c3('0x1')],'allowNull':![],'unique':_0x83c3('0x2')},'prefix':{'type':Sequelize[_0x83c3('0x3')],'get':function(_0x309647){return _0x83c3('0x4')+this[_0x83c3('0x5')](_0x83c3('0x2'))+'-';}},'description':{'type':Sequelize[_0x83c3('0x1')]},'callerIdAll':{'type':Sequelize[_0x83c3('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x83c3('0x6')]}}; \ No newline at end of file +var _0x787c=['exports','STRING','name','VIRTUAL','system-','getDataValue','sequelize'];(function(_0x5dc617,_0x548133){var _0x207165=function(_0x2946d0){while(--_0x2946d0){_0x5dc617['push'](_0x5dc617['shift']());}};_0x207165(++_0x548133);}(_0x787c,0xd8));var _0xc787=function(_0x4676d8,_0x1b640e){_0x4676d8=_0x4676d8-0x0;var _0x5e92ee=_0x787c[_0x4676d8];return _0x5e92ee;};'use strict';var Sequelize=require(_0xc787('0x0'));module[_0xc787('0x1')]={'name':{'type':Sequelize[_0xc787('0x2')],'allowNull':![],'unique':_0xc787('0x3')},'prefix':{'type':Sequelize[_0xc787('0x4')],'get':function(_0xb8373f){return _0xc787('0x5')+this[_0xc787('0x6')](_0xc787('0x3'))+'-';}},'description':{'type':Sequelize[_0xc787('0x2')]},'callerIdAll':{'type':Sequelize[_0xc787('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 47e2189..e3605ef 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 _0x160f=['forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','name','send','index','map','VoicePrefix','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','type','system','description','Voice\x20Prefix\x20Extension','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','nolimit','Team','getTeams','Agents','online','voicePause','interface','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate'];(function(_0x451e44,_0x2a4226){var _0x58f6ca=function(_0x504c35){while(--_0x504c35){_0x451e44['push'](_0x451e44['shift']());}};_0x58f6ca(++_0x2a4226);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];config[_0xf160('0x17')]=_[_0xf160('0x18')](config['redis'],{'host':_0xf160('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf160('0x17')]));require(_0xf160('0x1a'))[_0xf160('0x1b')](socket);function respondWithStatusCode(_0x2bb6c7,_0x3a4faa){_0x3a4faa=_0x3a4faa||0xcc;return function(_0x31f7ae){if(_0x31f7ae){return _0x2bb6c7[_0xf160('0x1c')](_0x3a4faa);}return _0x2bb6c7[_0xf160('0x1d')](_0x3a4faa)[_0xf160('0x1e')]();};}function respondWithResult(_0x59ac02,_0x477e4d){_0x477e4d=_0x477e4d||0xc8;return function(_0x400bda){if(_0x400bda){return _0x59ac02[_0xf160('0x1d')](_0x477e4d)[_0xf160('0x1f')](_0x400bda);}};}function respondWithFilteredResult(_0x51824b,_0x36a978){return function(_0x4b8185){if(_0x4b8185){var _0x5388c7=typeof _0x36a978[_0xf160('0x20')]===_0xf160('0x21')&&typeof _0x36a978[_0xf160('0x22')]===_0xf160('0x21');var _0x205afa=_0x4b8185[_0xf160('0x23')];var _0x2a8cb4=_0x5388c7?0x0:_0x36a978[_0xf160('0x20')];var _0x4a58d9=_0x5388c7?_0x4b8185[_0xf160('0x23')]:_0x36a978[_0xf160('0x20')]+_0x36a978[_0xf160('0x22')];var _0x5ad173;if(_0x4a58d9>=_0x205afa){_0x4a58d9=_0x205afa;_0x5ad173=0xc8;}else{_0x5ad173=0xce;}_0x51824b[_0xf160('0x1d')](_0x5ad173);return _0x51824b[_0xf160('0x24')](_0xf160('0x25'),_0x2a8cb4+'-'+_0x4a58d9+'/'+_0x205afa)[_0xf160('0x1f')](_0x4b8185);}return null;};}function patchUpdates(_0x2e03c8){return function(_0x1b0081){try{jsonpatch[_0xf160('0x26')](_0x1b0081,_0x2e03c8,!![]);}catch(_0x5a72d1){return BPromise[_0xf160('0x27')](_0x5a72d1);}return _0x1b0081[_0xf160('0x28')]();};}function saveUpdates(_0x305f6a,_0x49bb5c){return function(_0x578f7d){if(_0x578f7d){return _0x578f7d[_0xf160('0x29')](_0x305f6a)[_0xf160('0x2a')](function(_0x4a8003){return _0x4a8003;});}return null;};}function removeEntity(_0x487c0c,_0x168a09){return function(_0x1cc04c){if(_0x1cc04c){return _0x1cc04c[_0xf160('0x2b')]()['then'](function(){var _0xcfa9bd=_0x1cc04c[_0xf160('0x2c')]({'plain':!![]});var _0x2851e8=_0xf160('0x2d');return db[_0xf160('0x2e')][_0xf160('0x2b')]({'where':{'type':_0x2851e8,'resourceId':_0xcfa9bd['id']}})['then'](function(){return _0x1cc04c;});})['then'](function(){_0x487c0c['status'](0xcc)[_0xf160('0x1e')]();});}};}function handleEntityNotFound(_0x16a5fa,_0xcaab39){return function(_0x26e06b){if(!_0x26e06b){_0x16a5fa[_0xf160('0x1c')](0x194);}return _0x26e06b;};}function handleError(_0x563103,_0x55f9c3){_0x55f9c3=_0x55f9c3||0x1f4;return function(_0x329d6b){logger['error'](_0x329d6b['stack']);if(_0x329d6b[_0xf160('0x2f')]){delete _0x329d6b[_0xf160('0x2f')];}_0x563103['status'](_0x55f9c3)[_0xf160('0x30')](_0x329d6b);};}exports[_0xf160('0x31')]=function(_0x4ab048,_0x528dff){var _0x4b3ef4={},_0x54d17f={},_0x3e7720={'count':0x0,'rows':[]};var _0x2bb5c4=_[_0xf160('0x32')](db[_0xf160('0x33')][_0xf160('0x34')],function(_0x26fc8b){return{'name':_0x26fc8b['fieldName'],'type':_0x26fc8b['type']['key']};});_0x54d17f[_0xf160('0x35')]=_['map'](_0x2bb5c4,'name');_0x54d17f[_0xf160('0x36')]=_[_0xf160('0x37')](_0x4ab048['query']);_0x54d17f[_0xf160('0x38')]=_[_0xf160('0x39')](_0x54d17f[_0xf160('0x35')],_0x54d17f[_0xf160('0x36')]);_0x4b3ef4[_0xf160('0x3a')]=_['intersection'](_0x54d17f[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x4ab048[_0xf160('0x36')]['fields']));_0x4b3ef4[_0xf160('0x3a')]=_0x4b3ef4[_0xf160('0x3a')][_0xf160('0x3c')]?_0x4b3ef4[_0xf160('0x3a')]:_0x54d17f[_0xf160('0x35')];if(!_0x4ab048[_0xf160('0x36')]['hasOwnProperty']('nolimit')){_0x4b3ef4[_0xf160('0x22')]=qs[_0xf160('0x22')](_0x4ab048[_0xf160('0x36')][_0xf160('0x22')]);_0x4b3ef4[_0xf160('0x20')]=qs[_0xf160('0x20')](_0x4ab048[_0xf160('0x36')][_0xf160('0x20')]);}_0x4b3ef4[_0xf160('0x3d')]=qs[_0xf160('0x3e')](_0x4ab048[_0xf160('0x36')][_0xf160('0x3e')]);_0x4b3ef4[_0xf160('0x3f')]=qs[_0xf160('0x38')](_[_0xf160('0x40')](_0x4ab048[_0xf160('0x36')],_0x54d17f[_0xf160('0x38')]),_0x2bb5c4);if(_0x4ab048[_0xf160('0x36')][_0xf160('0x41')]){_0x4b3ef4[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x4b3ef4[_0xf160('0x3f')],{'$or':_[_0xf160('0x32')](_0x2bb5c4,function(_0x1bdc44){if(_0x1bdc44['type']!==_0xf160('0x43')){var _0x476c31={};_0x476c31[_0x1bdc44[_0xf160('0x2f')]]={'$like':'%'+_0x4ab048[_0xf160('0x36')][_0xf160('0x41')]+'%'};return _0x476c31;}})});}_0x4b3ef4=_[_0xf160('0x42')]({},_0x4b3ef4,_0x4ab048[_0xf160('0x44')]);var _0x4f65c9={'where':_0x4b3ef4[_0xf160('0x3f')]};return db['VoicePrefix'][_0xf160('0x23')](_0x4f65c9)[_0xf160('0x2a')](function(_0x530fc5){_0x3e7720[_0xf160('0x23')]=_0x530fc5;if(_0x4ab048[_0xf160('0x36')][_0xf160('0x45')]){_0x4b3ef4[_0xf160('0x46')]=[{'all':!![]}];}return db[_0xf160('0x33')][_0xf160('0x47')](_0x4b3ef4);})[_0xf160('0x2a')](function(_0x4f5eba){_0x3e7720[_0xf160('0x48')]=_0x4f5eba;return _0x3e7720;})[_0xf160('0x2a')](respondWithFilteredResult(_0x528dff,_0x4b3ef4))[_0xf160('0x49')](handleError(_0x528dff,null));};exports[_0xf160('0x4a')]=function(_0x3e4f0e,_0x2caefa){var _0x33bef9={'raw':![],'where':{'id':_0x3e4f0e[_0xf160('0x4b')]['id']}},_0x15b31a={};_0x15b31a[_0xf160('0x35')]=_[_0xf160('0x37')](db['VoicePrefix']['rawAttributes']);_0x15b31a[_0xf160('0x36')]=_[_0xf160('0x37')](_0x3e4f0e[_0xf160('0x36')]);_0x15b31a[_0xf160('0x38')]=_[_0xf160('0x39')](_0x15b31a[_0xf160('0x35')],_0x15b31a['query']);_0x33bef9[_0xf160('0x3a')]=_['intersection'](_0x15b31a['model'],qs[_0xf160('0x3b')](_0x3e4f0e[_0xf160('0x36')]['fields']));_0x33bef9['attributes']=_0x33bef9[_0xf160('0x3a')][_0xf160('0x3c')]?_0x33bef9[_0xf160('0x3a')]:_0x15b31a[_0xf160('0x35')];if(_0x3e4f0e['query']['includeAll']){_0x33bef9['include']=[{'all':!![]}];}_0x33bef9=_['merge']({},_0x33bef9,_0x3e4f0e[_0xf160('0x44')]);return db['VoicePrefix'][_0xf160('0x4c')](_0x33bef9)[_0xf160('0x2a')](handleEntityNotFound(_0x2caefa,null))[_0xf160('0x2a')](respondWithResult(_0x2caefa,null))[_0xf160('0x49')](handleError(_0x2caefa,null));};exports['destroy']=function(_0x45af83,_0x283f55){return db[_0xf160('0x33')]['find']({'where':{'id':_0x45af83[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x283f55,null))[_0xf160('0x2a')](removeEntity(_0x283f55,null))['catch'](handleError(_0x283f55,null));};exports[_0xf160('0x4d')]=function(_0x6d8c9b,_0x409e7d){return db[_0xf160('0x33')][_0xf160('0x4d')]()['then'](respondWithResult(_0x409e7d,null))['catch'](handleError(_0x409e7d,null));};exports[_0xf160('0x4e')]=function(_0x5d81b9,_0x1d5168){var _0xf31056;return db['sequelize']['transaction'](function(_0x321309){return db[_0xf160('0x33')]['create'](_0x5d81b9[_0xf160('0x4f')],{'transaction':_0x321309})[_0xf160('0x2a')](function(_0x28605d){_0xf31056=_0x28605d[_0xf160('0x2c')]({'plain':!![]});return db['VoiceExtension'][_0xf160('0x4c')]({'where':{'id':_0xf31056['VoiceExtensionId']},'raw':!![]})[_0xf160('0x2a')](function(_0x1b3ec0){return createVoicePrefixExtensions(_0xf31056,_0x1b3ec0,_0x321309);});});})[_0xf160('0x2a')](function(){var _0x170ca4=_0x5d81b9[_0xf160('0x50')]['get']({'plain':!![]});if(!_0x170ca4)throw new Error(_0xf160('0x51'));if(_0x170ca4['role']===_0xf160('0x50')){var _0x1229cd=_0xf31056;return db[_0xf160('0x52')][_0xf160('0x4c')]({'where':{'name':_0xf160('0x2d'),'userProfileId':_0x170ca4[_0xf160('0x53')]},'raw':!![]})[_0xf160('0x2a')](function(_0x12c22){if(_0x12c22&&_0x12c22[_0xf160('0x54')]===0x0){return db[_0xf160('0x2e')]['create']({'name':_0x1229cd['name'],'resourceId':_0x1229cd['id'],'type':_0x12c22[_0xf160('0x2f')],'sectionId':_0x12c22['id']},{})[_0xf160('0x2a')](function(){return _0xf31056;});}else{return _0xf31056;}})['catch'](function(_0x12083d){logger[_0xf160('0x55')](_0xf160('0x56'),_0x12083d);throw _0x12083d;});}return _0xf31056;})['then'](respondWithResult(_0x1d5168,null))['catch'](handleError(_0x1d5168,null));};function Extension(_0x12ab32,_0x352ddb,_0x5eeab6,_0x3243c6){this[_0xf160('0x57')]='from-sip';this[_0xf160('0x58')]=_0x12ab32;this[_0xf160('0x59')]=_0x5eeab6;this[_0xf160('0x5a')]=_0xf160('0x5b');this[_0xf160('0x5c')]=_0xf160('0x5d');this['priority']=_0x352ddb;this[_0xf160('0x5e')]=_0x3243c6;}function createVoicePrefixExtensions(_0x3dc02f,_0x30f750,_0x1364bc){return new BPromise(function(_0x38ee0f,_0x5a1be3){var _0x1d22bb=new Extension(formatPrefixName(_0x3dc02f['prefix']),0x1,_0xf160('0x5f'),_0xf160('0x60'));_0x1d22bb[_0xf160('0x61')]=_0x3dc02f['id'];return db[_0xf160('0x62')][_0xf160('0x4e')](_0x1d22bb,{'transaction':_0x1364bc})[_0xf160('0x2a')](function(_0x492d5b){var _0x32ec90=_0x492d5b[_0xf160('0x2c')]({'plain':!![]});var _0x291320=_[_0xf160('0x32')](addVoicePrefixExtensions(_0x3dc02f,_0x30f750),function(_0x40e5a1){_0x40e5a1['VoiceExtensionId']=_0x32ec90['id'];_0x40e5a1['VoicePrefixId']=_0x3dc02f['id'];return _0x40e5a1;});return db[_0xf160('0x62')][_0xf160('0x63')](_0x291320,{'transaction':_0x1364bc})[_0xf160('0x2a')](function(_0x3d8c6c){if(!_0x3d8c6c){return _0x5a1be3(_0xf160('0x64'));}else{return _0x38ee0f(_0x3d8c6c);}})[_0xf160('0x49')](function(_0x4c151f){return _0x5a1be3(_0x4c151f);});});;});};function addVoicePrefixExtensions(_0x25f79e,_0x27332f){var _0x351fa9=[];var _0x352063=formatPrefixName(_0x25f79e[_0xf160('0x65')]);_0x351fa9[_0xf160('0x66')](new Extension(_0x352063,0x2,_0xf160('0x67'),_0xf160('0x68')+_0x25f79e['name']));if(_0x25f79e[_0xf160('0x69')]){_0x351fa9['push'](new Extension(_0x352063,0x3,_0xf160('0x67'),_0xf160('0x6a')+_0x25f79e[_0xf160('0x69')]));}else{_0x351fa9[_0xf160('0x66')](new Extension(_0x352063,0x3,_0xf160('0x5f'),_0xf160('0x6b')));}_0x351fa9['push'](new Extension(_0x352063,0x4,_0xf160('0x6c'),_0x27332f[_0xf160('0x57')]+','+_0xf160('0x6d')+(0x8+_0x25f79e['name'][_0xf160('0x3c')])+'}'+','+0x1));return _0x351fa9;}function formatPrefixName(_0x407a4a){var _0x4db1df='_';for(var _0x1db588=0x0;_0x1db588<_0x407a4a[_0xf160('0x3c')];_0x1db588++){if(_0x407a4a[_0xf160('0x6e')](_0x1db588)=='-'){_0x4db1df+=_0x407a4a['charAt'](_0x1db588);}else{_0x4db1df+='['+_0x407a4a[_0xf160('0x6e')](_0x1db588)+']';}}_0x4db1df+='.';return _0x4db1df;}exports[_0xf160('0x29')]=function(_0x4265e1,_0x4b9d21,_0xc78642){var _0x136919=_0x4265e1[_0xf160('0x4f')];_0x136919[_0xf160('0x65')]=_0xf160('0x6f')+_0x136919[_0xf160('0x2f')]+'-';return db[_0xf160('0x70')]['transaction'](function(_0x797ba1){return db[_0xf160('0x33')][_0xf160('0x29')](_0x136919,{'where':{'id':_0x136919['id']},'transaction':_0x797ba1})['then'](function(){return db[_0xf160('0x62')][_0xf160('0x2b')]({'where':{'VoicePrefixId':_0x136919['id']},'transaction':_0x797ba1})[_0xf160('0x2a')](function(){return db[_0xf160('0x62')][_0xf160('0x4c')]({'where':{'id':_0x136919[_0xf160('0x71')]},'raw':!![]})[_0xf160('0x2a')](function(_0x59b63c){return createVoicePrefixExtensions(_0x136919,_0x59b63c,_0x797ba1);});});});})['then'](function(){return db[_0xf160('0x33')][_0xf160('0x72')](_0x136919['id']);})[_0xf160('0x2a')](respondWithResult(_0x4b9d21,null))[_0xf160('0x49')](handleError(_0x4b9d21,null));};exports[_0xf160('0x73')]=function(_0x722f3a,_0x2f434c,_0x484b18){return db[_0xf160('0x33')][_0xf160('0x4c')]({'where':{'id':_0x722f3a['params']['id']}})['then'](handleEntityNotFound(_0x2f434c,null))[_0xf160('0x2a')](function(_0x14d69d){if(_0x14d69d){return _0x14d69d['addAgents'](_0x722f3a[_0xf160('0x4f')][_0xf160('0x74')],_['omit'](_0x722f3a[_0xf160('0x4f')],['ids','id'])||{})[_0xf160('0x75')](function(_0x355226){for(var _0x74028e=0x0;_0x74028e<_0x722f3a[_0xf160('0x4f')]['ids'][_0xf160('0x3c')];_0x74028e+=0x1){socket[_0xf160('0x76')](_0xf160('0x77'),{'UserId':Number(_0x722f3a[_0xf160('0x4f')][_0xf160('0x74')][_0x74028e]),'VoicePrefixId':Number(_0x722f3a['params']['id'])});}return _0x355226;});}})[_0xf160('0x2a')](respondWithResult(_0x2f434c,null))[_0xf160('0x49')](handleError(_0x2f434c,null));};exports[_0xf160('0x78')]=function(_0x5275b4,_0x2396f6,_0x1165f5){return db[_0xf160('0x33')][_0xf160('0x4c')]({'where':{'id':_0x5275b4[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x2396f6,null))[_0xf160('0x2a')](function(_0x543534){if(_0x543534){return _0x543534[_0xf160('0x78')](_0x5275b4[_0xf160('0x36')][_0xf160('0x74')])[_0xf160('0x2a')](function(){if(_[_0xf160('0x79')](_0x5275b4['query'][_0xf160('0x74')])){for(var _0x3526cd=0x0;_0x3526cd<_0x5275b4[_0xf160('0x36')][_0xf160('0x74')][_0xf160('0x3c')];_0x3526cd+=0x1){socket[_0xf160('0x76')](_0xf160('0x7a'),{'UserId':Number(_0x5275b4[_0xf160('0x36')][_0xf160('0x74')][_0x3526cd]),'VoicePrefixId':Number(_0x5275b4[_0xf160('0x4b')]['id'])});}}else{socket[_0xf160('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x5275b4[_0xf160('0x36')]['ids']),'VoicePrefixId':Number(_0x5275b4[_0xf160('0x4b')]['id'])});}});}})[_0xf160('0x2a')](respondWithStatusCode(_0x2396f6,null))[_0xf160('0x49')](handleError(_0x2396f6,null));};exports[_0xf160('0x7b')]=function(_0x6ff6b1,_0x59281e,_0x3f873a){var _0x38426d={};var _0x2a992a={};var _0x185268;var _0x5927c9;return db['VoicePrefix'][_0xf160('0x7c')]({'where':{'id':_0x6ff6b1['params']['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x59281e,null))['then'](function(_0x21b93a){if(_0x21b93a){_0x185268=_0x21b93a;_0x2a992a['model']=_['keys'](db[_0xf160('0x7d')][_0xf160('0x34')]);_0x2a992a[_0xf160('0x36')]=_[_0xf160('0x37')](_0x6ff6b1[_0xf160('0x36')]);_0x2a992a[_0xf160('0x38')]=_[_0xf160('0x39')](_0x2a992a[_0xf160('0x35')],_0x2a992a[_0xf160('0x36')]);_0x38426d['attributes']=_['intersection'](_0x2a992a[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x6ff6b1[_0xf160('0x36')][_0xf160('0x3b')]));_0x38426d[_0xf160('0x3a')]=_0x38426d['attributes'][_0xf160('0x3c')]?_0x38426d[_0xf160('0x3a')]:_0x2a992a[_0xf160('0x35')];_0x38426d[_0xf160('0x3d')]=qs['sort'](_0x6ff6b1['query']['sort']);_0x38426d[_0xf160('0x3f')]=qs['filters'](_[_0xf160('0x40')](_0x6ff6b1['query'],_0x2a992a[_0xf160('0x38')]));if(_0x6ff6b1[_0xf160('0x36')]['filter']){_0x38426d[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x38426d[_0xf160('0x3f')],{'$or':_[_0xf160('0x32')](_0x38426d[_0xf160('0x3a')],function(_0x39ec7e){var _0x2558b8={};_0x2558b8[_0x39ec7e]={'$like':'%'+_0x6ff6b1['query']['filter']+'%'};return _0x2558b8;})});}_0x38426d=_[_0xf160('0x42')]({},_0x38426d,_0x6ff6b1[_0xf160('0x44')]);return _0x185268[_0xf160('0x7b')](_0x38426d);}})['then'](function(_0x5316c5){if(_0x5316c5){_0x5927c9=_0x5316c5[_0xf160('0x3c')];if(!_0x6ff6b1[_0xf160('0x36')][_0xf160('0x7e')](_0xf160('0x7f'))){_0x38426d[_0xf160('0x22')]=qs[_0xf160('0x22')](_0x6ff6b1[_0xf160('0x36')][_0xf160('0x22')]);_0x38426d[_0xf160('0x20')]=qs[_0xf160('0x20')](_0x6ff6b1['query'][_0xf160('0x20')]);}return _0x185268[_0xf160('0x7b')](_0x38426d);}})[_0xf160('0x2a')](function(_0x3ee8d8){if(_0x3ee8d8){return _0x3ee8d8?{'count':_0x5927c9,'rows':_0x3ee8d8}:null;}})[_0xf160('0x2a')](respondWithResult(_0x59281e,null))[_0xf160('0x49')](handleError(_0x59281e,null));};exports['getTeams']=function(_0x336560,_0x120282,_0x2b6e56){var _0x362718={};var _0xcf5dee={};var _0x2a8af4;var _0x224dcc;return db[_0xf160('0x33')]['findOne']({'where':{'id':_0x336560['params']['id']}})[_0xf160('0x2a')](handleEntityNotFound(_0x120282,null))[_0xf160('0x2a')](function(_0x55865d){if(_0x55865d){_0x2a8af4=_0x55865d;_0xcf5dee[_0xf160('0x35')]=_[_0xf160('0x37')](db[_0xf160('0x80')][_0xf160('0x34')]);_0xcf5dee[_0xf160('0x36')]=_[_0xf160('0x37')](_0x336560[_0xf160('0x36')]);_0xcf5dee[_0xf160('0x38')]=_[_0xf160('0x39')](_0xcf5dee[_0xf160('0x35')],_0xcf5dee['query']);_0x362718[_0xf160('0x3a')]=_[_0xf160('0x39')](_0xcf5dee[_0xf160('0x35')],qs[_0xf160('0x3b')](_0x336560[_0xf160('0x36')]['fields']));_0x362718[_0xf160('0x3a')]=_0x362718[_0xf160('0x3a')][_0xf160('0x3c')]?_0x362718[_0xf160('0x3a')]:_0xcf5dee['model'];_0x362718[_0xf160('0x3d')]=qs[_0xf160('0x3e')](_0x336560['query']['sort']);_0x362718['where']=qs['filters'](_['pick'](_0x336560[_0xf160('0x36')],_0xcf5dee[_0xf160('0x38')]));if(_0x336560['query']['filter']){_0x362718[_0xf160('0x3f')]=_[_0xf160('0x42')](_0x362718['where'],{'$or':_[_0xf160('0x32')](_0x362718['attributes'],function(_0x32fb34){var _0x3b1d1a={};_0x3b1d1a[_0x32fb34]={'$like':'%'+_0x336560[_0xf160('0x36')]['filter']+'%'};return _0x3b1d1a;})});}_0x362718=_[_0xf160('0x42')]({},_0x362718,_0x336560['options']);return _0x2a8af4[_0xf160('0x81')](_0x362718);}})['then'](function(_0x308dd9){if(_0x308dd9){_0x224dcc=_0x308dd9['length'];if(!_0x336560[_0xf160('0x36')]['hasOwnProperty'](_0xf160('0x7f'))){_0x362718[_0xf160('0x22')]=qs['limit'](_0x336560[_0xf160('0x36')][_0xf160('0x22')]);_0x362718['offset']=qs[_0xf160('0x20')](_0x336560[_0xf160('0x36')][_0xf160('0x20')]);}return _0x2a8af4[_0xf160('0x81')](_0x362718);}})['then'](function(_0x5cdecf){if(_0x5cdecf){return _0x5cdecf?{'count':_0x224dcc,'rows':_0x5cdecf}:null;}})[_0xf160('0x2a')](respondWithResult(_0x120282,null))[_0xf160('0x49')](handleError(_0x120282,null));};exports['addTeams']=function(_0x28b2cb,_0x24e3b5,_0x5c0dc8){var _0x182ed8=_0x28b2cb['body'][_0xf160('0x74')];var _0x2eada8;return db[_0xf160('0x80')]['findAll']({'where':{'id':_0x182ed8},'attributes':['id'],'include':[{'model':db[_0xf160('0x7d')],'as':_0xf160('0x82'),'attributes':['id',_0xf160('0x2f'),_0xf160('0x83'),_0xf160('0x84'),_0xf160('0x85')],'raw':!![]}]})[_0xf160('0x2a')](function(_0x2dbb52){if(_0x2dbb52){_0x2eada8=_0x2dbb52;var _0x5b29e0=_['flatMap'](_0x2dbb52,function(_0x2ae1dc){var _0x50912b=_0x2ae1dc['get']({'plain':!![]});return _0x50912b[_0xf160('0x82')];});return db['VoicePrefix'][_0xf160('0x4c')]({'where':{'id':_0x28b2cb[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](function(_0x26aa72){return db[_0xf160('0x70')][_0xf160('0x86')](function(_0x1bef1a){return _0x26aa72[_0xf160('0x87')](_0x182ed8,{'transaction':_0x1bef1a})[_0xf160('0x2a')](function(){return BPromise[_0xf160('0x88')](_0x2eada8,function(_0x154789){return db[_0xf160('0x89')][_0xf160('0x8a')]({'TeamId':_0x154789['id'],'VoicePrefixId':_0x28b2cb['params']['id']},{'transaction':_0x1bef1a});});})[_0xf160('0x2a')](function(){return BPromise[_0xf160('0x88')](_0x5b29e0,function(_0x3e46d1){return db[_0xf160('0x8b')][_0xf160('0x8c')]({'where':{'UserId':_0x3e46d1['id'],'VoicePrefixId':_0x28b2cb[_0xf160('0x4b')]['id']},'transaction':_0x1bef1a});});})[_0xf160('0x2a')](function(){_0x5b29e0[_0xf160('0x8d')](function(_0x3e9116){socket[_0xf160('0x76')](_0xf160('0x77'),{'UserId':_0x3e9116['id'],'VoicePrefixId':_0x26aa72['id']});});});});});}})[_0xf160('0x2a')](respondWithStatusCode(_0x24e3b5,null))[_0xf160('0x49')](handleError(_0x24e3b5,null));};exports[_0xf160('0x8e')]=function(_0x481f96,_0x4186f7,_0x37579a){return db[_0xf160('0x80')][_0xf160('0x47')]({'where':{'id':_0x481f96[_0xf160('0x36')][_0xf160('0x74')]},'attributes':['id'],'include':[{'model':db[_0xf160('0x7d')],'as':_0xf160('0x82'),'attributes':['id'],'raw':!![]}]})[_0xf160('0x2a')](handleEntityNotFound(_0x4186f7,null))[_0xf160('0x2a')](function(_0x36c1c5){var _0x4753d6=_[_0xf160('0x32')](_0x36c1c5,'id');var _0x2c486d=[];var _0x26332b=[];var _0x539056=squel['select']();_0x539056['field'](_0xf160('0x8f'))[_0xf160('0x90')](_0xf160('0x91'),'tq')[_0xf160('0x92')](_0xf160('0x93'),'ut',_0xf160('0x94'))['where'](_0xf160('0x95'),_0x481f96[_0xf160('0x4b')]['id']);for(var _0x1d308e=0x0;_0x1d308e<_0x36c1c5[_0xf160('0x3c')];_0x1d308e+=0x1){let _0x5bc8a3=_0x36c1c5[_0x1d308e];for(var _0x19dc59=0x0;_0x19dc59<_0x5bc8a3[_0xf160('0x82')][_0xf160('0x3c')];_0x19dc59+=0x1){let _0x35de2b=_0x5bc8a3[_0xf160('0x82')][_0x19dc59];var _0x446548=_0x539056[_0xf160('0x96')]();_0x446548[_0xf160('0x3f')](_0xf160('0x97'),_0x35de2b['id']);_0x26332b[_0xf160('0x66')](db[_0xf160('0x70')][_0xf160('0x36')](_0x446548[_0xf160('0x98')](),{'type':db[_0xf160('0x70')][_0xf160('0x99')][_0xf160('0x9a')]})[_0xf160('0x2a')](function(_0x258ad9){if(_0x258ad9['length']===0x1){return _0x35de2b['id'];}else{var _0x27d3ef=_['every'](_['map'](_0x258ad9,'TeamId'),function(_0x191d89){return _[_0xf160('0x9b')](_0x4753d6,_0x191d89);});if(_0x27d3ef){return _0x35de2b['id'];}}}));}}return BPromise[_0xf160('0x9c')](_0x26332b)[_0xf160('0x2a')](function(_0x2391f9){_0x2c486d=_(_0x2c486d)['union'](_0x2391f9)['compact']()[_0xf160('0x9d')]();return db[_0xf160('0x33')]['find']({'where':{'id':_0x481f96[_0xf160('0x4b')]['id']}})[_0xf160('0x2a')](function(_0x3d9b9b){return db[_0xf160('0x70')][_0xf160('0x86')](function(_0x563e5d){return _0x3d9b9b[_0xf160('0x8e')](_0x481f96['query'][_0xf160('0x74')],{'transaction':_0x563e5d})[_0xf160('0x2a')](function(){if(!_[_0xf160('0x9e')](_0x2c486d)){return _0x3d9b9b['removeAgents'](_0x2c486d,{'transaction':_0x563e5d});}})[_0xf160('0x2a')](function(){_0x2c486d[_0xf160('0x8d')](function(_0xfb5d28){socket[_0xf160('0x76')](_0xf160('0x7a'),{'UserId':_0xfb5d28,'VoicePrefixId':_0x3d9b9b['id']});});});});});});})[_0xf160('0x2a')](respondWithStatusCode(_0x4186f7,null))[_0xf160('0x49')](handleError(_0x4186f7,null));}; \ No newline at end of file +var _0x5423=['user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','CDR(prefix)=','callerIdAll','Set','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','filter','getAgents','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','each','upsert','UserVoicePrefix','forEach','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','compact','isEmpty','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','stack','name','send','index','VoicePrefix','fieldName','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','sequelize','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x531d76,_0x2c297d){var _0x44379d=function(_0x356d6e){while(--_0x356d6e){_0x531d76['push'](_0x531d76['shift']());}};_0x44379d(++_0x2c297d);}(_0x5423,0xe3));var _0x3542=function(_0x3d45b4,_0x4a757a){_0x3d45b4=_0x3d45b4-0x0;var _0x4a85b7=_0x5423[_0x3d45b4];return _0x4a85b7;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];config[_0x3542('0x18')]=_[_0x3542('0x19')](config[_0x3542('0x18')],{'host':_0x3542('0x1a'),'port':0x18eb});var socket=require(_0x3542('0x1b'))(new Redis(config[_0x3542('0x18')]));require(_0x3542('0x1c'))['register'](socket);function respondWithStatusCode(_0x14fe57,_0x4fb366){_0x4fb366=_0x4fb366||0xcc;return function(_0x3bfb33){if(_0x3bfb33){return _0x14fe57[_0x3542('0x1d')](_0x4fb366);}return _0x14fe57[_0x3542('0x1e')](_0x4fb366)['end']();};}function respondWithResult(_0x270312,_0x177fb9){_0x177fb9=_0x177fb9||0xc8;return function(_0x347ac8){if(_0x347ac8){return _0x270312['status'](_0x177fb9)[_0x3542('0x1f')](_0x347ac8);}};}function respondWithFilteredResult(_0x23b0de,_0x116859){return function(_0x3d5199){if(_0x3d5199){var _0x493d95=typeof _0x116859[_0x3542('0x20')]==='undefined'&&typeof _0x116859[_0x3542('0x21')]===_0x3542('0x22');var _0x4d93bc=_0x3d5199[_0x3542('0x23')];var _0x199f7d=_0x493d95?0x0:_0x116859[_0x3542('0x20')];var _0x1302fb=_0x493d95?_0x3d5199[_0x3542('0x23')]:_0x116859['offset']+_0x116859['limit'];var _0x4c58f1;if(_0x1302fb>=_0x4d93bc){_0x1302fb=_0x4d93bc;_0x4c58f1=0xc8;}else{_0x4c58f1=0xce;}_0x23b0de[_0x3542('0x1e')](_0x4c58f1);return _0x23b0de['set'](_0x3542('0x24'),_0x199f7d+'-'+_0x1302fb+'/'+_0x4d93bc)['json'](_0x3d5199);}return null;};}function patchUpdates(_0x1d5f1e){return function(_0x55774d){try{jsonpatch['apply'](_0x55774d,_0x1d5f1e,!![]);}catch(_0x3eacd0){return BPromise[_0x3542('0x25')](_0x3eacd0);}return _0x55774d['save']();};}function saveUpdates(_0x5d05b2,_0x3fc964){return function(_0x5123f0){if(_0x5123f0){return _0x5123f0[_0x3542('0x26')](_0x5d05b2)[_0x3542('0x27')](function(_0x1e0723){return _0x1e0723;});}return null;};}function removeEntity(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(_0xf1f7d0){return _0xf1f7d0[_0x3542('0x28')]()[_0x3542('0x27')](function(){var _0x18dc6c=_0xf1f7d0[_0x3542('0x29')]({'plain':!![]});var _0xfdfe62=_0x3542('0x2a');return db[_0x3542('0x2b')][_0x3542('0x28')]({'where':{'type':_0xfdfe62,'resourceId':_0x18dc6c['id']}})[_0x3542('0x27')](function(){return _0xf1f7d0;});})[_0x3542('0x27')](function(){_0x2f2e63[_0x3542('0x1e')](0xcc)[_0x3542('0x2c')]();});}};}function handleEntityNotFound(_0x3bd666,_0x5590a2){return function(_0x31ad47){if(!_0x31ad47){_0x3bd666[_0x3542('0x1d')](0x194);}return _0x31ad47;};}function handleError(_0x2aec76,_0x4a3ad0){_0x4a3ad0=_0x4a3ad0||0x1f4;return function(_0x402c97){logger[_0x3542('0x2d')](_0x402c97[_0x3542('0x2e')]);if(_0x402c97[_0x3542('0x2f')]){delete _0x402c97['name'];}_0x2aec76['status'](_0x4a3ad0)[_0x3542('0x30')](_0x402c97);};}exports[_0x3542('0x31')]=function(_0xd19bf4,_0x44e8f7){var _0x209e7f={},_0x1e5789={},_0x1f43d2={'count':0x0,'rows':[]};var _0x49b18a=_['map'](db[_0x3542('0x32')]['rawAttributes'],function(_0x4ec0c1){return{'name':_0x4ec0c1[_0x3542('0x33')],'type':_0x4ec0c1['type']['key']};});_0x1e5789[_0x3542('0x34')]=_[_0x3542('0x35')](_0x49b18a,_0x3542('0x2f'));_0x1e5789['query']=_[_0x3542('0x36')](_0xd19bf4['query']);_0x1e5789[_0x3542('0x37')]=_[_0x3542('0x38')](_0x1e5789['model'],_0x1e5789[_0x3542('0x39')]);_0x209e7f['attributes']=_[_0x3542('0x38')](_0x1e5789[_0x3542('0x34')],qs[_0x3542('0x3a')](_0xd19bf4['query'][_0x3542('0x3a')]));_0x209e7f['attributes']=_0x209e7f[_0x3542('0x3b')][_0x3542('0x3c')]?_0x209e7f[_0x3542('0x3b')]:_0x1e5789[_0x3542('0x34')];if(!_0xd19bf4[_0x3542('0x39')][_0x3542('0x3d')](_0x3542('0x3e'))){_0x209e7f[_0x3542('0x21')]=qs[_0x3542('0x21')](_0xd19bf4[_0x3542('0x39')][_0x3542('0x21')]);_0x209e7f[_0x3542('0x20')]=qs[_0x3542('0x20')](_0xd19bf4['query'][_0x3542('0x20')]);}_0x209e7f['order']=qs['sort'](_0xd19bf4[_0x3542('0x39')][_0x3542('0x3f')]);_0x209e7f[_0x3542('0x40')]=qs[_0x3542('0x37')](_[_0x3542('0x41')](_0xd19bf4[_0x3542('0x39')],_0x1e5789[_0x3542('0x37')]),_0x49b18a);if(_0xd19bf4[_0x3542('0x39')]['filter']){_0x209e7f[_0x3542('0x40')]=_['merge'](_0x209e7f[_0x3542('0x40')],{'$or':_[_0x3542('0x35')](_0x49b18a,function(_0x57900f){if(_0x57900f[_0x3542('0x42')]!==_0x3542('0x43')){var _0x49d879={};_0x49d879[_0x57900f[_0x3542('0x2f')]]={'$like':'%'+_0xd19bf4[_0x3542('0x39')]['filter']+'%'};return _0x49d879;}})});}_0x209e7f=_[_0x3542('0x44')]({},_0x209e7f,_0xd19bf4[_0x3542('0x45')]);var _0x18c5aa={'where':_0x209e7f[_0x3542('0x40')]};return db[_0x3542('0x32')][_0x3542('0x23')](_0x18c5aa)[_0x3542('0x27')](function(_0x4bf45a){_0x1f43d2['count']=_0x4bf45a;if(_0xd19bf4[_0x3542('0x39')][_0x3542('0x46')]){_0x209e7f[_0x3542('0x47')]=[{'all':!![]}];}return db[_0x3542('0x32')][_0x3542('0x48')](_0x209e7f);})['then'](function(_0x3e6a49){_0x1f43d2['rows']=_0x3e6a49;return _0x1f43d2;})[_0x3542('0x27')](respondWithFilteredResult(_0x44e8f7,_0x209e7f))[_0x3542('0x49')](handleError(_0x44e8f7,null));};exports[_0x3542('0x4a')]=function(_0x5255a3,_0x1ea685){var _0x2c2bb2={'raw':![],'where':{'id':_0x5255a3[_0x3542('0x4b')]['id']}},_0x524925={};_0x524925[_0x3542('0x34')]=_[_0x3542('0x36')](db[_0x3542('0x32')][_0x3542('0x4c')]);_0x524925[_0x3542('0x39')]=_[_0x3542('0x36')](_0x5255a3[_0x3542('0x39')]);_0x524925['filters']=_['intersection'](_0x524925['model'],_0x524925[_0x3542('0x39')]);_0x2c2bb2[_0x3542('0x3b')]=_[_0x3542('0x38')](_0x524925[_0x3542('0x34')],qs[_0x3542('0x3a')](_0x5255a3[_0x3542('0x39')][_0x3542('0x3a')]));_0x2c2bb2['attributes']=_0x2c2bb2[_0x3542('0x3b')][_0x3542('0x3c')]?_0x2c2bb2[_0x3542('0x3b')]:_0x524925[_0x3542('0x34')];if(_0x5255a3['query'][_0x3542('0x46')]){_0x2c2bb2[_0x3542('0x47')]=[{'all':!![]}];}_0x2c2bb2=_['merge']({},_0x2c2bb2,_0x5255a3['options']);return db[_0x3542('0x32')][_0x3542('0x4d')](_0x2c2bb2)[_0x3542('0x27')](handleEntityNotFound(_0x1ea685,null))[_0x3542('0x27')](respondWithResult(_0x1ea685,null))[_0x3542('0x49')](handleError(_0x1ea685,null));};exports[_0x3542('0x28')]=function(_0x42cf91,_0x594189){return db[_0x3542('0x32')][_0x3542('0x4d')]({'where':{'id':_0x42cf91[_0x3542('0x4b')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x594189,null))[_0x3542('0x27')](removeEntity(_0x594189,null))[_0x3542('0x49')](handleError(_0x594189,null));};exports[_0x3542('0x4e')]=function(_0x331506,_0xaf8f1){return db['VoicePrefix']['describe']()[_0x3542('0x27')](respondWithResult(_0xaf8f1,null))['catch'](handleError(_0xaf8f1,null));};exports['create']=function(_0x572e7a,_0x286222){var _0xd5c5c3;return db[_0x3542('0x4f')]['transaction'](function(_0x2db495){return db[_0x3542('0x32')]['create'](_0x572e7a[_0x3542('0x50')],{'transaction':_0x2db495})[_0x3542('0x27')](function(_0x442000){_0xd5c5c3=_0x442000[_0x3542('0x29')]({'plain':!![]});return db[_0x3542('0x51')]['find']({'where':{'id':_0xd5c5c3[_0x3542('0x52')]},'raw':!![]})[_0x3542('0x27')](function(_0x2989c3){return createVoicePrefixExtensions(_0xd5c5c3,_0x2989c3,_0x2db495);});});})[_0x3542('0x27')](function(){var _0xbf9a5=_0x572e7a['user']['get']({'plain':!![]});if(!_0xbf9a5)throw new Error(_0x3542('0x53'));if(_0xbf9a5[_0x3542('0x54')]===_0x3542('0x55')){var _0x5de994=_0xd5c5c3;return db[_0x3542('0x56')][_0x3542('0x4d')]({'where':{'name':_0x3542('0x2a'),'userProfileId':_0xbf9a5[_0x3542('0x57')]},'raw':!![]})[_0x3542('0x27')](function(_0x5d49cc){if(_0x5d49cc&&_0x5d49cc['autoAssociation']===0x0){return db[_0x3542('0x2b')]['create']({'name':_0x5de994[_0x3542('0x2f')],'resourceId':_0x5de994['id'],'type':_0x5d49cc[_0x3542('0x2f')],'sectionId':_0x5d49cc['id']},{})['then'](function(){return _0xd5c5c3;});}else{return _0xd5c5c3;}})[_0x3542('0x49')](function(_0x422535){logger[_0x3542('0x2d')](_0x3542('0x58'),_0x422535);throw _0x422535;});}return _0xd5c5c3;})[_0x3542('0x27')](respondWithResult(_0x286222,null))['catch'](handleError(_0x286222,null));};function Extension(_0x4cb73f,_0x271dd0,_0x56b920,_0x1ffa0a){this[_0x3542('0x59')]=_0x3542('0x5a');this['exten']=_0x4cb73f;this[_0x3542('0x5b')]=_0x56b920;this[_0x3542('0x42')]=_0x3542('0x5c');this[_0x3542('0x5d')]=_0x3542('0x5e');this[_0x3542('0x5f')]=_0x271dd0;this['appdata']=_0x1ffa0a;}function createVoicePrefixExtensions(_0x2e75a1,_0x3ee446,_0x44c95a){return new BPromise(function(_0x411de1,_0x302bed){var _0x43dd32=new Extension(formatPrefixName(_0x2e75a1['prefix']),0x1,_0x3542('0x60'),_0x3542('0x61'));_0x43dd32[_0x3542('0x62')]=_0x2e75a1['id'];return db[_0x3542('0x51')]['create'](_0x43dd32,{'transaction':_0x44c95a})[_0x3542('0x27')](function(_0x2bb95c){var _0x5349a8=_0x2bb95c['get']({'plain':!![]});var _0x2908e5=_['map'](addVoicePrefixExtensions(_0x2e75a1,_0x3ee446),function(_0x3be40e){_0x3be40e['VoiceExtensionId']=_0x5349a8['id'];_0x3be40e['VoicePrefixId']=_0x2e75a1['id'];return _0x3be40e;});return db[_0x3542('0x51')][_0x3542('0x63')](_0x2908e5,{'transaction':_0x44c95a})[_0x3542('0x27')](function(_0x3bba0d){if(!_0x3bba0d){return _0x302bed(_0x3542('0x64'));}else{return _0x411de1(_0x3bba0d);}})[_0x3542('0x49')](function(_0x32b137){return _0x302bed(_0x32b137);});});;});};function addVoicePrefixExtensions(_0x557c5c,_0x365947){var _0xf1cf57=[];var _0x16faf1=formatPrefixName(_0x557c5c[_0x3542('0x65')]);_0xf1cf57[_0x3542('0x66')](new Extension(_0x16faf1,0x2,'Set',_0x3542('0x67')+_0x557c5c[_0x3542('0x2f')]));if(_0x557c5c[_0x3542('0x68')]){_0xf1cf57[_0x3542('0x66')](new Extension(_0x16faf1,0x3,_0x3542('0x69'),_0x3542('0x6a')+_0x557c5c[_0x3542('0x68')]));}else{_0xf1cf57['push'](new Extension(_0x16faf1,0x3,_0x3542('0x60'),'No\x20callerid\x20available'));}_0xf1cf57[_0x3542('0x66')](new Extension(_0x16faf1,0x4,_0x3542('0x6b'),_0x365947[_0x3542('0x59')]+','+_0x3542('0x6c')+(0x8+_0x557c5c['name']['length'])+'}'+','+0x1));return _0xf1cf57;}function formatPrefixName(_0x5b3d44){var _0x2f36c6='_';for(var _0x349a9e=0x0;_0x349a9e<_0x5b3d44[_0x3542('0x3c')];_0x349a9e++){if(_0x5b3d44[_0x3542('0x6d')](_0x349a9e)=='-'){_0x2f36c6+=_0x5b3d44[_0x3542('0x6d')](_0x349a9e);}else{_0x2f36c6+='['+_0x5b3d44[_0x3542('0x6d')](_0x349a9e)+']';}}_0x2f36c6+='.';return _0x2f36c6;}exports[_0x3542('0x26')]=function(_0x77f0af,_0x2b0de0,_0x5c8061){var _0x37ce35=_0x77f0af[_0x3542('0x50')];_0x37ce35[_0x3542('0x65')]=_0x3542('0x6e')+_0x37ce35[_0x3542('0x2f')]+'-';return db['sequelize']['transaction'](function(_0x51b83c){return db[_0x3542('0x32')]['update'](_0x37ce35,{'where':{'id':_0x37ce35['id']},'transaction':_0x51b83c})[_0x3542('0x27')](function(){return db['VoiceExtension'][_0x3542('0x28')]({'where':{'VoicePrefixId':_0x37ce35['id']},'transaction':_0x51b83c})['then'](function(){return db[_0x3542('0x51')][_0x3542('0x4d')]({'where':{'id':_0x37ce35['VoiceExtensionId']},'raw':!![]})['then'](function(_0x5488f8){return createVoicePrefixExtensions(_0x37ce35,_0x5488f8,_0x51b83c);});});});})[_0x3542('0x27')](function(){return db['VoicePrefix'][_0x3542('0x6f')](_0x37ce35['id']);})[_0x3542('0x27')](respondWithResult(_0x2b0de0,null))['catch'](handleError(_0x2b0de0,null));};exports[_0x3542('0x70')]=function(_0x345082,_0x12d32a,_0x51d0a8){return db[_0x3542('0x32')]['find']({'where':{'id':_0x345082[_0x3542('0x4b')]['id']}})['then'](handleEntityNotFound(_0x12d32a,null))[_0x3542('0x27')](function(_0xf10a99){if(_0xf10a99){return _0xf10a99[_0x3542('0x70')](_0x345082['body'][_0x3542('0x71')],_[_0x3542('0x72')](_0x345082[_0x3542('0x50')],[_0x3542('0x71'),'id'])||{})['spread'](function(_0x5b2016){for(var _0x3f9cdb=0x0;_0x3f9cdb<_0x345082[_0x3542('0x50')][_0x3542('0x71')][_0x3542('0x3c')];_0x3f9cdb+=0x1){socket[_0x3542('0x73')](_0x3542('0x74'),{'UserId':Number(_0x345082[_0x3542('0x50')][_0x3542('0x71')][_0x3f9cdb]),'VoicePrefixId':Number(_0x345082[_0x3542('0x4b')]['id'])});}return _0x5b2016;});}})[_0x3542('0x27')](respondWithResult(_0x12d32a,null))[_0x3542('0x49')](handleError(_0x12d32a,null));};exports[_0x3542('0x75')]=function(_0x23f092,_0x8a72fb,_0x33719d){return db[_0x3542('0x32')][_0x3542('0x4d')]({'where':{'id':_0x23f092[_0x3542('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8a72fb,null))[_0x3542('0x27')](function(_0x10f7d2){if(_0x10f7d2){return _0x10f7d2['removeAgents'](_0x23f092['query'][_0x3542('0x71')])[_0x3542('0x27')](function(){if(_[_0x3542('0x76')](_0x23f092[_0x3542('0x39')]['ids'])){for(var _0x263ff6=0x0;_0x263ff6<_0x23f092[_0x3542('0x39')]['ids'][_0x3542('0x3c')];_0x263ff6+=0x1){socket['emit'](_0x3542('0x77'),{'UserId':Number(_0x23f092['query'][_0x3542('0x71')][_0x263ff6]),'VoicePrefixId':Number(_0x23f092[_0x3542('0x4b')]['id'])});}}else{socket[_0x3542('0x73')](_0x3542('0x77'),{'UserId':Number(_0x23f092[_0x3542('0x39')][_0x3542('0x71')]),'VoicePrefixId':Number(_0x23f092[_0x3542('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x8a72fb,null))[_0x3542('0x49')](handleError(_0x8a72fb,null));};exports['getAgents']=function(_0x55c2a7,_0x3c47c1,_0x1a9a73){var _0x2c6f2b={};var _0x40c19c={};var _0x593bf1;var _0x468804;return db[_0x3542('0x32')][_0x3542('0x78')]({'where':{'id':_0x55c2a7[_0x3542('0x4b')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x3c47c1,null))[_0x3542('0x27')](function(_0x1bc57f){if(_0x1bc57f){_0x593bf1=_0x1bc57f;_0x40c19c[_0x3542('0x34')]=_[_0x3542('0x36')](db[_0x3542('0x79')]['rawAttributes']);_0x40c19c['query']=_[_0x3542('0x36')](_0x55c2a7['query']);_0x40c19c[_0x3542('0x37')]=_[_0x3542('0x38')](_0x40c19c[_0x3542('0x34')],_0x40c19c['query']);_0x2c6f2b[_0x3542('0x3b')]=_[_0x3542('0x38')](_0x40c19c[_0x3542('0x34')],qs['fields'](_0x55c2a7[_0x3542('0x39')]['fields']));_0x2c6f2b[_0x3542('0x3b')]=_0x2c6f2b[_0x3542('0x3b')][_0x3542('0x3c')]?_0x2c6f2b['attributes']:_0x40c19c[_0x3542('0x34')];_0x2c6f2b['order']=qs[_0x3542('0x3f')](_0x55c2a7['query']['sort']);_0x2c6f2b[_0x3542('0x40')]=qs[_0x3542('0x37')](_['pick'](_0x55c2a7[_0x3542('0x39')],_0x40c19c['filters']));if(_0x55c2a7[_0x3542('0x39')]['filter']){_0x2c6f2b[_0x3542('0x40')]=_[_0x3542('0x44')](_0x2c6f2b[_0x3542('0x40')],{'$or':_[_0x3542('0x35')](_0x2c6f2b[_0x3542('0x3b')],function(_0x4accdb){var _0x40ad35={};_0x40ad35[_0x4accdb]={'$like':'%'+_0x55c2a7[_0x3542('0x39')][_0x3542('0x7a')]+'%'};return _0x40ad35;})});}_0x2c6f2b=_['merge']({},_0x2c6f2b,_0x55c2a7[_0x3542('0x45')]);return _0x593bf1[_0x3542('0x7b')](_0x2c6f2b);}})[_0x3542('0x27')](function(_0x32a91e){if(_0x32a91e){_0x468804=_0x32a91e[_0x3542('0x3c')];if(!_0x55c2a7[_0x3542('0x39')][_0x3542('0x3d')]('nolimit')){_0x2c6f2b[_0x3542('0x21')]=qs[_0x3542('0x21')](_0x55c2a7['query']['limit']);_0x2c6f2b['offset']=qs[_0x3542('0x20')](_0x55c2a7[_0x3542('0x39')][_0x3542('0x20')]);}return _0x593bf1[_0x3542('0x7b')](_0x2c6f2b);}})[_0x3542('0x27')](function(_0x47a913){if(_0x47a913){return _0x47a913?{'count':_0x468804,'rows':_0x47a913}:null;}})['then'](respondWithResult(_0x3c47c1,null))[_0x3542('0x49')](handleError(_0x3c47c1,null));};exports['getTeams']=function(_0x41157c,_0x446817,_0x1d275b){var _0x7c8e51={};var _0x5912ef={};var _0x4737ee;var _0x40fa0d;return db[_0x3542('0x32')][_0x3542('0x78')]({'where':{'id':_0x41157c[_0x3542('0x4b')]['id']}})[_0x3542('0x27')](handleEntityNotFound(_0x446817,null))[_0x3542('0x27')](function(_0x5481e9){if(_0x5481e9){_0x4737ee=_0x5481e9;_0x5912ef['model']=_[_0x3542('0x36')](db['Team'][_0x3542('0x4c')]);_0x5912ef[_0x3542('0x39')]=_[_0x3542('0x36')](_0x41157c[_0x3542('0x39')]);_0x5912ef['filters']=_[_0x3542('0x38')](_0x5912ef[_0x3542('0x34')],_0x5912ef['query']);_0x7c8e51[_0x3542('0x3b')]=_[_0x3542('0x38')](_0x5912ef[_0x3542('0x34')],qs[_0x3542('0x3a')](_0x41157c[_0x3542('0x39')][_0x3542('0x3a')]));_0x7c8e51[_0x3542('0x3b')]=_0x7c8e51['attributes']['length']?_0x7c8e51[_0x3542('0x3b')]:_0x5912ef['model'];_0x7c8e51['order']=qs['sort'](_0x41157c[_0x3542('0x39')][_0x3542('0x3f')]);_0x7c8e51['where']=qs[_0x3542('0x37')](_[_0x3542('0x41')](_0x41157c[_0x3542('0x39')],_0x5912ef[_0x3542('0x37')]));if(_0x41157c[_0x3542('0x39')]['filter']){_0x7c8e51[_0x3542('0x40')]=_['merge'](_0x7c8e51[_0x3542('0x40')],{'$or':_['map'](_0x7c8e51[_0x3542('0x3b')],function(_0x32b2d1){var _0x4ad1e2={};_0x4ad1e2[_0x32b2d1]={'$like':'%'+_0x41157c['query'][_0x3542('0x7a')]+'%'};return _0x4ad1e2;})});}_0x7c8e51=_['merge']({},_0x7c8e51,_0x41157c[_0x3542('0x45')]);return _0x4737ee[_0x3542('0x7c')](_0x7c8e51);}})[_0x3542('0x27')](function(_0x2f86ef){if(_0x2f86ef){_0x40fa0d=_0x2f86ef['length'];if(!_0x41157c[_0x3542('0x39')]['hasOwnProperty'](_0x3542('0x3e'))){_0x7c8e51[_0x3542('0x21')]=qs[_0x3542('0x21')](_0x41157c[_0x3542('0x39')][_0x3542('0x21')]);_0x7c8e51[_0x3542('0x20')]=qs[_0x3542('0x20')](_0x41157c[_0x3542('0x39')]['offset']);}return _0x4737ee[_0x3542('0x7c')](_0x7c8e51);}})[_0x3542('0x27')](function(_0x97014){if(_0x97014){return _0x97014?{'count':_0x40fa0d,'rows':_0x97014}:null;}})[_0x3542('0x27')](respondWithResult(_0x446817,null))[_0x3542('0x49')](handleError(_0x446817,null));};exports[_0x3542('0x7d')]=function(_0x903746,_0x363be1,_0x537baf){var _0x40f0ea=_0x903746[_0x3542('0x50')][_0x3542('0x71')];var _0x43c45a;return db[_0x3542('0x7e')]['findAll']({'where':{'id':_0x40f0ea},'attributes':['id'],'include':[{'model':db[_0x3542('0x79')],'as':_0x3542('0x7f'),'attributes':['id',_0x3542('0x2f'),_0x3542('0x80'),_0x3542('0x81'),_0x3542('0x82')],'raw':!![]}]})['then'](function(_0x2dccea){if(_0x2dccea){_0x43c45a=_0x2dccea;var _0x404b41=_[_0x3542('0x83')](_0x2dccea,function(_0x3f4459){var _0x39fda0=_0x3f4459['get']({'plain':!![]});return _0x39fda0[_0x3542('0x7f')];});return db[_0x3542('0x32')][_0x3542('0x4d')]({'where':{'id':_0x903746['params']['id']}})[_0x3542('0x27')](function(_0x3517aa){return db[_0x3542('0x4f')][_0x3542('0x84')](function(_0x5be1ce){return _0x3517aa[_0x3542('0x7d')](_0x40f0ea,{'transaction':_0x5be1ce})[_0x3542('0x27')](function(){return BPromise[_0x3542('0x85')](_0x43c45a,function(_0x4e5ca6){return db['TeamVoicePrefix'][_0x3542('0x86')]({'TeamId':_0x4e5ca6['id'],'VoicePrefixId':_0x903746[_0x3542('0x4b')]['id']},{'transaction':_0x5be1ce});});})[_0x3542('0x27')](function(){return BPromise[_0x3542('0x85')](_0x404b41,function(_0xdd4842){return db[_0x3542('0x87')]['findOrCreate']({'where':{'UserId':_0xdd4842['id'],'VoicePrefixId':_0x903746[_0x3542('0x4b')]['id']},'transaction':_0x5be1ce});});})[_0x3542('0x27')](function(){_0x404b41[_0x3542('0x88')](function(_0x51d0bb){socket[_0x3542('0x73')](_0x3542('0x74'),{'UserId':_0x51d0bb['id'],'VoicePrefixId':_0x3517aa['id']});});});});});}})[_0x3542('0x27')](respondWithStatusCode(_0x363be1,null))[_0x3542('0x49')](handleError(_0x363be1,null));};exports[_0x3542('0x89')]=function(_0x1ab57e,_0x299d11,_0x1e2111){return db[_0x3542('0x7e')]['findAll']({'where':{'id':_0x1ab57e[_0x3542('0x39')][_0x3542('0x71')]},'attributes':['id'],'include':[{'model':db[_0x3542('0x79')],'as':_0x3542('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x3542('0x27')](handleEntityNotFound(_0x299d11,null))['then'](function(_0x1c0bfd){var _0x2f3ad3=_[_0x3542('0x35')](_0x1c0bfd,'id');var _0x30a535=[];var _0x1fdf10=[];var _0x415044=squel[_0x3542('0x8a')]();_0x415044[_0x3542('0x8b')]('tq.TeamId')[_0x3542('0x8c')](_0x3542('0x8d'),'tq')[_0x3542('0x8e')](_0x3542('0x8f'),'ut',_0x3542('0x90'))[_0x3542('0x40')](_0x3542('0x91'),_0x1ab57e[_0x3542('0x4b')]['id']);for(var _0x5afb14=0x0;_0x5afb14<_0x1c0bfd['length'];_0x5afb14+=0x1){let _0x404cf0=_0x1c0bfd[_0x5afb14];for(var _0x1e9d45=0x0;_0x1e9d45<_0x404cf0[_0x3542('0x7f')]['length'];_0x1e9d45+=0x1){let _0x5c2675=_0x404cf0[_0x3542('0x7f')][_0x1e9d45];var _0x57859a=_0x415044[_0x3542('0x92')]();_0x57859a['where'](_0x3542('0x93'),_0x5c2675['id']);_0x1fdf10[_0x3542('0x66')](db[_0x3542('0x4f')][_0x3542('0x39')](_0x57859a[_0x3542('0x94')](),{'type':db[_0x3542('0x4f')][_0x3542('0x95')][_0x3542('0x96')]})[_0x3542('0x27')](function(_0x518344){if(_0x518344[_0x3542('0x3c')]===0x1){return _0x5c2675['id'];}else{var _0x5d9869=_['every'](_[_0x3542('0x35')](_0x518344,_0x3542('0x97')),function(_0x5927a7){return _[_0x3542('0x98')](_0x2f3ad3,_0x5927a7);});if(_0x5d9869){return _0x5c2675['id'];}}}));}}return BPromise[_0x3542('0x99')](_0x1fdf10)[_0x3542('0x27')](function(_0x2da3a5){_0x30a535=_(_0x30a535)['union'](_0x2da3a5)[_0x3542('0x9a')]()['value']();return db['VoicePrefix'][_0x3542('0x4d')]({'where':{'id':_0x1ab57e[_0x3542('0x4b')]['id']}})[_0x3542('0x27')](function(_0x51ac4a){return db[_0x3542('0x4f')]['transaction'](function(_0x32712f){return _0x51ac4a[_0x3542('0x89')](_0x1ab57e[_0x3542('0x39')][_0x3542('0x71')],{'transaction':_0x32712f})[_0x3542('0x27')](function(){if(!_[_0x3542('0x9b')](_0x30a535)){return _0x51ac4a[_0x3542('0x75')](_0x30a535,{'transaction':_0x32712f});}})[_0x3542('0x27')](function(){_0x30a535[_0x3542('0x88')](function(_0x5815b5){socket[_0x3542('0x73')](_0x3542('0x77'),{'UserId':_0x5815b5,'VoicePrefixId':_0x51ac4a['id']});});});});});});})['then'](respondWithStatusCode(_0x299d11,null))[_0x3542('0x49')](handleError(_0x299d11,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 0a64fb2..7610ebc 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 _0xd1d2=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix','setMaxListeners','update'];(function(_0x3cffb3,_0x284b2d){var _0x57a846=function(_0x32a354){while(--_0x32a354){_0x3cffb3['push'](_0x3cffb3['shift']());}};_0x57a846(++_0x284b2d);}(_0xd1d2,0x125));var _0x2d1d=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xd1d2[_0x2c2980];return _0x2a20a9;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x2d1d('0x0'))['db'][_0x2d1d('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2d1d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d1d('0x3'),'afterDestroy':_0x2d1d('0x4')};function emitEvent(_0x48197c){return function(_0x42187c,_0x574bdf,_0x582d88){VoicePrefixEvents['emit'](_0x48197c+':'+_0x42187c['id'],_0x42187c);VoicePrefixEvents[_0x2d1d('0x5')](_0x48197c,_0x42187c);_0x582d88(null);};}for(var e in events){if(events[_0x2d1d('0x6')](e)){var event=events[e];VoicePrefix[_0x2d1d('0x7')](e,emitEvent(event));}}module[_0x2d1d('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xd79f=['exports','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x17307e,_0x36fbde){var _0x1d9863=function(_0x10908a){while(--_0x10908a){_0x17307e['push'](_0x17307e['shift']());}};_0x1d9863(++_0x36fbde);}(_0xd79f,0x143));var _0xfd79=function(_0x11d5be,_0x4810b2){_0x11d5be=_0x11d5be-0x0;var _0xf4c325=_0xd79f[_0x11d5be];return _0xf4c325;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0xfd79('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfd79('0x1')](0x0);var events={'afterCreate':_0xfd79('0x2'),'afterUpdate':_0xfd79('0x3'),'afterDestroy':_0xfd79('0x4')};function emitEvent(_0x37a166){return function(_0x3230be,_0x5db38c,_0x43e6f1){VoicePrefixEvents['emit'](_0x37a166+':'+_0x3230be['id'],_0x3230be);VoicePrefixEvents[_0xfd79('0x5')](_0x37a166,_0x3230be);_0x43e6f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xfd79('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 7fb8715..94da27f 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 _0xd4f6=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd4f6,0xc5));var _0x6d4f=function(_0x4f4ca5,_0x4c02b8){_0x4f4ca5=_0x4f4ca5-0x0;var _0x4a2021=_0xd4f6[_0x4f4ca5];return _0x4a2021;};'use strict';var _=require('lodash');var util=require(_0x6d4f('0x0'));var logger=require(_0x6d4f('0x1'))(_0x6d4f('0x2'));var moment=require(_0x6d4f('0x3'));var BPromise=require('bluebird');var rp=require(_0x6d4f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d4f('0x5'));var config=require(_0x6d4f('0x6'));var attributes=require(_0x6d4f('0x7'));module[_0x6d4f('0x8')]=function(_0x3f0f23,_0x2f2d20){return _0x3f0f23[_0x6d4f('0x9')](_0x6d4f('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3c8=['exports','define','VoicePrefix','util','../../config/logger','moment','../../config/environment','./voicePrefix.attributes'];(function(_0x308374,_0x550e85){var _0x1f71e0=function(_0x18377d){while(--_0x18377d){_0x308374['push'](_0x308374['shift']());}};_0x1f71e0(++_0x550e85);}(_0xa3c8,0xa3));var _0x8a3c=function(_0x1d263d,_0x1479dd){_0x1d263d=_0x1d263d-0x0;var _0x574a7f=_0xa3c8[_0x1d263d];return _0x574a7f;};'use strict';var _=require('lodash');var util=require(_0x8a3c('0x0'));var logger=require(_0x8a3c('0x1'))('api');var moment=require(_0x8a3c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8a3c('0x3'));var attributes=require(_0x8a3c('0x4'));module[_0x8a3c('0x5')]=function(_0x6f963f,_0x45c2ce){return _0x6f963f[_0x8a3c('0x6')](_0x8a3c('0x7'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 367a27d..94d851c 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 _0xc274=['register','request','then','request\x20sent','debug','stringify','error','VoicePrefix,\x20%s,\x20%s','message','info','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./voicePrefix.socket'];(function(_0x3be081,_0x1a0666){var _0x2ff0d8=function(_0x7572e6){while(--_0x7572e6){_0x3be081['push'](_0x3be081['shift']());}};_0x2ff0d8(++_0x1a0666);}(_0xc274,0x151));var _0x4c27=function(_0x5ddf81,_0x22c425){_0x5ddf81=_0x5ddf81-0x0;var _0x2e95c1=_0xc274[_0x5ddf81];return _0x2e95c1;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c27('0x1'));var fs=require('fs');var Redis=require(_0x4c27('0x2'));var db=require(_0x4c27('0x3'))['db'];var utils=require(_0x4c27('0x4'));var logger=require(_0x4c27('0x5'))(_0x4c27('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c27('0x7'));var client=jayson['client'][_0x4c27('0x8')]({'port':0x232a});config[_0x4c27('0x9')]=_[_0x4c27('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c27('0xb'))(new Redis(config['redis']));require(_0x4c27('0xc'))[_0x4c27('0xd')](socket);function respondWithRpcPromise(_0x2d0a27,_0x846d26,_0x2604cf){return new BPromise(function(_0x5c666e,_0x29b5ff){return client[_0x4c27('0xe')](_0x2d0a27,_0x2604cf)[_0x4c27('0xf')](function(_0x163df3){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x846d26,_0x4c27('0x10'));logger[_0x4c27('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x846d26,'request\x20sent',JSON[_0x4c27('0x12')](_0x163df3));if(_0x163df3[_0x4c27('0x13')]){if(_0x163df3[_0x4c27('0x13')]['code']===0x1f4){logger[_0x4c27('0x13')](_0x4c27('0x14'),_0x846d26,_0x163df3[_0x4c27('0x13')]['message']);return _0x29b5ff(_0x163df3[_0x4c27('0x13')]['message']);}logger['error'](_0x4c27('0x14'),_0x846d26,_0x163df3[_0x4c27('0x13')][_0x4c27('0x15')]);return _0x5c666e(_0x163df3[_0x4c27('0x13')]['message']);}else{logger[_0x4c27('0x16')](_0x4c27('0x14'),_0x846d26,'request\x20sent');_0x5c666e(_0x163df3[_0x4c27('0x17')][_0x4c27('0x15')]);}})[_0x4c27('0x18')](function(_0x42a9d6){logger['error'](_0x4c27('0x14'),_0x846d26,_0x42a9d6);_0x29b5ff(_0x42a9d6);});});} \ No newline at end of file +var _0xc43c=['../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x39a49a,_0x1e25b5){var _0x3b490a=function(_0x46814a){while(--_0x46814a){_0x39a49a['push'](_0x39a49a['shift']());}};_0x3b490a(++_0x1e25b5);}(_0xc43c,0xd4));var _0xcc43=function(_0x55c3d5,_0x488fbf){_0x55c3d5=_0x55c3d5-0x0;var _0x4f10cf=_0xc43c[_0x55c3d5];return _0x4f10cf;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc43('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcc43('0x4'));var jayson=require(_0xcc43('0x5'));var client=jayson[_0xcc43('0x6')]['http']({'port':0x232a});config[_0xcc43('0x7')]=_[_0xcc43('0x8')](config[_0xcc43('0x7')],{'host':_0xcc43('0x9'),'port':0x18eb});var socket=require(_0xcc43('0xa'))(new Redis(config[_0xcc43('0x7')]));require(_0xcc43('0xb'))[_0xcc43('0xc')](socket);function respondWithRpcPromise(_0x4b11dc,_0x3ddc64,_0x1a825b){return new BPromise(function(_0x2656bc,_0x3bc51e){return client[_0xcc43('0xd')](_0x4b11dc,_0x1a825b)[_0xcc43('0xe')](function(_0x439c43){logger[_0xcc43('0xf')](_0xcc43('0x10'),_0x3ddc64,_0xcc43('0x11'));logger[_0xcc43('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3ddc64,_0xcc43('0x11'),JSON[_0xcc43('0x13')](_0x439c43));if(_0x439c43[_0xcc43('0x14')]){if(_0x439c43[_0xcc43('0x14')]['code']===0x1f4){logger[_0xcc43('0x14')](_0xcc43('0x10'),_0x3ddc64,_0x439c43[_0xcc43('0x14')][_0xcc43('0x15')]);return _0x3bc51e(_0x439c43[_0xcc43('0x14')]['message']);}logger[_0xcc43('0x14')](_0xcc43('0x10'),_0x3ddc64,_0x439c43['error'][_0xcc43('0x15')]);return _0x2656bc(_0x439c43['error'][_0xcc43('0x15')]);}else{logger[_0xcc43('0xf')](_0xcc43('0x10'),_0x3ddc64,'request\x20sent');_0x2656bc(_0x439c43[_0xcc43('0x16')][_0xcc43('0x15')]);}})[_0xcc43('0x17')](function(_0x326851){logger['error'](_0xcc43('0x10'),_0x3ddc64,_0x326851);_0x3bc51e(_0x326851);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index be55ea2..7e86168 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 _0xde2c=['save','remove','update','emit','removeListener','register','length','./voicePrefix.events'];(function(_0x34cfde,_0x38c82f){var _0x36b2cb=function(_0x453970){while(--_0x453970){_0x34cfde['push'](_0x34cfde['shift']());}};_0x36b2cb(++_0x38c82f);}(_0xde2c,0x7f));var _0xcde2=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0xde2c[_0x2b5b44];return _0x32cb66;};'use strict';var VoicePrefixEvents=require(_0xcde2('0x0'));var events=[_0xcde2('0x1'),_0xcde2('0x2'),_0xcde2('0x3')];function createListener(_0x7595ed,_0x40fa0a){return function(_0x33bb0c){_0x40fa0a[_0xcde2('0x4')](_0x7595ed,_0x33bb0c);};}function removeListener(_0x55c175,_0x4353c8){return function(){VoicePrefixEvents[_0xcde2('0x5')](_0x55c175,_0x4353c8);};}exports[_0xcde2('0x6')]=function(_0x1398de){for(var _0x401b16=0x0,_0x53c558=events[_0xcde2('0x7')];_0x401b16<_0x53c558;_0x401b16++){var _0x385e83=events[_0x401b16];var _0x9c7036=createListener('voicePrefix:'+_0x385e83,_0x1398de);VoicePrefixEvents['on'](_0x385e83,_0x9c7036);}}; \ No newline at end of file +var _0xc686=['removeListener','register','length','remove','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc686,0x148));var _0x6c68=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc686[_0x5bd426];return _0x23a7eb;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x6c68('0x0'),'update'];function createListener(_0xe45565,_0x5f1f2c){return function(_0x1f6b6d){_0x5f1f2c[_0x6c68('0x1')](_0xe45565,_0x1f6b6d);};}function removeListener(_0x1bfe91,_0x434bb0){return function(){VoicePrefixEvents[_0x6c68('0x2')](_0x1bfe91,_0x434bb0);};}exports[_0x6c68('0x3')]=function(_0x1c1b02){for(var _0x2d5dda=0x0,_0x3dc035=events[_0x6c68('0x4')];_0x2d5dda<_0x3dc035;_0x2d5dda++){var _0x12e935=events[_0x2d5dda];var _0x394644=createListener('voicePrefix:'+_0x12e935,_0x1c1b02);VoicePrefixEvents['on'](_0x12e935,_0x394644);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index bb71196..b330ded 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 _0xfcf5=['addLists','/:id/blacklists','put','delete','destroy','removeTeams','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','/:id/hoppers','isAuthenticated','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams','addAgents'];(function(_0x4524f5,_0x423093){var _0x244216=function(_0x2d9757){while(--_0x2d9757){_0x4524f5['push'](_0x4524f5['shift']());}};_0x244216(++_0x423093);}(_0xfcf5,0xb0));var _0x5fcf=function(_0x1c0e5e,_0x5092e9){_0x1c0e5e=_0x1c0e5e-0x0;var _0x4ca1f1=_0xfcf5[_0x1c0e5e];return _0x4ca1f1;};'use strict';var multer=require(_0x5fcf('0x0'));var util=require(_0x5fcf('0x1'));var path=require(_0x5fcf('0x2'));var timeout=require(_0x5fcf('0x3'));var express=require(_0x5fcf('0x4'));var router=express[_0x5fcf('0x5')]();var fs_extra=require(_0x5fcf('0x6'));var auth=require(_0x5fcf('0x7'));var interaction=require(_0x5fcf('0x8'));var config=require(_0x5fcf('0x9'));var controller=require(_0x5fcf('0xa'));router[_0x5fcf('0xb')]('/',auth['isAuthenticated'](),controller[_0x5fcf('0xc')]);router[_0x5fcf('0xb')](_0x5fcf('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x5fcf('0xe'),auth[_0x5fcf('0xf')](),controller['getHoppers']);router[_0x5fcf('0xb')](_0x5fcf('0x10'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x11')]);router[_0x5fcf('0xb')](_0x5fcf('0x12'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x13')]);router[_0x5fcf('0xb')](_0x5fcf('0x14'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x15')]);router['get'](_0x5fcf('0x16'),auth[_0x5fcf('0xf')](),controller['getTeams']);router['get'](_0x5fcf('0x17'),auth['isAuthenticated'](),controller[_0x5fcf('0x18')]);router[_0x5fcf('0xb')](_0x5fcf('0x19'),auth[_0x5fcf('0xf')](),controller['getMembers']);router['get'](_0x5fcf('0x1a'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x1b')]);router[_0x5fcf('0xb')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0x5fcf('0x1c')]('/',auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x1d')]);router[_0x5fcf('0x1c')](_0x5fcf('0x1e'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x1f')]);router[_0x5fcf('0x1c')](_0x5fcf('0x16'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x20')]);router[_0x5fcf('0x1c')](_0x5fcf('0x17'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x21')]);router[_0x5fcf('0x1c')](_0x5fcf('0x1a'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x22')]);router[_0x5fcf('0x1c')](_0x5fcf('0x23'),auth[_0x5fcf('0xf')](),controller['addBlackLists']);router[_0x5fcf('0x24')](_0x5fcf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5fcf('0x25')](_0x5fcf('0xd'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x26')]);router['delete'](_0x5fcf('0x16'),auth[_0x5fcf('0xf')](),controller[_0x5fcf('0x27')]);router['delete'](_0x5fcf('0x17'),auth[_0x5fcf('0xf')](),controller['removeAgents']);router['delete'](_0x5fcf('0x1a'),auth['isAuthenticated'](),controller['removeLists']);router[_0x5fcf('0x25')](_0x5fcf('0x23'),auth['isAuthenticated'](),controller[_0x5fcf('0x28')]);module[_0x5fcf('0x29')]=router; \ No newline at end of file +var _0x40e9=['index','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addTeams','addBlackLists','update','delete','/:id','destroy','removeLists','removeBlackLists','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3b467d,_0x1a933d){var _0x4b36ee=function(_0x10f620){while(--_0x10f620){_0x3b467d['push'](_0x3b467d['shift']());}};_0x4b36ee(++_0x1a933d);}(_0x40e9,0xf1));var _0x940e=function(_0x9f0ccb,_0x388edf){_0x9f0ccb=_0x9f0ccb-0x0;var _0x31fd77=_0x40e9[_0x9f0ccb];return _0x31fd77;};'use strict';var multer=require('multer');var util=require(_0x940e('0x0'));var path=require('path');var timeout=require(_0x940e('0x1'));var express=require('express');var router=express[_0x940e('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x940e('0x3'));var config=require(_0x940e('0x4'));var controller=require('./voiceQueue.controller');router[_0x940e('0x5')]('/',auth[_0x940e('0x6')](),controller[_0x940e('0x7')]);router[_0x940e('0x5')]('/:id',auth[_0x940e('0x6')](),controller['show']);router[_0x940e('0x5')](_0x940e('0x8'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x940e('0x5')]('/:id/hopper_histories',auth[_0x940e('0x6')](),controller[_0x940e('0x9')]);router['get'](_0x940e('0xa'),auth[_0x940e('0x6')](),controller[_0x940e('0xb')]);router[_0x940e('0x5')]('/:id/hopper_black',auth[_0x940e('0x6')](),controller['getHopperBlacks']);router[_0x940e('0x5')](_0x940e('0xc'),auth[_0x940e('0x6')](),controller[_0x940e('0xd')]);router[_0x940e('0x5')](_0x940e('0xe'),auth[_0x940e('0x6')](),controller[_0x940e('0xf')]);router[_0x940e('0x5')](_0x940e('0x10'),auth[_0x940e('0x6')](),controller['getMembers']);router[_0x940e('0x5')](_0x940e('0x11'),auth['isAuthenticated'](),controller['getLists']);router[_0x940e('0x5')](_0x940e('0x12'),auth['isAuthenticated'](),controller[_0x940e('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x940e('0x14')](_0x940e('0x15'),auth[_0x940e('0x6')](),controller[_0x940e('0x16')]);router[_0x940e('0x14')](_0x940e('0xc'),auth['isAuthenticated'](),controller[_0x940e('0x17')]);router[_0x940e('0x14')]('/:id/users',auth[_0x940e('0x6')](),controller['addAgents']);router[_0x940e('0x14')](_0x940e('0x11'),auth[_0x940e('0x6')](),controller['addLists']);router[_0x940e('0x14')](_0x940e('0x12'),auth[_0x940e('0x6')](),controller[_0x940e('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x940e('0x19')]);router[_0x940e('0x1a')](_0x940e('0x1b'),auth[_0x940e('0x6')](),controller[_0x940e('0x1c')]);router['delete'](_0x940e('0xc'),auth[_0x940e('0x6')](),controller['removeTeams']);router[_0x940e('0x1a')](_0x940e('0xe'),auth[_0x940e('0x6')](),controller['removeAgents']);router[_0x940e('0x1a')](_0x940e('0x11'),auth[_0x940e('0x6')](),controller[_0x940e('0x1d')]);router[_0x940e('0x1a')](_0x940e('0x12'),auth[_0x940e('0x6')](),controller[_0x940e('0x1e')]);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 b32b147..751440e 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 _0xa1a9=['random','wrandom','setDataValue','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','ENUM','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','name','inbound','outbound','STRING','ringall','leastrecent'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa1a9,0x9b));var _0x9a1a=function(_0x4c815e,_0x39c450){_0x4c815e=_0x4c815e-0x0;var _0x42f656=_0xa1a9[_0x4c815e];return _0x42f656;};'use strict';var Sequelize=require(_0x9a1a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a1a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x9a1a('0x2'),_0x9a1a('0x3')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x9a1a('0x5'),_0x9a1a('0x6'),'fewestcalls',_0x9a1a('0x7'),'rrmemory','linear',_0x9a1a('0x8'),'rrordered'),'allowNull':![],'defaultValue':_0x9a1a('0x5'),'set':function(_0x4f7bf7){this[_0x9a1a('0x9')](_0x9a1a('0xa'),_0x4f7bf7?_0x4f7bf7:_0x9a1a('0xb'));},'get':function(){var _0xc656da=this[_0x9a1a('0xc')](_0x9a1a('0xd'));var _0x5db9ea=this[_0x9a1a('0xc')](_0x9a1a('0xe'));var _0x3060e8=this[_0x9a1a('0xc')](_0x9a1a('0xa'));if(_0xc656da===_0x9a1a('0x2')){return _0x3060e8;}if(_0x5db9ea===_0x9a1a('0xf')&&_0x3060e8===_0x9a1a('0xb')||_0x5db9ea===_0x9a1a('0xf')&&_0x3060e8===_0x9a1a('0x10')){return _0x3060e8;}if(_0x5db9ea===_0x9a1a('0x11')||_0x5db9ea==='predictive'||_0x5db9ea===_0x9a1a('0x12')){return _0x3060e8;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9a1a('0x13')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9a1a('0x4')]},'weight':{'type':Sequelize[_0x9a1a('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':_0x9a1a('0x15')},'autopause':{'type':Sequelize['ENUM'](_0x9a1a('0x15'),'no',_0x9a1a('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9a1a('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x9a1a('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9a1a('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9a1a('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':_0x9a1a('0x15')},'announce_holdtime':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no',_0x9a1a('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x9a1a('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x9a1a('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9a1a('0x14')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9a1a('0x4')]},'queue_youarenext':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9a1a('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x9a1a('0x4')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x9a1a('0x4')]},'periodic_announce':{'type':Sequelize[_0x9a1a('0x18')],'set':function(_0x123a4d){this[_0x9a1a('0x9')](_0x9a1a('0x19'),_0x123a4d?_0x123a4d[_0x9a1a('0x1a')](','):[]);},'get':function(){return this[_0x9a1a('0xc')](_0x9a1a('0x19'))?this[_0x9a1a('0xc')](_0x9a1a('0x19'))[_0x9a1a('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':'yes','set':function(_0xd3cd79){this[_0x9a1a('0x9')]('joinempty',_0xd3cd79?_0xd3cd79[_0x9a1a('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x9a1a('0x1c'))?this['getDataValue']('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':'no','set':function(_0x2b0cb7){this[_0x9a1a('0x9')]('leavewhenempty',_0x2b0cb7?_0x2b0cb7[_0x9a1a('0x1a')](','):undefined);},'get':function(){return this[_0x9a1a('0xc')](_0x9a1a('0x1d'))?this[_0x9a1a('0xc')](_0x9a1a('0x1d'))[_0x9a1a('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9a1a('0x4')]},'description':{'type':Sequelize[_0x9a1a('0x4')]},'acw':{'type':Sequelize[_0x9a1a('0x1e')],'defaultValue':0x0,'set':function(_0x29813c){this[_0x9a1a('0x9')](_0x9a1a('0x1f'),_0x29813c);if(_0x29813c){if(this[_0x9a1a('0xc')](_0x9a1a('0x20'))<0x2){this[_0x9a1a('0x9')](_0x9a1a('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9a1a('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9a1a('0x1e')],'defaultValue':0x0,'comment':_0x9a1a('0x21')},'dialMethod':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x22'),_0x9a1a('0x11'),_0x9a1a('0x12'),_0x9a1a('0x23'),_0x9a1a('0xf')),'defaultValue':_0x9a1a('0x11'),'comment':_0x9a1a('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x9a1a('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9a1a('0x26')},'dialLimitQueue':{'type':Sequelize[_0x9a1a('0x13')](0x4)[_0x9a1a('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9a1a('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x9a1a('0x28'),_0x9a1a('0x29')),'defaultValue':_0x9a1a('0x29'),'comment':_0x9a1a('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9a1a('0x2b')](0x2)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9a1a('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9a1a('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9a1a('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9a1a('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x2e')},'dialQueueOptions':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':_0x9a1a('0x2f'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x30')},'dialQueueProject':{'type':Sequelize[_0x9a1a('0x4')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a1a('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'comment':_0x9a1a('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a1a('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9a1a('0x35')},'dialTimezone':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x9a1a('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x36'),_0x9a1a('0x37'),_0x9a1a('0x38')),'defaultValue':_0x9a1a('0x36')},'dialAMDActive':{'type':Sequelize[_0x9a1a('0x1e')],'defaultValue':0x0,'comment':_0x9a1a('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x9a1a('0x13')](0x9)[_0x9a1a('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9a1a('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x9a1a('0x13')](0x9)[_0x9a1a('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9a1a('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x9a1a('0x13')](0x9)[_0x9a1a('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9a1a('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9a1a('0x13')](0x9)[_0x9a1a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9a1a('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9a1a('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9a1a('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9a1a('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9a1a('0x13')](0x9)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9a1a('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9a1a('0x13')](0x9)[_0x9a1a('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9a1a('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x9a1a('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x9a1a('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x9a1a('0x14')](_0x9a1a('0x42'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x9a1a('0x43')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9a1a('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9a1a('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9a1a('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x9a1a('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9a1a('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a1a('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a1a('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a1a('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9a1a('0x13')](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9a1a('0x13')](0x3)[_0x9a1a('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9a1a('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9a1a('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9a1a('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9a1a('0x13')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9a1a('0x4e'),'set':function(_0x7dc8d0){if(!_0x7dc8d0)this['setDataValue'](_0x9a1a('0x4f'),null);this[_0x9a1a('0x9')](_0x9a1a('0x50'),_0x7dc8d0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9a1a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9a1a('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x2444=['periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#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)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','ringall','leastrecent','random','rrmemory','wrandom','rrordered','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue'];(function(_0xa05ba7,_0x2950bc){var _0x552354=function(_0x34b19d){while(--_0x34b19d){_0xa05ba7['push'](_0xa05ba7['shift']());}};_0x552354(++_0x2950bc);}(_0x2444,0x170));var _0x4244=function(_0x1feaf5,_0x2bbced){_0x1feaf5=_0x1feaf5-0x0;var _0x22ea52=_0x2444[_0x1feaf5];return _0x22ea52;};'use strict';var Sequelize=require(_0x4244('0x0'));module[_0x4244('0x1')]={'name':{'type':Sequelize[_0x4244('0x2')],'allowNull':![],'unique':_0x4244('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x4244('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x4244('0x6')},'announce':{'type':Sequelize[_0x4244('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x4244('0x7'),_0x4244('0x8'),'fewestcalls',_0x4244('0x9'),_0x4244('0xa'),'linear',_0x4244('0xb'),_0x4244('0xc')),'allowNull':![],'defaultValue':_0x4244('0x7'),'set':function(_0x202d7a){this['setDataValue'](_0x4244('0xd'),_0x202d7a?_0x202d7a:_0x4244('0xa'));},'get':function(){var _0x14c513=this[_0x4244('0xe')]('type');var _0x4a0765=this[_0x4244('0xe')](_0x4244('0xf'));var _0x156de4=this[_0x4244('0xe')](_0x4244('0xd'));if(_0x14c513===_0x4244('0x5')){return _0x156de4;}if(_0x4a0765==='booked'&&_0x156de4===_0x4244('0xa')||_0x4a0765===_0x4244('0x10')&&_0x156de4===_0x4244('0x11')){return _0x156de4;}if(_0x4a0765===_0x4244('0x12')||_0x4a0765===_0x4244('0x13')||_0x4a0765===_0x4244('0x14')){return _0x156de4;}return null;}},'servicelevel':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4244('0x15')](0xb)},'timeout':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4244('0x2')]},'weight':{'type':Sequelize[_0x4244('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x4244('0x16'),'no'),'defaultValue':_0x4244('0x16')},'autopause':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no',_0x4244('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4244('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x4244('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x4244('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4244('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x4244('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no'),'defaultValue':_0x4244('0x16')},'announce_holdtime':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no',_0x4244('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4244('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4244('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4244('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4244('0x2')]},'queue_youarenext':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x4244('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x4244('0x2')]},'periodic_announce':{'type':Sequelize[_0x4244('0x19')],'set':function(_0x79095){this[_0x4244('0x1a')](_0x4244('0x1b'),_0x79095?_0x79095[_0x4244('0x1c')](','):[]);},'get':function(){return this[_0x4244('0xe')](_0x4244('0x1b'))?this['getDataValue'](_0x4244('0x1b'))[_0x4244('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x4244('0x2')],'defaultValue':_0x4244('0x16'),'set':function(_0x1ee320){this[_0x4244('0x1a')](_0x4244('0x1e'),_0x1ee320?_0x1ee320[_0x4244('0x1c')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x4244('0xe')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x3a7817){this[_0x4244('0x1a')]('leavewhenempty',_0x3a7817?_0x3a7817[_0x4244('0x1c')](','):undefined);},'get':function(){return this[_0x4244('0xe')](_0x4244('0x1f'))?this[_0x4244('0xe')]('leavewhenempty')[_0x4244('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x4244('0x4')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x4244('0x2')]},'description':{'type':Sequelize[_0x4244('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3a6b81){this[_0x4244('0x1a')](_0x4244('0x20'),_0x3a6b81);if(_0x3a6b81){if(this[_0x4244('0xe')](_0x4244('0x21'))<0x2){this[_0x4244('0x1a')](_0x4244('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4244('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4244('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0x4244('0x23'),_0x4244('0x12'),_0x4244('0x14'),_0x4244('0x13'),'booked'),'defaultValue':_0x4244('0x12'),'comment':_0x4244('0x24')},'dialLimitChannel':{'type':Sequelize[_0x4244('0x15')](0x4)[_0x4244('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4244('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x4244('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x4244('0x27')](0x2)[_0x4244('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x4244('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x4244('0x4')]('agentBusyFactor',_0x4244('0x29')),'defaultValue':_0x4244('0x29'),'comment':_0x4244('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4244('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4244('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4244('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4244('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x4244('0x2')],'defaultValue':_0x4244('0x2d'),'comment':_0x4244('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x4244('0x2')],'comment':_0x4244('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4244('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4244('0x15')](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4244('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4244('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x4244('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4244('0x15')](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4244('0x34')},'dialTimezone':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x4244('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4244('0x4')]('always',_0x4244('0x35'),_0x4244('0x36')),'defaultValue':_0x4244('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x4244('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x4244('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4244('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x4244('0x15')](0x9)[_0x4244('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4244('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4244('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4244('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x4244('0x15')](0x9)[_0x4244('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4244('0x15')](0x9)[_0x4244('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4244('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4244('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4244('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4244('0x15')](0x5)[_0x4244('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4244('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4244('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x4244('0x15')](0x5)[_0x4244('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4244('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x4244('0x22')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x4244('0x4')](_0x4244('0x3f'),_0x4244('0x40')),'defaultValue':_0x4244('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x4244('0x2')],'comment':_0x4244('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4244('0x22')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4244('0x22')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4244('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4244('0x41')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x4244('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4244('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4244('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4244('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4244('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4244('0x45')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4244('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4244('0x47')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4244('0x48')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4244('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4244('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4244('0x15')](0x5)[_0x4244('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4244('0x15')],'allowNull':!![],'comment':_0x4244('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4244('0x4c'),'set':function(_0x553960){if(!_0x553960)this['setDataValue'](_0x4244('0x4d'),null);this['setDataValue'](_0x4244('0x4e'),_0x553960);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4244('0x15')](0x3)[_0x4244('0x25')],'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 48229dc..d360070 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 _0x5736=['nolimit','order','sort','where','pick','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','outbound','userProfileId','autoAssociation','getHoppers','findOne','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','interface','format','voicePause','forEach','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','CmHopper','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','includes','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x2b0d96,_0x20b3bf){var _0x1d4c7f=function(_0x31a9e3){while(--_0x31a9e3){_0x2b0d96['push'](_0x2b0d96['shift']());}};_0x1d4c7f(++_0x20b3bf);}(_0x5736,0x72));var _0x6573=function(_0x4a8706,_0x38cf17){_0x4a8706=_0x4a8706-0x0;var _0xd9d3d7=_0x5736[_0x4a8706];return _0xd9d3d7;};'use strict';var emlformat=require(_0x6573('0x0'));var rimraf=require(_0x6573('0x1'));var zipdir=require(_0x6573('0x2'));var jsonpatch=require(_0x6573('0x3'));var rp=require(_0x6573('0x4'));var moment=require(_0x6573('0x5'));var BPromise=require(_0x6573('0x6'));var Mustache=require(_0x6573('0x7'));var util=require('util');var path=require(_0x6573('0x8'));var sox=require(_0x6573('0x9'));var csv=require('to-csv');var ejs=require(_0x6573('0xa'));var fs=require('fs');var fs_extra=require(_0x6573('0xb'));var _=require(_0x6573('0xc'));var squel=require(_0x6573('0xd'));var crypto=require('crypto');var jsforce=require(_0x6573('0xe'));var deskjs=require(_0x6573('0xf'));var toCsv=require(_0x6573('0x10'));var querystring=require(_0x6573('0x11'));var Papa=require(_0x6573('0x12'));var Redis=require(_0x6573('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6573('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6573('0x15'))(_0x6573('0x16'));var utils=require(_0x6573('0x17'));var config=require(_0x6573('0x18'));var licenseUtil=require(_0x6573('0x19'));var db=require(_0x6573('0x1a'))['db'];config[_0x6573('0x1b')]=_[_0x6573('0x1c')](config[_0x6573('0x1b')],{'host':_0x6573('0x1d'),'port':0x18eb});var socket=require(_0x6573('0x1e'))(new Redis(config[_0x6573('0x1b')]));require(_0x6573('0x1f'))[_0x6573('0x20')](socket);function respondWithStatusCode(_0x5d3d97,_0x52fc15){_0x52fc15=_0x52fc15||0xcc;return function(_0x20ee14){if(_0x20ee14){return _0x5d3d97[_0x6573('0x21')](_0x52fc15);}return _0x5d3d97[_0x6573('0x22')](_0x52fc15)[_0x6573('0x23')]();};}function respondWithResult(_0x5b2148,_0x3df729){_0x3df729=_0x3df729||0xc8;return function(_0x1ba0a5){if(_0x1ba0a5){return _0x5b2148[_0x6573('0x22')](_0x3df729)['json'](_0x1ba0a5);}};}function respondWithFilteredResult(_0x3be7fc,_0x485dd3){return function(_0x28225c){if(_0x28225c){var _0x304b97=typeof _0x485dd3[_0x6573('0x24')]==='undefined'&&typeof _0x485dd3[_0x6573('0x25')]==='undefined';var _0x11a5ba=_0x28225c['count'];var _0x2dcad1=_0x304b97?0x0:_0x485dd3['offset'];var _0x245086=_0x304b97?_0x28225c[_0x6573('0x26')]:_0x485dd3[_0x6573('0x24')]+_0x485dd3[_0x6573('0x25')];var _0x10ee04;if(_0x245086>=_0x11a5ba){_0x245086=_0x11a5ba;_0x10ee04=0xc8;}else{_0x10ee04=0xce;}_0x3be7fc[_0x6573('0x22')](_0x10ee04);return _0x3be7fc[_0x6573('0x27')](_0x6573('0x28'),_0x2dcad1+'-'+_0x245086+'/'+_0x11a5ba)['json'](_0x28225c);}return null;};}function patchUpdates(_0x538aee){return function(_0x3831a4){try{jsonpatch[_0x6573('0x29')](_0x3831a4,_0x538aee,!![]);}catch(_0x3be83d){return BPromise[_0x6573('0x2a')](_0x3be83d);}return _0x3831a4[_0x6573('0x2b')]();};}function saveUpdates(_0x20d83e,_0x5a1d9d){return function(_0x4b1dee){if(_0x4b1dee){return _0x4b1dee[_0x6573('0x2c')](_0x20d83e)[_0x6573('0x2d')](function(_0x1c32d0){return _0x1c32d0;});}return null;};}function removeEntity(_0x3be91c,_0x43818b){return function(_0x4f56bf){if(_0x4f56bf){return _0x4f56bf[_0x6573('0x2e')]()[_0x6573('0x2d')](function(){var _0x10b84d=_0x4f56bf[_0x6573('0x2f')]({'plain':!![]});var _0x15e7f8=[{'name':_0x6573('0x30'),'value':_0x6573('0x31'),'ignore':![]},{'name':_0x6573('0x32'),'value':'outbound','ignore':![]}];var _0x49d7bc=_(_0x15e7f8)[_0x6573('0x33')](_0x6573('0x34'))[_0x6573('0x35')]('value')[_0x6573('0x36')]();if(_[_0x6573('0x37')](_0x49d7bc,_0x10b84d['type'])){return;}var _0x16c6f7=_[_0x6573('0x38')](_0x15e7f8,[_0x6573('0x36'),_0x10b84d['type']])[_0x6573('0x39')];return db[_0x6573('0x3a')]['destroy']({'where':{'type':_0x16c6f7,'resourceId':_0x10b84d['id']}})[_0x6573('0x2d')](function(){return _0x4f56bf;});})[_0x6573('0x2d')](function(){_0x3be91c[_0x6573('0x22')](0xcc)[_0x6573('0x23')]();});}};}function handleEntityNotFound(_0x564a37,_0xdd6682){return function(_0x1229e5){if(!_0x1229e5){_0x564a37['sendStatus'](0x194);}return _0x1229e5;};}function handleError(_0x553eff,_0x5f1724){_0x5f1724=_0x5f1724||0x1f4;return function(_0x31beec){logger[_0x6573('0x3b')](_0x31beec[_0x6573('0x3c')]);if(_0x31beec[_0x6573('0x39')]){delete _0x31beec[_0x6573('0x39')];}_0x553eff[_0x6573('0x22')](_0x5f1724)[_0x6573('0x3d')](_0x31beec);};}exports[_0x6573('0x3e')]=function(_0x463ba5,_0x5b6488){var _0x36169c={},_0x12de59={},_0x2bf8c5={'count':0x0,'rows':[]};var _0x17ccb7=_[_0x6573('0x35')](db[_0x6573('0x3f')][_0x6573('0x40')],function(_0x4743ed){return{'name':_0x4743ed['fieldName'],'type':_0x4743ed[_0x6573('0x41')][_0x6573('0x42')]};});_0x12de59[_0x6573('0x43')]=_[_0x6573('0x35')](_0x17ccb7,_0x6573('0x39'));_0x12de59['query']=_['keys'](_0x463ba5[_0x6573('0x44')]);_0x12de59[_0x6573('0x45')]=_['intersection'](_0x12de59[_0x6573('0x43')],_0x12de59[_0x6573('0x44')]);_0x36169c[_0x6573('0x46')]=_[_0x6573('0x47')](_0x12de59[_0x6573('0x43')],qs['fields'](_0x463ba5[_0x6573('0x44')][_0x6573('0x48')]));_0x36169c[_0x6573('0x46')]=_0x36169c[_0x6573('0x46')][_0x6573('0x49')]?_0x36169c['attributes']:_0x12de59['model'];if(!_0x463ba5[_0x6573('0x44')][_0x6573('0x4a')](_0x6573('0x4b'))){_0x36169c[_0x6573('0x25')]=qs['limit'](_0x463ba5['query'][_0x6573('0x25')]);_0x36169c[_0x6573('0x24')]=qs[_0x6573('0x24')](_0x463ba5[_0x6573('0x44')][_0x6573('0x24')]);}_0x36169c[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0x463ba5['query']['sort']);_0x36169c[_0x6573('0x4e')]=qs[_0x6573('0x45')](_[_0x6573('0x4f')](_0x463ba5[_0x6573('0x44')],_0x12de59['filters']),_0x17ccb7);if(_0x463ba5['query']['filter']){_0x36169c[_0x6573('0x4e')]=_['merge'](_0x36169c[_0x6573('0x4e')],{'$or':_['map'](_0x17ccb7,function(_0x477de4){if(_0x477de4[_0x6573('0x41')]!=='VIRTUAL'){var _0x5d40a4={};_0x5d40a4[_0x477de4['name']]={'$like':'%'+_0x463ba5[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x5d40a4;}})});}_0x36169c=_[_0x6573('0x50')]({},_0x36169c,_0x463ba5['options']);var _0x350fe0={'where':_0x36169c['where']};return db[_0x6573('0x3f')][_0x6573('0x26')](_0x350fe0)['then'](function(_0x19c208){_0x2bf8c5[_0x6573('0x26')]=_0x19c208;if(_0x463ba5['query']['includeAll']){_0x36169c[_0x6573('0x51')]=[{'all':!![]}];}return db['VoiceQueue'][_0x6573('0x52')](_0x36169c);})[_0x6573('0x2d')](function(_0x1b4fd8){_0x2bf8c5[_0x6573('0x53')]=_0x1b4fd8;return _0x2bf8c5;})['then'](respondWithFilteredResult(_0x5b6488,_0x36169c))[_0x6573('0x54')](handleError(_0x5b6488,null));};exports[_0x6573('0x55')]=function(_0x55f02f,_0x2a7ecc){var _0x5f5073={'raw':![],'where':{'id':_0x55f02f[_0x6573('0x56')]['id']}},_0x35dcff={};_0x35dcff['model']=_[_0x6573('0x57')](db[_0x6573('0x3f')]['rawAttributes']);_0x35dcff[_0x6573('0x44')]=_[_0x6573('0x57')](_0x55f02f['query']);_0x35dcff[_0x6573('0x45')]=_[_0x6573('0x47')](_0x35dcff[_0x6573('0x43')],_0x35dcff[_0x6573('0x44')]);_0x5f5073[_0x6573('0x46')]=_[_0x6573('0x47')](_0x35dcff[_0x6573('0x43')],qs['fields'](_0x55f02f[_0x6573('0x44')][_0x6573('0x48')]));_0x5f5073[_0x6573('0x46')]=_0x5f5073[_0x6573('0x46')][_0x6573('0x49')]?_0x5f5073[_0x6573('0x46')]:_0x35dcff['model'];if(_0x55f02f['query'][_0x6573('0x58')]){_0x5f5073[_0x6573('0x51')]=[{'all':!![]}];}_0x5f5073=_['merge']({},_0x5f5073,_0x55f02f[_0x6573('0x59')]);return db['VoiceQueue'][_0x6573('0x38')](_0x5f5073)[_0x6573('0x2d')](handleEntityNotFound(_0x2a7ecc,null))[_0x6573('0x2d')](respondWithResult(_0x2a7ecc,null))['catch'](handleError(_0x2a7ecc,null));};exports[_0x6573('0x5a')]=function(_0x3d38f0,_0x4e7dc9){return db['VoiceQueue'][_0x6573('0x5a')](_0x3d38f0[_0x6573('0x5b')],{})[_0x6573('0x2d')](function(_0x33d3c0){var _0x153fae=_0x3d38f0['user'][_0x6573('0x2f')]({'plain':!![]});if(!_0x153fae)throw new Error(_0x6573('0x5c'));if(_0x153fae[_0x6573('0x5d')]==='user'){var _0x1fe539=_0x33d3c0[_0x6573('0x2f')]({'plain':!![]});var _0x5dcc7f=[{'name':'VoiceQueues','value':_0x6573('0x31')},{'name':_0x6573('0x32'),'value':'outbound'}];var _0x24a0fa=_[_0x6573('0x38')](_0x5dcc7f,[_0x6573('0x36'),_0x1fe539[_0x6573('0x41')]])[_0x6573('0x39')];return db[_0x6573('0x5e')][_0x6573('0x38')]({'where':{'name':_0x24a0fa,'userProfileId':_0x153fae['userProfileId']},'raw':!![]})[_0x6573('0x2d')](function(_0x132dda){if(_0x132dda&&_0x132dda['autoAssociation']===0x0){return db[_0x6573('0x3a')][_0x6573('0x5a')]({'name':_0x1fe539[_0x6573('0x39')],'resourceId':_0x1fe539['id'],'type':_0x132dda[_0x6573('0x39')],'sectionId':_0x132dda['id']},{})[_0x6573('0x2d')](function(){return _0x33d3c0;});}else{return _0x33d3c0;}})[_0x6573('0x54')](function(_0xef7361){logger[_0x6573('0x3b')](_0x6573('0x5f'),_0xef7361);throw _0xef7361;});}return _0x33d3c0;})[_0x6573('0x2d')](respondWithResult(_0x4e7dc9,0xc9))[_0x6573('0x54')](handleError(_0x4e7dc9,null));};exports[_0x6573('0x60')]=function(_0x1eaf9e,_0x2bea64){var _0x1f69d2={'where':{'id':_0x1eaf9e[_0x6573('0x56')]['id']}},_0x348891={};_0x348891[_0x6573('0x43')]=_[_0x6573('0x57')](db[_0x6573('0x3f')][_0x6573('0x40')]);_0x1f69d2['attributes']=_[_0x6573('0x47')](_0x348891[_0x6573('0x43')],qs[_0x6573('0x48')](_0x1eaf9e[_0x6573('0x44')][_0x6573('0x48')]));_0x1f69d2['attributes']=_0x1f69d2[_0x6573('0x46')][_0x6573('0x49')]?_0x1f69d2['attributes']:_0x348891[_0x6573('0x43')];if(_0x1eaf9e[_0x6573('0x44')]['includeAll']){_0x1f69d2['include']=[{'all':!![]}];}_0x1f69d2=_[_0x6573('0x50')]({},_0x1f69d2,_0x1eaf9e['options']);return db[_0x6573('0x3f')]['find'](_0x1f69d2)[_0x6573('0x2d')](handleEntityNotFound(_0x2bea64,null))[_0x6573('0x2d')](function(_0x4323be){if(_0x4323be){var _0x18c7ac=_0x4323be['get']({'plain':!![]});_0x18c7ac=qs[_0x6573('0x61')](_0x18c7ac,['id',_0x6573('0x62'),_0x6573('0x63')]);_0x1eaf9e[_0x6573('0x5b')]=_['omit'](_0x1eaf9e[_0x6573('0x5b')],['id','createdAt',_0x6573('0x63')]);return db[_0x6573('0x3f')][_0x6573('0x5a')](_[_0x6573('0x50')](_0x18c7ac,_0x1eaf9e[_0x6573('0x5b')]),{'include':_0x1eaf9e[_0x6573('0x44')][_0x6573('0x58')]?[{'all':!![]}]:undefined})[_0x6573('0x2d')](function(_0x5ecbd7){var _0x1d16b8=_0x1eaf9e[_0x6573('0x64')][_0x6573('0x2f')]({'plain':!![]});if(!_0x1d16b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d16b8[_0x6573('0x5d')]===_0x6573('0x64')){var _0x361f38=_0x5ecbd7[_0x6573('0x2f')]({'plain':!![]});var _0x450f42=[{'name':_0x6573('0x30'),'value':'inbound'},{'name':_0x6573('0x32'),'value':_0x6573('0x65')}];var _0x1ffe61=_[_0x6573('0x38')](_0x450f42,[_0x6573('0x36'),_0x361f38[_0x6573('0x41')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x1ffe61,'userProfileId':_0x1d16b8[_0x6573('0x66')]},'raw':!![]})[_0x6573('0x2d')](function(_0x565d1b){if(_0x565d1b&&_0x565d1b[_0x6573('0x67')]===0x0){return db['UserProfileResource'][_0x6573('0x5a')]({'name':_0x361f38[_0x6573('0x39')],'resourceId':_0x361f38['id'],'type':_0x565d1b[_0x6573('0x39')],'sectionId':_0x565d1b['id']},{})[_0x6573('0x2d')](function(){return _0x5ecbd7;});}else{return _0x5ecbd7;}})[_0x6573('0x54')](function(_0xc12b05){logger[_0x6573('0x3b')](_0x6573('0x5f'),_0xc12b05);throw _0xc12b05;});}return _0x5ecbd7;});}})[_0x6573('0x2d')](respondWithResult(_0x2bea64,0xc9))[_0x6573('0x54')](handleError(_0x2bea64,null));};exports[_0x6573('0x2c')]=function(_0x1afcfd,_0x68d277){if(_0x1afcfd[_0x6573('0x5b')]['id']){delete _0x1afcfd[_0x6573('0x5b')]['id'];}return db[_0x6573('0x3f')][_0x6573('0x38')]({'where':{'id':_0x1afcfd[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x68d277,null))[_0x6573('0x2d')](saveUpdates(_0x1afcfd[_0x6573('0x5b')],null))[_0x6573('0x2d')](respondWithResult(_0x68d277,null))[_0x6573('0x54')](handleError(_0x68d277,null));};exports[_0x6573('0x2e')]=function(_0x4eabbe,_0x2e11d6){return db['VoiceQueue'][_0x6573('0x38')]({'where':{'id':_0x4eabbe[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x2e11d6,null))[_0x6573('0x2d')](removeEntity(_0x2e11d6,null))['catch'](handleError(_0x2e11d6,null));};exports[_0x6573('0x68')]=function(_0x393351,_0x53f7a2,_0x324301){var _0x267760={'raw':![],'where':{}};var _0x28166a={};var _0xbe2b9d={'count':0x0,'rows':[]};return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0x393351[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x53f7a2,null))[_0x6573('0x2d')](function(_0x2c819c){if(_0x2c819c){_0x28166a[_0x6573('0x43')]=_[_0x6573('0x57')](db['CmHopper'][_0x6573('0x40')]);_0x28166a[_0x6573('0x44')]=_['keys'](_0x393351[_0x6573('0x44')]);_0x28166a[_0x6573('0x45')]=_[_0x6573('0x47')](_0x28166a['model'],_0x28166a[_0x6573('0x44')]);_0x267760[_0x6573('0x46')]=_[_0x6573('0x47')](_0x28166a['model'],qs['fields'](_0x393351[_0x6573('0x44')][_0x6573('0x48')]));_0x267760['attributes']=_0x267760[_0x6573('0x46')]['length']?_0x267760[_0x6573('0x46')]:_0x28166a[_0x6573('0x43')];if(!_0x393351[_0x6573('0x44')][_0x6573('0x4a')]('nolimit')){_0x267760[_0x6573('0x25')]=qs['limit'](_0x393351[_0x6573('0x44')][_0x6573('0x25')]);_0x267760['offset']=qs['offset'](_0x393351['query'][_0x6573('0x24')]);}_0x267760[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0x393351[_0x6573('0x44')]['sort']);_0x267760[_0x6573('0x4e')]=qs[_0x6573('0x45')](_[_0x6573('0x4f')](_0x393351['query'],_0x28166a['filters']));_0x267760['where']['VoiceQueueId']=_0x2c819c['id'];if(_0x393351[_0x6573('0x44')][_0x6573('0x33')]){_0x267760['where']=_[_0x6573('0x50')](_0x267760['where'],{'$or':_[_0x6573('0x35')](_0x267760[_0x6573('0x46')],function(_0x90e2da){var _0x2b8adb={};_0x2b8adb[_0x90e2da]={'$like':'%'+_0x393351[_0x6573('0x44')]['filter']+'%'};return _0x2b8adb;})});}_0x267760=_[_0x6573('0x50')]({},_0x267760,_0x393351[_0x6573('0x59')]);return db['CmHopper'][_0x6573('0x26')]({'where':_0x267760[_0x6573('0x4e')]})[_0x6573('0x2d')](function(_0x429c25){_0xbe2b9d[_0x6573('0x26')]=_0x429c25;if(_0x393351[_0x6573('0x44')][_0x6573('0x58')]){_0x267760[_0x6573('0x51')]=[{'all':!![]}];}return db['CmHopper'][_0x6573('0x52')](_0x267760);})[_0x6573('0x2d')](function(_0x22786f){_0xbe2b9d[_0x6573('0x53')]=_0x22786f;return _0xbe2b9d;});}})[_0x6573('0x2d')](respondWithFilteredResult(_0x53f7a2,_0x267760))[_0x6573('0x54')](handleError(_0x53f7a2,null));};exports[_0x6573('0x6a')]=function(_0x2cf9b0,_0x5de294,_0x4aba40){var _0x4fb57d={'raw':!![],'where':{}};var _0x44157c={};var _0x6283a8={'count':0x0,'rows':[]};return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0x2cf9b0[_0x6573('0x56')]['id']}})['then'](handleEntityNotFound(_0x5de294,null))[_0x6573('0x2d')](function(_0x188714){if(_0x188714){_0x44157c[_0x6573('0x43')]=_['keys'](db[_0x6573('0x6b')][_0x6573('0x40')]);_0x44157c[_0x6573('0x44')]=_[_0x6573('0x57')](_0x2cf9b0[_0x6573('0x44')]);_0x44157c[_0x6573('0x45')]=_[_0x6573('0x47')](_0x44157c['model'],_0x44157c['query']);_0x4fb57d['attributes']=_[_0x6573('0x47')](_0x44157c[_0x6573('0x43')],qs[_0x6573('0x48')](_0x2cf9b0[_0x6573('0x44')]['fields']));_0x4fb57d[_0x6573('0x46')]=_0x4fb57d[_0x6573('0x46')][_0x6573('0x49')]?_0x4fb57d[_0x6573('0x46')]:_0x44157c[_0x6573('0x43')];if(!_0x2cf9b0['query'][_0x6573('0x4a')]('nolimit')){_0x4fb57d[_0x6573('0x25')]=qs[_0x6573('0x25')](_0x2cf9b0[_0x6573('0x44')][_0x6573('0x25')]);_0x4fb57d['offset']=qs['offset'](_0x2cf9b0[_0x6573('0x44')][_0x6573('0x24')]);}_0x4fb57d['order']=qs[_0x6573('0x4d')](_0x2cf9b0[_0x6573('0x44')]['sort']);_0x4fb57d[_0x6573('0x4e')]=qs['filters'](_[_0x6573('0x4f')](_0x2cf9b0[_0x6573('0x44')],_0x44157c[_0x6573('0x45')]));_0x4fb57d['where'][_0x6573('0x6c')]=_0x188714['id'];if(_0x2cf9b0['query'][_0x6573('0x33')]){_0x4fb57d[_0x6573('0x4e')]=_[_0x6573('0x50')](_0x4fb57d[_0x6573('0x4e')],{'$or':_[_0x6573('0x35')](_0x4fb57d[_0x6573('0x46')],function(_0x51aa21){var _0xb826c9={};_0xb826c9[_0x51aa21]={'$like':'%'+_0x2cf9b0[_0x6573('0x44')]['filter']+'%'};return _0xb826c9;})});}_0x4fb57d=_[_0x6573('0x50')]({},_0x4fb57d,_0x2cf9b0[_0x6573('0x59')]);return db[_0x6573('0x6b')][_0x6573('0x26')]({'where':_0x4fb57d[_0x6573('0x4e')]})['then'](function(_0x166a2e){_0x6283a8[_0x6573('0x26')]=_0x166a2e;if(_0x2cf9b0[_0x6573('0x44')]['includeAll']){_0x4fb57d['include']=[{'all':!![]}];}return db[_0x6573('0x6b')][_0x6573('0x52')](_0x4fb57d);})['then'](function(_0x51014d){_0x6283a8[_0x6573('0x53')]=_0x51014d;return _0x6283a8;});}})[_0x6573('0x2d')](respondWithFilteredResult(_0x5de294,_0x4fb57d))[_0x6573('0x54')](handleError(_0x5de294,null));};exports[_0x6573('0x6d')]=function(_0x2b7f0e,_0xc6ee24,_0x1a3636){var _0x3e0421={'raw':!![],'where':{}};var _0x5b2e6b={};var _0x5dcbd5={'count':0x0,'rows':[]};return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0x2b7f0e[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0xc6ee24,null))[_0x6573('0x2d')](function(_0x3ce75d){if(_0x3ce75d){_0x5b2e6b[_0x6573('0x43')]=_[_0x6573('0x57')](db[_0x6573('0x6e')][_0x6573('0x40')]);_0x5b2e6b['query']=_['keys'](_0x2b7f0e[_0x6573('0x44')]);_0x5b2e6b['filters']=_[_0x6573('0x47')](_0x5b2e6b[_0x6573('0x43')],_0x5b2e6b[_0x6573('0x44')]);_0x3e0421[_0x6573('0x46')]=_['intersection'](_0x5b2e6b['model'],qs[_0x6573('0x48')](_0x2b7f0e['query'][_0x6573('0x48')]));_0x3e0421[_0x6573('0x46')]=_0x3e0421['attributes']['length']?_0x3e0421['attributes']:_0x5b2e6b[_0x6573('0x43')];if(!_0x2b7f0e[_0x6573('0x44')][_0x6573('0x4a')](_0x6573('0x4b'))){_0x3e0421['limit']=qs[_0x6573('0x25')](_0x2b7f0e[_0x6573('0x44')][_0x6573('0x25')]);_0x3e0421[_0x6573('0x24')]=qs[_0x6573('0x24')](_0x2b7f0e[_0x6573('0x44')][_0x6573('0x24')]);}_0x3e0421[_0x6573('0x4c')]=qs['sort'](_0x2b7f0e[_0x6573('0x44')][_0x6573('0x4d')]);_0x3e0421['where']=qs['filters'](_[_0x6573('0x4f')](_0x2b7f0e[_0x6573('0x44')],_0x5b2e6b['filters']));_0x3e0421['where']['VoiceQueueId']=_0x3ce75d['id'];if(_0x2b7f0e['query'][_0x6573('0x33')]){_0x3e0421[_0x6573('0x4e')]=_[_0x6573('0x50')](_0x3e0421[_0x6573('0x4e')],{'$or':_['map'](_0x3e0421[_0x6573('0x46')],function(_0x514fda){var _0x55dcb4={};_0x55dcb4[_0x514fda]={'$like':'%'+_0x2b7f0e[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x55dcb4;})});}_0x3e0421=_[_0x6573('0x50')]({},_0x3e0421,_0x2b7f0e[_0x6573('0x59')]);return db['CmHopperFinal']['count']({'where':_0x3e0421[_0x6573('0x4e')]})['then'](function(_0x263524){_0x5dcbd5['count']=_0x263524;if(_0x2b7f0e[_0x6573('0x44')][_0x6573('0x58')]){_0x3e0421['include']=[{'all':!![]}];}return db[_0x6573('0x6e')][_0x6573('0x52')](_0x3e0421);})[_0x6573('0x2d')](function(_0x56a91e){_0x5dcbd5['rows']=_0x56a91e;return _0x5dcbd5;});}})[_0x6573('0x2d')](respondWithFilteredResult(_0xc6ee24,_0x3e0421))[_0x6573('0x54')](handleError(_0xc6ee24,null));};exports[_0x6573('0x6f')]=function(_0x5d9c1c,_0xc490f8,_0x55ce1f){var _0x41baf4={'raw':!![],'where':{}};var _0xa60194={};var _0x3354b8={'count':0x0,'rows':[]};return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0x5d9c1c['params']['id']}})['then'](handleEntityNotFound(_0xc490f8,null))[_0x6573('0x2d')](function(_0x44a4f8){if(_0x44a4f8){_0xa60194[_0x6573('0x43')]=_[_0x6573('0x57')](db[_0x6573('0x70')]['rawAttributes']);_0xa60194[_0x6573('0x44')]=_['keys'](_0x5d9c1c[_0x6573('0x44')]);_0xa60194[_0x6573('0x45')]=_[_0x6573('0x47')](_0xa60194[_0x6573('0x43')],_0xa60194[_0x6573('0x44')]);_0x41baf4[_0x6573('0x46')]=_['intersection'](_0xa60194[_0x6573('0x43')],qs[_0x6573('0x48')](_0x5d9c1c[_0x6573('0x44')]['fields']));_0x41baf4[_0x6573('0x46')]=_0x41baf4[_0x6573('0x46')]['length']?_0x41baf4['attributes']:_0xa60194['model'];if(!_0x5d9c1c[_0x6573('0x44')][_0x6573('0x4a')](_0x6573('0x4b'))){_0x41baf4[_0x6573('0x25')]=qs[_0x6573('0x25')](_0x5d9c1c[_0x6573('0x44')]['limit']);_0x41baf4['offset']=qs[_0x6573('0x24')](_0x5d9c1c['query'][_0x6573('0x24')]);}_0x41baf4[_0x6573('0x4c')]=qs['sort'](_0x5d9c1c[_0x6573('0x44')]['sort']);_0x41baf4['where']=qs[_0x6573('0x45')](_[_0x6573('0x4f')](_0x5d9c1c[_0x6573('0x44')],_0xa60194[_0x6573('0x45')]));_0x41baf4[_0x6573('0x4e')][_0x6573('0x6c')]=_0x44a4f8['id'];if(_0x5d9c1c[_0x6573('0x44')][_0x6573('0x33')]){_0x41baf4[_0x6573('0x4e')]=_[_0x6573('0x50')](_0x41baf4['where'],{'$or':_[_0x6573('0x35')](_0x41baf4['attributes'],function(_0x5c606d){var _0x277548={};_0x277548[_0x5c606d]={'$like':'%'+_0x5d9c1c[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x277548;})});}_0x41baf4=_[_0x6573('0x50')]({},_0x41baf4,_0x5d9c1c[_0x6573('0x59')]);return db[_0x6573('0x70')][_0x6573('0x26')]({'where':_0x41baf4[_0x6573('0x4e')]})['then'](function(_0x487812){_0x3354b8[_0x6573('0x26')]=_0x487812;if(_0x5d9c1c[_0x6573('0x44')][_0x6573('0x58')]){_0x41baf4[_0x6573('0x51')]=[{'all':!![]}];}return db[_0x6573('0x70')]['findAll'](_0x41baf4);})[_0x6573('0x2d')](function(_0x2b0bba){_0x3354b8[_0x6573('0x53')]=_0x2b0bba;return _0x3354b8;});}})[_0x6573('0x2d')](respondWithFilteredResult(_0xc490f8,_0x41baf4))['catch'](handleError(_0xc490f8,null));};exports[_0x6573('0x71')]=function(_0x15b108,_0x16b728,_0x44651e){var _0xbf582b={};var _0x383c38={};var _0x530c8b;var _0x36e9b3;return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0x15b108[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x16b728,null))[_0x6573('0x2d')](function(_0x411b09){if(_0x411b09){_0x530c8b=_0x411b09;_0x383c38[_0x6573('0x43')]=_[_0x6573('0x57')](db['Team'][_0x6573('0x40')]);_0x383c38[_0x6573('0x44')]=_[_0x6573('0x57')](_0x15b108[_0x6573('0x44')]);_0x383c38['filters']=_[_0x6573('0x47')](_0x383c38[_0x6573('0x43')],_0x383c38['query']);_0xbf582b[_0x6573('0x46')]=_[_0x6573('0x47')](_0x383c38[_0x6573('0x43')],qs['fields'](_0x15b108[_0x6573('0x44')]['fields']));_0xbf582b[_0x6573('0x46')]=_0xbf582b[_0x6573('0x46')]['length']?_0xbf582b[_0x6573('0x46')]:_0x383c38[_0x6573('0x43')];_0xbf582b[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0x15b108[_0x6573('0x44')][_0x6573('0x4d')]);_0xbf582b[_0x6573('0x4e')]=qs['filters'](_[_0x6573('0x4f')](_0x15b108[_0x6573('0x44')],_0x383c38['filters']));if(_0x15b108[_0x6573('0x44')][_0x6573('0x33')]){_0xbf582b[_0x6573('0x4e')]=_[_0x6573('0x50')](_0xbf582b['where'],{'$or':_[_0x6573('0x35')](_0xbf582b['attributes'],function(_0x5f3a4f){var _0x252774={};_0x252774[_0x5f3a4f]={'$like':'%'+_0x15b108[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x252774;})});}_0xbf582b=_[_0x6573('0x50')]({},_0xbf582b,_0x15b108[_0x6573('0x59')]);return _0x530c8b[_0x6573('0x71')](_0xbf582b);}})['then'](function(_0x1f3ad1){if(_0x1f3ad1){_0x36e9b3=_0x1f3ad1[_0x6573('0x49')];if(!_0x15b108[_0x6573('0x44')][_0x6573('0x4a')](_0x6573('0x4b'))){_0xbf582b[_0x6573('0x25')]=qs['limit'](_0x15b108[_0x6573('0x44')][_0x6573('0x25')]);_0xbf582b['offset']=qs[_0x6573('0x24')](_0x15b108[_0x6573('0x44')][_0x6573('0x24')]);}return _0x530c8b['getTeams'](_0xbf582b);}})[_0x6573('0x2d')](function(_0xe8f6a6){if(_0xe8f6a6){return _0xe8f6a6?{'count':_0x36e9b3,'rows':_0xe8f6a6}:null;}})[_0x6573('0x2d')](respondWithResult(_0x16b728,null))[_0x6573('0x54')](handleError(_0x16b728,null));};exports[_0x6573('0x72')]=function(_0x54c2f7,_0x5edaed,_0xf5b22b){var _0x108beb=_0x54c2f7[_0x6573('0x5b')][_0x6573('0x73')];var _0x43ca5e=_[_0x6573('0x35')](_0x108beb,'id');return db[_0x6573('0x74')][_0x6573('0x52')]({'where':{'id':_0x43ca5e},'attributes':['id'],'include':[{'model':db[_0x6573('0x75')],'as':_0x6573('0x76'),'attributes':['id',_0x6573('0x39'),_0x6573('0x77'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x25837c){if(_0x25837c){var _0x3ebb39=_['flatMap'](_0x25837c,function(_0x4f8cfc){var _0x313a93=_0x4f8cfc[_0x6573('0x2f')]({'plain':!![]});_0x313a93[_0x6573('0x76')]['forEach'](function(_0x4cc925){_0x4cc925['penalty']=_['find'](_0x108beb,{'id':_0x313a93['id']})[_0x6573('0x78')];});return _0x313a93['Agents'];});return db[_0x6573('0x3f')][_0x6573('0x38')]({'where':{'id':_0x54c2f7[_0x6573('0x56')]['id']}})['then'](function(_0x59775b){return db[_0x6573('0x79')][_0x6573('0x7a')](function(_0x5e4209){return _0x59775b['addTeams'](_0x43ca5e,{'transaction':_0x5e4209})['then'](function(){return BPromise[_0x6573('0x7b')](_0x108beb,function(_0x5806d4){return db[_0x6573('0x7c')][_0x6573('0x7d')]({'TeamId':_0x5806d4['id'],'VoiceQueueId':_0x54c2f7[_0x6573('0x56')]['id'],'penalty':_0x5806d4[_0x6573('0x78')]},{'transaction':_0x5e4209});});})['then'](function(){return BPromise[_0x6573('0x7b')](_0x3ebb39,function(_0x138ffe){return db[_0x6573('0x7e')][_0x6573('0x7f')]({'where':{'UserId':_0x138ffe['id'],'VoiceQueueId':_0x54c2f7[_0x6573('0x56')]['id']},'defaults':{'penalty':_0x138ffe[_0x6573('0x78')]},'transaction':_0x5e4209});});})['then'](function(){return BPromise[_0x6573('0x7b')](_[_0x6573('0x33')](_0x3ebb39,{'online':!![]}),function(_0x510e35){return db[_0x6573('0x80')]['upsert']({'membername':_0x510e35[_0x6573('0x39')],'UserId':_0x510e35['id'],'queue_name':_0x59775b[_0x6573('0x39')],'VoiceQueueId':_0x59775b['id'],'interface':_['isNil'](_0x510e35[_0x6573('0x81')])?util[_0x6573('0x82')]('SIP/%s',_0x510e35[_0x6573('0x39')]):_0x510e35[_0x6573('0x81')],'paused':_0x510e35[_0x6573('0x83')]||![],'penalty':_0x510e35[_0x6573('0x78')]},{'transaction':_0x5e4209});});})[_0x6573('0x2d')](function(){_0x3ebb39[_0x6573('0x84')](function(_0x564b09){socket[_0x6573('0x85')](_0x6573('0x86'),{'UserId':_0x564b09['id'],'VoiceQueueId':_0x59775b['id']});});});});});}})[_0x6573('0x2d')](respondWithStatusCode(_0x5edaed,null))[_0x6573('0x54')](handleError(_0x5edaed,null));};exports[_0x6573('0x87')]=function(_0x15ffc7,_0x644070,_0x402ef4){return db['Team'][_0x6573('0x52')]({'where':{'id':_0x15ffc7[_0x6573('0x44')][_0x6573('0x88')]},'attributes':['id'],'include':[{'model':db[_0x6573('0x75')],'as':_0x6573('0x76'),'attributes':['id'],'raw':!![]}]})[_0x6573('0x2d')](handleEntityNotFound(_0x644070,null))[_0x6573('0x2d')](function(_0xe066dd){var _0x5bad46=_['map'](_0xe066dd,'id');var _0x30273f=[];var _0x5ce9bb=[];var _0x41916d=squel[_0x6573('0x89')]();_0x41916d['field'](_0x6573('0x8a'))[_0x6573('0x8b')](_0x6573('0x8c'),'tq')['join'](_0x6573('0x8d'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6573('0x4e')](_0x6573('0x8e'),_0x15ffc7['params']['id']);for(var _0x4d2786=0x0;_0x4d2786<_0xe066dd[_0x6573('0x49')];_0x4d2786+=0x1){let _0x2d26e9=_0xe066dd[_0x4d2786];for(var _0x351c88=0x0;_0x351c88<_0x2d26e9[_0x6573('0x76')][_0x6573('0x49')];_0x351c88+=0x1){let _0x506911=_0x2d26e9[_0x6573('0x76')][_0x351c88];var _0x9b0ecc=_0x41916d[_0x6573('0x60')]();_0x9b0ecc[_0x6573('0x4e')](_0x6573('0x8f'),_0x506911['id']);_0x5ce9bb[_0x6573('0x90')](db['sequelize'][_0x6573('0x44')](_0x9b0ecc[_0x6573('0x91')](),{'type':db['sequelize']['QueryTypes'][_0x6573('0x92')]})['then'](function(_0x136207){if(_0x136207[_0x6573('0x49')]===0x1){return _0x506911['id'];}else{var _0xdec607=_['every'](_[_0x6573('0x35')](_0x136207,_0x6573('0x93')),function(_0x2df67c){return _[_0x6573('0x37')](_0x5bad46,_0x2df67c);});if(_0xdec607){return _0x506911['id'];}}}));}}return BPromise[_0x6573('0x94')](_0x5ce9bb)['then'](function(_0x1d82f3){_0x30273f=_(_0x30273f)['union'](_0x1d82f3)[_0x6573('0x95')]()[_0x6573('0x36')]();return db[_0x6573('0x3f')]['find']({'where':{'id':_0x15ffc7[_0x6573('0x56')]['id']}})['then'](function(_0x243e88){return db['sequelize']['transaction'](function(_0x47042f){return _0x243e88[_0x6573('0x87')](_0x15ffc7[_0x6573('0x44')][_0x6573('0x88')],{'transaction':_0x47042f})['then'](function(){if(!_[_0x6573('0x96')](_0x30273f)){return _0x243e88[_0x6573('0x97')](_0x30273f,{'transaction':_0x47042f})[_0x6573('0x2d')](function(){return db[_0x6573('0x80')]['destroy']({'where':{'VoiceQueueId':_0x15ffc7[_0x6573('0x56')]['id'],'UserId':_0x30273f},'transaction':_0x47042f});});}})[_0x6573('0x2d')](function(){_0x30273f[_0x6573('0x84')](function(_0x4bc068){socket[_0x6573('0x85')](_0x6573('0x98'),{'UserId':_0x4bc068,'VoiceQueueId':_0x243e88['id']});});});});});});})[_0x6573('0x2d')](respondWithStatusCode(_0x644070,null))[_0x6573('0x54')](handleError(_0x644070,null));};exports[_0x6573('0x99')]=function(_0x4838d5,_0xa585c3,_0x51ad40){var _0x156dca,_0x3794c5;return db['VoiceQueue'][_0x6573('0x38')]({'where':{'id':_0x4838d5[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0xa585c3,null))[_0x6573('0x2d')](function(_0x28d2c9){if(_0x28d2c9){_0x3794c5=_0x28d2c9;return _0x28d2c9[_0x6573('0x99')](_0x4838d5['body']['ids'],_['omit'](_0x4838d5[_0x6573('0x5b')],[_0x6573('0x88'),'id'])||{})[_0x6573('0x9a')](function(_0x123c3b){for(var _0x5342ce=0x0;_0x5342ce<_0x4838d5[_0x6573('0x5b')]['ids'][_0x6573('0x49')];_0x5342ce+=0x1){socket[_0x6573('0x85')](_0x6573('0x86'),{'UserId':Number(_0x4838d5[_0x6573('0x5b')][_0x6573('0x88')][_0x5342ce]),'VoiceQueueId':Number(_0x4838d5[_0x6573('0x56')]['id'])});}return _0x123c3b;});}})[_0x6573('0x2d')](function(_0x4866be){_0x156dca=_0x4866be||[];if(_0x3794c5){return db[_0x6573('0x75')][_0x6573('0x52')]({'where':{'id':_0x4838d5[_0x6573('0x5b')]['ids']},'attributes':['id',_0x6573('0x39'),'online','voicePause',_0x6573('0x81')],'raw':!![]});}})['then'](function(_0x3f5d11){if(!_['isEmpty'](_0x3f5d11)){var _0x1d62a3=[];for(var _0x4ba594=0x0;_0x4ba594<_0x3f5d11['length'];_0x4ba594++){if(_0x3f5d11[_0x4ba594]['online']){_0x1d62a3[_0x6573('0x90')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3f5d11[_0x4ba594][_0x6573('0x39')],'UserId':_0x3f5d11[_0x4ba594]['id'],'queue_name':_0x3794c5['name'],'VoiceQueueId':_0x3794c5['id'],'interface':_['isNil'](_0x3f5d11[_0x4ba594][_0x6573('0x81')])?util['format'](_0x6573('0x9b'),_0x3f5d11[_0x4ba594][_0x6573('0x39')]):_0x3f5d11[_0x4ba594][_0x6573('0x81')],'paused':_0x3f5d11[_0x4ba594][_0x6573('0x83')]||![],'penalty':_0x4838d5[_0x6573('0x5b')][_0x6573('0x78')]||0x0}));}}return BPromise[_0x6573('0x94')](_0x1d62a3);}})[_0x6573('0x2d')](function(){return _0x156dca;})[_0x6573('0x2d')](respondWithResult(_0xa585c3,null))[_0x6573('0x54')](handleError(_0xa585c3,null));};exports[_0x6573('0x97')]=function(_0x3e8287,_0x1f33aa,_0x46f45c){return db[_0x6573('0x3f')][_0x6573('0x38')]({'where':{'id':_0x3e8287['params']['id']}})['then'](handleEntityNotFound(_0x1f33aa,null))[_0x6573('0x2d')](function(_0x229012){if(_0x229012){return _0x229012['removeAgents'](_0x3e8287[_0x6573('0x44')][_0x6573('0x88')])[_0x6573('0x2d')](function(){if(_['isArray'](_0x3e8287['query'][_0x6573('0x88')])){for(var _0xa1181=0x0;_0xa1181<_0x3e8287['query'][_0x6573('0x88')][_0x6573('0x49')];_0xa1181+=0x1){socket[_0x6573('0x85')]('userVoiceQueue:remove',{'UserId':Number(_0x3e8287[_0x6573('0x44')][_0x6573('0x88')][_0xa1181]),'VoiceQueueId':Number(_0x3e8287[_0x6573('0x56')]['id'])});}}else{socket[_0x6573('0x85')](_0x6573('0x98'),{'UserId':Number(_0x3e8287[_0x6573('0x44')][_0x6573('0x88')]),'VoiceQueueId':Number(_0x3e8287[_0x6573('0x56')]['id'])});}});}})[_0x6573('0x2d')](function(_0x1a5504){return db[_0x6573('0x80')][_0x6573('0x2e')]({'where':{'VoiceQueueId':_0x3e8287[_0x6573('0x56')]['id'],'UserId':_0x3e8287['query'][_0x6573('0x88')]}})[_0x6573('0x2d')](function(){return _0x1a5504;});})[_0x6573('0x2d')](respondWithStatusCode(_0x1f33aa,null))[_0x6573('0x54')](handleError(_0x1f33aa,null));};exports[_0x6573('0x9c')]=function(_0x4cbb2e,_0xc2df9f,_0x1c07d7){var _0x9374d4={};var _0x342686={};var _0x40e537;var _0x36f27e;return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0x4cbb2e[_0x6573('0x56')]['id']}})['then'](handleEntityNotFound(_0xc2df9f,null))['then'](function(_0x21ddb5){if(_0x21ddb5){_0x40e537=_0x21ddb5;_0x342686[_0x6573('0x43')]=_['keys'](db[_0x6573('0x75')][_0x6573('0x40')]);_0x342686[_0x6573('0x44')]=_[_0x6573('0x57')](_0x4cbb2e[_0x6573('0x44')]);_0x342686[_0x6573('0x45')]=_[_0x6573('0x47')](_0x342686[_0x6573('0x43')],_0x342686[_0x6573('0x44')]);_0x9374d4[_0x6573('0x46')]=_[_0x6573('0x47')](_0x342686['model'],qs[_0x6573('0x48')](_0x4cbb2e[_0x6573('0x44')][_0x6573('0x48')]));_0x9374d4[_0x6573('0x46')]=_0x9374d4['attributes'][_0x6573('0x49')]?_0x9374d4[_0x6573('0x46')]:_0x342686[_0x6573('0x43')];_0x9374d4[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0x4cbb2e[_0x6573('0x44')][_0x6573('0x4d')]);_0x9374d4[_0x6573('0x4e')]=qs[_0x6573('0x45')](_[_0x6573('0x4f')](_0x4cbb2e[_0x6573('0x44')],_0x342686[_0x6573('0x45')]));if(_0x4cbb2e[_0x6573('0x44')][_0x6573('0x33')]){_0x9374d4['where']=_['merge'](_0x9374d4[_0x6573('0x4e')],{'$or':_[_0x6573('0x35')](_0x9374d4['attributes'],function(_0x2adf1a){var _0x11167c={};_0x11167c[_0x2adf1a]={'$like':'%'+_0x4cbb2e[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x11167c;})});}_0x9374d4=_['merge']({},_0x9374d4,_0x4cbb2e[_0x6573('0x59')]);return _0x40e537[_0x6573('0x9c')](_0x9374d4);}})[_0x6573('0x2d')](function(_0x3eb81c){if(_0x3eb81c){_0x36f27e=_0x3eb81c[_0x6573('0x49')];if(!_0x4cbb2e[_0x6573('0x44')][_0x6573('0x4a')](_0x6573('0x4b'))){_0x9374d4['limit']=qs[_0x6573('0x25')](_0x4cbb2e['query'][_0x6573('0x25')]);_0x9374d4['offset']=qs[_0x6573('0x24')](_0x4cbb2e['query'][_0x6573('0x24')]);}return _0x40e537['getAgents'](_0x9374d4);}})['then'](function(_0x347c5d){if(_0x347c5d){return _0x347c5d?{'count':_0x36f27e,'rows':_0x347c5d}:null;}})[_0x6573('0x2d')](respondWithResult(_0xc2df9f,null))['catch'](handleError(_0xc2df9f,null));};exports[_0x6573('0x9d')]=function(_0x37e5c7,_0x2626cf,_0x4e912a){var _0x2439c2={};var _0x646452={};var _0x27e71a;var _0x1bfd90;return db['VoiceQueue'][_0x6573('0x69')]({'where':{'id':_0x37e5c7[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x2626cf,null))[_0x6573('0x2d')](function(_0x13ca97){if(_0x13ca97){_0x27e71a=_0x13ca97;_0x646452[_0x6573('0x43')]=_[_0x6573('0x57')](db[_0x6573('0x80')][_0x6573('0x40')]);_0x646452[_0x6573('0x44')]=_[_0x6573('0x57')](_0x37e5c7['query']);_0x646452[_0x6573('0x45')]=_[_0x6573('0x47')](_0x646452[_0x6573('0x43')],_0x646452[_0x6573('0x44')]);_0x2439c2[_0x6573('0x46')]=_['intersection'](_0x646452[_0x6573('0x43')],qs[_0x6573('0x48')](_0x37e5c7[_0x6573('0x44')][_0x6573('0x48')]));_0x2439c2[_0x6573('0x46')]=_0x2439c2[_0x6573('0x46')]['length']?_0x2439c2[_0x6573('0x46')]:_0x646452[_0x6573('0x43')];_0x2439c2[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0x37e5c7[_0x6573('0x44')][_0x6573('0x4d')]);_0x2439c2['where']=qs[_0x6573('0x45')](_[_0x6573('0x4f')](_0x37e5c7['query'],_0x646452['filters']));if(_0x37e5c7[_0x6573('0x44')][_0x6573('0x33')]){_0x2439c2['where']=_[_0x6573('0x50')](_0x2439c2['where'],{'$or':_[_0x6573('0x35')](_0x2439c2[_0x6573('0x46')],function(_0x5937bd){var _0x4c2816={};_0x4c2816[_0x5937bd]={'$like':'%'+_0x37e5c7[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x4c2816;})});}_0x2439c2=_[_0x6573('0x50')]({},_0x2439c2,_0x37e5c7[_0x6573('0x59')]);return _0x27e71a[_0x6573('0x9d')](_0x2439c2);}})[_0x6573('0x2d')](function(_0x33dbfc){if(_0x33dbfc){_0x1bfd90=_0x33dbfc[_0x6573('0x49')];if(!_0x37e5c7[_0x6573('0x44')][_0x6573('0x4a')](_0x6573('0x4b'))){_0x2439c2[_0x6573('0x25')]=qs[_0x6573('0x25')](_0x37e5c7[_0x6573('0x44')][_0x6573('0x25')]);_0x2439c2['offset']=qs['offset'](_0x37e5c7['query'][_0x6573('0x24')]);}return _0x27e71a[_0x6573('0x9d')](_0x2439c2);}})['then'](function(_0x28fc6d){return _0x28fc6d?{'count':_0x1bfd90,'rows':_0x28fc6d}:null;})[_0x6573('0x2d')](respondWithResult(_0x2626cf,null))[_0x6573('0x54')](handleError(_0x2626cf,null));};exports[_0x6573('0x9e')]=function(_0x3cd30e,_0x33275d,_0x2c6152){var _0x132b4f={};var _0x20168e={};var _0x2d93ff;var _0x52729a;return db['VoiceQueue'][_0x6573('0x69')]({'where':{'id':_0x3cd30e[_0x6573('0x56')]['id']}})['then'](handleEntityNotFound(_0x33275d,null))[_0x6573('0x2d')](function(_0x3e1ffc){if(_0x3e1ffc){_0x2d93ff=_0x3e1ffc;_0x20168e['model']=_[_0x6573('0x57')](db[_0x6573('0x9f')][_0x6573('0x40')]);_0x20168e[_0x6573('0x44')]=_['keys'](_0x3cd30e[_0x6573('0x44')]);_0x20168e['filters']=_[_0x6573('0x47')](_0x20168e[_0x6573('0x43')],_0x20168e[_0x6573('0x44')]);_0x132b4f[_0x6573('0x46')]=_[_0x6573('0x47')](_0x20168e[_0x6573('0x43')],qs[_0x6573('0x48')](_0x3cd30e['query']['fields']));_0x132b4f[_0x6573('0x46')]=_0x132b4f[_0x6573('0x46')]['length']?_0x132b4f[_0x6573('0x46')]:_0x20168e[_0x6573('0x43')];_0x132b4f[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0x3cd30e[_0x6573('0x44')]['sort']);_0x132b4f['where']=qs['filters'](_[_0x6573('0x4f')](_0x3cd30e[_0x6573('0x44')],_0x20168e[_0x6573('0x45')]));if(_0x3cd30e[_0x6573('0x44')][_0x6573('0x33')]){_0x132b4f[_0x6573('0x4e')]=_['merge'](_0x132b4f[_0x6573('0x4e')],{'$or':_['map'](_0x132b4f[_0x6573('0x46')],function(_0x39efbd){var _0x4c3e98={};_0x4c3e98[_0x39efbd]={'$like':'%'+_0x3cd30e[_0x6573('0x44')]['filter']+'%'};return _0x4c3e98;})});}_0x132b4f=_['merge']({},_0x132b4f,_0x3cd30e['options']);return _0x2d93ff[_0x6573('0x9e')](_0x132b4f);}})[_0x6573('0x2d')](function(_0x514055){if(_0x514055){_0x52729a=_0x514055[_0x6573('0x49')];if(!_0x3cd30e['query'][_0x6573('0x4a')](_0x6573('0x4b'))){_0x132b4f[_0x6573('0x25')]=qs['limit'](_0x3cd30e[_0x6573('0x44')][_0x6573('0x25')]);_0x132b4f[_0x6573('0x24')]=qs[_0x6573('0x24')](_0x3cd30e[_0x6573('0x44')][_0x6573('0x24')]);}return _0x2d93ff[_0x6573('0x9e')](_0x132b4f);}})[_0x6573('0x2d')](function(_0x4fe6c8){if(_0x4fe6c8){return _0x4fe6c8?{'count':_0x52729a,'rows':_0x4fe6c8}:null;}})[_0x6573('0x2d')](respondWithResult(_0x33275d,null))[_0x6573('0x54')](handleError(_0x33275d,null));};exports[_0x6573('0xa0')]=function(_0x47b735,_0x42f13b,_0x5f3e4c){var _0x256b94,_0x5a919f;return db['VoiceQueue'][_0x6573('0x38')]({'where':{'id':_0x47b735[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x42f13b,null))[_0x6573('0x2d')](function(_0x770a11){if(_0x770a11){_0x5a919f=_0x770a11;return _0x770a11[_0x6573('0xa0')](_0x47b735[_0x6573('0x5b')][_0x6573('0x88')],_[_0x6573('0x61')](_0x47b735[_0x6573('0x5b')],[_0x6573('0x88'),'id'])||{});}return null;})[_0x6573('0x9a')](function(_0x533405){var _0x57bdbf;_0x256b94=_0x533405||[];var _0x1837e0=[];if(_0x533405){for(var _0x174adc=0x0;_0x174adc<_0x533405['length'];_0x174adc+=0x1){var _0x144b07=_0x533405[_0x174adc]['get']({'plain':!![]});_0x5a919f[_0x6573('0xa1')]=_0x47b735['body'][_0x6573('0xa1')]?_0x47b735['body']['dialCheckDuplicateType']:_0x5a919f['dialCheckDuplicateType'];switch(_0x5a919f['dialCheckDuplicateType']){case _0x6573('0xa2'):_0x57bdbf=squel['insert']()[_0x6573('0xa3')](_0x6573('0xa4'))[_0x6573('0xa5')]([_0x6573('0xa6'),_0x6573('0xa7'),_0x6573('0xa8'),_0x6573('0xa9'),_0x6573('0x6c'),'createdAt',_0x6573('0x63')],squel[_0x6573('0x89')]()[_0x6573('0xaa')](_0x6573('0xa6'),_0x6573('0xa6'))[_0x6573('0xaa')](_0x6573('0xab'),'scheduledAt')['field']('id',_0x6573('0xa8'))['field'](_0x144b07[_0x6573('0xac')][_0x6573('0x91')](),_0x6573('0xa9'))['field'](_0x47b735[_0x6573('0x56')]['id'][_0x6573('0x91')](),'VoiceQueueId')[_0x6573('0xaa')](_0x6573('0xab'),'createdAt')[_0x6573('0xaa')](_0x6573('0xab'),_0x6573('0x63'))[_0x6573('0x8b')](_0x6573('0xad'))[_0x6573('0x4e')]('deletedAt\x20IS\x20NULL')[_0x6573('0x4e')]('ListId\x20=\x20?',_0x144b07[_0x6573('0xac')]['toString']())[_0x6573('0x4e')](_0x6573('0xae'))[_0x6573('0x4e')](_0x6573('0xaf'),squel['select']()[_0x6573('0xaa')](_0x6573('0xb0'))['from'](_0x6573('0xb1'))['where']('VoiceQueueId\x20=\x20?',_0x47b735[_0x6573('0x56')]['id']['toString']()))[_0x6573('0x4e')](_0x6573('0xaf'),squel[_0x6573('0x89')]()[_0x6573('0xaa')](_0x6573('0xb2'))[_0x6573('0x8b')](_0x6573('0xa4'))[_0x6573('0x4e')](_0x6573('0x8e'),_0x47b735['params']['id']['toString']())))[_0x6573('0x91')]();break;case _0x6573('0xb3'):_0x57bdbf=squel[_0x6573('0xb4')]()[_0x6573('0xa3')](_0x6573('0xa4'))['fromQuery']([_0x6573('0xa6'),_0x6573('0xa7'),_0x6573('0xa8'),'ListId',_0x6573('0x6c'),_0x6573('0x62'),_0x6573('0x63')],squel[_0x6573('0x89')]()['field'](_0x6573('0xa6'),'phone')['field'](_0x6573('0xab'),'scheduledAt')[_0x6573('0xaa')]('id',_0x6573('0xa8'))['field'](_0x144b07[_0x6573('0xac')][_0x6573('0x91')](),_0x6573('0xa9'))[_0x6573('0xaa')](_0x47b735[_0x6573('0x56')]['id'][_0x6573('0x91')](),_0x6573('0x6c'))[_0x6573('0xaa')](_0x6573('0xab'),_0x6573('0x62'))[_0x6573('0xaa')]('NOW()',_0x6573('0x63'))[_0x6573('0x8b')](_0x6573('0xad'))[_0x6573('0x4e')](_0x6573('0xb5'))[_0x6573('0x4e')](_0x6573('0xb6'),_0x144b07['CmListId'][_0x6573('0x91')]())[_0x6573('0x4e')]('phone\x20IS\x20NOT\x20NULL')[_0x6573('0x4e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6573('0x89')]()[_0x6573('0xaa')](_0x6573('0xb2'))[_0x6573('0x8b')](_0x6573('0xa4'))[_0x6573('0x4e')]('VoiceQueueId\x20=\x20?',_0x47b735['params']['id'][_0x6573('0x91')]())))[_0x6573('0x91')]();break;default:_0x57bdbf=squel['insert']()[_0x6573('0xa3')](_0x6573('0xa4'))['fromQuery']([_0x6573('0xa6'),_0x6573('0xa7'),_0x6573('0xa8'),'ListId',_0x6573('0x6c'),_0x6573('0x62'),_0x6573('0x63')],squel[_0x6573('0x89')]()[_0x6573('0xaa')](_0x6573('0xa6'),_0x6573('0xa6'))[_0x6573('0xaa')](_0x6573('0xab'),_0x6573('0xa7'))['field']('id',_0x6573('0xa8'))[_0x6573('0xaa')](_0x144b07['CmListId'][_0x6573('0x91')](),_0x6573('0xa9'))[_0x6573('0xaa')](_0x47b735[_0x6573('0x56')]['id'][_0x6573('0x91')](),_0x6573('0x6c'))[_0x6573('0xaa')](_0x6573('0xab'),'createdAt')[_0x6573('0xaa')]('NOW()',_0x6573('0x63'))[_0x6573('0x8b')](_0x6573('0xad'))[_0x6573('0x4e')](_0x6573('0xb5'))['where']('ListId\x20=\x20?',_0x144b07[_0x6573('0xac')][_0x6573('0x91')]())['where'](_0x6573('0xae')))[_0x6573('0x91')]();}_0x1837e0[_0x6573('0x90')](db[_0x6573('0x79')][_0x6573('0x44')](_0x57bdbf));}return BPromise[_0x6573('0x94')](_0x1837e0);}})['then'](function(){return _0x256b94;})[_0x6573('0x2d')](respondWithResult(_0x42f13b,null))[_0x6573('0x54')](handleError(_0x42f13b,null));};exports[_0x6573('0xb7')]=function(_0x5d269f,_0x2fc18c,_0x1a6fda){return db[_0x6573('0x3f')][_0x6573('0x38')]({'where':{'id':_0x5d269f['params']['id']}})['then'](handleEntityNotFound(_0x2fc18c,null))['then'](function(_0x3b20ef){if(_0x3b20ef){return _0x3b20ef[_0x6573('0xb7')](_0x5d269f[_0x6573('0x44')][_0x6573('0x88')]);}})[_0x6573('0x2d')](function(_0x4ad0af){if(_0x4ad0af){return db[_0x6573('0xb8')][_0x6573('0x2e')]({'where':{'ListId':_0x5d269f[_0x6573('0x44')][_0x6573('0x88')],'VoiceQueueId':_0x5d269f[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](function(){return _0x4ad0af;});}})[_0x6573('0x2d')](respondWithStatusCode(_0x2fc18c,null))[_0x6573('0x54')](handleError(_0x2fc18c,null));};exports['getBlackLists']=function(_0xf0f09d,_0x5c12e0,_0x5e314e){var _0x5c66f3={};var _0x44207b={};var _0x30315a;var _0x296b0d;return db[_0x6573('0x3f')][_0x6573('0x69')]({'where':{'id':_0xf0f09d[_0x6573('0x56')]['id']}})['then'](handleEntityNotFound(_0x5c12e0,null))['then'](function(_0x256451){if(_0x256451){_0x30315a=_0x256451;_0x44207b[_0x6573('0x43')]=_[_0x6573('0x57')](db[_0x6573('0x9f')][_0x6573('0x40')]);_0x44207b[_0x6573('0x44')]=_[_0x6573('0x57')](_0xf0f09d['query']);_0x44207b[_0x6573('0x45')]=_[_0x6573('0x47')](_0x44207b['model'],_0x44207b[_0x6573('0x44')]);_0x5c66f3[_0x6573('0x46')]=_[_0x6573('0x47')](_0x44207b[_0x6573('0x43')],qs['fields'](_0xf0f09d['query'][_0x6573('0x48')]));_0x5c66f3[_0x6573('0x46')]=_0x5c66f3[_0x6573('0x46')][_0x6573('0x49')]?_0x5c66f3['attributes']:_0x44207b[_0x6573('0x43')];_0x5c66f3[_0x6573('0x4c')]=qs[_0x6573('0x4d')](_0xf0f09d[_0x6573('0x44')][_0x6573('0x4d')]);_0x5c66f3[_0x6573('0x4e')]=qs[_0x6573('0x45')](_['pick'](_0xf0f09d[_0x6573('0x44')],_0x44207b[_0x6573('0x45')]));if(_0xf0f09d[_0x6573('0x44')][_0x6573('0x33')]){_0x5c66f3[_0x6573('0x4e')]=_[_0x6573('0x50')](_0x5c66f3[_0x6573('0x4e')],{'$or':_[_0x6573('0x35')](_0x5c66f3[_0x6573('0x46')],function(_0x5c4941){var _0x24fa23={};_0x24fa23[_0x5c4941]={'$like':'%'+_0xf0f09d[_0x6573('0x44')][_0x6573('0x33')]+'%'};return _0x24fa23;})});}_0x5c66f3=_[_0x6573('0x50')]({},_0x5c66f3,_0xf0f09d[_0x6573('0x59')]);return _0x30315a['getBlackLists'](_0x5c66f3);}})[_0x6573('0x2d')](function(_0x696388){if(_0x696388){_0x296b0d=_0x696388[_0x6573('0x49')];if(!_0xf0f09d[_0x6573('0x44')]['hasOwnProperty'](_0x6573('0x4b'))){_0x5c66f3[_0x6573('0x25')]=qs['limit'](_0xf0f09d['query'][_0x6573('0x25')]);_0x5c66f3[_0x6573('0x24')]=qs[_0x6573('0x24')](_0xf0f09d[_0x6573('0x44')][_0x6573('0x24')]);}return _0x30315a[_0x6573('0xb9')](_0x5c66f3);}})[_0x6573('0x2d')](function(_0x4f4cb6){if(_0x4f4cb6){return _0x4f4cb6?{'count':_0x296b0d,'rows':_0x4f4cb6}:null;}})[_0x6573('0x2d')](respondWithResult(_0x5c12e0,null))[_0x6573('0x54')](handleError(_0x5c12e0,null));};exports['addBlackLists']=function(_0x197b38,_0x389459,_0x106243){var _0x269585,_0x2c8ce6;return db[_0x6573('0x3f')][_0x6573('0x38')]({'where':{'id':_0x197b38[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x389459,null))[_0x6573('0x2d')](function(_0x756c53){if(_0x756c53){_0x2c8ce6=_0x756c53;return _0x756c53[_0x6573('0xba')](_0x197b38[_0x6573('0x5b')][_0x6573('0x88')],_[_0x6573('0x61')](_0x197b38['body'],['ids','id'])||{});}return null;})['spread'](function(_0x6b4cd9){var _0xff8613;_0x269585=_0x6b4cd9||[];var _0xb37e96=[];if(_0x6b4cd9){for(var _0x467677=0x0;_0x467677<_0x6b4cd9[_0x6573('0x49')];_0x467677+=0x1){var _0x19fcd7=_0x6b4cd9[_0x467677][_0x6573('0x2f')]({'plain':!![]});_0xff8613=squel[_0x6573('0xb4')]()[_0x6573('0xa3')](_0x6573('0xbb'))['fromQuery'](['phone','ContactId','ListId','VoiceQueueId',_0x6573('0x62'),_0x6573('0x63')],squel[_0x6573('0x89')]()[_0x6573('0xaa')](_0x6573('0xa6'),_0x6573('0xa6'))['field']('id',_0x6573('0xa8'))[_0x6573('0xaa')](_0x19fcd7[_0x6573('0xac')][_0x6573('0x91')](),_0x6573('0xa9'))[_0x6573('0xaa')](_0x197b38['params']['id'][_0x6573('0x91')](),_0x6573('0x6c'))[_0x6573('0xaa')](_0x6573('0xab'),'createdAt')[_0x6573('0xaa')](_0x6573('0xab'),_0x6573('0x63'))['from'](_0x6573('0xad'))[_0x6573('0x4e')](_0x6573('0xb5'))[_0x6573('0x4e')]('ListId\x20=\x20?',_0x19fcd7[_0x6573('0xac')][_0x6573('0x91')]())[_0x6573('0x4e')](_0x6573('0xae')))['toString']();_0xb37e96[_0x6573('0x90')](db[_0x6573('0x79')][_0x6573('0x44')](_0xff8613));}return BPromise[_0x6573('0x94')](_0xb37e96);}})[_0x6573('0x2d')](function(){return _0x269585;})['then'](respondWithResult(_0x389459,null))['catch'](handleError(_0x389459,null));};exports[_0x6573('0xbc')]=function(_0x3c85b5,_0x3e1a85,_0x16bb87){return db[_0x6573('0x3f')]['find']({'where':{'id':_0x3c85b5['params']['id']}})[_0x6573('0x2d')](handleEntityNotFound(_0x3e1a85,null))[_0x6573('0x2d')](function(_0x1a4da6){if(_0x1a4da6){return _0x1a4da6[_0x6573('0xbc')](_0x3c85b5[_0x6573('0x44')]['ids']);}})[_0x6573('0x2d')](function(_0x4a145b){if(_0x4a145b){return db[_0x6573('0x70')]['destroy']({'where':{'ListId':_0x3c85b5['query'][_0x6573('0x88')],'VoiceQueueId':_0x3c85b5[_0x6573('0x56')]['id']}})[_0x6573('0x2d')](function(){return _0x4a145b;});}})[_0x6573('0x2d')](respondWithStatusCode(_0x3e1a85,null))[_0x6573('0x54')](handleError(_0x3e1a85,null));}; \ No newline at end of file +var _0x2645=['findAll','rows','catch','params','keys','length','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','nolimit','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','select','field','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','all','union','compact','isEmpty','UserVoiceQueueRt','emit','addAgents','spread','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ListId','NOW()','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','value','type','find','name','UserProfileResource','sendStatus','stack','send','index','map','VoiceQueue','fieldName','key','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include'];(function(_0x11660c,_0x3ce87e){var _0x37a98c=function(_0x3c1462){while(--_0x3c1462){_0x11660c['push'](_0x11660c['shift']());}};_0x37a98c(++_0x3ce87e);}(_0x2645,0x129));var _0x5264=function(_0x55f913,_0x2551e5){_0x55f913=_0x55f913-0x0;var _0x1f2154=_0x2645[_0x55f913];return _0x1f2154;};'use strict';var emlformat=require(_0x5264('0x0'));var rimraf=require(_0x5264('0x1'));var zipdir=require(_0x5264('0x2'));var jsonpatch=require(_0x5264('0x3'));var rp=require(_0x5264('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5264('0x5'));var util=require(_0x5264('0x6'));var path=require('path');var sox=require(_0x5264('0x7'));var csv=require(_0x5264('0x8'));var ejs=require(_0x5264('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5264('0xa'));var crypto=require(_0x5264('0xb'));var jsforce=require(_0x5264('0xc'));var deskjs=require(_0x5264('0xd'));var toCsv=require(_0x5264('0x8'));var querystring=require('querystring');var Papa=require(_0x5264('0xe'));var Redis=require(_0x5264('0xf'));var authService=require(_0x5264('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5264('0x11'));var logger=require(_0x5264('0x12'))(_0x5264('0x13'));var utils=require('../../config/utils');var config=require(_0x5264('0x14'));var licenseUtil=require(_0x5264('0x15'));var db=require(_0x5264('0x16'))['db'];config[_0x5264('0x17')]=_[_0x5264('0x18')](config[_0x5264('0x17')],{'host':_0x5264('0x19'),'port':0x18eb});var socket=require(_0x5264('0x1a'))(new Redis(config['redis']));require(_0x5264('0x1b'))[_0x5264('0x1c')](socket);function respondWithStatusCode(_0x384ed1,_0x154be7){_0x154be7=_0x154be7||0xcc;return function(_0x235112){if(_0x235112){return _0x384ed1['sendStatus'](_0x154be7);}return _0x384ed1['status'](_0x154be7)[_0x5264('0x1d')]();};}function respondWithResult(_0x46091c,_0xeb3ef5){_0xeb3ef5=_0xeb3ef5||0xc8;return function(_0x437b3b){if(_0x437b3b){return _0x46091c['status'](_0xeb3ef5)[_0x5264('0x1e')](_0x437b3b);}};}function respondWithFilteredResult(_0x3716c0,_0x1663f4){return function(_0x28331b){if(_0x28331b){var _0x47f5d4=typeof _0x1663f4['offset']===_0x5264('0x1f')&&typeof _0x1663f4[_0x5264('0x20')]===_0x5264('0x1f');var _0x4599f5=_0x28331b[_0x5264('0x21')];var _0x4e6225=_0x47f5d4?0x0:_0x1663f4[_0x5264('0x22')];var _0x11dc67=_0x47f5d4?_0x28331b['count']:_0x1663f4[_0x5264('0x22')]+_0x1663f4['limit'];var _0x405913;if(_0x11dc67>=_0x4599f5){_0x11dc67=_0x4599f5;_0x405913=0xc8;}else{_0x405913=0xce;}_0x3716c0[_0x5264('0x23')](_0x405913);return _0x3716c0[_0x5264('0x24')](_0x5264('0x25'),_0x4e6225+'-'+_0x11dc67+'/'+_0x4599f5)[_0x5264('0x1e')](_0x28331b);}return null;};}function patchUpdates(_0x25b425){return function(_0x577618){try{jsonpatch[_0x5264('0x26')](_0x577618,_0x25b425,!![]);}catch(_0x21540f){return BPromise[_0x5264('0x27')](_0x21540f);}return _0x577618[_0x5264('0x28')]();};}function saveUpdates(_0x510423,_0xec90e5){return function(_0x515172){if(_0x515172){return _0x515172[_0x5264('0x29')](_0x510423)[_0x5264('0x2a')](function(_0x1bfe58){return _0x1bfe58;});}return null;};}function removeEntity(_0x2f1265,_0x91596){return function(_0x26c896){if(_0x26c896){return _0x26c896[_0x5264('0x2b')]()['then'](function(){var _0x10404a=_0x26c896[_0x5264('0x2c')]({'plain':!![]});var _0x1809ec=[{'name':_0x5264('0x2d'),'value':_0x5264('0x2e'),'ignore':![]},{'name':_0x5264('0x2f'),'value':_0x5264('0x30'),'ignore':![]}];var _0x5915e5=_(_0x1809ec)['filter']('ignore')['map'](_0x5264('0x31'))['value']();if(_['includes'](_0x5915e5,_0x10404a[_0x5264('0x32')])){return;}var _0x12fb0d=_[_0x5264('0x33')](_0x1809ec,[_0x5264('0x31'),_0x10404a['type']])[_0x5264('0x34')];return db[_0x5264('0x35')]['destroy']({'where':{'type':_0x12fb0d,'resourceId':_0x10404a['id']}})['then'](function(){return _0x26c896;});})[_0x5264('0x2a')](function(){_0x2f1265[_0x5264('0x23')](0xcc)[_0x5264('0x1d')]();});}};}function handleEntityNotFound(_0x5c77e5,_0x33be15){return function(_0x24f11f){if(!_0x24f11f){_0x5c77e5[_0x5264('0x36')](0x194);}return _0x24f11f;};}function handleError(_0x1ac7e0,_0x47ee54){_0x47ee54=_0x47ee54||0x1f4;return function(_0xb73c80){logger['error'](_0xb73c80[_0x5264('0x37')]);if(_0xb73c80['name']){delete _0xb73c80['name'];}_0x1ac7e0[_0x5264('0x23')](_0x47ee54)[_0x5264('0x38')](_0xb73c80);};}exports[_0x5264('0x39')]=function(_0x3431eb,_0x331038){var _0x4d116d={},_0x4e3acc={},_0x3f2780={'count':0x0,'rows':[]};var _0x8537d9=_[_0x5264('0x3a')](db[_0x5264('0x3b')]['rawAttributes'],function(_0x475c27){return{'name':_0x475c27[_0x5264('0x3c')],'type':_0x475c27[_0x5264('0x32')][_0x5264('0x3d')]};});_0x4e3acc[_0x5264('0x3e')]=_['map'](_0x8537d9,_0x5264('0x34'));_0x4e3acc[_0x5264('0x3f')]=_['keys'](_0x3431eb['query']);_0x4e3acc['filters']=_['intersection'](_0x4e3acc[_0x5264('0x3e')],_0x4e3acc['query']);_0x4d116d[_0x5264('0x40')]=_[_0x5264('0x41')](_0x4e3acc[_0x5264('0x3e')],qs['fields'](_0x3431eb[_0x5264('0x3f')][_0x5264('0x42')]));_0x4d116d[_0x5264('0x40')]=_0x4d116d[_0x5264('0x40')]['length']?_0x4d116d['attributes']:_0x4e3acc[_0x5264('0x3e')];if(!_0x3431eb[_0x5264('0x3f')][_0x5264('0x43')]('nolimit')){_0x4d116d[_0x5264('0x20')]=qs[_0x5264('0x20')](_0x3431eb[_0x5264('0x3f')][_0x5264('0x20')]);_0x4d116d[_0x5264('0x22')]=qs['offset'](_0x3431eb[_0x5264('0x3f')][_0x5264('0x22')]);}_0x4d116d[_0x5264('0x44')]=qs['sort'](_0x3431eb[_0x5264('0x3f')][_0x5264('0x45')]);_0x4d116d[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0x3431eb[_0x5264('0x3f')],_0x4e3acc['filters']),_0x8537d9);if(_0x3431eb['query'][_0x5264('0x49')]){_0x4d116d['where']=_['merge'](_0x4d116d[_0x5264('0x46')],{'$or':_[_0x5264('0x3a')](_0x8537d9,function(_0x4690a4){if(_0x4690a4[_0x5264('0x32')]!==_0x5264('0x4a')){var _0x1d58e6={};_0x1d58e6[_0x4690a4[_0x5264('0x34')]]={'$like':'%'+_0x3431eb[_0x5264('0x3f')][_0x5264('0x49')]+'%'};return _0x1d58e6;}})});}_0x4d116d=_[_0x5264('0x4b')]({},_0x4d116d,_0x3431eb[_0x5264('0x4c')]);var _0x47dc4e={'where':_0x4d116d['where']};return db[_0x5264('0x3b')][_0x5264('0x21')](_0x47dc4e)['then'](function(_0x3ca110){_0x3f2780[_0x5264('0x21')]=_0x3ca110;if(_0x3431eb[_0x5264('0x3f')][_0x5264('0x4d')]){_0x4d116d[_0x5264('0x4e')]=[{'all':!![]}];}return db[_0x5264('0x3b')][_0x5264('0x4f')](_0x4d116d);})[_0x5264('0x2a')](function(_0x2dfb2f){_0x3f2780[_0x5264('0x50')]=_0x2dfb2f;return _0x3f2780;})[_0x5264('0x2a')](respondWithFilteredResult(_0x331038,_0x4d116d))[_0x5264('0x51')](handleError(_0x331038,null));};exports['show']=function(_0x500804,_0x255bed){var _0x50f2={'raw':![],'where':{'id':_0x500804[_0x5264('0x52')]['id']}},_0x1798f0={};_0x1798f0['model']=_[_0x5264('0x53')](db[_0x5264('0x3b')]['rawAttributes']);_0x1798f0[_0x5264('0x3f')]=_[_0x5264('0x53')](_0x500804[_0x5264('0x3f')]);_0x1798f0[_0x5264('0x47')]=_[_0x5264('0x41')](_0x1798f0[_0x5264('0x3e')],_0x1798f0[_0x5264('0x3f')]);_0x50f2['attributes']=_[_0x5264('0x41')](_0x1798f0[_0x5264('0x3e')],qs[_0x5264('0x42')](_0x500804[_0x5264('0x3f')]['fields']));_0x50f2['attributes']=_0x50f2[_0x5264('0x40')][_0x5264('0x54')]?_0x50f2[_0x5264('0x40')]:_0x1798f0[_0x5264('0x3e')];if(_0x500804[_0x5264('0x3f')]['includeAll']){_0x50f2[_0x5264('0x4e')]=[{'all':!![]}];}_0x50f2=_['merge']({},_0x50f2,_0x500804[_0x5264('0x4c')]);return db['VoiceQueue'][_0x5264('0x33')](_0x50f2)[_0x5264('0x2a')](handleEntityNotFound(_0x255bed,null))[_0x5264('0x2a')](respondWithResult(_0x255bed,null))[_0x5264('0x51')](handleError(_0x255bed,null));};exports[_0x5264('0x55')]=function(_0x4dd2f3,_0x2b0519){return db[_0x5264('0x3b')][_0x5264('0x55')](_0x4dd2f3[_0x5264('0x56')],{})['then'](function(_0x5b834f){var _0x45c788=_0x4dd2f3[_0x5264('0x57')]['get']({'plain':!![]});if(!_0x45c788)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45c788[_0x5264('0x58')]==='user'){var _0xb47db1=_0x5b834f['get']({'plain':!![]});var _0x145818=[{'name':'VoiceQueues','value':_0x5264('0x2e')},{'name':_0x5264('0x2f'),'value':'outbound'}];var _0x24e075=_['find'](_0x145818,[_0x5264('0x31'),_0xb47db1['type']])[_0x5264('0x34')];return db[_0x5264('0x59')][_0x5264('0x33')]({'where':{'name':_0x24e075,'userProfileId':_0x45c788[_0x5264('0x5a')]},'raw':!![]})[_0x5264('0x2a')](function(_0x12459d){if(_0x12459d&&_0x12459d[_0x5264('0x5b')]===0x0){return db[_0x5264('0x35')][_0x5264('0x55')]({'name':_0xb47db1['name'],'resourceId':_0xb47db1['id'],'type':_0x12459d[_0x5264('0x34')],'sectionId':_0x12459d['id']},{})['then'](function(){return _0x5b834f;});}else{return _0x5b834f;}})[_0x5264('0x51')](function(_0x5b1a2c){logger[_0x5264('0x5c')](_0x5264('0x5d'),_0x5b1a2c);throw _0x5b1a2c;});}return _0x5b834f;})[_0x5264('0x2a')](respondWithResult(_0x2b0519,0xc9))[_0x5264('0x51')](handleError(_0x2b0519,null));};exports['clone']=function(_0x4d0371,_0x4af56a){var _0x206543={'where':{'id':_0x4d0371['params']['id']}},_0x35d378={};_0x35d378[_0x5264('0x3e')]=_[_0x5264('0x53')](db[_0x5264('0x3b')][_0x5264('0x5e')]);_0x206543[_0x5264('0x40')]=_['intersection'](_0x35d378['model'],qs['fields'](_0x4d0371[_0x5264('0x3f')][_0x5264('0x42')]));_0x206543[_0x5264('0x40')]=_0x206543[_0x5264('0x40')][_0x5264('0x54')]?_0x206543['attributes']:_0x35d378[_0x5264('0x3e')];if(_0x4d0371[_0x5264('0x3f')][_0x5264('0x4d')]){_0x206543[_0x5264('0x4e')]=[{'all':!![]}];}_0x206543=_[_0x5264('0x4b')]({},_0x206543,_0x4d0371[_0x5264('0x4c')]);return db['VoiceQueue']['find'](_0x206543)['then'](handleEntityNotFound(_0x4af56a,null))[_0x5264('0x2a')](function(_0x3c2718){if(_0x3c2718){var _0x2ee2e6=_0x3c2718[_0x5264('0x2c')]({'plain':!![]});_0x2ee2e6=qs['omit'](_0x2ee2e6,['id','createdAt',_0x5264('0x5f')]);_0x4d0371['body']=_[_0x5264('0x60')](_0x4d0371[_0x5264('0x56')],['id',_0x5264('0x61'),_0x5264('0x5f')]);return db[_0x5264('0x3b')][_0x5264('0x55')](_['merge'](_0x2ee2e6,_0x4d0371[_0x5264('0x56')]),{'include':_0x4d0371[_0x5264('0x3f')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x3bacd6){var _0x4b22cf=_0x4d0371['user'][_0x5264('0x2c')]({'plain':!![]});if(!_0x4b22cf)throw new Error(_0x5264('0x62'));if(_0x4b22cf[_0x5264('0x58')]===_0x5264('0x57')){var _0x8b77da=_0x3bacd6[_0x5264('0x2c')]({'plain':!![]});var _0x5c216e=[{'name':_0x5264('0x2d'),'value':'inbound'},{'name':_0x5264('0x2f'),'value':_0x5264('0x30')}];var _0x2a70ba=_[_0x5264('0x33')](_0x5c216e,[_0x5264('0x31'),_0x8b77da[_0x5264('0x32')]])[_0x5264('0x34')];return db[_0x5264('0x59')][_0x5264('0x33')]({'where':{'name':_0x2a70ba,'userProfileId':_0x4b22cf[_0x5264('0x5a')]},'raw':!![]})['then'](function(_0x4524ca){if(_0x4524ca&&_0x4524ca[_0x5264('0x5b')]===0x0){return db['UserProfileResource'][_0x5264('0x55')]({'name':_0x8b77da[_0x5264('0x34')],'resourceId':_0x8b77da['id'],'type':_0x4524ca[_0x5264('0x34')],'sectionId':_0x4524ca['id']},{})[_0x5264('0x2a')](function(){return _0x3bacd6;});}else{return _0x3bacd6;}})['catch'](function(_0x159b41){logger['error'](_0x5264('0x5d'),_0x159b41);throw _0x159b41;});}return _0x3bacd6;});}})[_0x5264('0x2a')](respondWithResult(_0x4af56a,0xc9))[_0x5264('0x51')](handleError(_0x4af56a,null));};exports['update']=function(_0x3cc803,_0x2c9ca2){if(_0x3cc803[_0x5264('0x56')]['id']){delete _0x3cc803[_0x5264('0x56')]['id'];}return db[_0x5264('0x3b')][_0x5264('0x33')]({'where':{'id':_0x3cc803[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x2c9ca2,null))[_0x5264('0x2a')](saveUpdates(_0x3cc803[_0x5264('0x56')],null))[_0x5264('0x2a')](respondWithResult(_0x2c9ca2,null))[_0x5264('0x51')](handleError(_0x2c9ca2,null));};exports[_0x5264('0x2b')]=function(_0x316e0d,_0x942a66){return db[_0x5264('0x3b')]['find']({'where':{'id':_0x316e0d[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x942a66,null))['then'](removeEntity(_0x942a66,null))[_0x5264('0x51')](handleError(_0x942a66,null));};exports[_0x5264('0x63')]=function(_0x25e071,_0xf4bd7e,_0x5880e0){var _0x49bcd0={'raw':![],'where':{}};var _0x190efa={};var _0x2d0511={'count':0x0,'rows':[]};return db[_0x5264('0x3b')][_0x5264('0x64')]({'where':{'id':_0x25e071[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0xf4bd7e,null))[_0x5264('0x2a')](function(_0x3a4435){if(_0x3a4435){_0x190efa[_0x5264('0x3e')]=_[_0x5264('0x53')](db[_0x5264('0x65')]['rawAttributes']);_0x190efa[_0x5264('0x3f')]=_[_0x5264('0x53')](_0x25e071[_0x5264('0x3f')]);_0x190efa[_0x5264('0x47')]=_['intersection'](_0x190efa[_0x5264('0x3e')],_0x190efa[_0x5264('0x3f')]);_0x49bcd0['attributes']=_['intersection'](_0x190efa[_0x5264('0x3e')],qs[_0x5264('0x42')](_0x25e071[_0x5264('0x3f')][_0x5264('0x42')]));_0x49bcd0['attributes']=_0x49bcd0['attributes']['length']?_0x49bcd0[_0x5264('0x40')]:_0x190efa[_0x5264('0x3e')];if(!_0x25e071['query'][_0x5264('0x43')]('nolimit')){_0x49bcd0[_0x5264('0x20')]=qs[_0x5264('0x20')](_0x25e071[_0x5264('0x3f')][_0x5264('0x20')]);_0x49bcd0['offset']=qs['offset'](_0x25e071[_0x5264('0x3f')][_0x5264('0x22')]);}_0x49bcd0['order']=qs['sort'](_0x25e071['query'][_0x5264('0x45')]);_0x49bcd0[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0x25e071[_0x5264('0x3f')],_0x190efa[_0x5264('0x47')]));_0x49bcd0['where']['VoiceQueueId']=_0x3a4435['id'];if(_0x25e071['query'][_0x5264('0x49')]){_0x49bcd0[_0x5264('0x46')]=_['merge'](_0x49bcd0[_0x5264('0x46')],{'$or':_['map'](_0x49bcd0[_0x5264('0x40')],function(_0x57c111){var _0x3f4bf6={};_0x3f4bf6[_0x57c111]={'$like':'%'+_0x25e071['query']['filter']+'%'};return _0x3f4bf6;})});}_0x49bcd0=_[_0x5264('0x4b')]({},_0x49bcd0,_0x25e071['options']);return db[_0x5264('0x65')][_0x5264('0x21')]({'where':_0x49bcd0[_0x5264('0x46')]})['then'](function(_0x18ec45){_0x2d0511['count']=_0x18ec45;if(_0x25e071[_0x5264('0x3f')][_0x5264('0x4d')]){_0x49bcd0[_0x5264('0x4e')]=[{'all':!![]}];}return db[_0x5264('0x65')]['findAll'](_0x49bcd0);})[_0x5264('0x2a')](function(_0x55f920){_0x2d0511['rows']=_0x55f920;return _0x2d0511;});}})[_0x5264('0x2a')](respondWithFilteredResult(_0xf4bd7e,_0x49bcd0))[_0x5264('0x51')](handleError(_0xf4bd7e,null));};exports['getHopperHistories']=function(_0x17bc7c,_0x5b9275,_0x2b7762){var _0x5e373e={'raw':!![],'where':{}};var _0x4e5204={};var _0x563798={'count':0x0,'rows':[]};return db[_0x5264('0x3b')]['findOne']({'where':{'id':_0x17bc7c[_0x5264('0x52')]['id']}})['then'](handleEntityNotFound(_0x5b9275,null))['then'](function(_0x57cccf){if(_0x57cccf){_0x4e5204[_0x5264('0x3e')]=_['keys'](db['CmHopperHistory'][_0x5264('0x5e')]);_0x4e5204[_0x5264('0x3f')]=_['keys'](_0x17bc7c[_0x5264('0x3f')]);_0x4e5204[_0x5264('0x47')]=_[_0x5264('0x41')](_0x4e5204[_0x5264('0x3e')],_0x4e5204[_0x5264('0x3f')]);_0x5e373e['attributes']=_[_0x5264('0x41')](_0x4e5204['model'],qs['fields'](_0x17bc7c[_0x5264('0x3f')][_0x5264('0x42')]));_0x5e373e[_0x5264('0x40')]=_0x5e373e[_0x5264('0x40')][_0x5264('0x54')]?_0x5e373e[_0x5264('0x40')]:_0x4e5204[_0x5264('0x3e')];if(!_0x17bc7c[_0x5264('0x3f')][_0x5264('0x43')]('nolimit')){_0x5e373e[_0x5264('0x20')]=qs[_0x5264('0x20')](_0x17bc7c[_0x5264('0x3f')][_0x5264('0x20')]);_0x5e373e[_0x5264('0x22')]=qs[_0x5264('0x22')](_0x17bc7c[_0x5264('0x3f')][_0x5264('0x22')]);}_0x5e373e[_0x5264('0x44')]=qs[_0x5264('0x45')](_0x17bc7c[_0x5264('0x3f')][_0x5264('0x45')]);_0x5e373e[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0x17bc7c['query'],_0x4e5204[_0x5264('0x47')]));_0x5e373e['where'][_0x5264('0x66')]=_0x57cccf['id'];if(_0x17bc7c[_0x5264('0x3f')][_0x5264('0x49')]){_0x5e373e[_0x5264('0x46')]=_[_0x5264('0x4b')](_0x5e373e[_0x5264('0x46')],{'$or':_[_0x5264('0x3a')](_0x5e373e[_0x5264('0x40')],function(_0x44abb8){var _0x2c7bc8={};_0x2c7bc8[_0x44abb8]={'$like':'%'+_0x17bc7c[_0x5264('0x3f')]['filter']+'%'};return _0x2c7bc8;})});}_0x5e373e=_['merge']({},_0x5e373e,_0x17bc7c[_0x5264('0x4c')]);return db[_0x5264('0x67')][_0x5264('0x21')]({'where':_0x5e373e[_0x5264('0x46')]})[_0x5264('0x2a')](function(_0x164dad){_0x563798[_0x5264('0x21')]=_0x164dad;if(_0x17bc7c[_0x5264('0x3f')]['includeAll']){_0x5e373e['include']=[{'all':!![]}];}return db[_0x5264('0x67')][_0x5264('0x4f')](_0x5e373e);})[_0x5264('0x2a')](function(_0x4563d2){_0x563798[_0x5264('0x50')]=_0x4563d2;return _0x563798;});}})[_0x5264('0x2a')](respondWithFilteredResult(_0x5b9275,_0x5e373e))[_0x5264('0x51')](handleError(_0x5b9275,null));};exports[_0x5264('0x68')]=function(_0x1aa123,_0x4f5a11,_0x4138a2){var _0x250cbf={'raw':!![],'where':{}};var _0x45a001={};var _0x36d8b2={'count':0x0,'rows':[]};return db[_0x5264('0x3b')][_0x5264('0x64')]({'where':{'id':_0x1aa123[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x4f5a11,null))[_0x5264('0x2a')](function(_0x3e29ca){if(_0x3e29ca){_0x45a001[_0x5264('0x3e')]=_['keys'](db[_0x5264('0x69')][_0x5264('0x5e')]);_0x45a001['query']=_[_0x5264('0x53')](_0x1aa123[_0x5264('0x3f')]);_0x45a001[_0x5264('0x47')]=_['intersection'](_0x45a001[_0x5264('0x3e')],_0x45a001[_0x5264('0x3f')]);_0x250cbf['attributes']=_[_0x5264('0x41')](_0x45a001[_0x5264('0x3e')],qs[_0x5264('0x42')](_0x1aa123['query'][_0x5264('0x42')]));_0x250cbf[_0x5264('0x40')]=_0x250cbf[_0x5264('0x40')][_0x5264('0x54')]?_0x250cbf[_0x5264('0x40')]:_0x45a001[_0x5264('0x3e')];if(!_0x1aa123[_0x5264('0x3f')]['hasOwnProperty'](_0x5264('0x6a'))){_0x250cbf[_0x5264('0x20')]=qs['limit'](_0x1aa123[_0x5264('0x3f')][_0x5264('0x20')]);_0x250cbf[_0x5264('0x22')]=qs[_0x5264('0x22')](_0x1aa123[_0x5264('0x3f')][_0x5264('0x22')]);}_0x250cbf['order']=qs[_0x5264('0x45')](_0x1aa123[_0x5264('0x3f')][_0x5264('0x45')]);_0x250cbf[_0x5264('0x46')]=qs['filters'](_[_0x5264('0x48')](_0x1aa123[_0x5264('0x3f')],_0x45a001['filters']));_0x250cbf['where'][_0x5264('0x66')]=_0x3e29ca['id'];if(_0x1aa123['query'][_0x5264('0x49')]){_0x250cbf['where']=_[_0x5264('0x4b')](_0x250cbf[_0x5264('0x46')],{'$or':_[_0x5264('0x3a')](_0x250cbf[_0x5264('0x40')],function(_0x26d1cb){var _0x193593={};_0x193593[_0x26d1cb]={'$like':'%'+_0x1aa123[_0x5264('0x3f')]['filter']+'%'};return _0x193593;})});}_0x250cbf=_[_0x5264('0x4b')]({},_0x250cbf,_0x1aa123[_0x5264('0x4c')]);return db['CmHopperFinal'][_0x5264('0x21')]({'where':_0x250cbf[_0x5264('0x46')]})['then'](function(_0x3c4f7a){_0x36d8b2[_0x5264('0x21')]=_0x3c4f7a;if(_0x1aa123[_0x5264('0x3f')]['includeAll']){_0x250cbf['include']=[{'all':!![]}];}return db[_0x5264('0x69')][_0x5264('0x4f')](_0x250cbf);})[_0x5264('0x2a')](function(_0x1d3b3b){_0x36d8b2[_0x5264('0x50')]=_0x1d3b3b;return _0x36d8b2;});}})[_0x5264('0x2a')](respondWithFilteredResult(_0x4f5a11,_0x250cbf))[_0x5264('0x51')](handleError(_0x4f5a11,null));};exports['getHopperBlacks']=function(_0x58b383,_0x49312e,_0x431895){var _0x53027f={'raw':!![],'where':{}};var _0x30c023={};var _0x24616a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5264('0x64')]({'where':{'id':_0x58b383[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x49312e,null))[_0x5264('0x2a')](function(_0x13b52b){if(_0x13b52b){_0x30c023[_0x5264('0x3e')]=_[_0x5264('0x53')](db['CmHopperBlack'][_0x5264('0x5e')]);_0x30c023[_0x5264('0x3f')]=_[_0x5264('0x53')](_0x58b383['query']);_0x30c023[_0x5264('0x47')]=_['intersection'](_0x30c023[_0x5264('0x3e')],_0x30c023['query']);_0x53027f[_0x5264('0x40')]=_[_0x5264('0x41')](_0x30c023[_0x5264('0x3e')],qs[_0x5264('0x42')](_0x58b383[_0x5264('0x3f')][_0x5264('0x42')]));_0x53027f['attributes']=_0x53027f['attributes']['length']?_0x53027f[_0x5264('0x40')]:_0x30c023[_0x5264('0x3e')];if(!_0x58b383['query'][_0x5264('0x43')](_0x5264('0x6a'))){_0x53027f[_0x5264('0x20')]=qs['limit'](_0x58b383[_0x5264('0x3f')][_0x5264('0x20')]);_0x53027f['offset']=qs[_0x5264('0x22')](_0x58b383['query'][_0x5264('0x22')]);}_0x53027f['order']=qs[_0x5264('0x45')](_0x58b383[_0x5264('0x3f')][_0x5264('0x45')]);_0x53027f[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0x58b383[_0x5264('0x3f')],_0x30c023['filters']));_0x53027f['where']['VoiceQueueId']=_0x13b52b['id'];if(_0x58b383['query'][_0x5264('0x49')]){_0x53027f[_0x5264('0x46')]=_[_0x5264('0x4b')](_0x53027f[_0x5264('0x46')],{'$or':_[_0x5264('0x3a')](_0x53027f['attributes'],function(_0x477713){var _0x3dba2c={};_0x3dba2c[_0x477713]={'$like':'%'+_0x58b383[_0x5264('0x3f')][_0x5264('0x49')]+'%'};return _0x3dba2c;})});}_0x53027f=_[_0x5264('0x4b')]({},_0x53027f,_0x58b383[_0x5264('0x4c')]);return db['CmHopperBlack'][_0x5264('0x21')]({'where':_0x53027f['where']})[_0x5264('0x2a')](function(_0x4e7a49){_0x24616a[_0x5264('0x21')]=_0x4e7a49;if(_0x58b383[_0x5264('0x3f')][_0x5264('0x4d')]){_0x53027f['include']=[{'all':!![]}];}return db[_0x5264('0x6b')]['findAll'](_0x53027f);})['then'](function(_0x1b05df){_0x24616a[_0x5264('0x50')]=_0x1b05df;return _0x24616a;});}})[_0x5264('0x2a')](respondWithFilteredResult(_0x49312e,_0x53027f))['catch'](handleError(_0x49312e,null));};exports[_0x5264('0x6c')]=function(_0xb2f224,_0x5cf672,_0x2b351a){var _0x2d00a0={};var _0x394f08={};var _0x522bed;var _0x564879;return db[_0x5264('0x3b')][_0x5264('0x64')]({'where':{'id':_0xb2f224[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x5cf672,null))[_0x5264('0x2a')](function(_0x415ca8){if(_0x415ca8){_0x522bed=_0x415ca8;_0x394f08['model']=_[_0x5264('0x53')](db[_0x5264('0x6d')][_0x5264('0x5e')]);_0x394f08[_0x5264('0x3f')]=_[_0x5264('0x53')](_0xb2f224[_0x5264('0x3f')]);_0x394f08['filters']=_[_0x5264('0x41')](_0x394f08[_0x5264('0x3e')],_0x394f08['query']);_0x2d00a0[_0x5264('0x40')]=_[_0x5264('0x41')](_0x394f08[_0x5264('0x3e')],qs[_0x5264('0x42')](_0xb2f224[_0x5264('0x3f')][_0x5264('0x42')]));_0x2d00a0[_0x5264('0x40')]=_0x2d00a0[_0x5264('0x40')][_0x5264('0x54')]?_0x2d00a0[_0x5264('0x40')]:_0x394f08[_0x5264('0x3e')];_0x2d00a0[_0x5264('0x44')]=qs[_0x5264('0x45')](_0xb2f224[_0x5264('0x3f')][_0x5264('0x45')]);_0x2d00a0[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0xb2f224[_0x5264('0x3f')],_0x394f08['filters']));if(_0xb2f224['query']['filter']){_0x2d00a0[_0x5264('0x46')]=_[_0x5264('0x4b')](_0x2d00a0[_0x5264('0x46')],{'$or':_['map'](_0x2d00a0['attributes'],function(_0x1b42cd){var _0x2c1a35={};_0x2c1a35[_0x1b42cd]={'$like':'%'+_0xb2f224[_0x5264('0x3f')][_0x5264('0x49')]+'%'};return _0x2c1a35;})});}_0x2d00a0=_[_0x5264('0x4b')]({},_0x2d00a0,_0xb2f224[_0x5264('0x4c')]);return _0x522bed[_0x5264('0x6c')](_0x2d00a0);}})['then'](function(_0x351dc0){if(_0x351dc0){_0x564879=_0x351dc0[_0x5264('0x54')];if(!_0xb2f224[_0x5264('0x3f')][_0x5264('0x43')](_0x5264('0x6a'))){_0x2d00a0[_0x5264('0x20')]=qs[_0x5264('0x20')](_0xb2f224[_0x5264('0x3f')]['limit']);_0x2d00a0['offset']=qs['offset'](_0xb2f224[_0x5264('0x3f')][_0x5264('0x22')]);}return _0x522bed[_0x5264('0x6c')](_0x2d00a0);}})[_0x5264('0x2a')](function(_0x256292){if(_0x256292){return _0x256292?{'count':_0x564879,'rows':_0x256292}:null;}})[_0x5264('0x2a')](respondWithResult(_0x5cf672,null))['catch'](handleError(_0x5cf672,null));};exports[_0x5264('0x6e')]=function(_0xfd515d,_0x1219f1,_0x48f37c){var _0x5e7115=_0xfd515d[_0x5264('0x56')][_0x5264('0x6f')];var _0x47dc09=_[_0x5264('0x3a')](_0x5e7115,'id');return db['Team'][_0x5264('0x4f')]({'where':{'id':_0x47dc09},'attributes':['id'],'include':[{'model':db[_0x5264('0x70')],'as':'Agents','attributes':['id',_0x5264('0x34'),_0x5264('0x71'),_0x5264('0x72'),_0x5264('0x73')],'raw':!![]}]})['then'](function(_0x401fb3){if(_0x401fb3){var _0xb0d311=_[_0x5264('0x74')](_0x401fb3,function(_0x28aa0e){var _0x2bef5b=_0x28aa0e[_0x5264('0x2c')]({'plain':!![]});_0x2bef5b[_0x5264('0x75')]['forEach'](function(_0xcb9cad){_0xcb9cad[_0x5264('0x76')]=_[_0x5264('0x33')](_0x5e7115,{'id':_0x2bef5b['id']})[_0x5264('0x76')];});return _0x2bef5b[_0x5264('0x75')];});return db[_0x5264('0x3b')][_0x5264('0x33')]({'where':{'id':_0xfd515d[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](function(_0x4d848b){return db[_0x5264('0x77')][_0x5264('0x78')](function(_0x5b4618){return _0x4d848b[_0x5264('0x6e')](_0x47dc09,{'transaction':_0x5b4618})[_0x5264('0x2a')](function(){return BPromise[_0x5264('0x79')](_0x5e7115,function(_0x2d842b){return db[_0x5264('0x7a')][_0x5264('0x7b')]({'TeamId':_0x2d842b['id'],'VoiceQueueId':_0xfd515d['params']['id'],'penalty':_0x2d842b[_0x5264('0x76')]},{'transaction':_0x5b4618});});})['then'](function(){return BPromise[_0x5264('0x79')](_0xb0d311,function(_0x5c8670){return db[_0x5264('0x7c')][_0x5264('0x7d')]({'where':{'UserId':_0x5c8670['id'],'VoiceQueueId':_0xfd515d[_0x5264('0x52')]['id']},'defaults':{'penalty':_0x5c8670[_0x5264('0x76')]},'transaction':_0x5b4618});});})[_0x5264('0x2a')](function(){return BPromise[_0x5264('0x79')](_[_0x5264('0x49')](_0xb0d311,{'online':!![]}),function(_0x4fd99d){return db['UserVoiceQueueRt'][_0x5264('0x7b')]({'membername':_0x4fd99d['name'],'UserId':_0x4fd99d['id'],'queue_name':_0x4d848b[_0x5264('0x34')],'VoiceQueueId':_0x4d848b['id'],'interface':_[_0x5264('0x7e')](_0x4fd99d[_0x5264('0x73')])?util[_0x5264('0x7f')](_0x5264('0x80'),_0x4fd99d['name']):_0x4fd99d[_0x5264('0x73')],'paused':_0x4fd99d[_0x5264('0x72')]||![],'penalty':_0x4fd99d[_0x5264('0x76')]},{'transaction':_0x5b4618});});})[_0x5264('0x2a')](function(){_0xb0d311[_0x5264('0x81')](function(_0x2c675e){socket['emit'](_0x5264('0x82'),{'UserId':_0x2c675e['id'],'VoiceQueueId':_0x4d848b['id']});});});});});}})[_0x5264('0x2a')](respondWithStatusCode(_0x1219f1,null))[_0x5264('0x51')](handleError(_0x1219f1,null));};exports[_0x5264('0x83')]=function(_0x28b1f4,_0x24850c,_0x2b5ea4){return db[_0x5264('0x6d')][_0x5264('0x4f')]({'where':{'id':_0x28b1f4['query'][_0x5264('0x84')]},'attributes':['id'],'include':[{'model':db[_0x5264('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x24850c,null))['then'](function(_0xbc57cd){var _0x23ecd8=_[_0x5264('0x3a')](_0xbc57cd,'id');var _0x5b3df8=[];var _0xc40683=[];var _0x4b4a0f=squel[_0x5264('0x85')]();_0x4b4a0f[_0x5264('0x86')]('tq.TeamId')['from'](_0x5264('0x87'),'tq')[_0x5264('0x88')](_0x5264('0x89'),'ut',_0x5264('0x8a'))['where']('VoiceQueueId\x20=\x20?',_0x28b1f4[_0x5264('0x52')]['id']);for(var _0x3314f5=0x0;_0x3314f5<_0xbc57cd[_0x5264('0x54')];_0x3314f5+=0x1){let _0x223af4=_0xbc57cd[_0x3314f5];for(var _0xeab6ed=0x0;_0xeab6ed<_0x223af4[_0x5264('0x75')][_0x5264('0x54')];_0xeab6ed+=0x1){let _0x209c84=_0x223af4[_0x5264('0x75')][_0xeab6ed];var _0x3a966c=_0x4b4a0f[_0x5264('0x8b')]();_0x3a966c['where']('ut.UserId\x20=\x20?',_0x209c84['id']);_0xc40683[_0x5264('0x8c')](db['sequelize']['query'](_0x3a966c[_0x5264('0x8d')](),{'type':db['sequelize'][_0x5264('0x8e')]['SELECT']})[_0x5264('0x2a')](function(_0x154efd){if(_0x154efd['length']===0x1){return _0x209c84['id'];}else{var _0x1c95c2=_[_0x5264('0x8f')](_[_0x5264('0x3a')](_0x154efd,_0x5264('0x90')),function(_0x1ab0b9){return _['includes'](_0x23ecd8,_0x1ab0b9);});if(_0x1c95c2){return _0x209c84['id'];}}}));}}return BPromise[_0x5264('0x91')](_0xc40683)[_0x5264('0x2a')](function(_0x116ae7){_0x5b3df8=_(_0x5b3df8)[_0x5264('0x92')](_0x116ae7)[_0x5264('0x93')]()[_0x5264('0x31')]();return db['VoiceQueue'][_0x5264('0x33')]({'where':{'id':_0x28b1f4[_0x5264('0x52')]['id']}})['then'](function(_0x504c4e){return db[_0x5264('0x77')][_0x5264('0x78')](function(_0x3c09ba){return _0x504c4e[_0x5264('0x83')](_0x28b1f4[_0x5264('0x3f')][_0x5264('0x84')],{'transaction':_0x3c09ba})[_0x5264('0x2a')](function(){if(!_[_0x5264('0x94')](_0x5b3df8)){return _0x504c4e['removeAgents'](_0x5b3df8,{'transaction':_0x3c09ba})[_0x5264('0x2a')](function(){return db[_0x5264('0x95')][_0x5264('0x2b')]({'where':{'VoiceQueueId':_0x28b1f4['params']['id'],'UserId':_0x5b3df8},'transaction':_0x3c09ba});});}})[_0x5264('0x2a')](function(){_0x5b3df8[_0x5264('0x81')](function(_0x4acbf7){socket[_0x5264('0x96')]('userVoiceQueue:remove',{'UserId':_0x4acbf7,'VoiceQueueId':_0x504c4e['id']});});});});});});})[_0x5264('0x2a')](respondWithStatusCode(_0x24850c,null))[_0x5264('0x51')](handleError(_0x24850c,null));};exports[_0x5264('0x97')]=function(_0x71340e,_0x7b4363,_0x32b460){var _0x25d35f,_0x1daea8;return db[_0x5264('0x3b')][_0x5264('0x33')]({'where':{'id':_0x71340e[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x7b4363,null))[_0x5264('0x2a')](function(_0x3a0930){if(_0x3a0930){_0x1daea8=_0x3a0930;return _0x3a0930[_0x5264('0x97')](_0x71340e[_0x5264('0x56')][_0x5264('0x84')],_['omit'](_0x71340e[_0x5264('0x56')],[_0x5264('0x84'),'id'])||{})[_0x5264('0x98')](function(_0x5f24ca){for(var _0x3a0908=0x0;_0x3a0908<_0x71340e[_0x5264('0x56')][_0x5264('0x84')][_0x5264('0x54')];_0x3a0908+=0x1){socket[_0x5264('0x96')]('userVoiceQueue:save',{'UserId':Number(_0x71340e['body'][_0x5264('0x84')][_0x3a0908]),'VoiceQueueId':Number(_0x71340e[_0x5264('0x52')]['id'])});}return _0x5f24ca;});}})['then'](function(_0x2cf7c4){_0x25d35f=_0x2cf7c4||[];if(_0x1daea8){return db[_0x5264('0x70')][_0x5264('0x4f')]({'where':{'id':_0x71340e['body'][_0x5264('0x84')]},'attributes':['id',_0x5264('0x34'),_0x5264('0x71'),_0x5264('0x72'),_0x5264('0x73')],'raw':!![]});}})['then'](function(_0x5ac699){if(!_['isEmpty'](_0x5ac699)){var _0x41b761=[];for(var _0x4fee37=0x0;_0x4fee37<_0x5ac699[_0x5264('0x54')];_0x4fee37++){if(_0x5ac699[_0x4fee37]['online']){_0x41b761['push'](db[_0x5264('0x95')][_0x5264('0x7b')]({'membername':_0x5ac699[_0x4fee37][_0x5264('0x34')],'UserId':_0x5ac699[_0x4fee37]['id'],'queue_name':_0x1daea8[_0x5264('0x34')],'VoiceQueueId':_0x1daea8['id'],'interface':_['isNil'](_0x5ac699[_0x4fee37][_0x5264('0x73')])?util[_0x5264('0x7f')](_0x5264('0x80'),_0x5ac699[_0x4fee37][_0x5264('0x34')]):_0x5ac699[_0x4fee37][_0x5264('0x73')],'paused':_0x5ac699[_0x4fee37][_0x5264('0x72')]||![],'penalty':_0x71340e['body'][_0x5264('0x76')]||0x0}));}}return BPromise['all'](_0x41b761);}})['then'](function(){return _0x25d35f;})[_0x5264('0x2a')](respondWithResult(_0x7b4363,null))[_0x5264('0x51')](handleError(_0x7b4363,null));};exports[_0x5264('0x99')]=function(_0x33018e,_0x2c0010,_0x2356dc){return db[_0x5264('0x3b')][_0x5264('0x33')]({'where':{'id':_0x33018e[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x2c0010,null))[_0x5264('0x2a')](function(_0x18a371){if(_0x18a371){return _0x18a371[_0x5264('0x99')](_0x33018e[_0x5264('0x3f')][_0x5264('0x84')])['then'](function(){if(_[_0x5264('0x9a')](_0x33018e[_0x5264('0x3f')][_0x5264('0x84')])){for(var _0xf5b98d=0x0;_0xf5b98d<_0x33018e[_0x5264('0x3f')][_0x5264('0x84')]['length'];_0xf5b98d+=0x1){socket[_0x5264('0x96')]('userVoiceQueue:remove',{'UserId':Number(_0x33018e[_0x5264('0x3f')][_0x5264('0x84')][_0xf5b98d]),'VoiceQueueId':Number(_0x33018e[_0x5264('0x52')]['id'])});}}else{socket['emit'](_0x5264('0x9b'),{'UserId':Number(_0x33018e['query'][_0x5264('0x84')]),'VoiceQueueId':Number(_0x33018e[_0x5264('0x52')]['id'])});}});}})['then'](function(_0x1eb486){return db[_0x5264('0x95')][_0x5264('0x2b')]({'where':{'VoiceQueueId':_0x33018e['params']['id'],'UserId':_0x33018e[_0x5264('0x3f')][_0x5264('0x84')]}})['then'](function(){return _0x1eb486;});})[_0x5264('0x2a')](respondWithStatusCode(_0x2c0010,null))[_0x5264('0x51')](handleError(_0x2c0010,null));};exports[_0x5264('0x9c')]=function(_0xb8d900,_0x133e4c,_0x1c8d40){var _0x5566b1={};var _0x431e76={};var _0x1773b6;var _0x1d8fef;return db[_0x5264('0x3b')][_0x5264('0x64')]({'where':{'id':_0xb8d900[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x133e4c,null))['then'](function(_0x133b3d){if(_0x133b3d){_0x1773b6=_0x133b3d;_0x431e76['model']=_[_0x5264('0x53')](db['User']['rawAttributes']);_0x431e76[_0x5264('0x3f')]=_[_0x5264('0x53')](_0xb8d900[_0x5264('0x3f')]);_0x431e76[_0x5264('0x47')]=_['intersection'](_0x431e76['model'],_0x431e76[_0x5264('0x3f')]);_0x5566b1['attributes']=_[_0x5264('0x41')](_0x431e76['model'],qs[_0x5264('0x42')](_0xb8d900['query'][_0x5264('0x42')]));_0x5566b1[_0x5264('0x40')]=_0x5566b1['attributes'][_0x5264('0x54')]?_0x5566b1[_0x5264('0x40')]:_0x431e76[_0x5264('0x3e')];_0x5566b1[_0x5264('0x44')]=qs['sort'](_0xb8d900[_0x5264('0x3f')]['sort']);_0x5566b1[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0xb8d900[_0x5264('0x3f')],_0x431e76[_0x5264('0x47')]));if(_0xb8d900[_0x5264('0x3f')][_0x5264('0x49')]){_0x5566b1[_0x5264('0x46')]=_[_0x5264('0x4b')](_0x5566b1[_0x5264('0x46')],{'$or':_[_0x5264('0x3a')](_0x5566b1['attributes'],function(_0x10e317){var _0x1fc314={};_0x1fc314[_0x10e317]={'$like':'%'+_0xb8d900[_0x5264('0x3f')]['filter']+'%'};return _0x1fc314;})});}_0x5566b1=_[_0x5264('0x4b')]({},_0x5566b1,_0xb8d900['options']);return _0x1773b6['getAgents'](_0x5566b1);}})[_0x5264('0x2a')](function(_0x3755b9){if(_0x3755b9){_0x1d8fef=_0x3755b9[_0x5264('0x54')];if(!_0xb8d900[_0x5264('0x3f')][_0x5264('0x43')]('nolimit')){_0x5566b1[_0x5264('0x20')]=qs['limit'](_0xb8d900[_0x5264('0x3f')][_0x5264('0x20')]);_0x5566b1[_0x5264('0x22')]=qs[_0x5264('0x22')](_0xb8d900['query'][_0x5264('0x22')]);}return _0x1773b6[_0x5264('0x9c')](_0x5566b1);}})[_0x5264('0x2a')](function(_0x314f45){if(_0x314f45){return _0x314f45?{'count':_0x1d8fef,'rows':_0x314f45}:null;}})[_0x5264('0x2a')](respondWithResult(_0x133e4c,null))[_0x5264('0x51')](handleError(_0x133e4c,null));};exports[_0x5264('0x9d')]=function(_0x5ac229,_0x1e3f6d,_0x35ba46){var _0x13d88b={};var _0x25c80e={};var _0x388700;var _0x3be2b0;return db['VoiceQueue'][_0x5264('0x64')]({'where':{'id':_0x5ac229[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x1e3f6d,null))[_0x5264('0x2a')](function(_0x5c75ee){if(_0x5c75ee){_0x388700=_0x5c75ee;_0x25c80e[_0x5264('0x3e')]=_[_0x5264('0x53')](db['UserVoiceQueueRt'][_0x5264('0x5e')]);_0x25c80e[_0x5264('0x3f')]=_[_0x5264('0x53')](_0x5ac229[_0x5264('0x3f')]);_0x25c80e[_0x5264('0x47')]=_[_0x5264('0x41')](_0x25c80e['model'],_0x25c80e['query']);_0x13d88b['attributes']=_[_0x5264('0x41')](_0x25c80e[_0x5264('0x3e')],qs[_0x5264('0x42')](_0x5ac229[_0x5264('0x3f')]['fields']));_0x13d88b[_0x5264('0x40')]=_0x13d88b['attributes'][_0x5264('0x54')]?_0x13d88b[_0x5264('0x40')]:_0x25c80e['model'];_0x13d88b[_0x5264('0x44')]=qs['sort'](_0x5ac229[_0x5264('0x3f')]['sort']);_0x13d88b['where']=qs['filters'](_[_0x5264('0x48')](_0x5ac229[_0x5264('0x3f')],_0x25c80e[_0x5264('0x47')]));if(_0x5ac229['query'][_0x5264('0x49')]){_0x13d88b[_0x5264('0x46')]=_[_0x5264('0x4b')](_0x13d88b[_0x5264('0x46')],{'$or':_[_0x5264('0x3a')](_0x13d88b[_0x5264('0x40')],function(_0x13e212){var _0x3483a6={};_0x3483a6[_0x13e212]={'$like':'%'+_0x5ac229['query'][_0x5264('0x49')]+'%'};return _0x3483a6;})});}_0x13d88b=_[_0x5264('0x4b')]({},_0x13d88b,_0x5ac229[_0x5264('0x4c')]);return _0x388700[_0x5264('0x9d')](_0x13d88b);}})['then'](function(_0xcb2fa8){if(_0xcb2fa8){_0x3be2b0=_0xcb2fa8['length'];if(!_0x5ac229[_0x5264('0x3f')][_0x5264('0x43')](_0x5264('0x6a'))){_0x13d88b[_0x5264('0x20')]=qs[_0x5264('0x20')](_0x5ac229[_0x5264('0x3f')][_0x5264('0x20')]);_0x13d88b[_0x5264('0x22')]=qs[_0x5264('0x22')](_0x5ac229[_0x5264('0x3f')]['offset']);}return _0x388700[_0x5264('0x9d')](_0x13d88b);}})[_0x5264('0x2a')](function(_0x34d50a){return _0x34d50a?{'count':_0x3be2b0,'rows':_0x34d50a}:null;})[_0x5264('0x2a')](respondWithResult(_0x1e3f6d,null))[_0x5264('0x51')](handleError(_0x1e3f6d,null));};exports[_0x5264('0x9e')]=function(_0x3d8aa6,_0x4680d5,_0x2e72ca){var _0x21b64a={};var _0x304707={};var _0x3c83de;var _0x178d84;return db[_0x5264('0x3b')][_0x5264('0x64')]({'where':{'id':_0x3d8aa6[_0x5264('0x52')]['id']}})['then'](handleEntityNotFound(_0x4680d5,null))[_0x5264('0x2a')](function(_0x2eaaf1){if(_0x2eaaf1){_0x3c83de=_0x2eaaf1;_0x304707[_0x5264('0x3e')]=_[_0x5264('0x53')](db[_0x5264('0x9f')]['rawAttributes']);_0x304707[_0x5264('0x3f')]=_['keys'](_0x3d8aa6['query']);_0x304707['filters']=_[_0x5264('0x41')](_0x304707['model'],_0x304707['query']);_0x21b64a[_0x5264('0x40')]=_[_0x5264('0x41')](_0x304707[_0x5264('0x3e')],qs[_0x5264('0x42')](_0x3d8aa6['query'][_0x5264('0x42')]));_0x21b64a['attributes']=_0x21b64a[_0x5264('0x40')][_0x5264('0x54')]?_0x21b64a['attributes']:_0x304707[_0x5264('0x3e')];_0x21b64a[_0x5264('0x44')]=qs['sort'](_0x3d8aa6[_0x5264('0x3f')][_0x5264('0x45')]);_0x21b64a[_0x5264('0x46')]=qs['filters'](_['pick'](_0x3d8aa6[_0x5264('0x3f')],_0x304707['filters']));if(_0x3d8aa6['query'][_0x5264('0x49')]){_0x21b64a[_0x5264('0x46')]=_['merge'](_0x21b64a['where'],{'$or':_['map'](_0x21b64a['attributes'],function(_0x4d7b00){var _0x3da347={};_0x3da347[_0x4d7b00]={'$like':'%'+_0x3d8aa6[_0x5264('0x3f')][_0x5264('0x49')]+'%'};return _0x3da347;})});}_0x21b64a=_[_0x5264('0x4b')]({},_0x21b64a,_0x3d8aa6[_0x5264('0x4c')]);return _0x3c83de['getLists'](_0x21b64a);}})['then'](function(_0x3a6dca){if(_0x3a6dca){_0x178d84=_0x3a6dca[_0x5264('0x54')];if(!_0x3d8aa6[_0x5264('0x3f')][_0x5264('0x43')](_0x5264('0x6a'))){_0x21b64a[_0x5264('0x20')]=qs['limit'](_0x3d8aa6['query'][_0x5264('0x20')]);_0x21b64a['offset']=qs[_0x5264('0x22')](_0x3d8aa6[_0x5264('0x3f')][_0x5264('0x22')]);}return _0x3c83de[_0x5264('0x9e')](_0x21b64a);}})[_0x5264('0x2a')](function(_0x4697fd){if(_0x4697fd){return _0x4697fd?{'count':_0x178d84,'rows':_0x4697fd}:null;}})[_0x5264('0x2a')](respondWithResult(_0x4680d5,null))[_0x5264('0x51')](handleError(_0x4680d5,null));};exports[_0x5264('0xa0')]=function(_0x335623,_0x4d0658,_0x537119){var _0x2dde5b,_0x56a8e9;return db['VoiceQueue'][_0x5264('0x33')]({'where':{'id':_0x335623[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x4d0658,null))[_0x5264('0x2a')](function(_0x2e0112){if(_0x2e0112){_0x56a8e9=_0x2e0112;return _0x2e0112['addLists'](_0x335623[_0x5264('0x56')][_0x5264('0x84')],_[_0x5264('0x60')](_0x335623[_0x5264('0x56')],[_0x5264('0x84'),'id'])||{});}return null;})[_0x5264('0x98')](function(_0x277b5b){var _0x278cad;_0x2dde5b=_0x277b5b||[];var _0x1904fc=[];if(_0x277b5b){for(var _0x451bc1=0x0;_0x451bc1<_0x277b5b[_0x5264('0x54')];_0x451bc1+=0x1){var _0x45121e=_0x277b5b[_0x451bc1][_0x5264('0x2c')]({'plain':!![]});_0x56a8e9[_0x5264('0xa1')]=_0x335623['body']['dialCheckDuplicateType']?_0x335623[_0x5264('0x56')][_0x5264('0xa1')]:_0x56a8e9[_0x5264('0xa1')];switch(_0x56a8e9[_0x5264('0xa1')]){case _0x5264('0xa2'):_0x278cad=squel['insert']()['into'](_0x5264('0xa3'))[_0x5264('0xa4')]([_0x5264('0xa5'),_0x5264('0xa6'),'ContactId',_0x5264('0xa7'),_0x5264('0x66'),_0x5264('0x61'),_0x5264('0x5f')],squel[_0x5264('0x85')]()[_0x5264('0x86')]('phone',_0x5264('0xa5'))['field'](_0x5264('0xa8'),'scheduledAt')['field']('id',_0x5264('0xa9'))[_0x5264('0x86')](_0x45121e[_0x5264('0xaa')][_0x5264('0x8d')](),_0x5264('0xa7'))[_0x5264('0x86')](_0x335623['params']['id'][_0x5264('0x8d')](),_0x5264('0x66'))['field']('NOW()',_0x5264('0x61'))[_0x5264('0x86')](_0x5264('0xa8'),_0x5264('0x5f'))[_0x5264('0xab')](_0x5264('0xac'))['where'](_0x5264('0xad'))[_0x5264('0x46')]('ListId\x20=\x20?',_0x45121e['CmListId']['toString']())[_0x5264('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x5264('0x46')](_0x5264('0xae'),squel[_0x5264('0x85')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x5264('0xab')](_0x5264('0xaf'))['where'](_0x5264('0xb0'),_0x335623[_0x5264('0x52')]['id'][_0x5264('0x8d')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x5264('0x85')]()[_0x5264('0x86')](_0x5264('0xb1'))['from']('cm_hopper')[_0x5264('0x46')]('VoiceQueueId\x20=\x20?',_0x335623['params']['id'][_0x5264('0x8d')]())))[_0x5264('0x8d')]();break;case _0x5264('0xb2'):_0x278cad=squel[_0x5264('0xb3')]()[_0x5264('0xb4')]('cm_hopper')['fromQuery']([_0x5264('0xa5'),'scheduledAt',_0x5264('0xa9'),_0x5264('0xa7'),_0x5264('0x66'),_0x5264('0x61'),'updatedAt'],squel[_0x5264('0x85')]()[_0x5264('0x86')]('phone',_0x5264('0xa5'))[_0x5264('0x86')](_0x5264('0xa8'),_0x5264('0xa6'))[_0x5264('0x86')]('id','ContactId')[_0x5264('0x86')](_0x45121e[_0x5264('0xaa')][_0x5264('0x8d')](),'ListId')[_0x5264('0x86')](_0x335623['params']['id'][_0x5264('0x8d')](),_0x5264('0x66'))[_0x5264('0x86')](_0x5264('0xa8'),_0x5264('0x61'))[_0x5264('0x86')](_0x5264('0xa8'),_0x5264('0x5f'))['from']('cm_contacts')[_0x5264('0x46')]('deletedAt\x20IS\x20NULL')[_0x5264('0x46')](_0x5264('0xb5'),_0x45121e[_0x5264('0xaa')][_0x5264('0x8d')]())[_0x5264('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0x5264('0x46')](_0x5264('0xae'),squel[_0x5264('0x85')]()['field']('COALESCE(phone,\x27\x27)')[_0x5264('0xab')](_0x5264('0xa3'))[_0x5264('0x46')](_0x5264('0xb0'),_0x335623['params']['id'][_0x5264('0x8d')]())))[_0x5264('0x8d')]();break;default:_0x278cad=squel[_0x5264('0xb3')]()['into'](_0x5264('0xa3'))['fromQuery']([_0x5264('0xa5'),_0x5264('0xa6'),'ContactId',_0x5264('0xa7'),_0x5264('0x66'),_0x5264('0x61'),'updatedAt'],squel[_0x5264('0x85')]()['field']('phone',_0x5264('0xa5'))[_0x5264('0x86')](_0x5264('0xa8'),_0x5264('0xa6'))[_0x5264('0x86')]('id',_0x5264('0xa9'))[_0x5264('0x86')](_0x45121e[_0x5264('0xaa')][_0x5264('0x8d')](),_0x5264('0xa7'))[_0x5264('0x86')](_0x335623['params']['id']['toString'](),_0x5264('0x66'))[_0x5264('0x86')]('NOW()',_0x5264('0x61'))[_0x5264('0x86')]('NOW()',_0x5264('0x5f'))[_0x5264('0xab')](_0x5264('0xac'))[_0x5264('0x46')](_0x5264('0xad'))[_0x5264('0x46')](_0x5264('0xb5'),_0x45121e[_0x5264('0xaa')]['toString']())[_0x5264('0x46')](_0x5264('0xb6')))[_0x5264('0x8d')]();}_0x1904fc[_0x5264('0x8c')](db['sequelize']['query'](_0x278cad));}return BPromise[_0x5264('0x91')](_0x1904fc);}})[_0x5264('0x2a')](function(){return _0x2dde5b;})['then'](respondWithResult(_0x4d0658,null))[_0x5264('0x51')](handleError(_0x4d0658,null));};exports[_0x5264('0xb7')]=function(_0x492692,_0x14303b,_0x54f610){return db['VoiceQueue'][_0x5264('0x33')]({'where':{'id':_0x492692['params']['id']}})['then'](handleEntityNotFound(_0x14303b,null))[_0x5264('0x2a')](function(_0x1c5692){if(_0x1c5692){return _0x1c5692[_0x5264('0xb7')](_0x492692[_0x5264('0x3f')][_0x5264('0x84')]);}})[_0x5264('0x2a')](function(_0x2ef7b2){if(_0x2ef7b2){return db[_0x5264('0x65')][_0x5264('0x2b')]({'where':{'ListId':_0x492692[_0x5264('0x3f')][_0x5264('0x84')],'VoiceQueueId':_0x492692[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](function(){return _0x2ef7b2;});}})['then'](respondWithStatusCode(_0x14303b,null))[_0x5264('0x51')](handleError(_0x14303b,null));};exports[_0x5264('0xb8')]=function(_0xd1403f,_0x2e0117,_0x136a8d){var _0x117cb6={};var _0x6809d={};var _0x3124a8;var _0x5b4cbf;return db['VoiceQueue'][_0x5264('0x64')]({'where':{'id':_0xd1403f[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x2e0117,null))[_0x5264('0x2a')](function(_0x173d66){if(_0x173d66){_0x3124a8=_0x173d66;_0x6809d[_0x5264('0x3e')]=_['keys'](db[_0x5264('0x9f')][_0x5264('0x5e')]);_0x6809d[_0x5264('0x3f')]=_['keys'](_0xd1403f[_0x5264('0x3f')]);_0x6809d[_0x5264('0x47')]=_[_0x5264('0x41')](_0x6809d[_0x5264('0x3e')],_0x6809d[_0x5264('0x3f')]);_0x117cb6[_0x5264('0x40')]=_[_0x5264('0x41')](_0x6809d['model'],qs['fields'](_0xd1403f[_0x5264('0x3f')][_0x5264('0x42')]));_0x117cb6[_0x5264('0x40')]=_0x117cb6[_0x5264('0x40')][_0x5264('0x54')]?_0x117cb6[_0x5264('0x40')]:_0x6809d[_0x5264('0x3e')];_0x117cb6[_0x5264('0x44')]=qs[_0x5264('0x45')](_0xd1403f[_0x5264('0x3f')][_0x5264('0x45')]);_0x117cb6[_0x5264('0x46')]=qs[_0x5264('0x47')](_[_0x5264('0x48')](_0xd1403f[_0x5264('0x3f')],_0x6809d[_0x5264('0x47')]));if(_0xd1403f['query'][_0x5264('0x49')]){_0x117cb6[_0x5264('0x46')]=_[_0x5264('0x4b')](_0x117cb6[_0x5264('0x46')],{'$or':_['map'](_0x117cb6[_0x5264('0x40')],function(_0x803d90){var _0x4f1573={};_0x4f1573[_0x803d90]={'$like':'%'+_0xd1403f[_0x5264('0x3f')][_0x5264('0x49')]+'%'};return _0x4f1573;})});}_0x117cb6=_['merge']({},_0x117cb6,_0xd1403f[_0x5264('0x4c')]);return _0x3124a8[_0x5264('0xb8')](_0x117cb6);}})[_0x5264('0x2a')](function(_0x3bc52e){if(_0x3bc52e){_0x5b4cbf=_0x3bc52e[_0x5264('0x54')];if(!_0xd1403f[_0x5264('0x3f')]['hasOwnProperty']('nolimit')){_0x117cb6[_0x5264('0x20')]=qs[_0x5264('0x20')](_0xd1403f[_0x5264('0x3f')]['limit']);_0x117cb6[_0x5264('0x22')]=qs[_0x5264('0x22')](_0xd1403f['query']['offset']);}return _0x3124a8['getBlackLists'](_0x117cb6);}})[_0x5264('0x2a')](function(_0x563319){if(_0x563319){return _0x563319?{'count':_0x5b4cbf,'rows':_0x563319}:null;}})[_0x5264('0x2a')](respondWithResult(_0x2e0117,null))['catch'](handleError(_0x2e0117,null));};exports[_0x5264('0xb9')]=function(_0x1a0372,_0xd61f86,_0x5a8af2){var _0xa2328f,_0x3968ad;return db['VoiceQueue'][_0x5264('0x33')]({'where':{'id':_0x1a0372[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0xd61f86,null))[_0x5264('0x2a')](function(_0x16d312){if(_0x16d312){_0x3968ad=_0x16d312;return _0x16d312['addBlackLists'](_0x1a0372[_0x5264('0x56')][_0x5264('0x84')],_[_0x5264('0x60')](_0x1a0372[_0x5264('0x56')],['ids','id'])||{});}return null;})[_0x5264('0x98')](function(_0x2bcc64){var _0x10d5f0;_0xa2328f=_0x2bcc64||[];var _0x3ab293=[];if(_0x2bcc64){for(var _0xa9dfae=0x0;_0xa9dfae<_0x2bcc64['length'];_0xa9dfae+=0x1){var _0x446fb2=_0x2bcc64[_0xa9dfae]['get']({'plain':!![]});_0x10d5f0=squel[_0x5264('0xb3')]()[_0x5264('0xb4')](_0x5264('0xba'))[_0x5264('0xa4')]([_0x5264('0xa5'),_0x5264('0xa9'),_0x5264('0xa7'),_0x5264('0x66'),_0x5264('0x61'),_0x5264('0x5f')],squel[_0x5264('0x85')]()[_0x5264('0x86')](_0x5264('0xa5'),'phone')[_0x5264('0x86')]('id',_0x5264('0xa9'))[_0x5264('0x86')](_0x446fb2['CmListId'][_0x5264('0x8d')](),'ListId')[_0x5264('0x86')](_0x1a0372[_0x5264('0x52')]['id'][_0x5264('0x8d')](),_0x5264('0x66'))[_0x5264('0x86')](_0x5264('0xa8'),_0x5264('0x61'))[_0x5264('0x86')]('NOW()','updatedAt')['from'](_0x5264('0xac'))[_0x5264('0x46')](_0x5264('0xad'))[_0x5264('0x46')]('ListId\x20=\x20?',_0x446fb2[_0x5264('0xaa')]['toString']())['where'](_0x5264('0xb6')))[_0x5264('0x8d')]();_0x3ab293['push'](db[_0x5264('0x77')][_0x5264('0x3f')](_0x10d5f0));}return BPromise[_0x5264('0x91')](_0x3ab293);}})[_0x5264('0x2a')](function(){return _0xa2328f;})[_0x5264('0x2a')](respondWithResult(_0xd61f86,null))[_0x5264('0x51')](handleError(_0xd61f86,null));};exports['removeBlackLists']=function(_0x4773c4,_0x4da365,_0x1691e1){return db[_0x5264('0x3b')][_0x5264('0x33')]({'where':{'id':_0x4773c4['params']['id']}})[_0x5264('0x2a')](handleEntityNotFound(_0x4da365,null))['then'](function(_0x20f91b){if(_0x20f91b){return _0x20f91b[_0x5264('0xbb')](_0x4773c4['query'][_0x5264('0x84')]);}})['then'](function(_0x1d1f8e){if(_0x1d1f8e){return db[_0x5264('0x6b')][_0x5264('0x2b')]({'where':{'ListId':_0x4773c4['query'][_0x5264('0x84')],'VoiceQueueId':_0x4773c4[_0x5264('0x52')]['id']}})[_0x5264('0x2a')](function(){return _0x1d1f8e;});}})[_0x5264('0x2a')](respondWithStatusCode(_0x4da365,null))['catch'](handleError(_0x4da365,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 1e2d5d4..ed23268 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 _0x1b20=['emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0xae0f71,_0x5e7384){var _0x313a44=function(_0x741263){while(--_0x741263){_0xae0f71['push'](_0xae0f71['shift']());}};_0x313a44(++_0x5e7384);}(_0x1b20,0x1a8));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require(_0x01b2('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x01b2('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x01b2('0x2')](0x0);var events={'afterCreate':_0x01b2('0x3'),'afterUpdate':_0x01b2('0x4'),'afterDestroy':_0x01b2('0x5')};function emitEvent(_0x57763b){return function(_0x142fc5,_0x729658,_0x876034){VoiceQueueEvents[_0x01b2('0x6')](_0x57763b+':'+_0x142fc5['id'],_0x142fc5);VoiceQueueEvents[_0x01b2('0x6')](_0x57763b,_0x142fc5);_0x876034(null);};}for(var e in events){if(events[_0x01b2('0x7')](e)){var event=events[e];VoiceQueue[_0x01b2('0x8')](e,emitEvent(event));}}module[_0x01b2('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xa5eb=['hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit'];(function(_0x132df2,_0x53abbd){var _0x3c1183=function(_0x4140ee){while(--_0x4140ee){_0x132df2['push'](_0x132df2['shift']());}};_0x3c1183(++_0x53abbd);}(_0xa5eb,0x92));var _0xba5e=function(_0x18300c,_0x1e2a22){_0x18300c=_0x18300c-0x0;var _0x481344=_0xa5eb[_0x18300c];return _0x481344;};'use strict';var EventEmitter=require(_0xba5e('0x0'));var VoiceQueue=require(_0xba5e('0x1'))['db'][_0xba5e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xba5e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba5e('0x4'),'afterDestroy':_0xba5e('0x5')};function emitEvent(_0x59fa7d){return function(_0x1465d0,_0x182945,_0x480254){VoiceQueueEvents['emit'](_0x59fa7d+':'+_0x1465d0['id'],_0x1465d0);VoiceQueueEvents[_0xba5e('0x6')](_0x59fa7d,_0x1465d0);_0x480254(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xba5e('0x7')](e,emitEvent(event));}}module[_0xba5e('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2991e17..0b437fb 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x1aa51f,_0x45f7d8){var _0x15005=function(_0x45985f){while(--_0x45985f){_0x1aa51f['push'](_0x1aa51f['shift']());}};_0x15005(++_0x45f7d8);}(_0x34e8,0x12c));var _0x834e=function(_0x191c8d,_0x4faaac){_0x191c8d=_0x191c8d-0x0;var _0x18d890=_0x34e8[_0x191c8d];return _0x18d890;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x16ed87,_0x1be1a2){var _0xc1a1d8=function(_0x3c0fcf){while(--_0x3c0fcf){_0x16ed87['push'](_0x16ed87['shift']());}};_0xc1a1d8(++_0x1be1a2);}(_0x3e74,0x175));var _0x43e7=function(_0x5b652d,_0x430f78){_0x5b652d=_0x5b652d-0x0;var _0x41a11a=_0x3e74[_0x5b652d];return _0x41a11a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 2e99990..e8f9b5f 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 _0x7f19=['find','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueue','ShowVoiceQueue'];(function(_0x21ecf3,_0x3b4b99){var _0x3cf63a=function(_0x536c67){while(--_0x536c67){_0x21ecf3['push'](_0x21ecf3['shift']());}};_0x3cf63a(++_0x3b4b99);}(_0x7f19,0x70));var _0x97f1=function(_0x5b8ca0,_0x4ae5fa){_0x5b8ca0=_0x5b8ca0-0x0;var _0x1c0a79=_0x7f19[_0x5b8ca0];return _0x1c0a79;};'use strict';var _=require(_0x97f1('0x0'));var util=require(_0x97f1('0x1'));var moment=require('moment');var BPromise=require(_0x97f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x97f1('0x3'))['db'];var utils=require(_0x97f1('0x4'));var logger=require(_0x97f1('0x5'))('rpc');var config=require(_0x97f1('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x97f1('0x7')]=_[_0x97f1('0x8')](config[_0x97f1('0x7')],{'host':_0x97f1('0x9'),'port':0x18eb});var socket=require(_0x97f1('0xa'))(new Redis(config['redis']));require(_0x97f1('0xb'))[_0x97f1('0xc')](socket);function respondWithRpcPromise(_0x3f660a,_0xe1d370,_0x478de1){return new BPromise(function(_0x541551,_0x4715df){return client['request'](_0x3f660a,_0x478de1)[_0x97f1('0xd')](function(_0x55cfe6){logger[_0x97f1('0xe')](_0x97f1('0xf'),_0xe1d370,_0x97f1('0x10'));logger[_0x97f1('0x11')](_0x97f1('0x12'),_0xe1d370,_0x97f1('0x10'),JSON[_0x97f1('0x13')](_0x55cfe6));if(_0x55cfe6[_0x97f1('0x14')]){if(_0x55cfe6[_0x97f1('0x14')][_0x97f1('0x15')]===0x1f4){logger[_0x97f1('0x14')](_0x97f1('0xf'),_0xe1d370,_0x55cfe6['error'][_0x97f1('0x16')]);return _0x4715df(_0x55cfe6[_0x97f1('0x14')][_0x97f1('0x16')]);}logger[_0x97f1('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xe1d370,_0x55cfe6[_0x97f1('0x14')]['message']);return _0x541551(_0x55cfe6[_0x97f1('0x14')]['message']);}else{logger[_0x97f1('0xe')](_0x97f1('0xf'),_0xe1d370,_0x97f1('0x10'));_0x541551(_0x55cfe6['result'][_0x97f1('0x16')]);}})[_0x97f1('0x17')](function(_0x3154b9){logger[_0x97f1('0x14')](_0x97f1('0xf'),_0xe1d370,_0x3154b9);_0x4715df(_0x3154b9);});});}exports['GetVoiceQueue']=function(_0xa0a245){var _0x1b0762=this;return new Promise(function(_0x69d5f,_0x53d1cf){return db[_0x97f1('0x18')][_0x97f1('0x19')]({'raw':_0xa0a245[_0x97f1('0x1a')]?_0xa0a245['options'][_0x97f1('0x1b')]===undefined?!![]:![]:!![],'where':_0xa0a245[_0x97f1('0x1a')]?_0xa0a245['options'][_0x97f1('0x1c')]||null:null,'attributes':_0xa0a245['options']?_0xa0a245[_0x97f1('0x1a')][_0x97f1('0x1d')]||null:null,'limit':_0xa0a245['options']?_0xa0a245[_0x97f1('0x1a')][_0x97f1('0x1e')]||null:null,'include':_0xa0a245['options']?_0xa0a245[_0x97f1('0x1a')][_0x97f1('0x1f')]?_[_0x97f1('0x20')](_0xa0a245[_0x97f1('0x1a')][_0x97f1('0x1f')],function(_0x319837){return{'model':db[_0x319837[_0x97f1('0x21')]],'as':_0x319837['as'],'attributes':_0x319837['attributes'],'include':_0x319837[_0x97f1('0x1f')]?_[_0x97f1('0x20')](_0x319837[_0x97f1('0x1f')],function(_0x366f43){return{'model':db[_0x366f43[_0x97f1('0x21')]],'as':_0x366f43['as'],'attributes':_0x366f43[_0x97f1('0x1d')],'include':_0x366f43[_0x97f1('0x1f')]?_['map'](_0x366f43['include'],function(_0x40f22e){return{'model':db[_0x40f22e[_0x97f1('0x21')]],'as':_0x40f22e['as'],'attributes':_0x40f22e[_0x97f1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x97f1('0xd')](function(_0x18e394){logger['info']('GetVoiceQueue',_0xa0a245);logger[_0x97f1('0x11')](_0x97f1('0x22'),_0xa0a245,JSON[_0x97f1('0x13')](_0x18e394));_0x69d5f(_0x18e394);})[_0x97f1('0x17')](function(_0x5db14f){logger[_0x97f1('0x14')](_0x97f1('0x22'),_0x5db14f['message'],_0xa0a245);_0x53d1cf(_0x1b0762[_0x97f1('0x14')](0x1f4,_0x5db14f[_0x97f1('0x16')]));});});};exports[_0x97f1('0x23')]=function(_0x4326e8){var _0x248409=this;return new Promise(function(_0x33e79d,_0x2570bc){return db[_0x97f1('0x18')][_0x97f1('0x24')]({'raw':_0x4326e8[_0x97f1('0x1a')]?_0x4326e8['options'][_0x97f1('0x1b')]===undefined?!![]:![]:!![],'where':_0x4326e8[_0x97f1('0x1a')]?_0x4326e8[_0x97f1('0x1a')][_0x97f1('0x1c')]||null:null,'attributes':_0x4326e8[_0x97f1('0x1a')]?_0x4326e8[_0x97f1('0x1a')]['attributes']||null:null,'include':_0x4326e8[_0x97f1('0x1a')]?_0x4326e8[_0x97f1('0x1a')][_0x97f1('0x1f')]?_['map'](_0x4326e8['options']['include'],function(_0x138437){return{'model':db[_0x138437[_0x97f1('0x21')]],'as':_0x138437['as'],'attributes':_0x138437[_0x97f1('0x1d')],'include':_0x138437[_0x97f1('0x1f')]?_['map'](_0x138437[_0x97f1('0x1f')],function(_0x22d324){return{'model':db[_0x22d324[_0x97f1('0x21')]],'as':_0x22d324['as'],'attributes':_0x22d324['attributes'],'include':_0x22d324[_0x97f1('0x1f')]?_['map'](_0x22d324[_0x97f1('0x1f')],function(_0x5ce79c){return{'model':db[_0x5ce79c[_0x97f1('0x21')]],'as':_0x5ce79c['as'],'attributes':_0x5ce79c[_0x97f1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x97f1('0xd')](function(_0x492def){logger['info'](_0x97f1('0x23'),_0x4326e8);logger[_0x97f1('0x11')](_0x97f1('0x23'),_0x4326e8,JSON[_0x97f1('0x13')](_0x492def));_0x33e79d(_0x492def);})[_0x97f1('0x17')](function(_0x2c898c){logger[_0x97f1('0x14')](_0x97f1('0x23'),_0x2c898c[_0x97f1('0x16')],_0x4326e8);_0x2570bc(_0x248409['error'](0x1f4,_0x2c898c[_0x97f1('0x16')]));});});}; \ No newline at end of file +var _0x873c=['options','where','attributes','include','map','model','catch','VoiceQueue','find','raw','ShowVoiceQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','debug','request\x20sent','stringify','code','error','message','VoiceQueue,\x20%s,\x20%s','result','GetVoiceQueue','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x873c,0x80));var _0xc873=function(_0x42cc18,_0x17bf33){_0x42cc18=_0x42cc18-0x0;var _0x4c0a82=_0x873c[_0x42cc18];return _0x4c0a82;};'use strict';var _=require(_0xc873('0x0'));var util=require(_0xc873('0x1'));var moment=require(_0xc873('0x2'));var BPromise=require('bluebird');var rs=require(_0xc873('0x3'));var fs=require('fs');var Redis=require(_0xc873('0x4'));var db=require(_0xc873('0x5'))['db'];var utils=require(_0xc873('0x6'));var logger=require(_0xc873('0x7'))(_0xc873('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc873('0x9')][_0xc873('0xa')]({'port':0x232a});config[_0xc873('0xb')]=_[_0xc873('0xc')](config[_0xc873('0xb')],{'host':_0xc873('0xd'),'port':0x18eb});var socket=require(_0xc873('0xe'))(new Redis(config[_0xc873('0xb')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4737bf,_0x8325e4,_0x268d4f){return new BPromise(function(_0x5c1ba6,_0x21db57){return client[_0xc873('0xf')](_0x4737bf,_0x268d4f)[_0xc873('0x10')](function(_0x30d2ad){logger[_0xc873('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x8325e4,'request\x20sent');logger[_0xc873('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x8325e4,_0xc873('0x13'),JSON[_0xc873('0x14')](_0x30d2ad));if(_0x30d2ad['error']){if(_0x30d2ad['error'][_0xc873('0x15')]===0x1f4){logger[_0xc873('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x8325e4,_0x30d2ad[_0xc873('0x16')][_0xc873('0x17')]);return _0x21db57(_0x30d2ad[_0xc873('0x16')][_0xc873('0x17')]);}logger[_0xc873('0x16')](_0xc873('0x18'),_0x8325e4,_0x30d2ad[_0xc873('0x16')][_0xc873('0x17')]);return _0x5c1ba6(_0x30d2ad[_0xc873('0x16')][_0xc873('0x17')]);}else{logger[_0xc873('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x8325e4,_0xc873('0x13'));_0x5c1ba6(_0x30d2ad[_0xc873('0x19')][_0xc873('0x17')]);}})['catch'](function(_0x4bf168){logger[_0xc873('0x16')](_0xc873('0x18'),_0x8325e4,_0x4bf168);_0x21db57(_0x4bf168);});});}exports[_0xc873('0x1a')]=function(_0x5d9095){var _0x3d77c3=this;return new Promise(function(_0x3fd2a3,_0x105ea1){return db['VoiceQueue'][_0xc873('0x1b')]({'raw':_0x5d9095[_0xc873('0x1c')]?_0x5d9095[_0xc873('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5d9095[_0xc873('0x1c')]?_0x5d9095[_0xc873('0x1c')][_0xc873('0x1d')]||null:null,'attributes':_0x5d9095['options']?_0x5d9095[_0xc873('0x1c')][_0xc873('0x1e')]||null:null,'limit':_0x5d9095['options']?_0x5d9095[_0xc873('0x1c')]['limit']||null:null,'include':_0x5d9095[_0xc873('0x1c')]?_0x5d9095[_0xc873('0x1c')][_0xc873('0x1f')]?_[_0xc873('0x20')](_0x5d9095['options'][_0xc873('0x1f')],function(_0x3646c8){return{'model':db[_0x3646c8[_0xc873('0x21')]],'as':_0x3646c8['as'],'attributes':_0x3646c8[_0xc873('0x1e')],'include':_0x3646c8['include']?_['map'](_0x3646c8[_0xc873('0x1f')],function(_0x4bb8ce){return{'model':db[_0x4bb8ce[_0xc873('0x21')]],'as':_0x4bb8ce['as'],'attributes':_0x4bb8ce[_0xc873('0x1e')],'include':_0x4bb8ce[_0xc873('0x1f')]?_[_0xc873('0x20')](_0x4bb8ce[_0xc873('0x1f')],function(_0x3ce8b7){return{'model':db[_0x3ce8b7[_0xc873('0x21')]],'as':_0x3ce8b7['as'],'attributes':_0x3ce8b7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc873('0x10')](function(_0x209bbc){logger[_0xc873('0x11')](_0xc873('0x1a'),_0x5d9095);logger[_0xc873('0x12')](_0xc873('0x1a'),_0x5d9095,JSON[_0xc873('0x14')](_0x209bbc));_0x3fd2a3(_0x209bbc);})[_0xc873('0x22')](function(_0xa74f6a){logger[_0xc873('0x16')](_0xc873('0x1a'),_0xa74f6a[_0xc873('0x17')],_0x5d9095);_0x105ea1(_0x3d77c3['error'](0x1f4,_0xa74f6a['message']));});});};exports['ShowVoiceQueue']=function(_0x1ffcad){var _0x4a6490=this;return new Promise(function(_0x50f2e4,_0x1bccdf){return db[_0xc873('0x23')][_0xc873('0x24')]({'raw':_0x1ffcad[_0xc873('0x1c')]?_0x1ffcad[_0xc873('0x1c')][_0xc873('0x25')]===undefined?!![]:![]:!![],'where':_0x1ffcad['options']?_0x1ffcad[_0xc873('0x1c')][_0xc873('0x1d')]||null:null,'attributes':_0x1ffcad['options']?_0x1ffcad[_0xc873('0x1c')][_0xc873('0x1e')]||null:null,'include':_0x1ffcad['options']?_0x1ffcad['options'][_0xc873('0x1f')]?_[_0xc873('0x20')](_0x1ffcad[_0xc873('0x1c')][_0xc873('0x1f')],function(_0x4b42ea){return{'model':db[_0x4b42ea[_0xc873('0x21')]],'as':_0x4b42ea['as'],'attributes':_0x4b42ea['attributes'],'include':_0x4b42ea[_0xc873('0x1f')]?_[_0xc873('0x20')](_0x4b42ea[_0xc873('0x1f')],function(_0x31ebf9){return{'model':db[_0x31ebf9['model']],'as':_0x31ebf9['as'],'attributes':_0x31ebf9[_0xc873('0x1e')],'include':_0x31ebf9['include']?_['map'](_0x31ebf9[_0xc873('0x1f')],function(_0x3b41ff){return{'model':db[_0x3b41ff[_0xc873('0x21')]],'as':_0x3b41ff['as'],'attributes':_0x3b41ff[_0xc873('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc873('0x10')](function(_0x3b925c){logger['info'](_0xc873('0x26'),_0x1ffcad);logger['debug'](_0xc873('0x26'),_0x1ffcad,JSON[_0xc873('0x14')](_0x3b925c));_0x50f2e4(_0x3b925c);})[_0xc873('0x22')](function(_0x4e053d){logger[_0xc873('0x16')](_0xc873('0x26'),_0x4e053d[_0xc873('0x17')],_0x1ffcad);_0x1bccdf(_0x4a6490[_0xc873('0x16')](0x1f4,_0x4e053d[_0xc873('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index d5a28ab..4b3b61b 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 _0x7ddc=['update','register','length','voiceQueue:','save','remove'];(function(_0x57f8c0,_0x136cf6){var _0x117f08=function(_0x426cd4){while(--_0x426cd4){_0x57f8c0['push'](_0x57f8c0['shift']());}};_0x117f08(++_0x136cf6);}(_0x7ddc,0x124));var _0xc7dd=function(_0x5b16f7,_0x1cbe43){_0x5b16f7=_0x5b16f7-0x0;var _0xb788ad=_0x7ddc[_0x5b16f7];return _0xb788ad;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xc7dd('0x0'),_0xc7dd('0x1'),_0xc7dd('0x2')];function createListener(_0x5097d2,_0x2fae14){return function(_0x53bd0d){_0x2fae14['emit'](_0x5097d2,_0x53bd0d);};}function removeListener(_0x19e77f,_0x1d2f36){return function(){VoiceQueueEvents['removeListener'](_0x19e77f,_0x1d2f36);};}exports[_0xc7dd('0x3')]=function(_0x418154){for(var _0x255b92=0x0,_0x450827=events[_0xc7dd('0x4')];_0x255b92<_0x450827;_0x255b92++){var _0x31a24b=events[_0x255b92];var _0xd93be2=createListener(_0xc7dd('0x5')+_0x31a24b,_0x418154);VoiceQueueEvents['on'](_0x31a24b,_0xd93be2);}}; \ No newline at end of file +var _0xfe7e=['update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','remove'];(function(_0x51c7ca,_0x1b01fd){var _0x5ee919=function(_0x4cc918){while(--_0x4cc918){_0x51c7ca['push'](_0x51c7ca['shift']());}};_0x5ee919(++_0x1b01fd);}(_0xfe7e,0x1b6));var _0xefe7=function(_0x2c068d,_0x27371a){_0x2c068d=_0x2c068d-0x0;var _0x3bfed0=_0xfe7e[_0x2c068d];return _0x3bfed0;};'use strict';var VoiceQueueEvents=require(_0xefe7('0x0'));var events=['save',_0xefe7('0x1'),_0xefe7('0x2')];function createListener(_0xaf1cbf,_0x21918e){return function(_0x20f350){_0x21918e[_0xefe7('0x3')](_0xaf1cbf,_0x20f350);};}function removeListener(_0x5174db,_0x1868fd){return function(){VoiceQueueEvents[_0xefe7('0x4')](_0x5174db,_0x1868fd);};}exports[_0xefe7('0x5')]=function(_0x389c96){for(var _0x1543b4=0x0,_0xc10af7=events[_0xefe7('0x6')];_0x1543b4<_0xc10af7;_0x1543b4++){var _0x2aa44b=events[_0x1543b4];var _0x48b9ef=createListener(_0xefe7('0x7')+_0x2aa44b,_0x389c96);VoiceQueueEvents['on'](_0x2aa44b,_0x48b9ef);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index de70097..6b61821 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 _0x627e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','/index','getVoiceQueuesReport','/:id','post','put','update','destroy','exports','multer','util','path','express','Router'];(function(_0x598ab5,_0x5af546){var _0x1a23f3=function(_0x3e219c){while(--_0x3e219c){_0x598ab5['push'](_0x598ab5['shift']());}};_0x1a23f3(++_0x5af546);}(_0x627e,0x1b3));var _0xe627=function(_0x1e96b3,_0x5456c8){_0x1e96b3=_0x1e96b3-0x0;var _0x1bd56f=_0x627e[_0x1e96b3];return _0x1bd56f;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require('connect-timeout');var express=require(_0xe627('0x3'));var router=express[_0xe627('0x4')]();var fs_extra=require(_0xe627('0x5'));var auth=require(_0xe627('0x6'));var interaction=require(_0xe627('0x7'));var config=require(_0xe627('0x8'));var controller=require(_0xe627('0x9'));router[_0xe627('0xa')]('/',auth['isAuthenticated'](),controller[_0xe627('0xb')]);router['get'](_0xe627('0xc'),auth[_0xe627('0xd')](),controller['describe']);router[_0xe627('0xa')](_0xe627('0xe'),auth['isAuthenticated'](),controller[_0xe627('0xf')]);router[_0xe627('0xa')](_0xe627('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xe627('0x11')]('/',auth[_0xe627('0xd')](),controller['create']);router[_0xe627('0x12')](_0xe627('0x10'),auth['isAuthenticated'](),controller[_0xe627('0x13')]);router['delete'](_0xe627('0x10'),auth['isAuthenticated'](),controller[_0xe627('0x14')]);module[_0xe627('0x15')]=router; \ No newline at end of file +var _0x43cc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x43cc,0x126));var _0xc43c=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x43cc[_0x553150];return _0x18193d;};'use strict';var multer=require(_0xc43c('0x0'));var util=require(_0xc43c('0x1'));var path=require(_0xc43c('0x2'));var timeout=require(_0xc43c('0x3'));var express=require(_0xc43c('0x4'));var router=express[_0xc43c('0x5')]();var fs_extra=require(_0xc43c('0x6'));var auth=require(_0xc43c('0x7'));var interaction=require(_0xc43c('0x8'));var config=require(_0xc43c('0x9'));var controller=require('./voiceQueueReport.controller');router[_0xc43c('0xa')]('/',auth['isAuthenticated'](),controller[_0xc43c('0xb')]);router[_0xc43c('0xa')](_0xc43c('0xc'),auth[_0xc43c('0xd')](),controller[_0xc43c('0xe')]);router[_0xc43c('0xa')](_0xc43c('0xf'),auth[_0xc43c('0xd')](),controller['getVoiceQueuesReport']);router[_0xc43c('0xa')](_0xc43c('0x10'),auth[_0xc43c('0xd')](),controller[_0xc43c('0x11')]);router['post']('/',auth[_0xc43c('0xd')](),controller[_0xc43c('0x12')]);router[_0xc43c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc43c('0x14')]);router[_0xc43c('0x15')](_0xc43c('0x10'),auth[_0xc43c('0xd')](),controller['destroy']);module[_0xc43c('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 9440cde..3acfdf0 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 _0x8cc0=['queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x368c56,_0x3db153){var _0x852818=function(_0x4aad87){while(--_0x4aad87){_0x368c56['push'](_0x368c56['shift']());}};_0x852818(++_0x3db153);}(_0x8cc0,0x1d6));var _0x08cc=function(_0x256327,_0x2a37db){_0x256327=_0x256327-0x0;var _0x35fc26=_0x8cc0[_0x256327];return _0x35fc26;};'use strict';var Sequelize=require(_0x08cc('0x0'));var moment=require(_0x08cc('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x08cc('0x2')]},'calleridnum':{'type':Sequelize[_0x08cc('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x08cc('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x08cc('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x08cc('0x3')],'set':function(_0xe1b7b2){var _0x37d0ba=moment(_0xe1b7b2);var _0x28d907=moment(this[_0x08cc('0x4')]('queuecallerjoinAt'))[_0x08cc('0x5')](_0x08cc('0x6'));var _0x58c0d8=_0x37d0ba[_0x08cc('0x7')](_0x28d907,_0x08cc('0x8'));this[_0x08cc('0x9')](_0x08cc('0xa'),_0xe1b7b2);this[_0x08cc('0x9')]('holdtime',_0x58c0d8||null);}},'position':{'type':Sequelize[_0x08cc('0xb')]},'count':{'type':Sequelize[_0x08cc('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x08cc('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x08cc('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x08cc('0x3')]},'queuecallerexit':{'type':Sequelize[_0x08cc('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x08cc('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x08cc('0x2')],'comment':_0x08cc('0xd')},'originalposition':{'type':Sequelize[_0x08cc('0xb')]},'channel':{'type':Sequelize[_0x08cc('0x2')]},'connectedlinenum':{'type':Sequelize[_0x08cc('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x08cc('0x2')]},'exten':{'type':Sequelize[_0x08cc('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x08cc('0xb')]},'mohtime':{'type':Sequelize[_0x08cc('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x08cc('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x08cc('0x2')]},'transfer':{'type':Sequelize[_0x08cc('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x08cc('0x2')],'comment':_0x08cc('0xe')},'transferexten':{'type':Sequelize[_0x08cc('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x08cc('0x2')]},'secondDisposition':{'type':Sequelize[_0x08cc('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x08cc('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xab2d=['getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE'];(function(_0x337c27,_0x152c99){var _0x3a77e0=function(_0x5eadef){while(--_0x5eadef){_0x337c27['push'](_0x337c27['shift']());}};_0x3a77e0(++_0x152c99);}(_0xab2d,0x137));var _0xdab2=function(_0x1a3c05,_0x1d755d){_0x1a3c05=_0x1a3c05-0x0;var _0x5a765c=_0xab2d[_0x1a3c05];return _0x5a765c;};'use strict';var Sequelize=require(_0xdab2('0x0'));var moment=require(_0xdab2('0x1'));module['exports']={'type':{'type':Sequelize[_0xdab2('0x2')]},'uniqueid':{'type':Sequelize[_0xdab2('0x2')]},'calleridnum':{'type':Sequelize[_0xdab2('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdab2('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xdab2('0x3')],'set':function(_0x56e6a3){var _0xf4c39b=moment(_0x56e6a3);var _0x2bf4a8=moment(this[_0xdab2('0x4')]('queuecallerjoinAt'))[_0xdab2('0x5')](_0xdab2('0x6'));var _0x49df19=_0xf4c39b[_0xdab2('0x7')](_0x2bf4a8,_0xdab2('0x8'));this['setDataValue'](_0xdab2('0x9'),_0x56e6a3);this[_0xdab2('0xa')](_0xdab2('0xb'),_0x49df19||null);}},'position':{'type':Sequelize[_0xdab2('0xc')]},'count':{'type':Sequelize[_0xdab2('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xdab2('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xdab2('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xdab2('0x3')]},'queuecallerexit':{'type':Sequelize[_0xdab2('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xdab2('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xdab2('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdab2('0x2')]},'connectedlinename':{'type':Sequelize[_0xdab2('0x2')]},'accountcode':{'type':Sequelize[_0xdab2('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xdab2('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdab2('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdab2('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdab2('0x2')],'comment':_0xdab2('0xe')},'transferexten':{'type':Sequelize[_0xdab2('0x2')]},'transferuniqueid':{'type':Sequelize[_0xdab2('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdab2('0x2')]},'thirdDisposition':{'type':Sequelize[_0xdab2('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xdab2('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 177b6c1..407a1d1 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 _0x7d69=['VIRTUAL','merge','VoiceQueueReport','includeAll','findAll','rows','catch','params','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','options','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x533784,_0x3293c2){var _0x3d96ce=function(_0x4a7ef0){while(--_0x4a7ef0){_0x533784['push'](_0x533784['shift']());}};_0x3d96ce(++_0x3293c2);}(_0x7d69,0x160));var _0x97d6=function(_0x48a825,_0x2ee6cf){_0x48a825=_0x48a825-0x0;var _0x424703=_0x7d69[_0x48a825];return _0x424703;};'use strict';var emlformat=require(_0x97d6('0x0'));var rimraf=require(_0x97d6('0x1'));var zipdir=require(_0x97d6('0x2'));var jsonpatch=require(_0x97d6('0x3'));var rp=require('request-promise');var moment=require(_0x97d6('0x4'));var BPromise=require(_0x97d6('0x5'));var Mustache=require(_0x97d6('0x6'));var util=require(_0x97d6('0x7'));var path=require(_0x97d6('0x8'));var sox=require(_0x97d6('0x9'));var csv=require(_0x97d6('0xa'));var ejs=require(_0x97d6('0xb'));var fs=require('fs');var fs_extra=require(_0x97d6('0xc'));var _=require(_0x97d6('0xd'));var squel=require(_0x97d6('0xe'));var crypto=require(_0x97d6('0xf'));var jsforce=require(_0x97d6('0x10'));var deskjs=require(_0x97d6('0x11'));var toCsv=require(_0x97d6('0xa'));var querystring=require(_0x97d6('0x12'));var Papa=require(_0x97d6('0x13'));var Redis=require(_0x97d6('0x14'));var authService=require(_0x97d6('0x15'));var qs=require(_0x97d6('0x16'));var as=require(_0x97d6('0x17'));var hardwareService=require(_0x97d6('0x18'));var logger=require(_0x97d6('0x19'))(_0x97d6('0x1a'));var utils=require(_0x97d6('0x1b'));var config=require(_0x97d6('0x1c'));var licenseUtil=require(_0x97d6('0x1d'));var db=require(_0x97d6('0x1e'))['db'];config[_0x97d6('0x1f')]=_[_0x97d6('0x20')](config[_0x97d6('0x1f')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97d6('0x1f')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x67ec9,_0x5f1414){_0x5f1414=_0x5f1414||0xcc;return function(_0x248731){if(_0x248731){return _0x67ec9['sendStatus'](_0x5f1414);}return _0x67ec9[_0x97d6('0x21')](_0x5f1414)[_0x97d6('0x22')]();};}function respondWithResult(_0x528e0d,_0x118f7f){_0x118f7f=_0x118f7f||0xc8;return function(_0x1c5e0a){if(_0x1c5e0a){return _0x528e0d['status'](_0x118f7f)[_0x97d6('0x23')](_0x1c5e0a);}};}function respondWithFilteredResult(_0xc520e6,_0x2f23b0){return function(_0x59c112){if(_0x59c112){var _0x1bdc6f=typeof _0x2f23b0[_0x97d6('0x24')]===_0x97d6('0x25')&&typeof _0x2f23b0[_0x97d6('0x26')]===_0x97d6('0x25');var _0x13b819=_0x59c112['count'];var _0x33ca3b=_0x1bdc6f?0x0:_0x2f23b0[_0x97d6('0x24')];var _0x1e062e=_0x1bdc6f?_0x59c112[_0x97d6('0x27')]:_0x2f23b0[_0x97d6('0x24')]+_0x2f23b0['limit'];var _0x20d514;if(_0x1e062e>=_0x13b819){_0x1e062e=_0x13b819;_0x20d514=0xc8;}else{_0x20d514=0xce;}_0xc520e6[_0x97d6('0x21')](_0x20d514);return _0xc520e6[_0x97d6('0x28')](_0x97d6('0x29'),_0x33ca3b+'-'+_0x1e062e+'/'+_0x13b819)[_0x97d6('0x23')](_0x59c112);}return null;};}function patchUpdates(_0xb1b507){return function(_0xbf7cab){try{jsonpatch[_0x97d6('0x2a')](_0xbf7cab,_0xb1b507,!![]);}catch(_0x38d329){return BPromise[_0x97d6('0x2b')](_0x38d329);}return _0xbf7cab[_0x97d6('0x2c')]();};}function saveUpdates(_0x790b77,_0x57112d){return function(_0x1b3e6f){if(_0x1b3e6f){return _0x1b3e6f[_0x97d6('0x2d')](_0x790b77)[_0x97d6('0x2e')](function(_0x78690c){return _0x78690c;});}return null;};}function removeEntity(_0x51e7ed,_0x4c41ce){return function(_0x1e76ab){if(_0x1e76ab){return _0x1e76ab['destroy']()['then'](function(){_0x51e7ed[_0x97d6('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b427,_0x36d6d5){return function(_0x91b6cd){if(!_0x91b6cd){_0x12b427[_0x97d6('0x2f')](0x194);}return _0x91b6cd;};}function handleError(_0x5e4cf1,_0x1b28d3){_0x1b28d3=_0x1b28d3||0x1f4;return function(_0x56cbc0){logger[_0x97d6('0x30')](_0x56cbc0[_0x97d6('0x31')]);if(_0x56cbc0[_0x97d6('0x32')]){delete _0x56cbc0[_0x97d6('0x32')];}_0x5e4cf1['status'](_0x1b28d3)['send'](_0x56cbc0);};}exports[_0x97d6('0x33')]=function(_0x26fed5,_0xaedcc8){var _0x383df8={},_0x8e8bb4={},_0x25d577={'count':0x0,'rows':[]};var _0x3e529a=_[_0x97d6('0x34')](db['VoiceQueueReport'][_0x97d6('0x35')],function(_0x572aeb){return{'name':_0x572aeb['fieldName'],'type':_0x572aeb['type']['key']};});_0x8e8bb4[_0x97d6('0x36')]=_[_0x97d6('0x34')](_0x3e529a,_0x97d6('0x32'));_0x8e8bb4[_0x97d6('0x37')]=_[_0x97d6('0x38')](_0x26fed5[_0x97d6('0x37')]);_0x8e8bb4[_0x97d6('0x39')]=_['intersection'](_0x8e8bb4[_0x97d6('0x36')],_0x8e8bb4[_0x97d6('0x37')]);_0x383df8[_0x97d6('0x3a')]=_[_0x97d6('0x3b')](_0x8e8bb4['model'],qs[_0x97d6('0x3c')](_0x26fed5[_0x97d6('0x37')][_0x97d6('0x3c')]));_0x383df8[_0x97d6('0x3a')]=_0x383df8[_0x97d6('0x3a')][_0x97d6('0x3d')]?_0x383df8['attributes']:_0x8e8bb4[_0x97d6('0x36')];if(!_0x26fed5[_0x97d6('0x37')][_0x97d6('0x3e')]('nolimit')){_0x383df8['limit']=qs[_0x97d6('0x26')](_0x26fed5[_0x97d6('0x37')]['limit']);_0x383df8['offset']=qs['offset'](_0x26fed5['query'][_0x97d6('0x24')]);}_0x383df8[_0x97d6('0x3f')]=qs[_0x97d6('0x40')](_0x26fed5[_0x97d6('0x37')][_0x97d6('0x40')]);_0x383df8['where']=qs[_0x97d6('0x39')](_[_0x97d6('0x41')](_0x26fed5['query'],_0x8e8bb4[_0x97d6('0x39')]),_0x3e529a);if(_0x26fed5[_0x97d6('0x37')][_0x97d6('0x42')]){_0x383df8[_0x97d6('0x43')]=_['merge'](_0x383df8[_0x97d6('0x43')],{'$or':_[_0x97d6('0x34')](_0x3e529a,function(_0x4246f6){if(_0x4246f6['type']!==_0x97d6('0x44')){var _0x32bff1={};_0x32bff1[_0x4246f6['name']]={'$like':'%'+_0x26fed5['query'][_0x97d6('0x42')]+'%'};return _0x32bff1;}})});}_0x383df8=_[_0x97d6('0x45')]({},_0x383df8,_0x26fed5['options']);var _0x513763={'where':_0x383df8[_0x97d6('0x43')]};return db[_0x97d6('0x46')]['count'](_0x513763)[_0x97d6('0x2e')](function(_0x34eae4){_0x25d577['count']=_0x34eae4;if(_0x26fed5[_0x97d6('0x37')][_0x97d6('0x47')]){_0x383df8['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x97d6('0x48')](_0x383df8);})[_0x97d6('0x2e')](function(_0x5a9b93){_0x25d577[_0x97d6('0x49')]=_0x5a9b93;return _0x25d577;})[_0x97d6('0x2e')](respondWithFilteredResult(_0xaedcc8,_0x383df8))[_0x97d6('0x4a')](handleError(_0xaedcc8,null));};exports['show']=function(_0x1aff47,_0x5ca2dd){var _0xaebd35={'raw':![],'where':{'id':_0x1aff47[_0x97d6('0x4b')]['id']}},_0x45f247={};_0x45f247[_0x97d6('0x36')]=_[_0x97d6('0x38')](db['VoiceQueueReport'][_0x97d6('0x35')]);_0x45f247['query']=_[_0x97d6('0x38')](_0x1aff47[_0x97d6('0x37')]);_0x45f247['filters']=_[_0x97d6('0x3b')](_0x45f247[_0x97d6('0x36')],_0x45f247[_0x97d6('0x37')]);_0xaebd35[_0x97d6('0x3a')]=_[_0x97d6('0x3b')](_0x45f247[_0x97d6('0x36')],qs[_0x97d6('0x3c')](_0x1aff47[_0x97d6('0x37')][_0x97d6('0x3c')]));_0xaebd35[_0x97d6('0x3a')]=_0xaebd35[_0x97d6('0x3a')][_0x97d6('0x3d')]?_0xaebd35[_0x97d6('0x3a')]:_0x45f247[_0x97d6('0x36')];if(_0x1aff47[_0x97d6('0x37')][_0x97d6('0x47')]){_0xaebd35['include']=[{'all':!![]}];}_0xaebd35=_['merge']({},_0xaebd35,_0x1aff47['options']);return db[_0x97d6('0x46')][_0x97d6('0x4c')](_0xaebd35)[_0x97d6('0x2e')](handleEntityNotFound(_0x5ca2dd,null))['then'](respondWithResult(_0x5ca2dd,null))[_0x97d6('0x4a')](handleError(_0x5ca2dd,null));};exports[_0x97d6('0x4d')]=function(_0x2ae883,_0x3ed435){return db[_0x97d6('0x46')][_0x97d6('0x4d')](_0x2ae883[_0x97d6('0x4e')],{})[_0x97d6('0x2e')](respondWithResult(_0x3ed435,0xc9))[_0x97d6('0x4a')](handleError(_0x3ed435,null));};exports[_0x97d6('0x2d')]=function(_0x5bfa14,_0x2418c9){if(_0x5bfa14[_0x97d6('0x4e')]['id']){delete _0x5bfa14[_0x97d6('0x4e')]['id'];}return db[_0x97d6('0x46')][_0x97d6('0x4c')]({'where':{'id':_0x5bfa14[_0x97d6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2418c9,null))['then'](saveUpdates(_0x5bfa14[_0x97d6('0x4e')],null))[_0x97d6('0x2e')](respondWithResult(_0x2418c9,null))['catch'](handleError(_0x2418c9,null));};exports[_0x97d6('0x4f')]=function(_0x599d19,_0x31ced0){return db[_0x97d6('0x46')][_0x97d6('0x4c')]({'where':{'id':_0x599d19[_0x97d6('0x4b')]['id']}})[_0x97d6('0x2e')](handleEntityNotFound(_0x31ced0,null))[_0x97d6('0x2e')](removeEntity(_0x31ced0,null))['catch'](handleError(_0x31ced0,null));};exports[_0x97d6('0x50')]=function(_0x1626d9,_0x36251b){return db['VoiceQueueReport']['describe']()[_0x97d6('0x2e')](respondWithResult(_0x36251b,null))[_0x97d6('0x4a')](handleError(_0x36251b,null));};exports[_0x97d6('0x51')]=function(_0x537ba0,_0xc7b1fa){var _0xf2e286={},_0x2cd55c={},_0x6f3ae7={'count':0x0,'rows':[]};_0x2cd55c[_0x97d6('0x36')]=_[_0x97d6('0x38')](db[_0x97d6('0x46')][_0x97d6('0x35')]);_0x2cd55c[_0x97d6('0x37')]=_[_0x97d6('0x38')](_0x537ba0[_0x97d6('0x37')]);_0x2cd55c[_0x97d6('0x39')]=_[_0x97d6('0x3b')](_0x2cd55c['model'],_0x2cd55c['query']);_0xf2e286[_0x97d6('0x3a')]=_['intersection'](_0x2cd55c[_0x97d6('0x36')],qs['fields'](_0x537ba0[_0x97d6('0x37')][_0x97d6('0x3c')]));_0xf2e286[_0x97d6('0x3a')]=_0xf2e286[_0x97d6('0x3a')][_0x97d6('0x3d')]?_0xf2e286[_0x97d6('0x3a')]:_0x2cd55c['model'];if(!_0x537ba0[_0x97d6('0x37')]['hasOwnProperty'](_0x97d6('0x52'))){_0xf2e286[_0x97d6('0x26')]=qs[_0x97d6('0x26')](_0x537ba0[_0x97d6('0x37')][_0x97d6('0x26')]);_0xf2e286['offset']=qs[_0x97d6('0x24')](_0x537ba0[_0x97d6('0x37')][_0x97d6('0x24')]);}_0xf2e286[_0x97d6('0x3f')]=qs[_0x97d6('0x40')](_0x537ba0[_0x97d6('0x37')][_0x97d6('0x40')]);_0xf2e286['where']=qs['filters'](_['pick'](_0x537ba0['query'],_0x2cd55c['filters']));if(_0x537ba0[_0x97d6('0x37')][_0x97d6('0x42')]){_0xf2e286['where']=_[_0x97d6('0x45')](_0xf2e286[_0x97d6('0x43')],{'$or':_[_0x97d6('0x34')](_0xf2e286[_0x97d6('0x3a')],function(_0x573bf1){var _0xfc9049={};_0xfc9049[_0x573bf1]={'$like':'%'+_0x537ba0[_0x97d6('0x37')][_0x97d6('0x42')]+'%'};return _0xfc9049;})});}_0xf2e286=_[_0x97d6('0x45')]({},_0xf2e286,_0x537ba0[_0x97d6('0x53')]);var _0x318e33={'where':_0xf2e286[_0x97d6('0x43')]};return db[_0x97d6('0x46')][_0x97d6('0x27')](_0x318e33)[_0x97d6('0x2e')](function(_0x28401f){_0x6f3ae7[_0x97d6('0x27')]=_0x28401f;if(_0x537ba0['query'][_0x97d6('0x47')]){_0xf2e286['include']=[{'all':!![]}];}return db[_0x97d6('0x46')]['findAll'](_0xf2e286);})['then'](function(_0x309364){_0x6f3ae7[_0x97d6('0x49')]=_0x309364;return _0x6f3ae7;})['then'](respondWithFilteredResult(_0xc7b1fa,_0xf2e286,'getVoiceQueuesReport'))[_0x97d6('0x4a')](handleError(_0xc7b1fa,null,_0x97d6('0x51')));}; \ No newline at end of file +var _0x8a16=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','name','send','map','VoiceQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','describe','order','rows','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x29e12a,_0x427d7b){var _0x294041=function(_0x31e5b6){while(--_0x31e5b6){_0x29e12a['push'](_0x29e12a['shift']());}};_0x294041(++_0x427d7b);}(_0x8a16,0x1c2));var _0x68a1=function(_0x313c0d,_0x217fc8){_0x313c0d=_0x313c0d-0x0;var _0x2a6476=_0x8a16[_0x313c0d];return _0x2a6476;};'use strict';var emlformat=require(_0x68a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68a1('0x1'));var jsonpatch=require(_0x68a1('0x2'));var rp=require(_0x68a1('0x3'));var moment=require(_0x68a1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x68a1('0x5'));var util=require('util');var path=require(_0x68a1('0x6'));var sox=require(_0x68a1('0x7'));var csv=require('to-csv');var ejs=require(_0x68a1('0x8'));var fs=require('fs');var fs_extra=require(_0x68a1('0x9'));var _=require(_0x68a1('0xa'));var squel=require(_0x68a1('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x68a1('0xc'));var toCsv=require(_0x68a1('0xd'));var querystring=require(_0x68a1('0xe'));var Papa=require(_0x68a1('0xf'));var Redis=require(_0x68a1('0x10'));var authService=require(_0x68a1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x68a1('0x12'));var hardwareService=require(_0x68a1('0x13'));var logger=require(_0x68a1('0x14'))(_0x68a1('0x15'));var utils=require('../../config/utils');var config=require(_0x68a1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x68a1('0x17')](config[_0x68a1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x68a1('0x19'))(new Redis(config[_0x68a1('0x18')]));require(_0x68a1('0x1a'))['register'](socket);function respondWithStatusCode(_0x5e04c3,_0x4ae154){_0x4ae154=_0x4ae154||0xcc;return function(_0x23851e){if(_0x23851e){return _0x5e04c3[_0x68a1('0x1b')](_0x4ae154);}return _0x5e04c3[_0x68a1('0x1c')](_0x4ae154)['end']();};}function respondWithResult(_0x53e8c3,_0x3acf5a){_0x3acf5a=_0x3acf5a||0xc8;return function(_0x3e966a){if(_0x3e966a){return _0x53e8c3[_0x68a1('0x1c')](_0x3acf5a)[_0x68a1('0x1d')](_0x3e966a);}};}function respondWithFilteredResult(_0x3e13cf,_0x10698f){return function(_0x5ac65f){if(_0x5ac65f){var _0x459e7a=typeof _0x10698f['offset']===_0x68a1('0x1e')&&typeof _0x10698f[_0x68a1('0x1f')]==='undefined';var _0x420f82=_0x5ac65f[_0x68a1('0x20')];var _0x760193=_0x459e7a?0x0:_0x10698f[_0x68a1('0x21')];var _0x13b5f9=_0x459e7a?_0x5ac65f['count']:_0x10698f[_0x68a1('0x21')]+_0x10698f[_0x68a1('0x1f')];var _0x43cb7c;if(_0x13b5f9>=_0x420f82){_0x13b5f9=_0x420f82;_0x43cb7c=0xc8;}else{_0x43cb7c=0xce;}_0x3e13cf[_0x68a1('0x1c')](_0x43cb7c);return _0x3e13cf[_0x68a1('0x22')]('Content-Range',_0x760193+'-'+_0x13b5f9+'/'+_0x420f82)[_0x68a1('0x1d')](_0x5ac65f);}return null;};}function patchUpdates(_0x18e614){return function(_0xff401b){try{jsonpatch['apply'](_0xff401b,_0x18e614,!![]);}catch(_0x15029c){return BPromise[_0x68a1('0x23')](_0x15029c);}return _0xff401b[_0x68a1('0x24')]();};}function saveUpdates(_0xd287bc,_0x1be2d6){return function(_0x4003dc){if(_0x4003dc){return _0x4003dc[_0x68a1('0x25')](_0xd287bc)[_0x68a1('0x26')](function(_0x28310f){return _0x28310f;});}return null;};}function removeEntity(_0x295589,_0x51487d){return function(_0x1fdea3){if(_0x1fdea3){return _0x1fdea3[_0x68a1('0x27')]()['then'](function(){_0x295589[_0x68a1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b802,_0x30bbf3){return function(_0x55b3b1){if(!_0x55b3b1){_0x23b802['sendStatus'](0x194);}return _0x55b3b1;};}function handleError(_0x12ff3f,_0x7ae54d){_0x7ae54d=_0x7ae54d||0x1f4;return function(_0x390f09){logger[_0x68a1('0x28')](_0x390f09['stack']);if(_0x390f09['name']){delete _0x390f09[_0x68a1('0x29')];}_0x12ff3f[_0x68a1('0x1c')](_0x7ae54d)[_0x68a1('0x2a')](_0x390f09);};}exports['index']=function(_0x342b2f,_0x300562){var _0x88d6ff={},_0x699235={},_0x873ff7={'count':0x0,'rows':[]};var _0x5db79e=_[_0x68a1('0x2b')](db[_0x68a1('0x2c')]['rawAttributes'],function(_0x14dd11){return{'name':_0x14dd11[_0x68a1('0x2d')],'type':_0x14dd11[_0x68a1('0x2e')][_0x68a1('0x2f')]};});_0x699235[_0x68a1('0x30')]=_[_0x68a1('0x2b')](_0x5db79e,'name');_0x699235[_0x68a1('0x31')]=_[_0x68a1('0x32')](_0x342b2f[_0x68a1('0x31')]);_0x699235[_0x68a1('0x33')]=_[_0x68a1('0x34')](_0x699235['model'],_0x699235[_0x68a1('0x31')]);_0x88d6ff['attributes']=_[_0x68a1('0x34')](_0x699235['model'],qs[_0x68a1('0x35')](_0x342b2f[_0x68a1('0x31')][_0x68a1('0x35')]));_0x88d6ff[_0x68a1('0x36')]=_0x88d6ff['attributes'][_0x68a1('0x37')]?_0x88d6ff[_0x68a1('0x36')]:_0x699235[_0x68a1('0x30')];if(!_0x342b2f[_0x68a1('0x31')][_0x68a1('0x38')](_0x68a1('0x39'))){_0x88d6ff[_0x68a1('0x1f')]=qs[_0x68a1('0x1f')](_0x342b2f['query'][_0x68a1('0x1f')]);_0x88d6ff[_0x68a1('0x21')]=qs[_0x68a1('0x21')](_0x342b2f[_0x68a1('0x31')][_0x68a1('0x21')]);}_0x88d6ff['order']=qs[_0x68a1('0x3a')](_0x342b2f[_0x68a1('0x31')]['sort']);_0x88d6ff[_0x68a1('0x3b')]=qs[_0x68a1('0x33')](_[_0x68a1('0x3c')](_0x342b2f[_0x68a1('0x31')],_0x699235[_0x68a1('0x33')]),_0x5db79e);if(_0x342b2f[_0x68a1('0x31')][_0x68a1('0x3d')]){_0x88d6ff[_0x68a1('0x3b')]=_[_0x68a1('0x3e')](_0x88d6ff['where'],{'$or':_['map'](_0x5db79e,function(_0x161582){if(_0x161582[_0x68a1('0x2e')]!=='VIRTUAL'){var _0x503ff5={};_0x503ff5[_0x161582[_0x68a1('0x29')]]={'$like':'%'+_0x342b2f[_0x68a1('0x31')][_0x68a1('0x3d')]+'%'};return _0x503ff5;}})});}_0x88d6ff=_[_0x68a1('0x3e')]({},_0x88d6ff,_0x342b2f[_0x68a1('0x3f')]);var _0x4b3e0f={'where':_0x88d6ff[_0x68a1('0x3b')]};return db['VoiceQueueReport'][_0x68a1('0x20')](_0x4b3e0f)[_0x68a1('0x26')](function(_0x4b83a9){_0x873ff7[_0x68a1('0x20')]=_0x4b83a9;if(_0x342b2f[_0x68a1('0x31')]['includeAll']){_0x88d6ff[_0x68a1('0x40')]=[{'all':!![]}];}return db[_0x68a1('0x2c')][_0x68a1('0x41')](_0x88d6ff);})[_0x68a1('0x26')](function(_0x4db358){_0x873ff7['rows']=_0x4db358;return _0x873ff7;})[_0x68a1('0x26')](respondWithFilteredResult(_0x300562,_0x88d6ff))[_0x68a1('0x42')](handleError(_0x300562,null));};exports[_0x68a1('0x43')]=function(_0x4a5ef5,_0x295066){var _0x2ceaf9={'raw':![],'where':{'id':_0x4a5ef5[_0x68a1('0x44')]['id']}},_0x2d9e23={};_0x2d9e23[_0x68a1('0x30')]=_[_0x68a1('0x32')](db[_0x68a1('0x2c')][_0x68a1('0x45')]);_0x2d9e23[_0x68a1('0x31')]=_[_0x68a1('0x32')](_0x4a5ef5[_0x68a1('0x31')]);_0x2d9e23[_0x68a1('0x33')]=_[_0x68a1('0x34')](_0x2d9e23[_0x68a1('0x30')],_0x2d9e23[_0x68a1('0x31')]);_0x2ceaf9['attributes']=_[_0x68a1('0x34')](_0x2d9e23[_0x68a1('0x30')],qs['fields'](_0x4a5ef5[_0x68a1('0x31')][_0x68a1('0x35')]));_0x2ceaf9[_0x68a1('0x36')]=_0x2ceaf9[_0x68a1('0x36')][_0x68a1('0x37')]?_0x2ceaf9[_0x68a1('0x36')]:_0x2d9e23[_0x68a1('0x30')];if(_0x4a5ef5[_0x68a1('0x31')][_0x68a1('0x46')]){_0x2ceaf9['include']=[{'all':!![]}];}_0x2ceaf9=_[_0x68a1('0x3e')]({},_0x2ceaf9,_0x4a5ef5['options']);return db[_0x68a1('0x2c')][_0x68a1('0x47')](_0x2ceaf9)[_0x68a1('0x26')](handleEntityNotFound(_0x295066,null))[_0x68a1('0x26')](respondWithResult(_0x295066,null))[_0x68a1('0x42')](handleError(_0x295066,null));};exports[_0x68a1('0x48')]=function(_0x41271d,_0x2e7e6a){return db[_0x68a1('0x2c')]['create'](_0x41271d[_0x68a1('0x49')],{})[_0x68a1('0x26')](respondWithResult(_0x2e7e6a,0xc9))['catch'](handleError(_0x2e7e6a,null));};exports[_0x68a1('0x25')]=function(_0x1b4b1c,_0x1f8aa6){if(_0x1b4b1c[_0x68a1('0x49')]['id']){delete _0x1b4b1c[_0x68a1('0x49')]['id'];}return db[_0x68a1('0x2c')][_0x68a1('0x47')]({'where':{'id':_0x1b4b1c[_0x68a1('0x44')]['id']}})[_0x68a1('0x26')](handleEntityNotFound(_0x1f8aa6,null))[_0x68a1('0x26')](saveUpdates(_0x1b4b1c['body'],null))[_0x68a1('0x26')](respondWithResult(_0x1f8aa6,null))[_0x68a1('0x42')](handleError(_0x1f8aa6,null));};exports[_0x68a1('0x27')]=function(_0x3c379b,_0x679698){return db[_0x68a1('0x2c')][_0x68a1('0x47')]({'where':{'id':_0x3c379b[_0x68a1('0x44')]['id']}})[_0x68a1('0x26')](handleEntityNotFound(_0x679698,null))[_0x68a1('0x26')](removeEntity(_0x679698,null))[_0x68a1('0x42')](handleError(_0x679698,null));};exports[_0x68a1('0x4a')]=function(_0x4c981d,_0x1573fb){return db['VoiceQueueReport']['describe']()[_0x68a1('0x26')](respondWithResult(_0x1573fb,null))[_0x68a1('0x42')](handleError(_0x1573fb,null));};exports['getVoiceQueuesReport']=function(_0x2f14aa,_0x40dddd){var _0x56e607={},_0x5b9ae3={},_0x2ad52b={'count':0x0,'rows':[]};_0x5b9ae3[_0x68a1('0x30')]=_[_0x68a1('0x32')](db[_0x68a1('0x2c')][_0x68a1('0x45')]);_0x5b9ae3[_0x68a1('0x31')]=_[_0x68a1('0x32')](_0x2f14aa['query']);_0x5b9ae3[_0x68a1('0x33')]=_[_0x68a1('0x34')](_0x5b9ae3[_0x68a1('0x30')],_0x5b9ae3['query']);_0x56e607[_0x68a1('0x36')]=_[_0x68a1('0x34')](_0x5b9ae3['model'],qs[_0x68a1('0x35')](_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x35')]));_0x56e607[_0x68a1('0x36')]=_0x56e607[_0x68a1('0x36')][_0x68a1('0x37')]?_0x56e607[_0x68a1('0x36')]:_0x5b9ae3[_0x68a1('0x30')];if(!_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x38')](_0x68a1('0x39'))){_0x56e607[_0x68a1('0x1f')]=qs['limit'](_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x1f')]);_0x56e607[_0x68a1('0x21')]=qs[_0x68a1('0x21')](_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x21')]);}_0x56e607[_0x68a1('0x4b')]=qs[_0x68a1('0x3a')](_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x3a')]);_0x56e607['where']=qs[_0x68a1('0x33')](_[_0x68a1('0x3c')](_0x2f14aa[_0x68a1('0x31')],_0x5b9ae3[_0x68a1('0x33')]));if(_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x3d')]){_0x56e607[_0x68a1('0x3b')]=_[_0x68a1('0x3e')](_0x56e607[_0x68a1('0x3b')],{'$or':_[_0x68a1('0x2b')](_0x56e607[_0x68a1('0x36')],function(_0x124457){var _0x58af18={};_0x58af18[_0x124457]={'$like':'%'+_0x2f14aa[_0x68a1('0x31')][_0x68a1('0x3d')]+'%'};return _0x58af18;})});}_0x56e607=_['merge']({},_0x56e607,_0x2f14aa[_0x68a1('0x3f')]);var _0x3bc189={'where':_0x56e607[_0x68a1('0x3b')]};return db[_0x68a1('0x2c')]['count'](_0x3bc189)[_0x68a1('0x26')](function(_0x54c13f){_0x2ad52b['count']=_0x54c13f;if(_0x2f14aa['query'][_0x68a1('0x46')]){_0x56e607[_0x68a1('0x40')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x68a1('0x41')](_0x56e607);})['then'](function(_0x1e09ed){_0x2ad52b[_0x68a1('0x4c')]=_0x1e09ed;return _0x2ad52b;})[_0x68a1('0x26')](respondWithFilteredResult(_0x40dddd,_0x56e607,_0x68a1('0x4d')))[_0x68a1('0x42')](handleError(_0x40dddd,null,_0x68a1('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f1978f4..4e67a58 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 _0x006a=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x006a,0x192));var _0xa006=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x006a[_0x1d1219];return _0x5b5b89;};'use strict';var EventEmitter=require(_0xa006('0x0'));var VoiceQueueReport=require(_0xa006('0x1'))['db'][_0xa006('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xa006('0x3')](0x0);var events={'afterCreate':_0xa006('0x4'),'afterUpdate':_0xa006('0x5'),'afterDestroy':'remove'};function emitEvent(_0x418fca){return function(_0x36b9d5,_0x25597a,_0x20487c){VoiceQueueReportEvents[_0xa006('0x6')](_0x418fca+':'+_0x36b9d5['id'],_0x36b9d5);VoiceQueueReportEvents[_0xa006('0x6')](_0x418fca,_0x36b9d5);_0x20487c(null);};}for(var e in events){if(events[_0xa006('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xa006('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4a05=['emit','hook','exports','../../mysqldb','VoiceQueueReport','save','remove'];(function(_0x22f889,_0x456c25){var _0x4ae831=function(_0x2d5b3e){while(--_0x2d5b3e){_0x22f889['push'](_0x22f889['shift']());}};_0x4ae831(++_0x456c25);}(_0x4a05,0xf8));var _0x54a0=function(_0x33cab0,_0x4dc044){_0x33cab0=_0x33cab0-0x0;var _0x4fbfb7=_0x4a05[_0x33cab0];return _0x4fbfb7;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x54a0('0x0'))['db'][_0x54a0('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x54a0('0x2'),'afterUpdate':'update','afterDestroy':_0x54a0('0x3')};function emitEvent(_0x2a6488){return function(_0x4359f5,_0x268229,_0x23e773){VoiceQueueReportEvents[_0x54a0('0x4')](_0x2a6488+':'+_0x4359f5['id'],_0x4359f5);VoiceQueueReportEvents[_0x54a0('0x4')](_0x2a6488,_0x4359f5);_0x23e773(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x54a0('0x5')](e,emitEvent(event));}}module[_0x54a0('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index eb5fce1..3be0873 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 _0x4b04=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum'];(function(_0x3f05c5,_0x23e523){var _0x2fe1d0=function(_0x2da5e8){while(--_0x2da5e8){_0x3f05c5['push'](_0x3f05c5['shift']());}};_0x2fe1d0(++_0x23e523);}(_0x4b04,0xc3));var _0x44b0=function(_0x55268e,_0x53616e){_0x55268e=_0x55268e-0x0;var _0x31798b=_0x4b04[_0x55268e];return _0x31798b;};'use strict';var _=require(_0x44b0('0x0'));var util=require(_0x44b0('0x1'));var logger=require(_0x44b0('0x2'))(_0x44b0('0x3'));var moment=require('moment');var BPromise=require(_0x44b0('0x4'));var rp=require(_0x44b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44b0('0x6'));var config=require(_0x44b0('0x7'));var attributes=require(_0x44b0('0x8'));module[_0x44b0('0x9')]=function(_0x3c777b,_0x3c3fd2){return _0x3c777b[_0x44b0('0xa')](_0x44b0('0xb'),attributes,{'tableName':_0x44b0('0xc'),'paranoid':![],'indexes':[{'fields':[_0x44b0('0xd')]},{'fields':[_0x44b0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc211=['moment','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x510c0d,_0x256cfc){var _0x5d97b6=function(_0x427108){while(--_0x427108){_0x510c0d['push'](_0x510c0d['shift']());}};_0x5d97b6(++_0x256cfc);}(_0xc211,0x119));var _0x1c21=function(_0x1b37b7,_0x1538e0){_0x1b37b7=_0x1b37b7-0x0;var _0x5dd846=_0xc211[_0x1b37b7];return _0x5dd846;};'use strict';var _=require(_0x1c21('0x0'));var util=require(_0x1c21('0x1'));var logger=require(_0x1c21('0x2'))(_0x1c21('0x3'));var moment=require(_0x1c21('0x4'));var BPromise=require(_0x1c21('0x5'));var rp=require(_0x1c21('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c21('0x7'));var attributes=require(_0x1c21('0x8'));module[_0x1c21('0x9')]=function(_0x5797ae,_0x1b1296){return _0x5797ae[_0x1c21('0xa')](_0x1c21('0xb'),attributes,{'tableName':_0x1c21('0xc'),'paranoid':![],'indexes':[{'fields':[_0x1c21('0xd')]},{'fields':[_0x1c21('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index d2abc41..b68b8d5 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 _0xe772=['http','defaults','localhost','socket.io-emitter','redis','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','model','map','catch','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x201312,_0x3105da){var _0x505ba6=function(_0x5e9e3a){while(--_0x5e9e3a){_0x201312['push'](_0x201312['shift']());}};_0x505ba6(++_0x3105da);}(_0xe772,0x15d));var _0x2e77=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0xe772[_0x27bcf5];return _0x4ce4cf;};'use strict';var _=require(_0x2e77('0x0'));var util=require('util');var moment=require(_0x2e77('0x1'));var BPromise=require(_0x2e77('0x2'));var rs=require(_0x2e77('0x3'));var fs=require('fs');var Redis=require(_0x2e77('0x4'));var db=require(_0x2e77('0x5'))['db'];var utils=require(_0x2e77('0x6'));var logger=require(_0x2e77('0x7'))(_0x2e77('0x8'));var config=require('../../config/environment');var jayson=require(_0x2e77('0x9'));var client=jayson[_0x2e77('0xa')][_0x2e77('0xb')]({'port':0x232a});config['redis']=_[_0x2e77('0xc')](config['redis'],{'host':_0x2e77('0xd'),'port':0x18eb});var socket=require(_0x2e77('0xe'))(new Redis(config[_0x2e77('0xf')]));require('./voiceQueueReport.socket')[_0x2e77('0x10')](socket);function respondWithRpcPromise(_0x375b81,_0x536a4d,_0x3b1c36){return new BPromise(function(_0x519ba8,_0xea2e17){return client[_0x2e77('0x11')](_0x375b81,_0x3b1c36)[_0x2e77('0x12')](function(_0x4182b1){logger[_0x2e77('0x13')](_0x2e77('0x14'),_0x536a4d,_0x2e77('0x15'));logger[_0x2e77('0x16')](_0x2e77('0x17'),_0x536a4d,_0x2e77('0x15'),JSON[_0x2e77('0x18')](_0x4182b1));if(_0x4182b1[_0x2e77('0x19')]){if(_0x4182b1[_0x2e77('0x19')][_0x2e77('0x1a')]===0x1f4){logger[_0x2e77('0x19')](_0x2e77('0x14'),_0x536a4d,_0x4182b1[_0x2e77('0x19')][_0x2e77('0x1b')]);return _0xea2e17(_0x4182b1[_0x2e77('0x19')][_0x2e77('0x1b')]);}logger['error'](_0x2e77('0x14'),_0x536a4d,_0x4182b1[_0x2e77('0x19')][_0x2e77('0x1b')]);return _0x519ba8(_0x4182b1['error']['message']);}else{logger[_0x2e77('0x13')](_0x2e77('0x14'),_0x536a4d,_0x2e77('0x15'));_0x519ba8(_0x4182b1[_0x2e77('0x1c')][_0x2e77('0x1b')]);}})['catch'](function(_0x2589e3){logger[_0x2e77('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x536a4d,_0x2589e3);_0xea2e17(_0x2589e3);});});}exports[_0x2e77('0x1d')]=function(_0x1d5564){var _0x3dd5eb=this;return new Promise(function(_0x1662b5,_0x49b4ca){return db[_0x2e77('0x1e')]['findAll']({'raw':_0x1d5564['options']?_0x1d5564[_0x2e77('0x1f')][_0x2e77('0x20')]===undefined?!![]:![]:!![],'where':_0x1d5564[_0x2e77('0x1f')]?_0x1d5564[_0x2e77('0x1f')][_0x2e77('0x21')]||null:null,'attributes':_0x1d5564[_0x2e77('0x1f')]?_0x1d5564[_0x2e77('0x1f')][_0x2e77('0x22')]||null:null,'limit':_0x1d5564[_0x2e77('0x1f')]?_0x1d5564[_0x2e77('0x1f')][_0x2e77('0x23')]||null:null,'include':_0x1d5564[_0x2e77('0x1f')]?_0x1d5564['options'][_0x2e77('0x24')]?_['map'](_0x1d5564[_0x2e77('0x1f')][_0x2e77('0x24')],function(_0x307b60){return{'model':db[_0x307b60[_0x2e77('0x25')]],'as':_0x307b60['as'],'attributes':_0x307b60[_0x2e77('0x22')],'include':_0x307b60[_0x2e77('0x24')]?_[_0x2e77('0x26')](_0x307b60[_0x2e77('0x24')],function(_0x41afe6){return{'model':db[_0x41afe6[_0x2e77('0x25')]],'as':_0x41afe6['as'],'attributes':_0x41afe6[_0x2e77('0x22')],'include':_0x41afe6[_0x2e77('0x24')]?_[_0x2e77('0x26')](_0x41afe6[_0x2e77('0x24')],function(_0x37888e){return{'model':db[_0x37888e[_0x2e77('0x25')]],'as':_0x37888e['as'],'attributes':_0x37888e[_0x2e77('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2e77('0x12')](function(_0x2bff04){logger['info']('GetVoiceQueueReport',_0x1d5564);logger[_0x2e77('0x16')](_0x2e77('0x1d'),_0x1d5564,JSON[_0x2e77('0x18')](_0x2bff04));_0x1662b5(_0x2bff04);})[_0x2e77('0x27')](function(_0x215de7){logger['error'](_0x2e77('0x1d'),_0x215de7[_0x2e77('0x1b')],_0x1d5564);_0x49b4ca(_0x3dd5eb[_0x2e77('0x19')](0x1f4,_0x215de7[_0x2e77('0x1b')]));});});};exports[_0x2e77('0x28')]=function(_0x49d10e){var _0x42fe1d=this;return new Promise(function(_0x16adde,_0x3b9703){return db[_0x2e77('0x1e')][_0x2e77('0x29')](_0x49d10e['body'],{'raw':_0x49d10e[_0x2e77('0x1f')]?_0x49d10e[_0x2e77('0x1f')][_0x2e77('0x20')]===undefined?!![]:![]:!![]})[_0x2e77('0x12')](function(_0x2f3009){logger[_0x2e77('0x13')]('CreateVoiceQueueReport',_0x49d10e);logger['debug'](_0x2e77('0x28'),_0x49d10e,JSON[_0x2e77('0x18')](_0x2f3009));_0x16adde(_0x2f3009);})[_0x2e77('0x27')](function(_0x4acdc0){logger[_0x2e77('0x19')](_0x2e77('0x28'),_0x4acdc0['message'],_0x49d10e);_0x3b9703(_0x42fe1d[_0x2e77('0x19')](0x1f4,_0x4acdc0[_0x2e77('0x1b')]));});});};exports[_0x2e77('0x2a')]=function(_0x1a2237){var _0x10b78b=this;return new Promise(function(_0x2fab56,_0x3e40ee){return db[_0x2e77('0x1e')][_0x2e77('0x2b')](_0x1a2237[_0x2e77('0x2c')],{'raw':_0x1a2237[_0x2e77('0x1f')]?_0x1a2237[_0x2e77('0x1f')][_0x2e77('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a2237['options']?_0x1a2237[_0x2e77('0x1f')][_0x2e77('0x21')]||null:null,'attributes':_0x1a2237[_0x2e77('0x1f')]?_0x1a2237[_0x2e77('0x1f')][_0x2e77('0x22')]||null:null,'limit':_0x1a2237[_0x2e77('0x1f')]?_0x1a2237['options'][_0x2e77('0x23')]||null:null})[_0x2e77('0x12')](function(_0xf75ba1){logger[_0x2e77('0x13')](_0x2e77('0x2a'),_0x1a2237);logger[_0x2e77('0x16')](_0x2e77('0x2a'),_0x1a2237,JSON['stringify'](_0xf75ba1));_0x2fab56(_0xf75ba1);})['catch'](function(_0x27d3d){logger[_0x2e77('0x19')](_0x2e77('0x2a'),_0x27d3d[_0x2e77('0x1b')],_0x1a2237);_0x3e40ee(_0x10b78b[_0x2e77('0x19')](0x1f4,_0x27d3d[_0x2e77('0x1b')]));});});}; \ No newline at end of file +var _0xa66d=['result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','map','include','model','debug','CreateVoiceQueueReport','create','body','limit','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xb30689,_0x59a222){var _0x2bed52=function(_0x3a8e4a){while(--_0x3a8e4a){_0xb30689['push'](_0xb30689['shift']());}};_0x2bed52(++_0x59a222);}(_0xa66d,0x66));var _0xda66=function(_0xe56075,_0x4ec2ba){_0xe56075=_0xe56075-0x0;var _0x10b588=_0xa66d[_0xe56075];return _0x10b588;};'use strict';var _=require('lodash');var util=require(_0xda66('0x0'));var moment=require(_0xda66('0x1'));var BPromise=require(_0xda66('0x2'));var rs=require(_0xda66('0x3'));var fs=require('fs');var Redis=require(_0xda66('0x4'));var db=require(_0xda66('0x5'))['db'];var utils=require(_0xda66('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xda66('0x7'));var jayson=require(_0xda66('0x8'));var client=jayson['client'][_0xda66('0x9')]({'port':0x232a});config[_0xda66('0xa')]=_[_0xda66('0xb')](config[_0xda66('0xa')],{'host':_0xda66('0xc'),'port':0x18eb});var socket=require(_0xda66('0xd'))(new Redis(config[_0xda66('0xa')]));require('./voiceQueueReport.socket')[_0xda66('0xe')](socket);function respondWithRpcPromise(_0x4e0ff9,_0x18c864,_0x61dd40){return new BPromise(function(_0x89514e,_0x309af5){return client[_0xda66('0xf')](_0x4e0ff9,_0x61dd40)[_0xda66('0x10')](function(_0x2bd3c5){logger[_0xda66('0x11')](_0xda66('0x12'),_0x18c864,_0xda66('0x13'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x18c864,_0xda66('0x13'),JSON[_0xda66('0x14')](_0x2bd3c5));if(_0x2bd3c5[_0xda66('0x15')]){if(_0x2bd3c5[_0xda66('0x15')][_0xda66('0x16')]===0x1f4){logger[_0xda66('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x18c864,_0x2bd3c5['error']['message']);return _0x309af5(_0x2bd3c5[_0xda66('0x15')][_0xda66('0x17')]);}logger[_0xda66('0x15')](_0xda66('0x12'),_0x18c864,_0x2bd3c5[_0xda66('0x15')]['message']);return _0x89514e(_0x2bd3c5[_0xda66('0x15')]['message']);}else{logger[_0xda66('0x11')](_0xda66('0x12'),_0x18c864,_0xda66('0x13'));_0x89514e(_0x2bd3c5[_0xda66('0x18')][_0xda66('0x17')]);}})[_0xda66('0x19')](function(_0x4c4eb5){logger[_0xda66('0x15')](_0xda66('0x12'),_0x18c864,_0x4c4eb5);_0x309af5(_0x4c4eb5);});});}exports[_0xda66('0x1a')]=function(_0x3fc171){var _0x3894a3=this;return new Promise(function(_0x4c112d,_0x428dcf){return db[_0xda66('0x1b')][_0xda66('0x1c')]({'raw':_0x3fc171[_0xda66('0x1d')]?_0x3fc171[_0xda66('0x1d')][_0xda66('0x1e')]===undefined?!![]:![]:!![],'where':_0x3fc171[_0xda66('0x1d')]?_0x3fc171[_0xda66('0x1d')][_0xda66('0x1f')]||null:null,'attributes':_0x3fc171[_0xda66('0x1d')]?_0x3fc171[_0xda66('0x1d')][_0xda66('0x20')]||null:null,'limit':_0x3fc171['options']?_0x3fc171[_0xda66('0x1d')]['limit']||null:null,'include':_0x3fc171['options']?_0x3fc171[_0xda66('0x1d')]['include']?_[_0xda66('0x21')](_0x3fc171[_0xda66('0x1d')][_0xda66('0x22')],function(_0x145434){return{'model':db[_0x145434['model']],'as':_0x145434['as'],'attributes':_0x145434['attributes'],'include':_0x145434[_0xda66('0x22')]?_[_0xda66('0x21')](_0x145434[_0xda66('0x22')],function(_0x561b45){return{'model':db[_0x561b45[_0xda66('0x23')]],'as':_0x561b45['as'],'attributes':_0x561b45[_0xda66('0x20')],'include':_0x561b45[_0xda66('0x22')]?_[_0xda66('0x21')](_0x561b45[_0xda66('0x22')],function(_0x26829a){return{'model':db[_0x26829a[_0xda66('0x23')]],'as':_0x26829a['as'],'attributes':_0x26829a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a9f60){logger[_0xda66('0x11')](_0xda66('0x1a'),_0x3fc171);logger[_0xda66('0x24')](_0xda66('0x1a'),_0x3fc171,JSON['stringify'](_0x2a9f60));_0x4c112d(_0x2a9f60);})['catch'](function(_0x4144c0){logger[_0xda66('0x15')](_0xda66('0x1a'),_0x4144c0[_0xda66('0x17')],_0x3fc171);_0x428dcf(_0x3894a3[_0xda66('0x15')](0x1f4,_0x4144c0[_0xda66('0x17')]));});});};exports[_0xda66('0x25')]=function(_0xf34e3f){var _0xe1271a=this;return new Promise(function(_0x191a5a,_0x2c53d3){return db['VoiceQueueReport'][_0xda66('0x26')](_0xf34e3f[_0xda66('0x27')],{'raw':_0xf34e3f['options']?_0xf34e3f['options'][_0xda66('0x1e')]===undefined?!![]:![]:!![]})[_0xda66('0x10')](function(_0x2cf24e){logger['info'](_0xda66('0x25'),_0xf34e3f);logger['debug'](_0xda66('0x25'),_0xf34e3f,JSON['stringify'](_0x2cf24e));_0x191a5a(_0x2cf24e);})[_0xda66('0x19')](function(_0x27d068){logger[_0xda66('0x15')](_0xda66('0x25'),_0x27d068[_0xda66('0x17')],_0xf34e3f);_0x2c53d3(_0xe1271a['error'](0x1f4,_0x27d068[_0xda66('0x17')]));});});};exports['UpdateVoiceQueueReport']=function(_0x496177){var _0x14c2aa=this;return new Promise(function(_0x16712d,_0xec3769){return db[_0xda66('0x1b')]['update'](_0x496177[_0xda66('0x27')],{'raw':_0x496177[_0xda66('0x1d')]?_0x496177['options'][_0xda66('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496177['options']?_0x496177[_0xda66('0x1d')][_0xda66('0x1f')]||null:null,'attributes':_0x496177[_0xda66('0x1d')]?_0x496177[_0xda66('0x1d')]['attributes']||null:null,'limit':_0x496177[_0xda66('0x1d')]?_0x496177[_0xda66('0x1d')][_0xda66('0x28')]||null:null})['then'](function(_0x2d7021){logger[_0xda66('0x11')](_0xda66('0x29'),_0x496177);logger[_0xda66('0x24')](_0xda66('0x29'),_0x496177,JSON[_0xda66('0x14')](_0x2d7021));_0x16712d(_0x2d7021);})['catch'](function(_0x11cd21){logger[_0xda66('0x15')](_0xda66('0x29'),_0x11cd21['message'],_0x496177);_0xec3769(_0x14c2aa[_0xda66('0x15')](0x1f4,_0x11cd21['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 005427f..3aa4c29 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 _0xa6bb=['save','remove','update','removeListener','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6bb,0x12c));var _0xba6b=function(_0x1cc539,_0x555169){_0x1cc539=_0x1cc539-0x0;var _0x5e5641=_0xa6bb[_0x1cc539];return _0x5e5641;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xba6b('0x0'),_0xba6b('0x1'),_0xba6b('0x2')];function createListener(_0x418373,_0x112efb){return function(_0x5f29e1){_0x112efb['emit'](_0x418373,_0x5f29e1);};}function removeListener(_0x5d1f87,_0x17e34b){return function(){VoiceQueueReportEvents[_0xba6b('0x3')](_0x5d1f87,_0x17e34b);};}exports[_0xba6b('0x4')]=function(_0x517d10){for(var _0x4cc381=0x0,_0x2a00d6=events[_0xba6b('0x5')];_0x4cc381<_0x2a00d6;_0x4cc381++){var _0x2f305e=events[_0x4cc381];var _0x5506d6=createListener('voiceQueueReport:'+_0x2f305e,_0x517d10);VoiceQueueReportEvents['on'](_0x2f305e,_0x5506d6);}}; \ No newline at end of file +var _0xabce=['voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x39e509,_0x5af0b8){var _0xc29ef2=function(_0x440435){while(--_0x440435){_0x39e509['push'](_0x39e509['shift']());}};_0xc29ef2(++_0x5af0b8);}(_0xabce,0x103));var _0xeabc=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xabce[_0x4bfac3];return _0x15f0f2;};'use strict';var VoiceQueueReportEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceQueueReportEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceQueueReportEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9708324..8f9f7da 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 _0x2ec2=['express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout'];(function(_0x3757f5,_0x539929){var _0x1655d0=function(_0x35f597){while(--_0x35f597){_0x3757f5['push'](_0x3757f5['shift']());}};_0x1655d0(++_0x539929);}(_0x2ec2,0xe7));var _0x22ec=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x2ec2[_0x5751e6];return _0x4199e4;};'use strict';var multer=require(_0x22ec('0x0'));var util=require('util');var path=require(_0x22ec('0x1'));var timeout=require(_0x22ec('0x2'));var express=require(_0x22ec('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x22ec('0x4'));var interaction=require(_0x22ec('0x5'));var config=require('../../config/environment');var controller=require(_0x22ec('0x6'));router[_0x22ec('0x7')]('/',auth['isAuthenticated'](),controller[_0x22ec('0x8')]);router[_0x22ec('0x7')](_0x22ec('0x9'),auth[_0x22ec('0xa')](),controller[_0x22ec('0xb')]);router[_0x22ec('0xc')]('/',auth[_0x22ec('0xa')](),controller[_0x22ec('0xd')]);router[_0x22ec('0xe')]('/:id',auth[_0x22ec('0xa')](),controller[_0x22ec('0xf')]);router[_0x22ec('0x10')](_0x22ec('0x9'),auth['isAuthenticated'](),controller[_0x22ec('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3f38=['multer','util','connect-timeout','express','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(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x3f38,0x1e4));var _0x83f3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3f38[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x83f3('0x0'));var util=require(_0x83f3('0x1'));var path=require('path');var timeout=require(_0x83f3('0x2'));var express=require(_0x83f3('0x3'));var router=express[_0x83f3('0x4')]();var fs_extra=require(_0x83f3('0x5'));var auth=require(_0x83f3('0x6'));var interaction=require(_0x83f3('0x7'));var config=require(_0x83f3('0x8'));var controller=require(_0x83f3('0x9'));router[_0x83f3('0xa')]('/',auth[_0x83f3('0xb')](),controller[_0x83f3('0xc')]);router[_0x83f3('0xa')](_0x83f3('0xd'),auth[_0x83f3('0xb')](),controller[_0x83f3('0xe')]);router[_0x83f3('0xf')]('/',auth[_0x83f3('0xb')](),controller[_0x83f3('0x10')]);router[_0x83f3('0x11')](_0x83f3('0xd'),auth[_0x83f3('0xb')](),controller[_0x83f3('0x12')]);router[_0x83f3('0x13')](_0x83f3('0xd'),auth['isAuthenticated'](),controller[_0x83f3('0x14')]);module[_0x83f3('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index afbe1ce..2317b09 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 _0xa5c4=['DATE','format','sequelize','moment','exports','STRING'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa5c4,0x18e));var _0x4a5c=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0xa5c4[_0x328bd3];return _0x458149;};'use strict';var Sequelize=require(_0x4a5c('0x0'));var moment=require(_0x4a5c('0x1'));module[_0x4a5c('0x2')]={'time':{'type':Sequelize[_0x4a5c('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x4a5c('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x4a5c('0x4')],'allowNull':![],'defaultValue':moment()[_0x4a5c('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x9dd1=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x17dd87,_0x3f44de){var _0x425590=function(_0x2c0f39){while(--_0x2c0f39){_0x17dd87['push'](_0x17dd87['shift']());}};_0x425590(++_0x3f44de);}(_0x9dd1,0x160));var _0x19dd=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0x9dd1[_0x471448];return _0x38190b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x19dd('0x0'));module[_0x19dd('0x1')]={'time':{'type':Sequelize[_0x19dd('0x2')]},'callid':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x19dd('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x19dd('0x3')],'allowNull':![],'defaultValue':moment()[_0x19dd('0x4')](_0x19dd('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c05657d..dcbde74 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 _0x771b=['catch','keys','length','find','create','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','include','rows'];(function(_0x439ab5,_0x285a6c){var _0x48f693=function(_0x3e937e){while(--_0x3e937e){_0x439ab5['push'](_0x439ab5['shift']());}};_0x48f693(++_0x285a6c);}(_0x771b,0x1ca));var _0xb771=function(_0x315544,_0x99e83b){_0x315544=_0x315544-0x0;var _0x239297=_0x771b[_0x315544];return _0x239297;};'use strict';var emlformat=require(_0xb771('0x0'));var rimraf=require(_0xb771('0x1'));var zipdir=require(_0xb771('0x2'));var jsonpatch=require(_0xb771('0x3'));var rp=require(_0xb771('0x4'));var moment=require(_0xb771('0x5'));var BPromise=require(_0xb771('0x6'));var Mustache=require(_0xb771('0x7'));var util=require(_0xb771('0x8'));var path=require(_0xb771('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb771('0xa'));var _=require(_0xb771('0xb'));var squel=require('squel');var crypto=require(_0xb771('0xc'));var jsforce=require(_0xb771('0xd'));var deskjs=require(_0xb771('0xe'));var toCsv=require(_0xb771('0xf'));var querystring=require(_0xb771('0x10'));var Papa=require(_0xb771('0x11'));var Redis=require('ioredis');var authService=require(_0xb771('0x12'));var qs=require(_0xb771('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb771('0x14'));var logger=require(_0xb771('0x15'))(_0xb771('0x16'));var utils=require(_0xb771('0x17'));var config=require(_0xb771('0x18'));var licenseUtil=require(_0xb771('0x19'));var db=require(_0xb771('0x1a'))['db'];function respondWithStatusCode(_0x4a2822,_0x4bfb2f){_0x4bfb2f=_0x4bfb2f||0xcc;return function(_0x3ceccf){if(_0x3ceccf){return _0x4a2822[_0xb771('0x1b')](_0x4bfb2f);}return _0x4a2822[_0xb771('0x1c')](_0x4bfb2f)['end']();};}function respondWithResult(_0x85cdad,_0x41b48e){_0x41b48e=_0x41b48e||0xc8;return function(_0x3c158e){if(_0x3c158e){return _0x85cdad['status'](_0x41b48e)[_0xb771('0x1d')](_0x3c158e);}};}function respondWithFilteredResult(_0x33e7e1,_0x1c0d28){return function(_0x2f7090){if(_0x2f7090){var _0x199b51=typeof _0x1c0d28[_0xb771('0x1e')]===_0xb771('0x1f')&&typeof _0x1c0d28[_0xb771('0x20')]===_0xb771('0x1f');var _0x4c2c74=_0x2f7090[_0xb771('0x21')];var _0x916e12=_0x199b51?0x0:_0x1c0d28[_0xb771('0x1e')];var _0x202fac=_0x199b51?_0x2f7090['count']:_0x1c0d28[_0xb771('0x1e')]+_0x1c0d28[_0xb771('0x20')];var _0x4f223d;if(_0x202fac>=_0x4c2c74){_0x202fac=_0x4c2c74;_0x4f223d=0xc8;}else{_0x4f223d=0xce;}_0x33e7e1['status'](_0x4f223d);return _0x33e7e1['set'](_0xb771('0x22'),_0x916e12+'-'+_0x202fac+'/'+_0x4c2c74)['json'](_0x2f7090);}return null;};}function patchUpdates(_0x12f518){return function(_0x45528b){try{jsonpatch[_0xb771('0x23')](_0x45528b,_0x12f518,!![]);}catch(_0x24e567){return BPromise['reject'](_0x24e567);}return _0x45528b[_0xb771('0x24')]();};}function saveUpdates(_0x2e1bae,_0x55c1f9){return function(_0x3f83ff){if(_0x3f83ff){return _0x3f83ff[_0xb771('0x25')](_0x2e1bae)[_0xb771('0x26')](function(_0xb897dc){return _0xb897dc;});}return null;};}function removeEntity(_0x345764,_0x1088b2){return function(_0x59891e){if(_0x59891e){return _0x59891e['destroy']()[_0xb771('0x26')](function(){_0x345764[_0xb771('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35a704,_0x5c0aa9){return function(_0x1f46b9){if(!_0x1f46b9){_0x35a704[_0xb771('0x1b')](0x194);}return _0x1f46b9;};}function handleError(_0x7eaede,_0x50d45e){_0x50d45e=_0x50d45e||0x1f4;return function(_0xbf466e){logger[_0xb771('0x27')](_0xbf466e[_0xb771('0x28')]);if(_0xbf466e[_0xb771('0x29')]){delete _0xbf466e[_0xb771('0x29')];}_0x7eaede[_0xb771('0x1c')](_0x50d45e)[_0xb771('0x2a')](_0xbf466e);};}exports[_0xb771('0x2b')]=function(_0x38b0af,_0xd0ef61){var _0x2c02e3={},_0x4678b5={},_0x40ac44={'count':0x0,'rows':[]};var _0x5a4997=_[_0xb771('0x2c')](db[_0xb771('0x2d')][_0xb771('0x2e')],function(_0x135a6d){return{'name':_0x135a6d[_0xb771('0x2f')],'type':_0x135a6d[_0xb771('0x30')][_0xb771('0x31')]};});_0x4678b5[_0xb771('0x32')]=_[_0xb771('0x2c')](_0x5a4997,'name');_0x4678b5[_0xb771('0x33')]=_['keys'](_0x38b0af[_0xb771('0x33')]);_0x4678b5[_0xb771('0x34')]=_[_0xb771('0x35')](_0x4678b5[_0xb771('0x32')],_0x4678b5[_0xb771('0x33')]);_0x2c02e3[_0xb771('0x36')]=_[_0xb771('0x35')](_0x4678b5[_0xb771('0x32')],qs[_0xb771('0x37')](_0x38b0af[_0xb771('0x33')]['fields']));_0x2c02e3[_0xb771('0x36')]=_0x2c02e3['attributes']['length']?_0x2c02e3['attributes']:_0x4678b5['model'];if(!_0x38b0af['query'][_0xb771('0x38')](_0xb771('0x39'))){_0x2c02e3[_0xb771('0x20')]=qs[_0xb771('0x20')](_0x38b0af[_0xb771('0x33')][_0xb771('0x20')]);_0x2c02e3[_0xb771('0x1e')]=qs[_0xb771('0x1e')](_0x38b0af[_0xb771('0x33')][_0xb771('0x1e')]);}_0x2c02e3[_0xb771('0x3a')]=qs[_0xb771('0x3b')](_0x38b0af[_0xb771('0x33')]['sort']);_0x2c02e3['where']=qs[_0xb771('0x34')](_[_0xb771('0x3c')](_0x38b0af[_0xb771('0x33')],_0x4678b5[_0xb771('0x34')]),_0x5a4997);if(_0x38b0af[_0xb771('0x33')]['filter']){_0x2c02e3[_0xb771('0x3d')]=_[_0xb771('0x3e')](_0x2c02e3[_0xb771('0x3d')],{'$or':_[_0xb771('0x2c')](_0x5a4997,function(_0x381ab8){if(_0x381ab8[_0xb771('0x30')]!=='VIRTUAL'){var _0x50bddc={};_0x50bddc[_0x381ab8[_0xb771('0x29')]]={'$like':'%'+_0x38b0af[_0xb771('0x33')]['filter']+'%'};return _0x50bddc;}})});}_0x2c02e3=_['merge']({},_0x2c02e3,_0x38b0af[_0xb771('0x3f')]);var _0xdf8cb8={'where':_0x2c02e3['where']};return db[_0xb771('0x2d')][_0xb771('0x21')](_0xdf8cb8)[_0xb771('0x26')](function(_0x5728d7){_0x40ac44[_0xb771('0x21')]=_0x5728d7;if(_0x38b0af['query'][_0xb771('0x40')]){_0x2c02e3[_0xb771('0x41')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x2c02e3);})[_0xb771('0x26')](function(_0x267474){_0x40ac44[_0xb771('0x42')]=_0x267474;return _0x40ac44;})['then'](respondWithFilteredResult(_0xd0ef61,_0x2c02e3))[_0xb771('0x43')](handleError(_0xd0ef61,null));};exports['show']=function(_0x92b369,_0x5876d4){var _0x174f2c={'raw':!![],'where':{'id':_0x92b369['params']['id']}},_0x6306fd={};_0x6306fd[_0xb771('0x32')]=_['keys'](db[_0xb771('0x2d')][_0xb771('0x2e')]);_0x6306fd[_0xb771('0x33')]=_[_0xb771('0x44')](_0x92b369[_0xb771('0x33')]);_0x6306fd[_0xb771('0x34')]=_[_0xb771('0x35')](_0x6306fd[_0xb771('0x32')],_0x6306fd['query']);_0x174f2c[_0xb771('0x36')]=_[_0xb771('0x35')](_0x6306fd['model'],qs[_0xb771('0x37')](_0x92b369[_0xb771('0x33')][_0xb771('0x37')]));_0x174f2c[_0xb771('0x36')]=_0x174f2c[_0xb771('0x36')][_0xb771('0x45')]?_0x174f2c[_0xb771('0x36')]:_0x6306fd[_0xb771('0x32')];if(_0x92b369[_0xb771('0x33')][_0xb771('0x40')]){_0x174f2c[_0xb771('0x41')]=[{'all':!![]}];}_0x174f2c=_['merge']({},_0x174f2c,_0x92b369[_0xb771('0x3f')]);return db[_0xb771('0x2d')][_0xb771('0x46')](_0x174f2c)[_0xb771('0x26')](handleEntityNotFound(_0x5876d4,null))['then'](respondWithResult(_0x5876d4,null))['catch'](handleError(_0x5876d4,null));};exports['create']=function(_0x3209d0,_0x55554b){return db[_0xb771('0x2d')][_0xb771('0x47')](_0x3209d0[_0xb771('0x48')],{})[_0xb771('0x26')](respondWithResult(_0x55554b,0xc9))[_0xb771('0x43')](handleError(_0x55554b,null));};exports['update']=function(_0x269beb,_0x159683){if(_0x269beb[_0xb771('0x48')]['id']){delete _0x269beb[_0xb771('0x48')]['id'];}return db['VoiceQueuesLog'][_0xb771('0x46')]({'where':{'id':_0x269beb['params']['id']}})['then'](handleEntityNotFound(_0x159683,null))[_0xb771('0x26')](saveUpdates(_0x269beb['body'],null))[_0xb771('0x26')](respondWithResult(_0x159683,null))['catch'](handleError(_0x159683,null));};exports[_0xb771('0x49')]=function(_0x4dc454,_0x25bcbd){return db[_0xb771('0x2d')][_0xb771('0x46')]({'where':{'id':_0x4dc454[_0xb771('0x4a')]['id']}})[_0xb771('0x26')](handleEntityNotFound(_0x25bcbd,null))[_0xb771('0x26')](removeEntity(_0x25bcbd,null))[_0xb771('0x43')](handleError(_0x25bcbd,null));}; \ No newline at end of file +var _0x0724=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VoiceQueuesLog','includeAll','include','findAll','catch','show','params','keys','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x0724,0x144));var _0x4072=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0724[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x4072('0x0'));var rimraf=require(_0x4072('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4072('0x2'));var rp=require(_0x4072('0x3'));var moment=require('moment');var BPromise=require(_0x4072('0x4'));var Mustache=require(_0x4072('0x5'));var util=require(_0x4072('0x6'));var path=require('path');var sox=require(_0x4072('0x7'));var csv=require(_0x4072('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4072('0x9'));var _=require(_0x4072('0xa'));var squel=require(_0x4072('0xb'));var crypto=require(_0x4072('0xc'));var jsforce=require(_0x4072('0xd'));var deskjs=require(_0x4072('0xe'));var toCsv=require(_0x4072('0x8'));var querystring=require(_0x4072('0xf'));var Papa=require(_0x4072('0x10'));var Redis=require('ioredis');var authService=require(_0x4072('0x11'));var qs=require(_0x4072('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4072('0x13'));var logger=require(_0x4072('0x14'))(_0x4072('0x15'));var utils=require('../../config/utils');var config=require(_0x4072('0x16'));var licenseUtil=require(_0x4072('0x17'));var db=require(_0x4072('0x18'))['db'];function respondWithStatusCode(_0x529ac0,_0x30776d){_0x30776d=_0x30776d||0xcc;return function(_0x458629){if(_0x458629){return _0x529ac0[_0x4072('0x19')](_0x30776d);}return _0x529ac0['status'](_0x30776d)['end']();};}function respondWithResult(_0x1440e7,_0x311241){_0x311241=_0x311241||0xc8;return function(_0xae6e61){if(_0xae6e61){return _0x1440e7[_0x4072('0x1a')](_0x311241)[_0x4072('0x1b')](_0xae6e61);}};}function respondWithFilteredResult(_0x3d490e,_0x4599b6){return function(_0xb6b4f2){if(_0xb6b4f2){var _0xfc3377=typeof _0x4599b6['offset']==='undefined'&&typeof _0x4599b6[_0x4072('0x1c')]===_0x4072('0x1d');var _0xe78c82=_0xb6b4f2[_0x4072('0x1e')];var _0x384c25=_0xfc3377?0x0:_0x4599b6[_0x4072('0x1f')];var _0x2d6491=_0xfc3377?_0xb6b4f2[_0x4072('0x1e')]:_0x4599b6[_0x4072('0x1f')]+_0x4599b6['limit'];var _0x574cd3;if(_0x2d6491>=_0xe78c82){_0x2d6491=_0xe78c82;_0x574cd3=0xc8;}else{_0x574cd3=0xce;}_0x3d490e[_0x4072('0x1a')](_0x574cd3);return _0x3d490e[_0x4072('0x20')]('Content-Range',_0x384c25+'-'+_0x2d6491+'/'+_0xe78c82)[_0x4072('0x1b')](_0xb6b4f2);}return null;};}function patchUpdates(_0x201e65){return function(_0x438869){try{jsonpatch[_0x4072('0x21')](_0x438869,_0x201e65,!![]);}catch(_0x1b0849){return BPromise[_0x4072('0x22')](_0x1b0849);}return _0x438869[_0x4072('0x23')]();};}function saveUpdates(_0x26c6f9,_0x109761){return function(_0x14acc9){if(_0x14acc9){return _0x14acc9[_0x4072('0x24')](_0x26c6f9)[_0x4072('0x25')](function(_0x2934b2){return _0x2934b2;});}return null;};}function removeEntity(_0x5457e6,_0x5a1939){return function(_0x202cb1){if(_0x202cb1){return _0x202cb1[_0x4072('0x26')]()[_0x4072('0x25')](function(){_0x5457e6[_0x4072('0x1a')](0xcc)[_0x4072('0x27')]();});}};}function handleEntityNotFound(_0x57e8c0,_0x474f55){return function(_0x2af1b8){if(!_0x2af1b8){_0x57e8c0['sendStatus'](0x194);}return _0x2af1b8;};}function handleError(_0x1c05b6,_0x2a127c){_0x2a127c=_0x2a127c||0x1f4;return function(_0x2b0850){logger[_0x4072('0x28')](_0x2b0850['stack']);if(_0x2b0850[_0x4072('0x29')]){delete _0x2b0850[_0x4072('0x29')];}_0x1c05b6[_0x4072('0x1a')](_0x2a127c)[_0x4072('0x2a')](_0x2b0850);};}exports[_0x4072('0x2b')]=function(_0x24bed9,_0x57441d){var _0x4cc9c6={},_0x44379d={},_0x2c0c53={'count':0x0,'rows':[]};var _0xa75f7e=_[_0x4072('0x2c')](db['VoiceQueuesLog'][_0x4072('0x2d')],function(_0x5c1b78){return{'name':_0x5c1b78[_0x4072('0x2e')],'type':_0x5c1b78[_0x4072('0x2f')][_0x4072('0x30')]};});_0x44379d[_0x4072('0x31')]=_[_0x4072('0x2c')](_0xa75f7e,_0x4072('0x29'));_0x44379d[_0x4072('0x32')]=_['keys'](_0x24bed9[_0x4072('0x32')]);_0x44379d[_0x4072('0x33')]=_[_0x4072('0x34')](_0x44379d['model'],_0x44379d['query']);_0x4cc9c6['attributes']=_['intersection'](_0x44379d[_0x4072('0x31')],qs[_0x4072('0x35')](_0x24bed9[_0x4072('0x32')][_0x4072('0x35')]));_0x4cc9c6[_0x4072('0x36')]=_0x4cc9c6[_0x4072('0x36')][_0x4072('0x37')]?_0x4cc9c6['attributes']:_0x44379d[_0x4072('0x31')];if(!_0x24bed9[_0x4072('0x32')][_0x4072('0x38')]('nolimit')){_0x4cc9c6[_0x4072('0x1c')]=qs[_0x4072('0x1c')](_0x24bed9[_0x4072('0x32')]['limit']);_0x4cc9c6['offset']=qs[_0x4072('0x1f')](_0x24bed9['query'][_0x4072('0x1f')]);}_0x4cc9c6[_0x4072('0x39')]=qs[_0x4072('0x3a')](_0x24bed9[_0x4072('0x32')][_0x4072('0x3a')]);_0x4cc9c6['where']=qs['filters'](_['pick'](_0x24bed9[_0x4072('0x32')],_0x44379d['filters']),_0xa75f7e);if(_0x24bed9[_0x4072('0x32')][_0x4072('0x3b')]){_0x4cc9c6['where']=_['merge'](_0x4cc9c6[_0x4072('0x3c')],{'$or':_[_0x4072('0x2c')](_0xa75f7e,function(_0x6496a8){if(_0x6496a8[_0x4072('0x2f')]!=='VIRTUAL'){var _0x125a0f={};_0x125a0f[_0x6496a8['name']]={'$like':'%'+_0x24bed9['query'][_0x4072('0x3b')]+'%'};return _0x125a0f;}})});}_0x4cc9c6=_[_0x4072('0x3d')]({},_0x4cc9c6,_0x24bed9['options']);var _0x1106f6={'where':_0x4cc9c6[_0x4072('0x3c')]};return db[_0x4072('0x3e')][_0x4072('0x1e')](_0x1106f6)[_0x4072('0x25')](function(_0x197b89){_0x2c0c53[_0x4072('0x1e')]=_0x197b89;if(_0x24bed9['query'][_0x4072('0x3f')]){_0x4cc9c6[_0x4072('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x4072('0x41')](_0x4cc9c6);})['then'](function(_0x596771){_0x2c0c53['rows']=_0x596771;return _0x2c0c53;})[_0x4072('0x25')](respondWithFilteredResult(_0x57441d,_0x4cc9c6))[_0x4072('0x42')](handleError(_0x57441d,null));};exports[_0x4072('0x43')]=function(_0x36b401,_0x37fcab){var _0x178ec8={'raw':!![],'where':{'id':_0x36b401[_0x4072('0x44')]['id']}},_0x100bfe={};_0x100bfe[_0x4072('0x31')]=_[_0x4072('0x45')](db[_0x4072('0x3e')][_0x4072('0x2d')]);_0x100bfe[_0x4072('0x32')]=_['keys'](_0x36b401['query']);_0x100bfe[_0x4072('0x33')]=_['intersection'](_0x100bfe[_0x4072('0x31')],_0x100bfe[_0x4072('0x32')]);_0x178ec8[_0x4072('0x36')]=_[_0x4072('0x34')](_0x100bfe[_0x4072('0x31')],qs['fields'](_0x36b401[_0x4072('0x32')][_0x4072('0x35')]));_0x178ec8['attributes']=_0x178ec8[_0x4072('0x36')]['length']?_0x178ec8['attributes']:_0x100bfe['model'];if(_0x36b401[_0x4072('0x32')][_0x4072('0x3f')]){_0x178ec8[_0x4072('0x40')]=[{'all':!![]}];}_0x178ec8=_[_0x4072('0x3d')]({},_0x178ec8,_0x36b401[_0x4072('0x46')]);return db[_0x4072('0x3e')]['find'](_0x178ec8)[_0x4072('0x25')](handleEntityNotFound(_0x37fcab,null))[_0x4072('0x25')](respondWithResult(_0x37fcab,null))['catch'](handleError(_0x37fcab,null));};exports[_0x4072('0x47')]=function(_0xa086b9,_0x4d6121){return db[_0x4072('0x3e')]['create'](_0xa086b9[_0x4072('0x48')],{})[_0x4072('0x25')](respondWithResult(_0x4d6121,0xc9))[_0x4072('0x42')](handleError(_0x4d6121,null));};exports[_0x4072('0x24')]=function(_0x2f75ee,_0x5a892f){if(_0x2f75ee[_0x4072('0x48')]['id']){delete _0x2f75ee[_0x4072('0x48')]['id'];}return db[_0x4072('0x3e')][_0x4072('0x49')]({'where':{'id':_0x2f75ee['params']['id']}})[_0x4072('0x25')](handleEntityNotFound(_0x5a892f,null))[_0x4072('0x25')](saveUpdates(_0x2f75ee[_0x4072('0x48')],null))[_0x4072('0x25')](respondWithResult(_0x5a892f,null))[_0x4072('0x42')](handleError(_0x5a892f,null));};exports[_0x4072('0x26')]=function(_0x54cd99,_0x1196bc){return db[_0x4072('0x3e')]['find']({'where':{'id':_0x54cd99['params']['id']}})[_0x4072('0x25')](handleEntityNotFound(_0x1196bc,null))[_0x4072('0x25')](removeEntity(_0x1196bc,null))['catch'](handleError(_0x1196bc,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 115a2d7..a647981 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 _0xd8a1=['../../config/environment','exports','define','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd8a1,0x111));var _0x1d8a=function(_0x37e5e9,_0xd16cb2){_0x37e5e9=_0x37e5e9-0x0;var _0x1361a0=_0xd8a1[_0x37e5e9];return _0x1361a0;};'use strict';var _=require(_0x1d8a('0x0'));var util=require(_0x1d8a('0x1'));var logger=require(_0x1d8a('0x2'))('api');var moment=require(_0x1d8a('0x3'));var BPromise=require(_0x1d8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d8a('0x5'));var rimraf=require(_0x1d8a('0x6'));var config=require(_0x1d8a('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x1d8a('0x8')]=function(_0x18f057,_0x3d7b2c){return _0x18f057[_0x1d8a('0x9')]('VoiceQueuesLog',attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x065e=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','moment','path','rimraf','exports','define'];(function(_0x20d75f,_0x48616a){var _0x1942d3=function(_0x320876){while(--_0x320876){_0x20d75f['push'](_0x20d75f['shift']());}};_0x1942d3(++_0x48616a);}(_0x065e,0xbb));var _0xe065=function(_0x31ad21,_0x36178f){_0x31ad21=_0x31ad21-0x0;var _0x2a5bcf=_0x065e[_0x31ad21];return _0x2a5bcf;};'use strict';var _=require(_0xe065('0x0'));var util=require(_0xe065('0x1'));var logger=require(_0xe065('0x2'))('api');var moment=require(_0xe065('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe065('0x4'));var rimraf=require(_0xe065('0x5'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0xe065('0x6')]=function(_0x5d04be,_0x506ef3){return _0x5d04be[_0xe065('0x7')](_0xe065('0x8'),attributes,{'tableName':_0xe065('0x9'),'paranoid':![],'indexes':[{'name':_0xe065('0xa'),'fields':[_0xe065('0xb'),_0xe065('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index f88f0cb..2cc9861 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 _0x68fc=['stringify','error','code','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa827a,_0x4b56e8){var _0x130952=function(_0x3a585b){while(--_0x3a585b){_0xa827a['push'](_0xa827a['shift']());}};_0x130952(++_0x4b56e8);}(_0x68fc,0xa5));var _0xc68f=function(_0x597bbc,_0x4806a2){_0x597bbc=_0x597bbc-0x0;var _0x56a9a4=_0x68fc[_0x597bbc];return _0x56a9a4;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});} \ No newline at end of file +var _0x28f3=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20fb4d,_0x506ef2){var _0x25bfd2=function(_0x3bea88){while(--_0x3bea88){_0x20fb4d['push'](_0x20fb4d['shift']());}};_0x25bfd2(++_0x506ef2);}(_0x28f3,0x9d));var _0x328f=function(_0x118e20,_0xae3d36){_0x118e20=_0x118e20-0x0;var _0x49ea16=_0x28f3[_0x118e20];return _0x49ea16;};'use strict';var _=require(_0x328f('0x0'));var util=require(_0x328f('0x1'));var moment=require('moment');var BPromise=require(_0x328f('0x2'));var rs=require(_0x328f('0x3'));var fs=require('fs');var Redis=require(_0x328f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x328f('0x5'));var config=require(_0x328f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x328f('0x7')][_0x328f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fb66c,_0x254912,_0x4b30ef){return new BPromise(function(_0x46552e,_0x1311c){return client[_0x328f('0x9')](_0x2fb66c,_0x4b30ef)[_0x328f('0xa')](function(_0x4c9eb6){logger[_0x328f('0xb')](_0x328f('0xc'),_0x254912,_0x328f('0xd'));logger[_0x328f('0xe')](_0x328f('0xf'),_0x254912,'request\x20sent',JSON[_0x328f('0x10')](_0x4c9eb6));if(_0x4c9eb6[_0x328f('0x11')]){if(_0x4c9eb6['error'][_0x328f('0x12')]===0x1f4){logger[_0x328f('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x254912,_0x4c9eb6[_0x328f('0x11')]['message']);return _0x1311c(_0x4c9eb6[_0x328f('0x11')][_0x328f('0x13')]);}logger[_0x328f('0x11')](_0x328f('0xc'),_0x254912,_0x4c9eb6[_0x328f('0x11')][_0x328f('0x13')]);return _0x46552e(_0x4c9eb6[_0x328f('0x11')][_0x328f('0x13')]);}else{logger[_0x328f('0xb')](_0x328f('0xc'),_0x254912,_0x328f('0xd'));_0x46552e(_0x4c9eb6[_0x328f('0x14')][_0x328f('0x13')]);}})[_0x328f('0x15')](function(_0x384ef4){logger['error'](_0x328f('0xc'),_0x254912,_0x384ef4);_0x1311c(_0x384ef4);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7b7ffd1..bf881ec 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 _0xb404=['../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service'];(function(_0x3b1238,_0x59d566){var _0x4ca35a=function(_0x342667){while(--_0x342667){_0x3b1238['push'](_0x3b1238['shift']());}};_0x4ca35a(++_0x59d566);}(_0xb404,0xf5));var _0x4b40=function(_0x3717ee,_0x182e24){_0x3717ee=_0x3717ee-0x0;var _0x383065=_0xb404[_0x3717ee];return _0x383065;};'use strict';var multer=require(_0x4b40('0x0'));var util=require(_0x4b40('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4b40('0x2')]();var fs_extra=require(_0x4b40('0x3'));var auth=require(_0x4b40('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4b40('0x5'));var controller=require(_0x4b40('0x6'));router[_0x4b40('0x7')]('/',auth[_0x4b40('0x8')](),controller[_0x4b40('0x9')]);router[_0x4b40('0x7')](_0x4b40('0xa'),auth[_0x4b40('0x8')](),controller[_0x4b40('0xb')]);router[_0x4b40('0x7')](_0x4b40('0xc'),auth[_0x4b40('0x8')](),controller[_0x4b40('0xd')]);router[_0x4b40('0x7')](_0x4b40('0xe'),auth[_0x4b40('0x8')](),controller[_0x4b40('0xf')]);router[_0x4b40('0x7')](_0x4b40('0x10'),controller[_0x4b40('0x11')]);router[_0x4b40('0x7')](_0x4b40('0x12'),auth['isAuthenticated'](),controller[_0x4b40('0x13')]);router['post']('/',auth[_0x4b40('0x8')](),controller['create']);router[_0x4b40('0x14')]('/:id/transcribe',auth[_0x4b40('0x8')](),controller[_0x4b40('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4b40('0x16')]);router['delete'](_0x4b40('0xc'),auth[_0x4b40('0x8')](),controller[_0x4b40('0x17')]);module[_0x4b40('0x18')]=router; \ No newline at end of file +var _0xa684=['downloads','/:id/transcribe','downloadTranscribe','post','create','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/downloads'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa684,0xbc));var _0x4a68=function(_0x468749,_0x472291){_0x468749=_0x468749-0x0;var _0x5d0b33=_0xa684[_0x468749];return _0x5d0b33;};'use strict';var multer=require('multer');var util=require(_0x4a68('0x0'));var path=require('path');var timeout=require(_0x4a68('0x1'));var express=require(_0x4a68('0x2'));var router=express['Router']();var fs_extra=require(_0x4a68('0x3'));var auth=require(_0x4a68('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x4a68('0x5')]('/',auth[_0x4a68('0x6')](),controller['index']);router[_0x4a68('0x5')](_0x4a68('0x7'),auth[_0x4a68('0x6')](),controller[_0x4a68('0x8')]);router[_0x4a68('0x5')](_0x4a68('0x9'),auth[_0x4a68('0x6')](),controller[_0x4a68('0xa')]);router[_0x4a68('0x5')]('/:id/download',auth[_0x4a68('0x6')](),controller['download']);router[_0x4a68('0x5')](_0x4a68('0xb'),controller[_0x4a68('0xc')]);router[_0x4a68('0x5')](_0x4a68('0xd'),auth[_0x4a68('0x6')](),controller[_0x4a68('0xe')]);router[_0x4a68('0xf')]('/',auth[_0x4a68('0x6')](),controller[_0x4a68('0x10')]);router[_0x4a68('0xf')](_0x4a68('0xd'),auth['isAuthenticated'](),controller['runTranscribe']);router['put'](_0x4a68('0x9'),auth['isAuthenticated'](),controller[_0x4a68('0x11')]);router[_0x4a68('0x12')](_0x4a68('0x9'),auth[_0x4a68('0x6')](),controller[_0x4a68('0x13')]);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 10c046f..a127bc5 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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 6456763..5694d38 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 _0x85a1=['params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','col','token','$and','push','isNil','Entity\x20not\x20found','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','info','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','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','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeAccountId','language','Sequelize','ValidationError','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','type','differenceBy','format','query','keys','filters','attributes','model','fields','length','nolimit','order','where','filter','merge','options','VoiceRecording','includeAll','include','findAll','catch','show','intersection','find','create','body'];(function(_0x33d103,_0x487546){var _0x40a631=function(_0x316157){while(--_0x316157){_0x33d103['push'](_0x33d103['shift']());}};_0x40a631(++_0x487546);}(_0x85a1,0x17b));var _0x185a=function(_0x47169a,_0x14a3d9){_0x47169a=_0x47169a-0x0;var _0x44553e=_0x85a1[_0x47169a];return _0x44553e;};'use strict';var emlformat=require(_0x185a('0x0'));var rimraf=require(_0x185a('0x1'));var zipdir=require(_0x185a('0x2'));var jsonpatch=require(_0x185a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x185a('0x4'));var Mustache=require(_0x185a('0x5'));var util=require(_0x185a('0x6'));var path=require(_0x185a('0x7'));var sox=require(_0x185a('0x8'));var csv=require(_0x185a('0x9'));var ejs=require(_0x185a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x185a('0xb'));var squel=require(_0x185a('0xc'));var crypto=require(_0x185a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x185a('0xe'));var toCsv=require(_0x185a('0x9'));var querystring=require(_0x185a('0xf'));var Papa=require(_0x185a('0x10'));var AWS=require(_0x185a('0x11'));var uuidv4=require(_0x185a('0x12'));var Redis=require(_0x185a('0x13'));var authService=require(_0x185a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x185a('0x15'));var hardwareService=require(_0x185a('0x16'));var logger=require(_0x185a('0x17'))(_0x185a('0x18'));var utils=require('../../config/utils');var config=require(_0x185a('0x19'));var licenseUtil=require(_0x185a('0x1a'));var db=require(_0x185a('0x1b'))['db'];function respondWithStatusCode(_0x38a3d6,_0x2fde89){_0x2fde89=_0x2fde89||0xcc;return function(_0x3342c5){if(_0x3342c5){return _0x38a3d6['sendStatus'](_0x2fde89);}return _0x38a3d6[_0x185a('0x1c')](_0x2fde89)['end']();};}function respondWithResult(_0x20e8a1,_0x1c58eb){_0x1c58eb=_0x1c58eb||0xc8;return function(_0x1b3af5){if(_0x1b3af5){return _0x20e8a1[_0x185a('0x1c')](_0x1c58eb)['json'](_0x1b3af5);}};}function respondWithFilteredResult(_0x2d5567,_0x10cbc4){return function(_0x418790){if(_0x418790){var _0x35d134=typeof _0x10cbc4[_0x185a('0x1d')]===_0x185a('0x1e')&&typeof _0x10cbc4[_0x185a('0x1f')]===_0x185a('0x1e');var _0x2dceec=_0x418790[_0x185a('0x20')];var _0x2879ed=_0x35d134?0x0:_0x10cbc4[_0x185a('0x1d')];var _0x52c8c2=_0x35d134?_0x418790[_0x185a('0x20')]:_0x10cbc4[_0x185a('0x1d')]+_0x10cbc4['limit'];var _0x2432ca;if(_0x52c8c2>=_0x2dceec){_0x52c8c2=_0x2dceec;_0x2432ca=0xc8;}else{_0x2432ca=0xce;}_0x2d5567[_0x185a('0x1c')](_0x2432ca);return _0x2d5567['set'](_0x185a('0x21'),_0x2879ed+'-'+_0x52c8c2+'/'+_0x2dceec)[_0x185a('0x22')](_0x418790);}return null;};}function patchUpdates(_0x4237a3){return function(_0x42db48){try{jsonpatch[_0x185a('0x23')](_0x42db48,_0x4237a3,!![]);}catch(_0x1d8904){return BPromise[_0x185a('0x24')](_0x1d8904);}return _0x42db48['save']();};}function saveUpdates(_0x3a3b97,_0x45a190){return function(_0x1c30fb){if(_0x1c30fb){return _0x1c30fb[_0x185a('0x25')](_0x3a3b97)[_0x185a('0x26')](function(_0x2566cb){return _0x2566cb;});}return null;};}function removeEntity(_0x588d29,_0x426a66){return function(_0x37480c){if(_0x37480c){return _0x37480c[_0x185a('0x27')]()[_0x185a('0x26')](function(){_0x588d29[_0x185a('0x1c')](0xcc)[_0x185a('0x28')]();});}};}function handleEntityNotFound(_0x4e267c,_0x3ffed4){return function(_0x6480ce){if(!_0x6480ce){_0x4e267c[_0x185a('0x29')](0x194);}return _0x6480ce;};}function handleError(_0x17dba3,_0x11c987){_0x11c987=_0x11c987||0x1f4;return function(_0x30c4d0){logger[_0x185a('0x2a')](_0x30c4d0[_0x185a('0x2b')]);if(_0x30c4d0[_0x185a('0x2c')]){delete _0x30c4d0[_0x185a('0x2c')];}_0x17dba3[_0x185a('0x1c')](_0x11c987)[_0x185a('0x2d')](_0x30c4d0);};}exports['index']=function(_0x173ad6,_0x25a0e1){var _0x243fdb={},_0x56be4a={},_0x30706f={'count':0x0,'rows':[]};var _0x5b8f08=_[_0x185a('0x2e')](db['VoiceRecording'][_0x185a('0x2f')],function(_0x275ed9){return{'name':_0x275ed9['fieldName'],'type':_0x275ed9[_0x185a('0x30')]['key']};});_0x56be4a['model']=_[_0x185a('0x31')](_['map'](_0x5b8f08,_0x185a('0x2c')),[_0x185a('0x32')]);_0x56be4a[_0x185a('0x33')]=_[_0x185a('0x34')](_0x173ad6['query']);_0x56be4a[_0x185a('0x35')]=_['intersection'](_0x56be4a['model'],_0x56be4a['query']);_0x243fdb[_0x185a('0x36')]=_['intersection'](_0x56be4a[_0x185a('0x37')],qs[_0x185a('0x38')](_0x173ad6[_0x185a('0x33')][_0x185a('0x38')]));_0x243fdb['attributes']=_0x243fdb[_0x185a('0x36')][_0x185a('0x39')]?_0x243fdb[_0x185a('0x36')]:_0x56be4a[_0x185a('0x37')];if(!_0x173ad6[_0x185a('0x33')]['hasOwnProperty'](_0x185a('0x3a'))){_0x243fdb[_0x185a('0x1f')]=qs['limit'](_0x173ad6[_0x185a('0x33')][_0x185a('0x1f')]);_0x243fdb[_0x185a('0x1d')]=qs['offset'](_0x173ad6[_0x185a('0x33')][_0x185a('0x1d')]);}_0x243fdb[_0x185a('0x3b')]=qs['sort'](_0x173ad6['query']['sort']);_0x243fdb[_0x185a('0x3c')]=qs[_0x185a('0x35')](_['pick'](_0x173ad6[_0x185a('0x33')],_0x56be4a[_0x185a('0x35')]),_0x5b8f08);if(_0x173ad6[_0x185a('0x33')][_0x185a('0x3d')]){_0x243fdb[_0x185a('0x3c')]=_[_0x185a('0x3e')](_0x243fdb['where'],{'$or':_[_0x185a('0x2e')](_0x5b8f08,function(_0x301459){if(_0x301459[_0x185a('0x30')]!=='VIRTUAL'){var _0x64926d={};_0x64926d[_0x301459[_0x185a('0x2c')]]={'$like':'%'+_0x173ad6[_0x185a('0x33')][_0x185a('0x3d')]+'%'};return _0x64926d;}})});}_0x243fdb=_['merge']({},_0x243fdb,_0x173ad6[_0x185a('0x3f')]);var _0x4afd83={'where':_0x243fdb[_0x185a('0x3c')]};return db[_0x185a('0x40')][_0x185a('0x20')](_0x4afd83)[_0x185a('0x26')](function(_0x3f7ae6){_0x30706f[_0x185a('0x20')]=_0x3f7ae6;if(_0x173ad6[_0x185a('0x33')][_0x185a('0x41')]){_0x243fdb[_0x185a('0x42')]=[{'all':!![]}];}return db[_0x185a('0x40')][_0x185a('0x43')](_0x243fdb);})[_0x185a('0x26')](function(_0x186cc4){_0x30706f['rows']=_0x186cc4;return _0x30706f;})['then'](respondWithFilteredResult(_0x25a0e1,_0x243fdb))[_0x185a('0x44')](handleError(_0x25a0e1,null));};exports[_0x185a('0x45')]=function(_0x46dc3b,_0x291f37){var _0x32205f={'raw':![],'where':{'id':_0x46dc3b['params']['id']}},_0x694d19={};_0x694d19[_0x185a('0x37')]=_[_0x185a('0x34')](db[_0x185a('0x40')][_0x185a('0x2f')]);_0x694d19[_0x185a('0x33')]=_[_0x185a('0x34')](_0x46dc3b['query']);_0x694d19[_0x185a('0x35')]=_[_0x185a('0x46')](_0x694d19['model'],_0x694d19[_0x185a('0x33')]);_0x32205f['attributes']=_['intersection'](_0x694d19[_0x185a('0x37')],qs[_0x185a('0x38')](_0x46dc3b['query'][_0x185a('0x38')]));_0x32205f['attributes']=_0x32205f[_0x185a('0x36')][_0x185a('0x39')]?_0x32205f['attributes']:_0x694d19[_0x185a('0x37')];if(_0x46dc3b['query'][_0x185a('0x41')]){_0x32205f[_0x185a('0x42')]=[{'all':!![]}];}_0x32205f=_[_0x185a('0x3e')]({},_0x32205f,_0x46dc3b[_0x185a('0x3f')]);return db[_0x185a('0x40')][_0x185a('0x47')](_0x32205f)[_0x185a('0x26')](handleEntityNotFound(_0x291f37,null))[_0x185a('0x26')](respondWithResult(_0x291f37,null))['catch'](handleError(_0x291f37,null));};exports[_0x185a('0x48')]=function(_0x219d81,_0x9b3e02){return db[_0x185a('0x40')][_0x185a('0x48')](_0x219d81[_0x185a('0x49')],{})[_0x185a('0x26')](respondWithResult(_0x9b3e02,0xc9))['catch'](handleError(_0x9b3e02,null));};exports[_0x185a('0x25')]=function(_0x31854d,_0x3aa1d1){if(_0x31854d['body']['id']){delete _0x31854d['body']['id'];}return db[_0x185a('0x40')]['find']({'where':{'id':_0x31854d[_0x185a('0x4a')]['id']}})[_0x185a('0x26')](handleEntityNotFound(_0x3aa1d1,null))[_0x185a('0x26')](saveUpdates(_0x31854d[_0x185a('0x49')],null))[_0x185a('0x26')](respondWithResult(_0x3aa1d1,null))[_0x185a('0x44')](handleError(_0x3aa1d1,null));};exports['describe']=function(_0x2d2019,_0x4ef37c){return db['VoiceRecording'][_0x185a('0x4b')]()[_0x185a('0x26')](respondWithResult(_0x4ef37c,null))[_0x185a('0x44')](handleError(_0x4ef37c,null));};exports[_0x185a('0x4c')]=function(_0x7c5f12,_0x578e97,_0x553760){var _0x15e2eb=require(_0x185a('0x4d'));var _0x292230=![];var _0x1a5952={};if(_0x7c5f12[_0x185a('0x33')][_0x185a('0x30')]&&_0x7c5f12[_0x185a('0x33')]['type']===_0x185a('0x4e')){_0x1a5952['uniqueid']=_0x7c5f12['params']['id'];}else{_0x1a5952['id']=_0x7c5f12[_0x185a('0x4a')]['id'];}return db[_0x185a('0x40')][_0x185a('0x47')]({'where':_0x1a5952,'attributes':['id',_0x185a('0x4f')],'raw':!![]})[_0x185a('0x26')](handleEntityNotFound(_0x578e97,null))[_0x185a('0x26')](function(_0x2e77b4){if(_0x2e77b4){var _0x4ae0df=_0x2e77b4[_0x185a('0x4f')];var _0x1ab05b=util[_0x185a('0x32')](_0x185a('0x50'),_0x4ae0df);if(fs[_0x185a('0x51')](_0x1ab05b)){_0x292230=!![];return _0x15e2eb[_0x185a('0x52')](_0x1ab05b,_0x4ae0df,config[_0x185a('0x53')][_0x185a('0x54')])[_0x185a('0x26')](function(){return _0x2e77b4;});}return _0x2e77b4;}})[_0x185a('0x26')](function(_0x279e14){if(_0x279e14){var _0x1c4976=_0x279e14[_0x185a('0x4f')];if(!fs[_0x185a('0x51')](_0x1c4976)){throw new db['Sequelize']['ValidationError'](_0x185a('0x55'));}if(_0x279e14['filename']){return _0x578e97[_0x185a('0x4c')](_0x1c4976,_0x279e14[_0x185a('0x56')]+path[_0x185a('0x57')](_0x1c4976),function(){if(_0x292230){fs[_0x185a('0x58')](_0x1c4976);}});}else{return _0x578e97[_0x185a('0x4c')](_0x1c4976,function(_0x2a2233){if(_0x292230){fs[_0x185a('0x58')](_0x1c4976);}});}}})[_0x185a('0x44')](function(_0x1dc70e){if(_0x1dc70e[_0x185a('0x59')]===_0x185a('0x55')){_0x578e97['status'](0x194)[_0x185a('0x2d')](_0x185a('0x5a'));}else{return handleError(_0x578e97,null);}});};exports[_0x185a('0x5b')]=function(_0x5c284f,_0x1d8c61,_0x1534dc){var _0x7a45a7=require(_0x185a('0x4d'));var _0x2baab2=![];var _0x1d6f7b={'$and':[db[_0x185a('0x5c')][_0x185a('0x3c')](db[_0x185a('0x5c')]['fn']('MD5',db['sequelize'][_0x185a('0x5d')](_0x185a('0x4e'))),_0x5c284f['query'][_0x185a('0x5e')])]};if(_0x5c284f['query'][_0x185a('0x30')]&&_0x5c284f[_0x185a('0x33')][_0x185a('0x30')]===_0x185a('0x4e')){_0x1d6f7b[_0x185a('0x5f')]['push']({'uniqueid':_0x5c284f[_0x185a('0x4a')]['id']});}else{_0x1d6f7b[_0x185a('0x5f')][_0x185a('0x60')]({'id':_0x5c284f['params']['id']});}return db['VoiceRecording'][_0x185a('0x47')]({'where':_0x1d6f7b,'attributes':['id',_0x185a('0x4f')],'raw':!![]})[_0x185a('0x26')](handleEntityNotFound(_0x1d8c61,null))['then'](function(_0x5442d4){if(_0x5442d4){var _0x3d0586=util[_0x185a('0x32')](_0x185a('0x50'),_0x5442d4[_0x185a('0x4f')]);if(fs[_0x185a('0x51')](_0x3d0586)){_0x2baab2=!![];return _0x7a45a7[_0x185a('0x52')](_0x3d0586,_0x5442d4[_0x185a('0x4f')],config[_0x185a('0x53')][_0x185a('0x54')])['then'](function(){return _0x5442d4;});}return _0x5442d4;}})[_0x185a('0x26')](function(_0x3c6383){if(_0x3c6383){if(!fs[_0x185a('0x51')](_0x3c6383[_0x185a('0x4f')])){throw new db['Sequelize']['ValidationError'](_0x185a('0x55'));}if(_0x3c6383[_0x185a('0x56')]){return _0x1d8c61[_0x185a('0x4c')](_0x3c6383[_0x185a('0x4f')],_0x3c6383[_0x185a('0x56')]+path[_0x185a('0x57')](_0x3c6383[_0x185a('0x4f')]),function(){if(_0x2baab2){fs[_0x185a('0x58')](_0x3c6383[_0x185a('0x4f')]);}});}else{return _0x1d8c61[_0x185a('0x4c')](_0x3c6383[_0x185a('0x4f')],function(_0x45bd28){if(_0x2baab2){fs['unlink'](_0x3c6383[_0x185a('0x4f')]);}});}}})[_0x185a('0x44')](handleError(_0x1d8c61,null));};exports[_0x185a('0x27')]=function(_0x98abdf,_0x39c393){return db[_0x185a('0x40')][_0x185a('0x47')]({'where':{'id':_0x98abdf[_0x185a('0x4a')]['id']}})[_0x185a('0x26')](function(_0x203f31){if(_[_0x185a('0x61')](_0x203f31)){throw new ReferenceError(_0x185a('0x62'));}return _0x203f31;})[_0x185a('0x26')](function(_0x14520f){var _0x5c46a3=_0x14520f[_0x185a('0x4f')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x5c46a3);if(!_[_0x185a('0x61')](_0x14520f[_0x185a('0x4f')])&&fs[_0x185a('0x51')](_0x5c46a3)){logger['info'](_0x185a('0x63')+_0x5c46a3+_0x185a('0x64'));fs[_0x185a('0x65')](_0x5c46a3);}_0x5c46a3=_0x5c46a3+'.cypher';if(!_[_0x185a('0x61')](_0x14520f[_0x185a('0x4f')])&&fs['existsSync'](_0x5c46a3)){logger[_0x185a('0x66')](_0x185a('0x63')+_0x5c46a3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x185a('0x65')](_0x5c46a3);}return _0x14520f;})[_0x185a('0x26')](function(_0x268700){if(!_0x268700)throw new InternalError();return _0x268700[_0x185a('0x27')]();})[_0x185a('0x26')](function(){_0x39c393[_0x185a('0x1c')](0xcc)['end']();})[_0x185a('0x44')](handleError(_0x39c393,null));};function getBucketslist(_0x235ad9,_0x28f68b,_0x6de3eb){return new Promise(function(_0x1fce29,_0xe238f7){var _0x11905d=new AWS['S3']({'accessKeyId':_0x28f68b,'secretAccessKey':_0x235ad9,'region':_0x6de3eb});_0x11905d['listBuckets']({},function(_0x2c8c74,_0x31b89b){if(_0x2c8c74){return _0xe238f7(_0x2c8c74);}else{return _0x1fce29(_0x31b89b);}});});}function createBucket(_0x5b69e8,_0x27c333,_0x4917a8,_0x412c43){return new Promise(function(_0x18211b,_0x192851){var _0x286096=new AWS['S3']({'accessKeyId':_0x27c333,'secretAccessKey':_0x5b69e8,'region':_0x4917a8});_0x286096[_0x185a('0x67')]({'Bucket':_0x412c43},function(_0x4368f9,_0x29f59b){if(_0x4368f9){return _0x192851(_0x4368f9);}else{return _0x18211b(_0x29f59b);}});});}function uploadFile(_0x279fb3,_0x5794f8,_0x549b6b,_0x192d21,_0x35b438,_0x4d959a){return new Promise(function(_0x44e78e,_0x3d2a7a){var _0x20363b=new AWS['S3']({'accessKeyId':_0x5794f8,'secretAccessKey':_0x279fb3,'region':_0x549b6b});_0x20363b[_0x185a('0x68')]({'Bucket':_0x192d21,'Key':_0x35b438,'Body':_0x4d959a},function(_0x1b89b2,_0x364a35){if(_0x1b89b2){return _0x3d2a7a(_0x1b89b2);}else{return _0x44e78e(_0x364a35);}});});}function startTranscribe(_0x5396d,_0x96a154,_0x4dfb99,_0x2b2c83,_0x511515,_0x6b88bf){return new Promise(function(_0x4ba45a,_0x47b5a1){var _0x1e028c=new AWS[(_0x185a('0x69'))]({'accessKeyId':_0x96a154,'secretAccessKey':_0x5396d,'region':_0x4dfb99});_0x1e028c[_0x185a('0x6a')]({'TranscriptionJobName':_0x2b2c83,'LanguageCode':_0x511515,'Media':{'MediaFileUri':_0x6b88bf}},function(_0x45f7dd,_0x4f58cb){if(_0x45f7dd){return _0x47b5a1(_0x45f7dd);}else{return _0x4ba45a(_0x4f58cb);}});});}function transcribe(_0x5f3805,_0x4ef157,_0x2f3415,_0x3f1c6b,_0x4d44cb,_0x5ac935,_0x2ace59){return new Promise(function(_0x514668,_0xc0b80){var _0x49c34b={};logger[_0x185a('0x66')](util[_0x185a('0x32')](_0x185a('0x6b'),_0x5f3805,_0x4d44cb));return uploadFile(_0x4ef157,_0x2f3415,_0x3f1c6b,_0x4d44cb,path['basename'](_0x5ac935),fs[_0x185a('0x6c')](_0x5ac935))[_0x185a('0x26')](function(_0x46364e){logger[_0x185a('0x66')](util[_0x185a('0x32')](_0x185a('0x6d'),_0x5f3805,_0x4d44cb,_0x46364e[_0x185a('0x6e')]));_0x49c34b[_0x185a('0x6f')]=_0x46364e[_0x185a('0x70')];_0x49c34b[_0x185a('0x71')]=_0x46364e[_0x185a('0x6e')];logger['info'](util['format'](_0x185a('0x72'),_0x5f3805));return startTranscribe(_0x4ef157,_0x2f3415,_0x3f1c6b,uuidv4(),_0x2ace59,_0x46364e['Location']);})['then'](function(_0x2fbfea){logger['info'](util[_0x185a('0x32')](_0x185a('0x73'),_0x5f3805,_0x2fbfea[_0x185a('0x74')][_0x185a('0x75')]));_0x49c34b[_0x185a('0x76')]=_0x2fbfea[_0x185a('0x74')]['TranscriptionJobName'];_0x49c34b[_0x185a('0x77')]=_0x2fbfea[_0x185a('0x74')][_0x185a('0x78')];return _0x514668(_0x49c34b);})['catch'](function(_0x4452f3){return _0xc0b80(_0x4452f3);});});}exports[_0x185a('0x79')]=function(_0x4379e9,_0x3befe0,_0xe4500e){var _0x17e0a8;var _0x3cb857;var _0xe7376f;var _0x5c107c=require(_0x185a('0x4d'));return db[_0x185a('0x40')][_0x185a('0x7a')]({'where':{'id':_0x4379e9['params']['id']}})[_0x185a('0x26')](function(_0x3bcc2c){if(_0x3bcc2c){var _0x729113=util[_0x185a('0x32')](_0x185a('0x50'),_0x3bcc2c['value']);if(fs[_0x185a('0x51')](_0x729113)){cypher=!![];return _0x5c107c['decryptFile'](_0x729113,_0x3bcc2c[_0x185a('0x4f')],config['secrets'][_0x185a('0x54')])[_0x185a('0x26')](function(){return _0x3bcc2c;});}return _0x3bcc2c;}})[_0x185a('0x26')](function(_0x271416){if(!_0x271416){throw new db['Sequelize']['ValidationError'](_0x185a('0x7b'));}_0x3cb857=_0x271416;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x185a('0x26')](handleEntityNotFound(_0x3befe0,null))[_0x185a('0x26')](function(_0x3c7609){if(_0x3c7609){_0x17e0a8=_0x3c7609;if(!_0x17e0a8['transcribe']||!_0x17e0a8[_0x185a('0x7c')]||!_0x17e0a8['transcribeRegion']||!_0x17e0a8[_0x185a('0x7d')]||!_0x17e0a8[_0x185a('0x6f')]){throw new db[(_0x185a('0x7e'))][(_0x185a('0x7f'))](_0x185a('0x80'));}if(_0x4379e9[_0x185a('0x49')][_0x185a('0x81')]&&(!_0x17e0a8[_0x185a('0x82')]||!_0x17e0a8[_0x185a('0x83')]||!_0x17e0a8[_0x185a('0x84')]||!_0x17e0a8[_0x185a('0x7d')]||!_0x17e0a8[_0x185a('0x6f')])){throw new db['Sequelize'][(_0x185a('0x7f'))](_0x185a('0x85'));}return db[_0x185a('0x86')][_0x185a('0x7a')]({'where':{'id':_0x17e0a8[_0x185a('0x7c')]}});}})[_0x185a('0x26')](function(_0x3b555f){if(!_0x3b555f){throw new db['Sequelize'][(_0x185a('0x7f'))](_0x185a('0x87'));}if(!_0x3b555f[_0x185a('0x88')]||!_0x3b555f[_0x185a('0x89')]){throw new db['Sequelize']['ValidationError'](_0x185a('0x8a'));}_0xe7376f=_0x3b555f;return getBucketslist(_0xe7376f[_0x185a('0x88')],_0xe7376f[_0x185a('0x89')],_0x17e0a8[_0x185a('0x8b')]);})['then'](function(_0x2b4622){if(_0x2b4622&&_0x2b4622[_0x185a('0x8c')]){var _0x20b728=_['find'](_0x2b4622[_0x185a('0x8c')],function(_0x25d1b6){return _0x25d1b6[_0x185a('0x8d')]===_0x17e0a8['bucket'];});if(!_0x20b728){logger[_0x185a('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x4379e9['params']['id'],_0x17e0a8['bucket']));return createBucket(_0xe7376f[_0x185a('0x88')],_0xe7376f['data2'],_0x17e0a8[_0x185a('0x8b')],_0x17e0a8[_0x185a('0x6f')]);}logger[_0x185a('0x66')](util[_0x185a('0x32')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4379e9[_0x185a('0x4a')]['id'],_0x17e0a8[_0x185a('0x6f')]));return;}})[_0x185a('0x26')](function(_0x4eecfd){if(_0x3cb857[_0x185a('0x77')]===_0x185a('0x8e')){return transcribe(_0x4379e9['params']['id'],_0xe7376f[_0x185a('0x88')],_0xe7376f[_0x185a('0x89')],_0x17e0a8[_0x185a('0x8b')],_0x17e0a8['bucket'],_0x3cb857['value'],_0x17e0a8[_0x185a('0x7d')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4379e9[_0x185a('0x4a')]['id']));return{'transcribeStatus':_0x185a('0x8f')};}})['then'](function(_0x33bb4e){if(_0x33bb4e){_0x33bb4e[_0x185a('0x90')]=_0x4379e9['body'][_0x185a('0x81')];return _0x3cb857[_0x185a('0x91')](_0x33bb4e);}})[_0x185a('0x26')](respondWithResult(_0x3befe0,null))[_0x185a('0x44')](handleError(_0x3befe0,null));};function writeFile(_0x172f5f,_0x4afccc){return new Promise(function(_0xf95208,_0xb6e196){fs[_0x185a('0x92')](_0x4afccc,_0x172f5f,function(_0x452202,_0x2ef79e){if(_0x452202){return _0xb6e196(_0x452202);}else{return _0xf95208(_0x2ef79e);}});});}exports['downloadTranscribe']=function(_0x44ec8d,_0x14c68c,_0x41f022){return db[_0x185a('0x40')][_0x185a('0x7a')]({'where':{'id':_0x44ec8d['params']['id']}})['then'](handleEntityNotFound(_0x14c68c))[_0x185a('0x26')](function(_0x43703e){if(_0x43703e&&_0x43703e[_0x185a('0x93')]){var _0x58e7ec=_0x43703e[_0x185a('0x93')];var _0x5defeb=config[_0x185a('0x94')]+'/server/files/transcribes/transcribe_'+_0x43703e['id']+_0x185a('0x95');if(fs['existsSync'](_0x5defeb)){return _0x5defeb;}return writeFile(_0x58e7ec,_0x5defeb)[_0x185a('0x26')](function(){return _0x5defeb;});}else{throw new db['Sequelize']['ValidationError'](_0x185a('0x96'));}})['then'](function(_0x532823){return _0x14c68c[_0x185a('0x4c')](_0x532823);})[_0x185a('0x44')](handleError(_0x14c68c));}; \ No newline at end of file +var _0x34a0=['rimraf','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','filter','merge','where','VIRTUAL','VoiceRecording','includeAll','include','rows','catch','show','params','rawAttributes','length','options','find','create','body','describe','../../components/encryptor','uniqueid','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','downloads','MD5','sequelize','col','token','$and','push','value','filename','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','upload','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format'];(function(_0x444ddb,_0x290ac0){var _0x555d4a=function(_0x1dd10a){while(--_0x1dd10a){_0x444ddb['push'](_0x444ddb['shift']());}};_0x555d4a(++_0x290ac0);}(_0x34a0,0x1ca));var _0x034a=function(_0x1ec25f,_0x14356d){_0x1ec25f=_0x1ec25f-0x0;var _0x27b441=_0x34a0[_0x1ec25f];return _0x27b441;};'use strict';var emlformat=require(_0x034a('0x0'));var rimraf=require(_0x034a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x034a('0x2'));var moment=require(_0x034a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x034a('0x4'));var util=require(_0x034a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x034a('0x6'));var ejs=require(_0x034a('0x7'));var fs=require('fs');var fs_extra=require(_0x034a('0x8'));var _=require(_0x034a('0x9'));var squel=require('squel');var crypto=require(_0x034a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x034a('0xb'));var Papa=require(_0x034a('0xc'));var AWS=require(_0x034a('0xd'));var uuidv4=require(_0x034a('0xe'));var Redis=require(_0x034a('0xf'));var authService=require(_0x034a('0x10'));var qs=require(_0x034a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x034a('0x12'));var logger=require(_0x034a('0x13'))(_0x034a('0x14'));var utils=require(_0x034a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x034a('0x16'));var db=require(_0x034a('0x17'))['db'];function respondWithStatusCode(_0x5a8168,_0x547fb3){_0x547fb3=_0x547fb3||0xcc;return function(_0x2c58df){if(_0x2c58df){return _0x5a8168['sendStatus'](_0x547fb3);}return _0x5a8168[_0x034a('0x18')](_0x547fb3)['end']();};}function respondWithResult(_0x3e04a2,_0x4c498f){_0x4c498f=_0x4c498f||0xc8;return function(_0x4e8516){if(_0x4e8516){return _0x3e04a2[_0x034a('0x18')](_0x4c498f)[_0x034a('0x19')](_0x4e8516);}};}function respondWithFilteredResult(_0x557094,_0x2a11bf){return function(_0xbe29fe){if(_0xbe29fe){var _0x3b7d9c=typeof _0x2a11bf['offset']===_0x034a('0x1a')&&typeof _0x2a11bf[_0x034a('0x1b')]==='undefined';var _0xbbe37a=_0xbe29fe['count'];var _0x59cba1=_0x3b7d9c?0x0:_0x2a11bf['offset'];var _0x4b5ec7=_0x3b7d9c?_0xbe29fe[_0x034a('0x1c')]:_0x2a11bf[_0x034a('0x1d')]+_0x2a11bf[_0x034a('0x1b')];var _0x51e9b2;if(_0x4b5ec7>=_0xbbe37a){_0x4b5ec7=_0xbbe37a;_0x51e9b2=0xc8;}else{_0x51e9b2=0xce;}_0x557094[_0x034a('0x18')](_0x51e9b2);return _0x557094[_0x034a('0x1e')](_0x034a('0x1f'),_0x59cba1+'-'+_0x4b5ec7+'/'+_0xbbe37a)[_0x034a('0x19')](_0xbe29fe);}return null;};}function patchUpdates(_0x3451fa){return function(_0x35076f){try{jsonpatch['apply'](_0x35076f,_0x3451fa,!![]);}catch(_0x539969){return BPromise['reject'](_0x539969);}return _0x35076f[_0x034a('0x20')]();};}function saveUpdates(_0x442bad,_0xf29419){return function(_0x7adacf){if(_0x7adacf){return _0x7adacf[_0x034a('0x21')](_0x442bad)[_0x034a('0x22')](function(_0x1e59f8){return _0x1e59f8;});}return null;};}function removeEntity(_0x1ea34c,_0x54660f){return function(_0x2249cf){if(_0x2249cf){return _0x2249cf[_0x034a('0x23')]()['then'](function(){_0x1ea34c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x563dc9,_0x2be1ca){return function(_0x1862d6){if(!_0x1862d6){_0x563dc9['sendStatus'](0x194);}return _0x1862d6;};}function handleError(_0x41bf37,_0x2be65c){_0x2be65c=_0x2be65c||0x1f4;return function(_0x53006f){logger[_0x034a('0x24')](_0x53006f[_0x034a('0x25')]);if(_0x53006f[_0x034a('0x26')]){delete _0x53006f[_0x034a('0x26')];}_0x41bf37[_0x034a('0x18')](_0x2be65c)[_0x034a('0x27')](_0x53006f);};}exports[_0x034a('0x28')]=function(_0x1b9766,_0x464cbf){var _0x758a7={},_0x102467={},_0x23c408={'count':0x0,'rows':[]};var _0x1e5f81=_[_0x034a('0x29')](db['VoiceRecording']['rawAttributes'],function(_0x2dde67){return{'name':_0x2dde67[_0x034a('0x2a')],'type':_0x2dde67[_0x034a('0x2b')][_0x034a('0x2c')]};});_0x102467[_0x034a('0x2d')]=_[_0x034a('0x2e')](_[_0x034a('0x29')](_0x1e5f81,'name'),[_0x034a('0x2f')]);_0x102467[_0x034a('0x30')]=_[_0x034a('0x31')](_0x1b9766[_0x034a('0x30')]);_0x102467['filters']=_[_0x034a('0x32')](_0x102467[_0x034a('0x2d')],_0x102467[_0x034a('0x30')]);_0x758a7[_0x034a('0x33')]=_['intersection'](_0x102467[_0x034a('0x2d')],qs['fields'](_0x1b9766[_0x034a('0x30')][_0x034a('0x34')]));_0x758a7['attributes']=_0x758a7[_0x034a('0x33')]['length']?_0x758a7[_0x034a('0x33')]:_0x102467[_0x034a('0x2d')];if(!_0x1b9766[_0x034a('0x30')][_0x034a('0x35')]('nolimit')){_0x758a7[_0x034a('0x1b')]=qs['limit'](_0x1b9766[_0x034a('0x30')][_0x034a('0x1b')]);_0x758a7[_0x034a('0x1d')]=qs[_0x034a('0x1d')](_0x1b9766[_0x034a('0x30')][_0x034a('0x1d')]);}_0x758a7['order']=qs[_0x034a('0x36')](_0x1b9766[_0x034a('0x30')][_0x034a('0x36')]);_0x758a7['where']=qs[_0x034a('0x37')](_[_0x034a('0x38')](_0x1b9766['query'],_0x102467[_0x034a('0x37')]),_0x1e5f81);if(_0x1b9766['query'][_0x034a('0x39')]){_0x758a7['where']=_[_0x034a('0x3a')](_0x758a7[_0x034a('0x3b')],{'$or':_['map'](_0x1e5f81,function(_0x282670){if(_0x282670['type']!==_0x034a('0x3c')){var _0x35bc63={};_0x35bc63[_0x282670[_0x034a('0x26')]]={'$like':'%'+_0x1b9766[_0x034a('0x30')][_0x034a('0x39')]+'%'};return _0x35bc63;}})});}_0x758a7=_[_0x034a('0x3a')]({},_0x758a7,_0x1b9766['options']);var _0x316856={'where':_0x758a7['where']};return db[_0x034a('0x3d')]['count'](_0x316856)[_0x034a('0x22')](function(_0x3091d1){_0x23c408['count']=_0x3091d1;if(_0x1b9766['query'][_0x034a('0x3e')]){_0x758a7[_0x034a('0x3f')]=[{'all':!![]}];}return db[_0x034a('0x3d')]['findAll'](_0x758a7);})[_0x034a('0x22')](function(_0x401c06){_0x23c408[_0x034a('0x40')]=_0x401c06;return _0x23c408;})[_0x034a('0x22')](respondWithFilteredResult(_0x464cbf,_0x758a7))[_0x034a('0x41')](handleError(_0x464cbf,null));};exports[_0x034a('0x42')]=function(_0x54d5ca,_0x317765){var _0x77d7b5={'raw':![],'where':{'id':_0x54d5ca[_0x034a('0x43')]['id']}},_0x5c2d88={};_0x5c2d88[_0x034a('0x2d')]=_[_0x034a('0x31')](db['VoiceRecording'][_0x034a('0x44')]);_0x5c2d88[_0x034a('0x30')]=_['keys'](_0x54d5ca[_0x034a('0x30')]);_0x5c2d88[_0x034a('0x37')]=_[_0x034a('0x32')](_0x5c2d88[_0x034a('0x2d')],_0x5c2d88['query']);_0x77d7b5[_0x034a('0x33')]=_[_0x034a('0x32')](_0x5c2d88[_0x034a('0x2d')],qs[_0x034a('0x34')](_0x54d5ca['query'][_0x034a('0x34')]));_0x77d7b5[_0x034a('0x33')]=_0x77d7b5[_0x034a('0x33')][_0x034a('0x45')]?_0x77d7b5['attributes']:_0x5c2d88[_0x034a('0x2d')];if(_0x54d5ca[_0x034a('0x30')][_0x034a('0x3e')]){_0x77d7b5['include']=[{'all':!![]}];}_0x77d7b5=_[_0x034a('0x3a')]({},_0x77d7b5,_0x54d5ca[_0x034a('0x46')]);return db[_0x034a('0x3d')][_0x034a('0x47')](_0x77d7b5)[_0x034a('0x22')](handleEntityNotFound(_0x317765,null))[_0x034a('0x22')](respondWithResult(_0x317765,null))[_0x034a('0x41')](handleError(_0x317765,null));};exports[_0x034a('0x48')]=function(_0x437336,_0x4f917d){return db[_0x034a('0x3d')][_0x034a('0x48')](_0x437336[_0x034a('0x49')],{})[_0x034a('0x22')](respondWithResult(_0x4f917d,0xc9))['catch'](handleError(_0x4f917d,null));};exports[_0x034a('0x21')]=function(_0x31416a,_0x38a715){if(_0x31416a[_0x034a('0x49')]['id']){delete _0x31416a[_0x034a('0x49')]['id'];}return db['VoiceRecording'][_0x034a('0x47')]({'where':{'id':_0x31416a['params']['id']}})[_0x034a('0x22')](handleEntityNotFound(_0x38a715,null))[_0x034a('0x22')](saveUpdates(_0x31416a[_0x034a('0x49')],null))['then'](respondWithResult(_0x38a715,null))[_0x034a('0x41')](handleError(_0x38a715,null));};exports[_0x034a('0x4a')]=function(_0x9a7bc5,_0x4fcc77){return db[_0x034a('0x3d')]['describe']()['then'](respondWithResult(_0x4fcc77,null))[_0x034a('0x41')](handleError(_0x4fcc77,null));};exports['download']=function(_0x49d940,_0x41492e,_0x464fd6){var _0x1e4d04=require(_0x034a('0x4b'));var _0x51af2a=![];var _0x2e2402={};if(_0x49d940[_0x034a('0x30')][_0x034a('0x2b')]&&_0x49d940[_0x034a('0x30')][_0x034a('0x2b')]===_0x034a('0x4c')){_0x2e2402[_0x034a('0x4c')]=_0x49d940[_0x034a('0x43')]['id'];}else{_0x2e2402['id']=_0x49d940['params']['id'];}return db[_0x034a('0x3d')][_0x034a('0x47')]({'where':_0x2e2402,'attributes':['id','value'],'raw':!![]})[_0x034a('0x22')](handleEntityNotFound(_0x41492e,null))[_0x034a('0x22')](function(_0x620cf1){if(_0x620cf1){var _0x378cd1=_0x620cf1['value'];var _0x504a9f=util['format']('%s.cypher',_0x378cd1);if(fs[_0x034a('0x4d')](_0x504a9f)){_0x51af2a=!![];return _0x1e4d04[_0x034a('0x4e')](_0x504a9f,_0x378cd1,config[_0x034a('0x4f')][_0x034a('0x50')])[_0x034a('0x22')](function(){return _0x620cf1;});}return _0x620cf1;}})[_0x034a('0x22')](function(_0x38dbf9){if(_0x38dbf9){var _0x948e3d=_0x38dbf9['value'];if(!fs[_0x034a('0x4d')](_0x948e3d)){throw new db[(_0x034a('0x51'))][(_0x034a('0x52'))](_0x034a('0x53'));}if(_0x38dbf9['filename']){return _0x41492e[_0x034a('0x54')](_0x948e3d,_0x38dbf9['filename']+path[_0x034a('0x55')](_0x948e3d),function(){if(_0x51af2a){fs[_0x034a('0x56')](_0x948e3d);}});}else{return _0x41492e[_0x034a('0x54')](_0x948e3d,function(_0x161781){if(_0x51af2a){fs[_0x034a('0x56')](_0x948e3d);}});}}})[_0x034a('0x41')](function(_0xdba7e9){if(_0xdba7e9[_0x034a('0x57')]==='VoiceRecording\x20not\x20found'){_0x41492e['status'](0x194)[_0x034a('0x27')](_0x034a('0x58'));}else{return handleError(_0x41492e,null);}});};exports[_0x034a('0x59')]=function(_0x269d29,_0x44c369,_0x2a127e){var _0x2819b9=require('../../components/encryptor');var _0x4914df=![];var _0x5b1403={'$and':[db['sequelize'][_0x034a('0x3b')](db['sequelize']['fn'](_0x034a('0x5a'),db[_0x034a('0x5b')][_0x034a('0x5c')](_0x034a('0x4c'))),_0x269d29[_0x034a('0x30')][_0x034a('0x5d')])]};if(_0x269d29[_0x034a('0x30')]['type']&&_0x269d29[_0x034a('0x30')][_0x034a('0x2b')]===_0x034a('0x4c')){_0x5b1403[_0x034a('0x5e')]['push']({'uniqueid':_0x269d29['params']['id']});}else{_0x5b1403['$and'][_0x034a('0x5f')]({'id':_0x269d29[_0x034a('0x43')]['id']});}return db[_0x034a('0x3d')][_0x034a('0x47')]({'where':_0x5b1403,'attributes':['id','value'],'raw':!![]})[_0x034a('0x22')](handleEntityNotFound(_0x44c369,null))[_0x034a('0x22')](function(_0x2a6346){if(_0x2a6346){var _0x11aeb3=util[_0x034a('0x2f')]('%s.cypher',_0x2a6346['value']);if(fs['existsSync'](_0x11aeb3)){_0x4914df=!![];return _0x2819b9[_0x034a('0x4e')](_0x11aeb3,_0x2a6346['value'],config['secrets']['recording'])[_0x034a('0x22')](function(){return _0x2a6346;});}return _0x2a6346;}})[_0x034a('0x22')](function(_0x4cea14){if(_0x4cea14){if(!fs[_0x034a('0x4d')](_0x4cea14[_0x034a('0x60')])){throw new db[(_0x034a('0x51'))][(_0x034a('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x4cea14[_0x034a('0x61')]){return _0x44c369['download'](_0x4cea14[_0x034a('0x60')],_0x4cea14[_0x034a('0x61')]+path['extname'](_0x4cea14[_0x034a('0x60')]),function(){if(_0x4914df){fs[_0x034a('0x56')](_0x4cea14[_0x034a('0x60')]);}});}else{return _0x44c369[_0x034a('0x54')](_0x4cea14[_0x034a('0x60')],function(_0x2f85c6){if(_0x4914df){fs[_0x034a('0x56')](_0x4cea14[_0x034a('0x60')]);}});}}})['catch'](handleError(_0x44c369,null));};exports['destroy']=function(_0x102396,_0x1aa069){return db[_0x034a('0x3d')][_0x034a('0x47')]({'where':{'id':_0x102396[_0x034a('0x43')]['id']}})['then'](function(_0xa492b6){if(_['isNil'](_0xa492b6)){throw new ReferenceError(_0x034a('0x62'));}return _0xa492b6;})['then'](function(_0x411ccd){var _0x1e3863=_0x411ccd[_0x034a('0x60')];logger[_0x034a('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x1e3863);if(!_[_0x034a('0x64')](_0x411ccd[_0x034a('0x60')])&&fs[_0x034a('0x4d')](_0x1e3863)){logger[_0x034a('0x63')](_0x034a('0x65')+_0x1e3863+_0x034a('0x66'));fs[_0x034a('0x67')](_0x1e3863);}_0x1e3863=_0x1e3863+_0x034a('0x68');if(!_['isNil'](_0x411ccd[_0x034a('0x60')])&&fs[_0x034a('0x4d')](_0x1e3863)){logger[_0x034a('0x63')]('File:\x20\x22'+_0x1e3863+_0x034a('0x66'));fs[_0x034a('0x67')](_0x1e3863);}return _0x411ccd;})[_0x034a('0x22')](function(_0x42f942){if(!_0x42f942)throw new InternalError();return _0x42f942['destroy']();})[_0x034a('0x22')](function(){_0x1aa069[_0x034a('0x18')](0xcc)[_0x034a('0x69')]();})[_0x034a('0x41')](handleError(_0x1aa069,null));};function getBucketslist(_0x1c4f2e,_0x473516,_0x467df6){return new Promise(function(_0x4e13f9,_0x555a8a){var _0x16ced3=new AWS['S3']({'accessKeyId':_0x473516,'secretAccessKey':_0x1c4f2e,'region':_0x467df6});_0x16ced3['listBuckets']({},function(_0x4a0022,_0x437f2f){if(_0x4a0022){return _0x555a8a(_0x4a0022);}else{return _0x4e13f9(_0x437f2f);}});});}function createBucket(_0x1d61c1,_0x2b92d4,_0x21dc6f,_0x573fc0){return new Promise(function(_0x4a2d1c,_0x357952){var _0x224650=new AWS['S3']({'accessKeyId':_0x2b92d4,'secretAccessKey':_0x1d61c1,'region':_0x21dc6f});_0x224650['createBucket']({'Bucket':_0x573fc0},function(_0x2273bf,_0x220f4c){if(_0x2273bf){return _0x357952(_0x2273bf);}else{return _0x4a2d1c(_0x220f4c);}});});}function uploadFile(_0x4c6b13,_0x8be7bb,_0x327e62,_0x2ea7e5,_0x3b7d2c,_0x5ac368){return new Promise(function(_0xecaf2d,_0x1cd02f){var _0x384499=new AWS['S3']({'accessKeyId':_0x8be7bb,'secretAccessKey':_0x4c6b13,'region':_0x327e62});_0x384499[_0x034a('0x6a')]({'Bucket':_0x2ea7e5,'Key':_0x3b7d2c,'Body':_0x5ac368},function(_0x2b9a06,_0x3ba6ae){if(_0x2b9a06){return _0x1cd02f(_0x2b9a06);}else{return _0xecaf2d(_0x3ba6ae);}});});}function startTranscribe(_0xdc2b0b,_0x149e0c,_0x4de741,_0x58deff,_0x3a4c5c,_0x4a72e3){return new Promise(function(_0x51d97c,_0x2144dd){var _0x4f772b=new AWS['TranscribeService']({'accessKeyId':_0x149e0c,'secretAccessKey':_0xdc2b0b,'region':_0x4de741});_0x4f772b[_0x034a('0x6b')]({'TranscriptionJobName':_0x58deff,'LanguageCode':_0x3a4c5c,'Media':{'MediaFileUri':_0x4a72e3}},function(_0x4d9817,_0x596e9c){if(_0x4d9817){return _0x2144dd(_0x4d9817);}else{return _0x51d97c(_0x596e9c);}});});}function transcribe(_0x2d3152,_0x1d0dc7,_0x20a51b,_0x1e8660,_0x3e9fe2,_0x1adbbd,_0x900fd9){return new Promise(function(_0x951f16,_0x3043f5){var _0xb5ea50={};logger['info'](util[_0x034a('0x2f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x2d3152,_0x3e9fe2));return uploadFile(_0x1d0dc7,_0x20a51b,_0x1e8660,_0x3e9fe2,path['basename'](_0x1adbbd),fs[_0x034a('0x6c')](_0x1adbbd))[_0x034a('0x22')](function(_0xba6f5f){logger[_0x034a('0x63')](util['format'](_0x034a('0x6d'),_0x2d3152,_0x3e9fe2,_0xba6f5f[_0x034a('0x6e')]));_0xb5ea50[_0x034a('0x6f')]=_0xba6f5f[_0x034a('0x70')];_0xb5ea50['location']=_0xba6f5f[_0x034a('0x6e')];logger['info'](util[_0x034a('0x2f')](_0x034a('0x71'),_0x2d3152));return startTranscribe(_0x1d0dc7,_0x20a51b,_0x1e8660,uuidv4(),_0x900fd9,_0xba6f5f['Location']);})[_0x034a('0x22')](function(_0x4055f9){logger[_0x034a('0x63')](util['format'](_0x034a('0x72'),_0x2d3152,_0x4055f9['TranscriptionJob'][_0x034a('0x73')]));_0xb5ea50['transcribeName']=_0x4055f9['TranscriptionJob'][_0x034a('0x73')];_0xb5ea50['transcribeStatus']=_0x4055f9[_0x034a('0x74')][_0x034a('0x75')];return _0x951f16(_0xb5ea50);})['catch'](function(_0x38a7f6){return _0x3043f5(_0x38a7f6);});});}exports[_0x034a('0x76')]=function(_0x134b2e,_0x2fe22a,_0x193c92){var _0x44ad57;var _0x488a5b;var _0x124f30;var _0x1ccb7e=require(_0x034a('0x4b'));return db[_0x034a('0x3d')][_0x034a('0x77')]({'where':{'id':_0x134b2e[_0x034a('0x43')]['id']}})['then'](function(_0x46a38e){if(_0x46a38e){var _0x18efa2=util[_0x034a('0x2f')](_0x034a('0x78'),_0x46a38e[_0x034a('0x60')]);if(fs['existsSync'](_0x18efa2)){cypher=!![];return _0x1ccb7e[_0x034a('0x4e')](_0x18efa2,_0x46a38e['value'],config[_0x034a('0x4f')][_0x034a('0x50')])[_0x034a('0x22')](function(){return _0x46a38e;});}return _0x46a38e;}})[_0x034a('0x22')](function(_0x340d89){if(!_0x340d89){throw new db[(_0x034a('0x51'))]['ValidationError'](_0x034a('0x79'));}_0x488a5b=_0x340d89;return db[_0x034a('0x7a')]['findOne']({'where':{'id':0x1}});})[_0x034a('0x22')](handleEntityNotFound(_0x2fe22a,null))[_0x034a('0x22')](function(_0x314fc9){if(_0x314fc9){_0x44ad57=_0x314fc9;if(!_0x44ad57[_0x034a('0x7b')]||!_0x44ad57[_0x034a('0x7c')]||!_0x44ad57[_0x034a('0x7d')]||!_0x44ad57[_0x034a('0x7e')]||!_0x44ad57[_0x034a('0x6f')]){throw new db[(_0x034a('0x51'))]['ValidationError'](_0x034a('0x7f'));}if(_0x134b2e['body']['runSentiment']&&(!_0x44ad57[_0x034a('0x80')]||!_0x44ad57[_0x034a('0x81')]||!_0x44ad57[_0x034a('0x82')]||!_0x44ad57[_0x034a('0x7e')]||!_0x44ad57['bucket'])){throw new db[(_0x034a('0x51'))][(_0x034a('0x52'))](_0x034a('0x83'));}return db[_0x034a('0x84')][_0x034a('0x77')]({'where':{'id':_0x44ad57['transcribeAccountId']}});}})[_0x034a('0x22')](function(_0x44be8f){if(!_0x44be8f){throw new db['Sequelize'][(_0x034a('0x52'))](_0x034a('0x85'));}if(!_0x44be8f[_0x034a('0x86')]||!_0x44be8f[_0x034a('0x87')]){throw new db['Sequelize']['ValidationError'](_0x034a('0x88'));}_0x124f30=_0x44be8f;return getBucketslist(_0x124f30[_0x034a('0x86')],_0x124f30['data2'],_0x44ad57[_0x034a('0x7d')]);})[_0x034a('0x22')](function(_0x23cae1){if(_0x23cae1&&_0x23cae1[_0x034a('0x89')]){var _0x556f1e=_['find'](_0x23cae1['Buckets'],function(_0xe3e73f){return _0xe3e73f[_0x034a('0x8a')]===_0x44ad57[_0x034a('0x6f')];});if(!_0x556f1e){logger[_0x034a('0x63')](util[_0x034a('0x2f')](_0x034a('0x8b'),_0x134b2e['params']['id'],_0x44ad57['bucket']));return createBucket(_0x124f30['data1'],_0x124f30['data2'],_0x44ad57[_0x034a('0x7d')],_0x44ad57[_0x034a('0x6f')]);}logger[_0x034a('0x63')](util['format'](_0x034a('0x8c'),_0x134b2e['params']['id'],_0x44ad57[_0x034a('0x6f')]));return;}})[_0x034a('0x22')](function(_0x2576ac){if(_0x488a5b['transcribeStatus']===_0x034a('0x8d')){return transcribe(_0x134b2e[_0x034a('0x43')]['id'],_0x124f30['data1'],_0x124f30[_0x034a('0x87')],_0x44ad57[_0x034a('0x7d')],_0x44ad57[_0x034a('0x6f')],_0x488a5b[_0x034a('0x60')],_0x44ad57[_0x034a('0x7e')]);}else{logger[_0x034a('0x63')](util[_0x034a('0x2f')](_0x034a('0x8e'),_0x134b2e[_0x034a('0x43')]['id']));return{'transcribeStatus':_0x034a('0x8f')};}})[_0x034a('0x22')](function(_0x52e404){if(_0x52e404){_0x52e404[_0x034a('0x90')]=_0x134b2e[_0x034a('0x49')][_0x034a('0x91')];return _0x488a5b[_0x034a('0x92')](_0x52e404);}})['then'](respondWithResult(_0x2fe22a,null))['catch'](handleError(_0x2fe22a,null));};function writeFile(_0x3415cc,_0x3bcf09){return new Promise(function(_0x47f0b6,_0x5e0ab6){fs[_0x034a('0x93')](_0x3bcf09,_0x3415cc,function(_0x257cc9,_0x1011f8){if(_0x257cc9){return _0x5e0ab6(_0x257cc9);}else{return _0x47f0b6(_0x1011f8);}});});}exports[_0x034a('0x94')]=function(_0x112542,_0x300a9d,_0x4ca22f){return db[_0x034a('0x3d')]['findOne']({'where':{'id':_0x112542[_0x034a('0x43')]['id']}})[_0x034a('0x22')](handleEntityNotFound(_0x300a9d))[_0x034a('0x22')](function(_0x29b838){if(_0x29b838&&_0x29b838[_0x034a('0x95')]){var _0x185556=_0x29b838[_0x034a('0x95')];var _0x259dbd=config[_0x034a('0x96')]+'/server/files/transcribes/transcribe_'+_0x29b838['id']+_0x034a('0x97');if(fs[_0x034a('0x4d')](_0x259dbd)){return _0x259dbd;}return writeFile(_0x185556,_0x259dbd)[_0x034a('0x22')](function(){return _0x259dbd;});}else{throw new db[(_0x034a('0x51'))][(_0x034a('0x52'))](_0x034a('0x98'));}})[_0x034a('0x22')](function(_0x23e1f3){return _0x300a9d['download'](_0x23e1f3);})[_0x034a('0x41')](handleError(_0x300a9d));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 1d2accb..248816b 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 _0xf7a1=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceRecording.attributes','define'];(function(_0x2f8a59,_0x5c3234){var _0x4f7969=function(_0x5cecf8){while(--_0x5cecf8){_0x2f8a59['push'](_0x2f8a59['shift']());}};_0x4f7969(++_0x5c3234);}(_0xf7a1,0xed));var _0x1f7a=function(_0x339a45,_0x391206){_0x339a45=_0x339a45-0x0;var _0x118e27=_0xf7a1[_0x339a45];return _0x118e27;};'use strict';var _=require(_0x1f7a('0x0'));var util=require(_0x1f7a('0x1'));var logger=require(_0x1f7a('0x2'))(_0x1f7a('0x3'));var moment=require(_0x1f7a('0x4'));var BPromise=require(_0x1f7a('0x5'));var rp=require(_0x1f7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f7a('0x7'));var config=require('../../config/environment');var attributes=require(_0x1f7a('0x8'));module['exports']=function(_0x4e22a8,_0x44bfb0){return _0x4e22a8[_0x1f7a('0x9')](_0x1f7a('0xa'),attributes,{'tableName':_0x1f7a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1f7a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757e=['path','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','api','moment','request-promise'];(function(_0x483920,_0x5f0a77){var _0x186258=function(_0x4b94eb){while(--_0x4b94eb){_0x483920['push'](_0x483920['shift']());}};_0x186258(++_0x5f0a77);}(_0x757e,0xf8));var _0xe757=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x757e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe757('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe757('0x1'));var moment=require(_0xe757('0x2'));var BPromise=require('bluebird');var rp=require(_0xe757('0x3'));var fs=require('fs');var path=require(_0xe757('0x4'));var rimraf=require(_0xe757('0x5'));var config=require('../../config/environment');var attributes=require(_0xe757('0x6'));module[_0xe757('0x7')]=function(_0x5e91c3,_0x2a8815){return _0x5e91c3[_0xe757('0x8')](_0xe757('0x9'),attributes,{'tableName':_0xe757('0xa'),'paranoid':![],'indexes':[{'name':_0xe757('0xb'),'fields':[_0xe757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index efdbe73..1423db5 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 _0x3e24=['client','http','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2af9bf,_0x4ce3ee){var _0x473a7c=function(_0x3905e3){while(--_0x3905e3){_0x2af9bf['push'](_0x2af9bf['shift']());}};_0x473a7c(++_0x4ce3ee);}(_0x3e24,0x167));var _0x43e2=function(_0x7ce8a5,_0xa18e08){_0x7ce8a5=_0x7ce8a5-0x0;var _0x42d2f5=_0x3e24[_0x7ce8a5];return _0x42d2f5;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var moment=require(_0x43e2('0x2'));var BPromise=require(_0x43e2('0x3'));var rs=require(_0x43e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43e2('0x5'))['db'];var utils=require(_0x43e2('0x6'));var logger=require('../../config/logger')(_0x43e2('0x7'));var config=require(_0x43e2('0x8'));var jayson=require(_0x43e2('0x9'));var client=jayson[_0x43e2('0xa')][_0x43e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x121e2e,_0x23b2d8,_0x59956d){return new BPromise(function(_0xb75b,_0x2357bc){return client['request'](_0x121e2e,_0x59956d)[_0x43e2('0xc')](function(_0x2fdf85){logger['info'](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));logger['debug'](_0x43e2('0xf'),_0x23b2d8,'request\x20sent',JSON['stringify'](_0x2fdf85));if(_0x2fdf85['error']){if(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x11')]===0x1f4){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0x2357bc(_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);}logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x2fdf85[_0x43e2('0x10')][_0x43e2('0x12')]);return _0xb75b(_0x2fdf85['error'][_0x43e2('0x12')]);}else{logger[_0x43e2('0x13')](_0x43e2('0xd'),_0x23b2d8,_0x43e2('0xe'));_0xb75b(_0x2fdf85['result']['message']);}})[_0x43e2('0x14')](function(_0x417ce5){logger[_0x43e2('0x10')](_0x43e2('0xd'),_0x23b2d8,_0x417ce5);_0x2357bc(_0x417ce5);});});}exports[_0x43e2('0x15')]=function(_0x1b7cde){var _0x3ea010=this;return new Promise(function(_0x15ecb5,_0x3236b9){return db[_0x43e2('0x16')]['update'](_0x1b7cde[_0x43e2('0x17')],{'raw':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde['options'][_0x43e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1a')]||null:null,'attributes':_0x1b7cde[_0x43e2('0x18')]?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1b')]||null:null,'limit':_0x1b7cde['options']?_0x1b7cde[_0x43e2('0x18')][_0x43e2('0x1c')]||null:null})[_0x43e2('0xc')](function(_0x52e361){logger[_0x43e2('0x13')](_0x43e2('0x15'),_0x1b7cde);logger[_0x43e2('0x1d')](_0x43e2('0x15'),_0x1b7cde,JSON['stringify'](_0x52e361));_0x15ecb5(_0x52e361);})[_0x43e2('0x14')](function(_0xc717d8){logger[_0x43e2('0x10')](_0x43e2('0x15'),_0xc717d8[_0x43e2('0x12')],_0x1b7cde);_0x3236b9(_0x3ea010[_0x43e2('0x10')](0x1f4,_0xc717d8[_0x43e2('0x12')]));});});};exports[_0x43e2('0x1e')]=function(_0xd29b7b){var _0x1ec68e=this;return new Promise(function(_0x1ea844,_0x1de7e1){var _0x52ed49=require(_0x43e2('0x1f'));var _0x2f2bd8;return db['Setting'][_0x43e2('0x20')]({'attributes':['id',_0x43e2('0x21')],'where':{'id':0x1},'raw':!![]})[_0x43e2('0xc')](function(_0x404483){_0x2f2bd8=_0x404483;return db[_0x43e2('0x16')]['create'](_0xd29b7b[_0x43e2('0x17')]);})[_0x43e2('0xc')](function(_0x1779f9){if(_0x2f2bd8[_0x43e2('0x21')]&&fs[_0x43e2('0x22')](_0x1779f9[_0x43e2('0x23')])){var _0x53f797=util['format'](_0x43e2('0x24'),_0x1779f9[_0x43e2('0x23')]);return _0x52ed49[_0x43e2('0x25')](_0x1779f9[_0x43e2('0x23')],_0x53f797,config[_0x43e2('0x26')]['recording'])[_0x43e2('0xc')](function(){fs[_0x43e2('0x27')](_0x1779f9[_0x43e2('0x23')]);logger[_0x43e2('0x13')](_0x43e2('0x28'));return _0x1779f9;});}return _0x1779f9;})[_0x43e2('0xc')](function(_0x2fcdd4){logger['info']('CreateVoiceRecording',_0xd29b7b);logger[_0x43e2('0x1d')](_0x43e2('0x1e'),_0xd29b7b,JSON['stringify'](_0x2fcdd4));_0x1ea844(_0x2fcdd4);})[_0x43e2('0x14')](function(_0x34effb){logger['error'](_0x43e2('0x1e'),_0x34effb['message'],_0xd29b7b);_0x1de7e1(_0x1ec68e['error'](0x1f4,_0x34effb['message']));});});}; \ No newline at end of file +var _0x160f=['../../config/environment','client','http','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','debug','CreateVoiceRecording','../../components/encryptor','Setting','create','existsSync','format','%s.cypher','encryptFile','value','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x50fef6,_0x38b038){var _0x2504a3=function(_0x573e4d){while(--_0x573e4d){_0x50fef6['push'](_0x50fef6['shift']());}};_0x2504a3(++_0x38b038);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}exports[_0xf160('0x16')]=function(_0x4b8185){var _0x5388c7=this;return new Promise(function(_0x1cf6ba,_0x1e0c78){return db[_0xf160('0x17')][_0xf160('0x18')](_0x4b8185[_0xf160('0x19')],{'raw':_0x4b8185[_0xf160('0x1a')]?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b8185['options']?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1c')]||null:null,'attributes':_0x4b8185[_0xf160('0x1a')]?_0x4b8185['options'][_0xf160('0x1d')]||null:null,'limit':_0x4b8185[_0xf160('0x1a')]?_0x4b8185[_0xf160('0x1a')][_0xf160('0x1e')]||null:null})[_0xf160('0xc')](function(_0x1b0081){logger[_0xf160('0xd')]('UpdateVoiceRecording',_0x4b8185);logger[_0xf160('0x1f')](_0xf160('0x16'),_0x4b8185,JSON[_0xf160('0x11')](_0x1b0081));_0x1cf6ba(_0x1b0081);})[_0xf160('0x15')](function(_0x578f7d){logger[_0xf160('0x12')](_0xf160('0x16'),_0x578f7d['message'],_0x4b8185);_0x1e0c78(_0x5388c7['error'](0x1f4,_0x578f7d[_0xf160('0x14')]));});});};exports[_0xf160('0x20')]=function(_0x39c0e3){var _0x4c0c51=this;return new Promise(function(_0xcfa9bd,_0x73851f){var _0x2851e8=require(_0xf160('0x21'));var _0x135e0f;return db[_0xf160('0x22')]['findOne']({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x26e7b9){_0x135e0f=_0x26e7b9;return db[_0xf160('0x17')][_0xf160('0x23')](_0x39c0e3[_0xf160('0x19')]);})[_0xf160('0xc')](function(_0x563103){if(_0x135e0f['callRecordingEncryption']&&fs[_0xf160('0x24')](_0x563103['value'])){var _0x4ce478=util[_0xf160('0x25')](_0xf160('0x26'),_0x563103['value']);return _0x2851e8[_0xf160('0x27')](_0x563103[_0xf160('0x28')],_0x4ce478,config['secrets']['recording'])['then'](function(){fs['unlink'](_0x563103[_0xf160('0x28')]);logger[_0xf160('0xd')](_0xf160('0x29'));return _0x563103;});}return _0x563103;})[_0xf160('0xc')](function(_0x16c528){logger[_0xf160('0xd')]('CreateVoiceRecording',_0x39c0e3);logger['debug']('CreateVoiceRecording',_0x39c0e3,JSON[_0xf160('0x11')](_0x16c528));_0xcfa9bd(_0x16c528);})['catch'](function(_0x5c65d2){logger[_0xf160('0x12')](_0xf160('0x20'),_0x5c65d2['message'],_0x39c0e3);_0x73851f(_0x4c0c51[_0xf160('0x12')](0x1f4,_0x5c65d2[_0xf160('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index fea77cb..bf62c91 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 _0xd569=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','/describe','isAuthenticated','describe','/:id','show','create','put'];(function(_0x7a00ab,_0x55e187){var _0x3324e5=function(_0x539cd1){while(--_0x539cd1){_0x7a00ab['push'](_0x7a00ab['shift']());}};_0x3324e5(++_0x55e187);}(_0xd569,0xa6));var _0x9d56=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0xd569[_0x242a4f];return _0x122117;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d56('0x0'));var timeout=require('connect-timeout');var express=require(_0x9d56('0x1'));var router=express[_0x9d56('0x2')]();var fs_extra=require(_0x9d56('0x3'));var auth=require(_0x9d56('0x4'));var interaction=require(_0x9d56('0x5'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9d56('0x6')]);router['get'](_0x9d56('0x7'),auth[_0x9d56('0x8')](),controller[_0x9d56('0x9')]);router['get'](_0x9d56('0xa'),auth[_0x9d56('0x8')](),controller[_0x9d56('0xb')]);router['post']('/',auth[_0x9d56('0x8')](),controller[_0x9d56('0xc')]);router[_0x9d56('0xd')]('/:id',auth[_0x9d56('0x8')](),controller['update']);router['delete'](_0x9d56('0xa'),auth[_0x9d56('0x8')](),controller['destroy']);module[_0x9d56('0xe')]=router; \ No newline at end of file +var _0x66b6=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update'];(function(_0x26550f,_0x527259){var _0x790023=function(_0x36fd90){while(--_0x36fd90){_0x26550f['push'](_0x26550f['shift']());}};_0x790023(++_0x527259);}(_0x66b6,0xa2));var _0x666b=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x66b6[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0x666b('0x0'));var util=require(_0x666b('0x1'));var path=require(_0x666b('0x2'));var timeout=require('connect-timeout');var express=require(_0x666b('0x3'));var router=express[_0x666b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x666b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x666b('0x6'));var controller=require(_0x666b('0x7'));router[_0x666b('0x8')]('/',auth[_0x666b('0x9')](),controller[_0x666b('0xa')]);router['get']('/describe',auth[_0x666b('0x9')](),controller[_0x666b('0xb')]);router['get'](_0x666b('0xc'),auth[_0x666b('0x9')](),controller[_0x666b('0xd')]);router[_0x666b('0xe')]('/',auth[_0x666b('0x9')](),controller[_0x666b('0xf')]);router[_0x666b('0x10')](_0x666b('0xc'),auth[_0x666b('0x9')](),controller[_0x666b('0x11')]);router[_0x666b('0x12')](_0x666b('0xc'),auth[_0x666b('0x9')](),controller[_0x666b('0x13')]);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 e458d12..c27d7f8 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 _0xafcd=['Yes','moment','exports','ENUM','blind','STRING'];(function(_0x311f44,_0x1d7f5b){var _0x46f1e6=function(_0x27342a){while(--_0x27342a){_0x311f44['push'](_0x311f44['shift']());}};_0x46f1e6(++_0x1d7f5b);}(_0xafcd,0x1c3));var _0xdafc=function(_0x67ef3d,_0x50f0bd){_0x67ef3d=_0x67ef3d-0x0;var _0x2ef03e=_0xafcd[_0x67ef3d];return _0x2ef03e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdafc('0x0'));module[_0xdafc('0x1')]={'type':{'type':Sequelize[_0xdafc('0x2')](_0xdafc('0x3'),'attended')},'result':{'type':Sequelize[_0xdafc('0x4')]},'transfererchannel':{'type':Sequelize[_0xdafc('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xdafc('0x4')]},'transferercalleridname':{'type':Sequelize[_0xdafc('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xdafc('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xdafc('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xdafc('0x4')]},'transferercontext':{'type':Sequelize[_0xdafc('0x4')]},'transfererexten':{'type':Sequelize[_0xdafc('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xdafc('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xdafc('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xdafc('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xdafc('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xdafc('0x4')]},'transfereecontext':{'type':Sequelize[_0xdafc('0x4')]},'transfereeexten':{'type':Sequelize[_0xdafc('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xdafc('0x4')]},'isexternal':{'type':Sequelize[_0xdafc('0x2')](_0xdafc('0x5'),'No')},'context':{'type':Sequelize[_0xdafc('0x4')]},'extension':{'type':Sequelize[_0xdafc('0x4')]}}; \ No newline at end of file +var _0xf054=['exports','ENUM','STRING','sequelize','moment'];(function(_0x3a84a9,_0x423db4){var _0x3c3f60=function(_0x325cc4){while(--_0x325cc4){_0x3a84a9['push'](_0x3a84a9['shift']());}};_0x3c3f60(++_0x423db4);}(_0xf054,0xb2));var _0x4f05=function(_0x5259c9,_0x3e18ec){_0x5259c9=_0x5259c9-0x0;var _0x628dec=_0xf054[_0x5259c9];return _0x628dec;};'use strict';var Sequelize=require(_0x4f05('0x0'));var moment=require(_0x4f05('0x1'));module[_0x4f05('0x2')]={'type':{'type':Sequelize[_0x4f05('0x3')]('blind','attended')},'result':{'type':Sequelize[_0x4f05('0x4')]},'transfererchannel':{'type':Sequelize[_0x4f05('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x4f05('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x4f05('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x4f05('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x4f05('0x4')]},'transfereechannel':{'type':Sequelize[_0x4f05('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x4f05('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x4f05('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x4f05('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x4f05('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x4f05('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x4f05('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x4f05('0x4')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x4f05('0x4')]},'extension':{'type':Sequelize[_0x4f05('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6fcc3c6..2a22bc6 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 _0xf95d=['limit','count','set','Content-Range','apply','reject','save','update','then','status','send','index','map','VoiceTransferReport','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined'];(function(_0x3292b0,_0x20bd6a){var _0x35aedd=function(_0xc759df){while(--_0xc759df){_0x3292b0['push'](_0x3292b0['shift']());}};_0x35aedd(++_0x20bd6a);}(_0xf95d,0x10c));var _0xdf95=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xf95d[_0x4b2436];return _0x4f5ab2;};'use strict';var emlformat=require(_0xdf95('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf95('0x1'));var jsonpatch=require(_0xdf95('0x2'));var rp=require(_0xdf95('0x3'));var moment=require(_0xdf95('0x4'));var BPromise=require(_0xdf95('0x5'));var Mustache=require(_0xdf95('0x6'));var util=require(_0xdf95('0x7'));var path=require(_0xdf95('0x8'));var sox=require(_0xdf95('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf95('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf95('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdf95('0xc'));var querystring=require(_0xdf95('0xd'));var Papa=require(_0xdf95('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdf95('0xf'));var hardwareService=require(_0xdf95('0x10'));var logger=require(_0xdf95('0x11'))(_0xdf95('0x12'));var utils=require(_0xdf95('0x13'));var config=require(_0xdf95('0x14'));var licenseUtil=require(_0xdf95('0x15'));var db=require(_0xdf95('0x16'))['db'];function respondWithStatusCode(_0x39707c,_0x5badb5){_0x5badb5=_0x5badb5||0xcc;return function(_0x3736f1){if(_0x3736f1){return _0x39707c[_0xdf95('0x17')](_0x5badb5);}return _0x39707c['status'](_0x5badb5)[_0xdf95('0x18')]();};}function respondWithResult(_0x924363,_0x3a7ceb){_0x3a7ceb=_0x3a7ceb||0xc8;return function(_0x20edab){if(_0x20edab){return _0x924363['status'](_0x3a7ceb)[_0xdf95('0x19')](_0x20edab);}};}function respondWithFilteredResult(_0x3e488b,_0x14de21){return function(_0x47473f){if(_0x47473f){var _0x54f6a0=typeof _0x14de21[_0xdf95('0x1a')]===_0xdf95('0x1b')&&typeof _0x14de21[_0xdf95('0x1c')]===_0xdf95('0x1b');var _0x791f99=_0x47473f[_0xdf95('0x1d')];var _0x28c788=_0x54f6a0?0x0:_0x14de21[_0xdf95('0x1a')];var _0x33b3e6=_0x54f6a0?_0x47473f['count']:_0x14de21['offset']+_0x14de21[_0xdf95('0x1c')];var _0x560538;if(_0x33b3e6>=_0x791f99){_0x33b3e6=_0x791f99;_0x560538=0xc8;}else{_0x560538=0xce;}_0x3e488b['status'](_0x560538);return _0x3e488b[_0xdf95('0x1e')](_0xdf95('0x1f'),_0x28c788+'-'+_0x33b3e6+'/'+_0x791f99)['json'](_0x47473f);}return null;};}function patchUpdates(_0x4130df){return function(_0x314412){try{jsonpatch[_0xdf95('0x20')](_0x314412,_0x4130df,!![]);}catch(_0xf9f381){return BPromise[_0xdf95('0x21')](_0xf9f381);}return _0x314412[_0xdf95('0x22')]();};}function saveUpdates(_0xbc92e0,_0x35761b){return function(_0x408d74){if(_0x408d74){return _0x408d74[_0xdf95('0x23')](_0xbc92e0)[_0xdf95('0x24')](function(_0x3bc743){return _0x3bc743;});}return null;};}function removeEntity(_0x2277f3,_0x424aa4){return function(_0x220971){if(_0x220971){return _0x220971['destroy']()['then'](function(){_0x2277f3[_0xdf95('0x25')](0xcc)[_0xdf95('0x18')]();});}};}function handleEntityNotFound(_0x65274,_0x56ce92){return function(_0x56cf0f){if(!_0x56cf0f){_0x65274[_0xdf95('0x17')](0x194);}return _0x56cf0f;};}function handleError(_0x525b9f,_0x33af60){_0x33af60=_0x33af60||0x1f4;return function(_0x18697e){logger['error'](_0x18697e['stack']);if(_0x18697e['name']){delete _0x18697e['name'];}_0x525b9f[_0xdf95('0x25')](_0x33af60)[_0xdf95('0x26')](_0x18697e);};}exports[_0xdf95('0x27')]=function(_0x4a97c1,_0x4fce0b){var _0x2f1de0={},_0x2b74ed={},_0x1e40fb={'count':0x0,'rows':[]};var _0x2ec087=_[_0xdf95('0x28')](db[_0xdf95('0x29')][_0xdf95('0x2a')],function(_0x5ae5a1){return{'name':_0x5ae5a1['fieldName'],'type':_0x5ae5a1[_0xdf95('0x2b')][_0xdf95('0x2c')]};});_0x2b74ed[_0xdf95('0x2d')]=_[_0xdf95('0x28')](_0x2ec087,_0xdf95('0x2e'));_0x2b74ed[_0xdf95('0x2f')]=_[_0xdf95('0x30')](_0x4a97c1[_0xdf95('0x2f')]);_0x2b74ed[_0xdf95('0x31')]=_[_0xdf95('0x32')](_0x2b74ed[_0xdf95('0x2d')],_0x2b74ed['query']);_0x2f1de0[_0xdf95('0x33')]=_[_0xdf95('0x32')](_0x2b74ed[_0xdf95('0x2d')],qs['fields'](_0x4a97c1['query'][_0xdf95('0x34')]));_0x2f1de0[_0xdf95('0x33')]=_0x2f1de0[_0xdf95('0x33')][_0xdf95('0x35')]?_0x2f1de0[_0xdf95('0x33')]:_0x2b74ed[_0xdf95('0x2d')];if(!_0x4a97c1[_0xdf95('0x2f')][_0xdf95('0x36')]('nolimit')){_0x2f1de0['limit']=qs[_0xdf95('0x1c')](_0x4a97c1[_0xdf95('0x2f')][_0xdf95('0x1c')]);_0x2f1de0[_0xdf95('0x1a')]=qs[_0xdf95('0x1a')](_0x4a97c1[_0xdf95('0x2f')][_0xdf95('0x1a')]);}_0x2f1de0['order']=qs['sort'](_0x4a97c1[_0xdf95('0x2f')][_0xdf95('0x37')]);_0x2f1de0[_0xdf95('0x38')]=qs[_0xdf95('0x31')](_[_0xdf95('0x39')](_0x4a97c1['query'],_0x2b74ed[_0xdf95('0x31')]),_0x2ec087);if(_0x4a97c1[_0xdf95('0x2f')][_0xdf95('0x3a')]){_0x2f1de0['where']=_[_0xdf95('0x3b')](_0x2f1de0['where'],{'$or':_['map'](_0x2ec087,function(_0x3534a8){if(_0x3534a8[_0xdf95('0x2b')]!==_0xdf95('0x3c')){var _0x42dfb8={};_0x42dfb8[_0x3534a8[_0xdf95('0x2e')]]={'$like':'%'+_0x4a97c1[_0xdf95('0x2f')][_0xdf95('0x3a')]+'%'};return _0x42dfb8;}})});}_0x2f1de0=_[_0xdf95('0x3b')]({},_0x2f1de0,_0x4a97c1[_0xdf95('0x3d')]);var _0x2b9111={'where':_0x2f1de0[_0xdf95('0x38')]};return db[_0xdf95('0x29')][_0xdf95('0x1d')](_0x2b9111)[_0xdf95('0x24')](function(_0x442989){_0x1e40fb[_0xdf95('0x1d')]=_0x442989;if(_0x4a97c1[_0xdf95('0x2f')]['includeAll']){_0x2f1de0[_0xdf95('0x3e')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xdf95('0x3f')](_0x2f1de0);})['then'](function(_0x37c0aa){_0x1e40fb[_0xdf95('0x40')]=_0x37c0aa;return _0x1e40fb;})[_0xdf95('0x24')](respondWithFilteredResult(_0x4fce0b,_0x2f1de0))['catch'](handleError(_0x4fce0b,null));};exports[_0xdf95('0x41')]=function(_0x100978,_0x86e0e6){var _0x1b2180={'raw':!![],'where':{'id':_0x100978[_0xdf95('0x42')]['id']}},_0x215802={};_0x215802[_0xdf95('0x2d')]=_['keys'](db[_0xdf95('0x29')][_0xdf95('0x2a')]);_0x215802['query']=_[_0xdf95('0x30')](_0x100978[_0xdf95('0x2f')]);_0x215802['filters']=_['intersection'](_0x215802[_0xdf95('0x2d')],_0x215802[_0xdf95('0x2f')]);_0x1b2180[_0xdf95('0x33')]=_['intersection'](_0x215802['model'],qs['fields'](_0x100978[_0xdf95('0x2f')]['fields']));_0x1b2180[_0xdf95('0x33')]=_0x1b2180[_0xdf95('0x33')][_0xdf95('0x35')]?_0x1b2180[_0xdf95('0x33')]:_0x215802['model'];if(_0x100978[_0xdf95('0x2f')][_0xdf95('0x43')]){_0x1b2180[_0xdf95('0x3e')]=[{'all':!![]}];}_0x1b2180=_[_0xdf95('0x3b')]({},_0x1b2180,_0x100978[_0xdf95('0x3d')]);return db[_0xdf95('0x29')][_0xdf95('0x44')](_0x1b2180)[_0xdf95('0x24')](handleEntityNotFound(_0x86e0e6,null))[_0xdf95('0x24')](respondWithResult(_0x86e0e6,null))[_0xdf95('0x45')](handleError(_0x86e0e6,null));};exports['create']=function(_0x1634ee,_0x230031){return db['VoiceTransferReport'][_0xdf95('0x46')](_0x1634ee['body'],{})[_0xdf95('0x24')](respondWithResult(_0x230031,0xc9))[_0xdf95('0x45')](handleError(_0x230031,null));};exports[_0xdf95('0x23')]=function(_0x522c98,_0x318ad7){if(_0x522c98[_0xdf95('0x47')]['id']){delete _0x522c98[_0xdf95('0x47')]['id'];}return db[_0xdf95('0x29')][_0xdf95('0x44')]({'where':{'id':_0x522c98['params']['id']}})['then'](handleEntityNotFound(_0x318ad7,null))[_0xdf95('0x24')](saveUpdates(_0x522c98[_0xdf95('0x47')],null))[_0xdf95('0x24')](respondWithResult(_0x318ad7,null))['catch'](handleError(_0x318ad7,null));};exports[_0xdf95('0x48')]=function(_0x2b0d4e,_0x3a4635){return db['VoiceTransferReport'][_0xdf95('0x44')]({'where':{'id':_0x2b0d4e['params']['id']}})[_0xdf95('0x24')](handleEntityNotFound(_0x3a4635,null))[_0xdf95('0x24')](removeEntity(_0x3a4635,null))[_0xdf95('0x45')](handleError(_0x3a4635,null));};exports['describe']=function(_0x1cd832,_0x1b0a68){return db[_0xdf95('0x29')][_0xdf95('0x49')]()[_0xdf95('0x24')](respondWithResult(_0x1b0a68,null))[_0xdf95('0x45')](handleError(_0x1b0a68,null));}; \ No newline at end of file +var _0xc0c0=['reject','save','then','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','filter','count','include','rows','show','params','find','create','update','body','catch','destroy','describe','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply'];(function(_0x4bfab7,_0x1f92fc){var _0x232fd7=function(_0x2fb73c){while(--_0x2fb73c){_0x4bfab7['push'](_0x4bfab7['shift']());}};_0x232fd7(++_0x1f92fc);}(_0xc0c0,0x70));var _0x0c0c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xc0c0[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x0c0c('0x0'));var rimraf=require(_0x0c0c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0c0c('0x2'));var moment=require('moment');var BPromise=require(_0x0c0c('0x3'));var Mustache=require('mustache');var util=require(_0x0c0c('0x4'));var path=require(_0x0c0c('0x5'));var sox=require(_0x0c0c('0x6'));var csv=require(_0x0c0c('0x7'));var ejs=require(_0x0c0c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0c0c('0x9'));var crypto=require(_0x0c0c('0xa'));var jsforce=require(_0x0c0c('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0c0c('0xc'));var Papa=require(_0x0c0c('0xd'));var Redis=require(_0x0c0c('0xe'));var authService=require(_0x0c0c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0c0c('0x10'));var hardwareService=require(_0x0c0c('0x11'));var logger=require(_0x0c0c('0x12'))(_0x0c0c('0x13'));var utils=require(_0x0c0c('0x14'));var config=require(_0x0c0c('0x15'));var licenseUtil=require(_0x0c0c('0x16'));var db=require(_0x0c0c('0x17'))['db'];function respondWithStatusCode(_0x43ce6f,_0xaa6997){_0xaa6997=_0xaa6997||0xcc;return function(_0x23e79e){if(_0x23e79e){return _0x43ce6f[_0x0c0c('0x18')](_0xaa6997);}return _0x43ce6f[_0x0c0c('0x19')](_0xaa6997)[_0x0c0c('0x1a')]();};}function respondWithResult(_0x217702,_0x428705){_0x428705=_0x428705||0xc8;return function(_0x383386){if(_0x383386){return _0x217702['status'](_0x428705)[_0x0c0c('0x1b')](_0x383386);}};}function respondWithFilteredResult(_0x2773cf,_0xc4338e){return function(_0x5351b3){if(_0x5351b3){var _0x5b7d3c=typeof _0xc4338e[_0x0c0c('0x1c')]==='undefined'&&typeof _0xc4338e[_0x0c0c('0x1d')]===_0x0c0c('0x1e');var _0x473762=_0x5351b3['count'];var _0x15e08d=_0x5b7d3c?0x0:_0xc4338e['offset'];var _0x4cc624=_0x5b7d3c?_0x5351b3['count']:_0xc4338e[_0x0c0c('0x1c')]+_0xc4338e['limit'];var _0x5c06d5;if(_0x4cc624>=_0x473762){_0x4cc624=_0x473762;_0x5c06d5=0xc8;}else{_0x5c06d5=0xce;}_0x2773cf[_0x0c0c('0x19')](_0x5c06d5);return _0x2773cf[_0x0c0c('0x1f')](_0x0c0c('0x20'),_0x15e08d+'-'+_0x4cc624+'/'+_0x473762)['json'](_0x5351b3);}return null;};}function patchUpdates(_0x19957c){return function(_0x3014b7){try{jsonpatch[_0x0c0c('0x21')](_0x3014b7,_0x19957c,!![]);}catch(_0x342ef1){return BPromise[_0x0c0c('0x22')](_0x342ef1);}return _0x3014b7[_0x0c0c('0x23')]();};}function saveUpdates(_0x2ecc02,_0x2a6c68){return function(_0x144a93){if(_0x144a93){return _0x144a93['update'](_0x2ecc02)[_0x0c0c('0x24')](function(_0x220581){return _0x220581;});}return null;};}function removeEntity(_0x1ef37a,_0x334cf8){return function(_0x40eb1d){if(_0x40eb1d){return _0x40eb1d['destroy']()['then'](function(){_0x1ef37a['status'](0xcc)[_0x0c0c('0x1a')]();});}};}function handleEntityNotFound(_0xa0a983,_0x21e384){return function(_0x27e1d9){if(!_0x27e1d9){_0xa0a983[_0x0c0c('0x18')](0x194);}return _0x27e1d9;};}function handleError(_0x388eef,_0x286ff3){_0x286ff3=_0x286ff3||0x1f4;return function(_0x5e5baa){logger['error'](_0x5e5baa[_0x0c0c('0x25')]);if(_0x5e5baa[_0x0c0c('0x26')]){delete _0x5e5baa[_0x0c0c('0x26')];}_0x388eef[_0x0c0c('0x19')](_0x286ff3)[_0x0c0c('0x27')](_0x5e5baa);};}exports['index']=function(_0x2ebc01,_0x30f70f){var _0x1fe078={},_0xc64c7b={},_0x3d06c1={'count':0x0,'rows':[]};var _0x274344=_[_0x0c0c('0x28')](db[_0x0c0c('0x29')][_0x0c0c('0x2a')],function(_0x37b092){return{'name':_0x37b092[_0x0c0c('0x2b')],'type':_0x37b092[_0x0c0c('0x2c')][_0x0c0c('0x2d')]};});_0xc64c7b[_0x0c0c('0x2e')]=_['map'](_0x274344,'name');_0xc64c7b['query']=_[_0x0c0c('0x2f')](_0x2ebc01['query']);_0xc64c7b[_0x0c0c('0x30')]=_['intersection'](_0xc64c7b['model'],_0xc64c7b['query']);_0x1fe078[_0x0c0c('0x31')]=_[_0x0c0c('0x32')](_0xc64c7b[_0x0c0c('0x2e')],qs[_0x0c0c('0x33')](_0x2ebc01[_0x0c0c('0x34')]['fields']));_0x1fe078['attributes']=_0x1fe078[_0x0c0c('0x31')]['length']?_0x1fe078[_0x0c0c('0x31')]:_0xc64c7b[_0x0c0c('0x2e')];if(!_0x2ebc01[_0x0c0c('0x34')][_0x0c0c('0x35')](_0x0c0c('0x36'))){_0x1fe078[_0x0c0c('0x1d')]=qs[_0x0c0c('0x1d')](_0x2ebc01[_0x0c0c('0x34')]['limit']);_0x1fe078['offset']=qs['offset'](_0x2ebc01[_0x0c0c('0x34')][_0x0c0c('0x1c')]);}_0x1fe078[_0x0c0c('0x37')]=qs['sort'](_0x2ebc01[_0x0c0c('0x34')]['sort']);_0x1fe078['where']=qs[_0x0c0c('0x30')](_[_0x0c0c('0x38')](_0x2ebc01[_0x0c0c('0x34')],_0xc64c7b[_0x0c0c('0x30')]),_0x274344);if(_0x2ebc01['query']['filter']){_0x1fe078[_0x0c0c('0x39')]=_[_0x0c0c('0x3a')](_0x1fe078[_0x0c0c('0x39')],{'$or':_[_0x0c0c('0x28')](_0x274344,function(_0x5ddee5){if(_0x5ddee5[_0x0c0c('0x2c')]!==_0x0c0c('0x3b')){var _0x1c5b46={};_0x1c5b46[_0x5ddee5[_0x0c0c('0x26')]]={'$like':'%'+_0x2ebc01[_0x0c0c('0x34')][_0x0c0c('0x3c')]+'%'};return _0x1c5b46;}})});}_0x1fe078=_[_0x0c0c('0x3a')]({},_0x1fe078,_0x2ebc01['options']);var _0x3e1c0c={'where':_0x1fe078['where']};return db['VoiceTransferReport'][_0x0c0c('0x3d')](_0x3e1c0c)['then'](function(_0x9859b0){_0x3d06c1[_0x0c0c('0x3d')]=_0x9859b0;if(_0x2ebc01[_0x0c0c('0x34')]['includeAll']){_0x1fe078[_0x0c0c('0x3e')]=[{'all':!![]}];}return db[_0x0c0c('0x29')]['findAll'](_0x1fe078);})['then'](function(_0x31bd26){_0x3d06c1[_0x0c0c('0x3f')]=_0x31bd26;return _0x3d06c1;})[_0x0c0c('0x24')](respondWithFilteredResult(_0x30f70f,_0x1fe078))['catch'](handleError(_0x30f70f,null));};exports[_0x0c0c('0x40')]=function(_0xe03f38,_0x2dcf70){var _0x3e2cb1={'raw':!![],'where':{'id':_0xe03f38[_0x0c0c('0x41')]['id']}},_0x59bac8={};_0x59bac8[_0x0c0c('0x2e')]=_[_0x0c0c('0x2f')](db[_0x0c0c('0x29')][_0x0c0c('0x2a')]);_0x59bac8[_0x0c0c('0x34')]=_['keys'](_0xe03f38[_0x0c0c('0x34')]);_0x59bac8[_0x0c0c('0x30')]=_[_0x0c0c('0x32')](_0x59bac8['model'],_0x59bac8[_0x0c0c('0x34')]);_0x3e2cb1[_0x0c0c('0x31')]=_[_0x0c0c('0x32')](_0x59bac8[_0x0c0c('0x2e')],qs[_0x0c0c('0x33')](_0xe03f38[_0x0c0c('0x34')]['fields']));_0x3e2cb1[_0x0c0c('0x31')]=_0x3e2cb1[_0x0c0c('0x31')]['length']?_0x3e2cb1[_0x0c0c('0x31')]:_0x59bac8[_0x0c0c('0x2e')];if(_0xe03f38['query']['includeAll']){_0x3e2cb1[_0x0c0c('0x3e')]=[{'all':!![]}];}_0x3e2cb1=_[_0x0c0c('0x3a')]({},_0x3e2cb1,_0xe03f38['options']);return db[_0x0c0c('0x29')][_0x0c0c('0x42')](_0x3e2cb1)[_0x0c0c('0x24')](handleEntityNotFound(_0x2dcf70,null))['then'](respondWithResult(_0x2dcf70,null))['catch'](handleError(_0x2dcf70,null));};exports[_0x0c0c('0x43')]=function(_0x13d2ed,_0x441c56){return db[_0x0c0c('0x29')][_0x0c0c('0x43')](_0x13d2ed['body'],{})['then'](respondWithResult(_0x441c56,0xc9))['catch'](handleError(_0x441c56,null));};exports[_0x0c0c('0x44')]=function(_0x4d57ae,_0x590e5f){if(_0x4d57ae[_0x0c0c('0x45')]['id']){delete _0x4d57ae[_0x0c0c('0x45')]['id'];}return db[_0x0c0c('0x29')][_0x0c0c('0x42')]({'where':{'id':_0x4d57ae['params']['id']}})[_0x0c0c('0x24')](handleEntityNotFound(_0x590e5f,null))['then'](saveUpdates(_0x4d57ae[_0x0c0c('0x45')],null))[_0x0c0c('0x24')](respondWithResult(_0x590e5f,null))[_0x0c0c('0x46')](handleError(_0x590e5f,null));};exports[_0x0c0c('0x47')]=function(_0x1fd97c,_0x38dc8c){return db['VoiceTransferReport']['find']({'where':{'id':_0x1fd97c[_0x0c0c('0x41')]['id']}})[_0x0c0c('0x24')](handleEntityNotFound(_0x38dc8c,null))[_0x0c0c('0x24')](removeEntity(_0x38dc8c,null))[_0x0c0c('0x46')](handleError(_0x38dc8c,null));};exports[_0x0c0c('0x48')]=function(_0x5e55da,_0x1a26df){return db[_0x0c0c('0x29')][_0x0c0c('0x48')]()['then'](respondWithResult(_0x1a26df,null))[_0x0c0c('0x46')](handleError(_0x1a26df,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1080fbd..f62f1cf 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 _0xc94a=['../../config/environment','exports','define','VoiceTransferReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x12dfb8,_0x50d25a){var _0x2e161a=function(_0x3d634c){while(--_0x3d634c){_0x12dfb8['push'](_0x12dfb8['shift']());}};_0x2e161a(++_0x50d25a);}(_0xc94a,0xca));var _0xac94=function(_0x340bfa,_0x54fe74){_0x340bfa=_0x340bfa-0x0;var _0x4223a=_0xc94a[_0x340bfa];return _0x4223a;};'use strict';var _=require(_0xac94('0x0'));var util=require('util');var logger=require(_0xac94('0x1'))(_0xac94('0x2'));var moment=require(_0xac94('0x3'));var BPromise=require(_0xac94('0x4'));var rp=require(_0xac94('0x5'));var fs=require('fs');var path=require(_0xac94('0x6'));var rimraf=require('rimraf');var config=require(_0xac94('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xac94('0x8')]=function(_0x425d44,_0x43e2e3){return _0x425d44[_0xac94('0x9')](_0xac94('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f0c=['VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./voiceTransferReport.attributes','define'];(function(_0x371fa2,_0x74272f){var _0x4aff68=function(_0x4c3a07){while(--_0x4c3a07){_0x371fa2['push'](_0x371fa2['shift']());}};_0x4aff68(++_0x74272f);}(_0x1f0c,0x70));var _0xc1f0=function(_0xba2ea,_0xa011d2){_0xba2ea=_0xba2ea-0x0;var _0x23d000=_0x1f0c[_0xba2ea];return _0x23d000;};'use strict';var _=require(_0xc1f0('0x0'));var util=require('util');var logger=require(_0xc1f0('0x1'))(_0xc1f0('0x2'));var moment=require(_0xc1f0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1f0('0x4'));var config=require(_0xc1f0('0x5'));var attributes=require(_0xc1f0('0x6'));module['exports']=function(_0x40ae6c,_0x538160){return _0x40ae6c[_0xc1f0('0x7')](_0xc1f0('0x8'),attributes,{'tableName':_0xc1f0('0x9'),'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 cf8bb93..d5b818c 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 _0x93bd=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x93bd,0x189));var _0xd93b=function(_0x2d3187,_0x7ce442){_0x2d3187=_0x2d3187-0x0;var _0x4e575b=_0x93bd[_0x2d3187];return _0x4e575b;};'use strict';var _=require(_0xd93b('0x0'));var util=require(_0xd93b('0x1'));var moment=require(_0xd93b('0x2'));var BPromise=require(_0xd93b('0x3'));var rs=require(_0xd93b('0x4'));var fs=require('fs');var Redis=require(_0xd93b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd93b('0x6'));var logger=require(_0xd93b('0x7'))('rpc');var config=require(_0xd93b('0x8'));var jayson=require(_0xd93b('0x9'));var client=jayson[_0xd93b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2761ad,_0x4e8fae,_0x2d4fe2){return new BPromise(function(_0x1c43b0,_0xbca637){return client[_0xd93b('0xb')](_0x2761ad,_0x2d4fe2)[_0xd93b('0xc')](function(_0x5c8e70){logger['info'](_0xd93b('0xd'),_0x4e8fae,_0xd93b('0xe'));logger[_0xd93b('0xf')](_0xd93b('0x10'),_0x4e8fae,_0xd93b('0xe'),JSON[_0xd93b('0x11')](_0x5c8e70));if(_0x5c8e70['error']){if(_0x5c8e70[_0xd93b('0x12')][_0xd93b('0x13')]===0x1f4){logger[_0xd93b('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4e8fae,_0x5c8e70['error']['message']);return _0xbca637(_0x5c8e70[_0xd93b('0x12')][_0xd93b('0x14')]);}logger[_0xd93b('0x12')](_0xd93b('0xd'),_0x4e8fae,_0x5c8e70[_0xd93b('0x12')][_0xd93b('0x14')]);return _0x1c43b0(_0x5c8e70['error'][_0xd93b('0x14')]);}else{logger[_0xd93b('0x15')](_0xd93b('0xd'),_0x4e8fae,_0xd93b('0xe'));_0x1c43b0(_0x5c8e70[_0xd93b('0x16')][_0xd93b('0x14')]);}})[_0xd93b('0x17')](function(_0x4dbf20){logger[_0xd93b('0x12')](_0xd93b('0xd'),_0x4e8fae,_0x4dbf20);_0xbca637(_0x4dbf20);});});}exports[_0xd93b('0x18')]=function(_0x37939d){var _0x491f20=this;return new Promise(function(_0x22bbfe,_0x2b40d2){return db[_0xd93b('0x19')][_0xd93b('0x1a')](_0x37939d[_0xd93b('0x1b')],{'raw':_0x37939d[_0xd93b('0x1c')]?_0x37939d[_0xd93b('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3564de){logger['info'](_0xd93b('0x18'),_0x37939d);logger['debug'](_0xd93b('0x18'),_0x37939d,JSON['stringify'](_0x3564de));_0x22bbfe(_0x3564de);})['catch'](function(_0x526c0e){logger[_0xd93b('0x12')](_0xd93b('0x18'),_0x526c0e[_0xd93b('0x14')],_0x37939d);_0x2b40d2(_0x491f20[_0xd93b('0x12')](0x1f4,_0x526c0e[_0xd93b('0x14')]));});});}; \ No newline at end of file +var _0x9794=['create','options','then','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateVoiceTransferReport'];(function(_0xf9ab6f,_0x4b7752){var _0x13673c=function(_0x1db985){while(--_0x1db985){_0xf9ab6f['push'](_0xf9ab6f['shift']());}};_0x13673c(++_0x4b7752);}(_0x9794,0xbc));var _0x4979=function(_0x17c25d,_0x406808){_0x17c25d=_0x17c25d-0x0;var _0x122fee=_0x9794[_0x17c25d];return _0x122fee;};'use strict';var _=require(_0x4979('0x0'));var util=require(_0x4979('0x1'));var moment=require(_0x4979('0x2'));var BPromise=require(_0x4979('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4979('0x4'));var logger=require(_0x4979('0x5'))('rpc');var config=require(_0x4979('0x6'));var jayson=require(_0x4979('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5baf63,_0x259944,_0x249db0){return new BPromise(function(_0x1a0388,_0x4ee4ef){return client[_0x4979('0x8')](_0x5baf63,_0x249db0)['then'](function(_0x1abd74){logger['info'](_0x4979('0x9'),_0x259944,_0x4979('0xa'));logger[_0x4979('0xb')](_0x4979('0xc'),_0x259944,'request\x20sent',JSON['stringify'](_0x1abd74));if(_0x1abd74[_0x4979('0xd')]){if(_0x1abd74[_0x4979('0xd')][_0x4979('0xe')]===0x1f4){logger[_0x4979('0xd')](_0x4979('0x9'),_0x259944,_0x1abd74[_0x4979('0xd')]['message']);return _0x4ee4ef(_0x1abd74['error']['message']);}logger[_0x4979('0xd')](_0x4979('0x9'),_0x259944,_0x1abd74[_0x4979('0xd')][_0x4979('0xf')]);return _0x1a0388(_0x1abd74[_0x4979('0xd')][_0x4979('0xf')]);}else{logger[_0x4979('0x10')](_0x4979('0x9'),_0x259944,_0x4979('0xa'));_0x1a0388(_0x1abd74['result'][_0x4979('0xf')]);}})[_0x4979('0x11')](function(_0x1f0fae){logger['error'](_0x4979('0x9'),_0x259944,_0x1f0fae);_0x4ee4ef(_0x1f0fae);});});}exports[_0x4979('0x12')]=function(_0x6f82a8){var _0x9a3345=this;return new Promise(function(_0x551356,_0x16e86c){return db['VoiceTransferReport'][_0x4979('0x13')](_0x6f82a8['body'],{'raw':_0x6f82a8[_0x4979('0x14')]?_0x6f82a8[_0x4979('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x4979('0x15')](function(_0x46eaa3){logger[_0x4979('0x10')](_0x4979('0x12'),_0x6f82a8);logger[_0x4979('0xb')]('CreateVoiceTransferReport',_0x6f82a8,JSON[_0x4979('0x16')](_0x46eaa3));_0x551356(_0x46eaa3);})[_0x4979('0x11')](function(_0x3d4e43){logger[_0x4979('0xd')](_0x4979('0x12'),_0x3d4e43[_0x4979('0xf')],_0x6f82a8);_0x16e86c(_0x9a3345['error'](0x1f4,_0x3d4e43['message']));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 0af9565..4b25566 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 _0x80a8=['hold','unhold','calls','/transfer','transfer','exports','Router','../../components/auth/service','./webbar.controller','/originate','canUpdate','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','/hold'];(function(_0x3cf733,_0x10874a){var _0x29e3db=function(_0x13d9f0){while(--_0x13d9f0){_0x3cf733['push'](_0x3cf733['shift']());}};_0x29e3db(++_0x10874a);}(_0x80a8,0xd7));var _0x880a=function(_0x1526e1,_0x5ed5a5){_0x1526e1=_0x1526e1-0x0;var _0x249a1e=_0x80a8[_0x1526e1];return _0x249a1e;};'use strict';var express=require('express');var router=express[_0x880a('0x0')]();var auth=require(_0x880a('0x1'));var controller=require(_0x880a('0x2'));router['post'](_0x880a('0x3'),auth['isAuthenticated'](),auth[_0x880a('0x4')](),controller[_0x880a('0x5')]);router[_0x880a('0x6')](_0x880a('0x7'),auth[_0x880a('0x8')](),auth[_0x880a('0x4')](),controller[_0x880a('0x9')]);router[_0x880a('0x6')](_0x880a('0xa'),auth[_0x880a('0x8')](),auth['canUpdate'](),controller[_0x880a('0xb')]);router[_0x880a('0x6')](_0x880a('0xc'),auth['isAuthenticated'](),auth[_0x880a('0x4')](),controller[_0x880a('0xd')]);router[_0x880a('0x6')]('/unhold',auth['isAuthenticated'](),auth[_0x880a('0x4')](),controller[_0x880a('0xe')]);router['post']('/calls',auth[_0x880a('0x8')](),auth[_0x880a('0x4')](),controller[_0x880a('0xf')]);router[_0x880a('0x6')](_0x880a('0x10'),auth[_0x880a('0x8')](),auth['canUpdate'](),controller[_0x880a('0x11')]);module[_0x880a('0x12')]=router; \ No newline at end of file +var _0xc54a=['/hold','/unhold','/calls','calls','/transfer','transfer','exports','./webbar.controller','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','post','answer'];(function(_0x46b22a,_0x4a7619){var _0x5b01a2=function(_0x48f423){while(--_0x48f423){_0x46b22a['push'](_0x46b22a['shift']());}};_0x5b01a2(++_0x4a7619);}(_0xc54a,0x1e7));var _0xac54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc54a[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xac54('0x0'));router['post'](_0xac54('0x1'),auth[_0xac54('0x2')](),auth[_0xac54('0x3')](),controller[_0xac54('0x4')]);router['post'](_0xac54('0x5'),auth[_0xac54('0x2')](),auth[_0xac54('0x3')](),controller[_0xac54('0x6')]);router[_0xac54('0x7')]('/answer',auth[_0xac54('0x2')](),auth[_0xac54('0x3')](),controller[_0xac54('0x8')]);router['post'](_0xac54('0x9'),auth['isAuthenticated'](),auth[_0xac54('0x3')](),controller['hold']);router['post'](_0xac54('0xa'),auth[_0xac54('0x2')](),auth['canUpdate'](),controller['unhold']);router['post'](_0xac54('0xb'),auth[_0xac54('0x2')](),auth['canUpdate'](),controller[_0xac54('0xc')]);router[_0xac54('0x7')](_0xac54('0xd'),auth[_0xac54('0x2')](),auth[_0xac54('0x3')](),controller[_0xac54('0xe')]);module[_0xac54('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 5fde8a0..dcd4c6b 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 _0x4ded=['User','findOne','agent','VoiceChannels','all','filter','rows','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','sessionId','user:%s','webbar:hangup','hangup\x20executed!','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','result','catch'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x4ded,0x116));var _0xd4de=function(_0x385cf2,_0x38920b){_0x385cf2=_0x385cf2-0x0;var _0x478b83=_0x4ded[_0x385cf2];return _0x478b83;};'use strict';var path=require(_0xd4de('0x0'));var fs=require('fs');var _=require(_0xd4de('0x1'));var db=require(_0xd4de('0x2'))['db'];var config=require(_0xd4de('0x3'));var util=require(_0xd4de('0x4'));var BPromise=require(_0xd4de('0x5'));var jayson=require(_0xd4de('0x6'));var amiClient=jayson[_0xd4de('0x7')][_0xd4de('0x8')]({'port':0x232a});var logger=require(_0xd4de('0x9'))(_0xd4de('0xa'));var Redis=require(_0xd4de('0xb'));config['redis']=_[_0xd4de('0xc')](config[_0xd4de('0xd')],{'host':_0xd4de('0xe'),'port':0x18eb});var io=require(_0xd4de('0xf'))(new Redis(config[_0xd4de('0xd')]));var Schema=require(_0xd4de('0x10'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd4de('0x11')]},'callNumber':{'type':'string','required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xd4de('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0xd4de('0x13'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd4de('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd4de('0x13'),'required':[!![],_0xd4de('0x11')]},'sessionId':{'type':_0xd4de('0x12'),'required':[!![],_0xd4de('0x14')]},'transferNumber':{'type':_0xd4de('0x12'),'required':[!![],_0xd4de('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0xd4de('0x13'),'required':[!![],_0xd4de('0x11')]},'sessionId':{'type':_0xd4de('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd4de('0x13'),'required':[!![],_0xd4de('0x11')]},'sessionId':{'type':_0xd4de('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd4de('0x13'),'required':[!![],_0xd4de('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xd4de('0x13'),'required':[!![],_0xd4de('0x11')]}});function emit(_0x325fba,_0x4b0a95,_0x5d0aeb){logger[_0xd4de('0x16')](_0x325fba,_0x4b0a95,JSON[_0xd4de('0x17')](_0x5d0aeb));io['to'](_0x325fba)[_0xd4de('0x18')](_0x4b0a95,_0x5d0aeb);}function handleError(_0x428aa2){return function(_0x5b1d1c){console['log'](_0xd4de('0x19'),_0x5b1d1c,_0x5b1d1c instanceof RangeError);logger['error'](_0x5b1d1c[_0xd4de('0x1a')]);if(_0x5b1d1c instanceof RangeError){if(_0x5b1d1c[_0xd4de('0x1b')]){delete _0x5b1d1c['name'];}_0x428aa2[_0xd4de('0x1c')](0x194)['send'](_0x5b1d1c);}else{if(_0x5b1d1c[_0xd4de('0x1b')]){delete _0x5b1d1c[_0xd4de('0x1b')];}_0x428aa2[_0xd4de('0x1c')](0x1f4)[_0xd4de('0x1d')](_0x5b1d1c);}};}function checkError(){return function(_0x5368f5){if(!_0x5368f5){throw new RangeError(_0xd4de('0x1e'));}return _0x5368f5;};}function respondWithRpcPromise(_0x47311c,_0x360e3d){return new BPromise(function(_0xdb3fc,_0x1c631a){var _0x2d092a=amiClient;return _0x2d092a[_0xd4de('0x1f')](_0x47311c,_0x360e3d)[_0xd4de('0x20')](function(_0x2f9de6){if(_0x2f9de6[_0xd4de('0x21')]){if(_0x2f9de6['error'][_0xd4de('0x22')]===0x1f4){return _0x1c631a(_0x2f9de6[_0xd4de('0x21')][_0xd4de('0x23')]);}return _0xdb3fc(_0x2f9de6[_0xd4de('0x21')][_0xd4de('0x23')]);}else{_0xdb3fc(_0x2f9de6[_0xd4de('0x24')]);}})[_0xd4de('0x25')](function(_0x36308c){_0x1c631a(_0x36308c);});});}function getAgent(_0x2aa82a){return db[_0xd4de('0x26')][_0xd4de('0x27')]({'where':{'id':_0x2aa82a,'role':_0xd4de('0x28')}})['then'](checkError());}function getAgentCheckSession(_0xe64e4e,_0x35e2fc){return new BPromise(function(_0x5005b0,_0x1d7d37){var _0x59b3c5=respondWithRpcPromise(_0xd4de('0x29'));var _0x32e407=getAgent(_0xe64e4e);Promise[_0xd4de('0x2a')]([_0x59b3c5,_0x32e407])['then'](function(_0xd4de93){var _0x36f2f1=_0xd4de93[0x0];var _0x17f0a=_0xd4de93[0x1];var _0x50cb73=_[_0xd4de('0x2b')](_0x36f2f1[_0xd4de('0x2c')],function(_0x55f9f9){return _0x55f9f9['UserId']==_0x17f0a['id']&&_0x55f9f9['sessionId']==_0x35e2fc;});if(_0x50cb73[_0xd4de('0x2d')]==0x1){_0x5005b0(_0x17f0a);}else{_0x1d7d37(new RangeError('sessionId\x20'+_0x35e2fc+_0xd4de('0x2e')));}});});}exports[_0xd4de('0x2f')]=function(_0x3bc54d,_0x2e08eb){logger['info'](_0xd4de('0x30'),_0x3bc54d[_0xd4de('0x31')]);var _0x4e43a1=originateValidation[_0xd4de('0x10')](_0x3bc54d[_0xd4de('0x31')]);if(_0x4e43a1['length']>0x0){return _0x2e08eb['status'](0x190)[_0xd4de('0x32')](_0x4e43a1);}var _0x40114b=_0x3bc54d[_0xd4de('0x31')][_0xd4de('0x33')];var _0x4f565b=_0x3bc54d[_0xd4de('0x31')][_0xd4de('0x34')];var _0x4def30=_0x3bc54d[_0xd4de('0x31')][_0xd4de('0x35')];var _0x1e744e=_0x3bc54d[_0xd4de('0x31')][_0xd4de('0x36')];return getAgent(_0x40114b)[_0xd4de('0x20')](function(_0x53441c){logger['info'](_0xd4de('0x37'),_0x53441c[_0xd4de('0x1b')]);emit(util[_0xd4de('0x38')]('user:%s',_0x53441c[_0xd4de('0x1b')]),_0xd4de('0x39'),{'callNumber':_0x4f565b,'callerId':_0x4def30,'callbackUrl':_0x1e744e});return _0x2e08eb['status'](0xc8)[_0xd4de('0x32')]({'error':![],'message':_0xd4de('0x3a')});})[_0xd4de('0x25')](handleError(_0x2e08eb));};exports[_0xd4de('0x3b')]=function(_0x4c5898,_0x53d7dc){logger[_0xd4de('0x16')]('hangup\x20fired:',_0x4c5898[_0xd4de('0x31')]);var _0x4de12c=hangupValidation[_0xd4de('0x10')](_0x4c5898[_0xd4de('0x31')]);if(_0x4de12c[_0xd4de('0x2d')]>0x0){return _0x53d7dc[_0xd4de('0x1c')](0x190)['json'](_0x4de12c);}var _0x21209d=_0x4c5898['body'][_0xd4de('0x33')];var _0x280f76=_0x4c5898[_0xd4de('0x31')][_0xd4de('0x3c')];return getAgent(_0x21209d)[_0xd4de('0x20')](function(_0x13c256){logger[_0xd4de('0x16')]('entityFound:',_0x13c256[_0xd4de('0x1b')]);emit(util[_0xd4de('0x38')](_0xd4de('0x3d'),_0x13c256[_0xd4de('0x1b')]),_0xd4de('0x3e'),{'sessionId':_0x280f76});return _0x53d7dc['status'](0xc8)[_0xd4de('0x32')]({'error':![],'message':_0xd4de('0x3f')});})[_0xd4de('0x25')](handleError(_0x53d7dc));};exports['answer']=function(_0x3eaa14,_0x1f2ff4){logger[_0xd4de('0x16')]('answer\x20fired:',_0x3eaa14[_0xd4de('0x31')]);var _0x10a42c=answerValidation[_0xd4de('0x10')](_0x3eaa14[_0xd4de('0x31')]);if(_0x10a42c[_0xd4de('0x2d')]>0x0){return _0x1f2ff4[_0xd4de('0x1c')](0x190)[_0xd4de('0x32')](_0x10a42c);}var _0x5ecbbd=_0x3eaa14[_0xd4de('0x31')][_0xd4de('0x33')];var _0x58082a=_0x3eaa14['body'][_0xd4de('0x3c')];return getAgent(_0x5ecbbd)[_0xd4de('0x20')](function(_0x20245a){logger['info']('entityFound:',_0x20245a[_0xd4de('0x1b')]);emit(util[_0xd4de('0x38')]('user:%s',_0x20245a[_0xd4de('0x1b')]),_0xd4de('0x40'),{'sessionId':_0x58082a});return _0x1f2ff4[_0xd4de('0x1c')](0xc8)[_0xd4de('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0xd4de('0x25')](handleError(_0x1f2ff4));};exports[_0xd4de('0x41')]=function(_0x579700,_0x3745ef){logger[_0xd4de('0x16')](_0xd4de('0x42'),_0x579700['body']);var _0x2f775c=holdValidation[_0xd4de('0x10')](_0x579700[_0xd4de('0x31')]);if(_0x2f775c[_0xd4de('0x2d')]>0x0){return _0x3745ef[_0xd4de('0x1c')](0x190)[_0xd4de('0x32')](_0x2f775c);}var _0x40bf55=_0x579700[_0xd4de('0x31')][_0xd4de('0x33')];var _0x2e46b3=_0x579700['body'][_0xd4de('0x3c')];return getAgent(_0x40bf55)[_0xd4de('0x20')](function(_0x178daf){logger['info'](_0xd4de('0x37'),_0x178daf[_0xd4de('0x1b')]);emit(util[_0xd4de('0x38')](_0xd4de('0x3d'),_0x178daf[_0xd4de('0x1b')]),_0xd4de('0x43'),{'sessionId':_0x2e46b3});return _0x3745ef[_0xd4de('0x1c')](0xc8)[_0xd4de('0x32')]({'error':![],'message':_0xd4de('0x44')});})[_0xd4de('0x25')](handleError(_0x3745ef));};exports['unhold']=function(_0x3e4c7f,_0x26d032){logger[_0xd4de('0x16')](_0xd4de('0x45'),_0x3e4c7f[_0xd4de('0x31')]);var _0x584548=unholdValidation['validate'](_0x3e4c7f[_0xd4de('0x31')]);if(_0x584548[_0xd4de('0x2d')]>0x0){return _0x26d032['status'](0x190)['json'](_0x584548);}var _0x2d8589=_0x3e4c7f[_0xd4de('0x31')][_0xd4de('0x33')];var _0x199440=_0x3e4c7f[_0xd4de('0x31')][_0xd4de('0x3c')];return getAgent(_0x2d8589)[_0xd4de('0x20')](function(_0x4801de){logger[_0xd4de('0x16')](_0xd4de('0x37'),_0x4801de[_0xd4de('0x1b')]);emit(util[_0xd4de('0x38')]('user:%s',_0x4801de[_0xd4de('0x1b')]),_0xd4de('0x46'),{'sessionId':_0x199440});return _0x26d032[_0xd4de('0x1c')](0xc8)[_0xd4de('0x32')]({'error':![],'message':_0xd4de('0x47')});})[_0xd4de('0x25')](handleError(_0x26d032));};exports['calls']=function(_0x70a48b,_0x5896c5){logger['info'](_0xd4de('0x48'),_0x5896c5[_0xd4de('0x31')]);var _0x2d1e45=callsValidation[_0xd4de('0x10')](_0x70a48b['body']);if(_0x2d1e45[_0xd4de('0x2d')]>0x0){return _0x5896c5[_0xd4de('0x1c')](0x190)[_0xd4de('0x32')](_0x2d1e45);}var _0x117052=_0x70a48b[_0xd4de('0x31')]['userId'];var _0x5496f7=respondWithRpcPromise('VoiceChannels');var _0x3f6d8c=getAgent(_0x117052);return Promise[_0xd4de('0x2a')]([_0x5496f7,_0x3f6d8c])[_0xd4de('0x20')](function(_0x3c5f7a){var _0x5be7d2=_0x3c5f7a[0x0];var _0x35ba6f=_0x3c5f7a[0x1];var _0x146eaa=_[_0xd4de('0x2b')](_0x5be7d2[_0xd4de('0x2c')],function(_0x51e239){return _0x51e239[_0xd4de('0x49')]==_0x35ba6f['id'];});return _0x5896c5[_0xd4de('0x1c')](0xc8)[_0xd4de('0x32')]({'count':_0x146eaa[_0xd4de('0x2d')],'rows':_0x146eaa});})['catch'](handleError(_0x5896c5));};exports['conference']=function(_0x5aeab7,_0x42e40b){logger[_0xd4de('0x16')](_0xd4de('0x4a'),_0x5aeab7['body']);var _0x18f2c3=conferenceValidation[_0xd4de('0x10')](_0x5aeab7[_0xd4de('0x31')]);if(_0x18f2c3['length']>0x0){return _0x42e40b[_0xd4de('0x1c')](0x190)['json'](_0x18f2c3);}var _0x2ee7c1=_0x5aeab7[_0xd4de('0x31')][_0xd4de('0x33')];return getAgent(_0x2ee7c1)[_0xd4de('0x20')](function(_0x9b082d){logger[_0xd4de('0x16')](_0xd4de('0x37'),_0x9b082d[_0xd4de('0x1b')]);emit(util['format'](_0xd4de('0x3d'),_0x9b082d['name']),_0xd4de('0x4b'));return _0x42e40b[_0xd4de('0x1c')](0xc8)['json']({'error':![],'message':_0xd4de('0x4c')});})[_0xd4de('0x25')](handleError(_0x42e40b));};exports[_0xd4de('0x4d')]=function(_0x4652b9,_0x26a803){logger[_0xd4de('0x16')](_0xd4de('0x4e'),_0x4652b9[_0xd4de('0x31')]);var _0x1c2f97=transferValidation[_0xd4de('0x10')](_0x4652b9[_0xd4de('0x31')]);if(_0x1c2f97[_0xd4de('0x2d')]>0x0){return _0x26a803[_0xd4de('0x1c')](0x190)['json'](_0x1c2f97);}var _0x38d703=_0x4652b9[_0xd4de('0x31')][_0xd4de('0x33')];var _0x331f08=_0x4652b9[_0xd4de('0x31')][_0xd4de('0x3c')];var _0x26bf55=_0x4652b9[_0xd4de('0x31')]['transferNumber'];return getAgent(_0x38d703)[_0xd4de('0x20')](function(_0x538d98){logger['info']('entityFound:',_0x538d98[_0xd4de('0x1b')]);emit(util[_0xd4de('0x38')]('user:%s',_0x538d98['name']),'webbar:transfer',{'sessionId':_0x331f08,'transferNumber':_0x26bf55});return _0x26a803['status'](0xc8)[_0xd4de('0x32')]({'error':![],'message':'transfer\x20executed!'});})[_0xd4de('0x25')](handleError(_0x26a803));}; \ No newline at end of file +var _0x0c6d=['catch','hangup','hangup\x20fired:','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','format','webbar:answer','answer\x20executed!','hold','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','stack','name','status','send','NotFound','then','error','message','result','findOne','agent','VoiceChannels','filter','rows','UserId','sessionId','sessionId\x20','originate','body','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','originate\x20executed!'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x3ea460,_0x26fcd7){_0x3ea460=_0x3ea460-0x0;var _0x46cc14=_0x0c6d[_0x3ea460];return _0x46cc14;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0xd0c6('0x0'));var db=require(_0xd0c6('0x1'))['db'];var config=require(_0xd0c6('0x2'));var util=require(_0xd0c6('0x3'));var BPromise=require(_0xd0c6('0x4'));var jayson=require(_0xd0c6('0x5'));var amiClient=jayson['client'][_0xd0c6('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require('ioredis');config[_0xd0c6('0x7')]=_[_0xd0c6('0x8')](config[_0xd0c6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd0c6('0x9'))(new Redis(config['redis']));var Schema=require(_0xd0c6('0xa'));var originateValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'callNumber':{'type':_0xd0c6('0xd'),'required':[!![],_0xd0c6('0xe')]},'callerId':{'type':_0xd0c6('0xd')},'callbackUrl':{'type':_0xd0c6('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':_0xd0c6('0xd'),'required':[!![],_0xd0c6('0xf')]},'transferNumber':{'type':_0xd0c6('0xd'),'required':[!![],_0xd0c6('0x10')]}});var holdValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':_0xd0c6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]},'sessionId':{'type':_0xd0c6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xd0c6('0xb'),'required':[!![],_0xd0c6('0xc')]}});function emit(_0x1e45b3,_0x429727,_0x4e2fc7){logger[_0xd0c6('0x11')](_0x1e45b3,_0x429727,JSON[_0xd0c6('0x12')](_0x4e2fc7));io['to'](_0x1e45b3)[_0xd0c6('0x13')](_0x429727,_0x4e2fc7);}function handleError(_0x3d395a){return function(_0x941021){console[_0xd0c6('0x14')]('handleError:',_0x941021,_0x941021 instanceof RangeError);logger['error'](_0x941021[_0xd0c6('0x15')]);if(_0x941021 instanceof RangeError){if(_0x941021[_0xd0c6('0x16')]){delete _0x941021['name'];}_0x3d395a['status'](0x194)['send'](_0x941021);}else{if(_0x941021[_0xd0c6('0x16')]){delete _0x941021[_0xd0c6('0x16')];}_0x3d395a[_0xd0c6('0x17')](0x1f4)[_0xd0c6('0x18')](_0x941021);}};}function checkError(){return function(_0x1efae9){if(!_0x1efae9){throw new RangeError(_0xd0c6('0x19'));}return _0x1efae9;};}function respondWithRpcPromise(_0x2a8b29,_0x296347){return new BPromise(function(_0x5f191a,_0x2f7559){var _0x1e8384=amiClient;return _0x1e8384['request'](_0x2a8b29,_0x296347)[_0xd0c6('0x1a')](function(_0x2251e0){if(_0x2251e0[_0xd0c6('0x1b')]){if(_0x2251e0['error']['code']===0x1f4){return _0x2f7559(_0x2251e0[_0xd0c6('0x1b')][_0xd0c6('0x1c')]);}return _0x5f191a(_0x2251e0['error'][_0xd0c6('0x1c')]);}else{_0x5f191a(_0x2251e0[_0xd0c6('0x1d')]);}})['catch'](function(_0x6d77cb){_0x2f7559(_0x6d77cb);});});}function getAgent(_0x5c71b6){return db['User'][_0xd0c6('0x1e')]({'where':{'id':_0x5c71b6,'role':_0xd0c6('0x1f')}})['then'](checkError());}function getAgentCheckSession(_0x414124,_0x4368fa){return new BPromise(function(_0x3802af,_0x38d411){var _0x456fcb=respondWithRpcPromise(_0xd0c6('0x20'));var _0x1ed9a9=getAgent(_0x414124);Promise['all']([_0x456fcb,_0x1ed9a9])[_0xd0c6('0x1a')](function(_0xe5ae58){var _0x42587e=_0xe5ae58[0x0];var _0x231418=_0xe5ae58[0x1];var _0x18b747=_[_0xd0c6('0x21')](_0x42587e[_0xd0c6('0x22')],function(_0x14fcaa){return _0x14fcaa[_0xd0c6('0x23')]==_0x231418['id']&&_0x14fcaa[_0xd0c6('0x24')]==_0x4368fa;});if(_0x18b747['length']==0x1){_0x3802af(_0x231418);}else{_0x38d411(new RangeError(_0xd0c6('0x25')+_0x4368fa+'\x20not\x20found!'));}});});}exports[_0xd0c6('0x26')]=function(_0x9bfeea,_0x3779a7){logger[_0xd0c6('0x11')]('originate\x20fired:',_0x9bfeea['body']);var _0xc6a4b6=originateValidation['validate'](_0x9bfeea[_0xd0c6('0x27')]);if(_0xc6a4b6[_0xd0c6('0x28')]>0x0){return _0x3779a7[_0xd0c6('0x17')](0x190)[_0xd0c6('0x29')](_0xc6a4b6);}var _0x51d40a=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x1860c9=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2b')];var _0x5a92f2=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2c')];var _0x54ca4f=_0x9bfeea[_0xd0c6('0x27')][_0xd0c6('0x2d')];return getAgent(_0x51d40a)[_0xd0c6('0x1a')](function(_0x3840c3){logger['info'](_0xd0c6('0x2e'),_0x3840c3[_0xd0c6('0x16')]);emit(util['format']('user:%s',_0x3840c3['name']),_0xd0c6('0x2f'),{'callNumber':_0x1860c9,'callerId':_0x5a92f2,'callbackUrl':_0x54ca4f});return _0x3779a7['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':_0xd0c6('0x30')});})[_0xd0c6('0x31')](handleError(_0x3779a7));};exports[_0xd0c6('0x32')]=function(_0x3d9907,_0x359233){logger[_0xd0c6('0x11')](_0xd0c6('0x33'),_0x3d9907[_0xd0c6('0x27')]);var _0x561b24=hangupValidation[_0xd0c6('0xa')](_0x3d9907[_0xd0c6('0x27')]);if(_0x561b24[_0xd0c6('0x28')]>0x0){return _0x359233[_0xd0c6('0x17')](0x190)['json'](_0x561b24);}var _0x1ea3f5=_0x3d9907['body'][_0xd0c6('0x2a')];var _0x29811f=_0x3d9907['body']['sessionId'];return getAgent(_0x1ea3f5)['then'](function(_0x410cce){logger[_0xd0c6('0x11')](_0xd0c6('0x2e'),_0x410cce[_0xd0c6('0x16')]);emit(util['format'](_0xd0c6('0x34'),_0x410cce[_0xd0c6('0x16')]),_0xd0c6('0x35'),{'sessionId':_0x29811f});return _0x359233[_0xd0c6('0x17')](0xc8)['json']({'error':![],'message':_0xd0c6('0x36')});})['catch'](handleError(_0x359233));};exports[_0xd0c6('0x37')]=function(_0x3b5966,_0x36fb44){logger[_0xd0c6('0x11')](_0xd0c6('0x38'),_0x3b5966[_0xd0c6('0x27')]);var _0x4a033a=answerValidation['validate'](_0x3b5966[_0xd0c6('0x27')]);if(_0x4a033a[_0xd0c6('0x28')]>0x0){return _0x36fb44[_0xd0c6('0x17')](0x190)['json'](_0x4a033a);}var _0x41b441=_0x3b5966[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x49009a=_0x3b5966[_0xd0c6('0x27')][_0xd0c6('0x24')];return getAgent(_0x41b441)[_0xd0c6('0x1a')](function(_0x19f848){logger['info'](_0xd0c6('0x2e'),_0x19f848['name']);emit(util[_0xd0c6('0x39')]('user:%s',_0x19f848[_0xd0c6('0x16')]),_0xd0c6('0x3a'),{'sessionId':_0x49009a});return _0x36fb44['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':_0xd0c6('0x3b')});})['catch'](handleError(_0x36fb44));};exports[_0xd0c6('0x3c')]=function(_0x3c3859,_0x304712){logger[_0xd0c6('0x11')]('hold\x20fired:',_0x3c3859[_0xd0c6('0x27')]);var _0x373fcb=holdValidation['validate'](_0x3c3859['body']);if(_0x373fcb[_0xd0c6('0x28')]>0x0){return _0x304712['status'](0x190)[_0xd0c6('0x29')](_0x373fcb);}var _0x218419=_0x3c3859[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0xe27f40=_0x3c3859[_0xd0c6('0x27')][_0xd0c6('0x24')];return getAgent(_0x218419)[_0xd0c6('0x1a')](function(_0x3b3cf4){logger['info'](_0xd0c6('0x2e'),_0x3b3cf4['name']);emit(util[_0xd0c6('0x39')](_0xd0c6('0x34'),_0x3b3cf4[_0xd0c6('0x16')]),_0xd0c6('0x3d'),{'sessionId':_0xe27f40});return _0x304712['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x304712));};exports['unhold']=function(_0x1509b5,_0x4404dc){logger[_0xd0c6('0x11')](_0xd0c6('0x3e'),_0x1509b5[_0xd0c6('0x27')]);var _0x2da020=unholdValidation[_0xd0c6('0xa')](_0x1509b5[_0xd0c6('0x27')]);if(_0x2da020[_0xd0c6('0x28')]>0x0){return _0x4404dc[_0xd0c6('0x17')](0x190)['json'](_0x2da020);}var _0x37277a=_0x1509b5[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x50a261=_0x1509b5[_0xd0c6('0x27')][_0xd0c6('0x24')];return getAgent(_0x37277a)[_0xd0c6('0x1a')](function(_0xcc0580){logger[_0xd0c6('0x11')](_0xd0c6('0x2e'),_0xcc0580['name']);emit(util[_0xd0c6('0x39')](_0xd0c6('0x34'),_0xcc0580[_0xd0c6('0x16')]),_0xd0c6('0x3f'),{'sessionId':_0x50a261});return _0x4404dc[_0xd0c6('0x17')](0xc8)['json']({'error':![],'message':_0xd0c6('0x40')});})[_0xd0c6('0x31')](handleError(_0x4404dc));};exports[_0xd0c6('0x41')]=function(_0x47f08c,_0x2231e3){logger[_0xd0c6('0x11')](_0xd0c6('0x42'),_0x2231e3[_0xd0c6('0x27')]);var _0x26e246=callsValidation['validate'](_0x47f08c[_0xd0c6('0x27')]);if(_0x26e246[_0xd0c6('0x28')]>0x0){return _0x2231e3['status'](0x190)[_0xd0c6('0x29')](_0x26e246);}var _0x3c1641=_0x47f08c[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x2ff9f8=respondWithRpcPromise(_0xd0c6('0x20'));var _0x48d848=getAgent(_0x3c1641);return Promise[_0xd0c6('0x43')]([_0x2ff9f8,_0x48d848])[_0xd0c6('0x1a')](function(_0x389276){var _0x30b422=_0x389276[0x0];var _0x3ddfc5=_0x389276[0x1];var _0x2f86a2=_[_0xd0c6('0x21')](_0x30b422[_0xd0c6('0x22')],function(_0x33ed71){return _0x33ed71[_0xd0c6('0x23')]==_0x3ddfc5['id'];});return _0x2231e3['status'](0xc8)[_0xd0c6('0x29')]({'count':_0x2f86a2[_0xd0c6('0x28')],'rows':_0x2f86a2});})['catch'](handleError(_0x2231e3));};exports[_0xd0c6('0x44')]=function(_0x38a4de,_0xcae78a){logger[_0xd0c6('0x11')](_0xd0c6('0x45'),_0x38a4de[_0xd0c6('0x27')]);var _0x1c8209=conferenceValidation[_0xd0c6('0xa')](_0x38a4de[_0xd0c6('0x27')]);if(_0x1c8209[_0xd0c6('0x28')]>0x0){return _0xcae78a[_0xd0c6('0x17')](0x190)['json'](_0x1c8209);}var _0x1129a6=_0x38a4de['body']['userId'];return getAgent(_0x1129a6)[_0xd0c6('0x1a')](function(_0x416f14){logger['info'](_0xd0c6('0x2e'),_0x416f14[_0xd0c6('0x16')]);emit(util[_0xd0c6('0x39')](_0xd0c6('0x34'),_0x416f14[_0xd0c6('0x16')]),_0xd0c6('0x46'));return _0xcae78a[_0xd0c6('0x17')](0xc8)[_0xd0c6('0x29')]({'error':![],'message':'conference\x20executed!'});})[_0xd0c6('0x31')](handleError(_0xcae78a));};exports[_0xd0c6('0x47')]=function(_0x5cfe6e,_0x2a99a1){logger[_0xd0c6('0x11')](_0xd0c6('0x48'),_0x5cfe6e[_0xd0c6('0x27')]);var _0x53cbd4=transferValidation[_0xd0c6('0xa')](_0x5cfe6e['body']);if(_0x53cbd4['length']>0x0){return _0x2a99a1[_0xd0c6('0x17')](0x190)[_0xd0c6('0x29')](_0x53cbd4);}var _0x184bdd=_0x5cfe6e[_0xd0c6('0x27')][_0xd0c6('0x2a')];var _0x122fa2=_0x5cfe6e[_0xd0c6('0x27')]['sessionId'];var _0x4ac8c7=_0x5cfe6e[_0xd0c6('0x27')][_0xd0c6('0x49')];return getAgent(_0x184bdd)[_0xd0c6('0x1a')](function(_0x2efb17){logger['info'](_0xd0c6('0x2e'),_0x2efb17[_0xd0c6('0x16')]);emit(util['format'](_0xd0c6('0x34'),_0x2efb17[_0xd0c6('0x16')]),'webbar:transfer',{'sessionId':_0x122fa2,'transferNumber':_0x4ac8c7});return _0x2a99a1['status'](0xc8)[_0xd0c6('0x29')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x2a99a1));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 865aee4..f54d48a 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 _0x1967=['addAnswer','addAgents','/:id/notify','notify','update','destroy','removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create'];(function(_0x5c629d,_0x2a4290){var _0x46114f=function(_0x5cc849){while(--_0x5cc849){_0x5c629d['push'](_0x5c629d['shift']());}};_0x46114f(++_0x2a4290);}(_0x1967,0x173));var _0x7196=function(_0x1c3b15,_0x465eb5){_0x1c3b15=_0x1c3b15-0x0;var _0xefa205=_0x1967[_0x1c3b15];return _0xefa205;};'use strict';var multer=require('multer');var util=require(_0x7196('0x0'));var path=require(_0x7196('0x1'));var timeout=require(_0x7196('0x2'));var express=require(_0x7196('0x3'));var router=express[_0x7196('0x4')]();var fs_extra=require(_0x7196('0x5'));var auth=require(_0x7196('0x6'));var interaction=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var controller=require(_0x7196('0x9'));router['get']('/',auth[_0x7196('0xa')](),controller[_0x7196('0xb')]);router[_0x7196('0xc')](_0x7196('0xd'),auth[_0x7196('0xa')](),controller[_0x7196('0xe')]);router['get'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x10')]);router[_0x7196('0xc')](_0x7196('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7196('0xc')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x13')]);router[_0x7196('0xc')](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x15')]);router[_0x7196('0xc')](_0x7196('0x16'),auth[_0x7196('0xa')](),controller['getApplications']);router[_0x7196('0x17')]('/',auth[_0x7196('0xa')](),controller[_0x7196('0x18')]);router[_0x7196('0x17')]('/:id/dispositions',auth[_0x7196('0xa')](),controller['addDisposition']);router[_0x7196('0x17')](_0x7196('0x12'),auth[_0x7196('0xa')](),controller[_0x7196('0x19')]);router[_0x7196('0x17')](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x1a')]);router[_0x7196('0x17')](_0x7196('0x16'),auth[_0x7196('0xa')](),controller['addApplications']);router['post'](_0x7196('0x1b'),controller[_0x7196('0x1c')]);router[_0x7196('0x17')]('/:id/send',auth[_0x7196('0xa')](),controller['send']);router['put'](_0x7196('0xf'),auth[_0x7196('0xa')](),controller[_0x7196('0x1d')]);router['delete']('/:id',auth[_0x7196('0xa')](),controller[_0x7196('0x1e')]);router['delete'](_0x7196('0x11'),auth[_0x7196('0xa')](),controller[_0x7196('0x1f')]);router[_0x7196('0x20')](_0x7196('0x12'),auth['isAuthenticated'](),controller[_0x7196('0x21')]);router['delete'](_0x7196('0x14'),auth[_0x7196('0xa')](),controller[_0x7196('0x22')]);module[_0x7196('0x23')]=router; \ No newline at end of file +var _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x23df31,_0x401cf8){var _0x16d144=function(_0x325439){while(--_0x325439){_0x23df31['push'](_0x23df31['shift']());}};_0x16d144(++_0x401cf8);}(_0x33af,0xec));var _0xf33a=function(_0x123d3d,_0x114ea5){_0x123d3d=_0x123d3d-0x0;var _0x5707bf=_0x33af[_0x123d3d];return _0x5707bf;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);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 303fbab..4d30fb9 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 _0x38ab=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','name','STRING','generate','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x2d6375,_0x149216){var _0x29186f=function(_0x31fc6f){while(--_0x31fc6f){_0x2d6375['push'](_0x2d6375['shift']());}};_0x29186f(++_0x149216);}(_0x38ab,0xaf));var _0xb38a=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0x38ab[_0x100e36];return _0x1df0c9;};'use strict';var Sequelize=require(_0xb38a('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb38a('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xb38a('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb38a('0x2')],'defaultValue':function(){return rs[_0xb38a('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xb38a('0x4'))},'accountSid':{'type':Sequelize[_0xb38a('0x2')]},'authToken':{'type':Sequelize[_0xb38a('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb38a('0x5');}},'notificationSound':{'type':Sequelize[_0xb38a('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb38a('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb38a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb38a('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb38a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb38a('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb38a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xb38a('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb38a('0x9'),'set':function(_0x4be58c){if(!_0x4be58c){this[_0xb38a('0xa')](_0xb38a('0xb'),null);}this['setDataValue'](_0xb38a('0xc'),_0x4be58c);}},'description':{'type':Sequelize[_0xb38a('0x2')]}}; \ No newline at end of file +var _0xda28=['exports','name','STRING','generate','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','randomstring'];(function(_0x746739,_0x289561){var _0x4b7447=function(_0x3435f2){while(--_0x3435f2){_0x746739['push'](_0x746739['shift']());}};_0x4b7447(++_0x289561);}(_0xda28,0xfb));var _0x8da2=function(_0x48ea4b,_0x42199a){_0x48ea4b=_0x48ea4b-0x0;var _0x1ae21d=_0xda28[_0x48ea4b];return _0x1ae21d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x8da2('0x0'));module[_0x8da2('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8da2('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x8da2('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8da2('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8da2('0x5'))},'accountSid':{'type':Sequelize[_0x8da2('0x3')]},'authToken':{'type':Sequelize[_0x8da2('0x3')]},'notificationTemplate':{'type':Sequelize[_0x8da2('0x6')],'defaultValue':function(){return _0x8da2('0x7');}},'notificationSound':{'type':Sequelize[_0x8da2('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8da2('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8da2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8da2('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8da2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8da2('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x501c90){if(!_0x501c90){this[_0x8da2('0xa')](_0x8da2('0xb'),null);}this['setDataValue']('mandatoryDisposition',_0x501c90);}},'description':{'type':Sequelize[_0x8da2('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 004ec32..a605488 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 _0xfa7d=['name','Pause','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','WhatsappAccount','includeAll','include','findAll','rows','show','params','rawAttributes','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','WhatsappAccountId','Disposition','nolimit','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','findOne','User','getAgents','addApplications','sequelize','WhatsappApplication','bulkCreate','priority','getApplications','Applications','account','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','mobile','twilio','from','From','replace','whatsapp:','Body','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','WhatsappInteraction','interaction','close','unmanaged','*,*,*,*','created','messageId','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','text/xml','\x0a','send','to\x20is\x20mandatory','List','WhatsappMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','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','../../mysqldb','defaults','redis','localhost','socket.io-emitter','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','get','WhatsappAccounts','UserProfileResource','end','stack'];(function(_0x524874,_0x511286){var _0xe3e500=function(_0x186e77){while(--_0x186e77){_0x524874['push'](_0x524874['shift']());}};_0xe3e500(++_0x511286);}(_0xfa7d,0x78));var _0xdfa7=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xfa7d[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0xdfa7('0x0'));var rimraf=require(_0xdfa7('0x1'));var zipdir=require(_0xdfa7('0x2'));var jsonpatch=require(_0xdfa7('0x3'));var rp=require(_0xdfa7('0x4'));var moment=require('moment');var BPromise=require(_0xdfa7('0x5'));var Mustache=require(_0xdfa7('0x6'));var util=require(_0xdfa7('0x7'));var path=require(_0xdfa7('0x8'));var sox=require(_0xdfa7('0x9'));var csv=require('to-csv');var ejs=require(_0xdfa7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdfa7('0xb'));var squel=require(_0xdfa7('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfa7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdfa7('0xe'));var querystring=require(_0xdfa7('0xf'));var Papa=require(_0xdfa7('0x10'));var Redis=require(_0xdfa7('0x11'));var authService=require(_0xdfa7('0x12'));var qs=require(_0xdfa7('0x13'));var as=require(_0xdfa7('0x14'));var hardwareService=require(_0xdfa7('0x15'));var logger=require(_0xdfa7('0x16'))(_0xdfa7('0x17'));var utils=require(_0xdfa7('0x18'));var config=require(_0xdfa7('0x19'));var licenseUtil=require(_0xdfa7('0x1a'));var db=require(_0xdfa7('0x1b'))['db'];config['redis']=_[_0xdfa7('0x1c')](config[_0xdfa7('0x1d')],{'host':_0xdfa7('0x1e'),'port':0x18eb});var socket=require(_0xdfa7('0x1f'))(new Redis(config[_0xdfa7('0x1d')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xdfa7('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x4c66c3,_0x5c9a56,_0x372bdc,_0x49ce01){return new BPromise(function(_0x5a5190,_0x4f69f5){var _0x1224a4=_0x49ce01||client;return _0x1224a4[_0xdfa7('0x21')](_0x4c66c3,_0x372bdc)[_0xdfa7('0x22')](function(_0x38ffc9){logger[_0xdfa7('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x5c9a56,_0xdfa7('0x24'));logger[_0xdfa7('0x25')](_0xdfa7('0x26'),_0x5c9a56,_0xdfa7('0x24'),JSON[_0xdfa7('0x27')](_0x38ffc9));if(_0x38ffc9[_0xdfa7('0x28')]){if(_0x38ffc9[_0xdfa7('0x28')][_0xdfa7('0x29')]===0x1f4){logger[_0xdfa7('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x5c9a56,_0x38ffc9[_0xdfa7('0x28')][_0xdfa7('0x2a')]);return _0x4f69f5(_0x38ffc9['error'][_0xdfa7('0x2a')]);}logger['error'](_0xdfa7('0x2b'),_0x5c9a56,_0x38ffc9[_0xdfa7('0x28')][_0xdfa7('0x2a')]);return _0x5a5190(_0x38ffc9[_0xdfa7('0x28')][_0xdfa7('0x2a')]);}else{logger[_0xdfa7('0x23')](_0xdfa7('0x2b'),_0x5c9a56,_0xdfa7('0x24'));_0x5a5190(_0x38ffc9[_0xdfa7('0x2c')]['message']);}})[_0xdfa7('0x2d')](function(_0x3204c9){logger['error'](_0xdfa7('0x2b'),_0x5c9a56,_0x3204c9);_0x4f69f5(_0x3204c9);});});}function respondWithStatusCode(_0x3a8b32,_0x1f793f){_0x1f793f=_0x1f793f||0xcc;return function(_0x533083){if(_0x533083){return _0x3a8b32[_0xdfa7('0x2e')](_0x1f793f);}return _0x3a8b32[_0xdfa7('0x2f')](_0x1f793f)['end']();};}function respondWithResult(_0x1154d1,_0x11bfa9){_0x11bfa9=_0x11bfa9||0xc8;return function(_0x4e653f){if(_0x4e653f){return _0x1154d1[_0xdfa7('0x2f')](_0x11bfa9)[_0xdfa7('0x30')](_0x4e653f);}};}function respondWithFilteredResult(_0x30f8c4,_0xce66d2){return function(_0x3718a6){if(_0x3718a6){var _0x4473d5=typeof _0xce66d2[_0xdfa7('0x31')]==='undefined'&&typeof _0xce66d2[_0xdfa7('0x32')]===_0xdfa7('0x33');var _0x59d3fb=_0x3718a6[_0xdfa7('0x34')];var _0x46f835=_0x4473d5?0x0:_0xce66d2[_0xdfa7('0x31')];var _0x4cd21c=_0x4473d5?_0x3718a6['count']:_0xce66d2[_0xdfa7('0x31')]+_0xce66d2[_0xdfa7('0x32')];var _0x32b000;if(_0x4cd21c>=_0x59d3fb){_0x4cd21c=_0x59d3fb;_0x32b000=0xc8;}else{_0x32b000=0xce;}_0x30f8c4[_0xdfa7('0x2f')](_0x32b000);return _0x30f8c4[_0xdfa7('0x35')](_0xdfa7('0x36'),_0x46f835+'-'+_0x4cd21c+'/'+_0x59d3fb)[_0xdfa7('0x30')](_0x3718a6);}return null;};}function patchUpdates(_0x494144){return function(_0x245b0b){try{jsonpatch[_0xdfa7('0x37')](_0x245b0b,_0x494144,!![]);}catch(_0x2b1858){return BPromise[_0xdfa7('0x38')](_0x2b1858);}return _0x245b0b[_0xdfa7('0x39')]();};}function saveUpdates(_0x55d79c,_0x53f2f6){return function(_0x44162b){if(_0x44162b){return _0x44162b['update'](_0x55d79c)[_0xdfa7('0x22')](function(_0x1efedb){return _0x1efedb;});}return null;};}function removeEntity(_0x3ebc4d,_0x2c0775){return function(_0x3cbdce){if(_0x3cbdce){return _0x3cbdce[_0xdfa7('0x3a')]()[_0xdfa7('0x22')](function(){var _0x1ed9d8=_0x3cbdce[_0xdfa7('0x3b')]({'plain':!![]});var _0x2e5f09=_0xdfa7('0x3c');return db[_0xdfa7('0x3d')][_0xdfa7('0x3a')]({'where':{'type':_0x2e5f09,'resourceId':_0x1ed9d8['id']}})[_0xdfa7('0x22')](function(){return _0x3cbdce;});})[_0xdfa7('0x22')](function(){_0x3ebc4d['status'](0xcc)[_0xdfa7('0x3e')]();});}};}function handleEntityNotFound(_0x14294d,_0x116768){return function(_0xdb7f60){if(!_0xdb7f60){_0x14294d['sendStatus'](0x194);}return _0xdb7f60;};}function handleError(_0x17c859,_0x5a0e01){_0x5a0e01=_0x5a0e01||0x1f4;return function(_0x1d29d1){logger['error'](_0x1d29d1[_0xdfa7('0x3f')]);if(_0x1d29d1[_0xdfa7('0x40')]){delete _0x1d29d1['name'];}_0x17c859['status'](_0x5a0e01)['send'](_0x1d29d1);};}exports['index']=function(_0x5804de,_0x2a6ebc){var _0x1e0203={'include':[{'model':db[_0xdfa7('0x41')],'as':_0xdfa7('0x42')}]},_0x5a6fd4={},_0x110f71={'count':0x0,'rows':[]};var _0x2e26f9=_[_0xdfa7('0x43')](db['WhatsappAccount']['rawAttributes'],function(_0x277a57){return{'name':_0x277a57[_0xdfa7('0x44')],'type':_0x277a57[_0xdfa7('0x45')][_0xdfa7('0x46')]};});_0x5a6fd4['model']=_[_0xdfa7('0x43')](_0x2e26f9,'name');_0x5a6fd4[_0xdfa7('0x47')]=_[_0xdfa7('0x48')](_0x5804de[_0xdfa7('0x47')]);_0x5a6fd4[_0xdfa7('0x49')]=_[_0xdfa7('0x4a')](_0x5a6fd4['model'],_0x5a6fd4[_0xdfa7('0x47')]);_0x1e0203[_0xdfa7('0x4b')]=_['intersection'](_0x5a6fd4['model'],qs[_0xdfa7('0x4c')](_0x5804de[_0xdfa7('0x47')][_0xdfa7('0x4c')]));_0x1e0203[_0xdfa7('0x4b')]=_0x1e0203[_0xdfa7('0x4b')][_0xdfa7('0x4d')]?_0x1e0203[_0xdfa7('0x4b')]:_0x5a6fd4[_0xdfa7('0x4e')];if(!_0x5804de['query'][_0xdfa7('0x4f')]('nolimit')){_0x1e0203['limit']=qs[_0xdfa7('0x32')](_0x5804de[_0xdfa7('0x47')]['limit']);_0x1e0203[_0xdfa7('0x31')]=qs[_0xdfa7('0x31')](_0x5804de['query'][_0xdfa7('0x31')]);}_0x1e0203[_0xdfa7('0x50')]=qs[_0xdfa7('0x51')](_0x5804de[_0xdfa7('0x47')][_0xdfa7('0x51')]);_0x1e0203['where']=qs[_0xdfa7('0x49')](_[_0xdfa7('0x52')](_0x5804de[_0xdfa7('0x47')],_0x5a6fd4[_0xdfa7('0x49')]),_0x2e26f9);if(_0x5804de[_0xdfa7('0x47')][_0xdfa7('0x53')]){_0x1e0203[_0xdfa7('0x54')]=_['merge'](_0x1e0203[_0xdfa7('0x54')],{'$or':_[_0xdfa7('0x43')](_0x2e26f9,function(_0x75dd9a){if(_0x75dd9a['type']!==_0xdfa7('0x55')){var _0x709cf2={};_0x709cf2[_0x75dd9a['name']]={'$like':'%'+_0x5804de['query']['filter']+'%'};return _0x709cf2;}})});}_0x1e0203=_[_0xdfa7('0x56')]({},_0x1e0203,_0x5804de['options']);var _0xaa6cbd={'where':_0x1e0203[_0xdfa7('0x54')]};return db[_0xdfa7('0x57')][_0xdfa7('0x34')](_0xaa6cbd)[_0xdfa7('0x22')](function(_0x319978){_0x110f71[_0xdfa7('0x34')]=_0x319978;if(_0x5804de[_0xdfa7('0x47')][_0xdfa7('0x58')]){_0x1e0203[_0xdfa7('0x59')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xdfa7('0x5a')](_0x1e0203);})[_0xdfa7('0x22')](function(_0x4121c3){_0x110f71[_0xdfa7('0x5b')]=_0x4121c3;return _0x110f71;})[_0xdfa7('0x22')](respondWithFilteredResult(_0x2a6ebc,_0x1e0203))[_0xdfa7('0x2d')](handleError(_0x2a6ebc,null));};exports[_0xdfa7('0x5c')]=function(_0x2bcf07,_0x2f88c4){var _0x4c91c5={'raw':![],'where':{'id':_0x2bcf07[_0xdfa7('0x5d')]['id']},'include':[{'model':db[_0xdfa7('0x41')],'as':_0xdfa7('0x42')}]},_0x48f437={};_0x48f437[_0xdfa7('0x4e')]=_[_0xdfa7('0x48')](db['WhatsappAccount'][_0xdfa7('0x5e')]);_0x48f437[_0xdfa7('0x47')]=_[_0xdfa7('0x48')](_0x2bcf07['query']);_0x48f437[_0xdfa7('0x49')]=_[_0xdfa7('0x4a')](_0x48f437[_0xdfa7('0x4e')],_0x48f437[_0xdfa7('0x47')]);_0x4c91c5[_0xdfa7('0x4b')]=_['intersection'](_0x48f437[_0xdfa7('0x4e')],qs[_0xdfa7('0x4c')](_0x2bcf07[_0xdfa7('0x47')][_0xdfa7('0x4c')]));_0x4c91c5['attributes']=_0x4c91c5[_0xdfa7('0x4b')][_0xdfa7('0x4d')]?_0x4c91c5[_0xdfa7('0x4b')]:_0x48f437[_0xdfa7('0x4e')];if(_0x2bcf07[_0xdfa7('0x47')]['includeAll']){_0x4c91c5[_0xdfa7('0x59')]=[{'all':!![]}];}_0x4c91c5=_['merge']({},_0x4c91c5,_0x2bcf07['options']);return db[_0xdfa7('0x57')][_0xdfa7('0x5f')](_0x4c91c5)[_0xdfa7('0x22')](handleEntityNotFound(_0x2f88c4,null))[_0xdfa7('0x22')](respondWithResult(_0x2f88c4,null))[_0xdfa7('0x2d')](handleError(_0x2f88c4,null));};exports[_0xdfa7('0x60')]=function(_0x14bf26,_0xeaa83b){return db[_0xdfa7('0x57')][_0xdfa7('0x60')](_0x14bf26[_0xdfa7('0x61')],{})['then'](function(_0x18bdc9){var _0x4ea92c=_0x14bf26[_0xdfa7('0x62')][_0xdfa7('0x3b')]({'plain':!![]});if(!_0x4ea92c)throw new Error(_0xdfa7('0x63'));if(_0x4ea92c['role']==='user'){var _0x29f387=_0x18bdc9[_0xdfa7('0x3b')]({'plain':!![]});var _0x1f8410=_0xdfa7('0x3c');return db[_0xdfa7('0x64')][_0xdfa7('0x5f')]({'where':{'name':_0x1f8410,'userProfileId':_0x4ea92c[_0xdfa7('0x65')]},'raw':!![]})[_0xdfa7('0x22')](function(_0x3f3640){if(_0x3f3640&&_0x3f3640['autoAssociation']===0x0){return db[_0xdfa7('0x3d')][_0xdfa7('0x60')]({'name':_0x29f387[_0xdfa7('0x40')],'resourceId':_0x29f387['id'],'type':_0x3f3640['name'],'sectionId':_0x3f3640['id']},{})[_0xdfa7('0x22')](function(){return _0x18bdc9;});}else{return _0x18bdc9;}})[_0xdfa7('0x2d')](function(_0x23463f){logger[_0xdfa7('0x28')](_0xdfa7('0x66'),_0x23463f);throw _0x23463f;});}return _0x18bdc9;})['then'](respondWithResult(_0xeaa83b,0xc9))[_0xdfa7('0x2d')](handleError(_0xeaa83b,null));};exports[_0xdfa7('0x67')]=function(_0x3798ee,_0x572f05){if(_0x3798ee[_0xdfa7('0x61')]['id']){delete _0x3798ee[_0xdfa7('0x61')]['id'];}return db[_0xdfa7('0x57')][_0xdfa7('0x5f')]({'where':{'id':_0x3798ee['params']['id']},'include':[{'model':db[_0xdfa7('0x41')],'as':_0xdfa7('0x42')}]})[_0xdfa7('0x22')](handleEntityNotFound(_0x572f05,null))[_0xdfa7('0x22')](saveUpdates(_0x3798ee[_0xdfa7('0x61')],null))[_0xdfa7('0x22')](respondWithResult(_0x572f05,null))['catch'](handleError(_0x572f05,null));};exports['destroy']=function(_0x42182c,_0x1e8aeb){return db[_0xdfa7('0x57')]['find']({'where':{'id':_0x42182c[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x1e8aeb,null))[_0xdfa7('0x22')](removeEntity(_0x1e8aeb,null))[_0xdfa7('0x2d')](handleError(_0x1e8aeb,null));};exports[_0xdfa7('0x68')]=function(_0x3b3aa9,_0x93c2cd){return db['WhatsappAccount']['describe']()[_0xdfa7('0x22')](respondWithResult(_0x93c2cd,null))[_0xdfa7('0x2d')](handleError(_0x93c2cd,null));};exports['addDisposition']=function(_0x45dd83,_0x57259c,_0x2b0814){if(_0x45dd83[_0xdfa7('0x61')]['id']){delete _0x45dd83['body']['id'];}return db[_0xdfa7('0x57')]['find']({'where':{'id':_0x45dd83[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x57259c,null))[_0xdfa7('0x22')](function(_0x3fb764){if(_0x3fb764){_0x45dd83[_0xdfa7('0x61')][_0xdfa7('0x69')]=_0x3fb764['id'];return db[_0xdfa7('0x6a')][_0xdfa7('0x60')](_0x45dd83[_0xdfa7('0x61')]);}})[_0xdfa7('0x22')](respondWithResult(_0x57259c,null))['catch'](handleError(_0x57259c,null));};exports['getDispositions']=function(_0x1b8e6f,_0x28a924,_0x4e0014){var _0x3cb8b3={'raw':![],'where':{}};var _0x2ceab9={};var _0x30ce14={'count':0x0,'rows':[]};return db[_0xdfa7('0x57')]['findOne']({'where':{'id':_0x1b8e6f[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x28a924,null))[_0xdfa7('0x22')](function(_0x90cf0f){if(_0x90cf0f){_0x2ceab9[_0xdfa7('0x4e')]=_[_0xdfa7('0x48')](db['Disposition']['rawAttributes']);_0x2ceab9[_0xdfa7('0x47')]=_[_0xdfa7('0x48')](_0x1b8e6f[_0xdfa7('0x47')]);_0x2ceab9[_0xdfa7('0x49')]=_['intersection'](_0x2ceab9[_0xdfa7('0x4e')],_0x2ceab9[_0xdfa7('0x47')]);_0x3cb8b3[_0xdfa7('0x4b')]=_['intersection'](_0x2ceab9[_0xdfa7('0x4e')],qs[_0xdfa7('0x4c')](_0x1b8e6f[_0xdfa7('0x47')][_0xdfa7('0x4c')]));_0x3cb8b3['attributes']=_0x3cb8b3[_0xdfa7('0x4b')][_0xdfa7('0x4d')]?_0x3cb8b3[_0xdfa7('0x4b')]:_0x2ceab9[_0xdfa7('0x4e')];if(!_0x1b8e6f[_0xdfa7('0x47')][_0xdfa7('0x4f')](_0xdfa7('0x6b'))){_0x3cb8b3[_0xdfa7('0x32')]=qs[_0xdfa7('0x32')](_0x1b8e6f[_0xdfa7('0x47')][_0xdfa7('0x32')]);_0x3cb8b3['offset']=qs[_0xdfa7('0x31')](_0x1b8e6f['query'][_0xdfa7('0x31')]);}_0x3cb8b3[_0xdfa7('0x50')]=qs[_0xdfa7('0x51')](_0x1b8e6f['query'][_0xdfa7('0x51')]);_0x3cb8b3[_0xdfa7('0x54')]=qs[_0xdfa7('0x49')](_[_0xdfa7('0x52')](_0x1b8e6f[_0xdfa7('0x47')],_0x2ceab9[_0xdfa7('0x49')]));_0x3cb8b3['where']['WhatsappAccountId']=_0x90cf0f['id'];if(_0x1b8e6f[_0xdfa7('0x47')]['filter']){_0x3cb8b3[_0xdfa7('0x54')]=_[_0xdfa7('0x56')](_0x3cb8b3[_0xdfa7('0x54')],{'$or':_['map'](_0x3cb8b3[_0xdfa7('0x4b')],function(_0x556fda){var _0x1327ff={};_0x1327ff[_0x556fda]={'$like':'%'+_0x1b8e6f[_0xdfa7('0x47')][_0xdfa7('0x53')]+'%'};return _0x1327ff;})});}_0x3cb8b3=_[_0xdfa7('0x56')]({},_0x3cb8b3,_0x1b8e6f[_0xdfa7('0x6c')]);return db[_0xdfa7('0x6a')][_0xdfa7('0x34')]({'where':_0x3cb8b3['where']})[_0xdfa7('0x22')](function(_0x266040){_0x30ce14[_0xdfa7('0x34')]=_0x266040;if(_0x1b8e6f[_0xdfa7('0x47')]['includeAll']){_0x3cb8b3[_0xdfa7('0x59')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3cb8b3);})['then'](function(_0x17b7aa){_0x30ce14['rows']=_0x17b7aa;return _0x30ce14;});}})['then'](respondWithFilteredResult(_0x28a924,_0x3cb8b3))[_0xdfa7('0x2d')](handleError(_0x28a924,null));};exports[_0xdfa7('0x6d')]=function(_0x3504ad,_0x418d0f,_0x5ad05a){return db[_0xdfa7('0x57')][_0xdfa7('0x5f')]({'where':{'id':_0x3504ad[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x418d0f,null))[_0xdfa7('0x22')](function(_0x65609b){if(_0x65609b){return _0x65609b[_0xdfa7('0x6d')](_0x3504ad[_0xdfa7('0x47')][_0xdfa7('0x6e')]);}})[_0xdfa7('0x22')](respondWithStatusCode(_0x418d0f,null))[_0xdfa7('0x2d')](handleError(_0x418d0f,null));};exports[_0xdfa7('0x6f')]=function(_0x57e17f,_0x3c1e94,_0x15918f){if(_0x57e17f['body']['id']){delete _0x57e17f[_0xdfa7('0x61')]['id'];}return db[_0xdfa7('0x57')]['find']({'where':{'id':_0x57e17f['params']['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x3c1e94,null))[_0xdfa7('0x22')](function(_0x57f950){if(_0x57f950){_0x57e17f[_0xdfa7('0x61')][_0xdfa7('0x69')]=_0x57f950['id'];return db['CannedAnswer']['create'](_0x57e17f[_0xdfa7('0x61')]);}})[_0xdfa7('0x22')](respondWithResult(_0x3c1e94,null))['catch'](handleError(_0x3c1e94,null));};exports[_0xdfa7('0x70')]=function(_0xd56b9a,_0x1be83f,_0x188529){var _0x423c55={'raw':![],'where':{}};var _0x2dfe38={};var _0x30cd6a={'count':0x0,'rows':[]};return db[_0xdfa7('0x57')]['findOne']({'where':{'id':_0xd56b9a['params']['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x1be83f,null))[_0xdfa7('0x22')](function(_0xdf2e2b){if(_0xdf2e2b){_0x2dfe38[_0xdfa7('0x4e')]=_['keys'](db[_0xdfa7('0x71')]['rawAttributes']);_0x2dfe38[_0xdfa7('0x47')]=_[_0xdfa7('0x48')](_0xd56b9a[_0xdfa7('0x47')]);_0x2dfe38['filters']=_[_0xdfa7('0x4a')](_0x2dfe38[_0xdfa7('0x4e')],_0x2dfe38[_0xdfa7('0x47')]);_0x423c55['attributes']=_[_0xdfa7('0x4a')](_0x2dfe38['model'],qs['fields'](_0xd56b9a[_0xdfa7('0x47')][_0xdfa7('0x4c')]));_0x423c55['attributes']=_0x423c55[_0xdfa7('0x4b')]['length']?_0x423c55['attributes']:_0x2dfe38['model'];if(!_0xd56b9a['query'][_0xdfa7('0x4f')]('nolimit')){_0x423c55['limit']=qs[_0xdfa7('0x32')](_0xd56b9a[_0xdfa7('0x47')][_0xdfa7('0x32')]);_0x423c55[_0xdfa7('0x31')]=qs[_0xdfa7('0x31')](_0xd56b9a[_0xdfa7('0x47')][_0xdfa7('0x31')]);}_0x423c55[_0xdfa7('0x50')]=qs[_0xdfa7('0x51')](_0xd56b9a[_0xdfa7('0x47')][_0xdfa7('0x51')]);_0x423c55['where']=qs[_0xdfa7('0x49')](_['pick'](_0xd56b9a[_0xdfa7('0x47')],_0x2dfe38[_0xdfa7('0x49')]));_0x423c55['where'][_0xdfa7('0x69')]=_0xdf2e2b['id'];if(_0xd56b9a['query'][_0xdfa7('0x53')]){_0x423c55[_0xdfa7('0x54')]=_[_0xdfa7('0x56')](_0x423c55[_0xdfa7('0x54')],{'$or':_[_0xdfa7('0x43')](_0x423c55[_0xdfa7('0x4b')],function(_0x52c006){var _0x4f5899={};_0x4f5899[_0x52c006]={'$like':'%'+_0xd56b9a[_0xdfa7('0x47')][_0xdfa7('0x53')]+'%'};return _0x4f5899;})});}_0x423c55=_[_0xdfa7('0x56')]({},_0x423c55,_0xd56b9a[_0xdfa7('0x6c')]);return db[_0xdfa7('0x71')]['count']({'where':_0x423c55[_0xdfa7('0x54')]})[_0xdfa7('0x22')](function(_0x19f56b){_0x30cd6a['count']=_0x19f56b;if(_0xd56b9a['query'][_0xdfa7('0x58')]){_0x423c55['include']=[{'all':!![]}];}return db[_0xdfa7('0x71')]['findAll'](_0x423c55);})['then'](function(_0x266109){_0x30cd6a[_0xdfa7('0x5b')]=_0x266109;return _0x30cd6a;});}})[_0xdfa7('0x22')](respondWithFilteredResult(_0x1be83f,_0x423c55))[_0xdfa7('0x2d')](handleError(_0x1be83f,null));};exports['removeAnswers']=function(_0x13385f,_0xf6dc6d,_0x3db725){return db[_0xdfa7('0x57')][_0xdfa7('0x5f')]({'where':{'id':_0x13385f['params']['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0xf6dc6d,null))[_0xdfa7('0x22')](function(_0x2b174a){if(_0x2b174a){return _0x2b174a[_0xdfa7('0x72')](_0x13385f[_0xdfa7('0x47')][_0xdfa7('0x6e')]);}})[_0xdfa7('0x22')](respondWithStatusCode(_0xf6dc6d,null))[_0xdfa7('0x2d')](handleError(_0xf6dc6d,null));};exports[_0xdfa7('0x73')]=function(_0xeb81cf,_0x5d1f33,_0x349c73){return db['WhatsappAccount'][_0xdfa7('0x5f')]({'where':{'id':_0xeb81cf[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x5d1f33,null))[_0xdfa7('0x22')](function(_0x497627){if(_0x497627){return _0x497627['addAgents'](_0xeb81cf[_0xdfa7('0x61')]['ids'],_[_0xdfa7('0x74')](_0xeb81cf[_0xdfa7('0x61')],[_0xdfa7('0x6e'),'id'])||{})[_0xdfa7('0x75')](function(_0x1d1dfe){for(var _0x12135e=0x0;_0x12135e<_0xeb81cf['body'][_0xdfa7('0x6e')][_0xdfa7('0x4d')];_0x12135e+=0x1){socket[_0xdfa7('0x76')](_0xdfa7('0x77'),{'UserId':Number(_0xeb81cf[_0xdfa7('0x61')]['ids'][_0x12135e]),'WhatsappAccountId':Number(_0xeb81cf[_0xdfa7('0x5d')]['id'])});}return _0x1d1dfe;});}})[_0xdfa7('0x22')](respondWithResult(_0x5d1f33,null))[_0xdfa7('0x2d')](handleError(_0x5d1f33,null));};exports[_0xdfa7('0x78')]=function(_0x5b975a,_0xf91633,_0x133937){return db[_0xdfa7('0x57')][_0xdfa7('0x5f')]({'where':{'id':_0x5b975a[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0xf91633,null))[_0xdfa7('0x22')](function(_0x5c6539){if(_0x5c6539){return _0x5c6539[_0xdfa7('0x78')](_0x5b975a[_0xdfa7('0x47')]['ids'])[_0xdfa7('0x22')](function(){if(_['isArray'](_0x5b975a['query'][_0xdfa7('0x6e')])){for(var _0x4d94d4=0x0;_0x4d94d4<_0x5b975a[_0xdfa7('0x47')][_0xdfa7('0x6e')]['length'];_0x4d94d4+=0x1){socket['emit'](_0xdfa7('0x79'),{'UserId':Number(_0x5b975a[_0xdfa7('0x47')][_0xdfa7('0x6e')][_0x4d94d4]),'WhatsappAccountId':Number(_0x5b975a[_0xdfa7('0x5d')]['id'])});}}else{socket[_0xdfa7('0x76')](_0xdfa7('0x79'),{'UserId':Number(_0x5b975a[_0xdfa7('0x47')]['ids']),'WhatsappAccountId':Number(_0x5b975a[_0xdfa7('0x5d')]['id'])});}});}})[_0xdfa7('0x22')](respondWithStatusCode(_0xf91633,null))[_0xdfa7('0x2d')](handleError(_0xf91633,null));};exports['getAgents']=function(_0x141267,_0xadf96,_0x5a9e5e){var _0x4eca85={};var _0x3a4144={};var _0x511d33;var _0x18eb70;return db[_0xdfa7('0x57')][_0xdfa7('0x7a')]({'where':{'id':_0x141267[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0xadf96,null))[_0xdfa7('0x22')](function(_0x9c591){if(_0x9c591){_0x511d33=_0x9c591;_0x3a4144[_0xdfa7('0x4e')]=_[_0xdfa7('0x48')](db[_0xdfa7('0x7b')][_0xdfa7('0x5e')]);_0x3a4144['query']=_[_0xdfa7('0x48')](_0x141267[_0xdfa7('0x47')]);_0x3a4144['filters']=_[_0xdfa7('0x4a')](_0x3a4144[_0xdfa7('0x4e')],_0x3a4144['query']);_0x4eca85[_0xdfa7('0x4b')]=_[_0xdfa7('0x4a')](_0x3a4144['model'],qs[_0xdfa7('0x4c')](_0x141267[_0xdfa7('0x47')]['fields']));_0x4eca85['attributes']=_0x4eca85[_0xdfa7('0x4b')][_0xdfa7('0x4d')]?_0x4eca85[_0xdfa7('0x4b')]:_0x3a4144[_0xdfa7('0x4e')];_0x4eca85[_0xdfa7('0x50')]=qs['sort'](_0x141267[_0xdfa7('0x47')]['sort']);_0x4eca85[_0xdfa7('0x54')]=qs[_0xdfa7('0x49')](_[_0xdfa7('0x52')](_0x141267[_0xdfa7('0x47')],_0x3a4144[_0xdfa7('0x49')]));if(_0x141267[_0xdfa7('0x47')][_0xdfa7('0x53')]){_0x4eca85[_0xdfa7('0x54')]=_[_0xdfa7('0x56')](_0x4eca85['where'],{'$or':_['map'](_0x4eca85[_0xdfa7('0x4b')],function(_0x210521){var _0x367e37={};_0x367e37[_0x210521]={'$like':'%'+_0x141267[_0xdfa7('0x47')][_0xdfa7('0x53')]+'%'};return _0x367e37;})});}_0x4eca85=_[_0xdfa7('0x56')]({},_0x4eca85,_0x141267[_0xdfa7('0x6c')]);return _0x511d33['getAgents'](_0x4eca85);}})[_0xdfa7('0x22')](function(_0x583bea){if(_0x583bea){_0x18eb70=_0x583bea[_0xdfa7('0x4d')];if(!_0x141267[_0xdfa7('0x47')][_0xdfa7('0x4f')]('nolimit')){_0x4eca85[_0xdfa7('0x32')]=qs[_0xdfa7('0x32')](_0x141267[_0xdfa7('0x47')]['limit']);_0x4eca85['offset']=qs[_0xdfa7('0x31')](_0x141267[_0xdfa7('0x47')]['offset']);}return _0x511d33[_0xdfa7('0x7c')](_0x4eca85);}})[_0xdfa7('0x22')](function(_0x43345c){if(_0x43345c){return _0x43345c?{'count':_0x18eb70,'rows':_0x43345c}:null;}})[_0xdfa7('0x22')](respondWithResult(_0xadf96,null))[_0xdfa7('0x2d')](handleError(_0xadf96,null));};exports[_0xdfa7('0x7d')]=function(_0x166fe5,_0x1903f4,_0xe57386){return db['WhatsappAccount']['findOne']({'where':{'id':_0x166fe5[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0x1903f4,null))[_0xdfa7('0x22')](function(_0x1eb079){if(_0x1eb079){return db[_0xdfa7('0x7e')]['transaction'](function(_0x3944b1){return db[_0xdfa7('0x7f')][_0xdfa7('0x3a')]({'where':{'WhatsappAccountId':_0x166fe5[_0xdfa7('0x5d')]['id']},'transaction':_0x3944b1})[_0xdfa7('0x22')](function(_0x2425bb){var _0x22de19=_[_0xdfa7('0x43')](_0x166fe5[_0xdfa7('0x61')],function(_0x50bce9){_0x50bce9[_0xdfa7('0x69')]=_0x166fe5[_0xdfa7('0x5d')]['id'];return _0x50bce9;});return db['WhatsappApplication'][_0xdfa7('0x80')](_0x22de19,{'transaction':_0x3944b1});});})['then'](function(){return db[_0xdfa7('0x7f')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x166fe5[_0xdfa7('0x5d')]['id']},'order':_0xdfa7('0x81')});});}})[_0xdfa7('0x22')](respondWithResult(_0x1903f4,null))['catch'](handleError(_0x1903f4,null));};exports[_0xdfa7('0x82')]=function(_0x22e015,_0xbd4246,_0x1f521e){var _0x133379={};var _0x553a0b={};var _0x5c490b;var _0x1bee3d;return db['WhatsappAccount'][_0xdfa7('0x7a')]({'where':{'id':_0x22e015[_0xdfa7('0x5d')]['id']}})[_0xdfa7('0x22')](handleEntityNotFound(_0xbd4246,null))[_0xdfa7('0x22')](function(_0x3dbb72){if(_0x3dbb72){_0x5c490b=_0x3dbb72;_0x553a0b[_0xdfa7('0x4e')]=_[_0xdfa7('0x48')](db[_0xdfa7('0x7f')][_0xdfa7('0x5e')]);_0x553a0b[_0xdfa7('0x47')]=_[_0xdfa7('0x48')](_0x22e015['query']);_0x553a0b[_0xdfa7('0x49')]=_['intersection'](_0x553a0b[_0xdfa7('0x4e')],_0x553a0b['query']);_0x133379['attributes']=_[_0xdfa7('0x4a')](_0x553a0b[_0xdfa7('0x4e')],qs[_0xdfa7('0x4c')](_0x22e015['query'][_0xdfa7('0x4c')]));_0x133379[_0xdfa7('0x4b')]=_0x133379[_0xdfa7('0x4b')][_0xdfa7('0x4d')]?_0x133379[_0xdfa7('0x4b')]:_0x553a0b[_0xdfa7('0x4e')];_0x133379[_0xdfa7('0x50')]=qs[_0xdfa7('0x51')](_0x22e015['query'][_0xdfa7('0x51')]);_0x133379[_0xdfa7('0x54')]=qs[_0xdfa7('0x49')](_['pick'](_0x22e015[_0xdfa7('0x47')],_0x553a0b[_0xdfa7('0x49')]));if(_0x22e015['query'][_0xdfa7('0x53')]){_0x133379[_0xdfa7('0x54')]=_[_0xdfa7('0x56')](_0x133379[_0xdfa7('0x54')],{'$or':_[_0xdfa7('0x43')](_0x133379[_0xdfa7('0x4b')],function(_0x32e965){var _0x5ee73a={};_0x5ee73a[_0x32e965]={'$like':'%'+_0x22e015[_0xdfa7('0x47')][_0xdfa7('0x53')]+'%'};return _0x5ee73a;})});}_0x133379=_[_0xdfa7('0x56')]({},_0x133379,_0x22e015[_0xdfa7('0x6c')]);return _0x5c490b['getApplications'](_0x133379);}})[_0xdfa7('0x22')](function(_0x454d42){if(_0x454d42){_0x1bee3d=_0x454d42[_0xdfa7('0x4d')];if(!_0x22e015['query']['hasOwnProperty'](_0xdfa7('0x6b'))){_0x133379[_0xdfa7('0x32')]=qs['limit'](_0x22e015[_0xdfa7('0x47')]['limit']);_0x133379[_0xdfa7('0x31')]=qs[_0xdfa7('0x31')](_0x22e015[_0xdfa7('0x47')][_0xdfa7('0x31')]);}return _0x5c490b[_0xdfa7('0x82')](_0x133379);}})['then'](function(_0x30fda5){if(_0x30fda5){return _0x30fda5?{'count':_0x1bee3d,'rows':_0x30fda5}:null;}})[_0xdfa7('0x22')](respondWithResult(_0xbd4246,null))[_0xdfa7('0x2d')](handleError(_0xbd4246,null));};exports['notify']=function(_0x16eef3,_0x2997d9,_0xad9a49){var _0x2fc52b={'channel':'whatsapp'};var _0x1737ef=[];var _0x1fd2d2=[];var _0x9ced6c={};return db[_0xdfa7('0x57')][_0xdfa7('0x5f')]({'where':{'id':_0x16eef3[_0xdfa7('0x5d')]['id']},'include':[{'model':db[_0xdfa7('0x7f')],'as':_0xdfa7('0x83')}]})[_0xdfa7('0x22')](handleEntityNotFound(_0x2997d9,null))[_0xdfa7('0x22')](function(_0x179e69){_0x2fc52b[_0xdfa7('0x84')]=_0x179e69;_0x2fc52b[_0xdfa7('0x85')]=_[_0xdfa7('0x86')](_0x179e69[_0xdfa7('0x83')],['priority'],[_0xdfa7('0x87')]);if(_0x2fc52b['account'][_0xdfa7('0x83')]){delete _0x2fc52b[_0xdfa7('0x84')][_0xdfa7('0x83')];}return db[_0xdfa7('0x88')][_0xdfa7('0x68')]();})[_0xdfa7('0x22')](function(_0x32088c){if(!_0x32088c){throw new db['Sequelize'][(_0xdfa7('0x89'))](_0xdfa7('0x8a'));}_0x1737ef=_[_0xdfa7('0x8b')](_[_0xdfa7('0x48')](_0x32088c),[_0xdfa7('0x8c'),_0xdfa7('0x8d')]);_0x1fd2d2=_['difference'](_[_0xdfa7('0x48')](_0x32088c),[_0xdfa7('0x8c'),'updatedAt','CompanyId','ListId']);_0x2fc52b[_0xdfa7('0x61')]={'mapKey':_0xdfa7('0x8e')};if(_0x2fc52b[_0xdfa7('0x84')][_0xdfa7('0x45')]&&_0x2fc52b[_0xdfa7('0x84')][_0xdfa7('0x45')]===_0xdfa7('0x8f')){_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x90')]=_0x16eef3[_0xdfa7('0x61')][_0xdfa7('0x91')][_0xdfa7('0x92')](_0xdfa7('0x93'),'');_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x61')]=_0x16eef3[_0xdfa7('0x61')][_0xdfa7('0x94')];_0x2fc52b[_0xdfa7('0x61')]['messageId']=_0x16eef3[_0xdfa7('0x61')]['MessageSid'];}if(_0x2fc52b[_0xdfa7('0x61')]['id']){delete _0x2fc52b['body']['id'];}if(_[_0xdfa7('0x95')](_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x90')])){throw new db[(_0xdfa7('0x96'))][(_0xdfa7('0x89'))](_0xdfa7('0x97'));}if(_[_0xdfa7('0x95')](_0x2fc52b[_0xdfa7('0x61')]['body'])||_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x61')]===''){throw new db['Sequelize'][(_0xdfa7('0x89'))](_0xdfa7('0x98'));}if(_[_0xdfa7('0x95')](_0x2fc52b[_0xdfa7('0x61')]['mapKey'])){throw new db['Sequelize'][(_0xdfa7('0x89'))](_0xdfa7('0x99')+_0x1fd2d2);}if(!_[_0xdfa7('0x9a')](_0x1fd2d2,_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x9b')])){throw new db[(_0xdfa7('0x96'))][(_0xdfa7('0x89'))](_0xdfa7('0x9c')+_0x1fd2d2);}_0x9ced6c[_0x2fc52b[_0xdfa7('0x61')]['mapKey']]=_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x90')];return db[_0xdfa7('0x9d')][_0xdfa7('0x5f')]({'where':{'id':_0x2fc52b[_0xdfa7('0x84')][_0xdfa7('0x9e')]},'include':[{'model':db[_0xdfa7('0x88')],'as':_0xdfa7('0x9f'),'where':_0x9ced6c,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xdfa7('0x22')](handleEntityNotFound(_0x2997d9,null))[_0xdfa7('0x22')](function(_0x2c69ee){if(_0x2c69ee){_0x2fc52b['list']=_[_0xdfa7('0x74')](_0x2c69ee,[_0xdfa7('0x9f')]);if(_0x2c69ee[_0xdfa7('0x9f')][_0xdfa7('0x4d')]){return _0x2c69ee['Contacts'][0x0];}var _0x330c1c=_[_0xdfa7('0x1c')](_0x2fc52b[_0xdfa7('0x61')],{'firstName':_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x90')],'ListId':_0x2c69ee['id']});_0x330c1c[_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x9b')]]=_0x2fc52b['body'][_0xdfa7('0x90')];return db[_0xdfa7('0x88')][_0xdfa7('0x60')](_0x330c1c,{'fields':_0x1737ef,'raw':!![]});}})[_0xdfa7('0x22')](handleEntityNotFound(_0x2997d9,null))['then'](function(_0x436341){if(_0x436341){_0x2fc52b['contact']=_0x436341;var _0x33b35f={'ContactId':_0x436341['id'],'phone':_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x90')],'WhatsappAccountId':_0x16eef3[_0xdfa7('0x5d')]['id']};var _0x509ae1={'ContactId':_0x436341['id'],'WhatsappAccountId':_0x16eef3[_0xdfa7('0x5d')]['id'],'closed':![]};return db[_0xdfa7('0xa0')][_0xdfa7('0x5f')]({'where':_0x509ae1})[_0xdfa7('0x22')](function(_0xca23b7){if(_0xca23b7){return[_0xca23b7,![]];}return db[_0xdfa7('0xa0')]['create'](_0x33b35f)[_0xdfa7('0x22')](function(_0x8402a3){return[_0x8402a3,!![]];});});}})[_0xdfa7('0x75')](function(_0x4c3b68,_0x4ddcb9){_0x2fc52b[_0xdfa7('0xa1')]=_0x4c3b68[_0xdfa7('0x3b')]({'plain':!![]});_0x2fc52b[_0xdfa7('0xa1')]['created']=![];if(_0x4ddcb9){if(_0x2fc52b[_0xdfa7('0x84')]['autoclose']){_0x2fc52b[_0xdfa7('0x85')]['push']({'id':0x0,'priority':_0x2fc52b[_0xdfa7('0x85')]['length']+0x1,'app':_0xdfa7('0xa2'),'appdata':_0xdfa7('0xa3'),'interval':_0xdfa7('0xa4')});}_0x2fc52b['interaction'][_0xdfa7('0xa5')]=!![];}return db['WhatsappMessage'][_0xdfa7('0x60')]({'phone':_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x90')],'messageId':_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0xa6')],'body':_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0x61')],'WhatsappAccountId':_0x16eef3[_0xdfa7('0x5d')]['id'],'WhatsappInteractionId':_0x4c3b68['id'],'direction':'in','ContactId':_0x4c3b68[_0xdfa7('0xa7')],'AttachmentId':_0x2fc52b[_0xdfa7('0x61')][_0xdfa7('0xa8')]});})[_0xdfa7('0x22')](function(_0x3c5483){_0x2fc52b[_0xdfa7('0x2a')]=_0x3c5483;if(_0x2fc52b[_0xdfa7('0xa1')]['UserId']){return db[_0xdfa7('0x7b')][_0xdfa7('0x5f')]({'attributes':['id',_0xdfa7('0x40')],'where':{'id':_0x2fc52b[_0xdfa7('0xa1')]['UserId']}})[_0xdfa7('0x22')](function(_0xdf343d){if(_0xdf343d){_0x2fc52b[_0xdfa7('0x85')][_0xdfa7('0xa9')]({'id':0x0,'priority':0x0,'app':_0xdfa7('0xaa'),'appdata':_0xdf343d[_0xdfa7('0x40')]+','+(_0x2fc52b[_0xdfa7('0x84')][_0xdfa7('0xab')]||0xa),'interval':_0xdfa7('0xa4')});}return respondWithRpcPromise(_0xdfa7('0xac'),'startRouting',_0x2fc52b);});}return respondWithRpcPromise(_0xdfa7('0xac'),_0xdfa7('0xad'),_0x2fc52b);})[_0xdfa7('0x22')](function(_0x49dc99){if(_0x49dc99){var _0x10536b=0xc8;var _0x467f08=_0xdfa7('0xae');logger[_0xdfa7('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x467f08,_0x10536b,_0xdfa7('0xaf'));logger[_0xdfa7('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x467f08,_0x10536b,_0xdfa7('0xaf'),JSON['stringify'](_0x49dc99));if(_0x2fc52b[_0xdfa7('0x84')][_0xdfa7('0x45')]===_0xdfa7('0x8f')){return _0x2997d9[_0xdfa7('0x2f')](_0x10536b)['set']('Content-Type',_0xdfa7('0xb0'))['send'](_0xdfa7('0xb1'));}else{return _0x2997d9[_0xdfa7('0x2f')](_0x10536b)[_0xdfa7('0x30')](_0x49dc99);}}})[_0xdfa7('0x2d')](handleError(_0x2997d9,null));};exports[_0xdfa7('0xb2')]=function(_0x11bdf7,_0x4f5e88,_0x5d34d6){var _0xd4ecb3,_0x57db5e,_0x229bfe;if(_[_0xdfa7('0x95')](_0x11bdf7['body'][_0xdfa7('0x61')])||_0x11bdf7[_0xdfa7('0x61')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdfa7('0x95')](_0x11bdf7[_0xdfa7('0x61')]['to'])){throw new db[(_0xdfa7('0x96'))][(_0xdfa7('0x89'))](_0xdfa7('0xb3'));}_0xd4ecb3=_0x11bdf7[_0xdfa7('0x61')]['to'];return db['WhatsappAccount'][_0xdfa7('0x5f')]({'where':{'id':_0x11bdf7[_0xdfa7('0x5d')]['id']},'include':[{'model':db[_0xdfa7('0x9d')],'as':_0xdfa7('0xb4'),'include':[{'model':db[_0xdfa7('0x88')],'as':_0xdfa7('0x9f'),'where':{'mobile':_0xd4ecb3},'limit':0x1,'order':[[_0xdfa7('0x8d'),'DESC']]}]}]})[_0xdfa7('0x22')](handleEntityNotFound(_0x4f5e88,null))[_0xdfa7('0x22')](function(_0x1a94ea){if(_0x1a94ea&&_0x1a94ea[_0xdfa7('0xb4')]){_0x57db5e=_0x1a94ea[_0xdfa7('0x3b')]({'plain':!![]});if(_0x57db5e[_0xdfa7('0xb4')]&&_0x57db5e[_0xdfa7('0xb4')]['Contacts'][_0xdfa7('0x4d')]){return _0x57db5e[_0xdfa7('0xb4')]['Contacts'][0x0];}return db[_0xdfa7('0x88')][_0xdfa7('0x60')](_[_0xdfa7('0x1c')](_0x11bdf7[_0xdfa7('0x61')],{'firstName':_0xd4ecb3,'mobile':_0xd4ecb3,'phone':_0xd4ecb3,'ListId':_0x57db5e[_0xdfa7('0x9e')]}));}})[_0xdfa7('0x22')](handleEntityNotFound(_0x4f5e88,null))[_0xdfa7('0x22')](function(_0x526e69){if(_0x526e69){_0x229bfe=_0x526e69;return db[_0xdfa7('0xa0')][_0xdfa7('0x5f')]({'where':{'ContactId':_0x229bfe['id'],'closed':![],'WhatsappAccountId':_0x57db5e['id']}})[_0xdfa7('0x22')](function(_0x4803e5){if(_0x4803e5){return[_0x4803e5,![]];}return db['WhatsappInteraction'][_0xdfa7('0x60')]({'UserId':_0x11bdf7[_0xdfa7('0x62')]['id'],'ContactId':_0x229bfe['id'],'WhatsappAccountId':_0x57db5e['id'],'phone':_0xd4ecb3,'firstMsgDirection':'out','Messages':[_[_0xdfa7('0x56')](_0x11bdf7[_0xdfa7('0x61')],{'read':![],'body':_0x11bdf7['body']['body'],'phone':_0xd4ecb3,'WhatsappAccountId':_0x57db5e['id'],'UserId':_0x11bdf7[_0xdfa7('0x62')]['id'],'ContactId':_0x229bfe['id']})]},{'include':[{'model':db[_0xdfa7('0xb5')],'as':_0xdfa7('0xb6')}]})[_0xdfa7('0x22')](function(_0x471958){return[_0x471958,!![]];});});}})['spread'](function(_0x146c28,_0x513934){if(_0x513934){return _0x146c28;}return db[_0xdfa7('0xb5')][_0xdfa7('0x60')](_[_0xdfa7('0x56')](_0x11bdf7[_0xdfa7('0x61')],{'read':![],'body':_0x11bdf7[_0xdfa7('0x61')][_0xdfa7('0x61')],'phone':_0xd4ecb3,'WhatsappAccountId':_0x57db5e['id'],'WhatsappInteractionId':_0x146c28['id'],'UserId':_0x11bdf7[_0xdfa7('0x62')]['id'],'ContactId':_0x229bfe['id']}))[_0xdfa7('0x22')](function(_0x2809bf){_0x146c28['dataValues']['Messages']=[];_0x146c28['dataValues']['Messages']['push'](_0x2809bf[_0xdfa7('0xb7')]);return _0x146c28;});})['then'](respondWithResult(_0x4f5e88,null))[_0xdfa7('0x2d')](handleError(_0x4f5e88,null));}; \ No newline at end of file +var _0xbe9e=['index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','WhatsappAccountId','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','spread','emit','removeAgents','isArray','getAgents','addApplications','transaction','WhatsappApplication','bulkCreate','priority','getApplications','notify','Applications','account','applications','orderBy','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','whatsapp:','Body','messageId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','contact','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','json','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','name','send'];(function(_0x46b58a,_0x544e5e){var _0x8f8cc8=function(_0x3d1360){while(--_0x3d1360){_0x46b58a['push'](_0x46b58a['shift']());}};_0x8f8cc8(++_0x544e5e);}(_0xbe9e,0x7c));var _0xebe9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xbe9e[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebe9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebe9('0x1'));var rp=require(_0xebe9('0x2'));var moment=require('moment');var BPromise=require(_0xebe9('0x3'));var Mustache=require(_0xebe9('0x4'));var util=require(_0xebe9('0x5'));var path=require(_0xebe9('0x6'));var sox=require(_0xebe9('0x7'));var csv=require(_0xebe9('0x8'));var ejs=require(_0xebe9('0x9'));var fs=require('fs');var fs_extra=require(_0xebe9('0xa'));var _=require('lodash');var squel=require(_0xebe9('0xb'));var crypto=require(_0xebe9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xebe9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xebe9('0xe'));var Papa=require(_0xebe9('0xf'));var Redis=require(_0xebe9('0x10'));var authService=require(_0xebe9('0x11'));var qs=require(_0xebe9('0x12'));var as=require(_0xebe9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xebe9('0x14'));var config=require(_0xebe9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xebe9('0x16'))['db'];config[_0xebe9('0x17')]=_[_0xebe9('0x18')](config[_0xebe9('0x17')],{'host':_0xebe9('0x19'),'port':0x18eb});var socket=require(_0xebe9('0x1a'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xebe9('0x1b')](socket);var jayson=require(_0xebe9('0x1c'));var client=jayson[_0xebe9('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1d97ae,_0x1e532d,_0x297632,_0x58ce2a){return new BPromise(function(_0x35f4a4,_0x3873b6){var _0x4eb2d3=_0x58ce2a||client;return _0x4eb2d3[_0xebe9('0x1e')](_0x1d97ae,_0x297632)[_0xebe9('0x1f')](function(_0x37d4e5){logger['info'](_0xebe9('0x20'),_0x1e532d,_0xebe9('0x21'));logger[_0xebe9('0x22')](_0xebe9('0x23'),_0x1e532d,'request\x20sent',JSON[_0xebe9('0x24')](_0x37d4e5));if(_0x37d4e5[_0xebe9('0x25')]){if(_0x37d4e5[_0xebe9('0x25')][_0xebe9('0x26')]===0x1f4){logger[_0xebe9('0x25')](_0xebe9('0x20'),_0x1e532d,_0x37d4e5[_0xebe9('0x25')]['message']);return _0x3873b6(_0x37d4e5[_0xebe9('0x25')][_0xebe9('0x27')]);}logger[_0xebe9('0x25')](_0xebe9('0x20'),_0x1e532d,_0x37d4e5['error'][_0xebe9('0x27')]);return _0x35f4a4(_0x37d4e5[_0xebe9('0x25')]['message']);}else{logger[_0xebe9('0x28')](_0xebe9('0x20'),_0x1e532d,_0xebe9('0x21'));_0x35f4a4(_0x37d4e5[_0xebe9('0x29')][_0xebe9('0x27')]);}})[_0xebe9('0x2a')](function(_0x104276){logger[_0xebe9('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x1e532d,_0x104276);_0x3873b6(_0x104276);});});}function respondWithStatusCode(_0x34b174,_0x3f4475){_0x3f4475=_0x3f4475||0xcc;return function(_0xe67ca0){if(_0xe67ca0){return _0x34b174[_0xebe9('0x2b')](_0x3f4475);}return _0x34b174[_0xebe9('0x2c')](_0x3f4475)[_0xebe9('0x2d')]();};}function respondWithResult(_0x501f00,_0x1d06e1){_0x1d06e1=_0x1d06e1||0xc8;return function(_0x49990a){if(_0x49990a){return _0x501f00[_0xebe9('0x2c')](_0x1d06e1)['json'](_0x49990a);}};}function respondWithFilteredResult(_0x2c7132,_0x3ca24b){return function(_0x4dd031){if(_0x4dd031){var _0x593613=typeof _0x3ca24b[_0xebe9('0x2e')]===_0xebe9('0x2f')&&typeof _0x3ca24b[_0xebe9('0x30')]===_0xebe9('0x2f');var _0x22c8aa=_0x4dd031[_0xebe9('0x31')];var _0x232ec5=_0x593613?0x0:_0x3ca24b[_0xebe9('0x2e')];var _0x336322=_0x593613?_0x4dd031[_0xebe9('0x31')]:_0x3ca24b[_0xebe9('0x2e')]+_0x3ca24b['limit'];var _0x2edabc;if(_0x336322>=_0x22c8aa){_0x336322=_0x22c8aa;_0x2edabc=0xc8;}else{_0x2edabc=0xce;}_0x2c7132[_0xebe9('0x2c')](_0x2edabc);return _0x2c7132[_0xebe9('0x32')](_0xebe9('0x33'),_0x232ec5+'-'+_0x336322+'/'+_0x22c8aa)['json'](_0x4dd031);}return null;};}function patchUpdates(_0x37defd){return function(_0x36a0ef){try{jsonpatch['apply'](_0x36a0ef,_0x37defd,!![]);}catch(_0x409fbc){return BPromise[_0xebe9('0x34')](_0x409fbc);}return _0x36a0ef[_0xebe9('0x35')]();};}function saveUpdates(_0xab62b4,_0x567269){return function(_0x69a8b){if(_0x69a8b){return _0x69a8b[_0xebe9('0x36')](_0xab62b4)[_0xebe9('0x1f')](function(_0x2223d3){return _0x2223d3;});}return null;};}function removeEntity(_0x2bba6f,_0x267960){return function(_0x300b4a){if(_0x300b4a){return _0x300b4a[_0xebe9('0x37')]()[_0xebe9('0x1f')](function(){var _0x4170b2=_0x300b4a[_0xebe9('0x38')]({'plain':!![]});var _0xef677e=_0xebe9('0x39');return db['UserProfileResource'][_0xebe9('0x37')]({'where':{'type':_0xef677e,'resourceId':_0x4170b2['id']}})[_0xebe9('0x1f')](function(){return _0x300b4a;});})[_0xebe9('0x1f')](function(){_0x2bba6f[_0xebe9('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fc69b,_0x4d1577){return function(_0x2851ad){if(!_0x2851ad){_0x2fc69b[_0xebe9('0x2b')](0x194);}return _0x2851ad;};}function handleError(_0x209dde,_0x259135){_0x259135=_0x259135||0x1f4;return function(_0x34bd7d){logger[_0xebe9('0x25')](_0x34bd7d['stack']);if(_0x34bd7d['name']){delete _0x34bd7d[_0xebe9('0x3a')];}_0x209dde[_0xebe9('0x2c')](_0x259135)[_0xebe9('0x3b')](_0x34bd7d);};}exports[_0xebe9('0x3c')]=function(_0x1a52b6,_0x328193){var _0x4c0722={'include':[{'model':db[_0xebe9('0x3d')],'as':_0xebe9('0x3e')}]},_0x216f80={},_0x284e44={'count':0x0,'rows':[]};var _0x3c878b=_[_0xebe9('0x3f')](db[_0xebe9('0x40')][_0xebe9('0x41')],function(_0x35df03){return{'name':_0x35df03[_0xebe9('0x42')],'type':_0x35df03[_0xebe9('0x43')][_0xebe9('0x44')]};});_0x216f80[_0xebe9('0x45')]=_[_0xebe9('0x3f')](_0x3c878b,'name');_0x216f80['query']=_[_0xebe9('0x46')](_0x1a52b6['query']);_0x216f80[_0xebe9('0x47')]=_[_0xebe9('0x48')](_0x216f80[_0xebe9('0x45')],_0x216f80['query']);_0x4c0722[_0xebe9('0x49')]=_[_0xebe9('0x48')](_0x216f80[_0xebe9('0x45')],qs['fields'](_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x4b')]));_0x4c0722[_0xebe9('0x49')]=_0x4c0722['attributes'][_0xebe9('0x4c')]?_0x4c0722['attributes']:_0x216f80[_0xebe9('0x45')];if(!_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x4d')](_0xebe9('0x4e'))){_0x4c0722[_0xebe9('0x30')]=qs[_0xebe9('0x30')](_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x30')]);_0x4c0722[_0xebe9('0x2e')]=qs[_0xebe9('0x2e')](_0x1a52b6[_0xebe9('0x4a')]['offset']);}_0x4c0722['order']=qs['sort'](_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x4f')]);_0x4c0722[_0xebe9('0x50')]=qs[_0xebe9('0x47')](_[_0xebe9('0x51')](_0x1a52b6[_0xebe9('0x4a')],_0x216f80[_0xebe9('0x47')]),_0x3c878b);if(_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x52')]){_0x4c0722[_0xebe9('0x50')]=_['merge'](_0x4c0722[_0xebe9('0x50')],{'$or':_[_0xebe9('0x3f')](_0x3c878b,function(_0x15d85e){if(_0x15d85e['type']!==_0xebe9('0x53')){var _0x114a3c={};_0x114a3c[_0x15d85e['name']]={'$like':'%'+_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x52')]+'%'};return _0x114a3c;}})});}_0x4c0722=_[_0xebe9('0x54')]({},_0x4c0722,_0x1a52b6[_0xebe9('0x55')]);var _0x5b6b6b={'where':_0x4c0722[_0xebe9('0x50')]};return db[_0xebe9('0x40')][_0xebe9('0x31')](_0x5b6b6b)[_0xebe9('0x1f')](function(_0x3a1652){_0x284e44[_0xebe9('0x31')]=_0x3a1652;if(_0x1a52b6[_0xebe9('0x4a')][_0xebe9('0x56')]){_0x4c0722['include']=[{'all':!![]}];}return db[_0xebe9('0x40')][_0xebe9('0x57')](_0x4c0722);})[_0xebe9('0x1f')](function(_0x480435){_0x284e44[_0xebe9('0x58')]=_0x480435;return _0x284e44;})[_0xebe9('0x1f')](respondWithFilteredResult(_0x328193,_0x4c0722))[_0xebe9('0x2a')](handleError(_0x328193,null));};exports[_0xebe9('0x59')]=function(_0x1a6661,_0x89eb33){var _0x1356bc={'raw':![],'where':{'id':_0x1a6661[_0xebe9('0x5a')]['id']},'include':[{'model':db[_0xebe9('0x3d')],'as':_0xebe9('0x3e')}]},_0x409f40={};_0x409f40[_0xebe9('0x45')]=_[_0xebe9('0x46')](db[_0xebe9('0x40')][_0xebe9('0x41')]);_0x409f40[_0xebe9('0x4a')]=_['keys'](_0x1a6661[_0xebe9('0x4a')]);_0x409f40['filters']=_[_0xebe9('0x48')](_0x409f40[_0xebe9('0x45')],_0x409f40[_0xebe9('0x4a')]);_0x1356bc[_0xebe9('0x49')]=_['intersection'](_0x409f40['model'],qs[_0xebe9('0x4b')](_0x1a6661[_0xebe9('0x4a')][_0xebe9('0x4b')]));_0x1356bc[_0xebe9('0x49')]=_0x1356bc[_0xebe9('0x49')][_0xebe9('0x4c')]?_0x1356bc[_0xebe9('0x49')]:_0x409f40['model'];if(_0x1a6661[_0xebe9('0x4a')][_0xebe9('0x56')]){_0x1356bc[_0xebe9('0x5b')]=[{'all':!![]}];}_0x1356bc=_[_0xebe9('0x54')]({},_0x1356bc,_0x1a6661['options']);return db[_0xebe9('0x40')][_0xebe9('0x5c')](_0x1356bc)[_0xebe9('0x1f')](handleEntityNotFound(_0x89eb33,null))['then'](respondWithResult(_0x89eb33,null))[_0xebe9('0x2a')](handleError(_0x89eb33,null));};exports['create']=function(_0x6d0da9,_0x1a085d){return db[_0xebe9('0x40')][_0xebe9('0x5d')](_0x6d0da9['body'],{})[_0xebe9('0x1f')](function(_0x5ac177){var _0x378f16=_0x6d0da9['user'][_0xebe9('0x38')]({'plain':!![]});if(!_0x378f16)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x378f16[_0xebe9('0x5e')]===_0xebe9('0x5f')){var _0x4e2a06=_0x5ac177[_0xebe9('0x38')]({'plain':!![]});var _0x3e3387=_0xebe9('0x39');return db[_0xebe9('0x60')][_0xebe9('0x5c')]({'where':{'name':_0x3e3387,'userProfileId':_0x378f16[_0xebe9('0x61')]},'raw':!![]})['then'](function(_0x3217a2){if(_0x3217a2&&_0x3217a2[_0xebe9('0x62')]===0x0){return db['UserProfileResource'][_0xebe9('0x5d')]({'name':_0x4e2a06[_0xebe9('0x3a')],'resourceId':_0x4e2a06['id'],'type':_0x3217a2[_0xebe9('0x3a')],'sectionId':_0x3217a2['id']},{})[_0xebe9('0x1f')](function(){return _0x5ac177;});}else{return _0x5ac177;}})[_0xebe9('0x2a')](function(_0x2b0ee1){logger[_0xebe9('0x25')](_0xebe9('0x63'),_0x2b0ee1);throw _0x2b0ee1;});}return _0x5ac177;})['then'](respondWithResult(_0x1a085d,0xc9))['catch'](handleError(_0x1a085d,null));};exports[_0xebe9('0x36')]=function(_0x33bc12,_0x4f9e16){if(_0x33bc12[_0xebe9('0x64')]['id']){delete _0x33bc12[_0xebe9('0x64')]['id'];}return db[_0xebe9('0x40')][_0xebe9('0x5c')]({'where':{'id':_0x33bc12[_0xebe9('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0xebe9('0x3e')}]})[_0xebe9('0x1f')](handleEntityNotFound(_0x4f9e16,null))[_0xebe9('0x1f')](saveUpdates(_0x33bc12[_0xebe9('0x64')],null))[_0xebe9('0x1f')](respondWithResult(_0x4f9e16,null))[_0xebe9('0x2a')](handleError(_0x4f9e16,null));};exports['destroy']=function(_0x55202b,_0x4528fc){return db[_0xebe9('0x40')]['find']({'where':{'id':_0x55202b['params']['id']}})['then'](handleEntityNotFound(_0x4528fc,null))[_0xebe9('0x1f')](removeEntity(_0x4528fc,null))[_0xebe9('0x2a')](handleError(_0x4528fc,null));};exports[_0xebe9('0x65')]=function(_0x5ef10c,_0x28bb01){return db[_0xebe9('0x40')][_0xebe9('0x65')]()[_0xebe9('0x1f')](respondWithResult(_0x28bb01,null))[_0xebe9('0x2a')](handleError(_0x28bb01,null));};exports[_0xebe9('0x66')]=function(_0x561219,_0x22c640,_0x26606e){if(_0x561219[_0xebe9('0x64')]['id']){delete _0x561219['body']['id'];}return db[_0xebe9('0x40')][_0xebe9('0x5c')]({'where':{'id':_0x561219['params']['id']}})[_0xebe9('0x1f')](handleEntityNotFound(_0x22c640,null))['then'](function(_0x237f1b){if(_0x237f1b){_0x561219[_0xebe9('0x64')][_0xebe9('0x67')]=_0x237f1b['id'];return db[_0xebe9('0x68')][_0xebe9('0x5d')](_0x561219['body']);}})[_0xebe9('0x1f')](respondWithResult(_0x22c640,null))[_0xebe9('0x2a')](handleError(_0x22c640,null));};exports['getDispositions']=function(_0x4c60fd,_0x157e39,_0x273ab6){var _0x428f87={'raw':![],'where':{}};var _0x4cb927={};var _0x1b8991={'count':0x0,'rows':[]};return db[_0xebe9('0x40')]['findOne']({'where':{'id':_0x4c60fd[_0xebe9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x157e39,null))['then'](function(_0x406d94){if(_0x406d94){_0x4cb927[_0xebe9('0x45')]=_[_0xebe9('0x46')](db[_0xebe9('0x68')][_0xebe9('0x41')]);_0x4cb927[_0xebe9('0x4a')]=_[_0xebe9('0x46')](_0x4c60fd[_0xebe9('0x4a')]);_0x4cb927['filters']=_['intersection'](_0x4cb927[_0xebe9('0x45')],_0x4cb927['query']);_0x428f87[_0xebe9('0x49')]=_['intersection'](_0x4cb927[_0xebe9('0x45')],qs[_0xebe9('0x4b')](_0x4c60fd['query'][_0xebe9('0x4b')]));_0x428f87[_0xebe9('0x49')]=_0x428f87[_0xebe9('0x49')][_0xebe9('0x4c')]?_0x428f87[_0xebe9('0x49')]:_0x4cb927[_0xebe9('0x45')];if(!_0x4c60fd[_0xebe9('0x4a')][_0xebe9('0x4d')](_0xebe9('0x4e'))){_0x428f87['limit']=qs[_0xebe9('0x30')](_0x4c60fd[_0xebe9('0x4a')]['limit']);_0x428f87['offset']=qs[_0xebe9('0x2e')](_0x4c60fd[_0xebe9('0x4a')][_0xebe9('0x2e')]);}_0x428f87[_0xebe9('0x69')]=qs[_0xebe9('0x4f')](_0x4c60fd[_0xebe9('0x4a')][_0xebe9('0x4f')]);_0x428f87[_0xebe9('0x50')]=qs[_0xebe9('0x47')](_['pick'](_0x4c60fd[_0xebe9('0x4a')],_0x4cb927[_0xebe9('0x47')]));_0x428f87[_0xebe9('0x50')][_0xebe9('0x67')]=_0x406d94['id'];if(_0x4c60fd[_0xebe9('0x4a')]['filter']){_0x428f87[_0xebe9('0x50')]=_['merge'](_0x428f87['where'],{'$or':_['map'](_0x428f87[_0xebe9('0x49')],function(_0x433d05){var _0x3abbde={};_0x3abbde[_0x433d05]={'$like':'%'+_0x4c60fd[_0xebe9('0x4a')][_0xebe9('0x52')]+'%'};return _0x3abbde;})});}_0x428f87=_[_0xebe9('0x54')]({},_0x428f87,_0x4c60fd[_0xebe9('0x55')]);return db['Disposition'][_0xebe9('0x31')]({'where':_0x428f87[_0xebe9('0x50')]})[_0xebe9('0x1f')](function(_0x5f0ede){_0x1b8991['count']=_0x5f0ede;if(_0x4c60fd[_0xebe9('0x4a')][_0xebe9('0x56')]){_0x428f87[_0xebe9('0x5b')]=[{'all':!![]}];}return db[_0xebe9('0x68')]['findAll'](_0x428f87);})[_0xebe9('0x1f')](function(_0x4ce16f){_0x1b8991['rows']=_0x4ce16f;return _0x1b8991;});}})['then'](respondWithFilteredResult(_0x157e39,_0x428f87))[_0xebe9('0x2a')](handleError(_0x157e39,null));};exports[_0xebe9('0x6a')]=function(_0x570855,_0x56fa72,_0x27585e){return db['WhatsappAccount']['find']({'where':{'id':_0x570855[_0xebe9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x56fa72,null))[_0xebe9('0x1f')](function(_0x1a8f17){if(_0x1a8f17){return _0x1a8f17[_0xebe9('0x6a')](_0x570855[_0xebe9('0x4a')][_0xebe9('0x6b')]);}})[_0xebe9('0x1f')](respondWithStatusCode(_0x56fa72,null))['catch'](handleError(_0x56fa72,null));};exports[_0xebe9('0x6c')]=function(_0x32b93c,_0x234aca,_0x56e913){if(_0x32b93c[_0xebe9('0x64')]['id']){delete _0x32b93c[_0xebe9('0x64')]['id'];}return db[_0xebe9('0x40')][_0xebe9('0x5c')]({'where':{'id':_0x32b93c[_0xebe9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x234aca,null))[_0xebe9('0x1f')](function(_0x37b0c9){if(_0x37b0c9){_0x32b93c[_0xebe9('0x64')][_0xebe9('0x67')]=_0x37b0c9['id'];return db[_0xebe9('0x6d')][_0xebe9('0x5d')](_0x32b93c[_0xebe9('0x64')]);}})[_0xebe9('0x1f')](respondWithResult(_0x234aca,null))[_0xebe9('0x2a')](handleError(_0x234aca,null));};exports[_0xebe9('0x6e')]=function(_0x2d5602,_0x1ed6c7,_0x596c4b){var _0x3b4eec={'raw':![],'where':{}};var _0x3f68fc={};var _0x2f747c={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xebe9('0x6f')]({'where':{'id':_0x2d5602[_0xebe9('0x5a')]['id']}})[_0xebe9('0x1f')](handleEntityNotFound(_0x1ed6c7,null))[_0xebe9('0x1f')](function(_0x27c9ea){if(_0x27c9ea){_0x3f68fc[_0xebe9('0x45')]=_[_0xebe9('0x46')](db[_0xebe9('0x6d')][_0xebe9('0x41')]);_0x3f68fc[_0xebe9('0x4a')]=_[_0xebe9('0x46')](_0x2d5602[_0xebe9('0x4a')]);_0x3f68fc[_0xebe9('0x47')]=_['intersection'](_0x3f68fc[_0xebe9('0x45')],_0x3f68fc[_0xebe9('0x4a')]);_0x3b4eec['attributes']=_['intersection'](_0x3f68fc[_0xebe9('0x45')],qs[_0xebe9('0x4b')](_0x2d5602[_0xebe9('0x4a')]['fields']));_0x3b4eec[_0xebe9('0x49')]=_0x3b4eec['attributes'][_0xebe9('0x4c')]?_0x3b4eec[_0xebe9('0x49')]:_0x3f68fc[_0xebe9('0x45')];if(!_0x2d5602['query'][_0xebe9('0x4d')](_0xebe9('0x4e'))){_0x3b4eec[_0xebe9('0x30')]=qs[_0xebe9('0x30')](_0x2d5602['query'][_0xebe9('0x30')]);_0x3b4eec[_0xebe9('0x2e')]=qs[_0xebe9('0x2e')](_0x2d5602['query'][_0xebe9('0x2e')]);}_0x3b4eec[_0xebe9('0x69')]=qs[_0xebe9('0x4f')](_0x2d5602[_0xebe9('0x4a')][_0xebe9('0x4f')]);_0x3b4eec[_0xebe9('0x50')]=qs[_0xebe9('0x47')](_[_0xebe9('0x51')](_0x2d5602[_0xebe9('0x4a')],_0x3f68fc[_0xebe9('0x47')]));_0x3b4eec[_0xebe9('0x50')][_0xebe9('0x67')]=_0x27c9ea['id'];if(_0x2d5602[_0xebe9('0x4a')][_0xebe9('0x52')]){_0x3b4eec[_0xebe9('0x50')]=_['merge'](_0x3b4eec[_0xebe9('0x50')],{'$or':_[_0xebe9('0x3f')](_0x3b4eec[_0xebe9('0x49')],function(_0x262e76){var _0x4b692d={};_0x4b692d[_0x262e76]={'$like':'%'+_0x2d5602[_0xebe9('0x4a')]['filter']+'%'};return _0x4b692d;})});}_0x3b4eec=_[_0xebe9('0x54')]({},_0x3b4eec,_0x2d5602[_0xebe9('0x55')]);return db[_0xebe9('0x6d')][_0xebe9('0x31')]({'where':_0x3b4eec['where']})[_0xebe9('0x1f')](function(_0x1f4b0d){_0x2f747c['count']=_0x1f4b0d;if(_0x2d5602[_0xebe9('0x4a')][_0xebe9('0x56')]){_0x3b4eec[_0xebe9('0x5b')]=[{'all':!![]}];}return db[_0xebe9('0x6d')][_0xebe9('0x57')](_0x3b4eec);})['then'](function(_0x375246){_0x2f747c[_0xebe9('0x58')]=_0x375246;return _0x2f747c;});}})[_0xebe9('0x1f')](respondWithFilteredResult(_0x1ed6c7,_0x3b4eec))[_0xebe9('0x2a')](handleError(_0x1ed6c7,null));};exports[_0xebe9('0x70')]=function(_0x2f9102,_0x35a020,_0x552106){return db['WhatsappAccount'][_0xebe9('0x5c')]({'where':{'id':_0x2f9102[_0xebe9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x35a020,null))[_0xebe9('0x1f')](function(_0x35419d){if(_0x35419d){return _0x35419d[_0xebe9('0x70')](_0x2f9102['query'][_0xebe9('0x6b')]);}})[_0xebe9('0x1f')](respondWithStatusCode(_0x35a020,null))[_0xebe9('0x2a')](handleError(_0x35a020,null));};exports[_0xebe9('0x71')]=function(_0xeb2565,_0x329fa9,_0x485161){return db['WhatsappAccount']['find']({'where':{'id':_0xeb2565['params']['id']}})[_0xebe9('0x1f')](handleEntityNotFound(_0x329fa9,null))[_0xebe9('0x1f')](function(_0x23a396){if(_0x23a396){return _0x23a396[_0xebe9('0x71')](_0xeb2565[_0xebe9('0x64')][_0xebe9('0x6b')],_['omit'](_0xeb2565['body'],[_0xebe9('0x6b'),'id'])||{})[_0xebe9('0x72')](function(_0x8685fc){for(var _0x5a4597=0x0;_0x5a4597<_0xeb2565[_0xebe9('0x64')]['ids'][_0xebe9('0x4c')];_0x5a4597+=0x1){socket[_0xebe9('0x73')]('userWhatsappAccount:save',{'UserId':Number(_0xeb2565[_0xebe9('0x64')]['ids'][_0x5a4597]),'WhatsappAccountId':Number(_0xeb2565[_0xebe9('0x5a')]['id'])});}return _0x8685fc;});}})[_0xebe9('0x1f')](respondWithResult(_0x329fa9,null))['catch'](handleError(_0x329fa9,null));};exports[_0xebe9('0x74')]=function(_0x448614,_0x26a1ff,_0xb8555){return db['WhatsappAccount'][_0xebe9('0x5c')]({'where':{'id':_0x448614[_0xebe9('0x5a')]['id']}})[_0xebe9('0x1f')](handleEntityNotFound(_0x26a1ff,null))[_0xebe9('0x1f')](function(_0x38cff6){if(_0x38cff6){return _0x38cff6['removeAgents'](_0x448614[_0xebe9('0x4a')][_0xebe9('0x6b')])[_0xebe9('0x1f')](function(){if(_[_0xebe9('0x75')](_0x448614['query'][_0xebe9('0x6b')])){for(var _0xf8c849=0x0;_0xf8c849<_0x448614['query'][_0xebe9('0x6b')][_0xebe9('0x4c')];_0xf8c849+=0x1){socket[_0xebe9('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x448614['query'][_0xebe9('0x6b')][_0xf8c849]),'WhatsappAccountId':Number(_0x448614['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x448614['query']['ids']),'WhatsappAccountId':Number(_0x448614[_0xebe9('0x5a')]['id'])});}});}})[_0xebe9('0x1f')](respondWithStatusCode(_0x26a1ff,null))[_0xebe9('0x2a')](handleError(_0x26a1ff,null));};exports[_0xebe9('0x76')]=function(_0x429ece,_0x1c647a,_0x47efed){var _0x1e0b47={};var _0x355a9d={};var _0x618045;var _0x24806e;return db[_0xebe9('0x40')][_0xebe9('0x6f')]({'where':{'id':_0x429ece['params']['id']}})['then'](handleEntityNotFound(_0x1c647a,null))['then'](function(_0x4071f5){if(_0x4071f5){_0x618045=_0x4071f5;_0x355a9d['model']=_['keys'](db['User'][_0xebe9('0x41')]);_0x355a9d[_0xebe9('0x4a')]=_[_0xebe9('0x46')](_0x429ece['query']);_0x355a9d[_0xebe9('0x47')]=_[_0xebe9('0x48')](_0x355a9d[_0xebe9('0x45')],_0x355a9d[_0xebe9('0x4a')]);_0x1e0b47[_0xebe9('0x49')]=_[_0xebe9('0x48')](_0x355a9d[_0xebe9('0x45')],qs['fields'](_0x429ece[_0xebe9('0x4a')][_0xebe9('0x4b')]));_0x1e0b47[_0xebe9('0x49')]=_0x1e0b47[_0xebe9('0x49')][_0xebe9('0x4c')]?_0x1e0b47[_0xebe9('0x49')]:_0x355a9d[_0xebe9('0x45')];_0x1e0b47['order']=qs[_0xebe9('0x4f')](_0x429ece[_0xebe9('0x4a')][_0xebe9('0x4f')]);_0x1e0b47[_0xebe9('0x50')]=qs[_0xebe9('0x47')](_[_0xebe9('0x51')](_0x429ece[_0xebe9('0x4a')],_0x355a9d[_0xebe9('0x47')]));if(_0x429ece[_0xebe9('0x4a')][_0xebe9('0x52')]){_0x1e0b47['where']=_[_0xebe9('0x54')](_0x1e0b47['where'],{'$or':_[_0xebe9('0x3f')](_0x1e0b47['attributes'],function(_0x3eb6ba){var _0x11650b={};_0x11650b[_0x3eb6ba]={'$like':'%'+_0x429ece['query'][_0xebe9('0x52')]+'%'};return _0x11650b;})});}_0x1e0b47=_[_0xebe9('0x54')]({},_0x1e0b47,_0x429ece[_0xebe9('0x55')]);return _0x618045[_0xebe9('0x76')](_0x1e0b47);}})['then'](function(_0x583250){if(_0x583250){_0x24806e=_0x583250[_0xebe9('0x4c')];if(!_0x429ece[_0xebe9('0x4a')][_0xebe9('0x4d')](_0xebe9('0x4e'))){_0x1e0b47['limit']=qs[_0xebe9('0x30')](_0x429ece['query'][_0xebe9('0x30')]);_0x1e0b47[_0xebe9('0x2e')]=qs[_0xebe9('0x2e')](_0x429ece[_0xebe9('0x4a')][_0xebe9('0x2e')]);}return _0x618045[_0xebe9('0x76')](_0x1e0b47);}})[_0xebe9('0x1f')](function(_0x4b2b23){if(_0x4b2b23){return _0x4b2b23?{'count':_0x24806e,'rows':_0x4b2b23}:null;}})['then'](respondWithResult(_0x1c647a,null))[_0xebe9('0x2a')](handleError(_0x1c647a,null));};exports[_0xebe9('0x77')]=function(_0x248009,_0x53837a,_0x56f5c9){return db[_0xebe9('0x40')][_0xebe9('0x6f')]({'where':{'id':_0x248009[_0xebe9('0x5a')]['id']}})[_0xebe9('0x1f')](handleEntityNotFound(_0x53837a,null))['then'](function(_0x5c0fcb){if(_0x5c0fcb){return db['sequelize'][_0xebe9('0x78')](function(_0x33396e){return db[_0xebe9('0x79')][_0xebe9('0x37')]({'where':{'WhatsappAccountId':_0x248009[_0xebe9('0x5a')]['id']},'transaction':_0x33396e})[_0xebe9('0x1f')](function(_0x2cd514){var _0x5b0d1b=_[_0xebe9('0x3f')](_0x248009['body'],function(_0x4e20e8){_0x4e20e8[_0xebe9('0x67')]=_0x248009[_0xebe9('0x5a')]['id'];return _0x4e20e8;});return db['WhatsappApplication'][_0xebe9('0x7a')](_0x5b0d1b,{'transaction':_0x33396e});});})[_0xebe9('0x1f')](function(){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x248009[_0xebe9('0x5a')]['id']},'order':_0xebe9('0x7b')});});}})['then'](respondWithResult(_0x53837a,null))['catch'](handleError(_0x53837a,null));};exports[_0xebe9('0x7c')]=function(_0xe944bc,_0x564198,_0x6aa24e){var _0x2aa1c6={};var _0x2bacc5={};var _0x5aff8b;var _0x58268a;return db['WhatsappAccount'][_0xebe9('0x6f')]({'where':{'id':_0xe944bc[_0xebe9('0x5a')]['id']}})[_0xebe9('0x1f')](handleEntityNotFound(_0x564198,null))[_0xebe9('0x1f')](function(_0x126c9c){if(_0x126c9c){_0x5aff8b=_0x126c9c;_0x2bacc5[_0xebe9('0x45')]=_[_0xebe9('0x46')](db[_0xebe9('0x79')]['rawAttributes']);_0x2bacc5['query']=_['keys'](_0xe944bc[_0xebe9('0x4a')]);_0x2bacc5[_0xebe9('0x47')]=_[_0xebe9('0x48')](_0x2bacc5[_0xebe9('0x45')],_0x2bacc5[_0xebe9('0x4a')]);_0x2aa1c6[_0xebe9('0x49')]=_['intersection'](_0x2bacc5[_0xebe9('0x45')],qs[_0xebe9('0x4b')](_0xe944bc[_0xebe9('0x4a')][_0xebe9('0x4b')]));_0x2aa1c6[_0xebe9('0x49')]=_0x2aa1c6['attributes'][_0xebe9('0x4c')]?_0x2aa1c6['attributes']:_0x2bacc5['model'];_0x2aa1c6[_0xebe9('0x69')]=qs['sort'](_0xe944bc[_0xebe9('0x4a')][_0xebe9('0x4f')]);_0x2aa1c6['where']=qs['filters'](_['pick'](_0xe944bc[_0xebe9('0x4a')],_0x2bacc5['filters']));if(_0xe944bc[_0xebe9('0x4a')][_0xebe9('0x52')]){_0x2aa1c6[_0xebe9('0x50')]=_['merge'](_0x2aa1c6['where'],{'$or':_['map'](_0x2aa1c6[_0xebe9('0x49')],function(_0x3da211){var _0x3ec0bf={};_0x3ec0bf[_0x3da211]={'$like':'%'+_0xe944bc[_0xebe9('0x4a')][_0xebe9('0x52')]+'%'};return _0x3ec0bf;})});}_0x2aa1c6=_[_0xebe9('0x54')]({},_0x2aa1c6,_0xe944bc[_0xebe9('0x55')]);return _0x5aff8b[_0xebe9('0x7c')](_0x2aa1c6);}})[_0xebe9('0x1f')](function(_0x180299){if(_0x180299){_0x58268a=_0x180299[_0xebe9('0x4c')];if(!_0xe944bc[_0xebe9('0x4a')][_0xebe9('0x4d')](_0xebe9('0x4e'))){_0x2aa1c6[_0xebe9('0x30')]=qs[_0xebe9('0x30')](_0xe944bc['query']['limit']);_0x2aa1c6[_0xebe9('0x2e')]=qs[_0xebe9('0x2e')](_0xe944bc['query'][_0xebe9('0x2e')]);}return _0x5aff8b[_0xebe9('0x7c')](_0x2aa1c6);}})['then'](function(_0x2d5812){if(_0x2d5812){return _0x2d5812?{'count':_0x58268a,'rows':_0x2d5812}:null;}})[_0xebe9('0x1f')](respondWithResult(_0x564198,null))[_0xebe9('0x2a')](handleError(_0x564198,null));};exports[_0xebe9('0x7d')]=function(_0x34e999,_0x32e366,_0x37593c){var _0x5d0aa3={'channel':'whatsapp'};var _0x52b05a=[];var _0x2c58ae=[];var _0x4aff22={};return db['WhatsappAccount'][_0xebe9('0x5c')]({'where':{'id':_0x34e999[_0xebe9('0x5a')]['id']},'include':[{'model':db[_0xebe9('0x79')],'as':_0xebe9('0x7e')}]})[_0xebe9('0x1f')](handleEntityNotFound(_0x32e366,null))[_0xebe9('0x1f')](function(_0x5a2ded){_0x5d0aa3[_0xebe9('0x7f')]=_0x5a2ded;_0x5d0aa3[_0xebe9('0x80')]=_[_0xebe9('0x81')](_0x5a2ded[_0xebe9('0x7e')],[_0xebe9('0x7b')],[_0xebe9('0x82')]);if(_0x5d0aa3[_0xebe9('0x7f')][_0xebe9('0x7e')]){delete _0x5d0aa3[_0xebe9('0x7f')][_0xebe9('0x7e')];}return db[_0xebe9('0x83')][_0xebe9('0x65')]();})['then'](function(_0x1e0f30){if(!_0x1e0f30){throw new db['Sequelize']['ValidationError'](_0xebe9('0x84'));}_0x52b05a=_[_0xebe9('0x85')](_[_0xebe9('0x46')](_0x1e0f30),[_0xebe9('0x86'),_0xebe9('0x87')]);_0x2c58ae=_[_0xebe9('0x85')](_[_0xebe9('0x46')](_0x1e0f30),['createdAt','updatedAt',_0xebe9('0x88'),_0xebe9('0x89')]);_0x5d0aa3['body']={'mapKey':'mobile'};if(_0x5d0aa3[_0xebe9('0x7f')][_0xebe9('0x43')]&&_0x5d0aa3[_0xebe9('0x7f')][_0xebe9('0x43')]===_0xebe9('0x8a')){_0x5d0aa3['body']['from']=_0x34e999[_0xebe9('0x64')]['From']['replace'](_0xebe9('0x8b'),'');_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x64')]=_0x34e999[_0xebe9('0x64')][_0xebe9('0x8c')];_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x8d')]=_0x34e999[_0xebe9('0x64')]['MessageSid'];}if(_0x5d0aa3[_0xebe9('0x64')]['id']){delete _0x5d0aa3[_0xebe9('0x64')]['id'];}if(_[_0xebe9('0x8e')](_0x5d0aa3['body'][_0xebe9('0x8f')])){throw new db[(_0xebe9('0x90'))][(_0xebe9('0x91'))](_0xebe9('0x92'));}if(_[_0xebe9('0x8e')](_0x5d0aa3['body'][_0xebe9('0x64')])||_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x64')]===''){throw new db['Sequelize'][(_0xebe9('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xebe9('0x8e')](_0x5d0aa3['body'][_0xebe9('0x93')])){throw new db[(_0xebe9('0x90'))][(_0xebe9('0x91'))](_0xebe9('0x94')+_0x2c58ae);}if(!_[_0xebe9('0x95')](_0x2c58ae,_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x93')])){throw new db[(_0xebe9('0x90'))][(_0xebe9('0x91'))](_0xebe9('0x96')+_0x2c58ae);}_0x4aff22[_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x93')]]=_0x5d0aa3[_0xebe9('0x64')]['from'];return db[_0xebe9('0x97')][_0xebe9('0x5c')]({'where':{'id':_0x5d0aa3[_0xebe9('0x7f')]['ListId']},'include':[{'model':db[_0xebe9('0x83')],'as':_0xebe9('0x98'),'where':_0x4aff22,'limit':0x1,'order':[[_0xebe9('0x87'),_0xebe9('0x99')]]}]});})[_0xebe9('0x1f')](handleEntityNotFound(_0x32e366,null))['then'](function(_0x4e87d1){if(_0x4e87d1){_0x5d0aa3['list']=_['omit'](_0x4e87d1,[_0xebe9('0x98')]);if(_0x4e87d1[_0xebe9('0x98')][_0xebe9('0x4c')]){return _0x4e87d1[_0xebe9('0x98')][0x0];}var _0x23e97b=_[_0xebe9('0x18')](_0x5d0aa3['body'],{'firstName':_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x8f')],'ListId':_0x4e87d1['id']});_0x23e97b[_0x5d0aa3['body']['mapKey']]=_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x8f')];return db[_0xebe9('0x83')][_0xebe9('0x5d')](_0x23e97b,{'fields':_0x52b05a,'raw':!![]});}})[_0xebe9('0x1f')](handleEntityNotFound(_0x32e366,null))[_0xebe9('0x1f')](function(_0x2e2f61){if(_0x2e2f61){_0x5d0aa3[_0xebe9('0x9a')]=_0x2e2f61;var _0x563009={'ContactId':_0x2e2f61['id'],'phone':_0x5d0aa3['body'][_0xebe9('0x8f')],'WhatsappAccountId':_0x34e999[_0xebe9('0x5a')]['id']};var _0x26ab00={'ContactId':_0x2e2f61['id'],'WhatsappAccountId':_0x34e999[_0xebe9('0x5a')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xebe9('0x5c')]({'where':_0x26ab00})[_0xebe9('0x1f')](function(_0x1903ea){if(_0x1903ea){return[_0x1903ea,![]];}return db['WhatsappInteraction'][_0xebe9('0x5d')](_0x563009)[_0xebe9('0x1f')](function(_0x3fd9fa){return[_0x3fd9fa,!![]];});});}})[_0xebe9('0x72')](function(_0x4096f0,_0x992e8d){_0x5d0aa3[_0xebe9('0x9b')]=_0x4096f0[_0xebe9('0x38')]({'plain':!![]});_0x5d0aa3['interaction'][_0xebe9('0x9c')]=![];if(_0x992e8d){if(_0x5d0aa3[_0xebe9('0x7f')][_0xebe9('0x9d')]){_0x5d0aa3[_0xebe9('0x80')][_0xebe9('0x9e')]({'id':0x0,'priority':_0x5d0aa3['applications']['length']+0x1,'app':_0xebe9('0x9f'),'appdata':_0xebe9('0xa0'),'interval':_0xebe9('0xa1')});}_0x5d0aa3[_0xebe9('0x9b')][_0xebe9('0x9c')]=!![];}return db[_0xebe9('0xa2')][_0xebe9('0x5d')]({'phone':_0x5d0aa3[_0xebe9('0x64')]['from'],'messageId':_0x5d0aa3[_0xebe9('0x64')][_0xebe9('0x8d')],'body':_0x5d0aa3['body'][_0xebe9('0x64')],'WhatsappAccountId':_0x34e999[_0xebe9('0x5a')]['id'],'WhatsappInteractionId':_0x4096f0['id'],'direction':'in','ContactId':_0x4096f0[_0xebe9('0xa3')],'AttachmentId':_0x5d0aa3['body'][_0xebe9('0xa4')]});})['then'](function(_0x42171c){_0x5d0aa3[_0xebe9('0x27')]=_0x42171c;if(_0x5d0aa3['interaction'][_0xebe9('0xa5')]){return db['User']['find']({'attributes':['id',_0xebe9('0x3a')],'where':{'id':_0x5d0aa3[_0xebe9('0x9b')][_0xebe9('0xa5')]}})[_0xebe9('0x1f')](function(_0xc320d8){if(_0xc320d8){_0x5d0aa3[_0xebe9('0x80')][_0xebe9('0xa6')]({'id':0x0,'priority':0x0,'app':_0xebe9('0xa7'),'appdata':_0xc320d8['name']+','+(_0x5d0aa3[_0xebe9('0x7f')]['waitForTheAssignedAgent']||0xa),'interval':_0xebe9('0xa1')});}return respondWithRpcPromise(_0xebe9('0xa8'),_0xebe9('0xa9'),_0x5d0aa3);});}return respondWithRpcPromise('Start',_0xebe9('0xa9'),_0x5d0aa3);})[_0xebe9('0x1f')](function(_0x1eaa24){if(_0x1eaa24){var _0x85c54e=0xc8;var _0x17c988=_0xebe9('0xaa');logger[_0xebe9('0x28')](_0xebe9('0x23'),_0x17c988,_0x85c54e,'entity\x20found');logger['debug'](_0xebe9('0xab'),_0x17c988,_0x85c54e,_0xebe9('0xac'),JSON[_0xebe9('0x24')](_0x1eaa24));if(_0x5d0aa3[_0xebe9('0x7f')][_0xebe9('0x43')]===_0xebe9('0x8a')){return _0x32e366[_0xebe9('0x2c')](_0x85c54e)[_0xebe9('0x32')](_0xebe9('0xad'),_0xebe9('0xae'))[_0xebe9('0x3b')](_0xebe9('0xaf'));}else{return _0x32e366[_0xebe9('0x2c')](_0x85c54e)[_0xebe9('0xb0')](_0x1eaa24);}}})[_0xebe9('0x2a')](handleError(_0x32e366,null));};exports[_0xebe9('0x3b')]=function(_0x205f45,_0x4fea3c,_0x5274ad){var _0x21d238,_0x29b971,_0x1649ed;if(_[_0xebe9('0x8e')](_0x205f45[_0xebe9('0x64')]['body'])||_0x205f45[_0xebe9('0x64')][_0xebe9('0x64')]===''){throw new db[(_0xebe9('0x90'))][(_0xebe9('0x91'))](_0xebe9('0xb1'));}if(_[_0xebe9('0x8e')](_0x205f45[_0xebe9('0x64')]['to'])){throw new db[(_0xebe9('0x90'))][(_0xebe9('0x91'))](_0xebe9('0xb2'));}_0x21d238=_0x205f45['body']['to'];return db[_0xebe9('0x40')]['find']({'where':{'id':_0x205f45[_0xebe9('0x5a')]['id']},'include':[{'model':db[_0xebe9('0x97')],'as':_0xebe9('0xb3'),'include':[{'model':db[_0xebe9('0x83')],'as':'Contacts','where':{'mobile':_0x21d238},'limit':0x1,'order':[[_0xebe9('0x87'),_0xebe9('0x99')]]}]}]})[_0xebe9('0x1f')](handleEntityNotFound(_0x4fea3c,null))['then'](function(_0xd32925){if(_0xd32925&&_0xd32925[_0xebe9('0xb3')]){_0x29b971=_0xd32925['get']({'plain':!![]});if(_0x29b971['List']&&_0x29b971['List']['Contacts']['length']){return _0x29b971[_0xebe9('0xb3')][_0xebe9('0x98')][0x0];}return db[_0xebe9('0x83')][_0xebe9('0x5d')](_[_0xebe9('0x18')](_0x205f45[_0xebe9('0x64')],{'firstName':_0x21d238,'mobile':_0x21d238,'phone':_0x21d238,'ListId':_0x29b971['ListId']}));}})['then'](handleEntityNotFound(_0x4fea3c,null))[_0xebe9('0x1f')](function(_0x452487){if(_0x452487){_0x1649ed=_0x452487;return db[_0xebe9('0xb4')][_0xebe9('0x5c')]({'where':{'ContactId':_0x1649ed['id'],'closed':![],'WhatsappAccountId':_0x29b971['id']}})[_0xebe9('0x1f')](function(_0x9a7779){if(_0x9a7779){return[_0x9a7779,![]];}return db[_0xebe9('0xb4')][_0xebe9('0x5d')]({'UserId':_0x205f45['user']['id'],'ContactId':_0x1649ed['id'],'WhatsappAccountId':_0x29b971['id'],'phone':_0x21d238,'firstMsgDirection':_0xebe9('0xb5'),'Messages':[_[_0xebe9('0x54')](_0x205f45[_0xebe9('0x64')],{'read':![],'body':_0x205f45[_0xebe9('0x64')][_0xebe9('0x64')],'phone':_0x21d238,'WhatsappAccountId':_0x29b971['id'],'UserId':_0x205f45[_0xebe9('0x5f')]['id'],'ContactId':_0x1649ed['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xebe9('0xb6')}]})['then'](function(_0x199e33){return[_0x199e33,!![]];});});}})[_0xebe9('0x72')](function(_0x1b3ca2,_0x308603){if(_0x308603){return _0x1b3ca2;}return db[_0xebe9('0xa2')][_0xebe9('0x5d')](_['merge'](_0x205f45[_0xebe9('0x64')],{'read':![],'body':_0x205f45[_0xebe9('0x64')][_0xebe9('0x64')],'phone':_0x21d238,'WhatsappAccountId':_0x29b971['id'],'WhatsappInteractionId':_0x1b3ca2['id'],'UserId':_0x205f45[_0xebe9('0x5f')]['id'],'ContactId':_0x1649ed['id']}))[_0xebe9('0x1f')](function(_0x10ec14){_0x1b3ca2['dataValues']['Messages']=[];_0x1b3ca2[_0xebe9('0xb7')][_0xebe9('0xb6')][_0xebe9('0x9e')](_0x10ec14[_0xebe9('0xb7')]);return _0x1b3ca2;});})['then'](respondWithResult(_0x4fea3c,null))[_0xebe9('0x2a')](handleError(_0x4fea3c,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 0e3e180..dc9ac4d 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 _0x6c23=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x4b12cb,_0x5ca14b){var _0x5d3687=function(_0x26319d){while(--_0x26319d){_0x4b12cb['push'](_0x4b12cb['shift']());}};_0x5d3687(++_0x5ca14b);}(_0x6c23,0xbf));var _0x36c2=function(_0x228314,_0x4ed5c2){_0x228314=_0x228314-0x0;var _0x28a9ef=_0x6c23[_0x228314];return _0x28a9ef;};'use strict';var EventEmitter=require(_0x36c2('0x0'));var WhatsappAccount=require(_0x36c2('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x36c2('0x2')](0x0);var events={'afterCreate':_0x36c2('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x483dc4){return function(_0x23bd15,_0x38c10d,_0x69c5b8){WhatsappAccountEvents[_0x36c2('0x4')](_0x483dc4+':'+_0x23bd15['id'],_0x23bd15);WhatsappAccountEvents['emit'](_0x483dc4,_0x23bd15);_0x69c5b8(null);};}for(var e in events){if(events[_0x36c2('0x5')](e)){var event=events[e];WhatsappAccount[_0x36c2('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x92cb=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x5113da,_0x28ebbc){var _0x4216cf=function(_0x24cfb3){while(--_0x24cfb3){_0x5113da['push'](_0x5113da['shift']());}};_0x4216cf(++_0x28ebbc);}(_0x92cb,0x151));var _0xb92c=function(_0x146ac1,_0x1e86ec){_0x146ac1=_0x146ac1-0x0;var _0x27cf9e=_0x92cb[_0x146ac1];return _0x27cf9e;};'use strict';var EventEmitter=require(_0xb92c('0x0'));var WhatsappAccount=require(_0xb92c('0x1'))['db'][_0xb92c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb92c('0x3')](0x0);var events={'afterCreate':_0xb92c('0x4'),'afterUpdate':_0xb92c('0x5'),'afterDestroy':_0xb92c('0x6')};function emitEvent(_0x3c499d){return function(_0x68869b,_0x2ebe20,_0x4e7367){WhatsappAccountEvents['emit'](_0x3c499d+':'+_0x68869b['id'],_0x68869b);WhatsappAccountEvents[_0xb92c('0x7')](_0x3c499d,_0x68869b);_0x4e7367(null);};}for(var e in events){if(events[_0xb92c('0x8')](e)){var event=events[e];WhatsappAccount[_0xb92c('0x9')](e,emitEvent(event));}}module[_0xb92c('0xa')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index ed3096f..8ba8174 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 _0x1a02=['exports','define','WhatsappAccount','util','moment','request-promise','path','../../config/environment'];(function(_0x5e745e,_0xde2931){var _0x122dab=function(_0xe396a5){while(--_0xe396a5){_0x5e745e['push'](_0x5e745e['shift']());}};_0x122dab(++_0xde2931);}(_0x1a02,0x1ab));var _0x21a0=function(_0x448974,_0x157f8a){_0x448974=_0x448974-0x0;var _0x23ec10=_0x1a02[_0x448974];return _0x23ec10;};'use strict';var _=require('lodash');var util=require(_0x21a0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x21a0('0x1'));var BPromise=require('bluebird');var rp=require(_0x21a0('0x2'));var fs=require('fs');var path=require(_0x21a0('0x3'));var rimraf=require('rimraf');var config=require(_0x21a0('0x4'));var attributes=require('./whatsappAccount.attributes');module[_0x21a0('0x5')]=function(_0x18f6a2,_0x5e33b9){return _0x18f6a2[_0x21a0('0x6')](_0x21a0('0x7'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa22a=['request-promise','path','rimraf','../../config/environment','exports','whatsapp_accounts','lodash','util','moment','bluebird'];(function(_0x5bb22c,_0x335673){var _0x17081b=function(_0x4ae026){while(--_0x4ae026){_0x5bb22c['push'](_0x5bb22c['shift']());}};_0x17081b(++_0x335673);}(_0xa22a,0x146));var _0xaa22=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa22a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa22('0x0'));var util=require(_0xaa22('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa22('0x2'));var BPromise=require(_0xaa22('0x3'));var rp=require(_0xaa22('0x4'));var fs=require('fs');var path=require(_0xaa22('0x5'));var rimraf=require(_0xaa22('0x6'));var config=require(_0xaa22('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0xaa22('0x8')]=function(_0x1cb28b,_0xee29e9){return _0x1cb28b['define']('WhatsappAccount',attributes,{'tableName':_0xaa22('0x9'),'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 f85f961..2ce1064 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 _0x5d7c=['raw','attributes','include','map','model','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','options'];(function(_0x1b3e07,_0x3cc96f){var _0x166afc=function(_0x2bcd44){while(--_0x2bcd44){_0x1b3e07['push'](_0x1b3e07['shift']());}};_0x166afc(++_0x3cc96f);}(_0x5d7c,0x165));var _0xc5d7=function(_0x1b6382,_0x11fc67){_0x1b6382=_0x1b6382-0x0;var _0x27fc13=_0x5d7c[_0x1b6382];return _0x27fc13;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc5d7('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5d7('0x1'));var db=require(_0xc5d7('0x2'))['db'];var utils=require(_0xc5d7('0x3'));var logger=require(_0xc5d7('0x4'))(_0xc5d7('0x5'));var config=require('../../config/environment');var jayson=require(_0xc5d7('0x6'));var client=jayson[_0xc5d7('0x7')]['http']({'port':0x232a});config[_0xc5d7('0x8')]=_[_0xc5d7('0x9')](config[_0xc5d7('0x8')],{'host':_0xc5d7('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5d7('0x8')]));require(_0xc5d7('0xb'))[_0xc5d7('0xc')](socket);function respondWithRpcPromise(_0x3a261f,_0x42ee71,_0x5b4ede){return new BPromise(function(_0x274b7c,_0x15e0de){return client[_0xc5d7('0xd')](_0x3a261f,_0x5b4ede)[_0xc5d7('0xe')](function(_0x24786d){logger[_0xc5d7('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x42ee71,_0xc5d7('0x10'));logger[_0xc5d7('0x11')](_0xc5d7('0x12'),_0x42ee71,_0xc5d7('0x10'),JSON[_0xc5d7('0x13')](_0x24786d));if(_0x24786d['error']){if(_0x24786d[_0xc5d7('0x14')]['code']===0x1f4){logger[_0xc5d7('0x14')](_0xc5d7('0x15'),_0x42ee71,_0x24786d[_0xc5d7('0x14')][_0xc5d7('0x16')]);return _0x15e0de(_0x24786d[_0xc5d7('0x14')][_0xc5d7('0x16')]);}logger[_0xc5d7('0x14')](_0xc5d7('0x15'),_0x42ee71,_0x24786d['error'][_0xc5d7('0x16')]);return _0x274b7c(_0x24786d[_0xc5d7('0x14')][_0xc5d7('0x16')]);}else{logger['info'](_0xc5d7('0x15'),_0x42ee71,_0xc5d7('0x10'));_0x274b7c(_0x24786d[_0xc5d7('0x17')][_0xc5d7('0x16')]);}})[_0xc5d7('0x18')](function(_0x135992){logger['error'](_0xc5d7('0x15'),_0x42ee71,_0x135992);_0x15e0de(_0x135992);});});}exports[_0xc5d7('0x19')]=function(_0x335dc7){var _0x44f142=this;return new Promise(function(_0x60cc24,_0x155a85){return db['WhatsappAccount']['find']({'raw':_0x335dc7[_0xc5d7('0x1a')]?_0x335dc7[_0xc5d7('0x1a')][_0xc5d7('0x1b')]===undefined?!![]:![]:!![],'where':_0x335dc7[_0xc5d7('0x1a')]?_0x335dc7[_0xc5d7('0x1a')]['where']||null:null,'attributes':_0x335dc7[_0xc5d7('0x1a')]?_0x335dc7[_0xc5d7('0x1a')][_0xc5d7('0x1c')]||null:null,'include':_0x335dc7['options']?_0x335dc7[_0xc5d7('0x1a')][_0xc5d7('0x1d')]?_[_0xc5d7('0x1e')](_0x335dc7['options'][_0xc5d7('0x1d')],function(_0x4cce4e){return{'model':db[_0x4cce4e[_0xc5d7('0x1f')]],'as':_0x4cce4e['as'],'attributes':_0x4cce4e['attributes'],'include':_0x4cce4e[_0xc5d7('0x1d')]?_[_0xc5d7('0x1e')](_0x4cce4e[_0xc5d7('0x1d')],function(_0x39c656){return{'model':db[_0x39c656[_0xc5d7('0x1f')]],'as':_0x39c656['as'],'attributes':_0x39c656[_0xc5d7('0x1c')],'include':_0x39c656[_0xc5d7('0x1d')]?_[_0xc5d7('0x1e')](_0x39c656[_0xc5d7('0x1d')],function(_0xdb7a93){return{'model':db[_0xdb7a93[_0xc5d7('0x1f')]],'as':_0xdb7a93['as'],'attributes':_0xdb7a93[_0xc5d7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc5d7('0xe')](function(_0x54e1a7){logger[_0xc5d7('0xf')]('ShowWhatsappAccount',_0x335dc7);logger[_0xc5d7('0x11')](_0xc5d7('0x19'),_0x335dc7,JSON[_0xc5d7('0x13')](_0x54e1a7));_0x60cc24(_0x54e1a7);})[_0xc5d7('0x18')](function(_0x1cb024){logger['error'](_0xc5d7('0x19'),_0x1cb024[_0xc5d7('0x16')],_0x335dc7);_0x155a85(_0x44f142[_0xc5d7('0x14')](0x1f4,_0x1cb024[_0xc5d7('0x16')]));});});}; \ No newline at end of file +var _0xbf06=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','util','moment'];(function(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0xbf06,0x101));var _0x6bf0=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xbf06[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require(_0x6bf0('0x0'));var moment=require(_0x6bf0('0x1'));var BPromise=require(_0x6bf0('0x2'));var rs=require(_0x6bf0('0x3'));var fs=require('fs');var Redis=require(_0x6bf0('0x4'));var db=require(_0x6bf0('0x5'))['db'];var utils=require(_0x6bf0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6bf0('0x7'));var jayson=require(_0x6bf0('0x8'));var client=jayson[_0x6bf0('0x9')][_0x6bf0('0xa')]({'port':0x232a});config['redis']=_[_0x6bf0('0xb')](config[_0x6bf0('0xc')],{'host':_0x6bf0('0xd'),'port':0x18eb});var socket=require(_0x6bf0('0xe'))(new Redis(config[_0x6bf0('0xc')]));require('./whatsappAccount.socket')[_0x6bf0('0xf')](socket);function respondWithRpcPromise(_0x14d273,_0x2e2743,_0x448936){return new BPromise(function(_0x1eb7ec,_0x58bfcc){return client['request'](_0x14d273,_0x448936)[_0x6bf0('0x10')](function(_0x3a1e81){logger[_0x6bf0('0x11')](_0x6bf0('0x12'),_0x2e2743,_0x6bf0('0x13'));logger[_0x6bf0('0x14')](_0x6bf0('0x15'),_0x2e2743,_0x6bf0('0x13'),JSON[_0x6bf0('0x16')](_0x3a1e81));if(_0x3a1e81['error']){if(_0x3a1e81['error']['code']===0x1f4){logger['error'](_0x6bf0('0x12'),_0x2e2743,_0x3a1e81[_0x6bf0('0x17')][_0x6bf0('0x18')]);return _0x58bfcc(_0x3a1e81[_0x6bf0('0x17')][_0x6bf0('0x18')]);}logger[_0x6bf0('0x17')](_0x6bf0('0x12'),_0x2e2743,_0x3a1e81['error'][_0x6bf0('0x18')]);return _0x1eb7ec(_0x3a1e81[_0x6bf0('0x17')][_0x6bf0('0x18')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x2e2743,_0x6bf0('0x13'));_0x1eb7ec(_0x3a1e81[_0x6bf0('0x19')][_0x6bf0('0x18')]);}})[_0x6bf0('0x1a')](function(_0x1eb811){logger[_0x6bf0('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x2e2743,_0x1eb811);_0x58bfcc(_0x1eb811);});});}exports[_0x6bf0('0x1b')]=function(_0x1c4ed8){var _0x55cdf8=this;return new Promise(function(_0x33b8fe,_0x5642f1){return db[_0x6bf0('0x1c')][_0x6bf0('0x1d')]({'raw':_0x1c4ed8['options']?_0x1c4ed8[_0x6bf0('0x1e')][_0x6bf0('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c4ed8['options']?_0x1c4ed8[_0x6bf0('0x1e')][_0x6bf0('0x20')]||null:null,'attributes':_0x1c4ed8[_0x6bf0('0x1e')]?_0x1c4ed8['options'][_0x6bf0('0x21')]||null:null,'include':_0x1c4ed8[_0x6bf0('0x1e')]?_0x1c4ed8[_0x6bf0('0x1e')][_0x6bf0('0x22')]?_[_0x6bf0('0x23')](_0x1c4ed8['options']['include'],function(_0x4b6326){return{'model':db[_0x4b6326['model']],'as':_0x4b6326['as'],'attributes':_0x4b6326[_0x6bf0('0x21')],'include':_0x4b6326[_0x6bf0('0x22')]?_[_0x6bf0('0x23')](_0x4b6326[_0x6bf0('0x22')],function(_0x306b8a){return{'model':db[_0x306b8a[_0x6bf0('0x24')]],'as':_0x306b8a['as'],'attributes':_0x306b8a['attributes'],'include':_0x306b8a['include']?_[_0x6bf0('0x23')](_0x306b8a[_0x6bf0('0x22')],function(_0x5cbb4e){return{'model':db[_0x5cbb4e[_0x6bf0('0x24')]],'as':_0x5cbb4e['as'],'attributes':_0x5cbb4e[_0x6bf0('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6bf0('0x10')](function(_0x21bba0){logger['info'](_0x6bf0('0x1b'),_0x1c4ed8);logger[_0x6bf0('0x14')](_0x6bf0('0x1b'),_0x1c4ed8,JSON[_0x6bf0('0x16')](_0x21bba0));_0x33b8fe(_0x21bba0);})['catch'](function(_0x7cf0b8){logger['error'](_0x6bf0('0x1b'),_0x7cf0b8[_0x6bf0('0x18')],_0x1c4ed8);_0x5642f1(_0x55cdf8[_0x6bf0('0x17')](0x1f4,_0x7cf0b8[_0x6bf0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 5ded60d..b2a0255 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 _0xf57c=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf57c,0x106));var _0xcf57=function(_0x3af384,_0x2b2160){_0x3af384=_0x3af384-0x0;var _0x194aad=_0xf57c[_0x3af384];return _0x194aad;};'use strict';var WhatsappAccountEvents=require(_0xcf57('0x0'));var events=[_0xcf57('0x1'),_0xcf57('0x2'),_0xcf57('0x3')];function createListener(_0x575026,_0x1b26aa){return function(_0x33c34b){_0x1b26aa['emit'](_0x575026,_0x33c34b);};}function removeListener(_0xf11a1f,_0xb41813){return function(){WhatsappAccountEvents['removeListener'](_0xf11a1f,_0xb41813);};}exports[_0xcf57('0x4')]=function(_0x3b3883){for(var _0x4058c8=0x0,_0x4e98e1=events[_0xcf57('0x5')];_0x4058c8<_0x4e98e1;_0x4058c8++){var _0xa28b5=events[_0x4058c8];var _0x76dceb=createListener(_0xcf57('0x6')+_0xa28b5,_0x3b3883);WhatsappAccountEvents['on'](_0xa28b5,_0x76dceb);}}; \ No newline at end of file +var _0x8b8c=['save','remove','update','removeListener','register','whatsappAccount:'];(function(_0x14837e,_0x149d95){var _0x32b50c=function(_0x3719c0){while(--_0x3719c0){_0x14837e['push'](_0x14837e['shift']());}};_0x32b50c(++_0x149d95);}(_0x8b8c,0xf0));var _0xc8b8=function(_0x44d208,_0x32e911){_0x44d208=_0x44d208-0x0;var _0xc11d72=_0x8b8c[_0x44d208];return _0xc11d72;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xc8b8('0x0'),_0xc8b8('0x1'),_0xc8b8('0x2')];function createListener(_0x14fef7,_0x504802){return function(_0x323b1d){_0x504802['emit'](_0x14fef7,_0x323b1d);};}function removeListener(_0x16accd,_0x5953f8){return function(){WhatsappAccountEvents[_0xc8b8('0x3')](_0x16accd,_0x5953f8);};}exports[_0xc8b8('0x4')]=function(_0x5dfb4e){for(var _0x26b9a3=0x0,_0x226e34=events['length'];_0x26b9a3<_0x226e34;_0x26b9a3++){var _0x1516dd=events[_0x26b9a3];var _0x143fef=createListener(_0xc8b8('0x5')+_0x1516dd,_0x5dfb4e);WhatsappAccountEvents['on'](_0x1516dd,_0x143fef);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index dc77c03..db32e11 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 _0x6921=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','put','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x1030bd,_0x31189e){var _0x41f30d=function(_0x672a99){while(--_0x672a99){_0x1030bd['push'](_0x1030bd['shift']());}};_0x41f30d(++_0x31189e);}(_0x6921,0xa4));var _0x1692=function(_0x3f10ba,_0x55b8d7){_0x3f10ba=_0x3f10ba-0x0;var _0x3e63cf=_0x6921[_0x3f10ba];return _0x3e63cf;};'use strict';var multer=require(_0x1692('0x0'));var util=require(_0x1692('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1692('0x2'));var router=express[_0x1692('0x3')]();var fs_extra=require(_0x1692('0x4'));var auth=require(_0x1692('0x5'));var interaction=require(_0x1692('0x6'));var config=require(_0x1692('0x7'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x1692('0x8')](),controller[_0x1692('0x9')]);router[_0x1692('0xa')](_0x1692('0xb'),auth[_0x1692('0x8')](),controller['show']);router[_0x1692('0xc')]('/',auth[_0x1692('0x8')](),controller['create']);router[_0x1692('0xd')](_0x1692('0xb'),auth[_0x1692('0x8')](),controller[_0x1692('0xe')]);router['delete'](_0x1692('0xb'),auth[_0x1692('0x8')](),controller[_0x1692('0xf')]);module[_0x1692('0x10')]=router; \ No newline at end of file +var _0xf16c=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0x347aaf,_0x295f7e){var _0x19ec80=function(_0x137180){while(--_0x137180){_0x347aaf['push'](_0x347aaf['shift']());}};_0x19ec80(++_0x295f7e);}(_0xf16c,0xb1));var _0xcf16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf16c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xcf16('0x0'));var util=require(_0xcf16('0x1'));var path=require(_0xcf16('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf16('0x3'));var router=express[_0xcf16('0x4')]();var fs_extra=require(_0xcf16('0x5'));var auth=require(_0xcf16('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf16('0x7'));var controller=require(_0xcf16('0x8'));router['get']('/',auth[_0xcf16('0x9')](),controller[_0xcf16('0xa')]);router['get'](_0xcf16('0xb'),auth['isAuthenticated'](),controller[_0xcf16('0xc')]);router[_0xcf16('0xd')]('/',auth[_0xcf16('0x9')](),controller['create']);router[_0xcf16('0xe')](_0xcf16('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xcf16('0xf')]('/:id',auth[_0xcf16('0x9')](),controller[_0xcf16('0x10')]);module[_0xcf16('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 51e3c49..6e446a8 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 _0xdbe2=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0xdbe2,0x1c6));var _0x2dbe=function(_0x1c6664,_0x45566e){_0x1c6664=_0x1c6664-0x0;var _0x33124b=_0xdbe2[_0x1c6664];return _0x33124b;};'use strict';var Sequelize=require(_0x2dbe('0x0'));module[_0x2dbe('0x1')]={'priority':{'type':Sequelize[_0x2dbe('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2dbe('0x3')],'allowNull':![],'defaultValue':_0x2dbe('0x4')},'appdata':{'type':Sequelize[_0x2dbe('0x5')]()},'description':{'type':Sequelize[_0x2dbe('0x3')]},'interval':{'type':Sequelize[_0x2dbe('0x3')],'defaultValue':_0x2dbe('0x6')}}; \ No newline at end of file +var _0x6e66=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6e66,0x115));var _0x66e6=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x6e66[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require(_0x66e6('0x0'));module[_0x66e6('0x1')]={'priority':{'type':Sequelize[_0x66e6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x66e6('0x3')],'allowNull':![],'defaultValue':_0x66e6('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x66e6('0x3')]},'interval':{'type':Sequelize[_0x66e6('0x3')],'defaultValue':_0x66e6('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 60c3994..60a5f12 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 _0x9672=['type','VIRTUAL','options','WhatsappApplication','include','findAll','rows','show','includeAll','catch','create','params','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','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','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x200255,_0x48af70){var _0x3dc9b6=function(_0x4b2efe){while(--_0x4b2efe){_0x200255['push'](_0x200255['shift']());}};_0x3dc9b6(++_0x48af70);}(_0x9672,0xee));var _0x2967=function(_0x1beb67,_0x33c691){_0x1beb67=_0x1beb67-0x0;var _0x42fa22=_0x9672[_0x1beb67];return _0x42fa22;};'use strict';var emlformat=require(_0x2967('0x0'));var rimraf=require(_0x2967('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2967('0x2'));var rp=require(_0x2967('0x3'));var moment=require(_0x2967('0x4'));var BPromise=require(_0x2967('0x5'));var Mustache=require('mustache');var util=require(_0x2967('0x6'));var path=require(_0x2967('0x7'));var sox=require(_0x2967('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2967('0x9'));var _=require(_0x2967('0xa'));var squel=require(_0x2967('0xb'));var crypto=require(_0x2967('0xc'));var jsforce=require(_0x2967('0xd'));var deskjs=require(_0x2967('0xe'));var toCsv=require(_0x2967('0xf'));var querystring=require(_0x2967('0x10'));var Papa=require('papaparse');var Redis=require(_0x2967('0x11'));var authService=require(_0x2967('0x12'));var qs=require(_0x2967('0x13'));var as=require(_0x2967('0x14'));var hardwareService=require(_0x2967('0x15'));var logger=require(_0x2967('0x16'))('api');var utils=require(_0x2967('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2967('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x207630,_0x298f58){_0x298f58=_0x298f58||0xcc;return function(_0x4d777a){if(_0x4d777a){return _0x207630[_0x2967('0x19')](_0x298f58);}return _0x207630['status'](_0x298f58)[_0x2967('0x1a')]();};}function respondWithResult(_0x313b5c,_0x3ea4b3){_0x3ea4b3=_0x3ea4b3||0xc8;return function(_0x52d5c0){if(_0x52d5c0){return _0x313b5c['status'](_0x3ea4b3)[_0x2967('0x1b')](_0x52d5c0);}};}function respondWithFilteredResult(_0x9a4e11,_0x42296c){return function(_0x4e1d34){if(_0x4e1d34){var _0x574a9f=typeof _0x42296c[_0x2967('0x1c')]===_0x2967('0x1d')&&typeof _0x42296c[_0x2967('0x1e')]===_0x2967('0x1d');var _0x50fbcb=_0x4e1d34[_0x2967('0x1f')];var _0x426fee=_0x574a9f?0x0:_0x42296c[_0x2967('0x1c')];var _0x209f45=_0x574a9f?_0x4e1d34[_0x2967('0x1f')]:_0x42296c['offset']+_0x42296c[_0x2967('0x1e')];var _0x449991;if(_0x209f45>=_0x50fbcb){_0x209f45=_0x50fbcb;_0x449991=0xc8;}else{_0x449991=0xce;}_0x9a4e11[_0x2967('0x20')](_0x449991);return _0x9a4e11[_0x2967('0x21')]('Content-Range',_0x426fee+'-'+_0x209f45+'/'+_0x50fbcb)[_0x2967('0x1b')](_0x4e1d34);}return null;};}function patchUpdates(_0x1cb5e4){return function(_0x33bb91){try{jsonpatch['apply'](_0x33bb91,_0x1cb5e4,!![]);}catch(_0x5e0e26){return BPromise[_0x2967('0x22')](_0x5e0e26);}return _0x33bb91[_0x2967('0x23')]();};}function saveUpdates(_0x258eca,_0x10788e){return function(_0x832a72){if(_0x832a72){return _0x832a72[_0x2967('0x24')](_0x258eca)[_0x2967('0x25')](function(_0x3d1040){return _0x3d1040;});}return null;};}function removeEntity(_0x46ab4a,_0x5bd687){return function(_0x436b45){if(_0x436b45){return _0x436b45[_0x2967('0x26')]()[_0x2967('0x25')](function(){_0x46ab4a[_0x2967('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42acb3,_0x4327a5){return function(_0x524ab1){if(!_0x524ab1){_0x42acb3[_0x2967('0x19')](0x194);}return _0x524ab1;};}function handleError(_0x2f9d9f,_0x2bfcd3){_0x2bfcd3=_0x2bfcd3||0x1f4;return function(_0xef5d7f){logger[_0x2967('0x27')](_0xef5d7f[_0x2967('0x28')]);if(_0xef5d7f[_0x2967('0x29')]){delete _0xef5d7f['name'];}_0x2f9d9f[_0x2967('0x20')](_0x2bfcd3)[_0x2967('0x2a')](_0xef5d7f);};}exports[_0x2967('0x2b')]=function(_0x57cee6,_0x2a04e6){var _0x30ba97={},_0x2d704d={},_0x48a49b={'count':0x0,'rows':[]};var _0x903e11=_[_0x2967('0x2c')](db['WhatsappApplication'][_0x2967('0x2d')],function(_0x45c7fd){return{'name':_0x45c7fd[_0x2967('0x2e')],'type':_0x45c7fd['type'][_0x2967('0x2f')]};});_0x2d704d[_0x2967('0x30')]=_[_0x2967('0x2c')](_0x903e11,'name');_0x2d704d[_0x2967('0x31')]=_[_0x2967('0x32')](_0x57cee6[_0x2967('0x31')]);_0x2d704d[_0x2967('0x33')]=_[_0x2967('0x34')](_0x2d704d[_0x2967('0x30')],_0x2d704d[_0x2967('0x31')]);_0x30ba97[_0x2967('0x35')]=_[_0x2967('0x34')](_0x2d704d[_0x2967('0x30')],qs[_0x2967('0x36')](_0x57cee6[_0x2967('0x31')][_0x2967('0x36')]));_0x30ba97[_0x2967('0x35')]=_0x30ba97[_0x2967('0x35')][_0x2967('0x37')]?_0x30ba97['attributes']:_0x2d704d['model'];if(!_0x57cee6[_0x2967('0x31')][_0x2967('0x38')](_0x2967('0x39'))){_0x30ba97[_0x2967('0x1e')]=qs['limit'](_0x57cee6[_0x2967('0x31')]['limit']);_0x30ba97[_0x2967('0x1c')]=qs[_0x2967('0x1c')](_0x57cee6[_0x2967('0x31')]['offset']);}_0x30ba97[_0x2967('0x3a')]=qs['sort'](_0x57cee6[_0x2967('0x31')]['sort']);_0x30ba97[_0x2967('0x3b')]=qs[_0x2967('0x33')](_['pick'](_0x57cee6[_0x2967('0x31')],_0x2d704d[_0x2967('0x33')]),_0x903e11);if(_0x57cee6[_0x2967('0x31')][_0x2967('0x3c')]){_0x30ba97[_0x2967('0x3b')]=_[_0x2967('0x3d')](_0x30ba97[_0x2967('0x3b')],{'$or':_[_0x2967('0x2c')](_0x903e11,function(_0x3f3d19){if(_0x3f3d19[_0x2967('0x3e')]!==_0x2967('0x3f')){var _0x2d39df={};_0x2d39df[_0x3f3d19[_0x2967('0x29')]]={'$like':'%'+_0x57cee6[_0x2967('0x31')][_0x2967('0x3c')]+'%'};return _0x2d39df;}})});}_0x30ba97=_[_0x2967('0x3d')]({},_0x30ba97,_0x57cee6[_0x2967('0x40')]);var _0x735670={'where':_0x30ba97[_0x2967('0x3b')]};return db[_0x2967('0x41')][_0x2967('0x1f')](_0x735670)[_0x2967('0x25')](function(_0x3366c1){_0x48a49b[_0x2967('0x1f')]=_0x3366c1;if(_0x57cee6['query']['includeAll']){_0x30ba97[_0x2967('0x42')]=[{'all':!![]}];}return db[_0x2967('0x41')][_0x2967('0x43')](_0x30ba97);})[_0x2967('0x25')](function(_0x3ce06d){_0x48a49b[_0x2967('0x44')]=_0x3ce06d;return _0x48a49b;})['then'](respondWithFilteredResult(_0x2a04e6,_0x30ba97))['catch'](handleError(_0x2a04e6,null));};exports[_0x2967('0x45')]=function(_0x5c6b8c,_0x235d39){var _0x3f4a94={'raw':!![],'where':{'id':_0x5c6b8c['params']['id']}},_0x31a35f={};_0x31a35f[_0x2967('0x30')]=_[_0x2967('0x32')](db['WhatsappApplication']['rawAttributes']);_0x31a35f[_0x2967('0x31')]=_[_0x2967('0x32')](_0x5c6b8c[_0x2967('0x31')]);_0x31a35f['filters']=_[_0x2967('0x34')](_0x31a35f[_0x2967('0x30')],_0x31a35f[_0x2967('0x31')]);_0x3f4a94[_0x2967('0x35')]=_['intersection'](_0x31a35f['model'],qs[_0x2967('0x36')](_0x5c6b8c['query'][_0x2967('0x36')]));_0x3f4a94['attributes']=_0x3f4a94['attributes'][_0x2967('0x37')]?_0x3f4a94[_0x2967('0x35')]:_0x31a35f['model'];if(_0x5c6b8c[_0x2967('0x31')][_0x2967('0x46')]){_0x3f4a94['include']=[{'all':!![]}];}_0x3f4a94=_[_0x2967('0x3d')]({},_0x3f4a94,_0x5c6b8c[_0x2967('0x40')]);return db[_0x2967('0x41')]['find'](_0x3f4a94)[_0x2967('0x25')](handleEntityNotFound(_0x235d39,null))['then'](respondWithResult(_0x235d39,null))[_0x2967('0x47')](handleError(_0x235d39,null));};exports[_0x2967('0x48')]=function(_0x420182,_0x286869){return db[_0x2967('0x41')][_0x2967('0x48')](_0x420182['body'],{})[_0x2967('0x25')](respondWithResult(_0x286869,0xc9))[_0x2967('0x47')](handleError(_0x286869,null));};exports['update']=function(_0x369128,_0x27bbac){if(_0x369128['body']['id']){delete _0x369128['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x369128[_0x2967('0x49')]['id']}})[_0x2967('0x25')](handleEntityNotFound(_0x27bbac,null))['then'](saveUpdates(_0x369128[_0x2967('0x4a')],null))[_0x2967('0x25')](respondWithResult(_0x27bbac,null))[_0x2967('0x47')](handleError(_0x27bbac,null));};exports[_0x2967('0x26')]=function(_0x2fcad1,_0x304f6f){return db['WhatsappApplication']['find']({'where':{'id':_0x2fcad1[_0x2967('0x49')]['id']}})[_0x2967('0x25')](handleEntityNotFound(_0x304f6f,null))['then'](removeEntity(_0x304f6f,null))['catch'](handleError(_0x304f6f,null));}; \ No newline at end of file +var _0x9666=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication','includeAll','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf'];(function(_0x5a4b42,_0x2b9c18){var _0x5e81d6=function(_0x595077){while(--_0x595077){_0x5a4b42['push'](_0x5a4b42['shift']());}};_0x5e81d6(++_0x2b9c18);}(_0x9666,0x17a));var _0x6966=function(_0x18053b,_0x323fe6){_0x18053b=_0x18053b-0x0;var _0x19d879=_0x9666[_0x18053b];return _0x19d879;};'use strict';var emlformat=require(_0x6966('0x0'));var rimraf=require(_0x6966('0x1'));var zipdir=require(_0x6966('0x2'));var jsonpatch=require(_0x6966('0x3'));var rp=require('request-promise');var moment=require(_0x6966('0x4'));var BPromise=require(_0x6966('0x5'));var Mustache=require(_0x6966('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6966('0x7'));var csv=require(_0x6966('0x8'));var ejs=require(_0x6966('0x9'));var fs=require('fs');var fs_extra=require(_0x6966('0xa'));var _=require(_0x6966('0xb'));var squel=require(_0x6966('0xc'));var crypto=require('crypto');var jsforce=require(_0x6966('0xd'));var deskjs=require(_0x6966('0xe'));var toCsv=require(_0x6966('0x8'));var querystring=require('querystring');var Papa=require(_0x6966('0xf'));var Redis=require(_0x6966('0x10'));var authService=require(_0x6966('0x11'));var qs=require(_0x6966('0x12'));var as=require(_0x6966('0x13'));var hardwareService=require(_0x6966('0x14'));var logger=require(_0x6966('0x15'))(_0x6966('0x16'));var utils=require(_0x6966('0x17'));var config=require(_0x6966('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c5272,_0x154c15){_0x154c15=_0x154c15||0xcc;return function(_0x2ce913){if(_0x2ce913){return _0x4c5272[_0x6966('0x19')](_0x154c15);}return _0x4c5272['status'](_0x154c15)['end']();};}function respondWithResult(_0x584bf2,_0x235ba3){_0x235ba3=_0x235ba3||0xc8;return function(_0xbd4ea2){if(_0xbd4ea2){return _0x584bf2[_0x6966('0x1a')](_0x235ba3)[_0x6966('0x1b')](_0xbd4ea2);}};}function respondWithFilteredResult(_0x19428c,_0x48d414){return function(_0x204200){if(_0x204200){var _0x1bf59d=typeof _0x48d414['offset']===_0x6966('0x1c')&&typeof _0x48d414[_0x6966('0x1d')]===_0x6966('0x1c');var _0x529dbd=_0x204200[_0x6966('0x1e')];var _0x4bf5b8=_0x1bf59d?0x0:_0x48d414[_0x6966('0x1f')];var _0x519049=_0x1bf59d?_0x204200['count']:_0x48d414['offset']+_0x48d414[_0x6966('0x1d')];var _0x5eef44;if(_0x519049>=_0x529dbd){_0x519049=_0x529dbd;_0x5eef44=0xc8;}else{_0x5eef44=0xce;}_0x19428c['status'](_0x5eef44);return _0x19428c['set']('Content-Range',_0x4bf5b8+'-'+_0x519049+'/'+_0x529dbd)['json'](_0x204200);}return null;};}function patchUpdates(_0x197c2c){return function(_0x247570){try{jsonpatch[_0x6966('0x20')](_0x247570,_0x197c2c,!![]);}catch(_0x4e8342){return BPromise[_0x6966('0x21')](_0x4e8342);}return _0x247570[_0x6966('0x22')]();};}function saveUpdates(_0x43349b,_0x8c7833){return function(_0x33fc7f){if(_0x33fc7f){return _0x33fc7f[_0x6966('0x23')](_0x43349b)[_0x6966('0x24')](function(_0x2af0b7){return _0x2af0b7;});}return null;};}function removeEntity(_0x3772d7,_0x509631){return function(_0x24af6a){if(_0x24af6a){return _0x24af6a[_0x6966('0x25')]()[_0x6966('0x24')](function(){_0x3772d7[_0x6966('0x1a')](0xcc)[_0x6966('0x26')]();});}};}function handleEntityNotFound(_0x27db0e,_0x44a5df){return function(_0x4e4c30){if(!_0x4e4c30){_0x27db0e[_0x6966('0x19')](0x194);}return _0x4e4c30;};}function handleError(_0x5a7f85,_0x433601){_0x433601=_0x433601||0x1f4;return function(_0x4f7aa2){logger[_0x6966('0x27')](_0x4f7aa2[_0x6966('0x28')]);if(_0x4f7aa2[_0x6966('0x29')]){delete _0x4f7aa2[_0x6966('0x29')];}_0x5a7f85[_0x6966('0x1a')](_0x433601)[_0x6966('0x2a')](_0x4f7aa2);};}exports[_0x6966('0x2b')]=function(_0x1b86a7,_0x2c9fbb){var _0x4a85c7={},_0x270919={},_0x35fdb4={'count':0x0,'rows':[]};var _0x59a8d6=_[_0x6966('0x2c')](db['WhatsappApplication'][_0x6966('0x2d')],function(_0x297c21){return{'name':_0x297c21[_0x6966('0x2e')],'type':_0x297c21[_0x6966('0x2f')][_0x6966('0x30')]};});_0x270919[_0x6966('0x31')]=_[_0x6966('0x2c')](_0x59a8d6,_0x6966('0x29'));_0x270919[_0x6966('0x32')]=_[_0x6966('0x33')](_0x1b86a7[_0x6966('0x32')]);_0x270919[_0x6966('0x34')]=_[_0x6966('0x35')](_0x270919[_0x6966('0x31')],_0x270919[_0x6966('0x32')]);_0x4a85c7[_0x6966('0x36')]=_['intersection'](_0x270919[_0x6966('0x31')],qs['fields'](_0x1b86a7[_0x6966('0x32')][_0x6966('0x37')]));_0x4a85c7[_0x6966('0x36')]=_0x4a85c7[_0x6966('0x36')][_0x6966('0x38')]?_0x4a85c7[_0x6966('0x36')]:_0x270919[_0x6966('0x31')];if(!_0x1b86a7[_0x6966('0x32')][_0x6966('0x39')](_0x6966('0x3a'))){_0x4a85c7['limit']=qs[_0x6966('0x1d')](_0x1b86a7[_0x6966('0x32')][_0x6966('0x1d')]);_0x4a85c7['offset']=qs['offset'](_0x1b86a7[_0x6966('0x32')][_0x6966('0x1f')]);}_0x4a85c7['order']=qs[_0x6966('0x3b')](_0x1b86a7['query']['sort']);_0x4a85c7[_0x6966('0x3c')]=qs[_0x6966('0x34')](_[_0x6966('0x3d')](_0x1b86a7[_0x6966('0x32')],_0x270919['filters']),_0x59a8d6);if(_0x1b86a7[_0x6966('0x32')][_0x6966('0x3e')]){_0x4a85c7[_0x6966('0x3c')]=_[_0x6966('0x3f')](_0x4a85c7[_0x6966('0x3c')],{'$or':_[_0x6966('0x2c')](_0x59a8d6,function(_0x3cb629){if(_0x3cb629[_0x6966('0x2f')]!==_0x6966('0x40')){var _0x112bff={};_0x112bff[_0x3cb629[_0x6966('0x29')]]={'$like':'%'+_0x1b86a7[_0x6966('0x32')][_0x6966('0x3e')]+'%'};return _0x112bff;}})});}_0x4a85c7=_['merge']({},_0x4a85c7,_0x1b86a7[_0x6966('0x41')]);var _0x5c9590={'where':_0x4a85c7['where']};return db[_0x6966('0x42')][_0x6966('0x1e')](_0x5c9590)['then'](function(_0x57949e){_0x35fdb4[_0x6966('0x1e')]=_0x57949e;if(_0x1b86a7[_0x6966('0x32')][_0x6966('0x43')]){_0x4a85c7['include']=[{'all':!![]}];}return db[_0x6966('0x42')][_0x6966('0x44')](_0x4a85c7);})[_0x6966('0x24')](function(_0x6af6a8){_0x35fdb4[_0x6966('0x45')]=_0x6af6a8;return _0x35fdb4;})[_0x6966('0x24')](respondWithFilteredResult(_0x2c9fbb,_0x4a85c7))[_0x6966('0x46')](handleError(_0x2c9fbb,null));};exports[_0x6966('0x47')]=function(_0x1df2cb,_0x5356fc){var _0x49be81={'raw':!![],'where':{'id':_0x1df2cb[_0x6966('0x48')]['id']}},_0x50ec04={};_0x50ec04['model']=_[_0x6966('0x33')](db[_0x6966('0x42')]['rawAttributes']);_0x50ec04[_0x6966('0x32')]=_['keys'](_0x1df2cb[_0x6966('0x32')]);_0x50ec04[_0x6966('0x34')]=_[_0x6966('0x35')](_0x50ec04[_0x6966('0x31')],_0x50ec04[_0x6966('0x32')]);_0x49be81[_0x6966('0x36')]=_[_0x6966('0x35')](_0x50ec04[_0x6966('0x31')],qs[_0x6966('0x37')](_0x1df2cb[_0x6966('0x32')][_0x6966('0x37')]));_0x49be81['attributes']=_0x49be81[_0x6966('0x36')][_0x6966('0x38')]?_0x49be81[_0x6966('0x36')]:_0x50ec04['model'];if(_0x1df2cb[_0x6966('0x32')][_0x6966('0x43')]){_0x49be81['include']=[{'all':!![]}];}_0x49be81=_[_0x6966('0x3f')]({},_0x49be81,_0x1df2cb[_0x6966('0x41')]);return db[_0x6966('0x42')][_0x6966('0x49')](_0x49be81)[_0x6966('0x24')](handleEntityNotFound(_0x5356fc,null))[_0x6966('0x24')](respondWithResult(_0x5356fc,null))[_0x6966('0x46')](handleError(_0x5356fc,null));};exports[_0x6966('0x4a')]=function(_0x3635b8,_0x154d3e){return db['WhatsappApplication'][_0x6966('0x4a')](_0x3635b8['body'],{})[_0x6966('0x24')](respondWithResult(_0x154d3e,0xc9))[_0x6966('0x46')](handleError(_0x154d3e,null));};exports['update']=function(_0x301555,_0x4955b8){if(_0x301555[_0x6966('0x4b')]['id']){delete _0x301555[_0x6966('0x4b')]['id'];}return db[_0x6966('0x42')]['find']({'where':{'id':_0x301555[_0x6966('0x48')]['id']}})['then'](handleEntityNotFound(_0x4955b8,null))[_0x6966('0x24')](saveUpdates(_0x301555[_0x6966('0x4b')],null))[_0x6966('0x24')](respondWithResult(_0x4955b8,null))['catch'](handleError(_0x4955b8,null));};exports['destroy']=function(_0x3422fe,_0x40175c){return db[_0x6966('0x42')][_0x6966('0x49')]({'where':{'id':_0x3422fe[_0x6966('0x48')]['id']}})['then'](handleEntityNotFound(_0x40175c,null))[_0x6966('0x24')](removeEntity(_0x40175c,null))[_0x6966('0x46')](handleError(_0x40175c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index ebd54d6..cf21c09 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 _0x5178=['moment','bluebird','rimraf','../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','../../config/logger','api'];(function(_0xe1df26,_0x23c4cd){var _0x7c09e9=function(_0x533a1a){while(--_0x533a1a){_0xe1df26['push'](_0xe1df26['shift']());}};_0x7c09e9(++_0x23c4cd);}(_0x5178,0x171));var _0x8517=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5178[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0x8517('0x7')]=function(_0x58ed7e,_0x13ba05){return _0x58ed7e[_0x8517('0x8')](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8517('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9d92=['whatsapp_applications','utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication'];(function(_0x4070e6,_0x39c88d){var _0x1ec3b2=function(_0x556a03){while(--_0x556a03){_0x4070e6['push'](_0x4070e6['shift']());}};_0x1ec3b2(++_0x39c88d);}(_0x9d92,0xdf));var _0x29d9=function(_0x3239f5,_0x50e77c){_0x3239f5=_0x3239f5-0x0;var _0x3559c8=_0x9d92[_0x3239f5];return _0x3559c8;};'use strict';var _=require(_0x29d9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29d9('0x1'));var moment=require(_0x29d9('0x2'));var BPromise=require('bluebird');var rp=require(_0x29d9('0x3'));var fs=require('fs');var path=require(_0x29d9('0x4'));var rimraf=require(_0x29d9('0x5'));var config=require(_0x29d9('0x6'));var attributes=require(_0x29d9('0x7'));module[_0x29d9('0x8')]=function(_0x27d032,_0x52932b){return _0x27d032[_0x29d9('0x9')](_0x29d9('0xa'),attributes,{'tableName':_0x29d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x29d9('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 05894c3..6239f80 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x533e43,_0x31038b){var _0x716ea7=function(_0xed91e5){while(--_0xed91e5){_0x533e43['push'](_0x533e43['shift']());}};_0x716ea7(++_0x31038b);}(_0x55ca,0x126));var _0xa55c=function(_0x2e17a7,_0x5b5efa){_0x2e17a7=_0x2e17a7-0x0;var _0x443505=_0x55ca[_0x2e17a7];return _0x443505;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x327572,_0x2f2565){var _0x485e48=function(_0x52ac02){while(--_0x52ac02){_0x327572['push'](_0x327572['shift']());}};_0x485e48(++_0x2f2565);}(_0xac31,0xca));var _0x1ac3=function(_0x3f924f,_0x3e13af){_0x3f924f=_0x3f924f-0x0;var _0x5aa25f=_0xac31[_0x3f924f];return _0x5aa25f;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 28edf47..7a91cdf 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 _0x4300=['removeTags','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','addTags','put','update','whatsappinteraction:destroy','destroy'];(function(_0x3efab9,_0xba045){var _0x16b7b1=function(_0x43e877){while(--_0x43e877){_0x3efab9['push'](_0x3efab9['shift']());}};_0x16b7b1(++_0xba045);}(_0x4300,0x1a6));var _0x0430=function(_0x2c7b16,_0x25cc01){_0x2c7b16=_0x2c7b16-0x0;var _0x2f198d=_0x4300[_0x2c7b16];return _0x2f198d;};'use strict';var multer=require(_0x0430('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0430('0x1')]();var fs_extra=require(_0x0430('0x2'));var auth=require(_0x0430('0x3'));var interaction=require(_0x0430('0x4'));var config=require(_0x0430('0x5'));var controller=require('./whatsappInteraction.controller');router[_0x0430('0x6')]('/',auth['isAuthenticated'](),controller[_0x0430('0x7')]);router['get'](_0x0430('0x8'),auth[_0x0430('0x9')](),controller[_0x0430('0xa')]);router[_0x0430('0x6')](_0x0430('0xb'),auth[_0x0430('0x9')](),controller[_0x0430('0xc')]);router[_0x0430('0x6')](_0x0430('0xd'),auth['isAuthenticated'](),controller[_0x0430('0xe')]);router[_0x0430('0x6')](_0x0430('0xf'),auth[_0x0430('0x9')](),controller[_0x0430('0x10')]);router[_0x0430('0x11')]('/',auth[_0x0430('0x9')](),controller[_0x0430('0x12')]);router['post']('/:id/messages',auth[_0x0430('0x9')](),controller[_0x0430('0x13')]);router[_0x0430('0x11')](_0x0430('0x14'),auth[_0x0430('0x9')](),interaction[_0x0430('0x15')](_0x0430('0x16'),'whatsappinteraction:addtags'),controller[_0x0430('0x17')]);router[_0x0430('0x18')](_0x0430('0xb'),auth[_0x0430('0x9')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x0430('0x19')]);router['delete']('/:id',auth[_0x0430('0x9')](),interaction[_0x0430('0x15')](_0x0430('0x16'),_0x0430('0x1a')),controller[_0x0430('0x1b')]);router['delete']('/:id/tags',auth[_0x0430('0x9')](),controller[_0x0430('0x1c')]);module[_0x0430('0x1d')]=router; \ No newline at end of file +var _0xc6ac=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x4a4af4,_0x35e5f8){var _0x432df6=function(_0xb04240){while(--_0xb04240){_0x4a4af4['push'](_0x4a4af4['shift']());}};_0x432df6(++_0x35e5f8);}(_0xc6ac,0x15b));var _0xcc6a=function(_0xe54599,_0x3985b3){_0xe54599=_0xe54599-0x0;var _0x3bfd82=_0xc6ac[_0xe54599];return _0x3bfd82;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0x16')]('/',auth[_0xcc6a('0xc')](),controller['create']);router['post'](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x17')]);router['post']('/:id/tags',auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1a')),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x1c')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0xcc6a('0x1d')]);router[_0xcc6a('0x1e')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1f')),controller[_0xcc6a('0x20')]);router[_0xcc6a('0x1e')](_0xcc6a('0x21'),auth[_0xcc6a('0xc')](),controller['removeTags']);module[_0xcc6a('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index c15a718..88e4852 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 _0xb491=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0xd0e429,_0x35a0af){var _0x243b77=function(_0x192f53){while(--_0x192f53){_0xd0e429['push'](_0xd0e429['shift']());}};_0x243b77(++_0x35a0af);}(_0xb491,0x18c));var _0x1b49=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xb491[_0x56daff];return _0x132c82;};'use strict';var Sequelize=require(_0x1b49('0x0'));var moment=require(_0x1b49('0x1'));module[_0x1b49('0x2')]={'closed':{'type':Sequelize[_0x1b49('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b49('0x4')]},'disposition':{'type':Sequelize[_0x1b49('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1b49('0x5')]},'note':{'type':Sequelize[_0x1b49('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x1b49('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1b49('0x6')]('in',_0x1b49('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1b49('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1b49('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x7163=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x7163,0x1ef));var _0x3716=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0x7163[_0x313c96];return _0x522f53;};'use strict';var Sequelize=require(_0x3716('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x3716('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3716('0x2')]},'disposition':{'type':Sequelize[_0x3716('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3716('0x3')]},'note':{'type':Sequelize[_0x3716('0x3')]},'phone':{'type':Sequelize[_0x3716('0x3')]},'read1stAt':{'type':Sequelize[_0x3716('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3716('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3716('0x4')]('in',_0x3716('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3716('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 15357ad..c1cce1b 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 _0x41a6=['./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','reject','save','update','then','destroy','end','error','stack','name','fullname','TagIds','Tags','split','forEach','catch','waiting','talking','unmanaged','closed','UserId','answered','total','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','field','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','some','compact','isEmpty','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','WhatsappInteraction','a.key','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','params','includeAll','include','merge','options','create','body','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','color','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','get','mkdirSync','Whatsapp','Account','Owner','N.A.','closedAt','disposition','basename','existsSync','pipe','createWriteStream','System','secret','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter'];(function(_0x42135e,_0x5f4b26){var _0x11b9a8=function(_0x78794){while(--_0x78794){_0x42135e['push'](_0x42135e['shift']());}};_0x11b9a8(++_0x5f4b26);}(_0x41a6,0x1c8));var _0x641a=function(_0x50727d,_0x2f4446){_0x50727d=_0x50727d-0x0;var _0x31bcb1=_0x41a6[_0x50727d];return _0x31bcb1;};'use strict';var emlformat=require(_0x641a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x641a('0x1'));var rp=require('request-promise');var moment=require(_0x641a('0x2'));var BPromise=require(_0x641a('0x3'));var Mustache=require(_0x641a('0x4'));var util=require(_0x641a('0x5'));var path=require(_0x641a('0x6'));var sox=require('sox');var csv=require(_0x641a('0x7'));var ejs=require(_0x641a('0x8'));var fs=require('fs');var fs_extra=require(_0x641a('0x9'));var _=require(_0x641a('0xa'));var squel=require(_0x641a('0xb'));var crypto=require(_0x641a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x641a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x641a('0xe'));var Papa=require(_0x641a('0xf'));var Redis=require(_0x641a('0x10'));var authService=require(_0x641a('0x11'));var qs=require(_0x641a('0x12'));var as=require(_0x641a('0x13'));var pdf=require(_0x641a('0x14'));var hardwareService=require(_0x641a('0x15'));var logger=require('../../config/logger')(_0x641a('0x16'));var utils=require(_0x641a('0x17'));var config=require(_0x641a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x641a('0x19'))['db'];config['redis']=_['defaults'](config[_0x641a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x641a('0x1b'))(new Redis(config[_0x641a('0x1a')]));require(_0x641a('0x1c'))[_0x641a('0x1d')](socket);function respondWithStatusCode(_0x5417a3,_0x19378c){_0x19378c=_0x19378c||0xcc;return function(_0x2f1911){if(_0x2f1911){return _0x5417a3[_0x641a('0x1e')](_0x19378c);}return _0x5417a3['status'](_0x19378c)['end']();};}function respondWithResult(_0x5cdcdf,_0x270756){_0x270756=_0x270756||0xc8;return function(_0x283ad){if(_0x283ad){return _0x5cdcdf[_0x641a('0x1f')](_0x270756)[_0x641a('0x20')](_0x283ad);}};}function respondWithFilteredResult(_0x2d63bc,_0xae38d3){return function(_0x22cfde){if(_0x22cfde){var _0x2e5a1c=typeof _0xae38d3[_0x641a('0x21')]===_0x641a('0x22')&&typeof _0xae38d3['limit']===_0x641a('0x22');var _0x440814=_0x22cfde['count'];var _0x428d48=_0x2e5a1c?0x0:_0xae38d3[_0x641a('0x21')];var _0x295b92=_0x2e5a1c?_0x22cfde[_0x641a('0x23')]:_0xae38d3[_0x641a('0x21')]+_0xae38d3[_0x641a('0x24')];var _0xb2a959;if(_0x295b92>=_0x440814){_0x295b92=_0x440814;_0xb2a959=0xc8;}else{_0xb2a959=0xce;}_0x2d63bc[_0x641a('0x1f')](_0xb2a959);return _0x2d63bc['set']('Content-Range',_0x428d48+'-'+_0x295b92+'/'+_0x440814)['json'](_0x22cfde);}return null;};}function patchUpdates(_0x21a196){return function(_0x5bbe6f){try{jsonpatch['apply'](_0x5bbe6f,_0x21a196,!![]);}catch(_0x2d950f){return BPromise[_0x641a('0x25')](_0x2d950f);}return _0x5bbe6f[_0x641a('0x26')]();};}function saveUpdates(_0x354a9f,_0xe182d7){return function(_0x4101ba){if(_0x4101ba){return _0x4101ba[_0x641a('0x27')](_0x354a9f)[_0x641a('0x28')](function(_0x35da07){return _0x35da07;});}return null;};}function removeEntity(_0x5abc24,_0x1c84e3){return function(_0x27112e){if(_0x27112e){return _0x27112e[_0x641a('0x29')]()[_0x641a('0x28')](function(){_0x5abc24[_0x641a('0x1f')](0xcc)[_0x641a('0x2a')]();});}};}function handleEntityNotFound(_0x31e3e2,_0x199d71){return function(_0x18ff07){if(!_0x18ff07){_0x31e3e2['sendStatus'](0x194);}return _0x18ff07;};}function handleError(_0x5f5b44,_0x4ff571){_0x4ff571=_0x4ff571||0x1f4;return function(_0x349ad5){logger[_0x641a('0x2b')](_0x349ad5[_0x641a('0x2c')]);if(_0x349ad5[_0x641a('0x2d')]){delete _0x349ad5[_0x641a('0x2d')];}_0x5f5b44[_0x641a('0x1f')](_0x4ff571)['send'](_0x349ad5);};}function getInteractionUsers(_0x1b9e12,_0x2a703a){return new BPromise(function(_0x1c9f73,_0x334caa){try{if(_0x2a703a[_0x1b9e12['id']]){_0x1b9e12['Users']=_['map'](_0x2a703a[_0x1b9e12['id']],function(_0x56c401){return{'id':_0x56c401['id'],'fullname':_0x56c401[_0x641a('0x2e')]};});}}catch(_0x202828){_0x334caa(_0x202828);}_0x1c9f73(_0x1b9e12);});}function getInteractionTags(_0x422d49,_0x787cfe){return new BPromise(function(_0x2cf310,_0x3343ac){try{if(_0x422d49[_0x641a('0x2f')]){_0x422d49[_0x641a('0x30')]=[];_0x422d49['TagIds'][_0x641a('0x31')](',')[_0x641a('0x32')](function(_0xdb351e){_0x422d49[_0x641a('0x30')]['push'](_0x787cfe[_0xdb351e]);});}delete _0x422d49[_0x641a('0x2f')];}catch(_0x28eb1a){_0x3343ac(_0x28eb1a);}_0x2cf310(_0x422d49);});}function updateWhatsappInteraction(_0x215f19,_0x2ac41c,_0x39fc1e){return new BPromise(function(_0x41d86c,_0x485746){return getInteractionUsers(_0x215f19,_0x39fc1e)[_0x641a('0x28')](function(_0x1c36e1){return getInteractionTags(_0x1c36e1,_0x2ac41c);})[_0x641a('0x28')](function(_0x1f965e){return getStateInteraction(_0x1f965e);})[_0x641a('0x28')](function(_0x946920){_0x41d86c(_0x946920);})[_0x641a('0x33')](function(_0x16c7f0){_0x485746(_0x16c7f0);});});}function getStateInteraction(_0x2169b7){return new BPromise(function(_0x467be2,_0x1b5cfc){_0x2169b7[_0x641a('0x34')]=0x0;_0x2169b7[_0x641a('0x35')]=0x0;_0x2169b7['answered']=0x0;_0x2169b7[_0x641a('0x36')]=0x0;_0x2169b7['total']=0x0;if(!_0x2169b7[_0x641a('0x37')]&&!_0x2169b7[_0x641a('0x38')])_0x2169b7['waiting']+=0x1;if(!_0x2169b7[_0x641a('0x37')]&&_0x2169b7['UserId'])_0x2169b7['talking']+=0x1;if(_0x2169b7[_0x641a('0x37')]&&_0x2169b7[_0x641a('0x38')])_0x2169b7[_0x641a('0x39')]+=0x1;if(_0x2169b7[_0x641a('0x37')]&&!_0x2169b7[_0x641a('0x38')])_0x2169b7['unmanaged']+=0x1;_0x2169b7[_0x641a('0x3a')]+=0x1;_0x467be2(_0x2169b7);});}exports[_0x641a('0x3b')]=function(_0x5197ec,_0x13a007){var _0x37ea1b={},_0x4d45ca={},_0xdaab45={'count':0x0,'rows':[]};var _0x15f435=_[_0x641a('0x3c')](db['WhatsappInteraction'][_0x641a('0x3d')],function(_0x95a8a9){return{'name':_0x95a8a9[_0x641a('0x3e')],'type':_0x95a8a9['type'][_0x641a('0x3f')]};});_0x4d45ca[_0x641a('0x40')]=_[_0x641a('0x3c')](_0x15f435,'name');_0x4d45ca[_0x641a('0x41')]=_[_0x641a('0x42')](_0x5197ec['query']);_0x4d45ca[_0x641a('0x43')]=_['intersection'](_0x4d45ca[_0x641a('0x40')],_0x4d45ca[_0x641a('0x41')]);_0x37ea1b[_0x641a('0x44')]=_[_0x641a('0x45')](_0x4d45ca[_0x641a('0x40')],qs[_0x641a('0x46')](_0x5197ec[_0x641a('0x41')]['fields']));_0x37ea1b[_0x641a('0x44')]=_0x37ea1b[_0x641a('0x44')]['length']?_0x37ea1b[_0x641a('0x44')]:_0x4d45ca[_0x641a('0x40')];if(!_0x5197ec[_0x641a('0x41')][_0x641a('0x47')](_0x641a('0x48'))){_0x37ea1b[_0x641a('0x24')]=qs['limit'](_0x5197ec[_0x641a('0x41')]['limit']);_0x37ea1b[_0x641a('0x21')]=qs['offset'](_0x5197ec['query'][_0x641a('0x21')]);}_0x37ea1b[_0x641a('0x49')]=qs[_0x641a('0x4a')](_0x5197ec[_0x641a('0x41')][_0x641a('0x4a')]);_0x37ea1b['where']=qs['filters'](_[_0x641a('0x4b')](_0x5197ec[_0x641a('0x41')],_0x4d45ca[_0x641a('0x43')]),_0x15f435);var _0x5d2a79=[];var _0x5798b0=squel['select']()[_0x641a('0x4c')]('id')[_0x641a('0x4c')](_0x641a('0x2d'))['field']('color')[_0x641a('0x4d')](_0x641a('0x4e'));var _0x39fa7f=squel[_0x641a('0x4f')]()['field'](_0x641a('0x50'))[_0x641a('0x4c')](_0x641a('0x51'))[_0x641a('0x4c')](_0x641a('0x52'))[_0x641a('0x4d')](_0x641a('0x53'),'ui')[_0x641a('0x54')](_0x641a('0x55'),'u',_0x641a('0x56'));var _0x2635d0=squel[_0x641a('0x4f')]()[_0x641a('0x4d')]('whatsapp_interactions','i')[_0x641a('0x54')](_0x641a('0x57'),'c',_0x641a('0x58'))[_0x641a('0x54')](_0x641a('0x55'),'o',_0x641a('0x59'))['left_join'](_0x641a('0x5a'),'a',_0x641a('0x5b'))[_0x641a('0x54')]('whatsapp_messages','me',_0x641a('0x5c'))[_0x641a('0x54')](_0x641a('0x5d'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x641a('0x4e'),'t',_0x641a('0x5e'));var _0x46bf56=squel['expr']();var _0x50cb59=[];var _0x19d421=squel[_0x641a('0x5f')]();var _0x1341a7;if(_0x5197ec['query'][_0x641a('0x60')]){_0x1341a7=as[_0x641a('0x61')](_0x5197ec[_0x641a('0x41')]['search']);var _0x1c0f1c=_0x1341a7[_0x641a('0x62')];for(var _0x5aa73a=0x0;_0x5aa73a<_0x1341a7[_0x641a('0x63')]['length'];_0x5aa73a++){var _0x4b201c=_0x1341a7[_0x641a('0x63')][_0x5aa73a];var _0x29ed67='i';var _0xd16857=_[_0x641a('0x64')](_0x15f435,[_0x641a('0x2d'),_0x4b201c['field']]);if(!_0xd16857){switch(_0x4b201c[_0x641a('0x4c')]){case _0x641a('0x65'):if(_0x4b201c[_0x641a('0x66')]==0x1){_0x2635d0[_0x641a('0x67')]('`'+_0x4b201c[_0x641a('0x4c')]+_0x641a('0x68'));}else{_0x2635d0[_0x641a('0x67')]('`'+_0x4b201c[_0x641a('0x4c')]+_0x641a('0x69'));}break;case _0x641a('0x6a'):if(_0x4b201c[_0x641a('0x6b')]===_0x641a('0x6c')){if(_0x4b201c[_0x641a('0x66')]['split']('\x20')[_0x641a('0x6d')]>0x1){_0x46bf56[_0x1c0f1c](_0x641a('0x6e'),qs[_0x641a('0x6f')](_0x4b201c['value']),null);}else{var _0x368abc='%'+_0x4b201c[_0x641a('0x66')]+'%';_0x46bf56[_0x1c0f1c]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x368abc,_0x368abc,_0x368abc);}}else{_0xd16857=_[_0x641a('0x64')](_0x15f435,[_0x641a('0x2d'),_0x641a('0x70')]);_0x4b201c[_0x641a('0x4c')]=_0x641a('0x70');_0x300084=as[_0x641a('0x71')](_0x29ed67,_0xd16857['type'],_0x4b201c);_0x46bf56[_0x1c0f1c](_0x300084[_0x641a('0x72')],_0x300084[_0x641a('0x66')][_0x641a('0x73')],_0x300084[_0x641a('0x66')]['end']);}break;case _0x641a('0x74'):var _0x5d32f4=_0x4b201c[_0x641a('0x66')]['split'](',')[_0x641a('0x3c')](function(_0x3f5952){return Number(_0x3f5952);});_0x5d32f4[_0x641a('0x32')](function(_0x5a1b2f){_0x19d421['or'](_0x641a('0x75'),'%,'+_0x5a1b2f+',%');});_0x50cb59=_[_0x641a('0x76')](_0x50cb59,_0x5d32f4);break;case _0x641a('0x77'):if(_0x4b201c['operator']===_0x641a('0x6c')){_0x46bf56[_0x1c0f1c](_0x641a('0x78'),'%'+_0x4b201c[_0x641a('0x66')]+'%',null);}else{_0xd16857=_[_0x641a('0x64')](_0x15f435,['name',_0x641a('0x38')]);_0x4b201c[_0x641a('0x4c')]='UserId';_0x300084=as['buildExpression'](_0x29ed67,_0xd16857['type'],_0x4b201c);_0x46bf56[_0x1c0f1c](_0x300084[_0x641a('0x72')],_0x300084[_0x641a('0x66')][_0x641a('0x73')],_0x300084[_0x641a('0x66')][_0x641a('0x2a')]);}break;case'body':_0x300084=as[_0x641a('0x71')]('me',null,_0x4b201c);_0x46bf56[_0x1c0f1c](_0x300084[_0x641a('0x72')],_0x300084[_0x641a('0x66')][_0x641a('0x73')],_0x300084[_0x641a('0x66')][_0x641a('0x2a')]);break;}}else{var _0x300084=as[_0x641a('0x71')](_0x29ed67,_0xd16857[_0x641a('0x79')],_0x4b201c);_0x46bf56[_0x1c0f1c](_0x300084[_0x641a('0x72')],_0x300084['value'][_0x641a('0x73')],_0x300084[_0x641a('0x66')][_0x641a('0x2a')]);}}}else{var _0x218660=_(_0x5197ec[_0x641a('0x41')])[_0x641a('0x42')]()[_0x641a('0x3c')](function(_0x3750c6){return _[_0x641a('0x7a')](_0x15f435,[_0x641a('0x2d'),_0x3750c6])?_0x3750c6:undefined;})[_0x641a('0x7b')]()[_0x641a('0x66')]();if(!_[_0x641a('0x7c')](_0x218660)){_0x218660['forEach'](function(_0x5d0071){if(_0x5d0071==='WhatsappAccountId'){_0x2635d0[_0x641a('0x7d')](_0x641a('0x7e'),[][_0x641a('0x7f')](_0x5197ec[_0x641a('0x41')][_0x5d0071]));}else if(_0x5d0071===_0x641a('0x80')){var _0x20e3d9=JSON['parse'](_0x5197ec['query'][_0x5d0071])[_0x641a('0x81')];var _0x43a957=JSON[_0x641a('0x82')](_0x5197ec[_0x641a('0x41')][_0x5d0071])[_0x641a('0x83')];_0x2635d0[_0x641a('0x7d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x20e3d9,_0x43a957);}else{if(_0x5197ec['query'][_0x5d0071]===_0x641a('0x84')){_0x2635d0[_0x641a('0x7d')]('i.'+_0x5d0071+_0x641a('0x85'));}else{_0x2635d0[_0x641a('0x7d')]('i.'+_0x5d0071+_0x641a('0x86'),_0x5197ec['query'][_0x5d0071]);}}});}if(_0x5197ec[_0x641a('0x41')][_0x641a('0x87')]){if(_0x5197ec[_0x641a('0x41')][_0x641a('0x87')]==0x1){_0x2635d0[_0x641a('0x67')](_0x641a('0x88'));}else{_0x2635d0[_0x641a('0x67')](_0x641a('0x89'));}}if(_0x5197ec[_0x641a('0x41')]['tag']){_0x50cb59=_[_0x641a('0x8a')](_0x5197ec['query']['tag'])?_0x5197ec['query'][_0x641a('0x8b')]:new Array(_0x5197ec['query'][_0x641a('0x8b')]);_0x50cb59[_0x641a('0x32')](function(_0x2dc7bc){_0x19d421['or'](_0x641a('0x75'),'%,'+_0x2dc7bc+',%');});}if(_0x5197ec[_0x641a('0x41')][_0x641a('0x8c')]){var _0x41e9b9=_0x5197ec[_0x641a('0x41')][_0x641a('0x8c')][_0x641a('0x8d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x641a('0x8e')](_0x41e9b9)){_0x46bf56['or'](_0x641a('0x8f'),_0x41e9b9+'%')['or'](_0x641a('0x90'),_0x41e9b9+'%');}else{_0x46bf56['or'](_0x641a('0x91'),qs[_0x641a('0x6f')](_0x41e9b9))['or'](_0x641a('0x92'),_0x41e9b9+'%');}}}_0x2635d0[_0x641a('0x7d')](_0x46bf56);_0x2635d0['group'](_0x641a('0x93'));var _0x2074ff={'type':db[_0x641a('0x94')][_0x641a('0x95')][_0x641a('0x96')],'raw':!![]};var _0x47988c=_0x2635d0[_0x641a('0x97')]();_0x47988c[_0x641a('0x4c')](_0x641a('0x93'));_0x47988c[_0x641a('0x4c')](_0x641a('0x98'),_0x641a('0x65'));if(_0x37ea1b['order']){_0x37ea1b['order'][_0x641a('0x32')](function(_0x2068a0){var _0x2e0c50=_0x2068a0[0x0]===_0x641a('0x99')?_0x2068a0[0x0]:'i.'+_0x2068a0[0x0];_0x2635d0[_0x641a('0x49')](_0x2e0c50,_0x2068a0[0x1]===_0x641a('0x9a')?![]:!![]);});}if(!_[_0x641a('0x7c')](_0x50cb59)){_0x2635d0[_0x641a('0x67')](_0x19d421);_0x47988c[_0x641a('0x7d')]('t.id\x20IN\x20?',_0x50cb59);}BPromise['resolve']()[_0x641a('0x28')](function(){if(!_0x1341a7){if(_0x5197ec[_0x641a('0x41')][_0x641a('0x9b')])return;_0x47988c[_0x641a('0x7d')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x2635d0[_0x641a('0x7d')](_0x641a('0x9c'));return;}if(_0x5197ec['user'][_0x641a('0x9d')]!==_0x641a('0x9e'))return;return _0x5197ec['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x641a('0x28')](function(_0x4c80eb){if(_['isEmpty'](_0x4c80eb)){_0x47988c['where'](_0x641a('0x9f'));_0x2635d0['where'](_0x641a('0x9f'));}else{_0x47988c[_0x641a('0x7d')](_0x641a('0x7e'),_['map'](_0x4c80eb,'id'));_0x2635d0['where'](_0x641a('0x7e'),_[_0x641a('0x3c')](_0x4c80eb,'id'));}});})[_0x641a('0x28')](function(){if(_0x5197ec['user'][_0x641a('0x9d')]===_0x641a('0x9e')&&!_0x1341a7&&!_0x5197ec['query'][_0x641a('0x9b')])return[];return db[_0x641a('0xa0')][_0x641a('0x41')](_0x47988c[_0x641a('0xa1')](),_0x2074ff);})[_0x641a('0x28')](function(_0x1375b5){_0xdaab45[_0x641a('0x23')]=_0x1375b5[_0x641a('0x6d')];if(_0xdaab45[_0x641a('0x23')]===0x0)return[];return db[_0x641a('0xa0')]['query'](_0x5798b0[_0x641a('0xa1')](),_0x2074ff)['then'](function(_0x9fbf31){_0x5d2a79=_[_0x641a('0xa2')](_0x9fbf31,'id');_0x2074ff=_['merge'](_0x2074ff,{'model':db[_0x641a('0xa3')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5197ec['query'][_0x641a('0x46')]){_0x37ea1b[_0x641a('0x44')]['forEach'](function(_0x262d1d){_0x2635d0[_0x641a('0x4c')]('i.'+_0x262d1d);});}else{_0x2635d0[_0x641a('0x4c')](_0x641a('0x98'),'unreadMessages');_0x2635d0[_0x641a('0x4c')](_0x641a('0xa4'),'Account.key');_0x2635d0['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2635d0['field'](_0x641a('0xa5'),_0x641a('0x99'));_0x2635d0[_0x641a('0x4c')](_0x641a('0xa6'));_0x2635d0[_0x641a('0x4c')](_0x641a('0xa7'),'Contact.firstName');_0x2635d0[_0x641a('0x4c')]('c.lastName','Contact.lastName');_0x2635d0[_0x641a('0x4c')](_0x641a('0xa8'),'Contact.email');_0x2635d0[_0x641a('0x4c')](_0x641a('0xa9'),_0x641a('0xaa'));_0x2635d0[_0x641a('0x4c')](_0x641a('0xab'),_0x641a('0xac'));_0x2635d0[_0x641a('0x4c')]('c.fax',_0x641a('0xad'));_0x2635d0[_0x641a('0x4c')](_0x641a('0xae'),'Owner.fullname');_0x2635d0[_0x641a('0x4c')](_0x641a('0xaf'),'Owner.internal');_0x2635d0['field'](_0x641a('0xb0'),_0x641a('0x2f'));}if(_0x37ea1b[_0x641a('0x24')])_0x2635d0[_0x641a('0x24')](_0x37ea1b[_0x641a('0x24')]);if(_0x37ea1b['offset'])_0x2635d0[_0x641a('0x21')](_0x37ea1b[_0x641a('0x21')]);return db[_0x641a('0xa0')][_0x641a('0x41')](_0x2635d0['toString'](),_0x2074ff);})[_0x641a('0x28')](function(_0x1248cb){if(_0x1248cb[_0x641a('0x6d')]>0x0)_0x39fa7f[_0x641a('0x7d')](_0x641a('0xb1'),_['map'](_0x1248cb,'id'));return db[_0x641a('0xa0')][_0x641a('0x41')](_0x39fa7f['toString'](),_0x2074ff)[_0x641a('0x28')](function(_0x39eed0){var _0x191113=_[_0x641a('0xb2')](_0x39eed0,_0x641a('0xb3'));var _0xadb13c=[];_0x1248cb[_0x641a('0x32')](function(_0x1ffc7f){_0xadb13c[_0x641a('0xb4')](updateWhatsappInteraction(_0x1ffc7f,_0x5d2a79,_0x191113));});return BPromise[_0x641a('0xb5')](_0xadb13c);});});})[_0x641a('0x28')](function(_0x560158){_0xdaab45[_0x641a('0xb6')]=_0x560158;return _0xdaab45;})['then'](respondWithFilteredResult(_0x13a007,_0x37ea1b))[_0x641a('0x33')](handleError(_0x13a007,null));};exports['show']=function(_0x465512,_0x445043){var _0x1da8f4={'raw':![],'where':{'id':_0x465512[_0x641a('0xb7')]['id']}},_0x4c810b={};_0x4c810b[_0x641a('0x40')]=_[_0x641a('0x42')](db[_0x641a('0xa3')][_0x641a('0x3d')]);_0x4c810b[_0x641a('0x41')]=_[_0x641a('0x42')](_0x465512[_0x641a('0x41')]);_0x4c810b[_0x641a('0x43')]=_[_0x641a('0x45')](_0x4c810b['model'],_0x4c810b[_0x641a('0x41')]);_0x1da8f4[_0x641a('0x44')]=_['intersection'](_0x4c810b[_0x641a('0x40')],qs['fields'](_0x465512[_0x641a('0x41')][_0x641a('0x46')]));_0x1da8f4[_0x641a('0x44')]=_0x1da8f4['attributes'][_0x641a('0x6d')]?_0x1da8f4[_0x641a('0x44')]:_0x4c810b['model'];if(_0x465512[_0x641a('0x41')][_0x641a('0xb8')]){_0x1da8f4[_0x641a('0xb9')]=[{'all':!![]}];}_0x1da8f4=_[_0x641a('0xba')]({},_0x1da8f4,_0x465512[_0x641a('0xbb')]);return db[_0x641a('0xa3')][_0x641a('0x64')](_0x1da8f4)['then'](handleEntityNotFound(_0x445043,null))[_0x641a('0x28')](respondWithResult(_0x445043,null))[_0x641a('0x33')](handleError(_0x445043,null));};exports[_0x641a('0xbc')]=function(_0x3097f4,_0x21c9ff){return db['WhatsappInteraction'][_0x641a('0xbc')](_0x3097f4[_0x641a('0xbd')],{})[_0x641a('0x28')](respondWithResult(_0x21c9ff,0xc9))['catch'](handleError(_0x21c9ff,null));};exports[_0x641a('0x27')]=function(_0x946e06,_0x1b399d){if(_0x946e06[_0x641a('0xbd')]['id']){delete _0x946e06[_0x641a('0xbd')]['id'];}return db[_0x641a('0xa3')]['find']({'where':{'id':_0x946e06[_0x641a('0xb7')]['id']}})[_0x641a('0x28')](handleEntityNotFound(_0x1b399d,null))[_0x641a('0x28')](saveUpdates(_0x946e06['body'],null))['then'](respondWithResult(_0x1b399d,null))[_0x641a('0x33')](handleError(_0x1b399d,null));};exports[_0x641a('0x29')]=function(_0x2bcb83,_0x7e5734){return db['WhatsappInteraction']['find']({'where':{'id':_0x2bcb83[_0x641a('0xb7')]['id']}})[_0x641a('0x28')](handleEntityNotFound(_0x7e5734,null))[_0x641a('0x28')](removeEntity(_0x7e5734,null))[_0x641a('0x33')](handleError(_0x7e5734,null));};exports[_0x641a('0xbe')]=function(_0x5c3348,_0x462033){return db[_0x641a('0xa3')]['describe']()[_0x641a('0x28')](respondWithResult(_0x462033,null))[_0x641a('0x33')](handleError(_0x462033,null));};exports[_0x641a('0xbf')]=function(_0x3abcc4,_0x57a789,_0x55917f){return db[_0x641a('0xc0')][_0x641a('0x64')]({'where':{'id':_0x3abcc4[_0x641a('0xb7')]['id']}})[_0x641a('0x28')](handleEntityNotFound(_0x57a789,null))[_0x641a('0x28')](function(_0x5e65e9){if(_0x5e65e9){return _0x5e65e9[_0x641a('0xbf')](_0x3abcc4[_0x641a('0xbd')][_0x641a('0xc1')],_['omit'](_0x3abcc4[_0x641a('0xbd')],[_0x641a('0xc1'),'id'])||{});}})[_0x641a('0x28')](respondWithResult(_0x57a789,null))[_0x641a('0x33')](handleError(_0x57a789,null));};exports[_0x641a('0xc2')]=function(_0x390f9e,_0x32c30b,_0x4189e0){var _0x418a77={'raw':![],'where':{}};var _0xc77647={};var _0x28bbe6={'count':0x0,'rows':[]};return db[_0x641a('0xa3')][_0x641a('0xc3')]({'where':{'id':_0x390f9e[_0x641a('0xb7')]['id']}})[_0x641a('0x28')](handleEntityNotFound(_0x32c30b,null))[_0x641a('0x28')](function(_0x3eb665){if(_0x3eb665){_0xc77647[_0x641a('0x40')]=_[_0x641a('0x42')](db[_0x641a('0xc0')][_0x641a('0x3d')]);_0xc77647[_0x641a('0x41')]=_[_0x641a('0x42')](_0x390f9e[_0x641a('0x41')]);_0xc77647[_0x641a('0x43')]=_['intersection'](_0xc77647['model'],_0xc77647[_0x641a('0x41')]);_0x418a77['attributes']=_[_0x641a('0x45')](_0xc77647[_0x641a('0x40')],qs[_0x641a('0x46')](_0x390f9e[_0x641a('0x41')]['fields']));_0x418a77['attributes']=_0x418a77[_0x641a('0x44')]['length']?_0x418a77[_0x641a('0x44')]:_0xc77647[_0x641a('0x40')];if(!_0x390f9e[_0x641a('0x41')]['hasOwnProperty'](_0x641a('0x48'))){_0x418a77[_0x641a('0x24')]=qs[_0x641a('0x24')](_0x390f9e[_0x641a('0x41')][_0x641a('0x24')]);_0x418a77[_0x641a('0x21')]=qs['offset'](_0x390f9e['query'][_0x641a('0x21')]);}_0x418a77[_0x641a('0x49')]=qs[_0x641a('0x4a')](_0x390f9e[_0x641a('0x41')][_0x641a('0x4a')]);_0x418a77[_0x641a('0x7d')]=qs[_0x641a('0x43')](_[_0x641a('0x4b')](_0x390f9e['query'],_0xc77647[_0x641a('0x43')]));_0x418a77[_0x641a('0x7d')]['WhatsappInteractionId']=_0x3eb665['id'];if(_0x390f9e[_0x641a('0x41')][_0x641a('0x8c')]){_0x418a77['where']=_[_0x641a('0xba')](_0x418a77[_0x641a('0x7d')],{'$or':_[_0x641a('0x3c')](_0x418a77[_0x641a('0x44')],function(_0x23e2c0){var _0x5657e3={};_0x5657e3[_0x23e2c0]={'$like':'%'+_0x390f9e[_0x641a('0x41')]['filter']+'%'};return _0x5657e3;})});}if(_0x390f9e[_0x641a('0x41')][_0x641a('0x81')]){var _0x57d0fe=_0x390f9e[_0x641a('0x41')][_0x641a('0x81')][_0x641a('0x31')](',');var _0x2e10f2={};_0x2e10f2[_0x57d0fe[0x0]]={'$gte':moment(_0x57d0fe[0x1])[_0x641a('0xc4')](_0x641a('0xc5'))};_0x418a77[_0x641a('0x7d')]=_[_0x641a('0xba')](_0x418a77[_0x641a('0x7d')],_0x2e10f2);}_0x418a77=_[_0x641a('0xba')]({},_0x418a77,_0x390f9e[_0x641a('0xbb')]);return db[_0x641a('0xc0')][_0x641a('0x23')]({'where':_0x418a77[_0x641a('0x7d')]})['then'](function(_0x1885d7){_0x28bbe6[_0x641a('0x23')]=_0x1885d7;if(_0x390f9e[_0x641a('0x41')][_0x641a('0xb8')]){_0x418a77[_0x641a('0xb9')]=[{'all':!![]}];}return db[_0x641a('0xc0')][_0x641a('0xc6')](_0x418a77);})[_0x641a('0x28')](function(_0x2ac8ba){_0x28bbe6[_0x641a('0xb6')]=_0x2ac8ba;return _0x28bbe6;});}})[_0x641a('0x28')](respondWithFilteredResult(_0x32c30b,_0x418a77))[_0x641a('0x33')](handleError(_0x32c30b,null));};exports['addTags']=function(_0xf229b4,_0xfdf0c3,_0x35d0be){return db['WhatsappInteraction'][_0x641a('0x64')]({'where':{'id':_0xf229b4['params']['id']}})['then'](handleEntityNotFound(_0xfdf0c3,null))[_0x641a('0x28')](function(_0x23454){if(_0x23454){return _0x23454[_0x641a('0xc7')](_0xf229b4['body'][_0x641a('0xc1')],_[_0x641a('0xc8')](_0xf229b4[_0x641a('0xbd')],[_0x641a('0xc1'),'id'])||{})[_0x641a('0xc9')](function(){return db[_0x641a('0x74')][_0x641a('0xc6')]({'attributes':['id',_0x641a('0x2d'),_0x641a('0xca')],'where':{'id':_0xf229b4[_0x641a('0xbd')]['ids']}});})['then'](function(_0x550cb2){socket['emit'](_0x641a('0xcb'),{'id':Number(_0xf229b4['params']['id']),'tags':_0x550cb2||[]});return{'id':Number(_0xf229b4[_0x641a('0xb7')]['id']),'tags':_0x550cb2||[]};});}})[_0x641a('0x28')](respondWithResult(_0xfdf0c3,null))[_0x641a('0x33')](handleError(_0xfdf0c3,null));};exports['removeTags']=function(_0x3c9de3,_0x27e705,_0x2f9372){return db['WhatsappInteraction'][_0x641a('0x64')]({'where':{'id':_0x3c9de3['params']['id']}})[_0x641a('0x28')](handleEntityNotFound(_0x27e705,null))[_0x641a('0x28')](function(_0x1a0a20){if(_0x1a0a20){return _0x1a0a20[_0x641a('0xcc')](_0x3c9de3[_0x641a('0x41')]['ids']);}})[_0x641a('0x28')](respondWithStatusCode(_0x27e705,null))[_0x641a('0x33')](handleError(_0x27e705,null));};exports[_0x641a('0xcd')]=function(_0x2fa1e9,_0x4b9ae5){var _0x4afc6a=moment()[_0x641a('0xce')]()['toString']();var _0x4912f2=path[_0x641a('0xcf')](config[_0x641a('0xd0')],_0x641a('0xd1'),_0x641a('0xd2'),_0x641a('0xd3'));var _0x3ae3c4=path[_0x641a('0xcf')](config['root'],_0x641a('0xd1'),_0x641a('0xd2'),_0x641a('0xd4'));var _0x5c79a1=path[_0x641a('0xcf')](_0x4912f2,_0x4afc6a);var _0x49598d=util[_0x641a('0xc4')](_0x641a('0xd5'),_0x2fa1e9[_0x641a('0xb7')]['id'],_0x4afc6a);var _0x226d52=path[_0x641a('0xcf')](_0x4912f2,_0x49598d);var _0x312e9a=[];_0x312e9a['push']({'model':db[_0x641a('0x77')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x312e9a['push']({'model':db[_0x641a('0xd6')],'as':_0x641a('0x6a'),'attributes':['id',_0x641a('0xd7'),_0x641a('0xd8')],'raw':!![]});if(_0x2fa1e9[_0x641a('0x41')][_0x641a('0xd4')]){_0x312e9a[_0x641a('0xb4')]({'model':db['Attachment'],'as':_0x641a('0xd9'),'raw':!![]});}var _0x42602c=[{'model':db['WhatsappMessage'],'as':_0x641a('0xda'),'attributes':['id',_0x641a('0xbd'),'createdAt',_0x641a('0xdb'),'secret',_0x641a('0x87')],'include':_0x312e9a}];_0x42602c['push']({'model':db[_0x641a('0xdc')],'as':'Account','attributes':['id','name']});_0x42602c[_0x641a('0xb4')]({'model':db['User'],'as':'Owner','attributes':['id',_0x641a('0x2e')]});return db[_0x641a('0xa3')][_0x641a('0x64')]({'where':{'id':_0x2fa1e9[_0x641a('0xb7')]['id']},'include':_0x42602c})[_0x641a('0x28')](handleEntityNotFound(_0x4b9ae5,null))[_0x641a('0x28')](function(_0x4e19de){if(_0x4e19de){var _0x5b5d41=_0x4e19de[_0x641a('0xdd')]({'plain':!![]});fs[_0x641a('0xde')](_0x5c79a1);var _0x4a6e7a={'channel':_0x641a('0xdf'),'account':_0x5b5d41[_0x641a('0xe0')][_0x641a('0x2d')],'agent':_0x5b5d41[_0x641a('0xe1')]?_0x5b5d41[_0x641a('0xe1')][_0x641a('0x2e')]:_0x641a('0xe2'),'createdAt':moment(_0x5b5d41[_0x641a('0x80')])[_0x641a('0xc4')](_0x641a('0xc5'))[_0x641a('0xa1')](),'closedAt':_0x5b5d41[_0x641a('0x37')]?moment(_0x5b5d41[_0x641a('0xe3')])[_0x641a('0xc4')](_0x641a('0xc5'))[_0x641a('0xa1')]():'','disposition':_0x5b5d41[_0x641a('0xe4')],'messages':_(_0x5b5d41[_0x641a('0xda')])[_0x641a('0x8c')]({'secret':![]})[_0x641a('0x3c')](function(_0x29ba58){if(_0x29ba58['Attachment']){var _0x41d874=path[_0x641a('0xcf')](_0x3ae3c4,_0x29ba58['Attachment'][_0x641a('0xe5')]);if(fs[_0x641a('0xe6')](_0x41d874)){fs['createReadStream'](_0x41d874)[_0x641a('0xe7')](fs[_0x641a('0xe8')](path[_0x641a('0xcf')](_0x5c79a1,_0x29ba58[_0x641a('0xd9')][_0x641a('0xe5')])));}}return{'date':moment(_0x29ba58[_0x641a('0x80')])[_0x641a('0xc4')](_0x641a('0xc5'))[_0x641a('0xa1')](),'sender':_0x29ba58[_0x641a('0xdb')]==='out'?_0x29ba58[_0x641a('0x77')]?_0x29ba58[_0x641a('0x77')][_0x641a('0x2e')]:_0x641a('0xe9'):_0x29ba58['Contact']['firstName']+(_0x29ba58['Contact']['lastName']?'\x20'+_0x29ba58[_0x641a('0x6a')]['lastName']:''),'body':_0x29ba58[_0x641a('0xd9')]?_0x29ba58[_0x641a('0xd9')][_0x641a('0xe5')]:_0x29ba58[_0x641a('0xbd')],'direction':_0x29ba58[_0x641a('0xdb')]==='out'?'A':'C','secret':_0x29ba58[_0x641a('0xea')],'read':_0x29ba58[_0x641a('0x87')],'attachment':_0x29ba58[_0x641a('0xd9')]};})[_0x641a('0x66')]()};return ejs[_0x641a('0xeb')](path[_0x641a('0xcf')](config[_0x641a('0xd0')],_0x641a('0xd1'),'views',_0x641a('0xec')),{'interaction':_0x4a6e7a})['then'](function(_0x41d8ff){var _0xfc97a7=path[_0x641a('0xcf')](_0x5c79a1,_0x641a('0xed')+_0x5b5d41['id']+'-'+_0x4afc6a+_0x641a('0xee'));var _0x33fe11={'path':_0xfc97a7,'channel':_0x641a('0xdf'),'interactionId':_0x5b5d41['id']};return pdf[_0x641a('0xef')](_0x41d8ff,_0x33fe11);})[_0x641a('0x28')](function(){return new BPromise(function(_0x27d713,_0x38a00a){zipdir(_0x5c79a1,{'saveTo':_0x226d52},function(_0xe1425e,_0x29f6b9){if(_0xe1425e)return _0x38a00a(_0xe1425e);return _0x27d713(_0x29f6b9);});})[_0x641a('0x28')](function(){return new BPromise(function(_0x4e3f40,_0x2a8ab8){rimraf(_0x5c79a1,function(_0x969e03){if(_0x969e03)_0x2a8ab8(_0x969e03);return _0x4e3f40();});});})[_0x641a('0x28')](function(){return _0x4b9ae5[_0x641a('0xcd')](_0x226d52,_0x49598d,function(_0x70272){if(_0x70272){console['log'](_0x641a('0xf0'),_0x70272);}else{fs[_0x641a('0xf1')](_0x226d52);}});});});}else{return _0x4b9ae5[_0x641a('0x1e')](0xc8);}})[_0x641a('0x33')](handleError(_0x4b9ae5,null));}; \ No newline at end of file +var _0x7ace=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','unmanaged','closed','UserId','answered','WhatsappInteraction','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','color','from','u.id','field','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','find','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','start','some','compact','isEmpty','WhatsappAccountId','concat','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','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','catch','show','params','rawAttributes','include','options','create','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','WhatsappInteractionId','format','includeAll','findAll','addTags','omit','spread','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','CmContact','firstName','lastName','Attachment','Messages','direction','secret','Account','get','mkdirSync','Whatsapp','Owner','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','existsSync','pipe','createWriteStream','basename','out','System','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7ace,0xd6));var _0xe7ac=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7ace[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0xe7ac('0x0'));var rimraf=require(_0xe7ac('0x1'));var zipdir=require(_0xe7ac('0x2'));var jsonpatch=require(_0xe7ac('0x3'));var rp=require(_0xe7ac('0x4'));var moment=require(_0xe7ac('0x5'));var BPromise=require(_0xe7ac('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe7ac('0x7'));var csv=require(_0xe7ac('0x8'));var ejs=require(_0xe7ac('0x9'));var fs=require('fs');var fs_extra=require(_0xe7ac('0xa'));var _=require(_0xe7ac('0xb'));var squel=require(_0xe7ac('0xc'));var crypto=require(_0xe7ac('0xd'));var jsforce=require(_0xe7ac('0xe'));var deskjs=require(_0xe7ac('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe7ac('0x10'));var Papa=require(_0xe7ac('0x11'));var Redis=require(_0xe7ac('0x12'));var authService=require(_0xe7ac('0x13'));var qs=require(_0xe7ac('0x14'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xe7ac('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe7ac('0x16'))(_0xe7ac('0x17'));var utils=require(_0xe7ac('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xe7ac('0x19'));var db=require(_0xe7ac('0x1a'))['db'];config[_0xe7ac('0x1b')]=_[_0xe7ac('0x1c')](config['redis'],{'host':_0xe7ac('0x1d'),'port':0x18eb});var socket=require(_0xe7ac('0x1e'))(new Redis(config['redis']));require(_0xe7ac('0x1f'))[_0xe7ac('0x20')](socket);function respondWithStatusCode(_0x3de7e3,_0x107c86){_0x107c86=_0x107c86||0xcc;return function(_0x36f687){if(_0x36f687){return _0x3de7e3['sendStatus'](_0x107c86);}return _0x3de7e3[_0xe7ac('0x21')](_0x107c86)[_0xe7ac('0x22')]();};}function respondWithResult(_0x3fd71e,_0x31c39c){_0x31c39c=_0x31c39c||0xc8;return function(_0x901569){if(_0x901569){return _0x3fd71e[_0xe7ac('0x21')](_0x31c39c)[_0xe7ac('0x23')](_0x901569);}};}function respondWithFilteredResult(_0x530a21,_0x3dc6e1){return function(_0x15eec3){if(_0x15eec3){var _0x32dacb=typeof _0x3dc6e1['offset']===_0xe7ac('0x24')&&typeof _0x3dc6e1[_0xe7ac('0x25')]==='undefined';var _0x4348c9=_0x15eec3[_0xe7ac('0x26')];var _0x1e7a4a=_0x32dacb?0x0:_0x3dc6e1[_0xe7ac('0x27')];var _0x553305=_0x32dacb?_0x15eec3['count']:_0x3dc6e1[_0xe7ac('0x27')]+_0x3dc6e1[_0xe7ac('0x25')];var _0x35db96;if(_0x553305>=_0x4348c9){_0x553305=_0x4348c9;_0x35db96=0xc8;}else{_0x35db96=0xce;}_0x530a21[_0xe7ac('0x21')](_0x35db96);return _0x530a21['set']('Content-Range',_0x1e7a4a+'-'+_0x553305+'/'+_0x4348c9)[_0xe7ac('0x23')](_0x15eec3);}return null;};}function patchUpdates(_0x5bd0c7){return function(_0x426033){try{jsonpatch[_0xe7ac('0x28')](_0x426033,_0x5bd0c7,!![]);}catch(_0x11aff6){return BPromise[_0xe7ac('0x29')](_0x11aff6);}return _0x426033[_0xe7ac('0x2a')]();};}function saveUpdates(_0x5e5d89,_0x2f9196){return function(_0x42d947){if(_0x42d947){return _0x42d947[_0xe7ac('0x2b')](_0x5e5d89)[_0xe7ac('0x2c')](function(_0x429742){return _0x429742;});}return null;};}function removeEntity(_0x453e90,_0x25d173){return function(_0x216904){if(_0x216904){return _0x216904[_0xe7ac('0x2d')]()['then'](function(){_0x453e90['status'](0xcc)[_0xe7ac('0x22')]();});}};}function handleEntityNotFound(_0x5b83e3,_0x4f2d5c){return function(_0x98a36){if(!_0x98a36){_0x5b83e3[_0xe7ac('0x2e')](0x194);}return _0x98a36;};}function handleError(_0x460ef6,_0xedaa83){_0xedaa83=_0xedaa83||0x1f4;return function(_0x29d8df){logger['error'](_0x29d8df[_0xe7ac('0x2f')]);if(_0x29d8df[_0xe7ac('0x30')]){delete _0x29d8df[_0xe7ac('0x30')];}_0x460ef6[_0xe7ac('0x21')](_0xedaa83)[_0xe7ac('0x31')](_0x29d8df);};}function getInteractionUsers(_0x3f2d06,_0x211d4f){return new BPromise(function(_0x4185c2,_0x584cda){try{if(_0x211d4f[_0x3f2d06['id']]){_0x3f2d06[_0xe7ac('0x32')]=_[_0xe7ac('0x33')](_0x211d4f[_0x3f2d06['id']],function(_0x49e458){return{'id':_0x49e458['id'],'fullname':_0x49e458[_0xe7ac('0x34')]};});}}catch(_0x2c3fcd){_0x584cda(_0x2c3fcd);}_0x4185c2(_0x3f2d06);});}function getInteractionTags(_0x5eafc0,_0x234f39){return new BPromise(function(_0x152ac8,_0xbeed69){try{if(_0x5eafc0[_0xe7ac('0x35')]){_0x5eafc0[_0xe7ac('0x36')]=[];_0x5eafc0[_0xe7ac('0x35')][_0xe7ac('0x37')](',')[_0xe7ac('0x38')](function(_0x5e3402){_0x5eafc0['Tags'][_0xe7ac('0x39')](_0x234f39[_0x5e3402]);});}delete _0x5eafc0[_0xe7ac('0x35')];}catch(_0x431f25){_0xbeed69(_0x431f25);}_0x152ac8(_0x5eafc0);});}function updateWhatsappInteraction(_0x366fda,_0x149b10,_0x58b079){return new BPromise(function(_0x5b82f5,_0x4c491c){return getInteractionUsers(_0x366fda,_0x58b079)[_0xe7ac('0x2c')](function(_0x49cbe3){return getInteractionTags(_0x49cbe3,_0x149b10);})[_0xe7ac('0x2c')](function(_0xe02f62){return getStateInteraction(_0xe02f62);})[_0xe7ac('0x2c')](function(_0x11b912){_0x5b82f5(_0x11b912);})['catch'](function(_0x377d30){_0x4c491c(_0x377d30);});});}function getStateInteraction(_0x4cee75){return new BPromise(function(_0x1d1183,_0x2b8fa8){_0x4cee75[_0xe7ac('0x3a')]=0x0;_0x4cee75[_0xe7ac('0x3b')]=0x0;_0x4cee75['answered']=0x0;_0x4cee75[_0xe7ac('0x3c')]=0x0;_0x4cee75['total']=0x0;if(!_0x4cee75[_0xe7ac('0x3d')]&&!_0x4cee75[_0xe7ac('0x3e')])_0x4cee75[_0xe7ac('0x3a')]+=0x1;if(!_0x4cee75[_0xe7ac('0x3d')]&&_0x4cee75[_0xe7ac('0x3e')])_0x4cee75[_0xe7ac('0x3b')]+=0x1;if(_0x4cee75['closed']&&_0x4cee75['UserId'])_0x4cee75[_0xe7ac('0x3f')]+=0x1;if(_0x4cee75[_0xe7ac('0x3d')]&&!_0x4cee75[_0xe7ac('0x3e')])_0x4cee75[_0xe7ac('0x3c')]+=0x1;_0x4cee75['total']+=0x1;_0x1d1183(_0x4cee75);});}exports['index']=function(_0x59e1b7,_0x2ca55b){var _0x694087={},_0x1133de={},_0x58926c={'count':0x0,'rows':[]};var _0x2350a3=_['map'](db[_0xe7ac('0x40')]['rawAttributes'],function(_0x1db180){return{'name':_0x1db180[_0xe7ac('0x41')],'type':_0x1db180[_0xe7ac('0x42')][_0xe7ac('0x43')]};});_0x1133de[_0xe7ac('0x44')]=_['map'](_0x2350a3,_0xe7ac('0x30'));_0x1133de['query']=_[_0xe7ac('0x45')](_0x59e1b7[_0xe7ac('0x46')]);_0x1133de[_0xe7ac('0x47')]=_['intersection'](_0x1133de[_0xe7ac('0x44')],_0x1133de[_0xe7ac('0x46')]);_0x694087['attributes']=_[_0xe7ac('0x48')](_0x1133de['model'],qs[_0xe7ac('0x49')](_0x59e1b7[_0xe7ac('0x46')]['fields']));_0x694087[_0xe7ac('0x4a')]=_0x694087['attributes'][_0xe7ac('0x4b')]?_0x694087[_0xe7ac('0x4a')]:_0x1133de[_0xe7ac('0x44')];if(!_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x4c')](_0xe7ac('0x4d'))){_0x694087['limit']=qs[_0xe7ac('0x25')](_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x25')]);_0x694087[_0xe7ac('0x27')]=qs[_0xe7ac('0x27')](_0x59e1b7['query'][_0xe7ac('0x27')]);}_0x694087[_0xe7ac('0x4e')]=qs[_0xe7ac('0x4f')](_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x4f')]);_0x694087[_0xe7ac('0x50')]=qs[_0xe7ac('0x47')](_[_0xe7ac('0x51')](_0x59e1b7['query'],_0x1133de[_0xe7ac('0x47')]),_0x2350a3);var _0xac6b36=[];var _0x3a5330=squel['select']()['field']('id')['field']('name')['field'](_0xe7ac('0x52'))[_0xe7ac('0x53')]('tools_tags');var _0x381426=squel['select']()['field'](_0xe7ac('0x54'))[_0xe7ac('0x55')](_0xe7ac('0x56'))[_0xe7ac('0x55')](_0xe7ac('0x57'))[_0xe7ac('0x53')](_0xe7ac('0x58'),'ui')[_0xe7ac('0x59')](_0xe7ac('0x5a'),'u',_0xe7ac('0x5b'));var _0x4fe110=squel[_0xe7ac('0x5c')]()[_0xe7ac('0x53')](_0xe7ac('0x5d'),'i')['left_join']('cm_contacts','c',_0xe7ac('0x5e'))[_0xe7ac('0x59')]('users','o',_0xe7ac('0x5f'))[_0xe7ac('0x59')](_0xe7ac('0x60'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xe7ac('0x59')](_0xe7ac('0x61'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xe7ac('0x59')]('whatsapp_interaction_has_tags','it',_0xe7ac('0x62'))[_0xe7ac('0x59')](_0xe7ac('0x63'),'t',_0xe7ac('0x64'));var _0x49306e=squel[_0xe7ac('0x65')]();var _0x579dda=[];var _0x3a1fce=squel[_0xe7ac('0x65')]();var _0x4596fe;if(_0x59e1b7[_0xe7ac('0x46')]['search']){_0x4596fe=as[_0xe7ac('0x66')](_0x59e1b7['query'][_0xe7ac('0x67')]);var _0x54b0a0=_0x4596fe[_0xe7ac('0x68')];for(var _0x1b41e1=0x0;_0x1b41e1<_0x4596fe[_0xe7ac('0x69')][_0xe7ac('0x4b')];_0x1b41e1++){var _0x6ad1a0=_0x4596fe[_0xe7ac('0x69')][_0x1b41e1];var _0x2fe0a1='i';var _0x4f4d5b=_['find'](_0x2350a3,[_0xe7ac('0x30'),_0x6ad1a0[_0xe7ac('0x55')]]);if(!_0x4f4d5b){switch(_0x6ad1a0[_0xe7ac('0x55')]){case _0xe7ac('0x6a'):if(_0x6ad1a0[_0xe7ac('0x6b')]==0x1){_0x4fe110[_0xe7ac('0x6c')]('`'+_0x6ad1a0[_0xe7ac('0x55')]+_0xe7ac('0x6d'));}else{_0x4fe110['having']('`'+_0x6ad1a0['field']+_0xe7ac('0x6e'));}break;case _0xe7ac('0x6f'):if(_0x6ad1a0[_0xe7ac('0x70')]===_0xe7ac('0x71')){if(_0x6ad1a0['value'][_0xe7ac('0x37')]('\x20')['length']>0x1){_0x49306e[_0x54b0a0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x6ad1a0[_0xe7ac('0x6b')]),null);}else{var _0x867e9e='%'+_0x6ad1a0[_0xe7ac('0x6b')]+'%';_0x49306e[_0x54b0a0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x867e9e,_0x867e9e,_0x867e9e);}}else{_0x4f4d5b=_[_0xe7ac('0x72')](_0x2350a3,[_0xe7ac('0x30'),_0xe7ac('0x73')]);_0x6ad1a0['field']=_0xe7ac('0x73');_0x111dee=as[_0xe7ac('0x74')](_0x2fe0a1,_0x4f4d5b[_0xe7ac('0x42')],_0x6ad1a0);_0x49306e[_0x54b0a0](_0x111dee['text'],_0x111dee[_0xe7ac('0x6b')]['start'],_0x111dee[_0xe7ac('0x6b')][_0xe7ac('0x22')]);}break;case _0xe7ac('0x75'):var _0x204cea=_0x6ad1a0[_0xe7ac('0x6b')][_0xe7ac('0x37')](',')[_0xe7ac('0x33')](function(_0xe94503){return Number(_0xe94503);});_0x204cea[_0xe7ac('0x38')](function(_0x300e40){_0x3a1fce['or'](_0xe7ac('0x76'),'%,'+_0x300e40+',%');});_0x579dda=_['union'](_0x579dda,_0x204cea);break;case _0xe7ac('0x77'):if(_0x6ad1a0[_0xe7ac('0x70')]==='$substring'){_0x49306e[_0x54b0a0](_0xe7ac('0x78'),'%'+_0x6ad1a0[_0xe7ac('0x6b')]+'%',null);}else{_0x4f4d5b=_[_0xe7ac('0x72')](_0x2350a3,[_0xe7ac('0x30'),_0xe7ac('0x3e')]);_0x6ad1a0[_0xe7ac('0x55')]='UserId';_0x111dee=as[_0xe7ac('0x74')](_0x2fe0a1,_0x4f4d5b['type'],_0x6ad1a0);_0x49306e[_0x54b0a0](_0x111dee[_0xe7ac('0x79')],_0x111dee[_0xe7ac('0x6b')]['start'],_0x111dee[_0xe7ac('0x6b')]['end']);}break;case _0xe7ac('0x7a'):_0x111dee=as[_0xe7ac('0x74')]('me',null,_0x6ad1a0);_0x49306e[_0x54b0a0](_0x111dee[_0xe7ac('0x79')],_0x111dee[_0xe7ac('0x6b')][_0xe7ac('0x7b')],_0x111dee[_0xe7ac('0x6b')][_0xe7ac('0x22')]);break;}}else{var _0x111dee=as[_0xe7ac('0x74')](_0x2fe0a1,_0x4f4d5b['type'],_0x6ad1a0);_0x49306e[_0x54b0a0](_0x111dee[_0xe7ac('0x79')],_0x111dee[_0xe7ac('0x6b')]['start'],_0x111dee[_0xe7ac('0x6b')][_0xe7ac('0x22')]);}}}else{var _0x334e36=_(_0x59e1b7['query'])['keys']()['map'](function(_0x28af44){return _[_0xe7ac('0x7c')](_0x2350a3,[_0xe7ac('0x30'),_0x28af44])?_0x28af44:undefined;})[_0xe7ac('0x7d')]()[_0xe7ac('0x6b')]();if(!_[_0xe7ac('0x7e')](_0x334e36)){_0x334e36[_0xe7ac('0x38')](function(_0x5600ac){if(_0x5600ac===_0xe7ac('0x7f')){_0x4fe110['where']('i.WhatsappAccountId\x20IN\x20?',[][_0xe7ac('0x80')](_0x59e1b7['query'][_0x5600ac]));}else if(_0x5600ac==='createdAt'){var _0x558901=JSON[_0xe7ac('0x81')](_0x59e1b7['query'][_0x5600ac])[_0xe7ac('0x82')];var _0x2a3915=JSON['parse'](_0x59e1b7[_0xe7ac('0x46')][_0x5600ac])[_0xe7ac('0x83')];_0x4fe110[_0xe7ac('0x50')](_0xe7ac('0x84'),_0x558901,_0x2a3915);}else{if(_0x59e1b7[_0xe7ac('0x46')][_0x5600ac]===_0xe7ac('0x85')){_0x4fe110[_0xe7ac('0x50')]('i.'+_0x5600ac+_0xe7ac('0x86'));}else{_0x4fe110['where']('i.'+_0x5600ac+_0xe7ac('0x87'),_0x59e1b7[_0xe7ac('0x46')][_0x5600ac]);}}});}if(_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x88')]){if(_0x59e1b7[_0xe7ac('0x46')]['read']==0x1){_0x4fe110['having'](_0xe7ac('0x89'));}else{_0x4fe110[_0xe7ac('0x6c')](_0xe7ac('0x8a'));}}if(_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x8b')]){_0x579dda=_[_0xe7ac('0x8c')](_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x8b')])?_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x8b')]:new Array(_0x59e1b7['query'][_0xe7ac('0x8b')]);_0x579dda[_0xe7ac('0x38')](function(_0xabfb71){_0x3a1fce['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xabfb71+',%');});}if(_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x8d')]){var _0x39af6a=_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x8d')][_0xe7ac('0x8e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe7ac('0x8f')](_0x39af6a)){_0x49306e['or']('i.id\x20LIKE\x20?',_0x39af6a+'%')['or'](_0xe7ac('0x90'),_0x39af6a+'%');}else{_0x49306e['or'](_0xe7ac('0x91'),qs[_0xe7ac('0x92')](_0x39af6a))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x39af6a+'%');}}}_0x4fe110['where'](_0x49306e);_0x4fe110[_0xe7ac('0x93')](_0xe7ac('0x94'));var _0x2acf14={'type':db['Sequelize']['QueryTypes'][_0xe7ac('0x95')],'raw':!![]};var _0x3f42cf=_0x4fe110['clone']();_0x3f42cf[_0xe7ac('0x55')](_0xe7ac('0x94'));_0x3f42cf[_0xe7ac('0x55')](_0xe7ac('0x96'),_0xe7ac('0x6a'));if(_0x694087[_0xe7ac('0x4e')]){_0x694087[_0xe7ac('0x4e')][_0xe7ac('0x38')](function(_0x43ac6c){var _0x1ce79f=_0x43ac6c[0x0]===_0xe7ac('0x97')?_0x43ac6c[0x0]:'i.'+_0x43ac6c[0x0];_0x4fe110[_0xe7ac('0x4e')](_0x1ce79f,_0x43ac6c[0x1]===_0xe7ac('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x579dda)){_0x4fe110[_0xe7ac('0x6c')](_0x3a1fce);_0x3f42cf[_0xe7ac('0x50')]('t.id\x20IN\x20?',_0x579dda);}BPromise[_0xe7ac('0x99')]()['then'](function(){if(!_0x4596fe){if(_0x59e1b7['query']['WhatsappAccountId'])return;_0x3f42cf[_0xe7ac('0x50')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x4fe110['where'](_0xe7ac('0x9a'));return;}if(_0x59e1b7['user'][_0xe7ac('0x9b')]!==_0xe7ac('0x9c'))return;return _0x59e1b7[_0xe7ac('0x9d')][_0xe7ac('0x9e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x64e47a){if(_[_0xe7ac('0x7e')](_0x64e47a)){_0x3f42cf[_0xe7ac('0x50')](_0xe7ac('0x9f'));_0x4fe110[_0xe7ac('0x50')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3f42cf[_0xe7ac('0x50')](_0xe7ac('0xa0'),_[_0xe7ac('0x33')](_0x64e47a,'id'));_0x4fe110['where'](_0xe7ac('0xa0'),_['map'](_0x64e47a,'id'));}});})['then'](function(){if(_0x59e1b7['user']['role']===_0xe7ac('0x9c')&&!_0x4596fe&&!_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x7f')])return[];return db[_0xe7ac('0xa1')][_0xe7ac('0x46')](_0x3f42cf[_0xe7ac('0xa2')](),_0x2acf14);})['then'](function(_0x14bc73){_0x58926c[_0xe7ac('0x26')]=_0x14bc73[_0xe7ac('0x4b')];if(_0x58926c[_0xe7ac('0x26')]===0x0)return[];return db[_0xe7ac('0xa1')][_0xe7ac('0x46')](_0x3a5330['toString'](),_0x2acf14)['then'](function(_0x5bc8ab){_0xac6b36=_['keyBy'](_0x5bc8ab,'id');_0x2acf14=_[_0xe7ac('0xa3')](_0x2acf14,{'model':db[_0xe7ac('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x59e1b7[_0xe7ac('0x46')][_0xe7ac('0x49')]){_0x694087[_0xe7ac('0x4a')]['forEach'](function(_0x2a2851){_0x4fe110[_0xe7ac('0x55')]('i.'+_0x2a2851);});}else{_0x4fe110[_0xe7ac('0x55')](_0xe7ac('0x96'),_0xe7ac('0x6a'));_0x4fe110[_0xe7ac('0x55')](_0xe7ac('0xa4'),_0xe7ac('0xa5'));_0x4fe110[_0xe7ac('0x55')](_0xe7ac('0xa6'),_0xe7ac('0xa7'));_0x4fe110['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4fe110['field'](_0xe7ac('0xa8'));_0x4fe110['field']('c.firstName',_0xe7ac('0xa9'));_0x4fe110['field'](_0xe7ac('0xaa'),_0xe7ac('0xab'));_0x4fe110['field']('c.email','Contact.email');_0x4fe110['field'](_0xe7ac('0xac'),_0xe7ac('0xad'));_0x4fe110['field']('c.mobile',_0xe7ac('0xae'));_0x4fe110[_0xe7ac('0x55')]('c.fax','Contact.fax');_0x4fe110[_0xe7ac('0x55')]('o.fullname','Owner.fullname');_0x4fe110[_0xe7ac('0x55')](_0xe7ac('0xaf'),_0xe7ac('0xb0'));_0x4fe110[_0xe7ac('0x55')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x694087[_0xe7ac('0x25')])_0x4fe110[_0xe7ac('0x25')](_0x694087[_0xe7ac('0x25')]);if(_0x694087[_0xe7ac('0x27')])_0x4fe110[_0xe7ac('0x27')](_0x694087[_0xe7ac('0x27')]);return db[_0xe7ac('0xa1')][_0xe7ac('0x46')](_0x4fe110[_0xe7ac('0xa2')](),_0x2acf14);})[_0xe7ac('0x2c')](function(_0x1eef5b){if(_0x1eef5b['length']>0x0)_0x381426[_0xe7ac('0x50')](_0xe7ac('0xb1'),_[_0xe7ac('0x33')](_0x1eef5b,'id'));return db[_0xe7ac('0xa1')][_0xe7ac('0x46')](_0x381426[_0xe7ac('0xa2')](),_0x2acf14)[_0xe7ac('0x2c')](function(_0x271381){var _0x5ad415=_[_0xe7ac('0xb2')](_0x271381,'WhatsappInteractionId');var _0x5be978=[];_0x1eef5b[_0xe7ac('0x38')](function(_0x118eeb){_0x5be978['push'](updateWhatsappInteraction(_0x118eeb,_0xac6b36,_0x5ad415));});return BPromise[_0xe7ac('0xb3')](_0x5be978);});});})[_0xe7ac('0x2c')](function(_0x4d8ab9){_0x58926c[_0xe7ac('0xb4')]=_0x4d8ab9;return _0x58926c;})[_0xe7ac('0x2c')](respondWithFilteredResult(_0x2ca55b,_0x694087))[_0xe7ac('0xb5')](handleError(_0x2ca55b,null));};exports[_0xe7ac('0xb6')]=function(_0x11d25c,_0x582c27){var _0x52d451={'raw':![],'where':{'id':_0x11d25c[_0xe7ac('0xb7')]['id']}},_0x2cb24c={};_0x2cb24c[_0xe7ac('0x44')]=_[_0xe7ac('0x45')](db[_0xe7ac('0x40')][_0xe7ac('0xb8')]);_0x2cb24c[_0xe7ac('0x46')]=_['keys'](_0x11d25c['query']);_0x2cb24c[_0xe7ac('0x47')]=_['intersection'](_0x2cb24c[_0xe7ac('0x44')],_0x2cb24c['query']);_0x52d451['attributes']=_[_0xe7ac('0x48')](_0x2cb24c[_0xe7ac('0x44')],qs[_0xe7ac('0x49')](_0x11d25c['query'][_0xe7ac('0x49')]));_0x52d451['attributes']=_0x52d451[_0xe7ac('0x4a')][_0xe7ac('0x4b')]?_0x52d451[_0xe7ac('0x4a')]:_0x2cb24c['model'];if(_0x11d25c[_0xe7ac('0x46')]['includeAll']){_0x52d451[_0xe7ac('0xb9')]=[{'all':!![]}];}_0x52d451=_[_0xe7ac('0xa3')]({},_0x52d451,_0x11d25c[_0xe7ac('0xba')]);return db[_0xe7ac('0x40')][_0xe7ac('0x72')](_0x52d451)['then'](handleEntityNotFound(_0x582c27,null))[_0xe7ac('0x2c')](respondWithResult(_0x582c27,null))[_0xe7ac('0xb5')](handleError(_0x582c27,null));};exports[_0xe7ac('0xbb')]=function(_0x330aaf,_0xc34e1b){return db[_0xe7ac('0x40')]['create'](_0x330aaf[_0xe7ac('0x7a')],{})[_0xe7ac('0x2c')](respondWithResult(_0xc34e1b,0xc9))[_0xe7ac('0xb5')](handleError(_0xc34e1b,null));};exports[_0xe7ac('0x2b')]=function(_0x5acebb,_0x33be77){if(_0x5acebb[_0xe7ac('0x7a')]['id']){delete _0x5acebb['body']['id'];}return db[_0xe7ac('0x40')][_0xe7ac('0x72')]({'where':{'id':_0x5acebb['params']['id']}})[_0xe7ac('0x2c')](handleEntityNotFound(_0x33be77,null))[_0xe7ac('0x2c')](saveUpdates(_0x5acebb['body'],null))[_0xe7ac('0x2c')](respondWithResult(_0x33be77,null))['catch'](handleError(_0x33be77,null));};exports['destroy']=function(_0x4fcbbd,_0x4f4136){return db[_0xe7ac('0x40')]['find']({'where':{'id':_0x4fcbbd[_0xe7ac('0xb7')]['id']}})[_0xe7ac('0x2c')](handleEntityNotFound(_0x4f4136,null))['then'](removeEntity(_0x4f4136,null))[_0xe7ac('0xb5')](handleError(_0x4f4136,null));};exports['describe']=function(_0x2880d7,_0x2190cf){return db[_0xe7ac('0x40')][_0xe7ac('0xbc')]()[_0xe7ac('0x2c')](respondWithResult(_0x2190cf,null))[_0xe7ac('0xb5')](handleError(_0x2190cf,null));};exports[_0xe7ac('0xbd')]=function(_0x2dd0fa,_0x3b5e73,_0x86e7bb){return db['WhatsappMessage'][_0xe7ac('0x72')]({'where':{'id':_0x2dd0fa[_0xe7ac('0xb7')]['id']}})[_0xe7ac('0x2c')](handleEntityNotFound(_0x3b5e73,null))[_0xe7ac('0x2c')](function(_0x4b6a73){if(_0x4b6a73){return _0x4b6a73['addMessage'](_0x2dd0fa[_0xe7ac('0x7a')][_0xe7ac('0xbe')],_['omit'](_0x2dd0fa['body'],[_0xe7ac('0xbe'),'id'])||{});}})[_0xe7ac('0x2c')](respondWithResult(_0x3b5e73,null))[_0xe7ac('0xb5')](handleError(_0x3b5e73,null));};exports[_0xe7ac('0xbf')]=function(_0x4567ef,_0x561bc6,_0x4b7a8f){var _0x2acaa8={'raw':![],'where':{}};var _0x2c48e3={};var _0x42e115={'count':0x0,'rows':[]};return db[_0xe7ac('0x40')][_0xe7ac('0xc0')]({'where':{'id':_0x4567ef[_0xe7ac('0xb7')]['id']}})['then'](handleEntityNotFound(_0x561bc6,null))[_0xe7ac('0x2c')](function(_0x25e88d){if(_0x25e88d){_0x2c48e3[_0xe7ac('0x44')]=_[_0xe7ac('0x45')](db[_0xe7ac('0xc1')][_0xe7ac('0xb8')]);_0x2c48e3[_0xe7ac('0x46')]=_[_0xe7ac('0x45')](_0x4567ef[_0xe7ac('0x46')]);_0x2c48e3[_0xe7ac('0x47')]=_[_0xe7ac('0x48')](_0x2c48e3[_0xe7ac('0x44')],_0x2c48e3[_0xe7ac('0x46')]);_0x2acaa8[_0xe7ac('0x4a')]=_[_0xe7ac('0x48')](_0x2c48e3[_0xe7ac('0x44')],qs[_0xe7ac('0x49')](_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x49')]));_0x2acaa8['attributes']=_0x2acaa8['attributes'][_0xe7ac('0x4b')]?_0x2acaa8['attributes']:_0x2c48e3[_0xe7ac('0x44')];if(!_0x4567ef['query'][_0xe7ac('0x4c')](_0xe7ac('0x4d'))){_0x2acaa8['limit']=qs['limit'](_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x25')]);_0x2acaa8[_0xe7ac('0x27')]=qs['offset'](_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x27')]);}_0x2acaa8[_0xe7ac('0x4e')]=qs[_0xe7ac('0x4f')](_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x4f')]);_0x2acaa8['where']=qs['filters'](_[_0xe7ac('0x51')](_0x4567ef[_0xe7ac('0x46')],_0x2c48e3[_0xe7ac('0x47')]));_0x2acaa8['where'][_0xe7ac('0xc2')]=_0x25e88d['id'];if(_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x8d')]){_0x2acaa8['where']=_[_0xe7ac('0xa3')](_0x2acaa8[_0xe7ac('0x50')],{'$or':_[_0xe7ac('0x33')](_0x2acaa8['attributes'],function(_0x2b5494){var _0x1b3e04={};_0x1b3e04[_0x2b5494]={'$like':'%'+_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x8d')]+'%'};return _0x1b3e04;})});}if(_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0x82')]){var _0x1cff96=_0x4567ef[_0xe7ac('0x46')]['$gte'][_0xe7ac('0x37')](',');var _0xb2718a={};_0xb2718a[_0x1cff96[0x0]]={'$gte':moment(_0x1cff96[0x1])[_0xe7ac('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2acaa8[_0xe7ac('0x50')]=_[_0xe7ac('0xa3')](_0x2acaa8[_0xe7ac('0x50')],_0xb2718a);}_0x2acaa8=_[_0xe7ac('0xa3')]({},_0x2acaa8,_0x4567ef['options']);return db[_0xe7ac('0xc1')][_0xe7ac('0x26')]({'where':_0x2acaa8[_0xe7ac('0x50')]})[_0xe7ac('0x2c')](function(_0x1d2a29){_0x42e115['count']=_0x1d2a29;if(_0x4567ef[_0xe7ac('0x46')][_0xe7ac('0xc4')]){_0x2acaa8[_0xe7ac('0xb9')]=[{'all':!![]}];}return db[_0xe7ac('0xc1')][_0xe7ac('0xc5')](_0x2acaa8);})['then'](function(_0x482383){_0x42e115[_0xe7ac('0xb4')]=_0x482383;return _0x42e115;});}})['then'](respondWithFilteredResult(_0x561bc6,_0x2acaa8))[_0xe7ac('0xb5')](handleError(_0x561bc6,null));};exports[_0xe7ac('0xc6')]=function(_0x2b4f4d,_0x52cc10,_0x3d6089){return db[_0xe7ac('0x40')][_0xe7ac('0x72')]({'where':{'id':_0x2b4f4d[_0xe7ac('0xb7')]['id']}})[_0xe7ac('0x2c')](handleEntityNotFound(_0x52cc10,null))[_0xe7ac('0x2c')](function(_0x38c7e8){if(_0x38c7e8){return _0x38c7e8['setTags'](_0x2b4f4d[_0xe7ac('0x7a')][_0xe7ac('0xbe')],_[_0xe7ac('0xc7')](_0x2b4f4d[_0xe7ac('0x7a')],['ids','id'])||{})[_0xe7ac('0xc8')](function(){return db['Tag'][_0xe7ac('0xc5')]({'attributes':['id',_0xe7ac('0x30'),'color'],'where':{'id':_0x2b4f4d['body'][_0xe7ac('0xbe')]}});})[_0xe7ac('0x2c')](function(_0x2338aa){socket['emit'](_0xe7ac('0xc9'),{'id':Number(_0x2b4f4d[_0xe7ac('0xb7')]['id']),'tags':_0x2338aa||[]});return{'id':Number(_0x2b4f4d[_0xe7ac('0xb7')]['id']),'tags':_0x2338aa||[]};});}})[_0xe7ac('0x2c')](respondWithResult(_0x52cc10,null))['catch'](handleError(_0x52cc10,null));};exports[_0xe7ac('0xca')]=function(_0x4d9695,_0x41e827,_0xfb030){return db[_0xe7ac('0x40')][_0xe7ac('0x72')]({'where':{'id':_0x4d9695['params']['id']}})[_0xe7ac('0x2c')](handleEntityNotFound(_0x41e827,null))[_0xe7ac('0x2c')](function(_0xa43b54){if(_0xa43b54){return _0xa43b54[_0xe7ac('0xca')](_0x4d9695[_0xe7ac('0x46')][_0xe7ac('0xbe')]);}})[_0xe7ac('0x2c')](respondWithStatusCode(_0x41e827,null))[_0xe7ac('0xb5')](handleError(_0x41e827,null));};exports[_0xe7ac('0xcb')]=function(_0x258800,_0x287136){var _0x3646d3=moment()['unix']()[_0xe7ac('0xa2')]();var _0x4af59c=path['join'](config[_0xe7ac('0xcc')],_0xe7ac('0xcd'),_0xe7ac('0xce'),_0xe7ac('0xcf'));var _0x15097a=path[_0xe7ac('0xd0')](config[_0xe7ac('0xcc')],'server',_0xe7ac('0xce'),'attachments');var _0x54cb20=path[_0xe7ac('0xd0')](_0x4af59c,_0x3646d3);var _0x3a78b5=util[_0xe7ac('0xc3')]('transcript-%d-%s.zip',_0x258800[_0xe7ac('0xb7')]['id'],_0x3646d3);var _0x2090cd=path[_0xe7ac('0xd0')](_0x4af59c,_0x3a78b5);var _0x4cb05f=[];_0x4cb05f[_0xe7ac('0x39')]({'model':db[_0xe7ac('0x77')],'as':_0xe7ac('0x77'),'attributes':['id',_0xe7ac('0x34')],'raw':!![]});_0x4cb05f[_0xe7ac('0x39')]({'model':db[_0xe7ac('0xd1')],'as':_0xe7ac('0x6f'),'attributes':['id',_0xe7ac('0xd2'),_0xe7ac('0xd3')],'raw':!![]});if(_0x258800[_0xe7ac('0x46')]['attachments']){_0x4cb05f[_0xe7ac('0x39')]({'model':db[_0xe7ac('0xd4')],'as':_0xe7ac('0xd4'),'raw':!![]});}var _0x56d48f=[{'model':db[_0xe7ac('0xc1')],'as':_0xe7ac('0xd5'),'attributes':['id',_0xe7ac('0x7a'),'createdAt',_0xe7ac('0xd6'),_0xe7ac('0xd7'),_0xe7ac('0x88')],'include':_0x4cb05f}];_0x56d48f[_0xe7ac('0x39')]({'model':db['WhatsappAccount'],'as':_0xe7ac('0xd8'),'attributes':['id','name']});_0x56d48f[_0xe7ac('0x39')]({'model':db['User'],'as':'Owner','attributes':['id',_0xe7ac('0x34')]});return db[_0xe7ac('0x40')]['find']({'where':{'id':_0x258800[_0xe7ac('0xb7')]['id']},'include':_0x56d48f})[_0xe7ac('0x2c')](handleEntityNotFound(_0x287136,null))['then'](function(_0x28d7d0){if(_0x28d7d0){var _0x5b9810=_0x28d7d0[_0xe7ac('0xd9')]({'plain':!![]});fs[_0xe7ac('0xda')](_0x54cb20);var _0x55d2e4={'channel':_0xe7ac('0xdb'),'account':_0x5b9810[_0xe7ac('0xd8')][_0xe7ac('0x30')],'agent':_0x5b9810[_0xe7ac('0xdc')]?_0x5b9810['Owner'][_0xe7ac('0x34')]:_0xe7ac('0xdd'),'createdAt':moment(_0x5b9810[_0xe7ac('0xde')])[_0xe7ac('0xc3')](_0xe7ac('0xdf'))[_0xe7ac('0xa2')](),'closedAt':_0x5b9810[_0xe7ac('0x3d')]?moment(_0x5b9810[_0xe7ac('0xe0')])[_0xe7ac('0xc3')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe7ac('0xa2')]():'','disposition':_0x5b9810['disposition'],'messages':_(_0x5b9810[_0xe7ac('0xd5')])[_0xe7ac('0x8d')]({'secret':![]})[_0xe7ac('0x33')](function(_0x26e2aa){if(_0x26e2aa[_0xe7ac('0xd4')]){var _0x4ee4c5=path[_0xe7ac('0xd0')](_0x15097a,_0x26e2aa[_0xe7ac('0xd4')]['basename']);if(fs[_0xe7ac('0xe1')](_0x4ee4c5)){fs['createReadStream'](_0x4ee4c5)[_0xe7ac('0xe2')](fs[_0xe7ac('0xe3')](path[_0xe7ac('0xd0')](_0x54cb20,_0x26e2aa[_0xe7ac('0xd4')][_0xe7ac('0xe4')])));}}return{'date':moment(_0x26e2aa[_0xe7ac('0xde')])[_0xe7ac('0xc3')](_0xe7ac('0xdf'))[_0xe7ac('0xa2')](),'sender':_0x26e2aa[_0xe7ac('0xd6')]===_0xe7ac('0xe5')?_0x26e2aa['User']?_0x26e2aa['User']['fullname']:_0xe7ac('0xe6'):_0x26e2aa[_0xe7ac('0x6f')]['firstName']+(_0x26e2aa[_0xe7ac('0x6f')][_0xe7ac('0xd3')]?'\x20'+_0x26e2aa[_0xe7ac('0x6f')][_0xe7ac('0xd3')]:''),'body':_0x26e2aa[_0xe7ac('0xd4')]?_0x26e2aa[_0xe7ac('0xd4')]['basename']:_0x26e2aa[_0xe7ac('0x7a')],'direction':_0x26e2aa['direction']===_0xe7ac('0xe5')?'A':'C','secret':_0x26e2aa[_0xe7ac('0xd7')],'read':_0x26e2aa[_0xe7ac('0x88')],'attachment':_0x26e2aa[_0xe7ac('0xd4')]};})[_0xe7ac('0x6b')]()};return ejs['renderFile'](path[_0xe7ac('0xd0')](config[_0xe7ac('0xcc')],'server',_0xe7ac('0xe7'),_0xe7ac('0xe8')),{'interaction':_0x55d2e4})[_0xe7ac('0x2c')](function(_0x51104a){var _0x49c894=path[_0xe7ac('0xd0')](_0x54cb20,_0xe7ac('0xe9')+_0x5b9810['id']+'-'+_0x3646d3+_0xe7ac('0xea'));var _0x139c23={'path':_0x49c894,'channel':_0xe7ac('0xdb'),'interactionId':_0x5b9810['id']};return pdf['createPdfFromHTML'](_0x51104a,_0x139c23);})[_0xe7ac('0x2c')](function(){return new BPromise(function(_0x3fd2ee,_0x346470){zipdir(_0x54cb20,{'saveTo':_0x2090cd},function(_0x3be7df,_0x4a0a7c){if(_0x3be7df)return _0x346470(_0x3be7df);return _0x3fd2ee(_0x4a0a7c);});})['then'](function(){return new BPromise(function(_0x3038e0,_0x2d31ef){rimraf(_0x54cb20,function(_0x5c2e7a){if(_0x5c2e7a)_0x2d31ef(_0x5c2e7a);return _0x3038e0();});});})['then'](function(){return _0x287136['download'](_0x2090cd,_0x3a78b5,function(_0x52671e){if(_0x52671e){console['log']('err',_0x52671e);}else{fs[_0xe7ac('0xeb')](_0x2090cd);}});});});}else{return _0x287136[_0xe7ac('0x2e')](0xc8);}})[_0xe7ac('0xb5')](handleError(_0x287136,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 7568f5c..02e2119 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 _0x3360=['Users','map','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','remove','setDataValue'];(function(_0x3c0485,_0x49d066){var _0xfb315c=function(_0x16c1ed){while(--_0x16c1ed){_0x3c0485['push'](_0x3c0485['shift']());}};_0xfb315c(++_0x49d066);}(_0x3360,0x1d7));var _0x0336=function(_0x4d6e4e,_0x3f51f3){_0x4d6e4e=_0x4d6e4e-0x0;var _0x5b44ad=_0x3360[_0x4d6e4e];return _0x5b44ad;};'use strict';var EventEmitter=require(_0x0336('0x0'));var WhatsappInteraction=require(_0x0336('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x0336('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0336('0x3')};function emitEvent(_0xeb42d1){return function(_0x25a5f1,_0x1bfac1,_0x340a8a){_0x25a5f1['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x33fb80){_0x25a5f1[_0x0336('0x4')](_0x0336('0x5'),_0x33fb80[_0x0336('0x6')](function(_0x7cda49){return{'id':_0x7cda49['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x25a5f1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0336('0x7')](function(_0x27d0ab){_0x25a5f1[_0x0336('0x4')]('unreadMessages',_0x27d0ab[_0x0336('0x8')]);WhatsappInteractionEvents['emit'](_0xeb42d1+':'+_0x25a5f1['id'],_0x25a5f1);WhatsappInteractionEvents[_0x0336('0x9')](_0xeb42d1,_0x25a5f1);_0x340a8a(null);})[_0x0336('0xa')](_0x340a8a(null));};}for(var e in events){if(events[_0x0336('0xb')](e)){var event=events[e];WhatsappInteraction[_0x0336('0xc')](e,emitEvent(event));}}module[_0x0336('0xd')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x2333=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove'];(function(_0x52413f,_0x4d456e){var _0x3f841e=function(_0x37f5d2){while(--_0x37f5d2){_0x52413f['push'](_0x52413f['shift']());}};_0x3f841e(++_0x4d456e);}(_0x2333,0x11a));var _0x3233=function(_0x1cde46,_0x440063){_0x1cde46=_0x1cde46-0x0;var _0x43fa30=_0x2333[_0x1cde46];return _0x43fa30;};'use strict';var EventEmitter=require(_0x3233('0x0'));var WhatsappInteraction=require(_0x3233('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x3233('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3233('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3233('0x4'),'afterDestroy':_0x3233('0x5')};function emitEvent(_0x698dea){return function(_0x30ecc8,_0x40768d,_0x31452c){_0x30ecc8[_0x3233('0x6')]({'attributes':['id'],'raw':!![]})[_0x3233('0x7')](function(_0x1e93e8){_0x30ecc8[_0x3233('0x8')](_0x3233('0x9'),_0x1e93e8[_0x3233('0xa')](function(_0x126cf3){return{'id':_0x126cf3['id']};}));return WhatsappMessage[_0x3233('0xb')]({'where':{'WhatsappInteractionId':_0x30ecc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3233('0x7')](function(_0x24ad04){_0x30ecc8[_0x3233('0x8')](_0x3233('0xc'),_0x24ad04[_0x3233('0xd')]);WhatsappInteractionEvents[_0x3233('0xe')](_0x698dea+':'+_0x30ecc8['id'],_0x30ecc8);WhatsappInteractionEvents[_0x3233('0xe')](_0x698dea,_0x30ecc8);_0x31452c(null);})['catch'](_0x31452c(null));};}for(var e in events){if(events[_0x3233('0xf')](e)){var event=events[e];WhatsappInteraction[_0x3233('0x10')](e,emitEvent(event));}}module[_0x3233('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index b181020..f72b891 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 _0xe4ca=['request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x443677,_0x4f2692){var _0x596e9a=function(_0x47c31e){while(--_0x47c31e){_0x443677['push'](_0x443677['shift']());}};_0x596e9a(++_0x4f2692);}(_0xe4ca,0x9a));var _0xae4c=function(_0x232466,_0x344a20){_0x232466=_0x232466-0x0;var _0x2552e9=_0xe4ca[_0x232466];return _0x2552e9;};'use strict';var _=require(_0xae4c('0x0'));var util=require(_0xae4c('0x1'));var logger=require(_0xae4c('0x2'))(_0xae4c('0x3'));var moment=require(_0xae4c('0x4'));var BPromise=require(_0xae4c('0x5'));var rp=require(_0xae4c('0x6'));var fs=require('fs');var path=require(_0xae4c('0x7'));var rimraf=require('rimraf');var config=require(_0xae4c('0x8'));var attributes=require(_0xae4c('0x9'));module[_0xae4c('0xa')]=function(_0x285a13,_0x416a1c){return _0x285a13[_0xae4c('0xb')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f69ce,_0x23c58a,_0x36968f){if(_0x1f69ce[_0xae4c('0xc')](_0xae4c('0xd'))){_0x1f69ce['closedAt']=moment()[_0xae4c('0xe')](_0xae4c('0xf'));}_0x36968f(null,_0x1f69ce);}}});}; \ No newline at end of file +var _0x1268=['./whatsappInteraction.attributes','exports','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5a05e2,_0x5842d4){var _0x31de1d=function(_0x4d5e3e){while(--_0x4d5e3e){_0x5a05e2['push'](_0x5a05e2['shift']());}};_0x31de1d(++_0x5842d4);}(_0x1268,0x9e));var _0x8126=function(_0x385937,_0x3db334){_0x385937=_0x385937-0x0;var _0x5c81ce=_0x1268[_0x385937];return _0x5c81ce;};'use strict';var _=require('lodash');var util=require(_0x8126('0x0'));var logger=require(_0x8126('0x1'))(_0x8126('0x2'));var moment=require(_0x8126('0x3'));var BPromise=require(_0x8126('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8126('0x5'));var rimraf=require('rimraf');var config=require(_0x8126('0x6'));var attributes=require(_0x8126('0x7'));module[_0x8126('0x8')]=function(_0x1ddc02,_0x34ef35){return _0x1ddc02['define']('WhatsappInteraction',attributes,{'tableName':_0x8126('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x342dfe,_0x1614db,_0x2abc44){if(_0x342dfe[_0x8126('0xa')](_0x8126('0xb'))){_0x342dfe[_0x8126('0xc')]=moment()[_0x8126('0xd')](_0x8126('0xe'));}_0x2abc44(null,_0x342dfe);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c620fa8..570bb4c 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 _0x6b83=['register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','find','ids','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket'];(function(_0x623c85,_0x4633b5){var _0x37bca6=function(_0xb802f3){while(--_0xb802f3){_0x623c85['push'](_0x623c85['shift']());}};_0x37bca6(++_0x4633b5);}(_0x6b83,0x141));var _0x36b8=function(_0x37e0a8,_0x184bc8){_0x37e0a8=_0x37e0a8-0x0;var _0x5ca63c=_0x6b83[_0x37e0a8];return _0x5ca63c;};'use strict';var _=require('lodash');var util=require(_0x36b8('0x0'));var moment=require(_0x36b8('0x1'));var BPromise=require(_0x36b8('0x2'));var rs=require(_0x36b8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36b8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x36b8('0x5'));var config=require(_0x36b8('0x6'));var jayson=require(_0x36b8('0x7'));var client=jayson[_0x36b8('0x8')][_0x36b8('0x9')]({'port':0x232a});config[_0x36b8('0xa')]=_[_0x36b8('0xb')](config['redis'],{'host':_0x36b8('0xc'),'port':0x18eb});var socket=require(_0x36b8('0xd'))(new Redis(config[_0x36b8('0xa')]));require(_0x36b8('0xe'))[_0x36b8('0xf')](socket);function respondWithRpcPromise(_0x1d800f,_0x36ad32,_0x242b40){return new BPromise(function(_0x32b9cb,_0xd8a056){return client[_0x36b8('0x10')](_0x1d800f,_0x242b40)[_0x36b8('0x11')](function(_0x3c11b5){logger[_0x36b8('0x12')](_0x36b8('0x13'),_0x36ad32,_0x36b8('0x14'));logger[_0x36b8('0x15')](_0x36b8('0x16'),_0x36ad32,_0x36b8('0x14'),JSON['stringify'](_0x3c11b5));if(_0x3c11b5[_0x36b8('0x17')]){if(_0x3c11b5[_0x36b8('0x17')][_0x36b8('0x18')]===0x1f4){logger['error'](_0x36b8('0x13'),_0x36ad32,_0x3c11b5[_0x36b8('0x17')][_0x36b8('0x19')]);return _0xd8a056(_0x3c11b5[_0x36b8('0x17')]['message']);}logger[_0x36b8('0x17')](_0x36b8('0x13'),_0x36ad32,_0x3c11b5[_0x36b8('0x17')][_0x36b8('0x19')]);return _0x32b9cb(_0x3c11b5[_0x36b8('0x17')][_0x36b8('0x19')]);}else{logger[_0x36b8('0x12')](_0x36b8('0x13'),_0x36ad32,_0x36b8('0x14'));_0x32b9cb(_0x3c11b5[_0x36b8('0x1a')][_0x36b8('0x19')]);}})[_0x36b8('0x1b')](function(_0x2e1563){logger[_0x36b8('0x17')](_0x36b8('0x13'),_0x36ad32,_0x2e1563);_0xd8a056(_0x2e1563);});});}exports[_0x36b8('0x1c')]=function(_0x14240e){var _0x37b27a=this;return new Promise(function(_0x38f50f,_0x3b369a){return db[_0x36b8('0x1d')][_0x36b8('0x1e')](_0x14240e[_0x36b8('0x1f')],{'raw':_0x14240e['options']?_0x14240e[_0x36b8('0x20')][_0x36b8('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14240e['options']?_0x14240e[_0x36b8('0x20')][_0x36b8('0x22')]||null:null,'attributes':_0x14240e[_0x36b8('0x20')]?_0x14240e[_0x36b8('0x20')][_0x36b8('0x23')]||null:null,'limit':_0x14240e['options']?_0x14240e['options'][_0x36b8('0x24')]||null:null})['then'](function(_0x2e3a49){logger[_0x36b8('0x12')](_0x36b8('0x1c'),_0x14240e);logger['debug']('UpdateWhatsappInteraction',_0x14240e,JSON[_0x36b8('0x25')](_0x2e3a49));_0x38f50f(_0x2e3a49);})[_0x36b8('0x1b')](function(_0xb78fca){logger['error'](_0x36b8('0x1c'),_0xb78fca[_0x36b8('0x19')],_0x14240e);_0x3b369a(_0x37b27a[_0x36b8('0x17')](0x1f4,_0xb78fca[_0x36b8('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x325541){return new Promise(function(_0x22adce,_0x4264b6){return db['WhatsappInteraction'][_0x36b8('0x26')]({'where':_0x325541['options']?_0x325541[_0x36b8('0x20')][_0x36b8('0x22')]||null:null})['then'](function(_0x145b47){if(_0x145b47){return _0x145b47['addTags'](_0x325541[_0x36b8('0x1f')][_0x36b8('0x27')],_['omit'](_0x325541['body'],['ids','id'])||{});}})[_0x36b8('0x28')](function(_0x146054){logger[_0x36b8('0x12')](_0x36b8('0x29'),_0x325541);logger['debug'](_0x36b8('0x29'),_0x325541,JSON[_0x36b8('0x25')](_0x146054));_0x22adce(_0x146054);})[_0x36b8('0x1b')](function(_0x4c1c75){logger[_0x36b8('0x17')](_0x36b8('0x29'),_0x4c1c75['message'],_0x325541);_0x4264b6(_this[_0x36b8('0x17')](0x1f4,_0x4c1c75[_0x36b8('0x19')]));});});}; \ No newline at end of file +var _0xd37f=['info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateWhatsappInteraction','body','options','raw','where','limit','WhatsappInteraction','addTags','ids','spread','AddTags','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then'];(function(_0x41b620,_0x2520d9){var _0x14460a=function(_0x1aef47){while(--_0x1aef47){_0x41b620['push'](_0x41b620['shift']());}};_0x14460a(++_0x2520d9);}(_0xd37f,0x1d0));var _0xfd37=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xd37f[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xfd37('0x0'));var util=require('util');var moment=require(_0xfd37('0x1'));var BPromise=require(_0xfd37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd37('0x3'));var db=require(_0xfd37('0x4'))['db'];var utils=require(_0xfd37('0x5'));var logger=require(_0xfd37('0x6'))('rpc');var config=require(_0xfd37('0x7'));var jayson=require(_0xfd37('0x8'));var client=jayson[_0xfd37('0x9')]['http']({'port':0x232a});config[_0xfd37('0xa')]=_['defaults'](config[_0xfd37('0xa')],{'host':_0xfd37('0xb'),'port':0x18eb});var socket=require(_0xfd37('0xc'))(new Redis(config[_0xfd37('0xa')]));require(_0xfd37('0xd'))[_0xfd37('0xe')](socket);function respondWithRpcPromise(_0x5b5959,_0xe63c1f,_0x2d1421){return new BPromise(function(_0x55f0e5,_0x4366ed){return client[_0xfd37('0xf')](_0x5b5959,_0x2d1421)[_0xfd37('0x10')](function(_0x3b58fc){logger[_0xfd37('0x11')](_0xfd37('0x12'),_0xe63c1f,_0xfd37('0x13'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xe63c1f,_0xfd37('0x13'),JSON[_0xfd37('0x14')](_0x3b58fc));if(_0x3b58fc[_0xfd37('0x15')]){if(_0x3b58fc[_0xfd37('0x15')][_0xfd37('0x16')]===0x1f4){logger[_0xfd37('0x15')](_0xfd37('0x12'),_0xe63c1f,_0x3b58fc[_0xfd37('0x15')][_0xfd37('0x17')]);return _0x4366ed(_0x3b58fc[_0xfd37('0x15')][_0xfd37('0x17')]);}logger[_0xfd37('0x15')](_0xfd37('0x12'),_0xe63c1f,_0x3b58fc[_0xfd37('0x15')][_0xfd37('0x17')]);return _0x55f0e5(_0x3b58fc[_0xfd37('0x15')][_0xfd37('0x17')]);}else{logger['info'](_0xfd37('0x12'),_0xe63c1f,'request\x20sent');_0x55f0e5(_0x3b58fc['result']['message']);}})[_0xfd37('0x18')](function(_0x53d46c){logger[_0xfd37('0x15')](_0xfd37('0x12'),_0xe63c1f,_0x53d46c);_0x4366ed(_0x53d46c);});});}exports[_0xfd37('0x19')]=function(_0x39adea){var _0x5af28a=this;return new Promise(function(_0x1e8d2a,_0x44be03){return db['WhatsappInteraction']['update'](_0x39adea[_0xfd37('0x1a')],{'raw':_0x39adea[_0xfd37('0x1b')]?_0x39adea[_0xfd37('0x1b')][_0xfd37('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39adea[_0xfd37('0x1b')]?_0x39adea[_0xfd37('0x1b')][_0xfd37('0x1d')]||null:null,'attributes':_0x39adea[_0xfd37('0x1b')]?_0x39adea[_0xfd37('0x1b')]['attributes']||null:null,'limit':_0x39adea[_0xfd37('0x1b')]?_0x39adea[_0xfd37('0x1b')][_0xfd37('0x1e')]||null:null})[_0xfd37('0x10')](function(_0x11d02c){logger[_0xfd37('0x11')](_0xfd37('0x19'),_0x39adea);logger['debug']('UpdateWhatsappInteraction',_0x39adea,JSON[_0xfd37('0x14')](_0x11d02c));_0x1e8d2a(_0x11d02c);})['catch'](function(_0x5e8d28){logger['error'](_0xfd37('0x19'),_0x5e8d28[_0xfd37('0x17')],_0x39adea);_0x44be03(_0x5af28a[_0xfd37('0x15')](0x1f4,_0x5e8d28['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x4935e6){return new Promise(function(_0x52fe36,_0x5862c4){return db[_0xfd37('0x1f')]['find']({'where':_0x4935e6[_0xfd37('0x1b')]?_0x4935e6[_0xfd37('0x1b')][_0xfd37('0x1d')]||null:null})['then'](function(_0x35bfe1){if(_0x35bfe1){return _0x35bfe1[_0xfd37('0x20')](_0x4935e6[_0xfd37('0x1a')][_0xfd37('0x21')],_['omit'](_0x4935e6[_0xfd37('0x1a')],['ids','id'])||{});}})[_0xfd37('0x22')](function(_0x6a2644){logger[_0xfd37('0x11')](_0xfd37('0x23'),_0x4935e6);logger[_0xfd37('0x24')]('AddTags',_0x4935e6,JSON[_0xfd37('0x14')](_0x6a2644));_0x52fe36(_0x6a2644);})['catch'](function(_0x175f93){logger[_0xfd37('0x15')](_0xfd37('0x23'),_0x175f93[_0xfd37('0x17')],_0x4935e6);_0x5862c4(_this[_0xfd37('0x15')](0x1f4,_0x175f93[_0xfd37('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index e13baaf..b25734f 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 _0xfcfd=['removeListener','register','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x1355df,_0x133da2){var _0x214773=function(_0x22128b){while(--_0x22128b){_0x1355df['push'](_0x1355df['shift']());}};_0x214773(++_0x133da2);}(_0xfcfd,0x1a6));var _0xdfcf=function(_0x33d1ba,_0x26311b){_0x33d1ba=_0x33d1ba-0x0;var _0x2b0123=_0xfcfd[_0x33d1ba];return _0x2b0123;};'use strict';var WhatsappInteractionEvents=require(_0xdfcf('0x0'));var events=[_0xdfcf('0x1'),_0xdfcf('0x2'),_0xdfcf('0x3')];function createListener(_0x43a96f,_0x168608){return function(_0x587ca4){_0x168608[_0xdfcf('0x4')](_0x43a96f,_0x587ca4);};}function removeListener(_0x434439,_0x215ef4){return function(){WhatsappInteractionEvents[_0xdfcf('0x5')](_0x434439,_0x215ef4);};}exports[_0xdfcf('0x6')]=function(_0x2da742){for(var _0x561943=0x0,_0x260ece=events['length'];_0x561943<_0x260ece;_0x561943++){var _0x3aa9e3=events[_0x561943];var _0x479fcb=createListener('whatsappInteraction:'+_0x3aa9e3,_0x2da742);WhatsappInteractionEvents['on'](_0x3aa9e3,_0x479fcb);}}; \ No newline at end of file +var _0x2f96=['removeListener','length','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit'];(function(_0x231005,_0x37b489){var _0xa7726f=function(_0x2558eb){while(--_0x2558eb){_0x231005['push'](_0x231005['shift']());}};_0xa7726f(++_0x37b489);}(_0x2f96,0x192));var _0x62f9=function(_0x2c7997,_0x5842e2){_0x2c7997=_0x2c7997-0x0;var _0x1abcb8=_0x2f96[_0x2c7997];return _0x1abcb8;};'use strict';var WhatsappInteractionEvents=require(_0x62f9('0x0'));var events=['save',_0x62f9('0x1'),_0x62f9('0x2')];function createListener(_0x4aa1cc,_0x58a452){return function(_0x5ac4b1){_0x58a452[_0x62f9('0x3')](_0x4aa1cc,_0x5ac4b1);};}function removeListener(_0x20202f,_0x47c44e){return function(){WhatsappInteractionEvents[_0x62f9('0x4')](_0x20202f,_0x47c44e);};}exports['register']=function(_0x56635a){for(var _0x52cab2=0x0,_0x540b1a=events[_0x62f9('0x5')];_0x52cab2<_0x540b1a;_0x52cab2++){var _0x21fd70=events[_0x52cab2];var _0x52cc3a=createListener(_0x62f9('0x6')+_0x21fd70,_0x56635a);WhatsappInteractionEvents['on'](_0x21fd70,_0x52cc3a);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 167d08a..2764811 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 _0x2c3f=['get','isAuthenticated','/describe','describe','/:id','show','tracked','whatsappmessage:create','create','post','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller'];(function(_0x518dfb,_0x513936){var _0x588cc1=function(_0x2d6a5a){while(--_0x2d6a5a){_0x518dfb['push'](_0x518dfb['shift']());}};_0x588cc1(++_0x513936);}(_0x2c3f,0x125));var _0xf2c3=function(_0x40d1dd,_0x54b781){_0x40d1dd=_0x40d1dd-0x0;var _0xeae037=_0x2c3f[_0x40d1dd];return _0xeae037;};'use strict';var multer=require(_0xf2c3('0x0'));var util=require('util');var path=require(_0xf2c3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf2c3('0x2'));var router=express[_0xf2c3('0x3')]();var fs_extra=require(_0xf2c3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf2c3('0x5'));var config=require('../../config/environment');var controller=require(_0xf2c3('0x6'));router[_0xf2c3('0x7')]('/',auth[_0xf2c3('0x8')](),controller['index']);router['get'](_0xf2c3('0x9'),auth[_0xf2c3('0x8')](),controller[_0xf2c3('0xa')]);router[_0xf2c3('0x7')](_0xf2c3('0xb'),auth[_0xf2c3('0x8')](),controller[_0xf2c3('0xc')]);router['post']('/',auth[_0xf2c3('0x8')](),interaction[_0xf2c3('0xd')]('whatsapp',_0xf2c3('0xe')),controller[_0xf2c3('0xf')]);router[_0xf2c3('0x10')]('/:id/status',controller['status']);router[_0xf2c3('0x11')](_0xf2c3('0xb'),auth[_0xf2c3('0x8')](),controller['update']);router[_0xf2c3('0x11')](_0xf2c3('0x12'),auth[_0xf2c3('0x8')](),controller[_0xf2c3('0x13')]);router[_0xf2c3('0x11')](_0xf2c3('0x14'),auth[_0xf2c3('0x8')](),controller[_0xf2c3('0x15')]);router[_0xf2c3('0x16')](_0xf2c3('0xb'),auth[_0xf2c3('0x8')](),controller[_0xf2c3('0x17')]);module[_0xf2c3('0x18')]=router; \ No newline at end of file +var _0xcc5d=['exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','whatsappmessage:create','create','post','/:id/status','put','/:id','update','accept','reject','delete','destroy'];(function(_0x17cac8,_0x5002d3){var _0x21635f=function(_0x4bf8fe){while(--_0x4bf8fe){_0x17cac8['push'](_0x17cac8['shift']());}};_0x21635f(++_0x5002d3);}(_0xcc5d,0x10f));var _0xdcc5=function(_0x18414e,_0xf51dba){_0x18414e=_0x18414e-0x0;var _0x2b580e=_0xcc5d[_0x18414e];return _0x2b580e;};'use strict';var multer=require(_0xdcc5('0x0'));var util=require('util');var path=require(_0xdcc5('0x1'));var timeout=require(_0xdcc5('0x2'));var express=require(_0xdcc5('0x3'));var router=express['Router']();var fs_extra=require(_0xdcc5('0x4'));var auth=require(_0xdcc5('0x5'));var interaction=require(_0xdcc5('0x6'));var config=require(_0xdcc5('0x7'));var controller=require(_0xdcc5('0x8'));router[_0xdcc5('0x9')]('/',auth[_0xdcc5('0xa')](),controller[_0xdcc5('0xb')]);router[_0xdcc5('0x9')](_0xdcc5('0xc'),auth[_0xdcc5('0xa')](),controller[_0xdcc5('0xd')]);router[_0xdcc5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdcc5('0xe')]);router['post']('/',auth[_0xdcc5('0xa')](),interaction['tracked']('whatsapp',_0xdcc5('0xf')),controller[_0xdcc5('0x10')]);router[_0xdcc5('0x11')](_0xdcc5('0x12'),controller['status']);router[_0xdcc5('0x13')](_0xdcc5('0x14'),auth[_0xdcc5('0xa')](),controller[_0xdcc5('0x15')]);router[_0xdcc5('0x13')]('/:id/accept',auth[_0xdcc5('0xa')](),controller[_0xdcc5('0x16')]);router['put']('/:id/reject',auth[_0xdcc5('0xa')](),controller[_0xdcc5('0x17')]);router[_0xdcc5('0x18')](_0xdcc5('0x14'),auth['isAuthenticated'](),controller[_0xdcc5('0x19')]);module[_0xdcc5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 41c6c10..bcde911 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 _0x0fa0=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x531ce7,_0x22e465){var _0x185949=function(_0x11d4c3){while(--_0x11d4c3){_0x531ce7['push'](_0x531ce7['shift']());}};_0x185949(++_0x22e465);}(_0x0fa0,0xbc));var _0x00fa=function(_0x1d3546,_0x539c31){_0x1d3546=_0x1d3546-0x0;var _0x495482=_0x0fa0[_0x1d3546];return _0x495482;};'use strict';var Sequelize=require(_0x00fa('0x0'));module['exports']={'body':{'type':Sequelize[_0x00fa('0x1')](_0x00fa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x00fa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x00fa('0x4')]('in',_0x00fa('0x5')),'defaultValue':_0x00fa('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x00fa('0x6')](0xbe)},'phone':{'type':Sequelize[_0x00fa('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x00fa('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x00fa('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8a78=['exports','TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x426200,_0x14e133){var _0x2d8400=function(_0x4e3476){while(--_0x4e3476){_0x426200['push'](_0x426200['shift']());}};_0x2d8400(++_0x14e133);}(_0x8a78,0x1e7));var _0x88a7=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0x8a78[_0x46a3ff];return _0x404bc2;};'use strict';var Sequelize=require(_0x88a7('0x0'));module[_0x88a7('0x1')]={'body':{'type':Sequelize[_0x88a7('0x2')](_0x88a7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x88a7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x88a7('0x5')),'defaultValue':_0x88a7('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x88a7('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x88a7('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x88a7('0x6')]},'providerResponse':{'type':Sequelize[_0x88a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index beb6b2d..bb823a1 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 _0xd50d=['order','sort','where','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','describe','../../config/logger','whatsapp-interactions','whatsapp','format','UserId','agent','get','update','read1stAt','interaction','info','role','stringify','null','AcceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','user','channel','event','accept','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','motionChannel','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','destroy','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x1b6a90,_0x166b37){var _0x3e9bcf=function(_0x4dec7f){while(--_0x4dec7f){_0x1b6a90['push'](_0x1b6a90['shift']());}};_0x3e9bcf(++_0x166b37);}(_0xd50d,0xc9));var _0xdd50=function(_0x58a0ac,_0x2cbc38){_0x58a0ac=_0x58a0ac-0x0;var _0x20b914=_0xd50d[_0x58a0ac];return _0x20b914;};'use strict';var emlformat=require(_0xdd50('0x0'));var rimraf=require(_0xdd50('0x1'));var zipdir=require(_0xdd50('0x2'));var jsonpatch=require(_0xdd50('0x3'));var rp=require(_0xdd50('0x4'));var moment=require('moment');var BPromise=require(_0xdd50('0x5'));var Mustache=require(_0xdd50('0x6'));var util=require(_0xdd50('0x7'));var path=require(_0xdd50('0x8'));var sox=require(_0xdd50('0x9'));var csv=require(_0xdd50('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdd50('0xb'));var _=require('lodash');var squel=require(_0xdd50('0xc'));var crypto=require('crypto');var jsforce=require(_0xdd50('0xd'));var deskjs=require(_0xdd50('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdd50('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd50('0x10'));var as=require(_0xdd50('0x11'));var hardwareService=require(_0xdd50('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdd50('0x13'));var licenseUtil=require(_0xdd50('0x14'));var db=require(_0xdd50('0x15'))['db'];config['redis']=_['defaults'](config[_0xdd50('0x16')],{'host':_0xdd50('0x17'),'port':0x18eb});var socket=require(_0xdd50('0x18'))(new Redis(config[_0xdd50('0x16')]));require(_0xdd50('0x19'))['register'](socket);var jayson=require(_0xdd50('0x1a'));var client=jayson[_0xdd50('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xdd50('0x1b')][_0xdd50('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x10c254,_0x5256a3,_0xbc9edf,_0x4c36a9){return new BPromise(function(_0x29a772,_0x56b47f){var _0x16bddb=_0x4c36a9||client;return _0x16bddb[_0xdd50('0x1d')](_0x10c254,_0xbc9edf)[_0xdd50('0x1e')](function(_0x5a36e8){logger['info'](_0xdd50('0x1f'),_0x5256a3,_0xdd50('0x20'));logger[_0xdd50('0x21')](_0xdd50('0x22'),_0x5256a3,'request\x20sent',JSON['stringify'](_0x5a36e8));if(_0x5a36e8[_0xdd50('0x23')]){if(_0x5a36e8[_0xdd50('0x23')][_0xdd50('0x24')]===0x1f4){logger['error'](_0xdd50('0x1f'),_0x5256a3,_0x5a36e8[_0xdd50('0x23')][_0xdd50('0x25')]);return _0x56b47f(_0x5a36e8['error']['message']);}logger[_0xdd50('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x5256a3,_0x5a36e8[_0xdd50('0x23')][_0xdd50('0x25')]);return _0x29a772(_0x5a36e8[_0xdd50('0x23')][_0xdd50('0x25')]);}else{logger['info'](_0xdd50('0x1f'),_0x5256a3,_0xdd50('0x20'));_0x29a772(_0x5a36e8[_0xdd50('0x26')][_0xdd50('0x25')]);}})[_0xdd50('0x27')](function(_0x287b67){logger[_0xdd50('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x5256a3,_0x287b67);_0x56b47f(_0x287b67);});});}function respondWithStatusCode(_0x15e929,_0x5d2263){_0x5d2263=_0x5d2263||0xcc;return function(_0x3287b2){if(_0x3287b2){return _0x15e929[_0xdd50('0x28')](_0x5d2263);}return _0x15e929['status'](_0x5d2263)[_0xdd50('0x29')]();};}function respondWithResult(_0x473b3f,_0x5d6e18){_0x5d6e18=_0x5d6e18||0xc8;return function(_0x3b2c3f){if(_0x3b2c3f){return _0x473b3f[_0xdd50('0x2a')](_0x5d6e18)['json'](_0x3b2c3f);}};}function respondWithFilteredResult(_0x1810d2,_0x21ae45){return function(_0x3b9d36){if(_0x3b9d36){var _0x357001=typeof _0x21ae45[_0xdd50('0x2b')]==='undefined'&&typeof _0x21ae45[_0xdd50('0x2c')]===_0xdd50('0x2d');var _0x1e3c32=_0x3b9d36['count'];var _0x272096=_0x357001?0x0:_0x21ae45[_0xdd50('0x2b')];var _0x34202d=_0x357001?_0x3b9d36[_0xdd50('0x2e')]:_0x21ae45[_0xdd50('0x2b')]+_0x21ae45['limit'];var _0x3a5619;if(_0x34202d>=_0x1e3c32){_0x34202d=_0x1e3c32;_0x3a5619=0xc8;}else{_0x3a5619=0xce;}_0x1810d2[_0xdd50('0x2a')](_0x3a5619);return _0x1810d2[_0xdd50('0x2f')](_0xdd50('0x30'),_0x272096+'-'+_0x34202d+'/'+_0x1e3c32)[_0xdd50('0x31')](_0x3b9d36);}return null;};}function patchUpdates(_0x4edbba){return function(_0x93553a){try{jsonpatch[_0xdd50('0x32')](_0x93553a,_0x4edbba,!![]);}catch(_0x5a90d2){return BPromise[_0xdd50('0x33')](_0x5a90d2);}return _0x93553a[_0xdd50('0x34')]();};}function saveUpdates(_0x2b09ea,_0x559e30){return function(_0x3a7c1e){if(_0x3a7c1e){return _0x3a7c1e['update'](_0x2b09ea)[_0xdd50('0x1e')](function(_0x23dd87){return _0x23dd87;});}return null;};}function removeEntity(_0x30a70d,_0xff3b6c){return function(_0x2ee603){if(_0x2ee603){return _0x2ee603[_0xdd50('0x35')]()[_0xdd50('0x1e')](function(){_0x30a70d[_0xdd50('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27ea46,_0x126f1b){return function(_0x618aec){if(!_0x618aec){_0x27ea46[_0xdd50('0x28')](0x194);}return _0x618aec;};}function handleError(_0x413d21,_0x37f555){_0x37f555=_0x37f555||0x1f4;return function(_0x5987dd){logger[_0xdd50('0x23')](_0x5987dd[_0xdd50('0x36')]);if(_0x5987dd[_0xdd50('0x37')]){delete _0x5987dd[_0xdd50('0x37')];}_0x413d21['status'](_0x37f555)['send'](_0x5987dd);};}exports[_0xdd50('0x38')]=function(_0x5cfc6f,_0x5df123){var _0x3bf0b1={},_0x367c7f={},_0x564e5={'count':0x0,'rows':[]};var _0x226ea3=_[_0xdd50('0x39')](db[_0xdd50('0x3a')][_0xdd50('0x3b')],function(_0xd99025){return{'name':_0xd99025[_0xdd50('0x3c')],'type':_0xd99025[_0xdd50('0x3d')]['key']};});_0x367c7f[_0xdd50('0x3e')]=_[_0xdd50('0x39')](_0x226ea3,'name');_0x367c7f[_0xdd50('0x3f')]=_['keys'](_0x5cfc6f[_0xdd50('0x3f')]);_0x367c7f[_0xdd50('0x40')]=_['intersection'](_0x367c7f[_0xdd50('0x3e')],_0x367c7f[_0xdd50('0x3f')]);_0x3bf0b1[_0xdd50('0x41')]=_[_0xdd50('0x42')](_0x367c7f[_0xdd50('0x3e')],qs['fields'](_0x5cfc6f[_0xdd50('0x3f')][_0xdd50('0x43')]));_0x3bf0b1['attributes']=_0x3bf0b1[_0xdd50('0x41')][_0xdd50('0x44')]?_0x3bf0b1[_0xdd50('0x41')]:_0x367c7f[_0xdd50('0x3e')];if(!_0x5cfc6f[_0xdd50('0x3f')][_0xdd50('0x45')](_0xdd50('0x46'))){_0x3bf0b1[_0xdd50('0x2c')]=qs['limit'](_0x5cfc6f[_0xdd50('0x3f')][_0xdd50('0x2c')]);_0x3bf0b1[_0xdd50('0x2b')]=qs[_0xdd50('0x2b')](_0x5cfc6f[_0xdd50('0x3f')][_0xdd50('0x2b')]);}_0x3bf0b1[_0xdd50('0x47')]=qs[_0xdd50('0x48')](_0x5cfc6f['query']['sort']);_0x3bf0b1[_0xdd50('0x49')]=qs['filters'](_['pick'](_0x5cfc6f[_0xdd50('0x3f')],_0x367c7f[_0xdd50('0x40')]),_0x226ea3);if(_0x5cfc6f[_0xdd50('0x3f')][_0xdd50('0x4a')]){_0x3bf0b1[_0xdd50('0x49')]=_[_0xdd50('0x4b')](_0x3bf0b1['where'],{'$or':_[_0xdd50('0x39')](_0x226ea3,function(_0x5615b8){if(_0x5615b8[_0xdd50('0x3d')]!=='VIRTUAL'){var _0x50ee8f={};_0x50ee8f[_0x5615b8[_0xdd50('0x37')]]={'$like':'%'+_0x5cfc6f[_0xdd50('0x3f')]['filter']+'%'};return _0x50ee8f;}})});}_0x3bf0b1=_[_0xdd50('0x4b')]({},_0x3bf0b1,_0x5cfc6f[_0xdd50('0x4c')]);var _0x414f1a={'where':_0x3bf0b1[_0xdd50('0x49')]};return db[_0xdd50('0x3a')][_0xdd50('0x2e')](_0x414f1a)[_0xdd50('0x1e')](function(_0x484a84){_0x564e5['count']=_0x484a84;if(_0x5cfc6f[_0xdd50('0x3f')]['includeAll']){_0x3bf0b1[_0xdd50('0x4d')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xdd50('0x4e')](_0x3bf0b1);})[_0xdd50('0x1e')](function(_0xcf2005){_0x564e5[_0xdd50('0x4f')]=_0xcf2005;return _0x564e5;})[_0xdd50('0x1e')](respondWithFilteredResult(_0x5df123,_0x3bf0b1))[_0xdd50('0x27')](handleError(_0x5df123,null));};exports[_0xdd50('0x50')]=function(_0x3180fd,_0x151741){var _0x1879c={'raw':!![],'where':{'id':_0x3180fd[_0xdd50('0x51')]['id']}},_0x16e446={};_0x16e446['model']=_[_0xdd50('0x52')](db[_0xdd50('0x3a')][_0xdd50('0x3b')]);_0x16e446['query']=_[_0xdd50('0x52')](_0x3180fd[_0xdd50('0x3f')]);_0x16e446[_0xdd50('0x40')]=_[_0xdd50('0x42')](_0x16e446[_0xdd50('0x3e')],_0x16e446[_0xdd50('0x3f')]);_0x1879c['attributes']=_[_0xdd50('0x42')](_0x16e446[_0xdd50('0x3e')],qs[_0xdd50('0x43')](_0x3180fd['query']['fields']));_0x1879c[_0xdd50('0x41')]=_0x1879c[_0xdd50('0x41')][_0xdd50('0x44')]?_0x1879c[_0xdd50('0x41')]:_0x16e446[_0xdd50('0x3e')];if(_0x3180fd[_0xdd50('0x3f')][_0xdd50('0x53')]){_0x1879c[_0xdd50('0x4d')]=[{'all':!![]}];}_0x1879c=_[_0xdd50('0x4b')]({},_0x1879c,_0x3180fd[_0xdd50('0x4c')]);return db[_0xdd50('0x3a')][_0xdd50('0x54')](_0x1879c)[_0xdd50('0x1e')](handleEntityNotFound(_0x151741,null))[_0xdd50('0x1e')](respondWithResult(_0x151741,null))[_0xdd50('0x27')](handleError(_0x151741,null));};exports['create']=function(_0x202016,_0x3e5923){return db[_0xdd50('0x3a')][_0xdd50('0x55')](_0x202016[_0xdd50('0x56')],{})['then'](respondWithResult(_0x3e5923,0xc9))['catch'](handleError(_0x3e5923,null));};exports['update']=function(_0x35e902,_0x2173ca){if(_0x35e902[_0xdd50('0x56')]['id']){delete _0x35e902[_0xdd50('0x56')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x35e902[_0xdd50('0x51')]['id']}})[_0xdd50('0x1e')](handleEntityNotFound(_0x2173ca,null))[_0xdd50('0x1e')](saveUpdates(_0x35e902[_0xdd50('0x56')],null))[_0xdd50('0x1e')](respondWithResult(_0x2173ca,null))[_0xdd50('0x27')](handleError(_0x2173ca,null));};exports[_0xdd50('0x35')]=function(_0x1e0b3c,_0x429484){return db[_0xdd50('0x3a')]['find']({'where':{'id':_0x1e0b3c[_0xdd50('0x51')]['id']}})[_0xdd50('0x1e')](handleEntityNotFound(_0x429484,null))['then'](removeEntity(_0x429484,null))['catch'](handleError(_0x429484,null));};exports[_0xdd50('0x57')]=function(_0x3d9edc,_0x4ab245){return db[_0xdd50('0x3a')]['describe']()['then'](respondWithResult(_0x4ab245,null))[_0xdd50('0x27')](handleError(_0x4ab245,null));};var interaction_log=require(_0xdd50('0x58'))(_0xdd50('0x59'));exports['accept']=function(_0x118e5d,_0x332912,_0x5a4084){var _0xf9b287={'agent':{},'channel':_0xdd50('0x5a')};if(_0x118e5d[_0xdd50('0x56')]['id']){delete _0x118e5d[_0xdd50('0x56')]['id'];}_0x118e5d[_0xdd50('0x56')]['read']=!![];_0x118e5d[_0xdd50('0x56')]['readAt']=moment()[_0xdd50('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x118e5d[_0xdd50('0x56')][_0xdd50('0x5c')]=_0x118e5d[_0xdd50('0x56')][_0xdd50('0x5c')]||_0x118e5d['user']['id'];_0xf9b287[_0xdd50('0x5d')]['id']=_0x118e5d[_0xdd50('0x56')]['UserId'];return db['WhatsappMessage'][_0xdd50('0x54')]({'where':{'id':_0x118e5d['params']['id'],'UserId':null}})[_0xdd50('0x1e')](handleEntityNotFound(_0x332912,null))[_0xdd50('0x1e')](saveUpdates(_0x118e5d[_0xdd50('0x56')],null))[_0xdd50('0x1e')](function(_0x5c2ed0){if(_0x5c2ed0){_0xf9b287['message']=_0x5c2ed0[_0xdd50('0x5e')]({'plain':!![]});return db['WhatsappInteraction'][_0xdd50('0x54')]({'where':{'id':_0x5c2ed0['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x332912,null))[_0xdd50('0x1e')](function(_0x5b4dbc){if(_0x5b4dbc){return _0x5b4dbc[_0xdd50('0x5f')]({'UserId':_0x118e5d['body']['UserId'],'read1stAt':_['isNil'](_0x5b4dbc[_0xdd50('0x60')])?moment()[_0xdd50('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x8ffd1c){if(_0x8ffd1c){_0xf9b287[_0xdd50('0x61')]=_0x8ffd1c[_0xdd50('0x5e')]({'plain':!![]});interaction_log[_0xdd50('0x62')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x118e5d['user']['id'],_0x118e5d['user'][_0xdd50('0x37')],_0x118e5d['user'][_0xdd50('0x63')],_0xf9b287[_0xdd50('0x61')]['id'],_0x118e5d[_0xdd50('0x56')]?JSON[_0xdd50('0x64')](_0x118e5d['body']):_0xdd50('0x65'));return respondWithRpcPromise(_0xdd50('0x66'),'acceptMessage',_0xf9b287);}return null;})[_0xdd50('0x1e')](function(_0x12bae2){var _0x49aa32='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12bae2[_0xdd50('0x25')][_0xdd50('0x67')];return db[_0xdd50('0x68')]['query'](_0x49aa32,{'type':db['Sequelize'][_0xdd50('0x69')][_0xdd50('0x6a')],'raw':!![]})[_0xdd50('0x1e')](function(_0x5983f8){return _0x5983f8;});})[_0xdd50('0x1e')](function(_0xc0dc2b){if(_0xc0dc2b){_0xf9b287[_0xdd50('0x25')][_0xdd50('0x6b')]=_0xc0dc2b[0x0];if(!_0x118e5d[_0xdd50('0x56')][_0xdd50('0x5c')])return;return db['User'][_0xdd50('0x54')]({'where':{'id':_0x118e5d['body'][_0xdd50('0x5c')],'role':_0xdd50('0x5d')},'attributes':['id','name',_0xdd50('0x6c'),_0xdd50('0x6d'),_0xdd50('0x6e')],'raw':!![]});}return null;})[_0xdd50('0x1e')](function(_0x161bd2){if(!_0x161bd2)return null;_0xf9b287['message'][_0xdd50('0x5d')]=_0x161bd2;return _0xf9b287;})[_0xdd50('0x1e')](function(_0x2187c4){if(_0x2187c4){if(_0x118e5d[_0xdd50('0x56')][_0xdd50('0x6f')]){_0xf9b287[_0xdd50('0x25')][_0xdd50('0x70')]=util[_0xdd50('0x5b')](_0xdd50('0x71'),_0x118e5d[_0xdd50('0x72')][_0xdd50('0x37')]);_0xf9b287[_0xdd50('0x25')][_0xdd50('0x73')]=_0xf9b287[_0xdd50('0x73')];_0xf9b287[_0xdd50('0x25')]['motionChannel']=_0xf9b287[_0xdd50('0x73')];_0xf9b287['message'][_0xdd50('0x74')]=_0xdd50('0x75');return respondWithRpcPromise(_0xdd50('0x76'),_0xdd50('0x76'),{'event':'acceptmessage','message':_0xf9b287[_0xdd50('0x25')]},client9002)['then'](function(){return _0xf9b287;});}return _0xf9b287;}return null;})[_0xdd50('0x1e')](respondWithResult(_0x332912,null))['catch'](handleError(_0x332912,null));};var interaction_log=require(_0xdd50('0x58'))(_0xdd50('0x59'));exports[_0xdd50('0x33')]=function(_0x346fbc,_0xe25acb,_0x83f31c){var _0x3636cc={'agent':{},'channel':_0xdd50('0x5a')};if(_0x346fbc[_0xdd50('0x56')]['id']){delete _0x346fbc[_0xdd50('0x56')]['id'];}_0x346fbc[_0xdd50('0x56')]['UserId']=_0x346fbc[_0xdd50('0x56')]['UserId']||_0x346fbc['user']['id'];_0x3636cc['agent']['id']=_0x346fbc['body'][_0xdd50('0x5c')];return db[_0xdd50('0x3a')][_0xdd50('0x54')]({'where':{'id':_0x346fbc['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe25acb,null))[_0xdd50('0x1e')](function(_0xe74fe6){if(_0xe74fe6){_0x3636cc[_0xdd50('0x25')]=_0xe74fe6[_0xdd50('0x5e')]({'plain':!![]});return db[_0xdd50('0x77')]['find']({'where':{'id':_0xe74fe6['WhatsappInteractionId']}});}return null;})[_0xdd50('0x1e')](handleEntityNotFound(_0xe25acb,null))['then'](function(_0x3da61a){if(_0x3da61a){_0x3636cc['interaction']=_0x3da61a['get']({'plain':!![]});interaction_log[_0xdd50('0x62')](_0xdd50('0x78'),_0x346fbc[_0xdd50('0x72')]['id'],_0x346fbc[_0xdd50('0x72')][_0xdd50('0x37')],_0x346fbc[_0xdd50('0x72')]['role'],_0x3636cc[_0xdd50('0x61')]['id'],_0x346fbc['body']?JSON['stringify'](_0x346fbc[_0xdd50('0x56')]):_0xdd50('0x65'));return respondWithRpcPromise(_0xdd50('0x79'),'rejectMessage',_0x3636cc);}return null;})[_0xdd50('0x1e')](function(_0x207a02){var _0x3ff6d9=_0xdd50('0x7a')+_0x207a02['message'][_0xdd50('0x67')];return db['sequelize']['query'](_0x3ff6d9,{'type':db[_0xdd50('0x7b')][_0xdd50('0x69')][_0xdd50('0x6a')],'raw':!![]})['then'](function(_0xc7ff85){return _0xc7ff85;});})[_0xdd50('0x1e')](function(_0x3ae406){if(_0x3ae406){_0x3636cc['message'][_0xdd50('0x6b')]=_0x3ae406[0x0];if(!_0x346fbc[_0xdd50('0x56')][_0xdd50('0x5c')])return;return db[_0xdd50('0x7c')][_0xdd50('0x54')]({'where':{'id':_0x346fbc[_0xdd50('0x56')][_0xdd50('0x5c')],'role':'agent'},'attributes':['id','name',_0xdd50('0x6c'),_0xdd50('0x6d'),_0xdd50('0x6e')],'raw':!![]});}return null;})[_0xdd50('0x1e')](function(_0x5e36e9){if(!_0x5e36e9)return null;_0x3636cc[_0xdd50('0x25')][_0xdd50('0x5d')]=_0x5e36e9;return _0x3636cc;})[_0xdd50('0x1e')](function(_0x267eb2){if(_0x267eb2){_0x267eb2['message']['interface']=util[_0xdd50('0x5b')](_0xdd50('0x71'),_0x346fbc['user'][_0xdd50('0x37')]);_0x267eb2[_0xdd50('0x25')][_0xdd50('0x73')]=_0x3636cc[_0xdd50('0x73')];_0x267eb2[_0xdd50('0x25')][_0xdd50('0x7d')]=_0x3636cc['channel'];_0x267eb2[_0xdd50('0x25')][_0xdd50('0x74')]=_0xdd50('0x33');respondWithRpcPromise(_0xdd50('0x76'),_0xdd50('0x76'),{'event':'rejectmessage','message':_0x267eb2[_0xdd50('0x25')]},client9002);return _0x3636cc;}return null;})[_0xdd50('0x1e')](respondWithResult(_0xe25acb,null))[_0xdd50('0x27')](handleError(_0xe25acb,null));};exports[_0xdd50('0x2a')]=function(_0x108a52,_0x24e246,_0x433f1e){if(_0x108a52[_0xdd50('0x56')]['id']){delete _0x108a52[_0xdd50('0x56')]['id'];}var _0x5314be;return db['WhatsappMessage'][_0xdd50('0x54')]({'where':{'id':_0x108a52['params']['id']}})['then'](handleEntityNotFound(_0x24e246,null))[_0xdd50('0x1e')](function(_0x7b62aa){if(_0x7b62aa){_0x5314be=_0x7b62aa;return db[_0xdd50('0x7e')]['find']({'where':{'id':_0x7b62aa[_0xdd50('0x7f')]}});}})[_0xdd50('0x1e')](handleEntityNotFound(_0x24e246,null))[_0xdd50('0x1e')](function(_0x549c22){if(_0x549c22){logger[_0xdd50('0x21')](_0xdd50('0x80'),'status',_0xdd50('0x81'),_0x549c22[_0xdd50('0x3d')],util[_0xdd50('0x82')](_0x108a52[_0xdd50('0x56')],{'showHidden':![],'depth':null}));switch(_0x549c22['type']){case _0xdd50('0x83'):if(_0x108a52[_0xdd50('0x56')][_0xdd50('0x84')]&&_0x108a52[_0xdd50('0x56')][_0xdd50('0x84')]===_0x5314be[_0xdd50('0x85')]&&_0x108a52[_0xdd50('0x56')][_0xdd50('0x86')]&&_0x108a52[_0xdd50('0x56')][_0xdd50('0x86')]===_0xdd50('0x87')){return _0x5314be[_0xdd50('0x5f')]({'read':!![]});}else{logger[_0xdd50('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xdd50('0x83'),util['inspect'](_0x108a52[_0xdd50('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x5314be;}})[_0xdd50('0x1e')](respondWithResult(_0x24e246,null))[_0xdd50('0x27')](handleError(_0x24e246,null));}; \ No newline at end of file +var _0x0e6f=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','WhatsappMessage','includeAll','include','findAll','rows','show','params','options','find','create','body','describe','whatsapp-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','whatsapp','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','email','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','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','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','stack','name','index','map','rawAttributes','type','key','model','query'];(function(_0x12f66b,_0x41fda0){var _0x23807b=function(_0x6e3692){while(--_0x6e3692){_0x12f66b['push'](_0x12f66b['shift']());}};_0x23807b(++_0x41fda0);}(_0x0e6f,0x159));var _0xf0e6=function(_0x230628,_0x4b01f9){_0x230628=_0x230628-0x0;var _0xd221b1=_0x0e6f[_0x230628];return _0xd221b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0e6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0e6('0x1'));var moment=require(_0xf0e6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf0e6('0x3'));var util=require(_0xf0e6('0x4'));var path=require('path');var sox=require(_0xf0e6('0x5'));var csv=require(_0xf0e6('0x6'));var ejs=require(_0xf0e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0e6('0x8'));var squel=require('squel');var crypto=require(_0xf0e6('0x9'));var jsforce=require(_0xf0e6('0xa'));var deskjs=require(_0xf0e6('0xb'));var toCsv=require(_0xf0e6('0x6'));var querystring=require(_0xf0e6('0xc'));var Papa=require(_0xf0e6('0xd'));var Redis=require(_0xf0e6('0xe'));var authService=require(_0xf0e6('0xf'));var qs=require(_0xf0e6('0x10'));var as=require(_0xf0e6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0e6('0x12'))('api');var utils=require(_0xf0e6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf0e6('0x14'));var db=require(_0xf0e6('0x15'))['db'];config['redis']=_['defaults'](config[_0xf0e6('0x16')],{'host':_0xf0e6('0x17'),'port':0x18eb});var socket=require(_0xf0e6('0x18'))(new Redis(config[_0xf0e6('0x16')]));require(_0xf0e6('0x19'))[_0xf0e6('0x1a')](socket);var jayson=require(_0xf0e6('0x1b'));var client=jayson[_0xf0e6('0x1c')][_0xf0e6('0x1d')]({'port':0x232c});var client9002=jayson[_0xf0e6('0x1c')][_0xf0e6('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x58a8fe,_0x5d673f,_0x17644b,_0x384ee4){return new BPromise(function(_0x2eccd5,_0x4d487c){var _0xcc8e3f=_0x384ee4||client;return _0xcc8e3f['request'](_0x58a8fe,_0x17644b)[_0xf0e6('0x1e')](function(_0xddc0d2){logger[_0xf0e6('0x1f')](_0xf0e6('0x20'),_0x5d673f,_0xf0e6('0x21'));logger[_0xf0e6('0x22')](_0xf0e6('0x23'),_0x5d673f,'request\x20sent',JSON[_0xf0e6('0x24')](_0xddc0d2));if(_0xddc0d2[_0xf0e6('0x25')]){if(_0xddc0d2[_0xf0e6('0x25')][_0xf0e6('0x26')]===0x1f4){logger[_0xf0e6('0x25')](_0xf0e6('0x20'),_0x5d673f,_0xddc0d2[_0xf0e6('0x25')]['message']);return _0x4d487c(_0xddc0d2[_0xf0e6('0x25')][_0xf0e6('0x27')]);}logger[_0xf0e6('0x25')](_0xf0e6('0x20'),_0x5d673f,_0xddc0d2[_0xf0e6('0x25')]['message']);return _0x2eccd5(_0xddc0d2[_0xf0e6('0x25')][_0xf0e6('0x27')]);}else{logger[_0xf0e6('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x5d673f,_0xf0e6('0x21'));_0x2eccd5(_0xddc0d2['result']['message']);}})[_0xf0e6('0x28')](function(_0x2f0914){logger[_0xf0e6('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x5d673f,_0x2f0914);_0x4d487c(_0x2f0914);});});}function respondWithStatusCode(_0x3d073a,_0x1310c4){_0x1310c4=_0x1310c4||0xcc;return function(_0x28fa47){if(_0x28fa47){return _0x3d073a['sendStatus'](_0x1310c4);}return _0x3d073a[_0xf0e6('0x29')](_0x1310c4)[_0xf0e6('0x2a')]();};}function respondWithResult(_0x17c031,_0x5b56b7){_0x5b56b7=_0x5b56b7||0xc8;return function(_0xdc9014){if(_0xdc9014){return _0x17c031[_0xf0e6('0x29')](_0x5b56b7)[_0xf0e6('0x2b')](_0xdc9014);}};}function respondWithFilteredResult(_0x26447b,_0x1d9bd3){return function(_0x36c703){if(_0x36c703){var _0x30c7cc=typeof _0x1d9bd3['offset']===_0xf0e6('0x2c')&&typeof _0x1d9bd3[_0xf0e6('0x2d')]===_0xf0e6('0x2c');var _0xb17e9e=_0x36c703[_0xf0e6('0x2e')];var _0x44d304=_0x30c7cc?0x0:_0x1d9bd3['offset'];var _0x2e2f9a=_0x30c7cc?_0x36c703[_0xf0e6('0x2e')]:_0x1d9bd3[_0xf0e6('0x2f')]+_0x1d9bd3['limit'];var _0x5810fb;if(_0x2e2f9a>=_0xb17e9e){_0x2e2f9a=_0xb17e9e;_0x5810fb=0xc8;}else{_0x5810fb=0xce;}_0x26447b['status'](_0x5810fb);return _0x26447b[_0xf0e6('0x30')](_0xf0e6('0x31'),_0x44d304+'-'+_0x2e2f9a+'/'+_0xb17e9e)['json'](_0x36c703);}return null;};}function patchUpdates(_0xc97eb1){return function(_0x14e18d){try{jsonpatch[_0xf0e6('0x32')](_0x14e18d,_0xc97eb1,!![]);}catch(_0x2fa4fb){return BPromise[_0xf0e6('0x33')](_0x2fa4fb);}return _0x14e18d['save']();};}function saveUpdates(_0x303eb8,_0x5f150e){return function(_0x58e44c){if(_0x58e44c){return _0x58e44c[_0xf0e6('0x34')](_0x303eb8)['then'](function(_0x21ffe7){return _0x21ffe7;});}return null;};}function removeEntity(_0x1bf8b3,_0xd4ed25){return function(_0x31a3e8){if(_0x31a3e8){return _0x31a3e8[_0xf0e6('0x35')]()[_0xf0e6('0x1e')](function(){_0x1bf8b3[_0xf0e6('0x29')](0xcc)[_0xf0e6('0x2a')]();});}};}function handleEntityNotFound(_0x468308,_0x1ed0de){return function(_0x2bac05){if(!_0x2bac05){_0x468308['sendStatus'](0x194);}return _0x2bac05;};}function handleError(_0x564e8c,_0x372d47){_0x372d47=_0x372d47||0x1f4;return function(_0x1f010d){logger['error'](_0x1f010d[_0xf0e6('0x36')]);if(_0x1f010d[_0xf0e6('0x37')]){delete _0x1f010d[_0xf0e6('0x37')];}_0x564e8c['status'](_0x372d47)['send'](_0x1f010d);};}exports[_0xf0e6('0x38')]=function(_0x8b1746,_0x34fd1d){var _0x2c910d={},_0x29d2cd={},_0x431b97={'count':0x0,'rows':[]};var _0x3d65c4=_[_0xf0e6('0x39')](db['WhatsappMessage'][_0xf0e6('0x3a')],function(_0x4e5713){return{'name':_0x4e5713['fieldName'],'type':_0x4e5713[_0xf0e6('0x3b')][_0xf0e6('0x3c')]};});_0x29d2cd[_0xf0e6('0x3d')]=_['map'](_0x3d65c4,_0xf0e6('0x37'));_0x29d2cd[_0xf0e6('0x3e')]=_[_0xf0e6('0x3f')](_0x8b1746[_0xf0e6('0x3e')]);_0x29d2cd[_0xf0e6('0x40')]=_['intersection'](_0x29d2cd[_0xf0e6('0x3d')],_0x29d2cd['query']);_0x2c910d[_0xf0e6('0x41')]=_[_0xf0e6('0x42')](_0x29d2cd[_0xf0e6('0x3d')],qs[_0xf0e6('0x43')](_0x8b1746[_0xf0e6('0x3e')][_0xf0e6('0x43')]));_0x2c910d[_0xf0e6('0x41')]=_0x2c910d['attributes'][_0xf0e6('0x44')]?_0x2c910d[_0xf0e6('0x41')]:_0x29d2cd[_0xf0e6('0x3d')];if(!_0x8b1746['query'][_0xf0e6('0x45')]('nolimit')){_0x2c910d[_0xf0e6('0x2d')]=qs[_0xf0e6('0x2d')](_0x8b1746[_0xf0e6('0x3e')][_0xf0e6('0x2d')]);_0x2c910d[_0xf0e6('0x2f')]=qs[_0xf0e6('0x2f')](_0x8b1746[_0xf0e6('0x3e')]['offset']);}_0x2c910d[_0xf0e6('0x46')]=qs['sort'](_0x8b1746[_0xf0e6('0x3e')][_0xf0e6('0x47')]);_0x2c910d['where']=qs[_0xf0e6('0x40')](_[_0xf0e6('0x48')](_0x8b1746[_0xf0e6('0x3e')],_0x29d2cd['filters']),_0x3d65c4);if(_0x8b1746[_0xf0e6('0x3e')][_0xf0e6('0x49')]){_0x2c910d['where']=_['merge'](_0x2c910d[_0xf0e6('0x4a')],{'$or':_[_0xf0e6('0x39')](_0x3d65c4,function(_0x10d820){if(_0x10d820[_0xf0e6('0x3b')]!=='VIRTUAL'){var _0x1d84b9={};_0x1d84b9[_0x10d820[_0xf0e6('0x37')]]={'$like':'%'+_0x8b1746['query'][_0xf0e6('0x49')]+'%'};return _0x1d84b9;}})});}_0x2c910d=_[_0xf0e6('0x4b')]({},_0x2c910d,_0x8b1746['options']);var _0x3164ae={'where':_0x2c910d[_0xf0e6('0x4a')]};return db[_0xf0e6('0x4c')][_0xf0e6('0x2e')](_0x3164ae)[_0xf0e6('0x1e')](function(_0x594e78){_0x431b97['count']=_0x594e78;if(_0x8b1746[_0xf0e6('0x3e')][_0xf0e6('0x4d')]){_0x2c910d[_0xf0e6('0x4e')]=[{'all':!![]}];}return db[_0xf0e6('0x4c')][_0xf0e6('0x4f')](_0x2c910d);})[_0xf0e6('0x1e')](function(_0x2c63af){_0x431b97[_0xf0e6('0x50')]=_0x2c63af;return _0x431b97;})[_0xf0e6('0x1e')](respondWithFilteredResult(_0x34fd1d,_0x2c910d))[_0xf0e6('0x28')](handleError(_0x34fd1d,null));};exports[_0xf0e6('0x51')]=function(_0x560df1,_0x211f99){var _0x346d70={'raw':!![],'where':{'id':_0x560df1[_0xf0e6('0x52')]['id']}},_0x33ff90={};_0x33ff90[_0xf0e6('0x3d')]=_['keys'](db[_0xf0e6('0x4c')][_0xf0e6('0x3a')]);_0x33ff90[_0xf0e6('0x3e')]=_[_0xf0e6('0x3f')](_0x560df1[_0xf0e6('0x3e')]);_0x33ff90['filters']=_[_0xf0e6('0x42')](_0x33ff90[_0xf0e6('0x3d')],_0x33ff90[_0xf0e6('0x3e')]);_0x346d70['attributes']=_[_0xf0e6('0x42')](_0x33ff90[_0xf0e6('0x3d')],qs['fields'](_0x560df1[_0xf0e6('0x3e')][_0xf0e6('0x43')]));_0x346d70[_0xf0e6('0x41')]=_0x346d70['attributes'][_0xf0e6('0x44')]?_0x346d70[_0xf0e6('0x41')]:_0x33ff90['model'];if(_0x560df1[_0xf0e6('0x3e')][_0xf0e6('0x4d')]){_0x346d70[_0xf0e6('0x4e')]=[{'all':!![]}];}_0x346d70=_[_0xf0e6('0x4b')]({},_0x346d70,_0x560df1[_0xf0e6('0x53')]);return db[_0xf0e6('0x4c')][_0xf0e6('0x54')](_0x346d70)['then'](handleEntityNotFound(_0x211f99,null))[_0xf0e6('0x1e')](respondWithResult(_0x211f99,null))['catch'](handleError(_0x211f99,null));};exports[_0xf0e6('0x55')]=function(_0x3701f1,_0x707727){return db[_0xf0e6('0x4c')][_0xf0e6('0x55')](_0x3701f1['body'],{})[_0xf0e6('0x1e')](respondWithResult(_0x707727,0xc9))[_0xf0e6('0x28')](handleError(_0x707727,null));};exports[_0xf0e6('0x34')]=function(_0x5c0ef3,_0xdae12b){if(_0x5c0ef3[_0xf0e6('0x56')]['id']){delete _0x5c0ef3[_0xf0e6('0x56')]['id'];}return db['WhatsappMessage'][_0xf0e6('0x54')]({'where':{'id':_0x5c0ef3['params']['id']}})[_0xf0e6('0x1e')](handleEntityNotFound(_0xdae12b,null))[_0xf0e6('0x1e')](saveUpdates(_0x5c0ef3[_0xf0e6('0x56')],null))[_0xf0e6('0x1e')](respondWithResult(_0xdae12b,null))[_0xf0e6('0x28')](handleError(_0xdae12b,null));};exports[_0xf0e6('0x35')]=function(_0x5ee068,_0x5259b2){return db[_0xf0e6('0x4c')]['find']({'where':{'id':_0x5ee068[_0xf0e6('0x52')]['id']}})[_0xf0e6('0x1e')](handleEntityNotFound(_0x5259b2,null))[_0xf0e6('0x1e')](removeEntity(_0x5259b2,null))['catch'](handleError(_0x5259b2,null));};exports['describe']=function(_0x1ff7f5,_0x376d6b){return db['WhatsappMessage'][_0xf0e6('0x57')]()[_0xf0e6('0x1e')](respondWithResult(_0x376d6b,null))[_0xf0e6('0x28')](handleError(_0x376d6b,null));};var interaction_log=require('../../config/logger')(_0xf0e6('0x58'));exports['accept']=function(_0x342935,_0x5ba8c8,_0x16a286){var _0x57784f={'agent':{},'channel':'whatsapp'};if(_0x342935['body']['id']){delete _0x342935[_0xf0e6('0x56')]['id'];}_0x342935[_0xf0e6('0x56')][_0xf0e6('0x59')]=!![];_0x342935['body'][_0xf0e6('0x5a')]=moment()[_0xf0e6('0x5b')](_0xf0e6('0x5c'));_0x342935[_0xf0e6('0x56')][_0xf0e6('0x5d')]=_0x342935[_0xf0e6('0x56')][_0xf0e6('0x5d')]||_0x342935[_0xf0e6('0x5e')]['id'];_0x57784f[_0xf0e6('0x5f')]['id']=_0x342935['body'][_0xf0e6('0x5d')];return db[_0xf0e6('0x4c')][_0xf0e6('0x54')]({'where':{'id':_0x342935[_0xf0e6('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5ba8c8,null))['then'](saveUpdates(_0x342935['body'],null))[_0xf0e6('0x1e')](function(_0x3caf6f){if(_0x3caf6f){_0x57784f[_0xf0e6('0x27')]=_0x3caf6f['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x3caf6f[_0xf0e6('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x5ba8c8,null))[_0xf0e6('0x1e')](function(_0x53be88){if(_0x53be88){return _0x53be88[_0xf0e6('0x34')]({'UserId':_0x342935[_0xf0e6('0x56')][_0xf0e6('0x5d')],'read1stAt':_['isNil'](_0x53be88[_0xf0e6('0x61')])?moment()[_0xf0e6('0x5b')](_0xf0e6('0x5c')):undefined});}return null;})[_0xf0e6('0x1e')](function(_0x226135){if(_0x226135){_0x57784f[_0xf0e6('0x62')]=_0x226135['get']({'plain':!![]});interaction_log[_0xf0e6('0x1f')](_0xf0e6('0x63'),_0x342935[_0xf0e6('0x5e')]['id'],_0x342935[_0xf0e6('0x5e')]['name'],_0x342935[_0xf0e6('0x5e')][_0xf0e6('0x64')],_0x57784f[_0xf0e6('0x62')]['id'],_0x342935[_0xf0e6('0x56')]?JSON[_0xf0e6('0x24')](_0x342935[_0xf0e6('0x56')]):_0xf0e6('0x65'));return respondWithRpcPromise('AcceptMessage',_0xf0e6('0x66'),_0x57784f);}return null;})[_0xf0e6('0x1e')](function(_0x67ce66){var _0x322c55='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x67ce66['message'][_0xf0e6('0x67')];return db[_0xf0e6('0x68')][_0xf0e6('0x3e')](_0x322c55,{'type':db[_0xf0e6('0x69')][_0xf0e6('0x6a')][_0xf0e6('0x6b')],'raw':!![]})[_0xf0e6('0x1e')](function(_0x464e4b){return _0x464e4b;});})[_0xf0e6('0x1e')](function(_0x4889d1){if(_0x4889d1){_0x57784f[_0xf0e6('0x27')][_0xf0e6('0x6c')]=_0x4889d1[0x0];if(!_0x342935[_0xf0e6('0x56')][_0xf0e6('0x5d')])return;return db['User']['find']({'where':{'id':_0x342935[_0xf0e6('0x56')][_0xf0e6('0x5d')],'role':'agent'},'attributes':['id',_0xf0e6('0x37'),_0xf0e6('0x6d'),'email',_0xf0e6('0x6e')],'raw':!![]});}return null;})['then'](function(_0x38f2f1){if(!_0x38f2f1)return null;_0x57784f['message'][_0xf0e6('0x5f')]=_0x38f2f1;return _0x57784f;})[_0xf0e6('0x1e')](function(_0x546bf0){if(_0x546bf0){if(_0x342935[_0xf0e6('0x56')]['manual']){_0x57784f['message'][_0xf0e6('0x6f')]=util[_0xf0e6('0x5b')](_0xf0e6('0x70'),_0x342935['user']['name']);_0x57784f[_0xf0e6('0x27')][_0xf0e6('0x71')]=_0x57784f[_0xf0e6('0x71')];_0x57784f['message'][_0xf0e6('0x72')]=_0x57784f[_0xf0e6('0x71')];_0x57784f[_0xf0e6('0x27')][_0xf0e6('0x73')]=_0xf0e6('0x74');return respondWithRpcPromise(_0xf0e6('0x75'),_0xf0e6('0x75'),{'event':_0xf0e6('0x76'),'message':_0x57784f[_0xf0e6('0x27')]},client9002)[_0xf0e6('0x1e')](function(){return _0x57784f;});}return _0x57784f;}return null;})[_0xf0e6('0x1e')](respondWithResult(_0x5ba8c8,null))[_0xf0e6('0x28')](handleError(_0x5ba8c8,null));};var interaction_log=require(_0xf0e6('0x12'))(_0xf0e6('0x58'));exports[_0xf0e6('0x33')]=function(_0x4f7ed7,_0x39e58c,_0x4f9e3d){var _0xb39664={'agent':{},'channel':_0xf0e6('0x77')};if(_0x4f7ed7[_0xf0e6('0x56')]['id']){delete _0x4f7ed7['body']['id'];}_0x4f7ed7[_0xf0e6('0x56')]['UserId']=_0x4f7ed7[_0xf0e6('0x56')][_0xf0e6('0x5d')]||_0x4f7ed7[_0xf0e6('0x5e')]['id'];_0xb39664[_0xf0e6('0x5f')]['id']=_0x4f7ed7[_0xf0e6('0x56')][_0xf0e6('0x5d')];return db['WhatsappMessage'][_0xf0e6('0x54')]({'where':{'id':_0x4f7ed7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x39e58c,null))['then'](function(_0xe1b9c4){if(_0xe1b9c4){_0xb39664[_0xf0e6('0x27')]=_0xe1b9c4[_0xf0e6('0x78')]({'plain':!![]});return db['WhatsappInteraction'][_0xf0e6('0x54')]({'where':{'id':_0xe1b9c4[_0xf0e6('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x39e58c,null))[_0xf0e6('0x1e')](function(_0x31fd72){if(_0x31fd72){_0xb39664[_0xf0e6('0x62')]=_0x31fd72['get']({'plain':!![]});interaction_log[_0xf0e6('0x1f')](_0xf0e6('0x79'),_0x4f7ed7[_0xf0e6('0x5e')]['id'],_0x4f7ed7[_0xf0e6('0x5e')][_0xf0e6('0x37')],_0x4f7ed7[_0xf0e6('0x5e')][_0xf0e6('0x64')],_0xb39664['interaction']['id'],_0x4f7ed7[_0xf0e6('0x56')]?JSON[_0xf0e6('0x24')](_0x4f7ed7['body']):_0xf0e6('0x65'));return respondWithRpcPromise(_0xf0e6('0x7a'),_0xf0e6('0x7b'),_0xb39664);}return null;})[_0xf0e6('0x1e')](function(_0x8fa7af){var _0x60fd75=_0xf0e6('0x7c')+_0x8fa7af[_0xf0e6('0x27')][_0xf0e6('0x67')];return db['sequelize'][_0xf0e6('0x3e')](_0x60fd75,{'type':db[_0xf0e6('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0xf0e6('0x1e')](function(_0x188277){return _0x188277;});})[_0xf0e6('0x1e')](function(_0x2f5843){if(_0x2f5843){_0xb39664['message'][_0xf0e6('0x6c')]=_0x2f5843[0x0];if(!_0x4f7ed7['body'][_0xf0e6('0x5d')])return;return db[_0xf0e6('0x7d')][_0xf0e6('0x54')]({'where':{'id':_0x4f7ed7[_0xf0e6('0x56')][_0xf0e6('0x5d')],'role':_0xf0e6('0x5f')},'attributes':['id','name',_0xf0e6('0x6d'),_0xf0e6('0x7e'),'internal'],'raw':!![]});}return null;})['then'](function(_0x22f3b5){if(!_0x22f3b5)return null;_0xb39664['message'][_0xf0e6('0x5f')]=_0x22f3b5;return _0xb39664;})['then'](function(_0x4e66ba){if(_0x4e66ba){_0x4e66ba[_0xf0e6('0x27')][_0xf0e6('0x6f')]=util[_0xf0e6('0x5b')](_0xf0e6('0x70'),_0x4f7ed7[_0xf0e6('0x5e')][_0xf0e6('0x37')]);_0x4e66ba[_0xf0e6('0x27')][_0xf0e6('0x71')]=_0xb39664['channel'];_0x4e66ba[_0xf0e6('0x27')][_0xf0e6('0x72')]=_0xb39664[_0xf0e6('0x71')];_0x4e66ba[_0xf0e6('0x27')][_0xf0e6('0x73')]=_0xf0e6('0x33');respondWithRpcPromise('EventManager',_0xf0e6('0x75'),{'event':_0xf0e6('0x7f'),'message':_0x4e66ba[_0xf0e6('0x27')]},client9002);return _0xb39664;}return null;})['then'](respondWithResult(_0x39e58c,null))[_0xf0e6('0x28')](handleError(_0x39e58c,null));};exports['status']=function(_0x246cdb,_0x5ad107,_0xf279bf){if(_0x246cdb[_0xf0e6('0x56')]['id']){delete _0x246cdb[_0xf0e6('0x56')]['id'];}var _0x22d367;return db[_0xf0e6('0x4c')]['find']({'where':{'id':_0x246cdb['params']['id']}})['then'](handleEntityNotFound(_0x5ad107,null))['then'](function(_0x68ac57){if(_0x68ac57){_0x22d367=_0x68ac57;return db[_0xf0e6('0x80')]['find']({'where':{'id':_0x68ac57[_0xf0e6('0x81')]}});}})['then'](handleEntityNotFound(_0x5ad107,null))['then'](function(_0x4b054e){if(_0x4b054e){logger[_0xf0e6('0x22')](_0xf0e6('0x82'),_0xf0e6('0x29'),_0xf0e6('0x83'),_0x4b054e[_0xf0e6('0x3b')],util[_0xf0e6('0x84')](_0x246cdb['body'],{'showHidden':![],'depth':null}));switch(_0x4b054e[_0xf0e6('0x3b')]){case _0xf0e6('0x85'):if(_0x246cdb['body'][_0xf0e6('0x86')]&&_0x246cdb[_0xf0e6('0x56')][_0xf0e6('0x86')]===_0x22d367['messageId']&&_0x246cdb[_0xf0e6('0x56')][_0xf0e6('0x87')]&&_0x246cdb[_0xf0e6('0x56')][_0xf0e6('0x87')]===_0xf0e6('0x59')){return _0x22d367['update']({'read':!![]});}else{logger[_0xf0e6('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xf0e6('0x29'),_0xf0e6('0x85'),util['inspect'](_0x246cdb['body'],{'showHidden':![],'depth':null}));}break;}return _0x22d367;}})[_0xf0e6('0x1e')](respondWithResult(_0x5ad107,null))[_0xf0e6('0x28')](handleError(_0x5ad107,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 09887f0..40f7671 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 _0x065e=['emit','hasOwnProperty','hook','events','save','update','remove'];(function(_0x1dae13,_0x337229){var _0x5ce854=function(_0x367af6){while(--_0x367af6){_0x1dae13['push'](_0x1dae13['shift']());}};_0x5ce854(++_0x337229);}(_0x065e,0x1a7));var _0xe065=function(_0x5972de,_0x2b786b){_0x5972de=_0x5972de-0x0;var _0x5d1f41=_0x065e[_0x5972de];return _0x5d1f41;};'use strict';var EventEmitter=require(_0xe065('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe065('0x1'),'afterUpdate':_0xe065('0x2'),'afterDestroy':_0xe065('0x3')};function emitEvent(_0x4d35bf){return function(_0x4964fa,_0x4610a3,_0x2f90aa){WhatsappMessageEvents['emit'](_0x4d35bf+':'+_0x4964fa['id'],_0x4964fa);WhatsappMessageEvents[_0xe065('0x4')](_0x4d35bf,_0x4964fa);_0x2f90aa(null);};}for(var e in events){if(events[_0xe065('0x5')](e)){var event=events[e];WhatsappMessage[_0xe065('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xb921=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb921,0x16a));var _0x1b92=function(_0x5c942a,_0x4c8872){_0x5c942a=_0x5c942a-0x0;var _0x21c584=_0xb921[_0x5c942a];return _0x21c584;};'use strict';var EventEmitter=require(_0x1b92('0x0'));var WhatsappMessage=require(_0x1b92('0x1'))['db'][_0x1b92('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1b92('0x3')](0x0);var events={'afterCreate':_0x1b92('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x389da0){return function(_0xc3832e,_0x1e49a8,_0x10868d){WhatsappMessageEvents[_0x1b92('0x5')](_0x389da0+':'+_0xc3832e['id'],_0xc3832e);WhatsappMessageEvents[_0x1b92('0x5')](_0x389da0,_0xc3832e);_0x10868d(null);};}for(var e in events){if(events[_0x1b92('0x6')](e)){var event=events[e];WhatsappMessage[_0x1b92('0x7')](e,emitEvent(event));}}module[_0x1b92('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index a2178b1..7e3c870 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 _0x5689=['catch','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes','exports','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','error','out','WhatsappAccount','find','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid'];(function(_0x47ee72,_0x34d075){var _0x309f61=function(_0xd7ec9){while(--_0xd7ec9){_0x47ee72['push'](_0x47ee72['shift']());}};_0x309f61(++_0x34d075);}(_0x5689,0x100));var _0x9568=function(_0x5d06f6,_0x2e9906){_0x5d06f6=_0x5d06f6-0x0;var _0x523b12=_0x5689[_0x5d06f6];return _0x523b12;};'use strict';var _=require(_0x9568('0x0'));var util=require(_0x9568('0x1'));var logger=require(_0x9568('0x2'))(_0x9568('0x3'));var moment=require(_0x9568('0x4'));var BPromise=require(_0x9568('0x5'));var rp=require(_0x9568('0x6'));var fs=require('fs');var path=require(_0x9568('0x7'));var rimraf=require(_0x9568('0x8'));var config=require('../../config/environment');var attributes=require(_0x9568('0x9'));module[_0x9568('0xa')]=function(_0x50f5a3,_0x3e0ce3){return _0x50f5a3['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x9568('0xb'),'fields':['messageId']},{'name':_0x9568('0xc'),'fields':[_0x9568('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x542bdb,_0xaa4732,_0x4129a2){var _0x3daac8=_0x50f5a3[_0x9568('0xe')];var _0x502f99=_0x542bdb[_0x9568('0xf')]({'plain':!![]});if(_0x502f99[_0x9568('0x10')][_0x9568('0x11')]()==='in'||_0x502f99['direction'][_0x9568('0x11')]()==='out'&&!_0x502f99[_0x9568('0x12')]&&!_[_0x9568('0x13')](_0x502f99[_0x9568('0x14')])){_0x3daac8[_0x9568('0x15')][_0x9568('0x16')]({'where':{'id':_0x502f99[_0x9568('0x17')]}})[_0x9568('0x18')](function(_0x4cf381){if(_0x4cf381){_0x4cf381[_0x9568('0x19')]({'lastMsgAt':_0x502f99[_0x9568('0x1a')],'lastMsgDirection':_0x502f99[_0x9568('0x10')]['toLowerCase']()});}})['catch'](function(_0x385448){console[_0x9568('0x1b')](_0x385448);});}if(_0x502f99[_0x9568('0x10')]===_0x9568('0x1c')&&!_0x502f99[_0x9568('0x12')]){var _0x697169;_0x3daac8[_0x9568('0x1d')][_0x9568('0x1e')]({'where':{'id':_0x502f99['WhatsappAccountId']},'raw':!![]})[_0x9568('0x18')](function(_0x36fca6){_0x697169=_0x36fca6;if(_0x697169&&_0x697169[_0x9568('0x1f')]){switch(_0x697169['type']){case _0x9568('0x20'):var _0x1aa3bd=require(_0x9568('0x20'));if(_0x697169[_0x9568('0x21')]&&_0x697169[_0x9568('0x22')]&&_0x697169['phone']){var _0x2c4e6f=new _0x1aa3bd(_0x697169[_0x9568('0x21')],_0x697169[_0x9568('0x22')]);_0x2c4e6f[_0x9568('0x23')][_0x9568('0x24')]({'body':_0x502f99[_0x9568('0xd')],'to':_0x9568('0x25')+_0x502f99[_0x9568('0x26')],'from':_0x9568('0x25')+_0x697169[_0x9568('0x26')],'statusCallback':_0x697169[_0x9568('0x27')]+_0x9568('0x28')+_0x502f99['id']+_0x9568('0x29')+_0x697169[_0x9568('0x2a')]})[_0x9568('0x18')](function(_0x4b97f5){if(_0x4b97f5[_0x9568('0x2b')]){return _0x542bdb[_0x9568('0x19')]({'messageId':_0x4b97f5[_0x9568('0x2b')]});}})[_0x9568('0x2c')](function(_0x2ad271){logger[_0x9568('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9568('0x2d'),_0x9568('0x20'),util[_0x9568('0x2e')](_0x2ad271,{'showHidden':![],'depth':null}));});}else{logger[_0x9568('0x1b')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9568('0x2d'),_0x9568('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x9568('0x2f')](function(){_0x4129a2();});}else{_0x4129a2();}}},'charset':_0x9568('0x30'),'collate':_0x9568('0x31')});}; \ No newline at end of file +var _0x52ae=['direction','toLowerCase','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','out','find','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','finally','utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','whatsapp_messages','messageId','body','FULLTEXT','models','get'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x52ae,0x18f));var _0xe52a=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x52ae[_0x5c2c7c];return _0xea7ffe;};'use strict';var _=require(_0xe52a('0x0'));var util=require(_0xe52a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe52a('0x2'));var rp=require(_0xe52a('0x3'));var fs=require('fs');var path=require(_0xe52a('0x4'));var rimraf=require(_0xe52a('0x5'));var config=require(_0xe52a('0x6'));var attributes=require(_0xe52a('0x7'));module[_0xe52a('0x8')]=function(_0x18ea8d,_0x644b85){return _0x18ea8d['define']('WhatsappMessage',attributes,{'tableName':_0xe52a('0x9'),'paranoid':![],'indexes':[{'name':_0xe52a('0xa'),'fields':[_0xe52a('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0xe52a('0xb')],'type':_0xe52a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x273612,_0x38a413,_0x54fa31){var _0xb0494f=_0x18ea8d[_0xe52a('0xd')];var _0x4a95fb=_0x273612[_0xe52a('0xe')]({'plain':!![]});if(_0x4a95fb[_0xe52a('0xf')][_0xe52a('0x10')]()==='in'||_0x4a95fb['direction'][_0xe52a('0x10')]()==='out'&&!_0x4a95fb['secret']&&!_[_0xe52a('0x11')](_0x4a95fb[_0xe52a('0x12')])){_0xb0494f[_0xe52a('0x13')][_0xe52a('0x14')]({'where':{'id':_0x4a95fb[_0xe52a('0x15')]}})['then'](function(_0x391dfa){if(_0x391dfa){_0x391dfa[_0xe52a('0x16')]({'lastMsgAt':_0x4a95fb[_0xe52a('0x17')],'lastMsgDirection':_0x4a95fb[_0xe52a('0xf')][_0xe52a('0x10')]()});}})[_0xe52a('0x18')](function(_0x573c13){console[_0xe52a('0x19')](_0x573c13);});}if(_0x4a95fb[_0xe52a('0xf')]===_0xe52a('0x1a')&&!_0x4a95fb['secret']){var _0x28ee76;_0xb0494f['WhatsappAccount'][_0xe52a('0x1b')]({'where':{'id':_0x4a95fb['WhatsappAccountId']},'raw':!![]})['then'](function(_0x319290){_0x28ee76=_0x319290;if(_0x28ee76&&_0x28ee76[_0xe52a('0x1c')]){switch(_0x28ee76[_0xe52a('0x1c')]){case _0xe52a('0x1d'):var _0x1bc616=require(_0xe52a('0x1d'));if(_0x28ee76[_0xe52a('0x1e')]&&_0x28ee76[_0xe52a('0x1f')]&&_0x28ee76[_0xe52a('0x20')]){var _0x3429ac=new _0x1bc616(_0x28ee76[_0xe52a('0x1e')],_0x28ee76[_0xe52a('0x1f')]);_0x3429ac[_0xe52a('0x21')][_0xe52a('0x22')]({'body':_0x4a95fb['body'],'to':'whatsapp:'+_0x4a95fb[_0xe52a('0x20')],'from':_0xe52a('0x23')+_0x28ee76[_0xe52a('0x20')],'statusCallback':_0x28ee76[_0xe52a('0x24')]+_0xe52a('0x25')+_0x4a95fb['id']+_0xe52a('0x26')+_0x28ee76[_0xe52a('0x27')]})[_0xe52a('0x28')](function(_0x12924b){if(_0x12924b[_0xe52a('0x29')]){return _0x273612['update']({'messageId':_0x12924b[_0xe52a('0x29')]});}})[_0xe52a('0x18')](function(_0x4a7ec3){logger['error'](_0xe52a('0x2a'),_0xe52a('0x2b'),_0xe52a('0x1d'),util['inspect'](_0x4a7ec3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe52a('0x2a'),_0xe52a('0x2b'),_0xe52a('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0xe52a('0x2c')](function(){_0x54fa31();});}else{_0x54fa31();}}},'charset':_0xe52a('0x2d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index bb236ae..80d0f78 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 _0x2c89=['http','redis','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','body','options','raw','CreateWhatsappMessage','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x669aed,_0x3e0344){var _0x3a388d=function(_0x233e16){while(--_0x233e16){_0x669aed['push'](_0x669aed['shift']());}};_0x3a388d(++_0x3e0344);}(_0x2c89,0x154));var _0x92c8=function(_0x1fe327,_0x1f8b59){_0x1fe327=_0x1fe327-0x0;var _0x583734=_0x2c89[_0x1fe327];return _0x583734;};'use strict';var _=require('lodash');var util=require(_0x92c8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x92c8('0x1'));var fs=require('fs');var Redis=require(_0x92c8('0x2'));var db=require(_0x92c8('0x3'))['db'];var utils=require(_0x92c8('0x4'));var logger=require('../../config/logger')(_0x92c8('0x5'));var config=require(_0x92c8('0x6'));var jayson=require(_0x92c8('0x7'));var client=jayson['client'][_0x92c8('0x8')]({'port':0x232a});config[_0x92c8('0x9')]=_['defaults'](config[_0x92c8('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x92c8('0x9')]));require(_0x92c8('0xa'))[_0x92c8('0xb')](socket);function respondWithRpcPromise(_0x5bb458,_0x13fa51,_0x2e4d5e){return new BPromise(function(_0x14af9b,_0x425138){return client[_0x92c8('0xc')](_0x5bb458,_0x2e4d5e)[_0x92c8('0xd')](function(_0x2a27b3){logger[_0x92c8('0xe')](_0x92c8('0xf'),_0x13fa51,_0x92c8('0x10'));logger[_0x92c8('0x11')](_0x92c8('0x12'),_0x13fa51,_0x92c8('0x10'),JSON[_0x92c8('0x13')](_0x2a27b3));if(_0x2a27b3[_0x92c8('0x14')]){if(_0x2a27b3[_0x92c8('0x14')][_0x92c8('0x15')]===0x1f4){logger[_0x92c8('0x14')](_0x92c8('0xf'),_0x13fa51,_0x2a27b3[_0x92c8('0x14')][_0x92c8('0x16')]);return _0x425138(_0x2a27b3[_0x92c8('0x14')]['message']);}logger[_0x92c8('0x14')](_0x92c8('0xf'),_0x13fa51,_0x2a27b3[_0x92c8('0x14')][_0x92c8('0x16')]);return _0x14af9b(_0x2a27b3[_0x92c8('0x14')][_0x92c8('0x16')]);}else{logger['info'](_0x92c8('0xf'),_0x13fa51,_0x92c8('0x10'));_0x14af9b(_0x2a27b3['result']['message']);}})[_0x92c8('0x17')](function(_0x3b264e){logger[_0x92c8('0x14')](_0x92c8('0xf'),_0x13fa51,_0x3b264e);_0x425138(_0x3b264e);});});}exports['CreateWhatsappMessage']=function(_0x447b53){var _0x494aed=this;return new Promise(function(_0x324563,_0x4c9c33){return db['WhatsappMessage'][_0x92c8('0x18')](_0x447b53[_0x92c8('0x19')],{'raw':_0x447b53['options']?_0x447b53[_0x92c8('0x1a')][_0x92c8('0x1b')]===undefined?!![]:![]:!![]})[_0x92c8('0xd')](function(_0xfbcaff){logger[_0x92c8('0xe')](_0x92c8('0x1c'),_0x447b53);logger[_0x92c8('0x11')](_0x92c8('0x1c'),_0x447b53,JSON[_0x92c8('0x13')](_0xfbcaff));_0x324563(_0xfbcaff);})['catch'](function(_0x2c7001){logger[_0x92c8('0x14')](_0x92c8('0x1c'),_0x2c7001[_0x92c8('0x16')],_0x447b53);_0x4c9c33(_0x494aed[_0x92c8('0x14')](0x1f4,_0x2c7001[_0x92c8('0x16')]));});});}; \ No newline at end of file +var _0x1ef0=['localhost','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','body','options','raw','debug','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','redis','defaults'];(function(_0x3ce4e6,_0x57b7e0){var _0x9bc05c=function(_0x5474d0){while(--_0x5474d0){_0x3ce4e6['push'](_0x3ce4e6['shift']());}};_0x9bc05c(++_0x57b7e0);}(_0x1ef0,0xdf));var _0x01ef=function(_0x314d99,_0xb8c0df){_0x314d99=_0x314d99-0x0;var _0x31d8c4=_0x1ef0[_0x314d99];return _0x31d8c4;};'use strict';var _=require(_0x01ef('0x0'));var util=require(_0x01ef('0x1'));var moment=require(_0x01ef('0x2'));var BPromise=require('bluebird');var rs=require(_0x01ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x01ef('0x4'));var logger=require(_0x01ef('0x5'))('rpc');var config=require(_0x01ef('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x01ef('0x7')]=_[_0x01ef('0x8')](config[_0x01ef('0x7')],{'host':_0x01ef('0x9'),'port':0x18eb});var socket=require(_0x01ef('0xa'))(new Redis(config[_0x01ef('0x7')]));require('./whatsappMessage.socket')[_0x01ef('0xb')](socket);function respondWithRpcPromise(_0x2bce91,_0x5a7c35,_0x4722a4){return new BPromise(function(_0x38420e,_0x4f1865){return client[_0x01ef('0xc')](_0x2bce91,_0x4722a4)[_0x01ef('0xd')](function(_0x3f8613){logger[_0x01ef('0xe')](_0x01ef('0xf'),_0x5a7c35,_0x01ef('0x10'));logger['debug'](_0x01ef('0x11'),_0x5a7c35,'request\x20sent',JSON[_0x01ef('0x12')](_0x3f8613));if(_0x3f8613[_0x01ef('0x13')]){if(_0x3f8613[_0x01ef('0x13')]['code']===0x1f4){logger[_0x01ef('0x13')](_0x01ef('0xf'),_0x5a7c35,_0x3f8613['error'][_0x01ef('0x14')]);return _0x4f1865(_0x3f8613[_0x01ef('0x13')][_0x01ef('0x14')]);}logger[_0x01ef('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x5a7c35,_0x3f8613[_0x01ef('0x13')][_0x01ef('0x14')]);return _0x38420e(_0x3f8613[_0x01ef('0x13')][_0x01ef('0x14')]);}else{logger[_0x01ef('0xe')](_0x01ef('0xf'),_0x5a7c35,'request\x20sent');_0x38420e(_0x3f8613[_0x01ef('0x15')][_0x01ef('0x14')]);}})['catch'](function(_0x230f73){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5a7c35,_0x230f73);_0x4f1865(_0x230f73);});});}exports[_0x01ef('0x16')]=function(_0x555e06){var _0x4dbd25=this;return new Promise(function(_0x11fcd6,_0x2c235a){return db[_0x01ef('0x17')]['create'](_0x555e06[_0x01ef('0x18')],{'raw':_0x555e06[_0x01ef('0x19')]?_0x555e06[_0x01ef('0x19')][_0x01ef('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4ab4e5){logger['info'](_0x01ef('0x16'),_0x555e06);logger[_0x01ef('0x1b')]('CreateWhatsappMessage',_0x555e06,JSON['stringify'](_0x4ab4e5));_0x11fcd6(_0x4ab4e5);})[_0x01ef('0x1c')](function(_0x9d5bce){logger[_0x01ef('0x13')](_0x01ef('0x16'),_0x9d5bce['message'],_0x555e06);_0x2c235a(_0x4dbd25[_0x01ef('0x13')](0x1f4,_0x9d5bce['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 69ac5cc..ddb1b9f 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 _0x4877=['whatsappMessage:','./whatsappMessage.events','update','emit','length'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x4877,0xf1));var _0x7487=function(_0x4637f5,_0x1f5a1a){_0x4637f5=_0x4637f5-0x0;var _0x485a18=_0x4877[_0x4637f5];return _0x485a18;};'use strict';var WhatsappMessageEvents=require(_0x7487('0x0'));var events=['save','remove',_0x7487('0x1')];function createListener(_0x4c44e0,_0x12e785){return function(_0x393e7f){_0x12e785[_0x7487('0x2')](_0x4c44e0,_0x393e7f);};}function removeListener(_0x4dc015,_0x33edcc){return function(){WhatsappMessageEvents['removeListener'](_0x4dc015,_0x33edcc);};}exports['register']=function(_0x274205){for(var _0x155171=0x0,_0x1bbb86=events[_0x7487('0x3')];_0x155171<_0x1bbb86;_0x155171++){var _0x1074fc=events[_0x155171];var _0x32bfdc=createListener(_0x7487('0x4')+_0x1074fc,_0x274205);WhatsappMessageEvents['on'](_0x1074fc,_0x32bfdc);}}; \ No newline at end of file +var _0xb947=['length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x115683,_0x4a1c36){var _0x5715b0=function(_0x17a343){while(--_0x17a343){_0x115683['push'](_0x115683['shift']());}};_0x5715b0(++_0x4a1c36);}(_0xb947,0x1cd));var _0x7b94=function(_0x3ecd56,_0x5841d2){_0x3ecd56=_0x3ecd56-0x0;var _0x4d9d77=_0xb947[_0x3ecd56];return _0x4d9d77;};'use strict';var WhatsappMessageEvents=require(_0x7b94('0x0'));var events=[_0x7b94('0x1'),_0x7b94('0x2'),_0x7b94('0x3')];function createListener(_0x5279d9,_0x8dde8b){return function(_0x397544){_0x8dde8b[_0x7b94('0x4')](_0x5279d9,_0x397544);};}function removeListener(_0x5f44d3,_0x365f42){return function(){WhatsappMessageEvents[_0x7b94('0x5')](_0x5f44d3,_0x365f42);};}exports[_0x7b94('0x6')]=function(_0x3322b5){for(var _0xfb0de=0x0,_0x37bc5b=events[_0x7b94('0x7')];_0xfb0de<_0x37bc5b;_0xfb0de++){var _0x30f2f0=events[_0xfb0de];var _0x313c31=createListener(_0x7b94('0x8')+_0x30f2f0,_0x3322b5);WhatsappMessageEvents['on'](_0x30f2f0,_0x313c31);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index d9ba424..fb74025 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 _0x3373=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post','addAgents','put','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3ddd8f,_0x494768){var _0x1cb9c7=function(_0x8af683){while(--_0x8af683){_0x3ddd8f['push'](_0x3ddd8f['shift']());}};_0x1cb9c7(++_0x494768);}(_0x3373,0x11b));var _0x3337=function(_0x469614,_0x2668b7){_0x469614=_0x469614-0x0;var _0x5471d2=_0x3373[_0x469614];return _0x5471d2;};'use strict';var multer=require(_0x3337('0x0'));var util=require(_0x3337('0x1'));var path=require(_0x3337('0x2'));var timeout=require(_0x3337('0x3'));var express=require(_0x3337('0x4'));var router=express[_0x3337('0x5')]();var fs_extra=require(_0x3337('0x6'));var auth=require(_0x3337('0x7'));var interaction=require(_0x3337('0x8'));var config=require(_0x3337('0x9'));var controller=require(_0x3337('0xa'));router['get']('/',auth[_0x3337('0xb')](),controller[_0x3337('0xc')]);router[_0x3337('0xd')](_0x3337('0xe'),auth['isAuthenticated'](),controller[_0x3337('0xf')]);router[_0x3337('0xd')](_0x3337('0x10'),auth['isAuthenticated'](),controller[_0x3337('0x11')]);router[_0x3337('0xd')]('/:id/members',auth[_0x3337('0xb')](),controller[_0x3337('0x12')]);router[_0x3337('0xd')](_0x3337('0x13'),auth[_0x3337('0xb')](),controller[_0x3337('0x14')]);router['get'](_0x3337('0x15'),auth[_0x3337('0xb')](),controller['getAgents']);router[_0x3337('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3337('0x16')](_0x3337('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x3337('0x16')](_0x3337('0x15'),auth[_0x3337('0xb')](),controller[_0x3337('0x17')]);router[_0x3337('0x18')](_0x3337('0x10'),auth['isAuthenticated'](),controller[_0x3337('0x19')]);router[_0x3337('0x1a')](_0x3337('0x10'),auth[_0x3337('0xb')](),controller[_0x3337('0x1b')]);router['delete'](_0x3337('0x13'),auth[_0x3337('0xb')](),controller[_0x3337('0x1c')]);router[_0x3337('0x1a')](_0x3337('0x15'),auth[_0x3337('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x6dfd=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x6dfd,0x17d));var _0xd6df=function(_0x53589c,_0x5768fd){_0x53589c=_0x53589c-0x0;var _0x2726ed=_0x6dfd[_0x53589c];return _0x2726ed;};'use strict';var multer=require(_0xd6df('0x0'));var util=require(_0xd6df('0x1'));var path=require(_0xd6df('0x2'));var timeout=require(_0xd6df('0x3'));var express=require(_0xd6df('0x4'));var router=express['Router']();var fs_extra=require(_0xd6df('0x5'));var auth=require(_0xd6df('0x6'));var interaction=require(_0xd6df('0x7'));var config=require(_0xd6df('0x8'));var controller=require(_0xd6df('0x9'));router['get']('/',auth[_0xd6df('0xa')](),controller['index']);router[_0xd6df('0xb')](_0xd6df('0xc'),auth[_0xd6df('0xa')](),controller[_0xd6df('0xd')]);router[_0xd6df('0xb')](_0xd6df('0xe'),auth[_0xd6df('0xa')](),controller[_0xd6df('0xf')]);router[_0xd6df('0xb')](_0xd6df('0x10'),auth[_0xd6df('0xa')](),controller[_0xd6df('0x11')]);router['get'](_0xd6df('0x12'),auth[_0xd6df('0xa')](),controller[_0xd6df('0x13')]);router['get']('/:id/users',auth[_0xd6df('0xa')](),controller[_0xd6df('0x14')]);router[_0xd6df('0x15')]('/',auth['isAuthenticated'](),controller[_0xd6df('0x16')]);router[_0xd6df('0x15')](_0xd6df('0x12'),auth[_0xd6df('0xa')](),controller[_0xd6df('0x17')]);router['post'](_0xd6df('0x18'),auth['isAuthenticated'](),controller[_0xd6df('0x19')]);router[_0xd6df('0x1a')](_0xd6df('0xe'),auth[_0xd6df('0xa')](),controller[_0xd6df('0x1b')]);router[_0xd6df('0x1c')](_0xd6df('0xe'),auth[_0xd6df('0xa')](),controller['destroy']);router[_0xd6df('0x1c')](_0xd6df('0x12'),auth['isAuthenticated'](),controller[_0xd6df('0x1d')]);router[_0xd6df('0x1c')](_0xd6df('0x18'),auth[_0xd6df('0xa')](),controller[_0xd6df('0x1e')]);module[_0xd6df('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 7665de1..b5cdd41 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 _0x220b=['name','INTEGER','rrmemory','roundrobin','exports','STRING'];(function(_0x39486e,_0x473a36){var _0x9411e4=function(_0x2b937f){while(--_0x2b937f){_0x39486e['push'](_0x39486e['shift']());}};_0x9411e4(++_0x473a36);}(_0x220b,0x1a2));var _0xb220=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x220b[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xb220('0x0')]={'name':{'type':Sequelize[_0xb220('0x1')],'unique':_0xb220('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb220('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb220('0x4'),'beepall',_0xb220('0x5'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb2b3=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0xb2b3,0x71));var _0x3b2b=function(_0x46b4eb,_0x517ec9){_0x46b4eb=_0x46b4eb-0x0;var _0x5cbb80=_0xb2b3[_0x46b4eb];return _0x5cbb80;};'use strict';var Sequelize=require(_0x3b2b('0x0'));module[_0x3b2b('0x1')]={'name':{'type':Sequelize[_0x3b2b('0x2')],'unique':_0x3b2b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3b2b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3b2b('0x5')](_0x3b2b('0x6'),'beepall',_0x3b2b('0x7'))},'description':{'type':Sequelize[_0x3b2b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7916218..17ab5b8 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 _0x4dcd=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','WhatsappQueue','include','findAll','rows','show','keys','intersection','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserWhatsappQueue','User','UserId','agent','whatsappPause','createdAt','format','SIP','getTeams','Team','ids','Agents','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','WhatsappQueues','error','name','index','map','rawAttributes','fieldName','key','model','query'];(function(_0x3fcfc2,_0x53a3b1){var _0x372907=function(_0x6cbe1a){while(--_0x6cbe1a){_0x3fcfc2['push'](_0x3fcfc2['shift']());}};_0x372907(++_0x53a3b1);}(_0x4dcd,0x16c));var _0xd4dc=function(_0x12892e,_0x3857cf){_0x12892e=_0x12892e-0x0;var _0x1fcd04=_0x4dcd[_0x12892e];return _0x1fcd04;};'use strict';var emlformat=require(_0xd4dc('0x0'));var rimraf=require(_0xd4dc('0x1'));var zipdir=require(_0xd4dc('0x2'));var jsonpatch=require(_0xd4dc('0x3'));var rp=require(_0xd4dc('0x4'));var moment=require(_0xd4dc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd4dc('0x6'));var util=require(_0xd4dc('0x7'));var path=require(_0xd4dc('0x8'));var sox=require(_0xd4dc('0x9'));var csv=require(_0xd4dc('0xa'));var ejs=require(_0xd4dc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4dc('0xc'));var squel=require('squel');var crypto=require(_0xd4dc('0xd'));var jsforce=require(_0xd4dc('0xe'));var deskjs=require(_0xd4dc('0xf'));var toCsv=require(_0xd4dc('0xa'));var querystring=require(_0xd4dc('0x10'));var Papa=require(_0xd4dc('0x11'));var Redis=require(_0xd4dc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd4dc('0x13'));var as=require(_0xd4dc('0x14'));var hardwareService=require(_0xd4dc('0x15'));var logger=require(_0xd4dc('0x16'))(_0xd4dc('0x17'));var utils=require('../../config/utils');var config=require(_0xd4dc('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd4dc('0x19')](config[_0xd4dc('0x1a')],{'host':_0xd4dc('0x1b'),'port':0x18eb});var socket=require(_0xd4dc('0x1c'))(new Redis(config[_0xd4dc('0x1a')]));require(_0xd4dc('0x1d'))[_0xd4dc('0x1e')](socket);function respondWithStatusCode(_0x474cc4,_0x500070){_0x500070=_0x500070||0xcc;return function(_0x46f266){if(_0x46f266){return _0x474cc4[_0xd4dc('0x1f')](_0x500070);}return _0x474cc4[_0xd4dc('0x20')](_0x500070)['end']();};}function respondWithResult(_0x5e832e,_0x151f35){_0x151f35=_0x151f35||0xc8;return function(_0x59b123){if(_0x59b123){return _0x5e832e[_0xd4dc('0x20')](_0x151f35)[_0xd4dc('0x21')](_0x59b123);}};}function respondWithFilteredResult(_0x7e8e7e,_0x4be9de){return function(_0x37d142){if(_0x37d142){var _0xda73db=typeof _0x4be9de[_0xd4dc('0x22')]===_0xd4dc('0x23')&&typeof _0x4be9de[_0xd4dc('0x24')]==='undefined';var _0x1a7bc4=_0x37d142[_0xd4dc('0x25')];var _0x2bbd96=_0xda73db?0x0:_0x4be9de[_0xd4dc('0x22')];var _0x3b9d6a=_0xda73db?_0x37d142['count']:_0x4be9de['offset']+_0x4be9de['limit'];var _0x58c1bb;if(_0x3b9d6a>=_0x1a7bc4){_0x3b9d6a=_0x1a7bc4;_0x58c1bb=0xc8;}else{_0x58c1bb=0xce;}_0x7e8e7e[_0xd4dc('0x20')](_0x58c1bb);return _0x7e8e7e[_0xd4dc('0x26')](_0xd4dc('0x27'),_0x2bbd96+'-'+_0x3b9d6a+'/'+_0x1a7bc4)[_0xd4dc('0x21')](_0x37d142);}return null;};}function patchUpdates(_0x16f718){return function(_0x34839c){try{jsonpatch[_0xd4dc('0x28')](_0x34839c,_0x16f718,!![]);}catch(_0x3c11c5){return BPromise[_0xd4dc('0x29')](_0x3c11c5);}return _0x34839c[_0xd4dc('0x2a')]();};}function saveUpdates(_0x2eca8e,_0x58366a){return function(_0x568ac1){if(_0x568ac1){return _0x568ac1['update'](_0x2eca8e)[_0xd4dc('0x2b')](function(_0x9077ee){return _0x9077ee;});}return null;};}function removeEntity(_0x3f753e,_0x40dd29){return function(_0x3ccddf){if(_0x3ccddf){return _0x3ccddf[_0xd4dc('0x2c')]()[_0xd4dc('0x2b')](function(){var _0x3578f5=_0x3ccddf[_0xd4dc('0x2d')]({'plain':!![]});var _0x1487c2=_0xd4dc('0x2e');return db['UserProfileResource'][_0xd4dc('0x2c')]({'where':{'type':_0x1487c2,'resourceId':_0x3578f5['id']}})['then'](function(){return _0x3ccddf;});})[_0xd4dc('0x2b')](function(){_0x3f753e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x316e7e,_0x2768a9){return function(_0x442998){if(!_0x442998){_0x316e7e['sendStatus'](0x194);}return _0x442998;};}function handleError(_0x4870bf,_0x3cb36b){_0x3cb36b=_0x3cb36b||0x1f4;return function(_0x46f181){logger[_0xd4dc('0x2f')](_0x46f181['stack']);if(_0x46f181[_0xd4dc('0x30')]){delete _0x46f181[_0xd4dc('0x30')];}_0x4870bf[_0xd4dc('0x20')](_0x3cb36b)['send'](_0x46f181);};}exports[_0xd4dc('0x31')]=function(_0x34afb8,_0x375389){var _0x37704c={},_0x5eb636={},_0x178330={'count':0x0,'rows':[]};var _0x287be1=_[_0xd4dc('0x32')](db['WhatsappQueue'][_0xd4dc('0x33')],function(_0x557eac){return{'name':_0x557eac[_0xd4dc('0x34')],'type':_0x557eac['type'][_0xd4dc('0x35')]};});_0x5eb636[_0xd4dc('0x36')]=_[_0xd4dc('0x32')](_0x287be1,_0xd4dc('0x30'));_0x5eb636[_0xd4dc('0x37')]=_['keys'](_0x34afb8[_0xd4dc('0x37')]);_0x5eb636['filters']=_['intersection'](_0x5eb636[_0xd4dc('0x36')],_0x5eb636['query']);_0x37704c[_0xd4dc('0x38')]=_['intersection'](_0x5eb636[_0xd4dc('0x36')],qs[_0xd4dc('0x39')](_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x39')]));_0x37704c[_0xd4dc('0x38')]=_0x37704c[_0xd4dc('0x38')][_0xd4dc('0x3a')]?_0x37704c[_0xd4dc('0x38')]:_0x5eb636[_0xd4dc('0x36')];if(!_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x3b')](_0xd4dc('0x3c'))){_0x37704c[_0xd4dc('0x24')]=qs[_0xd4dc('0x24')](_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x24')]);_0x37704c['offset']=qs[_0xd4dc('0x22')](_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x22')]);}_0x37704c[_0xd4dc('0x3d')]=qs['sort'](_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x3e')]);_0x37704c[_0xd4dc('0x3f')]=qs['filters'](_[_0xd4dc('0x40')](_0x34afb8[_0xd4dc('0x37')],_0x5eb636[_0xd4dc('0x41')]),_0x287be1);if(_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x42')]){_0x37704c[_0xd4dc('0x3f')]=_[_0xd4dc('0x43')](_0x37704c[_0xd4dc('0x3f')],{'$or':_[_0xd4dc('0x32')](_0x287be1,function(_0x5529bb){if(_0x5529bb['type']!==_0xd4dc('0x44')){var _0x6a803f={};_0x6a803f[_0x5529bb['name']]={'$like':'%'+_0x34afb8[_0xd4dc('0x37')][_0xd4dc('0x42')]+'%'};return _0x6a803f;}})});}_0x37704c=_[_0xd4dc('0x43')]({},_0x37704c,_0x34afb8[_0xd4dc('0x45')]);var _0x8ad8b0={'where':_0x37704c[_0xd4dc('0x3f')]};return db[_0xd4dc('0x46')][_0xd4dc('0x25')](_0x8ad8b0)['then'](function(_0x409854){_0x178330[_0xd4dc('0x25')]=_0x409854;if(_0x34afb8[_0xd4dc('0x37')]['includeAll']){_0x37704c[_0xd4dc('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xd4dc('0x48')](_0x37704c);})[_0xd4dc('0x2b')](function(_0x4870d7){_0x178330[_0xd4dc('0x49')]=_0x4870d7;return _0x178330;})[_0xd4dc('0x2b')](respondWithFilteredResult(_0x375389,_0x37704c))['catch'](handleError(_0x375389,null));};exports[_0xd4dc('0x4a')]=function(_0x4238b5,_0x182b09){var _0x47051c={'raw':!![],'where':{'id':_0x4238b5['params']['id']}},_0x15306f={};_0x15306f[_0xd4dc('0x36')]=_['keys'](db[_0xd4dc('0x46')][_0xd4dc('0x33')]);_0x15306f[_0xd4dc('0x37')]=_[_0xd4dc('0x4b')](_0x4238b5[_0xd4dc('0x37')]);_0x15306f['filters']=_['intersection'](_0x15306f[_0xd4dc('0x36')],_0x15306f[_0xd4dc('0x37')]);_0x47051c[_0xd4dc('0x38')]=_[_0xd4dc('0x4c')](_0x15306f['model'],qs[_0xd4dc('0x39')](_0x4238b5[_0xd4dc('0x37')][_0xd4dc('0x39')]));_0x47051c[_0xd4dc('0x38')]=_0x47051c[_0xd4dc('0x38')]['length']?_0x47051c[_0xd4dc('0x38')]:_0x15306f[_0xd4dc('0x36')];if(_0x4238b5['query'][_0xd4dc('0x4d')]){_0x47051c[_0xd4dc('0x47')]=[{'all':!![]}];}_0x47051c=_[_0xd4dc('0x43')]({},_0x47051c,_0x4238b5['options']);return db[_0xd4dc('0x46')][_0xd4dc('0x4e')](_0x47051c)[_0xd4dc('0x2b')](handleEntityNotFound(_0x182b09,null))[_0xd4dc('0x2b')](respondWithResult(_0x182b09,null))[_0xd4dc('0x4f')](handleError(_0x182b09,null));};exports[_0xd4dc('0x50')]=function(_0x31a414,_0x4f60ed){return db['WhatsappQueue'][_0xd4dc('0x50')](_0x31a414[_0xd4dc('0x51')],{})['then'](function(_0x33b99d){var _0x34adf1=_0x31a414[_0xd4dc('0x52')][_0xd4dc('0x2d')]({'plain':!![]});if(!_0x34adf1)throw new Error(_0xd4dc('0x53'));if(_0x34adf1['role']==='user'){var _0x4b27cd=_0x33b99d[_0xd4dc('0x2d')]({'plain':!![]});var _0x2ee596=_0xd4dc('0x2e');return db[_0xd4dc('0x54')][_0xd4dc('0x4e')]({'where':{'name':_0x2ee596,'userProfileId':_0x34adf1[_0xd4dc('0x55')]},'raw':!![]})[_0xd4dc('0x2b')](function(_0x558347){if(_0x558347&&_0x558347[_0xd4dc('0x56')]===0x0){return db[_0xd4dc('0x57')][_0xd4dc('0x50')]({'name':_0x4b27cd[_0xd4dc('0x30')],'resourceId':_0x4b27cd['id'],'type':_0x558347['name'],'sectionId':_0x558347['id']},{})[_0xd4dc('0x2b')](function(){return _0x33b99d;});}else{return _0x33b99d;}})[_0xd4dc('0x4f')](function(_0x51d8f5){logger['error'](_0xd4dc('0x58'),_0x51d8f5);throw _0x51d8f5;});}return _0x33b99d;})[_0xd4dc('0x2b')](respondWithResult(_0x4f60ed,0xc9))[_0xd4dc('0x4f')](handleError(_0x4f60ed,null));};exports[_0xd4dc('0x59')]=function(_0x370d4d,_0x366b87){if(_0x370d4d[_0xd4dc('0x51')]['id']){delete _0x370d4d['body']['id'];}return db[_0xd4dc('0x46')][_0xd4dc('0x4e')]({'where':{'id':_0x370d4d['params']['id']}})['then'](handleEntityNotFound(_0x366b87,null))[_0xd4dc('0x2b')](saveUpdates(_0x370d4d['body'],null))[_0xd4dc('0x2b')](respondWithResult(_0x366b87,null))['catch'](handleError(_0x366b87,null));};exports[_0xd4dc('0x2c')]=function(_0x478bd0,_0x32ef94){return db[_0xd4dc('0x46')][_0xd4dc('0x4e')]({'where':{'id':_0x478bd0[_0xd4dc('0x5a')]['id']}})[_0xd4dc('0x2b')](handleEntityNotFound(_0x32ef94,null))[_0xd4dc('0x2b')](removeEntity(_0x32ef94,null))[_0xd4dc('0x4f')](handleError(_0x32ef94,null));};exports[_0xd4dc('0x5b')]=function(_0x111441,_0x58506e){return db[_0xd4dc('0x46')][_0xd4dc('0x5b')]()['then'](respondWithResult(_0x58506e,null))[_0xd4dc('0x4f')](handleError(_0x58506e,null));};exports[_0xd4dc('0x5c')]=function(_0x17e8e7,_0x3b0fc4,_0x39882d){var _0x42eef7={'raw':!![],'where':{}},_0x2bb65b={},_0x4774ae;return db[_0xd4dc('0x46')][_0xd4dc('0x5d')]({'where':{'id':_0x17e8e7[_0xd4dc('0x5a')]['id']}})[_0xd4dc('0x2b')](handleEntityNotFound(_0x3b0fc4,null))[_0xd4dc('0x2b')](function(_0x20b2f2){if(_0x20b2f2){_0x4774ae=_0x20b2f2[_0xd4dc('0x2d')]({'plain':!![]});_0x2bb65b[_0xd4dc('0x36')]=_[_0xd4dc('0x4b')](db[_0xd4dc('0x5e')][_0xd4dc('0x33')]);_0x2bb65b[_0xd4dc('0x37')]=_[_0xd4dc('0x4b')](_0x17e8e7['query']);_0x2bb65b['filters']=_[_0xd4dc('0x4c')](_0x2bb65b[_0xd4dc('0x36')],_0x2bb65b[_0xd4dc('0x37')]);_0x42eef7['attributes']=_[_0xd4dc('0x4c')](_0x2bb65b[_0xd4dc('0x36')],qs[_0xd4dc('0x39')](_0x17e8e7[_0xd4dc('0x37')][_0xd4dc('0x39')]));_0x42eef7[_0xd4dc('0x38')]=_0x42eef7['attributes'][_0xd4dc('0x3a')]?_0x42eef7[_0xd4dc('0x38')]:_0x2bb65b['model'];if(!_0x17e8e7[_0xd4dc('0x37')]['hasOwnProperty']('nolimit')){_0x42eef7['limit']=qs[_0xd4dc('0x24')](_0x17e8e7[_0xd4dc('0x37')][_0xd4dc('0x24')]);_0x42eef7[_0xd4dc('0x22')]=qs[_0xd4dc('0x22')](_0x17e8e7[_0xd4dc('0x37')][_0xd4dc('0x22')]);}_0x42eef7[_0xd4dc('0x3d')]=qs[_0xd4dc('0x3e')](_0x17e8e7[_0xd4dc('0x37')]['sort']);_0x42eef7[_0xd4dc('0x3f')]=qs['filters'](_['pick'](_0x17e8e7[_0xd4dc('0x37')],_0x2bb65b[_0xd4dc('0x41')]));_0x42eef7[_0xd4dc('0x3f')]['WhatsappQueueId']=_0x20b2f2['id'];if(_0x17e8e7['query'][_0xd4dc('0x42')]){_0x42eef7[_0xd4dc('0x3f')]=_[_0xd4dc('0x43')](_0x42eef7[_0xd4dc('0x3f')],{'$or':_[_0xd4dc('0x32')](_0x42eef7[_0xd4dc('0x38')],function(_0x1006b4){var _0x99181d={};_0x99181d[_0x1006b4]={'$like':'%'+_0x17e8e7[_0xd4dc('0x37')][_0xd4dc('0x42')]+'%'};return _0x99181d;})});}_0x42eef7=_['merge']({},_0x42eef7,_0x17e8e7[_0xd4dc('0x45')]);return db['UserWhatsappQueue']['findAll'](_0x42eef7);}})[_0xd4dc('0x2b')](function(_0x1f52d5){if(_0x1f52d5){return db[_0xd4dc('0x5f')]['findAndCountAll']({'where':{'id':_[_0xd4dc('0x32')](_0x1f52d5,_0xd4dc('0x60')),'role':_0xd4dc('0x61')},'attributes':['id',_0xd4dc('0x30'),_0xd4dc('0x62'),'updatedAt',_0xd4dc('0x63')]});}})[_0xd4dc('0x2b')](function(_0x34d3cd){if(_0x34d3cd){return{'count':_0x34d3cd[_0xd4dc('0x25')],'rows':_[_0xd4dc('0x32')](_0x34d3cd['rows'],function(_0x9b6675){return{'membername':_0x9b6675[_0xd4dc('0x30')],'UserId':_0x9b6675['id'],'queue_name':_0x4774ae[_0xd4dc('0x30')],'WhatsappQueueId':_0x4774ae['id'],'interface':util[_0xd4dc('0x64')]('%s/%s',_0xd4dc('0x65'),_0x9b6675[_0xd4dc('0x30')]),'penalty':0x0,'paused':_0x9b6675[_0xd4dc('0x62')],'createdAt':_0x9b6675['createdAt'],'updatedAt':_0x9b6675['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd4dc('0x2b')](respondWithFilteredResult(_0x3b0fc4,_0x42eef7))['catch'](handleError(_0x3b0fc4,null));};exports[_0xd4dc('0x66')]=function(_0x48a3b0,_0x386190,_0xfd8139){var _0x52d05b={};var _0x1fe4c0={};var _0xe0d90b;var _0x21700f;return db[_0xd4dc('0x46')][_0xd4dc('0x5d')]({'where':{'id':_0x48a3b0[_0xd4dc('0x5a')]['id']}})[_0xd4dc('0x2b')](handleEntityNotFound(_0x386190,null))['then'](function(_0x4de8ae){if(_0x4de8ae){_0xe0d90b=_0x4de8ae;_0x1fe4c0[_0xd4dc('0x36')]=_[_0xd4dc('0x4b')](db[_0xd4dc('0x67')][_0xd4dc('0x33')]);_0x1fe4c0[_0xd4dc('0x37')]=_[_0xd4dc('0x4b')](_0x48a3b0[_0xd4dc('0x37')]);_0x1fe4c0['filters']=_[_0xd4dc('0x4c')](_0x1fe4c0[_0xd4dc('0x36')],_0x1fe4c0[_0xd4dc('0x37')]);_0x52d05b[_0xd4dc('0x38')]=_[_0xd4dc('0x4c')](_0x1fe4c0[_0xd4dc('0x36')],qs[_0xd4dc('0x39')](_0x48a3b0[_0xd4dc('0x37')]['fields']));_0x52d05b[_0xd4dc('0x38')]=_0x52d05b['attributes'][_0xd4dc('0x3a')]?_0x52d05b[_0xd4dc('0x38')]:_0x1fe4c0[_0xd4dc('0x36')];_0x52d05b['order']=qs['sort'](_0x48a3b0[_0xd4dc('0x37')]['sort']);_0x52d05b['where']=qs['filters'](_[_0xd4dc('0x40')](_0x48a3b0[_0xd4dc('0x37')],_0x1fe4c0[_0xd4dc('0x41')]));if(_0x48a3b0[_0xd4dc('0x37')][_0xd4dc('0x42')]){_0x52d05b[_0xd4dc('0x3f')]=_[_0xd4dc('0x43')](_0x52d05b[_0xd4dc('0x3f')],{'$or':_[_0xd4dc('0x32')](_0x52d05b['attributes'],function(_0x22bc74){var _0x5a300c={};_0x5a300c[_0x22bc74]={'$like':'%'+_0x48a3b0[_0xd4dc('0x37')][_0xd4dc('0x42')]+'%'};return _0x5a300c;})});}_0x52d05b=_['merge']({},_0x52d05b,_0x48a3b0['options']);return _0xe0d90b['getTeams'](_0x52d05b);}})[_0xd4dc('0x2b')](function(_0x2bdb31){if(_0x2bdb31){_0x21700f=_0x2bdb31['length'];if(!_0x48a3b0[_0xd4dc('0x37')][_0xd4dc('0x3b')](_0xd4dc('0x3c'))){_0x52d05b[_0xd4dc('0x24')]=qs[_0xd4dc('0x24')](_0x48a3b0[_0xd4dc('0x37')][_0xd4dc('0x24')]);_0x52d05b[_0xd4dc('0x22')]=qs[_0xd4dc('0x22')](_0x48a3b0[_0xd4dc('0x37')]['offset']);}return _0xe0d90b['getTeams'](_0x52d05b);}})[_0xd4dc('0x2b')](function(_0x4a97a6){if(_0x4a97a6){return _0x4a97a6?{'count':_0x21700f,'rows':_0x4a97a6}:null;}})[_0xd4dc('0x2b')](respondWithResult(_0x386190,null))['catch'](handleError(_0x386190,null));};exports['addTeams']=function(_0x36ffc9,_0x231312,_0x2b0dff){var _0x293ad0=_0x36ffc9[_0xd4dc('0x51')][_0xd4dc('0x68')];return db['Team']['findAll']({'where':{'id':_0x293ad0},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd4dc('0x69'),'attributes':['id',_0xd4dc('0x30'),'online',_0xd4dc('0x6a'),_0xd4dc('0x6b')],'raw':!![]}]})[_0xd4dc('0x2b')](function(_0xf542bc){if(_0xf542bc){var _0x3417d9=_['flatMap'](_0xf542bc,function(_0x25a965){var _0x44ad5b=_0x25a965[_0xd4dc('0x2d')]({'plain':!![]});return _0x44ad5b[_0xd4dc('0x69')];});return db['WhatsappQueue'][_0xd4dc('0x4e')]({'where':{'id':_0x36ffc9[_0xd4dc('0x5a')]['id']}})[_0xd4dc('0x2b')](function(_0x3770d1){return db[_0xd4dc('0x6c')][_0xd4dc('0x6d')](function(_0x882e5e){return _0x3770d1[_0xd4dc('0x6e')](_0x293ad0,{'transaction':_0x882e5e})[_0xd4dc('0x2b')](function(){return BPromise['each'](_0x3417d9,function(_0x53dfd7){return db[_0xd4dc('0x5e')][_0xd4dc('0x6f')]({'where':{'UserId':_0x53dfd7['id'],'WhatsappQueueId':_0x36ffc9['params']['id']},'transaction':_0x882e5e});});})['then'](function(){_0x3417d9[_0xd4dc('0x70')](function(_0x2dab93){socket[_0xd4dc('0x71')](_0xd4dc('0x72'),{'UserId':_0x2dab93['id'],'WhatsappQueueId':_0x3770d1['id']});});});});});}})[_0xd4dc('0x2b')](respondWithStatusCode(_0x231312,null))[_0xd4dc('0x4f')](handleError(_0x231312,null));};exports[_0xd4dc('0x73')]=function(_0x35bac,_0x353dc4,_0x38a15b){return db[_0xd4dc('0x67')][_0xd4dc('0x48')]({'where':{'id':_0x35bac[_0xd4dc('0x37')][_0xd4dc('0x68')]},'attributes':['id'],'include':[{'model':db[_0xd4dc('0x5f')],'as':_0xd4dc('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x353dc4,null))[_0xd4dc('0x2b')](function(_0xaf0d44){var _0x1f91d2=_[_0xd4dc('0x32')](_0xaf0d44,'id');var _0x5a6161=[];var _0x5f5604=[];var _0x5ee419=squel[_0xd4dc('0x74')]();_0x5ee419[_0xd4dc('0x75')]('tq.TeamId')[_0xd4dc('0x76')](_0xd4dc('0x77'),'tq')[_0xd4dc('0x78')]('user_has_teams','ut',_0xd4dc('0x79'))[_0xd4dc('0x3f')](_0xd4dc('0x7a'),_0x35bac[_0xd4dc('0x5a')]['id']);for(var _0x563633=0x0;_0x563633<_0xaf0d44[_0xd4dc('0x3a')];_0x563633+=0x1){let _0x3ab849=_0xaf0d44[_0x563633];for(var _0x1fc792=0x0;_0x1fc792<_0x3ab849[_0xd4dc('0x69')][_0xd4dc('0x3a')];_0x1fc792+=0x1){let _0xf75c60=_0x3ab849[_0xd4dc('0x69')][_0x1fc792];var _0xa38a17=_0x5ee419[_0xd4dc('0x7b')]();_0xa38a17[_0xd4dc('0x3f')](_0xd4dc('0x7c'),_0xf75c60['id']);_0x5f5604[_0xd4dc('0x7d')](db[_0xd4dc('0x6c')][_0xd4dc('0x37')](_0xa38a17[_0xd4dc('0x7e')](),{'type':db['sequelize'][_0xd4dc('0x7f')]['SELECT']})[_0xd4dc('0x2b')](function(_0x1d9a42){if(_0x1d9a42[_0xd4dc('0x3a')]===0x1){return _0xf75c60['id'];}else{var _0x3ed094=_[_0xd4dc('0x80')](_[_0xd4dc('0x32')](_0x1d9a42,'TeamId'),function(_0x233476){return _[_0xd4dc('0x81')](_0x1f91d2,_0x233476);});if(_0x3ed094){return _0xf75c60['id'];}}}));}}return BPromise[_0xd4dc('0x82')](_0x5f5604)[_0xd4dc('0x2b')](function(_0x6a8acb){_0x5a6161=_(_0x5a6161)[_0xd4dc('0x83')](_0x6a8acb)[_0xd4dc('0x84')]()['value']();return db[_0xd4dc('0x46')][_0xd4dc('0x4e')]({'where':{'id':_0x35bac['params']['id']}})[_0xd4dc('0x2b')](function(_0x44038d){return db[_0xd4dc('0x6c')][_0xd4dc('0x6d')](function(_0x5dec9b){return _0x44038d[_0xd4dc('0x73')](_0x35bac[_0xd4dc('0x37')][_0xd4dc('0x68')],{'transaction':_0x5dec9b})[_0xd4dc('0x2b')](function(){if(!_['isEmpty'](_0x5a6161)){return _0x44038d[_0xd4dc('0x85')](_0x5a6161,{'transaction':_0x5dec9b});}})[_0xd4dc('0x2b')](function(){_0x5a6161[_0xd4dc('0x70')](function(_0x1bd858){socket[_0xd4dc('0x71')](_0xd4dc('0x86'),{'UserId':_0x1bd858,'WhatsappQueueId':_0x44038d['id']});});});});});});})[_0xd4dc('0x2b')](respondWithStatusCode(_0x353dc4,null))[_0xd4dc('0x4f')](handleError(_0x353dc4,null));};exports[_0xd4dc('0x87')]=function(_0x5c346f,_0x243ace,_0x12c94b){return db['WhatsappQueue'][_0xd4dc('0x4e')]({'where':{'id':_0x5c346f['params']['id']}})['then'](handleEntityNotFound(_0x243ace,null))['then'](function(_0x34d03f){if(_0x34d03f){return _0x34d03f[_0xd4dc('0x87')](_0x5c346f[_0xd4dc('0x51')][_0xd4dc('0x68')],_[_0xd4dc('0x88')](_0x5c346f[_0xd4dc('0x51')],['ids','id'])||{})[_0xd4dc('0x89')](function(_0x19609c){for(var _0x1cbcb4=0x0;_0x1cbcb4<_0x5c346f[_0xd4dc('0x51')]['ids'][_0xd4dc('0x3a')];_0x1cbcb4+=0x1){socket[_0xd4dc('0x71')](_0xd4dc('0x72'),{'UserId':Number(_0x5c346f[_0xd4dc('0x51')]['ids'][_0x1cbcb4]),'WhatsappQueueId':Number(_0x5c346f[_0xd4dc('0x5a')]['id'])});}return _0x19609c;});}})[_0xd4dc('0x2b')](respondWithResult(_0x243ace,null))[_0xd4dc('0x4f')](handleError(_0x243ace,null));};exports[_0xd4dc('0x85')]=function(_0x48963f,_0x121566,_0x297340){return db[_0xd4dc('0x46')][_0xd4dc('0x4e')]({'where':{'id':_0x48963f['params']['id']}})['then'](handleEntityNotFound(_0x121566,null))[_0xd4dc('0x2b')](function(_0x1ebff6){if(_0x1ebff6){return _0x1ebff6[_0xd4dc('0x85')](_0x48963f['query'][_0xd4dc('0x68')])[_0xd4dc('0x2b')](function(){if(_[_0xd4dc('0x8a')](_0x48963f['query'][_0xd4dc('0x68')])){for(var _0x2dd2a8=0x0;_0x2dd2a8<_0x48963f['query'][_0xd4dc('0x68')][_0xd4dc('0x3a')];_0x2dd2a8+=0x1){socket[_0xd4dc('0x71')](_0xd4dc('0x86'),{'UserId':Number(_0x48963f[_0xd4dc('0x37')]['ids'][_0x2dd2a8]),'WhatsappQueueId':Number(_0x48963f['params']['id'])});}}else{socket[_0xd4dc('0x71')]('userWhatsappQueue:remove',{'UserId':Number(_0x48963f['query']['ids']),'WhatsappQueueId':Number(_0x48963f[_0xd4dc('0x5a')]['id'])});}});}})[_0xd4dc('0x2b')](respondWithStatusCode(_0x121566,null))['catch'](handleError(_0x121566,null));};exports[_0xd4dc('0x8b')]=function(_0xbed119,_0x1e22b8,_0x27049d){var _0x59bfe1={};var _0x47e559={};var _0x7f97e7;var _0x4049ba;return db[_0xd4dc('0x46')][_0xd4dc('0x5d')]({'where':{'id':_0xbed119['params']['id']}})[_0xd4dc('0x2b')](handleEntityNotFound(_0x1e22b8,null))[_0xd4dc('0x2b')](function(_0xdcc45e){if(_0xdcc45e){_0x7f97e7=_0xdcc45e;_0x47e559['model']=_[_0xd4dc('0x4b')](db['User']['rawAttributes']);_0x47e559[_0xd4dc('0x37')]=_[_0xd4dc('0x4b')](_0xbed119[_0xd4dc('0x37')]);_0x47e559[_0xd4dc('0x41')]=_[_0xd4dc('0x4c')](_0x47e559[_0xd4dc('0x36')],_0x47e559[_0xd4dc('0x37')]);_0x59bfe1[_0xd4dc('0x38')]=_['intersection'](_0x47e559[_0xd4dc('0x36')],qs[_0xd4dc('0x39')](_0xbed119[_0xd4dc('0x37')][_0xd4dc('0x39')]));_0x59bfe1[_0xd4dc('0x38')]=_0x59bfe1[_0xd4dc('0x38')][_0xd4dc('0x3a')]?_0x59bfe1['attributes']:_0x47e559['model'];_0x59bfe1['order']=qs['sort'](_0xbed119[_0xd4dc('0x37')][_0xd4dc('0x3e')]);_0x59bfe1[_0xd4dc('0x3f')]=qs[_0xd4dc('0x41')](_[_0xd4dc('0x40')](_0xbed119[_0xd4dc('0x37')],_0x47e559[_0xd4dc('0x41')]));if(_0xbed119['query'][_0xd4dc('0x42')]){_0x59bfe1[_0xd4dc('0x3f')]=_[_0xd4dc('0x43')](_0x59bfe1['where'],{'$or':_[_0xd4dc('0x32')](_0x59bfe1[_0xd4dc('0x38')],function(_0x21757b){var _0x4ce2e8={};_0x4ce2e8[_0x21757b]={'$like':'%'+_0xbed119[_0xd4dc('0x37')]['filter']+'%'};return _0x4ce2e8;})});}_0x59bfe1=_['merge']({},_0x59bfe1,_0xbed119['options']);return _0x7f97e7[_0xd4dc('0x8b')](_0x59bfe1);}})[_0xd4dc('0x2b')](function(_0x21f192){if(_0x21f192){_0x4049ba=_0x21f192[_0xd4dc('0x3a')];if(!_0xbed119[_0xd4dc('0x37')][_0xd4dc('0x3b')](_0xd4dc('0x3c'))){_0x59bfe1[_0xd4dc('0x24')]=qs[_0xd4dc('0x24')](_0xbed119[_0xd4dc('0x37')][_0xd4dc('0x24')]);_0x59bfe1[_0xd4dc('0x22')]=qs[_0xd4dc('0x22')](_0xbed119[_0xd4dc('0x37')][_0xd4dc('0x22')]);}return _0x7f97e7[_0xd4dc('0x8b')](_0x59bfe1);}})[_0xd4dc('0x2b')](function(_0x16c1b7){if(_0x16c1b7){return _0x16c1b7?{'count':_0x4049ba,'rows':_0x16c1b7}:null;}})[_0xd4dc('0x2b')](respondWithResult(_0x1e22b8,null))['catch'](handleError(_0x1e22b8,null));}; \ No newline at end of file +var _0x5092=['describe','getMembers','findOne','hasOwnProperty','nolimit','order','WhatsappQueueId','UserWhatsappQueue','findAndCountAll','UserId','whatsappPause','createdAt','format','%s/%s','updatedAt','getTeams','addTeams','ids','Team','findAll','User','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','merge','options','WhatsappQueue','includeAll','include','rows','catch','params','length','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find'];(function(_0x59bbd2,_0x449914){var _0x3bc07b=function(_0x265d6b){while(--_0x265d6b){_0x59bbd2['push'](_0x59bbd2['shift']());}};_0x3bc07b(++_0x449914);}(_0x5092,0xce));var _0x2509=function(_0x1379c1,_0x3a5e44){_0x1379c1=_0x1379c1-0x0;var _0x222fe6=_0x5092[_0x1379c1];return _0x222fe6;};'use strict';var emlformat=require(_0x2509('0x0'));var rimraf=require(_0x2509('0x1'));var zipdir=require(_0x2509('0x2'));var jsonpatch=require(_0x2509('0x3'));var rp=require(_0x2509('0x4'));var moment=require(_0x2509('0x5'));var BPromise=require(_0x2509('0x6'));var Mustache=require(_0x2509('0x7'));var util=require(_0x2509('0x8'));var path=require(_0x2509('0x9'));var sox=require(_0x2509('0xa'));var csv=require(_0x2509('0xb'));var ejs=require(_0x2509('0xc'));var fs=require('fs');var fs_extra=require(_0x2509('0xd'));var _=require(_0x2509('0xe'));var squel=require(_0x2509('0xf'));var crypto=require(_0x2509('0x10'));var jsforce=require(_0x2509('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x2509('0xb'));var querystring=require(_0x2509('0x12'));var Papa=require(_0x2509('0x13'));var Redis=require(_0x2509('0x14'));var authService=require(_0x2509('0x15'));var qs=require(_0x2509('0x16'));var as=require(_0x2509('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2509('0x18'))(_0x2509('0x19'));var utils=require(_0x2509('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2509('0x1b'))['db'];config[_0x2509('0x1c')]=_['defaults'](config[_0x2509('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x2509('0x1d'))(new Redis(config[_0x2509('0x1c')]));require(_0x2509('0x1e'))[_0x2509('0x1f')](socket);function respondWithStatusCode(_0x450e77,_0x1528c2){_0x1528c2=_0x1528c2||0xcc;return function(_0x4980c1){if(_0x4980c1){return _0x450e77['sendStatus'](_0x1528c2);}return _0x450e77[_0x2509('0x20')](_0x1528c2)[_0x2509('0x21')]();};}function respondWithResult(_0x4a7565,_0x891bb2){_0x891bb2=_0x891bb2||0xc8;return function(_0x1f70d9){if(_0x1f70d9){return _0x4a7565['status'](_0x891bb2)['json'](_0x1f70d9);}};}function respondWithFilteredResult(_0x40d47b,_0x206e0b){return function(_0x78dd2a){if(_0x78dd2a){var _0x32406d=typeof _0x206e0b[_0x2509('0x22')]==='undefined'&&typeof _0x206e0b[_0x2509('0x23')]==='undefined';var _0x2c1a47=_0x78dd2a[_0x2509('0x24')];var _0x51fd21=_0x32406d?0x0:_0x206e0b['offset'];var _0xf37838=_0x32406d?_0x78dd2a['count']:_0x206e0b[_0x2509('0x22')]+_0x206e0b[_0x2509('0x23')];var _0x3634e0;if(_0xf37838>=_0x2c1a47){_0xf37838=_0x2c1a47;_0x3634e0=0xc8;}else{_0x3634e0=0xce;}_0x40d47b[_0x2509('0x20')](_0x3634e0);return _0x40d47b[_0x2509('0x25')](_0x2509('0x26'),_0x51fd21+'-'+_0xf37838+'/'+_0x2c1a47)[_0x2509('0x27')](_0x78dd2a);}return null;};}function patchUpdates(_0x1cf665){return function(_0x5e1967){try{jsonpatch[_0x2509('0x28')](_0x5e1967,_0x1cf665,!![]);}catch(_0x287f4b){return BPromise[_0x2509('0x29')](_0x287f4b);}return _0x5e1967[_0x2509('0x2a')]();};}function saveUpdates(_0x50ac40,_0x55c926){return function(_0x58e346){if(_0x58e346){return _0x58e346[_0x2509('0x2b')](_0x50ac40)[_0x2509('0x2c')](function(_0x3592ca){return _0x3592ca;});}return null;};}function removeEntity(_0x2cb5b9,_0x32951b){return function(_0x3e2bbf){if(_0x3e2bbf){return _0x3e2bbf[_0x2509('0x2d')]()[_0x2509('0x2c')](function(){var _0x40536a=_0x3e2bbf[_0x2509('0x2e')]({'plain':!![]});var _0x42230a=_0x2509('0x2f');return db[_0x2509('0x30')][_0x2509('0x2d')]({'where':{'type':_0x42230a,'resourceId':_0x40536a['id']}})[_0x2509('0x2c')](function(){return _0x3e2bbf;});})[_0x2509('0x2c')](function(){_0x2cb5b9[_0x2509('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f1b9d,_0x5218b4){return function(_0x456939){if(!_0x456939){_0x6f1b9d[_0x2509('0x31')](0x194);}return _0x456939;};}function handleError(_0x3e81bd,_0x23fed8){_0x23fed8=_0x23fed8||0x1f4;return function(_0xd77be5){logger[_0x2509('0x32')](_0xd77be5[_0x2509('0x33')]);if(_0xd77be5[_0x2509('0x34')]){delete _0xd77be5[_0x2509('0x34')];}_0x3e81bd[_0x2509('0x20')](_0x23fed8)[_0x2509('0x35')](_0xd77be5);};}exports[_0x2509('0x36')]=function(_0x5caa67,_0x3104e3){var _0x18ddb7={},_0x6539bf={},_0x40190f={'count':0x0,'rows':[]};var _0x168219=_['map'](db['WhatsappQueue'][_0x2509('0x37')],function(_0x4a0970){return{'name':_0x4a0970[_0x2509('0x38')],'type':_0x4a0970[_0x2509('0x39')]['key']};});_0x6539bf[_0x2509('0x3a')]=_[_0x2509('0x3b')](_0x168219,_0x2509('0x34'));_0x6539bf['query']=_[_0x2509('0x3c')](_0x5caa67[_0x2509('0x3d')]);_0x6539bf[_0x2509('0x3e')]=_[_0x2509('0x3f')](_0x6539bf[_0x2509('0x3a')],_0x6539bf[_0x2509('0x3d')]);_0x18ddb7[_0x2509('0x40')]=_['intersection'](_0x6539bf[_0x2509('0x3a')],qs[_0x2509('0x41')](_0x5caa67['query'][_0x2509('0x41')]));_0x18ddb7[_0x2509('0x40')]=_0x18ddb7['attributes']['length']?_0x18ddb7[_0x2509('0x40')]:_0x6539bf[_0x2509('0x3a')];if(!_0x5caa67['query']['hasOwnProperty']('nolimit')){_0x18ddb7[_0x2509('0x23')]=qs[_0x2509('0x23')](_0x5caa67[_0x2509('0x3d')][_0x2509('0x23')]);_0x18ddb7['offset']=qs[_0x2509('0x22')](_0x5caa67[_0x2509('0x3d')]['offset']);}_0x18ddb7['order']=qs[_0x2509('0x42')](_0x5caa67['query']['sort']);_0x18ddb7[_0x2509('0x43')]=qs[_0x2509('0x3e')](_[_0x2509('0x44')](_0x5caa67['query'],_0x6539bf[_0x2509('0x3e')]),_0x168219);if(_0x5caa67[_0x2509('0x3d')][_0x2509('0x45')]){_0x18ddb7['where']=_[_0x2509('0x46')](_0x18ddb7['where'],{'$or':_[_0x2509('0x3b')](_0x168219,function(_0x810857){if(_0x810857[_0x2509('0x39')]!=='VIRTUAL'){var _0x523c40={};_0x523c40[_0x810857['name']]={'$like':'%'+_0x5caa67[_0x2509('0x3d')]['filter']+'%'};return _0x523c40;}})});}_0x18ddb7=_[_0x2509('0x46')]({},_0x18ddb7,_0x5caa67[_0x2509('0x47')]);var _0x1334e7={'where':_0x18ddb7[_0x2509('0x43')]};return db[_0x2509('0x48')][_0x2509('0x24')](_0x1334e7)[_0x2509('0x2c')](function(_0x15bcd9){_0x40190f[_0x2509('0x24')]=_0x15bcd9;if(_0x5caa67[_0x2509('0x3d')][_0x2509('0x49')]){_0x18ddb7[_0x2509('0x4a')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x18ddb7);})[_0x2509('0x2c')](function(_0x12e230){_0x40190f[_0x2509('0x4b')]=_0x12e230;return _0x40190f;})[_0x2509('0x2c')](respondWithFilteredResult(_0x3104e3,_0x18ddb7))[_0x2509('0x4c')](handleError(_0x3104e3,null));};exports['show']=function(_0x28dbd2,_0x32d153){var _0x3be382={'raw':!![],'where':{'id':_0x28dbd2[_0x2509('0x4d')]['id']}},_0x2cfb10={};_0x2cfb10[_0x2509('0x3a')]=_[_0x2509('0x3c')](db['WhatsappQueue'][_0x2509('0x37')]);_0x2cfb10[_0x2509('0x3d')]=_[_0x2509('0x3c')](_0x28dbd2[_0x2509('0x3d')]);_0x2cfb10['filters']=_['intersection'](_0x2cfb10['model'],_0x2cfb10[_0x2509('0x3d')]);_0x3be382['attributes']=_[_0x2509('0x3f')](_0x2cfb10['model'],qs[_0x2509('0x41')](_0x28dbd2[_0x2509('0x3d')]['fields']));_0x3be382[_0x2509('0x40')]=_0x3be382['attributes'][_0x2509('0x4e')]?_0x3be382[_0x2509('0x40')]:_0x2cfb10['model'];if(_0x28dbd2['query'][_0x2509('0x49')]){_0x3be382['include']=[{'all':!![]}];}_0x3be382=_[_0x2509('0x46')]({},_0x3be382,_0x28dbd2['options']);return db[_0x2509('0x48')]['find'](_0x3be382)[_0x2509('0x2c')](handleEntityNotFound(_0x32d153,null))[_0x2509('0x2c')](respondWithResult(_0x32d153,null))[_0x2509('0x4c')](handleError(_0x32d153,null));};exports[_0x2509('0x4f')]=function(_0x35201c,_0x743175){return db[_0x2509('0x48')][_0x2509('0x4f')](_0x35201c[_0x2509('0x50')],{})[_0x2509('0x2c')](function(_0x1ee1c6){var _0x5cc62d=_0x35201c[_0x2509('0x51')][_0x2509('0x2e')]({'plain':!![]});if(!_0x5cc62d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cc62d[_0x2509('0x52')]===_0x2509('0x51')){var _0x10fe7a=_0x1ee1c6[_0x2509('0x2e')]({'plain':!![]});var _0x24c3b1=_0x2509('0x2f');return db[_0x2509('0x53')]['find']({'where':{'name':_0x24c3b1,'userProfileId':_0x5cc62d[_0x2509('0x54')]},'raw':!![]})[_0x2509('0x2c')](function(_0x39b4a4){if(_0x39b4a4&&_0x39b4a4[_0x2509('0x55')]===0x0){return db['UserProfileResource'][_0x2509('0x4f')]({'name':_0x10fe7a['name'],'resourceId':_0x10fe7a['id'],'type':_0x39b4a4[_0x2509('0x34')],'sectionId':_0x39b4a4['id']},{})['then'](function(){return _0x1ee1c6;});}else{return _0x1ee1c6;}})[_0x2509('0x4c')](function(_0x464a02){logger[_0x2509('0x32')](_0x2509('0x56'),_0x464a02);throw _0x464a02;});}return _0x1ee1c6;})[_0x2509('0x2c')](respondWithResult(_0x743175,0xc9))['catch'](handleError(_0x743175,null));};exports['update']=function(_0x3453b4,_0x42572a){if(_0x3453b4['body']['id']){delete _0x3453b4[_0x2509('0x50')]['id'];}return db[_0x2509('0x48')][_0x2509('0x57')]({'where':{'id':_0x3453b4['params']['id']}})[_0x2509('0x2c')](handleEntityNotFound(_0x42572a,null))[_0x2509('0x2c')](saveUpdates(_0x3453b4[_0x2509('0x50')],null))['then'](respondWithResult(_0x42572a,null))['catch'](handleError(_0x42572a,null));};exports[_0x2509('0x2d')]=function(_0x19cb08,_0xea2d39){return db['WhatsappQueue'][_0x2509('0x57')]({'where':{'id':_0x19cb08[_0x2509('0x4d')]['id']}})['then'](handleEntityNotFound(_0xea2d39,null))[_0x2509('0x2c')](removeEntity(_0xea2d39,null))[_0x2509('0x4c')](handleError(_0xea2d39,null));};exports[_0x2509('0x58')]=function(_0x1f98e7,_0x34f286){return db[_0x2509('0x48')][_0x2509('0x58')]()['then'](respondWithResult(_0x34f286,null))['catch'](handleError(_0x34f286,null));};exports[_0x2509('0x59')]=function(_0x1eaf89,_0x2092d9,_0x4f481c){var _0x65fe83={'raw':!![],'where':{}},_0x432771={},_0x258edd;return db[_0x2509('0x48')][_0x2509('0x5a')]({'where':{'id':_0x1eaf89[_0x2509('0x4d')]['id']}})[_0x2509('0x2c')](handleEntityNotFound(_0x2092d9,null))['then'](function(_0x1f2b15){if(_0x1f2b15){_0x258edd=_0x1f2b15[_0x2509('0x2e')]({'plain':!![]});_0x432771[_0x2509('0x3a')]=_['keys'](db['UserWhatsappQueue']['rawAttributes']);_0x432771[_0x2509('0x3d')]=_['keys'](_0x1eaf89[_0x2509('0x3d')]);_0x432771['filters']=_['intersection'](_0x432771[_0x2509('0x3a')],_0x432771[_0x2509('0x3d')]);_0x65fe83[_0x2509('0x40')]=_['intersection'](_0x432771[_0x2509('0x3a')],qs[_0x2509('0x41')](_0x1eaf89[_0x2509('0x3d')][_0x2509('0x41')]));_0x65fe83[_0x2509('0x40')]=_0x65fe83['attributes'][_0x2509('0x4e')]?_0x65fe83[_0x2509('0x40')]:_0x432771[_0x2509('0x3a')];if(!_0x1eaf89[_0x2509('0x3d')][_0x2509('0x5b')](_0x2509('0x5c'))){_0x65fe83[_0x2509('0x23')]=qs[_0x2509('0x23')](_0x1eaf89[_0x2509('0x3d')][_0x2509('0x23')]);_0x65fe83['offset']=qs['offset'](_0x1eaf89['query'][_0x2509('0x22')]);}_0x65fe83[_0x2509('0x5d')]=qs['sort'](_0x1eaf89['query'][_0x2509('0x42')]);_0x65fe83[_0x2509('0x43')]=qs[_0x2509('0x3e')](_[_0x2509('0x44')](_0x1eaf89['query'],_0x432771[_0x2509('0x3e')]));_0x65fe83[_0x2509('0x43')][_0x2509('0x5e')]=_0x1f2b15['id'];if(_0x1eaf89[_0x2509('0x3d')][_0x2509('0x45')]){_0x65fe83[_0x2509('0x43')]=_[_0x2509('0x46')](_0x65fe83['where'],{'$or':_[_0x2509('0x3b')](_0x65fe83[_0x2509('0x40')],function(_0x137a11){var _0x51e28e={};_0x51e28e[_0x137a11]={'$like':'%'+_0x1eaf89[_0x2509('0x3d')][_0x2509('0x45')]+'%'};return _0x51e28e;})});}_0x65fe83=_[_0x2509('0x46')]({},_0x65fe83,_0x1eaf89[_0x2509('0x47')]);return db[_0x2509('0x5f')]['findAll'](_0x65fe83);}})[_0x2509('0x2c')](function(_0x2d1e08){if(_0x2d1e08){return db['User'][_0x2509('0x60')]({'where':{'id':_[_0x2509('0x3b')](_0x2d1e08,_0x2509('0x61')),'role':'agent'},'attributes':['id','name',_0x2509('0x62'),'updatedAt',_0x2509('0x63')]});}})['then'](function(_0x5dd32b){if(_0x5dd32b){return{'count':_0x5dd32b['count'],'rows':_['map'](_0x5dd32b[_0x2509('0x4b')],function(_0x536bea){return{'membername':_0x536bea[_0x2509('0x34')],'UserId':_0x536bea['id'],'queue_name':_0x258edd[_0x2509('0x34')],'WhatsappQueueId':_0x258edd['id'],'interface':util[_0x2509('0x64')](_0x2509('0x65'),'SIP',_0x536bea[_0x2509('0x34')]),'penalty':0x0,'paused':_0x536bea[_0x2509('0x62')],'createdAt':_0x536bea[_0x2509('0x63')],'updatedAt':_0x536bea[_0x2509('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2509('0x2c')](respondWithFilteredResult(_0x2092d9,_0x65fe83))[_0x2509('0x4c')](handleError(_0x2092d9,null));};exports[_0x2509('0x67')]=function(_0x50dc26,_0xe367b2,_0x472ec0){var _0x5e3601={};var _0x3e6a82={};var _0x575d8c;var _0x5cf555;return db[_0x2509('0x48')][_0x2509('0x5a')]({'where':{'id':_0x50dc26['params']['id']}})[_0x2509('0x2c')](handleEntityNotFound(_0xe367b2,null))['then'](function(_0x54b661){if(_0x54b661){_0x575d8c=_0x54b661;_0x3e6a82[_0x2509('0x3a')]=_[_0x2509('0x3c')](db['Team'][_0x2509('0x37')]);_0x3e6a82['query']=_[_0x2509('0x3c')](_0x50dc26['query']);_0x3e6a82[_0x2509('0x3e')]=_['intersection'](_0x3e6a82[_0x2509('0x3a')],_0x3e6a82['query']);_0x5e3601[_0x2509('0x40')]=_[_0x2509('0x3f')](_0x3e6a82['model'],qs[_0x2509('0x41')](_0x50dc26['query'][_0x2509('0x41')]));_0x5e3601['attributes']=_0x5e3601[_0x2509('0x40')][_0x2509('0x4e')]?_0x5e3601[_0x2509('0x40')]:_0x3e6a82[_0x2509('0x3a')];_0x5e3601[_0x2509('0x5d')]=qs['sort'](_0x50dc26[_0x2509('0x3d')][_0x2509('0x42')]);_0x5e3601[_0x2509('0x43')]=qs[_0x2509('0x3e')](_[_0x2509('0x44')](_0x50dc26[_0x2509('0x3d')],_0x3e6a82[_0x2509('0x3e')]));if(_0x50dc26[_0x2509('0x3d')]['filter']){_0x5e3601[_0x2509('0x43')]=_[_0x2509('0x46')](_0x5e3601[_0x2509('0x43')],{'$or':_[_0x2509('0x3b')](_0x5e3601[_0x2509('0x40')],function(_0x148efe){var _0x3bc937={};_0x3bc937[_0x148efe]={'$like':'%'+_0x50dc26[_0x2509('0x3d')]['filter']+'%'};return _0x3bc937;})});}_0x5e3601=_['merge']({},_0x5e3601,_0x50dc26[_0x2509('0x47')]);return _0x575d8c[_0x2509('0x67')](_0x5e3601);}})[_0x2509('0x2c')](function(_0x1aec97){if(_0x1aec97){_0x5cf555=_0x1aec97[_0x2509('0x4e')];if(!_0x50dc26[_0x2509('0x3d')][_0x2509('0x5b')](_0x2509('0x5c'))){_0x5e3601['limit']=qs[_0x2509('0x23')](_0x50dc26['query'][_0x2509('0x23')]);_0x5e3601[_0x2509('0x22')]=qs[_0x2509('0x22')](_0x50dc26[_0x2509('0x3d')][_0x2509('0x22')]);}return _0x575d8c[_0x2509('0x67')](_0x5e3601);}})[_0x2509('0x2c')](function(_0x1773d7){if(_0x1773d7){return _0x1773d7?{'count':_0x5cf555,'rows':_0x1773d7}:null;}})[_0x2509('0x2c')](respondWithResult(_0xe367b2,null))[_0x2509('0x4c')](handleError(_0xe367b2,null));};exports[_0x2509('0x68')]=function(_0x298eb9,_0x49a46a,_0x58737f){var _0x53b36a=_0x298eb9[_0x2509('0x50')][_0x2509('0x69')];return db[_0x2509('0x6a')][_0x2509('0x6b')]({'where':{'id':_0x53b36a},'attributes':['id'],'include':[{'model':db[_0x2509('0x6c')],'as':_0x2509('0x6d'),'attributes':['id',_0x2509('0x34'),_0x2509('0x6e'),'voicePause',_0x2509('0x6f')],'raw':!![]}]})['then'](function(_0x577765){if(_0x577765){var _0x131d86=_[_0x2509('0x70')](_0x577765,function(_0x5b4ba6){var _0x1e1cdb=_0x5b4ba6[_0x2509('0x2e')]({'plain':!![]});return _0x1e1cdb[_0x2509('0x6d')];});return db[_0x2509('0x48')]['find']({'where':{'id':_0x298eb9['params']['id']}})[_0x2509('0x2c')](function(_0x13c721){return db['sequelize'][_0x2509('0x71')](function(_0x51055c){return _0x13c721[_0x2509('0x68')](_0x53b36a,{'transaction':_0x51055c})[_0x2509('0x2c')](function(){return BPromise[_0x2509('0x72')](_0x131d86,function(_0x33b44c){return db['UserWhatsappQueue'][_0x2509('0x73')]({'where':{'UserId':_0x33b44c['id'],'WhatsappQueueId':_0x298eb9[_0x2509('0x4d')]['id']},'transaction':_0x51055c});});})[_0x2509('0x2c')](function(){_0x131d86[_0x2509('0x74')](function(_0x557c58){socket[_0x2509('0x75')](_0x2509('0x76'),{'UserId':_0x557c58['id'],'WhatsappQueueId':_0x13c721['id']});});});});});}})[_0x2509('0x2c')](respondWithStatusCode(_0x49a46a,null))[_0x2509('0x4c')](handleError(_0x49a46a,null));};exports[_0x2509('0x77')]=function(_0x28348f,_0x275227,_0x5c635b){return db[_0x2509('0x6a')][_0x2509('0x6b')]({'where':{'id':_0x28348f[_0x2509('0x3d')][_0x2509('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2509('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x275227,null))['then'](function(_0xbc3fee){var _0x3608a4=_[_0x2509('0x3b')](_0xbc3fee,'id');var _0x35f2f2=[];var _0x11bf24=[];var _0x4aba81=squel[_0x2509('0x78')]();_0x4aba81[_0x2509('0x79')](_0x2509('0x7a'))[_0x2509('0x7b')](_0x2509('0x7c'),'tq')[_0x2509('0x7d')]('user_has_teams','ut',_0x2509('0x7e'))[_0x2509('0x43')](_0x2509('0x7f'),_0x28348f['params']['id']);for(var _0x3c8da8=0x0;_0x3c8da8<_0xbc3fee['length'];_0x3c8da8+=0x1){let _0x5066d7=_0xbc3fee[_0x3c8da8];for(var _0x54b443=0x0;_0x54b443<_0x5066d7[_0x2509('0x6d')][_0x2509('0x4e')];_0x54b443+=0x1){let _0x27b613=_0x5066d7['Agents'][_0x54b443];var _0x340714=_0x4aba81['clone']();_0x340714['where'](_0x2509('0x80'),_0x27b613['id']);_0x11bf24[_0x2509('0x81')](db['sequelize'][_0x2509('0x3d')](_0x340714[_0x2509('0x82')](),{'type':db['sequelize']['QueryTypes'][_0x2509('0x83')]})[_0x2509('0x2c')](function(_0x102bee){if(_0x102bee['length']===0x1){return _0x27b613['id'];}else{var _0x21ceee=_[_0x2509('0x84')](_[_0x2509('0x3b')](_0x102bee,_0x2509('0x85')),function(_0x2ba1d5){return _[_0x2509('0x86')](_0x3608a4,_0x2ba1d5);});if(_0x21ceee){return _0x27b613['id'];}}}));}}return BPromise[_0x2509('0x87')](_0x11bf24)[_0x2509('0x2c')](function(_0x453fc6){_0x35f2f2=_(_0x35f2f2)[_0x2509('0x88')](_0x453fc6)[_0x2509('0x89')]()[_0x2509('0x8a')]();return db['WhatsappQueue']['find']({'where':{'id':_0x28348f[_0x2509('0x4d')]['id']}})[_0x2509('0x2c')](function(_0x18a97b){return db[_0x2509('0x8b')][_0x2509('0x71')](function(_0x1bd68f){return _0x18a97b[_0x2509('0x77')](_0x28348f[_0x2509('0x3d')][_0x2509('0x69')],{'transaction':_0x1bd68f})['then'](function(){if(!_[_0x2509('0x8c')](_0x35f2f2)){return _0x18a97b['removeAgents'](_0x35f2f2,{'transaction':_0x1bd68f});}})[_0x2509('0x2c')](function(){_0x35f2f2[_0x2509('0x74')](function(_0x3778c7){socket[_0x2509('0x75')](_0x2509('0x8d'),{'UserId':_0x3778c7,'WhatsappQueueId':_0x18a97b['id']});});});});});});})[_0x2509('0x2c')](respondWithStatusCode(_0x275227,null))[_0x2509('0x4c')](handleError(_0x275227,null));};exports['addAgents']=function(_0x2e7424,_0x3cf4d1,_0xe92f5d){return db[_0x2509('0x48')][_0x2509('0x57')]({'where':{'id':_0x2e7424[_0x2509('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3cf4d1,null))[_0x2509('0x2c')](function(_0x5a5929){if(_0x5a5929){return _0x5a5929[_0x2509('0x8e')](_0x2e7424[_0x2509('0x50')][_0x2509('0x69')],_[_0x2509('0x8f')](_0x2e7424[_0x2509('0x50')],[_0x2509('0x69'),'id'])||{})[_0x2509('0x90')](function(_0x3f52a1){for(var _0x56841f=0x0;_0x56841f<_0x2e7424[_0x2509('0x50')][_0x2509('0x69')][_0x2509('0x4e')];_0x56841f+=0x1){socket[_0x2509('0x75')]('userWhatsappQueue:save',{'UserId':Number(_0x2e7424[_0x2509('0x50')]['ids'][_0x56841f]),'WhatsappQueueId':Number(_0x2e7424[_0x2509('0x4d')]['id'])});}return _0x3f52a1;});}})['then'](respondWithResult(_0x3cf4d1,null))[_0x2509('0x4c')](handleError(_0x3cf4d1,null));};exports[_0x2509('0x91')]=function(_0x1b36f5,_0x410b6b,_0x2f4f6e){return db[_0x2509('0x48')]['find']({'where':{'id':_0x1b36f5[_0x2509('0x4d')]['id']}})[_0x2509('0x2c')](handleEntityNotFound(_0x410b6b,null))[_0x2509('0x2c')](function(_0x17cfff){if(_0x17cfff){return _0x17cfff['removeAgents'](_0x1b36f5['query']['ids'])[_0x2509('0x2c')](function(){if(_['isArray'](_0x1b36f5[_0x2509('0x3d')][_0x2509('0x69')])){for(var _0x216ec3=0x0;_0x216ec3<_0x1b36f5[_0x2509('0x3d')][_0x2509('0x69')][_0x2509('0x4e')];_0x216ec3+=0x1){socket[_0x2509('0x75')](_0x2509('0x8d'),{'UserId':Number(_0x1b36f5[_0x2509('0x3d')][_0x2509('0x69')][_0x216ec3]),'WhatsappQueueId':Number(_0x1b36f5[_0x2509('0x4d')]['id'])});}}else{socket[_0x2509('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x1b36f5[_0x2509('0x3d')][_0x2509('0x69')]),'WhatsappQueueId':Number(_0x1b36f5[_0x2509('0x4d')]['id'])});}});}})[_0x2509('0x2c')](respondWithStatusCode(_0x410b6b,null))[_0x2509('0x4c')](handleError(_0x410b6b,null));};exports[_0x2509('0x92')]=function(_0x5acc25,_0x46f5ad,_0x319e76){var _0x109eff={};var _0x3105a0={};var _0x4a1e08;var _0xbd0966;return db[_0x2509('0x48')][_0x2509('0x5a')]({'where':{'id':_0x5acc25[_0x2509('0x4d')]['id']}})['then'](handleEntityNotFound(_0x46f5ad,null))[_0x2509('0x2c')](function(_0xbf47a0){if(_0xbf47a0){_0x4a1e08=_0xbf47a0;_0x3105a0[_0x2509('0x3a')]=_[_0x2509('0x3c')](db[_0x2509('0x6c')][_0x2509('0x37')]);_0x3105a0[_0x2509('0x3d')]=_['keys'](_0x5acc25[_0x2509('0x3d')]);_0x3105a0[_0x2509('0x3e')]=_['intersection'](_0x3105a0[_0x2509('0x3a')],_0x3105a0[_0x2509('0x3d')]);_0x109eff[_0x2509('0x40')]=_['intersection'](_0x3105a0[_0x2509('0x3a')],qs[_0x2509('0x41')](_0x5acc25[_0x2509('0x3d')]['fields']));_0x109eff[_0x2509('0x40')]=_0x109eff[_0x2509('0x40')]['length']?_0x109eff[_0x2509('0x40')]:_0x3105a0[_0x2509('0x3a')];_0x109eff[_0x2509('0x5d')]=qs['sort'](_0x5acc25['query'][_0x2509('0x42')]);_0x109eff[_0x2509('0x43')]=qs['filters'](_[_0x2509('0x44')](_0x5acc25[_0x2509('0x3d')],_0x3105a0[_0x2509('0x3e')]));if(_0x5acc25['query'][_0x2509('0x45')]){_0x109eff['where']=_['merge'](_0x109eff[_0x2509('0x43')],{'$or':_[_0x2509('0x3b')](_0x109eff[_0x2509('0x40')],function(_0x5c2aed){var _0x1086a0={};_0x1086a0[_0x5c2aed]={'$like':'%'+_0x5acc25[_0x2509('0x3d')][_0x2509('0x45')]+'%'};return _0x1086a0;})});}_0x109eff=_[_0x2509('0x46')]({},_0x109eff,_0x5acc25[_0x2509('0x47')]);return _0x4a1e08[_0x2509('0x92')](_0x109eff);}})[_0x2509('0x2c')](function(_0x35cebe){if(_0x35cebe){_0xbd0966=_0x35cebe[_0x2509('0x4e')];if(!_0x5acc25[_0x2509('0x3d')][_0x2509('0x5b')](_0x2509('0x5c'))){_0x109eff[_0x2509('0x23')]=qs[_0x2509('0x23')](_0x5acc25[_0x2509('0x3d')][_0x2509('0x23')]);_0x109eff[_0x2509('0x22')]=qs[_0x2509('0x22')](_0x5acc25[_0x2509('0x3d')]['offset']);}return _0x4a1e08[_0x2509('0x92')](_0x109eff);}})['then'](function(_0x5caba5){if(_0x5caba5){return _0x5caba5?{'count':_0xbd0966,'rows':_0x5caba5}:null;}})[_0x2509('0x2c')](respondWithResult(_0x46f5ad,null))['catch'](handleError(_0x46f5ad,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 8a27b0b..f9dce88 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 _0x6fa3=['update','remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue','setMaxListeners','save'];(function(_0x3ef484,_0x80aef8){var _0x26817c=function(_0x349a7c){while(--_0x349a7c){_0x3ef484['push'](_0x3ef484['shift']());}};_0x26817c(++_0x80aef8);}(_0x6fa3,0x16e));var _0x36fa=function(_0x2425e9,_0x5bbd2d){_0x2425e9=_0x2425e9-0x0;var _0x1dea52=_0x6fa3[_0x2425e9];return _0x1dea52;};'use strict';var EventEmitter=require(_0x36fa('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x36fa('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x36fa('0x2')](0x0);var events={'afterCreate':_0x36fa('0x3'),'afterUpdate':_0x36fa('0x4'),'afterDestroy':_0x36fa('0x5')};function emitEvent(_0x4b0f60){return function(_0x3de7ab,_0x779c66,_0x2a2a5f){WhatsappQueueEvents['emit'](_0x4b0f60+':'+_0x3de7ab['id'],_0x3de7ab);WhatsappQueueEvents[_0x36fa('0x6')](_0x4b0f60,_0x3de7ab);_0x2a2a5f(null);};}for(var e in events){if(events[_0x36fa('0x7')](e)){var event=events[e];WhatsappQueue[_0x36fa('0x8')](e,emitEvent(event));}}module[_0x36fa('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xdea1=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue'];(function(_0x21aae8,_0x37d176){var _0x138b74=function(_0x30a718){while(--_0x30a718){_0x21aae8['push'](_0x21aae8['shift']());}};_0x138b74(++_0x37d176);}(_0xdea1,0xb6));var _0x1dea=function(_0x3e8b11,_0x34c43c){_0x3e8b11=_0x3e8b11-0x0;var _0x5ea28e=_0xdea1[_0x3e8b11];return _0x5ea28e;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x1dea('0x0'))['db'][_0x1dea('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1dea('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1dea('0x3'),'afterDestroy':'remove'};function emitEvent(_0x554b31){return function(_0x572391,_0x598423,_0x55252d){WhatsappQueueEvents[_0x1dea('0x4')](_0x554b31+':'+_0x572391['id'],_0x572391);WhatsappQueueEvents[_0x1dea('0x4')](_0x554b31,_0x572391);_0x55252d(null);};}for(var e in events){if(events[_0x1dea('0x5')](e)){var event=events[e];WhatsappQueue[_0x1dea('0x6')](e,emitEvent(event));}}module[_0x1dea('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 2b69db8..360b76b 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 _0x49d2=['../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x221209,_0x275d5f){var _0x56f9a4=function(_0x21e20e){while(--_0x21e20e){_0x221209['push'](_0x221209['shift']());}};_0x56f9a4(++_0x275d5f);}(_0x49d2,0x102));var _0x249d=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x49d2[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x249d('0x0'));var util=require(_0x249d('0x1'));var logger=require(_0x249d('0x2'))(_0x249d('0x3'));var moment=require(_0x249d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x249d('0x5'));var rimraf=require(_0x249d('0x6'));var config=require(_0x249d('0x7'));var attributes=require(_0x249d('0x8'));module[_0x249d('0x9')]=function(_0x211bb8,_0x5e1fec){return _0x211bb8[_0x249d('0xa')](_0x249d('0xb'),attributes,{'tableName':_0x249d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6dfd=['moment','bluebird','request-promise','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6dfd,0x7a));var _0xd6df=function(_0x483d2a,_0x4bffba){_0x483d2a=_0x483d2a-0x0;var _0x5ba5d5=_0x6dfd[_0x483d2a];return _0x5ba5d5;};'use strict';var _=require(_0xd6df('0x0'));var util=require(_0xd6df('0x1'));var logger=require(_0xd6df('0x2'))(_0xd6df('0x3'));var moment=require(_0xd6df('0x4'));var BPromise=require(_0xd6df('0x5'));var rp=require(_0xd6df('0x6'));var fs=require('fs');var path=require(_0xd6df('0x7'));var rimraf=require(_0xd6df('0x8'));var config=require('../../config/environment');var attributes=require(_0xd6df('0x9'));module[_0xd6df('0xa')]=function(_0x9e315e,_0x31d943){return _0x9e315e[_0xd6df('0xb')](_0xd6df('0xc'),attributes,{'tableName':_0xd6df('0xd'),'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 cf3c0cd..166265d 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 _0xb43a=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowWhatsappQueue','find','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0xb43a,0x1c6));var _0xab43=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0xb43a[_0x307bf6];return _0x2878fc;};'use strict';var _=require(_0xab43('0x0'));var util=require(_0xab43('0x1'));var moment=require(_0xab43('0x2'));var BPromise=require('bluebird');var rs=require(_0xab43('0x3'));var fs=require('fs');var Redis=require(_0xab43('0x4'));var db=require(_0xab43('0x5'))['db'];var utils=require(_0xab43('0x6'));var logger=require(_0xab43('0x7'))(_0xab43('0x8'));var config=require(_0xab43('0x9'));var jayson=require(_0xab43('0xa'));var client=jayson[_0xab43('0xb')][_0xab43('0xc')]({'port':0x232a});config[_0xab43('0xd')]=_[_0xab43('0xe')](config[_0xab43('0xd')],{'host':_0xab43('0xf'),'port':0x18eb});var socket=require(_0xab43('0x10'))(new Redis(config[_0xab43('0xd')]));require(_0xab43('0x11'))[_0xab43('0x12')](socket);function respondWithRpcPromise(_0x2af853,_0x4601d1,_0x16ba98){return new BPromise(function(_0x1dbdf1,_0x39a383){return client['request'](_0x2af853,_0x16ba98)['then'](function(_0x31522b){logger['info'](_0xab43('0x13'),_0x4601d1,'request\x20sent');logger[_0xab43('0x14')](_0xab43('0x15'),_0x4601d1,_0xab43('0x16'),JSON[_0xab43('0x17')](_0x31522b));if(_0x31522b[_0xab43('0x18')]){if(_0x31522b[_0xab43('0x18')][_0xab43('0x19')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x4601d1,_0x31522b[_0xab43('0x18')][_0xab43('0x1a')]);return _0x39a383(_0x31522b[_0xab43('0x18')][_0xab43('0x1a')]);}logger[_0xab43('0x18')](_0xab43('0x13'),_0x4601d1,_0x31522b[_0xab43('0x18')][_0xab43('0x1a')]);return _0x1dbdf1(_0x31522b[_0xab43('0x18')][_0xab43('0x1a')]);}else{logger[_0xab43('0x1b')](_0xab43('0x13'),_0x4601d1,_0xab43('0x16'));_0x1dbdf1(_0x31522b['result']['message']);}})['catch'](function(_0x545331){logger[_0xab43('0x18')](_0xab43('0x13'),_0x4601d1,_0x545331);_0x39a383(_0x545331);});});}exports[_0xab43('0x1c')]=function(_0x32c4ec){var _0x3ac300=this;return new Promise(function(_0x1f838f,_0x1c0238){return db[_0xab43('0x1d')][_0xab43('0x1e')]({'raw':_0x32c4ec[_0xab43('0x1f')]?_0x32c4ec['options'][_0xab43('0x20')]===undefined?!![]:![]:!![],'where':_0x32c4ec[_0xab43('0x1f')]?_0x32c4ec[_0xab43('0x1f')][_0xab43('0x21')]||null:null,'attributes':_0x32c4ec[_0xab43('0x1f')]?_0x32c4ec[_0xab43('0x1f')][_0xab43('0x22')]||null:null,'limit':_0x32c4ec[_0xab43('0x1f')]?_0x32c4ec[_0xab43('0x1f')]['limit']||null:null,'include':_0x32c4ec[_0xab43('0x1f')]?_0x32c4ec['options'][_0xab43('0x23')]?_[_0xab43('0x24')](_0x32c4ec[_0xab43('0x1f')][_0xab43('0x23')],function(_0x59ccbb){return{'model':db[_0x59ccbb[_0xab43('0x25')]],'as':_0x59ccbb['as'],'attributes':_0x59ccbb[_0xab43('0x22')],'include':_0x59ccbb['include']?_['map'](_0x59ccbb['include'],function(_0x1a1d9f){return{'model':db[_0x1a1d9f['model']],'as':_0x1a1d9f['as'],'attributes':_0x1a1d9f[_0xab43('0x22')],'include':_0x1a1d9f[_0xab43('0x23')]?_[_0xab43('0x24')](_0x1a1d9f[_0xab43('0x23')],function(_0xccb705){return{'model':db[_0xccb705[_0xab43('0x25')]],'as':_0xccb705['as'],'attributes':_0xccb705[_0xab43('0x22')]};}):[]};}):[]};}):[]:[]})[_0xab43('0x26')](function(_0x33edc4){logger[_0xab43('0x1b')](_0xab43('0x1c'),_0x32c4ec);logger[_0xab43('0x14')](_0xab43('0x1c'),_0x32c4ec,JSON[_0xab43('0x17')](_0x33edc4));_0x1f838f(_0x33edc4);})['catch'](function(_0x4e84e8){logger[_0xab43('0x18')](_0xab43('0x1c'),_0x4e84e8[_0xab43('0x1a')],_0x32c4ec);_0x1c0238(_0x3ac300[_0xab43('0x18')](0x1f4,_0x4e84e8[_0xab43('0x1a')]));});});};exports[_0xab43('0x27')]=function(_0x2a0b37){var _0x34d53e=this;return new Promise(function(_0x572e88,_0xfe1cd5){return db['WhatsappQueue'][_0xab43('0x28')]({'raw':_0x2a0b37['options']?_0x2a0b37[_0xab43('0x1f')][_0xab43('0x20')]===undefined?!![]:![]:!![],'where':_0x2a0b37[_0xab43('0x1f')]?_0x2a0b37[_0xab43('0x1f')][_0xab43('0x21')]||null:null,'attributes':_0x2a0b37['options']?_0x2a0b37['options'][_0xab43('0x22')]||null:null,'include':_0x2a0b37['options']?_0x2a0b37[_0xab43('0x1f')][_0xab43('0x23')]?_[_0xab43('0x24')](_0x2a0b37['options'][_0xab43('0x23')],function(_0xa1eccd){return{'model':db[_0xa1eccd[_0xab43('0x25')]],'as':_0xa1eccd['as'],'attributes':_0xa1eccd['attributes'],'include':_0xa1eccd['include']?_[_0xab43('0x24')](_0xa1eccd['include'],function(_0xedb58e){return{'model':db[_0xedb58e[_0xab43('0x25')]],'as':_0xedb58e['as'],'attributes':_0xedb58e[_0xab43('0x22')],'include':_0xedb58e[_0xab43('0x23')]?_[_0xab43('0x24')](_0xedb58e['include'],function(_0x4a6b8a){return{'model':db[_0x4a6b8a[_0xab43('0x25')]],'as':_0x4a6b8a['as'],'attributes':_0x4a6b8a[_0xab43('0x22')]};}):[]};}):[]};}):[]:[]})[_0xab43('0x26')](function(_0x23b138){logger[_0xab43('0x1b')](_0xab43('0x27'),_0x2a0b37);logger['debug'](_0xab43('0x27'),_0x2a0b37,JSON['stringify'](_0x23b138));_0x572e88(_0x23b138);})[_0xab43('0x29')](function(_0x8af2d6){logger[_0xab43('0x18')](_0xab43('0x27'),_0x8af2d6[_0xab43('0x1a')],_0x2a0b37);_0xfe1cd5(_0x34d53e[_0xab43('0x18')](0x1f4,_0x8af2d6[_0xab43('0x1a')]));});});}; \ No newline at end of file +var _0x79e5=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','map','include','model','info','ShowWhatsappQueue'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x79e5,0x98));var _0x579e=function(_0x142b78,_0x2c9f77){_0x142b78=_0x142b78-0x0;var _0x19abab=_0x79e5[_0x142b78];return _0x19abab;};'use strict';var _=require(_0x579e('0x0'));var util=require(_0x579e('0x1'));var moment=require('moment');var BPromise=require(_0x579e('0x2'));var rs=require(_0x579e('0x3'));var fs=require('fs');var Redis=require(_0x579e('0x4'));var db=require(_0x579e('0x5'))['db'];var utils=require(_0x579e('0x6'));var logger=require(_0x579e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x579e('0x8')][_0x579e('0x9')]({'port':0x232a});config[_0x579e('0xa')]=_['defaults'](config[_0x579e('0xa')],{'host':_0x579e('0xb'),'port':0x18eb});var socket=require(_0x579e('0xc'))(new Redis(config[_0x579e('0xa')]));require(_0x579e('0xd'))[_0x579e('0xe')](socket);function respondWithRpcPromise(_0xba56b6,_0x59408a,_0x573511){return new BPromise(function(_0x40fbf0,_0x34995f){return client['request'](_0xba56b6,_0x573511)[_0x579e('0xf')](function(_0xfec9b3){logger['info'](_0x579e('0x10'),_0x59408a,_0x579e('0x11'));logger[_0x579e('0x12')](_0x579e('0x13'),_0x59408a,'request\x20sent',JSON[_0x579e('0x14')](_0xfec9b3));if(_0xfec9b3[_0x579e('0x15')]){if(_0xfec9b3['error'][_0x579e('0x16')]===0x1f4){logger[_0x579e('0x15')](_0x579e('0x10'),_0x59408a,_0xfec9b3[_0x579e('0x15')][_0x579e('0x17')]);return _0x34995f(_0xfec9b3['error'][_0x579e('0x17')]);}logger[_0x579e('0x15')](_0x579e('0x10'),_0x59408a,_0xfec9b3[_0x579e('0x15')]['message']);return _0x40fbf0(_0xfec9b3[_0x579e('0x15')]['message']);}else{logger['info'](_0x579e('0x10'),_0x59408a,_0x579e('0x11'));_0x40fbf0(_0xfec9b3[_0x579e('0x18')][_0x579e('0x17')]);}})[_0x579e('0x19')](function(_0xf7f798){logger[_0x579e('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x59408a,_0xf7f798);_0x34995f(_0xf7f798);});});}exports[_0x579e('0x1a')]=function(_0x52329a){var _0x4f75c2=this;return new Promise(function(_0x5ad6b4,_0x4fc45b){return db[_0x579e('0x1b')]['findAll']({'raw':_0x52329a[_0x579e('0x1c')]?_0x52329a['options'][_0x579e('0x1d')]===undefined?!![]:![]:!![],'where':_0x52329a['options']?_0x52329a[_0x579e('0x1c')][_0x579e('0x1e')]||null:null,'attributes':_0x52329a[_0x579e('0x1c')]?_0x52329a[_0x579e('0x1c')][_0x579e('0x1f')]||null:null,'limit':_0x52329a['options']?_0x52329a['options'][_0x579e('0x20')]||null:null,'include':_0x52329a[_0x579e('0x1c')]?_0x52329a[_0x579e('0x1c')]['include']?_[_0x579e('0x21')](_0x52329a[_0x579e('0x1c')][_0x579e('0x22')],function(_0x549ba1){return{'model':db[_0x549ba1['model']],'as':_0x549ba1['as'],'attributes':_0x549ba1[_0x579e('0x1f')],'include':_0x549ba1[_0x579e('0x22')]?_[_0x579e('0x21')](_0x549ba1['include'],function(_0x5e7aa0){return{'model':db[_0x5e7aa0[_0x579e('0x23')]],'as':_0x5e7aa0['as'],'attributes':_0x5e7aa0['attributes'],'include':_0x5e7aa0['include']?_['map'](_0x5e7aa0[_0x579e('0x22')],function(_0x50254c){return{'model':db[_0x50254c[_0x579e('0x23')]],'as':_0x50254c['as'],'attributes':_0x50254c['attributes']};}):[]};}):[]};}):[]:[]})[_0x579e('0xf')](function(_0x4b914c){logger[_0x579e('0x24')]('GetWhatsappQueue',_0x52329a);logger['debug']('GetWhatsappQueue',_0x52329a,JSON[_0x579e('0x14')](_0x4b914c));_0x5ad6b4(_0x4b914c);})['catch'](function(_0x42d519){logger[_0x579e('0x15')](_0x579e('0x1a'),_0x42d519[_0x579e('0x17')],_0x52329a);_0x4fc45b(_0x4f75c2['error'](0x1f4,_0x42d519[_0x579e('0x17')]));});});};exports[_0x579e('0x25')]=function(_0x26672d){var _0x475d54=this;return new Promise(function(_0x3ace5a,_0x5bfe69){return db[_0x579e('0x1b')]['find']({'raw':_0x26672d[_0x579e('0x1c')]?_0x26672d['options'][_0x579e('0x1d')]===undefined?!![]:![]:!![],'where':_0x26672d['options']?_0x26672d[_0x579e('0x1c')]['where']||null:null,'attributes':_0x26672d[_0x579e('0x1c')]?_0x26672d['options']['attributes']||null:null,'include':_0x26672d[_0x579e('0x1c')]?_0x26672d[_0x579e('0x1c')][_0x579e('0x22')]?_[_0x579e('0x21')](_0x26672d['options'][_0x579e('0x22')],function(_0x2fa1dc){return{'model':db[_0x2fa1dc[_0x579e('0x23')]],'as':_0x2fa1dc['as'],'attributes':_0x2fa1dc[_0x579e('0x1f')],'include':_0x2fa1dc['include']?_[_0x579e('0x21')](_0x2fa1dc['include'],function(_0x480031){return{'model':db[_0x480031[_0x579e('0x23')]],'as':_0x480031['as'],'attributes':_0x480031[_0x579e('0x1f')],'include':_0x480031['include']?_[_0x579e('0x21')](_0x480031[_0x579e('0x22')],function(_0x31c26b){return{'model':db[_0x31c26b[_0x579e('0x23')]],'as':_0x31c26b['as'],'attributes':_0x31c26b['attributes']};}):[]};}):[]};}):[]:[]})[_0x579e('0xf')](function(_0x398562){logger[_0x579e('0x24')](_0x579e('0x25'),_0x26672d);logger[_0x579e('0x12')]('ShowWhatsappQueue',_0x26672d,JSON[_0x579e('0x14')](_0x398562));_0x3ace5a(_0x398562);})[_0x579e('0x19')](function(_0x50602c){logger['error']('ShowWhatsappQueue',_0x50602c['message'],_0x26672d);_0x5bfe69(_0x475d54[_0x579e('0x15')](0x1f4,_0x50602c[_0x579e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index cf5f406..d4bfd09 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 _0x99e0=['./whatsappQueue.events','save','remove','emit','register','length','whatsappQueue:'];(function(_0x5deded,_0x4dc023){var _0x7220bc=function(_0x4a0222){while(--_0x4a0222){_0x5deded['push'](_0x5deded['shift']());}};_0x7220bc(++_0x4dc023);}(_0x99e0,0x85));var _0x099e=function(_0x482080,_0x599d71){_0x482080=_0x482080-0x0;var _0x265ddd=_0x99e0[_0x482080];return _0x265ddd;};'use strict';var WhatsappQueueEvents=require(_0x099e('0x0'));var events=[_0x099e('0x1'),_0x099e('0x2'),'update'];function createListener(_0x384780,_0x20b02d){return function(_0x1c8e41){_0x20b02d[_0x099e('0x3')](_0x384780,_0x1c8e41);};}function removeListener(_0x46f6fe,_0x36dfe8){return function(){WhatsappQueueEvents['removeListener'](_0x46f6fe,_0x36dfe8);};}exports[_0x099e('0x4')]=function(_0x336032){for(var _0xfb687c=0x0,_0x40cea7=events[_0x099e('0x5')];_0xfb687c<_0x40cea7;_0xfb687c++){var _0x490c0b=events[_0xfb687c];var _0x5b4ed0=createListener(_0x099e('0x6')+_0x490c0b,_0x336032);WhatsappQueueEvents['on'](_0x490c0b,_0x5b4ed0);}}; \ No newline at end of file +var _0x578d=['update','emit','register','whatsappQueue:','./whatsappQueue.events','remove'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0x578d,0x148));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require(_0xd578('0x0'));var events=['save',_0xd578('0x1'),_0xd578('0x2')];function createListener(_0xb61f6,_0x445e6c){return function(_0x4b149a){_0x445e6c[_0xd578('0x3')](_0xb61f6,_0x4b149a);};}function removeListener(_0x333558,_0x3b3ff8){return function(){WhatsappQueueEvents['removeListener'](_0x333558,_0x3b3ff8);};}exports[_0xd578('0x4')]=function(_0x25f7f7){for(var _0x249801=0x0,_0x73b6ad=events['length'];_0x249801<_0x73b6ad;_0x249801++){var _0x32c310=events[_0x249801];var _0x1a2921=createListener(_0xd578('0x5')+_0x32c310,_0x25f7f7);WhatsappQueueEvents['on'](_0x32c310,_0x1a2921);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index a0be7b7..041f976 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 _0x3e6e=['get','isAuthenticated','/:id','post','create','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller'];(function(_0x5917a3,_0x3e2a23){var _0xcd765=function(_0x202a77){while(--_0x202a77){_0x5917a3['push'](_0x5917a3['shift']());}};_0xcd765(++_0x3e2a23);}(_0x3e6e,0x76));var _0xe3e6=function(_0x3d6ff1,_0x362706){_0x3d6ff1=_0x3d6ff1-0x0;var _0x3abdd8=_0x3e6e[_0x3d6ff1];return _0x3abdd8;};'use strict';var multer=require('multer');var util=require(_0xe3e6('0x0'));var path=require(_0xe3e6('0x1'));var timeout=require(_0xe3e6('0x2'));var express=require(_0xe3e6('0x3'));var router=express[_0xe3e6('0x4')]();var fs_extra=require(_0xe3e6('0x5'));var auth=require(_0xe3e6('0x6'));var interaction=require(_0xe3e6('0x7'));var config=require(_0xe3e6('0x8'));var controller=require(_0xe3e6('0x9'));router[_0xe3e6('0xa')]('/',auth[_0xe3e6('0xb')](),controller['index']);router[_0xe3e6('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xe3e6('0xa')](_0xe3e6('0xc'),auth[_0xe3e6('0xb')](),controller['show']);router[_0xe3e6('0xd')]('/',auth['isAuthenticated'](),controller[_0xe3e6('0xe')]);router['put'](_0xe3e6('0xc'),auth[_0xe3e6('0xb')](),controller[_0xe3e6('0xf')]);router['delete'](_0xe3e6('0xc'),auth[_0xe3e6('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbd28=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1bdae7,_0x54b5e5){var _0x2abd0e=function(_0x2e956a){while(--_0x2e956a){_0x1bdae7['push'](_0x1bdae7['shift']());}};_0x2abd0e(++_0x54b5e5);}(_0xbd28,0x6c));var _0x8bd2=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0xbd28[_0x25d2fb];return _0x1ded53;};'use strict';var multer=require(_0x8bd2('0x0'));var util=require(_0x8bd2('0x1'));var path=require(_0x8bd2('0x2'));var timeout=require(_0x8bd2('0x3'));var express=require('express');var router=express[_0x8bd2('0x4')]();var fs_extra=require(_0x8bd2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8bd2('0x6'));var config=require(_0x8bd2('0x7'));var controller=require(_0x8bd2('0x8'));router[_0x8bd2('0x9')]('/',auth[_0x8bd2('0xa')](),controller[_0x8bd2('0xb')]);router[_0x8bd2('0x9')](_0x8bd2('0xc'),auth['isAuthenticated'](),controller[_0x8bd2('0xd')]);router[_0x8bd2('0x9')](_0x8bd2('0xe'),auth[_0x8bd2('0xa')](),controller['show']);router['post']('/',auth[_0x8bd2('0xa')](),controller['create']);router[_0x8bd2('0xf')](_0x8bd2('0xe'),auth[_0x8bd2('0xa')](),controller[_0x8bd2('0x10')]);router[_0x8bd2('0x11')]('/:id',auth[_0x8bd2('0xa')](),controller['destroy']);module[_0x8bd2('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 63af2e7..136dc95 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(_0x31a638,_0x5d8226){var _0x4ae6c2=function(_0x4c5878){while(--_0x4c5878){_0x31a638['push'](_0x31a638['shift']());}};_0x4ae6c2(++_0x5d8226);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x230fbe,_0x4d893b){var _0x49adb1=function(_0x4bba62){while(--_0x4bba62){_0x230fbe['push'](_0x230fbe['shift']());}};_0x49adb1(++_0x4d893b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 55f3ae2..0e98727 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 _0x3f8c=['end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2c249a,_0x4a6096){var _0x3edb89=function(_0x46f832){while(--_0x46f832){_0x2c249a['push'](_0x2c249a['shift']());}};_0x3edb89(++_0x4a6096);}(_0x3f8c,0x104));var _0xc3f8=function(_0x1a91fe,_0x5c66ec){_0x1a91fe=_0x1a91fe-0x0;var _0x58cc44=_0x3f8c[_0x1a91fe];return _0x58cc44;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={},_0x218029={},_0x5bf6e2={'count':0x0,'rows':[]};var _0x151bba=_['map'](db[_0xc3f8('0x27')][_0xc3f8('0x28')],function(_0x47ab53){return{'name':_0x47ab53['fieldName'],'type':_0x47ab53[_0xc3f8('0x29')][_0xc3f8('0x2a')]};});_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x151bba,_0xc3f8('0x24'));_0x218029[_0xc3f8('0x2d')]=_[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2d')]);_0x218029[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x218029['model'],_0x218029[_0xc3f8('0x2d')]);_0x2909f8[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x218029[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x59e4dd['query']['fields']));_0x2909f8[_0xc3f8('0x31')]=_0x2909f8[_0xc3f8('0x31')][_0xc3f8('0x33')]?_0x2909f8[_0xc3f8('0x31')]:_0x218029[_0xc3f8('0x2b')];if(!_0x59e4dd['query'][_0xc3f8('0x34')](_0xc3f8('0x35'))){_0x2909f8[_0xc3f8('0x1b')]=qs['limit'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1b')]);_0x2909f8[_0xc3f8('0x1a')]=qs['offset'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1a')]);}_0x2909f8['order']=qs[_0xc3f8('0x36')](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x36')]);_0x2909f8[_0xc3f8('0x37')]=qs[_0xc3f8('0x2f')](_[_0xc3f8('0x38')](_0x59e4dd['query'],_0x218029[_0xc3f8('0x2f')]),_0x151bba);if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]){_0x2909f8[_0xc3f8('0x37')]=_[_0xc3f8('0x3a')](_0x2909f8['where'],{'$or':_[_0xc3f8('0x2c')](_0x151bba,function(_0x4451a2){if(_0x4451a2[_0xc3f8('0x29')]!=='VIRTUAL'){var _0x316643={};_0x316643[_0x4451a2[_0xc3f8('0x24')]]={'$like':'%'+_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]+'%'};return _0x316643;}})});}_0x2909f8=_['merge']({},_0x2909f8,_0x59e4dd[_0xc3f8('0x3b')]);var _0x45d416={'where':_0x2909f8[_0xc3f8('0x37')]};return db[_0xc3f8('0x27')]['count'](_0x45d416)[_0xc3f8('0x21')](function(_0x5db44d){_0x5bf6e2['count']=_0x5db44d;if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x3c')]){_0x2909f8[_0xc3f8('0x3d')]=[{'all':!![]}];}return db[_0xc3f8('0x27')]['findAll'](_0x2909f8);})['then'](function(_0x361a85){_0x5bf6e2[_0xc3f8('0x3e')]=_0x361a85;return _0x5bf6e2;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x58b303,_0x2909f8))[_0xc3f8('0x3f')](handleError(_0x58b303,null));};exports[_0xc3f8('0x40')]=function(_0x465547,_0x3113b4){var _0x45e6ea={'raw':!![],'where':{'id':_0x465547[_0xc3f8('0x41')]['id']}},_0x13d8dc={};_0x13d8dc[_0xc3f8('0x2b')]=_['keys'](db[_0xc3f8('0x27')][_0xc3f8('0x28')]);_0x13d8dc['query']=_[_0xc3f8('0x2e')](_0x465547[_0xc3f8('0x2d')]);_0x13d8dc['filters']=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],_0x13d8dc[_0xc3f8('0x2d')]);_0x45e6ea[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x465547[_0xc3f8('0x2d')][_0xc3f8('0x32')]));_0x45e6ea[_0xc3f8('0x31')]=_0x45e6ea[_0xc3f8('0x31')]['length']?_0x45e6ea[_0xc3f8('0x31')]:_0x13d8dc[_0xc3f8('0x2b')];if(_0x465547['query'][_0xc3f8('0x3c')]){_0x45e6ea[_0xc3f8('0x3d')]=[{'all':!![]}];}_0x45e6ea=_[_0xc3f8('0x3a')]({},_0x45e6ea,_0x465547[_0xc3f8('0x3b')]);return db['WhatsappQueueReport']['find'](_0x45e6ea)[_0xc3f8('0x21')](handleEntityNotFound(_0x3113b4,null))[_0xc3f8('0x21')](respondWithResult(_0x3113b4,null))[_0xc3f8('0x3f')](handleError(_0x3113b4,null));};exports['create']=function(_0x1b5777,_0x3a665e){return db[_0xc3f8('0x27')][_0xc3f8('0x42')](_0x1b5777[_0xc3f8('0x43')],{})['then'](respondWithResult(_0x3a665e,0xc9))[_0xc3f8('0x3f')](handleError(_0x3a665e,null));};exports[_0xc3f8('0x20')]=function(_0x5961ab,_0x1becae){if(_0x5961ab[_0xc3f8('0x43')]['id']){delete _0x5961ab[_0xc3f8('0x43')]['id'];}return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x5961ab[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1becae,null))['then'](saveUpdates(_0x5961ab[_0xc3f8('0x43')],null))[_0xc3f8('0x21')](respondWithResult(_0x1becae,null))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x45')]=function(_0x2e9f93,_0x2448bf){return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x2e9f93[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x2448bf,null))['then'](removeEntity(_0x2448bf,null))[_0xc3f8('0x3f')](handleError(_0x2448bf,null));};exports[_0xc3f8('0x46')]=function(_0x425fee,_0x267c95){return db[_0xc3f8('0x27')][_0xc3f8('0x46')]()[_0xc3f8('0x21')](respondWithResult(_0x267c95,null))[_0xc3f8('0x3f')](handleError(_0x267c95,null));}; \ No newline at end of file +var _0xd914=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','WhatsappQueueReport','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x308256,_0x353670){var _0x4626d3=function(_0x5d1903){while(--_0x5d1903){_0x308256['push'](_0x308256['shift']());}};_0x4626d3(++_0x353670);}(_0xd914,0x17f));var _0x4d91=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xd914[_0x8de54f];return _0x14cba4;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){_0x9cb864['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee6b3,_0x112923){return function(_0x3bed98){if(!_0x3bed98){_0x1ee6b3[_0x4d91('0x28')](0x194);}return _0x3bed98;};}function handleError(_0x472f3a,_0x2c7d7a){_0x2c7d7a=_0x2c7d7a||0x1f4;return function(_0x14bdb4){logger['error'](_0x14bdb4[_0x4d91('0x29')]);if(_0x14bdb4[_0x4d91('0x2a')]){delete _0x14bdb4[_0x4d91('0x2a')];}_0x472f3a['status'](_0x2c7d7a)['send'](_0x14bdb4);};}exports[_0x4d91('0x2b')]=function(_0x470079,_0x5ed948){var _0x50fe76={},_0x42d5a0={},_0x2d6981={'count':0x0,'rows':[]};var _0x43371e=_[_0x4d91('0x2c')](db['WhatsappQueueReport'][_0x4d91('0x2d')],function(_0x31bbf8){return{'name':_0x31bbf8[_0x4d91('0x2e')],'type':_0x31bbf8[_0x4d91('0x2f')][_0x4d91('0x30')]};});_0x42d5a0[_0x4d91('0x31')]=_[_0x4d91('0x2c')](_0x43371e,'name');_0x42d5a0[_0x4d91('0x32')]=_['keys'](_0x470079['query']);_0x42d5a0[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x42d5a0['model'],_0x42d5a0[_0x4d91('0x32')]);_0x50fe76[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x42d5a0[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x470079['query'][_0x4d91('0x36')]));_0x50fe76[_0x4d91('0x35')]=_0x50fe76[_0x4d91('0x35')][_0x4d91('0x37')]?_0x50fe76[_0x4d91('0x35')]:_0x42d5a0[_0x4d91('0x31')];if(!_0x470079['query'][_0x4d91('0x38')](_0x4d91('0x39'))){_0x50fe76['limit']=qs[_0x4d91('0x3a')](_0x470079[_0x4d91('0x32')][_0x4d91('0x3a')]);_0x50fe76['offset']=qs[_0x4d91('0x1e')](_0x470079[_0x4d91('0x32')][_0x4d91('0x1e')]);}_0x50fe76[_0x4d91('0x3b')]=qs['sort'](_0x470079[_0x4d91('0x32')][_0x4d91('0x3c')]);_0x50fe76[_0x4d91('0x3d')]=qs[_0x4d91('0x33')](_['pick'](_0x470079['query'],_0x42d5a0[_0x4d91('0x33')]),_0x43371e);if(_0x470079[_0x4d91('0x32')]['filter']){_0x50fe76[_0x4d91('0x3d')]=_[_0x4d91('0x3e')](_0x50fe76[_0x4d91('0x3d')],{'$or':_[_0x4d91('0x2c')](_0x43371e,function(_0x5d93c1){if(_0x5d93c1[_0x4d91('0x2f')]!==_0x4d91('0x3f')){var _0x571a0c={};_0x571a0c[_0x5d93c1[_0x4d91('0x2a')]]={'$like':'%'+_0x470079['query'][_0x4d91('0x40')]+'%'};return _0x571a0c;}})});}_0x50fe76=_['merge']({},_0x50fe76,_0x470079[_0x4d91('0x41')]);var _0x49742b={'where':_0x50fe76[_0x4d91('0x3d')]};return db[_0x4d91('0x42')][_0x4d91('0x20')](_0x49742b)[_0x4d91('0x26')](function(_0x4f6576){_0x2d6981['count']=_0x4f6576;if(_0x470079[_0x4d91('0x32')]['includeAll']){_0x50fe76[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x42')]['findAll'](_0x50fe76);})[_0x4d91('0x26')](function(_0x2ae356){_0x2d6981[_0x4d91('0x44')]=_0x2ae356;return _0x2d6981;})[_0x4d91('0x26')](respondWithFilteredResult(_0x5ed948,_0x50fe76))[_0x4d91('0x45')](handleError(_0x5ed948,null));};exports[_0x4d91('0x46')]=function(_0x23902f,_0x4f6254){var _0x1e4c6d={'raw':!![],'where':{'id':_0x23902f[_0x4d91('0x47')]['id']}},_0x4c70af={};_0x4c70af[_0x4d91('0x31')]=_[_0x4d91('0x48')](db[_0x4d91('0x42')][_0x4d91('0x2d')]);_0x4c70af[_0x4d91('0x32')]=_['keys'](_0x23902f['query']);_0x4c70af[_0x4d91('0x33')]=_[_0x4d91('0x34')](_0x4c70af['model'],_0x4c70af[_0x4d91('0x32')]);_0x1e4c6d[_0x4d91('0x35')]=_[_0x4d91('0x34')](_0x4c70af[_0x4d91('0x31')],qs[_0x4d91('0x36')](_0x23902f[_0x4d91('0x32')][_0x4d91('0x36')]));_0x1e4c6d[_0x4d91('0x35')]=_0x1e4c6d[_0x4d91('0x35')]['length']?_0x1e4c6d['attributes']:_0x4c70af[_0x4d91('0x31')];if(_0x23902f['query'][_0x4d91('0x49')]){_0x1e4c6d[_0x4d91('0x43')]=[{'all':!![]}];}_0x1e4c6d=_[_0x4d91('0x3e')]({},_0x1e4c6d,_0x23902f[_0x4d91('0x41')]);return db['WhatsappQueueReport'][_0x4d91('0x4a')](_0x1e4c6d)['then'](handleEntityNotFound(_0x4f6254,null))['then'](respondWithResult(_0x4f6254,null))[_0x4d91('0x45')](handleError(_0x4f6254,null));};exports[_0x4d91('0x4b')]=function(_0x18073d,_0xa03d75){return db[_0x4d91('0x42')][_0x4d91('0x4b')](_0x18073d['body'],{})[_0x4d91('0x26')](respondWithResult(_0xa03d75,0xc9))[_0x4d91('0x45')](handleError(_0xa03d75,null));};exports[_0x4d91('0x25')]=function(_0x449dd8,_0x106e5b){if(_0x449dd8[_0x4d91('0x4c')]['id']){delete _0x449dd8[_0x4d91('0x4c')]['id'];}return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x449dd8[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x106e5b,null))['then'](saveUpdates(_0x449dd8[_0x4d91('0x4c')],null))['then'](respondWithResult(_0x106e5b,null))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x27')]=function(_0x195e65,_0x386935){return db[_0x4d91('0x42')][_0x4d91('0x4a')]({'where':{'id':_0x195e65[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x386935,null))['then'](removeEntity(_0x386935,null))[_0x4d91('0x45')](handleError(_0x386935,null));};exports[_0x4d91('0x4d')]=function(_0x3fe9ee,_0x2bba43){return db[_0x4d91('0x42')][_0x4d91('0x4d')]()[_0x4d91('0x26')](respondWithResult(_0x2bba43,null))['catch'](handleError(_0x2bba43,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 8d98ff3..dfcdd2b 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 _0x378f=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define'];(function(_0x3a8b2d,_0x4ea870){var _0x54f1be=function(_0x295c2c){while(--_0x295c2c){_0x3a8b2d['push'](_0x3a8b2d['shift']());}};_0x54f1be(++_0x4ea870);}(_0x378f,0xd5));var _0xf378=function(_0x2d29ad,_0xd8ce08){_0x2d29ad=_0x2d29ad-0x0;var _0x4567e2=_0x378f[_0x2d29ad];return _0x4567e2;};'use strict';var _=require(_0xf378('0x0'));var util=require('util');var logger=require(_0xf378('0x1'))('api');var moment=require(_0xf378('0x2'));var BPromise=require(_0xf378('0x3'));var rp=require(_0xf378('0x4'));var fs=require('fs');var path=require(_0xf378('0x5'));var rimraf=require(_0xf378('0x6'));var config=require(_0xf378('0x7'));var attributes=require(_0xf378('0x8'));module[_0xf378('0x9')]=function(_0x54fd12,_0x22d6d0){return _0x54fd12[_0xf378('0xa')](_0xf378('0xb'),attributes,{'tableName':_0xf378('0xc'),'paranoid':![],'indexes':[{'name':_0xf378('0xd'),'fields':[_0xf378('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e53=['exports','define','WhatsappQueueReport','uniqueid','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x2ce9c3,_0x20a165){var _0x109b3a=function(_0xfd90e2){while(--_0xfd90e2){_0x2ce9c3['push'](_0x2ce9c3['shift']());}};_0x109b3a(++_0x20a165);}(_0x0e53,0xe8));var _0x30e5=function(_0x14282a,_0x1cbb45){_0x14282a=_0x14282a-0x0;var _0x279a71=_0x0e53[_0x14282a];return _0x279a71;};'use strict';var _=require(_0x30e5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x30e5('0x1'));var moment=require('moment');var BPromise=require(_0x30e5('0x2'));var rp=require(_0x30e5('0x3'));var fs=require('fs');var path=require(_0x30e5('0x4'));var rimraf=require(_0x30e5('0x5'));var config=require(_0x30e5('0x6'));var attributes=require(_0x30e5('0x7'));module[_0x30e5('0x8')]=function(_0x941770,_0x695f83){return _0x941770[_0x30e5('0x9')](_0x30e5('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x30e5('0xb'),'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 8278496..2b34654 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 _0x4d82=['debug','error','code','message','info','result','catch','WhatsappQueueReport,\x20%s,\x20%s','CreateWhatsappQueueReport','WhatsappQueueReport','body','update','options','raw','where','attributes','UpdateWhatsappQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x4d82,0x1c4));var _0x24d8=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x4d82[_0x46c9cc];return _0x21b46e;};'use strict';var _=require(_0x24d8('0x0'));var util=require(_0x24d8('0x1'));var moment=require(_0x24d8('0x2'));var BPromise=require(_0x24d8('0x3'));var rs=require(_0x24d8('0x4'));var fs=require('fs');var Redis=require(_0x24d8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x24d8('0x6'));var logger=require('../../config/logger')(_0x24d8('0x7'));var config=require(_0x24d8('0x8'));var jayson=require(_0x24d8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x413404,_0x24def7,_0x526634){return new BPromise(function(_0x580646,_0x27e6fa){return client[_0x24d8('0xa')](_0x413404,_0x526634)[_0x24d8('0xb')](function(_0x2fe914){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x24def7,_0x24d8('0xc'));logger[_0x24d8('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x24def7,_0x24d8('0xc'),JSON['stringify'](_0x2fe914));if(_0x2fe914[_0x24d8('0xe')]){if(_0x2fe914['error'][_0x24d8('0xf')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x24def7,_0x2fe914['error'][_0x24d8('0x10')]);return _0x27e6fa(_0x2fe914['error'][_0x24d8('0x10')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x24def7,_0x2fe914[_0x24d8('0xe')][_0x24d8('0x10')]);return _0x580646(_0x2fe914['error'][_0x24d8('0x10')]);}else{logger[_0x24d8('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x24def7,'request\x20sent');_0x580646(_0x2fe914[_0x24d8('0x12')]['message']);}})[_0x24d8('0x13')](function(_0x3597a8){logger[_0x24d8('0xe')](_0x24d8('0x14'),_0x24def7,_0x3597a8);_0x27e6fa(_0x3597a8);});});}exports[_0x24d8('0x15')]=function(_0x4d6b26){var _0x13ed46=this;return new Promise(function(_0x876124,_0x4ce92a){return db[_0x24d8('0x16')]['create'](_0x4d6b26[_0x24d8('0x17')],{'raw':_0x4d6b26['options']?_0x4d6b26['options']['raw']===undefined?!![]:![]:!![]})[_0x24d8('0xb')](function(_0x550655){logger[_0x24d8('0x11')]('CreateWhatsappQueueReport',_0x4d6b26);logger[_0x24d8('0xd')](_0x24d8('0x15'),_0x4d6b26,JSON['stringify'](_0x550655));_0x876124(_0x550655);})[_0x24d8('0x13')](function(_0xb4c640){logger[_0x24d8('0xe')](_0x24d8('0x15'),_0xb4c640[_0x24d8('0x10')],_0x4d6b26);_0x4ce92a(_0x13ed46[_0x24d8('0xe')](0x1f4,_0xb4c640['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x339cbf){var _0x254748=this;return new Promise(function(_0x21d9c9,_0x1b2135){return db[_0x24d8('0x16')][_0x24d8('0x18')](_0x339cbf[_0x24d8('0x17')],{'raw':_0x339cbf['options']?_0x339cbf[_0x24d8('0x19')][_0x24d8('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339cbf[_0x24d8('0x19')]?_0x339cbf[_0x24d8('0x19')][_0x24d8('0x1b')]||null:null,'attributes':_0x339cbf['options']?_0x339cbf[_0x24d8('0x19')][_0x24d8('0x1c')]||null:null,'limit':_0x339cbf[_0x24d8('0x19')]?_0x339cbf[_0x24d8('0x19')]['limit']||null:null})[_0x24d8('0xb')](function(_0x132dfa){logger[_0x24d8('0x11')](_0x24d8('0x1d'),_0x339cbf);logger[_0x24d8('0xd')]('UpdateWhatsappQueueReport',_0x339cbf,JSON[_0x24d8('0x1e')](_0x132dfa));_0x21d9c9(_0x132dfa);})[_0x24d8('0x13')](function(_0x5996e0){logger[_0x24d8('0xe')](_0x24d8('0x1d'),_0x5996e0[_0x24d8('0x10')],_0x339cbf);_0x1b2135(_0x254748[_0x24d8('0xe')](0x1f4,_0x5996e0[_0x24d8('0x10')]));});});}; \ No newline at end of file +var _0x9554=['http','request','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','then','stringify','UpdateWhatsappQueueReport','update','body','where','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x467d01,_0x534186){var _0x571b42=function(_0x585498){while(--_0x585498){_0x467d01['push'](_0x467d01['shift']());}};_0x571b42(++_0x534186);}(_0x9554,0x130));var _0x4955=function(_0x32a292,_0x1d0313){_0x32a292=_0x32a292-0x0;var _0x19d845=_0x9554[_0x32a292];return _0x19d845;};'use strict';var _=require(_0x4955('0x0'));var util=require(_0x4955('0x1'));var moment=require(_0x4955('0x2'));var BPromise=require(_0x4955('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4955('0x4'))['db'];var utils=require(_0x4955('0x5'));var logger=require(_0x4955('0x6'))(_0x4955('0x7'));var config=require(_0x4955('0x8'));var jayson=require(_0x4955('0x9'));var client=jayson[_0x4955('0xa')][_0x4955('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13886f,_0x4cc664,_0x4473c3){return new BPromise(function(_0x100597,_0x535db9){return client[_0x4955('0xc')](_0x13886f,_0x4473c3)['then'](function(_0x1f8249){logger[_0x4955('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4cc664,'request\x20sent');logger[_0x4955('0xe')](_0x4955('0xf'),_0x4cc664,_0x4955('0x10'),JSON['stringify'](_0x1f8249));if(_0x1f8249['error']){if(_0x1f8249['error'][_0x4955('0x11')]===0x1f4){logger[_0x4955('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4cc664,_0x1f8249[_0x4955('0x12')][_0x4955('0x13')]);return _0x535db9(_0x1f8249[_0x4955('0x12')][_0x4955('0x13')]);}logger[_0x4955('0x12')](_0x4955('0x14'),_0x4cc664,_0x1f8249[_0x4955('0x12')]['message']);return _0x100597(_0x1f8249['error'][_0x4955('0x13')]);}else{logger['info'](_0x4955('0x14'),_0x4cc664,_0x4955('0x10'));_0x100597(_0x1f8249[_0x4955('0x15')]['message']);}})[_0x4955('0x16')](function(_0x1cf986){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x4cc664,_0x1cf986);_0x535db9(_0x1cf986);});});}exports[_0x4955('0x17')]=function(_0x3a4c23){var _0x3be85a=this;return new Promise(function(_0x187d08,_0x16c535){return db[_0x4955('0x18')][_0x4955('0x19')](_0x3a4c23['body'],{'raw':_0x3a4c23[_0x4955('0x1a')]?_0x3a4c23['options'][_0x4955('0x1b')]===undefined?!![]:![]:!![]})[_0x4955('0x1c')](function(_0x3dcdbd){logger[_0x4955('0xd')]('CreateWhatsappQueueReport',_0x3a4c23);logger['debug'](_0x4955('0x17'),_0x3a4c23,JSON[_0x4955('0x1d')](_0x3dcdbd));_0x187d08(_0x3dcdbd);})[_0x4955('0x16')](function(_0x293e62){logger[_0x4955('0x12')](_0x4955('0x17'),_0x293e62[_0x4955('0x13')],_0x3a4c23);_0x16c535(_0x3be85a[_0x4955('0x12')](0x1f4,_0x293e62[_0x4955('0x13')]));});});};exports[_0x4955('0x1e')]=function(_0x55f02e){var _0x82904=this;return new Promise(function(_0x525fba,_0x4f5fbe){return db['WhatsappQueueReport'][_0x4955('0x1f')](_0x55f02e[_0x4955('0x20')],{'raw':_0x55f02e[_0x4955('0x1a')]?_0x55f02e[_0x4955('0x1a')][_0x4955('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55f02e[_0x4955('0x1a')]?_0x55f02e[_0x4955('0x1a')][_0x4955('0x21')]||null:null,'attributes':_0x55f02e[_0x4955('0x1a')]?_0x55f02e['options']['attributes']||null:null,'limit':_0x55f02e[_0x4955('0x1a')]?_0x55f02e['options'][_0x4955('0x22')]||null:null})[_0x4955('0x1c')](function(_0x1976d9){logger[_0x4955('0xd')](_0x4955('0x1e'),_0x55f02e);logger[_0x4955('0xe')](_0x4955('0x1e'),_0x55f02e,JSON[_0x4955('0x1d')](_0x1976d9));_0x525fba(_0x1976d9);})[_0x4955('0x16')](function(_0x2e23ea){logger[_0x4955('0x12')](_0x4955('0x1e'),_0x2e23ea[_0x4955('0x13')],_0x55f02e);_0x4f5fbe(_0x82904['error'](0x1f4,_0x2e23ea[_0x4955('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 67ddade..a509812 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 _0xf08f=['express','Router','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0xf08f,0x1f4));var _0xff08=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xf08f[_0x296897];return _0x2b44ab;};'use strict';var multer=require(_0xff08('0x0'));var util=require(_0xff08('0x1'));var path=require(_0xff08('0x2'));var timeout=require(_0xff08('0x3'));var express=require(_0xff08('0x4'));var router=express[_0xff08('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xff08('0x6'));router[_0xff08('0x7')]('/',auth[_0xff08('0x8')](),controller[_0xff08('0x9')]);router['get'](_0xff08('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xff08('0x8')](),controller[_0xff08('0xb')]);router[_0xff08('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xff08('0xd')](_0xff08('0xe'),auth[_0xff08('0x8')](),controller[_0xff08('0xf')]);router['delete'](_0xff08('0xe'),auth[_0xff08('0x8')](),controller[_0xff08('0x10')]);module[_0xff08('0x11')]=router; \ No newline at end of file +var _0x9cf0=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x22473b,_0x3fab5e){var _0x2ec23e=function(_0xb7d7bc){while(--_0xb7d7bc){_0x22473b['push'](_0x22473b['shift']());}};_0x2ec23e(++_0x3fab5e);}(_0x9cf0,0x1a8));var _0x09cf=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9cf0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x09cf('0x0'));var util=require(_0x09cf('0x1'));var path=require(_0x09cf('0x2'));var timeout=require(_0x09cf('0x3'));var express=require(_0x09cf('0x4'));var router=express[_0x09cf('0x5')]();var fs_extra=require(_0x09cf('0x6'));var auth=require(_0x09cf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x09cf('0x8'));var controller=require(_0x09cf('0x9'));router[_0x09cf('0xa')]('/',auth[_0x09cf('0xb')](),controller['index']);router[_0x09cf('0xa')](_0x09cf('0xc'),auth[_0x09cf('0xb')](),controller[_0x09cf('0xd')]);router[_0x09cf('0xa')](_0x09cf('0xe'),auth[_0x09cf('0xb')](),controller['show']);router[_0x09cf('0xf')]('/',auth[_0x09cf('0xb')](),controller[_0x09cf('0x10')]);router[_0x09cf('0x11')](_0x09cf('0xe'),auth[_0x09cf('0xb')](),controller['update']);router[_0x09cf('0x12')](_0x09cf('0xe'),auth[_0x09cf('0xb')](),controller[_0x09cf('0x13')]);module[_0x09cf('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index dcd8d3c..4951509 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 _0x404d=['DATE','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x15b594,_0x1b5329){var _0x522aba=function(_0x972150){while(--_0x972150){_0x15b594['push'](_0x15b594['shift']());}};_0x522aba(++_0x1b5329);}(_0x404d,0x1e9));var _0xd404=function(_0x2e0199,_0x1051a2){_0x2e0199=_0x2e0199-0x0;var _0x313813=_0x404d[_0x2e0199];return _0x313813;};'use strict';var Sequelize=require(_0xd404('0x0'));module[_0xd404('0x1')]={'uniqueid':{'type':Sequelize[_0xd404('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd404('0x3')](_0xd404('0x4'),_0xd404('0x5'),_0xd404('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd404('0x7')]}}; \ No newline at end of file +var _0x6c00=['STRING','account','agent','queue','DATE','sequelize','exports'];(function(_0x593aef,_0x50a2ff){var _0x37c497=function(_0x347c28){while(--_0x347c28){_0x593aef['push'](_0x593aef['shift']());}};_0x37c497(++_0x50a2ff);}(_0x6c00,0x1a9));var _0x06c0=function(_0x15fa77,_0x93eaff){_0x15fa77=_0x15fa77-0x0;var _0x1385ff=_0x6c00[_0x15fa77];return _0x1385ff;};'use strict';var Sequelize=require(_0x06c0('0x0'));module[_0x06c0('0x1')]={'uniqueid':{'type':Sequelize[_0x06c0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x06c0('0x3'),_0x06c0('0x4'),_0x06c0('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x06c0('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index a2cb10a..099561c 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 _0x3fa7=['end','error','stack','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','name','filter','options','WhatsappTransferReport','include','findAll','rows','catch','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy'];(function(_0x5f55b0,_0x3a9b9e){var _0x4228fa=function(_0x5547fe){while(--_0x5547fe){_0x5f55b0['push'](_0x5f55b0['shift']());}};_0x4228fa(++_0x3a9b9e);}(_0x3fa7,0x198));var _0x73fa=function(_0x4d7fc8,_0x2d94cb){_0x4d7fc8=_0x4d7fc8-0x0;var _0x26a41f=_0x3fa7[_0x4d7fc8];return _0x26a41f;};'use strict';var emlformat=require(_0x73fa('0x0'));var rimraf=require(_0x73fa('0x1'));var zipdir=require(_0x73fa('0x2'));var jsonpatch=require(_0x73fa('0x3'));var rp=require(_0x73fa('0x4'));var moment=require('moment');var BPromise=require(_0x73fa('0x5'));var Mustache=require(_0x73fa('0x6'));var util=require('util');var path=require(_0x73fa('0x7'));var sox=require(_0x73fa('0x8'));var csv=require(_0x73fa('0x9'));var ejs=require(_0x73fa('0xa'));var fs=require('fs');var fs_extra=require(_0x73fa('0xb'));var _=require(_0x73fa('0xc'));var squel=require(_0x73fa('0xd'));var crypto=require(_0x73fa('0xe'));var jsforce=require(_0x73fa('0xf'));var deskjs=require(_0x73fa('0x10'));var toCsv=require(_0x73fa('0x9'));var querystring=require(_0x73fa('0x11'));var Papa=require('papaparse');var Redis=require(_0x73fa('0x12'));var authService=require(_0x73fa('0x13'));var qs=require(_0x73fa('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x73fa('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x73fa('0x16'));var licenseUtil=require(_0x73fa('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34d362,_0x2c818f){_0x2c818f=_0x2c818f||0xcc;return function(_0x3cbd54){if(_0x3cbd54){return _0x34d362[_0x73fa('0x18')](_0x2c818f);}return _0x34d362[_0x73fa('0x19')](_0x2c818f)['end']();};}function respondWithResult(_0x4a7955,_0x23a330){_0x23a330=_0x23a330||0xc8;return function(_0x12b887){if(_0x12b887){return _0x4a7955['status'](_0x23a330)[_0x73fa('0x1a')](_0x12b887);}};}function respondWithFilteredResult(_0x255dcb,_0x5144fb){return function(_0x55f53b){if(_0x55f53b){var _0x228372=typeof _0x5144fb[_0x73fa('0x1b')]===_0x73fa('0x1c')&&typeof _0x5144fb[_0x73fa('0x1d')]==='undefined';var _0x104861=_0x55f53b[_0x73fa('0x1e')];var _0x5b8585=_0x228372?0x0:_0x5144fb[_0x73fa('0x1b')];var _0x584e3c=_0x228372?_0x55f53b[_0x73fa('0x1e')]:_0x5144fb['offset']+_0x5144fb['limit'];var _0xa2a882;if(_0x584e3c>=_0x104861){_0x584e3c=_0x104861;_0xa2a882=0xc8;}else{_0xa2a882=0xce;}_0x255dcb[_0x73fa('0x19')](_0xa2a882);return _0x255dcb['set'](_0x73fa('0x1f'),_0x5b8585+'-'+_0x584e3c+'/'+_0x104861)[_0x73fa('0x1a')](_0x55f53b);}return null;};}function patchUpdates(_0x1ad91b){return function(_0x4a0a4e){try{jsonpatch['apply'](_0x4a0a4e,_0x1ad91b,!![]);}catch(_0x29ad03){return BPromise['reject'](_0x29ad03);}return _0x4a0a4e[_0x73fa('0x20')]();};}function saveUpdates(_0x54c576,_0x5d136c){return function(_0x36a317){if(_0x36a317){return _0x36a317[_0x73fa('0x21')](_0x54c576)[_0x73fa('0x22')](function(_0x1a06aa){return _0x1a06aa;});}return null;};}function removeEntity(_0x52a9f1,_0x27c445){return function(_0x3bcb12){if(_0x3bcb12){return _0x3bcb12[_0x73fa('0x23')]()[_0x73fa('0x22')](function(){_0x52a9f1[_0x73fa('0x19')](0xcc)[_0x73fa('0x24')]();});}};}function handleEntityNotFound(_0x43e321,_0x47999d){return function(_0x4f4140){if(!_0x4f4140){_0x43e321[_0x73fa('0x18')](0x194);}return _0x4f4140;};}function handleError(_0x5c52dd,_0xbda3e0){_0xbda3e0=_0xbda3e0||0x1f4;return function(_0x36cd6a){logger[_0x73fa('0x25')](_0x36cd6a[_0x73fa('0x26')]);if(_0x36cd6a['name']){delete _0x36cd6a['name'];}_0x5c52dd['status'](_0xbda3e0)[_0x73fa('0x27')](_0x36cd6a);};}exports[_0x73fa('0x28')]=function(_0x1bc59f,_0x142a28){var _0x1ce8be={},_0x529359={},_0x2a14ef={'count':0x0,'rows':[]};var _0x552d30=_[_0x73fa('0x29')](db['WhatsappTransferReport'][_0x73fa('0x2a')],function(_0x1d4601){return{'name':_0x1d4601[_0x73fa('0x2b')],'type':_0x1d4601['type'][_0x73fa('0x2c')]};});_0x529359[_0x73fa('0x2d')]=_['map'](_0x552d30,'name');_0x529359[_0x73fa('0x2e')]=_['keys'](_0x1bc59f[_0x73fa('0x2e')]);_0x529359[_0x73fa('0x2f')]=_[_0x73fa('0x30')](_0x529359[_0x73fa('0x2d')],_0x529359[_0x73fa('0x2e')]);_0x1ce8be[_0x73fa('0x31')]=_[_0x73fa('0x30')](_0x529359['model'],qs['fields'](_0x1bc59f[_0x73fa('0x2e')][_0x73fa('0x32')]));_0x1ce8be[_0x73fa('0x31')]=_0x1ce8be['attributes'][_0x73fa('0x33')]?_0x1ce8be['attributes']:_0x529359['model'];if(!_0x1bc59f[_0x73fa('0x2e')][_0x73fa('0x34')](_0x73fa('0x35'))){_0x1ce8be[_0x73fa('0x1d')]=qs['limit'](_0x1bc59f[_0x73fa('0x2e')][_0x73fa('0x1d')]);_0x1ce8be[_0x73fa('0x1b')]=qs[_0x73fa('0x1b')](_0x1bc59f['query'][_0x73fa('0x1b')]);}_0x1ce8be[_0x73fa('0x36')]=qs[_0x73fa('0x37')](_0x1bc59f[_0x73fa('0x2e')][_0x73fa('0x37')]);_0x1ce8be[_0x73fa('0x38')]=qs[_0x73fa('0x2f')](_[_0x73fa('0x39')](_0x1bc59f[_0x73fa('0x2e')],_0x529359['filters']),_0x552d30);if(_0x1bc59f[_0x73fa('0x2e')]['filter']){_0x1ce8be[_0x73fa('0x38')]=_[_0x73fa('0x3a')](_0x1ce8be[_0x73fa('0x38')],{'$or':_[_0x73fa('0x29')](_0x552d30,function(_0x5a4b9e){if(_0x5a4b9e[_0x73fa('0x3b')]!=='VIRTUAL'){var _0x180ea9={};_0x180ea9[_0x5a4b9e[_0x73fa('0x3c')]]={'$like':'%'+_0x1bc59f['query'][_0x73fa('0x3d')]+'%'};return _0x180ea9;}})});}_0x1ce8be=_[_0x73fa('0x3a')]({},_0x1ce8be,_0x1bc59f[_0x73fa('0x3e')]);var _0x487163={'where':_0x1ce8be[_0x73fa('0x38')]};return db[_0x73fa('0x3f')][_0x73fa('0x1e')](_0x487163)[_0x73fa('0x22')](function(_0xbadc59){_0x2a14ef['count']=_0xbadc59;if(_0x1bc59f['query']['includeAll']){_0x1ce8be[_0x73fa('0x40')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x73fa('0x41')](_0x1ce8be);})[_0x73fa('0x22')](function(_0x5b0e1b){_0x2a14ef[_0x73fa('0x42')]=_0x5b0e1b;return _0x2a14ef;})[_0x73fa('0x22')](respondWithFilteredResult(_0x142a28,_0x1ce8be))[_0x73fa('0x43')](handleError(_0x142a28,null));};exports['show']=function(_0x114133,_0x4cd10c){var _0x282857={'raw':!![],'where':{'id':_0x114133[_0x73fa('0x44')]['id']}},_0x1e552e={};_0x1e552e[_0x73fa('0x2d')]=_['keys'](db[_0x73fa('0x3f')][_0x73fa('0x2a')]);_0x1e552e['query']=_[_0x73fa('0x45')](_0x114133[_0x73fa('0x2e')]);_0x1e552e[_0x73fa('0x2f')]=_[_0x73fa('0x30')](_0x1e552e['model'],_0x1e552e[_0x73fa('0x2e')]);_0x282857['attributes']=_[_0x73fa('0x30')](_0x1e552e[_0x73fa('0x2d')],qs[_0x73fa('0x32')](_0x114133[_0x73fa('0x2e')]['fields']));_0x282857['attributes']=_0x282857[_0x73fa('0x31')][_0x73fa('0x33')]?_0x282857[_0x73fa('0x31')]:_0x1e552e['model'];if(_0x114133[_0x73fa('0x2e')]['includeAll']){_0x282857[_0x73fa('0x40')]=[{'all':!![]}];}_0x282857=_[_0x73fa('0x3a')]({},_0x282857,_0x114133[_0x73fa('0x3e')]);return db[_0x73fa('0x3f')]['find'](_0x282857)[_0x73fa('0x22')](handleEntityNotFound(_0x4cd10c,null))[_0x73fa('0x22')](respondWithResult(_0x4cd10c,null))[_0x73fa('0x43')](handleError(_0x4cd10c,null));};exports[_0x73fa('0x46')]=function(_0x5d1f71,_0x2e43af){return db['WhatsappTransferReport'][_0x73fa('0x46')](_0x5d1f71[_0x73fa('0x47')],{})[_0x73fa('0x22')](respondWithResult(_0x2e43af,0xc9))[_0x73fa('0x43')](handleError(_0x2e43af,null));};exports[_0x73fa('0x21')]=function(_0x5b6049,_0x48c928){if(_0x5b6049[_0x73fa('0x47')]['id']){delete _0x5b6049[_0x73fa('0x47')]['id'];}return db[_0x73fa('0x3f')][_0x73fa('0x48')]({'where':{'id':_0x5b6049[_0x73fa('0x44')]['id']}})['then'](handleEntityNotFound(_0x48c928,null))[_0x73fa('0x22')](saveUpdates(_0x5b6049[_0x73fa('0x47')],null))[_0x73fa('0x22')](respondWithResult(_0x48c928,null))['catch'](handleError(_0x48c928,null));};exports[_0x73fa('0x23')]=function(_0x8e1f52,_0x54d77a){return db['WhatsappTransferReport'][_0x73fa('0x48')]({'where':{'id':_0x8e1f52[_0x73fa('0x44')]['id']}})['then'](handleEntityNotFound(_0x54d77a,null))[_0x73fa('0x22')](removeEntity(_0x54d77a,null))[_0x73fa('0x43')](handleError(_0x54d77a,null));};exports[_0x73fa('0x49')]=function(_0x1de2ba,_0x4613ef){return db[_0x73fa('0x3f')]['describe']()[_0x73fa('0x22')](respondWithResult(_0x4613ef,null))[_0x73fa('0x43')](handleError(_0x4613ef,null));}; \ No newline at end of file +var _0x0776=['where','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x1ecd0a,_0x63f609){var _0x2fd905=function(_0x449068){while(--_0x449068){_0x1ecd0a['push'](_0x1ecd0a['shift']());}};_0x2fd905(++_0x63f609);}(_0x0776,0x128));var _0x6077=function(_0x14c0f1,_0x2d5dce){_0x14c0f1=_0x14c0f1-0x0;var _0x4bf1d3=_0x0776[_0x14c0f1];return _0x4bf1d3;};'use strict';var emlformat=require(_0x6077('0x0'));var rimraf=require(_0x6077('0x1'));var zipdir=require(_0x6077('0x2'));var jsonpatch=require(_0x6077('0x3'));var rp=require(_0x6077('0x4'));var moment=require(_0x6077('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6077('0x6'));var util=require(_0x6077('0x7'));var path=require(_0x6077('0x8'));var sox=require('sox');var csv=require(_0x6077('0x9'));var ejs=require(_0x6077('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6077('0xb'));var squel=require('squel');var crypto=require(_0x6077('0xc'));var jsforce=require(_0x6077('0xd'));var deskjs=require(_0x6077('0xe'));var toCsv=require(_0x6077('0x9'));var querystring=require('querystring');var Papa=require(_0x6077('0xf'));var Redis=require(_0x6077('0x10'));var authService=require(_0x6077('0x11'));var qs=require(_0x6077('0x12'));var as=require(_0x6077('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6077('0x14'))['db'];function respondWithStatusCode(_0x4d9559,_0x287ca6){_0x287ca6=_0x287ca6||0xcc;return function(_0x4fd947){if(_0x4fd947){return _0x4d9559[_0x6077('0x15')](_0x287ca6);}return _0x4d9559[_0x6077('0x16')](_0x287ca6)[_0x6077('0x17')]();};}function respondWithResult(_0x161c7e,_0x295350){_0x295350=_0x295350||0xc8;return function(_0x6d167d){if(_0x6d167d){return _0x161c7e['status'](_0x295350)[_0x6077('0x18')](_0x6d167d);}};}function respondWithFilteredResult(_0x7ed57b,_0x23b72c){return function(_0x269cff){if(_0x269cff){var _0x570adb=typeof _0x23b72c[_0x6077('0x19')]===_0x6077('0x1a')&&typeof _0x23b72c['limit']===_0x6077('0x1a');var _0x57a91d=_0x269cff[_0x6077('0x1b')];var _0x5bb108=_0x570adb?0x0:_0x23b72c[_0x6077('0x19')];var _0x4eaebd=_0x570adb?_0x269cff[_0x6077('0x1b')]:_0x23b72c[_0x6077('0x19')]+_0x23b72c[_0x6077('0x1c')];var _0x31583f;if(_0x4eaebd>=_0x57a91d){_0x4eaebd=_0x57a91d;_0x31583f=0xc8;}else{_0x31583f=0xce;}_0x7ed57b['status'](_0x31583f);return _0x7ed57b[_0x6077('0x1d')]('Content-Range',_0x5bb108+'-'+_0x4eaebd+'/'+_0x57a91d)[_0x6077('0x18')](_0x269cff);}return null;};}function patchUpdates(_0x20382f){return function(_0x5102a1){try{jsonpatch[_0x6077('0x1e')](_0x5102a1,_0x20382f,!![]);}catch(_0x40bff8){return BPromise['reject'](_0x40bff8);}return _0x5102a1[_0x6077('0x1f')]();};}function saveUpdates(_0x15d15b,_0x5b30fd){return function(_0x58ca41){if(_0x58ca41){return _0x58ca41[_0x6077('0x20')](_0x15d15b)[_0x6077('0x21')](function(_0x5eaae4){return _0x5eaae4;});}return null;};}function removeEntity(_0x307272,_0x176639){return function(_0x54049a){if(_0x54049a){return _0x54049a[_0x6077('0x22')]()[_0x6077('0x21')](function(){_0x307272[_0x6077('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f6ae,_0x1cd735){return function(_0x54720a){if(!_0x54720a){_0x53f6ae[_0x6077('0x15')](0x194);}return _0x54720a;};}function handleError(_0x4d0dd2,_0x5a5158){_0x5a5158=_0x5a5158||0x1f4;return function(_0x446329){logger[_0x6077('0x23')](_0x446329[_0x6077('0x24')]);if(_0x446329[_0x6077('0x25')]){delete _0x446329[_0x6077('0x25')];}_0x4d0dd2[_0x6077('0x16')](_0x5a5158)[_0x6077('0x26')](_0x446329);};}exports[_0x6077('0x27')]=function(_0x4e408c,_0x425203){var _0x279513={},_0x76c471={},_0x51f101={'count':0x0,'rows':[]};var _0x78194b=_[_0x6077('0x28')](db['WhatsappTransferReport']['rawAttributes'],function(_0x44a47a){return{'name':_0x44a47a[_0x6077('0x29')],'type':_0x44a47a[_0x6077('0x2a')]['key']};});_0x76c471['model']=_[_0x6077('0x28')](_0x78194b,_0x6077('0x25'));_0x76c471['query']=_[_0x6077('0x2b')](_0x4e408c['query']);_0x76c471[_0x6077('0x2c')]=_[_0x6077('0x2d')](_0x76c471[_0x6077('0x2e')],_0x76c471[_0x6077('0x2f')]);_0x279513[_0x6077('0x30')]=_[_0x6077('0x2d')](_0x76c471['model'],qs[_0x6077('0x31')](_0x4e408c[_0x6077('0x2f')][_0x6077('0x31')]));_0x279513[_0x6077('0x30')]=_0x279513[_0x6077('0x30')][_0x6077('0x32')]?_0x279513[_0x6077('0x30')]:_0x76c471[_0x6077('0x2e')];if(!_0x4e408c[_0x6077('0x2f')][_0x6077('0x33')](_0x6077('0x34'))){_0x279513['limit']=qs[_0x6077('0x1c')](_0x4e408c[_0x6077('0x2f')][_0x6077('0x1c')]);_0x279513['offset']=qs[_0x6077('0x19')](_0x4e408c['query']['offset']);}_0x279513['order']=qs[_0x6077('0x35')](_0x4e408c['query'][_0x6077('0x35')]);_0x279513['where']=qs[_0x6077('0x2c')](_['pick'](_0x4e408c['query'],_0x76c471[_0x6077('0x2c')]),_0x78194b);if(_0x4e408c[_0x6077('0x2f')]['filter']){_0x279513[_0x6077('0x36')]=_[_0x6077('0x37')](_0x279513[_0x6077('0x36')],{'$or':_[_0x6077('0x28')](_0x78194b,function(_0x232d63){if(_0x232d63['type']!=='VIRTUAL'){var _0x4f3699={};_0x4f3699[_0x232d63[_0x6077('0x25')]]={'$like':'%'+_0x4e408c[_0x6077('0x2f')]['filter']+'%'};return _0x4f3699;}})});}_0x279513=_[_0x6077('0x37')]({},_0x279513,_0x4e408c[_0x6077('0x38')]);var _0x53f1c2={'where':_0x279513[_0x6077('0x36')]};return db[_0x6077('0x39')][_0x6077('0x1b')](_0x53f1c2)[_0x6077('0x21')](function(_0x2d98c0){_0x51f101[_0x6077('0x1b')]=_0x2d98c0;if(_0x4e408c['query'][_0x6077('0x3a')]){_0x279513[_0x6077('0x3b')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x6077('0x3c')](_0x279513);})['then'](function(_0x5a9cb7){_0x51f101[_0x6077('0x3d')]=_0x5a9cb7;return _0x51f101;})[_0x6077('0x21')](respondWithFilteredResult(_0x425203,_0x279513))['catch'](handleError(_0x425203,null));};exports[_0x6077('0x3e')]=function(_0x50d2be,_0x4f3133){var _0x370032={'raw':!![],'where':{'id':_0x50d2be[_0x6077('0x3f')]['id']}},_0x2e65b1={};_0x2e65b1[_0x6077('0x2e')]=_['keys'](db[_0x6077('0x39')][_0x6077('0x40')]);_0x2e65b1[_0x6077('0x2f')]=_['keys'](_0x50d2be[_0x6077('0x2f')]);_0x2e65b1[_0x6077('0x2c')]=_['intersection'](_0x2e65b1[_0x6077('0x2e')],_0x2e65b1[_0x6077('0x2f')]);_0x370032[_0x6077('0x30')]=_['intersection'](_0x2e65b1[_0x6077('0x2e')],qs['fields'](_0x50d2be['query'][_0x6077('0x31')]));_0x370032[_0x6077('0x30')]=_0x370032['attributes'][_0x6077('0x32')]?_0x370032[_0x6077('0x30')]:_0x2e65b1[_0x6077('0x2e')];if(_0x50d2be[_0x6077('0x2f')][_0x6077('0x3a')]){_0x370032[_0x6077('0x3b')]=[{'all':!![]}];}_0x370032=_[_0x6077('0x37')]({},_0x370032,_0x50d2be['options']);return db[_0x6077('0x39')]['find'](_0x370032)[_0x6077('0x21')](handleEntityNotFound(_0x4f3133,null))[_0x6077('0x21')](respondWithResult(_0x4f3133,null))['catch'](handleError(_0x4f3133,null));};exports[_0x6077('0x41')]=function(_0x17f3fb,_0x4cdf06){return db['WhatsappTransferReport'][_0x6077('0x41')](_0x17f3fb[_0x6077('0x42')],{})[_0x6077('0x21')](respondWithResult(_0x4cdf06,0xc9))[_0x6077('0x43')](handleError(_0x4cdf06,null));};exports[_0x6077('0x20')]=function(_0x2d41f9,_0x3c0f91){if(_0x2d41f9[_0x6077('0x42')]['id']){delete _0x2d41f9[_0x6077('0x42')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x2d41f9[_0x6077('0x3f')]['id']}})[_0x6077('0x21')](handleEntityNotFound(_0x3c0f91,null))[_0x6077('0x21')](saveUpdates(_0x2d41f9['body'],null))[_0x6077('0x21')](respondWithResult(_0x3c0f91,null))[_0x6077('0x43')](handleError(_0x3c0f91,null));};exports['destroy']=function(_0x1e7b54,_0x143ac4){return db['WhatsappTransferReport'][_0x6077('0x44')]({'where':{'id':_0x1e7b54[_0x6077('0x3f')]['id']}})[_0x6077('0x21')](handleEntityNotFound(_0x143ac4,null))[_0x6077('0x21')](removeEntity(_0x143ac4,null))['catch'](handleError(_0x143ac4,null));};exports[_0x6077('0x45')]=function(_0x14cb7c,_0x43715b){return db[_0x6077('0x39')][_0x6077('0x45')]()[_0x6077('0x21')](respondWithResult(_0x43715b,null))[_0x6077('0x43')](handleError(_0x43715b,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 6b3e74e..7caf18b 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 _0xd38c=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3f5e22,_0x4453ac){var _0x19b51c=function(_0x2c8a58){while(--_0x2c8a58){_0x3f5e22['push'](_0x3f5e22['shift']());}};_0x19b51c(++_0x4453ac);}(_0xd38c,0xcc));var _0xcd38=function(_0x24f6d4,_0x486e3){_0x24f6d4=_0x24f6d4-0x0;var _0x424139=_0xd38c[_0x24f6d4];return _0x424139;};'use strict';var _=require(_0xcd38('0x0'));var util=require(_0xcd38('0x1'));var logger=require(_0xcd38('0x2'))(_0xcd38('0x3'));var moment=require(_0xcd38('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd38('0x5'));var fs=require('fs');var path=require(_0xcd38('0x6'));var rimraf=require(_0xcd38('0x7'));var config=require(_0xcd38('0x8'));var attributes=require(_0xcd38('0x9'));module[_0xcd38('0xa')]=function(_0xd8429a,_0x1cd0cd){return _0xd8429a[_0xcd38('0xb')]('WhatsappTransferReport',attributes,{'tableName':_0xcd38('0xc'),'paranoid':![],'indexes':[{'name':_0xcd38('0xd'),'fields':[_0xcd38('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ac2=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8ac2,0x83));var _0x28ac=function(_0x31b8c2,_0x364800){_0x31b8c2=_0x31b8c2-0x0;var _0x1b9780=_0x8ac2[_0x31b8c2];return _0x1b9780;};'use strict';var _=require(_0x28ac('0x0'));var util=require('util');var logger=require(_0x28ac('0x1'))(_0x28ac('0x2'));var moment=require(_0x28ac('0x3'));var BPromise=require(_0x28ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28ac('0x5'));var rimraf=require(_0x28ac('0x6'));var config=require(_0x28ac('0x7'));var attributes=require(_0x28ac('0x8'));module[_0x28ac('0x9')]=function(_0x36a3c0,_0x33d24e){return _0x36a3c0[_0x28ac('0xa')]('WhatsappTransferReport',attributes,{'tableName':_0x28ac('0xb'),'paranoid':![],'indexes':[{'name':_0x28ac('0xc'),'fields':[_0x28ac('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 0fa6243..574d006 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 _0xa2a6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x7eee15,_0x3fe21a){var _0x7ad23=function(_0x2de173){while(--_0x2de173){_0x7eee15['push'](_0x7eee15['shift']());}};_0x7ad23(++_0x3fe21a);}(_0xa2a6,0xc8));var _0x6a2a=function(_0x1d525a,_0x49dd92){_0x1d525a=_0x1d525a-0x0;var _0x1bd9a0=_0xa2a6[_0x1d525a];return _0x1bd9a0;};'use strict';var _=require(_0x6a2a('0x0'));var util=require(_0x6a2a('0x1'));var moment=require(_0x6a2a('0x2'));var BPromise=require(_0x6a2a('0x3'));var rs=require(_0x6a2a('0x4'));var fs=require('fs');var Redis=require(_0x6a2a('0x5'));var db=require(_0x6a2a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a2a('0x7'))(_0x6a2a('0x8'));var config=require(_0x6a2a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a2a('0xa')][_0x6a2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3324e7,_0x2c0a9c,_0x416c53){return new BPromise(function(_0x343006,_0x18ff08){return client['request'](_0x3324e7,_0x416c53)[_0x6a2a('0xc')](function(_0x32fecb){logger[_0x6a2a('0xd')](_0x6a2a('0xe'),_0x2c0a9c,_0x6a2a('0xf'));logger[_0x6a2a('0x10')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x2c0a9c,_0x6a2a('0xf'),JSON[_0x6a2a('0x11')](_0x32fecb));if(_0x32fecb['error']){if(_0x32fecb['error']['code']===0x1f4){logger[_0x6a2a('0x12')](_0x6a2a('0xe'),_0x2c0a9c,_0x32fecb[_0x6a2a('0x12')][_0x6a2a('0x13')]);return _0x18ff08(_0x32fecb['error'][_0x6a2a('0x13')]);}logger[_0x6a2a('0x12')](_0x6a2a('0xe'),_0x2c0a9c,_0x32fecb['error'][_0x6a2a('0x13')]);return _0x343006(_0x32fecb[_0x6a2a('0x12')]['message']);}else{logger[_0x6a2a('0xd')](_0x6a2a('0xe'),_0x2c0a9c,_0x6a2a('0xf'));_0x343006(_0x32fecb[_0x6a2a('0x14')][_0x6a2a('0x13')]);}})[_0x6a2a('0x15')](function(_0x190a21){logger[_0x6a2a('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2c0a9c,_0x190a21);_0x18ff08(_0x190a21);});});} \ No newline at end of file +var _0xec7b=['util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xec7b,0x69));var _0xbec7=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xec7b[_0x503ffd];return _0x160437;};'use strict';var _=require('lodash');var util=require(_0xbec7('0x0'));var moment=require(_0xbec7('0x1'));var BPromise=require('bluebird');var rs=require(_0xbec7('0x2'));var fs=require('fs');var Redis=require(_0xbec7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbec7('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbec7('0x5'));var client=jayson[_0xbec7('0x6')][_0xbec7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32626f,_0x39be4c,_0x319b23){return new BPromise(function(_0x3c4dff,_0x1b41e0){return client[_0xbec7('0x8')](_0x32626f,_0x319b23)[_0xbec7('0x9')](function(_0x5100a1){logger[_0xbec7('0xa')](_0xbec7('0xb'),_0x39be4c,_0xbec7('0xc'));logger[_0xbec7('0xd')](_0xbec7('0xe'),_0x39be4c,_0xbec7('0xc'),JSON[_0xbec7('0xf')](_0x5100a1));if(_0x5100a1[_0xbec7('0x10')]){if(_0x5100a1[_0xbec7('0x10')][_0xbec7('0x11')]===0x1f4){logger[_0xbec7('0x10')](_0xbec7('0xb'),_0x39be4c,_0x5100a1[_0xbec7('0x10')][_0xbec7('0x12')]);return _0x1b41e0(_0x5100a1[_0xbec7('0x10')][_0xbec7('0x12')]);}logger['error'](_0xbec7('0xb'),_0x39be4c,_0x5100a1['error'][_0xbec7('0x12')]);return _0x3c4dff(_0x5100a1[_0xbec7('0x10')][_0xbec7('0x12')]);}else{logger[_0xbec7('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0x39be4c,_0xbec7('0xc'));_0x3c4dff(_0x5100a1[_0xbec7('0x13')][_0xbec7('0x12')]);}})[_0xbec7('0x14')](function(_0x4997dc){logger['error'](_0xbec7('0xb'),_0x39be4c,_0x4997dc);_0x1b41e0(_0x4997dc);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index a33bd06..48cf9d2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0556=['listen','then','info','start','map','filter','name','join','Offline\x20apps:','status','online','seedDB','./config/seedDB','./config/license','default','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync'];(function(_0x5be652,_0x129d44){var _0x3c89da=function(_0x2f01ac){while(--_0x2f01ac){_0x5be652['push'](_0x5be652['shift']());}};_0x3c89da(++_0x129d44);}(_0x0556,0xb2));var _0x6055=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x0556[_0x3e8270];return _0x1ccde9;};'use strict';var _=require(_0x6055('0x0'));var mysqldb=require(_0x6055('0x1'));var rpc=require(_0x6055('0x2'));var config=require(_0x6055('0x3'));var logger=require(_0x6055('0x4'))(_0x6055('0x5'));var pm2=require(_0x6055('0x6'));var pm2Config=require(_0x6055('0x7'));var schedule=require(_0x6055('0x8'));var chat=require(_0x6055('0x9'));var whatsapp=require(_0x6055('0xa'));var transcribe=require(_0x6055('0xb'));function main(){return mysqldb['db'][_0x6055('0xc')][_0x6055('0xd')]()['then'](function(){return rpc[_0x6055('0xe')]();})[_0x6055('0xf')](function(_0x2688a3){logger[_0x6055('0x10')](_0x2688a3);return chat[_0x6055('0x11')]();})[_0x6055('0xf')](function(){return whatsapp[_0x6055('0x11')]();})[_0x6055('0xf')](function(){return schedule[_0x6055('0x11')]();})['then'](function(){return transcribe[_0x6055('0x11')]();})[_0x6055('0xf')](function(_0x2617af){logger[_0x6055('0x10')](_0x2617af);return pm2['start'](pm2Config);})[_0x6055('0xf')](function(_0x51ea4b){logger['info']('Online\x20apps:',_[_0x6055('0x12')](_[_0x6055('0x13')](_0x51ea4b,{'status':'online'}),_0x6055('0x14'))[_0x6055('0x15')]());logger['info'](_0x6055('0x16'),_['map'](_[_0x6055('0x13')](_0x51ea4b,function(_0x334717){return _0x334717[_0x6055('0x17')]!==_0x6055('0x18');}),_0x6055('0x14'))[_0x6055('0x15')]()||'None');config[_0x6055('0x19')]&&require(_0x6055('0x1a'))['default']();require(_0x6055('0x1b'))[_0x6055('0x1c')]();})[_0x6055('0x1d')](function(_0xc5ade1){logger[_0x6055('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xc5ade1);process[_0x6055('0x1f')](0x1);});}main(); \ No newline at end of file +var _0xb8c8=['Offline\x20apps:','map','filter','status','join','None','default','catch','error','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','name'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb8c8,0x117));var _0x8b8c=function(_0x275686,_0x5e8573){_0x275686=_0x275686-0x0;var _0x431f80=_0xb8c8[_0x275686];return _0x431f80;};'use strict';var _=require('lodash');var mysqldb=require(_0x8b8c('0x0'));var rpc=require(_0x8b8c('0x1'));var config=require(_0x8b8c('0x2'));var logger=require('./config/logger')(_0x8b8c('0x3'));var pm2=require(_0x8b8c('0x4'));var pm2Config=require(_0x8b8c('0x5'));var schedule=require(_0x8b8c('0x6'));var chat=require(_0x8b8c('0x7'));var whatsapp=require(_0x8b8c('0x8'));var transcribe=require(_0x8b8c('0x9'));function main(){return mysqldb['db'][_0x8b8c('0xa')][_0x8b8c('0xb')]()[_0x8b8c('0xc')](function(){return rpc[_0x8b8c('0xd')]();})[_0x8b8c('0xc')](function(_0x3c9804){logger[_0x8b8c('0xe')](_0x3c9804);return chat[_0x8b8c('0xf')]();})[_0x8b8c('0xc')](function(){return whatsapp[_0x8b8c('0xf')]();})[_0x8b8c('0xc')](function(){return schedule[_0x8b8c('0xf')]();})[_0x8b8c('0xc')](function(){return transcribe[_0x8b8c('0xf')]();})[_0x8b8c('0xc')](function(_0x15843a){logger[_0x8b8c('0xe')](_0x15843a);return pm2[_0x8b8c('0xf')](pm2Config);})['then'](function(_0x27c6e6){logger[_0x8b8c('0xe')](_0x8b8c('0x10'),_['map'](_['filter'](_0x27c6e6,{'status':'online'}),_0x8b8c('0x11'))['join']());logger[_0x8b8c('0xe')](_0x8b8c('0x12'),_[_0x8b8c('0x13')](_[_0x8b8c('0x14')](_0x27c6e6,function(_0x4115a8){return _0x4115a8[_0x8b8c('0x15')]!=='online';}),_0x8b8c('0x11'))[_0x8b8c('0x16')]()||_0x8b8c('0x17'));config['seedDB']&&require('./config/seedDB')[_0x8b8c('0x18')]();require('./config/license')[_0x8b8c('0x18')]();})[_0x8b8c('0x19')](function(_0x22e4bd){logger[_0x8b8c('0x1a')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x22e4bd);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index cbe8c4b..d130e65 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 _0xfaac=['updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','join','promisify','sign','secrets','payload','options','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','session','role','fullname','internal','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','authorization','headers','Basic','User','find','name','authenticate','pass','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','add','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfaac,0x1f3));var _0xcfaa=function(_0x5dba52,_0x194d3e){_0x5dba52=_0x5dba52-0x0;var _0x11e446=_0xfaac[_0x5dba52];return _0x11e446;};'use strict';var db=require(_0xcfaa('0x0'))['db'];var config=require(_0xcfaa('0x1'));var hardwareConf=require(_0xcfaa('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xcfaa('0x3'));var _=require('lodash');var jwt=require(_0xcfaa('0x4'));var expressJwt=require(_0xcfaa('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0xcfaa('0x6'));var crypto=require(_0xcfaa('0x7'));var BPromise=require(_0xcfaa('0x8'));var util=require(_0xcfaa('0x9'));var moment=require(_0xcfaa('0xa'));var validateJwt=expressJwt({'secret':config['secrets'][_0xcfaa('0xb')]});var userAttributes=['id',_0xcfaa('0xc'),_0xcfaa('0xd'),'name',_0xcfaa('0xe'),'email',_0xcfaa('0xf'),_0xcfaa('0x10'),_0xcfaa('0x11'),_0xcfaa('0x12'),_0xcfaa('0x13'),_0xcfaa('0x14'),'faxPause',_0xcfaa('0x15'),'openchannelPause','pauseType','showWebBar','lastLoginAt',_0xcfaa('0x16'),_0xcfaa('0x17'),_0xcfaa('0x18'),_0xcfaa('0x19'),'alias',_0xcfaa('0x1a'),_0xcfaa('0x1b'),_0xcfaa('0x1c'),'phoneBarEnableRecording',_0xcfaa('0x1d'),_0xcfaa('0x1e'),_0xcfaa('0x1f'),_0xcfaa('0x20'),'phoneBarRemoteControl',_0xcfaa('0x21'),'hotdesk',_0xcfaa('0x22'),_0xcfaa('0x23'),_0xcfaa('0x24'),_0xcfaa('0x25'),_0xcfaa('0x26'),_0xcfaa('0x27'),'downloadOmnichannelInteractions',_0xcfaa('0x28')];exports[_0xcfaa('0x29')]=function(){return this[_0xcfaa('0x2a')](!![])[_0xcfaa('0x2b')](function(_0x3bf117,_0x101dcc,_0x14a105){if(_0x3bf117[_0xcfaa('0x2c')]){_0x14a105();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x3bf117[_0xcfaa('0x2d')]['id']},'attributes':['id',_0xcfaa('0x2e'),_0xcfaa('0x2f')],'raw':!![]})[_0xcfaa('0x30')](function(_0x1d3a3d){if(_0x1d3a3d&&_0x1d3a3d['closed']){return _0x101dcc[_0xcfaa('0x31')](_0x1d3a3d[_0xcfaa('0x2f')]===_0xcfaa('0x32')?0x195:0x193)['json']({'message':_0x1d3a3d[_0xcfaa('0x2f')]===_0xcfaa('0x32')?_0xcfaa('0x33'):_0xcfaa('0x34')});}else{_0x14a105();}})[_0xcfaa('0x35')](function(_0x413b0e){_0x14a105(_0x413b0e);});}});};exports['isAuthenticated']=function isAuthenticated(_0x1c6cbc){return compose()[_0xcfaa('0x2b')](function(_0x521424,_0x18442a,_0x55d902){var _0x5ce750;if(_0x521424['headers'][_0xcfaa('0x36')]){if(_['startsWith'](_0x521424[_0xcfaa('0x37')][_0xcfaa('0x36')],_0xcfaa('0x38'))){var _0x4546d2=basicAuth(_0x521424);db[_0xcfaa('0x39')][_0xcfaa('0x3a')]({'where':{'name':_0x4546d2[_0xcfaa('0x3b')]}})[_0xcfaa('0x30')](function(_0x2467c4){if(!_0x2467c4||!_0x2467c4[_0xcfaa('0x3c')](_0x4546d2[_0xcfaa('0x3d')])){return _0x18442a[_0xcfaa('0x31')](0x191)[_0xcfaa('0x3e')]({'message':_0xcfaa('0x3f')});}_0x521424[_0xcfaa('0x2c')]={'id':_0x2467c4['id']};_0x55d902();})[_0xcfaa('0x35')](function(_0x4641b4){_0x55d902(_0x4641b4);});}else if(_['startsWith'](_0x521424[_0xcfaa('0x37')][_0xcfaa('0x36')],_0xcfaa('0x40'))){validateJwt(_0x521424,_0x18442a,_0x55d902);}else{if(_0x1c6cbc){_0x55d902();}else{return _0x18442a['status'](0x193)['json']({'message':_0xcfaa('0x41')});}}}else if(_0x521424[_0xcfaa('0x42')][_0xcfaa('0x43')]){try{var _0x2ca15a={'audience':hardwareConf[_0xcfaa('0x44')](),'issuer':hardwareConf[_0xcfaa('0x44')]()};verifyJwt(_0x521424[_0xcfaa('0x42')]['apikey'],_0x2ca15a)[_0xcfaa('0x30')](function(_0x1c1b3f){return db[_0xcfaa('0x39')]['find']({'where':{'id':_0x1c1b3f[_0xcfaa('0x45')]}})[_0xcfaa('0x30')](function(_0x6ce44e){_0x5ce750=_0x6ce44e;return db['Setting'][_0xcfaa('0x46')]({'where':{'id':0x1},'attributes':[_0xcfaa('0x47'),_0xcfaa('0x48')],'raw':!![]});})[_0xcfaa('0x30')](function(_0x21ad9e){if(!_0x5ce750||!_[_0xcfaa('0x49')](_0x5ce750[_0xcfaa('0x4a')],_0x1c1b3f[_0xcfaa('0x4b')])){return _0x18442a['status'](0x191)[_0xcfaa('0x3e')]({'message':_0xcfaa('0x4c')});}if(_0x5ce750[_0xcfaa('0x4d')]){return _0x18442a[_0xcfaa('0x31')](0x191)['json']({'message':_0xcfaa('0x4e')});}if(_0x5ce750[_0xcfaa('0x4f')]){if(_0x21ad9e[_0xcfaa('0x48')]>0x0){if(moment(_0x5ce750['blockedAt'])[_0xcfaa('0x50')](_0x21ad9e[_0xcfaa('0x48')],'minutes')>moment()){return _0x18442a[_0xcfaa('0x31')](0x191)[_0xcfaa('0x3e')]({'message':_0xcfaa('0x4e')});}}else{return _0x18442a[_0xcfaa('0x31')](0x191)[_0xcfaa('0x3e')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x521424[_0xcfaa('0x2c')]={'id':_0x5ce750['id']};_0x55d902();});})[_0xcfaa('0x35')](function(){return _0x18442a['status'](0x191)[_0xcfaa('0x3e')]({'message':_0xcfaa('0x4e')});});}catch(_0x49529d){_0x55d902(_0x49529d);}}else if(_0x1c6cbc){_0x55d902();}else{return _0x18442a[_0xcfaa('0x31')](0x193)[_0xcfaa('0x3e')]({'message':_0xcfaa('0x41')});}})[_0xcfaa('0x2b')](function(_0x4a1d34,_0x4314e6,_0x194a1c){if(_0x4a1d34[_0xcfaa('0x2c')]){db[_0xcfaa('0x39')][_0xcfaa('0x3a')]({'where':{'id':_0x4a1d34[_0xcfaa('0x2c')]['id']},'attributes':userAttributes})[_0xcfaa('0x30')](function(_0x79e143){if(!_0x79e143){return _0x4314e6[_0xcfaa('0x31')](0x194)[_0xcfaa('0x3e')]({'message':'User\x20not\x20found.'});}_0x4a1d34[_0xcfaa('0x2c')]=_0x79e143;_0x194a1c();})[_0xcfaa('0x35')](function(_0x2ad3cf){_0x194a1c(_0x2ad3cf);});}else if(_0x1c6cbc){_0x194a1c();}else{return _0x4314e6[_0xcfaa('0x31')](0x194)['json']({'message':_0xcfaa('0x51')});}});};exports[_0xcfaa('0x52')]=function canUpdate(){return compose()[_0xcfaa('0x2b')](function(_0x2cb84f,_0x40e61e,_0x11669a){return licenseUtil[_0xcfaa('0x53')]()[_0xcfaa('0x30')](function(_0x1f3970){if(_0x1f3970['update']){_0x11669a();}else{return _0x40e61e[_0xcfaa('0x31')](0x193)[_0xcfaa('0x3e')]({'message':_0xcfaa('0x54')});}})['catch'](function(_0xa37f38){_0x11669a(_0xa37f38);});});};exports['isMiddleware']=function(_0xf570da,_0x2e10a9,_0x27a14a){_0xf570da[_0xcfaa('0x55')]=!![];return _0x27a14a();};exports[_0xcfaa('0x56')]=function signToken(_0x2f500e){return signJwt(_0x2f500e);};exports['setTokenCookie']=function(_0x178eb5,_0x2bd357){if(!_0x178eb5['user']){return _0x2bd357[_0xcfaa('0x31')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x48af74={'payload':{'id':_0x178eb5[_0xcfaa('0x2c')]['id'],'role':_0x178eb5['user'][_0xcfaa('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48af74)[_0xcfaa('0x30')](function(_0xe6343d){_0x2bd357['cookie'](_0xcfaa('0x57'),_0xe6343d);_0x2bd357[_0xcfaa('0x58')](_0xcfaa('0x59'));})['catch'](function(_0x42205d){return _0x2bd357[_0xcfaa('0x31')](0x1f4)[_0xcfaa('0x5a')](_0x42205d);});};exports[_0xcfaa('0x5b')]=function(_0x416908){if(_['isNil'](_0x416908[_0xcfaa('0x4a')])||_[_0xcfaa('0x5c')](_0x416908[_0xcfaa('0x5d')])){return null;}else{return createJwt(_0x416908);}};exports[_0xcfaa('0x5e')]=function(_0x379a79){_0x379a79[_0xcfaa('0x4a')]=generateNonce();_0x379a79[_0xcfaa('0x5d')]=generateIssuedAt();return createJwt(_0x379a79);};exports[_0xcfaa('0x5f')]=function(_0x35659c,_0x5db7b3){var _0x347113=_0x35659c[_0xcfaa('0x42')]['apikey'];if(_0x347113){var _0x4bc885={'nonce':_0x5db7b3['apiKeyNonce'],'iat':_0x5db7b3[_0xcfaa('0x5d')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xcfaa('0x44')]()};return verifyJwt(_0x347113,_0x4bc885)['then'](function(){return generateApiKey(_0x5db7b3);});}else{throw{'message':_0xcfaa('0x60')};}};exports[_0xcfaa('0x61')]=function(_0x2b096c){var _0x980537=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x980537[_0xcfaa('0x62')](_0x2b096c))throw new db[(_0xcfaa('0x63'))][(_0xcfaa('0x64'))](_0xcfaa('0x65'));return;};exports[_0xcfaa('0x66')]=function(_0x3444a8,_0xf9a89f,_0x50c4c8){var _0x472117=encryptor['decryptString'](_0xf9a89f)[_0xcfaa('0x67')](',');for(var _0x2c4534=0x0;_0x2c4534<_0x50c4c8;_0x2c4534++){if(!_0x472117[_0x2c4534])break;if(_0x3444a8[_0xcfaa('0x68')]()===_0x472117[_0x2c4534][_0xcfaa('0x68')]()){var _0x276ee8=util[_0xcfaa('0x69')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x50c4c8);if(_0x50c4c8===0x1){_0x276ee8='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xcfaa('0x63'))][(_0xcfaa('0x64'))](_0x276ee8);}}return;};exports[_0xcfaa('0x6a')]=function(_0x212812,_0x4aab48){var _0x24c25f=_0x4aab48?encryptor[_0xcfaa('0x6b')](_0x4aab48)[_0xcfaa('0x67')](','):[];if(_0x24c25f[_0xcfaa('0x6c')]===0x5){_0x24c25f[_0xcfaa('0x6d')](-0x1,0x1);}_0x24c25f[_0xcfaa('0x6e')](_0x212812);return encryptor[_0xcfaa('0x6f')](_0x24c25f[_0xcfaa('0x70')](','));};function signJwt(_0x52756a){var _0x19401a=BPromise[_0xcfaa('0x71')](jwt[_0xcfaa('0x72')],{'context':jwt});var _0x534da6=_0x52756a['secret']||config[_0xcfaa('0x73')][_0xcfaa('0xb')];return new BPromise(function(_0x587779,_0x62c8a1){_0x19401a(_0x52756a[_0xcfaa('0x74')],_0x534da6,_0x52756a[_0xcfaa('0x75')])[_0xcfaa('0x30')](function(_0x51e5c2){_0x587779(_0x51e5c2);})['catch'](function(_0x41ca0b){_0x62c8a1(_0x41ca0b);});});}function verifyJwt(_0x4945bf,_0x3f0151,_0x3656f8){var _0x25984d=BPromise[_0xcfaa('0x71')](jwt['verify'],{'context':jwt});var _0x2a6895=_0x3656f8||config[_0xcfaa('0x73')][_0xcfaa('0xb')];return new BPromise(function(_0x1d01c1,_0x1ab0a1){_0x25984d(_0x4945bf,_0x2a6895,_0x3f0151)[_0xcfaa('0x30')](function(_0x422019){_0x1d01c1(_0x422019);})['catch'](function(_0x2ec8d0){_0x1ab0a1(_0x2ec8d0);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xcfaa('0x76')](_0xcfaa('0x77'));}function generateIssuedAt(){return Math['floor'](Date[_0xcfaa('0x78')]()/0x3e8)['toString']();}function createJwt(_0x3887eb){var _0x3f2c43={'payload':{'iat':_0x3887eb[_0xcfaa('0x5d')],'nonce':_0x3887eb[_0xcfaa('0x4a')]},'options':{'algorithm':'HS512','subject':_0x3887eb['id'][_0xcfaa('0x76')](),'issuer':hardwareConf[_0xcfaa('0x44')](),'audience':hardwareConf[_0xcfaa('0x44')]()}};return signJwt(_0x3f2c43)[_0xcfaa('0x30')](function(_0x7a1b43){return{'iat':_0x3887eb[_0xcfaa('0x5d')],'nonce':_0x3887eb[_0xcfaa('0x4a')],'token':_0x7a1b43};});} \ No newline at end of file +var _0x75bb=['faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','privacyEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','disposition','closed','status','unmanaged','json','Forbidden.','catch','use','headers','startsWith','authorization','Basic','find','then','authenticate','pass','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','User','sub','findOne','allowedLoginAttempts','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','split','length','splice','unshift','encryptString','promisify','secret','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','basic-auth','bluebird','util','moment','secrets','session','fullname','name','email','userpic','md5secret','voicePause','chatPause','mailPause'];(function(_0x51b407,_0x304722){var _0x5f53e8=function(_0x23ebae){while(--_0x23ebae){_0x51b407['push'](_0x51b407['shift']());}};_0x5f53e8(++_0x304722);}(_0x75bb,0x150));var _0xb75b=function(_0x58a89f,_0x4d1e9a){_0x58a89f=_0x58a89f-0x0;var _0xf6288f=_0x75bb[_0x58a89f];return _0xf6288f;};'use strict';var db=require(_0xb75b('0x0'))['db'];var config=require(_0xb75b('0x1'));var hardwareConf=require(_0xb75b('0x2'));var licenseUtil=require(_0xb75b('0x3'));var encryptor=require(_0xb75b('0x4'));var _=require('lodash');var jwt=require(_0xb75b('0x5'));var expressJwt=require(_0xb75b('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xb75b('0x7'));var crypto=require('crypto');var BPromise=require(_0xb75b('0x8'));var util=require(_0xb75b('0x9'));var moment=require(_0xb75b('0xa'));var validateJwt=expressJwt({'secret':config[_0xb75b('0xb')][_0xb75b('0xc')]});var userAttributes=['id','role',_0xb75b('0xd'),_0xb75b('0xe'),'internal',_0xb75b('0xf'),_0xb75b('0x10'),'permissions',_0xb75b('0x11'),_0xb75b('0x12'),_0xb75b('0x13'),_0xb75b('0x14'),_0xb75b('0x15'),_0xb75b('0x16'),_0xb75b('0x17'),_0xb75b('0x18'),'showWebBar',_0xb75b('0x19'),_0xb75b('0x1a'),_0xb75b('0x1b'),_0xb75b('0x1c'),'passwordResetAt',_0xb75b('0x1d'),_0xb75b('0x1e'),_0xb75b('0x1f'),_0xb75b('0x20'),'phoneBarEnableRecording',_0xb75b('0x21'),_0xb75b('0x22'),_0xb75b('0x23'),'phoneBarPrefixRequired',_0xb75b('0x24'),'phoneBarRemoteControlPort',_0xb75b('0x25'),_0xb75b('0x26'),'userProfileId',_0xb75b('0x27'),'settingsEnabled',_0xb75b('0x28'),'downloadVoiceRecordings',_0xb75b('0x29'),_0xb75b('0x2a')];exports[_0xb75b('0x2b')]=function(){return this[_0xb75b('0x2c')](!![])['use'](function(_0x20b978,_0x57559a,_0x5b6873){if(_0x20b978[_0xb75b('0x2d')]){_0x5b6873();}else{return db[_0xb75b('0x2e')]['findOne']({'where':{'id':_0x20b978['params']['id']},'attributes':['id','closed',_0xb75b('0x2f')],'raw':!![]})['then'](function(_0x254ee2){if(_0x254ee2&&_0x254ee2[_0xb75b('0x30')]){return _0x57559a[_0xb75b('0x31')](_0x254ee2[_0xb75b('0x2f')]===_0xb75b('0x32')?0x195:0x193)[_0xb75b('0x33')]({'message':_0x254ee2[_0xb75b('0x2f')]==='unmanaged'?'Unmanaged.':_0xb75b('0x34')});}else{_0x5b6873();}})[_0xb75b('0x35')](function(_0x586e54){_0x5b6873(_0x586e54);});}});};exports[_0xb75b('0x2c')]=function isAuthenticated(_0x4a1224){return compose()[_0xb75b('0x36')](function(_0x43061e,_0x369111,_0x1970cc){var _0x270d91;if(_0x43061e[_0xb75b('0x37')]['authorization']){if(_[_0xb75b('0x38')](_0x43061e[_0xb75b('0x37')][_0xb75b('0x39')],_0xb75b('0x3a'))){var _0x1d1687=basicAuth(_0x43061e);db['User'][_0xb75b('0x3b')]({'where':{'name':_0x1d1687[_0xb75b('0xe')]}})[_0xb75b('0x3c')](function(_0x25f549){if(!_0x25f549||!_0x25f549[_0xb75b('0x3d')](_0x1d1687[_0xb75b('0x3e')])){return _0x369111[_0xb75b('0x31')](0x191)[_0xb75b('0x33')]({'message':_0xb75b('0x3f')});}_0x43061e['user']={'id':_0x25f549['id']};_0x1970cc();})[_0xb75b('0x35')](function(_0x4d7e0d){_0x1970cc(_0x4d7e0d);});}else if(_[_0xb75b('0x38')](_0x43061e['headers'][_0xb75b('0x39')],'Bearer')){validateJwt(_0x43061e,_0x369111,_0x1970cc);}else{if(_0x4a1224){_0x1970cc();}else{return _0x369111[_0xb75b('0x31')](0x193)[_0xb75b('0x33')]({'message':_0xb75b('0x40')});}}}else if(_0x43061e[_0xb75b('0x41')][_0xb75b('0x42')]){try{var _0x4281e5={'audience':hardwareConf[_0xb75b('0x43')](),'issuer':hardwareConf[_0xb75b('0x43')]()};verifyJwt(_0x43061e['query']['apikey'],_0x4281e5)[_0xb75b('0x3c')](function(_0x5d698b){return db[_0xb75b('0x44')]['find']({'where':{'id':_0x5d698b[_0xb75b('0x45')]}})[_0xb75b('0x3c')](function(_0x54327e){_0x270d91=_0x54327e;return db['Setting'][_0xb75b('0x46')]({'where':{'id':0x1},'attributes':[_0xb75b('0x47'),'blockDuration'],'raw':!![]});})[_0xb75b('0x3c')](function(_0x1c8c50){if(!_0x270d91||!_[_0xb75b('0x48')](_0x270d91['apiKeyNonce'],_0x5d698b[_0xb75b('0x49')])){return _0x369111[_0xb75b('0x31')](0x191)[_0xb75b('0x33')]({'message':_0xb75b('0x4a')});}if(_0x270d91[_0xb75b('0x4b')]){return _0x369111[_0xb75b('0x31')](0x191)[_0xb75b('0x33')]({'message':_0xb75b('0x4c')});}if(_0x270d91[_0xb75b('0x4d')]){if(_0x1c8c50[_0xb75b('0x4e')]>0x0){if(moment(_0x270d91[_0xb75b('0x4f')])[_0xb75b('0x50')](_0x1c8c50[_0xb75b('0x4e')],_0xb75b('0x51'))>moment()){return _0x369111[_0xb75b('0x31')](0x191)[_0xb75b('0x33')]({'message':_0xb75b('0x4c')});}}else{return _0x369111[_0xb75b('0x31')](0x191)[_0xb75b('0x33')]({'message':_0xb75b('0x4c')});}}_0x43061e[_0xb75b('0x2d')]={'id':_0x270d91['id']};_0x1970cc();});})[_0xb75b('0x35')](function(){return _0x369111[_0xb75b('0x31')](0x191)[_0xb75b('0x33')]({'message':_0xb75b('0x4c')});});}catch(_0x6438f6){_0x1970cc(_0x6438f6);}}else if(_0x4a1224){_0x1970cc();}else{return _0x369111[_0xb75b('0x31')](0x193)[_0xb75b('0x33')]({'message':_0xb75b('0x40')});}})['use'](function(_0x4cf0e8,_0x5eac1e,_0x1b4c4a){if(_0x4cf0e8[_0xb75b('0x2d')]){db[_0xb75b('0x44')][_0xb75b('0x3b')]({'where':{'id':_0x4cf0e8[_0xb75b('0x2d')]['id']},'attributes':userAttributes})[_0xb75b('0x3c')](function(_0x5f0216){if(!_0x5f0216){return _0x5eac1e[_0xb75b('0x31')](0x194)[_0xb75b('0x33')]({'message':'User\x20not\x20found.'});}_0x4cf0e8['user']=_0x5f0216;_0x1b4c4a();})[_0xb75b('0x35')](function(_0x1422af){_0x1b4c4a(_0x1422af);});}else if(_0x4a1224){_0x1b4c4a();}else{return _0x5eac1e[_0xb75b('0x31')](0x194)[_0xb75b('0x33')]({'message':_0xb75b('0x52')});}});};exports[_0xb75b('0x53')]=function canUpdate(){return compose()[_0xb75b('0x36')](function(_0x4d8edf,_0x50fbde,_0x2834a5){return licenseUtil[_0xb75b('0x54')]()[_0xb75b('0x3c')](function(_0x2bb1c1){if(_0x2bb1c1[_0xb75b('0x55')]){_0x2834a5();}else{return _0x50fbde['status'](0x193)[_0xb75b('0x33')]({'message':_0xb75b('0x56')});}})[_0xb75b('0x35')](function(_0x2a4a8a){_0x2834a5(_0x2a4a8a);});});};exports[_0xb75b('0x57')]=function(_0x108e34,_0xba3574,_0x3e37a1){_0x108e34[_0xb75b('0x57')]=!![];return _0x3e37a1();};exports['signToken']=function signToken(_0x3f251d){return signJwt(_0x3f251d);};exports[_0xb75b('0x58')]=function(_0x689286,_0x3aafd7){if(!_0x689286['user']){return _0x3aafd7[_0xb75b('0x31')](0x194)[_0xb75b('0x33')]({'message':_0xb75b('0x59')});}var _0x3cf797={'payload':{'id':_0x689286[_0xb75b('0x2d')]['id'],'role':_0x689286[_0xb75b('0x2d')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3cf797)[_0xb75b('0x3c')](function(_0x33e084){_0x3aafd7[_0xb75b('0x5a')](_0xb75b('0x5b'),_0x33e084);_0x3aafd7['redirect'](_0xb75b('0x5c'));})[_0xb75b('0x35')](function(_0x3ed82f){return _0x3aafd7[_0xb75b('0x31')](0x1f4)['send'](_0x3ed82f);});};exports[_0xb75b('0x5d')]=function(_0x5101fd){if(_[_0xb75b('0x5e')](_0x5101fd['apiKeyNonce'])||_['isNil'](_0x5101fd[_0xb75b('0x5f')])){return null;}else{return createJwt(_0x5101fd);}};exports[_0xb75b('0x60')]=function(_0x2f6db5){_0x2f6db5[_0xb75b('0x61')]=generateNonce();_0x2f6db5[_0xb75b('0x5f')]=generateIssuedAt();return createJwt(_0x2f6db5);};exports[_0xb75b('0x62')]=function(_0x1d5693,_0x1c527d){var _0x1f4c11=_0x1d5693['query']['apikey'];if(_0x1f4c11){var _0x22afb2={'nonce':_0x1c527d[_0xb75b('0x61')],'iat':_0x1c527d[_0xb75b('0x5f')],'audience':hardwareConf[_0xb75b('0x43')](),'issuer':hardwareConf[_0xb75b('0x43')]()};return verifyJwt(_0x1f4c11,_0x22afb2)[_0xb75b('0x3c')](function(){return generateApiKey(_0x1c527d);});}else{throw{'message':_0xb75b('0x63')};}};exports['validatePasswordPattern']=function(_0x59775e){var _0x2fdad5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2fdad5[_0xb75b('0x64')](_0x59775e))throw new db[(_0xb75b('0x65'))][(_0xb75b('0x66'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0xb75b('0x67')]=function(_0x511caf,_0x512adc,_0x4f117d){var _0x197c15=encryptor[_0xb75b('0x68')](_0x512adc)['split'](',');for(var _0x113b79=0x0;_0x113b79<_0x4f117d;_0x113b79++){if(!_0x197c15[_0x113b79])break;if(_0x511caf[_0xb75b('0x69')]()===_0x197c15[_0x113b79]['toLowerCase']()){var _0x695766=util[_0xb75b('0x6a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x4f117d);if(_0x4f117d===0x1){_0x695766=_0xb75b('0x6b');}throw new db['Sequelize'][(_0xb75b('0x66'))](_0x695766);}}return;};exports['updatePasswordsHistory']=function(_0x4b760e,_0x247733){var _0x323aa0=_0x247733?encryptor[_0xb75b('0x68')](_0x247733)[_0xb75b('0x6c')](','):[];if(_0x323aa0[_0xb75b('0x6d')]===0x5){_0x323aa0[_0xb75b('0x6e')](-0x1,0x1);}_0x323aa0[_0xb75b('0x6f')](_0x4b760e);return encryptor[_0xb75b('0x70')](_0x323aa0['join'](','));};function signJwt(_0x15be3b){var _0x49d98c=BPromise[_0xb75b('0x71')](jwt['sign'],{'context':jwt});var _0xdd3fd0=_0x15be3b[_0xb75b('0x72')]||config['secrets'][_0xb75b('0xc')];return new BPromise(function(_0x205ba7,_0x2ce3be){_0x49d98c(_0x15be3b['payload'],_0xdd3fd0,_0x15be3b[_0xb75b('0x73')])[_0xb75b('0x3c')](function(_0x5d25a8){_0x205ba7(_0x5d25a8);})[_0xb75b('0x35')](function(_0x48e7ac){_0x2ce3be(_0x48e7ac);});});}function verifyJwt(_0x20eff,_0x27d0f4,_0x54cc06){var _0x21397e=BPromise[_0xb75b('0x71')](jwt[_0xb75b('0x74')],{'context':jwt});var _0x4f054e=_0x54cc06||config[_0xb75b('0xb')][_0xb75b('0xc')];return new BPromise(function(_0x15f467,_0x149c33){_0x21397e(_0x20eff,_0x4f054e,_0x27d0f4)['then'](function(_0x38ec6b){_0x15f467(_0x38ec6b);})[_0xb75b('0x35')](function(_0x54afdd){_0x149c33(_0x54afdd);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb75b('0x75')](_0xb75b('0x76'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0xb75b('0x75')]();}function createJwt(_0x3c6c50){var _0xf14f1d={'payload':{'iat':_0x3c6c50[_0xb75b('0x5f')],'nonce':_0x3c6c50['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x3c6c50['id'][_0xb75b('0x75')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xb75b('0x43')]()}};return signJwt(_0xf14f1d)[_0xb75b('0x3c')](function(_0x239739){return{'iat':_0x3c6c50['apiKeyIat'],'nonce':_0x3c6c50[_0xb75b('0x61')],'token':_0x239739};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index af774be..aa0b8fb 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 _0xe601=['is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','close','unlink','decryptFile','createDecipher','update','encryptString','secret','utf8','base64','decryptString','final','crypto','bluebird','lodash','../../config/environment','app','secrets','session','aes192','encrypt','algorithm','join','error'];(function(_0x43a602,_0x4fe4ef){var _0x5b085c=function(_0xf6f6c4){while(--_0xf6f6c4){_0x43a602['push'](_0x43a602['shift']());}};_0x5b085c(++_0x4fe4ef);}(_0xe601,0x180));var _0x1e60=function(_0x54a0c0,_0x49b314){_0x54a0c0=_0x54a0c0-0x0;var _0x4c27b7=_0xe601[_0x54a0c0];return _0x4c27b7;};'use strict';var crypto=require(_0x1e60('0x0'));var fs=require('fs');var BPromise=require(_0x1e60('0x1'));var _=require(_0x1e60('0x2'));var config=require(_0x1e60('0x3'));var logger=require('../../config/logger')(_0x1e60('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1e60('0x5')][_0x1e60('0x6')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x1e60('0x7')};if(config[_0x1e60('0x8')]&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x1e60('0x8')][_0x1e60('0x9')]);if(isSupported){fileOptions[_0x1e60('0x9')]=config[_0x1e60('0x8')][_0x1e60('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x1e60('0xa')](',\x20');logger[_0x1e60('0xb')](config[_0x1e60('0x8')][_0x1e60('0x9')],_0x1e60('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2b40f0){return AES_SUPPORTED_RX[_0x1e60('0xd')](_0x2b40f0);}function getSupportedCiphers(){return crypto[_0x1e60('0xe')]()[_0x1e60('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x13089c){return getSupportedCiphers()['indexOf'](_0x13089c)>-0x1;}function combineOptions(_0xae5cbd){var _0x285b0={};for(var _0x2c8c6a in fileOptions){if(fileOptions[_0x1e60('0x10')](_0x2c8c6a)){_0x285b0[_0x2c8c6a]=fileOptions[_0x2c8c6a];}}if(_0xae5cbd){for(var _0x39ad82 in _0xae5cbd){if(_0xae5cbd[_0x1e60('0x10')](_0x39ad82)){_0x285b0[_0x39ad82]=_0xae5cbd[_0x39ad82];}}}return _0x285b0;}exports[_0x1e60('0x11')]=function(_0x2cc82d,_0x4b6389,_0xb7d512,_0x1958c0){return new BPromise(function(_0x5a34b7,_0x33dac9){_0x1958c0=combineOptions(_0x1958c0);var _0x48c292=new Buffer(_0xb7d512);var _0x437607=fs[_0x1e60('0x12')](_0x2cc82d);var _0x253a18=fs[_0x1e60('0x13')](_0x4b6389);var _0x4a8886=crypto[_0x1e60('0x14')](_0x1958c0[_0x1e60('0x9')],_0x48c292);_0x437607['on'](_0x1e60('0x15'),function(_0x40fd0d){var _0xdefe1f=new Buffer(_0x4a8886['update'](_0x40fd0d),_0x1e60('0x16'));_0x253a18[_0x1e60('0x17')](_0xdefe1f);});_0x437607['on']('end',function(){try{var _0x594244=new Buffer(_0x4a8886['final'](_0x1e60('0x16')),_0x1e60('0x16'));_0x253a18['write'](_0x594244);_0x253a18[_0x1e60('0x18')]();_0x253a18['on'](_0x1e60('0x19'),function(){return _0x5a34b7(_0x4b6389);});}catch(_0x3fb7b){fs[_0x1e60('0x1a')](_0x4b6389);return _0x33dac9(_0x3fb7b);}});});};exports[_0x1e60('0x1b')]=function(_0x447163,_0x493ab6,_0x2cbcc3,_0x2884d1){return new BPromise(function(_0x5d30ba,_0x9dec6d){_0x2884d1=combineOptions(_0x2884d1);var _0x230b10=new Buffer(_0x2cbcc3);var _0x47ce5b=fs[_0x1e60('0x12')](_0x447163);var _0x1b5d53=fs[_0x1e60('0x13')](_0x493ab6);var _0x320f5a=crypto[_0x1e60('0x1c')](_0x2884d1['algorithm'],_0x230b10);_0x47ce5b['on'](_0x1e60('0x15'),function(_0x3f707b){var _0x268a8c=new Buffer(_0x320f5a[_0x1e60('0x1d')](_0x3f707b),_0x1e60('0x16'));_0x1b5d53[_0x1e60('0x17')](_0x268a8c);});_0x47ce5b['on'](_0x1e60('0x18'),function(){try{var _0x406797=new Buffer(_0x320f5a['final'](_0x1e60('0x16')),_0x1e60('0x16'));_0x1b5d53[_0x1e60('0x17')](_0x406797);_0x1b5d53[_0x1e60('0x18')]();_0x1b5d53['on'](_0x1e60('0x19'),function(){return _0x5d30ba(_0x493ab6);});}catch(_0x3765ae){fs[_0x1e60('0x1a')](_0x493ab6);return _0x9dec6d(_0x3765ae);}});});};exports[_0x1e60('0x1e')]=function(_0x40e073,_0x293c40,_0x2902ba){var _0x5ef8bb=_0x2902ba||stringOptions[_0x1e60('0x9')];var _0x19bfd0=_0x293c40||stringOptions[_0x1e60('0x1f')];var _0x2862ee=crypto[_0x1e60('0x14')](_0x5ef8bb,_0x19bfd0);var _0x69ac22=_0x2862ee[_0x1e60('0x1d')](_0x40e073,_0x1e60('0x20'),_0x1e60('0x21'));_0x69ac22+=_0x2862ee['final']('base64');return _0x69ac22;};exports[_0x1e60('0x22')]=function(_0x43ec50,_0x58b8cb,_0x30c73b){var _0x162e54=_0x30c73b||stringOptions['algorithm'];var _0x2fee4e=_0x58b8cb||stringOptions['secret'];var _0x53afc8=crypto['createDecipher'](_0x162e54,_0x2fee4e);var _0x153c3b=_0x53afc8['update'](_0x43ec50,'base64',_0x1e60('0x20'));_0x153c3b+=_0x53afc8[_0x1e60('0x23')](_0x1e60('0x20'));return _0x153c3b;}; \ No newline at end of file +var _0x35d7=['final','close','decryptFile','createDecipher','end','unlink','encryptString','secret','utf8','decryptString','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write'];(function(_0x3bb421,_0x37300b){var _0x5e0da0=function(_0x3d6bf1){while(--_0x3d6bf1){_0x3bb421['push'](_0x3bb421['shift']());}};_0x5e0da0(++_0x37300b);}(_0x35d7,0x169));var _0x735d=function(_0x536405,_0x2df3de){_0x536405=_0x536405-0x0;var _0x504f96=_0x35d7[_0x536405];return _0x504f96;};'use strict';var crypto=require(_0x735d('0x0'));var fs=require('fs');var BPromise=require(_0x735d('0x1'));var _=require(_0x735d('0x2'));var config=require(_0x735d('0x3'));var logger=require(_0x735d('0x4'))(_0x735d('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x735d('0x6')][_0x735d('0x7')],'algorithm':_0x735d('0x8')};const fileOptions={'algorithm':'aes192'};if(config[_0x735d('0x9')]&&config[_0x735d('0x9')][_0x735d('0xa')]){var isSupported=isAlgorithmSupported(config[_0x735d('0x9')][_0x735d('0xa')]);if(isSupported){fileOptions[_0x735d('0xa')]=config[_0x735d('0x9')][_0x735d('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x735d('0xb')](',\x20');logger[_0x735d('0xc')](config[_0x735d('0x9')][_0x735d('0xa')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x20df0d){return AES_SUPPORTED_RX[_0x735d('0xd')](_0x20df0d);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x735d('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x4bbc7b){return getSupportedCiphers()[_0x735d('0xf')](_0x4bbc7b)>-0x1;}function combineOptions(_0x3d1641){var _0x2c43a7={};for(var _0x9ac31c in fileOptions){if(fileOptions[_0x735d('0x10')](_0x9ac31c)){_0x2c43a7[_0x9ac31c]=fileOptions[_0x9ac31c];}}if(_0x3d1641){for(var _0x279144 in _0x3d1641){if(_0x3d1641[_0x735d('0x10')](_0x279144)){_0x2c43a7[_0x279144]=_0x3d1641[_0x279144];}}}return _0x2c43a7;}exports[_0x735d('0x11')]=function(_0x29489e,_0x35a790,_0x4bc0ad,_0x4bf696){return new BPromise(function(_0x14bc7a,_0x292b68){_0x4bf696=combineOptions(_0x4bf696);var _0x143a60=new Buffer(_0x4bc0ad);var _0x2bf5d1=fs[_0x735d('0x12')](_0x29489e);var _0x499373=fs[_0x735d('0x13')](_0x35a790);var _0x7ec7ca=crypto[_0x735d('0x14')](_0x4bf696[_0x735d('0xa')],_0x143a60);_0x2bf5d1['on']('data',function(_0x5eb3c3){var _0x4c7390=new Buffer(_0x7ec7ca[_0x735d('0x15')](_0x5eb3c3),_0x735d('0x16'));_0x499373[_0x735d('0x17')](_0x4c7390);});_0x2bf5d1['on']('end',function(){try{var _0x68bc1e=new Buffer(_0x7ec7ca[_0x735d('0x18')](_0x735d('0x16')),'binary');_0x499373[_0x735d('0x17')](_0x68bc1e);_0x499373['end']();_0x499373['on'](_0x735d('0x19'),function(){return _0x14bc7a(_0x35a790);});}catch(_0x46c867){fs['unlink'](_0x35a790);return _0x292b68(_0x46c867);}});});};exports[_0x735d('0x1a')]=function(_0xe8471e,_0x130195,_0x2c6604,_0x15a3a2){return new BPromise(function(_0x1aaece,_0x10fe45){_0x15a3a2=combineOptions(_0x15a3a2);var _0x199a8a=new Buffer(_0x2c6604);var _0x1cc84b=fs[_0x735d('0x12')](_0xe8471e);var _0x579b7b=fs[_0x735d('0x13')](_0x130195);var _0x54b52a=crypto[_0x735d('0x1b')](_0x15a3a2['algorithm'],_0x199a8a);_0x1cc84b['on']('data',function(_0x4e7e73){var _0x1b3031=new Buffer(_0x54b52a[_0x735d('0x15')](_0x4e7e73),'binary');_0x579b7b[_0x735d('0x17')](_0x1b3031);});_0x1cc84b['on'](_0x735d('0x1c'),function(){try{var _0x1635d6=new Buffer(_0x54b52a[_0x735d('0x18')](_0x735d('0x16')),_0x735d('0x16'));_0x579b7b[_0x735d('0x17')](_0x1635d6);_0x579b7b[_0x735d('0x1c')]();_0x579b7b['on']('close',function(){return _0x1aaece(_0x130195);});}catch(_0x38cb76){fs[_0x735d('0x1d')](_0x130195);return _0x10fe45(_0x38cb76);}});});};exports[_0x735d('0x1e')]=function(_0x46dbae,_0x2fdf84,_0x1a034c){var _0x3c97e8=_0x1a034c||stringOptions[_0x735d('0xa')];var _0x57f44e=_0x2fdf84||stringOptions[_0x735d('0x1f')];var _0x27bff9=crypto[_0x735d('0x14')](_0x3c97e8,_0x57f44e);var _0x3de445=_0x27bff9[_0x735d('0x15')](_0x46dbae,_0x735d('0x20'),'base64');_0x3de445+=_0x27bff9[_0x735d('0x18')]('base64');return _0x3de445;};exports[_0x735d('0x21')]=function(_0x1f00a3,_0x377bae,_0x276873){var _0x1eeecb=_0x276873||stringOptions[_0x735d('0xa')];var _0x5c65fc=_0x377bae||stringOptions[_0x735d('0x1f')];var _0x27a38e=crypto[_0x735d('0x1b')](_0x1eeecb,_0x5c65fc);var _0x25bce1=_0x27a38e[_0x735d('0x15')](_0x1f00a3,_0x735d('0x22'),'utf8');_0x25bce1+=_0x27a38e[_0x735d('0x18')](_0x735d('0x20'));return _0x25bce1;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6ab05a1..1bf8ece 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 _0xf23f=['util','path','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','CSV','find','split','then','splitSizeCsv','sequelize','QueryTypes','Empty','length','range','num','isInteger','forEach','push','query','SELECT','dirname','basename','.csv','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit'];(function(_0xc19465,_0x4d5ced){var _0x332cfb=function(_0xae89b4){while(--_0xae89b4){_0xc19465['push'](_0xc19465['shift']());}};_0x332cfb(++_0x4d5ced);}(_0xf23f,0xc0));var _0xff23=function(_0x27e9b3,_0x1b17af){_0x27e9b3=_0x27e9b3-0x0;var _0x553cac=_0xf23f[_0x27e9b3];return _0x553cac;};'use strict';var util=require(_0xff23('0x0'));var path=require(_0xff23('0x1'));var _=require('lodash');var csv=require(_0xff23('0x2'));var fs=require('fs');var BPromise=require(_0xff23('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xff23('0x4'));var db=require(_0xff23('0x5'))['db'];var dbH=require('../../mysqldb')[_0xff23('0x6')];var logger=require(_0xff23('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xff23('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xff23('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x235f53,_0x21c42c){var _0x5a5eb7={'status':_0x235f53};var _0x38fb96={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21c42c){_0x5a5eb7[_0xff23('0x9')]=_0x21c42c;}return db[_0xff23('0xa')][_0xff23('0xb')](_0x5a5eb7,_0x38fb96);}function main(){var _0x229281=0x1388;var _0x37b105;logger[_0xff23('0xc')](util[_0xff23('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xff23('0xe')));return db['Setting'][_0xff23('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xff23('0x10'),'splitSizeCsv']})[_0xff23('0x11')](function(_0x3fadee){if(_0x3fadee){_0x37b105=_0x3fadee;_0x229281=_0x37b105[_0xff23('0x12')]||0x1388;}})[_0xff23('0x11')](function(){return dbH[_0xff23('0x13')]['query'](util[_0xff23('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xff23('0x14')]['SELECT']});})[_0xff23('0x11')](function(_0x406bc8){if(!_0x406bc8[0x0]['num']){return analyticExtractedReport(_0xff23('0x15'));}var _0xec06da=[];var _0x231fcb=0x0;if(_0x37b105['split']){if(_0x406bc8&&_0x406bc8[_0xff23('0x16')]){var _0x19ff23=_[_0xff23('0x17')](_0x406bc8[0x0][_0xff23('0x18')]/_0x229281);var _0x53c45f=Number[_0xff23('0x19')](_0x406bc8[0x0]['num']/_0x229281)?_0x406bc8[0x0][_0xff23('0x18')]%_0x229281:0x0;_0x19ff23[_0xff23('0x1a')](function(_0xbf677f){if(_0xbf677f>0x0){_0x231fcb+=_0x229281;}_0xec06da[_0xff23('0x1b')](dbH[_0xff23('0x13')][_0xff23('0x1c')](util[_0xff23('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x229281,_0x231fcb),{'type':dbH[_0xff23('0x13')]['QueryTypes'][_0xff23('0x1d')]}));});if(_0x53c45f>0x0){_0x231fcb+=_0x229281;_0xec06da[_0xff23('0x1b')](dbH[_0xff23('0x13')]['query'](util[_0xff23('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x53c45f,_0x231fcb),{'type':dbH['sequelize'][_0xff23('0x14')]['SELECT']}));}}}else{_0xec06da['push'](dbH[_0xff23('0x13')][_0xff23('0x1c')](QUERY,{'type':dbH[_0xff23('0x13')][_0xff23('0x14')]['SELECT']}));}var _0x2e1158=path[_0xff23('0x1e')](PATH);var _0xaa7e56=path[_0xff23('0x1f')](PATH,_0xff23('0x20'));var _0x2985f6=_0x37b105['split']&&_0xec06da[_0xff23('0x16')]>0x1;var _0x36761c=[];if(!fs['existsSync'](path[_0xff23('0x21')](_0x2e1158,_0xaa7e56))&&_0x2985f6){fs[_0xff23('0x22')](path[_0xff23('0x21')](_0x2e1158,_0xaa7e56));}return BPromise[_0xff23('0x23')](_0xec06da,function(_0x347a0d){_0x36761c[_0xff23('0x1b')](_0x347a0d);})[_0xff23('0x11')](function(){for(var _0x1fc44f=0x0;_0x1fc44f<_0x36761c[_0xff23('0x16')];_0x1fc44f+=0x1){var _0x24b2c8;var _0x2d5464=_0x36761c[_0x1fc44f];if(_0x2985f6){_0x24b2c8=path['join'](_0x2e1158,_0xaa7e56,util[_0xff23('0xd')](_0xff23('0x24'),_0xaa7e56,_0x1fc44f,_0xff23('0x25')));}else{_0x24b2c8=path[_0xff23('0x21')](_0x2e1158,util[_0xff23('0xd')]('%s.%s',_0xaa7e56,_0xff23('0x25')));}fs['writeFileSync'](_0x24b2c8,csv(_0x2d5464));}})[_0xff23('0x11')](function(){if(_0x2985f6){return new Promise(function(_0x218e74){zipdir(path['join'](_0x2e1158,_0xaa7e56),{'saveTo':path['join'](_0x2e1158,util[_0xff23('0xd')](_0xff23('0x26'),_0xaa7e56,_0xff23('0x27')))},function(_0x5b0dfd,_0x11a77d){rimraf(path[_0xff23('0x21')](_0x2e1158,_0xaa7e56),function(){});_0x218e74(_0xff23('0x28'));});});}})[_0xff23('0x11')](function(){logger[_0xff23('0xc')](util[_0xff23('0xd')](_0xff23('0x29'),EXTRACTED_REPORT_ID,_0xff23('0xe')));return analyticExtractedReport(_0xff23('0x2a'),_0x2985f6?util[_0xff23('0xd')](_0xff23('0x26'),_0xaa7e56,_0x2985f6?_0xff23('0x27'):'csv'):null);});})['catch'](function(_0x2c2883){logger[_0xff23('0xc')](util[_0xff23('0xd')](_0xff23('0x2b'),EXTRACTED_REPORT_ID,_0xff23('0xe')),util[_0xff23('0x2c')](_0x2c2883,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xff23('0x2d'));})[_0xff23('0x2e')](function(){process[_0xff23('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x51a9=['rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','join','each','csv','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','util','path','to-csv','bluebird','zip-dir'];(function(_0x3517e5,_0x2c3608){var _0x15ba05=function(_0x6eccbc){while(--_0x6eccbc){_0x3517e5['push'](_0x3517e5['shift']());}};_0x15ba05(++_0x2c3608);}(_0x51a9,0x136));var _0x951a=function(_0x15393b,_0x2519eb){_0x15393b=_0x15393b-0x0;var _0x118659=_0x51a9[_0x15393b];return _0x118659;};'use strict';var util=require(_0x951a('0x0'));var path=require(_0x951a('0x1'));var _=require('lodash');var csv=require(_0x951a('0x2'));var fs=require('fs');var BPromise=require(_0x951a('0x3'));var zipdir=require(_0x951a('0x4'));var rimraf=require(_0x951a('0x5'));var db=require(_0x951a('0x6'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x951a('0x7'))(_0x951a('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x951a('0x9')][0x2]);var QUERY=process[_0x951a('0x9')][0x3];var PATH=process[_0x951a('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8a5302,_0xbc50ff){var _0x207f09={'status':_0x8a5302};var _0x48851e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xbc50ff){_0x207f09['savename']=_0xbc50ff;}return db[_0x951a('0xa')][_0x951a('0xb')](_0x207f09,_0x48851e);}function main(){var _0x4db5dc=0x1388;var _0x1c3517;logger[_0x951a('0xc')](util[_0x951a('0xd')](_0x951a('0xe'),EXTRACTED_REPORT_ID,_0x951a('0xf')));return db[_0x951a('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x951a('0x11'),_0x951a('0x12')]})[_0x951a('0x13')](function(_0x1673d7){if(_0x1673d7){_0x1c3517=_0x1673d7;_0x4db5dc=_0x1c3517[_0x951a('0x12')]||0x1388;}})[_0x951a('0x13')](function(){return dbH['sequelize'][_0x951a('0x14')](util[_0x951a('0xd')](_0x951a('0x15'),QUERY),{'type':dbH[_0x951a('0x16')][_0x951a('0x17')][_0x951a('0x18')]});})['then'](function(_0x324830){if(!_0x324830[0x0][_0x951a('0x19')]){return analyticExtractedReport('Empty');}var _0x3a7d4f=[];var _0x2223ac=0x0;if(_0x1c3517[_0x951a('0x11')]){if(_0x324830&&_0x324830[_0x951a('0x1a')]){var _0x5c8224=_[_0x951a('0x1b')](_0x324830[0x0][_0x951a('0x19')]/_0x4db5dc);var _0x564ab8=Number['isInteger'](_0x324830[0x0][_0x951a('0x19')]/_0x4db5dc)?_0x324830[0x0][_0x951a('0x19')]%_0x4db5dc:0x0;_0x5c8224[_0x951a('0x1c')](function(_0x796590){if(_0x796590>0x0){_0x2223ac+=_0x4db5dc;}_0x3a7d4f[_0x951a('0x1d')](dbH[_0x951a('0x16')][_0x951a('0x14')](util[_0x951a('0xd')](_0x951a('0x1e'),QUERY,_0x4db5dc,_0x2223ac),{'type':dbH[_0x951a('0x16')][_0x951a('0x17')]['SELECT']}));});if(_0x564ab8>0x0){_0x2223ac+=_0x4db5dc;_0x3a7d4f[_0x951a('0x1d')](dbH[_0x951a('0x16')][_0x951a('0x14')](util[_0x951a('0xd')](_0x951a('0x1e'),QUERY,_0x564ab8,_0x2223ac),{'type':dbH[_0x951a('0x16')]['QueryTypes'][_0x951a('0x18')]}));}}}else{_0x3a7d4f[_0x951a('0x1d')](dbH[_0x951a('0x16')][_0x951a('0x14')](QUERY,{'type':dbH[_0x951a('0x16')]['QueryTypes'][_0x951a('0x18')]}));}var _0x19ba25=path['dirname'](PATH);var _0xec4b41=path['basename'](PATH,_0x951a('0x1f'));var _0x3fde9a=_0x1c3517[_0x951a('0x11')]&&_0x3a7d4f[_0x951a('0x1a')]>0x1;var _0x51dc4d=[];if(!fs['existsSync'](path[_0x951a('0x20')](_0x19ba25,_0xec4b41))&&_0x3fde9a){fs['mkdirSync'](path['join'](_0x19ba25,_0xec4b41));}return BPromise[_0x951a('0x21')](_0x3a7d4f,function(_0x42fca4){_0x51dc4d[_0x951a('0x1d')](_0x42fca4);})[_0x951a('0x13')](function(){for(var _0x588609=0x0;_0x588609<_0x51dc4d[_0x951a('0x1a')];_0x588609+=0x1){var _0x449115;var _0x12327c=_0x51dc4d[_0x588609];if(_0x3fde9a){_0x449115=path[_0x951a('0x20')](_0x19ba25,_0xec4b41,util[_0x951a('0xd')]('%s%d.%s',_0xec4b41,_0x588609,_0x951a('0x22')));}else{_0x449115=path[_0x951a('0x20')](_0x19ba25,util[_0x951a('0xd')]('%s.%s',_0xec4b41,_0x951a('0x22')));}fs['writeFileSync'](_0x449115,csv(_0x12327c));}})[_0x951a('0x13')](function(){if(_0x3fde9a){return new Promise(function(_0x58bc73){zipdir(path['join'](_0x19ba25,_0xec4b41),{'saveTo':path['join'](_0x19ba25,util[_0x951a('0xd')](_0x951a('0x23'),_0xec4b41,_0x951a('0x24')))},function(_0xa09cb0,_0x1c7d9f){rimraf(path[_0x951a('0x20')](_0x19ba25,_0xec4b41),function(){});_0x58bc73(_0x951a('0x25'));});});}})['then'](function(){logger['info'](util[_0x951a('0xd')](_0x951a('0x26'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x951a('0x27'),_0x3fde9a?util[_0x951a('0xd')]('%s.%s',_0xec4b41,_0x3fde9a?_0x951a('0x24'):_0x951a('0x22')):null);});})[_0x951a('0x28')](function(_0x20f5b3){logger[_0x951a('0xc')](util['format'](_0x951a('0x29'),EXTRACTED_REPORT_ID,'CSV'),util[_0x951a('0x2a')](_0x20f5b3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x951a('0x2b'));})['finally'](function(){process[_0x951a('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 1dd9305..ec03d58 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 _0xdeb7=['catch','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','push','body','concat','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','before','landscape','footer','Arial','black','Empty','Setting','find','split','splitSizePdf','then','num','isInteger','forEach','sequelize','QueryTypes','SELECT','query','dirname','basename','existsSync','join','each','flatten','createPdfKitDocument','pdf','all','%s.%s','zip','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','inspect','Failed','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','end'];(function(_0x3fa593,_0x2d587f){var _0x54cf6a=function(_0x3cbf40){while(--_0x3cbf40){_0x3fa593['push'](_0x3fa593['shift']());}};_0x54cf6a(++_0x2d587f);}(_0xdeb7,0x103));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x7deb('0x0'));var moment=require(_0x7deb('0x1'));var htmlToPdfmake=require(_0x7deb('0x2'));var PdfPrinter=require(_0x7deb('0x3'));var zipdir=require(_0x7deb('0x4'));var rimraf=require(_0x7deb('0x5'));var JSDOM=require(_0x7deb('0x6'))['JSDOM'];var window=new JSDOM('')[_0x7deb('0x7')];var BPromise=require(_0x7deb('0x8'));var db=require(_0x7deb('0x9'))['db'];var dbH=require(_0x7deb('0x9'))[_0x7deb('0xa')];var logger=require('../../config/logger')(_0x7deb('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x7deb('0xc')][0x2]);var QUERY=process[_0x7deb('0xc')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x7deb('0xc')][0x5];var FORMAT=_0x7deb('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1ba207,_0x3fe9aa){var _0x2d8db9={'status':_0x1ba207};var _0x45c856={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3fe9aa){_0x2d8db9[_0x7deb('0xe')]=_0x3fe9aa;}return db[_0x7deb('0xf')][_0x7deb('0x10')](_0x2d8db9,_0x45c856);}function getHeaders(_0x264f60){return _[_0x7deb('0x11')](_0x264f60,function(_0x5cf2e5){return{'text':_0x5cf2e5,'style':_0x7deb('0x12')};});}function getRows(_0x3173d5,_0xd38a9){return _[_0x7deb('0x11')](_0xd38a9,function(_0x190d37){return _(_0x190d37)[_0x7deb('0x13')](_0x3173d5)['map'](function(_0x547e31){return _0x547e31?_[_0x7deb('0x14')](_0x547e31):'';})[_0x7deb('0x15')]();});}function createTable(_0x1a2754,_0xf3914f){var _0x172184={'widths':_[_0x7deb('0x16')](Array(_0x1a2754[_0x7deb('0x17')]),0x91),'heights':function(_0x7db75a){return _0x7db75a===0x0?_0x7deb('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2a0f45=getHeaders(_0x1a2754);_0x172184['body'][_0x7deb('0x19')](_0x2a0f45);var _0x4113a2=getRows(_0x1a2754,_0xf3914f);_0x172184[_0x7deb('0x1a')]=_0x172184[_0x7deb('0x1a')][_0x7deb('0x1b')](_0x4113a2);return _0x172184;}function createTables(_0x51d8af){var _0xb5d95b=[];var _0x3670c5=_[_0x7deb('0x1c')](Object[_0x7deb('0x1d')](_0x51d8af[0x0]),0x5);_0x3670c5['forEach'](function(_0xd3e2e7){_0xb5d95b['push'](createTable(_0xd3e2e7,_0x51d8af));});return _0xb5d95b;}function getPDFDocDefinition(_0x41c067){var _0x363f92=util[_0x7deb('0x1e')](_0x7deb('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x7deb('0x20')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x7deb('0x21')])[_0x7deb('0x1e')](FORMAT));var _0x3169d1=[];for(var _0x2ec342=0x0;_0x2ec342<_0x41c067[_0x7deb('0x17')];_0x2ec342++){var _0x48d38a=[];if(_0x2ec342===0x0){_0x48d38a[_0x7deb('0x19')]({'text':_0x363f92,'style':'header'});}var _0x5f1c97={'table':_0x41c067[_0x2ec342]};if(_0x2ec342>0x0){_0x5f1c97[_0x7deb('0x22')]=_0x7deb('0x23');_0x5f1c97['margin']=[0x0,0x46,0x0,0x0];}_0x48d38a[_0x7deb('0x19')](_0x5f1c97);_0x3169d1['push'](_0x48d38a);}return{'pageSize':'A4','pageOrientation':_0x7deb('0x24'),'content':_0x3169d1,'footer':function(_0x3559bb,_0x5f50fc){return{'text':_0x3559bb['toString']()+'\x20/\x20'+_0x5f50fc,'style':_0x7deb('0x25')};},'defaultStyle':{'font':_0x7deb('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7deb('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x14bb48){var _0x12425e=0x1388;var _0x20da28;if(!_0x14bb48[0x0]['num']){return analyticExtractedReport(_0x7deb('0x28'));}return db[_0x7deb('0x29')][_0x7deb('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7deb('0x2b'),_0x7deb('0x2c')]})[_0x7deb('0x2d')](function(_0x39a6f2){if(_0x39a6f2){_0x20da28=_0x39a6f2;_0x12425e=_0x20da28[_0x7deb('0x2c')]||0x3e8;}})[_0x7deb('0x2d')](function(){var _0x2d2631=[];var _0x3e4cf9=0x0;if(_0x20da28['split']){if(_0x14bb48&&_0x14bb48[_0x7deb('0x17')]){var _0x21710a=_['range'](_0x14bb48[0x0][_0x7deb('0x2e')]/_0x12425e);var _0x389eab=Number[_0x7deb('0x2f')](_0x14bb48[0x0][_0x7deb('0x2e')]/_0x12425e)?_0x14bb48[0x0][_0x7deb('0x2e')]%_0x12425e:0x0;_0x21710a[_0x7deb('0x30')](function(_0x11516b){if(_0x11516b>0x0){_0x3e4cf9+=_0x12425e;}_0x2d2631[_0x7deb('0x19')](dbH[_0x7deb('0x31')]['query'](util[_0x7deb('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x12425e,_0x3e4cf9),{'type':dbH[_0x7deb('0x31')][_0x7deb('0x32')][_0x7deb('0x33')]}));});if(_0x389eab>0x0){_0x3e4cf9+=_0x12425e;_0x2d2631[_0x7deb('0x19')](dbH[_0x7deb('0x31')][_0x7deb('0x34')](util[_0x7deb('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x389eab,_0x3e4cf9),{'type':dbH[_0x7deb('0x31')][_0x7deb('0x32')][_0x7deb('0x33')]}));}}}else{_0x2d2631[_0x7deb('0x19')](dbH[_0x7deb('0x31')][_0x7deb('0x34')](QUERY,{'type':dbH[_0x7deb('0x31')][_0x7deb('0x32')][_0x7deb('0x33')]}));}var _0x4f12d9=path[_0x7deb('0x35')](PATH);var _0x23a561=path[_0x7deb('0x36')](PATH,'.pdf');var _0x185953=_0x20da28[_0x7deb('0x2b')]&&_0x2d2631[_0x7deb('0x17')]>0x1;var _0x8192d0=[];if(!fs[_0x7deb('0x37')](path[_0x7deb('0x38')](_0x4f12d9,_0x23a561))&&_0x185953){fs['mkdirSync'](path['join'](_0x4f12d9,_0x23a561));}return BPromise[_0x7deb('0x39')](_0x2d2631,function(_0x4e56ec){_0x8192d0[_0x7deb('0x19')](_0x4e56ec);})['then'](function(){var _0x526f71=[];for(var _0x531343=0x0;_0x531343<_0x8192d0[_0x7deb('0x17')];_0x531343+=0x1){var _0x5ba20a=_0x8192d0[_0x531343];var _0x4ce743=createTables(_[_0x7deb('0x3a')](_0x5ba20a));var _0x5770af;var _0x2119e8=getPDFDocDefinition(_0x4ce743);var _0x592a6f=getPDFPrinter();var _0x1f257f=_0x592a6f[_0x7deb('0x3b')](_0x2119e8);if(_0x185953){_0x5770af=path[_0x7deb('0x38')](_0x4f12d9,_0x23a561,util[_0x7deb('0x1e')]('%s%d.%s',_0x23a561,_0x531343,_0x7deb('0x3c')));}else{_0x5770af=path['join'](_0x4f12d9,util[_0x7deb('0x1e')]('%s.%s',_0x23a561,_0x7deb('0x3c')));}_0x526f71[_0x7deb('0x19')](writePDFDocument(_0x1f257f,_0x5770af));}return Promise[_0x7deb('0x3d')](_0x526f71);})[_0x7deb('0x2d')](function(){if(_0x185953){return new Promise(function(_0x10231){zipdir(path[_0x7deb('0x38')](_0x4f12d9,_0x23a561),{'saveTo':path[_0x7deb('0x38')](_0x4f12d9,util['format'](_0x7deb('0x3e'),_0x23a561,_0x7deb('0x3f')))},function(){rimraf(path[_0x7deb('0x38')](_0x4f12d9,_0x23a561),function(){});_0x10231('zip\x20finished');});});}})[_0x7deb('0x2d')](function(){if(!_0x185953)return;rimraf(path['join'](_0x4f12d9,_0x23a561),function(){});})[_0x7deb('0x2d')](function(){logger[_0x7deb('0x40')](util[_0x7deb('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7deb('0x41')));return analyticExtractedReport(_0x7deb('0x42'),_0x185953?util['format'](_0x7deb('0x3e'),_0x23a561,_0x185953?'zip':_0x7deb('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x7deb('0x40')](util[_0x7deb('0x1e')](_0x7deb('0x43'),EXTRACTED_REPORT_ID,_0x7deb('0x41')));return db[_0x7deb('0xf')][_0x7deb('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x55972b){EXTRACTED_REPORT=_0x55972b;return dbH[_0x7deb('0x31')][_0x7deb('0x34')](util['format'](_0x7deb('0x45'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})['then'](extractReport)['catch'](function(_0x49fe6c){logger['info'](util[_0x7deb('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0x7deb('0x46')](_0x49fe6c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7deb('0x47'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x21036f=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x7deb('0x48'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x7deb('0x49')}});return _0x21036f;}function getPDFDocDefinitionFromHTML(_0x349058,_0x5c31a8){var _0x555fc4=util['format'](_0x7deb('0x4a'),_0x5c31a8[_0x7deb('0x4b')],_0x5c31a8[_0x7deb('0x4c')]);var _0x148ef6=moment()[_0x7deb('0x1e')](_0x7deb('0x4d'))['toString']();var _0x16cd9a=htmlToPdfmake(_0x349058,{'window':window,'tableAutoSize':!![]});return{'content':[_0x16cd9a],'defaultStyle':{'font':_0x7deb('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7deb('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7deb('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x7deb('0x4e')}},'header':function(){return[{'text':_0x7deb('0x4f'),'style':_0x7deb('0x50')}];},'footer':function(_0x4316ff,_0x40d00e){return[{'text':util[_0x7deb('0x1e')](_0x7deb('0x51'),_0x555fc4,_0x4316ff,_0x40d00e,_0x148ef6),'style':'footer'}];}};}function writePDFDocument(_0xc3a644,_0xb64c33){return new Promise(function(_0x5457c9,_0x33e1c5){var _0x6bfcda=_0xc3a644[_0x7deb('0x52')](fs['createWriteStream'](_0xb64c33));_0x6bfcda['on'](_0x7deb('0x53'),function(){_0x5457c9(_0x7deb('0x53'));});_0x6bfcda['on']('error',function(_0x3fb1eb){_0x33e1c5(_0x3fb1eb);});_0xc3a644[_0x7deb('0x54')]();});}exports['createPdfFromHTML']=function(_0xe3353c,_0x1387d2){var _0x11f472=getPDFPrinter();var _0x89b19a=getPDFDocDefinitionFromHTML(_0xe3353c,_0x1387d2);var _0x4e713d=_0x11f472[_0x7deb('0x3b')](_0x89b19a);return writePDFDocument(_0x4e713d,_0x1387d2['path'])[_0x7deb('0x55')](function(_0x575546){throw _0x575546;});}; \ No newline at end of file +var _0x46d5=['length','body','push','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','endDate','header','pageBreak','before','margin','\x20/\x20','Arial','num','Setting','find','split','then','splitSizePdf','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','dirname','.pdf','existsSync','join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','createPdfFromHTML','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value'];(function(_0x2012a5,_0x3465e4){var _0x21bdf6=function(_0x581b23){while(--_0x581b23){_0x2012a5['push'](_0x2012a5['shift']());}};_0x21bdf6(++_0x3465e4);}(_0x46d5,0x190));var _0x546d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x46d5[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x546d('0x0'));var moment=require('moment');var htmlToPdfmake=require(_0x546d('0x1'));var PdfPrinter=require(_0x546d('0x2'));var zipdir=require(_0x546d('0x3'));var rimraf=require(_0x546d('0x4'));var JSDOM=require(_0x546d('0x5'))[_0x546d('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0x546d('0x7'));var db=require(_0x546d('0x8'))['db'];var dbH=require(_0x546d('0x8'))[_0x546d('0x9')];var logger=require(_0x546d('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x546d('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x46dd9e,_0x283c30){var _0x1e4ee3={'status':_0x46dd9e};var _0x2fd115={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x283c30){_0x1e4ee3[_0x546d('0xc')]=_0x283c30;}return db[_0x546d('0xd')][_0x546d('0xe')](_0x1e4ee3,_0x2fd115);}function getHeaders(_0x1c78db){return _['map'](_0x1c78db,function(_0x581ada){return{'text':_0x581ada,'style':_0x546d('0xf')};});}function getRows(_0x16000a,_0x206585){return _[_0x546d('0x10')](_0x206585,function(_0x551a1d){return _(_0x551a1d)[_0x546d('0x11')](_0x16000a)['map'](function(_0x427622){return _0x427622?_[_0x546d('0x12')](_0x427622):'';})[_0x546d('0x13')]();});}function createTable(_0x3b8a5e,_0x32926a){var _0x4f8efc={'widths':_['fill'](Array(_0x3b8a5e[_0x546d('0x14')]),0x91),'heights':function(_0x144e24){return _0x144e24===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x54afa4=getHeaders(_0x3b8a5e);_0x4f8efc[_0x546d('0x15')][_0x546d('0x16')](_0x54afa4);var _0x1a2feb=getRows(_0x3b8a5e,_0x32926a);_0x4f8efc[_0x546d('0x15')]=_0x4f8efc[_0x546d('0x15')]['concat'](_0x1a2feb);return _0x4f8efc;}function createTables(_0x1589f1){var _0x38871a=[];var _0x4d8990=_[_0x546d('0x17')](Object['keys'](_0x1589f1[0x0]),0x5);_0x4d8990[_0x546d('0x18')](function(_0x588d3d){_0x38871a[_0x546d('0x16')](createTable(_0x588d3d,_0x1589f1));});return _0x38871a;}function getPDFDocDefinition(_0x14f2c1){var _0xda5122=util[_0x546d('0x19')](_0x546d('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT['startDate'])[_0x546d('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x546d('0x1b')])['format'](FORMAT));var _0x23ac74=[];for(var _0x5393c5=0x0;_0x5393c5<_0x14f2c1[_0x546d('0x14')];_0x5393c5++){var _0x12a3a9=[];if(_0x5393c5===0x0){_0x12a3a9[_0x546d('0x16')]({'text':_0xda5122,'style':_0x546d('0x1c')});}var _0x224032={'table':_0x14f2c1[_0x5393c5]};if(_0x5393c5>0x0){_0x224032[_0x546d('0x1d')]=_0x546d('0x1e');_0x224032[_0x546d('0x1f')]=[0x0,0x46,0x0,0x0];}_0x12a3a9[_0x546d('0x16')](_0x224032);_0x23ac74[_0x546d('0x16')](_0x12a3a9);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x23ac74,'footer':function(_0x16a4fe,_0x526e4a){return{'text':_0x16a4fe[_0x546d('0x12')]()+_0x546d('0x20')+_0x526e4a,'style':'footer'};},'defaultStyle':{'font':_0x546d('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x41853d){var _0x1bf1c1=0x1388;var _0x449183;if(!_0x41853d[0x0][_0x546d('0x22')]){return analyticExtractedReport('Empty');}return db[_0x546d('0x23')][_0x546d('0x24')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x546d('0x25'),'splitSizePdf']})[_0x546d('0x26')](function(_0x551c86){if(_0x551c86){_0x449183=_0x551c86;_0x1bf1c1=_0x449183[_0x546d('0x27')]||0x3e8;}})[_0x546d('0x26')](function(){var _0x2d36d1=[];var _0x5121fe=0x0;if(_0x449183[_0x546d('0x25')]){if(_0x41853d&&_0x41853d[_0x546d('0x14')]){var _0x136d94=_[_0x546d('0x28')](_0x41853d[0x0][_0x546d('0x22')]/_0x1bf1c1);var _0x2180c6=Number[_0x546d('0x29')](_0x41853d[0x0]['num']/_0x1bf1c1)?_0x41853d[0x0][_0x546d('0x22')]%_0x1bf1c1:0x0;_0x136d94[_0x546d('0x18')](function(_0x3f0ffc){if(_0x3f0ffc>0x0){_0x5121fe+=_0x1bf1c1;}_0x2d36d1[_0x546d('0x16')](dbH['sequelize']['query'](util[_0x546d('0x19')](_0x546d('0x2a'),QUERY,_0x1bf1c1,_0x5121fe),{'type':dbH[_0x546d('0x2b')][_0x546d('0x2c')]['SELECT']}));});if(_0x2180c6>0x0){_0x5121fe+=_0x1bf1c1;_0x2d36d1[_0x546d('0x16')](dbH[_0x546d('0x2b')]['query'](util[_0x546d('0x19')](_0x546d('0x2a'),QUERY,_0x2180c6,_0x5121fe),{'type':dbH[_0x546d('0x2b')][_0x546d('0x2c')][_0x546d('0x2d')]}));}}}else{_0x2d36d1[_0x546d('0x16')](dbH[_0x546d('0x2b')][_0x546d('0x2e')](QUERY,{'type':dbH[_0x546d('0x2b')]['QueryTypes'][_0x546d('0x2d')]}));}var _0x59f60a=path[_0x546d('0x2f')](PATH);var _0x8f920=path['basename'](PATH,_0x546d('0x30'));var _0xec29f4=_0x449183[_0x546d('0x25')]&&_0x2d36d1[_0x546d('0x14')]>0x1;var _0x1603ec=[];if(!fs[_0x546d('0x31')](path[_0x546d('0x32')](_0x59f60a,_0x8f920))&&_0xec29f4){fs[_0x546d('0x33')](path[_0x546d('0x32')](_0x59f60a,_0x8f920));}return BPromise['each'](_0x2d36d1,function(_0x3d29c6){_0x1603ec[_0x546d('0x16')](_0x3d29c6);})[_0x546d('0x26')](function(){var _0x4ebd4d=[];for(var _0x513bbf=0x0;_0x513bbf<_0x1603ec[_0x546d('0x14')];_0x513bbf+=0x1){var _0x24b8d1=_0x1603ec[_0x513bbf];var _0x1ff93e=createTables(_[_0x546d('0x34')](_0x24b8d1));var _0x222a00;var _0x108bec=getPDFDocDefinition(_0x1ff93e);var _0x3de222=getPDFPrinter();var _0x40a494=_0x3de222[_0x546d('0x35')](_0x108bec);if(_0xec29f4){_0x222a00=path[_0x546d('0x32')](_0x59f60a,_0x8f920,util[_0x546d('0x19')](_0x546d('0x36'),_0x8f920,_0x513bbf,_0x546d('0x37')));}else{_0x222a00=path[_0x546d('0x32')](_0x59f60a,util[_0x546d('0x19')](_0x546d('0x38'),_0x8f920,_0x546d('0x37')));}_0x4ebd4d[_0x546d('0x16')](writePDFDocument(_0x40a494,_0x222a00));}return Promise[_0x546d('0x39')](_0x4ebd4d);})['then'](function(){if(_0xec29f4){return new Promise(function(_0x4a7cc8){zipdir(path[_0x546d('0x32')](_0x59f60a,_0x8f920),{'saveTo':path[_0x546d('0x32')](_0x59f60a,util['format'](_0x546d('0x38'),_0x8f920,_0x546d('0x3a')))},function(){rimraf(path[_0x546d('0x32')](_0x59f60a,_0x8f920),function(){});_0x4a7cc8(_0x546d('0x3b'));});});}})[_0x546d('0x26')](function(){if(!_0xec29f4)return;rimraf(path['join'](_0x59f60a,_0x8f920),function(){});})[_0x546d('0x26')](function(){logger[_0x546d('0x3c')](util[_0x546d('0x19')](_0x546d('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x546d('0x3e'),_0xec29f4?util[_0x546d('0x19')](_0x546d('0x38'),_0x8f920,_0xec29f4?_0x546d('0x3a'):_0x546d('0x37')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x546d('0x3c')](util[_0x546d('0x19')](_0x546d('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x546d('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x190493){EXTRACTED_REPORT=_0x190493;return dbH[_0x546d('0x2b')][_0x546d('0x2e')](util[_0x546d('0x19')](_0x546d('0x41'),QUERY),{'type':dbH[_0x546d('0x2b')][_0x546d('0x2c')][_0x546d('0x2d')]});})[_0x546d('0x26')](extractReport)[_0x546d('0x42')](function(_0x1fd123){logger[_0x546d('0x3c')](util[_0x546d('0x19')](_0x546d('0x43'),EXTRACTED_REPORT_ID,_0x546d('0x44')),util[_0x546d('0x45')](_0x1fd123,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x546d('0x46'));})[_0x546d('0x47')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0xf1cdd4=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x546d('0x48')}});return _0xf1cdd4;}function getPDFDocDefinitionFromHTML(_0x182c6f,_0x23c3c6){var _0x9a5db5=util[_0x546d('0x19')](_0x546d('0x49'),_0x23c3c6[_0x546d('0x4a')],_0x23c3c6['interactionId']);var _0x5b5ee2=moment()[_0x546d('0x19')](_0x546d('0x4b'))['toString']();var _0x16bc24=htmlToPdfmake(_0x182c6f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x16bc24],'defaultStyle':{'font':_0x546d('0x21')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x546d('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x546d('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x546d('0x4c')}},'header':function(){return[{'text':_0x546d('0x4d'),'style':_0x546d('0x1c')}];},'footer':function(_0x4fe03e,_0x51092e){return[{'text':util[_0x546d('0x19')](_0x546d('0x4e'),_0x9a5db5,_0x4fe03e,_0x51092e,_0x5b5ee2),'style':'footer'}];}};}function writePDFDocument(_0x61c607,_0x29d4de){return new Promise(function(_0x587b54,_0x290851){var _0x4ae453=_0x61c607[_0x546d('0x4f')](fs[_0x546d('0x50')](_0x29d4de));_0x4ae453['on'](_0x546d('0x51'),function(){_0x587b54(_0x546d('0x51'));});_0x4ae453['on'](_0x546d('0x52'),function(_0x2583c8){_0x290851(_0x2583c8);});_0x61c607['end']();});}exports[_0x546d('0x53')]=function(_0x3a61e4,_0x5368b8){var _0x3c2bf5=getPDFPrinter();var _0x2faf96=getPDFDocDefinitionFromHTML(_0x3a61e4,_0x5368b8);var _0x38eae9=_0x3c2bf5['createPdfKitDocument'](_0x2faf96);return writePDFDocument(_0x38eae9,_0x5368b8['path'])['catch'](function(_0x4562a9){throw _0x4562a9;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 41467f4..c012e91 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 _0x467f=['isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.xlsx','existsSync','join','mkdirSync','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','json2xls','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length'];(function(_0x529c33,_0x45e135){var _0x5410ef=function(_0x561862){while(--_0x561862){_0x529c33['push'](_0x529c33['shift']());}};_0x5410ef(++_0x45e135);}(_0x467f,0x7a));var _0xf467=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x467f[_0x25e7cb];return _0x375d92;};'use strict';var util=require('util');var path=require(_0xf467('0x0'));var _=require(_0xf467('0x1'));var fs=require('fs');var json2xls=require(_0xf467('0x2'));var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xf467('0x3'));var db=require(_0xf467('0x4'))['db'];var dbH=require('../../mysqldb')[_0xf467('0x5')];var logger=require(_0xf467('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xf467('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x44eb7f,_0x528d1f){var _0x210a9b={'status':_0x44eb7f};var _0xba105d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x528d1f){_0x210a9b[_0xf467('0x8')]=_0x528d1f;}return db['AnalyticExtractedReport']['update'](_0x210a9b,_0xba105d);}function main(){var _0x386141=0x1388;var _0x1bc0d3;logger[_0xf467('0x9')](util[_0xf467('0xa')](_0xf467('0xb'),EXTRACTED_REPORT_ID,_0xf467('0xc')));return db[_0xf467('0xd')][_0xf467('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf467('0xf'),_0xf467('0x10')]})[_0xf467('0x11')](function(_0x44d243){if(_0x44d243){_0x1bc0d3=_0x44d243;_0x386141=_0x1bc0d3[_0xf467('0x10')]||0x1388;}})[_0xf467('0x11')](function(){return dbH[_0xf467('0x12')][_0xf467('0x13')](util[_0xf467('0xa')](_0xf467('0x14'),QUERY),{'type':dbH[_0xf467('0x12')][_0xf467('0x15')][_0xf467('0x16')]});})['then'](function(_0x2b1097){if(!_0x2b1097[0x0][_0xf467('0x17')]){return analyticExtractedReport('Empty');}var _0x312fa5=[];var _0x4ab6a6=0x0;if(_0x1bc0d3[_0xf467('0xf')]){if(_0x2b1097&&_0x2b1097[_0xf467('0x18')]){var _0x824b34=_['range'](_0x2b1097[0x0]['num']/_0x386141);var _0x8c16be=Number[_0xf467('0x19')](_0x2b1097[0x0][_0xf467('0x17')]/_0x386141)?_0x2b1097[0x0][_0xf467('0x17')]%_0x386141:0x0;_0x824b34[_0xf467('0x1a')](function(_0x1520ec){if(_0x1520ec>0x0){_0x4ab6a6+=_0x386141;}_0x312fa5['push'](dbH[_0xf467('0x12')][_0xf467('0x13')](util['format'](_0xf467('0x1b'),QUERY,_0x386141,_0x4ab6a6),{'type':dbH[_0xf467('0x12')][_0xf467('0x15')][_0xf467('0x16')]}));});if(_0x8c16be>0x0){_0x4ab6a6+=_0x386141;_0x312fa5[_0xf467('0x1c')](dbH[_0xf467('0x12')][_0xf467('0x13')](util[_0xf467('0xa')](_0xf467('0x1b'),QUERY,_0x8c16be,_0x4ab6a6),{'type':dbH[_0xf467('0x12')]['QueryTypes'][_0xf467('0x16')]}));}}}else{_0x312fa5[_0xf467('0x1c')](dbH[_0xf467('0x12')][_0xf467('0x13')](QUERY,{'type':dbH[_0xf467('0x12')]['QueryTypes'][_0xf467('0x16')]}));}var _0x43a726=path['dirname'](PATH);var _0x2d09c4=path[_0xf467('0x1d')](PATH,_0xf467('0x1e'));var _0x22fa17=_0x1bc0d3[_0xf467('0xf')]&&_0x312fa5[_0xf467('0x18')]>0x1;var _0x42388c=[];if(!fs[_0xf467('0x1f')](path[_0xf467('0x20')](_0x43a726,_0x2d09c4))&&_0x22fa17){fs[_0xf467('0x21')](path[_0xf467('0x20')](_0x43a726,_0x2d09c4));}return BPromise['each'](_0x312fa5,function(_0xfc0bc0){_0x42388c[_0xf467('0x1c')](_0xfc0bc0);})[_0xf467('0x11')](function(){for(var _0x55f801=0x0;_0x55f801<_0x42388c[_0xf467('0x18')];_0x55f801+=0x1){var _0x588435;var _0x360e2a=_0x42388c[_0x55f801];if(_0x22fa17){_0x588435=path['join'](_0x43a726,_0x2d09c4,util['format'](_0xf467('0x22'),_0x2d09c4,_0x55f801,'xlsx'));}else{_0x588435=path['join'](_0x43a726,util[_0xf467('0xa')](_0xf467('0x23'),_0x2d09c4,_0xf467('0x24')));}fs[_0xf467('0x25')](_0x588435,json2xls(_0x360e2a),_0xf467('0x26'));}})['then'](function(){if(_0x22fa17){return new Promise(function(_0x29f22a){zipdir(path[_0xf467('0x20')](_0x43a726,_0x2d09c4),{'saveTo':path[_0xf467('0x20')](_0x43a726,util['format']('%s.%s',_0x2d09c4,_0xf467('0x27')))},function(_0x240e55,_0x5905b8){rimraf(path[_0xf467('0x20')](_0x43a726,_0x2d09c4),function(){});_0x29f22a(_0xf467('0x28'));});});}})[_0xf467('0x11')](function(){logger[_0xf467('0x9')](util[_0xf467('0xa')](_0xf467('0x29'),EXTRACTED_REPORT_ID,_0xf467('0xc')));return analyticExtractedReport(_0xf467('0x2a'),_0x22fa17?util[_0xf467('0xa')](_0xf467('0x23'),_0x2d09c4,_0x22fa17?'zip':'xlsx'):null);});})[_0xf467('0x2b')](function(_0x428e17){logger[_0xf467('0x9')](util[_0xf467('0xa')](_0xf467('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xf467('0x2d')](_0x428e17,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf467('0x2e'));})[_0xf467('0x2f')](function(){process[_0xf467('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0805=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','split','splitSizeXlsx','then','sequelize','query','QueryTypes','num','range','isInteger','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','length','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','finally','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0805,0x1c9));var _0x5080=function(_0x36955d,_0x3c1166){_0x36955d=_0x36955d-0x0;var _0x46f2b6=_0x0805[_0x36955d];return _0x46f2b6;};'use strict';var util=require(_0x5080('0x0'));var path=require(_0x5080('0x1'));var _=require(_0x5080('0x2'));var fs=require('fs');var json2xls=require(_0x5080('0x3'));var BPromise=require(_0x5080('0x4'));var zipdir=require(_0x5080('0x5'));var rimraf=require(_0x5080('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5080('0x7'))[_0x5080('0x8')];var logger=require('../../config/logger')(_0x5080('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5080('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8079e3,_0x2b5ded){var _0x50d5ec={'status':_0x8079e3};var _0x4536f1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b5ded){_0x50d5ec['savename']=_0x2b5ded;}return db[_0x5080('0xb')][_0x5080('0xc')](_0x50d5ec,_0x4536f1);}function main(){var _0x521a66=0x1388;var _0x179938;logger[_0x5080('0xd')](util[_0x5080('0xe')](_0x5080('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5080('0x10'),_0x5080('0x11')]})[_0x5080('0x12')](function(_0x342414){if(_0x342414){_0x179938=_0x342414;_0x521a66=_0x179938[_0x5080('0x11')]||0x1388;}})[_0x5080('0x12')](function(){return dbH[_0x5080('0x13')][_0x5080('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5080('0x13')][_0x5080('0x15')]['SELECT']});})[_0x5080('0x12')](function(_0x5eafc9){if(!_0x5eafc9[0x0][_0x5080('0x16')]){return analyticExtractedReport('Empty');}var _0x37b87c=[];var _0x35e1c7=0x0;if(_0x179938[_0x5080('0x10')]){if(_0x5eafc9&&_0x5eafc9['length']){var _0x1fc54d=_[_0x5080('0x17')](_0x5eafc9[0x0][_0x5080('0x16')]/_0x521a66);var _0x15681d=Number[_0x5080('0x18')](_0x5eafc9[0x0][_0x5080('0x16')]/_0x521a66)?_0x5eafc9[0x0][_0x5080('0x16')]%_0x521a66:0x0;_0x1fc54d['forEach'](function(_0x37f5b5){if(_0x37f5b5>0x0){_0x35e1c7+=_0x521a66;}_0x37b87c[_0x5080('0x19')](dbH[_0x5080('0x13')][_0x5080('0x14')](util[_0x5080('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x521a66,_0x35e1c7),{'type':dbH['sequelize'][_0x5080('0x15')][_0x5080('0x1a')]}));});if(_0x15681d>0x0){_0x35e1c7+=_0x521a66;_0x37b87c[_0x5080('0x19')](dbH[_0x5080('0x13')][_0x5080('0x14')](util['format'](_0x5080('0x1b'),QUERY,_0x15681d,_0x35e1c7),{'type':dbH[_0x5080('0x13')][_0x5080('0x15')][_0x5080('0x1a')]}));}}}else{_0x37b87c[_0x5080('0x19')](dbH[_0x5080('0x13')][_0x5080('0x14')](QUERY,{'type':dbH[_0x5080('0x13')][_0x5080('0x15')]['SELECT']}));}var _0x53b000=path['dirname'](PATH);var _0x4b3dd7=path[_0x5080('0x1c')](PATH,_0x5080('0x1d'));var _0x26deac=_0x179938[_0x5080('0x10')]&&_0x37b87c[_0x5080('0x1e')]>0x1;var _0x42c820=[];if(!fs['existsSync'](path[_0x5080('0x1f')](_0x53b000,_0x4b3dd7))&&_0x26deac){fs[_0x5080('0x20')](path[_0x5080('0x1f')](_0x53b000,_0x4b3dd7));}return BPromise[_0x5080('0x21')](_0x37b87c,function(_0x12cdb1){_0x42c820['push'](_0x12cdb1);})[_0x5080('0x12')](function(){for(var _0x35ae17=0x0;_0x35ae17<_0x42c820[_0x5080('0x1e')];_0x35ae17+=0x1){var _0x415ce3;var _0x45728c=_0x42c820[_0x35ae17];if(_0x26deac){_0x415ce3=path['join'](_0x53b000,_0x4b3dd7,util[_0x5080('0xe')](_0x5080('0x22'),_0x4b3dd7,_0x35ae17,_0x5080('0x23')));}else{_0x415ce3=path[_0x5080('0x1f')](_0x53b000,util['format']('%s.%s',_0x4b3dd7,'xlsx'));}fs[_0x5080('0x24')](_0x415ce3,json2xls(_0x45728c),_0x5080('0x25'));}})[_0x5080('0x12')](function(){if(_0x26deac){return new Promise(function(_0x36bee2){zipdir(path[_0x5080('0x1f')](_0x53b000,_0x4b3dd7),{'saveTo':path[_0x5080('0x1f')](_0x53b000,util[_0x5080('0xe')]('%s.%s',_0x4b3dd7,_0x5080('0x26')))},function(_0xb8e8cf,_0x488e7f){rimraf(path['join'](_0x53b000,_0x4b3dd7),function(){});_0x36bee2(_0x5080('0x27'));});});}})[_0x5080('0x12')](function(){logger[_0x5080('0xd')](util[_0x5080('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x5080('0x28'),_0x26deac?util[_0x5080('0xe')]('%s.%s',_0x4b3dd7,_0x26deac?_0x5080('0x26'):_0x5080('0x23')):null);});})[_0x5080('0x29')](function(_0x5e885a){logger['info'](util['format'](_0x5080('0x2a'),EXTRACTED_REPORT_ID,_0x5080('0x2b')),util[_0x5080('0x2c')](_0x5e885a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5080('0x2d'));})[_0x5080('0x2e')](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 023a00c..fe0857d 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 _0x8f09=['models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','extensions','find','push','type','Set','CDR(type)=%s','priority','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','extension','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','createdAt','interval','*,*,*,*','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','sortBy','catch','rewrite','util'];(function(_0x5c9a1f,_0x192e77){var _0x227a45=function(_0x66dc81){while(--_0x66dc81){_0x5c9a1f['push'](_0x5c9a1f['shift']());}};_0x227a45(++_0x192e77);}(_0x8f09,0xce));var _0x98f0=function(_0x4185fe,_0x136aac){_0x4185fe=_0x4185fe-0x0;var _0x215887=_0x8f09[_0x4185fe];return _0x215887;};'use strict';var _=require('lodash');var util=require(_0x98f0('0x0'));function rewrite(_0x4c9696,_0x177fe9){var _0x46c961=this;return _0x4c9696[_0x98f0('0x1')][_0x98f0('0x2')][_0x98f0('0x3')]({'raw':!![]})['then'](function(_0x49569b){_0x46c961[_0x98f0('0x4')]=_0x49569b;return _0x4c9696['models'][_0x98f0('0x5')][_0x98f0('0x3')]({'where':{'IntervalId':_0x177fe9[_0x98f0('0x6')]},'raw':!![]});})[_0x98f0('0x7')](function(_0x51a4a1){return _0x4c9696[_0x98f0('0x1')]['VoiceExtension'][_0x98f0('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x98f0('0x8')](_0x51a4a1,_0x98f0('0x9')))}},'order':[{'raw':_0x98f0('0xa')}],'raw':!![]});})['then'](function(_0x11c059){var _0x2346bb=_[_0x98f0('0xb')](_0x11c059,{'priority':'1'});var _0x5037f7=_['filter'](_0x11c059,{'isApp':0x1});var _0x1b13f9=_[_0x98f0('0xc')](_0x5037f7,_0x98f0('0x9'));var _0x9b874a=[_0x98f0('0xd'),'playback'];var _0x53b9f0=[];var _0x34d72e=[];for(var _0x1b98a8 in _0x1b13f9){if(_0x1b13f9['hasOwnProperty'](_0x1b98a8)){_0x46c961['priority']=0x2;_0x46c961[_0x98f0('0xe')]=[];_0x46c961['extension']=_[_0x98f0('0xf')](_0x2346bb,{'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')]});_0x46c961['extensions'][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':util['format'](_0x98f0('0x13'),_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')]),'context':_0x1b13f9[_0x1b98a8][0x0]['context'],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});if(_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')]===_0x98f0('0x16')){_0x46c961['extensions'][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':'Set','appdata':_0x98f0('0x17')+_0x1b13f9[_0x1b98a8][0x0]['VoiceExtensionId'],'context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x46c961['priority']++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});}else if(_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')]===_0x98f0('0x19')){if(_0x46c961['extension']){_0x46c961[_0x98f0('0xe')]['push']({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x98f0('0x1a')+(_0x46c961[_0x98f0('0x1b')]['cutdigits']?_0x98f0('0x1c')+_0x46c961[_0x98f0('0x1b')]['cutdigits']+'}':_0x98f0('0x1d')),'context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'exten':_0x1b13f9[_0x1b98a8][0x0]['exten'],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});}_0x46c961['extensions']['push']({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':'CDR(routeid)='+_0x1b13f9[_0x1b98a8][0x0]['VoiceExtensionId'],'context':_0x1b13f9[_0x1b98a8][0x0]['context'],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});var _0x1c1c19=_0x46c961['priority']++;_0x46c961['extensions'][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x1e'),'appdata':_0x98f0('0x1f')+(_0x1c1c19+0x2)+'):Goto('+(_0x1c1c19+0x1)+')','context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x1c1c19,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});if(_0x46c961[_0x98f0('0x1b')]){_0x46c961['extensions']['push']({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x46c961['extension'][_0x98f0('0x20')]?_0x98f0('0x21')+_0x46c961[_0x98f0('0x1b')][_0x98f0('0x20')]+'}':_0x98f0('0x22'),'context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'exten':_0x1b13f9[_0x1b98a8][0x0]['exten'],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});}_0x46c961[_0x98f0('0xe')][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':'outboundrouteid='+_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')],'context':_0x1b13f9[_0x1b98a8][0x0]['context'],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});if(_0x46c961['extension']&&_0x46c961['extension'][_0x98f0('0x23')](_0x98f0('0x24'))&&_0x46c961[_0x98f0('0x1b')][_0x98f0('0x24')]!==_0x98f0('0x25')){_0x46c961['extensions'][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x98f0('0x26'),'context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'exten':_0x1b13f9[_0x1b98a8][0x0]['exten'],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});_0x46c961[_0x98f0('0xe')][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0]['type'],'app':'Set','appdata':_0x98f0('0x27')+_0x46c961[_0x98f0('0x1b')][_0x98f0('0x24')]||_0x98f0('0x28'),'context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x46c961['priority']++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0]['VoiceExtensionId']});}}_0x46c961[_0x98f0('0xe')][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x98f0('0x29'),'context':_0x1b13f9[_0x1b98a8][0x0]['context'],'exten':_0x1b13f9[_0x1b98a8][0x0]['exten'],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});_0x46c961[_0x98f0('0xe')][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x98f0('0x2a'),'context':_0x1b13f9[_0x1b98a8][0x0]['context'],'exten':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x9')],'priority':_0x46c961['priority']++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});_0x46c961[_0x98f0('0xe')]['push']({'type':_0x1b13f9[_0x1b98a8][0x0]['type'],'app':_0x98f0('0x12'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1b13f9[_0x1b98a8][0x0]['context'],'exten':_0x1b13f9[_0x1b98a8][0x0]['exten'],'priority':_0x46c961[_0x98f0('0x14')]++,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0]['VoiceExtensionId']});for(var _0x29c797=0x0,_0x392df0=0x0;_0x29c797<_0x1b13f9[_0x1b98a8]['length'];_0x29c797+=0x1,_0x392df0=0x0){var _0x137d5e=_0x1b13f9[_0x1b98a8][_0x29c797];if(_0x137d5e['type']){_0x137d5e[_0x98f0('0x11')]=_0x137d5e['type']['toLowerCase']();}var _0x5306d2=[];var _0xaa8a66=[];delete _0x137d5e['id'];delete _0x137d5e[_0x98f0('0x2b')];delete _0x137d5e['updatedAt'];var _0x101a1d=_0x137d5e[_0x98f0('0x2c')]!==_0x98f0('0x2d')?[_0x137d5e['interval']]:_0x137d5e[_0x98f0('0x6')]?_[_0x98f0('0x8')](_['filter'](_0x46c961['intervals'],{'IntervalId':_0x137d5e[_0x98f0('0x6')]}),'interval'):[];if(_0x137d5e['hasOwnProperty'](_0x98f0('0x2e'))){if(_0x137d5e[_0x98f0('0x2e')]&&_0x137d5e[_0x98f0('0x2e')]!=='--'){_0x5306d2[_0x98f0('0x10')]({'type':_0x137d5e['type'],'app':_0x98f0('0x12'),'appdata':'CDR(tag)='+_0x137d5e[_0x98f0('0x2e')],'context':_0x137d5e[_0x98f0('0x18')],'exten':_0x137d5e[_0x98f0('0x9')],'priority':_0x101a1d[_0x98f0('0x2f')]+_0x46c961[_0x98f0('0x14')]+_0x392df0++,'VoiceExtensionId':_0x137d5e[_0x98f0('0x15')]});}}if(_0x137d5e[_0x98f0('0x11')]===_0x98f0('0x19')&&_0x137d5e[_0x98f0('0x23')](_0x98f0('0x30'))){if(_0x137d5e[_0x98f0('0x30')]){_0x5306d2[_0x98f0('0x10')]({'type':_0x137d5e[_0x98f0('0x11')],'app':_0x98f0('0x1e'),'appdata':_0x98f0('0x31')+_0x137d5e[_0x98f0('0x30')]+')','context':_0x137d5e['context'],'exten':_0x137d5e[_0x98f0('0x9')],'priority':_0x101a1d[_0x98f0('0x2f')]+_0x46c961[_0x98f0('0x14')]+_0x392df0++,'VoiceExtensionId':_0x137d5e[_0x98f0('0x15')]});}else{_0x5306d2['push']({'type':_0x137d5e[_0x98f0('0x11')],'app':'ExecIf','appdata':_0x98f0('0x32'),'context':_0x137d5e[_0x98f0('0x18')],'exten':_0x137d5e[_0x98f0('0x9')],'priority':_0x101a1d['length']+_0x46c961[_0x98f0('0x14')]+_0x392df0++,'VoiceExtensionId':_0x137d5e[_0x98f0('0x15')]});}}if(_0x137d5e[_0x98f0('0x23')](_0x98f0('0x33'))){if(_0x9b874a[_0x98f0('0x34')](_0x137d5e[_0x98f0('0x35')][_0x98f0('0x36')]())>=0x0&&_0x137d5e[_0x98f0('0x37')]!==_0x98f0('0x38')){if(_0x137d5e[_0x98f0('0x33')]){_0x5306d2[_0x98f0('0x10')]({'type':_0x137d5e['type'],'app':_0x98f0('0x1e'),'appdata':_0x98f0('0x39'),'context':_0x137d5e['context'],'exten':_0x137d5e[_0x98f0('0x9')],'priority':_0x101a1d[_0x98f0('0x2f')]+_0x46c961[_0x98f0('0x14')]+_0x392df0++,'VoiceExtensionId':_0x137d5e[_0x98f0('0x15')]});_0x5306d2['push']({'type':_0x137d5e[_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x98f0('0x3a'),'context':_0x137d5e['context'],'exten':_0x137d5e['exten'],'priority':_0x101a1d[_0x98f0('0x2f')]+_0x46c961['priority']+_0x392df0++,'VoiceExtensionId':_0x137d5e[_0x98f0('0x15')]});}else{_0x5306d2[_0x98f0('0x10')]({'type':_0x137d5e[_0x98f0('0x11')],'app':'ExecIf','appdata':_0x98f0('0x3b'),'context':_0x137d5e['context'],'exten':_0x137d5e[_0x98f0('0x9')],'priority':_0x101a1d['length']+_0x46c961[_0x98f0('0x14')]+_0x392df0++,'VoiceExtensionId':_0x137d5e['VoiceExtensionId']});_0x5306d2[_0x98f0('0x10')]({'type':_0x137d5e[_0x98f0('0x11')],'app':_0x98f0('0x12'),'appdata':_0x98f0('0x3c'),'context':_0x137d5e[_0x98f0('0x18')],'exten':_0x137d5e[_0x98f0('0x9')],'priority':_0x101a1d['length']+_0x46c961[_0x98f0('0x14')]+_0x392df0++,'VoiceExtensionId':_0x137d5e[_0x98f0('0x15')]});}}}for(var _0x487344=0x0;_0x487344<_0x101a1d['length'];_0x487344+=0x1){var _0x3cfec4=_0x46c961[_0x98f0('0x14')]+_0x101a1d['length'];var _0x268f1a=_0x487344===_0x101a1d['length']-0x1?_0x46c961['priority']+_0x5306d2['length']+_0xaa8a66[_0x98f0('0x2f')]+0x2:_0x46c961[_0x98f0('0x14')]+_0x487344+0x1;_0x5306d2[_0x98f0('0x3d')](_0x487344,0x0,{'type':_0x137d5e['type'],'app':_0x98f0('0x3e'),'appdata':_0x101a1d[_0x487344]+'?'+_0x137d5e['context']+_0x98f0('0x3f')+_0x3cfec4+':'+_0x137d5e[_0x98f0('0x18')]+_0x98f0('0x3f')+_0x268f1a,'exten':_0x137d5e[_0x98f0('0x9')],'context':_0x137d5e[_0x98f0('0x18')],'priority':_0x46c961[_0x98f0('0x14')]+_0x487344,'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});}_0x137d5e[_0x98f0('0x14')]=_0x5306d2[_0x98f0('0x2f')]?_['last'](_0x5306d2)['priority']+0x1:_0x46c961['priority'];_0x46c961['priority']=(_0xaa8a66[_0x98f0('0x2f')]?_[_0x98f0('0x40')](_0xaa8a66)[_0x98f0('0x14')]:_0x137d5e[_0x98f0('0x14')])+0x1;_0x46c961[_0x98f0('0xe')]=_[_0x98f0('0x41')](_0x46c961[_0x98f0('0xe')],_0x5306d2,[_0x137d5e],_0xaa8a66);}_0x46c961['extensions'][_0x98f0('0x10')]({'type':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x11')],'app':'Hangup','exten':_0x1b13f9[_0x1b98a8][0x0]['exten'],'context':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x18')],'priority':_0x46c961[_0x98f0('0x14')],'VoiceExtensionId':_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]});_0x53b9f0[_0x98f0('0x10')](_0x1b13f9[_0x1b98a8][0x0][_0x98f0('0x15')]);_0x34d72e=_['concat'](_0x34d72e,_0x46c961['extensions']);}}return _0x4c9696['transaction'](function(_0x618105){return _0x4c9696[_0x98f0('0x1')][_0x98f0('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x53b9f0}},'transaction':_0x618105})[_0x98f0('0x7')](function(_0x43cce8){return _0x4c9696[_0x98f0('0x1')]['VoiceExtension']['bulkCreate'](_[_0x98f0('0x42')](_0x34d72e,_0x98f0('0x14')),{'transaction':_0x618105});});});})[_0x98f0('0x43')](function(_0x457ea9){console['error'](_0x457ea9);});}exports[_0x98f0('0x44')]=rewrite; \ No newline at end of file +var _0x0963=['Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','last','concat','bulkCreate','sortBy','error','lodash','models','Interval','findAll','intervals','VoiceExtension','then','uniq','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type'];(function(_0x644770,_0x3c2d18){var _0x155bac=function(_0xe64d0e){while(--_0xe64d0e){_0x644770['push'](_0x644770['shift']());}};_0x155bac(++_0x3c2d18);}(_0x0963,0x13f));var _0x3096=function(_0x3cc82b,_0x259747){_0x3cc82b=_0x3cc82b-0x0;var _0x4d2e83=_0x0963[_0x3cc82b];return _0x4d2e83;};'use strict';var _=require(_0x3096('0x0'));var util=require('util');function rewrite(_0x1f1334,_0x34b983){var _0x301cd5=this;return _0x1f1334[_0x3096('0x1')][_0x3096('0x2')][_0x3096('0x3')]({'raw':!![]})['then'](function(_0x4a8c40){_0x301cd5[_0x3096('0x4')]=_0x4a8c40;return _0x1f1334[_0x3096('0x1')][_0x3096('0x5')][_0x3096('0x3')]({'where':{'IntervalId':_0x34b983['IntervalId']},'raw':!![]});})[_0x3096('0x6')](function(_0x5c6e2c){return _0x1f1334['models'][_0x3096('0x5')][_0x3096('0x3')]({'where':{'exten':{'$in':_[_0x3096('0x7')](_[_0x3096('0x8')](_0x5c6e2c,_0x3096('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3096('0x6')](function(_0x44aff1){var _0x5aeccd=_[_0x3096('0xa')](_0x44aff1,{'priority':'1'});var _0x6d9e83=_['filter'](_0x44aff1,{'isApp':0x1});var _0x218d44=_[_0x3096('0xb')](_0x6d9e83,'exten');var _0x3a0bac=[_0x3096('0xc'),_0x3096('0xd')];var _0x318c6a=[];var _0x23f127=[];for(var _0x158535 in _0x218d44){if(_0x218d44[_0x3096('0xe')](_0x158535)){_0x301cd5[_0x3096('0xf')]=0x2;_0x301cd5[_0x3096('0x10')]=[];_0x301cd5[_0x3096('0x11')]=_[_0x3096('0x12')](_0x5aeccd,{'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')]});_0x301cd5['extensions'][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':util[_0x3096('0x16')](_0x3096('0x17'),_0x218d44[_0x158535][0x0][_0x3096('0x14')]),'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});if(_0x218d44[_0x158535][0x0][_0x3096('0x14')]===_0x3096('0x1a')){_0x301cd5[_0x3096('0x10')]['push']({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':_0x3096('0x1b')+_0x218d44[_0x158535][0x0][_0x3096('0x19')],'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});}else if(_0x218d44[_0x158535][0x0][_0x3096('0x14')]===_0x3096('0x1c')){if(_0x301cd5['extension']){_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':'Set','appdata':_0x3096('0x1d')+(_0x301cd5[_0x3096('0x11')]['cutdigits']?'${EXTEN:'+_0x301cd5[_0x3096('0x11')][_0x3096('0x1e')]+'}':_0x3096('0x1f')),'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0]['exten'],'priority':_0x301cd5['priority']++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});}_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':_0x3096('0x1b')+_0x218d44[_0x158535][0x0][_0x3096('0x19')],'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});var _0x56974f=_0x301cd5[_0x3096('0xf')]++;_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x20'),'appdata':_0x3096('0x21')+(_0x56974f+0x2)+'):Goto('+(_0x56974f+0x1)+')','context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x56974f,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});if(_0x301cd5[_0x3096('0x11')]){_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0]['type'],'app':_0x3096('0x15'),'appdata':_0x301cd5[_0x3096('0x11')][_0x3096('0x1e')]?_0x3096('0x22')+_0x301cd5['extension']['cutdigits']+'}':_0x3096('0x23'),'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0]['exten'],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0]['VoiceExtensionId']});}_0x301cd5['extensions'][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0]['type'],'app':_0x3096('0x15'),'appdata':_0x3096('0x24')+_0x218d44[_0x158535][0x0]['VoiceExtensionId'],'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});if(_0x301cd5[_0x3096('0x11')]&&_0x301cd5[_0x3096('0x11')]['hasOwnProperty'](_0x3096('0x25'))&&_0x301cd5[_0x3096('0x11')]['recordingFormat']!=='none'){_0x301cd5['extensions']['push']({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':_0x3096('0x26'),'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':_0x3096('0x27')+_0x301cd5[_0x3096('0x11')][_0x3096('0x25')]||'wav','context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0]['VoiceExtensionId']});}}_0x301cd5['extensions'][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':_0x3096('0x28'),'context':_0x218d44[_0x158535][0x0]['context'],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0]['VoiceExtensionId']});_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':'Set','appdata':_0x3096('0x29'),'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0]['VoiceExtensionId']});_0x301cd5['extensions'][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0]['type'],'app':'Set','appdata':_0x3096('0x2a'),'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'priority':_0x301cd5[_0x3096('0xf')]++,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});for(var _0x4892a9=0x0,_0x338fb2=0x0;_0x4892a9<_0x218d44[_0x158535][_0x3096('0x2b')];_0x4892a9+=0x1,_0x338fb2=0x0){var _0x2b6754=_0x218d44[_0x158535][_0x4892a9];if(_0x2b6754[_0x3096('0x14')]){_0x2b6754[_0x3096('0x14')]=_0x2b6754['type'][_0x3096('0x2c')]();}var _0x453c4c=[];var _0x4b0542=[];delete _0x2b6754['id'];delete _0x2b6754[_0x3096('0x2d')];delete _0x2b6754[_0x3096('0x2e')];var _0x4248e3=_0x2b6754[_0x3096('0x2f')]!==_0x3096('0x30')?[_0x2b6754[_0x3096('0x2f')]]:_0x2b6754[_0x3096('0x31')]?_[_0x3096('0x8')](_['filter'](_0x301cd5['intervals'],{'IntervalId':_0x2b6754['IntervalId']}),'interval'):[];if(_0x2b6754[_0x3096('0xe')](_0x3096('0x32'))){if(_0x2b6754[_0x3096('0x32')]&&_0x2b6754['tag']!=='--'){_0x453c4c[_0x3096('0x13')]({'type':_0x2b6754[_0x3096('0x14')],'app':'Set','appdata':_0x3096('0x33')+_0x2b6754[_0x3096('0x32')],'context':_0x2b6754[_0x3096('0x18')],'exten':_0x2b6754['exten'],'priority':_0x4248e3[_0x3096('0x2b')]+_0x301cd5['priority']+_0x338fb2++,'VoiceExtensionId':_0x2b6754[_0x3096('0x19')]});}}if(_0x2b6754[_0x3096('0x14')]==='outbound'&&_0x2b6754[_0x3096('0xe')](_0x3096('0x34'))){if(_0x2b6754[_0x3096('0x34')]){_0x453c4c['push']({'type':_0x2b6754[_0x3096('0x14')],'app':_0x3096('0x20'),'appdata':_0x3096('0x35')+_0x2b6754['callerID']+')','context':_0x2b6754[_0x3096('0x18')],'exten':_0x2b6754['exten'],'priority':_0x4248e3[_0x3096('0x2b')]+_0x301cd5[_0x3096('0xf')]+_0x338fb2++,'VoiceExtensionId':_0x2b6754[_0x3096('0x19')]});}else{_0x453c4c[_0x3096('0x13')]({'type':_0x2b6754[_0x3096('0x14')],'app':_0x3096('0x20'),'appdata':_0x3096('0x36'),'context':_0x2b6754['context'],'exten':_0x2b6754[_0x3096('0x9')],'priority':_0x4248e3['length']+_0x301cd5[_0x3096('0xf')]+_0x338fb2++,'VoiceExtensionId':_0x2b6754[_0x3096('0x19')]});}}if(_0x2b6754[_0x3096('0xe')](_0x3096('0x37'))){if(_0x3a0bac[_0x3096('0x38')](_0x2b6754[_0x3096('0x39')][_0x3096('0x2c')]())>=0x0&&_0x2b6754[_0x3096('0x3a')]!==_0x3096('0x3b')){if(_0x2b6754[_0x3096('0x37')]){_0x453c4c['push']({'type':_0x2b6754[_0x3096('0x14')],'app':_0x3096('0x20'),'appdata':_0x3096('0x3c'),'context':_0x2b6754['context'],'exten':_0x2b6754[_0x3096('0x9')],'priority':_0x4248e3[_0x3096('0x2b')]+_0x301cd5['priority']+_0x338fb2++,'VoiceExtensionId':_0x2b6754[_0x3096('0x19')]});_0x453c4c[_0x3096('0x13')]({'type':_0x2b6754[_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2b6754[_0x3096('0x18')],'exten':_0x2b6754[_0x3096('0x9')],'priority':_0x4248e3[_0x3096('0x2b')]+_0x301cd5[_0x3096('0xf')]+_0x338fb2++,'VoiceExtensionId':_0x2b6754['VoiceExtensionId']});}else{_0x453c4c[_0x3096('0x13')]({'type':_0x2b6754[_0x3096('0x14')],'app':_0x3096('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2b6754[_0x3096('0x18')],'exten':_0x2b6754['exten'],'priority':_0x4248e3[_0x3096('0x2b')]+_0x301cd5[_0x3096('0xf')]+_0x338fb2++,'VoiceExtensionId':_0x2b6754[_0x3096('0x19')]});_0x453c4c['push']({'type':_0x2b6754[_0x3096('0x14')],'app':_0x3096('0x15'),'appdata':_0x3096('0x3d'),'context':_0x2b6754['context'],'exten':_0x2b6754[_0x3096('0x9')],'priority':_0x4248e3[_0x3096('0x2b')]+_0x301cd5['priority']+_0x338fb2++,'VoiceExtensionId':_0x2b6754[_0x3096('0x19')]});}}}for(var _0x34740f=0x0;_0x34740f<_0x4248e3[_0x3096('0x2b')];_0x34740f+=0x1){var _0x1629ca=_0x301cd5[_0x3096('0xf')]+_0x4248e3['length'];var _0x517a53=_0x34740f===_0x4248e3[_0x3096('0x2b')]-0x1?_0x301cd5['priority']+_0x453c4c[_0x3096('0x2b')]+_0x4b0542[_0x3096('0x2b')]+0x2:_0x301cd5[_0x3096('0xf')]+_0x34740f+0x1;_0x453c4c[_0x3096('0x3e')](_0x34740f,0x0,{'type':_0x2b6754[_0x3096('0x14')],'app':'GotoIfTime','appdata':_0x4248e3[_0x34740f]+'?'+_0x2b6754[_0x3096('0x18')]+',${EXTEN},'+_0x1629ca+':'+_0x2b6754[_0x3096('0x18')]+',${EXTEN},'+_0x517a53,'exten':_0x2b6754[_0x3096('0x9')],'context':_0x2b6754[_0x3096('0x18')],'priority':_0x301cd5[_0x3096('0xf')]+_0x34740f,'VoiceExtensionId':_0x218d44[_0x158535][0x0][_0x3096('0x19')]});}_0x2b6754[_0x3096('0xf')]=_0x453c4c[_0x3096('0x2b')]?_['last'](_0x453c4c)['priority']+0x1:_0x301cd5[_0x3096('0xf')];_0x301cd5[_0x3096('0xf')]=(_0x4b0542[_0x3096('0x2b')]?_[_0x3096('0x3f')](_0x4b0542)[_0x3096('0xf')]:_0x2b6754['priority'])+0x1;_0x301cd5['extensions']=_['concat'](_0x301cd5[_0x3096('0x10')],_0x453c4c,[_0x2b6754],_0x4b0542);}_0x301cd5[_0x3096('0x10')][_0x3096('0x13')]({'type':_0x218d44[_0x158535][0x0][_0x3096('0x14')],'app':'Hangup','exten':_0x218d44[_0x158535][0x0][_0x3096('0x9')],'context':_0x218d44[_0x158535][0x0][_0x3096('0x18')],'priority':_0x301cd5['priority'],'VoiceExtensionId':_0x218d44[_0x158535][0x0]['VoiceExtensionId']});_0x318c6a[_0x3096('0x13')](_0x218d44[_0x158535][0x0][_0x3096('0x19')]);_0x23f127=_[_0x3096('0x40')](_0x23f127,_0x301cd5['extensions']);}}return _0x1f1334['transaction'](function(_0x577f6b){return _0x1f1334[_0x3096('0x1')][_0x3096('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x318c6a}},'transaction':_0x577f6b})[_0x3096('0x6')](function(_0x2b9b13){return _0x1f1334[_0x3096('0x1')][_0x3096('0x5')][_0x3096('0x41')](_[_0x3096('0x42')](_0x23f127,_0x3096('0xf')),{'transaction':_0x577f6b});});});})['catch'](function(_0xba3537){console[_0x3096('0x43')](_0xba3537);});}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 597ab61..81f2025 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 _0x8cc0=['isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','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!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','fromQuery','ContactId','ListId','createdAt','updatedAt','field','NOW()','scheduledAt','toString','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','from','cm_contacts','id\x20IN\x20?','calleridnum','cm_hopper_final','cm_hopper','into','deletedAt\x20IS\x20NULL','str','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','query','VoiceQueueId','sequelize','all','CmList','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','undefined','argv','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x8cc0,0xcc));var _0x08cc=function(_0x1761d7,_0x1877f8){_0x1761d7=_0x1761d7-0x0;var _0x3a73a6=_0x8cc0[_0x1761d7];return _0x3a73a6;};'use strict';var BPromise=require(_0x08cc('0x0'));var util=require(_0x08cc('0x1'));var _=require(_0x08cc('0x2'));var fs=require('fs');var squel=require(_0x08cc('0x3'));var Papa=require(_0x08cc('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x08cc('0x5'));var logger=require(_0x08cc('0x6'))('api');config[_0x08cc('0x7')]=_[_0x08cc('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x08cc('0x9'))(new Redis(config[_0x08cc('0x7')]));require(_0x08cc('0xa'))['register'](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x08cc('0xb')||process[_0x08cc('0xc')][0x2]==='null'){throw new Error(_0x08cc('0xd'));}var FILEPATH=process[_0x08cc('0xc')][0x2];if(!process[_0x08cc('0xc')][0x3]||process['argv'][0x3]==='undefined'||process[_0x08cc('0xc')][0x3]===_0x08cc('0xe')||!process['argv'][0x4]||process[_0x08cc('0xc')][0x4]==='undefined'||process['argv'][0x4]===_0x08cc('0xe')){throw new Error(_0x08cc('0xf'));}var FIELDS=_['zipObject'](process[_0x08cc('0xc')][0x3][_0x08cc('0x10')](','),process[_0x08cc('0xc')][0x4][_0x08cc('0x10')](','));if(!process[_0x08cc('0xc')][0x5]||process['argv'][0x5]===_0x08cc('0xb')||process[_0x08cc('0xc')][0x5]===_0x08cc('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x08cc('0xc')][0x5];var COMPANYID=process[_0x08cc('0xc')][0x6]&&process[_0x08cc('0xc')][0x6]!==_0x08cc('0xb')&&process[_0x08cc('0xc')][0x6]!==_0x08cc('0xe')?process[_0x08cc('0xc')][0x6]:null;var DUPLICATES=process[_0x08cc('0xc')][0x7]&&process[_0x08cc('0xc')][0x7]!=='undefined'&&process[_0x08cc('0xc')][0x7]!==_0x08cc('0xe')?process['argv'][0x7]:null;if(!process[_0x08cc('0xc')][0x8]||process['argv'][0x8]===_0x08cc('0xb')||process['argv'][0x8]==='null'){throw new Error(_0x08cc('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xec14c){logger[_0x08cc('0x12')](_0xec14c);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(_0x217720,_0x2c8b8f,_0x5e4430,_0x279154){var _0x331982={'message':_0x2c8b8f};_0x331982[_0x217720]=!![];if(_0x5e4430){_0x331982[_0x08cc('0x13')]=_0x5e4430;}if(_0x279154){_0x331982[_0x08cc('0x14')]=_0x279154;}return _0x331982;}function isEmail(_0x1df875){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))*$/[_0x08cc('0x15')](_0x1df875);}function checkRow(_0x5d1a3d,_0x334bed,_0x1162eb){return new BPromise(function(_0xaef884,_0x5d0534){if(_[_0x08cc('0x16')](_0x5d1a3d)){return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),_0x08cc('0x17'),null,_0x1162eb));}if(_0x5d1a3d[_0x08cc('0x18')]&&_0x5d1a3d[_0x08cc('0x18')][_0x08cc('0x19')]){var _0x29da66=_['map'](_0x5d1a3d['errors'],_0x08cc('0x1a'))[_0x08cc('0x1b')](';');return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),_0x29da66,null,_0x1162eb));}var _0x3220a1={};for(var _0x4081be in FIELDS){if(FIELDS[_0x08cc('0x1c')](_0x4081be)&&FIELDS[_0x4081be]){_0x3220a1[_0x4081be]=_0x5d1a3d['data'][0x0][FIELDS[_0x4081be]]||_0x5d1a3d[_0x08cc('0x1d')][0x0]['\ufeff'+FIELDS[_0x4081be]];}}if(!_0x3220a1[_0x08cc('0x1e')]){return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),_0x08cc('0x1f'),null,_0x1162eb));}if(!_0x3220a1[_0x08cc('0x20')]){return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),'phone\x20not\x20specified!',null,_0x1162eb));}if(_0x3220a1[_0x08cc('0x21')]){var _0x4c018a=moment(_0x3220a1[_0x08cc('0x21')],_0x08cc('0x22'));if(!_0x4c018a[_0x08cc('0x23')]()){return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),_0x08cc('0x24'),null,_0x1162eb));}}if(_0x3220a1[_0x08cc('0x25')]){if(!isEmail(_0x3220a1['email'])){return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),_0x08cc('0x26'),null,_0x1162eb));}}_0x3220a1['ListId']=LISTID;_0x3220a1[_0x08cc('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x334bed){var _0x1d21a6={};for(var _0x5c5716=0x0,_0x34f339=DUPLICATES[_0x08cc('0x19')];_0x5c5716<_0x34f339;_0x5c5716+=0x1){_0x1d21a6[DUPLICATES[_0x5c5716]]=_0x3220a1[DUPLICATES[_0x5c5716]];}var _0x302036=_[_0x08cc('0x28')](_0x334bed,_0x1d21a6);if(_0x302036){return _0x5d0534(handleCheckRowError(_0x08cc('0x29'),_0x08cc('0x2a'),_0x302036,_0x1162eb));}}return db[_0x08cc('0x2b')][_0x08cc('0x2c')](_0x3220a1,{'raw':!![],'hooks':![],'fields':_[_0x08cc('0x2d')](_0x3220a1)})[_0x08cc('0x2e')](function(_0x4a1e80){if(DUPLICATES&&DUPLICATES[_0x08cc('0x19')]&&_0x334bed){_0x334bed[_0x08cc('0x2f')](_[_0x08cc('0x30')](_0x3220a1,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4a1e80['id'];return _0xaef884();})[_0x08cc('0x31')](function(_0x1bfaf2){return _0x5d0534(handleCheckRowError(_0x08cc('0x12'),_0x08cc('0x32')+(_0x1bfaf2['message']||JSON[_0x08cc('0x33')](_0x1bfaf2)),null,_0x1162eb));});});}function checkHopper(){function _0x226025(){return function(_0x186116){logger['error'](_0x08cc('0x34'),_0x08cc('0x35'),util[_0x08cc('0x36')](_0x186116,{'showHidden':![],'depth':null}));};}var _0xace133=function(_0x46987c,_0x1e6f22){var _0x5f370b=squel[_0x08cc('0x37')]()['into']('cm_hopper')[_0x08cc('0x38')]([_0x08cc('0x20'),'scheduledAt',_0x08cc('0x39'),_0x08cc('0x3a'),_0x1e6f22,_0x08cc('0x3b'),_0x08cc('0x3c')],squel['select']()[_0x08cc('0x3d')](_0x08cc('0x20'),_0x08cc('0x20'))[_0x08cc('0x3d')](_0x08cc('0x3e'),_0x08cc('0x3f'))['field']('id',_0x08cc('0x39'))[_0x08cc('0x3d')](LISTID[_0x08cc('0x40')](),_0x08cc('0x3a'))[_0x08cc('0x3d')](_0x46987c['id'][_0x08cc('0x40')](),_0x1e6f22)['field'](_0x08cc('0x3e'),'createdAt')[_0x08cc('0x3d')]('NOW()',_0x08cc('0x3c'))['from']('cm_contacts')[_0x08cc('0x41')]('deletedAt\x20IS\x20NULL')['where'](_0x08cc('0x42'),LISTID['toString']())[_0x08cc('0x41')](_0x08cc('0x43'))[_0x08cc('0x41')](_0x08cc('0x44'),squel[_0x08cc('0x45')]()[_0x08cc('0x3d')](_0x08cc('0x20'))['from']('cm_hopper')[_0x08cc('0x41')](_0x1e6f22+_0x08cc('0x46'),_0x46987c['id'][_0x08cc('0x40')]())))[_0x08cc('0x40')]();return _0x5f370b;};var _0x17dfb3=function(_0xe7ce9a,_0x566d46){var _0xcc6b77=squel[_0x08cc('0x37')]()['into']('cm_hopper')['fromQuery']([_0x08cc('0x20'),'scheduledAt',_0x08cc('0x39'),_0x08cc('0x3a'),_0x566d46,_0x08cc('0x3b'),_0x08cc('0x3c')],squel[_0x08cc('0x45')]()[_0x08cc('0x3d')](_0x08cc('0x20'),_0x08cc('0x20'))[_0x08cc('0x3d')](_0x08cc('0x3e'),'scheduledAt')[_0x08cc('0x3d')]('id',_0x08cc('0x39'))[_0x08cc('0x3d')](LISTID[_0x08cc('0x40')](),_0x08cc('0x3a'))[_0x08cc('0x3d')](_0xe7ce9a['id']['toString'](),_0x566d46)[_0x08cc('0x3d')](_0x08cc('0x3e'),'createdAt')[_0x08cc('0x3d')](_0x08cc('0x3e'),'updatedAt')[_0x08cc('0x47')](_0x08cc('0x48'))[_0x08cc('0x41')]('deletedAt\x20IS\x20NULL')[_0x08cc('0x41')](_0x08cc('0x42'),LISTID[_0x08cc('0x40')]())[_0x08cc('0x41')](_0x08cc('0x49'),squel['str'](hopperContacts))[_0x08cc('0x41')](_0x08cc('0x43'))[_0x08cc('0x41')](_0x08cc('0x44'),squel[_0x08cc('0x45')]()['field'](_0x08cc('0x4a'))[_0x08cc('0x47')](_0x08cc('0x4b'))['where'](_0x566d46+'\x20=\x20?',_0xe7ce9a['id'][_0x08cc('0x40')]()))[_0x08cc('0x41')](_0x08cc('0x44'),squel[_0x08cc('0x45')]()['field'](_0x08cc('0x20'))[_0x08cc('0x47')](_0x08cc('0x4c'))[_0x08cc('0x41')](_0x566d46+_0x08cc('0x46'),_0xe7ce9a['id'][_0x08cc('0x40')]())))[_0x08cc('0x40')]();return _0xcc6b77;};function _0x5dbc0d(_0x17b5b1,_0x175b0b){var _0x37a8a6=squel[_0x08cc('0x37')]()[_0x08cc('0x4d')]('cm_hopper')[_0x08cc('0x38')]([_0x08cc('0x20'),_0x08cc('0x3f'),_0x08cc('0x39'),_0x08cc('0x3a'),_0x175b0b,_0x08cc('0x3b'),_0x08cc('0x3c')],squel[_0x08cc('0x45')]()['field'](_0x08cc('0x20'),'phone')['field'](_0x08cc('0x3e'),_0x08cc('0x3f'))[_0x08cc('0x3d')]('id','ContactId')['field'](LISTID[_0x08cc('0x40')](),'ListId')['field'](_0x17b5b1['id']['toString'](),_0x175b0b)[_0x08cc('0x3d')]('NOW()',_0x08cc('0x3b'))[_0x08cc('0x3d')](_0x08cc('0x3e'),_0x08cc('0x3c'))['from']('cm_contacts')[_0x08cc('0x41')](_0x08cc('0x4e'))[_0x08cc('0x41')](_0x08cc('0x42'),LISTID[_0x08cc('0x40')]())['where'](_0x08cc('0x49'),squel[_0x08cc('0x4f')](hopperContacts))[_0x08cc('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x08cc('0x40')]();return _0x37a8a6;}function _0xa59a4e(_0x380c52,_0x1c5c6d){var _0x59be2a=squel['insert']()[_0x08cc('0x4d')](_0x08cc('0x50'))[_0x08cc('0x38')]([_0x08cc('0x20'),'ContactId',_0x08cc('0x3a'),_0x1c5c6d,_0x08cc('0x3b'),'updatedAt'],squel[_0x08cc('0x45')]()['field'](_0x08cc('0x20'),_0x08cc('0x20'))['field']('id',_0x08cc('0x39'))['field'](LISTID[_0x08cc('0x40')](),_0x08cc('0x3a'))[_0x08cc('0x3d')](_0x380c52['id'][_0x08cc('0x40')](),_0x1c5c6d)[_0x08cc('0x3d')](_0x08cc('0x3e'),_0x08cc('0x3b'))[_0x08cc('0x3d')]('NOW()',_0x08cc('0x3c'))['from'](_0x08cc('0x48'))[_0x08cc('0x41')]('deletedAt\x20IS\x20NULL')[_0x08cc('0x41')](_0x08cc('0x42'),LISTID['toString']())[_0x08cc('0x41')](_0x08cc('0x49'),squel[_0x08cc('0x4f')](hopperContacts))[_0x08cc('0x41')](_0x08cc('0x43')))['toString']();return _0x59be2a;}return db[_0x08cc('0x51')][_0x08cc('0x52')]({'where':{'type':_0x08cc('0x53')},'attributes':['id',_0x08cc('0x54')],'include':[{'model':db['CmList'],'as':_0x08cc('0x55'),'where':{'id':LISTID}}]})[_0x08cc('0x2e')](function(_0x2688f4){var _0x573a2e=[];if(_0x2688f4){var _0x550ec1;for(var _0xd8e79b=0x0,_0x229c42;_0xd8e79b<_0x2688f4['length'];_0xd8e79b+=0x1){_0x229c42=_0x2688f4[_0xd8e79b]['get']({'plain':!![]});switch(_0x229c42[_0x08cc('0x54')]){case _0x08cc('0x56'):_0x573a2e[_0x08cc('0x2f')](db['sequelize'][_0x08cc('0x57')](_0x17dfb3(_0x229c42,_0x08cc('0x58')))[_0x08cc('0x2e')](function(){})[_0x08cc('0x31')](_0x226025()));break;case'onlyIfOpen':_0x573a2e[_0x08cc('0x2f')](db[_0x08cc('0x59')][_0x08cc('0x57')](_0xace133(_0x229c42,_0x08cc('0x58')))['then'](function(){})[_0x08cc('0x31')](_0x226025()));break;default:_0x573a2e[_0x08cc('0x2f')](db[_0x08cc('0x59')][_0x08cc('0x57')](_0x5dbc0d(_0x229c42,'VoiceQueueId'))[_0x08cc('0x2e')](function(){})[_0x08cc('0x31')](_0x226025()));}}}return _0x573a2e;})[_0x08cc('0x5a')]()[_0x08cc('0x2e')](function(){return db[_0x08cc('0x51')][_0x08cc('0x52')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x08cc('0x5b')],'as':_0x08cc('0x5c'),'where':{'id':LISTID}}]})[_0x08cc('0x2e')](function(_0xd42331){var _0x5e0c3b=[];if(_0xd42331){var _0x4cd4bc;for(var _0x3d0c20=0x0,_0x290c8a;_0x3d0c20<_0xd42331[_0x08cc('0x19')];_0x3d0c20+=0x1){_0x290c8a=_0xd42331[_0x3d0c20][_0x08cc('0x5d')]({'plain':!![]});_0x5e0c3b['push'](db[_0x08cc('0x59')][_0x08cc('0x57')](_0xa59a4e(_0x290c8a,'VoiceQueueId'))[_0x08cc('0x2e')](function(){})[_0x08cc('0x31')](_0x226025()));}}return _0x5e0c3b;})[_0x08cc('0x5a')]();})[_0x08cc('0x2e')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x08cc('0x54')],'include':[{'model':db['CmList'],'as':_0x08cc('0x55'),'where':{'id':LISTID}}]})['then'](function(_0xc26154){var _0x161911=[];if(_0xc26154){for(var _0x2c484b=0x0,_0x326a97;_0x2c484b<_0xc26154[_0x08cc('0x19')];_0x2c484b+=0x1){_0x326a97=_0xc26154[_0x2c484b][_0x08cc('0x5d')]({'plain':!![]});switch(_0x326a97['dialCheckDuplicateType']){case _0x08cc('0x56'):_0x161911[_0x08cc('0x2f')](db['sequelize']['query'](_0x17dfb3(_0x326a97,_0x08cc('0x5e')))['then'](function(){})['catch'](_0x226025()));break;case'onlyIfOpen':_0x161911[_0x08cc('0x2f')](db[_0x08cc('0x59')][_0x08cc('0x57')](_0xace133(_0x326a97,_0x08cc('0x5e')))[_0x08cc('0x2e')](function(){})[_0x08cc('0x31')](_0x226025()));break;default:_0x161911[_0x08cc('0x2f')](db[_0x08cc('0x59')][_0x08cc('0x57')](_0x5dbc0d(_0x326a97,_0x08cc('0x5e')))['then'](function(){})[_0x08cc('0x31')](_0x226025()));}}}return _0x161911;})['all']();})[_0x08cc('0x2e')](function(){return db['Campaign'][_0x08cc('0x52')]({'attributes':['id'],'include':[{'model':db[_0x08cc('0x5b')],'as':_0x08cc('0x5c'),'where':{'id':LISTID}}]})[_0x08cc('0x2e')](function(_0x196aec){var _0x2e627d=[];if(_0x196aec){for(var _0x1f809f=0x0,_0x2abe28;_0x1f809f<_0x196aec[_0x08cc('0x19')];_0x1f809f+=0x1){_0x2abe28=_0x196aec[_0x1f809f][_0x08cc('0x5d')]({'plain':!![]});_0x2e627d[_0x08cc('0x2f')](db[_0x08cc('0x59')][_0x08cc('0x57')](_0xa59a4e(_0x2abe28,_0x08cc('0x5e')))['then'](function(){})[_0x08cc('0x31')](_0x226025()));}}return _0x2e627d;})[_0x08cc('0x5a')]();})['catch'](function(_0x23fcd9){logger[_0x08cc('0x12')](_0x08cc('0x5f'),_0x08cc('0x60'),_0x23fcd9['message']);});}var processPromises=function(_0x52713e){return BPromise['all'](promises)[_0x08cc('0x2e')](function(_0x17bea5){})[_0x08cc('0x31')](function(_0x1dea31){logger[_0x08cc('0x12')](_0x08cc('0x61'),JSON[_0x08cc('0x33')](_0x1dea31));})[_0x08cc('0x62')](function(){socket[_0x08cc('0x63')](_0x08cc('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x52713e){return _0x52713e[_0x08cc('0x65')]();}});};var endCsv=function(){return BPromise[_0x08cc('0x66')]()[_0x08cc('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0x08cc('0x2e')](function(){socket[_0x08cc('0x63')](_0x08cc('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x08cc('0x67')](FILEPATH);}catch(_0x21fc08){logger['error'](_0x08cc('0x68'),JSON[_0x08cc('0x33')](_0x21fc08));}finally{process[_0x08cc('0x69')](0x0);}});};process['on']('SIGINT',function(){logger[_0x08cc('0x6a')](_0x08cc('0x6b'));endCsv();});function main(){return BPromise[_0x08cc('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x08cc('0x10')](',');return db[_0x08cc('0x2b')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x08cc('0x2e')](function(_0x1c3bfb){var _0x5d89d1=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x08cc('0x6c')](_0x5d89d1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4d56bc,_0x20daa0){total+=0x1;var _0x3da5f5=total;promises[_0x08cc('0x2f')](checkRow(_0x4d56bc,_0x1c3bfb,_0x3da5f5)[_0x08cc('0x2e')](function(){success+=0x1;})[_0x08cc('0x31')](function(_0x115521){if(_0x115521[_0x08cc('0x12')]){errors+=0x1;delete _0x115521[_0x08cc('0x12')];}else if(_0x115521[_0x08cc('0x29')]){duplicates+=0x1;delete _0x115521[_0x08cc('0x29')];}rows[_0x08cc('0x2f')](_0x115521);}));if(total%0xc8===0x0){_0x20daa0[_0x08cc('0x6d')]();return processPromises(_0x20daa0);}},'complete':function(){return processPromises()[_0x08cc('0x2e')](function(){logger[_0x08cc('0x6a')](_0x08cc('0x6e'));endCsv();});},'error':function(_0x8e4579,_0x40deb5){logger[_0x08cc('0x6a')](_0x08cc('0x6f'),JSON[_0x08cc('0x33')](_0x8e4579));endCsv();}});})[_0x08cc('0x31')](function(_0x698a95){logger['error'](_0x08cc('0x70'),JSON[_0x08cc('0x33')](_0x698a95));});}main(); \ No newline at end of file +var _0x42b8=['CmContact','create','keys','then','pick','message','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','cm_hopper_final','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','VoiceQueueId','catch','all','BlackLists','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','emit','contact:csv_','resolve','exit','SIGINT','info','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','register','argv','Missing\x20filepath\x20parameter!','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42b8,0xac));var _0x842b=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x42b8[_0x199572];return _0x13cfa3;};'use strict';var BPromise=require(_0x842b('0x0'));var util=require(_0x842b('0x1'));var _=require(_0x842b('0x2'));var fs=require('fs');var squel=require(_0x842b('0x3'));var Papa=require('papaparse');var Redis=require(_0x842b('0x4'));var db=require(_0x842b('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0x842b('0x6'))('api');config[_0x842b('0x7')]=_[_0x842b('0x8')](config[_0x842b('0x7')],{'host':_0x842b('0x9'),'port':0x18eb});var socket=require(_0x842b('0xa'))(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x842b('0xb')](socket);try{if(!process[_0x842b('0xc')][0x2]||process[_0x842b('0xc')][0x2]==='undefined'||process[_0x842b('0xc')][0x2]==='null'){throw new Error(_0x842b('0xd'));}var FILEPATH=process[_0x842b('0xc')][0x2];if(!process['argv'][0x3]||process[_0x842b('0xc')][0x3]===_0x842b('0xe')||process[_0x842b('0xc')][0x3]===_0x842b('0xf')||!process[_0x842b('0xc')][0x4]||process['argv'][0x4]===_0x842b('0xe')||process[_0x842b('0xc')][0x4]===_0x842b('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x842b('0x10')](process[_0x842b('0xc')][0x3][_0x842b('0x11')](','),process[_0x842b('0xc')][0x4][_0x842b('0x11')](','));if(!process[_0x842b('0xc')][0x5]||process[_0x842b('0xc')][0x5]===_0x842b('0xe')||process['argv'][0x5]==='null'){throw new Error(_0x842b('0x12'));}var LISTID=process[_0x842b('0xc')][0x5];var COMPANYID=process[_0x842b('0xc')][0x6]&&process[_0x842b('0xc')][0x6]!==_0x842b('0xe')&&process['argv'][0x6]!==_0x842b('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x842b('0xc')][0x7]&&process[_0x842b('0xc')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x842b('0xf')?process[_0x842b('0xc')][0x7]:null;if(!process[_0x842b('0xc')][0x8]||process['argv'][0x8]===_0x842b('0xe')||process['argv'][0x8]===_0x842b('0xf')){throw new Error(_0x842b('0x13'));}var SOCKET_TIMESTAMP=process[_0x842b('0xc')][0x8];}catch(_0x436a80){logger[_0x842b('0x14')](_0x436a80);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(_0x194359,_0x3ee4b0,_0x2a3cef,_0xfce4e2){var _0x3cfdaa={'message':_0x3ee4b0};_0x3cfdaa[_0x194359]=!![];if(_0x2a3cef){_0x3cfdaa[_0x842b('0x15')]=_0x2a3cef;}if(_0xfce4e2){_0x3cfdaa[_0x842b('0x16')]=_0xfce4e2;}return _0x3cfdaa;}function isEmail(_0x2fc6f1){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))*$/[_0x842b('0x17')](_0x2fc6f1);}function checkRow(_0xf916d6,_0x5ba62c,_0x2c3665){return new BPromise(function(_0x53bbba,_0x5b55ea){if(_[_0x842b('0x18')](_0xf916d6)){return _0x5b55ea(handleCheckRowError(_0x842b('0x14'),_0x842b('0x19'),null,_0x2c3665));}if(_0xf916d6[_0x842b('0x1a')]&&_0xf916d6[_0x842b('0x1a')][_0x842b('0x1b')]){var _0x122691=_[_0x842b('0x1c')](_0xf916d6[_0x842b('0x1a')],'message')[_0x842b('0x1d')](';');return _0x5b55ea(handleCheckRowError('error',_0x122691,null,_0x2c3665));}var _0x2d3db8={};for(var _0x4bd31 in FIELDS){if(FIELDS[_0x842b('0x1e')](_0x4bd31)&&FIELDS[_0x4bd31]){_0x2d3db8[_0x4bd31]=_0xf916d6[_0x842b('0x1f')][0x0][FIELDS[_0x4bd31]]||_0xf916d6[_0x842b('0x1f')][0x0]['\ufeff'+FIELDS[_0x4bd31]];}}if(!_0x2d3db8[_0x842b('0x20')]){return _0x5b55ea(handleCheckRowError(_0x842b('0x14'),_0x842b('0x21'),null,_0x2c3665));}if(!_0x2d3db8[_0x842b('0x22')]){return _0x5b55ea(handleCheckRowError('error',_0x842b('0x23'),null,_0x2c3665));}if(_0x2d3db8['birthDate']){var _0x435ba7=moment(_0x2d3db8[_0x842b('0x24')],'YYYY-MM-DD');if(!_0x435ba7[_0x842b('0x25')]()){return _0x5b55ea(handleCheckRowError('error',_0x842b('0x26'),null,_0x2c3665));}}if(_0x2d3db8[_0x842b('0x27')]){if(!isEmail(_0x2d3db8['email'])){return _0x5b55ea(handleCheckRowError('error',_0x842b('0x28'),null,_0x2c3665));}}_0x2d3db8[_0x842b('0x29')]=LISTID;_0x2d3db8[_0x842b('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x842b('0x1b')]&&_0x5ba62c){var _0x5095f8={};for(var _0x435ab5=0x0,_0x46517b=DUPLICATES[_0x842b('0x1b')];_0x435ab5<_0x46517b;_0x435ab5+=0x1){_0x5095f8[DUPLICATES[_0x435ab5]]=_0x2d3db8[DUPLICATES[_0x435ab5]];}var _0x36ad39=_['find'](_0x5ba62c,_0x5095f8);if(_0x36ad39){return _0x5b55ea(handleCheckRowError(_0x842b('0x2b'),'Duplicate\x20Contact',_0x36ad39,_0x2c3665));}}return db[_0x842b('0x2c')][_0x842b('0x2d')](_0x2d3db8,{'raw':!![],'hooks':![],'fields':_[_0x842b('0x2e')](_0x2d3db8)})[_0x842b('0x2f')](function(_0x2c6dd5){if(DUPLICATES&&DUPLICATES['length']&&_0x5ba62c){_0x5ba62c['push'](_[_0x842b('0x30')](_0x2d3db8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2c6dd5['id'];return _0x53bbba();})['catch'](function(_0x2a1363){return _0x5b55ea(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x2a1363[_0x842b('0x31')]||JSON[_0x842b('0x32')](_0x2a1363)),null,_0x2c3665));});});}function checkHopper(){function _0x545d9d(){return function(_0x217deb){logger[_0x842b('0x14')](_0x842b('0x33'),_0x842b('0x34'),util[_0x842b('0x35')](_0x217deb,{'showHidden':![],'depth':null}));};}var _0x1c04ba=function(_0x315b3f,_0x2ec2b4){var _0x53d709=squel[_0x842b('0x36')]()[_0x842b('0x37')](_0x842b('0x38'))[_0x842b('0x39')](['phone',_0x842b('0x3a'),_0x842b('0x3b'),_0x842b('0x29'),_0x2ec2b4,_0x842b('0x3c'),_0x842b('0x3d')],squel[_0x842b('0x3e')]()[_0x842b('0x3f')]('phone',_0x842b('0x22'))['field'](_0x842b('0x40'),_0x842b('0x3a'))[_0x842b('0x3f')]('id','ContactId')[_0x842b('0x3f')](LISTID[_0x842b('0x41')](),_0x842b('0x29'))['field'](_0x315b3f['id'][_0x842b('0x41')](),_0x2ec2b4)['field'](_0x842b('0x40'),_0x842b('0x3c'))[_0x842b('0x3f')](_0x842b('0x40'),_0x842b('0x3d'))[_0x842b('0x42')](_0x842b('0x43'))[_0x842b('0x44')](_0x842b('0x45'))[_0x842b('0x44')](_0x842b('0x46'),LISTID[_0x842b('0x41')]())[_0x842b('0x44')](_0x842b('0x47'))[_0x842b('0x44')](_0x842b('0x48'),squel[_0x842b('0x3e')]()[_0x842b('0x3f')](_0x842b('0x22'))['from'](_0x842b('0x38'))[_0x842b('0x44')](_0x2ec2b4+_0x842b('0x49'),_0x315b3f['id'][_0x842b('0x41')]())))['toString']();return _0x53d709;};var _0x227241=function(_0x324fca,_0x31439c){var _0x814037=squel['insert']()[_0x842b('0x37')](_0x842b('0x38'))[_0x842b('0x39')]([_0x842b('0x22'),_0x842b('0x3a'),_0x842b('0x3b'),_0x842b('0x29'),_0x31439c,_0x842b('0x3c'),_0x842b('0x3d')],squel[_0x842b('0x3e')]()[_0x842b('0x3f')](_0x842b('0x22'),_0x842b('0x22'))[_0x842b('0x3f')](_0x842b('0x40'),_0x842b('0x3a'))[_0x842b('0x3f')]('id',_0x842b('0x3b'))['field'](LISTID[_0x842b('0x41')](),_0x842b('0x29'))[_0x842b('0x3f')](_0x324fca['id']['toString'](),_0x31439c)['field'](_0x842b('0x40'),_0x842b('0x3c'))['field'](_0x842b('0x40'),_0x842b('0x3d'))[_0x842b('0x42')]('cm_contacts')[_0x842b('0x44')]('deletedAt\x20IS\x20NULL')[_0x842b('0x44')]('ListId\x20=\x20?',LISTID[_0x842b('0x41')]())[_0x842b('0x44')]('id\x20IN\x20?',squel[_0x842b('0x4a')](hopperContacts))[_0x842b('0x44')](_0x842b('0x47'))[_0x842b('0x44')](_0x842b('0x48'),squel[_0x842b('0x3e')]()[_0x842b('0x3f')]('calleridnum')['from'](_0x842b('0x4b'))[_0x842b('0x44')](_0x31439c+_0x842b('0x49'),_0x324fca['id'][_0x842b('0x41')]()))[_0x842b('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x842b('0x3e')]()[_0x842b('0x3f')](_0x842b('0x22'))['from'](_0x842b('0x38'))[_0x842b('0x44')](_0x31439c+_0x842b('0x49'),_0x324fca['id'][_0x842b('0x41')]())))[_0x842b('0x41')]();return _0x814037;};function _0xaa316f(_0x1593d6,_0x536c8e){var _0x19e732=squel['insert']()[_0x842b('0x37')]('cm_hopper')['fromQuery']([_0x842b('0x22'),_0x842b('0x3a'),_0x842b('0x3b'),'ListId',_0x536c8e,'createdAt',_0x842b('0x3d')],squel[_0x842b('0x3e')]()[_0x842b('0x3f')](_0x842b('0x22'),_0x842b('0x22'))[_0x842b('0x3f')]('NOW()','scheduledAt')['field']('id','ContactId')[_0x842b('0x3f')](LISTID['toString'](),_0x842b('0x29'))[_0x842b('0x3f')](_0x1593d6['id'][_0x842b('0x41')](),_0x536c8e)[_0x842b('0x3f')](_0x842b('0x40'),_0x842b('0x3c'))[_0x842b('0x3f')]('NOW()',_0x842b('0x3d'))['from']('cm_contacts')[_0x842b('0x44')]('deletedAt\x20IS\x20NULL')[_0x842b('0x44')](_0x842b('0x46'),LISTID[_0x842b('0x41')]())['where'](_0x842b('0x4c'),squel[_0x842b('0x4a')](hopperContacts))['where'](_0x842b('0x47')))[_0x842b('0x41')]();return _0x19e732;}function _0x285607(_0x2babd0,_0x37b398){var _0x5817b7=squel['insert']()[_0x842b('0x37')](_0x842b('0x4d'))[_0x842b('0x39')]([_0x842b('0x22'),_0x842b('0x3b'),'ListId',_0x37b398,_0x842b('0x3c'),_0x842b('0x3d')],squel[_0x842b('0x3e')]()['field'](_0x842b('0x22'),_0x842b('0x22'))[_0x842b('0x3f')]('id',_0x842b('0x3b'))[_0x842b('0x3f')](LISTID[_0x842b('0x41')](),_0x842b('0x29'))[_0x842b('0x3f')](_0x2babd0['id'][_0x842b('0x41')](),_0x37b398)['field'](_0x842b('0x40'),'createdAt')['field'](_0x842b('0x40'),_0x842b('0x3d'))['from'](_0x842b('0x43'))[_0x842b('0x44')](_0x842b('0x45'))[_0x842b('0x44')](_0x842b('0x46'),LISTID[_0x842b('0x41')]())[_0x842b('0x44')]('id\x20IN\x20?',squel[_0x842b('0x4a')](hopperContacts))[_0x842b('0x44')](_0x842b('0x47')))[_0x842b('0x41')]();return _0x5817b7;}return db[_0x842b('0x4e')][_0x842b('0x4f')]({'where':{'type':_0x842b('0x50')},'attributes':['id',_0x842b('0x51')],'include':[{'model':db[_0x842b('0x52')],'as':_0x842b('0x53'),'where':{'id':LISTID}}]})[_0x842b('0x2f')](function(_0x4b9a2d){var _0x3c2020=[];if(_0x4b9a2d){var _0x14a8a0;for(var _0x4efb36=0x0,_0x39b3e6;_0x4efb36<_0x4b9a2d[_0x842b('0x1b')];_0x4efb36+=0x1){_0x39b3e6=_0x4b9a2d[_0x4efb36][_0x842b('0x54')]({'plain':!![]});switch(_0x39b3e6['dialCheckDuplicateType']){case _0x842b('0x55'):_0x3c2020[_0x842b('0x56')](db[_0x842b('0x57')][_0x842b('0x58')](_0x227241(_0x39b3e6,_0x842b('0x59')))['then'](function(){})[_0x842b('0x5a')](_0x545d9d()));break;case'onlyIfOpen':_0x3c2020[_0x842b('0x56')](db[_0x842b('0x57')][_0x842b('0x58')](_0x1c04ba(_0x39b3e6,_0x842b('0x59')))[_0x842b('0x2f')](function(){})['catch'](_0x545d9d()));break;default:_0x3c2020[_0x842b('0x56')](db[_0x842b('0x57')][_0x842b('0x58')](_0xaa316f(_0x39b3e6,_0x842b('0x59')))[_0x842b('0x2f')](function(){})[_0x842b('0x5a')](_0x545d9d()));}}}return _0x3c2020;})[_0x842b('0x5b')]()[_0x842b('0x2f')](function(){return db[_0x842b('0x4e')][_0x842b('0x4f')]({'where':{'type':_0x842b('0x50')},'attributes':['id'],'include':[{'model':db[_0x842b('0x52')],'as':_0x842b('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x45bf03){var _0x216d73=[];if(_0x45bf03){var _0x53b276;for(var _0x1c705d=0x0,_0xc48501;_0x1c705d<_0x45bf03[_0x842b('0x1b')];_0x1c705d+=0x1){_0xc48501=_0x45bf03[_0x1c705d][_0x842b('0x54')]({'plain':!![]});_0x216d73['push'](db[_0x842b('0x57')]['query'](_0x285607(_0xc48501,'VoiceQueueId'))[_0x842b('0x2f')](function(){})[_0x842b('0x5a')](_0x545d9d()));}}return _0x216d73;})['all']();})[_0x842b('0x2f')](function(){return db[_0x842b('0x5d')][_0x842b('0x4f')]({'attributes':['id',_0x842b('0x51')],'include':[{'model':db[_0x842b('0x52')],'as':_0x842b('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x25f37a){var _0x2befcc=[];if(_0x25f37a){for(var _0x13a886=0x0,_0x4a6b4b;_0x13a886<_0x25f37a[_0x842b('0x1b')];_0x13a886+=0x1){_0x4a6b4b=_0x25f37a[_0x13a886]['get']({'plain':!![]});switch(_0x4a6b4b[_0x842b('0x51')]){case _0x842b('0x55'):_0x2befcc[_0x842b('0x56')](db[_0x842b('0x57')][_0x842b('0x58')](_0x227241(_0x4a6b4b,_0x842b('0x5e')))[_0x842b('0x2f')](function(){})['catch'](_0x545d9d()));break;case _0x842b('0x5f'):_0x2befcc[_0x842b('0x56')](db[_0x842b('0x57')][_0x842b('0x58')](_0x1c04ba(_0x4a6b4b,'CampaignId'))['then'](function(){})[_0x842b('0x5a')](_0x545d9d()));break;default:_0x2befcc[_0x842b('0x56')](db[_0x842b('0x57')]['query'](_0xaa316f(_0x4a6b4b,'CampaignId'))[_0x842b('0x2f')](function(){})[_0x842b('0x5a')](_0x545d9d()));}}}return _0x2befcc;})['all']();})['then'](function(){return db[_0x842b('0x5d')][_0x842b('0x4f')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x842b('0x2f')](function(_0x44d8fe){var _0x34c8ff=[];if(_0x44d8fe){for(var _0x2a8676=0x0,_0x10ddd8;_0x2a8676<_0x44d8fe['length'];_0x2a8676+=0x1){_0x10ddd8=_0x44d8fe[_0x2a8676][_0x842b('0x54')]({'plain':!![]});_0x34c8ff[_0x842b('0x56')](db[_0x842b('0x57')][_0x842b('0x58')](_0x285607(_0x10ddd8,_0x842b('0x5e')))[_0x842b('0x2f')](function(){})[_0x842b('0x5a')](_0x545d9d()));}}return _0x34c8ff;})['all']();})[_0x842b('0x5a')](function(_0x2da486){logger[_0x842b('0x14')](_0x842b('0x60'),_0x842b('0x61'),_0x2da486[_0x842b('0x31')]);});}var processPromises=function(_0xeb55f5){return BPromise['all'](promises)[_0x842b('0x2f')](function(_0x3f47da){})[_0x842b('0x5a')](function(_0x3854ad){logger[_0x842b('0x14')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x3854ad));})['finally'](function(){socket[_0x842b('0x62')](_0x842b('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xeb55f5){return _0xeb55f5['resume']();}});};var endCsv=function(){return BPromise[_0x842b('0x64')]()[_0x842b('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x842b('0x62')](_0x842b('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x6e212b){logger[_0x842b('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x6e212b));}finally{process[_0x842b('0x65')](0x0);}});};process['on'](_0x842b('0x66'),function(){logger[_0x842b('0x67')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x842b('0x11')](',');return db[_0x842b('0x2c')][_0x842b('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x842b('0x2f')](function(_0x220db0){var _0x40db61=fs[_0x842b('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x40db61,{'header':!![],'skipEmptyLines':!![],'step':function(_0x180e76,_0x5af6fb){total+=0x1;var _0x4b6f00=total;promises[_0x842b('0x56')](checkRow(_0x180e76,_0x220db0,_0x4b6f00)[_0x842b('0x2f')](function(){success+=0x1;})[_0x842b('0x5a')](function(_0x583865){if(_0x583865['error']){errors+=0x1;delete _0x583865[_0x842b('0x14')];}else if(_0x583865['duplicate']){duplicates+=0x1;delete _0x583865[_0x842b('0x2b')];}rows['push'](_0x583865);}));if(total%0xc8===0x0){_0x5af6fb['pause']();return processPromises(_0x5af6fb);}},'complete':function(){return processPromises()['then'](function(){logger[_0x842b('0x67')](_0x842b('0x69'));endCsv();});},'error':function(_0x43369e,_0x4fe7af){logger[_0x842b('0x67')](_0x842b('0x6a'),JSON[_0x842b('0x32')](_0x43369e));endCsv();}});})[_0x842b('0x5a')](function(_0x5b77ea){logger[_0x842b('0x14')](_0x842b('0x6b'),JSON[_0x842b('0x32')](_0x5b77ea));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5f4ffd8..0c69c0a 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 _0x4f2f=['cm_contacts.priority','cm_contacts.UserId','insert','fromQuery','scheduledat','createdAt','updatedAt','priority','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','into','cm_hopper_black','ContactId','ListId','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','spread','push','main','stringify','send','start','socket_timestamp','server/files/tmp','.csv','keys','header','writeFileSync','parse','createReadStream','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','length','SystemRow','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','unlink','catch','complete','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','binding','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','localhost','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x4f2f,0xf5));var _0xf4f2=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x4f2f[_0x13b8f3];return _0x1a6d06;};'use strict';var fs=require('fs');var path=require(_0xf4f2('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xf4f2('0x1'));var BPromise=require(_0xf4f2('0x2'));var moment=require(_0xf4f2('0x3'));var squel=require(_0xf4f2('0x4'));var Redis=require(_0xf4f2('0x5'));var db=require(_0xf4f2('0x6'))['db'];var config=require(_0xf4f2('0x7'));var logger=require(_0xf4f2('0x8'))(_0xf4f2('0x9'));config['redis']=_['defaults'](config['redis'],{'host':_0xf4f2('0xa'),'port':0x18eb});var socket=require(_0xf4f2('0xb'))(new Redis(config[_0xf4f2('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xf4f2('0xd')](_0xf4f2('0xe'));function isEmail(_0x1c75ad){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'](_0x1c75ad);}function selectNotIn(_0x1183e2,_0x3d2870,_0x551f14,_0x1693f2,_0x4c2c0b){return squel[_0xf4f2('0xf')]()[_0xf4f2('0x10')](_0xf4f2('0x11'))[_0xf4f2('0x12')](_0x1693f2)[_0xf4f2('0x13')](_0x3d2870,null,_0x3d2870+_0xf4f2('0x14')+_0x1693f2+'.'+_0x551f14)[_0xf4f2('0x15')](_0x1693f2+'.'+_0x551f14+_0xf4f2('0x16')+_0x1183e2+'.'+_0x551f14)['where'](_0x3d2870+_0xf4f2('0x17')+_0x4c2c0b['join']()+')');}function insertCmHopper(_0x16009e,_0x37f0a4,_0x5c6b26,_0x3de846,_0x47e841){var _0x303505=[_0xf4f2('0x18'),_0xf4f2('0x19'),'cm_contacts.id',_0xf4f2('0x1a'),_0x37f0a4+'.'+_0x3de846,_0xf4f2('0x1b'),_0xf4f2('0x1c'),_0xf4f2('0x1d'),_0xf4f2('0x1e'),'\x22'+_0x47e841+'\x22'];return squel[_0xf4f2('0x1f')]()['into']('cm_hopper')[_0xf4f2('0x20')]([_0xf4f2('0x11'),_0xf4f2('0x21'),'ContactId','ListId',_0x3de846,_0xf4f2('0x22'),_0xf4f2('0x23'),_0xf4f2('0x24'),'UserId','recallme'],squel[_0xf4f2('0xf')]()[_0xf4f2('0x25')](_0x303505)['from'](_0x37f0a4)['join'](_0xf4f2('0x26'),null,_0xf4f2('0x27')+_0x37f0a4+_0xf4f2('0x28'))['join'](_0x5c6b26,null,_0x5c6b26+_0xf4f2('0x14')+_0x37f0a4+'.'+_0x3de846)[_0xf4f2('0x15')](_0x37f0a4+'.CmListId\x20=\x20?',_0x16009e)[_0xf4f2('0x15')](_0xf4f2('0x29'),NOW)[_0xf4f2('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x37f0a4,_0x5c6b26,_0x3de846,_0xf4f2('0x2a'),['\x22always\x22',_0xf4f2('0x2b')]))[_0xf4f2('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x37f0a4,_0x5c6b26,_0x3de846,_0xf4f2('0x2a'),[_0xf4f2('0x2c')])))[_0xf4f2('0x2d')]();}function insertCmHopperBlack(_0x4e1c6a,_0x5693c8,_0x4ebe34,_0x210d37){var _0x473fa3=['cm_contacts.phone',_0xf4f2('0x2e'),_0xf4f2('0x1a'),_0x5693c8+'.'+_0x210d37,_0xf4f2('0x1b'),_0xf4f2('0x1c')];return squel[_0xf4f2('0x1f')]()[_0xf4f2('0x2f')](_0xf4f2('0x30'))[_0xf4f2('0x20')]([_0xf4f2('0x11'),_0xf4f2('0x31'),_0xf4f2('0x32'),_0x210d37,'createdAt',_0xf4f2('0x23')],squel[_0xf4f2('0xf')]()[_0xf4f2('0x25')](_0x473fa3)[_0xf4f2('0x12')](_0x5693c8)[_0xf4f2('0x13')]('cm_contacts',null,_0xf4f2('0x27')+_0x5693c8+_0xf4f2('0x28'))['join'](_0x4ebe34,null,_0x4ebe34+_0xf4f2('0x14')+_0x5693c8+'.'+_0x210d37)[_0xf4f2('0x15')](_0x5693c8+'.CmListId\x20=\x20?',_0x4e1c6a)[_0xf4f2('0x15')](_0xf4f2('0x29'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf4f2('0xf')]()['field']('phone')[_0xf4f2('0x12')]('cm_hopper_black')[_0xf4f2('0x15')](_0xf4f2('0x33'),_0x4e1c6a)[_0xf4f2('0x15')](_0x210d37+_0xf4f2('0x34'),_0x5693c8+'.'+_0x210d37)))['toString']();}function insertCmContact(_0x3007a0,_0xd4ab82,_0x28d43f,_0x324ced){var _0x27525c=_[_0xf4f2('0x35')](_['keys'](_0x324ced),[_0xf4f2('0x32'),_0xf4f2('0x36'),_0xf4f2('0x22'),_0xf4f2('0x23')]);return squel[_0xf4f2('0x1f')]()[_0xf4f2('0x2f')](_0xf4f2('0x26'))[_0xf4f2('0x20')](_0x27525c,squel[_0xf4f2('0xf')]()[_0xf4f2('0x25')](_0x27525c)['from'](_0xd4ab82)[_0xf4f2('0x15')]('('+_0x28d43f[_0xf4f2('0x13')](',')+_0xf4f2('0x37'),squel[_0xf4f2('0xf')]()['fields'](_0x28d43f)[_0xf4f2('0x12')](_0xf4f2('0x26'))['where'](_0xf4f2('0x33'),_0x3007a0)['where'](_0xf4f2('0x38')))[_0xf4f2('0x15')](_0xf4f2('0x39'),squel[_0xf4f2('0xf')]()[_0xf4f2('0x10')](_0xf4f2('0x3a'),_0xf4f2('0x3b'))[_0xf4f2('0x12')](_0xd4ab82)[_0xf4f2('0x3c')](_0x28d43f[_0xf4f2('0x13')](','))))[_0xf4f2('0x2d')]();}function handleStop(){logger[_0xf4f2('0x3d')](_0xf4f2('0x3e'));stopped=!![];}function handleUncaughtException(_0x2672b0){logger[_0xf4f2('0x3f')](_0x2672b0['message']);process[_0xf4f2('0x40')](0x1);}function handleError(_0x284afe,_0x1e02ed){stats[_0xf4f2('0x41')]['push']({'name':_0x1e02ed[_0xf4f2('0x42')],'message':_0x1e02ed[_0xf4f2('0x43')],'row':_0x284afe});}function handleQuery(_0x52d455){logger[_0xf4f2('0x3d')](_0x52d455);return db[_0xf4f2('0x44')]['query'](_0x52d455)[_0xf4f2('0x45')](function(_0x4d9df2){results[_0xf4f2('0x46')](_0x4d9df2);})['catch'](function(_0x1f9432){logger['error'](_0x1f9432['message']);});}function main(_0x2b41d6,_0x21735a,_0x1c8304,_0x359129){logger[_0xf4f2('0x3d')](_0xf4f2('0x47'),_0x2b41d6,JSON[_0xf4f2('0x48')](_0x21735a));process[_0xf4f2('0x49')](_0xf4f2('0x4a'));var _0x52e4f9=_0x21735a['binding'];var _0x3e5a67=_0x21735a[_0xf4f2('0x4b')];var _0x350327=path[_0xf4f2('0x13')](config['root'],_0xf4f2('0x4c'),_0x3e5a67+_0xf4f2('0x4d'));var _0x44c149=_[_0xf4f2('0x4e')](_0x52e4f9)[_0xf4f2('0x13')]();logger[_0xf4f2('0x3d')](_0xf4f2('0x4f'),_0x44c149);fs[_0xf4f2('0x50')](_0x350327,_0x44c149+'\x0a');Papa[_0xf4f2('0x51')](fs[_0xf4f2('0x52')](_0x2b41d6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2c8a2a,_0x34f5d5){try{for(var _0x13ca7a=0x0,_0xdf07ab=[];_0x13ca7a<_0x2c8a2a[_0xf4f2('0x53')]['length'];_0x13ca7a++){stats['rows']+=0x1;if(_0x2c8a2a[_0xf4f2('0x41')][_0x13ca7a]){handleError(_0x2c8a2a['data'][_0x13ca7a],_0x2c8a2a[_0xf4f2('0x41')][_0x13ca7a]);}else{var _0xe66915=[];for(var _0x34ab5b in _0x52e4f9){if(_0x52e4f9['hasOwnProperty'](_0x34ab5b)){if(_0x2c8a2a['data'][_0x13ca7a][_0x52e4f9[_0x34ab5b]]){var _0x537553=_[_0xf4f2('0x54')](_0x2c8a2a['data'][_0x13ca7a][_0x52e4f9[_0x34ab5b]][_0xf4f2('0x55')](/"/g,'\x27'));switch(_0x34ab5b){case _0xf4f2('0x21'):var _0x327174=moment(_0x537553,_0xf4f2('0xe'),!![]);if(_0x327174[_0xf4f2('0x56')]()){_0xdf07ab[_0xf4f2('0x46')]('\x22'+_0x537553+'\x22');}else{_0xe66915[_0xf4f2('0x46')](_0xf4f2('0x57'));}break;case _0xf4f2('0x24'):var _0x117484=parseInt(_0x537553);_0x537553=_[_0xf4f2('0x58')](_0x117484)||_0x117484<0x0||_0x117484>0x4?_0x359129?0x3:0x2:_0x117484;_0xdf07ab[_0xf4f2('0x46')]('\x22'+_0x537553+'\x22');break;case _0xf4f2('0x59'):var _0x39cc23=parseInt(_0x537553);if(_['isNumber'](_0x39cc23)&&_[_0xf4f2('0x5a')](_0x1c8304,_0x39cc23)){_0xdf07ab['push']('\x22'+_0x39cc23+'\x22');}else{_0xe66915[_0xf4f2('0x46')](_0xf4f2('0x5b'));}break;case _0xf4f2('0x5c'):if(isEmail(_0x537553)){_0xdf07ab[_0xf4f2('0x46')]('\x22'+_0x537553+'\x22');}else{_0xe66915[_0xf4f2('0x46')](_0xf4f2('0x5d'));}break;case _0xf4f2('0x5e'):var _0x4eaf32=moment(_0x537553,'YYYY-MM-DD',!![]);if(_0x4eaf32[_0xf4f2('0x56')]()){_0xdf07ab['push']('\x22'+_0x537553+'\x22');}else{_0xe66915[_0xf4f2('0x46')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xdf07ab['push']('\x22'+_0x537553+'\x22');}}else{switch(_0x34ab5b){case _0xf4f2('0x5f'):case _0xf4f2('0x11'):_0xe66915[_0xf4f2('0x46')](_0x34ab5b+'\x20not\x20specified');break;default:_0xdf07ab[_0xf4f2('0x46')]('\x22\x22');}}}}if(_0xe66915[_0xf4f2('0x60')]){handleError(_0x2c8a2a[_0xf4f2('0x53')][_0x13ca7a],{'code':_0xf4f2('0x61'),'message':_0xe66915['join']()});}else{fs['appendFileSync'](_0x350327,_0xdf07ab[_0xf4f2('0x13')]()+'\x0a');}_0xdf07ab=[];}if(!(stats[_0xf4f2('0x62')]%0xc8)){socket[_0xf4f2('0x63')](_0xf4f2('0x64')+_0x3e5a67,stats);stats[_0xf4f2('0x41')]=[];}}if(stopped){logger['info'](_0xf4f2('0x65'));_0x34f5d5[_0xf4f2('0x66')]();}}catch(_0x469a2b){handleError(_0x2c8a2a['data'][_0x13ca7a],{'code':'SystemError','message':_0x469a2b[_0xf4f2('0x43')]});logger[_0xf4f2('0x3f')](_0xf4f2('0x67'),_0x469a2b[_0xf4f2('0x43')]);}},'complete':function(){try{var _0x290f39=[];var _0x1385e3=_0xf4f2('0x26');if(_0x21735a[_0xf4f2('0x68')]&&_0x21735a['duplicates']['length']){_0x1385e3=_0xf4f2('0x69')+_0x3e5a67;_0x290f39['push'](_0xf4f2('0x6a')+_0x1385e3+'\x20LIKE\x20cm_contacts;');}var _0x823388=util[_0xf4f2('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',_0x350327,_0x1385e3,_0x44c149,_0x21735a[_0xf4f2('0x32')],_0x21735a[_0xf4f2('0x36')]||null,NOW,NOW);if(_[_0xf4f2('0x6b')](_0x52e4f9['scheduledat'])){_0x823388+=',\x20scheduledAt\x20=\x20NOW()';}_0x290f39[_0xf4f2('0x46')](_0x823388);if(_0x21735a['duplicates']&&_0x21735a[_0xf4f2('0x68')][_0xf4f2('0x60')]){_0x290f39[_0xf4f2('0x46')](insertCmContact(_0x21735a[_0xf4f2('0x32')],_0x1385e3,_0x21735a[_0xf4f2('0x68')],_0x52e4f9));_0x290f39['push'](_0xf4f2('0x6c')+_0x1385e3+';');}_0x290f39[_0xf4f2('0x46')](insertCmHopper(_0x21735a[_0xf4f2('0x32')],_0xf4f2('0x6d'),_0xf4f2('0x6e'),_0xf4f2('0x6f'),_0x359129));_0x290f39[_0xf4f2('0x46')](insertCmHopperBlack(_0x21735a[_0xf4f2('0x32')],_0xf4f2('0x70'),_0xf4f2('0x6e'),'VoiceQueueId'));_0x290f39[_0xf4f2('0x46')](insertCmHopper(_0x21735a[_0xf4f2('0x32')],_0xf4f2('0x71'),_0xf4f2('0x72'),_0xf4f2('0x73'),_0x359129));_0x290f39['push'](insertCmHopperBlack(_0x21735a[_0xf4f2('0x32')],_0xf4f2('0x74'),_0xf4f2('0x72'),_0xf4f2('0x73')));BPromise[_0xf4f2('0x75')](_0x290f39,handleQuery)[_0xf4f2('0x76')](function(_0x19cbc0){stats['finish']=!![];stats[_0xf4f2('0x77')]=_0x21735a[_0xf4f2('0x68')]&&_0x21735a[_0xf4f2('0x68')]['length']?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket['emit']('contact:import:'+_0x3e5a67,stats);fs['unlink'](_0x2b41d6);fs[_0xf4f2('0x78')](_0x350327);process[_0xf4f2('0x40')](0x0);})[_0xf4f2('0x79')](function(_0x1c6e2f){logger['error'](_0x1c6e2f[_0xf4f2('0x43')]);process[_0xf4f2('0x40')](0x1);});}catch(_0x1ad027){logger[_0xf4f2('0x3f')](_0xf4f2('0x7a'),_0x1ad027[_0xf4f2('0x43')]);process['exit'](0x1);}},'error':function(_0x269023,_0x13f2a5,_0x381224,_0x184597){throw new Error(_0x184597);}});}function validate(){if(process[_0xf4f2('0x7b')]&&process[_0xf4f2('0x7b')][_0xf4f2('0x60')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x3902bd=path[_0xf4f2('0x13')](config[_0xf4f2('0x7c')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0xf4f2('0x7d')](_0x3902bd)){throw new Error(_0xf4f2('0x7e'));}var _0x35fdcc={};try{_0x35fdcc=JSON[_0xf4f2('0x51')](process[_0xf4f2('0x7b')][0x3]);if(!_0x35fdcc['binding']){throw new Error(_0xf4f2('0x7f'));}if(!_0x35fdcc['binding'][_0xf4f2('0x11')]){throw new Error(_0xf4f2('0x80'));}if(!_0x35fdcc[_0xf4f2('0x81')][_0xf4f2('0x5f')]){throw new Error(_0xf4f2('0x82'));}var _0x5523d7=0x0;if(_0x35fdcc[_0xf4f2('0x81')][_0xf4f2('0x59')]){_0x5523d7=0x1;}if(!_0x35fdcc[_0xf4f2('0x32')]){throw new Error(_0xf4f2('0x83'));}}catch(_0x594528){throw new Error(_0xf4f2('0x84'));}var _0xed0550=[];try{_0xed0550=_[_0xf4f2('0x85')](JSON['parse'](process[_0xf4f2('0x7b')][0x4]),'id');}catch(_0x4affbf){logger[_0xf4f2('0x3d')](_0xf4f2('0x86'));}main(_0x3902bd,_0x35fdcc,_0xed0550,_0x5523d7);}validate();process['on'](_0xf4f2('0x87'),handleStop);process['on'](_0xf4f2('0x88'),handleUncaughtException); \ No newline at end of file +var _0x9604=['../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','join','where','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper_black','ListId','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','error','message','errors','push','code','info','sequelize','query','spread','start','binding','socket_timestamp','.csv','header','writeFileSync','parse','createReadStream','data','length','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','YYYY-MM-DD','isValid','firstName','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_blacklists','campaigns','CampaignId','each','finish','affectedRows','unlink','exit','catch','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','papaparse','util','bluebird','ioredis'];(function(_0x4b58b7,_0x52c7b3){var _0x361f06=function(_0x246397){while(--_0x246397){_0x4b58b7['push'](_0x4b58b7['shift']());}};_0x361f06(++_0x52c7b3);}(_0x9604,0x7d));var _0x4960=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9604[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x4960('0x0'));var _=require('lodash');var Papa=require(_0x4960('0x1'));var util=require(_0x4960('0x2'));var BPromise=require(_0x4960('0x3'));var moment=require('moment');var squel=require('squel');var Redis=require(_0x4960('0x4'));var db=require(_0x4960('0x5'))['db'];var config=require(_0x4960('0x6'));var logger=require(_0x4960('0x7'))(_0x4960('0x8'));config[_0x4960('0x9')]=_['defaults'](config[_0x4960('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4960('0xa'))(new Redis(config[_0x4960('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x4960('0xb')](_0x4960('0xc'));function isEmail(_0x2b5295){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))*$/[_0x4960('0xd')](_0x2b5295);}function selectNotIn(_0x4c3d74,_0x27bf62,_0x50a1cb,_0x29216e,_0x2b53ce){return squel[_0x4960('0xe')]()[_0x4960('0xf')](_0x4960('0x10'))[_0x4960('0x11')](_0x29216e)['join'](_0x27bf62,null,_0x27bf62+_0x4960('0x12')+_0x29216e+'.'+_0x50a1cb)['where'](_0x29216e+'.'+_0x50a1cb+_0x4960('0x13')+_0x4c3d74+'.'+_0x50a1cb)['where'](_0x27bf62+'.dialCheckDuplicateType\x20IN\x20('+_0x2b53ce['join']()+')');}function insertCmHopper(_0x541bbf,_0x2899d2,_0x4fb201,_0x1b4be0,_0x5af3bb){var _0x2b6de4=[_0x4960('0x14'),_0x4960('0x15'),'cm_contacts.id',_0x4960('0x16'),_0x2899d2+'.'+_0x1b4be0,'cm_contacts.createdAt',_0x4960('0x17'),_0x4960('0x18'),_0x4960('0x19'),'\x22'+_0x5af3bb+'\x22'];return squel[_0x4960('0x1a')]()['into'](_0x4960('0x1b'))[_0x4960('0x1c')]([_0x4960('0x10'),_0x4960('0x1d'),_0x4960('0x1e'),'ListId',_0x1b4be0,_0x4960('0x1f'),_0x4960('0x20'),_0x4960('0x21'),_0x4960('0x22'),_0x4960('0x23')],squel['select']()[_0x4960('0x24')](_0x2b6de4)[_0x4960('0x11')](_0x2899d2)['join'](_0x4960('0x25'),null,_0x4960('0x26')+_0x2899d2+'.CmListId')[_0x4960('0x27')](_0x4fb201,null,_0x4fb201+_0x4960('0x12')+_0x2899d2+'.'+_0x1b4be0)[_0x4960('0x28')](_0x2899d2+_0x4960('0x29'),_0x541bbf)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x4960('0x28')](_0x4960('0x2a'),selectNotIn(_0x2899d2,_0x4fb201,_0x1b4be0,_0x4960('0x1b'),[_0x4960('0x2b'),_0x4960('0x2c')]))[_0x4960('0x28')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2899d2,_0x4fb201,_0x1b4be0,_0x4960('0x1b'),[_0x4960('0x2b')])))[_0x4960('0x2d')]();}function insertCmHopperBlack(_0x50f376,_0x38c937,_0x4c4610,_0x13b6c0){var _0x48956e=[_0x4960('0x14'),_0x4960('0x2e'),_0x4960('0x16'),_0x38c937+'.'+_0x13b6c0,_0x4960('0x2f'),'cm_contacts.updatedAt'];return squel[_0x4960('0x1a')]()[_0x4960('0x30')](_0x4960('0x31'))[_0x4960('0x1c')]([_0x4960('0x10'),_0x4960('0x1e'),_0x4960('0x32'),_0x13b6c0,'createdAt',_0x4960('0x20')],squel[_0x4960('0xe')]()[_0x4960('0x24')](_0x48956e)[_0x4960('0x11')](_0x38c937)['join']('cm_contacts',null,_0x4960('0x26')+_0x38c937+'.CmListId')[_0x4960('0x27')](_0x4c4610,null,_0x4c4610+_0x4960('0x12')+_0x38c937+'.'+_0x13b6c0)[_0x4960('0x28')](_0x38c937+_0x4960('0x29'),_0x50f376)[_0x4960('0x28')](_0x4960('0x33'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x4960('0xe')]()[_0x4960('0xf')]('phone')[_0x4960('0x11')](_0x4960('0x31'))['where'](_0x4960('0x34'),_0x50f376)['where'](_0x13b6c0+'\x20=\x20?',_0x38c937+'.'+_0x13b6c0)))['toString']();}function insertCmContact(_0x45b880,_0x2b8fa8,_0x1b258b,_0x4f9b4c){var _0x327f9d=_['concat'](_[_0x4960('0x35')](_0x4f9b4c),[_0x4960('0x32'),_0x4960('0x36'),_0x4960('0x1f'),_0x4960('0x20')]);return squel['insert']()[_0x4960('0x30')](_0x4960('0x25'))[_0x4960('0x1c')](_0x327f9d,squel['select']()[_0x4960('0x24')](_0x327f9d)['from'](_0x2b8fa8)[_0x4960('0x28')]('('+_0x1b258b[_0x4960('0x27')](',')+_0x4960('0x37'),squel[_0x4960('0xe')]()[_0x4960('0x24')](_0x1b258b)['from'](_0x4960('0x25'))[_0x4960('0x28')](_0x4960('0x34'),_0x45b880)[_0x4960('0x28')](_0x4960('0x38')))[_0x4960('0x28')](_0x4960('0x39'),squel[_0x4960('0xe')]()[_0x4960('0xf')](_0x4960('0x3a'),_0x4960('0x3b'))[_0x4960('0x11')](_0x2b8fa8)[_0x4960('0x3c')](_0x1b258b['join'](','))))[_0x4960('0x2d')]();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x4dc187){logger[_0x4960('0x3d')](_0x4dc187[_0x4960('0x3e')]);process['exit'](0x1);}function handleError(_0x29e568,_0x27d093){stats[_0x4960('0x3f')][_0x4960('0x40')]({'name':_0x27d093[_0x4960('0x41')],'message':_0x27d093['message'],'row':_0x29e568});}function handleQuery(_0x344406){logger[_0x4960('0x42')](_0x344406);return db[_0x4960('0x43')][_0x4960('0x44')](_0x344406)[_0x4960('0x45')](function(_0x20b663){results['push'](_0x20b663);})['catch'](function(_0x6936fb){logger[_0x4960('0x3d')](_0x6936fb[_0x4960('0x3e')]);});}function main(_0x4b1b67,_0xb217a7,_0x3f707d,_0x55808c){logger['info']('main',_0x4b1b67,JSON['stringify'](_0xb217a7));process['send'](_0x4960('0x46'));var _0x35a468=_0xb217a7[_0x4960('0x47')];var _0x21ae6d=_0xb217a7[_0x4960('0x48')];var _0x1afa4b=path[_0x4960('0x27')](config['root'],'server/files/tmp',_0x21ae6d+_0x4960('0x49'));var _0x5a4022=_[_0x4960('0x35')](_0x35a468)[_0x4960('0x27')]();logger['info'](_0x4960('0x4a'),_0x5a4022);fs[_0x4960('0x4b')](_0x1afa4b,_0x5a4022+'\x0a');Papa[_0x4960('0x4c')](fs[_0x4960('0x4d')](_0x4b1b67),{'header':!![],'skipEmptyLines':!![],'step':function(_0x513a8b,_0x3feb75){try{for(var _0x192590=0x0,_0x5bb449=[];_0x192590<_0x513a8b[_0x4960('0x4e')][_0x4960('0x4f')];_0x192590++){stats['rows']+=0x1;if(_0x513a8b[_0x4960('0x3f')][_0x192590]){handleError(_0x513a8b[_0x4960('0x4e')][_0x192590],_0x513a8b[_0x4960('0x3f')][_0x192590]);}else{var _0x1e781d=[];for(var _0x5b724c in _0x35a468){if(_0x35a468['hasOwnProperty'](_0x5b724c)){if(_0x513a8b['data'][_0x192590][_0x35a468[_0x5b724c]]){var _0x14c30b=_[_0x4960('0x50')](_0x513a8b[_0x4960('0x4e')][_0x192590][_0x35a468[_0x5b724c]][_0x4960('0x51')](/"/g,'\x27'));switch(_0x5b724c){case'scheduledat':var _0x58999c=moment(_0x14c30b,_0x4960('0xc'),!![]);if(_0x58999c['isValid']()){_0x5bb449[_0x4960('0x40')]('\x22'+_0x14c30b+'\x22');}else{_0x1e781d['push'](_0x4960('0x52'));}break;case _0x4960('0x21'):var _0xec6466=parseInt(_0x14c30b);_0x14c30b=_['isNaN'](_0xec6466)||_0xec6466<0x0||_0xec6466>0x4?_0x55808c?0x3:0x2:_0xec6466;_0x5bb449['push']('\x22'+_0x14c30b+'\x22');break;case'UserId':var _0x4773f5=parseInt(_0x14c30b);if(_[_0x4960('0x53')](_0x4773f5)&&_['includes'](_0x3f707d,_0x4773f5)){_0x5bb449[_0x4960('0x40')]('\x22'+_0x4773f5+'\x22');}else{_0x1e781d[_0x4960('0x40')](_0x4960('0x54'));}break;case'email':if(isEmail(_0x14c30b)){_0x5bb449[_0x4960('0x40')]('\x22'+_0x14c30b+'\x22');}else{_0x1e781d['push'](_0x4960('0x55'));}break;case'dateOfBirth':var _0x1ce9f8=moment(_0x14c30b,_0x4960('0x56'),!![]);if(_0x1ce9f8[_0x4960('0x57')]()){_0x5bb449[_0x4960('0x40')]('\x22'+_0x14c30b+'\x22');}else{_0x1e781d[_0x4960('0x40')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x5bb449[_0x4960('0x40')]('\x22'+_0x14c30b+'\x22');}}else{switch(_0x5b724c){case _0x4960('0x58'):case _0x4960('0x10'):_0x1e781d['push'](_0x5b724c+'\x20not\x20specified');break;default:_0x5bb449[_0x4960('0x40')]('\x22\x22');}}}}if(_0x1e781d[_0x4960('0x4f')]){handleError(_0x513a8b[_0x4960('0x4e')][_0x192590],{'code':_0x4960('0x59'),'message':_0x1e781d['join']()});}else{fs[_0x4960('0x5a')](_0x1afa4b,_0x5bb449['join']()+'\x0a');}_0x5bb449=[];}if(!(stats[_0x4960('0x5b')]%0xc8)){socket[_0x4960('0x5c')](_0x4960('0x5d')+_0x21ae6d,stats);stats[_0x4960('0x3f')]=[];}}if(stopped){logger[_0x4960('0x42')](_0x4960('0x5e'));_0x3feb75[_0x4960('0x5f')]();}}catch(_0x14c33f){handleError(_0x513a8b[_0x4960('0x4e')][_0x192590],{'code':_0x4960('0x60'),'message':_0x14c33f['message']});logger[_0x4960('0x3d')](_0x4960('0x61'),_0x14c33f[_0x4960('0x3e')]);}},'complete':function(){try{var _0x52c0e4=[];var _0x54d4cb='cm_contacts';if(_0xb217a7[_0x4960('0x62')]&&_0xb217a7[_0x4960('0x62')][_0x4960('0x4f')]){_0x54d4cb=_0x4960('0x63')+_0x21ae6d;_0x52c0e4[_0x4960('0x40')](_0x4960('0x64')+_0x54d4cb+_0x4960('0x65'));}var _0x210311=util[_0x4960('0xb')](_0x4960('0x66'),_0x1afa4b,_0x54d4cb,_0x5a4022,_0xb217a7[_0x4960('0x32')],_0xb217a7[_0x4960('0x36')]||null,NOW,NOW);if(_[_0x4960('0x67')](_0x35a468[_0x4960('0x1d')])){_0x210311+=',\x20scheduledAt\x20=\x20NOW()';}_0x52c0e4[_0x4960('0x40')](_0x210311);if(_0xb217a7['duplicates']&&_0xb217a7['duplicates'][_0x4960('0x4f')]){_0x52c0e4[_0x4960('0x40')](insertCmContact(_0xb217a7[_0x4960('0x32')],_0x54d4cb,_0xb217a7[_0x4960('0x62')],_0x35a468));_0x52c0e4[_0x4960('0x40')](_0x4960('0x68')+_0x54d4cb+';');}_0x52c0e4[_0x4960('0x40')](insertCmHopper(_0xb217a7[_0x4960('0x32')],_0x4960('0x69'),_0x4960('0x6a'),'VoiceQueueId',_0x55808c));_0x52c0e4[_0x4960('0x40')](insertCmHopperBlack(_0xb217a7['ListId'],_0x4960('0x6b'),'voice_queues',_0x4960('0x6c')));_0x52c0e4[_0x4960('0x40')](insertCmHopper(_0xb217a7['ListId'],'campaigns_has_cm_lists','campaigns','CampaignId',_0x55808c));_0x52c0e4['push'](insertCmHopperBlack(_0xb217a7[_0x4960('0x32')],_0x4960('0x6d'),_0x4960('0x6e'),_0x4960('0x6f')));BPromise[_0x4960('0x70')](_0x52c0e4,handleQuery)['then'](function(_0x51aaab){stats[_0x4960('0x71')]=!![];stats[_0x4960('0x72')]=_0xb217a7[_0x4960('0x62')]&&_0xb217a7[_0x4960('0x62')][_0x4960('0x4f')]?results[0x2][_0x4960('0x72')]:results[0x0][_0x4960('0x72')];socket[_0x4960('0x5c')](_0x4960('0x5d')+_0x21ae6d,stats);fs[_0x4960('0x73')](_0x4b1b67);fs[_0x4960('0x73')](_0x1afa4b);process[_0x4960('0x74')](0x0);})[_0x4960('0x75')](function(_0x6f5fe5){logger['error'](_0x6f5fe5[_0x4960('0x3e')]);process[_0x4960('0x74')](0x1);});}catch(_0x48db39){logger[_0x4960('0x3d')](_0x4960('0x76'),_0x48db39[_0x4960('0x3e')]);process[_0x4960('0x74')](0x1);}},'error':function(_0x30700e,_0x165e4a,_0x3a412e,_0x21197a){throw new Error(_0x21197a);}});}function validate(){if(process[_0x4960('0x77')]&&process[_0x4960('0x77')][_0x4960('0x4f')]<0x4){throw new Error(_0x4960('0x78'));}var _0x16db1f=path[_0x4960('0x27')](config['root'],_0x4960('0x79'),process[_0x4960('0x77')][0x2]);if(!fs[_0x4960('0x7a')](_0x16db1f)){throw new Error(_0x4960('0x7b'));}var _0xd1228f={};try{_0xd1228f=JSON[_0x4960('0x4c')](process[_0x4960('0x77')][0x3]);if(!_0xd1228f[_0x4960('0x47')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xd1228f[_0x4960('0x47')][_0x4960('0x10')]){throw new Error(_0x4960('0x7c'));}if(!_0xd1228f[_0x4960('0x47')][_0x4960('0x58')]){throw new Error(_0x4960('0x7d'));}var _0x3b3aef=0x0;if(_0xd1228f[_0x4960('0x47')][_0x4960('0x22')]){_0x3b3aef=0x1;}if(!_0xd1228f['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x487af7){throw new Error(_0x4960('0x7e'));}var _0x7d7c36=[];try{_0x7d7c36=_[_0x4960('0x7f')](JSON['parse'](process[_0x4960('0x77')][0x4]),'id');}catch(_0xa6d8fc){logger['info'](_0x4960('0x80'));}main(_0x16db1f,_0xd1228f,_0x7d7c36,_0x3b3aef);}validate();process['on']('SIGINT',handleStop);process['on'](_0x4960('0x81'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 45221de..35a1b09 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 _0x0440=['Billable\x20Time','billableseconds','string','toLowerCase','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','inbound','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','uniqueid','Answer\x20Time','answertime','endtime','duration'];(function(_0xbde2f8,_0x57a33c){var _0x99bedd=function(_0x2d25fd){while(--_0x2d25fd){_0xbde2f8['push'](_0xbde2f8['shift']());}};_0x99bedd(++_0x57a33c);}(_0x0440,0x158));var _0x0044=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x0440[_0x1678c8];return _0x387aa9;};'use strict';exports['getSubjects']=function(_0x29450c,_0x25998f){var _0x2b1908=[{'type':_0x0044('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x29450c[_0x0044('0x1')]()){case _0x0044('0x2'):switch(_0x25998f['toLowerCase']()){case'inbound':_0x2b1908[_0x0044('0x3')]({'type':_0x0044('0x4'),'content':'','variableName':_0x0044('0x5')});_0x2b1908['push']({'type':_0x0044('0x4'),'content':'','variableName':_0x0044('0x6')});break;case _0x0044('0x7'):_0x2b1908[_0x0044('0x3')]({'type':_0x0044('0x0'),'content':_0x0044('0x8'),'variableName':null});_0x2b1908['push']({'type':'variable','content':'','variableName':_0x0044('0x9')});break;}}return _0x2b1908;};exports['getDescriptions']=function(_0x796ab4,_0x2c0223){var _0x2ac9ee=[];switch(_0x796ab4[_0x0044('0x1')]()){case _0x0044('0x2'):switch(_0x2c0223[_0x0044('0x1')]()){case _0x0044('0xa'):_0x2ac9ee=[{'type':_0x0044('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x0044('0xb'),'content':'','key':'Caller\x20Number','keyType':_0x0044('0x4'),'variableName':_0x0044('0x6')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0xc'),'keyType':_0x0044('0x4'),'variableName':_0x0044('0xd')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0xe'),'keyType':'variable','variableName':'destexten'},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0xf'),'keyType':'variable','variableName':_0x0044('0x5')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x10'),'keyType':_0x0044('0x4'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x0044('0x11'),'keyType':_0x0044('0x4'),'variableName':_0x0044('0x12')},{'type':_0x0044('0x0'),'content':_0x0044('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x0044('0x14')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x15'),'keyType':_0x0044('0x4'),'variableName':_0x0044('0x9')},{'type':_0x0044('0x0'),'content':_0x0044('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x0044('0x4'),'variableName':_0x0044('0x12')},{'type':_0x0044('0xb'),'content':'','key':'Agent\x20Connect','keyType':_0x0044('0x4'),'variableName':_0x0044('0x17')},{'type':'keyValue','content':'','key':_0x0044('0x18'),'keyType':_0x0044('0x4'),'variableName':_0x0044('0x19')},{'type':_0x0044('0xb'),'content':'','key':'Hold\x20Time','keyType':_0x0044('0x4'),'variableName':_0x0044('0x1a')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x1b'),'keyType':_0x0044('0x4'),'variableName':_0x0044('0x1c')}];break;case'outbound':_0x2ac9ee=[{'type':_0x0044('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x1d'),'keyType':'variable','keyContent':'','variableName':_0x0044('0x9')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x1e'),'keyType':_0x0044('0x4'),'keyContent':'','variableName':'membername'},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x10'),'keyType':_0x0044('0x4'),'keyContent':'','variableName':_0x0044('0x1f')},{'type':'keyValue','content':'','key':_0x0044('0x11'),'keyType':_0x0044('0x4'),'keyContent':'','variableName':'starttime'},{'type':_0x0044('0x0'),'content':_0x0044('0x16')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x20'),'keyType':'variable','keyContent':'','variableName':_0x0044('0x21')},{'type':_0x0044('0xb'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0x0044('0x22')},{'type':'keyValue','content':'','key':'Duration','keyType':_0x0044('0x4'),'keyContent':'','variableName':_0x0044('0x23')},{'type':_0x0044('0xb'),'content':'','key':_0x0044('0x24'),'keyType':_0x0044('0x4'),'keyContent':'','variableName':_0x0044('0x25')}];break;}}return _0x2ac9ee;}; \ No newline at end of file +var _0xc65f=['agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','Complete\x20Time','duration','Billable\x20Time','getSubjects','string','toLowerCase','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','variable','destcalleridnum','getDescriptions','voice','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','keyValue','Queue','UniqueId','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Complete'];(function(_0x500fd4,_0x1bdab9){var _0x4f1f6f=function(_0x3b7ee3){while(--_0x3b7ee3){_0x500fd4['push'](_0x500fd4['shift']());}};_0x4f1f6f(++_0x1bdab9);}(_0xc65f,0x14b));var _0xfc65=function(_0x1f0e2a,_0x1ea4fc){_0x1f0e2a=_0x1f0e2a-0x0;var _0x5bedbb=_0xc65f[_0x1f0e2a];return _0x5bedbb;};'use strict';exports[_0xfc65('0x0')]=function(_0x43c5c1,_0x4c438e){var _0x403807=[{'type':_0xfc65('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x43c5c1[_0xfc65('0x2')]()){case'voice':switch(_0x4c438e['toLowerCase']()){case _0xfc65('0x3'):_0x403807[_0xfc65('0x4')]({'type':'variable','content':'','variableName':_0xfc65('0x5')});_0x403807[_0xfc65('0x4')]({'type':'variable','content':'','variableName':_0xfc65('0x6')});break;case _0xfc65('0x7'):_0x403807[_0xfc65('0x4')]({'type':_0xfc65('0x1'),'content':_0xfc65('0x8'),'variableName':null});_0x403807[_0xfc65('0x4')]({'type':_0xfc65('0x9'),'content':'','variableName':_0xfc65('0xa')});break;}}return _0x403807;};exports[_0xfc65('0xb')]=function(_0x37a172,_0x2d8c9c){var _0x5dd2c5=[];switch(_0x37a172[_0xfc65('0x2')]()){case _0xfc65('0xc'):switch(_0x2d8c9c[_0xfc65('0x2')]()){case _0xfc65('0x3'):_0x5dd2c5=[{'type':_0xfc65('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xfc65('0xd'),'keyType':_0xfc65('0x9'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xfc65('0xe'),'keyType':_0xfc65('0x9'),'variableName':_0xfc65('0xf')},{'type':'keyValue','content':'','key':_0xfc65('0x10'),'keyType':_0xfc65('0x9'),'variableName':'destexten'},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x12'),'keyType':_0xfc65('0x9'),'variableName':'queue'},{'type':'keyValue','content':'','key':_0xfc65('0x13'),'keyType':_0xfc65('0x9'),'variableName':'uniqueid'},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x14'),'keyType':_0xfc65('0x9'),'variableName':'agentcalledAt'},{'type':'string','content':_0xfc65('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x16'),'keyType':_0xfc65('0x9'),'variableName':_0xfc65('0x17')},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x18'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0xfc65('0x1'),'content':_0xfc65('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x1a'),'keyType':_0xfc65('0x9'),'variableName':_0xfc65('0x1b')},{'type':_0xfc65('0x11'),'content':'','key':'Agent\x20Connect','keyType':_0xfc65('0x9'),'variableName':'agentconnectAt'},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x1c'),'keyType':_0xfc65('0x9'),'variableName':_0xfc65('0x1d')},{'type':'keyValue','content':'','key':_0xfc65('0x1e'),'keyType':_0xfc65('0x9'),'variableName':_0xfc65('0x1f')},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x20'),'keyType':_0xfc65('0x9'),'variableName':_0xfc65('0x21')}];break;case'outbound':_0x5dd2c5=[{'type':_0xfc65('0x1'),'content':_0xfc65('0x22'),'variableName':null},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x23'),'keyType':_0xfc65('0x9'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xfc65('0x9'),'keyContent':'','variableName':_0xfc65('0x24')},{'type':_0xfc65('0x11'),'content':'','key':'UniqueId','keyType':_0xfc65('0x9'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xfc65('0x14'),'keyType':_0xfc65('0x9'),'keyContent':'','variableName':'starttime'},{'type':_0xfc65('0x1'),'content':_0xfc65('0x19')},{'type':_0xfc65('0x11'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0xfc65('0x11'),'content':'','key':_0xfc65('0x25'),'keyType':_0xfc65('0x9'),'keyContent':'','variableName':'endtime'},{'type':_0xfc65('0x11'),'content':'','key':'Duration','keyType':_0xfc65('0x9'),'keyContent':'','variableName':_0xfc65('0x26')},{'type':'keyValue','content':'','key':_0xfc65('0x27'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x5dd2c5;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 1a71393..a9de499 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 _0xd5bb=['findOne','then','update','info','tracked','user','clone','body','omit','fax','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','role','null','Interaction'];(function(_0x575087,_0x4fd5a6){var _0x3c55d6=function(_0x3ebcb1){while(--_0x3ebcb1){_0x575087['push'](_0x575087['shift']());}};_0x3c55d6(++_0x4fd5a6);}(_0xd5bb,0x73));var _0xbd5b=function(_0x59e446,_0x5b1f27){_0x59e446=_0x59e446-0x0;var _0x408d80=_0xd5bb[_0x59e446];return _0x408d80;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xbd5b('0x0'))('openchannel-interactions'),'mail':require(_0xbd5b('0x0'))(_0xbd5b('0x1')),'fax':require(_0xbd5b('0x0'))(_0xbd5b('0x2')),'sms':require('../../config/logger')(_0xbd5b('0x3')),'chat':require(_0xbd5b('0x0'))(_0xbd5b('0x4')),'whatsapp':require(_0xbd5b('0x0'))('whatsapp-interactions')};function getInteractionId(_0x53b6e4,_0x1f29d0,_0x3fe29b){if(_0x53b6e4&&_0x53b6e4[_[_0xbd5b('0x5')](_0x3fe29b)+_0xbd5b('0x6')]){return _0x53b6e4[_[_0xbd5b('0x5')](_0x3fe29b)+_0xbd5b('0x6')];}else if(_0x53b6e4&&_0x53b6e4['id']){return _0x53b6e4['id'];}else if(_0x1f29d0&&_0x1f29d0['id']){return _0x1f29d0['id'];}else{return'unknown';}}function log(_0x1a59a7,_0x55c909,_0xe86d5d,_0x258d5e,_0x261532,_0x1c7d75){loggers[_0x261532[_0xbd5b('0x7')]()][_0x1a59a7]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c7d75['toUpperCase'](),_0x55c909?_0x55c909['id']:null,_0x55c909?_0x55c909['name']:null,_0x55c909?_0x55c909[_0xbd5b('0x8')]:null,getInteractionId(_0xe86d5d,_0x258d5e,_0x261532),_0xe86d5d?JSON['stringify'](_0xe86d5d):_0xbd5b('0x9'));}function updateUser(_0x20b1cb,_0x4e71c8,_0x5a46ba,_0x4caabd,_0x3758fb){db[_['upperFirst'](_0x4caabd)+_0xbd5b('0xa')][_0xbd5b('0xb')]({'where':{'id':getInteractionId(_0x4e71c8,_0x5a46ba,_0x4caabd)}})[_0xbd5b('0xc')](function(_0x9cd02c){if(_0x9cd02c){return _0x9cd02c[_0xbd5b('0xd')]({'UserId':_0x20b1cb?_0x20b1cb['id']:null});}})['then'](function(_0x2e120d){if(_0x2e120d){log(_0xbd5b('0xe'),_0x20b1cb,_0x4e71c8,_0x5a46ba,_0x4caabd,_0x3758fb);}})['catch'](function(){log('error',_0x20b1cb,_0x4e71c8,_0x5a46ba,_0x4caabd,_0x3758fb);});}exports[_0xbd5b('0xf')]=function(_0x978d8e,_0x2bd29f){return function(_0x48781a,_0x3d194f,_0x509849){var _0x3b8fd0=_0x48781a[_0xbd5b('0x10')];var _0x3e31e8={};var _0x14e3e0=_0x48781a['query'];if(_0x3e31e8){_0x3e31e8=_[_0xbd5b('0x11')](_0x48781a[_0xbd5b('0x12')]);_0x3e31e8=_[_0xbd5b('0x13')](_0x3e31e8,[_0xbd5b('0x12'),'html','phone',_0xbd5b('0x14'),'mobile']);}updateUser(_0x3b8fd0,_0x3e31e8,_0x14e3e0,_0x978d8e,_0x2bd29f);_0x509849(null);};}; \ No newline at end of file +var _0x00a3=['phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','catch','error','tracked','user','clone','body','omit','html'];(function(_0x41b96c,_0xaad34d){var _0x32bdf6=function(_0x11dd6e){while(--_0x11dd6e){_0x41b96c['push'](_0x41b96c['shift']());}};_0x32bdf6(++_0xaad34d);}(_0x00a3,0x87));var _0x300a=function(_0x5f27e4,_0x99f5ff){_0x5f27e4=_0x5f27e4-0x0;var _0x588fe5=_0x00a3[_0x5f27e4];return _0x588fe5;};'use strict';var _=require(_0x300a('0x0'));var db=require(_0x300a('0x1'))['db'];var loggers={'openchannel':require(_0x300a('0x2'))(_0x300a('0x3')),'mail':require(_0x300a('0x2'))('mail-interactions'),'fax':require(_0x300a('0x2'))(_0x300a('0x4')),'sms':require('../../config/logger')(_0x300a('0x5')),'chat':require(_0x300a('0x2'))(_0x300a('0x6')),'whatsapp':require(_0x300a('0x2'))(_0x300a('0x7'))};function getInteractionId(_0x190ae4,_0x5d6894,_0x1958d9){if(_0x190ae4&&_0x190ae4[_[_0x300a('0x8')](_0x1958d9)+_0x300a('0x9')]){return _0x190ae4[_['upperFirst'](_0x1958d9)+_0x300a('0x9')];}else if(_0x190ae4&&_0x190ae4['id']){return _0x190ae4['id'];}else if(_0x5d6894&&_0x5d6894['id']){return _0x5d6894['id'];}else{return _0x300a('0xa');}}function log(_0x5818c9,_0x1ab39c,_0x21d67e,_0x5d15d5,_0x44c1ac,_0x5a6ae7){loggers[_0x44c1ac[_0x300a('0xb')]()][_0x5818c9](_0x300a('0xc'),_0x5a6ae7[_0x300a('0xd')](),_0x1ab39c?_0x1ab39c['id']:null,_0x1ab39c?_0x1ab39c[_0x300a('0xe')]:null,_0x1ab39c?_0x1ab39c[_0x300a('0xf')]:null,getInteractionId(_0x21d67e,_0x5d15d5,_0x44c1ac),_0x21d67e?JSON[_0x300a('0x10')](_0x21d67e):_0x300a('0x11'));}function updateUser(_0x4d87d1,_0x3e94de,_0x150991,_0x624bde,_0x22dae8){db[_['upperFirst'](_0x624bde)+_0x300a('0x12')][_0x300a('0x13')]({'where':{'id':getInteractionId(_0x3e94de,_0x150991,_0x624bde)}})[_0x300a('0x14')](function(_0x4149ab){if(_0x4149ab){return _0x4149ab['update']({'UserId':_0x4d87d1?_0x4d87d1['id']:null});}})[_0x300a('0x14')](function(_0x348a9c){if(_0x348a9c){log(_0x300a('0x15'),_0x4d87d1,_0x3e94de,_0x150991,_0x624bde,_0x22dae8);}})[_0x300a('0x16')](function(){log(_0x300a('0x17'),_0x4d87d1,_0x3e94de,_0x150991,_0x624bde,_0x22dae8);});}exports[_0x300a('0x18')]=function(_0x26487e,_0x57607e){return function(_0xabd6a,_0x43c10b,_0x349928){var _0x5f1921=_0xabd6a[_0x300a('0x19')];var _0x16a2b8={};var _0x3ffa94=_0xabd6a['query'];if(_0x16a2b8){_0x16a2b8=_[_0x300a('0x1a')](_0xabd6a[_0x300a('0x1b')]);_0x16a2b8=_[_0x300a('0x1c')](_0x16a2b8,['body',_0x300a('0x1d'),_0x300a('0x1e'),_0x300a('0x1f'),_0x300a('0x20')]);}updateUser(_0x5f1921,_0x16a2b8,_0x3ffa94,_0x26487e,_0x57607e);_0x349928(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 01dc748..17c6908 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 _0xbd20=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','findOne','then','status'];(function(_0x1ba64e,_0x1b009f){var _0x48a4b6=function(_0x1d2c55){while(--_0x1d2c55){_0x1ba64e['push'](_0x1ba64e['shift']());}};_0x48a4b6(++_0x1b009f);}(_0xbd20,0xfa));var _0x0bd2=function(_0x417774,_0x1b95e6){_0x417774=_0x417774-0x0;var _0x10015d=_0xbd20[_0x417774];return _0x10015d;};'use strict';var crypto=require(_0x0bd2('0x0'));var util=require(_0x0bd2('0x1'));var compose=require(_0x0bd2('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x0bd2('0x3'));function getValueFromLicense(_0x3fee88,_0x56b4c4){if(_0x3fee88&&_0x56b4c4){if(_0x56b4c4[_0x0bd2('0x4')]&&_0x56b4c4[_0x0bd2('0x5')]){var _0x4e1918=_0x56b4c4[_0x0bd2('0x4')];var _0x19e4b7=_0x56b4c4['license'];var _0x1d7488=_0x4e1918[_0x0bd2('0x6')]('-')[0x4];var _0x30b447=_0x4e1918['split']('-')[0x0];var _0x5c927a=crypto[_0x0bd2('0x7')](_0x0bd2('0x8'),util[_0x0bd2('0x9')](_0x0bd2('0xa'),_0x1d7488,_0x4e1918,_0x30b447));var _0xb6bb6f=_0x5c927a[_0x0bd2('0xb')](_0x19e4b7,'base64',_0x0bd2('0xc'));_0xb6bb6f+=_0x5c927a[_0x0bd2('0xd')](_0x0bd2('0xc'));var _0x28b8b3=JSON[_0x0bd2('0xe')](_0xb6bb6f);return _0x28b8b3[_0x0bd2('0xf')](_0x3fee88)?_0x28b8b3[_0x3fee88]:null;}}return null;}function isLimit(_0x55874c,_0x375a54,_0x1f6c24,_0x43259d){var _0x4a8fef=_0x375a54;return compose()[_0x0bd2('0x10')](function(_0x4504c2,_0x490306,_0x110288){return db['License'][_0x0bd2('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x0bd2('0x12')](function(_0x2d2e9e){var _0x2c892e=getValueFromLicense(_0x55874c,_0x2d2e9e);return _0x2c892e?_0x2c892e:_0x4a8fef;})[_0x0bd2('0x12')](function(_0x4ed823){_0x4a8fef=_0x4ed823;return _0x1f6c24['count'](_0x43259d);})[_0x0bd2('0x12')](function(_0x4a210d){if(_0x4a210d>=_0x4a8fef){return _0x490306[_0x0bd2('0x13')](0x193)['json']({'message':util[_0x0bd2('0x9')](_0x0bd2('0x14'),_0x55874c)});}_0x110288();})[_0x0bd2('0x15')](function(_0x3dca94){_0x110288(_0x3dca94);});});}function isUserLimit(){return isLimit(_0x0bd2('0x16'),0x1,db[_0x0bd2('0x17')],{'where':{'$or':[{'role':_0x0bd2('0x18')},{'role':_0x0bd2('0x19')}]}});}exports[_0x0bd2('0x1a')]=isUserLimit; \ No newline at end of file +var _0x609b=['utf8','parse','use','findOne','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','isUserLimit','crypto','util','composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','%s:%s:%s','update','base64'];(function(_0x5c2601,_0x224e53){var _0x436a6a=function(_0x3b8736){while(--_0x3b8736){_0x5c2601['push'](_0x5c2601['shift']());}};_0x436a6a(++_0x224e53);}(_0x609b,0x155));var _0xb609=function(_0x48da05,_0x5ea4af){_0x48da05=_0x48da05-0x0;var _0x4260c3=_0x609b[_0x48da05];return _0x4260c3;};'use strict';var crypto=require(_0xb609('0x0'));var util=require(_0xb609('0x1'));var compose=require(_0xb609('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xb609('0x3'));function getValueFromLicense(_0xb3a5ae,_0x1d6830){if(_0xb3a5ae&&_0x1d6830){if(_0x1d6830['data1']&&_0x1d6830[_0xb609('0x4')]){var _0x5b6655=_0x1d6830[_0xb609('0x5')];var _0x4bb0b8=_0x1d6830[_0xb609('0x4')];var _0x23549c=_0x5b6655[_0xb609('0x6')]('-')[0x4];var _0x41e898=_0x5b6655[_0xb609('0x6')]('-')[0x0];var _0x14ed39=crypto['createDecipher'](_0xb609('0x7'),util['format'](_0xb609('0x8'),_0x23549c,_0x5b6655,_0x41e898));var _0x4134c8=_0x14ed39[_0xb609('0x9')](_0x4bb0b8,_0xb609('0xa'),_0xb609('0xb'));_0x4134c8+=_0x14ed39['final'](_0xb609('0xb'));var _0x3b9f63=JSON[_0xb609('0xc')](_0x4134c8);return _0x3b9f63['hasOwnProperty'](_0xb3a5ae)?_0x3b9f63[_0xb3a5ae]:null;}}return null;}function isLimit(_0x5289d4,_0x3e46d6,_0x3a94f0,_0x2ea51f){var _0x58c068=_0x3e46d6;return compose()[_0xb609('0xd')](function(_0x167099,_0x254469,_0x287b88){return db['License'][_0xb609('0xe')]({'where':{'id':0x1},'raw':!![]})[_0xb609('0xf')](function(_0x174cec){var _0x4b1070=getValueFromLicense(_0x5289d4,_0x174cec);return _0x4b1070?_0x4b1070:_0x58c068;})['then'](function(_0x4f2cd4){_0x58c068=_0x4f2cd4;return _0x3a94f0['count'](_0x2ea51f);})['then'](function(_0x2c1b7d){if(_0x2c1b7d>=_0x58c068){return _0x254469[_0xb609('0x10')](0x193)[_0xb609('0x11')]({'message':util[_0xb609('0x12')](_0xb609('0x13'),_0x5289d4)});}_0x287b88();})['catch'](function(_0x3c159e){_0x287b88(_0x3c159e);});});}function isUserLimit(){return isLimit(_0xb609('0x14'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xb609('0x15')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fa9930b..f3377ce 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 _0xb942=['DATE','operator','$between','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','$ne','<>\x20?','$startsWith','LIKE\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$in','start','$substring','$endsWith','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','split','length','forEach','shift','indexOf','map','conditions','push','buildExpression'];(function(_0x27a24a,_0x4b5d8f){var _0x3ec224=function(_0x270edf){while(--_0x270edf){_0x27a24a['push'](_0x27a24a['shift']());}};_0x3ec224(++_0x4b5d8f);}(_0xb942,0x134));var _0x2b94=function(_0x190dde,_0x5bb90f){_0x190dde=_0x190dde-0x0;var _0x2a3638=_0xb942[_0x190dde];return _0x2a3638;};'use strict';var _=require('lodash');var moment=require(_0x2b94('0x0'));exports[_0x2b94('0x1')]=function(_0x3031d4){var _0x2cf2a4={'conditions':[]};_0x2cf2a4[_0x2b94('0x2')]=_[_0x2b94('0x3')](_0x3031d4,_0x2b94('0x4'))?'or':_0x2b94('0x5');var _0xcddb97=_0x3031d4['replace'](_0x2b94('0x6'),'')['replace'](_0x2b94('0x4'),'')[_0x2b94('0x7')]('||');for(var _0x2bc101=0x0;_0x2bc101<_0xcddb97[_0x2b94('0x8')];_0x2bc101++){var _0xcfe57e=_0xcddb97[_0x2bc101][_0x2b94('0x7')](':=');var _0x2ca805=_0xcfe57e[0x0];var _0x90850f=_0xcfe57e['slice'](0x1);_0x90850f[_0x2b94('0x9')](function(_0x4ea3a8){var _0x3f3e3a=_0x4ea3a8[_0x2b94('0x7')]('[')[_0x2b94('0xa')]();var _0x5e1ddf=_0x4ea3a8['match'](/\[(.*?)\]/g);_0x5e1ddf['forEach'](function(_0x5bc8a9){var _0x589d1a=_0x5bc8a9['split']('[')['filter'](function(_0x1cfc7d){return _0x1cfc7d[_0x2b94('0xb')](']')>-0x1;})[_0x2b94('0xc')](function(_0x3ad836){return _0x3ad836['split'](']')[0x0];})[0x0];_0x2cf2a4[_0x2b94('0xd')][_0x2b94('0xe')]({'field':_0x2ca805,'operator':_0x3f3e3a,'value':_0x589d1a});});});}return _0x2cf2a4;};exports[_0x2b94('0xf')]=function(_0x37edaf,_0x5c27c6,_0x31938d){var _0x2b0af1={};if(_0x5c27c6===_0x2b94('0x10')){if(_0x31938d[_0x2b94('0x11')]==='$eq'){_0x31938d[_0x2b94('0x11')]=_0x2b94('0x12');_0x31938d[_0x2b94('0x13')]+=','+_0x31938d['value'];}else if(_[_0x2b94('0x14')]([_0x2b94('0x15'),_0x2b94('0x16')],_0x31938d[_0x2b94('0x11')])){_0x31938d['value']=moment(_0x31938d[_0x2b94('0x13')])[_0x2b94('0x17')](0x1,_0x2b94('0x18'))[_0x2b94('0x19')]('YYYY-MM-DD');}}if(_0x31938d[_0x2b94('0x1a')]){_0x5c27c6=_0x31938d[_0x2b94('0x1a')];_0x2b0af1[_0x2b94('0x1b')]=_0x2b94('0x1c')+_0x37edaf+'.'+_0x31938d[_0x2b94('0x1d')]+_0x2b94('0x1e')+_0x31938d[_0x2b94('0x1a')]+')\x20'+parseOperator(_0x31938d[_0x2b94('0x11')]);}else{_0x2b0af1['text']=_0x37edaf+'.'+_0x31938d['field']+'\x20'+parseOperator(_0x31938d[_0x2b94('0x11')]);}if(_['includes'](['$ne',_0x2b94('0x1f')],_0x31938d[_0x2b94('0x11')]))_0x2b0af1[_0x2b94('0x1b')]='('+_0x2b0af1['text']+'\x20OR\x20'+_0x37edaf+'.'+_0x31938d[_0x2b94('0x1d')]+_0x2b94('0x20');_0x2b0af1[_0x2b94('0x13')]=parseValue(_0x5c27c6,_0x31938d[_0x2b94('0x11')],_0x31938d[_0x2b94('0x13')]);return _0x2b0af1;};function parseOperator(_0x41d19a){var _0x294743;switch(_0x41d19a){case'$in':_0x294743=_0x2b94('0x21');break;case _0x2b94('0x1f'):_0x294743=_0x2b94('0x22');break;case _0x2b94('0x23'):_0x294743=_0x2b94('0x24');break;case _0x2b94('0x25'):_0x294743=_0x2b94('0x26');break;case'$substring':case _0x2b94('0x27'):case'$endsWith':_0x294743=_0x2b94('0x28');break;case'$lt':_0x294743='<\x20?';break;case _0x2b94('0x15'):_0x294743=_0x2b94('0x29');break;case _0x2b94('0x16'):_0x294743=_0x2b94('0x2a');break;case _0x2b94('0x2b'):_0x294743=_0x2b94('0x2c');break;case _0x2b94('0x12'):_0x294743='BETWEEN\x20?\x20AND\x20?';break;}return _0x294743;}function parseValue(_0x4ab744,_0x30684c,_0x1ff8b9){var _0x7d6865={'start':undefined,'end':undefined};switch(_0x30684c){case _0x2b94('0x2d'):case'$notIn':_0x7d6865[_0x2b94('0x2e')]=_0x1ff8b9[_0x2b94('0x7')](',');break;case _0x2b94('0x2f'):_0x7d6865[_0x2b94('0x2e')]='%'+_0x1ff8b9+'%';break;case'$startsWith':_0x7d6865[_0x2b94('0x2e')]=_0x1ff8b9+'%';break;case _0x2b94('0x30'):_0x7d6865[_0x2b94('0x2e')]='%'+_0x1ff8b9;break;case _0x2b94('0x12'):var _0x579be0=_0x1ff8b9[_0x2b94('0x7')](',');var _0x1ff8b9=_0x579be0[_0x2b94('0xa')]();var _0x55cf86=_0x579be0[_0x2b94('0x31')]();if(_0x4ab744===_0x2b94('0x10')){_0x1ff8b9=moment(_0x1ff8b9)[_0x2b94('0x32')](0x0,!![])[_0x2b94('0x19')]();_0x55cf86=moment(_0x55cf86)[_0x2b94('0x32')](0x0,!![])[_0x2b94('0x17')](0x17,_0x2b94('0x33'))[_0x2b94('0x17')](0x3b,_0x2b94('0x34'))[_0x2b94('0x17')](0x3b,_0x2b94('0x35'))[_0x2b94('0x19')]();}_0x7d6865={'start':_0x1ff8b9,'end':_0x55cf86};break;default:_0x7d6865[_0x2b94('0x2e')]=_0x1ff8b9;break;}return _0x7d6865;} \ No newline at end of file +var _0x662d=['$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring'];(function(_0x297eb4,_0x5f28d3){var _0x3ffc36=function(_0x4a9688){while(--_0x4a9688){_0x297eb4['push'](_0x297eb4['shift']());}};_0x3ffc36(++_0x5f28d3);}(_0x662d,0xc3));var _0xd662=function(_0x4aba33,_0x520908){_0x4aba33=_0x4aba33-0x0;var _0x38612a=_0x662d[_0x4aba33];return _0x38612a;};'use strict';var _=require(_0xd662('0x0'));var moment=require(_0xd662('0x1'));exports[_0xd662('0x2')]=function(_0xd9e200){var _0x4e09f2={'conditions':[]};_0x4e09f2[_0xd662('0x3')]=_[_0xd662('0x4')](_0xd9e200,_0xd662('0x5'))?'or':_0xd662('0x6');var _0x40c2f2=_0xd9e200[_0xd662('0x7')](_0xd662('0x8'),'')['replace'](_0xd662('0x5'),'')['split']('||');for(var _0x32aa97=0x0;_0x32aa97<_0x40c2f2[_0xd662('0x9')];_0x32aa97++){var _0x23c1ce=_0x40c2f2[_0x32aa97][_0xd662('0xa')](':=');var _0x4631c8=_0x23c1ce[0x0];var _0x2d5464=_0x23c1ce[_0xd662('0xb')](0x1);_0x2d5464[_0xd662('0xc')](function(_0x4adcba){var _0xca71e9=_0x4adcba['split']('[')[_0xd662('0xd')]();var _0x195e8d=_0x4adcba[_0xd662('0xe')](/\[(.*?)\]/g);_0x195e8d[_0xd662('0xc')](function(_0x4a2ebb){var _0x43442c=_0x4a2ebb[_0xd662('0xa')]('[')[_0xd662('0xf')](function(_0x2f9039){return _0x2f9039[_0xd662('0x10')](']')>-0x1;})[_0xd662('0x11')](function(_0x393705){return _0x393705[_0xd662('0xa')](']')[0x0];})[0x0];_0x4e09f2[_0xd662('0x12')][_0xd662('0x13')]({'field':_0x4631c8,'operator':_0xca71e9,'value':_0x43442c});});});}return _0x4e09f2;};exports[_0xd662('0x14')]=function(_0x5a0775,_0xdc79b0,_0x56b0fc){var _0x14c8bc={};if(_0xdc79b0===_0xd662('0x15')){if(_0x56b0fc[_0xd662('0x16')]===_0xd662('0x17')){_0x56b0fc[_0xd662('0x16')]=_0xd662('0x18');_0x56b0fc[_0xd662('0x19')]+=','+_0x56b0fc[_0xd662('0x19')];}else if(_['includes'](['$gt','$lte'],_0x56b0fc[_0xd662('0x16')])){_0x56b0fc['value']=moment(_0x56b0fc[_0xd662('0x19')])['add'](0x1,_0xd662('0x1a'))[_0xd662('0x1b')](_0xd662('0x1c'));}}if(_0x56b0fc[_0xd662('0x1d')]){_0xdc79b0=_0x56b0fc['castTo'];_0x14c8bc[_0xd662('0x1e')]=_0xd662('0x1f')+_0x5a0775+'.'+_0x56b0fc[_0xd662('0x20')]+_0xd662('0x21')+_0x56b0fc[_0xd662('0x1d')]+')\x20'+parseOperator(_0x56b0fc[_0xd662('0x16')]);}else{_0x14c8bc[_0xd662('0x1e')]=_0x5a0775+'.'+_0x56b0fc[_0xd662('0x20')]+'\x20'+parseOperator(_0x56b0fc[_0xd662('0x16')]);}if(_[_0xd662('0x22')]([_0xd662('0x23'),'$notIn'],_0x56b0fc[_0xd662('0x16')]))_0x14c8bc[_0xd662('0x1e')]='('+_0x14c8bc[_0xd662('0x1e')]+_0xd662('0x24')+_0x5a0775+'.'+_0x56b0fc['field']+_0xd662('0x25');_0x14c8bc[_0xd662('0x19')]=parseValue(_0xdc79b0,_0x56b0fc[_0xd662('0x16')],_0x56b0fc[_0xd662('0x19')]);return _0x14c8bc;};function parseOperator(_0x22772a){var _0x20d915;switch(_0x22772a){case _0xd662('0x26'):_0x20d915=_0xd662('0x27');break;case _0xd662('0x28'):_0x20d915=_0xd662('0x29');break;case'$eq':_0x20d915=_0xd662('0x2a');break;case _0xd662('0x23'):_0x20d915=_0xd662('0x2b');break;case _0xd662('0x2c'):case _0xd662('0x2d'):case _0xd662('0x2e'):_0x20d915=_0xd662('0x2f');break;case'$lt':_0x20d915=_0xd662('0x30');break;case'$gt':_0x20d915=_0xd662('0x31');break;case _0xd662('0x32'):_0x20d915=_0xd662('0x33');break;case _0xd662('0x34'):_0x20d915='>=\x20?';break;case _0xd662('0x18'):_0x20d915=_0xd662('0x35');break;}return _0x20d915;}function parseValue(_0x414e8a,_0x34c953,_0x1b4dc1){var _0x456a7f={'start':undefined,'end':undefined};switch(_0x34c953){case _0xd662('0x26'):case _0xd662('0x28'):_0x456a7f[_0xd662('0x36')]=_0x1b4dc1[_0xd662('0xa')](',');break;case _0xd662('0x2c'):_0x456a7f[_0xd662('0x36')]='%'+_0x1b4dc1+'%';break;case'$startsWith':_0x456a7f[_0xd662('0x36')]=_0x1b4dc1+'%';break;case _0xd662('0x2e'):_0x456a7f[_0xd662('0x36')]='%'+_0x1b4dc1;break;case _0xd662('0x18'):var _0x34bca0=_0x1b4dc1['split'](',');var _0x1b4dc1=_0x34bca0['shift']();var _0x3d59e1=_0x34bca0['pop']();if(_0x414e8a==='DATE'){_0x1b4dc1=moment(_0x1b4dc1)['utcOffset'](0x0,!![])['format']();_0x3d59e1=moment(_0x3d59e1)[_0xd662('0x37')](0x0,!![])[_0xd662('0x38')](0x17,_0xd662('0x39'))[_0xd662('0x38')](0x3b,_0xd662('0x3a'))[_0xd662('0x38')](0x3b,_0xd662('0x3b'))[_0xd662('0x1b')]();}_0x456a7f={'start':_0x1b4dc1,'end':_0x3d59e1};break;default:_0x456a7f[_0xd662('0x36')]=_0x1b4dc1;break;}return _0x456a7f;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 5978b86..c9c9e4c 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 _0x960e=['utc','subtract','name','isArray','limit','offset','sort','map','indexOf','priority','cast','substr','DESC','unsigned','ASC','omit','isObject','isString','unset','hasOwnProperty','isNumeric','isEmail','match','forEach','replace','push','join','query','$id','model','intersection','attributes','length','filters','where','VIRTUAL','col','lower','filter','moment','parse','keys','includes','fields','split','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte'];(function(_0x402784,_0x26fdd5){var _0x4eac8e=function(_0x530081){while(--_0x530081){_0x402784['push'](_0x402784['shift']());}};_0x4eac8e(++_0x26fdd5);}(_0x960e,0x135));var _0xe960=function(_0x3ac68b,_0x504113){_0x3ac68b=_0x3ac68b-0x0;var _0x107f29=_0x960e[_0x3ac68b];return _0x107f29;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xe960('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x33b471){var _0x2803ec=['ne'];try{var _0x286054=JSON[_0xe960('0x1')](_0x33b471);var _0x453af0=Object[_0xe960('0x2')](_0x286054)[0x0];return _0x2803ec[_0xe960('0x3')](_0x453af0);}catch(_0x25b3fb){return![];}}function getOperatorValue(_0x4ef9ca){var _0x2fa7b9=JSON['parse'](_0x4ef9ca);var _0x13774e=Object[_0xe960('0x2')](_0x2fa7b9)[0x0];var _0x152f0b=_0x2fa7b9[_0x13774e];return{['$'+_0x13774e]:_0x152f0b};}exports[_0xe960('0x4')]=function(_0x1d7c07){var _0x22b8c1=null;if(_0x1d7c07){_0x22b8c1=_0x1d7c07[_0xe960('0x5')](',');}return _0x22b8c1;};exports['filters']=function(_0x2b71d2,_0x40fabe){var _0x253c07={};if(!_['isEmpty'](_0x2b71d2)){_[_0xe960('0x6')](_0x2b71d2,function(_0x2d6872,_0x352e49){try{if(_0x40fabe){var _0x3482e4=_[_0xe960('0x7')](_0x40fabe,{'name':_0x352e49})||{};if(hasSequelizeOperator(_0x2d6872)){_0x253c07[_0x352e49]=getOperatorValue(_0x2d6872);}else if(_0x3482e4[_0xe960('0x8')]===_0xe960('0x9')&&_[_0xe960('0xa')](_0x2d6872)){var _0x49d08d=JSON[_0xe960('0x1')](_0x2d6872);var _0x5902a3={'$gte':moment(moment(_0x49d08d[_0xe960('0xb')])[_0xe960('0xc')](_0xe960('0xd')))['utc']()[_0xe960('0xc')](),'$lte':moment(moment(_0x49d08d[_0xe960('0xe')])[_0xe960('0xc')](_0xe960('0xd')))[_0xe960('0xf')]()[_0xe960('0x10')](0x1,'s')[_0xe960('0xc')]()};_0x253c07[_0x352e49]=_0x5902a3;}else if(_0x3482e4[_0xe960('0x11')]==='uniqueid'){_0x253c07[_0x352e49]=_0x2d6872;}else{_0x253c07[_0x352e49]=_['isArray'](_0x2d6872)?_0x2d6872:JSON[_0xe960('0x1')](_0x2d6872);}}else{_0x253c07[_0x352e49]=_[_0xe960('0x12')](_0x2d6872)?_0x2d6872:JSON[_0xe960('0x1')](_0x2d6872);}}catch(_0x308a8a){_0x253c07[_0x352e49]=_0x2d6872[_0xe960('0x5')](',');}});}return _0x253c07;};exports[_0xe960('0x13')]=function(_0x20efb9){_0x20efb9=parseInt(_0x20efb9,0xa);if(!_0x20efb9||_0x20efb9<0x0){_0x20efb9=LIMIT_VALUE;}return _0x20efb9;};exports[_0xe960('0x14')]=function(_0x23595e){_0x23595e=parseInt(_0x23595e,0xa);if(!_0x23595e||_0x23595e<0x0){_0x23595e=0x0;}return _0x23595e;};exports[_0xe960('0x15')]=function(_0x84d9eb){var _0x2fcf48,_0x5d1380=null;if(_0x84d9eb){_0x2fcf48=_0x84d9eb['split'](',');_0x5d1380=_[_0xe960('0x16')](_0x2fcf48,function(_0x5db4d7){if(_0x5db4d7[_0xe960('0x17')]('-')===0x0){return[_0x5db4d7===_0xe960('0x18')?sequelize[_0xe960('0x19')](sequelize['col'](_0xe960('0x18')),'unsigned'):_0x5db4d7[_0xe960('0x1a')](0x1),_0xe960('0x1b')];}else{return[_0x5db4d7==='priority'?sequelize[_0xe960('0x19')](sequelize['col'](_0xe960('0x18')),_0xe960('0x1c')):_0x5db4d7,_0xe960('0x1d')];}});}return _0x5d1380;};exports[_0xe960('0x1e')]=function(_0x26c1cc,_0x5b8aa9){if(_['isEmpty'](_0x26c1cc)){return _0x26c1cc;}if(_['isArray'](_0x26c1cc)){for(var _0x2e8b0c=0x0;_0x2e8b0c<_0x26c1cc['length'];_0x2e8b0c+=0x1){_0x26c1cc[_0x2e8b0c]=this[_0xe960('0x1e')](_0x26c1cc[_0x2e8b0c],_0x5b8aa9);}return _0x26c1cc;}if(!_[_0xe960('0x1f')](_0x26c1cc)){return _0x26c1cc;}if(_[_0xe960('0x20')](_0x5b8aa9)){_0x5b8aa9=[_0x5b8aa9];}if(!_[_0xe960('0x12')](_0x5b8aa9)){return _0x26c1cc;}for(var _0x5ae5ff=0x0;_0x5ae5ff<_0x5b8aa9['length'];_0x5ae5ff+=0x1){_[_0xe960('0x21')](_0x26c1cc,_0x5b8aa9[_0x5ae5ff]);}for(var _0x3ce994 in _0x26c1cc){if(_0x26c1cc[_0xe960('0x22')](_0x3ce994)){_0x26c1cc[_0x3ce994]=this['omit'](_0x26c1cc[_0x3ce994],_0x5b8aa9);}}return _0x26c1cc;};exports[_0xe960('0x23')]=function(_0x4ca991){return _0x4ca991['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xe960('0x24')]=function(_0x5dd623){return _0x5dd623[_0xe960('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x24c6a7){var _0x57ba38=[];_0x24c6a7['split'](/[ ,]+/)[_0xe960('0x26')](function(_0x1dea94){_0x1dea94=_0x1dea94[_0xe960('0x27')](/([^:]")"+/g,'$1');_0x1dea94='+'+_0x1dea94+'*';if(_0x1dea94[_0xe960('0x3')]('@'))_0x1dea94='\x22'+_0x1dea94+'\x22';_0x57ba38[_0xe960('0x28')](_0x1dea94);});return _0x57ba38[_0xe960('0x29')]('\x20');};exports['getOptions']=function(_0x48b2b4,_0x287fa5,_0x4951a9){var _0x2eac19={},_0x57fff3={};if(_0x287fa5[_0xe960('0x2a')][_0xe960('0x2b')]){_0x287fa5['query']['id']=_0x287fa5[_0xe960('0x2a')][_0xe960('0x2b')];delete _0x287fa5[_0xe960('0x2a')][_0xe960('0x2b')];}_0x2eac19[_0xe960('0x2c')]=_[_0xe960('0x16')](_0x48b2b4,_0xe960('0x11'));_0x2eac19['query']=_[_0xe960('0x2')](_0x287fa5[_0xe960('0x2a')]);_0x2eac19['filters']=_[_0xe960('0x2d')](_0x2eac19[_0xe960('0x2c')],_0x2eac19[_0xe960('0x2a')]);_0x57fff3['attributes']=_[_0xe960('0x2d')](_0x2eac19[_0xe960('0x2c')],this[_0xe960('0x4')](_0x287fa5[_0xe960('0x2a')][_0xe960('0x4')]));_0x57fff3[_0xe960('0x2e')]=_0x57fff3['attributes'][_0xe960('0x2f')]?_0x57fff3[_0xe960('0x2e')]:_0x2eac19[_0xe960('0x2c')];if(!_0x287fa5[_0xe960('0x2a')]['hasOwnProperty']('nolimit')){_0x57fff3['limit']=this[_0xe960('0x13')](_0x287fa5[_0xe960('0x2a')][_0xe960('0x13')]);_0x57fff3[_0xe960('0x14')]=this[_0xe960('0x14')](_0x287fa5[_0xe960('0x2a')][_0xe960('0x14')]);}_0x57fff3['order']=this[_0xe960('0x15')](_0x287fa5[_0xe960('0x2a')]['sort']);_0x57fff3['where']=this['filters'](_['pick'](_0x287fa5[_0xe960('0x2a')],_0x2eac19[_0xe960('0x30')]),_0x48b2b4);if(_0x287fa5[_0xe960('0x2a')]['filter']){_0x57fff3['where']=_['merge'](_0x57fff3[_0xe960('0x31')],{'$or':_[_0xe960('0x16')](_0x48b2b4,function(_0x553a9e){if(_0x553a9e['type']!==_0xe960('0x32')){if(_0x4951a9){return sequelize[_0xe960('0x31')](sequelize['fn']('lower',sequelize[_0xe960('0x33')](_0x553a9e[_0xe960('0x11')])),{'$like':sequelize['fn'](_0xe960('0x34'),'%'+_0x287fa5[_0xe960('0x2a')]['filter']+'%')});}else{var _0x338978={};_0x338978[_0x553a9e[_0xe960('0x11')]]={'$like':'%'+_0x287fa5[_0xe960('0x2a')][_0xe960('0x35')]+'%'};return _0x338978;}}})});}_0x57fff3=_['merge']({},_0x57fff3,_0x287fa5['options']);return _0x57fff3;}; \ No newline at end of file +var _0xcdee=['merge','VIRTUAL','lower','options','sequelize','moment','parse','includes','fields','split','isEmpty','forOwn','type','DATE','isPlainObject','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','offset','sort','map','indexOf','priority','col','unsigned','substr','cast','ASC','length','isString','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','name','keys','filters','intersection','attributes','limit','order','where','pick','filter'];(function(_0x5c673d,_0xdc93c2){var _0x42ba9a=function(_0x511a96){while(--_0x511a96){_0x5c673d['push'](_0x5c673d['shift']());}};_0x42ba9a(++_0xdc93c2);}(_0xcdee,0xf4));var _0xecde=function(_0x300f6a,_0x19d591){_0x300f6a=_0x300f6a-0x0;var _0x5ddabf=_0xcdee[_0x300f6a];return _0x5ddabf;};'use strict';var _=require('lodash');var sequelize=require(_0xecde('0x0'));var moment=require(_0xecde('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x280a78){var _0x49d009=['ne'];try{var _0x416e33=JSON[_0xecde('0x2')](_0x280a78);var _0x32cd92=Object['keys'](_0x416e33)[0x0];return _0x49d009[_0xecde('0x3')](_0x32cd92);}catch(_0x46599c){return![];}}function getOperatorValue(_0x176b06){var _0x4c8e8e=JSON[_0xecde('0x2')](_0x176b06);var _0x304fe7=Object['keys'](_0x4c8e8e)[0x0];var _0x55ae6a=_0x4c8e8e[_0x304fe7];return{['$'+_0x304fe7]:_0x55ae6a};}exports[_0xecde('0x4')]=function(_0x18ede9){var _0x3a06c2=null;if(_0x18ede9){_0x3a06c2=_0x18ede9[_0xecde('0x5')](',');}return _0x3a06c2;};exports['filters']=function(_0xbac44e,_0xd1cbd4){var _0x23d55d={};if(!_[_0xecde('0x6')](_0xbac44e)){_[_0xecde('0x7')](_0xbac44e,function(_0x13cfd6,_0x4e4b53){try{if(_0xd1cbd4){var _0x65f564=_['find'](_0xd1cbd4,{'name':_0x4e4b53})||{};if(hasSequelizeOperator(_0x13cfd6)){_0x23d55d[_0x4e4b53]=getOperatorValue(_0x13cfd6);}else if(_0x65f564[_0xecde('0x8')]===_0xecde('0x9')&&_[_0xecde('0xa')](_0x13cfd6)){var _0xdb2529=JSON[_0xecde('0x2')](_0x13cfd6);var _0x46785a={'$gte':moment(moment(_0xdb2529['$gte'])['format'](_0xecde('0xb')))[_0xecde('0xc')]()[_0xecde('0xd')](),'$lte':moment(moment(_0xdb2529[_0xecde('0xe')])['format'](_0xecde('0xb')))[_0xecde('0xc')]()[_0xecde('0xf')](0x1,'s')[_0xecde('0xd')]()};_0x23d55d[_0x4e4b53]=_0x46785a;}else if(_0x65f564['name']===_0xecde('0x10')){_0x23d55d[_0x4e4b53]=_0x13cfd6;}else{_0x23d55d[_0x4e4b53]=_[_0xecde('0x11')](_0x13cfd6)?_0x13cfd6:JSON[_0xecde('0x2')](_0x13cfd6);}}else{_0x23d55d[_0x4e4b53]=_[_0xecde('0x11')](_0x13cfd6)?_0x13cfd6:JSON[_0xecde('0x2')](_0x13cfd6);}}catch(_0x477ab1){_0x23d55d[_0x4e4b53]=_0x13cfd6[_0xecde('0x5')](',');}});}return _0x23d55d;};exports['limit']=function(_0x456abb){_0x456abb=parseInt(_0x456abb,0xa);if(!_0x456abb||_0x456abb<0x0){_0x456abb=LIMIT_VALUE;}return _0x456abb;};exports[_0xecde('0x12')]=function(_0x54e0fb){_0x54e0fb=parseInt(_0x54e0fb,0xa);if(!_0x54e0fb||_0x54e0fb<0x0){_0x54e0fb=0x0;}return _0x54e0fb;};exports[_0xecde('0x13')]=function(_0x1a67f8){var _0x3aee56,_0x5d8afa=null;if(_0x1a67f8){_0x3aee56=_0x1a67f8[_0xecde('0x5')](',');_0x5d8afa=_[_0xecde('0x14')](_0x3aee56,function(_0x195467){if(_0x195467[_0xecde('0x15')]('-')===0x0){return[_0x195467===_0xecde('0x16')?sequelize['cast'](sequelize[_0xecde('0x17')](_0xecde('0x16')),_0xecde('0x18')):_0x195467[_0xecde('0x19')](0x1),'DESC'];}else{return[_0x195467===_0xecde('0x16')?sequelize[_0xecde('0x1a')](sequelize[_0xecde('0x17')](_0xecde('0x16')),_0xecde('0x18')):_0x195467,_0xecde('0x1b')];}});}return _0x5d8afa;};exports['omit']=function(_0x3fdf8a,_0x1d0772){if(_['isEmpty'](_0x3fdf8a)){return _0x3fdf8a;}if(_[_0xecde('0x11')](_0x3fdf8a)){for(var _0x54f6a6=0x0;_0x54f6a6<_0x3fdf8a[_0xecde('0x1c')];_0x54f6a6+=0x1){_0x3fdf8a[_0x54f6a6]=this['omit'](_0x3fdf8a[_0x54f6a6],_0x1d0772);}return _0x3fdf8a;}if(!_['isObject'](_0x3fdf8a)){return _0x3fdf8a;}if(_[_0xecde('0x1d')](_0x1d0772)){_0x1d0772=[_0x1d0772];}if(!_[_0xecde('0x11')](_0x1d0772)){return _0x3fdf8a;}for(var _0xce8cb7=0x0;_0xce8cb7<_0x1d0772[_0xecde('0x1c')];_0xce8cb7+=0x1){_[_0xecde('0x1e')](_0x3fdf8a,_0x1d0772[_0xce8cb7]);}for(var _0x4dd2a4 in _0x3fdf8a){if(_0x3fdf8a[_0xecde('0x1f')](_0x4dd2a4)){_0x3fdf8a[_0x4dd2a4]=this[_0xecde('0x20')](_0x3fdf8a[_0x4dd2a4],_0x1d0772);}}return _0x3fdf8a;};exports[_0xecde('0x21')]=function(_0x1b17af){return _0x1b17af[_0xecde('0x22')](RegExp(_0xecde('0x23')))?!![]:![];};exports[_0xecde('0x24')]=function(_0x3ac8cb){return _0x3ac8cb[_0xecde('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0xecde('0x25')]=function(_0x515918){var _0x102772=[];_0x515918[_0xecde('0x5')](/[ ,]+/)[_0xecde('0x26')](function(_0x284251){_0x284251=_0x284251[_0xecde('0x27')](/([^:]")"+/g,'$1');_0x284251='+'+_0x284251+'*';if(_0x284251[_0xecde('0x3')]('@'))_0x284251='\x22'+_0x284251+'\x22';_0x102772[_0xecde('0x28')](_0x284251);});return _0x102772[_0xecde('0x29')]('\x20');};exports[_0xecde('0x2a')]=function(_0x2488ff,_0x6a758d,_0x426f2e){var _0x475d87={},_0x416adf={};if(_0x6a758d[_0xecde('0x2b')][_0xecde('0x2c')]){_0x6a758d[_0xecde('0x2b')]['id']=_0x6a758d[_0xecde('0x2b')][_0xecde('0x2c')];delete _0x6a758d[_0xecde('0x2b')]['$id'];}_0x475d87[_0xecde('0x2d')]=_[_0xecde('0x14')](_0x2488ff,_0xecde('0x2e'));_0x475d87[_0xecde('0x2b')]=_[_0xecde('0x2f')](_0x6a758d['query']);_0x475d87[_0xecde('0x30')]=_[_0xecde('0x31')](_0x475d87[_0xecde('0x2d')],_0x475d87[_0xecde('0x2b')]);_0x416adf[_0xecde('0x32')]=_[_0xecde('0x31')](_0x475d87[_0xecde('0x2d')],this[_0xecde('0x4')](_0x6a758d[_0xecde('0x2b')][_0xecde('0x4')]));_0x416adf['attributes']=_0x416adf[_0xecde('0x32')][_0xecde('0x1c')]?_0x416adf[_0xecde('0x32')]:_0x475d87['model'];if(!_0x6a758d[_0xecde('0x2b')]['hasOwnProperty']('nolimit')){_0x416adf[_0xecde('0x33')]=this[_0xecde('0x33')](_0x6a758d[_0xecde('0x2b')][_0xecde('0x33')]);_0x416adf[_0xecde('0x12')]=this[_0xecde('0x12')](_0x6a758d[_0xecde('0x2b')][_0xecde('0x12')]);}_0x416adf[_0xecde('0x34')]=this[_0xecde('0x13')](_0x6a758d[_0xecde('0x2b')][_0xecde('0x13')]);_0x416adf[_0xecde('0x35')]=this[_0xecde('0x30')](_[_0xecde('0x36')](_0x6a758d['query'],_0x475d87[_0xecde('0x30')]),_0x2488ff);if(_0x6a758d['query'][_0xecde('0x37')]){_0x416adf[_0xecde('0x35')]=_[_0xecde('0x38')](_0x416adf[_0xecde('0x35')],{'$or':_[_0xecde('0x14')](_0x2488ff,function(_0x3b54b0){if(_0x3b54b0[_0xecde('0x8')]!==_0xecde('0x39')){if(_0x426f2e){return sequelize['where'](sequelize['fn'](_0xecde('0x3a'),sequelize['col'](_0x3b54b0['name'])),{'$like':sequelize['fn'](_0xecde('0x3a'),'%'+_0x6a758d[_0xecde('0x2b')][_0xecde('0x37')]+'%')});}else{var _0x4eb647={};_0x4eb647[_0x3b54b0[_0xecde('0x2e')]]={'$like':'%'+_0x6a758d[_0xecde('0x2b')][_0xecde('0x37')]+'%'};return _0x4eb647;}}})});}_0x416adf=_[_0xecde('0x38')]({},_0x416adf,_0x6a758d[_0xecde('0x3b')]);return _0x416adf;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 65dd938..d14f722 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0056=['cors','moment','../mysqldb','default','get','env','production','set','appPath','join','public','development','test','root','client','use','json\x20replacer','toISOString','split','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','express','serve-favicon','method-override','cookie-parser','errorhandler','passport'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x0056,0x7a));var _0x6005=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x0056[_0x4baae2];return _0x1a2285;};'use strict';var express=require(_0x6005('0x0'));var favicon=require(_0x6005('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x6005('0x2'));var cookieParser=require(_0x6005('0x3'));var errorHandler=require(_0x6005('0x4'));var path=require('path');var passport=require(_0x6005('0x5'));var cors=require(_0x6005('0x6'));var moment=require(_0x6005('0x7'));var config=require('./environment');var db=require(_0x6005('0x8'))['db'];exports[_0x6005('0x9')]=function(_0x27d265){var _0x6c17fa=_0x27d265[_0x6005('0xa')](_0x6005('0xb'));if(_0x6c17fa===_0x6005('0xc')){_0x27d265[_0x6005('0xd')](_0x6005('0xe'),path[_0x6005('0xf')](config['root'],_0x6005('0x10')));}if(_0x6c17fa===_0x6005('0x11')||_0x6c17fa===_0x6005('0x12')){_0x27d265[_0x6005('0xd')](_0x6005('0xe'),path[_0x6005('0xf')](config[_0x6005('0x13')],_0x6005('0x14')));_0x27d265[_0x6005('0x15')](errorHandler());}_0x27d265[_0x6005('0xd')](_0x6005('0x16'),function(_0x5a5fd6,_0xd21b83){if(this[_0x5a5fd6]instanceof Date){_0xd21b83=this[_0x5a5fd6][_0x6005('0x17')]()[_0x6005('0x18')]('.')[0x0]+'Z';}return _0xd21b83;});_0x27d265[_0x6005('0x15')](express['static'](_0x27d265[_0x6005('0xa')](_0x6005('0xe'))));_0x27d265[_0x6005('0xd')]('views',config[_0x6005('0x13')]+'/server/views');_0x27d265[_0x6005('0x19')](_0x6005('0x1a'),require(_0x6005('0x1b'))[_0x6005('0x1c')]);_0x27d265['set'](_0x6005('0x1d'),_0x6005('0x1a'));_0x27d265[_0x6005('0x15')](bodyParser[_0x6005('0x1e')]({'limit':'50mb','extended':!![]}));_0x27d265[_0x6005('0x15')](bodyParser[_0x6005('0x1f')]({'limit':'50mb'}));_0x27d265[_0x6005('0x15')](cors());_0x27d265[_0x6005('0x15')](methodOverride());_0x27d265['use'](cookieParser());_0x27d265[_0x6005('0x15')](passport['initialize']());}; \ No newline at end of file +var _0x0fc6=['cookie-parser','errorhandler','path','passport','cors','moment','env','production','set','root','development','test','join','client','use','json\x20replacer','toISOString','static','get','appPath','/server/views','ejs','renderFile','json','50mb','initialize','express','serve-favicon','body-parser','method-override'];(function(_0x1b7834,_0x16e346){var _0x201862=function(_0x5e0e2c){while(--_0x5e0e2c){_0x1b7834['push'](_0x1b7834['shift']());}};_0x201862(++_0x16e346);}(_0x0fc6,0x92));var _0x60fc=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x0fc6[_0x413feb];return _0x40ee88;};'use strict';var express=require(_0x60fc('0x0'));var favicon=require(_0x60fc('0x1'));var bodyParser=require(_0x60fc('0x2'));var methodOverride=require(_0x60fc('0x3'));var cookieParser=require(_0x60fc('0x4'));var errorHandler=require(_0x60fc('0x5'));var path=require(_0x60fc('0x6'));var passport=require(_0x60fc('0x7'));var cors=require(_0x60fc('0x8'));var moment=require(_0x60fc('0x9'));var config=require('./environment');var db=require('../mysqldb')['db'];exports['default']=function(_0x57b17){var _0x149d73=_0x57b17['get'](_0x60fc('0xa'));if(_0x149d73===_0x60fc('0xb')){_0x57b17[_0x60fc('0xc')]('appPath',path['join'](config[_0x60fc('0xd')],'public'));}if(_0x149d73===_0x60fc('0xe')||_0x149d73===_0x60fc('0xf')){_0x57b17[_0x60fc('0xc')]('appPath',path[_0x60fc('0x10')](config['root'],_0x60fc('0x11')));_0x57b17[_0x60fc('0x12')](errorHandler());}_0x57b17['set'](_0x60fc('0x13'),function(_0x4c8ea3,_0x52ad86){if(this[_0x4c8ea3]instanceof Date){_0x52ad86=this[_0x4c8ea3][_0x60fc('0x14')]()['split']('.')[0x0]+'Z';}return _0x52ad86;});_0x57b17['use'](express[_0x60fc('0x15')](_0x57b17[_0x60fc('0x16')](_0x60fc('0x17'))));_0x57b17[_0x60fc('0xc')]('views',config['root']+_0x60fc('0x18'));_0x57b17['engine']('html',require(_0x60fc('0x19'))[_0x60fc('0x1a')]);_0x57b17[_0x60fc('0xc')]('view\x20engine','html');_0x57b17[_0x60fc('0x12')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x57b17[_0x60fc('0x12')](bodyParser[_0x60fc('0x1b')]({'limit':_0x60fc('0x1c')}));_0x57b17[_0x60fc('0x12')](cors());_0x57b17['use'](methodOverride());_0x57b17[_0x60fc('0x12')](cookieParser());_0x57b17[_0x60fc('0x12')](passport[_0x60fc('0x1d')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 4919b0f..1c6c772 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 _0xc6a8=['filter','family','IPv4','internal','concat','head','mac','address','getFirstInterface','map','model','join','createHash','md5','update','digest','platform','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','ipAddress','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','orderBy','keys'];(function(_0x5a5849,_0x1ab4de){var _0x2bf3bb=function(_0x4dd8c6){while(--_0x4dd8c6){_0x5a5849['push'](_0x5a5849['shift']());}};_0x2bf3bb(++_0x1ab4de);}(_0xc6a8,0xb2));var _0x8c6a=function(_0x50df20,_0x14aba7){_0x50df20=_0x50df20-0x0;var _0x3a1b8d=_0xc6a8[_0x50df20];return _0x3a1b8d;};'use strict';var _=require(_0x8c6a('0x0'));var os=require('os');var crypto=require(_0x8c6a('0x1'));var machine=require(_0x8c6a('0x2'));var exec=require(_0x8c6a('0x3'))[_0x8c6a('0x4')];var config=require(_0x8c6a('0x5'));function getInterfaces(){var _0x537365=[];var _0x27e9bb=os['networkInterfaces']();var _0x291f10=_[_0x8c6a('0x6')](_[_0x8c6a('0x7')](_0x27e9bb));for(var _0x227f0c=0x0;_0x227f0c<_0x291f10['length'];_0x227f0c++){var _0x1e8511=_0x27e9bb[_0x291f10[_0x227f0c]][_0x8c6a('0x8')](function(_0x1a394c){return _0x1a394c[_0x8c6a('0x9')]===_0x8c6a('0xa')&&_0x1a394c[_0x8c6a('0xb')]===![];});_0x537365=_0x537365[_0x8c6a('0xc')](_0x1e8511);}return _0x537365;}function getFirstInterface(){var _0x5213ef=_[_0x8c6a('0xd')](getInterfaces());return{'macAddress':_0x5213ef&&_0x5213ef[_0x8c6a('0xe')]?_0x5213ef[_0x8c6a('0xe')]:'00:00:00:00:00:00','ipAddress':_0x5213ef&&_0x5213ef[_0x8c6a('0xf')]?_0x5213ef[_0x8c6a('0xf')]:'127.0.0.1'};}exports[_0x8c6a('0x10')]=getFirstInterface;function getCPUhash(){var _0x3ffeea=_['orderBy'](os['cpus']()[_0x8c6a('0x11')](function(_0x489dab){return _0x489dab[_0x8c6a('0x12')];}))[_0x8c6a('0x13')](':');return crypto[_0x8c6a('0x14')](_0x8c6a('0x15'))[_0x8c6a('0x16')](_0x3ffeea)[_0x8c6a('0x17')]('hex');}exports['getUuid']=function(){var _0x2b324e=os[_0x8c6a('0x18')]();var _0x2c9ff8=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2c9ff8['test'](config[_0x8c6a('0x19')])){return config[_0x8c6a('0x19')];}else if(_0x2b324e==='win32'){return exec(_0x8c6a('0x1a'),{'encoding':_0x8c6a('0x1b')})['replace']('\x0d\x0a','');}else{var _0x468ac0=getFirstInterface();var _0x3fde5f=getCPUhash();var _0x54e4e1=_0x3fde5f+'|'+os['hostname']()+'|'+_0x468ac0['macAddress']+'|'+_0x468ac0[_0x8c6a('0x1c')];var _0x4bf170=crypto['createHash']('md5')[_0x8c6a('0x16')](_0x54e4e1)[_0x8c6a('0x17')](_0x8c6a('0x1d'));return _0x4bf170[_0x8c6a('0x1e')](0x0,0x8)+'-'+_0x4bf170[_0x8c6a('0x1e')](0x8,0xc)+'-'+_0x4bf170['substring'](0xc,0x10)+'-'+_0x4bf170[_0x8c6a('0x1e')](0x10,0x14)+'-'+_0x4bf170['substring'](0x14);}}; \ No newline at end of file +var _0xa001=['address','getFirstInterface','orderBy','map','join','digest','hex','getUuid','platform','licenseToken','test','win32','replace','ipAddress','createHash','md5','substring','lodash','bimedia-machine-uuid','child_process','networkInterfaces','keys','length','family','IPv4','internal','concat','head','mac'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xa001,0x85));var _0x1a00=function(_0x584073,_0x4ae83e){_0x584073=_0x584073-0x0;var _0x4e4d9e=_0xa001[_0x584073];return _0x4e4d9e;};'use strict';var _=require(_0x1a00('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x1a00('0x1'));var exec=require(_0x1a00('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x14cf01=[];var _0xcde31d=os[_0x1a00('0x3')]();var _0x25923b=_['orderBy'](_[_0x1a00('0x4')](_0xcde31d));for(var _0x596545=0x0;_0x596545<_0x25923b[_0x1a00('0x5')];_0x596545++){var _0x588db6=_0xcde31d[_0x25923b[_0x596545]]['filter'](function(_0x3972f8){return _0x3972f8[_0x1a00('0x6')]===_0x1a00('0x7')&&_0x3972f8[_0x1a00('0x8')]===![];});_0x14cf01=_0x14cf01[_0x1a00('0x9')](_0x588db6);}return _0x14cf01;}function getFirstInterface(){var _0x464334=_[_0x1a00('0xa')](getInterfaces());return{'macAddress':_0x464334&&_0x464334[_0x1a00('0xb')]?_0x464334[_0x1a00('0xb')]:'00:00:00:00:00:00','ipAddress':_0x464334&&_0x464334[_0x1a00('0xc')]?_0x464334[_0x1a00('0xc')]:'127.0.0.1'};}exports[_0x1a00('0xd')]=getFirstInterface;function getCPUhash(){var _0x282e10=_[_0x1a00('0xe')](os['cpus']()[_0x1a00('0xf')](function(_0x9d75aa){return _0x9d75aa['model'];}))[_0x1a00('0x10')](':');return crypto['createHash']('md5')['update'](_0x282e10)[_0x1a00('0x11')](_0x1a00('0x12'));}exports[_0x1a00('0x13')]=function(){var _0x2ae812=os[_0x1a00('0x14')]();var _0x360085=/[0-9a-f-]{36}/;if(config[_0x1a00('0x15')]&&_0x360085[_0x1a00('0x16')](config[_0x1a00('0x15')])){return config[_0x1a00('0x15')];}else if(_0x2ae812===_0x1a00('0x17')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x1a00('0x18')]('\x0d\x0a','');}else{var _0x1d0349=getFirstInterface();var _0x5a5d0a=getCPUhash();var _0x2afe59=_0x5a5d0a+'|'+os['hostname']()+'|'+_0x1d0349['macAddress']+'|'+_0x1d0349[_0x1a00('0x19')];var _0x5a9f8f=crypto[_0x1a00('0x1a')](_0x1a00('0x1b'))['update'](_0x2afe59)[_0x1a00('0x11')](_0x1a00('0x12'));return _0x5a9f8f[_0x1a00('0x1c')](0x0,0x8)+'-'+_0x5a9f8f['substring'](0x8,0xc)+'-'+_0x5a9f8f[_0x1a00('0x1c')](0xc,0x10)+'-'+_0x5a9f8f[_0x1a00('0x1c')](0x10,0x14)+'-'+_0x5a9f8f[_0x1a00('0x1c')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a72c3e6..0336e79 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 _0x4e70=['finally','License','findOrCreate','error','default','util','moment','request-promise','bluebird','../../components/encryptor','./hardware','%s/api/servers/%s/check?version=%s','exports','version','format','GET','then','catch','get','data1','data2','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','message'];(function(_0x1240d8,_0x251fb3){var _0x435c62=function(_0x201307){while(--_0x201307){_0x1240d8['push'](_0x1240d8['shift']());}};_0x435c62(++_0x251fb3);}(_0x4e70,0xb9));var _0x04e7=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x4e70[_0x580647];return _0x5f0792;};'use strict';var util=require(_0x04e7('0x0'));var moment=require(_0x04e7('0x1'));var rp=require(_0x04e7('0x2'));var BPromise=require(_0x04e7('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x04e7('0x4'));var hardware=require(_0x04e7('0x5'));var logger=require('../logger')('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x17b807){return new BPromise(function(_0x5e6aa9,_0x3015ea){var _0x31be12=util['format'](_0x04e7('0x6'),HOST,_0x17b807,module[_0x04e7('0x7')][_0x04e7('0x8')]);if(oldToken){_0x31be12=util[_0x04e7('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x17b807,module[_0x04e7('0x7')][_0x04e7('0x8')],oldToken);}var _0x467217={'uri':_0x31be12,'method':_0x04e7('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x467217)[_0x04e7('0xb')](function(_0x485092){_0x5e6aa9(_0x485092);})[_0x04e7('0xc')](function(_0x3727c7){_0x3015ea(_0x3727c7);});});}function manageLicense(_0x43b189,_0x13c174){var _0x591878=_0x13c174[_0x04e7('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x591878[_0x04e7('0xe')]!==_0x43b189&&!_0x591878[_0x04e7('0xf')]){oldToken=_0x591878[_0x04e7('0xe')];}httpRequest(_0x43b189)[_0x04e7('0xb')](function(_0x33216f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x33216f['active']){isOldTokenSent=![];if(!_0x591878[_0x04e7('0x10')]&&_0x591878[_0x04e7('0x10')]!=_0x33216f[_0x04e7('0x10')]||_0x591878[_0x04e7('0x10')]&&_0x591878['data2']){logger[_0x04e7('0x11')](_0x04e7('0x12'));}if(_0x591878[_0x04e7('0x10')]&&!_0x591878[_0x04e7('0xf')]&&_0x591878[_0x04e7('0x10')]!=_0x33216f[_0x04e7('0x10')]){logger[_0x04e7('0x11')](_0x04e7('0x13'));}if(_0x591878['license']&&!_0x591878['data2']&&_0x591878[_0x04e7('0x10')]==_0x33216f[_0x04e7('0x10')]){return _0x13c174;}return _0x13c174[_0x04e7('0x14')]({'data1':_0x43b189,'data2':null,'license':_0x33216f['license']});}else{if(_0x33216f[_0x04e7('0x10')]||_0x591878[_0x04e7('0x10')]){if(!_0x591878['data2']){if(_0x591878[_0x04e7('0xe')]==_0x43b189){GRAY_PERIOD_REASON='Disabled';logger[_0x04e7('0x11')](_0x04e7('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x04e7('0x11')](_0x04e7('0x16'),_0x591878[_0x04e7('0xe')],_0x43b189);}logger[_0x04e7('0x11')](_0x04e7('0x17'),GRAY_PERIOD_REASON[_0x04e7('0x18')](),moment()[_0x04e7('0x9')]('YYYY-MM-DD\x20HH:mm'));return _0x13c174['update']({'data2':encryptor[_0x04e7('0x19')](moment()[_0x04e7('0x9')](_0x04e7('0x1a')))});}else{if(moment()[_0x04e7('0x1b')](encryptor[_0x04e7('0x1c')](_0x591878[_0x04e7('0xf')]),'days')>DAYS){logger[_0x04e7('0x11')](_0x04e7('0x1d'),moment()[_0x04e7('0x9')](_0x04e7('0x1a')));isOldTokenSent=![];return _0x13c174[_0x04e7('0x14')]({'data1':_0x43b189,'data2':null,'license':null});}}}else{if(_0x591878[_0x04e7('0xe')]!=_0x43b189){logger[_0x04e7('0x11')](_0x04e7('0x16'),_0x591878[_0x04e7('0xe')],_0x43b189);return _0x13c174[_0x04e7('0x14')]({'data1':_0x43b189,'data2':null,'license':null});}}}return _0x13c174;})[_0x04e7('0xb')](function(_0x6ff449){_0x13c174=_0x6ff449;})['catch'](function(_0x33d3dc){logger['error'](_0x33d3dc[_0x04e7('0x1e')]);})[_0x04e7('0x1f')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x13c174);},TIME);});}function defaultLicense(){var _0x1e515a=hardware['getUuid']();if(_0x1e515a){return db[_0x04e7('0x20')][_0x04e7('0x21')]({'where':{'id':0x1},'defaults':{'data1':_0x1e515a}})['spread'](function(_0x5a2464,_0x243855){logger[_0x04e7('0x11')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1e515a);manageLicense(_0x1e515a,_0x5a2464);})[_0x04e7('0xc')](function(_0x4c4370){logger[_0x04e7('0x22')](_0x4c4370[_0x04e7('0x1e')]);});}}exports[_0x04e7('0x23')]=defaultLicense; \ No newline at end of file +var _0x1069=['SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','format','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','findOrCreate','spread'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1069,0x83));var _0x9106=function(_0xb0b719,_0x13e1c1){_0xb0b719=_0xb0b719-0x0;var _0x1e3ce5=_0x1069[_0xb0b719];return _0x1e3ce5;};'use strict';var util=require(_0x9106('0x0'));var moment=require(_0x9106('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x9106('0x2'))(module,_0x9106('0x3'));var db=require(_0x9106('0x4'))['db'];var encryptor=require(_0x9106('0x5'));var hardware=require(_0x9106('0x6'));var logger=require(_0x9106('0x7'))(_0x9106('0x8'));var HOST=_0x9106('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x38b16f){return new BPromise(function(_0x32b6ea,_0x696807){var _0x2d852a=util['format'](_0x9106('0xa'),HOST,_0x38b16f,module[_0x9106('0xb')][_0x9106('0x3')]);if(oldToken){_0x2d852a=util['format'](_0x9106('0xc'),HOST,_0x38b16f,module[_0x9106('0xb')][_0x9106('0x3')],oldToken);}var _0x33b00b={'uri':_0x2d852a,'method':_0x9106('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x33b00b)[_0x9106('0xe')](function(_0x43afc9){_0x32b6ea(_0x43afc9);})[_0x9106('0xf')](function(_0x27496d){_0x696807(_0x27496d);});});}function manageLicense(_0x14455c,_0x38beaf){var _0x4d16e0=_0x38beaf[_0x9106('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4d16e0['data1']!==_0x14455c&&!_0x4d16e0[_0x9106('0x11')]){oldToken=_0x4d16e0[_0x9106('0x12')];}httpRequest(_0x14455c)[_0x9106('0xe')](function(_0x506e54){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x506e54[_0x9106('0x13')]){isOldTokenSent=![];if(!_0x4d16e0[_0x9106('0x8')]&&_0x4d16e0[_0x9106('0x8')]!=_0x506e54['license']||_0x4d16e0['license']&&_0x4d16e0['data2']){logger[_0x9106('0x14')](_0x9106('0x15'));}if(_0x4d16e0[_0x9106('0x8')]&&!_0x4d16e0['data2']&&_0x4d16e0[_0x9106('0x8')]!=_0x506e54[_0x9106('0x8')]){logger[_0x9106('0x14')](_0x9106('0x16'));}if(_0x4d16e0['license']&&!_0x4d16e0[_0x9106('0x11')]&&_0x4d16e0['license']==_0x506e54[_0x9106('0x8')]){return _0x38beaf;}return _0x38beaf[_0x9106('0x17')]({'data1':_0x14455c,'data2':null,'license':_0x506e54[_0x9106('0x8')]});}else{if(_0x506e54[_0x9106('0x8')]||_0x4d16e0[_0x9106('0x8')]){if(!_0x4d16e0[_0x9106('0x11')]){if(_0x4d16e0[_0x9106('0x12')]==_0x14455c){GRAY_PERIOD_REASON='Disabled';logger[_0x9106('0x14')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x9106('0x18');logger[_0x9106('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4d16e0[_0x9106('0x12')],_0x14455c);}logger[_0x9106('0x14')](_0x9106('0x19'),GRAY_PERIOD_REASON[_0x9106('0x1a')](),moment()[_0x9106('0x1b')]('YYYY-MM-DD\x20HH:mm'));return _0x38beaf[_0x9106('0x17')]({'data2':encryptor[_0x9106('0x1c')](moment()[_0x9106('0x1b')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x9106('0x1d')](encryptor[_0x9106('0x1e')](_0x4d16e0[_0x9106('0x11')]),_0x9106('0x1f'))>DAYS){logger[_0x9106('0x14')](_0x9106('0x20'),moment()['format'](_0x9106('0x21')));isOldTokenSent=![];return _0x38beaf[_0x9106('0x17')]({'data1':_0x14455c,'data2':null,'license':null});}}}else{if(_0x4d16e0[_0x9106('0x12')]!=_0x14455c){logger[_0x9106('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4d16e0[_0x9106('0x12')],_0x14455c);return _0x38beaf[_0x9106('0x17')]({'data1':_0x14455c,'data2':null,'license':null});}}}return _0x38beaf;})[_0x9106('0xe')](function(_0x36ba1e){_0x38beaf=_0x36ba1e;})[_0x9106('0xf')](function(_0x2cddca){logger[_0x9106('0x22')](_0x2cddca[_0x9106('0x23')]);})[_0x9106('0x24')](function(){setTimeout(function(){manageLicense(hardware[_0x9106('0x25')](),_0x38beaf);},TIME);});}function defaultLicense(){var _0x5d1236=hardware['getUuid']();if(_0x5d1236){return db[_0x9106('0x26')][_0x9106('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x5d1236}})[_0x9106('0x28')](function(_0x38378d,_0x1fe815){logger[_0x9106('0x14')](_0x9106('0x29'),_0x5d1236);manageLicense(_0x5d1236,_0x38378d);})[_0x9106('0xf')](function(_0x298e9b){logger[_0x9106('0x22')](_0x298e9b['message']);});}}exports[_0x9106('0x2a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 89b89d3..f7907de 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 _0xa126=['Demo\x20license','getUuid','Breaking\x20license','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','uuid','machineUuid','deadline','add','grayReason','changed','disabled','message','User','findAll','sequelize','col','role','admin','user','users','forEach','count','pick','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x209cc0,_0x59bb37){var _0x3c5029=function(_0x39c02f){while(--_0x39c02f){_0x209cc0['push'](_0x209cc0['shift']());}};_0x3c5029(++_0x59bb37);}(_0xa126,0xd7));var _0x6a12=function(_0x5d4d56,_0x1e6c38){_0x5d4d56=_0x5d4d56-0x0;var _0x3b9b73=_0xa126[_0x5d4d56];return _0x3b9b73;};'use strict';var util=require(_0x6a12('0x0'));var _=require('lodash');var moment=require(_0x6a12('0x1'));var BPromise=require('bluebird');var hardware=require(_0x6a12('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x6a12('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6a12('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x6a12('0x5'),'machineUuid':hardware[_0x6a12('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x6a12('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x6a12('0x7'),'machineUuid':hardware[_0x6a12('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1dfcb4){return new BPromise(function(_0x496281,_0x13f3e7){return db['License']['find'](_[_0x6a12('0x8')](_0x1dfcb4,{'raw':!![],'where':{'id':0x1}}))[_0x6a12('0x9')](function(_0x58c95f){return checkLicense(_0x58c95f,null);})[_0x6a12('0x9')](function(_0x3227ed){_0x496281(_0x3227ed);return;})[_0x6a12('0xa')](function(_0x2235a6){_0x13f3e7(_0x2235a6);});});}function checkLicense(_0x4aecd7,_0x50e8ce){if(!_0x4aecd7){demoLicense['uuid']=_0x4aecd7[_0x6a12('0xb')];return demoLicense;}try{var _0x24463f=_0x50e8ce||_0x4aecd7[_0x6a12('0xc')];if(_[_0x6a12('0xd')](_0x24463f)){throw new Error(_0x6a12('0xe'));}var _0x2146ab=_0x4aecd7[_0x6a12('0xb')];var _0x319337=_0x4aecd7[_0x6a12('0xf')];var _0x3280b3=_0x2146ab[_0x6a12('0x10')]('-')[0x4];var _0x284ff8=_0x2146ab['split']('-')[0x0];var _0x476c1e=encryptor[_0x6a12('0x11')](_0x24463f,util[_0x6a12('0x12')](_0x6a12('0x13'),_0x3280b3,_0x2146ab,_0x284ff8));var _0x185213=JSON[_0x6a12('0x14')](_0x476c1e);_0x185213[_0x6a12('0x15')]=![];_0x185213[_0x6a12('0x16')]=_0x2146ab;_0x185213[_0x6a12('0x17')]=hardware['getUuid']();if(_0x319337){var _0x4d0583=encryptor[_0x6a12('0x11')](_0x319337);_0x185213['gray']=_0x4d0583;_0x185213[_0x6a12('0x18')]=moment(_0x4d0583)[_0x6a12('0x19')](0x7,'days')[_0x6a12('0x12')]();_0x185213[_0x6a12('0x1a')]=_0x185213['uuid']!=_0x185213['machineUuid']?_0x6a12('0x1b'):_0x6a12('0x1c');}return _0x185213;}catch(_0x2d824e){breakingLicense['uuid']=_0x4aecd7[_0x6a12('0xb')];breakingLicense[_0x6a12('0x1d')]=_0x2d824e[_0x6a12('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xba955,_0x80f0b7){getLicense()[_0x6a12('0x9')](function(_0x5a63a0){return db[_0x6a12('0x1e')][_0x6a12('0x1f')]({'attributes':['role',[db[_0x6a12('0x20')]['fn']('COUNT',db['sequelize'][_0x6a12('0x21')]('role')),'count']],'group':_0x6a12('0x22'),'where':{'role':{'$or':[_0x6a12('0x23'),_0x6a12('0x24'),'telephone']}},'raw':!![]})[_0x6a12('0x9')](function(_0x550819){var _0x360d01={'user':_0x5a63a0[_0x6a12('0x25')]||0x0,'telephone':_0x5a63a0['telephones']||0x0};_0x550819[_0x6a12('0x26')](function(_0x38020f){var _0x509dff=_0x38020f['role']===_0x6a12('0x23')?_0x6a12('0x24'):_0x38020f[_0x6a12('0x22')];_0x360d01[_0x509dff]-=_0x38020f[_0x6a12('0x27')];if(_0x360d01[_0x509dff]<0x0)_0x360d01[_0x509dff]=0x0;});_0xba955(_0x360d01);return;});})[_0x6a12('0xa')](function(_0x2002e3){_0x80f0b7(_0x2002e3);});});}function checkUserLimits(_0x37a0bb){return new BPromise(function(_0x42987f,_0x424f08){getLimits()[_0x6a12('0x9')](function(_0x24d9c6){var _0x2577d1=_[_0x6a12('0x28')](_['countBy'](_0x37a0bb,_0x6a12('0x22')),[_0x6a12('0x23'),_0x6a12('0x24'),_0x6a12('0x29')]);var _0x195312=(_0x2577d1[_0x6a12('0x23')]||0x0)+(_0x2577d1[_0x6a12('0x24')]||0x0);var _0x461da2=_0x2577d1[_0x6a12('0x29')]||0x0;if(_0x195312>_0x24d9c6[_0x6a12('0x24')])return _0x424f08('License\x20limit\x20reached\x20for\x20users');if(_0x461da2>_0x24d9c6[_0x6a12('0x29')])return _0x424f08(_0x6a12('0x2a'));return _0x42987f();})[_0x6a12('0xa')](function(_0x5a11d7){_0x424f08(_0x5a11d7);});});}module[_0x6a12('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4522=['License','find','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','days','grayReason','changed','disabled','message','findAll','role','sequelize','COUNT','col','count','user','users','telephones','forEach','admin','pick','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x4522,0x111));var _0x2452=function(_0x107e8b,_0x37438f){_0x107e8b=_0x107e8b-0x0;var _0x1a39af=_0x4522[_0x107e8b];return _0x1a39af;};'use strict';var util=require(_0x2452('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x2452('0x1'));var hardware=require(_0x2452('0x2'));var encryptor=require(_0x2452('0x3'));var db=require(_0x2452('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2452('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2452('0x6'),'machineUuid':hardware[_0x2452('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2452('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2452('0x8'),'machineUuid':hardware[_0x2452('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x32ed13){return new BPromise(function(_0x4f3314,_0x262832){return db[_0x2452('0x9')][_0x2452('0xa')](_['defaults'](_0x32ed13,{'raw':!![],'where':{'id':0x1}}))[_0x2452('0xb')](function(_0x272365){return checkLicense(_0x272365,null);})[_0x2452('0xb')](function(_0x19e0d7){_0x4f3314(_0x19e0d7);return;})[_0x2452('0xc')](function(_0x5c0cc9){_0x262832(_0x5c0cc9);});});}function checkLicense(_0x5dddb9,_0x7b2ae6){if(!_0x5dddb9){demoLicense[_0x2452('0xd')]=_0x5dddb9[_0x2452('0xe')];return demoLicense;}try{var _0xbada97=_0x7b2ae6||_0x5dddb9[_0x2452('0xf')];if(_['isEmpty'](_0xbada97)){throw new Error(_0x2452('0x10'));}var _0x51e92e=_0x5dddb9['data1'];var _0x2312b2=_0x5dddb9[_0x2452('0x11')];var _0x5b0a7d=_0x51e92e[_0x2452('0x12')]('-')[0x4];var _0x218f15=_0x51e92e[_0x2452('0x12')]('-')[0x0];var _0x57308c=encryptor[_0x2452('0x13')](_0xbada97,util[_0x2452('0x14')](_0x2452('0x15'),_0x5b0a7d,_0x51e92e,_0x218f15));var _0x4f5f56=JSON[_0x2452('0x16')](_0x57308c);_0x4f5f56[_0x2452('0x17')]=![];_0x4f5f56['uuid']=_0x51e92e;_0x4f5f56[_0x2452('0x18')]=hardware[_0x2452('0x7')]();if(_0x2312b2){var _0x1fa6ee=encryptor[_0x2452('0x13')](_0x2312b2);_0x4f5f56[_0x2452('0x19')]=_0x1fa6ee;_0x4f5f56[_0x2452('0x1a')]=moment(_0x1fa6ee)['add'](0x7,_0x2452('0x1b'))[_0x2452('0x14')]();_0x4f5f56[_0x2452('0x1c')]=_0x4f5f56[_0x2452('0xd')]!=_0x4f5f56[_0x2452('0x18')]?_0x2452('0x1d'):_0x2452('0x1e');}return _0x4f5f56;}catch(_0x3de862){breakingLicense[_0x2452('0xd')]=_0x5dddb9[_0x2452('0xe')];breakingLicense[_0x2452('0x1f')]=_0x3de862[_0x2452('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5b2a89,_0x4b613d){getLicense()[_0x2452('0xb')](function(_0x158e9e){return db['User'][_0x2452('0x20')]({'attributes':[_0x2452('0x21'),[db[_0x2452('0x22')]['fn'](_0x2452('0x23'),db[_0x2452('0x22')][_0x2452('0x24')](_0x2452('0x21'))),_0x2452('0x25')]],'group':_0x2452('0x21'),'where':{'role':{'$or':['admin',_0x2452('0x26'),'telephone']}},'raw':!![]})[_0x2452('0xb')](function(_0x24f96c){var _0x574bc3={'user':_0x158e9e[_0x2452('0x27')]||0x0,'telephone':_0x158e9e[_0x2452('0x28')]||0x0};_0x24f96c[_0x2452('0x29')](function(_0x3c7e06){var _0x88497=_0x3c7e06[_0x2452('0x21')]===_0x2452('0x2a')?_0x2452('0x26'):_0x3c7e06['role'];_0x574bc3[_0x88497]-=_0x3c7e06[_0x2452('0x25')];if(_0x574bc3[_0x88497]<0x0)_0x574bc3[_0x88497]=0x0;});_0x5b2a89(_0x574bc3);return;});})[_0x2452('0xc')](function(_0x2e31ba){_0x4b613d(_0x2e31ba);});});}function checkUserLimits(_0xe90101){return new BPromise(function(_0x3dcd99,_0x206655){getLimits()['then'](function(_0x243dca){var _0x1b879c=_[_0x2452('0x2b')](_['countBy'](_0xe90101,_0x2452('0x21')),['admin','user',_0x2452('0x2c')]);var _0x555920=(_0x1b879c[_0x2452('0x2a')]||0x0)+(_0x1b879c[_0x2452('0x26')]||0x0);var _0x5d8ef4=_0x1b879c[_0x2452('0x2c')]||0x0;if(_0x555920>_0x243dca['user'])return _0x206655('License\x20limit\x20reached\x20for\x20users');if(_0x5d8ef4>_0x243dca[_0x2452('0x2c')])return _0x206655(_0x2452('0x2d'));return _0x3dcd99();})[_0x2452('0xc')](function(_0x308d8e){_0x206655(_0x308d8e);});});}module[_0x2452('0x2e')]={'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 a9a5102..a919f7e 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 _0x3266=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x3c8f44,_0x4799d1){var _0x773ffc=function(_0x4f6668){while(--_0x4f6668){_0x3c8f44['push'](_0x3c8f44['shift']());}};_0x773ffc(++_0x4799d1);}(_0x3266,0x6a));var _0x6326=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x3266[_0x46e363];return _0x3fb059;};'use strict';module[_0x6326('0x0')]={'DOMAIN':_0x6326('0x1'),'SESSION_SECRET':_0x6326('0x2'),'GOOGLE_ID':_0x6326('0x3'),'GOOGLE_SECRET':_0x6326('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xe5af=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x363e05,_0x1a3797){var _0x5ea244=function(_0x4a9c3d){while(--_0x4a9c3d){_0x363e05['push'](_0x363e05['shift']());}};_0x5ea244(++_0x1a3797);}(_0xe5af,0x9c));var _0xfe5a=function(_0x4cb8de,_0x5235ab){_0x4cb8de=_0x4cb8de-0x0;var _0x11c2b9=_0xe5af[_0x4cb8de];return _0x11c2b9;};'use strict';module['exports']={'DOMAIN':_0xfe5a('0x0'),'SESSION_SECRET':_0xfe5a('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfe5a('0x2'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 9717ea6..bb785b4 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07b8=['xcally','%s-%s.log','message','replace','{{{','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','File','%s-%s','error','transports','info','env','debugLevel','winston','util','path','INFO','join','/var','log'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x07b8,0xc1));var _0x807b=function(_0x102fa1,_0x13d678){_0x102fa1=_0x102fa1-0x0;var _0x2c54ac=_0x07b8[_0x102fa1];return _0x2c54ac;};'use strict';var moment=require('moment');var winston=require(_0x807b('0x0'));var util=require(_0x807b('0x1'));var path=require(_0x807b('0x2'));var debugLevel=_0x807b('0x3');function filename(_0x352452,_0x5e4b43){return path[_0x807b('0x4')](_0x807b('0x5'),_0x807b('0x6'),_0x807b('0x7'),util['format'](_0x807b('0x8'),_0x352452,_0x5e4b43));}function formatter(_0x1bc1c2,_0x4020e2){_0x4020e2[_0x807b('0x9')]=_0x4020e2[_0x807b('0x9')][_0x807b('0xa')](/@@{/g,_0x807b('0xb'))[_0x807b('0xa')](/}@@/g,'}}}')[_0x807b('0xa')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x807b('0xc')](_0x807b('0xd'),moment()['format'](_0x807b('0xe')),_0x4020e2[_0x807b('0xf')]['toUpperCase'](),_0x1bc1c2,_0x4020e2[_0x807b('0x9')]);}module[_0x807b('0x10')]=function(_0x1e2f30){return new winston[(_0x807b('0x11'))]({'transports':[new winston['transports'][(_0x807b('0x12'))]({'name':util['format'](_0x807b('0x13'),_0x1e2f30,_0x807b('0x14')),'filename':filename(_0x1e2f30,_0x807b('0x14')),'level':_0x807b('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd3a3df){return formatter(_0x1e2f30,_0xd3a3df);}}),new winston[(_0x807b('0x15'))][(_0x807b('0x12'))]({'name':util['format'](_0x807b('0x13'),_0x1e2f30,'info'),'filename':filename(_0x1e2f30,_0x807b('0x16')),'level':_0x807b('0x16'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x143426){return formatter(_0x1e2f30,_0x143426);}}),new winston['transports']['Console']({'level':process[_0x807b('0x17')][_0x807b('0x18')]||debugLevel,'json':![],'formatter':function(_0x1b8d79){return formatter(_0x1e2f30,_0x1b8d79);}})]});}; \ No newline at end of file +var _0xd948=['join','log','xcally','format','%s-%s.log','message','{{{','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','Logger','File','%s-%s','error','transports','info','env','debugLevel','winston','util','path','INFO'];(function(_0x549b10,_0x3e5114){var _0x116a46=function(_0x537acd){while(--_0x537acd){_0x549b10['push'](_0x549b10['shift']());}};_0x116a46(++_0x3e5114);}(_0xd948,0xa4));var _0x8d94=function(_0x2717f4,_0xe236c5){_0x2717f4=_0x2717f4-0x0;var _0x6b0f9=_0xd948[_0x2717f4];return _0x6b0f9;};'use strict';var moment=require('moment');var winston=require(_0x8d94('0x0'));var util=require(_0x8d94('0x1'));var path=require(_0x8d94('0x2'));var debugLevel=_0x8d94('0x3');function filename(_0x448a92,_0x1cb1bf){return path[_0x8d94('0x4')]('/var',_0x8d94('0x5'),_0x8d94('0x6'),util[_0x8d94('0x7')](_0x8d94('0x8'),_0x448a92,_0x1cb1bf));}function formatter(_0x441be8,_0x1ff785){_0x1ff785[_0x8d94('0x9')]=_0x1ff785['message']['replace'](/@@{/g,_0x8d94('0xa'))[_0x8d94('0xb')](/}@@/g,'}}}')[_0x8d94('0xb')](/@{/g,'{{')[_0x8d94('0xb')](/}@/g,'}}');return util[_0x8d94('0x7')](_0x8d94('0xc'),moment()[_0x8d94('0x7')](_0x8d94('0xd')),_0x1ff785[_0x8d94('0xe')][_0x8d94('0xf')](),_0x441be8,_0x1ff785['message']);}module['exports']=function(_0x1e5c87){return new winston[(_0x8d94('0x10'))]({'transports':[new winston['transports'][(_0x8d94('0x11'))]({'name':util['format'](_0x8d94('0x12'),_0x1e5c87,_0x8d94('0x13')),'filename':filename(_0x1e5c87,_0x8d94('0x13')),'level':_0x8d94('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1e36db){return formatter(_0x1e5c87,_0x1e36db);}}),new winston[(_0x8d94('0x14'))][(_0x8d94('0x11'))]({'name':util['format'](_0x8d94('0x12'),_0x1e5c87,_0x8d94('0x15')),'filename':filename(_0x1e5c87,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x98f481){return formatter(_0x1e5c87,_0x98f481);}}),new winston['transports']['Console']({'level':process[_0x8d94('0x16')][_0x8d94('0x17')]||debugLevel,'json':![],'formatter':function(_0x55b752){return formatter(_0x1e5c87,_0x55b752);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 94d3186..d1c0175 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 _0x0a9f=['express','../../services/express/index.js','ami','join','../../services/email/index.js','xdr','../../services/xdr/index.js','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x0a9f,0x150));var _0xf0a9=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0x0a9f[_0x56825b];return _0x69ce77;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xf0a9('0x0'),'script':path['join'](__dirname,_0xf0a9('0x1'))},{'name':_0xf0a9('0x2'),'script':path[_0xf0a9('0x3')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0xf0a9('0x3')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0xf0a9('0x3')](__dirname,_0xf0a9('0x4'))},{'name':'routing','script':path[_0xf0a9('0x3')](__dirname,'../../services/routing/index.js')},{'name':_0xf0a9('0x5'),'script':path['join'](__dirname,_0xf0a9('0x6'))}]};module[_0xf0a9('0x7')]=config; \ No newline at end of file +var _0x41b0=['../../services/xdr/index.js','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/email/index.js','../../services/routing/index.js','xdr'];(function(_0x355535,_0x1e2607){var _0x2a4242=function(_0x3165b5){while(--_0x3165b5){_0x355535['push'](_0x355535['shift']());}};_0x2a4242(++_0x1e2607);}(_0x41b0,0x8e));var _0x041b=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0x41b0[_0xe5b349];return _0x26b0ad;};'use strict';var path=require(_0x041b('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x041b('0x1')](__dirname,_0x041b('0x2'))},{'name':_0x041b('0x3'),'script':path[_0x041b('0x1')](__dirname,_0x041b('0x4'))},{'name':'agi','script':path[_0x041b('0x1')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path['join'](__dirname,_0x041b('0x5'))},{'name':'routing','script':path[_0x041b('0x1')](__dirname,_0x041b('0x6'))},{'name':_0x041b('0x7'),'script':path[_0x041b('0x1')](__dirname,_0x041b('0x8'))}]};module[_0x041b('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index c77b332..2c2d5c5 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 _0x9d17=['list','describe','delete','dump','saved','pm2','start','then','disconnect','stop','restart'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x9d17,0x139));var _0x79d1=function(_0x62bc17,_0x236ee9){_0x62bc17=_0x62bc17-0x0;var _0x76cf0c=_0x9d17[_0x62bc17];return _0x76cf0c;};'use strict';var pm2=require(_0x79d1('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x1e1917,_0x4bbdbf){return pm2['connect'](function(_0xf958ec){if(_0xf958ec){return _0x4bbdbf(_0xf958ec);}return _0x1e1917('connected');});});};exports[_0x79d1('0x1')]=function(_0xefc0e6){return connect()[_0x79d1('0x2')](function(){return new BPromise(function(_0x2ae522,_0x47d7fd){return pm2[_0x79d1('0x1')](_0xefc0e6,function(_0x29c350,_0x191886){if(_0x29c350){return _0x47d7fd(_0x29c350);}pm2[_0x79d1('0x3')]();return _0x2ae522(_0x191886);});});});};exports[_0x79d1('0x4')]=function(_0x3076c0){return connect()[_0x79d1('0x2')](function(){return new BPromise(function(_0x20efda,_0x158869){return pm2['stop'](_0x3076c0,function(_0x32eec3,_0x295139){if(_0x32eec3){return _0x158869(_0x32eec3);}pm2['disconnect']();return _0x20efda(_0x295139);});});});};exports[_0x79d1('0x5')]=function(_0x27e797){return connect()['then'](function(){return new BPromise(function(_0x4371b2,_0x2217b4){return pm2[_0x79d1('0x5')](_0x27e797,function(_0x2915a4,_0x18e41a){if(_0x2915a4){return _0x2217b4(_0x2915a4);}pm2[_0x79d1('0x3')]();return _0x4371b2(_0x18e41a);});});});};exports[_0x79d1('0x6')]=function(){return connect()[_0x79d1('0x2')](function(){return new BPromise(function(_0x1a8c84,_0x2f99a9){return pm2[_0x79d1('0x6')](function(_0x59d535,_0x4eb0a6){if(_0x59d535){return _0x2f99a9(_0x59d535);}pm2[_0x79d1('0x3')]();return _0x1a8c84(_0x4eb0a6);});});});};exports[_0x79d1('0x7')]=function(_0x1898f6){return connect()[_0x79d1('0x2')](function(){return new BPromise(function(_0x14ffb5,_0x136a29){return pm2[_0x79d1('0x7')](_0x1898f6,function(_0x5a582d,_0x163831){if(_0x5a582d){return _0x136a29(_0x5a582d);}pm2[_0x79d1('0x3')]();return _0x14ffb5(_0x163831);});});});};exports[_0x79d1('0x8')]=function(_0x559db0){return connect()[_0x79d1('0x2')](function(){return new BPromise(function(_0x1c9111,_0x37ef85){return pm2[_0x79d1('0x8')](_0x559db0,function(_0x55aa3e,_0x162f30){if(_0x55aa3e){return _0x37ef85(_0x55aa3e);}pm2[_0x79d1('0x3')]();return _0x1c9111(_0x162f30);});});});};exports[_0x79d1('0x9')]=function(){return connect()[_0x79d1('0x2')](function(){return new BPromise(function(_0x23abc6,_0xdc8a78){return pm2[_0x79d1('0x9')](function(_0xc5f202){if(_0xc5f202){return _0xdc8a78(_0xc5f202);}return _0x23abc6(_0x79d1('0xa'));});});});}; \ No newline at end of file +var _0x3aa0=['connected','start','stop','then','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x3aa0,0x169));var _0x03aa=function(_0x23a757,_0x52cb59){_0x23a757=_0x23a757-0x0;var _0x27d871=_0x3aa0[_0x23a757];return _0x27d871;};'use strict';var pm2=require(_0x03aa('0x0'));var BPromise=require(_0x03aa('0x1'));var config=require(_0x03aa('0x2'));function connect(){return new BPromise(function(_0x2af2dc,_0x4d48cf){return pm2['connect'](function(_0x4d073a){if(_0x4d073a){return _0x4d48cf(_0x4d073a);}return _0x2af2dc(_0x03aa('0x3'));});});};exports[_0x03aa('0x4')]=function(_0x40100d){return connect()['then'](function(){return new BPromise(function(_0x1b8065,_0x28fc62){return pm2[_0x03aa('0x4')](_0x40100d,function(_0x41d876,_0x59abdd){if(_0x41d876){return _0x28fc62(_0x41d876);}pm2['disconnect']();return _0x1b8065(_0x59abdd);});});});};exports[_0x03aa('0x5')]=function(_0x86d79b){return connect()[_0x03aa('0x6')](function(){return new BPromise(function(_0x1cda13,_0x2bd0c6){return pm2[_0x03aa('0x5')](_0x86d79b,function(_0xb1d2d0,_0x2efad5){if(_0xb1d2d0){return _0x2bd0c6(_0xb1d2d0);}pm2[_0x03aa('0x7')]();return _0x1cda13(_0x2efad5);});});});};exports[_0x03aa('0x8')]=function(_0x28fd65){return connect()[_0x03aa('0x6')](function(){return new BPromise(function(_0x23a697,_0x3a7525){return pm2[_0x03aa('0x8')](_0x28fd65,function(_0x1bd30a,_0x12ca4a){if(_0x1bd30a){return _0x3a7525(_0x1bd30a);}pm2[_0x03aa('0x7')]();return _0x23a697(_0x12ca4a);});});});};exports['list']=function(){return connect()[_0x03aa('0x6')](function(){return new BPromise(function(_0x1bf518,_0x11288a){return pm2[_0x03aa('0x9')](function(_0x347f81,_0x22d9ef){if(_0x347f81){return _0x11288a(_0x347f81);}pm2['disconnect']();return _0x1bf518(_0x22d9ef);});});});};exports['describe']=function(_0x3ce902){return connect()[_0x03aa('0x6')](function(){return new BPromise(function(_0x3f1551,_0x2dbc7f){return pm2[_0x03aa('0xa')](_0x3ce902,function(_0x548c36,_0x18d83a){if(_0x548c36){return _0x2dbc7f(_0x548c36);}pm2['disconnect']();return _0x3f1551(_0x18d83a);});});});};exports['delete']=function(_0x2778f8){return connect()[_0x03aa('0x6')](function(){return new BPromise(function(_0x27db53,_0x4fa6d7){return pm2[_0x03aa('0xb')](_0x2778f8,function(_0x44b0a6,_0x3e194e){if(_0x44b0a6){return _0x4fa6d7(_0x44b0a6);}pm2[_0x03aa('0x7')]();return _0x27db53(_0x3e194e);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x19491c,_0x18dba2){return pm2[_0x03aa('0xc')](function(_0x403437){if(_0x403437){return _0x18dba2(_0x403437);}return _0x19491c(_0x03aa('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index a886f4b..34f2224 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 _0xb4fd=['YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','lodash','moment','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout','findAll','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format'];(function(_0x205b9d,_0x3543d6){var _0x148ff1=function(_0x2e1092){while(--_0x2e1092){_0x205b9d['push'](_0x205b9d['shift']());}};_0x148ff1(++_0x3543d6);}(_0xb4fd,0x1b4));var _0xdb4f=function(_0x26abc3,_0x28f5e8){_0x26abc3=_0x26abc3-0x0;var _0x1ce64d=_0xb4fd[_0x26abc3];return _0x1ce64d;};'use strict';var _=require(_0xdb4f('0x0'));var moment=require(_0xdb4f('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xdb4f('0x2'));var db=require(_0xdb4f('0x3'))['db'];var logger=require(_0xdb4f('0x4'))(_0xdb4f('0x5'));config['redis']=_['defaults'](config[_0xdb4f('0x6')],{'host':_0xdb4f('0x7'),'port':0x18eb});var io=require(_0xdb4f('0x8'))(new Redis(config[_0xdb4f('0x6')]));function closeInteractions(){var _0x993196=0x0;var _0x1c6973=[];return db[_0xdb4f('0x9')][_0xdb4f('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xdb4f('0xb')](function(_0xa54bcb){_0x993196=_0xa54bcb[_0xdb4f('0xc')];if(_0x993196){return db['ChatInteraction'][_0xdb4f('0xd')]({'raw':!![],'attributes':['id',_0xdb4f('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xdb4f('0xf')](_0xa54bcb['chatTimeout'],_0xdb4f('0x10'))}}});}else{return[];}})[_0xdb4f('0xb')](function(_0x5b0ba8){if(_0x5b0ba8&&_0x5b0ba8['length']){_0x1c6973=_[_0xdb4f('0x11')](_0x5b0ba8||[],'id');logger[_0xdb4f('0x12')](_0xdb4f('0x13'),_0x1c6973[_0xdb4f('0x14')]());return db[_0xdb4f('0x15')][_0xdb4f('0x16')]({'closeReason':_0xdb4f('0x17'),'disposition':_0xdb4f('0x18'),'closed':!![],'closedAt':moment()[_0xdb4f('0x19')](_0xdb4f('0x1a'))},{'where':{'id':_0x1c6973}});}})[_0xdb4f('0xb')](function(){if(_0x1c6973&&_0x1c6973[_0xdb4f('0x1b')]){logger[_0xdb4f('0x12')](_0xdb4f('0x1c'),_0x1c6973[_0xdb4f('0x14')]());for(var _0x3cc580=0x0;_0x3cc580<_0x1c6973[_0xdb4f('0x1b')];_0x3cc580++){io[_0xdb4f('0x1d')]('chatInteraction:update',{'id':_0x1c6973[_0x3cc580],'closed':!![]});}}})[_0xdb4f('0x1e')](function(_0x1defcc){logger[_0xdb4f('0x1f')](_0xdb4f('0x20'),_0x1defcc?util['inspect'](_0x1defcc,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xad07=['lodash','ioredis','util','../../mysqldb','../logger','redis','defaults','socket.io-emitter','Setting','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start'];(function(_0x5db313,_0x3c8f0c){var _0x36d503=function(_0x5d1ff6){while(--_0x5d1ff6){_0x5db313['push'](_0x5db313['shift']());}};_0x36d503(++_0x3c8f0c);}(_0xad07,0x1a4));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ad0('0x0'));var moment=require('moment');var Redis=require(_0x7ad0('0x1'));var util=require(_0x7ad0('0x2'));var config=require('../../config/environment');var db=require(_0x7ad0('0x3'))['db'];var logger=require(_0x7ad0('0x4'))('schedule');config[_0x7ad0('0x5')]=_[_0x7ad0('0x6')](config[_0x7ad0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x7ad0('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x4de342=0x0;var _0x3a5eae=[];return db[_0x7ad0('0x8')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x7ad0('0x9')](function(_0x517d64){_0x4de342=_0x517d64[_0x7ad0('0xa')];if(_0x4de342){return db[_0x7ad0('0xb')][_0x7ad0('0xc')]({'raw':!![],'attributes':['id',_0x7ad0('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7ad0('0xe')](_0x517d64[_0x7ad0('0xa')],_0x7ad0('0xf'))}}});}else{return[];}})[_0x7ad0('0x9')](function(_0x28dbdc){if(_0x28dbdc&&_0x28dbdc[_0x7ad0('0x10')]){_0x3a5eae=_[_0x7ad0('0x11')](_0x28dbdc||[],'id');logger[_0x7ad0('0x12')](_0x7ad0('0x13'),_0x3a5eae[_0x7ad0('0x14')]());return db[_0x7ad0('0xb')][_0x7ad0('0x15')]({'closeReason':_0x7ad0('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x7ad0('0x17')](_0x7ad0('0x18'))},{'where':{'id':_0x3a5eae}});}})['then'](function(){if(_0x3a5eae&&_0x3a5eae[_0x7ad0('0x10')]){logger[_0x7ad0('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3a5eae[_0x7ad0('0x14')]());for(var _0x5de2c7=0x0;_0x5de2c7<_0x3a5eae[_0x7ad0('0x10')];_0x5de2c7++){io['emit'](_0x7ad0('0x19'),{'id':_0x3a5eae[_0x5de2c7],'closed':!![]});}}})['catch'](function(_0x28fa16){logger[_0x7ad0('0x1a')](_0x7ad0('0x1b'),_0x28fa16?util[_0x7ad0('0x1c')](_0x28fa16,{'showHidden':![],'depth':null}):'');});}exports[_0x7ad0('0x1d')]=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 ff39c08..37cfd6e 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 _0xbe6a=['scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','index','my\x20id','resolve','cron','active','isBetween','startAt','start','add\x20cron','stop\x20cron','endAt','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','email','Report\x20%s\x20last\x20%s\x20%s','name','subtractUnit','join','../../files/reports','extname','savename','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','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xbe6a,0x187));var _0xabe6=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xbe6a[_0x17928f];return _0x500b63;};'use strict';var fs=require('fs');var util=require(_0xabe6('0x0'));var path=require(_0xabe6('0x1'));var _=require(_0xabe6('0x2'));var moment=require(_0xabe6('0x3'));var CronJobManager=require(_0xabe6('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0xabe6('0x5'));var logger=require(_0xabe6('0x6'))(_0xabe6('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xabe6('0x8'));var analyticDefaultReportController=require(_0xabe6('0x9'));var client=jayson[_0xabe6('0xa')][_0xabe6('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x156ed0,_0x14b19f){return function(){logger['info']('Try\x20to\x20send\x20a\x20mail\x20to',_0x156ed0['email']);var _0x47297f=!![];var _0x4ce03f={'tls':{'rejectUnauthorized':![]}};if(_0x156ed0[_0xabe6('0xc')]['Smtp']['service']){_0x4ce03f[_0xabe6('0xd')]=_0x156ed0[_0xabe6('0xc')]['Smtp'][_0xabe6('0xd')];}else{_0x4ce03f['host']=_0x156ed0[_0xabe6('0xc')][_0xabe6('0xe')][_0xabe6('0xf')];_0x4ce03f[_0xabe6('0x10')]=_0x156ed0[_0xabe6('0xc')][_0xabe6('0xe')][_0xabe6('0x10')];_0x4ce03f[_0xabe6('0x11')]=_0x156ed0[_0xabe6('0xc')][_0xabe6('0xe')][_0xabe6('0x11')];}if(_0x156ed0[_0xabe6('0xc')][_0xabe6('0xe')][_0xabe6('0x12')]){_0x4ce03f[_0xabe6('0x13')]={'user':_0x156ed0[_0xabe6('0xc')][_0xabe6('0xe')][_0xabe6('0x14')],'pass':_0x156ed0[_0xabe6('0xc')]['Smtp'][_0xabe6('0x15')]};}var _0x1f5207={'account':_0x4ce03f,'message':{'from':util[_0xabe6('0x16')](_0xabe6('0x17'),_0x156ed0[_0xabe6('0xc')]['name'],_0x156ed0[_0xabe6('0xc')][_0xabe6('0x18')]||_0x156ed0['MailAccount']['Smtp'][_0xabe6('0x14')]),'to':_0x156ed0['email'],'cc':_0x156ed0['cc'],'bcc':_0x156ed0['bcc'],'subject':util['format'](_0xabe6('0x19'),_0x14b19f[_0xabe6('0x1a')],_0x156ed0['subtractNumber'],_0x156ed0[_0xabe6('0x1b')])}};var _0x40b32b=path[_0xabe6('0x1c')](__dirname,_0xabe6('0x1d'));var _0x5e923b=_0x14b19f['savename'];var _0x100d46=util[_0xabe6('0x16')]('%s.%s',path['basename'](_0x14b19f['savename'],path[_0xabe6('0x1e')](_0x14b19f[_0xabe6('0x1f')])),'zip');var _0x27519b=path[_0xabe6('0x1c')](_0x40b32b,_0x5e923b);var _0x4e5e0e=path['join'](_0x40b32b,_0x100d46);if(fs['existsSync'](_0x27519b)){_0x14b19f['status']=_0xabe6('0x20');_0x1f5207[_0xabe6('0x21')][_0xabe6('0x22')]=[{'filename':_0x5e923b,'path':_0x27519b}];_0x1f5207[_0xabe6('0x21')][_0xabe6('0x23')]=util[_0xabe6('0x16')](_0xabe6('0x24'),JSON[_0xabe6('0x25')](_0x14b19f,null,0x2));}else if(fs['existsSync'](_0x4e5e0e)){_0x14b19f[_0xabe6('0x26')]=_0xabe6('0x20');_0x1f5207[_0xabe6('0x21')][_0xabe6('0x22')]=[{'filename':_0x100d46,'path':_0x4e5e0e}];}else{_0x1f5207[_0xabe6('0x21')][_0xabe6('0x23')]=_0xabe6('0x27');if(!_0x156ed0[_0xabe6('0x28')]){_0x47297f=![];logger[_0xabe6('0x29')](_0xabe6('0x2a'));}}if(_0x47297f){return client[_0xabe6('0x2b')](_0xabe6('0x2c'),_0x1f5207)[_0xabe6('0x2d')](function(_0x525590){if(_0x525590[_0xabe6('0x2e')]){return logger[_0xabe6('0x2e')](_0xabe6('0x2f'),JSON[_0xabe6('0x25')](_0x525590));}return logger['info']('email\x20sent');})[_0xabe6('0x30')](function(_0x2d7bcc){return logger['error']('error\x20mail',JSON[_0xabe6('0x25')](_0x2d7bcc));});}};}function handleError(){return function(_0x3e2923){return logger[_0xabe6('0x2e')](JSON['stringify'](_0x3e2923));};}function handleResult(_0x30bdd1){return function(_0x56ac1b){logger[_0xabe6('0x29')](_0xabe6('0x31'),JSON[_0xabe6('0x25')](_0x56ac1b));if(_0x30bdd1[_0xabe6('0xc')]&&_0x30bdd1[_0xabe6('0xc')][_0xabe6('0xe')]&&!_[_0xabe6('0x32')](_0x30bdd1['email'])){setTimeout(handleSendEmail(_0x30bdd1,_0x56ac1b),0x3c*0x3e8);}};}function handleJob(_0x5abcbc){return function(){try{if(_[_0xabe6('0x32')](_0x5abcbc['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x5abcbc['subtractUnit'])){return logger[_0xabe6('0x29')](_0xabe6('0x33'));}var _0x584465={'startDate':moment()[_0xabe6('0x34')](_0x5abcbc[_0xabe6('0x35')],_0x5abcbc[_0xabe6('0x1b')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xabe6('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xabe6('0x36'),'output':_0x5abcbc[_0xabe6('0x37')],'name':_0x5abcbc[_0xabe6('0x1a')]};if(!_['isNil'](_0x5abcbc['DefaultReportId'])){logger[_0xabe6('0x29')](_0xabe6('0x38'),_0x5abcbc['DefaultReportId']);return analyticDefaultReportController[_0xabe6('0x39')]({'id':_0x5abcbc[_0xabe6('0x3a')]},_0x584465)['then'](handleResult(_0x5abcbc))['catch'](handleError());}if(!_[_0xabe6('0x32')](_0x5abcbc[_0xabe6('0x3b')])){logger[_0xabe6('0x29')](_0xabe6('0x3c'),_0x5abcbc[_0xabe6('0x3b')]);return analyticCustomReportController[_0xabe6('0x39')]({'id':_0x5abcbc[_0xabe6('0x3b')]},_0x584465)[_0xabe6('0x2d')](handleResult(_0x5abcbc))[_0xabe6('0x30')](handleError());}}catch(_0x340f8e){logger['error'](JSON[_0xabe6('0x25')](_0x340f8e));}return logger[_0xabe6('0x29')](_0xabe6('0x3d'));};}function getJobs(_0x365729){var _0x223101={};if(_0x365729){_0x223101['id']=_0x365729;}return db[_0xabe6('0x3e')][_0xabe6('0x3f')]({'where':_0x223101,'include':[{'model':db[_0xabe6('0xc')],'attributes':['id',_0xabe6('0x1a'),_0xabe6('0x18')],'include':[{'model':db[_0xabe6('0x40')],'as':_0xabe6('0xe')}]}]})[_0xabe6('0x2d')](function(_0x24ca59){var _0x591aa1=_['keys'](manager[_0xabe6('0x41')]);var _0x2638fd=_[_0xabe6('0x42')](_0x24ca59,function(_0x55fe6a){return _0x55fe6a['id'][_0xabe6('0x43')]();});var _0x523303=_[_0xabe6('0x44')](_0x24ca59,function(_0x36e6c5){return _0x36e6c5['id']['toString']();});var _0x2cd0ee=_0x365729?_0x2638fd:_[_0xabe6('0x45')](_0x2638fd,_0x591aa1);var _0x21255d=_[_0xabe6('0x46')](_0x2638fd,_0x591aa1);var _0x1e34c5=_[_0xabe6('0x45')](_0x591aa1,_0x2638fd);var _0x4c8ec2;var _0x26421e;for(_0x4c8ec2=0x0;_0x4c8ec2<_0x1e34c5[_0xabe6('0x47')]&&!_0x365729;_0x4c8ec2+=0x1){_0x26421e=_0x1e34c5[_0x4c8ec2][_0xabe6('0x43')]();if(manager[_0xabe6('0x48')](_0x26421e)){manager[_0xabe6('0x49')](_0x26421e);manager[_0xabe6('0x4a')](_0x26421e);logger[_0xabe6('0x29')]('delete\x20cron',_0x26421e);}}logger[_0xabe6('0x29')]('toRun',JSON[_0xabe6('0x25')](_0x2cd0ee));for(_0x4c8ec2=0x0;_0x4c8ec2<_0x2cd0ee[_0xabe6('0x47')];_0x4c8ec2+=0x1){_0x26421e=_0x2cd0ee[_0x4c8ec2]['toString']();logger[_0xabe6('0x29')](_0xabe6('0x4b'),_0x26421e);if(_0x365729){logger['info'](_0xabe6('0x4c'),_0x365729);logger['info'](JSON[_0xabe6('0x25')](_0x523303[_0x26421e]));BPromise[_0xabe6('0x4d')]()[_0xabe6('0x2d')](handleJob(_0x523303[_0x26421e]));logger['info']('run\x20job',_0x523303[_0x26421e][_0xabe6('0x1a')],_0x523303[_0x26421e][_0xabe6('0x4e')]);}else if(_0x523303[_0x26421e]['cron']&&_0x523303[_0x26421e][_0xabe6('0x4f')]&&moment()[_0xabe6('0x50')](_0x523303[_0x26421e][_0xabe6('0x51')],_0x523303[_0x26421e]['endAt'])){manager['add'](_0x26421e,_0x523303[_0x26421e][_0xabe6('0x4e')],handleJob(_0x523303[_0x26421e]));manager[_0xabe6('0x52')](_0x26421e);logger[_0xabe6('0x29')](_0xabe6('0x53'),_0x523303[_0x26421e][_0xabe6('0x1a')],_0x523303[_0x26421e][_0xabe6('0x4e')]);}else if(manager[_0xabe6('0x48')](_0x26421e)){manager['stop'](_0x26421e);manager[_0xabe6('0x4a')](_0x26421e);logger['info'](_0xabe6('0x54'),_0x523303[_0x26421e][_0xabe6('0x1a')],_0x523303[_0x26421e][_0xabe6('0x4e')]);}}for(_0x4c8ec2=0x0,_0x26421e;_0x4c8ec2<_0x21255d[_0xabe6('0x47')]&&!_0x365729;_0x4c8ec2+=0x1){_0x26421e=_0x21255d[_0x4c8ec2][_0xabe6('0x43')]();if(manager[_0xabe6('0x48')](_0x26421e)){if(_0x523303[_0x26421e][_0xabe6('0x4e')]&&_0x523303[_0x26421e][_0xabe6('0x4f')]&&moment()[_0xabe6('0x50')](_0x523303[_0x26421e][_0xabe6('0x51')],_0x523303[_0x26421e][_0xabe6('0x55')])){manager[_0xabe6('0x56')](_0x26421e,_0x523303[_0x26421e][_0xabe6('0x4e')],handleJob(_0x523303[_0x26421e]));logger[_0xabe6('0x29')](_0xabe6('0x57'),_0x523303[_0x26421e][_0xabe6('0x1a')],_0x523303[_0x26421e][_0xabe6('0x4e')]);}else{manager[_0xabe6('0x49')](_0x26421e);manager[_0xabe6('0x4a')](_0x26421e);logger['info'](_0xabe6('0x54'),_0x523303[_0x26421e][_0xabe6('0x1a')],_0x523303[_0x26421e][_0xabe6('0x4e')]);}}}})['catch'](function(_0x45ccfc){logger[_0xabe6('0x2e')](JSON[_0xabe6('0x25')](_0x45ccfc));});}exports[_0xabe6('0x58')]=function(_0x1c90dc){return getJobs(_0x1c90dc);};exports[_0xabe6('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x02ad=['schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','authentication','pass','format','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','zip','existsSync','status','Sent','message','attachments','stringify','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','info','email\x20sent','catch','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','jobs','toString','difference','intersection','length','exists','stop','delete\x20cron','toRun','index','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','deleteJob','stop\x20cron','endAt','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','../logger'];(function(_0x18493a,_0x3076fd){var _0x195f9a=function(_0x37bbd4){while(--_0x37bbd4){_0x18493a['push'](_0x18493a['shift']());}};_0x195f9a(++_0x3076fd);}(_0x02ad,0xf6));var _0xd02a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x02ad[_0x32f7d7];return _0x133d09;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xd02a('0x0'));var _=require(_0xd02a('0x1'));var moment=require(_0xd02a('0x2'));var CronJobManager=require(_0xd02a('0x3'));var jayson=require(_0xd02a('0x4'));var BPromise=require('bluebird');var logger=require(_0xd02a('0x5'))(_0xd02a('0x6'));var db=require(_0xd02a('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xd02a('0x8'));var client=jayson['client'][_0xd02a('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5ad2b7,_0x118e85){return function(){logger['info'](_0xd02a('0xa'),_0x5ad2b7[_0xd02a('0xb')]);var _0x505c9a=!![];var _0x57683e={'tls':{'rejectUnauthorized':![]}};if(_0x5ad2b7[_0xd02a('0xc')]['Smtp'][_0xd02a('0xd')]){_0x57683e[_0xd02a('0xd')]=_0x5ad2b7['MailAccount']['Smtp'][_0xd02a('0xd')];}else{_0x57683e['host']=_0x5ad2b7[_0xd02a('0xc')][_0xd02a('0xe')][_0xd02a('0xf')];_0x57683e[_0xd02a('0x10')]=_0x5ad2b7[_0xd02a('0xc')][_0xd02a('0xe')][_0xd02a('0x10')];_0x57683e[_0xd02a('0x11')]=_0x5ad2b7[_0xd02a('0xc')]['Smtp'][_0xd02a('0x11')];}if(_0x5ad2b7['MailAccount'][_0xd02a('0xe')][_0xd02a('0x12')]){_0x57683e['auth']={'user':_0x5ad2b7[_0xd02a('0xc')]['Smtp']['user'],'pass':_0x5ad2b7[_0xd02a('0xc')]['Smtp'][_0xd02a('0x13')]};}var _0x23b0ad={'account':_0x57683e,'message':{'from':util[_0xd02a('0x14')]('\x22%s\x22\x20<%s>',_0x5ad2b7['MailAccount'][_0xd02a('0x15')],_0x5ad2b7['MailAccount'][_0xd02a('0xb')]||_0x5ad2b7[_0xd02a('0xc')][_0xd02a('0xe')][_0xd02a('0x16')]),'to':_0x5ad2b7['email'],'cc':_0x5ad2b7['cc'],'bcc':_0x5ad2b7[_0xd02a('0x17')],'subject':util['format'](_0xd02a('0x18'),_0x118e85['name'],_0x5ad2b7['subtractNumber'],_0x5ad2b7[_0xd02a('0x19')])}};var _0x31cdd2=path[_0xd02a('0x1a')](__dirname,_0xd02a('0x1b'));var _0x46d74a=_0x118e85[_0xd02a('0x1c')];var _0x437043=util[_0xd02a('0x14')](_0xd02a('0x1d'),path['basename'](_0x118e85[_0xd02a('0x1c')],path['extname'](_0x118e85['savename'])),_0xd02a('0x1e'));var _0x29e9a5=path[_0xd02a('0x1a')](_0x31cdd2,_0x46d74a);var _0x14680d=path[_0xd02a('0x1a')](_0x31cdd2,_0x437043);if(fs[_0xd02a('0x1f')](_0x29e9a5)){_0x118e85[_0xd02a('0x20')]=_0xd02a('0x21');_0x23b0ad[_0xd02a('0x22')][_0xd02a('0x23')]=[{'filename':_0x46d74a,'path':_0x29e9a5}];_0x23b0ad[_0xd02a('0x22')]['text']=util[_0xd02a('0x14')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0xd02a('0x24')](_0x118e85,null,0x2));}else if(fs[_0xd02a('0x1f')](_0x14680d)){_0x118e85[_0xd02a('0x20')]='Sent';_0x23b0ad[_0xd02a('0x22')][_0xd02a('0x23')]=[{'filename':_0x437043,'path':_0x14680d}];}else{_0x23b0ad[_0xd02a('0x22')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5ad2b7['sendIfEmpty']){_0x505c9a=![];logger['info'](_0xd02a('0x25'));}}if(_0x505c9a){return client[_0xd02a('0x26')](_0xd02a('0x27'),_0x23b0ad)[_0xd02a('0x28')](function(_0x1fe428){if(_0x1fe428[_0xd02a('0x29')]){return logger[_0xd02a('0x29')](_0xd02a('0x2a'),JSON['stringify'](_0x1fe428));}return logger[_0xd02a('0x2b')](_0xd02a('0x2c'));})[_0xd02a('0x2d')](function(_0x380d2b){return logger[_0xd02a('0x29')]('error\x20mail',JSON[_0xd02a('0x24')](_0x380d2b));});}};}function handleError(){return function(_0x71cbc){return logger['error'](JSON['stringify'](_0x71cbc));};}function handleResult(_0x1db9d6){return function(_0x3a3da){logger['info'](_0xd02a('0x2e'),JSON[_0xd02a('0x24')](_0x3a3da));if(_0x1db9d6[_0xd02a('0xc')]&&_0x1db9d6[_0xd02a('0xc')][_0xd02a('0xe')]&&!_['isNil'](_0x1db9d6[_0xd02a('0xb')])){setTimeout(handleSendEmail(_0x1db9d6,_0x3a3da),0x3c*0x3e8);}};}function handleJob(_0x410a8e){return function(){try{if(_[_0xd02a('0x2f')](_0x410a8e[_0xd02a('0x30')])){return logger[_0xd02a('0x2b')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd02a('0x2f')](_0x410a8e[_0xd02a('0x19')])){return logger[_0xd02a('0x2b')](_0xd02a('0x31'));}var _0x4c3083={'startDate':moment()[_0xd02a('0x32')](_0x410a8e[_0xd02a('0x30')],_0x410a8e[_0xd02a('0x19')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0xd02a('0x33')),'type':_0xd02a('0x34'),'output':_0x410a8e[_0xd02a('0x35')],'name':_0x410a8e['name']};if(!_[_0xd02a('0x2f')](_0x410a8e['DefaultReportId'])){logger[_0xd02a('0x2b')]('exec\x20defaul\x20report\x20id:%s',_0x410a8e[_0xd02a('0x36')]);return analyticDefaultReportController[_0xd02a('0x37')]({'id':_0x410a8e[_0xd02a('0x36')]},_0x4c3083)[_0xd02a('0x28')](handleResult(_0x410a8e))[_0xd02a('0x2d')](handleError());}if(!_['isNil'](_0x410a8e[_0xd02a('0x38')])){logger[_0xd02a('0x2b')]('exec\x20custom\x20report\x20id:%s',_0x410a8e[_0xd02a('0x38')]);return analyticCustomReportController[_0xd02a('0x37')]({'id':_0x410a8e['CustomReportId']},_0x4c3083)[_0xd02a('0x28')](handleResult(_0x410a8e))[_0xd02a('0x2d')](handleError());}}catch(_0x1b1ad5){logger[_0xd02a('0x29')](JSON[_0xd02a('0x24')](_0x1b1ad5));}return logger[_0xd02a('0x2b')](_0xd02a('0x39'));};}function getJobs(_0x22a3be){var _0x557a0f={};if(_0x22a3be){_0x557a0f['id']=_0x22a3be;}return db['Schedule'][_0xd02a('0x3a')]({'where':_0x557a0f,'include':[{'model':db[_0xd02a('0xc')],'attributes':['id','name',_0xd02a('0xb')],'include':[{'model':db[_0xd02a('0x3b')],'as':_0xd02a('0xe')}]}]})[_0xd02a('0x28')](function(_0x1586b7){var _0x1d6bcd=_['keys'](manager[_0xd02a('0x3c')]);var _0x2a1348=_['map'](_0x1586b7,function(_0x29939b){return _0x29939b['id'][_0xd02a('0x3d')]();});var _0x26b03a=_['keyBy'](_0x1586b7,function(_0x1a7a18){return _0x1a7a18['id'][_0xd02a('0x3d')]();});var _0x745d07=_0x22a3be?_0x2a1348:_[_0xd02a('0x3e')](_0x2a1348,_0x1d6bcd);var _0x1c5bdb=_[_0xd02a('0x3f')](_0x2a1348,_0x1d6bcd);var _0x4febf3=_[_0xd02a('0x3e')](_0x1d6bcd,_0x2a1348);var _0x33459e;var _0x3e4373;for(_0x33459e=0x0;_0x33459e<_0x4febf3[_0xd02a('0x40')]&&!_0x22a3be;_0x33459e+=0x1){_0x3e4373=_0x4febf3[_0x33459e][_0xd02a('0x3d')]();if(manager[_0xd02a('0x41')](_0x3e4373)){manager[_0xd02a('0x42')](_0x3e4373);manager['deleteJob'](_0x3e4373);logger[_0xd02a('0x2b')](_0xd02a('0x43'),_0x3e4373);}}logger['info'](_0xd02a('0x44'),JSON[_0xd02a('0x24')](_0x745d07));for(_0x33459e=0x0;_0x33459e<_0x745d07[_0xd02a('0x40')];_0x33459e+=0x1){_0x3e4373=_0x745d07[_0x33459e][_0xd02a('0x3d')]();logger[_0xd02a('0x2b')](_0xd02a('0x45'),_0x3e4373);if(_0x22a3be){logger[_0xd02a('0x2b')]('my\x20id',_0x22a3be);logger['info'](JSON['stringify'](_0x26b03a[_0x3e4373]));BPromise['resolve']()[_0xd02a('0x28')](handleJob(_0x26b03a[_0x3e4373]));logger[_0xd02a('0x2b')](_0xd02a('0x46'),_0x26b03a[_0x3e4373][_0xd02a('0x15')],_0x26b03a[_0x3e4373][_0xd02a('0x47')]);}else if(_0x26b03a[_0x3e4373][_0xd02a('0x47')]&&_0x26b03a[_0x3e4373][_0xd02a('0x48')]&&moment()[_0xd02a('0x49')](_0x26b03a[_0x3e4373][_0xd02a('0x4a')],_0x26b03a[_0x3e4373]['endAt'])){manager[_0xd02a('0x4b')](_0x3e4373,_0x26b03a[_0x3e4373][_0xd02a('0x47')],handleJob(_0x26b03a[_0x3e4373]));manager[_0xd02a('0x4c')](_0x3e4373);logger[_0xd02a('0x2b')](_0xd02a('0x4d'),_0x26b03a[_0x3e4373][_0xd02a('0x15')],_0x26b03a[_0x3e4373][_0xd02a('0x47')]);}else if(manager[_0xd02a('0x41')](_0x3e4373)){manager[_0xd02a('0x42')](_0x3e4373);manager[_0xd02a('0x4e')](_0x3e4373);logger['info'](_0xd02a('0x4f'),_0x26b03a[_0x3e4373][_0xd02a('0x15')],_0x26b03a[_0x3e4373][_0xd02a('0x47')]);}}for(_0x33459e=0x0,_0x3e4373;_0x33459e<_0x1c5bdb[_0xd02a('0x40')]&&!_0x22a3be;_0x33459e+=0x1){_0x3e4373=_0x1c5bdb[_0x33459e][_0xd02a('0x3d')]();if(manager[_0xd02a('0x41')](_0x3e4373)){if(_0x26b03a[_0x3e4373][_0xd02a('0x47')]&&_0x26b03a[_0x3e4373]['active']&&moment()[_0xd02a('0x49')](_0x26b03a[_0x3e4373][_0xd02a('0x4a')],_0x26b03a[_0x3e4373][_0xd02a('0x50')])){manager[_0xd02a('0x51')](_0x3e4373,_0x26b03a[_0x3e4373]['cron'],handleJob(_0x26b03a[_0x3e4373]));logger[_0xd02a('0x2b')](_0xd02a('0x52'),_0x26b03a[_0x3e4373]['name'],_0x26b03a[_0x3e4373][_0xd02a('0x47')]);}else{manager[_0xd02a('0x42')](_0x3e4373);manager[_0xd02a('0x4e')](_0x3e4373);logger[_0xd02a('0x2b')](_0xd02a('0x4f'),_0x26b03a[_0x3e4373][_0xd02a('0x15')],_0x26b03a[_0x3e4373][_0xd02a('0x47')]);}}}})[_0xd02a('0x2d')](function(_0x1621c2){logger[_0xd02a('0x29')](JSON[_0xd02a('0x24')](_0x1621c2));});}exports[_0xd02a('0x53')]=function(_0x570e5c){return getJobs(_0x570e5c);};exports[_0xd02a('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 47ebae7..450f526 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 _0x4977=['aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','Neutral','FAILED','FailureReason','resolve','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Positive','Negative','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','start','lodash'];(function(_0x28d896,_0x48c547){var _0x4c4d6e=function(_0x41cd50){while(--_0x41cd50){_0x28d896['push'](_0x28d896['shift']());}};_0x4c4d6e(++_0x48c547);}(_0x4977,0x1cd));var _0x7497=function(_0x312b5,_0x1ecb0e){_0x312b5=_0x312b5-0x0;var _0x19a3c4=_0x4977[_0x312b5];return _0x19a3c4;};var _=require(_0x7497('0x0'));var AWS=require(_0x7497('0x1'));var rp=require(_0x7497('0x2'));var util=require(_0x7497('0x3'));var BPromise=require(_0x7497('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x7497('0x5'))(_0x7497('0x6'));function getTranscriptionJob(_0x41bc6e,_0x43c339,_0x2f8f2e,_0x71433e){return new Promise(function(_0x50f563,_0x170987){var _0x21d9d5=new AWS[(_0x7497('0x7'))]({'accessKeyId':_0x43c339,'secretAccessKey':_0x41bc6e,'region':_0x2f8f2e});_0x21d9d5[_0x7497('0x8')]({'TranscriptionJobName':_0x71433e},function(_0x180bf8,_0x54da2d){if(_0x180bf8){return _0x170987(_0x180bf8);}else{return _0x50f563(_0x54da2d);}});});}function sentiment(_0x400394,_0x2b0d70,_0x5b4f54,_0x28c035,_0x264d9f){return new Promise(function(_0x44115a,_0x1d316d){var _0x336d87=new AWS[(_0x7497('0x9'))]({'accessKeyId':_0x2b0d70,'secretAccessKey':_0x400394,'region':_0x5b4f54});_0x336d87[_0x7497('0xa')]({'Text':_0x28c035,'LanguageCode':_0x264d9f[_0x7497('0xb')](0x0,0x2)},function(_0x5dabe9,_0x2d9836){if(_0x5dabe9){return _0x1d316d(_0x5dabe9);}else{return _0x44115a(_0x2d9836);}});});}function checkTranscribeJob(_0x2cfb39,_0x5e327f,_0x5be343){var _0x1845c9;return new BPromise(function(_0x3bccea,_0x3d4e1f){logger[_0x7497('0xc')](util[_0x7497('0xd')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x2cfb39['id'],_0x2cfb39[_0x7497('0xe')]));return getTranscriptionJob(_0x5be343['data1'],_0x5be343[_0x7497('0xf')],_0x5e327f[_0x7497('0x10')],_0x2cfb39[_0x7497('0xe')])[_0x7497('0x11')](function(_0x2f3dce){logger['info'](util[_0x7497('0xd')](_0x7497('0x12'),_0x2cfb39['id'],_0x2cfb39[_0x7497('0xe')],_0x2f3dce[_0x7497('0x13')][_0x7497('0x14')]));if(!_0x2cfb39['fileText']){switch(_0x2f3dce['TranscriptionJob'][_0x7497('0x14')]){case _0x7497('0x15'):var _0x454f13={'transcribeStatus':_0x2f3dce[_0x7497('0x13')][_0x7497('0x14')],'fileUri':_0x2f3dce[_0x7497('0x13')]['Transcript'][_0x7497('0x16')]};logger[_0x7497('0xc')](util[_0x7497('0xd')](_0x7497('0x17'),_0x2cfb39['id']));return rp({'uri':_0x2f3dce['TranscriptionJob'][_0x7497('0x18')][_0x7497('0x16')],'json':!![]})[_0x7497('0x11')](function(_0x31a354){logger[_0x7497('0xc')](util[_0x7497('0xd')](_0x7497('0x19'),_0x2cfb39['id']));if(_0x31a354&&_0x31a354[_0x7497('0x1a')]&&_0x31a354[_0x7497('0x1a')]['transcripts']&&_0x31a354[_0x7497('0x1a')][_0x7497('0x1b')][_0x7497('0x1c')]){_0x454f13[_0x7497('0x1d')]='';for(var _0x2c3d00=0x0;_0x2c3d00<_0x31a354[_0x7497('0x1a')][_0x7497('0x1b')]['length'];_0x2c3d00++){_0x454f13[_0x7497('0x1d')]+=_0x31a354[_0x7497('0x1a')][_0x7497('0x1b')][_0x2c3d00][_0x7497('0x1e')]+'';}}return _0x2cfb39[_0x7497('0x1f')](_0x454f13);})['then'](function(){logger['info'](util[_0x7497('0xd')](_0x7497('0x20'),_0x2cfb39['id']));if(!_0x2cfb39[_0x7497('0x21')]){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x24'));}if(!_0x5e327f[_0x7497('0x25')]||!_0x5e327f[_0x7497('0x26')]||!_0x5e327f['sentimentRegion']||!_0x5e327f[_0x7497('0x27')]||!_0x5e327f['bucket']){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x454f13['fileText']){throw new Error(_0x7497('0x28'));}if(_0x5e327f[_0x7497('0x26')]===_0x5be343['id']){return _0x5be343;}else{return db['CloudProvider'][_0x7497('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x7497('0x11')](function(_0x3c1117){if(!_0x3c1117){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x2a'));}if(!_0x3c1117[_0x7497('0x2b')]||!_0x3c1117[_0x7497('0xf')]){throw new db['Sequelize'][(_0x7497('0x23'))](_0x7497('0x2c'));}_0x1845c9=_0x3c1117;logger[_0x7497('0xc')](util['format'](_0x7497('0x2d'),_0x2cfb39['id']));return sentiment(_0x1845c9[_0x7497('0x2b')],_0x1845c9['data2'],_0x5e327f['sentimentRegion'],_0x454f13[_0x7497('0x1d')],_0x5e327f[_0x7497('0x27')]);})['then'](function(_0x161718){logger['info'](util['format'](_0x7497('0x2e'),_0x2cfb39['id']));return _0x2cfb39[_0x7497('0x1f')]({'sentiment':_0x161718[_0x7497('0x2f')],'sPositive':_0x161718[_0x7497('0x30')]['Positive'],'sNegative':_0x161718[_0x7497('0x30')]['Negative'],'sMixed':_0x161718[_0x7497('0x30')][_0x7497('0x31')],'sNeutral':_0x161718[_0x7497('0x30')][_0x7497('0x32')]});})[_0x7497('0x11')](function(){logger[_0x7497('0xc')](util[_0x7497('0xd')](_0x7497('0x20'),_0x2cfb39['id']));_0x3bccea();});case _0x7497('0x33'):return _0x2cfb39[_0x7497('0x1f')]({'transcribeStatus':_0x7497('0x33'),'failureReason':_0x2f3dce[_0x7497('0x13')][_0x7497('0x34')]})['then'](function(){logger[_0x7497('0xc')](util[_0x7497('0xd')](_0x7497('0x20'),_0x2cfb39['id']));_0x3bccea();});default:logger[_0x7497('0xc')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x2cfb39['id']));break;}}else{return BPromise[_0x7497('0x35')]()['then'](function(){if(!_0x2cfb39[_0x7497('0x21')]){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x24'));}if(!_0x5e327f[_0x7497('0x25')]||!_0x5e327f[_0x7497('0x26')]||!_0x5e327f['sentimentRegion']||!_0x5e327f[_0x7497('0x27')]||!_0x5e327f[_0x7497('0x36')]){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x37'));}if(!_0x2cfb39[_0x7497('0x1d')]){throw new Error(_0x7497('0x28'));}if(_0x5e327f[_0x7497('0x26')]===_0x5be343['id']){return _0x5be343;}else{return db[_0x7497('0x38')]['findOne']({'where':{'id':_settings[_0x7497('0x26')]}});}})[_0x7497('0x11')](function(_0x27b98f){if(!_0x27b98f){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x2a'));}if(!_0x27b98f['data1']||!_0x27b98f[_0x7497('0xf')]){throw new db[(_0x7497('0x22'))]['ValidationError'](_0x7497('0x2c'));}_0x1845c9=_0x27b98f;logger[_0x7497('0xc')](util[_0x7497('0xd')](_0x7497('0x2d'),_0x2cfb39['id']));return sentiment(_0x1845c9[_0x7497('0x2b')],_0x1845c9[_0x7497('0xf')],_0x5e327f['sentimentRegion'],_0x2cfb39[_0x7497('0x1d')],_0x5e327f['language']);})[_0x7497('0x11')](function(_0xf68263){logger[_0x7497('0xc')](util['format'](_0x7497('0x2e'),_0x2cfb39['id']));return _0x2cfb39['update']({'sentiment':_0xf68263['Sentiment'],'sPositive':_0xf68263[_0x7497('0x30')][_0x7497('0x39')],'sNegative':_0xf68263['SentimentScore'][_0x7497('0x3a')],'sMixed':_0xf68263[_0x7497('0x30')][_0x7497('0x31')],'sNeutral':_0xf68263[_0x7497('0x30')][_0x7497('0x32')],'transcribeStatus':'COMPLETED'});})[_0x7497('0x11')](function(){logger[_0x7497('0xc')](util[_0x7497('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2cfb39['id']));_0x3bccea();});}})['catch'](function(_0x54f3e5){if(_0x54f3e5){if(!_0x54f3e5[_0x7497('0x3b')]||_0x54f3e5[_0x7497('0x3b')]!==_0x7497('0x3c')){logger[_0x7497('0x3d')](util[_0x7497('0xd')](_0x7497('0x3e'),_0x2cfb39['id']),util[_0x7497('0x3f')](_0x54f3e5,{'showHidden':![],'depth':null}));}}_0x3bccea();});});}function checkTranscribe(){var _0x200066;var _0x293af5;var _0x17910c;return db[_0x7497('0x40')][_0x7497('0x41')]({'where':{'transcribeStatus':_0x7497('0x42')}})[_0x7497('0x11')](function(_0x5a2c26){if(!_0x5a2c26||!_0x5a2c26['length']){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x43'));}_0x200066=_0x5a2c26;return db[_0x7497('0x44')]['findOne']({'where':{'id':0x1}});})[_0x7497('0x11')](function(_0x4347f4){if(!_0x4347f4){throw new db['Sequelize'][(_0x7497('0x23'))](_0x7497('0x45'));}_0x293af5=_0x4347f4;if(!_0x293af5['transcribe']||!_0x293af5[_0x7497('0x46')]||!_0x293af5[_0x7497('0x10')]||!_0x293af5[_0x7497('0x27')]||!_0x293af5[_0x7497('0x36')]){throw new db[(_0x7497('0x22'))]['ValidationError'](_0x7497('0x47'));}return db['CloudProvider'][_0x7497('0x29')]({'where':{'id':_0x293af5[_0x7497('0x46')]}});})['then'](function(_0x4f8fc8){if(!_0x4f8fc8){throw new db['Sequelize'][(_0x7497('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4f8fc8[_0x7497('0x2b')]||!_0x4f8fc8[_0x7497('0xf')]){throw new db[(_0x7497('0x22'))][(_0x7497('0x23'))](_0x7497('0x2c'));}_0x17910c=_0x4f8fc8;var _0x458fe9=[];_0x200066[_0x7497('0x48')](function(_0x77a3ac){_0x458fe9[_0x7497('0x49')](checkTranscribeJob(_0x77a3ac,_0x293af5,_0x17910c));});return BPromise[_0x7497('0x4a')](_0x458fe9);})[_0x7497('0x4b')](function(_0x3d7a34){if(_0x3d7a34){if(!_0x3d7a34[_0x7497('0x3b')]||_0x3d7a34[_0x7497('0x3b')]!==_0x7497('0x3c')){logger['error'](util[_0x7497('0x3f')](_0x3d7a34,{'showHidden':![],'depth':null}));}}});}exports[_0x7497('0x4c')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x5987=['Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','bucket','transcribeAccountId','forEach','push','all','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','TranscriptFileUri','info','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data2','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative'];(function(_0x272d7d,_0x13e48d){var _0x34dc31=function(_0x5ae553){while(--_0x5ae553){_0x272d7d['push'](_0x272d7d['shift']());}};_0x34dc31(++_0x13e48d);}(_0x5987,0x128));var _0x7598=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x5987[_0x1ac595];return _0x455fff;};var _=require(_0x7598('0x0'));var AWS=require(_0x7598('0x1'));var rp=require(_0x7598('0x2'));var util=require(_0x7598('0x3'));var BPromise=require('bluebird');var db=require(_0x7598('0x4'))['db'];var logger=require(_0x7598('0x5'))(_0x7598('0x6'));function getTranscriptionJob(_0x373ef6,_0x2820fc,_0x1d3f9e,_0x1a5a7d){return new Promise(function(_0x56cc44,_0x1c78e){var _0x4ae889=new AWS[(_0x7598('0x7'))]({'accessKeyId':_0x2820fc,'secretAccessKey':_0x373ef6,'region':_0x1d3f9e});_0x4ae889[_0x7598('0x8')]({'TranscriptionJobName':_0x1a5a7d},function(_0x2cf89d,_0x163b1){if(_0x2cf89d){return _0x1c78e(_0x2cf89d);}else{return _0x56cc44(_0x163b1);}});});}function sentiment(_0x3510af,_0x1c1835,_0x3871d4,_0x4bafbc,_0x5c1782){return new Promise(function(_0x55f8a5,_0x8ac2a3){var _0x138510=new AWS[(_0x7598('0x9'))]({'accessKeyId':_0x1c1835,'secretAccessKey':_0x3510af,'region':_0x3871d4});_0x138510['detectSentiment']({'Text':_0x4bafbc,'LanguageCode':_0x5c1782['substring'](0x0,0x2)},function(_0x30f0f2,_0xee86a3){if(_0x30f0f2){return _0x8ac2a3(_0x30f0f2);}else{return _0x55f8a5(_0xee86a3);}});});}function checkTranscribeJob(_0x1be21a,_0x1a92e9,_0x22cc20){var _0x52bc43;return new BPromise(function(_0x212ee4,_0x5242a1){logger['info'](util[_0x7598('0xa')](_0x7598('0xb'),_0x1be21a['id'],_0x1be21a[_0x7598('0xc')]));return getTranscriptionJob(_0x22cc20[_0x7598('0xd')],_0x22cc20['data2'],_0x1a92e9[_0x7598('0xe')],_0x1be21a[_0x7598('0xc')])[_0x7598('0xf')](function(_0x3282de){logger['info'](util[_0x7598('0xa')](_0x7598('0x10'),_0x1be21a['id'],_0x1be21a[_0x7598('0xc')],_0x3282de[_0x7598('0x11')][_0x7598('0x12')]));if(!_0x1be21a[_0x7598('0x13')]){switch(_0x3282de['TranscriptionJob'][_0x7598('0x12')]){case _0x7598('0x14'):var _0x50c315={'transcribeStatus':_0x3282de[_0x7598('0x11')][_0x7598('0x12')],'fileUri':_0x3282de['TranscriptionJob']['Transcript'][_0x7598('0x15')]};logger[_0x7598('0x16')](util[_0x7598('0xa')](_0x7598('0x17'),_0x1be21a['id']));return rp({'uri':_0x3282de[_0x7598('0x11')]['Transcript'][_0x7598('0x15')],'json':!![]})[_0x7598('0xf')](function(_0x1d6e1b){logger[_0x7598('0x16')](util[_0x7598('0xa')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1be21a['id']));if(_0x1d6e1b&&_0x1d6e1b[_0x7598('0x18')]&&_0x1d6e1b[_0x7598('0x18')][_0x7598('0x19')]&&_0x1d6e1b[_0x7598('0x18')][_0x7598('0x19')][_0x7598('0x1a')]){_0x50c315['fileText']='';for(var _0x4bfac0=0x0;_0x4bfac0<_0x1d6e1b[_0x7598('0x18')]['transcripts']['length'];_0x4bfac0++){_0x50c315[_0x7598('0x13')]+=_0x1d6e1b[_0x7598('0x18')][_0x7598('0x19')][_0x4bfac0]['transcript']+'';}}return _0x1be21a['update'](_0x50c315);})['then'](function(){logger[_0x7598('0x16')](util[_0x7598('0xa')](_0x7598('0x1b'),_0x1be21a['id']));if(!_0x1be21a[_0x7598('0x1c')]){throw new db[(_0x7598('0x1d'))][(_0x7598('0x1e'))](_0x7598('0x1f'));}if(!_0x1a92e9[_0x7598('0x20')]||!_0x1a92e9[_0x7598('0x21')]||!_0x1a92e9[_0x7598('0x22')]||!_0x1a92e9['language']||!_0x1a92e9['bucket']){throw new db['Sequelize'][(_0x7598('0x1e'))](_0x7598('0x23'));}if(!_0x50c315[_0x7598('0x13')]){throw new Error(_0x7598('0x24'));}if(_0x1a92e9['sentimentAccountId']===_0x22cc20['id']){return _0x22cc20;}else{return db[_0x7598('0x25')][_0x7598('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x7598('0xf')](function(_0x511a1d){if(!_0x511a1d){throw new db[(_0x7598('0x1d'))][(_0x7598('0x1e'))](_0x7598('0x27'));}if(!_0x511a1d['data1']||!_0x511a1d['data2']){throw new db[(_0x7598('0x1d'))]['ValidationError'](_0x7598('0x28'));}_0x52bc43=_0x511a1d;logger[_0x7598('0x16')](util[_0x7598('0xa')](_0x7598('0x29'),_0x1be21a['id']));return sentiment(_0x52bc43['data1'],_0x52bc43[_0x7598('0x2a')],_0x1a92e9[_0x7598('0x22')],_0x50c315[_0x7598('0x13')],_0x1a92e9[_0x7598('0x2b')]);})[_0x7598('0xf')](function(_0x2ae444){logger[_0x7598('0x16')](util[_0x7598('0xa')](_0x7598('0x2c'),_0x1be21a['id']));return _0x1be21a['update']({'sentiment':_0x2ae444[_0x7598('0x2d')],'sPositive':_0x2ae444['SentimentScore'][_0x7598('0x2e')],'sNegative':_0x2ae444[_0x7598('0x2f')][_0x7598('0x30')],'sMixed':_0x2ae444[_0x7598('0x2f')][_0x7598('0x31')],'sNeutral':_0x2ae444[_0x7598('0x2f')][_0x7598('0x32')]});})[_0x7598('0xf')](function(){logger['info'](util['format'](_0x7598('0x1b'),_0x1be21a['id']));_0x212ee4();});case _0x7598('0x33'):return _0x1be21a['update']({'transcribeStatus':'FAILED','failureReason':_0x3282de['TranscriptionJob'][_0x7598('0x34')]})[_0x7598('0xf')](function(){logger['info'](util['format'](_0x7598('0x1b'),_0x1be21a['id']));_0x212ee4();});default:logger[_0x7598('0x16')](util[_0x7598('0xa')](_0x7598('0x35'),_0x1be21a['id']));break;}}else{return BPromise[_0x7598('0x36')]()[_0x7598('0xf')](function(){if(!_0x1be21a[_0x7598('0x1c')]){throw new db['Sequelize'][(_0x7598('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1a92e9['sentiment']||!_0x1a92e9[_0x7598('0x21')]||!_0x1a92e9[_0x7598('0x22')]||!_0x1a92e9[_0x7598('0x2b')]||!_0x1a92e9['bucket']){throw new db[(_0x7598('0x1d'))]['ValidationError'](_0x7598('0x23'));}if(!_0x1be21a[_0x7598('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x1a92e9[_0x7598('0x21')]===_0x22cc20['id']){return _0x22cc20;}else{return db[_0x7598('0x25')][_0x7598('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x7598('0xf')](function(_0x803c9){if(!_0x803c9){throw new db[(_0x7598('0x1d'))][(_0x7598('0x1e'))](_0x7598('0x27'));}if(!_0x803c9[_0x7598('0xd')]||!_0x803c9[_0x7598('0x2a')]){throw new db[(_0x7598('0x1d'))][(_0x7598('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x52bc43=_0x803c9;logger[_0x7598('0x16')](util['format'](_0x7598('0x29'),_0x1be21a['id']));return sentiment(_0x52bc43[_0x7598('0xd')],_0x52bc43[_0x7598('0x2a')],_0x1a92e9['sentimentRegion'],_0x1be21a[_0x7598('0x13')],_0x1a92e9['language']);})[_0x7598('0xf')](function(_0x186d91){logger[_0x7598('0x16')](util[_0x7598('0xa')](_0x7598('0x2c'),_0x1be21a['id']));return _0x1be21a['update']({'sentiment':_0x186d91['Sentiment'],'sPositive':_0x186d91[_0x7598('0x2f')][_0x7598('0x2e')],'sNegative':_0x186d91[_0x7598('0x2f')][_0x7598('0x30')],'sMixed':_0x186d91['SentimentScore'][_0x7598('0x31')],'sNeutral':_0x186d91['SentimentScore']['Neutral'],'transcribeStatus':_0x7598('0x14')});})[_0x7598('0xf')](function(){logger[_0x7598('0x16')](util[_0x7598('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1be21a['id']));_0x212ee4();});}})[_0x7598('0x37')](function(_0x1adf67){if(_0x1adf67){if(!_0x1adf67[_0x7598('0x38')]||_0x1adf67[_0x7598('0x38')]!==_0x7598('0x39')){logger[_0x7598('0x3a')](util[_0x7598('0xa')](_0x7598('0x3b'),_0x1be21a['id']),util[_0x7598('0x3c')](_0x1adf67,{'showHidden':![],'depth':null}));}}_0x212ee4();});});}function checkTranscribe(){var _0x58fee6;var _0x293100;var _0x2efa18;return db[_0x7598('0x3d')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x334a54){if(!_0x334a54||!_0x334a54[_0x7598('0x1a')]){throw new db[(_0x7598('0x1d'))][(_0x7598('0x1e'))](_0x7598('0x3e'));}_0x58fee6=_0x334a54;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x7598('0xf')](function(_0x33a6a5){if(!_0x33a6a5){throw new db['Sequelize']['ValidationError']('Settings\x20not\x20available');}_0x293100=_0x33a6a5;if(!_0x293100[_0x7598('0x6')]||!_0x293100['transcribeAccountId']||!_0x293100['transcribeRegion']||!_0x293100[_0x7598('0x2b')]||!_0x293100[_0x7598('0x3f')]){throw new db[(_0x7598('0x1d'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x7598('0x25')][_0x7598('0x26')]({'where':{'id':_0x293100[_0x7598('0x40')]}});})['then'](function(_0x1ce912){if(!_0x1ce912){throw new db[(_0x7598('0x1d'))]['ValidationError'](_0x7598('0x27'));}if(!_0x1ce912[_0x7598('0xd')]||!_0x1ce912['data2']){throw new db['Sequelize'][(_0x7598('0x1e'))](_0x7598('0x28'));}_0x2efa18=_0x1ce912;var _0x3891fb=[];_0x58fee6[_0x7598('0x41')](function(_0x47f44e){_0x3891fb[_0x7598('0x42')](checkTranscribeJob(_0x47f44e,_0x293100,_0x2efa18));});return BPromise[_0x7598('0x43')](_0x3891fb);})[_0x7598('0x37')](function(_0x7235ec){if(_0x7235ec){if(!_0x7235ec[_0x7598('0x38')]||_0x7235ec[_0x7598('0x38')]!==_0x7598('0x39')){logger[_0x7598('0x3a')](util['inspect'](_0x7235ec,{'showHidden':![],'depth':null}));}}});}exports[_0x7598('0x44')]=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 3f4a6ed..d2bd65a 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 _0x2edf=['lastMsgAt','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','lodash','moment','ioredis','../logger','schedule','redis','localhost','socket.io-emitter'];(function(_0x3cf1dc,_0x669169){var _0x2432a3=function(_0xe284b5){while(--_0xe284b5){_0x3cf1dc['push'](_0x3cf1dc['shift']());}};_0x2432a3(++_0x669169);}(_0x2edf,0x94));var _0xf2ed=function(_0x1806d4,_0x47cc68){_0x1806d4=_0x1806d4-0x0;var _0x392c2c=_0x2edf[_0x1806d4];return _0x392c2c;};'use strict';var _=require(_0xf2ed('0x0'));var moment=require(_0xf2ed('0x1'));var Redis=require(_0xf2ed('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xf2ed('0x3'))(_0xf2ed('0x4'));config[_0xf2ed('0x5')]=_['defaults'](config['redis'],{'host':_0xf2ed('0x6'),'port':0x18eb});var io=require(_0xf2ed('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x45f69d=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0xf2ed('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xf2ed('0x9'))}}})[_0xf2ed('0xa')](function(_0x97d52a){if(_0x97d52a&&_0x97d52a[_0xf2ed('0xb')]){_0x45f69d=_[_0xf2ed('0xc')](_0x97d52a||[],'id');logger['info'](_0xf2ed('0xd'),_0x45f69d[_0xf2ed('0xe')]());return db['WhatsappInteraction'][_0xf2ed('0xf')]({'closeReason':'system','disposition':_0xf2ed('0x10'),'closed':!![],'closedAt':moment()[_0xf2ed('0x11')](_0xf2ed('0x12'))},{'where':{'id':_0x45f69d}});}})['then'](function(){if(_0x45f69d&&_0x45f69d['length']){logger[_0xf2ed('0x13')](_0xf2ed('0x14'),_0x45f69d['join']());for(var _0x3558ea=0x0;_0x3558ea<_0x45f69d[_0xf2ed('0xb')];_0x3558ea++){io[_0xf2ed('0x15')]('whatsappInteraction:update',{'id':_0x45f69d[_0x3558ea],'closed':!![]});}}})[_0xf2ed('0x16')](function(_0xb3a5bf){logger[_0xf2ed('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xb3a5bf?util[_0xf2ed('0x18')](_0xb3a5bf,{'showHidden':![],'depth':null}):'');});}exports[_0xf2ed('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe1c7=['redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment','../../mysqldb','../logger'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xe1c7,0x6f));var _0x7e1c=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0xe1c7[_0x2f3794];return _0x1c9fbe;};'use strict';var _=require('lodash');var moment=require(_0x7e1c('0x0'));var Redis=require('ioredis');var util=require(_0x7e1c('0x1'));var config=require(_0x7e1c('0x2'));var db=require(_0x7e1c('0x3'))['db'];var logger=require(_0x7e1c('0x4'))('schedule');config[_0x7e1c('0x5')]=_[_0x7e1c('0x6')](config[_0x7e1c('0x5')],{'host':_0x7e1c('0x7'),'port':0x18eb});var io=require(_0x7e1c('0x8'))(new Redis(config[_0x7e1c('0x5')]));function closeInteractions(){var _0x3dbd21=[];return db[_0x7e1c('0x9')][_0x7e1c('0xa')]({'raw':!![],'attributes':['id',_0x7e1c('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7e1c('0xc')](0x18,'hours')}}})[_0x7e1c('0xd')](function(_0x5509a1){if(_0x5509a1&&_0x5509a1[_0x7e1c('0xe')]){_0x3dbd21=_[_0x7e1c('0xf')](_0x5509a1||[],'id');logger[_0x7e1c('0x10')](_0x7e1c('0x11'),_0x3dbd21[_0x7e1c('0x12')]());return db[_0x7e1c('0x9')][_0x7e1c('0x13')]({'closeReason':_0x7e1c('0x14'),'disposition':_0x7e1c('0x15'),'closed':!![],'closedAt':moment()['format'](_0x7e1c('0x16'))},{'where':{'id':_0x3dbd21}});}})['then'](function(){if(_0x3dbd21&&_0x3dbd21['length']){logger['info']('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x3dbd21[_0x7e1c('0x12')]());for(var _0x2f4f8b=0x0;_0x2f4f8b<_0x3dbd21[_0x7e1c('0xe')];_0x2f4f8b++){io[_0x7e1c('0x17')](_0x7e1c('0x18'),{'id':_0x3dbd21[_0x2f4f8b],'closed':!![]});}}})[_0x7e1c('0x19')](function(_0x1eba5f){logger[_0x7e1c('0x1a')](_0x7e1c('0x1b'),_0x1eba5f?util['inspect'](_0x1eba5f,{'showHidden':![],'depth':null}):'');});}exports[_0x7e1c('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 40c5d75..43fdc9c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd564=['util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch'];(function(_0x5a2a96,_0x4014f2){var _0x264e1f=function(_0x2af760){while(--_0x2af760){_0x5a2a96['push'](_0x5a2a96['shift']());}};_0x264e1f(++_0x4014f2);}(_0xd564,0x190));var _0x4d56=function(_0x2e684a,_0x3a1c94){_0x2e684a=_0x2e684a-0x0;var _0x3d60e2=_0xd564[_0x2e684a];return _0x3d60e2;};'use strict';var util=require(_0x4d56('0x0'));var db=require(_0x4d56('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x4d56('0x2')]({'id':i,'firstName':_0x4d56('0x3')+i,'lastName':_0x4d56('0x4')+i,'phone':0xf879fb460+i,'email':_0x4d56('0x5')+i+_0x4d56('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x4d56('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x4d56('0x7')](),'updatedAt':Date[_0x4d56('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x4d56('0x5')+i+_0x4d56('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x4d56('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x4d56('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x4d56('0x8')][_0x4d56('0x9')]({'where':{}})[_0x4d56('0xa')](function(){return db[_0x4d56('0x8')][_0x4d56('0xb')](contacts);})[_0x4d56('0xa')](function(){console[_0x4d56('0xc')](_0x4d56('0xd'),_0x4d56('0xe'));return db[_0x4d56('0xf')][_0x4d56('0x9')]({'where':{}});})[_0x4d56('0xa')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x4d56('0xa')](function(){console[_0x4d56('0xc')](_0x4d56('0xd'),_0x4d56('0x10'));return db[_0x4d56('0x8')][_0x4d56('0xb')](contacts2);})[_0x4d56('0xa')](function(){console[_0x4d56('0xc')](_0x4d56('0xd'),_0x4d56('0x11'));return db[_0x4d56('0xf')]['bulkCreate'](hopper2);})['then'](function(){console[_0x4d56('0xc')]('finished\x20populating',_0x4d56('0x12'));})[_0x4d56('0x13')](function(_0x263804){console[_0x4d56('0xc')](_0x263804);}); \ No newline at end of file +var _0x85eb=['finished\x20populating','contacts1','CmHopper','hopper1','log','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x3fc184,_0x1b6486){var _0x2431d9=function(_0x3b2adf){while(--_0x3b2adf){_0x3fc184['push'](_0x3fc184['shift']());}};_0x2431d9(++_0x1b6486);}(_0x85eb,0x171));var _0xb85e=function(_0x9c7ce0,_0x5d09de){_0x9c7ce0=_0x9c7ce0-0x0;var _0x2db3f0=_0x85eb[_0x9c7ce0];return _0x2db3f0;};'use strict';var util=require('util');var db=require(_0xb85e('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb85e('0x1')]({'id':i,'firstName':_0xb85e('0x2')+i,'lastName':_0xb85e('0x3')+i,'phone':0xf879fb460+i,'email':_0xb85e('0x4')+i+_0xb85e('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb85e('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb85e('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb85e('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xb85e('0x3')+i,'phone':0xf879fb460+i,'email':_0xb85e('0x4')+i+_0xb85e('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb85e('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xb85e('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb85e('0x6')]()});}db[_0xb85e('0x7')][_0xb85e('0x8')]({'where':{}})[_0xb85e('0x9')](function(){return db[_0xb85e('0x7')][_0xb85e('0xa')](contacts);})[_0xb85e('0x9')](function(){console['log'](_0xb85e('0xb'),_0xb85e('0xc'));return db[_0xb85e('0xd')][_0xb85e('0x8')]({'where':{}});})[_0xb85e('0x9')](function(){return db[_0xb85e('0xd')][_0xb85e('0xa')](hopper);})[_0xb85e('0x9')](function(){console['log'](_0xb85e('0xb'),_0xb85e('0xe'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console[_0xb85e('0xf')](_0xb85e('0xb'),_0xb85e('0x10'));return db[_0xb85e('0xd')][_0xb85e('0xa')](hopper2);})[_0xb85e('0x9')](function(){console[_0xb85e('0xf')]('finished\x20populating',_0xb85e('0x11'));})[_0xb85e('0x12')](function(_0x2a5f1d){console[_0xb85e('0xf')](_0x2a5f1d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 4a48d5c..d78425a 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc94=['log','util','../mysqldb','format','%s%s','%s%s@xcally.com','agent','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','then','add\x20user','catch'];(function(_0x3d2428,_0x5a51a9){var _0x94785a=function(_0xc70872){while(--_0xc70872){_0x3d2428['push'](_0x3d2428['shift']());}};_0x94785a(++_0x5a51a9);}(_0xdc94,0xa3));var _0x4dc9=function(_0xe78cd1,_0x1576df){_0xe78cd1=_0xe78cd1-0x0;var _0x1d6b4d=_0xdc94[_0xe78cd1];return _0x1d6b4d;};'use strict';var util=require(_0x4dc9('0x0'));var db=require(_0x4dc9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x4dc9('0x2')]('%s%s','agent',i),'fullname':util[_0x4dc9('0x2')](_0x4dc9('0x3'),'agent',i),'email':util[_0x4dc9('0x2')](_0x4dc9('0x4'),_0x4dc9('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x4dc9('0x6'),'transport':[_0x4dc9('0x7'),'ws',_0x4dc9('0x8')],'disallow':[_0x4dc9('0x9')],'allow':['ulaw'],'defaultuser':util[_0x4dc9('0x2')](_0x4dc9('0x3'),_0x4dc9('0x5'),i),'encryption':_0x4dc9('0xa'),'avpf':_0x4dc9('0xa'),'force_avp':_0x4dc9('0xa'),'icesupport':_0x4dc9('0xa'),'dtlsenable':_0x4dc9('0xa'),'dtlsverify':'no','dtlscertfile':_0x4dc9('0xb'),'dtlsprivatekey':_0x4dc9('0xc'),'dtlssetup':'actpass','callerid':util[_0x4dc9('0x2')](_0x4dc9('0xd'),util[_0x4dc9('0x2')](_0x4dc9('0x3'),_0x4dc9('0x5'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0x4dc9('0xe')](function(){console['log'](_0x4dc9('0xf'));})[_0x4dc9('0x10')](function(_0xae387){console[_0x4dc9('0x11')](_0xae387);}); \ No newline at end of file +var _0x0cd6=['actpass','\x22%s\x22\x20<%s>','User','then','log','catch','util','../mysqldb','format','%s%s','%s%s@xcally.com','agent','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x880e91,_0x4e3547){var _0x2f8361=function(_0x46fdd9){while(--_0x46fdd9){_0x880e91['push'](_0x880e91['shift']());}};_0x2f8361(++_0x4e3547);}(_0x0cd6,0x1bb));var _0x60cd=function(_0x34325b,_0x5e5afe){_0x34325b=_0x34325b-0x0;var _0x3da348=_0x0cd6[_0x34325b];return _0x3da348;};'use strict';var util=require(_0x60cd('0x0'));var db=require(_0x60cd('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x60cd('0x2')](_0x60cd('0x3'),'agent',i),'fullname':util[_0x60cd('0x2')](_0x60cd('0x3'),'agent',i),'email':util[_0x60cd('0x2')](_0x60cd('0x4'),_0x60cd('0x5'),i),'role':_0x60cd('0x5'),'password':_0x60cd('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x60cd('0x7'),'ws',_0x60cd('0x8')],'disallow':[_0x60cd('0x9')],'allow':['ulaw'],'defaultuser':util[_0x60cd('0x2')]('%s%s',_0x60cd('0x5'),i),'encryption':_0x60cd('0xa'),'avpf':_0x60cd('0xa'),'force_avp':'yes','icesupport':_0x60cd('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x60cd('0xb'),'dtlsprivatekey':_0x60cd('0xc'),'dtlssetup':_0x60cd('0xd'),'callerid':util[_0x60cd('0x2')](_0x60cd('0xe'),util[_0x60cd('0x2')]('%s%s',_0x60cd('0x5'),i),0xfa0+i)});}db[_0x60cd('0xf')]['bulkCreate'](users)[_0x60cd('0x10')](function(){console[_0x60cd('0x11')]('add\x20user');})[_0x60cd('0x12')](function(_0x34618b){console[_0x60cd('0x11')](_0x34618b);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 656b9aa..b3d032b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4baf=['WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','Campaign','%s:queue:%s','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','format','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','VoiceQueues','MailQueues','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','getWhatsappQueues','length','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues'];(function(_0x1b958c,_0x3eca5d){var _0x52dd1d=function(_0x2264b0){while(--_0x2264b0){_0x1b958c['push'](_0x1b958c['shift']());}};_0x52dd1d(++_0x3eca5d);}(_0x4baf,0xb4));var _0xf4ba=function(_0x416393,_0x47b819){_0x416393=_0x416393-0x0;var _0x24babc=_0x4baf[_0x416393];return _0x24babc;};'use strict';var _=require(_0xf4ba('0x0'));var util=require('util');var BPromise=require(_0xf4ba('0x1'));var db=require(_0xf4ba('0x2'))['db'];var config=require(_0xf4ba('0x3'));var queryQueues={'attributes':['id',_0xf4ba('0x4')],'include':[{'as':_0xf4ba('0x5'),'model':db[_0xf4ba('0x6')],'attributes':['id',_0xf4ba('0x4'),_0xf4ba('0x7')],'raw':!![],'where':{'role':_0xf4ba('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xf4ba('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xf4ba('0x4')],'where':{'role':_0xf4ba('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xf4ba('0xa')],'where':{'type':_0xf4ba('0xb')}};function getAssociatedResources(_0x33e766,_0x12e561,_0x9b2d62){return db['UserProfileSection']['findOne']({'where':{'name':_0x33e766,'userProfileId':_0x12e561},'raw':!![]})[_0xf4ba('0xc')](function(_0x219942){if(_0x219942){if(_0x219942[_0xf4ba('0xd')]){switch(_0x33e766){case'VoiceQueues':case _0xf4ba('0xe'):case _0xf4ba('0xf'):case _0xf4ba('0x10'):case'MailQueues':case _0xf4ba('0x11'):case _0xf4ba('0x12'):return db[_0x9b2d62][_0xf4ba('0x13')](queryQueues);case _0xf4ba('0x14'):return db[_0x9b2d62][_0xf4ba('0x13')](queryTelephones);case _0xf4ba('0x15'):return db[_0x9b2d62][_0xf4ba('0x13')](queryTrunks);case _0xf4ba('0x16'):return db[_0x9b2d62][_0xf4ba('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0xf4ba('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x219942['id']},'raw':!![]})[_0xf4ba('0xc')](function(_0x31895e){if(_0x31895e){var _0x52fbf4={'where':{'id':_['map'](_0x31895e,_0xf4ba('0x17'))},'raw':!![]};switch(_0x9b2d62){case _0xf4ba('0x6'):_0x52fbf4[_0xf4ba('0x18')][_0xf4ba('0x7')]=_0xf4ba('0x9');break;case _0xf4ba('0x19'):_0x52fbf4[_0xf4ba('0x18')]['type']=_0xf4ba('0xb');break;}return db[_0x9b2d62][_0xf4ba('0x13')](_0x52fbf4);}else{return[];}});}}else{return[];}})[_0xf4ba('0xc')](function(_0x5aad70){return _0x5aad70;});}function joinOrLeaveQueues(_0x51beca,_0x1d6a87,_0xd2e75f,_0xe339ec){_0x51beca[_0x1d6a87](util['format'](_0xf4ba('0x1a'),_0xd2e75f,_0xe339ec[_0xf4ba('0x4')]));if(_0xe339ec[_0xf4ba('0x5')]){for(var _0x33e6e6=0x0;_0x33e6e6<_0xe339ec[_0xf4ba('0x5')]['length'];_0x33e6e6+=0x1){_0x51beca[_0x1d6a87](util['format'](_0xf4ba('0x1b'),_0xe339ec[_0xf4ba('0x5')][_0x33e6e6]['name']));}}}function joinOrLeave(_0x3d18e3,_0x212dc5,_0x566333){var _0x5d099c;if(_0x3d18e3[_0xf4ba('0x1c')][_0xf4ba('0x1d')]['id']){db['User'][_0xf4ba('0x1e')]({'attributes':['id','name',_0xf4ba('0x7'),_0xf4ba('0x1f')],'where':{'id':_0x3d18e3['handshake'][_0xf4ba('0x1d')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xf4ba('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0xf4ba('0x21')],'as':_0xf4ba('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xf4ba('0x23')],'as':_0xf4ba('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xf4ba('0x25')],'as':_0xf4ba('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xf4ba('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf4ba('0x28')],'as':_0xf4ba('0x29'),'attributes':['id'],'raw':!![]}]})[_0xf4ba('0xc')](function(_0x1bbf03){if(_0x1bbf03){_0x5d099c=_0x1bbf03;_0x3d18e3[_0x212dc5](util[_0xf4ba('0x2a')](_0xf4ba('0x1b'),_0x1bbf03['name']));var _0x2d7a7d=[];switch(_0x1bbf03[_0xf4ba('0x7')]){case _0xf4ba('0x2b'):_0x3d18e3[_0x212dc5](_0xf4ba('0x2c'));_0x3d18e3[_0x212dc5](_0xf4ba('0x2d'));if(queryQueues[_0xf4ba('0x2e')](_0xf4ba('0x2f'))){delete queryQueues[_0xf4ba('0x2f')];}_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x31')][_0xf4ba('0x13')](queryQueues));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x32')][_0xf4ba('0x13')](queryQueues));_0x2d7a7d['push'](db[_0xf4ba('0x33')][_0xf4ba('0x13')](queryQueues));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x34')][_0xf4ba('0x13')](queryQueues));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x35')]['findAll'](queryQueues));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x36')][_0xf4ba('0x13')](queryQueues));_0x2d7a7d['push'](db[_0xf4ba('0x37')][_0xf4ba('0x13')](queryQueues));_0x2d7a7d[_0xf4ba('0x30')](db['User'][_0xf4ba('0x13')](queryTelephones));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x38')][_0xf4ba('0x13')](queryTrunks));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x19')][_0xf4ba('0x13')](queryCampaigns));_0x2d7a7d[_0xf4ba('0x30')](db[_0xf4ba('0x6')][_0xf4ba('0x13')](queryAgents));break;case'user':_0x3d18e3[_0x212dc5](_0xf4ba('0x2c'));_0x3d18e3[_0x212dc5](_0xf4ba('0x2d'));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x39'),_0x1bbf03[_0xf4ba('0x1f')],'VoiceQueue'));_0x2d7a7d['push'](getAssociatedResources('ChatQueues',_0x1bbf03[_0xf4ba('0x1f')],'ChatQueue'));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources('FaxQueues',_0x1bbf03[_0xf4ba('0x1f')],_0xf4ba('0x33')));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x10'),_0x1bbf03[_0xf4ba('0x1f')],_0xf4ba('0x34')));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x3a'),_0x1bbf03[_0xf4ba('0x1f')],'MailQueue'));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x11'),_0x1bbf03[_0xf4ba('0x1f')],'OpenchannelQueue'));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x12'),_0x1bbf03[_0xf4ba('0x1f')],_0xf4ba('0x37')));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x14'),_0x1bbf03[_0xf4ba('0x1f')],_0xf4ba('0x6')));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources('Trunks',_0x1bbf03[_0xf4ba('0x1f')],_0xf4ba('0x38')));_0x2d7a7d[_0xf4ba('0x30')](getAssociatedResources(_0xf4ba('0x16'),_0x1bbf03[_0xf4ba('0x1f')],_0xf4ba('0x19')));_0x2d7a7d['push'](db[_0xf4ba('0x6')][_0xf4ba('0x13')](queryAgents));break;case _0xf4ba('0x8'):_0x3d18e3[_0x212dc5](_0xf4ba('0x2c'));_0x3d18e3[_0x212dc5](_0xf4ba('0x2d'));_0x2d7a7d[_0xf4ba('0x30')](_0x1bbf03[_0xf4ba('0x3b')]({'attributes':['id',_0xf4ba('0x4')]}));_0x2d7a7d[_0xf4ba('0x30')](_0x1bbf03[_0xf4ba('0x3c')]({'attributes':['id',_0xf4ba('0x4')]}));_0x2d7a7d[_0xf4ba('0x30')](_0x1bbf03[_0xf4ba('0x3d')]({'attributes':['id',_0xf4ba('0x4')]}));_0x2d7a7d[_0xf4ba('0x30')](_0x1bbf03['getSmsQueues']({'attributes':['id',_0xf4ba('0x4')]}));_0x2d7a7d[_0xf4ba('0x30')](_0x1bbf03['getMailQueues']({'attributes':['id','name']}));_0x2d7a7d[_0xf4ba('0x30')](_0x1bbf03[_0xf4ba('0x3e')]({'attributes':['id','name']}));_0x2d7a7d['push'](_0x1bbf03[_0xf4ba('0x3f')]({'attributes':['id',_0xf4ba('0x4')]}));break;}return BPromise['all'](_0x2d7a7d);}})[_0xf4ba('0xc')](function(_0x5c616d){if(_0x5c616d&&_0x5c616d['length']){for(var _0x5982d3=0x0;_0x5982d3<_0x5c616d[_0xf4ba('0x40')];_0x5982d3+=0x1){for(var _0x4db0a3=0x0;_0x4db0a3<_0x5c616d[_0x5982d3][_0xf4ba('0x40')];_0x4db0a3+=0x1){switch(_0x5982d3){case 0x0:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,'voice',_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x1:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,'chat',_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x2:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,_0xf4ba('0x41'),_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x3:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,_0xf4ba('0x42'),_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x4:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,_0xf4ba('0x43'),_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x5:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,_0xf4ba('0x44'),_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x6:joinOrLeaveQueues(_0x3d18e3,_0x212dc5,_0xf4ba('0x45'),_0x5c616d[_0x5982d3][_0x4db0a3]);break;case 0x7:if(_0x5d099c[_0xf4ba('0x7')]!==_0xf4ba('0x8'))_0x3d18e3[_0x212dc5](util[_0xf4ba('0x2a')](_0xf4ba('0x46'),_0x5c616d[_0x5982d3][_0x4db0a3][_0xf4ba('0x4')]));break;case 0x8:if(_0x5d099c[_0xf4ba('0x7')]!=='agent')_0x3d18e3[_0x212dc5](util[_0xf4ba('0x2a')](_0xf4ba('0x47'),_0x5c616d[_0x5982d3][_0x4db0a3][_0xf4ba('0x4')]));break;case 0x9:if(_0x5d099c['role']!==_0xf4ba('0x8'))_0x3d18e3[_0x212dc5](util[_0xf4ba('0x2a')](_0xf4ba('0x48'),_0x5c616d[_0x5982d3][_0x4db0a3]['type'],_0x5c616d[_0x5982d3][_0x4db0a3][_0xf4ba('0x4')]));break;case 0xa:_0x3d18e3[_0x212dc5](util[_0xf4ba('0x2a')](_0xf4ba('0x1b'),_0x5c616d[_0x5982d3][_0x4db0a3][_0xf4ba('0x4')]));break;}}}}})[_0xf4ba('0xc')](function(){if(_0x212dc5===_0xf4ba('0x49')){var _0x15d676=_[_0xf4ba('0x4a')](_0x5d099c[_0xf4ba('0x20')],'id');return _0x5d099c['removeChatInteractions'](_0x15d676)[_0xf4ba('0xc')](function(){for(var _0x536d87=0x0;_0x536d87<_0x15d676[_0xf4ba('0x40')];_0x536d87+=0x1){_0x566333[_0xf4ba('0x4b')](_0xf4ba('0x4c'),{'ChatInteractionId':Number(_0x15d676[_0x536d87]),'UserId':Number(_0x5d099c['id'])});}});}})['then'](function(){if(_0x212dc5===_0xf4ba('0x49')){var _0x27d65e=_[_0xf4ba('0x4a')](_0x5d099c[_0xf4ba('0x22')],'id');return _0x5d099c[_0xf4ba('0x4d')](_0x27d65e)[_0xf4ba('0xc')](function(){for(var _0x555bcd=0x0;_0x555bcd<_0x27d65e[_0xf4ba('0x40')];_0x555bcd+=0x1){_0x566333[_0xf4ba('0x4b')](_0xf4ba('0x4e'),{'MailInteractionId':Number(_0x27d65e[_0x555bcd]),'UserId':Number(_0x5d099c['id'])});}});}})[_0xf4ba('0xc')](function(){if(_0x212dc5===_0xf4ba('0x49')){var _0x39220d=_['map'](_0x5d099c['FaxInteractions'],'id');return _0x5d099c[_0xf4ba('0x4f')](_0x39220d)[_0xf4ba('0xc')](function(){for(var _0x35dbe1=0x0;_0x35dbe1<_0x39220d[_0xf4ba('0x40')];_0x35dbe1+=0x1){_0x566333['emit'](_0xf4ba('0x50'),{'FaxInteractionId':Number(_0x39220d[_0x35dbe1]),'UserId':Number(_0x5d099c['id'])});}});}})['then'](function(){if(_0x212dc5===_0xf4ba('0x49')){var _0x48176c=_[_0xf4ba('0x4a')](_0x5d099c[_0xf4ba('0x26')],'id');return _0x5d099c['removeSmsInteractions'](_0x48176c)[_0xf4ba('0xc')](function(){for(var _0x43a0d6=0x0;_0x43a0d6<_0x48176c[_0xf4ba('0x40')];_0x43a0d6+=0x1){_0x566333[_0xf4ba('0x4b')](_0xf4ba('0x51'),{'SmsInteractionId':Number(_0x48176c[_0x43a0d6]),'UserId':Number(_0x5d099c['id'])});}});}})['then'](function(){if(_0x212dc5===_0xf4ba('0x49')){var _0x56e858=_[_0xf4ba('0x4a')](_0x5d099c['OpenchannelInteractions'],'id');return _0x5d099c[_0xf4ba('0x52')](_0x56e858)[_0xf4ba('0xc')](function(){for(var _0x60d20=0x0;_0x60d20<_0x56e858[_0xf4ba('0x40')];_0x60d20+=0x1){_0x566333[_0xf4ba('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x56e858[_0x60d20]),'UserId':Number(_0x5d099c['id'])});}});}})[_0xf4ba('0xc')](function(){if(_0x212dc5==='leave'){var _0x1679ff=_['map'](_0x5d099c[_0xf4ba('0x29')],'id');return _0x5d099c[_0xf4ba('0x53')](_0x1679ff)[_0xf4ba('0xc')](function(){for(var _0x54c0fb=0x0;_0x54c0fb<_0x1679ff['length'];_0x54c0fb+=0x1){_0x566333[_0xf4ba('0x4b')](_0xf4ba('0x54'),{'WhatsappInteractionId':Number(_0x1679ff[_0x54c0fb]),'UserId':Number(_0x5d099c['id'])});}});}})[_0xf4ba('0x55')](function(_0x294a30){_0x3d18e3[_0xf4ba('0x56')](_0x294a30);});}}function onDisconnect(_0x48b7a8,_0x168865){joinOrLeave(_0x48b7a8,'leave',_0x168865);}function onConnect(_0x2f6596){joinOrLeave(_0x2f6596,_0xf4ba('0x57'));}exports[_0xf4ba('0x58')]=function(_0x335db5){_0x335db5['on'](_0xf4ba('0x59'),function(_0xe9494a){_0xe9494a[_0xf4ba('0x5a')](0x0);_0xe9494a[_0xf4ba('0x5b')]=_0xe9494a['request'][_0xf4ba('0x59')][_0xf4ba('0x5c')]+':'+_0xe9494a['request'][_0xf4ba('0x59')]['remotePort'];_0xe9494a[_0xf4ba('0x5d')]=new Date();_0xe9494a[_0xf4ba('0x56')]=function(_0x24c388){console[_0xf4ba('0x56')](_0xf4ba('0x5e')+_0xe9494a[_0xf4ba('0x5f')][_0xf4ba('0x4')]+'['+_0xe9494a[_0xf4ba('0x5b')]+']',_0x24c388);};_0xe9494a['on'](_0xf4ba('0x60'),function(){onDisconnect(_0xe9494a,_0x335db5);_0xe9494a['log'](_0xf4ba('0x61'));});onConnect(_0xe9494a);_0xe9494a['log'](_0xf4ba('0x62'));});}; \ No newline at end of file +var _0x3e94=['connection','setMaxListeners','request','remotePort','SocketIO\x20','nsp','address','DISCONNECTED','lodash','util','../mysqldb','./environment','name','User','role','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','resourceId','map','where','telephone','Campaign','format','Agents','length','user:%s','query','find','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','OpenchannelInteractions','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','voice:outbound','userProfileId','ChatQueues','OpenchannelQueues','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default'];(function(_0x26a241,_0x2b1bc5){var _0x326e14=function(_0x3306b1){while(--_0x3306b1){_0x26a241['push'](_0x26a241['shift']());}};_0x326e14(++_0x2b1bc5);}(_0x3e94,0x67));var _0x43e9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x3e94[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var BPromise=require('bluebird');var db=require(_0x43e9('0x2'))['db'];var config=require(_0x43e9('0x3'));var queryQueues={'attributes':['id',_0x43e9('0x4')],'include':[{'as':'Agents','model':db[_0x43e9('0x5')],'attributes':['id',_0x43e9('0x4'),_0x43e9('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x43e9('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x43e9('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x43e9('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x43e9('0x4'),_0x43e9('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x1cabf1,_0x12597a,_0x43d6e8){return db[_0x43e9('0x9')][_0x43e9('0xa')]({'where':{'name':_0x1cabf1,'userProfileId':_0x12597a},'raw':!![]})[_0x43e9('0xb')](function(_0x437e1d){if(_0x437e1d){if(_0x437e1d[_0x43e9('0xc')]){switch(_0x1cabf1){case _0x43e9('0xd'):case'ChatQueues':case _0x43e9('0xe'):case _0x43e9('0xf'):case _0x43e9('0x10'):case'OpenchannelQueues':case _0x43e9('0x11'):return db[_0x43d6e8][_0x43e9('0x12')](queryQueues);case _0x43e9('0x13'):return db[_0x43d6e8][_0x43e9('0x12')](queryTelephones);case _0x43e9('0x14'):return db[_0x43d6e8]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x43d6e8][_0x43e9('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x43e9('0x12')]({'attributes':[_0x43e9('0x15')],'where':{'sectionId':_0x437e1d['id']},'raw':!![]})[_0x43e9('0xb')](function(_0x274175){if(_0x274175){var _0x3017bf={'where':{'id':_[_0x43e9('0x16')](_0x274175,_0x43e9('0x15'))},'raw':!![]};switch(_0x43d6e8){case _0x43e9('0x5'):_0x3017bf[_0x43e9('0x17')][_0x43e9('0x6')]=_0x43e9('0x18');break;case _0x43e9('0x19'):_0x3017bf[_0x43e9('0x17')][_0x43e9('0x8')]='ivr';break;}return db[_0x43d6e8]['findAll'](_0x3017bf);}else{return[];}});}}else{return[];}})[_0x43e9('0xb')](function(_0x381b8b){return _0x381b8b;});}function joinOrLeaveQueues(_0x663c43,_0x301114,_0x2f7f0d,_0x4bfb04){_0x663c43[_0x301114](util[_0x43e9('0x1a')]('%s:queue:%s',_0x2f7f0d,_0x4bfb04[_0x43e9('0x4')]));if(_0x4bfb04[_0x43e9('0x1b')]){for(var _0x777e8f=0x0;_0x777e8f<_0x4bfb04[_0x43e9('0x1b')][_0x43e9('0x1c')];_0x777e8f+=0x1){_0x663c43[_0x301114](util['format'](_0x43e9('0x1d'),_0x4bfb04[_0x43e9('0x1b')][_0x777e8f]['name']));}}}function joinOrLeave(_0xa3813,_0x25a8f9,_0x362e81){var _0x6e609b;if(_0xa3813['handshake'][_0x43e9('0x1e')]['id']){db['User'][_0x43e9('0x1f')]({'attributes':['id','name','role','userProfileId'],'where':{'id':_0xa3813['handshake'][_0x43e9('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x43e9('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x43e9('0x21')],'as':_0x43e9('0x22'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x43e9('0x23')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x43e9('0x24'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x197c88){if(_0x197c88){_0x6e609b=_0x197c88;_0xa3813[_0x25a8f9](util[_0x43e9('0x1a')]('user:%s',_0x197c88[_0x43e9('0x4')]));var _0x4bbf3a=[];switch(_0x197c88[_0x43e9('0x6')]){case'admin':_0xa3813[_0x25a8f9](_0x43e9('0x25'));_0xa3813[_0x25a8f9]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x43e9('0x26'))){delete queryQueues[_0x43e9('0x26')];}_0x4bbf3a[_0x43e9('0x27')](db[_0x43e9('0x28')][_0x43e9('0x12')](queryQueues));_0x4bbf3a['push'](db[_0x43e9('0x29')]['findAll'](queryQueues));_0x4bbf3a['push'](db[_0x43e9('0x2a')][_0x43e9('0x12')](queryQueues));_0x4bbf3a[_0x43e9('0x27')](db[_0x43e9('0x2b')]['findAll'](queryQueues));_0x4bbf3a[_0x43e9('0x27')](db[_0x43e9('0x2c')][_0x43e9('0x12')](queryQueues));_0x4bbf3a[_0x43e9('0x27')](db['OpenchannelQueue'][_0x43e9('0x12')](queryQueues));_0x4bbf3a[_0x43e9('0x27')](db[_0x43e9('0x2d')][_0x43e9('0x12')](queryQueues));_0x4bbf3a[_0x43e9('0x27')](db[_0x43e9('0x5')][_0x43e9('0x12')](queryTelephones));_0x4bbf3a['push'](db[_0x43e9('0x2e')][_0x43e9('0x12')](queryTrunks));_0x4bbf3a[_0x43e9('0x27')](db[_0x43e9('0x19')][_0x43e9('0x12')](queryCampaigns));_0x4bbf3a['push'](db[_0x43e9('0x5')][_0x43e9('0x12')](queryAgents));break;case _0x43e9('0x2f'):_0xa3813[_0x25a8f9]('voice:inbound');_0xa3813[_0x25a8f9](_0x43e9('0x30'));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0xd'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x28')));_0x4bbf3a['push'](getAssociatedResources(_0x43e9('0x32'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x29')));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0xe'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x2a')));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0xf'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x2b')));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0x10'),_0x197c88[_0x43e9('0x31')],'MailQueue'));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0x33'),_0x197c88[_0x43e9('0x31')],'OpenchannelQueue'));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0x11'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x2d')));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0x13'),_0x197c88['userProfileId'],_0x43e9('0x5')));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0x14'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x2e')));_0x4bbf3a[_0x43e9('0x27')](getAssociatedResources(_0x43e9('0x34'),_0x197c88[_0x43e9('0x31')],_0x43e9('0x19')));_0x4bbf3a[_0x43e9('0x27')](db['User']['findAll'](queryAgents));break;case _0x43e9('0x7'):_0xa3813[_0x25a8f9](_0x43e9('0x25'));_0xa3813[_0x25a8f9](_0x43e9('0x30'));_0x4bbf3a[_0x43e9('0x27')](_0x197c88[_0x43e9('0x35')]({'attributes':['id',_0x43e9('0x4')]}));_0x4bbf3a[_0x43e9('0x27')](_0x197c88['getChatQueues']({'attributes':['id',_0x43e9('0x4')]}));_0x4bbf3a['push'](_0x197c88[_0x43e9('0x36')]({'attributes':['id',_0x43e9('0x4')]}));_0x4bbf3a[_0x43e9('0x27')](_0x197c88[_0x43e9('0x37')]({'attributes':['id',_0x43e9('0x4')]}));_0x4bbf3a[_0x43e9('0x27')](_0x197c88[_0x43e9('0x38')]({'attributes':['id',_0x43e9('0x4')]}));_0x4bbf3a[_0x43e9('0x27')](_0x197c88['getOpenchannelQueues']({'attributes':['id',_0x43e9('0x4')]}));_0x4bbf3a[_0x43e9('0x27')](_0x197c88[_0x43e9('0x39')]({'attributes':['id',_0x43e9('0x4')]}));break;}return BPromise[_0x43e9('0x3a')](_0x4bbf3a);}})[_0x43e9('0xb')](function(_0x5692ac){if(_0x5692ac&&_0x5692ac[_0x43e9('0x1c')]){for(var _0x32950e=0x0;_0x32950e<_0x5692ac['length'];_0x32950e+=0x1){for(var _0x3e132d=0x0;_0x3e132d<_0x5692ac[_0x32950e][_0x43e9('0x1c')];_0x3e132d+=0x1){switch(_0x32950e){case 0x0:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x3b'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x1:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x3c'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x2:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x3d'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x3:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x3e'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x4:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x3f'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x5:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x40'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x6:joinOrLeaveQueues(_0xa3813,_0x25a8f9,_0x43e9('0x41'),_0x5692ac[_0x32950e][_0x3e132d]);break;case 0x7:if(_0x6e609b['role']!=='agent')_0xa3813[_0x25a8f9](util[_0x43e9('0x1a')](_0x43e9('0x42'),_0x5692ac[_0x32950e][_0x3e132d][_0x43e9('0x4')]));break;case 0x8:if(_0x6e609b['role']!==_0x43e9('0x7'))_0xa3813[_0x25a8f9](util[_0x43e9('0x1a')](_0x43e9('0x43'),_0x5692ac[_0x32950e][_0x3e132d]['name']));break;case 0x9:if(_0x6e609b['role']!==_0x43e9('0x7'))_0xa3813[_0x25a8f9](util[_0x43e9('0x1a')](_0x43e9('0x44'),_0x5692ac[_0x32950e][_0x3e132d][_0x43e9('0x8')],_0x5692ac[_0x32950e][_0x3e132d]['name']));break;case 0xa:_0xa3813[_0x25a8f9](util[_0x43e9('0x1a')](_0x43e9('0x1d'),_0x5692ac[_0x32950e][_0x3e132d]['name']));break;}}}}})[_0x43e9('0xb')](function(){if(_0x25a8f9===_0x43e9('0x45')){var _0x4ade24=_[_0x43e9('0x16')](_0x6e609b[_0x43e9('0x20')],'id');return _0x6e609b['removeChatInteractions'](_0x4ade24)[_0x43e9('0xb')](function(){for(var _0x2cb89f=0x0;_0x2cb89f<_0x4ade24[_0x43e9('0x1c')];_0x2cb89f+=0x1){_0x362e81[_0x43e9('0x46')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4ade24[_0x2cb89f]),'UserId':Number(_0x6e609b['id'])});}});}})[_0x43e9('0xb')](function(){if(_0x25a8f9===_0x43e9('0x45')){var _0x120233=_[_0x43e9('0x16')](_0x6e609b['MailInteractions'],'id');return _0x6e609b['removeMailInteractions'](_0x120233)[_0x43e9('0xb')](function(){for(var _0x59c03d=0x0;_0x59c03d<_0x120233[_0x43e9('0x1c')];_0x59c03d+=0x1){_0x362e81['emit'](_0x43e9('0x47'),{'MailInteractionId':Number(_0x120233[_0x59c03d]),'UserId':Number(_0x6e609b['id'])});}});}})[_0x43e9('0xb')](function(){if(_0x25a8f9==='leave'){var _0x2308b3=_[_0x43e9('0x16')](_0x6e609b[_0x43e9('0x48')],'id');return _0x6e609b[_0x43e9('0x49')](_0x2308b3)['then'](function(){for(var _0x1105d8=0x0;_0x1105d8<_0x2308b3['length'];_0x1105d8+=0x1){_0x362e81[_0x43e9('0x46')](_0x43e9('0x4a'),{'FaxInteractionId':Number(_0x2308b3[_0x1105d8]),'UserId':Number(_0x6e609b['id'])});}});}})[_0x43e9('0xb')](function(){if(_0x25a8f9==='leave'){var _0x4ec88a=_['map'](_0x6e609b[_0x43e9('0x4b')],'id');return _0x6e609b[_0x43e9('0x4c')](_0x4ec88a)['then'](function(){for(var _0x59a787=0x0;_0x59a787<_0x4ec88a[_0x43e9('0x1c')];_0x59a787+=0x1){_0x362e81[_0x43e9('0x46')](_0x43e9('0x4d'),{'SmsInteractionId':Number(_0x4ec88a[_0x59a787]),'UserId':Number(_0x6e609b['id'])});}});}})[_0x43e9('0xb')](function(){if(_0x25a8f9===_0x43e9('0x45')){var _0xf576fd=_[_0x43e9('0x16')](_0x6e609b[_0x43e9('0x24')],'id');return _0x6e609b[_0x43e9('0x4e')](_0xf576fd)[_0x43e9('0xb')](function(){for(var _0x54e2a2=0x0;_0x54e2a2<_0xf576fd[_0x43e9('0x1c')];_0x54e2a2+=0x1){_0x362e81[_0x43e9('0x46')](_0x43e9('0x4f'),{'OpenchannelInteractionId':Number(_0xf576fd[_0x54e2a2]),'UserId':Number(_0x6e609b['id'])});}});}})['then'](function(){if(_0x25a8f9===_0x43e9('0x45')){var _0x5166cb=_[_0x43e9('0x16')](_0x6e609b[_0x43e9('0x50')],'id');return _0x6e609b[_0x43e9('0x51')](_0x5166cb)[_0x43e9('0xb')](function(){for(var _0x592293=0x0;_0x592293<_0x5166cb[_0x43e9('0x1c')];_0x592293+=0x1){_0x362e81[_0x43e9('0x46')](_0x43e9('0x52'),{'WhatsappInteractionId':Number(_0x5166cb[_0x592293]),'UserId':Number(_0x6e609b['id'])});}});}})[_0x43e9('0x53')](function(_0x13ede8){_0xa3813[_0x43e9('0x54')](_0x13ede8);});}}function onDisconnect(_0x5703a5,_0x30eec3){joinOrLeave(_0x5703a5,_0x43e9('0x45'),_0x30eec3);}function onConnect(_0x32b474){joinOrLeave(_0x32b474,_0x43e9('0x55'));}exports[_0x43e9('0x56')]=function(_0x3f2eac){_0x3f2eac['on'](_0x43e9('0x57'),function(_0x4f73d1){_0x4f73d1[_0x43e9('0x58')](0x0);_0x4f73d1['address']=_0x4f73d1[_0x43e9('0x59')][_0x43e9('0x57')]['remoteAddress']+':'+_0x4f73d1[_0x43e9('0x59')]['connection'][_0x43e9('0x5a')];_0x4f73d1['connectedAt']=new Date();_0x4f73d1['log']=function(_0x20ab3d){console['log'](_0x43e9('0x5b')+_0x4f73d1[_0x43e9('0x5c')][_0x43e9('0x4')]+'['+_0x4f73d1[_0x43e9('0x5d')]+']',_0x20ab3d);};_0x4f73d1['on']('disconnect',function(){onDisconnect(_0x4f73d1,_0x3f2eac);_0x4f73d1[_0x43e9('0x54')](_0x43e9('0x5e'));});onConnect(_0x4f73d1);_0x4f73d1[_0x43e9('0x54')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 241142b..4b93177 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 _0x5af7=['User','fullname','internal','interface','format','name','agent','outgoingmessage','get','event','opened','sequelize','changed','closed','find','email','SIP/%s','length','hasOwnProperty','model','hook','callback','util','jayson/promise','lodash','http','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','Sms','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','substatus','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','Trigger,\x20%s','catch','channel','motionChannel','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','QueryTypes','SELECT','contact','UserId'];(function(_0x1f4c5a,_0x44baf0){var _0x33e64f=function(_0x3f56b3){while(--_0x3f56b3){_0x1f4c5a['push'](_0x1f4c5a['shift']());}};_0x33e64f(++_0x44baf0);}(_0x5af7,0x9c));var _0x75af=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x5af7[_0x220f3f];return _0x1f170e;};'use strict';var util=require(_0x75af('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0x75af('0x1'));var logger=require('../logger')('triggers');var _=require(_0x75af('0x2'));var client=jayson['client'][_0x75af('0x3')]({'port':0x232a});var triggers=[{'channel':_0x75af('0x4'),'model':_0x75af('0x5'),'event':'afterCreate','condition':_0x75af('0x6'),'callback':afterCreate},{'channel':_0x75af('0x4'),'model':_0x75af('0x5'),'event':_0x75af('0x7'),'condition':_0x75af('0x8'),'callback':afterUpdate},{'channel':_0x75af('0x4'),'model':_0x75af('0x9'),'event':_0x75af('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x75af('0xb'),'model':'SmsInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x75af('0xb'),'model':'SmsInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x75af('0xc'),'event':'afterCreate','condition':_0x75af('0xd'),'callback':afterCreateMessage},{'channel':_0x75af('0xe'),'model':_0x75af('0xf'),'event':_0x75af('0xa'),'condition':_0x75af('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x75af('0xf'),'event':_0x75af('0x7'),'condition':_0x75af('0x8'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x75af('0x10'),'event':_0x75af('0xa'),'condition':_0x75af('0xd'),'callback':afterCreateMessage},{'channel':_0x75af('0x11'),'model':_0x75af('0x12'),'event':'afterCreate','condition':_0x75af('0x6'),'callback':afterCreate},{'channel':_0x75af('0x11'),'model':'FaxInteraction','event':_0x75af('0x7'),'condition':_0x75af('0x8'),'callback':afterUpdate},{'channel':_0x75af('0x11'),'model':_0x75af('0x13'),'event':_0x75af('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x75af('0x14'),'event':_0x75af('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x75af('0x15'),'model':_0x75af('0x14'),'event':_0x75af('0x7'),'condition':_0x75af('0x8'),'callback':afterUpdate},{'channel':_0x75af('0x15'),'model':'MailInteraction','event':'substatus','condition':_0x75af('0x16'),'callback':afterUpdate},{'channel':_0x75af('0x15'),'model':_0x75af('0x17'),'event':_0x75af('0xa'),'condition':_0x75af('0xd'),'callback':afterCreateMessage},{'channel':_0x75af('0x18'),'model':_0x75af('0x19'),'event':_0x75af('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0x75af('0x19'),'event':_0x75af('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x75af('0x1a'),'event':_0x75af('0xa'),'condition':_0x75af('0xd'),'callback':afterCreateMessage}];function request(_0x4b6e61){return client[_0x75af('0x1b')](_0x75af('0x1c'),_0x4b6e61)[_0x75af('0x1d')](function(_0x1b5208){logger[_0x75af('0x1e')]('Trigger,\x20%s',_0x75af('0x1c'),_0x1b5208);if(_0x1b5208[_0x75af('0x1f')]){if(_0x1b5208[_0x75af('0x1f')]['code']===0x1f4){logger['error'](_0x75af('0x20'),_0x75af('0x1c'),_0x1b5208[_0x75af('0x1f')]);}}})[_0x75af('0x21')](function(_0x45a3a7){logger[_0x75af('0x1f')](_0x75af('0x20'),'EventManager',_0x45a3a7);});}function afterCreateMessage(_0x361b58,_0x5899e4){return function(_0x51ce65,_0xa61a07){_0x51ce65=_0x51ce65['get']({'plain':!![]});_0x51ce65[_0x75af('0x22')]=_0x361b58;_0x51ce65[_0x75af('0x23')]=_0x361b58;_0x51ce65['event']=_0x51ce65[_0x75af('0x24')];var _0x2ab0c3=_0x75af('0x25')+_0x51ce65[_0x75af('0x26')];return db['sequelize'][_0x75af('0x27')](_0x2ab0c3,{'type':db[_0x75af('0x28')][_0x75af('0x29')][_0x75af('0x2a')],'raw':!![]})[_0x75af('0x1d')](function(_0x2d26ba){return _0x2d26ba;})[_0x75af('0x1d')](function(_0x382ccc){if(_0x382ccc){_0x51ce65[_0x75af('0x2b')]=_0x382ccc[0x0];}if(_0x51ce65[_0x75af('0x2c')]){return db[_0x75af('0x2d')]['find']({'where':{'id':_0x51ce65[_0x75af('0x2c')]},'attributes':['id','name',_0x75af('0x2e'),'email',_0x75af('0x2f')],'raw':!![]})[_0x75af('0x1d')](function(_0x58425b){_0x51ce65[_0x75af('0x30')]=util[_0x75af('0x31')]('SIP/%s',_0x58425b[_0x75af('0x32')]);_0x51ce65[_0x75af('0x22')]=_0x361b58;_0x51ce65[_0x75af('0x33')]=_0x58425b;return request({'event':'incomingmessage','message':_0x51ce65});})['catch'](function(_0x720ed6){console[_0x75af('0x1f')](_0x720ed6);});}else{return request({'event':_0x75af('0x34'),'message':_0x51ce65});}});};}function afterCreate(_0xf71aa6,_0x76e7c5){return function(_0x4b8571,_0x40dbbf){_0x4b8571=_0x4b8571[_0x75af('0x35')]({'plain':!![]});_0x4b8571['channel']=_0xf71aa6;_0x4b8571['motionChannel']=_0xf71aa6;_0x4b8571[_0x75af('0x36')]=_0x75af('0x37');var _0x26c314=_0x75af('0x25')+_0x4b8571[_0x75af('0x26')];return db[_0x75af('0x38')][_0x75af('0x27')](_0x26c314,{'type':db[_0x75af('0x28')]['QueryTypes'][_0x75af('0x2a')],'raw':!![]})['then'](function(_0x55b996){return _0x55b996;})['then'](function(_0x25dbd2){if(_0x25dbd2){_0x4b8571[_0x75af('0x2b')]=_0x25dbd2[0x0];}return request({'event':_0x76e7c5,'message':_0x4b8571});});};}function afterUpdate(_0x1e72ed,_0x152f20){return function(_0x43fd2f,_0x2a37bc){if(_0x43fd2f[_0x75af('0x39')](_0x75af('0x3a'))&&_0x43fd2f[_0x75af('0x3a')]){_0x43fd2f=_0x43fd2f[_0x75af('0x35')]({'plain':!![]});_0x43fd2f[_0x75af('0x22')]=_0x1e72ed;_0x43fd2f[_0x75af('0x23')]=_0x1e72ed;_0x43fd2f[_0x75af('0x36')]='closed';var _0x49dfb7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x43fd2f[_0x75af('0x26')];return db['sequelize']['query'](_0x49dfb7,{'type':db[_0x75af('0x28')][_0x75af('0x29')][_0x75af('0x2a')],'raw':!![]})[_0x75af('0x1d')](function(_0x39963f){return _0x39963f;})[_0x75af('0x1d')](function(_0x3e9d5a){if(_0x3e9d5a){_0x43fd2f[_0x75af('0x2b')]=_0x3e9d5a[0x0];}if(_0x43fd2f[_0x75af('0x2c')]){return db['User'][_0x75af('0x3b')]({'where':{'id':_0x43fd2f['UserId']},'attributes':['id',_0x75af('0x32'),_0x75af('0x2e'),_0x75af('0x3c'),_0x75af('0x2f')],'raw':!![]})['then'](function(_0x3f282a){_0x43fd2f[_0x75af('0x30')]=util[_0x75af('0x31')](_0x75af('0x3d'),_0x3f282a['name']);_0x43fd2f[_0x75af('0x33')]=_0x3f282a;return request({'event':_0x152f20,'message':_0x43fd2f});})[_0x75af('0x21')](function(_0x3661cc){console[_0x75af('0x1f')](_0x3661cc);});}else{return request({'event':_0x152f20,'message':_0x43fd2f});}});}else if(_0x43fd2f[_0x75af('0x39')](_0x75af('0x16'))){_0x43fd2f=_0x43fd2f[_0x75af('0x35')]({'plain':!![]});_0x43fd2f[_0x75af('0x22')]=_0x1e72ed;_0x43fd2f['event']=_0x75af('0x16');var _0x49dfb7=_0x75af('0x25')+_0x43fd2f[_0x75af('0x26')];return db[_0x75af('0x38')][_0x75af('0x27')](_0x49dfb7,{'type':db[_0x75af('0x28')][_0x75af('0x29')]['SELECT'],'raw':!![]})[_0x75af('0x1d')](function(_0x1b2d47){return _0x1b2d47;})[_0x75af('0x1d')](function(_0x30bcda){if(_0x30bcda){_0x43fd2f[_0x75af('0x2b')]=_0x30bcda[0x0];}if(_0x43fd2f[_0x75af('0x2c')]){return db['User'][_0x75af('0x3b')]({'where':{'id':_0x43fd2f['UserId']},'attributes':['id',_0x75af('0x32'),_0x75af('0x2e'),_0x75af('0x3c'),_0x75af('0x2f')],'raw':!![]})[_0x75af('0x1d')](function(_0x1dfafa){_0x43fd2f[_0x75af('0x30')]=util['format'](_0x75af('0x3d'),_0x1dfafa[_0x75af('0x32')]);_0x43fd2f[_0x75af('0x33')]=_0x1dfafa;return request({'event':_0x152f20,'message':_0x43fd2f});})[_0x75af('0x21')](function(_0xabd524){console['error'](_0xabd524);});}else{return request({'event':_0x152f20,'message':_0x43fd2f});}});}};}exports['default']=function(){for(var _0x53b50c=0x0;_0x53b50c=_0xe8edd0[_0x9518('0x11')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x23cd5b(_0x17dbb3);})[_0x9518('0x12')](function(_0x4ae42b){_0x2ab0fd(_0x4ae42b);});});}; \ No newline at end of file +var _0x9e2b=['getLicense','role','agent','count','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','../mysqldb','./license/util','mail','chat','whatsapp','getChannels','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x20ebac,_0x2f7138){var _0x3c8f26=function(_0x285eeb){while(--_0x285eeb){_0x20ebac['push'](_0x20ebac['shift']());}};_0x3c8f26(++_0x2f7138);}(_0x9e2b,0x6c));var _0xb9e2=function(_0x28adfa,_0x2a3303){_0x28adfa=_0x28adfa-0x0;var _0x3c664c=_0x9e2b[_0x28adfa];return _0x3c664c;};'use strict';var _=require('lodash');var BPromise=require(_0xb9e2('0x0'));var db=require(_0xb9e2('0x1'))['db'];var util=require(_0xb9e2('0x2'));var channels=['voice',_0xb9e2('0x3'),_0xb9e2('0x4'),'fax','sms',_0xb9e2('0x5'),'openchannel'];exports[_0xb9e2('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x453644){_0x453644=_0x453644['toLowerCase']();return _['includes'](channels,_0x453644);};exports[_0xb9e2('0x7')]=function(_0x1bf821,_0x3f0ced,_0xc39db5,_0x16ddce){var _0x4fe4d5={'loginAttempts':_0x3f0ced,'blocked':_0xc39db5};if(!_[_0xb9e2('0x8')](_0x16ddce)){_0x4fe4d5[_0xb9e2('0x9')]=_0x16ddce;}return _0x1bf821[_0xb9e2('0xa')](_0x4fe4d5);};exports[_0xb9e2('0xb')]=function(_0x2207e6){return new BPromise(function(_0x43c769,_0x417483){var _0x29181c=0x0;if(_0x2207e6[_0xb9e2('0xc')]!==_0xb9e2('0xd')){_0x43c769(_0x2207e6);}db['User'][_0xb9e2('0xe')]({'where':{'role':_0xb9e2('0xd'),'online':!![],'id':{'$ne':_0x2207e6['id']}}})['then'](function(_0x2fa75f){_0x29181c=_0x2fa75f;return util[_0xb9e2('0xb')]();})['then'](function(_0x15771d){if(_0x15771d&&_0x15771d[_0xb9e2('0xf')]&&_0x29181c>=_0x15771d[_0xb9e2('0xf')]){throw Error(_0xb9e2('0x10'));}_0x43c769(_0x2207e6);})['catch'](function(_0x31d374){_0x417483(_0x31d374);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 3e011a9..5af9951 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbbbb=['status','render','json','send','exports'];(function(_0xed0ca7,_0x300f49){var _0x32dfd2=function(_0x17df0a){while(--_0x17df0a){_0xed0ca7['push'](_0xed0ca7['shift']());}};_0x32dfd2(++_0x300f49);}(_0xbbbb,0xf4));var _0xbbbb=function(_0x12e42a,_0x45de0f){_0x12e42a=_0x12e42a-0x0;var _0x35f0c8=_0xbbbb[_0x12e42a];return _0x35f0c8;};'use strict';module[_0xbbbb('0x0')][0x194]=function pageNotFound(_0xd63b3f,_0x601dcf){var _0x23c2bf='404';var _0x593a04=0x194;var _0xd34878={'status':_0x593a04};_0x601dcf[_0xbbbb('0x1')](_0xd34878[_0xbbbb('0x1')]);_0x601dcf[_0xbbbb('0x2')](_0x23c2bf,{},function(_0x574cd1,_0x28aba0){if(_0x574cd1){return _0x601dcf[_0xbbbb('0x1')](_0xd34878['status'])[_0xbbbb('0x3')](_0xd34878);}_0x601dcf[_0xbbbb('0x4')](_0x28aba0);});}; \ No newline at end of file +var _0x88c3=['404','status','render','json','send'];(function(_0x1fd3dd,_0x89682a){var _0x2461e0=function(_0x1cef7d){while(--_0x1cef7d){_0x1fd3dd['push'](_0x1fd3dd['shift']());}};_0x2461e0(++_0x89682a);}(_0x88c3,0x1c2));var _0x388c=function(_0x330795,_0x10fd1b){_0x330795=_0x330795-0x0;var _0x3170a7=_0x88c3[_0x330795];return _0x3170a7;};'use strict';module['exports'][0x194]=function pageNotFound(_0x1ae331,_0x4f05c2){var _0x1e1203=_0x388c('0x0');var _0x4f9d4c=0x194;var _0x277c47={'status':_0x4f9d4c};_0x4f05c2[_0x388c('0x1')](_0x277c47['status']);_0x4f05c2[_0x388c('0x2')](_0x1e1203,{},function(_0x149401,_0x4281e5){if(_0x149401){return _0x4f05c2[_0x388c('0x1')](_0x277c47[_0x388c('0x1')])[_0x388c('0x3')](_0x277c47);}_0x4f05c2[_0x388c('0x4')](_0x4281e5);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 5d9823b..bcf4b18 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e0=['SmsInteractions','FaxInteractions','MailInteraction','UserNotifications','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteraction','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccount','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','BlackLists','ScreenRecording','Messages','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','Imap','Disposition','Answers','Interactions','TemplateId','mandatoryDispositionPause','team_has_mail_queues','Teams','Owner','mail_interaction_has_tags','ThroughTags','MailInteractionId','Attachments','Interaction','restrict','TagId','ListId','Items','FaxAccountId','Exntensions','FaxMessage','List','FaxInteractionId','Account','fax_interaction_has_tags','Tags','AttachmentId','Dispositions','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Users','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','cm_contact_has_tags','CampaignId','Condition','All','OneAll','OneAny','Action','Actions','Intervals','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','SalesforceConfiguration','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','DeskAccount','int_desk_configuration_has_tags','Descriptions','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','SessionId','JscriptyProject','ProjectId','user_has_square_projects','team_has_fax_queues','team_has_whatsapp_queues','WhatsappQueues','Hoppers','campaigns_has_cm_lists','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappMessage','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','name','utf8_general_ci','sequelizeHistory','mysql','utf8mb4','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../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/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','hasMany','VoiceRecording','UserId','UserVoiceQueueRt','VoiceQueuesRt','Extensions','CmHopperHistory','OpenchannelInteractions'];(function(_0x4ddbdc,_0x16a20a){var _0x1865ad=function(_0x45e400){while(--_0x45e400){_0x4ddbdc['push'](_0x4ddbdc['shift']());}};_0x1865ad(++_0x16a20a);}(_0x55e0,0xdc));var _0x055e=function(_0x334b0e,_0x441488){_0x334b0e=_0x334b0e-0x0;var _0x38b00d=_0x55e0[_0x334b0e];return _0x38b00d;};'use strict';var config=require(_0x055e('0x0'));var Sequelize=require(_0x055e('0x1'));var _=require(_0x055e('0x2'));var jstz=require(_0x055e('0x3'));var timezone=jstz['determine']();config['sequelize']=_[_0x055e('0x4')](config[_0x055e('0x1')],{'database':_0x055e('0x5'),'username':_0x055e('0x6'),'password':_0x055e('0x7'),'options':{'host':_0x055e('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x055e('0x9')](),'define':{'charset':'utf8','collate':_0x055e('0xa')}}});config[_0x055e('0xb')]=_[_0x055e('0x4')](config[_0x055e('0xb')],{'database':_0x055e('0x5'),'username':'xcall','password':_0x055e('0x7'),'options':{'host':_0x055e('0x8'),'port':0xcea,'dialect':_0x055e('0xc'),'dialectOptions':{'charset':_0x055e('0xd')},'logging':![],'timezone':timezone[_0x055e('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x055e('0x1')]['database'],config[_0x055e('0x1')][_0x055e('0xe')],config[_0x055e('0x1')][_0x055e('0xf')],config[_0x055e('0x1')][_0x055e('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x055e('0xb')]['database'],config[_0x055e('0xb')][_0x055e('0xe')],config[_0x055e('0xb')][_0x055e('0xf')],config[_0x055e('0xb')]['options'])};db[_0x055e('0x11')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/user/user.model');db[_0x055e('0x13')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x14'));db[_0x055e('0x15')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x16'));db[_0x055e('0x17')]=db[_0x055e('0x1')]['import'](_0x055e('0x18'));db[_0x055e('0x19')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x1a'));db[_0x055e('0x1b')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x1c'));db['VoiceRecording']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x1d'));db['ScreenRecording']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x1e'));db[_0x055e('0x1f')]=db['sequelize'][_0x055e('0x12')]('../api/voiceMail/voiceMail.model');db[_0x055e('0x20')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x21'));db[_0x055e('0x22')]=db[_0x055e('0x1')]['import'](_0x055e('0x23'));db[_0x055e('0x24')]=db[_0x055e('0x1')]['import'](_0x055e('0x25'));db[_0x055e('0x26')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x055e('0x27')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x28'));db[_0x055e('0x29')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/memberReport/memberReport.model');db[_0x055e('0x2a')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x2b'));db[_0x055e('0x2c')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x2d'));db['UserVoiceQueueRt']=db[_0x055e('0x1')][_0x055e('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x055e('0x2e')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x2f'));db[_0x055e('0x30')]=db[_0x055e('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db[_0x055e('0x31')]=db['sequelize']['import']('../api/userMailQueue/userMailQueue.model');db[_0x055e('0x32')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x33'));db[_0x055e('0x34')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x35'));db[_0x055e('0x36')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x37'));db['UserWhatsappQueue']=db['sequelize'][_0x055e('0x12')](_0x055e('0x38'));db[_0x055e('0x39')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x3a'));db[_0x055e('0x3b')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x3c'));db[_0x055e('0x3d')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/mailAccount/mailAccount.model');db[_0x055e('0x3e')]=db[_0x055e('0x1')]['import'](_0x055e('0x3f'));db[_0x055e('0x40')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x41'));db['MailInteraction']=db[_0x055e('0x1')][_0x055e('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0x055e('0x42')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/mailMessage/mailMessage.model');db[_0x055e('0x43')]=db[_0x055e('0x1')]['import'](_0x055e('0x44'));db[_0x055e('0x45')]=db[_0x055e('0x1')]['import'](_0x055e('0x46'));db[_0x055e('0x47')]=db[_0x055e('0x1')]['import']('../api/dashboard/dashboard.model');db[_0x055e('0x48')]=db[_0x055e('0x1')]['import'](_0x055e('0x49'));db['FaxAccount']=db[_0x055e('0x1')]['import'](_0x055e('0x4a'));db[_0x055e('0x4b')]=db[_0x055e('0x1')]['import']('../api/faxApplication/faxApplication.model');db[_0x055e('0x4c')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x4d'));db['FaxMessage']=db['sequelize'][_0x055e('0x12')](_0x055e('0x4e'));db['FaxQueue']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x4f'));db[_0x055e('0x50')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/faxQueueReport/faxQueueReport.model');db[_0x055e('0x51')]=db[_0x055e('0x1')]['import'](_0x055e('0x52'));db[_0x055e('0x53')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x54'));db[_0x055e('0x55')]=db[_0x055e('0x1')]['import'](_0x055e('0x56'));db['SmsMessage']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x57'));db['SmsQueue']=db['sequelize'][_0x055e('0x12')](_0x055e('0x58'));db[_0x055e('0x59')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x5a'));db[_0x055e('0x5b')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0x055e('0x5c')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x5d'));db[_0x055e('0x5e')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x5f'));db[_0x055e('0x60')]=db['sequelize'][_0x055e('0x12')]('../api/openchannelQueue/openchannelQueue.model');db[_0x055e('0x61')]=db[_0x055e('0x1')]['import'](_0x055e('0x62'));db[_0x055e('0x63')]=db[_0x055e('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x055e('0x64')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x65'));db[_0x055e('0x66')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x67'));db[_0x055e('0x68')]=db[_0x055e('0x1')]['import'](_0x055e('0x69'));db[_0x055e('0x6a')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x055e('0x6b')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x6c'));db['ChatGroup']=db['sequelize'][_0x055e('0x12')](_0x055e('0x6d'));db[_0x055e('0x6e')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x6f'));db[_0x055e('0x70')]=db[_0x055e('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0x055e('0x71')]=db[_0x055e('0x1')]['import'](_0x055e('0x72'));db[_0x055e('0x73')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/cmHopper/cmHopper.model');db[_0x055e('0x74')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x75'));db[_0x055e('0x76')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x77'));db['CmHopperHistory']=db[_0x055e('0x1')][_0x055e('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x055e('0x78')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x79'));db['CmCustomField']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x7a'));db['Action']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x7b'));db[_0x055e('0x7c')]=db[_0x055e('0x1')]['import'](_0x055e('0x7d'));db[_0x055e('0x7e')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x7f'));db['Disposition']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x80'));db['Condition']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x81'));db[_0x055e('0x82')]=db[_0x055e('0x1')]['import'](_0x055e('0x83'));db['Pause']=db[_0x055e('0x1')][_0x055e('0x12')]('../api/pause/pause.model');db[_0x055e('0x84')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x85'));db['VoiceQueuesLog']=db['sequelize'][_0x055e('0x12')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x055e('0x86')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x87'));db[_0x055e('0x88')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x89'));db[_0x055e('0x8a')]=db[_0x055e('0x1')]['import']('../api/tag/tag.model');db[_0x055e('0x8b')]=db[_0x055e('0x1')]['import'](_0x055e('0x8c'));db['Trigger']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x8d'));db[_0x055e('0x8e')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x8f'));db[_0x055e('0x90')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x91'));db[_0x055e('0x92')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x93'));db[_0x055e('0x94')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x055e('0x95')]=db[_0x055e('0x1')]['import'](_0x055e('0x96'));db[_0x055e('0x97')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x055e('0x98')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x99'));db[_0x055e('0x9a')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x9b'));db[_0x055e('0x9c')]=db[_0x055e('0x1')]['import'](_0x055e('0x9d'));db[_0x055e('0x9e')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x9f'));db['SalesforceConfiguration']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xa0'));db[_0x055e('0xa1')]=db['sequelize'][_0x055e('0x12')](_0x055e('0xa2'));db[_0x055e('0xa3')]=db[_0x055e('0x1')]['import'](_0x055e('0xa4'));db[_0x055e('0xa5')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xa6'));db['SugarcrmField']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xa7'));db['DeskAccount']=db['sequelize'][_0x055e('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x055e('0xa8')]=db[_0x055e('0x1')]['import'](_0x055e('0xa9'));db[_0x055e('0xaa')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xab'));db[_0x055e('0xac')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xad'));db[_0x055e('0xae')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xaf'));db[_0x055e('0xb0')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/intZohoField/intZohoField.model');db[_0x055e('0xb1')]=db['sequelize']['import'](_0x055e('0xb2'));db[_0x055e('0xb3')]=db[_0x055e('0x1')]['import'](_0x055e('0xb4'));db[_0x055e('0xb5')]=db['sequelize'][_0x055e('0x12')](_0x055e('0xb6'));db['FreshdeskAccount']=db[_0x055e('0x1')]['import'](_0x055e('0xb7'));db[_0x055e('0xb8')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize'][_0x055e('0x12')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x055e('0x1')]['import'](_0x055e('0xb9'));db[_0x055e('0xba')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xbb'));db[_0x055e('0xbc')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xbd'));db['ServicenowConfiguration']=db[_0x055e('0x1')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x055e('0xbe')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/intServicenowField/intServicenowField.model');db[_0x055e('0xbf')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x055e('0xc0')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xc1'));db[_0x055e('0xc2')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xc3'));db[_0x055e('0xc4')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xc5'));db[_0x055e('0xc6')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xc7'));db['FreshsalesField']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xc8'));db['Integration']=db['sequelize']['import'](_0x055e('0x91'));db[_0x055e('0xc9')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xca'));db[_0x055e('0xcb')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x055e('0xcc')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xcd'));db[_0x055e('0xce')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xcf'));db[_0x055e('0xd0')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xd1'));db['JscriptySessionReport']=db['sequelize'][_0x055e('0x12')](_0x055e('0xd2'));db[_0x055e('0xd3')]=db['sequelize'][_0x055e('0x12')](_0x055e('0xd4'));db[_0x055e('0xd5')]=db['sequelize'][_0x055e('0x12')]('../api/squareReport/squareReport.model');db[_0x055e('0xd6')]=db['sequelize'][_0x055e('0x12')](_0x055e('0xd7'));db['JscriptyProject']=db['sequelize'][_0x055e('0x12')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xd8'));db[_0x055e('0xd9')]=db[_0x055e('0x1')]['import'](_0x055e('0xda'));db[_0x055e('0xdb')]=db['sequelize'][_0x055e('0x12')](_0x055e('0xdc'));db[_0x055e('0xdd')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xde'));db[_0x055e('0xdf')]=db[_0x055e('0x1')]['import'](_0x055e('0xe0'));db[_0x055e('0xe1')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xe2'));db[_0x055e('0xe3')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xe4'));db[_0x055e('0xe5')]=db[_0x055e('0x1')]['import'](_0x055e('0xe6'));db[_0x055e('0xe7')]=db[_0x055e('0x1')]['import']('../api/migration/migration.model');db[_0x055e('0xe8')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xe9'));db[_0x055e('0xea')]=db[_0x055e('0x1')]['import'](_0x055e('0xeb'));db[_0x055e('0xec')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xed'));db[_0x055e('0xee')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xef'));db['FaxTransferReport']=db['sequelize']['import'](_0x055e('0xf0'));db[_0x055e('0xf1')]=db[_0x055e('0x1')]['import'](_0x055e('0xf2'));db[_0x055e('0xf3')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xf4'));db[_0x055e('0xf5')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/cmList/cmList.model');db[_0x055e('0xf6')]=db[_0x055e('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x055e('0xf7')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0xf8'));db['UserProfileSection']=db['sequelize'][_0x055e('0x12')](_0x055e('0xf9'));db[_0x055e('0xfa')]=db[_0x055e('0x1')][_0x055e('0x12')]('../api/userProfileResource/userProfileResource.model');db[_0x055e('0xfb')]=db[_0x055e('0x1')]['import'](_0x055e('0xfc'));db['WhatsappAccount']=db['sequelize']['import'](_0x055e('0xfd'));db[_0x055e('0xfe')]=db['sequelize'][_0x055e('0x12')](_0x055e('0xff'));db['WhatsappInteraction']=db[_0x055e('0x1')]['import'](_0x055e('0x100'));db['WhatsappMessage']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x101'));db[_0x055e('0x102')]=db['sequelize'][_0x055e('0x12')](_0x055e('0x103'));db['WhatsappTransferReport']=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x104'));db[_0x055e('0x105')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x106'));db[_0x055e('0x107')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x108'));db[_0x055e('0x109')]=db[_0x055e('0x1')][_0x055e('0x12')](_0x055e('0x10a'));db[_0x055e('0x10b')]=db['sequelize'][_0x055e('0x12')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x055e('0x10c')]=db[_0x055e('0x1')]['import'](_0x055e('0x10d'));db['User'][_0x055e('0x10e')](db['VoiceMail'],{'as':_0x055e('0x1f'),'onDelete':_0x055e('0x10f'),'foreignKey':'UserId'});db[_0x055e('0x11')][_0x055e('0x110')](db[_0x055e('0x111')],{'as':'Recordings','foreignKey':_0x055e('0x112')});db[_0x055e('0x11')][_0x055e('0x110')](db[_0x055e('0x113')],{'as':_0x055e('0x114'),'foreignKey':_0x055e('0x112')});db['User'][_0x055e('0x110')](db['VoiceExtension'],{'as':_0x055e('0x115'),'onDelete':_0x055e('0x10f'),'hooks':!![]});db['User']['hasMany'](db[_0x055e('0x76')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x055e('0x11')]['hasMany'](db[_0x055e('0x116')],{'as':'HopperHistory','foreignKey':_0x055e('0x112')});db[_0x055e('0x11')][_0x055e('0x110')](db[_0x055e('0x78')],{'as':_0x055e('0x78'),'foreignKey':'UserId'});db['User'][_0x055e('0x110')](db[_0x055e('0x5c')],{'as':_0x055e('0x117'),'foreignKey':_0x055e('0x112')});db['User'][_0x055e('0x110')](db[_0x055e('0x66')],{'as':'ChatInteractions','foreignKey':_0x055e('0x112')});db[_0x055e('0x11')][_0x055e('0x110')](db[_0x055e('0x55')],{'as':_0x055e('0x118'),'foreignKey':_0x055e('0x112')});db['User'][_0x055e('0x110')](db[_0x055e('0x4c')],{'as':_0x055e('0x119'),'foreignKey':'UserId'});db[_0x055e('0x11')][_0x055e('0x110')](db[_0x055e('0x11a')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0x055e('0x11')][_0x055e('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':_0x055e('0x112')});db['User'][_0x055e('0x110')](db[_0x055e('0xfb')],{'as':_0x055e('0x11b'),'foreignKey':'SenderId'});db[_0x055e('0x11')][_0x055e('0x11c')](db[_0x055e('0xf7')],{'as':'UserProfile','foreignKey':_0x055e('0x11d')});db['User'][_0x055e('0x11e')](db[_0x055e('0x11f')],{'as':_0x055e('0x120'),'through':_0x055e('0x121')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x71')],{'as':_0x055e('0x122'),'through':_0x055e('0x123')});db[_0x055e('0x11')][_0x055e('0x11e')](db['CmList'],{'as':'Lists','through':_0x055e('0x124')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0xe1')],{'through':_0x055e('0x125')});db[_0x055e('0x11')]['belongsToMany'](db[_0x055e('0x11a')],{'as':_0x055e('0x126'),'through':_0x055e('0x127')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x66')],{'as':_0x055e('0x128'),'through':_0x055e('0x129')});db['User'][_0x055e('0x11e')](db[_0x055e('0x4c')],{'as':'FaxInteractions','through':_0x055e('0x12a')});db[_0x055e('0x11')]['belongsToMany'](db[_0x055e('0x55')],{'as':_0x055e('0x118'),'through':_0x055e('0x12b')});db['User'][_0x055e('0x11e')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':_0x055e('0x12c')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x12d')],{'as':_0x055e('0x12e'),'through':_0x055e('0x12f')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x1b')],{'as':_0x055e('0x130'),'through':_0x055e('0x2e'),'required':![]});db[_0x055e('0x11')]['belongsToMany'](db[_0x055e('0xf6')],{'as':_0x055e('0x131'),'through':_0x055e('0x10c'),'required':![]});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x3e')],{'as':_0x055e('0x132'),'through':'UserMailQueue','required':![]});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x6b')],{'as':_0x055e('0x133'),'through':_0x055e('0x30'),'required':![],'hooks':!![]});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x134')],{'as':_0x055e('0x135'),'through':_0x055e('0x32'),'required':![]});db['User']['belongsToMany'](db[_0x055e('0x136')],{'as':_0x055e('0x137'),'through':_0x055e('0x34'),'required':![]});db[_0x055e('0x11')][_0x055e('0x11e')](db['OpenchannelQueue'],{'as':_0x055e('0x138'),'through':_0x055e('0x36'),'required':![]});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x105')],{'as':'WhatsappQueues','through':_0x055e('0x139'),'required':![]});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0xf5')],{'through':_0x055e('0x124')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x61')],{'as':_0x055e('0x13a'),'through':_0x055e('0x13b')});db[_0x055e('0x11')]['belongsToMany'](db[_0x055e('0x13c')],{'as':'FaxAccounts','through':_0x055e('0x13d')});db[_0x055e('0x11')]['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0x055e('0x13e')});db[_0x055e('0x11')]['belongsToMany'](db[_0x055e('0x59')],{'as':_0x055e('0x13f'),'through':_0x055e('0x140')});db[_0x055e('0x11')][_0x055e('0x11e')](db[_0x055e('0x51')],{'as':'SmsAccounts','through':_0x055e('0x141')});db[_0x055e('0x11')]['belongsToMany'](db[_0x055e('0x142')],{'as':_0x055e('0x143'),'through':'user_has_whatsapp_accounts'});db[_0x055e('0x11')][_0x055e('0x11e')](db['SquareProject'],{'as':_0x055e('0x144'),'through':'user_has_square_projects'});db[_0x055e('0x13')]['hasMany'](db[_0x055e('0x17')],{'as':'SpiedAgents','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x145')});db[_0x055e('0x15')][_0x055e('0x110')](db[_0x055e('0x17')],{'onDelete':_0x055e('0x10f')});db[_0x055e('0x17')][_0x055e('0x110')](db['VoiceExtension'],{'as':_0x055e('0x146'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x055e('0x11e')](db['Sound'],{'as':_0x055e('0x147'),'through':_0x055e('0x148')});db[_0x055e('0x1b')][_0x055e('0x110')](db[_0x055e('0x113')],{'as':_0x055e('0x149'),'foreignKey':_0x055e('0x14a')});db[_0x055e('0x1b')][_0x055e('0x110')](db[_0x055e('0x73')],{'as':'Hoppers','foreignKey':_0x055e('0x14a')});db[_0x055e('0x1b')][_0x055e('0x110')](db[_0x055e('0x76')],{'as':_0x055e('0x14b'),'foreignKey':_0x055e('0x14a')});db[_0x055e('0x1b')]['hasMany'](db[_0x055e('0x116')],{'as':_0x055e('0x14c'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x055e('0x110')](db['ReportAgentPreview'],{'as':_0x055e('0x78'),'foreignKey':'VoiceQueueId'});db[_0x055e('0x1b')]['hasMany'](db[_0x055e('0x74')],{'as':_0x055e('0x14d'),'foreignKey':_0x055e('0x14a')});db['VoiceQueue'][_0x055e('0x110')](db[_0x055e('0x14e')],{'as':_0x055e('0x14f'),'foreignKey':_0x055e('0x14a')});db[_0x055e('0x1b')][_0x055e('0x11c')](db[_0x055e('0x2a')],{'as':_0x055e('0x2a'),'foreignKey':_0x055e('0x150')});db['VoiceQueue']['belongsTo'](db[_0x055e('0x2a')],{'as':_0x055e('0x151'),'foreignKey':_0x055e('0x152')});db[_0x055e('0x1b')]['belongsTo'](db[_0x055e('0x82')],{'as':'Interval','foreignKey':_0x055e('0x153')});db[_0x055e('0x1b')][_0x055e('0x11c')](db[_0x055e('0x154')],{'as':'mandatoryDispositionPause','foreignKey':_0x055e('0x155')});db[_0x055e('0x1b')][_0x055e('0x11e')](db[_0x055e('0xf5')],{'as':_0x055e('0x156'),'through':_0x055e('0x157')});db['VoiceQueue'][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x2e')});db['VoiceQueue'][_0x055e('0x11e')](db['Team'],{'as':'Teams','through':_0x055e('0x109')});db['VoiceQueue']['belongsToMany'](db[_0x055e('0xf5')],{'as':_0x055e('0x159'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':'User','foreignKey':_0x055e('0x112')});db[_0x055e('0x15a')]['belongsTo'](db[_0x055e('0x11')],{'as':_0x055e('0x11'),'foreignKey':_0x055e('0x112')});db[_0x055e('0x1f')][_0x055e('0x110')](db[_0x055e('0x20')],{'as':_0x055e('0x15b'),'onDelete':'cascade','foreignKey':_0x055e('0x15c'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0x055e('0x11c')](db[_0x055e('0x1f')],{'foreignKey':_0x055e('0x15c'),'targetKey':_0x055e('0x15d')});db['VoiceCallReport']['hasMany'](db[_0x055e('0x27')],{'as':_0x055e('0x15e'),'foreignKey':'uniqueid','constraints':![]});db[_0x055e('0x22')][_0x055e('0x110')](db['VoiceAgentReport'],{'as':_0x055e('0x15f'),'foreignKey':_0x055e('0x160'),'constraints':![]});db[_0x055e('0x22')]['belongsTo'](db['User'],{'as':_0x055e('0x11'),'foreignKey':'UserId'});db[_0x055e('0x22')]['belongsTo'](db['CmContact'],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x39')][_0x055e('0x11c')](db['MailAccount'],{'as':_0x055e('0x3d'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x055e('0x11c')](db[_0x055e('0x3d')],{'as':_0x055e('0x3d'),'foreignKey':_0x055e('0x163')});db[_0x055e('0x3d')][_0x055e('0x10e')](db['MailServerIn'],{'as':_0x055e('0x164'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x3d')][_0x055e('0x10e')](db[_0x055e('0x3b')],{'as':'Smtp','onDelete':_0x055e('0x10f')});db['MailAccount']['hasMany'](db[_0x055e('0x165')],{'as':'Dispositions','foreignKey':_0x055e('0x163'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x3d')]['hasMany'](db[_0x055e('0x7e')],{'as':_0x055e('0x166'),'foreignKey':'MailAccountId'});db[_0x055e('0x3d')][_0x055e('0x110')](db[_0x055e('0x42')],{'as':_0x055e('0x15b'),'foreignKey':_0x055e('0x163')});db[_0x055e('0x3d')][_0x055e('0x110')](db[_0x055e('0x11a')],{'as':_0x055e('0x167')});db[_0x055e('0x3d')]['hasMany'](db['MailApplication'],{'as':'Applications'});db[_0x055e('0x3d')]['belongsTo'](db[_0x055e('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0x055e('0x3d')][_0x055e('0x11c')](db[_0x055e('0x8b')],{'as':_0x055e('0x8b'),'foreignKey':_0x055e('0x168')});db[_0x055e('0x3d')]['belongsTo'](db['Pause'],{'as':_0x055e('0x169'),'foreignKey':_0x055e('0x155')});db[_0x055e('0x3d')][_0x055e('0x11e')](db['User'],{'as':_0x055e('0x158'),'through':_0x055e('0x13e')});db[_0x055e('0x3e')][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x31')});db['MailQueue'][_0x055e('0x11e')](db[_0x055e('0xe1')],{'through':_0x055e('0x16a'),'as':_0x055e('0x16b')});db['MailInteraction'][_0x055e('0x110')](db[_0x055e('0x42')],{'as':'Messages','onDelete':_0x055e('0x10f'),'foreignKey':'MailInteractionId'});db[_0x055e('0x11a')][_0x055e('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0x055e('0x163')});db[_0x055e('0x11a')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':'Contact','foreignKey':_0x055e('0x162')});db[_0x055e('0x11a')]['belongsTo'](db[_0x055e('0x11')],{'as':_0x055e('0x16c'),'foreignKey':_0x055e('0x112')});db[_0x055e('0x11a')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x16d'),'as':'Tags'});db[_0x055e('0x11a')][_0x055e('0x11e')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x055e('0x16e')});db[_0x055e('0x11a')]['belongsToMany'](db['User'],{'as':'Users','through':_0x055e('0x127'),'foreignKey':_0x055e('0x16f')});db[_0x055e('0x42')][_0x055e('0x110')](db['Attachment'],{'as':_0x055e('0x170'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x42')][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':_0x055e('0x11')});db[_0x055e('0x42')][_0x055e('0x11c')](db[_0x055e('0x71')],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x161')});db['MailMessage'][_0x055e('0x11c')](db[_0x055e('0x11a')],{'as':_0x055e('0x171'),'foreignKey':_0x055e('0x16f')});db['MailMessage']['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x055e('0x11c')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db['MailMessage'][_0x055e('0x11c')](db['ChatOfflineMessage'],{'as':_0x055e('0x6a'),'foreignKey':'ChatOfflineMessageId'});db[_0x055e('0x43')]['belongsTo'](db[_0x055e('0x11')],{'onDelete':'restrict'});db[_0x055e('0x43')][_0x055e('0x11c')](db[_0x055e('0x3e')],{'onDelete':'restrict'});db[_0x055e('0x43')]['belongsTo'](db[_0x055e('0x3d')],{'onDelete':_0x055e('0x172')});db[_0x055e('0x43')][_0x055e('0x11c')](db[_0x055e('0x82')],{'onDelete':'restrict','foreignKey':_0x055e('0x153')});db['MailApplication'][_0x055e('0x11c')](db[_0x055e('0x8a')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x173')});db['MailQueueReport']['belongsTo'](db[_0x055e('0x3d')],{});db[_0x055e('0x45')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':'List','foreignKey':_0x055e('0x174')});db['MailQueueReport'][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x45')][_0x055e('0x11c')](db['MailInteraction'],{});db[_0x055e('0x45')][_0x055e('0x11c')](db[_0x055e('0x42')],{});db['MailQueueReport'][_0x055e('0x11c')](db[_0x055e('0x11')],{});db[_0x055e('0x45')][_0x055e('0x11c')](db['MailQueue'],{});db[_0x055e('0x47')]['hasMany'](db[_0x055e('0x48')],{'as':_0x055e('0x175'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x13c')][_0x055e('0x110')](db[_0x055e('0x165')],{'as':'Dispositions','foreignKey':_0x055e('0x176'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x13c')][_0x055e('0x110')](db[_0x055e('0x7e')],{'as':_0x055e('0x166'),'foreignKey':'FaxAccountId'});db[_0x055e('0x13c')]['hasMany'](db[_0x055e('0x4c')],{'as':_0x055e('0x167')});db[_0x055e('0x13c')]['hasMany'](db[_0x055e('0x4b')],{'as':_0x055e('0x146')});db['FaxAccount'][_0x055e('0x110')](db['VoiceExtension'],{'as':_0x055e('0x177'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x13c')][_0x055e('0x110')](db[_0x055e('0x178')],{'as':_0x055e('0x15b')});db[_0x055e('0x13c')][_0x055e('0x11c')](db[_0x055e('0x2a')],{'as':_0x055e('0x2a')});db['FaxAccount'][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db[_0x055e('0x13c')][_0x055e('0x11c')](db[_0x055e('0x154')],{'as':_0x055e('0x169'),'foreignKey':_0x055e('0x155')});db[_0x055e('0x13c')]['belongsToMany'](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x13d')});db[_0x055e('0x4b')][_0x055e('0x11c')](db[_0x055e('0x11')],{'onDelete':_0x055e('0x172')});db['FaxApplication'][_0x055e('0x11c')](db[_0x055e('0x134')],{'onDelete':'restrict'});db[_0x055e('0x4b')][_0x055e('0x11c')](db['FaxAccount'],{'onDelete':_0x055e('0x172')});db[_0x055e('0x4b')][_0x055e('0x11c')](db[_0x055e('0x8a')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x173')});db[_0x055e('0x4c')]['hasMany'](db[_0x055e('0x178')],{'as':_0x055e('0x15b'),'onDelete':'cascade','foreignKey':_0x055e('0x17a')});db[_0x055e('0x4c')]['belongsTo'](db[_0x055e('0x13c')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x176')});db[_0x055e('0x4c')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':'Contact','foreignKey':'ContactId'});db['FaxInteraction'][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':'Owner','foreignKey':_0x055e('0x112')});db[_0x055e('0x4c')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x17c'),'as':_0x055e('0x17d')});db[_0x055e('0x4c')]['belongsToMany'](db['Tag'],{'through':_0x055e('0x17c'),'as':'ThroughTags'});db[_0x055e('0x4c')][_0x055e('0x11e')](db['User'],{'as':'Users','through':_0x055e('0x12a'),'foreignKey':_0x055e('0x17a')});db['FaxMessage'][_0x055e('0x11c')](db['User'],{'onDelete':'cascade','as':_0x055e('0x11')});db[_0x055e('0x178')][_0x055e('0x11c')](db[_0x055e('0x4c')],{'as':_0x055e('0x171'),'foreignKey':_0x055e('0x17a')});db[_0x055e('0x178')][_0x055e('0x11c')](db['CmContact'],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x161')});db[_0x055e('0x178')][_0x055e('0x11c')](db['Attachment'],{'as':_0x055e('0xe8'),'foreignKey':_0x055e('0x17e')});db[_0x055e('0x178')]['belongsTo'](db[_0x055e('0x13c')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x176')});db['FaxQueue']['belongsToMany'](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x32')});db['FaxQueue'][_0x055e('0x11e')](db[_0x055e('0xe1')],{'through':'team_has_fax_queues','as':_0x055e('0x16b')});db[_0x055e('0x50')][_0x055e('0x11c')](db[_0x055e('0x13c')],{});db[_0x055e('0x50')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':'ListId'});db[_0x055e('0x50')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x50')][_0x055e('0x11c')](db[_0x055e('0x4c')],{});db['FaxQueueReport'][_0x055e('0x11c')](db['FaxMessage'],{});db[_0x055e('0x50')][_0x055e('0x11c')](db[_0x055e('0x11')],{});db[_0x055e('0x50')][_0x055e('0x11c')](db[_0x055e('0x134')],{});db[_0x055e('0x51')][_0x055e('0x110')](db[_0x055e('0x165')],{'as':_0x055e('0x17f'),'foreignKey':'SmsAccountId','onDelete':_0x055e('0x10f')});db['SmsAccount']['hasMany'](db['CannedAnswer'],{'as':_0x055e('0x166'),'foreignKey':_0x055e('0x180')});db[_0x055e('0x51')][_0x055e('0x110')](db[_0x055e('0x181')],{'as':_0x055e('0x15b'),'foreignKey':_0x055e('0x180')});db['SmsAccount'][_0x055e('0x110')](db[_0x055e('0x55')],{'as':'Interactions'});db[_0x055e('0x51')][_0x055e('0x110')](db[_0x055e('0x53')],{'as':_0x055e('0x146')});db[_0x055e('0x51')][_0x055e('0x11c')](db['CmList'],{'as':_0x055e('0x179'),'foreignKey':'ListId'});db[_0x055e('0x51')]['belongsTo'](db[_0x055e('0x154')],{'as':'mandatoryDispositionPause','foreignKey':_0x055e('0x155')});db[_0x055e('0x51')][_0x055e('0x11e')](db['User'],{'as':'Agents','through':'user_has_sms_accounts'});db[_0x055e('0x53')][_0x055e('0x11c')](db[_0x055e('0x11')],{'onDelete':_0x055e('0x172')});db[_0x055e('0x53')][_0x055e('0x11c')](db['SmsQueue'],{'onDelete':_0x055e('0x172')});db[_0x055e('0x53')]['belongsTo'](db[_0x055e('0x51')],{'onDelete':_0x055e('0x172')});db[_0x055e('0x53')][_0x055e('0x11c')](db[_0x055e('0x82')],{'onDelete':'restrict','foreignKey':_0x055e('0x153')});db[_0x055e('0x53')]['belongsTo'](db['Tag'],{'onDelete':_0x055e('0x172'),'foreignKey':'TagId'});db[_0x055e('0x55')][_0x055e('0x110')](db[_0x055e('0x181')],{'as':_0x055e('0x15b'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x182')});db[_0x055e('0x55')][_0x055e('0x11c')](db[_0x055e('0x51')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x180')});db['SmsInteraction'][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':'ContactId'});db[_0x055e('0x55')][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':'Owner','foreignKey':_0x055e('0x112')});db['SmsInteraction'][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x183'),'as':'Tags'});db[_0x055e('0x55')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x183'),'as':_0x055e('0x16e')});db[_0x055e('0x55')][_0x055e('0x11e')](db['User'],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x055e('0x182')});db[_0x055e('0x181')]['belongsTo'](db['User'],{'as':_0x055e('0x11')});db[_0x055e('0x181')][_0x055e('0x11c')](db['CmContact'],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x161')});db[_0x055e('0x181')][_0x055e('0x11c')](db['SmsInteraction'],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x171'),'foreignKey':_0x055e('0x182')});db[_0x055e('0x181')][_0x055e('0x11c')](db['SmsAccount'],{'as':'Account','foreignKey':_0x055e('0x180')});db['SmsQueue'][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x34'),'foreignKey':_0x055e('0x184')});db[_0x055e('0x136')]['belongsToMany'](db['Team'],{'through':_0x055e('0x185'),'as':_0x055e('0x16b')});db[_0x055e('0x59')]['hasMany'](db['Disposition'],{'as':_0x055e('0x17f'),'foreignKey':'OpenchannelAccountId','onDelete':_0x055e('0x10f')});db[_0x055e('0x59')][_0x055e('0x110')](db[_0x055e('0x7e')],{'as':'Answers','foreignKey':_0x055e('0x186')});db[_0x055e('0x59')]['hasMany'](db[_0x055e('0x5c')],{'as':_0x055e('0x167'),'foreignKey':'OpenchannelAccountId'});db[_0x055e('0x59')][_0x055e('0x110')](db[_0x055e('0x5e')],{'as':_0x055e('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0x055e('0x59')][_0x055e('0x110')](db['OpenchannelApplication'],{'as':_0x055e('0x146'),'foreignKey':_0x055e('0x186')});db[_0x055e('0x59')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db[_0x055e('0x59')][_0x055e('0x11c')](db[_0x055e('0x154')],{'as':_0x055e('0x169'),'foreignKey':_0x055e('0x155')});db[_0x055e('0x59')][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':'Agents','through':_0x055e('0x140')});db['OpenchannelApplication'][_0x055e('0x11c')](db[_0x055e('0x11')],{'onDelete':_0x055e('0x172')});db['OpenchannelApplication'][_0x055e('0x11c')](db[_0x055e('0x60')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x187')});db[_0x055e('0x5b')]['belongsTo'](db[_0x055e('0x59')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x186')});db[_0x055e('0x5b')][_0x055e('0x11c')](db[_0x055e('0x82')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x055e('0x5b')]['belongsTo'](db[_0x055e('0x8a')],{'onDelete':'restrict','foreignKey':_0x055e('0x173')});db[_0x055e('0x5c')][_0x055e('0x110')](db[_0x055e('0x5e')],{'as':'Messages','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x188')});db['OpenchannelInteraction']['belongsTo'](db[_0x055e('0x59')],{'as':'Account','foreignKey':_0x055e('0x186')});db[_0x055e('0x5c')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x5c')][_0x055e('0x11c')](db['User'],{'as':_0x055e('0x16c'),'foreignKey':_0x055e('0x112')});db[_0x055e('0x5c')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':'openchannel_interaction_has_tags','as':_0x055e('0x17d')});db[_0x055e('0x5c')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x189'),'as':_0x055e('0x16e')});db[_0x055e('0x5c')][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x18a'),'through':_0x055e('0x12c'),'foreignKey':_0x055e('0x188')});db[_0x055e('0x5e')]['belongsTo'](db[_0x055e('0x11')],{'onDelete':'cascade','as':_0x055e('0x11')});db[_0x055e('0x5e')][_0x055e('0x11c')](db[_0x055e('0x71')],{'onDelete':'cascade','as':_0x055e('0x161')});db[_0x055e('0x5e')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x171'),'foreignKey':_0x055e('0x188')});db['OpenchannelMessage']['belongsTo'](db[_0x055e('0xe8')],{'as':_0x055e('0xe8'),'foreignKey':_0x055e('0x17e')});db['OpenchannelMessage'][_0x055e('0x11c')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x055e('0x186')});db[_0x055e('0x60')]['belongsToMany'](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x055e('0x60')][_0x055e('0x11e')](db['Team'],{'through':_0x055e('0x18b'),'as':'Teams'});db[_0x055e('0x61')][_0x055e('0x110')](db[_0x055e('0x165')],{'as':_0x055e('0x17f'),'foreignKey':_0x055e('0x18c'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x61')][_0x055e('0x110')](db[_0x055e('0x7e')],{'as':'Answers','foreignKey':_0x055e('0x18c')});db['ChatWebsite'][_0x055e('0x110')](db[_0x055e('0x6e')],{'as':_0x055e('0x18d')});db['ChatWebsite'][_0x055e('0x110')](db[_0x055e('0x66')],{'as':_0x055e('0x167')});db['ChatWebsite']['hasMany'](db[_0x055e('0x64')],{'as':_0x055e('0x146')});db[_0x055e('0x61')][_0x055e('0x110')](db[_0x055e('0x68')],{'as':_0x055e('0x15b')});db[_0x055e('0x61')]['belongsTo'](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db['ChatWebsite']['belongsTo'](db[_0x055e('0x82')],{'as':_0x055e('0x82'),'foreignKey':_0x055e('0x153')});db['ChatWebsite'][_0x055e('0x11c')](db[_0x055e('0x3d')],{'as':_0x055e('0x3d'),'foreignKey':'MailAccountId'});db[_0x055e('0x61')][_0x055e('0x11c')](db[_0x055e('0x154')],{'as':'mandatoryDispositionPause','foreignKey':_0x055e('0x155')});db['ChatWebsite'][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x13b')});db[_0x055e('0x63')][_0x055e('0x11c')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db[_0x055e('0x63')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db['OpenchannelQueueReport'][_0x055e('0x11c')](db[_0x055e('0x5c')],{});db[_0x055e('0x63')]['belongsTo'](db[_0x055e('0x5e')],{});db[_0x055e('0x63')][_0x055e('0x11c')](db['User'],{});db[_0x055e('0x63')]['belongsTo'](db[_0x055e('0x60')],{});db['ChatApplication'][_0x055e('0x11c')](db['User'],{'as':_0x055e('0x18e'),'foreignKey':'UserId','onDelete':'restrict'});db[_0x055e('0x64')][_0x055e('0x11c')](db['ChatQueue'],{'as':_0x055e('0x18f'),'foreignKey':'ChatQueueId','onDelete':_0x055e('0x172')});db[_0x055e('0x64')]['belongsTo'](db[_0x055e('0x61')],{'as':_0x055e('0x190'),'foreignKey':_0x055e('0x18c'),'onDelete':_0x055e('0x172')});db[_0x055e('0x64')][_0x055e('0x11c')](db[_0x055e('0x8a')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x173')});db[_0x055e('0x66')][_0x055e('0x110')](db[_0x055e('0x68')],{'as':_0x055e('0x15b'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x191')});db[_0x055e('0x66')]['belongsTo'](db[_0x055e('0x61')],{'as':'Account','foreignKey':_0x055e('0x18c')});db[_0x055e('0x66')][_0x055e('0x11c')](db['CmContact'],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x66')][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':'Owner','foreignKey':_0x055e('0x112')});db[_0x055e('0x66')][_0x055e('0x11e')](db['Tag'],{'through':_0x055e('0x192'),'as':'Tags'});db[_0x055e('0x66')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x192'),'as':_0x055e('0x16e')});db[_0x055e('0x66')][_0x055e('0x11e')](db['User'],{'as':_0x055e('0x18a'),'through':_0x055e('0x129'),'foreignKey':_0x055e('0x191')});db[_0x055e('0x68')]['belongsTo'](db[_0x055e('0x11')],{'onDelete':'cascade','as':'User'});db[_0x055e('0x68')][_0x055e('0x11c')](db['CmContact'],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x68')][_0x055e('0x11c')](db['ChatInteraction'],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x171'),'foreignKey':_0x055e('0x191')});db[_0x055e('0x68')][_0x055e('0x11c')](db[_0x055e('0xe8')],{'as':_0x055e('0xe8'),'foreignKey':'AttachmentId'});db[_0x055e('0x68')][_0x055e('0x11c')](db[_0x055e('0x61')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x18c')});db[_0x055e('0x6a')][_0x055e('0x110')](db[_0x055e('0xe8')],{'as':_0x055e('0x170'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x055e('0x10f'),'hooks':!![]});db[_0x055e('0x6a')][_0x055e('0x11c')](db[_0x055e('0x71')],{'onDelete':_0x055e('0x10f'),'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x6a')][_0x055e('0x11c')](db[_0x055e('0x61')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x18c')});db[_0x055e('0x6b')]['belongsToMany'](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x30'),'hooks':!![]});db['ChatQueue'][_0x055e('0x11e')](db['Team'],{'through':_0x055e('0x193'),'as':_0x055e('0x16b')});db[_0x055e('0x11f')][_0x055e('0x110')](db['ChatInternalMessage'],{'as':_0x055e('0x15b'),'foreignKey':_0x055e('0x194'),'onDelete':'cascade'});db['ChatGroup'][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x149'),'through':_0x055e('0x121')});db[_0x055e('0x6e')][_0x055e('0x11c')](db[_0x055e('0x61')],{'as':_0x055e('0x190'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x055e('0x110')](db[_0x055e('0x71')],{'as':_0x055e('0x122'),'foreignKey':_0x055e('0x195')});db[_0x055e('0x71')]['hasMany'](db[_0x055e('0x73')],{'as':'Hoppers','foreignKey':_0x055e('0x162')});db[_0x055e('0x71')]['hasMany'](db[_0x055e('0x76')],{'as':_0x055e('0x14b'),'foreignKey':'ContactId'});db[_0x055e('0x71')][_0x055e('0x110')](db[_0x055e('0x116')],{'as':_0x055e('0x14c'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x71')]['hasMany'](db['ReportAgentPreview'],{'as':_0x055e('0x78'),'foreignKey':'ContactId'});db[_0x055e('0x71')][_0x055e('0x110')](db[_0x055e('0x14e')],{'as':_0x055e('0x14f'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x71')][_0x055e('0x110')](db[_0x055e('0x5c')],{'as':_0x055e('0x117'),'foreignKey':_0x055e('0x162'),'onDelete':_0x055e('0x172')});db[_0x055e('0x71')]['hasMany'](db[_0x055e('0x66')],{'as':_0x055e('0x128'),'foreignKey':_0x055e('0x162'),'onDelete':_0x055e('0x172')});db[_0x055e('0x71')][_0x055e('0x110')](db[_0x055e('0x55')],{'as':_0x055e('0x118'),'foreignKey':_0x055e('0x162'),'onDelete':_0x055e('0x172')});db[_0x055e('0x71')][_0x055e('0x110')](db['FaxInteraction'],{'as':_0x055e('0x119'),'foreignKey':_0x055e('0x162'),'onDelete':'restrict'});db[_0x055e('0x71')]['hasMany'](db[_0x055e('0x11a')],{'as':_0x055e('0x126'),'foreignKey':_0x055e('0x162'),'onDelete':_0x055e('0x172')});db[_0x055e('0x71')]['belongsTo'](db[_0x055e('0x70')],{'as':'Company','foreignKey':_0x055e('0x195')});db['CmContact'][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174'),'onDelete':_0x055e('0x10f')});db['CmContact'][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':'Users','through':_0x055e('0x123')});db[_0x055e('0x71')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'as':_0x055e('0x17d'),'through':_0x055e('0x196')});db[_0x055e('0x71')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x196'),'as':'ThroughTags'});db[_0x055e('0x73')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x055e('0x73')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':'ListId','onDelete':_0x055e('0x10f')});db['CmHopper'][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':'Agent','foreignKey':_0x055e('0x112')});db[_0x055e('0x73')][_0x055e('0x11c')](db['VoiceQueue'],{'as':_0x055e('0x18f'),'foreignKey':_0x055e('0x14a'),'onDelete':'cascade'});db[_0x055e('0x73')][_0x055e('0x11c')](db[_0x055e('0xe5')],{'as':_0x055e('0xe5'),'foreignKey':_0x055e('0x197'),'onDelete':_0x055e('0x10f')});db['CmHopper'][_0x055e('0x11c')](db[_0x055e('0x11')],{'as':_0x055e('0x16c'),'foreignKey':'OwnerId'});db[_0x055e('0x74')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x74')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':'List','foreignKey':_0x055e('0x174'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x74')][_0x055e('0x11c')](db[_0x055e('0x1b')],{'as':_0x055e('0x18f'),'foreignKey':_0x055e('0x14a'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x74')]['belongsTo'](db['Campaign'],{'as':_0x055e('0xe5'),'foreignKey':_0x055e('0x197'),'onDelete':'cascade'});db[_0x055e('0x7c')]['hasMany'](db[_0x055e('0x198')],{'as':{'plural':_0x055e('0x199'),'singular':_0x055e('0x19a')},'foreignKey':'AutomationAllId','onDelete':_0x055e('0x10f'),'hooks':!![]});db[_0x055e('0x7c')]['hasMany'](db['Condition'],{'as':{'plural':'Any','singular':_0x055e('0x19b')},'foreignKey':'AutomationAnyId','onDelete':_0x055e('0x10f'),'hooks':!![]});db['Automation']['hasMany'](db[_0x055e('0x19c')],{'as':_0x055e('0x19d'),'foreignKey':'AutomationId','onDelete':_0x055e('0x10f'),'hooks':!![]});db[_0x055e('0x165')][_0x055e('0x110')](db[_0x055e('0x165')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0x055e('0x10f')});db[_0x055e('0x82')]['hasMany'](db[_0x055e('0x82')],{'as':_0x055e('0x19e'),'foreignKey':_0x055e('0x153'),'onDelete':_0x055e('0x10f'),'hooks':!![],'required':![]});db[_0x055e('0x82')][_0x055e('0x110')](db[_0x055e('0x17')],{'as':_0x055e('0x115'),'foreignKey':'IntervalId','onDelete':_0x055e('0x172')});db['Interval'][_0x055e('0x110')](db[_0x055e('0x43')],{'as':'MailApplications','foreignKey':_0x055e('0x153')});db[_0x055e('0x82')]['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0x055e('0x153')});db[_0x055e('0x82')][_0x055e('0x110')](db[_0x055e('0x4b')],{'as':_0x055e('0x19f'),'foreignKey':'IntervalId'});db[_0x055e('0x82')][_0x055e('0x110')](db[_0x055e('0x53')],{'as':_0x055e('0x1a0'),'foreignKey':_0x055e('0x153')});db[_0x055e('0x86')][_0x055e('0x11c')](db['MailAccount'],{});db[_0x055e('0x86')][_0x055e('0x11c')](db[_0x055e('0x95')],{'foreignKey':_0x055e('0x1a1')});db[_0x055e('0x86')][_0x055e('0x11c')](db['AnalyticCustomReport'],{'foreignKey':_0x055e('0x1a2')});db[_0x055e('0x88')]['belongsToMany'](db[_0x055e('0x19')],{'as':_0x055e('0x1a3'),'through':'moh_has_sounds','onDelete':_0x055e('0x172')});db['Tag']['belongsToMany'](db['CmContact'],{'through':_0x055e('0x196')});db[_0x055e('0x8a')]['belongsToMany'](db['ChatInteraction'],{'through':_0x055e('0x192')});db[_0x055e('0x8a')][_0x055e('0x11e')](db[_0x055e('0x11a')],{'through':_0x055e('0x16d')});db[_0x055e('0x8a')][_0x055e('0x11e')](db[_0x055e('0x55')],{'through':_0x055e('0x183')});db['Tag'][_0x055e('0x11e')](db[_0x055e('0x4c')],{'through':_0x055e('0x17c')});db[_0x055e('0x8a')][_0x055e('0x11e')](db[_0x055e('0x5c')],{'through':_0x055e('0x189')});db[_0x055e('0x8a')][_0x055e('0x11e')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x055e('0x1a4')]['hasMany'](db[_0x055e('0x198')],{'as':{'plural':'AllConditions','singular':_0x055e('0x1a5')},'foreignKey':_0x055e('0x1a6'),'onDelete':_0x055e('0x10f'),'hooks':!![]});db[_0x055e('0x1a4')]['hasMany'](db[_0x055e('0x198')],{'as':{'plural':_0x055e('0x1a7'),'singular':_0x055e('0x1a8')},'foreignKey':_0x055e('0x1a9'),'onDelete':_0x055e('0x10f'),'hooks':!![]});db['Trigger'][_0x055e('0x110')](db[_0x055e('0x19c')],{'as':_0x055e('0x19d'),'foreignKey':'TriggerId','onDelete':_0x055e('0x10f'),'hooks':!![]});db[_0x055e('0x94')][_0x055e('0x110')](db['AnalyticFieldReport'],{'as':_0x055e('0x1aa'),'onDelete':'cascade','foreignKey':_0x055e('0x1a2'),'hooks':!![]});db[_0x055e('0x95')][_0x055e('0x110')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1a1')});db[_0x055e('0x98')][_0x055e('0x110')](db[_0x055e('0x9a')],{'as':'Fields','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ab')});db[_0x055e('0x9a')][_0x055e('0x11c')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x055e('0x9e')][_0x055e('0x110')](db['SalesforceConfiguration'],{'as':_0x055e('0x1ac'),'onDelete':'cascade','foreignKey':_0x055e('0x1ad')});db[_0x055e('0x1ae')][_0x055e('0x110')](db[_0x055e('0xa1')],{'as':_0x055e('0x1af'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b0')});db[_0x055e('0x1ae')][_0x055e('0x110')](db[_0x055e('0xa1')],{'as':'Descriptions','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0x1ae')][_0x055e('0x110')](db[_0x055e('0xa1')],{'as':_0x055e('0x1aa'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0x1ae')][_0x055e('0x11c')](db[_0x055e('0x9e')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xa1')]['hasMany'](db[_0x055e('0xa1')],{'as':_0x055e('0x1b3'),'foreignKey':_0x055e('0x1b0')});db[_0x055e('0xa1')][_0x055e('0x110')](db[_0x055e('0xa1')],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xa1')][_0x055e('0x110')](db[_0x055e('0xa1')],{'as':_0x055e('0x1b5'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xa1')]['belongsTo'](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':_0x055e('0x1b6')});db[_0x055e('0xa3')][_0x055e('0x110')](db[_0x055e('0xa5')],{'as':'Configurations','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xa5')][_0x055e('0x110')](db[_0x055e('0x1b7')],{'as':_0x055e('0x1af'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b0')});db[_0x055e('0xa5')][_0x055e('0x110')](db[_0x055e('0x1b7')],{'as':'Descriptions','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b1')});db['SugarcrmConfiguration'][_0x055e('0x110')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xa5')][_0x055e('0x11c')](db[_0x055e('0xa3')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0x1b7')][_0x055e('0x110')](db['SugarcrmField'],{'as':_0x055e('0x1b3'),'foreignKey':_0x055e('0x1b0')});db[_0x055e('0x1b7')][_0x055e('0x110')](db['SugarcrmField'],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0x1b7')][_0x055e('0x110')](db[_0x055e('0x1b7')],{'as':'Field','foreignKey':_0x055e('0x1b2')});db['SugarcrmField']['belongsTo'](db['Variable'],{'as':_0x055e('0x8e'),'foreignKey':'VariableId'});db[_0x055e('0x1b8')][_0x055e('0x110')](db[_0x055e('0xa8')],{'as':_0x055e('0x1ac'),'onDelete':'cascade','foreignKey':_0x055e('0x1ad')});db[_0x055e('0xa8')][_0x055e('0x110')](db[_0x055e('0xaa')],{'as':_0x055e('0x1af'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x055e('0xa8')]['hasMany'](db[_0x055e('0xaa')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x055e('0x1b1')});db['DeskConfiguration'][_0x055e('0x110')](db[_0x055e('0xaa')],{'as':'Fields','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xa8')]['belongsTo'](db[_0x055e('0x1b8')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xa8')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x1b9')});db[_0x055e('0xaa')][_0x055e('0x110')](db['DeskField'],{'as':_0x055e('0x1b3'),'foreignKey':_0x055e('0x1b0')});db['DeskField'][_0x055e('0x110')](db[_0x055e('0xaa')],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xaa')][_0x055e('0x110')](db[_0x055e('0xaa')],{'as':_0x055e('0x1b5'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xaa')][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':'Variable','foreignKey':_0x055e('0x1b6')});db[_0x055e('0xac')][_0x055e('0x110')](db[_0x055e('0xae')],{'as':_0x055e('0x1ac'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0x055e('0x1af'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b0')});db[_0x055e('0xae')][_0x055e('0x110')](db[_0x055e('0xb0')],{'as':'Descriptions','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xae')][_0x055e('0x110')](db[_0x055e('0xb0')],{'as':_0x055e('0x1aa'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xae')][_0x055e('0x11c')](db[_0x055e('0xac')],{'as':'Account','foreignKey':_0x055e('0x1ad')});db['ZohoField'][_0x055e('0x110')](db[_0x055e('0xb0')],{'as':'Subject','foreignKey':_0x055e('0x1b0')});db['ZohoField'][_0x055e('0x110')](db[_0x055e('0xb0')],{'as':'Description','foreignKey':_0x055e('0x1b1')});db[_0x055e('0xb0')][_0x055e('0x110')](db[_0x055e('0xb0')],{'as':_0x055e('0x1b5'),'foreignKey':_0x055e('0x1b2')});db['ZohoField'][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':_0x055e('0x1b6')});db['ZendeskAccount'][_0x055e('0x110')](db['ZendeskConfiguration'],{'as':_0x055e('0x1ac'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xb3')][_0x055e('0x110')](db[_0x055e('0xb5')],{'as':_0x055e('0x1af'),'foreignKey':'SubjectId'});db[_0x055e('0xb3')][_0x055e('0x110')](db['ZendeskField'],{'as':_0x055e('0x1ba'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xb3')][_0x055e('0x110')](db[_0x055e('0xb5')],{'as':_0x055e('0x1aa'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xb3')][_0x055e('0x11c')](db[_0x055e('0xb1')],{'as':'Account','foreignKey':_0x055e('0x1ad')});db[_0x055e('0xb3')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x1bb')});db[_0x055e('0xb5')][_0x055e('0x110')](db[_0x055e('0xb5')],{'as':'Subject','foreignKey':_0x055e('0x1b0')});db[_0x055e('0xb5')][_0x055e('0x110')](db[_0x055e('0xb5')],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xb5')][_0x055e('0x110')](db[_0x055e('0xb5')],{'as':_0x055e('0x1b5'),'foreignKey':'FieldId'});db['ZendeskField'][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':'VariableId'});db[_0x055e('0x1bc')][_0x055e('0x110')](db['FreshdeskConfiguration'],{'as':_0x055e('0x1ac'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xb8')]['hasMany'](db[_0x055e('0x1bd')],{'as':_0x055e('0x1af'),'onDelete':_0x055e('0x10f'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x055e('0x110')](db[_0x055e('0x1bd')],{'as':_0x055e('0x1ba'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xb8')][_0x055e('0x110')](db[_0x055e('0x1bd')],{'as':_0x055e('0x1aa'),'onDelete':'cascade','foreignKey':_0x055e('0x1b2')});db[_0x055e('0xb8')][_0x055e('0x11c')](db[_0x055e('0x1bc')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xb8')][_0x055e('0x11e')](db['Tag'],{'through':_0x055e('0x1be')});db[_0x055e('0x1bd')][_0x055e('0x110')](db[_0x055e('0x1bd')],{'as':'Subject','foreignKey':_0x055e('0x1b0')});db[_0x055e('0x1bd')]['hasMany'](db['FreshdeskField'],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0x1bd')][_0x055e('0x110')](db['FreshdeskField'],{'as':_0x055e('0x1b5'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0x1bd')]['belongsTo'](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':_0x055e('0x1b6')});db[_0x055e('0x1bf')][_0x055e('0x110')](db[_0x055e('0xba')],{'as':_0x055e('0x1ac'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xba')]['hasMany'](db['VtigerField'],{'as':_0x055e('0x1af'),'foreignKey':_0x055e('0x1b0')});db[_0x055e('0xba')][_0x055e('0x110')](db[_0x055e('0x1c0')],{'as':_0x055e('0x1ba'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xba')]['hasMany'](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration'][_0x055e('0x11c')](db[_0x055e('0x1bf')],{'as':_0x055e('0x17b'),'foreignKey':'AccountId'});db['VtigerField'][_0x055e('0x110')](db[_0x055e('0x1c0')],{'as':'Subject','foreignKey':_0x055e('0x1b0')});db['VtigerField'][_0x055e('0x110')](db[_0x055e('0x1c0')],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0x1c0')][_0x055e('0x110')](db[_0x055e('0x1c0')],{'as':_0x055e('0x1b5'),'foreignKey':'FieldId'});db[_0x055e('0x1c0')][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':_0x055e('0x1b6')});db[_0x055e('0xbc')][_0x055e('0x110')](db[_0x055e('0x1c1')],{'as':_0x055e('0x1ac'),'onDelete':_0x055e('0x10f'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x055e('0x110')](db[_0x055e('0xbe')],{'as':_0x055e('0x1af'),'foreignKey':'SubjectId'});db[_0x055e('0x1c1')][_0x055e('0x110')](db[_0x055e('0xbe')],{'as':_0x055e('0x1ba'),'foreignKey':'DescriptionId'});db[_0x055e('0x1c1')]['hasMany'](db[_0x055e('0xbe')],{'as':_0x055e('0x1aa'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0x1c1')]['belongsTo'](db['ServicenowAccount'],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xbe')][_0x055e('0x110')](db[_0x055e('0xbe')],{'as':_0x055e('0x1b3'),'foreignKey':'SubjectId'});db[_0x055e('0xbe')][_0x055e('0x110')](db['ServicenowField'],{'as':'Description','foreignKey':_0x055e('0x1b1')});db[_0x055e('0xbe')][_0x055e('0x110')](db[_0x055e('0xbe')],{'as':_0x055e('0x1b5'),'foreignKey':_0x055e('0x1b2')});db[_0x055e('0xbe')][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':'Variable','foreignKey':'VariableId'});db[_0x055e('0xbf')][_0x055e('0x110')](db[_0x055e('0xc0')],{'as':'Configurations','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xc0')]['hasMany'](db['Dynamics365Field'],{'as':_0x055e('0x1af'),'onDelete':'cascade','foreignKey':_0x055e('0x1b0')});db[_0x055e('0xc0')][_0x055e('0x110')](db[_0x055e('0xc2')],{'as':_0x055e('0x1ba'),'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xc0')]['hasMany'](db[_0x055e('0xc2')],{'as':_0x055e('0x1aa'),'onDelete':'cascade','foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x055e('0x11c')](db[_0x055e('0xbf')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db['Dynamics365Field'][_0x055e('0x110')](db[_0x055e('0xc2')],{'as':'Subject','foreignKey':_0x055e('0x1b0')});db[_0x055e('0xc2')]['hasMany'](db[_0x055e('0xc2')],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xc2')]['hasMany'](db[_0x055e('0xc2')],{'as':_0x055e('0x1b5'),'foreignKey':_0x055e('0x1b2')});db['Dynamics365Field'][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':_0x055e('0x1b6')});db['FreshsalesAccount'][_0x055e('0x110')](db[_0x055e('0xc6')],{'as':'Configurations','onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1ad')});db[_0x055e('0xc6')][_0x055e('0x110')](db[_0x055e('0x1c2')],{'as':_0x055e('0x1af'),'foreignKey':'SubjectId'});db[_0x055e('0xc6')]['hasMany'](db[_0x055e('0x1c2')],{'as':_0x055e('0x1ba'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0xc6')][_0x055e('0x110')](db['FreshsalesField'],{'as':_0x055e('0x1aa'),'foreignKey':_0x055e('0x1b2')});db['FreshsalesConfiguration'][_0x055e('0x11c')](db[_0x055e('0xc4')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ad')});db['FreshsalesField'][_0x055e('0x110')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0x055e('0x1b0')});db['FreshsalesField']['hasMany'](db[_0x055e('0x1c2')],{'as':_0x055e('0x1b4'),'foreignKey':_0x055e('0x1b1')});db[_0x055e('0x1c2')][_0x055e('0x110')](db['FreshsalesField'],{'as':'Field','foreignKey':_0x055e('0x1b2')});db['FreshsalesField'][_0x055e('0x11c')](db[_0x055e('0x8e')],{'as':_0x055e('0x8e'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x055e('0x11c')](db[_0x055e('0x61')],{});db[_0x055e('0xcb')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db[_0x055e('0xcb')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0xcb')]['belongsTo'](db[_0x055e('0x66')],{});db[_0x055e('0xcb')][_0x055e('0x11c')](db[_0x055e('0x68')],{});db[_0x055e('0xcb')][_0x055e('0x11c')](db[_0x055e('0x11')],{});db['ChatQueueReport'][_0x055e('0x11c')](db[_0x055e('0x6b')],{});db[_0x055e('0xcc')]['belongsTo'](db[_0x055e('0x11')],{'onDelete':_0x055e('0x10f'),'foreignKey':_0x055e('0x1c3')});db[_0x055e('0xcc')][_0x055e('0x11c')](db[_0x055e('0x11')],{'onDelete':_0x055e('0x10f'),'foreignKey':'ToId'});db[_0x055e('0x14e')][_0x055e('0x110')](db[_0x055e('0xd0')],{'foreignKey':_0x055e('0x1c4'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x14e')][_0x055e('0x110')](db[_0x055e('0xce')],{'foreignKey':_0x055e('0x1c4'),'onDelete':_0x055e('0x10f')});db[_0x055e('0xd3')][_0x055e('0x11c')](db[_0x055e('0x51')],{});db[_0x055e('0xd3')][_0x055e('0x11c')](db[_0x055e('0xf5')],{'as':'List','foreignKey':_0x055e('0x174')});db[_0x055e('0xd3')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':'Contact','foreignKey':'ContactId'});db['SmsQueueReport'][_0x055e('0x11c')](db[_0x055e('0x55')],{});db['SmsQueueReport'][_0x055e('0x11c')](db[_0x055e('0x181')],{});db[_0x055e('0xd3')]['belongsTo'](db[_0x055e('0x11')],{});db[_0x055e('0xd3')][_0x055e('0x11c')](db[_0x055e('0x136')],{});db[_0x055e('0x1c5')][_0x055e('0x110')](db[_0x055e('0x14e')],{'foreignKey':'ProjectId'});db[_0x055e('0x1c5')][_0x055e('0x110')](db[_0x055e('0xd0')],{'foreignKey':_0x055e('0x1c6')});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x055e('0x1c6')});db[_0x055e('0xdb')][_0x055e('0x11e')](db['User'],{'as':'Users','through':_0x055e('0x1c7')});db[_0x055e('0xe1')][_0x055e('0x11e')](db['User'],{'as':_0x055e('0x158'),'through':_0x055e('0x125')});db[_0x055e('0xe1')][_0x055e('0x11e')](db[_0x055e('0x1b')],{'through':_0x055e('0x109'),'as':'VoiceQueues'});db[_0x055e('0xe1')][_0x055e('0x11e')](db[_0x055e('0x3e')],{'through':_0x055e('0x16a'),'as':'MailQueues'});db[_0x055e('0xe1')]['belongsToMany'](db['ChatQueue'],{'through':_0x055e('0x193'),'as':'ChatQueues'});db[_0x055e('0xe1')][_0x055e('0x11e')](db[_0x055e('0x134')],{'through':_0x055e('0x1c8'),'as':'FaxQueues'});db[_0x055e('0xe1')][_0x055e('0x11e')](db[_0x055e('0x136')],{'through':'team_has_sms_queues','as':_0x055e('0x137')});db[_0x055e('0xe1')][_0x055e('0x11e')](db[_0x055e('0x60')],{'through':'team_has_openchannel_queues','as':_0x055e('0x138')});db['Team'][_0x055e('0x11e')](db[_0x055e('0x105')],{'through':_0x055e('0x1c9'),'as':_0x055e('0x1ca')});db[_0x055e('0xe1')][_0x055e('0x11e')](db[_0x055e('0xf6')],{'through':_0x055e('0x10b'),'as':_0x055e('0x131')});db[_0x055e('0xe5')]['hasMany'](db['CmHopper'],{'as':_0x055e('0x1cb'),'foreignKey':_0x055e('0x197')});db[_0x055e('0xe5')][_0x055e('0x110')](db['CmHopperFinal'],{'as':_0x055e('0x14b'),'foreignKey':_0x055e('0x197')});db['Campaign'][_0x055e('0x110')](db[_0x055e('0x116')],{'as':_0x055e('0x14c'),'foreignKey':_0x055e('0x197')});db[_0x055e('0xe5')][_0x055e('0x110')](db[_0x055e('0x74')],{'as':_0x055e('0x14d'),'foreignKey':_0x055e('0x197')});db[_0x055e('0xe5')][_0x055e('0x11c')](db[_0x055e('0x2a')],{'as':_0x055e('0x2a'),'foreignKey':_0x055e('0x150')});db[_0x055e('0xe5')][_0x055e('0x11c')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x055e('0xe5')][_0x055e('0x11c')](db[_0x055e('0x82')],{'as':_0x055e('0x82'),'foreignKey':'IntervalId'});db['Campaign'][_0x055e('0x11c')](db['SquareProject'],{'as':_0x055e('0xdb'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0x055e('0xf5')],{'as':_0x055e('0x156'),'through':_0x055e('0x1cc')});db[_0x055e('0xe5')][_0x055e('0x11e')](db[_0x055e('0xf5')],{'as':_0x055e('0x159'),'through':_0x055e('0x1cd')});db[_0x055e('0xe8')][_0x055e('0x11c')](db[_0x055e('0x6a')],{'as':'ChatOfflineMessage','foreignKey':_0x055e('0x1ce')});db[_0x055e('0xec')][_0x055e('0x11c')](db[_0x055e('0x42')],{});db[_0x055e('0xec')]['belongsTo'](db[_0x055e('0x11a')],{});db[_0x055e('0xec')][_0x055e('0x11c')](db[_0x055e('0x3d')],{'foreignKey':_0x055e('0x1cf'),'as':_0x055e('0x1d0')});db['MailTransferReport'][_0x055e('0x11c')](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d1'),'as':_0x055e('0x1d2')});db[_0x055e('0xec')]['belongsTo'](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d3'),'as':'ToAgent'});db[_0x055e('0xec')][_0x055e('0x11c')](db[_0x055e('0x3e')],{'foreignKey':_0x055e('0x1d4'),'as':_0x055e('0x1d5')});db[_0x055e('0xec')][_0x055e('0x11c')](db[_0x055e('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x055e('0x1d6')});db['ChatTransferReport']['belongsTo'](db[_0x055e('0x68')],{});db[_0x055e('0xee')][_0x055e('0x11c')](db['ChatInteraction'],{});db[_0x055e('0xee')]['belongsTo'](db[_0x055e('0x61')],{'foreignKey':_0x055e('0x1d7'),'as':_0x055e('0x1d0')});db[_0x055e('0xee')][_0x055e('0x11c')](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d1'),'as':_0x055e('0x1d2')});db[_0x055e('0xee')][_0x055e('0x11c')](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d3'),'as':_0x055e('0x1d8')});db[_0x055e('0xee')][_0x055e('0x11c')](db[_0x055e('0x6b')],{'foreignKey':'ToChatQueueId','as':_0x055e('0x1d5')});db[_0x055e('0xee')][_0x055e('0x11c')](db[_0x055e('0x61')],{'foreignKey':_0x055e('0x1d9'),'as':_0x055e('0x1d6')});db['FaxTransferReport']['belongsTo'](db[_0x055e('0x178')],{});db[_0x055e('0x1da')][_0x055e('0x11c')](db[_0x055e('0x4c')],{});db[_0x055e('0x1da')]['belongsTo'](db[_0x055e('0x13c')],{'foreignKey':'FromFaxAccountId','as':_0x055e('0x1d0')});db[_0x055e('0x1da')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x055e('0x1d2')});db[_0x055e('0x1da')][_0x055e('0x11c')](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d3'),'as':_0x055e('0x1d8')});db[_0x055e('0x1da')][_0x055e('0x11c')](db[_0x055e('0x134')],{'foreignKey':_0x055e('0x1db'),'as':_0x055e('0x1d5')});db[_0x055e('0x1da')][_0x055e('0x11c')](db['FaxAccount'],{'foreignKey':_0x055e('0x1dc'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x055e('0x11c')](db[_0x055e('0x5e')],{});db[_0x055e('0xf1')][_0x055e('0x11c')](db[_0x055e('0x5c')],{});db[_0x055e('0xf1')][_0x055e('0x11c')](db[_0x055e('0x59')],{'foreignKey':_0x055e('0x1dd'),'as':'FromAccount'});db[_0x055e('0xf1')][_0x055e('0x11c')](db['User'],{'foreignKey':_0x055e('0x1d1'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x055e('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0x055e('0x1d8')});db[_0x055e('0xf1')][_0x055e('0x11c')](db['OpenchannelQueue'],{'foreignKey':_0x055e('0x1de'),'as':_0x055e('0x1d5')});db[_0x055e('0xf1')][_0x055e('0x11c')](db[_0x055e('0x59')],{'foreignKey':_0x055e('0x1df'),'as':_0x055e('0x1d6')});db[_0x055e('0xf3')][_0x055e('0x11c')](db['SmsMessage'],{});db[_0x055e('0xf3')][_0x055e('0x11c')](db[_0x055e('0x55')],{});db[_0x055e('0xf3')][_0x055e('0x11c')](db[_0x055e('0x51')],{'foreignKey':_0x055e('0x1e0'),'as':_0x055e('0x1d0')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x055e('0x1d2')});db[_0x055e('0xf3')][_0x055e('0x11c')](db[_0x055e('0x11')],{'foreignKey':'ToUserId','as':_0x055e('0x1d8')});db[_0x055e('0xf3')][_0x055e('0x11c')](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0x055e('0x1d5')});db[_0x055e('0xf3')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x055e('0x1e1'),'as':_0x055e('0x1d6')});db[_0x055e('0xf5')][_0x055e('0x110')](db[_0x055e('0x165')],{'as':_0x055e('0x17f'),'foreignKey':_0x055e('0x174'),'onDelete':_0x055e('0x10f')});db[_0x055e('0xf5')][_0x055e('0x110')](db[_0x055e('0x1e2')],{'as':_0x055e('0x1e3'),'foreignKey':_0x055e('0x174')});db[_0x055e('0xf5')]['hasMany'](db[_0x055e('0x71')],{'as':_0x055e('0x122'),'onDelete':_0x055e('0x10f'),'foreignKey':'ListId'});db[_0x055e('0xf5')]['hasMany'](db[_0x055e('0x76')],{'as':_0x055e('0x14b'),'foreignKey':_0x055e('0x174')});db[_0x055e('0xf5')][_0x055e('0x110')](db[_0x055e('0x116')],{'as':_0x055e('0x1e4'),'foreignKey':_0x055e('0x174')});db[_0x055e('0xf5')][_0x055e('0x110')](db['ReportAgentPreview'],{'as':_0x055e('0x78'),'foreignKey':_0x055e('0x174')});db[_0x055e('0xf5')][_0x055e('0x11e')](db[_0x055e('0x1b')],{'as':_0x055e('0x1e5'),'through':_0x055e('0x157')});db[_0x055e('0xf5')][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':_0x055e('0x124')});db[_0x055e('0xf6')]['hasMany'](db[_0x055e('0x17')],{'as':_0x055e('0x115'),'onDelete':_0x055e('0x10f')});db['VoicePrefix'][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0x055e('0x11e')](db[_0x055e('0xe1')],{'through':'TeamVoicePrefix','as':_0x055e('0x16b')});db['UserProfile'][_0x055e('0x110')](db[_0x055e('0x11')],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile'][_0x055e('0x110')](db[_0x055e('0x1e6')],{'as':_0x055e('0x1e7'),'foreignKey':_0x055e('0x11d'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x1e6')][_0x055e('0x110')](db[_0x055e('0xfa')],{'as':_0x055e('0x1e8'),'foreignKey':_0x055e('0x1e9'),'onDelete':_0x055e('0x10f')});db['WhatsappAccount']['hasMany'](db['Disposition'],{'as':_0x055e('0x17f'),'foreignKey':_0x055e('0x1ea'),'onDelete':_0x055e('0x10f')});db[_0x055e('0x142')]['hasMany'](db[_0x055e('0x7e')],{'as':_0x055e('0x166'),'foreignKey':_0x055e('0x1ea')});db[_0x055e('0x142')]['hasMany'](db[_0x055e('0x1eb')],{'as':_0x055e('0x15b'),'foreignKey':_0x055e('0x1ea')});db[_0x055e('0x142')][_0x055e('0x110')](db[_0x055e('0x12d')],{'as':_0x055e('0x167')});db['WhatsappAccount'][_0x055e('0x110')](db[_0x055e('0xfe')],{'as':_0x055e('0x146')});db[_0x055e('0x142')][_0x055e('0x11c')](db['CmList'],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db[_0x055e('0x142')]['belongsTo'](db[_0x055e('0x154')],{'as':_0x055e('0x169'),'foreignKey':_0x055e('0x155')});db[_0x055e('0x142')][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x158'),'through':'user_has_whatsapp_accounts'});db[_0x055e('0xfe')][_0x055e('0x11c')](db[_0x055e('0x11')],{'onDelete':_0x055e('0x172')});db['WhatsappApplication'][_0x055e('0x11c')](db[_0x055e('0x105')],{'onDelete':_0x055e('0x172')});db[_0x055e('0xfe')][_0x055e('0x11c')](db[_0x055e('0x142')],{'onDelete':_0x055e('0x172')});db['WhatsappApplication'][_0x055e('0x11c')](db[_0x055e('0x82')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x153')});db[_0x055e('0xfe')]['belongsTo'](db[_0x055e('0x8a')],{'onDelete':_0x055e('0x172'),'foreignKey':_0x055e('0x173')});db[_0x055e('0x12d')]['hasMany'](db[_0x055e('0x1eb')],{'as':_0x055e('0x15b'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x055e('0x12d')][_0x055e('0x11c')](db[_0x055e('0x142')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ea')});db[_0x055e('0x12d')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':_0x055e('0x161'),'foreignKey':_0x055e('0x162')});db[_0x055e('0x12d')][_0x055e('0x11c')](db['User'],{'as':'Owner','foreignKey':_0x055e('0x112')});db[_0x055e('0x12d')][_0x055e('0x11e')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x055e('0x17d')});db[_0x055e('0x12d')][_0x055e('0x11e')](db[_0x055e('0x8a')],{'through':_0x055e('0x1ec'),'as':_0x055e('0x16e')});db[_0x055e('0x12d')][_0x055e('0x11e')](db[_0x055e('0x11')],{'as':_0x055e('0x18a'),'through':_0x055e('0x12f'),'foreignKey':_0x055e('0x1ed')});db[_0x055e('0x1eb')][_0x055e('0x11c')](db['User'],{'as':'User'});db[_0x055e('0x1eb')]['belongsTo'](db[_0x055e('0x71')],{'onDelete':'cascade','as':'Contact'});db[_0x055e('0x1eb')][_0x055e('0x11c')](db[_0x055e('0x12d')],{'onDelete':_0x055e('0x10f'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x055e('0x1eb')][_0x055e('0x11c')](db[_0x055e('0x142')],{'as':_0x055e('0x17b'),'foreignKey':_0x055e('0x1ea')});db[_0x055e('0x102')][_0x055e('0x11c')](db['WhatsappAccount'],{});db[_0x055e('0x102')]['belongsTo'](db[_0x055e('0xf5')],{'as':_0x055e('0x179'),'foreignKey':_0x055e('0x174')});db[_0x055e('0x102')][_0x055e('0x11c')](db[_0x055e('0x71')],{'as':'Contact','foreignKey':_0x055e('0x162')});db[_0x055e('0x102')][_0x055e('0x11c')](db[_0x055e('0x12d')],{});db[_0x055e('0x102')][_0x055e('0x11c')](db[_0x055e('0x105')],{});db['WhatsappQueueReport'][_0x055e('0x11c')](db[_0x055e('0x1eb')],{});db[_0x055e('0x102')]['belongsTo'](db[_0x055e('0x11')],{});db[_0x055e('0x1ee')][_0x055e('0x11c')](db[_0x055e('0x1eb')],{});db['WhatsappTransferReport'][_0x055e('0x11c')](db[_0x055e('0x12d')],{});db['WhatsappTransferReport'][_0x055e('0x11c')](db[_0x055e('0x142')],{'foreignKey':_0x055e('0x1ef'),'as':_0x055e('0x1d0')});db[_0x055e('0x1ee')][_0x055e('0x11c')](db['WhatsappAccount'],{'foreignKey':_0x055e('0x1f0'),'as':_0x055e('0x1d6')});db[_0x055e('0x1ee')][_0x055e('0x11c')](db[_0x055e('0x105')],{'foreignKey':_0x055e('0x1f1'),'as':_0x055e('0x1d5')});db[_0x055e('0x1ee')][_0x055e('0x11c')](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d1'),'as':_0x055e('0x1d2')});db[_0x055e('0x1ee')]['belongsTo'](db[_0x055e('0x11')],{'foreignKey':_0x055e('0x1d3'),'as':_0x055e('0x1d8')});db[_0x055e('0x105')][_0x055e('0x11e')](db['User'],{'as':_0x055e('0x158'),'through':_0x055e('0x139'),'foreignKey':_0x055e('0x1f2')});db[_0x055e('0x105')]['belongsToMany'](db[_0x055e('0xe1')],{'through':'team_has_whatsapp_queues','as':_0x055e('0x16b')});module[_0x055e('0x1f3')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x4522=['SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/interval/interval.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceRecording','VoiceQueuesRt','HopperHistory','OpenchannelInteraction','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','UserProfile','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','MailInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueue','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','CmList','ChatWebsite','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','Interval','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Teams','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','MailServerOut','Imap','Smtp','Disposition','Dispositions','Interactions','TemplateId','Agents','MailQueue','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','user_has_mail_interactions','MailInteractionId','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','IntervalId','TagId','MailQueueReport','List','ListId','FaxAccountId','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','Interaction','team_has_sms_queues','OpenchannelAccountId','Answers','OpenchannelApplication','openchannel_interaction_has_tags','OpenchannelInteractionId','OpenchannelMessage','OpenchannelQueueId','ProactiveActions','ChatInteraction','user_has_chat_websites','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','CmHopperFinal','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','AutomationId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Action','Actions','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','VariableId','SugarcrmField','Field','int_desk_configuration_has_tags','FreshdeskAccount','FreshdeskField','VtigerConfiguration','ServicenowAccount','ServicenowField','FreshsalesAccount','ToId','JscriptyAnswerReport','SessionId','ProjectId','FaxQueues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAgent','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CustomFields','voice_queues_has_cm_lists','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','UserWhatsappQueue','WhatsappQueueId','exports','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x4522,0x1a0));var _0x2452=function(_0x3e3748,_0x118608){_0x3e3748=_0x3e3748-0x0;var _0x467996=_0x4522[_0x3e3748];return _0x467996;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x2452('0x0'));var jstz=require(_0x2452('0x1'));var timezone=jstz[_0x2452('0x2')]();config['sequelize']=_[_0x2452('0x3')](config[_0x2452('0x4')],{'database':_0x2452('0x5'),'username':_0x2452('0x6'),'password':_0x2452('0x7'),'options':{'host':_0x2452('0x8'),'port':0xcea,'dialect':_0x2452('0x9'),'dialectOptions':{'charset':_0x2452('0xa')},'logging':![],'timezone':timezone[_0x2452('0xb')](),'define':{'charset':_0x2452('0xc'),'collate':_0x2452('0xd')}}});config[_0x2452('0xe')]=_[_0x2452('0x3')](config[_0x2452('0xe')],{'database':_0x2452('0x5'),'username':_0x2452('0x6'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x2452('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x2452('0xc'),'collate':_0x2452('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2452('0x4')][_0x2452('0xf')],config[_0x2452('0x4')][_0x2452('0x10')],config[_0x2452('0x4')][_0x2452('0x11')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x2452('0xf')],config['sequelizeHistory'][_0x2452('0x10')],config['sequelizeHistory'][_0x2452('0x11')],config[_0x2452('0xe')]['options'])};db[_0x2452('0x12')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x14'));db[_0x2452('0x15')]=db[_0x2452('0x4')]['import'](_0x2452('0x16'));db[_0x2452('0x17')]=db['sequelize']['import'](_0x2452('0x18'));db[_0x2452('0x19')]=db[_0x2452('0x4')]['import'](_0x2452('0x1a'));db[_0x2452('0x1b')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x1c'));db[_0x2452('0x1d')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x2452('0x1e')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x1f'));db[_0x2452('0x20')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/voiceMail/voiceMail.model');db[_0x2452('0x21')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x22'));db[_0x2452('0x23')]=db['sequelize']['import'](_0x2452('0x24'));db[_0x2452('0x25')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x26'));db['VoiceAgentReport']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x27'));db[_0x2452('0x28')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/memberReport/memberReport.model');db['Trunk']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x29'));db['VoiceTransferReport']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x2452('0x2a')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x2b'));db[_0x2452('0x2c')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x2d'));db[_0x2452('0x2e')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x2f'));db[_0x2452('0x30')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x31'));db['UserFaxQueue']=db[_0x2452('0x4')]['import'](_0x2452('0x32'));db[_0x2452('0x33')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x34'));db[_0x2452('0x35')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x36'));db['UserWhatsappQueue']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x37'));db[_0x2452('0x38')]=db[_0x2452('0x4')]['import']('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x39'));db[_0x2452('0x3a')]=db[_0x2452('0x4')]['import'](_0x2452('0x3b'));db['MailQueue']=db['sequelize'][_0x2452('0x13')]('../api/mailQueue/mailQueue.model');db[_0x2452('0x3c')]=db[_0x2452('0x4')]['import'](_0x2452('0x3d'));db[_0x2452('0x3e')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x3f'));db[_0x2452('0x40')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/mailMessage/mailMessage.model');db[_0x2452('0x41')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x42'));db['MailQueueReport']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x43'));db[_0x2452('0x44')]=db[_0x2452('0x4')]['import'](_0x2452('0x45'));db[_0x2452('0x46')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x47'));db[_0x2452('0x48')]=db[_0x2452('0x4')]['import'](_0x2452('0x49'));db[_0x2452('0x4a')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x4b'));db[_0x2452('0x4c')]=db['sequelize'][_0x2452('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x2452('0x4d')]=db[_0x2452('0x4')]['import']('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x2452('0x13')]('../api/faxQueue/faxQueue.model');db[_0x2452('0x4e')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x4f'));db['SmsAccount']=db['sequelize'][_0x2452('0x13')]('../api/smsAccount/smsAccount.model');db[_0x2452('0x50')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x51'));db['SmsInteraction']=db['sequelize'][_0x2452('0x13')](_0x2452('0x52'));db[_0x2452('0x53')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/smsMessage/smsMessage.model');db[_0x2452('0x54')]=db['sequelize'][_0x2452('0x13')]('../api/smsQueue/smsQueue.model');db[_0x2452('0x55')]=db[_0x2452('0x4')]['import'](_0x2452('0x56'));db['OpenchannelApplication']=db[_0x2452('0x4')]['import']('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x57'));db['OpenchannelMessage']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x58'));db[_0x2452('0x59')]=db[_0x2452('0x4')]['import'](_0x2452('0x5a'));db['ChatWebsite']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x5b'));db[_0x2452('0x5c')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x5d'));db[_0x2452('0x5e')]=db[_0x2452('0x4')]['import'](_0x2452('0x5f'));db['ChatInteraction']=db[_0x2452('0x4')]['import'](_0x2452('0x60'));db[_0x2452('0x61')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x62'));db[_0x2452('0x63')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x64'));db[_0x2452('0x65')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x66'));db[_0x2452('0x67')]=db['sequelize'][_0x2452('0x13')]('../api/chatGroup/chatGroup.model');db[_0x2452('0x68')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x69'));db[_0x2452('0x6a')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x6b'));db[_0x2452('0x6c')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x6d'));db[_0x2452('0x6e')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x6f'));db[_0x2452('0x70')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x71'));db['CmHopperFinal']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x2452('0x72')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x73'));db[_0x2452('0x74')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x75'));db[_0x2452('0x76')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x2452('0x4')]['import'](_0x2452('0x77'));db[_0x2452('0x78')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x79'));db[_0x2452('0x7a')]=db['sequelize']['import'](_0x2452('0x7b'));db['Disposition']=db[_0x2452('0x4')]['import'](_0x2452('0x7c'));db[_0x2452('0x7d')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/condition/condition.model');db['Interval']=db['sequelize'][_0x2452('0x13')](_0x2452('0x7e'));db['Pause']=db['sequelize']['import']('../api/pause/pause.model');db['Cdr']=db[_0x2452('0x4')]['import']('../api/cdr/cdr.model');db[_0x2452('0x7f')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x80'));db[_0x2452('0x81')]=db[_0x2452('0x4')]['import'](_0x2452('0x82'));db[_0x2452('0x83')]=db[_0x2452('0x4')]['import']('../api/sound/sound.model');db[_0x2452('0x84')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x85'));db[_0x2452('0x86')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x87'));db['Trigger']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x88'));db[_0x2452('0x89')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x8a'));db['Integration']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x8b'));db[_0x2452('0x8c')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x8d'));db[_0x2452('0x8e')]=db['sequelize']['import'](_0x2452('0x8f'));db[_0x2452('0x90')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2452('0x91')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x92'));db['AnalyticMetric']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x93'));db[_0x2452('0x94')]=db['sequelize']['import'](_0x2452('0x95'));db[_0x2452('0x96')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x97'));db[_0x2452('0x98')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x99'));db[_0x2452('0x9a')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x9b'));db[_0x2452('0x9c')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x9d'));db[_0x2452('0x9e')]=db[_0x2452('0x4')]['import'](_0x2452('0x9f'));db[_0x2452('0xa0')]=db[_0x2452('0x4')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xa1'));db[_0x2452('0xa2')]=db['sequelize']['import']('../api/intDeskAccount/intDeskAccount.model');db[_0x2452('0xa3')]=db['sequelize'][_0x2452('0x13')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2452('0xa4')]=db['sequelize'][_0x2452('0x13')]('../api/intDeskField/intDeskField.model');db[_0x2452('0xa5')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xa6'));db[_0x2452('0xa7')]=db['sequelize'][_0x2452('0x13')](_0x2452('0xa8'));db[_0x2452('0xa9')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xaa'));db[_0x2452('0xab')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xac'));db[_0x2452('0xad')]=db['sequelize'][_0x2452('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x2452('0xae')]=db['sequelize']['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db['sequelize']['import'](_0x2452('0xaf'));db[_0x2452('0xb0')]=db[_0x2452('0x4')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xb1'));db[_0x2452('0xb2')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xb3'));db['VtigerConfiguration']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x2452('0xb4')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xb5'));db['ServicenowAccount']=db[_0x2452('0x4')]['import'](_0x2452('0xb6'));db[_0x2452('0xb7')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xb8'));db['ServicenowField']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xb9'));db[_0x2452('0xba')]=db['sequelize'][_0x2452('0x13')](_0x2452('0xbb'));db[_0x2452('0xbc')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xbd'));db[_0x2452('0xbe')]=db['sequelize'][_0x2452('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db['sequelize'][_0x2452('0x13')](_0x2452('0xbf'));db[_0x2452('0xc0')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xc1'));db[_0x2452('0xc2')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db['Integration']=db['sequelize'][_0x2452('0x13')]('../api/integration/integration.model');db['Network']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xc3'));db[_0x2452('0xc4')]=db[_0x2452('0x4')]['import'](_0x2452('0xc5'));db[_0x2452('0xc6')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xc7'));db['JscriptyAnswerReport']=db[_0x2452('0x4')]['import'](_0x2452('0xc8'));db[_0x2452('0xc9')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xca'));db[_0x2452('0xcb')]=db['sequelize']['import'](_0x2452('0xcc'));db[_0x2452('0xcd')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xce'));db[_0x2452('0xcf')]=db['sequelize'][_0x2452('0x13')](_0x2452('0xd0'));db[_0x2452('0xd1')]=db[_0x2452('0x4')]['import'](_0x2452('0xd2'));db[_0x2452('0xd3')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xd4'));db['SquareOdbc']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0x2452('0x13')](_0x2452('0xd5'));db[_0x2452('0xd6')]=db['sequelize'][_0x2452('0x13')](_0x2452('0xd7'));db[_0x2452('0xd8')]=db['sequelize']['import'](_0x2452('0xd9'));db['Team']=db[_0x2452('0x4')][_0x2452('0x13')]('../api/team/team.model');db[_0x2452('0xda')]=db[_0x2452('0x4')][_0x2452('0x13')]('../api/license/license.model');db[_0x2452('0xdb')]=db[_0x2452('0x4')]['import'](_0x2452('0xdc'));db[_0x2452('0xdd')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xde'));db[_0x2452('0xdf')]=db[_0x2452('0x4')]['import'](_0x2452('0xe0'));db[_0x2452('0xe1')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xe2'));db[_0x2452('0xe3')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xe4'));db['ChatTransferReport']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xe5'));db[_0x2452('0xe6')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xe7'));db[_0x2452('0xe8')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xe9'));db['SmsTransferReport']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xea'));db['CmList']=db['sequelize'][_0x2452('0x13')]('../api/cmList/cmList.model');db[_0x2452('0xeb')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xec'));db['UserProfile']=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xed'));db[_0x2452('0xee')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xef'));db[_0x2452('0xf0')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xf1'));db['UserNotification']=db['sequelize']['import'](_0x2452('0xf2'));db[_0x2452('0xf3')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xf4'));db[_0x2452('0xf5')]=db['sequelize']['import'](_0x2452('0xf6'));db[_0x2452('0xf7')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xf8'));db[_0x2452('0xf9')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xfa'));db[_0x2452('0xfb')]=db['sequelize'][_0x2452('0x13')](_0x2452('0xfc'));db[_0x2452('0xfd')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0xfe'));db[_0x2452('0xff')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x100'));db[_0x2452('0x101')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x102'));db[_0x2452('0x103')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x104'));db[_0x2452('0x105')]=db['sequelize'][_0x2452('0x13')](_0x2452('0x106'));db[_0x2452('0x107')]=db[_0x2452('0x4')][_0x2452('0x13')](_0x2452('0x108'));db[_0x2452('0x12')][_0x2452('0x109')](db['VoiceMail'],{'as':_0x2452('0x20'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x10b')});db[_0x2452('0x12')][_0x2452('0x10c')](db[_0x2452('0x10d')],{'as':'Recordings','foreignKey':'UserId'});db['User'][_0x2452('0x10c')](db[_0x2452('0x2a')],{'as':_0x2452('0x10e'),'foreignKey':_0x2452('0x10b')});db[_0x2452('0x12')]['hasMany'](db[_0x2452('0x19')],{'as':'Extensions','onDelete':_0x2452('0x10a'),'hooks':!![]});db[_0x2452('0x12')][_0x2452('0x10c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x2452('0x10b')});db['User'][_0x2452('0x10c')](db[_0x2452('0x72')],{'as':_0x2452('0x10f'),'foreignKey':_0x2452('0x10b')});db[_0x2452('0x12')][_0x2452('0x10c')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'UserId'});db['User'][_0x2452('0x10c')](db[_0x2452('0x110')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db[_0x2452('0x12')][_0x2452('0x10c')](db['ChatInteraction'],{'as':_0x2452('0x111'),'foreignKey':_0x2452('0x10b')});db[_0x2452('0x12')][_0x2452('0x10c')](db[_0x2452('0x112')],{'as':_0x2452('0x113'),'foreignKey':'UserId'});db[_0x2452('0x12')][_0x2452('0x10c')](db[_0x2452('0x4c')],{'as':_0x2452('0x114'),'foreignKey':_0x2452('0x10b')});db['User'][_0x2452('0x10c')](db[_0x2452('0x3e')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0x2452('0x12')][_0x2452('0x10c')](db[_0x2452('0xf7')],{'as':_0x2452('0x115'),'foreignKey':'UserId'});db[_0x2452('0x12')][_0x2452('0x10c')](db[_0x2452('0x116')],{'as':_0x2452('0x117'),'foreignKey':_0x2452('0x118')});db[_0x2452('0x12')][_0x2452('0x119')](db[_0x2452('0x11a')],{'as':_0x2452('0x11a'),'foreignKey':'userProfileId'});db[_0x2452('0x12')]['belongsToMany'](db['ChatGroup'],{'as':_0x2452('0x11b'),'through':_0x2452('0x11c')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x6c')],{'as':'Contacts','through':_0x2452('0x11e')});db['User']['belongsToMany'](db['CmList'],{'as':_0x2452('0x11f'),'through':_0x2452('0x120')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x121')],{'through':_0x2452('0x122')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x3e')],{'as':_0x2452('0x123'),'through':'user_has_mail_interactions'});db[_0x2452('0x12')]['belongsToMany'](db['ChatInteraction'],{'as':_0x2452('0x111'),'through':'user_has_chat_interactions'});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x4c')],{'as':_0x2452('0x114'),'through':'user_has_fax_interactions'});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x112')],{'as':_0x2452('0x113'),'through':_0x2452('0x124')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x110')],{'as':_0x2452('0x125'),'through':'user_has_openchannel_interactions'});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0xf7')],{'as':'WhatsappInteractions','through':_0x2452('0x126')});db['User'][_0x2452('0x11d')](db[_0x2452('0x1d')],{'as':_0x2452('0x127'),'through':_0x2452('0x2c'),'required':![]});db[_0x2452('0x12')]['belongsToMany'](db[_0x2452('0xeb')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db['User'][_0x2452('0x11d')](db['MailQueue'],{'as':_0x2452('0x128'),'through':'UserMailQueue','required':![]});db[_0x2452('0x12')]['belongsToMany'](db[_0x2452('0x65')],{'as':_0x2452('0x129'),'through':_0x2452('0x2e'),'required':![],'hooks':!![]});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x12a')],{'as':'FaxQueues','through':_0x2452('0x12b'),'required':![]});db['User'][_0x2452('0x11d')](db[_0x2452('0x54')],{'as':_0x2452('0x12c'),'through':_0x2452('0x33'),'required':![]});db['User']['belongsToMany'](db[_0x2452('0x59')],{'as':_0x2452('0x12d'),'through':_0x2452('0x35'),'required':![]});db[_0x2452('0x12')]['belongsToMany'](db[_0x2452('0xff')],{'as':_0x2452('0x12e'),'through':'UserWhatsappQueue','required':![]});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x12f')],{'through':_0x2452('0x120')});db['User'][_0x2452('0x11d')](db[_0x2452('0x130')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db['User'][_0x2452('0x11d')](db[_0x2452('0x48')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x3a')],{'as':_0x2452('0x131'),'through':_0x2452('0x132')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x55')],{'as':_0x2452('0x133'),'through':_0x2452('0x134')});db[_0x2452('0x12')]['belongsToMany'](db[_0x2452('0x135')],{'as':'SmsAccounts','through':_0x2452('0x136')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0xf3')],{'as':'WhatsappAccounts','through':_0x2452('0x137')});db[_0x2452('0x12')][_0x2452('0x11d')](db[_0x2452('0x138')],{'as':_0x2452('0x139'),'through':_0x2452('0x13a')});db[_0x2452('0x15')][_0x2452('0x10c')](db[_0x2452('0x19')],{'as':_0x2452('0x13b'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x2452('0x17')]['hasMany'](db[_0x2452('0x19')],{'onDelete':'cascade'});db[_0x2452('0x19')][_0x2452('0x10c')](db[_0x2452('0x19')],{'as':_0x2452('0x13c'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x1b')][_0x2452('0x11d')](db[_0x2452('0x83')],{'as':_0x2452('0x13d'),'through':_0x2452('0x13e')});db['VoiceQueue']['hasMany'](db[_0x2452('0x2a')],{'as':_0x2452('0x13f'),'foreignKey':_0x2452('0x140')});db[_0x2452('0x1d')][_0x2452('0x10c')](db[_0x2452('0x6e')],{'as':_0x2452('0x141'),'foreignKey':'VoiceQueueId'});db[_0x2452('0x1d')]['hasMany'](db['CmHopperFinal'],{'as':_0x2452('0x142'),'foreignKey':'VoiceQueueId'});db[_0x2452('0x1d')]['hasMany'](db[_0x2452('0x72')],{'as':_0x2452('0x143'),'foreignKey':_0x2452('0x140')});db[_0x2452('0x1d')][_0x2452('0x10c')](db[_0x2452('0x74')],{'as':_0x2452('0x74'),'foreignKey':_0x2452('0x140')});db[_0x2452('0x1d')][_0x2452('0x10c')](db['CmHopperBlack'],{'as':_0x2452('0x144'),'foreignKey':_0x2452('0x140')});db[_0x2452('0x1d')][_0x2452('0x10c')](db[_0x2452('0xcb')],{'as':_0x2452('0x145'),'foreignKey':'VoiceQueueId'});db[_0x2452('0x1d')][_0x2452('0x119')](db[_0x2452('0x146')],{'as':_0x2452('0x146'),'foreignKey':_0x2452('0x147')});db[_0x2452('0x1d')]['belongsTo'](db[_0x2452('0x146')],{'as':_0x2452('0x148'),'foreignKey':_0x2452('0x149')});db[_0x2452('0x1d')]['belongsTo'](db[_0x2452('0x14a')],{'as':_0x2452('0x14a'),'foreignKey':'IntervalId'});db[_0x2452('0x1d')][_0x2452('0x119')](db[_0x2452('0x14b')],{'as':_0x2452('0x14c'),'foreignKey':_0x2452('0x14d')});db[_0x2452('0x1d')]['belongsToMany'](db[_0x2452('0x12f')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x2452('0x1d')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x2452('0x1d')][_0x2452('0x11d')](db[_0x2452('0x121')],{'as':_0x2452('0x14e'),'through':_0x2452('0x103')});db[_0x2452('0x1d')][_0x2452('0x11d')](db[_0x2452('0x12f')],{'as':_0x2452('0x14f'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x2452('0x119')](db[_0x2452('0x12')],{'as':_0x2452('0x12'),'foreignKey':_0x2452('0x10b')});db[_0x2452('0x1e')]['belongsTo'](db[_0x2452('0x12')],{'as':_0x2452('0x12'),'foreignKey':'UserId'});db[_0x2452('0x20')]['hasMany'](db['VoiceMailMessage'],{'as':_0x2452('0x150'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x151'),'sourceKey':_0x2452('0x152')});db[_0x2452('0x21')]['belongsTo'](db[_0x2452('0x20')],{'foreignKey':_0x2452('0x151'),'targetKey':'mailbox'});db[_0x2452('0x23')]['hasMany'](db['VoiceQueueReport'],{'as':_0x2452('0x153'),'foreignKey':_0x2452('0x154'),'constraints':![]});db[_0x2452('0x23')][_0x2452('0x10c')](db['VoiceAgentReport'],{'as':_0x2452('0x155'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x2452('0x12')],{'as':'User','foreignKey':_0x2452('0x10b')});db[_0x2452('0x23')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db[_0x2452('0x38')][_0x2452('0x119')](db[_0x2452('0x3a')],{'as':'MailAccount','foreignKey':_0x2452('0x158')});db[_0x2452('0x159')][_0x2452('0x119')](db[_0x2452('0x3a')],{'as':_0x2452('0x3a'),'foreignKey':_0x2452('0x158')});db['MailAccount'][_0x2452('0x109')](db[_0x2452('0x38')],{'as':_0x2452('0x15a'),'onDelete':'cascade'});db['MailAccount'][_0x2452('0x109')](db['MailServerOut'],{'as':_0x2452('0x15b'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x3a')][_0x2452('0x10c')](db[_0x2452('0x15c')],{'as':_0x2452('0x15d'),'foreignKey':_0x2452('0x158'),'onDelete':'cascade'});db['MailAccount'][_0x2452('0x10c')](db[_0x2452('0x7a')],{'as':'Answers','foreignKey':_0x2452('0x158')});db[_0x2452('0x3a')]['hasMany'](db[_0x2452('0x40')],{'as':_0x2452('0x150'),'foreignKey':_0x2452('0x158')});db[_0x2452('0x3a')]['hasMany'](db[_0x2452('0x3e')],{'as':_0x2452('0x15e')});db[_0x2452('0x3a')][_0x2452('0x10c')](db[_0x2452('0x41')],{'as':'Applications'});db[_0x2452('0x3a')]['belongsTo'](db[_0x2452('0x12f')],{'as':'List','foreignKey':'ListId'});db['MailAccount'][_0x2452('0x119')](db[_0x2452('0x86')],{'as':_0x2452('0x86'),'foreignKey':_0x2452('0x15f')});db[_0x2452('0x3a')][_0x2452('0x119')](db[_0x2452('0x14b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['MailAccount']['belongsToMany'](db['User'],{'as':'Agents','through':_0x2452('0x132')});db['MailQueue'][_0x2452('0x11d')](db['User'],{'as':_0x2452('0x160'),'through':_0x2452('0x30')});db[_0x2452('0x161')]['belongsToMany'](db[_0x2452('0x121')],{'through':_0x2452('0x162'),'as':_0x2452('0x14e')});db[_0x2452('0x3e')][_0x2452('0x10c')](db[_0x2452('0x40')],{'as':_0x2452('0x150'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x2452('0x3e')][_0x2452('0x119')](db[_0x2452('0x3a')],{'as':_0x2452('0x163'),'foreignKey':'MailAccountId'});db[_0x2452('0x3e')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':'Contact','foreignKey':_0x2452('0x157')});db[_0x2452('0x3e')][_0x2452('0x119')](db['User'],{'as':_0x2452('0x164'),'foreignKey':_0x2452('0x10b')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0x2452('0x165'),'as':_0x2452('0x166')});db[_0x2452('0x3e')]['belongsToMany'](db[_0x2452('0x84')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x2452('0x3e')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':'Users','through':_0x2452('0x167'),'foreignKey':_0x2452('0x168')});db[_0x2452('0x40')][_0x2452('0x10c')](db[_0x2452('0xdf')],{'as':_0x2452('0x169'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x40')][_0x2452('0x119')](db[_0x2452('0x12')],{'as':_0x2452('0x12')});db[_0x2452('0x40')]['belongsTo'](db[_0x2452('0x6c')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x156')});db['MailMessage'][_0x2452('0x119')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x2452('0x168')});db[_0x2452('0x40')]['belongsTo'](db[_0x2452('0x3a')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x2452('0x40')]['belongsTo'](db[_0x2452('0x130')],{'as':_0x2452('0x130'),'foreignKey':_0x2452('0x16a')});db[_0x2452('0x40')][_0x2452('0x119')](db[_0x2452('0x63')],{'as':_0x2452('0x63'),'foreignKey':_0x2452('0x16b')});db[_0x2452('0x41')][_0x2452('0x119')](db[_0x2452('0x12')],{'onDelete':_0x2452('0x16c')});db[_0x2452('0x41')][_0x2452('0x119')](db[_0x2452('0x161')],{'onDelete':'restrict'});db[_0x2452('0x41')][_0x2452('0x119')](db['MailAccount'],{'onDelete':_0x2452('0x16c')});db[_0x2452('0x41')][_0x2452('0x119')](db[_0x2452('0x14a')],{'onDelete':_0x2452('0x16c'),'foreignKey':_0x2452('0x16d')});db['MailApplication'][_0x2452('0x119')](db[_0x2452('0x84')],{'onDelete':_0x2452('0x16c'),'foreignKey':_0x2452('0x16e')});db[_0x2452('0x16f')][_0x2452('0x119')](db[_0x2452('0x3a')],{});db[_0x2452('0x16f')][_0x2452('0x119')](db['CmList'],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171')});db['MailQueueReport']['belongsTo'](db[_0x2452('0x6c')],{'as':'Contact','foreignKey':_0x2452('0x157')});db['MailQueueReport']['belongsTo'](db[_0x2452('0x3e')],{});db[_0x2452('0x16f')][_0x2452('0x119')](db[_0x2452('0x40')],{});db['MailQueueReport'][_0x2452('0x119')](db[_0x2452('0x12')],{});db[_0x2452('0x16f')]['belongsTo'](db['MailQueue'],{});db[_0x2452('0x44')][_0x2452('0x10c')](db[_0x2452('0x46')],{'as':'Items','onDelete':'cascade'});db[_0x2452('0x48')][_0x2452('0x10c')](db['Disposition'],{'as':_0x2452('0x15d'),'foreignKey':_0x2452('0x172'),'onDelete':'cascade'});db[_0x2452('0x48')][_0x2452('0x10c')](db[_0x2452('0x7a')],{'as':'Answers','foreignKey':_0x2452('0x172')});db['FaxAccount'][_0x2452('0x10c')](db[_0x2452('0x4c')],{'as':_0x2452('0x15e')});db[_0x2452('0x48')][_0x2452('0x10c')](db[_0x2452('0x4a')],{'as':_0x2452('0x13c')});db[_0x2452('0x48')][_0x2452('0x10c')](db[_0x2452('0x19')],{'as':_0x2452('0x173'),'onDelete':_0x2452('0x10a')});db['FaxAccount'][_0x2452('0x10c')](db[_0x2452('0x4d')],{'as':'Messages'});db[_0x2452('0x48')][_0x2452('0x119')](db[_0x2452('0x146')],{'as':_0x2452('0x146')});db[_0x2452('0x48')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171')});db['FaxAccount'][_0x2452('0x119')](db[_0x2452('0x14b')],{'as':'mandatoryDispositionPause','foreignKey':_0x2452('0x14d')});db[_0x2452('0x48')][_0x2452('0x11d')](db['User'],{'as':'Agents','through':_0x2452('0x174')});db[_0x2452('0x4a')][_0x2452('0x119')](db[_0x2452('0x12')],{'onDelete':'restrict'});db[_0x2452('0x4a')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x2452('0x16c')});db[_0x2452('0x4a')][_0x2452('0x119')](db[_0x2452('0x48')],{'onDelete':_0x2452('0x16c')});db['FaxApplication']['belongsTo'](db[_0x2452('0x84')],{'onDelete':_0x2452('0x16c'),'foreignKey':_0x2452('0x16e')});db['FaxInteraction'][_0x2452('0x10c')](db[_0x2452('0x4d')],{'as':_0x2452('0x150'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x175')});db[_0x2452('0x4c')][_0x2452('0x119')](db[_0x2452('0x48')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x2452('0x4c')][_0x2452('0x119')](db['CmContact'],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db[_0x2452('0x4c')][_0x2452('0x119')](db[_0x2452('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x2452('0x4c')][_0x2452('0x11d')](db['Tag'],{'through':_0x2452('0x176'),'as':'Tags'});db[_0x2452('0x4c')][_0x2452('0x11d')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x2452('0x177')});db['FaxInteraction'][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x178'),'through':_0x2452('0x179'),'foreignKey':_0x2452('0x175')});db['FaxMessage'][_0x2452('0x119')](db[_0x2452('0x12')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x12')});db[_0x2452('0x4d')][_0x2452('0x119')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0x2452('0x175')});db[_0x2452('0x4d')][_0x2452('0x119')](db[_0x2452('0x6c')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x156')});db[_0x2452('0x4d')][_0x2452('0x119')](db[_0x2452('0xdf')],{'as':'Attachment','foreignKey':_0x2452('0x17a')});db[_0x2452('0x4d')][_0x2452('0x119')](db['FaxAccount'],{'as':_0x2452('0x163'),'foreignKey':'FaxAccountId'});db[_0x2452('0x12a')]['belongsToMany'](db[_0x2452('0x12')],{'as':'Agents','through':'UserFaxQueue'});db[_0x2452('0x12a')][_0x2452('0x11d')](db['Team'],{'through':_0x2452('0x17b'),'as':_0x2452('0x14e')});db[_0x2452('0x4e')][_0x2452('0x119')](db[_0x2452('0x48')],{});db[_0x2452('0x4e')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':'ListId'});db[_0x2452('0x4e')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db[_0x2452('0x4e')][_0x2452('0x119')](db[_0x2452('0x4c')],{});db[_0x2452('0x4e')][_0x2452('0x119')](db[_0x2452('0x4d')],{});db[_0x2452('0x4e')][_0x2452('0x119')](db[_0x2452('0x12')],{});db[_0x2452('0x4e')]['belongsTo'](db[_0x2452('0x12a')],{});db[_0x2452('0x135')][_0x2452('0x10c')](db['Disposition'],{'as':_0x2452('0x15d'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x2452('0x135')][_0x2452('0x10c')](db[_0x2452('0x7a')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0x2452('0x135')][_0x2452('0x10c')](db['SmsMessage'],{'as':_0x2452('0x150'),'foreignKey':_0x2452('0x17c')});db['SmsAccount'][_0x2452('0x10c')](db[_0x2452('0x112')],{'as':_0x2452('0x15e')});db[_0x2452('0x135')][_0x2452('0x10c')](db[_0x2452('0x50')],{'as':'Applications'});db[_0x2452('0x135')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171')});db[_0x2452('0x135')][_0x2452('0x119')](db[_0x2452('0x14b')],{'as':_0x2452('0x14c'),'foreignKey':_0x2452('0x14d')});db['SmsAccount']['belongsToMany'](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x136')});db[_0x2452('0x50')]['belongsTo'](db[_0x2452('0x12')],{'onDelete':'restrict'});db['SmsApplication'][_0x2452('0x119')](db[_0x2452('0x54')],{'onDelete':_0x2452('0x16c')});db[_0x2452('0x50')][_0x2452('0x119')](db[_0x2452('0x135')],{'onDelete':_0x2452('0x16c')});db[_0x2452('0x50')][_0x2452('0x119')](db[_0x2452('0x14a')],{'onDelete':_0x2452('0x16c'),'foreignKey':'IntervalId'});db[_0x2452('0x50')]['belongsTo'](db['Tag'],{'onDelete':_0x2452('0x16c'),'foreignKey':_0x2452('0x16e')});db['SmsInteraction'][_0x2452('0x10c')](db['SmsMessage'],{'as':_0x2452('0x150'),'onDelete':_0x2452('0x10a'),'foreignKey':'SmsInteractionId'});db[_0x2452('0x112')][_0x2452('0x119')](db[_0x2452('0x135')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x17c')});db[_0x2452('0x112')][_0x2452('0x119')](db['CmContact'],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db['SmsInteraction'][_0x2452('0x119')](db[_0x2452('0x12')],{'as':'Owner','foreignKey':_0x2452('0x10b')});db[_0x2452('0x112')][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x17d'),'as':_0x2452('0x166')});db['SmsInteraction'][_0x2452('0x11d')](db['Tag'],{'through':_0x2452('0x17d'),'as':'ThroughTags'});db[_0x2452('0x112')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':_0x2452('0x17e')});db[_0x2452('0x53')][_0x2452('0x119')](db['User'],{'as':_0x2452('0x12')});db[_0x2452('0x53')][_0x2452('0x119')](db[_0x2452('0x6c')],{'onDelete':'cascade','as':_0x2452('0x156')});db['SmsMessage'][_0x2452('0x119')](db[_0x2452('0x112')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x17f'),'foreignKey':'SmsInteractionId'});db[_0x2452('0x53')][_0x2452('0x119')](db[_0x2452('0x135')],{'as':_0x2452('0x163'),'foreignKey':'SmsAccountId'});db[_0x2452('0x54')]['belongsToMany'](db['User'],{'as':_0x2452('0x160'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x2452('0x54')][_0x2452('0x11d')](db[_0x2452('0x121')],{'through':_0x2452('0x180'),'as':_0x2452('0x14e')});db[_0x2452('0x55')][_0x2452('0x10c')](db[_0x2452('0x15c')],{'as':'Dispositions','foreignKey':_0x2452('0x181'),'onDelete':'cascade'});db[_0x2452('0x55')][_0x2452('0x10c')](db['CannedAnswer'],{'as':_0x2452('0x182'),'foreignKey':'OpenchannelAccountId'});db[_0x2452('0x55')][_0x2452('0x10c')](db['OpenchannelInteraction'],{'as':'Interactions','foreignKey':_0x2452('0x181')});db[_0x2452('0x55')]['hasMany'](db['OpenchannelMessage'],{'as':_0x2452('0x150'),'foreignKey':_0x2452('0x181')});db[_0x2452('0x55')][_0x2452('0x10c')](db[_0x2452('0x183')],{'as':_0x2452('0x13c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':'ListId'});db[_0x2452('0x55')]['belongsTo'](db['Pause'],{'as':_0x2452('0x14c'),'foreignKey':_0x2452('0x14d')});db[_0x2452('0x55')]['belongsToMany'](db[_0x2452('0x12')],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x2452('0x119')](db[_0x2452('0x12')],{'onDelete':_0x2452('0x16c')});db[_0x2452('0x183')][_0x2452('0x119')](db[_0x2452('0x59')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x2452('0x183')]['belongsTo'](db[_0x2452('0x55')],{'onDelete':_0x2452('0x16c'),'foreignKey':_0x2452('0x181')});db[_0x2452('0x183')][_0x2452('0x119')](db[_0x2452('0x14a')],{'onDelete':_0x2452('0x16c'),'foreignKey':'IntervalId'});db[_0x2452('0x183')][_0x2452('0x119')](db[_0x2452('0x84')],{'onDelete':'restrict','foreignKey':_0x2452('0x16e')});db['OpenchannelInteraction'][_0x2452('0x10c')](db['OpenchannelMessage'],{'as':_0x2452('0x150'),'onDelete':_0x2452('0x10a'),'foreignKey':'OpenchannelInteractionId'});db[_0x2452('0x110')][_0x2452('0x119')](db[_0x2452('0x55')],{'as':_0x2452('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0x2452('0x110')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db['OpenchannelInteraction'][_0x2452('0x119')](db[_0x2452('0x12')],{'as':_0x2452('0x164'),'foreignKey':'UserId'});db[_0x2452('0x110')][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x184'),'as':_0x2452('0x166')});db[_0x2452('0x110')][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x184'),'as':_0x2452('0x177')});db[_0x2452('0x110')]['belongsToMany'](db['User'],{'as':_0x2452('0x178'),'through':'user_has_openchannel_interactions','foreignKey':_0x2452('0x185')});db[_0x2452('0x186')]['belongsTo'](db[_0x2452('0x12')],{'onDelete':'cascade','as':'User'});db[_0x2452('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x156')});db['OpenchannelMessage'][_0x2452('0x119')](db[_0x2452('0x110')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x17f'),'foreignKey':_0x2452('0x185')});db[_0x2452('0x186')][_0x2452('0x119')](db[_0x2452('0xdf')],{'as':'Attachment','foreignKey':_0x2452('0x17a')});db[_0x2452('0x186')][_0x2452('0x119')](db[_0x2452('0x55')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x181')});db[_0x2452('0x59')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x35'),'foreignKey':_0x2452('0x187')});db[_0x2452('0x59')][_0x2452('0x11d')](db[_0x2452('0x121')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x2452('0x130')][_0x2452('0x10c')](db[_0x2452('0x15c')],{'as':'Dispositions','foreignKey':_0x2452('0x16a'),'onDelete':'cascade'});db[_0x2452('0x130')][_0x2452('0x10c')](db[_0x2452('0x7a')],{'as':_0x2452('0x182'),'foreignKey':_0x2452('0x16a')});db[_0x2452('0x130')][_0x2452('0x10c')](db[_0x2452('0x68')],{'as':_0x2452('0x188')});db[_0x2452('0x130')]['hasMany'](db[_0x2452('0x189')],{'as':_0x2452('0x15e')});db[_0x2452('0x130')][_0x2452('0x10c')](db[_0x2452('0x5e')],{'as':'Applications'});db[_0x2452('0x130')][_0x2452('0x10c')](db[_0x2452('0x61')],{'as':'Messages'});db[_0x2452('0x130')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':'ListId'});db['ChatWebsite']['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x2452('0x16d')});db['ChatWebsite'][_0x2452('0x119')](db[_0x2452('0x3a')],{'as':'MailAccount','foreignKey':_0x2452('0x158')});db[_0x2452('0x130')]['belongsTo'](db[_0x2452('0x14b')],{'as':_0x2452('0x14c'),'foreignKey':_0x2452('0x14d')});db[_0x2452('0x130')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x18a')});db['OpenchannelQueueReport'][_0x2452('0x119')](db[_0x2452('0x55')],{});db[_0x2452('0x5c')]['belongsTo'](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171')});db[_0x2452('0x5c')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x2452('0x5c')]['belongsTo'](db[_0x2452('0x186')],{});db[_0x2452('0x5c')]['belongsTo'](db['User'],{});db[_0x2452('0x5c')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x2452('0x5e')][_0x2452('0x119')](db['User'],{'as':_0x2452('0x18b'),'foreignKey':_0x2452('0x10b'),'onDelete':_0x2452('0x16c')});db['ChatApplication'][_0x2452('0x119')](db[_0x2452('0x65')],{'as':'Queue','foreignKey':_0x2452('0x18c'),'onDelete':_0x2452('0x16c')});db['ChatApplication'][_0x2452('0x119')](db[_0x2452('0x130')],{'as':_0x2452('0x18d'),'foreignKey':'ChatWebsiteId','onDelete':_0x2452('0x16c')});db['ChatApplication'][_0x2452('0x119')](db[_0x2452('0x84')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2452('0x189')][_0x2452('0x10c')](db[_0x2452('0x61')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x2452('0x18e')});db[_0x2452('0x189')][_0x2452('0x119')](db[_0x2452('0x130')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x16a')});db[_0x2452('0x189')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db[_0x2452('0x189')][_0x2452('0x119')](db[_0x2452('0x12')],{'as':_0x2452('0x164'),'foreignKey':'UserId'});db[_0x2452('0x189')][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x18f'),'as':'Tags'});db['ChatInteraction'][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x18f'),'as':_0x2452('0x177')});db['ChatInteraction'][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x178'),'through':_0x2452('0x190'),'foreignKey':_0x2452('0x18e')});db[_0x2452('0x61')][_0x2452('0x119')](db['User'],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x12')});db[_0x2452('0x61')][_0x2452('0x119')](db[_0x2452('0x6c')],{'onDelete':_0x2452('0x10a'),'as':'Contact','foreignKey':_0x2452('0x157')});db['ChatMessage'][_0x2452('0x119')](db[_0x2452('0x189')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x17f'),'foreignKey':_0x2452('0x18e')});db[_0x2452('0x61')]['belongsTo'](db['Attachment'],{'as':_0x2452('0xdf'),'foreignKey':_0x2452('0x17a')});db[_0x2452('0x61')]['belongsTo'](db[_0x2452('0x130')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x16a')});db[_0x2452('0x63')][_0x2452('0x10c')](db[_0x2452('0xdf')],{'as':_0x2452('0x169'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x2452('0x10a'),'hooks':!![]});db[_0x2452('0x63')]['belongsTo'](db[_0x2452('0x6c')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x156'),'foreignKey':'ContactId'});db[_0x2452('0x63')][_0x2452('0x119')](db[_0x2452('0x130')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x16a')});db[_0x2452('0x65')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x2e'),'hooks':!![]});db[_0x2452('0x65')]['belongsToMany'](db['Team'],{'through':_0x2452('0x191'),'as':_0x2452('0x14e')});db['ChatGroup'][_0x2452('0x10c')](db[_0x2452('0xc6')],{'as':_0x2452('0x150'),'foreignKey':_0x2452('0x192'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x67')]['belongsToMany'](db[_0x2452('0x12')],{'as':_0x2452('0x13f'),'through':_0x2452('0x11c')});db[_0x2452('0x68')][_0x2452('0x119')](db['ChatWebsite'],{'as':_0x2452('0x18d'),'foreignKey':_0x2452('0x16a')});db[_0x2452('0x6a')][_0x2452('0x10c')](db[_0x2452('0x6c')],{'as':_0x2452('0x193'),'foreignKey':_0x2452('0x194')});db[_0x2452('0x6c')][_0x2452('0x10c')](db[_0x2452('0x6e')],{'as':'Hoppers','foreignKey':_0x2452('0x157')});db['CmContact'][_0x2452('0x10c')](db[_0x2452('0x195')],{'as':_0x2452('0x142'),'foreignKey':'ContactId'});db[_0x2452('0x6c')]['hasMany'](db[_0x2452('0x72')],{'as':_0x2452('0x143'),'foreignKey':_0x2452('0x157')});db['CmContact'][_0x2452('0x10c')](db[_0x2452('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x2452('0x157')});db[_0x2452('0x6c')]['hasMany'](db[_0x2452('0xcb')],{'as':_0x2452('0x145'),'foreignKey':_0x2452('0x157')});db[_0x2452('0x6c')][_0x2452('0x10c')](db[_0x2452('0x110')],{'as':_0x2452('0x125'),'foreignKey':_0x2452('0x157'),'onDelete':'restrict'});db[_0x2452('0x6c')][_0x2452('0x10c')](db[_0x2452('0x189')],{'as':'ChatInteractions','foreignKey':_0x2452('0x157'),'onDelete':_0x2452('0x16c')});db['CmContact']['hasMany'](db[_0x2452('0x112')],{'as':_0x2452('0x113'),'foreignKey':_0x2452('0x157'),'onDelete':_0x2452('0x16c')});db[_0x2452('0x6c')][_0x2452('0x10c')](db['FaxInteraction'],{'as':_0x2452('0x114'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x2452('0x6c')]['hasMany'](db[_0x2452('0x3e')],{'as':'MailInteractions','foreignKey':_0x2452('0x157'),'onDelete':'restrict'});db[_0x2452('0x6c')][_0x2452('0x119')](db[_0x2452('0x6a')],{'as':_0x2452('0x196'),'foreignKey':_0x2452('0x194')});db[_0x2452('0x6c')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171'),'onDelete':_0x2452('0x10a')});db['CmContact'][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x178'),'through':_0x2452('0x11e')});db[_0x2452('0x6c')][_0x2452('0x11d')](db[_0x2452('0x84')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x2452('0x6c')][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x197'),'as':_0x2452('0x177')});db['CmHopper'][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x6e')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':'ListId','onDelete':_0x2452('0x10a')});db[_0x2452('0x6e')][_0x2452('0x119')](db['User'],{'as':_0x2452('0x18b'),'foreignKey':_0x2452('0x10b')});db['CmHopper']['belongsTo'](db[_0x2452('0x1d')],{'as':_0x2452('0x198'),'foreignKey':_0x2452('0x140'),'onDelete':_0x2452('0x10a')});db['CmHopper'][_0x2452('0x119')](db[_0x2452('0xdb')],{'as':_0x2452('0xdb'),'foreignKey':_0x2452('0x199'),'onDelete':_0x2452('0x10a')});db['CmHopper'][_0x2452('0x119')](db[_0x2452('0x12')],{'as':_0x2452('0x164'),'foreignKey':_0x2452('0x19a')});db[_0x2452('0x70')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':'Contact','foreignKey':_0x2452('0x157'),'onDelete':_0x2452('0x10a')});db['CmHopperBlack'][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x70')]['belongsTo'](db[_0x2452('0x1d')],{'as':'Queue','foreignKey':_0x2452('0x140'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x70')][_0x2452('0x119')](db['Campaign'],{'as':'Campaign','foreignKey':_0x2452('0x199'),'onDelete':_0x2452('0x10a')});db['Automation'][_0x2452('0x10c')](db['Condition'],{'as':{'plural':_0x2452('0x19b'),'singular':_0x2452('0x19c')},'foreignKey':_0x2452('0x19d'),'onDelete':'cascade','hooks':!![]});db[_0x2452('0x78')]['hasMany'](db['Condition'],{'as':{'plural':_0x2452('0x19e'),'singular':_0x2452('0x19f')},'foreignKey':_0x2452('0x1a0'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x2452('0x10c')](db['Action'],{'as':'Actions','foreignKey':_0x2452('0x1a1'),'onDelete':_0x2452('0x10a'),'hooks':!![]});db[_0x2452('0x15c')][_0x2452('0x10c')](db[_0x2452('0x15c')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0x2452('0x10a')});db[_0x2452('0x14a')]['hasMany'](db[_0x2452('0x14a')],{'as':_0x2452('0x1a2'),'foreignKey':_0x2452('0x16d'),'onDelete':_0x2452('0x10a'),'hooks':!![],'required':![]});db['Interval'][_0x2452('0x10c')](db[_0x2452('0x19')],{'as':_0x2452('0x1a3'),'foreignKey':_0x2452('0x16d'),'onDelete':_0x2452('0x16c')});db[_0x2452('0x14a')][_0x2452('0x10c')](db[_0x2452('0x41')],{'as':'MailApplications','foreignKey':_0x2452('0x16d')});db['Interval'][_0x2452('0x10c')](db['ChatApplication'],{'as':_0x2452('0x1a4'),'foreignKey':_0x2452('0x16d')});db[_0x2452('0x14a')][_0x2452('0x10c')](db[_0x2452('0x4a')],{'as':_0x2452('0x1a5'),'foreignKey':_0x2452('0x16d')});db['Interval'][_0x2452('0x10c')](db['SmsApplication'],{'as':_0x2452('0x1a6'),'foreignKey':_0x2452('0x16d')});db[_0x2452('0x81')][_0x2452('0x119')](db['MailAccount'],{});db[_0x2452('0x81')][_0x2452('0x119')](db['AnalyticDefaultReport'],{'foreignKey':_0x2452('0x1a7')});db[_0x2452('0x81')][_0x2452('0x119')](db[_0x2452('0x8e')],{'foreignKey':_0x2452('0x1a8')});db[_0x2452('0x83')][_0x2452('0x11d')](db[_0x2452('0x1b')],{'as':_0x2452('0x1a9'),'through':_0x2452('0x13e'),'onDelete':'restrict'});db['Tag']['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x2452('0x84')]['belongsToMany'](db[_0x2452('0x189')],{'through':_0x2452('0x18f')});db[_0x2452('0x84')][_0x2452('0x11d')](db[_0x2452('0x3e')],{'through':'mail_interaction_has_tags'});db[_0x2452('0x84')][_0x2452('0x11d')](db[_0x2452('0x112')],{'through':_0x2452('0x17d')});db['Tag'][_0x2452('0x11d')](db[_0x2452('0x4c')],{'through':_0x2452('0x176')});db[_0x2452('0x84')][_0x2452('0x11d')](db[_0x2452('0x110')],{'through':_0x2452('0x184')});db[_0x2452('0x84')][_0x2452('0x11d')](db[_0x2452('0xf7')],{'through':_0x2452('0x1aa')});db[_0x2452('0x1ab')][_0x2452('0x10c')](db['Condition'],{'as':{'plural':'AllConditions','singular':_0x2452('0x1ac')},'foreignKey':_0x2452('0x1ad'),'onDelete':_0x2452('0x10a'),'hooks':!![]});db[_0x2452('0x1ab')][_0x2452('0x10c')](db[_0x2452('0x7d')],{'as':{'plural':_0x2452('0x1ae'),'singular':_0x2452('0x1af')},'foreignKey':'TriggerAnyId','onDelete':_0x2452('0x10a'),'hooks':!![]});db[_0x2452('0x1ab')][_0x2452('0x10c')](db[_0x2452('0x1b0')],{'as':_0x2452('0x1b1'),'foreignKey':'TriggerId','onDelete':_0x2452('0x10a'),'hooks':!![]});db[_0x2452('0x8e')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x2452('0x1b2'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1a8'),'hooks':!![]});db[_0x2452('0x90')][_0x2452('0x10c')](db[_0x2452('0x94')],{'as':'Fields','onDelete':_0x2452('0x10a'),'foreignKey':'DefaultReportId'});db[_0x2452('0x1b3')][_0x2452('0x10c')](db['AnalyticFieldReport'],{'as':_0x2452('0x1b2'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1b4')});db[_0x2452('0x94')][_0x2452('0x119')](db['AnalyticMetric'],{'foreignKey':_0x2452('0x1b4')});db[_0x2452('0x98')]['hasMany'](db[_0x2452('0x9a')],{'as':_0x2452('0x1b5'),'onDelete':'cascade','foreignKey':_0x2452('0x1b6')});db['SalesforceConfiguration'][_0x2452('0x10c')](db[_0x2452('0x9c')],{'as':_0x2452('0x1b7'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0x9a')]['hasMany'](db[_0x2452('0x9c')],{'as':_0x2452('0x1b9'),'onDelete':'cascade','foreignKey':_0x2452('0x1ba')});db[_0x2452('0x9a')][_0x2452('0x10c')](db['SalesforceField'],{'as':'Fields','onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0x9a')]['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x2452('0x9c')][_0x2452('0x10c')](db[_0x2452('0x9c')],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0x9c')][_0x2452('0x10c')](db[_0x2452('0x9c')],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db['SalesforceField'][_0x2452('0x10c')](db['SalesforceField'],{'as':'Field','foreignKey':_0x2452('0x1bb')});db[_0x2452('0x9c')][_0x2452('0x119')](db[_0x2452('0x89')],{'as':_0x2452('0x89'),'foreignKey':_0x2452('0x1be')});db[_0x2452('0x9e')][_0x2452('0x10c')](db[_0x2452('0xa0')],{'as':_0x2452('0x1b5'),'onDelete':'cascade','foreignKey':_0x2452('0x1b6')});db[_0x2452('0xa0')][_0x2452('0x10c')](db[_0x2452('0x1bf')],{'as':_0x2452('0x1b7'),'onDelete':_0x2452('0x10a'),'foreignKey':'SubjectId'});db[_0x2452('0xa0')]['hasMany'](db[_0x2452('0x1bf')],{'as':_0x2452('0x1b9'),'onDelete':_0x2452('0x10a'),'foreignKey':'DescriptionId'});db[_0x2452('0xa0')][_0x2452('0x10c')](db[_0x2452('0x1bf')],{'as':_0x2452('0x1b2'),'onDelete':'cascade','foreignKey':_0x2452('0x1bb')});db[_0x2452('0xa0')]['belongsTo'](db[_0x2452('0x9e')],{'as':'Account','foreignKey':_0x2452('0x1b6')});db[_0x2452('0x1bf')][_0x2452('0x10c')](db[_0x2452('0x1bf')],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0x1bf')][_0x2452('0x10c')](db[_0x2452('0x1bf')],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db['SugarcrmField'][_0x2452('0x10c')](db[_0x2452('0x1bf')],{'as':_0x2452('0x1c0'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0x1bf')][_0x2452('0x119')](db['Variable'],{'as':'Variable','foreignKey':_0x2452('0x1be')});db[_0x2452('0xa2')]['hasMany'](db[_0x2452('0xa3')],{'as':_0x2452('0x1b5'),'onDelete':_0x2452('0x10a'),'foreignKey':'AccountId'});db[_0x2452('0xa3')][_0x2452('0x10c')](db[_0x2452('0xa4')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2452('0xa3')][_0x2452('0x10c')](db[_0x2452('0xa4')],{'as':_0x2452('0x1b9'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1ba')});db[_0x2452('0xa3')]['hasMany'](db[_0x2452('0xa4')],{'as':'Fields','onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0xa3')]['belongsTo'](db[_0x2452('0xa2')],{'as':'Account','foreignKey':_0x2452('0x1b6')});db[_0x2452('0xa3')][_0x2452('0x11d')](db['Tag'],{'through':_0x2452('0x1c1')});db[_0x2452('0xa4')][_0x2452('0x10c')](db['DeskField'],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0xa4')][_0x2452('0x10c')](db[_0x2452('0xa4')],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db['DeskField']['hasMany'](db[_0x2452('0xa4')],{'as':_0x2452('0x1c0'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0xa4')][_0x2452('0x119')](db['Variable'],{'as':_0x2452('0x89'),'foreignKey':_0x2452('0x1be')});db[_0x2452('0xa5')]['hasMany'](db[_0x2452('0xa7')],{'as':_0x2452('0x1b5'),'onDelete':_0x2452('0x10a'),'foreignKey':'AccountId'});db[_0x2452('0xa7')][_0x2452('0x10c')](db[_0x2452('0xa9')],{'as':_0x2452('0x1b7'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2452('0xa7')][_0x2452('0x10c')](db[_0x2452('0xa9')],{'as':_0x2452('0x1b9'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2452('0xa7')][_0x2452('0x10c')](db[_0x2452('0xa9')],{'as':_0x2452('0x1b2'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1bb')});db['ZohoConfiguration'][_0x2452('0x119')](db[_0x2452('0xa5')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db['ZohoField'][_0x2452('0x10c')](db[_0x2452('0xa9')],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0xa9')]['hasMany'](db[_0x2452('0xa9')],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db['ZohoField'][_0x2452('0x10c')](db[_0x2452('0xa9')],{'as':'Field','foreignKey':_0x2452('0x1bb')});db['ZohoField']['belongsTo'](db['Variable'],{'as':_0x2452('0x89'),'foreignKey':'VariableId'});db[_0x2452('0xab')]['hasMany'](db[_0x2452('0xad')],{'as':_0x2452('0x1b5'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xad')][_0x2452('0x10c')](db[_0x2452('0xae')],{'as':_0x2452('0x1b7'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0xad')]['hasMany'](db[_0x2452('0xae')],{'as':_0x2452('0x1b9'),'foreignKey':_0x2452('0x1ba')});db['ZendeskConfiguration'][_0x2452('0x10c')](db['ZendeskField'],{'as':_0x2452('0x1b2'),'foreignKey':_0x2452('0x1bb')});db['ZendeskConfiguration']['belongsTo'](db[_0x2452('0xab')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xad')]['belongsToMany'](db[_0x2452('0x84')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x2452('0x10c')](db[_0x2452('0xae')],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db['ZendeskField'][_0x2452('0x10c')](db[_0x2452('0xae')],{'as':'Description','foreignKey':_0x2452('0x1ba')});db[_0x2452('0xae')][_0x2452('0x10c')](db[_0x2452('0xae')],{'as':'Field','foreignKey':'FieldId'});db[_0x2452('0xae')][_0x2452('0x119')](db[_0x2452('0x89')],{'as':_0x2452('0x89'),'foreignKey':_0x2452('0x1be')});db[_0x2452('0x1c2')]['hasMany'](db[_0x2452('0xb0')],{'as':_0x2452('0x1b5'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1b6')});db['FreshdeskConfiguration'][_0x2452('0x10c')](db['FreshdeskField'],{'as':'Subjects','onDelete':_0x2452('0x10a'),'foreignKey':'SubjectId'});db[_0x2452('0xb0')]['hasMany'](db['FreshdeskField'],{'as':_0x2452('0x1b9'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1ba')});db[_0x2452('0xb0')][_0x2452('0x10c')](db[_0x2452('0x1c3')],{'as':_0x2452('0x1b2'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0xb0')][_0x2452('0x119')](db[_0x2452('0x1c2')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xb0')][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x2452('0x10c')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x2452('0x1b8')});db[_0x2452('0x1c3')][_0x2452('0x10c')](db['FreshdeskField'],{'as':_0x2452('0x1bd'),'foreignKey':'DescriptionId'});db[_0x2452('0x1c3')][_0x2452('0x10c')](db['FreshdeskField'],{'as':_0x2452('0x1c0'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0x1c3')]['belongsTo'](db[_0x2452('0x89')],{'as':_0x2452('0x89'),'foreignKey':'VariableId'});db[_0x2452('0xb2')][_0x2452('0x10c')](db[_0x2452('0x1c4')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2452('0x1b6')});db['VtigerConfiguration']['hasMany'](db[_0x2452('0xb4')],{'as':_0x2452('0x1b7'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0x1c4')][_0x2452('0x10c')](db['VtigerField'],{'as':_0x2452('0x1b9'),'foreignKey':_0x2452('0x1ba')});db['VtigerConfiguration'][_0x2452('0x10c')](db[_0x2452('0xb4')],{'as':_0x2452('0x1b2'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0x1c4')][_0x2452('0x119')](db[_0x2452('0xb2')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xb4')][_0x2452('0x10c')](db[_0x2452('0xb4')],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2452('0xb4')][_0x2452('0x10c')](db[_0x2452('0xb4')],{'as':_0x2452('0x1c0'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0xb4')]['belongsTo'](db[_0x2452('0x89')],{'as':'Variable','foreignKey':_0x2452('0x1be')});db[_0x2452('0x1c5')]['hasMany'](db[_0x2452('0xb7')],{'as':_0x2452('0x1b5'),'onDelete':'cascade','foreignKey':_0x2452('0x1b6')});db[_0x2452('0xb7')][_0x2452('0x10c')](db[_0x2452('0x1c6')],{'as':_0x2452('0x1b7'),'foreignKey':_0x2452('0x1b8')});db['ServicenowConfiguration'][_0x2452('0x10c')](db[_0x2452('0x1c6')],{'as':'Descriptions','foreignKey':_0x2452('0x1ba')});db[_0x2452('0xb7')][_0x2452('0x10c')](db[_0x2452('0x1c6')],{'as':'Fields','foreignKey':_0x2452('0x1bb')});db['ServicenowConfiguration'][_0x2452('0x119')](db[_0x2452('0x1c5')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0x1c6')][_0x2452('0x10c')](db['ServicenowField'],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db[_0x2452('0x1c6')][_0x2452('0x10c')](db[_0x2452('0x1c6')],{'as':_0x2452('0x1c0'),'foreignKey':'FieldId'});db['ServicenowField'][_0x2452('0x119')](db[_0x2452('0x89')],{'as':_0x2452('0x89'),'foreignKey':_0x2452('0x1be')});db[_0x2452('0xba')][_0x2452('0x10c')](db['Dynamics365Configuration'],{'as':_0x2452('0x1b5'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xbc')][_0x2452('0x10c')](db[_0x2452('0xbe')],{'as':_0x2452('0x1b7'),'onDelete':'cascade','foreignKey':_0x2452('0x1b8')});db[_0x2452('0xbc')][_0x2452('0x10c')](db[_0x2452('0xbe')],{'as':_0x2452('0x1b9'),'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1ba')});db[_0x2452('0xbc')][_0x2452('0x10c')](db[_0x2452('0xbe')],{'as':_0x2452('0x1b2'),'onDelete':_0x2452('0x10a'),'foreignKey':'FieldId'});db[_0x2452('0xbc')][_0x2452('0x119')](db['Dynamics365Account'],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xbe')]['hasMany'](db['Dynamics365Field'],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db['Dynamics365Field'][_0x2452('0x10c')](db[_0x2452('0xbe')],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db['Dynamics365Field'][_0x2452('0x10c')](db[_0x2452('0xbe')],{'as':_0x2452('0x1c0'),'foreignKey':'FieldId'});db[_0x2452('0xbe')][_0x2452('0x119')](db[_0x2452('0x89')],{'as':'Variable','foreignKey':_0x2452('0x1be')});db[_0x2452('0x1c7')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x2452('0x1b5'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db[_0x2452('0xc2')],{'as':_0x2452('0x1b7'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0xc0')][_0x2452('0x10c')](db[_0x2452('0xc2')],{'as':_0x2452('0x1b9'),'foreignKey':'DescriptionId'});db[_0x2452('0xc0')][_0x2452('0x10c')](db[_0x2452('0xc2')],{'as':_0x2452('0x1b2'),'foreignKey':_0x2452('0x1bb')});db[_0x2452('0xc0')][_0x2452('0x119')](db[_0x2452('0x1c7')],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1b6')});db[_0x2452('0xc2')][_0x2452('0x10c')](db[_0x2452('0xc2')],{'as':_0x2452('0x1bc'),'foreignKey':_0x2452('0x1b8')});db[_0x2452('0xc2')][_0x2452('0x10c')](db[_0x2452('0xc2')],{'as':_0x2452('0x1bd'),'foreignKey':_0x2452('0x1ba')});db[_0x2452('0xc2')][_0x2452('0x10c')](db[_0x2452('0xc2')],{'as':'Field','foreignKey':'FieldId'});db['FreshsalesField'][_0x2452('0x119')](db['Variable'],{'as':_0x2452('0x89'),'foreignKey':_0x2452('0x1be')});db[_0x2452('0xc4')][_0x2452('0x119')](db[_0x2452('0x130')],{});db[_0x2452('0xc4')]['belongsTo'](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171')});db['ChatQueueReport']['belongsTo'](db[_0x2452('0x6c')],{'as':'Contact','foreignKey':_0x2452('0x157')});db[_0x2452('0xc4')][_0x2452('0x119')](db[_0x2452('0x189')],{});db[_0x2452('0xc4')][_0x2452('0x119')](db[_0x2452('0x61')],{});db[_0x2452('0xc4')][_0x2452('0x119')](db[_0x2452('0x12')],{});db['ChatQueueReport']['belongsTo'](db[_0x2452('0x65')],{});db[_0x2452('0xc6')]['belongsTo'](db[_0x2452('0x12')],{'onDelete':_0x2452('0x10a'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x2452('0x119')](db[_0x2452('0x12')],{'onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x1c8')});db[_0x2452('0xcb')][_0x2452('0x10c')](db[_0x2452('0xc9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x2452('0xcb')]['hasMany'](db[_0x2452('0x1c9')],{'foreignKey':_0x2452('0x1ca'),'onDelete':_0x2452('0x10a')});db[_0x2452('0xcd')][_0x2452('0x119')](db[_0x2452('0x135')],{});db['SmsQueueReport'][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':_0x2452('0x171')});db['SmsQueueReport']['belongsTo'](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db[_0x2452('0xcd')][_0x2452('0x119')](db[_0x2452('0x112')],{});db['SmsQueueReport'][_0x2452('0x119')](db[_0x2452('0x53')],{});db[_0x2452('0xcd')][_0x2452('0x119')](db[_0x2452('0x12')],{});db[_0x2452('0xcd')][_0x2452('0x119')](db[_0x2452('0x54')],{});db['JscriptyProject']['hasMany'](db[_0x2452('0xcb')],{'foreignKey':_0x2452('0x1cb')});db[_0x2452('0xd3')]['hasMany'](db[_0x2452('0xc9')],{'foreignKey':_0x2452('0x1cb')});db['JscriptyProject'][_0x2452('0x10c')](db[_0x2452('0x1c9')],{'foreignKey':_0x2452('0x1cb')});db[_0x2452('0x138')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x178'),'through':_0x2452('0x13a')});db[_0x2452('0x121')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x122')});db['Team']['belongsToMany'](db['VoiceQueue'],{'through':_0x2452('0x103'),'as':_0x2452('0x127')});db[_0x2452('0x121')]['belongsToMany'](db[_0x2452('0x161')],{'through':'team_has_mail_queues','as':_0x2452('0x128')});db[_0x2452('0x121')][_0x2452('0x11d')](db[_0x2452('0x65')],{'through':_0x2452('0x191'),'as':'ChatQueues'});db[_0x2452('0x121')][_0x2452('0x11d')](db[_0x2452('0x12a')],{'through':'team_has_fax_queues','as':_0x2452('0x1cc')});db[_0x2452('0x121')][_0x2452('0x11d')](db['SmsQueue'],{'through':_0x2452('0x180'),'as':'SmsQueues'});db[_0x2452('0x121')][_0x2452('0x11d')](db[_0x2452('0x59')],{'through':'team_has_openchannel_queues','as':_0x2452('0x12d')});db[_0x2452('0x121')]['belongsToMany'](db['WhatsappQueue'],{'through':_0x2452('0x1cd'),'as':_0x2452('0x12e')});db['Team']['belongsToMany'](db[_0x2452('0xeb')],{'through':_0x2452('0x105'),'as':'VoicePrefixes'});db[_0x2452('0xdb')][_0x2452('0x10c')](db[_0x2452('0x6e')],{'as':'Hoppers','foreignKey':_0x2452('0x199')});db[_0x2452('0xdb')][_0x2452('0x10c')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x2452('0x199')});db[_0x2452('0xdb')][_0x2452('0x10c')](db['CmHopperHistory'],{'as':_0x2452('0x143'),'foreignKey':_0x2452('0x199')});db['Campaign'][_0x2452('0x10c')](db['CmHopperBlack'],{'as':_0x2452('0x144'),'foreignKey':_0x2452('0x199')});db[_0x2452('0xdb')][_0x2452('0x119')](db[_0x2452('0x146')],{'as':_0x2452('0x146'),'foreignKey':_0x2452('0x147')});db[_0x2452('0xdb')][_0x2452('0x119')](db[_0x2452('0x146')],{'as':_0x2452('0x148'),'foreignKey':_0x2452('0x149')});db[_0x2452('0xdb')][_0x2452('0x119')](db[_0x2452('0x14a')],{'as':_0x2452('0x14a'),'foreignKey':_0x2452('0x16d')});db[_0x2452('0xdb')][_0x2452('0x119')](db[_0x2452('0x138')],{'as':_0x2452('0x138'),'foreignKey':_0x2452('0x1ce')});db['Campaign'][_0x2452('0x11d')](db['CmList'],{'as':_0x2452('0x11f'),'through':_0x2452('0x1cf')});db[_0x2452('0xdb')]['belongsToMany'](db[_0x2452('0x12f')],{'as':_0x2452('0x14f'),'through':_0x2452('0x1d0')});db['Attachment'][_0x2452('0x119')](db[_0x2452('0x63')],{'as':'ChatOfflineMessage','foreignKey':_0x2452('0x16b')});db[_0x2452('0xe3')][_0x2452('0x119')](db[_0x2452('0x40')],{});db[_0x2452('0xe3')][_0x2452('0x119')](db['MailInteraction'],{});db[_0x2452('0xe3')]['belongsTo'](db[_0x2452('0x3a')],{'foreignKey':_0x2452('0x1d1'),'as':_0x2452('0x1d2')});db[_0x2452('0xe3')][_0x2452('0x119')](db['User'],{'foreignKey':_0x2452('0x1d3'),'as':'FromAgent'});db['MailTransferReport'][_0x2452('0x119')](db['User'],{'foreignKey':_0x2452('0x1d4'),'as':_0x2452('0x1d5')});db[_0x2452('0xe3')][_0x2452('0x119')](db['MailQueue'],{'foreignKey':_0x2452('0x1d6'),'as':_0x2452('0x1d7')});db[_0x2452('0xe3')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x2452('0x1d8')});db[_0x2452('0x1d9')]['belongsTo'](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db[_0x2452('0x189')],{});db['ChatTransferReport'][_0x2452('0x119')](db[_0x2452('0x130')],{'foreignKey':_0x2452('0x1da'),'as':_0x2452('0x1d2')});db[_0x2452('0x1d9')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':_0x2452('0x1d3'),'as':_0x2452('0x1db')});db[_0x2452('0x1d9')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':_0x2452('0x1d4'),'as':_0x2452('0x1d5')});db[_0x2452('0x1d9')][_0x2452('0x119')](db[_0x2452('0x65')],{'foreignKey':'ToChatQueueId','as':_0x2452('0x1d7')});db[_0x2452('0x1d9')][_0x2452('0x119')](db[_0x2452('0x130')],{'foreignKey':'ToChatWebsiteId','as':_0x2452('0x1d8')});db[_0x2452('0xe6')][_0x2452('0x119')](db[_0x2452('0x4d')],{});db['FaxTransferReport']['belongsTo'](db[_0x2452('0x4c')],{});db[_0x2452('0xe6')][_0x2452('0x119')](db[_0x2452('0x48')],{'foreignKey':_0x2452('0x1dc'),'as':_0x2452('0x1d2')});db[_0x2452('0xe6')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2452('0xe6')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':'ToUserId','as':_0x2452('0x1d5')});db['FaxTransferReport']['belongsTo'](db[_0x2452('0x12a')],{'foreignKey':'ToFaxQueueId','as':_0x2452('0x1d7')});db[_0x2452('0xe6')][_0x2452('0x119')](db['FaxAccount'],{'foreignKey':_0x2452('0x1dd'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x2452('0x119')](db[_0x2452('0x186')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x2452('0x110')],{});db[_0x2452('0xe8')][_0x2452('0x119')](db[_0x2452('0x55')],{'foreignKey':_0x2452('0x1de'),'as':'FromAccount'});db[_0x2452('0xe8')][_0x2452('0x119')](db['User'],{'foreignKey':'FromUserId','as':_0x2452('0x1db')});db[_0x2452('0xe8')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':'ToUserId','as':_0x2452('0x1d5')});db[_0x2452('0xe8')][_0x2452('0x119')](db['OpenchannelQueue'],{'foreignKey':_0x2452('0x1df'),'as':_0x2452('0x1d7')});db[_0x2452('0xe8')][_0x2452('0x119')](db[_0x2452('0x55')],{'foreignKey':_0x2452('0x1e0'),'as':'ToAccount'});db[_0x2452('0x1e1')]['belongsTo'](db[_0x2452('0x53')],{});db['SmsTransferReport'][_0x2452('0x119')](db['SmsInteraction'],{});db[_0x2452('0x1e1')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x2452('0x1e2'),'as':_0x2452('0x1d2')});db[_0x2452('0x1e1')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2452('0x1e1')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':'ToUserId','as':_0x2452('0x1d5')});db[_0x2452('0x1e1')][_0x2452('0x119')](db[_0x2452('0x54')],{'foreignKey':_0x2452('0x1e3'),'as':_0x2452('0x1d7')});db[_0x2452('0x1e1')][_0x2452('0x119')](db[_0x2452('0x135')],{'foreignKey':'ToSmsAccountId','as':_0x2452('0x1d8')});db[_0x2452('0x12f')]['hasMany'](db[_0x2452('0x15c')],{'as':'Dispositions','foreignKey':_0x2452('0x171'),'onDelete':_0x2452('0x10a')});db[_0x2452('0x12f')]['hasMany'](db[_0x2452('0x76')],{'as':_0x2452('0x1e4'),'foreignKey':_0x2452('0x171')});db[_0x2452('0x12f')]['hasMany'](db[_0x2452('0x6c')],{'as':'Contacts','onDelete':_0x2452('0x10a'),'foreignKey':_0x2452('0x171')});db[_0x2452('0x12f')][_0x2452('0x10c')](db['CmHopperFinal'],{'as':_0x2452('0x142'),'foreignKey':_0x2452('0x171')});db[_0x2452('0x12f')]['hasMany'](db[_0x2452('0x72')],{'as':_0x2452('0x10f'),'foreignKey':_0x2452('0x171')});db[_0x2452('0x12f')][_0x2452('0x10c')](db[_0x2452('0x74')],{'as':'ReportAgentPreview','foreignKey':_0x2452('0x171')});db[_0x2452('0x12f')]['belongsToMany'](db[_0x2452('0x1d')],{'as':'Queues','through':_0x2452('0x1e5')});db[_0x2452('0x12f')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':'cm_user_has_lists'});db[_0x2452('0xeb')]['hasMany'](db['VoiceExtension'],{'as':'Extensions','onDelete':'cascade'});db[_0x2452('0xeb')]['belongsToMany'](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x107')});db['VoicePrefix'][_0x2452('0x11d')](db[_0x2452('0x121')],{'through':_0x2452('0x105'),'as':_0x2452('0x14e')});db[_0x2452('0x11a')][_0x2452('0x10c')](db[_0x2452('0x12')],{'as':_0x2452('0x178'),'foreignKey':_0x2452('0x1e6')});db[_0x2452('0x11a')][_0x2452('0x10c')](db[_0x2452('0xee')],{'as':_0x2452('0x1e7'),'foreignKey':_0x2452('0x1e6'),'onDelete':_0x2452('0x10a')});db['UserProfileSection']['hasMany'](db[_0x2452('0xf0')],{'as':'Resources','foreignKey':_0x2452('0x1e8'),'onDelete':_0x2452('0x10a')});db[_0x2452('0xf3')]['hasMany'](db[_0x2452('0x15c')],{'as':_0x2452('0x15d'),'foreignKey':_0x2452('0x1e9'),'onDelete':_0x2452('0x10a')});db['WhatsappAccount'][_0x2452('0x10c')](db[_0x2452('0x7a')],{'as':_0x2452('0x182'),'foreignKey':_0x2452('0x1e9')});db['WhatsappAccount'][_0x2452('0x10c')](db[_0x2452('0xf9')],{'as':_0x2452('0x150'),'foreignKey':_0x2452('0x1e9')});db['WhatsappAccount'][_0x2452('0x10c')](db[_0x2452('0xf7')],{'as':_0x2452('0x15e')});db['WhatsappAccount']['hasMany'](db[_0x2452('0xf5')],{'as':'Applications'});db[_0x2452('0xf3')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':'ListId'});db[_0x2452('0xf3')]['belongsTo'](db['Pause'],{'as':_0x2452('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2452('0xf3')][_0x2452('0x11d')](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x137')});db[_0x2452('0xf5')][_0x2452('0x119')](db[_0x2452('0x12')],{'onDelete':_0x2452('0x16c')});db[_0x2452('0xf5')][_0x2452('0x119')](db['WhatsappQueue'],{'onDelete':_0x2452('0x16c')});db['WhatsappApplication']['belongsTo'](db[_0x2452('0xf3')],{'onDelete':_0x2452('0x16c')});db[_0x2452('0xf5')]['belongsTo'](db[_0x2452('0x14a')],{'onDelete':'restrict','foreignKey':_0x2452('0x16d')});db[_0x2452('0xf5')]['belongsTo'](db[_0x2452('0x84')],{'onDelete':'restrict','foreignKey':_0x2452('0x16e')});db[_0x2452('0xf7')][_0x2452('0x10c')](db[_0x2452('0xf9')],{'as':'Messages','onDelete':_0x2452('0x10a'),'foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x2452('0x119')](db['WhatsappAccount'],{'as':_0x2452('0x163'),'foreignKey':_0x2452('0x1e9')});db['WhatsappInteraction']['belongsTo'](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':'ContactId'});db[_0x2452('0xf7')][_0x2452('0x119')](db[_0x2452('0x12')],{'as':_0x2452('0x164'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':'whatsapp_interaction_has_tags','as':_0x2452('0x166')});db['WhatsappInteraction'][_0x2452('0x11d')](db[_0x2452('0x84')],{'through':_0x2452('0x1aa'),'as':_0x2452('0x177')});db['WhatsappInteraction'][_0x2452('0x11d')](db['User'],{'as':_0x2452('0x178'),'through':_0x2452('0x126'),'foreignKey':_0x2452('0x1ea')});db['WhatsappMessage']['belongsTo'](db[_0x2452('0x12')],{'as':_0x2452('0x12')});db[_0x2452('0xf9')][_0x2452('0x119')](db['CmContact'],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x156')});db[_0x2452('0xf9')]['belongsTo'](db[_0x2452('0xf7')],{'onDelete':_0x2452('0x10a'),'as':_0x2452('0x17f'),'foreignKey':_0x2452('0x1ea')});db['WhatsappMessage'][_0x2452('0x119')](db[_0x2452('0xf3')],{'as':_0x2452('0x163'),'foreignKey':'WhatsappAccountId'});db[_0x2452('0xfb')][_0x2452('0x119')](db['WhatsappAccount'],{});db[_0x2452('0xfb')][_0x2452('0x119')](db[_0x2452('0x12f')],{'as':_0x2452('0x170'),'foreignKey':'ListId'});db[_0x2452('0xfb')][_0x2452('0x119')](db[_0x2452('0x6c')],{'as':_0x2452('0x156'),'foreignKey':_0x2452('0x157')});db[_0x2452('0xfb')][_0x2452('0x119')](db['WhatsappInteraction'],{});db[_0x2452('0xfb')][_0x2452('0x119')](db[_0x2452('0xff')],{});db['WhatsappQueueReport'][_0x2452('0x119')](db['WhatsappMessage'],{});db[_0x2452('0xfb')]['belongsTo'](db['User'],{});db['WhatsappTransferReport'][_0x2452('0x119')](db[_0x2452('0xf9')],{});db[_0x2452('0xfd')][_0x2452('0x119')](db[_0x2452('0xf7')],{});db[_0x2452('0xfd')][_0x2452('0x119')](db[_0x2452('0xf3')],{'foreignKey':'FromWhatsappAccountId','as':_0x2452('0x1d2')});db[_0x2452('0xfd')][_0x2452('0x119')](db['WhatsappAccount'],{'foreignKey':_0x2452('0x1eb'),'as':'ToAccount'});db[_0x2452('0xfd')][_0x2452('0x119')](db[_0x2452('0xff')],{'foreignKey':_0x2452('0x1ec'),'as':'ToQueue'});db[_0x2452('0xfd')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x2452('0x1db')});db[_0x2452('0xfd')][_0x2452('0x119')](db[_0x2452('0x12')],{'foreignKey':'ToUserId','as':_0x2452('0x1d5')});db[_0x2452('0xff')]['belongsToMany'](db[_0x2452('0x12')],{'as':_0x2452('0x160'),'through':_0x2452('0x1ed'),'foreignKey':_0x2452('0x1ee')});db[_0x2452('0xff')][_0x2452('0x11d')](db[_0x2452('0x121')],{'through':_0x2452('0x1cd'),'as':'Teams'});module[_0x2452('0x1ef')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index b0e4b03..f342a60 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dfd=['/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','accessToken','accessTokenSecret','authToken','calleridname','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','accountSid','localstationid','registry','isPlainObject','isArray','replace','@@{','includes','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','remoteAddress','url','test','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/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/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/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/action','/api/canned_answers','/api/dispositions','./api/disposition'];(function(_0x5b0755,_0x8fd569){var _0x9e6765=function(_0x8a3763){while(--_0x8a3763){_0x5b0755['push'](_0x5b0755['shift']());}};_0x9e6765(++_0x8fd569);}(_0x7dfd,0xcc));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd7df('0x0'));var path=require(_0xd7df('0x1'));var express=require(_0xd7df('0x2'));var ewinston=require(_0xd7df('0x3'));var util=require(_0xd7df('0x4'));var errors=require(_0xd7df('0x5'));var config=require(_0xd7df('0x6'));var logger=require(_0xd7df('0x7'))(_0xd7df('0x8'));var authLogger=require(_0xd7df('0x7'))('auth');exports[_0xd7df('0x9')]=function(_0x5cf189){_0x5cf189['use'](ewinston[_0xd7df('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x44d3ca,_0x183aea){var _0x2b576e=_0xd7df('0xb');if(!_['isEmpty'](_0x44d3ca[_0xd7df('0xc')])){_0x2b576e+=_0xd7df('0xd');var _0x16b773=_0x44d3ca[_0xd7df('0xc')];maskSensitiveData(_0x16b773);}return util[_0xd7df('0xe')](_0x2b576e,_0x44d3ca[_0xd7df('0xf')],_0x44d3ca[_0xd7df('0x10')][_0xd7df('0x11')]?_0x44d3ca['headers'][_0xd7df('0x11')]:_0x44d3ca[_0xd7df('0x12')]['remoteAddress']||_0x44d3ca['ip'],_0x44d3ca['url'],_0x183aea[_0xd7df('0x13')],_0x183aea[_0xd7df('0x14')],_0x44d3ca[_0xd7df('0x15')]?_0x44d3ca[_0xd7df('0x15')]['id']:null,_0x44d3ca['user']?_0x44d3ca[_0xd7df('0x15')][_0xd7df('0x16')]:null,_0x44d3ca[_0xd7df('0x15')]?_0x44d3ca[_0xd7df('0x15')][_0xd7df('0x17')]:null,_0x16b773?util[_0xd7df('0x18')](_0x16b773,![],null):'');}}));_0x5cf189['use'](ewinston[_0xd7df('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xa2d742,_0x4d8e94){var _0x5daaff=_0xd7df('0x19');if(_0xa2d742['body']&&_0xa2d742['body'][_0xd7df('0x1a')]&&_0xa2d742['body'][_0xd7df('0x1b')]){_0x5daaff='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xd7df('0xe')](_0x5daaff,_0xa2d742[_0xd7df('0xf')],_0xa2d742[_0xd7df('0x10')][_0xd7df('0x11')]?_0xa2d742[_0xd7df('0x10')]['x-forwarded-for']:_0xa2d742['connection'][_0xd7df('0x1c')]||_0xa2d742['ip'],_0xa2d742[_0xd7df('0x1d')],_0x4d8e94[_0xd7df('0x13')],_0x4d8e94['responseTime'],_0xa2d742[_0xd7df('0x15')]?_0xa2d742[_0xd7df('0x15')]['id']:null,_0xa2d742[_0xd7df('0x15')]?_0xa2d742['user'][_0xd7df('0x16')]:null,_0xa2d742[_0xd7df('0x15')]?_0xa2d742['user'][_0xd7df('0x17')]:null,_0xa2d742[_0xd7df('0xc')]&&_0xa2d742[_0xd7df('0xc')][_0xd7df('0x1a')]?_0xa2d742[_0xd7df('0xc')]['device']:'other',_0xa2d742['body']&&_0xa2d742[_0xd7df('0xc')][_0xd7df('0x1b')]?_0xa2d742[_0xd7df('0xc')][_0xd7df('0x1b')]:'',_0xa2d742['body']&&_0xa2d742[_0xd7df('0xc')]['agent_name']?_0xa2d742[_0xd7df('0xc')]['agent_name']:'');},'ignoreRoute':function(_0x65b111){var _0x38741a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x38741a[_0xd7df('0x1e')](_0x65b111[_0xd7df('0x1d')]);}}));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x20'),require(_0xd7df('0x21')));_0x5cf189['use'](_0xd7df('0x22'),require(_0xd7df('0x23')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x24'),require('./api/voiceContext'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x25'),require('./api/voiceExtension'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x26'),require(_0xd7df('0x27')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x28'),require(_0xd7df('0x29')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x2a'),require(_0xd7df('0x2b')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x2c'),require(_0xd7df('0x2d')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x2e'),require('./api/voiceMail'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x2f'),require(_0xd7df('0x30')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x31'),require(_0xd7df('0x32')));_0x5cf189[_0xd7df('0x1f')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x5cf189[_0xd7df('0x1f')]('/api/voice/agents/reports',require(_0xd7df('0x33')));_0x5cf189['use'](_0xd7df('0x34'),require(_0xd7df('0x35')));_0x5cf189['use'](_0xd7df('0x36'),require(_0xd7df('0x37')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x38'),require('./api/trunk'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x39'),require('./api/voiceTransferReport'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x3a'),require(_0xd7df('0x3b')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x3c'),require(_0xd7df('0x3d')));_0x5cf189[_0xd7df('0x1f')]('/api/mail/queues',require(_0xd7df('0x3e')));_0x5cf189['use']('/api/mail/substatuses',require(_0xd7df('0x3f')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x40'),require(_0xd7df('0x41')));_0x5cf189[_0xd7df('0x1f')]('/api/mail/messages',require(_0xd7df('0x42')));_0x5cf189['use'](_0xd7df('0x43'),require('./api/mailApplication'));_0x5cf189[_0xd7df('0x1f')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x5cf189['use'](_0xd7df('0x44'),require('./api/dashboard'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x45'),require(_0xd7df('0x46')));_0x5cf189[_0xd7df('0x1f')]('/api/fax/accounts',require('./api/faxAccount'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x47'),require(_0xd7df('0x48')));_0x5cf189['use'](_0xd7df('0x49'),require(_0xd7df('0x4a')));_0x5cf189['use'](_0xd7df('0x4b'),require(_0xd7df('0x4c')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x4d'),require(_0xd7df('0x4e')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x4f'),require(_0xd7df('0x50')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x51'),require(_0xd7df('0x52')));_0x5cf189['use'](_0xd7df('0x53'),require(_0xd7df('0x54')));_0x5cf189['use'](_0xd7df('0x55'),require(_0xd7df('0x56')));_0x5cf189['use']('/api/sms/messages',require('./api/smsMessage'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x57'),require('./api/smsQueue'));_0x5cf189[_0xd7df('0x1f')]('/api/openchannel/accounts',require(_0xd7df('0x58')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x59'),require(_0xd7df('0x5a')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x5b'),require(_0xd7df('0x5c')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x5d'),require(_0xd7df('0x5e')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x5f'),require(_0xd7df('0x60')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x61'),require(_0xd7df('0x62')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x63'),require(_0xd7df('0x64')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x65'),require(_0xd7df('0x66')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x67'),require(_0xd7df('0x68')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x69'),require(_0xd7df('0x6a')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x6b'),require('./api/chatOfflineMessage'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x6c'),require(_0xd7df('0x6d')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x6e'),require(_0xd7df('0x6f')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x70'),require(_0xd7df('0x71')));_0x5cf189[_0xd7df('0x1f')]('/api/cm/companies',require(_0xd7df('0x72')));_0x5cf189['use'](_0xd7df('0x73'),require(_0xd7df('0x74')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x75'),require(_0xd7df('0x76')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x77'),require(_0xd7df('0x78')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x79'),require('./api/cmHopperFinal'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x7a'),require(_0xd7df('0x7b')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x7c'),require(_0xd7df('0x7d')));_0x5cf189[_0xd7df('0x1f')]('/api/actions',require(_0xd7df('0x7e')));_0x5cf189[_0xd7df('0x1f')]('/api/automations',require('./api/automation'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x7f'),require('./api/cannedAnswer'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x80'),require(_0xd7df('0x81')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x82'),require(_0xd7df('0x83')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x84'),require('./api/interval'));_0x5cf189['use'](_0xd7df('0x85'),require(_0xd7df('0x86')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x87'),require(_0xd7df('0x88')));_0x5cf189['use'](_0xd7df('0x89'),require('./api/voiceQueuesLog'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x8a'),require('./api/schedule'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x8b'),require(_0xd7df('0x8c')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x8d'),require(_0xd7df('0x8e')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x8f'),require(_0xd7df('0x90')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x91'),require(_0xd7df('0x92')));_0x5cf189[_0xd7df('0x1f')]('/api/variables',require(_0xd7df('0x93')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x94'),require(_0xd7df('0x95')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x96'),require(_0xd7df('0x97')));_0x5cf189['use'](_0xd7df('0x98'),require(_0xd7df('0x99')));_0x5cf189[_0xd7df('0x1f')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x9a'),require(_0xd7df('0x9b')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x9c'),require(_0xd7df('0x9d')));_0x5cf189['use'](_0xd7df('0x9e'),require(_0xd7df('0x9f')));_0x5cf189['use'](_0xd7df('0xa0'),require(_0xd7df('0xa1')));_0x5cf189['use'](_0xd7df('0xa2'),require('./api/intSalesforceAccount'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xa3'),require('./api/intSalesforceConfiguration'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xa4'),require(_0xd7df('0xa5')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xa6'),require(_0xd7df('0xa7')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xa8'),require('./api/intSugarcrmConfiguration'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xa9'),require(_0xd7df('0xaa')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xab'),require(_0xd7df('0xac')));_0x5cf189['use'](_0xd7df('0xad'),require(_0xd7df('0xae')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xaf'),require(_0xd7df('0xb0')));_0x5cf189[_0xd7df('0x1f')]('/api/integrations/zoho/accounts',require(_0xd7df('0xb1')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xb2'),require('./api/intZohoConfiguration'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xb3'),require(_0xd7df('0xb4')));_0x5cf189['use'](_0xd7df('0xb5'),require(_0xd7df('0xb6')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xb7'),require('./api/intZendeskConfiguration'));_0x5cf189['use']('/api/integrations/zendesk/fields',require(_0xd7df('0xb8')));_0x5cf189['use'](_0xd7df('0xb9'),require(_0xd7df('0xba')));_0x5cf189[_0xd7df('0x1f')]('/api/integrations/freshdesk/configurations',require(_0xd7df('0xbb')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xbc'),require(_0xd7df('0xbd')));_0x5cf189[_0xd7df('0x1f')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xbe'),require(_0xd7df('0xbf')));_0x5cf189['use'](_0xd7df('0xc0'),require(_0xd7df('0xc1')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xc2'),require(_0xd7df('0xc3')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xc4'),require(_0xd7df('0xc5')));_0x5cf189['use'](_0xd7df('0xc6'),require(_0xd7df('0xc7')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xc8'),require(_0xd7df('0xc9')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xca'),require(_0xd7df('0xcb')));_0x5cf189[_0xd7df('0x1f')]('/api/integrations/dynamics365/fields',require(_0xd7df('0xcc')));_0x5cf189['use'](_0xd7df('0xcd'),require(_0xd7df('0xce')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xcf'),require('./api/intFreshsalesConfiguration'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xd0'),require(_0xd7df('0xd1')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xd2'),require(_0xd7df('0xd3')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xd4'),require(_0xd7df('0xd5')));_0x5cf189['use']('/api/chat/internal/messages',require(_0xd7df('0xd6')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xd7'),require(_0xd7df('0xd8')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xd9'),require('./api/jscriptyQuestionReport'));_0x5cf189['use'](_0xd7df('0xda'),require(_0xd7df('0xdb')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xdc'),require(_0xd7df('0xdd')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xde'),require('./api/squareReport'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xdf'),require(_0xd7df('0xe0')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xe1'),require('./api/jscriptyProject'));_0x5cf189[_0xd7df('0x1f')]('/api/settings',require(_0xd7df('0xe2')));_0x5cf189['use'](_0xd7df('0xe3'),require(_0xd7df('0xe4')));_0x5cf189[_0xd7df('0x1f')]('/api/square/projects',require(_0xd7df('0xe5')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xe6'),require(_0xd7df('0xe7')));_0x5cf189[_0xd7df('0x1f')]('/api/square/messages',require(_0xd7df('0xe8')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xe9'),require('./api/team'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xea'),require(_0xd7df('0xeb')));_0x5cf189[_0xd7df('0x1f')]('/api/campaigns',require(_0xd7df('0xec')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xed'),require(_0xd7df('0xee')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xef'),require(_0xd7df('0xf0')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xf1'),require('./api/plugin'));_0x5cf189[_0xd7df('0x1f')]('/api/mail/reports/transfer',require(_0xd7df('0xf2')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xf3'),require(_0xd7df('0xf4')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xf5'),require(_0xd7df('0xf6')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xf7'),require('./api/openchannelTransferReport'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xf8'),require('./api/smsTransferReport'));_0x5cf189[_0xd7df('0x1f')]('/api/cm/lists',require('./api/cmList'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xf9'),require(_0xd7df('0xfa')));_0x5cf189[_0xd7df('0x1f')]('/api/userProfiles',require(_0xd7df('0xfb')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0xfc'),require(_0xd7df('0xfd')));_0x5cf189['use'](_0xd7df('0xfe'),require(_0xd7df('0xff')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x100'),require(_0xd7df('0x101')));_0x5cf189['use'](_0xd7df('0x102'),require('./api/whatsappAccount'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x103'),require(_0xd7df('0x104')));_0x5cf189[_0xd7df('0x1f')]('/api/whatsapp/interactions',require(_0xd7df('0x105')));_0x5cf189['use'](_0xd7df('0x106'),require(_0xd7df('0x107')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x108'),require('./api/whatsappQueueReport'));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x109'),require('./api/whatsappTransferReport'));_0x5cf189['use'](_0xd7df('0x10a'),require(_0xd7df('0x10b')));_0x5cf189[_0xd7df('0x1f')]('/api/cloudProviders',require(_0xd7df('0x10c')));_0x5cf189[_0xd7df('0x1f')]('/api/realtime',require(_0xd7df('0x10d')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x10e'),require(_0xd7df('0x10f')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x110'),require(_0xd7df('0x111')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x112'),require(_0xd7df('0x113')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x114'),require(_0xd7df('0x115')));_0x5cf189[_0xd7df('0x1f')]('/api/version',require(_0xd7df('0x116')));_0x5cf189['use'](_0xd7df('0x117'),require(_0xd7df('0x118')));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x119'),require(_0xd7df('0x11a')));_0x5cf189['use']('/api/webbar',require(_0xd7df('0x11b')));_0x5cf189['use']('/apidoc',express[_0xd7df('0x11c')](path[_0xd7df('0x11d')](config[_0xd7df('0x11e')],_0xd7df('0x11f'))));_0x5cf189['use']('/www',express[_0xd7df('0x11c')](path[_0xd7df('0x11d')](config['root'],_0xd7df('0x120'))));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x121'),express[_0xd7df('0x11c')](path[_0xd7df('0x11d')](config[_0xd7df('0x11e')],'/demo')));_0x5cf189['use'](_0xd7df('0x122'),express[_0xd7df('0x11c')](path['join'](config['root'],_0xd7df('0x123'),_0xd7df('0x124'))));_0x5cf189[_0xd7df('0x1f')](_0xd7df('0x125'),express[_0xd7df('0x11c')](path[_0xd7df('0x11d')](config[_0xd7df('0x11e')],_0xd7df('0x126'))));_0x5cf189[_0xd7df('0x127')](_0xd7df('0x128'))['get'](errors[0x194]);_0x5cf189['route']('/*')['get'](function(_0xd5cc7d,_0x513510){_0x513510[_0xd7df('0x129')](path[_0xd7df('0x12a')](_0x5cf189['get'](_0xd7df('0x12b'))+_0xd7df('0x12c')));});};var sensitiveFields=[_0xd7df('0x12d'),_0xd7df('0x12e'),_0xd7df('0x12f'),_0xd7df('0x130'),'firstName','lastName',_0xd7df('0x131'),_0xd7df('0x132'),_0xd7df('0x133'),'fax',_0xd7df('0x134'),_0xd7df('0x135'),_0xd7df('0x136'),_0xd7df('0x137'),_0xd7df('0x138'),_0xd7df('0x139'),_0xd7df('0x13a'),'token','channelSecret',_0xd7df('0x13b'),_0xd7df('0x13c'),_0xd7df('0x13d'),'consumerKey','consumerSecret','membername',_0xd7df('0x13e'),_0xd7df('0x13f'),_0xd7df('0x140'),_0xd7df('0x141'),'clientEmail',_0xd7df('0x142'),_0xd7df('0x143'),_0xd7df('0x144'),_0xd7df('0x145'),_0xd7df('0x15'),'pass',_0xd7df('0x146'),_0xd7df('0x147'),'dsn','secret',_0xd7df('0x148'),'oldPassword'];function maskSensitiveData(_0x1dbb03){var _0x5596b6=/(?!^)[\s\S](?!$)/g;if(!_[_0xd7df('0x149')](_0x1dbb03))return;for(var _0x24bbda in _0x1dbb03){if(_[_0xd7df('0x14a')](_0x1dbb03[_0x24bbda])){for(var _0x240bff=0x0;_0x240bff<_0x1dbb03[_0x24bbda]['length'];_0x240bff++){maskSensitiveData(_0x1dbb03[_0x24bbda][_0x240bff]);}}else if(_[_0xd7df('0x149')](_0x1dbb03[_0x24bbda])){maskSensitiveData(_0x1dbb03[_0x24bbda]);}else if(_['isString'](_0x1dbb03[_0x24bbda])){_0x1dbb03[_0x24bbda]=_0x1dbb03[_0x24bbda][_0xd7df('0x14b')](/{{{/g,_0xd7df('0x14c'))[_0xd7df('0x14b')](/}}}/g,'}@@')[_0xd7df('0x14b')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0xd7df('0x14d')](sensitiveFields,_0x24bbda)){_0x1dbb03[_0x24bbda]=_0x1dbb03[_0x24bbda][_0xd7df('0x14b')](_0x5596b6,'*');}}}} \ No newline at end of file +var _0x0922=['./api/squareProject','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','join','/www','root','/demo','static','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','fax','email','clientId','clientSecret','code','accessKey','token','channelSecret','accessTokenSecret','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','pass','localstationid','dsn','registry','oldPassword','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','lodash','path','express','util','./errors','./config/environment','api','auth','default','use','logger','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','role','inspect','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','name','device','agent_name','test','url','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/template','/api/triggers','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc'];(function(_0x59cce0,_0x5179f3){var _0x38c802=function(_0x160b72){while(--_0x160b72){_0x59cce0['push'](_0x59cce0['shift']());}};_0x38c802(++_0x5179f3);}(_0x0922,0x67));var _0x2092=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x0922[_0xaa6a4];return _0xdc31a4;};'use strict';var _=require(_0x2092('0x0'));var path=require(_0x2092('0x1'));var express=require(_0x2092('0x2'));var ewinston=require('express-winston');var util=require(_0x2092('0x3'));var errors=require(_0x2092('0x4'));var config=require(_0x2092('0x5'));var logger=require('./config/logger')(_0x2092('0x6'));var authLogger=require('./config/logger')(_0x2092('0x7'));exports[_0x2092('0x8')]=function(_0x3d2bf1){_0x3d2bf1[_0x2092('0x9')](ewinston[_0x2092('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x37f81e,_0x3fa410){var _0x4e2b99='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x37f81e[_0x2092('0xb')])){_0x4e2b99+=_0x2092('0xc');var _0x2a82a7=_0x37f81e[_0x2092('0xb')];maskSensitiveData(_0x2a82a7);}return util['format'](_0x4e2b99,_0x37f81e[_0x2092('0xd')],_0x37f81e[_0x2092('0xe')][_0x2092('0xf')]?_0x37f81e[_0x2092('0xe')][_0x2092('0xf')]:_0x37f81e[_0x2092('0x10')][_0x2092('0x11')]||_0x37f81e['ip'],_0x37f81e['url'],_0x3fa410[_0x2092('0x12')],_0x3fa410[_0x2092('0x13')],_0x37f81e[_0x2092('0x14')]?_0x37f81e[_0x2092('0x14')]['id']:null,_0x37f81e[_0x2092('0x14')]?_0x37f81e[_0x2092('0x14')]['name']:null,_0x37f81e['user']?_0x37f81e[_0x2092('0x14')][_0x2092('0x15')]:null,_0x2a82a7?util[_0x2092('0x16')](_0x2a82a7,![],null):'');}}));_0x3d2bf1['use'](ewinston[_0x2092('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x54a18f,_0x439c5f){var _0x26596a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x54a18f[_0x2092('0xb')]&&_0x54a18f[_0x2092('0xb')]['device']&&_0x54a18f[_0x2092('0xb')][_0x2092('0x17')]){_0x26596a=_0x2092('0x18');}return util[_0x2092('0x19')](_0x26596a,_0x54a18f[_0x2092('0xd')],_0x54a18f['headers'][_0x2092('0xf')]?_0x54a18f[_0x2092('0xe')][_0x2092('0xf')]:_0x54a18f[_0x2092('0x10')][_0x2092('0x11')]||_0x54a18f['ip'],_0x54a18f['url'],_0x439c5f[_0x2092('0x12')],_0x439c5f['responseTime'],_0x54a18f[_0x2092('0x14')]?_0x54a18f['user']['id']:null,_0x54a18f[_0x2092('0x14')]?_0x54a18f[_0x2092('0x14')][_0x2092('0x1a')]:null,_0x54a18f[_0x2092('0x14')]?_0x54a18f['user'][_0x2092('0x15')]:null,_0x54a18f['body']&&_0x54a18f[_0x2092('0xb')][_0x2092('0x1b')]?_0x54a18f[_0x2092('0xb')][_0x2092('0x1b')]:'other',_0x54a18f[_0x2092('0xb')]&&_0x54a18f[_0x2092('0xb')][_0x2092('0x17')]?_0x54a18f[_0x2092('0xb')]['agent_id']:'',_0x54a18f[_0x2092('0xb')]&&_0x54a18f[_0x2092('0xb')]['agent_name']?_0x54a18f[_0x2092('0xb')][_0x2092('0x1c')]:'');},'ignoreRoute':function(_0xd6814a){var _0xa190b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xa190b[_0x2092('0x1d')](_0xd6814a[_0x2092('0x1e')]);}}));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x1f'),require(_0x2092('0x20')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x21'),require(_0x2092('0x22')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x23'),require(_0x2092('0x24')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x25'),require(_0x2092('0x26')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x27'),require(_0x2092('0x28')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x29'),require(_0x2092('0x2a')));_0x3d2bf1[_0x2092('0x9')]('/api/voice/recordings',require(_0x2092('0x2b')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x2c'),require(_0x2092('0x2d')));_0x3d2bf1['use']('/api/voice/mails',require('./api/voiceMail'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x2e'),require(_0x2092('0x2f')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x30'),require(_0x2092('0x31')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x32'),require(_0x2092('0x33')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x34'),require(_0x2092('0x35')));_0x3d2bf1[_0x2092('0x9')]('/api/voice/queues/reports',require(_0x2092('0x36')));_0x3d2bf1[_0x2092('0x9')]('/api/members/reports',require(_0x2092('0x37')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x38'),require(_0x2092('0x39')));_0x3d2bf1[_0x2092('0x9')]('/api/voice/transfers/reports',require(_0x2092('0x3a')));_0x3d2bf1['use'](_0x2092('0x3b'),require(_0x2092('0x3c')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x3d'),require(_0x2092('0x3e')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x3f'),require(_0x2092('0x40')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x41'),require('./api/mailSubstatus'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x42'),require('./api/mailInteraction'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x43'),require(_0x2092('0x44')));_0x3d2bf1['use'](_0x2092('0x45'),require(_0x2092('0x46')));_0x3d2bf1['use'](_0x2092('0x47'),require(_0x2092('0x48')));_0x3d2bf1['use'](_0x2092('0x49'),require(_0x2092('0x4a')));_0x3d2bf1['use'](_0x2092('0x4b'),require(_0x2092('0x4c')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x4d'),require(_0x2092('0x4e')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x4f'),require('./api/faxApplication'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x50'),require(_0x2092('0x51')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x52'),require('./api/faxMessage'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x53'),require(_0x2092('0x54')));_0x3d2bf1['use'](_0x2092('0x55'),require(_0x2092('0x56')));_0x3d2bf1['use'](_0x2092('0x57'),require(_0x2092('0x58')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x59'),require(_0x2092('0x5a')));_0x3d2bf1['use'](_0x2092('0x5b'),require(_0x2092('0x5c')));_0x3d2bf1['use'](_0x2092('0x5d'),require(_0x2092('0x5e')));_0x3d2bf1[_0x2092('0x9')]('/api/sms/queues',require(_0x2092('0x5f')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x60'),require(_0x2092('0x61')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x62'),require(_0x2092('0x63')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x64'),require(_0x2092('0x65')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x66'),require('./api/openchannelMessage'));_0x3d2bf1['use'](_0x2092('0x67'),require(_0x2092('0x68')));_0x3d2bf1[_0x2092('0x9')]('/api/chat/websites',require(_0x2092('0x69')));_0x3d2bf1[_0x2092('0x9')]('/api/openchannel/reports/queue',require(_0x2092('0x6a')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x6b'),require(_0x2092('0x6c')));_0x3d2bf1['use'](_0x2092('0x6d'),require(_0x2092('0x6e')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x6f'),require('./api/chatMessage'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x70'),require(_0x2092('0x71')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x72'),require(_0x2092('0x73')));_0x3d2bf1[_0x2092('0x9')]('/api/chat/groups',require(_0x2092('0x74')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x75'),require(_0x2092('0x76')));_0x3d2bf1['use'](_0x2092('0x77'),require(_0x2092('0x78')));_0x3d2bf1['use']('/api/cm/contacts',require('./api/cmContact'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x79'),require('./api/cmHopper'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x7a'),require(_0x2092('0x7b')));_0x3d2bf1['use'](_0x2092('0x7c'),require('./api/cmHopperFinal'));_0x3d2bf1['use'](_0x2092('0x7d'),require(_0x2092('0x7e')));_0x3d2bf1[_0x2092('0x9')]('/api/cm/custom_fields',require(_0x2092('0x7f')));_0x3d2bf1['use'](_0x2092('0x80'),require(_0x2092('0x81')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x82'),require('./api/automation'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x83'),require(_0x2092('0x84')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x85'),require('./api/disposition'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x86'),require(_0x2092('0x87')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x88'),require('./api/interval'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x89'),require(_0x2092('0x8a')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x8b'),require('./api/cdr'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x8c'),require('./api/voiceQueuesLog'));_0x3d2bf1['use']('/api/schedules',require(_0x2092('0x8d')));_0x3d2bf1['use'](_0x2092('0x8e'),require(_0x2092('0x8f')));_0x3d2bf1['use'](_0x2092('0x90'),require('./api/tag'));_0x3d2bf1[_0x2092('0x9')]('/api/templates',require(_0x2092('0x91')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x92'),require('./api/trigger'));_0x3d2bf1[_0x2092('0x9')]('/api/variables',require(_0x2092('0x93')));_0x3d2bf1['use'](_0x2092('0x94'),require(_0x2092('0x95')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x96'),require('./api/integrationReport'));_0x3d2bf1['use'](_0x2092('0x97'),require(_0x2092('0x98')));_0x3d2bf1['use']('/api/analytics/default_reports',require(_0x2092('0x99')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x9a'),require('./api/analyticExtractedReport'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x9b'),require(_0x2092('0x9c')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x9d'),require('./api/analyticFieldReport'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x9e'),require(_0x2092('0x9f')));_0x3d2bf1[_0x2092('0x9')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xa0'),require(_0x2092('0xa1')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xa2'),require(_0x2092('0xa3')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xa4'),require(_0x2092('0xa5')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xa6'),require(_0x2092('0xa7')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xa8'),require(_0x2092('0xa9')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xaa'),require('./api/intDeskAccount'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xab'),require(_0x2092('0xac')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xad'),require(_0x2092('0xae')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xaf'),require(_0x2092('0xb0')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xb1'),require('./api/intZohoConfiguration'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xb2'),require(_0x2092('0xb3')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xb4'),require(_0x2092('0xb5')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xb6'),require('./api/intZendeskConfiguration'));_0x3d2bf1['use'](_0x2092('0xb7'),require(_0x2092('0xb8')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xb9'),require(_0x2092('0xba')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xbb'),require(_0x2092('0xbc')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xbd'),require('./api/intFreshdeskField'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xbe'),require('./api/intVtigerAccount'));_0x3d2bf1['use'](_0x2092('0xbf'),require(_0x2092('0xc0')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xc1'),require(_0x2092('0xc2')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xc3'),require(_0x2092('0xc4')));_0x3d2bf1['use']('/api/integrations/servicenow/configurations',require(_0x2092('0xc5')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xc6'),require('./api/intServicenowField'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xc7'),require('./api/intDynamics365Account'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xc8'),require('./api/intDynamics365Configuration'));_0x3d2bf1['use'](_0x2092('0xc9'),require('./api/intDynamics365Field'));_0x3d2bf1['use'](_0x2092('0xca'),require('./api/intFreshsalesAccount'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xcb'),require(_0x2092('0xcc')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xcd'),require('./api/intFreshsalesField'));_0x3d2bf1['use']('/api/networks',require(_0x2092('0xce')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xcf'),require(_0x2092('0xd0')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xd1'),require('./api/chatInternalMessage'));_0x3d2bf1['use'](_0x2092('0xd2'),require(_0x2092('0xd3')));_0x3d2bf1[_0x2092('0x9')]('/api/jscripty/questions/reports',require(_0x2092('0xd4')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xd5'),require(_0x2092('0xd6')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xd7'),require(_0x2092('0xd8')));_0x3d2bf1['use'](_0x2092('0xd9'),require(_0x2092('0xda')));_0x3d2bf1['use'](_0x2092('0xdb'),require(_0x2092('0xdc')));_0x3d2bf1['use'](_0x2092('0xdd'),require(_0x2092('0xde')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xdf'),require(_0x2092('0xe0')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xe1'),require(_0x2092('0xe2')));_0x3d2bf1[_0x2092('0x9')]('/api/square/projects',require(_0x2092('0xe3')));_0x3d2bf1[_0x2092('0x9')]('/api/square/recordings',require('./api/squareRecording'));_0x3d2bf1[_0x2092('0x9')]('/api/square/messages',require('./api/squareMessage'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xe4'),require(_0x2092('0xe5')));_0x3d2bf1[_0x2092('0x9')]('/api/license',require(_0x2092('0xe6')));_0x3d2bf1[_0x2092('0x9')]('/api/campaigns',require(_0x2092('0xe7')));_0x3d2bf1['use'](_0x2092('0xe8'),require('./api/migration'));_0x3d2bf1[_0x2092('0x9')]('/api/attachments',require(_0x2092('0xe9')));_0x3d2bf1['use'](_0x2092('0xea'),require(_0x2092('0xeb')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xec'),require(_0x2092('0xed')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xee'),require(_0x2092('0xef')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xf0'),require(_0x2092('0xf1')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xf2'),require('./api/openchannelTransferReport'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xf3'),require(_0x2092('0xf4')));_0x3d2bf1['use'](_0x2092('0xf5'),require(_0x2092('0xf6')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xf7'),require('./api/voicePrefix'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xf8'),require('./api/userProfile'));_0x3d2bf1[_0x2092('0x9')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x3d2bf1['use'](_0x2092('0xf9'),require(_0x2092('0xfa')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0xfb'),require(_0x2092('0xfc')));_0x3d2bf1['use'](_0x2092('0xfd'),require(_0x2092('0xfe')));_0x3d2bf1['use'](_0x2092('0xff'),require(_0x2092('0x100')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x101'),require('./api/whatsappInteraction'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x102'),require(_0x2092('0x103')));_0x3d2bf1[_0x2092('0x9')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x3d2bf1['use'](_0x2092('0x104'),require(_0x2092('0x105')));_0x3d2bf1[_0x2092('0x9')]('/api/whatsapp/queues',require(_0x2092('0x106')));_0x3d2bf1[_0x2092('0x9')]('/api/cloudProviders',require(_0x2092('0x107')));_0x3d2bf1['use'](_0x2092('0x108'),require(_0x2092('0x109')));_0x3d2bf1[_0x2092('0x9')]('/api/auth/local',require(_0x2092('0x10a')));_0x3d2bf1[_0x2092('0x9')]('/api/auth/google',require(_0x2092('0x10b')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x10c'),require(_0x2092('0x10d')));_0x3d2bf1[_0x2092('0x9')]('/api/rpc',require('./api/rpc'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x10e'),require(_0x2092('0x10f')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x110'),require(_0x2092('0x111')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x112'),require(_0x2092('0x113')));_0x3d2bf1[_0x2092('0x9')]('/api/webbar',require('./api/webbar'));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x114'),express['static'](path[_0x2092('0x115')](config['root'],'/apidoc')));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x116'),express['static'](path[_0x2092('0x115')](config[_0x2092('0x117')],_0x2092('0x116'))));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x118'),express[_0x2092('0x119')](path['join'](config[_0x2092('0x117')],_0x2092('0x118'))));_0x3d2bf1[_0x2092('0x9')]('/snippet',express['static'](path['join'](config['root'],'snippet',_0x2092('0x11a'))));_0x3d2bf1[_0x2092('0x9')](_0x2092('0x11b'),express[_0x2092('0x119')](path[_0x2092('0x115')](config[_0x2092('0x117')],_0x2092('0x11c'))));_0x3d2bf1[_0x2092('0x11d')](_0x2092('0x11e'))['get'](errors[0x194]);_0x3d2bf1[_0x2092('0x11d')]('/*')[_0x2092('0x11f')](function(_0x1f43c3,_0xe8fc9b){_0xe8fc9b[_0x2092('0x120')](path[_0x2092('0x121')](_0x3d2bf1['get'](_0x2092('0x122'))+_0x2092('0x123')));});};var sensitiveFields=[_0x2092('0x124'),_0x2092('0x125'),_0x2092('0x126'),_0x2092('0x127'),_0x2092('0x128'),_0x2092('0x129'),_0x2092('0x12a'),_0x2092('0x12b'),'mobile',_0x2092('0x12c'),_0x2092('0x12d'),_0x2092('0x12e'),_0x2092('0x12f'),'securityToken',_0x2092('0x130'),_0x2092('0x131'),'tenantId',_0x2092('0x132'),_0x2092('0x133'),'accessToken',_0x2092('0x134'),'authToken','consumerKey',_0x2092('0x135'),_0x2092('0x136'),_0x2092('0x137'),_0x2092('0x138'),_0x2092('0x139'),_0x2092('0x13a'),_0x2092('0x13b'),'privateKey','accesskeyid','secretaccesskey',_0x2092('0x13c'),'user',_0x2092('0x13d'),'accountSid',_0x2092('0x13e'),_0x2092('0x13f'),'secret',_0x2092('0x140'),_0x2092('0x141')];function maskSensitiveData(_0x53a1c5){var _0x1d0ce9=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0x53a1c5))return;for(var _0x3c8981 in _0x53a1c5){if(_[_0x2092('0x142')](_0x53a1c5[_0x3c8981])){for(var _0x576b72=0x0;_0x576b72<_0x53a1c5[_0x3c8981][_0x2092('0x143')];_0x576b72++){maskSensitiveData(_0x53a1c5[_0x3c8981][_0x576b72]);}}else if(_[_0x2092('0x144')](_0x53a1c5[_0x3c8981])){maskSensitiveData(_0x53a1c5[_0x3c8981]);}else if(_[_0x2092('0x145')](_0x53a1c5[_0x3c8981])){_0x53a1c5[_0x3c8981]=_0x53a1c5[_0x3c8981][_0x2092('0x146')](/{{{/g,_0x2092('0x147'))[_0x2092('0x146')](/}}}/g,_0x2092('0x148'))[_0x2092('0x146')](/{{/g,'@{')[_0x2092('0x146')](/}}/g,'}@');if(_[_0x2092('0x149')](sensitiveFields,_0x3c8981)){_0x53a1c5[_0x3c8981]=_0x53a1c5[_0x3c8981][_0x2092('0x146')](_0x1d0ce9,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index b22dea0..77c60f0 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca97=['../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.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','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc'];(function(_0x1614e5,_0x3a5900){var _0x597538=function(_0x2b1765){while(--_0x2b1765){_0x1614e5['push'](_0x1614e5['shift']());}};_0x597538(++_0x3a5900);}(_0xca97,0x185));var _0x7ca9=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xca97[_0x2b10c6];return _0x3789d2;};'use strict';var jayson=require(_0x7ca9('0x0'));var BPromise=require('bluebird');var _=require(_0x7ca9('0x1'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x3d6fb5,_0x136ce7){var _0x3a6eeb={};_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x3')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/voiceExtension/voiceExtension.rpc'));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x4')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x5')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x6')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3a6eeb=_['merge'](_0x3a6eeb,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x7')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x8')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x9')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0xa')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0xb')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0xc')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/mailInteraction/mailInteraction.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/mailMessage/mailMessage.rpc'));_0x3a6eeb=_['merge'](_0x3a6eeb,require('../api/mailApplication/mailApplication.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0xd')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0xe')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0xf')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x10')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x11')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x12')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x13')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/smsAccount/smsAccount.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x14')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x15')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x16')));_0x3a6eeb=_['merge'](_0x3a6eeb,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x17')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x18')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x19')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x1a')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x1b')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x1c')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/chatQueue/chatQueue.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x1d')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x1e')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x1f')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x20')));_0x3a6eeb=_['merge'](_0x3a6eeb,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x21')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x22')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x23')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x24')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x25')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/variable/variable.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x26')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x27')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x28')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x29')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x2a')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x2b')));_0x3a6eeb=_['merge'](_0x3a6eeb,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x2c')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x2d')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x2e')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x2f')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x30')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x31')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x32')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x33')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x34')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x35')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x36')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x37')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x38')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x39')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x3a')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x3b')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x3c')));_0x3a6eeb=_['merge'](_0x3a6eeb,require(_0x7ca9('0x3d')));_0x3a6eeb=_[_0x7ca9('0x2')](_0x3a6eeb,require(_0x7ca9('0x3e')));var _0x44477f=jayson[_0x7ca9('0x3f')](_0x3a6eeb)['http']();var _0xce8f80=config[_0x7ca9('0x40')][_0x7ca9('0x41')]||config[_0x7ca9('0x41')]+0x1;var _0x217e66=config['rpc']['ip']||_0x7ca9('0x42');_0x44477f['on'](_0x7ca9('0x43'),function(_0x4d4407){return _0x136ce7(_0x4d4407);});_0x44477f[_0x7ca9('0x44')](_0xce8f80,_0x217e66,function(){console[_0x7ca9('0x45')](_0x7ca9('0x46'),_0x217e66,_0xce8f80);require(_0x7ca9('0x47'))[_0x7ca9('0x48')]();return _0x3d6fb5('RPC\x20listening\x20on\x20'+_0x217e66+':'+_0xce8f80);});});}; \ No newline at end of file +var _0x001b=['../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.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/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc'];(function(_0x27f3d1,_0x323acc){var _0x3a217a=function(_0x2515b2){while(--_0x2515b2){_0x27f3d1['push'](_0x27f3d1['shift']());}};_0x3a217a(++_0x323acc);}(_0x001b,0x1e6));var _0xb001=function(_0x416fc6,_0x346660){_0x416fc6=_0x416fc6-0x0;var _0x2329b3=_0x001b[_0x416fc6];return _0x2329b3;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb001('0x0'));var _=require(_0xb001('0x1'));var config=require(_0xb001('0x2'));exports[_0xb001('0x3')]=function(){return new BPromise(function(_0x1e86f8,_0x1f90eb){var _0x2ce00b={};_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/user/user.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/voiceExtension/voiceExtension.rpc'));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x5')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x6')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x7')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x8')));_0x2ce00b=_['merge'](_0x2ce00b,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x9')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/trunk/trunk.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0xa')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0xb')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0xc')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0xd')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0xe')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0xf')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x10')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/mailApplication/mailApplication.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x11')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/faxApplication/faxApplication.rpc'));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x12')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x13')));_0x2ce00b=_['merge'](_0x2ce00b,require('../api/faxQueue/faxQueue.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x14')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x15')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x16')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x17')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x18')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x19')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x1a')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x1b')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x1c')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x1d')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x1e')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x1f')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x20')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x21')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x22')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x23')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x24')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x25')));_0x2ce00b=_['merge'](_0x2ce00b,require('../api/pause/pause.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x26')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x27')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x28')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x29')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x2a')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x2b')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x2c')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x2d')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x2e')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x2f')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x30')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x31')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x32')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x33')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x34')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/squareReport/squareReport.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x35')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x36')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x37')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x38')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/squareRecording/squareRecording.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x39')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x3a')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x3b')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x3c')));_0x2ce00b=_['merge'](_0x2ce00b,require(_0xb001('0x3d')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x3e')));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x2ce00b=_[_0xb001('0x4')](_0x2ce00b,require(_0xb001('0x3f')));var _0x13849a=jayson[_0xb001('0x40')](_0x2ce00b)[_0xb001('0x41')]();var _0x478ab2=config[_0xb001('0x42')][_0xb001('0x43')]||config[_0xb001('0x43')]+0x1;var _0x5f3a1a=config[_0xb001('0x42')]['ip']||_0xb001('0x44');_0x13849a['on'](_0xb001('0x45'),function(_0x4fed65){return _0x1f90eb(_0x4fed65);});_0x13849a[_0xb001('0x3')](_0x478ab2,_0x5f3a1a,function(){console[_0xb001('0x46')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5f3a1a,_0x478ab2);require('../config/triggers')[_0xb001('0x47')]();return _0x1e86f8(_0xb001('0x48')+_0x5f3a1a+':'+_0x478ab2);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 3b7f612..80dcec2 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 _0xba55=['E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','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','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./error','setEncoding','setTimeout','utf8','headers','emit','ready','toLowerCase','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','split','length','match','error'];(function(_0x5ac03f,_0x5646e4){var _0x458700=function(_0x63dcfd){while(--_0x63dcfd){_0x5ac03f['push'](_0x5ac03f['shift']());}};_0x458700(++_0x5646e4);}(_0xba55,0x1f3));var _0x5ba5=function(_0x58109f,_0x3ea4a8){_0x58109f=_0x58109f-0x0;var _0x3c74d1=_0xba55[_0x58109f];return _0x3c74d1;};'use strict';var util=require(_0x5ba5('0x0'));var _=require(_0x5ba5('0x1'));var EventEmitter=require(_0x5ba5('0x2'))[_0x5ba5('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x5ba5('0x4'));function AGIChannel(_0x262bf7){var _0x41fda3=this,_0x153fd4=new AGIReply(),_0x15e2d0=![],_0x1bc2b4={};EventEmitter['call'](_0x41fda3);_0x262bf7[_0x5ba5('0x5')]('utf8');_0x262bf7[_0x5ba5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x153fd4[_0x5ba5('0x5')](_0x5ba5('0x7'));_0x153fd4['on'](_0x5ba5('0x8'),function(_0x2744e8){for(var _0x44c512 in _0x2744e8){_0x41fda3[_0x44c512]=_0x2744e8[_0x44c512];}_0x41fda3[_0x5ba5('0x9')](_0x5ba5('0xa'));});_0x153fd4['on']('line',function(_0x2664f0){if(_0x2664f0[_0x5ba5('0xb')]()=='hangup'){_0x41fda3[_0x5ba5('0x9')]('hangup');return;}if(_0x2664f0[_0x5ba5('0xc')](0x0,0xb)==_0x5ba5('0xd')){_0x15e2d0=!![];}if(_0x15e2d0){_0x1bc2b4['rx']+=_0x2664f0+'\x0a';if(_0x2664f0[_0x5ba5('0xe')](_0x5ba5('0xf'))!=-0x1){_0x15e2d0=![];}}else{_0x1bc2b4['rx']=_0x2664f0;}if(_0x15e2d0){return;}if(typeof _0x1bc2b4['cb']==_0x5ba5('0x10')){var _0x3edd73=_0x1bc2b4['rx'][_0x5ba5('0xc')](0x0,0x3),_0x12cd36=null,_0xe02cff=null;_0x3edd73=parseInt(_0x3edd73);if(isNaN(_0x3edd73)){_0x1bc2b4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5ba5('0x11')});return;}if(_0x3edd73!=0xc8){_0x1bc2b4['cb'](null,{'code':_0x3edd73,'result':-0x1,'extra':'KO'});return;}_0x12cd36=_0x1bc2b4['rx'][_0x5ba5('0xc')](0x4)[_0x5ba5('0x12')](_0x5ba5('0x13'),'');if(_0x12cd36[_0x5ba5('0x14')]('\x20')!=-0x1){_0x12cd36=_0x12cd36[_0x5ba5('0x15')](0x0,_0x12cd36['indexOf']('\x20'));}if(_['startsWith'](_0x12cd36,'-1')){_0x12cd36=parseInt(_0x12cd36);}_0xe02cff=_0x1bc2b4['rx'][_0x5ba5('0x16')]('\x20');if(_0xe02cff['length']==0x3){_0xe02cff=_0xe02cff[0x2]['substring'](0x1,_0xe02cff[0x2]['length']-0x1);}else if(_0xe02cff[_0x5ba5('0x17')]>0x3){var _0x51cbf2=/\((.+)\)/;var _0xe9afd4=_0x1bc2b4['rx'][_0x5ba5('0x18')](_0x51cbf2);if(_0xe9afd4){_0xe02cff=_0xe9afd4[0x1];}else{_0xe02cff=null;}}else{_0xe02cff=null;}_0x1bc2b4['cb'](null,{'code':_0x3edd73,'result':_0x12cd36,'extra':_0xe02cff});}});_0x262bf7['on'](_0x5ba5('0x19'),function(_0x4677e5){_0x41fda3[_0x5ba5('0x9')](_0x5ba5('0x19'),new AGIError(_0x5ba5('0x1a'),_0x4677e5['code']));});_0x262bf7['on'](_0x5ba5('0x1b'),function(){_0x41fda3['emit']('close',new AGIError(_0x5ba5('0x1c')));});_0x262bf7['on']('timeout',function(){_0x41fda3[_0x5ba5('0x9')](_0x5ba5('0x1d'),new AGIError(_0x5ba5('0x1e')));_0x262bf7['destroy']();});_0x262bf7[_0x5ba5('0x1f')](_0x153fd4);this[_0x5ba5('0x20')]=function(_0x9b0ea,_0x4ac568){var _0x9b0ea=_0x9b0ea||'',_0x4ac568=typeof _0x4ac568=='function'?_0x4ac568:new Function();_0x1bc2b4={'tx':_0x9b0ea,'rx':'','cb':_0x4ac568};_0x262bf7[_0x5ba5('0x21')](_0x9b0ea+'\x0a');},this['close']=function(){_0x262bf7[_0x5ba5('0x22')]();};}util[_0x5ba5('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x5ba5('0x24')]['sendRequest']=function(_0x2471b3){return this[_0x5ba5('0x20')][_0x5ba5('0x25')](this,_0x2471b3);};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x26')]=function(){return this[_0x5ba5('0x27')](_0x5ba5('0x28'));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x29')]=function(_0x20e7e9,_0x5cc064,_0x566a3d){_0x20e7e9=_0x20e7e9===undefined?_0x5ba5('0x2a'):_0x20e7e9;_0x5cc064=_0x5cc064===undefined?'5':_0x5cc064;_0x566a3d=_0x566a3d===undefined?'1':_0x566a3d;return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x20e7e9,_0x5cc064*0x3e8,_0x566a3d));};AGIChannel[_0x5ba5('0x24')]['noop']=function(_0x3129a5){_0x3129a5=_0x3129a5||_0x5ba5('0x2c');return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('VERBOSE\x20\x22%s\x22',_0x3129a5));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x2d')]=function(_0x417402,_0x1b409d){if(_['isArray'](_0x1b409d)){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('EXEC\x20%s\x20%s',_0x417402,_0x1b409d['join'](',')));}return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x2e'),_0x417402,_0x1b409d));};AGIChannel[_0x5ba5('0x24')]['setContext']=function(_0x4ea5ee){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x2f'),_0x4ea5ee));};AGIChannel['prototype'][_0x5ba5('0x30')]=function(_0x4e09ef){return this['sendRequest'](util[_0x5ba5('0x2b')]('SET\x20EXTENSION\x20%s',_0x4e09ef));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x31')]=function(_0x2f5ca6){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x32'),_0x2f5ca6));};AGIChannel[_0x5ba5('0x24')]['hangup']=function(){return this[_0x5ba5('0x27')]('HANGUP');};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x33')]=function(_0x3c38ea,_0x392e30){var _0x4a72a6=_[_0x5ba5('0x34')](_0x392e30)||_[_0x5ba5('0x35')](_0x392e30)?_0x392e30[_0x5ba5('0x36')]():_0x392e30;return this[_0x5ba5('0x27')](util['format'](_0x5ba5('0x37'),_0x3c38ea,_0x4a72a6?_0x4a72a6[_0x5ba5('0x36')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x5ba5('0x38')]=function(_0x5702f1,_0x2a77ef){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x39'),_0x5702f1,_0x2a77ef));};AGIChannel[_0x5ba5('0x24')]['sayDigits']=function(_0x2b7d79,_0x1ced9d){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x3a'),_0x2b7d79,_0x1ced9d));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x3b')]=function(_0x3781ef,_0x1f65e3){return this['sendRequest'](util[_0x5ba5('0x2b')](_0x5ba5('0x3c'),_0x3781ef,_0x1f65e3));};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x3d')]=function(_0x29a22b,_0x2f11c2,_0x358f09){_0x2f11c2=_0x2f11c2||this[_0x5ba5('0x3e')];_0x358f09=_0x358f09||0x1;this[_0x5ba5('0x3f')](_0x29a22b);this[_0x5ba5('0x30')](_0x2f11c2);this['setPriority'](_0x358f09);return this[_0x5ba5('0x40')](util['format'](_0x5ba5('0x41'),_0x29a22b,_0x2f11c2,_0x358f09));};AGIChannel['prototype']['getVariable']=function(_0x2a45e9){return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x42'),_0x2a45e9));};AGIChannel[_0x5ba5('0x24')]['recordFile']=function(_0x12ba05,_0x2d8e1c,_0x2e8beb,_0x792af3,_0x33c47,_0x62a4e0){_0x2d8e1c=_0x2d8e1c||_0x5ba5('0x43');_0x2e8beb=_0x2e8beb||'';_0x792af3=_0x792af3===undefined?-0x1:_0x792af3==='-1'?-0x1:_0x792af3*0x3e8;_0x33c47=_0x33c47===undefined?'':'s='+_0x33c47;_0x62a4e0=_0x62a4e0?_0x5ba5('0x44'):'';return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')](_0x5ba5('0x45'),_0x12ba05,_0x2d8e1c,_0x2e8beb,_0x792af3,_0x62a4e0,_0x33c47));};AGIChannel[_0x5ba5('0x24')]['streamFile']=function(_0x37a722,_0x893a8){_0x893a8=_0x893a8||'';return this[_0x5ba5('0x27')](util[_0x5ba5('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x37a722,_0x893a8));};AGIChannel[_0x5ba5('0x24')]['agi']=function(_0x509c3d){return this[_0x5ba5('0x2d')](_0x5ba5('0x46'),_0x509c3d);};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x47')]=function(_0x2bd6c9){return this[_0x5ba5('0x2d')](_0x5ba5('0x48'),_0x2bd6c9);};AGIChannel[_0x5ba5('0x24')][_0x5ba5('0x19')]=function(_0x336cbb,_0x4ad046){this[_0x5ba5('0x40')](util['format'](_0x5ba5('0x49'),_0x336cbb['id'],_0x336cbb['label'],_0x4ad046));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x5ba5('0x4a')]=AGIChannel; \ No newline at end of file +var _0xaf11=['sayPhonetic','setExtension','setPriority','noop','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./error','call','utf8','setEncoding','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','prototype','sync','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits'];(function(_0xf6f5ee,_0x1c79bc){var _0x22f43e=function(_0x40afca){while(--_0x40afca){_0xf6f5ee['push'](_0xf6f5ee['shift']());}};_0x22f43e(++_0x1c79bc);}(_0xaf11,0x12f));var _0x1af1=function(_0x3da33d,_0x981b00){_0x3da33d=_0x3da33d-0x0;var _0x46bdc0=_0xaf11[_0x3da33d];return _0x46bdc0;};'use strict';var util=require(_0x1af1('0x0'));var _=require(_0x1af1('0x1'));var EventEmitter=require(_0x1af1('0x2'))[_0x1af1('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x1af1('0x4'));function AGIChannel(_0x2c89fa){var _0x28842d=this,_0x53af48=new AGIReply(),_0xb0ace=![],_0x12eead={};EventEmitter[_0x1af1('0x5')](_0x28842d);_0x2c89fa['setEncoding'](_0x1af1('0x6'));_0x2c89fa['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x53af48[_0x1af1('0x7')](_0x1af1('0x6'));_0x53af48['on']('headers',function(_0x260799){for(var _0x53ba26 in _0x260799){_0x28842d[_0x53ba26]=_0x260799[_0x53ba26];}_0x28842d['emit'](_0x1af1('0x8'));});_0x53af48['on'](_0x1af1('0x9'),function(_0x3b9e2b){if(_0x3b9e2b[_0x1af1('0xa')]()==_0x1af1('0xb')){_0x28842d[_0x1af1('0xc')]('hangup');return;}if(_0x3b9e2b[_0x1af1('0xd')](0x0,0xb)==_0x1af1('0xe')){_0xb0ace=!![];}if(_0xb0ace){_0x12eead['rx']+=_0x3b9e2b+'\x0a';if(_0x3b9e2b[_0x1af1('0xf')](_0x1af1('0x10'))!=-0x1){_0xb0ace=![];}}else{_0x12eead['rx']=_0x3b9e2b;}if(_0xb0ace){return;}if(typeof _0x12eead['cb']==_0x1af1('0x11')){var _0x20141a=_0x12eead['rx'][_0x1af1('0xd')](0x0,0x3),_0x339763=null,_0x5e4634=null;_0x20141a=parseInt(_0x20141a);if(isNaN(_0x20141a)){_0x12eead['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1af1('0x12')});return;}if(_0x20141a!=0xc8){_0x12eead['cb'](null,{'code':_0x20141a,'result':-0x1,'extra':'KO'});return;}_0x339763=_0x12eead['rx'][_0x1af1('0xd')](0x4)[_0x1af1('0x13')]('result=','');if(_0x339763[_0x1af1('0x14')]('\x20')!=-0x1){_0x339763=_0x339763[_0x1af1('0x15')](0x0,_0x339763[_0x1af1('0x14')]('\x20'));}if(_['startsWith'](_0x339763,'-1')){_0x339763=parseInt(_0x339763);}_0x5e4634=_0x12eead['rx'][_0x1af1('0x16')]('\x20');if(_0x5e4634[_0x1af1('0x17')]==0x3){_0x5e4634=_0x5e4634[0x2][_0x1af1('0xd')](0x1,_0x5e4634[0x2][_0x1af1('0x17')]-0x1);}else if(_0x5e4634[_0x1af1('0x17')]>0x3){var _0x359eaf=/\((.+)\)/;var _0x1c7664=_0x12eead['rx'][_0x1af1('0x18')](_0x359eaf);if(_0x1c7664){_0x5e4634=_0x1c7664[0x1];}else{_0x5e4634=null;}}else{_0x5e4634=null;}_0x12eead['cb'](null,{'code':_0x20141a,'result':_0x339763,'extra':_0x5e4634});}});_0x2c89fa['on'](_0x1af1('0x19'),function(_0x20c17b){_0x28842d['emit']('error',new AGIError('E_AGI_SOCKET_ERROR',_0x20c17b[_0x1af1('0x1a')]));});_0x2c89fa['on']('close',function(){_0x28842d[_0x1af1('0xc')](_0x1af1('0x1b'),new AGIError(_0x1af1('0x1c')));});_0x2c89fa['on'](_0x1af1('0x1d'),function(){_0x28842d[_0x1af1('0xc')](_0x1af1('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c89fa[_0x1af1('0x1e')]();});_0x2c89fa[_0x1af1('0x1f')](_0x53af48);this[_0x1af1('0x20')]=function(_0x518f49,_0x3d1ed1){var _0x518f49=_0x518f49||'',_0x3d1ed1=typeof _0x3d1ed1==_0x1af1('0x11')?_0x3d1ed1:new Function();_0x12eead={'tx':_0x518f49,'rx':'','cb':_0x3d1ed1};_0x2c89fa[_0x1af1('0x21')](_0x518f49+'\x0a');},this[_0x1af1('0x1b')]=function(){_0x2c89fa['destroy']();};}util[_0x1af1('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x1af1('0x23')]['sendRequest']=function(_0x57d9f0){return this['command'][_0x1af1('0x24')](this,_0x57d9f0);};AGIChannel['prototype']['answer']=function(){return this[_0x1af1('0x25')](_0x1af1('0x26'));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x27')]=function(_0x6222f1,_0x5dba1d,_0x371931){_0x6222f1=_0x6222f1===undefined?_0x1af1('0x28'):_0x6222f1;_0x5dba1d=_0x5dba1d===undefined?'5':_0x5dba1d;_0x371931=_0x371931===undefined?'1':_0x371931;return this[_0x1af1('0x25')](util[_0x1af1('0x29')](_0x1af1('0x2a'),_0x6222f1,_0x5dba1d*0x3e8,_0x371931));};AGIChannel[_0x1af1('0x23')]['noop']=function(_0x40e32f){_0x40e32f=_0x40e32f||'NO\x20MESSAGE';return this[_0x1af1('0x25')](util[_0x1af1('0x29')]('VERBOSE\x20\x22%s\x22',_0x40e32f));};AGIChannel['prototype'][_0x1af1('0x2b')]=function(_0x2ec5e0,_0x2c1494){if(_[_0x1af1('0x2c')](_0x2c1494)){return this['sendRequest'](util[_0x1af1('0x29')](_0x1af1('0x2d'),_0x2ec5e0,_0x2c1494['join'](',')));}return this[_0x1af1('0x25')](util['format'](_0x1af1('0x2d'),_0x2ec5e0,_0x2c1494));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x2e')]=function(_0x24f94c){return this['sendRequest'](util[_0x1af1('0x29')](_0x1af1('0x2f'),_0x24f94c));};AGIChannel[_0x1af1('0x23')]['setExtension']=function(_0x4bbcec){return this[_0x1af1('0x25')](util['format'](_0x1af1('0x30'),_0x4bbcec));};AGIChannel[_0x1af1('0x23')]['setPriority']=function(_0x4c5f9c){return this[_0x1af1('0x25')](util['format'](_0x1af1('0x31'),_0x4c5f9c));};AGIChannel[_0x1af1('0x23')][_0x1af1('0xb')]=function(){return this[_0x1af1('0x25')]('HANGUP');};AGIChannel[_0x1af1('0x23')]['setVariable']=function(_0x21f0f3,_0x50b558){var _0xda7efa=_[_0x1af1('0x32')](_0x50b558)||_[_0x1af1('0x33')](_0x50b558)?_0x50b558[_0x1af1('0x34')]():_0x50b558;return this['sendRequest'](util[_0x1af1('0x29')](_0x1af1('0x35'),_0x21f0f3,_0xda7efa?_0xda7efa[_0x1af1('0x34')]()[_0x1af1('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x36')]=function(_0x58c5d5,_0x2de4a9){return this[_0x1af1('0x25')](util['format'](_0x1af1('0x37'),_0x58c5d5,_0x2de4a9));};AGIChannel['prototype'][_0x1af1('0x38')]=function(_0x1c4905,_0x4569f5){return this[_0x1af1('0x25')](util[_0x1af1('0x29')]('SAY\x20DIGITS\x20%s\x20%s',_0x1c4905,_0x4569f5));};AGIChannel['prototype'][_0x1af1('0x39')]=function(_0x36ab51,_0x1bb8fe){return this[_0x1af1('0x25')](util[_0x1af1('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x36ab51,_0x1bb8fe));};AGIChannel[_0x1af1('0x23')]['continueAt']=function(_0x149f4f,_0x296c11,_0x57e0fd){_0x296c11=_0x296c11||this['extension'];_0x57e0fd=_0x57e0fd||0x1;this[_0x1af1('0x2e')](_0x149f4f);this[_0x1af1('0x3a')](_0x296c11);this[_0x1af1('0x3b')](_0x57e0fd);return this[_0x1af1('0x3c')](util[_0x1af1('0x29')]('GOTO\x20%s\x20%s\x20%s',_0x149f4f,_0x296c11,_0x57e0fd));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x3d')]=function(_0x501056){return this['sendRequest'](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x501056));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x3e')]=function(_0x298b76,_0x53b640,_0x113d96,_0x44cece,_0x42e391,_0x1bb1cb){_0x53b640=_0x53b640||_0x1af1('0x3f');_0x113d96=_0x113d96||'';_0x44cece=_0x44cece===undefined?-0x1:_0x44cece==='-1'?-0x1:_0x44cece*0x3e8;_0x42e391=_0x42e391===undefined?'':'s='+_0x42e391;_0x1bb1cb=_0x1bb1cb?_0x1af1('0x40'):'';return this['sendRequest'](util[_0x1af1('0x29')](_0x1af1('0x41'),_0x298b76,_0x53b640,_0x113d96,_0x44cece,_0x1bb1cb,_0x42e391));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x42')]=function(_0x55cc1e,_0x203ccf){_0x203ccf=_0x203ccf||'';return this[_0x1af1('0x25')](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x55cc1e,_0x203ccf));};AGIChannel[_0x1af1('0x23')][_0x1af1('0x43')]=function(_0x582c85){return this[_0x1af1('0x2b')](_0x1af1('0x44'),_0x582c85);};AGIChannel['prototype'][_0x1af1('0x45')]=function(_0x4d201b){return this[_0x1af1('0x2b')]('WAIT',_0x4d201b);};AGIChannel[_0x1af1('0x23')][_0x1af1('0x19')]=function(_0x4ccca3,_0xabb1c6){this[_0x1af1('0x3c')](util[_0x1af1('0x29')](_0x1af1('0x46'),_0x4ccca3['id'],_0x4ccca3[_0x1af1('0x47')],_0xabb1c6));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 616f4cb..5ab572a 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 _0x801d=['format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x801d,0xe9));var _0xd801=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x801d[_0x3e112d];return _0x531c31;};'use strict';var util=require(_0xd801('0x0'));var error={'E_AGI_UNDEFINED':_0xd801('0x1'),'E_AGI_ARGUMENT_PORT':_0xd801('0x2'),'E_AGI_SERVER_ERROR':_0xd801('0x3'),'E_AGI_SERVER_CLOSE':_0xd801('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xd801('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xd801('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xd801('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd801('0x8'),'E_AGI_COMMAND_EMPTY':_0xd801('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd801('0xa'),'E_AGI_IVR_ENTRY':_0xd801('0xb')};function AGIError(_0x14cf1d){var _0x14cf1d=_0x14cf1d||null,_0x577763=_0x577763||[],_0x383050=0x1,_0x411e2a='';if(!error[_0x14cf1d]){_0x14cf1d=_0xd801('0xc');}_0x577763[_0xd801('0xd')](error[_0x14cf1d]);while(arguments[_0x383050]){_0x577763[_0xd801('0xd')](arguments[_0x383050]);_0x383050++;}_0x411e2a=util[_0xd801('0xe')][_0xd801('0xf')](util,_0x577763);this[_0xd801('0x10')]=_0x411e2a;this[_0xd801('0x11')]=_0x14cf1d;}module[_0xd801('0x12')]=AGIError; \ No newline at end of file +var _0xf273=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0xda60df,_0x59dee0){var _0x1d44bb=function(_0x487cea){while(--_0x487cea){_0xda60df['push'](_0xda60df['shift']());}};_0x1d44bb(++_0x59dee0);}(_0xf273,0x88));var _0x3f27=function(_0x704de0,_0x11a37a){_0x704de0=_0x704de0-0x0;var _0x465477=_0xf273[_0x704de0];return _0x465477;};'use strict';var util=require(_0x3f27('0x0'));var error={'E_AGI_UNDEFINED':_0x3f27('0x1'),'E_AGI_ARGUMENT_PORT':_0x3f27('0x2'),'E_AGI_SERVER_ERROR':_0x3f27('0x3'),'E_AGI_SERVER_CLOSE':_0x3f27('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x3f27('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x3f27('0x6'),'E_AGI_SOCKET_ERROR':_0x3f27('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x3f27('0x8'),'E_AGI_COMMAND_EMPTY':_0x3f27('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x3f27('0xa')};function AGIError(_0x394e2a){var _0x394e2a=_0x394e2a||null,_0x279045=_0x279045||[],_0x2d4fdb=0x1,_0x34bd37='';if(!error[_0x394e2a]){_0x394e2a=_0x3f27('0xb');}_0x279045['push'](error[_0x394e2a]);while(arguments[_0x2d4fdb]){_0x279045['push'](arguments[_0x2d4fdb]);_0x2d4fdb++;}_0x34bd37=util[_0x3f27('0xc')][_0x3f27('0xd')](util,_0x279045);this[_0x3f27('0xe')]=_0x34bd37;this[_0x3f27('0xf')]=_0x394e2a;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 896c2e7..ba3d14d 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 _0x5c11=['addVertex','addEdge','push','numberOfEdges','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','invalid','includes','condition\x20not\x20found','lodash','../../../config/logger','agi','getdigits','getsecretdigits','vertices','edges','prototype'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x5c11,0x1b8));var _0x15c1=function(_0x42003f,_0x1ac84a){_0x42003f=_0x42003f-0x0;var _0x371c69=_0x5c11[_0x42003f];return _0x371c69;};'use strict';var _=require(_0x15c1('0x0'));var logger=require(_0x15c1('0x1'))(_0x15c1('0x2'));var verticesWithRetry=['menu',_0x15c1('0x3'),_0x15c1('0x4')];var Graph=function(){this[_0x15c1('0x5')]={};this[_0x15c1('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x15c1('0x7')][_0x15c1('0x8')]=function(_0x426a74){this['vertices'][_0x426a74['id']]=_0x426a74;this[_0x15c1('0x6')][_0x426a74['id']]=[];};Graph['prototype'][_0x15c1('0x9')]=function(_0x3a30b8,_0x2e703a,_0x42aeda){this['edges'][_0x3a30b8][_0x15c1('0xa')]({'target':_0x2e703a,'condition':_0x42aeda});this[_0x15c1('0xb')]+=0x1;};Graph[_0x15c1('0x7')][_0x15c1('0xc')]=function(){return _[_0x15c1('0xc')](this[_0x15c1('0x5')]);};Graph[_0x15c1('0x7')]['relations']=function(){return this[_0x15c1('0xb')];};Graph['prototype'][_0x15c1('0xd')]=function(_0x2a7ed2){return this[_0x15c1('0x5')][_0x2a7ed2];};Graph[_0x15c1('0x7')][_0x15c1('0xe')]=function(_0x5d3465,_0x2856a9){if(!this[_0x15c1('0x5')][_0x5d3465]){return logger[_0x15c1('0xf')](_0x15c1('0x10'));}var _0xa4f664=_0x2856a9(this['vertices'][_0x5d3465]);if(!_0xa4f664){return logger['info'](_0x15c1('0x11'));}if(this[_0x15c1('0x6')][_0x5d3465][_0x15c1('0x12')]===0x0){return logger[_0x15c1('0xf')](_0x15c1('0x13'));}for(var _0x559e45=0x0,_0x20ae69=[],_0x2f73f6=![];_0x559e45\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','toString','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','lodash','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[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','target','addEdge','source','then','catch','indexOf','agi_','substring','debug','variables','stringify','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','response'];(function(_0x2371ee,_0x1d791e){var _0x8e4fb5=function(_0x5e0e37){while(--_0x5e0e37){_0x2371ee['push'](_0x2371ee['shift']());}};_0x8e4fb5(++_0x1d791e);}(_0x1140,0x17a));var _0x0114=function(_0x5b98d1,_0x3a230f){_0x5b98d1=_0x5b98d1-0x0;var _0x2f8388=_0x1140[_0x5b98d1];return _0x2f8388;};'use strict';var parser=require('xml2json');var _=require(_0x0114('0x0'));var syncho=require('syncho');var util=require('util');var moment=require(_0x0114('0x1'));var config=require(_0x0114('0x2'));var logger=require(_0x0114('0x3'))(_0x0114('0x4'));var utilLicense=require(_0x0114('0x5'));var rpc=require(_0x0114('0x6'));var mailRpc=require(_0x0114('0x7'));var Graph=require('./graph');var Vertices=require(_0x0114('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0114('0x4')]=_['defaults'](config[_0x0114('0x4')],{'ip':_0x0114('0x9'),'port':0x11dd});function connectionHandler(_0x1402fc){process[_0x0114('0xa')](function(){syncho(function(){try{setChannelVariables(_0x1402fc);agiHandler(_0x1402fc);}catch(_0x463fe6){logger[_0x0114('0xb')](_0x463fe6[_0x0114('0xc')]);}});});}function listeningHandler(){console[_0x0114('0xd')](_0x0114('0xe'),config[_0x0114('0x4')][_0x0114('0xf')]);logger[_0x0114('0x10')](util[_0x0114('0x11')](_0x0114('0x12'),config[_0x0114('0x4')]['ip'],config['agi'][_0x0114('0xf')]));}function errorHandler(_0x587c07){if(_0x587c07&&_0x587c07[_0x0114('0x13')]&&_0x587c07[_0x0114('0x14')]){logger[_0x0114('0xb')](util[_0x0114('0x11')]('[%s]\x20%s',_0x587c07[_0x0114('0x13')],_0x587c07[_0x0114('0x14')]));}else{logger['error'](util[_0x0114('0x11')]('[ERROR]\x20%s',_0x587c07['stack']));}}function closeHandler(){logger[_0x0114('0x10')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x0114('0x15')],this[_0x0114('0x16')],this[_0x0114('0x17')],this['dnid'],this[_0x0114('0x18')]));try{createSquareReport(this);}catch(_0x291ac3){logger[_0x0114('0xb')](_0x291ac3['stack']);}}function timeoutHandler(){logger['info'](util[_0x0114('0x11')](_0x0114('0x19'),this[_0x0114('0x15')],this[_0x0114('0x16')],this[_0x0114('0x17')],this[_0x0114('0x1a')],this[_0x0114('0x18')]));}function hangupHandler(){logger[_0x0114('0x10')](util['format'](_0x0114('0x1b'),this[_0x0114('0x15')],this[_0x0114('0x16')],this[_0x0114('0x17')],this[_0x0114('0x1a')],this[_0x0114('0x18')]));this[_0x0114('0x1c')]=!![];}function getRoot(_0x4aa880){return parser[_0x0114('0x1d')](_0x4aa880,{'object':!![]})[_0x0114('0x1e')][_0x0114('0x1f')];}function addVertex(_0x591231,_0x41e868,_0x25ff95){_0x41e868[_0x0114('0x20')]=_0x25ff95;if(_0x41e868[_0x0114('0x21')](_0x0114('0x22'))){_0x41e868[_0x0114('0x23')]=parseInt(_0x41e868[_0x0114('0x22')],0xa);}_0x591231[_0x0114('0x24')](_[_0x0114('0x25')](_0x41e868,_0x0114('0x26')));}function initGraph(_0x420f3b,_0x46770f){var _0x18fdae=new Graph();for(var _0x34704f in _0x420f3b){if(_0x420f3b['hasOwnProperty'](_0x34704f)){if(_[_0x0114('0x27')](_0x420f3b[_0x34704f])){for(var _0x5d5ed8=0x0;_0x5d5ed8<_0x420f3b[_0x34704f][_0x0114('0x28')];_0x5d5ed8+=0x1){addVertex(_0x18fdae,_0x420f3b[_0x34704f][_0x5d5ed8],_0x34704f);}}else{addVertex(_0x18fdae,_0x420f3b[_0x34704f],_0x34704f);}}}for(var _0x587900=0x0;_0x587900<_0x46770f[_0x0114('0x28')];_0x587900+=0x1){if(_0x46770f[_0x587900]['source']&&_0x46770f[_0x587900][_0x0114('0x29')]){_0x18fdae[_0x0114('0x2a')](_0x46770f[_0x587900][_0x0114('0x2b')],_0x46770f[_0x587900][_0x0114('0x29')],_0x46770f[_0x587900]['value']);}}return _0x18fdae;}function getSquareProject(_0x4e8548,_0x242117){rpc['getSquareProject'](_0x4e8548)[_0x0114('0x2c')](function(_0x362951){_0x242117(null,_0x362951);})[_0x0114('0x2d')](function(_0x4e2be6){_0x242117(null,_0x4e2be6);});}function createSquareReport(_0x56cd43,_0x1ec71d){rpc['createSquareReport'](_0x56cd43)['then'](function(_0x29014b){if(_0x1ec71d){_0x1ec71d(null,_0x29014b);}})[_0x0114('0x2d')](function(_0x171c08){if(_0x1ec71d){_0x1ec71d(null,_0x171c08);}});}function setChannelVariables(_0x265079){for(var _0x501740 in _0x265079){if(_0x265079[_0x0114('0x21')](_0x501740)){if(_0x501740[_0x0114('0x2e')](_0x0114('0x2f'))===0x0){_0x265079[_0x501740[_0x0114('0x30')](0x4)]=_0x265079[_0x501740];delete _0x265079[_0x501740];}}}}function getLogFromObject(_0x38e08e){return util['inspect'](_0x38e08e,{'showHidden':![],'depth':null});}function agiHandler(_0x1e934c){var _0x56cb3e,_0x5ccb68,_0xda0d1f,_0x256562,_0x24908d;logger[_0x0114('0x31')](_0x0114('0x32'),JSON[_0x0114('0x33')](_0x1e934c,null,0x2));logger[_0x0114('0x10')](util[_0x0114('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1e934c[_0x0114('0x15')],_0x1e934c[_0x0114('0x16')],_0x1e934c[_0x0114('0x17')],_0x1e934c[_0x0114('0x1a')],_0x1e934c[_0x0114('0x18')]));_0x1e934c['on']('error',errorHandler);_0x1e934c['on']('close',closeHandler);_0x1e934c['on']('timeout',timeoutHandler);_0x1e934c[_0x0114('0x1c')]=![];_0x1e934c['on'](_0x0114('0x34'),hangupHandler);var _0x290eb0=getSquareProject[_0x0114('0x35')](null,_0x1e934c[_0x0114('0x15')]);if(_0x290eb0){if(_0x290eb0[_0x0114('0x36')]){_0x56cb3e=getRoot(_0x290eb0[_0x0114('0x36')]);if(_0x56cb3e&&_0x56cb3e['start']){logger[_0x0114('0x31')]('root',JSON[_0x0114('0x33')](_0x56cb3e,null,0x2));_0x1e934c[_0x0114('0x37')]=moment()[_0x0114('0x11')](_0x0114('0x38'));_0x5ccb68=initGraph(_['omit'](_0x56cb3e,'mxCell'),_0x56cb3e['mxCell']);_0xda0d1f=new Vertices(_0x1e934c,rpc,mailRpc);logger[_0x0114('0x10')](util[_0x0114('0x11')](_0x0114('0x39'),_0x1e934c[_0x0114('0x15')],_0x1e934c[_0x0114('0x16')],_0x1e934c['callerid'],_0x1e934c[_0x0114('0x1a')],_0x1e934c[_0x0114('0x18')]));_0x5ccb68[_0x0114('0x3a')](_0x56cb3e[_0x0114('0x3b')]['id'],function(_0x7bcfb9){try{_0x7bcfb9=_0xda0d1f[_0x0114('0x3c')](_0x7bcfb9);logger[_0x0114('0x31')](_0x0114('0x3d'),JSON[_0x0114('0x33')](_0x7bcfb9,null,0x2));if(_0x7bcfb9[_0x0114('0x20')]===_0x0114('0x3e')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1e934c[_0x0114('0x3f')]=_0x7bcfb9[_0x0114('0x3f')]||_0x1e934c[_0x0114('0x3f')];_0x1e934c['extension']=_0x7bcfb9[_0x0114('0x40')];_0x1e934c['priority']=_0x7bcfb9[_0x0114('0x41')]?_0x7bcfb9[_0x0114('0x41')]-0x1:0x1;return null;}else if(_0x7bcfb9&&_0xda0d1f[_0x7bcfb9[_0x0114('0x20')]]){_0x24908d=_0xda0d1f[_0x7bcfb9[_0x0114('0x20')]](_0x7bcfb9);logger[_0x0114('0x10')](_0x0114('0x42'),JSON[_0x0114('0x33')](_0x24908d,null,0x2));if(_0x24908d&&_0x24908d[_0x0114('0x43')]===AGI_CODE_SUCCESS&&_0x24908d[_0x0114('0x44')]!==AGI_RESULT_ERROR&&!_0x1e934c[_0x0114('0x1c')]){logger[_0x0114('0x31')]('response',getLogFromObject(_0x24908d));return _[_0x0114('0x45')](_0x24908d[_0x0114('0x44')])?null:_0x24908d[_0x0114('0x44')]['toString']();}else{logger[_0x0114('0xb')]('response',getLogFromObject(_0x24908d));return null;}}else{logger[_0x0114('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x50ef8c){logger[_0x0114('0xb')](_0x50ef8c[_0x0114('0xc')]);return null;}});if(_0x56cb3e['finally']){logger[_0x0114('0x10')](util[_0x0114('0x11')](_0x0114('0x46'),_0x1e934c['arg_1'],_0x1e934c[_0x0114('0x16')],_0x1e934c[_0x0114('0x17')],_0x1e934c[_0x0114('0x1a')],_0x1e934c['uniqueid']));_0x5ccb68[_0x0114('0x3a')](_0x56cb3e[_0x0114('0x47')]['id'],function(_0x5891a4){try{_0x5891a4=_0xda0d1f[_0x0114('0x3c')](_0x5891a4);logger[_0x0114('0x31')](_0x0114('0x3d'),JSON[_0x0114('0x33')](_0x5891a4,null,0x2));if(_0x5891a4&&_0xda0d1f[_0x5891a4[_0x0114('0x20')]]){_0x24908d=_0xda0d1f[_0x5891a4['agicommand']](_0x5891a4);if(_0x24908d){logger[_0x0114('0x31')](_0x0114('0x42'),getLogFromObject(_0x24908d));return _['isUndefined'](_0x24908d[_0x0114('0x44')])?null:_0x24908d[_0x0114('0x44')][_0x0114('0x48')]();}else{logger['error']('response',getLogFromObject(_0x24908d));return null;}}else{logger[_0x0114('0xb')](_0x0114('0x49'));return null;}}catch(_0x63e256){logger[_0x0114('0xb')](_0x63e256[_0x0114('0xc')]);return null;}});}logger['info'](util[_0x0114('0x11')](_0x0114('0x4a'),_0x1e934c[_0x0114('0x15')],_0x1e934c['calleridname'],_0x1e934c['callerid'],_0x1e934c[_0x0114('0x1a')],_0x1e934c[_0x0114('0x18')]));logger[_0x0114('0x10')](util[_0x0114('0x11')](_0x0114('0x4b'),_0x1e934c['context'],_0x1e934c[_0x0114('0x40')],parseInt(_0x1e934c['priority'],0xa)+0x1));_0x1e934c[_0x0114('0x4c')](_0x1e934c['context'],_0x1e934c[_0x0114('0x40')],parseInt(_0x1e934c['priority'],0xa)+0x1);_0x1e934c['close']();}}else{logger['error'](util['format']('Project\x20%s\x20not\x20published',_0x1e934c['arg_1']));_0x1e934c['continueAt'](_0x1e934c[_0x0114('0x3f')],_0x1e934c['extension'],parseInt(_0x1e934c['priority'],0xa)+0x1);_0x1e934c[_0x0114('0x4d')]();}}else{logger[_0x0114('0xb')](util[_0x0114('0x11')](_0x0114('0x4e'),_0x1e934c[_0x0114('0x15')]));_0x1e934c[_0x0114('0x4c')](_0x1e934c[_0x0114('0x3f')],_0x1e934c[_0x0114('0x40')],parseInt(_0x1e934c['priority'],0xa)+0x1);_0x1e934c[_0x0114('0x4d')]();}}function main(){var _0x4110f3;return utilLicense[_0x0114('0x4f')]()[_0x0114('0x2c')](function(_0x35edcf){if(_0x35edcf){if(_0x35edcf[_0x0114('0x50')]){if(_0x35edcf['callysquare']&&_0x35edcf[_0x0114('0x51')]>0x0){logger['info'](util[_0x0114('0x11')](_0x0114('0x52'),_0x35edcf[_0x0114('0x51')]));_0x4110f3=_0x35edcf[_0x0114('0x51')];}else{logger[_0x0114('0x10')](_0x0114('0x53'));}}else{logger[_0x0114('0x10')](_0x0114('0x54'));_0x4110f3=-0x1;}}})[_0x0114('0x2d')](function(_0x2aed08){logger['error'](_0x0114('0x55'),_0x2aed08[_0x0114('0xc')]);})['finally'](function(){var _0x6dd7cb=require(_0x0114('0x56'))(config[_0x0114('0x4')][_0x0114('0xf')],config[_0x0114('0x4')]['ip'],_0x4110f3);_0x6dd7cb['on'](_0x0114('0xb'),errorHandler);_0x6dd7cb['on'](_0x0114('0x57'),listeningHandler);_0x6dd7cb['on'](_0x0114('0x58'),connectionHandler);_0x6dd7cb['on'](_0x0114('0x4d'),closeHandler);});}main(); \ No newline at end of file +var _0xc10e=['[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','lodash','syncho','util','moment','../../config/logger','agi','../../config/license/util','./rpc','./graph','defaults','nextTick','error','stack','log','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','calleridname','callerid','info','format','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','toJson','root','hasOwnProperty','retry','omit','mxCell','isArray','length','addEdge','source','target','value','getSquareProject','catch','then','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','context','extension','priority','agicommand','code','response','isUndefined','result','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x3c500c,_0x5acb5c){var _0x3c64a4=function(_0x7e5722){while(--_0x7e5722){_0x3c500c['push'](_0x3c500c['shift']());}};_0x3c64a4(++_0x5acb5c);}(_0xc10e,0x114));var _0xec10=function(_0x46abcd,_0x941a15){_0x46abcd=_0x46abcd-0x0;var _0x2cd077=_0xc10e[_0x46abcd];return _0x2cd077;};'use strict';var parser=require('xml2json');var _=require(_0xec10('0x0'));var syncho=require(_0xec10('0x1'));var util=require(_0xec10('0x2'));var moment=require(_0xec10('0x3'));var config=require('../../config/environment');var logger=require(_0xec10('0x4'))(_0xec10('0x5'));var utilLicense=require(_0xec10('0x6'));var rpc=require(_0xec10('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0xec10('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xec10('0x5')]=_[_0xec10('0x9')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x513e5d){process[_0xec10('0xa')](function(){syncho(function(){try{setChannelVariables(_0x513e5d);agiHandler(_0x513e5d);}catch(_0x539563){logger[_0xec10('0xb')](_0x539563[_0xec10('0xc')]);}});});}function listeningHandler(){console[_0xec10('0xd')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0xec10('0xe')]);logger['info'](util['format'](_0xec10('0xf'),config[_0xec10('0x5')]['ip'],config[_0xec10('0x5')][_0xec10('0xe')]));}function errorHandler(_0x532cbb){if(_0x532cbb&&_0x532cbb[_0xec10('0x10')]&&_0x532cbb[_0xec10('0x11')]){logger['error'](util['format'](_0xec10('0x12'),_0x532cbb['name'],_0x532cbb['message']));}else{logger[_0xec10('0xb')](util['format'](_0xec10('0x13'),_0x532cbb[_0xec10('0xc')]));}}function closeHandler(){logger['info'](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xec10('0x14')],this[_0xec10('0x15')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x2d1a99){logger[_0xec10('0xb')](_0x2d1a99[_0xec10('0xc')]);}}function timeoutHandler(){logger[_0xec10('0x16')](util[_0xec10('0x17')](_0xec10('0x18'),this[_0xec10('0x19')],this[_0xec10('0x14')],this['callerid'],this[_0xec10('0x1a')],this['uniqueid']));}function hangupHandler(){logger[_0xec10('0x16')](util[_0xec10('0x17')](_0xec10('0x1b'),this[_0xec10('0x19')],this['calleridname'],this[_0xec10('0x15')],this[_0xec10('0x1a')],this[_0xec10('0x1c')]));this[_0xec10('0x1d')]=!![];}function getRoot(_0x28000f){return parser[_0xec10('0x1e')](_0x28000f,{'object':!![]})['mxGraphModel'][_0xec10('0x1f')];}function addVertex(_0x4a344f,_0x1bec4f,_0xffd45b){_0x1bec4f['agicommand']=_0xffd45b;if(_0x1bec4f[_0xec10('0x20')](_0xec10('0x21'))){_0x1bec4f['maxRetry']=parseInt(_0x1bec4f[_0xec10('0x21')],0xa);}_0x4a344f['addVertex'](_[_0xec10('0x22')](_0x1bec4f,_0xec10('0x23')));}function initGraph(_0x5df0fe,_0x549888){var _0x367a51=new Graph();for(var _0x388a10 in _0x5df0fe){if(_0x5df0fe[_0xec10('0x20')](_0x388a10)){if(_[_0xec10('0x24')](_0x5df0fe[_0x388a10])){for(var _0xd4a14a=0x0;_0xd4a14a<_0x5df0fe[_0x388a10][_0xec10('0x25')];_0xd4a14a+=0x1){addVertex(_0x367a51,_0x5df0fe[_0x388a10][_0xd4a14a],_0x388a10);}}else{addVertex(_0x367a51,_0x5df0fe[_0x388a10],_0x388a10);}}}for(var _0x5c0934=0x0;_0x5c0934<_0x549888[_0xec10('0x25')];_0x5c0934+=0x1){if(_0x549888[_0x5c0934]['source']&&_0x549888[_0x5c0934]['target']){_0x367a51[_0xec10('0x26')](_0x549888[_0x5c0934][_0xec10('0x27')],_0x549888[_0x5c0934][_0xec10('0x28')],_0x549888[_0x5c0934][_0xec10('0x29')]);}}return _0x367a51;}function getSquareProject(_0x43daa6,_0x1ac4a0){rpc[_0xec10('0x2a')](_0x43daa6)['then'](function(_0x128735){_0x1ac4a0(null,_0x128735);})[_0xec10('0x2b')](function(_0x29ea5b){_0x1ac4a0(null,_0x29ea5b);});}function createSquareReport(_0x484fb8,_0x219848){rpc['createSquareReport'](_0x484fb8)[_0xec10('0x2c')](function(_0x1498e6){if(_0x219848){_0x219848(null,_0x1498e6);}})[_0xec10('0x2b')](function(_0x167b1d){if(_0x219848){_0x219848(null,_0x167b1d);}});}function setChannelVariables(_0xf8b761){for(var _0xab4a17 in _0xf8b761){if(_0xf8b761[_0xec10('0x20')](_0xab4a17)){if(_0xab4a17[_0xec10('0x2d')](_0xec10('0x2e'))===0x0){_0xf8b761[_0xab4a17[_0xec10('0x2f')](0x4)]=_0xf8b761[_0xab4a17];delete _0xf8b761[_0xab4a17];}}}}function getLogFromObject(_0x3092d5){return util[_0xec10('0x30')](_0x3092d5,{'showHidden':![],'depth':null});}function agiHandler(_0x5d4a55){var _0x2c531d,_0x554ea3,_0x41ab10,_0x16f703,_0x4723b9;logger[_0xec10('0x31')](_0xec10('0x32'),JSON[_0xec10('0x33')](_0x5d4a55,null,0x2));logger[_0xec10('0x16')](util['format'](_0xec10('0x34'),_0x5d4a55['arg_1'],_0x5d4a55[_0xec10('0x14')],_0x5d4a55[_0xec10('0x15')],_0x5d4a55['dnid'],_0x5d4a55[_0xec10('0x1c')]));_0x5d4a55['on'](_0xec10('0xb'),errorHandler);_0x5d4a55['on'](_0xec10('0x35'),closeHandler);_0x5d4a55['on'](_0xec10('0x36'),timeoutHandler);_0x5d4a55['evtHangup']=![];_0x5d4a55['on'](_0xec10('0x37'),hangupHandler);var _0x4a4187=getSquareProject[_0xec10('0x38')](null,_0x5d4a55['arg_1']);if(_0x4a4187){if(_0x4a4187['production']){_0x2c531d=getRoot(_0x4a4187[_0xec10('0x39')]);if(_0x2c531d&&_0x2c531d[_0xec10('0x3a')]){logger[_0xec10('0x31')]('root',JSON[_0xec10('0x33')](_0x2c531d,null,0x2));_0x5d4a55[_0xec10('0x3b')]=moment()[_0xec10('0x17')]('YYYY-MM-DD\x20HH:mm:ss');_0x554ea3=initGraph(_['omit'](_0x2c531d,'mxCell'),_0x2c531d['mxCell']);_0x41ab10=new Vertices(_0x5d4a55,rpc,mailRpc);logger['info'](util[_0xec10('0x17')](_0xec10('0x3c'),_0x5d4a55[_0xec10('0x19')],_0x5d4a55[_0xec10('0x14')],_0x5d4a55[_0xec10('0x15')],_0x5d4a55[_0xec10('0x1a')],_0x5d4a55['uniqueid']));_0x554ea3['traverseBFS'](_0x2c531d[_0xec10('0x3a')]['id'],function(_0x4591d7){try{_0x4591d7=_0x41ab10[_0xec10('0x3d')](_0x4591d7);logger[_0xec10('0x31')](_0xec10('0x3e'),JSON[_0xec10('0x33')](_0x4591d7,null,0x2));if(_0x4591d7['agicommand']==='gotoc'){logger[_0xec10('0x16')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x5d4a55[_0xec10('0x3f')]=_0x4591d7['context']||_0x5d4a55[_0xec10('0x3f')];_0x5d4a55[_0xec10('0x40')]=_0x4591d7['extension'];_0x5d4a55['priority']=_0x4591d7[_0xec10('0x41')]?_0x4591d7[_0xec10('0x41')]-0x1:0x1;return null;}else if(_0x4591d7&&_0x41ab10[_0x4591d7[_0xec10('0x42')]]){_0x4723b9=_0x41ab10[_0x4591d7[_0xec10('0x42')]](_0x4591d7);logger['info']('response',JSON[_0xec10('0x33')](_0x4723b9,null,0x2));if(_0x4723b9&&_0x4723b9[_0xec10('0x43')]===AGI_CODE_SUCCESS&&_0x4723b9['result']!==AGI_RESULT_ERROR&&!_0x5d4a55['evtHangup']){logger[_0xec10('0x31')](_0xec10('0x44'),getLogFromObject(_0x4723b9));return _[_0xec10('0x45')](_0x4723b9['result'])?null:_0x4723b9[_0xec10('0x46')]['toString']();}else{logger[_0xec10('0xb')](_0xec10('0x44'),getLogFromObject(_0x4723b9));return null;}}else{logger[_0xec10('0xb')](_0xec10('0x47'));return null;}}catch(_0x380e02){logger[_0xec10('0xb')](_0x380e02[_0xec10('0xc')]);return null;}});if(_0x2c531d['finally']){logger[_0xec10('0x16')](util[_0xec10('0x17')](_0xec10('0x48'),_0x5d4a55[_0xec10('0x19')],_0x5d4a55['calleridname'],_0x5d4a55['callerid'],_0x5d4a55[_0xec10('0x1a')],_0x5d4a55[_0xec10('0x1c')]));_0x554ea3['traverseBFS'](_0x2c531d[_0xec10('0x49')]['id'],function(_0x1e0123){try{_0x1e0123=_0x41ab10[_0xec10('0x3d')](_0x1e0123);logger[_0xec10('0x31')](_0xec10('0x3e'),JSON[_0xec10('0x33')](_0x1e0123,null,0x2));if(_0x1e0123&&_0x41ab10[_0x1e0123[_0xec10('0x42')]]){_0x4723b9=_0x41ab10[_0x1e0123[_0xec10('0x42')]](_0x1e0123);if(_0x4723b9){logger[_0xec10('0x31')](_0xec10('0x44'),getLogFromObject(_0x4723b9));return _[_0xec10('0x45')](_0x4723b9[_0xec10('0x46')])?null:_0x4723b9[_0xec10('0x46')][_0xec10('0x4a')]();}else{logger[_0xec10('0xb')](_0xec10('0x44'),getLogFromObject(_0x4723b9));return null;}}else{logger[_0xec10('0xb')](_0xec10('0x47'));return null;}}catch(_0x38cc22){logger['error'](_0x38cc22['stack']);return null;}});}logger['info'](util[_0xec10('0x17')](_0xec10('0x4b'),_0x5d4a55[_0xec10('0x19')],_0x5d4a55[_0xec10('0x14')],_0x5d4a55[_0xec10('0x15')],_0x5d4a55[_0xec10('0x1a')],_0x5d4a55[_0xec10('0x1c')]));logger[_0xec10('0x16')](util[_0xec10('0x17')](_0xec10('0x4c'),_0x5d4a55[_0xec10('0x3f')],_0x5d4a55[_0xec10('0x40')],parseInt(_0x5d4a55[_0xec10('0x41')],0xa)+0x1));_0x5d4a55['continueAt'](_0x5d4a55['context'],_0x5d4a55[_0xec10('0x40')],parseInt(_0x5d4a55[_0xec10('0x41')],0xa)+0x1);_0x5d4a55[_0xec10('0x35')]();}}else{logger[_0xec10('0xb')](util[_0xec10('0x17')]('Project\x20%s\x20not\x20published',_0x5d4a55['arg_1']));_0x5d4a55[_0xec10('0x4d')](_0x5d4a55[_0xec10('0x3f')],_0x5d4a55[_0xec10('0x40')],parseInt(_0x5d4a55[_0xec10('0x41')],0xa)+0x1);_0x5d4a55[_0xec10('0x35')]();}}else{logger[_0xec10('0xb')](util['format'](_0xec10('0x4e'),_0x5d4a55[_0xec10('0x19')]));_0x5d4a55['continueAt'](_0x5d4a55[_0xec10('0x3f')],_0x5d4a55['extension'],parseInt(_0x5d4a55[_0xec10('0x41')],0xa)+0x1);_0x5d4a55['close']();}}function main(){var _0x2289de;return utilLicense[_0xec10('0x4f')]()[_0xec10('0x2c')](function(_0x1bd3c3){if(_0x1bd3c3){if(_0x1bd3c3[_0xec10('0x50')]){if(_0x1bd3c3[_0xec10('0x51')]&&_0x1bd3c3[_0xec10('0x51')]>0x0){logger[_0xec10('0x16')](util['format'](_0xec10('0x52'),_0x1bd3c3[_0xec10('0x51')]));_0x2289de=_0x1bd3c3['callysquare'];}else{logger[_0xec10('0x16')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xec10('0x16')](_0xec10('0x53'));_0x2289de=-0x1;}}})[_0xec10('0x2b')](function(_0x4844e9){logger[_0xec10('0xb')](_0xec10('0x54'),_0x4844e9['stack']);})[_0xec10('0x49')](function(){var _0x1288db=require(_0xec10('0x55'))(config[_0xec10('0x5')][_0xec10('0xe')],config['agi']['ip'],_0x2289de);_0x1288db['on'](_0xec10('0xb'),errorHandler);_0x1288db['on'](_0xec10('0x56'),listeningHandler);_0x1288db['on'](_0xec10('0x57'),connectionHandler);_0x1288db['on'](_0xec10('0x35'),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 5e42a67..bf9f306 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 _0xa025=['error','message','result','catch','SendMail','bluebird','jayson/promise','http','request','then'];(function(_0x550651,_0x32926b){var _0x53edcf=function(_0x1ebc42){while(--_0x1ebc42){_0x550651['push'](_0x550651['shift']());}};_0x53edcf(++_0x32926b);}(_0xa025,0x11d));var _0x5a02=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0xa025[_0x4d40dd];return _0x1c51f2;};'use strict';var BPromise=require(_0x5a02('0x0'));var jayson=require(_0x5a02('0x1'));var client=jayson['client'][_0x5a02('0x2')]({'port':0x232b});function request(_0x4579b6,_0x5e3475){return new BPromise(function(_0x330a2b,_0x5480c0){return client[_0x5a02('0x3')](_0x4579b6,_0x5e3475)[_0x5a02('0x4')](function(_0x28aa0e){if(_0x28aa0e[_0x5a02('0x5')]){return _0x5480c0(_0x28aa0e['error'][_0x5a02('0x6')]);}else{return _0x330a2b(_0x28aa0e[_0x5a02('0x7')]);}})[_0x5a02('0x8')](function(_0x2183e9){return _0x5480c0(_0x2183e9);});});}exports['sendMailMessage']=function(_0x1b3194,_0x4a81d1){return request(_0x5a02('0x9'),{'account':_0x1b3194,'message':_0x4a81d1});}; \ No newline at end of file +var _0x3196=['client','http','request','then','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x1a6c7f,_0x5aee3f){var _0x1d378d=function(_0x3faee3){while(--_0x3faee3){_0x1a6c7f['push'](_0x1a6c7f['shift']());}};_0x1d378d(++_0x5aee3f);}(_0x3196,0xb2));var _0x6319=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3196[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x6319('0x0'));var jayson=require(_0x6319('0x1'));var client=jayson[_0x6319('0x2')][_0x6319('0x3')]({'port':0x232b});function request(_0x10be6d,_0x472616){return new BPromise(function(_0x20d45a,_0x449105){return client[_0x6319('0x4')](_0x10be6d,_0x472616)[_0x6319('0x5')](function(_0x419824){if(_0x419824[_0x6319('0x6')]){return _0x449105(_0x419824[_0x6319('0x6')]['message']);}else{return _0x20d45a(_0x419824['result']);}})[_0x6319('0x7')](function(_0x565599){return _0x449105(_0x565599);});});}exports[_0x6319('0x8')]=function(_0x28b0c4,_0x49b3f9){return request(_0x6319('0x9'),{'account':_0x28b0c4,'message':_0x49b3f9});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 368d7a5..4937087 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 _0x42c8=['substring','length','slice','emit','headers','exports','Transform','call','_localBuffer','inherits','\x0d\x0a\x0d\x0a','toString','_inBody','indexOf'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x42c8,0x110));var _0x842c=function(_0xcd07c,_0x8f566c){_0xcd07c=_0xcd07c-0x0;var _0xb99e27=_0x42c8[_0xcd07c];return _0xb99e27;};'use strict';var util=require('util');var Transform=require('stream')[_0x842c('0x0')];function AGIReply(_0x3e4daa){Transform[_0x842c('0x1')](this,_0x3e4daa);this[_0x842c('0x2')]='';this['_inBody']=![];}util[_0x842c('0x3')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x177bb6,_0x118474,_0x3ed37b){var _0x21b1e7='\x0a',_0x194568=['\x0a\x0a',_0x842c('0x4')],_0x4a4aa7=-0x1,_0x3837e5=-0x1,_0xe76956='',_0x79540c=0x0,_0x38646f='',_0x33eeeb='';this[_0x842c('0x2')]+=_0x177bb6[_0x842c('0x5')]();_0x38646f=this[_0x842c('0x2')];if(!this[_0x842c('0x6')]){_0x79540c=0x0;while(_0x194568[_0x79540c]){while((_0x3837e5=_0x38646f[_0x842c('0x7')](_0x194568[_0x79540c]))!=-0x1){_0xe76956=_0x194568[_0x79540c];_0x33eeeb=_0x38646f[_0x842c('0x8')](0x0,_0x3837e5);_0x38646f=_0x38646f[_0x842c('0x8')](_0x3837e5+_0xe76956[_0x842c('0x9')]);var _0x224bef=_0x33eeeb['split'](_0x21b1e7),_0x109ba5=0x0,_0x2c8c2b={},_0x22a3eb='',_0x46df7d='',_0x19bb15=-0x1;while(_0x224bef[_0x109ba5]){_0x19bb15=_0x224bef[_0x109ba5][_0x842c('0x7')](':');if(_0x19bb15!=-0x1){_0x22a3eb=_0x224bef[_0x109ba5][_0x842c('0xa')](0x0,_0x19bb15)['trim']();_0x46df7d=_0x224bef[_0x109ba5][_0x842c('0xa')](_0x19bb15+0x1)['trim']();if(_0x22a3eb[_0x842c('0x9')]>0x0){_0x2c8c2b[_0x22a3eb]=_0x46df7d;}}else{}_0x109ba5++;}this[_0x842c('0xb')](_0x842c('0xc'),_0x2c8c2b);this['_inBody']=!![];}_0x79540c++;}this['_localBuffer']=_0x38646f;}else{while((_0x4a4aa7=_0x38646f[_0x842c('0x7')](_0x21b1e7))!=-0x1){_0x33eeeb=_0x38646f[_0x842c('0x8')](0x0,_0x4a4aa7);this[_0x842c('0xb')]('line',_0x33eeeb);_0x38646f=_0x38646f[_0x842c('0x8')](_0x4a4aa7+_0x21b1e7[_0x842c('0x9')]);}this[_0x842c('0x2')]=_0x38646f;}_0x3ed37b();};module[_0x842c('0xd')]=AGIReply; \ No newline at end of file +var _0xf6d5=['stream','_localBuffer','inherits','prototype','_inBody','indexOf','substring','length','slice','trim','headers','line','exports','util'];(function(_0x2bf163,_0xf8ee26){var _0x398cc8=function(_0x574b3f){while(--_0x574b3f){_0x2bf163['push'](_0x2bf163['shift']());}};_0x398cc8(++_0xf8ee26);}(_0xf6d5,0x15d));var _0x5f6d=function(_0x15d950,_0x5a2882){_0x15d950=_0x15d950-0x0;var _0x5b2bb4=_0xf6d5[_0x15d950];return _0x5b2bb4;};'use strict';var util=require(_0x5f6d('0x0'));var Transform=require(_0x5f6d('0x1'))['Transform'];function AGIReply(_0x54f6c6){Transform['call'](this,_0x54f6c6);this[_0x5f6d('0x2')]='';this['_inBody']=![];}util[_0x5f6d('0x3')](AGIReply,Transform);AGIReply[_0x5f6d('0x4')]['_transform']=function(_0x54c665,_0x258580,_0x526836){var _0x43f7b2='\x0a',_0x3491a2=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4bcb4f=-0x1,_0x54f409=-0x1,_0x288416='',_0x1a8912=0x0,_0x2c139a='',_0x6e78cf='';this[_0x5f6d('0x2')]+=_0x54c665['toString']();_0x2c139a=this['_localBuffer'];if(!this[_0x5f6d('0x5')]){_0x1a8912=0x0;while(_0x3491a2[_0x1a8912]){while((_0x54f409=_0x2c139a[_0x5f6d('0x6')](_0x3491a2[_0x1a8912]))!=-0x1){_0x288416=_0x3491a2[_0x1a8912];_0x6e78cf=_0x2c139a[_0x5f6d('0x7')](0x0,_0x54f409);_0x2c139a=_0x2c139a[_0x5f6d('0x7')](_0x54f409+_0x288416[_0x5f6d('0x8')]);var _0x27ca44=_0x6e78cf['split'](_0x43f7b2),_0x23ea74=0x0,_0x2f475c={},_0x265533='',_0x49a6b8='',_0x1a21d8=-0x1;while(_0x27ca44[_0x23ea74]){_0x1a21d8=_0x27ca44[_0x23ea74]['indexOf'](':');if(_0x1a21d8!=-0x1){_0x265533=_0x27ca44[_0x23ea74][_0x5f6d('0x9')](0x0,_0x1a21d8)[_0x5f6d('0xa')]();_0x49a6b8=_0x27ca44[_0x23ea74][_0x5f6d('0x9')](_0x1a21d8+0x1)[_0x5f6d('0xa')]();if(_0x265533[_0x5f6d('0x8')]>0x0){_0x2f475c[_0x265533]=_0x49a6b8;}}else{}_0x23ea74++;}this['emit'](_0x5f6d('0xb'),_0x2f475c);this[_0x5f6d('0x5')]=!![];}_0x1a8912++;}this[_0x5f6d('0x2')]=_0x2c139a;}else{while((_0x4bcb4f=_0x2c139a[_0x5f6d('0x6')](_0x43f7b2))!=-0x1){_0x6e78cf=_0x2c139a[_0x5f6d('0x7')](0x0,_0x4bcb4f);this['emit'](_0x5f6d('0xc'),_0x6e78cf);_0x2c139a=_0x2c139a[_0x5f6d('0x7')](_0x4bcb4f+_0x43f7b2[_0x5f6d('0x8')]);}this['_localBuffer']=_0x2c139a;}_0x526836();};module[_0x5f6d('0xd')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 157e22a..21ba021 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 _0x2e8f=['error','result','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','name','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','getIntervalById','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','LogoutUser','moment','lodash','util','jayson/promise','client','http','request','then'];(function(_0x2c9885,_0x2433b0){var _0x5af6e2=function(_0xb035c){while(--_0xb035c){_0x2c9885['push'](_0x2c9885['shift']());}};_0x5af6e2(++_0x2433b0);}(_0x2e8f,0x1de));var _0xf2e8=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x2e8f[_0x8c43de];return _0xa6591b;};'use strict';var BPromise=require('bluebird');var moment=require(_0xf2e8('0x0'));var _=require(_0xf2e8('0x1'));var util=require(_0xf2e8('0x2'));var jayson=require(_0xf2e8('0x3'));var client=jayson[_0xf2e8('0x4')][_0xf2e8('0x5')]({'port':0x2329});function request(_0x177789,_0x4b7945){return new BPromise(function(_0x307e66,_0x2bbfb2){return client[_0xf2e8('0x6')](_0x177789,_0x4b7945)[_0xf2e8('0x7')](function(_0x2aea3c){if(_0x2aea3c[_0xf2e8('0x8')]){return _0x2bbfb2(_0x2aea3c[_0xf2e8('0x8')]['message']);}else{return _0x307e66(_0x2aea3c[_0xf2e8('0x9')]);}})['catch'](function(_0x3f0519){return _0x2bbfb2(_0x3f0519);});});}exports[_0xf2e8('0xa')]=function(_0x293995){return request(_0xf2e8('0xb'),{'options':{'raw':![],'where':{'name':_0x293995},'attributes':[_0xf2e8('0xc')]}});};exports['getMailAccountById']=function(_0x57f1f7){return request(_0xf2e8('0xd'),{'options':{'raw':![],'where':{'id':_0x57f1f7},'include':[{'model':_0xf2e8('0xe'),'as':'Smtp'}],'attributes':['id',_0xf2e8('0xf'),'email']}});};exports[_0xf2e8('0x10')]=function(_0x32b301){return request(_0xf2e8('0xb'),{'options':{'where':{'id':_0x32b301},'attributes':[_0xf2e8('0xf')]}});};exports[_0xf2e8('0x11')]=function(_0x1d91eb){return request(_0xf2e8('0x12'),{'options':{'where':{'id':_0x1d91eb},'attributes':[_0xf2e8('0xf')]}});};exports[_0xf2e8('0x13')]=function(_0x521633){return request(_0xf2e8('0x14'),{'options':{'where':{'id':_0x521633},'attributes':[_0xf2e8('0xf')]}});};exports[_0xf2e8('0x15')]=function(_0x18e83a){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x18e83a},'attributes':[_0xf2e8('0x16')]}});};exports[_0xf2e8('0x17')]=function(_0x3edabc){return request(_0xf2e8('0x18'),{'options':{'where':{'id':_0x3edabc},'attributes':[_0xf2e8('0xf')]}});};exports[_0xf2e8('0x19')]=function(_0x382fb0){return request(_0xf2e8('0x1a'),{'options':{'where':{'id':_0x382fb0},'attributes':[_0xf2e8('0xf')]}});};exports[_0xf2e8('0x1b')]=function(_0x518cdb){return request('ShowSound',{'options':{'where':{'id':_0x518cdb},'attributes':['save_name']}});};exports[_0xf2e8('0x1c')]=function(_0x53e626){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x53e626},'include':[{'model':_0xf2e8('0x1d'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x80c85e){return request(_0xf2e8('0x1e'),{'options':{'where':{'id':_0x80c85e},'attributes':['id','name']}});};exports[_0xf2e8('0x1f')]=function(_0x53ee71){return request(_0xf2e8('0x20'),{'body':_0x53ee71});};exports['createSquareDetailsReport']=function(_0x4067e6){return request(_0xf2e8('0x21'),{'body':_0x4067e6});};exports[_0xf2e8('0x22')]=function(_0x2bcb4a){return request(_0xf2e8('0x23'),{'body':_[_0xf2e8('0x24')](_0x2bcb4a,{'project_name':_0x2bcb4a['arg_1'],'prev_project_name':_0x2bcb4a[_0xf2e8('0x25')]||'','is_subproject':_0x2bcb4a[_0xf2e8('0x25')]?!![]:![],'leaveAt':moment()[_0xf2e8('0x26')](_0xf2e8('0x27'))})});};exports['createSquareRecording']=function(_0x1cc3d9){return request(_0xf2e8('0x28'),{'body':_0x1cc3d9});};exports[_0xf2e8('0x29')]=function(_0x2ba6d6){return request('CreateSquareMessage',{'body':_0x2ba6d6});};exports[_0xf2e8('0x2a')]=function(_0x1e7ca6){return request(_0xf2e8('0x2b'),{'options':{'raw':![],'where':{'phone':_0x1e7ca6[_0xf2e8('0x2c')],'ListId':_0x1e7ca6[_0xf2e8('0x2d')]}}})['then'](function(_0x2763db){if(_0x2763db){return _0x2763db;}return request(_0xf2e8('0x2e'),{'body':_0x1e7ca6});});};exports['getPauseById']=function(_0x430469){return request(_0xf2e8('0x2f'),{'options':{'where':{'id':_0x430469},'attributes':['name']}});};exports[_0xf2e8('0x30')]=function(_0x3c4051,_0x951581){return request(_0xf2e8('0x31'),{'body':{'interface':_0x951581},'options':{'where':_0x3c4051}});};exports[_0xf2e8('0x32')]=function(_0x1edc9f,_0x29a5f8,_0x32a246){return request('PauseUser',{'body':{'type':_0x29a5f8,'uniqueid':_0x32a246},'options':{'where':_0x1edc9f}});};exports[_0xf2e8('0x33')]=function(_0x14c5b1){return request(_0xf2e8('0x34'),{'body':{},'options':{'where':_0x14c5b1}});};exports['agentLogout']=function(_0x415b94){return request(_0xf2e8('0x35'),{'body':{},'options':{'where':_0x415b94}});}; \ No newline at end of file +var _0x8975=['createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','request','then','error','message','result','catch','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount'];(function(_0x2343a9,_0x79421c){var _0x205534=function(_0x45d85c){while(--_0x45d85c){_0x2343a9['push'](_0x2343a9['shift']());}};_0x205534(++_0x79421c);}(_0x8975,0x1a9));var _0x5897=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8975[_0x17d9e3];return _0x14192d;};'use strict';var BPromise=require(_0x5897('0x0'));var moment=require(_0x5897('0x1'));var _=require(_0x5897('0x2'));var util=require('util');var jayson=require(_0x5897('0x3'));var client=jayson[_0x5897('0x4')]['http']({'port':0x2329});function request(_0xc61fde,_0x389fa8){return new BPromise(function(_0xc59ddd,_0x1c8313){return client[_0x5897('0x5')](_0xc61fde,_0x389fa8)[_0x5897('0x6')](function(_0x174f3c){if(_0x174f3c[_0x5897('0x7')]){return _0x1c8313(_0x174f3c[_0x5897('0x7')][_0x5897('0x8')]);}else{return _0xc59ddd(_0x174f3c[_0x5897('0x9')]);}})[_0x5897('0xa')](function(_0x388650){return _0x1c8313(_0x388650);});});}exports['getSquareProject']=function(_0x420abc){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x420abc},'attributes':[_0x5897('0xb')]}});};exports[_0x5897('0xc')]=function(_0x1dfd01){return request(_0x5897('0xd'),{'options':{'raw':![],'where':{'id':_0x1dfd01},'include':[{'model':'MailServerOut','as':_0x5897('0xe')}],'attributes':['id',_0x5897('0xf'),_0x5897('0x10')]}});};exports['getSquareProjectById']=function(_0x25aad8){return request('ShowSquareProject',{'options':{'where':{'id':_0x25aad8},'attributes':[_0x5897('0xf')]}});};exports[_0x5897('0x11')]=function(_0x2f2124){return request(_0x5897('0x12'),{'options':{'where':{'id':_0x2f2124},'attributes':[_0x5897('0xf')]}});};exports[_0x5897('0x13')]=function(_0x38995b){return request('ShowVariable',{'options':{'where':{'id':_0x38995b},'attributes':[_0x5897('0xf')]}});};exports[_0x5897('0x14')]=function(_0x43c7e3){return request(_0x5897('0x15'),{'options':{'where':{'id':_0x43c7e3},'attributes':[_0x5897('0x16')]}});};exports['getUserById']=function(_0x58768f){return request('ShowUser',{'options':{'where':{'id':_0x58768f},'attributes':['name']}});};exports['getTrunkById']=function(_0x3db103){return request(_0x5897('0x17'),{'options':{'where':{'id':_0x3db103},'attributes':[_0x5897('0xf')]}});};exports['getSoundById']=function(_0x47d875){return request(_0x5897('0x18'),{'options':{'where':{'id':_0x47d875},'attributes':[_0x5897('0x19')]}});};exports[_0x5897('0x1a')]=function(_0x398724){return request(_0x5897('0x1b'),{'options':{'raw':![],'where':{'id':_0x398724},'include':[{'model':_0x5897('0x1c'),'as':_0x5897('0x1d')}]}});};exports['getSmsAccountById']=function(_0x501b65){return request(_0x5897('0x1e'),{'options':{'where':{'id':_0x501b65},'attributes':['id',_0x5897('0xf')]}});};exports[_0x5897('0x1f')]=function(_0x53c3e0){return request(_0x5897('0x20'),{'body':_0x53c3e0});};exports[_0x5897('0x21')]=function(_0x228d01){return request(_0x5897('0x22'),{'body':_0x228d01});};exports[_0x5897('0x23')]=function(_0x7fcd73){return request(_0x5897('0x24'),{'body':_[_0x5897('0x25')](_0x7fcd73,{'project_name':_0x7fcd73[_0x5897('0x26')],'prev_project_name':_0x7fcd73[_0x5897('0x27')]||'','is_subproject':_0x7fcd73['arg_2']?!![]:![],'leaveAt':moment()[_0x5897('0x28')](_0x5897('0x29'))})});};exports[_0x5897('0x2a')]=function(_0x1844b1){return request(_0x5897('0x2b'),{'body':_0x1844b1});};exports['createSquareMessage']=function(_0x398f6d){return request(_0x5897('0x2c'),{'body':_0x398f6d});};exports['createCmContact']=function(_0x3b772a){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3b772a[_0x5897('0x2d')],'ListId':_0x3b772a[_0x5897('0x2e')]}}})['then'](function(_0x511ce3){if(_0x511ce3){return _0x511ce3;}return request('CreateCmContact',{'body':_0x3b772a});});};exports[_0x5897('0x2f')]=function(_0x257123){return request(_0x5897('0x30'),{'options':{'where':{'id':_0x257123},'attributes':[_0x5897('0xf')]}});};exports[_0x5897('0x31')]=function(_0x2bd656,_0x21637e){return request(_0x5897('0x32'),{'body':{'interface':_0x21637e},'options':{'where':_0x2bd656}});};exports[_0x5897('0x33')]=function(_0x6f80e2,_0x485b61,_0x21aee0){return request(_0x5897('0x34'),{'body':{'type':_0x485b61,'uniqueid':_0x21aee0},'options':{'where':_0x6f80e2}});};exports[_0x5897('0x35')]=function(_0xe83b39){return request(_0x5897('0x36'),{'body':{},'options':{'where':_0xe83b39}});};exports[_0x5897('0x37')]=function(_0x3ec493){return request(_0x5897('0x38'),{'body':{},'options':{'where':_0x3ec493}});}; \ 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 94977b0..fd1afb2 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 _0xc1db=['./polly','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc1db,0x120));var _0xbc1d=function(_0x4044ad,_0x4cc86f){_0x4044ad=_0x4044ad-0x0;var _0x4a01ca=_0xc1db[_0x4044ad];return _0x4a01ca;};var polly=require(_0xbc1d('0x0'));var lex=require('./lex');module[_0xbc1d('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x7d9f=['./polly','./lex','exports'];(function(_0x3a0f28,_0x29376){var _0x17110a=function(_0x37c1c0){while(--_0x37c1c0){_0x3a0f28['push'](_0x3a0f28['shift']());}};_0x17110a(++_0x29376);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x2e5069,_0x3a1115){_0x2e5069=_0x2e5069-0x0;var _0x2f00ad=_0x7d9f[_0x2e5069];return _0x2f00ad;};var polly=require(_0xf7d9('0x0'));var lex=require(_0xf7d9('0x1'));module[_0xf7d9('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index cca36d4..183e1d3 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 _0xf4eb=['./lib/api'];(function(_0x45cd59,_0x5be7c0){var _0x39541a=function(_0xab724a){while(--_0xab724a){_0x45cd59['push'](_0x45cd59['shift']());}};_0x39541a(++_0x5be7c0);}(_0xf4eb,0xec));var _0xbf4e=function(_0x344cfe,_0x19547e){_0x344cfe=_0x344cfe-0x0;var _0x9e5a58=_0xf4eb[_0x344cfe];return _0x9e5a58;};'use strict';var lex=require(_0xbf4e('0x0'));module['exports']=function(_0x50f2fc,_0x479210,_0x5ed5b9,_0xbbbf01,_0x49d80e,_0x4e7fa7){return lex(_0x50f2fc,_0x479210,_0x5ed5b9,_0xbbbf01,_0x49d80e,_0x4e7fa7);}; \ No newline at end of file +var _0xec56=['./lib/api'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xec56,0x1bd));var _0x6ec5=function(_0x23b72b,_0x30a8a4){_0x23b72b=_0x23b72b-0x0;var _0x3b586a=_0xec56[_0x23b72b];return _0x3b586a;};'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 8563e6a..2a8f4cb 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(_0x2bc5d5,_0x4411d0){var _0x43b25c=function(_0x3fc169){while(--_0x3fc169){_0x2bc5d5['push'](_0x2bc5d5['shift']());}};_0x43b25c(++_0x4411d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x1ef9bd,_0x2897ac){var _0x1528ba=function(_0x4c7747){while(--_0x4c7747){_0x1ef9bd['push'](_0x1ef9bd['shift']());}};_0x1528ba(++_0x2897ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 762c119..ed005e2 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 _0x4e46=['exports'];(function(_0x46a287,_0x5ed8bd){var _0x49dc77=function(_0x448ee4){while(--_0x448ee4){_0x46a287['push'](_0x46a287['shift']());}};_0x49dc77(++_0x5ed8bd);}(_0x4e46,0xeb));var _0x64e4=function(_0x4d0339,_0x27af62){_0x4d0339=_0x4d0339-0x0;var _0x1b3d83=_0x4e46[_0x4d0339];return _0x1b3d83;};'use strict';var polly=require('./lib/api');module[_0x64e4('0x0')]=function(_0x18881f,_0x319a27,_0x360ab5,_0x381979,_0x2af80d,_0x1ec980,_0x550f4f){return polly(_0x18881f,_0x319a27,_0x360ab5,_0x381979,_0x2af80d,_0x1ec980,_0x550f4f);}; \ No newline at end of file +var _0x263f=['exports','./lib/api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x263f,0x1f3));var _0xf263=function(_0x129071,_0x360dba){_0x129071=_0x129071-0x0;var _0x4edaab=_0x263f[_0x129071];return _0x4edaab;};'use strict';var polly=require(_0xf263('0x0'));module[_0xf263('0x1')]=function(_0x24fa68,_0x19af27,_0x8c4d8f,_0x4c68b3,_0x257db4,_0x2cfa39,_0x48d302){return polly(_0x24fa68,_0x19af27,_0x8c4d8f,_0x4c68b3,_0x257db4,_0x2cfa39,_0x48d302);}; \ 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 6f4ebf4..01f29b2 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 _0x5b8d=['Polly','text','mp3','path','randomstring','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x2e5d2a,_0x1795fb){var _0x5ebeeb=function(_0x3ad815){while(--_0x3ad815){_0x2e5d2a['push'](_0x2e5d2a['shift']());}};_0x5ebeeb(++_0x1795fb);}(_0x5b8d,0x1e9));var _0xd5b8=function(_0x542d1c,_0xefd282){_0x542d1c=_0x542d1c-0x0;var _0x58d8aa=_0x5b8d[_0x542d1c];return _0x58d8aa;};'use strict';var fs=require('fs');var path=require(_0xd5b8('0x0'));var BPromise=require('bluebird');var rs=require(_0xd5b8('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x78b7ce,_0x94049e,_0xdb4e1){return new BPromise(function(_0x261e92,_0x1b9477){_0x78b7ce['synthesizeSpeech'](_0x94049e,function(_0x28bb50,_0x1fb49a){if(_0x28bb50){_0x1b9477(_0x28bb50);}else if(_0x1fb49a){if(_0x1fb49a['AudioStream']instanceof Buffer){fs['writeFile'](_0xdb4e1,_0x1fb49a[_0xd5b8('0x2')],function(_0x199af1){if(_0x199af1){_0x1b9477(_0x199af1);}else{_0x261e92();}});}else{_0x1b9477(new Error(_0xd5b8('0x3')));}}else{_0x1b9477(new Error(_0xd5b8('0x4')));}});});}module[_0xd5b8('0x5')]=function(_0x39b7ca,_0x38a910,_0x9f0d9c,_0x5d0df3,_0x2ca67b,_0x5444a7,_0x1763f7){var _0xf73da8=new AWS[(_0xd5b8('0x6'))]({'accessKeyId':_0x39b7ca,'secretAccessKey':_0x38a910,'region':_0x9f0d9c});var _0x4b4231={'Text':_0x2ca67b,'TextType':_0x5444a7||_0xd5b8('0x7'),'OutputFormat':_0xd5b8('0x8'),'VoiceId':_0x5d0df3};return pollyResult(_0xf73da8,_0x4b4231,_0x1763f7);}; \ No newline at end of file +var _0x4baf=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x4a6445,_0x3128c7){var _0x2edf48=function(_0xe8e9df){while(--_0xe8e9df){_0x4a6445['push'](_0x4a6445['shift']());}};_0x2edf48(++_0x3128c7);}(_0x4baf,0x1d8));var _0xf4ba=function(_0x3325bc,_0x7ae18e){_0x3325bc=_0x3325bc-0x0;var _0x4115b7=_0x4baf[_0x3325bc];return _0x4115b7;};'use strict';var fs=require('fs');var path=require(_0xf4ba('0x0'));var BPromise=require(_0xf4ba('0x1'));var rs=require(_0xf4ba('0x2'));var AWS=require(_0xf4ba('0x3'));function pollyResult(_0x499374,_0xbfa557,_0x2cc27d){return new BPromise(function(_0x58576d,_0xfb5d4b){_0x499374[_0xf4ba('0x4')](_0xbfa557,function(_0x2d25f4,_0x3a9eb3){if(_0x2d25f4){_0xfb5d4b(_0x2d25f4);}else if(_0x3a9eb3){if(_0x3a9eb3[_0xf4ba('0x5')]instanceof Buffer){fs[_0xf4ba('0x6')](_0x2cc27d,_0x3a9eb3[_0xf4ba('0x5')],function(_0x262f55){if(_0x262f55){_0xfb5d4b(_0x262f55);}else{_0x58576d();}});}else{_0xfb5d4b(new Error(_0xf4ba('0x7')));}}else{_0xfb5d4b(new Error(_0xf4ba('0x8')));}});});}module[_0xf4ba('0x9')]=function(_0x5178ba,_0x5a147f,_0x421d5b,_0x26c8cb,_0x39cc49,_0x16ef33,_0x28f7d4){var _0x47939e=new AWS['Polly']({'accessKeyId':_0x5178ba,'secretAccessKey':_0x5a147f,'region':_0x421d5b});var _0x48b4e7={'Text':_0x39cc49,'TextType':_0x16ef33||_0xf4ba('0xa'),'OutputFormat':_0xf4ba('0xb'),'VoiceId':_0x26c8cb};return pollyResult(_0x47939e,_0x48b4e7,_0x28f7d4);}; \ 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 ca566e5..cff2232 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x4d2395,_0x41ae57,_0x519b3d,_0x18e517){return asr(_0x4d2395,_0x41ae57,_0x519b3d);}; \ No newline at end of file +var _0x29e2=['./lib/api','exports'];(function(_0x188eda,_0xccb743){var _0x3c3658=function(_0x376e57){while(--_0x376e57){_0x188eda['push'](_0x188eda['shift']());}};_0x3c3658(++_0xccb743);}(_0x29e2,0xfc));var _0x229e=function(_0x252b33,_0x2e5e46){_0x252b33=_0x252b33-0x0;var _0x359499=_0x29e2[_0x252b33];return _0x359499;};'use strict';var asr=require(_0x229e('0x0'));module[_0x229e('0x1')]=function(_0x505143,_0x1e1959,_0x22ea69,_0x3d28a8){return asr(_0x505143,_0x1e1959,_0x22ea69);}; \ 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 ee6c0cf..7e448f0 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 _0xe13e=['LINEAR16','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key='];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xee13('0x0');module[_0xee13('0x1')]=function(_0x421a41,_0xc995b6,_0xf1e0a8){return new BPromise(function(_0x2513f3,_0x7a275f){var _0x2fc6ff;if(typeof _0x421a41!==_0xee13('0x2')||_0x421a41[_0xee13('0x3')]===0x0){return _0x7a275f(_0xee13('0x4'));}if(typeof _0xc995b6!=='string'||_0xc995b6[_0xee13('0x3')]===0x0){return _0x7a275f(_0xee13('0x5'));}if(typeof _0xf1e0a8!==_0xee13('0x6')&&(typeof _0xf1e0a8!==_0xee13('0x2')||_0xf1e0a8['length']===0x0)){return _0x7a275f(_0xee13('0x7'));}try{_0x2fc6ff=fs[_0xee13('0x8')](_0x421a41)[_0xee13('0x9')](_0xee13('0xa'));}catch(_0x2a7207){return _0x7a275f(_0x2a7207);}return _0x2513f3({'method':'POST','uri':host+_0xee13('0xb')+_0xc995b6,'body':{'config':{'encoding':_0xee13('0xc'),'sampleRateHertz':'8000','languageCode':_0xf1e0a8},'audio':{'content':_0x2fc6ff}},'json':!![]});});}; \ No newline at end of file +var _0x6282=['bluebird','https://speech.googleapis.com','exports','string','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'];(function(_0x4a97b0,_0x5a7da2){var _0x1da209=function(_0x2d4e36){while(--_0x2d4e36){_0x4a97b0['push'](_0x4a97b0['shift']());}};_0x1da209(++_0x5a7da2);}(_0x6282,0x76));var _0x2628=function(_0x5f073a,_0xc5ac31){_0x5f073a=_0x5f073a-0x0;var _0x3c70a9=_0x6282[_0x5f073a];return _0x3c70a9;};'use strict';var url=require(_0x2628('0x0'));var BPromise=require(_0x2628('0x1'));var fs=require('fs');var host=_0x2628('0x2');module[_0x2628('0x3')]=function(_0x58f873,_0x50e40f,_0x126d9a){return new BPromise(function(_0xc5c0c7,_0x5eb31b){var _0x2d420f;if(typeof _0x58f873!==_0x2628('0x4')||_0x58f873[_0x2628('0x5')]===0x0){return _0x5eb31b(_0x2628('0x6'));}if(typeof _0x50e40f!==_0x2628('0x4')||_0x50e40f['length']===0x0){return _0x5eb31b(_0x2628('0x7'));}if(typeof _0x126d9a!==_0x2628('0x8')&&(typeof _0x126d9a!==_0x2628('0x4')||_0x126d9a[_0x2628('0x5')]===0x0)){return _0x5eb31b(_0x2628('0x9'));}try{_0x2d420f=fs[_0x2628('0xa')](_0x58f873)[_0x2628('0xb')](_0x2628('0xc'));}catch(_0x3f9015){return _0x5eb31b(_0x3f9015);}return _0xc5c0c7({'method':_0x2628('0xd'),'uri':host+_0x2628('0xe')+_0x50e40f,'body':{'config':{'encoding':_0x2628('0xf'),'sampleRateHertz':_0x2628('0x10'),'languageCode':_0x126d9a},'audio':{'content':_0x2d420f}},'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 7cc9a21..10cb4be 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 _0xfb73=['exports','./asr'];(function(_0x223a04,_0x14e146){var _0x36153b=function(_0x2e31ee){while(--_0x2e31ee){_0x223a04['push'](_0x223a04['shift']());}};_0x36153b(++_0x14e146);}(_0xfb73,0x12f));var _0x3fb7=function(_0x33a6d8,_0x586943){_0x33a6d8=_0x33a6d8-0x0;var _0x342d44=_0xfb73[_0x33a6d8];return _0x342d44;};var asr=require(_0x3fb7('0x0'));module[_0x3fb7('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'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 ca470cf..15c1536 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 _0xbfc3=['input','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','info','goggleTTS\x20path','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','message','textRequest','result','source','resolvedQuery','action','actionIncomplete','score','code','metadata','endConversation','replace','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','isFallback','languageCode','queryText','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','channelData','CustomAction','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','path','querystring','request-promise','google-tts-api','url','parse','util','./aws','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish\x20download\x20file','unlink','download\x20error','pipe','host','data','transcode','wav','end','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','?key=','ssml'];(function(_0x57684a,_0x514ea0){var _0x51a36e=function(_0x25b8e5){while(--_0x25b8e5){_0x57684a['push'](_0x57684a['shift']());}};_0x51a36e(++_0x514ea0);}(_0xbfc3,0xc0));var _0x3bfc=function(_0x53ae0a,_0x49e9ed){_0x53ae0a=_0x53ae0a-0x0;var _0x36bc91=_0xbfc3[_0x53ae0a];return _0x36bc91;};'use strict';var apiai=require(_0x3bfc('0x0'));var BPromise=require(_0x3bfc('0x1'));var dialogflow=require(_0x3bfc('0x2'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require('md5');var path=require(_0x3bfc('0x3'));var querystring=require(_0x3bfc('0x4'));var rp=require(_0x3bfc('0x5'));var rs=require('randomstring');var sox=require('sox');var tts=require(_0x3bfc('0x6'));var urlParse=require(_0x3bfc('0x7'))[_0x3bfc('0x8')];var util=require(_0x3bfc('0x9'));var aws=require(_0x3bfc('0xa'));var google=require(_0x3bfc('0xb'));var sestek=require('./sestek');var tilde=require(_0x3bfc('0xc'));var logger=require(_0x3bfc('0xd'))('agi');var ISPEECH_API=_0x3bfc('0xe');function downloadFile(_0x58dd05,_0x3cb01c){return new BPromise(function(_0x194d30,_0x189ae3){var _0x465272=urlParse(_0x58dd05);var _0x237cc8=_0x465272[_0x3bfc('0xf')]===_0x3bfc('0x10')?https:http;var _0x132d6b={'host':_0x465272['host'],'path':_0x465272[_0x3bfc('0x3')],'headers':{'user-agent':_0x3bfc('0x11')}};_0x237cc8[_0x3bfc('0x12')](_0x132d6b,function(_0x14f902){if(_0x14f902[_0x3bfc('0x13')]!==0xc8){logger[_0x3bfc('0x14')](_0x3bfc('0x15')+_0x58dd05+_0x3bfc('0x16')+_0x14f902['statusCode']+'\x20('+_0x14f902[_0x3bfc('0x17')]+')');_0x189ae3(new Error(_0x3bfc('0x15')+_0x58dd05+_0x3bfc('0x16')+_0x14f902[_0x3bfc('0x13')]+'\x20('+_0x14f902[_0x3bfc('0x17')]+')'));return;}var _0x20b6a5=fs[_0x3bfc('0x18')](_0x3cb01c);_0x20b6a5['on']('finish',function(){logger['info'](_0x3bfc('0x19'));_0x20b6a5['close'](_0x194d30);});_0x20b6a5['on'](_0x3bfc('0x14'),function(_0x5d6bb7){fs[_0x3bfc('0x1a')](_0x3cb01c);logger[_0x3bfc('0x14')](_0x3bfc('0x1b'),_0x5d6bb7);_0x189ae3(_0x5d6bb7);});_0x14f902[_0x3bfc('0x1c')](_0x20b6a5);})['on'](_0x3bfc('0x14'),function(_0x125e77){logger[_0x3bfc('0x14')](_0x125e77);_0x189ae3(_0x125e77);})['end']();});}function uploadFile(_0x4c829d){return new BPromise(function(_0x3880a6,_0x5a348d){var _0x493cfa=urlParse(_0x4c829d);var _0x4d8ccf=_0x493cfa[_0x3bfc('0xf')]===_0x3bfc('0x10')?https:http;var _0x38b2b8={'host':_0x493cfa[_0x3bfc('0x1d')],'path':_0x493cfa[_0x3bfc('0x3')],'headers':{'user-agent':_0x3bfc('0x11')}};_0x4d8ccf[_0x3bfc('0x12')](_0x38b2b8,function(_0x533bb2){if(_0x533bb2[_0x3bfc('0x13')]!==0xc8){_0x5a348d(new Error(_0x3bfc('0x15')+_0x4c829d+_0x3bfc('0x16')+_0x533bb2[_0x3bfc('0x13')]+'\x20('+_0x533bb2[_0x3bfc('0x17')]+')'));return;}var _0x5614bd='';_0x533bb2['on'](_0x3bfc('0x1e'),function(_0x4e2adb){_0x5614bd+=_0x4e2adb;});_0x533bb2['on']('end',function(){_0x3880a6(_0x5614bd);});})['on']('error',function(_0x25186c){_0x5a348d(_0x25186c);})['end']();});}function convertFile(_0x1705a6,_0x2a1e02){return new BPromise(function(_0x28de37,_0x18128b){var _0x15e71c=sox[_0x3bfc('0x1f')](_0x1705a6,_0x2a1e02,{'sampleRate':0x1f40,'format':_0x3bfc('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x15e71c['on'](_0x3bfc('0x14'),function(_0x3ac727){logger['error']('error\x20convert',_0x3ac727);_0x18128b(_0x3ac727);});_0x15e71c['on'](_0x3bfc('0x21'),function(){logger['info']('finish\x20to\x20convert');_0x28de37();});_0x15e71c['start']();});}function base64Decode(_0x551cb3,_0x358444){var _0x5255dd=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+_0x3bfc('0x25'));fs[_0x3bfc('0x26')](_0x5255dd,_0x551cb3,_0x3bfc('0x27'));return convertFile(_0x5255dd,_0x358444)[_0x3bfc('0x28')](function(){try{fs[_0x3bfc('0x1a')](_0x5255dd);fs[_0x3bfc('0x29')](_0x358444,_0x3bfc('0x2a'));}catch(_0x24cc36){logger[_0x3bfc('0x14')](_0x24cc36);}return _0x358444[_0x3bfc('0x2b')]('.')[0x0];});}function base64Encode(_0x39bb30){var _0x2f5f2e=fs[_0x3bfc('0x2c')](_0x39bb30);return new Buffer(_0x2f5f2e)[_0x3bfc('0x2d')](_0x3bfc('0x27'));}exports['googleCloudTTS']=function(_0x54fc28,_0x5092d1,_0x16b988,_0x54bffd,_0x5ee683,_0x5c450b){var _0x41f400,_0x4eae0b;var _0x178c5b='https://texttospeech.googleapis.com/v1/';var _0x875409=_0x3bfc('0x2e')+_0x54fc28;var _0x38fb3a={};if(_0x5092d1===_0x3bfc('0x2f')){_0x38fb3a[_0x3bfc('0x30')]={'ssml':_0x16b988};}else{_0x38fb3a[_0x3bfc('0x30')]={'text':_0x16b988};};_0x38fb3a['voice']={'languageCode':_0x54bffd,'ssmlGender':_0x5ee683};_0x38fb3a[_0x3bfc('0x31')]={'audioEncoding':_0x3bfc('0x32'),'sampleRateHertz':0x1f40};var _0x45df35={'url':_0x178c5b+_0x3bfc('0x33')+_0x875409,'method':_0x3bfc('0x34'),'json':!![],'body':_0x38fb3a};return rp(_0x45df35)['then'](function(_0x50028c){return new BPromise(function(_0xc6a808,_0x268da4){_0x41f400=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+_0x3bfc('0x35'));var _0x42a122=Buffer[_0x3bfc('0x36')](_0x50028c[_0x3bfc('0x37')],'base64');return fs[_0x3bfc('0x38')](_0x41f400,_0x42a122,function(_0x23562b){_0x268da4(_0x23562b);},function(_0x278d4e){fs[_0x3bfc('0x29')](_0x41f400,'777');_0xc6a808(_0x278d4e);});});})['then'](function(_0x1d5d78){_0x4eae0b=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+'.wav');return convertFile(_0x41f400,_0x4eae0b);})[_0x3bfc('0x28')](function(){try{fs[_0x3bfc('0x1a')](_0x41f400);fs[_0x3bfc('0x29')](_0x4eae0b,_0x3bfc('0x2a'));}catch(_0x36b04f){logger['error'](_0x36b04f);}logger['info'](_0x3bfc('0x39'),_0x4eae0b[_0x3bfc('0x2b')]('.')[0x0]);return _0x4eae0b['split']('.')[0x0];});};exports[_0x3bfc('0x3a')]=function(_0x4f4aaa,_0xcb5bba){var _0x2b61ce=_0x3bfc('0x3b');var _0x5ac276,_0x38c92a;var _0x36726a;var _0x4cb27d={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x2b61ce,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x3bfc('0x3c')+encodeURIComponent(JSON[_0x3bfc('0x3d')]([[['jQ1olc',JSON[_0x3bfc('0x3d')]([_0x4f4aaa,_0xcb5bba||'en',![],_0x3bfc('0x3e')]),null,_0x3bfc('0x3f')]]]))};return rp(_0x4cb27d)[_0x3bfc('0x28')](function(_0x510ef8){try{_0x36726a=eval(_0x510ef8[_0x3bfc('0x40')](0x5))[0x0][0x2];}catch(_0x156ba5){throw new Error('parse\x20response\x20failed:\x0a'+_0x510ef8[_0x3bfc('0x1e')]);}if(!_0x36726a){if(_0x4f4aaa[_0x3bfc('0x41')]>0xc8){throw new Error(_0x3bfc('0x42'));}else{throw new Error(_0x3bfc('0x43')+_0xcb5bba+_0x3bfc('0x44'));}}try{_0x36726a=eval(_0x36726a)[0x0];}catch(_0x4980dd){throw new Error(_0x3bfc('0x45')+res[_0x3bfc('0x1e')]);}const _0x4fd233=_0x36726a;_0x5ac276=path['resolve'](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+_0x3bfc('0x35'));fs[_0x3bfc('0x26')](_0x5ac276,_0x36726a,{'encoding':_0x3bfc('0x27')});_0x38c92a=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs['generate'](0x4)+_0x3bfc('0x25'));return convertFile(_0x5ac276,_0x38c92a);})[_0x3bfc('0x28')](function(){try{fs[_0x3bfc('0x1a')](_0x5ac276);fs['chmodSync'](_0x38c92a,_0x3bfc('0x2a'));}catch(_0x3ae1c4){logger[_0x3bfc('0x14')](_0x3ae1c4);}logger[_0x3bfc('0x46')](_0x3bfc('0x47'),_0x38c92a[_0x3bfc('0x2b')]('.')[0x0]);return _0x38c92a['split']('.')[0x0];});};exports['googleASR']=function(_0x7789f6,_0x54a60a,_0x2270be){return google['asr'](_0x7789f6,_0x54a60a,_0x2270be)['then'](function(_0xf6c38c){logger[_0x3bfc('0x46')](_0xf6c38c[_0x3bfc('0x48')]);return rp(_0xf6c38c);})[_0x3bfc('0x28')](function(_0x6384a7){var _0x358740='';var _0x217f7d=0x0;try{fs[_0x3bfc('0x1a')](_0x7789f6);}catch(_0x207d2c){logger['error'](_0x207d2c);}if(_0x6384a7&&_0x6384a7[_0x3bfc('0x49')]){_0x358740=_0x6384a7['results']['map'](function(_0x213bba){return _0x213bba&&_0x213bba['alternatives'][0x0]&&_0x213bba[_0x3bfc('0x4a')][0x0]['transcript']?_0x213bba[_0x3bfc('0x4a')][0x0][_0x3bfc('0x4b')]:'';})[_0x3bfc('0x4c')]('\x0a');_0x217f7d=_0x6384a7[_0x3bfc('0x49')]['map'](function(_0xa864fb){return _0xa864fb&&_0xa864fb[_0x3bfc('0x4a')][0x0]&&_0xa864fb[_0x3bfc('0x4a')][0x0][_0x3bfc('0x4d')]?_0xa864fb['alternatives'][0x0][_0x3bfc('0x4d')]:0x0;})[_0x3bfc('0x4c')]('\x0a');}logger[_0x3bfc('0x46')](_0x3bfc('0x4e'),_0x358740);logger['info'](_0x3bfc('0x4f'),_0x217f7d);return{'transcript':_0x358740,'confidence':_0x217f7d};})['catch'](function(_0x3249ee){logger[_0x3bfc('0x14')](_0x3bfc('0x50'),_0x3249ee[_0x3bfc('0x13')],_0x3249ee['name'],_0x3249ee[_0x3bfc('0x51')]);});};exports['googleDialogflow']=function(_0xb4ac85,_0x4a2a74,_0x46ee51,_0x489844){var _0xcb683e=apiai(_0x4a2a74,{'language':_0x489844||'en'});return _0xcb683e[_0x3bfc('0x52')](_0x46ee51,{'sessionId':md5(_0xb4ac85)})[_0x3bfc('0x28')](function(_0xe39e2e){logger[_0x3bfc('0x46')](JSON[_0x3bfc('0x3d')](_0xe39e2e));return{'source':_0xe39e2e[_0x3bfc('0x53')][_0x3bfc('0x54')],'resolvedQuery':_0xe39e2e['result'][_0x3bfc('0x55')],'action':_0xe39e2e['result'][_0x3bfc('0x56')],'actionIncomplete':_0xe39e2e[_0x3bfc('0x53')][_0x3bfc('0x57')],'speech':_0xe39e2e[_0x3bfc('0x53')]['fulfillment']['speech'],'score':_0xe39e2e[_0x3bfc('0x53')][_0x3bfc('0x58')],'statusCode':_0xe39e2e['status'][_0x3bfc('0x59')],'endConversation':_0xe39e2e['result'][_0x3bfc('0x5a')][_0x3bfc('0x5b')]||![],'isFallbackIntent':_0xe39e2e[_0x3bfc('0x53')][_0x3bfc('0x5a')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x585001,_0x197816,_0x5e1ff1,_0x4f05d5,_0x59a7c9,_0x445c88){var _0x3fe7a2=_0x4f05d5[_0x3bfc('0x5c')](/\\n/g,'\x0a');var _0x29d907={'credentials':{'private_key':_0x3fe7a2,'client_email':_0x5e1ff1}};var _0x20e950=new dialogflow['SessionsClient'](_0x29d907);var _0x583260=_0x20e950['sessionPath'](_0x197816,md5(_0x585001));var _0x3a7ce8={'session':_0x583260,'queryInput':{'text':{'text':_0x59a7c9,'languageCode':_0x445c88}}};return _0x20e950[_0x3bfc('0x5d')](_0x3a7ce8)[_0x3bfc('0x28')](function(_0x185e1a){if(_0x185e1a&&_0x185e1a[_0x3bfc('0x41')]){logger[_0x3bfc('0x46')](_0x3bfc('0x5e'),JSON[_0x3bfc('0x3d')](_0x185e1a));var _0x4952b6=_0x185e1a[0x0];if(_0x4952b6){var _0x331a2d={'action':_0x4952b6['queryResult']['action'],'allRequiredParamsPresent':_0x4952b6[_0x3bfc('0x5f')][_0x3bfc('0x60')],'endConversation':_0x4952b6[_0x3bfc('0x5f')][_0x3bfc('0x61')]&&_0x4952b6[_0x3bfc('0x5f')][_0x3bfc('0x61')][_0x3bfc('0x62')]?_0x4952b6[_0x3bfc('0x5f')]['diagnosticInfo'][_0x3bfc('0x62')][_0x3bfc('0x63')]['boolValue']:![],'fulfillmentText':_0x4952b6[_0x3bfc('0x5f')]['fulfillmentText'],'intentName':_0x4952b6[_0x3bfc('0x5f')]['intent']['name'],'intentDisplayName':_0x4952b6[_0x3bfc('0x5f')][_0x3bfc('0x64')]['displayName'],'isFallbackIntent':_0x4952b6['queryResult']['intent'][_0x3bfc('0x65')],'languageCode':_0x4952b6[_0x3bfc('0x5f')][_0x3bfc('0x66')],'queryText':_0x4952b6[_0x3bfc('0x5f')][_0x3bfc('0x67')],'responseId':_0x4952b6['responseId'],'score':_0x4952b6['queryResult']['intentDetectionConfidence'],'speech':_0x4952b6[_0x3bfc('0x5f')]['fulfillmentText'],'providerResponse':JSON[_0x3bfc('0x3d')](_0x185e1a)};return _0x331a2d;}}});};exports['tildeASR']=function(_0x4a1d10,_0x132f6a,_0x36dfa2,_0x4ef1d7){return tilde['asr'](_0x4a1d10,_0x132f6a,_0x36dfa2,_0x4ef1d7)[_0x3bfc('0x28')](function(_0x35ea4b){try{fs['unlink'](_0x4a1d10);}catch(_0x22f71){logger[_0x3bfc('0x14')](_0x22f71);}logger[_0x3bfc('0x46')]('Tilde\x20ASR\x20transcription',_0x35ea4b[_0x3bfc('0x4b')]);logger['info'](_0x3bfc('0x68'),_0x35ea4b['confidence']);return _0x35ea4b;});};exports[_0x3bfc('0x69')]=function(_0x59faaf,_0x5a2065,_0x2266ce,_0xc020dd,_0xe6c717,_0xda5543){var _0x3894e8=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+'.mp3');var _0x3807eb;return aws[_0x3bfc('0x6a')](_0x59faaf,_0x5a2065,_0x2266ce,_0xc020dd,_0xe6c717,_0xda5543,_0x3894e8)[_0x3bfc('0x28')](function(){_0x3807eb=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+_0x3bfc('0x25'));return convertFile(_0x3894e8,_0x3807eb);})[_0x3bfc('0x28')](function(){try{fs['unlink'](_0x3894e8);fs[_0x3bfc('0x29')](_0x3807eb,'777');}catch(_0x1a246d){logger[_0x3bfc('0x14')](_0x1a246d);}return _0x3807eb['split']('.')[0x0];});};exports[_0x3bfc('0x6b')]=function(_0x308236,_0x45b339,_0x155943,_0x1188c5,_0x27010d,_0x14d671){return aws[_0x3bfc('0x6c')](_0x308236,_0x45b339,_0x155943,_0x1188c5,_0x27010d,_0x14d671)['then'](function(_0x562831){logger[_0x3bfc('0x46')](JSON[_0x3bfc('0x3d')](_0x562831));return _0x562831;});};exports[_0x3bfc('0x6d')]=function(_0x585ca5,_0x3c96fa,_0x35e25b,_0x738245){var _0x59f3d1=util['format'](_0x3bfc('0x6e'),ISPEECH_API,_0x585ca5,encodeURIComponent(_0x3c96fa),_0x35e25b,_0x738245);var _0x5e2015=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+'.mp3');var _0x5a81c0;return downloadFile(_0x59f3d1,_0x5e2015)[_0x3bfc('0x28')](function(){_0x5a81c0=path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+_0x3bfc('0x25'));return convertFile(_0x5e2015,_0x5a81c0);})[_0x3bfc('0x28')](function(){try{fs[_0x3bfc('0x1a')](_0x5e2015);fs['chmodSync'](_0x5a81c0,_0x3bfc('0x2a'));}catch(_0x37d1f0){logger[_0x3bfc('0x14')](_0x37d1f0);}return _0x5a81c0[_0x3bfc('0x2b')]('.')[0x0];});};exports['ispeechASR']=function(_0x2f4c1d,_0xb29053,_0x477467,_0x4dfdaa){var _0x3953cb=util[_0x3bfc('0x6f')](_0x3bfc('0x70'),ISPEECH_API,_0xb29053,_0x477467,base64Encode(_0x2f4c1d),_0x4dfdaa?util['format']('model=%s',encodeURIComponent(_0x4dfdaa)):_0x3bfc('0x71'));return uploadFile(_0x3953cb)['then'](function(_0x166714){return querystring[_0x3bfc('0x8')](_0x166714);});};exports['sestekNDA']=function(_0x2dac2c,_0x51c12e){return sestek[_0x3bfc('0x72')](_0x2dac2c,_0x51c12e)[_0x3bfc('0x28')](function(_0x62dc77){logger[_0x3bfc('0x46')](JSON['stringify'](_0x62dc77));var _0x2e6d40={'speech':_0x62dc77['text'],'action':_0x62dc77[_0x3bfc('0x73')]?_0x62dc77['channelData'][_0x3bfc('0x74')]:undefined,'actiondata':_0x62dc77[_0x3bfc('0x73')]?_0x62dc77[_0x3bfc('0x73')]['CustomActionData']:undefined};if(_0x62dc77[_0x3bfc('0x73')]&&_0x62dc77[_0x3bfc('0x73')]['AudioFromTts']){return base64Decode(_0x62dc77[_0x3bfc('0x73')][_0x3bfc('0x75')][_0x3bfc('0x76')],path[_0x3bfc('0x22')](__dirname,_0x3bfc('0x23'),rs[_0x3bfc('0x24')](0x4)+'.wav'))[_0x3bfc('0x28')](function(_0xcbb89c){_0x2e6d40['audiofile']=_0xcbb89c;return _0x2e6d40;});}return _0x2e6d40;});};exports[_0x3bfc('0x77')]=function(){return __dirname;}; \ No newline at end of file +var _0x8b74=['wav','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','unlink','777','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','resolve','.mp3','chmodSync','googleTTS','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','text\x20length\x20limit\x20reached','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','awsPolly','polly','awsLex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomAction','AudioFromTts','Data','dirName','apiai-promise','dialogflow','http','https','md5','querystring','request-promise','sox','google-tts-api','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','host','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','pipe','end','protocol','data'];(function(_0x1ec856,_0x44e534){var _0x2458c9=function(_0x1bbe4d){while(--_0x1bbe4d){_0x1ec856['push'](_0x1ec856['shift']());}};_0x2458c9(++_0x44e534);}(_0x8b74,0x160));var _0x48b7=function(_0x2c117a,_0x567fc7){_0x2c117a=_0x2c117a-0x0;var _0x29151f=_0x8b74[_0x2c117a];return _0x29151f;};'use strict';var apiai=require(_0x48b7('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x48b7('0x1'));var fs=require('fs');var http=require(_0x48b7('0x2'));var https=require(_0x48b7('0x3'));var md5=require(_0x48b7('0x4'));var path=require('path');var querystring=require(_0x48b7('0x5'));var rp=require(_0x48b7('0x6'));var rs=require('randomstring');var sox=require(_0x48b7('0x7'));var tts=require(_0x48b7('0x8'));var urlParse=require('url')[_0x48b7('0x9')];var util=require(_0x48b7('0xa'));var aws=require(_0x48b7('0xb'));var google=require(_0x48b7('0xc'));var sestek=require(_0x48b7('0xd'));var tilde=require('./tilde');var logger=require(_0x48b7('0xe'))(_0x48b7('0xf'));var ISPEECH_API=_0x48b7('0x10');function downloadFile(_0x38057e,_0x551f8d){return new BPromise(function(_0x44349b,_0x1ef8cd){var _0x499738=urlParse(_0x38057e);var _0x3c38b0=_0x499738['protocol']==='https:'?https:http;var _0x23a9a8={'host':_0x499738[_0x48b7('0x11')],'path':_0x499738[_0x48b7('0x12')],'headers':{'user-agent':_0x48b7('0x13')}};_0x3c38b0[_0x48b7('0x14')](_0x23a9a8,function(_0x244c25){if(_0x244c25[_0x48b7('0x15')]!==0xc8){logger[_0x48b7('0x16')](_0x48b7('0x17')+_0x38057e+_0x48b7('0x18')+_0x244c25['statusCode']+'\x20('+_0x244c25[_0x48b7('0x19')]+')');_0x1ef8cd(new Error(_0x48b7('0x17')+_0x38057e+_0x48b7('0x18')+_0x244c25[_0x48b7('0x15')]+'\x20('+_0x244c25[_0x48b7('0x19')]+')'));return;}var _0x3c9006=fs[_0x48b7('0x1a')](_0x551f8d);_0x3c9006['on'](_0x48b7('0x1b'),function(){logger[_0x48b7('0x1c')](_0x48b7('0x1d'));_0x3c9006[_0x48b7('0x1e')](_0x44349b);});_0x3c9006['on'](_0x48b7('0x16'),function(_0x4672a9){fs['unlink'](_0x551f8d);logger[_0x48b7('0x16')]('download\x20error',_0x4672a9);_0x1ef8cd(_0x4672a9);});_0x244c25[_0x48b7('0x1f')](_0x3c9006);})['on'](_0x48b7('0x16'),function(_0x50da0b){logger[_0x48b7('0x16')](_0x50da0b);_0x1ef8cd(_0x50da0b);})[_0x48b7('0x20')]();});}function uploadFile(_0x7b6dcd){return new BPromise(function(_0x42a128,_0x57124e){var _0x4e3fe3=urlParse(_0x7b6dcd);var _0xaa4d25=_0x4e3fe3[_0x48b7('0x21')]==='https:'?https:http;var _0x56aa2b={'host':_0x4e3fe3['host'],'path':_0x4e3fe3[_0x48b7('0x12')],'headers':{'user-agent':_0x48b7('0x13')}};_0xaa4d25[_0x48b7('0x14')](_0x56aa2b,function(_0x332189){if(_0x332189[_0x48b7('0x15')]!==0xc8){_0x57124e(new Error('request\x20to\x20'+_0x7b6dcd+_0x48b7('0x18')+_0x332189['statusCode']+'\x20('+_0x332189[_0x48b7('0x19')]+')'));return;}var _0x534880='';_0x332189['on'](_0x48b7('0x22'),function(_0x5671e6){_0x534880+=_0x5671e6;});_0x332189['on'](_0x48b7('0x20'),function(){_0x42a128(_0x534880);});})['on'](_0x48b7('0x16'),function(_0x25d605){_0x57124e(_0x25d605);})[_0x48b7('0x20')]();});}function convertFile(_0x53c735,_0x334f86){return new BPromise(function(_0x1c9a43,_0xc8f85b){var _0x3787bb=sox['transcode'](_0x53c735,_0x334f86,{'sampleRate':0x1f40,'format':_0x48b7('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3787bb['on'](_0x48b7('0x16'),function(_0x1e9bc4){logger[_0x48b7('0x16')]('error\x20convert',_0x1e9bc4);_0xc8f85b(_0x1e9bc4);});_0x3787bb['on']('end',function(){logger[_0x48b7('0x1c')](_0x48b7('0x24'));_0x1c9a43();});_0x3787bb[_0x48b7('0x25')]();});}function base64Decode(_0x136a5c,_0x384f14){var _0x53f875=path['resolve'](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+_0x48b7('0x28'));fs[_0x48b7('0x29')](_0x53f875,_0x136a5c,_0x48b7('0x2a'));return convertFile(_0x53f875,_0x384f14)[_0x48b7('0x2b')](function(){try{fs[_0x48b7('0x2c')](_0x53f875);fs['chmodSync'](_0x384f14,_0x48b7('0x2d'));}catch(_0x24aeac){logger[_0x48b7('0x16')](_0x24aeac);}return _0x384f14[_0x48b7('0x2e')]('.')[0x0];});}function base64Encode(_0x5505f5){var _0x33bc37=fs[_0x48b7('0x2f')](_0x5505f5);return new Buffer(_0x33bc37)['toString'](_0x48b7('0x2a'));}exports[_0x48b7('0x30')]=function(_0x2f263f,_0x4a6521,_0x41885a,_0x14304b,_0x5267fe,_0x53c7ce){var _0x497ba3,_0x3c4d10;var _0x9793a5=_0x48b7('0x31');var _0x1fae03=_0x48b7('0x32')+_0x2f263f;var _0x3c3d67={};if(_0x4a6521===_0x48b7('0x33')){_0x3c3d67['input']={'ssml':_0x41885a};}else{_0x3c3d67[_0x48b7('0x34')]={'text':_0x41885a};};_0x3c3d67[_0x48b7('0x35')]={'languageCode':_0x14304b,'ssmlGender':_0x5267fe};_0x3c3d67[_0x48b7('0x36')]={'audioEncoding':_0x48b7('0x37'),'sampleRateHertz':0x1f40};var _0x20ba37={'url':_0x9793a5+'text:synthesize'+_0x1fae03,'method':_0x48b7('0x38'),'json':!![],'body':_0x3c3d67};return rp(_0x20ba37)[_0x48b7('0x2b')](function(_0x2e94c2){return new BPromise(function(_0x5abf82,_0x1ebdde){_0x497ba3=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs['generate'](0x4)+_0x48b7('0x3a'));var _0x5cf371=Buffer['from'](_0x2e94c2['audioContent'],_0x48b7('0x2a'));return fs['writeFile'](_0x497ba3,_0x5cf371,function(_0x19ee4a){_0x1ebdde(_0x19ee4a);},function(_0xbfcfd0){fs[_0x48b7('0x3b')](_0x497ba3,_0x48b7('0x2d'));_0x5abf82(_0xbfcfd0);});});})[_0x48b7('0x2b')](function(_0x2f2489){_0x3c4d10=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+'.wav');return convertFile(_0x497ba3,_0x3c4d10);})[_0x48b7('0x2b')](function(){try{fs[_0x48b7('0x2c')](_0x497ba3);fs[_0x48b7('0x3b')](_0x3c4d10,'777');}catch(_0x191969){logger['error'](_0x191969);}logger['info']('googleCloudTTS\x20path',_0x3c4d10[_0x48b7('0x2e')]('.')[0x0]);return _0x3c4d10['split']('.')[0x0];});};exports[_0x48b7('0x3c')]=function(_0x6d2bef,_0x2b3e5c){var _0x240e71='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x50913f,_0x1c04ab;var _0x844f4f;var _0x3d3697={'encoding':_0x48b7('0x3d'),'method':_0x48b7('0x38'),'timeout':0x2710,'url':_0x240e71,'headers':{'Content-Type':_0x48b7('0x3e')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x48b7('0x3f'),JSON[_0x48b7('0x40')]([_0x6d2bef,_0x2b3e5c||'en',![],_0x48b7('0x41')]),null,_0x48b7('0x42')]]]))};return rp(_0x3d3697)[_0x48b7('0x2b')](function(_0x100472){try{_0x844f4f=eval(_0x100472[_0x48b7('0x43')](0x5))[0x0][0x2];}catch(_0x2e9fde){throw new Error('parse\x20response\x20failed:\x0a'+_0x100472[_0x48b7('0x22')]);}if(!_0x844f4f){if(_0x6d2bef['length']>0xc8){throw new Error(_0x48b7('0x44'));}else{throw new Error('lang\x20\x22'+_0x2b3e5c+'\x22\x20might\x20not\x20exist');}}try{_0x844f4f=eval(_0x844f4f)[0x0];}catch(_0x4efa68){throw new Error(_0x48b7('0x45')+res[_0x48b7('0x22')]);}const _0x5964a9=_0x844f4f;_0x50913f=path['resolve'](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+_0x48b7('0x3a'));fs[_0x48b7('0x29')](_0x50913f,_0x844f4f,{'encoding':'base64'});_0x1c04ab=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x50913f,_0x1c04ab);})[_0x48b7('0x2b')](function(){try{fs[_0x48b7('0x2c')](_0x50913f);fs['chmodSync'](_0x1c04ab,_0x48b7('0x2d'));}catch(_0x21754a){logger[_0x48b7('0x16')](_0x21754a);}logger['info'](_0x48b7('0x46'),_0x1c04ab[_0x48b7('0x2e')]('.')[0x0]);return _0x1c04ab['split']('.')[0x0];});};exports['googleASR']=function(_0x3fa35a,_0x3293b5,_0x13604a){return google[_0x48b7('0x47')](_0x3fa35a,_0x3293b5,_0x13604a)[_0x48b7('0x2b')](function(_0x3a1f8d){logger[_0x48b7('0x1c')](_0x3a1f8d[_0x48b7('0x48')]);return rp(_0x3a1f8d);})[_0x48b7('0x2b')](function(_0x1350d3){var _0x49dd7f='';var _0x41619e=0x0;try{fs[_0x48b7('0x2c')](_0x3fa35a);}catch(_0x44f3c6){logger[_0x48b7('0x16')](_0x44f3c6);}if(_0x1350d3&&_0x1350d3[_0x48b7('0x49')]){_0x49dd7f=_0x1350d3['results']['map'](function(_0x512d55){return _0x512d55&&_0x512d55[_0x48b7('0x4a')][0x0]&&_0x512d55[_0x48b7('0x4a')][0x0][_0x48b7('0x4b')]?_0x512d55[_0x48b7('0x4a')][0x0]['transcript']:'';})[_0x48b7('0x4c')]('\x0a');_0x41619e=_0x1350d3[_0x48b7('0x49')][_0x48b7('0x4d')](function(_0x3b10d3){return _0x3b10d3&&_0x3b10d3[_0x48b7('0x4a')][0x0]&&_0x3b10d3[_0x48b7('0x4a')][0x0]['confidence']?_0x3b10d3[_0x48b7('0x4a')][0x0][_0x48b7('0x4e')]:0x0;})['join']('\x0a');}logger[_0x48b7('0x1c')](_0x48b7('0x4f'),_0x49dd7f);logger[_0x48b7('0x1c')](_0x48b7('0x50'),_0x41619e);return{'transcript':_0x49dd7f,'confidence':_0x41619e};})['catch'](function(_0x2d411e){logger[_0x48b7('0x16')](_0x48b7('0x51'),_0x2d411e['statusCode'],_0x2d411e[_0x48b7('0x52')],_0x2d411e[_0x48b7('0x53')]);});};exports[_0x48b7('0x54')]=function(_0x221711,_0x5ec68d,_0x5a409e,_0x43141d){var _0x45643d=apiai(_0x5ec68d,{'language':_0x43141d||'en'});return _0x45643d[_0x48b7('0x55')](_0x5a409e,{'sessionId':md5(_0x221711)})[_0x48b7('0x2b')](function(_0x1be654){logger[_0x48b7('0x1c')](JSON[_0x48b7('0x40')](_0x1be654));return{'source':_0x1be654[_0x48b7('0x56')][_0x48b7('0x57')],'resolvedQuery':_0x1be654[_0x48b7('0x56')][_0x48b7('0x58')],'action':_0x1be654[_0x48b7('0x56')][_0x48b7('0x59')],'actionIncomplete':_0x1be654['result'][_0x48b7('0x5a')],'speech':_0x1be654['result'][_0x48b7('0x5b')][_0x48b7('0x5c')],'score':_0x1be654[_0x48b7('0x56')][_0x48b7('0x5d')],'statusCode':_0x1be654[_0x48b7('0x5e')][_0x48b7('0x5f')],'endConversation':_0x1be654['result'][_0x48b7('0x60')][_0x48b7('0x61')]||![],'isFallbackIntent':_0x1be654[_0x48b7('0x56')][_0x48b7('0x60')][_0x48b7('0x62')]};});};exports[_0x48b7('0x63')]=function(_0x1e6c48,_0x26aab5,_0x3abb39,_0x5d2691,_0x273f7a,_0x1e562f){var _0x1cc147=_0x5d2691[_0x48b7('0x64')](/\\n/g,'\x0a');var _0x249dbd={'credentials':{'private_key':_0x1cc147,'client_email':_0x3abb39}};var _0x42735a=new dialogflow[(_0x48b7('0x65'))](_0x249dbd);var _0x1c4525=_0x42735a[_0x48b7('0x66')](_0x26aab5,md5(_0x1e6c48));var _0x542612={'session':_0x1c4525,'queryInput':{'text':{'text':_0x273f7a,'languageCode':_0x1e562f}}};return _0x42735a[_0x48b7('0x67')](_0x542612)['then'](function(_0x171646){if(_0x171646&&_0x171646['length']){logger[_0x48b7('0x1c')](_0x48b7('0x68'),JSON[_0x48b7('0x40')](_0x171646));var _0x597da8=_0x171646[0x0];if(_0x597da8){var _0x2f26b7={'action':_0x597da8['queryResult'][_0x48b7('0x59')],'allRequiredParamsPresent':_0x597da8['queryResult'][_0x48b7('0x69')],'endConversation':_0x597da8[_0x48b7('0x6a')][_0x48b7('0x6b')]&&_0x597da8[_0x48b7('0x6a')]['diagnosticInfo']['fields']?_0x597da8[_0x48b7('0x6a')][_0x48b7('0x6b')][_0x48b7('0x6c')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x597da8['queryResult'][_0x48b7('0x6d')],'intentName':_0x597da8[_0x48b7('0x6a')][_0x48b7('0x6e')][_0x48b7('0x52')],'intentDisplayName':_0x597da8[_0x48b7('0x6a')][_0x48b7('0x6e')][_0x48b7('0x6f')],'isFallbackIntent':_0x597da8[_0x48b7('0x6a')]['intent'][_0x48b7('0x70')],'languageCode':_0x597da8[_0x48b7('0x6a')][_0x48b7('0x71')],'queryText':_0x597da8[_0x48b7('0x6a')]['queryText'],'responseId':_0x597da8[_0x48b7('0x72')],'score':_0x597da8[_0x48b7('0x6a')][_0x48b7('0x73')],'speech':_0x597da8[_0x48b7('0x6a')][_0x48b7('0x6d')],'providerResponse':JSON[_0x48b7('0x40')](_0x171646)};return _0x2f26b7;}}});};exports['tildeASR']=function(_0x316fce,_0x41a2d5,_0x1e2ca3,_0x2369e6){return tilde[_0x48b7('0x47')](_0x316fce,_0x41a2d5,_0x1e2ca3,_0x2369e6)['then'](function(_0x96591d){try{fs['unlink'](_0x316fce);}catch(_0x4a768e){logger[_0x48b7('0x16')](_0x4a768e);}logger[_0x48b7('0x1c')]('Tilde\x20ASR\x20transcription',_0x96591d['transcript']);logger['info']('Tilde\x20ASR\x20confidence',_0x96591d[_0x48b7('0x4e')]);return _0x96591d;});};exports[_0x48b7('0x74')]=function(_0x300973,_0x21f536,_0x207171,_0x468d5c,_0x368867,_0x1486fa){var _0x1737fb=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+'.mp3');var _0x312a8e;return aws[_0x48b7('0x75')](_0x300973,_0x21f536,_0x207171,_0x468d5c,_0x368867,_0x1486fa,_0x1737fb)[_0x48b7('0x2b')](function(){_0x312a8e=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+_0x48b7('0x28'));return convertFile(_0x1737fb,_0x312a8e);})[_0x48b7('0x2b')](function(){try{fs[_0x48b7('0x2c')](_0x1737fb);fs[_0x48b7('0x3b')](_0x312a8e,_0x48b7('0x2d'));}catch(_0x48439d){logger[_0x48b7('0x16')](_0x48439d);}return _0x312a8e['split']('.')[0x0];});};exports[_0x48b7('0x76')]=function(_0x696a5e,_0x17a9ca,_0x1190b9,_0x2e4a8b,_0x9e7684,_0x2cca94){return aws['lex'](_0x696a5e,_0x17a9ca,_0x1190b9,_0x2e4a8b,_0x9e7684,_0x2cca94)[_0x48b7('0x2b')](function(_0x2364cf){logger[_0x48b7('0x1c')](JSON['stringify'](_0x2364cf));return _0x2364cf;});};exports['ispeechTTS']=function(_0x582161,_0xe00c34,_0xcc7da3,_0xf81ff5){var _0x780213=util['format'](_0x48b7('0x77'),ISPEECH_API,_0x582161,encodeURIComponent(_0xe00c34),_0xcc7da3,_0xf81ff5);var _0x168994=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+_0x48b7('0x3a'));var _0x448585;return downloadFile(_0x780213,_0x168994)[_0x48b7('0x2b')](function(){_0x448585=path[_0x48b7('0x39')](__dirname,_0x48b7('0x26'),rs[_0x48b7('0x27')](0x4)+_0x48b7('0x28'));return convertFile(_0x168994,_0x448585);})[_0x48b7('0x2b')](function(){try{fs[_0x48b7('0x2c')](_0x168994);fs['chmodSync'](_0x448585,'777');}catch(_0x551ec4){logger[_0x48b7('0x16')](_0x551ec4);}return _0x448585['split']('.')[0x0];});};exports['ispeechASR']=function(_0x4ddeed,_0x3386a9,_0x237293,_0x4d9416){var _0x484d80=util['format'](_0x48b7('0x78'),ISPEECH_API,_0x3386a9,_0x237293,base64Encode(_0x4ddeed),_0x4d9416?util['format'](_0x48b7('0x79'),encodeURIComponent(_0x4d9416)):'freeform=3');return uploadFile(_0x484d80)[_0x48b7('0x2b')](function(_0x1b803d){return querystring[_0x48b7('0x9')](_0x1b803d);});};exports[_0x48b7('0x7a')]=function(_0x37fc20,_0x164483){return sestek[_0x48b7('0x7b')](_0x37fc20,_0x164483)[_0x48b7('0x2b')](function(_0x4deada){logger[_0x48b7('0x1c')](JSON[_0x48b7('0x40')](_0x4deada));var _0x112803={'speech':_0x4deada['text'],'action':_0x4deada[_0x48b7('0x7c')]?_0x4deada[_0x48b7('0x7c')][_0x48b7('0x7d')]:undefined,'actiondata':_0x4deada['channelData']?_0x4deada['channelData']['CustomActionData']:undefined};if(_0x4deada[_0x48b7('0x7c')]&&_0x4deada['channelData'][_0x48b7('0x7e')]){return base64Decode(_0x4deada[_0x48b7('0x7c')][_0x48b7('0x7e')][_0x48b7('0x7f')],path[_0x48b7('0x39')](__dirname,'tmp',rs['generate'](0x4)+'.wav'))[_0x48b7('0x2b')](function(_0xc1a36d){_0x112803['audiofile']=_0xc1a36d;return _0x112803;});}return _0x112803;});};exports[_0x48b7('0x80')]=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 34041e8..72ffcd3 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 _0xf88a=['exports','./nda'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf88a,0x10d));var _0xaf88=function(_0x3398bc,_0x359653){_0x3398bc=_0x3398bc-0x0;var _0x1f8c90=_0xf88a[_0x3398bc];return _0x1f8c90;};var nda=require(_0xaf88('0x0'));module[_0xaf88('0x1')]={'nda':nda}; \ No newline at end of file +var _0xcd33=['./nda'];(function(_0x831f0,_0x8c01cd){var _0x14b1bb=function(_0xb40dd1){while(--_0xb40dd1){_0x831f0['push'](_0x831f0['shift']());}};_0x14b1bb(++_0x8c01cd);}(_0xcd33,0x12c));var _0x3cd3=function(_0x435aea,_0x46fffd){_0x435aea=_0x435aea-0x0;var _0x527298=_0xcd33[_0x435aea];return _0x527298;};var nda=require(_0x3cd3('0x0'));module['exports']={'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 9502f24..f43784c 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 _0xfa7c=['../../../../../config/logger','agi','exports','POST','resolve','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','CustomAction','custom_action','custom_action_data','CustomActionData','info','request-promise'];(function(_0x255896,_0x46d589){var _0x37eeb1=function(_0x4a9a8c){while(--_0x4a9a8c){_0x255896['push'](_0x255896['shift']());}};_0x37eeb1(++_0x46d589);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x20d145,_0x14adf7){_0x20d145=_0x20d145-0x0;var _0x210b43=_0xfa7c[_0x20d145];return _0x210b43;};'use strict';var rp=require(_0xcfa7('0x0'));var url=require('url');var logger=require(_0xcfa7('0x1'))(_0xcfa7('0x2'));module[_0xcfa7('0x3')]=function(_0x1d6921,_0x19beaf){var _0x185124={'method':_0xcfa7('0x4'),'uri':url[_0xcfa7('0x5')](_0x19beaf['ndauth_url'],_0xcfa7('0x6')),'form':{'grant_type':_0xcfa7('0x7'),'username':_0x19beaf[_0xcfa7('0x8')],'password':_0x19beaf[_0xcfa7('0x7')]},'json':!![]};return rp(_0x185124)['then'](function(_0x816590){var _0x573432={'method':_0xcfa7('0x4'),'uri':url[_0xcfa7('0x5')](_0x19beaf[_0xcfa7('0x9')],_0xcfa7('0xa')),'body':{'type':_0x19beaf['ndaactivity_type']||_0xcfa7('0xb'),'channelId':_0xcfa7('0xc'),'conversation':{'id':_0x1d6921[_0xcfa7('0xd')]},'from':{'id':_0x1d6921[_0xcfa7('0xe')],'name':_0x1d6921[_0xcfa7('0xf')]},'recipient':{'id':_0x1d6921['dnid'],'name':_0x1d6921['extension']},'text':_0x19beaf[_0xcfa7('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x816590[_0xcfa7('0x11')]},'json':!![]};if(_0x19beaf[_0xcfa7('0x12')]){_0x573432[_0xcfa7('0x13')][_0xcfa7('0x14')][_0xcfa7('0x15')]=_0x19beaf[_0xcfa7('0x12')];}if(_0x19beaf[_0xcfa7('0x16')]=='1'){_0x573432[_0xcfa7('0x13')]['channelData'][_0xcfa7('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x19beaf['custom_action']){_0x573432[_0xcfa7('0x13')][_0xcfa7('0x14')][_0xcfa7('0x18')]=_0x19beaf[_0xcfa7('0x19')];if(_0x19beaf[_0xcfa7('0x1a')]){_0x573432['body'][_0xcfa7('0x14')][_0xcfa7('0x1b')]=_0x19beaf[_0xcfa7('0x1a')];}}logger[_0xcfa7('0x1c')](JSON['stringify'](_0x573432));return rp(_0x573432);});}; \ No newline at end of file +var _0x5a8c=['ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','agi','exports','POST','resolve','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','project','body','ProjectName'];(function(_0x23fc38,_0x1e7855){var _0x4ea6be=function(_0x164840){while(--_0x164840){_0x23fc38['push'](_0x23fc38['shift']());}};_0x4ea6be(++_0x1e7855);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x32c379,_0x38f9aa){_0x32c379=_0x32c379-0x0;var _0x40af2d=_0x5a8c[_0x32c379];return _0x40af2d;};'use strict';var rp=require(_0xc5a8('0x0'));var url=require(_0xc5a8('0x1'));var logger=require('../../../../../config/logger')(_0xc5a8('0x2'));module[_0xc5a8('0x3')]=function(_0x1e03e6,_0x185f20){var _0x5d67ef={'method':_0xc5a8('0x4'),'uri':url[_0xc5a8('0x5')](_0x185f20['ndauth_url'],_0xc5a8('0x6')),'form':{'grant_type':_0xc5a8('0x7'),'username':_0x185f20[_0xc5a8('0x8')],'password':_0x185f20[_0xc5a8('0x7')]},'json':!![]};return rp(_0x5d67ef)[_0xc5a8('0x9')](function(_0x2eb2a5){var _0x414555={'method':_0xc5a8('0x4'),'uri':url[_0xc5a8('0x5')](_0x185f20[_0xc5a8('0xa')],_0xc5a8('0xb')),'body':{'type':_0x185f20['ndaactivity_type']||_0xc5a8('0xc'),'channelId':'Nda','conversation':{'id':_0x1e03e6[_0xc5a8('0xd')]},'from':{'id':_0x1e03e6[_0xc5a8('0xe')],'name':_0x1e03e6[_0xc5a8('0xf')]},'recipient':{'id':_0x1e03e6['dnid'],'name':_0x1e03e6['extension']},'text':_0x185f20[_0xc5a8('0x10')],'channelData':{}},'headers':{'Authorization':_0xc5a8('0x11')+_0x2eb2a5[_0xc5a8('0x12')]},'json':!![]};if(_0x185f20[_0xc5a8('0x13')]){_0x414555[_0xc5a8('0x14')]['channelData'][_0xc5a8('0x15')]=_0x185f20[_0xc5a8('0x13')];}if(_0x185f20[_0xc5a8('0x16')]=='1'){_0x414555[_0xc5a8('0x14')][_0xc5a8('0x17')][_0xc5a8('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xc5a8('0x19')};}if(_0x185f20[_0xc5a8('0x1a')]){_0x414555[_0xc5a8('0x14')][_0xc5a8('0x17')][_0xc5a8('0x1b')]=_0x185f20[_0xc5a8('0x1a')];if(_0x185f20[_0xc5a8('0x1c')]){_0x414555[_0xc5a8('0x14')][_0xc5a8('0x17')][_0xc5a8('0x1d')]=_0x185f20[_0xc5a8('0x1c')];}}logger[_0xc5a8('0x1e')](JSON['stringify'](_0x414555));return rp(_0x414555);});}; \ 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 c30c9de..8fb3267 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 _0x108f=['./lib/api'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x108f,0x8b));var _0xf108=function(_0x463ad8,_0x480ddb){_0x463ad8=_0x463ad8-0x0;var _0x1c95eb=_0x108f[_0x463ad8];return _0x1c95eb;};'use strict';var asr=require(_0xf108('0x0'));module['exports']=function(_0x1f400f,_0x3c6ed8,_0x36e003,_0x16014c){return asr(_0x1f400f,_0x3c6ed8,_0x36e003,_0x16014c);}; \ No newline at end of file +var _0x36ad=['./lib/api','exports'];(function(_0x22b7ac,_0x292fa8){var _0x22f7f3=function(_0x1c85cc){while(--_0x1c85cc){_0x22b7ac['push'](_0x22b7ac['shift']());}};_0x22f7f3(++_0x292fa8);}(_0x36ad,0x1e6));var _0xd36a=function(_0x254e3e,_0x2234e6){_0x254e3e=_0x254e3e-0x0;var _0x10fd8c=_0x36ad[_0x254e3e];return _0x10fd8c;};'use strict';var asr=require(_0xd36a('0x0'));module[_0xd36a('0x1')]=function(_0xd32522,_0x4f0d4f,_0x2f157c,_0x1460bb){return asr(_0xd32522,_0x4f0d4f,_0x2f157c,_0x1460bb);}; \ 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 8bfcba6..2050464 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 _0xbfb2=['status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','close','bluebird','moment','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','terminate','parse'];(function(_0x50df1d,_0x1dff91){var _0xae8cad=function(_0x55dc3b){while(--_0x55dc3b){_0x50df1d['push'](_0x50df1d['shift']());}};_0xae8cad(++_0x1dff91);}(_0xbfb2,0x1a1));var _0x2bfb=function(_0x729516,_0x48eba4){_0x729516=_0x729516-0x0;var _0xec47ed=_0xbfb2[_0x729516];return _0xec47ed;};'use strict';var BPromise=require(_0x2bfb('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2bfb('0x1'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')(_0x2bfb('0x2'));module[_0x2bfb('0x3')]=function(_0x2baa7c,_0x1d5c9b,_0x57d146,_0x530ff3){return new BPromise(function(_0x6103d6,_0x6db96){logger[_0x2bfb('0x4')](_0x2bfb('0x5'),_0x530ff3||_0x2bfb('0x6'));var _0x580dbf=new WebSocket(_0x530ff3||_0x2bfb('0x6'),{'perMessageDeflate':![]});var _0x3cc378='';var _0x2a3afe='0';var _0xa6270c='1';var _0x493c59=_0x2bfb('0x7');function _0xe18fe(_0x134706){var _0x1e6c78=crypto[_0x2bfb('0x8')](_0x2bfb('0x9'));_0x1e6c78[_0x2bfb('0xa')](_0x134706);return _0x1e6c78[_0x2bfb('0xb')](_0x2bfb('0xc'));}function _0x5189e5(){try{logger[_0x2bfb('0x4')](_0x2bfb('0xd'));var _0x5c949b=moment()[_0x2bfb('0xe')]();var _0x22d8b0=_0xe18fe(_0x5c949b+_0x1d5c9b+_0x57d146);_0x580dbf[_0x2bfb('0xf')](JSON[_0x2bfb('0x10')]({'appID':_0x1d5c9b,'timestamp':_0x5c949b,'appKey':_0x22d8b0}));var _0x423033=fs[_0x2bfb('0x11')](_0x2baa7c);_0x423033['on'](_0x2bfb('0x12'),function(_0x424c75){_0x580dbf[_0x2bfb('0xf')](_0x424c75);});_0x423033['on']('close',function(){_0x580dbf['send'](_0x2bfb('0x13'));});}catch(_0x2a2107){logger[_0x2bfb('0x14')]('Tilde\x20ASR\x20send\x20error',JSON[_0x2bfb('0x10')](_0x2a2107));_0x580dbf[_0x2bfb('0x15')]();}}function _0xcce63a(_0x40bd61){try{if(_0x40bd61){var _0x43f16f=JSON[_0x2bfb('0x16')](_0x40bd61);switch(_0x43f16f[_0x2bfb('0x17')]){case 0x0:if(_0x43f16f[_0x2bfb('0x18')]){if(_0x43f16f['result']['final']){logger[_0x2bfb('0x4')](_0x2bfb('0x19'),JSON[_0x2bfb('0x10')](_0x43f16f['result'][_0x2bfb('0x1a')]));_0x3cc378=_0x43f16f[_0x2bfb('0x18')]['hypotheses'][0x0][_0x2bfb('0x1b')];_0x2a3afe=_0x43f16f['result']['hypotheses'][0x0][_0x2bfb('0x1c')];_0xa6270c='0';_0x493c59=_0x2bfb('0x1d');_0x580dbf['terminate']();}}break;case 0x1:logger[_0x2bfb('0x4')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0xa6270c='1';_0x493c59=_0x2bfb('0x7');break;case 0x2:logger['info'](_0x2bfb('0x1e'));_0xa6270c='2';_0x493c59=_0x2bfb('0x1e');break;case 0x9:logger[_0x2bfb('0x4')](_0x2bfb('0x1f'));_0xa6270c='9';_0x493c59=_0x2bfb('0x1f');break;case 0xa:logger['info'](_0x2bfb('0x20'));_0xa6270c='10';_0x493c59=_0x2bfb('0x20');break;case 0xb:logger[_0x2bfb('0x4')](_0x2bfb('0x21'));_0xa6270c='11';_0x493c59=_0x2bfb('0x21');}}}catch(_0x264df2){logger[_0x2bfb('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x264df2));_0x580dbf['terminate']();}}function _0x1aa6a2(){logger[_0x2bfb('0x4')](_0x2bfb('0x22'));_0x6103d6({'transcript':_0x3cc378,'confidence':_0x2a3afe,'status':_0xa6270c,'status_message':_0x493c59});}function _0x240167(_0x320013){logger['error'](_0x2bfb('0x23'));if(!_[_0x2bfb('0x24')](_0x320013)){logger[_0x2bfb('0x14')](_['isObject'](_0x320013)?JSON[_0x2bfb('0x10')](_0x320013):_0x320013);}}_0x580dbf['on'](_0x2bfb('0x25'),_0x5189e5);_0x580dbf['on'](_0x2bfb('0x26'),_0xcce63a);_0x580dbf['on'](_0x2bfb('0x27'),_0x1aa6a2);_0x580dbf['on'](_0x2bfb('0x14'),_0x240167);});}; \ No newline at end of file +var _0x3109=['Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.'];(function(_0x181c8f,_0x840879){var _0x3597bb=function(_0x7f33d3){while(--_0x7f33d3){_0x181c8f['push'](_0x181c8f['shift']());}};_0x3597bb(++_0x840879);}(_0x3109,0xc7));var _0x9310=function(_0x1b39ad,_0x5b7648){_0x1b39ad=_0x1b39ad-0x0;var _0x2a79b1=_0x3109[_0x1b39ad];return _0x2a79b1;};'use strict';var BPromise=require(_0x9310('0x0'));var _=require(_0x9310('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9310('0x2'));var crypto=require(_0x9310('0x3'));var logger=require(_0x9310('0x4'))('agi');module[_0x9310('0x5')]=function(_0xdc1757,_0x575961,_0x1a6e81,_0x556f1f){return new BPromise(function(_0x4b6919,_0xa35262){logger[_0x9310('0x6')](_0x9310('0x7'),_0x556f1f||_0x9310('0x8'));var _0x5c0b9f=new WebSocket(_0x556f1f||_0x9310('0x8'),{'perMessageDeflate':![]});var _0x573632='';var _0x271e50='0';var _0x4db3ac='1';var _0x345d62='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x594028(_0x52505d){var _0x13940c=crypto[_0x9310('0x9')]('sha1');_0x13940c['update'](_0x52505d);return _0x13940c['digest']('hex');}function _0x439c5e(){try{logger[_0x9310('0x6')](_0x9310('0xa'));var _0x42947f=moment()[_0x9310('0xb')]();var _0x1c685d=_0x594028(_0x42947f+_0x575961+_0x1a6e81);_0x5c0b9f[_0x9310('0xc')](JSON[_0x9310('0xd')]({'appID':_0x575961,'timestamp':_0x42947f,'appKey':_0x1c685d}));var _0x4ce275=fs[_0x9310('0xe')](_0xdc1757);_0x4ce275['on'](_0x9310('0xf'),function(_0x43dba2){_0x5c0b9f['send'](_0x43dba2);});_0x4ce275['on'](_0x9310('0x10'),function(){_0x5c0b9f['send'](_0x9310('0x11'));});}catch(_0x5df15f){logger['error'](_0x9310('0x12'),JSON[_0x9310('0xd')](_0x5df15f));_0x5c0b9f[_0x9310('0x13')]();}}function _0x52f82a(_0x344928){try{if(_0x344928){var _0x4af695=JSON[_0x9310('0x14')](_0x344928);switch(_0x4af695[_0x9310('0x15')]){case 0x0:if(_0x4af695[_0x9310('0x16')]){if(_0x4af695[_0x9310('0x16')][_0x9310('0x17')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x9310('0xd')](_0x4af695[_0x9310('0x16')][_0x9310('0x18')]));_0x573632=_0x4af695[_0x9310('0x16')]['hypotheses'][0x0][_0x9310('0x19')];_0x271e50=_0x4af695[_0x9310('0x16')][_0x9310('0x18')][0x0]['likelihood'];_0x4db3ac='0';_0x345d62=_0x9310('0x1a');_0x5c0b9f['terminate']();}}break;case 0x1:logger[_0x9310('0x6')](_0x9310('0x1b'));_0x4db3ac='1';_0x345d62=_0x9310('0x1b');break;case 0x2:logger[_0x9310('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x4db3ac='2';_0x345d62=_0x9310('0x1c');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4db3ac='9';_0x345d62=_0x9310('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x4db3ac='10';_0x345d62=_0x9310('0x1e');break;case 0xb:logger['info'](_0x9310('0x1f'));_0x4db3ac='11';_0x345d62=_0x9310('0x1f');}}}catch(_0x501a3b){logger['error'](_0x9310('0x20'),JSON[_0x9310('0xd')](_0x501a3b));_0x5c0b9f['terminate']();}}function _0x531be5(){logger[_0x9310('0x6')](_0x9310('0x21'));_0x4b6919({'transcript':_0x573632,'confidence':_0x271e50,'status':_0x4db3ac,'status_message':_0x345d62});}function _0x48bc24(_0x440eed){logger[_0x9310('0x22')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x9310('0x23')](_0x440eed)){logger[_0x9310('0x22')](_[_0x9310('0x24')](_0x440eed)?JSON[_0x9310('0xd')](_0x440eed):_0x440eed);}}_0x5c0b9f['on'](_0x9310('0x25'),_0x439c5e);_0x5c0b9f['on']('message',_0x52f82a);_0x5c0b9f['on'](_0x9310('0x10'),_0x531be5);_0x5c0b9f['on'](_0x9310('0x22'),_0x48bc24);});}; \ 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 d9b2690..220e11c 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 _0x93dc=['exports','./asr'];(function(_0x28df3e,_0x5eb77e){var _0x3c162a=function(_0x1ca2d9){while(--_0x1ca2d9){_0x28df3e['push'](_0x28df3e['shift']());}};_0x3c162a(++_0x5eb77e);}(_0x93dc,0x1a3));var _0xc93d=function(_0x42f069,_0x56db02){_0x42f069=_0x42f069-0x0;var _0x4ad6e6=_0x93dc[_0x42f069];return _0x4ad6e6;};var asr=require(_0xc93d('0x0'));module[_0xc93d('0x1')]={'asr':asr}; \ No newline at end of file +var _0x7951=['exports','./asr'];(function(_0x5c6469,_0x54afe8){var _0x4a85d0=function(_0x668156){while(--_0x668156){_0x5c6469['push'](_0x5c6469['shift']());}};_0x4a85d0(++_0x54afe8);}(_0x7951,0xf5));var _0x1795=function(_0x4f3979,_0x2a1908){_0x4f3979=_0x4f3979-0x0;var _0x50e544=_0x7951[_0x4f3979];return _0x50e544;};var asr=require(_0x1795('0x0'));module[_0x1795('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 5552949..666da8e 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 _0xbf29=['destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','nextTick','inherits','exports','util','net','events','./error','127.0.0.1','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED'];(function(_0x93aa24,_0x2363ba){var _0x5252ad=function(_0x382c59){while(--_0x382c59){_0x93aa24['push'](_0x93aa24['shift']());}};_0x5252ad(++_0x2363ba);}(_0xbf29,0x1d3));var _0x9bf2=function(_0x450091,_0x4b6700){_0x450091=_0x450091-0x0;var _0x2ec898=_0xbf29[_0x450091];return _0x2ec898;};'use strict';var util=require(_0x9bf2('0x0'));var net=require(_0x9bf2('0x1'));var EventEmitter=require(_0x9bf2('0x2'))['EventEmitter'];var AGIError=require(_0x9bf2('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0xa88d1d,_0x27c468,_0x360fac){var _0x24320e=this,_0xa88d1d=_0xa88d1d||0x11dd,_0x27c468=_0x27c468||_0x9bf2('0x4'),_0x260fb4=null,_0x46a462=0x0;EventEmitter['call'](_0x24320e);function _0x3fc380(){if(!_0xa88d1d){_0x24320e['emit'](_0x9bf2('0x5'),new AGIError(_0x9bf2('0x6')));return![];}_0x260fb4=net[_0x9bf2('0x7')]();_0x260fb4[_0x9bf2('0x8')](_0xa88d1d,_0x27c468);_0x260fb4['on'](_0x9bf2('0x9'),function(){_0x24320e[_0x9bf2('0xa')](_0x9bf2('0x9'));});_0x260fb4['on']('connection',function(_0x1f0bd4){_0x260fb4['getConnections'](function(_0x3ea402,_0x237eb6){if(_0x3ea402){_0x24320e[_0x9bf2('0xa')](_0x9bf2('0x5'),new AGIError(_0x9bf2('0xb'),_0x3ea402));}else if(_0x360fac&&_0x360fac<0x0){_0x24320e['emit'](_0x9bf2('0x5'),new AGIError(_0x9bf2('0xc')));_0x1f0bd4[_0x9bf2('0xd')]();}else if(_0x360fac&&_0x360fac>0x0&&_0x360fac<_0x237eb6){_0x46a462+=0x1;_0x24320e['emit'](_0x9bf2('0x5'),new AGIError(_0x9bf2('0xe'),_0x46a462));_0x1f0bd4[_0x9bf2('0xd')]();}else{var _0x557996=new AGIChannel(_0x1f0bd4);_0x557996['on'](_0x9bf2('0xf'),function(){_0x24320e[_0x9bf2('0xa')](_0x9bf2('0x10'),_0x557996);});}});});_0x260fb4['on']('error',function(_0xc6a3d2){_0x24320e['emit'](_0x9bf2('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0xc6a3d2['code']));});_0x260fb4['on']('close',function(){_0x24320e['emit']('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x9bf2('0x11')](function(){_0x3fc380();});};util[_0x9bf2('0x12')](AGIServer,EventEmitter);module[_0x9bf2('0x13')]=function(_0x54f62b,_0x4e3a31,_0x1c7dfb){return new AGIServer(_0x54f62b,_0x4e3a31,_0x1c7dfb);}; \ No newline at end of file +var _0x9da1=['util','net','events','./error','./channel','emit','createServer','listen','listening','connection','getConnections','error','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','inherits','exports'];(function(_0x212579,_0xdb4d5a){var _0x55d50e=function(_0x38fa1d){while(--_0x38fa1d){_0x212579['push'](_0x212579['shift']());}};_0x55d50e(++_0xdb4d5a);}(_0x9da1,0xab));var _0x19da=function(_0x32ff1d,_0x3e29bb){_0x32ff1d=_0x32ff1d-0x0;var _0x50489e=_0x9da1[_0x32ff1d];return _0x50489e;};'use strict';var util=require(_0x19da('0x0'));var net=require(_0x19da('0x1'));var EventEmitter=require(_0x19da('0x2'))['EventEmitter'];var AGIError=require(_0x19da('0x3'));var AGIChannel=require(_0x19da('0x4'));var AGIServer=function(_0x27270b,_0x338344,_0x378b7d){var _0x571ed5=this,_0x27270b=_0x27270b||0x11dd,_0x338344=_0x338344||'127.0.0.1',_0x2d4dbc=null,_0x3a0642=0x0;EventEmitter['call'](_0x571ed5);function _0x2ab612(){if(!_0x27270b){_0x571ed5[_0x19da('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x2d4dbc=net[_0x19da('0x6')]();_0x2d4dbc[_0x19da('0x7')](_0x27270b,_0x338344);_0x2d4dbc['on'](_0x19da('0x8'),function(){_0x571ed5[_0x19da('0x5')]('listening');});_0x2d4dbc['on'](_0x19da('0x9'),function(_0x574d65){_0x2d4dbc[_0x19da('0xa')](function(_0xdb5cc8,_0x395e91){if(_0xdb5cc8){_0x571ed5['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xdb5cc8));}else if(_0x378b7d&&_0x378b7d<0x0){_0x571ed5['emit'](_0x19da('0xb'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x574d65[_0x19da('0xc')]();}else if(_0x378b7d&&_0x378b7d>0x0&&_0x378b7d<_0x395e91){_0x3a0642+=0x1;_0x571ed5[_0x19da('0x5')](_0x19da('0xb'),new AGIError(_0x19da('0xd'),_0x3a0642));_0x574d65[_0x19da('0xc')]();}else{var _0x503767=new AGIChannel(_0x574d65);_0x503767['on'](_0x19da('0xe'),function(){_0x571ed5[_0x19da('0x5')]('connection',_0x503767);});}});});_0x2d4dbc['on'](_0x19da('0xb'),function(_0x14a523){_0x571ed5['emit'](_0x19da('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x14a523[_0x19da('0xf')]));});_0x2d4dbc['on'](_0x19da('0x10'),function(){_0x571ed5['emit'](_0x19da('0x10'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x2ab612();});};util[_0x19da('0x11')](AGIServer,EventEmitter);module[_0x19da('0x12')]=function(_0x36254c,_0x4ea9de,_0x5b7e8b){return new AGIServer(_0x36254c,_0x4ea9de,_0x5b7e8b);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 644282a..4efaa92 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 _0x3940=['Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause_id','playback','PLAYBACK','opts','queue','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','200','%s_STATUS_MESSAGE','statusMessage','saydigits','sayDigits','digits','saynumber','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','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','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','shelljs','randomstring','moment','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','shellCommand','exec','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','render','stringify','body','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','model','awsPolly','aws_polly_region','aws_text_type','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','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','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured'];(function(_0x4f2626,_0x3045ad){var _0xd8673c=function(_0x2be27d){while(--_0x2be27d){_0x4f2626['push'](_0x4f2626['shift']());}};_0xd8673c(++_0x3045ad);}(_0x3940,0xa6));var _0x0394=function(_0x5a84d3,_0x18554c){_0x5a84d3=_0x5a84d3-0x0;var _0xd11d84=_0x3940[_0x5a84d3];return _0xd11d84;};'use strict';var fs=require('fs');var path=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var _=require('lodash');var sh=require(_0x0394('0x2'));var odbc=require('odbc')();var rs=require(_0x0394('0x3'));var moment=require(_0x0394('0x4'));var Mustache=require('mustache');var rp=require(_0x0394('0x5'));var logger=require('../../config/logger')(_0x0394('0x6'));var config=require(_0x0394('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x0394('0x8');var recursiveMapAttributes=[_0x0394('0x9'),'rawBody'];var verticesWithRetry=[_0x0394('0xa'),'getdigits',_0x0394('0xb')];var AGIVertices=function(_0x9b3b2f,_0xdcc778,_0x3c2968){this[_0x0394('0xc')]=_0x9b3b2f;this[_0x0394('0xd')]=_0xdcc778;this[_0x0394('0xe')]=_0x3c2968;};AGIVertices[_0x0394('0xf')][_0x0394('0x10')]=function(_0x50c4a7,_0x569fb3){this[_0x0394('0xd')][_0x0394('0x11')](_0x50c4a7)[_0x0394('0x12')](function(_0x46c0f8){_0x569fb3(null,_0x46c0f8?_0x46c0f8['name']:![]);})[_0x0394('0x13')](function(_0x7c3d40){_0x569fb3(_0x7c3d40);});};AGIVertices[_0x0394('0xf')]['getVoiceQueue']=function(_0x2762d7,_0x53cc66){this[_0x0394('0xd')][_0x0394('0x14')](_0x2762d7)[_0x0394('0x12')](function(_0x152622){_0x53cc66(null,_0x152622?_0x152622[_0x0394('0x15')]:![]);})[_0x0394('0x13')](function(_0x2d3caf){_0x53cc66(_0x2d3caf);});};AGIVertices['prototype'][_0x0394('0x16')]=function(_0x2ee844,_0x3e4e23){this[_0x0394('0xd')][_0x0394('0x17')](_0x2ee844)[_0x0394('0x12')](function(_0x208aa3){_0x3e4e23(null,_0x208aa3?_0x208aa3['name']:![]);})['catch'](function(_0x18d8f7){_0x3e4e23(_0x18d8f7);});};AGIVertices['prototype'][_0x0394('0x18')]=function(_0x2b0342,_0x2d7384){this[_0x0394('0xd')][_0x0394('0x19')](_0x2b0342)[_0x0394('0x12')](function(_0x5d805c){_0x2d7384(null,_0x5d805c?_0x5d805c[_0x0394('0x1a')]:![]);})[_0x0394('0x13')](function(_0xf9a971){_0x2d7384(_0xf9a971);});};AGIVertices[_0x0394('0xf')][_0x0394('0x1b')]=function(_0x3d8985,_0x798a55){this['rpc'][_0x0394('0x1c')](_0x3d8985)[_0x0394('0x12')](function(_0x39d784){_0x798a55(null,_0x39d784?_0x39d784[_0x0394('0x15')]:![]);})['catch'](function(_0x2a96fa){_0x798a55(_0x2a96fa);});};AGIVertices[_0x0394('0xf')][_0x0394('0x1d')]=function(_0x2f2a86,_0x37faa7){this['rpc'][_0x0394('0x1e')](_0x2f2a86)['then'](function(_0xaada5e){_0x37faa7(null,_0xaada5e?_0xaada5e[_0x0394('0x15')]:![]);})[_0x0394('0x13')](function(_0x11b7ca){_0x37faa7(_0x11b7ca);});};AGIVertices[_0x0394('0xf')][_0x0394('0x1f')]=function(_0x22dadc,_0x46e329){var _0x28eede=this;this['rpc'][_0x0394('0x20')](_0x22dadc)[_0x0394('0x12')](function(_0x100635){_0x46e329(null,_0x100635?_0x28eede[_0x0394('0x21')](_0x100635[_0x0394('0x22')]):![]);})[_0x0394('0x13')](function(_0x3e5ff7){_0x46e329(_0x3e5ff7);});};AGIVertices[_0x0394('0xf')][_0x0394('0x23')]=function(_0x537fb8,_0x1060b0){this[_0x0394('0xd')][_0x0394('0x24')](_0x537fb8)['then'](function(_0x24e2e9){_0x1060b0(null,_0x24e2e9?_0x24e2e9:![]);})['catch'](function(_0x25d985){_0x1060b0(_0x25d985);});};AGIVertices[_0x0394('0xf')][_0x0394('0x25')]=function(_0x4fad2,_0x23aad7,_0x1b21c8){this[_0x0394('0xe')][_0x0394('0x25')](_0x4fad2,_0x23aad7)[_0x0394('0x12')](function(){_0x1b21c8(null);})[_0x0394('0x13')](function(_0x5a4231){_0x1b21c8(_0x5a4231);});};AGIVertices[_0x0394('0xf')][_0x0394('0x26')]=function(_0x43aa6b,_0x3c0539){this[_0x0394('0xd')][_0x0394('0x27')](_0x43aa6b)['then'](function(_0x35fad9){if(_0x35fad9){if(_0x35fad9['IntervalId']){_0x3c0539(null,[_0x35fad9[_0x0394('0x28')]]);}else{_0x3c0539(null,_[_0x0394('0x29')](_0x35fad9['Intervals'],_0x0394('0x28')));}}else{_0x3c0539(null,![]);}})[_0x0394('0x13')](function(_0x261fb9){_0x3c0539(_0x261fb9);});};AGIVertices[_0x0394('0xf')][_0x0394('0x21')]=function(_0x5aa789){return util[_0x0394('0x2a')]('%s/sounds/converted/%s',FILES_PATH,_0x5aa789);};AGIVertices[_0x0394('0xf')][_0x0394('0x2b')]=function(_0x1e6ac0,_0x361a7d,_0x4b211a){odbc[_0x0394('0x2c')](_0x1e6ac0,function(_0x995fb2){if(_0x995fb2){logger[_0x0394('0x2d')](_0x0394('0x2e'),_0x995fb2);_0x4b211a(_0x995fb2);}else{logger[_0x0394('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0x0394('0x30')](_0x361a7d,function(_0x2a64f2,_0xed563f){if(_0x2a64f2){logger[_0x0394('0x2f')](_0x0394('0x31'),_0x361a7d);_0x4b211a(_0x2a64f2);}else{logger[_0x0394('0x2f')](_0x0394('0x32'),_0x361a7d);odbc[_0x0394('0x33')](function(_0x30ff0e){if(_0x30ff0e){logger[_0x0394('0x2d')](_0x0394('0x34'),_0x30ff0e);}_0x4b211a(null,_0xed563f);});}});}});};AGIVertices[_0x0394('0xf')][_0x0394('0x35')]=function(_0x324f5a,_0x4d2fa6){this[_0x0394('0xd')][_0x0394('0x36')](_0x324f5a)[_0x0394('0x12')](function(_0xc08143){_0x4d2fa6(null,_0xc08143?_0xc08143:![]);})[_0x0394('0x13')](function(_0x46913b){_0x4d2fa6(_0x46913b);});};AGIVertices[_0x0394('0xf')][_0x0394('0x37')]=function(_0x307e86,_0x3cd550){this[_0x0394('0xd')][_0x0394('0x37')](_0x307e86)[_0x0394('0x12')](function(_0x4cc772){_0x3cd550(null,_0x4cc772);})['catch'](function(_0x36f44f){_0x3cd550(_0x36f44f);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x3e97bd,_0x49a72c,_0x126621){this[_0x0394('0xd')][_0x0394('0x38')]({'uniqueid':this[_0x0394('0xc')]['uniqueid'],'node':_0x3e97bd[_0x0394('0x39')],'application':_0x3e97bd[_0x0394('0x3a')],'data':_0x49a72c||null,'project_name':this[_0x0394('0xc')][_0x0394('0x3b')],'callerid':this[_0x0394('0xc')][_0x0394('0x3c')]})[_0x0394('0x12')](function(_0x340083){if(_0x126621){_0x126621(null,_0x340083);}})[_0x0394('0x13')](function(_0x2bccb8){if(_0x126621){_0x126621(_0x2bccb8);}});};AGIVertices['prototype'][_0x0394('0x3d')]=function(_0x185599,_0x56efa5,_0x2baa24,_0x5ef755){this[_0x0394('0xd')]['createSquareRecording']({'uniqueid':this[_0x0394('0xc')][_0x0394('0x3e')],'callerid':this[_0x0394('0xc')][_0x0394('0x3c')],'calleridname':this['channel'][_0x0394('0x3f')],'context':this['channel']['context'],'extension':this[_0x0394('0xc')][_0x0394('0x40')],'priority':this['channel'][_0x0394('0x41')],'accountcode':this[_0x0394('0xc')][_0x0394('0x42')],'dnid':this[_0x0394('0xc')]['dnid'],'projectName':this[_0x0394('0xc')]['arg_1'],'saveName':_0x56efa5,'filename':_0x185599[_0x0394('0x43')]||_0x56efa5,'savePath':_0x2baa24})['then'](function(_0x292fc7){_0x5ef755(null,_0x292fc7);})[_0x0394('0x13')](function(_0x56d367){_0x5ef755(_0x56d367);});};AGIVertices[_0x0394('0xf')][_0x0394('0x44')]=function(_0x134047,_0x1b6f16,_0x1e6a4e,_0x5bedde,_0x5c67f6){this[_0x0394('0xd')][_0x0394('0x44')]({'uniqueid':this[_0x0394('0xc')][_0x0394('0x3e')],'body':_0x134047,'direction':_0x1b6f16,'providerName':_0x1e6a4e,'providerResponse':_0x5bedde})[_0x0394('0x12')](function(_0x52b60f){if(_0x5c67f6){_0x5c67f6(null,_0x52b60f);}})['catch'](function(_0x32a774){if(_0x5c67f6){_0x5c67f6(_0x32a774);}});};AGIVertices[_0x0394('0xf')][_0x0394('0x45')]=function(_0x225056,_0x3762ca){this['rpc'][_0x0394('0x45')]({'firstName':_[_0x0394('0x46')](_0x225056[_0x0394('0x15')])||_[_0x0394('0x47')](_0x225056[_0x0394('0x15')])?'callback_'+Math[_0x0394('0x48')]():_0x225056[_0x0394('0x15')],'lastName':_['isEmpty'](_0x225056[_0x0394('0x49')])||_[_0x0394('0x47')](_0x225056[_0x0394('0x49')])?null:_0x225056[_0x0394('0x49')],'phone':_0x225056[_0x0394('0x4a')],'ListId':_0x225056[_0x0394('0x4b')],'scheduledat':_0x225056[_0x0394('0x4c')],'callbackUniqueid':this[_0x0394('0xc')]['uniqueid'],'tags':'callback','description':_0x0394('0x4d')+_0x225056[_0x0394('0x4c')][_0x0394('0x4e')](),'priority':_0x225056[_0x0394('0x4f')]})[_0x0394('0x12')](function(_0x2f6515){_0x3762ca(null,_0x2f6515);})[_0x0394('0x13')](function(_0x3f13f7){_0x3762ca(_0x3f13f7);});};AGIVertices[_0x0394('0xf')][_0x0394('0x50')]=function(_0x29a4de,_0x179255){this['rpc'][_0x0394('0x51')](_0x29a4de)[_0x0394('0x12')](function(_0x26b93f){_0x179255(null,_0x26b93f?_0x26b93f[_0x0394('0x15')]:![]);})[_0x0394('0x13')](function(_0x20830e){_0x179255(_0x20830e);});};AGIVertices[_0x0394('0xf')][_0x0394('0x52')]=function(_0x279dd7,_0x2947f1,_0x51434c){var _0xf59cc3={'role':_0x0394('0x53')};_0xf59cc3[_0x279dd7]=this[_0x0394('0xc')][_0x0394('0x3c')];this['rpc'][_0x0394('0x52')](_0xf59cc3,_0x2947f1,this['channel'][_0x0394('0x3e')])['then'](function(_0x39fdfe){_0x51434c(null,_[_0x0394('0x47')](_0x39fdfe)?![]:!![]);})['catch'](function(_0x4d0a8c){logger['error'](_0x4d0a8c);_0x51434c(null,![]);});};AGIVertices['prototype'][_0x0394('0x54')]=function(_0x5bca7d,_0x38a391){var _0x11de19={'role':'agent'};_0x11de19[_0x5bca7d]=this['channel'][_0x0394('0x3c')];this[_0x0394('0xd')][_0x0394('0x54')](_0x11de19)[_0x0394('0x12')](function(_0xee6637){_0x38a391(null,_[_0x0394('0x47')](_0xee6637)?![]:!![]);})[_0x0394('0x13')](function(_0x4fa578){logger['error'](_0x4fa578);_0x38a391(null,![]);});};AGIVertices['prototype'][_0x0394('0x55')]=function(_0x4d39c5,_0x12e7b1){var _0x445ef3={'role':_0x0394('0x53')};_0x445ef3[_0x4d39c5]=this[_0x0394('0xc')]['callerid'];this[_0x0394('0xd')][_0x0394('0x55')](_0x445ef3)['then'](function(_0x50c24f){_0x12e7b1(null,_[_0x0394('0x47')](_0x50c24f)?![]:!![]);})[_0x0394('0x13')](function(_0x3bce00){logger[_0x0394('0x2d')](_0x3bce00);_0x12e7b1(null,![]);});};AGIVertices['prototype'][_0x0394('0x56')]=function(_0x4759cd,_0x55f69f){var _0x3b9fad={'role':_0x0394('0x53')};_0x3b9fad[_0x4759cd]=this['channel']['callerid'];var _0x52b402=_0x4759cd!=_0x0394('0x57')?util[_0x0394('0x2a')]('%s/%s@from-sip/n','LOCAL',this[_0x0394('0xc')]['callerid']):undefined;this['rpc']['agentLogin'](_0x3b9fad,_0x52b402)[_0x0394('0x12')](function(_0x179703){_0x55f69f(null,_[_0x0394('0x47')](_0x179703)?![]:!![]);})[_0x0394('0x13')](function(_0x42cb6a){logger[_0x0394('0x2d')](_0x42cb6a);_0x55f69f(null,![]);});};AGIVertices['prototype'][_0x0394('0x58')]=function(_0x25541e,_0xd751f4){sh[_0x0394('0x59')](_['trim'](_0x25541e),function(_0x2fa131,_0x1140b0){var _0x2c3ed8=_0x1140b0[_0x0394('0x5a')](/(\r\n|\n|\r)/gm,'');_0xd751f4(null,_0x2c3ed8);});};AGIVertices[_0x0394('0xf')][_0x0394('0x5b')]=function(_0x15495b,_0x178c32){scripts[_0x0394('0x5b')](_0x15495b['apiKey'],_0x15495b[_0x0394('0x5c')]||_0x0394('0x5d'),_0x15495b[_0x0394('0x5d')],_0x15495b[_0x0394('0x5e')]||_0x0394('0x5f'),_0x15495b[_0x0394('0x60')]||_0x0394('0x61'),_0x15495b[_0x0394('0x62')]||'MP3')[_0x0394('0x12')](function(_0x2f22f3){_0x178c32(null,_0x2f22f3);})['catch'](function(_0x1ad6f2){_0x178c32(_0x1ad6f2);});};AGIVertices['prototype'][_0x0394('0x63')]=function(_0x16dfd8,_0x497dac){scripts[_0x0394('0x63')](_0x16dfd8[_0x0394('0x5d')],_0x16dfd8[_0x0394('0x64')]||'en',0x1)[_0x0394('0x12')](function(_0x1e1dd8){_0x497dac(null,_0x1e1dd8);})[_0x0394('0x13')](function(_0x263b5e){_0x497dac(_0x263b5e);});};AGIVertices[_0x0394('0xf')][_0x0394('0x65')]=function(_0xdc1734,_0x47748b){var _0x526658={'uri':_0xdc1734[_0x0394('0x66')],'method':_0xdc1734[_0x0394('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xdc1734[_0x0394('0x68')])==='number'&&parseInt(_0xdc1734[_0x0394('0x68')])>=0x1?parseInt(_0xdc1734[_0x0394('0x68')])*0x3e8:0x5*0x3e8};if(_[_0x0394('0x69')]([_0x0394('0x6a'),_0x0394('0x6b')],_0x526658[_0x0394('0x67')][_0x0394('0x6c')]())){try{_0x526658['body']=_0xdc1734[_0x0394('0x6d')]?JSON[_0x0394('0x6e')](_0xdc1734[_0x0394('0x6d')]):{};}catch(_0x17e1d8){logger['error'](_0x0394('0x6f'),_0x17e1d8);}}try{_0x526658['headers']=_0xdc1734[_0x0394('0x9')]?JSON[_0x0394('0x6e')](_0xdc1734[_0x0394('0x9')]):{};}catch(_0x329fb0){logger[_0x0394('0x2d')](_0x0394('0x70'),_0x329fb0);}if(_0xdc1734['computedVariables']){try{var _0x3016a2=require(_0xdc1734[_0x0394('0x71')])[_0x0394('0x72')](this,_0x526658);_0x526658[_0x0394('0x73')]=Mustache['render'](_0xdc1734[_0x0394('0x66')],_0x3016a2,{},['$$','$$']);if(_0x526658['headers']){_0x526658[_0x0394('0x74')]=JSON['parse'](Mustache[_0x0394('0x75')](JSON[_0x0394('0x76')](_0x526658['headers']),_0x3016a2,{},['$$','$$']));}if(_0x526658['body']){_0x526658[_0x0394('0x77')]=JSON['parse'](Mustache[_0x0394('0x75')](JSON[_0x0394('0x76')](_0x526658[_0x0394('0x77')]),_0x3016a2,{},['$$','$$']));}}catch(_0x24641d){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x24641d);}}rp(_0x526658)[_0x0394('0x12')](function(_0x82e170){var _0x5e4c0c={'statusCode':_0x82e170[_0x0394('0x78')]||0xc8,'statusMessage':_0x82e170['statusMessage']||'OK','headers':_0x82e170[_0x0394('0x74')]||{},'body':_0x82e170[_0x0394('0x77')]||{}};_0x47748b(null,_0x5e4c0c);})[_0x0394('0x13')](function(_0x103330){var _0x4ab10e={'statusCode':_0x103330[_0x0394('0x78')]||0x1f4,'statusMessage':_0x103330[_0x0394('0x79')]||_0x0394('0x7a'),'headers':_0x103330[_0x0394('0x7b')][_0x0394('0x74')]||{},'body':_0x103330[_0x0394('0x7b')][_0x0394('0x77')]||{}};_0x47748b(null,_0x4ab10e);});};AGIVertices['prototype'][_0x0394('0x7c')]=function(_0x14e396,_0x4e6ccd){scripts[_0x0394('0x7c')](this[_0x0394('0xc')][_0x0394('0x3e')],_0x14e396['key'],_0x14e396['text'],_0x14e396[_0x0394('0x7d')]||'en')[_0x0394('0x12')](function(_0x2010c1){_0x4e6ccd(null,_0x2010c1);})[_0x0394('0x13')](function(_0x397d81){_0x4e6ccd(_0x397d81);});};AGIVertices[_0x0394('0xf')][_0x0394('0x7e')]=function(_0x174228,_0x3bccbb){scripts[_0x0394('0x7e')](this[_0x0394('0xc')][_0x0394('0x3e')],_0x174228['dialogflowV2_project_id'],_0x174228[_0x0394('0x7f')],_0x174228[_0x0394('0x80')],_0x174228[_0x0394('0x5d')],_0x174228['dialogflowV2_language']||'en')['then'](function(_0x17b74d){_0x3bccbb(null,_0x17b74d);})[_0x0394('0x13')](function(_0x50fc95){_0x3bccbb(_0x50fc95);});};AGIVertices[_0x0394('0xf')]['sestekNDA']=function(_0x1e70c2,_0xba93ea){scripts[_0x0394('0x81')](this['channel'],_0x1e70c2)[_0x0394('0x12')](function(_0x3f73c3){_0xba93ea(null,_0x3f73c3);})[_0x0394('0x13')](function(_0x57b9d8){_0xba93ea(_0x57b9d8);});};AGIVertices['prototype']['ispeechTTS']=function(_0x494079,_0x284f8b){scripts[_0x0394('0x82')](_0x494079[_0x0394('0x83')],_0x494079[_0x0394('0x5d')],_0x494079[_0x0394('0x84')]||_0x0394('0x5f'),_0x494079[_0x0394('0x85')])[_0x0394('0x12')](function(_0x47ec00){_0x284f8b(null,_0x47ec00);})[_0x0394('0x13')](function(_0x3b5f58){_0x284f8b(_0x3b5f58);});};AGIVertices[_0x0394('0xf')][_0x0394('0x86')]=function(_0x59c956,_0x49763e,_0x550ce1){scripts['ispeechASR'](_0x49763e,_0x59c956['key'],_0x59c956['ispeech_asr_language']||_0x0394('0x5f'),this['isConfigured'](_0x59c956['model'])?_0x59c956[_0x0394('0x87')]:undefined)[_0x0394('0x12')](function(_0x33eea5){_0x550ce1(null,_0x33eea5);})['catch'](function(_0x3abd6a){_0x550ce1(_0x3abd6a);});};AGIVertices[_0x0394('0xf')][_0x0394('0x88')]=function(_0x575528,_0x2eb0a5){scripts[_0x0394('0x88')](_0x575528['aws_access_key_id'],_0x575528['aws_secret_access_key'],_0x575528[_0x0394('0x89')],_0x575528['aws_polly_voice']||'Amy',_0x575528[_0x0394('0x5d')],_0x575528[_0x0394('0x8a')]||'text')['then'](function(_0x1d437c){_0x2eb0a5(null,_0x1d437c);})['catch'](function(_0x543e89){_0x2eb0a5(_0x543e89);});};AGIVertices[_0x0394('0xf')][_0x0394('0x8b')]=function(_0x3da3ee,_0x40601f){scripts[_0x0394('0x8b')](this[_0x0394('0xc')]['uniqueid'],_0x3da3ee[_0x0394('0x8c')],_0x3da3ee[_0x0394('0x8d')],_0x3da3ee[_0x0394('0x8e')],_0x3da3ee[_0x0394('0x5d')],_0x3da3ee[_0x0394('0x8f')])['then'](function(_0x15d7bc){_0x40601f(null,_0x15d7bc);})[_0x0394('0x13')](function(_0x2a9b6e){_0x40601f(_0x2a9b6e);});};AGIVertices['prototype'][_0x0394('0x90')]=function(_0x48dd85,_0x2726ec,_0x310161){scripts[_0x0394('0x90')](_0x2726ec,_0x48dd85[_0x0394('0x83')],_0x48dd85['google_asr_language']||_0x0394('0x5f'))['then'](function(_0x528cf9){_0x310161(null,_0x528cf9);})[_0x0394('0x13')](function(_0x13c180){_0x310161(_0x13c180);});};AGIVertices['prototype'][_0x0394('0x91')]=function(_0x48443f,_0x576830,_0x5943fd){scripts[_0x0394('0x91')](_0x576830,_0x48443f[_0x0394('0x92')],_0x48443f[_0x0394('0x93')],_0x48443f[_0x0394('0x73')])[_0x0394('0x12')](function(_0x4cad14){_0x5943fd(null,_0x4cad14);})['catch'](function(_0x46bc8e){_0x5943fd(_0x46bc8e);});};AGIVertices[_0x0394('0xf')][_0x0394('0x94')]=function(_0x1dd217){var _0x36c44e=_['includes'](verticesWithRetry,_0x1dd217['agicommand'])?_0x1dd217:_[_0x0394('0x95')](_0x1dd217);for(var _0x3a2fc4 in _0x36c44e){if(_0x36c44e[_0x0394('0x96')](_0x3a2fc4)){if(_0x36c44e[_0x3a2fc4]&&_[_0x0394('0x97')](_0x36c44e[_0x3a2fc4])){if(_['includes'](recursiveMapAttributes,_0x3a2fc4)){_0x36c44e[_0x3a2fc4]=this[_0x0394('0x98')](_0x36c44e[_0x3a2fc4]);}else{_0x36c44e[_0x3a2fc4]=this[_0x0394('0x99')](_0x36c44e[_0x3a2fc4]);}}}}return _0x36c44e;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x28869f){for(var _0x4575e8 in _0x28869f){if(_0x28869f[_0x0394('0x96')](_0x4575e8)){if(_[_0x0394('0x9a')](_0x28869f[_0x4575e8])){this[_0x0394('0x9b')](_0x28869f[_0x4575e8]);}else if(_[_0x0394('0x9c')](_0x28869f[_0x4575e8])){for(var _0x716a1f=0x0;_0x716a1f<_0x28869f[_0x4575e8][_0x0394('0x9d')];_0x716a1f++){this[_0x0394('0x9b')](_0x28869f[_0x4575e8][_0x716a1f]);}}else if(_['isString'](_0x28869f[_0x4575e8])){_0x28869f[_0x4575e8]=this[_0x0394('0x99')](_0x28869f[_0x4575e8]);}}}};AGIVertices[_0x0394('0xf')][_0x0394('0x9e')]=function(_0x4801cb,_0x156488){for(var _0x3c07a3 in _0x4801cb){if(_0x4801cb[_0x0394('0x96')](_0x3c07a3)){if(_[_0x0394('0x9a')](_0x4801cb[_0x3c07a3])){if(!_[_0x0394('0x46')](_0x4801cb[_0x3c07a3])){this['saveRestApiResult'](_0x4801cb[_0x3c07a3],util[_0x0394('0x2a')](_0x0394('0x9f'),_0x156488,_0x3c07a3));}}else if(_['isArray'](_0x4801cb[_0x3c07a3])){for(var _0xe0326f=0x0;_0xe0326f<_0x4801cb[_0x3c07a3]['length'];_0xe0326f++){this[_0x0394('0x9e')](_0x4801cb[_0x3c07a3][_0xe0326f],util[_0x0394('0x2a')]('%s.%s',_0x156488,_0x3c07a3+'['+_0xe0326f+']'));}}else{if(!_[_0x0394('0x47')](_0x4801cb[_0x3c07a3])){this['channel'][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0x9f'),_0x156488,_0x3c07a3),_0x4801cb[_0x3c07a3]);}}}}};AGIVertices[_0x0394('0xf')][_0x0394('0x98')]=function(_0x5b22c2){try{var _0xbd7b1f=JSON['parse'](_0x5b22c2);this['recursiveNodeIndex'](_0xbd7b1f);return JSON[_0x0394('0x76')](_0xbd7b1f);}catch(_0x2c0a74){return this[_0x0394('0x99')](_0x5b22c2);}};AGIVertices['prototype'][_0x0394('0x99')]=function(_0x221d90){var _0x588bde=_0x221d90[_0x0394('0xa1')]('{');for(var _0x39b9e9=0x1;_0x39b9e9<_0x588bde[_0x0394('0x9d')];_0x39b9e9+=0x1){var _0x2c0403=_0x588bde[_0x39b9e9]['split']('}');if(_0x2c0403[_0x0394('0x9d')]>0x1){_0x221d90=_0x221d90['replaceAll']('{'+_0x2c0403[0x0]+'}',this[_0x0394('0xc')][_0x0394('0x10')](_0x2c0403[0x0])[_0x0394('0xa2')]||_0x2c0403[0x0]);}}if(_0x588bde[_0x0394('0x9d')]===0x1){return _0x221d90['toString']();}return this['replaceAllVariables'](_0x221d90);};AGIVertices[_0x0394('0xf')][_0x0394('0xa3')]=function(_0x53e005,_0x974acf){var _0x320f7f=this['channel'][_0x0394('0x10')](_0x53e005);if(_0x320f7f[_0x0394('0xa4')]===-0x1){return _0x320f7f;}logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xa5'),_0x974acf,_0x320f7f[_0x0394('0xa2')]));return this[_0x0394('0xc')][_0x0394('0xa0')](_0x974acf,_0x320f7f['extra']);};AGIVertices[_0x0394('0xf')]['isConfigured']=function(_0x227ed3){return _0x227ed3&&_0x227ed3!=='0'&&_0x227ed3!=='-1'&&_0x227ed3!=='';};AGIVertices[_0x0394('0xf')][_0x0394('0xa6')]=function(_0x402fbb){this[_0x0394('0x38')]['sync'](this,_0x402fbb,'-');_0x402fbb[_0x0394('0xa7')]=_0x402fbb[_0x0394('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0394('0xf')][_0x0394('0xa8')]=function(_0x3f554e){logger[_0x0394('0x2f')](util['format'](_0x0394('0xa9'),_0x3f554e[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x3f554e[_0x0394('0x5d')])){return this['channel'][_0x0394('0xab')]('no\x20text\x20configured');}var _0x2954cf='\x22'+_0x3f554e[_0x0394('0x5d')]+'\x22';if(this['isConfigured'](_0x3f554e[_0x0394('0x7b')])){_0x2954cf+=','+_0x3f554e['options'];}var _0x179df2=this['channel'][_0x0394('0x59')](_0x0394('0xac'),_0x2954cf);if(_0x179df2[_0x0394('0xa4')]===-0x1){return _0x179df2;}return this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xad'),_0x2954cf));};AGIVertices[_0x0394('0xf')][_0x0394('0xae')]=function(_0x5bf6f2){logger['info'](util[_0x0394('0x2a')](_0x0394('0xaf'),_0x5bf6f2[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x5bf6f2[_0x0394('0xb0')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xb1'));}var _0x454f16=_0x5bf6f2['grammar'];if(this[_0x0394('0xaa')](_0x5bf6f2[_0x0394('0x7b')])){_0x454f16+=','+_0x5bf6f2[_0x0394('0x7b')];}var _0x27e98f=this[_0x0394('0xc')][_0x0394('0x59')](_0x0394('0xb2'),_0x454f16);if(_0x27e98f['result']===-0x1){return _0x27e98f;}var _0x3111a8=this['getAndSetVariable'](_0x0394('0xb3'),_0x0394('0xb4'));if(_0x3111a8[_0x0394('0xa4')]===-0x1){return _0x3111a8;}var _0x3ebb9e=this[_0x0394('0xa3')]('RECOG_INPUT()',_0x0394('0xb5'));if(_0x3ebb9e[_0x0394('0xa4')]===-0x1){return _0x3ebb9e;}var _0x5b41cf=this[_0x0394('0xa3')](_0x0394('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x5b41cf[_0x0394('0xa4')]===-0x1){return _0x5b41cf;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xb7'),_0x454f16));};AGIVertices['prototype']['agi']=function(_0x59e360){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x59e360[_0x0394('0x39')]));return this[_0x0394('0xc')]['agi']([_0x59e360['command'],_0x59e360[_0x0394('0xb8')]]);};AGIVertices[_0x0394('0xf')][_0x0394('0xb9')]=function(_0xd29c18){logger['info'](util[_0x0394('0x2a')](_0x0394('0xba'),_0xd29c18['label']));if(this[_0x0394('0xaa')](_0xd29c18[_0x0394('0x68')])){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xbb'),_0xd29c18['timeout']));var _0x262dde=this[_0x0394('0xc')][_0x0394('0xbc')](_0xd29c18['timeout']);if(_0x262dde[_0x0394('0xa4')]===-0x1){return _0x262dde;}}return this[_0x0394('0xc')]['answer']();};AGIVertices[_0x0394('0xf')][_0x0394('0xbd')]=function(_0x298d60){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xbe'),_0x298d60['label']));if(!this['isConfigured'](_0x298d60[_0x0394('0x4b')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x298d60,_0x0394('0xbf'));}_0x298d60[_0x0394('0x4c')]=moment();if(this[_0x0394('0xaa')](_0x298d60['delay'])){_0x298d60['scheduledAt']=moment()['add'](_0x298d60[_0x0394('0xc0')],_0x0394('0xc1'));}if(!this[_0x0394('0xaa')](_0x298d60[_0x0394('0x4f')])){_0x298d60[_0x0394('0x4f')]=0x2;}this[_0x0394('0x45')][_0x0394('0x72')](this,_0x298d60);return this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0xc2'),_0x298d60['phone'],_0x298d60[_0x0394('0x4b')],_0x298d60[_0x0394('0x4c')]));};AGIVertices[_0x0394('0xf')]['custom_app']=function(_0x455b34){logger[_0x0394('0x2f')](util['format'](_0x0394('0xc3'),_0x455b34[_0x0394('0x39')]));var _0x518e43=this[_0x0394('0xc')][_0x0394('0x59')](_0x455b34['application'],_0x455b34['options']);if(_0x518e43['result']===-0x1){return _0x518e43;}return this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xc4'),_0x455b34[_0x0394('0xc5')],_0x455b34[_0x0394('0x7b')]));};AGIVertices[_0x0394('0xf')][_0x0394('0xc6')]=function(_0x1eeb63){logger['info'](util[_0x0394('0x2a')](_0x0394('0xc7'),_0x1eeb63[_0x0394('0x39')]));if(!this['isConfigured'](_0x1eeb63[_0x0394('0x5d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}var _0x43bb10='\x22'+_0x1eeb63[_0x0394('0x5d')]+'\x22';if(this['isConfigured'](_0x1eeb63[_0x0394('0x7b')])){_0x43bb10+=','+_0x1eeb63[_0x0394('0x7b')];}var _0x4f6d35=this[_0x0394('0xc')][_0x0394('0x59')](_0x0394('0xac'),_0x43bb10);if(_0x4f6d35[_0x0394('0xa4')]===-0x1){return _0x4f6d35;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x43bb10));};AGIVertices[_0x0394('0xf')][_0x0394('0xc9')]=function(_0x4fb200){logger['info'](util[_0x0394('0x2a')](_0x0394('0xca'),_0x4fb200[_0x0394('0x39')]));if(!this['isConfigured'](_0x4fb200[_0x0394('0x5d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}var _0x5689b7='\x22'+_0x4fb200[_0x0394('0x5d')]+'\x22';if(this[_0x0394('0xaa')](_0x4fb200['options'])){_0x5689b7+=','+_0x4fb200[_0x0394('0x7b')];}var _0x517165=this['channel'][_0x0394('0x59')]('MRCPSynth',_0x5689b7);if(_0x517165[_0x0394('0xa4')]===-0x1){return _0x517165;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xad'),_0x5689b7));};AGIVertices[_0x0394('0xf')][_0x0394('0xcb')]=function(_0xa353ed){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xcc'),_0xa353ed['label']));if(!this[_0x0394('0xaa')](_0xa353ed[_0x0394('0xb0')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xb1'));}var _0xd56f07=_0xa353ed[_0x0394('0xb0')];if(this[_0x0394('0xaa')](_0xa353ed['options'])){_0xd56f07+=','+_0xa353ed[_0x0394('0x7b')];}var _0x3240f2=this[_0x0394('0xc')][_0x0394('0x59')](_0x0394('0xb2'),_0xd56f07);if(_0x3240f2['result']===-0x1){return _0x3240f2;}var _0x41ffc6=this[_0x0394('0xa3')]('RECOG_CONFIDENCE()',_0x0394('0xcd'));if(_0x41ffc6[_0x0394('0xa4')]===-0x1){return _0x41ffc6;}var _0x1ea7f2=this[_0x0394('0xa3')]('RECOG_INPUT()',_0x0394('0xce'));if(_0x1ea7f2['result']===-0x1){return _0x1ea7f2;}var _0x1c7cc3=this['getAndSetVariable']('RECOG_INSTANCE()',_0x0394('0xcf'));if(_0x1c7cc3[_0x0394('0xa4')]===-0x1){return _0x1c7cc3;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0xd56f07));};AGIVertices[_0x0394('0xf')]['sestekasr']=function(_0x455bae){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xd0'),_0x455bae[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x455bae['grammar'])){return this[_0x0394('0xc')]['noop'](_0x0394('0xb1'));}var _0x194d57=_0x455bae['grammar'];if(this[_0x0394('0xaa')](_0x455bae[_0x0394('0x7b')])){_0x194d57+=','+_0x455bae['options'];}var _0xe6cdad=this['channel']['exec'](_0x0394('0xb2'),_0x194d57);if(_0xe6cdad['result']===-0x1){return _0xe6cdad;}var _0x5190eb=this[_0x0394('0xa3')](_0x0394('0xb3'),_0x0394('0xd1'));if(_0x5190eb[_0x0394('0xa4')]===-0x1){return _0x5190eb;}var _0x3da49e=this['getAndSetVariable'](_0x0394('0xd2'),'SESTEK_ASR_TRANSCRIPT');if(_0x3da49e['result']===-0x1){return _0x3da49e;}var _0x463b8f=this[_0x0394('0xa3')]('RECOG_INSTANCE()',_0x0394('0xd3'));if(_0x463b8f[_0x0394('0xa4')]===-0x1){return _0x463b8f;}return this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xb7'),_0x194d57));};AGIVertices[_0x0394('0xf')][_0x0394('0xd4')]=function(_0x58578f){logger[_0x0394('0x2f')](util['format'](_0x0394('0xd5'),_0x58578f[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x58578f[_0x0394('0xd6')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x58578f,_0x0394('0xd7'));}var _0x2bac5c=this[_0x0394('0x18')]['sync'](this,_0x58578f[_0x0394('0xd6')]);if(!_0x2bac5c){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x58578f,_0x0394('0xd8'));}if(!this[_0x0394('0xaa')](_0x58578f[_0x0394('0x30')])){return this['channel'][_0x0394('0x2d')](_0x58578f,_0x0394('0xd9'));}var _0x4637d0=_0x58578f['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x0394('0xc')]['noop'](util[_0x0394('0x2a')](_0x0394('0xda'),_0x4637d0));var _0x6df5f5=this['getQueryOdbc'][_0x0394('0x72')](this,_0x2bac5c,_0x4637d0);this[_0x0394('0x38')][_0x0394('0x72')](this,_0x58578f,_0x4637d0);if(!this[_0x0394('0xaa')](_0x58578f[_0x0394('0xdb')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xdc'));}var _0x8d8a33=this[_0x0394('0x10')][_0x0394('0x72')](this,_0x58578f[_0x0394('0xdb')]);if(!_0x8d8a33){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x58578f,_0x0394('0xdd'));}var _0x4533b1=this;_0x6df5f5[_0x0394('0xde')](function(_0x1c4346,_0x41dda1){Object[_0x0394('0xdf')](_0x1c4346)[_0x0394('0xde')](function(_0x20999a){_0x4533b1[_0x0394('0xc')][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0xe0'),_0x8d8a33,_0x41dda1,_0x20999a),_0x1c4346[_0x20999a]);});});this[_0x0394('0xc')][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0xe1'),_0x8d8a33),_0x6df5f5[_0x0394('0x9d')]);return this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0xe2'),_0x8d8a33));};AGIVertices[_0x0394('0xf')][_0x0394('0xe3')]=function(_0x18f36c){logger[_0x0394('0xe4')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x18f36c[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x18f36c[_0x0394('0xe5')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x18f36c,_0x0394('0xe6'));}var _0x48c981=this[_0x0394('0x1b')][_0x0394('0x72')](this,_0x18f36c['sip_id']);if(!_0x48c981){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x18f36c,_0x0394('0xe7'));}var _0x23a71b=this[_0x0394('0xc')][_0x0394('0x59')](_0x0394('0xe8'),[util['format'](_0x0394('0xe9'),_0x48c981),_0x18f36c['timeout'],_0x18f36c['opts'],_0x18f36c[_0x0394('0x66')]]);if(_0x23a71b[_0x0394('0xa4')]===-0x1){return _0x23a71b;}return this[_0x0394('0xc')]['noop'](util[_0x0394('0x2a')](_0x0394('0xea'),'DIAL'));};AGIVertices[_0x0394('0xf')][_0x0394('0xeb')]=function(_0x112f58){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xec'),_0x112f58[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x112f58['key'])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xed'));}if(!this[_0x0394('0xaa')](_0x112f58['text'])){return this[_0x0394('0xc')][_0x0394('0xab')]('no\x20text\x20configured');}this['channel'][_0x0394('0xee')]=!![];this[_0x0394('0x38')](_0x112f58);this['createSquareMessage'](_0x112f58[_0x0394('0x5d')],'in','','');this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xef'),_0x112f58[_0x0394('0x5d')]));var _0x4bede6=this[_0x0394('0x7c')][_0x0394('0x72')](this,_0x112f58);if(_0x4bede6){for(var _0x666625 in _0x4bede6){if(_0x4bede6['hasOwnProperty'](_0x666625)){this['channel'][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0xf0'),_0x666625[_0x0394('0x6c')]()),_0x4bede6[_0x666625]);}}this[_0x0394('0x44')](_0x4bede6['speech'],_0x0394('0xf1'),_0x0394('0xeb'),'');return this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0xf2'),_0x4bede6[_0x0394('0xf3')]));}return this[_0x0394('0xc')]['error'](_0x112f58,_0x0394('0xf4'));};AGIVertices[_0x0394('0xf')]['dialogflowV2']=function(_0x439261){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x439261[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x439261[_0x0394('0xf5')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xf6'));}if(!this[_0x0394('0xaa')](_0x439261[_0x0394('0x7f')])){return this['channel'][_0x0394('0xab')](_0x0394('0xf7'));}if(!this[_0x0394('0xaa')](_0x439261[_0x0394('0x80')])){return this[_0x0394('0xc')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x439261['dialogflowV2_language'])){return this[_0x0394('0xc')][_0x0394('0xab')]('no\x20anguage\x20configured');}if(!this[_0x0394('0xaa')](_0x439261[_0x0394('0x5d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}this[_0x0394('0xc')][_0x0394('0xee')]=!![];this['createSquareDetailsReport'](_0x439261);this['createSquareMessage'](_0x439261['text'],'in','','');this['channel']['noop'](util['format'](_0x0394('0xf8'),_0x439261[_0x0394('0x5d')]));var _0x4ed849=this[_0x0394('0x7e')][_0x0394('0x72')](this,_0x439261);if(_0x4ed849){for(var _0x3438bd in _0x4ed849){if(_0x4ed849['hasOwnProperty'](_0x3438bd)){if(_0x3438bd!=='providerResponse'){this[_0x0394('0xc')][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0xf0'),_0x3438bd[_0x0394('0x6c')]()),_0x4ed849[_0x3438bd]);}}}this['createSquareMessage'](_0x4ed849[_0x0394('0xf3')],'out','dialogflowV2',_0x4ed849[_0x0394('0xf9')]);return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xfa'),_0x4ed849[_0x0394('0xf3')]));}return this['channel']['error'](_0x439261,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x0394('0xf')][_0x0394('0xfb')]=function(_0x38f79b){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0xfc'),_0x38f79b[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x38f79b[_0x0394('0xfd')])){return this[_0x0394('0xc')][_0x0394('0xab')]('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0x38f79b[_0x0394('0xfe')])){return this['channel'][_0x0394('0xab')](_0x0394('0xff'));}if(!this[_0x0394('0xaa')](_0x38f79b[_0x0394('0x100')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x101'));}if(!this[_0x0394('0xaa')](_0x38f79b[_0x0394('0x102')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}this[_0x0394('0xc')][_0x0394('0xee')]=!![];this['createSquareDetailsReport'](_0x38f79b);this['createSquareMessage'](_0x38f79b['text'],'in','','');this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x103'),_0x38f79b[_0x0394('0x5d')]));var _0x31ee67=this['sestekNDA'][_0x0394('0x72')](this,_0x38f79b);if(_0x31ee67){for(var _0x211378 in _0x31ee67){if(_0x31ee67['hasOwnProperty'](_0x211378)){this[_0x0394('0xc')][_0x0394('0xa0')](util['format']('SESTEK_NDA_%s',_0x211378[_0x0394('0x6c')]()),_0x31ee67[_0x211378]);}}this[_0x0394('0x44')](_0x31ee67[_0x0394('0xf3')],'out',_0x0394('0xfb'),'');if(_0x31ee67[_0x0394('0x104')]){this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x105'),_0x31ee67[_0x0394('0x104')]));var _0x54afea=this[_0x0394('0xc')][_0x0394('0x106')](_0x31ee67[_0x0394('0x104')]);try{fs[_0x0394('0x107')](_0x31ee67[_0x0394('0x104')]+_0x0394('0x108'));}catch(_0x102462){logger[_0x0394('0x2d')](_0x102462);}return _0x54afea;}else{return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x109'),_0x31ee67[_0x0394('0xf3')]));}}return this['channel'][_0x0394('0x2d')](_0x38f79b,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x0394('0xf')][_0x0394('0x10a')]=function(_0x4cab54){logger['info'](util['format'](_0x0394('0x10b'),_0x4cab54[_0x0394('0x39')]));return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x10a'));};AGIVertices['prototype'][_0x0394('0x10c')]=function(_0x4c5945){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x10d'),_0x4c5945[_0x0394('0x39')]));var _0x18bd22='';if(_0x4c5945['trunk_id']){if(!this[_0x0394('0xaa')](_0x4c5945[_0x0394('0x10e')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x4c5945,'no\x20trunk\x20selected');}else{var _0x55fd02=parseInt(_0x4c5945[_0x0394('0x10e')],0xa);if(isNaN(_0x55fd02)){_0x18bd22=_0x4c5945[_0x0394('0x10e')];}else{_0x18bd22=this[_0x0394('0x1d')][_0x0394('0x72')](this,_0x4c5945[_0x0394('0x10e')]);if(!_0x18bd22){return this['channel'][_0x0394('0x2d')](_0x4c5945,_0x0394('0x10f'));}}}}else if(_0x4c5945[_0x0394('0x110')]){_0x18bd22=_0x4c5945['trunk_name'];}else{return this['channel'][_0x0394('0x2d')](_0x4c5945,_0x0394('0x111'));}var _0x5db659=this[_0x0394('0xc')][_0x0394('0x59')](_0x0394('0xe8'),[util[_0x0394('0x2a')](_0x0394('0x112'),_0x18bd22,_0x4c5945['phone']),_0x4c5945['timeout'],_0x4c5945['opts'],_0x4c5945[_0x0394('0x66')]]);if(_0x5db659['result']===-0x1){return _0x5db659;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('Executed\x20command\x20%s',_0x0394('0xe8')));};AGIVertices[_0x0394('0xf')]['finally']=function(_0x4a9e45){logger[_0x0394('0x2f')](util['format'](_0x0394('0x113'),_0x4a9e45[_0x0394('0x39')]));return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x114'));};AGIVertices[_0x0394('0xf')][_0x0394('0x115')]=function(_0x1ae4e6){logger[_0x0394('0x2f')](util['format'](_0x0394('0x116'),_0x1ae4e6[_0x0394('0x39')]));if(_0x1ae4e6[_0x0394('0xa7')]===0x0){return this[_0x0394('0xa6')](_0x1ae4e6);}_0x1ae4e6[_0x0394('0xa7')]-=0x1;if(!this['isConfigured'](_0x1ae4e6[_0x0394('0x117')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x1ae4e6,'no\x20file\x20audio\x20selected');}var _0x270653=this[_0x0394('0x1f')][_0x0394('0x72')](this,_0x1ae4e6['file_id']);if(!_0x270653){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x1ae4e6,_0x0394('0x118'));}if(!this['isConfigured'](_0x1ae4e6[_0x0394('0xdb')])){return this['channel']['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4735a2=this[_0x0394('0xc')][_0x0394('0x119')](_0x270653,_0x1ae4e6['response'],_0x1ae4e6[_0x0394('0x11a')]);var _0x2f8f0c=_0x4735a2[_0x0394('0xa4')]?_0x4735a2[_0x0394('0xa4')][_0x0394('0x4e')]():'';logger['info'](_0x0394('0x11b'),JSON[_0x0394('0x76')](_0x4735a2));if(_0x4735a2['result']===-0x1){this['createSquareDetailsReport'][_0x0394('0x72')](this,_0x1ae4e6,_0x2f8f0c);return _0x4735a2;}else if(_0x4735a2['extra']==='timeout'){_0x4735a2[_0x0394('0xa4')]=_0x2f8f0c[_0x0394('0x9d')]>=parseInt(_0x1ae4e6[_0x0394('0x11c')])?'x':'i';}else{_0x4735a2[_0x0394('0xa4')]=_0x2f8f0c['length']>=parseInt(_0x1ae4e6[_0x0394('0x11c')])&&_0x2f8f0c[_0x0394('0x9d')]<=parseInt(_0x1ae4e6[_0x0394('0x11a')])?'x':'i';}var _0x427923=this[_0x0394('0x10')][_0x0394('0x72')](this,_0x1ae4e6['variable_id']);if(!_0x427923){return this[_0x0394('0xc')]['error'](_0x1ae4e6,'no\x20variable\x20found');}this[_0x0394('0xc')][_0x0394('0xa0')](_0x427923,_0x2f8f0c);if(this['isConfigured'](_0x1ae4e6[_0x0394('0x11d')])){var _0x52519b=parseInt(_0x1ae4e6[_0x0394('0x11d')],0xa);var _0x2c664d=rs[_0x0394('0x11e')]({'charset':'*','length':_0x52519b});var _0x108ac2=_0x2f8f0c['length'];if(_0x108ac2>0x0){if(_0x108ac2>_0x52519b){this['createSquareDetailsReport'][_0x0394('0x72')](this,_0x1ae4e6,_0x1ae4e6[_0x0394('0x11f')]===_0x0394('0x120')?_0x2c664d+_0x2f8f0c['substr'](_0x52519b):_0x2f8f0c[_0x0394('0x121')](0x0,_0x108ac2-_0x52519b)+_0x2c664d);}else{this[_0x0394('0x38')][_0x0394('0x72')](this,_0x1ae4e6,rs[_0x0394('0x11e')]({'charset':'*','length':_0x108ac2}));}}else{this[_0x0394('0x38')][_0x0394('0x72')](this,_0x1ae4e6,'');}}else{this[_0x0394('0x38')]['sync'](this,_0x1ae4e6,_0x2f8f0c);}return _0x4735a2;};AGIVertices[_0x0394('0xf')]['getsecretdigits']=function(_0x839ed){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x122'),_0x839ed['label']));return this[_0x0394('0x115')](_0x839ed);};AGIVertices[_0x0394('0xf')][_0x0394('0x123')]=function(_0x55d06a){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x55d06a[_0x0394('0x39')]));this['createSquareDetailsReport'][_0x0394('0x72')](this,_0x55d06a,_0x55d06a[_0x0394('0x124')]);return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('GOAL\x20%s',_0x55d06a['goalname']));};AGIVertices['prototype'][_0x0394('0x125')]=function(_0x135028){logger['info'](util[_0x0394('0x2a')](_0x0394('0x126'),_0x135028[_0x0394('0x39')]));if(!this['isConfigured'](_0x135028[_0x0394('0x8c')])||!this[_0x0394('0xaa')](_0x135028[_0x0394('0x8d')])){return this[_0x0394('0xc')]['noop'](_0x0394('0x127'));}if(!this[_0x0394('0xaa')](_0x135028[_0x0394('0x5d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x128'),_0x135028['text']));var _0x29d095=this['awsPolly'][_0x0394('0x72')](this,_0x135028);if(_0x29d095){this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x129'),_0x29d095));var _0x5c884e=this[_0x0394('0xc')][_0x0394('0x106')](_0x29d095);try{fs['unlink'](_0x29d095+'.wav');}catch(_0x4aec41){logger['error'](_0x4aec41);}return _0x5c884e;}return this['channel'][_0x0394('0x2d')](_0x135028,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x0394('0xf')][_0x0394('0x12a')]=function(_0x4d3940){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x12b'),_0x4d3940['label']));if(!this[_0x0394('0xaa')](_0x4d3940[_0x0394('0x8c')])||!this['isConfigured'](_0x4d3940[_0x0394('0x8d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x127'));}if(!this['isConfigured'](_0x4d3940[_0x0394('0x8f')])){return this[_0x0394('0xc')]['noop'](_0x0394('0x12c'));}if(!this[_0x0394('0xaa')](_0x4d3940[_0x0394('0x5d')])){return this['channel'][_0x0394('0xab')](_0x0394('0xc8'));}this['channel'][_0x0394('0xee')]=!![];this[_0x0394('0x38')](_0x4d3940);this['createSquareMessage'](_0x4d3940[_0x0394('0x5d')],'in','','');this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0x12d'),_0x4d3940['text']));var _0x15f1bc=this[_0x0394('0x8b')][_0x0394('0x72')](this,_0x4d3940);if(_0x15f1bc){for(var _0x14893f in _0x15f1bc){if(_0x15f1bc[_0x0394('0x96')](_0x14893f)&&_[_0x0394('0x97')](_0x15f1bc[_0x14893f])){this[_0x0394('0xc')][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0x12e'),_0x14893f[_0x0394('0x6c')]()),_0x15f1bc[_0x14893f]);}}if(_[_0x0394('0x47')](_0x15f1bc[_0x0394('0x79')])){return this['channel'][_0x0394('0xab')](_0x0394('0x12f'));}else{this[_0x0394('0x44')](_0x15f1bc[_0x0394('0x79')],_0x0394('0xf1'),'amazonlex','');return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x130'),_0x15f1bc['message']));}}return this[_0x0394('0xc')][_0x0394('0x2d')](_0x4d3940,_0x0394('0x131'));};AGIVertices[_0x0394('0xf')]['googleasr']=function(_0x4a55a5){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x132'),_0x4a55a5[_0x0394('0x39')],_0x4a55a5[_0x0394('0x68')]));if(!this['isConfigured'](_0x4a55a5['key'])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xed'));}var _0x124e02=_0x0394('0x133');var _0x4f7b2b=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x0394('0x11e')](0x4));var _0x152855=util[_0x0394('0x2a')](_0x0394('0x9f'),_0x4f7b2b,_0x124e02);var _0x18ace4=!![];if(_0x4a55a5[_0x0394('0x134')]===_0x0394('0x135')){_0x18ace4=![];}var _0x4dac39=this[_0x0394('0xc')]['recordFile'](_0x4f7b2b,_0x124e02,_0x4a55a5['intKey'],_0x4a55a5[_0x0394('0x68')],undefined,_0x18ace4);if(_0x4dac39['result']!==-0x1){this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x136'),_0x152855));var _0x121c4a=this[_0x0394('0x90')]['sync'](this,_0x4a55a5,_0x152855);if(_0x121c4a){for(var _0x3518d3 in _0x121c4a){if(_0x121c4a['hasOwnProperty'](_0x3518d3)){this[_0x0394('0xc')][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0x137'),_0x3518d3[_0x0394('0x6c')]()),_0x121c4a[_0x3518d3]);}}return this['channel']['noop'](util['format'](_0x0394('0x138'),JSON[_0x0394('0x76')](_0x121c4a)));}}return _0x4dac39;};AGIVertices['prototype'][_0x0394('0x139')]=function(_0x125d8){logger[_0x0394('0x2f')](util['format'](_0x0394('0x13a'),_0x125d8['label']));if(!this['isConfigured'](_0x125d8[_0x0394('0x92')])){return this[_0x0394('0xc')]['noop']('no\x20appid\x20configured');}if(!this[_0x0394('0xaa')](_0x125d8[_0x0394('0x93')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x13b'));}var _0x1b357b=_0x0394('0x133');var _0x4c0807=util['format'](_0x0394('0x13c'),FILES_PATH,rs[_0x0394('0x11e')](0x4));var _0x4dbc07=util['format']('%s.%s',_0x4c0807,_0x1b357b);var _0x283cfc=!![];if(_0x125d8[_0x0394('0x134')]===_0x0394('0x135')){_0x283cfc=![];}var _0x5a2960=this['channel'][_0x0394('0x13d')](_0x4c0807,_0x1b357b,_0x125d8['intKey'],_0x125d8[_0x0394('0x68')],undefined,_0x283cfc);if(_0x5a2960['result']!==-0x1){this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x13e'),_0x4dbc07));var _0x228567=this[_0x0394('0x91')]['sync'](this,_0x125d8,_0x4dbc07);if(_0x228567){for(var _0x2bd4ed in _0x228567){if(_0x228567['hasOwnProperty'](_0x2bd4ed)){this['channel'][_0x0394('0xa0')](util[_0x0394('0x2a')](_0x0394('0x13f'),_0x2bd4ed[_0x0394('0x6c')]()),_0x228567[_0x2bd4ed]);}}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x140'),JSON[_0x0394('0x76')](_0x228567)));}}return _0x5a2960;};AGIVertices[_0x0394('0xf')][_0x0394('0x141')]=function(_0x2c83aa){logger['info'](util[_0x0394('0x2a')](_0x0394('0x142'),_0x2c83aa[_0x0394('0x39')]));return this[_0x0394('0xc')][_0x0394('0x143')](_0x2c83aa['context'],_0x2c83aa[_0x0394('0x40')],_0x2c83aa[_0x0394('0x41')]);};AGIVertices[_0x0394('0xf')][_0x0394('0x144')]=function(_0x327996){logger['info'](util[_0x0394('0x2a')](_0x0394('0x145'),_0x327996[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x327996[_0x0394('0x146')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x327996,_0x0394('0x147'));}try{var _0x3b2b82=eval(_0x327996[_0x0394('0x146')])?_0x0394('0x148'):_0x0394('0x149');this['channel']['noop'](util[_0x0394('0x2a')]('EVAL\x20CONDITION\x20%s\x20%s',_0x327996[_0x0394('0x146')],_0x3b2b82));return{'code':0xc8,'result':_0x3b2b82};}catch(_0x54d639){return{'code':0xc8,'result':_0x0394('0x149')};}};AGIVertices[_0x0394('0xf')]['gotoiftime']=function(_0x2f765b){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x14a'),_0x2f765b[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x2f765b[_0x0394('0x14b')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x2f765b,_0x0394('0x14c'));}var _0x24a475=this[_0x0394('0x26')][_0x0394('0x72')](this,_0x2f765b['interval_id']);if(!_0x24a475){return this[_0x0394('0xc')]['error'](_0x2f765b,_0x0394('0x14d'));}for(var _0x3562a4=0x0;_0x3562a4<_0x24a475['length'];_0x3562a4+=0x1){var _0x52296e=this[_0x0394('0xc')][_0x0394('0x10')](util[_0x0394('0x2a')](_0x0394('0x14e'),_0x24a475[_0x3562a4]));if(_0x52296e[_0x0394('0xa4')]===-0x1){return _0x52296e;}logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x14f'),_0x24a475[_0x3562a4],_0x52296e[_0x0394('0xa2')]));if(_0x52296e[_0x0394('0xa2')]==='true'){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('IFTIME\x20%s\x20%s',_0x24a475[_0x3562a4],_0x0394('0x148')));this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x14f'),_0x24a475[_0x3562a4],_0x0394('0x148')));return{'code':0xc8,'result':_0x0394('0x148')};}else{logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x14f'),_0x24a475[_0x3562a4],'false'));this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0x14f'),_0x24a475[_0x3562a4],_0x0394('0x149')));}}return{'code':0xc8,'result':_0x0394('0x149')};};AGIVertices[_0x0394('0xf')][_0x0394('0x150')]=function(_0x305115){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x305115[_0x0394('0x39')]));return this[_0x0394('0xc')][_0x0394('0x150')]();};AGIVertices['prototype'][_0x0394('0x151')]=function(_0x17dcc3){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x17dcc3[_0x0394('0x39')]));if(!this['isConfigured'](_0x17dcc3[_0x0394('0x83')])){return this['channel'][_0x0394('0xab')]('no\x20key\x20configured');}var _0x17a92b=_0x0394('0x133');var _0x175b8e=util['format'](_0x0394('0x13c'),FILES_PATH,rs[_0x0394('0x11e')](0x4));var _0x19afbc=util[_0x0394('0x2a')]('%s.%s',_0x175b8e,_0x17a92b);var _0x40e235=!![];if(_0x17dcc3[_0x0394('0x134')]==='NOBEEP'){_0x40e235=![];}var _0x4405f4=this[_0x0394('0xc')]['recordFile'](_0x175b8e,_0x17a92b,_0x17dcc3[_0x0394('0x152')],_0x17dcc3[_0x0394('0x68')],undefined,_0x40e235);if(_0x4405f4[_0x0394('0xa4')]!==-0x1){this[_0x0394('0xc')]['noop'](util[_0x0394('0x2a')](_0x0394('0x153'),_0x19afbc));var _0x41d333=this[_0x0394('0x86')][_0x0394('0x72')](this,_0x17dcc3,_0x19afbc);if(_0x41d333){for(var _0x461f62 in _0x41d333){if(_0x41d333[_0x0394('0x96')](_0x461f62)){this[_0x0394('0xc')][_0x0394('0xa0')](util['format'](_0x0394('0x154'),_0x461f62['toUpperCase']()),_0x41d333[_0x461f62]);}}return this['channel'][_0x0394('0xab')](util['format'](_0x0394('0x155'),JSON[_0x0394('0x76')](_0x41d333)));}}return _0x4405f4;};AGIVertices[_0x0394('0xf')][_0x0394('0x156')]=function(_0x448ae9){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x157'),_0x448ae9[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x448ae9[_0x0394('0x83')])){return this[_0x0394('0xc')]['noop']('no\x20key\x20configured');}if(!this['isConfigured'](_0x448ae9[_0x0394('0x5d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x158'),_0x448ae9[_0x0394('0x5d')]));var _0x28d7bb=this[_0x0394('0x82')][_0x0394('0x72')](this,_0x448ae9);if(_0x28d7bb){this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0x153'),_0x28d7bb));var _0x1148e4=this[_0x0394('0xc')][_0x0394('0x106')](_0x28d7bb,_0x448ae9[_0x0394('0x152')]);try{fs[_0x0394('0x107')](_0x28d7bb+_0x0394('0x108'));}catch(_0x3fd70a){logger['error'](_0x3fd70a);}return _0x1148e4;}return this[_0x0394('0xc')][_0x0394('0x2d')](_0x448ae9,_0x0394('0x159'));};AGIVertices['prototype'][_0x0394('0x15a')]=function(_0x3ee9a1){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x15b'),_0x3ee9a1['label']));if(!this[_0x0394('0xaa')](_0x3ee9a1[_0x0394('0x15c')])){return this[_0x0394('0xc')]['error'](_0x3ee9a1,_0x0394('0x15d'));}logger['info'](util[_0x0394('0x2a')](_0x0394('0x15e'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x3ee9a1[_0x0394('0x15c')]));var _0x21e622=this[_0x0394('0x56')]['sync'](this,_0x3ee9a1[_0x0394('0x15c')]);if(_0x21e622){logger['info'](util[_0x0394('0x2a')](_0x0394('0x15f'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x3ee9a1[_0x0394('0x15c')]));this[_0x0394('0xc')][_0x0394('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0394('0xc')][_0x0394('0x3c')],_0x3ee9a1[_0x0394('0x15c')]));return{'code':0xc8,'result':_0x0394('0x160')};}else{logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x161'),this['channel'][_0x0394('0x3c')],_0x3ee9a1[_0x0394('0x15c')]));this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0x161'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x3ee9a1[_0x0394('0x15c')]));return{'code':0xc8,'result':_0x0394('0x162')};}};AGIVertices[_0x0394('0xf')][_0x0394('0x163')]=function(_0x17acc1){logger[_0x0394('0x2f')](util['format'](_0x0394('0x164'),_0x17acc1[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x17acc1[_0x0394('0x15c')])){return this['channel'][_0x0394('0x2d')](_0x17acc1,_0x0394('0x15d'));}logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x15e'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x17acc1[_0x0394('0x15c')]));var _0x1c35ff=this[_0x0394('0x55')]['sync'](this,_0x17acc1[_0x0394('0x15c')]);if(_0x1c35ff){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0394('0x3c')],_0x17acc1[_0x0394('0x15c')]));this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x15f'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x17acc1[_0x0394('0x15c')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x161'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x17acc1['findBy']));this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0394('0xc')][_0x0394('0x3c')],_0x17acc1[_0x0394('0x15c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0394('0xf')][_0x0394('0x165')]=function(_0x31b2cb){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x166'),_0x31b2cb[_0x0394('0x39')]));if(!this['isConfigured'](_0x31b2cb[_0x0394('0x167')])){return this[_0x0394('0xc')]['error'](_0x31b2cb,_0x0394('0x168'));}this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x169'),_0x31b2cb['operation']));var _0x16a105=eval(_0x31b2cb[_0x0394('0x167')]);if(!this[_0x0394('0xaa')](_0x31b2cb['variable_id'])){return this['channel'][_0x0394('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x507b26=this[_0x0394('0x10')][_0x0394('0x72')](this,_0x31b2cb[_0x0394('0xdb')]);if(!_0x507b26){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x31b2cb,_0x0394('0xdd'));}if(_['isArray'](_0x16a105)){var _0x240154=this;_0x16a105[_0x0394('0xde')](function(_0x140886,_0x5bc37c){_0x240154[_0x0394('0xc')]['setVariable'](util[_0x0394('0x2a')](_0x0394('0x16a'),_0x507b26,_0x5bc37c),_0x140886);});return this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x16b'),_0x507b26));}else{return this[_0x0394('0xc')][_0x0394('0xa0')](_0x507b26,_0x16a105);}};AGIVertices[_0x0394('0xf')]['menu']=function(_0x495f43){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x16c'),_0x495f43[_0x0394('0x39')]));if(_0x495f43['retry']===0x0){return this['maxRetry'](_0x495f43);}_0x495f43[_0x0394('0xa7')]-=0x1;if(!this['isConfigured'](_0x495f43['file_id'])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x495f43,_0x0394('0x16d'));}var _0x5942eb=this['getSound'][_0x0394('0x72')](this,_0x495f43[_0x0394('0x117')]);if(!_0x5942eb){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x495f43,_0x0394('0x118'));}var _0x3fd232=this[_0x0394('0xc')][_0x0394('0x119')](_0x5942eb,_0x495f43[_0x0394('0x16e')],_0x495f43['digit']);var _0x5cdce3=_0x3fd232[_0x0394('0xa4')];if(_0x3fd232[_0x0394('0xa4')]===-0x1){this[_0x0394('0x38')][_0x0394('0x72')](this,_0x495f43,'-1');return _0x3fd232;}else if(_0x3fd232['extra']===_0x0394('0x68')){_0x3fd232['result']=_0x3fd232['result'][_0x0394('0x9d')]>0x0?_0x3fd232[_0x0394('0xa4')]:'t';}else if(_[_0x0394('0x46')](_0x3fd232[_0x0394('0xa4')])){_0x3fd232[_0x0394('0xa4')]='#';_0x5cdce3='#';}if(!this[_0x0394('0xaa')](_0x495f43[_0x0394('0xdb')])){this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xdc'));}else{var _0x21d445=this['getVariable'][_0x0394('0x72')](this,_0x495f43[_0x0394('0xdb')]);if(!_0x21d445){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x495f43,_0x0394('0xdd'));}this[_0x0394('0xc')]['setVariable'](_0x21d445,_0x5cdce3);}this[_0x0394('0x38')][_0x0394('0x72')](this,_0x495f43,_0x5cdce3);return _0x3fd232;};AGIVertices['prototype'][_0x0394('0xab')]=function(_0x79b5a5){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x16f'),_0x79b5a5[_0x0394('0x39')]));return this[_0x0394('0xc')][_0x0394('0xab')](_0x79b5a5[_0x0394('0x170')]||_0x79b5a5['label']);};AGIVertices[_0x0394('0xf')]['pause']=function(_0x41ef22){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x41ef22[_0x0394('0x39')]));if(!this['isConfigured'](_0x41ef22[_0x0394('0x15c')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x41ef22,_0x0394('0x15d'));}logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0394('0xc')][_0x0394('0x3c')],_0x41ef22[_0x0394('0x15c')]));var _0x14a757=this[_0x0394('0x50')]['sync'](this,_0x41ef22[_0x0394('0x171')]);var _0x134489=this[_0x0394('0x52')][_0x0394('0x72')](this,_0x41ef22[_0x0394('0x15c')],_0x14a757);if(_0x134489){logger['info'](util[_0x0394('0x2a')](_0x0394('0x15f'),this[_0x0394('0xc')]['callerid'],_0x41ef22['findBy']));this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x15f'),this['channel'][_0x0394('0x3c')],_0x41ef22[_0x0394('0x15c')]));return{'code':0xc8,'result':_0x0394('0x160')};}else{logger['info'](util[_0x0394('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0394('0xc')][_0x0394('0x3c')],_0x41ef22[_0x0394('0x15c')]));this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x15f'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x41ef22[_0x0394('0x15c')]));return{'code':0xc8,'result':_0x0394('0x162')};}};AGIVertices[_0x0394('0xf')][_0x0394('0x172')]=function(_0x23d0d2){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x23d0d2[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x23d0d2[_0x0394('0x117')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x23d0d2,_0x0394('0x16d'));}var _0x5935ba=this[_0x0394('0x1f')][_0x0394('0x72')](this,_0x23d0d2[_0x0394('0x117')]);if(!_0x5935ba){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x23d0d2,_0x0394('0x118'));}var _0x570130=this['channel']['exec'](_0x0394('0x173'),[_0x5935ba,_0x23d0d2[_0x0394('0x174')]]);if(_0x570130['result']===-0x1){return _0x570130;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('Executed\x20command\x20%s\x20%s',_0x0394('0x173'),_0x5935ba));};AGIVertices[_0x0394('0xf')][_0x0394('0x175')]=function(_0x40ebea){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x40ebea[_0x0394('0x39')]));if(!this['isConfigured'](_0x40ebea[_0x0394('0x176')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x40ebea,'no\x20queue\x20selected');}var _0x3fdcef='';var _0x549549=parseInt(_0x40ebea['queue_id'],0xa);if(isNaN(_0x549549)){_0x3fdcef=_0x40ebea['queue_id'];}else{_0x3fdcef=this['getVoiceQueue']['sync'](this,_0x40ebea[_0x0394('0x176')]);if(!_0x3fdcef){return this[_0x0394('0xc')]['error'](_0x40ebea,'no\x20queue\x20found');}}var _0x1adf1b='';if(this['isConfigured'](_0x40ebea[_0x0394('0x117')])){var _0x5e05c9=this['getSound'][_0x0394('0x72')](this,_0x40ebea[_0x0394('0x117')]);if(_0x5e05c9){_0x1adf1b=_0x5e05c9;}}this[_0x0394('0x38')][_0x0394('0x72')](this,_0x40ebea,_0x3fdcef);if(_0x40ebea[_0x0394('0x174')][_0x0394('0x177')]('x')<0x0){_0x40ebea['opts']+='x';}if(_0x40ebea[_0x0394('0x174')]['indexOf']('X')<0x0){_0x40ebea[_0x0394('0x174')]+='X';}this[_0x0394('0xc')]['setVariable'](_0x0394('0x178'),_0x3fdcef?_0x3fdcef[_0x0394('0x179')]():'');var _0x154014=this[_0x0394('0xc')]['exec'](_0x0394('0x17a'),[_0x3fdcef,_0x40ebea[_0x0394('0x174')],_0x40ebea['url'],_0x1adf1b,_0x40ebea['timeout'],_0x40ebea[_0x0394('0x6')],_0x40ebea[_0x0394('0x17b')],_0x40ebea[_0x0394('0x17c')],'',_0x40ebea['position']]);if(_0x154014[_0x0394('0xa4')]===-0x1){return _0x154014;}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xc4'),_0x0394('0x17a'),_0x3fdcef));};AGIVertices[_0x0394('0xf')][_0x0394('0x17d')]=function(_0x1fbd28){logger[_0x0394('0x2f')](util['format'](_0x0394('0x17e'),_0x1fbd28['label']));var _0x2b5f33=_0x1fbd28[_0x0394('0x17f')]||'wav';var _0x2d9a08=util[_0x0394('0x2a')](_0x0394('0x180'),this[_0x0394('0xc')]['uniqueid'],rs[_0x0394('0x11e')](0x5));var _0x12ce98=util[_0x0394('0x2a')](_0x0394('0x181'),FILES_PATH,_0x2d9a08,_0x2b5f33);var _0x4587c8=util[_0x0394('0x2a')]('%s/recordings/%s',FILES_PATH,_0x2d9a08);this[_0x0394('0x3d')][_0x0394('0x72')](this,_0x1fbd28,_0x2d9a08,_0x12ce98);this[_0x0394('0xc')]['setVariable'](_0x0394('0x182'),_0x2d9a08);logger[_0x0394('0x2f')](_0x0394('0x183'),_0x4587c8,_0x2b5f33,_0x1fbd28[_0x0394('0x184')],_0x1fbd28[_0x0394('0x68')]);return this[_0x0394('0xc')]['recordFile'](_0x4587c8,_0x2b5f33,_0x1fbd28[_0x0394('0x184')],_0x1fbd28[_0x0394('0x68')],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x37dac2){logger['info'](util[_0x0394('0x2a')](_0x0394('0x185'),_0x37dac2[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x37dac2[_0x0394('0x66')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x186'));}var _0x250f01=this[_0x0394('0x65')][_0x0394('0x72')](this,_0x37dac2);logger[_0x0394('0x2f')](util['format']('Response:',util[_0x0394('0x187')](_0x250f01,{'showHidden':![],'depth':null})));if(!this[_0x0394('0xaa')](_0x37dac2[_0x0394('0xdb')])){return this[_0x0394('0xc')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3161be=this[_0x0394('0x10')][_0x0394('0x72')](this,_0x37dac2[_0x0394('0xdb')]);if(!_0x3161be){return this['channel']['error'](_0x37dac2,_0x0394('0xdd'));}this[_0x0394('0xc')]['setVariable'](util['format']('%s_STATUS_CODE',_0x3161be),_0x250f01[_0x0394('0x78')]?_0x250f01['statusCode']:_0x0394('0x188'));this[_0x0394('0xc')]['setVariable'](util[_0x0394('0x2a')](_0x0394('0x189'),_0x3161be),_0x250f01[_0x0394('0x18a')]?_0x250f01['statusMessage']:'OK');if(_0x250f01[_0x0394('0x77')]){try{this['saveRestApiResult'](_0x250f01[_0x0394('0x77')],_0x3161be);}catch(_0x44c8e9){logger[_0x0394('0x2d')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x3161be));}}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0xe2'),_0x3161be));};AGIVertices[_0x0394('0xf')][_0x0394('0x18b')]=function(_0xa03065){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0xa03065['label']));return this['channel'][_0x0394('0x18c')](_0xa03065[_0x0394('0x18d')][_0x0394('0x5a')](/\s+/g,''),_0xa03065[_0x0394('0x184')]);};AGIVertices['prototype'][_0x0394('0x18e')]=function(_0x1cbf2f){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x1cbf2f['label']));return this[_0x0394('0xc')][_0x0394('0x18f')](_0x1cbf2f['number']['replace'](/\s+/g,''),_0x1cbf2f[_0x0394('0x184')]);};AGIVertices['prototype']['sayphonetic']=function(_0x2088bf){logger['info'](util[_0x0394('0x2a')](_0x0394('0x190'),_0x2088bf[_0x0394('0x39')]));return this[_0x0394('0xc')][_0x0394('0x191')](_0x2088bf[_0x0394('0x5d')],_0x2088bf[_0x0394('0x184')]);};AGIVertices[_0x0394('0xf')][_0x0394('0x192')]=function(_0x2dab07){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2dab07[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x2dab07['account_id'])){return this['channel'][_0x0394('0xab')](_0x0394('0x193'));}var _0x47f79f=this[_0x0394('0x23')][_0x0394('0x72')](this,_0x2dab07['account_id']);if(!_0x47f79f||!_0x47f79f[_0x0394('0x194')]){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x2dab07,_0x0394('0x195'));}var _0x2213c1={'from':util[_0x0394('0x2a')](_0x0394('0x196'),_0x47f79f['name'],_0x47f79f[_0x0394('0x197')]||_0x47f79f[_0x0394('0x194')]['user']),'to':_0x2dab07['to']||'','cc':_0x2dab07['cc']||'','bcc':_0x2dab07[_0x0394('0x198')]||'','subject':_0x2dab07[_0x0394('0x199')],'html':_0x2dab07[_0x0394('0x5d')],'text':_0x2dab07[_0x0394('0x5d')]};var _0x1f8503={'tls':{'rejectUnauthorized':![]}};if(_0x47f79f[_0x0394('0x194')][_0x0394('0x19a')]){_0x1f8503[_0x0394('0x19a')]=_0x47f79f['Smtp'][_0x0394('0x19a')];}else{_0x1f8503[_0x0394('0x19b')]=_0x47f79f['Smtp']['host'];_0x1f8503[_0x0394('0x19c')]=_0x47f79f['Smtp']['port'];_0x1f8503[_0x0394('0x19d')]=_0x47f79f[_0x0394('0x194')]['secure'];}if(_0x47f79f[_0x0394('0x194')][_0x0394('0x19e')]){_0x1f8503[_0x0394('0x19f')]={'user':_0x47f79f[_0x0394('0x194')][_0x0394('0x1a0')],'pass':_0x47f79f[_0x0394('0x194')][_0x0394('0x1a1')]};}if(this['isConfigured'](_0x2dab07[_0x0394('0x1a2')])){}logger[_0x0394('0xe4')](_0x0394('0x1a3'),JSON['stringify'](_0x2213c1));this[_0x0394('0x38')][_0x0394('0x72')](this,_0x2dab07,_0x2dab07[_0x0394('0x1a4')]);this[_0x0394('0xc')][_0x0394('0xab')](util['format'](_0x0394('0x1a5'),_0x47f79f[_0x0394('0x15')]));this[_0x0394('0x25')][_0x0394('0x72')](this,_0x1f8503,_0x2213c1);return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x1a6'));};AGIVertices[_0x0394('0xf')][_0x0394('0x1a7')]=function(_0x58be59){logger[_0x0394('0x2f')](util['format'](_0x0394('0x1a8'),_0x58be59[_0x0394('0x39')]));return this['channel']['noop'](_0x0394('0x1a9'));};AGIVertices[_0x0394('0xf')][_0x0394('0x1aa')]=function(_0x291549){logger['info'](util[_0x0394('0x2a')](_0x0394('0x1ab'),_0x291549[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x291549[_0x0394('0x1ac')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x1ad'));}var _0xd8405c=this[_0x0394('0x35')][_0x0394('0x72')](this,_0x291549[_0x0394('0x1ac')]);if(!_0xd8405c){return this['channel'][_0x0394('0x2d')](_0x291549,_0x0394('0x1ae'));}var _0x591e28={'body':_0x291549[_0x0394('0x1af')],'phone':_0x291549['to']||'','SmsAccountId':_0xd8405c['id']};logger[_0x0394('0xe4')](_0x0394('0x1b0'),JSON[_0x0394('0x76')](_0x591e28));this[_0x0394('0x38')][_0x0394('0x72')](this,_0x291549,_0x291549[_0x0394('0x1ac')]);this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0xd8405c[_0x0394('0x15')]));this[_0x0394('0x37')][_0x0394('0x72')](this,_0x591e28);return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x1b1'));};AGIVertices['prototype']['set']=function(_0x22c348){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x1b2'),_0x22c348[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x22c348[_0x0394('0xdb')])){return this[_0x0394('0xc')]['error'](_0x22c348,_0x0394('0x1b3'));}var _0x2e44a9=this['getVariable'][_0x0394('0x72')](this,_0x22c348[_0x0394('0xdb')]);if(!_0x2e44a9){return this['channel']['error'](_0x22c348,_0x0394('0xdd'));}return this[_0x0394('0xc')][_0x0394('0xa0')](_0x2e44a9,_0x22c348[_0x0394('0x1b4')]);};AGIVertices['prototype']['start']=function(_0x42ad57){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x1b5'),_0x42ad57[_0x0394('0x39')]));this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x1b6'));if(_0x42ad57[_0x0394('0xb9')]==='yes'){this[_0x0394('0xc')][_0x0394('0xab')]('Answer');return this['channel'][_0x0394('0xb9')]();}return this['channel'][_0x0394('0xab')](_0x0394('0x1b7'));};AGIVertices[_0x0394('0xf')][_0x0394('0x1b8')]=function(_0x3dc5c8){logger[_0x0394('0x2f')](util[_0x0394('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3dc5c8[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x3dc5c8[_0x0394('0x1b9')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x3dc5c8,_0x0394('0x1ba'));}var _0x2644b8=this[_0x0394('0x16')][_0x0394('0x72')](this,_0x3dc5c8[_0x0394('0x1b9')]);if(!this[_0x0394('0xaa')](_0x2644b8)){return this['channel'][_0x0394('0x2d')](_0x3dc5c8,util[_0x0394('0x2a')](_0x0394('0x1bb'),_0x3dc5c8[_0x0394('0x1b9')]));}if(_0x2644b8===this[_0x0394('0xc')][_0x0394('0x3b')]){return this[_0x0394('0xc')]['error'](_0x3dc5c8,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x0394('0x38')][_0x0394('0x72')](this,_0x3dc5c8,_0x2644b8);var _0x1e2327=this[_0x0394('0xc')][_0x0394('0x59')]('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x0394('0x6')][_0x0394('0x19b')]||_0x0394('0x1bc'),_0x2644b8,this[_0x0394('0xc')][_0x0394('0x3b')]));if(_0x1e2327[_0x0394('0xa4')]===-0x1){return _0x1e2327;}return this[_0x0394('0xc')]['noop'](util[_0x0394('0x2a')](_0x0394('0xc4'),'AGI',_0x2644b8));};AGIVertices[_0x0394('0xf')]['system']=function(_0x30c057){logger['info'](util['format'](_0x0394('0x1bd'),_0x30c057[_0x0394('0x39')]));var _0x12a400=this[_0x0394('0x58')][_0x0394('0x72')](this,_0x30c057[_0x0394('0x1be')]);this[_0x0394('0x38')][_0x0394('0x72')](this,_0x30c057,_0x30c057['command']);if(this[_0x0394('0xaa')](_0x30c057[_0x0394('0xdb')])){var _0x72ec8e=this[_0x0394('0x10')][_0x0394('0x72')](this,_0x30c057[_0x0394('0xdb')]);if(_0x72ec8e){this[_0x0394('0xc')][_0x0394('0xa0')](_0x72ec8e,_0x12a400);return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x1bf'),_0x30c057[_0x0394('0x1be')],_0x72ec8e));}}return this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x1c0'),_0x30c057[_0x0394('0x1be')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x43d59f){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x1c1'),_0x43d59f[_0x0394('0x39')]));_0x43d59f[_0x0394('0x5d')]=_0x43d59f['text'][_0x0394('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0394('0xaa')](_0x43d59f['apiKey'])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0x1c2'));}if(!this[_0x0394('0xaa')](_0x43d59f['text'])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x1c3'),_0x43d59f[_0x0394('0x5d')]));var _0x47b1ee=this[_0x0394('0x5b')][_0x0394('0x72')](this,_0x43d59f);if(_0x47b1ee){this['channel'][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x1c4'),_0x47b1ee));var _0x3503c8=this[_0x0394('0xc')][_0x0394('0x106')](_0x47b1ee);try{fs['unlink'](_0x47b1ee+'.wav');}catch(_0x2d0859){logger['error'](_0x2d0859);}return _0x3503c8;}return this['channel'][_0x0394('0x2d')](_0x43d59f,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x0394('0xf')]['tts']=function(_0x20046f){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x20046f['label']));_0x20046f['text']=_0x20046f[_0x0394('0x5d')][_0x0394('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0394('0xaa')](_0x20046f[_0x0394('0x5d')])){return this[_0x0394('0xc')][_0x0394('0xab')](_0x0394('0xc8'));}this['channel'][_0x0394('0xab')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x20046f[_0x0394('0x5d')]));var _0x1a86e0=this[_0x0394('0x63')][_0x0394('0x72')](this,_0x20046f);if(_0x1a86e0){this[_0x0394('0xc')]['noop'](util['format'](_0x0394('0x1c5'),_0x1a86e0));var _0x456d53=this[_0x0394('0xc')]['streamFile'](_0x1a86e0);try{fs[_0x0394('0x107')](_0x1a86e0+_0x0394('0x108'));}catch(_0x3c4c41){logger['error'](_0x3c4c41);}return _0x456d53;}return this['channel']['error'](_0x20046f,_0x0394('0x1c6'));};AGIVertices[_0x0394('0xf')][_0x0394('0x1c7')]=function(_0x2170e8){logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x1c8'),_0x2170e8[_0x0394('0x39')]));if(!this[_0x0394('0xaa')](_0x2170e8['findBy'])){return this['channel'][_0x0394('0x2d')](_0x2170e8,_0x0394('0x15d'));}logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x15e'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x2170e8[_0x0394('0x15c')]));var _0x494453=this[_0x0394('0x54')][_0x0394('0x72')](this,_0x2170e8[_0x0394('0x15c')]);if(_0x494453){logger[_0x0394('0x2f')](util['format'](_0x0394('0x15f'),this[_0x0394('0xc')][_0x0394('0x3c')],_0x2170e8[_0x0394('0x15c')]));this[_0x0394('0xc')][_0x0394('0xab')](util[_0x0394('0x2a')](_0x0394('0x15f'),this[_0x0394('0xc')]['callerid'],_0x2170e8['findBy']));return{'code':0xc8,'result':_0x0394('0x160')};}else{logger[_0x0394('0x2f')](util[_0x0394('0x2a')](_0x0394('0x161'),this[_0x0394('0xc')]['callerid'],_0x2170e8['findBy']));this['channel']['noop'](util[_0x0394('0x2a')](_0x0394('0x161'),this[_0x0394('0xc')]['callerid'],_0x2170e8[_0x0394('0x15c')]));return{'code':0xc8,'result':_0x0394('0x162')};}};AGIVertices[_0x0394('0xf')][_0x0394('0x1c9')]=function(_0x5a0661){logger[_0x0394('0x2f')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x5a0661[_0x0394('0x39')]));var _0x548e20=this[_0x0394('0xc')][_0x0394('0x59')](_0x0394('0x1ca'),[_0x5a0661[_0x0394('0x1cb')],_0x5a0661[_0x0394('0x7b')]]);if(_0x548e20[_0x0394('0xa4')]===-0x1){return _0x548e20;}return this[_0x0394('0xc')]['noop'](util[_0x0394('0x2a')](_0x0394('0xc4'),_0x0394('0x1ca'),_0x5a0661['mailbox']));};AGIVertices[_0x0394('0xf')]['vswitch']=function(_0x166b94){logger['info'](util[_0x0394('0x2a')](_0x0394('0x1cc'),_0x166b94[_0x0394('0x39')]));if(!this['isConfigured'](_0x166b94[_0x0394('0xdb')])){return this[_0x0394('0xc')][_0x0394('0x2d')](_0x166b94,_0x0394('0x1b3'));}var _0x38d93a=this['getVariable']['sync'](this,_0x166b94[_0x0394('0xdb')]);if(!_0x38d93a){return this[_0x0394('0xc')]['error'](_0x166b94,_0x0394('0xdd'));}var _0x242e9d=this[_0x0394('0xc')][_0x0394('0x10')](_0x38d93a);return{'code':0xc8,'result':_0x242e9d[_0x0394('0xa2')]?_0x242e9d[_0x0394('0xa2')]:'-'};};String[_0x0394('0xf')]['replaceAll']=function(_0xf5a147,_0x19623e){return this[_0x0394('0xa1')](_0xf5a147)['join'](_0x19623e);};module[_0x0394('0x1cd')]=AGIVertices; \ No newline at end of file +var _0xf5e2=['GOAL\x20%s','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','%s/recordings/%s','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','macro','gosub','QUEUE','record','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','replace','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','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','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','exports','path','util','lodash','shelljs','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','computedVariables','render','body','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','aws_secret_access_key','aws_lex_region','google_asr_language','tildeASR','appid','clear','includes','clone','isString','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','format','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20odbc\x20database\x20found','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','toUpperCase','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','DIAL','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname'];(function(_0x29c318,_0x1c6de0){var _0x135d5a=function(_0x2444cc){while(--_0x2444cc){_0x29c318['push'](_0x29c318['shift']());}};_0x135d5a(++_0x1c6de0);}(_0xf5e2,0xa7));var _0x2f5e=function(_0x19bf50,_0x3813ee){_0x19bf50=_0x19bf50-0x0;var _0x252f7b=_0xf5e2[_0x19bf50];return _0x252f7b;};'use strict';var fs=require('fs');var path=require(_0x2f5e('0x0'));var util=require(_0x2f5e('0x1'));var _=require(_0x2f5e('0x2'));var sh=require(_0x2f5e('0x3'));var odbc=require(_0x2f5e('0x4'))();var rs=require('randomstring');var moment=require(_0x2f5e('0x5'));var Mustache=require(_0x2f5e('0x6'));var rp=require(_0x2f5e('0x7'));var logger=require(_0x2f5e('0x8'))(_0x2f5e('0x9'));var config=require(_0x2f5e('0xa'));var scripts=require(_0x2f5e('0xb'));var FILES_PATH=_0x2f5e('0xc');var recursiveMapAttributes=[_0x2f5e('0xd'),_0x2f5e('0xe')];var verticesWithRetry=[_0x2f5e('0xf'),_0x2f5e('0x10'),_0x2f5e('0x11')];var AGIVertices=function(_0x310c9e,_0x4b2791,_0x1dd020){this[_0x2f5e('0x12')]=_0x310c9e;this[_0x2f5e('0x13')]=_0x4b2791;this['mailRpc']=_0x1dd020;};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x15')]=function(_0x277541,_0x464d5d){this[_0x2f5e('0x13')][_0x2f5e('0x16')](_0x277541)[_0x2f5e('0x17')](function(_0x3bd586){_0x464d5d(null,_0x3bd586?_0x3bd586['name']:![]);})[_0x2f5e('0x18')](function(_0x482176){_0x464d5d(_0x482176);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x19')]=function(_0x1b6451,_0x33cca9){this[_0x2f5e('0x13')][_0x2f5e('0x1a')](_0x1b6451)[_0x2f5e('0x17')](function(_0x347e91){_0x33cca9(null,_0x347e91?_0x347e91[_0x2f5e('0x1b')]:![]);})[_0x2f5e('0x18')](function(_0x150512){_0x33cca9(_0x150512);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x1c')]=function(_0x19be61,_0x4be422){this['rpc'][_0x2f5e('0x1d')](_0x19be61)[_0x2f5e('0x17')](function(_0x5de58f){_0x4be422(null,_0x5de58f?_0x5de58f[_0x2f5e('0x1b')]:![]);})['catch'](function(_0x527832){_0x4be422(_0x527832);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x1e')]=function(_0x6c330f,_0x2b8e0d){this[_0x2f5e('0x13')]['getSquareOdbcById'](_0x6c330f)[_0x2f5e('0x17')](function(_0xfc7970){_0x2b8e0d(null,_0xfc7970?_0xfc7970[_0x2f5e('0x1f')]:![]);})[_0x2f5e('0x18')](function(_0x56a0da){_0x2b8e0d(_0x56a0da);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x20')]=function(_0x385c8c,_0xbfa479){this[_0x2f5e('0x13')][_0x2f5e('0x21')](_0x385c8c)[_0x2f5e('0x17')](function(_0x290d3a){_0xbfa479(null,_0x290d3a?_0x290d3a[_0x2f5e('0x1b')]:![]);})['catch'](function(_0x19ac59){_0xbfa479(_0x19ac59);});};AGIVertices[_0x2f5e('0x14')]['getTrunk']=function(_0x47f5ac,_0x488910){this['rpc']['getTrunkById'](_0x47f5ac)['then'](function(_0x41cb68){_0x488910(null,_0x41cb68?_0x41cb68[_0x2f5e('0x1b')]:![]);})[_0x2f5e('0x18')](function(_0x2f7cef){_0x488910(_0x2f7cef);});};AGIVertices['prototype']['getSound']=function(_0x39180f,_0x410406){var _0x2b90fe=this;this[_0x2f5e('0x13')][_0x2f5e('0x22')](_0x39180f)[_0x2f5e('0x17')](function(_0x542370){_0x410406(null,_0x542370?_0x2b90fe[_0x2f5e('0x23')](_0x542370[_0x2f5e('0x24')]):![]);})['catch'](function(_0x2b5f15){_0x410406(_0x2b5f15);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x25')]=function(_0x1e7b17,_0x4f9650){this['rpc'][_0x2f5e('0x26')](_0x1e7b17)[_0x2f5e('0x17')](function(_0x289da8){_0x4f9650(null,_0x289da8?_0x289da8:![]);})[_0x2f5e('0x18')](function(_0x354cce){_0x4f9650(_0x354cce);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x27')]=function(_0x21a2a5,_0x5069ed,_0x2a3149){this['mailRpc']['sendMailMessage'](_0x21a2a5,_0x5069ed)[_0x2f5e('0x17')](function(){_0x2a3149(null);})[_0x2f5e('0x18')](function(_0x2c0297){_0x2a3149(_0x2c0297);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x28')]=function(_0xd3404d,_0x398c9f){this['rpc']['getIntervalById'](_0xd3404d)[_0x2f5e('0x17')](function(_0x1e569f){if(_0x1e569f){if(_0x1e569f[_0x2f5e('0x29')]){_0x398c9f(null,[_0x1e569f[_0x2f5e('0x2a')]]);}else{_0x398c9f(null,_[_0x2f5e('0x2b')](_0x1e569f[_0x2f5e('0x2c')],_0x2f5e('0x2a')));}}else{_0x398c9f(null,![]);}})[_0x2f5e('0x18')](function(_0x1faed9){_0x398c9f(_0x1faed9);});};AGIVertices['prototype'][_0x2f5e('0x23')]=function(_0x41a6cf){return util['format'](_0x2f5e('0x2d'),FILES_PATH,_0x41a6cf);};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x2e')]=function(_0x7de1c8,_0x4f0d3c,_0x34ac5d){odbc[_0x2f5e('0x2f')](_0x7de1c8,function(_0x5891e8){if(_0x5891e8){logger[_0x2f5e('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5891e8);_0x34ac5d(_0x5891e8);}else{logger[_0x2f5e('0x31')](_0x2f5e('0x32'));odbc[_0x2f5e('0x33')](_0x4f0d3c,function(_0x4dc24a,_0x5b675f){if(_0x4dc24a){logger['info'](_0x2f5e('0x34'),_0x4f0d3c);_0x34ac5d(_0x4dc24a);}else{logger[_0x2f5e('0x31')](_0x2f5e('0x35'),_0x4f0d3c);odbc[_0x2f5e('0x36')](function(_0x5f5a04){if(_0x5f5a04){logger[_0x2f5e('0x30')](_0x2f5e('0x37'),_0x5f5a04);}_0x34ac5d(null,_0x5b675f);});}});}});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x38')]=function(_0x2c7656,_0x4aea35){this[_0x2f5e('0x13')][_0x2f5e('0x39')](_0x2c7656)['then'](function(_0x24f5fe){_0x4aea35(null,_0x24f5fe?_0x24f5fe:![]);})[_0x2f5e('0x18')](function(_0x3cd34b){_0x4aea35(_0x3cd34b);});};AGIVertices[_0x2f5e('0x14')]['createSmsMessage']=function(_0x329856,_0x29c1db){this['rpc'][_0x2f5e('0x3a')](_0x329856)[_0x2f5e('0x17')](function(_0x42c785){_0x29c1db(null,_0x42c785);})[_0x2f5e('0x18')](function(_0xa10bce){_0x29c1db(_0xa10bce);});};AGIVertices['prototype'][_0x2f5e('0x3b')]=function(_0x10639c,_0x46d1dc,_0x85ad8d){this['rpc'][_0x2f5e('0x3b')]({'uniqueid':this[_0x2f5e('0x12')][_0x2f5e('0x3c')],'node':_0x10639c[_0x2f5e('0x3d')],'application':_0x10639c[_0x2f5e('0x3e')],'data':_0x46d1dc||null,'project_name':this['channel'][_0x2f5e('0x3f')],'callerid':this[_0x2f5e('0x12')][_0x2f5e('0x40')]})['then'](function(_0x4ea6ab){if(_0x85ad8d){_0x85ad8d(null,_0x4ea6ab);}})[_0x2f5e('0x18')](function(_0x5d0552){if(_0x85ad8d){_0x85ad8d(_0x5d0552);}});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x41')]=function(_0x27c862,_0x590cb9,_0xe4ac40,_0x7bf765){this['rpc'][_0x2f5e('0x41')]({'uniqueid':this[_0x2f5e('0x12')][_0x2f5e('0x3c')],'callerid':this['channel'][_0x2f5e('0x40')],'calleridname':this[_0x2f5e('0x12')][_0x2f5e('0x42')],'context':this[_0x2f5e('0x12')][_0x2f5e('0x43')],'extension':this[_0x2f5e('0x12')][_0x2f5e('0x44')],'priority':this['channel'][_0x2f5e('0x45')],'accountcode':this[_0x2f5e('0x12')][_0x2f5e('0x46')],'dnid':this[_0x2f5e('0x12')][_0x2f5e('0x47')],'projectName':this['channel']['arg_1'],'saveName':_0x590cb9,'filename':_0x27c862[_0x2f5e('0x48')]||_0x590cb9,'savePath':_0xe4ac40})[_0x2f5e('0x17')](function(_0x849217){_0x7bf765(null,_0x849217);})['catch'](function(_0x5537ba){_0x7bf765(_0x5537ba);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x49')]=function(_0x3e2d06,_0x2b812e,_0x277be9,_0x206098,_0x46e213){this[_0x2f5e('0x13')]['createSquareMessage']({'uniqueid':this['channel'][_0x2f5e('0x3c')],'body':_0x3e2d06,'direction':_0x2b812e,'providerName':_0x277be9,'providerResponse':_0x206098})[_0x2f5e('0x17')](function(_0x1089bb){if(_0x46e213){_0x46e213(null,_0x1089bb);}})['catch'](function(_0x2144da){if(_0x46e213){_0x46e213(_0x2144da);}});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x4a')]=function(_0x489732,_0x58647b){this[_0x2f5e('0x13')][_0x2f5e('0x4a')]({'firstName':_[_0x2f5e('0x4b')](_0x489732['name'])||_[_0x2f5e('0x4c')](_0x489732['name'])?_0x2f5e('0x4d')+Math[_0x2f5e('0x4e')]():_0x489732[_0x2f5e('0x1b')],'lastName':_['isEmpty'](_0x489732[_0x2f5e('0x4f')])||_[_0x2f5e('0x4c')](_0x489732[_0x2f5e('0x4f')])?null:_0x489732[_0x2f5e('0x4f')],'phone':_0x489732[_0x2f5e('0x50')],'ListId':_0x489732[_0x2f5e('0x51')],'scheduledat':_0x489732[_0x2f5e('0x52')],'callbackUniqueid':this[_0x2f5e('0x12')][_0x2f5e('0x3c')],'tags':'callback','description':_0x2f5e('0x53')+_0x489732[_0x2f5e('0x52')][_0x2f5e('0x54')](),'priority':_0x489732[_0x2f5e('0x55')]})[_0x2f5e('0x17')](function(_0x2e7a67){_0x58647b(null,_0x2e7a67);})[_0x2f5e('0x18')](function(_0x2277fe){_0x58647b(_0x2277fe);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x56')]=function(_0x4415b5,_0x35561d){this[_0x2f5e('0x13')][_0x2f5e('0x57')](_0x4415b5)['then'](function(_0x284617){_0x35561d(null,_0x284617?_0x284617[_0x2f5e('0x1b')]:![]);})[_0x2f5e('0x18')](function(_0x1b93ed){_0x35561d(_0x1b93ed);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x58')]=function(_0x3196c6,_0x50922c,_0x17bae5){var _0x38f365={'role':'agent'};_0x38f365[_0x3196c6]=this[_0x2f5e('0x12')][_0x2f5e('0x40')];this['rpc']['agentPause'](_0x38f365,_0x50922c,this['channel'][_0x2f5e('0x3c')])[_0x2f5e('0x17')](function(_0x32aab1){_0x17bae5(null,_[_0x2f5e('0x4c')](_0x32aab1)?![]:!![]);})[_0x2f5e('0x18')](function(_0x444b11){logger[_0x2f5e('0x30')](_0x444b11);_0x17bae5(null,![]);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x59')]=function(_0x30f8fb,_0x1654c5){var _0x2bd4b8={'role':_0x2f5e('0x5a')};_0x2bd4b8[_0x30f8fb]=this[_0x2f5e('0x12')][_0x2f5e('0x40')];this['rpc']['agentUnpause'](_0x2bd4b8)[_0x2f5e('0x17')](function(_0x241130){_0x1654c5(null,_['isNil'](_0x241130)?![]:!![]);})[_0x2f5e('0x18')](function(_0xb93abb){logger['error'](_0xb93abb);_0x1654c5(null,![]);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x5b')]=function(_0x4dd15f,_0x20fc8a){var _0x52b3b6={'role':'agent'};_0x52b3b6[_0x4dd15f]=this['channel'][_0x2f5e('0x40')];this[_0x2f5e('0x13')][_0x2f5e('0x5b')](_0x52b3b6)[_0x2f5e('0x17')](function(_0x364fb8){_0x20fc8a(null,_[_0x2f5e('0x4c')](_0x364fb8)?![]:!![]);})[_0x2f5e('0x18')](function(_0x5c8de2){logger[_0x2f5e('0x30')](_0x5c8de2);_0x20fc8a(null,![]);});};AGIVertices[_0x2f5e('0x14')]['agentLogin']=function(_0x52863a,_0x416988){var _0x1494aa={'role':'agent'};_0x1494aa[_0x52863a]=this['channel'][_0x2f5e('0x40')];var _0x25fa6c=_0x52863a!=_0x2f5e('0x5c')?util['format']('%s/%s@from-sip/n',_0x2f5e('0x5d'),this['channel'][_0x2f5e('0x40')]):undefined;this[_0x2f5e('0x13')]['agentLogin'](_0x1494aa,_0x25fa6c)[_0x2f5e('0x17')](function(_0x2e4438){_0x416988(null,_[_0x2f5e('0x4c')](_0x2e4438)?![]:!![]);})[_0x2f5e('0x18')](function(_0x3dd5bf){logger[_0x2f5e('0x30')](_0x3dd5bf);_0x416988(null,![]);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x5e')]=function(_0x2ef842,_0x22f620){sh[_0x2f5e('0x5f')](_[_0x2f5e('0x60')](_0x2ef842),function(_0x3a4b31,_0x42a1af){var _0x6314ac=_0x42a1af['replace'](/(\r\n|\n|\r)/gm,'');_0x22f620(null,_0x6314ac);});};AGIVertices['prototype'][_0x2f5e('0x61')]=function(_0x15c1a1,_0x42e0c2){scripts['googleCloudTTS'](_0x15c1a1[_0x2f5e('0x62')],_0x15c1a1[_0x2f5e('0x63')]||_0x2f5e('0x64'),_0x15c1a1[_0x2f5e('0x64')],_0x15c1a1['languageCode']||_0x2f5e('0x65'),_0x15c1a1['ssmlGender']||'MALE',_0x15c1a1[_0x2f5e('0x66')]||'MP3')[_0x2f5e('0x17')](function(_0x41ba21){_0x42e0c2(null,_0x41ba21);})[_0x2f5e('0x18')](function(_0x22a523){_0x42e0c2(_0x22a523);});};AGIVertices['prototype'][_0x2f5e('0x67')]=function(_0x553b22,_0x5eab48){scripts[_0x2f5e('0x67')](_0x553b22[_0x2f5e('0x64')],_0x553b22[_0x2f5e('0x68')]||'en',0x1)['then'](function(_0x1deb27){_0x5eab48(null,_0x1deb27);})[_0x2f5e('0x18')](function(_0x1d6bd1){_0x5eab48(_0x1d6bd1);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x69')]=function(_0x5fd2e7,_0x1e89e7){var _0x43078e={'uri':_0x5fd2e7[_0x2f5e('0x6a')],'method':_0x5fd2e7[_0x2f5e('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5fd2e7[_0x2f5e('0x6c')])===_0x2f5e('0x6d')&&parseInt(_0x5fd2e7['timeout'])>=0x1?parseInt(_0x5fd2e7['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x2f5e('0x6e'),'PUT'],_0x43078e[_0x2f5e('0x6b')]['toUpperCase']())){try{_0x43078e['body']=_0x5fd2e7['rawBody']?JSON[_0x2f5e('0x6f')](_0x5fd2e7[_0x2f5e('0xe')]):{};}catch(_0x2e79b6){logger['error'](_0x2f5e('0x70'),_0x2e79b6);}}try{_0x43078e[_0x2f5e('0x71')]=_0x5fd2e7['rawHeaders']?JSON[_0x2f5e('0x6f')](_0x5fd2e7['rawHeaders']):{};}catch(_0x44033d){logger[_0x2f5e('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x44033d);}if(_0x5fd2e7[_0x2f5e('0x72')]){try{var _0x3eb0d4=require(_0x5fd2e7[_0x2f5e('0x72')])['sync'](this,_0x43078e);_0x43078e['uri']=Mustache[_0x2f5e('0x73')](_0x5fd2e7['url'],_0x3eb0d4,{},['$$','$$']);if(_0x43078e[_0x2f5e('0x71')]){_0x43078e[_0x2f5e('0x71')]=JSON[_0x2f5e('0x6f')](Mustache[_0x2f5e('0x73')](JSON['stringify'](_0x43078e[_0x2f5e('0x71')]),_0x3eb0d4,{},['$$','$$']));}if(_0x43078e['body']){_0x43078e[_0x2f5e('0x74')]=JSON[_0x2f5e('0x6f')](Mustache[_0x2f5e('0x73')](JSON[_0x2f5e('0x75')](_0x43078e[_0x2f5e('0x74')]),_0x3eb0d4,{},['$$','$$']));}}catch(_0x3c3352){logger['error'](_0x2f5e('0x76'),_0x3c3352);}}rp(_0x43078e)['then'](function(_0x412960){var _0x8278c3={'statusCode':_0x412960[_0x2f5e('0x77')]||0xc8,'statusMessage':_0x412960['statusMessage']||'OK','headers':_0x412960[_0x2f5e('0x71')]||{},'body':_0x412960[_0x2f5e('0x74')]||{}};_0x1e89e7(null,_0x8278c3);})[_0x2f5e('0x18')](function(_0x3009ec){var _0xc7cf6f={'statusCode':_0x3009ec[_0x2f5e('0x77')]||0x1f4,'statusMessage':_0x3009ec['message']||_0x2f5e('0x78'),'headers':_0x3009ec['options'][_0x2f5e('0x71')]||{},'body':_0x3009ec[_0x2f5e('0x79')][_0x2f5e('0x74')]||{}};_0x1e89e7(null,_0xc7cf6f);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x7a')]=function(_0x19fc13,_0x4dfcaa){scripts[_0x2f5e('0x7a')](this['channel'][_0x2f5e('0x3c')],_0x19fc13[_0x2f5e('0x7b')],_0x19fc13['text'],_0x19fc13[_0x2f5e('0x7c')]||'en')[_0x2f5e('0x17')](function(_0x1c8b7d){_0x4dfcaa(null,_0x1c8b7d);})[_0x2f5e('0x18')](function(_0x28688c){_0x4dfcaa(_0x28688c);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x7d')]=function(_0x5cd880,_0x2e1d6d){scripts[_0x2f5e('0x7d')](this[_0x2f5e('0x12')][_0x2f5e('0x3c')],_0x5cd880[_0x2f5e('0x7e')],_0x5cd880[_0x2f5e('0x7f')],_0x5cd880[_0x2f5e('0x80')],_0x5cd880['text'],_0x5cd880[_0x2f5e('0x81')]||'en')[_0x2f5e('0x17')](function(_0x40a133){_0x2e1d6d(null,_0x40a133);})[_0x2f5e('0x18')](function(_0x18d492){_0x2e1d6d(_0x18d492);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x82')]=function(_0x55a415,_0x2cd001){scripts[_0x2f5e('0x82')](this[_0x2f5e('0x12')],_0x55a415)[_0x2f5e('0x17')](function(_0x587077){_0x2cd001(null,_0x587077);})[_0x2f5e('0x18')](function(_0xee5ba0){_0x2cd001(_0xee5ba0);});};AGIVertices[_0x2f5e('0x14')]['ispeechTTS']=function(_0x34084a,_0x304ddb){scripts[_0x2f5e('0x83')](_0x34084a[_0x2f5e('0x7b')],_0x34084a[_0x2f5e('0x64')],_0x34084a[_0x2f5e('0x84')]||_0x2f5e('0x65'),_0x34084a[_0x2f5e('0x85')])['then'](function(_0x562f7a){_0x304ddb(null,_0x562f7a);})[_0x2f5e('0x18')](function(_0x41930c){_0x304ddb(_0x41930c);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x86')]=function(_0x404a9f,_0x143614,_0x605474){scripts[_0x2f5e('0x86')](_0x143614,_0x404a9f[_0x2f5e('0x7b')],_0x404a9f[_0x2f5e('0x87')]||_0x2f5e('0x65'),this[_0x2f5e('0x88')](_0x404a9f[_0x2f5e('0x89')])?_0x404a9f[_0x2f5e('0x89')]:undefined)[_0x2f5e('0x17')](function(_0x2edb27){_0x605474(null,_0x2edb27);})[_0x2f5e('0x18')](function(_0x16f0c7){_0x605474(_0x16f0c7);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x8a')]=function(_0x1e9c49,_0x218ef9){scripts[_0x2f5e('0x8a')](_0x1e9c49['aws_access_key_id'],_0x1e9c49['aws_secret_access_key'],_0x1e9c49[_0x2f5e('0x8b')],_0x1e9c49[_0x2f5e('0x8c')]||_0x2f5e('0x8d'),_0x1e9c49['text'],_0x1e9c49[_0x2f5e('0x8e')]||_0x2f5e('0x64'))['then'](function(_0x1c5010){_0x218ef9(null,_0x1c5010);})[_0x2f5e('0x18')](function(_0x880c5c){_0x218ef9(_0x880c5c);});};AGIVertices[_0x2f5e('0x14')]['awsLex']=function(_0x5ddbde,_0x14cbc8){scripts['awsLex'](this['channel']['uniqueid'],_0x5ddbde['aws_access_key_id'],_0x5ddbde[_0x2f5e('0x8f')],_0x5ddbde[_0x2f5e('0x90')],_0x5ddbde[_0x2f5e('0x64')],_0x5ddbde['aws_bot_name'])[_0x2f5e('0x17')](function(_0x17aaf1){_0x14cbc8(null,_0x17aaf1);})[_0x2f5e('0x18')](function(_0x44ff11){_0x14cbc8(_0x44ff11);});};AGIVertices[_0x2f5e('0x14')]['googleASR']=function(_0x42ebbe,_0x4cd48f,_0x4a2bcd){scripts['googleASR'](_0x4cd48f,_0x42ebbe[_0x2f5e('0x7b')],_0x42ebbe[_0x2f5e('0x91')]||_0x2f5e('0x65'))[_0x2f5e('0x17')](function(_0x3e15a1){_0x4a2bcd(null,_0x3e15a1);})[_0x2f5e('0x18')](function(_0x29ca1b){_0x4a2bcd(_0x29ca1b);});};AGIVertices[_0x2f5e('0x14')]['tildeASR']=function(_0x301937,_0x3d940e,_0x341c8a){scripts[_0x2f5e('0x92')](_0x3d940e,_0x301937[_0x2f5e('0x93')],_0x301937['appsecret'],_0x301937['uri'])[_0x2f5e('0x17')](function(_0xbef70a){_0x341c8a(null,_0xbef70a);})[_0x2f5e('0x18')](function(_0xfb7f8e){_0x341c8a(_0xfb7f8e);});};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x94')]=function(_0x27aea2){var _0x8d624e=_[_0x2f5e('0x95')](verticesWithRetry,_0x27aea2[_0x2f5e('0x3e')])?_0x27aea2:_[_0x2f5e('0x96')](_0x27aea2);for(var _0x528814 in _0x8d624e){if(_0x8d624e['hasOwnProperty'](_0x528814)){if(_0x8d624e[_0x528814]&&_[_0x2f5e('0x97')](_0x8d624e[_0x528814])){if(_[_0x2f5e('0x95')](recursiveMapAttributes,_0x528814)){_0x8d624e[_0x528814]=this['replaceObjectAllVariables'](_0x8d624e[_0x528814]);}else{_0x8d624e[_0x528814]=this[_0x2f5e('0x98')](_0x8d624e[_0x528814]);}}}}return _0x8d624e;};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x99')]=function(_0x37e65a){for(var _0xc82c82 in _0x37e65a){if(_0x37e65a[_0x2f5e('0x9a')](_0xc82c82)){if(_[_0x2f5e('0x9b')](_0x37e65a[_0xc82c82])){this[_0x2f5e('0x99')](_0x37e65a[_0xc82c82]);}else if(_[_0x2f5e('0x9c')](_0x37e65a[_0xc82c82])){for(var _0x4b5bda=0x0;_0x4b5bda<_0x37e65a[_0xc82c82][_0x2f5e('0x9d')];_0x4b5bda++){this['recursiveNodeIndex'](_0x37e65a[_0xc82c82][_0x4b5bda]);}}else if(_[_0x2f5e('0x97')](_0x37e65a[_0xc82c82])){_0x37e65a[_0xc82c82]=this['replaceAllVariables'](_0x37e65a[_0xc82c82]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x3e0206,_0x2e4206){for(var _0x2ae5ff in _0x3e0206){if(_0x3e0206[_0x2f5e('0x9a')](_0x2ae5ff)){if(_['isPlainObject'](_0x3e0206[_0x2ae5ff])){if(!_[_0x2f5e('0x4b')](_0x3e0206[_0x2ae5ff])){this[_0x2f5e('0x9e')](_0x3e0206[_0x2ae5ff],util[_0x2f5e('0x9f')](_0x2f5e('0xa0'),_0x2e4206,_0x2ae5ff));}}else if(_[_0x2f5e('0x9c')](_0x3e0206[_0x2ae5ff])){for(var _0x2e260b=0x0;_0x2e260b<_0x3e0206[_0x2ae5ff][_0x2f5e('0x9d')];_0x2e260b++){this[_0x2f5e('0x9e')](_0x3e0206[_0x2ae5ff][_0x2e260b],util[_0x2f5e('0x9f')](_0x2f5e('0xa0'),_0x2e4206,_0x2ae5ff+'['+_0x2e260b+']'));}}else{if(!_[_0x2f5e('0x4c')](_0x3e0206[_0x2ae5ff])){this['channel'][_0x2f5e('0xa1')](util[_0x2f5e('0x9f')](_0x2f5e('0xa0'),_0x2e4206,_0x2ae5ff),_0x3e0206[_0x2ae5ff]);}}}}};AGIVertices['prototype'][_0x2f5e('0xa2')]=function(_0x371a20){try{var _0x327f5f=JSON[_0x2f5e('0x6f')](_0x371a20);this[_0x2f5e('0x99')](_0x327f5f);return JSON['stringify'](_0x327f5f);}catch(_0x405e84){return this[_0x2f5e('0x98')](_0x371a20);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x1ac0c6){var _0x1bb844=_0x1ac0c6[_0x2f5e('0xa3')]('{');for(var _0x237801=0x1;_0x237801<_0x1bb844[_0x2f5e('0x9d')];_0x237801+=0x1){var _0x40c82b=_0x1bb844[_0x237801][_0x2f5e('0xa3')]('}');if(_0x40c82b[_0x2f5e('0x9d')]>0x1){_0x1ac0c6=_0x1ac0c6[_0x2f5e('0xa4')]('{'+_0x40c82b[0x0]+'}',this[_0x2f5e('0x12')][_0x2f5e('0x15')](_0x40c82b[0x0])[_0x2f5e('0xa5')]||_0x40c82b[0x0]);}}if(_0x1bb844[_0x2f5e('0x9d')]===0x1){return _0x1ac0c6[_0x2f5e('0x54')]();}return this[_0x2f5e('0x98')](_0x1ac0c6);};AGIVertices[_0x2f5e('0x14')]['getAndSetVariable']=function(_0x212abc,_0x9a23b6){var _0x5c4114=this[_0x2f5e('0x12')][_0x2f5e('0x15')](_0x212abc);if(_0x5c4114['result']===-0x1){return _0x5c4114;}logger[_0x2f5e('0x31')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x9a23b6,_0x5c4114[_0x2f5e('0xa5')]));return this['channel']['setVariable'](_0x9a23b6,_0x5c4114[_0x2f5e('0xa5')]);};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x88')]=function(_0x4e42b7){return _0x4e42b7&&_0x4e42b7!=='0'&&_0x4e42b7!=='-1'&&_0x4e42b7!=='';};AGIVertices['prototype'][_0x2f5e('0xa6')]=function(_0x5eb2e6){this[_0x2f5e('0x3b')]['sync'](this,_0x5eb2e6,'-');_0x5eb2e6[_0x2f5e('0xa7')]=_0x5eb2e6['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xa8')]=function(_0xfc0169){logger['info'](util['format'](_0x2f5e('0xa9'),_0xfc0169[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0xfc0169['text'])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xab'));}var _0x170ad7='\x22'+_0xfc0169[_0x2f5e('0x64')]+'\x22';if(this[_0x2f5e('0x88')](_0xfc0169[_0x2f5e('0x79')])){_0x170ad7+=','+_0xfc0169[_0x2f5e('0x79')];}var _0x495356=this['channel'][_0x2f5e('0x5f')](_0x2f5e('0xac'),_0x170ad7);if(_0x495356[_0x2f5e('0xad')]===-0x1){return _0x495356;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xae'),_0x170ad7));};AGIVertices['prototype'][_0x2f5e('0xaf')]=function(_0x3dee5d){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0xb0'),_0x3dee5d[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x3dee5d['grammar'])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xb1'));}var _0x3ba851=_0x3dee5d['grammar'];if(this['isConfigured'](_0x3dee5d[_0x2f5e('0x79')])){_0x3ba851+=','+_0x3dee5d['options'];}var _0x331878=this[_0x2f5e('0x12')][_0x2f5e('0x5f')]('MRCPRecog',_0x3ba851);if(_0x331878['result']===-0x1){return _0x331878;}var _0x212308=this[_0x2f5e('0xb2')](_0x2f5e('0xb3'),_0x2f5e('0xb4'));if(_0x212308[_0x2f5e('0xad')]===-0x1){return _0x212308;}var _0x508670=this[_0x2f5e('0xb2')](_0x2f5e('0xb5'),_0x2f5e('0xb6'));if(_0x508670[_0x2f5e('0xad')]===-0x1){return _0x508670;}var _0x3258a6=this[_0x2f5e('0xb2')](_0x2f5e('0xb7'),_0x2f5e('0xb8'));if(_0x3258a6[_0x2f5e('0xad')]===-0x1){return _0x3258a6;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xb9'),_0x3ba851));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x9')]=function(_0x2688a9){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0xba'),_0x2688a9[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0x9')]([_0x2688a9[_0x2f5e('0xbb')],_0x2688a9[_0x2f5e('0xbc')]]);};AGIVertices[_0x2f5e('0x14')]['answer']=function(_0x17b7bf){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0xbd'),_0x17b7bf[_0x2f5e('0x3d')]));if(this[_0x2f5e('0x88')](_0x17b7bf[_0x2f5e('0x6c')])){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0xbe'),_0x17b7bf[_0x2f5e('0x6c')]));var _0xf75b02=this[_0x2f5e('0x12')]['wait'](_0x17b7bf['timeout']);if(_0xf75b02[_0x2f5e('0xad')]===-0x1){return _0xf75b02;}}return this[_0x2f5e('0x12')][_0x2f5e('0xbf')]();};AGIVertices[_0x2f5e('0x14')]['callback']=function(_0x8976dc){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0xc0'),_0x8976dc[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x8976dc[_0x2f5e('0x51')])){return this['channel'][_0x2f5e('0x30')](_0x8976dc,_0x2f5e('0xc1'));}_0x8976dc[_0x2f5e('0x52')]=moment();if(this[_0x2f5e('0x88')](_0x8976dc[_0x2f5e('0xc2')])){_0x8976dc[_0x2f5e('0x52')]=moment()[_0x2f5e('0xc3')](_0x8976dc[_0x2f5e('0xc2')],_0x2f5e('0xc4'));}if(!this[_0x2f5e('0x88')](_0x8976dc[_0x2f5e('0x55')])){_0x8976dc[_0x2f5e('0x55')]=0x2;}this[_0x2f5e('0x4a')][_0x2f5e('0xc5')](this,_0x8976dc);return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xc6'),_0x8976dc['phone'],_0x8976dc[_0x2f5e('0x51')],_0x8976dc['scheduledAt']));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xc7')]=function(_0x33fd51){logger['info'](util['format'](_0x2f5e('0xc8'),_0x33fd51[_0x2f5e('0x3d')]));var _0x1aa71a=this[_0x2f5e('0x12')]['exec'](_0x33fd51[_0x2f5e('0xc9')],_0x33fd51[_0x2f5e('0x79')]);if(_0x1aa71a[_0x2f5e('0xad')]===-0x1){return _0x1aa71a;}return this['channel'][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xca'),_0x33fd51[_0x2f5e('0xc9')],_0x33fd51['options']));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xcb')]=function(_0x293cdf){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x293cdf[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x293cdf[_0x2f5e('0x64')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xab'));}var _0x2f2d4c='\x22'+_0x293cdf['text']+'\x22';if(this[_0x2f5e('0x88')](_0x293cdf[_0x2f5e('0x79')])){_0x2f2d4c+=','+_0x293cdf[_0x2f5e('0x79')];}var _0x5ad5f9=this[_0x2f5e('0x12')][_0x2f5e('0x5f')](_0x2f5e('0xac'),_0x2f2d4c);if(_0x5ad5f9[_0x2f5e('0xad')]===-0x1){return _0x5ad5f9;}return this['channel'][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x2f2d4c));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xcc')]=function(_0x259df1){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0xcd'),_0x259df1[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x259df1[_0x2f5e('0x64')])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0xab'));}var _0x30df3a='\x22'+_0x259df1[_0x2f5e('0x64')]+'\x22';if(this[_0x2f5e('0x88')](_0x259df1[_0x2f5e('0x79')])){_0x30df3a+=','+_0x259df1[_0x2f5e('0x79')];}var _0x4cc032=this[_0x2f5e('0x12')][_0x2f5e('0x5f')](_0x2f5e('0xac'),_0x30df3a);if(_0x4cc032[_0x2f5e('0xad')]===-0x1){return _0x4cc032;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xae'),_0x30df3a));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xce')]=function(_0x25db89){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0xcf'),_0x25db89['label']));if(!this[_0x2f5e('0x88')](_0x25db89[_0x2f5e('0xd0')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('no\x20grammar\x20configured');}var _0x26dd08=_0x25db89[_0x2f5e('0xd0')];if(this[_0x2f5e('0x88')](_0x25db89[_0x2f5e('0x79')])){_0x26dd08+=','+_0x25db89[_0x2f5e('0x79')];}var _0x3fec5c=this[_0x2f5e('0x12')][_0x2f5e('0x5f')](_0x2f5e('0xd1'),_0x26dd08);if(_0x3fec5c[_0x2f5e('0xad')]===-0x1){return _0x3fec5c;}var _0x59c70e=this['getAndSetVariable'](_0x2f5e('0xb3'),'LUMENVOX_ASR_CONFIDENCE');if(_0x59c70e[_0x2f5e('0xad')]===-0x1){return _0x59c70e;}var _0x3cbee1=this[_0x2f5e('0xb2')](_0x2f5e('0xb5'),_0x2f5e('0xd2'));if(_0x3cbee1[_0x2f5e('0xad')]===-0x1){return _0x3cbee1;}var _0x335613=this[_0x2f5e('0xb2')]('RECOG_INSTANCE()',_0x2f5e('0xd3'));if(_0x335613['result']===-0x1){return _0x335613;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xb9'),_0x26dd08));};AGIVertices[_0x2f5e('0x14')]['sestekasr']=function(_0x1d5bb5){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0xd4'),_0x1d5bb5[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x1d5bb5[_0x2f5e('0xd0')])){return this['channel']['noop'](_0x2f5e('0xb1'));}var _0x2a3c84=_0x1d5bb5[_0x2f5e('0xd0')];if(this[_0x2f5e('0x88')](_0x1d5bb5[_0x2f5e('0x79')])){_0x2a3c84+=','+_0x1d5bb5[_0x2f5e('0x79')];}var _0x1b209c=this['channel']['exec'](_0x2f5e('0xd1'),_0x2a3c84);if(_0x1b209c[_0x2f5e('0xad')]===-0x1){return _0x1b209c;}var _0x136508=this[_0x2f5e('0xb2')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x136508[_0x2f5e('0xad')]===-0x1){return _0x136508;}var _0x4d3d62=this['getAndSetVariable'](_0x2f5e('0xb5'),_0x2f5e('0xd5'));if(_0x4d3d62[_0x2f5e('0xad')]===-0x1){return _0x4d3d62;}var _0x595092=this['getAndSetVariable'](_0x2f5e('0xb7'),_0x2f5e('0xd6'));if(_0x595092[_0x2f5e('0xad')]===-0x1){return _0x595092;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xb9'),_0x2a3c84));};AGIVertices['prototype'][_0x2f5e('0xd7')]=function(_0x148b79){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0xd8'),_0x148b79[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x148b79['odbc_id'])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x148b79,'no\x20database\x20selected');}var _0x1cd230=this[_0x2f5e('0x1e')][_0x2f5e('0xc5')](this,_0x148b79['odbc_id']);if(!_0x1cd230){return this['channel'][_0x2f5e('0x30')](_0x148b79,_0x2f5e('0xd9'));}if(!this[_0x2f5e('0x88')](_0x148b79['query'])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x148b79,'no\x20query\x20configured');}var _0x29e855=_0x148b79[_0x2f5e('0x33')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('query:\x20%s',_0x29e855));var _0x497f80=this[_0x2f5e('0x2e')][_0x2f5e('0xc5')](this,_0x1cd230,_0x29e855);this[_0x2f5e('0x3b')][_0x2f5e('0xc5')](this,_0x148b79,_0x29e855);if(!this[_0x2f5e('0x88')](_0x148b79[_0x2f5e('0xda')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xdb'));}var _0x524dd5=this[_0x2f5e('0x15')][_0x2f5e('0xc5')](this,_0x148b79['variable_id']);if(!_0x524dd5){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x148b79,'no\x20variable\x20found');}var _0x21adcb=this;_0x497f80[_0x2f5e('0xdc')](function(_0x58230c,_0x2c2920){Object[_0x2f5e('0xdd')](_0x58230c)[_0x2f5e('0xdc')](function(_0x25ba65){_0x21adcb[_0x2f5e('0x12')]['setVariable'](util[_0x2f5e('0x9f')](_0x2f5e('0xde'),_0x524dd5,_0x2c2920,_0x25ba65),_0x58230c[_0x25ba65]);});});this['channel'][_0x2f5e('0xa1')](util['format']('%s_ROWS_COUNT',_0x524dd5),_0x497f80['length']);return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xdf'),_0x524dd5));};AGIVertices['prototype'][_0x2f5e('0xe0')]=function(_0x465a5c){logger[_0x2f5e('0xe1')](util['format'](_0x2f5e('0xe2'),_0x465a5c[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x465a5c[_0x2f5e('0xe3')])){return this['channel'][_0x2f5e('0x30')](_0x465a5c,'no\x20user\x20selected');}var _0x4b96a9=this[_0x2f5e('0x20')][_0x2f5e('0xc5')](this,_0x465a5c['sip_id']);if(!_0x4b96a9){return this[_0x2f5e('0x12')]['error'](_0x465a5c,_0x2f5e('0xe4'));}var _0x488c16=this[_0x2f5e('0x12')][_0x2f5e('0x5f')]('DIAL',[util[_0x2f5e('0x9f')](_0x2f5e('0xe5'),_0x4b96a9),_0x465a5c[_0x2f5e('0x6c')],_0x465a5c[_0x2f5e('0xe6')],_0x465a5c[_0x2f5e('0x6a')]]);if(_0x488c16[_0x2f5e('0xad')]===-0x1){return _0x488c16;}return this['channel'][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xe7'),'DIAL'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xe8')]=function(_0x3b9db8){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0xe9'),_0x3b9db8[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x3b9db8['key'])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xea'));}if(!this[_0x2f5e('0x88')](_0x3b9db8[_0x2f5e('0x64')])){return this['channel']['noop'](_0x2f5e('0xab'));}this[_0x2f5e('0x12')][_0x2f5e('0xeb')]=!![];this[_0x2f5e('0x3b')](_0x3b9db8);this[_0x2f5e('0x49')](_0x3b9db8[_0x2f5e('0x64')],'in','','');this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xec'),_0x3b9db8[_0x2f5e('0x64')]));var _0x54cee6=this['googleDialogflow'][_0x2f5e('0xc5')](this,_0x3b9db8);if(_0x54cee6){for(var _0x463439 in _0x54cee6){if(_0x54cee6[_0x2f5e('0x9a')](_0x463439)){this[_0x2f5e('0x12')][_0x2f5e('0xa1')](util['format']('DIALOGFLOW_%s',_0x463439['toUpperCase']()),_0x54cee6[_0x463439]);}}this[_0x2f5e('0x49')](_0x54cee6[_0x2f5e('0xed')],_0x2f5e('0xee'),'dialogflow','');return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xef'),_0x54cee6[_0x2f5e('0xed')]));}return this['channel'][_0x2f5e('0x30')](_0x3b9db8,_0x2f5e('0xf0'));};AGIVertices[_0x2f5e('0x14')]['dialogflowV2']=function(_0x34e4c1){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0xf1'),_0x34e4c1[_0x2f5e('0x3d')]));if(!this['isConfigured'](_0x34e4c1[_0x2f5e('0x7e')])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0xf2'));}if(!this[_0x2f5e('0x88')](_0x34e4c1[_0x2f5e('0x7f')])){return this[_0x2f5e('0x12')]['noop'](_0x2f5e('0xf3'));}if(!this[_0x2f5e('0x88')](_0x34e4c1['private_key'])){return this[_0x2f5e('0x12')]['noop']('no\x20private_key\x20configured');}if(!this[_0x2f5e('0x88')](_0x34e4c1['dialogflowV2_language'])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xf4'));}if(!this['isConfigured'](_0x34e4c1[_0x2f5e('0x64')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('no\x20text\x20configured');}this['channel'][_0x2f5e('0xeb')]=!![];this[_0x2f5e('0x3b')](_0x34e4c1);this[_0x2f5e('0x49')](_0x34e4c1[_0x2f5e('0x64')],'in','','');this['channel'][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xf5'),_0x34e4c1[_0x2f5e('0x64')]));var _0x328ba3=this['googleDialogflowV2'][_0x2f5e('0xc5')](this,_0x34e4c1);if(_0x328ba3){for(var _0x1098be in _0x328ba3){if(_0x328ba3[_0x2f5e('0x9a')](_0x1098be)){if(_0x1098be!=='providerResponse'){this['channel']['setVariable'](util[_0x2f5e('0x9f')]('DIALOGFLOW_%s',_0x1098be[_0x2f5e('0xf6')]()),_0x328ba3[_0x1098be]);}}}this['createSquareMessage'](_0x328ba3[_0x2f5e('0xed')],_0x2f5e('0xee'),'dialogflowV2',_0x328ba3['providerResponse']);return this['channel'][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xf7'),_0x328ba3[_0x2f5e('0xed')]));}return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x34e4c1,_0x2f5e('0xf8'));};AGIVertices['prototype']['sesteknda']=function(_0x192aae){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x192aae[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x192aae['ndauth_url'])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xf9'));}if(!this['isConfigured'](_0x192aae[_0x2f5e('0xfa')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xfb'));}if(!this[_0x2f5e('0x88')](_0x192aae[_0x2f5e('0xfc')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xfd'));}if(!this[_0x2f5e('0x88')](_0x192aae[_0x2f5e('0xfe')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xab'));}this[_0x2f5e('0x12')][_0x2f5e('0xeb')]=!![];this[_0x2f5e('0x3b')](_0x192aae);this[_0x2f5e('0x49')](_0x192aae[_0x2f5e('0x64')],'in','','');this['channel'][_0x2f5e('0xaa')](util['format'](_0x2f5e('0xff'),_0x192aae[_0x2f5e('0x64')]));var _0x5b6c66=this[_0x2f5e('0x82')][_0x2f5e('0xc5')](this,_0x192aae);if(_0x5b6c66){for(var _0x2a76c1 in _0x5b6c66){if(_0x5b6c66[_0x2f5e('0x9a')](_0x2a76c1)){this[_0x2f5e('0x12')][_0x2f5e('0xa1')](util['format'](_0x2f5e('0x100'),_0x2a76c1['toUpperCase']()),_0x5b6c66[_0x2a76c1]);}}this[_0x2f5e('0x49')](_0x5b6c66[_0x2f5e('0xed')],'out',_0x2f5e('0x101'),'');if(_0x5b6c66[_0x2f5e('0x102')]){this['channel']['noop'](util[_0x2f5e('0x9f')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x5b6c66[_0x2f5e('0x102')]));var _0xbef4c2=this['channel']['streamFile'](_0x5b6c66[_0x2f5e('0x102')]);try{fs['unlink'](_0x5b6c66['audiofile']+_0x2f5e('0x103'));}catch(_0x3b3d74){logger['error'](_0x3b3d74);}return _0xbef4c2;}else{return this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x104'),_0x5b6c66['speech']));}}return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x192aae,_0x2f5e('0x105'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x106')]=function(_0x3addd7){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x107'),_0x3addd7[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x106'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x108')]=function(_0x2b80dc){logger[_0x2f5e('0x31')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2b80dc['label']));var _0x3b42e='';if(_0x2b80dc[_0x2f5e('0x109')]){if(!this['isConfigured'](_0x2b80dc[_0x2f5e('0x109')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x2b80dc,_0x2f5e('0x10a'));}else{var _0x4ad6c8=parseInt(_0x2b80dc[_0x2f5e('0x109')],0xa);if(isNaN(_0x4ad6c8)){_0x3b42e=_0x2b80dc['trunk_id'];}else{_0x3b42e=this[_0x2f5e('0x10b')][_0x2f5e('0xc5')](this,_0x2b80dc[_0x2f5e('0x109')]);if(!_0x3b42e){return this[_0x2f5e('0x12')]['error'](_0x2b80dc,_0x2f5e('0x10c'));}}}}else if(_0x2b80dc[_0x2f5e('0x10d')]){_0x3b42e=_0x2b80dc['trunk_name'];}else{return this[_0x2f5e('0x12')]['error'](_0x2b80dc,'no\x20trunk\x20selected');}var _0x1e90f6=this[_0x2f5e('0x12')][_0x2f5e('0x5f')](_0x2f5e('0x10e'),[util[_0x2f5e('0x9f')](_0x2f5e('0x10f'),_0x3b42e,_0x2b80dc[_0x2f5e('0x50')]),_0x2b80dc[_0x2f5e('0x6c')],_0x2b80dc[_0x2f5e('0xe6')],_0x2b80dc[_0x2f5e('0x6a')]]);if(_0x1e90f6[_0x2f5e('0xad')]===-0x1){return _0x1e90f6;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xe7'),_0x2f5e('0x10e')));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x110')]=function(_0x349423){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x111'),_0x349423[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x110'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x10')]=function(_0x5493d6){logger['info'](util['format'](_0x2f5e('0x112'),_0x5493d6[_0x2f5e('0x3d')]));if(_0x5493d6['retry']===0x0){return this['maxRetry'](_0x5493d6);}_0x5493d6[_0x2f5e('0xa7')]-=0x1;if(!this['isConfigured'](_0x5493d6[_0x2f5e('0x113')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x5493d6,'no\x20file\x20audio\x20selected');}var _0x233754=this[_0x2f5e('0x114')][_0x2f5e('0xc5')](this,_0x5493d6[_0x2f5e('0x113')]);if(!_0x233754){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x5493d6,_0x2f5e('0x115'));}if(!this[_0x2f5e('0x88')](_0x5493d6[_0x2f5e('0xda')])){return this['channel'][_0x2f5e('0x30')](_0x2f5e('0xdb'));}var _0x3c29d2=this['channel'][_0x2f5e('0x116')](_0x233754,_0x5493d6[_0x2f5e('0x117')],_0x5493d6[_0x2f5e('0x118')]);var _0x631867=_0x3c29d2[_0x2f5e('0xad')]?_0x3c29d2[_0x2f5e('0xad')][_0x2f5e('0x54')]():'';logger['info'](_0x2f5e('0x119'),JSON[_0x2f5e('0x75')](_0x3c29d2));if(_0x3c29d2[_0x2f5e('0xad')]===-0x1){this[_0x2f5e('0x3b')][_0x2f5e('0xc5')](this,_0x5493d6,_0x631867);return _0x3c29d2;}else if(_0x3c29d2[_0x2f5e('0xa5')]==='timeout'){_0x3c29d2[_0x2f5e('0xad')]=_0x631867[_0x2f5e('0x9d')]>=parseInt(_0x5493d6[_0x2f5e('0x11a')])?'x':'i';}else{_0x3c29d2[_0x2f5e('0xad')]=_0x631867[_0x2f5e('0x9d')]>=parseInt(_0x5493d6[_0x2f5e('0x11a')])&&_0x631867['length']<=parseInt(_0x5493d6['maxdigit'])?'x':'i';}var _0x404f6d=this[_0x2f5e('0x15')][_0x2f5e('0xc5')](this,_0x5493d6['variable_id']);if(!_0x404f6d){return this['channel'][_0x2f5e('0x30')](_0x5493d6,_0x2f5e('0x11b'));}this[_0x2f5e('0x12')]['setVariable'](_0x404f6d,_0x631867);if(this[_0x2f5e('0x88')](_0x5493d6[_0x2f5e('0x11c')])){var _0x4a7329=parseInt(_0x5493d6[_0x2f5e('0x11c')],0xa);var _0x3a22cd=rs[_0x2f5e('0x11d')]({'charset':'*','length':_0x4a7329});var _0x427a97=_0x631867['length'];if(_0x427a97>0x0){if(_0x427a97>_0x4a7329){this[_0x2f5e('0x3b')]['sync'](this,_0x5493d6,_0x5493d6[_0x2f5e('0x11e')]==='first'?_0x3a22cd+_0x631867[_0x2f5e('0x11f')](_0x4a7329):_0x631867[_0x2f5e('0x11f')](0x0,_0x427a97-_0x4a7329)+_0x3a22cd);}else{this[_0x2f5e('0x3b')][_0x2f5e('0xc5')](this,_0x5493d6,rs[_0x2f5e('0x11d')]({'charset':'*','length':_0x427a97}));}}else{this[_0x2f5e('0x3b')][_0x2f5e('0xc5')](this,_0x5493d6,'');}}else{this['createSquareDetailsReport'][_0x2f5e('0xc5')](this,_0x5493d6,_0x631867);}return _0x3c29d2;};AGIVertices['prototype']['getsecretdigits']=function(_0x50fdea){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x120'),_0x50fdea[_0x2f5e('0x3d')]));return this[_0x2f5e('0x10')](_0x50fdea);};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x121')]=function(_0x23b955){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x122'),_0x23b955[_0x2f5e('0x3d')]));this[_0x2f5e('0x3b')]['sync'](this,_0x23b955,_0x23b955[_0x2f5e('0x123')]);return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x124'),_0x23b955['goalname']));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x125')]=function(_0x26ab0e){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x26ab0e[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x26ab0e[_0x2f5e('0x126')])||!this[_0x2f5e('0x88')](_0x26ab0e[_0x2f5e('0x8f')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x127'));}if(!this[_0x2f5e('0x88')](_0x26ab0e[_0x2f5e('0x64')])){return this[_0x2f5e('0x12')]['noop'](_0x2f5e('0xab'));}this['channel']['noop'](util[_0x2f5e('0x9f')]('Trying\x20aws\x20Polly\x20%s',_0x26ab0e[_0x2f5e('0x64')]));var _0x5251f3=this[_0x2f5e('0x8a')]['sync'](this,_0x26ab0e);if(_0x5251f3){this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x128'),_0x5251f3));var _0x5c2dae=this[_0x2f5e('0x12')][_0x2f5e('0x129')](_0x5251f3);try{fs[_0x2f5e('0x12a')](_0x5251f3+_0x2f5e('0x103'));}catch(_0x413a22){logger['error'](_0x413a22);}return _0x5c2dae;}return this[_0x2f5e('0x12')]['error'](_0x26ab0e,_0x2f5e('0x12b'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x12c')]=function(_0x4fe85a){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x12d'),_0x4fe85a[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x4fe85a[_0x2f5e('0x126')])||!this[_0x2f5e('0x88')](_0x4fe85a[_0x2f5e('0x8f')])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0x127'));}if(!this['isConfigured'](_0x4fe85a[_0x2f5e('0x12e')])){return this[_0x2f5e('0x12')]['noop'](_0x2f5e('0x12f'));}if(!this['isConfigured'](_0x4fe85a[_0x2f5e('0x64')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xab'));}this[_0x2f5e('0x12')][_0x2f5e('0xeb')]=!![];this['createSquareDetailsReport'](_0x4fe85a);this[_0x2f5e('0x49')](_0x4fe85a['text'],'in','','');this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util['format'](_0x2f5e('0x130'),_0x4fe85a[_0x2f5e('0x64')]));var _0xb5b04b=this['awsLex'][_0x2f5e('0xc5')](this,_0x4fe85a);if(_0xb5b04b){for(var _0x5d6682 in _0xb5b04b){if(_0xb5b04b['hasOwnProperty'](_0x5d6682)&&_['isString'](_0xb5b04b[_0x5d6682])){this[_0x2f5e('0x12')]['setVariable'](util[_0x2f5e('0x9f')](_0x2f5e('0x131'),_0x5d6682[_0x2f5e('0xf6')]()),_0xb5b04b[_0x5d6682]);}}if(_[_0x2f5e('0x4c')](_0xb5b04b[_0x2f5e('0x132')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x2f5e('0x49')](_0xb5b04b[_0x2f5e('0x132')],_0x2f5e('0xee'),_0x2f5e('0x133'),'');return this['channel']['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x134'),_0xb5b04b[_0x2f5e('0x132')]));}}return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x4fe85a,_0x2f5e('0x135'));};AGIVertices[_0x2f5e('0x14')]['googleasr']=function(_0x13b6b3){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x136'),_0x13b6b3[_0x2f5e('0x3d')],_0x13b6b3['timeout']));if(!this['isConfigured'](_0x13b6b3[_0x2f5e('0x7b')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xea'));}var _0x146a3f=_0x2f5e('0x137');var _0x258259=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x2f5e('0x11d')](0x4));var _0x265669=util[_0x2f5e('0x9f')](_0x2f5e('0xa0'),_0x258259,_0x146a3f);var _0x64272d=!![];if(_0x13b6b3[_0x2f5e('0x138')]===_0x2f5e('0x139')){_0x64272d=![];}var _0x1fa5eb=this['channel'][_0x2f5e('0x13a')](_0x258259,_0x146a3f,_0x13b6b3[_0x2f5e('0x13b')],_0x13b6b3[_0x2f5e('0x6c')],undefined,_0x64272d);if(_0x1fa5eb[_0x2f5e('0xad')]!==-0x1){this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util['format'](_0x2f5e('0x13c'),_0x265669));var _0xced717=this[_0x2f5e('0x13d')]['sync'](this,_0x13b6b3,_0x265669);if(_0xced717){for(var _0x20cc81 in _0xced717){if(_0xced717[_0x2f5e('0x9a')](_0x20cc81)){this[_0x2f5e('0x12')][_0x2f5e('0xa1')](util[_0x2f5e('0x9f')](_0x2f5e('0x13e'),_0x20cc81[_0x2f5e('0xf6')]()),_0xced717[_0x20cc81]);}}return this['channel'][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('GoogleASR\x20Result\x20%s',JSON[_0x2f5e('0x75')](_0xced717)));}}return _0x1fa5eb;};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x13f')]=function(_0x190200){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x140'),_0x190200[_0x2f5e('0x3d')]));if(!this['isConfigured'](_0x190200[_0x2f5e('0x93')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x141'));}if(!this[_0x2f5e('0x88')](_0x190200[_0x2f5e('0x142')])){return this[_0x2f5e('0x12')]['noop'](_0x2f5e('0x143'));}var _0x461e6b=_0x2f5e('0x137');var _0x342106=util[_0x2f5e('0x9f')](_0x2f5e('0x144'),FILES_PATH,rs['generate'](0x4));var _0x1271c1=util['format'](_0x2f5e('0xa0'),_0x342106,_0x461e6b);var _0x1de563=!![];if(_0x190200['beep']===_0x2f5e('0x139')){_0x1de563=![];}var _0x3e3f77=this[_0x2f5e('0x12')][_0x2f5e('0x13a')](_0x342106,_0x461e6b,_0x190200['intKey'],_0x190200['timeout'],undefined,_0x1de563);if(_0x3e3f77['result']!==-0x1){this['channel'][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('tilde\x20%s\x20file\x20created',_0x1271c1));var _0x3b4ace=this[_0x2f5e('0x92')]['sync'](this,_0x190200,_0x1271c1);if(_0x3b4ace){for(var _0xbab963 in _0x3b4ace){if(_0x3b4ace[_0x2f5e('0x9a')](_0xbab963)){this['channel'][_0x2f5e('0xa1')](util[_0x2f5e('0x9f')](_0x2f5e('0x145'),_0xbab963[_0x2f5e('0xf6')]()),_0x3b4ace[_0xbab963]);}}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x146'),JSON['stringify'](_0x3b4ace)));}}return _0x3e3f77;};AGIVertices[_0x2f5e('0x14')]['gotoc']=function(_0x643cd9){logger[_0x2f5e('0x31')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x643cd9[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0x147')](_0x643cd9[_0x2f5e('0x43')],_0x643cd9[_0x2f5e('0x44')],_0x643cd9['priority']);};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x148')]=function(_0x5659c8){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x149'),_0x5659c8[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x5659c8[_0x2f5e('0x14a')])){return this[_0x2f5e('0x12')]['error'](_0x5659c8,'no\x20condition\x20configured');}try{var _0x17cc93=eval(_0x5659c8['condition'])?_0x2f5e('0x14b'):_0x2f5e('0x14c');this[_0x2f5e('0x12')]['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x5659c8[_0x2f5e('0x14a')],_0x17cc93));return{'code':0xc8,'result':_0x17cc93};}catch(_0x42f1b0){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x2f5e('0x14')]['gotoiftime']=function(_0x1e634c){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x14d'),_0x1e634c[_0x2f5e('0x3d')]));if(!this['isConfigured'](_0x1e634c[_0x2f5e('0x14e')])){return this['channel']['error'](_0x1e634c,_0x2f5e('0x14f'));}var _0x35e6bf=this[_0x2f5e('0x28')][_0x2f5e('0xc5')](this,_0x1e634c['interval_id']);if(!_0x35e6bf){return this['channel'][_0x2f5e('0x30')](_0x1e634c,'no\x20intervals\x20found');}for(var _0x4c8b9e=0x0;_0x4c8b9e<_0x35e6bf[_0x2f5e('0x9d')];_0x4c8b9e+=0x1){var _0x681e47=this[_0x2f5e('0x12')][_0x2f5e('0x15')](util['format'](_0x2f5e('0x150'),_0x35e6bf[_0x4c8b9e]));if(_0x681e47[_0x2f5e('0xad')]===-0x1){return _0x681e47;}logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x151'),_0x35e6bf[_0x4c8b9e],_0x681e47['extra']));if(_0x681e47[_0x2f5e('0xa5')]===_0x2f5e('0x14b')){logger['info'](util[_0x2f5e('0x9f')]('IFTIME\x20%s\x20%s',_0x35e6bf[_0x4c8b9e],_0x2f5e('0x14b')));this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x151'),_0x35e6bf[_0x4c8b9e],_0x2f5e('0x14b')));return{'code':0xc8,'result':_0x2f5e('0x14b')};}else{logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('IFTIME\x20%s\x20%s',_0x35e6bf[_0x4c8b9e],_0x2f5e('0x14c')));this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x151'),_0x35e6bf[_0x4c8b9e],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x152')]=function(_0x1b7b01){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x1b7b01[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0x152')]();};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x153')]=function(_0x7549e3){logger['info'](util['format'](_0x2f5e('0x154'),_0x7549e3[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x7549e3[_0x2f5e('0x7b')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('no\x20key\x20configured');}var _0xbfa20c=_0x2f5e('0x137');var _0x177948=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x2f5e('0x11d')](0x4));var _0x46f13f=util[_0x2f5e('0x9f')](_0x2f5e('0xa0'),_0x177948,_0xbfa20c);var _0x3485d1=!![];if(_0x7549e3['beep']===_0x2f5e('0x139')){_0x3485d1=![];}var _0x38f05f=this['channel'][_0x2f5e('0x13a')](_0x177948,_0xbfa20c,_0x7549e3[_0x2f5e('0x13b')],_0x7549e3[_0x2f5e('0x6c')],undefined,_0x3485d1);if(_0x38f05f[_0x2f5e('0xad')]!==-0x1){this[_0x2f5e('0x12')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x46f13f));var _0x10a085=this['ispeechASR'][_0x2f5e('0xc5')](this,_0x7549e3,_0x46f13f);if(_0x10a085){for(var _0x39f0e6 in _0x10a085){if(_0x10a085[_0x2f5e('0x9a')](_0x39f0e6)){this[_0x2f5e('0x12')][_0x2f5e('0xa1')](util[_0x2f5e('0x9f')](_0x2f5e('0x155'),_0x39f0e6['toUpperCase']()),_0x10a085[_0x39f0e6]);}}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x156'),JSON['stringify'](_0x10a085)));}}return _0x38f05f;};AGIVertices['prototype'][_0x2f5e('0x157')]=function(_0x244117){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x244117[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x244117['key'])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0xea'));}if(!this['isConfigured'](_0x244117[_0x2f5e('0x64')])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0xab'));}this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x158'),_0x244117[_0x2f5e('0x64')]));var _0x55e10f=this[_0x2f5e('0x83')][_0x2f5e('0xc5')](this,_0x244117);if(_0x55e10f){this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x159'),_0x55e10f));var _0x12ead0=this['channel'][_0x2f5e('0x129')](_0x55e10f,_0x244117[_0x2f5e('0x13b')]);try{fs[_0x2f5e('0x12a')](_0x55e10f+_0x2f5e('0x103'));}catch(_0x297899){logger[_0x2f5e('0x30')](_0x297899);}return _0x12ead0;}return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x244117,_0x2f5e('0x15a'));};AGIVertices['prototype'][_0x2f5e('0x15b')]=function(_0x21ec64){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x15c'),_0x21ec64[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x21ec64['findBy'])){return this['channel']['error'](_0x21ec64,_0x2f5e('0x15d'));}logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x15e'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x21ec64[_0x2f5e('0x15f')]));var _0x32c095=this[_0x2f5e('0x160')][_0x2f5e('0xc5')](this,_0x21ec64[_0x2f5e('0x15f')]);if(_0x32c095){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x161'),this[_0x2f5e('0x12')]['callerid'],_0x21ec64['findBy']));this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x161'),this['channel'][_0x2f5e('0x40')],_0x21ec64['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0x162'),this[_0x2f5e('0x12')]['callerid'],_0x21ec64['findBy']));this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x162'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x21ec64[_0x2f5e('0x15f')]));return{'code':0xc8,'result':_0x2f5e('0x163')};}};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x164')]=function(_0x32242b){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x165'),_0x32242b[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x32242b[_0x2f5e('0x15f')])){return this['channel']['error'](_0x32242b,'no\x20find\x20by\x20configured');}logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x15e'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x32242b[_0x2f5e('0x15f')]));var _0x2f2881=this[_0x2f5e('0x5b')][_0x2f5e('0xc5')](this,_0x32242b[_0x2f5e('0x15f')]);if(_0x2f2881){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0x161'),this['channel'][_0x2f5e('0x40')],_0x32242b[_0x2f5e('0x15f')]));this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2f5e('0x12')]['callerid'],_0x32242b[_0x2f5e('0x15f')]));return{'code':0xc8,'result':_0x2f5e('0x166')};}else{logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0x162'),this['channel'][_0x2f5e('0x40')],_0x32242b[_0x2f5e('0x15f')]));this['channel'][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x162'),this['channel'][_0x2f5e('0x40')],_0x32242b['findBy']));return{'code':0xc8,'result':_0x2f5e('0x163')};}};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x167')]=function(_0x1a7cde){logger[_0x2f5e('0x31')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1a7cde[_0x2f5e('0x3d')]));if(!this['isConfigured'](_0x1a7cde['operation'])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x1a7cde,_0x2f5e('0x168'));}this['channel']['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x169'),_0x1a7cde[_0x2f5e('0x16a')]));var _0x4ad6d7=eval(_0x1a7cde[_0x2f5e('0x16a')]);if(!this[_0x2f5e('0x88')](_0x1a7cde[_0x2f5e('0xda')])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0xdb'));}var _0x428435=this[_0x2f5e('0x15')][_0x2f5e('0xc5')](this,_0x1a7cde[_0x2f5e('0xda')]);if(!_0x428435){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x1a7cde,'no\x20variable\x20found');}if(_['isArray'](_0x4ad6d7)){var _0x1249eb=this;_0x4ad6d7[_0x2f5e('0xdc')](function(_0x106f40,_0x10f852){_0x1249eb[_0x2f5e('0x12')][_0x2f5e('0xa1')](util[_0x2f5e('0x9f')]('%s[%s]',_0x428435,_0x10f852),_0x106f40);});return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x16b'),_0x428435));}else{return this[_0x2f5e('0x12')][_0x2f5e('0xa1')](_0x428435,_0x4ad6d7);}};AGIVertices[_0x2f5e('0x14')]['menu']=function(_0x299344){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x16c'),_0x299344[_0x2f5e('0x3d')]));if(_0x299344[_0x2f5e('0xa7')]===0x0){return this[_0x2f5e('0xa6')](_0x299344);}_0x299344[_0x2f5e('0xa7')]-=0x1;if(!this[_0x2f5e('0x88')](_0x299344['file_id'])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x299344,'no\x20file\x20audio\x20selected');}var _0x5ec1af=this['getSound'][_0x2f5e('0xc5')](this,_0x299344[_0x2f5e('0x113')]);if(!_0x5ec1af){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x299344,_0x2f5e('0x115'));}var _0x87e685=this['channel'][_0x2f5e('0x116')](_0x5ec1af,_0x299344[_0x2f5e('0x117')],_0x299344[_0x2f5e('0x16d')]);var _0x57d83f=_0x87e685['result'];if(_0x87e685[_0x2f5e('0xad')]===-0x1){this[_0x2f5e('0x3b')][_0x2f5e('0xc5')](this,_0x299344,'-1');return _0x87e685;}else if(_0x87e685[_0x2f5e('0xa5')]===_0x2f5e('0x6c')){_0x87e685[_0x2f5e('0xad')]=_0x87e685['result'][_0x2f5e('0x9d')]>0x0?_0x87e685[_0x2f5e('0xad')]:'t';}else if(_[_0x2f5e('0x4b')](_0x87e685[_0x2f5e('0xad')])){_0x87e685[_0x2f5e('0xad')]='#';_0x57d83f='#';}if(!this['isConfigured'](_0x299344[_0x2f5e('0xda')])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3a974c=this[_0x2f5e('0x15')][_0x2f5e('0xc5')](this,_0x299344[_0x2f5e('0xda')]);if(!_0x3a974c){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x299344,_0x2f5e('0x11b'));}this['channel'][_0x2f5e('0xa1')](_0x3a974c,_0x57d83f);}this['createSquareDetailsReport']['sync'](this,_0x299344,_0x57d83f);return _0x87e685;};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0xaa')]=function(_0x208963){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x16e'),_0x208963[_0x2f5e('0x3d')]));return this['channel'][_0x2f5e('0xaa')](_0x208963[_0x2f5e('0x16f')]||_0x208963[_0x2f5e('0x3d')]);};AGIVertices['prototype']['pause']=function(_0x1dc280){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x170'),_0x1dc280[_0x2f5e('0x3d')]));if(!this['isConfigured'](_0x1dc280[_0x2f5e('0x15f')])){return this['channel'][_0x2f5e('0x30')](_0x1dc280,_0x2f5e('0x15d'));}logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x15e'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x1dc280[_0x2f5e('0x15f')]));var _0x1eb8c5=this[_0x2f5e('0x56')][_0x2f5e('0xc5')](this,_0x1dc280['pause_id']);var _0x24f704=this[_0x2f5e('0x58')][_0x2f5e('0xc5')](this,_0x1dc280[_0x2f5e('0x15f')],_0x1eb8c5);if(_0x24f704){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x1dc280[_0x2f5e('0x15f')]));this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2f5e('0x12')]['callerid'],_0x1dc280[_0x2f5e('0x15f')]));return{'code':0xc8,'result':_0x2f5e('0x166')};}else{logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x162'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x1dc280[_0x2f5e('0x15f')]));this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x161'),this['channel']['callerid'],_0x1dc280['findBy']));return{'code':0xc8,'result':_0x2f5e('0x163')};}};AGIVertices['prototype']['playback']=function(_0x568be2){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x568be2['label']));if(!this[_0x2f5e('0x88')](_0x568be2[_0x2f5e('0x113')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x568be2,_0x2f5e('0x171'));}var _0x2adbe8=this[_0x2f5e('0x114')][_0x2f5e('0xc5')](this,_0x568be2[_0x2f5e('0x113')]);if(!_0x2adbe8){return this['channel'][_0x2f5e('0x30')](_0x568be2,_0x2f5e('0x115'));}var _0x2e3323=this[_0x2f5e('0x12')][_0x2f5e('0x5f')]('PLAYBACK',[_0x2adbe8,_0x568be2[_0x2f5e('0xe6')]]);if(_0x2e3323[_0x2f5e('0xad')]===-0x1){return _0x2e3323;}return this['channel']['noop'](util[_0x2f5e('0x9f')]('Executed\x20command\x20%s\x20%s',_0x2f5e('0x172'),_0x2adbe8));};AGIVertices[_0x2f5e('0x14')]['queue']=function(_0x4d3edc){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x173'),_0x4d3edc[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x4d3edc[_0x2f5e('0x174')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x4d3edc,_0x2f5e('0x175'));}var _0x120705='';var _0x10d755=parseInt(_0x4d3edc['queue_id'],0xa);if(isNaN(_0x10d755)){_0x120705=_0x4d3edc[_0x2f5e('0x174')];}else{_0x120705=this[_0x2f5e('0x19')][_0x2f5e('0xc5')](this,_0x4d3edc['queue_id']);if(!_0x120705){return this['channel'][_0x2f5e('0x30')](_0x4d3edc,'no\x20queue\x20found');}}var _0x230f9b='';if(this[_0x2f5e('0x88')](_0x4d3edc['file_id'])){var _0x18521c=this[_0x2f5e('0x114')][_0x2f5e('0xc5')](this,_0x4d3edc[_0x2f5e('0x113')]);if(_0x18521c){_0x230f9b=_0x18521c;}}this[_0x2f5e('0x3b')][_0x2f5e('0xc5')](this,_0x4d3edc,_0x120705);if(_0x4d3edc[_0x2f5e('0xe6')][_0x2f5e('0x176')]('x')<0x0){_0x4d3edc[_0x2f5e('0xe6')]+='x';}if(_0x4d3edc[_0x2f5e('0xe6')]['indexOf']('X')<0x0){_0x4d3edc[_0x2f5e('0xe6')]+='X';}this[_0x2f5e('0x12')][_0x2f5e('0xa1')]('XMCS-QUEUE',_0x120705?_0x120705[_0x2f5e('0x177')]():'');var _0x2f44c4=this[_0x2f5e('0x12')]['exec']('QUEUE',[_0x120705,_0x4d3edc[_0x2f5e('0xe6')],_0x4d3edc['url'],_0x230f9b,_0x4d3edc['timeout'],_0x4d3edc[_0x2f5e('0x9')],_0x4d3edc[_0x2f5e('0x178')],_0x4d3edc[_0x2f5e('0x179')],'',_0x4d3edc['position']]);if(_0x2f44c4[_0x2f5e('0xad')]===-0x1){return _0x2f44c4;}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xca'),_0x2f5e('0x17a'),_0x120705));};AGIVertices['prototype'][_0x2f5e('0x17b')]=function(_0x2547f9){logger['info'](util[_0x2f5e('0x9f')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2547f9['label']));var _0x372453=_0x2547f9['recordingFormat']||_0x2f5e('0x137');var _0x2444ca=util[_0x2f5e('0x9f')](_0x2f5e('0x17c'),this[_0x2f5e('0x12')]['uniqueid'],rs[_0x2f5e('0x11d')](0x5));var _0x47c865=util[_0x2f5e('0x9f')]('%s/recordings/%s.%s',FILES_PATH,_0x2444ca,_0x372453);var _0x370305=util[_0x2f5e('0x9f')](_0x2f5e('0x144'),FILES_PATH,_0x2444ca);this[_0x2f5e('0x41')]['sync'](this,_0x2547f9,_0x2444ca,_0x47c865);this['channel'][_0x2f5e('0xa1')]('RECORDING_SAVENAME',_0x2444ca);logger[_0x2f5e('0x31')](_0x2f5e('0x17d'),_0x370305,_0x372453,_0x2547f9[_0x2f5e('0x17e')],_0x2547f9[_0x2f5e('0x6c')]);return this['channel'][_0x2f5e('0x13a')](_0x370305,_0x372453,_0x2547f9[_0x2f5e('0x17e')],_0x2547f9[_0x2f5e('0x6c')],undefined,!![]);};AGIVertices['prototype'][_0x2f5e('0x17f')]=function(_0x2a5b8f){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2a5b8f['label']));if(!this['isConfigured'](_0x2a5b8f['url'])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0x180'));}var _0x340472=this['restAPI'][_0x2f5e('0xc5')](this,_0x2a5b8f);logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x181'),util[_0x2f5e('0x182')](_0x340472,{'showHidden':![],'depth':null})));if(!this[_0x2f5e('0x88')](_0x2a5b8f[_0x2f5e('0xda')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x178dd1=this[_0x2f5e('0x15')][_0x2f5e('0xc5')](this,_0x2a5b8f[_0x2f5e('0xda')]);if(!_0x178dd1){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x2a5b8f,'no\x20variable\x20found');}this[_0x2f5e('0x12')]['setVariable'](util[_0x2f5e('0x9f')](_0x2f5e('0x183'),_0x178dd1),_0x340472[_0x2f5e('0x77')]?_0x340472[_0x2f5e('0x77')]:_0x2f5e('0x184'));this['channel'][_0x2f5e('0xa1')](util[_0x2f5e('0x9f')](_0x2f5e('0x185'),_0x178dd1),_0x340472[_0x2f5e('0x186')]?_0x340472['statusMessage']:'OK');if(_0x340472[_0x2f5e('0x74')]){try{this[_0x2f5e('0x9e')](_0x340472['body'],_0x178dd1);}catch(_0x2662f4){logger[_0x2f5e('0x30')](util[_0x2f5e('0x9f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x178dd1));}}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util['format']('variable\x20%s\x20set',_0x178dd1));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x187')]=function(_0x470a09){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x188'),_0x470a09[_0x2f5e('0x3d')]));return this['channel'][_0x2f5e('0x189')](_0x470a09[_0x2f5e('0x18a')]['replace'](/\s+/g,''),_0x470a09[_0x2f5e('0x17e')]);};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x18b')]=function(_0x498fb8){logger['info'](util[_0x2f5e('0x9f')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x498fb8[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0x18c')](_0x498fb8[_0x2f5e('0x6d')][_0x2f5e('0x18d')](/\s+/g,''),_0x498fb8[_0x2f5e('0x17e')]);};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x18e')]=function(_0x57eec1){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x18f'),_0x57eec1[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0x190')](_0x57eec1[_0x2f5e('0x64')],_0x57eec1[_0x2f5e('0x17e')]);};AGIVertices[_0x2f5e('0x14')]['sendMail']=function(_0xd943d7){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x191'),_0xd943d7[_0x2f5e('0x3d')]));if(!this['isConfigured'](_0xd943d7[_0x2f5e('0x192')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('no\x20mail\x20account\x20configured');}var _0x2ae9ce=this[_0x2f5e('0x25')][_0x2f5e('0xc5')](this,_0xd943d7[_0x2f5e('0x192')]);if(!_0x2ae9ce||!_0x2ae9ce['Smtp']){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0xd943d7,'no\x20mail\x20account\x20found');}var _0x657a6c={'from':util['format']('\x22%s\x22\x20<%s>',_0x2ae9ce[_0x2f5e('0x1b')],_0x2ae9ce[_0x2f5e('0x193')]||_0x2ae9ce[_0x2f5e('0x194')][_0x2f5e('0x195')]),'to':_0xd943d7['to']||'','cc':_0xd943d7['cc']||'','bcc':_0xd943d7[_0x2f5e('0x196')]||'','subject':_0xd943d7[_0x2f5e('0x197')],'html':_0xd943d7[_0x2f5e('0x64')],'text':_0xd943d7['text']};var _0x3e95d2={'tls':{'rejectUnauthorized':![]}};if(_0x2ae9ce['Smtp'][_0x2f5e('0x198')]){_0x3e95d2[_0x2f5e('0x198')]=_0x2ae9ce[_0x2f5e('0x194')]['service'];}else{_0x3e95d2[_0x2f5e('0x199')]=_0x2ae9ce[_0x2f5e('0x194')][_0x2f5e('0x199')];_0x3e95d2[_0x2f5e('0x19a')]=_0x2ae9ce['Smtp']['port'];_0x3e95d2[_0x2f5e('0x19b')]=_0x2ae9ce['Smtp'][_0x2f5e('0x19b')];}if(_0x2ae9ce[_0x2f5e('0x194')][_0x2f5e('0x19c')]){_0x3e95d2[_0x2f5e('0x19d')]={'user':_0x2ae9ce[_0x2f5e('0x194')][_0x2f5e('0x195')],'pass':_0x2ae9ce['Smtp']['pass']};}if(this['isConfigured'](_0xd943d7[_0x2f5e('0x19e')])){}logger[_0x2f5e('0xe1')](_0x2f5e('0x19f'),JSON['stringify'](_0x657a6c));this[_0x2f5e('0x3b')]['sync'](this,_0xd943d7,_0xd943d7[_0x2f5e('0x192')]);this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x1a0'),_0x2ae9ce[_0x2f5e('0x1b')]));this[_0x2f5e('0x27')][_0x2f5e('0xc5')](this,_0x3e95d2,_0x657a6c);return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0x1a1'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x1a2')]=function(_0x2a0a03){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x1a3'),_0x2a0a03[_0x2f5e('0x3d')]));return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x1a4'));};AGIVertices[_0x2f5e('0x14')]['sendSMS']=function(_0x1a2756){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x1a5'),_0x1a2756['label']));if(!this[_0x2f5e('0x88')](_0x1a2756[_0x2f5e('0x1a6')])){return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('no\x20sms\x20account\x20configured');}var _0x3fee48=this[_0x2f5e('0x38')]['sync'](this,_0x1a2756[_0x2f5e('0x1a6')]);if(!_0x3fee48){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x1a2756,_0x2f5e('0x1a7'));}var _0x83fe3f={'body':_0x1a2756[_0x2f5e('0x1a8')],'phone':_0x1a2756['to']||'','SmsAccountId':_0x3fee48['id']};logger[_0x2f5e('0xe1')](_0x2f5e('0x1a9'),JSON[_0x2f5e('0x75')](_0x83fe3f));this[_0x2f5e('0x3b')]['sync'](this,_0x1a2756,_0x1a2756[_0x2f5e('0x1a6')]);this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x1aa'),_0x3fee48[_0x2f5e('0x1b')]));this[_0x2f5e('0x3a')]['sync'](this,_0x83fe3f);return this[_0x2f5e('0x12')][_0x2f5e('0xaa')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x1ab')]=function(_0x235ea3){logger['info'](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x235ea3['label']));if(!this[_0x2f5e('0x88')](_0x235ea3[_0x2f5e('0xda')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x235ea3,_0x2f5e('0x1ac'));}var _0x453312=this[_0x2f5e('0x15')][_0x2f5e('0xc5')](this,_0x235ea3[_0x2f5e('0xda')]);if(!_0x453312){return this[_0x2f5e('0x12')]['error'](_0x235ea3,'no\x20variable\x20found');}return this['channel'][_0x2f5e('0xa1')](_0x453312,_0x235ea3[_0x2f5e('0x1ad')]);};AGIVertices[_0x2f5e('0x14')]['start']=function(_0x490ea1){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0x1ae'),_0x490ea1['label']));this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x1af'));if(_0x490ea1[_0x2f5e('0xbf')]===_0x2f5e('0x1b0')){this['channel'][_0x2f5e('0xaa')]('Answer');return this[_0x2f5e('0x12')][_0x2f5e('0xbf')]();}return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](_0x2f5e('0x1b1'));};AGIVertices[_0x2f5e('0x14')][_0x2f5e('0x1b2')]=function(_0x3129f5){logger['info'](util['format'](_0x2f5e('0x1b3'),_0x3129f5[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x3129f5[_0x2f5e('0x1b4')])){return this[_0x2f5e('0x12')]['error'](_0x3129f5,_0x2f5e('0x1b5'));}var _0xa55ab=this[_0x2f5e('0x1c')][_0x2f5e('0xc5')](this,_0x3129f5['project_id']);if(!this['isConfigured'](_0xa55ab)){return this[_0x2f5e('0x12')]['error'](_0x3129f5,util[_0x2f5e('0x9f')](_0x2f5e('0x1b6'),_0x3129f5[_0x2f5e('0x1b4')]));}if(_0xa55ab===this[_0x2f5e('0x12')][_0x2f5e('0x3f')]){return this['channel'][_0x2f5e('0x30')](_0x3129f5,_0x2f5e('0x1b7'));}this[_0x2f5e('0x3b')]['sync'](this,_0x3129f5,_0xa55ab);var _0x382e06=this['channel'][_0x2f5e('0x5f')](_0x2f5e('0x1b8'),util[_0x2f5e('0x9f')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x2f5e('0x9')][_0x2f5e('0x199')]||_0x2f5e('0x1b9'),_0xa55ab,this[_0x2f5e('0x12')]['arg_1']));if(_0x382e06[_0x2f5e('0xad')]===-0x1){return _0x382e06;}return this[_0x2f5e('0x12')]['noop'](util['format'](_0x2f5e('0xca'),_0x2f5e('0x1b8'),_0xa55ab));};AGIVertices['prototype'][_0x2f5e('0x1ba')]=function(_0x17a744){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x17a744['label']));var _0x177e8e=this['shellCommand']['sync'](this,_0x17a744[_0x2f5e('0xbb')]);this['createSquareDetailsReport'][_0x2f5e('0xc5')](this,_0x17a744,_0x17a744['command']);if(this[_0x2f5e('0x88')](_0x17a744[_0x2f5e('0xda')])){var _0x1be002=this[_0x2f5e('0x15')]['sync'](this,_0x17a744['variable_id']);if(_0x1be002){this[_0x2f5e('0x12')]['setVariable'](_0x1be002,_0x177e8e);return this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x1bb'),_0x17a744['command'],_0x1be002));}}return this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x17a744[_0x2f5e('0xbb')]));};AGIVertices[_0x2f5e('0x14')]['google_cloud_tts']=function(_0x5c6c7f){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x1bc'),_0x5c6c7f['label']));_0x5c6c7f[_0x2f5e('0x64')]=_0x5c6c7f[_0x2f5e('0x64')][_0x2f5e('0x18d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2f5e('0x88')](_0x5c6c7f[_0x2f5e('0x62')])){return this['channel'][_0x2f5e('0xaa')](_0x2f5e('0x1bd'));}if(!this[_0x2f5e('0x88')](_0x5c6c7f[_0x2f5e('0x64')])){return this[_0x2f5e('0x12')]['noop'](_0x2f5e('0xab'));}this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x5c6c7f[_0x2f5e('0x64')]));var _0x1b0479=this[_0x2f5e('0x61')][_0x2f5e('0xc5')](this,_0x5c6c7f);if(_0x1b0479){this[_0x2f5e('0x12')]['noop'](util[_0x2f5e('0x9f')](_0x2f5e('0x1be'),_0x1b0479));var _0x7e89a5=this[_0x2f5e('0x12')]['streamFile'](_0x1b0479);try{fs[_0x2f5e('0x12a')](_0x1b0479+_0x2f5e('0x103'));}catch(_0x1d4e43){logger[_0x2f5e('0x30')](_0x1d4e43);}return _0x7e89a5;}return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x5c6c7f,_0x2f5e('0x1bf'));};AGIVertices['prototype'][_0x2f5e('0x1c0')]=function(_0x1ef2bd){logger[_0x2f5e('0x31')](util['format'](_0x2f5e('0x1c1'),_0x1ef2bd[_0x2f5e('0x3d')]));_0x1ef2bd['text']=_0x1ef2bd['text'][_0x2f5e('0x18d')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x2f5e('0x88')](_0x1ef2bd['text'])){return this[_0x2f5e('0x12')]['noop']('no\x20text\x20configured');}this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x1c2'),_0x1ef2bd[_0x2f5e('0x64')]));var _0x4b709a=this[_0x2f5e('0x67')]['sync'](this,_0x1ef2bd);if(_0x4b709a){this[_0x2f5e('0x12')]['noop'](util['format'](_0x2f5e('0x1c3'),_0x4b709a));var _0x545790=this['channel'][_0x2f5e('0x129')](_0x4b709a);try{fs[_0x2f5e('0x12a')](_0x4b709a+_0x2f5e('0x103'));}catch(_0x94004f){logger['error'](_0x94004f);}return _0x545790;}return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x1ef2bd,_0x2f5e('0x1c4'));};AGIVertices['prototype'][_0x2f5e('0x1c5')]=function(_0x25efab){logger['info'](util[_0x2f5e('0x9f')](_0x2f5e('0x1c6'),_0x25efab[_0x2f5e('0x3d')]));if(!this[_0x2f5e('0x88')](_0x25efab[_0x2f5e('0x15f')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0x25efab,_0x2f5e('0x15d'));}logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x15e'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x25efab[_0x2f5e('0x15f')]));var _0x1d8809=this['agentUnpause'][_0x2f5e('0xc5')](this,_0x25efab[_0x2f5e('0x15f')]);if(_0x1d8809){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x2f5e('0x12')]['callerid'],_0x25efab[_0x2f5e('0x15f')]));this[_0x2f5e('0x12')]['noop'](util['format'](_0x2f5e('0x161'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x25efab['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x162'),this['channel']['callerid'],_0x25efab['findBy']));this[_0x2f5e('0x12')][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0x162'),this[_0x2f5e('0x12')][_0x2f5e('0x40')],_0x25efab[_0x2f5e('0x15f')]));return{'code':0xc8,'result':_0x2f5e('0x163')};}};AGIVertices[_0x2f5e('0x14')]['voicemail']=function(_0x13964d){logger[_0x2f5e('0x31')](util[_0x2f5e('0x9f')](_0x2f5e('0x1c7'),_0x13964d['label']));var _0x2b47b0=this[_0x2f5e('0x12')][_0x2f5e('0x5f')](_0x2f5e('0x1c8'),[_0x13964d[_0x2f5e('0x1c9')],_0x13964d[_0x2f5e('0x79')]]);if(_0x2b47b0[_0x2f5e('0xad')]===-0x1){return _0x2b47b0;}return this['channel'][_0x2f5e('0xaa')](util[_0x2f5e('0x9f')](_0x2f5e('0xca'),'VOICEMAIL',_0x13964d['mailbox']));};AGIVertices[_0x2f5e('0x14')]['vswitch']=function(_0xec2aa6){logger['info'](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0xec2aa6['label']));if(!this[_0x2f5e('0x88')](_0xec2aa6[_0x2f5e('0xda')])){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0xec2aa6,_0x2f5e('0x1ac'));}var _0x35319f=this['getVariable'][_0x2f5e('0xc5')](this,_0xec2aa6[_0x2f5e('0xda')]);if(!_0x35319f){return this[_0x2f5e('0x12')][_0x2f5e('0x30')](_0xec2aa6,_0x2f5e('0x11b'));}var _0x20a458=this[_0x2f5e('0x12')][_0x2f5e('0x15')](_0x35319f);return{'code':0xc8,'result':_0x20a458[_0x2f5e('0xa5')]?_0x20a458[_0x2f5e('0xa5')]:'-'};};String[_0x2f5e('0x14')][_0x2f5e('0xa4')]=function(_0x1da351,_0x26ecbd){return this[_0x2f5e('0xa3')](_0x1da351)['join'](_0x26ecbd);};module[_0x2f5e('0x1ca')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 32f8d06..f042396 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 _0xfba3=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','agents','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','updateAcw','update','uniqueid','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xfba3,0x163));var _0x3fba=function(_0x32a4a3,_0x59db5b){_0x32a4a3=_0x32a4a3-0x0;var _0xed38ac=_0xfba3[_0x32a4a3];return _0xed38ac;};'use strict';var util=require('util');var _=require(_0x3fba('0x0'));var moment=require(_0x3fba('0x1'));var ami=require(_0x3fba('0x2'));var logger=require(_0x3fba('0x3'))('acw');var RpcUser=require(_0x3fba('0x4'));var RpcVoiceAgentReport=require(_0x3fba('0x5'));function Acw(_0x221dd3){this[_0x3fba('0x6')]=_0x221dd3[_0x3fba('0x6')];this['agents']=_0x221dd3['agents'];this[_0x3fba('0x7')]=_0x221dd3[_0x3fba('0x7')];this[_0x3fba('0x8')]={};ami['on'](_0x3fba('0x9'),this[_0x3fba('0xa')]['bind'](this));ami['on'](_0x3fba('0xb'),this[_0x3fba('0xc')][_0x3fba('0xd')](this));ami['on']('hangup',this[_0x3fba('0xe')][_0x3fba('0xd')](this));ami['on'](_0x3fba('0xf'),this[_0x3fba('0x10')][_0x3fba('0xd')](this));ami['on']('attendedtransfer',this[_0x3fba('0x11')][_0x3fba('0xd')](this));ami['on'](_0x3fba('0x12'),this[_0x3fba('0x13')][_0x3fba('0xd')](this));ami['on']('custom:agentConnectPreview',this[_0x3fba('0x14')]['bind'](this));}function getDiff(_0x569a7f){var _0x398f93=moment()['milliseconds'](0x0);var _0x101b47=moment(_0x569a7f)[_0x3fba('0x15')](0x0);return _0x398f93[_0x3fba('0x16')](_0x101b47,_0x3fba('0x17'));}Acw['prototype'][_0x3fba('0x18')]=function(_0x49cd3a){try{var _0x470c41=this;var _0x3c79a5=this['channels'][_0x49cd3a][_0x3fba('0x19')];var _0x4dc5e1=this[_0x3fba('0x8')][_0x49cd3a][_0x3fba('0x1a')];var _0x457adf=this['voiceQueues'][_0x4dc5e1];var _0x835ebb=![];var _0x591b4a=_0x3fba('0x1b');if(_0x457adf[_0x3fba('0x1c')]){if(_0x457adf['mandatoryDispositionPause']['name']){_0x835ebb=!![];_0x591b4a=_0x457adf[_0x3fba('0x1d')][_0x3fba('0x1e')];}}ami[_0x3fba('0x1f')]({'action':_0x3fba('0x20'),'interface':_0x3c79a5,'paused':!![],'reason':_0x591b4a})[_0x3fba('0x21')](function(_0x822838){if(_0x470c41[_0x3fba('0x22')][_0x3c79a5]){return RpcUser['getAgent'](_0x470c41[_0x3fba('0x22')][_0x3c79a5]['id'])[_0x3fba('0x21')](function(_0x1ec4ca){if(_0x1ec4ca&&!_0x1ec4ca['voicePause']){logger[_0x3fba('0x23')](_0x3fba('0x24'),_0x49cd3a,_0x3c79a5,_0x4dc5e1);var _0x1f0319=_0x470c41[_0x3fba('0x8')][_0x49cd3a][_0x3fba('0x25')]&&_0x470c41[_0x3fba('0x8')][_0x49cd3a][_0x3fba('0x26')]?_0x470c41[_0x3fba('0x8')][_0x49cd3a][_0x3fba('0x26')]:_0x49cd3a;return RpcUser[_0x3fba('0x27')](_0x470c41[_0x3fba('0x22')][_0x3c79a5],_0x591b4a,_0x1f0319)[_0x3fba('0x21')](function(_0x3f34c3){if(!_0x835ebb){_0x470c41['timers'][_0x3c79a5]={};logger[_0x3fba('0x23')](_0x3fba('0x28'),_0x49cd3a,_0x470c41[_0x3fba('0x6')][_0x4dc5e1]['acwTimeout'],_0x3c79a5,_0x4dc5e1);_0x470c41[_0x3fba('0x7')][_0x3c79a5][_0x3fba('0x29')]=setTimeout(_0x470c41[_0x3fba('0x2a')][_0x3fba('0xd')](_0x470c41,_0x3c79a5),_0x470c41[_0x3fba('0x6')][_0x4dc5e1][_0x3fba('0x2b')]*0x3e8);_0x470c41['timers'][_0x3c79a5][_0x3fba('0x2c')]=moment()[_0x3fba('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x470c41[_0x3fba('0x7')][_0x3c79a5]['uniqueid']=_0x49cd3a;_0x470c41[_0x3fba('0x7')][_0x3c79a5]['queue']=_0x4dc5e1;_0x470c41['timers'][_0x3c79a5][_0x3fba('0x2e')]=function(){var _0x16d5f1=getDiff(_0x470c41[_0x3fba('0x7')][_0x3c79a5]['lastPauseAt']);clearTimeout(_0x470c41[_0x3fba('0x7')][_0x3c79a5][_0x3fba('0x29')]);_0x470c41['timers'][_0x3c79a5]['timer']=![];RpcVoiceAgentReport[_0x3fba('0x2f')]({'acwtime':_0x16d5f1},_0x470c41[_0x3fba('0x7')][_0x3c79a5][_0x3fba('0x30')],_0x3c79a5)[_0x3fba('0x21')](function(_0x2c9851){logger[_0x3fba('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x49cd3a,_0x16d5f1,_0x2c9851);})[_0x3fba('0x31')](function(_0x50239d){logger[_0x3fba('0x32')](_0x3fba('0x33'),_0x49cd3a,_0x50239d);});delete _0x470c41[_0x3fba('0x7')][_0x3c79a5];};}});}else{logger[_0x3fba('0x23')](_0x3fba('0x34'),_0x49cd3a,_0x3c79a5,_0x4dc5e1);}});}})[_0x3fba('0x31')](function(_0x4472b9){logger[_0x3fba('0x32')](_0x3fba('0x28'),_0x49cd3a,_0x470c41[_0x3fba('0x6')][_0x4dc5e1][_0x3fba('0x2b')],_0x3c79a5,_0x4dc5e1);})[_0x3fba('0x35')](function(){delete _0x470c41['channels'][_0x49cd3a];});}catch(_0x112d86){logger[_0x3fba('0x32')](_0x3fba('0x36'),_0x112d86[_0x3fba('0x37')]);}};Acw[_0x3fba('0x38')][_0x3fba('0x2a')]=function(_0x24ab97){try{var _0x5f4cee=this;if(_0x5f4cee['timers'][_0x24ab97]){_0x5f4cee[_0x3fba('0x7')][_0x24ab97]['timer']=![];var _0x29c15a=_0x5f4cee['timers'][_0x24ab97][_0x3fba('0x30')];var _0x3719d9=_0x5f4cee[_0x3fba('0x7')][_0x24ab97]['queue'];var _0x210fe8=_0x5f4cee['voiceQueues'][_0x3719d9][_0x3fba('0x2b')];logger[_0x3fba('0x23')](_0x3fba('0x39'),_0x29c15a,_0x24ab97);RpcUser[_0x3fba('0x3a')](this[_0x3fba('0x22')][_0x24ab97]);RpcVoiceAgentReport[_0x3fba('0x2f')]({'acwtime':_0x210fe8,'agentacw':!![]},_0x29c15a,_0x24ab97)[_0x3fba('0x21')](function(_0x36779a){logger[_0x3fba('0x23')](_0x3fba('0x3b'),_0x29c15a,_0x210fe8,_0x36779a);})[_0x3fba('0x31')](function(_0x767fef){logger[_0x3fba('0x32')](_0x3fba('0x33'),_0x29c15a,_0x767fef);});}else{logger['error'](_0x3fba('0x3c'),_0x24ab97);if(_0x5f4cee[_0x3fba('0x7')]){logger['info']('[ACW][TIMERS]',JSON[_0x3fba('0x3d')](_0x5f4cee[_0x3fba('0x7')]));}}}catch(_0x2b0d1d){logger['error'](_0x3fba('0x3e'),_0x2b0d1d['message']);}};Acw[_0x3fba('0x38')]['syncAgentConnect']=function(_0x282348){try{if(this[_0x3fba('0x6')][_0x282348[_0x3fba('0x1a')]]&&(this['voiceQueues'][_0x282348[_0x3fba('0x1a')]][_0x3fba('0x3f')]||this['voiceQueues'][_0x282348[_0x3fba('0x1a')]][_0x3fba('0x1c')])){if(this['agents'][_0x282348[_0x3fba('0x19')]]){this['channels'][_0x282348[_0x3fba('0x30')]]={'queue':_0x282348[_0x3fba('0x1a')],'interface':_0x282348[_0x3fba('0x19')],'destlinkedid':_0x282348[_0x3fba('0x26')]};}}}catch(_0x3dd5a2){logger[_0x3fba('0x32')](_0x3fba('0x40'),_0x3dd5a2['message']);}};Acw[_0x3fba('0x38')][_0x3fba('0x14')]=function(_0x9b5bcd){try{if(this[_0x3fba('0x6')][_0x9b5bcd[_0x3fba('0x1a')]]&&(this[_0x3fba('0x6')][_0x9b5bcd[_0x3fba('0x1a')]][_0x3fba('0x3f')]||this[_0x3fba('0x6')][_0x9b5bcd[_0x3fba('0x1a')]][_0x3fba('0x1c')])){if(this[_0x3fba('0x22')][_0x9b5bcd['interface']]){this[_0x3fba('0x8')][_0x9b5bcd[_0x3fba('0x30')]]={'queue':_0x9b5bcd[_0x3fba('0x1a')],'interface':_0x9b5bcd[_0x3fba('0x19')]};}}}catch(_0x3f0801){logger[_0x3fba('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x3f0801[_0x3fba('0x37')]);}};Acw[_0x3fba('0x38')]['syncHangupRequest']=function(_0x16f399){try{if(this['channels'][_0x16f399[_0x3fba('0x30')]]&&_[_0x3fba('0x41')](this[_0x3fba('0x8')][_0x16f399[_0x3fba('0x30')]]['attended'])){logger[_0x3fba('0x23')](_0x3fba('0x42'),_0x16f399[_0x3fba('0x30')]);this[_0x3fba('0x18')](_0x16f399[_0x3fba('0x30')]);}else if(this['channels'][_0x16f399[_0x3fba('0x43')]]&&_[_0x3fba('0x41')](this['channels'][_0x16f399[_0x3fba('0x43')]]['attended'])){logger[_0x3fba('0x23')]('[%s][HANGUP:LINKEDID]',_0x16f399[_0x3fba('0x43')]);this[_0x3fba('0x18')](_0x16f399[_0x3fba('0x43')]);}}catch(_0x2f3df4){logger[_0x3fba('0x32')](_0x3fba('0x44'),_0x2f3df4['message']);}};Acw['prototype'][_0x3fba('0xe')]=function(_0x135118){try{if(this['channels'][_0x135118[_0x3fba('0x30')]]&&this[_0x3fba('0x8')][_0x135118[_0x3fba('0x30')]][_0x3fba('0x25')]){logger[_0x3fba('0x23')](_0x3fba('0x45'),_0x135118[_0x3fba('0x30')]);this[_0x3fba('0x18')](_0x135118[_0x3fba('0x30')]);}else if(this[_0x3fba('0x8')][_0x135118[_0x3fba('0x43')]]&&this['channels'][_0x135118['linkedid']][_0x3fba('0x25')]){logger[_0x3fba('0x23')](_0x3fba('0x46'),_0x135118[_0x3fba('0x43')]);this[_0x3fba('0x18')](_0x135118['linkedid']);}}catch(_0x4bffa){logger[_0x3fba('0x32')](_0x3fba('0x47'),_0x4bffa[_0x3fba('0x37')]);}};Acw[_0x3fba('0x38')][_0x3fba('0x11')]=function(_0x269e03){try{if(!_[_0x3fba('0x48')](this[_0x3fba('0x8')][_0x269e03['transfereeuniqueid']])){this['startAcw'](_0x269e03[_0x3fba('0x49')]);if(this[_0x3fba('0x8')][_0x269e03['secondtransfereruniqueid']]){this[_0x3fba('0x8')][_0x269e03[_0x3fba('0x4a')]][_0x3fba('0x25')]=!![];this[_0x3fba('0x8')][_0x269e03['transfertargetuniqueid']]=this['channels'][_0x269e03[_0x3fba('0x4a')]];delete this[_0x3fba('0x8')][_0x269e03[_0x3fba('0x4a')]];}}else if(!_[_0x3fba('0x48')](this['channels'][_0x269e03[_0x3fba('0x4b')]])){this[_0x3fba('0x18')](_0x269e03[_0x3fba('0x4b')]);if(this[_0x3fba('0x8')][_0x269e03[_0x3fba('0x4c')]]){this[_0x3fba('0x8')][_0x269e03['origtransfereruniqueid']][_0x3fba('0x25')]=!![];this[_0x3fba('0x8')][_0x269e03[_0x3fba('0x49')]]=this[_0x3fba('0x8')][_0x269e03['origtransfereruniqueid']];delete this[_0x3fba('0x8')][_0x269e03['origtransfereruniqueid']];}}}catch(_0x410429){logger[_0x3fba('0x32')](_0x3fba('0x4d'),_0x410429[_0x3fba('0x37')]);}};Acw['prototype'][_0x3fba('0x13')]=function(_0x8f16b3){try{if(this['channels'][_0x8f16b3[_0x3fba('0x4e')]]){logger['info'](_0x3fba('0x4f'),JSON[_0x3fba('0x3d')](_0x8f16b3[_0x3fba('0x4e')]));this[_0x3fba('0x18')](_0x8f16b3['transfereruniqueid']);}else if(this[_0x3fba('0x8')][_0x8f16b3[_0x3fba('0x50')]]){logger[_0x3fba('0x23')](_0x3fba('0x51'),JSON[_0x3fba('0x3d')](_0x8f16b3[_0x3fba('0x50')]));this[_0x3fba('0x18')](_0x8f16b3[_0x3fba('0x50')]);}}catch(_0x9564fd){logger['error'](_0x3fba('0x52'),_0x9564fd['message']);}};Acw[_0x3fba('0x38')]['syncAgentRingNoAnswer']=function(_0x4f3ec3){try{if(this[_0x3fba('0x6')][_0x4f3ec3[_0x3fba('0x1a')]]&&this[_0x3fba('0x6')][_0x4f3ec3['queue']]['autopause']===_0x3fba('0x53')){if(this[_0x3fba('0x22')][_0x4f3ec3[_0x3fba('0x19')]]){logger[_0x3fba('0x23')](_0x3fba('0x54'),_0x4f3ec3[_0x3fba('0x30')],_0x4f3ec3['interface'],_0x4f3ec3[_0x3fba('0x1a')]);return RpcUser[_0x3fba('0x27')](this['agents'][_0x4f3ec3[_0x3fba('0x19')]],'Auto-Pause',_0x4f3ec3[_0x3fba('0x30')]);}}}catch(_0x4ca7a6){logger[_0x3fba('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4ca7a6['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x7e6a=['voiceQueues','agents','timers','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport'];(function(_0x21fc8c,_0x2fa551){var _0x3712b1=function(_0x2fb8ac){while(--_0x2fb8ac){_0x21fc8c['push'](_0x21fc8c['shift']());}};_0x3712b1(++_0x2fa551);}(_0x7e6a,0xf2));var _0xa7e6=function(_0x145d19,_0x76779e){_0x145d19=_0x145d19-0x0;var _0x5237a7=_0x7e6a[_0x145d19];return _0x5237a7;};'use strict';var util=require(_0xa7e6('0x0'));var _=require(_0xa7e6('0x1'));var moment=require(_0xa7e6('0x2'));var ami=require(_0xa7e6('0x3'));var logger=require(_0xa7e6('0x4'))(_0xa7e6('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xa7e6('0x6'));function Acw(_0x330d9e){this[_0xa7e6('0x7')]=_0x330d9e[_0xa7e6('0x7')];this[_0xa7e6('0x8')]=_0x330d9e[_0xa7e6('0x8')];this['timers']=_0x330d9e[_0xa7e6('0x9')];this['channels']={};ami['on']('agentconnect',this[_0xa7e6('0xa')][_0xa7e6('0xb')](this));ami['on']('hanguprequest',this[_0xa7e6('0xc')][_0xa7e6('0xb')](this));ami['on'](_0xa7e6('0xd'),this[_0xa7e6('0xe')][_0xa7e6('0xb')](this));ami['on'](_0xa7e6('0xf'),this[_0xa7e6('0x10')][_0xa7e6('0xb')](this));ami['on']('attendedtransfer',this[_0xa7e6('0x11')][_0xa7e6('0xb')](this));ami['on'](_0xa7e6('0x12'),this[_0xa7e6('0x13')][_0xa7e6('0xb')](this));ami['on'](_0xa7e6('0x14'),this[_0xa7e6('0x15')][_0xa7e6('0xb')](this));}function getDiff(_0x463b4f){var _0x4962f0=moment()[_0xa7e6('0x16')](0x0);var _0xef2678=moment(_0x463b4f)[_0xa7e6('0x16')](0x0);return _0x4962f0['diff'](_0xef2678,_0xa7e6('0x17'));}Acw[_0xa7e6('0x18')]['startAcw']=function(_0x4c3f75){try{var _0x41abe9=this;var _0x35b5b3=this[_0xa7e6('0x19')][_0x4c3f75][_0xa7e6('0x1a')];var _0x48adc9=this[_0xa7e6('0x19')][_0x4c3f75][_0xa7e6('0x1b')];var _0xc5f4a7=this['voiceQueues'][_0x48adc9];var _0x2d9219=![];var _0x166396=_0xa7e6('0x1c');if(_0xc5f4a7[_0xa7e6('0x1d')]){if(_0xc5f4a7[_0xa7e6('0x1e')][_0xa7e6('0x1f')]){_0x2d9219=!![];_0x166396=_0xc5f4a7['mandatoryDispositionPause'][_0xa7e6('0x1f')];}}ami[_0xa7e6('0x20')]({'action':'QueuePause','interface':_0x35b5b3,'paused':!![],'reason':_0x166396})[_0xa7e6('0x21')](function(_0x2041fd){if(_0x41abe9['agents'][_0x35b5b3]){return RpcUser[_0xa7e6('0x22')](_0x41abe9[_0xa7e6('0x8')][_0x35b5b3]['id'])[_0xa7e6('0x21')](function(_0x1e27f4){if(_0x1e27f4&&!_0x1e27f4[_0xa7e6('0x23')]){logger[_0xa7e6('0x24')](_0xa7e6('0x25'),_0x4c3f75,_0x35b5b3,_0x48adc9);var _0x59ef05=_0x41abe9[_0xa7e6('0x19')][_0x4c3f75][_0xa7e6('0x26')]&&_0x41abe9[_0xa7e6('0x19')][_0x4c3f75][_0xa7e6('0x27')]?_0x41abe9[_0xa7e6('0x19')][_0x4c3f75][_0xa7e6('0x27')]:_0x4c3f75;return RpcUser[_0xa7e6('0x28')](_0x41abe9[_0xa7e6('0x8')][_0x35b5b3],_0x166396,_0x59ef05)[_0xa7e6('0x21')](function(_0x2d5601){if(!_0x2d9219){_0x41abe9['timers'][_0x35b5b3]={};logger[_0xa7e6('0x24')](_0xa7e6('0x29'),_0x4c3f75,_0x41abe9[_0xa7e6('0x7')][_0x48adc9][_0xa7e6('0x2a')],_0x35b5b3,_0x48adc9);_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x2b')]=setTimeout(_0x41abe9[_0xa7e6('0x2c')][_0xa7e6('0xb')](_0x41abe9,_0x35b5b3),_0x41abe9[_0xa7e6('0x7')][_0x48adc9][_0xa7e6('0x2a')]*0x3e8);_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x2d')]=moment()[_0xa7e6('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x41abe9[_0xa7e6('0x9')][_0x35b5b3]['uniqueid']=_0x4c3f75;_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x1b')]=_0x48adc9;_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x2f')]=function(){var _0xc42af2=getDiff(_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x2d')]);clearTimeout(_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x2b')]);_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x2b')]=![];RpcVoiceAgentReport[_0xa7e6('0x30')]({'acwtime':_0xc42af2},_0x41abe9[_0xa7e6('0x9')][_0x35b5b3][_0xa7e6('0x31')],_0x35b5b3)[_0xa7e6('0x21')](function(_0x1e4564){logger[_0xa7e6('0x24')](_0xa7e6('0x32'),_0x4c3f75,_0xc42af2,_0x1e4564);})[_0xa7e6('0x33')](function(_0x2f98ad){logger[_0xa7e6('0x34')](_0xa7e6('0x35'),_0x4c3f75,_0x2f98ad);});delete _0x41abe9[_0xa7e6('0x9')][_0x35b5b3];};}});}else{logger[_0xa7e6('0x24')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x4c3f75,_0x35b5b3,_0x48adc9);}});}})[_0xa7e6('0x33')](function(_0x213b56){logger['error'](_0xa7e6('0x29'),_0x4c3f75,_0x41abe9['voiceQueues'][_0x48adc9]['acwTimeout'],_0x35b5b3,_0x48adc9);})['finally'](function(){delete _0x41abe9[_0xa7e6('0x19')][_0x4c3f75];});}catch(_0xa34196){logger[_0xa7e6('0x34')](_0xa7e6('0x36'),_0xa34196[_0xa7e6('0x37')]);}};Acw['prototype'][_0xa7e6('0x2c')]=function(_0x266168){try{var _0x43b081=this;if(_0x43b081[_0xa7e6('0x9')][_0x266168]){_0x43b081[_0xa7e6('0x9')][_0x266168]['timer']=![];var _0xb1d0a=_0x43b081[_0xa7e6('0x9')][_0x266168][_0xa7e6('0x31')];var _0x515513=_0x43b081[_0xa7e6('0x9')][_0x266168][_0xa7e6('0x1b')];var _0x284771=_0x43b081[_0xa7e6('0x7')][_0x515513]['acwTimeout'];logger[_0xa7e6('0x24')](_0xa7e6('0x38'),_0xb1d0a,_0x266168);RpcUser['saveUnpause'](this[_0xa7e6('0x8')][_0x266168]);RpcVoiceAgentReport[_0xa7e6('0x30')]({'acwtime':_0x284771,'agentacw':!![]},_0xb1d0a,_0x266168)['then'](function(_0x4e8074){logger[_0xa7e6('0x24')](_0xa7e6('0x32'),_0xb1d0a,_0x284771,_0x4e8074);})[_0xa7e6('0x33')](function(_0x4d6cd4){logger[_0xa7e6('0x34')](_0xa7e6('0x35'),_0xb1d0a,_0x4d6cd4);});}else{logger[_0xa7e6('0x34')](_0xa7e6('0x39'),_0x266168);if(_0x43b081['timers']){logger[_0xa7e6('0x24')]('[ACW][TIMERS]',JSON['stringify'](_0x43b081[_0xa7e6('0x9')]));}}}catch(_0x424146){logger[_0xa7e6('0x34')](_0xa7e6('0x3a'),_0x424146[_0xa7e6('0x37')]);}};Acw['prototype'][_0xa7e6('0xa')]=function(_0xc971ad){try{if(this['voiceQueues'][_0xc971ad['queue']]&&(this[_0xa7e6('0x7')][_0xc971ad['queue']][_0xa7e6('0x5')]||this[_0xa7e6('0x7')][_0xc971ad['queue']]['mandatoryDisposition'])){if(this[_0xa7e6('0x8')][_0xc971ad[_0xa7e6('0x1a')]]){this[_0xa7e6('0x19')][_0xc971ad[_0xa7e6('0x31')]]={'queue':_0xc971ad[_0xa7e6('0x1b')],'interface':_0xc971ad[_0xa7e6('0x1a')],'destlinkedid':_0xc971ad['destlinkedid']};}}}catch(_0xde4b67){logger[_0xa7e6('0x34')]('[ACW][syncAgentConnect]\x20%s',_0xde4b67[_0xa7e6('0x37')]);}};Acw[_0xa7e6('0x18')][_0xa7e6('0x15')]=function(_0x238f57){try{if(this[_0xa7e6('0x7')][_0x238f57[_0xa7e6('0x1b')]]&&(this[_0xa7e6('0x7')][_0x238f57[_0xa7e6('0x1b')]][_0xa7e6('0x5')]||this[_0xa7e6('0x7')][_0x238f57['queue']][_0xa7e6('0x1d')])){if(this[_0xa7e6('0x8')][_0x238f57['interface']]){this[_0xa7e6('0x19')][_0x238f57['uniqueid']]={'queue':_0x238f57[_0xa7e6('0x1b')],'interface':_0x238f57['interface']};}}}catch(_0x5b5d37){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x5b5d37[_0xa7e6('0x37')]);}};Acw[_0xa7e6('0x18')][_0xa7e6('0xc')]=function(_0xa7c716){try{if(this[_0xa7e6('0x19')][_0xa7c716[_0xa7e6('0x31')]]&&_[_0xa7e6('0x3b')](this[_0xa7e6('0x19')][_0xa7c716['uniqueid']][_0xa7e6('0x26')])){logger[_0xa7e6('0x24')](_0xa7e6('0x3c'),_0xa7c716[_0xa7e6('0x31')]);this[_0xa7e6('0x3d')](_0xa7c716[_0xa7e6('0x31')]);}else if(this[_0xa7e6('0x19')][_0xa7c716[_0xa7e6('0x3e')]]&&_[_0xa7e6('0x3b')](this['channels'][_0xa7c716[_0xa7e6('0x3e')]]['attended'])){logger[_0xa7e6('0x24')](_0xa7e6('0x3f'),_0xa7c716[_0xa7e6('0x3e')]);this[_0xa7e6('0x3d')](_0xa7c716[_0xa7e6('0x3e')]);}}catch(_0x4fc38b){logger[_0xa7e6('0x34')](_0xa7e6('0x40'),_0x4fc38b[_0xa7e6('0x37')]);}};Acw[_0xa7e6('0x18')][_0xa7e6('0xe')]=function(_0x538f63){try{if(this[_0xa7e6('0x19')][_0x538f63['uniqueid']]&&this[_0xa7e6('0x19')][_0x538f63[_0xa7e6('0x31')]][_0xa7e6('0x26')]){logger[_0xa7e6('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x538f63[_0xa7e6('0x31')]);this[_0xa7e6('0x3d')](_0x538f63[_0xa7e6('0x31')]);}else if(this[_0xa7e6('0x19')][_0x538f63[_0xa7e6('0x3e')]]&&this[_0xa7e6('0x19')][_0x538f63[_0xa7e6('0x3e')]]['attended']){logger[_0xa7e6('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x538f63[_0xa7e6('0x3e')]);this[_0xa7e6('0x3d')](_0x538f63[_0xa7e6('0x3e')]);}}catch(_0x9b4e80){logger['error'](_0xa7e6('0x41'),_0x9b4e80[_0xa7e6('0x37')]);}};Acw['prototype'][_0xa7e6('0x11')]=function(_0x3e31b5){try{if(!_[_0xa7e6('0x42')](this['channels'][_0x3e31b5[_0xa7e6('0x43')]])){this[_0xa7e6('0x3d')](_0x3e31b5[_0xa7e6('0x43')]);if(this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x44')]]){this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x44')]]['attended']=!![];this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x45')]]=this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x44')]];delete this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x44')]];}}else if(!_[_0xa7e6('0x42')](this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x45')]])){this[_0xa7e6('0x3d')](_0x3e31b5['transfertargetuniqueid']);if(this['channels'][_0x3e31b5[_0xa7e6('0x46')]]){this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x46')]][_0xa7e6('0x26')]=!![];this['channels'][_0x3e31b5['transfereeuniqueid']]=this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x46')]];delete this[_0xa7e6('0x19')][_0x3e31b5[_0xa7e6('0x46')]];}}}catch(_0x37f875){logger[_0xa7e6('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x37f875[_0xa7e6('0x37')]);}};Acw[_0xa7e6('0x18')][_0xa7e6('0x13')]=function(_0x42981d){try{if(this['channels'][_0x42981d[_0xa7e6('0x47')]]){logger['info'](_0xa7e6('0x48'),JSON[_0xa7e6('0x49')](_0x42981d['transfereruniqueid']));this[_0xa7e6('0x3d')](_0x42981d[_0xa7e6('0x47')]);}else if(this[_0xa7e6('0x19')][_0x42981d[_0xa7e6('0x4a')]]){logger[_0xa7e6('0x24')](_0xa7e6('0x4b'),JSON[_0xa7e6('0x49')](_0x42981d[_0xa7e6('0x4a')]));this[_0xa7e6('0x3d')](_0x42981d[_0xa7e6('0x4a')]);}}catch(_0x67899b){logger[_0xa7e6('0x34')](_0xa7e6('0x4c'),_0x67899b[_0xa7e6('0x37')]);}};Acw[_0xa7e6('0x18')][_0xa7e6('0x10')]=function(_0x2b4215){try{if(this[_0xa7e6('0x7')][_0x2b4215[_0xa7e6('0x1b')]]&&this[_0xa7e6('0x7')][_0x2b4215[_0xa7e6('0x1b')]][_0xa7e6('0x4d')]===_0xa7e6('0x4e')){if(this[_0xa7e6('0x8')][_0x2b4215[_0xa7e6('0x1a')]]){logger[_0xa7e6('0x24')](_0xa7e6('0x4f'),_0x2b4215[_0xa7e6('0x31')],_0x2b4215[_0xa7e6('0x1a')],_0x2b4215[_0xa7e6('0x1b')]);return RpcUser[_0xa7e6('0x28')](this[_0xa7e6('0x8')][_0x2b4215[_0xa7e6('0x1a')]],_0xa7e6('0x50'),_0x2b4215[_0xa7e6('0x31')]);}}}catch(_0x9f0890){logger[_0xa7e6('0x34')](_0xa7e6('0x51'),_0x9f0890['message']);}};module[_0xa7e6('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 9fc4023..f5badf0 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 _0x27e8=['moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','connect','shutdown','info','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','close','exports','asterisk-manager','bluebird'];(function(_0x49f9ad,_0x2c0fb5){var _0x54ac27=function(_0x4a864e){while(--_0x4a864e){_0x49f9ad['push'](_0x49f9ad['shift']());}};_0x54ac27(++_0x2c0fb5);}(_0x27e8,0x1de));var _0x827e=function(_0x2c612a,_0x3175a7){_0x2c612a=_0x2c612a-0x0;var _0x34d956=_0x27e8[_0x2c612a];return _0x34d956;};'use strict';var Manager=require(_0x827e('0x0'));var BPromise=require(_0x827e('0x1'));var moment=require(_0x827e('0x2'));var util=require(_0x827e('0x3'));var _=require(_0x827e('0x4'));var logger=require(_0x827e('0x5'))(_0x827e('0x6'));var config=require('../../config/environment');var ami=new Manager(config[_0x827e('0x7')][_0x827e('0x8')],config['asterisk']['ip'],config[_0x827e('0x7')][_0x827e('0x9')],config[_0x827e('0x7')][_0x827e('0xa')],!![]);ami[_0x827e('0xb')]();ami[_0x827e('0xc')]=BPromise[_0x827e('0xd')](ami[_0x827e('0xe')]);function error(_0x8ef85b){logger[_0x827e('0xf')](util[_0x827e('0x10')](_0x827e('0x11'),config['asterisk'][_0x827e('0x9')],config[_0x827e('0x7')]['ip'],config[_0x827e('0x7')][_0x827e('0x8')],util['inspect'](_0x8ef85b,![],null)));}function close(){logger[_0x827e('0xf')](util[_0x827e('0x10')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x827e('0x7')][_0x827e('0x9')],config[_0x827e('0x7')]['ip'],config['asterisk'][_0x827e('0x8')]));}ami[_0x827e('0x12')]=function(){return function(){return ami[_0x827e('0xc')]({'action':_0x827e('0x13')});};};ami[_0x827e('0x14')]=function(){return function(){return ami[_0x827e('0xc')]({'action':_0x827e('0x15')});};};ami[_0x827e('0x16')]=function(){return function(){return ami['Action']({'action':_0x827e('0x17')});};};ami[_0x827e('0x18')]=function(){return function(){return ami[_0x827e('0xc')]({'action':_0x827e('0x19')});};};ami[_0x827e('0x1a')]=function(){return function(){return ami[_0x827e('0xc')]({'action':_0x827e('0x1b')});};};function connect(_0x1faa3b){logger['info'](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0x827e('0x9')],config[_0x827e('0x7')]['ip'],config[_0x827e('0x7')][_0x827e('0x8')]));ami[_0x827e('0x1c')](_0x827e('0xf'),error);ami[_0x827e('0x1c')]('close',close);}ami['on'](_0x827e('0x1d'),connect);ami['on'](_0x827e('0x1e'),function(_0x3f7373){logger[_0x827e('0x1f')](util[_0x827e('0x10')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x827e('0x7')][_0x827e('0x9')],config[_0x827e('0x7')]['ip'],config['asterisk']['port'],util[_0x827e('0x20')](_0x3f7373,![],null)));});ami['on'](_0x827e('0x21'),function(_0x569dfd){logger[_0x827e('0x1f')](util[_0x827e('0x10')](_0x827e('0x22'),config[_0x827e('0x7')][_0x827e('0x9')],config[_0x827e('0x7')]['ip'],config[_0x827e('0x7')][_0x827e('0x8')]));return BPromise[_0x827e('0x23')]()[_0x827e('0x24')](ami[_0x827e('0x12')]())[_0x827e('0x24')](ami['actionDeviceStateList']())['then'](ami[_0x827e('0x16')]())['then'](ami[_0x827e('0x18')]())[_0x827e('0x24')](ami[_0x827e('0x1a')]())[_0x827e('0x25')](function(_0x115f30){console['log'](_0x115f30);});});ami[_0x827e('0x1c')](_0x827e('0xf'),error);ami[_0x827e('0x1c')](_0x827e('0x26'),close);module[_0x827e('0x27')]=ami; \ No newline at end of file +var _0x2a4a=['shutdown','inspect','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','actionCoreShowChannels','catch','log','exports','asterisk-manager','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','error','format','port','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect'];(function(_0x15e024,_0x552471){var _0x5747d5=function(_0x596a5d){while(--_0x596a5d){_0x15e024['push'](_0x15e024['shift']());}};_0x5747d5(++_0x552471);}(_0x2a4a,0x12a));var _0xa2a4=function(_0x1b6a4a,_0x5c9a93){_0x1b6a4a=_0x1b6a4a-0x0;var _0x7ee133=_0x2a4a[_0x1b6a4a];return _0x7ee133;};'use strict';var Manager=require(_0xa2a4('0x0'));var BPromise=require('bluebird');var moment=require(_0xa2a4('0x1'));var util=require(_0xa2a4('0x2'));var _=require(_0xa2a4('0x3'));var logger=require(_0xa2a4('0x4'))(_0xa2a4('0x5'));var config=require(_0xa2a4('0x6'));var ami=new Manager(config[_0xa2a4('0x7')]['port'],config[_0xa2a4('0x7')]['ip'],config['asterisk'][_0xa2a4('0x8')],config['asterisk'][_0xa2a4('0x9')],!![]);ami[_0xa2a4('0xa')]();ami[_0xa2a4('0xb')]=BPromise['promisify'](ami['action']);function error(_0x1fb832){logger[_0xa2a4('0xc')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa2a4('0x7')][_0xa2a4('0x8')],config[_0xa2a4('0x7')]['ip'],config[_0xa2a4('0x7')]['port'],util['inspect'](_0x1fb832,![],null)));}function close(){logger['error'](util[_0xa2a4('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0xa2a4('0x8')],config[_0xa2a4('0x7')]['ip'],config[_0xa2a4('0x7')][_0xa2a4('0xe')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xa2a4('0xf')});};};ami[_0xa2a4('0x10')]=function(){return function(){return ami[_0xa2a4('0xb')]({'action':_0xa2a4('0x11')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xa2a4('0xb')]({'action':_0xa2a4('0x12')});};};ami[_0xa2a4('0x13')]=function(){return function(){return ami[_0xa2a4('0xb')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xa2a4('0xb')]({'action':_0xa2a4('0x14')});};};function connect(_0x292ae1){logger[_0xa2a4('0x15')](util[_0xa2a4('0xd')](_0xa2a4('0x16'),config[_0xa2a4('0x7')][_0xa2a4('0x8')],config['asterisk']['ip'],config['asterisk'][_0xa2a4('0xe')]));ami[_0xa2a4('0x17')]('error',error);ami[_0xa2a4('0x17')](_0xa2a4('0x18'),close);}ami['on'](_0xa2a4('0x19'),connect);ami['on'](_0xa2a4('0x1a'),function(_0x1bde09){logger[_0xa2a4('0x15')](util[_0xa2a4('0xd')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa2a4('0x7')][_0xa2a4('0x8')],config[_0xa2a4('0x7')]['ip'],config[_0xa2a4('0x7')][_0xa2a4('0xe')],util[_0xa2a4('0x1b')](_0x1bde09,![],null)));});ami['on']('fullybooted',function(_0x5413af){logger[_0xa2a4('0x15')](util[_0xa2a4('0xd')](_0xa2a4('0x1c'),config[_0xa2a4('0x7')][_0xa2a4('0x8')],config[_0xa2a4('0x7')]['ip'],config[_0xa2a4('0x7')][_0xa2a4('0xe')]));return BPromise[_0xa2a4('0x1d')]()[_0xa2a4('0x1e')](ami['actionSipShowRegistry']())['then'](ami[_0xa2a4('0x10')]())['then'](ami[_0xa2a4('0x1f')]())[_0xa2a4('0x1e')](ami['actionQueueSummary']())[_0xa2a4('0x1e')](ami[_0xa2a4('0x20')]())[_0xa2a4('0x21')](function(_0x209d93){console[_0xa2a4('0x22')](_0x209d93);});});ami[_0xa2a4('0x17')](_0xa2a4('0xc'),error);ami[_0xa2a4('0x17')]('close',close);module[_0xa2a4('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index bc2a546..389831b 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x3d3379,_0x4c9bc1){var _0x358633=function(_0x54510c){while(--_0x54510c){_0x3d3379['push'](_0x3d3379['shift']());}};_0x358633(++_0x4c9bc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xe706,0xa3));var _0x6e70=function(_0x363a2b,_0x2c51a2){_0x363a2b=_0x363a2b-0x0;var _0x2c720e=_0xe706[_0x363a2b];return _0x2c720e;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 1f21bbb..784b3c1 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 _0xc0fe=['VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','number','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','firstName','Contact','lastName','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ListId','UserId'];(function(_0x47f175,_0xcc4df2){var _0xac8d5e=function(_0x4dd452){while(--_0x4dd452){_0x47f175['push'](_0x47f175['shift']());}};_0xac8d5e(++_0xcc4df2);}(_0xc0fe,0x122));var _0xec0f=function(_0x2fd6ff,_0x421073){_0x2fd6ff=_0x2fd6ff-0x0;var _0x317f60=_0xc0fe[_0x2fd6ff];return _0x317f60;};'use strict';var util=require(_0xec0f('0x0'));var _=require(_0xec0f('0x1'));var moment=require(_0xec0f('0x2'));function checkNameSurname(_0x4cc111,_0x242409,_0x25046a){var _0x25d42e='';if(!_[_0xec0f('0x3')](_0x242409)&&'string'===typeof _0x242409){_0x25d42e+=_0x242409;}if(!_[_0xec0f('0x3')](_0x25046a)&&_0xec0f('0x4')===typeof _0x25046a){_0x25d42e+='\x20'+_0x25046a;}if(_0x25d42e!==''){return _0x25d42e;}return _0x4cc111;}function Action(_0x1722da,_0x59cc50,_0x3916f6){this[_0xec0f('0x5')]=_0x1722da;this['uniqueid']=_0x3916f6||undefined;this['name']=checkNameSurname(_0x59cc50['Contact']['phone'],_0x59cc50['Contact'][_0xec0f('0x6')],_0x59cc50[_0xec0f('0x7')][_0xec0f('0x8')]);this['number']=_0x59cc50['Contact'][_0xec0f('0x9')];this[_0xec0f('0xa')]=_0x1722da[_0xec0f('0xb')];this[_0xec0f('0xc')]=_0x59cc50[_0xec0f('0xc')]||![];this['type']=_0x1722da[_0xec0f('0xd')];this[_0xec0f('0xe')]=_0x1722da[_0xec0f('0xe')]||0x3;this[_0xec0f('0xf')]=_0x59cc50['scheduledat'];this[_0xec0f('0x10')]=_0x59cc50[_0xec0f('0x10')];this[_0xec0f('0x11')]=_0x59cc50['countcongestionretry'];this[_0xec0f('0x12')]=_0x59cc50[_0xec0f('0x12')];this['countnosuchnumberretry']=_0x59cc50['countnosuchnumberretry'];this[_0xec0f('0x13')]=_0x59cc50[_0xec0f('0x13')];this[_0xec0f('0x14')]=_0x59cc50[_0xec0f('0x14')];this[_0xec0f('0x15')]=_0x59cc50[_0xec0f('0x15')];this[_0xec0f('0x16')]=_0x59cc50['countagentrejectretry'];this['ContactId']=_0x59cc50['ContactId'];this['ListId']=_0x59cc50[_0xec0f('0x17')];this[_0xec0f('0x18')]=_0x59cc50[_0xec0f('0x18')];this[_0xec0f('0x19')]=_0x59cc50[_0xec0f('0x19')];this[_0xec0f('0x1a')]=_0x59cc50['CampaignId'];this['idHopper']=_0x59cc50['id'];this[_0xec0f('0x1b')]=_0x59cc50[_0xec0f('0x7')]['firstName']||'';this[_0xec0f('0x1c')]=moment()[_0xec0f('0x1d')](_0xec0f('0x1e'));this[_0xec0f('0x1f')]=_0x59cc50[_0xec0f('0x1f')];this[_0xec0f('0x20')]=_0x59cc50[_0xec0f('0x20')];this[_0xec0f('0x21')]=_0x59cc50[_0xec0f('0x21')];this[_0xec0f('0x22')]=_0x59cc50[_0xec0f('0x22')];this[_0xec0f('0x23')]='';this[_0xec0f('0x24')]='';}Action[_0xec0f('0x25')][_0xec0f('0x26')]=function(){return util[_0xec0f('0x1d')](_0xec0f('0x27'),this[_0xec0f('0xb')],this[_0xec0f('0x5')][_0xec0f('0x28')]>0x0?this['number'][_0xec0f('0x29')](this[_0xec0f('0x5')][_0xec0f('0x28')]):this[_0xec0f('0x2a')]);};Action['prototype'][_0xec0f('0x2b')]=function(){return this[_0xec0f('0xa')];};module[_0xec0f('0x2c')]=Action; \ No newline at end of file +var _0x567c=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry'];(function(_0x56fe76,_0x52d85a){var _0x6e9637=function(_0x1774db){while(--_0x1774db){_0x56fe76['push'](_0x56fe76['shift']());}};_0x6e9637(++_0x52d85a);}(_0x567c,0xa6));var _0xc567=function(_0x1dbfd5,_0x1615e6){_0x1dbfd5=_0x1dbfd5-0x0;var _0x2ed462=_0x567c[_0x1dbfd5];return _0x2ed462;};'use strict';var util=require(_0xc567('0x0'));var _=require(_0xc567('0x1'));var moment=require(_0xc567('0x2'));function checkNameSurname(_0x4ab391,_0x1ef70b,_0x15623d){var _0x12ccad='';if(!_[_0xc567('0x3')](_0x1ef70b)&&_0xc567('0x4')===typeof _0x1ef70b){_0x12ccad+=_0x1ef70b;}if(!_[_0xc567('0x3')](_0x15623d)&&'string'===typeof _0x15623d){_0x12ccad+='\x20'+_0x15623d;}if(_0x12ccad!==''){return _0x12ccad;}return _0x4ab391;}function Action(_0x5691a6,_0x3950d5,_0x41aa49){this[_0xc567('0x5')]=_0x5691a6;this[_0xc567('0x6')]=_0x41aa49||undefined;this['name']=checkNameSurname(_0x3950d5[_0xc567('0x7')][_0xc567('0x8')],_0x3950d5[_0xc567('0x7')]['firstName'],_0x3950d5['Contact'][_0xc567('0x9')]);this[_0xc567('0xa')]=_0x3950d5['Contact'][_0xc567('0x8')];this[_0xc567('0xb')]=_0x5691a6[_0xc567('0xc')];this[_0xc567('0xd')]=_0x3950d5['active']||![];this[_0xc567('0xe')]=_0x5691a6[_0xc567('0xe')];this[_0xc567('0xf')]=_0x5691a6['dialQueueTimeout']||0x3;this[_0xc567('0x10')]=_0x3950d5['scheduledat'];this[_0xc567('0x11')]=_0x3950d5[_0xc567('0x11')];this['countcongestionretry']=_0x3950d5[_0xc567('0x12')];this['countnoanswerretry']=_0x3950d5[_0xc567('0x13')];this[_0xc567('0x14')]=_0x3950d5[_0xc567('0x14')];this[_0xc567('0x15')]=_0x3950d5[_0xc567('0x15')];this[_0xc567('0x16')]=_0x3950d5['countabandonedretry'];this[_0xc567('0x17')]=_0x3950d5[_0xc567('0x17')];this[_0xc567('0x18')]=_0x3950d5[_0xc567('0x18')];this[_0xc567('0x19')]=_0x3950d5['ContactId'];this[_0xc567('0x1a')]=_0x3950d5['ListId'];this[_0xc567('0x1b')]=_0x3950d5[_0xc567('0x1b')];this[_0xc567('0x1c')]=_0x3950d5[_0xc567('0x1c')];this[_0xc567('0x1d')]=_0x3950d5[_0xc567('0x1d')];this[_0xc567('0x1e')]=_0x3950d5['id'];this['ContactFirstName']=_0x3950d5['Contact'][_0xc567('0x1f')]||'';this[_0xc567('0x20')]=moment()[_0xc567('0x21')](_0xc567('0x22'));this[_0xc567('0x23')]=_0x3950d5[_0xc567('0x23')];this[_0xc567('0x24')]=_0x3950d5[_0xc567('0x24')];this[_0xc567('0x25')]=_0x3950d5['callbackat'];this[_0xc567('0x26')]=_0x3950d5[_0xc567('0x26')];this[_0xc567('0x27')]='';this[_0xc567('0x28')]='';}Action['prototype'][_0xc567('0x29')]=function(){return util[_0xc567('0x21')]('\x22%s\x22\x20<%s>',this[_0xc567('0xc')],this[_0xc567('0x5')][_0xc567('0x2a')]>0x0?this['number'][_0xc567('0x2b')](this['voiceQueue'][_0xc567('0x2a')]):this[_0xc567('0xa')]);};Action['prototype'][_0xc567('0x2c')]=function(){return this['queue'];};module[_0xc567('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9aeebab..3dbb672 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 _0x3a9f=['statedesc','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state'];(function(_0x4c5d31,_0x256c44){var _0x47238d=function(_0x5a81f1){while(--_0x5a81f1){_0x4c5d31['push'](_0x4c5d31['shift']());}};_0x47238d(++_0x256c44);}(_0x3a9f,0x151));var _0xf3a9=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x3a9f[_0xf168d3];return _0x17fb54;};'use strict';var util=require(_0xf3a9('0x0'));var _=require(_0xf3a9('0x1'));var moment=require(_0xf3a9('0x2'));function getSeconds(_0x1542bb,_0x3cb509){var _0x2c8929=moment(_0x1542bb)[_0xf3a9('0x3')](0x0);var _0x533407=moment(_0x3cb509)[_0xf3a9('0x3')](0x0);return _0x2c8929[_0xf3a9('0x4')](_0x533407,_0xf3a9('0x5'));}function AgentComplete(_0x2a45cc,_0x5eff25){this[_0xf3a9('0x6')]=0x4;this[_0xf3a9('0x7')]='Answer';this[_0xf3a9('0x8')]=_0x2a45cc[_0xf3a9('0x8')];this[_0xf3a9('0x9')]=_0x2a45cc[_0xf3a9('0x9')];this['campaigntype']=_0x2a45cc[_0xf3a9('0x9')]==='outbound'?_0xf3a9('0xa'):_0x2a45cc['type'];this[_0xf3a9('0xb')]=_0x2a45cc[_0xf3a9('0xb')];this[_0xf3a9('0xc')]=_0x2a45cc[_0xf3a9('0xc')];this['countnoanswerretry']=_0x2a45cc[_0xf3a9('0xd')];this['countglobal']=_0x2a45cc[_0xf3a9('0xb')]+_0x2a45cc[_0xf3a9('0xc')]+_0x2a45cc[_0xf3a9('0xd')]+_0x2a45cc[_0xf3a9('0xe')]+_0x2a45cc['countdropretry']+_0x2a45cc[_0xf3a9('0xf')]+_0x2a45cc['countmachineretry']+_0x2a45cc[_0xf3a9('0x10')];this['countnosuchnumberretry']=_0x2a45cc['countnosuchnumberretry'];this[_0xf3a9('0x11')]=_0x2a45cc['countdropretry'];this[_0xf3a9('0xf')]=_0x2a45cc[_0xf3a9('0xf')];this['countmachineretry']=_0x2a45cc[_0xf3a9('0x12')];this[_0xf3a9('0x10')]=_0x2a45cc[_0xf3a9('0x10')];this['uniqueid']=_0x5eff25[_0xf3a9('0x13')];this[_0xf3a9('0x14')]=_0x2a45cc[_0xf3a9('0x15')];this['calleridnum']=_0x2a45cc[_0xf3a9('0x16')];this['starttime']=_0x2a45cc[_0xf3a9('0x17')];this[_0xf3a9('0x18')]=_0x2a45cc[_0xf3a9('0x18')];this[_0xf3a9('0x19')]=_0x2a45cc['answertime'];this[_0xf3a9('0x1a')]=moment()['format'](_0xf3a9('0x1b'));this[_0xf3a9('0x1c')]=getSeconds(_0x2a45cc['responsetime'],_0x2a45cc[_0xf3a9('0x17')]);this[_0xf3a9('0x1d')]=getSeconds(_0x2a45cc['answertime'],_0x2a45cc[_0xf3a9('0x18')]);this[_0xf3a9('0x1e')]=getSeconds(this[_0xf3a9('0x1a')],_0x2a45cc[_0xf3a9('0x19')]);this[_0xf3a9('0xa')]=_0x5eff25[_0xf3a9('0xa')];this['membername']=_0x5eff25[_0xf3a9('0x1f')];this[_0xf3a9('0x20')]=_0x5eff25[_0xf3a9('0x20')];this[_0xf3a9('0x21')]=_0x2a45cc['callback'];this[_0xf3a9('0x22')]=_0x2a45cc[_0xf3a9('0x22')];this[_0xf3a9('0x23')]=_0x2a45cc[_0xf3a9('0x23')];this['recallme']=_0x2a45cc['recallme'];this[_0xf3a9('0x24')]=_0x2a45cc[_0xf3a9('0x24')];this[_0xf3a9('0x25')]=_0x2a45cc[_0xf3a9('0x25')];this['UserId']=_0x2a45cc[_0xf3a9('0x26')];this['VoiceQueueId']=_0x2a45cc['VoiceQueueId'];this[_0xf3a9('0x27')]=_0x2a45cc[_0xf3a9('0x27')];this['originatecalleridnum']=_0x2a45cc[_0xf3a9('0x28')]||'';this[_0xf3a9('0x29')]=_0x2a45cc[_0xf3a9('0x29')]||'';}module[_0xf3a9('0x2a')]=AgentComplete; \ No newline at end of file +var _0x8ce5=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x493f9f,_0x445f28){var _0x536959=function(_0x2f3204){while(--_0x2f3204){_0x493f9f['push'](_0x493f9f['shift']());}};_0x536959(++_0x445f28);}(_0x8ce5,0x17d));var _0x58ce=function(_0x254c0c,_0x4cc127){_0x254c0c=_0x254c0c-0x0;var _0x27c97a=_0x8ce5[_0x254c0c];return _0x27c97a;};'use strict';var util=require('util');var _=require(_0x58ce('0x0'));var moment=require('moment');function getSeconds(_0x47e6a5,_0x4a1737){var _0x29898e=moment(_0x47e6a5)[_0x58ce('0x1')](0x0);var _0x569a4b=moment(_0x4a1737)[_0x58ce('0x1')](0x0);return _0x29898e[_0x58ce('0x2')](_0x569a4b,_0x58ce('0x3'));}function AgentComplete(_0x5a9095,_0x2f5ad0){this[_0x58ce('0x4')]=0x4;this[_0x58ce('0x5')]=_0x58ce('0x6');this[_0x58ce('0x7')]=_0x5a9095[_0x58ce('0x7')];this[_0x58ce('0x8')]=_0x5a9095[_0x58ce('0x8')];this[_0x58ce('0x9')]=_0x5a9095[_0x58ce('0x8')]===_0x58ce('0xa')?'queue':_0x5a9095[_0x58ce('0x8')];this[_0x58ce('0xb')]=_0x5a9095[_0x58ce('0xb')];this[_0x58ce('0xc')]=_0x5a9095[_0x58ce('0xc')];this[_0x58ce('0xd')]=_0x5a9095[_0x58ce('0xd')];this[_0x58ce('0xe')]=_0x5a9095[_0x58ce('0xb')]+_0x5a9095[_0x58ce('0xc')]+_0x5a9095[_0x58ce('0xd')]+_0x5a9095[_0x58ce('0xf')]+_0x5a9095[_0x58ce('0x10')]+_0x5a9095[_0x58ce('0x11')]+_0x5a9095[_0x58ce('0x12')]+_0x5a9095[_0x58ce('0x13')];this[_0x58ce('0xf')]=_0x5a9095[_0x58ce('0xf')];this[_0x58ce('0x10')]=_0x5a9095[_0x58ce('0x10')];this['countabandonedretry']=_0x5a9095['countabandonedretry'];this[_0x58ce('0x12')]=_0x5a9095['countmachineretry'];this[_0x58ce('0x13')]=_0x5a9095[_0x58ce('0x13')];this['uniqueid']=_0x2f5ad0[_0x58ce('0x14')];this[_0x58ce('0x15')]=_0x5a9095[_0x58ce('0x16')];this[_0x58ce('0x17')]=_0x5a9095[_0x58ce('0x18')];this[_0x58ce('0x19')]=_0x5a9095['starttime'];this[_0x58ce('0x1a')]=_0x5a9095[_0x58ce('0x1a')];this[_0x58ce('0x1b')]=_0x5a9095[_0x58ce('0x1b')];this[_0x58ce('0x1c')]=moment()[_0x58ce('0x1d')](_0x58ce('0x1e'));this[_0x58ce('0x1f')]=getSeconds(_0x5a9095['responsetime'],_0x5a9095[_0x58ce('0x19')]);this['holdtime']=getSeconds(_0x5a9095['answertime'],_0x5a9095[_0x58ce('0x1a')]);this[_0x58ce('0x20')]=getSeconds(this[_0x58ce('0x1c')],_0x5a9095[_0x58ce('0x1b')]);this[_0x58ce('0x21')]=_0x2f5ad0[_0x58ce('0x21')];this[_0x58ce('0x22')]=_0x2f5ad0[_0x58ce('0x22')];this[_0x58ce('0x23')]=_0x2f5ad0[_0x58ce('0x23')];this['callback']=_0x5a9095[_0x58ce('0x24')];this[_0x58ce('0x25')]=_0x5a9095[_0x58ce('0x25')];this[_0x58ce('0x26')]=_0x5a9095[_0x58ce('0x26')];this['recallme']=_0x5a9095[_0x58ce('0x27')];this[_0x58ce('0x28')]=_0x5a9095['ContactId'];this['ListId']=_0x5a9095[_0x58ce('0x29')];this[_0x58ce('0x2a')]=_0x5a9095[_0x58ce('0x2a')];this[_0x58ce('0x2b')]=_0x5a9095[_0x58ce('0x2b')];this['CampaignId']=_0x5a9095['CampaignId'];this['originatecalleridnum']=_0x5a9095[_0x58ce('0x2c')]||'';this[_0x58ce('0x2d')]=_0x5a9095[_0x58ce('0x2d')]||'';}module[_0x58ce('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 4f8eb67..a3809f9 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 _0x44e8=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2a5789,_0x22c6e1){var _0x2c4588=function(_0xa15a5a){while(--_0xa15a5a){_0x2a5789['push'](_0x2a5789['shift']());}};_0x2c4588(++_0x22c6e1);}(_0x44e8,0xd7));var _0x844e=function(_0x6957bb,_0x17b83b){_0x6957bb=_0x6957bb-0x0;var _0x23e0d0=_0x44e8[_0x6957bb];return _0x23e0d0;};'use strict';var util=require(_0x844e('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1b5be7,_0x21307e){var _0x2afcef=moment(_0x1b5be7)[_0x844e('0x1')](0x0);var _0x49ce1b=moment(_0x21307e)[_0x844e('0x1')](0x0);return _0x2afcef[_0x844e('0x2')](_0x49ce1b,_0x844e('0x3'));}function Final(_0x446f47){this['uniqueid']=_0x446f47[_0x844e('0x4')];this[_0x844e('0x5')]=_0x446f47[_0x844e('0x5')];this[_0x844e('0x6')]=_0x446f47['type'];this[_0x844e('0x7')]=_0x446f47[_0x844e('0x6')]===_0x844e('0x8')?_0x844e('0x9'):_0x446f47[_0x844e('0x6')];this[_0x844e('0xa')]=_0x446f47['countbusyretry'];this[_0x844e('0xb')]=_0x446f47[_0x844e('0xb')];this[_0x844e('0xc')]=_0x446f47[_0x844e('0xc')];this[_0x844e('0xd')]=_0x446f47[_0x844e('0xa')]+_0x446f47[_0x844e('0xb')]+_0x446f47['countnoanswerretry']+_0x446f47[_0x844e('0xe')]+_0x446f47[_0x844e('0xf')]+_0x446f47['countabandonedretry']+_0x446f47[_0x844e('0x10')]+_0x446f47[_0x844e('0x11')];this['countnosuchnumberretry']=_0x446f47[_0x844e('0xe')];this[_0x844e('0xf')]=_0x446f47[_0x844e('0xf')];this['countabandonedretry']=_0x446f47[_0x844e('0x12')];this[_0x844e('0x10')]=_0x446f47[_0x844e('0x10')];this[_0x844e('0x11')]=_0x446f47[_0x844e('0x11')];this[_0x844e('0x9')]=_0x446f47[_0x844e('0x9')];this[_0x844e('0x13')]=_0x446f47['calleridname'];this[_0x844e('0x14')]=_0x446f47['calleridnum'];this[_0x844e('0x15')]=_0x446f47['starttime'];this[_0x844e('0x16')]=_0x446f47['responsetime'];this[_0x844e('0x17')]=_0x446f47[_0x844e('0x16')];this[_0x844e('0x18')]=_0x446f47[_0x844e('0x18')]||0x0;this[_0x844e('0x19')]=_0x446f47[_0x844e('0x19')]||0x0;this[_0x844e('0x1a')]=_0x446f47[_0x844e('0x1a')]||0x0;this['callback']=_0x446f47[_0x844e('0x1b')];this['callbackuniqueid']=_0x446f47['callbackuniqueid'];this[_0x844e('0x1c')]=_0x446f47[_0x844e('0x1c')];this[_0x844e('0x1d')]=_0x446f47[_0x844e('0x1d')];this['ContactId']=_0x446f47[_0x844e('0x1e')];this[_0x844e('0x1f')]=_0x446f47['ListId'];this[_0x844e('0x20')]=_0x446f47[_0x844e('0x20')];this[_0x844e('0x21')]=_0x446f47[_0x844e('0x21')];this[_0x844e('0x22')]=_0x446f47[_0x844e('0x22')];this['originatecalleridnum']=_0x446f47[_0x844e('0x23')]||'';this[_0x844e('0x24')]=_0x446f47[_0x844e('0x24')]||'';}module[_0x844e('0x25')]=Final; \ No newline at end of file +var _0x56e7=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime'];(function(_0x2a281f,_0x557f40){var _0x18d5ba=function(_0x5e566f){while(--_0x5e566f){_0x2a281f['push'](_0x2a281f['shift']());}};_0x18d5ba(++_0x557f40);}(_0x56e7,0x7b));var _0x756e=function(_0x1b54e1,_0xa731c2){_0x1b54e1=_0x1b54e1-0x0;var _0x16b3e7=_0x56e7[_0x1b54e1];return _0x16b3e7;};'use strict';var util=require('util');var _=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));function getSeconds(_0x590286,_0x2eadee){var _0x3efe5c=moment(_0x590286)[_0x756e('0x2')](0x0);var _0xb850c9=moment(_0x2eadee)[_0x756e('0x2')](0x0);return _0x3efe5c[_0x756e('0x3')](_0xb850c9,_0x756e('0x4'));}function Final(_0x538050){this[_0x756e('0x5')]=_0x538050[_0x756e('0x5')];this[_0x756e('0x6')]=_0x538050[_0x756e('0x6')];this['type']=_0x538050[_0x756e('0x7')];this['campaigntype']=_0x538050[_0x756e('0x7')]===_0x756e('0x8')?_0x756e('0x9'):_0x538050[_0x756e('0x7')];this['countbusyretry']=_0x538050['countbusyretry'];this[_0x756e('0xa')]=_0x538050[_0x756e('0xa')];this[_0x756e('0xb')]=_0x538050['countnoanswerretry'];this[_0x756e('0xc')]=_0x538050[_0x756e('0xd')]+_0x538050['countcongestionretry']+_0x538050['countnoanswerretry']+_0x538050[_0x756e('0xe')]+_0x538050['countdropretry']+_0x538050[_0x756e('0xf')]+_0x538050[_0x756e('0x10')]+_0x538050[_0x756e('0x11')];this[_0x756e('0xe')]=_0x538050[_0x756e('0xe')];this['countdropretry']=_0x538050['countdropretry'];this[_0x756e('0xf')]=_0x538050[_0x756e('0xf')];this[_0x756e('0x10')]=_0x538050['countmachineretry'];this['countagentrejectretry']=_0x538050[_0x756e('0x11')];this[_0x756e('0x9')]=_0x538050[_0x756e('0x9')];this[_0x756e('0x12')]=_0x538050[_0x756e('0x12')];this[_0x756e('0x13')]=_0x538050[_0x756e('0x13')];this[_0x756e('0x14')]=_0x538050[_0x756e('0x14')];this['responsetime']=_0x538050[_0x756e('0x15')];this['endtime']=_0x538050['responsetime'];this[_0x756e('0x16')]=_0x538050[_0x756e('0x16')]||0x0;this[_0x756e('0x17')]=_0x538050[_0x756e('0x17')]||0x0;this[_0x756e('0x18')]=_0x538050[_0x756e('0x18')]||0x0;this[_0x756e('0x19')]=_0x538050[_0x756e('0x19')];this[_0x756e('0x1a')]=_0x538050[_0x756e('0x1a')];this[_0x756e('0x1b')]=_0x538050[_0x756e('0x1b')];this[_0x756e('0x1c')]=_0x538050[_0x756e('0x1c')];this[_0x756e('0x1d')]=_0x538050[_0x756e('0x1d')];this['ListId']=_0x538050[_0x756e('0x1e')];this['UserId']=_0x538050[_0x756e('0x1f')];this[_0x756e('0x20')]=_0x538050[_0x756e('0x20')];this[_0x756e('0x21')]=_0x538050['CampaignId'];this[_0x756e('0x22')]=_0x538050[_0x756e('0x22')]||'';this[_0x756e('0x23')]=_0x538050['originatecalleridname']||'';}module[_0x756e('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 71aa983..193b92e 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 _0xe5d8=['countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','queue','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x37a65e,_0x5a24dd){var _0x2ced66=function(_0x4f0e52){while(--_0x4f0e52){_0x37a65e['push'](_0x37a65e['shift']());}};_0x2ced66(++_0x5a24dd);}(_0xe5d8,0x1bb));var _0x8e5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe5d8[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var _=require(_0x8e5d('0x0'));var moment=require(_0x8e5d('0x1'));function getSeconds(_0x2b444b,_0x36af1c){var _0x222924=moment(_0x2b444b)['milliseconds'](0x0);var _0x23e37d=moment(_0x36af1c)[_0x8e5d('0x2')](0x0);return _0x222924[_0x8e5d('0x3')](_0x23e37d,_0x8e5d('0x4'));}function Hangup(_0x2b0099,_0x320917){this[_0x8e5d('0x5')]=0x4;this[_0x8e5d('0x6')]=_0x8e5d('0x7');this[_0x8e5d('0x8')]=_0x2b0099[_0x8e5d('0x8')];this[_0x8e5d('0x9')]=_0x2b0099['type'];this['campaigntype']=_0x2b0099['type']===_0x8e5d('0xa')?'queue':_0x2b0099[_0x8e5d('0x9')];this[_0x8e5d('0xb')]=_0x2b0099[_0x8e5d('0xb')];this[_0x8e5d('0xc')]=_0x2b0099['countcongestionretry'];this['countnoanswerretry']=_0x2b0099[_0x8e5d('0xd')];this[_0x8e5d('0xe')]=_0x2b0099[_0x8e5d('0xb')]+_0x2b0099['countcongestionretry']+_0x2b0099[_0x8e5d('0xd')]+_0x2b0099[_0x8e5d('0xf')]+_0x2b0099[_0x8e5d('0x10')]+_0x2b0099[_0x8e5d('0x11')]+_0x2b0099[_0x8e5d('0x12')]+_0x2b0099['countagentrejectretry'];this[_0x8e5d('0xf')]=_0x2b0099[_0x8e5d('0xf')];this[_0x8e5d('0x10')]=_0x2b0099[_0x8e5d('0x10')];this[_0x8e5d('0x11')]=_0x2b0099['countabandonedretry'];this['countmachineretry']=_0x2b0099[_0x8e5d('0x12')];this[_0x8e5d('0x13')]=_0x2b0099[_0x8e5d('0x13')];this['uniqueid']=_0x320917[_0x8e5d('0x14')];this[_0x8e5d('0x15')]=_0x2b0099[_0x8e5d('0x16')];this['calleridnum']=_0x2b0099['number'];this[_0x8e5d('0x17')]=_0x2b0099[_0x8e5d('0x17')];this[_0x8e5d('0x18')]=_0x2b0099[_0x8e5d('0x18')];this[_0x8e5d('0x19')]=moment()['format'](_0x8e5d('0x1a'));this['ringtime']=getSeconds(_0x2b0099['responsetime'],_0x2b0099[_0x8e5d('0x17')]);this['holdtime']=0x0;this[_0x8e5d('0x1b')]=getSeconds(this[_0x8e5d('0x19')],_0x2b0099[_0x8e5d('0x18')]);this[_0x8e5d('0x1c')]=_0x2b0099['queue'];this[_0x8e5d('0x1d')]=_0x8e5d('0x1e');this[_0x8e5d('0x1f')]=_0x320917['cause-txt'];this[_0x8e5d('0x20')]=_0x2b0099['callback'];this[_0x8e5d('0x21')]=_0x2b0099[_0x8e5d('0x21')];this[_0x8e5d('0x22')]=_0x2b0099[_0x8e5d('0x22')];this[_0x8e5d('0x23')]=_0x2b0099[_0x8e5d('0x23')];this[_0x8e5d('0x24')]=_0x2b0099[_0x8e5d('0x24')];this[_0x8e5d('0x25')]=_0x2b0099['ListId'];this['UserId']=_0x2b0099[_0x8e5d('0x26')];this[_0x8e5d('0x27')]=_0x2b0099['VoiceQueueId'];this[_0x8e5d('0x28')]=_0x2b0099[_0x8e5d('0x28')];}module[_0x8e5d('0x29')]=Hangup; \ No newline at end of file +var _0x0e7d=['util','moment','diff','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','endtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports'];(function(_0x3fd6ba,_0x5b7a00){var _0x4f5ace=function(_0x5129e7){while(--_0x5129e7){_0x3fd6ba['push'](_0x3fd6ba['shift']());}};_0x4f5ace(++_0x5b7a00);}(_0x0e7d,0x1a4));var _0xd0e7=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x0e7d[_0x409353];return _0x4f4b59;};'use strict';var util=require(_0xd0e7('0x0'));var _=require('lodash');var moment=require(_0xd0e7('0x1'));function getSeconds(_0xb9dafe,_0x1c98db){var _0xbea373=moment(_0xb9dafe)['milliseconds'](0x0);var _0x5da697=moment(_0x1c98db)['milliseconds'](0x0);return _0xbea373[_0xd0e7('0x2')](_0x5da697,'seconds');}function Hangup(_0x3509a7,_0x9b8254){this[_0xd0e7('0x3')]=0x4;this['statedesc']=_0xd0e7('0x4');this[_0xd0e7('0x5')]=_0x3509a7[_0xd0e7('0x5')];this[_0xd0e7('0x6')]=_0x3509a7['type'];this[_0xd0e7('0x7')]=_0x3509a7[_0xd0e7('0x6')]===_0xd0e7('0x8')?_0xd0e7('0x9'):_0x3509a7['type'];this[_0xd0e7('0xa')]=_0x3509a7[_0xd0e7('0xa')];this[_0xd0e7('0xb')]=_0x3509a7[_0xd0e7('0xb')];this[_0xd0e7('0xc')]=_0x3509a7[_0xd0e7('0xc')];this[_0xd0e7('0xd')]=_0x3509a7[_0xd0e7('0xa')]+_0x3509a7[_0xd0e7('0xb')]+_0x3509a7[_0xd0e7('0xc')]+_0x3509a7[_0xd0e7('0xe')]+_0x3509a7['countdropretry']+_0x3509a7['countabandonedretry']+_0x3509a7['countmachineretry']+_0x3509a7['countagentrejectretry'];this['countnosuchnumberretry']=_0x3509a7[_0xd0e7('0xe')];this['countdropretry']=_0x3509a7[_0xd0e7('0xf')];this['countabandonedretry']=_0x3509a7[_0xd0e7('0x10')];this[_0xd0e7('0x11')]=_0x3509a7[_0xd0e7('0x11')];this[_0xd0e7('0x12')]=_0x3509a7[_0xd0e7('0x12')];this[_0xd0e7('0x13')]=_0x9b8254[_0xd0e7('0x13')];this[_0xd0e7('0x14')]=_0x3509a7[_0xd0e7('0x15')];this['calleridnum']=_0x3509a7[_0xd0e7('0x16')];this['starttime']=_0x3509a7['starttime'];this[_0xd0e7('0x17')]=_0x3509a7[_0xd0e7('0x17')];this['endtime']=moment()[_0xd0e7('0x18')](_0xd0e7('0x19'));this['ringtime']=getSeconds(_0x3509a7[_0xd0e7('0x17')],_0x3509a7['starttime']);this[_0xd0e7('0x1a')]=0x0;this[_0xd0e7('0x1b')]=getSeconds(this[_0xd0e7('0x1c')],_0x3509a7['responsetime']);this[_0xd0e7('0x9')]=_0x3509a7[_0xd0e7('0x9')];this['membername']=_0xd0e7('0x1d');this[_0xd0e7('0x1e')]=_0x9b8254[_0xd0e7('0x1f')];this['callback']=_0x3509a7[_0xd0e7('0x20')];this[_0xd0e7('0x21')]=_0x3509a7[_0xd0e7('0x21')];this[_0xd0e7('0x22')]=_0x3509a7[_0xd0e7('0x22')];this[_0xd0e7('0x23')]=_0x3509a7[_0xd0e7('0x23')];this[_0xd0e7('0x24')]=_0x3509a7[_0xd0e7('0x24')];this[_0xd0e7('0x25')]=_0x3509a7[_0xd0e7('0x25')];this['UserId']=_0x3509a7[_0xd0e7('0x26')];this['VoiceQueueId']=_0x3509a7[_0xd0e7('0x27')];this[_0xd0e7('0x28')]=_0x3509a7[_0xd0e7('0x28')];}module[_0xd0e7('0x29')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 8247e89..552f443 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 _0x6786=['countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x6786,0xd5));var _0x6678=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x6786[_0x4169d8];return _0x32084a;};'use strict';var util=require(_0x6678('0x0'));var _=require(_0x6678('0x1'));var moment=require('moment');function getSeconds(_0x4808cb,_0x9be66b){var _0x5f2559=moment(_0x4808cb)['milliseconds'](0x0);var _0x57a642=moment(_0x9be66b)[_0x6678('0x2')](0x0);return _0x5f2559[_0x6678('0x3')](_0x57a642,'seconds');}function History(_0x368dd1){this[_0x6678('0x4')]=_0x368dd1[_0x6678('0x4')];this[_0x6678('0x5')]=_0x368dd1[_0x6678('0x5')]||undefined;this[_0x6678('0x6')]=_0x368dd1[_0x6678('0x6')];this[_0x6678('0x7')]=_0x368dd1[_0x6678('0x6')]===_0x6678('0x8')?'queue':_0x368dd1['type'];this[_0x6678('0x9')]=_0x368dd1[_0x6678('0x9')];this[_0x6678('0xa')]=_0x368dd1[_0x6678('0xa')];this[_0x6678('0xb')]=_0x368dd1[_0x6678('0xb')];this[_0x6678('0xc')]=_0x368dd1[_0x6678('0x9')]+_0x368dd1[_0x6678('0xa')]+_0x368dd1[_0x6678('0xb')]+_0x368dd1[_0x6678('0xd')]+_0x368dd1[_0x6678('0xe')]+_0x368dd1[_0x6678('0xf')]+_0x368dd1[_0x6678('0x10')]+_0x368dd1[_0x6678('0x11')];this['countnosuchnumberretry']=_0x368dd1[_0x6678('0xd')];this[_0x6678('0xe')]=_0x368dd1[_0x6678('0xe')];this[_0x6678('0xf')]=_0x368dd1[_0x6678('0xf')];this[_0x6678('0x10')]=_0x368dd1[_0x6678('0x10')];this[_0x6678('0x11')]=_0x368dd1[_0x6678('0x11')];this[_0x6678('0x12')]=_0x368dd1[_0x6678('0x12')];this[_0x6678('0x13')]=_0x368dd1['name'];this['calleridnum']=_0x368dd1[_0x6678('0x14')];this[_0x6678('0x15')]=_0x368dd1[_0x6678('0x15')];this['responsetime']=_0x368dd1[_0x6678('0x16')];this[_0x6678('0x17')]=_0x368dd1[_0x6678('0x16')];this[_0x6678('0x18')]=getSeconds(_0x368dd1['responsetime'],_0x368dd1[_0x6678('0x15')]);this['holdtime']=0x0;this[_0x6678('0x19')]=0x0;this[_0x6678('0x1a')]=_0x368dd1[_0x6678('0x1a')];this[_0x6678('0x1b')]=_0x368dd1[_0x6678('0x1b')];this[_0x6678('0x1c')]=_0x368dd1[_0x6678('0x1c')];this[_0x6678('0x1d')]=_0x368dd1[_0x6678('0x1d')];this[_0x6678('0x1e')]=_0x368dd1[_0x6678('0x1e')];this[_0x6678('0x1f')]=_0x368dd1[_0x6678('0x1f')];this[_0x6678('0x20')]=_0x368dd1['UserId'];this['VoiceQueueId']=_0x368dd1[_0x6678('0x21')];this[_0x6678('0x22')]=_0x368dd1[_0x6678('0x22')];this[_0x6678('0x23')]=_0x368dd1['originatecalleridnum']||'';this[_0x6678('0x24')]=_0x368dd1[_0x6678('0x24')]||'';}module[_0x6678('0x25')]=History; \ No newline at end of file +var _0xcd6a=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','callback'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0xcd6a,0xbe));var _0xacd6=function(_0x538731,_0x5c5af3){_0x538731=_0x538731-0x0;var _0x54ed4e=_0xcd6a[_0x538731];return _0x54ed4e;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xacd6('0x0'));function getSeconds(_0x3a8578,_0x40b9fe){var _0x11ae79=moment(_0x3a8578)[_0xacd6('0x1')](0x0);var _0x4aa9f4=moment(_0x40b9fe)[_0xacd6('0x1')](0x0);return _0x11ae79[_0xacd6('0x2')](_0x4aa9f4,'seconds');}function History(_0x4f08e3){this[_0xacd6('0x3')]=_0x4f08e3[_0xacd6('0x3')];this[_0xacd6('0x4')]=_0x4f08e3[_0xacd6('0x4')]||undefined;this[_0xacd6('0x5')]=_0x4f08e3[_0xacd6('0x5')];this[_0xacd6('0x6')]=_0x4f08e3['type']===_0xacd6('0x7')?_0xacd6('0x8'):_0x4f08e3['type'];this[_0xacd6('0x9')]=_0x4f08e3[_0xacd6('0x9')];this[_0xacd6('0xa')]=_0x4f08e3[_0xacd6('0xa')];this['countnoanswerretry']=_0x4f08e3[_0xacd6('0xb')];this['countglobal']=_0x4f08e3[_0xacd6('0x9')]+_0x4f08e3[_0xacd6('0xa')]+_0x4f08e3[_0xacd6('0xb')]+_0x4f08e3['countnosuchnumberretry']+_0x4f08e3['countdropretry']+_0x4f08e3[_0xacd6('0xc')]+_0x4f08e3[_0xacd6('0xd')]+_0x4f08e3[_0xacd6('0xe')];this[_0xacd6('0xf')]=_0x4f08e3[_0xacd6('0xf')];this[_0xacd6('0x10')]=_0x4f08e3[_0xacd6('0x10')];this[_0xacd6('0xc')]=_0x4f08e3[_0xacd6('0xc')];this[_0xacd6('0xd')]=_0x4f08e3['countmachineretry'];this[_0xacd6('0xe')]=_0x4f08e3[_0xacd6('0xe')];this['queue']=_0x4f08e3[_0xacd6('0x8')];this[_0xacd6('0x11')]=_0x4f08e3[_0xacd6('0x12')];this[_0xacd6('0x13')]=_0x4f08e3[_0xacd6('0x14')];this[_0xacd6('0x15')]=_0x4f08e3['starttime'];this[_0xacd6('0x16')]=_0x4f08e3[_0xacd6('0x16')];this[_0xacd6('0x17')]=_0x4f08e3[_0xacd6('0x16')];this[_0xacd6('0x18')]=getSeconds(_0x4f08e3[_0xacd6('0x16')],_0x4f08e3[_0xacd6('0x15')]);this['holdtime']=0x0;this['talktime']=0x0;this['callback']=_0x4f08e3[_0xacd6('0x19')];this['callbackuniqueid']=_0x4f08e3[_0xacd6('0x1a')];this[_0xacd6('0x1b')]=_0x4f08e3[_0xacd6('0x1b')];this[_0xacd6('0x1c')]=_0x4f08e3[_0xacd6('0x1c')];this[_0xacd6('0x1d')]=_0x4f08e3['ContactId'];this['ListId']=_0x4f08e3[_0xacd6('0x1e')];this[_0xacd6('0x1f')]=_0x4f08e3[_0xacd6('0x1f')];this[_0xacd6('0x20')]=_0x4f08e3[_0xacd6('0x20')];this[_0xacd6('0x21')]=_0x4f08e3[_0xacd6('0x21')];this['originatecalleridnum']=_0x4f08e3[_0xacd6('0x22')]||'';this['originatecalleridname']=_0x4f08e3[_0xacd6('0x23')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cddde64..bac47d4 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 _0xe189=['---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','inspect','error','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','state','starttime','clearZombieChannels','[uniqueid]','undefined','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','voiceQueues','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','catch','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerCallsDay','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','statedesc','HangupInAMD','membername','[syncHangupInAMDIvr]','countglobal','countnoanswerretry','countnosuchnumberretry','add','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','stateinterface','locked','queueBooked','push','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','finally','[unlock][syncQueueStatusComplete]','_rr','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','unlockRR','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','interval','true','indexOf','some','GLOBAL_INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','power','predictive','Queue','handleIvr','syncQueueSummary','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','random','match','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[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','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','busyFactor','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','not_inuse','reachable','getContactDialer','ACTIVE','RUNNING','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\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]','Umin\x20=\x20','exports','util','uuid','moment','md5','ioredis','../../../config/logger','dialer','booked','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','tail','sequence','preview','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty'];(function(_0xe38c69,_0x5b1366){var _0x38218b=function(_0x5d6531){while(--_0x5d6531){_0xe38c69['push'](_0xe38c69['shift']());}};_0x38218b(++_0x5b1366);}(_0xe189,0x194));var _0x9e18=function(_0x24140d,_0x536fad){_0x24140d=_0x24140d-0x0;var _0x269d80=_0xe189[_0x24140d];return _0x269d80;};'use strict';var util=require(_0x9e18('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x9e18('0x1'));var moment=require(_0x9e18('0x2'));var rr=require('rr');var md5=require(_0x9e18('0x3'));var Redis=require(_0x9e18('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x9e18('0x5'))(_0x9e18('0x6'));var loggerBooked=require(_0x9e18('0x5'))(_0x9e18('0x7'));var loggerPredictive=require(_0x9e18('0x5'))('predictive');var loggerPredictiveCalls=require(_0x9e18('0x5'))(_0x9e18('0x8'));var loggerSyncQueueSummary=require(_0x9e18('0x5'))('syncQueueSummary');var ami=require(_0x9e18('0x9'));config[_0x9e18('0xa')]=_[_0x9e18('0xb')](config['redis'],{'host':_0x9e18('0xc'),'port':0x18eb});var io=require(_0x9e18('0xd'))(new Redis(config[_0x9e18('0xa')]));var cmHopper=require(_0x9e18('0xe'));var cmHopperHistory=require(_0x9e18('0xf'));var cmHopperBlack=require(_0x9e18('0x10'));var voiceQueueRt=require(_0x9e18('0x11'));var Action=require(_0x9e18('0x12'));var History=require(_0x9e18('0x13'));var Final=require('./final');var AgentComplete=require(_0x9e18('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x9e18('0x15'));var ipAgi=process[_0x9e18('0x16')]['XCALLY_IP_AGI']||_0x9e18('0x17');var strategy={'rrmemory':_0x9e18('0x18'),'roundrobin':_0x9e18('0x19')};var Sequence=function(){};Sequence[_0x9e18('0x1a')]['enqueue']=function(_0xbd877){this['tail']=this['tail']?this[_0x9e18('0x1b')]['finally'](_0xbd877):_0xbd877();};function Dialer(_0x691a51,_0x3a2ad9){this[_0x9e18('0x1c')]=new Sequence();this[_0x9e18('0x1d')]=_0x3a2ad9;this['voiceQueues']=_0x691a51['voiceQueues'];this[_0x9e18('0x1e')]=_0x691a51[_0x9e18('0x1e')];this['agents']=_0x691a51[_0x9e18('0x1f')];this['trunks']=_0x691a51[_0x9e18('0x20')];this['maxNumberOriginate']=config[_0x9e18('0x21')]||0x2;this[_0x9e18('0x22')]={};this[_0x9e18('0x23')]={};this[_0x9e18('0x24')]={};this[_0x9e18('0x25')]={};this[_0x9e18('0x26')]={};this[_0x9e18('0x27')]={};this[_0x9e18('0x28')]={};this[_0x9e18('0x29')]={};this['queueBooked']={};this[_0x9e18('0x2a')]={};ami['on'](_0x9e18('0x2b'),this[_0x9e18('0x2c')]['bind'](this));ami['on'](_0x9e18('0x2d'),this['syncQueueCallerAbandon'][_0x9e18('0x2e')](this));ami['on']('originateresponse',this[_0x9e18('0x2f')]['bind'](this));ami['on'](_0x9e18('0x30'),this[_0x9e18('0x31')]['bind'](this));ami['on'](_0x9e18('0x32'),this['syncQueueSummary']['bind'](this));ami['on'](_0x9e18('0x33'),this['syncHangup'][_0x9e18('0x2e')](this));ami['on']('newexten',this[_0x9e18('0x34')][_0x9e18('0x2e')](this));ami['on'](_0x9e18('0x35'),this[_0x9e18('0x36')][_0x9e18('0x2e')](this));ami['on'](_0x9e18('0x37'),this[_0x9e18('0x38')][_0x9e18('0x2e')](this));ami['on'](_0x9e18('0x39'),this['syncQueueStatusComplete'][_0x9e18('0x2e')](this));this[_0x9e18('0x3a')]();this[_0x9e18('0x3b')]();}function isNotNull(_0x2325b6){return _0x2325b6!==null&&!_['isUndefined'](_0x2325b6);}function checkIsLoggedIn(_0x56cb83,_0x410655){return function(){if(_0x410655<=0x0){_0x56cb83[_0x9e18('0x3c')]=_0x9e18('0x3d');throw _0x56cb83[_0x9e18('0x3e')]+_0x9e18('0x3f');}};}function isActive(_0x53c35e){return _0x53c35e;}function checkIsActive(_0xa72999,_0x3862d9){return function(){if(!isActive(_0x3862d9)){_0xa72999[_0x9e18('0x3c')]=_0x9e18('0x40');throw _0xa72999[_0x9e18('0x3e')]+_0x9e18('0x41');}};}function checkInterval(_0x5e2917){return function(){if(!isNotNull(_0x5e2917[_0x9e18('0x42')])){_0x5e2917[_0x9e18('0x3c')]=_0x9e18('0x43');throw _0x5e2917[_0x9e18('0x3e')]+_0x9e18('0x44');}if(!isNotNull(_0x5e2917['Interval']['Intervals'])){_0x5e2917[_0x9e18('0x3c')]=_0x9e18('0x43');throw _0x5e2917[_0x9e18('0x3e')]+_0x9e18('0x44');}if(!isNotNull(_['isEmpty'](_0x5e2917[_0x9e18('0x42')][_0x9e18('0x45')]))){_0x5e2917[_0x9e18('0x3c')]='INTERVAL_IS_NULL';throw _0x5e2917[_0x9e18('0x3e')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x26c457,_0x506ab8,_0xb842bf){return{'action':_0x26c457,'response':_0x506ab8,'message':_0xb842bf,'stack':_0xb842bf};}function myreject(_0x37b294){return function(_0xdc383c){return _0x37b294(msgResponse(_0x9e18('0x46'),_0x9e18('0x47'),JSON[_0x9e18('0x48')](_0xdc383c)));};}function getSeconds(_0x90019f,_0x22b590){var _0x267230=moment(_0x90019f)[_0x9e18('0x49')](0x0);var _0x24712f=moment(_0x22b590)['milliseconds'](0x0);return _0x267230[_0x9e18('0x4a')](_0x24712f,_0x9e18('0x4b'));}function emit(_0x2e1197,_0x368b8f,_0x437050){io['to'](_0x2e1197)[_0x9e18('0x4c')](_0x368b8f,_0x437050);}function emitVoiceQueueSummary(_0x15524f){if(_0x15524f[_0x9e18('0x4d')]===_0x9e18('0x4e')){var _0x41cf02={'id':_0x15524f['id'],'name':_0x15524f[_0x9e18('0x3e')],'strategy':_0x15524f[_0x9e18('0x4f')],'answered':_0x15524f[_0x9e18('0x50')],'available':_0x15524f[_0x9e18('0x51')],'loggedIn':_0x15524f['loggedIn'],'pTalking':_0x15524f[_0x9e18('0x52')],'sumBillable':_0x15524f[_0x9e18('0x53')],'sumDuration':_0x15524f[_0x9e18('0x54')],'sumHoldTime':_0x15524f['sumHoldTime']||0x0,'talking':_0x15524f[_0x9e18('0x55')],'total':_0x15524f[_0x9e18('0x56')],'type':_0x15524f[_0x9e18('0x4d')],'unmanaged':_0x15524f[_0x9e18('0x57')],'abandoned':_0x15524f[_0x9e18('0x58')],'waiting':_0x15524f[_0x9e18('0x59')],'loggedInDb':_0x15524f[_0x9e18('0x5a')],'dialActive':_0x15524f[_0x9e18('0x5b')],'dialMethod':_0x15524f[_0x9e18('0x5c')],'dialOriginateCallerIdName':_0x15524f[_0x9e18('0x5d')],'dialOriginateCallerIdNumber':_0x15524f['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x15524f['dialOriginateTimeout'],'dialPrefix':_0x15524f['dialPrefix'],'outboundAnswerAgiCallsDay':_0x15524f[_0x9e18('0x5e')],'outboundAnswerCallsDay':_0x15524f['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x15524f['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x15524f[_0x9e18('0x5f')],'outboundCongestionCallsDay':_0x15524f[_0x9e18('0x60')],'outboundDropCallsDayACS':_0x15524f[_0x9e18('0x61')],'outboundDropCallsDayCallersExit':_0x15524f['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x15524f[_0x9e18('0x62')],'outboundNoAnswerCallsDay':_0x15524f[_0x9e18('0x63')],'outboundNoSuchCallsDay':_0x15524f[_0x9e18('0x64')],'outboundOriginateFailureCallsDay':_0x15524f[_0x9e18('0x65')],'outboundReCallsDay':_0x15524f[_0x9e18('0x66')],'outboundRejectCallsDay':_0x15524f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x15524f[_0x9e18('0x67')],'predictiveIntervalAnsweredCalls':_0x15524f[_0x9e18('0x68')],'predictiveIntervalAvgHoldtime':_0x15524f[_0x9e18('0x69')],'predictiveIntervalAvgTalktime':_0x15524f[_0x9e18('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x15524f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x15524f[_0x9e18('0x6b')],'predictiveIntervalErlangCalls':_0x15524f[_0x9e18('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x15524f[_0x9e18('0x6d')],'predictiveIntervalHitRate':_0x15524f[_0x9e18('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x15524f[_0x9e18('0x6f')],'predictiveIntervalPauses':_0x15524f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x15524f[_0x9e18('0x70')],'predictiveIntervalTotalCalls':_0x15524f[_0x9e18('0x71')],'message':_0x15524f[_0x9e18('0x3c')],'originated':_0x15524f[_0x9e18('0x72')],'erlangCalls':_0x15524f[_0x9e18('0x73')],'erlangCallToSecond':_0x15524f['erlangCallToSecond'],'erlangAbandonmentRate':_0x15524f['erlangAbandonmentRate'],'erlangBusyFactor':_0x15524f['erlangBusyFactor'],'startPredictive':_0x15524f['startPredictive'],'startProgressive':_0x15524f[_0x9e18('0x28')]};if(_0x15524f[_0x9e18('0x74')]){_0x41cf02[_0x9e18('0x74')]={'id':_0x15524f[_0x9e18('0x74')]['id'],'name':_0x15524f[_0x9e18('0x74')]['name'],'active':_0x15524f[_0x9e18('0x74')][_0x9e18('0x75')],'callerid':_0x15524f[_0x9e18('0x74')][_0x9e18('0x76')]};}if(_0x15524f['Interval']){_0x41cf02['Interval']={'id':_0x15524f[_0x9e18('0x42')]['id'],'name':_0x15524f[_0x9e18('0x42')][_0x9e18('0x3e')]};}var _0x28a370=md5(JSON[_0x9e18('0x48')](_0x41cf02));if(_0x15524f[_0x9e18('0x3')]!==_0x28a370){_0x15524f['md5']=_0x28a370;emit(util[_0x9e18('0x77')]('voice:queue:%s',_0x41cf02[_0x9e18('0x3e')]),_0x9e18('0x78'),_0x41cf02);}}}function emitCampaignSummary(_0x344b62){if(_0x344b62[_0x9e18('0x4d')]===_0x9e18('0x79')){emit(util[_0x9e18('0x77')](_0x9e18('0x7a'),_0x344b62[_0x9e18('0x3e')]),_0x9e18('0x7b'),_0x344b62);}}function checkGetDataPredictive(_0x342b7a){if(isNotNull(_0x342b7a)&&!_[_0x9e18('0x7c')](_0x342b7a)){loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x7e'));loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x7f'),_0x342b7a['predictiveIntervalTotalCalls']);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x80'),_0x342b7a[_0x9e18('0x68')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x81'),_0x342b7a['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x82'),_0x342b7a[_0x9e18('0x83')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x84'),_0x342b7a[_0x9e18('0x69')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x85'),_0x342b7a[_0x9e18('0x6a')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x86'));if(_0x342b7a[_0x9e18('0x71')]>0x0){if(!_[_0x9e18('0x87')](_0x342b7a[_0x9e18('0x6a')])&&_0x342b7a[_0x9e18('0x6a')]>0x0){return!![];}loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x88'));if(!_[_0x9e18('0x87')](_0x342b7a[_0x9e18('0x69')])&&_0x342b7a[_0x9e18('0x69')]>0x0){return!![];}loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x89'));}else{loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8a'));}}else{loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8b'));}return![];}function mergeDataErlangB(_0x3e6d71){return function(_0x5b2f8d){loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8c'));loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8d'),_0x5b2f8d[_0x9e18('0x73')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8e'),_0x5b2f8d['erlangCallToSecond']);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8f'),_0x5b2f8d[_0x9e18('0x90')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x91'),_0x5b2f8d[_0x9e18('0x92')]);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x8f'),_0x5b2f8d[_0x9e18('0x90')]);loggerPredictive['info'](_0x9e18('0x86'));_[_0x9e18('0x93')](_0x3e6d71,_0x5b2f8d);};}function getDiff(_0x4972ce){var _0x354862=moment()[_0x9e18('0x49')](0x0);var _0x3ac52e=moment(_0x4972ce)[_0x9e18('0x49')](0x0);return _0x354862[_0x9e18('0x4a')](_0x3ac52e,_0x9e18('0x4b'));}function ifInterval(_0x2a2b62,_0x47679b){if(_[_0x9e18('0x87')](_0x47679b)){return![];}return getDiff(_0x47679b)<_0x2a2b62*0x3c;}function freeVariablesPredictive(_0x4c6545){if(isNotNull(_0x4c6545)){if(!_[_0x9e18('0x87')](_0x4c6545[_0x9e18('0x28')])){_0x4c6545[_0x9e18('0x28')]=undefined;loggerPredictive[_0x9e18('0x7d')](_0x4c6545['name'],_0x9e18('0x94'));}if(!_['isUndefined'](_0x4c6545[_0x9e18('0x27')])){_0x4c6545[_0x9e18('0x27')]=undefined;loggerPredictive[_0x9e18('0x7d')](_0x4c6545[_0x9e18('0x3e')],_0x9e18('0x95'));}if(!_[_0x9e18('0x87')](_0x4c6545[_0x9e18('0x96')])){clearInterval(_0x4c6545[_0x9e18('0x96')]);_0x4c6545['handlePredictive']=undefined;loggerPredictive[_0x9e18('0x7d')](_0x4c6545[_0x9e18('0x3e')],_0x9e18('0x97'));}}}function erlangb(_0xae3ae3,_0x540259){if(_0x540259===0x0){return 0x0;}var _0x4abb78=0x1;for(var _0x4327e9=0x1;_0x4327e9<=_0x540259;_0x4327e9+=0x1){_0x4abb78=0x1+_0x4abb78*_0x4327e9/_0xae3ae3;}return 0x1/_0x4abb78;}function isVoiceQueueOutbound(_0x21f734){return _0x21f734===_0x9e18('0x4e');}function isNotPreview(_0x1b3fe8){return _0x1b3fe8!==_0x9e18('0x1d');}function isCampaignIvr(_0xc68670){return _0xc68670==='ivr';}function getCallerId(_0x58bdae,_0x2c341a,_0x40ac17){if(!_[_0x9e18('0x87')](_0x40ac17)&&typeof _0x40ac17===_0x9e18('0x98')&&!_[_0x9e18('0x7c')](_0x40ac17)){if(!_[_0x9e18('0x87')](_0x2c341a)&&typeof _0x2c341a==='string'&&!_[_0x9e18('0x7c')](_0x2c341a)){return util['format']('\x22%s\x22\x20<%s>',_0x2c341a,_0x40ac17);}return util['format']('\x22%s\x22\x20<%s>',_0x40ac17,_0x40ac17);}if(!_[_0x9e18('0x87')](_0x58bdae)&&typeof _0x58bdae===_0x9e18('0x98')&&!_[_0x9e18('0x7c')](_0x58bdae)){return _0x58bdae;}return _0x9e18('0x99');}function loggerCatchQueueSummary(_0x2592da,_0xd083f9){return function(_0x46bd89){freeVariablesPredictive(_0xd083f9);emitVoiceQueueSummary(_0xd083f9);emitCampaignSummary(_0xd083f9);loggerSyncQueueSummary['error'](_0x2592da,util[_0x9e18('0x9a')](_0x46bd89,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1e241d,_0x569cf5){return function(_0x52a6ef){loggerPredictive['error'](_0x569cf5['name'],_0x1e241d);loggerPredictive[_0x9e18('0x9b')](_0x52a6ef[_0x9e18('0x9c')]);freeVariablesPredictive(_0x569cf5);};}function loggerCatch(_0x1fffbe){return function(_0x1e5312){logger['error'](_0x1fffbe,util['inspect'](_0x1e5312,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xc973f4){return _0xc973f4&&!_[_0x9e18('0x87')](_0xc973f4)&&_0xc973f4[_0x9e18('0x9d')]>0x0;}function decremetOriginate(_0x3ffd6b){if(!_['isUndefined'](_0x3ffd6b)&&_0x3ffd6b!==null){if(typeof _0x3ffd6b['originated']!=='undefined'){if(_0x3ffd6b[_0x9e18('0x72')]>0x0){_0x3ffd6b['originated']-=0x1;}else{logger[_0x9e18('0x9b')](_0x9e18('0x9e'));}}}else{logger[_0x9e18('0x9b')](_0x9e18('0x9f'));}}function checkContactLowerLimitOriginate(_0x1d7a2b,_0x1a676a,_0x3d4c3d){if(_0x1a676a>_0x3d4c3d){for(var _0x3e49d1=0x0;_0x3e49d1<_0x1a676a-_0x3d4c3d;_0x3e49d1+=0x1){decremetOriginate(_0x1d7a2b);}}}function loggerGetContactDialer(_0xf60714,_0x5217bd,_0x11439f){return function(_0x4e3146){checkContactLowerLimitOriginate(_0x5217bd,_0x11439f,0x0);logger['error'](_0xf60714,util[_0x9e18('0x9a')](_0x4e3146,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x38be8c){return function(_0x2bacec){if(isNotNull(_0x2bacec)&&isNotNull(_0x2bacec[0x0])){if(_0x2bacec[0x0][_0x9e18('0xa0')]>0x0){_0x38be8c[_0x9e18('0x3c')]='RESCHEDULED_CONTACTS';logger[_0x9e18('0x7d')](_0x9e18('0xa1')+_0x38be8c[_0x9e18('0x3e')],_0x2bacec[0x0]['contactsRescheduled'],_0x9e18('0xa2'));}else{_0x38be8c[_0x9e18('0x3c')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x9e18('0x7d')]('[getContactDialer2][Empty]'+_0x38be8c['name']);}}};}function notSendMessagesQueue(_0x4f9876){if(_0x4f9876[_0x9e18('0xa3')]){freeVariablesPredictive(_0x4f9876);if(_0x4f9876[_0x9e18('0x72')]===0x0&&_0x4f9876['talking']===0x0&&_0x4f9876[_0x9e18('0x59')]===0x0&&(_0x4f9876[_0x9e18('0x52')]||0x0)===0x0){_0x4f9876[_0x9e18('0xa3')]=![];_0x4f9876['available']=0x0;_0x4f9876['message']=_0x9e18('0x40');loggerSyncQueueSummary['error'](_0x9e18('0xa4'),_0x4f9876[_0x9e18('0x3e')],'is\x20not\x20active');}else{_0x4f9876[_0x9e18('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x9e18('0x9b')](_0x9e18('0xa4'),_0x4f9876['name'],_0x9e18('0xa5'));}emitVoiceQueueSummary(_0x4f9876);}}function notSendMessagesCampaign(_0x2a25d5){if(_0x2a25d5['sendMessageOneNotActive']){if(_0x2a25d5[_0x9e18('0x72')]===0x0){_0x2a25d5[_0x9e18('0xa3')]=![];_0x2a25d5[_0x9e18('0x3c')]=_0x9e18('0x40');loggerSyncQueueSummary[_0x9e18('0x9b')](_0x9e18('0xa6'),_0x2a25d5[_0x9e18('0x3e')],_0x9e18('0xa7'));}else{_0x2a25d5[_0x9e18('0x3c')]=_0x9e18('0xa8');loggerSyncQueueSummary[_0x9e18('0x9b')](_0x9e18('0xa6'),_0x2a25d5[_0x9e18('0x3e')],'is\x20disactive');}emitCampaignSummary(_0x2a25d5);}}function createObjHistory(_0x5d5919,_0x39e915,_0x21d023,_0x5c1699,_0x19f9cb){_0x5d5919[_0x9e18('0x3c')]=_0x21d023;var _0x1bc44c=new Action(_0x5d5919,_0x39e915);var _0x21bc20=new History(_0x1bc44c);_0x21bc20[_0x9e18('0xa9')]=_0x5c1699;_0x21bc20['statedesc']=_0x19f9cb;_0x21bc20['endtime']=_0x1bc44c[_0x9e18('0xaa')];return _0x21bc20;}Dialer[_0x9e18('0x1a')]['loopClearZombieChannels']=function(){var _0x18a6ac=this;setInterval(function(){_0x18a6ac[_0x9e18('0xab')](_0x18a6ac[_0x9e18('0x25')],_0x9e18('0xac'));_0x18a6ac['clearZombieChannels'](_0x18a6ac[_0x9e18('0x23')],'[actions]');},0x32c8);};Dialer[_0x9e18('0x1a')][_0x9e18('0xab')]=function(_0x284ac0,_0x13fe3d){var _0x1d4e7c=this;for(var _0x3d3d02 in _0x284ac0){if(typeof _0x284ac0[_0x3d3d02]!==_0x9e18('0xad')){this[_0x9e18('0x1c')]['enqueue'](function(){if(!_[_0x9e18('0xae')](_0x284ac0[_0x3d3d02])){return ami[_0x9e18('0xaf')]({'action':_0x9e18('0xb0'),'channel':_0x284ac0[_0x3d3d02][_0x9e18('0xb1')]})['catch'](function(_0x5ef309){if(_0x5ef309[_0x9e18('0x3c')]===_0x9e18('0xb2')){setTimeout(function(){if(_0x284ac0[_0x3d3d02]&&_0x284ac0[_0x3d3d02][_0x9e18('0x4d')]!==_0x9e18('0x79')){_0x1d4e7c[_0x9e18('0xb3')](_0x1d4e7c[_0x9e18('0xb4')][_0x284ac0[_0x3d3d02][_0x9e18('0xb5')]]);logger[_0x9e18('0x9b')](_0x9e18('0xb6'),_0x13fe3d,_0x3d3d02,_0x284ac0[_0x3d3d02][_0x9e18('0xb5')]);delete _0x284ac0[_0x3d3d02];}if(_0x284ac0[_0x3d3d02]&&_0x284ac0[_0x3d3d02][_0x9e18('0x4d')]===_0x9e18('0x79')){_0x1d4e7c[_0x9e18('0xb3')](_0x1d4e7c['campaigns'][_0x284ac0[_0x3d3d02][_0x9e18('0xb5')]]);logger[_0x9e18('0x9b')]('[Dialer][checkChannel][ivr]',_0x13fe3d,_0x3d3d02,_0x284ac0[_0x3d3d02][_0x9e18('0xb5')]);delete _0x284ac0[_0x3d3d02];}},0x2328);}});}});}}};Dialer[_0x9e18('0x1a')][_0x9e18('0xb7')]=function(_0x42ad24){return BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](cmHopper[_0x9e18('0xb7')](_0x42ad24))['catch'](loggerCatch(_0x9e18('0xba')));};Dialer['prototype'][_0x9e18('0xbb')]=function(_0x21a376){return BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](cmHopperBlack[_0x9e18('0xbb')](_0x21a376))[_0x9e18('0xbc')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x4e5930){return BPromise[_0x9e18('0xb8')]()['then'](cmHopperBlack[_0x9e18('0xbd')](_0x4e5930))['catch'](loggerCatch(_0x9e18('0xbe')));};Dialer['prototype'][_0x9e18('0xbf')]=function(_0x10e483){return BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](cmHopperHistory[_0x9e18('0xc0')](_0x10e483))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x9e18('0x1a')]['rescheduleContact']=function(_0x5b1e22){return BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](cmHopper[_0x9e18('0xc1')](_0x5b1e22))[_0x9e18('0xbc')](loggerCatch(_0x9e18('0xc2')));};Dialer[_0x9e18('0x1a')]['unlockContact']=function(_0xfe19ae,_0x10b73d,_0x538ea0){return BPromise[_0x9e18('0xb8')]()['then'](cmHopper[_0x9e18('0xc3')](_0xfe19ae,_0x10b73d,_0x538ea0))[_0x9e18('0xbc')](loggerCatch(_0x9e18('0xc4')));};Dialer[_0x9e18('0x1a')]['getContactDialer']=function(_0x48375a,_0x25e713,_0x4bbdc5,_0x49cad4,_0x3aa08c){return BPromise[_0x9e18('0xb8')]()['then'](cmHopper['getContactDialer'](_0x48375a,_0x25e713,_0x4bbdc5,_0x49cad4))[_0x9e18('0xbc')](function(_0x3bd903){_0x3aa08c['temp']-=_0x4bbdc5;_0x3aa08c['temp']=_0x3aa08c[_0x9e18('0xc5')]>0x0?_0x3aa08c['temp']:0x0;loggerCatch(_0x9e18('0xc6'))(_0x3bd903);});};Dialer['prototype'][_0x9e18('0xc7')]=function(_0x2e89d1,_0x5b2324,_0x1aefc5,_0x50d3e8){return BPromise['resolve']()[_0x9e18('0xb9')](cmHopper[_0x9e18('0xc7')](_0x2e89d1,_0x5b2324,_0x1aefc5))[_0x9e18('0xbc')](function(_0x47c1db){_0x50d3e8['temp']-=_0x5b2324;_0x50d3e8['temp']=_0x50d3e8['temp']>0x0?_0x50d3e8[_0x9e18('0xc5')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x47c1db);});};Dialer[_0x9e18('0x1a')][_0x9e18('0xc8')]=function(_0x127a2c){return BPromise['resolve']()[_0x9e18('0xb9')](voiceQueueRt['getVoiceQueueRtPauses'](_0x127a2c))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x9e18('0x1a')][_0x9e18('0xc9')]=function(_0x2f6bc6){return BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](cmHopper[_0x9e18('0xc9')](_0x2f6bc6))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x9e18('0x1a')][_0x9e18('0xca')]=function(_0xe615ce){return BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](cmHopperHistory[_0x9e18('0xca')](_0xe615ce))[_0x9e18('0xbc')](loggerCatch(_0x9e18('0xcb')));};Dialer[_0x9e18('0x1a')][_0x9e18('0xb3')]=function(_0x180276){if(!_['isUndefined'](_0x180276)&&_0x180276!==null){if(typeof _0x180276[_0x9e18('0x72')]!=='undefined'){if(_0x180276[_0x9e18('0x72')]>0x0){_0x180276[_0x9e18('0x72')]-=0x1;}else{logger[_0x9e18('0x9b')](_0x9e18('0xcc'));}}}else{logger[_0x9e18('0x9b')](_0x9e18('0xcd'));}};Dialer['prototype'][_0x9e18('0xce')]=function(_0x593809,_0x1c261b){var _0x210f6e=this;return function(_0x234a64){_0x210f6e[_0x9e18('0xb3')](_0x1c261b);logger[_0x9e18('0x9b')](_0x593809,util['inspect'](_0x234a64,{'showHidden':![],'depth':null}));};};Dialer[_0x9e18('0x1a')][_0x9e18('0xcf')]=function(_0x132a45,_0x595551,_0x3db36b){var _0x597ce4={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x595551);this[_0x9e18('0xd0')](_[_0x9e18('0x93')](_0x597ce4,_[_0x9e18('0xd1')](_0x3db36b,[_0x9e18('0xd2'),_0x9e18('0xd3'),'UserId',_0x9e18('0xd4'),_0x9e18('0xd5')])),'[emptyContact][createHistory]',_0x9e18('0xd6'));logger[_0x9e18('0x9b')](_0x132a45);};Dialer[_0x9e18('0x1a')][_0x9e18('0xd7')]=function(_0x4ff729){return _0x4ff729==='Success';};Dialer[_0x9e18('0x1a')][_0x9e18('0xd8')]=function(_0x37467b){return!_[_0x9e18('0x87')](_0x37467b)&&_0x37467b&&!_[_0x9e18('0x87')](_0x37467b[_0x9e18('0x3e')])&&!_['isUndefined'](_0x37467b[_0x9e18('0x75')])&&_0x37467b[_0x9e18('0x75')]&&(this['trunks'][util['format'](_0x9e18('0xd9'),_0x37467b['name'])]['status']==='reachable'||this[_0x9e18('0x20')][util[_0x9e18('0x77')]('SIP/%s',_0x37467b[_0x9e18('0x3e')])][_0x9e18('0xb0')]==='unmonitored');};Dialer[_0x9e18('0x1a')][_0x9e18('0xd0')]=function(_0x5c5173,_0x2ee383,_0x210fc8){this[_0x9e18('0xca')](_0x5c5173)[_0x9e18('0xbc')](loggerCatch(_0x2ee383));this[_0x9e18('0xc9')](_0x5c5173)[_0x9e18('0xbc')](loggerCatch(_0x210fc8));};Dialer[_0x9e18('0x1a')][_0x9e18('0x36')]=function(_0x25dce0){var _0xf24544=this[_0x9e18('0x25')][_0x25dce0[_0x9e18('0xda')]];var _0x1a7373;if(!_['isNil'](_0x25dce0)&&!_[_0x9e18('0xae')](_0x25dce0[_0x9e18('0xdb')])&&!_[_0x9e18('0xae')](_0x25dce0[_0x9e18('0xdb')][_0x9e18('0xdc')])&&_0x25dce0[_0x9e18('0xdd')]===_0x9e18('0xde')&&_0xf24544){if(_0xf24544[_0x9e18('0x4d')]!==_0x9e18('0x79')&&this[_0x9e18('0xb4')][_0xf24544[_0x9e18('0xb5')]][_0x9e18('0xdf')]&&_0x25dce0[_0x9e18('0xe0')]===_0x9e18('0xe1')){delete this['uniqueId'][_0x25dce0[_0x9e18('0xda')]];this['updateOriginated'](this[_0x9e18('0xb4')][_0xf24544['queue']]);this[_0x9e18('0xb4')][_0xf24544[_0x9e18('0xb5')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0xf24544[_0x9e18('0xb5')]][_0x9e18('0x5e')]+=0x1;_0x1a7373=new Hangup(_0xf24544,_0x25dce0);_0x1a7373[_0x9e18('0xa9')]=0x12;_0x1a7373['statedesc']='HangupInAMD';_0x1a7373['membername']=_0x9e18('0xe2');ami[_0x9e18('0x4c')](_0x9e18('0xe3'),ut[_0x9e18('0xe4')](_0x1a7373,_0x9e18('0xe5')));this['saveInDb'](_0x1a7373,_0x9e18('0xe6'),_0x9e18('0xe7'));}if(_0xf24544[_0x9e18('0x4d')]!==_0x9e18('0x79')&&this['voiceQueues'][_0xf24544[_0x9e18('0xb5')]][_0x9e18('0xdf')]&&_0x25dce0[_0x9e18('0xe0')]===_0x9e18('0xe8')){var _0x57dfa6=this;return new BPromise(function(_0x5412ae,_0x35276d){delete _0x57dfa6[_0x9e18('0x25')][_0x25dce0[_0x9e18('0xda')]];_0x57dfa6['updateOriginated'](_0x57dfa6[_0x9e18('0xb4')][_0xf24544[_0x9e18('0xb5')]]);_0x57dfa6[_0x9e18('0xb4')][_0xf24544['queue']][_0x9e18('0xe9')]+=0x1;_0x57dfa6[_0x9e18('0xb4')][_0xf24544[_0x9e18('0xb5')]][_0x9e18('0x5e')]+=0x1;var _0x20b465=_0x57dfa6[_0x9e18('0xb4')][_0xf24544[_0x9e18('0xb5')]];var _0x5549ba=new Hangup(_0xf24544,_0x25dce0);_0x5549ba['state']=0x13;_0x5549ba['statedesc']=_0x9e18('0xea');_0x5549ba['membername']='AMD';_0x5549ba[_0x9e18('0xeb')]+=0x1;_0x5549ba['countglobal']+=0x1;_0x5549ba[_0x9e18('0xe5')]=!![];ami['emit'](_0x9e18('0xe3'),ut['buildObj'](_0x5549ba,'amd'));_0x57dfa6['createHistory'](_0x5549ba)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0xec')));if(_0x5549ba[_0x9e18('0xed')]+_0x5549ba[_0x9e18('0xee')]+_0x5549ba['countnoanswerretry']+_0x5549ba['countnosuchnumberretry']+_0x5549ba[_0x9e18('0xef')]+_0x5549ba[_0x9e18('0xf0')]+_0x5549ba[_0x9e18('0xeb')]+_0x5549ba[_0x9e18('0xf1')]>=_0x20b465[_0x9e18('0xf2')]){_0x57dfa6[_0x9e18('0xf3')](_0x5549ba,_0x5412ae,_0x35276d,_0x9e18('0xf4'));}else{if(_0x5549ba[_0x9e18('0xeb')]>=_0x20b465[_0x9e18('0xf5')]){_0x57dfa6[_0x9e18('0xf6')](_0x5549ba,_0x5412ae,_0x35276d,_0x9e18('0xf7'));}else{_0x57dfa6['rescheduleContact']({'active':![],'countmachineretry':_0x5549ba['countmachineretry'],'scheduledat':moment()['add'](_0x20b465[_0x9e18('0xf8')],_0x9e18('0xf9'))[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x5549ba['ContactId'],'ListId':_0x5549ba[_0x9e18('0xd3')],'VoiceQueueId':_0x5549ba[_0x9e18('0xd4')]||undefined,'CampaignId':_0x5549ba[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x5412ae({'reschedule':0x1});}}});}if(_0xf24544[_0x9e18('0x4d')]===_0x9e18('0x79')&&this[_0x9e18('0x1e')][_0xf24544[_0x9e18('0xb5')]][_0x9e18('0xdf')]&&_0x25dce0[_0x9e18('0xe0')]===_0x9e18('0xe1')){delete this[_0x9e18('0x25')][_0x25dce0[_0x9e18('0xda')]];this[_0x9e18('0xb3')](this['campaigns'][_0xf24544[_0x9e18('0xb5')]]);_0x1a7373=new Hangup(_0xf24544,_0x25dce0);_0x1a7373[_0x9e18('0xa9')]=0x12;_0x1a7373[_0x9e18('0xfb')]=_0x9e18('0xfc');_0x1a7373[_0x9e18('0xfd')]=_0x9e18('0xe2');ami[_0x9e18('0x4c')](_0x9e18('0xe3'),ut[_0x9e18('0xe4')](_0x1a7373,_0x9e18('0xe5')));this['saveInDb'](_0x1a7373,'[syncHangupInAMDIvr][createHistory]',_0x9e18('0xfe'));}if(_0xf24544[_0x9e18('0x4d')]===_0x9e18('0x79')&&this[_0x9e18('0x1e')][_0xf24544['queue']][_0x9e18('0xdf')]&&_0x25dce0[_0x9e18('0xe0')]===_0x9e18('0xe8')){var _0x57dfa6=this;return new BPromise(function(_0xb3645e,_0x4cf876){delete _0x57dfa6[_0x9e18('0x25')][_0x25dce0[_0x9e18('0xda')]];_0x57dfa6[_0x9e18('0xb3')](_0x57dfa6[_0x9e18('0x1e')][_0xf24544[_0x9e18('0xb5')]]);_0x57dfa6[_0x9e18('0x1e')][_0xf24544[_0x9e18('0xb5')]]['outboundAnswerCallsDay']+=0x1;_0x57dfa6['campaigns'][_0xf24544[_0x9e18('0xb5')]][_0x9e18('0x5e')]+=0x1;var _0x593048=_0x57dfa6[_0x9e18('0x1e')][_0xf24544[_0x9e18('0xb5')]];var _0xfbf5c=new Hangup(_0xf24544,_0x25dce0);_0xfbf5c[_0x9e18('0xa9')]=0x13;_0xfbf5c['statedesc']=_0x9e18('0xea');_0xfbf5c[_0x9e18('0xfd')]=_0x9e18('0xe2');_0xfbf5c[_0x9e18('0xeb')]+=0x1;_0xfbf5c[_0x9e18('0xff')]+=0x1;_0xfbf5c[_0x9e18('0xe5')]=!![];ami[_0x9e18('0x4c')](_0x9e18('0xe3'),ut[_0x9e18('0xe4')](_0xfbf5c,_0x9e18('0xe5')));_0x57dfa6[_0x9e18('0xca')](_0xfbf5c)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0xec')));if(_0xfbf5c[_0x9e18('0xed')]+_0xfbf5c[_0x9e18('0xee')]+_0xfbf5c[_0x9e18('0x100')]+_0xfbf5c[_0x9e18('0x101')]+_0xfbf5c[_0x9e18('0xef')]+_0xfbf5c[_0x9e18('0xf0')]+_0xfbf5c[_0x9e18('0xeb')]+_0xfbf5c[_0x9e18('0xf1')]>=_0x593048['dialGlobalMaxRetry']){_0x57dfa6[_0x9e18('0xf3')](_0xfbf5c,_0xb3645e,_0x4cf876,_0x9e18('0xf4'));}else{if(_0xfbf5c[_0x9e18('0xeb')]>=_0x593048[_0x9e18('0xf5')]){_0x57dfa6[_0x9e18('0xf6')](_0xfbf5c,_0xb3645e,_0x4cf876,_0x9e18('0xf7'));}else{_0x57dfa6[_0x9e18('0xc1')]({'active':![],'countmachineretry':_0xfbf5c[_0x9e18('0xeb')],'scheduledat':moment()[_0x9e18('0x102')](_0x593048['dialMachineRetryFrequency'],_0x9e18('0xf9'))['format'](_0x9e18('0xfa')),'ContactId':_0xfbf5c['ContactId'],'ListId':_0xfbf5c[_0x9e18('0xd3')],'VoiceQueueId':_0xfbf5c[_0x9e18('0xd4')]||undefined,'CampaignId':_0xfbf5c[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0xb3645e({'reschedule':0x1});}}});}}};Dialer[_0x9e18('0x1a')][_0x9e18('0x103')]=function(_0x314021){var _0x4174c6=this[_0x9e18('0x25')][_0x314021[_0x9e18('0xda')]];var _0x2f19ff=this;var _0x20a4af;if(_0x4174c6&&_0x4174c6[_0x9e18('0x4d')]===_0x9e18('0x79')){delete this['uniqueId'][_0x314021['uniqueid']];this[_0x9e18('0xb3')](this[_0x9e18('0x1e')][_0x4174c6['queue']]);this['campaigns'][_0x4174c6[_0x9e18('0xb5')]][_0x9e18('0x104')]+=0x1;_0x20a4af=new Hangup(_0x4174c6,_0x314021);this[_0x9e18('0xca')](_0x20a4af)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x105')));this[_0x9e18('0xc9')](_0x20a4af)[_0x9e18('0xbc')](loggerCatch('[syncHangupIvr]'));}if(_0x4174c6&&_0x4174c6[_0x9e18('0x4d')]!==_0x9e18('0x79')&&isNotNull(this['voiceQueues'][_0x4174c6[_0x9e18('0xb5')]][_0x9e18('0x106')])){delete this[_0x9e18('0x25')][_0x314021[_0x9e18('0xda')]];this[_0x9e18('0xb3')](this[_0x9e18('0xb4')][_0x4174c6[_0x9e18('0xb5')]]);this['voiceQueues'][_0x4174c6[_0x9e18('0xb5')]][_0x9e18('0xe9')]+=0x1;this['voiceQueues'][_0x4174c6[_0x9e18('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;_0x20a4af=new Hangup(_0x4174c6,_0x314021);_0x20a4af[_0x9e18('0xa9')]=0x10;_0x20a4af['statedesc']=_0x9e18('0x107');_0x20a4af[_0x9e18('0xfd')]=_0x9e18('0x108');this[_0x9e18('0xca')](_0x20a4af)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x105')));this[_0x9e18('0xc9')](_0x20a4af)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x109')));}if(_0x4174c6&&_0x4174c6['type']!==_0x9e18('0x79')&&!isNotNull(this[_0x9e18('0xb4')][_0x4174c6[_0x9e18('0xb5')]][_0x9e18('0x106')])){delete this['uniqueId'][_0x314021[_0x9e18('0xda')]];this['updateOriginated'](this[_0x9e18('0xb4')][_0x4174c6[_0x9e18('0xb5')]]);this[_0x9e18('0xb4')][_0x4174c6[_0x9e18('0xb5')]][_0x9e18('0x67')]+=0x1;_0x20a4af=new Hangup(_0x4174c6,_0x314021);_0x20a4af[_0x9e18('0xa9')]=0xc;_0x20a4af[_0x9e18('0xfb')]=_0x314021[_0x9e18('0x10a')];_0x20a4af['membername']=_0x9e18('0x10b');this[_0x9e18('0xca')](_0x20a4af)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x105')));this[_0x9e18('0xc9')](_0x20a4af)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x109')));}};Dialer[_0x9e18('0x1a')][_0x9e18('0x31')]=function(_0x130555){var _0x4a073f=this[_0x9e18('0x25')][_0x130555['uniqueid']];var _0x4cc861=this;if(this[_0x9e18('0xb4')][_0x130555[_0x9e18('0xb5')]]){if(_0x4a073f&&_0x4a073f['type']!==_0x9e18('0x79')){delete this[_0x9e18('0x25')][_0x130555[_0x9e18('0xda')]];this[_0x9e18('0xb4')][_0x130555[_0x9e18('0xb5')]]['outboundAnswerCallsDay']+=0x1;var _0x151043=new AgentComplete(_0x4a073f,_0x130555);if(_0x130555[_0x9e18('0x10c')]==='agent'){_0x151043[_0x9e18('0x10d')]=this[_0x9e18('0xb4')][_0x130555[_0x9e18('0xb5')]][_0x9e18('0x10e')]&&this[_0x9e18('0xb4')][_0x130555['queue']][_0x9e18('0x10f')]?moment()[_0x9e18('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x9e18('0xca')](_0x151043)[_0x9e18('0xbc')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x9e18('0xc9')](_0x151043)['catch'](loggerCatch(_0x9e18('0x110')));}}};Dialer['prototype'][_0x9e18('0x2c')]=function(_0x2565fc){if(this[_0x9e18('0xb4')][_0x2565fc[_0x9e18('0xb5')]]){if(this['uniqueId'][_0x2565fc['uniqueid']]&&this['uniqueId'][_0x2565fc[_0x9e18('0xda')]][_0x9e18('0x4d')]!==_0x9e18('0x79')){this[_0x9e18('0xb3')](this[_0x9e18('0xb4')][_0x2565fc[_0x9e18('0xb5')]]);this[_0x9e18('0x25')][_0x2565fc['uniqueid']]['answertime']=moment()[_0x9e18('0x77')](_0x9e18('0xfa'));}}};Dialer[_0x9e18('0x1a')][_0x9e18('0x111')]=function(_0x36e3c2){this[_0x9e18('0xca')](_0x36e3c2)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x112')));this[_0x9e18('0xc9')](_0x36e3c2)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x113')));};Dialer[_0x9e18('0x1a')]['syncQueueCallerAbandon']=function(_0x41a509){var _0x31ab2b=this[_0x9e18('0x25')][_0x41a509[_0x9e18('0xda')]];var _0x5b2689=this;if(this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]]){if(_0x31ab2b&&_0x31ab2b[_0x9e18('0x4d')]!=='ivr'){delete this[_0x9e18('0x25')][_0x41a509[_0x9e18('0xda')]];this[_0x9e18('0xb3')](this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]]);_0x31ab2b[_0x9e18('0x114')]=moment()[_0x9e18('0x77')](_0x9e18('0xfa'));var _0x6269c3=new QueueCallerAbandon(_0x31ab2b,_0x41a509);if(getSeconds(_0x31ab2b[_0x9e18('0x114')],_0x31ab2b[_0x9e18('0x115')])>=_0x31ab2b[_0x9e18('0x116')]){this[_0x9e18('0xb4')][_0x41a509['queue']][_0x9e18('0x6b')]+=0x1;this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]][_0x9e18('0x62')]+=0x1;this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]][_0x9e18('0x6d')]+=0x1;_0x6269c3['state']=0xa;_0x6269c3[_0x9e18('0xfb')]=_0x9e18('0x117');_0x6269c3[_0x9e18('0x118')]=_0x9e18('0x119');_0x6269c3[_0x9e18('0x10d')]=this['voiceQueues'][_0x41a509[_0x9e18('0xb5')]][_0x9e18('0x10e')]?moment()[_0x9e18('0x77')](_0x9e18('0xfa')):undefined;_0x6269c3[_0x9e18('0xef')]+=0x1;_0x6269c3[_0x9e18('0xff')]+=0x1;if(_0x6269c3[_0x9e18('0xef')]>=this['voiceQueues'][_0x41a509[_0x9e18('0xb5')]][_0x9e18('0x11a')]){this['queueCallerAbandonCreateState'](_0x6269c3);}else{this[_0x9e18('0xc1')]({'active':![],'countdropretry':_0x6269c3[_0x9e18('0xef')],'scheduledat':moment()[_0x9e18('0x102')](this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]]['dialDropRetryFrequency'],_0x9e18('0xf9'))[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x31ab2b['ContactId'],'ListId':_0x31ab2b[_0x9e18('0xd3')],'VoiceQueueId':_0x31ab2b[_0x9e18('0xd4')]||undefined,'CampaignId':_0x31ab2b['CampaignId']||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x11b')));var _0x58daec=new History(_0x6269c3);_0x58daec[_0x9e18('0xa9')]=0xa;_0x58daec['statedesc']=_0x9e18('0x117');_0x58daec['starttime']=moment()[_0x9e18('0x77')](_0x9e18('0xfa'));_0x58daec['endtime']=_0x58daec[_0x9e18('0xaa')];_0x58daec['calleridname']=_0x6269c3[_0x9e18('0x11c')];_0x58daec[_0x9e18('0x11d')]=_0x6269c3[_0x9e18('0x11d')];this['createHistory'](_0x58daec)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]]['outboundDropCallsDayCallersExit']+=0x1;_0x6269c3['state']=0xb;_0x6269c3[_0x9e18('0xfb')]=_0x9e18('0x11e');_0x6269c3['dropreason']=_0x9e18('0x11f');_0x6269c3[_0x9e18('0xf0')]+=0x1;_0x6269c3[_0x9e18('0xff')]+=0x1;if(_0x6269c3[_0x9e18('0xf0')]>=this[_0x9e18('0xb4')][_0x41a509[_0x9e18('0xb5')]][_0x9e18('0x120')]){this[_0x9e18('0x111')](_0x6269c3);}else{this[_0x9e18('0xc1')]({'active':![],'countabandonedretry':_0x6269c3[_0x9e18('0xf0')],'scheduledat':moment()[_0x9e18('0x102')](this[_0x9e18('0xb4')][_0x41a509['queue']]['dialAbandonedRetryFrequency'],_0x9e18('0xf9'))['format'](_0x9e18('0xfa')),'ContactId':_0x31ab2b[_0x9e18('0xd2')],'ListId':_0x31ab2b[_0x9e18('0xd3')],'VoiceQueueId':_0x31ab2b[_0x9e18('0xd4')]||undefined,'CampaignId':_0x31ab2b['CampaignId']||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x121')));var _0x58daec=new History(_0x6269c3);_0x58daec[_0x9e18('0xa9')]=0xb;_0x58daec[_0x9e18('0xfb')]='Abandoned';_0x58daec['starttime']=moment()['format'](_0x9e18('0xfa'));_0x58daec['endtime']=_0x58daec[_0x9e18('0xaa')];_0x58daec[_0x9e18('0x11c')]=_0x6269c3['calleridname'];_0x58daec[_0x9e18('0x11d')]=_0x6269c3[_0x9e18('0x11d')];this[_0x9e18('0xca')](_0x58daec)['catch'](loggerCatch(_0x9e18('0x122')));}}}}};Dialer['prototype'][_0x9e18('0x34')]=function(_0x227606){if(this[_0x9e18('0x23')][_0x227606[_0x9e18('0xda')]]){this['actions'][_0x227606[_0x9e18('0xda')]][_0x9e18('0xb1')]=_0x227606[_0x9e18('0xb1')];}if(this[_0x9e18('0x25')][_0x227606['uniqueid']]){this[_0x9e18('0x25')][_0x227606[_0x9e18('0xda')]]['channel']=_0x227606['channel'];}};Dialer[_0x9e18('0x1a')][_0x9e18('0x38')]=function(_0x5d3e91){if(strategy[this[_0x9e18('0xb4')][this[_0x9e18('0x23')][_0x5d3e91[_0x9e18('0x123')]]['queue']]['strategy']]===_0x9e18('0x19')){if(this[_0x9e18('0x23')][_0x5d3e91['actionid']]&&_['isNil'](this[_0x9e18('0x23')][_0x5d3e91[_0x9e18('0x123')]]['locked'])&&_0x5d3e91['status']==='1'&&_0x5d3e91['paused']==='0'){if(this['agents'][_0x5d3e91[_0x9e18('0x124')]]){if(!this['agents'][_0x5d3e91[_0x9e18('0x124')]][_0x9e18('0x125')]){this[_0x9e18('0x1f')][_0x5d3e91[_0x9e18('0x124')]][_0x9e18('0x125')]=!![];this[_0x9e18('0x23')][_0x5d3e91[_0x9e18('0x123')]][_0x9e18('0x125')]=!![];this[_0x9e18('0x23')][_0x5d3e91[_0x9e18('0x123')]][_0x9e18('0x124')]=_0x5d3e91['stateinterface'];}}}}else if((strategy[this[_0x9e18('0xb4')][this['actions'][_0x5d3e91['actionid']]['queue']][_0x9e18('0x4f')]]||_0x9e18('0x18'))===_0x9e18('0x18')){if(this[_0x9e18('0x23')][_0x5d3e91['actionid']]){if(this[_0x9e18('0x1f')][_0x5d3e91[_0x9e18('0x124')]]){this[_0x9e18('0x23')][_0x5d3e91[_0x9e18('0x123')]][_0x9e18('0x124')]=_0x5d3e91['stateinterface'];if(_[_0x9e18('0xae')](this['queueBooked'][this[_0x9e18('0x23')][_0x5d3e91['actionid']]['queue']])){this[_0x9e18('0x126')][this[_0x9e18('0x23')][_0x5d3e91[_0x9e18('0x123')]][_0x9e18('0xb5')]]=[];}this[_0x9e18('0x126')][this['actions'][_0x5d3e91[_0x9e18('0x123')]]['queue']][_0x9e18('0x127')](_[_0x9e18('0x93')](_[_0x9e18('0xd1')](this['actions'][_0x5d3e91[_0x9e18('0x123')]],[_0x9e18('0x128'),'stateinterface']),{'status':_0x5d3e91['status'],'paused':_0x5d3e91[_0x9e18('0x129')]}));}}}};function unlockQueueStatus(_0x204b92,_0x539dff){setTimeout(function(){if(_[_0x9e18('0x87')](_0x204b92[_0x9e18('0x12a')])){loggerBooked[_0x9e18('0x9b')]('[unlockQueueStatus][undefined]',_0x539dff);}_0x204b92[_0x9e18('0x12a')]=!![];loggerBooked[_0x9e18('0x7d')](_0x9e18('0x12b'),_0x539dff,JSON[_0x9e18('0x48')](_[_0x9e18('0xd1')](_0x204b92,[_0x9e18('0x3e'),_0x9e18('0x12a')])));},0x1f3);}Dialer[_0x9e18('0x1a')][_0x9e18('0x12c')]=function(_0x24160a){var _0x582af7=this;var _0x1e5caa=_0x582af7[_0x9e18('0xb4')][_0x582af7[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]];if(strategy[this[_0x9e18('0xb4')][this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]][_0x9e18('0x4f')]]==='roundrobin'){if(this['actions'][_0x24160a[_0x9e18('0x123')]]&&this[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0x124')]){this[_0x9e18('0x1d')][_0x9e18('0x12d')](this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0x128')],this[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0x124')])[_0x9e18('0xbc')](function(_0x145980){logger[_0x9e18('0x9b')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x9e18('0x9a')](_0x145980,{'showHidden':![],'depth':null}));})[_0x9e18('0x12e')](function(){_0x582af7['updateOriginated'](_0x582af7[_0x9e18('0xb4')][_0x582af7[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]]);_0x582af7[_0x9e18('0x1f')][_0x582af7['actions'][_0x24160a[_0x9e18('0x123')]][_0x9e18('0x124')]][_0x9e18('0x125')]=![];delete _0x582af7['actions'][_0x24160a[_0x9e18('0x123')]];unlockQueueStatus(_0x1e5caa);});}else{this[_0x9e18('0xb3')](this[_0x9e18('0xb4')][this['actions'][_0x24160a['actionid']][_0x9e18('0xb5')]]);this[_0x9e18('0xc1')]({'active':![],'ContactId':this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xd2')],'ListId':this['actions'][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xd3')],'VoiceQueueId':this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xd4')]||undefined,'CampaignId':this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]]['CampaignId']||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x12f')));delete this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]];unlockQueueStatus(_0x1e5caa);}}else if((strategy[this[_0x9e18('0xb4')][this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]][_0x9e18('0x4f')]]||_0x9e18('0x18'))===_0x9e18('0x18')){var _0x13d3b5;if(this['actions'][_0x24160a['actionid']]&&!_[_0x9e18('0x7c')](this[_0x9e18('0x126')][this[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0xb5')]])){if(this[_0x9e18('0x2a')][_0x582af7[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]]){this[_0x9e18('0x2a')][_0x582af7[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0xb5')]]=this[_0x9e18('0x2a')][this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]]?this['queueBookedRR'][this[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0xb5')]]:this[_0x9e18('0x126')][this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]]?this[_0x9e18('0x126')][this[_0x9e18('0x23')][_0x24160a[_0x9e18('0x123')]][_0x9e18('0xb5')]][_0x9e18('0x130')]||0x0:0x0;}this[_0x9e18('0x126')][this[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0xb5')]][_0x9e18('0x130')]=this[_0x9e18('0x2a')][this[_0x9e18('0x23')][_0x24160a['actionid']][_0x9e18('0xb5')]];for(var _0x5a4b8b=0x0;_0x5a4b8b=0x0;})[_0x9e18('0xbc')](myreject(_0x5a965f)));}}else{_0xaf5d05[_0x9e18('0x127')](ami[_0x9e18('0xaf')]({'action':_0x9e18('0x149'),'command':util[_0x9e18('0x77')](_0x9e18('0x14a'),_0x1f411f,!_[_0x9e18('0x87')](config[_0x9e18('0x146')][_0x10667a])?_0x10667a:'')})[_0x9e18('0xb9')](function(_0x32cd04){return _0x32cd04['content'][_0x9e18('0x14d')](_0x9e18('0x14c'))>=0x0;})[_0x9e18('0xbc')](myreject(_0x5a965f)));}BPromise['all'](_0xaf5d05)[_0x9e18('0xb9')](function(_0x4f3512){var _0x43e0ed=_[_0x9e18('0x14e')](_0x4f3512);if(_0x43e0ed){return _0x166f74(_0x43e0ed);}else{_0x4764c1['message']=_0x26927d?_0x9e18('0x14f'):'INTERVAL_IS_OVERTIME';return _0x5a965f(msgResponse('[ifTime][promiseAll]',_0x9e18('0x144'),'Global:\x20'+_0x26927d+'\x20'+_0x1e311d+_0x9e18('0x150')+util[_0x9e18('0x9a')](_0x1f411f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x10667a));}})['catch'](function(_0x4ec3ad){return _0x5a965f(msgResponse(_0x9e18('0x141'),_0x9e18('0x144'),JSON[_0x9e18('0x48')](_0x4ec3ad)));});});};Dialer[_0x9e18('0x1a')][_0x9e18('0x151')]=function(_0x264259){var _0x17a948=this;return function(){switch(_0x264259[_0x9e18('0x5c')]){case _0x9e18('0x152'):freeVariablesPredictive(_0x264259);_0x17a948[_0x9e18('0x153')](_0x264259,0x1);break;case _0x9e18('0x154'):freeVariablesPredictive(_0x264259);_0x17a948[_0x9e18('0x153')](_0x264259,_0x264259['dialPowerLevel']);break;case _0x9e18('0x155'):_0x17a948[_0x9e18('0x155')](_0x264259);break;case'booked':freeVariablesPredictive(_0x264259);_0x17a948['handlePower'](_0x264259,0x1);break;default:freeVariablesPredictive(_0x264259);logger[_0x9e18('0x9b')](_0x9e18('0x156'),_0x264259[_0x9e18('0x3e')],'method\x20not\x20recognized');}};};Dialer[_0x9e18('0x1a')]['launchHandleIvr']=function(_0x538000){var _0x287ea6=this;return function(){_0x287ea6[_0x9e18('0x157')](_0x538000);};};Dialer['prototype'][_0x9e18('0x158')]=function(_0x38911a){var _0x2e42f8=this;if(isNotPreview(_0x38911a[_0x9e18('0x5c')])){if(isVoiceQueueOutbound(_0x38911a[_0x9e18('0x4d')])&&isActive(_0x38911a[_0x9e18('0x5b')])){_0x38911a[_0x9e18('0xa3')]=!![];BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](checkIsLoggedIn(_0x38911a,_0x38911a[_0x9e18('0x159')]))[_0x9e18('0xb9')](checkIsActive(_0x38911a,_0x38911a['dialActive']))[_0x9e18('0xb9')](checkInterval(_0x38911a))[_0x9e18('0xb9')](_0x2e42f8[_0x9e18('0x13d')](_0x38911a))[_0x9e18('0xb9')](_0x2e42f8['checkIfTime'](_0x38911a[_0x9e18('0x15a')],_0x38911a[_0x9e18('0x15b')],_0x38911a[_0x9e18('0x3e')],_0x38911a))[_0x9e18('0xb9')](_0x2e42f8[_0x9e18('0x142')](_0x38911a[_0x9e18('0x42')],_0x38911a[_0x9e18('0x15b')],_0x38911a[_0x9e18('0x3e')],_0x38911a))[_0x9e18('0xb9')](_0x2e42f8['checkDialMethod'](_0x38911a))['catch'](loggerCatchQueueSummary(_0x9e18('0x15c'),_0x38911a));}else{notSendMessagesQueue(_0x38911a);}}else{freeVariablesPredictive(_0x38911a);}};Dialer[_0x9e18('0x1a')]['syncCampaigns']=function(){var _0x47355a=this;var _0x7284e5;for(var _0x5ebf30 in this[_0x9e18('0x1e')]){if(typeof this[_0x9e18('0x1e')][_0x5ebf30]!==_0x9e18('0xad')){_0x7284e5=this['campaigns'][_0x5ebf30];if(isCampaignIvr(_0x7284e5[_0x9e18('0x4d')])&&isActive(_0x7284e5[_0x9e18('0x75')])){_0x7284e5[_0x9e18('0xa3')]=!![];BPromise[_0x9e18('0xb8')]()[_0x9e18('0xb9')](checkIsActive(_0x7284e5,_0x7284e5['active']))[_0x9e18('0xb9')](checkInterval(_0x7284e5))[_0x9e18('0xb9')](_0x47355a['checkIsTrunkReachable'](_0x7284e5))[_0x9e18('0xb9')](_0x47355a['checkIfTime'](_0x7284e5[_0x9e18('0x15a')],_0x7284e5[_0x9e18('0x15b')],_0x7284e5[_0x9e18('0x3e')],_0x7284e5))[_0x9e18('0xb9')](_0x47355a['checkIfTimeIntervals'](_0x7284e5['Interval'],_0x7284e5[_0x9e18('0x15b')],_0x7284e5['name'],_0x7284e5))[_0x9e18('0xb9')](_0x47355a[_0x9e18('0x15d')](_0x7284e5))[_0x9e18('0xbc')](loggerCatchQueueSummary(_0x9e18('0x15e'),_0x7284e5));}else{notSendMessagesCampaign(_0x7284e5);}}}};function getCallerIdRandom(_0x3828b9,_0x1afc12){var _0x8225eb;var _0x49b9bd;var _0x71fa88;if(_0x1afc12<=0x0){_0x1afc12=0x1;}_0x8225eb=new RegExp(_0x9e18('0x15f')+_0x1afc12+'}$');_0x49b9bd=Math['pow'](0xa,_0x1afc12-0x1);_0x71fa88=Math[_0x9e18('0x160')](0xa,_0x1afc12)-0x1;return util[_0x9e18('0x77')]('%s',_['replace'](_0x3828b9,_0x8225eb,_[_0x9e18('0x161')](_0x49b9bd,_0x71fa88)));}function extractCalleridName(_0x3e9f8a){var _0x31f9ae=_0x3e9f8a[_0x9e18('0x162')](/"(.*?)"/);return _0x31f9ae?_0x31f9ae[0x1]:_0x3e9f8a;}function extractCalleridNumber(_0x389318){var _0x28975=_0x389318[_0x9e18('0x162')](/<(.*?)>/);return _0x28975?_0x28975[0x1]:_0x389318;}Dialer[_0x9e18('0x1a')]['actionOriginate']=function(_0x10fe29,_0x93cee8){var _0x424fff=this;var _0xa4e8c8=uuid['v4']();this[_0x9e18('0x23')][_0xa4e8c8]=new Action(_0x10fe29,_0x93cee8,_0xa4e8c8);return new BPromise(function(_0x30def4,_0x363d17){if(_['isUndefined'](_0x10fe29)&&typeof _0x10fe29!==_0x9e18('0x163')){return _0x363d17(msgResponse(_0x9e18('0x164'),_0x9e18('0x144'),'voiceQueue\x20is\x20undefine'));}if(_[_0x9e18('0x87')](_0x93cee8[_0x9e18('0x165')][_0x9e18('0x166')])||_0x93cee8[_0x9e18('0x165')][_0x9e18('0x166')]===null){return _0x363d17(msgResponse(_0x9e18('0x164'),'Failure',_0x9e18('0x167')));}var _0x4ffed2={'XMD-CALLERID':_0x424fff[_0x9e18('0x23')][_0xa4e8c8][_0x9e18('0x168')](),'XMD-AGI':_0x10fe29[_0x9e18('0x106')]?util[_0x9e18('0x77')](_0x9e18('0x169'),ipAgi,_0x10fe29[_0x9e18('0x106')]):'NONE','XMD-AGIAFTER':_0x10fe29[_0x9e18('0x10e')]?util[_0x9e18('0x77')](_0x9e18('0x169'),ipAgi,_0x10fe29[_0x9e18('0x10e')]):'NONE','XMD-QUEUE':_0x10fe29[_0x9e18('0x4d')]==='outbound'?util[_0x9e18('0x77')](_0x9e18('0x16a'),_0x10fe29[_0x9e18('0x3e')],_0x10fe29[_0x9e18('0x16b')]||'',_0x10fe29[_0x9e18('0x10f')]?'c':'',_0x10fe29['dialQueueTimeout']||0x3):_0x9e18('0x16c'),'XMD-CONTACTID':_0x93cee8[_0x9e18('0xd2')],'XMD-CDRTYPE':_0x9e18('0x6'),'CALLERID(all)':_0x424fff[_0x9e18('0x23')][_0xa4e8c8][_0x9e18('0x168')](),'XMD-AMD':_0x10fe29[_0x9e18('0xdf')]?'ACTIVE':_0x9e18('0x16c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x10fe29['dialAMDActive']){_0x4ffed2['XMD-AMDINITIALSILENCE']=_0x10fe29[_0x9e18('0x16d')]||0x9c4;_0x4ffed2[_0x9e18('0x16e')]=_0x10fe29[_0x9e18('0x16f')]||0x5dc;_0x4ffed2[_0x9e18('0x170')]=_0x10fe29[_0x9e18('0x171')]||0x320;_0x4ffed2[_0x9e18('0x172')]=_0x10fe29[_0x9e18('0x173')]||0x1388;_0x4ffed2[_0x9e18('0x174')]=_0x10fe29[_0x9e18('0x175')]||0x64;_0x4ffed2[_0x9e18('0x176')]=_0x10fe29[_0x9e18('0x177')]||0x32;_0x4ffed2[_0x9e18('0x178')]=_0x10fe29[_0x9e18('0x179')]||0x3;_0x4ffed2[_0x9e18('0x17a')]=_0x10fe29[_0x9e18('0x17b')]||0x100;_0x4ffed2[_0x9e18('0x17c')]=_0x10fe29[_0x9e18('0x17d')]||0x1388;}if(_0x10fe29[_0x9e18('0x4d')]==='outbound'){_0x4ffed2[_0x9e18('0x17e')]=_0x93cee8[_0x9e18('0xd4')];}else{_0x4ffed2['XMD-CAMPAIGNID']=_0x93cee8[_0x9e18('0xd5')];}for(var _0x520a4a in _0x93cee8[_0x9e18('0x165')]){if(typeof _0x93cee8['Contact'][_0x520a4a]!==_0x9e18('0xad')){if(isNotNull(_0x93cee8[_0x9e18('0x165')][_0x520a4a])&&_0x520a4a!=='id'&&_0x520a4a!==_0x9e18('0x17f')&&_0x520a4a!==_0x9e18('0x180')&&_0x520a4a!==_0x9e18('0x181')){_0x4ffed2[util[_0x9e18('0x77')]('%s%s',_0x9e18('0x182'),_[_0x9e18('0x183')](_0x520a4a))]=_0x93cee8[_0x9e18('0x165')][_0x520a4a];}}}var _0xd19414=_0x424fff[_0x9e18('0xd8')](_0x10fe29['Trunk'])?getCallerId(_0x10fe29[_0x9e18('0x74')][_0x9e18('0x76')],_0x10fe29[_0x9e18('0x5d')],_0x10fe29[_0x9e18('0x184')]>0x0?getCallerIdRandom(_0x10fe29[_0x9e18('0x185')],_0x10fe29[_0x9e18('0x184')]):_0x10fe29['dialOriginateCallerIdNumber']):getCallerId(_[_0x9e18('0xae')](_0x10fe29[_0x9e18('0x13e')])?_0x10fe29[_0x9e18('0x74')][_0x9e18('0x76')]:_0x10fe29['TrunkBackup'][_0x9e18('0x76')],_0x10fe29['dialOriginateCallerIdName'],_0x10fe29['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x10fe29[_0x9e18('0x185')],_0x10fe29[_0x9e18('0x184')]):_0x10fe29['dialOriginateCallerIdNumber']);if(_0xd19414){_0x4ffed2[_0x9e18('0x186')]=_0x424fff[_0x9e18('0x23')][_0xa4e8c8][_0x9e18('0x187')]=extractCalleridName(_0xd19414);_0x4ffed2['XMD-ORIGINATECALLERIDNUM']=_0x424fff[_0x9e18('0x23')][_0xa4e8c8][_0x9e18('0x188')]=extractCalleridNumber(_0xd19414);}return ami[_0x9e18('0xaf')]({'actionid':_0xa4e8c8,'action':_0x9e18('0x164'),'channel':_0x424fff['isTrunkReachable'](_0x10fe29['Trunk'])?util[_0x9e18('0x77')](_0x9e18('0x189'),_0x10fe29[_0x9e18('0x74')][_0x9e18('0x3e')],isNotNull(_0x10fe29['dialPrefix'])?_0x10fe29[_0x9e18('0x18a')][_0x9e18('0x18b')]()||'':'',_0x10fe29[_0x9e18('0x18c')]>0x0?_0x93cee8[_0x9e18('0x165')]['phone'][_0x9e18('0x18d')](_0x10fe29[_0x9e18('0x18c')]):_0x93cee8[_0x9e18('0x165')][_0x9e18('0x166')]):util[_0x9e18('0x77')](_0x9e18('0x189'),_['isNil'](_0x10fe29[_0x9e18('0x13e')])?_0x10fe29['Trunk'][_0x9e18('0x3e')]:_0x10fe29[_0x9e18('0x13e')][_0x9e18('0x3e')],isNotNull(_0x10fe29['dialPrefix'])?_0x10fe29[_0x9e18('0x18a')][_0x9e18('0x18b')]()||'':'',_0x10fe29[_0x9e18('0x18c')]>0x0?_0x93cee8[_0x9e18('0x165')][_0x9e18('0x166')][_0x9e18('0x18d')](_0x10fe29['dialCutDigit']):_0x93cee8[_0x9e18('0x165')][_0x9e18('0x166')]),'callerid':_0xd19414,'Exten':_0x9e18('0xde'),'Context':'from-sip','Priority':'1','variable':_0x4ffed2,'timeout':(_0x10fe29[_0x9e18('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa4e8c8})['then'](function(_0x4943ba){return _0x30def4(_0x4943ba);})[_0x9e18('0xbc')](function(_0x363add){_0x10fe29['outboundOriginateFailureCallsDay']+=0x1;var _0x5d631e=new History(_0x424fff[_0x9e18('0x23')][_0xa4e8c8]);logger[_0x9e18('0x9b')](util[_0x9e18('0x77')](_0x9e18('0x18f'),JSON['stringify'](_0x363add)));_0x5d631e[_0x9e18('0xa9')]=0xe;_0x5d631e['statedesc']=_0x9e18('0x190');_0x5d631e[_0x9e18('0xaa')]=moment()['format'](_0x9e18('0xfa'));_0x5d631e['endtime']=_0x5d631e[_0x9e18('0xaa')];_0x424fff[_0x9e18('0xca')](_0x5d631e)[_0x9e18('0xbc')](loggerCatch('[originate][error]'));_0x424fff[_0x9e18('0xc9')](_0x5d631e)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x191')))[_0x9e18('0x12e')](function(){delete _0x424fff[_0x9e18('0x23')][_0xa4e8c8];return _0x363d17(msgResponse('originate',_0x9e18('0x47'),_0x9e18('0x192')));});});});};Dialer[_0x9e18('0x1a')]['syncOriginateResponse']=function(_0x35824e){var _0x1e16f1=this['actions'][_0x35824e[_0x9e18('0x123')]];if(_0x1e16f1){delete this[_0x9e18('0x23')][_0x35824e[_0x9e18('0x123')]];_0x1e16f1['responsetime']=moment()[_0x9e18('0x77')](_0x9e18('0xfa'));var _0x52275f=_0x1e16f1[_0x9e18('0x4d')]==='ivr'?this[_0x9e18('0x1e')][_0x1e16f1[_0x9e18('0xb5')]]:this[_0x9e18('0xb4')][_0x1e16f1[_0x9e18('0x193')]()];if(!this[_0x9e18('0xd7')](_0x35824e['response'])){this[_0x9e18('0xb3')](_0x52275f);return this['callProgressDetecting'](_0x1e16f1,_0x52275f,_0x35824e)[_0x9e18('0xbc')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x9e18('0x25')][_0x35824e[_0x9e18('0xda')]]=_0x1e16f1;}};Dialer['prototype']['checkRetriveMax']=function(_0x476396,_0x3c1e27,_0x595ae7){var _0x45d2a1=new History(_0x3c1e27);if(_0x45d2a1['countbusyretry']+_0x45d2a1[_0x9e18('0xee')]+_0x45d2a1[_0x9e18('0x100')]+_0x45d2a1[_0x9e18('0x101')]+_0x45d2a1['countdropretry']+_0x45d2a1[_0x9e18('0xf0')]+_0x45d2a1[_0x9e18('0xeb')]+_0x45d2a1[_0x9e18('0xf1')]>=_0x595ae7['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x476396){case 0x3:if(_0x45d2a1['countnoanswerretry']>=_0x595ae7[_0x9e18('0x194')]-0x1){return!![];}this[_0x9e18('0xc1')]({'active':![],'countnoanswerretry':_0x45d2a1[_0x9e18('0x100')]+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7['dialNoAnswerRetryFrequency'],_0x9e18('0xf9'))[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x45d2a1[_0x9e18('0xd2')],'ListId':_0x45d2a1['ListId'],'VoiceQueueId':_0x45d2a1[_0x9e18('0xd4')]||undefined,'CampaignId':_0x45d2a1[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x195')));break;case 0x5:if(_0x45d2a1[_0x9e18('0xed')]>=_0x595ae7[_0x9e18('0x196')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x45d2a1[_0x9e18('0xed')]+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7[_0x9e18('0x197')],_0x9e18('0xf9'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45d2a1[_0x9e18('0xd2')],'ListId':_0x45d2a1[_0x9e18('0xd3')],'VoiceQueueId':_0x45d2a1[_0x9e18('0xd4')]||undefined,'CampaignId':_0x45d2a1['CampaignId']||undefined})[_0x9e18('0xbc')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x45d2a1[_0x9e18('0xee')]>=_0x595ae7[_0x9e18('0x198')]-0x1){return!![];}this[_0x9e18('0xc1')]({'active':![],'countcongestionretry':_0x45d2a1[_0x9e18('0xee')]+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7[_0x9e18('0x199')],'minutes')['format'](_0x9e18('0xfa')),'ContactId':_0x45d2a1[_0x9e18('0xd2')],'ListId':_0x45d2a1[_0x9e18('0xd3')],'VoiceQueueId':_0x45d2a1['VoiceQueueId']||undefined,'CampaignId':_0x45d2a1[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x19a')));break;case 0x0:if(_0x45d2a1[_0x9e18('0x101')]>=_0x595ae7['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x9e18('0xc1')]({'active':![],'countnosuchnumberretry':_0x45d2a1['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7['dialNoSuchNumberRetryFrequency'],_0x9e18('0xf9'))[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x45d2a1['ContactId'],'ListId':_0x45d2a1['ListId'],'VoiceQueueId':_0x45d2a1[_0x9e18('0xd4')]||undefined,'CampaignId':_0x45d2a1[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x19b')));}break;case 0xa:if(_0x45d2a1[_0x9e18('0xef')]>=_0x595ae7['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x45d2a1[_0x9e18('0xef')]+=0x1,'scheduledat':moment()['add'](_0x595ae7[_0x9e18('0x19c')],'minutes')[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x45d2a1['ContactId'],'ListId':_0x45d2a1[_0x9e18('0xd3')],'VoiceQueueId':_0x45d2a1[_0x9e18('0xd4')]||undefined,'CampaignId':_0x45d2a1['CampaignId']||undefined})[_0x9e18('0xbc')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x45d2a1[_0x9e18('0xf0')]>=_0x595ae7[_0x9e18('0x120')]-0x1){return!![];}this[_0x9e18('0xc1')]({'active':![],'countabandonedretry':_0x45d2a1[_0x9e18('0xf0')]+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7[_0x9e18('0x19d')],_0x9e18('0xf9'))[_0x9e18('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45d2a1[_0x9e18('0xd2')],'ListId':_0x45d2a1[_0x9e18('0xd3')],'VoiceQueueId':_0x45d2a1['VoiceQueueId']||undefined,'CampaignId':_0x45d2a1[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x121')));break;case 0x13:if(_0x45d2a1['countmachineretry']>=_0x595ae7[_0x9e18('0xf5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x45d2a1[_0x9e18('0xeb')]+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7['dialMachineRetryFrequency'],_0x9e18('0xf9'))[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x45d2a1[_0x9e18('0xd2')],'ListId':_0x45d2a1[_0x9e18('0xd3')],'VoiceQueueId':_0x45d2a1['VoiceQueueId']||undefined,'CampaignId':_0x45d2a1[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x45d2a1[_0x9e18('0xf1')]>=_0x595ae7[_0x9e18('0x19e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x45d2a1['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x9e18('0x102')](_0x595ae7[_0x9e18('0x19f')],_0x9e18('0xf9'))[_0x9e18('0x77')](_0x9e18('0xfa')),'ContactId':_0x45d2a1[_0x9e18('0xd2')],'ListId':_0x45d2a1[_0x9e18('0xd3')],'VoiceQueueId':_0x45d2a1[_0x9e18('0xd4')]||undefined,'CampaignId':_0x45d2a1['CampaignId']||undefined})['catch'](loggerCatch(_0x9e18('0x1a0')));break;default:return!![];}};Dialer[_0x9e18('0x1a')][_0x9e18('0x1a1')]=function(_0x16377a,_0x18c00f,_0x1bb87e){var _0x5f17d8=this;var _0x25f721=new History(_0x16377a);return new BPromise(function(_0x433aa9,_0x11db82){if(_[_0x9e18('0x87')](_0x18c00f)&&typeof _0x18c00f!==_0x9e18('0x163')){return _0x11db82(msgResponse(_0x9e18('0x1a2'),_0x9e18('0x144'),_0x9e18('0x1a3')));}if(_['isUndefined'](_0x1bb87e)&&typeof _0x1bb87e!==_0x9e18('0x163')){return _0x11db82(msgResponse('[callProgressDetecting]','Failure',_0x9e18('0x1a4')));}switch(_0x1bb87e[_0x9e18('0x10c')]){case'0':_0x18c00f[_0x9e18('0x64')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0x0;_0x25f721[_0x9e18('0xfb')]=_0x9e18('0x1a5');_0x25f721[_0x9e18('0x101')]+=0x1;_0x25f721['countglobal']+=0x1;ami[_0x9e18('0x4c')](_0x9e18('0x1a6'),ut[_0x9e18('0xe4')](_0x16377a,_0x9e18('0x1a7')));_0x5f17d8['createHistory'](_0x25f721)[_0x9e18('0xbc')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5f17d8['checkRetriveMax'](0x0,_0x16377a,_0x18c00f)){if(_0x25f721['countnosuchnumberretry']>=_0x18c00f[_0x9e18('0x1a8')]){_0x5f17d8[_0x9e18('0xf6')](_0x25f721,_0x433aa9,_0x11db82,'reason\x200\x20no\x20such\x20number....');}else{_0x5f17d8['stateGlobal'](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1a9'));}}break;case'3':_0x18c00f[_0x9e18('0x63')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0x3;_0x25f721[_0x9e18('0xfb')]=_0x9e18('0x1aa');_0x25f721[_0x9e18('0x100')]+=0x1;_0x25f721['countglobal']+=0x1;ami['emit'](_0x9e18('0x1ab'),ut[_0x9e18('0xe4')](_0x16377a,_0x9e18('0x1ac')));_0x5f17d8[_0x9e18('0xca')](_0x25f721)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1ad')));if(_0x5f17d8[_0x9e18('0x1ae')](0x3,_0x16377a,_0x18c00f)){if(_0x25f721[_0x9e18('0x100')]>=_0x18c00f['dialNoAnswerMaxRetry']){_0x5f17d8[_0x9e18('0xf6')](_0x25f721,_0x433aa9,_0x11db82,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5f17d8[_0x9e18('0xf3')](_0x25f721,_0x433aa9,_0x11db82,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x18c00f[_0x9e18('0x5f')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0x5;_0x25f721[_0x9e18('0xfb')]=_0x9e18('0x1af');_0x25f721[_0x9e18('0xed')]+=0x1;_0x25f721['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut['buildObj'](_0x16377a,_0x9e18('0x1b0')));_0x5f17d8['createHistory'](_0x25f721)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1b1')));if(_0x5f17d8[_0x9e18('0x1ae')](0x5,_0x16377a,_0x18c00f)){if(_0x25f721[_0x9e18('0xed')]>=_0x18c00f[_0x9e18('0x196')]){_0x5f17d8[_0x9e18('0xf6')](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1b2'));}else{_0x5f17d8[_0x9e18('0xf3')](_0x25f721,_0x433aa9,_0x11db82,'reason\x205\x20busy');}}break;case'8':_0x18c00f[_0x9e18('0x60')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0x8;_0x25f721[_0x9e18('0xfb')]=_0x9e18('0x1b3');_0x25f721[_0x9e18('0xee')]+=0x1;_0x25f721[_0x9e18('0xff')]+=0x1;ami[_0x9e18('0x4c')](_0x9e18('0x1b4'),ut['buildObj'](_0x16377a,_0x9e18('0x1b5')));_0x5f17d8[_0x9e18('0xca')](_0x25f721)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1b6')));if(_0x5f17d8['checkRetriveMax'](0x8,_0x16377a,_0x18c00f)){if(_0x25f721['countcongestionretry']>=_0x18c00f[_0x9e18('0x198')]){_0x5f17d8['createStateFinal'](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1b7'));}else{_0x5f17d8[_0x9e18('0xf3')](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1b7'));}}break;case'11':_0x18c00f[_0x9e18('0x1b8')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0xb;_0x25f721[_0x9e18('0xfb')]=_0x9e18('0x11e');_0x25f721[_0x9e18('0xf0')]+=0x1;_0x25f721['countglobal']+=0x1;_0x5f17d8['createHistory'](_0x25f721)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x5f17d8['checkRetriveMax'](0xb,_0x16377a,_0x18c00f)){if(_0x25f721['countabandonedretry']>=_0x18c00f[_0x9e18('0x120')]){_0x5f17d8[_0x9e18('0xf6')](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1b9'));}else{_0x5f17d8[_0x9e18('0xf3')](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1b9'));}}break;case'20':_0x18c00f[_0x9e18('0x1ba')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0x14;_0x25f721['statedesc']=_0x9e18('0x1bb');_0x25f721[_0x9e18('0xf1')]+=0x1;_0x25f721[_0x9e18('0xff')]+=0x1;ami[_0x9e18('0x4c')](_0x9e18('0x1bc'),ut['buildObj'](_0x16377a,'agentreject'));_0x5f17d8[_0x9e18('0xca')](_0x25f721)[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1bd')));if(_0x5f17d8[_0x9e18('0x1ae')](0x14,_0x16377a,_0x18c00f)){if(_0x25f721[_0x9e18('0xf1')]>=_0x18c00f[_0x9e18('0x19e')]){_0x5f17d8[_0x9e18('0xf6')](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1be'));}else{_0x5f17d8[_0x9e18('0xf3')](_0x25f721,_0x433aa9,_0x11db82,_0x9e18('0x1be'));}}break;default:_0x18c00f[_0x9e18('0x67')]+=0x1;_0x25f721[_0x9e18('0xa9')]=0xc;_0x25f721[_0x9e18('0xfb')]=_0x1bb87e[_0x9e18('0x10c')];_0x5f17d8[_0x9e18('0xca')](_0x25f721)['catch'](loggerCatch(_0x9e18('0x1bf')));if(_0x5f17d8[_0x9e18('0x1ae')](_0x1bb87e[_0x9e18('0x10c')],_0x16377a,_0x18c00f)){if(_0x25f721['countbusyretry']+_0x25f721[_0x9e18('0xee')]+_0x25f721['countnoanswerretry']+_0x25f721[_0x9e18('0x101')]+_0x25f721[_0x9e18('0xef')]+_0x25f721[_0x9e18('0xf0')]+_0x25f721[_0x9e18('0xeb')]+_0x25f721[_0x9e18('0xf1')]>=_0x18c00f[_0x9e18('0xf2')]){_0x5f17d8['stateGlobal'](_0x25f721,_0x433aa9,_0x11db82,_0x1bb87e['reason']);}else{_0x5f17d8[_0x9e18('0xf6')](_0x25f721,_0x433aa9,_0x11db82,_0x1bb87e[_0x9e18('0x10c')]);}}}});};Dialer[_0x9e18('0x1a')][_0x9e18('0xf3')]=function(_0x2d07f9,_0x246177,_0x5d7cd1,_0x220951){var _0x535dab=new Final(_0x2d07f9);_0x535dab[_0x9e18('0xa9')]=0xf;_0x535dab['statedesc']='Global';this[_0x9e18('0xf6')](_0x535dab,_0x246177,_0x5d7cd1,_0x220951);};Dialer[_0x9e18('0x1a')][_0x9e18('0xf6')]=function(_0x365cfe,_0x437676,_0x1b95c8,_0x484cbf){this[_0x9e18('0xc9')](_0x365cfe)[_0x9e18('0xb9')](function(){return _0x437676(msgResponse('[callProgressDetecting]',_0x9e18('0x1c0'),_0x484cbf));})[_0x9e18('0xbc')](function(){return _0x1b95c8(msgResponse(_0x9e18('0x1c1'),_0x9e18('0x144'),'contact\x20not\x20moved'));});};Dialer[_0x9e18('0x1a')][_0x9e18('0x155')]=function(_0x57daa8){var _0x3aadc6=_0x57daa8[_0x9e18('0x1c2')]/0x64;var _0x381767=_0x57daa8['outboundDropCallsDayTimeout']/(_0x57daa8[_0x9e18('0x62')]+_0x57daa8['outboundAnswerCallsDay']);var _0x5b511d=Math[_0x9e18('0x1c3')](_0x57daa8[_0x9e18('0x70')]*(_0x57daa8[_0x9e18('0x1c4')]/0x64));var _0x2d5b5d=Math[_0x9e18('0x1c3')](_0x57daa8[_0x9e18('0x70')]*(_0x57daa8[_0x9e18('0x1c5')]/0x64));var _0x437cda=_0x57daa8[_0x9e18('0x51')]+_0x57daa8[_0x9e18('0x55')];var _0x2b0371=Math['floor'](_0x57daa8[_0x9e18('0x73')]*_0x57daa8['erlangAbandonmentRate']*_0x57daa8[_0x9e18('0x6e')]*_0x57daa8['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x57daa8['startProgressive'])){if(!_[_0x9e18('0x87')](_0x57daa8[_0x9e18('0x27')])){_0x57daa8[_0x9e18('0x27')]=undefined;loggerPredictive[_0x9e18('0x9b')](_0x9e18('0x1c6'),_0x9e18('0x1c7'));}if(!_[_0x9e18('0x87')](_0x57daa8[_0x9e18('0x96')])){loggerPredictive[_0x9e18('0x9b')](_0x9e18('0x1c6'),_0x9e18('0x1c8'));clearInterval(_0x57daa8[_0x9e18('0x96')]);_0x57daa8[_0x9e18('0x96')]=undefined;}_0x57daa8[_0x9e18('0x28')]=moment()[_0x9e18('0x77')](_0x9e18('0xfa'));loggerPredictive[_0x9e18('0x7d')](_0x57daa8['name'],_0x9e18('0x1c9'),_0x57daa8[_0x9e18('0x28')]);this[_0x9e18('0x153')](_0x57daa8,0x1);}else if(ifInterval(_0x57daa8[_0x9e18('0x1ca')],_0x57daa8['startProgressive'])){this[_0x9e18('0x153')](_0x57daa8,0x1);loggerPredictiveCalls[_0x9e18('0x7d')](_0x9e18('0x1cb'),_0x57daa8['startProgressive'],_0x57daa8['name']);_0x57daa8[_0x9e18('0x73')]=0x0;_0x57daa8[_0x9e18('0x6d')]=0x0;}else if(_0x3aadc6<_0x381767&&_0x57daa8[_0x9e18('0x1cc')]===_0x9e18('0x1cd')){freeVariablesPredictive(_0x57daa8);loggerPredictive['info'](_0x9e18('0x1ce'),_0x9e18('0x1cf'),_0x381767,'startProgressive',_0x57daa8[_0x9e18('0x3e')]);}else if(_0x2b0371<_0x57daa8[_0x9e18('0x6d')]&&_0x57daa8[_0x9e18('0x1cc')]===_0x9e18('0x1cd')){freeVariablesPredictive(_0x57daa8);loggerPredictive['info'](_0x9e18('0x1d0'),_0x9e18('0x1d1'),_0x2b0371,_0x9e18('0x1d2'),_0x57daa8['predictiveIntervalErlangCallsDroppedCalls'],_0x9e18('0x28'),_0x57daa8['name']);}else if(!ifInterval(_0x57daa8[_0x9e18('0x1ca')],_0x57daa8[_0x9e18('0x28')])&&_[_0x9e18('0x87')](_0x57daa8[_0x9e18('0x27')])&&!_[_0x9e18('0x87')](_0x57daa8['startProgressive'])){_0x57daa8['startPredictive']=moment()['format'](_0x9e18('0xfa'));loggerPredictive[_0x9e18('0x7d')](_0x57daa8['name'],_0x9e18('0x1d3'),_0x57daa8[_0x9e18('0x27')]);this[_0x9e18('0xbf')](_0x57daa8['dialPredictiveInterval'])[_0x9e18('0xb9')](this[_0x9e18('0x1d4')](_0x57daa8))['then'](mergeDataErlangB(_0x57daa8))[_0x9e18('0xb9')](this[_0x9e18('0x1d5')](_0x57daa8))['catch'](loggerCatchPredictive(_0x9e18('0x1d6'),_0x57daa8));}else if(!ifInterval(_0x57daa8[_0x9e18('0x1ca')],_0x57daa8[_0x9e18('0x27')])){_0x57daa8[_0x9e18('0x6d')]=0x0;_0x57daa8['startPredictive']=moment()['format'](_0x9e18('0xfa'));loggerPredictive[_0x9e18('0x7d')](_0x57daa8[_0x9e18('0x3e')],_0x9e18('0x1d7'),_0x57daa8[_0x9e18('0x27')]);clearInterval(_0x57daa8['handlePredictive']);_0x57daa8['handlePredictive']=undefined;this[_0x9e18('0xbf')](_0x57daa8[_0x9e18('0x1ca')])[_0x9e18('0xb9')](this[_0x9e18('0x1d4')](_0x57daa8))[_0x9e18('0xb9')](mergeDataErlangB(_0x57daa8))[_0x9e18('0xb9')](this[_0x9e18('0x1d5')](_0x57daa8))['catch'](loggerCatchPredictive(_0x9e18('0x1d8'),_0x57daa8));}else if(_0x57daa8[_0x9e18('0x70')]&&_0x437cda<_0x57daa8['predictiveIntervalAvailable']-_0x2d5b5d){freeVariablesPredictive(_0x57daa8);loggerPredictive[_0x9e18('0x7d')](_0x57daa8['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x437cda,')\x20are\x20less\x20than\x20threshold\x20(',_0x57daa8[_0x9e18('0x70')],'-',_0x2d5b5d,'=',_0x57daa8[_0x9e18('0x70')]-_0x2d5b5d,')');}else if(_0x57daa8['predictiveIntervalAvailable']&&_0x437cda>_0x57daa8[_0x9e18('0x70')]+_0x5b511d){freeVariablesPredictive(_0x57daa8);loggerPredictive[_0x9e18('0x7d')](_0x57daa8[_0x9e18('0x3e')],_0x9e18('0x1d9'),_0x437cda,')\x20are\x20more\x20than\x20threshold\x20(',_0x57daa8[_0x9e18('0x70')],'+',_0x5b511d,'=',_0x57daa8[_0x9e18('0x70')]+_0x5b511d,')');}};Dialer[_0x9e18('0x1a')]['getDataPredictive']=function(_0x1f69cd){var _0x2108cb=this;return function(_0x2493e9){return new BPromise(function(_0x2a8ac6,_0x3c6fb0){_[_0x9e18('0x93')](_0x1f69cd,_0x2493e9[0x0]);if(checkGetDataPredictive(_0x2493e9[0x0])){var _0xdb1f79=_0x1f69cd[_0x9e18('0x70')]=_0x1f69cd[_0x9e18('0x55')]+_0x1f69cd['available'];var _0x5193c7=_0x1f69cd[_0x9e18('0x1ca')]*0x3c;var _0x323774=_0x2493e9[0x0][_0x9e18('0x6a')]+_0x2493e9[0x0][_0x9e18('0x69')];var _0x12d47e=(_0x2493e9[0x0][_0x9e18('0x68')]+_0x2493e9[0x0][_0x9e18('0x6b')]+_0x2493e9[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2493e9[0x0][_0x9e18('0x71')];_0x1f69cd[_0x9e18('0x6e')]=_0x12d47e>0x0?_0x12d47e:0x1;switch(_0x1f69cd[_0x9e18('0x1cc')]){case'dropRate':var _0x14ce0b=_0x1f69cd[_0x9e18('0x1c2')]/0x64;return _0x2108cb[_0x9e18('0x1da')](_0xdb1f79,_0x5193c7,_0x323774,_0x12d47e,_0x14ce0b)[_0x9e18('0xb9')](function(_0x499b17){return _0x2a8ac6(_0x499b17);});case _0x9e18('0x1db'):var _0xdf60d4=_0x1f69cd[_0x9e18('0x1c2')]/0x64;return _0x2108cb['busyFactor'](_0xdb1f79,_0x5193c7,_0x323774,_0x12d47e,_0xdf60d4)[_0x9e18('0xb9')](function(_0x3024ed){return _0x2a8ac6(_0x3024ed);});default:return _0x3c6fb0(msgResponse(_0x9e18('0x1dc'),'Failure',_0x9e18('0x1dd')));}}else{return _0x3c6fb0(msgResponse('[getDataPredictive]',_0x9e18('0x144'),_0x9e18('0x1de')));}});};};Dialer[_0x9e18('0x1a')][_0x9e18('0x1df')]=function(_0x32e032){var _0x133218=this;return function(_0x7339a5){return new BPromise(function(_0x5f06ba,_0x483b3f){_[_0x9e18('0x93')](_0x32e032,_0x7339a5[0x0]);if(checkGetDataPredictive(_0x7339a5[0x0])){loggerPredictive[_0x9e18('0x7d')](JSON['stringify'](_0x7339a5[0x0]));if(_0x32e032['dialPredictiveOptimization']===_0x9e18('0x1cd')){return _0x133218[_0x9e18('0xc8')](_0x32e032['id'])[_0x9e18('0xb9')](function(_0x7966c6){var _0x5825d0=_0x32e032[_0x9e18('0x159')]-_0x7966c6[0x0][_0x9e18('0x1e0')];var _0x4e0a9b=_0x32e032[_0x9e18('0x1ca')]*0x3c;var _0x32d4fd=_0x7339a5[0x0][_0x9e18('0x6a')]+_0x7339a5[0x0][_0x9e18('0x69')];var _0x58c63b=(_0x7339a5[0x0]['predictiveIntervalAnsweredCalls']+_0x7339a5[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x7339a5[0x0][_0x9e18('0x83')])/_0x7339a5[0x0][_0x9e18('0x71')];var _0x2bf210=_0x32e032['dialPredictiveOptimizationPercentage']/0x64;_0x32e032[_0x9e18('0x1e1')]=_0x7966c6[0x0]['outboundQueuePauses']||0x0;_0x32e032[_0x9e18('0x6e')]=_0x58c63b>0x0?_0x58c63b:0x1;return _0x133218[_0x9e18('0x1da')](_0x5825d0,_0x4e0a9b,_0x32d4fd,_0x58c63b,_0x2bf210);})[_0x9e18('0xb9')](function(_0x2f6eb3){return _0x5f06ba(_0x2f6eb3);})[_0x9e18('0xbc')](function(_0x5e2443){return _0x483b3f(msgResponse('[CatchErlangB]',_0x9e18('0x144'),JSON[_0x9e18('0x48')](_0x5e2443)));});}if(_0x32e032[_0x9e18('0x1cc')]===_0x9e18('0x1db')){return _0x133218[_0x9e18('0xc8')](_0x32e032['id'])[_0x9e18('0xb9')](function(_0x1b4044){var _0x3f3e27=_0x32e032[_0x9e18('0x159')]-_0x1b4044[0x0][_0x9e18('0x1e0')];var _0x582283=_0x32e032[_0x9e18('0x1ca')]*0x3c;var _0x474c87=_0x7339a5[0x0][_0x9e18('0x6a')]+_0x7339a5[0x0][_0x9e18('0x69')];var _0x1fea06=(_0x7339a5[0x0]['predictiveIntervalAnsweredCalls']+_0x7339a5[0x0][_0x9e18('0x6b')]+_0x7339a5[0x0][_0x9e18('0x83')])/_0x7339a5[0x0][_0x9e18('0x71')];var _0x584dd7=_0x32e032[_0x9e18('0x1c2')]/0x64;_0x32e032['predictiveIntervalPauses']=_0x1b4044[0x0][_0x9e18('0x1e0')]||0x0;_0x32e032[_0x9e18('0x6e')]=_0x1fea06>0x0?_0x1fea06:0x1;return _0x133218[_0x9e18('0x1e2')](_0x3f3e27,_0x582283,_0x474c87,_0x1fea06,_0x584dd7);})[_0x9e18('0xb9')](function(_0x580327){return _0x5f06ba(_0x580327);})[_0x9e18('0xbc')](function(_0x20a371){return _0x483b3f(msgResponse(_0x9e18('0x1e3'),'Failure',JSON[_0x9e18('0x48')](_0x20a371)));});}}else{return _0x483b3f(msgResponse(_0x9e18('0x1dc'),'Failure',_0x9e18('0x1de')));}});};};Dialer['prototype'][_0x9e18('0x1d5')]=function(_0x3b0145){var _0x1a0318=this;return function(){var _0x417be1=0x0;var _0x2af852=Math['floor'](_0x3b0145[_0x9e18('0x1e4')]*0x3e8);if(_0x2af852>0x0){_0x2af852=_0x2af852<0x64?0x64:_0x2af852;loggerPredictive['info'](_0x3b0145['name'],_0x9e18('0x1e5'),_0x2af852,_0x9e18('0x49'));_0x3b0145[_0x9e18('0x96')]=setInterval(function(){_0x1a0318[_0x9e18('0x96')](_0x3b0145);loggerPredictiveCalls[_0x9e18('0x7d')]('[handlePredictive]',_0x417be1+=0x1);},_0x2af852);}else{loggerPredictive[_0x9e18('0x7d')](_0x3b0145[_0x9e18('0x3e')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x9e18('0x1a')][_0x9e18('0x1e6')]=function(_0xba14c7,_0x55954c){var _0x1f0bd4=this;return function(_0x4f9ddf){if(_[_0x9e18('0x7c')](_0x4f9ddf)){if(_[_0x9e18('0xae')](_0x55954c[_0x9e18('0x1e7')])||!_0x55954c[_0x9e18('0x1e8')]){if(_0xba14c7[_0x9e18('0x5c')]===_0x9e18('0x7')){_0xba14c7['queueStatusComplete']=_[_0x9e18('0x87')](_0xba14c7[_0x9e18('0x12a')])?!![]:_0xba14c7[_0x9e18('0x12a')];var _0x4c7d64=uuid['v4']();_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64]=new Action(_0xba14c7,_0x55954c,_0x4c7d64);loggerBooked['info'](_0x9e18('0x1e9'),_0x4c7d64,_0x9e18('0x1ea'),JSON[_0x9e18('0x48')](_0xba14c7[_0x9e18('0x12a')]),_0x9e18('0x1eb'),_0xba14c7[_0x9e18('0x3e')]);if(_0xba14c7[_0x9e18('0x12a')]){_0xba14c7[_0x9e18('0x12a')]=![];_0x1f0bd4['queueBooked'][_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64][_0x9e18('0xb5')]]=[];ami[_0x9e18('0xaf')]({'actionid':_0x4c7d64,'action':_0x9e18('0x1ec'),'queue':_0xba14c7['name']})[_0x9e18('0xbc')](function(){_0x1f0bd4[_0x9e18('0xb3')](_0xba14c7);_0x1f0bd4[_0x9e18('0xc1')]({'active':![],'ContactId':_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64][_0x9e18('0xd2')],'ListId':_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64][_0x9e18('0xd3')],'VoiceQueueId':_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64][_0x9e18('0xd4')]||undefined,'CampaignId':_0x1f0bd4['actions'][_0x4c7d64][_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1ed')));delete _0x1f0bd4[_0x9e18('0x23')][_0x4c7d64];});}else{loggerBooked[_0x9e18('0x7d')](_0x9e18('0x1ee'),JSON[_0x9e18('0x48')](_0xba14c7[_0x9e18('0x12a')]),_0x9e18('0x1eb'),_0xba14c7['name']);_0x1f0bd4[_0x9e18('0xb3')](_0xba14c7);_0x1f0bd4[_0x9e18('0xc1')]({'active':![],'ContactId':_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64][_0x9e18('0xd2')],'ListId':_0x1f0bd4[_0x9e18('0x23')][_0x4c7d64][_0x9e18('0xd3')],'VoiceQueueId':_0x1f0bd4['actions'][_0x4c7d64][_0x9e18('0xd4')]||undefined,'CampaignId':_0x1f0bd4['actions'][_0x4c7d64][_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1ed')));delete _0x1f0bd4[_0x9e18('0x23')][_0x4c7d64];}}else{return _0x1f0bd4['actionOriginate'](_0xba14c7,_0x55954c);}}else{if(getDiff(_0x55954c[_0x9e18('0x1ef')])<_0xba14c7[_0x9e18('0x1f0')]*0x3c){if(_0x55954c['Agent']&&!_0x55954c['Agent']['voicePause']){_0x1f0bd4['preview'][_0x9e18('0x12d')](_0x55954c['id'])[_0x9e18('0x12e')](function(){_0x1f0bd4['updateOriginated'](_0xba14c7);});}else{_0x1f0bd4[_0x9e18('0xc3')]({'active':![]},_0x55954c['id'],0x1)[_0x9e18('0x12e')](function(){_0x1f0bd4['updateOriginated'](_0xba14c7);});}}else{_0xba14c7[_0x9e18('0x66')]+=0x1;_0x1f0bd4[_0x9e18('0xb3')](_0xba14c7);if(_0xba14c7['dialRecallInQueue']){_0x1f0bd4[_0x9e18('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x55954c['ContactId'],'ListId':_0x55954c['ListId'],'VoiceQueueId':_0x55954c['VoiceQueueId']||undefined,'CampaignId':_0x55954c[_0x9e18('0xd5')]||undefined})[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1f1')));_0x1f0bd4['createHistory'](createObjHistory(_0xba14c7,_0x55954c,_0x9e18('0x1f2'),0x17,_0x9e18('0x1f3')))[_0x9e18('0xbc')](loggerCatch(_0x9e18('0x1f4')));}else{_0x1f0bd4[_0x9e18('0xd0')](createObjHistory(_0xba14c7,_0x55954c,'RECALLFAILEDTIMEOUT',0x16,_0x9e18('0x1f5')),_0x9e18('0x1f6'),_0x9e18('0x1f7'));}}}}else{_0xba14c7[_0x9e18('0x1f8')]+=0x1;_0x1f0bd4[_0x9e18('0xd0')](createObjHistory(_0xba14c7,_0x55954c,_0x9e18('0x1f9'),0xd,_0x9e18('0x1fa')),_0x9e18('0x1fb'),_0x9e18('0x1fc'));throw _0x9e18('0x1fd');}};};Dialer['prototype'][_0x9e18('0x157')]=function(_0x14d107){var _0x38312a=this;var _0x12b7d6=_0x14d107[_0x9e18('0x1fe')]-_0x14d107[_0x9e18('0x72')]-_0x14d107['temp'];emitCampaignSummary(_0x14d107);if(_0x12b7d6>0x0){if(_0x12b7d6>this[_0x9e18('0x21')]){_0x12b7d6=this[_0x9e18('0x21')];}_0x14d107['temp']+=_0x12b7d6;this[_0x9e18('0xc7')](_0x14d107['id'],_0x12b7d6,_0x14d107['dialOrderByScheduledAt'],_0x14d107)[_0x9e18('0xb9')](function(_0x13929a){_0x14d107[_0x9e18('0xc5')]-=_0x12b7d6;_0x14d107[_0x9e18('0xc5')]=_0x14d107[_0x9e18('0xc5')]>0x0?_0x14d107['temp']:0x0;if(!checkContactEmpty(_0x13929a)){_0x14d107[_0x9e18('0x3c')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x9e18('0x7d')](_0x9e18('0x1ff')+_0x14d107[_0x9e18('0x3e')]);}else{_0x14d107[_0x9e18('0x72')]+=_0x13929a['length'];_0x14d107[_0x9e18('0x3c')]='RUNNING';for(var _0x5c61b1=0x0;_0x5c61b1<_0x13929a[_0x9e18('0x9d')];_0x5c61b1+=0x1){_0x14d107['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x13929a[_0x5c61b1])||_['isNil'](_0x13929a[_0x5c61b1]['Contact'])||_['isNil'](_0x13929a[_0x5c61b1][_0x9e18('0x165')][_0x9e18('0x166')])){_0x38312a[_0x9e18('0xcf')]('[actionOriginate]\x20',_0x14d107,_0x13929a[_0x5c61b1]);}else{_0x38312a['checkIsBlackListIvr'](_[_0x9e18('0xd1')](_0x13929a[_0x5c61b1],[_0x9e18('0xd5'),_0x9e18('0x200')]))[_0x9e18('0xb9')](_0x38312a[_0x9e18('0x1e6')](_0x14d107,_0x13929a[_0x5c61b1]))[_0x9e18('0xbc')](_0x38312a[_0x9e18('0xce')](_0x9e18('0x201'),_0x14d107));}}}})[_0x9e18('0xbc')](loggerGetContactDialer(_0x9e18('0x202'),_0x14d107,_0x12b7d6));}};Dialer[_0x9e18('0x1a')]['handlePower']=function(_0x4d7ad1,_0x3a2452){var _0x270b90=this;var _0x38e192=[];var _0x1d563f=_0x3a2452>=0x1?_0x3a2452:0x1;if(_0x4d7ad1[_0x9e18('0x5c')]===_0x9e18('0x7')){_0x1d563f=0x1;}var _0x1e131c=Math[_0x9e18('0x203')](_0x4d7ad1['available']*_0x1d563f)-_0x4d7ad1[_0x9e18('0x72')]-_0x4d7ad1['temp'];emitVoiceQueueSummary(_0x4d7ad1);if(_0x4d7ad1['dialLimitQueue']>0x0){var _0x4495c4=_0x4d7ad1['dialLimitQueue']-_0x4d7ad1[_0x9e18('0x72')]-_0x4d7ad1[_0x9e18('0x55')]-_0x4d7ad1[_0x9e18('0xc5')]-_0x4d7ad1[_0x9e18('0x52')];if(_0x1e131c>_0x4495c4){_0x1e131c=_0x4495c4;}}if(_0x1e131c>0x0){if(_0x4d7ad1[_0x9e18('0x5c')]===_0x9e18('0x7')){_0x1e131c=0x1;}if(_0x1e131c>this['maxNumberOriginate']){_0x1e131c=this['maxNumberOriginate'];}_0x4d7ad1['temp']+=_0x1e131c;for(var _0xefccd1 in this[_0x9e18('0x1f')]){if(typeof this[_0x9e18('0x1f')][_0xefccd1]!==_0x9e18('0xad')){if(this[_0x9e18('0x1f')][_0xefccd1][_0x9e18('0xa9')]===_0x9e18('0x204')&&this[_0x9e18('0x1f')][_0xefccd1][_0x9e18('0xb0')]===_0x9e18('0x205')){_0x38e192[_0x9e18('0x127')](this[_0x9e18('0x1f')][_0xefccd1]['id']);}}}this[_0x9e18('0x206')](_0x4d7ad1['id'],_0x38e192,_0x1e131c,_0x4d7ad1['dialOrderByScheduledAt'],_0x4d7ad1)[_0x9e18('0xb9')](function(_0x47c42b){_0x4d7ad1['temp']-=_0x1e131c;_0x4d7ad1[_0x9e18('0xc5')]=_0x4d7ad1[_0x9e18('0xc5')]>0x0?_0x4d7ad1[_0x9e18('0xc5')]:0x0;if(!checkContactEmpty(_0x47c42b)){_0x270b90[_0x9e18('0xb7')](_0x4d7ad1)[_0x9e18('0xb9')](sendMessageReschedule(_0x4d7ad1))['catch'](loggerCatch(_0x9e18('0xba')));}else{_0x4d7ad1[_0x9e18('0x72')]+=_0x47c42b[_0x9e18('0x9d')];_0x4d7ad1[_0x9e18('0x3c')]=_0x4d7ad1[_0x9e18('0x5c')]===_0x9e18('0x7')?_0x9e18('0x207'):_0x9e18('0x208');for(var _0x1c028d=0x0;_0x1c028d<_0x47c42b['length'];_0x1c028d+=0x1){if(_[_0x9e18('0xae')](_0x47c42b[_0x1c028d])||_[_0x9e18('0xae')](_0x47c42b[_0x1c028d]['Contact'])||_[_0x9e18('0xae')](_0x47c42b[_0x1c028d][_0x9e18('0x165')][_0x9e18('0x166')])){_0x270b90[_0x9e18('0xcf')](_0x9e18('0x209'),_0x4d7ad1,_0x47c42b[_0x1c028d]);}else{_0x270b90[_0x9e18('0xbb')](_[_0x9e18('0xd1')](_0x47c42b[_0x1c028d],[_0x9e18('0xd4'),_0x9e18('0x200')]))[_0x9e18('0xb9')](_0x270b90['checkContactBlack'](_0x4d7ad1,_0x47c42b[_0x1c028d]))[_0x9e18('0xbc')](_0x270b90[_0x9e18('0xce')](_0x9e18('0x209'),_0x4d7ad1));}}}})[_0x9e18('0xbc')](loggerGetContactDialer(_0x9e18('0x20a'),_0x4d7ad1,_0x1e131c));}};Dialer['prototype'][_0x9e18('0x96')]=function(_0x272bcd){if(_0x272bcd[_0x9e18('0x20b')]>0x0){var _0x1e75ba=_0x272bcd[_0x9e18('0x20b')]-_0x272bcd[_0x9e18('0x72')]-_0x272bcd['talking'];if(_0x1e75ba>0x0){this[_0x9e18('0x20c')](_0x272bcd);}else{loggerPredictiveCalls[_0x9e18('0x7d')](_0x9e18('0x20d'));}}else{this[_0x9e18('0x20c')](_0x272bcd);}};Dialer[_0x9e18('0x1a')][_0x9e18('0x20c')]=function(_0x53830b){var _0x24a5f1=this;var _0x437f4b=[];_0x53830b[_0x9e18('0x72')]+=0x1;for(var _0x12a883 in this[_0x9e18('0x1f')]){if(typeof this[_0x9e18('0x1f')][_0x12a883]!==_0x9e18('0xad')){if(this[_0x9e18('0x1f')][_0x12a883][_0x9e18('0xa9')]===_0x9e18('0x204')&&this[_0x9e18('0x1f')][_0x12a883][_0x9e18('0xb0')]===_0x9e18('0x205')){_0x437f4b['push'](this['agents'][_0x12a883]['id']);}}}this[_0x9e18('0x206')](_0x53830b['id'],_0x437f4b,0x1,_0x53830b[_0x9e18('0x20e')],_0x53830b)['then'](function(_0x2f6879){if(!checkContactEmpty(_0x2f6879)){checkContactLowerLimitOriginate(_0x53830b,0x1,0x0);_0x24a5f1[_0x9e18('0xb7')](_0x53830b)[_0x9e18('0xb9')](sendMessageReschedule(_0x53830b))[_0x9e18('0xbc')](loggerCatch(_0x9e18('0xba')));}else{_0x53830b['message']=_0x9e18('0x208');if(_['isNil'](_0x2f6879[0x0])||_['isNil'](_0x2f6879[0x0]['Contact'])||_[_0x9e18('0xae')](_0x2f6879[0x0][_0x9e18('0x165')][_0x9e18('0x166')])){_0x24a5f1[_0x9e18('0xcf')](_0x9e18('0x209'),_0x53830b,_0x2f6879[0x0]);}else{_0x24a5f1['checkIsBlackList'](_[_0x9e18('0xd1')](_0x2f6879[0x0],[_0x9e18('0xd4'),'Contact.phone']))[_0x9e18('0xb9')](_0x24a5f1[_0x9e18('0x1e6')](_0x53830b,_0x2f6879[0x0]))['catch'](_0x24a5f1[_0x9e18('0xce')](_0x9e18('0x20f'),_0x53830b));}}})[_0x9e18('0xbc')](loggerGetContactDialer(_0x9e18('0x210'),_0x53830b,0x1));emitVoiceQueueSummary(_0x53830b);};Dialer[_0x9e18('0x1a')][_0x9e18('0x1da')]=function(_0x1be8d9,_0x4b87fb,_0x4184eb,_0x17d64,_0x1c3d62,_0x25c28c){loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x211'));loggerPredictive['info'](_0x9e18('0x212'),_0x1be8d9);loggerPredictive['info'](_0x9e18('0x213'),_0x4b87fb);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x214'),_0x4184eb);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x215'),_0x17d64);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x216'),_0x1c3d62);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x86'));return new BPromise(function(_0x2bea24,_0xb783d2){if(_0x1be8d9<=0x0||isNaN(_0x1be8d9)){return _0xb783d2(msgResponse(_0x9e18('0x217'),'Error',_0x9e18('0x218')+_0x1be8d9));}if(_0x4184eb<=0x0||isNaN(_0x4184eb)){return _0xb783d2(msgResponse(_0x9e18('0x217'),_0x9e18('0x47'),'Ts\x20=\x20'+_0x4184eb));}if(_0x17d64<=0x0||isNaN(_0x17d64)){return _0xb783d2(msgResponse(_0x9e18('0x217'),'Error',_0x9e18('0x219')+_0x17d64));}if(_0x4b87fb<=0x0||isNaN(_0x4b87fb)){return _0xb783d2(msgResponse(_0x9e18('0x217'),_0x9e18('0x47'),'interval\x20=\x20'+_0x4b87fb));}if(_0x1c3d62<=0x0||isNaN(_0x1c3d62)){return _0xb783d2(msgResponse(_0x9e18('0x217'),_0x9e18('0x47'),_0x9e18('0x21a')+_0x1c3d62));}_0x25c28c=_0x25c28c||0x0;var _0x552592=0x1/_0x4184eb;var _0xd55b6d=0x0;var _0x25ec2f=0x0;var _0x45f851=0x0;var _0x5710c8=0x0;for(var _0x1b0d4e=0x0;_0x45f851<_0x1c3d62;_0x1b0d4e+=0x1){_0x25ec2f=_0x1b0d4e/_0x4b87fb;_0xd55b6d=(_0x17d64*_0x25ec2f+_0x25c28c)/_0x552592;_0x45f851=erlangb(_0xd55b6d,_0x1be8d9);_0x5710c8=_0xd55b6d/_0x1be8d9*(0x1-erlangb(_0xd55b6d,_0x1be8d9));}return _0x2bea24({'erlangCalls':_0x1b0d4e,'erlangCallToSecond':_0x4b87fb/_0x1b0d4e,'erlangAbandonmentRate':_0x45f851,'erlangBusyFactor':_0x5710c8});});};Dialer[_0x9e18('0x1a')]['busyFactor']=function(_0x43ef97,_0x5d5db7,_0x54e152,_0xec1a61,_0x3de371,_0x3e49eb){loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x21b'));loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x212'),_0x43ef97);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x213'),_0x5d5db7);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x214'),_0x54e152);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x215'),_0xec1a61);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x21c'),_0x3de371);loggerPredictive[_0x9e18('0x7d')](_0x9e18('0x86'));return new BPromise(function(_0x350cbc,_0x4fe97c){if(_0x43ef97<=0x0||isNaN(_0x43ef97)){return _0x4fe97c(msgResponse('[busyFactor]',_0x9e18('0x47'),_0x9e18('0x218')+_0x43ef97));}if(_0x54e152<=0x0||isNaN(_0x54e152)){return _0x4fe97c(msgResponse(_0x9e18('0x21d'),_0x9e18('0x47'),'Ts\x20=\x20'+_0x54e152));}if(_0xec1a61<=0x0||isNaN(_0xec1a61)){return _0x4fe97c(msgResponse(_0x9e18('0x21d'),'Error',_0x9e18('0x219')+_0xec1a61));}if(_0x5d5db7<=0x0||isNaN(_0x5d5db7)){return _0x4fe97c(msgResponse(_0x9e18('0x21d'),_0x9e18('0x47'),'interval\x20=\x20'+_0x5d5db7));}if(_0x3de371<=0x0||isNaN(_0x3de371)){return _0x4fe97c(msgResponse(_0x9e18('0x21d'),_0x9e18('0x47'),_0x9e18('0x21e')+_0x3de371));}_0x3e49eb=_0x3e49eb||0x0;var _0x348e57=0x1/_0x54e152;var _0x108608=0x0;var _0x28f773=0x0;var _0x4bb176=0x0;var _0x18d045=0x0;for(var _0x3c2223=0x0;_0x18d045<_0x3de371;_0x3c2223+=0x1){_0x28f773=_0x3c2223/_0x5d5db7;_0x108608=(_0xec1a61*_0x28f773+_0x3e49eb)/_0x348e57;_0x4bb176=erlangb(_0x108608,_0x43ef97);_0x18d045=_0x108608/_0x43ef97*(0x1-erlangb(_0x108608,_0x43ef97));}return _0x350cbc({'erlangCalls':_0x3c2223,'erlangCallToSecond':_0x5d5db7/_0x3c2223,'erlangAbandonmentRate':_0x4bb176,'erlangBusyFactor':_0x18d045});});};module[_0x9e18('0x21f')]=Dialer; \ No newline at end of file +var _0x668b=['AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','countnosuchnumberretry','reason19\x20machine....','dialMachineMaxRetry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','cause-txt','Unknow','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','syncAgentConnect','[syncQueueCallerAbandon]\x20[Drop]','droptime','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','minutes','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','strategy','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','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','isArray','command','iftime\x20%s,%s','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','dialOriginateCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','phone','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','Error','responsetime','getQueue','response','callProgressDetecting','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][Drop]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','noanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','reason','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','predictiveIntervalMaxThreshold','round','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimization','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','outboundReCallsDay','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','handleIvr','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','dialOrderByScheduledAt','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','syncQueueSummary','hangup','newexten','syncNewExten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','Intervals','[ifTime][Action]','milliseconds','type','outbound','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','sequence','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','resolve','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','state','HangupInAMD','membername'];(function(_0x4e44d6,_0x395d6d){var _0x1f328c=function(_0x425e5a){while(--_0x425e5a){_0x4e44d6['push'](_0x4e44d6['shift']());}};_0x1f328c(++_0x395d6d);}(_0x668b,0x140));var _0xb668=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x668b[_0x16629d];return _0x56ccee;};'use strict';var util=require(_0xb668('0x0'));var _=require(_0xb668('0x1'));var BPromise=require('bluebird');var uuid=require(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xb668('0x4'));var ut=require('../preview/util/util');var config=require(_0xb668('0x5'));var logger=require(_0xb668('0x6'))(_0xb668('0x7'));var loggerBooked=require('../../../config/logger')(_0xb668('0x8'));var loggerPredictive=require(_0xb668('0x6'))(_0xb668('0x9'));var loggerPredictiveCalls=require(_0xb668('0x6'))(_0xb668('0xa'));var loggerSyncQueueSummary=require(_0xb668('0x6'))('syncQueueSummary');var ami=require(_0xb668('0xb'));config[_0xb668('0xc')]=_[_0xb668('0xd')](config[_0xb668('0xc')],{'host':_0xb668('0xe'),'port':0x18eb});var io=require(_0xb668('0xf'))(new Redis(config[_0xb668('0xc')]));var cmHopper=require(_0xb668('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xb668('0x11'));var voiceQueueRt=require(_0xb668('0x12'));var Action=require(_0xb668('0x13'));var History=require(_0xb668('0x14'));var Final=require(_0xb668('0x15'));var AgentComplete=require(_0xb668('0x16'));var QueueCallerAbandon=require(_0xb668('0x17'));var Hangup=require(_0xb668('0x18'));var ipAgi=process[_0xb668('0x19')][_0xb668('0x1a')]||_0xb668('0x1b');var strategy={'rrmemory':_0xb668('0x1c'),'roundrobin':_0xb668('0x1d')};var Sequence=function(){};Sequence[_0xb668('0x1e')][_0xb668('0x1f')]=function(_0x3b0c84){this[_0xb668('0x20')]=this[_0xb668('0x20')]?this[_0xb668('0x20')][_0xb668('0x21')](_0x3b0c84):_0x3b0c84();};function Dialer(_0xd3e39f,_0x27bbfa){this['sequence']=new Sequence();this[_0xb668('0x22')]=_0x27bbfa;this['voiceQueues']=_0xd3e39f[_0xb668('0x23')];this[_0xb668('0x24')]=_0xd3e39f['campaigns'];this[_0xb668('0x25')]=_0xd3e39f[_0xb668('0x25')];this['trunks']=_0xd3e39f[_0xb668('0x26')];this['maxNumberOriginate']=config[_0xb668('0x27')]||0x2;this[_0xb668('0x28')]={};this[_0xb668('0x29')]={};this[_0xb668('0x2a')]={};this['uniqueId']={};this[_0xb668('0x2b')]={};this[_0xb668('0x2c')]={};this[_0xb668('0x2d')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0xb668('0x2e')]={};ami['on'](_0xb668('0x2f'),this['syncAgentConnect'][_0xb668('0x30')](this));ami['on']('queuecallerabandon',this[_0xb668('0x31')]['bind'](this));ami['on'](_0xb668('0x32'),this[_0xb668('0x33')][_0xb668('0x30')](this));ami['on'](_0xb668('0x34'),this[_0xb668('0x35')][_0xb668('0x30')](this));ami['on']('custom:queuesummary',this[_0xb668('0x36')][_0xb668('0x30')](this));ami['on'](_0xb668('0x37'),this['syncHangup']['bind'](this));ami['on'](_0xb668('0x38'),this[_0xb668('0x39')][_0xb668('0x30')](this));ami['on']('varset',this[_0xb668('0x3a')][_0xb668('0x30')](this));ami['on'](_0xb668('0x3b'),this['syncQueueMember']['bind'](this));ami['on'](_0xb668('0x3c'),this[_0xb668('0x3d')]['bind'](this));this[_0xb668('0x3e')]();this[_0xb668('0x3f')]();}function isNotNull(_0x26918a){return _0x26918a!==null&&!_[_0xb668('0x40')](_0x26918a);}function checkIsLoggedIn(_0x256a8,_0x5f36b5){return function(){if(_0x5f36b5<=0x0){_0x256a8[_0xb668('0x41')]=_0xb668('0x42');throw _0x256a8['name']+_0xb668('0x43');}};}function isActive(_0x52a946){return _0x52a946;}function checkIsActive(_0x440236,_0x406cc5){return function(){if(!isActive(_0x406cc5)){_0x440236[_0xb668('0x41')]=_0xb668('0x44');throw _0x440236[_0xb668('0x45')]+_0xb668('0x46');}};}function checkInterval(_0x1c6dd7){return function(){if(!isNotNull(_0x1c6dd7[_0xb668('0x47')])){_0x1c6dd7[_0xb668('0x41')]='INTERVAL_IS_NULL';throw _0x1c6dd7[_0xb668('0x45')]+_0xb668('0x48');}if(!isNotNull(_0x1c6dd7[_0xb668('0x47')]['Intervals'])){_0x1c6dd7[_0xb668('0x41')]=_0xb668('0x49');throw _0x1c6dd7[_0xb668('0x45')]+_0xb668('0x48');}if(!isNotNull(_['isEmpty'](_0x1c6dd7[_0xb668('0x47')][_0xb668('0x4a')]))){_0x1c6dd7[_0xb668('0x41')]=_0xb668('0x49');throw _0x1c6dd7[_0xb668('0x45')]+_0xb668('0x48');}};}function msgResponse(_0x304311,_0x5a9134,_0x599eca){return{'action':_0x304311,'response':_0x5a9134,'message':_0x599eca,'stack':_0x599eca};}function myreject(_0x19de9f){return function(_0x5a9a55){return _0x19de9f(msgResponse(_0xb668('0x4b'),'Error',JSON['stringify'](_0x5a9a55)));};}function getSeconds(_0x39fa1a,_0x27539e){var _0x4850b7=moment(_0x39fa1a)[_0xb668('0x4c')](0x0);var _0x510f93=moment(_0x27539e)[_0xb668('0x4c')](0x0);return _0x4850b7['diff'](_0x510f93,'seconds');}function emit(_0x10ff88,_0x25fd3c,_0x48008b){io['to'](_0x10ff88)['emit'](_0x25fd3c,_0x48008b);}function emitVoiceQueueSummary(_0x218c1c){if(_0x218c1c[_0xb668('0x4d')]===_0xb668('0x4e')){var _0x187f4d={'id':_0x218c1c['id'],'name':_0x218c1c[_0xb668('0x45')],'strategy':_0x218c1c['strategy'],'answered':_0x218c1c['answered'],'available':_0x218c1c[_0xb668('0x4f')],'loggedIn':_0x218c1c[_0xb668('0x50')],'pTalking':_0x218c1c[_0xb668('0x51')],'sumBillable':_0x218c1c[_0xb668('0x52')],'sumDuration':_0x218c1c[_0xb668('0x53')],'sumHoldTime':_0x218c1c[_0xb668('0x54')]||0x0,'talking':_0x218c1c['talking'],'total':_0x218c1c['total'],'type':_0x218c1c[_0xb668('0x4d')],'unmanaged':_0x218c1c[_0xb668('0x55')],'abandoned':_0x218c1c[_0xb668('0x56')],'waiting':_0x218c1c[_0xb668('0x57')],'loggedInDb':_0x218c1c[_0xb668('0x58')],'dialActive':_0x218c1c['dialActive'],'dialMethod':_0x218c1c[_0xb668('0x59')],'dialOriginateCallerIdName':_0x218c1c[_0xb668('0x5a')],'dialOriginateCallerIdNumber':_0x218c1c['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x218c1c[_0xb668('0x5b')],'dialPrefix':_0x218c1c[_0xb668('0x5c')],'outboundAnswerAgiCallsDay':_0x218c1c[_0xb668('0x5d')],'outboundAnswerCallsDay':_0x218c1c[_0xb668('0x5e')],'outboundBlacklistCallsDay':_0x218c1c['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x218c1c['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x218c1c['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x218c1c[_0xb668('0x5f')],'outboundDropCallsDayCallersExit':_0x218c1c['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x218c1c['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x218c1c['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x218c1c['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x218c1c[_0xb668('0x60')],'outboundReCallsDay':_0x218c1c['outboundReCallsDay'],'outboundRejectCallsDay':_0x218c1c[_0xb668('0x61')],'outboundUnknownCallsDay':_0x218c1c[_0xb668('0x62')],'predictiveIntervalAnsweredCalls':_0x218c1c[_0xb668('0x63')],'predictiveIntervalAvgHoldtime':_0x218c1c[_0xb668('0x64')],'predictiveIntervalAvgTalktime':_0x218c1c[_0xb668('0x65')],'predictiveIntervalDroppedCallsCallersExit':_0x218c1c['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x218c1c[_0xb668('0x66')],'predictiveIntervalErlangCalls':_0x218c1c[_0xb668('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x218c1c[_0xb668('0x68')],'predictiveIntervalHitRate':_0x218c1c[_0xb668('0x69')],'predictiveIntervalMultiplicativeFactor':_0x218c1c[_0xb668('0x6a')],'predictiveIntervalPauses':_0x218c1c[_0xb668('0x6b')],'predictiveIntervalAvailable':_0x218c1c[_0xb668('0x6c')],'predictiveIntervalTotalCalls':_0x218c1c[_0xb668('0x6d')],'message':_0x218c1c[_0xb668('0x41')],'originated':_0x218c1c[_0xb668('0x6e')],'erlangCalls':_0x218c1c[_0xb668('0x6f')],'erlangCallToSecond':_0x218c1c['erlangCallToSecond'],'erlangAbandonmentRate':_0x218c1c[_0xb668('0x70')],'erlangBusyFactor':_0x218c1c[_0xb668('0x71')],'startPredictive':_0x218c1c[_0xb668('0x2c')],'startProgressive':_0x218c1c['startProgressive']};if(_0x218c1c['Trunk']){_0x187f4d[_0xb668('0x72')]={'id':_0x218c1c['Trunk']['id'],'name':_0x218c1c[_0xb668('0x72')]['name'],'active':_0x218c1c['Trunk']['active'],'callerid':_0x218c1c[_0xb668('0x72')][_0xb668('0x73')]};}if(_0x218c1c['Interval']){_0x187f4d[_0xb668('0x47')]={'id':_0x218c1c[_0xb668('0x47')]['id'],'name':_0x218c1c[_0xb668('0x47')][_0xb668('0x45')]};}var _0x16d06f=md5(JSON[_0xb668('0x74')](_0x187f4d));if(_0x218c1c[_0xb668('0x75')]!==_0x16d06f){_0x218c1c[_0xb668('0x75')]=_0x16d06f;emit(util[_0xb668('0x76')](_0xb668('0x77'),_0x187f4d['name']),_0xb668('0x78'),_0x187f4d);}}}function emitCampaignSummary(_0x415aba){if(_0x415aba[_0xb668('0x4d')]===_0xb668('0x79')){emit(util[_0xb668('0x76')](_0xb668('0x7a'),_0x415aba[_0xb668('0x45')]),_0xb668('0x7b'),_0x415aba);}}function checkGetDataPredictive(_0x3484dc){if(isNotNull(_0x3484dc)&&!_['isEmpty'](_0x3484dc)){loggerPredictive[_0xb668('0x7c')](_0xb668('0x7d'));loggerPredictive[_0xb668('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3484dc['predictiveIntervalTotalCalls']);loggerPredictive[_0xb668('0x7c')](_0xb668('0x7e'),_0x3484dc[_0xb668('0x63')]);loggerPredictive['info'](_0xb668('0x7f'),_0x3484dc['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xb668('0x80'),_0x3484dc[_0xb668('0x81')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x82'),_0x3484dc[_0xb668('0x64')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x83'),_0x3484dc[_0xb668('0x65')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x84'));if(_0x3484dc[_0xb668('0x6d')]>0x0){if(!_[_0xb668('0x40')](_0x3484dc[_0xb668('0x65')])&&_0x3484dc[_0xb668('0x65')]>0x0){return!![];}loggerPredictive[_0xb668('0x7c')](_0xb668('0x85'));if(!_[_0xb668('0x40')](_0x3484dc[_0xb668('0x64')])&&_0x3484dc[_0xb668('0x64')]>0x0){return!![];}loggerPredictive[_0xb668('0x7c')](_0xb668('0x86'));}else{loggerPredictive[_0xb668('0x7c')](_0xb668('0x87'));}}else{loggerPredictive[_0xb668('0x7c')](_0xb668('0x88'));}return![];}function mergeDataErlangB(_0xa74ae7){return function(_0x44724d){loggerPredictive[_0xb668('0x7c')](_0xb668('0x89'));loggerPredictive[_0xb668('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44724d[_0xb668('0x6f')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x8a'),_0x44724d[_0xb668('0x8b')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x8c'),_0x44724d[_0xb668('0x70')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x8d'),_0x44724d[_0xb668('0x71')]);loggerPredictive[_0xb668('0x7c')](_0xb668('0x8c'),_0x44724d[_0xb668('0x70')]);loggerPredictive['info'](_0xb668('0x84'));_[_0xb668('0x8e')](_0xa74ae7,_0x44724d);};}function getDiff(_0x537235){var _0x438c5b=moment()[_0xb668('0x4c')](0x0);var _0x50edcf=moment(_0x537235)[_0xb668('0x4c')](0x0);return _0x438c5b[_0xb668('0x8f')](_0x50edcf,'seconds');}function ifInterval(_0x2ea7b8,_0x568d4c){if(_[_0xb668('0x40')](_0x568d4c)){return![];}return getDiff(_0x568d4c)<_0x2ea7b8*0x3c;}function freeVariablesPredictive(_0x1978e4){if(isNotNull(_0x1978e4)){if(!_['isUndefined'](_0x1978e4[_0xb668('0x2d')])){_0x1978e4[_0xb668('0x2d')]=undefined;loggerPredictive[_0xb668('0x7c')](_0x1978e4[_0xb668('0x45')],_0xb668('0x90'));}if(!_[_0xb668('0x40')](_0x1978e4[_0xb668('0x2c')])){_0x1978e4[_0xb668('0x2c')]=undefined;loggerPredictive[_0xb668('0x7c')](_0x1978e4['name'],_0xb668('0x91'));}if(!_[_0xb668('0x40')](_0x1978e4[_0xb668('0x92')])){clearInterval(_0x1978e4[_0xb668('0x92')]);_0x1978e4[_0xb668('0x92')]=undefined;loggerPredictive['info'](_0x1978e4[_0xb668('0x45')],_0xb668('0x93'));}}}function erlangb(_0x276288,_0x4f78a5){if(_0x4f78a5===0x0){return 0x0;}var _0x41b08e=0x1;for(var _0x37169a=0x1;_0x37169a<=_0x4f78a5;_0x37169a+=0x1){_0x41b08e=0x1+_0x41b08e*_0x37169a/_0x276288;}return 0x1/_0x41b08e;}function isVoiceQueueOutbound(_0x409c8b){return _0x409c8b===_0xb668('0x4e');}function isNotPreview(_0x4e8288){return _0x4e8288!==_0xb668('0x22');}function isCampaignIvr(_0x231ef5){return _0x231ef5===_0xb668('0x79');}function getCallerId(_0x4b5f9d,_0xfaafb5,_0x1ffb89){if(!_[_0xb668('0x40')](_0x1ffb89)&&typeof _0x1ffb89===_0xb668('0x94')&&!_[_0xb668('0x95')](_0x1ffb89)){if(!_[_0xb668('0x40')](_0xfaafb5)&&typeof _0xfaafb5===_0xb668('0x94')&&!_[_0xb668('0x95')](_0xfaafb5)){return util[_0xb668('0x76')]('\x22%s\x22\x20<%s>',_0xfaafb5,_0x1ffb89);}return util[_0xb668('0x76')]('\x22%s\x22\x20<%s>',_0x1ffb89,_0x1ffb89);}if(!_[_0xb668('0x40')](_0x4b5f9d)&&typeof _0x4b5f9d==='string'&&!_[_0xb668('0x95')](_0x4b5f9d)){return _0x4b5f9d;}return _0xb668('0x96');}function loggerCatchQueueSummary(_0x2738e7,_0x4aa115){return function(_0x364356){freeVariablesPredictive(_0x4aa115);emitVoiceQueueSummary(_0x4aa115);emitCampaignSummary(_0x4aa115);loggerSyncQueueSummary[_0xb668('0x97')](_0x2738e7,util[_0xb668('0x98')](_0x364356,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x35a005,_0x37ad99){return function(_0x3aa1b1){loggerPredictive[_0xb668('0x97')](_0x37ad99[_0xb668('0x45')],_0x35a005);loggerPredictive[_0xb668('0x97')](_0x3aa1b1[_0xb668('0x99')]);freeVariablesPredictive(_0x37ad99);};}function loggerCatch(_0x7d3850){return function(_0x3136b7){logger[_0xb668('0x97')](_0x7d3850,util[_0xb668('0x98')](_0x3136b7,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2f274b){return _0x2f274b&&!_[_0xb668('0x40')](_0x2f274b)&&_0x2f274b[_0xb668('0x9a')]>0x0;}function decremetOriginate(_0x4260a9){if(!_[_0xb668('0x40')](_0x4260a9)&&_0x4260a9!==null){if(typeof _0x4260a9[_0xb668('0x6e')]!=='undefined'){if(_0x4260a9[_0xb668('0x6e')]>0x0){_0x4260a9[_0xb668('0x6e')]-=0x1;}else{logger['error'](_0xb668('0x9b'));}}}else{logger['error'](_0xb668('0x9c'));}}function checkContactLowerLimitOriginate(_0x43e15b,_0x562f04,_0x47e5a7){if(_0x562f04>_0x47e5a7){for(var _0xf93efe=0x0;_0xf93efe<_0x562f04-_0x47e5a7;_0xf93efe+=0x1){decremetOriginate(_0x43e15b);}}}function loggerGetContactDialer(_0x47174a,_0xb8b5bc,_0x486fbd){return function(_0x10a79e){checkContactLowerLimitOriginate(_0xb8b5bc,_0x486fbd,0x0);logger[_0xb668('0x97')](_0x47174a,util[_0xb668('0x98')](_0x10a79e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4f1712){return function(_0x60940a){if(isNotNull(_0x60940a)&&isNotNull(_0x60940a[0x0])){if(_0x60940a[0x0][_0xb668('0x9d')]>0x0){_0x4f1712[_0xb668('0x41')]=_0xb668('0x9e');logger[_0xb668('0x7c')](_0xb668('0x9f')+_0x4f1712[_0xb668('0x45')],_0x60940a[0x0][_0xb668('0x9d')],_0xb668('0xa0'));}else{_0x4f1712[_0xb668('0x41')]=_0xb668('0xa1');logger['info'](_0xb668('0xa2')+_0x4f1712['name']);}}};}function notSendMessagesQueue(_0x5e844b){if(_0x5e844b[_0xb668('0xa3')]){freeVariablesPredictive(_0x5e844b);if(_0x5e844b[_0xb668('0x6e')]===0x0&&_0x5e844b[_0xb668('0xa4')]===0x0&&_0x5e844b[_0xb668('0x57')]===0x0&&(_0x5e844b['pTalking']||0x0)===0x0){_0x5e844b[_0xb668('0xa3')]=![];_0x5e844b['available']=0x0;_0x5e844b[_0xb668('0x41')]=_0xb668('0x44');loggerSyncQueueSummary[_0xb668('0x97')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x5e844b[_0xb668('0x45')],_0xb668('0xa5'));}else{_0x5e844b[_0xb668('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xb668('0x97')](_0xb668('0xa6'),_0x5e844b[_0xb668('0x45')],_0xb668('0xa7'));}emitVoiceQueueSummary(_0x5e844b);}}function notSendMessagesCampaign(_0x57e479){if(_0x57e479[_0xb668('0xa3')]){if(_0x57e479[_0xb668('0x6e')]===0x0){_0x57e479['sendMessageOneNotActive']=![];_0x57e479[_0xb668('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb668('0x97')](_0xb668('0xa8'),_0x57e479[_0xb668('0x45')],_0xb668('0xa5'));}else{_0x57e479[_0xb668('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary['error'](_0xb668('0xa8'),_0x57e479[_0xb668('0x45')],_0xb668('0xa7'));}emitCampaignSummary(_0x57e479);}}function createObjHistory(_0x3a10c2,_0x138ee8,_0x2d4131,_0x10a19b,_0x3bc797){_0x3a10c2[_0xb668('0x41')]=_0x2d4131;var _0x2bcea0=new Action(_0x3a10c2,_0x138ee8);var _0x2a5c4c=new History(_0x2bcea0);_0x2a5c4c['state']=_0x10a19b;_0x2a5c4c[_0xb668('0xa9')]=_0x3bc797;_0x2a5c4c[_0xb668('0xaa')]=_0x2bcea0['starttime'];return _0x2a5c4c;}Dialer[_0xb668('0x1e')][_0xb668('0x3f')]=function(){var _0x1ddfd1=this;setInterval(function(){_0x1ddfd1[_0xb668('0xab')](_0x1ddfd1[_0xb668('0xac')],_0xb668('0xad'));_0x1ddfd1[_0xb668('0xab')](_0x1ddfd1['actions'],_0xb668('0xae'));},0x32c8);};Dialer['prototype'][_0xb668('0xab')]=function(_0x1eb38f,_0x1b547b){var _0x473ac8=this;for(var _0x116270 in _0x1eb38f){if(typeof _0x1eb38f[_0x116270]!=='undefined'){this[_0xb668('0xaf')][_0xb668('0x1f')](function(){if(!_[_0xb668('0xb0')](_0x1eb38f[_0x116270])){return ami[_0xb668('0xb1')]({'action':_0xb668('0xb2'),'channel':_0x1eb38f[_0x116270][_0xb668('0xb3')]})['catch'](function(_0x537a1c){if(_0x537a1c[_0xb668('0x41')]===_0xb668('0xb4')){setTimeout(function(){if(_0x1eb38f[_0x116270]&&_0x1eb38f[_0x116270][_0xb668('0x4d')]!==_0xb668('0x79')){_0x473ac8[_0xb668('0xb5')](_0x473ac8[_0xb668('0x23')][_0x1eb38f[_0x116270][_0xb668('0xb6')]]);logger['error'](_0xb668('0xb7'),_0x1b547b,_0x116270,_0x1eb38f[_0x116270][_0xb668('0xb6')]);delete _0x1eb38f[_0x116270];}if(_0x1eb38f[_0x116270]&&_0x1eb38f[_0x116270][_0xb668('0x4d')]==='ivr'){_0x473ac8[_0xb668('0xb5')](_0x473ac8['campaigns'][_0x1eb38f[_0x116270][_0xb668('0xb6')]]);logger[_0xb668('0x97')](_0xb668('0xb8'),_0x1b547b,_0x116270,_0x1eb38f[_0x116270][_0xb668('0xb6')]);delete _0x1eb38f[_0x116270];}},0x2328);}});}});}}};Dialer[_0xb668('0x1e')][_0xb668('0xb9')]=function(_0x219332){return BPromise['resolve']()['then'](cmHopper[_0xb668('0xb9')](_0x219332))[_0xb668('0xba')](loggerCatch(_0xb668('0xbb')));};Dialer[_0xb668('0x1e')][_0xb668('0xbc')]=function(_0x28bb86){return BPromise[_0xb668('0xbd')]()[_0xb668('0xbe')](cmHopperBlack[_0xb668('0xbc')](_0x28bb86))[_0xb668('0xba')](loggerCatch(_0xb668('0xbf')));};Dialer[_0xb668('0x1e')][_0xb668('0xc0')]=function(_0x58a898){return BPromise[_0xb668('0xbd')]()[_0xb668('0xbe')](cmHopperBlack[_0xb668('0xc0')](_0x58a898))[_0xb668('0xba')](loggerCatch(_0xb668('0xc1')));};Dialer[_0xb668('0x1e')][_0xb668('0xc2')]=function(_0xb9db2c){return BPromise['resolve']()[_0xb668('0xbe')](cmHopperHistory['avgHandleTime'](_0xb9db2c))['catch'](loggerCatch(_0xb668('0xc3')));};Dialer[_0xb668('0x1e')]['rescheduleContact']=function(_0x442bc1){return BPromise['resolve']()[_0xb668('0xbe')](cmHopper[_0xb668('0xc4')](_0x442bc1))[_0xb668('0xba')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xb668('0x1e')][_0xb668('0xc5')]=function(_0x3e8603,_0xf5b01c,_0x57eb41){return BPromise['resolve']()[_0xb668('0xbe')](cmHopper[_0xb668('0xc5')](_0x3e8603,_0xf5b01c,_0x57eb41))['catch'](loggerCatch(_0xb668('0xc6')));};Dialer['prototype'][_0xb668('0xc7')]=function(_0x2f988c,_0x102265,_0x19d55e,_0x506197,_0x5ca3ad){return BPromise[_0xb668('0xbd')]()[_0xb668('0xbe')](cmHopper[_0xb668('0xc7')](_0x2f988c,_0x102265,_0x19d55e,_0x506197))['catch'](function(_0x70477a){_0x5ca3ad[_0xb668('0xc8')]-=_0x19d55e;_0x5ca3ad[_0xb668('0xc8')]=_0x5ca3ad['temp']>0x0?_0x5ca3ad[_0xb668('0xc8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x70477a);});};Dialer[_0xb668('0x1e')][_0xb668('0xc9')]=function(_0x1a9bfb,_0x31ccc2,_0x3645c6,_0x5d93db){return BPromise['resolve']()[_0xb668('0xbe')](cmHopper[_0xb668('0xc9')](_0x1a9bfb,_0x31ccc2,_0x3645c6))[_0xb668('0xba')](function(_0x212a9d){_0x5d93db['temp']-=_0x31ccc2;_0x5d93db['temp']=_0x5d93db[_0xb668('0xc8')]>0x0?_0x5d93db[_0xb668('0xc8')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x212a9d);});};Dialer[_0xb668('0x1e')][_0xb668('0xca')]=function(_0x3eef84){return BPromise[_0xb668('0xbd')]()[_0xb668('0xbe')](voiceQueueRt[_0xb668('0xca')](_0x3eef84))[_0xb668('0xba')](loggerCatch(_0xb668('0xcb')));};Dialer[_0xb668('0x1e')][_0xb668('0xcc')]=function(_0x4b9faa){return BPromise[_0xb668('0xbd')]()[_0xb668('0xbe')](cmHopper[_0xb668('0xcc')](_0x4b9faa))[_0xb668('0xba')](loggerCatch(_0xb668('0xcd')));};Dialer[_0xb668('0x1e')][_0xb668('0xce')]=function(_0x40ec49){return BPromise[_0xb668('0xbd')]()[_0xb668('0xbe')](cmHopperHistory['createHistory'](_0x40ec49))[_0xb668('0xba')](loggerCatch(_0xb668('0xcf')));};Dialer['prototype'][_0xb668('0xb5')]=function(_0x3488b0){if(!_[_0xb668('0x40')](_0x3488b0)&&_0x3488b0!==null){if(typeof _0x3488b0['originated']!==_0xb668('0xd0')){if(_0x3488b0[_0xb668('0x6e')]>0x0){_0x3488b0['originated']-=0x1;}else{logger['error'](_0xb668('0xd1'));}}}else{logger[_0xb668('0x97')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xb668('0x1e')]['loggerHandler']=function(_0x1a05b8,_0x5ab3e8){var _0x19d783=this;return function(_0x1fc3aa){_0x19d783[_0xb668('0xb5')](_0x5ab3e8);logger[_0xb668('0x97')](_0x1a05b8,util['inspect'](_0x1fc3aa,{'showHidden':![],'depth':null}));};};Dialer[_0xb668('0x1e')][_0xb668('0xd2')]=function(_0x22f07b,_0x4d1924,_0x4984f0){var _0x3db0d4={'state':0x19,'statedesc':_0xb668('0xd3')};this[_0xb668('0xb5')](_0x4d1924);this[_0xb668('0xd4')](_['merge'](_0x3db0d4,_[_0xb668('0xd5')](_0x4984f0,[_0xb668('0xd6'),_0xb668('0xd7'),'UserId',_0xb668('0xd8'),_0xb668('0xd9')])),_0xb668('0xda'),'[emptyContact]');logger[_0xb668('0x97')](_0x22f07b);};Dialer[_0xb668('0x1e')][_0xb668('0xdb')]=function(_0x5431a8){return _0x5431a8===_0xb668('0xdc');};Dialer[_0xb668('0x1e')][_0xb668('0xdd')]=function(_0x108850){return!_[_0xb668('0x40')](_0x108850)&&_0x108850&&!_['isUndefined'](_0x108850[_0xb668('0x45')])&&!_['isUndefined'](_0x108850[_0xb668('0xde')])&&_0x108850['active']&&(this[_0xb668('0x26')][util[_0xb668('0x76')](_0xb668('0xdf'),_0x108850[_0xb668('0x45')])][_0xb668('0xb2')]===_0xb668('0xe0')||this[_0xb668('0x26')][util[_0xb668('0x76')](_0xb668('0xdf'),_0x108850['name'])][_0xb668('0xb2')]===_0xb668('0xe1'));};Dialer['prototype'][_0xb668('0xd4')]=function(_0x4fa5f7,_0x34d80,_0x390d76){this[_0xb668('0xce')](_0x4fa5f7)['catch'](loggerCatch(_0x34d80));this[_0xb668('0xcc')](_0x4fa5f7)[_0xb668('0xba')](loggerCatch(_0x390d76));};Dialer[_0xb668('0x1e')]['syncVarSet']=function(_0x4c4a64){var _0xf98198=this[_0xb668('0xac')][_0x4c4a64[_0xb668('0xe2')]];var _0x17d9d3;if(!_[_0xb668('0xb0')](_0x4c4a64)&&!_[_0xb668('0xb0')](_0x4c4a64[_0xb668('0xe3')])&&!_[_0xb668('0xb0')](_0x4c4a64['variable'][_0xb668('0xe4')])&&_0x4c4a64[_0xb668('0xe5')]===_0xb668('0xe6')&&_0xf98198){if(_0xf98198[_0xb668('0x4d')]!=='ivr'&&this['voiceQueues'][_0xf98198[_0xb668('0xb6')]][_0xb668('0xe7')]&&_0x4c4a64[_0xb668('0xe8')]==='HANGUP'){delete this[_0xb668('0xac')][_0x4c4a64[_0xb668('0xe2')]];this[_0xb668('0xb5')](this['voiceQueues'][_0xf98198[_0xb668('0xb6')]]);this[_0xb668('0x23')][_0xf98198[_0xb668('0xb6')]][_0xb668('0x5e')]+=0x1;this[_0xb668('0x23')][_0xf98198[_0xb668('0xb6')]][_0xb668('0x5d')]+=0x1;_0x17d9d3=new Hangup(_0xf98198,_0x4c4a64);_0x17d9d3[_0xb668('0xe9')]=0x12;_0x17d9d3[_0xb668('0xa9')]=_0xb668('0xea');_0x17d9d3[_0xb668('0xeb')]=_0xb668('0xec');ami[_0xb668('0xed')](_0xb668('0xee'),ut[_0xb668('0xef')](_0x17d9d3,_0xb668('0xf0')));this[_0xb668('0xd4')](_0x17d9d3,_0xb668('0xf1'),_0xb668('0xf2'));}if(_0xf98198[_0xb668('0x4d')]!==_0xb668('0x79')&&this['voiceQueues'][_0xf98198['queue']]['dialAMDActive']&&_0x4c4a64[_0xb668('0xe8')]===_0xb668('0xf3')){var _0x569d78=this;return new BPromise(function(_0x1ea0b9,_0x19b6bf){delete _0x569d78['uniqueId'][_0x4c4a64[_0xb668('0xe2')]];_0x569d78[_0xb668('0xb5')](_0x569d78[_0xb668('0x23')][_0xf98198[_0xb668('0xb6')]]);_0x569d78[_0xb668('0x23')][_0xf98198[_0xb668('0xb6')]][_0xb668('0x5e')]+=0x1;_0x569d78[_0xb668('0x23')][_0xf98198[_0xb668('0xb6')]][_0xb668('0x5d')]+=0x1;var _0x672fc1=_0x569d78[_0xb668('0x23')][_0xf98198[_0xb668('0xb6')]];var _0x47467d=new Hangup(_0xf98198,_0x4c4a64);_0x47467d['state']=0x13;_0x47467d[_0xb668('0xa9')]=_0xb668('0xf4');_0x47467d['membername']=_0xb668('0xec');_0x47467d['countmachineretry']+=0x1;_0x47467d[_0xb668('0xf5')]+=0x1;_0x47467d['amd']=!![];ami[_0xb668('0xed')](_0xb668('0xee'),ut[_0xb668('0xef')](_0x47467d,_0xb668('0xf0')));_0x569d78[_0xb668('0xce')](_0x47467d)[_0xb668('0xba')](loggerCatch(_0xb668('0xf6')));if(_0x47467d[_0xb668('0xf7')]+_0x47467d['countcongestionretry']+_0x47467d[_0xb668('0xf8')]+_0x47467d['countnosuchnumberretry']+_0x47467d[_0xb668('0xf9')]+_0x47467d[_0xb668('0xfa')]+_0x47467d[_0xb668('0xfb')]+_0x47467d[_0xb668('0xfc')]>=_0x672fc1[_0xb668('0xfd')]){_0x569d78[_0xb668('0xfe')](_0x47467d,_0x1ea0b9,_0x19b6bf,'reason19\x20machine....');}else{if(_0x47467d[_0xb668('0xfb')]>=_0x672fc1['dialMachineMaxRetry']){_0x569d78[_0xb668('0xff')](_0x47467d,_0x1ea0b9,_0x19b6bf,_0xb668('0x100'));}else{_0x569d78[_0xb668('0xc4')]({'active':![],'countmachineretry':_0x47467d[_0xb668('0xfb')],'scheduledat':moment()[_0xb668('0x101')](_0x672fc1[_0xb668('0x102')],'minutes')[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x47467d[_0xb668('0xd6')],'ListId':_0x47467d[_0xb668('0xd7')],'VoiceQueueId':_0x47467d[_0xb668('0xd8')]||undefined,'CampaignId':_0x47467d['CampaignId']||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x104')));_0x1ea0b9({'reschedule':0x1});}}});}if(_0xf98198['type']===_0xb668('0x79')&&this[_0xb668('0x24')][_0xf98198[_0xb668('0xb6')]][_0xb668('0xe7')]&&_0x4c4a64[_0xb668('0xe8')]===_0xb668('0x105')){delete this[_0xb668('0xac')][_0x4c4a64[_0xb668('0xe2')]];this[_0xb668('0xb5')](this[_0xb668('0x24')][_0xf98198[_0xb668('0xb6')]]);_0x17d9d3=new Hangup(_0xf98198,_0x4c4a64);_0x17d9d3[_0xb668('0xe9')]=0x12;_0x17d9d3[_0xb668('0xa9')]=_0xb668('0xea');_0x17d9d3[_0xb668('0xeb')]=_0xb668('0xec');ami[_0xb668('0xed')](_0xb668('0xee'),ut[_0xb668('0xef')](_0x17d9d3,'amd'));this[_0xb668('0xd4')](_0x17d9d3,_0xb668('0x106'),_0xb668('0x107'));}if(_0xf98198['type']===_0xb668('0x79')&&this[_0xb668('0x24')][_0xf98198['queue']]['dialAMDActive']&&_0x4c4a64[_0xb668('0xe8')]==='MACHINE'){var _0x569d78=this;return new BPromise(function(_0x2a4752,_0x1c20dc){delete _0x569d78[_0xb668('0xac')][_0x4c4a64[_0xb668('0xe2')]];_0x569d78[_0xb668('0xb5')](_0x569d78[_0xb668('0x24')][_0xf98198[_0xb668('0xb6')]]);_0x569d78[_0xb668('0x24')][_0xf98198[_0xb668('0xb6')]][_0xb668('0x5e')]+=0x1;_0x569d78[_0xb668('0x24')][_0xf98198[_0xb668('0xb6')]][_0xb668('0x5d')]+=0x1;var _0x58e4eb=_0x569d78[_0xb668('0x24')][_0xf98198[_0xb668('0xb6')]];var _0xea4b26=new Hangup(_0xf98198,_0x4c4a64);_0xea4b26[_0xb668('0xe9')]=0x13;_0xea4b26[_0xb668('0xa9')]='Machine';_0xea4b26[_0xb668('0xeb')]='AMD';_0xea4b26[_0xb668('0xfb')]+=0x1;_0xea4b26[_0xb668('0xf5')]+=0x1;_0xea4b26[_0xb668('0xf0')]=!![];ami[_0xb668('0xed')](_0xb668('0xee'),ut[_0xb668('0xef')](_0xea4b26,_0xb668('0xf0')));_0x569d78['createHistory'](_0xea4b26)['catch'](loggerCatch(_0xb668('0xf6')));if(_0xea4b26['countbusyretry']+_0xea4b26[_0xb668('0x108')]+_0xea4b26['countnoanswerretry']+_0xea4b26[_0xb668('0x109')]+_0xea4b26[_0xb668('0xf9')]+_0xea4b26['countabandonedretry']+_0xea4b26[_0xb668('0xfb')]+_0xea4b26[_0xb668('0xfc')]>=_0x58e4eb[_0xb668('0xfd')]){_0x569d78[_0xb668('0xfe')](_0xea4b26,_0x2a4752,_0x1c20dc,_0xb668('0x10a'));}else{if(_0xea4b26[_0xb668('0xfb')]>=_0x58e4eb[_0xb668('0x10b')]){_0x569d78[_0xb668('0xff')](_0xea4b26,_0x2a4752,_0x1c20dc,_0xb668('0x100'));}else{_0x569d78[_0xb668('0xc4')]({'active':![],'countmachineretry':_0xea4b26[_0xb668('0xfb')],'scheduledat':moment()[_0xb668('0x101')](_0x58e4eb[_0xb668('0x102')],'minutes')[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0xea4b26['ContactId'],'ListId':_0xea4b26['ListId'],'VoiceQueueId':_0xea4b26[_0xb668('0xd8')]||undefined,'CampaignId':_0xea4b26[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x104')));_0x2a4752({'reschedule':0x1});}}});}}};Dialer[_0xb668('0x1e')][_0xb668('0x10c')]=function(_0x268280){var _0x5e8ade=this[_0xb668('0xac')][_0x268280[_0xb668('0xe2')]];var _0x2f1b93=this;var _0x13045a;if(_0x5e8ade&&_0x5e8ade['type']===_0xb668('0x79')){delete this[_0xb668('0xac')][_0x268280[_0xb668('0xe2')]];this[_0xb668('0xb5')](this[_0xb668('0x24')][_0x5e8ade[_0xb668('0xb6')]]);this[_0xb668('0x24')][_0x5e8ade['queue']][_0xb668('0x10d')]+=0x1;_0x13045a=new Hangup(_0x5e8ade,_0x268280);this[_0xb668('0xce')](_0x13045a)[_0xb668('0xba')](loggerCatch(_0xb668('0x10e')));this[_0xb668('0xcc')](_0x13045a)[_0xb668('0xba')](loggerCatch(_0xb668('0x10f')));}if(_0x5e8ade&&_0x5e8ade[_0xb668('0x4d')]!==_0xb668('0x79')&&isNotNull(this[_0xb668('0x23')][_0x5e8ade[_0xb668('0xb6')]]['dialQueueProject'])){delete this['uniqueId'][_0x268280[_0xb668('0xe2')]];this[_0xb668('0xb5')](this[_0xb668('0x23')][_0x5e8ade[_0xb668('0xb6')]]);this[_0xb668('0x23')][_0x5e8ade[_0xb668('0xb6')]]['outboundAnswerCallsDay']+=0x1;this[_0xb668('0x23')][_0x5e8ade[_0xb668('0xb6')]][_0xb668('0x5d')]+=0x1;_0x13045a=new Hangup(_0x5e8ade,_0x268280);_0x13045a[_0xb668('0xe9')]=0x10;_0x13045a[_0xb668('0xa9')]='AnswerAGI';_0x13045a[_0xb668('0xeb')]=_0xb668('0x110');this[_0xb668('0xce')](_0x13045a)[_0xb668('0xba')](loggerCatch(_0xb668('0x10e')));this[_0xb668('0xcc')](_0x13045a)[_0xb668('0xba')](loggerCatch(_0xb668('0x10f')));}if(_0x5e8ade&&_0x5e8ade['type']!==_0xb668('0x79')&&!isNotNull(this['voiceQueues'][_0x5e8ade[_0xb668('0xb6')]][_0xb668('0x111')])){delete this[_0xb668('0xac')][_0x268280[_0xb668('0xe2')]];this[_0xb668('0xb5')](this[_0xb668('0x23')][_0x5e8ade[_0xb668('0xb6')]]);this[_0xb668('0x23')][_0x5e8ade[_0xb668('0xb6')]]['outboundUnknownCallsDay']+=0x1;_0x13045a=new Hangup(_0x5e8ade,_0x268280);_0x13045a['state']=0xc;_0x13045a[_0xb668('0xa9')]=_0x268280[_0xb668('0x112')];_0x13045a[_0xb668('0xeb')]=_0xb668('0x113');this[_0xb668('0xce')](_0x13045a)['catch'](loggerCatch(_0xb668('0x10e')));this[_0xb668('0xcc')](_0x13045a)[_0xb668('0xba')](loggerCatch(_0xb668('0x10f')));}};Dialer[_0xb668('0x1e')]['syncAgentComplete']=function(_0xc82700){var _0x491694=this[_0xb668('0xac')][_0xc82700[_0xb668('0xe2')]];var _0x374bc3=this;if(this['voiceQueues'][_0xc82700[_0xb668('0xb6')]]){if(_0x491694&&_0x491694[_0xb668('0x4d')]!==_0xb668('0x79')){delete this['uniqueId'][_0xc82700['uniqueid']];this[_0xb668('0x23')][_0xc82700[_0xb668('0xb6')]][_0xb668('0x5e')]+=0x1;var _0x5bc800=new AgentComplete(_0x491694,_0xc82700);if(_0xc82700['reason']==='agent'){_0x5bc800[_0xb668('0x114')]=this[_0xb668('0x23')][_0xc82700['queue']]['dialQueueProject2']&&this[_0xb668('0x23')][_0xc82700['queue']][_0xb668('0x115')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xb668('0xce')](_0x5bc800)[_0xb668('0xba')](loggerCatch(_0xb668('0x116')));this['moveContactManagedDialer'](_0x5bc800)[_0xb668('0xba')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0xb668('0x117')]=function(_0x3c2e80){if(this[_0xb668('0x23')][_0x3c2e80[_0xb668('0xb6')]]){if(this[_0xb668('0xac')][_0x3c2e80['uniqueid']]&&this[_0xb668('0xac')][_0x3c2e80[_0xb668('0xe2')]][_0xb668('0x4d')]!==_0xb668('0x79')){this[_0xb668('0xb5')](this['voiceQueues'][_0x3c2e80['queue']]);this['uniqueId'][_0x3c2e80[_0xb668('0xe2')]]['answertime']=moment()[_0xb668('0x76')](_0xb668('0x103'));}}};Dialer[_0xb668('0x1e')]['queueCallerAbandonCreateState']=function(_0xc227d7){this['createHistory'](_0xc227d7)[_0xb668('0xba')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xb668('0xcc')](_0xc227d7)[_0xb668('0xba')](loggerCatch(_0xb668('0x118')));};Dialer[_0xb668('0x1e')]['syncQueueCallerAbandon']=function(_0x23d579){var _0x2382fc=this['uniqueId'][_0x23d579[_0xb668('0xe2')]];var _0x22cf52=this;if(this['voiceQueues'][_0x23d579['queue']]){if(_0x2382fc&&_0x2382fc[_0xb668('0x4d')]!==_0xb668('0x79')){delete this[_0xb668('0xac')][_0x23d579[_0xb668('0xe2')]];this[_0xb668('0xb5')](this['voiceQueues'][_0x23d579[_0xb668('0xb6')]]);_0x2382fc[_0xb668('0x119')]=moment()[_0xb668('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x343f0b=new QueueCallerAbandon(_0x2382fc,_0x23d579);if(getSeconds(_0x2382fc['droptime'],_0x2382fc['responsetime'])>=_0x2382fc['dialQueueTimeout']){this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]][_0xb668('0x66')]+=0x1;this['voiceQueues'][_0x23d579['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x343f0b[_0xb668('0xe9')]=0xa;_0x343f0b[_0xb668('0xa9')]='Drop';_0x343f0b[_0xb668('0x11a')]=_0xb668('0x11b');_0x343f0b['agiafterat']=this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]][_0xb668('0x11c')]?moment()[_0xb668('0x76')](_0xb668('0x103')):undefined;_0x343f0b[_0xb668('0xf9')]+=0x1;_0x343f0b[_0xb668('0xf5')]+=0x1;if(_0x343f0b['countdropretry']>=this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]][_0xb668('0x11d')]){this[_0xb668('0x11e')](_0x343f0b);}else{this[_0xb668('0xc4')]({'active':![],'countdropretry':_0x343f0b[_0xb668('0xf9')],'scheduledat':moment()[_0xb668('0x101')](this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]][_0xb668('0x11f')],'minutes')[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x2382fc[_0xb668('0xd6')],'ListId':_0x2382fc[_0xb668('0xd7')],'VoiceQueueId':_0x2382fc[_0xb668('0xd8')]||undefined,'CampaignId':_0x2382fc[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[rescheduleContact][Drop]'));var _0x34c3f1=new History(_0x343f0b);_0x34c3f1[_0xb668('0xe9')]=0xa;_0x34c3f1[_0xb668('0xa9')]=_0xb668('0x120');_0x34c3f1[_0xb668('0x121')]=moment()[_0xb668('0x76')](_0xb668('0x103'));_0x34c3f1['endtime']=_0x34c3f1[_0xb668('0x121')];_0x34c3f1[_0xb668('0x122')]=_0x343f0b[_0xb668('0x122')];_0x34c3f1['calleridnum']=_0x343f0b[_0xb668('0x123')];this[_0xb668('0xce')](_0x34c3f1)[_0xb668('0xba')](loggerCatch(_0xb668('0x124')));}}else{this['voiceQueues'][_0x23d579[_0xb668('0xb6')]][_0xb668('0x81')]+=0x1;this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x343f0b[_0xb668('0xe9')]=0xb;_0x343f0b['statedesc']=_0xb668('0x125');_0x343f0b[_0xb668('0x11a')]=_0xb668('0x126');_0x343f0b['countabandonedretry']+=0x1;_0x343f0b[_0xb668('0xf5')]+=0x1;if(_0x343f0b['countabandonedretry']>=this[_0xb668('0x23')][_0x23d579[_0xb668('0xb6')]][_0xb668('0x127')]){this['queueCallerAbandonCreateState'](_0x343f0b);}else{this[_0xb668('0xc4')]({'active':![],'countabandonedretry':_0x343f0b[_0xb668('0xfa')],'scheduledat':moment()['add'](this[_0xb668('0x23')][_0x23d579['queue']][_0xb668('0x128')],_0xb668('0x129'))['format'](_0xb668('0x103')),'ContactId':_0x2382fc[_0xb668('0xd6')],'ListId':_0x2382fc[_0xb668('0xd7')],'VoiceQueueId':_0x2382fc[_0xb668('0xd8')]||undefined,'CampaignId':_0x2382fc[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x12a')));var _0x34c3f1=new History(_0x343f0b);_0x34c3f1['state']=0xb;_0x34c3f1['statedesc']='Abandoned';_0x34c3f1[_0xb668('0x121')]=moment()[_0xb668('0x76')](_0xb668('0x103'));_0x34c3f1[_0xb668('0xaa')]=_0x34c3f1['starttime'];_0x34c3f1[_0xb668('0x122')]=_0x343f0b[_0xb668('0x122')];_0x34c3f1[_0xb668('0x123')]=_0x343f0b[_0xb668('0x123')];this['createHistory'](_0x34c3f1)['catch'](loggerCatch(_0xb668('0x12b')));}}}}};Dialer[_0xb668('0x1e')][_0xb668('0x39')]=function(_0x18a87b){if(this[_0xb668('0x29')][_0x18a87b[_0xb668('0xe2')]]){this[_0xb668('0x29')][_0x18a87b[_0xb668('0xe2')]]['channel']=_0x18a87b[_0xb668('0xb3')];}if(this[_0xb668('0xac')][_0x18a87b['uniqueid']]){this[_0xb668('0xac')][_0x18a87b[_0xb668('0xe2')]][_0xb668('0xb3')]=_0x18a87b[_0xb668('0xb3')];}};Dialer[_0xb668('0x1e')][_0xb668('0x12c')]=function(_0x4c7aaf){if(strategy[this['voiceQueues'][this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]][_0xb668('0xb6')]][_0xb668('0x12e')]]===_0xb668('0x1d')){if(this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]]&&_[_0xb668('0xb0')](this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]][_0xb668('0x12f')])&&_0x4c7aaf[_0xb668('0xb2')]==='1'&&_0x4c7aaf[_0xb668('0x130')]==='0'){if(this[_0xb668('0x25')][_0x4c7aaf[_0xb668('0x131')]]){if(!this[_0xb668('0x25')][_0x4c7aaf[_0xb668('0x131')]][_0xb668('0x12f')]){this[_0xb668('0x25')][_0x4c7aaf[_0xb668('0x131')]]['locked']=!![];this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]][_0xb668('0x12f')]=!![];this['actions'][_0x4c7aaf['actionid']][_0xb668('0x131')]=_0x4c7aaf['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x4c7aaf['actionid']][_0xb668('0xb6')]][_0xb668('0x12e')]]||_0xb668('0x1c'))===_0xb668('0x1c')){if(this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]]){if(this['agents'][_0x4c7aaf['stateinterface']]){this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]]['stateinterface']=_0x4c7aaf[_0xb668('0x131')];if(_[_0xb668('0xb0')](this[_0xb668('0x132')][this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]][_0xb668('0xb6')]])){this[_0xb668('0x132')][this[_0xb668('0x29')][_0x4c7aaf['actionid']][_0xb668('0xb6')]]=[];}this[_0xb668('0x132')][this['actions'][_0x4c7aaf[_0xb668('0x12d')]][_0xb668('0xb6')]][_0xb668('0x133')](_[_0xb668('0x8e')](_[_0xb668('0xd5')](this[_0xb668('0x29')][_0x4c7aaf[_0xb668('0x12d')]],[_0xb668('0x134'),_0xb668('0x131')]),{'status':_0x4c7aaf['status'],'paused':_0x4c7aaf['paused']}));}}}};function unlockQueueStatus(_0x32c62a,_0x19b0f0){setTimeout(function(){if(_[_0xb668('0x40')](_0x32c62a[_0xb668('0x135')])){loggerBooked['error'](_0xb668('0x136'),_0x19b0f0);}_0x32c62a[_0xb668('0x135')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x19b0f0,JSON[_0xb668('0x74')](_['pick'](_0x32c62a,['name',_0xb668('0x135')])));},0x1f3);}Dialer['prototype'][_0xb668('0x3d')]=function(_0x3c8c9d){var _0x28c650=this;var _0x337620=_0x28c650['voiceQueues'][_0x28c650[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]];if(strategy[this[_0xb668('0x23')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]]['queue']][_0xb668('0x12e')]]===_0xb668('0x1d')){if(this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]]&&this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0x131')]){this[_0xb668('0x22')]['run'](this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0x134')],this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0x131')])['catch'](function(_0x1dbea1){logger[_0xb668('0x97')](_0xb668('0x137'),util[_0xb668('0x98')](_0x1dbea1,{'showHidden':![],'depth':null}));})[_0xb668('0x21')](function(){_0x28c650[_0xb668('0xb5')](_0x28c650[_0xb668('0x23')][_0x28c650['actions'][_0x3c8c9d['actionid']][_0xb668('0xb6')]]);_0x28c650[_0xb668('0x25')][_0x28c650[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0x131')]][_0xb668('0x12f')]=![];delete _0x28c650[_0xb668('0x29')][_0x3c8c9d['actionid']];unlockQueueStatus(_0x337620);});}else{this[_0xb668('0xb5')](this[_0xb668('0x23')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]]);this[_0xb668('0xc4')]({'active':![],'ContactId':this['actions'][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xd6')],'ListId':this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xd7')],'VoiceQueueId':this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xd8')]||undefined,'CampaignId':this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]];unlockQueueStatus(_0x337620);}}else if((strategy[this[_0xb668('0x23')][this[_0xb668('0x29')][_0x3c8c9d['actionid']]['queue']][_0xb668('0x12e')]]||_0xb668('0x1c'))===_0xb668('0x1c')){var _0x55fb67;if(this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]]&&!_[_0xb668('0x95')](this[_0xb668('0x132')][this[_0xb668('0x29')][_0x3c8c9d['actionid']][_0xb668('0xb6')]])){if(this[_0xb668('0x2e')][_0x28c650[_0xb668('0x29')][_0x3c8c9d['actionid']][_0xb668('0xb6')]]){this[_0xb668('0x2e')][_0x28c650[_0xb668('0x29')][_0x3c8c9d['actionid']][_0xb668('0xb6')]]=this['queueBookedRR'][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]]?this[_0xb668('0x2e')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]]:this[_0xb668('0x132')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]]?this[_0xb668('0x132')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]][_0xb668('0x138')]||0x0:0x0;}this[_0xb668('0x132')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]][_0xb668('0x138')]=this[_0xb668('0x2e')][this[_0xb668('0x29')][_0x3c8c9d[_0xb668('0x12d')]][_0xb668('0xb6')]];for(var _0x23ba6f=0x0;_0x23ba6f=0x0;})[_0xb668('0xba')](myreject(_0x5c42d0)));}}else{_0xcf2be3[_0xb668('0x133')](ami['Action']({'action':_0xb668('0x153'),'command':util[_0xb668('0x76')](_0xb668('0x154'),_0x334565,!_[_0xb668('0x40')](config['timezones'][_0x10a803])?_0x10a803:'')})[_0xb668('0xbe')](function(_0x30e3a4){return _0x30e3a4[_0xb668('0x155')]['indexOf'](_0xb668('0x157'))>=0x0;})[_0xb668('0xba')](myreject(_0x5c42d0)));}BPromise[_0xb668('0x158')](_0xcf2be3)[_0xb668('0xbe')](function(_0x1a94b5){var _0x3693f9=_[_0xb668('0x159')](_0x1a94b5);if(_0x3693f9){return _0x38773c(_0x3693f9);}else{_0x4033e9['message']=_0xfb5b54?_0xb668('0x15a'):_0xb668('0x15b');return _0x5c42d0(msgResponse(_0xb668('0x15c'),_0xb668('0x14b'),_0xb668('0x15d')+_0xfb5b54+'\x20'+_0x188b8f+_0xb668('0x15e')+util[_0xb668('0x98')](_0x334565,{'showHidden':![],'depth':null})+_0xb668('0x15f')+_0x10a803));}})[_0xb668('0xba')](function(_0x506fbd){return _0x5c42d0(msgResponse(_0xb668('0x149'),_0xb668('0x14b'),JSON['stringify'](_0x506fbd)));});});};Dialer[_0xb668('0x1e')]['checkDialMethod']=function(_0x24bc34){var _0x2a0802=this;return function(){switch(_0x24bc34['dialMethod']){case'progressive':freeVariablesPredictive(_0x24bc34);_0x2a0802[_0xb668('0x160')](_0x24bc34,0x1);break;case _0xb668('0x161'):freeVariablesPredictive(_0x24bc34);_0x2a0802[_0xb668('0x160')](_0x24bc34,_0x24bc34[_0xb668('0x162')]);break;case'predictive':_0x2a0802['predictive'](_0x24bc34);break;case _0xb668('0x8'):freeVariablesPredictive(_0x24bc34);_0x2a0802[_0xb668('0x160')](_0x24bc34,0x1);break;default:freeVariablesPredictive(_0x24bc34);logger['error'](_0xb668('0x163'),_0x24bc34['name'],_0xb668('0x164'));}};};Dialer['prototype'][_0xb668('0x165')]=function(_0x34f4be){var _0x5b4a23=this;return function(){_0x5b4a23['handleIvr'](_0x34f4be);};};Dialer[_0xb668('0x1e')]['syncQueueSummary']=function(_0x1b9f70){var _0x580533=this;if(isNotPreview(_0x1b9f70[_0xb668('0x59')])){if(isVoiceQueueOutbound(_0x1b9f70[_0xb668('0x4d')])&&isActive(_0x1b9f70[_0xb668('0x166')])){_0x1b9f70['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xb668('0xbe')](checkIsLoggedIn(_0x1b9f70,_0x1b9f70[_0xb668('0x50')]))[_0xb668('0xbe')](checkIsActive(_0x1b9f70,_0x1b9f70['dialActive']))[_0xb668('0xbe')](checkInterval(_0x1b9f70))[_0xb668('0xbe')](_0x580533[_0xb668('0x145')](_0x1b9f70))[_0xb668('0xbe')](_0x580533['checkIfTime'](_0x1b9f70[_0xb668('0x167')],_0x1b9f70['dialTimezone'],_0x1b9f70[_0xb668('0x45')],_0x1b9f70))['then'](_0x580533[_0xb668('0x14a')](_0x1b9f70[_0xb668('0x47')],_0x1b9f70[_0xb668('0x168')],_0x1b9f70[_0xb668('0x45')],_0x1b9f70))[_0xb668('0xbe')](_0x580533[_0xb668('0x169')](_0x1b9f70))['catch'](loggerCatchQueueSummary(_0xb668('0x16a'),_0x1b9f70));}else{notSendMessagesQueue(_0x1b9f70);}}else{freeVariablesPredictive(_0x1b9f70);}};Dialer[_0xb668('0x1e')]['syncCampaigns']=function(){var _0x57e36e=this;var _0xc14804;for(var _0x5ec8ad in this[_0xb668('0x24')]){if(typeof this['campaigns'][_0x5ec8ad]!==_0xb668('0xd0')){_0xc14804=this[_0xb668('0x24')][_0x5ec8ad];if(isCampaignIvr(_0xc14804[_0xb668('0x4d')])&&isActive(_0xc14804['active'])){_0xc14804[_0xb668('0xa3')]=!![];BPromise['resolve']()[_0xb668('0xbe')](checkIsActive(_0xc14804,_0xc14804[_0xb668('0xde')]))[_0xb668('0xbe')](checkInterval(_0xc14804))[_0xb668('0xbe')](_0x57e36e['checkIsTrunkReachable'](_0xc14804))[_0xb668('0xbe')](_0x57e36e[_0xb668('0x148')](_0xc14804[_0xb668('0x167')],_0xc14804['dialTimezone'],_0xc14804[_0xb668('0x45')],_0xc14804))[_0xb668('0xbe')](_0x57e36e[_0xb668('0x14a')](_0xc14804['Interval'],_0xc14804[_0xb668('0x168')],_0xc14804[_0xb668('0x45')],_0xc14804))['then'](_0x57e36e['launchHandleIvr'](_0xc14804))[_0xb668('0xba')](loggerCatchQueueSummary(_0xb668('0x16b'),_0xc14804));}else{notSendMessagesCampaign(_0xc14804);}}}};function getCallerIdRandom(_0x5ad8a0,_0x1c447c){var _0x3a5c65;var _0x13dfdd;var _0x51d7da;if(_0x1c447c<=0x0){_0x1c447c=0x1;}_0x3a5c65=new RegExp(_0xb668('0x16c')+_0x1c447c+'}$');_0x13dfdd=Math[_0xb668('0x16d')](0xa,_0x1c447c-0x1);_0x51d7da=Math[_0xb668('0x16d')](0xa,_0x1c447c)-0x1;return util[_0xb668('0x76')]('%s',_[_0xb668('0x16e')](_0x5ad8a0,_0x3a5c65,_[_0xb668('0x16f')](_0x13dfdd,_0x51d7da)));}function extractCalleridName(_0x11663b){var _0x24378b=_0x11663b[_0xb668('0x170')](/"(.*?)"/);return _0x24378b?_0x24378b[0x1]:_0x11663b;}function extractCalleridNumber(_0x120f2e){var _0x2b0b1d=_0x120f2e[_0xb668('0x170')](/<(.*?)>/);return _0x2b0b1d?_0x2b0b1d[0x1]:_0x120f2e;}Dialer[_0xb668('0x1e')][_0xb668('0x171')]=function(_0x2ee6fd,_0xd210cd){var _0x30ffac=this;var _0x268d89=uuid['v4']();this[_0xb668('0x29')][_0x268d89]=new Action(_0x2ee6fd,_0xd210cd,_0x268d89);return new BPromise(function(_0x51c0b4,_0x12903c){if(_[_0xb668('0x40')](_0x2ee6fd)&&typeof _0x2ee6fd!=='object'){return _0x12903c(msgResponse('originate',_0xb668('0x14b'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0xd210cd[_0xb668('0x172')]['phone'])||_0xd210cd[_0xb668('0x172')]['phone']===null){return _0x12903c(msgResponse(_0xb668('0x173'),_0xb668('0x14b'),_0xb668('0x174')));}var _0x4d9b06={'XMD-CALLERID':_0x30ffac[_0xb668('0x29')][_0x268d89][_0xb668('0x175')](),'XMD-AGI':_0x2ee6fd['dialQueueProject']?util[_0xb668('0x76')](_0xb668('0x176'),ipAgi,_0x2ee6fd[_0xb668('0x111')]):_0xb668('0x177'),'XMD-AGIAFTER':_0x2ee6fd[_0xb668('0x11c')]?util[_0xb668('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2ee6fd[_0xb668('0x11c')]):_0xb668('0x177'),'XMD-QUEUE':_0x2ee6fd['type']===_0xb668('0x4e')?util[_0xb668('0x76')](_0xb668('0x178'),_0x2ee6fd['name'],_0x2ee6fd[_0xb668('0x179')]||'',_0x2ee6fd[_0xb668('0x115')]?'c':'',_0x2ee6fd[_0xb668('0x17a')]||0x3):_0xb668('0x177'),'XMD-CONTACTID':_0xd210cd['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x30ffac[_0xb668('0x29')][_0x268d89][_0xb668('0x175')](),'XMD-AMD':_0x2ee6fd[_0xb668('0xe7')]?_0xb668('0x17b'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x2ee6fd[_0xb668('0xe7')]){_0x4d9b06[_0xb668('0x17c')]=_0x2ee6fd[_0xb668('0x17d')]||0x9c4;_0x4d9b06[_0xb668('0x17e')]=_0x2ee6fd[_0xb668('0x17f')]||0x5dc;_0x4d9b06[_0xb668('0x180')]=_0x2ee6fd[_0xb668('0x181')]||0x320;_0x4d9b06[_0xb668('0x182')]=_0x2ee6fd['dialAMDTotalAnalysisTime']||0x1388;_0x4d9b06[_0xb668('0x183')]=_0x2ee6fd[_0xb668('0x184')]||0x64;_0x4d9b06[_0xb668('0x185')]=_0x2ee6fd[_0xb668('0x186')]||0x32;_0x4d9b06[_0xb668('0x187')]=_0x2ee6fd[_0xb668('0x188')]||0x3;_0x4d9b06[_0xb668('0x189')]=_0x2ee6fd[_0xb668('0x18a')]||0x100;_0x4d9b06[_0xb668('0x18b')]=_0x2ee6fd[_0xb668('0x18c')]||0x1388;}if(_0x2ee6fd[_0xb668('0x4d')]===_0xb668('0x4e')){_0x4d9b06[_0xb668('0x18d')]=_0xd210cd[_0xb668('0xd8')];}else{_0x4d9b06[_0xb668('0x18e')]=_0xd210cd[_0xb668('0xd9')];}for(var _0x172f5e in _0xd210cd[_0xb668('0x172')]){if(typeof _0xd210cd[_0xb668('0x172')][_0x172f5e]!==_0xb668('0xd0')){if(isNotNull(_0xd210cd[_0xb668('0x172')][_0x172f5e])&&_0x172f5e!=='id'&&_0x172f5e!=='tags'&&_0x172f5e!==_0xb668('0x18f')&&_0x172f5e!==_0xb668('0x190')){_0x4d9b06[util['format'](_0xb668('0x191'),_0xb668('0x192'),_[_0xb668('0x193')](_0x172f5e))]=_0xd210cd[_0xb668('0x172')][_0x172f5e];}}}var _0x41b341=_0x30ffac[_0xb668('0xdd')](_0x2ee6fd['Trunk'])?getCallerId(_0x2ee6fd['Trunk'][_0xb668('0x73')],_0x2ee6fd[_0xb668('0x5a')],_0x2ee6fd[_0xb668('0x194')]>0x0?getCallerIdRandom(_0x2ee6fd['dialOriginateCallerIdNumber'],_0x2ee6fd[_0xb668('0x194')]):_0x2ee6fd['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x2ee6fd['TrunkBackup'])?_0x2ee6fd['Trunk'][_0xb668('0x73')]:_0x2ee6fd[_0xb668('0x195')][_0xb668('0x73')],_0x2ee6fd[_0xb668('0x5a')],_0x2ee6fd[_0xb668('0x194')]>0x0?getCallerIdRandom(_0x2ee6fd[_0xb668('0x196')],_0x2ee6fd[_0xb668('0x194')]):_0x2ee6fd[_0xb668('0x196')]);if(_0x41b341){_0x4d9b06['XMD-ORIGINATECALLERIDNAME']=_0x30ffac[_0xb668('0x29')][_0x268d89][_0xb668('0x197')]=extractCalleridName(_0x41b341);_0x4d9b06[_0xb668('0x198')]=_0x30ffac[_0xb668('0x29')][_0x268d89][_0xb668('0x199')]=extractCalleridNumber(_0x41b341);}return ami['Action']({'actionid':_0x268d89,'action':'originate','channel':_0x30ffac[_0xb668('0xdd')](_0x2ee6fd[_0xb668('0x72')])?util[_0xb668('0x76')]('SIP/%s/%s%s',_0x2ee6fd[_0xb668('0x72')]['name'],isNotNull(_0x2ee6fd[_0xb668('0x5c')])?_0x2ee6fd[_0xb668('0x5c')][_0xb668('0x19a')]()||'':'',_0x2ee6fd['dialCutDigit']>0x0?_0xd210cd[_0xb668('0x172')][_0xb668('0x19b')][_0xb668('0x19c')](_0x2ee6fd[_0xb668('0x19d')]):_0xd210cd[_0xb668('0x172')][_0xb668('0x19b')]):util[_0xb668('0x76')]('SIP/%s/%s%s',_['isNil'](_0x2ee6fd[_0xb668('0x195')])?_0x2ee6fd[_0xb668('0x72')]['name']:_0x2ee6fd[_0xb668('0x195')][_0xb668('0x45')],isNotNull(_0x2ee6fd['dialPrefix'])?_0x2ee6fd[_0xb668('0x5c')][_0xb668('0x19a')]()||'':'',_0x2ee6fd['dialCutDigit']>0x0?_0xd210cd['Contact'][_0xb668('0x19b')][_0xb668('0x19c')](_0x2ee6fd['dialCutDigit']):_0xd210cd['Contact']['phone']),'callerid':_0x41b341,'Exten':_0xb668('0xe6'),'Context':_0xb668('0x19e'),'Priority':'1','variable':_0x4d9b06,'timeout':(_0x2ee6fd['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x268d89})['then'](function(_0xb6c388){return _0x51c0b4(_0xb6c388);})['catch'](function(_0x17c0fd){_0x2ee6fd[_0xb668('0x60')]+=0x1;var _0x3d161a=new History(_0x30ffac['actions'][_0x268d89]);logger['error'](util[_0xb668('0x76')](_0xb668('0x19f'),JSON['stringify'](_0x17c0fd)));_0x3d161a[_0xb668('0xe9')]=0xe;_0x3d161a[_0xb668('0xa9')]=_0xb668('0x1a0');_0x3d161a[_0xb668('0x121')]=moment()['format'](_0xb668('0x103'));_0x3d161a['endtime']=_0x3d161a[_0xb668('0x121')];_0x30ffac[_0xb668('0xce')](_0x3d161a)[_0xb668('0xba')](loggerCatch(_0xb668('0x1a1')));_0x30ffac[_0xb668('0xcc')](_0x3d161a)[_0xb668('0xba')](loggerCatch('[originate][error]'))[_0xb668('0x21')](function(){delete _0x30ffac[_0xb668('0x29')][_0x268d89];return _0x12903c(msgResponse('originate',_0xb668('0x1a2'),'originate\x20action\x20Error'));});});});};Dialer[_0xb668('0x1e')][_0xb668('0x33')]=function(_0x241fb6){var _0x15752d=this[_0xb668('0x29')][_0x241fb6[_0xb668('0x12d')]];if(_0x15752d){delete this[_0xb668('0x29')][_0x241fb6[_0xb668('0x12d')]];_0x15752d[_0xb668('0x1a3')]=moment()[_0xb668('0x76')](_0xb668('0x103'));var _0x2252bd=_0x15752d[_0xb668('0x4d')]===_0xb668('0x79')?this[_0xb668('0x24')][_0x15752d[_0xb668('0xb6')]]:this[_0xb668('0x23')][_0x15752d[_0xb668('0x1a4')]()];if(!this[_0xb668('0xdb')](_0x241fb6[_0xb668('0x1a5')])){this[_0xb668('0xb5')](_0x2252bd);return this[_0xb668('0x1a6')](_0x15752d,_0x2252bd,_0x241fb6)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x241fb6[_0xb668('0xe2')]]=_0x15752d;}};Dialer['prototype'][_0xb668('0x1a7')]=function(_0x420e4e,_0x1ffd65,_0x47214a){var _0x474126=new History(_0x1ffd65);if(_0x474126[_0xb668('0xf7')]+_0x474126[_0xb668('0x108')]+_0x474126[_0xb668('0xf8')]+_0x474126[_0xb668('0x109')]+_0x474126[_0xb668('0xf9')]+_0x474126[_0xb668('0xfa')]+_0x474126[_0xb668('0xfb')]+_0x474126[_0xb668('0xfc')]>=_0x47214a[_0xb668('0xfd')]-0x1){return!![];}switch(_0x420e4e){case 0x3:if(_0x474126[_0xb668('0xf8')]>=_0x47214a['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0xb668('0xc4')]({'active':![],'countnoanswerretry':_0x474126['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a['dialNoAnswerRetryFrequency'],'minutes')[_0xb668('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126[_0xb668('0xd8')]||undefined,'CampaignId':_0x474126['CampaignId']||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x1a8')));break;case 0x5:if(_0x474126[_0xb668('0xf7')]>=_0x47214a[_0xb668('0x1a9')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x474126[_0xb668('0xf7')]+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x1aa')],_0xb668('0x129'))[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126[_0xb668('0xd8')]||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x474126[_0xb668('0x108')]>=_0x47214a[_0xb668('0x1ab')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x474126['countcongestionretry']+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x1ac')],_0xb668('0x129'))[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126['VoiceQueueId']||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x1ad')));break;case 0x0:if(_0x474126[_0xb668('0x109')]>=_0x47214a['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xb668('0xc4')]({'active':![],'countnosuchnumberretry':_0x474126[_0xb668('0x109')]+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x1ae')],_0xb668('0x129'))['format'](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126[_0xb668('0xd8')]||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x474126['countdropretry']>=_0x47214a[_0xb668('0x11d')]-0x1){return!![];}this[_0xb668('0xc4')]({'active':![],'countdropretry':_0x474126[_0xb668('0xf9')]+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x11f')],_0xb668('0x129'))[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126['VoiceQueueId']||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})['catch'](loggerCatch(_0xb668('0x1af')));break;case 0xb:if(_0x474126[_0xb668('0xfa')]>=_0x47214a[_0xb668('0x127')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x474126[_0xb668('0xfa')]+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x128')],_0xb668('0x129'))[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126['ListId'],'VoiceQueueId':_0x474126['VoiceQueueId']||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x474126[_0xb668('0xfb')]>=_0x47214a[_0xb668('0x10b')]-0x1){return!![];}this[_0xb668('0xc4')]({'active':![],'countmachineretry':_0x474126[_0xb668('0xfb')]+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x102')],_0xb668('0x129'))['format'](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126[_0xb668('0xd8')]||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x474126[_0xb668('0xfc')]>=_0x47214a['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xb668('0xc4')]({'active':![],'countagentrejectretry':_0x474126[_0xb668('0xfc')]+=0x1,'scheduledat':moment()[_0xb668('0x101')](_0x47214a[_0xb668('0x1b0')],_0xb668('0x129'))[_0xb668('0x76')](_0xb668('0x103')),'ContactId':_0x474126[_0xb668('0xd6')],'ListId':_0x474126[_0xb668('0xd7')],'VoiceQueueId':_0x474126[_0xb668('0xd8')]||undefined,'CampaignId':_0x474126[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x1b1')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x4af18b,_0x2bd450,_0x3c3fd7){var _0x4b76c2=this;var _0x8bd748=new History(_0x4af18b);return new BPromise(function(_0x3dcf79,_0x369c45){if(_[_0xb668('0x40')](_0x2bd450)&&typeof _0x2bd450!==_0xb668('0x1b2')){return _0x369c45(msgResponse(_0xb668('0x1b3'),_0xb668('0x14b'),_0xb668('0x1b4')));}if(_[_0xb668('0x40')](_0x3c3fd7)&&typeof _0x3c3fd7!==_0xb668('0x1b2')){return _0x369c45(msgResponse('[callProgressDetecting]',_0xb668('0x14b'),_0xb668('0x1b5')));}switch(_0x3c3fd7['reason']){case'0':_0x2bd450[_0xb668('0x1b6')]+=0x1;_0x8bd748[_0xb668('0xe9')]=0x0;_0x8bd748['statedesc']=_0xb668('0x1b7');_0x8bd748['countnosuchnumberretry']+=0x1;_0x8bd748[_0xb668('0xf5')]+=0x1;ami[_0xb668('0xed')](_0xb668('0x1b8'),ut[_0xb668('0xef')](_0x4af18b,_0xb668('0x1b9')));_0x4b76c2[_0xb668('0xce')](_0x8bd748)['catch'](loggerCatch(_0xb668('0xf6')));if(_0x4b76c2[_0xb668('0x1a7')](0x0,_0x4af18b,_0x2bd450)){if(_0x8bd748[_0xb668('0x109')]>=_0x2bd450[_0xb668('0x1ba')]){_0x4b76c2[_0xb668('0xff')](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1bb'));}else{_0x4b76c2[_0xb668('0xfe')](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1bb'));}}break;case'3':_0x2bd450[_0xb668('0x1bc')]+=0x1;_0x8bd748[_0xb668('0xe9')]=0x3;_0x8bd748['statedesc']='NoAnswer';_0x8bd748['countnoanswerretry']+=0x1;_0x8bd748[_0xb668('0xf5')]+=0x1;ami[_0xb668('0xed')]('custom:agentnoanswer',ut[_0xb668('0xef')](_0x4af18b,_0xb668('0x1bd')));_0x4b76c2['createHistory'](_0x8bd748)[_0xb668('0xba')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x4b76c2[_0xb668('0x1a7')](0x3,_0x4af18b,_0x2bd450)){if(_0x8bd748[_0xb668('0xf8')]>=_0x2bd450[_0xb668('0x1be')]){_0x4b76c2[_0xb668('0xff')](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1bf'));}else{_0x4b76c2[_0xb668('0xfe')](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1bf'));}}break;case'5':_0x2bd450[_0xb668('0x1c0')]+=0x1;_0x8bd748['state']=0x5;_0x8bd748['statedesc']=_0xb668('0x1c1');_0x8bd748[_0xb668('0xf7')]+=0x1;_0x8bd748[_0xb668('0xf5')]+=0x1;ami['emit'](_0xb668('0x1c2'),ut[_0xb668('0xef')](_0x4af18b,_0xb668('0x1c3')));_0x4b76c2['createHistory'](_0x8bd748)[_0xb668('0xba')](loggerCatch(_0xb668('0x1c4')));if(_0x4b76c2[_0xb668('0x1a7')](0x5,_0x4af18b,_0x2bd450)){if(_0x8bd748[_0xb668('0xf7')]>=_0x2bd450[_0xb668('0x1a9')]){_0x4b76c2[_0xb668('0xff')](_0x8bd748,_0x3dcf79,_0x369c45,'reason\x205\x20busy');}else{_0x4b76c2['stateGlobal'](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1c5'));}}break;case'8':_0x2bd450[_0xb668('0x1c6')]+=0x1;_0x8bd748[_0xb668('0xe9')]=0x8;_0x8bd748['statedesc']='Congestion';_0x8bd748['countcongestionretry']+=0x1;_0x8bd748[_0xb668('0xf5')]+=0x1;ami[_0xb668('0xed')]('custom:agentcongestion',ut[_0xb668('0xef')](_0x4af18b,_0xb668('0x1c7')));_0x4b76c2[_0xb668('0xce')](_0x8bd748)['catch'](loggerCatch(_0xb668('0x1c8')));if(_0x4b76c2[_0xb668('0x1a7')](0x8,_0x4af18b,_0x2bd450)){if(_0x8bd748[_0xb668('0x108')]>=_0x2bd450[_0xb668('0x1ab')]){_0x4b76c2['createStateFinal'](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1c9'));}else{_0x4b76c2[_0xb668('0xfe')](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1c9'));}}break;case'11':_0x2bd450[_0xb668('0x1ca')]+=0x1;_0x8bd748[_0xb668('0xe9')]=0xb;_0x8bd748[_0xb668('0xa9')]='Abandoned';_0x8bd748[_0xb668('0xfa')]+=0x1;_0x8bd748[_0xb668('0xf5')]+=0x1;_0x4b76c2[_0xb668('0xce')](_0x8bd748)[_0xb668('0xba')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4b76c2[_0xb668('0x1a7')](0xb,_0x4af18b,_0x2bd450)){if(_0x8bd748['countabandonedretry']>=_0x2bd450[_0xb668('0x127')]){_0x4b76c2[_0xb668('0xff')](_0x8bd748,_0x3dcf79,_0x369c45,'reason\x2011\x20abandoned');}else{_0x4b76c2[_0xb668('0xfe')](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1cb'));}}break;case'20':_0x2bd450[_0xb668('0x61')]+=0x1;_0x8bd748[_0xb668('0xe9')]=0x14;_0x8bd748[_0xb668('0xa9')]=_0xb668('0x1cc');_0x8bd748[_0xb668('0xfc')]+=0x1;_0x8bd748[_0xb668('0xf5')]+=0x1;ami['emit'](_0xb668('0x1cd'),ut['buildObj'](_0x4af18b,_0xb668('0x1ce')));_0x4b76c2[_0xb668('0xce')](_0x8bd748)['catch'](loggerCatch(_0xb668('0x1cf')));if(_0x4b76c2['checkRetriveMax'](0x14,_0x4af18b,_0x2bd450)){if(_0x8bd748[_0xb668('0xfc')]>=_0x2bd450[_0xb668('0x1d0')]){_0x4b76c2[_0xb668('0xff')](_0x8bd748,_0x3dcf79,_0x369c45,'reason\x2020\x20agentreject');}else{_0x4b76c2['stateGlobal'](_0x8bd748,_0x3dcf79,_0x369c45,_0xb668('0x1d1'));}}break;default:_0x2bd450['outboundUnknownCallsDay']+=0x1;_0x8bd748[_0xb668('0xe9')]=0xc;_0x8bd748[_0xb668('0xa9')]=_0x3c3fd7['reason'];_0x4b76c2['createHistory'](_0x8bd748)[_0xb668('0xba')](loggerCatch(_0xb668('0x1d2')));if(_0x4b76c2['checkRetriveMax'](_0x3c3fd7[_0xb668('0x1d3')],_0x4af18b,_0x2bd450)){if(_0x8bd748[_0xb668('0xf7')]+_0x8bd748['countcongestionretry']+_0x8bd748[_0xb668('0xf8')]+_0x8bd748['countnosuchnumberretry']+_0x8bd748[_0xb668('0xf9')]+_0x8bd748[_0xb668('0xfa')]+_0x8bd748['countmachineretry']+_0x8bd748['countagentrejectretry']>=_0x2bd450[_0xb668('0xfd')]){_0x4b76c2[_0xb668('0xfe')](_0x8bd748,_0x3dcf79,_0x369c45,_0x3c3fd7['reason']);}else{_0x4b76c2['createStateFinal'](_0x8bd748,_0x3dcf79,_0x369c45,_0x3c3fd7[_0xb668('0x1d3')]);}}}});};Dialer[_0xb668('0x1e')]['stateGlobal']=function(_0x4618cb,_0x4d735f,_0x38887e,_0x22f70e){var _0x3d312f=new Final(_0x4618cb);_0x3d312f[_0xb668('0xe9')]=0xf;_0x3d312f['statedesc']=_0xb668('0x1d4');this['createStateFinal'](_0x3d312f,_0x4d735f,_0x38887e,_0x22f70e);};Dialer[_0xb668('0x1e')][_0xb668('0xff')]=function(_0x4aa2c5,_0x2030de,_0x157fc5,_0x3926a7){this[_0xb668('0xcc')](_0x4aa2c5)[_0xb668('0xbe')](function(){return _0x2030de(msgResponse('[callProgressDetecting]','Success',_0x3926a7));})[_0xb668('0xba')](function(){return _0x157fc5(msgResponse(_0xb668('0x1d5'),_0xb668('0x14b'),_0xb668('0x1d6')));});};Dialer[_0xb668('0x1e')][_0xb668('0x9')]=function(_0xa95d0f){var _0x8fd3dc=_0xa95d0f[_0xb668('0x1d7')]/0x64;var _0x1bbb18=_0xa95d0f['outboundDropCallsDayTimeout']/(_0xa95d0f[_0xb668('0x1d8')]+_0xa95d0f['outboundAnswerCallsDay']);var _0x5e2a69=Math['round'](_0xa95d0f[_0xb668('0x6c')]*(_0xa95d0f[_0xb668('0x1d9')]/0x64));var _0x3703d4=Math[_0xb668('0x1da')](_0xa95d0f[_0xb668('0x6c')]*(_0xa95d0f['predictiveIntervalMinThreshold']/0x64));var _0x43cb04=_0xa95d0f[_0xb668('0x4f')]+_0xa95d0f[_0xb668('0xa4')];var _0x317bb3=Math[_0xb668('0x1db')](_0xa95d0f[_0xb668('0x6f')]*_0xa95d0f['erlangAbandonmentRate']*_0xa95d0f[_0xb668('0x69')]*_0xa95d0f[_0xb668('0x6a')]);if(_[_0xb668('0x40')](_0xa95d0f['startProgressive'])){if(!_[_0xb668('0x40')](_0xa95d0f[_0xb668('0x2c')])){_0xa95d0f[_0xb668('0x2c')]=undefined;loggerPredictive[_0xb668('0x97')](_0xb668('0x1dc'),_0xb668('0x1dd'));}if(!_['isUndefined'](_0xa95d0f[_0xb668('0x92')])){loggerPredictive[_0xb668('0x97')](_0xb668('0x1dc'),_0xb668('0x1de'));clearInterval(_0xa95d0f[_0xb668('0x92')]);_0xa95d0f['handlePredictive']=undefined;}_0xa95d0f[_0xb668('0x2d')]=moment()[_0xb668('0x76')](_0xb668('0x103'));loggerPredictive[_0xb668('0x7c')](_0xa95d0f[_0xb668('0x45')],_0xb668('0x1df'),_0xa95d0f[_0xb668('0x2d')]);this[_0xb668('0x160')](_0xa95d0f,0x1);}else if(ifInterval(_0xa95d0f[_0xb668('0x1e0')],_0xa95d0f[_0xb668('0x2d')])){this[_0xb668('0x160')](_0xa95d0f,0x1);loggerPredictiveCalls[_0xb668('0x7c')]('[startMethodPredictive][StartProgressive][Loop]',_0xa95d0f[_0xb668('0x2d')],_0xa95d0f[_0xb668('0x45')]);_0xa95d0f[_0xb668('0x6f')]=0x0;_0xa95d0f['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x8fd3dc<_0x1bbb18&&_0xa95d0f['dialPredictiveOptimization']===_0xb668('0x1e1')){freeVariablesPredictive(_0xa95d0f);loggerPredictive[_0xb668('0x7c')](_0xb668('0x1e2'),'Dropped\x20calls\x20day',_0x1bbb18,'startProgressive',_0xa95d0f[_0xb668('0x45')]);}else if(_0x317bb3<_0xa95d0f['predictiveIntervalErlangCallsDroppedCalls']&&_0xa95d0f['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xa95d0f);loggerPredictive[_0xb668('0x7c')](_0xb668('0x1e3'),'Max\x20Drop\x20',_0x317bb3,_0xb668('0x1e4'),_0xa95d0f[_0xb668('0x68')],_0xb668('0x2d'),_0xa95d0f[_0xb668('0x45')]);}else if(!ifInterval(_0xa95d0f[_0xb668('0x1e0')],_0xa95d0f[_0xb668('0x2d')])&&_[_0xb668('0x40')](_0xa95d0f[_0xb668('0x2c')])&&!_[_0xb668('0x40')](_0xa95d0f[_0xb668('0x2d')])){_0xa95d0f['startPredictive']=moment()[_0xb668('0x76')](_0xb668('0x103'));loggerPredictive['info'](_0xa95d0f['name'],'started\x20in\x20predictive\x20at',_0xa95d0f[_0xb668('0x2c')]);this[_0xb668('0xc2')](_0xa95d0f[_0xb668('0x1e0')])[_0xb668('0xbe')](this[_0xb668('0x1e5')](_0xa95d0f))[_0xb668('0xbe')](mergeDataErlangB(_0xa95d0f))[_0xb668('0xbe')](this[_0xb668('0x1e6')](_0xa95d0f))['catch'](loggerCatchPredictive(_0xb668('0x1e7'),_0xa95d0f));}else if(!ifInterval(_0xa95d0f[_0xb668('0x1e0')],_0xa95d0f[_0xb668('0x2c')])){_0xa95d0f[_0xb668('0x68')]=0x0;_0xa95d0f['startPredictive']=moment()['format'](_0xb668('0x103'));loggerPredictive['info'](_0xa95d0f[_0xb668('0x45')],_0xb668('0x1e8'),_0xa95d0f[_0xb668('0x2c')]);clearInterval(_0xa95d0f[_0xb668('0x92')]);_0xa95d0f['handlePredictive']=undefined;this[_0xb668('0xc2')](_0xa95d0f[_0xb668('0x1e0')])[_0xb668('0xbe')](this[_0xb668('0x1e5')](_0xa95d0f))[_0xb668('0xbe')](mergeDataErlangB(_0xa95d0f))[_0xb668('0xbe')](this[_0xb668('0x1e6')](_0xa95d0f))[_0xb668('0xba')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xa95d0f));}else if(_0xa95d0f[_0xb668('0x6c')]&&_0x43cb04<_0xa95d0f[_0xb668('0x6c')]-_0x3703d4){freeVariablesPredictive(_0xa95d0f);loggerPredictive[_0xb668('0x7c')](_0xa95d0f[_0xb668('0x45')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x43cb04,_0xb668('0x1e9'),_0xa95d0f[_0xb668('0x6c')],'-',_0x3703d4,'=',_0xa95d0f['predictiveIntervalAvailable']-_0x3703d4,')');}else if(_0xa95d0f[_0xb668('0x6c')]&&_0x43cb04>_0xa95d0f[_0xb668('0x6c')]+_0x5e2a69){freeVariablesPredictive(_0xa95d0f);loggerPredictive['info'](_0xa95d0f[_0xb668('0x45')],_0xb668('0x1ea'),_0x43cb04,_0xb668('0x1eb'),_0xa95d0f[_0xb668('0x6c')],'+',_0x5e2a69,'=',_0xa95d0f[_0xb668('0x6c')]+_0x5e2a69,')');}};Dialer['prototype'][_0xb668('0x1e5')]=function(_0x11c25a){var _0x417cce=this;return function(_0x1eab15){return new BPromise(function(_0x3eb624,_0x5287a1){_[_0xb668('0x8e')](_0x11c25a,_0x1eab15[0x0]);if(checkGetDataPredictive(_0x1eab15[0x0])){var _0x277f47=_0x11c25a[_0xb668('0x6c')]=_0x11c25a['talking']+_0x11c25a[_0xb668('0x4f')];var _0x567744=_0x11c25a['dialPredictiveInterval']*0x3c;var _0x564956=_0x1eab15[0x0][_0xb668('0x65')]+_0x1eab15[0x0][_0xb668('0x64')];var _0x460591=(_0x1eab15[0x0][_0xb668('0x63')]+_0x1eab15[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1eab15[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1eab15[0x0][_0xb668('0x6d')];_0x11c25a[_0xb668('0x69')]=_0x460591>0x0?_0x460591:0x1;switch(_0x11c25a[_0xb668('0x1ec')]){case'dropRate':var _0x447712=_0x11c25a[_0xb668('0x1d7')]/0x64;return _0x417cce[_0xb668('0x1ed')](_0x277f47,_0x567744,_0x564956,_0x460591,_0x447712)['then'](function(_0x177ff3){return _0x3eb624(_0x177ff3);});case _0xb668('0x1ee'):var _0x55596f=_0x11c25a['dialPredictiveOptimizationPercentage']/0x64;return _0x417cce[_0xb668('0x1ef')](_0x277f47,_0x567744,_0x564956,_0x460591,_0x55596f)[_0xb668('0xbe')](function(_0x3ea314){return _0x3eb624(_0x3ea314);});default:return _0x5287a1(msgResponse(_0xb668('0x1f0'),_0xb668('0x14b'),'Unknown\x20Predictive'));}}else{return _0x5287a1(msgResponse('[getDataPredictive]',_0xb668('0x14b'),'check\x20failure'));}});};};Dialer[_0xb668('0x1e')][_0xb668('0x1f1')]=function(_0x4af46c){var _0xa12ab=this;return function(_0x355121){return new BPromise(function(_0x2f7ec9,_0x9a9404){_[_0xb668('0x8e')](_0x4af46c,_0x355121[0x0]);if(checkGetDataPredictive(_0x355121[0x0])){loggerPredictive[_0xb668('0x7c')](JSON[_0xb668('0x74')](_0x355121[0x0]));if(_0x4af46c[_0xb668('0x1ec')]==='dropRate'){return _0xa12ab[_0xb668('0xca')](_0x4af46c['id'])[_0xb668('0xbe')](function(_0x300102){var _0x50618f=_0x4af46c[_0xb668('0x50')]-_0x300102[0x0][_0xb668('0x1f2')];var _0x196408=_0x4af46c[_0xb668('0x1e0')]*0x3c;var _0x5134ab=_0x355121[0x0][_0xb668('0x65')]+_0x355121[0x0]['predictiveIntervalAvgHoldtime'];var _0x164414=(_0x355121[0x0]['predictiveIntervalAnsweredCalls']+_0x355121[0x0][_0xb668('0x66')]+_0x355121[0x0][_0xb668('0x81')])/_0x355121[0x0][_0xb668('0x6d')];var _0x53187f=_0x4af46c[_0xb668('0x1d7')]/0x64;_0x4af46c[_0xb668('0x6b')]=_0x300102[0x0][_0xb668('0x1f2')]||0x0;_0x4af46c[_0xb668('0x69')]=_0x164414>0x0?_0x164414:0x1;return _0xa12ab[_0xb668('0x1ed')](_0x50618f,_0x196408,_0x5134ab,_0x164414,_0x53187f);})[_0xb668('0xbe')](function(_0x2aa2d8){return _0x2f7ec9(_0x2aa2d8);})[_0xb668('0xba')](function(_0x4071ae){return _0x9a9404(msgResponse(_0xb668('0x1f3'),_0xb668('0x14b'),JSON[_0xb668('0x74')](_0x4071ae)));});}if(_0x4af46c['dialPredictiveOptimization']===_0xb668('0x1ee')){return _0xa12ab['getVoiceQueueRtPauses'](_0x4af46c['id'])[_0xb668('0xbe')](function(_0x4073c3){var _0x4a3baf=_0x4af46c[_0xb668('0x50')]-_0x4073c3[0x0][_0xb668('0x1f2')];var _0x5cb3eb=_0x4af46c[_0xb668('0x1e0')]*0x3c;var _0x3fce8e=_0x355121[0x0][_0xb668('0x65')]+_0x355121[0x0][_0xb668('0x64')];var _0x54fbb4=(_0x355121[0x0][_0xb668('0x63')]+_0x355121[0x0][_0xb668('0x66')]+_0x355121[0x0][_0xb668('0x81')])/_0x355121[0x0][_0xb668('0x6d')];var _0x269392=_0x4af46c['dialPredictiveOptimizationPercentage']/0x64;_0x4af46c[_0xb668('0x6b')]=_0x4073c3[0x0]['outboundQueuePauses']||0x0;_0x4af46c['predictiveIntervalHitRate']=_0x54fbb4>0x0?_0x54fbb4:0x1;return _0xa12ab[_0xb668('0x1ef')](_0x4a3baf,_0x5cb3eb,_0x3fce8e,_0x54fbb4,_0x269392);})['then'](function(_0x21221e){return _0x2f7ec9(_0x21221e);})['catch'](function(_0x177726){return _0x9a9404(msgResponse('[CatchErlangB]',_0xb668('0x14b'),JSON[_0xb668('0x74')](_0x177726)));});}}else{return _0x9a9404(msgResponse('[getDataPredictive]',_0xb668('0x14b'),_0xb668('0x1f4')));}});};};Dialer[_0xb668('0x1e')]['startMethodPredictive']=function(_0x16b024){var _0x4edab0=this;return function(){var _0x34e8d1=0x0;var _0x319357=Math[_0xb668('0x1db')](_0x16b024[_0xb668('0x8b')]*0x3e8);if(_0x319357>0x0){_0x319357=_0x319357<0x64?0x64:_0x319357;loggerPredictive[_0xb668('0x7c')](_0x16b024[_0xb668('0x45')],_0xb668('0x1f5'),_0x319357,_0xb668('0x4c'));_0x16b024[_0xb668('0x92')]=setInterval(function(){_0x4edab0[_0xb668('0x92')](_0x16b024);loggerPredictiveCalls['info'](_0xb668('0x1f6'),_0x34e8d1+=0x1);},_0x319357);}else{loggerPredictive[_0xb668('0x7c')](_0x16b024[_0xb668('0x45')],_0xb668('0x1f7'));}};};Dialer[_0xb668('0x1e')]['checkContactBlack']=function(_0x2bab0f,_0x2a51dc){var _0x486b9a=this;return function(_0x3bdd9d){if(_[_0xb668('0x95')](_0x3bdd9d)){if(_[_0xb668('0xb0')](_0x2a51dc[_0xb668('0x1f8')])||!_0x2a51dc['recallme']){if(_0x2bab0f[_0xb668('0x59')]===_0xb668('0x8')){_0x2bab0f['queueStatusComplete']=_[_0xb668('0x40')](_0x2bab0f['queueStatusComplete'])?!![]:_0x2bab0f[_0xb668('0x135')];var _0x1c63d3=uuid['v4']();_0x486b9a[_0xb668('0x29')][_0x1c63d3]=new Action(_0x2bab0f,_0x2a51dc,_0x1c63d3);loggerBooked[_0xb668('0x7c')](_0xb668('0x1f9'),_0x1c63d3,'queueStatusComplete:\x20',JSON[_0xb668('0x74')](_0x2bab0f[_0xb668('0x135')]),_0xb668('0x1fa'),_0x2bab0f['name']);if(_0x2bab0f[_0xb668('0x135')]){_0x2bab0f[_0xb668('0x135')]=![];_0x486b9a[_0xb668('0x132')][_0x486b9a[_0xb668('0x29')][_0x1c63d3][_0xb668('0xb6')]]=[];ami[_0xb668('0xb1')]({'actionid':_0x1c63d3,'action':_0xb668('0x1fb'),'queue':_0x2bab0f[_0xb668('0x45')]})['catch'](function(){_0x486b9a[_0xb668('0xb5')](_0x2bab0f);_0x486b9a[_0xb668('0xc4')]({'active':![],'ContactId':_0x486b9a[_0xb668('0x29')][_0x1c63d3][_0xb668('0xd6')],'ListId':_0x486b9a['actions'][_0x1c63d3]['ListId'],'VoiceQueueId':_0x486b9a[_0xb668('0x29')][_0x1c63d3][_0xb668('0xd8')]||undefined,'CampaignId':_0x486b9a[_0xb668('0x29')][_0x1c63d3][_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch(_0xb668('0x1fc')));delete _0x486b9a[_0xb668('0x29')][_0x1c63d3];});}else{loggerBooked[_0xb668('0x7c')](_0xb668('0x1fd'),JSON[_0xb668('0x74')](_0x2bab0f[_0xb668('0x135')]),'Queue:\x20',_0x2bab0f[_0xb668('0x45')]);_0x486b9a[_0xb668('0xb5')](_0x2bab0f);_0x486b9a[_0xb668('0xc4')]({'active':![],'ContactId':_0x486b9a[_0xb668('0x29')][_0x1c63d3][_0xb668('0xd6')],'ListId':_0x486b9a['actions'][_0x1c63d3]['ListId'],'VoiceQueueId':_0x486b9a['actions'][_0x1c63d3][_0xb668('0xd8')]||undefined,'CampaignId':_0x486b9a['actions'][_0x1c63d3]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x486b9a['actions'][_0x1c63d3];}}else{return _0x486b9a[_0xb668('0x171')](_0x2bab0f,_0x2a51dc);}}else{if(getDiff(_0x2a51dc[_0xb668('0x1fe')])<_0x2bab0f[_0xb668('0x1ff')]*0x3c){if(_0x2a51dc[_0xb668('0x200')]&&!_0x2a51dc[_0xb668('0x200')][_0xb668('0x201')]){_0x486b9a['preview'][_0xb668('0x13d')](_0x2a51dc['id'])['finally'](function(){_0x486b9a[_0xb668('0xb5')](_0x2bab0f);});}else{_0x486b9a['unlockContact']({'active':![]},_0x2a51dc['id'],0x1)[_0xb668('0x21')](function(){_0x486b9a[_0xb668('0xb5')](_0x2bab0f);});}}else{_0x2bab0f[_0xb668('0x202')]+=0x1;_0x486b9a['updateOriginated'](_0x2bab0f);if(_0x2bab0f[_0xb668('0x203')]){_0x486b9a[_0xb668('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2a51dc['ContactId'],'ListId':_0x2a51dc[_0xb668('0xd7')],'VoiceQueueId':_0x2a51dc[_0xb668('0xd8')]||undefined,'CampaignId':_0x2a51dc[_0xb668('0xd9')]||undefined})[_0xb668('0xba')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x486b9a['createHistory'](createObjHistory(_0x2bab0f,_0x2a51dc,_0xb668('0x204'),0x17,_0xb668('0x205')))['catch'](loggerCatch(_0xb668('0x206')));}else{_0x486b9a[_0xb668('0xd4')](createObjHistory(_0x2bab0f,_0x2a51dc,_0xb668('0x207'),0x16,_0xb668('0x208')),_0xb668('0x209'),_0xb668('0x20a'));}}}}else{_0x2bab0f['outboundBlacklistCallsDay']+=0x1;_0x486b9a[_0xb668('0xd4')](createObjHistory(_0x2bab0f,_0x2a51dc,_0xb668('0x20b'),0xd,_0xb668('0x20c')),_0xb668('0x20d'),'[Originate][MoveBlacklist]');throw _0xb668('0x20e');}};};Dialer[_0xb668('0x1e')][_0xb668('0x20f')]=function(_0x33d68c){var _0x26fcc3=this;var _0x5a4473=_0x33d68c['limitCalls']-_0x33d68c[_0xb668('0x6e')]-_0x33d68c['temp'];emitCampaignSummary(_0x33d68c);if(_0x5a4473>0x0){if(_0x5a4473>this[_0xb668('0x27')]){_0x5a4473=this[_0xb668('0x27')];}_0x33d68c['temp']+=_0x5a4473;this[_0xb668('0xc9')](_0x33d68c['id'],_0x5a4473,_0x33d68c['dialOrderByScheduledAt'],_0x33d68c)['then'](function(_0x334d98){_0x33d68c[_0xb668('0xc8')]-=_0x5a4473;_0x33d68c[_0xb668('0xc8')]=_0x33d68c['temp']>0x0?_0x33d68c[_0xb668('0xc8')]:0x0;if(!checkContactEmpty(_0x334d98)){_0x33d68c[_0xb668('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xb668('0x210')+_0x33d68c[_0xb668('0x45')]);}else{_0x33d68c['originated']+=_0x334d98[_0xb668('0x9a')];_0x33d68c[_0xb668('0x41')]=_0xb668('0x211');for(var _0x5460fa=0x0;_0x5460fa<_0x334d98[_0xb668('0x9a')];_0x5460fa+=0x1){_0x33d68c['ivrTotalCallsDays']+=0x1;if(_[_0xb668('0xb0')](_0x334d98[_0x5460fa])||_[_0xb668('0xb0')](_0x334d98[_0x5460fa][_0xb668('0x172')])||_['isNil'](_0x334d98[_0x5460fa][_0xb668('0x172')][_0xb668('0x19b')])){_0x26fcc3[_0xb668('0xd2')](_0xb668('0x212'),_0x33d68c,_0x334d98[_0x5460fa]);}else{_0x26fcc3[_0xb668('0xc0')](_[_0xb668('0xd5')](_0x334d98[_0x5460fa],[_0xb668('0xd9'),_0xb668('0x213')]))[_0xb668('0xbe')](_0x26fcc3[_0xb668('0x214')](_0x33d68c,_0x334d98[_0x5460fa]))[_0xb668('0xba')](_0x26fcc3[_0xb668('0x215')](_0xb668('0x216'),_0x33d68c));}}}})[_0xb668('0xba')](loggerGetContactDialer('[getContactCampaign2]',_0x33d68c,_0x5a4473));}};Dialer[_0xb668('0x1e')][_0xb668('0x160')]=function(_0x30799f,_0xeea149){var _0x14b287=this;var _0x3f7f33=[];var _0x57d7c8=_0xeea149>=0x1?_0xeea149:0x1;if(_0x30799f[_0xb668('0x59')]==='booked'){_0x57d7c8=0x1;}var _0x36b61e=Math[_0xb668('0x1db')](_0x30799f[_0xb668('0x4f')]*_0x57d7c8)-_0x30799f[_0xb668('0x6e')]-_0x30799f[_0xb668('0xc8')];emitVoiceQueueSummary(_0x30799f);if(_0x30799f['dialLimitQueue']>0x0){var _0xe792b5=_0x30799f[_0xb668('0x217')]-_0x30799f[_0xb668('0x6e')]-_0x30799f[_0xb668('0xa4')]-_0x30799f[_0xb668('0xc8')]-_0x30799f[_0xb668('0x51')];if(_0x36b61e>_0xe792b5){_0x36b61e=_0xe792b5;}}if(_0x36b61e>0x0){if(_0x30799f[_0xb668('0x59')]==='booked'){_0x36b61e=0x1;}if(_0x36b61e>this['maxNumberOriginate']){_0x36b61e=this['maxNumberOriginate'];}_0x30799f['temp']+=_0x36b61e;for(var _0xcbcead in this['agents']){if(typeof this['agents'][_0xcbcead]!==_0xb668('0xd0')){if(this['agents'][_0xcbcead][_0xb668('0xe9')]===_0xb668('0x218')&&this[_0xb668('0x25')][_0xcbcead][_0xb668('0xb2')]==='reachable'){_0x3f7f33['push'](this[_0xb668('0x25')][_0xcbcead]['id']);}}}this[_0xb668('0xc7')](_0x30799f['id'],_0x3f7f33,_0x36b61e,_0x30799f[_0xb668('0x219')],_0x30799f)['then'](function(_0x1a2a4d){_0x30799f[_0xb668('0xc8')]-=_0x36b61e;_0x30799f['temp']=_0x30799f['temp']>0x0?_0x30799f[_0xb668('0xc8')]:0x0;if(!checkContactEmpty(_0x1a2a4d)){_0x14b287['countReScheduled'](_0x30799f)['then'](sendMessageReschedule(_0x30799f))[_0xb668('0xba')](loggerCatch(_0xb668('0xbb')));}else{_0x30799f[_0xb668('0x6e')]+=_0x1a2a4d['length'];_0x30799f[_0xb668('0x41')]=_0x30799f[_0xb668('0x59')]===_0xb668('0x8')?_0xb668('0x17b'):'RUNNING';for(var _0x5967fa=0x0;_0x5967fa<_0x1a2a4d['length'];_0x5967fa+=0x1){if(_[_0xb668('0xb0')](_0x1a2a4d[_0x5967fa])||_['isNil'](_0x1a2a4d[_0x5967fa][_0xb668('0x172')])||_['isNil'](_0x1a2a4d[_0x5967fa][_0xb668('0x172')][_0xb668('0x19b')])){_0x14b287[_0xb668('0xd2')](_0xb668('0x212'),_0x30799f,_0x1a2a4d[_0x5967fa]);}else{_0x14b287[_0xb668('0xbc')](_[_0xb668('0xd5')](_0x1a2a4d[_0x5967fa],[_0xb668('0xd8'),_0xb668('0x213')]))[_0xb668('0xbe')](_0x14b287[_0xb668('0x214')](_0x30799f,_0x1a2a4d[_0x5967fa]))[_0xb668('0xba')](_0x14b287[_0xb668('0x215')](_0xb668('0x212'),_0x30799f));}}}})[_0xb668('0xba')](loggerGetContactDialer('[getContactDialer2]',_0x30799f,_0x36b61e));}};Dialer[_0xb668('0x1e')][_0xb668('0x92')]=function(_0x32088c){if(_0x32088c['dialLimitQueue']>0x0){var _0x51892d=_0x32088c[_0xb668('0x217')]-_0x32088c['originated']-_0x32088c[_0xb668('0xa4')];if(_0x51892d>0x0){this[_0xb668('0x21a')](_0x32088c);}else{loggerPredictiveCalls[_0xb668('0x7c')](_0xb668('0x21b'));}}else{this[_0xb668('0x21a')](_0x32088c);}};Dialer[_0xb668('0x1e')][_0xb668('0x21a')]=function(_0x34ef2e){var _0x2dfd66=this;var _0x359448=[];_0x34ef2e[_0xb668('0x6e')]+=0x1;for(var _0x5c6204 in this['agents']){if(typeof this[_0xb668('0x25')][_0x5c6204]!==_0xb668('0xd0')){if(this[_0xb668('0x25')][_0x5c6204][_0xb668('0xe9')]==='not_inuse'&&this['agents'][_0x5c6204]['status']===_0xb668('0xe0')){_0x359448[_0xb668('0x133')](this[_0xb668('0x25')][_0x5c6204]['id']);}}}this[_0xb668('0xc7')](_0x34ef2e['id'],_0x359448,0x1,_0x34ef2e['dialOrderByScheduledAt'],_0x34ef2e)[_0xb668('0xbe')](function(_0x262b80){if(!checkContactEmpty(_0x262b80)){checkContactLowerLimitOriginate(_0x34ef2e,0x1,0x0);_0x2dfd66['countReScheduled'](_0x34ef2e)[_0xb668('0xbe')](sendMessageReschedule(_0x34ef2e))[_0xb668('0xba')](loggerCatch('[countReScheduled]\x20'));}else{_0x34ef2e[_0xb668('0x41')]=_0xb668('0x211');if(_[_0xb668('0xb0')](_0x262b80[0x0])||_[_0xb668('0xb0')](_0x262b80[0x0][_0xb668('0x172')])||_[_0xb668('0xb0')](_0x262b80[0x0][_0xb668('0x172')][_0xb668('0x19b')])){_0x2dfd66[_0xb668('0xd2')](_0xb668('0x212'),_0x34ef2e,_0x262b80[0x0]);}else{_0x2dfd66[_0xb668('0xbc')](_['pick'](_0x262b80[0x0],[_0xb668('0xd8'),'Contact.phone']))[_0xb668('0xbe')](_0x2dfd66[_0xb668('0x214')](_0x34ef2e,_0x262b80[0x0]))[_0xb668('0xba')](_0x2dfd66[_0xb668('0x215')](_0xb668('0x21c'),_0x34ef2e));}}})[_0xb668('0xba')](loggerGetContactDialer(_0xb668('0x21d'),_0x34ef2e,0x1));emitVoiceQueueSummary(_0x34ef2e);};Dialer['prototype']['abandonmentRate']=function(_0x259485,_0x3413b9,_0x169e17,_0x25bba0,_0x15eb85,_0xb79e75){loggerPredictive[_0xb668('0x7c')](_0xb668('0x21e'));loggerPredictive['info'](_0xb668('0x21f'),_0x259485);loggerPredictive[_0xb668('0x7c')](_0xb668('0x220'),_0x3413b9);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x169e17);loggerPredictive[_0xb668('0x7c')]('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',_0x25bba0);loggerPredictive[_0xb668('0x7c')](_0xb668('0x221'),_0x15eb85);loggerPredictive[_0xb668('0x7c')]('---------------------------');return new BPromise(function(_0x484c41,_0x358c47){if(_0x259485<=0x0||isNaN(_0x259485)){return _0x358c47(msgResponse(_0xb668('0x222'),_0xb668('0x1a2'),_0xb668('0x223')+_0x259485));}if(_0x169e17<=0x0||isNaN(_0x169e17)){return _0x358c47(msgResponse('[abandonmentRate]',_0xb668('0x1a2'),_0xb668('0x224')+_0x169e17));}if(_0x25bba0<=0x0||isNaN(_0x25bba0)){return _0x358c47(msgResponse(_0xb668('0x222'),_0xb668('0x1a2'),_0xb668('0x225')+_0x25bba0));}if(_0x3413b9<=0x0||isNaN(_0x3413b9)){return _0x358c47(msgResponse(_0xb668('0x222'),_0xb668('0x1a2'),_0xb668('0x226')+_0x3413b9));}if(_0x15eb85<=0x0||isNaN(_0x15eb85)){return _0x358c47(msgResponse(_0xb668('0x222'),_0xb668('0x1a2'),_0xb668('0x227')+_0x15eb85));}_0xb79e75=_0xb79e75||0x0;var _0x2e6979=0x1/_0x169e17;var _0x457c69=0x0;var _0x5cec72=0x0;var _0x4a0704=0x0;var _0x75014b=0x0;for(var _0x53f0b6=0x0;_0x4a0704<_0x15eb85;_0x53f0b6+=0x1){_0x5cec72=_0x53f0b6/_0x3413b9;_0x457c69=(_0x25bba0*_0x5cec72+_0xb79e75)/_0x2e6979;_0x4a0704=erlangb(_0x457c69,_0x259485);_0x75014b=_0x457c69/_0x259485*(0x1-erlangb(_0x457c69,_0x259485));}return _0x484c41({'erlangCalls':_0x53f0b6,'erlangCallToSecond':_0x3413b9/_0x53f0b6,'erlangAbandonmentRate':_0x4a0704,'erlangBusyFactor':_0x75014b});});};Dialer[_0xb668('0x1e')][_0xb668('0x1ef')]=function(_0x3f4b1a,_0x328018,_0x1ec5b3,_0x684c0,_0x382230,_0xe4bd2){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xb668('0x7c')](_0xb668('0x21f'),_0x3f4b1a);loggerPredictive[_0xb668('0x7c')](_0xb668('0x220'),_0x328018);loggerPredictive[_0xb668('0x7c')]('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',_0x1ec5b3);loggerPredictive['info']('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',_0x684c0);loggerPredictive['info'](_0xb668('0x228'),_0x382230);loggerPredictive['info'](_0xb668('0x84'));return new BPromise(function(_0x57f576,_0x4f605e){if(_0x3f4b1a<=0x0||isNaN(_0x3f4b1a)){return _0x4f605e(msgResponse(_0xb668('0x229'),'Error',_0xb668('0x223')+_0x3f4b1a));}if(_0x1ec5b3<=0x0||isNaN(_0x1ec5b3)){return _0x4f605e(msgResponse('[busyFactor]',_0xb668('0x1a2'),'Ts\x20=\x20'+_0x1ec5b3));}if(_0x684c0<=0x0||isNaN(_0x684c0)){return _0x4f605e(msgResponse(_0xb668('0x229'),_0xb668('0x1a2'),_0xb668('0x225')+_0x684c0));}if(_0x328018<=0x0||isNaN(_0x328018)){return _0x4f605e(msgResponse(_0xb668('0x229'),_0xb668('0x1a2'),'interval\x20=\x20'+_0x328018));}if(_0x382230<=0x0||isNaN(_0x382230)){return _0x4f605e(msgResponse(_0xb668('0x229'),'Error',_0xb668('0x22a')+_0x382230));}_0xe4bd2=_0xe4bd2||0x0;var _0xefad96=0x1/_0x1ec5b3;var _0x427d98=0x0;var _0x365594=0x0;var _0x176f32=0x0;var _0x524e54=0x0;for(var _0x1b81ba=0x0;_0x524e54<_0x382230;_0x1b81ba+=0x1){_0x365594=_0x1b81ba/_0x328018;_0x427d98=(_0x684c0*_0x365594+_0xe4bd2)/_0xefad96;_0x176f32=erlangb(_0x427d98,_0x3f4b1a);_0x524e54=_0x427d98/_0x3f4b1a*(0x1-erlangb(_0x427d98,_0x3f4b1a));}return _0x57f576({'erlangCalls':_0x1b81ba,'erlangCallToSecond':_0x328018/_0x1b81ba,'erlangAbandonmentRate':_0x176f32,'erlangBusyFactor':_0x524e54});});};module[_0xb668('0x22b')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 3056991..aef560d 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 _0x6c25=['originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c25,0x143));var _0x56c2=function(_0x2d7b77,_0x2476df){_0x2d7b77=_0x2d7b77-0x0;var _0x3e96ae=_0x6c25[_0x2d7b77];return _0x3e96ae;};'use strict';var util=require('util');var _=require(_0x56c2('0x0'));var moment=require(_0x56c2('0x1'));function getSeconds(_0x5b8875,_0x148421){var _0xb8cd59=moment(_0x5b8875)[_0x56c2('0x2')](0x0);var _0x2d25e8=moment(_0x148421)[_0x56c2('0x2')](0x0);return _0xb8cd59[_0x56c2('0x3')](_0x2d25e8,'seconds');}function QueueCallerAbandon(_0x5393b1,_0xd47755){this[_0x56c2('0x4')]=_0x5393b1['scheduledat'];this[_0x56c2('0x5')]=_0x5393b1[_0x56c2('0x5')];this[_0x56c2('0x6')]=_0x5393b1[_0x56c2('0x5')]==='outbound'?_0x56c2('0x7'):_0x5393b1[_0x56c2('0x5')];this[_0x56c2('0x8')]=_0x5393b1[_0x56c2('0x8')];this[_0x56c2('0x9')]=_0x5393b1['countcongestionretry'];this[_0x56c2('0xa')]=_0x5393b1[_0x56c2('0xa')];this['countglobal']=_0x5393b1[_0x56c2('0x8')]+_0x5393b1['countcongestionretry']+_0x5393b1[_0x56c2('0xa')]+_0x5393b1[_0x56c2('0xb')]+_0x5393b1[_0x56c2('0xc')]+_0x5393b1[_0x56c2('0xd')]+_0x5393b1['countmachineretry']+_0x5393b1['countagentrejectretry'];this[_0x56c2('0xb')]=_0x5393b1['countnosuchnumberretry'];this[_0x56c2('0xc')]=_0x5393b1['countdropretry'];this['countabandonedretry']=_0x5393b1[_0x56c2('0xd')];this[_0x56c2('0xe')]=_0x5393b1[_0x56c2('0xe')];this[_0x56c2('0xf')]=_0x5393b1[_0x56c2('0xf')];this[_0x56c2('0x10')]=_0xd47755['uniqueid'];this['calleridname']=_0x5393b1[_0x56c2('0x11')];this[_0x56c2('0x12')]=_0x5393b1[_0x56c2('0x13')];this[_0x56c2('0x14')]=_0x5393b1['starttime'];this[_0x56c2('0x15')]=_0x5393b1[_0x56c2('0x15')];this[_0x56c2('0x16')]=_0x5393b1[_0x56c2('0x16')];this[_0x56c2('0x17')]=this[_0x56c2('0x16')];this['ringtime']=getSeconds(_0x5393b1[_0x56c2('0x15')],_0x5393b1['starttime']);this[_0x56c2('0x18')]=getSeconds(this[_0x56c2('0x16')],_0x5393b1[_0x56c2('0x15')]);this[_0x56c2('0x19')]=0x0;this[_0x56c2('0x7')]=_0xd47755[_0x56c2('0x7')];this[_0x56c2('0x1a')]=_0xd47755[_0x56c2('0x1b')];this[_0x56c2('0x1c')]=_0xd47755['reason'];this[_0x56c2('0x1d')]=_0x5393b1[_0x56c2('0x1d')];this['callbackuniqueid']=_0x5393b1[_0x56c2('0x1e')];this['callbackat']=_0x5393b1['callbackat'];this[_0x56c2('0x1f')]=_0x5393b1[_0x56c2('0x1f')];this[_0x56c2('0x20')]=_0x5393b1[_0x56c2('0x20')];this[_0x56c2('0x21')]=_0x5393b1[_0x56c2('0x21')];this[_0x56c2('0x22')]=_0x5393b1[_0x56c2('0x22')];this[_0x56c2('0x23')]=_0x5393b1[_0x56c2('0x23')];this['CampaignId']=_0x5393b1[_0x56c2('0x24')];this[_0x56c2('0x25')]=_0x5393b1['originatecalleridnum']||'';this[_0x56c2('0x26')]=_0x5393b1[_0x56c2('0x26')]||'';}module[_0x56c2('0x27')]=QueueCallerAbandon; \ No newline at end of file +var _0xbad8=['membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime'];(function(_0x4a67eb,_0x431aab){var _0x1fe03b=function(_0x27213e){while(--_0x27213e){_0x4a67eb['push'](_0x4a67eb['shift']());}};_0x1fe03b(++_0x431aab);}(_0xbad8,0x19e));var _0x8bad=function(_0x3cf150,_0x178cb5){_0x3cf150=_0x3cf150-0x0;var _0x931f8b=_0xbad8[_0x3cf150];return _0x931f8b;};'use strict';var util=require(_0x8bad('0x0'));var _=require('lodash');var moment=require(_0x8bad('0x1'));function getSeconds(_0x595586,_0x134206){var _0x4e0455=moment(_0x595586)[_0x8bad('0x2')](0x0);var _0x482a8a=moment(_0x134206)[_0x8bad('0x2')](0x0);return _0x4e0455[_0x8bad('0x3')](_0x482a8a,'seconds');}function QueueCallerAbandon(_0x4292b9,_0x4b1a2e){this[_0x8bad('0x4')]=_0x4292b9['scheduledat'];this['type']=_0x4292b9[_0x8bad('0x5')];this['campaigntype']=_0x4292b9[_0x8bad('0x5')]==='outbound'?_0x8bad('0x6'):_0x4292b9[_0x8bad('0x5')];this[_0x8bad('0x7')]=_0x4292b9[_0x8bad('0x7')];this['countcongestionretry']=_0x4292b9[_0x8bad('0x8')];this[_0x8bad('0x9')]=_0x4292b9['countnoanswerretry'];this[_0x8bad('0xa')]=_0x4292b9['countbusyretry']+_0x4292b9[_0x8bad('0x8')]+_0x4292b9['countnoanswerretry']+_0x4292b9[_0x8bad('0xb')]+_0x4292b9['countdropretry']+_0x4292b9[_0x8bad('0xc')]+_0x4292b9[_0x8bad('0xd')]+_0x4292b9[_0x8bad('0xe')];this[_0x8bad('0xb')]=_0x4292b9[_0x8bad('0xb')];this[_0x8bad('0xf')]=_0x4292b9[_0x8bad('0xf')];this[_0x8bad('0xc')]=_0x4292b9[_0x8bad('0xc')];this[_0x8bad('0xd')]=_0x4292b9['countmachineretry'];this[_0x8bad('0xe')]=_0x4292b9['countagentrejectretry'];this['uniqueid']=_0x4b1a2e[_0x8bad('0x10')];this['calleridname']=_0x4292b9[_0x8bad('0x11')];this[_0x8bad('0x12')]=_0x4292b9[_0x8bad('0x13')];this[_0x8bad('0x14')]=_0x4292b9['starttime'];this[_0x8bad('0x15')]=_0x4292b9[_0x8bad('0x15')];this[_0x8bad('0x16')]=_0x4292b9[_0x8bad('0x16')];this[_0x8bad('0x17')]=this[_0x8bad('0x16')];this['ringtime']=getSeconds(_0x4292b9[_0x8bad('0x15')],_0x4292b9[_0x8bad('0x14')]);this[_0x8bad('0x18')]=getSeconds(this['droptime'],_0x4292b9[_0x8bad('0x15')]);this[_0x8bad('0x19')]=0x0;this[_0x8bad('0x6')]=_0x4b1a2e[_0x8bad('0x6')];this[_0x8bad('0x1a')]=_0x4b1a2e[_0x8bad('0x1b')];this[_0x8bad('0x1c')]=_0x4b1a2e['reason'];this[_0x8bad('0x1d')]=_0x4292b9[_0x8bad('0x1d')];this['callbackuniqueid']=_0x4292b9[_0x8bad('0x1e')];this[_0x8bad('0x1f')]=_0x4292b9[_0x8bad('0x1f')];this[_0x8bad('0x20')]=_0x4292b9[_0x8bad('0x20')];this[_0x8bad('0x21')]=_0x4292b9[_0x8bad('0x21')];this[_0x8bad('0x22')]=_0x4292b9[_0x8bad('0x22')];this[_0x8bad('0x23')]=_0x4292b9['UserId'];this[_0x8bad('0x24')]=_0x4292b9[_0x8bad('0x24')];this[_0x8bad('0x25')]=_0x4292b9['CampaignId'];this[_0x8bad('0x26')]=_0x4292b9['originatecalleridnum']||'';this[_0x8bad('0x27')]=_0x4292b9[_0x8bad('0x27')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 415fa06..b975cfc 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(_0x391200,_0x2df253){var _0x52b38c=function(_0x13cacc){while(--_0x13cacc){_0x391200['push'](_0x391200['shift']());}};_0x52b38c(++_0x2df253);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x5ae00d,_0x3f714e){var _0x5879d7=function(_0xd46957){while(--_0xd46957){_0x5ae00d['push'](_0x5ae00d['shift']());}};_0x5879d7(++_0x3f714e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 e69a32a..254eb0b 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 _0x2076=['Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','Action','variablesAction','ext','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','util','lodash','bluebird','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','reason','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId'];(function(_0x3e0156,_0x2b3343){var _0x23c1c3=function(_0x521afd){while(--_0x521afd){_0x3e0156['push'](_0x3e0156['shift']());}};_0x23c1c3(++_0x2b3343);}(_0x2076,0x177));var _0x6207=function(_0x3225fe,_0x564e61){_0x3225fe=_0x3225fe-0x0;var _0x378c84=_0x2076[_0x3225fe];return _0x378c84;};'use strict';var util=require(_0x6207('0x0'));var _=require(_0x6207('0x1'));var BPromise=require(_0x6207('0x2'));var uuid=require('uuid');var moment=require(_0x6207('0x3'));var path=require(_0x6207('0x4'));var tiff2pdf=require(_0x6207('0x5'));var gs=require('./util/gs');var logger=require(_0x6207('0x6'))(_0x6207('0x7'));var ami=require(_0x6207('0x8'));var rpcDb=require(_0x6207('0x9'));var Channel=require('./channel');var ut=require(_0x6207('0xa'));var Action=require(_0x6207('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x6207('0xc'));var faxMessage=require(_0x6207('0xd'));function Fax(_0x1f4bb6){this[_0x6207('0xe')]={};this[_0x6207('0xf')]=_0x1f4bb6[_0x6207('0xf')];this[_0x6207('0x10')]=_0x1f4bb6[_0x6207('0x10')];this[_0x6207('0x11')]={};ami['on'](_0x6207('0x12'),this['syncNewchannel'][_0x6207('0x13')](this));ami['on'](_0x6207('0x14'),this[_0x6207('0x15')]['bind'](this));ami['on'](_0x6207('0x16'),this[_0x6207('0x17')][_0x6207('0x13')](this));ami['on'](_0x6207('0x18'),this[_0x6207('0x19')][_0x6207('0x13')](this));ami['on']('faxstatus',this[_0x6207('0x1a')][_0x6207('0x13')](this));ami['on'](_0x6207('0x1b'),this[_0x6207('0x1c')][_0x6207('0x13')](this));ami['on'](_0x6207('0x1d'),this['syncHangup'][_0x6207('0x13')](this));ami['on'](_0x6207('0x1e'),this[_0x6207('0x1f')][_0x6207('0x13')](this));}Fax[_0x6207('0x20')][_0x6207('0x21')]=function(_0x4864aa){if(_0x4864aa[_0x6207('0x22')]==='from-voip-provider'){for(var _0x1ff52d in this[_0x6207('0xf')]){if(this[_0x6207('0xf')]['hasOwnProperty'](_0x1ff52d)){if(_0x4864aa[_0x6207('0x23')]===this['faxAccounts'][_0x1ff52d][_0x6207('0x24')]){this['channels'][_0x4864aa[_0x6207('0x25')]]={};this[_0x6207('0xe')][_0x4864aa[_0x6207('0x25')]][_0x6207('0x26')]=_0x4864aa[_0x6207('0x26')];this[_0x6207('0xe')][_0x4864aa['uniqueid']]['id']=this['faxAccounts'][_0x1ff52d]['id'];this[_0x6207('0xe')][_0x4864aa[_0x6207('0x25')]][_0x6207('0x27')]=this[_0x6207('0xf')][_0x1ff52d][_0x6207('0x27')];logger[_0x6207('0x28')](_0x4864aa[_0x6207('0x25')],_0x6207('0x29'));}}}}if(this[_0x6207('0x11')][_0x4864aa['uniqueid']]){this[_0x6207('0xe')][_0x4864aa[_0x6207('0x25')]]={};this[_0x6207('0xe')][_0x4864aa['uniqueid']][_0x6207('0x26')]=_0x4864aa['channel'];logger[_0x6207('0x28')](_0x4864aa[_0x6207('0x25')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x6207('0x15')]=function(_0x4281ed){if(this[_0x6207('0xe')][_0x4281ed['uniqueid']]){for(var _0x10ea56 in _0x4281ed[_0x6207('0x2a')]){if(_0x4281ed[_0x6207('0x2a')][_0x6207('0x2b')](_0x10ea56)){this[_0x6207('0xe')][_0x4281ed[_0x6207('0x25')]][_0x10ea56]=_0x4281ed[_0x6207('0x2c')];}}}};Fax[_0x6207('0x20')][_0x6207('0x17')]=function(_0x5b4e7f){if(this[_0x6207('0xe')][_0x5b4e7f[_0x6207('0x25')]]){this[_0x6207('0xe')][_0x5b4e7f[_0x6207('0x25')]][_0x6207('0x2d')]=_0x5b4e7f[_0x6207('0x2d')];this[_0x6207('0xe')][_0x5b4e7f['uniqueid']][_0x6207('0x2e')]=_0x5b4e7f[_0x6207('0x2e')];}};Fax[_0x6207('0x20')][_0x6207('0x19')]=function(_0x16040c){if(this[_0x6207('0xe')][_0x16040c[_0x6207('0x25')]]){for(var _0x4c9aea in _0x16040c[_0x6207('0x2a')]){if(_0x16040c['variable']['hasOwnProperty'](_0x4c9aea)){this[_0x6207('0xe')][_0x16040c['uniqueid']][_0x4c9aea]=_0x16040c['value'];}}}};Fax['prototype'][_0x6207('0x1a')]=function(_0x309d71){if(this[_0x6207('0xe')][_0x309d71[_0x6207('0x25')]]){this[_0x6207('0xe')][_0x309d71[_0x6207('0x25')]][_0x6207('0x2f')]=_0x309d71[_0x6207('0x2f')];this['channels'][_0x309d71[_0x6207('0x25')]][_0x6207('0x30')]=_0x309d71['status'];this['channels'][_0x309d71['uniqueid']]['localstationid']=_0x309d71[_0x6207('0x24')];this['channels'][_0x309d71[_0x6207('0x25')]]['filename']=_0x309d71['filename'];logger[_0x6207('0x28')](_0x309d71['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x6207('0x20')][_0x6207('0x1c')]=function(_0x1ea40f){var _0x6a2cb2=this;if(this[_0x6207('0xe')][_0x1ea40f[_0x6207('0x25')]]){var _0x281cac=this[_0x6207('0xe')][_0x1ea40f[_0x6207('0x25')]]['id'];this[_0x6207('0xe')][_0x1ea40f[_0x6207('0x25')]][_0x6207('0x31')]=_0x1ea40f[_0x6207('0x31')];this[_0x6207('0xe')][_0x1ea40f['uniqueid']]['pagestransferred']=_0x1ea40f[_0x6207('0x32')];this[_0x6207('0xe')][_0x1ea40f[_0x6207('0x25')]][_0x6207('0x24')]=_0x1ea40f['localstationid'];this[_0x6207('0xe')][_0x1ea40f[_0x6207('0x25')]][_0x6207('0x33')]=_0x1ea40f['resolution'];this[_0x6207('0xe')][_0x1ea40f['uniqueid']]['transferrate']=_0x1ea40f[_0x6207('0x34')];this[_0x6207('0xe')][_0x1ea40f['uniqueid']][_0x6207('0x35')]=_0x1ea40f[_0x6207('0x35')];this[_0x6207('0xe')][_0x1ea40f[_0x6207('0x25')]][_0x6207('0x36')]=_0x1ea40f[_0x6207('0x36')];if(this['channels'][_0x1ea40f[_0x6207('0x25')]][_0x6207('0x32')]>0x0){tiff2pdf(_0x1ea40f['filename'],_0x6207('0x37'),function(_0x1231f3){logger['info'](_0x1ea40f[_0x6207('0x25')],_0x6207('0x38'),_0x1231f3[_0x6207('0x39')]);attachment['create']({'name':path[_0x6207('0x3a')](_0x1ea40f[_0x6207('0x35')])[_0x6207('0x27')],'basename':path[_0x6207('0x3a')](_0x1ea40f['filename'])[_0x6207('0x27')]+_0x6207('0x3b'),'type':_0x6207('0x3c')})[_0x6207('0x3d')](function(_0x296635){faxAccount['notify'](_0x281cac,{'from':_0x1ea40f['calleridnum'],'mapKey':_0x6207('0x7'),'body':path[_0x6207('0x3a')](_0x1ea40f[_0x6207('0x35')])['name']+_0x6207('0x3b'),'AttachmentId':_0x296635['id']})[_0x6207('0x3e')](function(_0x1470ea){logger[_0x6207('0x3f')](_0x1ea40f[_0x6207('0x25')],_0x6207('0x40'),JSON[_0x6207('0x41')](_0x1470ea));});})[_0x6207('0x3e')](function(_0x49627d){logger[_0x6207('0x3f')](_0x1ea40f[_0x6207('0x25')],'\x20receiveFax\x20',JSON[_0x6207('0x41')](_0x49627d));});});}logger[_0x6207('0x28')](_0x1ea40f[_0x6207('0x25')],'\x20receiveFax\x20');}};Fax[_0x6207('0x20')][_0x6207('0x1f')]=function(_0x225cf8){if(this[_0x6207('0x11')][_0x225cf8[_0x6207('0x25')]]){_['merge'](this['channels'][_0x225cf8[_0x6207('0x25')]],_['pick'](_0x225cf8,['response',_0x6207('0x42')]));}};function updateStatus(_0x2de6b7){if(_0x2de6b7['AttachmentId']){faxMessage['update'](_0x2de6b7[_0x6207('0x43')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x5b9bc6){ut[_0x6207('0x44')](_0x6207('0x45'),_0x5b9bc6);})['catch'](function(_0x380eb4){ut['logger'](_0x6207('0x46'),_0x380eb4);});}else{ut[_0x6207('0x44')](_0x6207('0x47'));}}Fax[_0x6207('0x20')][_0x6207('0x48')]=function(_0x508fa3,_0x3decc4,_0x2da468){var _0xb45775=this;var _0x4264d1={};if(_0x3decc4){_0x4264d1={'read':_0x3decc4};}else{_0x4264d1={'failMessage':_0x2da468};}if(this[_0x6207('0x11')][_0x508fa3]['AttachmentId']){faxMessage[_0x6207('0x49')](this[_0x6207('0x11')][_0x508fa3]['AttachmentId'],_0x4264d1)['then'](function(_0x6d2563){ut['logger'](_0x6207('0x4a'),_0x6d2563);})['catch'](function(_0x1d672a){ut[_0x6207('0x44')]('[Fax][Message][NoUpdate1]',_0x1d672a);})[_0x6207('0x4b')](function(){delete _0xb45775[_0x6207('0xe')][_0x508fa3];delete _0xb45775[_0x6207('0x11')][_0x508fa3];});}else{ut['logger'](_0x6207('0x4c'));delete this[_0x6207('0xe')][_0x508fa3];delete this[_0x6207('0x11')][_0x508fa3];}};Fax[_0x6207('0x20')][_0x6207('0x4d')]=function(_0x1183ba){var _0x45d275=this;if(this[_0x6207('0xe')][_0x1183ba[_0x6207('0x25')]]){if(this[_0x6207('0x11')][_0x1183ba[_0x6207('0x25')]]){this[_0x6207('0xe')][_0x1183ba[_0x6207('0x25')]]['id']=this[_0x6207('0x11')][_0x1183ba['uniqueid']]['id'];this[_0x6207('0xe')][_0x1183ba[_0x6207('0x25')]][_0x6207('0x27')]=this[_0x6207('0x11')][_0x1183ba[_0x6207('0x25')]][_0x6207('0x27')];}logger['info'](_0x1183ba[_0x6207('0x25')],this['actions'][_0x1183ba[_0x6207('0x25')]]?_0x6207('0x4e'):_0x6207('0x4f'),JSON[_0x6207('0x41')](this[_0x6207('0xe')][_0x1183ba[_0x6207('0x25')]]));if(this[_0x6207('0x11')][_0x1183ba[_0x6207('0x25')]]){if(this['channels'][_0x1183ba[_0x6207('0x25')]][_0x6207('0x50')]>0x0&&this[_0x6207('0xe')][_0x1183ba['uniqueid']][_0x6207('0x51')]===_0x6207('0x52')){this[_0x6207('0x48')](_0x1183ba[_0x6207('0x25')],!![]);}else{this['updateStatus'](_0x1183ba[_0x6207('0x25')],![],this[_0x6207('0xe')][_0x1183ba['uniqueid']][_0x6207('0x53')]?_0x6207('0x54')+this['channels'][_0x1183ba[_0x6207('0x25')]][_0x6207('0x53')]:_0x6207('0x55'));}}}};Fax[_0x6207('0x20')][_0x6207('0x56')]=function(_0x17dc57){var _0x196794=this;return new BPromise(function(_0xb0e548,_0x1a0d18){_0x196794[_0x6207('0x57')](_0x17dc57,_0x196794[_0x6207('0xf')][_0x17dc57[_0x6207('0x58')]])['then'](function(_0x27c4c6){ut[_0x6207('0x44')]('[Fax][execOriginate][success]',_0x27c4c6);_0xb0e548(ut[_0x6207('0x39')](_0x6207('0x59')));})[_0x6207('0x3e')](function(_0x7ef5e5){ut['logger'](_0x6207('0x5a'),_0x7ef5e5);updateStatus(_0x17dc57);_0x1a0d18(ut['message']('Fax\x20failed'));});});};Fax[_0x6207('0x20')][_0x6207('0x5b')]=function(_0x439086){var _0x4b08d0=this;return new BPromise(function(_0x80c257,_0x133c5e){var _0x4b899e=_0x4b08d0[_0x6207('0x5c')](_0x4b08d0[_0x6207('0xf')][_0x439086[_0x6207('0x58')]]['Trunk'],_0x439086);if(_0x4b899e['isValid']){_0x80c257(ut[_0x6207('0x39')](_0x6207('0x5d')));}else{_0x133c5e(ut[_0x6207('0x39')](_0x4b899e[_0x6207('0x39')]));}});};function originate(_0x349500,_0x1286c2,_0xb6687b){return new BPromise(function(_0xdbc4b3,_0x15ec29){if(_0xb6687b){var _0x1b56ab=util[_0x6207('0x5e')](_0x6207('0x5f'),path[_0x6207('0x3a')](_0x349500[_0x6207('0x4')])['name'],_0x349500['path']);gs['execute'](_0x1b56ab)[_0x6207('0x3d')](function(){_0x349500[_0x6207('0x4')]=util[_0x6207('0x5e')](_0x6207('0x60'),path[_0x6207('0x3a')](_0x349500['path'])[_0x6207('0x61')],path['parse'](_0x349500[_0x6207('0x4')])['name']);_0x1286c2['XMF-PATH']=_0x349500[_0x6207('0x4')];ut[_0x6207('0x44')]('Convert\x20pdf\x20to\x20tif','');ami[_0x6207('0x62')](ut[_0x6207('0x63')](_0x349500,_0x1286c2))['then'](function(_0x376c80){_0xdbc4b3(_0x376c80);})['catch'](function(_0x2d1fe3){_0x15ec29(_0x2d1fe3);});})[_0x6207('0x3e')](function(_0x25f303){_0x15ec29(_0x25f303);});}else{ami[_0x6207('0x62')](ut[_0x6207('0x63')](_0x349500,_0x1286c2))[_0x6207('0x3d')](function(_0x2d7503){_0xdbc4b3(_0x2d7503);})['catch'](function(_0x247891){_0x15ec29(_0x247891);});}});}Fax[_0x6207('0x20')]['execOriginate']=function(_0xffcd94,_0x8d456){var _0x42eba8=this;return new BPromise(function(_0x3b4101,_0x396fec){var _0x4f6782=uuid['v4']();var _0x3087e4=ut['addVariables'](_0xffcd94,_0x8d456);_0x42eba8['actions'][_0x4f6782]=new Action(_0x4f6782,_0x8d456,_0xffcd94);var _0x5f390c=_0x42eba8[_0x6207('0x11')][_0x4f6782];if(path[_0x6207('0x3a')](_0xffcd94[_0x6207('0x4')])[_0x6207('0x64')]===_0x6207('0x3b')){originate(_0x5f390c,_0x3087e4,!![])[_0x6207('0x3d')](function(_0x59aedf){_0x3b4101(_0x59aedf);})[_0x6207('0x3e')](function(_0xc768d4){_0x396fec(_0xc768d4);});}else{originate(_0x5f390c,_0x3087e4,![])['then'](function(_0x999bfd){_0x3b4101(_0x999bfd);})[_0x6207('0x3e')](function(_0xdee5e8){_0x396fec(_0xdee5e8);});}});};Fax[_0x6207('0x20')][_0x6207('0x65')]=function(_0x1c53a2){return!_[_0x6207('0x66')](_0x1c53a2)&&!_['isNil'](_0x1c53a2[_0x6207('0x27')])&&!_[_0x6207('0x66')](_0x1c53a2[_0x6207('0x67')])&&_0x1c53a2[_0x6207('0x67')]&&!_[_0x6207('0x66')](this[_0x6207('0x10')][util[_0x6207('0x5e')](_0x6207('0x68'),_0x1c53a2[_0x6207('0x27')])])&&!_[_0x6207('0x66')](this[_0x6207('0x10')][util[_0x6207('0x5e')]('SIP/%s',_0x1c53a2[_0x6207('0x27')])][_0x6207('0x30')])&&(this['trunks'][util[_0x6207('0x5e')]('SIP/%s',_0x1c53a2[_0x6207('0x27')])][_0x6207('0x30')]===_0x6207('0x69')||this[_0x6207('0x10')][util[_0x6207('0x5e')]('SIP/%s',_0x1c53a2['name'])]['status']===_0x6207('0x6a'));};Fax[_0x6207('0x20')][_0x6207('0x5c')]=function(_0x32c2b9,_0x434c43){if(!this[_0x6207('0x65')](_0x32c2b9)){ut[_0x6207('0x44')](_0x6207('0x6b'),_[_0x6207('0x66')](_0x32c2b9)?'':_0x32c2b9[_0x6207('0x27')]+_0x6207('0x6c'));return{'isValid':![],'message':_0x6207('0x6d')};}if(_['isNil'](_0x434c43[_0x6207('0x7')])){ut[_0x6207('0x44')](_0x6207('0x6e'),JSON[_0x6207('0x41')](_0x434c43));return{'isValid':![],'message':_0x6207('0x6f')};}if(_[_0x6207('0x66')](_0x434c43[_0x6207('0x4')])){ut[_0x6207('0x44')](_0x6207('0x70'),JSON[_0x6207('0x41')](_0x434c43));return{'isValid':![],'message':_0x6207('0x71')};}return{'isValid':!![],'message':_0x6207('0x72')};};module[_0x6207('0x73')]=Fax; \ No newline at end of file +var _0xb98f=['Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','status','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','../../../config/logger','fax','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','varset','syncVarSet','bind','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','actions','info','variable','value','prototype','syncNewState','channelstate','channelstatedesc','operation','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','message','create','parse','application/pdf','notify','.pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','then','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk'];(function(_0x28df97,_0x3716cc){var _0x14fa64=function(_0x51120a){while(--_0x51120a){_0x28df97['push'](_0x28df97['shift']());}};_0x14fa64(++_0x3716cc);}(_0xb98f,0x186));var _0xfb98=function(_0x1aa2c0,_0xc6f41c){_0x1aa2c0=_0x1aa2c0-0x0;var _0x32ad76=_0xb98f[_0x1aa2c0];return _0x32ad76;};'use strict';var util=require(_0xfb98('0x0'));var _=require(_0xfb98('0x1'));var BPromise=require('bluebird');var uuid=require(_0xfb98('0x2'));var moment=require(_0xfb98('0x3'));var path=require(_0xfb98('0x4'));var tiff2pdf=require(_0xfb98('0x5'));var gs=require('./util/gs');var logger=require(_0xfb98('0x6'))(_0xfb98('0x7'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xfb98('0x8'));var ut=require('./util/util');var Action=require(_0xfb98('0x9'));var faxAccount=require(_0xfb98('0xa'));var attachment=require(_0xfb98('0xb'));var faxMessage=require(_0xfb98('0xc'));function Fax(_0x44719c){this['channels']={};this[_0xfb98('0xd')]=_0x44719c[_0xfb98('0xd')];this['trunks']=_0x44719c[_0xfb98('0xe')];this['actions']={};ami['on'](_0xfb98('0xf'),this['syncNewchannel']['bind'](this));ami['on'](_0xfb98('0x10'),this[_0xfb98('0x11')][_0xfb98('0x12')](this));ami['on'](_0xfb98('0x13'),this['syncNewState']['bind'](this));ami['on'](_0xfb98('0x14'),this[_0xfb98('0x15')][_0xfb98('0x12')](this));ami['on'](_0xfb98('0x16'),this[_0xfb98('0x17')][_0xfb98('0x12')](this));ami['on']('receivefax',this[_0xfb98('0x18')][_0xfb98('0x12')](this));ami['on'](_0xfb98('0x19'),this[_0xfb98('0x1a')][_0xfb98('0x12')](this));ami['on']('originateresponse',this[_0xfb98('0x1b')][_0xfb98('0x12')](this));}Fax['prototype'][_0xfb98('0x1c')]=function(_0x2f9eed){if(_0x2f9eed[_0xfb98('0x1d')]===_0xfb98('0x1e')){for(var _0x46dc59 in this[_0xfb98('0xd')]){if(this[_0xfb98('0xd')][_0xfb98('0x1f')](_0x46dc59)){if(_0x2f9eed[_0xfb98('0x20')]===this[_0xfb98('0xd')][_0x46dc59][_0xfb98('0x21')]){this[_0xfb98('0x22')][_0x2f9eed[_0xfb98('0x23')]]={};this['channels'][_0x2f9eed['uniqueid']][_0xfb98('0x24')]=_0x2f9eed[_0xfb98('0x24')];this[_0xfb98('0x22')][_0x2f9eed[_0xfb98('0x23')]]['id']=this[_0xfb98('0xd')][_0x46dc59]['id'];this[_0xfb98('0x22')][_0x2f9eed[_0xfb98('0x23')]][_0xfb98('0x25')]=this[_0xfb98('0xd')][_0x46dc59]['name'];logger['info'](_0x2f9eed[_0xfb98('0x23')],_0xfb98('0x26'));}}}}if(this[_0xfb98('0x27')][_0x2f9eed[_0xfb98('0x23')]]){this[_0xfb98('0x22')][_0x2f9eed[_0xfb98('0x23')]]={};this['channels'][_0x2f9eed[_0xfb98('0x23')]]['channel']=_0x2f9eed['channel'];logger[_0xfb98('0x28')](_0x2f9eed['uniqueid'],'\x20syncNewchannel\x20');}};Fax['prototype'][_0xfb98('0x11')]=function(_0x5d96a7){if(this['channels'][_0x5d96a7[_0xfb98('0x23')]]){for(var _0x565ef4 in _0x5d96a7['variable']){if(_0x5d96a7[_0xfb98('0x29')][_0xfb98('0x1f')](_0x565ef4)){this[_0xfb98('0x22')][_0x5d96a7['uniqueid']][_0x565ef4]=_0x5d96a7[_0xfb98('0x2a')];}}}};Fax[_0xfb98('0x2b')][_0xfb98('0x2c')]=function(_0x18f824){if(this[_0xfb98('0x22')][_0x18f824['uniqueid']]){this['channels'][_0x18f824['uniqueid']][_0xfb98('0x2d')]=_0x18f824[_0xfb98('0x2d')];this['channels'][_0x18f824[_0xfb98('0x23')]][_0xfb98('0x2e')]=_0x18f824['channelstatedesc'];}};Fax[_0xfb98('0x2b')]['syncNewExten']=function(_0x1e34ab){if(this[_0xfb98('0x22')][_0x1e34ab[_0xfb98('0x23')]]){for(var _0xbc53d3 in _0x1e34ab[_0xfb98('0x29')]){if(_0x1e34ab[_0xfb98('0x29')]['hasOwnProperty'](_0xbc53d3)){this['channels'][_0x1e34ab['uniqueid']][_0xbc53d3]=_0x1e34ab[_0xfb98('0x2a')];}}}};Fax['prototype'][_0xfb98('0x17')]=function(_0x311af8){if(this[_0xfb98('0x22')][_0x311af8['uniqueid']]){this['channels'][_0x311af8[_0xfb98('0x23')]][_0xfb98('0x2f')]=_0x311af8[_0xfb98('0x2f')];this[_0xfb98('0x22')][_0x311af8[_0xfb98('0x23')]]['status']=_0x311af8['status'];this[_0xfb98('0x22')][_0x311af8[_0xfb98('0x23')]][_0xfb98('0x21')]=_0x311af8[_0xfb98('0x21')];this[_0xfb98('0x22')][_0x311af8[_0xfb98('0x23')]]['filename']=_0x311af8[_0xfb98('0x30')];logger[_0xfb98('0x28')](_0x311af8[_0xfb98('0x23')],'\x20syncFaxStatus\x20');}};Fax[_0xfb98('0x2b')][_0xfb98('0x18')]=function(_0x37d35b){var _0x2af0eb=this;if(this[_0xfb98('0x22')][_0x37d35b[_0xfb98('0x23')]]){var _0x20d8ec=this[_0xfb98('0x22')][_0x37d35b['uniqueid']]['id'];this['channels'][_0x37d35b['uniqueid']][_0xfb98('0x31')]=_0x37d35b[_0xfb98('0x31')];this[_0xfb98('0x22')][_0x37d35b[_0xfb98('0x23')]][_0xfb98('0x32')]=_0x37d35b[_0xfb98('0x32')];this[_0xfb98('0x22')][_0x37d35b[_0xfb98('0x23')]]['localstationid']=_0x37d35b[_0xfb98('0x21')];this[_0xfb98('0x22')][_0x37d35b[_0xfb98('0x23')]][_0xfb98('0x33')]=_0x37d35b['resolution'];this[_0xfb98('0x22')][_0x37d35b[_0xfb98('0x23')]]['transferrate']=_0x37d35b[_0xfb98('0x34')];this['channels'][_0x37d35b[_0xfb98('0x23')]][_0xfb98('0x30')]=_0x37d35b['filename'];this[_0xfb98('0x22')][_0x37d35b['uniqueid']][_0xfb98('0x35')]=_0x37d35b[_0xfb98('0x35')];if(this[_0xfb98('0x22')][_0x37d35b[_0xfb98('0x23')]][_0xfb98('0x32')]>0x0){tiff2pdf(_0x37d35b['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x2df7de){logger['info'](_0x37d35b['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x2df7de[_0xfb98('0x36')]);attachment[_0xfb98('0x37')]({'name':path[_0xfb98('0x38')](_0x37d35b[_0xfb98('0x30')])[_0xfb98('0x25')],'basename':path['parse'](_0x37d35b['filename'])['name']+'.pdf','type':_0xfb98('0x39')})['then'](function(_0x3fdee1){faxAccount[_0xfb98('0x3a')](_0x20d8ec,{'from':_0x37d35b['calleridnum'],'mapKey':_0xfb98('0x7'),'body':path[_0xfb98('0x38')](_0x37d35b['filename'])[_0xfb98('0x25')]+_0xfb98('0x3b'),'AttachmentId':_0x3fdee1['id']})[_0xfb98('0x3c')](function(_0x362c98){logger['error'](_0x37d35b[_0xfb98('0x23')],_0xfb98('0x3d'),JSON[_0xfb98('0x3e')](_0x362c98));});})[_0xfb98('0x3c')](function(_0x1c7cb9){logger[_0xfb98('0x3f')](_0x37d35b[_0xfb98('0x23')],_0xfb98('0x40'),JSON[_0xfb98('0x3e')](_0x1c7cb9));});});}logger[_0xfb98('0x28')](_0x37d35b[_0xfb98('0x23')],_0xfb98('0x40'));}};Fax[_0xfb98('0x2b')][_0xfb98('0x1b')]=function(_0x30a963){if(this[_0xfb98('0x27')][_0x30a963['uniqueid']]){_[_0xfb98('0x41')](this[_0xfb98('0x22')][_0x30a963[_0xfb98('0x23')]],_['pick'](_0x30a963,['response',_0xfb98('0x42')]));}};function updateStatus(_0x216a1a){if(_0x216a1a['AttachmentId']){faxMessage['update'](_0x216a1a[_0xfb98('0x43')],{'failMessage':_0xfb98('0x44')})['then'](function(_0x341398){ut[_0xfb98('0x45')](_0xfb98('0x46'),_0x341398);})['catch'](function(_0x1a062a){ut[_0xfb98('0x45')](_0xfb98('0x47'),_0x1a062a);});}else{ut['logger'](_0xfb98('0x48'));}}Fax[_0xfb98('0x2b')][_0xfb98('0x49')]=function(_0x126b0d,_0x3ccb36,_0x10db70){var _0x1b60b4=this;var _0x339188={};if(_0x3ccb36){_0x339188={'read':_0x3ccb36};}else{_0x339188={'failMessage':_0x10db70};}if(this[_0xfb98('0x27')][_0x126b0d]['AttachmentId']){faxMessage[_0xfb98('0x4a')](this[_0xfb98('0x27')][_0x126b0d][_0xfb98('0x43')],_0x339188)['then'](function(_0x4dd58b){ut['logger'](_0xfb98('0x4b'),_0x4dd58b);})[_0xfb98('0x3c')](function(_0x52712e){ut['logger'](_0xfb98('0x4c'),_0x52712e);})[_0xfb98('0x4d')](function(){delete _0x1b60b4[_0xfb98('0x22')][_0x126b0d];delete _0x1b60b4[_0xfb98('0x27')][_0x126b0d];});}else{ut[_0xfb98('0x45')](_0xfb98('0x4e'));delete this['channels'][_0x126b0d];delete this[_0xfb98('0x27')][_0x126b0d];}};Fax[_0xfb98('0x2b')]['syncHangup']=function(_0x51fe31){var _0x4a544e=this;if(this['channels'][_0x51fe31[_0xfb98('0x23')]]){if(this[_0xfb98('0x27')][_0x51fe31[_0xfb98('0x23')]]){this[_0xfb98('0x22')][_0x51fe31[_0xfb98('0x23')]]['id']=this['actions'][_0x51fe31[_0xfb98('0x23')]]['id'];this[_0xfb98('0x22')][_0x51fe31[_0xfb98('0x23')]][_0xfb98('0x25')]=this[_0xfb98('0x27')][_0x51fe31[_0xfb98('0x23')]]['name'];}logger['info'](_0x51fe31[_0xfb98('0x23')],this[_0xfb98('0x27')][_0x51fe31[_0xfb98('0x23')]]?_0xfb98('0x4f'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x51fe31[_0xfb98('0x23')]]));if(this['actions'][_0x51fe31[_0xfb98('0x23')]]){if(this[_0xfb98('0x22')][_0x51fe31[_0xfb98('0x23')]]['faxpages']>0x0&&this[_0xfb98('0x22')][_0x51fe31[_0xfb98('0x23')]][_0xfb98('0x16')]===_0xfb98('0x50')){this[_0xfb98('0x49')](_0x51fe31[_0xfb98('0x23')],!![]);}else{this[_0xfb98('0x49')](_0x51fe31['uniqueid'],![],this[_0xfb98('0x22')][_0x51fe31[_0xfb98('0x23')]][_0xfb98('0x51')]?_0xfb98('0x52')+this[_0xfb98('0x22')][_0x51fe31['uniqueid']][_0xfb98('0x51')]:_0xfb98('0x53'));}}}};Fax['prototype'][_0xfb98('0x54')]=function(_0x7815d0){var _0x356ab5=this;return new BPromise(function(_0x1472fd,_0x10c646){_0x356ab5[_0xfb98('0x55')](_0x7815d0,_0x356ab5[_0xfb98('0xd')][_0x7815d0[_0xfb98('0x56')]])[_0xfb98('0x57')](function(_0xbe0526){ut['logger'](_0xfb98('0x58'),_0xbe0526);_0x1472fd(ut[_0xfb98('0x36')](_0xfb98('0x59')));})[_0xfb98('0x3c')](function(_0x11eece){ut[_0xfb98('0x45')](_0xfb98('0x5a'),_0x11eece);updateStatus(_0x7815d0);_0x10c646(ut[_0xfb98('0x36')](_0xfb98('0x5b')));});});};Fax[_0xfb98('0x2b')][_0xfb98('0x5c')]=function(_0x428554){var _0x470dfd=this;return new BPromise(function(_0x1db0d3,_0x559309){var _0x310985=_0x470dfd[_0xfb98('0x5d')](_0x470dfd[_0xfb98('0xd')][_0x428554[_0xfb98('0x56')]][_0xfb98('0x5e')],_0x428554);if(_0x310985[_0xfb98('0x5f')]){_0x1db0d3(ut['message']('Trunk\x20Reachable'));}else{_0x559309(ut[_0xfb98('0x36')](_0x310985['message']));}});};function originate(_0x455dfa,_0x35d721,_0x2fad0f){return new BPromise(function(_0x1bb23c,_0x16eb90){if(_0x2fad0f){var _0x4d9ba7=util[_0xfb98('0x60')](_0xfb98('0x61'),path[_0xfb98('0x38')](_0x455dfa['path'])['name'],_0x455dfa[_0xfb98('0x4')]);gs[_0xfb98('0x62')](_0x4d9ba7)[_0xfb98('0x57')](function(){_0x455dfa[_0xfb98('0x4')]=util[_0xfb98('0x60')](_0xfb98('0x63'),path[_0xfb98('0x38')](_0x455dfa['path'])[_0xfb98('0x64')],path['parse'](_0x455dfa[_0xfb98('0x4')])[_0xfb98('0x25')]);_0x35d721['XMF-PATH']=_0x455dfa['path'];ut[_0xfb98('0x45')](_0xfb98('0x65'),'');ami[_0xfb98('0x66')](ut[_0xfb98('0x67')](_0x455dfa,_0x35d721))[_0xfb98('0x57')](function(_0xa92832){_0x1bb23c(_0xa92832);})[_0xfb98('0x3c')](function(_0x34891f){_0x16eb90(_0x34891f);});})['catch'](function(_0x11feeb){_0x16eb90(_0x11feeb);});}else{ami[_0xfb98('0x66')](ut['variablesAction'](_0x455dfa,_0x35d721))[_0xfb98('0x57')](function(_0x21d7db){_0x1bb23c(_0x21d7db);})[_0xfb98('0x3c')](function(_0x555819){_0x16eb90(_0x555819);});}});}Fax[_0xfb98('0x2b')][_0xfb98('0x55')]=function(_0x54f5e2,_0x3f79ec){var _0x4b3b39=this;return new BPromise(function(_0x1d5e18,_0xf57d02){var _0x1ae5ab=uuid['v4']();var _0x56acaf=ut[_0xfb98('0x68')](_0x54f5e2,_0x3f79ec);_0x4b3b39['actions'][_0x1ae5ab]=new Action(_0x1ae5ab,_0x3f79ec,_0x54f5e2);var _0x5cfd44=_0x4b3b39[_0xfb98('0x27')][_0x1ae5ab];if(path[_0xfb98('0x38')](_0x54f5e2[_0xfb98('0x4')])[_0xfb98('0x69')]===_0xfb98('0x3b')){originate(_0x5cfd44,_0x56acaf,!![])[_0xfb98('0x57')](function(_0x497890){_0x1d5e18(_0x497890);})[_0xfb98('0x3c')](function(_0x5cacb3){_0xf57d02(_0x5cacb3);});}else{originate(_0x5cfd44,_0x56acaf,![])['then'](function(_0x4323c5){_0x1d5e18(_0x4323c5);})[_0xfb98('0x3c')](function(_0x4a72d1){_0xf57d02(_0x4a72d1);});}});};Fax[_0xfb98('0x2b')][_0xfb98('0x6a')]=function(_0x51301f){return!_[_0xfb98('0x6b')](_0x51301f)&&!_[_0xfb98('0x6b')](_0x51301f['name'])&&!_['isNil'](_0x51301f[_0xfb98('0x6c')])&&_0x51301f['active']&&!_[_0xfb98('0x6b')](this['trunks'][util['format'](_0xfb98('0x6d'),_0x51301f[_0xfb98('0x25')])])&&!_[_0xfb98('0x6b')](this[_0xfb98('0xe')][util['format'](_0xfb98('0x6d'),_0x51301f[_0xfb98('0x25')])][_0xfb98('0x6e')])&&(this[_0xfb98('0xe')][util[_0xfb98('0x60')](_0xfb98('0x6d'),_0x51301f['name'])][_0xfb98('0x6e')]==='reachable'||this[_0xfb98('0xe')][util['format'](_0xfb98('0x6d'),_0x51301f[_0xfb98('0x25')])][_0xfb98('0x6e')]===_0xfb98('0x6f'));};Fax['prototype']['checkTrunk']=function(_0x41f60a,_0x4e9971){if(!this[_0xfb98('0x6a')](_0x41f60a)){ut[_0xfb98('0x45')](_0xfb98('0x70'),_[_0xfb98('0x6b')](_0x41f60a)?'':_0x41f60a[_0xfb98('0x25')]+_0xfb98('0x71'));return{'isValid':![],'message':_0xfb98('0x72')};}if(_['isNil'](_0x4e9971[_0xfb98('0x7')])){ut[_0xfb98('0x45')](_0xfb98('0x73'),JSON[_0xfb98('0x3e')](_0x4e9971));return{'isValid':![],'message':_0xfb98('0x74')};}if(_[_0xfb98('0x6b')](_0x4e9971[_0xfb98('0x4')])){ut[_0xfb98('0x45')](_0xfb98('0x75'),JSON[_0xfb98('0x3e')](_0x4e9971));return{'isValid':![],'message':_0xfb98('0x76')};}return{'isValid':!![],'message':_0xfb98('0x77')};};module[_0xfb98('0x78')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5b13e8c..7b8a037 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 _0x835c=['inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','error'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x835c,0x1f2));var _0xc835=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x835c[_0x2641f9];return _0x585741;};'use strict';var util=require(_0xc835('0x0'));var BPromise=require(_0xc835('0x1'));var logger=require(_0xc835('0x2'))(_0xc835('0x3'));var _=require('lodash');var faxAccount=require(_0xc835('0x4'));function loggerCatch(_0x5a92e2){return function(_0x1ae4c1){logger[_0xc835('0x5')](_0x5a92e2,util[_0xc835('0x6')](_0x1ae4c1,{'showHidden':![],'depth':null}));};}exports[_0xc835('0x7')]=function(_0x3bd941,_0x9b3861){return BPromise[_0xc835('0x8')]()[_0xc835('0x9')](faxAccount[_0xc835('0x7')](_0x3bd941,_0x9b3861))[_0xc835('0xa')](loggerCatch(_0xc835('0xb')));}; \ No newline at end of file +var _0x51bd=['error','inspect','notify','resolve','[Notify]\x20','util','bluebird','../rpc/faxAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x51bd,0x10d));var _0xd51b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x51bd[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0xd51b('0x0'));var BPromise=require(_0xd51b('0x1'));var logger=require('../../../config/logger')('preview');var _=require('lodash');var faxAccount=require(_0xd51b('0x2'));function loggerCatch(_0x57202e){return function(_0xbc2d93){logger[_0xd51b('0x3')](_0x57202e,util[_0xd51b('0x4')](_0xbc2d93,{'showHidden':![],'depth':null}));};}exports[_0xd51b('0x5')]=function(_0xb03b86,_0x3a087b){return BPromise[_0xd51b('0x6')]()['then'](faxAccount[_0xd51b('0x5')](_0xb03b86,_0x3a087b))['catch'](loggerCatch(_0xd51b('0x7')));}; \ 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 ce363ed..dee7022 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 _0xca36=['inspect','fax','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x3786bc,_0x2e4674){var _0x114aa8=function(_0x6ac9f8){while(--_0x6ac9f8){_0x3786bc['push'](_0x3786bc['shift']());}};_0x114aa8(++_0x2e4674);}(_0xca36,0xf9));var _0x6ca3=function(_0x2ea7aa,_0x24b98c){_0x2ea7aa=_0x2ea7aa-0x0;var _0x50ed14=_0xca36[_0x2ea7aa];return _0x50ed14;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x6ca3('0x0'));var BPromise=require('bluebird');var exec=require(_0x6ca3('0x1'))[_0x6ca3('0x2')];exports[_0x6ca3('0x3')]=function(_0x70d1db){return new BPromise(function(_0x3bc373,_0x16078f){exec(_0x70d1db,function(_0x4f5d02,_0x5e5aeb,_0x3c1fa5){logger[_0x6ca3('0x4')](_0x6ca3('0x5'),_0x5e5aeb);if(_0x4f5d02){logger[_0x6ca3('0x4')](_0x6ca3('0x5'),_0x6ca3('0x6'),util[_0x6ca3('0x7')](_0x4f5d02,{'showHidden':![],'depth':null}),_0x5e5aeb,_0x3c1fa5);_0x16078f(_0x4f5d02);}_0x3bc373(_0x5e5aeb);});});}; \ No newline at end of file +var _0x471b=['exec','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','bluebird','child_process'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x471b,0x7a));var _0xb471=function(_0x17aa68,_0x3b0bb7){_0x17aa68=_0x17aa68-0x0;var _0x399a1a=_0x471b[_0x17aa68];return _0x399a1a;};'use strict';var util=require(_0xb471('0x0'));var logger=require(_0xb471('0x1'))('fax');var BPromise=require(_0xb471('0x2'));var exec=require(_0xb471('0x3'))[_0xb471('0x4')];exports['execute']=function(_0xfc752b){return new BPromise(function(_0x3b48f2,_0x351ded){exec(_0xfc752b,function(_0x105830,_0x4ddf78,_0x157dc6){logger[_0xb471('0x5')](_0xb471('0x6'),_0x4ddf78);if(_0x105830){logger[_0xb471('0x5')]('Exec\x20gs',_0xb471('0x7'),util[_0xb471('0x8')](_0x105830,{'showHidden':![],'depth':null}),_0x4ddf78,_0x157dc6);_0x351ded(_0x105830);}_0x3b48f2(_0x4ddf78);});});}; \ 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 abd80d6..6134a9f 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 _0xde99=['faxdetect','localstationid','path','variablesAction','uniqueid','xcally-motion-fax','\x22%s\x22\x20<%s>','util','../../../../config/logger','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xde99,0x137));var _0x9de9=function(_0x4baefc,_0x388dca){_0x4baefc=_0x4baefc-0x0;var _0x193979=_0xde99[_0x4baefc];return _0x193979;};'use strict';var util=require(_0x9de9('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x9de9('0x1'))('fax');exports['message']=function(_0x43b9b0){return{'message':_0x43b9b0};};exports[_0x9de9('0x2')]=function(_0x3beada,_0x571e06){logger['info'](_0x3beada,util[_0x9de9('0x3')](_0x571e06,{'showHidden':![],'depth':null}));};exports[_0x9de9('0x4')]=function(_0x7fd81d,_0x588055){var _0x87f44f={'XMF-ECM':_0x588055[_0x9de9('0x5')],'XMF-HEADERINFO':_0x588055[_0x9de9('0x6')],'XMF-MINRATE':_0x588055[_0x9de9('0x7')],'XMF-MAXRATE':_0x588055[_0x9de9('0x8')],'XMF-MODEM':util[_0x9de9('0x9')](_0x9de9('0xa'),_0x588055['modem']),'XMF-GATEWAY':_0x588055[_0x9de9('0xb')],'XMF-FAXDETECT':_0x588055[_0x9de9('0xc')],'XMF-T38TIMEOUT':_0x588055['t38timeout'],'XMF-LOCALSTATIONID':_0x588055[_0x9de9('0xd')],'XMF-PATH':_0x7fd81d[_0x9de9('0xe')]};return _0x87f44f;};exports[_0x9de9('0xf')]=function(_0x454378,_0x354457){return{'actionid':_0x454378[_0x9de9('0x10')],'action':'originate','channel':_0x454378['channel'],'Exten':_0x9de9('0x11'),'Context':'from-sip','Priority':'1','callerid':util[_0x9de9('0x9')](_0x9de9('0x12'),_0x454378[_0x9de9('0x6')]?_0x454378[_0x9de9('0x6')]:'',_0x454378[_0x9de9('0xd')]),'variable':_0x354457,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x454378[_0x9de9('0x10')]};}; \ No newline at end of file +var _0x85ba=['fax','message','info','inspect','addVariables','headerinfo','minrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','moment','../../../../config/logger'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x85ba,0x116));var _0xa85b=function(_0x10b220,_0x2073aa){_0x10b220=_0x10b220-0x0;var _0x1c2ead=_0x85ba[_0x10b220];return _0x1c2ead;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa85b('0x0'));var logger=require(_0xa85b('0x1'))(_0xa85b('0x2'));exports[_0xa85b('0x3')]=function(_0x1e3d75){return{'message':_0x1e3d75};};exports['logger']=function(_0x548034,_0x535c40){logger[_0xa85b('0x4')](_0x548034,util[_0xa85b('0x5')](_0x535c40,{'showHidden':![],'depth':null}));};exports[_0xa85b('0x6')]=function(_0x5d7506,_0x2e3e9e){var _0xf1bd4={'XMF-ECM':_0x2e3e9e['ecm'],'XMF-HEADERINFO':_0x2e3e9e[_0xa85b('0x7')],'XMF-MINRATE':_0x2e3e9e[_0xa85b('0x8')],'XMF-MAXRATE':_0x2e3e9e['maxrate'],'XMF-MODEM':util[_0xa85b('0x9')](_0xa85b('0xa'),_0x2e3e9e[_0xa85b('0xb')]),'XMF-GATEWAY':_0x2e3e9e['gateway'],'XMF-FAXDETECT':_0x2e3e9e[_0xa85b('0xc')],'XMF-T38TIMEOUT':_0x2e3e9e[_0xa85b('0xd')],'XMF-LOCALSTATIONID':_0x2e3e9e[_0xa85b('0xe')],'XMF-PATH':_0x5d7506['path']};return _0xf1bd4;};exports[_0xa85b('0xf')]=function(_0x5f3b37,_0x2a4781){return{'actionid':_0x5f3b37['uniqueid'],'action':_0xa85b('0x10'),'channel':_0x5f3b37[_0xa85b('0x11')],'Exten':_0xa85b('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0xa85b('0x9')](_0xa85b('0x13'),_0x5f3b37['headerinfo']?_0x5f3b37[_0xa85b('0x7')]:'',_0x5f3b37['localstationid']),'variable':_0x2a4781,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5f3b37['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 1effba3..5c0f4ea 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 _0x0a1f=['./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue'];(function(_0x2f7023,_0x1aa399){var _0x2f5e4e=function(_0x1fa5d4){while(--_0x1fa5d4){_0x2f7023['push'](_0x2f7023['shift']());}};_0x2f5e4e(++_0x1aa399);}(_0x0a1f,0x176));var _0xf0a1=function(_0xfff141,_0x195420){_0xfff141=_0xfff141-0x0;var _0x118c16=_0x0a1f[_0xfff141];return _0x118c16;};'use strict';var BPromise=require('bluebird');var util=require(_0xf0a1('0x0'));var moment=require(_0xf0a1('0x1'));var server=require(_0xf0a1('0x2'));var Realtime=require(_0xf0a1('0x3'));var Report=require(_0xf0a1('0x4'));var Acw=require(_0xf0a1('0x5'));var Trigger=require(_0xf0a1('0x6'));var Dialer=require('./dialer');var Preview=require(_0xf0a1('0x7'));var Fax=require('./fax');var user=require(_0xf0a1('0x8'));var voiceQueue=require(_0xf0a1('0x9'));var voiceQueueReport=require(_0xf0a1('0xa'));var voiceCallReport=require(_0xf0a1('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0xf0a1('0xc'));var template=require(_0xf0a1('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xf0a1('0xe'));var salesforce=require(_0xf0a1('0xf'));var sugarcrm=require(_0xf0a1('0x10'));var freshdesk=require(_0xf0a1('0x11'));var desk=require(_0xf0a1('0x12'));var zoho=require(_0xf0a1('0x13'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xf0a1('0x14'));var servicenow=require(_0xf0a1('0x15'));var dynamics365=require(_0xf0a1('0x16'));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()[_0xf0a1('0x17')](_0xf0a1('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()['then'](user[_0xf0a1('0x19')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x1b')]())[_0xf0a1('0x1a')](user[_0xf0a1('0x1c')]())['then'](realtime[_0xf0a1('0x1d')]())[_0xf0a1('0x1a')](trunk[_0xf0a1('0x1e')]())[_0xf0a1('0x1a')](realtime['initTrunks']())[_0xf0a1('0x1a')](voiceQueue['getVoiceQueues']())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x1f')]())[_0xf0a1('0x1a')](trigger[_0xf0a1('0x20')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x21')]())[_0xf0a1('0x1a')](template[_0xf0a1('0x22')]())['then'](realtime[_0xf0a1('0x23')]())[_0xf0a1('0x1a')](zendesk[_0xf0a1('0x24')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x25')]())['then'](salesforce[_0xf0a1('0x26')]())['then'](realtime[_0xf0a1('0x27')]())['then'](sugarcrm[_0xf0a1('0x28')]())[_0xf0a1('0x1a')](realtime['initSugarcrmAccounts']())[_0xf0a1('0x1a')](freshdesk[_0xf0a1('0x29')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x2a')]())[_0xf0a1('0x1a')](desk[_0xf0a1('0x2b')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x2c')]())[_0xf0a1('0x1a')](zoho['getZohoAccounts']())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x2d')]())[_0xf0a1('0x1a')](vtiger['getVtigerAccounts']())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x2e')]())[_0xf0a1('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xf0a1('0x2f')]())['then'](servicenow[_0xf0a1('0x30')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x31')]())[_0xf0a1('0x1a')](dynamics365[_0xf0a1('0x32')]())[_0xf0a1('0x1a')](realtime['initDynamics365Accounts']())[_0xf0a1('0x1a')](campaign[_0xf0a1('0x33')]())[_0xf0a1('0x1a')](realtime['initCampaigns']())['then'](voiceExtension[_0xf0a1('0x34')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x35')]())[_0xf0a1('0x1a')](faxAccount['getFaxAccounts']())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x36')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xf0a1('0x37')]()[_0xf0a1('0x1a')](voiceQueueReport[_0xf0a1('0x38')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x39')]())[_0xf0a1('0x1a')](cmHopperHistory[_0xf0a1('0x3a')]())[_0xf0a1('0x1a')](realtime['initVoiceQueueHopperHistory']())[_0xf0a1('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0xf0a1('0x1a')](realtime['initCampaignHopperHistory']())[_0xf0a1('0x1a')](voiceCallReport[_0xf0a1('0x3b')]())[_0xf0a1('0x1a')](realtime[_0xf0a1('0x3c')]())[_0xf0a1('0x1a')](function(_0x3ca082){})['catch'](function(_0x540f9f){console[_0xf0a1('0x3d')](_0x540f9f);});}function main(){return server[_0xf0a1('0x3e')](realtime,preview,fax)[_0xf0a1('0x1a')](function(_0x2252b8){return initRealtime();})[_0xf0a1('0x1a')](function(){return initParams();})[_0xf0a1('0x1a')](function(){report[_0xf0a1('0x3f')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x7cc0a6){console[_0xf0a1('0x3d')](_0x7cc0a6);});}main(); \ No newline at end of file +var _0x0a49=['./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','then','initAgents','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','bluebird','util','moment','./server','./report','./acw','./trigger','./dialer','./fax','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension'];(function(_0x5e429e,_0xb9e638){var _0x45fd77=function(_0x17b4cd){while(--_0x17b4cd){_0x5e429e['push'](_0x5e429e['shift']());}};_0x45fd77(++_0xb9e638);}(_0x0a49,0x73));var _0x90a4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x0a49[_0xdea41a];return _0x15d0d8;};'use strict';var BPromise=require(_0x90a4('0x0'));var util=require(_0x90a4('0x1'));var moment=require(_0x90a4('0x2'));var server=require(_0x90a4('0x3'));var Realtime=require('./realtime');var Report=require(_0x90a4('0x4'));var Acw=require(_0x90a4('0x5'));var Trigger=require(_0x90a4('0x6'));var Dialer=require(_0x90a4('0x7'));var Preview=require('./preview');var Fax=require(_0x90a4('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0x90a4('0x9'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x90a4('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x90a4('0xb'));var template=require(_0x90a4('0xc'));var cmHopperHistory=require(_0x90a4('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x90a4('0xe'));var faxAccount=require(_0x90a4('0xf'));var zendesk=require(_0x90a4('0x10'));var salesforce=require(_0x90a4('0x11'));var sugarcrm=require(_0x90a4('0x12'));var freshdesk=require(_0x90a4('0x13'));var desk=require(_0x90a4('0x14'));var zoho=require(_0x90a4('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x90a4('0x16'));var servicenow=require(_0x90a4('0x17'));var dynamics365=require(_0x90a4('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x90a4('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x90a4('0x1a')](user['getAgents']())[_0x90a4('0x1a')](realtime[_0x90a4('0x1b')]())[_0x90a4('0x1a')](user['getTelephones']())['then'](realtime[_0x90a4('0x1c')]())[_0x90a4('0x1a')](trunk[_0x90a4('0x1d')]())[_0x90a4('0x1a')](realtime['initTrunks']())[_0x90a4('0x1a')](voiceQueue[_0x90a4('0x1e')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x1f')]())[_0x90a4('0x1a')](trigger['getTriggers']())[_0x90a4('0x1a')](realtime[_0x90a4('0x20')]())[_0x90a4('0x1a')](template['getTemplates']())[_0x90a4('0x1a')](realtime[_0x90a4('0x21')]())[_0x90a4('0x1a')](zendesk['getZendeskAccounts']())[_0x90a4('0x1a')](realtime['initZendeskAccounts']())['then'](salesforce[_0x90a4('0x22')]())['then'](realtime[_0x90a4('0x23')]())[_0x90a4('0x1a')](sugarcrm[_0x90a4('0x24')]())['then'](realtime[_0x90a4('0x25')]())[_0x90a4('0x1a')](freshdesk[_0x90a4('0x26')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x27')]())[_0x90a4('0x1a')](desk['getDeskAccounts']())[_0x90a4('0x1a')](realtime[_0x90a4('0x28')]())[_0x90a4('0x1a')](zoho[_0x90a4('0x29')]())[_0x90a4('0x1a')](realtime['initZohoAccounts']())[_0x90a4('0x1a')](vtiger[_0x90a4('0x2a')]())['then'](realtime[_0x90a4('0x2b')]())[_0x90a4('0x1a')](freshsales[_0x90a4('0x2c')]())['then'](realtime[_0x90a4('0x2d')]())['then'](servicenow[_0x90a4('0x2e')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x2f')]())['then'](dynamics365[_0x90a4('0x30')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x31')]())['then'](campaign[_0x90a4('0x32')]())[_0x90a4('0x1a')](realtime['initCampaigns']())[_0x90a4('0x1a')](voiceExtension[_0x90a4('0x33')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x34')]())[_0x90a4('0x1a')](faxAccount[_0x90a4('0x35')]())['then'](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x90a4('0x36')]()['then'](voiceQueueReport[_0x90a4('0x37')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x38')]())[_0x90a4('0x1a')](cmHopperHistory[_0x90a4('0x39')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x3a')]())[_0x90a4('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0x90a4('0x1a')](realtime[_0x90a4('0x3b')]())[_0x90a4('0x1a')](voiceCallReport[_0x90a4('0x3c')]())[_0x90a4('0x1a')](realtime[_0x90a4('0x3d')]())[_0x90a4('0x1a')](function(_0x5d54b6){})['catch'](function(_0x5777b8){console[_0x90a4('0x3e')](_0x5777b8);});}function main(){return server[_0x90a4('0x3f')](realtime,preview,fax)[_0x90a4('0x1a')](function(_0x172d64){return initRealtime();})['then'](function(){return initParams();})[_0x90a4('0x1a')](function(){report[_0x90a4('0x40')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x16ea4e){console[_0x90a4('0x3e')](_0x16ea4e);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 6e44016..a985bcd 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(_0x27c226,_0x251e32){var _0xd17eec=function(_0x595e00){while(--_0x595e00){_0x27c226['push'](_0x27c226['shift']());}};_0xd17eec(++_0x251e32);}(_0x70e0,0x17b));var _0x070e=function(_0x3974f7,_0xe8b8d7){_0x3974f7=_0x3974f7-0x0;var _0x1c3119=_0x70e0[_0x3974f7];return _0x1c3119;};'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 _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x368c33,_0x12190a){var _0x23b033=function(_0x4b05f6){while(--_0x4b05f6){_0x368c33['push'](_0x368c33['shift']());}};_0x23b033(++_0x12190a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x397f37,_0x3cf86d){_0x397f37=_0x397f37-0x0;var _0x31cae6=_0xcb91[_0x397f37];return _0x31cae6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ef3b2b7..c1b733e 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 _0x56b2=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x5e08a2,_0x28cd1e){var _0x96e6b6=function(_0x1a0475){while(--_0x1a0475){_0x5e08a2['push'](_0x5e08a2['shift']());}};_0x96e6b6(++_0x28cd1e);}(_0x56b2,0x173));var _0x256b=function(_0x283bb7,_0x97b1f4){_0x283bb7=_0x283bb7-0x0;var _0x372b5a=_0x56b2[_0x283bb7];return _0x372b5a;};'use strict';function Campaign(_0x3b0c46){this['id']=_0x3b0c46['id']||0x0;this[_0x256b('0x0')]=_0x3b0c46['name']||'';this['type']=_0x3b0c46[_0x256b('0x1')]||'campaign';this[_0x256b('0x2')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x256b('0x3')]=0x0;this[_0x256b('0x4')]='';this[_0x256b('0x5')]=!![];this[_0x256b('0x6')]=_0x3b0c46[_0x256b('0x6')];this['limitCalls']=_0x3b0c46[_0x256b('0x7')];this[_0x256b('0x8')]=_0x3b0c46['dialTimezone']||null;this['dialGlobalInterval']=_0x3b0c46[_0x256b('0x9')]?_0x3b0c46[_0x256b('0x9')]:null;this[_0x256b('0xa')]=_0x3b0c46['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x3b0c46[_0x256b('0xb')];this[_0x256b('0xc')]=_0x3b0c46[_0x256b('0xc')]||0x1e;this[_0x256b('0xd')]=_0x3b0c46[_0x256b('0xd')];this['dialCongestionRetryFrequency']=_0x3b0c46[_0x256b('0xe')];this[_0x256b('0xf')]=_0x3b0c46[_0x256b('0xf')];this[_0x256b('0x10')]=_0x3b0c46[_0x256b('0x10')];this[_0x256b('0x11')]=_0x3b0c46[_0x256b('0x11')];this[_0x256b('0x12')]=_0x3b0c46[_0x256b('0x12')];this[_0x256b('0x13')]=_0x3b0c46['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x3b0c46[_0x256b('0x14')]||0x3;this[_0x256b('0x15')]=_0x3b0c46['dialNoSuchNumberRetryFrequency']||0x96;this[_0x256b('0x16')]=_0x3b0c46['dialDropMaxRetry']||0x3;this[_0x256b('0x17')]=_0x3b0c46[_0x256b('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0x3b0c46['dialAbandonedMaxRetry']||0x3;this[_0x256b('0x18')]=_0x3b0c46[_0x256b('0x18')]||0x96;this[_0x256b('0x19')]=_0x3b0c46['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x3b0c46[_0x256b('0x1a')]||0x96;this['dialAgentRejectMaxRetry']=_0x3b0c46['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x3b0c46[_0x256b('0x1b')]||0x96;this['dialOrderByScheduledAt']=_0x3b0c46[_0x256b('0x1c')]||_0x256b('0x1d');this[_0x256b('0x1e')]=_0x3b0c46[_0x256b('0x1e')]||undefined;this[_0x256b('0x1f')]=_0x3b0c46[_0x256b('0x1f')]||undefined;this[_0x256b('0x20')]=_0x3b0c46['dialCutDigit']||undefined;this['TrunkBackup']=_0x3b0c46['TrunkBackup']?_0x3b0c46['TrunkBackup']:undefined;this[_0x256b('0x21')]=_0x3b0c46[_0x256b('0x21')]?_0x3b0c46['Trunk']:undefined;this['Interval']=_0x3b0c46[_0x256b('0x22')]?_0x3b0c46[_0x256b('0x22')]:undefined;this['SquareProject']=_0x3b0c46[_0x256b('0x23')]?_0x3b0c46['SquareProject']:undefined;this[_0x256b('0x24')]=_0x3b0c46[_0x256b('0x23')]?_0x3b0c46[_0x256b('0x23')][_0x256b('0x0')]:undefined;this[_0x256b('0x25')]=_0x3b0c46[_0x256b('0x25')]||![];this[_0x256b('0x26')]=_0x3b0c46[_0x256b('0x26')];this['dialAMDGreeting']=_0x3b0c46[_0x256b('0x27')];this[_0x256b('0x28')]=_0x3b0c46[_0x256b('0x28')];this[_0x256b('0x29')]=_0x3b0c46[_0x256b('0x29')];this[_0x256b('0x2a')]=_0x3b0c46[_0x256b('0x2a')];this[_0x256b('0x2b')]=_0x3b0c46[_0x256b('0x2b')];this[_0x256b('0x2c')]=_0x3b0c46[_0x256b('0x2c')];this[_0x256b('0x2d')]=_0x3b0c46[_0x256b('0x2d')];this['dialAMDMaximumWordLength']=_0x3b0c46['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x2aa0=['dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime'];(function(_0x7fed01,_0x14678d){var _0x5534c6=function(_0x5069e1){while(--_0x5069e1){_0x7fed01['push'](_0x7fed01['shift']());}};_0x5534c6(++_0x14678d);}(_0x2aa0,0x15d));var _0x02aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2aa0[_0x40a045];return _0x1a687c;};'use strict';function Campaign(_0x20c2f2){this['id']=_0x20c2f2['id']||0x0;this[_0x02aa('0x0')]=_0x20c2f2['name']||'';this[_0x02aa('0x1')]=_0x20c2f2['type']||_0x02aa('0x2');this[_0x02aa('0x3')]=0x0;this[_0x02aa('0x4')]=0x0;this[_0x02aa('0x5')]=0x0;this[_0x02aa('0x6')]=0x0;this[_0x02aa('0x7')]='';this[_0x02aa('0x8')]=!![];this[_0x02aa('0x9')]=_0x20c2f2[_0x02aa('0x9')];this[_0x02aa('0xa')]=_0x20c2f2['limitCalls'];this[_0x02aa('0xb')]=_0x20c2f2[_0x02aa('0xb')]||null;this[_0x02aa('0xc')]=_0x20c2f2[_0x02aa('0xc')]?_0x20c2f2[_0x02aa('0xc')]:null;this[_0x02aa('0xd')]=_0x20c2f2[_0x02aa('0xd')];this['dialOriginateCallerIdNumber']=_0x20c2f2['dialOriginateCallerIdNumber'];this[_0x02aa('0xe')]=_0x20c2f2[_0x02aa('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x20c2f2[_0x02aa('0xf')];this['dialCongestionRetryFrequency']=_0x20c2f2['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x20c2f2[_0x02aa('0x10')];this[_0x02aa('0x11')]=_0x20c2f2['dialBusyRetryFrequency'];this[_0x02aa('0x12')]=_0x20c2f2[_0x02aa('0x12')];this[_0x02aa('0x13')]=_0x20c2f2[_0x02aa('0x13')];this['dialGlobalMaxRetry']=_0x20c2f2[_0x02aa('0x14')];this[_0x02aa('0x15')]=_0x20c2f2[_0x02aa('0x15')]||0x3;this[_0x02aa('0x16')]=_0x20c2f2[_0x02aa('0x16')]||0x96;this['dialDropMaxRetry']=_0x20c2f2[_0x02aa('0x17')]||0x3;this[_0x02aa('0x18')]=_0x20c2f2[_0x02aa('0x18')]||0x96;this[_0x02aa('0x19')]=_0x20c2f2[_0x02aa('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x20c2f2[_0x02aa('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x20c2f2[_0x02aa('0x1b')]||0x3;this[_0x02aa('0x1c')]=_0x20c2f2['dialMachineRetryFrequency']||0x96;this[_0x02aa('0x1d')]=_0x20c2f2[_0x02aa('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x20c2f2['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x20c2f2['dialOrderByScheduledAt']||_0x02aa('0x1e');this['dialPrefix']=_0x20c2f2[_0x02aa('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x20c2f2[_0x02aa('0x20')]||undefined;this['dialCutDigit']=_0x20c2f2[_0x02aa('0x21')]||undefined;this[_0x02aa('0x22')]=_0x20c2f2[_0x02aa('0x22')]?_0x20c2f2[_0x02aa('0x22')]:undefined;this[_0x02aa('0x23')]=_0x20c2f2[_0x02aa('0x23')]?_0x20c2f2[_0x02aa('0x23')]:undefined;this[_0x02aa('0x24')]=_0x20c2f2[_0x02aa('0x24')]?_0x20c2f2[_0x02aa('0x24')]:undefined;this['SquareProject']=_0x20c2f2[_0x02aa('0x25')]?_0x20c2f2[_0x02aa('0x25')]:undefined;this['dialQueueProject']=_0x20c2f2[_0x02aa('0x25')]?_0x20c2f2[_0x02aa('0x25')]['name']:undefined;this[_0x02aa('0x26')]=_0x20c2f2['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x20c2f2[_0x02aa('0x27')];this[_0x02aa('0x28')]=_0x20c2f2['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x20c2f2[_0x02aa('0x29')];this[_0x02aa('0x2a')]=_0x20c2f2[_0x02aa('0x2a')];this[_0x02aa('0x2b')]=_0x20c2f2['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x20c2f2[_0x02aa('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x20c2f2[_0x02aa('0x2d')];this[_0x02aa('0x2e')]=_0x20c2f2[_0x02aa('0x2e')];this[_0x02aa('0x2f')]=_0x20c2f2[_0x02aa('0x2f')];}module[_0x02aa('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 2c4e429..b0dafaa 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 _0xa0a3=['abandoned','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitors','transfercalleridnum','mohtime','exports','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged'];(function(_0x25c988,_0xce8221){var _0x45fcc2=function(_0x47fba5){while(--_0x47fba5){_0x25c988['push'](_0x25c988['shift']());}};_0x45fcc2(++_0xce8221);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x2c78d1,_0x1492d6){_0x2c78d1=_0x2c78d1-0x0;var _0xaf726a=_0xa0a3[_0x2c78d1];return _0xaf726a;};'use strict';function Channel(){this['starttime']=null;this[_0x3a0a('0x0')]='';this[_0x3a0a('0x1')]='';this['calleridnum']=0x0;this[_0x3a0a('0x2')]='';this[_0x3a0a('0x3')]=undefined;this[_0x3a0a('0x4')]=undefined;this[_0x3a0a('0x5')]=0x0;this[_0x3a0a('0x6')]='';this[_0x3a0a('0x7')]=0x0;this[_0x3a0a('0x8')]=0x0;this[_0x3a0a('0x9')]=0x0;this[_0x3a0a('0xa')]=![];this[_0x3a0a('0xb')]=null;this[_0x3a0a('0xc')]=null;this[_0x3a0a('0xd')]=![];this[_0x3a0a('0xe')]=![];this['lastapplication']='';this['lastdata']='';this[_0x3a0a('0xf')]=0x0;this[_0x3a0a('0x10')]=0x0;this[_0x3a0a('0x11')]=0x0;this[_0x3a0a('0x12')]=null;this[_0x3a0a('0x13')]=null;this[_0x3a0a('0x14')]=null;this[_0x3a0a('0x15')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x3a0a('0x16')]=[];this[_0x3a0a('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x3a0a('0x18')]=0x0;}module[_0x3a0a('0x19')]=Channel; \ No newline at end of file +var _0xc17d=['monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','linkedid','answertime','unmanaged','abandoned','duration','billableseconds','holdtime','type','tag','disposition'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xc17d,0x96));var _0xdc17=function(_0x32071e,_0x4ca62f){_0x32071e=_0x32071e-0x0;var _0xeefd21=_0xc17d[_0x32071e];return _0xeefd21;};'use strict';function Channel(){this[_0xdc17('0x0')]=null;this[_0xdc17('0x1')]='';this[_0xdc17('0x2')]='';this[_0xdc17('0x3')]=0x0;this['calleridname']='';this[_0xdc17('0x4')]=undefined;this[_0xdc17('0x5')]=undefined;this[_0xdc17('0x6')]=0x0;this[_0xdc17('0x7')]='';this['uniqueid']=0x0;this[_0xdc17('0x8')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xdc17('0x9')]=null;this['endtime']=null;this[_0xdc17('0xa')]=![];this[_0xdc17('0xb')]=![];this['lastapplication']='';this['lastdata']='';this[_0xdc17('0xc')]=0x0;this[_0xdc17('0xd')]=0x0;this[_0xdc17('0xe')]=0x0;this[_0xdc17('0xf')]=null;this[_0xdc17('0x10')]=null;this[_0xdc17('0x11')]=null;this[_0xdc17('0x12')]=![];this[_0xdc17('0x13')]=null;this['queue']=null;this[_0xdc17('0x14')]=[];this[_0xdc17('0x15')]=undefined;this[_0xdc17('0x16')]=undefined;this['transferType']=undefined;this[_0xdc17('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 084a7a4..b91e22c 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 _0x321d=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x37a30e,_0x4655a8){var _0x2a903b=function(_0x2d0527){while(--_0x2d0527){_0x37a30e['push'](_0x37a30e['shift']());}};_0x2a903b(++_0x4655a8);}(_0x321d,0x1ba));var _0xd321=function(_0x228e2a,_0x343796){_0x228e2a=_0x228e2a-0x0;var _0x4440a4=_0x321d[_0x228e2a];return _0x4440a4;};'use strict';function DeskAccount(_0x5bc8ed){this['id']=_0x5bc8ed['id']||0x0;this[_0xd321('0x0')]=_0x5bc8ed[_0xd321('0x0')]||'';this['username']=_0x5bc8ed[_0xd321('0x1')]||'';this[_0xd321('0x2')]=_0x5bc8ed[_0xd321('0x2')]||'';this[_0xd321('0x3')]=_0x5bc8ed[_0xd321('0x3')]||'';this[_0xd321('0x4')]=_0x5bc8ed[_0xd321('0x4')]||'';this['consumerKey']=_0x5bc8ed[_0xd321('0x5')]||'';this[_0xd321('0x6')]=_0x5bc8ed[_0xd321('0x6')]||'';this[_0xd321('0x7')]=_0x5bc8ed[_0xd321('0x7')]||'';this[_0xd321('0x8')]=_0x5bc8ed[_0xd321('0x8')]||'';this[_0xd321('0x9')]=_0x5bc8ed[_0xd321('0x9')]||'';this['serverUrl']=_0x5bc8ed[_0xd321('0xa')]||'';this[_0xd321('0xb')]=_0x5bc8ed[_0xd321('0xb')]||{};}module[_0xd321('0xc')]=DeskAccount; \ No newline at end of file +var _0xa9e4=['consumerKey','consumerSecret','token','tokenSecret','serverUrl','remoteUri','authType','password'];(function(_0x20504c,_0x4b36ca){var _0x29323a=function(_0x34d255){while(--_0x34d255){_0x20504c['push'](_0x20504c['shift']());}};_0x29323a(++_0x4b36ca);}(_0xa9e4,0x17d));var _0x4a9e=function(_0x363b26,_0x807f9b){_0x363b26=_0x363b26-0x0;var _0x948dc4=_0xa9e4[_0x363b26];return _0x948dc4;};'use strict';function DeskAccount(_0x25e62a){this['id']=_0x25e62a['id']||0x0;this['name']=_0x25e62a['name']||'';this['username']=_0x25e62a['username']||'';this['remoteUri']=_0x25e62a[_0x4a9e('0x0')]||'';this[_0x4a9e('0x1')]=_0x25e62a[_0x4a9e('0x1')]||'';this[_0x4a9e('0x2')]=_0x25e62a[_0x4a9e('0x2')]||'';this[_0x4a9e('0x3')]=_0x25e62a['consumerKey']||'';this[_0x4a9e('0x4')]=_0x25e62a[_0x4a9e('0x4')]||'';this['token']=_0x25e62a[_0x4a9e('0x5')]||'';this[_0x4a9e('0x6')]=_0x25e62a['tokenSecret']||'';this['type']=_0x25e62a['type']||'';this[_0x4a9e('0x7')]=_0x25e62a[_0x4a9e('0x7')]||'';this['Configurations']=_0x25e62a['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index beff658..0b0069e 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 _0xd64b=['exports','name','username','password','remoteUri','clientSecret','serverUrl','Configurations'];(function(_0x3e1eb8,_0x22824f){var _0xcedef8=function(_0x544722){while(--_0x544722){_0x3e1eb8['push'](_0x3e1eb8['shift']());}};_0xcedef8(++_0x22824f);}(_0xd64b,0xc1));var _0xbd64=function(_0x3b45d7,_0xbc2848){_0x3b45d7=_0x3b45d7-0x0;var _0x4690e8=_0xd64b[_0x3b45d7];return _0x4690e8;};'use strict';function Dynamics365Account(_0x272488){this['id']=_0x272488['id']||0x0;this['name']=_0x272488[_0xbd64('0x0')]||'';this['username']=_0x272488[_0xbd64('0x1')]||'';this[_0xbd64('0x2')]=_0x272488[_0xbd64('0x2')]||'';this[_0xbd64('0x3')]=_0x272488[_0xbd64('0x3')]||'';this['tenantId']=_0x272488['tenantId']||'';this['clientId']=_0x272488['clientId']||'';this[_0xbd64('0x4')]=_0x272488[_0xbd64('0x4')]||{};this[_0xbd64('0x5')]=_0x272488[_0xbd64('0x5')]||'';this[_0xbd64('0x6')]=_0x272488[_0xbd64('0x6')]||{};}module[_0xbd64('0x7')]=Dynamics365Account; \ No newline at end of file +var _0x9c00=['serverUrl','Configurations','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x1c6efd,_0xb2f3cd){var _0x53a918=function(_0x14c19b){while(--_0x14c19b){_0x1c6efd['push'](_0x1c6efd['shift']());}};_0x53a918(++_0xb2f3cd);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4ed625,_0x384757){_0x4ed625=_0x4ed625-0x0;var _0x5b4bad=_0x9c00[_0x4ed625];return _0x5b4bad;};'use strict';function Dynamics365Account(_0x1aed38){this['id']=_0x1aed38['id']||0x0;this[_0x09c0('0x0')]=_0x1aed38['name']||'';this['username']=_0x1aed38[_0x09c0('0x1')]||'';this[_0x09c0('0x2')]=_0x1aed38['password']||'';this[_0x09c0('0x3')]=_0x1aed38[_0x09c0('0x3')]||'';this[_0x09c0('0x4')]=_0x1aed38[_0x09c0('0x4')]||'';this[_0x09c0('0x5')]=_0x1aed38['clientId']||'';this['clientSecret']=_0x1aed38[_0x09c0('0x6')]||{};this[_0x09c0('0x7')]=_0x1aed38[_0x09c0('0x7')]||'';this[_0x09c0('0x8')]=_0x1aed38[_0x09c0('0x8')]||{};}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 2358f7a..13c5c62 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 _0x88a3=['exports','name','description','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','key'];(function(_0x1b988d,_0x2f0750){var _0x4fda45=function(_0x569358){while(--_0x569358){_0x1b988d['push'](_0x1b988d['shift']());}};_0x4fda45(++_0x2f0750);}(_0x88a3,0x1e1));var _0x388a=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x88a3[_0x1b1a3b];return _0x385347;};'use strict';function FaxAccount(_0x23dfdc){this['id']=_0x23dfdc['id']||0x0;this[_0x388a('0x0')]=_0x23dfdc[_0x388a('0x0')]||'';this[_0x388a('0x1')]=_0x23dfdc[_0x388a('0x1')];this[_0x388a('0x2')]=_0x23dfdc[_0x388a('0x2')];this[_0x388a('0x3')]=_0x23dfdc[_0x388a('0x3')];this['localstationid']=_0x23dfdc['localstationid'];this[_0x388a('0x4')]=_0x23dfdc['minrate']||0x960;this['maxrate']=_0x23dfdc[_0x388a('0x5')]||0x3840;this[_0x388a('0x6')]=_0x23dfdc[_0x388a('0x6')]||'v17,v27,v29';this[_0x388a('0x7')]=_0x23dfdc[_0x388a('0x7')]||'no';this[_0x388a('0x8')]=_0x23dfdc[_0x388a('0x8')]||'no';this[_0x388a('0x9')]=_0x23dfdc[_0x388a('0x9')]||0x1388;this[_0x388a('0xa')]=_0x23dfdc[_0x388a('0xa')]||_0x388a('0xb');this[_0x388a('0xc')]=_0x23dfdc[_0x388a('0xc')]?_0x23dfdc[_0x388a('0xc')]:undefined;this['ListId']=_0x23dfdc['ListId'];this['key']=_0x23dfdc[_0x388a('0xd')];}module[_0x388a('0xe')]=FaxAccount; \ No newline at end of file +var _0x890e=['maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate'];(function(_0x4e971c,_0x3587a2){var _0x1d2fc7=function(_0x25ba34){while(--_0x25ba34){_0x4e971c['push'](_0x4e971c['shift']());}};_0x1d2fc7(++_0x3587a2);}(_0x890e,0x18a));var _0xe890=function(_0x29d8b0,_0x4247cf){_0x29d8b0=_0x29d8b0-0x0;var _0x1e2f37=_0x890e[_0x29d8b0];return _0x1e2f37;};'use strict';function FaxAccount(_0x15f572){this['id']=_0x15f572['id']||0x0;this[_0xe890('0x0')]=_0x15f572[_0xe890('0x0')]||'';this[_0xe890('0x1')]=_0x15f572[_0xe890('0x1')];this['ecm']=_0x15f572[_0xe890('0x2')];this['headerinfo']=_0x15f572[_0xe890('0x3')];this[_0xe890('0x4')]=_0x15f572[_0xe890('0x4')];this[_0xe890('0x5')]=_0x15f572['minrate']||0x960;this[_0xe890('0x6')]=_0x15f572[_0xe890('0x6')]||0x3840;this[_0xe890('0x7')]=_0x15f572[_0xe890('0x7')]||'v17,v27,v29';this[_0xe890('0x8')]=_0x15f572[_0xe890('0x8')]||'no';this[_0xe890('0x9')]=_0x15f572[_0xe890('0x9')]||'no';this['t38timeout']=_0x15f572[_0xe890('0xa')]||0x1388;this[_0xe890('0xb')]=_0x15f572[_0xe890('0xb')]||_0xe890('0xc');this[_0xe890('0xd')]=_0x15f572[_0xe890('0xd')]?_0x15f572['Trunk']:undefined;this[_0xe890('0xe')]=_0x15f572['ListId'];this[_0xe890('0xf')]=_0x15f572['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 4267537..fe7b680 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 _0x449b=['apiKey','remoteUri','exports','name','username'];(function(_0x2d4981,_0x45811e){var _0x43e476=function(_0x820772){while(--_0x820772){_0x2d4981['push'](_0x2d4981['shift']());}};_0x43e476(++_0x45811e);}(_0x449b,0x11b));var _0xb449=function(_0x4bce0c,_0xd26b02){_0x4bce0c=_0x4bce0c-0x0;var _0x18d356=_0x449b[_0x4bce0c];return _0x18d356;};'use strict';function FreshdeskAccount(_0x130bb5){this['id']=_0x130bb5['id']||0x0;this[_0xb449('0x0')]=_0x130bb5[_0xb449('0x0')]||'';this[_0xb449('0x1')]=_0x130bb5[_0xb449('0x1')]||'';this[_0xb449('0x2')]=_0x130bb5['token']||'';this['remoteUri']=_0x130bb5[_0xb449('0x3')]||'';this['serverUrl']=_0x130bb5['serverUrl']||'';this['Configurations']=_0x130bb5['Configurations']||{};}module[_0xb449('0x4')]=FreshdeskAccount; \ No newline at end of file +var _0x3a4a=['token','remoteUri','serverUrl','Configurations','exports','username','apiKey'];(function(_0x2845e9,_0x2be5bd){var _0x1f62d8=function(_0xad2be6){while(--_0xad2be6){_0x2845e9['push'](_0x2845e9['shift']());}};_0x1f62d8(++_0x2be5bd);}(_0x3a4a,0xf3));var _0xa3a4=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x3a4a[_0x2fff83];return _0xa2a722;};'use strict';function FreshdeskAccount(_0x37a49a){this['id']=_0x37a49a['id']||0x0;this['name']=_0x37a49a['name']||'';this[_0xa3a4('0x0')]=_0x37a49a[_0xa3a4('0x0')]||'';this[_0xa3a4('0x1')]=_0x37a49a[_0xa3a4('0x2')]||'';this[_0xa3a4('0x3')]=_0x37a49a[_0xa3a4('0x3')]||'';this[_0xa3a4('0x4')]=_0x37a49a['serverUrl']||'';this[_0xa3a4('0x5')]=_0x37a49a[_0xa3a4('0x5')]||{};}module[_0xa3a4('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 5700799..90a2395 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 _0x4813=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x4813,0x14e));var _0x3481=function(_0x472e92,_0x2207e1){_0x472e92=_0x472e92-0x0;var _0x395d3a=_0x4813[_0x472e92];return _0x395d3a;};'use strict';function FreshsalesAccount(_0x2f4f46){this['id']=_0x2f4f46['id']||0x0;this[_0x3481('0x0')]=_0x2f4f46[_0x3481('0x0')]||'';this[_0x3481('0x1')]=_0x2f4f46[_0x3481('0x1')]||'';this[_0x3481('0x2')]=_0x2f4f46[_0x3481('0x3')]||'';this['remoteUri']=_0x2f4f46[_0x3481('0x4')]||'';this[_0x3481('0x5')]=_0x2f4f46[_0x3481('0x5')]||'';this[_0x3481('0x6')]=_0x2f4f46[_0x3481('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x7c1f=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7c1f,0x194));var _0xf7c1=function(_0x506053,_0x56a1c5){_0x506053=_0x506053-0x0;var _0x3e8191=_0x7c1f[_0x506053];return _0x3e8191;};'use strict';function FreshsalesAccount(_0x4340c3){this['id']=_0x4340c3['id']||0x0;this[_0xf7c1('0x0')]=_0x4340c3[_0xf7c1('0x0')]||'';this[_0xf7c1('0x1')]=_0x4340c3[_0xf7c1('0x1')]||'';this['apiKey']=_0x4340c3[_0xf7c1('0x2')]||'';this[_0xf7c1('0x3')]=_0x4340c3[_0xf7c1('0x3')]||'';this['serverUrl']=_0x4340c3[_0xf7c1('0x4')]||'';this[_0xf7c1('0x5')]=_0x4340c3[_0xf7c1('0x5')]||{};}module[_0xf7c1('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 2730fad..24651e9 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 _0xe299=['inbound','calleridnum','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','context','exten','priority','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe299,0x16f));var _0x9e29=function(_0x546aa1,_0x2dcf86){_0x546aa1=_0x546aa1-0x0;var _0x5e3b7d=_0xe299[_0x546aa1];return _0x5e3b7d;};'use strict';function QueueReport(){this[_0x9e29('0x0')]=_0x9e29('0x1');this['uniqueid']='';this[_0x9e29('0x2')]='';this['calleridname']='';this[_0x9e29('0x3')]='';this[_0x9e29('0x4')]=null;this[_0x9e29('0x5')]=null;this[_0x9e29('0x6')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x9e29('0x7')]=![];this[_0x9e29('0x8')]=null;this[_0x9e29('0x9')]=![];this[_0x9e29('0xa')]=null;this['originalposition']=0x1;this[_0x9e29('0xb')]='';this[_0x9e29('0xc')]='';this[_0x9e29('0xd')]='';this['accountcode']='';this[_0x9e29('0xe')]='';this[_0x9e29('0xf')]='';this[_0x9e29('0x10')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x9e29('0x11')]='';this[_0x9e29('0x12')]=_0x9e29('0x13');this[_0x9e29('0x14')]=0x0;this[_0x9e29('0x15')]={};}module[_0x9e29('0x16')]=QueueReport; \ No newline at end of file +var _0x85e3=['queuecallerleaveAt','position','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt'];(function(_0x5b829a,_0x29e0ef){var _0x47d50f=function(_0x350499){while(--_0x350499){_0x5b829a['push'](_0x5b829a['shift']());}};_0x47d50f(++_0x29e0ef);}(_0x85e3,0xa1));var _0x385e=function(_0x511b9e,_0x4ea780){_0x511b9e=_0x511b9e-0x0;var _0x2f5c28=_0x85e3[_0x511b9e];return _0x2f5c28;};'use strict';function QueueReport(){this[_0x385e('0x0')]=_0x385e('0x1');this[_0x385e('0x2')]='';this[_0x385e('0x3')]='';this[_0x385e('0x4')]='';this[_0x385e('0x5')]='';this[_0x385e('0x6')]=null;this[_0x385e('0x7')]=null;this[_0x385e('0x8')]=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x385e('0x9')]=null;this[_0x385e('0xa')]=![];this[_0x385e('0xb')]=null;this[_0x385e('0xc')]=![];this[_0x385e('0xd')]=null;this[_0x385e('0xe')]=0x1;this[_0x385e('0xf')]='';this[_0x385e('0x10')]='';this[_0x385e('0x11')]='';this['accountcode']='';this[_0x385e('0x12')]='';this[_0x385e('0x13')]='';this[_0x385e('0x14')]='';this[_0x385e('0x15')]=0x0;this['assigned']=![];this[_0x385e('0x16')]='';this[_0x385e('0x17')]=_0x385e('0x18');this[_0x385e('0x19')]=0x0;this[_0x385e('0x1a')]={};}module[_0x385e('0x1b')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index efb1969..12f80d6 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 _0xaf55=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf55,0x1e0));var _0x5af5=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xaf55[_0x455c6c];return _0x488242;};'use strict';function SalesforceAccount(_0xa3107b){this['id']=_0xa3107b['id']||0x0;this[_0x5af5('0x0')]=_0xa3107b[_0x5af5('0x0')]||'';this[_0x5af5('0x1')]=_0xa3107b[_0x5af5('0x1')]||'';this[_0x5af5('0x2')]=_0xa3107b[_0x5af5('0x2')]||'';this[_0x5af5('0x3')]=_0xa3107b[_0x5af5('0x3')]||'';this[_0x5af5('0x4')]=_0xa3107b[_0x5af5('0x4')]||'';this[_0x5af5('0x5')]=_0xa3107b[_0x5af5('0x5')]||'';this[_0x5af5('0x6')]=_0xa3107b[_0x5af5('0x6')]||'';this[_0x5af5('0x7')]=_0xa3107b[_0x5af5('0x7')]||_0x5af5('0x8');this[_0x5af5('0x9')]=_0xa3107b[_0x5af5('0x9')]||'';this['Configurations']=_0xa3107b[_0x5af5('0xa')]||{};}module[_0x5af5('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xa925=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x2c51a6,_0x490fa2){var _0x1c6c97=function(_0x4766a9){while(--_0x4766a9){_0x2c51a6['push'](_0x2c51a6['shift']());}};_0x1c6c97(++_0x490fa2);}(_0xa925,0x90));var _0x5a92=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xa925[_0xe66cf2];return _0x2d84e7;};'use strict';function SalesforceAccount(_0x47c818){this['id']=_0x47c818['id']||0x0;this[_0x5a92('0x0')]=_0x47c818[_0x5a92('0x0')]||'';this[_0x5a92('0x1')]=_0x47c818[_0x5a92('0x1')]||'';this['remoteUri']=_0x47c818[_0x5a92('0x2')]||'';this[_0x5a92('0x3')]=_0x47c818['password']||'';this['clientId']=_0x47c818[_0x5a92('0x4')]||'';this[_0x5a92('0x5')]=_0x47c818[_0x5a92('0x5')]||'';this[_0x5a92('0x6')]=_0x47c818[_0x5a92('0x6')]||'';this[_0x5a92('0x7')]=_0x47c818[_0x5a92('0x7')]||_0x5a92('0x8');this[_0x5a92('0x9')]=_0x47c818[_0x5a92('0x9')]||'';this['Configurations']=_0x47c818['Configurations']||{};}module[_0x5a92('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 2539111..58a85a0 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 _0x4fd8=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x4fd8,0x17d));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x491a78){this['id']=_0x491a78['id']||0x0;this[_0x84fd('0x0')]=_0x491a78['name']||'';this[_0x84fd('0x1')]=_0x491a78['username']||'';this[_0x84fd('0x2')]=_0x491a78['password']||'';this[_0x84fd('0x3')]=_0x491a78[_0x84fd('0x3')]||'';this[_0x84fd('0x4')]=_0x491a78[_0x84fd('0x4')]||'';this[_0x84fd('0x5')]=_0x491a78[_0x84fd('0x5')]||{};}module[_0x84fd('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x5d01=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4a869d,_0x1ddf77){var _0xee914d=function(_0x3df9a6){while(--_0x3df9a6){_0x4a869d['push'](_0x4a869d['shift']());}};_0xee914d(++_0x1ddf77);}(_0x5d01,0x1bf));var _0x15d0=function(_0x29dd2d,_0x352553){_0x29dd2d=_0x29dd2d-0x0;var _0x2e7237=_0x5d01[_0x29dd2d];return _0x2e7237;};'use strict';function ServicenowAccount(_0x390752){this['id']=_0x390752['id']||0x0;this[_0x15d0('0x0')]=_0x390752['name']||'';this[_0x15d0('0x1')]=_0x390752['username']||'';this[_0x15d0('0x2')]=_0x390752[_0x15d0('0x2')]||'';this[_0x15d0('0x3')]=_0x390752[_0x15d0('0x3')]||'';this[_0x15d0('0x4')]=_0x390752['serverUrl']||'';this[_0x15d0('0x5')]=_0x390752['Configurations']||{};}module[_0x15d0('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 0dfaa3e..c4ef09d 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 _0xdd19=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x161f4c,_0x3819ac){var _0x4063fe=function(_0x89d65e){while(--_0x89d65e){_0x161f4c['push'](_0x161f4c['shift']());}};_0x4063fe(++_0x3819ac);}(_0xdd19,0x1a6));var _0x9dd1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdd19[_0x3b380d];return _0x54502b;};'use strict';function SugarcrmAccount(_0x56f184){this['id']=_0x56f184['id']||0x0;this[_0x9dd1('0x0')]=_0x56f184[_0x9dd1('0x0')]||'';this['username']=_0x56f184[_0x9dd1('0x1')]||'';this[_0x9dd1('0x2')]=_0x56f184[_0x9dd1('0x2')]||'';this['remoteUri']=_0x56f184[_0x9dd1('0x3')]||'';this[_0x9dd1('0x4')]=_0x56f184['serverUrl']||'';this['Configurations']=_0x56f184[_0x9dd1('0x5')]||{};}module[_0x9dd1('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x07c7=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x174017,_0x4547ce){var _0x4f23bb=function(_0x373f06){while(--_0x373f06){_0x174017['push'](_0x174017['shift']());}};_0x4f23bb(++_0x4547ce);}(_0x07c7,0x7c));var _0x707c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x07c7[_0x19e35c];return _0x3e1fe8;};'use strict';function SugarcrmAccount(_0x215709){this['id']=_0x215709['id']||0x0;this[_0x707c('0x0')]=_0x215709[_0x707c('0x0')]||'';this[_0x707c('0x1')]=_0x215709[_0x707c('0x1')]||'';this['password']=_0x215709[_0x707c('0x2')]||'';this[_0x707c('0x3')]=_0x215709[_0x707c('0x3')]||'';this[_0x707c('0x4')]=_0x215709[_0x707c('0x4')]||'';this['Configurations']=_0x215709[_0x707c('0x5')]||{};}module[_0x707c('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index b43b1c1..9a7240f 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 _0xd004=['name','accountcode','unknown','stateTime','exports'];(function(_0x40133b,_0x155db7){var _0x4c2d4a=function(_0x519253){while(--_0x519253){_0x40133b['push'](_0x40133b['shift']());}};_0x4c2d4a(++_0x155db7);}(_0xd004,0x181));var _0x4d00=function(_0x1dd907,_0x49e59f){_0x1dd907=_0x1dd907-0x0;var _0x33c1ef=_0xd004[_0x1dd907];return _0x33c1ef;};'use strict';function Telephone(_0xda25fe){this['id']=_0xda25fe['id']||0x0;this[_0x4d00('0x0')]=_0xda25fe[_0x4d00('0x0')]||'';this[_0x4d00('0x1')]=_0xda25fe['accountcode']||'';this['state']=_0x4d00('0x2');this[_0x4d00('0x3')]=0x0;this['status']='unknown';this['address']='';}module[_0x4d00('0x4')]=Telephone; \ No newline at end of file +var _0xcecc=['name','state','unknown','stateTime','status','exports'];(function(_0x34c4fa,_0x291b7e){var _0x161c68=function(_0x136d81){while(--_0x136d81){_0x34c4fa['push'](_0x34c4fa['shift']());}};_0x161c68(++_0x291b7e);}(_0xcecc,0x186));var _0xccec=function(_0x487f2a,_0x23e760){_0x487f2a=_0x487f2a-0x0;var _0x291a85=_0xcecc[_0x487f2a];return _0x291a85;};'use strict';function Telephone(_0x29e80a){this['id']=_0x29e80a['id']||0x0;this['name']=_0x29e80a[_0xccec('0x0')]||'';this['accountcode']=_0x29e80a['accountcode']||'';this[_0xccec('0x1')]=_0xccec('0x2');this[_0xccec('0x3')]=0x0;this[_0xccec('0x4')]='unknown';this['address']='';}module[_0xccec('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 43b0135..ac23729 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','html'];(function(_0x5bf27a,_0x339194){var _0x16a3b2=function(_0x2f83b9){while(--_0x2f83b9){_0x5bf27a['push'](_0x5bf27a['shift']());}};_0x16a3b2(++_0x339194);}(_0xb10b,0x12a));var _0xbb10=function(_0x4528cf,_0x3b1892){_0x4528cf=_0x4528cf-0x0;var _0x4bca53=_0xb10b[_0x4528cf];return _0x4bca53;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x145b48,_0x31b106){var _0x9b5b67=function(_0x255047){while(--_0x255047){_0x145b48['push'](_0x145b48['shift']());}};_0x9b5b67(++_0x31b106);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 860c3a9..ff4c61b 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x2953d8,_0xaf2277){var _0x3f865a=function(_0x40413c){while(--_0x40413c){_0x2953d8['push'](_0x2953d8['shift']());}};_0x3f865a(++_0xaf2277);}(_0xda2d,0x102));var _0xdda2=function(_0x13b93d,_0x424dcf){_0x13b93d=_0x13b93d-0x0;var _0x3aef3c=_0xda2d[_0x13b93d];return _0x3aef3c;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5e6276,_0x2e3967){var _0x2e91c7=function(_0x2b9fee){while(--_0x2b9fee){_0x5e6276['push'](_0x5e6276['shift']());}};_0x2e91c7(++_0x2e3967);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5b5ef1,_0x4a9389){_0x5b5ef1=_0x5b5ef1-0x0;var _0x1f623f=_0x9ffd[_0x5b5ef1];return _0x1f623f;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 5e163af..c272627 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 _0x96c0=['exports','stateTime','status','unknown','registry','indexOf','split','host','domain','domainport','stateRegistry','registrationtime','address','defaultuser'];(function(_0x138532,_0x34622b){var _0x654673=function(_0x3f171c){while(--_0x3f171c){_0x138532['push'](_0x138532['shift']());}};_0x654673(++_0x34622b);}(_0x96c0,0x1c1));var _0x096c=function(_0x48db07,_0x49b67b){_0x48db07=_0x48db07-0x0;var _0x1b041f=_0x96c0[_0x48db07];return _0x1b041f;};'use strict';function Trunk(_0x4dfdb5){this['id']=_0x4dfdb5['id']||0x0;this['active']=_0x4dfdb5['active']||![];this['name']=_0x4dfdb5['name']||'';this['state']='unknown';this[_0x096c('0x0')]=0x0;this[_0x096c('0x1')]=_0x096c('0x2');this[_0x096c('0x3')]=_0x4dfdb5['registry']&&_0x4dfdb5[_0x096c('0x3')][_0x096c('0x4')](':')?_0x4dfdb5[_0x096c('0x3')][_0x096c('0x5')](':')[0x0]:'';this[_0x096c('0x6')]='';this['port']='';this[_0x096c('0x7')]='';this[_0x096c('0x8')]='';this['refresh']='';this[_0x096c('0x9')]=_0x096c('0x2');this[_0x096c('0xa')]='';this[_0x096c('0xb')]='';this[_0x096c('0xc')]=_0x4dfdb5['defaultuser']||'';}module[_0x096c('0xd')]=Trunk; \ No newline at end of file +var _0xa757=['active','name','state','stateTime','status','unknown','registry','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x1e2733,_0x3175b0){var _0x41048d=function(_0x554fe3){while(--_0x554fe3){_0x1e2733['push'](_0x1e2733['shift']());}};_0x41048d(++_0x3175b0);}(_0xa757,0x1ef));var _0x7a75=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xa757[_0x6cf19c];return _0xce14f3;};'use strict';function Trunk(_0x2544ea){this['id']=_0x2544ea['id']||0x0;this[_0x7a75('0x0')]=_0x2544ea[_0x7a75('0x0')]||![];this[_0x7a75('0x1')]=_0x2544ea[_0x7a75('0x1')]||'';this[_0x7a75('0x2')]='unknown';this[_0x7a75('0x3')]=0x0;this[_0x7a75('0x4')]=_0x7a75('0x5');this['registry']=_0x2544ea['registry']&&_0x2544ea[_0x7a75('0x6')]['indexOf'](':')?_0x2544ea[_0x7a75('0x6')]['split'](':')[0x0]:'';this['host']='';this[_0x7a75('0x7')]='';this[_0x7a75('0x8')]='';this[_0x7a75('0x9')]='';this[_0x7a75('0xa')]='';this[_0x7a75('0xb')]=_0x7a75('0x5');this[_0x7a75('0xc')]='';this[_0x7a75('0xd')]='';this[_0x7a75('0xe')]=_0x2544ea[_0x7a75('0xe')]||'';}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 547ab61..1d42f1c 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 _0x74bd=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0x74bd,0x157));var _0xd74b=function(_0x2da230,_0x5a5dfc){_0x2da230=_0x2da230-0x0;var _0x3504a9=_0x74bd[_0x2da230];return _0x3504a9;};'use strict';function voiceExtension(_0x2e74e8){this['id']=_0x2e74e8['id']||0x0;this[_0xd74b('0x0')]=_0x2e74e8['exten']||'';this[_0xd74b('0x1')]=_0x2e74e8[_0xd74b('0x1')]||'none';this[_0xd74b('0x2')]=_0x2e74e8[_0xd74b('0x2')]||![];}module[_0xd74b('0x3')]=voiceExtension; \ No newline at end of file +var _0x28cd=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0xece529,_0xef79a8){var _0x20abcb=function(_0x45a83d){while(--_0x45a83d){_0xece529['push'](_0xece529['shift']());}};_0x20abcb(++_0xef79a8);}(_0x28cd,0x1a8));var _0xd28c=function(_0x5c854a,_0x36b72a){_0x5c854a=_0x5c854a-0x0;var _0x1d9fc2=_0x28cd[_0x5c854a];return _0x1d9fc2;};'use strict';function voiceExtension(_0x3326a1){this['id']=_0x3326a1['id']||0x0;this[_0xd28c('0x0')]=_0x3326a1[_0xd28c('0x0')]||'';this[_0xd28c('0x1')]=_0x3326a1[_0xd28c('0x1')]||_0xd28c('0x2');this[_0xd28c('0x3')]=_0x3326a1[_0xd28c('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 430c8e4..d57a8d1 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 _0x176a=['outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumHoldTime','sumBillable','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay'];(function(_0x4cda40,_0x56b16c){var _0x46090f=function(_0x4ce818){while(--_0x4ce818){_0x4cda40['push'](_0x4cda40['shift']());}};_0x46090f(++_0x56b16c);}(_0x176a,0x8a));var _0xa176=function(_0x5846ab,_0x1a803f){_0x5846ab=_0x5846ab-0x0;var _0xea0e07=_0x176a[_0x5846ab];return _0xea0e07;};'use strict';var statusDesc=[_0xa176('0x0'),'not_inuse','inuse','busy',_0xa176('0x1'),_0xa176('0x2'),'ringing',_0xa176('0x3'),_0xa176('0x4')];var monitorFormat={'wav':_0xa176('0x5'),'wav49':_0xa176('0x6'),'gsm':_0xa176('0x7')};var strategy={'rrmemory':_0xa176('0x8'),'roundrobin':_0xa176('0x9')};function VoiceQueue(_0x1826bd){this['id']=_0x1826bd['id']||0x0;this[_0xa176('0xa')]=_0x1826bd[_0xa176('0xa')]||'';this[_0xa176('0xb')]=_0x1826bd[_0xa176('0xb')]||'';this[_0xa176('0xc')]=_0x1826bd[_0xa176('0xc')]||'inbound';this[_0xa176('0xd')]=0x0;this[_0xa176('0xe')]=0x0;this[_0xa176('0xf')]=0x0;this[_0xa176('0x10')]=0x0;this['sumDuration']=0x0;this[_0xa176('0x11')]=0x0;this[_0xa176('0x12')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0xa176('0x13')]=0x0;this[_0xa176('0x14')]=0x0;this[_0xa176('0x15')]=_0x1826bd[_0xa176('0x15')]||![];this['acwTimeout']=_0x1826bd['acwTimeout']||0xa;this[_0xa176('0x16')]=_0x1826bd[_0xa176('0x16')]||'no';this[_0xa176('0x17')]=!![];this[_0xa176('0x18')]='';this['originated']=0x0;this['temp']=0x0;this[_0xa176('0x19')]=_0x1826bd[_0xa176('0x19')]||null;this[_0xa176('0x1a')]=_0x1826bd[_0xa176('0x1a')]?_0x1826bd['dialGlobalInterval']:null;this[_0xa176('0x1b')]=_0x1826bd['dialActive'];this[_0xa176('0x1c')]=_0x1826bd[_0xa176('0x1c')]||_0xa176('0x1d');this[_0xa176('0x1e')]=_0x1826bd[_0xa176('0x1e')]||0x0;this['dialLimitQueue']=_0x1826bd[_0xa176('0x1f')]||0x0;this['dialPowerLevel']=_0x1826bd['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x1826bd[_0xa176('0x20')]||_0xa176('0x21');this[_0xa176('0x22')]=_0x1826bd['dialPredictiveOptimizationPercentage']||0.03;this[_0xa176('0x23')]=_0x1826bd[_0xa176('0x23')]||0x258;this[_0xa176('0x24')]=_0x1826bd[_0xa176('0x24')]||'anonymous';this[_0xa176('0x25')]=_0x1826bd[_0xa176('0x25')]||_0xa176('0x26');this[_0xa176('0x27')]=_0x1826bd[_0xa176('0x27')]||0x1e;this['dialQueueOptions']=_0x1826bd['dialQueueOptions']||_0xa176('0x28');this['dialQueueTimeout']=_0x1826bd[_0xa176('0x29')]||0x3;this[_0xa176('0x2a')]=_0x1826bd['dialQueueProject']||undefined;this[_0xa176('0x2b')]=_0x1826bd[_0xa176('0x2b')]||0x3;this['dialCongestionRetryFrequency']=_0x1826bd['dialCongestionRetryFrequency']||0x96;this[_0xa176('0x2c')]=_0x1826bd[_0xa176('0x2c')]||0x3;this[_0xa176('0x2d')]=_0x1826bd['dialBusyRetryFrequency']||0x96;this[_0xa176('0x2e')]=_0x1826bd[_0xa176('0x2e')]||0x3;this[_0xa176('0x2f')]=_0x1826bd[_0xa176('0x2f')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1826bd[_0xa176('0x30')]||0x3;this[_0xa176('0x31')]=_0x1826bd[_0xa176('0x31')]||0x96;this[_0xa176('0x32')]=_0x1826bd['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x1826bd[_0xa176('0x33')]||0x96;this[_0xa176('0x34')]=_0x1826bd['dialAbandonedMaxRetry']||0x3;this[_0xa176('0x35')]=_0x1826bd[_0xa176('0x35')]||0x96;this[_0xa176('0x36')]=_0x1826bd[_0xa176('0x36')]||0x3;this['dialMachineRetryFrequency']=_0x1826bd[_0xa176('0x37')]||0x96;this['dialAgentRejectMaxRetry']=_0x1826bd['dialAgentRejectMaxRetry']||0x3;this[_0xa176('0x38')]=_0x1826bd[_0xa176('0x38')]||0x96;this[_0xa176('0x39')]=_0x1826bd['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x1826bd['Trunk']?_0x1826bd[_0xa176('0x3a')]:undefined;this['TrunkBackup']=_0x1826bd[_0xa176('0x3b')]?_0x1826bd[_0xa176('0x3b')]:undefined;this['dialPrefix']=_0x1826bd['dialPrefix']||undefined;this[_0xa176('0x3c')]=_0x1826bd['Interval']?_0x1826bd[_0xa176('0x3c')]:undefined;this[_0xa176('0x3d')]=_0x1826bd['dialOrderByScheduledAt']||_0xa176('0x3e');this[_0xa176('0x3f')]=_0x1826bd['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1826bd['dialCutDigit']||undefined;this[_0xa176('0x40')]=strategy[_0x1826bd[_0xa176('0x40')]]||_0xa176('0x8');this[_0xa176('0x41')]=!![];this[_0xa176('0x42')]=_0x1826bd[_0xa176('0x42')]||![];this[_0xa176('0x43')]=_0x1826bd[_0xa176('0x43')];this[_0xa176('0x44')]=_0x1826bd['dialAMDGreeting'];this[_0xa176('0x45')]=_0x1826bd['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x1826bd[_0xa176('0x46')];this[_0xa176('0x47')]=_0x1826bd['dialAMDMinWordLength'];this[_0xa176('0x48')]=_0x1826bd[_0xa176('0x48')];this[_0xa176('0x49')]=_0x1826bd[_0xa176('0x49')];this[_0xa176('0x4a')]=_0x1826bd[_0xa176('0x4a')];this[_0xa176('0x4b')]=_0x1826bd[_0xa176('0x4b')];this[_0xa176('0x4c')]=0x0;this[_0xa176('0x4d')]=0x0;this[_0xa176('0x4e')]=_0x1826bd[_0xa176('0x4e')];this[_0xa176('0x4f')]=0x0;this[_0xa176('0x50')]=0x0;this[_0xa176('0x51')]=0x0;this[_0xa176('0x52')]=0x0;this[_0xa176('0x53')]=0x0;this[_0xa176('0x54')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xa176('0x55')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xa176('0x56')]=0x0;this[_0xa176('0x57')]=0x0;this[_0xa176('0x58')]=0x0;this['startProgressive']=undefined;this[_0xa176('0x59')]=undefined;this[_0xa176('0x5a')]=undefined;this[_0xa176('0x5b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xa176('0x5c')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xa176('0x5d')]=0x0;this[_0xa176('0x5e')]=0x0;this[_0xa176('0x5f')]=_0x1826bd[_0xa176('0x60')]||0x14;this[_0xa176('0x61')]=_0x1826bd[_0xa176('0x60')]||0xa;this[_0xa176('0x62')]=0x0;this[_0xa176('0x63')]=0x0;this[_0xa176('0x64')]=0x1;this[_0xa176('0x65')]=0x0;this[_0xa176('0x66')]=0x0;this[_0xa176('0x67')]=0x0;this[_0xa176('0x68')]=0x0;this['dialRecallMeTimeout']=_0x1826bd[_0xa176('0x69')]||0x1e;this[_0xa176('0x6a')]=_0x1826bd[_0xa176('0x6a')]||![];this['dialQueueProject2']=_0x1826bd['dialQueueProject2']||undefined;this[_0xa176('0x6b')]=_0x1826bd['dialAgiAfterHangupClient']||![];this[_0xa176('0x6c')]=_0x1826bd[_0xa176('0x6c')]||![];this[_0xa176('0xb')]=monitorFormat[_0x1826bd['monitor_format']]?monitorFormat[_0x1826bd['monitor_format']]:undefined;this['mandatoryDisposition']=_0x1826bd[_0xa176('0x6d')]||![];this[_0xa176('0x6e')]=_0x1826bd[_0xa176('0x6e')]?_0x1826bd[_0xa176('0x6e')]:undefined;}module[_0xa176('0x6f')]=VoiceQueue; \ No newline at end of file +var _0x2687=['dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringinuse','onhold','wav','rrmemory','name','monitor_format','type','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x522448,_0x32839c){var _0x12b627=function(_0x42edf6){while(--_0x42edf6){_0x522448['push'](_0x522448['shift']());}};_0x12b627(++_0x32839c);}(_0x2687,0x143));var _0x7268=function(_0x34c403,_0x341b70){_0x34c403=_0x34c403-0x0;var _0x5bf2b9=_0x2687[_0x34c403];return _0x5bf2b9;};'use strict';var statusDesc=[_0x7268('0x0'),_0x7268('0x1'),_0x7268('0x2'),_0x7268('0x3'),_0x7268('0x4'),'unavailable','ringing',_0x7268('0x5'),_0x7268('0x6')];var monitorFormat={'wav':_0x7268('0x7'),'wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x7268('0x8'),'roundrobin':'roundrobin'};function VoiceQueue(_0x2e8097){this['id']=_0x2e8097['id']||0x0;this['name']=_0x2e8097[_0x7268('0x9')]||'';this[_0x7268('0xa')]=_0x2e8097[_0x7268('0xa')]||'';this[_0x7268('0xb')]=_0x2e8097['type']||'inbound';this[_0x7268('0xc')]=0x0;this[_0x7268('0xd')]=0x0;this[_0x7268('0xe')]=0x0;this['answered']=0x0;this[_0x7268('0xf')]=0x0;this[_0x7268('0x10')]=0x0;this[_0x7268('0x11')]=0x0;this[_0x7268('0x12')]=0x0;this[_0x7268('0x13')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x7268('0x14')]=_0x2e8097['acw']||![];this[_0x7268('0x15')]=_0x2e8097['acwTimeout']||0xa;this[_0x7268('0x16')]=_0x2e8097['autopause']||'no';this[_0x7268('0x17')]=!![];this['message']='';this[_0x7268('0x18')]=0x0;this[_0x7268('0x19')]=0x0;this[_0x7268('0x1a')]=_0x2e8097[_0x7268('0x1a')]||null;this[_0x7268('0x1b')]=_0x2e8097['dialGlobalInterval']?_0x2e8097[_0x7268('0x1b')]:null;this[_0x7268('0x1c')]=_0x2e8097[_0x7268('0x1c')];this[_0x7268('0x1d')]=_0x2e8097[_0x7268('0x1d')]||_0x7268('0x1e');this['dialLimitChannel']=_0x2e8097[_0x7268('0x1f')]||0x0;this['dialLimitQueue']=_0x2e8097[_0x7268('0x20')]||0x0;this['dialPowerLevel']=_0x2e8097[_0x7268('0x21')]||0x1;this['dialPredictiveOptimization']=_0x2e8097['dialPredictiveOptimization']||_0x7268('0x22');this[_0x7268('0x23')]=_0x2e8097['dialPredictiveOptimizationPercentage']||0.03;this[_0x7268('0x24')]=_0x2e8097[_0x7268('0x24')]||0x258;this[_0x7268('0x25')]=_0x2e8097[_0x7268('0x25')]||_0x7268('0x26');this[_0x7268('0x27')]=_0x2e8097[_0x7268('0x27')]||_0x7268('0x26');this[_0x7268('0x28')]=_0x2e8097[_0x7268('0x28')]||0x1e;this[_0x7268('0x29')]=_0x2e8097[_0x7268('0x29')]||_0x7268('0x2a');this[_0x7268('0x2b')]=_0x2e8097['dialQueueTimeout']||0x3;this[_0x7268('0x2c')]=_0x2e8097[_0x7268('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x2e8097[_0x7268('0x2d')]||0x3;this[_0x7268('0x2e')]=_0x2e8097[_0x7268('0x2e')]||0x96;this[_0x7268('0x2f')]=_0x2e8097[_0x7268('0x2f')]||0x3;this[_0x7268('0x30')]=_0x2e8097[_0x7268('0x30')]||0x96;this[_0x7268('0x31')]=_0x2e8097[_0x7268('0x31')]||0x3;this[_0x7268('0x32')]=_0x2e8097['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x2e8097[_0x7268('0x33')]||0x3;this[_0x7268('0x34')]=_0x2e8097[_0x7268('0x34')]||0x96;this[_0x7268('0x35')]=_0x2e8097['dialDropMaxRetry']||0x3;this[_0x7268('0x36')]=_0x2e8097[_0x7268('0x36')]||0x96;this['dialAbandonedMaxRetry']=_0x2e8097['dialAbandonedMaxRetry']||0x3;this[_0x7268('0x37')]=_0x2e8097[_0x7268('0x37')]||0x96;this[_0x7268('0x38')]=_0x2e8097[_0x7268('0x38')]||0x3;this[_0x7268('0x39')]=_0x2e8097['dialMachineRetryFrequency']||0x96;this[_0x7268('0x3a')]=_0x2e8097[_0x7268('0x3a')]||0x3;this[_0x7268('0x3b')]=_0x2e8097[_0x7268('0x3b')]||0x96;this[_0x7268('0x3c')]=_0x2e8097['dialGlobalMaxRetry']||0x4;this[_0x7268('0x3d')]=_0x2e8097[_0x7268('0x3d')]?_0x2e8097['Trunk']:undefined;this['TrunkBackup']=_0x2e8097[_0x7268('0x3e')]?_0x2e8097[_0x7268('0x3e')]:undefined;this['dialPrefix']=_0x2e8097[_0x7268('0x3f')]||undefined;this[_0x7268('0x40')]=_0x2e8097['Interval']?_0x2e8097[_0x7268('0x40')]:undefined;this[_0x7268('0x41')]=_0x2e8097['dialOrderByScheduledAt']||_0x7268('0x42');this['dialRandomLastDigitCallerIdNumber']=_0x2e8097[_0x7268('0x43')]||undefined;this[_0x7268('0x44')]=_0x2e8097[_0x7268('0x44')]||undefined;this[_0x7268('0x45')]=strategy[_0x2e8097[_0x7268('0x45')]]||_0x7268('0x8');this[_0x7268('0x46')]=!![];this[_0x7268('0x47')]=_0x2e8097[_0x7268('0x47')]||![];this[_0x7268('0x48')]=_0x2e8097[_0x7268('0x48')];this[_0x7268('0x49')]=_0x2e8097[_0x7268('0x49')];this[_0x7268('0x4a')]=_0x2e8097[_0x7268('0x4a')];this[_0x7268('0x4b')]=_0x2e8097['dialAMDTotalAnalysisTime'];this[_0x7268('0x4c')]=_0x2e8097[_0x7268('0x4c')];this[_0x7268('0x4d')]=_0x2e8097[_0x7268('0x4d')];this[_0x7268('0x4e')]=_0x2e8097[_0x7268('0x4e')];this[_0x7268('0x4f')]=_0x2e8097[_0x7268('0x4f')];this['dialAMDMaximumWordLength']=_0x2e8097[_0x7268('0x50')];this[_0x7268('0x51')]=0x0;this[_0x7268('0x52')]=0x0;this[_0x7268('0x53')]=_0x2e8097[_0x7268('0x53')];this[_0x7268('0x54')]=0x0;this[_0x7268('0x55')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x7268('0x56')]=0x0;this[_0x7268('0x57')]=0x0;this[_0x7268('0x58')]=0x0;this[_0x7268('0x59')]=0x0;this[_0x7268('0x5a')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x7268('0x5b')]=0x0;this[_0x7268('0x5c')]=0x0;this[_0x7268('0x5d')]=0x0;this[_0x7268('0x5e')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0x7268('0x5f')]=undefined;this[_0x7268('0x60')]=undefined;this[_0x7268('0x61')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x7268('0x62')]=0x0;this[_0x7268('0x63')]=0x0;this[_0x7268('0x64')]=0x0;this[_0x7268('0x65')]=0x0;this[_0x7268('0x66')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x7268('0x67')]=0x0;this[_0x7268('0x68')]=_0x2e8097['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x7268('0x69')]=_0x2e8097['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x7268('0x6a')]=0x0;this[_0x7268('0x6b')]=0x0;this[_0x7268('0x6c')]=0x1;this[_0x7268('0x6d')]=0x0;this[_0x7268('0x6e')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x7268('0x6f')]=0x0;this[_0x7268('0x70')]=_0x2e8097[_0x7268('0x70')]||0x1e;this[_0x7268('0x71')]=_0x2e8097[_0x7268('0x71')]||![];this[_0x7268('0x72')]=_0x2e8097[_0x7268('0x72')]||undefined;this[_0x7268('0x73')]=_0x2e8097[_0x7268('0x73')]||![];this[_0x7268('0x74')]=_0x2e8097[_0x7268('0x74')]||![];this[_0x7268('0xa')]=monitorFormat[_0x2e8097[_0x7268('0xa')]]?monitorFormat[_0x2e8097['monitor_format']]:undefined;this[_0x7268('0x75')]=_0x2e8097[_0x7268('0x75')]||![];this[_0x7268('0x76')]=_0x2e8097[_0x7268('0x76')]?_0x2e8097[_0x7268('0x76')]:undefined;}module[_0x7268('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index b3cfaa6..942787a 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 _0xfcc5=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3e9505,_0x17419e){var _0x49cd1b=function(_0xe2a5b5){while(--_0xe2a5b5){_0x3e9505['push'](_0x3e9505['shift']());}};_0x49cd1b(++_0x17419e);}(_0xfcc5,0x1eb));var _0x5fcc=function(_0x4d7937,_0x63dd72){_0x4d7937=_0x4d7937-0x0;var _0x3e22dc=_0xfcc5[_0x4d7937];return _0x3e22dc;};'use strict';function VtigerAccount(_0x405347){this['id']=_0x405347['id']||0x0;this['name']=_0x405347[_0x5fcc('0x0')]||'';this[_0x5fcc('0x1')]=_0x405347['username']||'';this[_0x5fcc('0x2')]=_0x405347[_0x5fcc('0x2')]||'';this[_0x5fcc('0x3')]=_0x405347[_0x5fcc('0x3')]||'';this[_0x5fcc('0x4')]=_0x405347['serverUrl']||'';this['Configurations']=_0x405347[_0x5fcc('0x5')]||{};}module[_0x5fcc('0x6')]=VtigerAccount; \ No newline at end of file +var _0x0cc9=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3581a6,_0x1969e2){var _0x1d2ed7=function(_0x4b6274){while(--_0x4b6274){_0x3581a6['push'](_0x3581a6['shift']());}};_0x1d2ed7(++_0x1969e2);}(_0x0cc9,0x120));var _0x90cc=function(_0x23eb8c,_0x5618e8){_0x23eb8c=_0x23eb8c-0x0;var _0x4978ba=_0x0cc9[_0x23eb8c];return _0x4978ba;};'use strict';function VtigerAccount(_0x56574e){this['id']=_0x56574e['id']||0x0;this[_0x90cc('0x0')]=_0x56574e[_0x90cc('0x0')]||'';this[_0x90cc('0x1')]=_0x56574e[_0x90cc('0x1')]||'';this[_0x90cc('0x2')]=_0x56574e['accessKey']||'';this[_0x90cc('0x3')]=_0x56574e[_0x90cc('0x3')]||'';this[_0x90cc('0x4')]=_0x56574e[_0x90cc('0x4')]||'';this[_0x90cc('0x5')]=_0x56574e[_0x90cc('0x5')]||{};}module[_0x90cc('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 2293533..c399c6d 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 _0x5d44=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5d44,0xc5));var _0x45d4=function(_0x94068a,_0x8a158){_0x94068a=_0x94068a-0x0;var _0x23e121=_0x5d44[_0x94068a];return _0x23e121;};'use strict';function ZendeskAccount(_0x5a2e13){this['id']=_0x5a2e13['id']||0x0;this[_0x45d4('0x0')]=_0x5a2e13[_0x45d4('0x0')]||'';this[_0x45d4('0x1')]=_0x5a2e13[_0x45d4('0x1')]||'';this['password']=_0x5a2e13[_0x45d4('0x2')]||'';this[_0x45d4('0x3')]=_0x5a2e13[_0x45d4('0x3')]||'';this['remoteUri']=_0x5a2e13[_0x45d4('0x4')]||'';this[_0x45d4('0x5')]=_0x5a2e13[_0x45d4('0x5')]||'';this['type']=_0x5a2e13[_0x45d4('0x6')]||_0x45d4('0x7');this[_0x45d4('0x8')]=_0x5a2e13['serverUrl']||'';this['Configurations']=_0x5a2e13[_0x45d4('0x9')]||{};}module[_0x45d4('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xdebe=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password','token'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0xdebe,0x16e));var _0xedeb=function(_0x1e027d,_0x50fed7){_0x1e027d=_0x1e027d-0x0;var _0x15d541=_0xdebe[_0x1e027d];return _0x15d541;};'use strict';function ZendeskAccount(_0x4e4c2f){this['id']=_0x4e4c2f['id']||0x0;this[_0xedeb('0x0')]=_0x4e4c2f['name']||'';this[_0xedeb('0x1')]=_0x4e4c2f[_0xedeb('0x1')]||'';this['password']=_0x4e4c2f[_0xedeb('0x2')]||'';this[_0xedeb('0x3')]=_0x4e4c2f[_0xedeb('0x3')]||'';this[_0xedeb('0x4')]=_0x4e4c2f[_0xedeb('0x4')]||'';this[_0xedeb('0x5')]=_0x4e4c2f[_0xedeb('0x5')]||'';this[_0xedeb('0x6')]=_0x4e4c2f[_0xedeb('0x6')]||_0xedeb('0x7');this[_0xedeb('0x8')]=_0x4e4c2f[_0xedeb('0x8')]||'';this[_0xedeb('0x9')]=_0x4e4c2f['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 62aa713..cf02199 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 _0x7f62=['clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7f62,0x1bd));var _0x27f6=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x7f62[_0x2160a9];return _0xa88cf7;};'use strict';function ZohoAccount(_0x3afb7c){this['id']=_0x3afb7c['id']||0x0;this[_0x27f6('0x0')]=_0x3afb7c[_0x27f6('0x0')]||'';this[_0x27f6('0x1')]=_0x3afb7c[_0x27f6('0x1')]||'';this[_0x27f6('0x2')]=_0x3afb7c[_0x27f6('0x2')]||'';this[_0x27f6('0x3')]=_0x3afb7c[_0x27f6('0x3')]||'';this[_0x27f6('0x4')]=_0x3afb7c['clientId']||'';this[_0x27f6('0x5')]=_0x3afb7c[_0x27f6('0x5')]||'';this[_0x27f6('0x6')]=_0x3afb7c['serverUrl']||'';this['code']=_0x3afb7c[_0x27f6('0x7')]||'';this[_0x27f6('0x8')]=_0x3afb7c['refreshToken']||'';this['Configurations']=_0x3afb7c[_0x27f6('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xbd09=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x6593da,_0x3e9ac9){var _0x5c75dd=function(_0x1578a9){while(--_0x1578a9){_0x6593da['push'](_0x6593da['shift']());}};_0x5c75dd(++_0x3e9ac9);}(_0xbd09,0xd5));var _0x9bd0=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xbd09[_0x5c351c];return _0x26f3b3;};'use strict';function ZohoAccount(_0x2d5694){this['id']=_0x2d5694['id']||0x0;this['name']=_0x2d5694[_0x9bd0('0x0')]||'';this['description']=_0x2d5694[_0x9bd0('0x1')]||'';this[_0x9bd0('0x2')]=_0x2d5694['host']||'';this[_0x9bd0('0x3')]=_0x2d5694[_0x9bd0('0x3')]||'';this[_0x9bd0('0x4')]=_0x2d5694[_0x9bd0('0x4')]||'';this[_0x9bd0('0x5')]=_0x2d5694[_0x9bd0('0x5')]||'';this[_0x9bd0('0x6')]=_0x2d5694[_0x9bd0('0x6')]||'';this[_0x9bd0('0x7')]=_0x2d5694[_0x9bd0('0x7')]||'';this['refreshToken']=_0x2d5694[_0x9bd0('0x8')]||'';this[_0x9bd0('0x9')]=_0x2d5694[_0x9bd0('0x9')]||{};}module[_0x9bd0('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index a964081..d8f3c00 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 _0x0521=['membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','dialAnswer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0521,0x1e4));var _0x1052=function(_0x413c76,_0x11aee8){_0x413c76=_0x413c76-0x0;var _0x3ecb95=_0x0521[_0x413c76];return _0x3ecb95;};'use strict';var util=require(_0x1052('0x0'));var _=require(_0x1052('0x1'));var moment=require(_0x1052('0x2'));function checkNameSurname(_0xf042ed,_0x5f3cba,_0x418be6){var _0x3b75b0='';if(!_[_0x1052('0x3')](_0x5f3cba)&&_0x1052('0x4')===typeof _0x5f3cba){_0x3b75b0+=_0x5f3cba;}if(!_[_0x1052('0x3')](_0x418be6)&&_0x1052('0x4')===typeof _0x418be6){_0x3b75b0+='\x20'+_0x418be6;}if(_0x3b75b0!==''){return _0x3b75b0;}return _0xf042ed;}function Action(_0x4786ea,_0x245340,_0x57d7dd,_0x3a4200,_0x57a74c){this[_0x1052('0x5')]=_0x57d7dd||undefined;this[_0x1052('0x6')]=_0x4786ea['id'];this['queue']=_0x245340[_0x1052('0x7')];this[_0x1052('0x8')]=_0x245340[_0x1052('0x8')];this[_0x1052('0x9')]='queue';this[_0x1052('0xa')]=![];this[_0x1052('0xb')]=_[_0x1052('0x3')](_0x4786ea['Agent'])?undefined:_0x4786ea[_0x1052('0xc')]['name'];this[_0x1052('0xd')]=this[_0x1052('0xb')]?util[_0x1052('0xe')]('SIP/%s',this[_0x1052('0xb')]):_0x3a4200||undefined;this[_0x1052('0xf')]=checkNameSurname(_0x4786ea[_0x1052('0x10')][_0x1052('0x11')],_0x4786ea[_0x1052('0x10')][_0x1052('0x12')],_0x4786ea['Contact'][_0x1052('0x13')]);this['active']=_0x4786ea[_0x1052('0x14')]||![];this[_0x1052('0x15')]=_0x4786ea[_0x1052('0x10')][_0x1052('0x11')];this['scheduledat']=_0x4786ea[_0x1052('0x16')];this[_0x1052('0x17')]=_0x4786ea['countbusyretry']||0x0;this[_0x1052('0x18')]=_0x4786ea['countcongestionretry']||0x0;this['countnoanswerretry']=_0x4786ea[_0x1052('0x19')]||0x0;this[_0x1052('0x1a')]=(_0x4786ea[_0x1052('0x17')]||0x0)+(_0x4786ea[_0x1052('0x18')]||0x0)+(_0x4786ea[_0x1052('0x19')]||0x0)+(_0x4786ea[_0x1052('0x1b')]||0x0)+(_0x4786ea[_0x1052('0x1c')]||0x0)+(_0x4786ea[_0x1052('0x1d')]||0x0)+(_0x4786ea[_0x1052('0x1e')]||0x0)+(_0x4786ea[_0x1052('0x1f')]||0x0);this[_0x1052('0x1b')]=_0x4786ea[_0x1052('0x1b')]||0x0;this[_0x1052('0x1c')]=_0x4786ea[_0x1052('0x1c')]||0x0;this[_0x1052('0x1d')]=_0x4786ea[_0x1052('0x1d')]||0x0;this['countmachineretry']=_0x4786ea['countmachineretry']||0x0;this[_0x1052('0x1f')]=_0x4786ea[_0x1052('0x1f')]||0x0;this[_0x1052('0x20')]=_0x4786ea[_0x1052('0x20')];this[_0x1052('0x21')]=_0x4786ea[_0x1052('0x21')];this[_0x1052('0x22')]=_0x4786ea['callbackat'];this[_0x1052('0x23')]=_0x4786ea[_0x1052('0x23')];this['ContactId']=_0x4786ea['ContactId'];this[_0x1052('0x24')]=_0x4786ea['ListId'];this['UserId']=_[_0x1052('0x3')](_0x4786ea[_0x1052('0xc')])?_0x4786ea[_0x1052('0x25')]:_0x4786ea[_0x1052('0xc')]['id'];this[_0x1052('0x26')]=_0x4786ea['VoiceQueueId'];this[_0x1052('0x27')]='';this['originatecalleridname']='';}Action[_0x1052('0x28')][_0x1052('0x29')]=function(){return util[_0x1052('0xe')](_0x1052('0x2a'),this[_0x1052('0xf')],this[_0x1052('0x2b')]);};module[_0x1052('0x2c')]=Action; \ No newline at end of file +var _0xf1f0=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat'];(function(_0xe8b53f,_0x41624a){var _0x510c74=function(_0x26a232){while(--_0x26a232){_0xe8b53f['push'](_0xe8b53f['shift']());}};_0x510c74(++_0x41624a);}(_0xf1f0,0x143));var _0x0f1f=function(_0x1b2252,_0x5ca212){_0x1b2252=_0x1b2252-0x0;var _0xd30666=_0xf1f0[_0x1b2252];return _0xd30666;};'use strict';var util=require('util');var _=require(_0x0f1f('0x0'));var moment=require(_0x0f1f('0x1'));function checkNameSurname(_0x13810f,_0x2d0c3b,_0x4e7d17){var _0x5bf61d='';if(!_[_0x0f1f('0x2')](_0x2d0c3b)&&_0x0f1f('0x3')===typeof _0x2d0c3b){_0x5bf61d+=_0x2d0c3b;}if(!_['isNil'](_0x4e7d17)&&_0x0f1f('0x3')===typeof _0x4e7d17){_0x5bf61d+='\x20'+_0x4e7d17;}if(_0x5bf61d!==''){return _0x5bf61d;}return _0x13810f;}function Action(_0x3b3856,_0x480ff8,_0x52eb3e,_0xbbe89f,_0x35082e){this['uniqueid']=_0x52eb3e||undefined;this[_0x0f1f('0x4')]=_0x3b3856['id'];this[_0x0f1f('0x5')]=_0x480ff8[_0x0f1f('0x6')];this[_0x0f1f('0x7')]=_0x480ff8[_0x0f1f('0x7')];this[_0x0f1f('0x8')]=_0x0f1f('0x5');this[_0x0f1f('0x9')]=![];this['membername']=_[_0x0f1f('0x2')](_0x3b3856[_0x0f1f('0xa')])?undefined:_0x3b3856['Agent'][_0x0f1f('0x6')];this[_0x0f1f('0xb')]=this[_0x0f1f('0xc')]?util[_0x0f1f('0xd')]('SIP/%s',this[_0x0f1f('0xc')]):_0xbbe89f||undefined;this[_0x0f1f('0xe')]=checkNameSurname(_0x3b3856[_0x0f1f('0xf')][_0x0f1f('0x10')],_0x3b3856[_0x0f1f('0xf')][_0x0f1f('0x11')],_0x3b3856[_0x0f1f('0xf')]['lastName']);this[_0x0f1f('0x12')]=_0x3b3856[_0x0f1f('0x12')]||![];this[_0x0f1f('0x13')]=_0x3b3856['Contact'][_0x0f1f('0x10')];this[_0x0f1f('0x14')]=_0x3b3856[_0x0f1f('0x14')];this[_0x0f1f('0x15')]=_0x3b3856[_0x0f1f('0x15')]||0x0;this[_0x0f1f('0x16')]=_0x3b3856['countcongestionretry']||0x0;this[_0x0f1f('0x17')]=_0x3b3856['countnoanswerretry']||0x0;this[_0x0f1f('0x18')]=(_0x3b3856[_0x0f1f('0x15')]||0x0)+(_0x3b3856[_0x0f1f('0x16')]||0x0)+(_0x3b3856[_0x0f1f('0x17')]||0x0)+(_0x3b3856['countnosuchnumberretry']||0x0)+(_0x3b3856[_0x0f1f('0x19')]||0x0)+(_0x3b3856[_0x0f1f('0x1a')]||0x0)+(_0x3b3856[_0x0f1f('0x1b')]||0x0)+(_0x3b3856[_0x0f1f('0x1c')]||0x0);this[_0x0f1f('0x1d')]=_0x3b3856[_0x0f1f('0x1d')]||0x0;this[_0x0f1f('0x19')]=_0x3b3856[_0x0f1f('0x19')]||0x0;this[_0x0f1f('0x1a')]=_0x3b3856[_0x0f1f('0x1a')]||0x0;this['countmachineretry']=_0x3b3856[_0x0f1f('0x1b')]||0x0;this[_0x0f1f('0x1c')]=_0x3b3856[_0x0f1f('0x1c')]||0x0;this[_0x0f1f('0x1e')]=_0x3b3856['callback'];this[_0x0f1f('0x1f')]=_0x3b3856['callbackuniqueid'];this[_0x0f1f('0x20')]=_0x3b3856[_0x0f1f('0x20')];this[_0x0f1f('0x21')]=_0x3b3856[_0x0f1f('0x21')];this[_0x0f1f('0x22')]=_0x3b3856[_0x0f1f('0x22')];this[_0x0f1f('0x23')]=_0x3b3856[_0x0f1f('0x23')];this[_0x0f1f('0x24')]=_['isNil'](_0x3b3856['Agent'])?_0x3b3856[_0x0f1f('0x24')]:_0x3b3856[_0x0f1f('0xa')]['id'];this[_0x0f1f('0x25')]=_0x3b3856[_0x0f1f('0x25')];this[_0x0f1f('0x26')]='';this[_0x0f1f('0x27')]='';}Action[_0x0f1f('0x28')]['getCaller']=function(){return util[_0x0f1f('0xd')](_0x0f1f('0x29'),this[_0x0f1f('0xe')],this[_0x0f1f('0x2a')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1190024..2130253 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 _0x2f03=['name','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','type','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','recallMe','clearZombieChannel','enqueue','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','contactId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','agentReadyId','then','isNil','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','countbusyretry','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logCongestion]','AnswerAGI','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','pick','unlock','getContactPreview','recallme','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','variablesAction','destconnectedlinenum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','callProgressDetectingCustomer','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./action','defaults','redis','localhost','socket.io-emitter','tail','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','campaignsPreview','emit','outbound'];(function(_0x1e2b64,_0x36a9bb){var _0x5997ba=function(_0xf50cc2){while(--_0xf50cc2){_0x1e2b64['push'](_0x1e2b64['shift']());}};_0x5997ba(++_0x36a9bb);}(_0x2f03,0x133));var _0x32f0=function(_0x22a380,_0x3efade){_0x22a380=_0x22a380-0x0;var _0x142217=_0x2f03[_0x22a380];return _0x142217;};'use strict';var util=require(_0x32f0('0x0'));var _=require(_0x32f0('0x1'));var BPromise=require(_0x32f0('0x2'));var uuid=require(_0x32f0('0x3'));var moment=require('moment');var md5=require(_0x32f0('0x4'));var Redis=require(_0x32f0('0x5'));var config=require(_0x32f0('0x6'));var logger=require(_0x32f0('0x7'))(_0x32f0('0x8'));var loggerAction=require(_0x32f0('0x7'))(_0x32f0('0x9'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x32f0('0xa'));var ut=require('./util/util');config['redis']=_[_0x32f0('0xb')](config[_0x32f0('0xc')],{'host':_0x32f0('0xd'),'port':0x18eb});var io=require(_0x32f0('0xe'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x44f5ef){this[_0x32f0('0xf')]=this[_0x32f0('0xf')]?this[_0x32f0('0xf')]['finally'](_0x44f5ef):_0x44f5ef();};function Preview(_0x1fa46b){this[_0x32f0('0x10')]=new Sequence();this['campaignsPreview']=_0x1fa46b[_0x32f0('0x11')];this[_0x32f0('0x12')]=_0x1fa46b[_0x32f0('0x12')];this[_0x32f0('0x13')]={};this[_0x32f0('0x14')]=_0x1fa46b[_0x32f0('0x14')];this[_0x32f0('0x15')]=0x0;ami['on'](_0x32f0('0x16'),this[_0x32f0('0x17')][_0x32f0('0x18')](this));ami['on'](_0x32f0('0x19'),this['syncHangup'][_0x32f0('0x18')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x32f0('0x18')](this));ami['on'](_0x32f0('0x1a'),this[_0x32f0('0x1b')][_0x32f0('0x18')](this));ami['on'](_0x32f0('0x1c'),this[_0x32f0('0x1d')][_0x32f0('0x18')](this));ami['on'](_0x32f0('0x1e'),this[_0x32f0('0x1f')][_0x32f0('0x18')](this));ami['on'](_0x32f0('0x20'),this[_0x32f0('0x21')][_0x32f0('0x18')](this));ami['on']('blindtransfer',this[_0x32f0('0x22')][_0x32f0('0x18')](this));this['loopCampaigns'](this[_0x32f0('0x23')]);}function emit(_0x5c67bd,_0xeefef9,_0x3ce5be){io['to'](_0x5c67bd)[_0x32f0('0x24')](_0xeefef9,_0x3ce5be);}function emitCampaignPreview(_0x1aff40){if(_0x1aff40['type']===_0x32f0('0x25')){var _0x22ad16={'id':_0x1aff40['id'],'name':_0x1aff40[_0x32f0('0x26')],'strategy':_0x1aff40[_0x32f0('0x27')],'answered':_0x1aff40[_0x32f0('0x28')],'available':_0x1aff40[_0x32f0('0x29')],'loggedIn':_0x1aff40[_0x32f0('0x2a')],'pTalking':_0x1aff40[_0x32f0('0x2b')],'sumBillable':_0x1aff40['sumBillable'],'sumDuration':_0x1aff40['sumDuration'],'sumHoldTime':_0x1aff40[_0x32f0('0x2c')]||0x0,'talking':_0x1aff40[_0x32f0('0x2d')],'total':_0x1aff40[_0x32f0('0x2e')],'type':_0x1aff40[_0x32f0('0x2f')],'unmanaged':_0x1aff40[_0x32f0('0x30')],'abandoned':_0x1aff40[_0x32f0('0x31')],'waiting':_0x1aff40['waiting'],'loggedInDb':_0x1aff40['loggedInDb'],'dialActive':_0x1aff40[_0x32f0('0x32')],'dialMethod':_0x1aff40[_0x32f0('0x33')],'dialOriginateCallerIdName':_0x1aff40[_0x32f0('0x34')],'dialOriginateCallerIdNumber':_0x1aff40[_0x32f0('0x35')],'dialOriginateTimeout':_0x1aff40[_0x32f0('0x36')],'dialPrefix':_0x1aff40[_0x32f0('0x37')],'outboundAnswerAgiCallsDay':_0x1aff40[_0x32f0('0x38')],'outboundAnswerCallsDay':_0x1aff40[_0x32f0('0x39')],'outboundBlacklistCallsDay':_0x1aff40[_0x32f0('0x3a')],'outboundBusyCallsDay':_0x1aff40[_0x32f0('0x3b')],'outboundCongestionCallsDay':_0x1aff40[_0x32f0('0x3c')],'outboundDropCallsDayACS':_0x1aff40[_0x32f0('0x3d')],'outboundDropCallsDayCallersExit':_0x1aff40[_0x32f0('0x3e')],'outboundDropCallsDayTimeout':_0x1aff40[_0x32f0('0x3f')],'outboundNoAnswerCallsDay':_0x1aff40[_0x32f0('0x40')],'outboundNoSuchCallsDay':_0x1aff40[_0x32f0('0x41')],'outboundOriginateFailureCallsDay':_0x1aff40[_0x32f0('0x42')],'outboundReCallsDay':_0x1aff40[_0x32f0('0x43')],'outboundRejectCallsDay':_0x1aff40[_0x32f0('0x44')],'outboundUnknownCallsDay':_0x1aff40[_0x32f0('0x45')],'outboundAbandonedCallsDay':_0x1aff40[_0x32f0('0x46')],'predictiveIntervalAnsweredCalls':_0x1aff40[_0x32f0('0x47')],'predictiveIntervalAvgHoldtime':_0x1aff40[_0x32f0('0x48')],'predictiveIntervalAvgTalktime':_0x1aff40['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1aff40[_0x32f0('0x49')],'predictiveIntervalDroppedCallsTimeout':_0x1aff40[_0x32f0('0x4a')],'predictiveIntervalErlangCalls':_0x1aff40['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1aff40['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1aff40[_0x32f0('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x1aff40[_0x32f0('0x4c')],'predictiveIntervalPauses':_0x1aff40[_0x32f0('0x4d')],'predictiveIntervalAvailable':_0x1aff40[_0x32f0('0x4e')],'predictiveIntervalTotalCalls':_0x1aff40['predictiveIntervalTotalCalls'],'message':_0x1aff40[_0x32f0('0x4f')],'originated':_0x1aff40[_0x32f0('0x50')],'erlangCalls':_0x1aff40[_0x32f0('0x51')],'erlangCallToSecond':_0x1aff40['erlangCallToSecond'],'erlangAbandonmentRate':_0x1aff40[_0x32f0('0x52')],'erlangBusyFactor':_0x1aff40[_0x32f0('0x53')],'startPredictive':_0x1aff40[_0x32f0('0x54')],'startProgressive':_0x1aff40[_0x32f0('0x55')]};if(_0x1aff40['Trunk']){_0x22ad16[_0x32f0('0x56')]={'id':_0x1aff40[_0x32f0('0x56')]['id'],'name':_0x1aff40[_0x32f0('0x56')][_0x32f0('0x26')],'active':_0x1aff40[_0x32f0('0x56')][_0x32f0('0x57')],'callerid':_0x1aff40['Trunk']['callerid']};}if(_0x1aff40[_0x32f0('0x58')]){_0x22ad16[_0x32f0('0x58')]={'id':_0x1aff40[_0x32f0('0x58')]['id'],'name':_0x1aff40[_0x32f0('0x58')][_0x32f0('0x26')]};}var _0x25aa4d=md5(JSON[_0x32f0('0x59')](_0x22ad16));if(_0x1aff40[_0x32f0('0x4')]!==_0x25aa4d){_0x1aff40[_0x32f0('0x4')]=_0x25aa4d;emit(util[_0x32f0('0x5a')]('voice:queue:%s',_0x22ad16[_0x32f0('0x26')]),'voice_queue:save',_0x22ad16);}}}function emitVoiceQueueChannelRemove(_0x4ad36e){logger[_0x32f0('0x5b')](_0x32f0('0x5c'),JSON['stringify'](_0x4ad36e));emit(util['format'](_0x32f0('0x5d'),_0x4ad36e['name']),'voice_queue_channel:remove',_0x4ad36e);io[_0x32f0('0x24')](_0x32f0('0x5e'),_0x4ad36e);}function notSendMessagesQueue(_0x1bc334){if(_0x1bc334[_0x32f0('0x5f')]){if(_0x1bc334[_0x32f0('0x50')]===0x0&&_0x1bc334[_0x32f0('0x2b')]===0x0){_0x1bc334[_0x32f0('0x5f')]=![];_0x1bc334[_0x32f0('0x29')]=0x0;_0x1bc334[_0x32f0('0x60')]=0x0;_0x1bc334[_0x32f0('0x4f')]='NOT_ACTIVE';ut[_0x32f0('0x61')](_0x32f0('0x62'),_0x1bc334[_0x32f0('0x26')]+_0x32f0('0x63'));}else{_0x1bc334[_0x32f0('0x4f')]=_0x32f0('0x64');ut[_0x32f0('0x61')](_0x32f0('0x62'),_0x1bc334['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x1bc334);}}Preview[_0x32f0('0x65')]['loopCampaigns']=function(){var _0x417a9c=this;setInterval(function(){_0x417a9c[_0x32f0('0x66')]();},0x7cf);};Preview[_0x32f0('0x65')][_0x32f0('0x66')]=function(){var _0x38de72=this[_0x32f0('0x23')];this[_0x32f0('0x15')]+=0x1;for(var _0x70f6e in _0x38de72){if(_0x38de72[_0x32f0('0x67')](_0x70f6e)&&(_0x38de72[_0x70f6e][_0x32f0('0x33')]===_0x32f0('0x8')||_0x38de72[_0x70f6e][_0x32f0('0x33')]==='booked')&&_0x38de72[_0x70f6e][_0x32f0('0x2f')]===_0x32f0('0x25')){if(this[_0x32f0('0x15')]>0x7){this[_0x32f0('0x15')]=0x0;this[_0x32f0('0x68')]();}}if(_0x38de72['hasOwnProperty'](_0x70f6e)&&_0x38de72[_0x70f6e]['dialMethod']==='preview'&&_0x38de72[_0x70f6e]['type']===_0x32f0('0x25')){if(_0x38de72[_0x70f6e]['dialActive']){this[_0x32f0('0x69')](_0x38de72[_0x70f6e]);this[_0x32f0('0x6a')](_0x38de72[_0x70f6e]);}else{notSendMessagesQueue(_0x38de72[_0x70f6e]);}}}};Preview[_0x32f0('0x65')][_0x32f0('0x6b')]=function(_0x332a0d){var _0x909a6b=this;this['sequence'][_0x32f0('0x6c')](function(){if(!_['isNil'](_0x909a6b[_0x32f0('0x13')][_0x332a0d])){loggerAction[_0x32f0('0x5b')](_0x32f0('0x6d'),_0x332a0d,_0x32f0('0x6e'),_0x909a6b[_0x32f0('0x13')][_0x332a0d][_0x32f0('0x6f')],'originated:\x20',JSON[_0x32f0('0x59')](_0x909a6b['campaignsPreview'][_0x909a6b[_0x32f0('0x13')][_0x332a0d][_0x32f0('0x6f')]][_0x32f0('0x50')]),_0x32f0('0x70'),JSON[_0x32f0('0x59')](_0x909a6b[_0x32f0('0x23')][_0x909a6b[_0x32f0('0x13')][_0x332a0d]['queue']][_0x32f0('0x2b')]),JSON[_0x32f0('0x59')](_0x909a6b[_0x32f0('0x13')][_0x332a0d][_0x32f0('0x71')]),JSON[_0x32f0('0x59')](_['pick'](_0x909a6b[_0x32f0('0x13')][_0x332a0d],[_0x32f0('0x72'),'UserId',_0x32f0('0x73'),_0x32f0('0x74')])));return ami[_0x32f0('0x75')]({'action':_0x32f0('0x76'),'channel':_0x909a6b[_0x32f0('0x13')][_0x332a0d][_0x32f0('0x77')]})[_0x32f0('0x78')](function(_0x123baa){if(_0x123baa[_0x32f0('0x4f')]===_0x32f0('0x79')){setTimeout(function(){if(_0x909a6b[_0x32f0('0x13')][_0x332a0d]){ut['updateOriginated'](_0x909a6b[_0x32f0('0x23')][_0x909a6b['actions'][_0x332a0d]['queue']],_0x32f0('0x7a'));if(_0x909a6b['actions'][_0x332a0d]['dialAnswer']===!![]){ut[_0x32f0('0x7b')](_0x909a6b[_0x32f0('0x23')][_0x909a6b[_0x32f0('0x13')][_0x332a0d][_0x32f0('0x6f')]],_0x32f0('0x7a'));ut[_0x32f0('0x7c')](_0x32f0('0x7d')+_0x332a0d,_0x909a6b[_0x32f0('0x13')][_0x332a0d][_0x32f0('0x6f')]);}ut['loggerError'](_0x32f0('0x7e')+_0x332a0d,_0x909a6b['actions'][_0x332a0d]['queue']);delete _0x909a6b['actions'][_0x332a0d];}},0x2328);}});}});};Preview[_0x32f0('0x65')][_0x32f0('0x68')]=function(){var _0x11b347=this;loggerAction['info'](_0x32f0('0x7f'),_[_0x32f0('0x80')](this[_0x32f0('0x13')]));for(var _0x4c9708 in this['actions']){if(_0x11b347['actions']['hasOwnProperty'](_0x4c9708)){_0x11b347[_0x32f0('0x6b')](_0x4c9708);}}};Preview['prototype'][_0x32f0('0x6a')]=function(_0x1aa2cf){var _0x54639e=this;rpcDb['getContactRecallMe'](_0x1aa2cf['id'],ut[_0x32f0('0x81')](this[_0x32f0('0x14')]))[_0x32f0('0x82')](function(_0x44a123){if(!_[_0x32f0('0x83')](_0x44a123)){for(var _0x3af826=0x0;_0x3af826<_0x44a123[_0x32f0('0x84')];_0x3af826+=0x1){if(ut['getDiff'](_0x44a123[_0x3af826][_0x32f0('0x85')])<_0x1aa2cf[_0x32f0('0x86')]*0x3c){if(_0x44a123[_0x3af826]['Agent']&&!_0x44a123[_0x3af826][_0x32f0('0x87')][_0x32f0('0x88')]){_0x54639e[_0x32f0('0x89')](_0x44a123[_0x3af826]['id'])['then'](ut[_0x32f0('0x8a')](_0x32f0('0x8b')))[_0x32f0('0x78')](ut['logger2'](_0x32f0('0x8b')));}else{rpcDb[_0x32f0('0x8c')](_0x44a123[_0x3af826]['id']);}}else{var _0x250217=new Action(_0x44a123[_0x3af826],_0x1aa2cf);_0x250217[_0x32f0('0x8d')]=moment()[_0x32f0('0x5a')](_0x32f0('0x8e'));_0x1aa2cf['outboundReCallsDay']+=0x1;ut[_0x32f0('0x8f')](_0x250217,0x17,_0x32f0('0x90'));if(_0x1aa2cf[_0x32f0('0x91')]){rpcDb[_0x32f0('0x92')](ut[_0x32f0('0x93')](_0x44a123[_0x3af826]));rpcDb[_0x32f0('0x94')](_0x250217,_0x32f0('0x95'));}else{ut[_0x32f0('0x8f')](_0x250217,0x16,_0x32f0('0x96'));rpcDb[_0x32f0('0x94')](_0x250217,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x250217,'[HistoryRecallClose]');}}}}})[_0x32f0('0x78')](ut['logger2']('[getContactRecallMe]'));};Preview[_0x32f0('0x65')][_0x32f0('0x69')]=function(_0x2e8da2){_0x2e8da2[_0x32f0('0x5f')]=!![];if(ut[_0x32f0('0x97')](_0x2e8da2[_0x32f0('0x2a')])){_0x2e8da2['message']=_0x32f0('0x98');}else if(!ut[_0x32f0('0x99')](_0x2e8da2[_0x32f0('0x32')])){_0x2e8da2[_0x32f0('0x4f')]=_0x32f0('0x9a');}else if(!this[_0x32f0('0x9b')](_0x2e8da2[_0x32f0('0x56')])){if(!this[_0x32f0('0x9b')](_0x2e8da2['TrunkBackup'])){_0x2e8da2[_0x32f0('0x4f')]=_0x32f0('0x9c');}else{_0x2e8da2[_0x32f0('0x4f')]=_0x32f0('0x9d');}}else{_0x2e8da2[_0x32f0('0x4f')]=_0x32f0('0x9d');}emitCampaignPreview(_0x2e8da2);};Preview[_0x32f0('0x65')]['callProgressDetectingCustomer']=function(_0x119876,_0x59bb6d,_0x47c193){var _0x57ac92=this;var _0xd6c988=this[_0x32f0('0x13')][_0x59bb6d];var _0x3d902e=this['campaignsPreview'][_0xd6c988['queue']];var _0x513ce3;if(_0x3d902e){switch(_0x47c193){case'1':_0x3d902e['outboundNoSuchCallsDay']+=0x1;_0xd6c988['countnosuchnumberretry']+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x0,'NoSuchNumber');ami['emit'](_0x32f0('0xa0'),ut[_0x32f0('0xa1')](_0xd6c988,'nosuchnumber'));rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xa2'));if(ut[_0x32f0('0x9f')](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb['createCustomerFinal'](_0x513ce3,_0x32f0('0xa6'));}else{if(_0xd6c988[_0x32f0('0xa7')]>=_0x3d902e[_0x32f0('0xa8')]){rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xa6'));}else{rpcDb[_0x32f0('0xaa')](ut[_0x32f0('0xab')](_0xd6c988,'countnosuchnumberretry',_0x3d902e[_0x32f0('0xac')]),_0xd6c988[_0x32f0('0xad')],_0xd6c988[_0x32f0('0xae')]);}}delete this['actions'][_0x119876[_0x32f0('0xaf')]];break;case _0x32f0('0xb0'):var _0x4853ac=moment()[_0x32f0('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0xd6c988[_0x32f0('0xb1')]=_0x4853ac;_0xd6c988['answertime']=_0x4853ac;_0xd6c988['dialAnswer']=!![];_0x3d902e[_0x32f0('0x2b')]+=0x1;logger[_0x32f0('0x5b')]('[syncHangup][talking][increment]',_0xd6c988[_0x32f0('0xb2')],_0x32f0('0xb3'),_0x3d902e[_0x32f0('0x26')],_0x32f0('0x70'),_0x3d902e['pTalking']);ami[_0x32f0('0x24')](_0x32f0('0xb4'),ut[_0x32f0('0xa1')](_0xd6c988,_0x32f0('0xb5'),this['campaignsPreview'][_0xd6c988[_0x32f0('0x6f')]]));if(_0x3d902e[_0x32f0('0xb6')]){ami[_0x32f0('0x24')](_0x32f0('0xb7'),ut['buildAcw'](_0xd6c988));}break;case'16':ami[_0x32f0('0x24')](_0x32f0('0xb8'),ut['buildObj'](_0xd6c988,_0x32f0('0xb9'),this[_0x32f0('0x23')][_0xd6c988['queue']]));emitVoiceQueueChannelRemove(ut[_0x32f0('0xa1')](_0xd6c988,_0x32f0('0xb9')));_0x3d902e['outboundAnswerCallsDay']+=0x1;_0x3d902e[_0x32f0('0x2e')]+=0x1;_0x3d902e[_0x32f0('0x28')]+=0x1;ut[_0x32f0('0x7b')](_0x3d902e,'[16]');_0xd6c988['countglobal']=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x4,'Answer');rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xba'));rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xbb'));rpcDb[_0x32f0('0xbc')](_0xd6c988);_0x3d902e[_0x32f0('0xbd')]+=_0xd6c988[_0x32f0('0xbe')];_0x3d902e[_0x32f0('0xbf')]+=_0xd6c988[_0x32f0('0xbe')];logger[_0x32f0('0x5b')](_0x32f0('0xc0'),_0xd6c988[_0x32f0('0xb2')],'\x20Queue',_0x3d902e[_0x32f0('0x26')],_0x32f0('0x70'),_0x3d902e[_0x32f0('0x2b')]);delete this[_0x32f0('0x13')][_0x119876[_0x32f0('0xaf')]];break;case'BUSY':_0x3d902e['outboundBusyCallsDay']+=0x1;_0xd6c988[_0x32f0('0xc1')]+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x5,'Busy');ami[_0x32f0('0x24')](_0x32f0('0xc2'),ut[_0x32f0('0xa1')](_0xd6c988,'busy'));rpcDb['createCustomerHistory'](_0xd6c988,_0x32f0('0xc3'));if(ut[_0x32f0('0x9f')](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb['createCustomerFinal'](_0x513ce3,_0x32f0('0xc4'));}else{if(_0xd6c988['countbusyretry']>=_0x3d902e[_0x32f0('0xc5')]){rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xc3'));}else{rpcDb['rescheduleContact'](ut[_0x32f0('0xab')](_0xd6c988,_0x32f0('0xc1'),_0x3d902e[_0x32f0('0xc6')]),_0xd6c988[_0x32f0('0xad')],_0xd6c988[_0x32f0('0xae')]);}}break;case _0x32f0('0xc7'):_0x3d902e[_0x32f0('0x40')]+=0x1;_0xd6c988[_0x32f0('0xc8')]+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x3,_0x32f0('0xc9'));ami[_0x32f0('0x24')]('custom:agentnoanswer',ut[_0x32f0('0xa1')](_0xd6c988,_0x32f0('0xca')));rpcDb['createCustomerHistory'](_0xd6c988,_0x32f0('0xcb'));if(ut[_0x32f0('0x9f')](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,'Global');rpcDb[_0x32f0('0xa9')](_0x513ce3,_0x32f0('0xcc'));}else{if(_0xd6c988['countnoanswerretry']>=_0x3d902e['dialNoAnswerMaxRetry']){rpcDb[_0x32f0('0xa9')](_0xd6c988,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x32f0('0xab')](_0xd6c988,_0x32f0('0xc8'),_0x3d902e[_0x32f0('0xcd')]),_0xd6c988[_0x32f0('0xad')],_0xd6c988[_0x32f0('0xae')]);}}break;case _0x32f0('0xce'):_0x3d902e['outboundCongestionCallsDay']+=0x1;_0xd6c988[_0x32f0('0xcf')]+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut['logCustomer'](_0xd6c988,0x8,_0x32f0('0xd0'));ami[_0x32f0('0x24')]('custom:agentcongestion',ut['buildObj'](_0xd6c988,_0x32f0('0xd1')));rpcDb[_0x32f0('0x94')](_0xd6c988,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x32f0('0x9f')](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb[_0x32f0('0xa9')](_0x513ce3,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0xd6c988[_0x32f0('0xcf')]>=_0x3d902e[_0x32f0('0xd2')]){rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xd3'));}else{rpcDb[_0x32f0('0xaa')](ut[_0x32f0('0xab')](_0xd6c988,_0x32f0('0xcf'),_0x3d902e[_0x32f0('0xc6')]),_0xd6c988['unlockAgent'],_0xd6c988[_0x32f0('0xae')]);}}break;case _0x32f0('0xd4'):_0x3d902e[_0x32f0('0x44')]+=0x1;_0xd6c988[_0x32f0('0xd5')]+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x14,_0x32f0('0xd6'));ami[_0x32f0('0x24')](_0x32f0('0xd7'),ut[_0x32f0('0xa1')](_0xd6c988,_0x32f0('0xd8')));rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xd9'));if(ut['totalGlobal'](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0x14,_0x32f0('0xd6'));rpcDb['createCustomerFinal'](_0x513ce3,_0x32f0('0xda'));}else{if(_0xd6c988[_0x32f0('0xd5')]>=_0x3d902e[_0x32f0('0xdb')]){rpcDb['createCustomerFinal'](_0xd6c988,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x32f0('0xaa')](ut[_0x32f0('0xab')](_0xd6c988,_0x32f0('0xd5'),_0x3d902e['dialAgentRejectRetryFrequency']),_0xd6c988[_0x32f0('0xad')],_0xd6c988[_0x32f0('0xae')]);}}break;case _0x32f0('0xdc'):_0x3d902e['outboundAbandonedCallsDay']+=0x1;_0xd6c988['countabandonedretry']+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut['logCustomer'](_0xd6c988,0xb,_0x32f0('0xdd'));rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xde'));if(ut[_0x32f0('0x9f')](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb[_0x32f0('0xa9')](_0x513ce3,_0x32f0('0xde'));}else{if(_0xd6c988[_0x32f0('0xdf')]>=_0x3d902e[_0x32f0('0xe0')]){rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xde'));}else{rpcDb[_0x32f0('0xaa')](ut['scheduledAt'](_0xd6c988,_0x32f0('0xe1'),_0x3d902e[_0x32f0('0xe2')]),_0xd6c988[_0x32f0('0xad')],_0xd6c988['activeContact']);}}break;case'18':_0x3d902e['outboundUnknownCallsDay']+=0x1;_0xd6c988['countmachineretry']+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut['totalGlobal'](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x12,_0x119876[_0x32f0('0xe3')]||_0x119876['dialstatus']);ami['emit'](_0x32f0('0xe4'),ut['buildObj'](_0xd6c988,_0x32f0('0xe5')));rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xe6'));if(ut['totalGlobal'](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb[_0x32f0('0xa9')](_0x513ce3,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xe6'));}delete this['actions'][_0x119876[_0x32f0('0xaf')]];break;case'19':_0x3d902e['outboundUnknownCallsDay']+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0x13,_0x119876[_0x32f0('0xe3')]||_0x119876[_0x32f0('0xe7')]);ami[_0x32f0('0x24')](_0x32f0('0xe4'),ut[_0x32f0('0xa1')](_0xd6c988,_0x32f0('0xe5')));rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xe8'));if(ut[_0x32f0('0x9f')](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut['cloneAction'](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb[_0x32f0('0xa9')](_0x513ce3,_0x32f0('0xe8'));}else{rpcDb[_0x32f0('0xa9')](_0xd6c988,_0x32f0('0xe8'));}delete this[_0x32f0('0x13')][_0x119876[_0x32f0('0xaf')]];break;default:if(_0xd6c988[_0x32f0('0x71')]){ut[_0x32f0('0x7b')](_0x3d902e,'[default]');ut[_0x32f0('0x7c')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x3d902e['name'],_0x119876);}_0x3d902e[_0x32f0('0x45')]+=0x1;_0xd6c988[_0x32f0('0x9e')]=ut[_0x32f0('0x9f')](_0xd6c988);ut[_0x32f0('0x8f')](_0xd6c988,0xc,_0x119876[_0x32f0('0xe3')]||_0x119876['dialstatus']);rpcDb[_0x32f0('0x94')](_0xd6c988,_0x32f0('0xe9'));if(ut['totalGlobal'](_0xd6c988)>=_0x3d902e[_0x32f0('0xa3')]){_0x513ce3=ut[_0x32f0('0xa4')](_0xd6c988,0xf,_0x32f0('0xa5'));rpcDb[_0x32f0('0xa9')](_0x513ce3,_0x32f0('0xea'));}else{rpcDb['createCustomerFinal'](_0xd6c988,_0x32f0('0xea'));}delete this[_0x32f0('0x13')][_0x119876[_0x32f0('0xaf')]];}if(!(_0xd6c988[_0x32f0('0x71')]&&_0x47c193==='16')){ut['updateOriginated'](_0x3d902e,'[callProgressDetectingCustomer]');logger[_0x32f0('0x5b')]('[originated][decrement][callProgressDetectingCustomer]',_0xd6c988[_0x32f0('0xb2')],_0x32f0('0xb3'),_0x3d902e['name'],'originated:\x20',_0x3d902e['originated']);}if(_0x47c193!=='ANSWER'){delete this[_0x32f0('0x13')][_0x119876[_0x32f0('0xaf')]];delete this[_0x32f0('0x13')][_0x119876[_0x32f0('0xeb')]];}}};Preview[_0x32f0('0x65')][_0x32f0('0xec')]=function(_0x421991,_0x9e6ab4,_0x223ba7){if(_[_0x32f0('0xed')](_0x9e6ab4)&&_0x32f0('0xee')!==typeof _0x9e6ab4){return;}if(_['isUndefined'](_0x223ba7)&&_0x32f0('0xee')!==typeof _0x223ba7){return;}switch(_0x223ba7[_0x32f0('0xef')]){case'0':ut[_0x32f0('0xf0')](_0x421991,0x0,_0x32f0('0xf1'));rpcDb[_0x32f0('0xf2')](_0x421991,_0x32f0('0xf3'));break;case'3':ut['logAgent'](_0x421991,0x3,_0x32f0('0xc9'));rpcDb[_0x32f0('0xf2')](_0x421991,_0x32f0('0xf4'));break;case'5':ut[_0x32f0('0xf0')](_0x421991,0x5,_0x32f0('0xf5'));rpcDb[_0x32f0('0xf2')](_0x421991,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x32f0('0xf0')](_0x421991,0x8,_0x32f0('0xd0'));rpcDb[_0x32f0('0xf2')](_0x421991,_0x32f0('0xf6'));break;case'22':ut[_0x32f0('0xf0')](_0x421991,0x16,_0x32f0('0xf7'));rpcDb[_0x32f0('0xf2')](_0x421991,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x32f0('0xf0')](_0x421991,0xc,_0x223ba7[_0x32f0('0xef')]);rpcDb[_0x32f0('0xf2')](_0x421991,_0x32f0('0xf6'));}ut[_0x32f0('0xf8')](_0x9e6ab4,_0x32f0('0xf9'));logger[_0x32f0('0x5b')](_0x32f0('0xfa'),_0x421991[_0x32f0('0xb2')],_0x32f0('0xb3'),_0x9e6ab4['name'],_0x32f0('0xfb'),_0x9e6ab4['originated']);delete this['actions'][_0x421991[_0x32f0('0xb2')]];};Preview[_0x32f0('0x65')][_0x32f0('0xfc')]=function(_0x41ad97,_0x52941c,_0x578aca,_0xb54fb8,_0x554147){var _0x5ddb57=this;return new BPromise(function(_0x1cbd6a,_0x95d6bd){if(_[_0x32f0('0x83')](_0x52941c)||_[_0x32f0('0x83')](_0x52941c[_0x32f0('0xfd')])||_[_0x32f0('0x83')](_0x52941c[_0x32f0('0xfd')][_0x32f0('0xfe')])||_[_0x32f0('0x83')](_0x52941c[_0x32f0('0x73')])){_0x95d6bd(ut[_0x32f0('0x4f')](_0x32f0('0xff'),_0xb54fb8,_0x554147));return;}var _0x4b3020=uuid['v4']();var _0x4a5337=_0x5ddb57[_0x32f0('0x23')][_0x52941c[_0x32f0('0x6e')][_0x32f0('0x26')]];var _0x2abf1e=_0x578aca?_0x5ddb57[_0x32f0('0x14')][_0x578aca]['id']:undefined;_0x5ddb57[_0x32f0('0x13')][_0x4b3020]=new Action(_0x52941c,_0x4a5337,_0x4b3020,_0x578aca,_0x2abf1e);var _0x333d7b=_0x5ddb57[_0x32f0('0x13')][_0x4b3020];_0x333d7b[_0x32f0('0xad')]=_0xb54fb8;_0x333d7b['activeContact']=_0x554147;_0x333d7b[_0x32f0('0x100')]=_0x578aca;if(_['isEmpty'](_0x41ad97)){_0x5ddb57[_0x32f0('0x101')](_0x333d7b,_0x4a5337,_0x52941c,_0x578aca)[_0x32f0('0x82')](function(_0x4f9fc6){logger[_0x32f0('0x5b')]('[Preview][execCall][success]','Queue:\x20'+_0x333d7b[_0x32f0('0x6f')]+'\x20IdHopper:\x20'+_0x333d7b[_0x32f0('0x102')],JSON['stringify'](_0x4f9fc6));ami['emit'](_0x32f0('0x103'),ut['buildObj'](_0x333d7b,_0x32f0('0x104'),_0x5ddb57[_0x32f0('0x23')][_0x333d7b['queue']]));_0x1cbd6a(ut[_0x32f0('0x4f')](_0x32f0('0x105')));})['catch'](function(_0x363c61){ut['logger'](_0x32f0('0x106'),_0x363c61);_0x95d6bd(ut[_0x32f0('0x4f')](_0x32f0('0x107'),_0xb54fb8,_0x554147));});}else{_0x4a5337[_0x32f0('0x3a')]+=0x1;ut[_0x32f0('0x108')](_0x333d7b);rpcDb[_0x32f0('0x109')](_0x333d7b,_0x32f0('0x10a'));delete _0x5ddb57['actions'][_0x4b3020];_0x95d6bd(ut[_0x32f0('0x4f')](_0x32f0('0x10b'),_0xb54fb8,_0x554147));}});};Preview['prototype'][_0x32f0('0x9b')]=function(_0x3fc294){return!_[_0x32f0('0x83')](_0x3fc294)&&!_[_0x32f0('0x83')](_0x3fc294['name'])&&!_['isNil'](_0x3fc294[_0x32f0('0x57')])&&_0x3fc294[_0x32f0('0x57')]&&!_[_0x32f0('0x83')](this[_0x32f0('0x12')][util['format']('SIP/%s',_0x3fc294[_0x32f0('0x26')])])&&!_[_0x32f0('0x83')](this[_0x32f0('0x12')][util['format'](_0x32f0('0x10c'),_0x3fc294['name'])][_0x32f0('0x76')])&&(this[_0x32f0('0x12')][util[_0x32f0('0x5a')](_0x32f0('0x10c'),_0x3fc294[_0x32f0('0x26')])][_0x32f0('0x76')]===_0x32f0('0x10d')||this[_0x32f0('0x12')][util[_0x32f0('0x5a')](_0x32f0('0x10c'),_0x3fc294[_0x32f0('0x26')])]['status']===_0x32f0('0x10e'));};Preview['prototype'][_0x32f0('0x89')]=function(_0x560870,_0x5a9286){var _0xf41956=this;return new BPromise(function(_0x5b0a23,_0x2adcda){_0xf41956[_0x32f0('0x10f')](_0x560870,_0x5a9286)[_0x32f0('0x82')](function(_0x14f156){_0x5b0a23(_[_0x32f0('0x110')](_0x14f156,['message']));})['catch'](function(_0x4b5ce1){if(_0x4b5ce1[_0x32f0('0x111')]){rpcDb['unlockContact'](_0x560870);}if(_0x4b5ce1[_0x32f0('0x57')]){rpcDb[_0x32f0('0x8c')](_0x560870);}_0x2adcda(_['pick'](_0x4b5ce1,[_0x32f0('0x4f')]));});});};Preview['prototype'][_0x32f0('0x10f')]=function(_0x18089f,_0x38cfc0){var _0x3100db=this;return new BPromise(function(_0x19a689,_0x4a9df7){var _0x42af91,_0x346f62;rpcDb[_0x32f0('0x112')](_0x18089f)['then'](function(_0x58062b){if(!_[_0x32f0('0x83')](_0x58062b[0x0])){_0x346f62=_0x58062b[0x0][_0x32f0('0x113')]?![]:!![];_0x42af91=_0x58062b[0x0][_0x32f0('0x113')]?!![]:![];_0x42af91=_0x38cfc0?!![]:_0x42af91;}var _0x18ca31=_0x3100db['validateContact'](_0x58062b);if(_0x18ca31['isValid']){rpcDb[_0x32f0('0x114')](_['pick'](_0x58062b[0x0],[_0x32f0('0x73'),_0x32f0('0x115')]))['then'](function(_0x2131f9){_0x3100db[_0x32f0('0xfc')](_0x2131f9,_0x58062b[0x0],_0x38cfc0,_0x346f62,_0x42af91)['then'](function(_0x2a8b4e){_0x19a689(_0x2a8b4e);})['catch'](function(_0x382efb){_0x4a9df7(_0x382efb);});})[_0x32f0('0x78')](function(_0x72392f){ut['logger']('[Preview][checkIsBlackList]',_0x72392f);_0x4a9df7(ut[_0x32f0('0x4f')](_0x32f0('0x116'),_0x346f62,_0x42af91));});}else{_0x4a9df7(ut[_0x32f0('0x4f')](_0x18ca31[_0x32f0('0x4f')],_0x346f62,_0x42af91));}})[_0x32f0('0x78')](function(_0x2eff9a){ut[_0x32f0('0x61')](_0x32f0('0x117'),_0x2eff9a);_0x4a9df7(ut[_0x32f0('0x4f')](_0x32f0('0x116'),![],!![]));});});};Preview[_0x32f0('0x65')][_0x32f0('0x118')]=function(_0x53d824){if(_[_0x32f0('0x83')](_0x53d824)||_[_0x32f0('0x119')](_0x53d824)||!_[_0x32f0('0x83')](_0x53d824[0x0][_0x32f0('0x87')])&&_[_0x32f0('0x83')](_0x53d824[0x0][_0x32f0('0x87')][_0x32f0('0x26')])){ut[_0x32f0('0x61')](_0x32f0('0x11a'),_0x53d824);return{'isValid':![],'message':_0x32f0('0x11b')};}var _0x3b462e=this[_0x32f0('0x23')][_0x53d824[0x0][_0x32f0('0x6e')][_0x32f0('0x26')]];_0x3b462e[_0x32f0('0x4f')]=_0x32f0('0x9d');if(_[_0x32f0('0x83')](_0x3b462e)){ut[_0x32f0('0x61')](_0x32f0('0x11c'),_0x3b462e);return{'isValid':![],'message':_0x32f0('0x11d')};}if(!this[_0x32f0('0x9b')](_0x3b462e[_0x32f0('0x56')])){ut['logger'](_0x32f0('0x11e'),'campaign\x20Name:\x20'+_0x3b462e[_0x32f0('0x26')]+_0x32f0('0x11f'));if(!this[_0x32f0('0x9b')](_0x3b462e['TrunkBackup'])){ut[_0x32f0('0x61')](_0x32f0('0x11e'),_0x3b462e[_0x32f0('0x26')]+_0x32f0('0x120'));return{'isValid':![],'message':_0x32f0('0x121')};}}if(!ut[_0x32f0('0x99')](_0x3b462e['dialActive'])){ut[_0x32f0('0x61')](_0x32f0('0x122'),_0x3b462e[_0x32f0('0x26')]+_0x32f0('0x123'));return{'isValid':![],'message':_0x32f0('0x124')+_0x3b462e[_0x32f0('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x32f0('0x125')};};Preview[_0x32f0('0x65')][_0x32f0('0x101')]=function(_0x13382c,_0x536f43,_0x3f91ea,_0x18b0f3){var _0x26c977=this;return new BPromise(function(_0x5090d6,_0xde52d){var _0x398ecb=_0x13382c[_0x32f0('0xb2')];var _0x2cefdf=_0x26c977[_0x32f0('0x9b')](_0x536f43['Trunk'])?util[_0x32f0('0x5a')](_0x32f0('0x126'),_0x536f43[_0x32f0('0x56')][_0x32f0('0x26')],_[_0x32f0('0x83')](_0x536f43[_0x32f0('0x37')])?'':_0x536f43['dialPrefix'][_0x32f0('0x127')]()||'',_0x536f43[_0x32f0('0x128')]>0x0?_0x3f91ea[_0x32f0('0xfd')][_0x32f0('0xfe')][_0x32f0('0x129')](_0x536f43[_0x32f0('0x128')]):_0x3f91ea[_0x32f0('0xfd')][_0x32f0('0xfe')]):util['format'](_0x32f0('0x126'),_[_0x32f0('0x83')](_0x536f43[_0x32f0('0x12a')])?_0x536f43['Trunk'][_0x32f0('0x26')]:_0x536f43[_0x32f0('0x12a')][_0x32f0('0x26')],_[_0x32f0('0x83')](_0x536f43['dialPrefix'])?'':_0x536f43[_0x32f0('0x37')][_0x32f0('0x127')]()||'',_0x536f43[_0x32f0('0x128')]>0x0?_0x3f91ea[_0x32f0('0xfd')][_0x32f0('0xfe')][_0x32f0('0x129')](_0x536f43[_0x32f0('0x128')]):_0x3f91ea[_0x32f0('0xfd')][_0x32f0('0xfe')]);var _0x2068b4=_0x26c977['isTrunkReachable'](_0x536f43[_0x32f0('0x56')])?ut[_0x32f0('0x12b')](_0x536f43[_0x32f0('0x56')][_0x32f0('0x12c')],_0x536f43[_0x32f0('0x34')],_0x536f43['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x536f43['dialOriginateCallerIdNumber'],_0x536f43[_0x32f0('0x12d')]):_0x536f43['dialOriginateCallerIdNumber']):ut['getCallerId'](_['isNil'](_0x536f43['TrunkBackup'])?_0x536f43[_0x32f0('0x56')]['callerid']:_0x536f43[_0x32f0('0x12a')][_0x32f0('0x12c')],_0x536f43[_0x32f0('0x34')],_0x536f43['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x32f0('0x12e')](_0x536f43[_0x32f0('0x35')],_0x536f43[_0x32f0('0x12d')]):_0x536f43[_0x32f0('0x35')]);if(_0x2068b4){_0x13382c[_0x32f0('0x12f')]=ut[_0x32f0('0x130')](_0x2068b4);_0x13382c['originatecalleridnum']=ut[_0x32f0('0x131')](_0x2068b4);}var _0xdd6624=ut[_0x32f0('0x132')](_0x536f43,_0x3f91ea,_0x2cefdf,_0x2068b4,_0x398ecb,_0x13382c);_['merge'](_0x13382c,ut['toLowerVariables'](_0xdd6624));_0x13382c[_0x32f0('0x8d')]=moment()[_0x32f0('0x5a')](_0x32f0('0x8e'));ami[_0x32f0('0x75')](ut[_0x32f0('0x133')](_0x13382c,_0x536f43,_0xdd6624,_0x13382c['activeContact'],_0x18b0f3))['then'](function(_0x346e34){var _0x2bced4=_0x13382c['channelAgent'];if(!_['isNil'](_0x2bced4)){if(!_[_0x32f0('0x83')](_0x26c977['agents'][_0x2bced4])){_0x26c977[_0x32f0('0x14')][_0x2bced4][_0x32f0('0x134')]=_0x13382c['calleridnum'];emit(util['format'](_0x32f0('0x135'),_0x26c977['agents'][_0x2bced4]['name']),_0x32f0('0x136'),{'destaccountcode':_0x26c977[_0x32f0('0x14')][_0x2bced4][_0x32f0('0x137')],'destconnectedlinenum':_0x13382c['calleridnum']});}}_0x536f43[_0x32f0('0x50')]+=0x1;logger['info'](_0x32f0('0x138'),_0x398ecb,_0x32f0('0xb3'),_0x536f43[_0x32f0('0x26')],_0x32f0('0xfb'),_0x536f43[_0x32f0('0x50')]);_0x5090d6(_0x346e34);})['catch'](function(_0x7ea8e0){ut['logAgent'](_0x13382c,0xe,_0x32f0('0x139'));rpcDb[_0x32f0('0xf2')](_0x13382c,_0x32f0('0x13a'));_0xde52d(_0x7ea8e0);});});};Preview[_0x32f0('0x65')]['syncNewExten']=function(_0x592b2b){if(this[_0x32f0('0x13')][_0x592b2b[_0x32f0('0xaf')]]){this[_0x32f0('0x13')][_0x592b2b[_0x32f0('0xaf')]][_0x32f0('0x77')]=_0x592b2b['channel'];}};Preview[_0x32f0('0x65')][_0x32f0('0x17')]=function(_0x31137a){var _0x2a815b=this;var _0x17881a=this[_0x32f0('0x13')][_0x31137a[_0x32f0('0x13b')]];if(_0x17881a){if(_0x17881a[_0x32f0('0x100')]&&this['agents'][_0x17881a[_0x32f0('0x100')]]){ut[_0x32f0('0x13c')](_0x17881a,this[_0x32f0('0x14')][_0x17881a['lookAgent']][_0x32f0('0x26')],this[_0x32f0('0x14')][_0x17881a[_0x32f0('0x100')]]['id']);}var _0x2a56ec=_['clone'](_0x17881a);_0x2a56ec[_0x32f0('0xb1')]=moment()['format'](_0x32f0('0x8e'));var _0x215257=_0x2a815b[_0x32f0('0x23')][_0x17881a[_0x32f0('0x6f')]];if(ut[_0x32f0('0x13d')](_0x31137a[_0x32f0('0x13e')])){if(_0x17881a['unlockAgent']){rpcDb['unlockContact'](_0x17881a[_0x32f0('0x102')]);}if(_0x17881a[_0x32f0('0xae')]){rpcDb[_0x32f0('0x8c')](_0x17881a[_0x32f0('0x102')]);}ami['emit'](_0x32f0('0x13f'),ut[_0x32f0('0xa1')](_0x17881a,_0x32f0('0x140'),this[_0x32f0('0x23')][_0x17881a[_0x32f0('0x6f')]]));this[_0x32f0('0xec')](_0x2a56ec,_0x215257,_0x31137a);}else{_0x17881a['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut[_0x32f0('0xf0')](_0x2a56ec,0x4,_0x32f0('0x141'));rpcDb['createAgentHistory'](_0x2a56ec,_0x32f0('0x142'));}}};Preview[_0x32f0('0x65')]['syncHangup']=function(_0x249f91){var _0x31c3cf=this;var _0x187325=this[_0x32f0('0x13')][_0x249f91['linkedid']];var _0x898594;if(_0x187325){_0x898594=this['campaignsPreview'][_0x187325[_0x32f0('0x6f')]];logger[_0x32f0('0x5b')](_0x32f0('0x143'),_0x249f91[_0x32f0('0xaf')],'\x20Queue',_0x898594[_0x32f0('0x26')],'pTalking:\x20',_0x898594['pTalking']);}if(this[_0x32f0('0x13')][_0x249f91['linkedid']]&&_0x249f91[_0x32f0('0xaf')]!==_0x249f91[_0x32f0('0xb2')]){if(_0x249f91['cause']==='16'&&this['actions'][_0x249f91[_0x32f0('0xaf')]][_0x32f0('0x71')]){this[_0x32f0('0x144')](_0x249f91,_0x249f91[_0x32f0('0xaf')],_0x249f91[_0x32f0('0x145')]);}else if(this['actions'][_0x249f91[_0x32f0('0xaf')]][_0x32f0('0x71')]){logger[_0x32f0('0x5b')](_0x32f0('0x146'),_0x249f91[_0x32f0('0xaf')],_0x249f91[_0x32f0('0x145')],_0x32f0('0xb3'),_0x898594[_0x32f0('0x26')],_0x32f0('0x70'),_0x898594[_0x32f0('0x2b')]);this['callProgressDetectingCustomer'](_0x249f91,_0x249f91['linkedid'],_0x249f91[_0x32f0('0x145')]);}}else if(_0x187325&&_[_0x32f0('0x83')](_0x187325[_0x32f0('0x147')])&&_0x898594[_0x32f0('0x148')]&&_0x249f91[_0x32f0('0xaf')]===_0x249f91[_0x32f0('0xb2')]&&_['isNil'](_0x249f91[_0x32f0('0xef')])&&_0x249f91[_0x32f0('0x145')]==='16'&&_0x249f91[_0x32f0('0x149')]==='6'&&_[_0x32f0('0xed')](_0x187325[_0x32f0('0x14a')])){if(_0x187325[_0x32f0('0xad')]){rpcDb[_0x32f0('0x14b')](_0x187325['idContact']);}if(_0x187325[_0x32f0('0xae')]){rpcDb[_0x32f0('0x8c')](_0x187325[_0x32f0('0x102')]);}_0x249f91[_0x32f0('0xef')]='22';this[_0x32f0('0xec')](_0x187325,_0x898594,_0x249f91);}else if(_0x187325&&_0x187325['transfer']){if(_0x249f91[_0x32f0('0x145')]==='16'&&this[_0x32f0('0x13')][_0x249f91[_0x32f0('0xaf')]][_0x32f0('0x71')]){logger[_0x32f0('0x5b')](_0x32f0('0x14c'),_0x249f91[_0x32f0('0xaf')],_0x249f91[_0x32f0('0x145')],_0x32f0('0xb3'),_0x898594[_0x32f0('0x26')],'pTalking:\x20',_0x898594[_0x32f0('0x2b')]);this[_0x32f0('0x144')](_0x249f91,_0x249f91[_0x32f0('0xaf')],_0x249f91['cause']);}else if(this[_0x32f0('0x13')][_0x249f91['linkedid']][_0x32f0('0x71')]){logger[_0x32f0('0x5b')](_0x32f0('0x146'),_0x249f91['linkedid'],_0x249f91['cause'],_0x32f0('0xb3'),_0x898594[_0x32f0('0x26')],_0x32f0('0x70'),_0x898594['pTalking']);this[_0x32f0('0x144')](_0x249f91,_0x249f91['linkedid'],_0x249f91[_0x32f0('0x145')]);}}};Preview[_0x32f0('0x65')][_0x32f0('0x1b')]=function(_0x1c2820){if(this['actions'][_0x1c2820[_0x32f0('0xeb')]]&&_0x1c2820['destlinkedid']!==_0x1c2820['destuniqueid']){this[_0x32f0('0x144')](_0x1c2820,_0x1c2820[_0x32f0('0xeb')],_0x1c2820[_0x32f0('0xe7')]);}};Preview[_0x32f0('0x65')][_0x32f0('0x14d')]=function(_0x3b5c55){if(this[_0x32f0('0x13')][_0x3b5c55[_0x32f0('0xaf')]]&&_0x3b5c55['linkedid']!==_0x3b5c55[_0x32f0('0xb2')]&&!this['actions'][_0x3b5c55[_0x32f0('0xaf')]][_0x32f0('0x71')]){if(_0x3b5c55[_0x32f0('0x145')]==='1'){this[_0x32f0('0x144')](_0x3b5c55,_0x3b5c55[_0x32f0('0xaf')],_0x3b5c55[_0x32f0('0x145')]);}}};Preview[_0x32f0('0x65')][_0x32f0('0x14e')]=function(_0x52c425,_0x2c938d,_0x40e8ae){if(this['actions'][_0x52c425]){if(_[_0x32f0('0x83')](this[_0x32f0('0x13')][_0x52c425][_0x32f0('0x14f')])){this[_0x32f0('0x13')][_0x52c425][_0x32f0('0x14f')]={};}this[_0x32f0('0x13')][_0x52c425][_0x32f0('0x14f')][_0x2c938d]=_0x40e8ae;}};Preview[_0x32f0('0x65')]['syncVarSet']=function(_0x5bb884){try{if(!_[_0x32f0('0x83')](_0x5bb884)){if(ut[_0x32f0('0x150')](_[_0x32f0('0x151')](_0x5bb884['variable'])[0x0])){this['addVariable'](_0x5bb884[_0x32f0('0xb2')],_[_0x32f0('0x151')](_0x5bb884[_0x32f0('0x152')])[0x0],_0x5bb884['value']);}}}catch(_0x4c8313){logger[_0x32f0('0x153')](_0x32f0('0x154'),util[_0x32f0('0x155')](_0x4c8313,{'showHidden':![],'depth':null}));}};Preview[_0x32f0('0x65')][_0x32f0('0x21')]=function(_0x340493){if(_0x340493){if(this[_0x32f0('0x13')][_0x340493[_0x32f0('0x156')]]){this[_0x32f0('0x13')][_0x340493['transfertargetlinkedid']][_0x32f0('0x14a')]=!![];}}};Preview[_0x32f0('0x65')][_0x32f0('0x22')]=function(_0x59df53){if(_0x59df53){if(this[_0x32f0('0x13')][_0x59df53['transfererlinkedid']]){this['actions'][_0x59df53[_0x32f0('0x157')]]['transfer']=!![];}}};module[_0x32f0('0x158')]=Preview; \ No newline at end of file +var _0x2b61=['dialNoAnswerRetryFrequency','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','cause-txt','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','\x20Queue','ANSWER','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Queue','lookAgent','isEmpty','execCall','Queue:\x20','idContact','called','Calling','Call\x20failed','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','starttime','variablesAction','destconnectedlinenum','user:%s','user:agentconnect','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','./util/util','redis','defaults','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','dialActive','setMessage','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','then','length','Agent','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','activeContact','responsetime','answertime','uniqueid','pTalking:\x20','custom:agentconnect','buildObj','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry'];(function(_0x1b3b90,_0x1d6ac0){var _0x52aac3=function(_0x9e9eb){while(--_0x9e9eb){_0x1b3b90['push'](_0x1b3b90['shift']());}};_0x52aac3(++_0x1d6ac0);}(_0x2b61,0x1dc));var _0x12b6=function(_0x3494e8,_0x4111ea){_0x3494e8=_0x3494e8-0x0;var _0x20bd8c=_0x2b61[_0x3494e8];return _0x20bd8c;};'use strict';var util=require('util');var _=require(_0x12b6('0x0'));var BPromise=require(_0x12b6('0x1'));var uuid=require(_0x12b6('0x2'));var moment=require(_0x12b6('0x3'));var md5=require(_0x12b6('0x4'));var Redis=require(_0x12b6('0x5'));var config=require(_0x12b6('0x6'));var logger=require(_0x12b6('0x7'))(_0x12b6('0x8'));var loggerAction=require(_0x12b6('0x7'))(_0x12b6('0x9'));var ami=require(_0x12b6('0xa'));var rpcDb=require('./rpcDb');var Action=require(_0x12b6('0xb'));var ut=require(_0x12b6('0xc'));config[_0x12b6('0xd')]=_[_0x12b6('0xe')](config[_0x12b6('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x12b6('0xd')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x500a5b){this['tail']=this[_0x12b6('0xf')]?this[_0x12b6('0xf')][_0x12b6('0x10')](_0x500a5b):_0x500a5b();};function Preview(_0x44a784){this[_0x12b6('0x11')]=new Sequence();this[_0x12b6('0x12')]=_0x44a784[_0x12b6('0x13')];this[_0x12b6('0x14')]=_0x44a784[_0x12b6('0x14')];this[_0x12b6('0x15')]={};this[_0x12b6('0x16')]=_0x44a784[_0x12b6('0x16')];this[_0x12b6('0x17')]=0x0;ami['on'](_0x12b6('0x18'),this[_0x12b6('0x19')][_0x12b6('0x1a')](this));ami['on'](_0x12b6('0x1b'),this[_0x12b6('0x1c')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x12b6('0x1a')](this));ami['on'](_0x12b6('0x1d'),this[_0x12b6('0x1e')]['bind'](this));ami['on'](_0x12b6('0x1f'),this[_0x12b6('0x20')][_0x12b6('0x1a')](this));ami['on']('varset',this[_0x12b6('0x21')][_0x12b6('0x1a')](this));ami['on'](_0x12b6('0x22'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x12b6('0x23'),this[_0x12b6('0x24')][_0x12b6('0x1a')](this));this[_0x12b6('0x25')](this[_0x12b6('0x12')]);}function emit(_0x1aceda,_0x1339c1,_0x14740e){io['to'](_0x1aceda)[_0x12b6('0x26')](_0x1339c1,_0x14740e);}function emitCampaignPreview(_0x3eca26){if(_0x3eca26[_0x12b6('0x27')]===_0x12b6('0x28')){var _0x18524={'id':_0x3eca26['id'],'name':_0x3eca26[_0x12b6('0x29')],'strategy':_0x3eca26[_0x12b6('0x2a')],'answered':_0x3eca26[_0x12b6('0x2b')],'available':_0x3eca26[_0x12b6('0x2c')],'loggedIn':_0x3eca26[_0x12b6('0x2d')],'pTalking':_0x3eca26[_0x12b6('0x2e')],'sumBillable':_0x3eca26[_0x12b6('0x2f')],'sumDuration':_0x3eca26[_0x12b6('0x30')],'sumHoldTime':_0x3eca26[_0x12b6('0x31')]||0x0,'talking':_0x3eca26[_0x12b6('0x32')],'total':_0x3eca26['total'],'type':_0x3eca26[_0x12b6('0x27')],'unmanaged':_0x3eca26[_0x12b6('0x33')],'abandoned':_0x3eca26['abandoned'],'waiting':_0x3eca26[_0x12b6('0x34')],'loggedInDb':_0x3eca26[_0x12b6('0x35')],'dialActive':_0x3eca26['dialActive'],'dialMethod':_0x3eca26[_0x12b6('0x36')],'dialOriginateCallerIdName':_0x3eca26[_0x12b6('0x37')],'dialOriginateCallerIdNumber':_0x3eca26[_0x12b6('0x38')],'dialOriginateTimeout':_0x3eca26[_0x12b6('0x39')],'dialPrefix':_0x3eca26[_0x12b6('0x3a')],'outboundAnswerAgiCallsDay':_0x3eca26[_0x12b6('0x3b')],'outboundAnswerCallsDay':_0x3eca26[_0x12b6('0x3c')],'outboundBlacklistCallsDay':_0x3eca26[_0x12b6('0x3d')],'outboundBusyCallsDay':_0x3eca26[_0x12b6('0x3e')],'outboundCongestionCallsDay':_0x3eca26[_0x12b6('0x3f')],'outboundDropCallsDayACS':_0x3eca26['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3eca26['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3eca26[_0x12b6('0x40')],'outboundNoAnswerCallsDay':_0x3eca26['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3eca26[_0x12b6('0x41')],'outboundOriginateFailureCallsDay':_0x3eca26['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x3eca26[_0x12b6('0x42')],'outboundRejectCallsDay':_0x3eca26[_0x12b6('0x43')],'outboundUnknownCallsDay':_0x3eca26[_0x12b6('0x44')],'outboundAbandonedCallsDay':_0x3eca26[_0x12b6('0x45')],'predictiveIntervalAnsweredCalls':_0x3eca26[_0x12b6('0x46')],'predictiveIntervalAvgHoldtime':_0x3eca26[_0x12b6('0x47')],'predictiveIntervalAvgTalktime':_0x3eca26[_0x12b6('0x48')],'predictiveIntervalDroppedCallsCallersExit':_0x3eca26['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3eca26[_0x12b6('0x49')],'predictiveIntervalErlangCalls':_0x3eca26[_0x12b6('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x3eca26[_0x12b6('0x4b')],'predictiveIntervalHitRate':_0x3eca26[_0x12b6('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x3eca26[_0x12b6('0x4d')],'predictiveIntervalPauses':_0x3eca26[_0x12b6('0x4e')],'predictiveIntervalAvailable':_0x3eca26['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x3eca26[_0x12b6('0x4f')],'message':_0x3eca26['message'],'originated':_0x3eca26['originated'],'erlangCalls':_0x3eca26[_0x12b6('0x50')],'erlangCallToSecond':_0x3eca26[_0x12b6('0x51')],'erlangAbandonmentRate':_0x3eca26[_0x12b6('0x52')],'erlangBusyFactor':_0x3eca26[_0x12b6('0x53')],'startPredictive':_0x3eca26['startPredictive'],'startProgressive':_0x3eca26['startProgressive']};if(_0x3eca26[_0x12b6('0x54')]){_0x18524[_0x12b6('0x54')]={'id':_0x3eca26['Trunk']['id'],'name':_0x3eca26[_0x12b6('0x54')][_0x12b6('0x29')],'active':_0x3eca26[_0x12b6('0x54')][_0x12b6('0x55')],'callerid':_0x3eca26[_0x12b6('0x54')][_0x12b6('0x56')]};}if(_0x3eca26[_0x12b6('0x57')]){_0x18524[_0x12b6('0x57')]={'id':_0x3eca26[_0x12b6('0x57')]['id'],'name':_0x3eca26[_0x12b6('0x57')][_0x12b6('0x29')]};}var _0x20e584=md5(JSON[_0x12b6('0x58')](_0x18524));if(_0x3eca26[_0x12b6('0x4')]!==_0x20e584){_0x3eca26[_0x12b6('0x4')]=_0x20e584;emit(util[_0x12b6('0x59')](_0x12b6('0x5a'),_0x18524[_0x12b6('0x29')]),_0x12b6('0x5b'),_0x18524);}}}function emitVoiceQueueChannelRemove(_0x47817e){logger[_0x12b6('0x5c')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x47817e));emit(util['format']('voice:queue:%s',_0x47817e[_0x12b6('0x29')]),_0x12b6('0x5d'),_0x47817e);io['emit'](_0x12b6('0x5e'),_0x47817e);}function notSendMessagesQueue(_0x301900){if(_0x301900[_0x12b6('0x5f')]){if(_0x301900[_0x12b6('0x60')]===0x0&&_0x301900['pTalking']===0x0){_0x301900[_0x12b6('0x5f')]=![];_0x301900['available']=0x0;_0x301900[_0x12b6('0x61')]=0x0;_0x301900[_0x12b6('0x62')]=_0x12b6('0x63');ut[_0x12b6('0x64')](_0x12b6('0x65'),_0x301900[_0x12b6('0x29')]+_0x12b6('0x66'));}else{_0x301900[_0x12b6('0x62')]=_0x12b6('0x67');ut[_0x12b6('0x64')](_0x12b6('0x65'),_0x301900[_0x12b6('0x29')]+_0x12b6('0x68'));}emitCampaignPreview(_0x301900);}}Preview[_0x12b6('0x69')][_0x12b6('0x25')]=function(){var _0x54fc2e=this;setInterval(function(){_0x54fc2e[_0x12b6('0x6a')]();},0x7cf);};Preview[_0x12b6('0x69')][_0x12b6('0x6a')]=function(){var _0xbc3c5d=this[_0x12b6('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x449a4a in _0xbc3c5d){if(_0xbc3c5d[_0x12b6('0x6b')](_0x449a4a)&&(_0xbc3c5d[_0x449a4a][_0x12b6('0x36')]===_0x12b6('0x8')||_0xbc3c5d[_0x449a4a]['dialMethod']==='booked')&&_0xbc3c5d[_0x449a4a][_0x12b6('0x27')]===_0x12b6('0x28')){if(this['clockClearZombieChannels']>0x7){this[_0x12b6('0x17')]=0x0;this[_0x12b6('0x6c')]();}}if(_0xbc3c5d[_0x12b6('0x6b')](_0x449a4a)&&_0xbc3c5d[_0x449a4a][_0x12b6('0x36')]==='preview'&&_0xbc3c5d[_0x449a4a][_0x12b6('0x27')]===_0x12b6('0x28')){if(_0xbc3c5d[_0x449a4a][_0x12b6('0x6d')]){this[_0x12b6('0x6e')](_0xbc3c5d[_0x449a4a]);this['recallMe'](_0xbc3c5d[_0x449a4a]);}else{notSendMessagesQueue(_0xbc3c5d[_0x449a4a]);}}}};Preview[_0x12b6('0x69')][_0x12b6('0x6f')]=function(_0x1f59b6){var _0x46e4a2=this;this[_0x12b6('0x11')]['enqueue'](function(){if(!_[_0x12b6('0x70')](_0x46e4a2[_0x12b6('0x15')][_0x1f59b6])){loggerAction['info'](_0x12b6('0x71'),_0x1f59b6,'Queue',_0x46e4a2[_0x12b6('0x15')][_0x1f59b6][_0x12b6('0x72')],_0x12b6('0x73'),JSON[_0x12b6('0x58')](_0x46e4a2[_0x12b6('0x12')][_0x46e4a2['actions'][_0x1f59b6][_0x12b6('0x72')]][_0x12b6('0x60')]),'pTalking:\x20',JSON[_0x12b6('0x58')](_0x46e4a2[_0x12b6('0x12')][_0x46e4a2[_0x12b6('0x15')][_0x1f59b6][_0x12b6('0x72')]][_0x12b6('0x2e')]),JSON[_0x12b6('0x58')](_0x46e4a2[_0x12b6('0x15')][_0x1f59b6][_0x12b6('0x74')]),JSON[_0x12b6('0x58')](_[_0x12b6('0x75')](_0x46e4a2[_0x12b6('0x15')][_0x1f59b6],[_0x12b6('0x76'),'UserId',_0x12b6('0x77'),_0x12b6('0x78')])));return ami[_0x12b6('0x79')]({'action':_0x12b6('0x7a'),'channel':_0x46e4a2[_0x12b6('0x15')][_0x1f59b6]['channel']})[_0x12b6('0x7b')](function(_0x31201c){if(_0x31201c[_0x12b6('0x62')]===_0x12b6('0x7c')){setTimeout(function(){if(_0x46e4a2[_0x12b6('0x15')][_0x1f59b6]){ut['updateOriginated'](_0x46e4a2[_0x12b6('0x12')][_0x46e4a2[_0x12b6('0x15')][_0x1f59b6][_0x12b6('0x72')]],_0x12b6('0x7d'));if(_0x46e4a2['actions'][_0x1f59b6][_0x12b6('0x74')]===!![]){ut[_0x12b6('0x7e')](_0x46e4a2[_0x12b6('0x12')][_0x46e4a2['actions'][_0x1f59b6][_0x12b6('0x72')]],_0x12b6('0x7d'));ut[_0x12b6('0x7f')](_0x12b6('0x80')+_0x1f59b6,_0x46e4a2[_0x12b6('0x15')][_0x1f59b6][_0x12b6('0x72')]);}ut[_0x12b6('0x7f')]('[Dialer][checkChannel][Preview]'+_0x1f59b6,_0x46e4a2['actions'][_0x1f59b6][_0x12b6('0x72')]);delete _0x46e4a2[_0x12b6('0x15')][_0x1f59b6];}},0x2328);}});}});};Preview['prototype'][_0x12b6('0x6c')]=function(){var _0x213637=this;loggerAction['info'](_0x12b6('0x81'),_['size'](this[_0x12b6('0x15')]));for(var _0x3a49b8 in this['actions']){if(_0x213637[_0x12b6('0x15')]['hasOwnProperty'](_0x3a49b8)){_0x213637[_0x12b6('0x6f')](_0x3a49b8);}}};Preview[_0x12b6('0x69')]['recallMe']=function(_0x576d3d){var _0x584e55=this;rpcDb[_0x12b6('0x82')](_0x576d3d['id'],ut['agentReadyId'](this['agents']))[_0x12b6('0x83')](function(_0xfb0909){if(!_[_0x12b6('0x70')](_0xfb0909)){for(var _0x44914c=0x0;_0x44914c<_0xfb0909[_0x12b6('0x84')];_0x44914c+=0x1){if(ut['getDiff'](_0xfb0909[_0x44914c]['scheduledat'])<_0x576d3d['dialRecallMeTimeout']*0x3c){if(_0xfb0909[_0x44914c]['Agent']&&!_0xfb0909[_0x44914c][_0x12b6('0x85')]['voicePause']){_0x584e55[_0x12b6('0x86')](_0xfb0909[_0x44914c]['id'])['then'](ut[_0x12b6('0x87')]('[RecallMe]'))[_0x12b6('0x7b')](ut[_0x12b6('0x87')](_0x12b6('0x88')));}else{rpcDb[_0x12b6('0x89')](_0xfb0909[_0x44914c]['id']);}}else{var _0x4415c6=new Action(_0xfb0909[_0x44914c],_0x576d3d);_0x4415c6['starttime']=moment()['format'](_0x12b6('0x8a'));_0x576d3d[_0x12b6('0x42')]+=0x1;ut[_0x12b6('0x8b')](_0x4415c6,0x17,'RecallInQueue');if(_0x576d3d[_0x12b6('0x8c')]){rpcDb[_0x12b6('0x8d')](ut[_0x12b6('0x8e')](_0xfb0909[_0x44914c]));rpcDb[_0x12b6('0x8f')](_0x4415c6,_0x12b6('0x90'));}else{ut['logCustomer'](_0x4415c6,0x16,_0x12b6('0x91'));rpcDb['createCustomerHistory'](_0x4415c6,_0x12b6('0x92'));rpcDb[_0x12b6('0x93')](_0x4415c6,_0x12b6('0x92'));}}}}})[_0x12b6('0x7b')](ut[_0x12b6('0x87')](_0x12b6('0x94')));};Preview['prototype'][_0x12b6('0x6e')]=function(_0x4b6241){_0x4b6241[_0x12b6('0x5f')]=!![];if(ut[_0x12b6('0x95')](_0x4b6241[_0x12b6('0x2d')])){_0x4b6241[_0x12b6('0x62')]=_0x12b6('0x96');}else if(!ut[_0x12b6('0x97')](_0x4b6241['dialActive'])){_0x4b6241['message']=_0x12b6('0x63');}else if(!this[_0x12b6('0x98')](_0x4b6241['Trunk'])){if(!this[_0x12b6('0x98')](_0x4b6241[_0x12b6('0x99')])){_0x4b6241[_0x12b6('0x62')]='TRUNK_IS_NOT_REACHABLE';}else{_0x4b6241['message']='ACTIVE';}}else{_0x4b6241[_0x12b6('0x62')]=_0x12b6('0x9a');}emitCampaignPreview(_0x4b6241);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x47694c,_0x41ca9d,_0x5e6fe5){var _0x333ba5=this;var _0x18b66c=this[_0x12b6('0x15')][_0x41ca9d];var _0x38f98e=this[_0x12b6('0x12')][_0x18b66c[_0x12b6('0x72')]];var _0x531cd9;if(_0x38f98e){switch(_0x5e6fe5){case'1':_0x38f98e[_0x12b6('0x41')]+=0x1;_0x18b66c[_0x12b6('0x9b')]+=0x1;_0x18b66c[_0x12b6('0x9c')]=ut[_0x12b6('0x9d')](_0x18b66c);ut['logCustomer'](_0x18b66c,0x0,_0x12b6('0x9e'));ami[_0x12b6('0x26')](_0x12b6('0x9f'),ut['buildObj'](_0x18b66c,_0x12b6('0xa0')));rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xa1'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut[_0x12b6('0xa3')](_0x18b66c,0xf,_0x12b6('0xa4'));rpcDb[_0x12b6('0x93')](_0x531cd9,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x18b66c[_0x12b6('0x9b')]>=_0x38f98e['dialNoSuchNumberMaxRetry']){rpcDb[_0x12b6('0x93')](_0x18b66c,_0x12b6('0xa5'));}else{rpcDb['rescheduleContact'](ut[_0x12b6('0xa6')](_0x18b66c,_0x12b6('0x9b'),_0x38f98e['dialNoSuchNumberRetryFrequency']),_0x18b66c[_0x12b6('0xa7')],_0x18b66c[_0x12b6('0xa8')]);}}delete this['actions'][_0x47694c['linkedid']];break;case'ANSWER':var _0x444453=moment()[_0x12b6('0x59')](_0x12b6('0x8a'));_0x18b66c[_0x12b6('0xa9')]=_0x444453;_0x18b66c[_0x12b6('0xaa')]=_0x444453;_0x18b66c[_0x12b6('0x74')]=!![];_0x38f98e[_0x12b6('0x2e')]+=0x1;logger[_0x12b6('0x5c')]('[syncHangup][talking][increment]',_0x18b66c[_0x12b6('0xab')],'\x20Queue',_0x38f98e[_0x12b6('0x29')],_0x12b6('0xac'),_0x38f98e['pTalking']);ami[_0x12b6('0x26')](_0x12b6('0xad'),ut[_0x12b6('0xae')](_0x18b66c,_0x12b6('0xaf'),this[_0x12b6('0x12')][_0x18b66c[_0x12b6('0x72')]]));if(_0x38f98e[_0x12b6('0xb0')]){ami[_0x12b6('0x26')]('custom:agentConnectPreview',ut[_0x12b6('0xb1')](_0x18b66c));}break;case'16':ami['emit'](_0x12b6('0xb2'),ut[_0x12b6('0xae')](_0x18b66c,_0x12b6('0xb3'),this[_0x12b6('0x12')][_0x18b66c[_0x12b6('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x12b6('0xae')](_0x18b66c,_0x12b6('0xb3')));_0x38f98e[_0x12b6('0x3c')]+=0x1;_0x38f98e['total']+=0x1;_0x38f98e[_0x12b6('0x2b')]+=0x1;ut[_0x12b6('0x7e')](_0x38f98e,_0x12b6('0xb4'));_0x18b66c[_0x12b6('0x9c')]=ut['totalGlobal'](_0x18b66c);ut['logCustomer'](_0x18b66c,0x4,_0x12b6('0xb5'));rpcDb[_0x12b6('0x8f')](_0x18b66c,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x12b6('0x93')](_0x18b66c,_0x12b6('0xb6'));rpcDb['crateCustomerReportQueue'](_0x18b66c);_0x38f98e['sumDuration']+=_0x18b66c[_0x12b6('0xb7')];_0x38f98e['sumBillable']+=_0x18b66c[_0x12b6('0xb7')];logger[_0x12b6('0x5c')]('[syncHangup][talking][decrement]',_0x18b66c['uniqueid'],'\x20Queue',_0x38f98e['name'],_0x12b6('0xac'),_0x38f98e[_0x12b6('0x2e')]);delete this[_0x12b6('0x15')][_0x47694c['linkedid']];break;case _0x12b6('0xb8'):_0x38f98e['outboundBusyCallsDay']+=0x1;_0x18b66c[_0x12b6('0xb9')]+=0x1;_0x18b66c[_0x12b6('0x9c')]=ut['totalGlobal'](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0x5,_0x12b6('0xba'));ami[_0x12b6('0x26')](_0x12b6('0xbb'),ut['buildObj'](_0x18b66c,_0x12b6('0xbc')));rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xbd'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e['dialGlobalMaxRetry']){_0x531cd9=ut[_0x12b6('0xa3')](_0x18b66c,0xf,_0x12b6('0xa4'));rpcDb[_0x12b6('0x93')](_0x531cd9,_0x12b6('0xbe'));}else{if(_0x18b66c[_0x12b6('0xb9')]>=_0x38f98e[_0x12b6('0xbf')]){rpcDb['createCustomerFinal'](_0x18b66c,_0x12b6('0xbd'));}else{rpcDb[_0x12b6('0xc0')](ut[_0x12b6('0xa6')](_0x18b66c,_0x12b6('0xb9'),_0x38f98e[_0x12b6('0xc1')]),_0x18b66c[_0x12b6('0xa7')],_0x18b66c['activeContact']);}}break;case _0x12b6('0xc2'):_0x38f98e[_0x12b6('0xc3')]+=0x1;_0x18b66c[_0x12b6('0xc4')]+=0x1;_0x18b66c['countglobal']=ut[_0x12b6('0x9d')](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0x3,'NoAnswer');ami[_0x12b6('0x26')](_0x12b6('0xc5'),ut[_0x12b6('0xae')](_0x18b66c,'noanswer'));rpcDb['createCustomerHistory'](_0x18b66c,_0x12b6('0xc6'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut[_0x12b6('0xa3')](_0x18b66c,0xf,'Global');rpcDb[_0x12b6('0x93')](_0x531cd9,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x18b66c[_0x12b6('0xc4')]>=_0x38f98e[_0x12b6('0xc7')]){rpcDb['createCustomerFinal'](_0x18b66c,_0x12b6('0xc6'));}else{rpcDb['rescheduleContact'](ut[_0x12b6('0xa6')](_0x18b66c,_0x12b6('0xc4'),_0x38f98e[_0x12b6('0xc8')]),_0x18b66c['unlockAgent'],_0x18b66c[_0x12b6('0xa8')]);}}break;case _0x12b6('0xc9'):_0x38f98e[_0x12b6('0x3f')]+=0x1;_0x18b66c['countcongestionretry']+=0x1;_0x18b66c[_0x12b6('0x9c')]=ut[_0x12b6('0x9d')](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0x8,_0x12b6('0xca'));ami[_0x12b6('0x26')](_0x12b6('0xcb'),ut[_0x12b6('0xae')](_0x18b66c,_0x12b6('0xcc')));rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xcd'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut[_0x12b6('0xa3')](_0x18b66c,0xf,_0x12b6('0xa4'));rpcDb[_0x12b6('0x93')](_0x531cd9,_0x12b6('0xce'));}else{if(_0x18b66c[_0x12b6('0xcf')]>=_0x38f98e['dialCongestionMaxRetry']){rpcDb['createCustomerFinal'](_0x18b66c,_0x12b6('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0x12b6('0xa6')](_0x18b66c,_0x12b6('0xcf'),_0x38f98e[_0x12b6('0xc1')]),_0x18b66c[_0x12b6('0xa7')],_0x18b66c[_0x12b6('0xa8')]);}}break;case _0x12b6('0xd0'):_0x38f98e['outboundRejectCallsDay']+=0x1;_0x18b66c[_0x12b6('0xd1')]+=0x1;_0x18b66c['countglobal']=ut['totalGlobal'](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0x14,'AgentReject');ami[_0x12b6('0x26')](_0x12b6('0xd2'),ut[_0x12b6('0xae')](_0x18b66c,'agentreject'));rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xd3'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut['cloneAction'](_0x18b66c,0x14,'AgentReject');rpcDb[_0x12b6('0x93')](_0x531cd9,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x18b66c[_0x12b6('0xd1')]>=_0x38f98e['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x18b66c,_0x12b6('0xd4'));}else{rpcDb[_0x12b6('0xc0')](ut[_0x12b6('0xa6')](_0x18b66c,_0x12b6('0xd1'),_0x38f98e['dialAgentRejectRetryFrequency']),_0x18b66c[_0x12b6('0xa7')],_0x18b66c[_0x12b6('0xa8')]);}}break;case _0x12b6('0xd5'):_0x38f98e['outboundAbandonedCallsDay']+=0x1;_0x18b66c[_0x12b6('0xd6')]+=0x1;_0x18b66c['countglobal']=ut[_0x12b6('0x9d')](_0x18b66c);ut['logCustomer'](_0x18b66c,0xb,_0x12b6('0xd7'));rpcDb['createCustomerHistory'](_0x18b66c,_0x12b6('0xd8'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut[_0x12b6('0xa3')](_0x18b66c,0xf,_0x12b6('0xa4'));rpcDb[_0x12b6('0x93')](_0x531cd9,_0x12b6('0xd8'));}else{if(_0x18b66c[_0x12b6('0xd9')]>=_0x38f98e[_0x12b6('0xda')]){rpcDb[_0x12b6('0x93')](_0x18b66c,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x12b6('0xc0')](ut['scheduledAt'](_0x18b66c,_0x12b6('0xd6'),_0x38f98e['dialAbandonedRetryFrequency']),_0x18b66c[_0x12b6('0xa7')],_0x18b66c[_0x12b6('0xa8')]);}}break;case'18':_0x38f98e[_0x12b6('0x44')]+=0x1;_0x18b66c['countmachineretry']+=0x1;_0x18b66c[_0x12b6('0x9c')]=ut[_0x12b6('0x9d')](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0x12,_0x47694c['cause-txt']||_0x47694c['dialstatus']);ami[_0x12b6('0x26')](_0x12b6('0xdb'),ut[_0x12b6('0xae')](_0x18b66c,_0x12b6('0xdc')));rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xdd'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut['cloneAction'](_0x18b66c,0xf,'Global');rpcDb[_0x12b6('0x93')](_0x531cd9,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x18b66c,_0x12b6('0xdd'));}delete this[_0x12b6('0x15')][_0x47694c[_0x12b6('0xde')]];break;case'19':_0x38f98e[_0x12b6('0x44')]+=0x1;_0x18b66c['countglobal']=ut['totalGlobal'](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0x13,_0x47694c[_0x12b6('0xdf')]||_0x47694c[_0x12b6('0xe0')]);ami[_0x12b6('0x26')](_0x12b6('0xdb'),ut[_0x12b6('0xae')](_0x18b66c,_0x12b6('0xdc')));rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xe1'));if(ut[_0x12b6('0x9d')](_0x18b66c)>=_0x38f98e['dialGlobalMaxRetry']){_0x531cd9=ut[_0x12b6('0xa3')](_0x18b66c,0xf,_0x12b6('0xa4'));rpcDb[_0x12b6('0x93')](_0x531cd9,_0x12b6('0xe1'));}else{rpcDb[_0x12b6('0x93')](_0x18b66c,'[callProgressDetectingCustomer][machine]');}delete this[_0x12b6('0x15')][_0x47694c[_0x12b6('0xde')]];break;default:if(_0x18b66c[_0x12b6('0x74')]){ut[_0x12b6('0x7e')](_0x38f98e,_0x12b6('0xe2'));ut[_0x12b6('0x7f')](_0x12b6('0xe3')+_0x38f98e['name'],_0x47694c);}_0x38f98e[_0x12b6('0x44')]+=0x1;_0x18b66c[_0x12b6('0x9c')]=ut[_0x12b6('0x9d')](_0x18b66c);ut[_0x12b6('0x8b')](_0x18b66c,0xc,_0x47694c[_0x12b6('0xdf')]||_0x47694c['dialstatus']);rpcDb[_0x12b6('0x8f')](_0x18b66c,_0x12b6('0xe4'));if(ut['totalGlobal'](_0x18b66c)>=_0x38f98e[_0x12b6('0xa2')]){_0x531cd9=ut['cloneAction'](_0x18b66c,0xf,'Global');rpcDb[_0x12b6('0x93')](_0x531cd9,_0x12b6('0xe5'));}else{rpcDb[_0x12b6('0x93')](_0x18b66c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x12b6('0x15')][_0x47694c[_0x12b6('0xde')]];}if(!(_0x18b66c[_0x12b6('0x74')]&&_0x5e6fe5==='16')){ut[_0x12b6('0xe6')](_0x38f98e,_0x12b6('0xe7'));logger[_0x12b6('0x5c')](_0x12b6('0xe8'),_0x18b66c['uniqueid'],_0x12b6('0xe9'),_0x38f98e['name'],_0x12b6('0x73'),_0x38f98e[_0x12b6('0x60')]);}if(_0x5e6fe5!==_0x12b6('0xea')){delete this['actions'][_0x47694c[_0x12b6('0xde')]];delete this[_0x12b6('0x15')][_0x47694c['destlinkedid']];}}};Preview[_0x12b6('0x69')]['callProgressDetectingAgent']=function(_0x5d7a34,_0x87467b,_0x29ce00){if(_[_0x12b6('0xeb')](_0x87467b)&&_0x12b6('0xec')!==typeof _0x87467b){return;}if(_['isUndefined'](_0x29ce00)&&_0x12b6('0xec')!==typeof _0x29ce00){return;}switch(_0x29ce00['reason']){case'0':ut[_0x12b6('0xed')](_0x5d7a34,0x0,_0x12b6('0x9e'));rpcDb[_0x12b6('0xee')](_0x5d7a34,_0x12b6('0xef'));break;case'3':ut[_0x12b6('0xed')](_0x5d7a34,0x3,_0x12b6('0xf0'));rpcDb[_0x12b6('0xee')](_0x5d7a34,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x5d7a34,0x5,'Busy');rpcDb[_0x12b6('0xee')](_0x5d7a34,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x12b6('0xed')](_0x5d7a34,0x8,'Congestion');rpcDb[_0x12b6('0xee')](_0x5d7a34,_0x12b6('0xf1'));break;case'22':ut[_0x12b6('0xed')](_0x5d7a34,0x16,_0x12b6('0xf2'));rpcDb[_0x12b6('0xee')](_0x5d7a34,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x12b6('0xed')](_0x5d7a34,0xc,_0x29ce00[_0x12b6('0xf3')]);rpcDb[_0x12b6('0xee')](_0x5d7a34,_0x12b6('0xf1'));}ut['updateOriginated'](_0x87467b,_0x12b6('0xf4'));logger[_0x12b6('0x5c')](_0x12b6('0xf5'),_0x5d7a34[_0x12b6('0xab')],'\x20Queue',_0x87467b['name'],_0x12b6('0x73'),_0x87467b[_0x12b6('0x60')]);delete this[_0x12b6('0x15')][_0x5d7a34[_0x12b6('0xab')]];};Preview[_0x12b6('0x69')][_0x12b6('0xf6')]=function(_0x46603a,_0x4629cf,_0x188599,_0x3cd450,_0x243ce2){var _0x23bbb5=this;return new BPromise(function(_0x531c30,_0x3b8206){if(_['isNil'](_0x4629cf)||_[_0x12b6('0x70')](_0x4629cf[_0x12b6('0xf7')])||_[_0x12b6('0x70')](_0x4629cf[_0x12b6('0xf7')][_0x12b6('0xf8')])||_['isNil'](_0x4629cf['VoiceQueueId'])){_0x3b8206(ut[_0x12b6('0x62')]('Contact\x20is\x20undefined',_0x3cd450,_0x243ce2));return;}var _0x12d458=uuid['v4']();var _0x2ddff1=_0x23bbb5['campaignsPreview'][_0x4629cf[_0x12b6('0xf9')][_0x12b6('0x29')]];var _0x504a24=_0x188599?_0x23bbb5['agents'][_0x188599]['id']:undefined;_0x23bbb5[_0x12b6('0x15')][_0x12d458]=new Action(_0x4629cf,_0x2ddff1,_0x12d458,_0x188599,_0x504a24);var _0x4415e2=_0x23bbb5['actions'][_0x12d458];_0x4415e2['unlockAgent']=_0x3cd450;_0x4415e2[_0x12b6('0xa8')]=_0x243ce2;_0x4415e2[_0x12b6('0xfa')]=_0x188599;if(_[_0x12b6('0xfb')](_0x46603a)){_0x23bbb5[_0x12b6('0xfc')](_0x4415e2,_0x2ddff1,_0x4629cf,_0x188599)[_0x12b6('0x83')](function(_0x4aa848){logger['info']('[Preview][execCall][success]',_0x12b6('0xfd')+_0x4415e2[_0x12b6('0x72')]+'\x20IdHopper:\x20'+_0x4415e2[_0x12b6('0xfe')],JSON[_0x12b6('0x58')](_0x4aa848));ami[_0x12b6('0x26')]('custom:agentcalled',ut[_0x12b6('0xae')](_0x4415e2,_0x12b6('0xff'),_0x23bbb5['campaignsPreview'][_0x4415e2['queue']]));_0x531c30(ut[_0x12b6('0x62')](_0x12b6('0x100')));})[_0x12b6('0x7b')](function(_0x2a72c6){ut[_0x12b6('0x64')]('[Preview][execCall][failure]',_0x2a72c6);_0x3b8206(ut[_0x12b6('0x62')](_0x12b6('0x101'),_0x3cd450,_0x243ce2));});}else{_0x2ddff1['outboundBlacklistCallsDay']+=0x1;ut[_0x12b6('0x102')](_0x4415e2);rpcDb[_0x12b6('0x103')](_0x4415e2,'[Blacklist][error]');delete _0x23bbb5[_0x12b6('0x15')][_0x12d458];_0x3b8206(ut[_0x12b6('0x62')](_0x12b6('0x104'),_0x3cd450,_0x243ce2));}});};Preview[_0x12b6('0x69')]['isTrunkReachable']=function(_0x14e32d){return!_['isNil'](_0x14e32d)&&!_[_0x12b6('0x70')](_0x14e32d['name'])&&!_['isNil'](_0x14e32d['active'])&&_0x14e32d[_0x12b6('0x55')]&&!_[_0x12b6('0x70')](this[_0x12b6('0x14')][util[_0x12b6('0x59')](_0x12b6('0x105'),_0x14e32d[_0x12b6('0x29')])])&&!_['isNil'](this[_0x12b6('0x14')][util[_0x12b6('0x59')]('SIP/%s',_0x14e32d[_0x12b6('0x29')])][_0x12b6('0x7a')])&&(this['trunks'][util[_0x12b6('0x59')](_0x12b6('0x105'),_0x14e32d['name'])][_0x12b6('0x7a')]===_0x12b6('0x106')||this[_0x12b6('0x14')][util[_0x12b6('0x59')](_0x12b6('0x105'),_0x14e32d[_0x12b6('0x29')])]['status']===_0x12b6('0x107'));};Preview[_0x12b6('0x69')][_0x12b6('0x86')]=function(_0x1cff9a,_0x28bda3){var _0x31617c=this;return new BPromise(function(_0x229723,_0xd6f6e5){_0x31617c[_0x12b6('0x108')](_0x1cff9a,_0x28bda3)['then'](function(_0x2d0283){_0x229723(_[_0x12b6('0x75')](_0x2d0283,[_0x12b6('0x62')]));})[_0x12b6('0x7b')](function(_0x4b42d2){if(_0x4b42d2[_0x12b6('0x109')]){rpcDb[_0x12b6('0x10a')](_0x1cff9a);}if(_0x4b42d2[_0x12b6('0x55')]){rpcDb['disableContact'](_0x1cff9a);}_0xd6f6e5(_[_0x12b6('0x75')](_0x4b42d2,[_0x12b6('0x62')]));});});};Preview[_0x12b6('0x69')]['execRun']=function(_0x307292,_0x16acee){var _0x2fea37=this;return new BPromise(function(_0x125fd5,_0x50795f){var _0x1b679d,_0x370b37;rpcDb[_0x12b6('0x10b')](_0x307292)[_0x12b6('0x83')](function(_0x51b484){if(!_['isNil'](_0x51b484[0x0])){_0x370b37=_0x51b484[0x0][_0x12b6('0x10c')]?![]:!![];_0x1b679d=_0x51b484[0x0][_0x12b6('0x10c')]?!![]:![];_0x1b679d=_0x16acee?!![]:_0x1b679d;}var _0x44bfbb=_0x2fea37[_0x12b6('0x10d')](_0x51b484);if(_0x44bfbb[_0x12b6('0x10e')]){rpcDb[_0x12b6('0x10f')](_[_0x12b6('0x75')](_0x51b484[0x0],[_0x12b6('0x77'),_0x12b6('0x110')]))[_0x12b6('0x83')](function(_0x1170aa){_0x2fea37[_0x12b6('0xf6')](_0x1170aa,_0x51b484[0x0],_0x16acee,_0x370b37,_0x1b679d)[_0x12b6('0x83')](function(_0x933b19){_0x125fd5(_0x933b19);})[_0x12b6('0x7b')](function(_0x4da23b){_0x50795f(_0x4da23b);});})[_0x12b6('0x7b')](function(_0x3be752){ut['logger'](_0x12b6('0x111'),_0x3be752);_0x50795f(ut[_0x12b6('0x62')](_0x12b6('0x112'),_0x370b37,_0x1b679d));});}else{_0x50795f(ut[_0x12b6('0x62')](_0x44bfbb[_0x12b6('0x62')],_0x370b37,_0x1b679d));}})[_0x12b6('0x7b')](function(_0x1a821e){ut['logger'](_0x12b6('0x113'),_0x1a821e);_0x50795f(ut[_0x12b6('0x62')](_0x12b6('0x112'),![],!![]));});});};Preview[_0x12b6('0x69')]['validateContact']=function(_0x4f407f){if(_[_0x12b6('0x70')](_0x4f407f)||_['isEmpty'](_0x4f407f)||!_['isNil'](_0x4f407f[0x0][_0x12b6('0x85')])&&_[_0x12b6('0x70')](_0x4f407f[0x0]['Agent'][_0x12b6('0x29')])){ut[_0x12b6('0x64')](_0x12b6('0x114'),_0x4f407f);return{'isValid':![],'message':_0x12b6('0x115')};}var _0x3731f8=this['campaignsPreview'][_0x4f407f[0x0][_0x12b6('0xf9')][_0x12b6('0x29')]];_0x3731f8[_0x12b6('0x62')]=_0x12b6('0x9a');if(_[_0x12b6('0x70')](_0x3731f8)){ut[_0x12b6('0x64')](_0x12b6('0x116'),_0x3731f8);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x3731f8[_0x12b6('0x54')])){ut[_0x12b6('0x64')](_0x12b6('0x117'),_0x12b6('0x118')+_0x3731f8['name']+_0x12b6('0x119'));if(!this[_0x12b6('0x98')](_0x3731f8[_0x12b6('0x99')])){ut[_0x12b6('0x64')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x3731f8[_0x12b6('0x29')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x12b6('0x11a')};}}if(!ut[_0x12b6('0x97')](_0x3731f8[_0x12b6('0x6d')])){ut[_0x12b6('0x64')](_0x12b6('0x11b'),_0x3731f8[_0x12b6('0x29')]+_0x12b6('0x11c'));return{'isValid':![],'message':_0x12b6('0x118')+_0x3731f8[_0x12b6('0x29')]+_0x12b6('0x11c')};}return{'isValid':!![],'message':_0x12b6('0x11d')};};Preview['prototype'][_0x12b6('0xfc')]=function(_0x2ba62c,_0x5037f2,_0x1bddde,_0xa4a1ff){var _0x51b838=this;return new BPromise(function(_0x549d66,_0x446c9c){var _0x320e3e=_0x2ba62c[_0x12b6('0xab')];var _0x7db9d5=_0x51b838[_0x12b6('0x98')](_0x5037f2[_0x12b6('0x54')])?util['format'](_0x12b6('0x11e'),_0x5037f2[_0x12b6('0x54')][_0x12b6('0x29')],_[_0x12b6('0x70')](_0x5037f2[_0x12b6('0x3a')])?'':_0x5037f2[_0x12b6('0x3a')]['trim']()||'',_0x5037f2['dialCutDigit']>0x0?_0x1bddde['Contact']['phone']['substring'](_0x5037f2['dialCutDigit']):_0x1bddde['Contact']['phone']):util[_0x12b6('0x59')](_0x12b6('0x11e'),_[_0x12b6('0x70')](_0x5037f2['TrunkBackup'])?_0x5037f2[_0x12b6('0x54')]['name']:_0x5037f2[_0x12b6('0x99')][_0x12b6('0x29')],_[_0x12b6('0x70')](_0x5037f2[_0x12b6('0x3a')])?'':_0x5037f2[_0x12b6('0x3a')][_0x12b6('0x11f')]()||'',_0x5037f2[_0x12b6('0x120')]>0x0?_0x1bddde[_0x12b6('0xf7')]['phone'][_0x12b6('0x121')](_0x5037f2[_0x12b6('0x120')]):_0x1bddde['Contact'][_0x12b6('0xf8')]);var _0x3af72e=_0x51b838['isTrunkReachable'](_0x5037f2[_0x12b6('0x54')])?ut[_0x12b6('0x122')](_0x5037f2[_0x12b6('0x54')][_0x12b6('0x56')],_0x5037f2['dialOriginateCallerIdName'],_0x5037f2[_0x12b6('0x123')]>0x0?ut[_0x12b6('0x124')](_0x5037f2[_0x12b6('0x38')],_0x5037f2[_0x12b6('0x123')]):_0x5037f2[_0x12b6('0x38')]):ut[_0x12b6('0x122')](_[_0x12b6('0x70')](_0x5037f2['TrunkBackup'])?_0x5037f2[_0x12b6('0x54')]['callerid']:_0x5037f2['TrunkBackup'][_0x12b6('0x56')],_0x5037f2['dialOriginateCallerIdName'],_0x5037f2[_0x12b6('0x123')]>0x0?ut[_0x12b6('0x124')](_0x5037f2[_0x12b6('0x38')],_0x5037f2[_0x12b6('0x123')]):_0x5037f2[_0x12b6('0x38')]);if(_0x3af72e){_0x2ba62c['originatecalleridname']=ut[_0x12b6('0x125')](_0x3af72e);_0x2ba62c[_0x12b6('0x126')]=ut[_0x12b6('0x127')](_0x3af72e);}var _0xc84545=ut['addVariables'](_0x5037f2,_0x1bddde,_0x7db9d5,_0x3af72e,_0x320e3e,_0x2ba62c);_[_0x12b6('0x128')](_0x2ba62c,ut[_0x12b6('0x129')](_0xc84545));_0x2ba62c[_0x12b6('0x12a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami[_0x12b6('0x79')](ut[_0x12b6('0x12b')](_0x2ba62c,_0x5037f2,_0xc84545,_0x2ba62c[_0x12b6('0xa8')],_0xa4a1ff))[_0x12b6('0x83')](function(_0x29d561){var _0x429ca7=_0x2ba62c['channelAgent'];if(!_[_0x12b6('0x70')](_0x429ca7)){if(!_['isNil'](_0x51b838[_0x12b6('0x16')][_0x429ca7])){_0x51b838[_0x12b6('0x16')][_0x429ca7][_0x12b6('0x12c')]=_0x2ba62c['calleridnum'];emit(util[_0x12b6('0x59')](_0x12b6('0x12d'),_0x51b838[_0x12b6('0x16')][_0x429ca7][_0x12b6('0x29')]),_0x12b6('0x12e'),{'destaccountcode':_0x51b838[_0x12b6('0x16')][_0x429ca7][_0x12b6('0x12f')],'destconnectedlinenum':_0x2ba62c['calleridnum']});}}_0x5037f2[_0x12b6('0x60')]+=0x1;logger[_0x12b6('0x5c')](_0x12b6('0x130'),_0x320e3e,_0x12b6('0xe9'),_0x5037f2[_0x12b6('0x29')],_0x12b6('0x73'),_0x5037f2[_0x12b6('0x60')]);_0x549d66(_0x29d561);})['catch'](function(_0x46486d){ut[_0x12b6('0xed')](_0x2ba62c,0xe,_0x12b6('0x131'));rpcDb[_0x12b6('0xee')](_0x2ba62c,_0x12b6('0x132'));_0x446c9c(_0x46486d);});});};Preview[_0x12b6('0x69')][_0x12b6('0x20')]=function(_0xa45841){if(this['actions'][_0xa45841[_0x12b6('0xde')]]){this[_0x12b6('0x15')][_0xa45841[_0x12b6('0xde')]][_0x12b6('0x133')]=_0xa45841['channel'];}};Preview[_0x12b6('0x69')][_0x12b6('0x19')]=function(_0x5232b1){var _0x2e0031=this;var _0x205501=this[_0x12b6('0x15')][_0x5232b1['actionid']];if(_0x205501){if(_0x205501[_0x12b6('0xfa')]&&this[_0x12b6('0x16')][_0x205501[_0x12b6('0xfa')]]){ut[_0x12b6('0x134')](_0x205501,this[_0x12b6('0x16')][_0x205501['lookAgent']]['name'],this[_0x12b6('0x16')][_0x205501[_0x12b6('0xfa')]]['id']);}var _0x2f2029=_[_0x12b6('0x135')](_0x205501);_0x2f2029[_0x12b6('0xa9')]=moment()[_0x12b6('0x59')](_0x12b6('0x8a'));var _0x2d6d11=_0x2e0031['campaignsPreview'][_0x205501[_0x12b6('0x72')]];if(ut[_0x12b6('0x136')](_0x5232b1['response'])){if(_0x205501[_0x12b6('0xa7')]){rpcDb[_0x12b6('0x10a')](_0x205501[_0x12b6('0xfe')]);}if(_0x205501[_0x12b6('0xa8')]){rpcDb[_0x12b6('0x89')](_0x205501[_0x12b6('0xfe')]);}ami['emit'](_0x12b6('0x137'),ut[_0x12b6('0xae')](_0x205501,_0x12b6('0x138'),this[_0x12b6('0x12')][_0x205501[_0x12b6('0x72')]]));this[_0x12b6('0x139')](_0x2f2029,_0x2d6d11,_0x5232b1);}else{_0x205501[_0x12b6('0x12a')]=moment()[_0x12b6('0x59')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x12b6('0xed')](_0x2f2029,0x4,_0x12b6('0xb5'));rpcDb[_0x12b6('0xee')](_0x2f2029,_0x12b6('0x13a'));}}};Preview[_0x12b6('0x69')][_0x12b6('0x1c')]=function(_0x32cd63){var _0x59b2a5=this;var _0x1c858f=this[_0x12b6('0x15')][_0x32cd63[_0x12b6('0xde')]];var _0x4e0f1c;if(_0x1c858f){_0x4e0f1c=this[_0x12b6('0x12')][_0x1c858f['queue']];logger[_0x12b6('0x5c')](_0x12b6('0x13b'),_0x32cd63['linkedid'],_0x12b6('0xe9'),_0x4e0f1c[_0x12b6('0x29')],_0x12b6('0xac'),_0x4e0f1c[_0x12b6('0x2e')]);}if(this[_0x12b6('0x15')][_0x32cd63['linkedid']]&&_0x32cd63['linkedid']!==_0x32cd63['uniqueid']){if(_0x32cd63[_0x12b6('0x13c')]==='16'&&this[_0x12b6('0x15')][_0x32cd63[_0x12b6('0xde')]][_0x12b6('0x74')]){this[_0x12b6('0x13d')](_0x32cd63,_0x32cd63[_0x12b6('0xde')],_0x32cd63[_0x12b6('0x13c')]);}else if(this[_0x12b6('0x15')][_0x32cd63[_0x12b6('0xde')]][_0x12b6('0x74')]){logger[_0x12b6('0x5c')](_0x12b6('0x13e'),_0x32cd63['linkedid'],_0x32cd63[_0x12b6('0x13c')],_0x12b6('0xe9'),_0x4e0f1c[_0x12b6('0x29')],_0x12b6('0xac'),_0x4e0f1c['pTalking']);this[_0x12b6('0x13d')](_0x32cd63,_0x32cd63[_0x12b6('0xde')],_0x32cd63['cause']);}}else if(_0x1c858f&&_[_0x12b6('0x70')](_0x1c858f[_0x12b6('0x13f')])&&_0x4e0f1c[_0x12b6('0x140')]&&_0x32cd63[_0x12b6('0xde')]===_0x32cd63[_0x12b6('0xab')]&&_['isNil'](_0x32cd63[_0x12b6('0xf3')])&&_0x32cd63[_0x12b6('0x13c')]==='16'&&_0x32cd63[_0x12b6('0x141')]==='6'&&_[_0x12b6('0xeb')](_0x1c858f['transfer'])){if(_0x1c858f['unlockAgent']){rpcDb[_0x12b6('0x10a')](_0x1c858f[_0x12b6('0xfe')]);}if(_0x1c858f[_0x12b6('0xa8')]){rpcDb['disableContact'](_0x1c858f[_0x12b6('0xfe')]);}_0x32cd63['reason']='22';this[_0x12b6('0x139')](_0x1c858f,_0x4e0f1c,_0x32cd63);}else if(_0x1c858f&&_0x1c858f[_0x12b6('0x142')]){if(_0x32cd63[_0x12b6('0x13c')]==='16'&&this[_0x12b6('0x15')][_0x32cd63[_0x12b6('0xde')]]['dialAnswer']){logger[_0x12b6('0x5c')]('[syncHangup][talking][transfer]',_0x32cd63[_0x12b6('0xde')],_0x32cd63[_0x12b6('0x13c')],_0x12b6('0xe9'),_0x4e0f1c['name'],_0x12b6('0xac'),_0x4e0f1c['pTalking']);this['callProgressDetectingCustomer'](_0x32cd63,_0x32cd63['linkedid'],_0x32cd63[_0x12b6('0x13c')]);}else if(this[_0x12b6('0x15')][_0x32cd63[_0x12b6('0xde')]]['dialAnswer']){logger[_0x12b6('0x5c')](_0x12b6('0x13e'),_0x32cd63[_0x12b6('0xde')],_0x32cd63[_0x12b6('0x13c')],_0x12b6('0xe9'),_0x4e0f1c['name'],_0x12b6('0xac'),_0x4e0f1c['pTalking']);this[_0x12b6('0x13d')](_0x32cd63,_0x32cd63['linkedid'],_0x32cd63[_0x12b6('0x13c')]);}}};Preview['prototype']['syncDialEnd']=function(_0x5351d8){if(this[_0x12b6('0x15')][_0x5351d8[_0x12b6('0x143')]]&&_0x5351d8['destlinkedid']!==_0x5351d8[_0x12b6('0x144')]){this[_0x12b6('0x13d')](_0x5351d8,_0x5351d8[_0x12b6('0x143')],_0x5351d8[_0x12b6('0xe0')]);}};Preview['prototype'][_0x12b6('0x145')]=function(_0x2289b3){if(this[_0x12b6('0x15')][_0x2289b3[_0x12b6('0xde')]]&&_0x2289b3[_0x12b6('0xde')]!==_0x2289b3[_0x12b6('0xab')]&&!this['actions'][_0x2289b3[_0x12b6('0xde')]]['dialAnswer']){if(_0x2289b3[_0x12b6('0x13c')]==='1'){this[_0x12b6('0x13d')](_0x2289b3,_0x2289b3[_0x12b6('0xde')],_0x2289b3[_0x12b6('0x13c')]);}}};Preview[_0x12b6('0x69')][_0x12b6('0x146')]=function(_0x5f2115,_0x45b8e5,_0x5df86f){if(this[_0x12b6('0x15')][_0x5f2115]){if(_[_0x12b6('0x70')](this[_0x12b6('0x15')][_0x5f2115][_0x12b6('0x147')])){this[_0x12b6('0x15')][_0x5f2115]['variables']={};}this[_0x12b6('0x15')][_0x5f2115][_0x12b6('0x147')][_0x45b8e5]=_0x5df86f;}};Preview[_0x12b6('0x69')][_0x12b6('0x21')]=function(_0x5af8e2){try{if(!_[_0x12b6('0x70')](_0x5af8e2)){if(ut[_0x12b6('0x148')](_[_0x12b6('0x149')](_0x5af8e2[_0x12b6('0x14a')])[0x0])){this[_0x12b6('0x146')](_0x5af8e2[_0x12b6('0xab')],_[_0x12b6('0x149')](_0x5af8e2[_0x12b6('0x14a')])[0x0],_0x5af8e2[_0x12b6('0x14b')]);}}}catch(_0x5d7e6d){logger[_0x12b6('0x14c')](_0x12b6('0x14d'),util['inspect'](_0x5d7e6d,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x12b6('0x14e')]=function(_0x3fa7e1){if(_0x3fa7e1){if(this['actions'][_0x3fa7e1[_0x12b6('0x14f')]]){this[_0x12b6('0x15')][_0x3fa7e1[_0x12b6('0x14f')]][_0x12b6('0x142')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x168292){if(_0x168292){if(this[_0x12b6('0x15')][_0x168292[_0x12b6('0x150')]]){this[_0x12b6('0x15')][_0x168292['transfererlinkedid']][_0x12b6('0x142')]=!![];}}};module[_0x12b6('0x151')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 4644055..2a03407 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 _0x0c22=['assigned','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','xcally-motion-preview','holdtime'];(function(_0x3251ab,_0x1b0f26){var _0x2f3a2a=function(_0x1858ad){while(--_0x1858ad){_0x3251ab['push'](_0x3251ab['shift']());}};_0x2f3a2a(++_0x1b0f26);}(_0x0c22,0xa6));var _0x20c2=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0c22[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0x20c2('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x20c2('0x1'));var _=require(_0x20c2('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x20c2('0x3'));var cmHopperBlack=require(_0x20c2('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x20c2('0x5'));var voiceQueueReport=require(_0x20c2('0x6'));function loggerCatch(_0x2bf6b9){return function(_0xbcedad){logger[_0x20c2('0x7')](_0x2bf6b9,util[_0x20c2('0x8')](_0xbcedad,{'showHidden':![],'depth':null}));};}function create(_0x6b1f81){return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopperHistory[_0x20c2('0xb')](_0x6b1f81))[_0x20c2('0xc')](loggerCatch(_0x20c2('0xd')));}function createAgent(_0x19c510){return BPromise['resolve']()['then'](agentReportPreview[_0x20c2('0xb')](_0x19c510))[_0x20c2('0xc')](loggerCatch(_0x20c2('0xd')));}function moveContact(_0x2237cf){return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopper['moveContactManagedDialer'](_0x2237cf,!![]))[_0x20c2('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x202d7b){return BPromise['resolve']()[_0x20c2('0xa')](cmHopperBlack['checkIsBlackList'](_0x202d7b))[_0x20c2('0xc')](loggerCatch(_0x20c2('0xe')));};exports[_0x20c2('0xf')]=function(_0x39a4b3){return BPromise[_0x20c2('0x9')]()['then'](cmHopper[_0x20c2('0xf')](_0x39a4b3))[_0x20c2('0xc')](loggerCatch(_0x20c2('0x10')));};exports[_0x20c2('0xb')]=function(_0x1215b7,_0x376733){create(_0x1215b7)['catch'](loggerCatch(_0x376733));moveContact(_0x1215b7)['catch'](loggerCatch(_0x376733));};exports[_0x20c2('0x11')]=function(_0x148376,_0x1c02fa){createAgent(_0x148376)[_0x20c2('0xc')](loggerCatch(_0x1c02fa));};exports[_0x20c2('0x12')]=function(_0x1495d7,_0x387e79){create(_0x1495d7)['catch'](loggerCatch(_0x387e79));};exports[_0x20c2('0x13')]=function(_0x1a1dd0,_0x14d9f5){moveContact(_0x1a1dd0)[_0x20c2('0xc')](loggerCatch(_0x14d9f5));};exports[_0x20c2('0x14')]=function(_0x3df8e7,_0x5260aa,_0xe545f9){if(_0x5260aa){_0x3df8e7[_0x20c2('0x15')]=null;}if(_0xe545f9){_0x3df8e7[_0x20c2('0x16')]=![];}return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopper[_0x20c2('0x14')](_0x3df8e7))[_0x20c2('0xc')](loggerCatch(_0x20c2('0x17')));};exports['countReScheduled']=function(_0x46959b){return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopper[_0x20c2('0x18')](_0x46959b))[_0x20c2('0xc')](loggerCatch(_0x20c2('0x19')));};exports[_0x20c2('0x1a')]=function(_0x2af358){return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopper[_0x20c2('0x1a')]({'UserId':null},_0x2af358,0x1))[_0x20c2('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0x20c2('0x1b')]=function(_0x4a512b){return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopper[_0x20c2('0x1a')]({'active':![]},_0x4a512b,0x1))[_0x20c2('0xc')](loggerCatch(_0x20c2('0x1c')));};exports[_0x20c2('0x1d')]=function(_0x41657d){var _0x4e2a11={};_0x4e2a11[_0x20c2('0x1e')]=_0x41657d[_0x20c2('0x1e')];_0x4e2a11[_0x20c2('0x1f')]=_0x41657d['uniqueid'];_0x4e2a11[_0x20c2('0x20')]=_0x41657d[_0x20c2('0x20')];_0x4e2a11[_0x20c2('0x21')]=_0x41657d[_0x20c2('0x21')];_0x4e2a11[_0x20c2('0x22')]=_0x41657d[_0x20c2('0x22')];_0x4e2a11[_0x20c2('0x23')]=_0x41657d[_0x20c2('0x24')];_0x4e2a11[_0x20c2('0x25')]=_0x41657d[_0x20c2('0x24')];_0x4e2a11[_0x20c2('0x26')]=0x1;_0x4e2a11[_0x20c2('0x27')]=_0x41657d[_0x20c2('0x28')];_0x4e2a11['connectedlinename']=_0x41657d[_0x20c2('0x29')];_0x4e2a11['context']=_0x20c2('0x2a');_0x4e2a11[_0x20c2('0x2b')]=_0x20c2('0x2c');_0x4e2a11[_0x20c2('0x2d')]=0x0;_0x4e2a11[_0x20c2('0x2e')]=0x1;_0x4e2a11['lastAssignedTo']=_0x41657d['membername'];_0x4e2a11['queuecallerexitreason']='COMPLETED';return BPromise[_0x20c2('0x9')]()['then'](voiceQueueReport[_0x20c2('0x2f')](_0x4e2a11))['catch'](loggerCatch(_0x20c2('0x30')));};exports[_0x20c2('0x31')]=function(_0x25fc39,_0x18d3b8){return BPromise[_0x20c2('0x9')]()[_0x20c2('0xa')](cmHopper['getContactRecallMe'](_0x25fc39,_0x18d3b8))['catch'](loggerCatch(_0x20c2('0x32')));};exports[_0x20c2('0x33')]=function(_0x381d2e){return BPromise['resolve']()[_0x20c2('0xa')](cmHopper[_0x20c2('0x14')](_0x381d2e,!![],!![]))[_0x20c2('0xc')](loggerCatch(_0x20c2('0x34')));}; \ No newline at end of file +var _0x9508=['queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime'];(function(_0x461a30,_0x4366bc){var _0x2e4a01=function(_0x56ba90){while(--_0x56ba90){_0x461a30['push'](_0x461a30['shift']());}};_0x2e4a01(++_0x4366bc);}(_0x9508,0x1b1));var _0x8950=function(_0x3c7317,_0xa8e2f6){_0x3c7317=_0x3c7317-0x0;var _0xd21f77=_0x9508[_0x3c7317];return _0xd21f77;};'use strict';var util=require('util');var BPromise=require(_0x8950('0x0'));var logger=require(_0x8950('0x1'))(_0x8950('0x2'));var _=require('lodash');var cmHopper=require(_0x8950('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x8950('0x4'));var cmHopperBlack=require(_0x8950('0x5'));var voiceQueueRt=require(_0x8950('0x6'));var agentReportPreview=require(_0x8950('0x7'));var voiceQueueReport=require(_0x8950('0x8'));function loggerCatch(_0x42212e){return function(_0x5e763f){logger[_0x8950('0x9')](_0x42212e,util[_0x8950('0xa')](_0x5e763f,{'showHidden':![],'depth':null}));};}function create(_0x4e6825){return BPromise[_0x8950('0xb')]()[_0x8950('0xc')](cmHopperHistory[_0x8950('0xd')](_0x4e6825))[_0x8950('0xe')](loggerCatch(_0x8950('0xf')));}function createAgent(_0x408804){return BPromise['resolve']()['then'](agentReportPreview['createHistory'](_0x408804))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3d22b6){return BPromise['resolve']()['then'](cmHopper[_0x8950('0x10')](_0x3d22b6,!![]))[_0x8950('0xe')](loggerCatch(_0x8950('0x11')));}exports['checkIsBlackList']=function(_0x383045){return BPromise[_0x8950('0xb')]()[_0x8950('0xc')](cmHopperBlack[_0x8950('0x12')](_0x383045))[_0x8950('0xe')](loggerCatch(_0x8950('0x13')));};exports['getContactPreview']=function(_0x122246){return BPromise[_0x8950('0xb')]()[_0x8950('0xc')](cmHopper[_0x8950('0x14')](_0x122246))[_0x8950('0xe')](loggerCatch(_0x8950('0x15')));};exports[_0x8950('0xd')]=function(_0x5c3428,_0x4ad360){create(_0x5c3428)[_0x8950('0xe')](loggerCatch(_0x4ad360));moveContact(_0x5c3428)[_0x8950('0xe')](loggerCatch(_0x4ad360));};exports[_0x8950('0x16')]=function(_0x46593f,_0x120973){createAgent(_0x46593f)[_0x8950('0xe')](loggerCatch(_0x120973));};exports[_0x8950('0x17')]=function(_0x16bf26,_0x31ccf5){create(_0x16bf26)[_0x8950('0xe')](loggerCatch(_0x31ccf5));};exports[_0x8950('0x18')]=function(_0x5e69e1,_0x30316d){moveContact(_0x5e69e1)[_0x8950('0xe')](loggerCatch(_0x30316d));};exports['rescheduleContact']=function(_0x17734d,_0x31b81c,_0x3fd79b){if(_0x31b81c){_0x17734d[_0x8950('0x19')]=null;}if(_0x3fd79b){_0x17734d[_0x8950('0x1a')]=![];}return BPromise[_0x8950('0xb')]()[_0x8950('0xc')](cmHopper['rescheduleContact'](_0x17734d))[_0x8950('0xe')](loggerCatch(_0x8950('0x1b')));};exports['countReScheduled']=function(_0x21d0ac){return BPromise['resolve']()[_0x8950('0xc')](cmHopper['countReScheduled'](_0x21d0ac))[_0x8950('0xe')](loggerCatch('[countReScheduled]\x20'));};exports[_0x8950('0x1c')]=function(_0xee767c){return BPromise[_0x8950('0xb')]()['then'](cmHopper[_0x8950('0x1c')]({'UserId':null},_0xee767c,0x1))[_0x8950('0xe')](loggerCatch(_0x8950('0x1d')));};exports[_0x8950('0x1e')]=function(_0x4dd4da){return BPromise[_0x8950('0xb')]()[_0x8950('0xc')](cmHopper[_0x8950('0x1c')]({'active':![]},_0x4dd4da,0x1))[_0x8950('0xe')](loggerCatch(_0x8950('0x1f')));};exports[_0x8950('0x20')]=function(_0x419ab3){var _0x131575={};_0x131575[_0x8950('0x21')]=_0x419ab3[_0x8950('0x21')];_0x131575[_0x8950('0x22')]=_0x419ab3['uniqueid'];_0x131575[_0x8950('0x23')]=_0x419ab3[_0x8950('0x23')];_0x131575[_0x8950('0x24')]=_0x419ab3['calleridname'];_0x131575[_0x8950('0x25')]=_0x419ab3[_0x8950('0x25')];_0x131575['queuecallerjoinAt']=_0x419ab3[_0x8950('0x26')];_0x131575[_0x8950('0x27')]=_0x419ab3[_0x8950('0x26')];_0x131575[_0x8950('0x28')]=0x1;_0x131575[_0x8950('0x29')]=_0x419ab3[_0x8950('0x2a')];_0x131575[_0x8950('0x2b')]=_0x419ab3['membername'];_0x131575[_0x8950('0x2c')]=_0x8950('0x2d');_0x131575[_0x8950('0x2e')]=_0x8950('0x2f');_0x131575[_0x8950('0x30')]=0x0;_0x131575[_0x8950('0x31')]=0x1;_0x131575['lastAssignedTo']=_0x419ab3[_0x8950('0x32')];_0x131575[_0x8950('0x33')]='COMPLETED';return BPromise[_0x8950('0xb')]()['then'](voiceQueueReport[_0x8950('0x34')](_0x131575))[_0x8950('0xe')](loggerCatch(_0x8950('0x35')));};exports[_0x8950('0x36')]=function(_0x3a944e,_0x502b6c){return BPromise[_0x8950('0xb')]()[_0x8950('0xc')](cmHopper[_0x8950('0x36')](_0x3a944e,_0x502b6c))[_0x8950('0xe')](loggerCatch(_0x8950('0x37')));};exports[_0x8950('0x38')]=function(_0x2a3a40){return BPromise['resolve']()[_0x8950('0xc')](cmHopper[_0x8950('0x39')](_0x2a3a40,!![],!![]))['catch'](loggerCatch(_0x8950('0x3a')));}; \ 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 1aacdf0..44262c6 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 _0x6e3e=['logger2','message','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','updatedAt','%s%s','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','state','membername','logCustomer','statedesc','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countnoanswerretry','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','env','milliseconds','diff','seconds','loggerCatch','inspect','info','error'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x6e3e,0x197));var _0xe6e3=function(_0x2eca53,_0x263548){_0x2eca53=_0x2eca53-0x0;var _0x2f60e8=_0x6e3e[_0x2eca53];return _0x2f60e8;};'use strict';var util=require(_0xe6e3('0x0'));var _=require(_0xe6e3('0x1'));var moment=require(_0xe6e3('0x2'));var logger=require(_0xe6e3('0x3'))(_0xe6e3('0x4'));var ipAgi=process[_0xe6e3('0x5')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x4a4a16,_0x41efcb){var _0x31a83a=moment(_0x4a4a16)[_0xe6e3('0x6')](0x0);var _0x5250ab=moment(_0x41efcb)[_0xe6e3('0x6')](0x0);return _0x31a83a[_0xe6e3('0x7')](_0x5250ab,_0xe6e3('0x8'));}exports[_0xe6e3('0x9')]=function(_0x13d05e){return function(_0x5d9b4e){logger['error'](_0x13d05e,util[_0xe6e3('0xa')](_0x5d9b4e,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x201177,_0x89047e){logger[_0xe6e3('0xb')](_0x201177,util[_0xe6e3('0xa')](_0x89047e,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x16dec5,_0x4f1c52){logger[_0xe6e3('0xc')](_0x16dec5,util[_0xe6e3('0xa')](_0x4f1c52,{'showHidden':![],'depth':null}));};exports[_0xe6e3('0xd')]=function(_0x50d0c7){return function(_0x568883){logger[_0xe6e3('0xb')](_0x50d0c7,util[_0xe6e3('0xa')](_0x568883,{'showHidden':![],'depth':null}));};};exports[_0xe6e3('0xe')]=function(_0x25d78e,_0x1df824,_0x31ed39){return{'message':_0x25d78e,'unlock':_0x1df824,'active':_0x31ed39};};exports['getCallerId']=function(_0x2fd551,_0xf03d22,_0x297662){if(!_['isUndefined'](_0x297662)&&'string'===typeof _0x297662&&!_[_0xe6e3('0xf')](_0x297662)){if(!_[_0xe6e3('0x10')](_0xf03d22)&&'string'===typeof _0xf03d22&&!_[_0xe6e3('0xf')](_0xf03d22)){return util[_0xe6e3('0x11')](_0xe6e3('0x12'),_0xf03d22,_0x297662);}return util[_0xe6e3('0x11')](_0xe6e3('0x12'),_0x297662,_0x297662);}if(!_['isUndefined'](_0x2fd551)&&_0xe6e3('0x13')===typeof _0x2fd551&&!_['isEmpty'](_0x2fd551)){return _0x2fd551;}return _0xe6e3('0x14');};exports['isActive']=function(_0x4d0418){if(_['isNil'](_0x4d0418)){return![];}return _0x4d0418;};exports[_0xe6e3('0x15')]=function(_0x1e8f96,_0x3bfba8,_0x7c350a,_0x1001dc,_0x6f7ddc,_0x40d3de){var _0x5aa5e4={'XMD-QUEUE':_0x3bfba8['Queue']?_0x3bfba8[_0xe6e3('0x16')][_0xe6e3('0x17')]:'','XMD-CALLERID':_0x1001dc,'XMD-CALLERID-PREVIEW':_0x40d3de?util[_0xe6e3('0x11')](_0xe6e3('0x12'),_0x40d3de[_0xe6e3('0x18')],_0x40d3de[_0xe6e3('0x19')]):_0x1001dc,'XMD-DIALID':_0x6f7ddc,'XMD-CONTACTID':_0x3bfba8[_0xe6e3('0x1a')],'XMD-CDRTYPE':_0xe6e3('0x1b'),'CALLERID(all)':_0x1001dc,'XMD-VOICEQUEUEID':_0x3bfba8[_0xe6e3('0x1c')],'XMD-DIALCHANNEL':_0x7c350a,'XMD-DIALTIMEOUT':_0x1e8f96[_0xe6e3('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xe6e3('0x11')](_0xe6e3('0x1e'),_0x1e8f96['dialQueueProject2']?'g':'',_[_0xe6e3('0xf')](_0x1e8f96[_0xe6e3('0x1f')])?'':_0xe6e3('0x20')),'XMD-DIALURL':_0x1e8f96[_0xe6e3('0x21')]||'','XMD-AGI':_0x1e8f96[_0xe6e3('0x22')]?util[_0xe6e3('0x11')](_0xe6e3('0x23'),ipAgi,_0x1e8f96[_0xe6e3('0x22')]):_0xe6e3('0x24'),'XMD-AGIAFTER':_0x1e8f96[_0xe6e3('0x25')]?util[_0xe6e3('0x11')](_0xe6e3('0x23'),ipAgi,_0x1e8f96['dialQueueProject2']):_0xe6e3('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x40d3de?_0x40d3de[_0xe6e3('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x40d3de?_0x40d3de[_0xe6e3('0x27')]:'','XMD-DESTINATION':_0xe6e3('0x28')};if(!_[_0xe6e3('0xf')](_0x1e8f96['monitor_format'])){_0x5aa5e4[util[_0xe6e3('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1e8f96['monitor_format'];_0x5aa5e4[util[_0xe6e3('0x11')]('%s',_0xe6e3('0x29'))]=_0x6f7ddc;}if(_0x3bfba8&&_0x3bfba8[_0xe6e3('0x2a')]){for(var _0x320416 in _0x3bfba8[_0xe6e3('0x2a')]){if(_0x3bfba8[_0xe6e3('0x2a')][_0xe6e3('0x2b')](_0x320416)){if(!_[_0xe6e3('0x2c')](_0x3bfba8['Contact'][_0x320416])&&_0x320416!=='id'&&_0x320416!==_0xe6e3('0x2d')&&_0x320416!=='createdAt'&&_0x320416!==_0xe6e3('0x2e')){_0x5aa5e4[util[_0xe6e3('0x11')](_0xe6e3('0x2f'),'XMD-',_[_0xe6e3('0x30')](_0x320416))]=_0x3bfba8[_0xe6e3('0x2a')][_0x320416];}}}}return _0x5aa5e4;};exports['toLowerVariables']=function(_0x368be3){var _0x13b2bd={};for(var _0x3e6849 in _0x368be3){if(_0x368be3[_0xe6e3('0x2b')](_0x3e6849)){_0x13b2bd[util['format']('%s',_['toLower'](_0x3e6849))]=_0x368be3[_0x3e6849];}}return{'variables':_0x13b2bd};};exports[_0xe6e3('0x31')]=function(_0x5de79d,_0x532dcb){if(!_[_0xe6e3('0x2c')](_0x5de79d)){if(_0x5de79d[_0xe6e3('0x2b')](_0xe6e3('0x32'))){if(_0x5de79d[_0xe6e3('0x32')]>0x0){_0x5de79d[_0xe6e3('0x32')]-=0x1;}else{logger[_0xe6e3('0xc')](_0xe6e3('0x33'),_0x532dcb);}}}else{logger[_0xe6e3('0xc')](_0xe6e3('0x34'),_0x532dcb);}};exports['logBlacklist']=function(_0x35ba82){var _0xad29e0=moment()[_0xe6e3('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x35ba82['state']=0xd;_0x35ba82['statedesc']=_0xe6e3('0x35');_0x35ba82[_0xe6e3('0x36')]=_0xad29e0;_0x35ba82[_0xe6e3('0x37')]=_0xad29e0;_0x35ba82[_0xe6e3('0x38')]=_0xad29e0;};exports['logAgent']=function(_0x32148d,_0x1c08ed,_0x2ee6f3){var _0x57dccd=moment()[_0xe6e3('0x11')](_0xe6e3('0x39'));_0x32148d[_0xe6e3('0x3a')]=_0x1c08ed;_0x32148d['statedesc']=_0x2ee6f3;_0x32148d['responsetime']=_0x57dccd;_0x32148d['ringtime']=getSeconds(_0x32148d[_0xe6e3('0x37')],_0x32148d[_0xe6e3('0x36')]);};exports['logLookAgent']=function(_0x464af3,_0x24e32a,_0x59e198){_0x464af3[_0xe6e3('0x3b')]=_0x24e32a;_0x464af3['UserId']=_0x59e198;};exports[_0xe6e3('0x3c')]=function(_0x4c61a7,_0x48d5a3,_0x58e793){var _0x251676=moment()[_0xe6e3('0x11')](_0xe6e3('0x39'));_0x4c61a7[_0xe6e3('0x3a')]=_0x48d5a3;_0x4c61a7[_0xe6e3('0x3d')]=_0x58e793;_0x4c61a7[_0xe6e3('0x37')]=_0x4c61a7['responsetime']?_0x4c61a7[_0xe6e3('0x37')]:_0x251676;_0x4c61a7[_0xe6e3('0x38')]=_0x4c61a7['endtime']?_0x4c61a7[_0xe6e3('0x38')]:_0x251676;_0x4c61a7[_0xe6e3('0x3e')]=getSeconds(_0x4c61a7[_0xe6e3('0x37')]||0x0,_0x4c61a7[_0xe6e3('0x36')]||0x0);_0x4c61a7['talktime']=_0x4c61a7[_0xe6e3('0x3f')]?getSeconds(_0x4c61a7[_0xe6e3('0x38')],_0x4c61a7[_0xe6e3('0x3f')]):0x0;};exports[_0xe6e3('0x40')]=function(_0x479ef5){return _0x479ef5===_0xe6e3('0x41');};exports[_0xe6e3('0x42')]=function(_0x337651,_0x40d14f,_0x474437,_0x1516c1,_0x48d55b){var _0x4cb544=_0x1516c1?_0xe6e3('0x43'):_0x337651['calleridname'];_0x4cb544=_0x48d55b?_0xe6e3('0x44'):_0x4cb544;return{'actionid':_0x337651[_0xe6e3('0x45')],'action':'originate','channel':_0x337651[_0xe6e3('0x46')],'callerid':util['format'](_0xe6e3('0x12'),_0x4cb544,_0x337651[_0xe6e3('0x19')]),'Exten':_0xe6e3('0x28'),'Context':'from-sip','Priority':'1','variable':_0x474437,'timeout':(_0x40d14f['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x337651[_0xe6e3('0x45')]};};exports[_0xe6e3('0x47')]=function(_0xa7b4d6){return _0xa7b4d6[_0xe6e3('0x48')]+_0xa7b4d6[_0xe6e3('0x49')]+_0xa7b4d6['countnoanswerretry']+_0xa7b4d6[_0xe6e3('0x4a')]+_0xa7b4d6[_0xe6e3('0x4b')];};exports[_0xe6e3('0x4c')]=function(_0x4cb63f){var _0x56fc2a=_[_0xe6e3('0x4d')](_0x4cb63f);_0x56fc2a[_0xe6e3('0x3a')]=0xf;_0x56fc2a[_0xe6e3('0x3d')]=_0xe6e3('0x4e');return _0x56fc2a;};exports[_0xe6e3('0x4f')]=function(_0x33303d,_0x46054d,_0x39aee3){var _0x44d256={};_0x44d256[_0x46054d]=_0x33303d[_0x46054d];_0x44d256[_0xe6e3('0x50')]=![];_0x44d256['scheduledat']=moment()[_0xe6e3('0x51')](_0x39aee3,'minutes')[_0xe6e3('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x44d256[_0xe6e3('0x1a')]=_0x33303d[_0xe6e3('0x1a')];_0x44d256[_0xe6e3('0x52')]=_0x33303d['ListId'];_0x44d256[_0xe6e3('0x1c')]=_0x33303d['VoiceQueueId']||undefined;return _0x44d256;};exports[_0xe6e3('0x53')]=function(_0x5ca944,_0x3d9c1a){if(!_[_0xe6e3('0x2c')](_0x5ca944)){if(_0x5ca944[_0xe6e3('0x54')]>0x0){_0x5ca944[_0xe6e3('0x54')]-=0x1;}else{logger[_0xe6e3('0xc')](_0x3d9c1a,_0xe6e3('0x55'));}}else{logger[_0xe6e3('0xc')](_0x3d9c1a,_0xe6e3('0x56'));}};exports[_0xe6e3('0x57')]=function(_0x2e03c8){if(_0x2e03c8<=0x0){return!![];}return![];};exports[_0xe6e3('0x58')]=function(_0x49f2a6,_0x2133fe,_0x4da938){_0x49f2a6[_0xe6e3('0x59')]=_0x2133fe;_0x49f2a6[_0xe6e3('0x17')]=_0x49f2a6[_0xe6e3('0x5a')];_0x49f2a6[_0xe6e3('0x5b')]=_0x49f2a6[_0xe6e3('0x46')];_0x49f2a6[_0xe6e3('0x5c')]=_0xe6e3('0x5d');if(_0x4da938){_0x49f2a6['mandatoryDisposition']=_0x4da938[_0xe6e3('0x5e')];}return _0x49f2a6;};exports['buildAcw']=function(_0x24c518){var _0x4594be={};_0x4594be[_0xe6e3('0x5a')]=_0x24c518['queue'];_0x4594be[_0xe6e3('0x5b')]=_0x24c518[_0xe6e3('0x46')];_0x4594be['uniqueid']=_0x24c518[_0xe6e3('0x45')];return _0x4594be;};exports[_0xe6e3('0x5f')]=function(_0x4a8fce){var _0x3441df=[];for(var _0x1424f2 in _0x4a8fce){if(_0x4a8fce[_0xe6e3('0x2b')](_0x1424f2)){if(!_[_0xe6e3('0x2c')](_0x4a8fce[_0x1424f2])&&_0x4a8fce[_0x1424f2][_0xe6e3('0x3a')]===_0xe6e3('0x60')&&_0x4a8fce[_0x1424f2][_0xe6e3('0x61')]===_0xe6e3('0x62')){_0x3441df['push'](_0x4a8fce[_0x1424f2]['id']);}}}return _0x3441df;};exports[_0xe6e3('0x63')]=function(_0x10330d){var _0x493592=moment()['milliseconds'](0x0);var _0xd18629=moment(_0x10330d)[_0xe6e3('0x6')](0x0);return _0x493592[_0xe6e3('0x7')](_0xd18629,'seconds');};exports[_0xe6e3('0x64')]=function(_0x4785fa){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4785fa[_0xe6e3('0x1a')],'ListId':_0x4785fa['ListId'],'VoiceQueueId':_0x4785fa[_0xe6e3('0x1c')]||undefined,'CampaignId':_0x4785fa[_0xe6e3('0x65')]||undefined};};exports[_0xe6e3('0x66')]=function(_0x95f990){if(_0x95f990===_0xe6e3('0x45')||_0x95f990===_0xe6e3('0x67')||_0x95f990===_0xe6e3('0x5a')||_0x95f990===_0xe6e3('0x68')||_0x95f990===_0xe6e3('0x69')||_0x95f990==='dialAnswer'||_0x95f990==='membername'||_0x95f990===_0xe6e3('0x46')||_0x95f990===_0xe6e3('0x18')||_0x95f990===_0xe6e3('0x50')||_0x95f990==='calleridnum'||_0x95f990===_0xe6e3('0x6a')||_0x95f990==='countbusyretry'||_0x95f990===_0xe6e3('0x49')||_0x95f990===_0xe6e3('0x6b')||_0x95f990==='countglobal'||_0x95f990==='callback'||_0x95f990===_0xe6e3('0x6c')||_0x95f990===_0xe6e3('0x6d')||_0x95f990===_0xe6e3('0x6e')||_0x95f990===_0xe6e3('0x1a')||_0x95f990===_0xe6e3('0x52')||_0x95f990===_0xe6e3('0x6f')||_0x95f990===_0xe6e3('0x1c')||_0x95f990===_0xe6e3('0x70')||_0x95f990===_0xe6e3('0x71')||_0x95f990===_0xe6e3('0x72')||_0x95f990===_0xe6e3('0x73')||_0x95f990===_0xe6e3('0x74')||_0x95f990===_0xe6e3('0x75')||_0x95f990===_0xe6e3('0x76')||_0x95f990===_0xe6e3('0x77')||_0x95f990===_0xe6e3('0x78')||_0x95f990==='xmd-dialchannel'||_0x95f990===_0xe6e3('0x79')||_0x95f990==='xmd-cdrtype'||_0x95f990==='xmd-callerid'||_0x95f990===_0xe6e3('0x7a')||_0x95f990==='xmd-agi'||_0x95f990===_0xe6e3('0x7b')||_0x95f990===_0xe6e3('0x7c')||_0x95f990===_0xe6e3('0x7d')||_0x95f990===_0xe6e3('0x7e')||_0x95f990===_0xe6e3('0x7f')||_0x95f990===_0xe6e3('0x80')||_0x95f990===_0xe6e3('0x81')||_0x95f990===_0xe6e3('0x82')||_0x95f990==='rtpaudioqos'||_0x95f990===_0xe6e3('0x7c')||_0x95f990===_0xe6e3('0x7d')||_0x95f990===_0xe6e3('0x7e')||_0x95f990===_0xe6e3('0x7f')||_0x95f990===_0xe6e3('0x80')||_0x95f990===_0xe6e3('0x81')||_0x95f990==='rtpaudioqosrttbridged'||_0x95f990===_0xe6e3('0x83')||_0x95f990===_0xe6e3('0x84')||_0x95f990===_0xe6e3('0x3a')||_0x95f990==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0xd84d9a,_0x44653b){var _0x10de02,_0x1be431,_0x4fa78a;if(_0x44653b<=0x0){_0x44653b=0x1;}_0x10de02=new RegExp(_0xe6e3('0x85')+_0x44653b+'}$');_0x1be431=Math[_0xe6e3('0x86')](0xa,_0x44653b-0x1);_0x4fa78a=Math[_0xe6e3('0x86')](0xa,_0x44653b)-0x1;return util[_0xe6e3('0x11')]('%s',_[_0xe6e3('0x87')](_0xd84d9a,_0x10de02,_[_0xe6e3('0x88')](_0x1be431,_0x4fa78a)));};exports[_0xe6e3('0x89')]=function(_0x32934d){var _0x5c389a=_0x32934d['match'](/"(.*?)"/);return _0x5c389a?_0x5c389a[0x1]:_0x32934d;};exports[_0xe6e3('0x8a')]=function(_0x42f54f){var _0x1c859b=_0x42f54f[_0xe6e3('0x8b')](/<(.*?)>/);return _0x1c859b?_0x1c859b[0x1]:_0x42f54f;}; \ No newline at end of file +var _0x90d8=['ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','replace','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','seconds','logger','info','loggerError','error','logger2','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','ringtime','starttime','logLookAgent','membername','answertime','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','calleridnum','xcally-motion-preview','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','scheduledat','minutes','ContactId'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x90d8,0x151));var _0x890d=function(_0xb4ec3a,_0x2bace0){_0xb4ec3a=_0xb4ec3a-0x0;var _0x1b83db=_0x90d8[_0xb4ec3a];return _0x1b83db;};'use strict';var util=require(_0x890d('0x0'));var _=require(_0x890d('0x1'));var moment=require(_0x890d('0x2'));var logger=require(_0x890d('0x3'))(_0x890d('0x4'));var ipAgi=process[_0x890d('0x5')]['XCALLY_IP_AGI']||_0x890d('0x6');function getSeconds(_0x4def57,_0x4be5df){var _0x304480=moment(_0x4def57)[_0x890d('0x7')](0x0);var _0x371601=moment(_0x4be5df)['milliseconds'](0x0);return _0x304480[_0x890d('0x8')](_0x371601,_0x890d('0x9'));}exports['loggerCatch']=function(_0x1413cf){return function(_0x143f34){logger['error'](_0x1413cf,util['inspect'](_0x143f34,{'showHidden':![],'depth':null}));};};exports[_0x890d('0xa')]=function(_0x37a9a8,_0x33d0ce){logger[_0x890d('0xb')](_0x37a9a8,util['inspect'](_0x33d0ce,{'showHidden':![],'depth':null}));};exports[_0x890d('0xc')]=function(_0x585500,_0x568425){logger[_0x890d('0xd')](_0x585500,util['inspect'](_0x568425,{'showHidden':![],'depth':null}));};exports[_0x890d('0xe')]=function(_0x5a5b12){return function(_0x1cd264){logger[_0x890d('0xb')](_0x5a5b12,util['inspect'](_0x1cd264,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5454e6,_0x504bcc,_0x24ba4a){return{'message':_0x5454e6,'unlock':_0x504bcc,'active':_0x24ba4a};};exports[_0x890d('0xf')]=function(_0x3ab8cd,_0x346cc0,_0x1a11bc){if(!_['isUndefined'](_0x1a11bc)&&_0x890d('0x10')===typeof _0x1a11bc&&!_[_0x890d('0x11')](_0x1a11bc)){if(!_['isUndefined'](_0x346cc0)&&_0x890d('0x10')===typeof _0x346cc0&&!_[_0x890d('0x11')](_0x346cc0)){return util[_0x890d('0x12')](_0x890d('0x13'),_0x346cc0,_0x1a11bc);}return util[_0x890d('0x12')](_0x890d('0x13'),_0x1a11bc,_0x1a11bc);}if(!_['isUndefined'](_0x3ab8cd)&&_0x890d('0x10')===typeof _0x3ab8cd&&!_[_0x890d('0x11')](_0x3ab8cd)){return _0x3ab8cd;}return _0x890d('0x14');};exports[_0x890d('0x15')]=function(_0x22f5ad){if(_[_0x890d('0x16')](_0x22f5ad)){return![];}return _0x22f5ad;};exports[_0x890d('0x17')]=function(_0x323cf8,_0x177b2a,_0x98d002,_0x4485f8,_0x962959,_0x19fe8c){var _0x5be258={'XMD-QUEUE':_0x177b2a[_0x890d('0x18')]?_0x177b2a[_0x890d('0x18')][_0x890d('0x19')]:'','XMD-CALLERID':_0x4485f8,'XMD-CALLERID-PREVIEW':_0x19fe8c?util[_0x890d('0x12')](_0x890d('0x13'),_0x19fe8c['calleridname'],_0x19fe8c['calleridnum']):_0x4485f8,'XMD-DIALID':_0x962959,'XMD-CONTACTID':_0x177b2a['ContactId'],'XMD-CDRTYPE':_0x890d('0x1a'),'CALLERID(all)':_0x4485f8,'XMD-VOICEQUEUEID':_0x177b2a[_0x890d('0x1b')],'XMD-DIALCHANNEL':_0x98d002,'XMD-DIALTIMEOUT':_0x323cf8[_0x890d('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x890d('0x1d'),_0x323cf8[_0x890d('0x1e')]?'g':'',_[_0x890d('0x11')](_0x323cf8['monitor_format'])?'':_0x890d('0x1f')),'XMD-DIALURL':_0x323cf8[_0x890d('0x20')]||'','XMD-AGI':_0x323cf8[_0x890d('0x21')]?util[_0x890d('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x323cf8['dialQueueProject']):_0x890d('0x22'),'XMD-AGIAFTER':_0x323cf8[_0x890d('0x1e')]?util[_0x890d('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x323cf8[_0x890d('0x1e')]):_0x890d('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x19fe8c?_0x19fe8c['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x19fe8c?_0x19fe8c[_0x890d('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x323cf8[_0x890d('0x24')])){_0x5be258[util['format']('%s',_0x890d('0x25'))]=_0x323cf8[_0x890d('0x24')];_0x5be258[util[_0x890d('0x12')]('%s',_0x890d('0x26'))]=_0x962959;}if(_0x177b2a&&_0x177b2a['Contact']){for(var _0xc77e9c in _0x177b2a['Contact']){if(_0x177b2a[_0x890d('0x27')][_0x890d('0x28')](_0xc77e9c)){if(!_[_0x890d('0x16')](_0x177b2a[_0x890d('0x27')][_0xc77e9c])&&_0xc77e9c!=='id'&&_0xc77e9c!==_0x890d('0x29')&&_0xc77e9c!=='createdAt'&&_0xc77e9c!==_0x890d('0x2a')){_0x5be258[util[_0x890d('0x12')](_0x890d('0x2b'),_0x890d('0x2c'),_[_0x890d('0x2d')](_0xc77e9c))]=_0x177b2a[_0x890d('0x27')][_0xc77e9c];}}}}return _0x5be258;};exports[_0x890d('0x2e')]=function(_0x5b6288){var _0x4f3fd4={};for(var _0xe999c0 in _0x5b6288){if(_0x5b6288[_0x890d('0x28')](_0xe999c0)){_0x4f3fd4[util[_0x890d('0x12')]('%s',_[_0x890d('0x2f')](_0xe999c0))]=_0x5b6288[_0xe999c0];}}return{'variables':_0x4f3fd4};};exports['updateOriginated']=function(_0x54f9e2,_0x1c1eba){if(!_['isNil'](_0x54f9e2)){if(_0x54f9e2[_0x890d('0x28')](_0x890d('0x30'))){if(_0x54f9e2[_0x890d('0x30')]>0x0){_0x54f9e2[_0x890d('0x30')]-=0x1;}else{logger[_0x890d('0xd')](_0x890d('0x31'),_0x1c1eba);}}}else{logger['error'](_0x890d('0x32'),_0x1c1eba);}};exports['logBlacklist']=function(_0x4b41e5){var _0x4233a3=moment()[_0x890d('0x12')](_0x890d('0x33'));_0x4b41e5[_0x890d('0x34')]=0xd;_0x4b41e5[_0x890d('0x35')]=_0x890d('0x36');_0x4b41e5['starttime']=_0x4233a3;_0x4b41e5[_0x890d('0x37')]=_0x4233a3;_0x4b41e5[_0x890d('0x38')]=_0x4233a3;};exports['logAgent']=function(_0x2b7879,_0x479605,_0x12cdf1){var _0x134f1d=moment()[_0x890d('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b7879[_0x890d('0x34')]=_0x479605;_0x2b7879[_0x890d('0x35')]=_0x12cdf1;_0x2b7879[_0x890d('0x37')]=_0x134f1d;_0x2b7879[_0x890d('0x39')]=getSeconds(_0x2b7879['responsetime'],_0x2b7879[_0x890d('0x3a')]);};exports[_0x890d('0x3b')]=function(_0x59da70,_0x1c12ea,_0x16c725){_0x59da70[_0x890d('0x3c')]=_0x1c12ea;_0x59da70['UserId']=_0x16c725;};exports['logCustomer']=function(_0x54668f,_0x6c03a4,_0x180716){var _0x654448=moment()['format'](_0x890d('0x33'));_0x54668f[_0x890d('0x34')]=_0x6c03a4;_0x54668f['statedesc']=_0x180716;_0x54668f[_0x890d('0x37')]=_0x54668f['responsetime']?_0x54668f['responsetime']:_0x654448;_0x54668f[_0x890d('0x38')]=_0x54668f['endtime']?_0x54668f[_0x890d('0x38')]:_0x654448;_0x54668f['ringtime']=getSeconds(_0x54668f[_0x890d('0x37')]||0x0,_0x54668f['starttime']||0x0);_0x54668f['talktime']=_0x54668f[_0x890d('0x3d')]?getSeconds(_0x54668f[_0x890d('0x38')],_0x54668f[_0x890d('0x3d')]):0x0;};exports['isFailure']=function(_0x2f220a){return _0x2f220a===_0x890d('0x3e');};exports[_0x890d('0x3f')]=function(_0x53fc0f,_0x151b54,_0x3bc46e,_0x4a055e,_0x733f0e){var _0x3083e2=_0x4a055e?'RECALL':_0x53fc0f[_0x890d('0x40')];_0x3083e2=_0x733f0e?_0x890d('0x41'):_0x3083e2;return{'actionid':_0x53fc0f[_0x890d('0x42')],'action':_0x890d('0x43'),'channel':_0x53fc0f['channelAgent'],'callerid':util[_0x890d('0x12')](_0x890d('0x13'),_0x3083e2,_0x53fc0f[_0x890d('0x44')]),'Exten':_0x890d('0x45'),'Context':_0x890d('0x46'),'Priority':'1','variable':_0x3bc46e,'timeout':(_0x151b54[_0x890d('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x53fc0f[_0x890d('0x42')]};};exports[_0x890d('0x48')]=function(_0x34f1b0){return _0x34f1b0['countbusyretry']+_0x34f1b0[_0x890d('0x49')]+_0x34f1b0[_0x890d('0x4a')]+_0x34f1b0[_0x890d('0x4b')]+_0x34f1b0['countnosuchnumberretry'];};exports[_0x890d('0x4c')]=function(_0x324d03){var _0x249ff6=_[_0x890d('0x4d')](_0x324d03);_0x249ff6[_0x890d('0x34')]=0xf;_0x249ff6[_0x890d('0x35')]='Global';return _0x249ff6;};exports[_0x890d('0x4e')]=function(_0x294448,_0x7fae80,_0x500b7c){var _0x272ed5={};_0x272ed5[_0x7fae80]=_0x294448[_0x7fae80];_0x272ed5[_0x890d('0x4f')]=![];_0x272ed5[_0x890d('0x50')]=moment()['add'](_0x500b7c,_0x890d('0x51'))[_0x890d('0x12')](_0x890d('0x33'));_0x272ed5[_0x890d('0x52')]=_0x294448['ContactId'];_0x272ed5[_0x890d('0x53')]=_0x294448[_0x890d('0x53')];_0x272ed5['VoiceQueueId']=_0x294448[_0x890d('0x1b')]||undefined;return _0x272ed5;};exports[_0x890d('0x54')]=function(_0x42bd8f,_0x5c6b7a){if(!_[_0x890d('0x16')](_0x42bd8f)){if(_0x42bd8f['pTalking']>0x0){_0x42bd8f['pTalking']-=0x1;}else{logger['error'](_0x5c6b7a,_0x890d('0x55'));}}else{logger[_0x890d('0xd')](_0x5c6b7a,_0x890d('0x56'));}};exports[_0x890d('0x57')]=function(_0x1f58bd){if(_0x1f58bd<=0x0){return!![];}return![];};exports['buildObj']=function(_0x475839,_0x1597c3,_0x3b4d10){_0x475839[_0x890d('0x58')]=_0x1597c3;_0x475839[_0x890d('0x19')]=_0x475839[_0x890d('0x59')];_0x475839[_0x890d('0x5a')]=_0x475839[_0x890d('0x5b')];_0x475839[_0x890d('0x5c')]=_0x890d('0x5d');if(_0x3b4d10){_0x475839[_0x890d('0x5e')]=_0x3b4d10[_0x890d('0x5e')];}return _0x475839;};exports[_0x890d('0x5f')]=function(_0x1617ed){var _0x5c0e9e={};_0x5c0e9e['queue']=_0x1617ed[_0x890d('0x59')];_0x5c0e9e[_0x890d('0x5a')]=_0x1617ed['channelAgent'];_0x5c0e9e[_0x890d('0x42')]=_0x1617ed[_0x890d('0x42')];return _0x5c0e9e;};exports['agentReadyId']=function(_0x35633e){var _0x128c21=[];for(var _0x42545b in _0x35633e){if(_0x35633e[_0x890d('0x28')](_0x42545b)){if(!_[_0x890d('0x16')](_0x35633e[_0x42545b])&&_0x35633e[_0x42545b][_0x890d('0x34')]==='not_inuse'&&_0x35633e[_0x42545b][_0x890d('0x60')]===_0x890d('0x61')){_0x128c21[_0x890d('0x62')](_0x35633e[_0x42545b]['id']);}}}return _0x128c21;};exports[_0x890d('0x63')]=function(_0x4913fa){var _0x37020c=moment()[_0x890d('0x7')](0x0);var _0x473c64=moment(_0x4913fa)[_0x890d('0x7')](0x0);return _0x37020c[_0x890d('0x8')](_0x473c64,_0x890d('0x9'));};exports[_0x890d('0x64')]=function(_0x486ab4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x486ab4[_0x890d('0x52')],'ListId':_0x486ab4[_0x890d('0x53')],'VoiceQueueId':_0x486ab4[_0x890d('0x1b')]||undefined,'CampaignId':_0x486ab4[_0x890d('0x65')]||undefined};};exports[_0x890d('0x66')]=function(_0x37bbe5){if(_0x37bbe5===_0x890d('0x42')||_0x37bbe5===_0x890d('0x67')||_0x37bbe5==='queue'||_0x37bbe5===_0x890d('0x68')||_0x37bbe5===_0x890d('0x69')||_0x37bbe5===_0x890d('0x6a')||_0x37bbe5===_0x890d('0x3c')||_0x37bbe5===_0x890d('0x5b')||_0x37bbe5===_0x890d('0x40')||_0x37bbe5===_0x890d('0x4f')||_0x37bbe5===_0x890d('0x44')||_0x37bbe5===_0x890d('0x50')||_0x37bbe5===_0x890d('0x6b')||_0x37bbe5===_0x890d('0x49')||_0x37bbe5===_0x890d('0x4a')||_0x37bbe5===_0x890d('0x6c')||_0x37bbe5==='callback'||_0x37bbe5===_0x890d('0x6d')||_0x37bbe5===_0x890d('0x6e')||_0x37bbe5===_0x890d('0x6f')||_0x37bbe5==='ContactId'||_0x37bbe5===_0x890d('0x53')||_0x37bbe5===_0x890d('0x70')||_0x37bbe5==='VoiceQueueId'||_0x37bbe5===_0x890d('0x71')||_0x37bbe5==='xmd-voicequeueid'||_0x37bbe5===_0x890d('0x72')||_0x37bbe5===_0x890d('0x73')||_0x37bbe5===_0x890d('0x74')||_0x37bbe5===_0x890d('0x75')||_0x37bbe5===_0x890d('0x76')||_0x37bbe5===_0x890d('0x77')||_0x37bbe5===_0x890d('0x78')||_0x37bbe5===_0x890d('0x79')||_0x37bbe5===_0x890d('0x7a')||_0x37bbe5===_0x890d('0x7b')||_0x37bbe5===_0x890d('0x7c')||_0x37bbe5===_0x890d('0x7d')||_0x37bbe5===_0x890d('0x7e')||_0x37bbe5===_0x890d('0x7f')||_0x37bbe5===_0x890d('0x80')||_0x37bbe5===_0x890d('0x81')||_0x37bbe5===_0x890d('0x82')||_0x37bbe5===_0x890d('0x83')||_0x37bbe5===_0x890d('0x84')||_0x37bbe5==='rtpaudioqosrtt'||_0x37bbe5===_0x890d('0x85')||_0x37bbe5==='rtpaudioqos'||_0x37bbe5===_0x890d('0x80')||_0x37bbe5===_0x890d('0x81')||_0x37bbe5===_0x890d('0x82')||_0x37bbe5===_0x890d('0x83')||_0x37bbe5===_0x890d('0x84')||_0x37bbe5===_0x890d('0x86')||_0x37bbe5===_0x890d('0x85')||_0x37bbe5===_0x890d('0x87')||_0x37bbe5===_0x890d('0x88')||_0x37bbe5==='state'||_0x37bbe5===_0x890d('0x35')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2647c5,_0x1e7244){var _0x4064b6,_0x318793,_0x513227;if(_0x1e7244<=0x0){_0x1e7244=0x1;}_0x4064b6=new RegExp('\x5cw{0,'+_0x1e7244+'}$');_0x318793=Math['pow'](0xa,_0x1e7244-0x1);_0x513227=Math['pow'](0xa,_0x1e7244)-0x1;return util[_0x890d('0x12')]('%s',_[_0x890d('0x89')](_0x2647c5,_0x4064b6,_['random'](_0x318793,_0x513227)));};exports['extractCalleridName']=function(_0x17939c){var _0x5da2e1=_0x17939c[_0x890d('0x8a')](/"(.*?)"/);return _0x5da2e1?_0x5da2e1[0x1]:_0x17939c;};exports[_0x890d('0x8b')]=function(_0x5d2ff3){var _0x284349=_0x5d2ff3['match'](/<(.*?)>/);return _0x284349?_0x284349[0x1]:_0x5d2ff3;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f725b7d..242a892 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 _0x4d64=['voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queuepause'];(function(_0x2e46dc,_0x49c51c){var _0x15d72f=function(_0x52aa9a){while(--_0x52aa9a){_0x2e46dc['push'](_0x2e46dc['shift']());}};_0x15d72f(++_0x49c51c);}(_0x4d64,0xd4));var _0x44d6=function(_0x2dcef2,_0x1727a8){_0x2dcef2=_0x2dcef2-0x0;var _0x4d65da=_0x4d64[_0x2dcef2];return _0x4d65da;};'use strict';exports[_0x44d6('0x0')]={'queue':{'type':_0x44d6('0x1'),'required':!![]},'interface':{'type':_0x44d6('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x44d6('0x2'),'required':![]},'paused':{'type':_0x44d6('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x44d6('0x1'),'required':!![]}};exports[_0x44d6('0x4')]={'interface':{'type':_0x44d6('0x1'),'required':!![]},'paused':{'type':_0x44d6('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x44d6('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x44d6('0x1'),'required':!![]}};exports[_0x44d6('0x5')]={'uniqueid':{'type':_0x44d6('0x1'),'required':!![]},'filename':{'type':_0x44d6('0x1')},'format':{'type':_0x44d6('0x1')},'mixmonitorid':{'type':_0x44d6('0x1')}};exports[_0x44d6('0x6')]={'uniqueid':{'type':_0x44d6('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x44d6('0x1'),'required':!![]},'exten':{'type':_0x44d6('0x1'),'required':!![]},'context':{'type':_0x44d6('0x1')}}; \ No newline at end of file +var _0x9860=['voicequeuechannel','voicechannel','string','number','boolean','queueremove','queuepause','reload'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9860,0x1e2));var _0x0986=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9860[_0x2dafbe];return _0x58a45a;};'use strict';exports['queueadd']={'queue':{'type':_0x0986('0x0'),'required':!![]},'interface':{'type':_0x0986('0x0'),'required':!![]},'membername':{'type':_0x0986('0x0'),'required':!![]},'penalty':{'type':_0x0986('0x1'),'required':![]},'paused':{'type':_0x0986('0x2'),'required':![]}};exports[_0x0986('0x3')]={'queue':{'type':_0x0986('0x0'),'required':!![]},'interface':{'type':_0x0986('0x0'),'required':!![]}};exports[_0x0986('0x4')]={'interface':{'type':_0x0986('0x0'),'required':!![]},'paused':{'type':_0x0986('0x2')},'reason':{'type':_0x0986('0x0'),'required':![]}};exports[_0x0986('0x5')]={'module':{'type':'string','required':![]}};exports[_0x0986('0x6')]={'uniqueid':{'type':_0x0986('0x0'),'required':!![]}};exports[_0x0986('0x7')]={'uniqueid':{'type':_0x0986('0x0'),'required':!![]},'filename':{'type':_0x0986('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0x0986('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x0986('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x0986('0x0'),'required':!![]},'exten':{'type':_0x0986('0x0'),'required':!![]},'context':{'type':_0x0986('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 50e9a88..8ce1380 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 _0xd4d8=['mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','initTelephones','isUndefined','telephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts'];(function(_0x53619c,_0x31ebf1){var _0x239167=function(_0x3d24d9){while(--_0x3d24d9){_0x53619c['push'](_0x53619c['shift']());}};_0x239167(++_0x31ebf1);}(_0xd4d8,0xb1));var _0x8d4d=function(_0x49588f,_0x3e56ea){_0x49588f=_0x49588f-0x0;var _0x41b293=_0xd4d8[_0x49588f];return _0x41b293;};'use strict';var BPromise=require(_0x8d4d('0x0'));var util=require(_0x8d4d('0x1'));var _=require(_0x8d4d('0x2'));var moment=require(_0x8d4d('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x8d4d('0x4'));var Trunk=require(_0x8d4d('0x5'));var VoiceQueue=require(_0x8d4d('0x6'));var Trigger=require(_0x8d4d('0x7'));var Template=require('../model/template');var Campaign=require(_0x8d4d('0x8'));var VoiceExtension=require(_0x8d4d('0x9'));var ZendeskAccount=require(_0x8d4d('0xa'));var SalesforceAccount=require(_0x8d4d('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8d4d('0xc'));var DeskAccount=require(_0x8d4d('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x8d4d('0xe'));var Dynamics365Account=require(_0x8d4d('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x8d4d('0x10'));var Realtime=function(){this[_0x8d4d('0x11')]={};this['telephones']={};this[_0x8d4d('0x12')]={};this[_0x8d4d('0x13')]={};this[_0x8d4d('0x14')]={};this[_0x8d4d('0x15')]={};this['templates']={};this[_0x8d4d('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8d4d('0x17')]={};this[_0x8d4d('0x18')]={};this[_0x8d4d('0x19')]={};this['outboundChannels']={};this[_0x8d4d('0x1a')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8d4d('0x1b')]={};this[_0x8d4d('0x1c')]={};this[_0x8d4d('0x1d')]={};this[_0x8d4d('0x1e')]={};this['deskAccounts']={};this[_0x8d4d('0x1f')]={};this[_0x8d4d('0x20')]={};this[_0x8d4d('0x21')]={};this[_0x8d4d('0x22')]={};this['faxAccounts']={};};function freeIsNotKey(_0x2a4071,_0x3924b5,_0x52ae84){var _0x2c161d=_[_0x8d4d('0x23')](_0x2a4071,function(_0xd4ffc2,_0x2cdaed){return _0xd4ffc2[_0x52ae84];});for(var _0x5c49c7 in _0x3924b5){if(_0x3924b5['hasOwnProperty'](_0x5c49c7)){if(!_0x2c161d[_0x5c49c7]){delete _0x3924b5[_0x5c49c7];}}}}function freeIsNotKeySip(_0x49b654,_0x3835d3){var _0x501c91=_[_0x8d4d('0x23')](_0x49b654,function(_0x1ed5c8,_0x5e9455){return util[_0x8d4d('0x24')](_0x8d4d('0x25'),_0x1ed5c8[_0x8d4d('0x26')]);});for(var _0x4b08d3 in _0x3835d3){if(_0x3835d3[_0x8d4d('0x27')](_0x4b08d3)){if(!_0x501c91[_0x4b08d3]){delete _0x3835d3[_0x4b08d3];}}}}function freeIsNotKeyAgent(_0x16b8b3,_0x504928){var _0x594221=_['mapKeys'](_0x16b8b3,function(_0x1a3708,_0x4b00b3){var _0x354877=_[_0x8d4d('0x28')](_0x1a3708[_0x8d4d('0x29')])?util[_0x8d4d('0x24')](_0x8d4d('0x25'),_0x1a3708['name']):_0x1a3708[_0x8d4d('0x29')];return _0x354877;});for(var _0x5f06d6 in _0x504928){if(_0x504928[_0x8d4d('0x27')](_0x5f06d6)){if(!_0x594221[_0x5f06d6]){delete _0x504928[_0x5f06d6];}}}}function clearVoiceCallReports(_0xd5b2d){_0xd5b2d[_0x8d4d('0x2a')]=0x0;_0xd5b2d[_0x8d4d('0x2b')]=0x0;_0xd5b2d[_0x8d4d('0x2c')]=0x0;_0xd5b2d[_0x8d4d('0x2d')]=0x0;_0xd5b2d[_0x8d4d('0x2e')]=0x0;}function clearCampaigns(_0x36f12c){if(!_[_0x8d4d('0x2f')](_0x36f12c)){for(var _0x5d7414 in _0x36f12c){if(_0x36f12c[_0x8d4d('0x27')](_0x5d7414)){_0x36f12c[_0x5d7414]['ivrTotalCallsDays']=0x0;_0x36f12c[_0x5d7414][_0x8d4d('0x30')]=0x0;}}}}function clearVoiceQueues(_0x173e8d){if(!_[_0x8d4d('0x2f')](_0x173e8d)){for(var _0x5a4302 in _0x173e8d){if(_0x173e8d[_0x8d4d('0x27')](_0x5a4302)){_0x173e8d[_0x5a4302]['total']=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x2b')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x31')]=0x0;_0x173e8d[_0x5a4302]['abandoned']=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x2c')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x2d')]=0x0;_0x173e8d[_0x5a4302]['sumBillable']=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x32')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x33')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x34')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x35')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x36')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x37')]=0x0;_0x173e8d[_0x5a4302]['outboundDropCallsDayTimeout']=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x38')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x39')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x3a')]=0x0;_0x173e8d[_0x5a4302]['outboundRejectCallsDay']=0x0;_0x173e8d[_0x5a4302]['outboundReCallsDay']=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x32')]=0x0;_0x173e8d[_0x5a4302][_0x8d4d('0x3b')]=0x0;_0x173e8d[_0x5a4302]['queueStatusComplete']=!![];}}}}Realtime[_0x8d4d('0x3c')][_0x8d4d('0x3d')]=function(_0x5e1595,_0x109221){for(var _0x123dfa in _0x109221){if(_0x5e1595[_0x8d4d('0x27')](_0x123dfa)){_0x5e1595[_0x123dfa]=_0x109221[_0x123dfa];}}};Realtime['prototype'][_0x8d4d('0x3e')]=function(){var _0xfa901e=this;return function(_0x43d821){if(_0x43d821){freeIsNotKeyAgent(_0x43d821,_0xfa901e[_0x8d4d('0x11')]);for(var _0x196bee=0x0,_0x4b9c78={},_0x807ed5={};_0x196bee<_0x43d821[_0x8d4d('0x3f')];_0x196bee+=0x1){_0x4b9c78=_0x43d821[_0x196bee];var _0x1063a2=_[_0x8d4d('0x28')](_0x4b9c78['interface'])?util[_0x8d4d('0x24')](_0x8d4d('0x25'),_0x4b9c78[_0x8d4d('0x26')]):_0x4b9c78['interface'];if(_['isUndefined'](_0xfa901e[_0x8d4d('0x11')][_0x1063a2])){_0xfa901e[_0x8d4d('0x11')][_0x1063a2]=new Agent(_0x4b9c78);}else{_0xfa901e[_0x8d4d('0x3d')](_0xfa901e[_0x8d4d('0x11')][_0x1063a2],_0x4b9c78);}}}return _0xfa901e[_0x8d4d('0x11')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x40')]=function(){var _0x4b9ad8=this;return function(_0x42e828){if(_0x42e828){freeIsNotKeySip(_0x42e828,_0x4b9ad8['telephones']);for(var _0x22e922=0x0,_0x54b6e7={},_0x580c64={};_0x22e922<_0x42e828[_0x8d4d('0x3f')];_0x22e922+=0x1){_0x54b6e7=_0x42e828[_0x22e922];if(_[_0x8d4d('0x41')](_0x4b9ad8['telephones'][util['format'](_0x8d4d('0x25'),_0x54b6e7[_0x8d4d('0x26')])])){_0x4b9ad8[_0x8d4d('0x42')][util[_0x8d4d('0x24')](_0x8d4d('0x25'),_0x54b6e7[_0x8d4d('0x26')])]=new Telephone(_0x54b6e7);}else{_0x4b9ad8[_0x8d4d('0x3d')](_0x4b9ad8[_0x8d4d('0x42')][util[_0x8d4d('0x24')](_0x8d4d('0x25'),_0x54b6e7[_0x8d4d('0x26')])],_0x54b6e7);}}}return _0x4b9ad8['telephones'];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x43')]=function(){var _0x4a5fe=this;return function(_0xaaefb3){if(_0xaaefb3){freeIsNotKeySip(_0xaaefb3,_0x4a5fe['trunks']);for(var _0x4d0134=0x0,_0x4b4254={},_0x30d735={};_0x4d0134<_0xaaefb3['length'];_0x4d0134+=0x1){_0x4b4254=_0xaaefb3[_0x4d0134];if(_[_0x8d4d('0x41')](_0x4a5fe[_0x8d4d('0x12')][util['format']('SIP/%s',_0x4b4254['name'])])){_0x4a5fe[_0x8d4d('0x12')][util[_0x8d4d('0x24')](_0x8d4d('0x25'),_0x4b4254[_0x8d4d('0x26')])]=new Trunk(_0x4b4254);}else{_0x4a5fe['mergeFromDatabase'](_0x4a5fe[_0x8d4d('0x12')][util['format'](_0x8d4d('0x25'),_0x4b4254[_0x8d4d('0x26')])],_0x4b4254);}}}return _0x4a5fe[_0x8d4d('0x12')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x44')]=function(){var _0x30eaef=this;return function(_0x4677ec){if(_0x4677ec){freeIsNotKey(_0x4677ec,_0x30eaef[_0x8d4d('0x13')],_0x8d4d('0x26'));for(var _0x2b3040=0x0,_0x14eb9b={},_0x388193={};_0x2b3040<_0x4677ec[_0x8d4d('0x3f')];_0x2b3040+=0x1){_0x14eb9b=_0x4677ec[_0x2b3040];if(_['isUndefined'](_0x30eaef[_0x8d4d('0x13')][_0x14eb9b['name']])){_0x30eaef[_0x8d4d('0x13')][_0x14eb9b[_0x8d4d('0x26')]]=new VoiceQueue(_0x14eb9b);}else{_0x30eaef[_0x8d4d('0x3d')](_0x30eaef[_0x8d4d('0x13')][_0x14eb9b[_0x8d4d('0x26')]],_0x14eb9b);}}}return _0x30eaef['voiceQueues'];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x45')]=function(){var _0xf0eb01=this;return function(_0x120966){if(_0x120966){freeIsNotKey(_0x120966,_0xf0eb01[_0x8d4d('0x14')],'id');for(var _0x2dcbca=0x0,_0x3b59b8={},_0xd89d0b={};_0x2dcbca<_0x120966[_0x8d4d('0x3f')];_0x2dcbca+=0x1){_0x3b59b8=_0x120966[_0x2dcbca];if(_[_0x8d4d('0x41')](_0xf0eb01[_0x8d4d('0x14')][_0x3b59b8['id']])){_0xf0eb01['triggers'][_0x3b59b8['id']]=new Trigger(_0x3b59b8);}else{_0xf0eb01['mergeFromDatabase'](_0xf0eb01[_0x8d4d('0x14')][_0x3b59b8['id']],_0x3b59b8);}}}return _0xf0eb01[_0x8d4d('0x14')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x46')]=function(){var _0x2f0290=this;return function(_0x35fea5){if(_0x35fea5){freeIsNotKey(_0x35fea5,_0x2f0290[_0x8d4d('0x47')],'id');for(var _0x4d07d9=0x0,_0x5dae7b={},_0x464f06={};_0x4d07d9<_0x35fea5['length'];_0x4d07d9+=0x1){_0x5dae7b=_0x35fea5[_0x4d07d9];if(_[_0x8d4d('0x41')](_0x2f0290[_0x8d4d('0x47')][_0x5dae7b['id']])){_0x2f0290[_0x8d4d('0x47')][_0x5dae7b['id']]=new Template(_0x5dae7b);}else{_0x2f0290[_0x8d4d('0x3d')](_0x2f0290[_0x8d4d('0x47')][_0x5dae7b['id']],_0x5dae7b);}}}return _0x2f0290['templates'];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x48')]=function(){var _0x5d16b2=this;return function(_0x5bb465){if(_0x5bb465){freeIsNotKey(_0x5bb465,_0x5d16b2[_0x8d4d('0x49')],'id');for(var _0x4f4b1f=0x0,_0x3f9561={},_0x2594d6={};_0x4f4b1f<_0x5bb465[_0x8d4d('0x3f')];_0x4f4b1f+=0x1){_0x3f9561=_0x5bb465[_0x4f4b1f];if(_[_0x8d4d('0x41')](_0x5d16b2[_0x8d4d('0x49')][_0x3f9561['id']])){_0x5d16b2[_0x8d4d('0x49')][_0x3f9561['id']]=new ZendeskAccount(_0x3f9561);}else{_0x5d16b2['mergeFromDatabase'](_0x5d16b2['zendeskAccounts'][_0x3f9561['id']],_0x3f9561);}}}return _0x5d16b2[_0x8d4d('0x49')];};};Realtime[_0x8d4d('0x3c')]['initSalesforceAccounts']=function(){var _0x288eaa=this;return function(_0x3ca69f){if(_0x3ca69f){freeIsNotKey(_0x3ca69f,_0x288eaa[_0x8d4d('0x1b')],'id');for(var _0x43c1b6=0x0,_0x5af740={},_0x19eb2b={};_0x43c1b6<_0x3ca69f[_0x8d4d('0x3f')];_0x43c1b6+=0x1){_0x5af740=_0x3ca69f[_0x43c1b6];if(_[_0x8d4d('0x41')](_0x288eaa[_0x8d4d('0x1b')][_0x5af740['id']])){_0x288eaa['salesforceAccounts'][_0x5af740['id']]=new SalesforceAccount(_0x5af740);}else{_0x288eaa['mergeFromDatabase'](_0x288eaa[_0x8d4d('0x1b')][_0x5af740['id']],_0x5af740);}}}return _0x288eaa[_0x8d4d('0x1b')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x4a')]=function(){var _0x44fd79=this;return function(_0x3bfc7a){if(_0x3bfc7a){freeIsNotKey(_0x3bfc7a,_0x44fd79[_0x8d4d('0x1d')],'id');for(var _0x428105=0x0,_0x42ec38={},_0x86f70f={};_0x428105<_0x3bfc7a[_0x8d4d('0x3f')];_0x428105+=0x1){_0x42ec38=_0x3bfc7a[_0x428105];if(_[_0x8d4d('0x41')](_0x44fd79['freshdeskAccounts'][_0x42ec38['id']])){_0x44fd79[_0x8d4d('0x1d')][_0x42ec38['id']]=new FreshdeskAccount(_0x42ec38);}else{_0x44fd79[_0x8d4d('0x3d')](_0x44fd79[_0x8d4d('0x1d')][_0x42ec38['id']],_0x42ec38);}}}return _0x44fd79[_0x8d4d('0x1d')];};};Realtime[_0x8d4d('0x3c')]['initZohoAccounts']=function(){var _0x1557cb=this;return function(_0x2ecd59){if(_0x2ecd59){freeIsNotKey(_0x2ecd59,_0x1557cb[_0x8d4d('0x1e')],'id');for(var _0x3f64ea=0x0,_0x4b2910={},_0x1084a0={};_0x3f64ea<_0x2ecd59[_0x8d4d('0x3f')];_0x3f64ea+=0x1){_0x4b2910=_0x2ecd59[_0x3f64ea];if(_[_0x8d4d('0x41')](_0x1557cb[_0x8d4d('0x1e')][_0x4b2910['id']])){_0x1557cb[_0x8d4d('0x1e')][_0x4b2910['id']]=new ZohoAccount(_0x4b2910);}else{_0x1557cb[_0x8d4d('0x3d')](_0x1557cb[_0x8d4d('0x1e')][_0x4b2910['id']],_0x4b2910);}}}return _0x1557cb[_0x8d4d('0x1e')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x4b')]=function(){var _0x223677=this;return function(_0x4e4e27){if(_0x4e4e27){freeIsNotKey(_0x4e4e27,_0x223677['deskAccounts'],'id');for(var _0x323e05=0x0,_0x33a4be={},_0x11e5c9={};_0x323e05<_0x4e4e27[_0x8d4d('0x3f')];_0x323e05+=0x1){_0x33a4be=_0x4e4e27[_0x323e05];if(_[_0x8d4d('0x41')](_0x223677[_0x8d4d('0x4c')][_0x33a4be['id']])){_0x223677[_0x8d4d('0x4c')][_0x33a4be['id']]=new DeskAccount(_0x33a4be);}else{_0x223677['mergeFromDatabase'](_0x223677[_0x8d4d('0x4c')][_0x33a4be['id']],_0x33a4be);}}}return _0x223677[_0x8d4d('0x4c')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x4d')]=function(){var _0x14a859=this;return function(_0x4f5f43){if(_0x4f5f43){freeIsNotKey(_0x4f5f43,_0x14a859['sugarcrmAccounts'],'id');for(var _0x13ed39=0x0,_0x57ee79={},_0x18157d={};_0x13ed39<_0x4f5f43[_0x8d4d('0x3f')];_0x13ed39+=0x1){_0x57ee79=_0x4f5f43[_0x13ed39];if(_['isUndefined'](_0x14a859[_0x8d4d('0x1c')][_0x57ee79['id']])){_0x14a859['sugarcrmAccounts'][_0x57ee79['id']]=new SugarcrmAccount(_0x57ee79);}else{_0x14a859[_0x8d4d('0x3d')](_0x14a859[_0x8d4d('0x1c')][_0x57ee79['id']],_0x57ee79);}}}return _0x14a859['sugarcrmAccounts'];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x4e')]=function(){var _0x3e0ad0=this;return function(_0x5822fa){if(_0x5822fa){freeIsNotKey(_0x5822fa,_0x3e0ad0[_0x8d4d('0x1f')],'id');for(var _0x2e910a=0x0,_0x4ef27e={},_0x4345e7={};_0x2e910a<_0x5822fa[_0x8d4d('0x3f')];_0x2e910a+=0x1){_0x4ef27e=_0x5822fa[_0x2e910a];if(_['isUndefined'](_0x3e0ad0['vtigerAccounts'][_0x4ef27e['id']])){_0x3e0ad0[_0x8d4d('0x1f')][_0x4ef27e['id']]=new VtigerAccount(_0x4ef27e);}else{_0x3e0ad0[_0x8d4d('0x3d')](_0x3e0ad0[_0x8d4d('0x1f')][_0x4ef27e['id']],_0x4ef27e);}}}return _0x3e0ad0[_0x8d4d('0x1f')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x4f')]=function(){var _0x58a078=this;return function(_0x2a535f){if(_0x2a535f){freeIsNotKey(_0x2a535f,_0x58a078['servicenowAccounts'],'id');for(var _0x297b60=0x0,_0x2ad216={},_0x57c27b={};_0x297b60<_0x2a535f['length'];_0x297b60+=0x1){_0x2ad216=_0x2a535f[_0x297b60];if(_['isUndefined'](_0x58a078['servicenowAccounts'][_0x2ad216['id']])){_0x58a078[_0x8d4d('0x20')][_0x2ad216['id']]=new ServicenowAccount(_0x2ad216);}else{_0x58a078['mergeFromDatabase'](_0x58a078['servicenowAccounts'][_0x2ad216['id']],_0x2ad216);}}}return _0x58a078[_0x8d4d('0x20')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x2429a5=this;return function(_0x428db0){if(_0x428db0){freeIsNotKey(_0x428db0,_0x2429a5[_0x8d4d('0x21')],'id');for(var _0x38b2a7=0x0,_0x15bf30={},_0x17f744={};_0x38b2a7<_0x428db0[_0x8d4d('0x3f')];_0x38b2a7+=0x1){_0x15bf30=_0x428db0[_0x38b2a7];if(_['isUndefined'](_0x2429a5['dynamics365Accounts'][_0x15bf30['id']])){_0x2429a5[_0x8d4d('0x21')][_0x15bf30['id']]=new Dynamics365Account(_0x15bf30);}else{_0x2429a5['mergeFromDatabase'](_0x2429a5[_0x8d4d('0x21')][_0x15bf30['id']],_0x15bf30);}}}return _0x2429a5[_0x8d4d('0x21')];};};Realtime['prototype'][_0x8d4d('0x50')]=function(){var _0xa81bf9=this;return function(_0x5831d8){if(_0x5831d8){freeIsNotKey(_0x5831d8,_0xa81bf9[_0x8d4d('0x22')],'id');for(var _0x1c3f27=0x0,_0x3bc2cd={},_0x91e051={};_0x1c3f27<_0x5831d8[_0x8d4d('0x3f')];_0x1c3f27+=0x1){_0x3bc2cd=_0x5831d8[_0x1c3f27];if(_[_0x8d4d('0x41')](_0xa81bf9['freshsalesAccounts'][_0x3bc2cd['id']])){_0xa81bf9[_0x8d4d('0x22')][_0x3bc2cd['id']]=new FreshsalesAccount(_0x3bc2cd);}else{_0xa81bf9[_0x8d4d('0x3d')](_0xa81bf9[_0x8d4d('0x22')][_0x3bc2cd['id']],_0x3bc2cd);}}}return _0xa81bf9[_0x8d4d('0x22')];};};Realtime['prototype'][_0x8d4d('0x51')]=function(){var _0x1bd81a=this;return function(_0x2a137c){for(var _0x51cfdd=0x0;_0x51cfdd<_0x2a137c[_0x8d4d('0x3f')];_0x51cfdd+=0x1){_[_0x8d4d('0x52')](_0x1bd81a[_0x8d4d('0x13')][_0x2a137c[_0x51cfdd][_0x8d4d('0x26')]],_0x2a137c[_0x51cfdd]);}return _0x1bd81a[_0x8d4d('0x13')];};};Realtime[_0x8d4d('0x3c')]['initVoiceQueueReports']=function(){var _0x19cd80=this;return function(_0xcdd525){clearVoiceQueues(_0x19cd80[_0x8d4d('0x13')]);if(_0xcdd525){_0xcdd525=_['groupBy'](_0xcdd525,'uniqueid');for(var _0x448464 in _0xcdd525){if(_0xcdd525['hasOwnProperty'](_0x448464)){var _0x720556={};for(var _0x4f38c7=0x0;_0x4f38c7<_0xcdd525[_0x448464][_0x8d4d('0x3f')];_0x4f38c7+=0x1){var _0x33fe5f=_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x53')];if(_0x19cd80['voiceQueues'][_0x33fe5f]){if(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x54')]){_0x19cd80[_0x8d4d('0x13')][_0x33fe5f]['unmanaged']+=0x1;}if(_0xcdd525[_0x448464][_0x4f38c7]['queuecallerabandon']){_0x19cd80[_0x8d4d('0x13')][_0x33fe5f][_0x8d4d('0x55')]+=0x1;}_0x19cd80[_0x8d4d('0x13')][_0x33fe5f][_0x8d4d('0x2c')]+=moment(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x56')])[_0x8d4d('0x57')](moment(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x58')]),_0x8d4d('0x59'))||0x0;if(_0x4f38c7===_0xcdd525[_0x448464][_0x8d4d('0x3f')]-0x1){_0x19cd80[_0x8d4d('0x13')][_0x33fe5f][_0x8d4d('0x2d')]+=moment(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x5a')]||_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x5b')]||_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x5c')])[_0x8d4d('0x57')](moment(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x58')]),_0x8d4d('0x59'))||0x0;_0x19cd80[_0x8d4d('0x13')][_0x33fe5f][_0x8d4d('0x2a')]+=0x1;if(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x5d')]){_0x19cd80[_0x8d4d('0x13')][_0x33fe5f][_0x8d4d('0x2b')]+=0x1;_0x19cd80['voiceQueues'][_0x33fe5f]['sumBillable']+=moment(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x5a')])[_0x8d4d('0x57')](moment(_0xcdd525[_0x448464][_0x4f38c7][_0x8d4d('0x56')]),_0x8d4d('0x59'))||0x0;}}else{_0x19cd80['voiceQueues'][_0x33fe5f][_0x8d4d('0x2d')]+=_0x19cd80[_0x8d4d('0x13')][_0x33fe5f][_0x8d4d('0x2c')]||0x0;}}}}}}return _0x19cd80['voiceQueues'];};};Realtime[_0x8d4d('0x3c')]['initVoiceCallReports']=function(){var _0x24e17e=this;return function(_0x4a1fd9){clearVoiceCallReports(_0x24e17e[_0x8d4d('0x16')]);if(_0x4a1fd9){for(var _0x1fec25=0x0;_0x1fec25<_0x4a1fd9[_0x8d4d('0x3f')];_0x1fec25+=0x1){_0x24e17e[_0x8d4d('0x16')]['total']+=0x1;_0x24e17e[_0x8d4d('0x16')][_0x8d4d('0x2d')]+=_0x4a1fd9[_0x1fec25]['duration'];if(_0x4a1fd9[_0x1fec25][_0x8d4d('0x5e')]===_0x8d4d('0x5f')){_0x24e17e['outbound'][_0x8d4d('0x2b')]+=0x1;_0x24e17e[_0x8d4d('0x16')][_0x8d4d('0x2c')]+=_0x4a1fd9[_0x1fec25][_0x8d4d('0x60')]-_0x4a1fd9[_0x1fec25][_0x8d4d('0x61')]||0x0;_0x24e17e[_0x8d4d('0x16')]['sumBillable']+=_0x4a1fd9[_0x1fec25]['billableseconds'];}}}return _0x24e17e[_0x8d4d('0x16')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x62')]=function(){var _0x329d6f=this;return function(_0x9e0183){if(_0x9e0183){freeIsNotKey(_0x9e0183,_0x329d6f[_0x8d4d('0x15')],_0x8d4d('0x26'));for(var _0x404d10=0x0,_0x24f0ce={};_0x404d10<_0x9e0183[_0x8d4d('0x3f')];_0x404d10+=0x1){_0x24f0ce=_0x9e0183[_0x404d10];if(_[_0x8d4d('0x41')](_0x329d6f['campaigns'][_0x24f0ce[_0x8d4d('0x26')]])){_0x329d6f[_0x8d4d('0x15')][_0x24f0ce[_0x8d4d('0x26')]]=new Campaign(_0x24f0ce);}else{_0x329d6f[_0x8d4d('0x3d')](_0x329d6f[_0x8d4d('0x15')][_0x24f0ce[_0x8d4d('0x26')]],_0x24f0ce);_0x329d6f[_0x8d4d('0x15')][_0x24f0ce['name']][_0x8d4d('0x63')]=_0x24f0ce['SquareProject']?_0x24f0ce[_0x8d4d('0x64')][_0x8d4d('0x26')]:undefined;}}}return _0x329d6f['campaigns'];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x65')]=function(){var _0x207b2b=this;return function(_0x3bdb3c){if(_0x3bdb3c){freeIsNotKey(_0x3bdb3c,_0x207b2b[_0x8d4d('0x17')],'id');for(var _0x305b3e=0x0,_0x2b9292={};_0x305b3e<_0x3bdb3c[_0x8d4d('0x3f')];_0x305b3e+=0x1){_0x2b9292=_0x3bdb3c[_0x305b3e];if(_[_0x8d4d('0x41')](_0x207b2b[_0x8d4d('0x17')][_0x2b9292['id']])){_0x207b2b[_0x8d4d('0x17')][_0x2b9292['id']]=new VoiceExtension(_0x2b9292);}else{_0x207b2b[_0x8d4d('0x3d')](_0x207b2b[_0x8d4d('0x17')][_0x2b9292['id']],_0x2b9292);}}}return _0x207b2b['voiceExtensions'];};};Realtime['prototype'][_0x8d4d('0x66')]=function(){var _0x1865a7=this;return function(_0x976fd){clearCampaigns(_0x1865a7['campaigns']);for(var _0x508190=0x0;_0x508190<_0x976fd['length'];_0x508190+=0x1){_[_0x8d4d('0x52')](_0x1865a7[_0x8d4d('0x15')][_0x976fd[_0x508190]['name']],_0x976fd[_0x508190]);}return _0x1865a7[_0x8d4d('0x15')];};};Realtime[_0x8d4d('0x3c')][_0x8d4d('0x67')]=function(){var _0x1b27ae=this;return function(_0xd06720){if(_0xd06720){freeIsNotKey(_0xd06720,_0x1b27ae[_0x8d4d('0x68')],'id');for(var _0x49978f=0x0,_0x9d61f2={},_0x5ef075={};_0x49978f<_0xd06720['length'];_0x49978f+=0x1){_0x9d61f2=_0xd06720[_0x49978f];if(_[_0x8d4d('0x41')](_0x1b27ae[_0x8d4d('0x68')][_0x9d61f2['id']])){_0x1b27ae['faxAccounts'][_0x9d61f2['id']]=new FaxAccount(_0x9d61f2);}else{_0x1b27ae[_0x8d4d('0x3d')](_0x1b27ae[_0x8d4d('0x68')][_0x9d61f2['id']],_0x9d61f2);}}}return _0x1b27ae[_0x8d4d('0x68')];};};module[_0x8d4d('0x69')]=Realtime; \ No newline at end of file +var _0x94b2=['initFreshsalesAccounts','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','diff','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','sumHoldTime','sumBillable','ivrAnswerCallsDay','isEmpty','answered','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','mergeFromDatabase','prototype','initAgents','isUndefined','initTelephones','length','initTrunks','initVoiceQueues','triggers','initTemplates','initZendeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initDynamics365Accounts'];(function(_0x4b171f,_0x2bdadd){var _0x2d5398=function(_0x252ca3){while(--_0x252ca3){_0x4b171f['push'](_0x4b171f['shift']());}};_0x2d5398(++_0x2bdadd);}(_0x94b2,0x153));var _0x294b=function(_0x265522,_0x17c145){_0x265522=_0x265522-0x0;var _0x28fd7f=_0x94b2[_0x265522];return _0x28fd7f;};'use strict';var BPromise=require(_0x294b('0x0'));var util=require(_0x294b('0x1'));var _=require(_0x294b('0x2'));var moment=require(_0x294b('0x3'));var Agent=require(_0x294b('0x4'));var Telephone=require(_0x294b('0x5'));var Trunk=require(_0x294b('0x6'));var VoiceQueue=require(_0x294b('0x7'));var Trigger=require(_0x294b('0x8'));var Template=require(_0x294b('0x9'));var Campaign=require(_0x294b('0xa'));var VoiceExtension=require(_0x294b('0xb'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x294b('0xc'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x294b('0xd'));var ZohoAccount=require(_0x294b('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x294b('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x294b('0x10'));var FaxAccount=require(_0x294b('0x11'));var Realtime=function(){this[_0x294b('0x12')]={};this[_0x294b('0x13')]={};this[_0x294b('0x14')]={};this[_0x294b('0x15')]={};this['triggers']={};this[_0x294b('0x16')]={};this[_0x294b('0x17')]={};this[_0x294b('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x294b('0x19')]={};this[_0x294b('0x1a')]={};this[_0x294b('0x1b')]={};this[_0x294b('0x1c')]={};this[_0x294b('0x1d')]={};this['settings']={};this[_0x294b('0x1e')]={};this[_0x294b('0x1f')]={};this[_0x294b('0x20')]={};this[_0x294b('0x21')]={};this[_0x294b('0x22')]={};this[_0x294b('0x23')]={};this[_0x294b('0x24')]={};this[_0x294b('0x25')]={};this[_0x294b('0x26')]={};this[_0x294b('0x27')]={};this[_0x294b('0x28')]={};};function freeIsNotKey(_0x148519,_0x22dfc7,_0x2faf17){var _0x3ada39=_[_0x294b('0x29')](_0x148519,function(_0x3dceef,_0x40e130){return _0x3dceef[_0x2faf17];});for(var _0x421ee6 in _0x22dfc7){if(_0x22dfc7[_0x294b('0x2a')](_0x421ee6)){if(!_0x3ada39[_0x421ee6]){delete _0x22dfc7[_0x421ee6];}}}}function freeIsNotKeySip(_0xc80746,_0x97d368){var _0x19f484=_[_0x294b('0x29')](_0xc80746,function(_0x19c6a8,_0x2e3172){return util[_0x294b('0x2b')](_0x294b('0x2c'),_0x19c6a8[_0x294b('0x2d')]);});for(var _0x5e982e in _0x97d368){if(_0x97d368['hasOwnProperty'](_0x5e982e)){if(!_0x19f484[_0x5e982e]){delete _0x97d368[_0x5e982e];}}}}function freeIsNotKeyAgent(_0x13ee9c,_0x5c7cda){var _0xd5646a=_[_0x294b('0x29')](_0x13ee9c,function(_0xd5f159,_0x2e2283){var _0x19f91f=_[_0x294b('0x2e')](_0xd5f159['interface'])?util[_0x294b('0x2b')]('SIP/%s',_0xd5f159[_0x294b('0x2d')]):_0xd5f159[_0x294b('0x2f')];return _0x19f91f;});for(var _0x43e5b7 in _0x5c7cda){if(_0x5c7cda['hasOwnProperty'](_0x43e5b7)){if(!_0xd5646a[_0x43e5b7]){delete _0x5c7cda[_0x43e5b7];}}}}function clearVoiceCallReports(_0x4d4199){_0x4d4199[_0x294b('0x30')]=0x0;_0x4d4199['answered']=0x0;_0x4d4199[_0x294b('0x31')]=0x0;_0x4d4199['sumDuration']=0x0;_0x4d4199[_0x294b('0x32')]=0x0;}function clearCampaigns(_0x5ae60d){if(!_['isEmpty'](_0x5ae60d)){for(var _0x10f895 in _0x5ae60d){if(_0x5ae60d[_0x294b('0x2a')](_0x10f895)){_0x5ae60d[_0x10f895]['ivrTotalCallsDays']=0x0;_0x5ae60d[_0x10f895][_0x294b('0x33')]=0x0;}}}}function clearVoiceQueues(_0x56d1e6){if(!_[_0x294b('0x34')](_0x56d1e6)){for(var _0x2b5598 in _0x56d1e6){if(_0x56d1e6[_0x294b('0x2a')](_0x2b5598)){_0x56d1e6[_0x2b5598][_0x294b('0x30')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x35')]=0x0;_0x56d1e6[_0x2b5598]['unmanaged']=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x36')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x31')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x37')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x32')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x38')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x39')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x3a')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x3b')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x3c')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x3d')]=0x0;_0x56d1e6[_0x2b5598]['outboundDropCallsDayTimeout']=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x3e')]=0x0;_0x56d1e6[_0x2b5598]['outboundBlacklistCallsDay']=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x3f')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x40')]=0x0;_0x56d1e6[_0x2b5598][_0x294b('0x41')]=0x0;_0x56d1e6[_0x2b5598]['outboundAnswerAgiCallsDay']=0x0;_0x56d1e6[_0x2b5598]['outboundAnswerCallsDay']=0x0;_0x56d1e6[_0x2b5598]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x294b('0x42')]=function(_0x4033af,_0x46ae5d){for(var _0x54ce0f in _0x46ae5d){if(_0x4033af[_0x294b('0x2a')](_0x54ce0f)){_0x4033af[_0x54ce0f]=_0x46ae5d[_0x54ce0f];}}};Realtime[_0x294b('0x43')][_0x294b('0x44')]=function(){var _0x264f15=this;return function(_0x40f50d){if(_0x40f50d){freeIsNotKeyAgent(_0x40f50d,_0x264f15['agents']);for(var _0x3e1e98=0x0,_0x1d9e93={},_0x4dcc31={};_0x3e1e98<_0x40f50d['length'];_0x3e1e98+=0x1){_0x1d9e93=_0x40f50d[_0x3e1e98];var _0x3c864d=_[_0x294b('0x2e')](_0x1d9e93[_0x294b('0x2f')])?util[_0x294b('0x2b')](_0x294b('0x2c'),_0x1d9e93[_0x294b('0x2d')]):_0x1d9e93[_0x294b('0x2f')];if(_[_0x294b('0x45')](_0x264f15[_0x294b('0x12')][_0x3c864d])){_0x264f15[_0x294b('0x12')][_0x3c864d]=new Agent(_0x1d9e93);}else{_0x264f15[_0x294b('0x42')](_0x264f15[_0x294b('0x12')][_0x3c864d],_0x1d9e93);}}}return _0x264f15[_0x294b('0x12')];};};Realtime[_0x294b('0x43')][_0x294b('0x46')]=function(){var _0x25cd2b=this;return function(_0x37f633){if(_0x37f633){freeIsNotKeySip(_0x37f633,_0x25cd2b[_0x294b('0x13')]);for(var _0x262ee3=0x0,_0xffb4c={},_0x43146a={};_0x262ee3<_0x37f633[_0x294b('0x47')];_0x262ee3+=0x1){_0xffb4c=_0x37f633[_0x262ee3];if(_['isUndefined'](_0x25cd2b[_0x294b('0x13')][util[_0x294b('0x2b')](_0x294b('0x2c'),_0xffb4c[_0x294b('0x2d')])])){_0x25cd2b['telephones'][util[_0x294b('0x2b')](_0x294b('0x2c'),_0xffb4c[_0x294b('0x2d')])]=new Telephone(_0xffb4c);}else{_0x25cd2b[_0x294b('0x42')](_0x25cd2b[_0x294b('0x13')][util[_0x294b('0x2b')]('SIP/%s',_0xffb4c[_0x294b('0x2d')])],_0xffb4c);}}}return _0x25cd2b[_0x294b('0x13')];};};Realtime[_0x294b('0x43')][_0x294b('0x48')]=function(){var _0xf1da11=this;return function(_0x45effb){if(_0x45effb){freeIsNotKeySip(_0x45effb,_0xf1da11[_0x294b('0x14')]);for(var _0x88a060=0x0,_0x4c5a8c={},_0x500bbd={};_0x88a060<_0x45effb[_0x294b('0x47')];_0x88a060+=0x1){_0x4c5a8c=_0x45effb[_0x88a060];if(_['isUndefined'](_0xf1da11[_0x294b('0x14')][util[_0x294b('0x2b')](_0x294b('0x2c'),_0x4c5a8c['name'])])){_0xf1da11[_0x294b('0x14')][util[_0x294b('0x2b')]('SIP/%s',_0x4c5a8c['name'])]=new Trunk(_0x4c5a8c);}else{_0xf1da11['mergeFromDatabase'](_0xf1da11[_0x294b('0x14')][util['format'](_0x294b('0x2c'),_0x4c5a8c[_0x294b('0x2d')])],_0x4c5a8c);}}}return _0xf1da11['trunks'];};};Realtime['prototype'][_0x294b('0x49')]=function(){var _0x2939a0=this;return function(_0x388459){if(_0x388459){freeIsNotKey(_0x388459,_0x2939a0[_0x294b('0x15')],_0x294b('0x2d'));for(var _0x12bcf9=0x0,_0x3cfb4a={},_0x2708f7={};_0x12bcf9<_0x388459[_0x294b('0x47')];_0x12bcf9+=0x1){_0x3cfb4a=_0x388459[_0x12bcf9];if(_[_0x294b('0x45')](_0x2939a0[_0x294b('0x15')][_0x3cfb4a[_0x294b('0x2d')]])){_0x2939a0[_0x294b('0x15')][_0x3cfb4a[_0x294b('0x2d')]]=new VoiceQueue(_0x3cfb4a);}else{_0x2939a0[_0x294b('0x42')](_0x2939a0[_0x294b('0x15')][_0x3cfb4a[_0x294b('0x2d')]],_0x3cfb4a);}}}return _0x2939a0[_0x294b('0x15')];};};Realtime['prototype']['initTriggers']=function(){var _0x139c44=this;return function(_0x5048cb){if(_0x5048cb){freeIsNotKey(_0x5048cb,_0x139c44[_0x294b('0x4a')],'id');for(var _0x395011=0x0,_0x25b312={},_0x4ea0f4={};_0x395011<_0x5048cb['length'];_0x395011+=0x1){_0x25b312=_0x5048cb[_0x395011];if(_[_0x294b('0x45')](_0x139c44[_0x294b('0x4a')][_0x25b312['id']])){_0x139c44[_0x294b('0x4a')][_0x25b312['id']]=new Trigger(_0x25b312);}else{_0x139c44[_0x294b('0x42')](_0x139c44['triggers'][_0x25b312['id']],_0x25b312);}}}return _0x139c44[_0x294b('0x4a')];};};Realtime[_0x294b('0x43')][_0x294b('0x4b')]=function(){var _0x41301c=this;return function(_0x5fbfed){if(_0x5fbfed){freeIsNotKey(_0x5fbfed,_0x41301c[_0x294b('0x17')],'id');for(var _0x4d63cf=0x0,_0x4a07a9={},_0x484e47={};_0x4d63cf<_0x5fbfed['length'];_0x4d63cf+=0x1){_0x4a07a9=_0x5fbfed[_0x4d63cf];if(_[_0x294b('0x45')](_0x41301c[_0x294b('0x17')][_0x4a07a9['id']])){_0x41301c[_0x294b('0x17')][_0x4a07a9['id']]=new Template(_0x4a07a9);}else{_0x41301c['mergeFromDatabase'](_0x41301c[_0x294b('0x17')][_0x4a07a9['id']],_0x4a07a9);}}}return _0x41301c[_0x294b('0x17')];};};Realtime[_0x294b('0x43')][_0x294b('0x4c')]=function(){var _0x2d9f94=this;return function(_0x366a73){if(_0x366a73){freeIsNotKey(_0x366a73,_0x2d9f94[_0x294b('0x1e')],'id');for(var _0xb7da77=0x0,_0x154f9a={},_0x23b5fb={};_0xb7da77<_0x366a73[_0x294b('0x47')];_0xb7da77+=0x1){_0x154f9a=_0x366a73[_0xb7da77];if(_[_0x294b('0x45')](_0x2d9f94['zendeskAccounts'][_0x154f9a['id']])){_0x2d9f94[_0x294b('0x1e')][_0x154f9a['id']]=new ZendeskAccount(_0x154f9a);}else{_0x2d9f94['mergeFromDatabase'](_0x2d9f94[_0x294b('0x1e')][_0x154f9a['id']],_0x154f9a);}}}return _0x2d9f94['zendeskAccounts'];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x3d215f=this;return function(_0x13f7db){if(_0x13f7db){freeIsNotKey(_0x13f7db,_0x3d215f[_0x294b('0x1f')],'id');for(var _0x4ffd77=0x0,_0x5a185d={},_0x27c97c={};_0x4ffd77<_0x13f7db[_0x294b('0x47')];_0x4ffd77+=0x1){_0x5a185d=_0x13f7db[_0x4ffd77];if(_['isUndefined'](_0x3d215f['salesforceAccounts'][_0x5a185d['id']])){_0x3d215f['salesforceAccounts'][_0x5a185d['id']]=new SalesforceAccount(_0x5a185d);}else{_0x3d215f['mergeFromDatabase'](_0x3d215f[_0x294b('0x1f')][_0x5a185d['id']],_0x5a185d);}}}return _0x3d215f['salesforceAccounts'];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x38ccf0=this;return function(_0x187b78){if(_0x187b78){freeIsNotKey(_0x187b78,_0x38ccf0[_0x294b('0x21')],'id');for(var _0x33d6c4=0x0,_0x4edbbf={},_0x2beaad={};_0x33d6c4<_0x187b78[_0x294b('0x47')];_0x33d6c4+=0x1){_0x4edbbf=_0x187b78[_0x33d6c4];if(_[_0x294b('0x45')](_0x38ccf0[_0x294b('0x21')][_0x4edbbf['id']])){_0x38ccf0['freshdeskAccounts'][_0x4edbbf['id']]=new FreshdeskAccount(_0x4edbbf);}else{_0x38ccf0[_0x294b('0x42')](_0x38ccf0['freshdeskAccounts'][_0x4edbbf['id']],_0x4edbbf);}}}return _0x38ccf0[_0x294b('0x21')];};};Realtime[_0x294b('0x43')][_0x294b('0x4d')]=function(){var _0x56507e=this;return function(_0x25eed4){if(_0x25eed4){freeIsNotKey(_0x25eed4,_0x56507e[_0x294b('0x22')],'id');for(var _0xce0019=0x0,_0x36910c={},_0x373086={};_0xce0019<_0x25eed4[_0x294b('0x47')];_0xce0019+=0x1){_0x36910c=_0x25eed4[_0xce0019];if(_['isUndefined'](_0x56507e[_0x294b('0x22')][_0x36910c['id']])){_0x56507e[_0x294b('0x22')][_0x36910c['id']]=new ZohoAccount(_0x36910c);}else{_0x56507e[_0x294b('0x42')](_0x56507e[_0x294b('0x22')][_0x36910c['id']],_0x36910c);}}}return _0x56507e[_0x294b('0x22')];};};Realtime[_0x294b('0x43')][_0x294b('0x4e')]=function(){var _0x421ad1=this;return function(_0x4420c0){if(_0x4420c0){freeIsNotKey(_0x4420c0,_0x421ad1[_0x294b('0x23')],'id');for(var _0x13f575=0x0,_0x3fd66b={},_0x21dcf5={};_0x13f575<_0x4420c0[_0x294b('0x47')];_0x13f575+=0x1){_0x3fd66b=_0x4420c0[_0x13f575];if(_[_0x294b('0x45')](_0x421ad1[_0x294b('0x23')][_0x3fd66b['id']])){_0x421ad1['deskAccounts'][_0x3fd66b['id']]=new DeskAccount(_0x3fd66b);}else{_0x421ad1[_0x294b('0x42')](_0x421ad1[_0x294b('0x23')][_0x3fd66b['id']],_0x3fd66b);}}}return _0x421ad1[_0x294b('0x23')];};};Realtime[_0x294b('0x43')]['initSugarcrmAccounts']=function(){var _0x348481=this;return function(_0x297621){if(_0x297621){freeIsNotKey(_0x297621,_0x348481['sugarcrmAccounts'],'id');for(var _0x5a13c0=0x0,_0x1498b3={},_0x35b0a0={};_0x5a13c0<_0x297621['length'];_0x5a13c0+=0x1){_0x1498b3=_0x297621[_0x5a13c0];if(_[_0x294b('0x45')](_0x348481[_0x294b('0x20')][_0x1498b3['id']])){_0x348481['sugarcrmAccounts'][_0x1498b3['id']]=new SugarcrmAccount(_0x1498b3);}else{_0x348481['mergeFromDatabase'](_0x348481['sugarcrmAccounts'][_0x1498b3['id']],_0x1498b3);}}}return _0x348481['sugarcrmAccounts'];};};Realtime[_0x294b('0x43')][_0x294b('0x4f')]=function(){var _0x4e0f38=this;return function(_0x54c1a0){if(_0x54c1a0){freeIsNotKey(_0x54c1a0,_0x4e0f38[_0x294b('0x24')],'id');for(var _0x2439aa=0x0,_0x14daf7={},_0x25f615={};_0x2439aa<_0x54c1a0[_0x294b('0x47')];_0x2439aa+=0x1){_0x14daf7=_0x54c1a0[_0x2439aa];if(_[_0x294b('0x45')](_0x4e0f38[_0x294b('0x24')][_0x14daf7['id']])){_0x4e0f38[_0x294b('0x24')][_0x14daf7['id']]=new VtigerAccount(_0x14daf7);}else{_0x4e0f38[_0x294b('0x42')](_0x4e0f38['vtigerAccounts'][_0x14daf7['id']],_0x14daf7);}}}return _0x4e0f38[_0x294b('0x24')];};};Realtime[_0x294b('0x43')]['initServicenowAccounts']=function(){var _0x16ada4=this;return function(_0xc8d3cb){if(_0xc8d3cb){freeIsNotKey(_0xc8d3cb,_0x16ada4['servicenowAccounts'],'id');for(var _0x55fe23=0x0,_0x166af5={},_0x267396={};_0x55fe23<_0xc8d3cb['length'];_0x55fe23+=0x1){_0x166af5=_0xc8d3cb[_0x55fe23];if(_[_0x294b('0x45')](_0x16ada4[_0x294b('0x25')][_0x166af5['id']])){_0x16ada4[_0x294b('0x25')][_0x166af5['id']]=new ServicenowAccount(_0x166af5);}else{_0x16ada4[_0x294b('0x42')](_0x16ada4['servicenowAccounts'][_0x166af5['id']],_0x166af5);}}}return _0x16ada4[_0x294b('0x25')];};};Realtime[_0x294b('0x43')][_0x294b('0x50')]=function(){var _0x3406cb=this;return function(_0x1a7856){if(_0x1a7856){freeIsNotKey(_0x1a7856,_0x3406cb[_0x294b('0x26')],'id');for(var _0x2aba3e=0x0,_0x29c532={},_0xdf3368={};_0x2aba3e<_0x1a7856[_0x294b('0x47')];_0x2aba3e+=0x1){_0x29c532=_0x1a7856[_0x2aba3e];if(_[_0x294b('0x45')](_0x3406cb[_0x294b('0x26')][_0x29c532['id']])){_0x3406cb['dynamics365Accounts'][_0x29c532['id']]=new Dynamics365Account(_0x29c532);}else{_0x3406cb[_0x294b('0x42')](_0x3406cb[_0x294b('0x26')][_0x29c532['id']],_0x29c532);}}}return _0x3406cb[_0x294b('0x26')];};};Realtime[_0x294b('0x43')][_0x294b('0x51')]=function(){var _0x106ab8=this;return function(_0x12fdd8){if(_0x12fdd8){freeIsNotKey(_0x12fdd8,_0x106ab8[_0x294b('0x27')],'id');for(var _0x21c84f=0x0,_0x1cde42={},_0x3f025d={};_0x21c84f<_0x12fdd8[_0x294b('0x47')];_0x21c84f+=0x1){_0x1cde42=_0x12fdd8[_0x21c84f];if(_['isUndefined'](_0x106ab8['freshsalesAccounts'][_0x1cde42['id']])){_0x106ab8[_0x294b('0x27')][_0x1cde42['id']]=new FreshsalesAccount(_0x1cde42);}else{_0x106ab8[_0x294b('0x42')](_0x106ab8['freshsalesAccounts'][_0x1cde42['id']],_0x1cde42);}}}return _0x106ab8[_0x294b('0x27')];};};Realtime[_0x294b('0x43')]['initVoiceQueueHopperHistory']=function(){var _0x247deb=this;return function(_0x22a28b){for(var _0x5ae6d4=0x0;_0x5ae6d4<_0x22a28b['length'];_0x5ae6d4+=0x1){_['merge'](_0x247deb[_0x294b('0x15')][_0x22a28b[_0x5ae6d4][_0x294b('0x2d')]],_0x22a28b[_0x5ae6d4]);}return _0x247deb[_0x294b('0x15')];};};Realtime[_0x294b('0x43')]['initVoiceQueueReports']=function(){var _0xcc8808=this;return function(_0x97fa33){clearVoiceQueues(_0xcc8808[_0x294b('0x15')]);if(_0x97fa33){_0x97fa33=_['groupBy'](_0x97fa33,_0x294b('0x52'));for(var _0x2ae750 in _0x97fa33){if(_0x97fa33[_0x294b('0x2a')](_0x2ae750)){var _0x57b958={};for(var _0x10cda4=0x0;_0x10cda4<_0x97fa33[_0x2ae750][_0x294b('0x47')];_0x10cda4+=0x1){var _0x582c9e=_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x53')];if(_0xcc8808[_0x294b('0x15')][_0x582c9e]){if(_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x54')]){_0xcc8808['voiceQueues'][_0x582c9e]['unmanaged']+=0x1;}if(_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x55')]){_0xcc8808[_0x294b('0x15')][_0x582c9e][_0x294b('0x36')]+=0x1;}_0xcc8808[_0x294b('0x15')][_0x582c9e][_0x294b('0x31')]+=moment(_0x97fa33[_0x2ae750][_0x10cda4]['queuecallerleaveAt'])['diff'](moment(_0x97fa33[_0x2ae750][_0x10cda4]['queuecallerjoinAt']),'seconds')||0x0;if(_0x10cda4===_0x97fa33[_0x2ae750][_0x294b('0x47')]-0x1){_0xcc8808[_0x294b('0x15')][_0x582c9e]['sumDuration']+=moment(_0x97fa33[_0x2ae750][_0x10cda4]['queuecallercompleteAt']||_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x56')]||_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x57')])[_0x294b('0x58')](moment(_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x59')]),'seconds')||0x0;_0xcc8808[_0x294b('0x15')][_0x582c9e][_0x294b('0x30')]+=0x1;if(_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x5a')]){_0xcc8808['voiceQueues'][_0x582c9e][_0x294b('0x35')]+=0x1;_0xcc8808[_0x294b('0x15')][_0x582c9e][_0x294b('0x32')]+=moment(_0x97fa33[_0x2ae750][_0x10cda4][_0x294b('0x5b')])['diff'](moment(_0x97fa33[_0x2ae750][_0x10cda4]['queuecallerleaveAt']),_0x294b('0x5c'))||0x0;}}else{_0xcc8808['voiceQueues'][_0x582c9e][_0x294b('0x37')]+=_0xcc8808[_0x294b('0x15')][_0x582c9e]['sumHoldTime']||0x0;}}}}}}return _0xcc8808['voiceQueues'];};};Realtime[_0x294b('0x43')][_0x294b('0x5d')]=function(){var _0x4e4df7=this;return function(_0x361e32){clearVoiceCallReports(_0x4e4df7[_0x294b('0x18')]);if(_0x361e32){for(var _0x2cb04e=0x0;_0x2cb04e<_0x361e32[_0x294b('0x47')];_0x2cb04e+=0x1){_0x4e4df7[_0x294b('0x18')][_0x294b('0x30')]+=0x1;_0x4e4df7[_0x294b('0x18')]['sumDuration']+=_0x361e32[_0x2cb04e][_0x294b('0x5e')];if(_0x361e32[_0x2cb04e][_0x294b('0x5f')]===_0x294b('0x60')){_0x4e4df7[_0x294b('0x18')]['answered']+=0x1;_0x4e4df7['outbound']['sumHoldTime']+=_0x361e32[_0x2cb04e][_0x294b('0x5e')]-_0x361e32[_0x2cb04e][_0x294b('0x61')]||0x0;_0x4e4df7[_0x294b('0x18')]['sumBillable']+=_0x361e32[_0x2cb04e][_0x294b('0x61')];}}}return _0x4e4df7[_0x294b('0x18')];};};Realtime[_0x294b('0x43')][_0x294b('0x62')]=function(){var _0x322954=this;return function(_0x3c93ab){if(_0x3c93ab){freeIsNotKey(_0x3c93ab,_0x322954[_0x294b('0x16')],'name');for(var _0x343e5b=0x0,_0x5a3ce4={};_0x343e5b<_0x3c93ab['length'];_0x343e5b+=0x1){_0x5a3ce4=_0x3c93ab[_0x343e5b];if(_[_0x294b('0x45')](_0x322954['campaigns'][_0x5a3ce4['name']])){_0x322954['campaigns'][_0x5a3ce4[_0x294b('0x2d')]]=new Campaign(_0x5a3ce4);}else{_0x322954['mergeFromDatabase'](_0x322954[_0x294b('0x16')][_0x5a3ce4[_0x294b('0x2d')]],_0x5a3ce4);_0x322954['campaigns'][_0x5a3ce4[_0x294b('0x2d')]][_0x294b('0x63')]=_0x5a3ce4[_0x294b('0x64')]?_0x5a3ce4['SquareProject'][_0x294b('0x2d')]:undefined;}}}return _0x322954[_0x294b('0x16')];};};Realtime[_0x294b('0x43')]['initVoiceExtensions']=function(){var _0x42db7f=this;return function(_0x8ae52d){if(_0x8ae52d){freeIsNotKey(_0x8ae52d,_0x42db7f[_0x294b('0x19')],'id');for(var _0x363540=0x0,_0x1f48d8={};_0x363540<_0x8ae52d[_0x294b('0x47')];_0x363540+=0x1){_0x1f48d8=_0x8ae52d[_0x363540];if(_[_0x294b('0x45')](_0x42db7f[_0x294b('0x19')][_0x1f48d8['id']])){_0x42db7f[_0x294b('0x19')][_0x1f48d8['id']]=new VoiceExtension(_0x1f48d8);}else{_0x42db7f['mergeFromDatabase'](_0x42db7f[_0x294b('0x19')][_0x1f48d8['id']],_0x1f48d8);}}}return _0x42db7f[_0x294b('0x19')];};};Realtime[_0x294b('0x43')][_0x294b('0x65')]=function(){var _0x254f34=this;return function(_0x167670){clearCampaigns(_0x254f34[_0x294b('0x16')]);for(var _0x1272dc=0x0;_0x1272dc<_0x167670[_0x294b('0x47')];_0x1272dc+=0x1){_[_0x294b('0x66')](_0x254f34['campaigns'][_0x167670[_0x1272dc][_0x294b('0x2d')]],_0x167670[_0x1272dc]);}return _0x254f34[_0x294b('0x16')];};};Realtime[_0x294b('0x43')][_0x294b('0x67')]=function(){var _0xdfda82=this;return function(_0x3cf33c){if(_0x3cf33c){freeIsNotKey(_0x3cf33c,_0xdfda82['faxAccounts'],'id');for(var _0x1d3936=0x0,_0x56cef5={},_0x1c4209={};_0x1d3936<_0x3cf33c[_0x294b('0x47')];_0x1d3936+=0x1){_0x56cef5=_0x3cf33c[_0x1d3936];if(_[_0x294b('0x45')](_0xdfda82['faxAccounts'][_0x56cef5['id']])){_0xdfda82['faxAccounts'][_0x56cef5['id']]=new FaxAccount(_0x56cef5);}else{_0xdfda82[_0x294b('0x42')](_0xdfda82[_0x294b('0x28')][_0x56cef5['id']],_0x56cef5);}}}return _0xdfda82[_0x294b('0x28')];};};module[_0x294b('0x68')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 186977d..06b5aa4 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 _0xbf9c=['phone','indexOf','exports','moment','util','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','sync','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','name','isNil','accountcode','format','SIP/%s','assigned','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','voiceQueueReport','create','match','destination','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','length','monitorFilename','filename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','prototype','forEach','startsWith','Local','substring'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xbf9c,0x15f));var _0xcbf9=function(_0x4a6a03,_0x43ab3c){_0x4a6a03=_0x4a6a03-0x0;var _0x59dce1=_0xbf9c[_0x4a6a03];return _0x59dce1;};'use strict';var _=require('lodash');var moment=require(_0xcbf9('0x0'));var util=require(_0xcbf9('0x1'));var config=require('../../../config/environment');var ami=require(_0xcbf9('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xcbf9('0x3'));var RpcVoiceDialReport=require(_0xcbf9('0x4'));var RpcMemberReport=require(_0xcbf9('0x5'));var RpcVoiceQueueReport=require(_0xcbf9('0x6'));var RpcVoiceRecording=require(_0xcbf9('0x7'));var RpcVoiceTransferReport=require(_0xcbf9('0x8'));var VoiceQueueReport=require(_0xcbf9('0x9'));var VoiceCallReport=require(_0xcbf9('0xa'));var VoiceAgentReport=require(_0xcbf9('0xb'));var VoiceDialReport=require(_0xcbf9('0xc'));var UserReport=require('./userReport');function Report(_0x5d608e){this[_0xcbf9('0xd')]=_0x5d608e;this[_0xcbf9('0xe')]=_0x5d608e[_0xcbf9('0xe')];this['telephones']=_0x5d608e[_0xcbf9('0xf')];}Report['prototype'][_0xcbf9('0x10')]=function(_0x4c4ed3){var _0x2789ba=new VoiceQueueReport(this[_0xcbf9('0xd')]);var _0x3b89a0=new VoiceAgentReport(this[_0xcbf9('0xd')]);var _0x15e699=new VoiceDialReport(this['realtime']);var _0x684b04=new VoiceCallReport(this[_0xcbf9('0xd')]);var _0x1a08f3=new UserReport(this[_0xcbf9('0xd')]);if(config['xdr']&&config['xdr']['disabled']){ami['on'](_0xcbf9('0x11'),this['voiceQueueReport']['bind'](this));ami['on'](_0xcbf9('0x12'),this[_0xcbf9('0x13')][_0xcbf9('0x14')](this));ami['on'](_0xcbf9('0x15'),this[_0xcbf9('0x16')]['bind'](this));ami['on'](_0xcbf9('0x17'),this[_0xcbf9('0x18')]['bind'](this));ami['on'](_0xcbf9('0x19'),this[_0xcbf9('0x1a')][_0xcbf9('0x14')](this));ami['on']('attendedtransfer',this[_0xcbf9('0x1b')][_0xcbf9('0x14')](this));}};Report['prototype'][_0xcbf9('0x1c')]=function(_0xe83867){var _0x36a3ce;_0x36a3ce=_[_0xcbf9('0x1d')](this[_0xcbf9('0xe')],function(_0x58f518){return _0x58f518['accountcode']==_0xe83867||_0x58f518[_0xcbf9('0x1e')]==_0xe83867;});if(_[_0xcbf9('0x1f')](_0x36a3ce)){var _0xb0f460=_[_0xcbf9('0x1d')](this['telephones'],function(_0x2194fa){return _0x2194fa[_0xcbf9('0x20')]==_0xe83867||_0x2194fa[_0xcbf9('0x1e')]==_0xe83867;});if(_0xb0f460){_0x36a3ce=_['find'](this[_0xcbf9('0xe')],function(_0x145603){return _0x145603['interface']==util[_0xcbf9('0x21')](_0xcbf9('0x22'),_0xb0f460['name']);});}}return _0x36a3ce;};Report['prototype']['voiceQueueReport']=function(_0x1d7d72){for(var _0x4a7ef9=0x0;_0x4a7ef9<_0x1d7d72['length'];_0x4a7ef9+=0x1){var _0x1dcf3b=this[_0xcbf9('0x1c')](_0x1d7d72[_0x4a7ef9]['connectedlinenum']);if(_0x1dcf3b){_0x1d7d72[_0x4a7ef9][_0xcbf9('0x20')]=_0x1dcf3b[_0xcbf9('0x20')];_0x1d7d72[_0x4a7ef9][_0xcbf9('0x23')]=!![];_0x1d7d72[_0x4a7ef9][_0xcbf9('0x24')]=_0x1dcf3b['name'];_0x1d7d72[_0x4a7ef9][_0xcbf9('0x25')]=_[_0xcbf9('0x1f')](_0x1dcf3b['interface'])?util[_0xcbf9('0x21')](_0xcbf9('0x22'),_0x1dcf3b[_0xcbf9('0x1e')]):_0x1dcf3b[_0xcbf9('0x25')];if(_0x1d7d72[_0x4a7ef9][_0xcbf9('0x26')]){_0x1d7d72[_0x4a7ef9][_0xcbf9('0x27')]=moment()[_0xcbf9('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1d7d72[_0x4a7ef9][_0xcbf9('0x28')]){_0x1d7d72[_0x4a7ef9][_0xcbf9('0x29')]=moment()['format'](_0xcbf9('0x2a'));}RpcMemberReport[_0xcbf9('0x2b')](_0x1d7d72[_0x4a7ef9]);}RpcVoiceQueueReport[_0xcbf9('0x2c')](_0x1d7d72[_0x4a7ef9]);}};function extractCalleridNumber(_0x279b57){var _0x49b990=_0x279b57[_0xcbf9('0x2d')](/<(.*?)>/);return _0x49b990?_0x49b990[0x1]:_0x279b57;}Report['prototype'][_0xcbf9('0x13')]=function(_0x30716b){_0x30716b['destination']=_0x30716b[_0xcbf9('0x2e')]||_0x30716b['exten'];if(_0x30716b['type']==_0xcbf9('0x2f')){_0x30716b[_0xcbf9('0x30')]=_0xcbf9('0x31');_0x30716b[_0xcbf9('0x32')]=_0x30716b[_0xcbf9('0x31')];if(_0x30716b[_0xcbf9('0x33')]==_0xcbf9('0x34')){_0x30716b[_0xcbf9('0x20')]='';_0x30716b[_0xcbf9('0x2e')]=extractCalleridNumber(_0x30716b['callerid']);}else if(_0x30716b[_0xcbf9('0x33')]==_0xcbf9('0x35')){if(_0x30716b[_0xcbf9('0x2e')]==_0xcbf9('0x36')){_0x30716b['destination']=extractCalleridNumber(_0x30716b[_0xcbf9('0x37')]);_0x30716b[_0xcbf9('0x38')]=_0x30716b[_0xcbf9('0x39')];_0x30716b[_0xcbf9('0x3a')]=[_0x30716b[_0xcbf9('0x3b')],_0x30716b[_0xcbf9('0x3b')]=_0x30716b[_0xcbf9('0x3a')]][0x0];_0x30716b[_0xcbf9('0x3c')]=_0x30716b[_0xcbf9('0x37')];}else{_0x30716b[_0xcbf9('0x2e')]=_0x30716b[_0xcbf9('0x38')];_0x30716b[_0xcbf9('0x38')]=_0x30716b['originatecalleridnum'];if(_0x30716b['disposition']==_0xcbf9('0x3d')){_0x30716b[_0xcbf9('0x20')]=_0x30716b[_0xcbf9('0x3e')];}else{_0x30716b['accountcode']='';}}}}else{_0x30716b[_0xcbf9('0x3c')]=util[_0xcbf9('0x21')](_0xcbf9('0x3f'),_0x30716b[_0xcbf9('0x40')],_0x30716b[_0xcbf9('0x38')]);}if(RpcVoiceTransferReport['transfers'][_0x30716b[_0xcbf9('0x41')]]){var _0x1f725e=RpcVoiceTransferReport[_0xcbf9('0x42')][_0x30716b['linkedid']];_0x1f725e[_0xcbf9('0x43')]=_0x30716b[_0xcbf9('0x44')];RpcVoiceTransferReport[_0xcbf9('0x1a')](_0x1f725e);delete RpcVoiceTransferReport[_0xcbf9('0x42')][_0x30716b[_0xcbf9('0x41')]];}RpcVoiceCallReport[_0xcbf9('0x2c')](_0x30716b);if(_0x30716b[_0xcbf9('0x45')]){for(var _0x1dc589=0x0;_0x1dc589<_0x30716b[_0xcbf9('0x46')][_0xcbf9('0x47')];_0x1dc589+=0x1){_0x30716b[_0xcbf9('0x48')]=_0x30716b[_0xcbf9('0x46')][_0x1dc589][_0xcbf9('0x49')];_0x30716b[_0xcbf9('0x4a')]=_0x30716b[_0xcbf9('0x46')][_0x1dc589][_0xcbf9('0x4a')];if(_0x30716b[_0xcbf9('0x4b')]==_0xcbf9('0x36')){_0x30716b['calleridnum']=_0x30716b[_0xcbf9('0x3e')];_0x30716b[_0xcbf9('0x40')]=_0x30716b['connectedlinename'];_0x30716b['connectedlinenum']=_0x30716b[_0xcbf9('0x20')];_0x30716b[_0xcbf9('0x4c')]=_0x30716b[_0xcbf9('0x4d')];_0x30716b[_0xcbf9('0x4b')]=_0x30716b[_0xcbf9('0x39')];}else if(_0x30716b[_0xcbf9('0x4b')]==_0xcbf9('0x4e')){_0x30716b[_0xcbf9('0x38')]=_0x30716b['destination'];_0x30716b[_0xcbf9('0x4b')]=_0x30716b['originatecalleridnum'];}RpcVoiceRecording[_0xcbf9('0x2c')](_0x30716b);}}};Report[_0xcbf9('0x4f')][_0xcbf9('0x16')]=function(_0x26d630){if(_['isArray'](_0x26d630)){_0x26d630[_0xcbf9('0x50')](function(_0x43731e){RpcVoiceAgentReport[_0xcbf9('0x2c')](_0x43731e);});}else{RpcVoiceAgentReport['create'](_0x26d630);}};Report[_0xcbf9('0x4f')][_0xcbf9('0x18')]=function(_0x23e775){RpcVoiceDialReport[_0xcbf9('0x2c')](_0x23e775);var _0x55c19f;var _0x44b0a4;var _0x34d540=_0x23e775[_0xcbf9('0x3b')];if(_[_0xcbf9('0x51')](_0x34d540,_0xcbf9('0x52'))){_0x44b0a4=_0x34d540[_0xcbf9('0x53')](_0x34d540['indexOf']('/')+0x1,_0x34d540['indexOf']('@'));_0x55c19f=_['find'](this[_0xcbf9('0xe')],function(_0x1548f0){return _0x1548f0['mobile']==_0x44b0a4||_0x1548f0[_0xcbf9('0x54')]==_0x44b0a4||_0x1548f0[_0xcbf9('0x20')]==_0x44b0a4;});}else{_0x44b0a4=_0x34d540['substring'](_0x34d540[_0xcbf9('0x55')]('/')+0x1,_0x34d540['lastIndexOf']('-'));_0x55c19f=this['findAgent'](_0x44b0a4);}if(_0x55c19f){_0x23e775[_0xcbf9('0x25')]=_[_0xcbf9('0x1f')](_0x55c19f['interface'])?util[_0xcbf9('0x21')](_0xcbf9('0x22'),_0x55c19f[_0xcbf9('0x1e')]):_0x55c19f[_0xcbf9('0x25')];_0x23e775[_0xcbf9('0x4d')]=_0x55c19f[_0xcbf9('0x1e')];_0x23e775[_0xcbf9('0x20')]=_0x55c19f[_0xcbf9('0x20')];RpcMemberReport[_0xcbf9('0x18')](_0x23e775);}};Report[_0xcbf9('0x4f')][_0xcbf9('0x1a')]=function(_0x340f74){RpcVoiceTransferReport[_0xcbf9('0x42')][_0x340f74['transfererlinkedid']]=_0x340f74;};Report[_0xcbf9('0x4f')][_0xcbf9('0x1b')]=function(_0x341a18){RpcVoiceTransferReport[_0xcbf9('0x1b')](_0x341a18);};module[_0xcbf9('0x56')]=Report; \ No newline at end of file +var _0xc12b=['voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','accountcode','name','isNil','format','SIP/%s','length','findAgent','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','destination','type','dialer','lastapplication','lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','channel','callerid','calleridnum','originatecalleridnum','calleridname','linkedid','transfereelinkedid','transfers','create','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport'];(function(_0x190ceb,_0x2345b2){var _0x5ce806=function(_0x432853){while(--_0x432853){_0x190ceb['push'](_0x190ceb['shift']());}};_0x5ce806(++_0x2345b2);}(_0xc12b,0x192));var _0xbc12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc12b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0xbc12('0x0'));var util=require(_0xbc12('0x1'));var config=require('../../../config/environment');var ami=require(_0xbc12('0x2'));var RpcVoiceAgentReport=require(_0xbc12('0x3'));var RpcVoiceCallReport=require(_0xbc12('0x4'));var RpcVoiceDialReport=require(_0xbc12('0x5'));var RpcMemberReport=require(_0xbc12('0x6'));var RpcVoiceQueueReport=require(_0xbc12('0x7'));var RpcVoiceRecording=require(_0xbc12('0x8'));var RpcVoiceTransferReport=require(_0xbc12('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xbc12('0xa'));var VoiceAgentReport=require(_0xbc12('0xb'));var VoiceDialReport=require(_0xbc12('0xc'));var UserReport=require('./userReport');function Report(_0x5550f8){this[_0xbc12('0xd')]=_0x5550f8;this[_0xbc12('0xe')]=_0x5550f8['agents'];this[_0xbc12('0xf')]=_0x5550f8[_0xbc12('0xf')];}Report[_0xbc12('0x10')][_0xbc12('0x11')]=function(_0x117ec8){var _0x1c312a=new VoiceQueueReport(this[_0xbc12('0xd')]);var _0x3f7a34=new VoiceAgentReport(this[_0xbc12('0xd')]);var _0x6281ea=new VoiceDialReport(this[_0xbc12('0xd')]);var _0x5860fa=new VoiceCallReport(this[_0xbc12('0xd')]);var _0x46e660=new UserReport(this[_0xbc12('0xd')]);if(config[_0xbc12('0x12')]&&config[_0xbc12('0x12')][_0xbc12('0x13')]){ami['on'](_0xbc12('0x14'),this[_0xbc12('0x15')][_0xbc12('0x16')](this));ami['on'](_0xbc12('0x17'),this[_0xbc12('0x18')]['bind'](this));ami['on'](_0xbc12('0x19'),this[_0xbc12('0x1a')]['bind'](this));ami['on'](_0xbc12('0x1b'),this[_0xbc12('0x1c')][_0xbc12('0x16')](this));ami['on'](_0xbc12('0x1d'),this[_0xbc12('0x1e')]['bind'](this));ami['on']('attendedtransfer',this[_0xbc12('0x1f')][_0xbc12('0x16')](this));}};Report[_0xbc12('0x10')]['findAgent']=function(_0x3f3bcc){var _0x35fa79;_0x35fa79=_[_0xbc12('0x20')](this[_0xbc12('0xe')],function(_0x2bc620){return _0x2bc620[_0xbc12('0x21')]==_0x3f3bcc||_0x2bc620[_0xbc12('0x22')]==_0x3f3bcc;});if(_[_0xbc12('0x23')](_0x35fa79)){var _0x562c08=_[_0xbc12('0x20')](this[_0xbc12('0xf')],function(_0x4eccb4){return _0x4eccb4[_0xbc12('0x21')]==_0x3f3bcc||_0x4eccb4[_0xbc12('0x22')]==_0x3f3bcc;});if(_0x562c08){_0x35fa79=_[_0xbc12('0x20')](this[_0xbc12('0xe')],function(_0x3db455){return _0x3db455['interface']==util[_0xbc12('0x24')](_0xbc12('0x25'),_0x562c08['name']);});}}return _0x35fa79;};Report[_0xbc12('0x10')][_0xbc12('0x15')]=function(_0x26637e){for(var _0x17a180=0x0;_0x17a180<_0x26637e[_0xbc12('0x26')];_0x17a180+=0x1){var _0x139288=this[_0xbc12('0x27')](_0x26637e[_0x17a180][_0xbc12('0x28')]);if(_0x139288){_0x26637e[_0x17a180][_0xbc12('0x21')]=_0x139288['accountcode'];_0x26637e[_0x17a180][_0xbc12('0x29')]=!![];_0x26637e[_0x17a180][_0xbc12('0x2a')]=_0x139288[_0xbc12('0x22')];_0x26637e[_0x17a180]['interface']=_['isNil'](_0x139288[_0xbc12('0x2b')])?util[_0xbc12('0x24')](_0xbc12('0x25'),_0x139288[_0xbc12('0x22')]):_0x139288['interface'];if(_0x26637e[_0x17a180]['queuecallercomplete']){_0x26637e[_0x17a180][_0xbc12('0x2c')]=moment()['format'](_0xbc12('0x2d'));}if(_0x26637e[_0x17a180][_0xbc12('0x2e')]){_0x26637e[_0x17a180][_0xbc12('0x2f')]=moment()[_0xbc12('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x26637e[_0x17a180]);}RpcVoiceQueueReport['create'](_0x26637e[_0x17a180]);}};function extractCalleridNumber(_0x2ad02f){var _0x36c1c6=_0x2ad02f[_0xbc12('0x30')](/<(.*?)>/);return _0x36c1c6?_0x36c1c6[0x1]:_0x2ad02f;}Report[_0xbc12('0x10')]['voiceCallReport']=function(_0x494fed){_0x494fed[_0xbc12('0x31')]=_0x494fed[_0xbc12('0x31')]||_0x494fed['exten'];if(_0x494fed[_0xbc12('0x32')]==_0xbc12('0x33')){_0x494fed[_0xbc12('0x34')]='queue';_0x494fed[_0xbc12('0x35')]=_0x494fed[_0xbc12('0x36')];if(_0x494fed[_0xbc12('0x37')]==_0xbc12('0x38')){_0x494fed[_0xbc12('0x21')]='';_0x494fed['destination']=extractCalleridNumber(_0x494fed['callerid']);}else if(_0x494fed[_0xbc12('0x37')]==_0xbc12('0x39')){if(_0x494fed['destination']==_0xbc12('0x3a')){_0x494fed[_0xbc12('0x31')]=extractCalleridNumber(_0x494fed[_0xbc12('0x3b')]);_0x494fed['calleridnum']=_0x494fed['originatecalleridnum'];_0x494fed[_0xbc12('0x3c')]=[_0x494fed['channel'],_0x494fed[_0xbc12('0x3d')]=_0x494fed['destinationchannel']][0x0];_0x494fed[_0xbc12('0x3e')]=_0x494fed[_0xbc12('0x3b')];}else{_0x494fed[_0xbc12('0x31')]=_0x494fed[_0xbc12('0x3f')];_0x494fed[_0xbc12('0x3f')]=_0x494fed[_0xbc12('0x40')];if(_0x494fed['disposition']=='ANSWERED'){_0x494fed[_0xbc12('0x21')]=_0x494fed[_0xbc12('0x28')];}else{_0x494fed[_0xbc12('0x21')]='';}}}}else{_0x494fed['callerid']=util[_0xbc12('0x24')]('\x22%s\x22\x20<%s>',_0x494fed[_0xbc12('0x41')],_0x494fed[_0xbc12('0x3f')]);}if(RpcVoiceTransferReport['transfers'][_0x494fed[_0xbc12('0x42')]]){var _0x2540db=RpcVoiceTransferReport['transfers'][_0x494fed[_0xbc12('0x42')]];_0x2540db[_0xbc12('0x43')]=_0x494fed['uniqueid'];RpcVoiceTransferReport[_0xbc12('0x1e')](_0x2540db);delete RpcVoiceTransferReport[_0xbc12('0x44')][_0x494fed[_0xbc12('0x42')]];}RpcVoiceCallReport[_0xbc12('0x45')](_0x494fed);if(_0x494fed[_0xbc12('0x46')]){for(var _0x68b677=0x0;_0x68b677<_0x494fed[_0xbc12('0x47')][_0xbc12('0x26')];_0x68b677+=0x1){_0x494fed[_0xbc12('0x48')]=_0x494fed[_0xbc12('0x47')][_0x68b677]['filename'];_0x494fed['createdAt']=_0x494fed[_0xbc12('0x47')][_0x68b677][_0xbc12('0x49')];if(_0x494fed[_0xbc12('0x4a')]==_0xbc12('0x3a')){_0x494fed[_0xbc12('0x3f')]=_0x494fed[_0xbc12('0x28')];_0x494fed[_0xbc12('0x41')]=_0x494fed[_0xbc12('0x4b')];_0x494fed[_0xbc12('0x28')]=_0x494fed[_0xbc12('0x21')];_0x494fed[_0xbc12('0x4b')]=_0x494fed[_0xbc12('0x4c')];_0x494fed[_0xbc12('0x4a')]=_0x494fed[_0xbc12('0x40')];}else if(_0x494fed['exten']==_0xbc12('0x4d')){_0x494fed[_0xbc12('0x3f')]=_0x494fed[_0xbc12('0x31')];_0x494fed['exten']=_0x494fed['originatecalleridnum'];}RpcVoiceRecording[_0xbc12('0x45')](_0x494fed);}}};Report[_0xbc12('0x10')]['voiceAgentReport']=function(_0x1f7675){if(_['isArray'](_0x1f7675)){_0x1f7675['forEach'](function(_0x31268f){RpcVoiceAgentReport[_0xbc12('0x45')](_0x31268f);});}else{RpcVoiceAgentReport['create'](_0x1f7675);}};Report['prototype']['voiceDialReport']=function(_0x258112){RpcVoiceDialReport[_0xbc12('0x45')](_0x258112);var _0x5cba41;var _0x43a9d9;var _0x31b740=_0x258112[_0xbc12('0x3d')];if(_[_0xbc12('0x4e')](_0x31b740,_0xbc12('0x4f'))){_0x43a9d9=_0x31b740[_0xbc12('0x50')](_0x31b740[_0xbc12('0x51')]('/')+0x1,_0x31b740[_0xbc12('0x51')]('@'));_0x5cba41=_[_0xbc12('0x20')](this['agents'],function(_0xe8f8dd){return _0xe8f8dd[_0xbc12('0x52')]==_0x43a9d9||_0xe8f8dd[_0xbc12('0x53')]==_0x43a9d9||_0xe8f8dd[_0xbc12('0x21')]==_0x43a9d9;});}else{_0x43a9d9=_0x31b740[_0xbc12('0x50')](_0x31b740[_0xbc12('0x51')]('/')+0x1,_0x31b740[_0xbc12('0x54')]('-'));_0x5cba41=this[_0xbc12('0x27')](_0x43a9d9);}if(_0x5cba41){_0x258112['interface']=_[_0xbc12('0x23')](_0x5cba41[_0xbc12('0x2b')])?util[_0xbc12('0x24')](_0xbc12('0x25'),_0x5cba41[_0xbc12('0x22')]):_0x5cba41[_0xbc12('0x2b')];_0x258112[_0xbc12('0x4c')]=_0x5cba41['name'];_0x258112[_0xbc12('0x21')]=_0x5cba41[_0xbc12('0x21')];RpcMemberReport[_0xbc12('0x1c')](_0x258112);}};Report[_0xbc12('0x10')]['blindTransfer']=function(_0x1bcd58){RpcVoiceTransferReport[_0xbc12('0x44')][_0x1bcd58['transfererlinkedid']]=_0x1bcd58;};Report[_0xbc12('0x10')][_0xbc12('0x1f')]=function(_0x92a5c9){RpcVoiceTransferReport[_0xbc12('0x1f')](_0x92a5c9);};module[_0xbc12('0x55')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index e76695f..39d7f78 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 _0x3bc8=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','syncPeerStatus','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','stateTime','toNumber','toLowerCase','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','startsWith','Local','indexOf','phone','accountcode','updateStatusRealtime','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]'];(function(_0x327417,_0x1a7610){var _0x58195c=function(_0x54328f){while(--_0x54328f){_0x327417['push'](_0x327417['shift']());}};_0x58195c(++_0x1a7610);}(_0x3bc8,0x99));var _0x83bc=function(_0x4e8022,_0x53229d){_0x4e8022=_0x4e8022-0x0;var _0xf5e73f=_0x3bc8[_0x4e8022];return _0xf5e73f;};'use strict';var _=require(_0x83bc('0x0'));var moment=require(_0x83bc('0x1'));var util=require(_0x83bc('0x2'));var Redis=require(_0x83bc('0x3'));var BPromise=require(_0x83bc('0x4'));var config=require('../../../config/environment');var logger=require(_0x83bc('0x5'))(_0x83bc('0x6'));var ami=require(_0x83bc('0x7'));config[_0x83bc('0x8')]=_[_0x83bc('0x9')](config[_0x83bc('0x8')],{'host':_0x83bc('0xa'),'port':0x18eb});var io=require(_0x83bc('0xb'))(new Redis(config['redis']));function UserReport(_0x42c371){this[_0x83bc('0xc')]=_0x42c371[_0x83bc('0xc')];this[_0x83bc('0xd')]=_0x42c371[_0x83bc('0xd')];this[_0x83bc('0xe')]=_0x42c371[_0x83bc('0xe')];ami['on'](_0x83bc('0xf'),this[_0x83bc('0x10')][_0x83bc('0x11')](this));ami['on']('registry',this[_0x83bc('0x10')][_0x83bc('0x11')](this));ami['on'](_0x83bc('0x12'),this[_0x83bc('0x13')][_0x83bc('0x11')](this));ami['on']('peerstatus',this[_0x83bc('0x14')]['bind'](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x83bc('0x15')]()[_0x83bc('0x16')](ami['actionSipShowRegistry']())[_0x83bc('0x17')](function(_0x34422d){logger[_0x83bc('0x18')](_0x83bc('0x19'),util[_0x83bc('0x1a')](_0x34422d,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x83bc('0x15')]()['then'](ami[_0x83bc('0x1b')]())[_0x83bc('0x17')](function(_0x30dbd3){logger['error'](_0x83bc('0x1c'),util[_0x83bc('0x1a')](_0x30dbd3,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x83bc('0x15')]()[_0x83bc('0x16')](ami[_0x83bc('0x1d')]())[_0x83bc('0x17')](function(_0x35be9a){logger['error']('[userReport][sippeerstatus]',util[_0x83bc('0x1a')](_0x35be9a,{'showHidden':![],'depth':null}));});}UserReport[_0x83bc('0x1e')][_0x83bc('0x1f')]=function(){setInterval(function(){BPromise[_0x83bc('0x15')]()[_0x83bc('0x16')](showSipRegistrations())[_0x83bc('0x16')](listDeviceStates())[_0x83bc('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x83bc('0x1e')][_0x83bc('0x20')]=function(_0x423a85){return _0x423a85!==null&&!_[_0x83bc('0x21')](_0x423a85);};UserReport['prototype'][_0x83bc('0x22')]=function(_0x277159,_0x46646d,_0x400f6f){io['to'](_0x277159)[_0x83bc('0x22')](_0x46646d,_0x400f6f);};UserReport[_0x83bc('0x1e')][_0x83bc('0x10')]=function(_0x5d89d4){try{if(this[_0x83bc('0x20')](_0x5d89d4)){logger[_0x83bc('0x23')](_0x83bc('0x24'),_0x5d89d4[_0x83bc('0x25')],_0x5d89d4[_0x83bc('0x26')]);logger[_0x83bc('0x27')](_0x83bc('0x28'),util[_0x83bc('0x1a')](_0x5d89d4,{'showHidden':![],'depth':null}));var _0x4b9ae4=_[_0x83bc('0x29')](this[_0x83bc('0xc')],{'defaultuser':_0x5d89d4['username']});if(_0x4b9ae4){_0x5d89d4['stateRegistry']=_0x5d89d4[_0x83bc('0x26')];_[_0x83bc('0x2a')](_0x4b9ae4,_[_0x83bc('0x2b')](_0x5d89d4,[_0x83bc('0x2c'),_0x83bc('0x2d'),_0x83bc('0x25'),_0x83bc('0x26')]));logger[_0x83bc('0x27')](_0x83bc('0x2e'),util[_0x83bc('0x1a')](_0x4b9ae4,{'showHidden':![],'depth':null}));this[_0x83bc('0x22')](util[_0x83bc('0x2f')](_0x83bc('0x30'),_0x4b9ae4[_0x83bc('0x31')]),_0x83bc('0x32'),_0x4b9ae4);}}}catch(_0x4fcffb){logger['error'](_0x83bc('0x28'),util['inspect'](_0x4fcffb,{'showHidden':![],'depth':null}));}};UserReport[_0x83bc('0x1e')][_0x83bc('0x13')]=function(_0xd1858a){try{if(this[_0x83bc('0x20')](_0xd1858a)){logger[_0x83bc('0x23')](_0x83bc('0x33'),_0xd1858a[_0x83bc('0x34')],_0xd1858a['state']);logger[_0x83bc('0x27')](_0x83bc('0x35'),util[_0x83bc('0x1a')](_0xd1858a,{'showHidden':![],'depth':null}));if(this[_0x83bc('0xd')][_0xd1858a[_0x83bc('0x34')]]){if(!this[_0x83bc('0xd')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x36')]||_0xd1858a[_0x83bc('0x26')]['toLowerCase']()=='inuse'){this[_0x83bc('0xd')][_0xd1858a['device']][_0x83bc('0x36')]=![];if(this[_0x83bc('0xd')][_0xd1858a['device']][_0x83bc('0x26')]!==_0xd1858a[_0x83bc('0x26')]['toLowerCase']()){this[_0x83bc('0xd')][_0xd1858a['device']][_0x83bc('0x37')]=_[_0x83bc('0x38')](moment()[_0x83bc('0x2f')]('x'));}this[_0x83bc('0xd')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x26')]=_0xd1858a['state']['toLowerCase']();this[_0x83bc('0xd')][_0xd1858a[_0x83bc('0x34')]]['updateStatusRealtime'](_0xd1858a);}}else if(this[_0x83bc('0xe')][_0xd1858a[_0x83bc('0x34')]]){if(this[_0x83bc('0xe')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x26')]!==_0xd1858a['state'][_0x83bc('0x39')]()){this[_0x83bc('0xe')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x37')]=_[_0x83bc('0x38')](moment()[_0x83bc('0x2f')]('x'));}this[_0x83bc('0xe')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x26')]=_0xd1858a[_0x83bc('0x26')][_0x83bc('0x39')]();logger['debug'](_0x83bc('0x3a'),util['inspect'](this['telephones'][_0xd1858a[_0x83bc('0x34')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x83bc('0x2f')](_0x83bc('0x3b'),this[_0x83bc('0xe')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x31')]),_0x83bc('0x3c'),this['telephones'][_0xd1858a[_0x83bc('0x34')]]);}else if(this[_0x83bc('0xc')][_0xd1858a[_0x83bc('0x34')]]){if(this['trunks'][_0xd1858a[_0x83bc('0x34')]]['state']!==_0xd1858a[_0x83bc('0x26')]['toLowerCase']()){this['trunks'][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x37')]=_[_0x83bc('0x38')](moment()['format']('x'));}this[_0x83bc('0xc')][_0xd1858a['device']][_0x83bc('0x26')]=_0xd1858a['state'][_0x83bc('0x39')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x83bc('0x1a')](this['trunks'][_0xd1858a['device']],{'showHidden':![],'depth':null}));this[_0x83bc('0x22')](util[_0x83bc('0x2f')](_0x83bc('0x30'),this[_0x83bc('0xc')][_0xd1858a[_0x83bc('0x34')]][_0x83bc('0x31')]),_0x83bc('0x32'),this[_0x83bc('0xc')][_0xd1858a[_0x83bc('0x34')]]);}else if(_[_0x83bc('0x3d')](_0xd1858a[_0x83bc('0x34')],_0x83bc('0x3e'))){var _0x1f1ceb=_0xd1858a['device'];var _0x235530=_0x1f1ceb['substring'](_0x1f1ceb[_0x83bc('0x3f')]('/')+0x1,_0x1f1ceb['indexOf']('@'));var _0x1a339e=_[_0x83bc('0x29')](this[_0x83bc('0xd')],function(_0x9cc5e3){return _0x9cc5e3['mobile']==_0x235530||_0x9cc5e3[_0x83bc('0x40')]==_0x235530||_0x9cc5e3[_0x83bc('0x41')]==_0x235530;});if(_0x1a339e){if(_0x1a339e[_0x83bc('0x26')]!==_0xd1858a[_0x83bc('0x26')][_0x83bc('0x39')]()){_0x1a339e[_0x83bc('0x37')]=_['toNumber'](moment()[_0x83bc('0x2f')]('x'));}_0x1a339e['state']=_0xd1858a[_0x83bc('0x26')][_0x83bc('0x39')]();_0x1a339e[_0x83bc('0x36')]=!![];_0x1a339e[_0x83bc('0x42')](_0xd1858a);}}}}catch(_0x3155a0){logger[_0x83bc('0x18')](_0x83bc('0x35'),util['inspect'](_0x3155a0,{'showHidden':![],'depth':null}));}};UserReport[_0x83bc('0x1e')][_0x83bc('0x14')]=function(_0x372bce){try{if(this[_0x83bc('0x20')](_0x372bce)&&this[_0x83bc('0x20')](_0x372bce[_0x83bc('0x43')])){logger[_0x83bc('0x23')](_0x83bc('0x44'),_0x372bce[_0x83bc('0x45')],_0x372bce[_0x83bc('0x46')],_0x372bce[_0x83bc('0x43')]);logger[_0x83bc('0x27')](_0x83bc('0x47'),util[_0x83bc('0x1a')](_0x372bce,{'showHidden':![],'depth':null}));if(this[_0x83bc('0xd')][_0x372bce[_0x83bc('0x45')]]){if(!this[_0x83bc('0xd')][_0x372bce[_0x83bc('0x45')]]['local']||_0x372bce[_0x83bc('0x43')][_0x83bc('0x39')]()=='registered'){this[_0x83bc('0xd')][_0x372bce['peer']][_0x83bc('0x36')]=![];this[_0x83bc('0xd')][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x48')]=_0x372bce[_0x83bc('0x43')][_0x83bc('0x39')]();this[_0x83bc('0xd')][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x46')]=_0x372bce[_0x83bc('0x46')];this[_0x83bc('0xd')][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x42')](_0x372bce);}}else if(this[_0x83bc('0xe')][_0x372bce[_0x83bc('0x45')]]){this[_0x83bc('0xe')][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x48')]=_0x372bce['peerstatus'][_0x83bc('0x39')]();this['telephones'][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x46')]=_0x372bce[_0x83bc('0x46')];logger[_0x83bc('0x27')](_0x83bc('0x49'),util['inspect'](this['telephones'][_0x372bce[_0x83bc('0x45')]],{'showHidden':![],'depth':null}));this[_0x83bc('0x22')](util[_0x83bc('0x2f')](_0x83bc('0x3b'),this[_0x83bc('0xe')][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x31')]),_0x83bc('0x3c'),this[_0x83bc('0xe')][_0x372bce[_0x83bc('0x45')]]);}else if(this[_0x83bc('0xc')][_0x372bce[_0x83bc('0x45')]]){this[_0x83bc('0xc')][_0x372bce['peer']][_0x83bc('0x48')]=_0x372bce[_0x83bc('0x43')]['toLowerCase']();this[_0x83bc('0xc')][_0x372bce[_0x83bc('0x45')]][_0x83bc('0x46')]=_0x372bce['address'];logger[_0x83bc('0x27')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x83bc('0x1a')](this['trunks'][_0x372bce['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x83bc('0x2f')](_0x83bc('0x30'),this[_0x83bc('0xc')][_0x372bce[_0x83bc('0x45')]]['name']),_0x83bc('0x32'),this[_0x83bc('0xc')][_0x372bce[_0x83bc('0x45')]]);}}}catch(_0x5c7cb2){logger['error'](_0x83bc('0x47'),util[_0x83bc('0x1a')](_0x5c7cb2,{'showHidden':![],'depth':null}));}};module[_0x83bc('0x4a')]=UserReport; \ No newline at end of file +var _0x4380=['[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','inuse','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','trunk:%s','startsWith','Local','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','registered','peer','status','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','error','catch','[userReport][devicestatelist]','inspect','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x4380,0x153));var _0x0438=function(_0x45645f,_0x239c93){_0x45645f=_0x45645f-0x0;var _0x389d94=_0x4380[_0x45645f];return _0x389d94;};'use strict';var _=require(_0x0438('0x0'));var moment=require(_0x0438('0x1'));var util=require(_0x0438('0x2'));var Redis=require(_0x0438('0x3'));var BPromise=require(_0x0438('0x4'));var config=require('../../../config/environment');var logger=require(_0x0438('0x5'))(_0x0438('0x6'));var ami=require(_0x0438('0x7'));config[_0x0438('0x8')]=_[_0x0438('0x9')](config[_0x0438('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x0438('0xa'))(new Redis(config['redis']));function UserReport(_0x2b2fbf){this[_0x0438('0xb')]=_0x2b2fbf['trunks'];this[_0x0438('0xc')]=_0x2b2fbf['agents'];this['telephones']=_0x2b2fbf[_0x0438('0xd')];ami['on'](_0x0438('0xe'),this[_0x0438('0xf')][_0x0438('0x10')](this));ami['on']('registry',this['syncRegistry'][_0x0438('0x10')](this));ami['on'](_0x0438('0x11'),this[_0x0438('0x12')][_0x0438('0x10')](this));ami['on'](_0x0438('0x13'),this[_0x0438('0x14')][_0x0438('0x10')](this));return this[_0x0438('0x15')]();}function showSipRegistrations(){Promise[_0x0438('0x16')]()[_0x0438('0x17')](ami[_0x0438('0x18')]())['catch'](function(_0x1f1bb7){logger[_0x0438('0x19')]('[userReport][sipshowregistry]',util['inspect'](_0x1f1bb7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x0438('0x16')]()['then'](ami['actionDeviceStateList']())[_0x0438('0x1a')](function(_0x1a7bdf){logger[_0x0438('0x19')](_0x0438('0x1b'),util[_0x0438('0x1c')](_0x1a7bdf,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x0438('0x16')]()[_0x0438('0x17')](ami[_0x0438('0x1d')]())[_0x0438('0x1a')](function(_0x58363b){logger['error'](_0x0438('0x1e'),util[_0x0438('0x1c')](_0x58363b,{'showHidden':![],'depth':null}));});}UserReport[_0x0438('0x1f')][_0x0438('0x15')]=function(){setInterval(function(){BPromise[_0x0438('0x16')]()[_0x0438('0x17')](showSipRegistrations())[_0x0438('0x17')](listDeviceStates())[_0x0438('0x17')](showPeersStatus());},0x32c8);};UserReport[_0x0438('0x1f')][_0x0438('0x20')]=function(_0x2eaf08){return _0x2eaf08!==null&&!_[_0x0438('0x21')](_0x2eaf08);};UserReport[_0x0438('0x1f')][_0x0438('0x22')]=function(_0x3dd905,_0x4f0e9c,_0x29ea9a){io['to'](_0x3dd905)['emit'](_0x4f0e9c,_0x29ea9a);};UserReport[_0x0438('0x1f')][_0x0438('0xf')]=function(_0x55145c){try{if(this['isNotNull'](_0x55145c)){logger[_0x0438('0x23')](_0x0438('0x24'),_0x55145c[_0x0438('0x25')],_0x55145c[_0x0438('0x26')]);logger[_0x0438('0x27')](_0x0438('0x28'),util[_0x0438('0x1c')](_0x55145c,{'showHidden':![],'depth':null}));var _0x5092ff=_[_0x0438('0x29')](this[_0x0438('0xb')],{'defaultuser':_0x55145c[_0x0438('0x25')]});if(_0x5092ff){_0x55145c[_0x0438('0x2a')]=_0x55145c[_0x0438('0x26')];_[_0x0438('0x2b')](_0x5092ff,_[_0x0438('0x2c')](_0x55145c,[_0x0438('0x2d'),_0x0438('0x2e'),'username','state']));logger[_0x0438('0x27')](_0x0438('0x2f'),util['inspect'](_0x5092ff,{'showHidden':![],'depth':null}));this[_0x0438('0x22')](util[_0x0438('0x30')]('trunk:%s',_0x5092ff[_0x0438('0x31')]),_0x0438('0x32'),_0x5092ff);}}}catch(_0x49dfa7){logger['error'](_0x0438('0x28'),util['inspect'](_0x49dfa7,{'showHidden':![],'depth':null}));}};UserReport[_0x0438('0x1f')]['syncDeviceState']=function(_0x5aae58){try{if(this[_0x0438('0x20')](_0x5aae58)){logger['info'](_0x0438('0x33'),_0x5aae58[_0x0438('0x34')],_0x5aae58['state']);logger[_0x0438('0x27')](_0x0438('0x35'),util['inspect'](_0x5aae58,{'showHidden':![],'depth':null}));if(this['agents'][_0x5aae58['device']]){if(!this[_0x0438('0xc')][_0x5aae58[_0x0438('0x34')]]['local']||_0x5aae58[_0x0438('0x26')]['toLowerCase']()==_0x0438('0x36')){this['agents'][_0x5aae58[_0x0438('0x34')]][_0x0438('0x37')]=![];if(this[_0x0438('0xc')][_0x5aae58['device']][_0x0438('0x26')]!==_0x5aae58[_0x0438('0x26')][_0x0438('0x38')]()){this[_0x0438('0xc')][_0x5aae58[_0x0438('0x34')]][_0x0438('0x39')]=_[_0x0438('0x3a')](moment()['format']('x'));}this[_0x0438('0xc')][_0x5aae58['device']]['state']=_0x5aae58[_0x0438('0x26')]['toLowerCase']();this[_0x0438('0xc')][_0x5aae58[_0x0438('0x34')]][_0x0438('0x3b')](_0x5aae58);}}else if(this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]]){if(this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]][_0x0438('0x26')]!==_0x5aae58['state'][_0x0438('0x38')]()){this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]]['stateTime']=_['toNumber'](moment()[_0x0438('0x30')]('x'));}this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]][_0x0438('0x26')]=_0x5aae58['state'][_0x0438('0x38')]();logger[_0x0438('0x27')](_0x0438('0x3c'),util[_0x0438('0x1c')](this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0438('0x30')]('telephone:%s',this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]]['name']),_0x0438('0x3d'),this[_0x0438('0xd')][_0x5aae58[_0x0438('0x34')]]);}else if(this['trunks'][_0x5aae58[_0x0438('0x34')]]){if(this[_0x0438('0xb')][_0x5aae58[_0x0438('0x34')]][_0x0438('0x26')]!==_0x5aae58['state'][_0x0438('0x38')]()){this[_0x0438('0xb')][_0x5aae58[_0x0438('0x34')]]['stateTime']=_[_0x0438('0x3a')](moment()[_0x0438('0x30')]('x'));}this['trunks'][_0x5aae58[_0x0438('0x34')]]['state']=_0x5aae58['state'][_0x0438('0x38')]();logger[_0x0438('0x27')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0x0438('0x1c')](this[_0x0438('0xb')][_0x5aae58[_0x0438('0x34')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x0438('0x30')](_0x0438('0x3e'),this[_0x0438('0xb')][_0x5aae58['device']][_0x0438('0x31')]),'trunk:save',this[_0x0438('0xb')][_0x5aae58['device']]);}else if(_[_0x0438('0x3f')](_0x5aae58[_0x0438('0x34')],_0x0438('0x40'))){var _0x4949f4=_0x5aae58[_0x0438('0x34')];var _0x177420=_0x4949f4['substring'](_0x4949f4[_0x0438('0x41')]('/')+0x1,_0x4949f4[_0x0438('0x41')]('@'));var _0x4cf325=_[_0x0438('0x29')](this['agents'],function(_0x4b28bd){return _0x4b28bd[_0x0438('0x42')]==_0x177420||_0x4b28bd[_0x0438('0x43')]==_0x177420||_0x4b28bd[_0x0438('0x44')]==_0x177420;});if(_0x4cf325){if(_0x4cf325[_0x0438('0x26')]!==_0x5aae58[_0x0438('0x26')][_0x0438('0x38')]()){_0x4cf325[_0x0438('0x39')]=_[_0x0438('0x3a')](moment()[_0x0438('0x30')]('x'));}_0x4cf325['state']=_0x5aae58[_0x0438('0x26')]['toLowerCase']();_0x4cf325['local']=!![];_0x4cf325['updateStatusRealtime'](_0x5aae58);}}}}catch(_0x53cc27){logger[_0x0438('0x19')]('[userReport][devicestatechange]',util[_0x0438('0x1c')](_0x53cc27,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x1132f5){try{if(this[_0x0438('0x20')](_0x1132f5)&&this[_0x0438('0x20')](_0x1132f5[_0x0438('0x13')])){logger['info'](_0x0438('0x45'),_0x1132f5['peer'],_0x1132f5[_0x0438('0x46')],_0x1132f5['peerstatus']);logger[_0x0438('0x27')]('[userReport][peerstatus]',util[_0x0438('0x1c')](_0x1132f5,{'showHidden':![],'depth':null}));if(this[_0x0438('0xc')][_0x1132f5['peer']]){if(!this['agents'][_0x1132f5['peer']][_0x0438('0x37')]||_0x1132f5[_0x0438('0x13')][_0x0438('0x38')]()==_0x0438('0x47')){this[_0x0438('0xc')][_0x1132f5[_0x0438('0x48')]][_0x0438('0x37')]=![];this['agents'][_0x1132f5[_0x0438('0x48')]][_0x0438('0x49')]=_0x1132f5[_0x0438('0x13')]['toLowerCase']();this[_0x0438('0xc')][_0x1132f5[_0x0438('0x48')]]['address']=_0x1132f5[_0x0438('0x46')];this[_0x0438('0xc')][_0x1132f5[_0x0438('0x48')]][_0x0438('0x3b')](_0x1132f5);}}else if(this[_0x0438('0xd')][_0x1132f5['peer']]){this[_0x0438('0xd')][_0x1132f5[_0x0438('0x48')]][_0x0438('0x49')]=_0x1132f5[_0x0438('0x13')][_0x0438('0x38')]();this[_0x0438('0xd')][_0x1132f5[_0x0438('0x48')]][_0x0438('0x46')]=_0x1132f5[_0x0438('0x46')];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x0438('0x1c')](this['telephones'][_0x1132f5[_0x0438('0x48')]],{'showHidden':![],'depth':null}));this[_0x0438('0x22')](util[_0x0438('0x30')](_0x0438('0x4a'),this[_0x0438('0xd')][_0x1132f5['peer']][_0x0438('0x31')]),_0x0438('0x3d'),this[_0x0438('0xd')][_0x1132f5[_0x0438('0x48')]]);}else if(this['trunks'][_0x1132f5['peer']]){this[_0x0438('0xb')][_0x1132f5['peer']][_0x0438('0x49')]=_0x1132f5['peerstatus']['toLowerCase']();this[_0x0438('0xb')][_0x1132f5[_0x0438('0x48')]][_0x0438('0x46')]=_0x1132f5['address'];logger[_0x0438('0x27')](_0x0438('0x4b'),util[_0x0438('0x1c')](this[_0x0438('0xb')][_0x1132f5['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x0438('0x30')]('trunk:%s',this['trunks'][_0x1132f5[_0x0438('0x48')]][_0x0438('0x31')]),'trunk:save',this[_0x0438('0xb')][_0x1132f5[_0x0438('0x48')]]);}}}catch(_0x1ed660){logger[_0x0438('0x19')](_0x0438('0x4c'),util[_0x0438('0x1c')](_0x1ed660,{'showHidden':![],'depth':null}));}};module[_0x0438('0x4d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 40d10bb..5a1a059 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 _0x1c3b=['values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','seconds','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','channels','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','merge','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','agentringnoanswerAt','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','agentcompleteAt','complete','talktime','acw','acwtime','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','variable','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s'];(function(_0x53976e,_0x313deb){var _0x330aae=function(_0x4bc250){while(--_0x4bc250){_0x53976e['push'](_0x53976e['shift']());}};_0x330aae(++_0x313deb);}(_0x1c3b,0xab));var _0xb1c3=function(_0x11402d,_0xfa566){_0x11402d=_0x11402d-0x0;var _0x4f28d6=_0x1c3b[_0x11402d];return _0x4f28d6;};'use strict';var _=require(_0xb1c3('0x0'));var moment=require(_0xb1c3('0x1'));var util=require(_0xb1c3('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb1c3('0x3'))(_0xb1c3('0x4'));var ami=require(_0xb1c3('0x5'));config[_0xb1c3('0x6')]=_[_0xb1c3('0x7')](config[_0xb1c3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb1c3('0x8'))(new Redis(config[_0xb1c3('0x6')]));function VoiceAgentReport(_0x211254){this['channels']={};this['voiceChannels']=_0x211254['channels'];this['voiceQueues']=_0x211254[_0xb1c3('0x9')];this['agents']=_0x211254[_0xb1c3('0xa')];this[_0xb1c3('0xb')]={};ami['on'](_0xb1c3('0xc'),this['syncAgentCalled'][_0xb1c3('0xd')](this));ami['on'](_0xb1c3('0xe'),this[_0xb1c3('0xf')]['bind'](this));ami['on'](_0xb1c3('0x10'),this[_0xb1c3('0x11')][_0xb1c3('0xd')](this));ami['on'](_0xb1c3('0x12'),this['syncQueueCallerAbandon'][_0xb1c3('0xd')](this));ami['on'](_0xb1c3('0x13'),this[_0xb1c3('0x14')]['bind'](this));ami['on'](_0xb1c3('0x15'),this[_0xb1c3('0x16')]['bind'](this));ami['on'](_0xb1c3('0x17'),this[_0xb1c3('0x18')][_0xb1c3('0xd')](this));ami['on'](_0xb1c3('0x19'),this[_0xb1c3('0x1a')]['bind'](this));ami['on'](_0xb1c3('0x1b'),this[_0xb1c3('0x1c')][_0xb1c3('0xd')](this));ami['on'](_0xb1c3('0x1d'),this[_0xb1c3('0x1e')]['bind'](this));ami['on'](_0xb1c3('0x1f'),this[_0xb1c3('0x20')][_0xb1c3('0xd')](this));}VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x22')]=function(_0x4165d4,_0x39149e,_0x3d0672){io['to'](_0x4165d4)[_0xb1c3('0x22')](_0x39149e,_0x3d0672);};VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x23')]=function(_0x32d993){return _0x32d993!==null&&!_[_0xb1c3('0x24')](_0x32d993);};VoiceAgentReport['prototype'][_0xb1c3('0x25')]=function(_0x443040){try{if(this[_0xb1c3('0x23')](_0x443040)){logger[_0xb1c3('0x26')](_0xb1c3('0x27'),_0x443040[_0xb1c3('0x28')],_0x443040['membername'],_0x443040['destuniqueid']);logger[_0xb1c3('0x29')](_0xb1c3('0x2a'),_0x443040['uniqueid'],util[_0xb1c3('0x2b')](_0x443040,{'showHidden':![],'depth':null}));if(_[_0xb1c3('0x24')](this[_0xb1c3('0x2c')][_0x443040[_0xb1c3('0x28')]])){this['channels'][_0x443040[_0xb1c3('0x28')]]={};}if(_[_0xb1c3('0x24')](this[_0xb1c3('0x2c')][_0x443040[_0xb1c3('0x28')]][_0x443040[_0xb1c3('0x2d')]])){this['channels'][_0x443040[_0xb1c3('0x28')]][_0x443040[_0xb1c3('0x2d')]]={'agentcalledAt':moment()[_0xb1c3('0x2e')](_0xb1c3('0x2f')),'lastevent':_0xb1c3('0x30'),'mandatoryDisposition':this[_0xb1c3('0x9')][_0x443040[_0xb1c3('0x31')]]?this[_0xb1c3('0x9')][_0x443040[_0xb1c3('0x31')]][_0xb1c3('0x32')]||![]:![],'type':this[_0xb1c3('0x9')][_0x443040[_0xb1c3('0x31')]]?this[_0xb1c3('0x9')][_0x443040['queue']][_0xb1c3('0x33')]||'inbound':_0xb1c3('0x34'),'variables':this['variables'][_0x443040[_0xb1c3('0x28')]],'motionChannel':_0xb1c3('0x35')};}_[_0xb1c3('0x36')](this[_0xb1c3('0x2c')][_0x443040[_0xb1c3('0x28')]][_0x443040[_0xb1c3('0x2d')]],_['omit'](_0x443040,['event',_0xb1c3('0x37')]));logger[_0xb1c3('0x29')](_0xb1c3('0x38'),_0x443040[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this[_0xb1c3('0x2c')][_0x443040[_0xb1c3('0x28')]][_0x443040['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xb1c3('0x22')]('custom:agentcalled',this[_0xb1c3('0x2c')][_0x443040[_0xb1c3('0x28')]][_0x443040['destuniqueid']]);logger[_0xb1c3('0x29')](_0xb1c3('0x39'),_0x443040[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this['channels'][_0x443040[_0xb1c3('0x28')]][_0x443040[_0xb1c3('0x2d')]],{'showHidden':![],'depth':null}));this[_0xb1c3('0x22')](util[_0xb1c3('0x2e')](_0xb1c3('0x3a'),_0x443040[_0xb1c3('0x3b')]),_0xb1c3('0x3c'),this[_0xb1c3('0x2c')][_0x443040[_0xb1c3('0x28')]][_0x443040[_0xb1c3('0x2d')]]);}}catch(_0xc2b745){logger[_0xb1c3('0x3d')]('[%s][voiceAgentReport][agentcalled]',_0x443040[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0xc2b745,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb1c3('0xf')]=function(_0x1dacd0){try{if(this[_0xb1c3('0x23')](_0x1dacd0)){if(this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]]){logger[_0xb1c3('0x29')](_0xb1c3('0x3e'),_0x1dacd0[_0xb1c3('0x28')],util['inspect'](_0x1dacd0,{'showHidden':![],'depth':null}));for(var _0x2e6bdc in this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]]){if(this['channels'][_0x1dacd0['uniqueid']][_0xb1c3('0x3f')](_0x2e6bdc)){if(_0x1dacd0[_0xb1c3('0x2d')]===_0x2e6bdc){logger['info'](_0xb1c3('0x40'),_0x1dacd0[_0xb1c3('0x28')],_0x1dacd0['membername'],_0x1dacd0[_0xb1c3('0x2d')]);this['channels'][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc]['agentconnectAt']=moment()[_0xb1c3('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x41')]=_0x1dacd0[_0xb1c3('0x41')];this['channels'][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x42')]=_0x1dacd0['connectedlinenum'];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x43')]=_0x1dacd0[_0xb1c3('0x43')];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x44')]=_0x1dacd0[_0xb1c3('0x44')];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc]['holdtime']=_0x1dacd0[_0xb1c3('0x45')];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x46')]='connect';if(this['voiceChannels'][this['channels'][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x28')]]){var _0x561640=this[_0xb1c3('0x47')][this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x28')]][_0xb1c3('0x48')];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x48')]=_0x561640;_0x1dacd0[_0xb1c3('0x48')]=_0x561640;}_[_0xb1c3('0x36')](this[_0xb1c3('0xa')][_0x1dacd0[_0xb1c3('0x49')]],_[_0xb1c3('0x4a')](_0x1dacd0,[_0xb1c3('0x31'),_0xb1c3('0x4b'),_0xb1c3('0x48')]));logger[_0xb1c3('0x29')](_0xb1c3('0x4c'),_0x1dacd0[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x1dacd0[_0xb1c3('0x2d')]],{'showHidden':![],'depth':null}));ami[_0xb1c3('0x22')]('custom:agentconnect',this['channels'][_0x1dacd0[_0xb1c3('0x28')]][_0x1dacd0['destuniqueid']]);logger[_0xb1c3('0x29')](_0xb1c3('0x4d'),_0x1dacd0['uniqueid'],util[_0xb1c3('0x2b')](this[_0xb1c3('0x2c')][_0x1dacd0['uniqueid']][_0x1dacd0[_0xb1c3('0x2d')]],{'showHidden':![],'depth':null}));this[_0xb1c3('0x22')](util[_0xb1c3('0x2e')](_0xb1c3('0x3a'),_0x1dacd0[_0xb1c3('0x3b')]),_0xb1c3('0x4e'),this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x1dacd0[_0xb1c3('0x2d')]]);}else if(!this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc]['agentringnoanswer']&&!this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x13')]){logger[_0xb1c3('0x26')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x1dacd0[_0xb1c3('0x28')],this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x3b')],_0x2e6bdc);this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x10')]=!![];this[_0xb1c3('0x2c')][_0x1dacd0['uniqueid']][_0x2e6bdc]['agentringnoanswerAt']=moment()[_0xb1c3('0x2e')](_0xb1c3('0x2f'));this[_0xb1c3('0x2c')][_0x1dacd0['uniqueid']][_0x2e6bdc][_0xb1c3('0x4f')]=_0x1dacd0[_0xb1c3('0x2d')];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x50')]=_0x1dacd0[_0xb1c3('0x3b')];this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc][_0xb1c3('0x46')]=_0xb1c3('0x51');this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc]['reason']=_0xb1c3('0x51');logger[_0xb1c3('0x29')](_0xb1c3('0x52'),_0x1dacd0[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this[_0xb1c3('0x2c')][_0x1dacd0[_0xb1c3('0x28')]][_0x2e6bdc],{'showHidden':![],'depth':null}));ami['emit'](_0xb1c3('0x53'),this[_0xb1c3('0x2c')][_0x1dacd0['uniqueid']][_0x2e6bdc]);}}}}}}catch(_0x4c0be7){logger[_0xb1c3('0x3d')](_0xb1c3('0x54'),_0x1dacd0['uniqueid'],util[_0xb1c3('0x2b')](_0x4c0be7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')]['syncAgentRingNoAnswer']=function(_0x5587f8){try{if(this[_0xb1c3('0x23')](_0x5587f8)){logger[_0xb1c3('0x29')](_0xb1c3('0x55'),_0x5587f8['uniqueid'],util[_0xb1c3('0x2b')](_0x5587f8,{'showHidden':![],'depth':null}));if(this[_0xb1c3('0x2c')][_0x5587f8[_0xb1c3('0x28')]]&&this['channels'][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]]){logger[_0xb1c3('0x26')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x5587f8[_0xb1c3('0x28')],_0x5587f8['membername'],_0x5587f8['destuniqueid']);this[_0xb1c3('0x2c')][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]]['agentringnoanswer']=!![];this[_0xb1c3('0x2c')][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]][_0xb1c3('0x56')]=moment()[_0xb1c3('0x2e')](_0xb1c3('0x2f'));this[_0xb1c3('0x2c')][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]][_0xb1c3('0x46')]=_0xb1c3('0x57');this[_0xb1c3('0x2c')][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]][_0xb1c3('0x58')]=_0xb1c3('0x57');logger[_0xb1c3('0x29')](_0xb1c3('0x59'),_0x5587f8[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this['channels'][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this['channels'][_0x5587f8[_0xb1c3('0x28')]][_0x5587f8[_0xb1c3('0x2d')]]);}}}catch(_0x15852c){logger[_0xb1c3('0x3d')]('[%s][voiceAgentReport][agentringnoanswer]',_0x5587f8[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0x15852c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb1c3('0x5a')]=function(_0xccd347){try{if(this[_0xb1c3('0x23')](_0xccd347)){logger[_0xb1c3('0x29')](_0xb1c3('0x5b'),_0xccd347[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0xccd347,{'showHidden':![],'depth':null}));if(this['channels'][_0xccd347[_0xb1c3('0x28')]]){for(var _0x57f06e in this[_0xb1c3('0x2c')][_0xccd347['uniqueid']]){if(this['channels'][_0xccd347[_0xb1c3('0x28')]][_0xb1c3('0x3f')](_0x57f06e)&&!this['channels'][_0xccd347[_0xb1c3('0x28')]][_0x57f06e][_0xb1c3('0x10')]&&!this[_0xb1c3('0x2c')][_0xccd347[_0xb1c3('0x28')]][_0x57f06e][_0xb1c3('0x13')]){logger[_0xb1c3('0x26')](_0xb1c3('0x5c'),_0xccd347[_0xb1c3('0x28')],this[_0xb1c3('0x2c')][_0xccd347[_0xb1c3('0x28')]][_0x57f06e][_0xb1c3('0x3b')],_0x57f06e);this[_0xb1c3('0x2c')][_0xccd347['uniqueid']][_0x57f06e][_0xb1c3('0x10')]=!![];this[_0xb1c3('0x2c')][_0xccd347[_0xb1c3('0x28')]][_0x57f06e][_0xb1c3('0x56')]=moment()[_0xb1c3('0x2e')](_0xb1c3('0x2f'));this['channels'][_0xccd347[_0xb1c3('0x28')]][_0x57f06e][_0xb1c3('0x46')]='abandoned';this[_0xb1c3('0x2c')][_0xccd347[_0xb1c3('0x28')]][_0x57f06e]['reason']='abandoned';logger[_0xb1c3('0x29')](_0xb1c3('0x5d'),_0xccd347[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this['channels'][_0xccd347['uniqueid']][_0x57f06e],{'showHidden':![],'depth':null}));ami[_0xb1c3('0x22')]('custom:agentqueuecallerabandon',this['channels'][_0xccd347[_0xb1c3('0x28')]][_0x57f06e]);}}}}}catch(_0x9b58e2){logger[_0xb1c3('0x3d')](_0xb1c3('0x5e'),_0xccd347[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0x9b58e2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x14')]=function(_0x5be9b9){try{if(this['isNotNull'](_0x5be9b9)){logger[_0xb1c3('0x29')](_0xb1c3('0x5f'),_0x5be9b9[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0x5be9b9,{'showHidden':![],'depth':null}));if(this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]]){for(var _0x4197ce in this['channels'][_0x5be9b9['uniqueid']]){if(this[_0xb1c3('0x2c')][_0x5be9b9['uniqueid']]['hasOwnProperty'](_0x4197ce)){if(this[_0xb1c3('0x2c')][_0x5be9b9['uniqueid']][_0x4197ce][_0xb1c3('0x60')]&&!this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce][_0xb1c3('0x13')]){logger[_0xb1c3('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5be9b9[_0xb1c3('0x28')],this['channels'][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce]['membername'],_0x4197ce);this[_0xb1c3('0x2c')][_0x5be9b9['uniqueid']][_0x4197ce][_0xb1c3('0x13')]=!![];this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce][_0xb1c3('0x61')]=moment()[_0xb1c3('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce]['lastevent']=_0xb1c3('0x62');this['channels'][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce][_0xb1c3('0x58')]=_0x5be9b9[_0xb1c3('0x58')]=='transfer'?'agent':_0x5be9b9['reason'];this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce][_0xb1c3('0x63')]=_0x5be9b9['talktime'];if(this[_0xb1c3('0x9')][_0x5be9b9[_0xb1c3('0x31')]]&&this['voiceQueues'][_0x5be9b9[_0xb1c3('0x31')]][_0xb1c3('0x64')]){this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce][_0xb1c3('0x65')]=this[_0xb1c3('0x9')][_0x5be9b9[_0xb1c3('0x31')]]['acwTimeout'];this['channels'][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce][_0xb1c3('0x66')]=!![];}this[_0xb1c3('0xa')][_0x5be9b9[_0xb1c3('0x49')]]=_[_0xb1c3('0x67')](this['agents'][_0x5be9b9[_0xb1c3('0x49')]],[_0xb1c3('0x31'),_0xb1c3('0x4b')]);logger[_0xb1c3('0x29')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5be9b9[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce],{'showHidden':![],'depth':null}));ami[_0xb1c3('0x22')]('custom:agentcomplete',this['channels'][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce]);logger['debug'](_0xb1c3('0x68'),_0x5be9b9[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](this[_0xb1c3('0x2c')][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce],{'showHidden':![],'depth':null}));this[_0xb1c3('0x22')](util[_0xb1c3('0x2e')](_0xb1c3('0x3a'),_0x5be9b9['membername']),_0xb1c3('0x69'),this['channels'][_0x5be9b9[_0xb1c3('0x28')]][_0x4197ce]);}}}}}}catch(_0xe9352b){logger[_0xb1c3('0x3d')](_0xb1c3('0x6a'),_0x5be9b9['uniqueid'],util[_0xb1c3('0x2b')](_0xe9352b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x16')]=function(_0x475921){try{if(this[_0xb1c3('0x23')](_0x475921)){logger[_0xb1c3('0x29')](_0xb1c3('0x6b'),_0x475921[_0xb1c3('0x28')],util['inspect'](_0x475921,{'showHidden':![],'depth':null}));this['addVariable'](_0x475921[_0xb1c3('0x28')],_['keys'](_0x475921['variable'])[0x0],_0x475921['value']);if(this[_0xb1c3('0x2c')][_0x475921['uniqueid']]){for(var _0x4b9456 in this[_0xb1c3('0x2c')][_0x475921['uniqueid']]){if(this[_0xb1c3('0x2c')][_0x475921[_0xb1c3('0x28')]][_0xb1c3('0x3f')](_0x4b9456)){logger[_0xb1c3('0x26')](_0xb1c3('0x6c'),_0x475921['uniqueid'],_0x4b9456,_[_0xb1c3('0x6d')](_0x475921[_0xb1c3('0x6e')])[0x0],_0x475921['value']);if(_[_0xb1c3('0x24')](this[_0xb1c3('0x2c')][_0x475921[_0xb1c3('0x28')]][_0x4b9456][_0xb1c3('0xb')])){this[_0xb1c3('0x2c')][_0x475921[_0xb1c3('0x28')]][_0x4b9456][_0xb1c3('0xb')]={};}this['channels'][_0x475921[_0xb1c3('0x28')]][_0x4b9456]['variables']=this[_0xb1c3('0xb')][_0x475921[_0xb1c3('0x28')]];}}}}}catch(_0x44f9d3){logger[_0xb1c3('0x3d')]('[%s][voiceAgentReport][varset]',_0x475921[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0x44f9d3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x6f')]=function(_0x5c544b,_0x2e8c60,_0x3749c3){var _0x1ef2b1=[_0xb1c3('0x70'),_0xb1c3('0x71'),_0xb1c3('0x72'),_0xb1c3('0x73'),'rtpaudioqosloss',_0xb1c3('0x74'),'rtpaudioqosrtt',_0xb1c3('0x75'),_0xb1c3('0x76'),_0xb1c3('0x77'),_0xb1c3('0x78'),'bridgepvtcallid',_0xb1c3('0x79'),'memberdynamic',_0xb1c3('0x7a'),_0xb1c3('0x7b'),_0xb1c3('0x3b'),_0xb1c3('0x7c'),_0xb1c3('0x7d')];if(!_[_0xb1c3('0x7e')](_0x2e8c60)&&!_[_0xb1c3('0x7f')](_0x1ef2b1,_0x2e8c60)){if(_[_0xb1c3('0x24')](this[_0xb1c3('0xb')][_0x5c544b])){this[_0xb1c3('0xb')][_0x5c544b]={};}this[_0xb1c3('0xb')][_0x5c544b][_0x2e8c60]=_0x3749c3;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x320992){try{if(this[_0xb1c3('0x23')](_0x320992)){logger[_0xb1c3('0x29')](_0xb1c3('0x80'),_0x320992['uniqueid'],util[_0xb1c3('0x2b')](_0x320992,{'showHidden':![],'depth':null}));if(this[_0xb1c3('0x2c')][_0x320992[_0xb1c3('0x28')]]){for(var _0x147712 in this[_0xb1c3('0x2c')][_0x320992[_0xb1c3('0x28')]]){if(this[_0xb1c3('0x2c')][_0x320992[_0xb1c3('0x28')]]['hasOwnProperty'](_0x147712)){if(this[_0xb1c3('0x2c')][_0x320992['uniqueid']][_0x147712]['reason']==_0xb1c3('0x81')&&this['channels'][_0x320992[_0xb1c3('0x28')]][_0x147712][_0xb1c3('0x13')]){logger[_0xb1c3('0x26')](_0xb1c3('0x82'),_0x320992['uniqueid'],_0x147712);this[_0xb1c3('0x2c')][_0x320992[_0xb1c3('0x28')]][_0x147712]['agentcompleteAt']=moment()[_0xb1c3('0x2e')](_0xb1c3('0x2f'));}}}logger[_0xb1c3('0x29')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x320992['uniqueid'],util['inspect'](_[_0xb1c3('0x83')](this[_0xb1c3('0x2c')][_0x320992['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xb1c3('0x22')](_0xb1c3('0x84'),_[_0xb1c3('0x83')](this['channels'][_0x320992[_0xb1c3('0x28')]]));delete this[_0xb1c3('0x2c')][_0x320992[_0xb1c3('0x28')]];}if(this['variables'][_0x320992[_0xb1c3('0x28')]]){delete this[_0xb1c3('0xb')][_0x320992[_0xb1c3('0x28')]];}}}catch(_0x39a4db){logger[_0xb1c3('0x3d')](_0xb1c3('0x85'),_0x320992['uniqueid'],util[_0xb1c3('0x2b')](_0x39a4db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x1e')]=function(_0x5c8d27){try{if(this[_0xb1c3('0x23')](_0x5c8d27)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x5c8d27[_0xb1c3('0x28')],util['inspect'](_0x5c8d27,{'showHidden':![],'depth':null}));if(this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]]){for(var _0x450512 in this['channels'][_0x5c8d27[_0xb1c3('0x86')]]){if(this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]][_0xb1c3('0x3f')](_0x450512)){if(_0x5c8d27[_0xb1c3('0x87')]===_0x450512){logger['info'](_0xb1c3('0x88'),_0x5c8d27['uniqueid'],this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]][_0x450512]['membername'],_0x450512);var _0xf6ebe8=moment();this[_0xb1c3('0x2c')][_0x5c8d27['transfereeuniqueid']][_0x450512][_0xb1c3('0x13')]=!![];this[_0xb1c3('0x2c')][_0x5c8d27['transfereeuniqueid']][_0x450512]['agentcompleteAt']=moment()[_0xb1c3('0x2e')](_0xb1c3('0x2f'));this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]][_0x450512]['lastevent']=_0xb1c3('0x62');this['channels'][_0x5c8d27[_0xb1c3('0x86')]][_0x450512][_0xb1c3('0x58')]=_0xb1c3('0x81');this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]][_0x450512][_0xb1c3('0x63')]=_0xf6ebe8[_0xb1c3('0x89')](this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]][_0x450512][_0xb1c3('0x60')],'seconds');}}}}if(this['channels'][_0x5c8d27[_0xb1c3('0x8a')]]){var _0x7b5b15=this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x8a')]];this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x8a')]]=this[_0xb1c3('0x2c')][_0x5c8d27[_0xb1c3('0x86')]];this['channels'][_0x5c8d27[_0xb1c3('0x86')]]=_0x7b5b15;}}}catch(_0x124ecf){logger['error']('[%s][voiceAgentReport][attendedtransfer]',_0x5c8d27[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0x124ecf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')]['syncBlindTransfer']=function(_0x22dc7f){try{if(this[_0xb1c3('0x23')](_0x22dc7f)){logger[_0xb1c3('0x29')](_0xb1c3('0x8b'),_0x22dc7f['uniqueid'],util['inspect'](_0x22dc7f,{'showHidden':![],'depth':null}));if(this['channels'][_0x22dc7f[_0xb1c3('0x86')]]){for(var _0xa380c7 in this[_0xb1c3('0x2c')][_0x22dc7f[_0xb1c3('0x86')]]){if(this[_0xb1c3('0x2c')][_0x22dc7f['transfereeuniqueid']][_0xb1c3('0x3f')](_0xa380c7)){if(_0x22dc7f[_0xb1c3('0x8c')]===_0xa380c7){logger[_0xb1c3('0x26')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x22dc7f[_0xb1c3('0x28')],this[_0xb1c3('0x2c')][_0x22dc7f[_0xb1c3('0x86')]][_0xa380c7][_0xb1c3('0x3b')],_0xa380c7);var _0x18275b=moment();this[_0xb1c3('0x2c')][_0x22dc7f[_0xb1c3('0x86')]][_0xa380c7][_0xb1c3('0x13')]=!![];this['channels'][_0x22dc7f[_0xb1c3('0x86')]][_0xa380c7]['agentcompleteAt']=_0x18275b;this[_0xb1c3('0x2c')][_0x22dc7f[_0xb1c3('0x86')]][_0xa380c7]['lastevent']=_0xb1c3('0x62');this['channels'][_0x22dc7f[_0xb1c3('0x86')]][_0xa380c7][_0xb1c3('0x58')]=_0xb1c3('0x81');this['channels'][_0x22dc7f['transfereeuniqueid']][_0xa380c7]['talktime']=_0x18275b['diff'](this[_0xb1c3('0x2c')][_0x22dc7f[_0xb1c3('0x86')]][_0xa380c7][_0xb1c3('0x60')],_0xb1c3('0x8d'));}}}}}}catch(_0x24a9e4){logger[_0xb1c3('0x3d')]('[%s][voiceAgentReport][blindtransfer]',_0x22dc7f['uniqueid'],util[_0xb1c3('0x2b')](_0x24a9e4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')][_0xb1c3('0x1a')]=function(_0x40c9db){var _0x3570cb='';try{if(this[_0xb1c3('0x23')](_0x40c9db)){logger[_0xb1c3('0x29')](_0xb1c3('0x8e'),_0x40c9db['uniqueid'],util['inspect'](_0x40c9db,{'showHidden':![],'depth':null}));if(_0x40c9db[_0xb1c3('0x8f')]){_0x3570cb=_0x40c9db[_0xb1c3('0x8f')]['substring'](0x0,_0x40c9db[_0xb1c3('0x8f')][_0xb1c3('0x90')]('-'));if(this[_0xb1c3('0xa')][_0x3570cb]){logger[_0xb1c3('0x26')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x40c9db['uniqueid'],_0x3570cb);this[_0xb1c3('0xa')][_0x3570cb][_0xb1c3('0x91')]=!![];}}}}catch(_0x46b1aa){logger[_0xb1c3('0x3d')](_0xb1c3('0x92'),_0x40c9db[_0xb1c3('0x28')],util[_0xb1c3('0x2b')](_0x46b1aa,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb1c3('0x21')]['syncMusicOnHoldStop']=function(_0x2ed76b){var _0x50bd91='';try{if(this[_0xb1c3('0x23')](_0x2ed76b)){logger['debug'](_0xb1c3('0x93'),_0x2ed76b['uniqueid'],util[_0xb1c3('0x2b')](_0x2ed76b,{'showHidden':![],'depth':null}));if(_0x2ed76b['channel']){_0x50bd91=_0x2ed76b[_0xb1c3('0x8f')][_0xb1c3('0x94')](0x0,_0x2ed76b[_0xb1c3('0x8f')][_0xb1c3('0x90')]('-'));if(this[_0xb1c3('0xa')][_0x50bd91]){logger[_0xb1c3('0x26')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x2ed76b['uniqueid'],_0x50bd91);this[_0xb1c3('0xa')][_0x50bd91]['onhold']=![];}}}}catch(_0x59c8a6){logger['error'](_0xb1c3('0x95'),_0x2ed76b['uniqueid'],util['inspect'](_0x59c8a6,{'showHidden':![],'depth':null}));}};module[_0xb1c3('0x96')]=VoiceAgentReport; \ No newline at end of file +var _0xd663=['transfer','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','interface','pick','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','reason','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]','lastevent','complete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd663,0x1ed));var _0x3d66=function(_0x329731,_0x35e26b){_0x329731=_0x329731-0x0;var _0xdbef7a=_0xd663[_0x329731];return _0xdbef7a;};'use strict';var _=require(_0x3d66('0x0'));var moment=require(_0x3d66('0x1'));var util=require('util');var Redis=require(_0x3d66('0x2'));var config=require(_0x3d66('0x3'));var logger=require(_0x3d66('0x4'))(_0x3d66('0x5'));var ami=require(_0x3d66('0x6'));config['redis']=_[_0x3d66('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x2783f6){this['channels']={};this['voiceChannels']=_0x2783f6[_0x3d66('0x8')];this[_0x3d66('0x9')]=_0x2783f6[_0x3d66('0x9')];this[_0x3d66('0xa')]=_0x2783f6[_0x3d66('0xa')];this[_0x3d66('0xb')]={};ami['on'](_0x3d66('0xc'),this['syncAgentCalled'][_0x3d66('0xd')](this));ami['on'](_0x3d66('0xe'),this[_0x3d66('0xf')]['bind'](this));ami['on'](_0x3d66('0x10'),this[_0x3d66('0x11')][_0x3d66('0xd')](this));ami['on']('queuecallerabandon',this[_0x3d66('0x12')][_0x3d66('0xd')](this));ami['on'](_0x3d66('0x13'),this[_0x3d66('0x14')]['bind'](this));ami['on'](_0x3d66('0x15'),this['syncVarSet'][_0x3d66('0xd')](this));ami['on'](_0x3d66('0x16'),this[_0x3d66('0x17')][_0x3d66('0xd')](this));ami['on'](_0x3d66('0x18'),this[_0x3d66('0x19')]['bind'](this));ami['on']('musiconholdstop',this[_0x3d66('0x1a')][_0x3d66('0xd')](this));ami['on']('attendedtransfer',this[_0x3d66('0x1b')][_0x3d66('0xd')](this));ami['on'](_0x3d66('0x1c'),this[_0x3d66('0x1d')][_0x3d66('0xd')](this));}VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x1f')]=function(_0x27ae83,_0x1accfb,_0x3902f1){io['to'](_0x27ae83)[_0x3d66('0x1f')](_0x1accfb,_0x3902f1);};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x20')]=function(_0x42df07){return _0x42df07!==null&&!_[_0x3d66('0x21')](_0x42df07);};VoiceAgentReport['prototype'][_0x3d66('0x22')]=function(_0x5e1516){try{if(this[_0x3d66('0x20')](_0x5e1516)){logger[_0x3d66('0x23')](_0x3d66('0x24'),_0x5e1516[_0x3d66('0x25')],_0x5e1516[_0x3d66('0x26')],_0x5e1516[_0x3d66('0x27')]);logger[_0x3d66('0x28')](_0x3d66('0x29'),_0x5e1516[_0x3d66('0x25')],util['inspect'](_0x5e1516,{'showHidden':![],'depth':null}));if(_[_0x3d66('0x21')](this[_0x3d66('0x8')][_0x5e1516[_0x3d66('0x25')]])){this[_0x3d66('0x8')][_0x5e1516['uniqueid']]={};}if(_[_0x3d66('0x21')](this[_0x3d66('0x8')][_0x5e1516[_0x3d66('0x25')]][_0x5e1516[_0x3d66('0x27')]])){this['channels'][_0x5e1516[_0x3d66('0x25')]][_0x5e1516[_0x3d66('0x27')]]={'agentcalledAt':moment()[_0x3d66('0x2a')](_0x3d66('0x2b')),'lastevent':_0x3d66('0x2c'),'mandatoryDisposition':this[_0x3d66('0x9')][_0x5e1516[_0x3d66('0x2d')]]?this[_0x3d66('0x9')][_0x5e1516[_0x3d66('0x2d')]][_0x3d66('0x2e')]||![]:![],'type':this['voiceQueues'][_0x5e1516[_0x3d66('0x2d')]]?this[_0x3d66('0x9')][_0x5e1516[_0x3d66('0x2d')]][_0x3d66('0x2f')]||_0x3d66('0x30'):_0x3d66('0x30'),'variables':this[_0x3d66('0xb')][_0x5e1516[_0x3d66('0x25')]],'motionChannel':_0x3d66('0x31')};}_[_0x3d66('0x32')](this[_0x3d66('0x8')][_0x5e1516['uniqueid']][_0x5e1516['destuniqueid']],_[_0x3d66('0x33')](_0x5e1516,[_0x3d66('0x34'),_0x3d66('0x35')]));logger[_0x3d66('0x28')](_0x3d66('0x36'),_0x5e1516[_0x3d66('0x25')],util[_0x3d66('0x37')](this[_0x3d66('0x8')][_0x5e1516[_0x3d66('0x25')]][_0x5e1516[_0x3d66('0x27')]],{'showHidden':![],'depth':null}));ami[_0x3d66('0x1f')](_0x3d66('0x38'),this[_0x3d66('0x8')][_0x5e1516[_0x3d66('0x25')]][_0x5e1516[_0x3d66('0x27')]]);logger[_0x3d66('0x28')](_0x3d66('0x39'),_0x5e1516[_0x3d66('0x25')],util[_0x3d66('0x37')](this[_0x3d66('0x8')][_0x5e1516[_0x3d66('0x25')]][_0x5e1516[_0x3d66('0x27')]],{'showHidden':![],'depth':null}));this[_0x3d66('0x1f')](util['format'](_0x3d66('0x3a'),_0x5e1516[_0x3d66('0x26')]),_0x3d66('0x3b'),this['channels'][_0x5e1516[_0x3d66('0x25')]][_0x5e1516['destuniqueid']]);}}catch(_0x2ac6ce){logger[_0x3d66('0x3c')]('[%s][voiceAgentReport][agentcalled]',_0x5e1516[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x2ac6ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3d66('0xf')]=function(_0x3bd7eb){try{if(this['isNotNull'](_0x3bd7eb)){if(this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]]){logger[_0x3d66('0x28')](_0x3d66('0x3d'),_0x3bd7eb['uniqueid'],util[_0x3d66('0x37')](_0x3bd7eb,{'showHidden':![],'depth':null}));for(var _0x58851d in this[_0x3d66('0x8')][_0x3bd7eb['uniqueid']]){if(this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x3d66('0x3e')](_0x58851d)){if(_0x3bd7eb['destuniqueid']===_0x58851d){logger[_0x3d66('0x23')](_0x3d66('0x3f'),_0x3bd7eb[_0x3d66('0x25')],_0x3bd7eb[_0x3d66('0x26')],_0x3bd7eb[_0x3d66('0x27')]);this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x40')]=moment()[_0x3d66('0x2a')](_0x3d66('0x2b'));this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x41')]=_0x3bd7eb['connectedlinename'];this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x42')]=_0x3bd7eb['connectedlinenum'];this['channels'][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x43')]=_0x3bd7eb[_0x3d66('0x43')];this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x44')]=_0x3bd7eb[_0x3d66('0x44')];this[_0x3d66('0x8')][_0x3bd7eb['uniqueid']][_0x58851d][_0x3d66('0x45')]=_0x3bd7eb[_0x3d66('0x45')];this[_0x3d66('0x8')][_0x3bd7eb['uniqueid']][_0x58851d]['lastevent']=_0x3d66('0x46');if(this[_0x3d66('0x47')][this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x25')]]){var _0x3e6308=this[_0x3d66('0x47')][this[_0x3d66('0x8')][_0x3bd7eb['uniqueid']][_0x58851d][_0x3d66('0x25')]]['routealias'];this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x48')]=_0x3e6308;_0x3bd7eb['routealias']=_0x3e6308;}_[_0x3d66('0x32')](this[_0x3d66('0xa')][_0x3bd7eb[_0x3d66('0x49')]],_[_0x3d66('0x4a')](_0x3bd7eb,['queue','destconnectedlinenum',_0x3d66('0x48')]));logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x3bd7eb[_0x3d66('0x25')],util[_0x3d66('0x37')](this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x3bd7eb[_0x3d66('0x27')]],{'showHidden':![],'depth':null}));ami[_0x3d66('0x1f')](_0x3d66('0x4b'),this['channels'][_0x3bd7eb[_0x3d66('0x25')]][_0x3bd7eb[_0x3d66('0x27')]]);logger[_0x3d66('0x28')](_0x3d66('0x4c'),_0x3bd7eb[_0x3d66('0x25')],util['inspect'](this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x3bd7eb[_0x3d66('0x27')]],{'showHidden':![],'depth':null}));this[_0x3d66('0x1f')](util[_0x3d66('0x2a')](_0x3d66('0x3a'),_0x3bd7eb[_0x3d66('0x26')]),'user:agentconnect',this['channels'][_0x3bd7eb['uniqueid']][_0x3bd7eb[_0x3d66('0x27')]]);}else if(!this[_0x3d66('0x8')][_0x3bd7eb['uniqueid']][_0x58851d][_0x3d66('0x10')]&&!this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x13')]){logger[_0x3d66('0x23')](_0x3d66('0x4d'),_0x3bd7eb[_0x3d66('0x25')],this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d]['membername'],_0x58851d);this['channels'][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d]['agentringnoanswer']=!![];this['channels'][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x4e')]=moment()[_0x3d66('0x2a')](_0x3d66('0x2b'));this[_0x3d66('0x8')][_0x3bd7eb['uniqueid']][_0x58851d][_0x3d66('0x4f')]=_0x3bd7eb[_0x3d66('0x27')];this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d]['answeredelsewheremembername']=_0x3bd7eb[_0x3d66('0x26')];this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d]['lastevent']='answered_elsewhere';this['channels'][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d][_0x3d66('0x50')]=_0x3d66('0x51');logger[_0x3d66('0x28')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x3bd7eb[_0x3d66('0x25')],util[_0x3d66('0x37')](this['channels'][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d],{'showHidden':![],'depth':null}));ami[_0x3d66('0x1f')](_0x3d66('0x52'),this[_0x3d66('0x8')][_0x3bd7eb[_0x3d66('0x25')]][_0x58851d]);}}}}}}catch(_0x3059ed){logger[_0x3d66('0x3c')]('[%s][voiceAgentReport][agentconnect]',_0x3bd7eb['uniqueid'],util['inspect'](_0x3059ed,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x11')]=function(_0x2206c9){try{if(this[_0x3d66('0x20')](_0x2206c9)){logger['debug'](_0x3d66('0x53'),_0x2206c9[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x2206c9,{'showHidden':![],'depth':null}));if(this[_0x3d66('0x8')][_0x2206c9[_0x3d66('0x25')]]&&this[_0x3d66('0x8')][_0x2206c9[_0x3d66('0x25')]][_0x2206c9[_0x3d66('0x27')]]){logger['info'](_0x3d66('0x54'),_0x2206c9['uniqueid'],_0x2206c9['membername'],_0x2206c9[_0x3d66('0x27')]);this[_0x3d66('0x8')][_0x2206c9[_0x3d66('0x25')]][_0x2206c9[_0x3d66('0x27')]][_0x3d66('0x10')]=!![];this[_0x3d66('0x8')][_0x2206c9[_0x3d66('0x25')]][_0x2206c9[_0x3d66('0x27')]][_0x3d66('0x4e')]=moment()[_0x3d66('0x2a')](_0x3d66('0x2b'));this[_0x3d66('0x8')][_0x2206c9['uniqueid']][_0x2206c9[_0x3d66('0x27')]]['lastevent']=_0x3d66('0x55');this['channels'][_0x2206c9['uniqueid']][_0x2206c9[_0x3d66('0x27')]][_0x3d66('0x50')]=_0x3d66('0x55');logger[_0x3d66('0x28')](_0x3d66('0x56'),_0x2206c9[_0x3d66('0x25')],util[_0x3d66('0x37')](this[_0x3d66('0x8')][_0x2206c9['uniqueid']][_0x2206c9[_0x3d66('0x27')]],{'showHidden':![],'depth':null}));ami[_0x3d66('0x1f')](_0x3d66('0x57'),this['channels'][_0x2206c9[_0x3d66('0x25')]][_0x2206c9[_0x3d66('0x27')]]);}}}catch(_0x3cd99f){logger[_0x3d66('0x3c')](_0x3d66('0x58'),_0x2206c9[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x3cd99f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x12')]=function(_0x44736b){try{if(this['isNotNull'](_0x44736b)){logger['debug'](_0x3d66('0x59'),_0x44736b[_0x3d66('0x25')],util['inspect'](_0x44736b,{'showHidden':![],'depth':null}));if(this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]]){for(var _0x3789db in this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]]){if(this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]]['hasOwnProperty'](_0x3789db)&&!this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db]['agentringnoanswer']&&!this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db][_0x3d66('0x13')]){logger['info'](_0x3d66('0x5a'),_0x44736b['uniqueid'],this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db][_0x3d66('0x26')],_0x3789db);this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db][_0x3d66('0x10')]=!![];this['channels'][_0x44736b['uniqueid']][_0x3789db][_0x3d66('0x4e')]=moment()['format'](_0x3d66('0x2b'));this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db]['lastevent']=_0x3d66('0x5b');this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db]['reason']=_0x3d66('0x5b');logger[_0x3d66('0x28')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x44736b[_0x3d66('0x25')],util[_0x3d66('0x37')](this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db],{'showHidden':![],'depth':null}));ami[_0x3d66('0x1f')]('custom:agentqueuecallerabandon',this[_0x3d66('0x8')][_0x44736b[_0x3d66('0x25')]][_0x3789db]);}}}}}catch(_0x205ef4){logger[_0x3d66('0x3c')](_0x3d66('0x5c'),_0x44736b[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x205ef4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x14')]=function(_0x433ae7){try{if(this[_0x3d66('0x20')](_0x433ae7)){logger[_0x3d66('0x28')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x433ae7[_0x3d66('0x25')],util['inspect'](_0x433ae7,{'showHidden':![],'depth':null}));if(this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]]){for(var _0x37c166 in this['channels'][_0x433ae7[_0x3d66('0x25')]]){if(this['channels'][_0x433ae7[_0x3d66('0x25')]][_0x3d66('0x3e')](_0x37c166)){if(this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x40')]&&!this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x13')]){logger[_0x3d66('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x433ae7[_0x3d66('0x25')],this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x26')],_0x37c166);this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x13')]=!![];this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166]['agentcompleteAt']=moment()[_0x3d66('0x2a')](_0x3d66('0x2b'));this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x5d')]=_0x3d66('0x5e');this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x50')]=_0x433ae7[_0x3d66('0x50')]==_0x3d66('0x5f')?'agent':_0x433ae7[_0x3d66('0x50')];this[_0x3d66('0x8')][_0x433ae7['uniqueid']][_0x37c166][_0x3d66('0x60')]=_0x433ae7[_0x3d66('0x60')];if(this['voiceQueues'][_0x433ae7['queue']]&&this[_0x3d66('0x9')][_0x433ae7[_0x3d66('0x2d')]][_0x3d66('0x61')]){this['channels'][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x62')]=this[_0x3d66('0x9')][_0x433ae7[_0x3d66('0x2d')]]['acwTimeout'];this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166][_0x3d66('0x63')]=!![];}this['agents'][_0x433ae7[_0x3d66('0x49')]]=_[_0x3d66('0x33')](this[_0x3d66('0xa')][_0x433ae7['interface']],[_0x3d66('0x2d'),'destconnectedlinenum']);logger[_0x3d66('0x28')](_0x3d66('0x64'),_0x433ae7[_0x3d66('0x25')],util['inspect'](this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166],{'showHidden':![],'depth':null}));ami['emit'](_0x3d66('0x65'),this['channels'][_0x433ae7[_0x3d66('0x25')]][_0x37c166]);logger[_0x3d66('0x28')](_0x3d66('0x66'),_0x433ae7['uniqueid'],util[_0x3d66('0x37')](this[_0x3d66('0x8')][_0x433ae7[_0x3d66('0x25')]][_0x37c166],{'showHidden':![],'depth':null}));this[_0x3d66('0x1f')](util[_0x3d66('0x2a')]('user:%s',_0x433ae7[_0x3d66('0x26')]),_0x3d66('0x67'),this[_0x3d66('0x8')][_0x433ae7['uniqueid']][_0x37c166]);}}}}}}catch(_0xf65bd8){logger[_0x3d66('0x3c')](_0x3d66('0x68'),_0x433ae7[_0x3d66('0x25')],util[_0x3d66('0x37')](_0xf65bd8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncVarSet']=function(_0x43cbba){try{if(this[_0x3d66('0x20')](_0x43cbba)){logger['debug'](_0x3d66('0x69'),_0x43cbba[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x43cbba,{'showHidden':![],'depth':null}));this['addVariable'](_0x43cbba[_0x3d66('0x25')],_[_0x3d66('0x6a')](_0x43cbba['variable'])[0x0],_0x43cbba['value']);if(this[_0x3d66('0x8')][_0x43cbba['uniqueid']]){for(var _0x10f0b0 in this[_0x3d66('0x8')][_0x43cbba[_0x3d66('0x25')]]){if(this['channels'][_0x43cbba['uniqueid']][_0x3d66('0x3e')](_0x10f0b0)){logger[_0x3d66('0x23')](_0x3d66('0x6b'),_0x43cbba[_0x3d66('0x25')],_0x10f0b0,_[_0x3d66('0x6a')](_0x43cbba['variable'])[0x0],_0x43cbba['value']);if(_[_0x3d66('0x21')](this[_0x3d66('0x8')][_0x43cbba[_0x3d66('0x25')]][_0x10f0b0][_0x3d66('0xb')])){this[_0x3d66('0x8')][_0x43cbba[_0x3d66('0x25')]][_0x10f0b0]['variables']={};}this['channels'][_0x43cbba[_0x3d66('0x25')]][_0x10f0b0][_0x3d66('0xb')]=this['variables'][_0x43cbba[_0x3d66('0x25')]];}}}}}catch(_0x469fc8){logger['error']('[%s][voiceAgentReport][varset]',_0x43cbba['uniqueid'],util['inspect'](_0x469fc8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x34ee1e,_0x2ab646,_0x2db7c7){var _0xfa0597=[_0x3d66('0x6c'),_0x3d66('0x6d'),_0x3d66('0x6e'),'rtpaudioqosjitterbridged',_0x3d66('0x6f'),_0x3d66('0x70'),_0x3d66('0x71'),_0x3d66('0x72'),_0x3d66('0x73'),'sipuri','bridgepeer',_0x3d66('0x74'),_0x3d66('0x75'),_0x3d66('0x76'),_0x3d66('0x77'),_0x3d66('0x78'),_0x3d66('0x26'),_0x3d66('0x79'),_0x3d66('0x7a')];if(!_[_0x3d66('0x7b')](_0x2ab646)&&!_[_0x3d66('0x7c')](_0xfa0597,_0x2ab646)){if(_[_0x3d66('0x21')](this[_0x3d66('0xb')][_0x34ee1e])){this[_0x3d66('0xb')][_0x34ee1e]={};}this['variables'][_0x34ee1e][_0x2ab646]=_0x2db7c7;}};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x17')]=function(_0x1ebded){try{if(this['isNotNull'](_0x1ebded)){logger[_0x3d66('0x28')](_0x3d66('0x7d'),_0x1ebded[_0x3d66('0x25')],util['inspect'](_0x1ebded,{'showHidden':![],'depth':null}));if(this['channels'][_0x1ebded['uniqueid']]){for(var _0x3214b9 in this['channels'][_0x1ebded[_0x3d66('0x25')]]){if(this[_0x3d66('0x8')][_0x1ebded[_0x3d66('0x25')]][_0x3d66('0x3e')](_0x3214b9)){if(this['channels'][_0x1ebded[_0x3d66('0x25')]][_0x3214b9][_0x3d66('0x50')]=='transfer'&&this[_0x3d66('0x8')][_0x1ebded['uniqueid']][_0x3214b9][_0x3d66('0x13')]){logger[_0x3d66('0x23')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x1ebded['uniqueid'],_0x3214b9);this[_0x3d66('0x8')][_0x1ebded['uniqueid']][_0x3214b9][_0x3d66('0x7e')]=moment()[_0x3d66('0x2a')](_0x3d66('0x2b'));}}}logger['debug'](_0x3d66('0x7f'),_0x1ebded[_0x3d66('0x25')],util[_0x3d66('0x37')](_[_0x3d66('0x80')](this[_0x3d66('0x8')][_0x1ebded['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x3d66('0x1f')]('custom:voiceAgentReport',_[_0x3d66('0x80')](this[_0x3d66('0x8')][_0x1ebded['uniqueid']]));delete this[_0x3d66('0x8')][_0x1ebded[_0x3d66('0x25')]];}if(this[_0x3d66('0xb')][_0x1ebded['uniqueid']]){delete this[_0x3d66('0xb')][_0x1ebded[_0x3d66('0x25')]];}}}catch(_0x2a1e5f){logger[_0x3d66('0x3c')](_0x3d66('0x81'),_0x1ebded['uniqueid'],util['inspect'](_0x2a1e5f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')]['syncAttendedTransfer']=function(_0x255c6a){try{if(this[_0x3d66('0x20')](_0x255c6a)){logger[_0x3d66('0x28')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x255c6a[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x255c6a,{'showHidden':![],'depth':null}));if(this[_0x3d66('0x8')][_0x255c6a['transfereeuniqueid']]){for(var _0x3d0cbf in this['channels'][_0x255c6a[_0x3d66('0x82')]]){if(this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x82')]][_0x3d66('0x3e')](_0x3d0cbf)){if(_0x255c6a['origtransfereruniqueid']===_0x3d0cbf){logger[_0x3d66('0x23')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x255c6a['uniqueid'],this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x82')]][_0x3d0cbf][_0x3d66('0x26')],_0x3d0cbf);var _0x482e9d=moment();this[_0x3d66('0x8')][_0x255c6a['transfereeuniqueid']][_0x3d0cbf]['agentcomplete']=!![];this[_0x3d66('0x8')][_0x255c6a['transfereeuniqueid']][_0x3d0cbf][_0x3d66('0x7e')]=moment()[_0x3d66('0x2a')](_0x3d66('0x2b'));this['channels'][_0x255c6a[_0x3d66('0x82')]][_0x3d0cbf]['lastevent']='complete';this[_0x3d66('0x8')][_0x255c6a['transfereeuniqueid']][_0x3d0cbf][_0x3d66('0x50')]=_0x3d66('0x5f');this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x82')]][_0x3d0cbf][_0x3d66('0x60')]=_0x482e9d[_0x3d66('0x83')](this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x82')]][_0x3d0cbf][_0x3d66('0x40')],_0x3d66('0x84'));}}}}if(this['channels'][_0x255c6a[_0x3d66('0x85')]]){var _0x3c4f7c=this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x85')]];this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x85')]]=this['channels'][_0x255c6a[_0x3d66('0x82')]];this[_0x3d66('0x8')][_0x255c6a[_0x3d66('0x82')]]=_0x3c4f7c;}}}catch(_0x142b2b){logger[_0x3d66('0x3c')](_0x3d66('0x86'),_0x255c6a[_0x3d66('0x25')],util['inspect'](_0x142b2b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')]['syncBlindTransfer']=function(_0x51eb2c){try{if(this[_0x3d66('0x20')](_0x51eb2c)){logger[_0x3d66('0x28')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x51eb2c['uniqueid'],util[_0x3d66('0x37')](_0x51eb2c,{'showHidden':![],'depth':null}));if(this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]]){for(var _0x5e2a7a in this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]]){if(this['channels'][_0x51eb2c['transfereeuniqueid']][_0x3d66('0x3e')](_0x5e2a7a)){if(_0x51eb2c['transfereruniqueid']===_0x5e2a7a){logger[_0x3d66('0x23')](_0x3d66('0x87'),_0x51eb2c[_0x3d66('0x25')],this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]][_0x5e2a7a][_0x3d66('0x26')],_0x5e2a7a);var _0x5172ca=moment();this['channels'][_0x51eb2c[_0x3d66('0x82')]][_0x5e2a7a][_0x3d66('0x13')]=!![];this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]][_0x5e2a7a][_0x3d66('0x7e')]=_0x5172ca;this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]][_0x5e2a7a]['lastevent']='complete';this[_0x3d66('0x8')][_0x51eb2c['transfereeuniqueid']][_0x5e2a7a][_0x3d66('0x50')]=_0x3d66('0x5f');this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]][_0x5e2a7a][_0x3d66('0x60')]=_0x5172ca[_0x3d66('0x83')](this[_0x3d66('0x8')][_0x51eb2c[_0x3d66('0x82')]][_0x5e2a7a][_0x3d66('0x40')],_0x3d66('0x84'));}}}}}}catch(_0x63e5b1){logger[_0x3d66('0x3c')](_0x3d66('0x88'),_0x51eb2c[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x63e5b1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x19')]=function(_0x6f24b9){var _0x1f4dba='';try{if(this[_0x3d66('0x20')](_0x6f24b9)){logger[_0x3d66('0x28')](_0x3d66('0x89'),_0x6f24b9['uniqueid'],util[_0x3d66('0x37')](_0x6f24b9,{'showHidden':![],'depth':null}));if(_0x6f24b9['channel']){_0x1f4dba=_0x6f24b9['channel'][_0x3d66('0x8a')](0x0,_0x6f24b9[_0x3d66('0x8b')][_0x3d66('0x8c')]('-'));if(this['agents'][_0x1f4dba]){logger[_0x3d66('0x23')](_0x3d66('0x8d'),_0x6f24b9[_0x3d66('0x25')],_0x1f4dba);this['agents'][_0x1f4dba][_0x3d66('0x8e')]=!![];}}}}catch(_0x4f5a53){logger['error'](_0x3d66('0x8f'),_0x6f24b9[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x4f5a53,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3d66('0x1e')][_0x3d66('0x1a')]=function(_0x594945){var _0x42ca23='';try{if(this[_0x3d66('0x20')](_0x594945)){logger['debug'](_0x3d66('0x90'),_0x594945['uniqueid'],util[_0x3d66('0x37')](_0x594945,{'showHidden':![],'depth':null}));if(_0x594945['channel']){_0x42ca23=_0x594945[_0x3d66('0x8b')]['substring'](0x0,_0x594945[_0x3d66('0x8b')]['lastIndexOf']('-'));if(this['agents'][_0x42ca23]){logger[_0x3d66('0x23')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x594945[_0x3d66('0x25')],_0x42ca23);this[_0x3d66('0xa')][_0x42ca23]['onhold']=![];}}}}catch(_0x2f5060){logger[_0x3d66('0x3c')](_0x3d66('0x91'),_0x594945[_0x3d66('0x25')],util[_0x3d66('0x37')](_0x2f5060,{'showHidden':![],'depth':null}));}};module[_0x3d66('0x92')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 006f0dc..8257d13 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 _0x41db=['BLIND','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','bluebird','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','debug','uniqueid','linkedid','isUndefined','merge','keys','channel','split','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','name','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','pick','context','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','user:agentconnect','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','lastdata','set','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','calleridnum','destinationchannel','channelstate','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','monitorFilename','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','type','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','syncHangup','transfererchannel','transfereruniqueid'];(function(_0x300e9e,_0xcbfa6b){var _0x53c501=function(_0x4bdeb0){while(--_0x4bdeb0){_0x300e9e['push'](_0x300e9e['shift']());}};_0x53c501(++_0xcbfa6b);}(_0x41db,0xd1));var _0xb41d=function(_0x5bbc52,_0x339c68){_0x5bbc52=_0x5bbc52-0x0;var _0x2845de=_0x41db[_0x5bbc52];return _0x2845de;};'use strict';var BPromise=require(_0xb41d('0x0'));var _=require('lodash');var moment=require('moment');var util=require(_0xb41d('0x1'));var path=require(_0xb41d('0x2'));var Redis=require('ioredis');var config=require(_0xb41d('0x3'));var logger=require(_0xb41d('0x4'))(_0xb41d('0x5'));var ami=require(_0xb41d('0x6'));var Channel=require(_0xb41d('0x7'));var RpcSetting=require('../rpc/setting');var statusDesc=[_0xb41d('0x8'),_0xb41d('0x9'),_0xb41d('0xa'),_0xb41d('0xb'),_0xb41d('0xc'),_0xb41d('0xd'),'ringing',_0xb41d('0xe'),_0xb41d('0xf')];var applications=['set','queue',_0xb41d('0x10'),_0xb41d('0x11'),_0xb41d('0x12'),'voicemail'];var dispositions=[_0xb41d('0x13'),_0xb41d('0x14'),_0xb41d('0x14'),'NO\x20ANSWER','NO\x20ANSWER',_0xb41d('0x13'),_0xb41d('0x15'),'BUSY','FAILED',_0xb41d('0x14'),_0xb41d('0x14')];var actions={};config[_0xb41d('0x16')]=_[_0xb41d('0x17')](config[_0xb41d('0x16')],{'host':_0xb41d('0x18'),'port':0x18eb});var io=require(_0xb41d('0x19'))(new Redis(config['redis']));function VoiceCallReport(_0x2e4de6){this[_0xb41d('0x1a')]=_0x2e4de6[_0xb41d('0x1a')];this[_0xb41d('0x1b')]=_0x2e4de6[_0xb41d('0x1b')];this[_0xb41d('0x1c')]={};ami['on']('coreshowchannel',this[_0xb41d('0x1d')]['bind'](this));ami['on'](_0xb41d('0x1e'),this[_0xb41d('0x1d')][_0xb41d('0x1f')](this));ami['on'](_0xb41d('0x20'),this[_0xb41d('0x21')][_0xb41d('0x1f')](this));ami['on'](_0xb41d('0x22'),this[_0xb41d('0x23')][_0xb41d('0x1f')](this));ami['on']('varset',this[_0xb41d('0x24')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0xb41d('0x1f')](this));ami['on'](_0xb41d('0x25'),this[_0xb41d('0x26')]['bind'](this));ami['on'](_0xb41d('0x27'),this[_0xb41d('0x28')]['bind'](this));ami['on'](_0xb41d('0x29'),this[_0xb41d('0x2a')][_0xb41d('0x1f')](this));ami['on']('musiconholdstart',this[_0xb41d('0x2b')][_0xb41d('0x1f')](this));ami['on'](_0xb41d('0x2c'),this[_0xb41d('0x2d')][_0xb41d('0x1f')](this));try{logger['info'](_0xb41d('0x2e'));ami['actionCoreShowChannels']();}catch(_0x19e9b){logger[_0xb41d('0x2f')](_0xb41d('0x30'),util[_0xb41d('0x31')](_0x19e9b,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0xb41d('0x32')]=function(_0x2820da){return _0x2820da!==null&&!_['isUndefined'](_0x2820da);};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x34')]=function(_0x399bcc,_0x1a7c4f,_0x1cdb53){io['to'](_0x399bcc)[_0xb41d('0x34')](_0x1a7c4f,_0x1cdb53);};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x26')]=function(_0x4091f2){try{if(this[_0xb41d('0x32')](_0x4091f2)){logger[_0xb41d('0x35')](_0xb41d('0x36'),_0x4091f2['uniqueid'],_0x4091f2[_0xb41d('0x37')],_0x4091f2['calleridnum']);logger[_0xb41d('0x38')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x4091f2[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x4091f2,{'showHidden':![],'depth':null}));if(_0x4091f2[_0xb41d('0x39')]===_0x4091f2[_0xb41d('0x3a')]){if(!_[_0xb41d('0x3b')](this[_0xb41d('0x1a')][_0x4091f2['uniqueid']])){_[_0xb41d('0x3c')](this[_0xb41d('0x1a')][_0x4091f2[_0xb41d('0x39')]],_['pick'](_0x4091f2,_[_0xb41d('0x3d')](this[_0xb41d('0x1a')][_0x4091f2[_0xb41d('0x39')]])));}}if(_0x4091f2['context']==='from-sip'){if(this[_0xb41d('0x1b')][_0x4091f2[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]){if(_0x4091f2['exten']==_0xb41d('0x40')){this['agents'][_0x4091f2[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x41')]=_0x4091f2[_0xb41d('0x42')];this[_0xb41d('0x34')](util[_0xb41d('0x43')]('user:%s',this['agents'][_0x4091f2[_0xb41d('0x3e')]['split']('-')[0x0]][_0xb41d('0x44')]),'user:agentconnect',{'destaccountcode':this[_0xb41d('0x1b')][_0x4091f2[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4091f2[_0xb41d('0x42')]});}}}}}catch(_0x24677a){logger[_0xb41d('0x2f')](_0xb41d('0x45'),_0x4091f2[_0xb41d('0x39')],util['inspect'](_0x24677a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x21')]=function(_0x44b70b){try{if(this['isNotNull'](_0x44b70b)){logger[_0xb41d('0x38')](_0xb41d('0x46'),_0x44b70b[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x44b70b,{'showHidden':![],'depth':null}));if(_0x44b70b[_0xb41d('0x39')]===_0x44b70b[_0xb41d('0x3a')]&&_0x44b70b[_0xb41d('0x3e')]!=_0xb41d('0x47')){if(_['isUndefined'](this[_0xb41d('0x1a')][_0x44b70b[_0xb41d('0x39')]])){logger[_0xb41d('0x35')](_0xb41d('0x48'),_0x44b70b['uniqueid'],_0x44b70b['context'],_0x44b70b[_0xb41d('0x49')]);this['channels'][_0x44b70b[_0xb41d('0x39')]]=new Channel();this['channels'][_0x44b70b[_0xb41d('0x39')]][_0xb41d('0x4a')]=moment()[_0xb41d('0x43')](_0xb41d('0x4b'));this['channels'][_0x44b70b[_0xb41d('0x39')]][_0xb41d('0x4c')]=dispositions[_[_0xb41d('0x4d')](_0x44b70b['channelstate'])];_['merge'](this['channels'][_0x44b70b[_0xb41d('0x39')]],_[_0xb41d('0x4e')](_0x44b70b,_[_0xb41d('0x3d')](this[_0xb41d('0x1a')][_0x44b70b['uniqueid']])));if(_0x44b70b[_0xb41d('0x4f')]===_0xb41d('0x50')){if(this[_0xb41d('0x1b')][_0x44b70b[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]){if(_[_0xb41d('0x3b')](this['agents'][_0x44b70b['channel'][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x41')])){this['agents'][_0x44b70b['channel']['split']('-')[0x0]][_0xb41d('0x41')]=_0x44b70b['exten'];logger[_0xb41d('0x38')](_0xb41d('0x51'),_0x44b70b[_0xb41d('0x39')],util[_0xb41d('0x31')]({'destaccountcode':this[_0xb41d('0x1b')][_0x44b70b['channel']['split']('-')[0x0]][_0xb41d('0x52')],'destconnectedlinenum':_0x44b70b[_0xb41d('0x49')]},{'showHidden':![],'depth':null}));this[_0xb41d('0x34')](util[_0xb41d('0x43')](_0xb41d('0x53'),this[_0xb41d('0x1b')][_0x44b70b['channel'][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x44')]),_0xb41d('0x54'),{'destaccountcode':this['agents'][_0x44b70b[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x52')],'destconnectedlinenum':_0x44b70b[_0xb41d('0x49')]});}}}}}}}catch(_0x2cd456){logger['error']('[%s][voiceCallReport][newchannel]',_0x44b70b['uniqueid'],util[_0xb41d('0x31')](_0x2cd456,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x1d')]=function(_0xe461dd){try{if(this[_0xb41d('0x32')](_0xe461dd)){logger[_0xb41d('0x38')](_0xb41d('0x55'),_0xe461dd[_0xb41d('0x39')],util[_0xb41d('0x31')](_0xe461dd,{'showHidden':![],'depth':null}));if(_0xe461dd[_0xb41d('0x39')]===_0xe461dd[_0xb41d('0x3a')]&&_0xe461dd[_0xb41d('0x49')]!='h'&&_0xe461dd[_0xb41d('0x3e')]!=_0xb41d('0x47')){_0xe461dd[_0xb41d('0x56')]=_0xe461dd[_0xb41d('0x56')][_0xb41d('0x57')]();_0xe461dd[_0xb41d('0x58')]=_0xe461dd[_0xb41d('0x59')]&&_0xe461dd['appdata'][_0xb41d('0x5a')](_0xb41d('0x5b'))?_0xe461dd[_0xb41d('0x59')]:(_0xe461dd[_0xb41d('0x59')]||_0xe461dd[_0xb41d('0x58')])[_0xb41d('0x57')]();logger[_0xb41d('0x35')](_0xb41d('0x5c'),_0xe461dd[_0xb41d('0x39')],_0xe461dd[_0xb41d('0x56')],_0xe461dd[_0xb41d('0x58')]);if(_['isUndefined'](this['channels'][_0xe461dd[_0xb41d('0x39')]])){this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]]=new Channel();this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]]['starttime']=_0xe461dd['duration']?moment()['subtract'](moment['duration'](_0xe461dd[_0xb41d('0x5d')])['seconds'](),_0xb41d('0x5e'))[_0xb41d('0x43')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xb41d('0x43')](_0xb41d('0x4b'));this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]]['disposition']='NO\x20ANSWER';}_['merge'](this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]],_[_0xb41d('0x4e')](_0xe461dd,_[_0xb41d('0x3d')](this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]])));if(_['includes'](applications,_0xe461dd['application'])){this['channels'][_0xe461dd[_0xb41d('0x39')]]['lastapplication']=_0xe461dd[_0xb41d('0x56')];this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]][_0xb41d('0x5f')]=_0xe461dd[_0xb41d('0x58')];if(_0xe461dd[_0xb41d('0x56')]===_0xb41d('0x60')&&_[_0xb41d('0x5a')](_0xe461dd[_0xb41d('0x58')][_0xb41d('0x57')](),'cdr(')){var _0x440897=_0xe461dd[_0xb41d('0x58')]['split']('=');var _0x21eb41=_0x440897[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x21eb41){this[_0xb41d('0x1a')][_0xe461dd[_0xb41d('0x39')]][_0x21eb41[0x1]]=_0x440897[0x1];}}else if(_0xe461dd[_0xb41d('0x56')]==='queue'){this['channels'][_0xe461dd[_0xb41d('0x39')]]['queue']=_0xe461dd[_0xb41d('0x58')]['split'](',')[0x0];}}}}}catch(_0x339b8f){logger[_0xb41d('0x2f')](_0xb41d('0x61'),_0xe461dd['uniqueid'],util[_0xb41d('0x31')](_0x339b8f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb41d('0x23')]=function(_0x5859c8){try{if(this[_0xb41d('0x32')](_0x5859c8)){logger[_0xb41d('0x35')](_0xb41d('0x62'),_0x5859c8[_0xb41d('0x39')],_0x5859c8[_0xb41d('0x3a')],_0x5859c8[_0xb41d('0x37')],_0x5859c8['calleridnum']);logger[_0xb41d('0x38')](_0xb41d('0x63'),_0x5859c8[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x5859c8,{'showHidden':![],'depth':null}));if(_0x5859c8[_0xb41d('0x39')]!==_0x5859c8[_0xb41d('0x3a')]){if(this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]]){if(_0x5859c8['channelstate']==='6'){if(!this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x64')]){var _0xa7aae7=moment();this['channels'][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x64')]=!![];this['channels'][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x65')]=_0xa7aae7['format'](_0xb41d('0x4b'));if(this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x4a')]){this['channels'][_0x5859c8['linkedid']]['holdtime']=_0xa7aae7[_0xb41d('0x66')](this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x4a')],'seconds');}}this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]]['linkedid']=_0x5859c8[_0xb41d('0x39')];if(_0x5859c8['calleridnum']!==_0xb41d('0x40')){this[_0xb41d('0x1a')][_0x5859c8['linkedid']][_0xb41d('0x42')]=_0x5859c8[_0xb41d('0x67')];}this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]]['connectedlinename']=_0x5859c8[_0xb41d('0x37')];this[_0xb41d('0x1a')][_0x5859c8['linkedid']][_0xb41d('0x68')]=_0x5859c8['channel'];this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x4c')]=dispositions[_['toNumber'](_0x5859c8[_0xb41d('0x69')])];if(this[_0xb41d('0x1b')][_0x5859c8['channel'][_0xb41d('0x3f')]('-')[0x0]]){this[_0xb41d('0x1a')][_0x5859c8['linkedid']][_0xb41d('0x6a')]=this[_0xb41d('0x1b')][_0x5859c8[_0xb41d('0x3e')]['split']('-')[0x0]]['id'];this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x6b')]=this[_0xb41d('0x1b')][_0x5859c8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x44')];}}}}else{if(this['channels'][_0x5859c8['uniqueid']]){if(_0x5859c8[_0xb41d('0x69')]==='6'){if(this[_0xb41d('0x1b')][_0x5859c8['channel'][_0xb41d('0x3f')]('-')[0x0]]){this['channels'][_0x5859c8[_0xb41d('0x39')]][_0xb41d('0x6a')]=this[_0xb41d('0x1b')][_0x5859c8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]['id'];this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x39')]][_0xb41d('0x6b')]=this[_0xb41d('0x1b')][_0x5859c8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x44')];}}}}if(_0x5859c8[_0xb41d('0x69')]==='6'&&_0x5859c8['context']==='from-sip'){if(this[_0xb41d('0x1b')][_0x5859c8['channel'][_0xb41d('0x3f')]('-')[0x0]]){this[_0xb41d('0x1b')][_0x5859c8['channel'][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x41')]=_0x5859c8[_0xb41d('0x49')];var _0x310b3a;if(this[_0xb41d('0x1a')][_0x5859c8['uniqueid']])_0x310b3a=this['channels'][_0x5859c8['uniqueid']][_0xb41d('0x6c')];else if(this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]])_0x310b3a=this[_0xb41d('0x1a')][_0x5859c8[_0xb41d('0x3a')]][_0xb41d('0x6c')];logger[_0xb41d('0x38')](_0xb41d('0x6d'),_0x5859c8[_0xb41d('0x39')],util[_0xb41d('0x31')]({'destaccountcode':this['agents'][_0x5859c8[_0xb41d('0x3e')]['split']('-')[0x0]][_0xb41d('0x52')],'destconnectedlinenum':_0x5859c8['exten'],'routealias':_0x310b3a},{'showHidden':![],'depth':null}));this['emit'](util[_0xb41d('0x43')]('user:%s',this[_0xb41d('0x1b')][_0x5859c8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x44')]),_0xb41d('0x54'),{'destaccountcode':this[_0xb41d('0x1b')][_0x5859c8['channel'][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x52')],'destconnectedlinenum':_0x5859c8['exten'],'routealias':_0x310b3a});}}}}catch(_0x336fb5){logger[_0xb41d('0x2f')](_0xb41d('0x6e'),_0x5859c8[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x336fb5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')]['syncMixMonitorFilename']=function(_0x15266e,_0x23eb63){try{if(this[_0xb41d('0x1a')][_0x15266e]){logger[_0xb41d('0x35')](_0xb41d('0x6f'),_0x15266e,_0x23eb63);this[_0xb41d('0x1a')][_0x15266e][_0xb41d('0x70')]=!![];if(_[_0xb41d('0x71')](_0x23eb63,'.wav49')){_0x23eb63=_0x23eb63[_0xb41d('0x72')](_0xb41d('0x73'),'.WAV');}this[_0xb41d('0x1a')][_0x15266e][_0xb41d('0x74')]=_0x23eb63;var _0x19490b=_[_0xb41d('0x75')](this[_0xb41d('0x1a')][_0x15266e][_0xb41d('0x76')],{'filename':_0x23eb63});if(_[_0xb41d('0x77')](_0x19490b)){this[_0xb41d('0x1a')][_0x15266e][_0xb41d('0x76')]['push']({'filename':_0x23eb63,'createdAt':moment()[_0xb41d('0x43')](_0xb41d('0x4b')),'mixmonitorid':'','status':_0xb41d('0x78')});}}}catch(_0x794532){logger[_0xb41d('0x2f')](_0xb41d('0x79'),_0x15266e,util[_0xb41d('0x31')](_0x794532,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')]['syncVarSet']=function(_0x3da6e9){try{if(this[_0xb41d('0x32')](_0x3da6e9)){logger['debug'](_0xb41d('0x7a'),_0x3da6e9['uniqueid'],util['inspect'](_0x3da6e9,{'showHidden':![],'depth':null}));if(this['channels'][_0x3da6e9[_0xb41d('0x39')]]&&_0x3da6e9[_0xb41d('0x3e')]!=_0xb41d('0x47')){if(this[_0xb41d('0x32')](_0x3da6e9[_0xb41d('0x7b')])){if(this[_0xb41d('0x32')](_0x3da6e9[_0xb41d('0x7b')]['mixmonitor_filename'])){logger[_0xb41d('0x35')](_0xb41d('0x7c'),_0x3da6e9['uniqueid'],_0x3da6e9[_0xb41d('0x7d')]);this[_0xb41d('0x7e')](_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);}else if(this[_0xb41d('0x32')](_0x3da6e9[_0xb41d('0x7b')][_0xb41d('0x7f')])){logger[_0xb41d('0x35')](_0xb41d('0x80'),_0x3da6e9[_0xb41d('0x39')],_0x3da6e9['value']);this['channels'][_0x3da6e9[_0xb41d('0x39')]][_0xb41d('0x67')]=_0x3da6e9[_0xb41d('0x7d')];}else if(this[_0xb41d('0x32')](_0x3da6e9[_0xb41d('0x7b')][_0xb41d('0x81')])){logger[_0xb41d('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);this[_0xb41d('0x1a')][_0x3da6e9['uniqueid']][_0xb41d('0x82')]=_0x3da6e9[_0xb41d('0x7d')];}else if(this[_0xb41d('0x32')](_0x3da6e9['variable']['xmd-cdrtype'])){logger[_0xb41d('0x35')](_0xb41d('0x83'),_0x3da6e9[_0xb41d('0x39')],_0x3da6e9['value']);this[_0xb41d('0x1a')][_0x3da6e9['uniqueid']]['type']=_0x3da6e9[_0xb41d('0x7d')];}else if(this[_0xb41d('0x32')](_0x3da6e9['variable'][_0xb41d('0x84')])){logger['info'](_0xb41d('0x85'),_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')][_0xb41d('0x3f')](',')[0x0]);this[_0xb41d('0x1a')][_0x3da6e9[_0xb41d('0x39')]][_0xb41d('0x86')]=_0x3da6e9[_0xb41d('0x7d')]['split'](',')[0x0];}else if(this['isNotNull'](_0x3da6e9[_0xb41d('0x7b')]['xmd-originatecalleridnum'])){logger[_0xb41d('0x35')](_0xb41d('0x87'),_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);this[_0xb41d('0x1a')][_0x3da6e9[_0xb41d('0x39')]][_0xb41d('0x88')]=_0x3da6e9[_0xb41d('0x7d')];}else if(this[_0xb41d('0x32')](_0x3da6e9['variable'][_0xb41d('0x89')])){logger[_0xb41d('0x35')](_0xb41d('0x8a'),_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);this['channels'][_0x3da6e9[_0xb41d('0x39')]][_0xb41d('0x8b')]=_0x3da6e9[_0xb41d('0x7d')];}else if(this[_0xb41d('0x32')](_0x3da6e9['variable'][_0xb41d('0x8c')])){logger[_0xb41d('0x35')](_0xb41d('0x8d'),_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);this[_0xb41d('0x1a')][_0x3da6e9[_0xb41d('0x39')]][_0xb41d('0x8e')]=_0x3da6e9[_0xb41d('0x7d')];}else if(this['isNotNull'](_0x3da6e9[_0xb41d('0x7b')][_0xb41d('0x8f')])){logger[_0xb41d('0x35')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);this['channels'][_0x3da6e9[_0xb41d('0x39')]][_0xb41d('0x86')]=_0x3da6e9[_0xb41d('0x7d')];}else if(this[_0xb41d('0x32')](_0x3da6e9['variable'][_0xb41d('0x90')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x3da6e9[_0xb41d('0x39')],_0x3da6e9[_0xb41d('0x7d')]);this[_0xb41d('0x1a')][_0x3da6e9['uniqueid']]['sipcalluniqueid']=_0x3da6e9[_0xb41d('0x7d')];}}}else if(this['isNotNull'](_0x3da6e9['variable'][_0xb41d('0x91')])){if(_0x3da6e9[_0xb41d('0x7d')]){var _0x5ae6c3=path[_0xb41d('0x92')](_0x3da6e9[_0xb41d('0x7d')])['name'];logger['info'](_0xb41d('0x7c'),_0x5ae6c3,_0x3da6e9['value']);this[_0xb41d('0x7e')](_0x5ae6c3,_0x3da6e9[_0xb41d('0x7d')]);}}else if(this[_0xb41d('0x1a')][_0x3da6e9[_0xb41d('0x3a')]]){if(this[_0xb41d('0x32')](_0x3da6e9['variable'])){if(this[_0xb41d('0x32')](_0x3da6e9[_0xb41d('0x7b')][_0xb41d('0x90')])){logger[_0xb41d('0x35')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x3da6e9['linkedid'],_0x3da6e9['value']);this[_0xb41d('0x1a')][_0x3da6e9[_0xb41d('0x3a')]]['sipcalllinkedid']=_0x3da6e9['value'];}}}}}catch(_0x272f8b){logger[_0xb41d('0x2f')](_0xb41d('0x93'),_0x3da6e9[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x272f8b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')]['syncHangup']=function(_0x2775f8){try{if(this[_0xb41d('0x32')](_0x2775f8)){logger[_0xb41d('0x38')](_0xb41d('0x94'),_0x2775f8[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x2775f8,{'showHidden':![],'depth':null}));if(this['channels'][_0x2775f8[_0xb41d('0x39')]]){logger['info']('[%s][voiceCallReport][hangup]\x20reason:%s',_0x2775f8[_0xb41d('0x39')],_0x2775f8[_0xb41d('0x95')]);var _0x220798=moment();this['channels'][_0x2775f8[_0xb41d('0x39')]]['endtime']=_0x220798[_0xb41d('0x43')](_0xb41d('0x4b'));this[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]]['duration']=_0x220798[_0xb41d('0x66')](this[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]]['starttime'],_0xb41d('0x5e'));if(this[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]][_0xb41d('0x64')]){this[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]][_0xb41d('0x96')]=_0x220798['diff'](this[_0xb41d('0x1a')][_0x2775f8['uniqueid']][_0xb41d('0x65')],'seconds');this['channels'][_0x2775f8['uniqueid']][_0xb41d('0x97')]=this[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]][_0xb41d('0x5d')]-this['channels'][_0x2775f8['uniqueid']][_0xb41d('0x96')];}if(_0x2775f8[_0xb41d('0x4f')]===_0xb41d('0x50')){if(this[_0xb41d('0x1b')][_0x2775f8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]){this['agents'][_0x2775f8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]=_[_0xb41d('0x98')](this['agents'][_0x2775f8[_0xb41d('0x3e')]['split']('-')[0x0]],[_0xb41d('0x41')]);logger[_0xb41d('0x38')](_0xb41d('0x99'),_0x2775f8['uniqueid'],util[_0xb41d('0x31')]({'id':this[_0xb41d('0x1b')][_0x2775f8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x2775f8['channel']['split']('-')[0x0]][_0xb41d('0x52')]},{'showHidden':![],'depth':null}));this[_0xb41d('0x34')](util[_0xb41d('0x43')](_0xb41d('0x53'),this[_0xb41d('0x1b')][_0x2775f8[_0xb41d('0x3e')][_0xb41d('0x3f')]('-')[0x0]][_0xb41d('0x44')]),_0xb41d('0x9a'),{'id':this[_0xb41d('0x1b')][_0x2775f8['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xb41d('0x1b')][_0x2775f8[_0xb41d('0x3e')]['split']('-')[0x0]]['accountcode']});}}var _0x197f89=this;Promise[_0xb41d('0x9b')]()[_0xb41d('0x9c')](function(){var _0x3f3911=_0x197f89[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]];if(typeof _0x3f3911[_0xb41d('0x9d')]===_0xb41d('0x9e'))return;if(_[_0xb41d('0x9f')](_0x3f3911[_0xb41d('0x76')]))return;return RpcSetting[_0xb41d('0xa0')]()['then'](function(_0x3013bd){if(!_0x3013bd[_0xb41d('0xa1')])return;return Promise[_0xb41d('0x9b')]()[_0xb41d('0x9c')](function(){return ami[_0xb41d('0xa2')]({'action':_0xb41d('0xa3'),'channel':_0x3f3911[_0xb41d('0x3e')]})[_0xb41d('0xa4')](function(){});})[_0xb41d('0x9c')](function(){return ami[_0xb41d('0xa2')]({'action':_0xb41d('0xa3'),'channel':_0x3f3911[_0xb41d('0x68')]})[_0xb41d('0xa4')](function(){})[_0xb41d('0xa5')](function(){var _0x18986b=_0x197f89['agents'][_0x3f3911['destinationchannel'][_0xb41d('0x3f')]('-')[0x0]];if(!_0x18986b)return;io[_0xb41d('0x34')]('webbar:stopmonitors',{'agentId':_0x18986b['id'],'uniqueid':_0x3f3911[_0xb41d('0x39')]});});});});})[_0xb41d('0x9c')](function(){if(_0x2775f8['event']==='BlindTransfer'){_0x197f89[_0xb41d('0x1c')][_0x2775f8['uniqueid']]=_0x197f89[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]];}else{if(_0x197f89['channels'][_0x2775f8[_0xb41d('0x39')]]['type']===_0xb41d('0xa6')&&_0x197f89['blindTransfers'][_0x2775f8[_0xb41d('0x39')]]){_0x197f89['channels'][_0x2775f8['uniqueid']][_0xb41d('0x39')]=[_0x197f89[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]][_0xb41d('0x3a')],_0x197f89[_0xb41d('0x1a')][_0x2775f8['uniqueid']][_0xb41d('0x3a')]=_0x197f89[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]]['uniqueid']][0x0];delete _0x197f89[_0xb41d('0x1c')][_0x2775f8['uniqueid']];}}logger[_0xb41d('0x38')](_0xb41d('0xa7'),_0x2775f8[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x197f89[_0xb41d('0x1a')][_0x2775f8[_0xb41d('0x39')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb41d('0xa8'),_0x197f89['channels'][_0x2775f8[_0xb41d('0x39')]]);delete _0x197f89[_0xb41d('0x1a')][_0x2775f8['uniqueid']];});}}}catch(_0x764813){logger['error'](_0xb41d('0xa9'),_0x2775f8[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x764813,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x28')]=function(_0x573854){try{if(this[_0xb41d('0x32')](_0x573854)){logger['info'](_0xb41d('0xaa'),_0x573854[_0xb41d('0x39')],_0x573854[_0xb41d('0xab')],_0x573854[_0xb41d('0xac')]);logger[_0xb41d('0x38')](_0xb41d('0xad'),_0x573854[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x573854,{'showHidden':![],'depth':null}));if(this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xae')]]){this[_0xb41d('0x1a')][_0x573854['transfereeuniqueid']][_0xb41d('0xaf')]=_0x573854[_0xb41d('0xab')];this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xae')]][_0xb41d('0xb0')]=_0x573854[_0xb41d('0xac')];if(this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb1')]]){var _0x28fd35=this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb1')]];this[_0xb41d('0x1a')][_0x573854['secondtransfereruniqueid']]=this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xae')]];this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xae')]]=_0x28fd35;}}else if(this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb2')]]){this['channels'][_0x573854[_0xb41d('0xb2')]][_0xb41d('0xaf')]=_0x573854[_0xb41d('0xab')];this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb2')]][_0xb41d('0xb0')]=_0x573854['transfertargetcalleridnum'];if(this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb3')]]){var _0x28fd35=this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb3')]];this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb3')]]=this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb2')]];this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb2')]]=_0x28fd35;}}if((this['channels'][_0x573854[_0xb41d('0xb3')]]||this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb4')]])&&this[_0xb41d('0x1a')][_0x573854['secondtransfereruniqueid']]){var _0x5cbf54=_[_0xb41d('0xb5')]([this['channels'][_0x573854[_0xb41d('0xb3')]],this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb4')]],this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb1')]]],function(_0x5e1ab4){return _0x5e1ab4&&_0x5e1ab4[_0xb41d('0xb6')]==='outbound'&&_0x5e1ab4[_0xb41d('0xb7')];});if(_0x5cbf54){if(this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb3')]])this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb3')]][_0xb41d('0x9d')]=_0xb41d('0xb8');if(this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb4')]])this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb4')]]['transferType']=_0xb41d('0xb8');this[_0xb41d('0x1a')][_0x573854[_0xb41d('0xb1')]][_0xb41d('0x9d')]=_0xb41d('0xb8');}}}}catch(_0x2744cd){logger[_0xb41d('0x2f')](_0xb41d('0xb9'),_0x573854['uniqueid'],util['inspect'](_0x2744cd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x2a')]=function(_0x13e53c){try{if(this[_0xb41d('0x32')](_0x13e53c)){logger[_0xb41d('0x35')](_0xb41d('0xba'),_0x13e53c[_0xb41d('0x39')],_0x13e53c[_0xb41d('0xbb')],_0x13e53c[_0xb41d('0xbc')]);logger[_0xb41d('0x38')](_0xb41d('0xbd'),_0x13e53c[_0xb41d('0x39')],util['inspect'](_0x13e53c,{'showHidden':![],'depth':null}));if(this[_0xb41d('0x1a')][_0x13e53c[_0xb41d('0xae')]]){this[_0xb41d('0x1a')][_0x13e53c[_0xb41d('0xae')]][_0xb41d('0xaf')]=_0x13e53c[_0xb41d('0xbb')];this[_0xb41d('0x1a')][_0x13e53c['transfereeuniqueid']][_0xb41d('0xb0')]=_0x13e53c[_0xb41d('0xbc')];this[_0xb41d('0x1a')][_0x13e53c[_0xb41d('0xae')]]['transferType']='BLIND';this[_0xb41d('0xbe')]({'event':'BlindTransfer','uniqueid':_0x13e53c[_0xb41d('0xae')],'context':_0x13e53c[_0xb41d('0x4f')],'channel':_0x13e53c[_0xb41d('0xbf')]});}else{this[_0xb41d('0x1a')][_0x13e53c[_0xb41d('0xc0')]][_0xb41d('0x9d')]=_0xb41d('0xc1');}}}catch(_0x3ecf91){logger[_0xb41d('0x2f')]('[%s][voiceCallReport][blindtransfer]',_0x13e53c[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x3ecf91,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x2b')]=function(_0x3065d1){try{if(this[_0xb41d('0x32')](_0x3065d1)){logger[_0xb41d('0x38')](_0xb41d('0xc2'),_0x3065d1[_0xb41d('0x39')],util[_0xb41d('0x31')](_0x3065d1,{'showHidden':![],'depth':null}));if(this['channels'][_0x3065d1[_0xb41d('0x39')]]){if(!_[_0xb41d('0x77')](this['channels'][_0x3065d1[_0xb41d('0x39')]][_0xb41d('0x65')])){this[_0xb41d('0x1a')][_0x3065d1[_0xb41d('0x39')]]['mohstarttime']=moment()[_0xb41d('0x43')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xb41d('0x35')](_0xb41d('0xc3'),_0x3065d1[_0xb41d('0x39')],this[_0xb41d('0x1a')][_0x3065d1[_0xb41d('0x39')]][_0xb41d('0xc4')]);}}}}catch(_0x3fd367){logger[_0xb41d('0x2f')](_0xb41d('0xc5'),_0x3065d1[_0xb41d('0x39')],util['inspect'](_0x3fd367,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb41d('0x33')][_0xb41d('0x2d')]=function(_0xf23f49){try{if(this[_0xb41d('0x32')](_0xf23f49)){logger[_0xb41d('0x38')](_0xb41d('0xc6'),_0xf23f49[_0xb41d('0x39')],util['inspect'](_0xf23f49,{'showHidden':![],'depth':null}));if(this[_0xb41d('0x1a')][_0xf23f49[_0xb41d('0x39')]]){if(!_[_0xb41d('0x77')](this[_0xb41d('0x1a')][_0xf23f49['uniqueid']]['mohstarttime'])){this[_0xb41d('0x1a')][_0xf23f49[_0xb41d('0x39')]][_0xb41d('0xc7')]+=moment()['milliseconds'](0x0)[_0xb41d('0x66')](this[_0xb41d('0x1a')][_0xf23f49['uniqueid']][_0xb41d('0xc4')],_0xb41d('0x5e'));logger[_0xb41d('0x35')](_0xb41d('0xc8'),_0xf23f49['uniqueid'],this[_0xb41d('0x1a')][_0xf23f49[_0xb41d('0x39')]][_0xb41d('0xc7')]);delete this[_0xb41d('0x1a')][_0xf23f49[_0xb41d('0x39')]]['mohstarttime'];}}}}catch(_0xe59491){logger[_0xb41d('0x2f')]('[%s][voiceCallReport][musiconholdstop]',_0xf23f49[_0xb41d('0x39')],util['inspect'](_0xe59491,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xe196=['[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','webbar:stopmonitors','event','BlindTransfer','blindTransfers','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','ringinuse','onhold','queue','agi','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','newcallerid','syncNewCallerId','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','isUndefined','merge','pick','keys','context','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','name','user:agentconnect','accountcode','connectedlinenum','[%s][voiceCallReport][newcallerid]','isNotNull','linkedid','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','seconds','includes','lastapplication','lastdata','set','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','monitorFilename','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','parse','syncMixMonitorFilename','sipcalllinkedid'];(function(_0x104bff,_0x46d0c6){var _0x126086=function(_0x585ded){while(--_0x585ded){_0x104bff['push'](_0x104bff['shift']());}};_0x126086(++_0x46d0c6);}(_0xe196,0xf7));var _0x6e19=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe196[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x6e19('0x0'));var _=require(_0x6e19('0x1'));var moment=require(_0x6e19('0x2'));var util=require(_0x6e19('0x3'));var path=require(_0x6e19('0x4'));var Redis=require('ioredis');var config=require(_0x6e19('0x5'));var logger=require(_0x6e19('0x6'))('ami');var ami=require(_0x6e19('0x7'));var Channel=require(_0x6e19('0x8'));var RpcSetting=require(_0x6e19('0x9'));var statusDesc=[_0x6e19('0xa'),_0x6e19('0xb'),_0x6e19('0xc'),_0x6e19('0xd'),_0x6e19('0xe'),'unavailable','ringing',_0x6e19('0xf'),_0x6e19('0x10')];var applications=['set',_0x6e19('0x11'),_0x6e19('0x12'),'dial','playback',_0x6e19('0x13')];var dispositions=[_0x6e19('0x14'),'FAILED',_0x6e19('0x15'),_0x6e19('0x14'),'NO\x20ANSWER','NO\x20ANSWER',_0x6e19('0x16'),_0x6e19('0x17'),_0x6e19('0x15'),_0x6e19('0x15'),_0x6e19('0x15')];var actions={};config['redis']=_[_0x6e19('0x18')](config[_0x6e19('0x19')],{'host':_0x6e19('0x1a'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e19('0x19')]));function VoiceCallReport(_0x3bcad4){this[_0x6e19('0x1b')]=_0x3bcad4['channels'];this['agents']=_0x3bcad4[_0x6e19('0x1c')];this['blindTransfers']={};ami['on'](_0x6e19('0x1d'),this[_0x6e19('0x1e')][_0x6e19('0x1f')](this));ami['on'](_0x6e19('0x20'),this[_0x6e19('0x1e')][_0x6e19('0x1f')](this));ami['on'](_0x6e19('0x21'),this[_0x6e19('0x22')][_0x6e19('0x1f')](this));ami['on'](_0x6e19('0x23'),this[_0x6e19('0x24')][_0x6e19('0x1f')](this));ami['on']('varset',this[_0x6e19('0x25')]['bind'](this));ami['on'](_0x6e19('0x26'),this['syncHangup']['bind'](this));ami['on'](_0x6e19('0x27'),this[_0x6e19('0x28')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x6e19('0x1f')](this));ami['on']('blindtransfer',this[_0x6e19('0x29')][_0x6e19('0x1f')](this));ami['on']('musiconholdstart',this[_0x6e19('0x2a')][_0x6e19('0x1f')](this));ami['on'](_0x6e19('0x2b'),this[_0x6e19('0x2c')]['bind'](this));try{logger['info'](_0x6e19('0x2d'));ami[_0x6e19('0x2e')]();}catch(_0x3af6a3){logger[_0x6e19('0x2f')](_0x6e19('0x30'),util[_0x6e19('0x31')](_0x3af6a3,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x6e19('0x32')]['isNotNull']=function(_0x3880d6){return _0x3880d6!==null&&!_['isUndefined'](_0x3880d6);};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x33')]=function(_0x2250da,_0x3c7504,_0x28e540){io['to'](_0x2250da)[_0x6e19('0x33')](_0x3c7504,_0x28e540);};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x28')]=function(_0x98b1b){try{if(this['isNotNull'](_0x98b1b)){logger[_0x6e19('0x34')](_0x6e19('0x35'),_0x98b1b[_0x6e19('0x36')],_0x98b1b[_0x6e19('0x37')],_0x98b1b[_0x6e19('0x38')]);logger[_0x6e19('0x39')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x98b1b[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x98b1b,{'showHidden':![],'depth':null}));if(_0x98b1b['uniqueid']===_0x98b1b['linkedid']){if(!_[_0x6e19('0x3a')](this[_0x6e19('0x1b')][_0x98b1b['uniqueid']])){_[_0x6e19('0x3b')](this[_0x6e19('0x1b')][_0x98b1b['uniqueid']],_[_0x6e19('0x3c')](_0x98b1b,_[_0x6e19('0x3d')](this[_0x6e19('0x1b')][_0x98b1b['uniqueid']])));}}if(_0x98b1b[_0x6e19('0x3e')]==='from-sip'){if(this[_0x6e19('0x1c')][_0x98b1b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]){if(_0x98b1b[_0x6e19('0x41')]==_0x6e19('0x42')){this[_0x6e19('0x1c')][_0x98b1b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x43')]=_0x98b1b['connectedlinenum'];this['emit'](util[_0x6e19('0x44')](_0x6e19('0x45'),this[_0x6e19('0x1c')][_0x98b1b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x46')]),_0x6e19('0x47'),{'destaccountcode':this[_0x6e19('0x1c')][_0x98b1b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x48')],'destconnectedlinenum':_0x98b1b[_0x6e19('0x49')]});}}}}}catch(_0x1365ab){logger[_0x6e19('0x2f')](_0x6e19('0x4a'),_0x98b1b[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x1365ab,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x22')]=function(_0x46b7ab){try{if(this[_0x6e19('0x4b')](_0x46b7ab)){logger[_0x6e19('0x39')]('[%s][voiceCallReport][newchannel]\x20event:',_0x46b7ab[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x46b7ab,{'showHidden':![],'depth':null}));if(_0x46b7ab[_0x6e19('0x36')]===_0x46b7ab[_0x6e19('0x4c')]&&_0x46b7ab[_0x6e19('0x3f')]!=_0x6e19('0x4d')){if(_[_0x6e19('0x3a')](this[_0x6e19('0x1b')][_0x46b7ab[_0x6e19('0x36')]])){logger[_0x6e19('0x34')](_0x6e19('0x4e'),_0x46b7ab[_0x6e19('0x36')],_0x46b7ab[_0x6e19('0x3e')],_0x46b7ab[_0x6e19('0x41')]);this[_0x6e19('0x1b')][_0x46b7ab[_0x6e19('0x36')]]=new Channel();this[_0x6e19('0x1b')][_0x46b7ab['uniqueid']][_0x6e19('0x4f')]=moment()[_0x6e19('0x44')](_0x6e19('0x50'));this[_0x6e19('0x1b')][_0x46b7ab[_0x6e19('0x36')]][_0x6e19('0x51')]=dispositions[_[_0x6e19('0x52')](_0x46b7ab[_0x6e19('0x53')])];_[_0x6e19('0x3b')](this[_0x6e19('0x1b')][_0x46b7ab[_0x6e19('0x36')]],_['pick'](_0x46b7ab,_[_0x6e19('0x3d')](this[_0x6e19('0x1b')][_0x46b7ab[_0x6e19('0x36')]])));if(_0x46b7ab['context']===_0x6e19('0x54')){if(this[_0x6e19('0x1c')][_0x46b7ab[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]){if(_[_0x6e19('0x3a')](this[_0x6e19('0x1c')][_0x46b7ab[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x43')])){this[_0x6e19('0x1c')][_0x46b7ab['channel'][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x43')]=_0x46b7ab[_0x6e19('0x41')];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x46b7ab['uniqueid'],util['inspect']({'destaccountcode':this['agents'][_0x46b7ab[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x48')],'destconnectedlinenum':_0x46b7ab[_0x6e19('0x41')]},{'showHidden':![],'depth':null}));this[_0x6e19('0x33')](util['format'](_0x6e19('0x45'),this[_0x6e19('0x1c')][_0x46b7ab[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x46')]),_0x6e19('0x47'),{'destaccountcode':this[_0x6e19('0x1c')][_0x46b7ab['channel']['split']('-')[0x0]][_0x6e19('0x48')],'destconnectedlinenum':_0x46b7ab[_0x6e19('0x41')]});}}}}}}}catch(_0x1ebfe0){logger['error'](_0x6e19('0x55'),_0x46b7ab[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x1ebfe0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x41335f){try{if(this[_0x6e19('0x4b')](_0x41335f)){logger[_0x6e19('0x39')](_0x6e19('0x56'),_0x41335f['uniqueid'],util['inspect'](_0x41335f,{'showHidden':![],'depth':null}));if(_0x41335f[_0x6e19('0x36')]===_0x41335f[_0x6e19('0x4c')]&&_0x41335f[_0x6e19('0x41')]!='h'&&_0x41335f[_0x6e19('0x3f')]!='OutgoingSpoolFailed'){_0x41335f[_0x6e19('0x57')]=_0x41335f[_0x6e19('0x57')]['toLowerCase']();_0x41335f[_0x6e19('0x58')]=_0x41335f[_0x6e19('0x59')]&&_0x41335f['appdata'][_0x6e19('0x5a')]('CDR(routeAlias)')?_0x41335f[_0x6e19('0x59')]:(_0x41335f[_0x6e19('0x59')]||_0x41335f[_0x6e19('0x58')])[_0x6e19('0x5b')]();logger[_0x6e19('0x34')](_0x6e19('0x5c'),_0x41335f[_0x6e19('0x36')],_0x41335f[_0x6e19('0x57')],_0x41335f[_0x6e19('0x58')]);if(_[_0x6e19('0x3a')](this[_0x6e19('0x1b')][_0x41335f[_0x6e19('0x36')]])){this[_0x6e19('0x1b')][_0x41335f[_0x6e19('0x36')]]=new Channel();this['channels'][_0x41335f['uniqueid']]['starttime']=_0x41335f['duration']?moment()['subtract'](moment['duration'](_0x41335f[_0x6e19('0x5d')])[_0x6e19('0x5e')](),'seconds')[_0x6e19('0x44')](_0x6e19('0x50')):moment()[_0x6e19('0x44')](_0x6e19('0x50'));this[_0x6e19('0x1b')][_0x41335f[_0x6e19('0x36')]][_0x6e19('0x51')]=_0x6e19('0x14');}_[_0x6e19('0x3b')](this[_0x6e19('0x1b')][_0x41335f['uniqueid']],_[_0x6e19('0x3c')](_0x41335f,_[_0x6e19('0x3d')](this[_0x6e19('0x1b')][_0x41335f[_0x6e19('0x36')]])));if(_[_0x6e19('0x5f')](applications,_0x41335f['application'])){this[_0x6e19('0x1b')][_0x41335f[_0x6e19('0x36')]][_0x6e19('0x60')]=_0x41335f[_0x6e19('0x57')];this[_0x6e19('0x1b')][_0x41335f['uniqueid']][_0x6e19('0x61')]=_0x41335f['applicationdata'];if(_0x41335f[_0x6e19('0x57')]===_0x6e19('0x62')&&_['startsWith'](_0x41335f['applicationdata'][_0x6e19('0x5b')](),_0x6e19('0x63'))){var _0x13d8f0=_0x41335f['applicationdata'][_0x6e19('0x40')]('=');var _0x30db81=_0x13d8f0[0x0]['toLowerCase']()[_0x6e19('0x64')](/cdr\((.*)\)/);if(_0x30db81){this['channels'][_0x41335f[_0x6e19('0x36')]][_0x30db81[0x1]]=_0x13d8f0[0x1];}}else if(_0x41335f[_0x6e19('0x57')]===_0x6e19('0x11')){this['channels'][_0x41335f[_0x6e19('0x36')]]['queue']=_0x41335f['applicationdata'][_0x6e19('0x40')](',')[0x0];}}}}}catch(_0x354957){logger[_0x6e19('0x2f')](_0x6e19('0x65'),_0x41335f[_0x6e19('0x36')],util['inspect'](_0x354957,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x24')]=function(_0x481f10){try{if(this['isNotNull'](_0x481f10)){logger[_0x6e19('0x34')](_0x6e19('0x66'),_0x481f10[_0x6e19('0x36')],_0x481f10[_0x6e19('0x4c')],_0x481f10[_0x6e19('0x37')],_0x481f10[_0x6e19('0x38')]);logger[_0x6e19('0x39')]('[%s][voiceCallReport][newstate]\x20event:',_0x481f10[_0x6e19('0x36')],util['inspect'](_0x481f10,{'showHidden':![],'depth':null}));if(_0x481f10[_0x6e19('0x36')]!==_0x481f10['linkedid']){if(this[_0x6e19('0x1b')][_0x481f10['linkedid']]){if(_0x481f10[_0x6e19('0x53')]==='6'){if(!this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x67')]){var _0x4a9321=moment();this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x67')]=!![];this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x68')]=_0x4a9321[_0x6e19('0x44')](_0x6e19('0x50'));if(this['channels'][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x4f')]){this[_0x6e19('0x1b')][_0x481f10['linkedid']][_0x6e19('0x69')]=_0x4a9321[_0x6e19('0x6a')](this[_0x6e19('0x1b')][_0x481f10['linkedid']][_0x6e19('0x4f')],_0x6e19('0x5e'));}}this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x4c')]=_0x481f10['uniqueid'];if(_0x481f10['calleridnum']!==_0x6e19('0x42')){this['channels'][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x49')]=_0x481f10['calleridnum'];}this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]]['connectedlinename']=_0x481f10[_0x6e19('0x37')];this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x6b')]=_0x481f10['channel'];this[_0x6e19('0x1b')][_0x481f10['linkedid']][_0x6e19('0x51')]=dispositions[_[_0x6e19('0x52')](_0x481f10['channelstate'])];if(this[_0x6e19('0x1c')][_0x481f10[_0x6e19('0x3f')]['split']('-')[0x0]]){this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x6c')]=this['agents'][_0x481f10['channel']['split']('-')[0x0]]['id'];this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x6d')]=this['agents'][_0x481f10['channel'][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x46')];}}}}else{if(this['channels'][_0x481f10['uniqueid']]){if(_0x481f10[_0x6e19('0x53')]==='6'){if(this[_0x6e19('0x1c')][_0x481f10[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]){this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x36')]][_0x6e19('0x6c')]=this[_0x6e19('0x1c')][_0x481f10[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]['id'];this['channels'][_0x481f10[_0x6e19('0x36')]]['membername']=this[_0x6e19('0x1c')][_0x481f10[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x46')];}}}}if(_0x481f10['channelstate']==='6'&&_0x481f10['context']==='from-sip'){if(this[_0x6e19('0x1c')][_0x481f10[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]){this['agents'][_0x481f10[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x43')]=_0x481f10[_0x6e19('0x41')];var _0x410883;if(this['channels'][_0x481f10[_0x6e19('0x36')]])_0x410883=this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x36')]][_0x6e19('0x6e')];else if(this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]])_0x410883=this[_0x6e19('0x1b')][_0x481f10[_0x6e19('0x4c')]][_0x6e19('0x6e')];logger[_0x6e19('0x39')](_0x6e19('0x6f'),_0x481f10[_0x6e19('0x36')],util[_0x6e19('0x31')]({'destaccountcode':this[_0x6e19('0x1c')][_0x481f10[_0x6e19('0x3f')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x481f10[_0x6e19('0x41')],'routealias':_0x410883},{'showHidden':![],'depth':null}));this[_0x6e19('0x33')](util[_0x6e19('0x44')](_0x6e19('0x45'),this[_0x6e19('0x1c')][_0x481f10['channel'][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x46')]),_0x6e19('0x47'),{'destaccountcode':this['agents'][_0x481f10[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x48')],'destconnectedlinenum':_0x481f10[_0x6e19('0x41')],'routealias':_0x410883});}}}}catch(_0x5004e7){logger[_0x6e19('0x2f')]('[%s][voiceCallReport][newstate]',_0x481f10[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x5004e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6e19('0x32')]['syncMixMonitorFilename']=function(_0x486c8b,_0x168f56){try{if(this[_0x6e19('0x1b')][_0x486c8b]){logger[_0x6e19('0x34')](_0x6e19('0x70'),_0x486c8b,_0x168f56);this[_0x6e19('0x1b')][_0x486c8b][_0x6e19('0x71')]=!![];if(_['endsWith'](_0x168f56,_0x6e19('0x72'))){_0x168f56=_0x168f56[_0x6e19('0x73')]('.wav49','.WAV');}this[_0x6e19('0x1b')][_0x486c8b][_0x6e19('0x74')]=_0x168f56;var _0x3c2479=_['find'](this['channels'][_0x486c8b][_0x6e19('0x75')],{'filename':_0x168f56});if(_[_0x6e19('0x76')](_0x3c2479)){this[_0x6e19('0x1b')][_0x486c8b][_0x6e19('0x75')][_0x6e19('0x77')]({'filename':_0x168f56,'createdAt':moment()[_0x6e19('0x44')](_0x6e19('0x50')),'mixmonitorid':'','status':'rec'});}}}catch(_0x399b88){logger['error'](_0x6e19('0x78'),_0x486c8b,util[_0x6e19('0x31')](_0x399b88,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x25')]=function(_0x1c9663){try{if(this['isNotNull'](_0x1c9663)){logger[_0x6e19('0x39')]('[%s][voiceCallReport][varset]\x20event:',_0x1c9663[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x1c9663,{'showHidden':![],'depth':null}));if(this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x36')]]&&_0x1c9663[_0x6e19('0x3f')]!=_0x6e19('0x4d')){if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')])){if(this[_0x6e19('0x4b')](_0x1c9663['variable'][_0x6e19('0x7a')])){logger[_0x6e19('0x34')](_0x6e19('0x7b'),_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this['syncMixMonitorFilename'](_0x1c9663[_0x6e19('0x36')],_0x1c9663['value']);}else if(this[_0x6e19('0x4b')](_0x1c9663['variable'][_0x6e19('0x7d')])){logger['info'](_0x6e19('0x7e'),_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x36')]][_0x6e19('0x38')]=_0x1c9663['value'];}else if(this['isNotNull'](_0x1c9663['variable'][_0x6e19('0x7f')])){logger[_0x6e19('0x34')](_0x6e19('0x80'),_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x36')]][_0x6e19('0x81')]=_0x1c9663[_0x6e19('0x7c')];}else if(this['isNotNull'](_0x1c9663[_0x6e19('0x79')][_0x6e19('0x82')])){logger[_0x6e19('0x34')](_0x6e19('0x83'),_0x1c9663['uniqueid'],_0x1c9663['value']);this['channels'][_0x1c9663['uniqueid']][_0x6e19('0x84')]=_0x1c9663[_0x6e19('0x7c')];}else if(this['isNotNull'](_0x1c9663[_0x6e19('0x79')]['xmd-queue'])){logger[_0x6e19('0x34')](_0x6e19('0x85'),_0x1c9663[_0x6e19('0x36')],_0x1c9663['value'][_0x6e19('0x40')](',')[0x0]);this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x36')]][_0x6e19('0x11')]=_0x1c9663[_0x6e19('0x7c')][_0x6e19('0x40')](',')[0x0];}else if(this['isNotNull'](_0x1c9663['variable']['xmd-originatecalleridnum'])){logger[_0x6e19('0x34')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x36')]][_0x6e19('0x86')]=_0x1c9663[_0x6e19('0x7c')];}else if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')][_0x6e19('0x87')])){logger[_0x6e19('0x34')](_0x6e19('0x88'),_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this['channels'][_0x1c9663[_0x6e19('0x36')]][_0x6e19('0x89')]=_0x1c9663[_0x6e19('0x7c')];}else if(this['isNotNull'](_0x1c9663['variable'][_0x6e19('0x8a')])){logger[_0x6e19('0x34')](_0x6e19('0x8b'),_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x36')]][_0x6e19('0x8c')]=_0x1c9663[_0x6e19('0x7c')];}else if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')]['xmcs-queue'])){logger['info'](_0x6e19('0x8d'),_0x1c9663[_0x6e19('0x36')],_0x1c9663[_0x6e19('0x7c')]);this['channels'][_0x1c9663['uniqueid']][_0x6e19('0x11')]=_0x1c9663[_0x6e19('0x7c')];}else if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')][_0x6e19('0x8e')])){logger['info'](_0x6e19('0x8f'),_0x1c9663['uniqueid'],_0x1c9663[_0x6e19('0x7c')]);this['channels'][_0x1c9663[_0x6e19('0x36')]]['sipcalluniqueid']=_0x1c9663[_0x6e19('0x7c')];}}}else if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')][_0x6e19('0x7a')])){if(_0x1c9663[_0x6e19('0x7c')]){var _0x2415bf=path[_0x6e19('0x90')](_0x1c9663['value'])[_0x6e19('0x46')];logger[_0x6e19('0x34')](_0x6e19('0x7b'),_0x2415bf,_0x1c9663['value']);this[_0x6e19('0x91')](_0x2415bf,_0x1c9663['value']);}}else if(this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x4c')]]){if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')])){if(this[_0x6e19('0x4b')](_0x1c9663[_0x6e19('0x79')][_0x6e19('0x8e')])){logger[_0x6e19('0x34')](_0x6e19('0x8f'),_0x1c9663[_0x6e19('0x4c')],_0x1c9663[_0x6e19('0x7c')]);this[_0x6e19('0x1b')][_0x1c9663[_0x6e19('0x4c')]][_0x6e19('0x92')]=_0x1c9663[_0x6e19('0x7c')];}}}}}catch(_0x5c1e13){logger['error'](_0x6e19('0x93'),_0x1c9663['uniqueid'],util[_0x6e19('0x31')](_0x5c1e13,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x94')]=function(_0x5de89b){try{if(this['isNotNull'](_0x5de89b)){logger[_0x6e19('0x39')](_0x6e19('0x95'),_0x5de89b['uniqueid'],util[_0x6e19('0x31')](_0x5de89b,{'showHidden':![],'depth':null}));if(this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]]){logger['info'](_0x6e19('0x96'),_0x5de89b[_0x6e19('0x36')],_0x5de89b[_0x6e19('0x97')]);var _0x3dd153=moment();this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]]['endtime']=_0x3dd153[_0x6e19('0x44')](_0x6e19('0x50'));this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x5d')]=_0x3dd153[_0x6e19('0x6a')](this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x4f')],_0x6e19('0x5e'));if(this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x67')]){this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x98')]=_0x3dd153[_0x6e19('0x6a')](this['channels'][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x68')],_0x6e19('0x5e'));this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x69')]=this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]]['duration']-this[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x98')];}if(_0x5de89b[_0x6e19('0x3e')]===_0x6e19('0x54')){if(this['agents'][_0x5de89b['channel'][_0x6e19('0x40')]('-')[0x0]]){this[_0x6e19('0x1c')][_0x5de89b[_0x6e19('0x3f')]['split']('-')[0x0]]=_['omit'](this[_0x6e19('0x1c')][_0x5de89b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]],[_0x6e19('0x43')]);logger[_0x6e19('0x39')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x5de89b[_0x6e19('0x36')],util[_0x6e19('0x31')]({'id':this['agents'][_0x5de89b['channel'][_0x6e19('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0x6e19('0x1c')][_0x5de89b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x6e19('0x44')]('user:%s',this['agents'][_0x5de89b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]][_0x6e19('0x46')]),'user:agentcomplete',{'id':this[_0x6e19('0x1c')][_0x5de89b[_0x6e19('0x3f')][_0x6e19('0x40')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5de89b[_0x6e19('0x3f')]['split']('-')[0x0]][_0x6e19('0x48')]});}}var _0x567697=this;Promise[_0x6e19('0x99')]()[_0x6e19('0x9a')](function(){var _0x147ecc=_0x567697['channels'][_0x5de89b['uniqueid']];if(typeof _0x147ecc[_0x6e19('0x9b')]===_0x6e19('0x9c'))return;if(_[_0x6e19('0x9d')](_0x147ecc[_0x6e19('0x75')]))return;return RpcSetting[_0x6e19('0x9e')]()[_0x6e19('0x9a')](function(_0x3eb8b0){if(!_0x3eb8b0[_0x6e19('0x9f')])return;return Promise[_0x6e19('0x99')]()['then'](function(){return ami[_0x6e19('0xa0')]({'action':_0x6e19('0xa1'),'channel':_0x147ecc[_0x6e19('0x3f')]})[_0x6e19('0xa2')](function(){});})[_0x6e19('0x9a')](function(){return ami[_0x6e19('0xa0')]({'action':_0x6e19('0xa1'),'channel':_0x147ecc[_0x6e19('0x6b')]})[_0x6e19('0xa2')](function(){})['finally'](function(){var _0x328e0f=_0x567697[_0x6e19('0x1c')][_0x147ecc['destinationchannel']['split']('-')[0x0]];if(!_0x328e0f)return;io[_0x6e19('0x33')](_0x6e19('0xa3'),{'agentId':_0x328e0f['id'],'uniqueid':_0x147ecc['uniqueid']});});});});})[_0x6e19('0x9a')](function(){if(_0x5de89b[_0x6e19('0xa4')]===_0x6e19('0xa5')){_0x567697[_0x6e19('0xa6')][_0x5de89b[_0x6e19('0x36')]]=_0x567697[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]];}else{if(_0x567697['channels'][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x84')]===_0x6e19('0xa7')&&_0x567697[_0x6e19('0xa6')][_0x5de89b[_0x6e19('0x36')]]){_0x567697[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x36')]=[_0x567697[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x4c')],_0x567697[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x4c')]=_0x567697[_0x6e19('0x1b')][_0x5de89b[_0x6e19('0x36')]][_0x6e19('0x36')]][0x0];delete _0x567697[_0x6e19('0xa6')][_0x5de89b[_0x6e19('0x36')]];}}logger[_0x6e19('0x39')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x5de89b[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x567697[_0x6e19('0x1b')][_0x5de89b['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x6e19('0x33')](_0x6e19('0xa8'),_0x567697['channels'][_0x5de89b[_0x6e19('0x36')]]);delete _0x567697['channels'][_0x5de89b[_0x6e19('0x36')]];});}}}catch(_0x11e5a4){logger[_0x6e19('0x2f')](_0x6e19('0xa9'),_0x5de89b[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x11e5a4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6e19('0xaa')]=function(_0x219ba0){try{if(this[_0x6e19('0x4b')](_0x219ba0)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x219ba0[_0x6e19('0x36')],_0x219ba0[_0x6e19('0xab')],_0x219ba0['transfertargetcalleridnum']);logger[_0x6e19('0x39')](_0x6e19('0xac'),_0x219ba0[_0x6e19('0x36')],util['inspect'](_0x219ba0,{'showHidden':![],'depth':null}));if(this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xad')]]){this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xad')]][_0x6e19('0xae')]=_0x219ba0[_0x6e19('0xab')];this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xad')]][_0x6e19('0xaf')]=_0x219ba0['transfertargetcalleridnum'];if(this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb0')]]){var _0x52efcc=this['channels'][_0x219ba0['secondtransfereruniqueid']];this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb0')]]=this[_0x6e19('0x1b')][_0x219ba0['transfereeuniqueid']];this['channels'][_0x219ba0['transfereeuniqueid']]=_0x52efcc;}}else if(this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb1')]]){this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb1')]][_0x6e19('0xae')]=_0x219ba0[_0x6e19('0xab')];this['channels'][_0x219ba0[_0x6e19('0xb1')]]['transferconnectedlinenum']=_0x219ba0[_0x6e19('0xb2')];if(this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb3')]]){var _0x52efcc=this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb3')]];this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb3')]]=this[_0x6e19('0x1b')][_0x219ba0['transfertargetuniqueid']];this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb1')]]=_0x52efcc;}}if((this['channels'][_0x219ba0[_0x6e19('0xb3')]]||this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb4')]])&&this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb0')]]){var _0x3eeb45=_[_0x6e19('0xb5')]([this['channels'][_0x219ba0['origtransfereruniqueid']],this['channels'][_0x219ba0[_0x6e19('0xb4')]],this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb0')]]],function(_0x3ec10c){return _0x3ec10c&&_0x3ec10c[_0x6e19('0x84')]===_0x6e19('0xa7')&&_0x3ec10c['routeid'];});if(_0x3eeb45){if(this['channels'][_0x219ba0[_0x6e19('0xb3')]])this['channels'][_0x219ba0[_0x6e19('0xb3')]]['transferType']=_0x6e19('0xb6');if(this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb4')]])this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb4')]][_0x6e19('0x9b')]=_0x6e19('0xb6');this[_0x6e19('0x1b')][_0x219ba0[_0x6e19('0xb0')]][_0x6e19('0x9b')]='ATTENDED';}}}}catch(_0x1f9d44){logger[_0x6e19('0x2f')]('[%s][voiceCallReport][attendedtransfer]',_0x219ba0[_0x6e19('0x36')],util['inspect'](_0x1f9d44,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x6e19('0x29')]=function(_0xe494dd){try{if(this[_0x6e19('0x4b')](_0xe494dd)){logger[_0x6e19('0x34')](_0x6e19('0xb7'),_0xe494dd[_0x6e19('0x36')],_0xe494dd[_0x6e19('0xb8')],_0xe494dd[_0x6e19('0xb9')]);logger[_0x6e19('0x39')](_0x6e19('0xba'),_0xe494dd[_0x6e19('0x36')],util[_0x6e19('0x31')](_0xe494dd,{'showHidden':![],'depth':null}));if(this[_0x6e19('0x1b')][_0xe494dd[_0x6e19('0xad')]]){this[_0x6e19('0x1b')][_0xe494dd['transfereeuniqueid']][_0x6e19('0xae')]=_0xe494dd[_0x6e19('0xb8')];this[_0x6e19('0x1b')][_0xe494dd[_0x6e19('0xad')]][_0x6e19('0xaf')]=_0xe494dd[_0x6e19('0xb9')];this[_0x6e19('0x1b')][_0xe494dd[_0x6e19('0xad')]][_0x6e19('0x9b')]=_0x6e19('0xbb');this[_0x6e19('0x94')]({'event':'BlindTransfer','uniqueid':_0xe494dd[_0x6e19('0xad')],'context':_0xe494dd[_0x6e19('0x3e')],'channel':_0xe494dd[_0x6e19('0xbc')]});}else{this[_0x6e19('0x1b')][_0xe494dd['transfereruniqueid']]['transferType']='BLIND';}}}catch(_0x5b268f){logger[_0x6e19('0x2f')]('[%s][voiceCallReport][blindtransfer]',_0xe494dd[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x5b268f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x6aea4d){try{if(this['isNotNull'](_0x6aea4d)){logger[_0x6e19('0x39')](_0x6e19('0xbd'),_0x6aea4d[_0x6e19('0x36')],util['inspect'](_0x6aea4d,{'showHidden':![],'depth':null}));if(this['channels'][_0x6aea4d[_0x6e19('0x36')]]){if(!_[_0x6e19('0x76')](this[_0x6e19('0x1b')][_0x6aea4d['uniqueid']]['answertime'])){this['channels'][_0x6aea4d[_0x6e19('0x36')]]['mohstarttime']=moment()[_0x6e19('0x44')](_0x6e19('0x50'));logger[_0x6e19('0x34')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x6aea4d[_0x6e19('0x36')],this[_0x6e19('0x1b')][_0x6aea4d[_0x6e19('0x36')]][_0x6e19('0xbe')]);}}}}catch(_0x59e59d){logger[_0x6e19('0x2f')](_0x6e19('0xbf'),_0x6aea4d['uniqueid'],util[_0x6e19('0x31')](_0x59e59d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x6e19('0x32')][_0x6e19('0x2c')]=function(_0x3d8a82){try{if(this[_0x6e19('0x4b')](_0x3d8a82)){logger['debug'](_0x6e19('0xc0'),_0x3d8a82[_0x6e19('0x36')],util[_0x6e19('0x31')](_0x3d8a82,{'showHidden':![],'depth':null}));if(this[_0x6e19('0x1b')][_0x3d8a82[_0x6e19('0x36')]]){if(!_[_0x6e19('0x76')](this['channels'][_0x3d8a82['uniqueid']][_0x6e19('0xbe')])){this[_0x6e19('0x1b')][_0x3d8a82[_0x6e19('0x36')]][_0x6e19('0xc1')]+=moment()[_0x6e19('0xc2')](0x0)[_0x6e19('0x6a')](this['channels'][_0x3d8a82[_0x6e19('0x36')]][_0x6e19('0xbe')],'seconds');logger[_0x6e19('0x34')](_0x6e19('0xc3'),_0x3d8a82['uniqueid'],this[_0x6e19('0x1b')][_0x3d8a82[_0x6e19('0x36')]][_0x6e19('0xc1')]);delete this['channels'][_0x3d8a82[_0x6e19('0x36')]]['mohstarttime'];}}}}catch(_0x13b685){logger[_0x6e19('0x2f')]('[%s][voiceCallReport][musiconholdstop]',_0x3d8a82['uniqueid'],util[_0x6e19('0x31')](_0x13b685,{'showHidden':![],'depth':null}));}};module[_0x6e19('0xc4')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 91a09e4..05994f0 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 _0xa842=['connect','info','[%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][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','[%s][voiceDialReport][hangup]\x20event:','endtime','duration','diff','seconds','total','answertime','answered','starttime','billableseconds','holdtime','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','redis','defaults','localhost','channels','outboundChannels','outbound','applications','bind','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','prototype','isNotNull','isUndefined','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','voice:outbound','voice_outbound_channel:save','emit','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent'];(function(_0x5e4e04,_0x4d24f1){var _0x365828=function(_0x1d9e50){while(--_0x1d9e50){_0x5e4e04['push'](_0x5e4e04['shift']());}};_0x365828(++_0x4d24f1);}(_0xa842,0x12b));var _0x2a84=function(_0x15cd21,_0x34769b){_0x15cd21=_0x15cd21-0x0;var _0x4e8aeb=_0xa842[_0x15cd21];return _0x4e8aeb;};'use strict';var _=require(_0x2a84('0x0'));var moment=require(_0x2a84('0x1'));var util=require(_0x2a84('0x2'));var Redis=require(_0x2a84('0x3'));var config=require('../../../config/environment');var logger=require(_0x2a84('0x4'))('ami');var ami=require('../ami');config[_0x2a84('0x5')]=_[_0x2a84('0x6')](config['redis'],{'host':_0x2a84('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x10c0fd){this[_0x2a84('0x8')]=_0x10c0fd[_0x2a84('0x9')];this[_0x2a84('0xa')]=_0x10c0fd[_0x2a84('0xa')];this[_0x2a84('0xb')]={};this['variables']={};ami['on']('dialbegin',this['syncDialBegin'][_0x2a84('0xc')](this));ami['on']('dialend',this[_0x2a84('0xd')]['bind'](this));ami['on'](_0x2a84('0xe'),this[_0x2a84('0xf')]['bind'](this));ami['on'](_0x2a84('0x10'),this[_0x2a84('0x11')][_0x2a84('0xc')](this));ami['on']('hangup',this['syncHangup'][_0x2a84('0xc')](this));}VoiceDialReport[_0x2a84('0x12')][_0x2a84('0x13')]=function(_0x5eca07){return _0x5eca07!==null&&!_[_0x2a84('0x14')](_0x5eca07);};VoiceDialReport[_0x2a84('0x12')]['emit']=function(_0x55ee5e,_0x348b16,_0x390f82){io['to'](_0x55ee5e)['emit'](_0x348b16,_0x390f82);};VoiceDialReport[_0x2a84('0x12')]['syncDialBegin']=function(_0x22ba26){try{if(this['isNotNull'](_0x22ba26)){logger[_0x2a84('0x15')](_0x2a84('0x16'),_0x22ba26[_0x2a84('0x17')],util[_0x2a84('0x18')](_0x22ba26,{'showHidden':![],'depth':null}));if(this[_0x2a84('0x8')][_0x22ba26[_0x2a84('0x17')]]){_['merge'](this[_0x2a84('0x8')][_0x22ba26[_0x2a84('0x17')]],{'starttime':moment()[_0x2a84('0x19')](_0x2a84('0x1a')),'lastevent':_0x2a84('0x1b'),'interface':_0x22ba26[_0x2a84('0x1c')][_0x2a84('0x1d')](0x0,_0x22ba26[_0x2a84('0x1c')][_0x2a84('0x1e')]('-')),'membername':_0x22ba26[_0x2a84('0x1c')]['substring'](_0x22ba26['channel'][_0x2a84('0x1e')]('/')+0x1,_0x22ba26[_0x2a84('0x1c')][_0x2a84('0x1e')]('-'))},_[_0x2a84('0x1f')](_0x22ba26,['event',_0x2a84('0x20')]));logger['info'](_0x2a84('0x21'),_0x22ba26[_0x2a84('0x17')],this[_0x2a84('0x8')][_0x22ba26[_0x2a84('0x17')]][_0x2a84('0x22')],this['channels'][_0x22ba26[_0x2a84('0x17')]]['interface']);logger['debug'](_0x2a84('0x23'),_0x22ba26['uniqueid'],util[_0x2a84('0x18')](this[_0x2a84('0x8')][_0x22ba26['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x2a84('0xb')][_0x22ba26[_0x2a84('0x17')]])_[_0x2a84('0x24')](this[_0x2a84('0x8')][_0x22ba26[_0x2a84('0x17')]],this[_0x2a84('0xb')][_0x22ba26[_0x2a84('0x17')]]);this['emit'](_0x2a84('0x25'),_0x2a84('0x26'),this['channels'][_0x22ba26[_0x2a84('0x17')]]);logger[_0x2a84('0x15')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x22ba26[_0x2a84('0x17')],util[_0x2a84('0x18')](this[_0x2a84('0x8')][_0x22ba26['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x2a84('0x27')](_0x2a84('0x28'),this[_0x2a84('0x8')][_0x22ba26[_0x2a84('0x17')]]);}}}catch(_0x5a206d){logger[_0x2a84('0x29')](_0x2a84('0x2a'),_0x22ba26[_0x2a84('0x17')],util['inspect'](_0x5a206d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2a84('0x12')]['syncDialEnd']=function(_0x319294){try{if(this['isNotNull'](_0x319294)){logger[_0x2a84('0x15')](_0x2a84('0x2b'),_0x319294[_0x2a84('0x17')],util[_0x2a84('0x18')](_0x319294,{'showHidden':![],'depth':null}));if(this[_0x2a84('0x8')][_0x319294[_0x2a84('0x17')]]){this[_0x2a84('0x8')][_0x319294[_0x2a84('0x17')]][_0x2a84('0x2c')]=_0x319294[_0x2a84('0x2c')];if(_0x319294[_0x2a84('0x2c')]===_0x2a84('0x2d')){this['channels'][_0x319294[_0x2a84('0x17')]][_0x2a84('0x2e')]=_0x319294[_0x2a84('0x2e')];this['channels'][_0x319294[_0x2a84('0x17')]][_0x2a84('0x2f')]=_0x319294[_0x2a84('0x2f')];this[_0x2a84('0x8')][_0x319294['uniqueid']]['answertime']=moment()['format'](_0x2a84('0x1a'));this['channels'][_0x319294[_0x2a84('0x17')]][_0x2a84('0x30')]=_0x2a84('0x31');logger[_0x2a84('0x32')](_0x2a84('0x33'),_0x319294[_0x2a84('0x17')],_0x319294['channel']['substring'](_0x319294[_0x2a84('0x1c')]['lastIndexOf']('/')+0x1,_0x319294[_0x2a84('0x1c')][_0x2a84('0x1e')]('-')));logger['debug'](_0x2a84('0x34'),_0x319294[_0x2a84('0x17')],util[_0x2a84('0x18')](this[_0x2a84('0x8')][_0x319294[_0x2a84('0x17')]],{'showHidden':![],'depth':null}));ami['emit'](_0x2a84('0x35'),this['channels'][_0x319294[_0x2a84('0x17')]]);}logger[_0x2a84('0x15')](_0x2a84('0x36'),_0x319294['uniqueid'],util[_0x2a84('0x18')](this['channels'][_0x319294['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x2a84('0x25'),_0x2a84('0x26'),this[_0x2a84('0x8')][_0x319294[_0x2a84('0x17')]]);}}}catch(_0x5b71d5){logger[_0x2a84('0x29')](_0x2a84('0x37'),_0x319294[_0x2a84('0x17')],util[_0x2a84('0x18')](_0x5b71d5,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x2a84('0xf')]=function(_0x29935a){try{if(this[_0x2a84('0x13')](_0x29935a)){logger[_0x2a84('0x15')](_0x2a84('0x38'),_0x29935a[_0x2a84('0x17')],util['inspect'](_0x29935a,{'showHidden':![],'depth':null}));this[_0x2a84('0x39')](_0x29935a[_0x2a84('0x17')],_[_0x2a84('0x3a')](_0x29935a['variable'])[0x0],_0x29935a[_0x2a84('0x3b')]);if(this['isNotNull'](_0x29935a[_0x2a84('0x3c')])&&this[_0x2a84('0x13')](_0x29935a[_0x2a84('0x3c')]['outboundrouteid'])){if(_[_0x2a84('0x14')](this[_0x2a84('0x8')][_0x29935a[_0x2a84('0x17')]])){this['channels'][_0x29935a[_0x2a84('0x17')]]={'routeId':_0x29935a['value'],'variables':this[_0x2a84('0x3d')][_0x29935a['uniqueid']],'motionChannel':_0x2a84('0x3e')};logger['info'](_0x2a84('0x3f'),_0x29935a[_0x2a84('0x17')],_0x29935a[_0x2a84('0x3c')][_0x2a84('0x40')],_[_0x2a84('0x3a')](_0x29935a[_0x2a84('0x3c')])[0x0],_0x29935a[_0x2a84('0x3b')]);logger[_0x2a84('0x15')](_0x2a84('0x41'),_0x29935a[_0x2a84('0x17')],util[_0x2a84('0x18')](this[_0x2a84('0x8')][_0x29935a[_0x2a84('0x17')]],{'showHidden':![],'depth':null}));this[_0x2a84('0x27')](_0x2a84('0x25'),'voice_outbound_channel:save',this['channels'][_0x29935a['uniqueid']]);}}}}catch(_0x4fecd8){logger[_0x2a84('0x29')](_0x2a84('0x42'),_0x29935a['uniqueid'],util[_0x2a84('0x18')](_0x4fecd8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2a84('0x12')]['addVariable']=function(_0x434648,_0x39e489,_0x31b587){var _0x344f95=[_0x2a84('0x43'),_0x2a84('0x44'),_0x2a84('0x45'),_0x2a84('0x46'),'rtpaudioqosloss',_0x2a84('0x47'),_0x2a84('0x48'),_0x2a84('0x49'),_0x2a84('0x4a'),_0x2a84('0x4b'),_0x2a84('0x4c'),'bridgepvtcallid',_0x2a84('0x4d'),_0x2a84('0x4e'),_0x2a84('0x4f'),_0x2a84('0x50'),_0x2a84('0x22'),_0x2a84('0x51'),'memberrealtime'];if(!_[_0x2a84('0x52')](_0x39e489)&&!_['includes'](_0x344f95,_0x39e489)){if(_[_0x2a84('0x14')](this['variables'][_0x434648])){this[_0x2a84('0x3d')][_0x434648]={};}this[_0x2a84('0x3d')][_0x434648][_0x39e489]=_0x31b587;}};VoiceDialReport[_0x2a84('0x12')]['syncHangup']=function(_0x39c5e5){try{if(this[_0x2a84('0x13')](_0x39c5e5)){logger[_0x2a84('0x15')](_0x2a84('0x53'),_0x39c5e5[_0x2a84('0x17')],util['inspect'](_0x39c5e5,{'showHidden':![],'depth':null}));if(this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]]){logger[_0x2a84('0x32')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x39c5e5[_0x2a84('0x17')],_0x39c5e5['cause-txt']);this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x54')]=moment()['format'](_0x2a84('0x1a'));this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x55')]=moment(this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x54')])[_0x2a84('0x56')](this[_0x2a84('0x8')][_0x39c5e5['uniqueid']]['starttime'],_0x2a84('0x57'));this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x30')]='complete';this[_0x2a84('0xa')][_0x2a84('0x58')]+=0x1;if(this['channels'][_0x39c5e5['uniqueid']][_0x2a84('0x59')]){this[_0x2a84('0xa')][_0x2a84('0x5a')]+=0x1;this[_0x2a84('0x8')][_0x39c5e5['uniqueid']]['holdtime']=moment(this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x59')])[_0x2a84('0x56')](this['channels'][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x5b')],'seconds');this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x5c')]=moment(this['channels'][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x54')])[_0x2a84('0x56')](this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x59')],'seconds');this[_0x2a84('0xa')]['sumHoldTime']+=this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x5d')]||0x0;this[_0x2a84('0xa')]['sumBillable']+=this[_0x2a84('0x8')][_0x39c5e5['uniqueid']][_0x2a84('0x5c')];}this[_0x2a84('0xa')][_0x2a84('0x5e')]+=this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]][_0x2a84('0x55')];logger[_0x2a84('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x39c5e5['uniqueid'],util[_0x2a84('0x18')](this[_0x2a84('0x8')][_0x39c5e5['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x2a84('0x27')](_0x2a84('0x5f'),this['channels'][_0x39c5e5['uniqueid']]);logger[_0x2a84('0x15')](_0x2a84('0x60'),_0x39c5e5['uniqueid'],util[_0x2a84('0x18')](this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]],{'showHidden':![],'depth':null}));ami[_0x2a84('0x27')](_0x2a84('0x61'),this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]]);logger[_0x2a84('0x15')](_0x2a84('0x62'),_0x39c5e5[_0x2a84('0x17')],util[_0x2a84('0x18')](this['channels'][_0x39c5e5['uniqueid']],{'showHidden':![],'depth':null}));this[_0x2a84('0x27')]('voice:outbound',_0x2a84('0x63'),this[_0x2a84('0xa')]);logger[_0x2a84('0x32')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this['channels'][_0x39c5e5[_0x2a84('0x17')]]));logger[_0x2a84('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x39c5e5[_0x2a84('0x17')],util['inspect'](this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x17')]],{'showHidden':![],'depth':null}));this[_0x2a84('0x27')](_0x2a84('0x25'),_0x2a84('0x64'),this['channels'][_0x39c5e5[_0x2a84('0x17')]]);delete this[_0x2a84('0x8')][_0x39c5e5['uniqueid']];}else if(this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x65')]]){this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x65')]][_0x2a84('0x17')]=this[_0x2a84('0x8')][_0x39c5e5[_0x2a84('0x65')]][_0x2a84('0x66')];}if(this[_0x2a84('0x3d')][_0x39c5e5[_0x2a84('0x17')]]){delete this[_0x2a84('0x3d')][_0x39c5e5[_0x2a84('0x17')]];}}}catch(_0x2650d7){logger[_0x2a84('0x29')](_0x2a84('0x67'),_0x39c5e5[_0x2a84('0x17')],util[_0x2a84('0x18')](_0x2650d7,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x2a84('0x11')]=function(_0x275762){try{if(this[_0x2a84('0x13')](_0x275762)){logger[_0x2a84('0x15')](_0x2a84('0x68'),_0x275762[_0x2a84('0x17')],util[_0x2a84('0x18')](_0x275762,{'showHidden':![],'depth':null}));if(_0x275762[_0x2a84('0x69')][_0x2a84('0x6a')]()===_0x2a84('0x6b')){_0x275762[_0x2a84('0x6c')]=(_0x275762[_0x2a84('0x6d')]||_0x275762[_0x2a84('0x6c')])['toLowerCase']();if(_[_0x2a84('0x6e')](_0x275762['applicationdata'],'cdr(')){if(_[_0x2a84('0x14')](this['applications'][_0x275762[_0x2a84('0x17')]]))this[_0x2a84('0xb')][_0x275762[_0x2a84('0x17')]]={};logger[_0x2a84('0x32')](_0x2a84('0x6f'),_0x275762['uniqueid'],_0x275762['application'],_0x275762[_0x2a84('0x6c')]);var _0x1a6824=_0x275762[_0x2a84('0x6c')][_0x2a84('0x70')]('=');var _0x8c8421=_0x1a6824[0x0][_0x2a84('0x71')](/cdr\((.*)\)/);if(_0x8c8421)this[_0x2a84('0xb')][_0x275762[_0x2a84('0x17')]][_0x8c8421[0x1]]=_0x1a6824[0x1];}}}}catch(_0x2e56fb){logger[_0x2a84('0x29')](_0x2a84('0x72'),_0x275762['uniqueid'],util['inspect'](_0x2e56fb,{'showHidden':![],'depth':null}));}};module[_0x2a84('0x73')]=VoiceDialReport; \ No newline at end of file +var _0xb25b=['[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','lastevent','answered','holdtime','billableseconds','sumHoldTime','duration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','linkedid','[%s][voiceDialReport][hangup]','application','set','applicationdata','appdata','toLowerCase','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/logger','../ami','redis','defaults','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','newexten','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','applications','merge','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','info','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','value','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil'];(function(_0x379b7c,_0xd6e0f0){var _0x3bd974=function(_0xb2dcc7){while(--_0xb2dcc7){_0x379b7c['push'](_0x379b7c['shift']());}};_0x3bd974(++_0xd6e0f0);}(_0xb25b,0x16e));var _0xbb25=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb25b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xbb25('0x0'));var moment=require(_0xbb25('0x1'));var util=require('util');var Redis=require(_0xbb25('0x2'));var config=require('../../../config/environment');var logger=require(_0xbb25('0x3'))('ami');var ami=require(_0xbb25('0x4'));config[_0xbb25('0x5')]=_[_0xbb25('0x6')](config[_0xbb25('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0xe07578){this[_0xbb25('0x7')]=_0xe07578[_0xbb25('0x8')];this[_0xbb25('0x9')]=_0xe07578[_0xbb25('0x9')];this['applications']={};this[_0xbb25('0xa')]={};ami['on'](_0xbb25('0xb'),this[_0xbb25('0xc')][_0xbb25('0xd')](this));ami['on'](_0xbb25('0xe'),this[_0xbb25('0xf')][_0xbb25('0xd')](this));ami['on'](_0xbb25('0x10'),this['syncVarSet'][_0xbb25('0xd')](this));ami['on'](_0xbb25('0x11'),this[_0xbb25('0x12')][_0xbb25('0xd')](this));ami['on'](_0xbb25('0x13'),this[_0xbb25('0x14')][_0xbb25('0xd')](this));}VoiceDialReport[_0xbb25('0x15')][_0xbb25('0x16')]=function(_0x4341a8){return _0x4341a8!==null&&!_[_0xbb25('0x17')](_0x4341a8);};VoiceDialReport[_0xbb25('0x15')]['emit']=function(_0x865c38,_0x20af5c,_0x3ceb28){io['to'](_0x865c38)[_0xbb25('0x18')](_0x20af5c,_0x3ceb28);};VoiceDialReport[_0xbb25('0x15')]['syncDialBegin']=function(_0x2b8cf6){try{if(this[_0xbb25('0x16')](_0x2b8cf6)){logger[_0xbb25('0x19')](_0xbb25('0x1a'),_0x2b8cf6[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x2b8cf6,{'showHidden':![],'depth':null}));if(this[_0xbb25('0x7')][_0x2b8cf6[_0xbb25('0x1b')]]){_['merge'](this[_0xbb25('0x7')][_0x2b8cf6[_0xbb25('0x1b')]],{'starttime':moment()[_0xbb25('0x1d')](_0xbb25('0x1e')),'lastevent':'called','interface':_0x2b8cf6[_0xbb25('0x1f')][_0xbb25('0x20')](0x0,_0x2b8cf6[_0xbb25('0x1f')][_0xbb25('0x21')]('-')),'membername':_0x2b8cf6[_0xbb25('0x1f')][_0xbb25('0x20')](_0x2b8cf6[_0xbb25('0x1f')][_0xbb25('0x21')]('/')+0x1,_0x2b8cf6[_0xbb25('0x1f')][_0xbb25('0x21')]('-'))},_[_0xbb25('0x22')](_0x2b8cf6,['event','privilege']));logger['info'](_0xbb25('0x23'),_0x2b8cf6[_0xbb25('0x1b')],this[_0xbb25('0x7')][_0x2b8cf6[_0xbb25('0x1b')]]['membername'],this[_0xbb25('0x7')][_0x2b8cf6['uniqueid']][_0xbb25('0x24')]);logger[_0xbb25('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2b8cf6['uniqueid'],util['inspect'](this[_0xbb25('0x7')][_0x2b8cf6[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0xbb25('0x25')][_0x2b8cf6[_0xbb25('0x1b')]])_[_0xbb25('0x26')](this[_0xbb25('0x7')][_0x2b8cf6[_0xbb25('0x1b')]],this[_0xbb25('0x25')][_0x2b8cf6[_0xbb25('0x1b')]]);this['emit'](_0xbb25('0x27'),_0xbb25('0x28'),this[_0xbb25('0x7')][_0x2b8cf6[_0xbb25('0x1b')]]);logger['debug'](_0xbb25('0x29'),_0x2b8cf6[_0xbb25('0x1b')],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x2b8cf6['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xbb25('0x18')](_0xbb25('0x2a'),this[_0xbb25('0x7')][_0x2b8cf6['uniqueid']]);}}}catch(_0x18567b){logger[_0xbb25('0x2b')]('[%s][voiceDialReport][dialbegin]',_0x2b8cf6[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x18567b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbb25('0x15')][_0xbb25('0xf')]=function(_0x4d5d78){try{if(this[_0xbb25('0x16')](_0x4d5d78)){logger[_0xbb25('0x19')](_0xbb25('0x2c'),_0x4d5d78[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x4d5d78,{'showHidden':![],'depth':null}));if(this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]]){this[_0xbb25('0x7')][_0x4d5d78['uniqueid']]['dialstatus']=_0x4d5d78[_0xbb25('0x2d')];if(_0x4d5d78['dialstatus']===_0xbb25('0x2e')){this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]][_0xbb25('0x2f')]=_0x4d5d78[_0xbb25('0x2f')];this[_0xbb25('0x7')][_0x4d5d78['uniqueid']][_0xbb25('0x30')]=_0x4d5d78['connectedlinename'];this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]][_0xbb25('0x31')]=moment()['format'](_0xbb25('0x1e'));this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]]['lastevent']=_0xbb25('0x32');logger[_0xbb25('0x33')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x4d5d78['uniqueid'],_0x4d5d78[_0xbb25('0x1f')][_0xbb25('0x20')](_0x4d5d78[_0xbb25('0x1f')][_0xbb25('0x21')]('/')+0x1,_0x4d5d78[_0xbb25('0x1f')][_0xbb25('0x21')]('-')));logger[_0xbb25('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x4d5d78[_0xbb25('0x1b')],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xbb25('0x34'),this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]]);}logger[_0xbb25('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x4d5d78['uniqueid'],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x4d5d78[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xbb25('0x28'),this['channels'][_0x4d5d78['uniqueid']]);}}}catch(_0x49fa0f){logger[_0xbb25('0x2b')](_0xbb25('0x35'),_0x4d5d78[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x49fa0f,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x14c646){try{if(this['isNotNull'](_0x14c646)){logger[_0xbb25('0x19')](_0xbb25('0x36'),_0x14c646[_0xbb25('0x1b')],util['inspect'](_0x14c646,{'showHidden':![],'depth':null}));this['addVariable'](_0x14c646[_0xbb25('0x1b')],_[_0xbb25('0x37')](_0x14c646[_0xbb25('0x38')])[0x0],_0x14c646['value']);if(this['isNotNull'](_0x14c646['variable'])&&this[_0xbb25('0x16')](_0x14c646[_0xbb25('0x38')][_0xbb25('0x39')])){if(_[_0xbb25('0x17')](this['channels'][_0x14c646[_0xbb25('0x1b')]])){this[_0xbb25('0x7')][_0x14c646['uniqueid']]={'routeId':_0x14c646[_0xbb25('0x3a')],'variables':this[_0xbb25('0xa')][_0x14c646[_0xbb25('0x1b')]],'motionChannel':_0xbb25('0x3b')};logger[_0xbb25('0x33')](_0xbb25('0x3c'),_0x14c646['uniqueid'],_0x14c646['variable'][_0xbb25('0x39')],_[_0xbb25('0x37')](_0x14c646[_0xbb25('0x38')])[0x0],_0x14c646[_0xbb25('0x3a')]);logger['debug'](_0xbb25('0x3d'),_0x14c646[_0xbb25('0x1b')],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x14c646[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0xbb25('0x27'),_0xbb25('0x28'),this['channels'][_0x14c646[_0xbb25('0x1b')]]);}}}}catch(_0x2d2f41){logger[_0xbb25('0x2b')](_0xbb25('0x3e'),_0x14c646[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x2d2f41,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xbb25('0x3f')]=function(_0x4de9d7,_0x369608,_0xdef5ff){var _0x3b93ed=[_0xbb25('0x40'),_0xbb25('0x41'),_0xbb25('0x42'),_0xbb25('0x43'),_0xbb25('0x44'),_0xbb25('0x45'),'rtpaudioqosrtt',_0xbb25('0x46'),_0xbb25('0x47'),_0xbb25('0x48'),_0xbb25('0x49'),_0xbb25('0x4a'),_0xbb25('0x4b'),'memberdynamic',_0xbb25('0x4c'),_0xbb25('0x4d'),_0xbb25('0x4e'),_0xbb25('0x4f'),_0xbb25('0x50')];if(!_[_0xbb25('0x51')](_0x369608)&&!_['includes'](_0x3b93ed,_0x369608)){if(_[_0xbb25('0x17')](this[_0xbb25('0xa')][_0x4de9d7])){this[_0xbb25('0xa')][_0x4de9d7]={};}this[_0xbb25('0xa')][_0x4de9d7][_0x369608]=_0xdef5ff;}};VoiceDialReport[_0xbb25('0x15')]['syncHangup']=function(_0x44b1ef){try{if(this[_0xbb25('0x16')](_0x44b1ef)){logger[_0xbb25('0x19')](_0xbb25('0x52'),_0x44b1ef[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x44b1ef,{'showHidden':![],'depth':null}));if(this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]){logger['info'](_0xbb25('0x53'),_0x44b1ef[_0xbb25('0x1b')],_0x44b1ef[_0xbb25('0x54')]);this[_0xbb25('0x7')][_0x44b1ef['uniqueid']][_0xbb25('0x55')]=moment()['format'](_0xbb25('0x1e'));this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]['duration']=moment(this['channels'][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x55')])[_0xbb25('0x56')](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x57')],_0xbb25('0x58'));this[_0xbb25('0x7')][_0x44b1ef['uniqueid']][_0xbb25('0x59')]='complete';this[_0xbb25('0x9')]['total']+=0x1;if(this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]['answertime']){this[_0xbb25('0x9')][_0xbb25('0x5a')]+=0x1;this['channels'][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x5b')]=moment(this['channels'][_0x44b1ef['uniqueid']][_0xbb25('0x31')])['diff'](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x57')],'seconds');this['channels'][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x5c')]=moment(this[_0xbb25('0x7')][_0x44b1ef['uniqueid']]['endtime'])[_0xbb25('0x56')](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]['answertime'],'seconds');this[_0xbb25('0x9')][_0xbb25('0x5d')]+=this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x5b')]||0x0;this['outbound']['sumBillable']+=this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x5c')];}this[_0xbb25('0x9')]['sumDuration']+=this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]][_0xbb25('0x5e')];logger[_0xbb25('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x44b1ef['uniqueid'],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xbb25('0x18')](_0xbb25('0x5f'),this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]);logger['debug'](_0xbb25('0x60'),_0x44b1ef[_0xbb25('0x1b')],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xbb25('0x18')]('custom:dialend',this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]);logger[_0xbb25('0x19')](_0xbb25('0x61'),_0x44b1ef['uniqueid'],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]],{'showHidden':![],'depth':null}));this[_0xbb25('0x18')](_0xbb25('0x27'),_0xbb25('0x62'),this['outbound']);logger['info'](_0xbb25('0x63'),JSON['stringify'](this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]));logger['debug'](_0xbb25('0x64'),_0x44b1ef[_0xbb25('0x1b')],util[_0xbb25('0x1c')](this[_0xbb25('0x7')][_0x44b1ef['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:remove',this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x1b')]]);delete this['channels'][_0x44b1ef['uniqueid']];}else if(this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x65')]]){this[_0xbb25('0x7')][_0x44b1ef[_0xbb25('0x65')]][_0xbb25('0x1b')]=this['channels'][_0x44b1ef['linkedid']]['destuniqueid'];}if(this['variables'][_0x44b1ef['uniqueid']]){delete this[_0xbb25('0xa')][_0x44b1ef['uniqueid']];}}}catch(_0x409da0){logger[_0xbb25('0x2b')](_0xbb25('0x66'),_0x44b1ef[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x409da0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xbb25('0x15')][_0xbb25('0x12')]=function(_0x44e083){try{if(this[_0xbb25('0x16')](_0x44e083)){logger['debug']('[%s][voiceDialReport][newexten]\x20event:',_0x44e083[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x44e083,{'showHidden':![],'depth':null}));if(_0x44e083[_0xbb25('0x67')]['toLowerCase']()===_0xbb25('0x68')){_0x44e083[_0xbb25('0x69')]=(_0x44e083[_0xbb25('0x6a')]||_0x44e083[_0xbb25('0x69')])[_0xbb25('0x6b')]();if(_['startsWith'](_0x44e083[_0xbb25('0x69')],'cdr(')){if(_[_0xbb25('0x17')](this[_0xbb25('0x25')][_0x44e083['uniqueid']]))this[_0xbb25('0x25')][_0x44e083[_0xbb25('0x1b')]]={};logger[_0xbb25('0x33')](_0xbb25('0x6c'),_0x44e083['uniqueid'],_0x44e083['application'],_0x44e083[_0xbb25('0x69')]);var _0x1f7cc0=_0x44e083[_0xbb25('0x69')]['split']('=');var _0x3d24fc=_0x1f7cc0[0x0][_0xbb25('0x6d')](/cdr\((.*)\)/);if(_0x3d24fc)this[_0xbb25('0x25')][_0x44e083['uniqueid']][_0x3d24fc[0x1]]=_0x1f7cc0[0x1];}}}}catch(_0x1c86ea){logger['error'](_0xbb25('0x6e'),_0x44e083[_0xbb25('0x1b')],util[_0xbb25('0x1c')](_0x1c86ea,{'showHidden':![],'depth':null}));}};module[_0xbb25('0x6f')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 82ea08e..71229f3 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 _0x1da6=['then','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','info','pick','keys','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','channel','toLowerCase','local/','linkedid','seconds','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','unmanaged','milliseconds','diff','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','isNil','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','set','appdata','startsWith','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','waiting','unlockRR','clearZombieChannels','switch','Action','status','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','Trunk','active','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','queuesummary'];(function(_0x3c0964,_0x48416f){var _0x44bb35=function(_0x63884c){while(--_0x63884c){_0x3c0964['push'](_0x3c0964['shift']());}};_0x44bb35(++_0x48416f);}(_0x1da6,0x7c));var _0x61da=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0x1da6[_0x189305];return _0xea3406;};'use strict';var _=require(_0x61da('0x0'));var moment=require(_0x61da('0x1'));var util=require(_0x61da('0x2'));var md5=require(_0x61da('0x3'));var Redis=require(_0x61da('0x4'));var config=require(_0x61da('0x5'));var logger=require(_0x61da('0x6'))(_0x61da('0x7'));var ami=require(_0x61da('0x8'));var QueueReport=require(_0x61da('0x9'));config[_0x61da('0xa')]=_[_0x61da('0xb')](config[_0x61da('0xa')],{'host':_0x61da('0xc'),'port':0x18eb});var io=require(_0x61da('0xd'))(new Redis(config[_0x61da('0xa')]));var Sequence=function(){};Sequence[_0x61da('0xe')][_0x61da('0xf')]=function(_0x1a63b2){this[_0x61da('0x10')]=this['tail']?this[_0x61da('0x10')][_0x61da('0x11')](_0x1a63b2):_0x1a63b2();};function VoiceQueueReport(_0x438239){this[_0x61da('0x12')]=new Sequence();this[_0x61da('0x13')]={};this[_0x61da('0x14')]=_0x438239[_0x61da('0x14')];this[_0x61da('0x15')]=_0x438239[_0x61da('0x16')];this[_0x61da('0x17')]=_0x438239[_0x61da('0x17')];this[_0x61da('0x18')]=!![];this[_0x61da('0x19')]=_0x438239[_0x61da('0x19')];this[_0x61da('0x1a')]={};ami['on']('queuesummary',this[_0x61da('0x1b')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x1d'),this[_0x61da('0x1e')]['bind'](this));ami['on'](_0x61da('0x1f'),this['syncQueueCallerJoin'][_0x61da('0x1c')](this));ami['on'](_0x61da('0x20'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x61da('0x21'),this[_0x61da('0x22')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x23'),this[_0x61da('0x24')][_0x61da('0x1c')](this));ami['on']('agentconnect',this[_0x61da('0x25')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x26'),this[_0x61da('0x27')]['bind'](this));ami['on'](_0x61da('0x28'),this[_0x61da('0x29')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x2a'),this['syncFullyBooted'][_0x61da('0x1c')](this));ami['on']('newexten',this[_0x61da('0x2b')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x2c'),this[_0x61da('0x2d')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x2e'),this[_0x61da('0x2f')][_0x61da('0x1c')](this));ami['on'](_0x61da('0x30'),this[_0x61da('0x31')]['bind'](this));ami['on'](_0x61da('0x32'),this[_0x61da('0x33')][_0x61da('0x1c')](this));this[_0x61da('0x34')]();this[_0x61da('0x35')]();}function clearChannels(_0x371748){if(!_['isEmpty'](_0x371748)){for(var _0x2c5d97 in _0x371748){if(_0x371748[_0x61da('0x36')](_0x2c5d97)){delete _0x371748[_0x2c5d97];}}}}function clearCampaigns(_0x229326){if(!_[_0x61da('0x37')](_0x229326)){for(var _0x351241 in _0x229326){if(_0x229326[_0x61da('0x36')](_0x351241)){_0x229326[_0x351241][_0x61da('0x38')]=0x0;}}}}function clearVoiceQueues(_0x29b642){if(!_['isEmpty'](_0x29b642)){for(var _0x2746a6 in _0x29b642){if(_0x29b642[_0x61da('0x36')](_0x2746a6)){_0x29b642[_0x2746a6][_0x61da('0x38')]=0x0;_0x29b642[_0x2746a6][_0x61da('0x39')]=0x0;_0x29b642[_0x2746a6]['pTalking']=0x0;_0x29b642[_0x2746a6][_0x61da('0x3a')]=0x0;_0x29b642[_0x2746a6]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x2c9a1d){if(!_[_0x61da('0x37')](_0x2c9a1d)){for(var _0x3a31a2 in _0x2c9a1d){if(_0x2c9a1d[_0x61da('0x36')](_0x3a31a2)){_0x2c9a1d[_0x3a31a2][_0x61da('0x3b')]=!![];}}}}VoiceQueueReport[_0x61da('0xe')][_0x61da('0x3c')]=function(){var _0x52d93d=this;for(var _0x46b77b in this['channels']){if(this['channels'][_0x61da('0x36')](_0x46b77b)&&!this[_0x61da('0x15')][_0x46b77b][_0x61da('0x3d')]){this[_0x61da('0x12')][_0x61da('0xf')](function(){if(!_['isNil'](_0x52d93d[_0x61da('0x15')][_0x46b77b])){return ami[_0x61da('0x3e')]({'action':_0x61da('0x3f'),'channel':_0x52d93d[_0x61da('0x15')][_0x46b77b]['channel']})[_0x61da('0x40')](function(_0xb09cf5){if(_0xb09cf5['message']===_0x61da('0x41')){setTimeout(function(){if(_0x52d93d['channels'][_0x46b77b]){delete _0x52d93d['channels'][_0x46b77b];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x46b77b,util['inspect'](_0xb09cf5,{'showHidden':![],'depth':null}));}if(_0x52d93d[_0x61da('0x13')][_0x46b77b]){delete _0x52d93d[_0x61da('0x13')][_0x46b77b];logger[_0x61da('0x42')](_0x61da('0x43'),_0x46b77b,util[_0x61da('0x44')](_0xb09cf5,{'showHidden':![],'depth':null}));}if(_0x52d93d['variables'][_0x46b77b]){delete _0x52d93d[_0x61da('0x1a')][_0x46b77b];logger[_0x61da('0x42')](_0x61da('0x45'),_0x46b77b,util['inspect'](_0xb09cf5,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x46')]=function(){logger[_0x61da('0x42')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x61da('0x15')]);this[_0x61da('0x47')](this[_0x61da('0x13')]);clearAgentBooked(this[_0x61da('0x14')]);clearVoiceQueues(this[_0x61da('0x17')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x47')]=function(_0x136ed5){var _0x7ca2ff=this;if(!_[_0x61da('0x37')](_0x136ed5)){for(var _0x5170bd in _0x136ed5){if(_0x136ed5['hasOwnProperty'](_0x5170bd)){_0x7ca2ff['emitVoiceQueueChannelRemove'](_0x136ed5[_0x5170bd],_0x61da('0x48'));delete _0x136ed5[_0x5170bd];}}}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x49')]=function(_0x2e57df,_0xb0edad,_0x157e62){io['to'](_0x2e57df)[_0x61da('0x49')](_0xb0edad,_0x157e62);};VoiceQueueReport['prototype'][_0x61da('0x4a')]=function(_0x669497,_0x5d4d5e){logger[_0x61da('0x4b')](_0x61da('0x4c')+_0x5d4d5e+_0x61da('0x4d'),_0x669497['uniqueid'],util[_0x61da('0x44')](_0x669497,{'showHidden':![],'depth':null}));this['emit'](util[_0x61da('0x4e')](_0x61da('0x4f'),_0x669497[_0x61da('0x50')]),_0x61da('0x51'),_0x669497);io['emit'](_0x61da('0x52'),_0x669497);};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x53')]=function(_0x47e1a5,_0x18e2da){logger[_0x61da('0x4b')](_0x61da('0x4c')+_0x18e2da+_0x61da('0x54'),_0x47e1a5[_0x61da('0x55')],util[_0x61da('0x44')](_0x47e1a5,{'showHidden':![],'depth':null}));this['emit'](util[_0x61da('0x4e')](_0x61da('0x4f'),_0x47e1a5[_0x61da('0x50')]),_0x61da('0x56'),_0x47e1a5);io[_0x61da('0x49')](_0x61da('0x57'),_0x47e1a5);};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x58')]=function(_0x5b0db3,_0x5f5c54){if(_0x5b0db3[_0x61da('0x59')]===_0x61da('0x5a')){var _0x3849b9={'id':_0x5b0db3['id'],'name':_0x5b0db3[_0x61da('0x50')],'strategy':_0x5b0db3[_0x61da('0x5b')],'answered':_0x5b0db3['answered'],'available':_0x5b0db3[_0x61da('0x5c')],'loggedIn':_0x5b0db3[_0x61da('0x5d')],'pTalking':_0x5b0db3[_0x61da('0x5e')],'sumBillable':_0x5b0db3[_0x61da('0x5f')],'sumDuration':_0x5b0db3[_0x61da('0x60')],'sumHoldTime':_0x5b0db3[_0x61da('0x61')]||0x0,'talking':_0x5b0db3[_0x61da('0x39')],'total':_0x5b0db3[_0x61da('0x62')],'type':_0x5b0db3[_0x61da('0x59')],'unmanaged':_0x5b0db3['unmanaged'],'abandoned':_0x5b0db3[_0x61da('0x63')],'waiting':_0x5b0db3[_0x61da('0x3a')]};if(_0x5b0db3[_0x61da('0x64')]){_0x3849b9[_0x61da('0x64')]={'id':_0x5b0db3['Trunk']['id'],'name':_0x5b0db3[_0x61da('0x64')][_0x61da('0x50')],'active':_0x5b0db3[_0x61da('0x64')][_0x61da('0x65')],'callerid':_0x5b0db3[_0x61da('0x64')]['callerid']};}if(_0x5b0db3[_0x61da('0x66')]){_0x3849b9[_0x61da('0x66')]={'id':_0x5b0db3[_0x61da('0x66')]['id'],'name':_0x5b0db3[_0x61da('0x66')][_0x61da('0x50')]};}var _0x563f55=md5(JSON[_0x61da('0x67')](_0x3849b9));if(_0x5b0db3[_0x61da('0x3')]!==_0x563f55){_0x5b0db3[_0x61da('0x3')]=_0x563f55;logger['debug'](_0x61da('0x68')+_0x5f5c54+_0x61da('0x69'),util[_0x61da('0x44')](_0x3849b9,{'showHidden':![],'depth':null}));this[_0x61da('0x49')](util['format'](_0x61da('0x4f'),_0x3849b9['name']),_0x61da('0x6a'),_0x3849b9);}}};VoiceQueueReport['prototype'][_0x61da('0x6b')]=function(_0x45e1fc){return _0x45e1fc!==null&&!_[_0x61da('0x6c')](_0x45e1fc);};VoiceQueueReport[_0x61da('0xe')]['loopQueueShow']=function(){var _0xc5c8a6=this;setInterval(function(){_0xc5c8a6[_0x61da('0x3c')]();ami[_0x61da('0x3e')]({'action':_0x61da('0x6d')})[_0x61da('0x40')](function(_0x3b52bd){logger[_0x61da('0x42')]('[voiceQueueReport][queues]',util['inspect'](_0x3b52bd,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x61da('0x34')]=function(){var _0x23954f=this;setInterval(function(){if(_0x23954f[_0x61da('0x18')]){return ami['Action']({'action':_0x61da('0x6e')})[_0x61da('0x6f')](function(_0x2bacdb){_0x23954f[_0x61da('0x18')]=![];})[_0x61da('0x40')](function(_0xcb02b7){logger[_0x61da('0x42')]('[voiceQueueReport][queuesummary]',util['inspect'](_0xcb02b7,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x1b')]=function(_0x10e125){try{if(this[_0x61da('0x6b')](_0x10e125)&&this[_0x61da('0x6b')](_0x10e125[_0x61da('0x70')])){logger[_0x61da('0x4b')](_0x61da('0x71'),util[_0x61da('0x44')](_0x10e125,{'showHidden':![],'depth':null}));if(this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]]){logger['info'](_0x61da('0x72'),_0x10e125[_0x61da('0x70')]);var _0x4d8946=_[_0x61da('0x73')](this[_0x61da('0x15')],_0x61da('0x70'))[_0x10e125['queue']]||0x0;var _0x24c8cd=_0x4d8946-_0x10e125[_0x61da('0x74')];if(this['voiceQueues'][_0x10e125[_0x61da('0x70')]][_0x61da('0x3a')]!==_[_0x61da('0x75')](_0x10e125[_0x61da('0x74')])||this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]][_0x61da('0x5d')]!==_[_0x61da('0x75')](_0x10e125[_0x61da('0x76')])||this['voiceQueues'][_0x10e125['queue']][_0x61da('0x5c')]!==_['toNumber'](_0x10e125[_0x61da('0x5c')])||this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]]['talking']!==_0x24c8cd){this['voiceQueues'][_0x10e125[_0x61da('0x70')]][_0x61da('0x3a')]=_['toNumber'](_0x10e125[_0x61da('0x74')]);this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]][_0x61da('0x5d')]=_[_0x61da('0x75')](_0x10e125[_0x61da('0x76')]);this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]][_0x61da('0x5c')]=_[_0x61da('0x75')](_0x10e125[_0x61da('0x5c')]);this['voiceQueues'][_0x10e125[_0x61da('0x70')]]['talking']=_0x24c8cd>0x0?_0x24c8cd:0x0;this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]][_0x61da('0x39')]=this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]][_0x61da('0x39')]>_[_0x61da('0x75')](_0x10e125[_0x61da('0x76')])?_[_0x61da('0x75')](_0x10e125[_0x61da('0x76')]):this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]][_0x61da('0x39')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x10e125[_0x61da('0x70')]],_0x61da('0x6e'));}logger[_0x61da('0x4b')](_0x61da('0x77'),util[_0x61da('0x44')](this[_0x61da('0x17')][_0x10e125['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x61da('0x78'),this[_0x61da('0x17')][_0x10e125[_0x61da('0x70')]]);}}}catch(_0x29f4e8){logger['error'](_0x61da('0x79'),util['inspect'](_0x29f4e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')]['syncQueueSummaryComplete']=function(_0x54b9b9){logger[_0x61da('0x4b')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x61da('0x44')](_0x54b9b9,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x61da('0xe')]['syncQueueCallerJoin']=function(_0x54932c){try{if(this['isNotNull'](_0x54932c)){logger[_0x61da('0x4b')](_0x61da('0x7a'),_0x54932c['uniqueid'],util[_0x61da('0x44')](_0x54932c,{'showHidden':![],'depth':null}));if(_[_0x61da('0x6c')](this[_0x61da('0x13')][_0x54932c[_0x61da('0x55')]]))this['queueReports'][_0x54932c[_0x61da('0x55')]]=[];if(_[_0x61da('0x6c')](this[_0x61da('0x15')][_0x54932c['uniqueid']]))this[_0x61da('0x15')][_0x54932c[_0x61da('0x55')]]={};var _0x572834=new QueueReport();_0x572834[_0x61da('0x50')]=_0x54932c[_0x61da('0x70')];_0x572834['type']=this[_0x61da('0x17')][_0x572834[_0x61da('0x50')]]&&this['voiceQueues'][_0x572834[_0x61da('0x50')]][_0x61da('0x59')]?this[_0x61da('0x17')][_0x572834[_0x61da('0x50')]]['type']||_0x61da('0x5a'):_0x61da('0x5a');_0x572834['queue']=_0x54932c[_0x61da('0x70')];_0x572834[_0x61da('0x7b')]=moment()[_0x61da('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x572834[_0x61da('0x7c')]=_0x54932c['position'];_0x572834[_0x61da('0x7d')]=_0x54932c[_0x61da('0x7d')];_0x572834[_0x61da('0x55')]=_0x54932c['uniqueid'];_0x572834[_0x61da('0x7e')]=this[_0x61da('0x15')][_0x54932c[_0x61da('0x55')]][_0x61da('0x7e')];logger[_0x61da('0x7f')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x572834[_0x61da('0x50')],_0x572834['type']);_['merge'](_0x572834,_[_0x61da('0x80')](_0x54932c,_[_0x61da('0x81')](_0x572834)));this[_0x61da('0x13')][_0x54932c['uniqueid']]['push'](_0x572834);this[_0x61da('0x15')][_0x54932c[_0x61da('0x55')]]=_0x572834;this[_0x61da('0x4a')](_0x572834,'queuecallerjoin');}}catch(_0x372b0a){logger[_0x61da('0x42')](_0x61da('0x7a'),_0x54932c['uniqueid'],util[_0x61da('0x44')](_0x372b0a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x82')]=function(_0x1e00d2){try{if(this[_0x61da('0x6b')](_0x1e00d2)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x1e00d2[_0x61da('0x55')],util[_0x61da('0x44')](_0x1e00d2,{'showHidden':![],'depth':null}));if(this[_0x61da('0x13')][_0x1e00d2[_0x61da('0x55')]]){var _0xef593b=_[_0x61da('0x83')](this[_0x61da('0x13')][_0x1e00d2[_0x61da('0x55')]]);_0xef593b[_0x61da('0x84')]=![];_0xef593b[_0x61da('0x85')]=null;_0xef593b[_0x61da('0x86')]=_0x1e00d2[_0x61da('0x86')];_0xef593b[_0x61da('0x87')]=_0x1e00d2[_0x61da('0x87')];_0xef593b[_0x61da('0x20')]=!![];_0xef593b[_0x61da('0x88')]=moment()[_0x61da('0x4e')](_0x61da('0x89'));_0xef593b[_0x61da('0x8a')]='ABANDONED';_0xef593b[_0x61da('0x8b')]=null;logger[_0x61da('0x7f')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0xef593b[_0x61da('0x50')],_0xef593b[_0x61da('0x59')]);this['channels'][_0x1e00d2[_0x61da('0x55')]]=_0xef593b;this[_0x61da('0x53')](_0xef593b,_0x61da('0x20'));}}}catch(_0xd0a6d3){logger[_0x61da('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1e00d2['uniqueid'],util['inspect'](_0xd0a6d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x22')]=function(_0x5bb90d){try{if(this[_0x61da('0x6b')](_0x5bb90d)){logger['debug'](_0x61da('0x8c'),_0x5bb90d['uniqueid'],util[_0x61da('0x44')](_0x5bb90d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5bb90d[_0x61da('0x55')]]){var _0x3d3c00=_[_0x61da('0x83')](this['queueReports'][_0x5bb90d[_0x61da('0x55')]]);_0x3d3c00[_0x61da('0x8d')]=moment()[_0x61da('0x4e')](_0x61da('0x89'));_0x3d3c00['connectedlinenum']=_0x5bb90d[_0x61da('0x8e')];_0x3d3c00[_0x61da('0x8f')]=_0x5bb90d[_0x61da('0x8f')];logger[_0x61da('0x7f')](_0x61da('0x90'),_0x3d3c00[_0x61da('0x50')],_0x3d3c00[_0x61da('0x59')],_0x5bb90d[_0x61da('0x8e')],_0x5bb90d[_0x61da('0x8f')]);this[_0x61da('0x15')][_0x5bb90d[_0x61da('0x55')]]=_0x3d3c00;this['emitVoiceQueueChannelSave'](_0x3d3c00,_0x61da('0x21'));}}}catch(_0x1c513b){logger[_0x61da('0x42')](_0x61da('0x8c'),_0x5bb90d['uniqueid'],util[_0x61da('0x44')](_0x1c513b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x25')]=function(_0x22304d){try{if(this[_0x61da('0x6b')](_0x22304d)){logger['debug'](_0x61da('0x91'),_0x22304d[_0x61da('0x55')],util[_0x61da('0x44')](_0x22304d,{'showHidden':![],'depth':null}));if(this[_0x61da('0x13')][_0x22304d[_0x61da('0x55')]]){var _0x1ce0d3=_[_0x61da('0x83')](this[_0x61da('0x13')][_0x22304d[_0x61da('0x55')]]);_0x1ce0d3['queuecallercomplete']=!![];_0x1ce0d3[_0x61da('0x8a')]=_0x61da('0x92');logger['info'](_0x61da('0x93'),_0x1ce0d3[_0x61da('0x50')],_0x1ce0d3['type']);}}}catch(_0x4994bb){logger[_0x61da('0x42')](_0x61da('0x91'),_0x22304d['uniqueid'],util[_0x61da('0x44')](_0x4994bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')]['syncAgentComplete']=function(_0x431bd5){try{if(this['isNotNull'](_0x431bd5)){logger[_0x61da('0x4b')](_0x61da('0x94'),_0x431bd5['uniqueid'],util[_0x61da('0x44')](_0x431bd5,{'showHidden':![],'depth':null}));if(this[_0x61da('0x13')][_0x431bd5[_0x61da('0x55')]]){var _0x167b10=_[_0x61da('0x83')](this['queueReports'][_0x431bd5[_0x61da('0x55')]]);_0x167b10[_0x61da('0x20')]=![];_0x167b10[_0x61da('0x88')]=null;_0x167b10[_0x61da('0x95')]=!![];_0x167b10[_0x61da('0x8b')]=_0x431bd5['membername'];_0x167b10['holdtime']=_0x431bd5[_0x61da('0x86')];_0x167b10['queuecallercomplete']=!![];_0x167b10[_0x61da('0x96')]=![];_0x167b10[_0x61da('0x97')]=null;if(!_0x167b10[_0x61da('0x98')]){if(_0x431bd5[_0x61da('0x99')]==_0x61da('0x98')){_0x167b10[_0x61da('0x8a')]=_0x61da('0x9a');logger[_0x61da('0x7f')](_0x61da('0x9b'),_0x167b10[_0x61da('0x50')],_0x167b10[_0x61da('0x59')]);}else{if(_['startsWith'](_0x431bd5[_0x61da('0x9c')][_0x61da('0x9d')](),_0x61da('0x9e'))){if(this[_0x61da('0x13')][_0x431bd5[_0x61da('0x9f')]]){var _0x224929=_[_0x61da('0x83')](this[_0x61da('0x13')][_0x431bd5['linkedid']]);_0x224929[_0x61da('0x84')]=![];_0x224929['queuecallerexit']=!![];_0x224929[_0x61da('0x97')]=moment(_0x167b10[_0x61da('0x7b')])['add'](_0x431bd5[_0x61da('0x86')],_0x61da('0xa0'))['format'](_0x61da('0x89'));_0x224929[_0x61da('0x8a')]='FORWARDTRANSFER';_0x224929[_0x61da('0x98')]=!![];_0x224929[_0x61da('0xa1')]=_0x61da('0xa2');_0x224929['transferexten']=_0x431bd5[_0x61da('0xa3')];_0x224929[_0x61da('0xa4')]=_0x431bd5[_0x61da('0x55')];logger[_0x61da('0x7f')](_0x61da('0xa5'),_0x224929['name'],_0x224929[_0x61da('0x59')]);var _0x4820b5=this['queueReports'][_0x431bd5[_0x61da('0x9f')]];this[_0x61da('0x13')][_0x431bd5[_0x61da('0x9f')]]=this['queueReports'][_0x431bd5[_0x61da('0x55')]];this[_0x61da('0x13')][_0x431bd5[_0x61da('0x55')]]=_0x4820b5;}}else{_0x167b10[_0x61da('0x8a')]='COMPLETEDBY'+_0x431bd5[_0x61da('0x99')][_0x61da('0xa6')]();logger[_0x61da('0x7f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x167b10['name'],_0x167b10[_0x61da('0x59')],_0x167b10[_0x61da('0x8a')]);}}}this[_0x61da('0x15')][_0x431bd5[_0x61da('0x55')]]=_0x167b10;this[_0x61da('0x53')](_0x167b10,_0x61da('0x23'));}}}catch(_0x551de0){logger[_0x61da('0x42')]('[%s][voiceQueueReport][agentcomplete]',_0x431bd5[_0x61da('0x55')],util[_0x61da('0x44')](_0x551de0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x27')]=function(_0x205746){try{if(this[_0x61da('0x6b')](_0x205746)){logger[_0x61da('0x4b')](_0x61da('0xa7'),_0x205746[_0x61da('0x55')],util[_0x61da('0x44')](_0x205746,{'showHidden':![],'depth':null}));this[_0x61da('0xa8')](_0x205746['uniqueid'],_[_0x61da('0x81')](_0x205746[_0x61da('0xa9')])[0x0],_0x205746[_0x61da('0xaa')]);if(this[_0x61da('0x13')][_0x205746[_0x61da('0x55')]]){var _0x5cdb42=_[_0x61da('0x83')](this['queueReports'][_0x205746['uniqueid']]);if(_0x5cdb42){if(this['isNotNull'](_0x205746['variable'])&&this['isNotNull'](_0x205746['variable'][_0x61da('0xab')])){switch(_0x205746[_0x61da('0xaa')]){case _0x61da('0xac'):_0x5cdb42['queuecallerexit']=![];_0x5cdb42['queuecallerexitAt']=null;break;case _0x61da('0xad'):_0x5cdb42[_0x61da('0xae')]='timeout';_0x5cdb42[_0x61da('0x96')]=!![];_0x5cdb42[_0x61da('0x97')]=moment()[_0x61da('0x4e')](_0x61da('0x89'));_0x5cdb42[_0x61da('0x8d')]=moment()[_0x61da('0x4e')](_0x61da('0x89'));logger[_0x61da('0x4b')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x205746['uniqueid'],util[_0x61da('0x44')](_0x5cdb42,{'showHidden':![],'depth':null}));ami[_0x61da('0x49')](_0x61da('0xaf'),_0x5cdb42);break;default:_0x5cdb42['queuecallerexit']=!![];_0x5cdb42[_0x61da('0x97')]=moment()[_0x61da('0x4e')](_0x61da('0x89'));_0x5cdb42['queuecallerleaveAt']=moment()[_0x61da('0x4e')](_0x61da('0x89'));}_0x5cdb42[_0x61da('0x20')]=![];_0x5cdb42[_0x61da('0x88')]=null;_0x5cdb42['queuecallerexitreason']=_0x205746[_0x61da('0xaa')];this[_0x61da('0x15')][_0x205746[_0x61da('0x55')]]=_0x5cdb42;this[_0x61da('0x53')](_0x5cdb42,_0x61da('0x26'));}else if(this['isNotNull'](_0x205746[_0x61da('0xa9')])&&this[_0x61da('0x6b')](_0x205746[_0x61da('0xa9')]['queueposition'])){if(!_0x5cdb42[_0x61da('0x20')]){_0x5cdb42['queuecallerexit']=!![];_0x5cdb42[_0x61da('0x97')]=moment()[_0x61da('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5cdb42[_0x61da('0x8a')]=_0x61da('0xb0');_0x5cdb42['queuecallerleaveAt']=moment()[_0x61da('0x4e')](_0x61da('0x89'));this['channels'][_0x205746['uniqueid']]=_0x5cdb42;}}logger['info'](_0x61da('0xb1'),_0x205746[_0x61da('0x55')],_0x5cdb42[_0x61da('0x50')],_0x5cdb42[_0x61da('0x59')],_['keys'](_0x205746[_0x61da('0xa9')])[0x0],_0x205746[_0x61da('0xaa')]);_0x5cdb42[_0x61da('0x1a')]=this['variables'][_0x205746['uniqueid']];}}}}catch(_0xcaa73){logger[_0x61da('0x42')](_0x61da('0xa7'),_0x205746[_0x61da('0x55')],util[_0x61da('0x44')](_0xcaa73,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0xa8')]=function(_0x55d8ea,_0x475313,_0x13821b){var _0x54bc80=['rtpaudioqos',_0x61da('0xb2'),_0x61da('0xb3'),_0x61da('0xb4'),'rtpaudioqosloss',_0x61da('0xb5'),'rtpaudioqosrtt',_0x61da('0xb6'),'sipcallid','sipuri',_0x61da('0xb7'),_0x61da('0xb8'),_0x61da('0xb9'),'memberdynamic',_0x61da('0xba'),'memberlastcall','membername',_0x61da('0xbb'),_0x61da('0xbc')];if(!_['isNil'](_0x475313)&&!_[_0x61da('0xbd')](_0x54bc80,_0x475313)){if(_[_0x61da('0x6c')](this[_0x61da('0x1a')][_0x55d8ea])){this[_0x61da('0x1a')][_0x55d8ea]={};}this[_0x61da('0x1a')][_0x55d8ea][_0x475313]=_0x13821b;}};VoiceQueueReport[_0x61da('0xe')][_0x61da('0x29')]=function(_0x339362){try{if(this[_0x61da('0x6b')](_0x339362)){logger[_0x61da('0x4b')](_0x61da('0xbe'),_0x339362['uniqueid'],util[_0x61da('0x44')](_0x339362,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x339362['uniqueid']]){for(var _0x21570e=0x0,_0x55ca3d={};_0x21570e0x0?_0x46f139:0x0;this['voiceQueues'][_0x2d017f['queue']]['talking']=this[_0xe90a('0x14')][_0x2d017f['queue']]['talking']>_[_0xe90a('0x73')](_0x2d017f[_0xe90a('0x74')])?_['toNumber'](_0x2d017f[_0xe90a('0x74')]):this[_0xe90a('0x14')][_0x2d017f[_0xe90a('0x6d')]][_0xe90a('0x31')];this[_0xe90a('0x54')](this[_0xe90a('0x14')][_0x2d017f[_0xe90a('0x6d')]],_0xe90a('0x16'));}logger[_0xe90a('0x4a')](_0xe90a('0x75'),util[_0xe90a('0x40')](this[_0xe90a('0x14')][_0x2d017f[_0xe90a('0x6d')]],{'showHidden':![],'depth':null}));ami[_0xe90a('0x48')](_0xe90a('0x76'),this[_0xe90a('0x14')][_0x2d017f[_0xe90a('0x6d')]]);}}}catch(_0x1c2e34){logger['error'](_0xe90a('0x77'),util[_0xe90a('0x40')](_0x1c2e34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe90a('0xc')][_0xe90a('0x19')]=function(_0x5a27d2){logger[_0xe90a('0x4a')](_0xe90a('0x78'),util[_0xe90a('0x40')](_0x5a27d2,{'showHidden':![],'depth':null}));this[_0xe90a('0x6c')]=!![];};VoiceQueueReport['prototype'][_0xe90a('0x1a')]=function(_0x23eca4){try{if(this[_0xe90a('0x67')](_0x23eca4)){logger[_0xe90a('0x4a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x23eca4[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x23eca4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xe90a('0x11')][_0x23eca4[_0xe90a('0x79')]]))this[_0xe90a('0x11')][_0x23eca4[_0xe90a('0x79')]]=[];if(_[_0xe90a('0x68')](this[_0xe90a('0x36')][_0x23eca4[_0xe90a('0x79')]]))this[_0xe90a('0x36')][_0x23eca4[_0xe90a('0x79')]]={};var _0x2dd294=new QueueReport();_0x2dd294[_0xe90a('0x60')]=_0x23eca4['queue'];_0x2dd294[_0xe90a('0x55')]=this[_0xe90a('0x14')][_0x2dd294['name']]&&this[_0xe90a('0x14')][_0x2dd294[_0xe90a('0x60')]][_0xe90a('0x55')]?this[_0xe90a('0x14')][_0x2dd294[_0xe90a('0x60')]][_0xe90a('0x55')]||_0xe90a('0x56'):'inbound';_0x2dd294[_0xe90a('0x6d')]=_0x23eca4[_0xe90a('0x6d')];_0x2dd294[_0xe90a('0x7a')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));_0x2dd294['position']=_0x23eca4[_0xe90a('0x7c')];_0x2dd294[_0xe90a('0x7d')]=_0x23eca4[_0xe90a('0x7d')];_0x2dd294[_0xe90a('0x79')]=_0x23eca4[_0xe90a('0x79')];_0x2dd294['routealias']=this[_0xe90a('0x36')][_0x23eca4[_0xe90a('0x79')]][_0xe90a('0x7e')];logger[_0xe90a('0x6f')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x2dd294['name'],_0x2dd294[_0xe90a('0x55')]);_[_0xe90a('0x7f')](_0x2dd294,_[_0xe90a('0x80')](_0x23eca4,_[_0xe90a('0x81')](_0x2dd294)));this[_0xe90a('0x11')][_0x23eca4[_0xe90a('0x79')]][_0xe90a('0x82')](_0x2dd294);this[_0xe90a('0x36')][_0x23eca4[_0xe90a('0x79')]]=_0x2dd294;this[_0xe90a('0x49')](_0x2dd294,_0xe90a('0x83'));}}catch(_0x252e6e){logger['error'](_0xe90a('0x84'),_0x23eca4['uniqueid'],util[_0xe90a('0x40')](_0x252e6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x51528d){try{if(this[_0xe90a('0x67')](_0x51528d)){logger['debug'](_0xe90a('0x85'),_0x51528d[_0xe90a('0x79')],util['inspect'](_0x51528d,{'showHidden':![],'depth':null}));if(this[_0xe90a('0x11')][_0x51528d[_0xe90a('0x79')]]){var _0x3514c6=_[_0xe90a('0x86')](this[_0xe90a('0x11')][_0x51528d[_0xe90a('0x79')]]);_0x3514c6[_0xe90a('0x87')]=![];_0x3514c6[_0xe90a('0x88')]=null;_0x3514c6['holdtime']=_0x51528d[_0xe90a('0x89')];_0x3514c6['originalposition']=_0x51528d[_0xe90a('0x8a')];_0x3514c6[_0xe90a('0x8b')]=!![];_0x3514c6[_0xe90a('0x8c')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));_0x3514c6[_0xe90a('0x8d')]=_0xe90a('0x8e');_0x3514c6[_0xe90a('0x8f')]=null;logger[_0xe90a('0x6f')](_0xe90a('0x90'),_0x3514c6['name'],_0x3514c6[_0xe90a('0x55')]);this[_0xe90a('0x36')][_0x51528d[_0xe90a('0x79')]]=_0x3514c6;this['emitVoiceQueueChannelRemove'](_0x3514c6,_0xe90a('0x8b'));}}}catch(_0x380cb3){logger['error'](_0xe90a('0x85'),_0x51528d['uniqueid'],util[_0xe90a('0x40')](_0x380cb3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x45fc7a){try{if(this[_0xe90a('0x67')](_0x45fc7a)){logger[_0xe90a('0x4a')]('[%s][voiceQueueReport][queuecallerleave]',_0x45fc7a['uniqueid'],util[_0xe90a('0x40')](_0x45fc7a,{'showHidden':![],'depth':null}));if(this[_0xe90a('0x11')][_0x45fc7a[_0xe90a('0x79')]]){var _0x172fc6=_['last'](this[_0xe90a('0x11')][_0x45fc7a['uniqueid']]);_0x172fc6[_0xe90a('0x91')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));_0x172fc6[_0xe90a('0x92')]=_0x45fc7a['connectedlinenum'];_0x172fc6[_0xe90a('0x93')]=_0x45fc7a[_0xe90a('0x93')];logger['info'](_0xe90a('0x94'),_0x172fc6[_0xe90a('0x60')],_0x172fc6['type'],_0x45fc7a['connectedlinenum'],_0x45fc7a[_0xe90a('0x93')]);this[_0xe90a('0x36')][_0x45fc7a[_0xe90a('0x79')]]=_0x172fc6;this[_0xe90a('0x49')](_0x172fc6,_0xe90a('0x1b'));}}}catch(_0x2c853d){logger[_0xe90a('0x3e')]('[%s][voiceQueueReport][queuecallerleave]',_0x45fc7a[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x2c853d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe90a('0xc')][_0xe90a('0x20')]=function(_0x2fe3aa){try{if(this[_0xe90a('0x67')](_0x2fe3aa)){logger['debug'](_0xe90a('0x95'),_0x2fe3aa[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x2fe3aa,{'showHidden':![],'depth':null}));if(this[_0xe90a('0x11')][_0x2fe3aa[_0xe90a('0x79')]]){var _0x3c49af=_['last'](this[_0xe90a('0x11')][_0x2fe3aa[_0xe90a('0x79')]]);_0x3c49af[_0xe90a('0x87')]=!![];_0x3c49af[_0xe90a('0x8d')]=_0xe90a('0x96');logger[_0xe90a('0x6f')](_0xe90a('0x97'),_0x3c49af[_0xe90a('0x60')],_0x3c49af[_0xe90a('0x55')]);}}}catch(_0x154056){logger[_0xe90a('0x3e')](_0xe90a('0x95'),_0x2fe3aa[_0xe90a('0x79')],util['inspect'](_0x154056,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe90a('0x1e')]=function(_0x4cb716){try{if(this[_0xe90a('0x67')](_0x4cb716)){logger[_0xe90a('0x4a')]('[%s][voiceQueueReport][agentcomplete]',_0x4cb716['uniqueid'],util['inspect'](_0x4cb716,{'showHidden':![],'depth':null}));if(this[_0xe90a('0x11')][_0x4cb716[_0xe90a('0x79')]]){var _0x2f6259=_[_0xe90a('0x86')](this[_0xe90a('0x11')][_0x4cb716[_0xe90a('0x79')]]);_0x2f6259[_0xe90a('0x8b')]=![];_0x2f6259['queuecallerabandonAt']=null;_0x2f6259[_0xe90a('0x98')]=!![];_0x2f6259['lastAssignedTo']=_0x4cb716[_0xe90a('0x99')];_0x2f6259['holdtime']=_0x4cb716['holdtime'];_0x2f6259[_0xe90a('0x87')]=!![];_0x2f6259['queuecallerexit']=![];_0x2f6259[_0xe90a('0x9a')]=null;if(!_0x2f6259[_0xe90a('0x9b')]){if(_0x4cb716[_0xe90a('0x9c')]==_0xe90a('0x9b')){_0x2f6259[_0xe90a('0x8d')]='COMPLETED';logger[_0xe90a('0x6f')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2f6259[_0xe90a('0x60')],_0x2f6259[_0xe90a('0x55')]);}else{if(_['startsWith'](_0x4cb716['channel']['toLowerCase'](),_0xe90a('0x9d'))){if(this['queueReports'][_0x4cb716[_0xe90a('0x9e')]]){var _0x2ed614=_['last'](this[_0xe90a('0x11')][_0x4cb716['linkedid']]);_0x2ed614[_0xe90a('0x87')]=![];_0x2ed614[_0xe90a('0x9f')]=!![];_0x2ed614[_0xe90a('0x9a')]=moment(_0x2f6259[_0xe90a('0x7a')])[_0xe90a('0xa0')](_0x4cb716[_0xe90a('0x89')],'seconds')['format'](_0xe90a('0x7b'));_0x2ed614['queuecallerexitreason']='FORWARDTRANSFER';_0x2ed614['transfer']=!![];_0x2ed614[_0xe90a('0xa1')]=_0xe90a('0xa2');_0x2ed614[_0xe90a('0xa3')]=_0x4cb716[_0xe90a('0xa4')];_0x2ed614[_0xe90a('0xa5')]=_0x4cb716[_0xe90a('0x79')];logger[_0xe90a('0x6f')](_0xe90a('0xa6'),_0x2ed614['name'],_0x2ed614['type']);var _0xd642f4=this[_0xe90a('0x11')][_0x4cb716['linkedid']];this[_0xe90a('0x11')][_0x4cb716[_0xe90a('0x9e')]]=this[_0xe90a('0x11')][_0x4cb716[_0xe90a('0x79')]];this[_0xe90a('0x11')][_0x4cb716[_0xe90a('0x79')]]=_0xd642f4;}}else{_0x2f6259[_0xe90a('0x8d')]='COMPLETEDBY'+_0x4cb716[_0xe90a('0x9c')]['toUpperCase']();logger['info'](_0xe90a('0xa7'),_0x2f6259[_0xe90a('0x60')],_0x2f6259['type'],_0x2f6259[_0xe90a('0x8d')]);}}}this[_0xe90a('0x36')][_0x4cb716[_0xe90a('0x79')]]=_0x2f6259;this[_0xe90a('0x46')](_0x2f6259,_0xe90a('0x1d'));}}}catch(_0x516270){logger['error'](_0xe90a('0xa8'),_0x4cb716[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x516270,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe90a('0x22')]=function(_0x1e3cc6){try{if(this[_0xe90a('0x67')](_0x1e3cc6)){logger[_0xe90a('0x4a')](_0xe90a('0xa9'),_0x1e3cc6[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x1e3cc6,{'showHidden':![],'depth':null}));this[_0xe90a('0xaa')](_0x1e3cc6[_0xe90a('0x79')],_[_0xe90a('0x81')](_0x1e3cc6[_0xe90a('0xab')])[0x0],_0x1e3cc6[_0xe90a('0xac')]);if(this['queueReports'][_0x1e3cc6[_0xe90a('0x79')]]){var _0x34ff55=_[_0xe90a('0x86')](this[_0xe90a('0x11')][_0x1e3cc6[_0xe90a('0x79')]]);if(_0x34ff55){if(this['isNotNull'](_0x1e3cc6[_0xe90a('0xab')])&&this[_0xe90a('0x67')](_0x1e3cc6[_0xe90a('0xab')][_0xe90a('0xad')])){switch(_0x1e3cc6[_0xe90a('0xac')]){case _0xe90a('0xae'):_0x34ff55['queuecallerexit']=![];_0x34ff55['queuecallerexitAt']=null;break;case _0xe90a('0xaf'):_0x34ff55[_0xe90a('0xb0')]='timeout';_0x34ff55[_0xe90a('0x9f')]=!![];_0x34ff55[_0xe90a('0x9a')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));_0x34ff55[_0xe90a('0x91')]=moment()['format'](_0xe90a('0x7b'));logger[_0xe90a('0x4a')](_0xe90a('0xb1'),_0x1e3cc6[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x34ff55,{'showHidden':![],'depth':null}));ami[_0xe90a('0x48')]('custom:timeout',_0x34ff55);break;default:_0x34ff55[_0xe90a('0x9f')]=!![];_0x34ff55[_0xe90a('0x9a')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));_0x34ff55[_0xe90a('0x91')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));}_0x34ff55[_0xe90a('0x8b')]=![];_0x34ff55[_0xe90a('0x8c')]=null;_0x34ff55['queuecallerexitreason']=_0x1e3cc6[_0xe90a('0xac')];this[_0xe90a('0x36')][_0x1e3cc6[_0xe90a('0x79')]]=_0x34ff55;this[_0xe90a('0x46')](_0x34ff55,_0xe90a('0x21'));}else if(this[_0xe90a('0x67')](_0x1e3cc6[_0xe90a('0xab')])&&this['isNotNull'](_0x1e3cc6[_0xe90a('0xab')]['queueposition'])){if(!_0x34ff55[_0xe90a('0x8b')]){_0x34ff55['queuecallerexit']=!![];_0x34ff55[_0xe90a('0x9a')]=moment()[_0xe90a('0x51')](_0xe90a('0x7b'));_0x34ff55[_0xe90a('0x8d')]='EXITWITHKEY';_0x34ff55[_0xe90a('0x91')]=moment()['format'](_0xe90a('0x7b'));this[_0xe90a('0x36')][_0x1e3cc6['uniqueid']]=_0x34ff55;}}logger[_0xe90a('0x6f')](_0xe90a('0xb2'),_0x1e3cc6[_0xe90a('0x79')],_0x34ff55['name'],_0x34ff55['type'],_[_0xe90a('0x81')](_0x1e3cc6[_0xe90a('0xab')])[0x0],_0x1e3cc6[_0xe90a('0xac')]);_0x34ff55[_0xe90a('0x42')]=this[_0xe90a('0x42')][_0x1e3cc6['uniqueid']];}}}}catch(_0x3adc51){logger[_0xe90a('0x3e')](_0xe90a('0xa9'),_0x1e3cc6[_0xe90a('0x79')],util['inspect'](_0x3adc51,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe90a('0xaa')]=function(_0x297415,_0x469b54,_0xe10d5d){var _0x36b823=[_0xe90a('0xb3'),'rtpaudioqosbridged',_0xe90a('0xb4'),_0xe90a('0xb5'),_0xe90a('0xb6'),_0xe90a('0xb7'),_0xe90a('0xb8'),_0xe90a('0xb9'),_0xe90a('0xba'),_0xe90a('0xbb'),'bridgepeer','bridgepvtcallid',_0xe90a('0xbc'),_0xe90a('0xbd'),_0xe90a('0xbe'),'memberlastcall',_0xe90a('0x99'),'memberpenalty',_0xe90a('0xbf')];if(!_[_0xe90a('0x38')](_0x469b54)&&!_[_0xe90a('0xc0')](_0x36b823,_0x469b54)){if(_[_0xe90a('0x68')](this['variables'][_0x297415])){this[_0xe90a('0x42')][_0x297415]={};}this[_0xe90a('0x42')][_0x297415][_0x469b54]=_0xe10d5d;}};VoiceQueueReport[_0xe90a('0xc')][_0xe90a('0x23')]=function(_0x2e0e52){try{if(this[_0xe90a('0x67')](_0x2e0e52)){logger[_0xe90a('0x4a')]('[%s][voiceQueueReport][hangup]',_0x2e0e52[_0xe90a('0x79')],util[_0xe90a('0x40')](_0x2e0e52,{'showHidden':![],'depth':null}));if(this[_0xe90a('0x11')][_0x2e0e52[_0xe90a('0x79')]]){for(var _0x5456d3=0x0,_0x315385={};_0x5456d3=0x0?moment(_0x1370f2['endtime'])[_0x07fc('0xd')](_0x1370f2['starttime'],_0x07fc('0xf')):null,'data1':_0x07fc('0x16'),'data2':_0x1370f2[_0x07fc('0x12')],'data3':_0x1370f2[_0x07fc('0x17')],'data4':_0x1370f2[_0x07fc('0x18')]||null,'role':'agent','internal':_0x1370f2[_0x07fc('0x12')]?_[_0x07fc('0x13')](_0x1370f2[_0x07fc('0x12')]):undefined,'uniqueid':_0x1370f2[_0x07fc('0x14')]},'log':_0x07fc('0x6')});}; \ No newline at end of file +var _0x5af7=['toNumber','voiceDialReport','Request','starttime','dialstring','uniqueid','moment','util','../client','voiceQueueReport','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','accountcode'];(function(_0x22fe5c,_0x28645c){var _0x17a217=function(_0x1306f0){while(--_0x1306f0){_0x22fe5c['push'](_0x22fe5c['shift']());}};_0x17a217(++_0x28645c);}(_0x5af7,0xa2));var _0x75af=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0x5af7[_0x4503df];return _0x3f1b2b;};'use strict';var moment=require(_0x75af('0x0'));var _=require('lodash');var util=require(_0x75af('0x1'));var client=require(_0x75af('0x2'));exports[_0x75af('0x3')]=function(_0x1a3290){var _0x2e05c3=_0x1a3290[_0x75af('0x4')]||_0x1a3290['queuecallerexitAt'];return client['Request'](_0x75af('0x5'),{'body':{'channel':_0x75af('0x6'),'membername':_0x1a3290[_0x75af('0x7')],'interface':_[_0x75af('0x8')](_0x1a3290[_0x75af('0x9')])?util[_0x75af('0xa')](_0x75af('0xb'),_0x1a3290[_0x75af('0x7')]):_0x1a3290[_0x75af('0x9')],'type':'TALKING','enterAt':_0x1a3290['queuecallerleaveAt'],'exitAt':_0x2e05c3,'duration':moment(_0x2e05c3)[_0x75af('0xc')](_0x1a3290[_0x75af('0xd')],_0x75af('0xe')),'data1':'inbound','data2':_0x1a3290[_0x75af('0xf')],'data3':_0x1a3290[_0x75af('0x10')],'data4':null,'data5':_0x1a3290[_0x75af('0x11')],'role':_0x75af('0x12'),'internal':_0x1a3290[_0x75af('0x13')]?_[_0x75af('0x14')](_0x1a3290[_0x75af('0x13')]):undefined,'uniqueid':_0x1a3290['uniqueid']},'log':_0x75af('0x5')});};exports[_0x75af('0x15')]=function(_0xbf82a5){return client[_0x75af('0x16')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0xbf82a5['membername'],'interface':_0xbf82a5[_0x75af('0x9')],'type':'TALKING','enterAt':_0xbf82a5['starttime'],'exitAt':_0xbf82a5['endtime'],'duration':moment(_0xbf82a5['endtime'])['diff'](_0xbf82a5[_0x75af('0x17')],_0x75af('0xe'))>=0x0?moment(_0xbf82a5['endtime'])[_0x75af('0xc')](_0xbf82a5[_0x75af('0x17')],'seconds'):null,'data1':'outbound','data2':_0xbf82a5[_0x75af('0x13')],'data3':_0xbf82a5[_0x75af('0x10')],'data4':_0xbf82a5[_0x75af('0x18')]||null,'role':_0x75af('0x12'),'internal':_0xbf82a5['accountcode']?_[_0x75af('0x14')](_0xbf82a5[_0x75af('0x13')]):undefined,'uniqueid':_0xbf82a5[_0x75af('0x19')]},'log':_0x75af('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index a4260ca..4a92f4b 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 _0x8840=['Request','GetSettings','../client'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x8840,0x1ac));var _0x0884=function(_0x3ddbcc,_0x54be6b){_0x3ddbcc=_0x3ddbcc-0x0;var _0x381b48=_0x8840[_0x3ddbcc];return _0x381b48;};'use strict';var client=require(_0x0884('0x0'));exports['getSettings']=function(){return client[_0x0884('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x0884('0x2')});}; \ No newline at end of file +var _0x923c=['../client','Request','ShowSetting'];(function(_0x1b0d88,_0x53895e){var _0x4451ca=function(_0x4173fb){while(--_0x4173fb){_0x1b0d88['push'](_0x1b0d88['shift']());}};_0x4451ca(++_0x53895e);}(_0x923c,0x198));var _0xc923=function(_0x5b8e77,_0x44f62f){_0x5b8e77=_0x5b8e77-0x0;var _0x18c4a3=_0x923c[_0x5b8e77];return _0x18c4a3;};'use strict';var client=require(_0xc923('0x0'));exports['getSettings']=function(){return client[_0xc923('0x1')](_0xc923('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f917964..dee1386 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 _0x8091=['name','html','../client','getTemplates','GetTemplate'];(function(_0x29217a,_0x22ac1e){var _0x2dc3a3=function(_0x3fed8a){while(--_0x3fed8a){_0x29217a['push'](_0x29217a['shift']());}};_0x2dc3a3(++_0x22ac1e);}(_0x8091,0x124));var _0x1809=function(_0x48f191,_0x4ed044){_0x48f191=_0x48f191-0x0;var _0x4cd802=_0x8091[_0x48f191];return _0x4cd802;};'use strict';var client=require(_0x1809('0x0'));exports[_0x1809('0x1')]=function(_0x214571){return function(_0x59e14c){return client['Request'](_0x1809('0x2'),{'options':{'raw':!![],'attributes':['id',_0x1809('0x3'),_0x1809('0x4')]},'log':_0x1809('0x2')});};}; \ No newline at end of file +var _0x16d5=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x315684,_0x3d9c4c){var _0x56c435=function(_0x37f81b){while(--_0x37f81b){_0x315684['push'](_0x315684['shift']());}};_0x56c435(++_0x3d9c4c);}(_0x16d5,0xe9));var _0x516d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16d5[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x516d('0x0'));exports[_0x516d('0x1')]=function(_0x527b4e){return function(_0xf052e){return client[_0x516d('0x2')](_0x516d('0x3'),{'options':{'raw':!![],'attributes':['id',_0x516d('0x4'),_0x516d('0x5')]},'log':_0x516d('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index f03049b..c330034 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 _0xae97=['channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data3','data4','data5','data6','data7','getTriggers','GetTrigger','name'];(function(_0x5ab232,_0x570056){var _0x457b86=function(_0x189f6b){while(--_0x189f6b){_0x5ab232['push'](_0x5ab232['shift']());}};_0x457b86(++_0x570056);}(_0xae97,0x13d));var _0x7ae9=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xae97[_0x3b0731];return _0x4204d7;};'use strict';var client=require('../client');exports[_0x7ae9('0x0')]=function(_0x1d9cc2){return function(_0x62a9e8){return client['Request'](_0x7ae9('0x1'),{'options':{'raw':![],'attributes':['id',_0x7ae9('0x2'),_0x7ae9('0x3'),'status'],'include':[{'model':_0x7ae9('0x4'),'as':_0x7ae9('0x5'),'attributes':['id','field',_0x7ae9('0x6'),_0x7ae9('0x7')]},{'model':_0x7ae9('0x4'),'as':_0x7ae9('0x8'),'attributes':['id',_0x7ae9('0x9'),_0x7ae9('0x6'),_0x7ae9('0x7')]},{'model':_0x7ae9('0xa'),'as':_0x7ae9('0xb'),'attributes':['id',_0x7ae9('0xc'),_0x7ae9('0xd'),_0x7ae9('0xe'),_0x7ae9('0xf'),_0x7ae9('0x10'),_0x7ae9('0x11'),_0x7ae9('0x12'),_0x7ae9('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x45de=['data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','AllConditions','field','Condition','value','Action','Actions'];(function(_0x34753b,_0x23855d){var _0x225345=function(_0x8e839){while(--_0x8e839){_0x34753b['push'](_0x34753b['shift']());}};_0x225345(++_0x23855d);}(_0x45de,0xcf));var _0xe45d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x45de[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xe45d('0x0'));exports[_0xe45d('0x1')]=function(_0x2cbd4a){return function(_0x3e54cb){return client[_0xe45d('0x2')](_0xe45d('0x3'),{'options':{'raw':![],'attributes':['id',_0xe45d('0x4'),_0xe45d('0x5'),_0xe45d('0x6')],'include':[{'model':'Condition','as':_0xe45d('0x7'),'attributes':['id',_0xe45d('0x8'),'operator','value']},{'model':_0xe45d('0x9'),'as':'AnyConditions','attributes':['id',_0xe45d('0x8'),'operator',_0xe45d('0xa')]},{'model':_0xe45d('0xb'),'as':_0xe45d('0xc'),'attributes':['id','action',_0xe45d('0xd'),_0xe45d('0xe'),_0xe45d('0xf'),_0xe45d('0x10'),_0xe45d('0x11'),_0xe45d('0x12'),_0xe45d('0x13')]}]},'log':_0xe45d('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index a609017..d3bd807 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 _0xa27b=['GetTrunk','Request','name','registry'];(function(_0x297741,_0x21136a){var _0x62dd73=function(_0x2f4e73){while(--_0x2f4e73){_0x297741['push'](_0x297741['shift']());}};_0x62dd73(++_0x21136a);}(_0xa27b,0x1b5));var _0xba27=function(_0x23a8f7,_0x768747){_0x23a8f7=_0x23a8f7-0x0;var _0x5a1fc3=_0xa27b[_0x23a8f7];return _0x5a1fc3;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x17773e){return function(_0x4ff107){return client[_0xba27('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xba27('0x1'),_0xba27('0x2'),'defaultuser']},'log':_0xba27('0x3')});};}; \ No newline at end of file +var _0x27af=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x5d62a0,_0x180229){var _0x542eb8=function(_0x554207){while(--_0x554207){_0x5d62a0['push'](_0x5d62a0['shift']());}};_0x542eb8(++_0x180229);}(_0x27af,0xbe));var _0xf27a=function(_0x394376,_0x3fe6eb){_0x394376=_0x394376-0x0;var _0x2fe224=_0x27af[_0x394376];return _0x2fe224;};'use strict';var client=require(_0xf27a('0x0'));exports[_0xf27a('0x1')]=function(_0xa96838){return function(_0x62868a){return client[_0xf27a('0x2')](_0xf27a('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xf27a('0x4'),_0xf27a('0x5'),_0xf27a('0x6')]},'log':_0xf27a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index f4b22f6..26485a1 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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe706,0xa3));var _0x6e70=function(_0x29d530,_0x5da0d7){_0x29d530=_0x29d530-0x0;var _0x242905=_0xe706[_0x29d530];return _0x242905;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x29dec3,_0x486974){var _0x1f5062=function(_0x31ab2c){while(--_0x31ab2c){_0x29dec3['push'](_0x29dec3['shift']());}};_0x1f5062(++_0x486974);}(_0x70e0,0x17b));var _0x070e=function(_0x2207a6,_0x4f0166){_0x2207a6=_0x2207a6-0x0;var _0x382623=_0x70e0[_0x2207a6];return _0x382623;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index fc322ce..bfbbeb3 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 _0xf56d=['Request','CreateVoiceAgentReport','update','../client','create'];(function(_0x2d1966,_0x14ef7e){var _0x3885f9=function(_0x39ee34){while(--_0x39ee34){_0x2d1966['push'](_0x2d1966['shift']());}};_0x3885f9(++_0x14ef7e);}(_0xf56d,0x17f));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xdf56('0x0'));exports[_0xdf56('0x1')]=function(_0x866fa3){return client[_0xdf56('0x2')](_0xdf56('0x3'),{'body':_0x866fa3,'log':_0xdf56('0x3')});};exports[_0xdf56('0x4')]=function(_0x49f609,_0x4fd9e9,_0x57814d){return client[_0xdf56('0x2')]('UpdateVoiceAgentReport',{'body':_0x49f609,'options':{'where':{'uniqueid':_0x4fd9e9,'interface':_0x57814d,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0xc2ae=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2ae,0xfc));var _0xec2a=function(_0x1a916a,_0x16060d){_0x1a916a=_0x1a916a-0x0;var _0x1b6014=_0xc2ae[_0x1a916a];return _0x1b6014;};'use strict';var client=require(_0xec2a('0x0'));exports['create']=function(_0x203b3d){return client[_0xec2a('0x1')]('CreateVoiceAgentReport',{'body':_0x203b3d,'log':_0xec2a('0x2')});};exports[_0xec2a('0x3')]=function(_0x3bd9a0,_0x48ff95,_0x30971e){return client[_0xec2a('0x1')](_0xec2a('0x4'),{'body':_0x3bd9a0,'options':{'where':{'uniqueid':_0x48ff95,'interface':_0x30971e,'agentcomplete':!![]}},'log':_0xec2a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index ab8d3fb..e43a798 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 _0xe088=['outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0xe088,0x136));var _0x8e08=function(_0x45735b,_0x15bf2f){_0x45735b=_0x45735b-0x0;var _0x1c7553=_0xe088[_0x45735b];return _0x1c7553;};'use strict';var moment=require('moment');var util=require(_0x8e08('0x0'));var _=require(_0x8e08('0x1'));var client=require(_0x8e08('0x2'));exports[_0x8e08('0x3')]=function(_0x4fabe6){return client[_0x8e08('0x4')](_0x8e08('0x5'),{'body':_[_0x8e08('0x6')](_0x4fabe6,{'source':_0x4fabe6['calleridnum'],'destinationcontext':_0x4fabe6[_0x8e08('0x7')],'callerid':_0x4fabe6[_0x8e08('0x8')],'amaflags':_0x8e08('0x9')}),'log':_0x8e08('0x5')});};exports[_0x8e08('0xa')]=function(){return function(){return client[_0x8e08('0x4')](_0x8e08('0xb'),{'options':{'where':{'type':[_0x8e08('0xc')],'createdAt':{'$between':[moment()[_0x8e08('0xd')]('day')[_0x8e08('0xe')](_0x8e08('0xf')),moment()[_0x8e08('0x10')](_0x8e08('0x11'))['format'](_0x8e08('0xf'))]}},'attributes':[_0x8e08('0x12'),_0x8e08('0x13'),_0x8e08('0x14'),_0x8e08('0x15')]},'log':_0x8e08('0x16')});};}; \ No newline at end of file +var _0x3ed9=['billableseconds','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration'];(function(_0x1762d2,_0x24eb8c){var _0xfd822d=function(_0x2e922d){while(--_0x2e922d){_0x1762d2['push'](_0x1762d2['shift']());}};_0xfd822d(++_0x24eb8c);}(_0x3ed9,0xbe));var _0x93ed=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x3ed9[_0x1b828b];return _0x98da1a;};'use strict';var moment=require(_0x93ed('0x0'));var util=require(_0x93ed('0x1'));var _=require(_0x93ed('0x2'));var client=require(_0x93ed('0x3'));exports[_0x93ed('0x4')]=function(_0x3aa3e0){return client[_0x93ed('0x5')](_0x93ed('0x6'),{'body':_['merge'](_0x3aa3e0,{'source':_0x3aa3e0[_0x93ed('0x7')],'destinationcontext':_0x3aa3e0[_0x93ed('0x8')],'callerid':_0x3aa3e0[_0x93ed('0x9')],'amaflags':_0x93ed('0xa')}),'log':_0x93ed('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x93ed('0x5')](_0x93ed('0xb'),{'options':{'where':{'type':[_0x93ed('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x93ed('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x93ed('0xe')](_0x93ed('0xd'))[_0x93ed('0xf')](_0x93ed('0x10'))]}},'attributes':[_0x93ed('0x11'),_0x93ed('0x12'),_0x93ed('0x13'),_0x93ed('0x14')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 980e924..a627a46 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 _0x8bc5=['create','CreateVoiceDialReport','../client'];(function(_0xdff666,_0x26a021){var _0x3b0968=function(_0x5c70a5){while(--_0x5c70a5){_0xdff666['push'](_0xdff666['shift']());}};_0x3b0968(++_0x26a021);}(_0x8bc5,0x1b2));var _0x58bc=function(_0x446e9c,_0x8b592){_0x446e9c=_0x446e9c-0x0;var _0x54d2db=_0x8bc5[_0x446e9c];return _0x54d2db;};'use strict';var client=require(_0x58bc('0x0'));exports[_0x58bc('0x1')]=function(_0x27590e){return client['Request'](_0x58bc('0x2'),{'body':_0x27590e,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x8d4f=['../client','Request','CreateVoiceDialReport'];(function(_0x766451,_0x3ef32f){var _0xde5160=function(_0x307a1f){while(--_0x307a1f){_0x766451['push'](_0x766451['shift']());}};_0xde5160(++_0x3ef32f);}(_0x8d4f,0x168));var _0xf8d4=function(_0x308a4e,_0x5b6c19){_0x308a4e=_0x308a4e-0x0;var _0x7e11c4=_0x8d4f[_0x308a4e];return _0x7e11c4;};'use strict';var client=require(_0xf8d4('0x0'));exports['create']=function(_0x3a320e){return client[_0xf8d4('0x1')](_0xf8d4('0x2'),{'body':_0x3a320e,'log':_0xf8d4('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3783a6c..529cee0 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 _0x2e54=['recordingFormat','getVoiceExtensions','../client','GetVoiceExtension','exten'];(function(_0x352fc9,_0x59fadc){var _0x36b574=function(_0x3a451f){while(--_0x3a451f){_0x352fc9['push'](_0x352fc9['shift']());}};_0x36b574(++_0x59fadc);}(_0x2e54,0x1dd));var _0x42e5=function(_0x45124b,_0x208502){_0x45124b=_0x45124b-0x0;var _0x3a90d8=_0x2e54[_0x45124b];return _0x3a90d8;};'use strict';var client=require(_0x42e5('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x42e5('0x1'),{'options':{'raw':!![],'attributes':['id',_0x42e5('0x2'),_0x42e5('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x42e5('0x4')});};}; \ No newline at end of file +var _0x5db8=['exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5db8,0xbb));var _0x85db=function(_0x2a3c0a,_0x163f5c){_0x2a3c0a=_0x2a3c0a-0x0;var _0x1703a2=_0x5db8[_0x2a3c0a];return _0x1703a2;};'use strict';var client=require(_0x85db('0x0'));exports[_0x85db('0x1')]=function(){return function(){return client[_0x85db('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x85db('0x3'),_0x85db('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x85db('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index ba17c97..9d8ac7b 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 _0xe781=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','active','Interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x4e3419,_0x1959a8){var _0x9f5cbb=function(_0x3cfe00){while(--_0x3cfe00){_0x4e3419['push'](_0x4e3419['shift']());}};_0x9f5cbb(++_0x1959a8);}(_0xe781,0x147));var _0x1e78=function(_0x46d2b6,_0x166656){_0x46d2b6=_0x46d2b6-0x0;var _0x12831b=_0xe781[_0x46d2b6];return _0x12831b;};'use strict';var client=require('../client');exports[_0x1e78('0x0')]=function(){return function(){return client[_0x1e78('0x1')](_0x1e78('0x2'),{'options':{'raw':![],'attributes':['id',_0x1e78('0x3'),_0x1e78('0x4'),_0x1e78('0x5'),_0x1e78('0x6'),'monitor_format',_0x1e78('0x7'),_0x1e78('0x8'),_0x1e78('0x9'),_0x1e78('0xa'),'dialLimitQueue',_0x1e78('0xb'),_0x1e78('0xc'),_0x1e78('0xd'),'dialPredictiveInterval',_0x1e78('0xe'),_0x1e78('0xf'),'dialOriginateTimeout',_0x1e78('0x10'),_0x1e78('0x11'),_0x1e78('0x12'),_0x1e78('0x13'),_0x1e78('0x14'),_0x1e78('0x15'),_0x1e78('0x16'),_0x1e78('0x17'),_0x1e78('0x18'),'dialGlobalMaxRetry',_0x1e78('0x19'),_0x1e78('0x1a'),_0x1e78('0x1b'),_0x1e78('0x1c'),_0x1e78('0x1d'),_0x1e78('0x1e'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x1e78('0x1f'),_0x1e78('0x20'),_0x1e78('0x21'),_0x1e78('0x22'),_0x1e78('0x23'),_0x1e78('0x24'),_0x1e78('0x25'),'dialRecallMeTimeout','dialRecallInQueue',_0x1e78('0x26'),_0x1e78('0x27'),'dialAgiAfterHangupClient',_0x1e78('0x28'),_0x1e78('0x29'),'strategy',_0x1e78('0x2a'),_0x1e78('0x2b'),_0x1e78('0x2c'),_0x1e78('0x2d'),'dialDropMaxRetry',_0x1e78('0x2e'),_0x1e78('0x2f'),_0x1e78('0x30'),'dialMachineMaxRetry',_0x1e78('0x31'),_0x1e78('0x32'),'dialAgentRejectRetryFrequency',_0x1e78('0x33'),_0x1e78('0x34'),_0x1e78('0x35')],'include':[{'model':_0x1e78('0x36'),'as':_0x1e78('0x36'),'attributes':['id',_0x1e78('0x3'),_0x1e78('0x37'),'active']},{'model':_0x1e78('0x38'),'as':_0x1e78('0x39'),'attributes':['id',_0x1e78('0x3')]},{'model':_0x1e78('0x36'),'as':'TrunkBackup','attributes':['id','name','callerid',_0x1e78('0x3a')]},{'model':_0x1e78('0x3b'),'as':_0x1e78('0x3b'),'attributes':['id',_0x1e78('0x3')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x1e78('0x0')});};}; \ No newline at end of file +var _0x09c9=['type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialMachineMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','monitor_format'];(function(_0x3bf067,_0x5af22f){var _0x4fa49b=function(_0x54baf6){while(--_0x54baf6){_0x3bf067['push'](_0x3bf067['shift']());}};_0x4fa49b(++_0x5af22f);}(_0x09c9,0x1aa));var _0x909c=function(_0x40423c,_0x40fc79){_0x40423c=_0x40423c-0x0;var _0x2da581=_0x09c9[_0x40423c];return _0x2da581;};'use strict';var client=require('../client');exports[_0x909c('0x0')]=function(){return function(){return client[_0x909c('0x1')](_0x909c('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x909c('0x3'),'acwTimeout',_0x909c('0x4'),_0x909c('0x5'),_0x909c('0x6'),_0x909c('0x7'),_0x909c('0x8'),_0x909c('0x9'),'dialLimitQueue',_0x909c('0xa'),_0x909c('0xb'),'dialPredictiveOptimizationPercentage',_0x909c('0xc'),_0x909c('0xd'),_0x909c('0xe'),_0x909c('0xf'),_0x909c('0x10'),'dialQueueTimeout','dialQueueProject',_0x909c('0x11'),_0x909c('0x12'),_0x909c('0x13'),_0x909c('0x14'),_0x909c('0x15'),_0x909c('0x16'),_0x909c('0x17'),'dialTimezone','dialGlobalInterval','dialPrefix',_0x909c('0x18'),_0x909c('0x19'),'dialAMDInitialSilence',_0x909c('0x1a'),_0x909c('0x1b'),_0x909c('0x1c'),_0x909c('0x1d'),_0x909c('0x1e'),_0x909c('0x1f'),_0x909c('0x20'),'dialAMDMaximumWordLength',_0x909c('0x21'),'dialRecallMeTimeout','dialRecallInQueue',_0x909c('0x22'),_0x909c('0x23'),'dialAgiAfterHangupClient',_0x909c('0x24'),_0x909c('0x5'),_0x909c('0x25'),_0x909c('0x26'),_0x909c('0x27'),'dialNoSuchNumberMaxRetry',_0x909c('0x28'),'dialDropMaxRetry',_0x909c('0x29'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x909c('0x2a'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x909c('0x2b'),_0x909c('0x2c'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x909c('0x2d'),'as':'Trunk','attributes':['id',_0x909c('0x2e'),_0x909c('0x2f'),_0x909c('0x30')]},{'model':'Pause','as':_0x909c('0x31'),'attributes':['id',_0x909c('0x2e')]},{'model':_0x909c('0x2d'),'as':_0x909c('0x32'),'attributes':['id',_0x909c('0x2e'),'callerid',_0x909c('0x30')]},{'model':_0x909c('0x33'),'as':_0x909c('0x33'),'attributes':['id',_0x909c('0x2e')],'include':[{'model':_0x909c('0x33'),'as':_0x909c('0x34'),'attributes':['id',_0x909c('0x2e'),_0x909c('0x35')]}]}]},'log':_0x909c('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 49c8984..9b894b7 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(_0x1e5067,_0x1c47d6){var _0x315b32=function(_0x1cbe3f){while(--_0x1cbe3f){_0x1e5067['push'](_0x1e5067['shift']());}};_0x315b32(++_0x1c47d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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(_0x25fbd9,_0x1c5a4d){var _0x2bf713=function(_0x3bb6f4){while(--_0x3bb6f4){_0x25fbd9['push'](_0x25fbd9['shift']());}};_0x2bf713(++_0x1c5a4d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 8d11909..eab6082 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 _0x3b64=['../client','GetVoiceQueueRtPauses'];(function(_0x3f2228,_0x3b27d5){var _0x285ae4=function(_0x5e1f23){while(--_0x5e1f23){_0x3f2228['push'](_0x3f2228['shift']());}};_0x285ae4(++_0x3b27d5);}(_0x3b64,0xa6));var _0x43b6=function(_0x5a149e,_0x3de1e4){_0x5a149e=_0x5a149e-0x0;var _0x33b2d4=_0x3b64[_0x5a149e];return _0x33b2d4;};'use strict';var client=require(_0x43b6('0x0'));exports['getVoiceQueueRtPauses']=function(_0x1d72a3){return function(){return client['Request'](_0x43b6('0x1'),{'options':{'where':{'VoiceQueueId':_0x1d72a3,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x3124=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x32b25f,_0x395ee4){var _0x1f808a=function(_0x1a7c0d){while(--_0x1a7c0d){_0x32b25f['push'](_0x32b25f['shift']());}};_0x1f808a(++_0x395ee4);}(_0x3124,0x13f));var _0x4312=function(_0x36bc8f,_0x1c9e6c){_0x36bc8f=_0x36bc8f-0x0;var _0x3497d3=_0x3124[_0x36bc8f];return _0x3497d3;};'use strict';var client=require(_0x4312('0x0'));exports[_0x4312('0x1')]=function(_0x125317){return function(){return client[_0x4312('0x2')](_0x4312('0x3'),{'options':{'where':{'VoiceQueueId':_0x125317,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 241b2c1..080da6f 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3878eb,_0x242744){var _0x23eb00=function(_0x3a4f50){while(--_0x3a4f50){_0x3878eb['push'](_0x3878eb['shift']());}};_0x23eb00(++_0x242744);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x20dba9,_0x477048){var _0x1ad894=function(_0x96dfc2){while(--_0x96dfc2){_0x20dba9['push'](_0x20dba9['shift']());}};_0x1ad894(++_0x477048);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 e1735dc..0a21007 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 _0x8c50=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transferercontext','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereecontext','transfereeexten','isexternal','context','blind','Request','origtransfererchannel'];(function(_0x10c6d0,_0x2c6cba){var _0x231834=function(_0x1e0339){while(--_0x1e0339){_0x10c6d0['push'](_0x10c6d0['shift']());}};_0x231834(++_0x2c6cba);}(_0x8c50,0x1b5));var _0x08c5=function(_0x25e9d0,_0x13760a){_0x25e9d0=_0x25e9d0-0x0;var _0x4928fe=_0x8c50[_0x25e9d0];return _0x4928fe;};'use strict';var client=require(_0x08c5('0x0'));exports['transfers']={};exports[_0x08c5('0x1')]=function(_0x54cdb7){return client['Request'](_0x08c5('0x2'),{'body':{'result':_0x54cdb7[_0x08c5('0x3')],'transfererchannel':_0x54cdb7[_0x08c5('0x4')],'transferercalleridnum':_0x54cdb7[_0x08c5('0x5')],'transferercalleridname':_0x54cdb7['transferercalleridname'],'transfererconnectedlinenum':_0x54cdb7[_0x08c5('0x6')],'transfererconnectedlinename':_0x54cdb7['transfererconnectedlinename'],'transfereraccountcode':_0x54cdb7['transfereraccountcode'],'transferercontext':_0x54cdb7[_0x08c5('0x7')],'transfererexten':_0x54cdb7[_0x08c5('0x8')],'transfererlinkedid':_0x54cdb7['transfererlinkedid'],'transfereechannel':_0x54cdb7['transfereechannel'],'transfereecalleridnum':_0x54cdb7[_0x08c5('0x9')],'transfereecalleridname':_0x54cdb7[_0x08c5('0xa')],'transfereeconnectedlinenum':_0x54cdb7[_0x08c5('0xb')],'transfereeconnectedlinename':_0x54cdb7['transfereeconnectedlinename'],'transfereeaccountcode':_0x54cdb7['transfereeaccountcode'],'transfereecontext':_0x54cdb7[_0x08c5('0xc')],'transfereeexten':_0x54cdb7[_0x08c5('0xd')],'transfereelinkedid':_0x54cdb7['transfereelinkedid'],'isexternal':_0x54cdb7[_0x08c5('0xe')],'context':_0x54cdb7[_0x08c5('0xf')],'extension':_0x54cdb7['extension'],'type':_0x08c5('0x10')},'log':_0x08c5('0x2')});};exports['attendedTransfer']=function(_0x5a8569){return client[_0x08c5('0x11')](_0x08c5('0x2'),{'body':{'result':_0x5a8569[_0x08c5('0x3')],'transfererchannel':_0x5a8569[_0x08c5('0x12')],'transferercalleridnum':_0x5a8569[_0x08c5('0x13')],'transferercalleridname':_0x5a8569[_0x08c5('0x14')],'transfererconnectedlinenum':_0x5a8569[_0x08c5('0x15')],'transfererconnectedlinename':_0x5a8569[_0x08c5('0x16')],'transfereraccountcode':_0x5a8569['origtransfereraccountcode'],'transferercontext':_0x5a8569[_0x08c5('0x17')],'transfererexten':_0x5a8569[_0x08c5('0x18')],'transfererlinkedid':_0x5a8569[_0x08c5('0x19')],'transfereechannel':_0x5a8569[_0x08c5('0x1a')],'transfereecalleridnum':_0x5a8569[_0x08c5('0x1b')],'transfereecalleridname':_0x5a8569[_0x08c5('0x1c')],'transfereeconnectedlinenum':_0x5a8569[_0x08c5('0x1d')],'transfereeconnectedlinename':_0x5a8569[_0x08c5('0x1e')],'transfereeaccountcode':_0x5a8569[_0x08c5('0x1f')],'transfereecontext':_0x5a8569[_0x08c5('0x20')],'transfereeexten':_0x5a8569[_0x08c5('0x21')],'transfereelinkedid':_0x5a8569[_0x08c5('0x22')],'isexternal':_0x5a8569[_0x08c5('0xe')],'context':_0x5a8569[_0x08c5('0x23')],'extension':_0x5a8569[_0x08c5('0x24')],'type':_0x08c5('0x25')},'log':_0x08c5('0x2')});}; \ No newline at end of file +var _0xfa86=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','blindTransfer','Request','result','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeexten','isexternal','context','extension','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x4af895,_0x5537e8){var _0x9da56d=function(_0x4ee96a){while(--_0x4ee96a){_0x4af895['push'](_0x4af895['shift']());}};_0x9da56d(++_0x5537e8);}(_0xfa86,0xf1));var _0x6fa8=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0xfa86[_0x334fea];return _0x3c5829;};'use strict';var client=require(_0x6fa8('0x0'));exports[_0x6fa8('0x1')]={};exports[_0x6fa8('0x2')]=function(_0x8f52c0){return client[_0x6fa8('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x8f52c0[_0x6fa8('0x4')],'transfererchannel':_0x8f52c0['transfererchannel'],'transferercalleridnum':_0x8f52c0['transferercalleridnum'],'transferercalleridname':_0x8f52c0[_0x6fa8('0x5')],'transfererconnectedlinenum':_0x8f52c0['transfererconnectedlinenum'],'transfererconnectedlinename':_0x8f52c0[_0x6fa8('0x6')],'transfereraccountcode':_0x8f52c0[_0x6fa8('0x7')],'transferercontext':_0x8f52c0[_0x6fa8('0x8')],'transfererexten':_0x8f52c0[_0x6fa8('0x9')],'transfererlinkedid':_0x8f52c0[_0x6fa8('0xa')],'transfereechannel':_0x8f52c0[_0x6fa8('0xb')],'transfereecalleridnum':_0x8f52c0['transfereecalleridnum'],'transfereecalleridname':_0x8f52c0['transfereecalleridname'],'transfereeconnectedlinenum':_0x8f52c0[_0x6fa8('0xc')],'transfereeconnectedlinename':_0x8f52c0[_0x6fa8('0xd')],'transfereeaccountcode':_0x8f52c0['transfereeaccountcode'],'transfereecontext':_0x8f52c0['transfereecontext'],'transfereeexten':_0x8f52c0[_0x6fa8('0xe')],'transfereelinkedid':_0x8f52c0['transfereelinkedid'],'isexternal':_0x8f52c0[_0x6fa8('0xf')],'context':_0x8f52c0[_0x6fa8('0x10')],'extension':_0x8f52c0[_0x6fa8('0x11')],'type':_0x6fa8('0x12')},'log':_0x6fa8('0x13')});};exports['attendedTransfer']=function(_0x426aba){return client[_0x6fa8('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x426aba['result'],'transfererchannel':_0x426aba[_0x6fa8('0x14')],'transferercalleridnum':_0x426aba[_0x6fa8('0x15')],'transferercalleridname':_0x426aba['origtransferercalleridname'],'transfererconnectedlinenum':_0x426aba[_0x6fa8('0x16')],'transfererconnectedlinename':_0x426aba[_0x6fa8('0x17')],'transfereraccountcode':_0x426aba[_0x6fa8('0x18')],'transferercontext':_0x426aba[_0x6fa8('0x19')],'transfererexten':_0x426aba[_0x6fa8('0x1a')],'transfererlinkedid':_0x426aba[_0x6fa8('0x1b')],'transfereechannel':_0x426aba[_0x6fa8('0x1c')],'transfereecalleridnum':_0x426aba[_0x6fa8('0x1d')],'transfereecalleridname':_0x426aba[_0x6fa8('0x1e')],'transfereeconnectedlinenum':_0x426aba['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x426aba[_0x6fa8('0x1f')],'transfereeaccountcode':_0x426aba[_0x6fa8('0x20')],'transfereecontext':_0x426aba[_0x6fa8('0x21')],'transfereeexten':_0x426aba[_0x6fa8('0x22')],'transfereelinkedid':_0x426aba[_0x6fa8('0x23')],'isexternal':_0x426aba[_0x6fa8('0xf')],'context':_0x426aba[_0x6fa8('0x24')],'extension':_0x426aba['origtransfererexten'],'type':_0x6fa8('0x25')},'log':_0x6fa8('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 7173a57..eccd459 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 _0xcde7=['loggedIn','sumBillable','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','find','omit','undefined','values','channels','length','voicechannel','map','%s.%s','uniqueid','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','push','rec','mixmonitorid','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','filename','toLowerCase','StopMixMonitor\x20Success','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','campaigns','event','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','validate','bluebird','../properties','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','username','command','voiceQueues','hasOwnProperty','strategy','answered','available'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcde7,0x65));var _0x7cde=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcde7[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x7cde('0x0'));var schema=require(_0x7cde('0x1'));var BPromise=require(_0x7cde('0x2'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x7cde('0x3'));var ami=require('../ami');exports[_0x7cde('0x4')]=function(_0x5824bf,_0x18529,_0x293f70){return new BPromise(function(_0xbaa4b3,_0x15b9ec){var _0x5c8606={'QueuePause':function(_0x20e8cd){return new Promise(function(_0x512fae,_0x236dbd){var _0x18d4c5=util[_0x7cde('0x5')](_0x7cde('0x6'),'SIP',_0x20e8cd[_0x7cde('0x7')]);if(_0x5824bf[_0x7cde('0x8')]&&_0x5824bf[_0x7cde('0x8')][_0x18d4c5]&&_0x5824bf[_0x7cde('0x8')][_0x18d4c5][_0x7cde('0x9')]){_0x5824bf[_0x7cde('0x8')][_0x18d4c5][_0x7cde('0xa')]();}if(_0x5824bf[_0x7cde('0xb')][_0x18d4c5]){_0x5824bf[_0x7cde('0xb')][_0x18d4c5][_0x7cde('0xc')]({'statePause':_0x20e8cd['pause']?!![]:![]});}_0x512fae({'code':0xc8,'message':_0x7cde('0xd')});});},'Reload':function(_0x7084b7){var _0x1a8ed8=this;return new Promise(function(_0x1c51b2,_0x10ed91){if(ami[_0x7cde('0xe')]()==![]){return _0x10ed91(_0x1a8ed8[_0x7cde('0xf')](0x1f4,[config[_0x7cde('0x10')]['ip'],config[_0x7cde('0x10')]['username'],_0x7cde('0x11')][_0x7cde('0x12')]('\x20')));}_0x7084b7=_[_0x7cde('0x13')](_0x7084b7,_[_0x7cde('0x14')](properties[_0x7cde('0x15')]));_0x7084b7[_0x7cde('0x16')]=_0x7cde('0x17');return ami[_0x7cde('0x18')](_0x7084b7)[_0x7cde('0x19')](function(_0x1d8924){_0x1c51b2({'code':0xc8,'message':_0x1d8924[_0x7cde('0x1a')]});})[_0x7cde('0x1b')](function(_0x3b1e08){_0x10ed91(_0x1a8ed8['error'](0x1f5,_0x3b1e08[_0x7cde('0x1a')]));});});},'Command':function(_0x19c662){var _0xf257a5=this;return new Promise(function(_0x5c6875,_0x248e95){if(ami[_0x7cde('0xe')]()==![]){return _0x248e95(_0xf257a5['error'](0x1f4,[config[_0x7cde('0x10')]['ip'],config[_0x7cde('0x10')][_0x7cde('0x1c')],_0x7cde('0x11')][_0x7cde('0x12')]('\x20')));}_0x19c662=_[_0x7cde('0x13')](_0x19c662,_0x7cde('0x1d'));_0x19c662[_0x7cde('0x16')]='Command';return ami[_0x7cde('0x18')](_0x19c662)['then'](function(_0x5735fe){_0x5c6875({'code':0xc8,'message':_0x5735fe['content']});})[_0x7cde('0x1b')](function(_0x584ffc){_0x248e95(_0xf257a5[_0x7cde('0xf')](0x1f5,_0x584ffc[_0x7cde('0x1a')]));});});},'VoiceQueues':function(_0x16439a){return new Promise(function(_0x5596b3,_0x4b25e3){var _0x219296=[];for(var _0x591cfa in _0x5824bf[_0x7cde('0x1e')]){if(_0x5824bf[_0x7cde('0x1e')][_0x7cde('0x1f')](_0x591cfa)){var _0x4b28b2=_0x5824bf[_0x7cde('0x1e')][_0x591cfa];var _0x44d650={'id':_0x4b28b2['id'],'name':_0x4b28b2['name'],'strategy':_0x4b28b2[_0x7cde('0x20')],'answered':_0x4b28b2[_0x7cde('0x21')],'available':_0x4b28b2[_0x7cde('0x22')],'loggedIn':_0x4b28b2[_0x7cde('0x23')],'pTalking':_0x4b28b2['pTalking'],'sumBillable':_0x4b28b2[_0x7cde('0x24')],'sumDuration':_0x4b28b2['sumDuration'],'sumHoldTime':_0x4b28b2['sumHoldTime']||0x0,'talking':_0x4b28b2[_0x7cde('0x25')],'total':_0x4b28b2[_0x7cde('0x26')],'type':_0x4b28b2[_0x7cde('0x27')],'unmanaged':_0x4b28b2[_0x7cde('0x28')],'abandoned':_0x4b28b2[_0x7cde('0x29')],'waiting':_0x4b28b2[_0x7cde('0x2a')],'loggedInDb':_0x4b28b2['loggedInDb']};if(_0x4b28b2['type']===_0x7cde('0x2b')){_0x44d650[_0x7cde('0x2c')]=_0x4b28b2[_0x7cde('0x2c')];_0x44d650[_0x7cde('0x2d')]=_0x4b28b2['dialMethod'];_0x44d650['dialOriginateCallerIdName']=_0x4b28b2[_0x7cde('0x2e')];_0x44d650[_0x7cde('0x2f')]=_0x4b28b2[_0x7cde('0x2f')];_0x44d650[_0x7cde('0x30')]=_0x4b28b2[_0x7cde('0x30')];_0x44d650['dialPrefix']=_0x4b28b2['dialPrefix'];_0x44d650[_0x7cde('0x31')]=_0x4b28b2[_0x7cde('0x31')];_0x44d650[_0x7cde('0x32')]=_0x4b28b2[_0x7cde('0x32')];_0x44d650[_0x7cde('0x33')]=_0x4b28b2['outboundAnswerCallsDay'];_0x44d650[_0x7cde('0x34')]=_0x4b28b2[_0x7cde('0x34')];_0x44d650[_0x7cde('0x35')]=_0x4b28b2[_0x7cde('0x35')];_0x44d650[_0x7cde('0x36')]=_0x4b28b2['outboundCongestionCallsDay'];_0x44d650[_0x7cde('0x37')]=_0x4b28b2[_0x7cde('0x37')];_0x44d650[_0x7cde('0x38')]=_0x4b28b2[_0x7cde('0x38')];_0x44d650[_0x7cde('0x39')]=_0x4b28b2[_0x7cde('0x39')];_0x44d650[_0x7cde('0x3a')]=_0x4b28b2[_0x7cde('0x3a')];_0x44d650[_0x7cde('0x3b')]=_0x4b28b2[_0x7cde('0x3b')];_0x44d650[_0x7cde('0x3c')]=_0x4b28b2[_0x7cde('0x3c')];_0x44d650[_0x7cde('0x3d')]=_0x4b28b2['outboundReCallsDay'];_0x44d650[_0x7cde('0x3e')]=_0x4b28b2[_0x7cde('0x3e')];_0x44d650[_0x7cde('0x3f')]=_0x4b28b2[_0x7cde('0x3f')];_0x44d650[_0x7cde('0x40')]=_0x4b28b2[_0x7cde('0x40')];_0x44d650[_0x7cde('0x41')]=_0x4b28b2[_0x7cde('0x41')];_0x44d650[_0x7cde('0x42')]=_0x4b28b2[_0x7cde('0x42')];_0x44d650[_0x7cde('0x43')]=_0x4b28b2[_0x7cde('0x43')];_0x44d650['predictiveIntervalDroppedCallsTimeout']=_0x4b28b2[_0x7cde('0x44')];_0x44d650[_0x7cde('0x45')]=_0x4b28b2[_0x7cde('0x45')];_0x44d650[_0x7cde('0x46')]=_0x4b28b2[_0x7cde('0x46')];_0x44d650['predictiveIntervalHitRate']=_0x4b28b2[_0x7cde('0x47')];_0x44d650[_0x7cde('0x48')]=_0x4b28b2[_0x7cde('0x48')];_0x44d650['predictiveIntervalPauses']=_0x4b28b2['predictiveIntervalPauses'];_0x44d650[_0x7cde('0x49')]=_0x4b28b2['predictiveIntervalAvailable'];_0x44d650['predictiveIntervalTotalCalls']=_0x4b28b2[_0x7cde('0x4a')];_0x44d650[_0x7cde('0x1a')]=_0x4b28b2[_0x7cde('0x1a')];_0x44d650[_0x7cde('0x4b')]=_0x4b28b2[_0x7cde('0x4b')];_0x44d650['erlangCalls']=_0x4b28b2['erlangCalls'];_0x44d650['erlangCallToSecond']=_0x4b28b2[_0x7cde('0x4c')];_0x44d650[_0x7cde('0x4d')]=_0x4b28b2[_0x7cde('0x4d')];_0x44d650['erlangBusyFactor']=_0x4b28b2[_0x7cde('0x4e')];_0x44d650[_0x7cde('0x4f')]=_0x4b28b2[_0x7cde('0x4f')];_0x44d650[_0x7cde('0x50')]=_0x4b28b2[_0x7cde('0x50')];}if(_0x4b28b2[_0x7cde('0x51')]){_0x44d650[_0x7cde('0x51')]={'id':_0x4b28b2[_0x7cde('0x51')]['id'],'name':_0x4b28b2[_0x7cde('0x51')][_0x7cde('0x7')],'active':_0x4b28b2[_0x7cde('0x51')][_0x7cde('0x52')],'callerid':_0x4b28b2[_0x7cde('0x51')][_0x7cde('0x53')]};}if(_0x4b28b2['Interval']){_0x44d650[_0x7cde('0x54')]={'id':_0x4b28b2[_0x7cde('0x54')]['id'],'name':_0x4b28b2['Interval'][_0x7cde('0x7')]};}_0x219296['push'](_0x44d650);}}_0x5596b3({'count':_0x219296['length'],'rows':_0x219296});});},'UpdateVoiceQueue':function(_0x13f1a1){return new Promise(function(_0x479436,_0x2bab9b){var _0x43f02a=_[_0x7cde('0x55')](_0x5824bf[_0x7cde('0x1e')],{'id':parseInt(_0x13f1a1['id'])});var _0xd044d0=_[_0x7cde('0x56')](_0x13f1a1,['id']);if(_0x43f02a){for(var _0x1c7484 in _0xd044d0){if(typeof _0xd044d0[_0x1c7484]!==_0x7cde('0x57')&&typeof _0x43f02a[_0x1c7484]!=='undefined'){_0x43f02a[_0x1c7484]=_0xd044d0[_0x1c7484];}}_0x479436(_0x43f02a);}else{_0x2bab9b();}});},'VoiceChannels':function(_0x56e8a2){return new Promise(function(_0x9cc9c1,_0x3a742a){var _0x5da2bf=_[_0x7cde('0x58')](_0x5824bf[_0x7cde('0x59')]);_0x9cc9c1({'count':_0x5da2bf[_0x7cde('0x5a')],'rows':_0x5da2bf});});},'VoiceChannelMixMonitor':function(_0x288c8c){var _0x41d429=this;return new Promise(function(_0x32bb00,_0x5cda24){if(ami[_0x7cde('0xe')]()==![]){return _0x5cda24(_0x41d429[_0x7cde('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x7cde('0x10')][_0x7cde('0x1c')],_0x7cde('0x11')][_0x7cde('0x12')]('\x20')));}var _0x300da1=schema(properties[_0x7cde('0x5b')])[_0x7cde('0x1')](_0x288c8c);if(_0x300da1[_0x7cde('0x5a')]>0x0){return _0x5cda24(_0x41d429['error'](0x1f4,_[_0x7cde('0x5c')](_0x300da1,'message')[_0x7cde('0x12')](',\x20')));}var _0x3a9acc=_[_0x7cde('0x55')](_0x5824bf[_0x7cde('0x59')],{'uniqueid':_0x288c8c['uniqueid']});if(_0x3a9acc&&_0x3a9acc['channel']){var _0x1db1cb=util[_0x7cde('0x5')](_0x7cde('0x5d'),_0x288c8c['filename']||_0x288c8c[_0x7cde('0x5e')],_0x288c8c['format']||_0x7cde('0x5f'));return ami[_0x7cde('0x18')]({'action':_0x7cde('0x60'),'channel':_0x3a9acc[_0x7cde('0x61')],'file':_0x1db1cb,'options':_0x7cde('0x62')})[_0x7cde('0x19')](function(_0xec2f76){var _0x336fa0=_[_0x7cde('0x55')](_0x3a9acc[_0x7cde('0x63')],{'filename':_0x7cde('0x64')+_0x1db1cb['toLowerCase']()});if(_['isNil'](_0x336fa0)){_0x3a9acc[_0x7cde('0x63')][_0x7cde('0x65')]({'filename':_0x7cde('0x64')+_0x1db1cb['toLowerCase'](),'createdAt':moment()[_0x7cde('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0xec2f76['mixmonitorid'],'status':_0x7cde('0x66')});}else{_0x336fa0[_0x7cde('0x67')]=_0xec2f76['mixmonitorid'];_0x336fa0[_0x7cde('0x68')]=_0x7cde('0x66');}_0x32bb00({'code':0xc8,'message':[_0x288c8c[_0x7cde('0x5e')],_0x7cde('0x69'),_0xec2f76[_0x7cde('0x67')]][_0x7cde('0x12')]('\x20'),'mixmonitorid':_0xec2f76[_0x7cde('0x67')]});})[_0x7cde('0x1b')](function(_0x474ea7){_0x5cda24(_0x41d429['error'](0x1f5,[_0x288c8c['uniqueid'],_0x474ea7[_0x7cde('0x1a')]['toLowerCase']()]['join']('\x20')));});}else{return _0x5cda24(_0x41d429[_0x7cde('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2008e6){var _0xc35c60=this;return new Promise(function(_0x5229e4,_0x4029a0){if(ami['isConnected']()==![]){return _0x4029a0(_0xc35c60[_0x7cde('0xf')](0x1f4,[config[_0x7cde('0x10')]['ip'],config['asterisk'][_0x7cde('0x1c')],'ami\x20disconnected']['join']('\x20')));}var _0x11dce0=schema(properties['voicechannel'])[_0x7cde('0x1')](_0x2008e6);if(_0x11dce0[_0x7cde('0x5a')]>0x0){return _0x4029a0(_0xc35c60[_0x7cde('0xf')](0x1f4,_['map'](_0x11dce0,_0x7cde('0x1a'))[_0x7cde('0x12')](',\x20')));}var _0x174003=_[_0x7cde('0x55')](_0x5824bf[_0x7cde('0x59')],{'uniqueid':_0x2008e6[_0x7cde('0x5e')]});if(_0x174003){return BPromise[_0x7cde('0x6a')]()[_0x7cde('0x19')](function(){if(_0x174003['channel']){return ami[_0x7cde('0x18')]({'action':_0x7cde('0x6b'),'channel':_0x174003['channel'],'mixmonitorid':_0x2008e6[_0x7cde('0x67')]})[_0x7cde('0x1b')](function(_0x13deb6){});}})[_0x7cde('0x19')](function(){if(_0x174003[_0x7cde('0x6c')]){return ami[_0x7cde('0x18')]({'action':_0x7cde('0x6b'),'channel':_0x174003[_0x7cde('0x6c')],'mixmonitorid':_0x2008e6['mixmonitorid']})['catch'](function(_0x337399){});}})[_0x7cde('0x19')](function(_0x30a40d){var _0x3b9f73=_[_0x7cde('0x55')](_0x174003[_0x7cde('0x63')],{'mixmonitorid':_0x2008e6['mixmonitorid']});if(_0x3b9f73){_0x3b9f73[_0x7cde('0x68')]=_0x7cde('0x6d');}})[_0x7cde('0x19')](function(){var _0x37bff8=util[_0x7cde('0x5')](_0x7cde('0x5d'),_0x2008e6[_0x7cde('0x6e')]||_0x2008e6['uniqueid'],_0x2008e6[_0x7cde('0x5')]||'wav');var _0x33ef15=_[_0x7cde('0x55')](_0x174003[_0x7cde('0x63')],{'filename':_0x7cde('0x64')+_0x37bff8[_0x7cde('0x6f')]()});if(_0x33ef15){_0x33ef15[_0x7cde('0x68')]=_0x7cde('0x6d');}})[_0x7cde('0x19')](function(){_0x5229e4({'code':0xc8,'message':[_0x2008e6[_0x7cde('0x5e')],_0x7cde('0x70')][_0x7cde('0x12')]('\x20')});})['catch'](function(_0x558680){_0x4029a0(_0xc35c60[_0x7cde('0xf')](0x1f5,[_0x2008e6[_0x7cde('0x5e')],_0x558680[_0x7cde('0x1a')][_0x7cde('0x6f')]()][_0x7cde('0x12')]('\x20')));});}else{return _0x4029a0(_0xc35c60[_0x7cde('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x123fd2){return new Promise(function(_0x59d0b2,_0x5da602){var _0x67c67d=_[_0x7cde('0x58')](_0x5824bf['queueChannels']);_0x59d0b2({'count':_0x67c67d[_0x7cde('0x5a')],'rows':_0x67c67d});});},'VoiceQueuesChannel':function(_0x4675e3){var _0x15f470=this;return new Promise(function(_0x3123ea,_0x125382){var _0x4e577d=schema(properties[_0x7cde('0x71')])[_0x7cde('0x1')](_0x4675e3);if(_0x4e577d['length']>0x0){return _0x125382(_0x15f470['error'](0x1f4,_[_0x7cde('0x5c')](_0x4e577d,_0x7cde('0x1a'))['join'](',\x20')));}var _0x3bbe23=_[_0x7cde('0x55')](_0x5824bf['queueChannels'],{'uniqueid':_0x4675e3['uniqueid']});if(_0x3bbe23){_0x3123ea(_0x3bbe23);}else{return _0x125382(_0x15f470[_0x7cde('0xf')](0x1f5,_0x7cde('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x3f69f8){var _0x1af0ab=this;return new Promise(function(_0x25e6d8,_0x4baa5d){if(ami[_0x7cde('0xe')]()==![]){return _0x4baa5d(_0x1af0ab[_0x7cde('0xf')](0x1f4,[config[_0x7cde('0x10')]['ip'],config[_0x7cde('0x10')][_0x7cde('0x1c')],_0x7cde('0x11')][_0x7cde('0x12')]('\x20')));}var _0x178e7f=schema(properties[_0x7cde('0x73')])[_0x7cde('0x1')](_0x3f69f8);if(_0x178e7f[_0x7cde('0x5a')]>0x0){return _0x4baa5d(_0x1af0ab['error'](0x1f4,_[_0x7cde('0x5c')](_0x178e7f,'message')[_0x7cde('0x12')](',\x20')));}var _0x771eff=_[_0x7cde('0x55')](_0x5824bf[_0x7cde('0x74')],{'uniqueid':_0x3f69f8[_0x7cde('0x5e')]});if(_0x771eff&&_0x771eff[_0x7cde('0x61')]){return ami['Action']({'action':_0x7cde('0x75'),'channel':_0x771eff[_0x7cde('0x61')]})['then'](function(_0x5d6a92){_0x25e6d8({'code':0xc8,'message':[_0x3f69f8['uniqueid'],_0x5d6a92['message']['toLowerCase']()]['join']('\x20')});})[_0x7cde('0x1b')](function(_0x192c00){_0x4baa5d(_0x1af0ab[_0x7cde('0xf')](0x1f5,[_0x3f69f8['uniqueid'],_0x192c00[_0x7cde('0x1a')][_0x7cde('0x6f')]()][_0x7cde('0x12')]('\x20')));});}else{return _0x4baa5d(_0x1af0ab[_0x7cde('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1511b5){var _0x576f65=this;return new Promise(function(_0x865824,_0x2ddaa6){if(ami[_0x7cde('0xe')]()==![]){return _0x2ddaa6(_0x576f65[_0x7cde('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x7cde('0x10')][_0x7cde('0x1c')],_0x7cde('0x11')][_0x7cde('0x12')]('\x20')));}var _0x15a8ce=schema(properties[_0x7cde('0x76')])[_0x7cde('0x1')](_0x1511b5);if(_0x15a8ce[_0x7cde('0x5a')]>0x0){return _0x2ddaa6(_0x576f65[_0x7cde('0xf')](0x1f4,_[_0x7cde('0x5c')](_0x15a8ce,_0x7cde('0x1a'))[_0x7cde('0x12')](',\x20')));}var _0x10d678=_[_0x7cde('0x55')](_0x5824bf['queueChannels'],{'uniqueid':_0x1511b5[_0x7cde('0x5e')]});if(_0x10d678&&_0x10d678['channel']){return ami[_0x7cde('0x18')]({'action':_0x7cde('0x77'),'channel':_0x10d678[_0x7cde('0x61')],'exten':_0x1511b5[_0x7cde('0x78')],'context':_0x1511b5['context']||_0x10d678['context'],'priority':0x1})[_0x7cde('0x19')](function(_0x5bd3ea){_0x865824({'code':0xc8,'message':[_0x1511b5['uniqueid'],_0x5bd3ea[_0x7cde('0x1a')][_0x7cde('0x6f')]()][_0x7cde('0x12')]('\x20')});})[_0x7cde('0x1b')](function(_0x2b4a33){_0x2ddaa6(_0x576f65['error'](0x1f5,[_0x1511b5['uniqueid'],_0x2b4a33[_0x7cde('0x1a')][_0x7cde('0x6f')]()][_0x7cde('0x12')]('\x20')));});}else{return _0x2ddaa6(_0x576f65[_0x7cde('0xf')](0x1f5,_0x7cde('0x72')));}});},'Agents':function(_0xa8987a){return new Promise(function(_0x7d7e6c,_0x297c91){var _0x491e82=_['values'](_0x5824bf[_0x7cde('0xb')]);_0x7d7e6c({'count':_0x491e82[_0x7cde('0x5a')],'rows':_0x491e82});});},'Telephones':function(_0x4926c7){return new Promise(function(_0x2641c3,_0x294970){var _0x3360f5=_['values'](_0x5824bf[_0x7cde('0x79')]);_0x2641c3({'count':_0x3360f5[_0x7cde('0x5a')],'rows':_0x3360f5});});},'Trunks':function(_0x1b4cbe){return new Promise(function(_0x4e2227,_0x375820){var _0x2ebed9=_[_0x7cde('0x58')](_0x5824bf[_0x7cde('0x7a')]);_0x4e2227({'count':_0x2ebed9['length'],'rows':_0x2ebed9});});},'OutboundChannels':function(_0x5e9be1){return new Promise(function(_0x5a384e,_0x516a36){var _0x1e7b07=_[_0x7cde('0x58')](_0x5824bf[_0x7cde('0x7b')]);_0x5a384e({'count':_0x1e7b07[_0x7cde('0x5a')],'rows':_0x1e7b07});});},'Outbound':function(_0x40a9b2){return new Promise(function(_0x3c8c49,_0x3bf20f){_0x3c8c49(_0x5824bf[_0x7cde('0x2b')]);});},'Campaigns':function(_0x42ccb4){return new Promise(function(_0x246ffc,_0x173293){var _0x2abe76=_[_0x7cde('0x58')](_0x5824bf[_0x7cde('0x7c')]);_0x246ffc({'count':_0x2abe76[_0x7cde('0x5a')],'rows':_0x2abe76});});},'VoiceQueuesPreview':function(_0x389d20){var _0x140035=this;return new Promise(function(_0xccd918,_0x3ab58c){_0x18529['run'](_0x389d20['id'])[_0x7cde('0x19')](function(_0x476e79){_0xccd918({'code':0xc8,'message':_0x476e79[_0x7cde('0x1a')]});})[_0x7cde('0x1b')](function(_0x227183){_0x3ab58c(_0x140035[_0x7cde('0xf')](0x1f4,_0x227183[_0x7cde('0x1a')]));});});},'EventManager':function(_0x3a8fd5){var _0x24aa28=this;return new Promise(function(_0x120056,_0x23f20a){if(!_0x3a8fd5[_0x7cde('0x7d')]){return _0x23f20a(_0x24aa28[_0x7cde('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x7cde('0x7e')+_0x3a8fd5[_0x7cde('0x7d')],_0x3a8fd5['message']);_0x120056({'code':0xc8,'message':_0x3a8fd5});});},'FaxAccounts':function(_0x4ca086){return new Promise(function(_0x55c61d,_0x496d87){var _0x372f33=_[_0x7cde('0x58')](_0x5824bf[_0x7cde('0x7f')]);_0x55c61d({'count':_0x372f33[_0x7cde('0x5a')],'rows':_0x372f33});});},'SendFax':function(_0x48880b){var _0x4c988f=this;return new Promise(function(_0x5d26dc,_0x5ef6e2){_0x293f70[_0x7cde('0x80')](_0x48880b)[_0x7cde('0x19')](function(_0x170cfd){_0x5d26dc({'code':0xc8,'message':_0x170cfd[_0x7cde('0x1a')]});})[_0x7cde('0x1b')](function(_0x283b8e){_0x5ef6e2(_0x4c988f[_0x7cde('0xf')](0x1f4,_0x283b8e[_0x7cde('0x1a')]));});});},'CheckAfterSend':function(_0x30729d){var _0x502fdf=this;return new Promise(function(_0x4ec01c,_0x226f4d){_0x293f70[_0x7cde('0x81')](_0x30729d)[_0x7cde('0x19')](function(_0xd72cb0){_0x4ec01c({'code':0xc8,'message':_0xd72cb0['message']});})[_0x7cde('0x1b')](function(_0x592608){_0x226f4d(_0x502fdf[_0x7cde('0xf')](0x1f4,_0x592608[_0x7cde('0x1a')]));});});}};var _0x406679=jayson[_0x7cde('0x82')](_0x5c8606)[_0x7cde('0x83')]();_0x406679['on'](_0x7cde('0xf'),function(_0x5784d){return _0x15b9ec(_0x5784d);});_0x406679['listen'](0x232a,_0x7cde('0x84'),function(){console[_0x7cde('0x85')](_0x7cde('0x86'),0x232a);return _0xbaa4b3(_0x7cde('0x87')+0x232a);});});}; \ No newline at end of file +var _0x83d0=['%s.%s','filename','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','uniqueid','MixMonitor\x20Success','StopMixMonitor','destinationchannel','wav','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../properties','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','username','ami\x20disconnected','join','pick','keys','action','Action','then','message','catch','asterisk','Command','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','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','isConnected','voicechannel','map','channel','format'];(function(_0x5ccd90,_0x8f617){var _0x4f82b5=function(_0x11b2fd){while(--_0x11b2fd){_0x5ccd90['push'](_0x5ccd90['shift']());}};_0x4f82b5(++_0x8f617);}(_0x83d0,0xb7));var _0x083d=function(_0x5c808e,_0x1f319c){_0x5c808e=_0x5c808e-0x0;var _0x5c3bf3=_0x83d0[_0x5c808e];return _0x5c3bf3;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var jayson=require(_0x083d('0x2'));var schema=require(_0x083d('0x3'));var BPromise=require(_0x083d('0x4'));var moment=require(_0x083d('0x5'));var config=require('../../../config/environment');var properties=require(_0x083d('0x6'));var ami=require('../ami');exports['listen']=function(_0x404d77,_0x143ec8,_0x3c4b8c){return new BPromise(function(_0x2e75e8,_0x472c6b){var _0x52a3e7={'QueuePause':function(_0x4ec2e7){return new Promise(function(_0xddbf58,_0x32fa2c){var _0x3000d7=util['format'](_0x083d('0x7'),_0x083d('0x8'),_0x4ec2e7[_0x083d('0x9')]);if(_0x404d77[_0x083d('0xa')]&&_0x404d77['timers'][_0x3000d7]&&_0x404d77[_0x083d('0xa')][_0x3000d7]['timer']){_0x404d77[_0x083d('0xa')][_0x3000d7][_0x083d('0xb')]();}if(_0x404d77['agents'][_0x3000d7]){_0x404d77[_0x083d('0xc')][_0x3000d7][_0x083d('0xd')]({'statePause':_0x4ec2e7[_0x083d('0xe')]?!![]:![]});}_0xddbf58({'code':0xc8,'message':_0x083d('0xf')});});},'Reload':function(_0x3dfe4a){var _0x59fd41=this;return new Promise(function(_0xeb0ac2,_0x2266b2){if(ami['isConnected']()==![]){return _0x2266b2(_0x59fd41[_0x083d('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x083d('0x11')],_0x083d('0x12')][_0x083d('0x13')]('\x20')));}_0x3dfe4a=_[_0x083d('0x14')](_0x3dfe4a,_[_0x083d('0x15')](properties['module']));_0x3dfe4a[_0x083d('0x16')]='Reload';return ami[_0x083d('0x17')](_0x3dfe4a)[_0x083d('0x18')](function(_0x24708d){_0xeb0ac2({'code':0xc8,'message':_0x24708d[_0x083d('0x19')]});})[_0x083d('0x1a')](function(_0x63c0b6){_0x2266b2(_0x59fd41[_0x083d('0x10')](0x1f5,_0x63c0b6[_0x083d('0x19')]));});});},'Command':function(_0x160afb){var _0x2cb79c=this;return new Promise(function(_0x3ae260,_0xb8a16f){if(ami['isConnected']()==![]){return _0xb8a16f(_0x2cb79c[_0x083d('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x083d('0x1b')][_0x083d('0x11')],'ami\x20disconnected'][_0x083d('0x13')]('\x20')));}_0x160afb=_['pick'](_0x160afb,'command');_0x160afb['action']=_0x083d('0x1c');return ami[_0x083d('0x17')](_0x160afb)[_0x083d('0x18')](function(_0x2669b6){_0x3ae260({'code':0xc8,'message':_0x2669b6[_0x083d('0x1d')]});})[_0x083d('0x1a')](function(_0x5d8397){_0xb8a16f(_0x2cb79c[_0x083d('0x10')](0x1f5,_0x5d8397[_0x083d('0x19')]));});});},'VoiceQueues':function(_0x5e6e43){return new Promise(function(_0x3a0ce2,_0x38ca23){var _0x33d32a=[];for(var _0x3117af in _0x404d77[_0x083d('0x1e')]){if(_0x404d77[_0x083d('0x1e')][_0x083d('0x1f')](_0x3117af)){var _0x3923ff=_0x404d77['voiceQueues'][_0x3117af];var _0x6bccbd={'id':_0x3923ff['id'],'name':_0x3923ff['name'],'strategy':_0x3923ff[_0x083d('0x20')],'answered':_0x3923ff[_0x083d('0x21')],'available':_0x3923ff[_0x083d('0x22')],'loggedIn':_0x3923ff[_0x083d('0x23')],'pTalking':_0x3923ff[_0x083d('0x24')],'sumBillable':_0x3923ff[_0x083d('0x25')],'sumDuration':_0x3923ff[_0x083d('0x26')],'sumHoldTime':_0x3923ff[_0x083d('0x27')]||0x0,'talking':_0x3923ff[_0x083d('0x28')],'total':_0x3923ff[_0x083d('0x29')],'type':_0x3923ff[_0x083d('0x2a')],'unmanaged':_0x3923ff[_0x083d('0x2b')],'abandoned':_0x3923ff[_0x083d('0x2c')],'waiting':_0x3923ff[_0x083d('0x2d')],'loggedInDb':_0x3923ff[_0x083d('0x2e')]};if(_0x3923ff['type']===_0x083d('0x2f')){_0x6bccbd[_0x083d('0x30')]=_0x3923ff['dialActive'];_0x6bccbd['dialMethod']=_0x3923ff[_0x083d('0x31')];_0x6bccbd['dialOriginateCallerIdName']=_0x3923ff[_0x083d('0x32')];_0x6bccbd['dialOriginateCallerIdNumber']=_0x3923ff[_0x083d('0x33')];_0x6bccbd['dialOriginateTimeout']=_0x3923ff[_0x083d('0x34')];_0x6bccbd[_0x083d('0x35')]=_0x3923ff[_0x083d('0x35')];_0x6bccbd['temp']=_0x3923ff['temp'];_0x6bccbd[_0x083d('0x36')]=_0x3923ff['outboundAnswerAgiCallsDay'];_0x6bccbd[_0x083d('0x37')]=_0x3923ff[_0x083d('0x37')];_0x6bccbd[_0x083d('0x38')]=_0x3923ff[_0x083d('0x38')];_0x6bccbd['outboundBusyCallsDay']=_0x3923ff[_0x083d('0x39')];_0x6bccbd[_0x083d('0x3a')]=_0x3923ff[_0x083d('0x3a')];_0x6bccbd[_0x083d('0x3b')]=_0x3923ff['outboundDropCallsDayACS'];_0x6bccbd[_0x083d('0x3c')]=_0x3923ff[_0x083d('0x3c')];_0x6bccbd[_0x083d('0x3d')]=_0x3923ff[_0x083d('0x3d')];_0x6bccbd['outboundNoAnswerCallsDay']=_0x3923ff['outboundNoAnswerCallsDay'];_0x6bccbd[_0x083d('0x3e')]=_0x3923ff[_0x083d('0x3e')];_0x6bccbd[_0x083d('0x3f')]=_0x3923ff[_0x083d('0x3f')];_0x6bccbd[_0x083d('0x40')]=_0x3923ff['outboundReCallsDay'];_0x6bccbd[_0x083d('0x41')]=_0x3923ff[_0x083d('0x41')];_0x6bccbd['outboundUnknownCallsDay']=_0x3923ff[_0x083d('0x42')];_0x6bccbd['predictiveIntervalAnsweredCalls']=_0x3923ff['predictiveIntervalAnsweredCalls'];_0x6bccbd[_0x083d('0x43')]=_0x3923ff[_0x083d('0x43')];_0x6bccbd['predictiveIntervalAvgTalktime']=_0x3923ff[_0x083d('0x44')];_0x6bccbd[_0x083d('0x45')]=_0x3923ff[_0x083d('0x45')];_0x6bccbd['predictiveIntervalDroppedCallsTimeout']=_0x3923ff['predictiveIntervalDroppedCallsTimeout'];_0x6bccbd['predictiveIntervalErlangCalls']=_0x3923ff['predictiveIntervalErlangCalls'];_0x6bccbd[_0x083d('0x46')]=_0x3923ff[_0x083d('0x46')];_0x6bccbd[_0x083d('0x47')]=_0x3923ff[_0x083d('0x47')];_0x6bccbd['predictiveIntervalMultiplicativeFactor']=_0x3923ff[_0x083d('0x48')];_0x6bccbd[_0x083d('0x49')]=_0x3923ff['predictiveIntervalPauses'];_0x6bccbd[_0x083d('0x4a')]=_0x3923ff[_0x083d('0x4a')];_0x6bccbd[_0x083d('0x4b')]=_0x3923ff[_0x083d('0x4b')];_0x6bccbd[_0x083d('0x19')]=_0x3923ff[_0x083d('0x19')];_0x6bccbd[_0x083d('0x4c')]=_0x3923ff[_0x083d('0x4c')];_0x6bccbd['erlangCalls']=_0x3923ff[_0x083d('0x4d')];_0x6bccbd[_0x083d('0x4e')]=_0x3923ff[_0x083d('0x4e')];_0x6bccbd[_0x083d('0x4f')]=_0x3923ff[_0x083d('0x4f')];_0x6bccbd[_0x083d('0x50')]=_0x3923ff[_0x083d('0x50')];_0x6bccbd['startPredictive']=_0x3923ff[_0x083d('0x51')];_0x6bccbd[_0x083d('0x52')]=_0x3923ff['startProgressive'];}if(_0x3923ff[_0x083d('0x53')]){_0x6bccbd[_0x083d('0x53')]={'id':_0x3923ff[_0x083d('0x53')]['id'],'name':_0x3923ff[_0x083d('0x53')][_0x083d('0x9')],'active':_0x3923ff['Trunk'][_0x083d('0x54')],'callerid':_0x3923ff[_0x083d('0x53')][_0x083d('0x55')]};}if(_0x3923ff[_0x083d('0x56')]){_0x6bccbd[_0x083d('0x56')]={'id':_0x3923ff['Interval']['id'],'name':_0x3923ff[_0x083d('0x56')][_0x083d('0x9')]};}_0x33d32a[_0x083d('0x57')](_0x6bccbd);}}_0x3a0ce2({'count':_0x33d32a[_0x083d('0x58')],'rows':_0x33d32a});});},'UpdateVoiceQueue':function(_0x1d45a1){return new Promise(function(_0x15232f,_0x592d1a){var _0xd1f130=_[_0x083d('0x59')](_0x404d77[_0x083d('0x1e')],{'id':parseInt(_0x1d45a1['id'])});var _0x1bdafc=_[_0x083d('0x5a')](_0x1d45a1,['id']);if(_0xd1f130){for(var _0x1faad5 in _0x1bdafc){if(typeof _0x1bdafc[_0x1faad5]!==_0x083d('0x5b')&&typeof _0xd1f130[_0x1faad5]!=='undefined'){_0xd1f130[_0x1faad5]=_0x1bdafc[_0x1faad5];}}_0x15232f(_0xd1f130);}else{_0x592d1a();}});},'VoiceChannels':function(_0x515b43){return new Promise(function(_0x5c3258,_0x1dee34){var _0x509b72=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x5d')]);_0x5c3258({'count':_0x509b72[_0x083d('0x58')],'rows':_0x509b72});});},'VoiceChannelMixMonitor':function(_0x1bc090){var _0x525dd9=this;return new Promise(function(_0x117601,_0x410fb7){if(ami[_0x083d('0x5e')]()==![]){return _0x410fb7(_0x525dd9[_0x083d('0x10')](0x1f4,[config[_0x083d('0x1b')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x083d('0x13')]('\x20')));}var _0x34ed6c=schema(properties[_0x083d('0x5f')])[_0x083d('0x3')](_0x1bc090);if(_0x34ed6c[_0x083d('0x58')]>0x0){return _0x410fb7(_0x525dd9[_0x083d('0x10')](0x1f4,_[_0x083d('0x60')](_0x34ed6c,_0x083d('0x19'))[_0x083d('0x13')](',\x20')));}var _0x5a8620=_['find'](_0x404d77[_0x083d('0x5d')],{'uniqueid':_0x1bc090['uniqueid']});if(_0x5a8620&&_0x5a8620[_0x083d('0x61')]){var _0x2dd4f5=util[_0x083d('0x62')](_0x083d('0x63'),_0x1bc090[_0x083d('0x64')]||_0x1bc090['uniqueid'],_0x1bc090[_0x083d('0x62')]||'wav');return ami['Action']({'action':_0x083d('0x65'),'channel':_0x5a8620[_0x083d('0x61')],'file':_0x2dd4f5,'options':_0x083d('0x66')})[_0x083d('0x18')](function(_0x10db3e){var _0x2d26c4=_[_0x083d('0x59')](_0x5a8620['monitors'],{'filename':_0x083d('0x67')+_0x2dd4f5[_0x083d('0x68')]()});if(_[_0x083d('0x69')](_0x2d26c4)){_0x5a8620[_0x083d('0x6a')][_0x083d('0x57')]({'filename':_0x083d('0x67')+_0x2dd4f5[_0x083d('0x68')](),'createdAt':moment()[_0x083d('0x62')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x10db3e[_0x083d('0x6b')],'status':_0x083d('0x6c')});}else{_0x2d26c4[_0x083d('0x6b')]=_0x10db3e[_0x083d('0x6b')];_0x2d26c4[_0x083d('0x6d')]=_0x083d('0x6c');}_0x117601({'code':0xc8,'message':[_0x1bc090[_0x083d('0x6e')],_0x083d('0x6f'),_0x10db3e[_0x083d('0x6b')]][_0x083d('0x13')]('\x20'),'mixmonitorid':_0x10db3e[_0x083d('0x6b')]});})[_0x083d('0x1a')](function(_0x475ac6){_0x410fb7(_0x525dd9['error'](0x1f5,[_0x1bc090['uniqueid'],_0x475ac6[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x410fb7(_0x525dd9[_0x083d('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2ea876){var _0x14918f=this;return new Promise(function(_0x3aa5dc,_0x3c305e){if(ami[_0x083d('0x5e')]()==![]){return _0x3c305e(_0x14918f['error'](0x1f4,[config['asterisk']['ip'],config[_0x083d('0x1b')][_0x083d('0x11')],_0x083d('0x12')]['join']('\x20')));}var _0x39ca60=schema(properties[_0x083d('0x5f')])['validate'](_0x2ea876);if(_0x39ca60[_0x083d('0x58')]>0x0){return _0x3c305e(_0x14918f[_0x083d('0x10')](0x1f4,_['map'](_0x39ca60,_0x083d('0x19'))[_0x083d('0x13')](',\x20')));}var _0x533dbc=_[_0x083d('0x59')](_0x404d77[_0x083d('0x5d')],{'uniqueid':_0x2ea876['uniqueid']});if(_0x533dbc){return BPromise['resolve']()[_0x083d('0x18')](function(){if(_0x533dbc[_0x083d('0x61')]){return ami[_0x083d('0x17')]({'action':_0x083d('0x70'),'channel':_0x533dbc['channel'],'mixmonitorid':_0x2ea876[_0x083d('0x6b')]})[_0x083d('0x1a')](function(_0x33c209){});}})['then'](function(){if(_0x533dbc[_0x083d('0x71')]){return ami[_0x083d('0x17')]({'action':_0x083d('0x70'),'channel':_0x533dbc[_0x083d('0x71')],'mixmonitorid':_0x2ea876['mixmonitorid']})['catch'](function(_0xd6e7d9){});}})[_0x083d('0x18')](function(_0x5acf5d){var _0x20f921=_[_0x083d('0x59')](_0x533dbc[_0x083d('0x6a')],{'mixmonitorid':_0x2ea876[_0x083d('0x6b')]});if(_0x20f921){_0x20f921[_0x083d('0x6d')]='stop';}})[_0x083d('0x18')](function(){var _0x3bec08=util[_0x083d('0x62')](_0x083d('0x63'),_0x2ea876[_0x083d('0x64')]||_0x2ea876[_0x083d('0x6e')],_0x2ea876[_0x083d('0x62')]||_0x083d('0x72'));var _0x4e4543=_[_0x083d('0x59')](_0x533dbc[_0x083d('0x6a')],{'filename':_0x083d('0x67')+_0x3bec08['toLowerCase']()});if(_0x4e4543){_0x4e4543['status']=_0x083d('0x73');}})[_0x083d('0x18')](function(){_0x3aa5dc({'code':0xc8,'message':[_0x2ea876[_0x083d('0x6e')],_0x083d('0x74')]['join']('\x20')});})[_0x083d('0x1a')](function(_0x5b116b){_0x3c305e(_0x14918f['error'](0x1f5,[_0x2ea876[_0x083d('0x6e')],_0x5b116b[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x3c305e(_0x14918f[_0x083d('0x10')](0x1f5,_0x083d('0x75')));}});},'VoiceQueuesChannels':function(_0xa2afc){return new Promise(function(_0x135171,_0xca6924){var _0x2fdb74=_[_0x083d('0x5c')](_0x404d77['queueChannels']);_0x135171({'count':_0x2fdb74[_0x083d('0x58')],'rows':_0x2fdb74});});},'VoiceQueuesChannel':function(_0x565080){var _0x5ea764=this;return new Promise(function(_0x413a23,_0x18c0b6){var _0x3afabf=schema(properties[_0x083d('0x76')])['validate'](_0x565080);if(_0x3afabf['length']>0x0){return _0x18c0b6(_0x5ea764[_0x083d('0x10')](0x1f4,_[_0x083d('0x60')](_0x3afabf,_0x083d('0x19'))['join'](',\x20')));}var _0x27c6dc=_[_0x083d('0x59')](_0x404d77['queueChannels'],{'uniqueid':_0x565080[_0x083d('0x6e')]});if(_0x27c6dc){_0x413a23(_0x27c6dc);}else{return _0x18c0b6(_0x5ea764[_0x083d('0x10')](0x1f5,_0x083d('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x2c9fb5){var _0x36605d=this;return new Promise(function(_0x3a9f3f,_0x5359f0){if(ami[_0x083d('0x5e')]()==![]){return _0x5359f0(_0x36605d['error'](0x1f4,[config[_0x083d('0x1b')]['ip'],config['asterisk']['username'],_0x083d('0x12')]['join']('\x20')));}var _0x1d4add=schema(properties[_0x083d('0x77')])[_0x083d('0x3')](_0x2c9fb5);if(_0x1d4add[_0x083d('0x58')]>0x0){return _0x5359f0(_0x36605d['error'](0x1f4,_[_0x083d('0x60')](_0x1d4add,_0x083d('0x19'))[_0x083d('0x13')](',\x20')));}var _0x18c422=_[_0x083d('0x59')](_0x404d77[_0x083d('0x78')],{'uniqueid':_0x2c9fb5['uniqueid']});if(_0x18c422&&_0x18c422[_0x083d('0x61')]){return ami[_0x083d('0x17')]({'action':_0x083d('0x79'),'channel':_0x18c422['channel']})[_0x083d('0x18')](function(_0x13f487){_0x3a9f3f({'code':0xc8,'message':[_0x2c9fb5[_0x083d('0x6e')],_0x13f487[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')});})['catch'](function(_0x24b593){_0x5359f0(_0x36605d[_0x083d('0x10')](0x1f5,[_0x2c9fb5['uniqueid'],_0x24b593[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x5359f0(_0x36605d['error'](0x1f5,_0x083d('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x3ce6bf){var _0x5c3e46=this;return new Promise(function(_0x460ae3,_0x4d52e0){if(ami[_0x083d('0x5e')]()==![]){return _0x4d52e0(_0x5c3e46[_0x083d('0x10')](0x1f4,[config[_0x083d('0x1b')]['ip'],config[_0x083d('0x1b')]['username'],_0x083d('0x12')]['join']('\x20')));}var _0x3f75a4=schema(properties[_0x083d('0x7a')])['validate'](_0x3ce6bf);if(_0x3f75a4[_0x083d('0x58')]>0x0){return _0x4d52e0(_0x5c3e46[_0x083d('0x10')](0x1f4,_[_0x083d('0x60')](_0x3f75a4,_0x083d('0x19'))['join'](',\x20')));}var _0x4a9f1e=_['find'](_0x404d77[_0x083d('0x78')],{'uniqueid':_0x3ce6bf['uniqueid']});if(_0x4a9f1e&&_0x4a9f1e[_0x083d('0x61')]){return ami['Action']({'action':_0x083d('0x7b'),'channel':_0x4a9f1e[_0x083d('0x61')],'exten':_0x3ce6bf[_0x083d('0x7c')],'context':_0x3ce6bf[_0x083d('0x7d')]||_0x4a9f1e[_0x083d('0x7d')],'priority':0x1})[_0x083d('0x18')](function(_0x2b2562){_0x460ae3({'code':0xc8,'message':[_0x3ce6bf[_0x083d('0x6e')],_0x2b2562['message'][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')});})['catch'](function(_0x1e0cae){_0x4d52e0(_0x5c3e46[_0x083d('0x10')](0x1f5,[_0x3ce6bf[_0x083d('0x6e')],_0x1e0cae[_0x083d('0x19')][_0x083d('0x68')]()][_0x083d('0x13')]('\x20')));});}else{return _0x4d52e0(_0x5c3e46['error'](0x1f5,_0x083d('0x75')));}});},'Agents':function(_0x19259b){return new Promise(function(_0x5120a1,_0x55f34a){var _0x28ff6b=_[_0x083d('0x5c')](_0x404d77[_0x083d('0xc')]);_0x5120a1({'count':_0x28ff6b[_0x083d('0x58')],'rows':_0x28ff6b});});},'Telephones':function(_0x4889aa){return new Promise(function(_0x214a98,_0x23c8cd){var _0x2acf74=_[_0x083d('0x5c')](_0x404d77['telephones']);_0x214a98({'count':_0x2acf74['length'],'rows':_0x2acf74});});},'Trunks':function(_0x586a14){return new Promise(function(_0x5d9253,_0x3cae5c){var _0x12cf61=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x7e')]);_0x5d9253({'count':_0x12cf61[_0x083d('0x58')],'rows':_0x12cf61});});},'OutboundChannels':function(_0x12f8dd){return new Promise(function(_0x181a7a,_0x17cf6d){var _0x5164ea=_['values'](_0x404d77[_0x083d('0x7f')]);_0x181a7a({'count':_0x5164ea[_0x083d('0x58')],'rows':_0x5164ea});});},'Outbound':function(_0x28aa94){return new Promise(function(_0x26f7ec,_0x279355){_0x26f7ec(_0x404d77[_0x083d('0x2f')]);});},'Campaigns':function(_0x4feb9d){return new Promise(function(_0x21a44e,_0xedd308){var _0x1ad23d=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x80')]);_0x21a44e({'count':_0x1ad23d[_0x083d('0x58')],'rows':_0x1ad23d});});},'VoiceQueuesPreview':function(_0x1e75d9){var _0x356fef=this;return new Promise(function(_0x1966af,_0x381299){_0x143ec8[_0x083d('0x81')](_0x1e75d9['id'])['then'](function(_0x4ae132){_0x1966af({'code':0xc8,'message':_0x4ae132[_0x083d('0x19')]});})['catch'](function(_0x2afcd9){_0x381299(_0x356fef[_0x083d('0x10')](0x1f4,_0x2afcd9[_0x083d('0x19')]));});});},'EventManager':function(_0x310c32){var _0x517b26=this;return new Promise(function(_0x573ac7,_0x5ac7ae){if(!_0x310c32['event']){return _0x5ac7ae(_0x517b26[_0x083d('0x10')](0x1f4,_0x083d('0x82')));}ami[_0x083d('0x83')](_0x083d('0x84')+_0x310c32[_0x083d('0x85')],_0x310c32[_0x083d('0x19')]);_0x573ac7({'code':0xc8,'message':_0x310c32});});},'FaxAccounts':function(_0x1e4508){return new Promise(function(_0x5efbe6,_0x1f12e6){var _0x54cee3=_[_0x083d('0x5c')](_0x404d77[_0x083d('0x86')]);_0x5efbe6({'count':_0x54cee3[_0x083d('0x58')],'rows':_0x54cee3});});},'SendFax':function(_0x40cd0){var _0x5e227b=this;return new Promise(function(_0x5260a1,_0x1cbed9){_0x3c4b8c[_0x083d('0x87')](_0x40cd0)[_0x083d('0x18')](function(_0x90f46){_0x5260a1({'code':0xc8,'message':_0x90f46['message']});})[_0x083d('0x1a')](function(_0x1bb396){_0x1cbed9(_0x5e227b[_0x083d('0x10')](0x1f4,_0x1bb396['message']));});});},'CheckAfterSend':function(_0x518628){var _0x2a862d=this;return new Promise(function(_0x302332,_0x37fccc){_0x3c4b8c[_0x083d('0x88')](_0x518628)['then'](function(_0x4d37f9){_0x302332({'code':0xc8,'message':_0x4d37f9[_0x083d('0x19')]});})[_0x083d('0x1a')](function(_0x41fb77){_0x37fccc(_0x2a862d[_0x083d('0x10')](0x1f4,_0x41fb77[_0x083d('0x19')]));});});}};var _0x135509=jayson['server'](_0x52a3e7)['http']();_0x135509['on'](_0x083d('0x10'),function(_0x281096){return _0x472c6b(_0x281096);});_0x135509[_0x083d('0x89')](0x232a,_0x083d('0x8a'),function(){console[_0x083d('0x8b')](_0x083d('0x8c'),0x232a);return _0x2e75e8('RPC\x20listening\x20on\x20port:'+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 5fb339c..e2b0de3 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 _0xb4e6=['format','name','trigger:%s','action','toLowerCase','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','ListId','scheduledAt','updatedAt','union','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','calleridname','Unknown','','destcalleridname','createContact'];(function(_0x418059,_0xcaf61c){var _0x4f19f7=function(_0x395cf3){while(--_0x395cf3){_0x418059['push'](_0x418059['shift']());}};_0x4f19f7(++_0xcaf61c);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xb4e6[_0x2ac4af];return _0x3a36df;};'use strict';var _=require(_0x6b4e('0x0'));var BPromise=require('bluebird');var Redis=require(_0x6b4e('0x1'));var util=require(_0x6b4e('0x2'));var config=require(_0x6b4e('0x3'));var logger=require(_0x6b4e('0x4'))(_0x6b4e('0x5'));var cmContactRpc=require(_0x6b4e('0x6'));config[_0x6b4e('0x7')]=_['defaults'](config[_0x6b4e('0x7')],{'host':_0x6b4e('0x8'),'port':0x18eb});var io=require(_0x6b4e('0x9'))(new Redis(config['redis']));function emit(_0xd3138f,_0x570346,_0x4f00be,_0x2311d9,_0x48c870){logger['info'](_0x6b4e('0xa'),_0xd3138f,_0x570346['id'],_0x4f00be,_0x2311d9,JSON[_0x6b4e('0xb')](_0x48c870));io['to'](_0x4f00be)[_0x6b4e('0xc')](_0x2311d9,_0x48c870);}exports[_0x6b4e('0xd')]=function(_0x14cf84,_0x46cbe1,_0x323487,_0x49c734){var _0x39b4ec,_0x3bba86;var _0x58c67d={};var _0x2a4d0f=Number(_0x323487[_0x6b4e('0xe')]);var _0x432399=_0x323487[_0x6b4e('0xf')]?Boolean(Number(_0x323487[_0x6b4e('0xf')])):![];var _0xa3d358;var _0x1db513=![];if(!_['isNil'](_0x323487[_0x6b4e('0x10')])){if(_0x323487[_0x6b4e('0x10')]=='1')_0x1db513=!![];}if(!_0x1db513){if(_0x49c734['xmd-contactid']){_0x58c67d['id']=_0x49c734[_0x6b4e('0x11')];}}if(!_0x58c67d['id']){_0x58c67d['ListId']=_0x2a4d0f;_0xa3d358=_0x323487[_0x6b4e('0x12')]&&_0x323487[_0x6b4e('0x12')]!=='0'?_0x323487[_0x6b4e('0x12')][_0x6b4e('0x13')](','):[_0x6b4e('0x14')];_0x58c67d[_0x6b4e('0x15')]=_['map'](_0xa3d358,function(_0x5775f4){var _0x67496d={};_0x67496d[_0x5775f4]=_0x49c734[_0x6b4e('0x16')]?_0x49c734[_0x6b4e('0x17')]:_0x49c734[_0x6b4e('0x18')];return _0x67496d;});}var _0x101d0a=['id',_0x6b4e('0x19'),_0x6b4e('0x1a'),_0x6b4e('0x14'),_0x6b4e('0x1b'),_0x6b4e('0x1c'),_0x6b4e('0x1d'),'createdAt',_0x6b4e('0x1e'),_0x6b4e('0x1f')];var _0x31fb9d=_[_0x6b4e('0x20')](_0x101d0a,_0xa3d358);BPromise['resolve']()[_0x6b4e('0x21')](cmContactRpc['getContacts']({'attributes':_0x31fb9d,'where':_0x58c67d}))[_0x6b4e('0x21')](function(_0x163dea){_0x3bba86=_0x163dea;if(!_[_0x6b4e('0x22')](_0x3bba86)){if(_0x3bba86[_0x6b4e('0x23')]===0x1){_0x39b4ec=_0x3bba86[0x0];logger[_0x6b4e('0x24')](_0x6b4e('0x25'),_0x49c734[_0x6b4e('0x26')],_0x46cbe1['id'],_0x39b4ec['id']);}else{logger['info'](_0x6b4e('0x27'),_0x49c734['uniqueid'],_0x46cbe1['id'],_[_0x6b4e('0x28')](_0x3bba86,'id')[_0x6b4e('0x29')](','));}return;}else{logger[_0x6b4e('0x24')](_0x6b4e('0x2a'),_0x49c734['uniqueid'],_0x46cbe1['id']);var _0xec7d35={'ListId':_0x2a4d0f};var _0x3f72d7=_0x323487['data4']&&_0x323487[_0x6b4e('0x2b')]!=='0'?_0x323487[_0x6b4e('0x2b')]:_0x6b4e('0x14');if(_0x432399){logger[_0x6b4e('0x24')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x49c734[_0x6b4e('0x26')],_0x46cbe1['id']);_0xec7d35[_0x3f72d7]=_[_0x6b4e('0x2c')](_0x49c734['routeId'])?_0x49c734[_0x6b4e('0x18')]:_0x49c734[_0x6b4e('0x17')];if(_[_0x6b4e('0x2c')](_0x49c734[_0x6b4e('0x16')])){_0xec7d35['firstName']=_0x49c734[_0x6b4e('0x2d')]&&_0x49c734[_0x6b4e('0x2d')]!==''?_0x49c734[_0x6b4e('0x2d')]:_0x6b4e('0x2e');}else{_0xec7d35[_0x6b4e('0x19')]=_0x49c734['destcalleridname']&&_0x49c734['destcalleridname']!==_0x6b4e('0x2f')?_0x49c734[_0x6b4e('0x30')]:_0x6b4e('0x2e');}return BPromise['resolve']()[_0x6b4e('0x21')](cmContactRpc[_0x6b4e('0x31')](_0xec7d35))[_0x6b4e('0x21')](function(_0x5c1444){_0x39b4ec=_0x5c1444;_0x3bba86['push'](_0x5c1444);if(_0x39b4ec){logger[_0x6b4e('0x24')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x49c734[_0x6b4e('0x26')],_0x46cbe1['id'],_0x39b4ec['id']);}return;});}else{logger[_0x6b4e('0x24')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x49c734[_0x6b4e('0x26')],_0x46cbe1['id']);_0xec7d35[_0x3f72d7]=_[_0x6b4e('0x2c')](_0x49c734[_0x6b4e('0x16')])?_0x49c734[_0x6b4e('0x18')]:_0x49c734['destcalleridnum'];if(_['isNil'](_0x49c734[_0x6b4e('0x16')])){_0xec7d35[_0x6b4e('0x19')]=_0x49c734[_0x6b4e('0x2d')]&&_0x49c734[_0x6b4e('0x2d')]!==_0x6b4e('0x2f')?_0x49c734[_0x6b4e('0x2d')]:_0x6b4e('0x2e');}else{_0xec7d35[_0x6b4e('0x19')]=_0x49c734[_0x6b4e('0x30')]&&_0x49c734[_0x6b4e('0x30')]!==_0x6b4e('0x2f')?_0x49c734[_0x6b4e('0x30')]:_0x6b4e('0x2e');}_0x39b4ec=_0xec7d35;_0x3bba86['push'](_0xec7d35);return;}}})[_0x6b4e('0x21')](function(){if(_0x14cf84){emit(_0x49c734[_0x6b4e('0x26')],_0x46cbe1,util[_0x6b4e('0x32')]('user:%s',_0x14cf84[_0x6b4e('0x33')]),util['format'](_0x6b4e('0x34'),_0x323487[_0x6b4e('0x35')][_0x6b4e('0x36')]()),{'evt':_['merge'](_0x49c734,{'autoCreate':_0x432399}),'contact':_0x39b4ec===undefined?{}:_0x39b4ec,'contacts':_0x3bba86['length']===0x0?undefined:_0x3bba86});}});}; \ No newline at end of file +var _0xed1f=['trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','ListId','data3','phone','map','routeId','destcalleridnum','lastName','mobile','fax','createdAt','scheduledAt','union','resolve','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','Unknown','destcalleridname','','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger'];(function(_0x44b289,_0x37eaed){var _0x1351dc=function(_0x1bd414){while(--_0x1bd414){_0x44b289['push'](_0x44b289['shift']());}};_0x1351dc(++_0x37eaed);}(_0xed1f,0x6a));var _0xfed1=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xed1f[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xfed1('0x0'));var BPromise=require(_0xfed1('0x1'));var Redis=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var config=require(_0xfed1('0x4'));var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));var cmContactRpc=require(_0xfed1('0x7'));config[_0xfed1('0x8')]=_[_0xfed1('0x9')](config[_0xfed1('0x8')],{'host':_0xfed1('0xa'),'port':0x18eb});var io=require(_0xfed1('0xb'))(new Redis(config[_0xfed1('0x8')]));function emit(_0x380e18,_0x612b38,_0x2a6082,_0x2967ef,_0x568d48){logger[_0xfed1('0xc')](_0xfed1('0xd'),_0x380e18,_0x612b38['id'],_0x2a6082,_0x2967ef,JSON['stringify'](_0x568d48));io['to'](_0x2a6082)[_0xfed1('0xe')](_0x2967ef,_0x568d48);}exports[_0xfed1('0xf')]=function(_0x4a564e,_0x3ce017,_0x48c338,_0x1c3f40){var _0x234f4e,_0x4a8369;var _0x5c0b5f={};var _0x3d1891=Number(_0x48c338[_0xfed1('0x10')]);var _0x569a6e=_0x48c338[_0xfed1('0x11')]?Boolean(Number(_0x48c338['data2'])):![];var _0x529b3d;var _0x3f6555=![];if(!_[_0xfed1('0x12')](_0x48c338['data5'])){if(_0x48c338[_0xfed1('0x13')]=='1')_0x3f6555=!![];}if(!_0x3f6555){if(_0x1c3f40['xmd-contactid']){_0x5c0b5f['id']=_0x1c3f40['xmd-contactid'];}}if(!_0x5c0b5f['id']){_0x5c0b5f[_0xfed1('0x14')]=_0x3d1891;_0x529b3d=_0x48c338[_0xfed1('0x15')]&&_0x48c338[_0xfed1('0x15')]!=='0'?_0x48c338[_0xfed1('0x15')]['split'](','):[_0xfed1('0x16')];_0x5c0b5f['$or']=_[_0xfed1('0x17')](_0x529b3d,function(_0x29a32f){var _0x489a0f={};_0x489a0f[_0x29a32f]=_0x1c3f40[_0xfed1('0x18')]?_0x1c3f40[_0xfed1('0x19')]:_0x1c3f40['calleridnum'];return _0x489a0f;});}var _0x59509b=['id','firstName',_0xfed1('0x1a'),'phone',_0xfed1('0x1b'),_0xfed1('0x1c'),'ListId',_0xfed1('0x1d'),_0xfed1('0x1e'),'updatedAt'];var _0x3ce944=_[_0xfed1('0x1f')](_0x59509b,_0x529b3d);BPromise[_0xfed1('0x20')]()[_0xfed1('0x21')](cmContactRpc['getContacts']({'attributes':_0x3ce944,'where':_0x5c0b5f}))[_0xfed1('0x21')](function(_0x59333e){_0x4a8369=_0x59333e;if(!_[_0xfed1('0x22')](_0x4a8369)){if(_0x4a8369[_0xfed1('0x23')]===0x1){_0x234f4e=_0x4a8369[0x0];logger[_0xfed1('0xc')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id'],_0x234f4e['id']);}else{logger['info'](_0xfed1('0x25'),_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id'],_[_0xfed1('0x17')](_0x4a8369,'id')[_0xfed1('0x26')](','));}return;}else{logger[_0xfed1('0xc')](_0xfed1('0x27'),_0x1c3f40['uniqueid'],_0x3ce017['id']);var _0x465ce6={'ListId':_0x3d1891};var _0xcb1cdc=_0x48c338['data4']&&_0x48c338[_0xfed1('0x28')]!=='0'?_0x48c338[_0xfed1('0x28')]:_0xfed1('0x16');if(_0x569a6e){logger[_0xfed1('0xc')](_0xfed1('0x29'),_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id']);_0x465ce6[_0xcb1cdc]=_['isNil'](_0x1c3f40[_0xfed1('0x18')])?_0x1c3f40['calleridnum']:_0x1c3f40[_0xfed1('0x19')];if(_['isNil'](_0x1c3f40['routeId'])){_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40[_0xfed1('0x2b')]&&_0x1c3f40[_0xfed1('0x2b')]!==''?_0x1c3f40[_0xfed1('0x2b')]:_0xfed1('0x2c');}else{_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40[_0xfed1('0x2d')]&&_0x1c3f40[_0xfed1('0x2d')]!==_0xfed1('0x2e')?_0x1c3f40['destcalleridname']:_0xfed1('0x2c');}return BPromise[_0xfed1('0x20')]()['then'](cmContactRpc['createContact'](_0x465ce6))[_0xfed1('0x21')](function(_0x2d10f5){_0x234f4e=_0x2d10f5;_0x4a8369[_0xfed1('0x2f')](_0x2d10f5);if(_0x234f4e){logger[_0xfed1('0xc')](_0xfed1('0x30'),_0x1c3f40['uniqueid'],_0x3ce017['id'],_0x234f4e['id']);}return;});}else{logger[_0xfed1('0xc')](_0xfed1('0x31'),_0x1c3f40[_0xfed1('0x24')],_0x3ce017['id']);_0x465ce6[_0xcb1cdc]=_[_0xfed1('0x12')](_0x1c3f40[_0xfed1('0x18')])?_0x1c3f40['calleridnum']:_0x1c3f40[_0xfed1('0x19')];if(_['isNil'](_0x1c3f40[_0xfed1('0x18')])){_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40[_0xfed1('0x2b')]&&_0x1c3f40[_0xfed1('0x2b')]!==_0xfed1('0x2e')?_0x1c3f40[_0xfed1('0x2b')]:_0xfed1('0x2c');}else{_0x465ce6[_0xfed1('0x2a')]=_0x1c3f40['destcalleridname']&&_0x1c3f40[_0xfed1('0x2d')]!==_0xfed1('0x2e')?_0x1c3f40[_0xfed1('0x2d')]:_0xfed1('0x2c');}_0x234f4e=_0x465ce6;_0x4a8369['push'](_0x465ce6);return;}}})['then'](function(){if(_0x4a564e){emit(_0x1c3f40[_0xfed1('0x24')],_0x3ce017,util[_0xfed1('0x32')](_0xfed1('0x33'),_0x4a564e[_0xfed1('0x34')]),util[_0xfed1('0x32')](_0xfed1('0x35'),_0x48c338[_0xfed1('0x36')][_0xfed1('0x37')]()),{'evt':_['merge'](_0x1c3f40,{'autoCreate':_0x569a6e}),'contact':_0x234f4e===undefined?{}:_0x234f4e,'contacts':_0x4a8369['length']===0x0?undefined:_0x4a8369});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2363cf0..42b1003 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 _0x5a3b=['salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','custom:agentringnoanswer','bind','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','info','stringify','emit','clone','undefined','motionChannel','voice','checkTriggers','interface','triggers','hasOwnProperty','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','buildUri','isNil','data3','location','uriLocation','data4','data5','800','windowHeight','600','data6','winApplication','render','winArguments','format','user:%s','name','trigger:%s:%s','trigger:%s','exec','queue','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','membername','lastevent','routeId','exports','url','mustache','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5a3b,0xdc));var _0xb5a3=function(_0x3dbabd,_0x45aa24){_0x3dbabd=_0x3dbabd-0x0;var _0x2eef66=_0x5a3b[_0x3dbabd];return _0x2eef66;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xb5a3('0x0'));var Mustache=require(_0xb5a3('0x1'));var Redis=require('ioredis');var urlforward=require(_0xb5a3('0x2'));var integration=require(_0xb5a3('0x3'));var cmContact=require('./cmContact');var script=require(_0xb5a3('0x4'));var config=require(_0xb5a3('0x5'));var logger=require(_0xb5a3('0x6'))(_0xb5a3('0x7'));var ami=require(_0xb5a3('0x8'));config[_0xb5a3('0x9')]=_['defaults'](config[_0xb5a3('0x9')],{'host':_0xb5a3('0xa'),'port':0x18eb});var io=require(_0xb5a3('0xb'))(new Redis(config['redis']));var operators={'equals':function(_0x53856a,_0x524859){return _0x53856a==_0x524859;},'not_equals':function(_0x1e6290,_0x21cf4e){return _0x1e6290!=_0x21cf4e;}};var barAndWebActions=[_0xb5a3('0xc'),_0xb5a3('0x0'),_0xb5a3('0xd')];function Trigger(_0x482554){this['triggers']=_0x482554['triggers'];this[_0xb5a3('0xe')]=_0x482554['agents'];this[_0xb5a3('0xf')]=_0x482554[_0xb5a3('0xf')];this[_0xb5a3('0x10')]=_0x482554['templates'];this[_0xb5a3('0x11')]=_0x482554['voiceExtensions'];this[_0xb5a3('0x12')]=_0x482554[_0xb5a3('0x12')];this[_0xb5a3('0x13')]=_0x482554[_0xb5a3('0x13')];this[_0xb5a3('0x14')]=_0x482554[_0xb5a3('0x14')];this['sugarcrmAccounts']=_0x482554[_0xb5a3('0x15')];this[_0xb5a3('0x16')]=_0x482554[_0xb5a3('0x16')];this[_0xb5a3('0x17')]=_0x482554['deskAccounts'];this[_0xb5a3('0x18')]=_0x482554[_0xb5a3('0x18')];this[_0xb5a3('0x19')]=_0x482554[_0xb5a3('0x19')];this['dynamics365Accounts']=_0x482554['dynamics365Accounts'];this['freshsalesAccounts']=_0x482554[_0xb5a3('0x1a')];this[_0xb5a3('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xb5a3('0x14')],'freshdesk':this[_0xb5a3('0x13')],'sugarcrm':this[_0xb5a3('0x15')],'zoho':this[_0xb5a3('0x16')],'desk':this[_0xb5a3('0x17')],'vtiger':this[_0xb5a3('0x18')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0xb5a3('0x1c'),this[_0xb5a3('0x1d')]['bind'](this));ami['on'](_0xb5a3('0x1e'),this['syncCustomEvent']['bind'](this));ami['on'](_0xb5a3('0x1f'),this[_0xb5a3('0x1d')]['bind'](this));ami['on']('custom:agentcomplete',this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on']('custom:agentnosuchnumber',this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x21'),this['syncCustomEvent'][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x22'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x23'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x24'),this[_0xb5a3('0x1d')]['bind'](this));ami['on']('custom:amd',this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x25'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x26'),this[_0xb5a3('0x1d')]['bind'](this));ami['on']('custom:dialbegin',this[_0xb5a3('0x27')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x28'),this['syncAgentDial']['bind'](this));ami['on'](_0xb5a3('0x29'),this['syncAgentDial'][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x2a'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x2b'),this['syncCustomEvent'][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x2c'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x2d'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));ami['on'](_0xb5a3('0x2e'),this[_0xb5a3('0x1d')]['bind'](this));ami['on'](_0xb5a3('0x2f'),this[_0xb5a3('0x1d')][_0xb5a3('0x20')](this));}Trigger[_0xb5a3('0x30')]['emit']=function(_0x4047e7,_0x258b0e,_0x4bfc5f){logger[_0xb5a3('0x31')](_0x4047e7,_0x258b0e,JSON[_0xb5a3('0x32')](_0x4bfc5f));io['to'](_0x4047e7)[_0xb5a3('0x33')](_0x258b0e,_0x4bfc5f);};Trigger[_0xb5a3('0x30')]['syncCustomEvent']=function(_0x22092b){var _0x438377=_[_0xb5a3('0x34')](_0x22092b);if(typeof _0x438377['motionChannel']===_0xb5a3('0x35')){_0x438377[_0xb5a3('0x36')]=_0xb5a3('0x37');}this[_0xb5a3('0x38')](_0x438377);};Trigger[_0xb5a3('0x30')][_0xb5a3('0x27')]=function(_0x529c6b){if(this['agents'][_0x529c6b[_0xb5a3('0x39')]]){this[_0xb5a3('0x1d')](_0x529c6b);}};Trigger[_0xb5a3('0x30')][_0xb5a3('0x38')]=function(_0x23429e){var _0x4357f3;for(var _0x31ba75 in this[_0xb5a3('0x3a')]){if(this[_0xb5a3('0x3a')][_0xb5a3('0x3b')](_0x31ba75)){if(this[_0xb5a3('0x3a')][_0x31ba75][_0xb5a3('0x3c')]){_0x4357f3=this[_0xb5a3('0x3d')](this[_0xb5a3('0x3a')][_0x31ba75],_0x23429e);if(_0x4357f3){_[_0xb5a3('0x3e')](_0x23429e,_0x23429e['variables']);for(var _0x26d9f3=0x0,_0x13e588,_0x3cb64d,_0x259d06;_0x26d9f30x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','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','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x5eeff0,_0x205558){var _0x44f500=function(_0x4580a7){while(--_0x4580a7){_0x5eeff0['push'](_0x5eeff0['shift']());}};_0x44f500(++_0x205558);}(_0x7217,0x19e));var _0x7721=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7217[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 01c986c..4679649 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 _0x2135=['destcalleridnum','calleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','enduserId','contactid',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','assign','Subjects','getString','Descriptions','Fields','phonecalls','callDirection','queue','/contacts(','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','toUpperCase',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','systemuserid','toLowerCase','outbound'];(function(_0x4187e2,_0x58cc2a){var _0x53bf3e=function(_0x56a717){while(--_0x56a717){_0x4187e2['push'](_0x4187e2['shift']());}};_0x53bf3e(++_0x58cc2a);}(_0x2135,0x1d2));var _0x5213=function(_0x2cb4ac,_0x2f165c){_0x2cb4ac=_0x2cb4ac-0x0;var _0x3c9c16=_0x2135[_0x2cb4ac];return _0x3c9c16;};'use strict';var _=require(_0x5213('0x0'));var BPromise=require(_0x5213('0x1'));var rp=require(_0x5213('0x2'));var util=require('util');var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x5213('0x3'))('dynamics365');var config=require(_0x5213('0x4'));config[_0x5213('0x5')]=_[_0x5213('0x6')](config[_0x5213('0x5')],{'host':_0x5213('0x7'),'port':0x18eb});var io=require(_0x5213('0x8'))(new Redis(config[_0x5213('0x5')]));function getAuthToken(_0x1c63c9,_0x25b223,_0x2b579e){var _0x235eca={'method':_0x5213('0x9'),'uri':_0x25b223,'form':{'client_id':_0x1c63c9[_0x5213('0xa')],'resource':_0x1c63c9[_0x5213('0xb')],'username':_0x1c63c9['username'],'password':_0x1c63c9[_0x5213('0xc')],'grant_type':_0x5213('0xc'),'client_secret':_0x1c63c9[_0x5213('0xd')]},'json':!![]};return rp(_0x235eca)[_0x5213('0xe')](function(_0x528ca2){return _0x528ca2[_0x5213('0xf')];})[_0x5213('0x10')](function(_0x5118d7){logger[_0x5213('0x11')]('['+[_0x2b579e['toUpperCase']()]+_0x5213('0x12'));return _0x5118d7[_0x5213('0x13')];});}function getUser(_0x16a37f,_0x4062ad,_0x3fce85,_0x12131a,_0x1022a8,_0x3693fb){return new BPromise(function(_0x2e1a15,_0x59a0c6){return getAuthToken(_0x4062ad,_0x12131a,_0x3693fb)[_0x5213('0xe')](function(_0x1e1471){var _0x157f97={'method':_0x5213('0x14'),'uri':_0x1022a8+_0x5213('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x1e1471,'OData-Version':_0x5213('0x16')},'json':!![]};return rp(_0x157f97);})[_0x5213('0xe')](function(_0x27847a){var _0x1b9352=_0x27847a[_0x5213('0x17')];var _0x475cd0=![];var _0x2d3ffd=null;if(!_[_0x5213('0x18')](_0x3fce85)){if(intUtil[_0x5213('0x19')](_0x3fce85[_0x5213('0x1a')])){_0x16a37f['userEmail']=_0x3fce85[_0x5213('0x1a')];for(_0x2d3ffd=0x0;_0x2d3ffd<_0x1b9352[_0x5213('0x1b')];_0x2d3ffd++){if(_0x1b9352[_0x2d3ffd][_0x5213('0x1c')]===_0x3fce85[_0x5213('0x1a')]&&!_0x1b9352[_0x2d3ffd][_0x5213('0x1d')]){_0x475cd0=!![];logger[_0x5213('0x1e')]('['+[_0x3693fb['toUpperCase']()]+_0x5213('0x1f')+_0x1b9352[_0x2d3ffd]['systemuserid']+'!');_0x16a37f[_0x5213('0x20')]=_0x1b9352[_0x2d3ffd]['systemuserid'];}}}}if(!_0x475cd0){logger[_0x5213('0x1e')]('['+[_0x3693fb[_0x5213('0x21')]()]+_0x5213('0x22'));_0x16a37f['userEmail']=_0x4062ad[_0x5213('0x23')];for(_0x2d3ffd=0x0;_0x2d3ffd<_0x1b9352[_0x5213('0x1b')];_0x2d3ffd++){if(_0x1b9352[_0x2d3ffd][_0x5213('0x1c')]===_0x4062ad[_0x5213('0x23')]){_0x16a37f[_0x5213('0x20')]=_0x1b9352[_0x2d3ffd][_0x5213('0x24')];}}}_0x2e1a15(_0x16a37f);})['catch'](function(_0x319bc6){_0x59a0c6(_0x319bc6[_0x5213('0x13')]);});});}function createEndUser(_0x48b2ad,_0x59a8a6,_0x5ae1a9,_0x282d1c,_0x1ba8d7,_0xcaf621){return new BPromise(function(_0x590589,_0x5b6480){return getAuthToken(_0x59a8a6,_0x5ae1a9,_0xcaf621)[_0x5213('0xe')](function(_0x567219){var _0x18a724=_0xcaf621[_0x5213('0x25')]()===_0x5213('0x26')?_0x1ba8d7[_0x5213('0x27')]:_0x1ba8d7[_0x5213('0x28')];var _0x2c7282={'method':_0x5213('0x9'),'uri':_0x282d1c+'contacts','body':{'telephone1':_0x18a724,'fullname':_0x18a724,'firstname':_0x18a724,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5213('0x29')+_0x48b2ad['userId']+')'},'headers':{'Authorization':_0x5213('0x2a')+_0x567219,'OData-Version':_0x5213('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2c7282);})[_0x5213('0xe')](function(_0x4078e4){var _0x3acd36=_0x4078e4[_0x5213('0x2b')][_0x5213('0x2c')];var _0x8fef36=_0x3acd36[_0x5213('0x2d')](_0x3acd36[_0x5213('0x2e')]('(')+0x1,_0x3acd36['lastIndexOf'](')'));_0x48b2ad['enduserId']=_0x8fef36;_0x590589(_0x48b2ad);})[_0x5213('0x10')](function(_0x224351){_0x5b6480(_0x224351[_0x5213('0x13')]);});});}function getEndUser(_0x607e42,_0x48dd95,_0x4eb91c,_0x2aa922,_0x604f0,_0x54fc11){return new BPromise(function(_0x55a641,_0x8c4662){var _0x152290=_0x54fc11['toLowerCase']()===_0x5213('0x26')?_0x604f0[_0x5213('0x27')]:_0x604f0[_0x5213('0x28')];return getAuthToken(_0x48dd95,_0x4eb91c,_0x54fc11)['then'](function(_0x29df2a){var _0x42ffe7={'method':'GET','uri':_0x2aa922+_0x5213('0x2f')+_0x152290[_0x5213('0x30')]('+',_0x5213('0x31'))+'\x27','headers':{'Authorization':_0x5213('0x2a')+_0x29df2a,'If-None-Match':null,'OData-Version':_0x5213('0x16')},'json':!![]};return rp(_0x42ffe7);})[_0x5213('0xe')](function(_0x3371a1){var _0x3e51c7=null;if(_0x3371a1){var _0x26037=_0x3371a1[_0x5213('0x17')];var _0x274f63=![];for(_0x3e51c7=0x0;_0x3e51c7<_0x26037[_0x5213('0x1b')];_0x3e51c7++){if(_0x26037[_0x3e51c7][_0x5213('0x32')]===_0x152290){_0x274f63=!![];_0x607e42[_0x5213('0x33')]=_0x26037[_0x3e51c7][_0x5213('0x34')];}}if(_0x274f63){_0x55a641(_0x607e42);}else{return createEndUser(_0x607e42,_0x48dd95,_0x4eb91c,_0x2aa922,_0x604f0,_0x54fc11)[_0x5213('0xe')](function(_0x1da866){logger['info']('['+[_0x54fc11[_0x5213('0x21')]()]+_0x5213('0x35'),_0x1da866[_0x5213('0x33')]);_0x55a641(_0x1da866);});}}else{return createEndUser(_0x607e42,_0x48dd95,_0x4eb91c,_0x2aa922,_0x604f0,_0x54fc11)[_0x5213('0xe')](function(_0x59e230){logger[_0x5213('0x1e')]('['+[_0x54fc11[_0x5213('0x21')]()]+']\x20Enduser\x20Created!',_0x59e230[_0x5213('0x33')]);_0x55a641(_0x59e230);});}});});}function getCustomFields(_0xd058ea,_0x5a39f9,_0x1a3df0){var _0x30714a={};if(_0xd058ea[_0x5213('0x1b')]>0x0){_[_0x5213('0x36')](_0xd058ea,function(_0x47e624){if(_[_0x5213('0x37')]([_0x5213('0x38'),_0x5213('0x39')],_0x47e624[_0x5213('0x3a')])&&_0x47e624[_0x5213('0x3b')]&&!_0x47e624[_0x5213('0x3c')]){var _0x734a30=_0x47e624[_0x5213('0x3d')][_0x5213('0x25')]();var _0x3ce061=_0x734a30[_0x5213('0x2d')](0x0,_0x734a30[_0x5213('0x3e')]('_'));var _0x305535=_0x734a30[_0x5213('0x2d')](_0x734a30[_0x5213('0x3e')]('_')+0x1);if(_0x3ce061===_0x1a3df0){_0x30714a[_0x305535]=_0x47e624[_0x5213('0x3f')];}}});}return _0x30714a;}function getTicket(_0x21dbc1,_0x2404df,_0x30b74a,_0x29fbdc,_0x3f71d8,_0x442b64,_0x48732c){return new BPromise(function(_0x66221d,_0xef7372){var _0x2917bb;return getAuthToken(_0x2404df,_0x30b74a,_0x48732c)[_0x5213('0xe')](function(_0x295f0b){if(_0x442b64[_0x5213('0x40')]===_0x5213('0x41')){_0x2917bb={'method':_0x5213('0x9'),'uri':_0x29fbdc+'incidents','body':Object[_0x5213('0x42')]({},{'title':intUtil['getString'](_0x442b64[_0x5213('0x43')],_0x3f71d8,'\x20'),'description':intUtil[_0x5213('0x44')](_0x442b64[_0x5213('0x45')],_0x3f71d8,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x21dbc1[_0x5213('0x33')]+')','ownerid@odata.bind':_0x5213('0x29')+_0x21dbc1['userId']+')','caseorigincode':'1'},getCustomFields(_0x442b64[_0x5213('0x46')],_0x3f71d8,_0x442b64[_0x5213('0x40')])),'headers':{'Authorization':_0x5213('0x2a')+_0x295f0b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x442b64['ticketType']==='phonecall'){_0x2917bb={'method':_0x5213('0x9'),'uri':_0x29fbdc+_0x5213('0x47'),'body':Object[_0x5213('0x42')]({},{'subject':intUtil['getString'](_0x442b64[_0x5213('0x43')],_0x3f71d8,'\x20'),'phonenumber':String(_0x3f71d8[_0x5213('0x28')]),'description':intUtil['getString'](_0x442b64[_0x5213('0x45')],_0x3f71d8,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x21dbc1['enduserId']+')','ownerid@odata.bind':_0x5213('0x29')+_0x21dbc1['userId']+')','directioncode':_0x21dbc1[_0x5213('0x48')]===_0x5213('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5213('0x29')+_0x21dbc1[_0x5213('0x20')]+')','participationtypemask':_0x21dbc1['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5213('0x4a')+_0x21dbc1[_0x5213('0x33')]+')','participationtypemask':_0x21dbc1[_0x5213('0x48')]===_0x5213('0x49')?0x1:0x2}]},getCustomFields(_0x442b64['Fields'],_0x3f71d8,_0x442b64[_0x5213('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x295f0b,'OData-Version':_0x5213('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2917bb);})['then'](function(_0x506733){var _0xc86f1d=_0x506733['headers'][_0x5213('0x2c')];var _0x2d3068=_0xc86f1d[_0x5213('0x2d')](_0xc86f1d[_0x5213('0x2e')]('(')+0x1,_0xc86f1d['lastIndexOf'](')'));_0x21dbc1[_0x5213('0x4b')]=_0x2d3068;_0x66221d(_0x21dbc1);})[_0x5213('0x10')](function(_0x29854f){_0xef7372(_0x29854f[_0x5213('0x13')]);});});}function emit(_0x4462a0,_0x19e248,_0xaa766c,_0x3d534e){var _0xc46db5={'uri':util[_0x5213('0x4c')](_0x5213('0x4d'),_0x4462a0,_0xaa766c,_0x3d534e)};io['to'](util[_0x5213('0x4c')]('user:%s',_0x19e248))[_0x5213('0x4e')](_0x5213('0x4f'),_0xc46db5);}exports['cs']=function(_0x5d0a40,_0xc476d,_0x14d481,_0x5d34c2,_0x463e69,_0xd650f,_0x49e5eb,_0x112635){var _0x36edfa={};_0xd650f[_0x5213('0xb')]=intUtil[_0x5213('0x50')](_0xd650f[_0x5213('0xb')]);_0xd650f[_0x5213('0x51')]=intUtil[_0x5213('0x50')](_0xd650f[_0x5213('0x51')]);_0x36edfa[_0x5213('0x48')]=_0x112635===_0x5213('0x49')||_0x112635==='unmanaged'?_0x5213('0x49'):_0x5213('0x26');var _0x321ab7=util['format']('%s/api/data/v9.0/',_0xd650f['remoteUri']);var _0x1fed2e=util[_0x5213('0x4c')]('https://login.microsoftonline.com/%s/oauth2/token',_0xd650f[_0x5213('0x52')]);var _0x1e6e51=util[_0x5213('0x4c')](_0x5213('0x53'),_0xd650f[_0x5213('0x51')],_0xc476d[_0x5213('0x54')],md5(_0xc476d['uniqueid']));if(_0x463e69&&_0x463e69[_0x5213('0x55')]){logger[_0x5213('0x1e')](_0x5213('0x56'),_0x5213('0x57'));_0xc476d['recordingURL']=_0x1e6e51;}else if(_0x49e5eb&&_0x49e5eb['recordingFormat']&&_0x49e5eb[_0x5213('0x58')]!==_0x5213('0x59')){logger[_0x5213('0x1e')](_0x5213('0x5a'),_0x5213('0x57'));_0xc476d[_0x5213('0x5b')]=_0x1e6e51;}else{_0xc476d[_0x5213('0x5b')]='';}return getUser(_0x36edfa,_0xd650f,_0x5d34c2,_0x1fed2e,_0x321ab7,_0x112635)[_0x5213('0xe')](function(_0x1141d3){logger[_0x5213('0x1e')]('['+_0x112635[_0x5213('0x21')]()+_0x5213('0x5c'),_0x1141d3[_0x5213('0x20')]);logger[_0x5213('0x1e')]('['+_0x112635[_0x5213('0x21')]()+_0x5213('0x5d'),_0x1141d3[_0x5213('0x5e')]);return getEndUser(_0x1141d3,_0xd650f,_0x1fed2e,_0x321ab7,_0xc476d,_0x112635);})[_0x5213('0xe')](function(_0x27b23f){logger[_0x5213('0x1e')]('['+_0x112635[_0x5213('0x21')]()+_0x5213('0x5f'),_0x27b23f[_0x5213('0x33')]);logger[_0x5213('0x1e')]('['+_0x112635[_0x5213('0x21')]()+_0x5213('0x60'),_0xc476d['calleridnum']);return getTicket(_0x27b23f,_0xd650f,_0x1fed2e,_0x321ab7,_0xc476d,_0x14d481,_0x112635);})[_0x5213('0xe')](function(_0x2d5105){logger[_0x5213('0x1e')](util[_0x5213('0x4c')]('['+_0x112635[_0x5213('0x21')]()+_0x5213('0x61'),_0x14d481['ticketType'],_0x2d5105[_0x5213('0x4b')]));logger[_0x5213('0x1e')](util[_0x5213('0x4c')]('['+_0x112635[_0x5213('0x21')]()+']\x20Call\x20direction:\x20%s',_0x112635));if(_0x112635!==_0x5213('0x62')){logger['info']('['+_0x112635['toUpperCase']()+']',_0x5213('0x63'));emit(_0xd650f['remoteUri'],_0x5d34c2['name'],_0x14d481[_0x5213('0x40')],_0x2d5105[_0x5213('0x4b')]);}})[_0x5213('0x10')](function(_0x5734cd){logger[_0x5213('0x11')]('['+_0x112635[_0x5213('0x21')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x5213('0x64')](_0x5734cd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdec0=['bluebird','request-promise','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','POST','clientId','remoteUri','username','password','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','then','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','lastIndexOf','outbound','replace','%2b','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','forEach','string','picklist','type','customField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','phonecall','phonecalls','Descriptions','/contacts(','callDirection','queue','Fields','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdec0,0xc7));var _0x0dec=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0xdec0[_0x1deee5];return _0x1d6c3a;};'use strict';var _=require(_0x0dec('0x0'));var BPromise=require(_0x0dec('0x1'));var rp=require(_0x0dec('0x2'));var util=require('util');var intUtil=require(_0x0dec('0x3'));var md5=require(_0x0dec('0x4'));var Redis=require(_0x0dec('0x5'));var logger=require('../../../../config/logger')(_0x0dec('0x6'));var config=require(_0x0dec('0x7'));config[_0x0dec('0x8')]=_['defaults'](config[_0x0dec('0x8')],{'host':_0x0dec('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0dec('0x8')]));function getAuthToken(_0x186f41,_0x511cbd,_0xd02343){var _0x556e34={'method':_0x0dec('0xa'),'uri':_0x511cbd,'form':{'client_id':_0x186f41[_0x0dec('0xb')],'resource':_0x186f41[_0x0dec('0xc')],'username':_0x186f41[_0x0dec('0xd')],'password':_0x186f41[_0x0dec('0xe')],'grant_type':'password','client_secret':_0x186f41['clientSecret']},'json':!![]};return rp(_0x556e34)['then'](function(_0x1c5d71){return _0x1c5d71[_0x0dec('0xf')];})[_0x0dec('0x10')](function(_0x4ce86d){logger[_0x0dec('0x11')]('['+[_0xd02343[_0x0dec('0x12')]()]+_0x0dec('0x13'));return _0x4ce86d['message'];});}function getUser(_0x1b700e,_0x5e7424,_0x38268f,_0x16a501,_0x39b00a,_0x19e06d){return new BPromise(function(_0x3d2554,_0x4854b9){return getAuthToken(_0x5e7424,_0x16a501,_0x19e06d)['then'](function(_0x31d1c9){var _0x5120cf={'method':_0x0dec('0x14'),'uri':_0x39b00a+_0x0dec('0x15'),'headers':{'Authorization':_0x0dec('0x16')+_0x31d1c9,'OData-Version':_0x0dec('0x17')},'json':!![]};return rp(_0x5120cf);})[_0x0dec('0x18')](function(_0x5e627c){var _0x36adf4=_0x5e627c[_0x0dec('0x19')];var _0x2130c9=![];var _0x1236c7=null;if(!_[_0x0dec('0x1a')](_0x38268f)){if(intUtil[_0x0dec('0x1b')](_0x38268f[_0x0dec('0x1c')])){_0x1b700e[_0x0dec('0x1d')]=_0x38268f['email'];for(_0x1236c7=0x0;_0x1236c7<_0x36adf4[_0x0dec('0x1e')];_0x1236c7++){if(_0x36adf4[_0x1236c7][_0x0dec('0x1f')]===_0x38268f[_0x0dec('0x1c')]&&!_0x36adf4[_0x1236c7][_0x0dec('0x20')]){_0x2130c9=!![];logger[_0x0dec('0x21')]('['+[_0x19e06d['toUpperCase']()]+_0x0dec('0x22')+_0x36adf4[_0x1236c7][_0x0dec('0x23')]+'!');_0x1b700e[_0x0dec('0x24')]=_0x36adf4[_0x1236c7]['systemuserid'];}}}}if(!_0x2130c9){logger[_0x0dec('0x21')]('['+[_0x19e06d[_0x0dec('0x12')]()]+_0x0dec('0x25'));_0x1b700e[_0x0dec('0x1d')]=_0x5e7424[_0x0dec('0xd')];for(_0x1236c7=0x0;_0x1236c7<_0x36adf4[_0x0dec('0x1e')];_0x1236c7++){if(_0x36adf4[_0x1236c7]['internalemailaddress']===_0x5e7424[_0x0dec('0xd')]){_0x1b700e[_0x0dec('0x24')]=_0x36adf4[_0x1236c7][_0x0dec('0x23')];}}}_0x3d2554(_0x1b700e);})['catch'](function(_0x5a6840){_0x4854b9(_0x5a6840[_0x0dec('0x26')]);});});}function createEndUser(_0x24f4fc,_0x2de481,_0x2163b5,_0x5ed333,_0x26b1cb,_0x381fb7){return new BPromise(function(_0xc087a4,_0x1817e0){return getAuthToken(_0x2de481,_0x2163b5,_0x381fb7)[_0x0dec('0x18')](function(_0xce5229){var _0x40d685=_0x381fb7[_0x0dec('0x27')]()==='outbound'?_0x26b1cb[_0x0dec('0x28')]:_0x26b1cb[_0x0dec('0x29')];var _0x134469={'method':_0x0dec('0xa'),'uri':_0x5ed333+'contacts','body':{'telephone1':_0x40d685,'fullname':_0x40d685,'firstname':_0x40d685,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x0dec('0x2a')+_0x24f4fc['userId']+')'},'headers':{'Authorization':_0x0dec('0x16')+_0xce5229,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x134469);})['then'](function(_0x19114c){var _0x452484=_0x19114c[_0x0dec('0x2b')][_0x0dec('0x2c')];var _0x5e7492=_0x452484['substring'](_0x452484[_0x0dec('0x2d')]('(')+0x1,_0x452484[_0x0dec('0x2d')](')'));_0x24f4fc['enduserId']=_0x5e7492;_0xc087a4(_0x24f4fc);})[_0x0dec('0x10')](function(_0x563a4a){_0x1817e0(_0x563a4a[_0x0dec('0x26')]);});});}function getEndUser(_0x516c5b,_0x1b2f43,_0x52e48f,_0x3204f1,_0x50c6f2,_0x34248d){return new BPromise(function(_0x28aec9,_0xaa4f20){var _0x1c18ba=_0x34248d[_0x0dec('0x27')]()===_0x0dec('0x2e')?_0x50c6f2[_0x0dec('0x28')]:_0x50c6f2[_0x0dec('0x29')];return getAuthToken(_0x1b2f43,_0x52e48f,_0x34248d)[_0x0dec('0x18')](function(_0x1caec7){var _0x81b159={'method':_0x0dec('0x14'),'uri':_0x3204f1+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x1c18ba[_0x0dec('0x2f')]('+',_0x0dec('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1caec7,'If-None-Match':null,'OData-Version':_0x0dec('0x17')},'json':!![]};return rp(_0x81b159);})['then'](function(_0x2b3dad){var _0x30c7f3=null;if(_0x2b3dad){var _0x39ab00=_0x2b3dad[_0x0dec('0x19')];var _0x24680e=![];for(_0x30c7f3=0x0;_0x30c7f3<_0x39ab00[_0x0dec('0x1e')];_0x30c7f3++){if(_0x39ab00[_0x30c7f3][_0x0dec('0x31')]===_0x1c18ba){_0x24680e=!![];_0x516c5b[_0x0dec('0x32')]=_0x39ab00[_0x30c7f3][_0x0dec('0x33')];}}if(_0x24680e){_0x28aec9(_0x516c5b);}else{return createEndUser(_0x516c5b,_0x1b2f43,_0x52e48f,_0x3204f1,_0x50c6f2,_0x34248d)[_0x0dec('0x18')](function(_0x2e8f99){logger[_0x0dec('0x21')]('['+[_0x34248d['toUpperCase']()]+']\x20Enduser\x20created!',_0x2e8f99[_0x0dec('0x32')]);_0x28aec9(_0x2e8f99);});}}else{return createEndUser(_0x516c5b,_0x1b2f43,_0x52e48f,_0x3204f1,_0x50c6f2,_0x34248d)[_0x0dec('0x18')](function(_0x17ceab){logger[_0x0dec('0x21')]('['+[_0x34248d['toUpperCase']()]+_0x0dec('0x34'),_0x17ceab['enduserId']);_0x28aec9(_0x17ceab);});}});});}function getCustomFields(_0x5ae71f,_0x5b0495,_0xce5b2e){var _0x3a52c8={};if(_0x5ae71f[_0x0dec('0x1e')]>0x0){_[_0x0dec('0x35')](_0x5ae71f,function(_0x348295){if(_['includes']([_0x0dec('0x36'),_0x0dec('0x37')],_0x348295[_0x0dec('0x38')])&&_0x348295['nameField']&&!_0x348295[_0x0dec('0x39')]){var _0x2cb81a=_0x348295['idField']['toLowerCase']();var _0x426b6a=_0x2cb81a[_0x0dec('0x3a')](0x0,_0x2cb81a[_0x0dec('0x3b')]('_'));var _0x1af4dc=_0x2cb81a[_0x0dec('0x3a')](_0x2cb81a[_0x0dec('0x3b')]('_')+0x1);if(_0x426b6a===_0xce5b2e){_0x3a52c8[_0x1af4dc]=_0x348295[_0x0dec('0x3c')];}}});}return _0x3a52c8;}function getTicket(_0x154f9f,_0x4dc7eb,_0x38c02e,_0x550ae0,_0x4c3fcb,_0x3be158,_0x1e1966){return new BPromise(function(_0x71e44,_0x39c0ae){var _0x33e06d;return getAuthToken(_0x4dc7eb,_0x38c02e,_0x1e1966)[_0x0dec('0x18')](function(_0x3100df){if(_0x3be158[_0x0dec('0x3d')]===_0x0dec('0x3e')){_0x33e06d={'method':_0x0dec('0xa'),'uri':_0x550ae0+_0x0dec('0x3f'),'body':Object[_0x0dec('0x40')]({},{'title':intUtil[_0x0dec('0x41')](_0x3be158[_0x0dec('0x42')],_0x4c3fcb,'\x20'),'description':intUtil[_0x0dec('0x41')](_0x3be158['Descriptions'],_0x4c3fcb,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x154f9f[_0x0dec('0x32')]+')','ownerid@odata.bind':_0x0dec('0x2a')+_0x154f9f['userId']+')','caseorigincode':'1'},getCustomFields(_0x3be158['Fields'],_0x4c3fcb,_0x3be158['ticketType'])),'headers':{'Authorization':_0x0dec('0x16')+_0x3100df,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3be158[_0x0dec('0x3d')]===_0x0dec('0x43')){_0x33e06d={'method':_0x0dec('0xa'),'uri':_0x550ae0+_0x0dec('0x44'),'body':Object['assign']({},{'subject':intUtil[_0x0dec('0x41')](_0x3be158[_0x0dec('0x42')],_0x4c3fcb,'\x20'),'phonenumber':String(_0x4c3fcb['calleridnum']),'description':intUtil['getString'](_0x3be158[_0x0dec('0x45')],_0x4c3fcb,'\x0a'),'regardingobjectid_contact@odata.bind':_0x0dec('0x46')+_0x154f9f[_0x0dec('0x32')]+')','ownerid@odata.bind':_0x0dec('0x2a')+_0x154f9f[_0x0dec('0x24')]+')','directioncode':_0x154f9f[_0x0dec('0x47')]===_0x0dec('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0dec('0x2a')+_0x154f9f[_0x0dec('0x24')]+')','participationtypemask':_0x154f9f[_0x0dec('0x47')]===_0x0dec('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x0dec('0x46')+_0x154f9f['enduserId']+')','participationtypemask':_0x154f9f[_0x0dec('0x47')]===_0x0dec('0x48')?0x1:0x2}]},getCustomFields(_0x3be158[_0x0dec('0x49')],_0x4c3fcb,_0x3be158['ticketType'])),'headers':{'Authorization':_0x0dec('0x16')+_0x3100df,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x33e06d);})[_0x0dec('0x18')](function(_0x430a5d){var _0x4b3534=_0x430a5d[_0x0dec('0x2b')][_0x0dec('0x2c')];var _0x3fca91=_0x4b3534[_0x0dec('0x3a')](_0x4b3534[_0x0dec('0x2d')]('(')+0x1,_0x4b3534[_0x0dec('0x2d')](')'));_0x154f9f[_0x0dec('0x4a')]=_0x3fca91;_0x71e44(_0x154f9f);})['catch'](function(_0x18a952){_0x39c0ae(_0x18a952[_0x0dec('0x26')]);});});}function emit(_0x417f8b,_0x4aacaa,_0x3b15a7,_0x517caf){var _0x3bb6a0={'uri':util[_0x0dec('0x4b')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x417f8b,_0x3b15a7,_0x517caf)};io['to'](util[_0x0dec('0x4b')](_0x0dec('0x4c'),_0x4aacaa))[_0x0dec('0x4d')](_0x0dec('0x4e'),_0x3bb6a0);}exports['cs']=function(_0x33ae9e,_0xf28dfa,_0x3a2367,_0x393a9d,_0x489806,_0x2852f1,_0x53ff67,_0x2b292c){var _0x5d102c={};_0x2852f1[_0x0dec('0xc')]=intUtil[_0x0dec('0x4f')](_0x2852f1[_0x0dec('0xc')]);_0x2852f1[_0x0dec('0x50')]=intUtil[_0x0dec('0x4f')](_0x2852f1[_0x0dec('0x50')]);_0x5d102c[_0x0dec('0x47')]=_0x2b292c===_0x0dec('0x48')||_0x2b292c===_0x0dec('0x51')?'queue':_0x0dec('0x2e');var _0x16e75a=util[_0x0dec('0x4b')](_0x0dec('0x52'),_0x2852f1[_0x0dec('0xc')]);var _0x19f1d4=util[_0x0dec('0x4b')](_0x0dec('0x53'),_0x2852f1[_0x0dec('0x54')]);var _0x338e0f=util[_0x0dec('0x4b')](_0x0dec('0x55'),_0x2852f1[_0x0dec('0x50')],_0xf28dfa[_0x0dec('0x56')],md5(_0xf28dfa['uniqueid']));if(_0x489806&&_0x489806[_0x0dec('0x57')]){logger[_0x0dec('0x21')](_0x0dec('0x58'),_0x0dec('0x59'));_0xf28dfa[_0x0dec('0x5a')]=_0x338e0f;}else if(_0x53ff67&&_0x53ff67['recordingFormat']&&_0x53ff67[_0x0dec('0x5b')]!==_0x0dec('0x5c')){logger[_0x0dec('0x21')](_0x0dec('0x5d'),'Recording\x20is\x20enabled!');_0xf28dfa['recordingURL']=_0x338e0f;}else{_0xf28dfa['recordingURL']='';}return getUser(_0x5d102c,_0x2852f1,_0x393a9d,_0x19f1d4,_0x16e75a,_0x2b292c)[_0x0dec('0x18')](function(_0x67ee90){logger[_0x0dec('0x21')]('['+_0x2b292c['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x67ee90[_0x0dec('0x24')]);logger[_0x0dec('0x21')]('['+_0x2b292c[_0x0dec('0x12')]()+_0x0dec('0x5e'),_0x67ee90[_0x0dec('0x1d')]);return getEndUser(_0x67ee90,_0x2852f1,_0x19f1d4,_0x16e75a,_0xf28dfa,_0x2b292c);})[_0x0dec('0x18')](function(_0x38fbf8){logger['info']('['+_0x2b292c[_0x0dec('0x12')]()+_0x0dec('0x5f'),_0x38fbf8[_0x0dec('0x32')]);logger['info']('['+_0x2b292c[_0x0dec('0x12')]()+_0x0dec('0x60'),_0xf28dfa['calleridnum']);return getTicket(_0x38fbf8,_0x2852f1,_0x19f1d4,_0x16e75a,_0xf28dfa,_0x3a2367,_0x2b292c);})[_0x0dec('0x18')](function(_0x14d4f7){logger[_0x0dec('0x21')](util['format']('['+_0x2b292c['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x3a2367['ticketType'],_0x14d4f7['ticketId']));logger[_0x0dec('0x21')](util['format']('['+_0x2b292c[_0x0dec('0x12')]()+_0x0dec('0x61'),_0x2b292c));if(_0x2b292c!=='unmanaged'){logger[_0x0dec('0x21')]('['+_0x2b292c[_0x0dec('0x12')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2852f1['remoteUri'],_0x393a9d[_0x0dec('0x62')],_0x3a2367[_0x0dec('0x3d')],_0x14d4f7['ticketId']);}})['catch'](function(_0x3eff74){logger['error']('['+_0x2b292c[_0x0dec('0x12')]()+_0x0dec('0x63'),util['inspect'](_0x3eff74,{'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 338268f..0ed8257 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 _0x520e=['customField','push','content','variable','variableName','Variable','name','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','toString','base64','debug','[HTTP]','stringify','GET','map','includes','picklist','type','nameField','toLowerCase','idField'];(function(_0x137652,_0x2c1907){var _0x383f7c=function(_0x6cf849){while(--_0x6cf849){_0x137652['push'](_0x137652['shift']());}};_0x383f7c(++_0x2c1907);}(_0x520e,0x76));var _0xe520=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x520e[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0xe520('0x0'));var rp=require(_0xe520('0x1'));var md5=require(_0xe520('0x2'));var util=require(_0xe520('0x3'));var Redis=require('ioredis');var intUtil=require(_0xe520('0x4'));var config=require(_0xe520('0x5'));var logger=require(_0xe520('0x6'))(_0xe520('0x7'));config[_0xe520('0x8')]=_[_0xe520('0x9')](config['redis'],{'host':_0xe520('0xa'),'port':0x18eb});var io=require(_0xe520('0xb'))(new Redis(config[_0xe520('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xe520('0xc')};function emit(_0x4f9fe3,_0xb6db85,_0x1791c9){io['to'](_0x4f9fe3)[_0xe520('0xd')](_0xb6db85,_0x1791c9);}function getTicket(_0x5548bc,_0x262ebb,_0x1b34ed,_0x30c532,_0x482451){logger[_0xe520('0xe')](_0xe520('0xf'));var _0xe437d4=_[_0xe520('0x10')]({'responder_id':_0x262ebb['id'],'requester_id':_0x1b34ed['id'],'name':util[_0xe520('0x11')](_0xe520('0x12'),_0x482451['calleridname']),'phone':_0x482451['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x30c532['Subjects'],_0x482451,'\x20'),'description':intUtil[_0xe520('0x13')](_0x30c532['Descriptions'],_0x482451,'
'),'tags':getTags(_0x30c532['Tags'],'name')},getCustomFields(_0x30c532[_0xe520('0x14')],_0x482451));_0xe437d4[_0xe520('0x15')]=_[_0xe520('0x16')](_[_0xe520('0x17')](_0xe437d4[_0xe520('0x15')],'id'),'value');return request({'uri':util[_0xe520('0x11')](_0xe520('0x18'),_0x5548bc[_0xe520('0x19')]),'method':_0xe520('0x1a'),'body':_0xe437d4})[_0xe520('0x1b')](function(_0x28a74f){logger[_0xe520('0xe')](_0xe520('0x1c'));return _0x28a74f;});}function getUser(_0x5a7cda,_0x4c88d9){if(intUtil[_0xe520('0x1d')](_0x4c88d9)){return request({'uri':util['format'](_0xe520('0x1e'),_0x5a7cda[_0xe520('0x19')]),'qs':{'email':_0x4c88d9}})[_0xe520('0x1b')](function(_0x5792dc){if(_0x5792dc[_0xe520('0x1f')]){logger['info'](_0xe520('0x20'));return _[_0xe520('0x21')](_0x5792dc,function(_0x466ba3){return _0x466ba3[_0xe520('0x22')][_0xe520('0x23')]===_0x4c88d9;});}else{logger[_0xe520('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe520('0x11')](_0xe520('0x24'),_0x5a7cda['remoteUri'])})['then'](function(_0x1d3b46){logger[_0xe520('0xe')](_0xe520('0x25'));return _0x1d3b46;});}});}else{logger[_0xe520('0xe')](_0xe520('0x26'));return request({'uri':util['format'](_0xe520('0x24'),_0x5a7cda[_0xe520('0x19')])})['then'](function(_0x2e8142){logger['info'](_0xe520('0x25'));return _0x2e8142;});}}function getEndUser(_0x48a5a1,_0x2e0920,_0x420012){logger['info']('Searching\x20enduser\x20with\x20phone',_0x420012);return request({'uri':util[_0xe520('0x11')](_0xe520('0x27'),_0x48a5a1[_0xe520('0x19')]),'qs':{'phone':_0x420012}})[_0xe520('0x1b')](function(_0x19aa8b){if(_0x19aa8b[_0xe520('0x1f')]){logger[_0xe520('0xe')](_0xe520('0x28'));return _[_0xe520('0x21')](_0x19aa8b,{'phone':_0x420012});}else{logger[_0xe520('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe520('0x11')](_0xe520('0x27'),_0x48a5a1[_0xe520('0x19')]),'method':_0xe520('0x1a'),'body':{'name':_0x2e0920,'phone':_0x420012}})['then'](function(_0x3fffb0){logger[_0xe520('0xe')]('Enduser\x20created.');return _0x3fffb0;});}});}function getAuth(_0x34ea39){return util['format']('Basic\x20%s',new Buffer(_0x34ea39['apiKey']+':X')[_0xe520('0x29')](_0xe520('0x2a')));}function request(_0x2b8573){logger[_0xe520('0x2b')](_0xe520('0x2c'),JSON[_0xe520('0x2d')](_0x2b8573));return rp(_['defaults'](_0x2b8573,{'method':_0xe520('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x15eeec,_0x240003){var _0x3eb75a=[];if(_0x15eeec&&_0x15eeec[_0xe520('0x1f')]>0x0){_0x3eb75a=_[_0xe520('0x2f')](_0x15eeec,_0x240003);}return _0x3eb75a;}function getCustomFields(_0x53834f,_0x3a0282){var _0x6b5fc2=[];var _0x359c11={'custom_fields':[]};if(_0x53834f[_0xe520('0x1f')]>0x0){_['forEach'](_0x53834f,function(_0x5cf8e2){if(_[_0xe520('0x30')](['string',_0xe520('0x31')],_0x5cf8e2[_0xe520('0x32')])&&_0x5cf8e2['nameField']&&!_0x5cf8e2['customField']){_0x359c11[_0x5cf8e2[_0xe520('0x33')][_0xe520('0x34')]()]=_0x5cf8e2['content'][_0xe520('0x29')]();}else if(_[_0xe520('0x30')](['string',_0xe520('0x31')],_0x5cf8e2['type'])&&_0x5cf8e2[_0xe520('0x35')]&&_0x5cf8e2[_0xe520('0x36')]){_0x359c11[_0xe520('0x15')][_0xe520('0x37')]({'id':_0x5cf8e2[_0xe520('0x35')],'value':_0x5cf8e2[_0xe520('0x38')]['toString']()});}else if(_0x5cf8e2['type']===_0xe520('0x39')&&_0x5cf8e2[_0xe520('0x3a')]&&_0x5cf8e2[_0xe520('0x35')]&&_0x5cf8e2['customField']){_0x3a0282[_0x5cf8e2['variableName']]&&_0x359c11[_0xe520('0x15')][_0xe520('0x37')]({'id':_0x5cf8e2['idField'],'value':_0x3a0282[_0x5cf8e2['variableName']][_0xe520('0x29')]()});}else if(_0x5cf8e2[_0xe520('0x32')]==='customVariable'&&_0x5cf8e2[_0xe520('0x3b')]&&_0x5cf8e2[_0xe520('0x3b')][_0xe520('0x3c')]&&_0x5cf8e2[_0xe520('0x35')]&&_0x5cf8e2[_0xe520('0x36')]){_0x3a0282[_0x5cf8e2[_0xe520('0x3b')][_0xe520('0x3c')][_0xe520('0x34')]()]&&_0x359c11[_0xe520('0x15')]['push']({'id':_0x5cf8e2[_0xe520('0x35')],'value':_0x3a0282[_0x5cf8e2[_0xe520('0x3b')]['name'][_0xe520('0x34')]()][_0xe520('0x29')]()});}});}return _0x359c11;}exports[_0xe520('0x3d')]=function(_0x59c78b,_0x20464b,_0x5a781b,_0x33c77a,_0x596715,_0x304845){var _0x1d3a0d,_0x35857e;_0x304845[_0xe520('0x19')]=intUtil['stripTrailingSlash'](_0x304845[_0xe520('0x19')]);_0x304845[_0xe520('0x3e')]=intUtil[_0xe520('0x3f')](_0x304845[_0xe520('0x3e')]);if(_0x596715&&_0x596715['monitor_format']){logger['info']('[QUEUE]',_0xe520('0x40'));_0x20464b[_0xe520('0x41')]=util[_0xe520('0x11')](_0xe520('0x42'),_0x304845['serverUrl'],_0x20464b[_0xe520('0x43')],md5(_0x20464b[_0xe520('0x43')]));}else{_0x20464b[_0xe520('0x41')]='';}headers[_0xe520('0x44')]=getAuth(_0x304845);return getUser(_0x304845,_0x33c77a['email'])[_0xe520('0x1b')](function(_0x5083b7){_0x1d3a0d=_0x5083b7;logger[_0xe520('0xe')](_0xe520('0x45'),_0x1d3a0d['id']);return getEndUser(_0x304845,_0x20464b[_0xe520('0x46')],_0x20464b['calleridnum']);})[_0xe520('0x1b')](function(_0x3708d7){_0x35857e=_0x3708d7;logger[_0xe520('0xe')](_0xe520('0x47'),_0x35857e['id']);return getTicket(_0x304845,_0x1d3a0d,_0x35857e,_0x5a781b,_0x20464b);})[_0xe520('0x1b')](function(_0x241fdc){if(_0x241fdc&&_0x241fdc['id']){logger[_0xe520('0xe')](_0xe520('0x1c'));logger[_0xe520('0xe')]('The\x20Ticket\x20ID\x20is:',_0x241fdc['id']);logger[_0xe520('0xe')](_0xe520('0x48'),_0xe520('0x49'));emit(util[_0xe520('0x11')](_0xe520('0x4a'),_0x33c77a[_0xe520('0x3c')]),_0xe520('0x4b'),{'uri':util['format'](_0xe520('0x4c'),_0x304845[_0xe520('0x19')],_0x241fdc['id'])});}})[_0xe520('0x4d')](function(_0x124722){logger[_0xe520('0x4e')](_0xe520('0x48'),JSON[_0xe520('0x2d')](_0x124722));});};exports['outbound']=function(_0x8f6b28,_0x1208ca,_0x4c4274,_0x5aaef1,_0x32e240,_0x3a79fa,_0x2b6552){var _0x4b8dbb,_0x33f747;_0x3a79fa[_0xe520('0x19')]=intUtil[_0xe520('0x3f')](_0x3a79fa[_0xe520('0x19')]);_0x3a79fa['serverUrl']=intUtil[_0xe520('0x3f')](_0x3a79fa[_0xe520('0x3e')]);if(_0x2b6552&&_0x2b6552[_0xe520('0x4f')]&&_0x2b6552[_0xe520('0x4f')]!=='none'){logger[_0xe520('0xe')](_0xe520('0x50'),'Recording\x20is\x20enabled!');_0x1208ca[_0xe520('0x41')]=util[_0xe520('0x11')](_0xe520('0x42'),_0x3a79fa[_0xe520('0x3e')],_0x1208ca[_0xe520('0x43')],md5(_0x1208ca[_0xe520('0x43')]));}headers[_0xe520('0x44')]=getAuth(_0x3a79fa);return getUser(_0x3a79fa,_0x5aaef1[_0xe520('0x23')])[_0xe520('0x1b')](function(_0x1c9e8a){_0x4b8dbb=_0x1c9e8a;logger[_0xe520('0xe')]('The\x20User\x20ID\x20is:',_0x4b8dbb['id']);return getEndUser(_0x3a79fa,_0x1208ca['destcalleridname'],_0x1208ca[_0xe520('0x51')]);})[_0xe520('0x1b')](function(_0x399c34){_0x33f747=_0x399c34;logger['info'](_0xe520('0x47'),_0x33f747['id']);return getTicket(_0x3a79fa,_0x4b8dbb,_0x33f747,_0x4c4274,_0x1208ca);})[_0xe520('0x1b')](function(_0x6cdc61){if(_0x6cdc61&&_0x6cdc61['id']){logger[_0xe520('0xe')]('Ticket\x20created!');logger[_0xe520('0xe')](_0xe520('0x52'),_0x6cdc61['id']);logger[_0xe520('0xe')](_0xe520('0x50'),_0xe520('0x49'));emit(util[_0xe520('0x11')](_0xe520('0x4a'),_0x5aaef1[_0xe520('0x3c')]),'trigger:browser:url',{'uri':util[_0xe520('0x11')](_0xe520('0x4c'),_0x3a79fa[_0xe520('0x19')],_0x6cdc61['id'])});}})['catch'](function(_0x443ba4){logger[_0xe520('0x4e')]('[OUTBOUND]',JSON[_0xe520('0x2d')](_0x443ba4));});};exports[_0xe520('0x53')]=function(_0x3e7e34,_0x581729,_0x3d2a94,_0x50df9d,_0x13ee57,_0x5d6c87){var _0x594824,_0x25f226;_0x5d6c87[_0xe520('0x19')]=intUtil[_0xe520('0x3f')](_0x5d6c87[_0xe520('0x19')]);_0x5d6c87[_0xe520('0x3e')]=intUtil['stripTrailingSlash'](_0x5d6c87[_0xe520('0x3e')]);if(_0x13ee57&&_0x13ee57['monitor_format']){logger['info']('['+_0x581729[_0xe520('0x54')][_0xe520('0x55')]()+']','Recording\x20is\x20enabled!');_0x581729[_0xe520('0x41')]=util['format'](_0xe520('0x42'),_0x5d6c87['serverUrl'],_0x581729[_0xe520('0x43')],md5(_0x581729[_0xe520('0x43')]));}else{_0x581729[_0xe520('0x41')]='';}headers['Authorization']=getAuth(_0x5d6c87);return getUser(_0x5d6c87,'')[_0xe520('0x1b')](function(_0x480d0a){_0x594824=_0x480d0a;logger[_0xe520('0xe')](_0xe520('0x45'),_0x594824['id']);return getEndUser(_0x5d6c87,_0x581729[_0xe520('0x46')],_0x581729['calleridnum']);})[_0xe520('0x1b')](function(_0x2e1acb){_0x25f226=_0x2e1acb;logger[_0xe520('0xe')]('The\x20Enduser\x20ID\x20is:',_0x25f226['id']);return getTicket(_0x5d6c87,_0x594824,_0x25f226,_0x3d2a94,_0x581729);})[_0xe520('0x1b')](function(_0x2534a3){if(_0x2534a3){logger[_0xe520('0xe')](_0xe520('0x1c'));logger[_0xe520('0xe')](_0xe520('0x52'),_0x2534a3['id']);}})['catch'](function(_0x3fb276){logger['error']('['+_0x581729[_0xe520('0x54')][_0xe520('0x55')]()+']',JSON[_0xe520('0x2d')](_0x3fb276));});}; \ No newline at end of file +var _0xcb2e=['remoteUri','length','Agent\x20found!','find','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','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','includes','string','picklist','type','toLowerCase','content','idField','customField','variableName','customVariable','Variable','name','push','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','catch','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','emit','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','custom_fields','keyBy','value','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','%s/api/v2/agents'];(function(_0x3a7582,_0x4871fc){var _0x386399=function(_0x8ef2d2){while(--_0x8ef2d2){_0x3a7582['push'](_0x3a7582['shift']());}};_0x386399(++_0x4871fc);}(_0xcb2e,0x1a0));var _0xecb2=function(_0x108678,_0x34e67c){_0x108678=_0x108678-0x0;var _0x15fd03=_0xcb2e[_0x108678];return _0x15fd03;};'use strict';var _=require(_0xecb2('0x0'));var rp=require(_0xecb2('0x1'));var md5=require('md5');var util=require(_0xecb2('0x2'));var Redis=require(_0xecb2('0x3'));var intUtil=require(_0xecb2('0x4'));var config=require(_0xecb2('0x5'));var logger=require(_0xecb2('0x6'))('freshdesk');config['redis']=_['defaults'](config[_0xecb2('0x7')],{'host':_0xecb2('0x8'),'port':0x18eb});var io=require(_0xecb2('0x9'))(new Redis(config[_0xecb2('0x7')]));var headers={'Content-Type':_0xecb2('0xa'),'Accept':_0xecb2('0xa')};function emit(_0x2be763,_0x24ebbd,_0x535517){io['to'](_0x2be763)[_0xecb2('0xb')](_0x24ebbd,_0x535517);}function getTicket(_0x5447e0,_0x490908,_0x34666c,_0x592a01,_0x2b22cb){logger['info']('Creating\x20new\x20ticket...');var _0x2f2f8e=_[_0xecb2('0xc')]({'responder_id':_0x490908['id'],'requester_id':_0x34666c['id'],'name':util[_0xecb2('0xd')]('Caller\x20-\x20%s',_0x2b22cb[_0xecb2('0xe')]),'phone':_0x2b22cb[_0xecb2('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xecb2('0x10')](_0x592a01[_0xecb2('0x11')],_0x2b22cb,'\x20'),'description':intUtil['getString'](_0x592a01[_0xecb2('0x12')],_0x2b22cb,_0xecb2('0x13')),'tags':getTags(_0x592a01['Tags'],'name')},getCustomFields(_0x592a01['Fields'],_0x2b22cb));_0x2f2f8e[_0xecb2('0x14')]=_['mapValues'](_[_0xecb2('0x15')](_0x2f2f8e['custom_fields'],'id'),_0xecb2('0x16'));return request({'uri':util[_0xecb2('0xd')](_0xecb2('0x17'),_0x5447e0['remoteUri']),'method':_0xecb2('0x18'),'body':_0x2f2f8e})[_0xecb2('0x19')](function(_0x46de0e){logger[_0xecb2('0x1a')](_0xecb2('0x1b'));return _0x46de0e;});}function getUser(_0x35f98a,_0x3795d4){if(intUtil['validateEmail'](_0x3795d4)){return request({'uri':util['format'](_0xecb2('0x1c'),_0x35f98a[_0xecb2('0x1d')]),'qs':{'email':_0x3795d4}})[_0xecb2('0x19')](function(_0xa5c6ea){if(_0xa5c6ea[_0xecb2('0x1e')]){logger['info'](_0xecb2('0x1f'));return _[_0xecb2('0x20')](_0xa5c6ea,function(_0x1bee3e){return _0x1bee3e[_0xecb2('0x21')][_0xecb2('0x22')]===_0x3795d4;});}else{logger[_0xecb2('0x1a')](_0xecb2('0x23'));return request({'uri':util[_0xecb2('0xd')](_0xecb2('0x24'),_0x35f98a['remoteUri'])})[_0xecb2('0x19')](function(_0xefda0f){logger[_0xecb2('0x1a')](_0xecb2('0x25'));return _0xefda0f;});}});}else{logger[_0xecb2('0x1a')](_0xecb2('0x26'));return request({'uri':util[_0xecb2('0xd')](_0xecb2('0x24'),_0x35f98a[_0xecb2('0x1d')])})[_0xecb2('0x19')](function(_0x36b3e9){logger['info'](_0xecb2('0x25'));return _0x36b3e9;});}}function getEndUser(_0x3f76f1,_0x319570,_0x2a1b51){logger[_0xecb2('0x1a')](_0xecb2('0x27'),_0x2a1b51);return request({'uri':util['format'](_0xecb2('0x28'),_0x3f76f1['remoteUri']),'qs':{'phone':_0x2a1b51}})[_0xecb2('0x19')](function(_0x2ea5e8){if(_0x2ea5e8[_0xecb2('0x1e')]){logger[_0xecb2('0x1a')](_0xecb2('0x29'));return _[_0xecb2('0x20')](_0x2ea5e8,{'phone':_0x2a1b51});}else{logger[_0xecb2('0x1a')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xecb2('0xd')]('%s/api/v2/contacts',_0x3f76f1['remoteUri']),'method':_0xecb2('0x18'),'body':{'name':_0x319570,'phone':_0x2a1b51}})['then'](function(_0x38e076){logger[_0xecb2('0x1a')](_0xecb2('0x2a'));return _0x38e076;});}});}function getAuth(_0x3a9c3d){return util[_0xecb2('0xd')](_0xecb2('0x2b'),new Buffer(_0x3a9c3d['apiKey']+':X')[_0xecb2('0x2c')](_0xecb2('0x2d')));}function request(_0x345211){logger[_0xecb2('0x2e')](_0xecb2('0x2f'),JSON[_0xecb2('0x30')](_0x345211));return rp(_['defaults'](_0x345211,{'method':_0xecb2('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x48f259,_0x453511){var _0x116b2d=[];if(_0x48f259&&_0x48f259['length']>0x0){_0x116b2d=_['map'](_0x48f259,_0x453511);}return _0x116b2d;}function getCustomFields(_0xadf1c,_0x5e4097){var _0x367e67=[];var _0x5c03ae={'custom_fields':[]};if(_0xadf1c[_0xecb2('0x1e')]>0x0){_['forEach'](_0xadf1c,function(_0x527e41){if(_[_0xecb2('0x32')]([_0xecb2('0x33'),_0xecb2('0x34')],_0x527e41[_0xecb2('0x35')])&&_0x527e41['nameField']&&!_0x527e41['customField']){_0x5c03ae[_0x527e41['nameField'][_0xecb2('0x36')]()]=_0x527e41[_0xecb2('0x37')]['toString']();}else if(_['includes'](['string',_0xecb2('0x34')],_0x527e41['type'])&&_0x527e41[_0xecb2('0x38')]&&_0x527e41[_0xecb2('0x39')]){_0x5c03ae[_0xecb2('0x14')]['push']({'id':_0x527e41[_0xecb2('0x38')],'value':_0x527e41[_0xecb2('0x37')][_0xecb2('0x2c')]()});}else if(_0x527e41[_0xecb2('0x35')]==='variable'&&_0x527e41['variableName']&&_0x527e41[_0xecb2('0x38')]&&_0x527e41[_0xecb2('0x39')]){_0x5e4097[_0x527e41[_0xecb2('0x3a')]]&&_0x5c03ae[_0xecb2('0x14')]['push']({'id':_0x527e41['idField'],'value':_0x5e4097[_0x527e41['variableName']][_0xecb2('0x2c')]()});}else if(_0x527e41['type']===_0xecb2('0x3b')&&_0x527e41[_0xecb2('0x3c')]&&_0x527e41[_0xecb2('0x3c')]['name']&&_0x527e41['idField']&&_0x527e41[_0xecb2('0x39')]){_0x5e4097[_0x527e41[_0xecb2('0x3c')][_0xecb2('0x3d')]['toLowerCase']()]&&_0x5c03ae[_0xecb2('0x14')][_0xecb2('0x3e')]({'id':_0x527e41[_0xecb2('0x38')],'value':_0x5e4097[_0x527e41[_0xecb2('0x3c')][_0xecb2('0x3d')]['toLowerCase']()]['toString']()});}});}return _0x5c03ae;}exports[_0xecb2('0x3f')]=function(_0xe01595,_0x40de4f,_0x466a28,_0x49917c,_0x12988f,_0xc10062){var _0x38c9c5,_0x3c2a6e;_0xc10062[_0xecb2('0x1d')]=intUtil[_0xecb2('0x40')](_0xc10062[_0xecb2('0x1d')]);_0xc10062[_0xecb2('0x41')]=intUtil[_0xecb2('0x40')](_0xc10062[_0xecb2('0x41')]);if(_0x12988f&&_0x12988f['monitor_format']){logger[_0xecb2('0x1a')](_0xecb2('0x42'),_0xecb2('0x43'));_0x40de4f['recordingURL']=util[_0xecb2('0xd')](_0xecb2('0x44'),_0xc10062[_0xecb2('0x41')],_0x40de4f[_0xecb2('0x45')],md5(_0x40de4f[_0xecb2('0x45')]));}else{_0x40de4f['recordingURL']='';}headers[_0xecb2('0x46')]=getAuth(_0xc10062);return getUser(_0xc10062,_0x49917c[_0xecb2('0x22')])[_0xecb2('0x19')](function(_0xa0cc41){_0x38c9c5=_0xa0cc41;logger[_0xecb2('0x1a')](_0xecb2('0x47'),_0x38c9c5['id']);return getEndUser(_0xc10062,_0x40de4f[_0xecb2('0xe')],_0x40de4f[_0xecb2('0xf')]);})[_0xecb2('0x19')](function(_0x1c6a33){_0x3c2a6e=_0x1c6a33;logger[_0xecb2('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x3c2a6e['id']);return getTicket(_0xc10062,_0x38c9c5,_0x3c2a6e,_0x466a28,_0x40de4f);})[_0xecb2('0x19')](function(_0x48d05c){if(_0x48d05c&&_0x48d05c['id']){logger['info'](_0xecb2('0x1b'));logger[_0xecb2('0x1a')](_0xecb2('0x48'),_0x48d05c['id']);logger[_0xecb2('0x1a')](_0xecb2('0x42'),_0xecb2('0x49'));emit(util[_0xecb2('0xd')]('user:%s',_0x49917c[_0xecb2('0x3d')]),_0xecb2('0x4a'),{'uri':util['format'](_0xecb2('0x4b'),_0xc10062[_0xecb2('0x1d')],_0x48d05c['id'])});}})['catch'](function(_0x251187){logger[_0xecb2('0x4c')]('[QUEUE]',JSON[_0xecb2('0x30')](_0x251187));});};exports['outbound']=function(_0x4b6834,_0x5e2b03,_0x50ab55,_0x11c912,_0x50c250,_0x5443b4,_0x521788){var _0x227ecc,_0x56f2fe;_0x5443b4[_0xecb2('0x1d')]=intUtil[_0xecb2('0x40')](_0x5443b4['remoteUri']);_0x5443b4[_0xecb2('0x41')]=intUtil[_0xecb2('0x40')](_0x5443b4[_0xecb2('0x41')]);if(_0x521788&&_0x521788['recordingFormat']&&_0x521788[_0xecb2('0x4d')]!==_0xecb2('0x4e')){logger[_0xecb2('0x1a')](_0xecb2('0x4f'),_0xecb2('0x43'));_0x5e2b03[_0xecb2('0x50')]=util[_0xecb2('0xd')](_0xecb2('0x44'),_0x5443b4[_0xecb2('0x41')],_0x5e2b03[_0xecb2('0x45')],md5(_0x5e2b03[_0xecb2('0x45')]));}headers['Authorization']=getAuth(_0x5443b4);return getUser(_0x5443b4,_0x11c912[_0xecb2('0x22')])[_0xecb2('0x19')](function(_0x3c0b35){_0x227ecc=_0x3c0b35;logger['info'](_0xecb2('0x47'),_0x227ecc['id']);return getEndUser(_0x5443b4,_0x5e2b03[_0xecb2('0x51')],_0x5e2b03[_0xecb2('0x52')]);})[_0xecb2('0x19')](function(_0x29230f){_0x56f2fe=_0x29230f;logger['info'](_0xecb2('0x53'),_0x56f2fe['id']);return getTicket(_0x5443b4,_0x227ecc,_0x56f2fe,_0x50ab55,_0x5e2b03);})[_0xecb2('0x19')](function(_0x2ce380){if(_0x2ce380&&_0x2ce380['id']){logger[_0xecb2('0x1a')](_0xecb2('0x1b'));logger['info'](_0xecb2('0x48'),_0x2ce380['id']);logger[_0xecb2('0x1a')](_0xecb2('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xecb2('0xd')]('user:%s',_0x11c912[_0xecb2('0x3d')]),_0xecb2('0x4a'),{'uri':util[_0xecb2('0xd')](_0xecb2('0x4b'),_0x5443b4[_0xecb2('0x1d')],_0x2ce380['id'])});}})[_0xecb2('0x54')](function(_0x45a7d7){logger[_0xecb2('0x4c')](_0xecb2('0x4f'),JSON['stringify'](_0x45a7d7));});};exports[_0xecb2('0x55')]=function(_0x4b072a,_0x4b5683,_0x45ade0,_0x59be95,_0x562eee,_0x2ceb7e){var _0x2e19a8,_0x1f9d4d;_0x2ceb7e[_0xecb2('0x1d')]=intUtil[_0xecb2('0x40')](_0x2ceb7e[_0xecb2('0x1d')]);_0x2ceb7e[_0xecb2('0x41')]=intUtil['stripTrailingSlash'](_0x2ceb7e[_0xecb2('0x41')]);if(_0x562eee&&_0x562eee[_0xecb2('0x56')]){logger[_0xecb2('0x1a')]('['+_0x4b5683[_0xecb2('0x57')][_0xecb2('0x58')]()+']','Recording\x20is\x20enabled!');_0x4b5683[_0xecb2('0x50')]=util[_0xecb2('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ceb7e[_0xecb2('0x41')],_0x4b5683[_0xecb2('0x45')],md5(_0x4b5683[_0xecb2('0x45')]));}else{_0x4b5683[_0xecb2('0x50')]='';}headers[_0xecb2('0x46')]=getAuth(_0x2ceb7e);return getUser(_0x2ceb7e,'')[_0xecb2('0x19')](function(_0x23c582){_0x2e19a8=_0x23c582;logger[_0xecb2('0x1a')](_0xecb2('0x47'),_0x2e19a8['id']);return getEndUser(_0x2ceb7e,_0x4b5683['calleridname'],_0x4b5683['calleridnum']);})[_0xecb2('0x19')](function(_0x1a47c4){_0x1f9d4d=_0x1a47c4;logger[_0xecb2('0x1a')](_0xecb2('0x53'),_0x1f9d4d['id']);return getTicket(_0x2ceb7e,_0x2e19a8,_0x1f9d4d,_0x45ade0,_0x4b5683);})['then'](function(_0x26cde3){if(_0x26cde3){logger[_0xecb2('0x1a')](_0xecb2('0x1b'));logger[_0xecb2('0x1a')](_0xecb2('0x48'),_0x26cde3['id']);}})['catch'](function(_0x4c4d12){logger[_0xecb2('0x4c')]('['+_0x4b5683[_0xecb2('0x57')][_0xecb2('0x58')]()+']',JSON[_0xecb2('0x30')](_0x4c4d12));});}; \ 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 ed6eff3..85701e5 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 _0xaa91=['headers','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','info','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20with\x20email','agentEmail','userId','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','Subjects','getString','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','outbound','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','GET','/api/selector/owners'];(function(_0x3a6097,_0x266ca4){var _0xbb5020=function(_0x51b21c){while(--_0x51b21c){_0x3a6097['push'](_0x3a6097['shift']());}};_0xbb5020(++_0x266ca4);}(_0xaa91,0x8f));var _0x1aa9=function(_0x553a96,_0x3063d2){_0x553a96=_0x553a96-0x0;var _0x17d6ac=_0xaa91[_0x553a96];return _0x17d6ac;};'use strict';var _=require(_0x1aa9('0x0'));var rp=require(_0x1aa9('0x1'));var md5=require(_0x1aa9('0x2'));var util=require(_0x1aa9('0x3'));var moment=require(_0x1aa9('0x4'));var Promise=require('bluebird');var Redis=require(_0x1aa9('0x5'));var intUtil=require(_0x1aa9('0x6'));var config=require(_0x1aa9('0x7'));var logger=require('../../../../config/logger')('freshsales');config[_0x1aa9('0x8')]=_['defaults'](config[_0x1aa9('0x8')],{'host':_0x1aa9('0x9'),'port':0x18eb});var io=require(_0x1aa9('0xa'))(new Redis(config[_0x1aa9('0x8')]));function getAdminId(_0xba496e,_0x502df9,_0x27baa3,_0x289bba){return new Promise(function(_0xd283db,_0x1f5aaf){var _0x23f1d1=![];var _0x1181e5={'method':_0x1aa9('0xb'),'uri':_0x289bba+_0x1aa9('0xc'),'json':!![]};_0x1181e5[_0x1aa9('0xd')]=_0x27baa3;logger['info'](_0x1aa9('0xe'));return rp(_0x1181e5)[_0x1aa9('0xf')](function(_0x105dc8){if(_0x105dc8){var _0x5134e8=_0x105dc8[_0x1aa9('0x10')];var _0xa07633=null;for(_0xa07633=0x0;_0xa07633<_0x5134e8[_0x1aa9('0x11')];_0xa07633++){if(_0x5134e8[_0xa07633]['email']===_0xba496e[_0x1aa9('0x12')]){_0xba496e[_0x1aa9('0x13')]=_0x5134e8[_0xa07633]['id'];_0x23f1d1=!![];}}if(_0x23f1d1){logger[_0x1aa9('0x14')]('Admin\x20found:',_0xba496e[_0x1aa9('0x13')]);_0xd283db(_0xba496e);}else{_0x1f5aaf({'statusCode':0x194,'message':_0x1aa9('0x15')});}}else{_0x1f5aaf({'statusCode':0x194,'message':_0x1aa9('0x15')});}})[_0x1aa9('0x16')](function(_0x14201c){logger[_0x1aa9('0x17')]('['+[_0x502df9[_0x1aa9('0x18')]()]+']',_0x14201c[_0x1aa9('0x19')]);_0x1f5aaf(_0x14201c);});});}function getUser(_0x1fd680,_0x4f347b,_0x2a003d){return function(_0x3c5dcc){return new Promise(function(_0x2e5e29,_0x1ae6da){var _0x29330a={'method':_0x1aa9('0xb'),'uri':_0x2a003d+_0x1aa9('0xc'),'json':!![]};_0x29330a[_0x1aa9('0xd')]=_0x4f347b;logger['info']('Getting\x20user\x20list');return rp(_0x29330a)['then'](function(_0x15ef5a){if(_0x15ef5a){var _0x33f89a=_0x15ef5a[_0x1aa9('0x10')];var _0x1bbc3c=![];var _0x3a7eff=null;if(_0x3c5dcc['agentEmail']!==null){logger['info'](_0x1aa9('0x1a'),_0x3c5dcc[_0x1aa9('0x1b')]);_0x3c5dcc['userEmail']=_0x3c5dcc[_0x1aa9('0x1b')];for(_0x3a7eff=0x0;_0x3a7eff<_0x33f89a['length'];_0x3a7eff++){if(_0x33f89a[_0x3a7eff]['email']===_0x3c5dcc[_0x1aa9('0x1b')]){_0x1bbc3c=!![];_0x3c5dcc[_0x1aa9('0x1c')]=_0x33f89a[_0x3a7eff]['id'];logger['info']('User\x20found:',_0x3c5dcc[_0x1aa9('0x1c')]);}}}if(!_0x1bbc3c){logger[_0x1aa9('0x14')](_0x1aa9('0x1d'));_0x3c5dcc['userEmail']=_0x3c5dcc[_0x1aa9('0x12')];_0x3c5dcc['userId']=_0x3c5dcc[_0x1aa9('0x13')];_0x1bbc3c=!![];}if(_0x1bbc3c){_0x2e5e29(_0x3c5dcc);}else{_0x1ae6da({'statusCode':0x194,'message':_0x1aa9('0x15')});}}else{_0x1ae6da({'statusCode':0x194,'message':_0x1aa9('0x15')});}})[_0x1aa9('0x16')](function(_0x27106b){logger[_0x1aa9('0x17')]('['+[_0x1fd680[_0x1aa9('0x18')]()]+']',_0x27106b[_0x1aa9('0x19')]);_0x1ae6da(_0x27106b);});});};}function searchContact(_0x33e3be,_0x52c8b5,_0x2274e0,_0xc608f7){return new Promise(function(_0x3a6ede,_0x500329){var _0x58d7ec={'method':_0x1aa9('0xb'),'headers':_0x52c8b5,'uri':_0x33e3be+_0x1aa9('0x1e')+_0xc608f7+_0x1aa9('0x1f')+_0x2274e0+_0x1aa9('0x20'),'json':!![]};rp(_0x58d7ec)[_0x1aa9('0xf')](function(_0x206eac){var _0x4c6c35=_['find'](_0x206eac[_0x1aa9('0x21')]['contacts'],[_0x2274e0,_0xc608f7]);_0x3a6ede(_0x4c6c35);})['catch'](function(_0x1989c2){_0x500329(_0x1989c2);});});}function getEndUser(_0x13f137,_0x2b97fc,_0xec9023){return function(_0x41c4b9){return new Promise(function(_0xb2d87,_0x2bb656){logger['info'](util[_0x1aa9('0x22')](_0x1aa9('0x23'),_0x41c4b9[_0x1aa9('0x24')]));searchContact(_0xec9023,_0x2b97fc,_0x1aa9('0x25'),_0x41c4b9[_0x1aa9('0x24')])[_0x1aa9('0xf')](function(_0xac929b){if(_0xac929b){_0x41c4b9[_0x1aa9('0x26')]=_0xac929b['id'];logger[_0x1aa9('0x14')](_0x1aa9('0x27'),_0x41c4b9[_0x1aa9('0x26')]);return _0xb2d87(_0x41c4b9);}searchContact(_0xec9023,_0x2b97fc,'work_number',_0x41c4b9[_0x1aa9('0x24')])[_0x1aa9('0xf')](function(_0x162a91){if(_0x162a91){_0x41c4b9[_0x1aa9('0x26')]=_0x162a91['id'];logger['info'](_0x1aa9('0x28'),_0x41c4b9[_0x1aa9('0x26')]);return _0xb2d87(_0x41c4b9);}createEndUser(_0x41c4b9,_0x13f137,_0x2b97fc,_0xec9023)[_0x1aa9('0xf')](function(_0x5d5be4){logger[_0x1aa9('0x14')]('Contact\x20created:',_0x5d5be4[_0x1aa9('0x26')]);return _0xb2d87(_0x5d5be4);});});})[_0x1aa9('0x16')](function(_0x443cab){_0x2bb656(_0x443cab);});});};}function createEndUser(_0x164280,_0x1284c0,_0x42902e,_0x574edd){return new Promise(function(_0x35f718,_0x27481b){var _0x80071f=moment();var _0x425738={'method':_0x1aa9('0x29'),'uri':_0x574edd+_0x1aa9('0x2a'),'body':{'contact':{'last_name':_0x164280['contactNumber'],'work_number':_0x164280['contactNumber'],'mobile_number':_0x164280[_0x1aa9('0x24')],'owner_id':_0x164280[_0x1aa9('0x1c')],'created_at':_0x80071f['format'](_0x1aa9('0x2b'))}},'json':!![]};_0x425738['headers']=_0x42902e;logger[_0x1aa9('0x14')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x425738)['then'](function(_0x13af7b){_0x164280[_0x1aa9('0x26')]=_0x13af7b[_0x1aa9('0x2c')]['id'];_0x35f718(_0x164280);})[_0x1aa9('0x16')](function(_0x21a5fc){logger[_0x1aa9('0x17')]('['+[_0x1284c0['toUpperCase']()]+']',_0x21a5fc[_0x1aa9('0x19')]);_0x27481b(_0x21a5fc[_0x1aa9('0x19')]);});});}function getTicket(_0xc9d60b,_0x4291c6,_0x2518c5,_0x13fff2,_0x5e1dc){return function(_0x3ef108){logger[_0x1aa9('0x14')](_0x1aa9('0x2d'));return new Promise(function(_0x1c871c,_0x1eae25){var _0x2fb505=moment();var _0x513481={'method':_0x1aa9('0x29'),'uri':_0x2518c5+'/api/tasks','body':{'title':intUtil['getString'](_0x13fff2[_0x1aa9('0x2e')],_0x5e1dc,'\x20'),'description':intUtil[_0x1aa9('0x2f')](_0x13fff2['Descriptions'],_0x5e1dc,'\x0a'),'owner_id':_0x3ef108[_0x1aa9('0x1c')],'creater_id':_0x3ef108[_0x1aa9('0x13')],'targetable_id':_0x3ef108['endUserId'],'targetable_type':_0x1aa9('0x30'),'created_at':_0x2fb505[_0x1aa9('0x22')](_0x1aa9('0x2b')),'due_date':_0x2fb505[_0x1aa9('0x31')](0x1e,'m')[_0x1aa9('0x22')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x513481[_0x1aa9('0xd')]=_0x4291c6;return rp(_0x513481)[_0x1aa9('0xf')](function(_0x29d52c){_0x3ef108[_0x1aa9('0x32')]=_0x29d52c['task']['id'];logger[_0x1aa9('0x14')](_0x1aa9('0x33'),_0x3ef108[_0x1aa9('0x32')]);_0x1c871c(_0x3ef108);})['catch'](function(_0x540be3){logger[_0x1aa9('0x17')]('['+[_0xc9d60b[_0x1aa9('0x18')]()]+']',_0x540be3[_0x1aa9('0x19')]);_0x1eae25(_0x540be3[_0x1aa9('0x19')]);});});};}function emit(_0x5b2673,_0x180f79,_0x5e73b8){var _0x1d0366={'uri':_0x5b2673+_0x1aa9('0x34')+_0x5e73b8};io['to'](util[_0x1aa9('0x22')](_0x1aa9('0x35'),_0x180f79))['emit'](_0x1aa9('0x36'),_0x1d0366);}exports['cs']=function(_0x4e1c07,_0x165171,_0x1b38c2,_0x51a741,_0x228c55,_0x5e6d26,_0x2d9551,_0x201224){var _0x79b373={};var _0x214b7b={'Authorization':_0x1aa9('0x37')+_0x5e6d26[_0x1aa9('0x38')]};_0x5e6d26['remoteUri']=intUtil[_0x1aa9('0x39')](_0x5e6d26[_0x1aa9('0x3a')]);_0x5e6d26[_0x1aa9('0x3b')]=intUtil['stripTrailingSlash'](_0x5e6d26[_0x1aa9('0x3b')]);var _0x4e96d7=_0x5e6d26['remoteUri'];_0x79b373['adminEmail']=_0x5e6d26[_0x1aa9('0x3c')];_0x79b373[_0x1aa9('0x24')]=_0x201224[_0x1aa9('0x3d')]()==='outbound'?_0x165171[_0x1aa9('0x3e')]:_0x165171['calleridnum'];_0x79b373[_0x1aa9('0x3f')]=_0x201224===_0x1aa9('0x40')||_0x201224===_0x1aa9('0x41')?_0x1aa9('0x40'):_0x1aa9('0x42');if(_0x51a741){_0x79b373['agentEmail']=_0x51a741[_0x1aa9('0x43')];}var _0x11f8bf=util[_0x1aa9('0x22')](_0x1aa9('0x44'),_0x5e6d26[_0x1aa9('0x3b')],_0x165171[_0x1aa9('0x45')],md5(_0x165171[_0x1aa9('0x45')]));if(_0x228c55&&_0x228c55[_0x1aa9('0x46')]){logger[_0x1aa9('0x14')](_0x1aa9('0x47'),'Recording\x20is\x20enabled!');_0x165171[_0x1aa9('0x48')]=_0x11f8bf;}else if(_0x2d9551&&_0x2d9551[_0x1aa9('0x49')]&&_0x2d9551[_0x1aa9('0x49')]!=='none'){logger[_0x1aa9('0x14')](_0x1aa9('0x4a'),'Recording\x20is\x20enabled!');_0x165171[_0x1aa9('0x48')]=_0x11f8bf;}else{_0x165171[_0x1aa9('0x48')]='';}return getAdminId(_0x79b373,_0x201224,_0x214b7b,_0x4e96d7)[_0x1aa9('0xf')](getUser(_0x201224,_0x214b7b,_0x4e96d7))[_0x1aa9('0xf')](getEndUser(_0x201224,_0x214b7b,_0x4e96d7))[_0x1aa9('0xf')](getTicket(_0x201224,_0x214b7b,_0x4e96d7,_0x1b38c2,_0x165171))['then'](function(_0x33b6e8){logger[_0x1aa9('0x14')](util[_0x1aa9('0x22')](_0x1aa9('0x4b'),_0x33b6e8['ticketId']));if(_0x201224!=='unmanaged'){logger[_0x1aa9('0x14')]('['+[_0x201224[_0x1aa9('0x18')]()]+']',_0x1aa9('0x4c'));emit(_0x4e96d7,_0x51a741['name'],_0x33b6e8[_0x1aa9('0x26')]);}})[_0x1aa9('0x16')](function(_0x53f880){logger['error']('['+[_0x201224[_0x1aa9('0x18')]()]+_0x1aa9('0x4d'),util['inspect'](_0x53f880,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6a4c=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','util','moment','bluebird','ioredis','./util','../../../../config/environment','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminId','/api/lookup?q=','&f=','find','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Contact','ticketId','/contacts/','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x6b9266,_0x2afdb1){var _0x1ad2c1=function(_0x50f867){while(--_0x50f867){_0x6b9266['push'](_0x6b9266['shift']());}};_0x1ad2c1(++_0x2afdb1);}(_0x6a4c,0x1ec));var _0xc6a4=function(_0x1168f5,_0x426275){_0x1168f5=_0x1168f5-0x0;var _0x15e1fd=_0x6a4c[_0x1168f5];return _0x15e1fd;};'use strict';var _=require(_0xc6a4('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xc6a4('0x1'));var moment=require(_0xc6a4('0x2'));var Promise=require(_0xc6a4('0x3'));var Redis=require(_0xc6a4('0x4'));var intUtil=require(_0xc6a4('0x5'));var config=require(_0xc6a4('0x6'));var logger=require('../../../../config/logger')('freshsales');config[_0xc6a4('0x7')]=_[_0xc6a4('0x8')](config[_0xc6a4('0x7')],{'host':_0xc6a4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc6a4('0x7')]));function getAdminId(_0x3dda01,_0x2083ff,_0x165e35,_0x4810e5){return new Promise(function(_0x33a500,_0x4b58ca){var _0x16c295=![];var _0x474a41={'method':_0xc6a4('0xa'),'uri':_0x4810e5+_0xc6a4('0xb'),'json':!![]};_0x474a41[_0xc6a4('0xc')]=_0x165e35;logger[_0xc6a4('0xd')](_0xc6a4('0xe'));return rp(_0x474a41)[_0xc6a4('0xf')](function(_0x3ba230){if(_0x3ba230){var _0x327d68=_0x3ba230[_0xc6a4('0x10')];var _0x2c09bb=null;for(_0x2c09bb=0x0;_0x2c09bb<_0x327d68[_0xc6a4('0x11')];_0x2c09bb++){if(_0x327d68[_0x2c09bb][_0xc6a4('0x12')]===_0x3dda01[_0xc6a4('0x13')]){_0x3dda01['adminId']=_0x327d68[_0x2c09bb]['id'];_0x16c295=!![];}}if(_0x16c295){logger['info'](_0xc6a4('0x14'),_0x3dda01['adminId']);_0x33a500(_0x3dda01);}else{_0x4b58ca({'statusCode':0x194,'message':_0xc6a4('0x15')});}}else{_0x4b58ca({'statusCode':0x194,'message':_0xc6a4('0x15')});}})[_0xc6a4('0x16')](function(_0x3fb98c){logger[_0xc6a4('0x17')]('['+[_0x2083ff[_0xc6a4('0x18')]()]+']',_0x3fb98c[_0xc6a4('0x19')]);_0x4b58ca(_0x3fb98c);});});}function getUser(_0x1236cb,_0x22cd56,_0x459e3c){return function(_0x501519){return new Promise(function(_0x1a7879,_0x34630d){var _0xaf7392={'method':_0xc6a4('0xa'),'uri':_0x459e3c+_0xc6a4('0xb'),'json':!![]};_0xaf7392[_0xc6a4('0xc')]=_0x22cd56;logger[_0xc6a4('0xd')]('Getting\x20user\x20list');return rp(_0xaf7392)[_0xc6a4('0xf')](function(_0x2883a){if(_0x2883a){var _0x3f12c1=_0x2883a['users'];var _0x4bda9f=![];var _0x1bca47=null;if(_0x501519[_0xc6a4('0x1a')]!==null){logger[_0xc6a4('0xd')](_0xc6a4('0x1b'),_0x501519[_0xc6a4('0x1a')]);_0x501519[_0xc6a4('0x1c')]=_0x501519[_0xc6a4('0x1a')];for(_0x1bca47=0x0;_0x1bca47<_0x3f12c1[_0xc6a4('0x11')];_0x1bca47++){if(_0x3f12c1[_0x1bca47][_0xc6a4('0x12')]===_0x501519[_0xc6a4('0x1a')]){_0x4bda9f=!![];_0x501519[_0xc6a4('0x1d')]=_0x3f12c1[_0x1bca47]['id'];logger['info'](_0xc6a4('0x1e'),_0x501519[_0xc6a4('0x1d')]);}}}if(!_0x4bda9f){logger[_0xc6a4('0xd')](_0xc6a4('0x1f'));_0x501519[_0xc6a4('0x1c')]=_0x501519[_0xc6a4('0x13')];_0x501519[_0xc6a4('0x1d')]=_0x501519[_0xc6a4('0x20')];_0x4bda9f=!![];}if(_0x4bda9f){_0x1a7879(_0x501519);}else{_0x34630d({'statusCode':0x194,'message':_0xc6a4('0x15')});}}else{_0x34630d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xc6a4('0x16')](function(_0x3286a6){logger[_0xc6a4('0x17')]('['+[_0x1236cb[_0xc6a4('0x18')]()]+']',_0x3286a6[_0xc6a4('0x19')]);_0x34630d(_0x3286a6);});});};}function searchContact(_0x408f95,_0x1ae2f3,_0x2fbd09,_0x27eaa9){return new Promise(function(_0x512582,_0x310c92){var _0x4b95e6={'method':'GET','headers':_0x1ae2f3,'uri':_0x408f95+_0xc6a4('0x21')+_0x27eaa9+_0xc6a4('0x22')+_0x2fbd09+'&entities=contact','json':!![]};rp(_0x4b95e6)[_0xc6a4('0xf')](function(_0x5e5690){var _0x4aea59=_[_0xc6a4('0x23')](_0x5e5690['contacts']['contacts'],[_0x2fbd09,_0x27eaa9]);_0x512582(_0x4aea59);})['catch'](function(_0x3ca0e0){_0x310c92(_0x3ca0e0);});});}function getEndUser(_0x595547,_0x1baf1c,_0x2ffed7){return function(_0x17fc68){return new Promise(function(_0x2b0098,_0x152144){logger[_0xc6a4('0xd')](util[_0xc6a4('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x17fc68[_0xc6a4('0x25')]));searchContact(_0x2ffed7,_0x1baf1c,_0xc6a4('0x26'),_0x17fc68[_0xc6a4('0x25')])['then'](function(_0xe0a765){if(_0xe0a765){_0x17fc68[_0xc6a4('0x27')]=_0xe0a765['id'];logger['info'](_0xc6a4('0x28'),_0x17fc68['endUserId']);return _0x2b0098(_0x17fc68);}searchContact(_0x2ffed7,_0x1baf1c,'work_number',_0x17fc68[_0xc6a4('0x25')])[_0xc6a4('0xf')](function(_0xa1b3d4){if(_0xa1b3d4){_0x17fc68[_0xc6a4('0x27')]=_0xa1b3d4['id'];logger[_0xc6a4('0xd')]('Contact\x20found\x20work_number:',_0x17fc68[_0xc6a4('0x27')]);return _0x2b0098(_0x17fc68);}createEndUser(_0x17fc68,_0x595547,_0x1baf1c,_0x2ffed7)[_0xc6a4('0xf')](function(_0x515ad5){logger[_0xc6a4('0xd')](_0xc6a4('0x29'),_0x515ad5[_0xc6a4('0x27')]);return _0x2b0098(_0x515ad5);});});})[_0xc6a4('0x16')](function(_0x109af5){_0x152144(_0x109af5);});});};}function createEndUser(_0x210cb2,_0x14c78e,_0x35d7db,_0x11319e){return new Promise(function(_0x1feb9b,_0x135131){var _0x10e9bd=moment();var _0x1ca5f0={'method':_0xc6a4('0x2a'),'uri':_0x11319e+_0xc6a4('0x2b'),'body':{'contact':{'last_name':_0x210cb2[_0xc6a4('0x25')],'work_number':_0x210cb2[_0xc6a4('0x25')],'mobile_number':_0x210cb2['contactNumber'],'owner_id':_0x210cb2['userId'],'created_at':_0x10e9bd[_0xc6a4('0x24')](_0xc6a4('0x2c'))}},'json':!![]};_0x1ca5f0[_0xc6a4('0xc')]=_0x35d7db;logger[_0xc6a4('0xd')](_0xc6a4('0x2d'));return rp(_0x1ca5f0)[_0xc6a4('0xf')](function(_0x24c482){_0x210cb2[_0xc6a4('0x27')]=_0x24c482['contact']['id'];_0x1feb9b(_0x210cb2);})[_0xc6a4('0x16')](function(_0x4966e0){logger['error']('['+[_0x14c78e[_0xc6a4('0x18')]()]+']',_0x4966e0[_0xc6a4('0x19')]);_0x135131(_0x4966e0['message']);});});}function getTicket(_0x25dd8f,_0x4a8bc5,_0x186abf,_0x1f60e7,_0x58a59e){return function(_0x5d2c31){logger[_0xc6a4('0xd')](_0xc6a4('0x2e'));return new Promise(function(_0xd42ada,_0x38f501){var _0xe176e=moment();var _0x5d48d6={'method':_0xc6a4('0x2a'),'uri':_0x186abf+'/api/tasks','body':{'title':intUtil[_0xc6a4('0x2f')](_0x1f60e7[_0xc6a4('0x30')],_0x58a59e,'\x20'),'description':intUtil[_0xc6a4('0x2f')](_0x1f60e7['Descriptions'],_0x58a59e,'\x0a'),'owner_id':_0x5d2c31[_0xc6a4('0x1d')],'creater_id':_0x5d2c31['adminId'],'targetable_id':_0x5d2c31['endUserId'],'targetable_type':_0xc6a4('0x31'),'created_at':_0xe176e['format'](_0xc6a4('0x2c')),'due_date':_0xe176e['add'](0x1e,'m')[_0xc6a4('0x24')](_0xc6a4('0x2c'))},'json':!![]};_0x5d48d6[_0xc6a4('0xc')]=_0x4a8bc5;return rp(_0x5d48d6)[_0xc6a4('0xf')](function(_0x240bb6){_0x5d2c31[_0xc6a4('0x32')]=_0x240bb6['task']['id'];logger[_0xc6a4('0xd')]('Task\x20created:',_0x5d2c31[_0xc6a4('0x32')]);_0xd42ada(_0x5d2c31);})['catch'](function(_0x23aff5){logger['error']('['+[_0x25dd8f[_0xc6a4('0x18')]()]+']',_0x23aff5[_0xc6a4('0x19')]);_0x38f501(_0x23aff5[_0xc6a4('0x19')]);});});};}function emit(_0x4701ba,_0x39b6d8,_0x177148){var _0x22731d={'uri':_0x4701ba+_0xc6a4('0x33')+_0x177148};io['to'](util[_0xc6a4('0x24')](_0xc6a4('0x34'),_0x39b6d8))['emit'](_0xc6a4('0x35'),_0x22731d);}exports['cs']=function(_0x4ffb02,_0x2278f6,_0x2fff16,_0x55961e,_0x1ff2a2,_0x428639,_0x5e4a5c,_0x33feec){var _0xc3a399={};var _0x57bfab={'Authorization':_0xc6a4('0x36')+_0x428639[_0xc6a4('0x37')]};_0x428639[_0xc6a4('0x38')]=intUtil[_0xc6a4('0x39')](_0x428639[_0xc6a4('0x38')]);_0x428639[_0xc6a4('0x3a')]=intUtil[_0xc6a4('0x39')](_0x428639[_0xc6a4('0x3a')]);var _0x5a114c=_0x428639[_0xc6a4('0x38')];_0xc3a399['adminEmail']=_0x428639['username'];_0xc3a399[_0xc6a4('0x25')]=_0x33feec[_0xc6a4('0x3b')]()===_0xc6a4('0x3c')?_0x2278f6[_0xc6a4('0x3d')]:_0x2278f6[_0xc6a4('0x3e')];_0xc3a399[_0xc6a4('0x3f')]=_0x33feec==='queue'||_0x33feec===_0xc6a4('0x40')?_0xc6a4('0x41'):_0xc6a4('0x3c');if(_0x55961e){_0xc3a399[_0xc6a4('0x1a')]=_0x55961e[_0xc6a4('0x12')];}var _0x2d606c=util['format'](_0xc6a4('0x42'),_0x428639[_0xc6a4('0x3a')],_0x2278f6[_0xc6a4('0x43')],md5(_0x2278f6[_0xc6a4('0x43')]));if(_0x1ff2a2&&_0x1ff2a2[_0xc6a4('0x44')]){logger[_0xc6a4('0xd')](_0xc6a4('0x45'),_0xc6a4('0x46'));_0x2278f6['recordingURL']=_0x2d606c;}else if(_0x5e4a5c&&_0x5e4a5c[_0xc6a4('0x47')]&&_0x5e4a5c[_0xc6a4('0x47')]!==_0xc6a4('0x48')){logger['info'](_0xc6a4('0x49'),_0xc6a4('0x46'));_0x2278f6['recordingURL']=_0x2d606c;}else{_0x2278f6[_0xc6a4('0x4a')]='';}return getAdminId(_0xc3a399,_0x33feec,_0x57bfab,_0x5a114c)['then'](getUser(_0x33feec,_0x57bfab,_0x5a114c))[_0xc6a4('0xf')](getEndUser(_0x33feec,_0x57bfab,_0x5a114c))[_0xc6a4('0xf')](getTicket(_0x33feec,_0x57bfab,_0x5a114c,_0x2fff16,_0x2278f6))[_0xc6a4('0xf')](function(_0x47baf6){logger['info'](util['format'](_0xc6a4('0x4b'),_0x47baf6[_0xc6a4('0x32')]));if(_0x33feec!==_0xc6a4('0x40')){logger['info']('['+[_0x33feec[_0xc6a4('0x18')]()]+']',_0xc6a4('0x4c'));emit(_0x5a114c,_0x55961e[_0xc6a4('0x4d')],_0x47baf6[_0xc6a4('0x27')]);}})[_0xc6a4('0x16')](function(_0x5e5853){logger['error']('['+[_0x33feec[_0xc6a4('0x18')]()]+_0xc6a4('0x4e'),util[_0xc6a4('0x4f')](_0x5e5853,{'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 7824848..f61d88b 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 _0x02e3=['./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','freshdesk','zoho','dynamics365','freshsales','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','desk','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./sugarcrm'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x02e3,0x92));var _0x302e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x02e3[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x302e('0x0'));var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x302e('0x1'));var freshdesk=require(_0x302e('0x2'));var zoho=require(_0x302e('0x3'));var desk=require(_0x302e('0x4'));var vtiger=require(_0x302e('0x5'));var servicenow=require(_0x302e('0x6'));var dynamics365=require(_0x302e('0x7'));var freshsales=require(_0x302e('0x8'));var integrations=[_0x302e('0x9'),_0x302e('0xa'),'sugarcrm',_0x302e('0xb'),_0x302e('0xc'),'desk','vtiger',_0x302e('0xd'),_0x302e('0xe'),_0x302e('0xf')];exports['exec']=function(_0x3af1a9,_0x39232f,_0x26687c,_0x452b17,_0x2ee93e,_0x8c789a){if(_0x26687c){if(_[_0x302e('0x10')](integrations,_0x3af1a9[_0x302e('0x11')][_0x302e('0x12')]())){try{var _0xfa1693=null;var _0x362a38='';var _0x51951b=_0x26687c[_0x3af1a9[_0x302e('0x11')]['toLowerCase']()];if(_0x51951b){var _0x2b28f4=_0x51951b[_0x3af1a9[_0x302e('0x13')]];if(_0x2b28f4){var _0x45494b=_[_0x302e('0x14')](_0x2b28f4[_0x302e('0x15')],{'id':parseInt(_0x3af1a9[_0x302e('0x16')],0xa)});if(_0x45494b){if(_0x452b17){if(_0x2ee93e&&_0x39232f['queue']){_0x362a38=_0x302e('0x17');}else if(_0x39232f[_0x302e('0x18')]){_0x362a38=_0x302e('0x19');}else{console[_0x302e('0x1a')](_0x302e('0x1b'),_0x39232f);}}else{_0x362a38=_0x302e('0x1c');}switch(_0x3af1a9[_0x302e('0x11')][_0x302e('0x12')]()){case _0x302e('0x9'):zendesk[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case'salesforce':salesforce[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case _0x302e('0x1d'):sugarcrm[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case _0x302e('0xb'):freshdesk[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case _0x302e('0xc'):zoho[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case _0x302e('0x1e'):desk[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case'vtiger':vtiger[_0x362a38](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a);break;case _0x302e('0xe'):freshsales['cs'](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a,_0x362a38);break;case _0x302e('0xf'):servicenow['cs'](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a,_0x362a38);break;case _0x302e('0xd'):dynamics365['cs'](_0x3af1a9,_0x39232f,_0x45494b,_0x452b17,_0x2ee93e,_0x2b28f4,_0x8c789a,_0x362a38);break;default:console['log'](_0x302e('0x1f'));}}else{_0xfa1693=require(_0x302e('0x20'))(_0x3af1a9[_0x302e('0x11')][_0x302e('0x12')]());_0xfa1693[_0x302e('0x21')]('[EXEC]',util[_0x302e('0x22')](_0x302e('0x23'),_0x3af1a9[_0x302e('0x11')][_0x302e('0x12')](),_0x3af1a9[_0x302e('0x16')]));}}else{_0xfa1693=require('../../../../config/logger')(_0x3af1a9[_0x302e('0x11')][_0x302e('0x12')]());_0xfa1693['error']('[EXEC]',util[_0x302e('0x22')](_0x302e('0x24'),_0x3af1a9[_0x302e('0x11')][_0x302e('0x12')](),_0x3af1a9[_0x302e('0x13')]));}}else{}}catch(_0x243c1d){console[_0x302e('0x21')](_0x243c1d);}}}}; \ No newline at end of file +var _0xf2a9=['queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','dynamics365','unknown\x20integration','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','data3'];(function(_0x4f81f6,_0x4d8c60){var _0x283e8e=function(_0x3b2889){while(--_0x3b2889){_0x4f81f6['push'](_0x4f81f6['shift']());}};_0x283e8e(++_0x4d8c60);}(_0xf2a9,0x19d));var _0x9f2a=function(_0x7bc81d,_0xafa6b6){_0x7bc81d=_0x7bc81d-0x0;var _0x558011=_0xf2a9[_0x7bc81d];return _0x558011;};'use strict';var _=require(_0x9f2a('0x0'));var util=require(_0x9f2a('0x1'));var zendesk=require(_0x9f2a('0x2'));var salesforce=require(_0x9f2a('0x3'));var sugarcrm=require(_0x9f2a('0x4'));var freshdesk=require(_0x9f2a('0x5'));var zoho=require(_0x9f2a('0x6'));var desk=require(_0x9f2a('0x7'));var vtiger=require(_0x9f2a('0x8'));var servicenow=require(_0x9f2a('0x9'));var dynamics365=require(_0x9f2a('0xa'));var freshsales=require(_0x9f2a('0xb'));var integrations=[_0x9f2a('0xc'),_0x9f2a('0xd'),_0x9f2a('0xe'),_0x9f2a('0xf'),_0x9f2a('0x10'),_0x9f2a('0x11'),_0x9f2a('0x12'),'dynamics365',_0x9f2a('0x13'),_0x9f2a('0x14')];exports[_0x9f2a('0x15')]=function(_0x5567f1,_0x40c875,_0x3b01c1,_0x5edbbc,_0x487f2a,_0x48e3cb){if(_0x3b01c1){if(_[_0x9f2a('0x16')](integrations,_0x5567f1[_0x9f2a('0x17')]['toLowerCase']())){try{var _0x5e1598=null;var _0x35920b='';var _0x14dbc2=_0x3b01c1[_0x5567f1['data1'][_0x9f2a('0x18')]()];if(_0x14dbc2){var _0x5163a0=_0x14dbc2[_0x5567f1[_0x9f2a('0x19')]];if(_0x5163a0){var _0x5d5c4c=_['find'](_0x5163a0['Configurations'],{'id':parseInt(_0x5567f1[_0x9f2a('0x1a')],0xa)});if(_0x5d5c4c){if(_0x5edbbc){if(_0x487f2a&&_0x40c875[_0x9f2a('0x1b')]){_0x35920b='queue';}else if(_0x40c875[_0x9f2a('0x1c')]){_0x35920b='outbound';}else{console[_0x9f2a('0x1d')](_0x9f2a('0x1e'),_0x40c875);}}else{_0x35920b=_0x9f2a('0x1f');}switch(_0x5567f1[_0x9f2a('0x17')][_0x9f2a('0x18')]()){case _0x9f2a('0xc'):zendesk[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case _0x9f2a('0xd'):salesforce[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case _0x9f2a('0xe'):sugarcrm[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case _0x9f2a('0xf'):freshdesk[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case _0x9f2a('0x10'):zoho[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case _0x9f2a('0x11'):desk[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case'vtiger':vtiger[_0x35920b](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb);break;case _0x9f2a('0x13'):freshsales['cs'](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb,_0x35920b);break;case'servicenow':servicenow['cs'](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb,_0x35920b);break;case _0x9f2a('0x20'):dynamics365['cs'](_0x5567f1,_0x40c875,_0x5d5c4c,_0x5edbbc,_0x487f2a,_0x5163a0,_0x48e3cb,_0x35920b);break;default:console[_0x9f2a('0x1d')](_0x9f2a('0x21'));}}else{_0x5e1598=require(_0x9f2a('0x22'))(_0x5567f1[_0x9f2a('0x17')][_0x9f2a('0x18')]());_0x5e1598['error']('[EXEC]',util[_0x9f2a('0x23')](_0x9f2a('0x24'),_0x5567f1[_0x9f2a('0x17')][_0x9f2a('0x18')](),_0x5567f1['data3']));}}else{_0x5e1598=require(_0x9f2a('0x22'))(_0x5567f1[_0x9f2a('0x17')][_0x9f2a('0x18')]());_0x5e1598[_0x9f2a('0x25')](_0x9f2a('0x26'),util[_0x9f2a('0x23')](_0x9f2a('0x27'),_0x5567f1[_0x9f2a('0x17')][_0x9f2a('0x18')](),_0x5567f1[_0x9f2a('0x19')]));}}else{}}catch(_0x46c0ad){console[_0x9f2a('0x25')](_0x46c0ad);}}}}; \ 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 6c093ee..0abee69 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 _0x7612=['unmanaged','monitor_format','lastevent','toUpperCase','isNil','calleridname','lodash','request-promise','moment','bluebird','md5','jsforce','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','length','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','account','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Caller\x20-\x20%s','LastName','','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','serverUrl','remoteUri','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:salesforce:display','newTab'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7612,0x10c));var _0x2761=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x7612[_0x525af9];return _0x129fbf;};'use strict';var _=require(_0x2761('0x0'));var rp=require(_0x2761('0x1'));var moment=require(_0x2761('0x2'));var BPromise=require(_0x2761('0x3'));var md5=require(_0x2761('0x4'));var jsforce=require(_0x2761('0x5'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x2761('0x6'));var config=require(_0x2761('0x7'));var logger=require(_0x2761('0x8'))(_0x2761('0x9'));config[_0x2761('0xa')]=_['defaults'](config[_0x2761('0xa')],{'host':_0x2761('0xb'),'port':0x18eb});var io=require(_0x2761('0xc'))(new Redis(config['redis']));function emit(_0x1428e0,_0x404e79,_0x4c60d2){io['to'](_0x1428e0)[_0x2761('0xd')](_0x404e79,_0x4c60d2);}function getTicket(_0x32cff0,_0x3dc87d,_0x3aaaae,_0x3a9da2,_0x320ae8,_0x43039f,_0x12c21a,_0x323abb){var _0x1051e5=Object[_0x2761('0xe')]({},{'OwnerId':_0x3dc87d['id'],'Subject':intUtil[_0x2761('0xf')](_0x3a9da2[_0x2761('0x10')],_0x320ae8,'\x20'),'Description':intUtil[_0x2761('0xf')](_0x3a9da2[_0x2761('0x11')],_0x320ae8,'\x0a')},getCustomFields(_0x43039f,_0x320ae8));if(_0x3aaaae){if(_0x3a9da2[_0x2761('0x12')]===_0x2761('0x13')){_0x1051e5[_0x2761('0x14')]=moment[_0x2761('0x15')]();_0x1051e5[_0x2761('0x16')]=![];_0x1051e5[_0x2761('0x17')]=![];if(_0x3aaaae[_0x2761('0x18')]===_0x2761('0x19')||_0x3aaaae['endUserType']===_0x2761('0x1a')){_0x1051e5['WhoId']=_0x3aaaae['id'];}else if(_0x3aaaae['endUserType']==='account'){_0x1051e5['WhatId']=_0x3aaaae['id'];}}else if(_0x3a9da2[_0x2761('0x12')]===_0x2761('0x1b')){if(_0x3aaaae[_0x2761('0x18')]==='contact'){_0x1051e5[_0x2761('0x1c')]=_0x3aaaae['id'];}else if(_0x3aaaae[_0x2761('0x18')]==='account'){_0x1051e5[_0x2761('0x1d')]=_0x3aaaae['id'];}else if(_0x3aaaae[_0x2761('0x18')]==='lead'&&_0x3a9da2[_0x2761('0x1e')]){_0x1051e5[_0x3a9da2['leadId']]=_0x3aaaae['id'];}else{logger[_0x2761('0x1f')](_0x2761('0x20'));}}}return _0x12c21a[_0x2761('0x21')](_0x3a9da2[_0x2761('0x12')])[_0x2761('0x22')](_0x1051e5);}function getUser(_0x21429c,_0x2bc7fa,_0x1a8c98){if(!_['isNil'](_0x2bc7fa)&&intUtil[_0x2761('0x23')](_0x2bc7fa)){var _0x320fda={'Email':_0x2bc7fa};var _0x5220e1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1a8c98[_0x2761('0x21')](_0x2761('0x24'))[_0x2761('0x25')](_0x320fda,_0x5220e1)[_0x2761('0x26')]()['then'](function(_0x5764ba){if(_0x5764ba[_0x2761('0x27')]){var _0x16e2ef=_[_0x2761('0x25')](_0x5764ba,function(_0x458f99){return _0x458f99['Email']===_0x2bc7fa;});if(_0x16e2ef){logger['info'](_0x2761('0x28'),_0x2bc7fa);return BPromise[_0x2761('0x29')]({'id':_0x16e2ef['Id'],'name':_0x16e2ef[_0x2761('0x2a')]});}}else{logger['info'](_0x2761('0x2b'),_0x2bc7fa);return _0x1a8c98[_0x2761('0x2c')]()[_0x2761('0x2d')](function(_0x31aa9a){return BPromise[_0x2761('0x29')]({'id':_0x31aa9a[_0x2761('0x2e')],'name':_0x31aa9a[_0x2761('0x2f')]});});}});}else{logger[_0x2761('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2bc7fa);return _0x1a8c98[_0x2761('0x2c')]()[_0x2761('0x2d')](function(_0x3ccef2){return BPromise[_0x2761('0x29')]({'id':_0x3ccef2[_0x2761('0x2e')],'name':_0x3ccef2['display_name']});});}}function getEndUser(_0x51a825,_0x56ba21,_0x1bc4b1,_0x39c2a4,_0x1bfb83){var _0x29e8dc={'$or':{'Phone':_0x39c2a4}};var _0x1e33a8={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x2761('0x29')]()[_0x2761('0x2d')](function(){logger[_0x2761('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x39c2a4,_0x56ba21[_0x2761('0x30')]);switch(_0x56ba21[_0x2761('0x30')]){case _0x2761('0x31'):var _0x362659=_[_0x2761('0x32')](_0x29e8dc);if(_0x56ba21['additionalSearchContact']){var _0x4f9bac={};_0x4f9bac[_0x56ba21[_0x2761('0x33')]]=_0x39c2a4;_[_0x2761('0x34')](_0x362659[_0x2761('0x35')],_0x4f9bac);}return _0x1bfb83[_0x2761('0x21')](_0x2761('0x36'))['find'](_0x362659,_0x1e33a8)['execute']()[_0x2761('0x2d')](function(_0x1288b4){if(_0x1288b4&&_0x1288b4[_0x2761('0x27')]){return _0x1288b4;}else{var _0x586225=_[_0x2761('0x32')](_0x29e8dc);if(_0x56ba21[_0x2761('0x37')]){var _0x42cc96={};_0x42cc96[_0x56ba21[_0x2761('0x37')]]=_0x39c2a4;_[_0x2761('0x34')](_0x586225[_0x2761('0x35')],_0x42cc96);}return _0x1bfb83[_0x2761('0x21')](_0x2761('0x38'))['find'](_0x586225,_0x1e33a8);}});case'account_contact_lead':var _0x117143=_[_0x2761('0x32')](_0x29e8dc);if(_0x56ba21[_0x2761('0x39')]){var _0x4f9bac={};_0x4f9bac[_0x56ba21[_0x2761('0x39')]]=_0x39c2a4;_[_0x2761('0x34')](_0x117143[_0x2761('0x35')],_0x4f9bac);}return _0x1bfb83['sobject']('Account')['find'](_0x117143,_0x1e33a8)[_0x2761('0x26')]()[_0x2761('0x2d')](function(_0x4a7477){if(_0x4a7477&&_0x4a7477[_0x2761('0x27')]){return _0x4a7477;}else{var _0x2c9634=_['cloneDeep'](_0x29e8dc);if(_0x56ba21['additionalSearchContact']){var _0x1d4501={};_0x1d4501[_0x56ba21[_0x2761('0x33')]]=_0x39c2a4;_[_0x2761('0x34')](_0x2c9634[_0x2761('0x35')],_0x1d4501);}return _0x1bfb83[_0x2761('0x21')](_0x2761('0x36'))['find'](_0x2c9634,_0x1e33a8)[_0x2761('0x2d')](function(_0xb7a539){if(_0xb7a539&&_0xb7a539[_0x2761('0x27')]){return _0xb7a539;}else{var _0x33400f=_[_0x2761('0x32')](_0x29e8dc);if(_0x56ba21['additionalSearchLead']){var _0x27376d={};_0x27376d[_0x56ba21[_0x2761('0x37')]]=_0x39c2a4;_['merge'](_0x33400f[_0x2761('0x35')],_0x27376d);}return _0x1bfb83[_0x2761('0x21')](_0x2761('0x38'))['find'](_0x33400f,_0x1e33a8);}});}});case _0x2761('0x19'):var _0x362659=_[_0x2761('0x32')](_0x29e8dc);if(_0x56ba21['additionalSearchContact']){var _0x4f9bac={};_0x4f9bac[_0x56ba21[_0x2761('0x33')]]=_0x39c2a4;_[_0x2761('0x34')](_0x362659[_0x2761('0x35')],_0x4f9bac);}return _0x1bfb83['sobject'](_0x2761('0x36'))[_0x2761('0x25')](_0x362659,_0x1e33a8)[_0x2761('0x26')]();case _0x2761('0x1a'):var _0x441e1b=_['cloneDeep'](_0x29e8dc);if(_0x56ba21[_0x2761('0x37')]){var _0x4f9bac={};_0x4f9bac[_0x56ba21[_0x2761('0x37')]]=_0x39c2a4;_[_0x2761('0x34')](_0x441e1b[_0x2761('0x35')],_0x4f9bac);}return _0x1bfb83[_0x2761('0x21')](_0x2761('0x38'))[_0x2761('0x25')](_0x441e1b,_0x1e33a8);case _0x2761('0x3a'):var _0x117143=_['cloneDeep'](_0x29e8dc);if(_0x56ba21['additionalSearchAccount']){var _0x4f9bac={};_0x4f9bac[_0x56ba21[_0x2761('0x39')]]=_0x39c2a4;_['merge'](_0x117143[_0x2761('0x35')],_0x4f9bac);}return _0x1bfb83[_0x2761('0x21')](_0x2761('0x3b'))[_0x2761('0x25')](_0x117143,_0x1e33a8);default:return null;}})[_0x2761('0x2d')](function(_0x46e125){if(_0x46e125&&_0x46e125[_0x2761('0x27')]){var _0x3a7d27=_[_0x2761('0x3c')](_0x46e125);if(_0x3a7d27){return BPromise[_0x2761('0x29')]({'id':_0x3a7d27['Id'],'name':_0x3a7d27[_0x2761('0x2a')],'phone':_0x3a7d27[_0x2761('0x3d')],'endUserType':_0x3a7d27['attributes'][_0x2761('0x3e')][_0x2761('0x3f')]()});}}})[_0x2761('0x2d')](function(_0xc1386a){if(_0xc1386a){logger[_0x2761('0x1f')](_0x2761('0x40'),_0xc1386a[_0x2761('0x18')],_0x39c2a4);return BPromise[_0x2761('0x29')](_0xc1386a);}else{logger[_0x2761('0x1f')](_0x2761('0x41'),_0x39c2a4);var _0x2a954e={'Phone':_0x39c2a4};if(_0x56ba21[_0x2761('0x42')]){if(_0x56ba21[_0x2761('0x42')]===_0x2761('0x19')){logger[_0x2761('0x1f')](_0x2761('0x43'),_0x39c2a4,_0x56ba21['moduleCreate']);_0x2a954e['LastName']=_0x1bc4b1!==''?_0x1bc4b1:util[_0x2761('0x44')](_0x2761('0x45'),_0x39c2a4);}else if(_0x56ba21[_0x2761('0x42')]===_0x2761('0x1a')){logger[_0x2761('0x1f')](_0x2761('0x43'),_0x39c2a4,_0x56ba21['moduleCreate']);_0x2a954e[_0x2761('0x46')]=_0x1bc4b1!==_0x2761('0x47')?_0x1bc4b1:util[_0x2761('0x44')]('Caller\x20-\x20%s',_0x39c2a4);_0x2a954e[_0x2761('0x48')]=_0x2761('0x49');}else if(_0x56ba21[_0x2761('0x42')]===_0x2761('0x3a')){logger['info'](_0x2761('0x43'),_0x39c2a4,_0x56ba21[_0x2761('0x42')]);_0x2a954e[_0x2761('0x2a')]=_0x1bc4b1!==_0x2761('0x47')?_0x1bc4b1:util[_0x2761('0x44')](_0x2761('0x45'),_0x39c2a4);}else{return null;}}return _0x1bfb83[_0x2761('0x21')](_[_0x2761('0x4a')](_0x56ba21[_0x2761('0x42')]))[_0x2761('0x22')](_0x2a954e)[_0x2761('0x2d')](function(_0x1c3f22){return BPromise[_0x2761('0x29')]({'id':_0x1c3f22['id'],'endUserType':_0x56ba21[_0x2761('0x42')]});});}});}function getCustomFields(_0x319072,_0x38ef86){var _0x5f34bb={};if(_0x319072[_0x2761('0x27')]>0x0){_[_0x2761('0x4b')](_0x319072,function(_0x2b212a){if(_[_0x2761('0x4c')]([_0x2761('0x4d'),_0x2761('0x4e')],_0x2b212a[_0x2761('0x3e')])&&_0x2b212a[_0x2761('0x4f')]){_0x5f34bb[_0x2b212a[_0x2761('0x4f')]]=_0x2b212a[_0x2761('0x50')][_0x2761('0x51')]();}else if(_0x2b212a[_0x2761('0x3e')]===_0x2761('0x52')&&_0x2b212a['variableName']&&_0x2b212a[_0x2761('0x4f')]){_0x38ef86[_0x2b212a[_0x2761('0x53')]]&&(_0x5f34bb[_0x2b212a[_0x2761('0x4f')]]=_0x38ef86[_0x2b212a[_0x2761('0x53')]]['toString']());}else if(_0x2b212a[_0x2761('0x3e')]==='customVariable'&&_0x2b212a[_0x2761('0x54')]&&_0x2b212a['Variable'][_0x2761('0x55')]&&_0x2b212a['idField']){_0x38ef86[_0x2b212a['Variable']['name'][_0x2761('0x3f')]()]&&(_0x5f34bb[_0x2b212a[_0x2761('0x4f')]]=_0x38ef86[_0x2b212a[_0x2761('0x54')]['name'][_0x2761('0x3f')]()][_0x2761('0x51')]());}});}return _0x5f34bb;}function getConnection(_0xdfba59){var _0x493f61=_0xdfba59['password'][_0x2761('0x56')](_0xdfba59[_0x2761('0x57')]);var _0x4beeeb=new jsforce[(_0x2761('0x58'))]({'oauth2':{'loginUrl':_0xdfba59['remoteUri']||_0x2761('0x59'),'clientId':_0xdfba59[_0x2761('0x5a')],'clientSecret':_0xdfba59[_0x2761('0x5b')]}});return _0x4beeeb[_0x2761('0x5c')](_0xdfba59['username'],_0x493f61)[_0x2761('0x2d')](function(){logger[_0x2761('0x1f')](_0x2761('0x5d'));return _0x4beeeb;});}exports[_0x2761('0x5e')]=function(_0x5ebeda,_0x516d53,_0x2e9c74,_0x39b8e5,_0x108506,_0x45f104){var _0x106346,_0x27f5af,_0x139d6b,_0x302822;_0x45f104['serverUrl']=intUtil[_0x2761('0x5f')](_0x45f104[_0x2761('0x60')]);_0x45f104[_0x2761('0x61')]=intUtil[_0x2761('0x5f')](_0x45f104[_0x2761('0x61')]);if(_0x108506&&_0x108506['monitor_format']){logger[_0x2761('0x1f')]('[QUEUE]',_0x2761('0x62'));_0x516d53[_0x2761('0x63')]=util[_0x2761('0x44')](_0x2761('0x64'),_0x45f104[_0x2761('0x60')],_0x516d53[_0x2761('0x65')],md5(_0x516d53[_0x2761('0x65')]));}else{_0x516d53['recordingURL']='';}return getConnection(_0x45f104)['then'](function(_0x3d2d3e){_0x302822=_0x3d2d3e;return getUser(_0x45f104,_0x39b8e5[_0x2761('0x66')],_0x302822);})['then'](function(_0x2239e8){_0x106346=_0x2239e8;return getEndUser(_0x45f104,_0x2e9c74,_0x516d53['calleridname'],_0x516d53[_0x2761('0x67')],_0x302822);})['then'](function(_0x4607af){_0x27f5af=_0x4607af;return getTicket(_0x45f104,_0x106346,_0x27f5af,_0x2e9c74,_0x516d53,_0x2e9c74[_0x2761('0x68')],_0x302822,_0x2761('0x5e'));})[_0x2761('0x2d')](function(_0x479ebd){_0x139d6b=_0x479ebd;logger[_0x2761('0x1f')](_0x2761('0x69'),_0x139d6b['id']);logger[_0x2761('0x1f')](_0x2761('0x6a'),_0x139d6b['id'],_0x39b8e5[_0x2761('0x55')],_0x45f104[_0x2761('0x3e')]);switch(_0x45f104['type']){case _0x2761('0x6b'):emit(util[_0x2761('0x44')](_0x2761('0x6c'),_0x39b8e5[_0x2761('0x55')]),'trigger:salesforce:display',{'recordId':_0x139d6b['id']});break;case'newTab':emit(util[_0x2761('0x44')](_0x2761('0x6c'),_0x39b8e5[_0x2761('0x55')]),_0x2761('0x6d'),{'uri':util['format'](_0x2761('0x6e'),_0x302822[_0x2761('0x6f')],_0x139d6b['id'])});break;default:logger[_0x2761('0x70')](_0x2761('0x71'));}})[_0x2761('0x72')](function(_0x5bed9c){logger[_0x2761('0x70')](_0x2761('0x73'),_0x5bed9c);});};exports[_0x2761('0x74')]=function(_0x38f917,_0x1f78c3,_0x11d46d,_0x1d07f8,_0x50b6b6,_0x44078e,_0x47319e){var _0xe583f9,_0x40e1f3,_0x42b5fc,_0x3c8bad;_0x44078e[_0x2761('0x60')]=intUtil[_0x2761('0x5f')](_0x44078e['serverUrl']);_0x44078e['remoteUri']=intUtil[_0x2761('0x5f')](_0x44078e[_0x2761('0x61')]);if(_0x47319e&&_0x47319e[_0x2761('0x75')]&&_0x47319e[_0x2761('0x75')]!==_0x2761('0x76')){logger[_0x2761('0x1f')](_0x2761('0x77'),_0x2761('0x62'));_0x1f78c3[_0x2761('0x63')]=util[_0x2761('0x44')](_0x2761('0x64'),_0x44078e[_0x2761('0x60')],_0x1f78c3[_0x2761('0x65')],md5(_0x1f78c3[_0x2761('0x65')]));}return getConnection(_0x44078e)[_0x2761('0x2d')](function(_0x454bb3){_0x3c8bad=_0x454bb3;return getUser(_0x44078e,_0x1d07f8[_0x2761('0x66')],_0x3c8bad);})[_0x2761('0x2d')](function(_0x1d7bf5){_0xe583f9=_0x1d7bf5;return getEndUser(_0x44078e,_0x11d46d,_0x1f78c3[_0x2761('0x78')],_0x1f78c3[_0x2761('0x79')],_0x3c8bad);})[_0x2761('0x2d')](function(_0x300075){_0x40e1f3=_0x300075;return getTicket(_0x44078e,_0xe583f9,_0x40e1f3,_0x11d46d,_0x1f78c3,_0x11d46d[_0x2761('0x68')],_0x3c8bad,_0x2761('0x74'));})[_0x2761('0x2d')](function(_0xbbb44c){_0x42b5fc=_0xbbb44c;logger[_0x2761('0x1f')](_0x2761('0x7a'),_0x42b5fc['id']);logger[_0x2761('0x1f')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x42b5fc['id'],_0x1d07f8[_0x2761('0x55')],_0x44078e[_0x2761('0x3e')]);switch(_0x44078e[_0x2761('0x3e')]){case _0x2761('0x6b'):emit(util[_0x2761('0x44')]('user:%s',_0x1d07f8[_0x2761('0x55')]),_0x2761('0x7b'),{'recordId':_0x42b5fc['id']});break;case _0x2761('0x7c'):emit(util[_0x2761('0x44')]('user:%s',_0x1d07f8[_0x2761('0x55')]),_0x2761('0x6d'),{'uri':util[_0x2761('0x44')](_0x2761('0x6e'),_0x3c8bad[_0x2761('0x6f')],_0x42b5fc['id'])});break;default:logger[_0x2761('0x70')](_0x2761('0x77'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x2761('0x72')](function(_0x597c76){logger[_0x2761('0x70')]('[OUTBOUND]',_0x597c76);});};exports[_0x2761('0x7d')]=function(_0x37c897,_0x1149ac,_0x2bd050,_0x3a3432,_0x7591ed,_0x4969e0){var _0xdf8014,_0x301099,_0x6453f8,_0xedbabf;_0x4969e0[_0x2761('0x60')]=intUtil[_0x2761('0x5f')](_0x4969e0[_0x2761('0x60')]);_0x4969e0['remoteUri']=intUtil['stripTrailingSlash'](_0x4969e0['remoteUri']);if(_0x7591ed&&_0x7591ed[_0x2761('0x7e')]){logger[_0x2761('0x1f')]('['+_0x1149ac[_0x2761('0x7f')][_0x2761('0x80')]()+']',_0x2761('0x62'));_0x1149ac[_0x2761('0x63')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4969e0[_0x2761('0x60')],_0x1149ac[_0x2761('0x65')],md5(_0x1149ac[_0x2761('0x65')]));}else{_0x1149ac[_0x2761('0x63')]='';}return getConnection(_0x4969e0)[_0x2761('0x2d')](function(_0x12f81f){_0xedbabf=_0x12f81f;if(!_[_0x2761('0x81')](_0x3a3432)){return getUser(_0x4969e0,_0x3a3432['name'],_0xedbabf);}else{return getUser(_0x4969e0,null,_0xedbabf);}})[_0x2761('0x2d')](function(_0x3afe29){_0xdf8014=_0x3afe29;return getEndUser(_0x4969e0,_0x2bd050,_0x1149ac[_0x2761('0x82')],_0x1149ac[_0x2761('0x67')],_0xedbabf);})[_0x2761('0x2d')](function(_0x3fcf9a){_0x301099=_0x3fcf9a;return getTicket(_0x4969e0,_0xdf8014,_0x301099,_0x2bd050,_0x1149ac,_0x2bd050[_0x2761('0x68')],_0xedbabf);})[_0x2761('0x2d')](function(_0x4f4ff2){_0x6453f8=_0x4f4ff2;logger[_0x2761('0x1f')]('['+_0x1149ac[_0x2761('0x7f')][_0x2761('0x80')]()+']\x20Ticket\x20%s\x20created.',_0x6453f8['id']);logger[_0x2761('0x1f')]('['+_0x1149ac[_0x2761('0x7f')][_0x2761('0x80')]()+']\x20Integration\x20account\x20type\x20%s.',_0x4969e0[_0x2761('0x3e')]);})[_0x2761('0x72')](function(_0x3c4ccc){logger[_0x2761('0x70')]('['+_0x1149ac[_0x2761('0x7f')][_0x2761('0x80')]()+']',_0x3c4ccc);});}; \ No newline at end of file +var _0x27ef=['Caller\x20-\x20%s','LastName','format','Company','No\x20Company','upperFirst','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','error','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','redis','defaults','localhost','assign','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','contact','endUserType','WhoId','account','ContactId','lead','leadId','info','isNil','validateEmail','sobject','User','find','length','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','account_contact_lead','additionalSearchAccount','Contact','Lead','Account','Name','Phone','attributes','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.',''];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x27ef,0x1bd));var _0xf27e=function(_0x6891f7,_0x4747a6){_0x6891f7=_0x6891f7-0x0;var _0x45c5c8=_0x27ef[_0x6891f7];return _0x45c5c8;};'use strict';var _=require(_0xf27e('0x0'));var rp=require(_0xf27e('0x1'));var moment=require(_0xf27e('0x2'));var BPromise=require(_0xf27e('0x3'));var md5=require(_0xf27e('0x4'));var jsforce=require(_0xf27e('0x5'));var util=require('util');var Redis=require(_0xf27e('0x6'));var intUtil=require(_0xf27e('0x7'));var config=require('../../../../config/environment');var logger=require(_0xf27e('0x8'))('salesforce');config[_0xf27e('0x9')]=_[_0xf27e('0xa')](config['redis'],{'host':_0xf27e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2e0e7d,_0x335a5d,_0x3a39d6){io['to'](_0x2e0e7d)['emit'](_0x335a5d,_0x3a39d6);}function getTicket(_0x35fbef,_0x38e925,_0x2ef3d4,_0x2d34a6,_0x579b66,_0x3eb1ba,_0x55c6d8,_0x23a228){var _0x59d5b2=Object[_0xf27e('0xc')]({},{'OwnerId':_0x38e925['id'],'Subject':intUtil[_0xf27e('0xd')](_0x2d34a6[_0xf27e('0xe')],_0x579b66,'\x20'),'Description':intUtil[_0xf27e('0xd')](_0x2d34a6['Descriptions'],_0x579b66,'\x0a')},getCustomFields(_0x3eb1ba,_0x579b66));if(_0x2ef3d4){if(_0x2d34a6[_0xf27e('0xf')]===_0xf27e('0x10')){_0x59d5b2[_0xf27e('0x11')]=moment[_0xf27e('0x12')]();_0x59d5b2[_0xf27e('0x13')]=![];_0x59d5b2['IsRecurrence']=![];if(_0x2ef3d4['endUserType']===_0xf27e('0x14')||_0x2ef3d4[_0xf27e('0x15')]==='lead'){_0x59d5b2[_0xf27e('0x16')]=_0x2ef3d4['id'];}else if(_0x2ef3d4[_0xf27e('0x15')]===_0xf27e('0x17')){_0x59d5b2['WhatId']=_0x2ef3d4['id'];}}else if(_0x2d34a6[_0xf27e('0xf')]==='Case'){if(_0x2ef3d4[_0xf27e('0x15')]==='contact'){_0x59d5b2[_0xf27e('0x18')]=_0x2ef3d4['id'];}else if(_0x2ef3d4[_0xf27e('0x15')]===_0xf27e('0x17')){_0x59d5b2['AccountId']=_0x2ef3d4['id'];}else if(_0x2ef3d4['endUserType']===_0xf27e('0x19')&&_0x2d34a6['leadId']){_0x59d5b2[_0x2d34a6[_0xf27e('0x1a')]]=_0x2ef3d4['id'];}else{logger[_0xf27e('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x55c6d8['sobject'](_0x2d34a6['ticketType'])['create'](_0x59d5b2);}function getUser(_0x463534,_0x2f87ac,_0x390ad4){if(!_[_0xf27e('0x1c')](_0x2f87ac)&&intUtil[_0xf27e('0x1d')](_0x2f87ac)){var _0x49a09f={'Email':_0x2f87ac};var _0xfbce81={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x390ad4[_0xf27e('0x1e')](_0xf27e('0x1f'))[_0xf27e('0x20')](_0x49a09f,_0xfbce81)['execute']()['then'](function(_0x203c3e){if(_0x203c3e[_0xf27e('0x21')]){var _0x952cec=_[_0xf27e('0x20')](_0x203c3e,function(_0x2d877c){return _0x2d877c['Email']===_0x2f87ac;});if(_0x952cec){logger['info']('Agent\x20%s\x20found.',_0x2f87ac);return BPromise[_0xf27e('0x22')]({'id':_0x952cec['Id'],'name':_0x952cec['Name']});}}else{logger[_0xf27e('0x1b')](_0xf27e('0x23'),_0x2f87ac);return _0x390ad4[_0xf27e('0x24')]()[_0xf27e('0x25')](function(_0x10eb25){return BPromise[_0xf27e('0x22')]({'id':_0x10eb25[_0xf27e('0x26')],'name':_0x10eb25['display_name']});});}});}else{logger['info'](_0xf27e('0x23'),_0x2f87ac);return _0x390ad4[_0xf27e('0x24')]()[_0xf27e('0x25')](function(_0x3125ea){return BPromise[_0xf27e('0x22')]({'id':_0x3125ea['user_id'],'name':_0x3125ea[_0xf27e('0x27')]});});}}function getEndUser(_0x145feb,_0x9dc707,_0x72afa8,_0x3f5a91,_0x4a92dc){var _0x256d30={'$or':{'Phone':_0x3f5a91}};var _0x42aba5={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf27e('0x22')]()['then'](function(){logger['info'](_0xf27e('0x28'),_0x3f5a91,_0x9dc707[_0xf27e('0x29')]);switch(_0x9dc707[_0xf27e('0x29')]){case _0xf27e('0x2a'):var _0x542e7d=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707['additionalSearchContact']){var _0x1bb8aa={};_0x1bb8aa[_0x9dc707[_0xf27e('0x2c')]]=_0x3f5a91;_[_0xf27e('0x2d')](_0x542e7d[_0xf27e('0x2e')],_0x1bb8aa);}return _0x4a92dc[_0xf27e('0x1e')]('Contact')[_0xf27e('0x20')](_0x542e7d,_0x42aba5)[_0xf27e('0x2f')]()[_0xf27e('0x25')](function(_0x40a321){if(_0x40a321&&_0x40a321['length']){return _0x40a321;}else{var _0x1d996b=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x30')]){var _0x16edee={};_0x16edee[_0x9dc707[_0xf27e('0x30')]]=_0x3f5a91;_[_0xf27e('0x2d')](_0x1d996b[_0xf27e('0x2e')],_0x16edee);}return _0x4a92dc[_0xf27e('0x1e')]('Lead')[_0xf27e('0x20')](_0x1d996b,_0x42aba5);}});case _0xf27e('0x31'):var _0x4f929c=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x32')]){var _0x1bb8aa={};_0x1bb8aa[_0x9dc707[_0xf27e('0x32')]]=_0x3f5a91;_[_0xf27e('0x2d')](_0x4f929c[_0xf27e('0x2e')],_0x1bb8aa);}return _0x4a92dc[_0xf27e('0x1e')]('Account')[_0xf27e('0x20')](_0x4f929c,_0x42aba5)[_0xf27e('0x2f')]()['then'](function(_0x160b86){if(_0x160b86&&_0x160b86['length']){return _0x160b86;}else{var _0x2104ef=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x2c')]){var _0x34ebf7={};_0x34ebf7[_0x9dc707[_0xf27e('0x2c')]]=_0x3f5a91;_[_0xf27e('0x2d')](_0x2104ef[_0xf27e('0x2e')],_0x34ebf7);}return _0x4a92dc[_0xf27e('0x1e')](_0xf27e('0x33'))[_0xf27e('0x20')](_0x2104ef,_0x42aba5)[_0xf27e('0x25')](function(_0x41d4c3){if(_0x41d4c3&&_0x41d4c3[_0xf27e('0x21')]){return _0x41d4c3;}else{var _0x126c58=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x30')]){var _0x319076={};_0x319076[_0x9dc707[_0xf27e('0x30')]]=_0x3f5a91;_[_0xf27e('0x2d')](_0x126c58['$or'],_0x319076);}return _0x4a92dc[_0xf27e('0x1e')](_0xf27e('0x34'))[_0xf27e('0x20')](_0x126c58,_0x42aba5);}});}});case _0xf27e('0x14'):var _0x542e7d=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x2c')]){var _0x1bb8aa={};_0x1bb8aa[_0x9dc707['additionalSearchContact']]=_0x3f5a91;_[_0xf27e('0x2d')](_0x542e7d[_0xf27e('0x2e')],_0x1bb8aa);}return _0x4a92dc['sobject']('Contact')[_0xf27e('0x20')](_0x542e7d,_0x42aba5)[_0xf27e('0x2f')]();case _0xf27e('0x19'):var _0x43e892=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x30')]){var _0x1bb8aa={};_0x1bb8aa[_0x9dc707['additionalSearchLead']]=_0x3f5a91;_['merge'](_0x43e892[_0xf27e('0x2e')],_0x1bb8aa);}return _0x4a92dc['sobject'](_0xf27e('0x34'))[_0xf27e('0x20')](_0x43e892,_0x42aba5);case _0xf27e('0x17'):var _0x4f929c=_[_0xf27e('0x2b')](_0x256d30);if(_0x9dc707[_0xf27e('0x32')]){var _0x1bb8aa={};_0x1bb8aa[_0x9dc707[_0xf27e('0x32')]]=_0x3f5a91;_['merge'](_0x4f929c['$or'],_0x1bb8aa);}return _0x4a92dc[_0xf27e('0x1e')](_0xf27e('0x35'))[_0xf27e('0x20')](_0x4f929c,_0x42aba5);default:return null;}})['then'](function(_0x3a2105){if(_0x3a2105&&_0x3a2105[_0xf27e('0x21')]){var _0x20a439=_['first'](_0x3a2105);if(_0x20a439){return BPromise[_0xf27e('0x22')]({'id':_0x20a439['Id'],'name':_0x20a439[_0xf27e('0x36')],'phone':_0x20a439[_0xf27e('0x37')],'endUserType':_0x20a439[_0xf27e('0x38')][_0xf27e('0x39')]['toLowerCase']()});}}})[_0xf27e('0x25')](function(_0x3d7540){if(_0x3d7540){logger[_0xf27e('0x1b')](_0xf27e('0x3a'),_0x3d7540[_0xf27e('0x15')],_0x3f5a91);return BPromise[_0xf27e('0x22')](_0x3d7540);}else{logger[_0xf27e('0x1b')](_0xf27e('0x3b'),_0x3f5a91);var _0xa94c6f={'Phone':_0x3f5a91};if(_0x9dc707[_0xf27e('0x3c')]){if(_0x9dc707[_0xf27e('0x3c')]==='contact'){logger[_0xf27e('0x1b')](_0xf27e('0x3d'),_0x3f5a91,_0x9dc707[_0xf27e('0x3c')]);_0xa94c6f['LastName']=_0x72afa8!==_0xf27e('0x3e')?_0x72afa8:util['format'](_0xf27e('0x3f'),_0x3f5a91);}else if(_0x9dc707[_0xf27e('0x3c')]===_0xf27e('0x19')){logger[_0xf27e('0x1b')](_0xf27e('0x3d'),_0x3f5a91,_0x9dc707[_0xf27e('0x3c')]);_0xa94c6f[_0xf27e('0x40')]=_0x72afa8!==_0xf27e('0x3e')?_0x72afa8:util[_0xf27e('0x41')](_0xf27e('0x3f'),_0x3f5a91);_0xa94c6f[_0xf27e('0x42')]=_0xf27e('0x43');}else if(_0x9dc707[_0xf27e('0x3c')]==='account'){logger['info'](_0xf27e('0x3d'),_0x3f5a91,_0x9dc707[_0xf27e('0x3c')]);_0xa94c6f[_0xf27e('0x36')]=_0x72afa8!==''?_0x72afa8:util[_0xf27e('0x41')]('Caller\x20-\x20%s',_0x3f5a91);}else{return null;}}return _0x4a92dc[_0xf27e('0x1e')](_[_0xf27e('0x44')](_0x9dc707['moduleCreate']))[_0xf27e('0x45')](_0xa94c6f)['then'](function(_0x21f645){return BPromise[_0xf27e('0x22')]({'id':_0x21f645['id'],'endUserType':_0x9dc707[_0xf27e('0x3c')]});});}});}function getCustomFields(_0x2312ee,_0x337e21){var _0x5b0bf9={};if(_0x2312ee['length']>0x0){_[_0xf27e('0x46')](_0x2312ee,function(_0x5e6055){if(_[_0xf27e('0x47')]([_0xf27e('0x48'),_0xf27e('0x49')],_0x5e6055[_0xf27e('0x39')])&&_0x5e6055[_0xf27e('0x4a')]){_0x5b0bf9[_0x5e6055[_0xf27e('0x4a')]]=_0x5e6055[_0xf27e('0x4b')][_0xf27e('0x4c')]();}else if(_0x5e6055[_0xf27e('0x39')]===_0xf27e('0x4d')&&_0x5e6055[_0xf27e('0x4e')]&&_0x5e6055[_0xf27e('0x4a')]){_0x337e21[_0x5e6055[_0xf27e('0x4e')]]&&(_0x5b0bf9[_0x5e6055[_0xf27e('0x4a')]]=_0x337e21[_0x5e6055[_0xf27e('0x4e')]][_0xf27e('0x4c')]());}else if(_0x5e6055[_0xf27e('0x39')]==='customVariable'&&_0x5e6055[_0xf27e('0x4f')]&&_0x5e6055[_0xf27e('0x4f')][_0xf27e('0x50')]&&_0x5e6055[_0xf27e('0x4a')]){_0x337e21[_0x5e6055[_0xf27e('0x4f')][_0xf27e('0x50')][_0xf27e('0x51')]()]&&(_0x5b0bf9[_0x5e6055[_0xf27e('0x4a')]]=_0x337e21[_0x5e6055['Variable'][_0xf27e('0x50')][_0xf27e('0x51')]()][_0xf27e('0x4c')]());}});}return _0x5b0bf9;}function getConnection(_0x252409){var _0x3d76ae=_0x252409[_0xf27e('0x52')][_0xf27e('0x53')](_0x252409[_0xf27e('0x54')]);var _0x3b6bbf=new jsforce[(_0xf27e('0x55'))]({'oauth2':{'loginUrl':_0x252409[_0xf27e('0x56')]||'https://login.salesforce.com','clientId':_0x252409[_0xf27e('0x57')],'clientSecret':_0x252409[_0xf27e('0x58')]}});return _0x3b6bbf[_0xf27e('0x59')](_0x252409[_0xf27e('0x5a')],_0x3d76ae)[_0xf27e('0x25')](function(){logger[_0xf27e('0x1b')](_0xf27e('0x5b'));return _0x3b6bbf;});}exports['queue']=function(_0x128442,_0x565d68,_0x2105e1,_0x47710e,_0x128ed7,_0x43c9cf){var _0x2ab78c,_0x5e3d39,_0x6935f0,_0xc2681c;_0x43c9cf[_0xf27e('0x5c')]=intUtil['stripTrailingSlash'](_0x43c9cf[_0xf27e('0x5c')]);_0x43c9cf['remoteUri']=intUtil[_0xf27e('0x5d')](_0x43c9cf[_0xf27e('0x56')]);if(_0x128ed7&&_0x128ed7[_0xf27e('0x5e')]){logger['info'](_0xf27e('0x5f'),_0xf27e('0x60'));_0x565d68[_0xf27e('0x61')]=util[_0xf27e('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43c9cf[_0xf27e('0x5c')],_0x565d68[_0xf27e('0x62')],md5(_0x565d68[_0xf27e('0x62')]));}else{_0x565d68[_0xf27e('0x61')]='';}return getConnection(_0x43c9cf)[_0xf27e('0x25')](function(_0x504e56){_0xc2681c=_0x504e56;return getUser(_0x43c9cf,_0x47710e[_0xf27e('0x63')],_0xc2681c);})[_0xf27e('0x25')](function(_0xa1aa5d){_0x2ab78c=_0xa1aa5d;return getEndUser(_0x43c9cf,_0x2105e1,_0x565d68[_0xf27e('0x64')],_0x565d68[_0xf27e('0x65')],_0xc2681c);})[_0xf27e('0x25')](function(_0x2f3b70){_0x5e3d39=_0x2f3b70;return getTicket(_0x43c9cf,_0x2ab78c,_0x5e3d39,_0x2105e1,_0x565d68,_0x2105e1[_0xf27e('0x66')],_0xc2681c,_0xf27e('0x67'));})['then'](function(_0x4390c2){_0x6935f0=_0x4390c2;logger[_0xf27e('0x1b')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x6935f0['id']);logger[_0xf27e('0x1b')](_0xf27e('0x68'),_0x6935f0['id'],_0x47710e[_0xf27e('0x50')],_0x43c9cf['type']);switch(_0x43c9cf['type']){case'integrationTab':emit(util[_0xf27e('0x41')](_0xf27e('0x69'),_0x47710e[_0xf27e('0x50')]),'trigger:salesforce:display',{'recordId':_0x6935f0['id']});break;case _0xf27e('0x6a'):emit(util[_0xf27e('0x41')](_0xf27e('0x69'),_0x47710e['name']),_0xf27e('0x6b'),{'uri':util[_0xf27e('0x41')](_0xf27e('0x6c'),_0xc2681c[_0xf27e('0x6d')],_0x6935f0['id'])});break;default:logger['error'](_0xf27e('0x6e'));}})[_0xf27e('0x6f')](function(_0x286cc0){logger['error'](_0xf27e('0x5f'),_0x286cc0);});};exports[_0xf27e('0x70')]=function(_0x452eba,_0xafbec1,_0x25ef5a,_0x46885e,_0x11785e,_0x45aa5d,_0x25dbab){var _0x460e65,_0x2d7077,_0x1b5fc4,_0x5f3c2e;_0x45aa5d[_0xf27e('0x5c')]=intUtil[_0xf27e('0x5d')](_0x45aa5d[_0xf27e('0x5c')]);_0x45aa5d[_0xf27e('0x56')]=intUtil['stripTrailingSlash'](_0x45aa5d[_0xf27e('0x56')]);if(_0x25dbab&&_0x25dbab[_0xf27e('0x71')]&&_0x25dbab[_0xf27e('0x71')]!==_0xf27e('0x72')){logger[_0xf27e('0x1b')](_0xf27e('0x73'),_0xf27e('0x60'));_0xafbec1[_0xf27e('0x61')]=util['format'](_0xf27e('0x74'),_0x45aa5d['serverUrl'],_0xafbec1[_0xf27e('0x62')],md5(_0xafbec1[_0xf27e('0x62')]));}return getConnection(_0x45aa5d)[_0xf27e('0x25')](function(_0x1d67d9){_0x5f3c2e=_0x1d67d9;return getUser(_0x45aa5d,_0x46885e[_0xf27e('0x63')],_0x5f3c2e);})[_0xf27e('0x25')](function(_0x4853df){_0x460e65=_0x4853df;return getEndUser(_0x45aa5d,_0x25ef5a,_0xafbec1[_0xf27e('0x75')],_0xafbec1[_0xf27e('0x76')],_0x5f3c2e);})['then'](function(_0x25c8a7){_0x2d7077=_0x25c8a7;return getTicket(_0x45aa5d,_0x460e65,_0x2d7077,_0x25ef5a,_0xafbec1,_0x25ef5a[_0xf27e('0x66')],_0x5f3c2e,_0xf27e('0x70'));})['then'](function(_0x5b43d8){_0x1b5fc4=_0x5b43d8;logger[_0xf27e('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1b5fc4['id']);logger[_0xf27e('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1b5fc4['id'],_0x46885e[_0xf27e('0x50')],_0x45aa5d['type']);switch(_0x45aa5d['type']){case _0xf27e('0x77'):emit(util[_0xf27e('0x41')](_0xf27e('0x69'),_0x46885e[_0xf27e('0x50')]),'trigger:salesforce:display',{'recordId':_0x1b5fc4['id']});break;case'newTab':emit(util['format']('user:%s',_0x46885e[_0xf27e('0x50')]),_0xf27e('0x6b'),{'uri':util[_0xf27e('0x41')]('%s/%s/e',_0x5f3c2e['instanceUrl'],_0x1b5fc4['id'])});break;default:logger[_0xf27e('0x78')](_0xf27e('0x73'),_0xf27e('0x79'));}})[_0xf27e('0x6f')](function(_0x50ae08){logger[_0xf27e('0x78')](_0xf27e('0x73'),_0x50ae08);});};exports[_0xf27e('0x7a')]=function(_0x8566d0,_0x10cc86,_0x37e8f8,_0x3595be,_0x2124d4,_0x2970ac){var _0x1172d0,_0x35a0f1,_0x49ee9f,_0x3d6dcf;_0x2970ac[_0xf27e('0x5c')]=intUtil[_0xf27e('0x5d')](_0x2970ac[_0xf27e('0x5c')]);_0x2970ac['remoteUri']=intUtil[_0xf27e('0x5d')](_0x2970ac[_0xf27e('0x56')]);if(_0x2124d4&&_0x2124d4[_0xf27e('0x5e')]){logger[_0xf27e('0x1b')]('['+_0x10cc86[_0xf27e('0x7b')]['toUpperCase']()+']',_0xf27e('0x60'));_0x10cc86[_0xf27e('0x61')]=util['format'](_0xf27e('0x74'),_0x2970ac[_0xf27e('0x5c')],_0x10cc86[_0xf27e('0x62')],md5(_0x10cc86[_0xf27e('0x62')]));}else{_0x10cc86[_0xf27e('0x61')]='';}return getConnection(_0x2970ac)[_0xf27e('0x25')](function(_0x4b65b5){_0x3d6dcf=_0x4b65b5;if(!_[_0xf27e('0x1c')](_0x3595be)){return getUser(_0x2970ac,_0x3595be['name'],_0x3d6dcf);}else{return getUser(_0x2970ac,null,_0x3d6dcf);}})[_0xf27e('0x25')](function(_0x3105ea){_0x1172d0=_0x3105ea;return getEndUser(_0x2970ac,_0x37e8f8,_0x10cc86[_0xf27e('0x64')],_0x10cc86[_0xf27e('0x65')],_0x3d6dcf);})[_0xf27e('0x25')](function(_0x3e1593){_0x35a0f1=_0x3e1593;return getTicket(_0x2970ac,_0x1172d0,_0x35a0f1,_0x37e8f8,_0x10cc86,_0x37e8f8['Fields'],_0x3d6dcf);})[_0xf27e('0x25')](function(_0x16a067){_0x49ee9f=_0x16a067;logger[_0xf27e('0x1b')]('['+_0x10cc86[_0xf27e('0x7b')][_0xf27e('0x7c')]()+_0xf27e('0x7d'),_0x49ee9f['id']);logger[_0xf27e('0x1b')]('['+_0x10cc86[_0xf27e('0x7b')]['toUpperCase']()+_0xf27e('0x7e'),_0x2970ac[_0xf27e('0x39')]);})[_0xf27e('0x6f')](function(_0x17fb3a){logger[_0xf27e('0x78')]('['+_0x10cc86[_0xf27e('0x7b')][_0xf27e('0x7c')]()+']',_0x17fb3a);});}; \ 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 d127185..bf5da5f 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 _0xc6d5=['variableName','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','GET','label','label_entry','Incident','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','outbound','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','type','nameField','content','toString','includes','picklist','idField','customField','toLowerCase','variable'];(function(_0xb6b6d0,_0x38e575){var _0x3f23f4=function(_0x50275e){while(--_0x50275e){_0xb6b6d0['push'](_0xb6b6d0['shift']());}};_0x3f23f4(++_0x38e575);}(_0xc6d5,0xa3));var _0x5c6d=function(_0x23601a,_0x4864e0){_0x23601a=_0x23601a-0x0;var _0x4a9541=_0xc6d5[_0x23601a];return _0x4a9541;};'use strict';var _=require(_0x5c6d('0x0'));var Promise=require(_0x5c6d('0x1'));var rp=require(_0x5c6d('0x2'));var util=require(_0x5c6d('0x3'));var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0x5c6d('0x4'));var config=require(_0x5c6d('0x5'));var logger=require(_0x5c6d('0x6'))('servicenow');config[_0x5c6d('0x7')]=_['defaults'](config[_0x5c6d('0x7')],{'host':_0x5c6d('0x8'),'port':0x18eb});var io=require(_0x5c6d('0x9'))(new Redis(config['redis']));function getAdminUser(_0x12d585,_0x3a8dbf,_0x59955f,_0x1f8864,_0x5d2391,_0x9d6c23){return new Promise(function(_0x1a7fd0,_0x44412d){var _0x33d614={'method':'GET','uri':_0x1f8864+_0x5c6d('0xa')+'&'+_0x5d2391+'&'+_0x9d6c23,'auth':_0x3a8dbf,'json':!![]};return rp(_0x33d614)[_0x5c6d('0xb')](function(_0x482ca7){if(_0x482ca7[_0x5c6d('0xc')][_0x5c6d('0xd')]>0x0){_0x59955f[_0x5c6d('0xe')]=_0x482ca7[_0x5c6d('0xc')][0x0]['sys_id'];}logger[_0x5c6d('0xf')]('['+[_0x12d585[_0x5c6d('0x10')]()]+_0x5c6d('0x11'),_0x59955f);_0x1a7fd0(_0x59955f);})[_0x5c6d('0x12')](function(_0x324b3d){logger[_0x5c6d('0x13')]('['+[_0x12d585[_0x5c6d('0x10')]()]+']',_0x324b3d[_0x5c6d('0x14')]);_0x44412d(_0x324b3d['message']);});});}function getUser(_0x4a99de,_0x221bdd,_0x290f45,_0x2660f0,_0x29f3b3){return function(_0x255dc2){logger['info']('['+[_0x4a99de[_0x5c6d('0x10')]()]+_0x5c6d('0x15'),_0x255dc2);return new Promise(function(_0x3af2a4,_0x43d3c1){if(intUtil['validateEmail'](_0x255dc2[_0x5c6d('0x16')])){var _0x4543c5={'method':'GET','uri':_0x290f45+_0x5c6d('0x17')+_0x255dc2[_0x5c6d('0x16')]+'&'+_0x2660f0+'&'+_0x29f3b3,'auth':_0x221bdd,'json':!![]};logger[_0x5c6d('0xf')]('['+[_0x4a99de[_0x5c6d('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x4543c5);return rp(_0x4543c5)['then'](function(_0x3ec4d4){logger[_0x5c6d('0xf')]('['+[_0x4a99de['toUpperCase']()]+_0x5c6d('0x18'),_0x3ec4d4);if(_0x3ec4d4['result']['length']>0x0&&String(_0x3ec4d4[_0x5c6d('0xc')][0x0][_0x5c6d('0x19')])===_0x5c6d('0x1a')){_0x255dc2[_0x5c6d('0x1b')]=_0x3ec4d4[_0x5c6d('0xc')][0x0][_0x5c6d('0x1c')];}else{_0x255dc2[_0x5c6d('0x1b')]=_0x255dc2[_0x5c6d('0xe')];_0x255dc2[_0x5c6d('0x16')]=_0x255dc2[_0x5c6d('0x1d')];}logger[_0x5c6d('0xf')]('['+[_0x4a99de['toUpperCase']()]+_0x5c6d('0x1e'),_0x255dc2);_0x3af2a4(_0x255dc2);})['catch'](function(_0x7dbf97){logger[_0x5c6d('0x13')]('['+[_0x4a99de['toUpperCase']()]+']',_0x7dbf97[_0x5c6d('0x14')]);_0x43d3c1(_0x7dbf97[_0x5c6d('0x14')]);});}else{logger[_0x5c6d('0xf')]('['+[_0x4a99de[_0x5c6d('0x10')]()]+_0x5c6d('0x1f'));_0x255dc2[_0x5c6d('0x1b')]=_0x255dc2[_0x5c6d('0xe')];_0x255dc2[_0x5c6d('0x16')]=_0x255dc2['adminEmail'];_0x3af2a4(_0x255dc2);}});};}function createEndUser(_0x308131,_0x537989,_0x202b90,_0x42ca17,_0x31f9a5){logger['info']('['+[_0x308131['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x202b90);return new Promise(function(_0xef8fe6,_0xeb6c0b){var _0x5da384={'method':_0x5c6d('0x20'),'uri':_0x42ca17+_0x5c6d('0x21')+_0x31f9a5,'body':{'user_name':_0x202b90[_0x5c6d('0x22')],'roles':'user','first_name':_0x202b90[_0x5c6d('0x22')],'active':_0x5c6d('0x1a'),'date_format':_0x5c6d('0x23'),'phone':_0x202b90[_0x5c6d('0x22')]},'auth':_0x537989,'json':!![]};return rp(_0x5da384)['then'](function(_0xd1edbd){logger[_0x5c6d('0xf')]('['+[_0x308131[_0x5c6d('0x10')]()]+'],\x20EndUser\x20schema',_0xd1edbd[_0x5c6d('0xc')]);_0x202b90[_0x5c6d('0x24')]=_0xd1edbd[_0x5c6d('0xc')][_0x5c6d('0x1c')];_0xef8fe6(_0x202b90);})[_0x5c6d('0x12')](function(_0x5735e2){logger[_0x5c6d('0x13')]('['+[_0x308131['toUpperCase']()]+']',_0x5735e2[_0x5c6d('0x14')]);_0xeb6c0b(_0x5735e2[_0x5c6d('0x14')]);});});}function getEndUser(_0x4da5e4,_0x5e8ca7,_0x5c02a5,_0x50a69a,_0x24e96e){return function(_0x2d5199){logger[_0x5c6d('0xf')]('['+[_0x4da5e4[_0x5c6d('0x10')]()]+_0x5c6d('0x25'),_0x2d5199);return new Promise(function(_0x207fa8,_0x480cf0){var _0x23c761={'method':'GET','uri':_0x5c02a5+_0x5c6d('0x26')+_0x2d5199['endUserNumber']+'&'+_0x50a69a+'&'+_0x24e96e,'auth':_0x5e8ca7,'json':!![]};return rp(_0x23c761)[_0x5c6d('0xb')](function(_0x454bd2){if(_0x454bd2[_0x5c6d('0xc')][_0x5c6d('0xd')]>0x0){_0x2d5199[_0x5c6d('0x24')]=_0x454bd2[_0x5c6d('0xc')][0x0][_0x5c6d('0x1c')];logger[_0x5c6d('0xf')]('['+[_0x4da5e4[_0x5c6d('0x10')]()]+_0x5c6d('0x27'),_0x2d5199);_0x207fa8(_0x2d5199);}else{return createEndUser(_0x4da5e4,_0x5e8ca7,_0x2d5199,_0x5c02a5,_0x50a69a)['then'](function(_0x245c19){logger[_0x5c6d('0xf')]('['+[_0x4da5e4[_0x5c6d('0x10')]()]+_0x5c6d('0x28'),_0x245c19);_0x207fa8(_0x245c19);});}})['catch'](function(_0x22183b){logger[_0x5c6d('0x13')]('['+[_0x4da5e4['toUpperCase']()]+']',_0x22183b[_0x5c6d('0x14')]);_0x480cf0(_0x22183b[_0x5c6d('0x14')]);});});};}function getCustomFields(_0x4ba94a,_0x3099fb){var _0x1b7851={};if(_0x4ba94a[_0x5c6d('0xd')]>0x0){_[_0x5c6d('0x29')](_0x4ba94a,function(_0xbf27cb){if(_['includes']([_0x5c6d('0x2a'),'picklist'],_0xbf27cb[_0x5c6d('0x2b')])&&_0xbf27cb[_0x5c6d('0x2c')]&&!_0xbf27cb['customField']){_0x1b7851[_0xbf27cb[_0x5c6d('0x2c')]['toLowerCase']()]=_0xbf27cb[_0x5c6d('0x2d')][_0x5c6d('0x2e')]();}else if(_[_0x5c6d('0x2f')](['string',_0x5c6d('0x30')],_0xbf27cb['type'])&&_0xbf27cb[_0x5c6d('0x31')]&&_0xbf27cb[_0x5c6d('0x32')]){_0x1b7851[_0xbf27cb['idField'][_0x5c6d('0x33')]()]=_0xbf27cb[_0x5c6d('0x2d')]['toString']();}else if(_0xbf27cb[_0x5c6d('0x2b')]===_0x5c6d('0x34')&&_0xbf27cb[_0x5c6d('0x35')]&&_0xbf27cb[_0x5c6d('0x31')]&&_0xbf27cb[_0x5c6d('0x32')]){_0x1b7851[_0xbf27cb[_0x5c6d('0x31')][_0x5c6d('0x33')]()]=_0x3099fb[_0xbf27cb[_0x5c6d('0x35')]][_0x5c6d('0x2e')]();}else if(_0xbf27cb['type']==='customVariable'&&_0xbf27cb[_0x5c6d('0x36')]&&_0xbf27cb[_0x5c6d('0x36')][_0x5c6d('0x37')]&&_0xbf27cb[_0x5c6d('0x31')]&&_0xbf27cb[_0x5c6d('0x32')]){_0x1b7851[_0xbf27cb[_0x5c6d('0x31')][_0x5c6d('0x33')]()]=_0x3099fb[_0xbf27cb[_0x5c6d('0x36')][_0x5c6d('0x37')][_0x5c6d('0x33')]()]['toString']();}});}return _0x1b7851;}function getTicket(_0x522338,_0x5c5d52,_0x2c8302,_0x3f13ab,_0x306bed,_0x281bbd){return function(_0x26f1f5){logger[_0x5c6d('0xf')]('['+[_0x522338[_0x5c6d('0x10')]()]+_0x5c6d('0x38'),_0x26f1f5);return new Promise(function(_0x650866,_0x457ced){var _0x2353e7=_0x522338['toLowerCase']()==='outbound'?_0x26f1f5[_0x5c6d('0x1b')]:_0x26f1f5[_0x5c6d('0x24')];var _0x285001={'method':'POST','uri':_0x2c8302+_0x5c6d('0x39')+'?'+_0x281bbd,'body':Object[_0x5c6d('0x3a')]({},{'active':_0x5c6d('0x1a'),'caller_id':_0x2353e7,'assigned_to':_0x26f1f5['userId'],'short_description':intUtil[_0x5c6d('0x3b')](_0x3f13ab[_0x5c6d('0x3c')],_0x306bed,'\x20'),'description':intUtil[_0x5c6d('0x3b')](_0x3f13ab[_0x5c6d('0x3d')],_0x306bed,'\x0a')},getCustomFields(_0x3f13ab['Fields'],_0x306bed)),'auth':_0x5c5d52,'json':!![]};return rp(_0x285001)['then'](function(_0x15ab20){logger[_0x5c6d('0xf')]('['+[_0x522338[_0x5c6d('0x10')]()]+_0x5c6d('0x3e'),_0x15ab20[_0x5c6d('0xc')]);_0x26f1f5[_0x5c6d('0x3f')]=_0x15ab20[_0x5c6d('0xc')][_0x5c6d('0x1c')];_0x26f1f5[_0x5c6d('0x40')]=_0x15ab20[_0x5c6d('0xc')][_0x5c6d('0x41')];logger[_0x5c6d('0xf')]('['+[_0x522338[_0x5c6d('0x10')]()]+']\x20getTicket\x20crm',_0x26f1f5);_0x650866(_0x26f1f5);})[_0x5c6d('0x12')](function(_0x1a9487){logger[_0x5c6d('0x13')]('['+[_0x522338['toUpperCase']()]+']',_0x1a9487[_0x5c6d('0x14')]);_0x457ced(_0x1a9487[_0x5c6d('0x14')]);});});};}function createRemoteTag(_0x2cc8d0,_0xa31e2f,_0x413626,_0x19f0f4){return new Promise(function(_0x480c99,_0x2e17e8){var _0x51d1b3={'method':'POST','uri':_0x413626+'label'+'?'+_0x19f0f4,'body':{'short_description':_0x2cc8d0,'global':!![],'active':!![],'name':_0x2cc8d0},'auth':_0xa31e2f,'json':!![]};return rp(_0x51d1b3)['then'](function(_0x28516c){var _0x3a511e=_0x28516c['result'][_0x5c6d('0x1c')];_0x480c99(_0x3a511e);});});}function getRemoteTag(_0x588b9d,_0x485468,_0x543a51,_0x726366,_0x5529db){return new Promise(function(_0x407128,_0x3210e5){var _0x3eb4e7={'method':_0x5c6d('0x42'),'uri':_0x543a51+_0x5c6d('0x43')+'?sysparm_query=name%3D'+_0x588b9d+'&'+_0x726366,'auth':_0x485468,'json':!![]};return rp(_0x3eb4e7)['then'](function(_0x38b2d5){if(_0x38b2d5[_0x5c6d('0xc')]['length']>0x0){var _0x41f4dc=_0x38b2d5[_0x5c6d('0xc')][0x0][_0x5c6d('0x1c')];_0x407128(_0x41f4dc);}else{return createRemoteTag(_0x588b9d,_0x485468,_0x543a51,_0x726366)[_0x5c6d('0xb')](function(_0x59edd5){_0x407128(_0x59edd5);});}});});}function assignTagToIncident(_0xec7cdb,_0x19e16f,_0x28749f,_0x2a0336,_0x10efa5){return new Promise(function(_0x60c984,_0x1fd1c3){var _0x199ede={'method':'POST','uri':_0x28749f+_0x5c6d('0x44')+'?'+_0x10efa5,'body':{'label':_0xec7cdb,'table':_0x5c6d('0x39'),'id_type':_0x5c6d('0x45'),'table_key':_0x2a0336[_0x5c6d('0x3f')],'title':_0x5c6d('0x46')+_0x2a0336[_0x5c6d('0x40')],'id_display':_0x2a0336[_0x5c6d('0x40')]},'auth':_0x19e16f,'json':!![]};return rp(_0x199ede)[_0x5c6d('0xb')](function(_0x3beab0){_0x60c984();})[_0x5c6d('0x12')](function(){_0x60c984();});});}function manageTags(_0x1945c8,_0x562440,_0x11a674,_0x279bd1,_0x4b8a34,_0x279928,_0x937578){return new Promise(function(_0x231f9a,_0x2dcdf8){var _0x13f0f5=[];_0x562440['forEach'](function(_0x15c899){_0x13f0f5['push'](getRemoteTag(_0x15c899,_0x11a674,_0x279bd1,_0x279928,_0x937578));});return Promise[_0x5c6d('0x47')](_0x13f0f5)[_0x5c6d('0xb')](function(_0xf5a0aa){if(_0xf5a0aa['length']){logger[_0x5c6d('0xf')]('['+[_0x1945c8[_0x5c6d('0x10')]()]+_0x5c6d('0x48'),_0xf5a0aa);var _0x521d31=[];_0xf5a0aa[_0x5c6d('0x29')](function(_0x591f7f){_0x521d31[_0x5c6d('0x49')](assignTagToIncident(_0x591f7f,_0x11a674,_0x279bd1,_0x4b8a34,_0x279928));});return Promise[_0x5c6d('0x47')](_0x521d31)[_0x5c6d('0xb')](function(){_0x231f9a();})['catch'](function(){_0x231f9a();});}else{_0x231f9a();}});});}function getTags(_0x26738e,_0x1cc285,_0xf31301,_0x240d23,_0x19febb,_0x202460){return function(_0x442a53){return new Promise(function(_0x32d5af,_0x1568ce){var _0x1b8862=[];var _0x533372=_0x240d23[_0x5c6d('0x4a')];if(_0x533372&&_0x533372[_0x5c6d('0xd')]>0x0){_0x1b8862=_[_0x5c6d('0x4b')](_0x533372,_0x5c6d('0x37'));}if(_0x1b8862['length']>0x0){return manageTags(_0x26738e,_0x1b8862,_0x1cc285,_0xf31301,_0x442a53,_0x19febb,_0x202460)[_0x5c6d('0xb')](function(){_0x32d5af(_0x442a53);});}else{_0x32d5af(_0x442a53);}});};}function emit(_0x1fc6b6,_0x2f1aaa,_0x1bbb85){var _0x320676=_0x5c6d('0x4c')+_0x5c6d('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x3caa59={'uri':_0x1fc6b6+_0x5c6d('0x4e')+_0x1bbb85+_0x320676};io['to'](util['format'](_0x5c6d('0x4f'),_0x2f1aaa))[_0x5c6d('0x50')](_0x5c6d('0x51'),_0x3caa59);}exports['cs']=function(_0x435685,_0x5bebfc,_0x21d9bd,_0x5209cb,_0x587291,_0x3594b9,_0x50be94,_0x4eb48e){var _0x45f855={};var _0x17635d={'user':_0x3594b9[_0x5c6d('0x52')],'pass':_0x3594b9['password']};var _0x5e3500='sysparm_limit=1';var _0x1e32b1=_0x5c6d('0x53');_0x3594b9[_0x5c6d('0x54')]=intUtil['stripTrailingSlash'](_0x3594b9[_0x5c6d('0x54')]);_0x3594b9[_0x5c6d('0x55')]=intUtil[_0x5c6d('0x56')](_0x3594b9[_0x5c6d('0x55')]);var _0x509cc8=util['format'](_0x5c6d('0x57'),_0x3594b9[_0x5c6d('0x54')]);_0x45f855[_0x5c6d('0x16')]=!_[_0x5c6d('0x58')](_0x5209cb)?_0x5209cb['email']:null;_0x45f855[_0x5c6d('0x1d')]=_0x3594b9[_0x5c6d('0x59')];_0x45f855[_0x5c6d('0x22')]=_0x4eb48e[_0x5c6d('0x33')]()==='outbound'?_0x5bebfc[_0x5c6d('0x5a')]:_0x5bebfc[_0x5c6d('0x5b')];_0x45f855['callDirection']=_0x4eb48e===_0x5c6d('0x5c')||_0x4eb48e==='unmanaged'?_0x5c6d('0x5c'):_0x5c6d('0x5d');var _0x29503a=util[_0x5c6d('0x5e')](_0x5c6d('0x5f'),_0x3594b9[_0x5c6d('0x55')],_0x5bebfc['uniqueid'],md5(_0x5bebfc[_0x5c6d('0x60')]));if(_0x587291&&_0x587291[_0x5c6d('0x61')]){logger[_0x5c6d('0xf')](_0x5c6d('0x62'),_0x5c6d('0x63'));_0x5bebfc[_0x5c6d('0x64')]=_0x29503a;}else if(_0x50be94&&_0x50be94[_0x5c6d('0x65')]&&_0x50be94[_0x5c6d('0x65')]!==_0x5c6d('0x66')){logger['info'](_0x5c6d('0x67'),_0x5c6d('0x63'));_0x5bebfc['recordingURL']=_0x29503a;}else{_0x5bebfc[_0x5c6d('0x64')]='';}return getAdminUser(_0x4eb48e,_0x17635d,_0x45f855,_0x509cc8,_0x1e32b1,_0x5e3500)[_0x5c6d('0xb')](getUser(_0x4eb48e,_0x17635d,_0x509cc8,_0x1e32b1,_0x5e3500))[_0x5c6d('0xb')](getEndUser(_0x4eb48e,_0x17635d,_0x509cc8,_0x1e32b1,_0x5e3500))['then'](getTicket(_0x4eb48e,_0x17635d,_0x509cc8,_0x21d9bd,_0x5bebfc,_0x1e32b1))[_0x5c6d('0xb')](function(_0x302469){logger[_0x5c6d('0xf')](util[_0x5c6d('0x5e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x302469[_0x5c6d('0x3f')]));logger[_0x5c6d('0xf')](util[_0x5c6d('0x5e')](_0x5c6d('0x68'),_0x4eb48e));if(_0x4eb48e!=='unmanaged'){logger[_0x5c6d('0xf')]('['+[_0x4eb48e[_0x5c6d('0x10')]()]+']',_0x5c6d('0x69'));emit(_0x3594b9[_0x5c6d('0x54')],_0x5209cb['name'],_0x302469['ticketId']);}})[_0x5c6d('0x12')](function(_0x1d2ebf){logger[_0x5c6d('0x13')]('['+[_0x4eb48e[_0x5c6d('0x10')]()]+_0x5c6d('0x6a'),util[_0x5c6d('0x6b')](_0x1d2ebf,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf2a9=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20entity','active','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toString','includes','idField','toLowerCase','content','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%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','user:%s','emit','trigger:browser:url','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','isNil','email','destcalleridnum','callDirection','queue','unmanaged','format'];(function(_0x30e34f,_0x1cd2f8){var _0x3ca174=function(_0x4bcba8){while(--_0x4bcba8){_0x30e34f['push'](_0x30e34f['shift']());}};_0x3ca174(++_0x1cd2f8);}(_0xf2a9,0x14c));var _0x9f2a=function(_0xd9c907,_0x32ee43){_0xd9c907=_0xd9c907-0x0;var _0x546bb3=_0xf2a9[_0xd9c907];return _0x546bb3;};'use strict';var _=require(_0x9f2a('0x0'));var Promise=require(_0x9f2a('0x1'));var rp=require('request-promise');var util=require(_0x9f2a('0x2'));var md5=require(_0x9f2a('0x3'));var Redis=require('ioredis');var intUtil=require(_0x9f2a('0x4'));var config=require(_0x9f2a('0x5'));var logger=require(_0x9f2a('0x6'))(_0x9f2a('0x7'));config['redis']=_[_0x9f2a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9f2a('0x9')]));function getAdminUser(_0x4844c4,_0x27e175,_0x224cf6,_0x2c5f60,_0x4d646e,_0x111044){return new Promise(function(_0x292992,_0x2def33){var _0xeb9a66={'method':_0x9f2a('0xa'),'uri':_0x2c5f60+_0x9f2a('0xb')+'&'+_0x4d646e+'&'+_0x111044,'auth':_0x27e175,'json':!![]};return rp(_0xeb9a66)[_0x9f2a('0xc')](function(_0xb9e4){if(_0xb9e4[_0x9f2a('0xd')][_0x9f2a('0xe')]>0x0){_0x224cf6[_0x9f2a('0xf')]=_0xb9e4[_0x9f2a('0xd')][0x0][_0x9f2a('0x10')];}logger[_0x9f2a('0x11')]('['+[_0x4844c4[_0x9f2a('0x12')]()]+_0x9f2a('0x13'),_0x224cf6);_0x292992(_0x224cf6);})['catch'](function(_0x440a5a){logger[_0x9f2a('0x14')]('['+[_0x4844c4[_0x9f2a('0x12')]()]+']',_0x440a5a[_0x9f2a('0x15')]);_0x2def33(_0x440a5a[_0x9f2a('0x15')]);});});}function getUser(_0x473715,_0x986dc7,_0xcd9a22,_0x526f09,_0x5068f3){return function(_0xef0926){logger['info']('['+[_0x473715['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0xef0926);return new Promise(function(_0x291aca,_0x1285de){if(intUtil['validateEmail'](_0xef0926['userEmail'])){var _0x2ef0d7={'method':_0x9f2a('0xa'),'uri':_0xcd9a22+_0x9f2a('0x16')+_0xef0926[_0x9f2a('0x17')]+'&'+_0x526f09+'&'+_0x5068f3,'auth':_0x986dc7,'json':!![]};logger[_0x9f2a('0x11')]('['+[_0x473715[_0x9f2a('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x2ef0d7);return rp(_0x2ef0d7)[_0x9f2a('0xc')](function(_0xf152f0){logger[_0x9f2a('0x11')]('['+[_0x473715[_0x9f2a('0x12')]()]+_0x9f2a('0x18'),_0xf152f0);if(_0xf152f0[_0x9f2a('0xd')]['length']>0x0&&String(_0xf152f0[_0x9f2a('0xd')][0x0][_0x9f2a('0x19')])==='true'){_0xef0926[_0x9f2a('0x1a')]=_0xf152f0['result'][0x0][_0x9f2a('0x10')];}else{_0xef0926[_0x9f2a('0x1a')]=_0xef0926['adminId'];_0xef0926[_0x9f2a('0x17')]=_0xef0926[_0x9f2a('0x1b')];}logger[_0x9f2a('0x11')]('['+[_0x473715['toUpperCase']()]+_0x9f2a('0x1c'),_0xef0926);_0x291aca(_0xef0926);})[_0x9f2a('0x1d')](function(_0x41a8e7){logger[_0x9f2a('0x14')]('['+[_0x473715[_0x9f2a('0x12')]()]+']',_0x41a8e7[_0x9f2a('0x15')]);_0x1285de(_0x41a8e7[_0x9f2a('0x15')]);});}else{logger['info']('['+[_0x473715['toUpperCase']()]+_0x9f2a('0x1e'));_0xef0926[_0x9f2a('0x1a')]=_0xef0926[_0x9f2a('0xf')];_0xef0926['userEmail']=_0xef0926[_0x9f2a('0x1b')];_0x291aca(_0xef0926);}});};}function createEndUser(_0x10478e,_0x2d639d,_0x3436ab,_0x5c5724,_0x466b9a){logger[_0x9f2a('0x11')]('['+[_0x10478e['toUpperCase']()]+_0x9f2a('0x1f'),_0x3436ab);return new Promise(function(_0x476cb9,_0x31998f){var _0x3dc321={'method':_0x9f2a('0x20'),'uri':_0x5c5724+_0x9f2a('0x21')+_0x466b9a,'body':{'user_name':_0x3436ab[_0x9f2a('0x22')],'roles':_0x9f2a('0x23'),'first_name':_0x3436ab[_0x9f2a('0x22')],'active':_0x9f2a('0x24'),'date_format':_0x9f2a('0x25'),'phone':_0x3436ab[_0x9f2a('0x22')]},'auth':_0x2d639d,'json':!![]};return rp(_0x3dc321)[_0x9f2a('0xc')](function(_0x2a84f7){logger[_0x9f2a('0x11')]('['+[_0x10478e[_0x9f2a('0x12')]()]+_0x9f2a('0x26'),_0x2a84f7[_0x9f2a('0xd')]);_0x3436ab['endUserId']=_0x2a84f7['result'][_0x9f2a('0x10')];_0x476cb9(_0x3436ab);})['catch'](function(_0x22167b){logger[_0x9f2a('0x14')]('['+[_0x10478e[_0x9f2a('0x12')]()]+']',_0x22167b['message']);_0x31998f(_0x22167b[_0x9f2a('0x15')]);});});}function getEndUser(_0x71f28,_0x10b20c,_0x3d06f8,_0x1f02c0,_0x27aa41){return function(_0x404fe6){logger[_0x9f2a('0x11')]('['+[_0x71f28['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x404fe6);return new Promise(function(_0x9a10b9,_0x5b0d49){var _0x1652d8={'method':_0x9f2a('0xa'),'uri':_0x3d06f8+_0x9f2a('0x27')+_0x404fe6[_0x9f2a('0x22')]+'&'+_0x1f02c0+'&'+_0x27aa41,'auth':_0x10b20c,'json':!![]};return rp(_0x1652d8)[_0x9f2a('0xc')](function(_0x161fd3){if(_0x161fd3[_0x9f2a('0xd')][_0x9f2a('0xe')]>0x0){_0x404fe6[_0x9f2a('0x28')]=_0x161fd3['result'][0x0]['sys_id'];logger[_0x9f2a('0x11')]('['+[_0x71f28[_0x9f2a('0x12')]()]+_0x9f2a('0x29'),_0x404fe6);_0x9a10b9(_0x404fe6);}else{return createEndUser(_0x71f28,_0x10b20c,_0x404fe6,_0x3d06f8,_0x1f02c0)[_0x9f2a('0xc')](function(_0x28a181){logger[_0x9f2a('0x11')]('['+[_0x71f28[_0x9f2a('0x12')]()]+'],\x20createEndUser\x20crm',_0x28a181);_0x9a10b9(_0x28a181);});}})[_0x9f2a('0x1d')](function(_0x2be1ab){logger['error']('['+[_0x71f28[_0x9f2a('0x12')]()]+']',_0x2be1ab[_0x9f2a('0x15')]);_0x5b0d49(_0x2be1ab['message']);});});};}function getCustomFields(_0x5bf9dd,_0x396234){var _0x18ef4e={};if(_0x5bf9dd[_0x9f2a('0xe')]>0x0){_[_0x9f2a('0x2a')](_0x5bf9dd,function(_0x579228){if(_['includes']([_0x9f2a('0x2b'),_0x9f2a('0x2c')],_0x579228[_0x9f2a('0x2d')])&&_0x579228[_0x9f2a('0x2e')]&&!_0x579228[_0x9f2a('0x2f')]){_0x18ef4e[_0x579228['nameField']['toLowerCase']()]=_0x579228['content'][_0x9f2a('0x30')]();}else if(_[_0x9f2a('0x31')]([_0x9f2a('0x2b'),_0x9f2a('0x2c')],_0x579228['type'])&&_0x579228[_0x9f2a('0x32')]&&_0x579228[_0x9f2a('0x2f')]){_0x18ef4e[_0x579228[_0x9f2a('0x32')][_0x9f2a('0x33')]()]=_0x579228[_0x9f2a('0x34')][_0x9f2a('0x30')]();}else if(_0x579228['type']===_0x9f2a('0x35')&&_0x579228[_0x9f2a('0x36')]&&_0x579228['idField']&&_0x579228[_0x9f2a('0x2f')]){_0x18ef4e[_0x579228[_0x9f2a('0x32')][_0x9f2a('0x33')]()]=_0x396234[_0x579228[_0x9f2a('0x36')]][_0x9f2a('0x30')]();}else if(_0x579228[_0x9f2a('0x2d')]===_0x9f2a('0x37')&&_0x579228[_0x9f2a('0x38')]&&_0x579228['Variable'][_0x9f2a('0x39')]&&_0x579228[_0x9f2a('0x32')]&&_0x579228['customField']){_0x18ef4e[_0x579228['idField']['toLowerCase']()]=_0x396234[_0x579228[_0x9f2a('0x38')]['name'][_0x9f2a('0x33')]()][_0x9f2a('0x30')]();}});}return _0x18ef4e;}function getTicket(_0x35699a,_0x3c28b7,_0x222175,_0x5eb19e,_0x37f7d7,_0x4c06fc){return function(_0x4b2f66){logger[_0x9f2a('0x11')]('['+[_0x35699a['toUpperCase']()]+_0x9f2a('0x3a'),_0x4b2f66);return new Promise(function(_0x452592,_0x7a593c){var _0x305af7=_0x35699a['toLowerCase']()===_0x9f2a('0x3b')?_0x4b2f66[_0x9f2a('0x1a')]:_0x4b2f66[_0x9f2a('0x28')];var _0x383b1a={'method':_0x9f2a('0x20'),'uri':_0x222175+'incident'+'?'+_0x4c06fc,'body':Object[_0x9f2a('0x3c')]({},{'active':_0x9f2a('0x24'),'caller_id':_0x305af7,'assigned_to':_0x4b2f66[_0x9f2a('0x1a')],'short_description':intUtil[_0x9f2a('0x3d')](_0x5eb19e[_0x9f2a('0x3e')],_0x37f7d7,'\x20'),'description':intUtil[_0x9f2a('0x3d')](_0x5eb19e['Descriptions'],_0x37f7d7,'\x0a')},getCustomFields(_0x5eb19e[_0x9f2a('0x3f')],_0x37f7d7)),'auth':_0x3c28b7,'json':!![]};return rp(_0x383b1a)['then'](function(_0x5e39d6){logger[_0x9f2a('0x11')]('['+[_0x35699a[_0x9f2a('0x12')]()]+_0x9f2a('0x40'),_0x5e39d6[_0x9f2a('0xd')]);_0x4b2f66[_0x9f2a('0x41')]=_0x5e39d6['result'][_0x9f2a('0x10')];_0x4b2f66[_0x9f2a('0x42')]=_0x5e39d6['result'][_0x9f2a('0x43')];logger[_0x9f2a('0x11')]('['+[_0x35699a['toUpperCase']()]+_0x9f2a('0x44'),_0x4b2f66);_0x452592(_0x4b2f66);})[_0x9f2a('0x1d')](function(_0x4be666){logger['error']('['+[_0x35699a[_0x9f2a('0x12')]()]+']',_0x4be666['message']);_0x7a593c(_0x4be666[_0x9f2a('0x15')]);});});};}function createRemoteTag(_0x3d0ad9,_0x3dd8cf,_0x398db1,_0x3c5218){return new Promise(function(_0x3a6869,_0x108fea){var _0x376411={'method':_0x9f2a('0x20'),'uri':_0x398db1+_0x9f2a('0x45')+'?'+_0x3c5218,'body':{'short_description':_0x3d0ad9,'global':!![],'active':!![],'name':_0x3d0ad9},'auth':_0x3dd8cf,'json':!![]};return rp(_0x376411)[_0x9f2a('0xc')](function(_0x380287){var _0x2355d7=_0x380287[_0x9f2a('0xd')][_0x9f2a('0x10')];_0x3a6869(_0x2355d7);});});}function getRemoteTag(_0x53db2d,_0x19db7b,_0x5e1532,_0x45709f,_0x12792f){return new Promise(function(_0x16ca87,_0x48c007){var _0x130965={'method':_0x9f2a('0xa'),'uri':_0x5e1532+'label'+_0x9f2a('0x46')+_0x53db2d+'&'+_0x45709f,'auth':_0x19db7b,'json':!![]};return rp(_0x130965)['then'](function(_0xe7003d){if(_0xe7003d[_0x9f2a('0xd')][_0x9f2a('0xe')]>0x0){var _0x4869ac=_0xe7003d['result'][0x0][_0x9f2a('0x10')];_0x16ca87(_0x4869ac);}else{return createRemoteTag(_0x53db2d,_0x19db7b,_0x5e1532,_0x45709f)[_0x9f2a('0xc')](function(_0x6cac65){_0x16ca87(_0x6cac65);});}});});}function assignTagToIncident(_0x258296,_0x21ec96,_0x128e15,_0x69ae07,_0x5a6e48){return new Promise(function(_0x4669e5,_0x378eaf){var _0x1a3d42={'method':_0x9f2a('0x20'),'uri':_0x128e15+_0x9f2a('0x47')+'?'+_0x5a6e48,'body':{'label':_0x258296,'table':_0x9f2a('0x48'),'id_type':'Incident','table_key':_0x69ae07[_0x9f2a('0x41')],'title':'Incident\x20-\x20'+_0x69ae07[_0x9f2a('0x42')],'id_display':_0x69ae07[_0x9f2a('0x42')]},'auth':_0x21ec96,'json':!![]};return rp(_0x1a3d42)['then'](function(_0x215b07){_0x4669e5();})[_0x9f2a('0x1d')](function(){_0x4669e5();});});}function manageTags(_0x3193c1,_0x5a3e7f,_0x491701,_0x498b60,_0x328746,_0x32931a,_0x18e1ce){return new Promise(function(_0x1fbe7c,_0xefb7e){var _0xdabddf=[];_0x5a3e7f[_0x9f2a('0x2a')](function(_0x831d63){_0xdabddf[_0x9f2a('0x49')](getRemoteTag(_0x831d63,_0x491701,_0x498b60,_0x32931a,_0x18e1ce));});return Promise[_0x9f2a('0x4a')](_0xdabddf)[_0x9f2a('0xc')](function(_0x376463){if(_0x376463[_0x9f2a('0xe')]){logger[_0x9f2a('0x11')]('['+[_0x3193c1[_0x9f2a('0x12')]()]+_0x9f2a('0x4b'),_0x376463);var _0x49cfaf=[];_0x376463[_0x9f2a('0x2a')](function(_0x4952f1){_0x49cfaf[_0x9f2a('0x49')](assignTagToIncident(_0x4952f1,_0x491701,_0x498b60,_0x328746,_0x32931a));});return Promise[_0x9f2a('0x4a')](_0x49cfaf)[_0x9f2a('0xc')](function(){_0x1fbe7c();})[_0x9f2a('0x1d')](function(){_0x1fbe7c();});}else{_0x1fbe7c();}});});}function getTags(_0x32989c,_0x2a5474,_0x8f2ca5,_0x497d30,_0x32d68c,_0x52e9b1){return function(_0x360f05){return new Promise(function(_0x19bb2a,_0x3b131c){var _0x12d9ba=[];var _0x3fc554=_0x497d30['Tags'];if(_0x3fc554&&_0x3fc554[_0x9f2a('0xe')]>0x0){_0x12d9ba=_['map'](_0x3fc554,_0x9f2a('0x39'));}if(_0x12d9ba[_0x9f2a('0xe')]>0x0){return manageTags(_0x32989c,_0x12d9ba,_0x2a5474,_0x8f2ca5,_0x360f05,_0x32d68c,_0x52e9b1)['then'](function(){_0x19bb2a(_0x360f05);});}else{_0x19bb2a(_0x360f05);}});};}function emit(_0x1fa7b5,_0x337a9c,_0x5f041e){var _0x5aa052=_0x9f2a('0x4c')+_0x9f2a('0x4d')+_0x9f2a('0x4e')+_0x9f2a('0x4f');var _0x4344ca={'uri':_0x1fa7b5+_0x9f2a('0x50')+_0x5f041e+_0x5aa052};io['to'](util['format'](_0x9f2a('0x51'),_0x337a9c))[_0x9f2a('0x52')](_0x9f2a('0x53'),_0x4344ca);}exports['cs']=function(_0x125167,_0x544fc8,_0xdcaf7,_0x4cb1aa,_0x5a75b3,_0x5b91b4,_0x46543c,_0x48664c){var _0x590385={};var _0x4c7fe1={'user':_0x5b91b4['username'],'pass':_0x5b91b4[_0x9f2a('0x54')]};var _0x6129ef='sysparm_limit=1';var _0x1650c0=_0x9f2a('0x55');_0x5b91b4[_0x9f2a('0x56')]=intUtil[_0x9f2a('0x57')](_0x5b91b4[_0x9f2a('0x56')]);_0x5b91b4[_0x9f2a('0x58')]=intUtil[_0x9f2a('0x57')](_0x5b91b4['serverUrl']);var _0x4ed056=util['format']('%s/api/now/table/',_0x5b91b4[_0x9f2a('0x56')]);_0x590385[_0x9f2a('0x17')]=!_[_0x9f2a('0x59')](_0x4cb1aa)?_0x4cb1aa[_0x9f2a('0x5a')]:null;_0x590385[_0x9f2a('0x1b')]=_0x5b91b4[_0x9f2a('0x5a')];_0x590385['endUserNumber']=_0x48664c[_0x9f2a('0x33')]()===_0x9f2a('0x3b')?_0x544fc8[_0x9f2a('0x5b')]:_0x544fc8['calleridnum'];_0x590385[_0x9f2a('0x5c')]=_0x48664c===_0x9f2a('0x5d')||_0x48664c===_0x9f2a('0x5e')?_0x9f2a('0x5d'):_0x9f2a('0x3b');var _0x8f6023=util[_0x9f2a('0x5f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b91b4[_0x9f2a('0x58')],_0x544fc8[_0x9f2a('0x60')],md5(_0x544fc8[_0x9f2a('0x60')]));if(_0x5a75b3&&_0x5a75b3[_0x9f2a('0x61')]){logger['info'](_0x9f2a('0x62'),_0x9f2a('0x63'));_0x544fc8['recordingURL']=_0x8f6023;}else if(_0x46543c&&_0x46543c['recordingFormat']&&_0x46543c[_0x9f2a('0x64')]!==_0x9f2a('0x65')){logger['info'](_0x9f2a('0x66'),_0x9f2a('0x63'));_0x544fc8[_0x9f2a('0x67')]=_0x8f6023;}else{_0x544fc8[_0x9f2a('0x67')]='';}return getAdminUser(_0x48664c,_0x4c7fe1,_0x590385,_0x4ed056,_0x1650c0,_0x6129ef)[_0x9f2a('0xc')](getUser(_0x48664c,_0x4c7fe1,_0x4ed056,_0x1650c0,_0x6129ef))[_0x9f2a('0xc')](getEndUser(_0x48664c,_0x4c7fe1,_0x4ed056,_0x1650c0,_0x6129ef))[_0x9f2a('0xc')](getTicket(_0x48664c,_0x4c7fe1,_0x4ed056,_0xdcaf7,_0x544fc8,_0x1650c0))['then'](function(_0x3009b7){logger[_0x9f2a('0x11')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x3009b7[_0x9f2a('0x41')]));logger[_0x9f2a('0x11')](util['format'](_0x9f2a('0x68'),_0x48664c));if(_0x48664c!==_0x9f2a('0x5e')){logger['info']('['+[_0x48664c[_0x9f2a('0x12')]()]+']',_0x9f2a('0x69'));emit(_0x5b91b4[_0x9f2a('0x56')],_0x4cb1aa[_0x9f2a('0x39')],_0x3009b7[_0x9f2a('0x41')]);}})[_0x9f2a('0x1d')](function(_0x1bbdbe){logger[_0x9f2a('0x14')]('['+[_0x48664c[_0x9f2a('0x12')]()]+_0x9f2a('0x6a'),util['inspect'](_0x1bbdbe,{'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 50a0897..a29e5ba 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 _0xfa09=['localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','user:%s','trigger:browser:url','catch','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','users','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','toUpperCase','Inbound','lastevent','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults'];(function(_0x38a6ce,_0x149274){var _0x5d3671=function(_0x4411db){while(--_0x4411db){_0x38a6ce['push'](_0x38a6ce['shift']());}};_0x5d3671(++_0x149274);}(_0xfa09,0x166));var _0x9fa0=function(_0xb57962,_0x1eed70){_0xb57962=_0xb57962-0x0;var _0x2aacd6=_0xfa09[_0xb57962];return _0x2aacd6;};'use strict';var _=require(_0x9fa0('0x0'));var rp=require(_0x9fa0('0x1'));var BPromise=require(_0x9fa0('0x2'));var md5=require('md5');var util=require(_0x9fa0('0x3'));var Redis=require(_0x9fa0('0x4'));var intUtil=require(_0x9fa0('0x5'));var config=require(_0x9fa0('0x6'));var logger=require(_0x9fa0('0x7'))(_0x9fa0('0x8'));config[_0x9fa0('0x9')]=_[_0x9fa0('0xa')](config[_0x9fa0('0x9')],{'host':_0x9fa0('0xb'),'port':0x18eb});var io=require(_0x9fa0('0xc'))(new Redis(config[_0x9fa0('0x9')]));var def={'method':_0x9fa0('0xd'),'json':!![]};function emit(_0x469e07,_0x2c851b,_0x3864f4){io['to'](_0x469e07)[_0x9fa0('0xe')](_0x2c851b,_0x3864f4);}function getTicket(_0x2ca811,_0x57e3ff,_0x2c622b,_0x596f5b,_0x78a13,_0x56bb59,_0x21f756,_0x468148){logger[_0x9fa0('0xf')](_0x9fa0('0x10'));var _0x3783d1=new Date();var _0x118ccf=[{'name':_0x9fa0('0x11'),'value':intUtil['getString'](_0x596f5b['Subjects'],_0x78a13,'\x20')},{'name':_0x9fa0('0x12'),'value':_0x57e3ff['id']},{'name':_0x9fa0('0x13'),'value':_0x57e3ff['id']},{'name':_0x9fa0('0x14'),'value':intUtil[_0x9fa0('0x15')](_0x596f5b[_0x9fa0('0x16')],_0x78a13,'\x0a')},{'name':'date_start','value':_0x3783d1[_0x9fa0('0x17')]()[_0x9fa0('0x18')](0x0,0x13)['replace']('T','\x20')},{'name':_0x9fa0('0x19'),'value':'0'},{'name':_0x9fa0('0x1a'),'value':'15'},{'name':'parent_id','value':_0x2c622b['id']},{'name':_0x9fa0('0x1b'),'value':'Contacts'},{'name':_0x9fa0('0x1c'),'value':_0x2c622b[_0x9fa0('0x11')]},{'name':_0x9fa0('0x1d'),'value':_0x468148}];if(_0x56bb59[_0x9fa0('0x1e')]){_[_0x9fa0('0x1f')](_0x56bb59,function(_0x19aca8){if(_0x78a13[_0x19aca8[_0x9fa0('0x20')]]){_0x118ccf[_0x9fa0('0x21')]({'name':_0x19aca8[_0x9fa0('0x22')],'value':_0x78a13[_0x19aca8[_0x9fa0('0x20')]]});}});}return request({'form':{'method':_0x9fa0('0x23'),'input_type':_0x9fa0('0x24'),'response_type':_0x9fa0('0x24'),'rest_data':JSON[_0x9fa0('0x25')]({'session':_0x21f756['id'],'module_name':_0x9fa0('0x26'),'name_value_list':_0x118ccf})}});}function getAuth(_0x580855){return util[_0x9fa0('0x27')](_0x9fa0('0x28'),new Buffer(_0x580855['apiKey']+':X')[_0x9fa0('0x29')](_0x9fa0('0x2a')));}function getServerInfo(_0x4839bb){return request({'form':{'method':_0x9fa0('0x2b'),'input_type':'JSON','response_type':_0x9fa0('0x24'),'rest_data':JSON[_0x9fa0('0x25')]({'session':_0x4839bb['id']})}});}function getUser(_0x59ae41,_0x2575ea,_0x44ec31){if(!_[_0x9fa0('0x2c')](_0x2575ea)){logger['info'](_0x9fa0('0x2d'),_0x2575ea);return request({'form':{'method':'get_entry_list','input_type':_0x9fa0('0x24'),'response_type':'JSON','rest_data':JSON[_0x9fa0('0x25')]({'session':_0x44ec31['id'],'module_name':_0x9fa0('0x2e'),'query':util[_0x9fa0('0x27')](_0x9fa0('0x2f'),_0x2575ea),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9fa0('0x30')](function(_0x1038da){if(_0x1038da[_0x9fa0('0x31')]['length']){var _0x16434e=_['find'](_0x1038da['entry_list'],function(_0x453bb7){return _0x453bb7[_0x9fa0('0x32')][_0x9fa0('0x33')][_0x9fa0('0x34')]===_0x2575ea;});if(_0x16434e){logger[_0x9fa0('0xf')](_0x9fa0('0x35'));return BPromise[_0x9fa0('0x36')]({'id':_0x16434e[_0x9fa0('0x32')]['id']['value'],'name':_0x16434e['name_value_list'][_0x9fa0('0x11')][_0x9fa0('0x34')]});}}logger[_0x9fa0('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x9fa0('0x36')]({'id':_0x44ec31[_0x9fa0('0x32')][_0x9fa0('0x37')]['value'],'name':_0x44ec31[_0x9fa0('0x32')][_0x9fa0('0x33')][_0x9fa0('0x34')]});});}else{logger[_0x9fa0('0xf')](_0x9fa0('0x38'));return BPromise['resolve']({'id':_0x44ec31[_0x9fa0('0x32')][_0x9fa0('0x37')][_0x9fa0('0x34')],'name':_0x44ec31[_0x9fa0('0x32')]['user_name'][_0x9fa0('0x34')]});}}function getEndUser(_0x317609,_0x501038,_0x5c88bf,_0x15210c){logger[_0x9fa0('0xf')](_0x9fa0('0x39'),_0x5c88bf);return request({'form':{'method':_0x9fa0('0x3a'),'input_type':_0x9fa0('0x24'),'response_type':_0x9fa0('0x24'),'rest_data':JSON[_0x9fa0('0x25')]({'session':_0x15210c['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x5c88bf),'order_by':'','offset':'0','select_fields':['id',_0x9fa0('0x11'),_0x9fa0('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9fa0('0x30')](function(_0x1266b2){if(_0x1266b2[_0x9fa0('0x31')][_0x9fa0('0x1e')]){var _0xd2e263=_[_0x9fa0('0x3c')](_0x1266b2[_0x9fa0('0x31')],function(_0x2c6beb){return _0x2c6beb[_0x9fa0('0x32')]['phone_home']['value']===_0x5c88bf;});if(_0xd2e263){logger[_0x9fa0('0xf')](_0x9fa0('0x3d'));return BPromise[_0x9fa0('0x36')]({'id':_0xd2e263[_0x9fa0('0x32')]['id'][_0x9fa0('0x34')],'name':_0xd2e263[_0x9fa0('0x32')][_0x9fa0('0x11')]['value'],'phone':_0xd2e263['name_value_list'][_0x9fa0('0x3b')][_0x9fa0('0x34')]});}}else{logger['info'](_0x9fa0('0x3e'));return request({'form':{'method':_0x9fa0('0x23'),'input_type':_0x9fa0('0x24'),'response_type':_0x9fa0('0x24'),'rest_data':JSON['stringify']({'session':_0x15210c['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x501038!==''?_0x501038:util[_0x9fa0('0x27')](_0x9fa0('0x3f'),_0x5c88bf)},{'name':_0x9fa0('0x3b'),'value':_0x5c88bf}]})}})[_0x9fa0('0x30')](function(_0x3297f6){logger[_0x9fa0('0xf')](_0x9fa0('0x40'));return BPromise[_0x9fa0('0x36')]({'id':_0x3297f6['id'],'name':_0x3297f6[_0x9fa0('0x31')]['first_name']['value'],'phone':_0x3297f6[_0x9fa0('0x31')][_0x9fa0('0x3b')][_0x9fa0('0x34')]});});}});}function request(_0xe577ca){logger[_0x9fa0('0x41')](_0x9fa0('0x42'),JSON['stringify'](_0xe577ca));return rp(_[_0x9fa0('0x43')](def,_0xe577ca));}function getTags(_0xed8b87,_0x43726d){var _0x333d41=[];if(_0xed8b87&&_0xed8b87[_0x9fa0('0x1e')]>0x0){_0x333d41=_[_0x9fa0('0x44')](_0xed8b87,_0x43726d);}return _0x333d41;}function getCustomFields(_0x5e59c0,_0x25c499){var _0xafebec=[];var _0x2bbf5a={'custom_fields':[]};if(_0x5e59c0[_0x9fa0('0x1e')]>0x0){_['forEach'](_0x5e59c0,function(_0x3c550a){if(_0x3c550a[_0x9fa0('0x45')]===_0x9fa0('0x46')&&_0x3c550a[_0x9fa0('0x47')]&&!_0x3c550a[_0x9fa0('0x48')]){_0x2bbf5a[_0x3c550a[_0x9fa0('0x47')][_0x9fa0('0x49')]()]=_0x3c550a['content'][_0x9fa0('0x29')]();}else if(_0x3c550a[_0x9fa0('0x45')]===_0x9fa0('0x46')&&_0x3c550a[_0x9fa0('0x22')]&&_0x3c550a[_0x9fa0('0x48')]){_0x2bbf5a[_0x9fa0('0x4a')][_0x9fa0('0x21')]({'id':_0x3c550a[_0x9fa0('0x22')],'value':_0x3c550a[_0x9fa0('0x4b')][_0x9fa0('0x29')]()});}else if(_0x3c550a[_0x9fa0('0x45')]===_0x9fa0('0x4c')&&_0x3c550a['variableName']&&_0x3c550a['idField']&&_0x3c550a[_0x9fa0('0x48')]){_0x25c499[_0x3c550a[_0x9fa0('0x20')]]&&_0x2bbf5a['custom_fields'][_0x9fa0('0x21')]({'id':_0x3c550a[_0x9fa0('0x22')],'value':_0x25c499[_0x3c550a[_0x9fa0('0x20')]][_0x9fa0('0x29')]()});}else if(_0x3c550a[_0x9fa0('0x45')]===_0x9fa0('0x4d')&&_0x3c550a[_0x9fa0('0x4e')]&&_0x3c550a['Variable'][_0x9fa0('0x11')]&&_0x3c550a[_0x9fa0('0x22')]&&_0x3c550a[_0x9fa0('0x48')]){_0x25c499[_0x3c550a[_0x9fa0('0x4e')][_0x9fa0('0x11')][_0x9fa0('0x49')]()]&&_0x2bbf5a[_0x9fa0('0x4a')][_0x9fa0('0x21')]({'id':_0x3c550a[_0x9fa0('0x22')],'value':_0x25c499[_0x3c550a[_0x9fa0('0x4e')]['name'][_0x9fa0('0x49')]()][_0x9fa0('0x29')]()});}});}return _0x2bbf5a;}function getConnection(_0x2ffaca){return request({'method':_0x9fa0('0xd'),'form':{'method':_0x9fa0('0x4f'),'input_type':_0x9fa0('0x24'),'response_type':_0x9fa0('0x24'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2ffaca[_0x9fa0('0x50')],'password':_0x2ffaca[_0x9fa0('0x51')],'encryption':_0x9fa0('0x52')},'application':_0x9fa0('0x53')})}})[_0x9fa0('0x30')](function(_0x4c5697){var _0x1bddb4=_0x4c5697;if(_0x1bddb4['id']){def['sessionID']=_0x1bddb4['id'];return BPromise[_0x9fa0('0x36')](_0x1bddb4);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x2ffaca['id']));}});}function setRelationship(_0x572ec7,_0x3b3b8c,_0x3ebed7,_0x129694){return request({'form':{'method':'set_relationship','input_type':_0x9fa0('0x24'),'response_type':'JSON','rest_data':JSON[_0x9fa0('0x25')]({'session':_0x572ec7['id'],'module_name':'Calls','module_id':_0x3ebed7['id'],'link_field_name':_0x129694,'related_ids':[_0x3b3b8c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9fa0('0x54')]=function(_0x332fb2,_0x3ac090,_0x1e4145,_0x2264d2,_0x381247,_0x3b6ed9){var _0x64f924,_0x3a0f8a,_0x5269ac,_0x20391c;_0x3b6ed9[_0x9fa0('0x55')]=intUtil[_0x9fa0('0x56')](_0x3b6ed9[_0x9fa0('0x55')]);_0x3b6ed9['serverUrl']=intUtil[_0x9fa0('0x56')](_0x3b6ed9[_0x9fa0('0x57')]);def[_0x9fa0('0x58')]=util[_0x9fa0('0x27')](_0x9fa0('0x59'),_0x3b6ed9[_0x9fa0('0x55')]);if(_0x381247&&_0x381247[_0x9fa0('0x5a')]){logger[_0x9fa0('0xf')]('[QUEUE]',_0x9fa0('0x5b'));_0x3ac090[_0x9fa0('0x5c')]=util[_0x9fa0('0x27')](_0x9fa0('0x5d'),_0x3b6ed9[_0x9fa0('0x57')],_0x3ac090[_0x9fa0('0x5e')],md5(_0x3ac090[_0x9fa0('0x5e')]));}else{_0x3ac090[_0x9fa0('0x5c')]='';}return getConnection(_0x3b6ed9)[_0x9fa0('0x30')](function(_0x41f647){_0x20391c=_0x41f647;return getUser(_0x3b6ed9,_0x2264d2[_0x9fa0('0x11')],_0x20391c);})[_0x9fa0('0x30')](function(_0x3ff0fa){_0x64f924=_0x3ff0fa;logger['info'](_0x9fa0('0x5f'),_0x64f924['id']);return getEndUser(_0x3b6ed9,_0x3ac090[_0x9fa0('0x60')],_0x3ac090[_0x9fa0('0x61')],_0x20391c);})['then'](function(_0x40e8e5){_0x3a0f8a=_0x40e8e5;logger[_0x9fa0('0xf')](_0x9fa0('0x62'),_0x3a0f8a['id']);return getTicket(_0x3b6ed9,_0x64f924,_0x3a0f8a,_0x1e4145,_0x3ac090,_0x1e4145[_0x9fa0('0x63')],_0x20391c,'Inbound');})[_0x9fa0('0x30')](function(_0x28c1f4){_0x5269ac=_0x28c1f4;logger[_0x9fa0('0xf')](_0x9fa0('0x64'));logger[_0x9fa0('0xf')](_0x9fa0('0x65'),_0x5269ac['id']);return setRelationship(_0x20391c,_0x64f924,_0x5269ac,'users');})[_0x9fa0('0x30')](function(){return setRelationship(_0x20391c,_0x3a0f8a,_0x5269ac,_0x9fa0('0x66'));})[_0x9fa0('0x30')](function(){return getServerInfo(_0x20391c);})[_0x9fa0('0x30')](function(_0x4057dc){var _0x5066a9=parseInt(_0x4057dc['version'][_0x9fa0('0x67')](0x0));var _0x47fc77=util[_0x9fa0('0x27')](_0x9fa0('0x68'),_0x3b6ed9[_0x9fa0('0x55')],_0x5269ac['id']);if(_0x5066a9>0x6){_0x47fc77=util[_0x9fa0('0x27')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3b6ed9['remoteUri'],_0x5269ac['id']);}logger[_0x9fa0('0xf')](_0x9fa0('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9fa0('0x27')](_0x9fa0('0x6a'),_0x2264d2[_0x9fa0('0x11')]),_0x9fa0('0x6b'),{'uri':_0x47fc77});})[_0x9fa0('0x6c')](function(_0x22445d){logger['error']('[QUEUE]',JSON['stringify'](_0x22445d));});};exports['outbound']=function(_0x141e57,_0x42485c,_0xb4379a,_0x52dce8,_0x2cdf72,_0xf85003,_0x5dd94a){var _0x4e50ca,_0x315739,_0x4dc845,_0x29d4b3;_0xf85003[_0x9fa0('0x55')]=intUtil[_0x9fa0('0x56')](_0xf85003[_0x9fa0('0x55')]);_0xf85003['serverUrl']=intUtil[_0x9fa0('0x56')](_0xf85003['serverUrl']);def['uri']=util['format'](_0x9fa0('0x59'),_0xf85003[_0x9fa0('0x55')]);if(_0x5dd94a&&_0x5dd94a[_0x9fa0('0x6d')]&&_0x5dd94a[_0x9fa0('0x6d')]!==_0x9fa0('0x6e')){logger[_0x9fa0('0xf')]('[OUTBOUND]',_0x9fa0('0x5b'));_0x42485c[_0x9fa0('0x5c')]=util[_0x9fa0('0x27')](_0x9fa0('0x5d'),_0xf85003[_0x9fa0('0x57')],_0x42485c['uniqueid'],md5(_0x42485c[_0x9fa0('0x5e')]));}return getConnection(_0xf85003)[_0x9fa0('0x30')](function(_0x5c5d3b){_0x29d4b3=_0x5c5d3b;return getUser(_0xf85003,_0x52dce8[_0x9fa0('0x11')],_0x29d4b3);})[_0x9fa0('0x30')](function(_0x5620f3){_0x4e50ca=_0x5620f3;logger[_0x9fa0('0xf')](_0x9fa0('0x5f'),_0x4e50ca['id']);return getEndUser(_0xf85003,_0x42485c[_0x9fa0('0x6f')],_0x42485c[_0x9fa0('0x70')],_0x29d4b3);})[_0x9fa0('0x30')](function(_0x369c40){_0x315739=_0x369c40;logger['info'](_0x9fa0('0x62'),_0x315739['id']);return getTicket(_0xf85003,_0x4e50ca,_0x315739,_0xb4379a,_0x42485c,_0xb4379a[_0x9fa0('0x63')],_0x29d4b3,_0x9fa0('0x71'));})[_0x9fa0('0x30')](function(_0x1afbe1){_0x4dc845=_0x1afbe1;logger[_0x9fa0('0xf')](_0x9fa0('0x64'));logger[_0x9fa0('0xf')](_0x9fa0('0x65'),_0x4dc845['id']);return setRelationship(_0x29d4b3,_0x4e50ca,_0x4dc845,_0x9fa0('0x72'));})['then'](function(){return setRelationship(_0x29d4b3,_0x315739,_0x4dc845,_0x9fa0('0x66'));})[_0x9fa0('0x30')](function(){return getServerInfo(_0x29d4b3);})['then'](function(_0xd9a03f){var _0x194e01=parseInt(_0xd9a03f[_0x9fa0('0x73')][_0x9fa0('0x67')](0x0));var _0x491108=util[_0x9fa0('0x27')](_0x9fa0('0x68'),_0xf85003[_0x9fa0('0x55')],_0x4dc845['id']);if(_0x194e01>0x6){_0x491108=util['format'](_0x9fa0('0x74'),_0xf85003[_0x9fa0('0x55')],_0x4dc845['id']);}logger[_0x9fa0('0xf')](_0x9fa0('0x75'),_0x9fa0('0x76'));emit(util['format'](_0x9fa0('0x6a'),_0x52dce8[_0x9fa0('0x11')]),_0x9fa0('0x6b'),{'uri':_0x491108});})['catch'](function(_0x84e5c7){logger[_0x9fa0('0x77')](_0x9fa0('0x75'),JSON[_0x9fa0('0x25')](_0x84e5c7));});};exports['unmanaged']=function(_0x8ce384,_0x53401f,_0x22d1d4,_0x5c1611,_0x206863,_0x28b080){var _0x3298d8,_0x124c73,_0x54a531,_0x51e487;_0x28b080[_0x9fa0('0x55')]=intUtil[_0x9fa0('0x56')](_0x28b080['remoteUri']);_0x28b080['serverUrl']=intUtil[_0x9fa0('0x56')](_0x28b080[_0x9fa0('0x57')]);def['uri']=util['format'](_0x9fa0('0x59'),_0x28b080[_0x9fa0('0x55')]);if(_0x206863&&_0x206863['monitor_format']){logger[_0x9fa0('0xf')]('['+_0x53401f['lastevent'][_0x9fa0('0x78')]()+']','Recording\x20is\x20enabled!');_0x53401f[_0x9fa0('0x5c')]=util[_0x9fa0('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28b080['serverUrl'],_0x53401f['uniqueid'],md5(_0x53401f[_0x9fa0('0x5e')]));}else{_0x53401f[_0x9fa0('0x5c')]='';}return getConnection(_0x28b080)['then'](function(_0x3220dc){_0x51e487=_0x3220dc;if(!_[_0x9fa0('0x2c')](_0x5c1611)){return getUser(_0x28b080,_0x5c1611[_0x9fa0('0x11')],_0x51e487);}else{return getUser(_0x28b080,null,_0x51e487);}})[_0x9fa0('0x30')](function(_0x424e54){_0x3298d8=_0x424e54;logger[_0x9fa0('0xf')]('The\x20User\x20ID\x20is:',_0x3298d8['id']);return getEndUser(_0x28b080,_0x53401f[_0x9fa0('0x60')],_0x53401f[_0x9fa0('0x61')],_0x51e487);})['then'](function(_0x51dc0d){_0x124c73=_0x51dc0d;logger['info']('The\x20Enduser\x20ID\x20is:',_0x124c73['id']);return getTicket(_0x28b080,_0x3298d8,_0x124c73,_0x22d1d4,_0x53401f,_0x22d1d4[_0x9fa0('0x63')],_0x51e487,_0x9fa0('0x79'));})[_0x9fa0('0x30')](function(_0x11c134){_0x54a531=_0x11c134;logger['info'](_0x9fa0('0x64'));logger[_0x9fa0('0xf')](_0x9fa0('0x65'),_0x54a531['id']);return setRelationship(_0x51e487,_0x3298d8,_0x54a531,_0x9fa0('0x72'));})[_0x9fa0('0x30')](function(){return setRelationship(_0x51e487,_0x124c73,_0x54a531,_0x9fa0('0x66'));})['then'](function(){return getServerInfo(_0x51e487);})['catch'](function(_0x1a25c4){logger[_0x9fa0('0x77')]('['+_0x53401f[_0x9fa0('0x7a')][_0x9fa0('0x78')]()+']',JSON['stringify'](_0x1a25c4));});}; \ No newline at end of file +var _0xaa1a=['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...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','unmanaged','lastevent','toUpperCase','calleridnum','lodash','bluebird','md5','util','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','Descriptions','toISOString','replace','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','apiKey','base64','get_server_info','isNil','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','debug','[HTTP]','merge','map','type','nameField','customField','toString','custom_fields','content','variable','customVariable','Variable','toLowerCase','POST','login','PLAIN','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','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts'];(function(_0x113945,_0x102a24){var _0x5836c8=function(_0x5430a8){while(--_0x5430a8){_0x113945['push'](_0x113945['shift']());}};_0x5836c8(++_0x102a24);}(_0xaa1a,0x103));var _0xaaa1=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0xaa1a[_0xc82d1a];return _0x32fad2;};'use strict';var _=require(_0xaaa1('0x0'));var rp=require('request-promise');var BPromise=require(_0xaaa1('0x1'));var md5=require(_0xaaa1('0x2'));var util=require(_0xaaa1('0x3'));var Redis=require('ioredis');var intUtil=require(_0xaaa1('0x4'));var config=require('../../../../config/environment');var logger=require(_0xaaa1('0x5'))(_0xaaa1('0x6'));config['redis']=_[_0xaaa1('0x7')](config[_0xaaa1('0x8')],{'host':_0xaaa1('0x9'),'port':0x18eb});var io=require(_0xaaa1('0xa'))(new Redis(config[_0xaaa1('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x1bd237,_0x34fa46,_0x1b237f){io['to'](_0x1bd237)[_0xaaa1('0xb')](_0x34fa46,_0x1b237f);}function getTicket(_0x149878,_0x23da20,_0x447efc,_0x5bb2e1,_0x572d1b,_0x10e446,_0x289663,_0x34310d){logger[_0xaaa1('0xc')](_0xaaa1('0xd'));var _0x392016=new Date();var _0x228795=[{'name':_0xaaa1('0xe'),'value':intUtil[_0xaaa1('0xf')](_0x5bb2e1['Subjects'],_0x572d1b,'\x20')},{'name':_0xaaa1('0x10'),'value':_0x23da20['id']},{'name':_0xaaa1('0x11'),'value':_0x23da20['id']},{'name':'description','value':intUtil['getString'](_0x5bb2e1[_0xaaa1('0x12')],_0x572d1b,'\x0a')},{'name':'date_start','value':_0x392016[_0xaaa1('0x13')]()['slice'](0x0,0x13)[_0xaaa1('0x14')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xaaa1('0x15'),'value':'15'},{'name':_0xaaa1('0x16'),'value':_0x447efc['id']},{'name':_0xaaa1('0x17'),'value':'Contacts'},{'name':_0xaaa1('0x18'),'value':_0x447efc['name']},{'name':_0xaaa1('0x19'),'value':_0x34310d}];if(_0x10e446[_0xaaa1('0x1a')]){_[_0xaaa1('0x1b')](_0x10e446,function(_0x3e8ef6){if(_0x572d1b[_0x3e8ef6[_0xaaa1('0x1c')]]){_0x228795[_0xaaa1('0x1d')]({'name':_0x3e8ef6[_0xaaa1('0x1e')],'value':_0x572d1b[_0x3e8ef6[_0xaaa1('0x1c')]]});}});}return request({'form':{'method':_0xaaa1('0x1f'),'input_type':_0xaaa1('0x20'),'response_type':_0xaaa1('0x20'),'rest_data':JSON[_0xaaa1('0x21')]({'session':_0x289663['id'],'module_name':_0xaaa1('0x22'),'name_value_list':_0x228795})}});}function getAuth(_0x3e3c69){return util['format'](_0xaaa1('0x23'),new Buffer(_0x3e3c69[_0xaaa1('0x24')]+':X')['toString'](_0xaaa1('0x25')));}function getServerInfo(_0x5cae7d){return request({'form':{'method':_0xaaa1('0x26'),'input_type':_0xaaa1('0x20'),'response_type':_0xaaa1('0x20'),'rest_data':JSON['stringify']({'session':_0x5cae7d['id']})}});}function getUser(_0x37745f,_0x46995e,_0x2c4073){if(!_[_0xaaa1('0x27')](_0x46995e)){logger[_0xaaa1('0xc')]('Getting\x20agent\x20with\x20name',_0x46995e);return request({'form':{'method':'get_entry_list','input_type':_0xaaa1('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2c4073['id'],'module_name':_0xaaa1('0x28'),'query':util[_0xaaa1('0x29')](_0xaaa1('0x2a'),_0x46995e),'order_by':'','offset':'0','select_fields':['id',_0xaaa1('0xe'),_0xaaa1('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaaa1('0x2c')](function(_0x45eebe){if(_0x45eebe[_0xaaa1('0x2d')][_0xaaa1('0x1a')]){var _0x105fba=_[_0xaaa1('0x2e')](_0x45eebe['entry_list'],function(_0x2227d4){return _0x2227d4[_0xaaa1('0x2f')]['user_name']['value']===_0x46995e;});if(_0x105fba){logger[_0xaaa1('0xc')](_0xaaa1('0x30'));return BPromise[_0xaaa1('0x31')]({'id':_0x105fba[_0xaaa1('0x2f')]['id'][_0xaaa1('0x32')],'name':_0x105fba[_0xaaa1('0x2f')][_0xaaa1('0xe')][_0xaaa1('0x32')]});}}logger[_0xaaa1('0xc')](_0xaaa1('0x33'));return BPromise[_0xaaa1('0x31')]({'id':_0x2c4073[_0xaaa1('0x2f')][_0xaaa1('0x34')][_0xaaa1('0x32')],'name':_0x2c4073[_0xaaa1('0x2f')][_0xaaa1('0x2b')]['value']});});}else{logger[_0xaaa1('0xc')](_0xaaa1('0x35'));return BPromise[_0xaaa1('0x31')]({'id':_0x2c4073[_0xaaa1('0x2f')][_0xaaa1('0x34')]['value'],'name':_0x2c4073[_0xaaa1('0x2f')][_0xaaa1('0x2b')][_0xaaa1('0x32')]});}}function getEndUser(_0x3d46b9,_0x32009d,_0x177df1,_0x311e3a){logger[_0xaaa1('0xc')](_0xaaa1('0x36'),_0x177df1);return request({'form':{'method':_0xaaa1('0x37'),'input_type':_0xaaa1('0x20'),'response_type':_0xaaa1('0x20'),'rest_data':JSON[_0xaaa1('0x21')]({'session':_0x311e3a['id'],'module_name':_0xaaa1('0x38'),'query':util[_0xaaa1('0x29')](_0xaaa1('0x39'),_0x177df1),'order_by':'','offset':'0','select_fields':['id','name',_0xaaa1('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x29e9e4){if(_0x29e9e4[_0xaaa1('0x2d')][_0xaaa1('0x1a')]){var _0x4bcbd0=_[_0xaaa1('0x2e')](_0x29e9e4['entry_list'],function(_0x29f2fd){return _0x29f2fd['name_value_list'][_0xaaa1('0x3a')][_0xaaa1('0x32')]===_0x177df1;});if(_0x4bcbd0){logger[_0xaaa1('0xc')](_0xaaa1('0x3b'));return BPromise['resolve']({'id':_0x4bcbd0[_0xaaa1('0x2f')]['id']['value'],'name':_0x4bcbd0[_0xaaa1('0x2f')]['name'][_0xaaa1('0x32')],'phone':_0x4bcbd0[_0xaaa1('0x2f')][_0xaaa1('0x3a')]['value']});}}else{logger[_0xaaa1('0xc')](_0xaaa1('0x3c'));return request({'form':{'method':_0xaaa1('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x311e3a['id'],'module_name':'Contacts','name_value_list':[{'name':_0xaaa1('0x3d'),'value':_0x32009d!==_0xaaa1('0x3e')?_0x32009d:util['format']('Caller\x20-\x20%s',_0x177df1)},{'name':'phone_home','value':_0x177df1}]})}})[_0xaaa1('0x2c')](function(_0x44da18){logger[_0xaaa1('0xc')]('Enduser\x20created.');return BPromise[_0xaaa1('0x31')]({'id':_0x44da18['id'],'name':_0x44da18[_0xaaa1('0x2d')][_0xaaa1('0x3d')][_0xaaa1('0x32')],'phone':_0x44da18[_0xaaa1('0x2d')][_0xaaa1('0x3a')][_0xaaa1('0x32')]});});}});}function request(_0x3c64d7){logger[_0xaaa1('0x3f')](_0xaaa1('0x40'),JSON[_0xaaa1('0x21')](_0x3c64d7));return rp(_[_0xaaa1('0x41')](def,_0x3c64d7));}function getTags(_0x4374e7,_0xed59f){var _0x267d4d=[];if(_0x4374e7&&_0x4374e7[_0xaaa1('0x1a')]>0x0){_0x267d4d=_[_0xaaa1('0x42')](_0x4374e7,_0xed59f);}return _0x267d4d;}function getCustomFields(_0x3b4351,_0x51c0b6){var _0x5e427e=[];var _0x478aec={'custom_fields':[]};if(_0x3b4351[_0xaaa1('0x1a')]>0x0){_[_0xaaa1('0x1b')](_0x3b4351,function(_0xb09f9a){if(_0xb09f9a[_0xaaa1('0x43')]==='string'&&_0xb09f9a[_0xaaa1('0x44')]&&!_0xb09f9a[_0xaaa1('0x45')]){_0x478aec[_0xb09f9a[_0xaaa1('0x44')]['toLowerCase']()]=_0xb09f9a['content'][_0xaaa1('0x46')]();}else if(_0xb09f9a[_0xaaa1('0x43')]==='string'&&_0xb09f9a[_0xaaa1('0x1e')]&&_0xb09f9a[_0xaaa1('0x45')]){_0x478aec[_0xaaa1('0x47')][_0xaaa1('0x1d')]({'id':_0xb09f9a['idField'],'value':_0xb09f9a[_0xaaa1('0x48')][_0xaaa1('0x46')]()});}else if(_0xb09f9a[_0xaaa1('0x43')]===_0xaaa1('0x49')&&_0xb09f9a['variableName']&&_0xb09f9a[_0xaaa1('0x1e')]&&_0xb09f9a[_0xaaa1('0x45')]){_0x51c0b6[_0xb09f9a[_0xaaa1('0x1c')]]&&_0x478aec[_0xaaa1('0x47')][_0xaaa1('0x1d')]({'id':_0xb09f9a[_0xaaa1('0x1e')],'value':_0x51c0b6[_0xb09f9a[_0xaaa1('0x1c')]][_0xaaa1('0x46')]()});}else if(_0xb09f9a['type']===_0xaaa1('0x4a')&&_0xb09f9a['Variable']&&_0xb09f9a[_0xaaa1('0x4b')][_0xaaa1('0xe')]&&_0xb09f9a[_0xaaa1('0x1e')]&&_0xb09f9a[_0xaaa1('0x45')]){_0x51c0b6[_0xb09f9a[_0xaaa1('0x4b')]['name'][_0xaaa1('0x4c')]()]&&_0x478aec[_0xaaa1('0x47')][_0xaaa1('0x1d')]({'id':_0xb09f9a[_0xaaa1('0x1e')],'value':_0x51c0b6[_0xb09f9a['Variable']['name'][_0xaaa1('0x4c')]()]['toString']()});}});}return _0x478aec;}function getConnection(_0x26a616){return request({'method':_0xaaa1('0x4d'),'form':{'method':_0xaaa1('0x4e'),'input_type':_0xaaa1('0x20'),'response_type':'JSON','rest_data':JSON[_0xaaa1('0x21')]({'user_auth':{'user_name':_0x26a616['username'],'password':_0x26a616['password'],'encryption':_0xaaa1('0x4f')},'application':_0xaaa1('0x50')})}})[_0xaaa1('0x2c')](function(_0x4d94ea){var _0x146435=_0x4d94ea;if(_0x146435['id']){def[_0xaaa1('0x51')]=_0x146435['id'];return BPromise['resolve'](_0x146435);}else{throw new Error(util[_0xaaa1('0x29')](_0xaaa1('0x52'),_0x26a616['id']));}});}function setRelationship(_0x1fa358,_0x4382ed,_0x2055b4,_0x51205f){return request({'form':{'method':_0xaaa1('0x53'),'input_type':_0xaaa1('0x20'),'response_type':_0xaaa1('0x20'),'rest_data':JSON[_0xaaa1('0x21')]({'session':_0x1fa358['id'],'module_name':_0xaaa1('0x22'),'module_id':_0x2055b4['id'],'link_field_name':_0x51205f,'related_ids':[_0x4382ed['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xaaa1('0x54')]=function(_0x49eb7b,_0x2dc36e,_0x11262b,_0x154960,_0x26d735,_0x361bb2){var _0x5b1788,_0x372314,_0x525f3c,_0x328908;_0x361bb2['remoteUri']=intUtil[_0xaaa1('0x55')](_0x361bb2[_0xaaa1('0x56')]);_0x361bb2[_0xaaa1('0x57')]=intUtil[_0xaaa1('0x55')](_0x361bb2[_0xaaa1('0x57')]);def[_0xaaa1('0x58')]=util['format'](_0xaaa1('0x59'),_0x361bb2[_0xaaa1('0x56')]);if(_0x26d735&&_0x26d735[_0xaaa1('0x5a')]){logger['info'](_0xaaa1('0x5b'),_0xaaa1('0x5c'));_0x2dc36e[_0xaaa1('0x5d')]=util[_0xaaa1('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x361bb2[_0xaaa1('0x57')],_0x2dc36e[_0xaaa1('0x5e')],md5(_0x2dc36e[_0xaaa1('0x5e')]));}else{_0x2dc36e[_0xaaa1('0x5d')]='';}return getConnection(_0x361bb2)['then'](function(_0x426987){_0x328908=_0x426987;return getUser(_0x361bb2,_0x154960['name'],_0x328908);})[_0xaaa1('0x2c')](function(_0xe4f7b9){_0x5b1788=_0xe4f7b9;logger[_0xaaa1('0xc')](_0xaaa1('0x5f'),_0x5b1788['id']);return getEndUser(_0x361bb2,_0x2dc36e[_0xaaa1('0x60')],_0x2dc36e['calleridnum'],_0x328908);})[_0xaaa1('0x2c')](function(_0x5e37f5){_0x372314=_0x5e37f5;logger[_0xaaa1('0xc')](_0xaaa1('0x61'),_0x372314['id']);return getTicket(_0x361bb2,_0x5b1788,_0x372314,_0x11262b,_0x2dc36e,_0x11262b[_0xaaa1('0x62')],_0x328908,_0xaaa1('0x63'));})['then'](function(_0xf0bdbe){_0x525f3c=_0xf0bdbe;logger['info'](_0xaaa1('0x64'));logger['info'](_0xaaa1('0x65'),_0x525f3c['id']);return setRelationship(_0x328908,_0x5b1788,_0x525f3c,_0xaaa1('0x66'));})[_0xaaa1('0x2c')](function(){return setRelationship(_0x328908,_0x372314,_0x525f3c,_0xaaa1('0x67'));})['then'](function(){return getServerInfo(_0x328908);})['then'](function(_0x455956){var _0x18f6ca=parseInt(_0x455956[_0xaaa1('0x68')][_0xaaa1('0x69')](0x0));var _0x2a1146=util[_0xaaa1('0x29')](_0xaaa1('0x6a'),_0x361bb2[_0xaaa1('0x56')],_0x525f3c['id']);if(_0x18f6ca>0x6){_0x2a1146=util[_0xaaa1('0x29')](_0xaaa1('0x6b'),_0x361bb2[_0xaaa1('0x56')],_0x525f3c['id']);}logger['info'](_0xaaa1('0x5b'),_0xaaa1('0x6c'));emit(util['format'](_0xaaa1('0x6d'),_0x154960['name']),_0xaaa1('0x6e'),{'uri':_0x2a1146});})[_0xaaa1('0x6f')](function(_0x28b871){logger[_0xaaa1('0x70')](_0xaaa1('0x5b'),JSON[_0xaaa1('0x21')](_0x28b871));});};exports[_0xaaa1('0x71')]=function(_0x2e6ab0,_0x325e70,_0x426a43,_0x3f2844,_0x5c014c,_0x1571db,_0x19439c){var _0x2e26b0,_0x28edac,_0x55ef8a,_0x41377e;_0x1571db[_0xaaa1('0x56')]=intUtil[_0xaaa1('0x55')](_0x1571db[_0xaaa1('0x56')]);_0x1571db[_0xaaa1('0x57')]=intUtil[_0xaaa1('0x55')](_0x1571db[_0xaaa1('0x57')]);def[_0xaaa1('0x58')]=util['format'](_0xaaa1('0x59'),_0x1571db[_0xaaa1('0x56')]);if(_0x19439c&&_0x19439c[_0xaaa1('0x72')]&&_0x19439c[_0xaaa1('0x72')]!=='none'){logger[_0xaaa1('0xc')](_0xaaa1('0x73'),_0xaaa1('0x5c'));_0x325e70[_0xaaa1('0x5d')]=util[_0xaaa1('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1571db[_0xaaa1('0x57')],_0x325e70['uniqueid'],md5(_0x325e70['uniqueid']));}return getConnection(_0x1571db)['then'](function(_0x1d3227){_0x41377e=_0x1d3227;return getUser(_0x1571db,_0x3f2844[_0xaaa1('0xe')],_0x41377e);})['then'](function(_0x3b0336){_0x2e26b0=_0x3b0336;logger[_0xaaa1('0xc')](_0xaaa1('0x5f'),_0x2e26b0['id']);return getEndUser(_0x1571db,_0x325e70[_0xaaa1('0x74')],_0x325e70['destcalleridnum'],_0x41377e);})[_0xaaa1('0x2c')](function(_0x1c717d){_0x28edac=_0x1c717d;logger[_0xaaa1('0xc')]('The\x20Enduser\x20ID\x20is:',_0x28edac['id']);return getTicket(_0x1571db,_0x2e26b0,_0x28edac,_0x426a43,_0x325e70,_0x426a43[_0xaaa1('0x62')],_0x41377e,'Outbound');})[_0xaaa1('0x2c')](function(_0x3c8204){_0x55ef8a=_0x3c8204;logger['info'](_0xaaa1('0x64'));logger[_0xaaa1('0xc')]('The\x20Ticket\x20ID\x20is:',_0x55ef8a['id']);return setRelationship(_0x41377e,_0x2e26b0,_0x55ef8a,_0xaaa1('0x66'));})[_0xaaa1('0x2c')](function(){return setRelationship(_0x41377e,_0x28edac,_0x55ef8a,_0xaaa1('0x67'));})['then'](function(){return getServerInfo(_0x41377e);})[_0xaaa1('0x2c')](function(_0x54b3b9){var _0x64de80=parseInt(_0x54b3b9[_0xaaa1('0x68')][_0xaaa1('0x69')](0x0));var _0x4ea3c0=util[_0xaaa1('0x29')](_0xaaa1('0x6a'),_0x1571db[_0xaaa1('0x56')],_0x55ef8a['id']);if(_0x64de80>0x6){_0x4ea3c0=util[_0xaaa1('0x29')](_0xaaa1('0x6b'),_0x1571db[_0xaaa1('0x56')],_0x55ef8a['id']);}logger[_0xaaa1('0xc')](_0xaaa1('0x73'),_0xaaa1('0x6c'));emit(util[_0xaaa1('0x29')](_0xaaa1('0x6d'),_0x3f2844[_0xaaa1('0xe')]),_0xaaa1('0x6e'),{'uri':_0x4ea3c0});})['catch'](function(_0x5128d5){logger['error'](_0xaaa1('0x73'),JSON[_0xaaa1('0x21')](_0x5128d5));});};exports[_0xaaa1('0x75')]=function(_0x186af2,_0x594ae1,_0xea8720,_0x465be6,_0x117602,_0x4d4b29){var _0x30824c,_0x1fc849,_0x4de3be,_0x4114d0;_0x4d4b29[_0xaaa1('0x56')]=intUtil[_0xaaa1('0x55')](_0x4d4b29['remoteUri']);_0x4d4b29[_0xaaa1('0x57')]=intUtil['stripTrailingSlash'](_0x4d4b29['serverUrl']);def[_0xaaa1('0x58')]=util['format'](_0xaaa1('0x59'),_0x4d4b29[_0xaaa1('0x56')]);if(_0x117602&&_0x117602[_0xaaa1('0x5a')]){logger[_0xaaa1('0xc')]('['+_0x594ae1[_0xaaa1('0x76')][_0xaaa1('0x77')]()+']','Recording\x20is\x20enabled!');_0x594ae1[_0xaaa1('0x5d')]=util[_0xaaa1('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d4b29[_0xaaa1('0x57')],_0x594ae1['uniqueid'],md5(_0x594ae1[_0xaaa1('0x5e')]));}else{_0x594ae1[_0xaaa1('0x5d')]='';}return getConnection(_0x4d4b29)['then'](function(_0x396789){_0x4114d0=_0x396789;if(!_['isNil'](_0x465be6)){return getUser(_0x4d4b29,_0x465be6['name'],_0x4114d0);}else{return getUser(_0x4d4b29,null,_0x4114d0);}})['then'](function(_0x324fd2){_0x30824c=_0x324fd2;logger['info'](_0xaaa1('0x5f'),_0x30824c['id']);return getEndUser(_0x4d4b29,_0x594ae1[_0xaaa1('0x60')],_0x594ae1[_0xaaa1('0x78')],_0x4114d0);})[_0xaaa1('0x2c')](function(_0xcadc37){_0x1fc849=_0xcadc37;logger[_0xaaa1('0xc')]('The\x20Enduser\x20ID\x20is:',_0x1fc849['id']);return getTicket(_0x4d4b29,_0x30824c,_0x1fc849,_0xea8720,_0x594ae1,_0xea8720[_0xaaa1('0x62')],_0x4114d0,_0xaaa1('0x63'));})[_0xaaa1('0x2c')](function(_0x355ebd){_0x4de3be=_0x355ebd;logger[_0xaaa1('0xc')]('Ticket\x20created!');logger[_0xaaa1('0xc')](_0xaaa1('0x65'),_0x4de3be['id']);return setRelationship(_0x4114d0,_0x30824c,_0x4de3be,'users');})[_0xaaa1('0x2c')](function(){return setRelationship(_0x4114d0,_0x1fc849,_0x4de3be,'contacts');})[_0xaaa1('0x2c')](function(){return getServerInfo(_0x4114d0);})[_0xaaa1('0x6f')](function(_0x59ef26){logger[_0xaaa1('0x70')]('['+_0x594ae1[_0xaaa1('0x76')][_0xaaa1('0x77')]()+']',JSON[_0xaaa1('0x21')](_0x59ef26));});}; \ 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 52efc52..325fca0 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 _0x74f3=['type','push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','getString','sortBy'];(function(_0x4ca589,_0x24924a){var _0x17dca0=function(_0x353e48){while(--_0x353e48){_0x4ca589['push'](_0x4ca589['shift']());}};_0x17dca0(++_0x24924a);}(_0x74f3,0x1c8));var _0x374f=function(_0x278747,_0x2981cd){_0x278747=_0x278747-0x0;var _0x441464=_0x74f3[_0x278747];return _0x441464;};'use strict';var _=require(_0x374f('0x0'));var util=require('util');exports[_0x374f('0x1')]=function(_0x39e850,_0x46ddb2,_0x35fc94){var _0x555f56=[];if(_0x39e850['length']>0x0){var _0x48ed24=_[_0x374f('0x2')](_0x39e850,['id']);for(var _0x2406a1=0x0;_0x2406a1<_0x48ed24['length'];_0x2406a1++){var _0x4c966d=_0x48ed24[_0x2406a1];if(_0x4c966d[_0x374f('0x3')]==='string'){_0x555f56[_0x374f('0x4')](_0x4c966d[_0x374f('0x5')]);}else if(_0x4c966d[_0x374f('0x3')]===_0x374f('0x6')&&_0x4c966d[_0x374f('0x7')]){_0x46ddb2[_0x4c966d[_0x374f('0x7')]]&&_0x555f56[_0x374f('0x4')](_0x46ddb2[_0x4c966d['variableName']][_0x374f('0x8')]());}else if(_0x4c966d[_0x374f('0x3')]==='customVariable'&&_0x4c966d[_0x374f('0x9')]&&_0x4c966d['Variable'][_0x374f('0xa')]){_0x46ddb2[_0x4c966d['Variable'][_0x374f('0xa')][_0x374f('0xb')]()]&&_0x555f56['push'](_0x46ddb2[_0x4c966d[_0x374f('0x9')][_0x374f('0xa')][_0x374f('0xb')]()][_0x374f('0x8')]());}else if(_0x4c966d['type']===_0x374f('0xc')){if(_0x4c966d[_0x374f('0xd')]===_0x374f('0xe')&&_0x4c966d[_0x374f('0xf')]){_0x555f56[_0x374f('0x4')](util[_0x374f('0x10')](_0x374f('0x11'),_0x4c966d[_0x374f('0xf')],_0x4c966d[_0x374f('0x12')]));}else if(_0x4c966d[_0x374f('0xd')]===_0x374f('0x6')&&_0x4c966d['variableName']&&_0x4c966d[_0x374f('0xf')]){_0x46ddb2[_0x4c966d[_0x374f('0x7')]]&&_0x555f56[_0x374f('0x4')](util[_0x374f('0x10')](_0x374f('0x11'),_0x4c966d[_0x374f('0xf')],_0x46ddb2[_0x4c966d[_0x374f('0x7')]]));}else if(_0x4c966d[_0x374f('0xd')]===_0x374f('0x13')&&_0x4c966d[_0x374f('0x9')]&&_0x4c966d['Variable'][_0x374f('0xa')]&&_0x4c966d[_0x374f('0xf')]){_0x46ddb2[_0x4c966d[_0x374f('0x9')][_0x374f('0xa')][_0x374f('0xb')]()]&&_0x555f56['push'](util[_0x374f('0x10')](_0x374f('0x11'),_0x4c966d[_0x374f('0xf')],_0x46ddb2[_0x4c966d[_0x374f('0x9')]['name'][_0x374f('0xb')]()]));}}}}return _0x555f56[_0x374f('0x14')](_0x35fc94);};exports[_0x374f('0x15')]=function(_0x15cf38){var _0x12bb64=_0x15cf38[_0x374f('0x16')](-0x1);if(_0x12bb64==='/'){_0x15cf38=_0x15cf38[_0x374f('0x17')](0x0,_0x15cf38['lastIndexOf'](_0x12bb64));}return _0x15cf38;};exports[_0x374f('0x18')]=function(_0x4461a8){if(!_[_0x374f('0x19')](_0x4461a8)&&_0x4461a8!==''){var _0xf291f7=/^(([^<>()\[\]\\.,;:\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 _0xf291f7[_0x374f('0x1a')](String(_0x4461a8)[_0x374f('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xea7a=['type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','keyContent','keyType','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','getString','sortBy','length'];(function(_0xd8a01e,_0x52b249){var _0x2b716e=function(_0x4f7974){while(--_0x4f7974){_0xd8a01e['push'](_0xd8a01e['shift']());}};_0x2b716e(++_0x52b249);}(_0xea7a,0x1d8));var _0xaea7=function(_0x2a920d,_0x4ff746){_0x2a920d=_0x2a920d-0x0;var _0x4f7eb6=_0xea7a[_0x2a920d];return _0x4f7eb6;};'use strict';var _=require(_0xaea7('0x0'));var util=require('util');exports[_0xaea7('0x1')]=function(_0x26a012,_0x127668,_0x316f95){var _0xff9f8e=[];if(_0x26a012['length']>0x0){var _0x14e1b8=_[_0xaea7('0x2')](_0x26a012,['id']);for(var _0x1476c9=0x0;_0x1476c9<_0x14e1b8[_0xaea7('0x3')];_0x1476c9++){var _0x457982=_0x14e1b8[_0x1476c9];if(_0x457982[_0xaea7('0x4')]===_0xaea7('0x5')){_0xff9f8e[_0xaea7('0x6')](_0x457982[_0xaea7('0x7')]);}else if(_0x457982['type']===_0xaea7('0x8')&&_0x457982[_0xaea7('0x9')]){_0x127668[_0x457982[_0xaea7('0x9')]]&&_0xff9f8e['push'](_0x127668[_0x457982[_0xaea7('0x9')]][_0xaea7('0xa')]());}else if(_0x457982[_0xaea7('0x4')]===_0xaea7('0xb')&&_0x457982['Variable']&&_0x457982[_0xaea7('0xc')][_0xaea7('0xd')]){_0x127668[_0x457982[_0xaea7('0xc')][_0xaea7('0xd')]['toLowerCase']()]&&_0xff9f8e[_0xaea7('0x6')](_0x127668[_0x457982[_0xaea7('0xc')][_0xaea7('0xd')][_0xaea7('0xe')]()][_0xaea7('0xa')]());}else if(_0x457982[_0xaea7('0x4')]===_0xaea7('0xf')){if(_0x457982['keyType']===_0xaea7('0x5')&&_0x457982[_0xaea7('0x10')]){_0xff9f8e[_0xaea7('0x6')](util[_0xaea7('0x11')](_0xaea7('0x12'),_0x457982['key'],_0x457982[_0xaea7('0x13')]));}else if(_0x457982[_0xaea7('0x14')]===_0xaea7('0x8')&&_0x457982[_0xaea7('0x9')]&&_0x457982[_0xaea7('0x10')]){_0x127668[_0x457982['variableName']]&&_0xff9f8e[_0xaea7('0x6')](util[_0xaea7('0x11')](_0xaea7('0x12'),_0x457982[_0xaea7('0x10')],_0x127668[_0x457982[_0xaea7('0x9')]]));}else if(_0x457982[_0xaea7('0x14')]===_0xaea7('0xb')&&_0x457982[_0xaea7('0xc')]&&_0x457982['Variable'][_0xaea7('0xd')]&&_0x457982[_0xaea7('0x10')]){_0x127668[_0x457982[_0xaea7('0xc')][_0xaea7('0xd')][_0xaea7('0xe')]()]&&_0xff9f8e[_0xaea7('0x6')](util[_0xaea7('0x11')](_0xaea7('0x12'),_0x457982[_0xaea7('0x10')],_0x127668[_0x457982[_0xaea7('0xc')][_0xaea7('0xd')][_0xaea7('0xe')]()]));}}}}return _0xff9f8e['join'](_0x316f95);};exports[_0xaea7('0x15')]=function(_0x5371e9){var _0x67d8ae=_0x5371e9[_0xaea7('0x16')](-0x1);if(_0x67d8ae==='/'){_0x5371e9=_0x5371e9[_0xaea7('0x17')](0x0,_0x5371e9[_0xaea7('0x18')](_0x67d8ae));}return _0x5371e9;};exports[_0xaea7('0x19')]=function(_0x5b4839){if(!_[_0xaea7('0x1a')](_0x5b4839)&&_0x5b4839!==''){var _0x27fd71=/^(([^<>()\[\]\\.,;:\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 _0x27fd71[_0xaea7('0x1b')](String(_0x5b4839)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 57bb16a..52326c3 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _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(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 8d9aa53..039acdc 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 _0x6ec5=['variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:browser:url','/api/v2','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','toUpperCase','Authorization','\x20Error\x20running\x20Zendesk\x20integration','inspect','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','emit','application/json','info','Creating\x20new\x20ticket...','remoteUri','merge','getString','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','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.','Searching\x20enduser\x20with\x20phone','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','password','authType','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','length','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','idField','customField','custom_fields','push','variable'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6ec5,0x170));var _0x56ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ec5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x56ec('0x0'));var rp=require(_0x56ec('0x1'));var md5=require('md5');var util=require(_0x56ec('0x2'));var Redis=require(_0x56ec('0x3'));var intUtil=require(_0x56ec('0x4'));var config=require(_0x56ec('0x5'));var logger=require(_0x56ec('0x6'))(_0x56ec('0x7'));config[_0x56ec('0x8')]=_[_0x56ec('0x9')](config[_0x56ec('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x11e375,_0x1a52ad,_0x511193){io['to'](_0x11e375)[_0x56ec('0xa')](_0x1a52ad,_0x511193);}var headers={'Content-Type':_0x56ec('0xb'),'Accept':'application/json'};function getTicket(_0x532954,_0x28bf5a,_0x3810d8,_0x372963,_0x280caa){logger[_0x56ec('0xc')](_0x56ec('0xd'));return request({'uri':util['format']('%s/tickets.json',_0x532954[_0x56ec('0xe')]),'method':'POST','body':{'ticket':_[_0x56ec('0xf')]({'requester_id':_0x3810d8['id'],'submitter_id':_0x28bf5a?_0x28bf5a['id']:undefined,'assignee_id':_0x28bf5a?_0x28bf5a['id']:undefined,'tags':getTags(_0x372963['Tags'],'name'),'subject':intUtil[_0x56ec('0x10')](_0x372963['Subjects'],_0x280caa,'\x20'),'description':intUtil[_0x56ec('0x10')](_0x372963[_0x56ec('0x11')],_0x280caa,'\x0a'),'comment':{'public':![],'body':intUtil[_0x56ec('0x10')](_0x372963[_0x56ec('0x11')],_0x280caa,'\x0a')}},getCustomFields(_0x372963[_0x56ec('0x12')],_0x280caa))}})[_0x56ec('0x13')](function(_0x28b086){logger[_0x56ec('0xc')]('Ticket\x20created!');return _0x28b086[_0x56ec('0x14')];});}function getUser(_0x1fe7c0,_0x1eebd4){if(intUtil[_0x56ec('0x15')](_0x1eebd4)){logger['info'](_0x56ec('0x16'),_0x1eebd4);return request({'uri':util[_0x56ec('0x17')](_0x56ec('0x18'),_0x1fe7c0['remoteUri']),'qs':{'query':util[_0x56ec('0x17')](_0x56ec('0x19'),_0x1eebd4)}})[_0x56ec('0x13')](function(_0x440a51){if(_0x440a51[_0x56ec('0x1a')]){logger[_0x56ec('0xc')](_0x56ec('0x1b'));return _[_0x56ec('0x1c')](_0x440a51[_0x56ec('0x1d')],{'email':_0x1eebd4,'role':_0x56ec('0x1e')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x1fe7c0[_0x56ec('0xe')])})[_0x56ec('0x13')](function(_0x3dacbd){logger[_0x56ec('0xc')]('Admin\x20account\x20selected.');return _0x3dacbd['user'];});}});}else{logger['info'](_0x56ec('0x1f'));return request({'uri':util['format'](_0x56ec('0x20'),_0x1fe7c0[_0x56ec('0xe')])})[_0x56ec('0x13')](function(_0x46340a){logger[_0x56ec('0xc')](_0x56ec('0x21'));return _0x46340a['user'];});}}function getEndUser(_0x7a9044,_0x245fe9,_0x257be4){logger[_0x56ec('0xc')](_0x56ec('0x22'),_0x257be4);return request({'uri':util['format'](_0x56ec('0x18'),_0x7a9044[_0x56ec('0xe')]),'qs':{'query':util[_0x56ec('0x17')]('type:user\x20role:end-user\x20phone:%s',_0x257be4)}})[_0x56ec('0x13')](function(_0xbb223f){var _0x168667;if(_0xbb223f[_0x56ec('0x1d')]['length']){_0xbb223f['results']=_[_0x56ec('0x23')](_0xbb223f[_0x56ec('0x1d')],{'suspended':![],'role':'end-user'});if(_0xbb223f['results']['length']){_0x168667=_[_0x56ec('0x24')](_0xbb223f['results']);}}if(_0x168667){logger[_0x56ec('0xc')](_0x56ec('0x25'));return _0x168667;}else{logger[_0x56ec('0xc')](_0x56ec('0x26'));return request({'uri':util[_0x56ec('0x17')](_0x56ec('0x27'),_0x7a9044[_0x56ec('0xe')]),'method':_0x56ec('0x28'),'body':{'user':{'role':'end-user','name':util[_0x56ec('0x17')](_0x56ec('0x29'),_0x245fe9||_0x257be4),'phone':_0x257be4}}})[_0x56ec('0x13')](function(_0x2f2ea9){logger['info'](_0x56ec('0x2a'));return _0x2f2ea9['user'];});}});}function getAuth(_0x1e2543){var _0x402969;if(_0x1e2543['authType']===_0x56ec('0x2b')){_0x402969=util[_0x56ec('0x17')]('%s:%s',_0x1e2543['username'],_0x1e2543[_0x56ec('0x2b')]);}else if(_0x1e2543[_0x56ec('0x2c')]===_0x56ec('0x2d')){_0x402969=util[_0x56ec('0x17')]('%s/token:%s',_0x1e2543['username'],_0x1e2543[_0x56ec('0x2d')]);}return util['format'](_0x56ec('0x2e'),new Buffer(_0x402969)[_0x56ec('0x2f')](_0x56ec('0x30')));}function request(_0x5e5ca9){logger[_0x56ec('0x31')](_0x56ec('0x32'),JSON[_0x56ec('0x33')](_0x5e5ca9));return rp(_[_0x56ec('0x9')](_0x5e5ca9,{'method':_0x56ec('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x5cdb92,_0x5ee166){var _0x2b94aa=[];if(_0x5cdb92&&_0x5cdb92[_0x56ec('0x35')]>0x0){_0x2b94aa=_[_0x56ec('0x36')](_0x5cdb92,_0x5ee166);}return _0x2b94aa;}function getCustomFields(_0x46e93e,_0x3a3116){var _0x2ae9f1=[];var _0x250f1e={'custom_fields':[]};if(_0x46e93e[_0x56ec('0x35')]>0x0){_[_0x56ec('0x37')](_0x46e93e,function(_0x5744b4){if(_[_0x56ec('0x38')]([_0x56ec('0x39'),_0x56ec('0x3a')],_0x5744b4[_0x56ec('0x3b')])&&_0x5744b4[_0x56ec('0x3c')]&&!_0x5744b4['customField']){_0x250f1e[_0x5744b4['nameField'][_0x56ec('0x3d')]()]=_0x5744b4[_0x56ec('0x3e')]['toString']();}else if(_['includes']([_0x56ec('0x39'),_0x56ec('0x3a')],_0x5744b4[_0x56ec('0x3b')])&&_0x5744b4[_0x56ec('0x3f')]&&_0x5744b4[_0x56ec('0x40')]){_0x250f1e[_0x56ec('0x41')][_0x56ec('0x42')]({'id':_0x5744b4[_0x56ec('0x3f')],'value':_0x5744b4[_0x56ec('0x3e')]['toString']()});}else if(_0x5744b4[_0x56ec('0x3b')]===_0x56ec('0x43')&&_0x5744b4[_0x56ec('0x44')]&&_0x5744b4[_0x56ec('0x3f')]&&_0x5744b4[_0x56ec('0x40')]){_0x3a3116[_0x5744b4['variableName']]&&_0x250f1e[_0x56ec('0x41')]['push']({'id':_0x5744b4[_0x56ec('0x3f')],'value':_0x3a3116[_0x5744b4[_0x56ec('0x44')]][_0x56ec('0x2f')]()});}else if(_0x5744b4['type']===_0x56ec('0x45')&&_0x5744b4['Variable']&&_0x5744b4[_0x56ec('0x46')][_0x56ec('0x47')]&&_0x5744b4['idField']&&_0x5744b4[_0x56ec('0x40')]){_0x3a3116[_0x5744b4[_0x56ec('0x46')][_0x56ec('0x47')][_0x56ec('0x3d')]()]&&_0x250f1e[_0x56ec('0x41')][_0x56ec('0x42')]({'id':_0x5744b4[_0x56ec('0x3f')],'value':_0x3a3116[_0x5744b4[_0x56ec('0x46')][_0x56ec('0x47')][_0x56ec('0x3d')]()][_0x56ec('0x2f')]()});}});}return _0x250f1e;}exports[_0x56ec('0x48')]=function(_0x1db394,_0x359457,_0x33782b,_0x4bc7f9,_0x20da1d,_0x1a2fcb){var _0x1007f4,_0xe08e8c;_0x1a2fcb[_0x56ec('0xe')]=intUtil[_0x56ec('0x49')](_0x1a2fcb['remoteUri']);_0x1a2fcb[_0x56ec('0x4a')]=intUtil[_0x56ec('0x49')](_0x1a2fcb[_0x56ec('0x4a')]);if(_0x20da1d&&_0x20da1d[_0x56ec('0x4b')]){logger[_0x56ec('0xc')](_0x56ec('0x4c'),'Recording\x20is\x20enabled!');_0x359457[_0x56ec('0x4d')]=util[_0x56ec('0x17')](_0x56ec('0x4e'),_0x1a2fcb[_0x56ec('0x4a')],_0x359457['uniqueid'],md5(_0x359457[_0x56ec('0x4f')]));}else{_0x359457[_0x56ec('0x4d')]='';}headers['Authorization']=getAuth(_0x1a2fcb);return getUser(_0x1a2fcb,_0x4bc7f9[_0x56ec('0x50')])[_0x56ec('0x13')](function(_0x644957){_0x1007f4=_0x644957;logger[_0x56ec('0xc')](_0x56ec('0x51'),_0x1007f4['id']);return getEndUser(_0x1a2fcb,_0x359457[_0x56ec('0x52')],_0x359457[_0x56ec('0x53')]);})['then'](function(_0x182aea){_0xe08e8c=_0x182aea;logger['info']('The\x20Enduser\x20ID\x20is:',_0xe08e8c['id']);return getTicket(_0x1a2fcb,_0x1007f4,_0xe08e8c,_0x33782b,_0x359457);})[_0x56ec('0x13')](function(_0xf0fe2e){if(_0xf0fe2e){logger['info'](_0x56ec('0x54'),_0xf0fe2e['id']);switch(_0x1a2fcb[_0x56ec('0x3b')]){case'integrationTab':logger[_0x56ec('0xc')](_0x56ec('0x4c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x56ec('0x17')](_0x56ec('0x55'),_0x1a2fcb[_0x56ec('0xe')],_0x1007f4['id'],_0xf0fe2e['id']),'method':_0x56ec('0x28')});case _0x56ec('0x56'):logger[_0x56ec('0xc')]('[QUEUE]',_0x56ec('0x57'));emit(util[_0x56ec('0x17')]('user:%s',_0x4bc7f9[_0x56ec('0x47')]),'trigger:browser:url',{'uri':util[_0x56ec('0x17')](_0x56ec('0x58'),_0x1a2fcb[_0x56ec('0xe')]['replace']('/api/v2',''),_0xf0fe2e['id'])});break;default:logger[_0x56ec('0x59')](_0x56ec('0x4c'),_0x56ec('0x5a'));}}})['catch'](function(_0x34735e){logger[_0x56ec('0x59')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x34735e,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x1c1654,_0x11c3d4,_0x55fc9d,_0x508802,_0x5a1451,_0x559e1c,_0x15b885){var _0x1e269e,_0x1daf32;_0x559e1c[_0x56ec('0xe')]=intUtil[_0x56ec('0x49')](_0x559e1c[_0x56ec('0xe')]);_0x559e1c['serverUrl']=intUtil['stripTrailingSlash'](_0x559e1c[_0x56ec('0x4a')]);if(_0x15b885&&_0x15b885['recordingFormat']&&_0x15b885[_0x56ec('0x5b')]!==_0x56ec('0x5c')){logger[_0x56ec('0xc')]('[OUTBOUND]',_0x56ec('0x5d'));_0x11c3d4[_0x56ec('0x4d')]=util[_0x56ec('0x17')](_0x56ec('0x4e'),_0x559e1c[_0x56ec('0x4a')],_0x11c3d4[_0x56ec('0x4f')],md5(_0x11c3d4[_0x56ec('0x4f')]));}headers['Authorization']=getAuth(_0x559e1c);return getUser(_0x559e1c,_0x508802[_0x56ec('0x50')])['then'](function(_0x11722b){_0x1e269e=_0x11722b;logger['info'](_0x56ec('0x51'),_0x1e269e['id']);return getEndUser(_0x559e1c,_0x11c3d4[_0x56ec('0x5e')],_0x11c3d4[_0x56ec('0x5f')]);})['then'](function(_0x3f76cf){_0x1daf32=_0x3f76cf;logger[_0x56ec('0xc')](_0x56ec('0x60'),_0x1daf32['id']);return getTicket(_0x559e1c,_0x1e269e,_0x1daf32,_0x55fc9d,_0x11c3d4);})[_0x56ec('0x13')](function(_0x19d846){if(_0x19d846){logger[_0x56ec('0xc')](_0x56ec('0x54'),_0x19d846['id']);switch(_0x559e1c['type']){case _0x56ec('0x61'):logger[_0x56ec('0xc')](_0x56ec('0x62'),_0x56ec('0x63'));return request({'uri':util[_0x56ec('0x17')](_0x56ec('0x55'),_0x559e1c[_0x56ec('0xe')],_0x1e269e['id'],_0x19d846['id']),'method':_0x56ec('0x28')});case _0x56ec('0x56'):logger[_0x56ec('0xc')](_0x56ec('0x62'),_0x56ec('0x57'));emit(util[_0x56ec('0x17')](_0x56ec('0x64'),_0x508802[_0x56ec('0x47')]),_0x56ec('0x65'),{'uri':util[_0x56ec('0x17')](_0x56ec('0x58'),_0x559e1c[_0x56ec('0xe')]['replace'](_0x56ec('0x66'),''),_0x19d846['id'])});break;default:logger[_0x56ec('0x59')](_0x56ec('0x62'),_0x56ec('0x5a'));}}})[_0x56ec('0x67')](function(_0x28c03f){logger[_0x56ec('0x59')](_0x56ec('0x68'),util['inspect'](_0x28c03f,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x1fcf5b,_0x5ea04d,_0x2ffd93,_0x118cbd,_0x49e04f,_0x4168d3){var _0xe88540,_0x1c74b4;_0x4168d3[_0x56ec('0xe')]=intUtil['stripTrailingSlash'](_0x4168d3[_0x56ec('0xe')]);_0x4168d3[_0x56ec('0x4a')]=intUtil[_0x56ec('0x49')](_0x4168d3[_0x56ec('0x4a')]);if(_0x49e04f&&_0x49e04f[_0x56ec('0x4b')]){logger[_0x56ec('0xc')]('['+_0x5ea04d['lastevent'][_0x56ec('0x69')]()+']','Recording\x20is\x20enabled!');_0x5ea04d['recordingURL']=util[_0x56ec('0x17')](_0x56ec('0x4e'),_0x4168d3[_0x56ec('0x4a')],_0x5ea04d[_0x56ec('0x4f')],md5(_0x5ea04d[_0x56ec('0x4f')]));}else{_0x5ea04d[_0x56ec('0x4d')]='';}headers[_0x56ec('0x6a')]=getAuth(_0x4168d3);return getUser(_0x4168d3)[_0x56ec('0x13')](function(_0x1de02d){_0xe88540=_0x1de02d;logger[_0x56ec('0xc')](_0x56ec('0x51'),_0xe88540['id']);return getEndUser(_0x4168d3,_0x5ea04d[_0x56ec('0x52')],_0x5ea04d[_0x56ec('0x53')]);})['then'](function(_0x4225d4){_0x1c74b4=_0x4225d4;logger[_0x56ec('0xc')](_0x56ec('0x60'),_0x1c74b4['id']);return getTicket(_0x4168d3,_0xe88540,_0x1c74b4,_0x2ffd93,_0x5ea04d);})[_0x56ec('0x13')](function(_0x356a95){if(_0x356a95){logger[_0x56ec('0xc')](_0x56ec('0x54'),_0x356a95['id']);}})[_0x56ec('0x67')](function(_0x465b87){logger[_0x56ec('0x59')]('['+_0x5ea04d['lastevent'][_0x56ec('0x69')]()+']'+_0x56ec('0x6b'),util[_0x56ec('0x6c')](_0x465b87,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x04ee=['Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','toLowerCase','content','string','idField','customField','custom_fields','push','variable','variableName','customVariable'];(function(_0x37184d,_0x187341){var _0x50f116=function(_0x516089){while(--_0x516089){_0x37184d['push'](_0x37184d['shift']());}};_0x50f116(++_0x187341);}(_0x04ee,0x107));var _0xe04e=function(_0x22172f,_0x50b916){_0x22172f=_0x22172f-0x0;var _0x560a3b=_0x04ee[_0x22172f];return _0x560a3b;};'use strict';var _=require(_0xe04e('0x0'));var rp=require(_0xe04e('0x1'));var md5=require(_0xe04e('0x2'));var util=require('util');var Redis=require(_0xe04e('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe04e('0x4'))(_0xe04e('0x5'));config[_0xe04e('0x6')]=_[_0xe04e('0x7')](config[_0xe04e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe04e('0x8'))(new Redis(config[_0xe04e('0x6')]));function emit(_0x421733,_0x34b59a,_0x5783da){io['to'](_0x421733)['emit'](_0x34b59a,_0x5783da);}var headers={'Content-Type':_0xe04e('0x9'),'Accept':'application/json'};function getTicket(_0x2aa859,_0x4bbabc,_0x26d625,_0x146d01,_0x4d796e){logger[_0xe04e('0xa')](_0xe04e('0xb'));return request({'uri':util[_0xe04e('0xc')](_0xe04e('0xd'),_0x2aa859[_0xe04e('0xe')]),'method':_0xe04e('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x26d625['id'],'submitter_id':_0x4bbabc?_0x4bbabc['id']:undefined,'assignee_id':_0x4bbabc?_0x4bbabc['id']:undefined,'tags':getTags(_0x146d01[_0xe04e('0x10')],_0xe04e('0x11')),'subject':intUtil[_0xe04e('0x12')](_0x146d01[_0xe04e('0x13')],_0x4d796e,'\x20'),'description':intUtil[_0xe04e('0x12')](_0x146d01['Descriptions'],_0x4d796e,'\x0a'),'comment':{'public':![],'body':intUtil[_0xe04e('0x12')](_0x146d01[_0xe04e('0x14')],_0x4d796e,'\x0a')}},getCustomFields(_0x146d01[_0xe04e('0x15')],_0x4d796e))}})['then'](function(_0x2b0f7e){logger[_0xe04e('0xa')](_0xe04e('0x16'));return _0x2b0f7e[_0xe04e('0x17')];});}function getUser(_0x4f9333,_0x2d3c99){if(intUtil[_0xe04e('0x18')](_0x2d3c99)){logger[_0xe04e('0xa')](_0xe04e('0x19'),_0x2d3c99);return request({'uri':util[_0xe04e('0xc')]('%s/search.json',_0x4f9333['remoteUri']),'qs':{'query':util[_0xe04e('0xc')](_0xe04e('0x1a'),_0x2d3c99)}})[_0xe04e('0x1b')](function(_0x264cba){if(_0x264cba['count']){logger[_0xe04e('0xa')](_0xe04e('0x1c'));return _[_0xe04e('0x1d')](_0x264cba['results'],{'email':_0x2d3c99,'role':'agent'});}else{logger['info'](_0xe04e('0x1e'));return request({'uri':util[_0xe04e('0xc')](_0xe04e('0x1f'),_0x4f9333[_0xe04e('0xe')])})[_0xe04e('0x1b')](function(_0x27e23c){logger[_0xe04e('0xa')](_0xe04e('0x20'));return _0x27e23c[_0xe04e('0x21')];});}});}else{logger[_0xe04e('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe04e('0x1f'),_0x4f9333[_0xe04e('0xe')])})[_0xe04e('0x1b')](function(_0x44b251){logger[_0xe04e('0xa')](_0xe04e('0x20'));return _0x44b251['user'];});}}function getEndUser(_0x76b295,_0x1b01c3,_0x425187){logger[_0xe04e('0xa')](_0xe04e('0x22'),_0x425187);return request({'uri':util[_0xe04e('0xc')](_0xe04e('0x23'),_0x76b295[_0xe04e('0xe')]),'qs':{'query':util[_0xe04e('0xc')](_0xe04e('0x24'),_0x425187)}})['then'](function(_0x11942){var _0x304381;if(_0x11942[_0xe04e('0x25')][_0xe04e('0x26')]){_0x11942[_0xe04e('0x25')]=_[_0xe04e('0x27')](_0x11942[_0xe04e('0x25')],{'suspended':![],'role':_0xe04e('0x28')});if(_0x11942[_0xe04e('0x25')][_0xe04e('0x26')]){_0x304381=_[_0xe04e('0x29')](_0x11942['results']);}}if(_0x304381){logger[_0xe04e('0xa')](_0xe04e('0x2a'));return _0x304381;}else{logger[_0xe04e('0xa')](_0xe04e('0x2b'));return request({'uri':util[_0xe04e('0xc')]('%s/users.json',_0x76b295[_0xe04e('0xe')]),'method':'POST','body':{'user':{'role':_0xe04e('0x28'),'name':util[_0xe04e('0xc')](_0xe04e('0x2c'),_0x1b01c3||_0x425187),'phone':_0x425187}}})[_0xe04e('0x1b')](function(_0x1cd289){logger['info']('Enduser\x20created.');return _0x1cd289[_0xe04e('0x21')];});}});}function getAuth(_0xf5e43f){var _0x6d413c;if(_0xf5e43f[_0xe04e('0x2d')]===_0xe04e('0x2e')){_0x6d413c=util[_0xe04e('0xc')](_0xe04e('0x2f'),_0xf5e43f[_0xe04e('0x30')],_0xf5e43f['password']);}else if(_0xf5e43f[_0xe04e('0x2d')]===_0xe04e('0x31')){_0x6d413c=util[_0xe04e('0xc')](_0xe04e('0x32'),_0xf5e43f[_0xe04e('0x30')],_0xf5e43f[_0xe04e('0x31')]);}return util['format'](_0xe04e('0x33'),new Buffer(_0x6d413c)[_0xe04e('0x34')]('base64'));}function request(_0x21800a){logger[_0xe04e('0x35')](_0xe04e('0x36'),JSON[_0xe04e('0x37')](_0x21800a));return rp(_[_0xe04e('0x7')](_0x21800a,{'method':_0xe04e('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x294c8c,_0x39d230){var _0x46370f=[];if(_0x294c8c&&_0x294c8c[_0xe04e('0x26')]>0x0){_0x46370f=_[_0xe04e('0x39')](_0x294c8c,_0x39d230);}return _0x46370f;}function getCustomFields(_0x5f54b7,_0x5a2ccc){var _0x1ad9c3=[];var _0x3b1bed={'custom_fields':[]};if(_0x5f54b7[_0xe04e('0x26')]>0x0){_[_0xe04e('0x3a')](_0x5f54b7,function(_0x528ad7){if(_[_0xe04e('0x3b')](['string',_0xe04e('0x3c')],_0x528ad7[_0xe04e('0x3d')])&&_0x528ad7[_0xe04e('0x3e')]&&!_0x528ad7['customField']){_0x3b1bed[_0x528ad7['nameField'][_0xe04e('0x3f')]()]=_0x528ad7[_0xe04e('0x40')][_0xe04e('0x34')]();}else if(_[_0xe04e('0x3b')]([_0xe04e('0x41'),_0xe04e('0x3c')],_0x528ad7['type'])&&_0x528ad7[_0xe04e('0x42')]&&_0x528ad7[_0xe04e('0x43')]){_0x3b1bed[_0xe04e('0x44')][_0xe04e('0x45')]({'id':_0x528ad7[_0xe04e('0x42')],'value':_0x528ad7[_0xe04e('0x40')][_0xe04e('0x34')]()});}else if(_0x528ad7[_0xe04e('0x3d')]===_0xe04e('0x46')&&_0x528ad7['variableName']&&_0x528ad7[_0xe04e('0x42')]&&_0x528ad7[_0xe04e('0x43')]){_0x5a2ccc[_0x528ad7[_0xe04e('0x47')]]&&_0x3b1bed[_0xe04e('0x44')][_0xe04e('0x45')]({'id':_0x528ad7['idField'],'value':_0x5a2ccc[_0x528ad7[_0xe04e('0x47')]][_0xe04e('0x34')]()});}else if(_0x528ad7[_0xe04e('0x3d')]===_0xe04e('0x48')&&_0x528ad7['Variable']&&_0x528ad7['Variable'][_0xe04e('0x11')]&&_0x528ad7[_0xe04e('0x42')]&&_0x528ad7['customField']){_0x5a2ccc[_0x528ad7[_0xe04e('0x49')][_0xe04e('0x11')][_0xe04e('0x3f')]()]&&_0x3b1bed['custom_fields'][_0xe04e('0x45')]({'id':_0x528ad7[_0xe04e('0x42')],'value':_0x5a2ccc[_0x528ad7[_0xe04e('0x49')]['name']['toLowerCase']()][_0xe04e('0x34')]()});}});}return _0x3b1bed;}exports[_0xe04e('0x4a')]=function(_0x1f3c34,_0x54ba9b,_0x135ed7,_0x3d634e,_0xaa6f06,_0x4c784f){var _0x244ab5,_0x4c1ac6;_0x4c784f[_0xe04e('0xe')]=intUtil[_0xe04e('0x4b')](_0x4c784f[_0xe04e('0xe')]);_0x4c784f[_0xe04e('0x4c')]=intUtil[_0xe04e('0x4b')](_0x4c784f['serverUrl']);if(_0xaa6f06&&_0xaa6f06['monitor_format']){logger[_0xe04e('0xa')](_0xe04e('0x4d'),_0xe04e('0x4e'));_0x54ba9b[_0xe04e('0x4f')]=util[_0xe04e('0xc')](_0xe04e('0x50'),_0x4c784f[_0xe04e('0x4c')],_0x54ba9b['uniqueid'],md5(_0x54ba9b[_0xe04e('0x51')]));}else{_0x54ba9b['recordingURL']='';}headers['Authorization']=getAuth(_0x4c784f);return getUser(_0x4c784f,_0x3d634e[_0xe04e('0x52')])[_0xe04e('0x1b')](function(_0x5dc649){_0x244ab5=_0x5dc649;logger['info'](_0xe04e('0x53'),_0x244ab5['id']);return getEndUser(_0x4c784f,_0x54ba9b['calleridname'],_0x54ba9b[_0xe04e('0x54')]);})[_0xe04e('0x1b')](function(_0x3d5115){_0x4c1ac6=_0x3d5115;logger[_0xe04e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4c1ac6['id']);return getTicket(_0x4c784f,_0x244ab5,_0x4c1ac6,_0x135ed7,_0x54ba9b);})[_0xe04e('0x1b')](function(_0x19f6e0){if(_0x19f6e0){logger['info']('The\x20Ticket\x20ID\x20is:',_0x19f6e0['id']);switch(_0x4c784f['type']){case _0xe04e('0x55'):logger[_0xe04e('0xa')](_0xe04e('0x4d'),_0xe04e('0x56'));return request({'uri':util['format'](_0xe04e('0x57'),_0x4c784f[_0xe04e('0xe')],_0x244ab5['id'],_0x19f6e0['id']),'method':'POST'});case _0xe04e('0x58'):logger[_0xe04e('0xa')](_0xe04e('0x4d'),_0xe04e('0x59'));emit(util[_0xe04e('0xc')]('user:%s',_0x3d634e[_0xe04e('0x11')]),'trigger:browser:url',{'uri':util[_0xe04e('0xc')](_0xe04e('0x5a'),_0x4c784f[_0xe04e('0xe')][_0xe04e('0x5b')](_0xe04e('0x5c'),''),_0x19f6e0['id'])});break;default:logger[_0xe04e('0x5d')](_0xe04e('0x4d'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0xaf44d8){logger['error'](_0xe04e('0x5e'),util[_0xe04e('0x5f')](_0xaf44d8,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x1795e1,_0x40831e,_0x53f16e,_0x230229,_0x549296,_0x97d938,_0x20a4de){var _0x3382c5,_0x57f7ee;_0x97d938[_0xe04e('0xe')]=intUtil['stripTrailingSlash'](_0x97d938[_0xe04e('0xe')]);_0x97d938[_0xe04e('0x4c')]=intUtil[_0xe04e('0x4b')](_0x97d938[_0xe04e('0x4c')]);if(_0x20a4de&&_0x20a4de[_0xe04e('0x60')]&&_0x20a4de[_0xe04e('0x60')]!==_0xe04e('0x61')){logger['info'](_0xe04e('0x62'),_0xe04e('0x4e'));_0x40831e['recordingURL']=util[_0xe04e('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x97d938['serverUrl'],_0x40831e[_0xe04e('0x51')],md5(_0x40831e[_0xe04e('0x51')]));}headers['Authorization']=getAuth(_0x97d938);return getUser(_0x97d938,_0x230229['email'])[_0xe04e('0x1b')](function(_0x5a052d){_0x3382c5=_0x5a052d;logger[_0xe04e('0xa')](_0xe04e('0x53'),_0x3382c5['id']);return getEndUser(_0x97d938,_0x40831e[_0xe04e('0x63')],_0x40831e['destcalleridnum']);})[_0xe04e('0x1b')](function(_0x3a26bc){_0x57f7ee=_0x3a26bc;logger[_0xe04e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x57f7ee['id']);return getTicket(_0x97d938,_0x3382c5,_0x57f7ee,_0x53f16e,_0x40831e);})[_0xe04e('0x1b')](function(_0x5afc78){if(_0x5afc78){logger[_0xe04e('0xa')](_0xe04e('0x64'),_0x5afc78['id']);switch(_0x97d938[_0xe04e('0x3d')]){case'integrationTab':logger[_0xe04e('0xa')]('[OUTBOUND]',_0xe04e('0x56'));return request({'uri':util['format'](_0xe04e('0x57'),_0x97d938['remoteUri'],_0x3382c5['id'],_0x5afc78['id']),'method':_0xe04e('0xf')});case _0xe04e('0x58'):logger[_0xe04e('0xa')](_0xe04e('0x62'),_0xe04e('0x59'));emit(util[_0xe04e('0xc')](_0xe04e('0x65'),_0x230229[_0xe04e('0x11')]),_0xe04e('0x66'),{'uri':util[_0xe04e('0xc')](_0xe04e('0x5a'),_0x97d938['remoteUri'][_0xe04e('0x5b')]('/api/v2',''),_0x5afc78['id'])});break;default:logger[_0xe04e('0x5d')](_0xe04e('0x62'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xe04e('0x67')](function(_0x41a895){logger[_0xe04e('0x5d')](_0xe04e('0x68'),util[_0xe04e('0x5f')](_0x41a895,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x4c9e10,_0x371419,_0x4a1aa7,_0x49b751,_0x53b19f,_0x58699e){var _0x3fcd0c,_0xd78582;_0x58699e[_0xe04e('0xe')]=intUtil['stripTrailingSlash'](_0x58699e[_0xe04e('0xe')]);_0x58699e['serverUrl']=intUtil[_0xe04e('0x4b')](_0x58699e[_0xe04e('0x4c')]);if(_0x53b19f&&_0x53b19f[_0xe04e('0x69')]){logger[_0xe04e('0xa')]('['+_0x371419[_0xe04e('0x6a')][_0xe04e('0x6b')]()+']',_0xe04e('0x4e'));_0x371419[_0xe04e('0x4f')]=util[_0xe04e('0xc')](_0xe04e('0x50'),_0x58699e[_0xe04e('0x4c')],_0x371419['uniqueid'],md5(_0x371419['uniqueid']));}else{_0x371419['recordingURL']='';}headers[_0xe04e('0x6c')]=getAuth(_0x58699e);return getUser(_0x58699e)[_0xe04e('0x1b')](function(_0x3864b3){_0x3fcd0c=_0x3864b3;logger[_0xe04e('0xa')](_0xe04e('0x53'),_0x3fcd0c['id']);return getEndUser(_0x58699e,_0x371419[_0xe04e('0x6d')],_0x371419[_0xe04e('0x54')]);})[_0xe04e('0x1b')](function(_0x4545de){_0xd78582=_0x4545de;logger[_0xe04e('0xa')](_0xe04e('0x6e'),_0xd78582['id']);return getTicket(_0x58699e,_0x3fcd0c,_0xd78582,_0x4a1aa7,_0x371419);})[_0xe04e('0x1b')](function(_0x14f3aa){if(_0x14f3aa){logger[_0xe04e('0xa')](_0xe04e('0x64'),_0x14f3aa['id']);}})[_0xe04e('0x67')](function(_0x20b735){logger[_0xe04e('0x5d')]('['+_0x371419[_0xe04e('0x6a')][_0xe04e('0x6b')]()+']'+_0xe04e('0x6f'),util[_0xe04e('0x5f')](_0x20b735,{'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 d9391d7..0eaacfe 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 _0x91f3=['idField','content','type','variable','variableName','customVariable','name','toLowerCase','indexOf','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','refresh_token','then','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','lead','Owner','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Timeout','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','details','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','user:%s','unmanaged','lastevent','com','calleridnum','toUpperCase','lodash','request-promise','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','emit','debug','[HTTP]','length','includes','string','picklist'];(function(_0x59c339,_0x5f287c){var _0x5a5efd=function(_0x4686db){while(--_0x4686db){_0x59c339['push'](_0x59c339['shift']());}};_0x5a5efd(++_0x5f287c);}(_0x91f3,0x19d));var _0x391f=function(_0x37ee5f,_0x512f25){_0x37ee5f=_0x37ee5f-0x0;var _0x45350e=_0x91f3[_0x37ee5f];return _0x45350e;};'use strict';var _=require(_0x391f('0x0'));var rp=require(_0x391f('0x1'));var md5=require('md5');var util=require('util');var intUtil=require(_0x391f('0x2'));var moment=require(_0x391f('0x3'));var Redis=require(_0x391f('0x4'));var BPromise=require(_0x391f('0x5'));var config=require(_0x391f('0x6'));var logger=require(_0x391f('0x7'))(_0x391f('0x8'));config[_0x391f('0x9')]=_[_0x391f('0xa')](config['redis'],{'host':_0x391f('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x391f('0x9')]));function emit(_0x5e1332,_0x5bd10a,_0x45620f){io['to'](_0x5e1332)[_0x391f('0xc')](_0x5bd10a,_0x45620f);}function request(_0x393e0f){logger[_0x391f('0xd')](_0x391f('0xe'),JSON['stringify'](_0x393e0f));return rp(_0x393e0f);}function getCustomFields(_0x514061,_0x5abdda){var _0x19dc38={};if(_0x514061[_0x391f('0xf')]>0x0){_['forEach'](_0x514061,function(_0x11f374){if(_[_0x391f('0x10')]([_0x391f('0x11'),_0x391f('0x12')],_0x11f374['type'])&&_0x11f374['idField']){_0x19dc38[_0x11f374[_0x391f('0x13')]]=_0x11f374[_0x391f('0x14')]['toString']();}else if(_0x11f374[_0x391f('0x15')]===_0x391f('0x16')&&_0x11f374[_0x391f('0x17')]&&_0x11f374[_0x391f('0x13')]&&_0x5abdda[_0x11f374[_0x391f('0x17')]]){_0x19dc38[_0x11f374[_0x391f('0x13')]]=_0x5abdda[_0x11f374[_0x391f('0x17')]]['toString']();}else if(_0x11f374['type']===_0x391f('0x18')&&_0x11f374['Variable']&&_0x11f374['Variable'][_0x391f('0x19')]&&_0x11f374[_0x391f('0x13')]&&_0x5abdda[_0x11f374['Variable'][_0x391f('0x19')][_0x391f('0x1a')]()]){_0x19dc38[_0x11f374[_0x391f('0x13')]]=_0x5abdda[_0x11f374['Variable']['name'][_0x391f('0x1a')]()]['toString']();}});}return _0x19dc38;}function getName(_0x89e2d0){if(_0x89e2d0[_0x391f('0x1b')]('\x20')>0x0){var _0x2d5b2c=_0x89e2d0['split'](/ (.+)/);if(_0x2d5b2c[0x1]){return _0x2d5b2c;}}return[_0x89e2d0,_0x89e2d0];}var accountsTokens={};function getAccessToken(_0x1bd262){return new Promise(function(_0x30f11f,_0x4ae0ea){if(!_[_0x391f('0x1c')](accountsTokens[_0x1bd262['id']])&&!_[_0x391f('0x1c')](accountsTokens[_0x1bd262['id']][_0x391f('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x1bd262['id']][_0x391f('0x1e')])){_0x30f11f(accountsTokens[_0x1bd262['id']][_0x391f('0x1d')]);}}var _0x374d53;switch(_0x1bd262[_0x391f('0x1f')]){case'US':_0x374d53=_0x391f('0x20');break;case'AU':_0x374d53=_0x391f('0x21');break;case'EU':_0x374d53=_0x391f('0x22');break;case'IN':_0x374d53='https://accounts.zoho.in';break;case'CN':_0x374d53='https://accounts.zoho.com.cn';break;default:_0x374d53=_0x391f('0x22');break;}var _0xa11297={'method':_0x391f('0x23'),'uri':_0x374d53+_0x391f('0x24'),'qs':{'refresh_token':_0x1bd262['refreshToken'],'client_id':_0x1bd262['clientId'],'client_secret':_0x1bd262[_0x391f('0x25')],'grant_type':_0x391f('0x26')},'json':!![]};return rp(_0xa11297)[_0x391f('0x27')](function(_0x196c8b){accountsTokens[_0x1bd262['id']]={'access_token':_0x196c8b[_0x391f('0x1d')],'expires_in':moment()['add'](_0x196c8b[_0x391f('0x1e')],'seconds')};_0x30f11f(_0x196c8b[_0x391f('0x1d')]);})[_0x391f('0x28')](function(_0xe83b1f){logger['error']('Failing\x20creating\x20the\x20access_token',_0xe83b1f[_0x391f('0x29')]);_0x4ae0ea(_0xe83b1f);});});}function getUser(_0x44362b,_0x1f40e6,_0x294bed,_0x5db9a5){logger[_0x391f('0x2a')](_0x391f('0x2b'));return request({'method':_0x391f('0x2c'),'uri':util[_0x391f('0x2d')](_0x391f('0x2e'),_0x1f40e6),'qs':{'type':_0x391f('0x2f')},'headers':{'Authorization':_0x391f('0x30')+_0x44362b},'json':!![]})['then'](function(_0x4b5172){if(_0x4b5172['users']){var _0x206238=-0x1;if(_[_0x391f('0x31')](_0x4b5172['users'])){if(!_[_0x391f('0x1c')](_0x5db9a5)){_0x206238=_[_0x391f('0x32')](_0x4b5172[_0x391f('0x33')],function(_0xfafb20){return _0xfafb20[_0x391f('0x34')]===_0x5db9a5;});}if(_0x206238>=0x0){logger[_0x391f('0x2a')](_0x391f('0x35'));}else{logger[_0x391f('0x2a')](_0x391f('0x36'));_0x206238=_[_0x391f('0x32')](_0x4b5172['users'],function(_0xb8a8ad){return _0xb8a8ad[_0x391f('0x37')][_0x391f('0x19')]==='Administrator';});}return _0x4b5172[_0x391f('0x33')][_0x206238];}else{if(_0x4b5172['user']['profile']['name']===_0x391f('0x38')){logger[_0x391f('0x2a')](_0x391f('0x36'));user=_0x4b5172[_0x391f('0x39')];return user;}else{logger[_0x391f('0x3a')](_0x391f('0x3b'),JSON['stringify'](_0x4b5172));throw new Error(_0x391f('0x3c')+JSON[_0x391f('0x3d')](_0x4b5172));}}}else{logger['error'](_0x391f('0x3b'),JSON[_0x391f('0x3d')](_0x4b5172));throw new Error(_0x391f('0x3c')+JSON[_0x391f('0x3d')](_0x4b5172));}})['catch'](function(_0x1d5955){console['error'](_0x1d5955);});}function getZohoUser(_0x21ad81,_0x4c5805){return new BPromise(function(_0x4c9ba6,_0x4e30c1){request(_0x21ad81)['then'](function(_0x44329d){var _0xa299d1=null;if(_0x44329d){_0xa299d1=_0x44329d[_0x391f('0x3e')][0x0];_0xa299d1[_0x391f('0x3f')]=_0x4c5805;}_0x4c9ba6(_0xa299d1);})[_0x391f('0x28')](function(_0x2d68eb){_0x4e30c1(_0x2d68eb);});});}function createEndUser(_0x3f4a40,_0x3f10cb,_0x4d7ede,_0x2bb3ae,_0x26ba15,_0x3896eb){var _0x4d7ede=getName(_0x4d7ede);return request({'method':_0x391f('0x23'),'uri':_0x391f('0x40')+_0x3f10cb+'/crm/v2/'+_[_0x391f('0x41')](_0x3896eb[_0x391f('0x42')])+'s','body':{'data':[{'Last_Name':_0x4d7ede[0x1],'First_Name':_0x4d7ede[0x0],'Phone':_0x2bb3ae,'Owner':{'name':!_[_0x391f('0x1c')](_0x26ba15[_0x391f('0x43')][_0x391f('0x19')])?_0x26ba15['role'][_0x391f('0x19')]:!_[_0x391f('0x1c')](_0x26ba15[_0x391f('0x44')])?_0x26ba15['first_name']+'\x20'+_0x26ba15[_0x391f('0x45')]:_0x26ba15['last_name'],'id':_0x26ba15['id']}}]},'headers':{'Authorization':_0x391f('0x30')+_0x3f4a40},'json':!![]})['then'](function(_0x10ae19){if(_0x10ae19&&_0x10ae19['data'][0x0][_0x391f('0x46')]==='SUCCESS'){var _0x15bb0d=_0x10ae19['data'][0x0]['details'];_0x15bb0d[_0x391f('0x3f')]=_[_0x391f('0x41')](_0x3896eb[_0x391f('0x42')])+'s';return _0x15bb0d;}logger['error'](_0x391f('0x3b'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x391f('0x3d')](data));})[_0x391f('0x28')](function(_0x2f0da8){console[_0x391f('0x47')](_0x391f('0x48'),_0x2f0da8);});}function getEndUser(_0x1ffa46,_0x389b62,_0x3db023,_0x310316,_0x2c76fa,_0x508c46,_0x5e7aef){var _0x4f9670={'method':'GET','uri':'','headers':{'Authorization':_0x391f('0x30')+_0x1ffa46},'json':!![]};switch(_0x5e7aef[_0x391f('0x49')]){case _0x391f('0x4a'):_0x4f9670[_0x391f('0x4b')]=_0x391f('0x40')+_0x389b62+_0x391f('0x4c')+_0x2c76fa+'))';return getZohoUser(_0x4f9670,_0x391f('0x4d'))[_0x391f('0x27')](function(_0x3b6156){if(_0x3b6156)return _0x3b6156;_0x4f9670[_0x391f('0x4b')]=_0x391f('0x40')+_0x389b62+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2c76fa+'))';return getZohoUser(_0x4f9670,_0x391f('0x4e'))[_0x391f('0x27')](function(_0x48cd4c){if(_0x48cd4c)return _0x48cd4c;if(_0x5e7aef['moduleCreate']!=_0x391f('0x4f')){return createEndUser(_0x1ffa46,_0x389b62,_0x310316,_0x2c76fa,_0x508c46,_0x5e7aef);}else{return{};}});});break;case _0x391f('0x50'):_0x4f9670[_0x391f('0x4b')]='https://www.zohoapis.'+_0x389b62+_0x391f('0x4c')+_0x2c76fa+'))';return getZohoUser(_0x4f9670,_0x391f('0x4d'))[_0x391f('0x27')](function(_0x52d070){if(_0x52d070)return _0x52d070;if(_0x5e7aef[_0x391f('0x42')]!=_0x391f('0x4f')){return createEndUser(_0x1ffa46,_0x389b62,_0x310316,_0x2c76fa,_0x508c46,_0x5e7aef);}else{return{};}});break;case _0x391f('0x51'):_0x4f9670[_0x391f('0x4b')]=_0x391f('0x40')+_0x389b62+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2c76fa+'))';return getZohoUser(_0x4f9670,_0x391f('0x4e'))[_0x391f('0x27')](function(_0x4d513e){if(_0x4d513e)return _0x4d513e;if(_0x5e7aef[_0x391f('0x42')]!='nothing'){return createEndUser(_0x1ffa46,_0x389b62,_0x310316,_0x2c76fa,_0x508c46,_0x5e7aef);}else{return{};}});break;}}function getCall(_0x42419a,_0xf2ea81,_0x2e615e,_0x2e1cf2,_0x5e2835,_0x51eb71,_0x1650f4,_0x317376){logger[_0x391f('0x2a')]('Creating\x20new\x20call...');var _0x47bf58={};_0x47bf58[_0x391f('0x52')]={'name':!_[_0x391f('0x1c')](_0x2e1cf2[_0x391f('0x43')][_0x391f('0x19')])&&!_['isNil'](_0x2e1cf2['profile']['name'])&&_0x2e1cf2[_0x391f('0x37')][_0x391f('0x19')]==='administrator'?_0x2e1cf2[_0x391f('0x43')][_0x391f('0x19')]:!_[_0x391f('0x1c')](_0x2e1cf2[_0x391f('0x44')])?_0x2e1cf2[_0x391f('0x44')]+'\x20'+_0x2e1cf2['last_name']:_0x2e1cf2['last_name'],'id':_0x2e1cf2['id']};_0x47bf58['Subject']=intUtil[_0x391f('0x53')](_0x51eb71[_0x391f('0x54')],_0x1650f4,'\x20');_0x47bf58[_0x391f('0x55')]=intUtil[_0x391f('0x53')](_0x51eb71['Descriptions'],_0x1650f4,'\x0a');if(_0x5e2835[_0x391f('0x3f')]===_0x391f('0x4d')){_0x47bf58[_0x391f('0x56')]={'name':!_[_0x391f('0x1c')](_0x5e2835[_0x391f('0x57')])?_0x5e2835[_0x391f('0x57')]:!_['isNil'](_0x5e2835[_0x391f('0x58')])?_0x5e2835[_0x391f('0x58')]+'\x20'+_0x5e2835[_0x391f('0x59')]:_0x5e2835[_0x391f('0x59')],'id':_0x5e2835['id']};}if(_0x5e2835[_0x391f('0x3f')]==='Leads'){_0x47bf58[_0x391f('0x5a')]={'name':!_['isNil'](_0x5e2835[_0x391f('0x57')])?_0x5e2835[_0x391f('0x57')]:!_[_0x391f('0x1c')](_0x5e2835[_0x391f('0x58')])?_0x5e2835[_0x391f('0x58')]+'\x20'+_0x5e2835[_0x391f('0x59')]:_0x5e2835['Last_Name'],'id':_0x5e2835['id']};_0x47bf58[_0x391f('0x5b')]=_[_0x391f('0x41')](_0x5e2835[_0x391f('0x3f')]);}if(_0x1650f4[_0x391f('0x5c')]){_0x47bf58[_0x391f('0x5d')]=moment[_0x391f('0x5e')](parseInt(_0x1650f4[_0x391f('0x5c')])*0x3e8)[_0x391f('0x2d')](_0x391f('0x5f'));}else if(_0x1650f4['answertime']&&_0x1650f4[_0x391f('0x60')]){_0x47bf58[_0x391f('0x5d')]=moment[_0x391f('0x5e')](moment(_0x1650f4[_0x391f('0x60')],_0x391f('0x61'))[_0x391f('0x62')](moment(_0x1650f4[_0x391f('0x63')],_0x391f('0x61'))))[_0x391f('0x2d')]('mm:ss');}switch(_0x1650f4['lastevent']){case _0x391f('0x64'):_0x47bf58[_0x391f('0x65')]=_0x391f('0x66');break;case _0x391f('0x67'):case _0x391f('0x68'):_0x47bf58[_0x391f('0x65')]=_0x391f('0x69');break;case _0x391f('0x6a'):_0x47bf58['Call_Result']=_0x391f('0x6b');break;case'abandoned':_0x47bf58['Call_Result']='Abandoned';break;case'timeout':_0x47bf58[_0x391f('0x65')]=_0x391f('0x6c');default:}_0x47bf58['Call_Start_Time']=(_0x317376===_0x391f('0x6d')?moment(_0x1650f4[_0x391f('0x63')])[_0x391f('0x2d')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x1650f4[_0x391f('0x6e')])[_0x391f('0x2d')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x391f('0x2d')](_0x391f('0x61'));_0x47bf58[_0x391f('0x6f')]=_0x317376||_0x391f('0x70');_0x47bf58=_[_0x391f('0x71')](_0x47bf58,getCustomFields(_0x51eb71['Fields'],_0x1650f4));return request({'method':_0x391f('0x23'),'uri':_0x391f('0x40')+_0xf2ea81+_0x391f('0x72'),'headers':{'Authorization':_0x391f('0x30')+_0x42419a},'body':{'data':[_0x47bf58]},'json':!![]})[_0x391f('0x27')](function(_0x2a93f0){if(_0x2a93f0&&_0x2a93f0[_0x391f('0x3e')][0x0][_0x391f('0x46')]==='SUCCESS'){logger[_0x391f('0x2a')]('Call\x20created!');return{'id':_0x2a93f0['data'][0x0][_0x391f('0x73')]['id']};}})[_0x391f('0x28')](function(_0x500b35){logger[_0x391f('0x2a')](_0x391f('0x74'),_0x500b35[_0x391f('0x29')]);console[_0x391f('0x47')](_0x391f('0x74'),_0x500b35);});}exports[_0x391f('0x75')]=function(_0x3c1712,_0x4d0f3d,_0x2b9821,_0x3933ef,_0x4d5d23,_0xc244d5){var _0x2575ff,_0x259be4,_0x17b1ab;_0xc244d5['host']=intUtil[_0x391f('0x76')](_0xc244d5[_0x391f('0x77')]);_0xc244d5[_0x391f('0x78')]=intUtil[_0x391f('0x76')](_0xc244d5['serverUrl']);if(_0x4d5d23&&_0x4d5d23[_0x391f('0x79')]){logger['info'](_0x391f('0x7a'),_0x391f('0x7b'));_0x4d0f3d[_0x391f('0x7c')]=_0xc244d5[_0x391f('0x78')]+_0x391f('0x7d')+_0x4d0f3d[_0x391f('0x7e')]+_0x391f('0x7f')+md5(_0x4d0f3d[_0x391f('0x7e')]);}else{_0x4d0f3d[_0x391f('0x7c')]='';}var _0x175769=_0xc244d5[_0x391f('0x77')]===_0x391f('0x80')?'eu':'com';return getAccessToken(_0xc244d5)[_0x391f('0x27')](function(_0x164ff1){_0x17b1ab=_0x164ff1;return getUser(_0x17b1ab,_0x175769,_0xc244d5,_0x3933ef[_0x391f('0x34')]);})[_0x391f('0x27')](function(_0x123a56){_0x2575ff=_0x123a56;logger[_0x391f('0x2a')]('The\x20User\x20ID\x20is:',_0x2575ff['id']);return getEndUser(_0x17b1ab,_0x175769,_0xc244d5,_0x4d0f3d[_0x391f('0x81')],_0x4d0f3d['calleridnum'],_0x2575ff,_0x2b9821);})[_0x391f('0x27')](function(_0x174a2a){_0x259be4=_0x174a2a;return getCall(_0x17b1ab,_0x175769,_0xc244d5,_0x2575ff,_0x259be4,_0x2b9821,_0x4d0f3d,_0x391f('0x70'));})[_0x391f('0x27')](function(_0x162d4e){if(_0x162d4e){logger[_0x391f('0x2a')](_0x391f('0x82'),_0x162d4e['id']);logger['info'](_0x391f('0x7a'),_0x391f('0x83'));emit(util[_0x391f('0x2d')]('user:%s',_0x3933ef['name']),_0x391f('0x84'),{'uri':_0x391f('0x85')+_0xc244d5[_0x391f('0x77')]+_0x391f('0x86')+_0x162d4e['id']});}})[_0x391f('0x28')](function(_0x3cc03c){logger['error'](_0x391f('0x7a'),JSON[_0x391f('0x3d')](_0x3cc03c));});};exports[_0x391f('0x6d')]=function(_0x3ee595,_0x27504d,_0x26ab73,_0x4a8386,_0x12a611,_0x28593f,_0x2dfc94){var _0x543647,_0x5421e8,_0x1ce299;_0x28593f[_0x391f('0x77')]=intUtil['stripTrailingSlash'](_0x28593f[_0x391f('0x77')]);_0x28593f[_0x391f('0x78')]=intUtil[_0x391f('0x76')](_0x28593f[_0x391f('0x78')]);if(_0x2dfc94&&_0x2dfc94[_0x391f('0x87')]&&_0x2dfc94[_0x391f('0x87')]!=='none'){logger[_0x391f('0x2a')](_0x391f('0x88'),_0x391f('0x7b'));_0x27504d[_0x391f('0x7c')]=_0x28593f[_0x391f('0x78')]+_0x391f('0x7d')+_0x27504d[_0x391f('0x7e')]+'/downloads?type=uniqueid&token='+md5(_0x27504d[_0x391f('0x7e')]);}var _0x3cf081=_0x28593f[_0x391f('0x77')]===_0x391f('0x80')?'eu':'com';return getAccessToken(_0x28593f)['then'](function(_0x5e233a){_0x1ce299=_0x5e233a;return getUser(_0x1ce299,_0x3cf081,_0x28593f,_0x4a8386[_0x391f('0x34')]);})[_0x391f('0x27')](function(_0x2c8dc2){_0x543647=_0x2c8dc2;logger['info'](_0x391f('0x89'),_0x543647['id']);return getEndUser(_0x1ce299,_0x3cf081,_0x28593f,_0x27504d['destcalleridname'],_0x27504d['destcalleridnum'],_0x543647,_0x26ab73);})[_0x391f('0x27')](function(_0x20d097){_0x5421e8=_0x20d097;return getCall(_0x1ce299,_0x3cf081,_0x28593f,_0x543647,_0x5421e8,_0x26ab73,_0x27504d,'Outbound');})[_0x391f('0x27')](function(_0x56b5f6){if(_0x56b5f6){logger['info'](_0x391f('0x82'),_0x56b5f6['id']);logger[_0x391f('0x2a')](_0x391f('0x88'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x391f('0x2d')](_0x391f('0x8a'),_0x4a8386['name']),'trigger:browser:url',{'uri':_0x391f('0x85')+_0x28593f[_0x391f('0x77')]+_0x391f('0x86')+_0x56b5f6['id']});}})[_0x391f('0x28')](function(_0x3fbecc){logger[_0x391f('0x3a')]('[OUTBOUND]',JSON[_0x391f('0x3d')](_0x3fbecc));});};exports[_0x391f('0x8b')]=function(_0x5a205d,_0x113e61,_0x1625ea,_0x127473,_0x381db6,_0x168ee6){var _0x50f9ed,_0x5c1ef7,_0x4c3264;_0x168ee6[_0x391f('0x77')]=intUtil[_0x391f('0x76')](_0x168ee6[_0x391f('0x77')]);_0x168ee6['serverUrl']=intUtil[_0x391f('0x76')](_0x168ee6[_0x391f('0x78')]);if(_0x381db6&&_0x381db6[_0x391f('0x79')]){logger['info']('['+_0x113e61[_0x391f('0x8c')]['toUpperCase']()+']',_0x391f('0x7b'));_0x113e61[_0x391f('0x7c')]=_0x168ee6[_0x391f('0x78')]+_0x391f('0x7d')+_0x113e61[_0x391f('0x7e')]+_0x391f('0x7f')+md5(_0x113e61[_0x391f('0x7e')]);}else{_0x113e61[_0x391f('0x7c')]='';}var _0x46796f=_0x168ee6[_0x391f('0x77')]==='zoho.eu'?'eu':_0x391f('0x8d');return getAccessToken(_0x168ee6)[_0x391f('0x27')](function(_0x2129c7){_0x4c3264=_0x2129c7;return getUser(_0x4c3264,_0x46796f,_0x168ee6);})['then'](function(_0x5b9297){_0x50f9ed=_0x5b9297;logger[_0x391f('0x2a')]('The\x20User\x20ID\x20is:',_0x50f9ed['id']);return getEndUser(_0x4c3264,_0x46796f,_0x168ee6,_0x113e61[_0x391f('0x81')],_0x113e61[_0x391f('0x8e')],_0x50f9ed,_0x1625ea);})[_0x391f('0x27')](function(_0x1f370b){_0x5c1ef7=_0x1f370b;return getCall(_0x4c3264,_0x46796f,_0x168ee6,_0x50f9ed,_0x5c1ef7,_0x1625ea,_0x113e61,'Inbound');})[_0x391f('0x27')](function(_0x288d57){if(_0x288d57){logger[_0x391f('0x2a')]('The\x20Call\x20ID\x20is:',_0x288d57['id']);}})[_0x391f('0x28')](function(_0x33ffc1){logger[_0x391f('0x3a')]('['+_0x113e61[_0x391f('0x8c')][_0x391f('0x8f')]()+']',JSON[_0x391f('0x3d')](_0x33ffc1));});}; \ No newline at end of file +var _0x2d65=['What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','utc','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','Call_Result','Called','connect','Answered','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','queue','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','stripTrailingSlash','recordingFormat','[OUTBOUND]','zoho.eu','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','unmanaged','calleridname','lodash','request-promise','util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','string','picklist','type','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','then','add','seconds','stack','Search\x20user','GET','format','Zoho-oauthtoken\x20','isArrayLikeObject','users','email','info','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Full_Name','First_Name','Last_Name'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x2d65,0x1f2));var _0x52d6=function(_0x10493a,_0x133be3){_0x10493a=_0x10493a-0x0;var _0x386caf=_0x2d65[_0x10493a];return _0x386caf;};'use strict';var _=require(_0x52d6('0x0'));var rp=require(_0x52d6('0x1'));var md5=require('md5');var util=require(_0x52d6('0x2'));var intUtil=require('./util');var moment=require(_0x52d6('0x3'));var Redis=require(_0x52d6('0x4'));var BPromise=require(_0x52d6('0x5'));var config=require(_0x52d6('0x6'));var logger=require('../../../../config/logger')(_0x52d6('0x7'));config[_0x52d6('0x8')]=_[_0x52d6('0x9')](config[_0x52d6('0x8')],{'host':_0x52d6('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x52d6('0x8')]));function emit(_0x18b4ab,_0x5c04f3,_0x4a5e92){io['to'](_0x18b4ab)[_0x52d6('0xb')](_0x5c04f3,_0x4a5e92);}function request(_0x19f6ca){logger[_0x52d6('0xc')](_0x52d6('0xd'),JSON[_0x52d6('0xe')](_0x19f6ca));return rp(_0x19f6ca);}function getCustomFields(_0x20739c,_0xc034d0){var _0x6d1f96={};if(_0x20739c[_0x52d6('0xf')]>0x0){_['forEach'](_0x20739c,function(_0x56294e){if(_['includes']([_0x52d6('0x10'),_0x52d6('0x11')],_0x56294e[_0x52d6('0x12')])&&_0x56294e['idField']){_0x6d1f96[_0x56294e['idField']]=_0x56294e['content'][_0x52d6('0x13')]();}else if(_0x56294e[_0x52d6('0x12')]===_0x52d6('0x14')&&_0x56294e[_0x52d6('0x15')]&&_0x56294e['idField']&&_0xc034d0[_0x56294e[_0x52d6('0x15')]]){_0x6d1f96[_0x56294e[_0x52d6('0x16')]]=_0xc034d0[_0x56294e[_0x52d6('0x15')]][_0x52d6('0x13')]();}else if(_0x56294e[_0x52d6('0x12')]===_0x52d6('0x17')&&_0x56294e[_0x52d6('0x18')]&&_0x56294e[_0x52d6('0x18')][_0x52d6('0x19')]&&_0x56294e['idField']&&_0xc034d0[_0x56294e[_0x52d6('0x18')][_0x52d6('0x19')][_0x52d6('0x1a')]()]){_0x6d1f96[_0x56294e[_0x52d6('0x16')]]=_0xc034d0[_0x56294e[_0x52d6('0x18')]['name'][_0x52d6('0x1a')]()][_0x52d6('0x13')]();}});}return _0x6d1f96;}function getName(_0x19004e){if(_0x19004e['indexOf']('\x20')>0x0){var _0x2cce54=_0x19004e['split'](/ (.+)/);if(_0x2cce54[0x1]){return _0x2cce54;}}return[_0x19004e,_0x19004e];}var accountsTokens={};function getAccessToken(_0x52745b){return new Promise(function(_0x499681,_0x40a2f0){if(!_[_0x52d6('0x1b')](accountsTokens[_0x52745b['id']])&&!_[_0x52d6('0x1b')](accountsTokens[_0x52745b['id']][_0x52d6('0x1c')])){if(moment()[_0x52d6('0x1d')](accountsTokens[_0x52745b['id']][_0x52d6('0x1e')])){_0x499681(accountsTokens[_0x52745b['id']][_0x52d6('0x1c')]);}}var _0x142189;switch(_0x52745b[_0x52d6('0x1f')]){case'US':_0x142189=_0x52d6('0x20');break;case'AU':_0x142189=_0x52d6('0x21');break;case'EU':_0x142189=_0x52d6('0x22');break;case'IN':_0x142189=_0x52d6('0x23');break;case'CN':_0x142189=_0x52d6('0x24');break;default:_0x142189=_0x52d6('0x22');break;}var _0x4d3199={'method':_0x52d6('0x25'),'uri':_0x142189+_0x52d6('0x26'),'qs':{'refresh_token':_0x52745b[_0x52d6('0x27')],'client_id':_0x52745b['clientId'],'client_secret':_0x52745b[_0x52d6('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4d3199)[_0x52d6('0x29')](function(_0xc4e459){accountsTokens[_0x52745b['id']]={'access_token':_0xc4e459['access_token'],'expires_in':moment()[_0x52d6('0x2a')](_0xc4e459['expires_in'],_0x52d6('0x2b'))};_0x499681(_0xc4e459[_0x52d6('0x1c')]);})['catch'](function(_0x3bfa2a){logger['error']('Failing\x20creating\x20the\x20access_token',_0x3bfa2a[_0x52d6('0x2c')]);_0x40a2f0(_0x3bfa2a);});});}function getUser(_0xc94b72,_0x4956e3,_0x38e028,_0x24c5a5){logger['info'](_0x52d6('0x2d'));return request({'method':_0x52d6('0x2e'),'uri':util[_0x52d6('0x2f')]('https://www.zohoapis.%s/crm/v2/users',_0x4956e3),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x52d6('0x30')+_0xc94b72},'json':!![]})[_0x52d6('0x29')](function(_0x4c209e){if(_0x4c209e['users']){var _0x12844a=-0x1;if(_[_0x52d6('0x31')](_0x4c209e[_0x52d6('0x32')])){if(!_['isNil'](_0x24c5a5)){_0x12844a=_['findIndex'](_0x4c209e[_0x52d6('0x32')],function(_0x55460d){return _0x55460d[_0x52d6('0x33')]===_0x24c5a5;});}if(_0x12844a>=0x0){logger[_0x52d6('0x34')]('Agent\x20found!');}else{logger[_0x52d6('0x34')](_0x52d6('0x35'));_0x12844a=_[_0x52d6('0x36')](_0x4c209e[_0x52d6('0x32')],function(_0x2c83c4){return _0x2c83c4[_0x52d6('0x37')][_0x52d6('0x19')]===_0x52d6('0x38');});}return _0x4c209e[_0x52d6('0x32')][_0x12844a];}else{if(_0x4c209e['user'][_0x52d6('0x37')][_0x52d6('0x19')]===_0x52d6('0x38')){logger[_0x52d6('0x34')](_0x52d6('0x35'));user=_0x4c209e['user'];return user;}else{logger['error'](_0x52d6('0x39'),JSON['stringify'](_0x4c209e));throw new Error(_0x52d6('0x3a')+JSON['stringify'](_0x4c209e));}}}else{logger[_0x52d6('0x3b')](_0x52d6('0x39'),JSON[_0x52d6('0xe')](_0x4c209e));throw new Error(_0x52d6('0x3a')+JSON[_0x52d6('0xe')](_0x4c209e));}})[_0x52d6('0x3c')](function(_0xd67416){console[_0x52d6('0x3b')](_0xd67416);});}function getZohoUser(_0xfd5429,_0x4192bb){return new BPromise(function(_0x1ba02f,_0x1661c0){request(_0xfd5429)[_0x52d6('0x29')](function(_0x4c501d){var _0x28c281=null;if(_0x4c501d){_0x28c281=_0x4c501d['data'][0x0];_0x28c281['enduserType']=_0x4192bb;}_0x1ba02f(_0x28c281);})['catch'](function(_0x27cf5b){_0x1661c0(_0x27cf5b);});});}function createEndUser(_0x279dd1,_0x899191,_0x3b3a4a,_0x55312b,_0x5828c5,_0x508816){var _0x3b3a4a=getName(_0x3b3a4a);return request({'method':_0x52d6('0x25'),'uri':_0x52d6('0x3d')+_0x899191+_0x52d6('0x3e')+_[_0x52d6('0x3f')](_0x508816[_0x52d6('0x40')])+'s','body':{'data':[{'Last_Name':_0x3b3a4a[0x1],'First_Name':_0x3b3a4a[0x0],'Phone':_0x55312b,'Owner':{'name':!_[_0x52d6('0x1b')](_0x5828c5[_0x52d6('0x41')][_0x52d6('0x19')])?_0x5828c5[_0x52d6('0x41')][_0x52d6('0x19')]:!_[_0x52d6('0x1b')](_0x5828c5[_0x52d6('0x42')])?_0x5828c5[_0x52d6('0x42')]+'\x20'+_0x5828c5['last_name']:_0x5828c5[_0x52d6('0x43')],'id':_0x5828c5['id']}}]},'headers':{'Authorization':_0x52d6('0x30')+_0x279dd1},'json':!![]})[_0x52d6('0x29')](function(_0x3fb362){if(_0x3fb362&&_0x3fb362[_0x52d6('0x44')][0x0][_0x52d6('0x45')]===_0x52d6('0x46')){var _0x574afd=_0x3fb362[_0x52d6('0x44')][0x0][_0x52d6('0x47')];_0x574afd[_0x52d6('0x48')]=_['startCase'](_0x508816[_0x52d6('0x40')])+'s';return _0x574afd;}logger[_0x52d6('0x3b')](_0x52d6('0x39'),JSON['stringify'](data));throw new Error(_0x52d6('0x49')+JSON[_0x52d6('0xe')](data));})[_0x52d6('0x3c')](function(_0xab4d9b){console[_0x52d6('0x4a')](_0x52d6('0x4b'),_0xab4d9b);});}function getEndUser(_0x3b6ebf,_0x4cf743,_0x254324,_0xf60ea9,_0x57661e,_0x298df5,_0x28be5b){var _0x488e1e={'method':_0x52d6('0x2e'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3b6ebf},'json':!![]};switch(_0x28be5b[_0x52d6('0x4c')]){case'contact_lead':_0x488e1e[_0x52d6('0x4d')]=_0x52d6('0x3d')+_0x4cf743+_0x52d6('0x4e')+_0x57661e+'))';return getZohoUser(_0x488e1e,_0x52d6('0x4f'))[_0x52d6('0x29')](function(_0x321bc9){if(_0x321bc9)return _0x321bc9;_0x488e1e[_0x52d6('0x4d')]=_0x52d6('0x3d')+_0x4cf743+_0x52d6('0x50')+_0x57661e+'))';return getZohoUser(_0x488e1e,_0x52d6('0x51'))[_0x52d6('0x29')](function(_0x378eec){if(_0x378eec)return _0x378eec;if(_0x28be5b['moduleCreate']!=_0x52d6('0x52')){return createEndUser(_0x3b6ebf,_0x4cf743,_0xf60ea9,_0x57661e,_0x298df5,_0x28be5b);}else{return{};}});});break;case'contact':_0x488e1e[_0x52d6('0x4d')]=_0x52d6('0x3d')+_0x4cf743+_0x52d6('0x4e')+_0x57661e+'))';return getZohoUser(_0x488e1e,_0x52d6('0x4f'))[_0x52d6('0x29')](function(_0x4a8690){if(_0x4a8690)return _0x4a8690;if(_0x28be5b[_0x52d6('0x40')]!=_0x52d6('0x52')){return createEndUser(_0x3b6ebf,_0x4cf743,_0xf60ea9,_0x57661e,_0x298df5,_0x28be5b);}else{return{};}});break;case _0x52d6('0x53'):_0x488e1e[_0x52d6('0x4d')]=_0x52d6('0x3d')+_0x4cf743+_0x52d6('0x50')+_0x57661e+'))';return getZohoUser(_0x488e1e,_0x52d6('0x51'))[_0x52d6('0x29')](function(_0x25b168){if(_0x25b168)return _0x25b168;if(_0x28be5b[_0x52d6('0x40')]!=_0x52d6('0x52')){return createEndUser(_0x3b6ebf,_0x4cf743,_0xf60ea9,_0x57661e,_0x298df5,_0x28be5b);}else{return{};}});break;}}function getCall(_0x4cc4c5,_0x5c40e1,_0x39dd3e,_0x10d960,_0x5db1f1,_0x6f25ce,_0x440d87,_0x4e7d8b){logger[_0x52d6('0x34')](_0x52d6('0x54'));var _0x41d7d7={};_0x41d7d7[_0x52d6('0x55')]={'name':!_[_0x52d6('0x1b')](_0x10d960[_0x52d6('0x41')]['name'])&&!_[_0x52d6('0x1b')](_0x10d960[_0x52d6('0x37')][_0x52d6('0x19')])&&_0x10d960[_0x52d6('0x37')][_0x52d6('0x19')]===_0x52d6('0x56')?_0x10d960[_0x52d6('0x41')][_0x52d6('0x19')]:!_[_0x52d6('0x1b')](_0x10d960[_0x52d6('0x42')])?_0x10d960[_0x52d6('0x42')]+'\x20'+_0x10d960[_0x52d6('0x43')]:_0x10d960[_0x52d6('0x43')],'id':_0x10d960['id']};_0x41d7d7[_0x52d6('0x57')]=intUtil[_0x52d6('0x58')](_0x6f25ce[_0x52d6('0x59')],_0x440d87,'\x20');_0x41d7d7[_0x52d6('0x5a')]=intUtil[_0x52d6('0x58')](_0x6f25ce['Descriptions'],_0x440d87,'\x0a');if(_0x5db1f1[_0x52d6('0x48')]==='Contacts'){_0x41d7d7['Who_Id']={'name':!_[_0x52d6('0x1b')](_0x5db1f1[_0x52d6('0x5b')])?_0x5db1f1[_0x52d6('0x5b')]:!_[_0x52d6('0x1b')](_0x5db1f1[_0x52d6('0x5c')])?_0x5db1f1[_0x52d6('0x5c')]+'\x20'+_0x5db1f1[_0x52d6('0x5d')]:_0x5db1f1[_0x52d6('0x5d')],'id':_0x5db1f1['id']};}if(_0x5db1f1[_0x52d6('0x48')]===_0x52d6('0x51')){_0x41d7d7[_0x52d6('0x5e')]={'name':!_['isNil'](_0x5db1f1[_0x52d6('0x5b')])?_0x5db1f1['Full_Name']:!_['isNil'](_0x5db1f1['First_Name'])?_0x5db1f1[_0x52d6('0x5c')]+'\x20'+_0x5db1f1[_0x52d6('0x5d')]:_0x5db1f1[_0x52d6('0x5d')],'id':_0x5db1f1['id']};_0x41d7d7[_0x52d6('0x5f')]=_['startCase'](_0x5db1f1[_0x52d6('0x48')]);}if(_0x440d87[_0x52d6('0x60')]){_0x41d7d7[_0x52d6('0x61')]=moment['utc'](parseInt(_0x440d87[_0x52d6('0x60')])*0x3e8)['format'](_0x52d6('0x62'));}else if(_0x440d87[_0x52d6('0x63')]&&_0x440d87[_0x52d6('0x64')]){_0x41d7d7[_0x52d6('0x61')]=moment[_0x52d6('0x65')](moment(_0x440d87[_0x52d6('0x64')],'YYYY-MM-DDTHH:mm:ss')['diff'](moment(_0x440d87[_0x52d6('0x66')],_0x52d6('0x67'))))[_0x52d6('0x2f')](_0x52d6('0x62'));}switch(_0x440d87[_0x52d6('0x68')]){case'called':_0x41d7d7[_0x52d6('0x69')]=_0x52d6('0x6a');break;case'complete':case _0x52d6('0x6b'):_0x41d7d7['Call_Result']=_0x52d6('0x6c');break;case'rejected':_0x41d7d7[_0x52d6('0x69')]=_0x52d6('0x6d');break;case _0x52d6('0x6e'):_0x41d7d7[_0x52d6('0x69')]=_0x52d6('0x6f');break;case _0x52d6('0x70'):_0x41d7d7[_0x52d6('0x69')]=_0x52d6('0x71');default:}_0x41d7d7[_0x52d6('0x72')]=(_0x4e7d8b===_0x52d6('0x73')?moment(_0x440d87[_0x52d6('0x66')])[_0x52d6('0x2f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x440d87[_0x52d6('0x74')])[_0x52d6('0x2f')](_0x52d6('0x67')))||moment()[_0x52d6('0x2f')](_0x52d6('0x67'));_0x41d7d7[_0x52d6('0x75')]=_0x4e7d8b||_0x52d6('0x76');_0x41d7d7=_[_0x52d6('0x77')](_0x41d7d7,getCustomFields(_0x6f25ce['Fields'],_0x440d87));return request({'method':_0x52d6('0x25'),'uri':_0x52d6('0x3d')+_0x5c40e1+_0x52d6('0x78'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4cc4c5},'body':{'data':[_0x41d7d7]},'json':!![]})[_0x52d6('0x29')](function(_0x18c6c2){if(_0x18c6c2&&_0x18c6c2['data'][0x0][_0x52d6('0x45')]==='SUCCESS'){logger[_0x52d6('0x34')](_0x52d6('0x79'));return{'id':_0x18c6c2[_0x52d6('0x44')][0x0][_0x52d6('0x47')]['id']};}})[_0x52d6('0x3c')](function(_0x570a11){logger['info']('err',_0x570a11[_0x52d6('0x2c')]);console['log']('err',_0x570a11);});}exports[_0x52d6('0x7a')]=function(_0x4f89e9,_0x560b87,_0x4f7280,_0x405df7,_0x1b71a1,_0x5a737c){var _0x573d09,_0x51ea86,_0x5c921f;_0x5a737c[_0x52d6('0x7b')]=intUtil['stripTrailingSlash'](_0x5a737c[_0x52d6('0x7b')]);_0x5a737c['serverUrl']=intUtil['stripTrailingSlash'](_0x5a737c[_0x52d6('0x7c')]);if(_0x1b71a1&&_0x1b71a1[_0x52d6('0x7d')]){logger[_0x52d6('0x34')]('[QUEUE]',_0x52d6('0x7e'));_0x560b87[_0x52d6('0x7f')]=_0x5a737c[_0x52d6('0x7c')]+'/api/voice/recordings/'+_0x560b87[_0x52d6('0x80')]+_0x52d6('0x81')+md5(_0x560b87['uniqueid']);}else{_0x560b87[_0x52d6('0x7f')]='';}var _0x2c2cf1=_0x5a737c[_0x52d6('0x7b')]==='zoho.eu'?'eu':_0x52d6('0x82');return getAccessToken(_0x5a737c)[_0x52d6('0x29')](function(_0x53c47a){_0x5c921f=_0x53c47a;return getUser(_0x5c921f,_0x2c2cf1,_0x5a737c,_0x405df7[_0x52d6('0x33')]);})[_0x52d6('0x29')](function(_0x495179){_0x573d09=_0x495179;logger[_0x52d6('0x34')]('The\x20User\x20ID\x20is:',_0x573d09['id']);return getEndUser(_0x5c921f,_0x2c2cf1,_0x5a737c,_0x560b87['calleridname'],_0x560b87[_0x52d6('0x83')],_0x573d09,_0x4f7280);})[_0x52d6('0x29')](function(_0x364dee){_0x51ea86=_0x364dee;return getCall(_0x5c921f,_0x2c2cf1,_0x5a737c,_0x573d09,_0x51ea86,_0x4f7280,_0x560b87,'Inbound');})[_0x52d6('0x29')](function(_0xd08086){if(_0xd08086){logger['info'](_0x52d6('0x84'),_0xd08086['id']);logger[_0x52d6('0x34')](_0x52d6('0x85'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x52d6('0x2f')](_0x52d6('0x86'),_0x405df7[_0x52d6('0x19')]),_0x52d6('0x87'),{'uri':_0x52d6('0x88')+_0x5a737c[_0x52d6('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0xd08086['id']});}})[_0x52d6('0x3c')](function(_0x51aa37){logger[_0x52d6('0x3b')](_0x52d6('0x85'),JSON['stringify'](_0x51aa37));});};exports[_0x52d6('0x73')]=function(_0x578fa4,_0x5e8943,_0x209683,_0x1eab0c,_0x34b169,_0x5291fa,_0x1c35ae){var _0x46a5de,_0x2d1230,_0x2de909;_0x5291fa[_0x52d6('0x7b')]=intUtil[_0x52d6('0x89')](_0x5291fa[_0x52d6('0x7b')]);_0x5291fa['serverUrl']=intUtil[_0x52d6('0x89')](_0x5291fa['serverUrl']);if(_0x1c35ae&&_0x1c35ae[_0x52d6('0x8a')]&&_0x1c35ae[_0x52d6('0x8a')]!=='none'){logger[_0x52d6('0x34')](_0x52d6('0x8b'),_0x52d6('0x7e'));_0x5e8943[_0x52d6('0x7f')]=_0x5291fa[_0x52d6('0x7c')]+'/api/voice/recordings/'+_0x5e8943[_0x52d6('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x5e8943[_0x52d6('0x80')]);}var _0x566b87=_0x5291fa[_0x52d6('0x7b')]===_0x52d6('0x8c')?'eu':_0x52d6('0x82');return getAccessToken(_0x5291fa)[_0x52d6('0x29')](function(_0x8a7430){_0x2de909=_0x8a7430;return getUser(_0x2de909,_0x566b87,_0x5291fa,_0x1eab0c[_0x52d6('0x33')]);})['then'](function(_0x509ac4){_0x46a5de=_0x509ac4;logger[_0x52d6('0x34')](_0x52d6('0x8d'),_0x46a5de['id']);return getEndUser(_0x2de909,_0x566b87,_0x5291fa,_0x5e8943[_0x52d6('0x8e')],_0x5e8943[_0x52d6('0x8f')],_0x46a5de,_0x209683);})[_0x52d6('0x29')](function(_0x594480){_0x2d1230=_0x594480;return getCall(_0x2de909,_0x566b87,_0x5291fa,_0x46a5de,_0x2d1230,_0x209683,_0x5e8943,'Outbound');})[_0x52d6('0x29')](function(_0x384793){if(_0x384793){logger[_0x52d6('0x34')](_0x52d6('0x84'),_0x384793['id']);logger[_0x52d6('0x34')](_0x52d6('0x8b'),_0x52d6('0x90'));emit(util[_0x52d6('0x2f')]('user:%s',_0x1eab0c['name']),_0x52d6('0x87'),{'uri':_0x52d6('0x88')+_0x5291fa['host']+_0x52d6('0x91')+_0x384793['id']});}})[_0x52d6('0x3c')](function(_0x46d333){logger[_0x52d6('0x3b')](_0x52d6('0x8b'),JSON[_0x52d6('0xe')](_0x46d333));});};exports[_0x52d6('0x92')]=function(_0x39516f,_0x45f491,_0x42ddc1,_0x4ce609,_0x267ecd,_0xcb144a){var _0x4b532c,_0x55a663,_0x523a35;_0xcb144a[_0x52d6('0x7b')]=intUtil[_0x52d6('0x89')](_0xcb144a[_0x52d6('0x7b')]);_0xcb144a[_0x52d6('0x7c')]=intUtil['stripTrailingSlash'](_0xcb144a['serverUrl']);if(_0x267ecd&&_0x267ecd[_0x52d6('0x7d')]){logger[_0x52d6('0x34')]('['+_0x45f491[_0x52d6('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x45f491[_0x52d6('0x7f')]=_0xcb144a[_0x52d6('0x7c')]+'/api/voice/recordings/'+_0x45f491['uniqueid']+_0x52d6('0x81')+md5(_0x45f491[_0x52d6('0x80')]);}else{_0x45f491[_0x52d6('0x7f')]='';}var _0x249775=_0xcb144a[_0x52d6('0x7b')]==='zoho.eu'?'eu':_0x52d6('0x82');return getAccessToken(_0xcb144a)[_0x52d6('0x29')](function(_0x5b4951){_0x523a35=_0x5b4951;return getUser(_0x523a35,_0x249775,_0xcb144a);})[_0x52d6('0x29')](function(_0x1bb535){_0x4b532c=_0x1bb535;logger['info'](_0x52d6('0x8d'),_0x4b532c['id']);return getEndUser(_0x523a35,_0x249775,_0xcb144a,_0x45f491[_0x52d6('0x93')],_0x45f491['calleridnum'],_0x4b532c,_0x42ddc1);})[_0x52d6('0x29')](function(_0xfdf313){_0x55a663=_0xfdf313;return getCall(_0x523a35,_0x249775,_0xcb144a,_0x4b532c,_0x55a663,_0x42ddc1,_0x45f491,'Inbound');})[_0x52d6('0x29')](function(_0xecee41){if(_0xecee41){logger[_0x52d6('0x34')]('The\x20Call\x20ID\x20is:',_0xecee41['id']);}})[_0x52d6('0x3c')](function(_0x3f6d9f){logger[_0x52d6('0x3b')]('['+_0x45f491['lastevent']['toUpperCase']()+']',JSON[_0x52d6('0xe')](_0x3f6d9f));});}; \ 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 36b454c..d9dcea7 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 _0xfb02=['exec','error','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','data2','data3','render'];(function(_0x507af7,_0x5cfb83){var _0x496d57=function(_0x36f0c3){while(--_0x36f0c3){_0x507af7['push'](_0x507af7['shift']());}};_0x496d57(++_0x5cfb83);}(_0xfb02,0xb9));var _0x2fb0=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0xfb02[_0x11946c];return _0x383935;};'use strict';var util=require(_0x2fb0('0x0'));var sh=require(_0x2fb0('0x1'));var Mustache=require(_0x2fb0('0x2'));var logger=require(_0x2fb0('0x3'))('trigger');exports['exec']=function(_0x267d43,_0x1d09d5){var _0x20b591=_0x267d43[_0x2fb0('0x4')]?_0x267d43['data2']:'Script';var _0x4feb68=_0x267d43[_0x2fb0('0x5')]?Mustache[_0x2fb0('0x6')](_0x267d43['data3'],_0x1d09d5):_0x1d09d5;sh[_0x2fb0('0x7')](_0x4feb68,function(_0x440822,_0x32ce76,_0x250436){if(_0x440822!==0x0){logger[_0x2fb0('0x8')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x20b591,_0x4feb68,_0x440822,_0x250436));}else{logger[_0x2fb0('0x9')](util[_0x2fb0('0xa')](_0x2fb0('0xb'),_0x20b591,_0x4feb68,_0x32ce76));}});}; \ No newline at end of file +var _0x490d=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','util','shelljs','trigger','data2','Script','data3','render','exec','error','format'];(function(_0x4e3637,_0x4eb884){var _0x4ccb46=function(_0x7240c4){while(--_0x7240c4){_0x4e3637['push'](_0x4e3637['shift']());}};_0x4ccb46(++_0x4eb884);}(_0x490d,0x109));var _0xd490=function(_0x3aec72,_0x25d2a1){_0x3aec72=_0x3aec72-0x0;var _0x3494cb=_0x490d[_0x3aec72];return _0x3494cb;};'use strict';var util=require(_0xd490('0x0'));var sh=require(_0xd490('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xd490('0x2'));exports['exec']=function(_0x228062,_0xb45b87){var _0x3f8dbf=_0x228062[_0xd490('0x3')]?_0x228062[_0xd490('0x3')]:_0xd490('0x4');var _0x2a3a44=_0x228062[_0xd490('0x5')]?Mustache[_0xd490('0x6')](_0x228062[_0xd490('0x5')],_0xb45b87):_0xb45b87;sh[_0xd490('0x7')](_0x2a3a44,function(_0x877f0f,_0x27c16f,_0x24680d){if(_0x877f0f!==0x0){logger[_0xd490('0x8')](util[_0xd490('0x9')](_0xd490('0xa'),_0x3f8dbf,_0x2a3a44,_0x877f0f,_0x24680d));}else{logger['info'](util[_0xd490('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x3f8dbf,_0x2a3a44,_0x27c16f));}});}; \ 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 8752405..c356abc 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 _0x6653=['stack','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','headers','parse','data6','GET','DELETE','PUT','data7'];(function(_0x22e571,_0x443a32){var _0x5b3f1c=function(_0x52a0ce){while(--_0x52a0ce){_0x22e571['push'](_0x22e571['shift']());}};_0x5b3f1c(++_0x443a32);}(_0x6653,0xba));var _0x3665=function(_0x166f1e,_0x233cbe){_0x166f1e=_0x166f1e-0x0;var _0xe3360a=_0x6653[_0x166f1e];return _0xe3360a;};'use strict';var rp=require(_0x3665('0x0'));var util=require(_0x3665('0x1'));var _=require(_0x3665('0x2'));var Mustache=require(_0x3665('0x3'));var logger=require(_0x3665('0x4'))(_0x3665('0x5'));exports['exec']=function(_0x4f0438,_0x147285){var _0x8891ab,_0x16c357;var _0x507868={'method':_0x4f0438[_0x3665('0x6')][_0x3665('0x7')](),'uri':Mustache[_0x3665('0x8')](_0x4f0438[_0x3665('0x9')],_0x147285),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4f0438[_0x3665('0xa')])==='number'&&parseInt(_0x4f0438[_0x3665('0xa')])>=0x1&&parseInt(_0x4f0438[_0x3665('0xa')])<=0xa?parseInt(_0x4f0438[_0x3665('0xa')])*0x3e8:0x5*0x3e8};try{_0x507868[_0x3665('0xb')]=_0x4f0438['data6']?JSON[_0x3665('0xc')](Mustache[_0x3665('0x8')](_0x4f0438[_0x3665('0xd')],_0x147285)):{};}catch(_0x50364f){logger['error'](_0x50364f['stack']);}switch(_0x4f0438['data1'][_0x3665('0x7')]()){case _0x3665('0xe'):case _0x3665('0xf'):_0x8891ab=null;_0x507868['qs']=_0x147285;break;case'POST':case _0x3665('0x10'):if(_0x4f0438['data7']){try{_0x8891ab=JSON[_0x3665('0xc')](Mustache['render'](_0x4f0438[_0x3665('0x11')],_0x147285));_0x507868['body']=_0x8891ab;}catch(_0x4cf07d){logger['error'](_0x4cf07d[_0x3665('0x12')]);logger[_0x3665('0x13')](_0x3665('0x14'));}}else{_0x8891ab=_0x147285;_0x507868[_0x3665('0x15')]=_0x8891ab;}break;}logger[_0x3665('0x16')](util['format'](_0x3665('0x17'),_0x4f0438[_0x3665('0x6')],_0x4f0438[_0x3665('0x9')],JSON[_0x3665('0x18')](_0x507868)));rp(_0x507868)[_0x3665('0x19')](function(_0x3d094b){_0x8891ab=!_[_0x3665('0x1a')](_0x8891ab)?_0x3665('0x1b')+_0x8891ab:'';_0x16c357=typeof _0x3d094b[_0x3665('0x15')]===_0x3665('0x1c')?JSON[_0x3665('0x18')](_0x3d094b[_0x3665('0x15')]):_0x3d094b['body'];logger[_0x3665('0x16')](util[_0x3665('0x1d')](_0x3665('0x1e'),_0x4f0438[_0x3665('0x6')],_0x4f0438[_0x3665('0x9')],_0x3d094b[_0x3665('0x1f')],_0x16c357));})['catch'](function(_0x9a017e){logger[_0x3665('0x13')](util[_0x3665('0x1d')](_0x3665('0x20'),_0x4f0438[_0x3665('0x6')],_0x4f0438[_0x3665('0x9')],_0x9a017e[_0x3665('0x1f')],_0x9a017e['name'],_0x9a017e[_0x3665('0x21')]));});}; \ No newline at end of file +var _0xd2de=['data2','data5','headers','data6','error','GET','DELETE','PUT','data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','trigger','exec','data1','toUpperCase','render'];(function(_0x162351,_0x1687ae){var _0x52ab8e=function(_0x538569){while(--_0x538569){_0x162351['push'](_0x162351['shift']());}};_0x52ab8e(++_0x1687ae);}(_0xd2de,0x93));var _0xed2d=function(_0x2f0f4e,_0x386712){_0x2f0f4e=_0x2f0f4e-0x0;var _0x454069=_0xd2de[_0x2f0f4e];return _0x454069;};'use strict';var rp=require(_0xed2d('0x0'));var util=require(_0xed2d('0x1'));var _=require(_0xed2d('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xed2d('0x3'));exports[_0xed2d('0x4')]=function(_0x5373c6,_0x127ec9){var _0x161d1d,_0xa80145;var _0x4ece41={'method':_0x5373c6[_0xed2d('0x5')][_0xed2d('0x6')](),'uri':Mustache[_0xed2d('0x7')](_0x5373c6[_0xed2d('0x8')],_0x127ec9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5373c6[_0xed2d('0x9')])==='number'&&parseInt(_0x5373c6[_0xed2d('0x9')])>=0x1&&parseInt(_0x5373c6[_0xed2d('0x9')])<=0xa?parseInt(_0x5373c6[_0xed2d('0x9')])*0x3e8:0x5*0x3e8};try{_0x4ece41[_0xed2d('0xa')]=_0x5373c6[_0xed2d('0xb')]?JSON['parse'](Mustache[_0xed2d('0x7')](_0x5373c6[_0xed2d('0xb')],_0x127ec9)):{};}catch(_0x1450f1){logger[_0xed2d('0xc')](_0x1450f1['stack']);}switch(_0x5373c6[_0xed2d('0x5')][_0xed2d('0x6')]()){case _0xed2d('0xd'):case _0xed2d('0xe'):_0x161d1d=null;_0x4ece41['qs']=_0x127ec9;break;case'POST':case _0xed2d('0xf'):if(_0x5373c6[_0xed2d('0x10')]){try{_0x161d1d=JSON[_0xed2d('0x11')](Mustache[_0xed2d('0x7')](_0x5373c6[_0xed2d('0x10')],_0x127ec9));_0x4ece41[_0xed2d('0x12')]=_0x161d1d;}catch(_0x4efb9e){logger[_0xed2d('0xc')](_0x4efb9e[_0xed2d('0x13')]);logger[_0xed2d('0xc')](_0xed2d('0x14'));}}else{_0x161d1d=_0x127ec9;_0x4ece41['body']=_0x161d1d;}break;}logger[_0xed2d('0x15')](util[_0xed2d('0x16')](_0xed2d('0x17'),_0x5373c6[_0xed2d('0x5')],_0x5373c6[_0xed2d('0x8')],JSON[_0xed2d('0x18')](_0x4ece41)));rp(_0x4ece41)[_0xed2d('0x19')](function(_0x21e75c){_0x161d1d=!_['isNil'](_0x161d1d)?_0xed2d('0x1a')+_0x161d1d:'';_0xa80145=typeof _0x21e75c[_0xed2d('0x12')]==='object'?JSON[_0xed2d('0x18')](_0x21e75c[_0xed2d('0x12')]):_0x21e75c[_0xed2d('0x12')];logger[_0xed2d('0x15')](util[_0xed2d('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x5373c6[_0xed2d('0x5')],_0x5373c6[_0xed2d('0x8')],_0x21e75c[_0xed2d('0x1b')],_0xa80145));})[_0xed2d('0x1c')](function(_0x4187e1){logger['error'](util['format'](_0xed2d('0x1d'),_0x5373c6['data1'],_0x5373c6[_0xed2d('0x8')],_0x4187e1[_0xed2d('0x1b')],_0x4187e1[_0xed2d('0x1e')],_0x4187e1['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index d163607..5b6e5cb 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 _0x9774=['routing','client','http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger'];(function(_0x3ee625,_0x5c119f){var _0x25e0bb=function(_0x4c53be){while(--_0x4c53be){_0x3ee625['push'](_0x3ee625['shift']());}};_0x25e0bb(++_0x5c119f);}(_0x9774,0xb1));var _0x4977=function(_0x1420fa,_0xad1474){_0x1420fa=_0x1420fa-0x0;var _0x2ccd1c=_0x9774[_0x1420fa];return _0x2ccd1c;};'use strict';var jayson=require(_0x4977('0x0'));var BPromise=require(_0x4977('0x1'));var logger=require(_0x4977('0x2'))(_0x4977('0x3'));var client=jayson[_0x4977('0x4')][_0x4977('0x5')]({'port':0x2329});client['Request']=function(_0x3a0eb8,_0x5d0640){return new BPromise(function(_0x5be7eb,_0x1efd13){return client[_0x4977('0x6')](_0x3a0eb8,_0x5d0640)[_0x4977('0x7')](function(_0x2c96c1){logger[_0x4977('0x8')](_0x4977('0x9'),'routing',_0x3a0eb8,_0x5d0640,_0x2c96c1);if(_0x2c96c1[_0x4977('0xa')]){logger[_0x4977('0xa')]('rpc','routing',_0x3a0eb8,_0x2c96c1[_0x4977('0xa')][_0x4977('0xb')],_0x5d0640);return _0x1efd13(_0x2c96c1[_0x4977('0xa')][_0x4977('0xb')]);}else{return _0x5be7eb(_0x2c96c1[_0x4977('0xc')]);}})[_0x4977('0xd')](function(_0x3ab4e5){logger[_0x4977('0xa')](_0x4977('0x9'),_0x4977('0x3'),_0x3a0eb8,_0x3ab4e5,_0x5d0640);return _0x1efd13(_0x3ab4e5);});});};module[_0x4977('0xe')]=client; \ No newline at end of file +var _0x15ab=['error','message','result','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc'];(function(_0x2c3876,_0x486bbf){var _0x2ab760=function(_0x1ebfb6){while(--_0x1ebfb6){_0x2c3876['push'](_0x2c3876['shift']());}};_0x2ab760(++_0x486bbf);}(_0x15ab,0x9d));var _0xb15a=function(_0x128977,_0x179f3c){_0x128977=_0x128977-0x0;var _0x25102d=_0x15ab[_0x128977];return _0x25102d;};'use strict';var jayson=require(_0xb15a('0x0'));var BPromise=require(_0xb15a('0x1'));var logger=require(_0xb15a('0x2'))(_0xb15a('0x3'));var client=jayson[_0xb15a('0x4')][_0xb15a('0x5')]({'port':0x2329});client[_0xb15a('0x6')]=function(_0x88d254,_0x4929d5){return new BPromise(function(_0x5cadfc,_0x3a93ca){return client[_0xb15a('0x7')](_0x88d254,_0x4929d5)[_0xb15a('0x8')](function(_0x11bf83){logger[_0xb15a('0x9')](_0xb15a('0xa'),_0xb15a('0x3'),_0x88d254,_0x4929d5,_0x11bf83);if(_0x11bf83['error']){logger['error'](_0xb15a('0xa'),_0xb15a('0x3'),_0x88d254,_0x11bf83['error']['message'],_0x4929d5);return _0x3a93ca(_0x11bf83[_0xb15a('0xb')][_0xb15a('0xc')]);}else{return _0x5cadfc(_0x11bf83[_0xb15a('0xd')]);}})['catch'](function(_0x528bc1){logger['error'](_0xb15a('0xa'),_0xb15a('0x3'),_0x88d254,_0x528bc1,_0x4929d5);return _0x3a93ca(_0x528bc1);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1ef88b5..d0b225a 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 _0xef30=['resolve','initMailAccounts','listen','then','getSettings','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x2686fc,_0x33dd73){var _0x59f3e4=function(_0x15b9c6){while(--_0x15b9c6){_0x2686fc['push'](_0x2686fc['shift']());}};_0x59f3e4(++_0x33dd73);}(_0xef30,0x133));var _0x0ef3=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xef30[_0x421cf8];return _0x145c48;};'use strict';var BPromise=require(_0x0ef3('0x0'));var server=require(_0x0ef3('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0x0ef3('0x2'));var mailAccount=require(_0x0ef3('0x3'));var setting=require(_0x0ef3('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x0ef3('0x5')]()['then'](mailAccount['getMailAccounts']())['then'](realtime[_0x0ef3('0x6')]())['then'](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x0ef3('0x7')](realtime,email)[_0x0ef3('0x8')](function(){return initRealtime();})[_0x0ef3('0x8')](function(){return setting[_0x0ef3('0x9')]();})[_0x0ef3('0x8')](function(_0x19245d){return setInterval(initRealtime,_0x19245d[_0x0ef3('0xa')]*0x3e8);})[_0x0ef3('0xb')](function(_0xe70ab9){console[_0x0ef3('0xc')](_0xe70ab9);});}main(); \ No newline at end of file +var _0x156c=['getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','./realtime','./rpc/setting','then'];(function(_0x533c95,_0x537d5e){var _0x353c2d=function(_0x3e6508){while(--_0x3e6508){_0x533c95['push'](_0x533c95['shift']());}};_0x353c2d(++_0x537d5e);}(_0x156c,0x14d));var _0xc156=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x156c[_0x5d6456];return _0x4d66c1;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xc156('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xc156('0x1'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0xc156('0x2')](mailAccount[_0xc156('0x3')]())[_0xc156('0x2')](realtime[_0xc156('0x4')]())[_0xc156('0x2')](function(){email[_0xc156('0x5')](realtime[_0xc156('0x6')]);return realtime;});}function main(){return server[_0xc156('0x7')](realtime,email)['then'](function(){return initRealtime();})[_0xc156('0x2')](function(){return setting[_0xc156('0x8')]();})[_0xc156('0x2')](function(_0x1be5d6){return setInterval(initRealtime,_0x1be5d6[_0xc156('0x9')]*0x3e8);})[_0xc156('0xa')](function(_0x3d0fff){console[_0xc156('0xb')](_0x3d0fff);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 405d63f..6dcf0f8 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 _0x40df=['smtp','send','verifySmtp','Smtp','lastSync','verify','verified','exports','moment','bluebird','md5','../../../config/environment','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','key','active','Imap','status','isNil','stringify','emit','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','messageStatus','connected','name','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail'];(function(_0x599f32,_0x32b34f){var _0x47b552=function(_0x5237f8){while(--_0x5237f8){_0x599f32['push'](_0x599f32['shift']());}};_0x47b552(++_0x32b34f);}(_0x40df,0xec));var _0xf40d=function(_0x560210,_0x2e217d){_0x560210=_0x560210-0x0;var _0x1f1053=_0x40df[_0x560210];return _0x1f1053;};'use strict';var _=require('lodash');var moment=require(_0xf40d('0x0'));var BPromise=require(_0xf40d('0x1'));var md5=require(_0xf40d('0x2'));var Redis=require('ioredis');var config=require(_0xf40d('0x3'));var logger=require('../../../config/logger')(_0xf40d('0x4'));config['redis']=_[_0xf40d('0x5')](config[_0xf40d('0x6')],{'host':_0xf40d('0x7'),'port':0x18eb});var io=require(_0xf40d('0x8'))(new Redis(config[_0xf40d('0x6')]));var EmailImap=require(_0xf40d('0x9'));var EmailSmtp=require(_0xf40d('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0xcbaa33){logger[_0xf40d('0xb')](_0xf40d('0xc'));this['mailAccounts']=_0xcbaa33[_0xf40d('0xd')];this[_0xf40d('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0xf40d('0xf')]['emit']=function(_0x1a03e3){var _0x898bdf=this['mailAccounts'][_0x1a03e3];var _0x1ee20f={'id':_0x898bdf['id'],'name':_0x898bdf['name'],'key':_0x898bdf[_0xf40d('0x10')],'active':_0x898bdf[_0xf40d('0x11')],'Imap':{'status':_0x898bdf[_0xf40d('0x12')][_0xf40d('0x13')],'messageStatus':_0x898bdf[_0xf40d('0x12')]['messageStatus'],'total':_0x898bdf[_0xf40d('0x12')]['total']}};if(_[_0xf40d('0x14')](md5Accounts[_0x1a03e3])){md5Accounts[_0x1a03e3]={};}var _0x59f61e=md5(JSON[_0xf40d('0x15')](_0x1ee20f));if(md5Accounts[_0x1a03e3]['md5']!==_0x59f61e){md5Accounts[_0x1a03e3][_0xf40d('0x2')]=_0x59f61e;io[_0xf40d('0x16')]('mailAccount:update',_0x1ee20f);}};EmailChannel[_0xf40d('0xf')][_0xf40d('0x17')]=function(_0x5061a8){for(var _0xc1a751 in _0x5061a8){if(_0x5061a8[_0xf40d('0x18')](_0xc1a751)){if(_0x5061a8[_0xc1a751][_0xf40d('0x12')]&&_0x5061a8[_0xc1a751][_0xf40d('0x11')]){var _0x3b35a9=_0x5061a8[_0xc1a751][_0xf40d('0x12')];if(!this[_0xf40d('0xe')][_0xf40d('0x18')](_0x3b35a9['id'])){this[_0xf40d('0xe')][_0x3b35a9['id']]=new EmailImap(_0x3b35a9,_0x5061a8[_0xc1a751][_0xf40d('0x4')]);this['imapAccounts'][_0x3b35a9['id']]['on'](_0xf40d('0x19'),this[_0xf40d('0x1a')][_0xf40d('0x1b')](this,_0xc1a751));this['imapAccounts'][_0x3b35a9['id']]['on'](_0xf40d('0x4'),this[_0xf40d('0x1c')][_0xf40d('0x1b')](this,_0xc1a751));this[_0xf40d('0xe')][_0x3b35a9['id']]['on'](_0xf40d('0x1d'),this[_0xf40d('0x1e')][_0xf40d('0x1b')](this,_0xc1a751));this[_0xf40d('0xe')][_0x3b35a9['id']]['on']('error',this[_0xf40d('0x1f')][_0xf40d('0x1b')](this,_0xc1a751));}}else{if(_[_0xf40d('0x14')](this[_0xf40d('0xd')][_0xc1a751][_0xf40d('0x12')])){this[_0xf40d('0xd')][_0xc1a751][_0xf40d('0x12')]={};}this[_0xf40d('0xd')][_0xc1a751]['Imap'][_0xf40d('0x13')]=_0xf40d('0x20');this['mailAccounts'][_0xc1a751][_0xf40d('0x12')][_0xf40d('0x21')]='';this[_0xf40d('0x16')](_0xc1a751);}}}};EmailChannel[_0xf40d('0xf')][_0xf40d('0x1a')]=function(_0x57c344,_0x3de7cf){if(this['mailAccounts'][_0x57c344]){this[_0xf40d('0xd')][_0x57c344][_0xf40d('0x12')][_0xf40d('0x13')]=_0xf40d('0x22');this[_0xf40d('0xd')][_0x57c344][_0xf40d('0x12')]['messageStatus']=_0x3de7cf[_0xf40d('0x23')];if(_0x3de7cf[_0xf40d('0x24')]){this[_0xf40d('0xd')][_0x57c344]['Imap']['total']=_0x3de7cf[_0xf40d('0x24')][_0xf40d('0x25')];}return this[_0xf40d('0x16')](_0x57c344);}};EmailChannel[_0xf40d('0xf')][_0xf40d('0x1c')]=function(_0x49dc8a,_0x6fd4eb){logger[_0xf40d('0xb')](_0xf40d('0x26'),_0x6fd4eb[_0xf40d('0x27')],_0x6fd4eb[_0xf40d('0x28')],_0x6fd4eb[_0xf40d('0x29')],_0x49dc8a);if(this[_0xf40d('0xd')][_0x49dc8a]){return mailAccount[_0xf40d('0x2a')](_0x49dc8a,_0x6fd4eb)[_0xf40d('0x2b')](function(_0x245419){if(_0x245419){logger[_0xf40d('0xb')](_0xf40d('0x2c'));}})[_0xf40d('0x2d')](function(_0x171c78){logger[_0xf40d('0x2e')](_0xf40d('0x2f'),JSON[_0xf40d('0x15')](_0x171c78));});}};EmailChannel[_0xf40d('0xf')][_0xf40d('0x1e')]=function(_0x1bad97){if(this[_0xf40d('0xd')][_0x1bad97]&&this[_0xf40d('0xd')][_0x1bad97][_0xf40d('0x12')]){if(this[_0xf40d('0xe')][this['mailAccounts'][_0x1bad97][_0xf40d('0x12')]['id']]){delete this[_0xf40d('0xe')][this[_0xf40d('0xd')][_0x1bad97][_0xf40d('0x12')]['id']];}this[_0xf40d('0xd')][_0x1bad97]['Imap']['lastSync']=moment();this[_0xf40d('0x16')](_0x1bad97);}};EmailChannel[_0xf40d('0xf')][_0xf40d('0x1f')]=function(_0x50ef19,_0x26dece){if(this[_0xf40d('0xd')][_0x50ef19]){this[_0xf40d('0xd')][_0x50ef19][_0xf40d('0x12')][_0xf40d('0x13')]=_0xf40d('0x2e');this['mailAccounts'][_0x50ef19][_0xf40d('0x12')][_0xf40d('0x21')]=_0x26dece;return this[_0xf40d('0x16')](_0x50ef19);}};EmailChannel['prototype'][_0xf40d('0x30')]=function(_0xc875dc,_0x29cba8){return this[_0xf40d('0x31')][_0xf40d('0x32')](_0xc875dc,_0x29cba8);};EmailChannel[_0xf40d('0xf')][_0xf40d('0x33')]=function(_0xb3769e){var _0x144f93=this;if(this[_0xf40d('0xd')][_0xb3769e['id']]){if(_['isNil'](this['mailAccounts'][_0xb3769e['id']][_0xf40d('0x34')])){this['mailAccounts'][_0xb3769e['id']][_0xf40d('0x34')]={};}this[_0xf40d('0xd')][_0xb3769e['id']][_0xf40d('0x34')][_0xf40d('0x35')]=moment();return new BPromise(function(_0x2da00a,_0x153257){return _0x144f93['smtp'][_0xf40d('0x36')](_0xb3769e)[_0xf40d('0x2b')](function(_0xdb4738){_0x144f93[_0xf40d('0xd')][_0xb3769e['id']][_0xf40d('0x34')][_0xf40d('0x13')]=_0xf40d('0x37');_0x144f93['mailAccounts'][_0xb3769e['id']][_0xf40d('0x34')][_0xf40d('0x21')]='';_0x144f93[_0xf40d('0x16')](_0xb3769e['id']);_0x2da00a(_0xdb4738);})['catch'](function(_0x481daf){_0x144f93[_0xf40d('0xd')][_0xb3769e['id']]['Smtp'][_0xf40d('0x13')]=_0xf40d('0x2e');_0x144f93[_0xf40d('0xd')][_0xb3769e['id']]['Smtp'][_0xf40d('0x21')]=_0x481daf;_0x144f93[_0xf40d('0x16')](_0xb3769e['id']);_0x153257(_0x481daf);});});}return this[_0xf40d('0x31')][_0xf40d('0x36')](_0xb3769e);};module[_0xf40d('0x38')]=EmailChannel; \ No newline at end of file +var _0xf8d0=['mailAccount:update','refresh','hasOwnProperty','email','box','handleImapBox','handleImapEmail','end','bind','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','handleImapError','send','verifySmtp','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','ioredis','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','messageStatus','total','isNil','stringify','md5'];(function(_0x7cda8f,_0x24264e){var _0x1a9e30=function(_0x5970a2){while(--_0x5970a2){_0x7cda8f['push'](_0x7cda8f['shift']());}};_0x1a9e30(++_0x24264e);}(_0xf8d0,0x1d5));var _0x0f8d=function(_0x1ddaea,_0x251ebf){_0x1ddaea=_0x1ddaea-0x0;var _0x1cadde=_0xf8d0[_0x1ddaea];return _0x1cadde;};'use strict';var _=require(_0x0f8d('0x0'));var moment=require(_0x0f8d('0x1'));var BPromise=require(_0x0f8d('0x2'));var md5=require('md5');var Redis=require(_0x0f8d('0x3'));var config=require('../../../config/environment');var logger=require(_0x0f8d('0x4'))('email');config[_0x0f8d('0x5')]=_[_0x0f8d('0x6')](config[_0x0f8d('0x5')],{'host':_0x0f8d('0x7'),'port':0x18eb});var io=require(_0x0f8d('0x8'))(new Redis(config[_0x0f8d('0x5')]));var EmailImap=require(_0x0f8d('0x9'));var EmailSmtp=require(_0x0f8d('0xa'));var mailAccount=require(_0x0f8d('0xb'));var md5Accounts={};function EmailChannel(_0x66645e){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x66645e[_0x0f8d('0xc')];this[_0x0f8d('0xd')]={};this[_0x0f8d('0xe')]=new EmailSmtp();}EmailChannel[_0x0f8d('0xf')][_0x0f8d('0x10')]=function(_0x3e23e4){var _0x52d51a=this['mailAccounts'][_0x3e23e4];var _0x417771={'id':_0x52d51a['id'],'name':_0x52d51a[_0x0f8d('0x11')],'key':_0x52d51a['key'],'active':_0x52d51a[_0x0f8d('0x12')],'Imap':{'status':_0x52d51a[_0x0f8d('0x13')][_0x0f8d('0x14')],'messageStatus':_0x52d51a['Imap'][_0x0f8d('0x15')],'total':_0x52d51a[_0x0f8d('0x13')][_0x0f8d('0x16')]}};if(_[_0x0f8d('0x17')](md5Accounts[_0x3e23e4])){md5Accounts[_0x3e23e4]={};}var _0xf96a50=md5(JSON[_0x0f8d('0x18')](_0x417771));if(md5Accounts[_0x3e23e4]['md5']!==_0xf96a50){md5Accounts[_0x3e23e4][_0x0f8d('0x19')]=_0xf96a50;io[_0x0f8d('0x10')](_0x0f8d('0x1a'),_0x417771);}};EmailChannel[_0x0f8d('0xf')][_0x0f8d('0x1b')]=function(_0x1b7ded){for(var _0xc66f6d in _0x1b7ded){if(_0x1b7ded[_0x0f8d('0x1c')](_0xc66f6d)){if(_0x1b7ded[_0xc66f6d][_0x0f8d('0x13')]&&_0x1b7ded[_0xc66f6d][_0x0f8d('0x12')]){var _0x3ef741=_0x1b7ded[_0xc66f6d][_0x0f8d('0x13')];if(!this['imapAccounts'][_0x0f8d('0x1c')](_0x3ef741['id'])){this['imapAccounts'][_0x3ef741['id']]=new EmailImap(_0x3ef741,_0x1b7ded[_0xc66f6d][_0x0f8d('0x1d')]);this['imapAccounts'][_0x3ef741['id']]['on'](_0x0f8d('0x1e'),this[_0x0f8d('0x1f')]['bind'](this,_0xc66f6d));this['imapAccounts'][_0x3ef741['id']]['on'](_0x0f8d('0x1d'),this[_0x0f8d('0x20')]['bind'](this,_0xc66f6d));this[_0x0f8d('0xd')][_0x3ef741['id']]['on'](_0x0f8d('0x21'),this['handleImapEnd'][_0x0f8d('0x22')](this,_0xc66f6d));this[_0x0f8d('0xd')][_0x3ef741['id']]['on']('error',this['handleImapError'][_0x0f8d('0x22')](this,_0xc66f6d));}}else{if(_['isNil'](this['mailAccounts'][_0xc66f6d][_0x0f8d('0x13')])){this[_0x0f8d('0xc')][_0xc66f6d][_0x0f8d('0x13')]={};}this[_0x0f8d('0xc')][_0xc66f6d][_0x0f8d('0x13')][_0x0f8d('0x14')]='disabled';this[_0x0f8d('0xc')][_0xc66f6d][_0x0f8d('0x13')][_0x0f8d('0x15')]='';this['emit'](_0xc66f6d);}}}};EmailChannel[_0x0f8d('0xf')]['handleImapBox']=function(_0x147b87,_0x269e02){if(this[_0x0f8d('0xc')][_0x147b87]){this[_0x0f8d('0xc')][_0x147b87]['Imap'][_0x0f8d('0x14')]=_0x0f8d('0x23');this[_0x0f8d('0xc')][_0x147b87]['Imap']['messageStatus']=_0x269e02[_0x0f8d('0x11')];if(_0x269e02[_0x0f8d('0x24')]){this[_0x0f8d('0xc')][_0x147b87][_0x0f8d('0x13')][_0x0f8d('0x16')]=_0x269e02[_0x0f8d('0x24')]['total'];}return this['emit'](_0x147b87);}};EmailChannel[_0x0f8d('0xf')][_0x0f8d('0x20')]=function(_0x1d28e3,_0x31fd37){logger[_0x0f8d('0x25')](_0x0f8d('0x26'),_0x31fd37[_0x0f8d('0x27')],_0x31fd37[_0x0f8d('0x28')],_0x31fd37['from'],_0x1d28e3);if(this['mailAccounts'][_0x1d28e3]){return mailAccount[_0x0f8d('0x29')](_0x1d28e3,_0x31fd37)[_0x0f8d('0x2a')](function(_0x4c3328){if(_0x4c3328){logger[_0x0f8d('0x25')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x5b5af1){logger[_0x0f8d('0x2b')](_0x0f8d('0x2c'),JSON[_0x0f8d('0x18')](_0x5b5af1));});}};EmailChannel[_0x0f8d('0xf')][_0x0f8d('0x2d')]=function(_0x532665){if(this[_0x0f8d('0xc')][_0x532665]&&this[_0x0f8d('0xc')][_0x532665][_0x0f8d('0x13')]){if(this[_0x0f8d('0xd')][this[_0x0f8d('0xc')][_0x532665]['Imap']['id']]){delete this[_0x0f8d('0xd')][this[_0x0f8d('0xc')][_0x532665][_0x0f8d('0x13')]['id']];}this[_0x0f8d('0xc')][_0x532665][_0x0f8d('0x13')][_0x0f8d('0x2e')]=moment();this[_0x0f8d('0x10')](_0x532665);}};EmailChannel[_0x0f8d('0xf')][_0x0f8d('0x2f')]=function(_0x1b898b,_0x28e130){if(this[_0x0f8d('0xc')][_0x1b898b]){this[_0x0f8d('0xc')][_0x1b898b]['Imap'][_0x0f8d('0x14')]=_0x0f8d('0x2b');this[_0x0f8d('0xc')][_0x1b898b]['Imap']['messageStatus']=_0x28e130;return this[_0x0f8d('0x10')](_0x1b898b);}};EmailChannel[_0x0f8d('0xf')]['sendMail']=function(_0x53f297,_0x25fc1d){return this[_0x0f8d('0xe')][_0x0f8d('0x30')](_0x53f297,_0x25fc1d);};EmailChannel[_0x0f8d('0xf')][_0x0f8d('0x31')]=function(_0x5be169){var _0x1c17c8=this;if(this[_0x0f8d('0xc')][_0x5be169['id']]){if(_[_0x0f8d('0x17')](this[_0x0f8d('0xc')][_0x5be169['id']][_0x0f8d('0x32')])){this[_0x0f8d('0xc')][_0x5be169['id']]['Smtp']={};}this[_0x0f8d('0xc')][_0x5be169['id']][_0x0f8d('0x32')]['lastSync']=moment();return new BPromise(function(_0x352d32,_0x373887){return _0x1c17c8['smtp'][_0x0f8d('0x33')](_0x5be169)[_0x0f8d('0x2a')](function(_0x3a951f){_0x1c17c8[_0x0f8d('0xc')][_0x5be169['id']][_0x0f8d('0x32')][_0x0f8d('0x14')]=_0x0f8d('0x34');_0x1c17c8[_0x0f8d('0xc')][_0x5be169['id']][_0x0f8d('0x32')][_0x0f8d('0x15')]='';_0x1c17c8['emit'](_0x5be169['id']);_0x352d32(_0x3a951f);})[_0x0f8d('0x35')](function(_0x1b099d){_0x1c17c8[_0x0f8d('0xc')][_0x5be169['id']][_0x0f8d('0x32')][_0x0f8d('0x14')]='error';_0x1c17c8[_0x0f8d('0xc')][_0x5be169['id']]['Smtp']['messageStatus']=_0x1b099d;_0x1c17c8[_0x0f8d('0x10')](_0x5be169['id']);_0x373887(_0x1b099d);});});}return this[_0x0f8d('0xe')][_0x0f8d('0x33')](_0x5be169);};module[_0x0f8d('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 8638655..6cdbcdb 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 _0x1e43=['readUnseen','handleError','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','emit','handleCloseBox','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','randomstring','mailparser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','getAccount','imap','account','once','ready','handleReady','bind','end','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','service','anonymous@xcally.com','openBox','mailbox','handleOpenBox','box'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1e43,0x1d1));var _0x31e4=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0x1e43[_0x44f974];return _0x805dbd;};'use strict';var fs=require('fs');var path=require(_0x31e4('0x0'));var util=require(_0x31e4('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x31e4('0x2'));var simpleParser=require(_0x31e4('0x3'))['simpleParser'];var Iconv=require('iconv')[_0x31e4('0x4')];var EventEmitter=require(_0x31e4('0x5'))[_0x31e4('0x6')];var utils=require(_0x31e4('0x7'));var logger=require(_0x31e4('0x8'))(_0x31e4('0x9'));function EmailImap(_0x15aaf4,_0x2d5e43){this['mailbox']=_0x31e4('0xa');this['account']=this[_0x31e4('0xb')](_0x15aaf4,_0x2d5e43);this[_0x31e4('0xc')]=new Imap(this[_0x31e4('0xd')]);this[_0x31e4('0xc')][_0x31e4('0xe')](_0x31e4('0xf'),this[_0x31e4('0x10')][_0x31e4('0x11')](this));this[_0x31e4('0xc')][_0x31e4('0xe')](_0x31e4('0x12'),this[_0x31e4('0x13')][_0x31e4('0x11')](this));this[_0x31e4('0xc')]['on'](_0x31e4('0x14'),this['handleError']['bind'](this));this[_0x31e4('0xc')][_0x31e4('0x15')]();}util[_0x31e4('0x16')](EmailImap,EventEmitter);EmailImap[_0x31e4('0x17')][_0x31e4('0xb')]=function(_0x2af530,_0x1d3c64){var _0x47b9b6={'connTimeout':_0x2af530['connTimeout']?_0x2af530[_0x31e4('0x18')]*0x3e8:0x2710,'authTimeout':_0x2af530['authTimeout']?_0x2af530[_0x31e4('0x19')]*0x3e8:0x1388};if(_[_0x31e4('0x1a')](_0x2af530['service'])){if(_0x2af530[_0x31e4('0x1b')]){_0x47b9b6['user']=_0x2af530[_0x31e4('0x1c')];_0x47b9b6[_0x31e4('0x1d')]=_0x2af530[_0x31e4('0x1d')];}_0x47b9b6[_0x31e4('0x1e')]=_0x2af530[_0x31e4('0x1e')];_0x47b9b6[_0x31e4('0x1f')]=_0x2af530[_0x31e4('0x1f')]||0x3e1;if(_0x2af530[_0x31e4('0x20')]){_0x47b9b6[_0x31e4('0x20')]=!![];}else{_0x47b9b6['tls']=![];_0x47b9b6['autotls']='required';}}else{_0x47b9b6[_0x31e4('0x1c')]=_0x2af530[_0x31e4('0x1c')];_0x47b9b6[_0x31e4('0x1d')]=_0x2af530['password'];_0x47b9b6[_0x31e4('0x1e')]=utils['getHost'](_0x2af530[_0x31e4('0x21')]);_0x47b9b6[_0x31e4('0x1f')]=0x3e1;_0x47b9b6[_0x31e4('0x20')]=!![];}_0x47b9b6[_0x31e4('0x9')]=_0x1d3c64||_0x2af530[_0x31e4('0x1c')]||_0x31e4('0x22');return _0x47b9b6;};EmailImap[_0x31e4('0x17')][_0x31e4('0x10')]=function(){this[_0x31e4('0xc')][_0x31e4('0x23')](this[_0x31e4('0x24')],![],this['handleOpenBox'][_0x31e4('0x11')](this));};EmailImap[_0x31e4('0x17')][_0x31e4('0x25')]=function(_0x7f7e18,_0x1da1ec){if(_0x7f7e18){this['handleError'](_0x7f7e18,!![]);}else{this['emit'](_0x31e4('0x26'),_0x1da1ec);this[_0x31e4('0x27')]();}};EmailImap[_0x31e4('0x17')]['handleCloseBox']=function(_0x1b11f9){if(_0x1b11f9){this[_0x31e4('0x28')](_0x1b11f9,!![]);}else{this['imap'][_0x31e4('0x12')]();}};EmailImap['prototype'][_0x31e4('0x27')]=function(){this[_0x31e4('0xc')][_0x31e4('0x29')]([_0x31e4('0x2a')],this[_0x31e4('0x2b')][_0x31e4('0x11')](this));};EmailImap[_0x31e4('0x17')][_0x31e4('0x2b')]=function(_0x21f87c,_0x13ccde){if(_0x21f87c){this[_0x31e4('0x28')](_0x21f87c,!![]);}else{if(_0x13ccde[_0x31e4('0x2c')]){try{var _0x45ff29=this[_0x31e4('0xc')]['fetch'](_0x13ccde,{'bodies':'','markSeen':!![]});_0x45ff29['on'](_0x31e4('0x2d'),this[_0x31e4('0x2e')][_0x31e4('0x11')](this));_0x45ff29[_0x31e4('0xe')](_0x31e4('0x14'),this[_0x31e4('0x2f')]['bind'](this));_0x45ff29['once'](_0x31e4('0x12'),this[_0x31e4('0x30')]['bind'](this));}catch(_0x220e6d){logger[_0x31e4('0x14')](_0x220e6d);}}else{this[_0x31e4('0xc')][_0x31e4('0x31')](!![],this['handleCloseBox'][_0x31e4('0x11')](this));}}};EmailImap[_0x31e4('0x17')][_0x31e4('0x2e')]=function(_0x186531,_0x267ee2){_0x186531['on'](_0x31e4('0x32'),this[_0x31e4('0x33')][_0x31e4('0x11')](this));_0x186531[_0x31e4('0xe')](_0x31e4('0x34'),this[_0x31e4('0x35')]['bind'](this));_0x186531[_0x31e4('0xe')]('end',this['handleMessageEnd'][_0x31e4('0x11')](this));};EmailImap[_0x31e4('0x17')][_0x31e4('0x33')]=function(_0x112e76,_0x482705){simpleParser(_0x112e76,{'Iconv':Iconv},this['handleSimpleParser'][_0x31e4('0x11')](this));};EmailImap[_0x31e4('0x17')]['handleMessageAttributes']=function(_0x4fc9bf){};EmailImap[_0x31e4('0x17')][_0x31e4('0x36')]=function(){};EmailImap[_0x31e4('0x17')]['handleSimpleParser']=function(_0x9577ad,_0x57aca2){if(_0x9577ad){logger[_0x31e4('0x14')](_0x9577ad);}else{var _0x3fe065=this;utils[_0x31e4('0x37')](this[_0x31e4('0xd')],_0x57aca2,function(_0x1a2ce4){_0x3fe065[_0x31e4('0x38')](_0x31e4('0x9'),_0x1a2ce4);});}};EmailImap[_0x31e4('0x17')][_0x31e4('0x30')]=function(){this[_0x31e4('0xc')][_0x31e4('0x31')](!![],this[_0x31e4('0x39')][_0x31e4('0x11')](this));};EmailImap[_0x31e4('0x17')][_0x31e4('0x2f')]=function(_0x8b233a){this[_0x31e4('0x28')](_0x8b233a);this[_0x31e4('0xc')]['closeBox'](!![],this[_0x31e4('0x39')][_0x31e4('0x11')](this));};EmailImap[_0x31e4('0x17')][_0x31e4('0x13')]=function(){this[_0x31e4('0x38')]('end');};EmailImap[_0x31e4('0x17')][_0x31e4('0x28')]=function(_0x5d05b6,_0x39ca23){logger['error']('handleError',this[_0x31e4('0xd')][_0x31e4('0x9')],JSON[_0x31e4('0x3a')](_0x5d05b6));var _0x1fc62a='';if(_0x5d05b6){if(_0x5d05b6[_0x31e4('0x3b')]){_0x1fc62a=_0x5d05b6[_0x31e4('0x3b')];}else{for(var _0x4e89a1 in _0x5d05b6){if(_0x5d05b6[_0x31e4('0x3c')](_0x4e89a1)){_0x1fc62a+=_[_0x31e4('0x3d')](_0x4e89a1)+':\x20'+_0x5d05b6[_0x4e89a1]+'\x0a';}}}}if(_0x39ca23){this[_0x31e4('0xc')][_0x31e4('0x12')]();}else{this[_0x31e4('0x38')](_0x31e4('0x14'),_0x1fc62a);this[_0x31e4('0x38')](_0x31e4('0x12'));}};module[_0x31e4('0x3e')]=EmailImap; \ No newline at end of file +var _0x16e3=['bind','imap','end','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','handleReady','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','parser','account','handleEnd','stringify','textCode','hasOwnProperty','exports','path','lodash','mailparser','simpleParser','Iconv','EventEmitter','./utils','email','INBOX','getAccount','once','ready'];(function(_0x3e6923,_0x2bd6d9){var _0x239082=function(_0x3cf61d){while(--_0x3cf61d){_0x3e6923['push'](_0x3e6923['shift']());}};_0x239082(++_0x2bd6d9);}(_0x16e3,0x168));var _0x316e=function(_0x4c8b21,_0xf5a456){_0x4c8b21=_0x4c8b21-0x0;var _0x2fe614=_0x16e3[_0x4c8b21];return _0x2fe614;};'use strict';var fs=require('fs');var path=require(_0x316e('0x0'));var util=require('util');var Imap=require('imap');var _=require(_0x316e('0x1'));var rs=require('randomstring');var simpleParser=require(_0x316e('0x2'))[_0x316e('0x3')];var Iconv=require('iconv')[_0x316e('0x4')];var EventEmitter=require('events')[_0x316e('0x5')];var utils=require(_0x316e('0x6'));var logger=require('../../../config/logger')(_0x316e('0x7'));function EmailImap(_0x5d7a5e,_0xb85517){this['mailbox']=_0x316e('0x8');this['account']=this[_0x316e('0x9')](_0x5d7a5e,_0xb85517);this['imap']=new Imap(this['account']);this['imap'][_0x316e('0xa')](_0x316e('0xb'),this['handleReady'][_0x316e('0xc')](this));this[_0x316e('0xd')]['once'](_0x316e('0xe'),this['handleEnd']['bind'](this));this[_0x316e('0xd')]['on'](_0x316e('0xf'),this[_0x316e('0x10')][_0x316e('0xc')](this));this['imap'][_0x316e('0x11')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x316e('0x12')][_0x316e('0x9')]=function(_0x2a5009,_0x4ab332){var _0x2a9e30={'connTimeout':_0x2a5009[_0x316e('0x13')]?_0x2a5009[_0x316e('0x13')]*0x3e8:0x2710,'authTimeout':_0x2a5009['authTimeout']?_0x2a5009[_0x316e('0x14')]*0x3e8:0x1388};if(_[_0x316e('0x15')](_0x2a5009[_0x316e('0x16')])){if(_0x2a5009[_0x316e('0x17')]){_0x2a9e30[_0x316e('0x18')]=_0x2a5009[_0x316e('0x18')];_0x2a9e30[_0x316e('0x19')]=_0x2a5009['password'];}_0x2a9e30[_0x316e('0x1a')]=_0x2a5009[_0x316e('0x1a')];_0x2a9e30[_0x316e('0x1b')]=_0x2a5009[_0x316e('0x1b')]||0x3e1;if(_0x2a5009[_0x316e('0x1c')]){_0x2a9e30[_0x316e('0x1c')]=!![];}else{_0x2a9e30[_0x316e('0x1c')]=![];_0x2a9e30[_0x316e('0x1d')]='required';}}else{_0x2a9e30[_0x316e('0x18')]=_0x2a5009['user'];_0x2a9e30[_0x316e('0x19')]=_0x2a5009[_0x316e('0x19')];_0x2a9e30[_0x316e('0x1a')]=utils[_0x316e('0x1e')](_0x2a5009[_0x316e('0x16')]);_0x2a9e30[_0x316e('0x1b')]=0x3e1;_0x2a9e30[_0x316e('0x1c')]=!![];}_0x2a9e30[_0x316e('0x7')]=_0x4ab332||_0x2a5009[_0x316e('0x18')]||_0x316e('0x1f');return _0x2a9e30;};EmailImap[_0x316e('0x12')][_0x316e('0x20')]=function(){this[_0x316e('0xd')][_0x316e('0x21')](this[_0x316e('0x22')],![],this[_0x316e('0x23')]['bind'](this));};EmailImap[_0x316e('0x12')]['handleOpenBox']=function(_0x14343b,_0x6dd4a5){if(_0x14343b){this[_0x316e('0x10')](_0x14343b,!![]);}else{this[_0x316e('0x24')](_0x316e('0x25'),_0x6dd4a5);this[_0x316e('0x26')]();}};EmailImap[_0x316e('0x12')][_0x316e('0x27')]=function(_0x3cdc15){if(_0x3cdc15){this[_0x316e('0x10')](_0x3cdc15,!![]);}else{this[_0x316e('0xd')][_0x316e('0xe')]();}};EmailImap['prototype'][_0x316e('0x26')]=function(){this['imap'][_0x316e('0x28')]([_0x316e('0x29')],this[_0x316e('0x2a')][_0x316e('0xc')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x483ae0,_0x22e996){if(_0x483ae0){this[_0x316e('0x10')](_0x483ae0,!![]);}else{if(_0x22e996[_0x316e('0x2b')]){try{var _0x38c7a8=this[_0x316e('0xd')][_0x316e('0x2c')](_0x22e996,{'bodies':'','markSeen':!![]});_0x38c7a8['on'](_0x316e('0x2d'),this[_0x316e('0x2e')][_0x316e('0xc')](this));_0x38c7a8[_0x316e('0xa')](_0x316e('0xf'),this[_0x316e('0x2f')][_0x316e('0xc')](this));_0x38c7a8['once'](_0x316e('0xe'),this[_0x316e('0x30')][_0x316e('0xc')](this));}catch(_0x54915e){logger['error'](_0x54915e);}}else{this['imap'][_0x316e('0x31')](!![],this['handleCloseBox'][_0x316e('0xc')](this));}}};EmailImap[_0x316e('0x12')][_0x316e('0x2e')]=function(_0x32a8a6,_0x3fda09){_0x32a8a6['on'](_0x316e('0x32'),this['handleMessageBody'][_0x316e('0xc')](this));_0x32a8a6[_0x316e('0xa')]('attributes',this['handleMessageAttributes']['bind'](this));_0x32a8a6[_0x316e('0xa')](_0x316e('0xe'),this[_0x316e('0x33')][_0x316e('0xc')](this));};EmailImap['prototype'][_0x316e('0x34')]=function(_0x85191,_0xb5b46d){simpleParser(_0x85191,{'Iconv':Iconv},this[_0x316e('0x35')][_0x316e('0xc')](this));};EmailImap[_0x316e('0x12')][_0x316e('0x36')]=function(_0x2ac77e){};EmailImap[_0x316e('0x12')][_0x316e('0x33')]=function(){};EmailImap[_0x316e('0x12')][_0x316e('0x35')]=function(_0x3866f6,_0x5f598b){if(_0x3866f6){logger['error'](_0x3866f6);}else{var _0x97700e=this;utils[_0x316e('0x37')](this[_0x316e('0x38')],_0x5f598b,function(_0x5da39b){_0x97700e[_0x316e('0x24')]('email',_0x5da39b);});}};EmailImap[_0x316e('0x12')]['handleFetchEnd']=function(){this['imap'][_0x316e('0x31')](!![],this[_0x316e('0x27')][_0x316e('0xc')](this));};EmailImap[_0x316e('0x12')]['handleFetchError']=function(_0x4941db){this['handleError'](_0x4941db);this[_0x316e('0xd')][_0x316e('0x31')](!![],this[_0x316e('0x27')][_0x316e('0xc')](this));};EmailImap[_0x316e('0x12')][_0x316e('0x39')]=function(){this[_0x316e('0x24')](_0x316e('0xe'));};EmailImap['prototype']['handleError']=function(_0x1625c5,_0x28c1a7){logger[_0x316e('0xf')](_0x316e('0x10'),this['account']['email'],JSON[_0x316e('0x3a')](_0x1625c5));var _0x594a28='';if(_0x1625c5){if(_0x1625c5[_0x316e('0x3b')]){_0x594a28=_0x1625c5[_0x316e('0x3b')];}else{for(var _0x57e0cf in _0x1625c5){if(_0x1625c5[_0x316e('0x3c')](_0x57e0cf)){_0x594a28+=_['upperFirst'](_0x57e0cf)+':\x20'+_0x1625c5[_0x57e0cf]+'\x0a';}}}}if(_0x28c1a7){this[_0x316e('0xd')][_0x316e('0xe')]();}else{this['emit'](_0x316e('0xf'),_0x594a28);this[_0x316e('0x24')]('end');}};module[_0x316e('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 49020cf..d55d29b 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 _0x6bd3=['compile','sendMail','toString','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport','use'];(function(_0x5cbcae,_0x20ad17){var _0x248e21=function(_0x20671d){while(--_0x20671d){_0x5cbcae['push'](_0x5cbcae['shift']());}};_0x248e21(++_0x20ad17);}(_0x6bd3,0x1de));var _0x36bd=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x6bd3[_0x166d93];return _0xba708;};'use strict';var nodemailer=require(_0x36bd('0x0'));var BPromise=require(_0x36bd('0x1'));var inlineBase64=require(_0x36bd('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x36bd('0x3')]=function(_0x2dc91d,_0x325ed0){return new BPromise(function(_0x2fdf46,_0x443c53){var _0x12f698=nodemailer[_0x36bd('0x4')](_0x2dc91d);_0x12f698[_0x36bd('0x5')](_0x36bd('0x6'),inlineBase64());_0x12f698[_0x36bd('0x7')](_0x325ed0,function(_0x1b46bc,_0x4fb50e){if(_0x1b46bc){_0x443c53(_0x1b46bc[_0x36bd('0x8')]());}else{_0x2fdf46(_0x4fb50e);}});});};EmailSmtp['prototype']['verify']=function(_0x5901e9){return new BPromise(function(_0x10b2f8,_0xf60601){var _0x3d833d=nodemailer[_0x36bd('0x4')](_0x5901e9);_0x3d833d[_0x36bd('0x9')](function(_0x1ba6f7,_0x5edf3d){if(_0x1ba6f7){_0xf60601(_0x1ba6f7['toString']());}else{if(_0x5edf3d){_0x10b2f8(_0x5edf3d);}else{_0xf60601(_0x36bd('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x9e1e=['verify','Not\x20verifired','bluebird','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString'];(function(_0x30ee52,_0x9bf3a){var _0x406d1b=function(_0x5db038){while(--_0x5db038){_0x30ee52['push'](_0x30ee52['shift']());}};_0x406d1b(++_0x9bf3a);}(_0x9e1e,0x8e));var _0xe9e1=function(_0x4e1078,_0x24a9dd){_0x4e1078=_0x4e1078-0x0;var _0xb795fe=_0x9e1e[_0x4e1078];return _0xb795fe;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xe9e1('0x0'));var inlineBase64=require(_0xe9e1('0x1'));function EmailSmtp(){}EmailSmtp[_0xe9e1('0x2')]['send']=function(_0x21c8ea,_0x53f506){return new BPromise(function(_0x9251ea,_0x31f440){var _0x5c8efa=nodemailer[_0xe9e1('0x3')](_0x21c8ea);_0x5c8efa[_0xe9e1('0x4')](_0xe9e1('0x5'),inlineBase64());_0x5c8efa[_0xe9e1('0x6')](_0x53f506,function(_0x44bbac,_0x15bcd9){if(_0x44bbac){_0x31f440(_0x44bbac[_0xe9e1('0x7')]());}else{_0x9251ea(_0x15bcd9);}});});};EmailSmtp[_0xe9e1('0x2')][_0xe9e1('0x8')]=function(_0x37ab41){return new BPromise(function(_0x4f5eae,_0x4e4188){var _0x2a28a2=nodemailer[_0xe9e1('0x3')](_0x37ab41);_0x2a28a2[_0xe9e1('0x8')](function(_0x3f49fc,_0x2bbfb1){if(_0x3f49fc){_0x4e4188(_0x3f49fc[_0xe9e1('0x7')]());}else{if(_0x2bbfb1){_0x4f5eae(_0x2bbfb1);}else{_0x4e4188(_0xe9e1('0x9'));}}});});};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 857372b..d59724c 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 _0xc2c7=['imap.mail.yahoo.com','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','generate','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','getHost','gmail','yahoo'];(function(_0x5388b2,_0x15bbf1){var _0x10d50b=function(_0x552177){while(--_0x552177){_0x5388b2['push'](_0x5388b2['shift']());}};_0x10d50b(++_0x15bbf1);}(_0xc2c7,0x134));var _0x7c2c=function(_0x2c22fb,_0x409827){_0x2c22fb=_0x2c22fb-0x0;var _0x51a465=_0xc2c7[_0x2c22fb];return _0x51a465;};'use strict';var _=require('lodash');var moment=require(_0x7c2c('0x0'));var random=require(_0x7c2c('0x1'));var fs=require('fs');var path=require(_0x7c2c('0x2'));var util=require(_0x7c2c('0x3'));var tnef=require(_0x7c2c('0x4'));var logger=require(_0x7c2c('0x5'))(_0x7c2c('0x6'));var config=require(_0x7c2c('0x7'));function getAddress(_0x4bbc14){var _0x59f346=_[_0x7c2c('0x8')](_0x4bbc14[_0x7c2c('0x9')]);return _0x59f346&&_0x59f346[_0x7c2c('0xa')]?_0x59f346['address']:'anonymous'+random['generate'](0x6)+_0x7c2c('0xb');}function getFirstName(_0x29638d){var _0x3e668f=_[_0x7c2c('0x8')](_0x29638d[_0x7c2c('0x9')]);if(_0x3e668f&&_0x3e668f['name']){if(_0x3e668f[_0x7c2c('0xc')]==_0x3e668f[_0x7c2c('0xa')]){return _0x3e668f[_0x7c2c('0xc')][_0x7c2c('0xd')](0x0,_0x3e668f[_0x7c2c('0xc')][_0x7c2c('0xe')]('@'));}var _0x2cb057=_0x3e668f[_0x7c2c('0xc')][_0x7c2c('0xf')](/\s+/);return _0x2cb057[_0x7c2c('0x10')]>0x1?_0x2cb057[_0x7c2c('0x11')](0x0,-0x1)[_0x7c2c('0x12')]('\x20'):_0x3e668f[_0x7c2c('0xc')];}return _0x7c2c('0x13');}function getLastName(_0x177f14){var _0x29fe58=_['head'](_0x177f14['value']);if(_0x29fe58&&_0x29fe58[_0x7c2c('0xc')]){var _0xd1a3db=_0x29fe58[_0x7c2c('0xc')]['split'](/\s+/);return _0xd1a3db[_0x7c2c('0x10')]>0x1?_0xd1a3db[_0x7c2c('0x14')]():'';}return'';}function getMails(_0x5e55e0,_0x88f54b){var _0x5a5fe2='';for(var _0x1aa355=0x0;_0x1aa355<_0x88f54b['value'][_0x7c2c('0x10')];_0x1aa355+=0x1){if(_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]!==_0x5e55e0){if(!_[_0x7c2c('0x15')](_0x5a5fe2)){_0x5a5fe2+=',';}_0x5a5fe2+=_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xc')]||_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]||'';_0x5a5fe2+='\x20<';_0x5a5fe2+=_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]?_0x88f54b[_0x7c2c('0x9')][_0x1aa355][_0x7c2c('0xa')]:'anonymous'+random[_0x7c2c('0x16')](0x6)+'@xcally.com';_0x5a5fe2+='>';}}return _0x5a5fe2;}function parseEmail(_0x506d47,_0x15ae33,_0x3a71d7){if(_0x15ae33[_0x7c2c('0x17')]){var _0x38ae30=/)<[^<]*)*<\/script>/gi;while(_0x38ae30[_0x7c2c('0x18')](_0x15ae33[_0x7c2c('0x17')])){_0x15ae33[_0x7c2c('0x17')]=_0x15ae33['html'][_0x7c2c('0x19')](_0x38ae30,'');}if(_0x15ae33['html'][_0x7c2c('0x1a')]('{_0x3d4387['push'](_0x481867[_0x7c2c('0x1d')]);});var _0x30c53e=/]+>/g;var _0x3d2b8d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x150690=_0x15ae33[_0x7c2c('0x17')][_0x7c2c('0x19')](_0x3d2b8d,_0x7c2c('0x1e'));var _0x4b1dd0=_0x150690[_0x7c2c('0x19')](_0x30c53e,_0x7c2c('0x1f'));for(let _0x3b2652=0x0;_0x3b2652<_0x3d4387[_0x7c2c('0x10')];_0x3b2652++){var _0x145788=_0x4b1dd0[_0x7c2c('0x19')](_0x7c2c('0x1f'),_0x7c2c('0x20')+_0x3d4387[_0x3b2652]+_0x7c2c('0x21'));_0x4b1dd0=_0x145788;}_0x15ae33['html']=_0x4b1dd0;}_0x3a71d7[_0x7c2c('0x22')]=_0x15ae33[_0x7c2c('0x17')];}else{_0x3a71d7[_0x7c2c('0x22')]=_0x15ae33[_0x7c2c('0x23')];}if(_0x3a71d7['body']){_0x3a71d7[_0x7c2c('0x22')]=_0x3a71d7[_0x7c2c('0x22')][_0x7c2c('0x19')](/0x0){var _0x12c9cd=[_0x7c2c('0x35'),_0x7c2c('0x36'),'Precedence:\x20auto_reply'];for(var _0xe2a67b=0x0;_0xe2a67b<_0x15ae33['headerLines'][_0x7c2c('0x10')];_0xe2a67b++){var _0x322704=_['indexOf'](_0x12c9cd,_0x15ae33[_0x7c2c('0x34')][_0xe2a67b]['line']);if(_0x322704>=0x0){_0x3a71d7[_0x7c2c('0x37')]=!![];}}}return _0x3a71d7;}exports[_0x7c2c('0x38')]=function(_0x9b9813,_0x26351e,_0x4f3948){var _0x23fdcf={'from':getAddress(_0x26351e['from']),'firstName':getFirstName(_0x26351e['from']),'lastName':getLastName(_0x26351e[_0x7c2c('0x39')]),'mapKey':_0x7c2c('0x6'),'message':{'from':getMails(_0x9b9813[_0x7c2c('0x6')],_0x26351e['from']),'to':_0x9b9813[_0x7c2c('0x6')],'cc':'','subject':_0x26351e[_0x7c2c('0x3a')]||'','messageId':_0x26351e['messageId'],'inReplyTo':_0x26351e[_0x7c2c('0x3b')],'sentAt':moment(_0x26351e['date'])[_0x7c2c('0x2d')](_0x7c2c('0x3c')),'attach':![],'attachments':[]}};if(!_0x26351e['html']&&!_0x26351e['textAsHtml']){var _0x41413a=_[_0x7c2c('0x3d')](_0x26351e['attachments'],{'contentType':_0x7c2c('0x3e')});if(_0x41413a['length']){logger['info'](util[_0x7c2c('0x2d')](_0x7c2c('0x3f'),_0x26351e[_0x7c2c('0x40')]));tnef[_0x7c2c('0x41')](_[_0x7c2c('0x42')](_0x41413a)[_0x7c2c('0x31')],function(_0x2b0781,_0x20f7d9){if(_0x20f7d9){_0x26351e[_0x7c2c('0x17')]=_0x20f7d9['BodyHTML']||'

Empty\x20message

';if(_0x20f7d9[_0x7c2c('0x43')]){for(var _0x3091bd=0x0;_0x3091bd<_0x20f7d9[_0x7c2c('0x43')]['length'];_0x3091bd++){var _0x59bdc7=_0x20f7d9[_0x7c2c('0x43')][_0x3091bd];_0x23fdcf[_0x7c2c('0x25')][_0x7c2c('0x1b')][_0x7c2c('0x32')]({'filename':_0x59bdc7['Title'],'content':Buffer['from'](_0x59bdc7['Data'])});}}}_0x4f3948(parseEmail(_0x9b9813,_0x26351e,_0x23fdcf));});}else{_0x26351e[_0x7c2c('0x17')]=_0x7c2c('0x44');_0x4f3948(parseEmail(_0x9b9813,_0x26351e,_0x23fdcf));}}else{_0x4f3948(parseEmail(_0x9b9813,_0x26351e,_0x23fdcf));}};exports[_0x7c2c('0x45')]=function(_0x27a096){switch(_0x27a096){case _0x7c2c('0x46'):return'imap.gmail.com';case _0x7c2c('0x47'):return _0x7c2c('0x48');case'hotmail':return _0x7c2c('0x49');case'outlook365':return _0x7c2c('0x4a');}return _0x7c2c('0x4b');}; \ No newline at end of file +var _0x0b78=['_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Data','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','moment','randomstring','path','node-tnef','../../../config/logger','head','value','address','anonymous','@xcally.com','name','indexOf','slice','join','Anonymous','pop','length','isEmpty','generate','html','replace','includes','0x1?_0x1e8046[_0x80b7('0xc')](0x0,-0x1)[_0x80b7('0xd')]('\x20'):_0x225fb1[_0x80b7('0xa')];}return _0x80b7('0xe');}function getLastName(_0x281c95){var _0x1b62ac=_[_0x80b7('0x5')](_0x281c95[_0x80b7('0x6')]);if(_0x1b62ac&&_0x1b62ac[_0x80b7('0xa')]){var _0x56e1ec=_0x1b62ac['name']['split'](/\s+/);return _0x56e1ec['length']>0x1?_0x56e1ec[_0x80b7('0xf')]():'';}return'';}function getMails(_0x459f67,_0x289c93){var _0x1e0d8f='';for(var _0x6c9f31=0x0;_0x6c9f31<_0x289c93[_0x80b7('0x6')][_0x80b7('0x10')];_0x6c9f31+=0x1){if(_0x289c93[_0x80b7('0x6')][_0x6c9f31][_0x80b7('0x7')]!==_0x459f67){if(!_[_0x80b7('0x11')](_0x1e0d8f)){_0x1e0d8f+=',';}_0x1e0d8f+=_0x289c93[_0x80b7('0x6')][_0x6c9f31][_0x80b7('0xa')]||_0x289c93[_0x80b7('0x6')][_0x6c9f31]['address']||'';_0x1e0d8f+='\x20<';_0x1e0d8f+=_0x289c93[_0x80b7('0x6')][_0x6c9f31][_0x80b7('0x7')]?_0x289c93[_0x80b7('0x6')][_0x6c9f31][_0x80b7('0x7')]:_0x80b7('0x8')+random[_0x80b7('0x12')](0x6)+_0x80b7('0x9');_0x1e0d8f+='>';}}return _0x1e0d8f;}function parseEmail(_0x2c99a0,_0x3da240,_0x9cf6aa){if(_0x3da240[_0x80b7('0x13')]){var _0x1ef249=/)<[^<]*)*<\/script>/gi;while(_0x1ef249['test'](_0x3da240['html'])){_0x3da240[_0x80b7('0x13')]=_0x3da240[_0x80b7('0x13')][_0x80b7('0x14')](_0x1ef249,'');}if(_0x3da240['html'][_0x80b7('0x15')](_0x80b7('0x16'))){var _0x3c0560=[];_0x3da240[_0x80b7('0x17')][_0x80b7('0x18')](_0x397e34=>{_0x3c0560[_0x80b7('0x19')](_0x397e34[_0x80b7('0x1a')]);});var _0x23a876=/]+>/g;var _0x426bf0=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1221c7=_0x3da240['html'][_0x80b7('0x14')](_0x426bf0,_0x80b7('0x1b'));var _0x6fbf86=_0x1221c7[_0x80b7('0x14')](_0x23a876,_0x80b7('0x1c'));for(let _0x238fee=0x0;_0x238fee<_0x3c0560[_0x80b7('0x10')];_0x238fee++){var _0x14044d=_0x6fbf86['replace'](_0x80b7('0x1c'),_0x80b7('0x1d')+_0x3c0560[_0x238fee]+_0x80b7('0x1e'));_0x6fbf86=_0x14044d;}_0x3da240[_0x80b7('0x13')]=_0x6fbf86;}_0x9cf6aa[_0x80b7('0x1f')]=_0x3da240['html'];}else{_0x9cf6aa[_0x80b7('0x1f')]=_0x3da240[_0x80b7('0x20')];}if(_0x9cf6aa[_0x80b7('0x1f')]){_0x9cf6aa[_0x80b7('0x1f')]=_0x9cf6aa[_0x80b7('0x1f')][_0x80b7('0x14')](/0x0){var _0x4147ec=['Auto-Submitted:\x20auto-replied',_0x80b7('0x2f'),'Precedence:\x20auto_reply'];for(var _0x498124=0x0;_0x498124<_0x3da240[_0x80b7('0x2e')][_0x80b7('0x10')];_0x498124++){var _0x1b1b68=_[_0x80b7('0xb')](_0x4147ec,_0x3da240[_0x80b7('0x2e')][_0x498124][_0x80b7('0x30')]);if(_0x1b1b68>=0x0){_0x9cf6aa[_0x80b7('0x31')]=!![];}}}return _0x9cf6aa;}exports[_0x80b7('0x32')]=function(_0xa5d1bf,_0x190d41,_0x21331f){var _0x258250={'from':getAddress(_0x190d41['from']),'firstName':getFirstName(_0x190d41[_0x80b7('0x33')]),'lastName':getLastName(_0x190d41[_0x80b7('0x33')]),'mapKey':_0x80b7('0x25'),'message':{'from':getMails(_0xa5d1bf[_0x80b7('0x25')],_0x190d41[_0x80b7('0x33')]),'to':_0xa5d1bf[_0x80b7('0x25')],'cc':'','subject':_0x190d41[_0x80b7('0x34')]||'','messageId':_0x190d41[_0x80b7('0x35')],'inReplyTo':_0x190d41[_0x80b7('0x36')],'sentAt':moment(_0x190d41[_0x80b7('0x37')])[_0x80b7('0x2a')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x190d41[_0x80b7('0x13')]&&!_0x190d41['textAsHtml']){var _0x20a4d5=_[_0x80b7('0x38')](_0x190d41[_0x80b7('0x17')],{'contentType':_0x80b7('0x39')});if(_0x20a4d5['length']){logger[_0x80b7('0x3a')](util[_0x80b7('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x190d41[_0x80b7('0x35')]));tnef[_0x80b7('0x3b')](_['first'](_0x20a4d5)[_0x80b7('0x3c')],function(_0x1b6a19,_0x590204){if(_0x590204){_0x190d41['html']=_0x590204[_0x80b7('0x3d')]||_0x80b7('0x3e');if(_0x590204[_0x80b7('0x3f')]){for(var _0x29bee7=0x0;_0x29bee7<_0x590204[_0x80b7('0x3f')][_0x80b7('0x10')];_0x29bee7++){var _0x19fe59=_0x590204['Attachments'][_0x29bee7];_0x258250['message']['attachments']['push']({'filename':_0x19fe59['Title'],'content':Buffer['from'](_0x19fe59[_0x80b7('0x40')])});}}}_0x21331f(parseEmail(_0xa5d1bf,_0x190d41,_0x258250));});}else{_0x190d41[_0x80b7('0x13')]=_0x80b7('0x3e');_0x21331f(parseEmail(_0xa5d1bf,_0x190d41,_0x258250));}}else{_0x21331f(parseEmail(_0xa5d1bf,_0x190d41,_0x258250));}};exports['getHost']=function(_0x3aab8e){switch(_0x3aab8e){case _0x80b7('0x41'):return _0x80b7('0x42');case'yahoo':return _0x80b7('0x43');case'hotmail':return _0x80b7('0x44');case _0x80b7('0x45'):return _0x80b7('0x46');}return'127.0.0.1';}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index da5aeff..7f01cca 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 _0xb587=['SERV','active','Imap','Smtp','exports','name','Service','key'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0xb587,0x185));var _0x7b58=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb587[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');function MailAccount(_0xe673c7){this['id']=_0xe673c7['id']||0x0;this[_0x7b58('0x0')]=_0xe673c7[_0x7b58('0x0')]||_0x7b58('0x1');this['key']=_0xe673c7[_0x7b58('0x2')]||_0x7b58('0x3');this[_0x7b58('0x4')]=_0xe673c7[_0x7b58('0x4')]||![];this[_0x7b58('0x5')]=_0xe673c7[_0x7b58('0x5')]||[];this['Smtp']=_0xe673c7[_0x7b58('0x6')]||[];}module[_0x7b58('0x7')]=MailAccount; \ No newline at end of file +var _0xe501=['name','key','Imap','Smtp'];(function(_0x188a93,_0xaf57db){var _0x23b40d=function(_0x599f63){while(--_0x599f63){_0x188a93['push'](_0x188a93['shift']());}};_0x23b40d(++_0xaf57db);}(_0xe501,0xdc));var _0x1e50=function(_0x58b62c,_0x563a8e){_0x58b62c=_0x58b62c-0x0;var _0x471ade=_0xe501[_0x58b62c];return _0x471ade;};'use strict';var _=require('lodash');function MailAccount(_0x4e83d3){this['id']=_0x4e83d3['id']||0x0;this[_0x1e50('0x0')]=_0x4e83d3[_0x1e50('0x0')]||'Service';this['key']=_0x4e83d3[_0x1e50('0x1')]||'SERV';this['active']=_0x4e83d3['active']||![];this[_0x1e50('0x2')]=_0x4e83d3['Imap']||[];this[_0x1e50('0x3')]=_0x4e83d3['Smtp']||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index d27084d..713e033 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 _0x4ec7=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x12baa2,_0x27a8c9){var _0x4f78f2=function(_0x5b3978){while(--_0x5b3978){_0x12baa2['push'](_0x12baa2['shift']());}};_0x4f78f2(++_0x27a8c9);}(_0x4ec7,0x19f));var _0x74ec=function(_0x376ddb,_0x1a9fa2){_0x376ddb=_0x376ddb-0x0;var _0x2ed7af=_0x4ec7[_0x376ddb];return _0x2ed7af;};'use strict';var _=require(_0x74ec('0x0'));var MailAccount=require(_0x74ec('0x1'));var Realtime=function(){this[_0x74ec('0x2')]={};};function freeIsNotKey(_0x37b419,_0x210940,_0x5a54da){var _0x43847a=_[_0x74ec('0x3')](_0x37b419,function(_0x3b0ad2,_0x53e60f){return _0x3b0ad2[_0x5a54da];});for(var _0x1a3f09 in _0x210940){if(_0x210940[_0x74ec('0x4')](_0x1a3f09)){if(!_0x43847a[_0x1a3f09]){delete _0x210940[_0x1a3f09];}}}}Realtime[_0x74ec('0x5')][_0x74ec('0x6')]=function(_0x2361d3,_0x52e39e){for(var _0x55cbfb in _0x52e39e){if(_0x2361d3[_0x74ec('0x4')](_0x55cbfb)){_0x2361d3[_0x55cbfb]=_0x52e39e[_0x55cbfb];}}};Realtime[_0x74ec('0x5')][_0x74ec('0x7')]=function(){var _0x214260=this;return function(_0x358f20){if(_0x358f20){freeIsNotKey(_0x358f20,_0x214260[_0x74ec('0x2')],'id');for(var _0x2902fe=0x0,_0x399919={},_0x2ceadb={};_0x2902fe<_0x358f20['length'];_0x2902fe+=0x1){_0x399919=_0x358f20[_0x2902fe];if(_[_0x74ec('0x8')](_0x214260[_0x74ec('0x2')][_0x399919['id']])){_0x214260[_0x74ec('0x2')][_0x399919['id']]=new MailAccount(_0x399919);}else{_[_0x74ec('0x9')](_0x214260[_0x74ec('0x2')][_0x399919['id']],_0x399919);}}}return _0x214260[_0x74ec('0x2')];};};module[_0x74ec('0xa')]=Realtime; \ No newline at end of file +var _0x414a=['../model/mailAccount','mailAccounts','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','isUndefined','merge','exports','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x414a,0x18f));var _0xa414=function(_0x1625ce,_0x5c4bda){_0x1625ce=_0x1625ce-0x0;var _0xcf420f=_0x414a[_0x1625ce];return _0xcf420f;};'use strict';var _=require(_0xa414('0x0'));var MailAccount=require(_0xa414('0x1'));var Realtime=function(){this[_0xa414('0x2')]={};};function freeIsNotKey(_0x2fa1a5,_0xf9f339,_0x74180e){var _0x53304b=_['mapKeys'](_0x2fa1a5,function(_0x350f58,_0x3e861d){return _0x350f58[_0x74180e];});for(var _0x1105d7 in _0xf9f339){if(_0xf9f339[_0xa414('0x3')](_0x1105d7)){if(!_0x53304b[_0x1105d7]){delete _0xf9f339[_0x1105d7];}}}}Realtime[_0xa414('0x4')][_0xa414('0x5')]=function(_0x1b3d00,_0x5c5331){for(var _0x593e43 in _0x5c5331){if(_0x1b3d00['hasOwnProperty'](_0x593e43)){_0x1b3d00[_0x593e43]=_0x5c5331[_0x593e43];}}};Realtime[_0xa414('0x4')][_0xa414('0x6')]=function(){var _0x3426f6=this;return function(_0x2bbf4d){if(_0x2bbf4d){freeIsNotKey(_0x2bbf4d,_0x3426f6[_0xa414('0x2')],'id');for(var _0x32e087=0x0,_0x277a1f={},_0x5d3579={};_0x32e087<_0x2bbf4d['length'];_0x32e087+=0x1){_0x277a1f=_0x2bbf4d[_0x32e087];if(_[_0xa414('0x7')](_0x3426f6[_0xa414('0x2')][_0x277a1f['id']])){_0x3426f6['mailAccounts'][_0x277a1f['id']]=new MailAccount(_0x277a1f);}else{_[_0xa414('0x8')](_0x3426f6[_0xa414('0x2')][_0x277a1f['id']],_0x277a1f);}}}return _0x3426f6[_0xa414('0x2')];};};module[_0xa414('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 42515bf..a8c5a9b 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 _0x6d5e=['key','ListId','TemplateId','MailServerIn','MailServerOut','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','service','email','active'];(function(_0x38ab27,_0x53f027){var _0x4158bc=function(_0x11ee95){while(--_0x11ee95){_0x38ab27['push'](_0x38ab27['shift']());}};_0x4158bc(++_0x53f027);}(_0x6d5e,0x103));var _0xe6d5=function(_0x3102e0,_0xa94277){_0x3102e0=_0x3102e0-0x0;var _0x313db2=_0x6d5e[_0x3102e0];return _0x313db2;};'use strict';var client=require(_0xe6d5('0x0'));exports[_0xe6d5('0x1')]=function(){return function(){return client[_0xe6d5('0x2')](_0xe6d5('0x3'),{'options':{'attributes':['id','name',_0xe6d5('0x4'),_0xe6d5('0x5'),_0xe6d5('0x6'),_0xe6d5('0x7'),_0xe6d5('0x8'),_0xe6d5('0x9')],'raw':![],'include':[{'model':_0xe6d5('0xa'),'as':'Imap'},{'model':_0xe6d5('0xb'),'as':'Smtp'}]},'log':_0xe6d5('0xc')});};};exports['notify']=function(_0x572986,_0x52913e){return client['Request'](_0xe6d5('0xd'),{'account':{'id':_0x572986},'body':_0x52913e,'log':_0xe6d5('0xd')});}; \ No newline at end of file +var _0x9b0d=['getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','email','active','key','ListId','MailServerIn','Imap','MailServerOut','Smtp'];(function(_0x9fd47,_0xf376c2){var _0x215758=function(_0x2b46f0){while(--_0x2b46f0){_0x9fd47['push'](_0x9fd47['shift']());}};_0x215758(++_0xf376c2);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x5c1be4,_0x5a7376){_0x5c1be4=_0x5c1be4-0x0;var _0x1aa6f4=_0x9b0d[_0x5c1be4];return _0x1aa6f4;};'use strict';var client=require('../client');exports[_0xd9b0('0x0')]=function(){return function(){return client[_0xd9b0('0x1')](_0xd9b0('0x2'),{'options':{'attributes':['id',_0xd9b0('0x3'),'service',_0xd9b0('0x4'),_0xd9b0('0x5'),_0xd9b0('0x6'),_0xd9b0('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xd9b0('0x8'),'as':_0xd9b0('0x9')},{'model':_0xd9b0('0xa'),'as':_0xd9b0('0xb')}]},'log':_0xd9b0('0xc')});};};exports[_0xd9b0('0xd')]=function(_0x33f402,_0x510adc){return client[_0xd9b0('0x1')](_0xd9b0('0xe'),{'account':{'id':_0x33f402},'body':_0x510adc,'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 9f0abbc..934d0cd 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 _0xf406=['getSettings','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x2b84d5,_0x175ffa){var _0x48dbf7=function(_0x855ae0){while(--_0x855ae0){_0x2b84d5['push'](_0x2b84d5['shift']());}};_0x48dbf7(++_0x175ffa);}(_0xf406,0x1a8));var _0x6f40=function(_0x57e50b,_0x16e856){_0x57e50b=_0x57e50b-0x0;var _0x4a1016=_0xf406[_0x57e50b];return _0x4a1016;};'use strict';var client=require(_0x6f40('0x0'));exports[_0x6f40('0x1')]=function(){return client['Request'](_0x6f40('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6f40('0x3')]},'log':_0x6f40('0x4')});}; \ No newline at end of file +var _0x0da9=['Request','ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x285299,_0x796bcf){var _0x5a91f9=function(_0x535a7c){while(--_0x535a7c){_0x285299['push'](_0x285299['shift']());}};_0x5a91f9(++_0x796bcf);}(_0x0da9,0xb8));var _0x90da=function(_0x413e48,_0x2bf197){_0x413e48=_0x413e48-0x0;var _0x22c817=_0x0da9[_0x413e48];return _0x22c817;};'use strict';var client=require('../client');exports[_0x90da('0x0')]=function(){return client[_0x90da('0x1')](_0x90da('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x90da('0x3')]},'log':_0x90da('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 05654ce..638f535 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 c49be9d..41eed90 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 _0xf4e6=['default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0xf4e6,0x128));var _0x6f4e=function(_0x57e00e,_0x36e79a){_0x57e00e=_0x57e00e-0x0;var _0x415e60=_0xf4e6[_0x57e00e];return _0x415e60;};'use strict';var _=require(_0x6f4e('0x0'));var http=require(_0x6f4e('0x1'));var express=require('express');var sticky=require(_0x6f4e('0x2'));var Redis=require(_0x6f4e('0x3'));var config=require(_0x6f4e('0x4'));var app=express();var server=http[_0x6f4e('0x5')](app);server[_0x6f4e('0x6')]=0xdbba0;if(sticky[_0x6f4e('0x7')](server,config['port'])){var socketio=require(_0x6f4e('0x8'))(server,{'transports':[_0x6f4e('0x9'),_0x6f4e('0xa')]});config[_0x6f4e('0xb')]=_[_0x6f4e('0xc')](config[_0x6f4e('0xb')],{'host':_0x6f4e('0xd'),'port':0x18eb});socketio[_0x6f4e('0xe')](require(_0x6f4e('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x6f4e('0xb')])}));require('../../config/triggers')[_0x6f4e('0x10')]();require(_0x6f4e('0x11'))[_0x6f4e('0x10')](socketio);require(_0x6f4e('0x12'))[_0x6f4e('0x10')](app);require(_0x6f4e('0x13'))[_0x6f4e('0x10')](app);}else{server[_0x6f4e('0x14')](_0x6f4e('0x15'),function(){console[_0x6f4e('0x16')](_0x6f4e('0x17'),config[_0x6f4e('0x18')]);});}exports=module[_0x6f4e('0x19')]=app; \ No newline at end of file +var _0x9b2d=['polling','redis','adapter','socket.io-redis','default','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','sticky-session','../../config/environment','createServer','listen','socket.io'];(function(_0x1e3168,_0x8d5655){var _0x3c0012=function(_0x24d19d){while(--_0x24d19d){_0x1e3168['push'](_0x1e3168['shift']());}};_0x3c0012(++_0x8d5655);}(_0x9b2d,0x107));var _0xd9b2=function(_0x134827,_0x21f6ed){_0x134827=_0x134827-0x0;var _0x366671=_0x9b2d[_0x134827];return _0x366671;};'use strict';var _=require(_0xd9b2('0x0'));var http=require(_0xd9b2('0x1'));var express=require('express');var sticky=require(_0xd9b2('0x2'));var Redis=require('ioredis');var config=require(_0xd9b2('0x3'));var app=express();var server=http[_0xd9b2('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0xd9b2('0x5')](server,config['port'])){var socketio=require(_0xd9b2('0x6'))(server,{'transports':['websocket',_0xd9b2('0x7')]});config[_0xd9b2('0x8')]=_['defaults'](config[_0xd9b2('0x8')],{'host':'localhost','port':0x18eb});socketio[_0xd9b2('0x9')](require(_0xd9b2('0xa'))({'pubClient':new Redis(config[_0xd9b2('0x8')]),'subClient':new Redis(config[_0xd9b2('0x8')])}));require('../../config/triggers')[_0xd9b2('0xb')]();require('../../config/socketio')[_0xd9b2('0xb')](socketio);require(_0xd9b2('0xc'))[_0xd9b2('0xb')](app);require(_0xd9b2('0xd'))['default'](app);}else{server[_0xd9b2('0xe')]('listening',function(){console['log'](_0xd9b2('0xf'),config[_0xd9b2('0x10')]);});}exports=module[_0xd9b2('0x11')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 40cb202..3d3522d 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 _0x3f40=['debug','rpc','error','message','catch','exports','jayson/promise','../../config/logger','http','Request','request','then'];(function(_0x3fca12,_0x15fb5d){var _0x5b2b83=function(_0x4d8d05){while(--_0x4d8d05){_0x3fca12['push'](_0x3fca12['shift']());}};_0x5b2b83(++_0x15fb5d);}(_0x3f40,0x8a));var _0x03f4=function(_0x5d4106,_0x2eec2a){_0x5d4106=_0x5d4106-0x0;var _0x4ec52f=_0x3f40[_0x5d4106];return _0x4ec52f;};'use strict';var jayson=require(_0x03f4('0x0'));var BPromise=require('bluebird');var logger=require(_0x03f4('0x1'))('routing');var client=jayson['client'][_0x03f4('0x2')]({'port':0x2329});client[_0x03f4('0x3')]=function(_0x4467c8,_0x122e69){return new BPromise(function(_0x2739a0,_0x4bf1f4){return client[_0x03f4('0x4')](_0x4467c8,_0x122e69)[_0x03f4('0x5')](function(_0x1838f0){logger[_0x03f4('0x6')](_0x03f4('0x7'),'routing',_0x4467c8,_0x122e69,_0x1838f0);if(_0x1838f0[_0x03f4('0x8')]){logger[_0x03f4('0x8')](_0x03f4('0x7'),'routing',_0x4467c8,_0x1838f0['error'][_0x03f4('0x9')],_0x122e69);return _0x4bf1f4(_0x1838f0[_0x03f4('0x8')]['message']);}else{return _0x2739a0(_0x1838f0['result']);}})[_0x03f4('0xa')](function(_0x48cc20){logger[_0x03f4('0x8')]('rpc','routing',_0x4467c8,_0x48cc20,_0x122e69);return _0x4bf1f4(_0x48cc20);});});};module[_0x03f4('0xb')]=client; \ No newline at end of file +var _0xf77e=['../../config/logger','routing','client','http','request','then','debug','rpc','error','message','catch','exports','bluebird'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf77e,0x192));var _0xef77=function(_0x3b7f0c,_0x5d9140){_0x3b7f0c=_0x3b7f0c-0x0;var _0x2c6a4c=_0xf77e[_0x3b7f0c];return _0x2c6a4c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xef77('0x0'));var logger=require(_0xef77('0x1'))(_0xef77('0x2'));var client=jayson[_0xef77('0x3')][_0xef77('0x4')]({'port':0x2329});client['Request']=function(_0x27890d,_0x49f259){return new BPromise(function(_0x1c21e2,_0x5a5b3c){return client[_0xef77('0x5')](_0x27890d,_0x49f259)[_0xef77('0x6')](function(_0x30a962){logger[_0xef77('0x7')](_0xef77('0x8'),_0xef77('0x2'),_0x27890d,_0x49f259,_0x30a962);if(_0x30a962['error']){logger[_0xef77('0x9')](_0xef77('0x8'),'routing',_0x27890d,_0x30a962['error'][_0xef77('0xa')],_0x49f259);return _0x5a5b3c(_0x30a962[_0xef77('0x9')][_0xef77('0xa')]);}else{return _0x1c21e2(_0x30a962['result']);}})[_0xef77('0xb')](function(_0x28e69e){logger[_0xef77('0x9')](_0xef77('0x8'),_0xef77('0x2'),_0x27890d,_0x28e69e,_0x49f259);return _0x5a5b3c(_0x28e69e);});});};module[_0xef77('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 7a2b948..f992a8b 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 _0xd83d=['resolve','then','getAgents','initAgents','getIntervals','initIntervals','getChatQueues','getSmsQueues','initSmsQueues','initMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue'];(function(_0x165ea7,_0x53080a){var _0x50dbaa=function(_0xe2fbb0){while(--_0xe2fbb0){_0x165ea7['push'](_0x165ea7['shift']());}};_0x50dbaa(++_0x53080a);}(_0xd83d,0x7d));var _0xdd83=function(_0x2b60c8,_0x35e7aa){_0x2b60c8=_0x2b60c8-0x0;var _0x142f50=_0xd83d[_0x2b60c8];return _0x142f50;};'use strict';var BPromise=require('bluebird');var server=require(_0xdd83('0x0'));var Realtime=require(_0xdd83('0x1'));var user=require(_0xdd83('0x2'));var interval=require(_0xdd83('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xdd83('0x4'));var smsQueue=require(_0xdd83('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xdd83('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xdd83('0x7')]()[_0xdd83('0x8')](user[_0xdd83('0x9')]())[_0xdd83('0x8')](realtime[_0xdd83('0xa')]())[_0xdd83('0x8')](interval[_0xdd83('0xb')]())[_0xdd83('0x8')](realtime[_0xdd83('0xc')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xdd83('0x8')](realtime['initOpenchannelQueues']())[_0xdd83('0x8')](chatQueue[_0xdd83('0xd')]())['then'](realtime['initChatQueues']())[_0xdd83('0x8')](smsQueue[_0xdd83('0xe')]())[_0xdd83('0x8')](realtime[_0xdd83('0xf')]())[_0xdd83('0x8')](mailQueue['getMailQueues']())[_0xdd83('0x8')](realtime[_0xdd83('0x10')]())[_0xdd83('0x8')](faxQueue[_0xdd83('0x11')]())[_0xdd83('0x8')](realtime['initFaxQueues']())[_0xdd83('0x8')](whatsappQueue['getWhatsappQueues']())[_0xdd83('0x8')](realtime[_0xdd83('0x12')]())[_0xdd83('0x8')](function(){return realtime;});}function main(){return server[_0xdd83('0x13')](realtime)['then'](function(_0x5c8ce4){return initRealtime();})[_0xdd83('0x8')](function(_0x1720bb){return setInterval(initRealtime,0x1388);})[_0xdd83('0x14')](function(_0x49697a){console[_0xdd83('0x15')](_0x49697a);});}main(); \ No newline at end of file +var _0x8ab8=['./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','./realtime'];(function(_0x205176,_0x24e400){var _0x22c133=function(_0x3789f3){while(--_0x3789f3){_0x205176['push'](_0x205176['shift']());}};_0x22c133(++_0x24e400);}(_0x8ab8,0xc7));var _0x88ab=function(_0x18a99a,_0x21b7f2){_0x18a99a=_0x18a99a-0x0;var _0x210e2a=_0x8ab8[_0x18a99a];return _0x210e2a;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x88ab('0x0'));var user=require('./rpc/user');var interval=require(_0x88ab('0x1'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x88ab('0x2'));var mailQueue=require(_0x88ab('0x3'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x88ab('0x4'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x88ab('0x5')]()[_0x88ab('0x6')](user['getAgents']())[_0x88ab('0x6')](realtime[_0x88ab('0x7')]())['then'](interval[_0x88ab('0x8')]())[_0x88ab('0x6')](realtime[_0x88ab('0x9')]())[_0x88ab('0x6')](openchannelQueue[_0x88ab('0xa')]())[_0x88ab('0x6')](realtime[_0x88ab('0xb')]())[_0x88ab('0x6')](chatQueue['getChatQueues']())[_0x88ab('0x6')](realtime[_0x88ab('0xc')]())['then'](smsQueue[_0x88ab('0xd')]())[_0x88ab('0x6')](realtime[_0x88ab('0xe')]())[_0x88ab('0x6')](mailQueue[_0x88ab('0xf')]())[_0x88ab('0x6')](realtime['initMailQueues']())[_0x88ab('0x6')](faxQueue[_0x88ab('0x10')]())[_0x88ab('0x6')](realtime['initFaxQueues']())['then'](whatsappQueue[_0x88ab('0x11')]())[_0x88ab('0x6')](realtime[_0x88ab('0x12')]())[_0x88ab('0x6')](function(){return realtime;});}function main(){return server[_0x88ab('0x13')](realtime)[_0x88ab('0x6')](function(_0xb76512){return initRealtime();})['then'](function(_0x831014){return setInterval(initRealtime,0x1388);})['catch'](function(_0x59e060){console['log'](_0x59e060);});}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 df16618..308f9f6 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x4ae024,_0x2e3bfc){var _0x1b0f81=function(_0x52417d){while(--_0x52417d){_0x4ae024['push'](_0x4ae024['shift']());}};_0x1b0f81(++_0x2e3bfc);}(_0x5fc3,0xa8));var _0x35fc=function(_0xc0d9bc,_0x2bd6be){_0xc0d9bc=_0xc0d9bc-0x0;var _0x32ff73=_0x5fc3[_0xc0d9bc];return _0x32ff73;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x1ffff7,_0x2f9ff6){var _0x49d017=function(_0x1d2483){while(--_0x1d2483){_0x1ffff7['push'](_0x1ffff7['shift']());}};_0x49d017(++_0x2f9ff6);}(_0x814b,0x1a2));var _0xb814=function(_0x11c090,_0x7d8e4e){_0x11c090=_0x11c090-0x0;var _0x444c13=_0x814b[_0x11c090];return _0x444c13;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index cca6585..ece31a3 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 _0xa0ae=['catch','sendMailMessage','SendMail','jayson/promise','client','request','then','error','message'];(function(_0x23fd05,_0x55e532){var _0x4eb46c=function(_0x59e7c2){while(--_0x59e7c2){_0x23fd05['push'](_0x23fd05['shift']());}};_0x4eb46c(++_0x55e532);}(_0xa0ae,0x111));var _0xea0a=function(_0x18f80b,_0x46368a){_0x18f80b=_0x18f80b-0x0;var _0x54a62d=_0xa0ae[_0x18f80b];return _0x54a62d;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xea0a('0x0'));var client=jayson[_0xea0a('0x1')]['http']({'port':0x232b});function request(_0x192135,_0x468b3a){return new BPromise(function(_0x3972a8,_0x4ca951){return client[_0xea0a('0x2')](_0x192135,_0x468b3a)[_0xea0a('0x3')](function(_0xb4f65a){if(_0xb4f65a[_0xea0a('0x4')]){return _0x4ca951(_0xb4f65a[_0xea0a('0x4')][_0xea0a('0x5')]);}else{return _0x3972a8(_0xb4f65a['result']);}})[_0xea0a('0x6')](function(_0x25e528){return _0x4ca951(_0x25e528);});});}exports[_0xea0a('0x7')]=function(_0xd7eff6,_0x337d5c){return request(_0xea0a('0x8'),{'account':_0xd7eff6,'message':_0x337d5c});}; \ No newline at end of file +var _0x5754=['client','request','then','error','message','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x34a0e1,_0x316457){var _0x38dfa8=function(_0x523e8f){while(--_0x523e8f){_0x34a0e1['push'](_0x34a0e1['shift']());}};_0x38dfa8(++_0x316457);}(_0x5754,0x14b));var _0x4575=function(_0x30989e,_0x430ef9){_0x30989e=_0x30989e-0x0;var _0x5255ba=_0x5754[_0x30989e];return _0x5255ba;};'use strict';var BPromise=require(_0x4575('0x0'));var jayson=require(_0x4575('0x1'));var client=jayson[_0x4575('0x2')]['http']({'port':0x232b});function request(_0x2402e3,_0x2bca1b){return new BPromise(function(_0x1dc81f,_0x1c4243){return client[_0x4575('0x3')](_0x2402e3,_0x2bca1b)[_0x4575('0x4')](function(_0x2468f3){if(_0x2468f3['error']){return _0x1c4243(_0x2468f3[_0x4575('0x5')][_0x4575('0x6')]);}else{return _0x1dc81f(_0x2468f3['result']);}})['catch'](function(_0x2f01f3){return _0x1c4243(_0x2f01f3);});});}exports[_0x4575('0x7')]=function(_0x19f867,_0x4558d3){return request(_0x4575('0x8'),{'account':_0x19f867,'message':_0x4558d3});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 94c7eb3..c2c23e9 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 _0x3070=['redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','idle','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','chatStatus','smsStatus','smsCurrentCapacity','stringify','md5','emit','user:save','exports','moment','ioredis','../../../config/environment'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x3070,0x75));var _0x0307=function(_0x50461b,_0x4101e3){_0x50461b=_0x50461b-0x0;var _0x2cf0f3=_0x3070[_0x50461b];return _0x2cf0f3;};'use strict';var _=require('lodash');var moment=require(_0x0307('0x0'));var md5=require('md5');var Redis=require(_0x0307('0x1'));var config=require(_0x0307('0x2'));config[_0x0307('0x3')]=_[_0x0307('0x4')](config[_0x0307('0x3')],{'host':_0x0307('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x413a82){this['id']=_0x413a82['id']||0x0;this[_0x0307('0x6')]=_0x413a82[_0x0307('0x6')]||'';this[_0x0307('0x7')]=_0x413a82['online']||!![];this[_0x0307('0x8')]=_0x413a82[_0x0307('0x8')]||![];this['chatPause']=_0x413a82[_0x0307('0x9')]||![];this[_0x0307('0xa')]=_0x413a82[_0x0307('0xa')]||![];this[_0x0307('0xb')]=_0x413a82[_0x0307('0xb')]||![];this[_0x0307('0xc')]=_0x413a82[_0x0307('0xc')]||![];this[_0x0307('0xd')]=_0x413a82[_0x0307('0xd')]||![];this['chatStatus']=_0x0307('0xe');this['chatStatusTime']=0x0;this[_0x0307('0xf')]=_0x413a82[_0x0307('0xf')]||0x0;this[_0x0307('0x10')]=0x0;this[_0x0307('0x11')]=_0x0307('0xe');this[_0x0307('0x12')]=0x0;this[_0x0307('0x13')]=_0x413a82[_0x0307('0x13')]||0x0;this[_0x0307('0x14')]=0x0;this[_0x0307('0x15')]=_0x0307('0xe');this[_0x0307('0x16')]=0x0;this[_0x0307('0x17')]=_0x413a82[_0x0307('0x17')]||0x0;this[_0x0307('0x18')]=0x0;this['smsStatus']=_0x0307('0xe');this[_0x0307('0x19')]=0x0;this[_0x0307('0x1a')]=_0x413a82['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x0307('0x1b')]=_0x0307('0xe');this[_0x0307('0x1c')]=0x0;this[_0x0307('0x1d')]=_0x413a82[_0x0307('0x1d')]||0x0;this[_0x0307('0x1e')]=0x0;this[_0x0307('0x1f')]='unknown';this[_0x0307('0x20')]=0x0;this['openchannelCapacity']=_0x413a82[_0x0307('0x21')]||0x0;this[_0x0307('0x22')]=0x0;this[_0x0307('0x23')]=![];this[_0x0307('0x24')]=undefined;this['md5']='';this[_0x0307('0x25')]();}Agent[_0x0307('0x26')][_0x0307('0x27')]=function(_0x48bdac){if(this[_0x48bdac+'CurrentCapacity']>0x0){if(this[_0x48bdac+_0x0307('0x28')]>0x0&&this[_0x48bdac+_0x0307('0x29')]>=this[_0x48bdac+'Capacity']){return _0x0307('0x2a');}else{return'working';}}else{return _0x0307('0x2b');}};Agent[_0x0307('0x26')][_0x0307('0x25')]=function(){var _0x6c166e=['mail','chat',_0x0307('0x2c'),_0x0307('0x2d'),_0x0307('0x2e'),_0x0307('0x2f')];for(var _0x3fde2f=0x0;_0x3fde2f<_0x6c166e[_0x0307('0x30')];_0x3fde2f+=0x1){var _0x51a6cb=this[_0x0307('0x27')](_0x6c166e[_0x3fde2f]);if(this[_0x6c166e[_0x3fde2f]+'Status']!==_0x51a6cb){this[_0x6c166e[_0x3fde2f]+_0x0307('0x31')]=_[_0x0307('0x32')](moment()[_0x0307('0x33')]('x'));}this[_0x6c166e[_0x3fde2f]+'Status']=_0x51a6cb;}var _0x2c5a5b={'id':this['id'],'name':this[_0x0307('0x6')],'online':this[_0x0307('0x7')],'voicePause':this[_0x0307('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x0307('0xa')],'smsPause':this['smsPause'],'faxPause':this[_0x0307('0xb')],'openchannelPause':this[_0x0307('0xd')],'chatStatus':this[_0x0307('0x34')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x0307('0x10')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x0307('0x12')],'mailCapacity':this[_0x0307('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x0307('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x0307('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x0307('0x35')],'smsStatusTime':this[_0x0307('0x19')],'smsCapacity':this[_0x0307('0x1a')],'smsCurrentCapacity':this[_0x0307('0x36')],'whatsappStatus':this[_0x0307('0x1b')],'whatsappStatusTime':this[_0x0307('0x1c')],'whatsappCapacity':this[_0x0307('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x0307('0x1f')],'openchannelStatusTime':this[_0x0307('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x0307('0x23')],'busyQueue':this['busyQueue']};var _0x365b85=md5(JSON[_0x0307('0x37')](_0x2c5a5b));if(this[_0x0307('0x38')]!==_0x365b85){this[_0x0307('0x38')]=_0x365b85;io[_0x0307('0x39')](_0x0307('0x3a'),_0x2c5a5b);}};module[_0x0307('0x3b')]=Agent; \ No newline at end of file +var _0xe165=['openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','md5','prototype','CurrentCapacity','idle','updateRealtime','mail','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','chatPause','smsPause','mailStatus','faxCapacity','busy','stringify','emit','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','mailPause','faxPause'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xe165,0x190));var _0x5e16=function(_0x132eff,_0x4f91af){_0x132eff=_0x132eff-0x0;var _0x28d93e=_0xe165[_0x132eff];return _0x28d93e;};'use strict';var _=require(_0x5e16('0x0'));var moment=require(_0x5e16('0x1'));var md5=require('md5');var Redis=require(_0x5e16('0x2'));var config=require(_0x5e16('0x3'));config[_0x5e16('0x4')]=_[_0x5e16('0x5')](config[_0x5e16('0x4')],{'host':_0x5e16('0x6'),'port':0x18eb});var io=require(_0x5e16('0x7'))(new Redis(config[_0x5e16('0x4')]));function Agent(_0x38377c){this['id']=_0x38377c['id']||0x0;this[_0x5e16('0x8')]=_0x38377c[_0x5e16('0x8')]||'';this[_0x5e16('0x9')]=_0x38377c['online']||!![];this[_0x5e16('0xa')]=_0x38377c[_0x5e16('0xa')]||![];this['chatPause']=_0x38377c['chatPause']||![];this[_0x5e16('0xb')]=_0x38377c[_0x5e16('0xb')]||![];this[_0x5e16('0xc')]=_0x38377c[_0x5e16('0xc')]||![];this['smsPause']=_0x38377c['smsPause']||![];this[_0x5e16('0xd')]=_0x38377c['openchannelPause']||![];this[_0x5e16('0xe')]=_0x5e16('0xf');this[_0x5e16('0x10')]=0x0;this['chatCapacity']=_0x38377c[_0x5e16('0x11')]||0x0;this[_0x5e16('0x12')]=0x0;this['mailStatus']=_0x5e16('0xf');this[_0x5e16('0x13')]=0x0;this[_0x5e16('0x14')]=_0x38377c[_0x5e16('0x14')]||0x0;this[_0x5e16('0x15')]=0x0;this[_0x5e16('0x16')]=_0x5e16('0xf');this[_0x5e16('0x17')]=0x0;this['faxCapacity']=_0x38377c['faxCapacity']||0x0;this[_0x5e16('0x18')]=0x0;this[_0x5e16('0x19')]=_0x5e16('0xf');this['smsStatusTime']=0x0;this[_0x5e16('0x1a')]=_0x38377c[_0x5e16('0x1a')]||0x0;this[_0x5e16('0x1b')]=0x0;this[_0x5e16('0x1c')]='unknown';this[_0x5e16('0x1d')]=0x0;this[_0x5e16('0x1e')]=_0x38377c['whatsappCapacity']||0x0;this[_0x5e16('0x1f')]=0x0;this[_0x5e16('0x20')]=_0x5e16('0xf');this[_0x5e16('0x21')]=0x0;this[_0x5e16('0x22')]=_0x38377c[_0x5e16('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x5e16('0x23')]='';this['updateRealtime']();}Agent[_0x5e16('0x24')]['getChannelStatus']=function(_0x20f6bb){if(this[_0x20f6bb+_0x5e16('0x25')]>0x0){if(this[_0x20f6bb+'Capacity']>0x0&&this[_0x20f6bb+'CurrentCapacity']>=this[_0x20f6bb+'Capacity']){return'maxcapacity';}else{return'working';}}else{return _0x5e16('0x26');}};Agent[_0x5e16('0x24')][_0x5e16('0x27')]=function(){var _0x3c8151=[_0x5e16('0x28'),'chat',_0x5e16('0x29'),_0x5e16('0x2a'),_0x5e16('0x2b'),_0x5e16('0x2c')];for(var _0x1b0f6c=0x0;_0x1b0f6c<_0x3c8151[_0x5e16('0x2d')];_0x1b0f6c+=0x1){var _0x16a9b3=this[_0x5e16('0x2e')](_0x3c8151[_0x1b0f6c]);if(this[_0x3c8151[_0x1b0f6c]+_0x5e16('0x2f')]!==_0x16a9b3){this[_0x3c8151[_0x1b0f6c]+_0x5e16('0x30')]=_[_0x5e16('0x31')](moment()[_0x5e16('0x32')]('x'));}this[_0x3c8151[_0x1b0f6c]+_0x5e16('0x2f')]=_0x16a9b3;}var _0x963f1e={'id':this['id'],'name':this['name'],'online':this[_0x5e16('0x9')],'voicePause':this[_0x5e16('0xa')],'chatPause':this[_0x5e16('0x33')],'mailPause':this[_0x5e16('0xb')],'smsPause':this[_0x5e16('0x34')],'faxPause':this[_0x5e16('0xc')],'openchannelPause':this[_0x5e16('0xd')],'chatStatus':this[_0x5e16('0xe')],'chatStatusTime':this[_0x5e16('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x5e16('0x12')],'mailStatus':this[_0x5e16('0x35')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x5e16('0x14')],'mailCurrentCapacity':this[_0x5e16('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x5e16('0x17')],'faxCapacity':this[_0x5e16('0x36')],'faxCurrentCapacity':this[_0x5e16('0x18')],'smsStatus':this[_0x5e16('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x5e16('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x5e16('0x1f')],'openchannelStatus':this[_0x5e16('0x20')],'openchannelStatusTime':this[_0x5e16('0x21')],'openchannelCapacity':this[_0x5e16('0x22')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x5e16('0x37')],'busyQueue':this['busyQueue']};var _0x5cac4d=md5(JSON[_0x5e16('0x38')](_0x963f1e));if(this['md5']!==_0x5cac4d){this[_0x5e16('0x23')]=_0x5cac4d;io[_0x5e16('0x39')]('user:save',_0x963f1e);}};module[_0x5e16('0x3a')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 4a4dfc8..c4ce088 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 _0x3aca=['loggedIn','waiting','format','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','length','online','chatPause','paused','available'];(function(_0x49ea6d,_0x2a999c){var _0x1d2f5c=function(_0x22a761){while(--_0x22a761){_0x49ea6d['push'](_0x49ea6d['shift']());}};_0x1d2f5c(++_0x2a999c);}(_0x3aca,0x1eb));var _0xa3ac=function(_0x330723,_0x8de382){_0x330723=_0x330723-0x0;var _0x60c546=_0x3aca[_0x330723];return _0x60c546;};'use strict';var _=require(_0xa3ac('0x0'));var md5=require(_0xa3ac('0x1'));var util=require(_0xa3ac('0x2'));var Redis=require(_0xa3ac('0x3'));var config=require(_0xa3ac('0x4'));config[_0xa3ac('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa3ac('0x6'))(new Redis(config[_0xa3ac('0x5')]));function ChatQueue(_0xcc18ce){this['id']=_0xcc18ce['id']||0x0;this[_0xa3ac('0x7')]=_0xcc18ce[_0xa3ac('0x7')]||'';this[_0xa3ac('0x8')]=_0xcc18ce['timeout']||0xa;this[_0xa3ac('0x9')]=_0xcc18ce[_0xa3ac('0x9')]||'beepall';this[_0xa3ac('0xa')]=_0xcc18ce[_0xa3ac('0xa')];this[_0xa3ac('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xa3ac('0xc')]();this['updateRealtime']();}ChatQueue[_0xa3ac('0xd')][_0xa3ac('0xc')]=function(){var _0x198269=this[_0xa3ac('0xb')][_0xa3ac('0xe')];this['mapAgentsId']=_[_0xa3ac('0xf')](this[_0xa3ac('0xa')],'id');this['mapAgentsId'][_0xa3ac('0xe')]=_0x198269;};ChatQueue[_0xa3ac('0xd')][_0xa3ac('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x20bd5c=0x0;_0x20bd5c=0x0?this[_0xa3ac('0x15')]:0x0;var _0x15e296={'id':this['id'],'available':this[_0xa3ac('0x15')],'loggedIn':this[_0xa3ac('0x16')],'name':this[_0xa3ac('0x7')],'paused':this[_0xa3ac('0x14')],'waiting':this[_0xa3ac('0x17')]};var _0x36a5ab=md5(JSON['stringify'](_0x15e296));if(this[_0xa3ac('0x1')]!==_0x36a5ab){this[_0xa3ac('0x1')]=_0x36a5ab;io['to'](util[_0xa3ac('0x18')]('chat:queue:%s',_0x15e296[_0xa3ac('0x7')]))[_0xa3ac('0x19')]('chat_queue:save',_0x15e296);}};module[_0xa3ac('0x1a')]=ChatQueue; \ No newline at end of file +var _0xeae8=['available','format','chat:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','length','online','chatPause','paused'];(function(_0x49c0c1,_0x30503){var _0x2159e0=function(_0x1e6f1d){while(--_0x1e6f1d){_0x49c0c1['push'](_0x49c0c1['shift']());}};_0x2159e0(++_0x30503);}(_0xeae8,0x1b7));var _0x8eae=function(_0x1e17d2,_0x5c3dee){_0x1e17d2=_0x1e17d2-0x0;var _0x3063ae=_0xeae8[_0x1e17d2];return _0x3063ae;};'use strict';var _=require(_0x8eae('0x0'));var md5=require(_0x8eae('0x1'));var util=require(_0x8eae('0x2'));var Redis=require(_0x8eae('0x3'));var config=require(_0x8eae('0x4'));config[_0x8eae('0x5')]=_[_0x8eae('0x6')](config[_0x8eae('0x5')],{'host':_0x8eae('0x7'),'port':0x18eb});var io=require(_0x8eae('0x8'))(new Redis(config[_0x8eae('0x5')]));function ChatQueue(_0x23de9a){this['id']=_0x23de9a['id']||0x0;this[_0x8eae('0x9')]=_0x23de9a[_0x8eae('0x9')]||'';this[_0x8eae('0xa')]=_0x23de9a[_0x8eae('0xa')]||0xa;this[_0x8eae('0xb')]=_0x23de9a[_0x8eae('0xb')]||_0x8eae('0xc');this[_0x8eae('0xd')]=_0x23de9a[_0x8eae('0xd')];this[_0x8eae('0xe')]={};this[_0x8eae('0xf')]=0x0;this[_0x8eae('0x1')]='';this[_0x8eae('0x10')]();this['updateRealtime']();}ChatQueue[_0x8eae('0x11')][_0x8eae('0x10')]=function(){var _0x2ded3a=this['mapAgentsId'][_0x8eae('0x12')];this[_0x8eae('0xe')]=_['map'](this[_0x8eae('0xd')],'id');this[_0x8eae('0xe')][_0x8eae('0x12')]=_0x2ded3a;};ChatQueue['prototype'][_0x8eae('0x13')]=function(){this[_0x8eae('0x14')]=0x0;this['paused']=0x0;for(var _0x7aa096=0x0;_0x7aa096=0x0?this['available']:0x0;var _0x26d71c={'id':this['id'],'available':this[_0x8eae('0x19')],'loggedIn':this[_0x8eae('0x14')],'name':this['name'],'paused':this[_0x8eae('0x18')],'waiting':this['waiting']};var _0x298c9f=md5(JSON['stringify'](_0x26d71c));if(this[_0x8eae('0x1')]!==_0x298c9f){this[_0x8eae('0x1')]=_0x298c9f;io['to'](util[_0x8eae('0x1a')](_0x8eae('0x1b'),_0x26d71c[_0x8eae('0x9')]))['emit']('chat_queue:save',_0x26d71c);}};module[_0x8eae('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 f86b1e8..109fa99 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 _0xf576=['../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','_rr','map','updateRealtime','paused','online','faxPause','loggedIn','available','format','fax:queue:%s','emit','lodash','md5','util','ioredis'];(function(_0x57de35,_0x2ef99a){var _0x2a94eb=function(_0x2719e4){while(--_0x2719e4){_0x57de35['push'](_0x57de35['shift']());}};_0x2a94eb(++_0x2ef99a);}(_0xf576,0x114));var _0x6f57=function(_0x215f78,_0x16f698){_0x215f78=_0x215f78-0x0;var _0x19d6b5=_0xf576[_0x215f78];return _0x19d6b5;};'use strict';var _=require(_0x6f57('0x0'));var md5=require(_0x6f57('0x1'));var util=require(_0x6f57('0x2'));var Redis=require(_0x6f57('0x3'));var config=require(_0x6f57('0x4'));config['redis']=_[_0x6f57('0x5')](config[_0x6f57('0x6')],{'host':_0x6f57('0x7'),'port':0x18eb});var io=require(_0x6f57('0x8'))(new Redis(config[_0x6f57('0x6')]));function FaxQueue(_0x4f8b9b){this['id']=_0x4f8b9b['id']||0x0;this[_0x6f57('0x9')]=_0x4f8b9b[_0x6f57('0x9')]||'';this[_0x6f57('0xa')]=_0x4f8b9b['timeout']||0xa;this[_0x6f57('0xb')]=_0x4f8b9b[_0x6f57('0xb')]||_0x6f57('0xc');this['Agents']=_0x4f8b9b[_0x6f57('0xd')];this[_0x6f57('0xe')]={};this[_0x6f57('0xf')]=0x0;this[_0x6f57('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x6f57('0x10')]['updateRouting']=function(){var _0x27664b=this['mapAgentsId'][_0x6f57('0x11')];this['mapAgentsId']=_[_0x6f57('0x12')](this[_0x6f57('0xd')],'id');this['mapAgentsId'][_0x6f57('0x11')]=_0x27664b;};FaxQueue['prototype'][_0x6f57('0x13')]=function(){this['loggedIn']=0x0;this[_0x6f57('0x14')]=0x0;for(var _0x38bfd0=0x0;_0x38bfd0=0x0?this[_0x6f57('0x18')]:0x0;var _0x4345fd={'id':this['id'],'available':this[_0x6f57('0x18')],'loggedIn':this[_0x6f57('0x17')],'name':this[_0x6f57('0x9')],'paused':this[_0x6f57('0x14')],'waiting':this[_0x6f57('0xf')]};var _0x3fd2da=md5(JSON['stringify'](_0x4345fd));if(this[_0x6f57('0x1')]!==_0x3fd2da){this[_0x6f57('0x1')]=_0x3fd2da;io['to'](util[_0x6f57('0x19')](_0x6f57('0x1a'),_0x4345fd['name']))[_0x6f57('0x1b')]('fax_queue:save',_0x4345fd);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x525f=['Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','faxPause','available','stringify','format','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x525f,0xb2));var _0xf525=function(_0x47c668,_0x3deb25){_0x47c668=_0x47c668-0x0;var _0x1fafbf=_0x525f[_0x47c668];return _0x1fafbf;};'use strict';var _=require('lodash');var md5=require(_0xf525('0x0'));var util=require(_0xf525('0x1'));var Redis=require(_0xf525('0x2'));var config=require(_0xf525('0x3'));config[_0xf525('0x4')]=_[_0xf525('0x5')](config[_0xf525('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf525('0x6'))(new Redis(config[_0xf525('0x4')]));function FaxQueue(_0x2831f8){this['id']=_0x2831f8['id']||0x0;this[_0xf525('0x7')]=_0x2831f8[_0xf525('0x7')]||'';this[_0xf525('0x8')]=_0x2831f8['timeout']||0xa;this[_0xf525('0x9')]=_0x2831f8['strategy']||_0xf525('0xa');this[_0xf525('0xb')]=_0x2831f8[_0xf525('0xb')];this[_0xf525('0xc')]={};this['waiting']=0x0;this[_0xf525('0x0')]='';this[_0xf525('0xd')]();this[_0xf525('0xe')]();}FaxQueue[_0xf525('0xf')][_0xf525('0xd')]=function(){var _0x514aa8=this['mapAgentsId'][_0xf525('0x10')];this[_0xf525('0xc')]=_[_0xf525('0x11')](this[_0xf525('0xb')],'id');this['mapAgentsId'][_0xf525('0x10')]=_0x514aa8;};FaxQueue['prototype'][_0xf525('0xe')]=function(){this[_0xf525('0x12')]=0x0;this[_0xf525('0x13')]=0x0;for(var _0x47ef34=0x0;_0x47ef34=0x0?this[_0xf525('0x16')]:0x0;var _0x1d1e8d={'id':this['id'],'available':this[_0xf525('0x16')],'loggedIn':this[_0xf525('0x12')],'name':this['name'],'paused':this[_0xf525('0x13')],'waiting':this['waiting']};var _0x38a92c=md5(JSON[_0xf525('0x17')](_0x1d1e8d));if(this['md5']!==_0x38a92c){this['md5']=_0x38a92c;io['to'](util[_0xf525('0x18')]('fax:queue:%s',_0x1d1e8d[_0xf525('0x7')]))['emit'](_0xf525('0x19'),_0x1d1e8d);}};module[_0xf525('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index bbe0173..a1fa09b 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 _0xd738=['Intervals','exports','name'];(function(_0x421f5b,_0x79098){var _0x5d22d0=function(_0x5ba3b4){while(--_0x5ba3b4){_0x421f5b['push'](_0x421f5b['shift']());}};_0x5d22d0(++_0x79098);}(_0xd738,0x122));var _0x8d73=function(_0x11e8b7,_0x1bfe2a){_0x11e8b7=_0x11e8b7-0x0;var _0x3ee6d4=_0xd738[_0x11e8b7];return _0x3ee6d4;};'use strict';function Interval(_0x3d6dac){this['id']=_0x3d6dac['id']||0x0;this['name']=_0x3d6dac[_0x8d73('0x0')]||'';this[_0x8d73('0x1')]=_0x3d6dac[_0x8d73('0x1')]||{};}module[_0x8d73('0x2')]=Interval; \ No newline at end of file +var _0xfcc3=['Intervals','exports','name'];(function(_0xf022b,_0x785db2){var _0x48eaf7=function(_0x165d2e){while(--_0x165d2e){_0xf022b['push'](_0xf022b['shift']());}};_0x48eaf7(++_0x785db2);}(_0xfcc3,0x131));var _0x3fcc=function(_0x518688,_0x35c6b9){_0x518688=_0x518688-0x0;var _0x29c973=_0xfcc3[_0x518688];return _0x29c973;};'use strict';function Interval(_0xd06868){this['id']=_0xd06868['id']||0x0;this[_0x3fcc('0x0')]=_0xd06868[_0x3fcc('0x0')]||'';this[_0x3fcc('0x1')]=_0xd06868[_0x3fcc('0x1')]||{};}module[_0x3fcc('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 ef01953..bd43991 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 _0x0cfd=['lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','mailPause','available','stringify','format','emit','mail_queue:save','exports'];(function(_0xb6c999,_0x3328ae){var _0x2d8851=function(_0x4b59bd){while(--_0x4b59bd){_0xb6c999['push'](_0xb6c999['shift']());}};_0x2d8851(++_0x3328ae);}(_0x0cfd,0x1c2));var _0xd0cf=function(_0x2518a6,_0x5bed29){_0x2518a6=_0x2518a6-0x0;var _0x44948f=_0x0cfd[_0x2518a6];return _0x44948f;};'use strict';var _=require(_0xd0cf('0x0'));var md5=require('md5');var util=require(_0xd0cf('0x1'));var Redis=require(_0xd0cf('0x2'));var config=require('../../../config/environment');config[_0xd0cf('0x3')]=_[_0xd0cf('0x4')](config['redis'],{'host':_0xd0cf('0x5'),'port':0x18eb});var io=require(_0xd0cf('0x6'))(new Redis(config[_0xd0cf('0x3')]));function MailQueue(_0x44b149){this['id']=_0x44b149['id']||0x0;this[_0xd0cf('0x7')]=_0x44b149['name']||'';this[_0xd0cf('0x8')]=_0x44b149[_0xd0cf('0x8')]||0xa;this[_0xd0cf('0x9')]=_0x44b149[_0xd0cf('0x9')]||_0xd0cf('0xa');this[_0xd0cf('0xb')]=_0x44b149[_0xd0cf('0xb')];this[_0xd0cf('0xc')]={};this[_0xd0cf('0xd')]=0x0;this[_0xd0cf('0xe')]='';this[_0xd0cf('0xf')]();this[_0xd0cf('0x10')]();}MailQueue['prototype']['updateRouting']=function(){var _0x49ff24=this[_0xd0cf('0xc')][_0xd0cf('0x11')];this[_0xd0cf('0xc')]=_[_0xd0cf('0x12')](this[_0xd0cf('0xb')],'id');this[_0xd0cf('0xc')][_0xd0cf('0x11')]=_0x49ff24;};MailQueue[_0xd0cf('0x13')][_0xd0cf('0x10')]=function(){this[_0xd0cf('0x14')]=0x0;this[_0xd0cf('0x15')]=0x0;for(var _0x323fb7=0x0;_0x323fb7=0x0?this[_0xd0cf('0x18')]:0x0;var _0x31bb8f={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd0cf('0x14')],'name':this[_0xd0cf('0x7')],'paused':this[_0xd0cf('0x15')],'waiting':this[_0xd0cf('0xd')]};var _0x5ebbd2=md5(JSON[_0xd0cf('0x19')](_0x31bb8f));if(this[_0xd0cf('0xe')]!==_0x5ebbd2){this[_0xd0cf('0xe')]=_0x5ebbd2;io['to'](util[_0xd0cf('0x1a')]('mail:queue:%s',_0x31bb8f['name']))[_0xd0cf('0x1b')](_0xd0cf('0x1c'),_0x31bb8f);}};module[_0xd0cf('0x1d')]=MailQueue; \ No newline at end of file +var _0x4f58=['Agents','mapAgentsId','waiting','updateRealtime','updateRouting','map','prototype','loggedIn','paused','length','online','mailPause','available','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall'];(function(_0x132644,_0x3e7045){var _0x438960=function(_0x352963){while(--_0x352963){_0x132644['push'](_0x132644['shift']());}};_0x438960(++_0x3e7045);}(_0x4f58,0x117));var _0x84f5=function(_0x19a779,_0x188db1){_0x19a779=_0x19a779-0x0;var _0x32653b=_0x4f58[_0x19a779];return _0x32653b;};'use strict';var _=require(_0x84f5('0x0'));var md5=require(_0x84f5('0x1'));var util=require(_0x84f5('0x2'));var Redis=require(_0x84f5('0x3'));var config=require(_0x84f5('0x4'));config[_0x84f5('0x5')]=_['defaults'](config[_0x84f5('0x5')],{'host':_0x84f5('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x84f5('0x5')]));function MailQueue(_0x1d5e14){this['id']=_0x1d5e14['id']||0x0;this['name']=_0x1d5e14[_0x84f5('0x7')]||'';this[_0x84f5('0x8')]=_0x1d5e14[_0x84f5('0x8')]||0xa;this[_0x84f5('0x9')]=_0x1d5e14[_0x84f5('0x9')]||_0x84f5('0xa');this[_0x84f5('0xb')]=_0x1d5e14[_0x84f5('0xb')];this[_0x84f5('0xc')]={};this[_0x84f5('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x84f5('0xe')]();}MailQueue['prototype'][_0x84f5('0xf')]=function(){var _0x296083=this['mapAgentsId']['_rr'];this[_0x84f5('0xc')]=_[_0x84f5('0x10')](this[_0x84f5('0xb')],'id');this[_0x84f5('0xc')]['_rr']=_0x296083;};MailQueue[_0x84f5('0x11')][_0x84f5('0xe')]=function(){this[_0x84f5('0x12')]=0x0;this[_0x84f5('0x13')]=0x0;for(var _0x2b164e=0x0;_0x2b164e=0x0?this['available']:0x0;var _0xacdc29={'id':this['id'],'available':this['available'],'loggedIn':this[_0x84f5('0x12')],'name':this[_0x84f5('0x7')],'paused':this[_0x84f5('0x13')],'waiting':this[_0x84f5('0xd')]};var _0x56a7f5=md5(JSON[_0x84f5('0x18')](_0xacdc29));if(this[_0x84f5('0x1')]!==_0x56a7f5){this[_0x84f5('0x1')]=_0x56a7f5;io['to'](util[_0x84f5('0x19')]('mail:queue:%s',_0xacdc29['name']))[_0x84f5('0x1a')](_0x84f5('0x1b'),_0xacdc29);}};module[_0x84f5('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 9b0cfe6..3b22aaf 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x492e32,_0x2e0a93){var _0x4a335e=function(_0x1f4998){while(--_0x1f4998){_0x492e32['push'](_0x492e32['shift']());}};_0x4a335e(++_0x2e0a93);}(_0xadb5,0xad));var _0x5adb=function(_0x5ee488,_0x291c7c){_0x5ee488=_0x5ee488-0x0;var _0x3e5010=_0xadb5[_0x5ee488];return _0x3e5010;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 546b163..5f5330f 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 _0x5c37=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','paused','length','online','smsPause','available','stringify','format','emit','sms_queue:save','lodash','md5','util','ioredis'];(function(_0x329eef,_0x1d6364){var _0x5a1b7f=function(_0x32810d){while(--_0x32810d){_0x329eef['push'](_0x329eef['shift']());}};_0x5a1b7f(++_0x1d6364);}(_0x5c37,0x11e));var _0x75c3=function(_0x168127,_0x59cea1){_0x168127=_0x168127-0x0;var _0x4c99ad=_0x5c37[_0x168127];return _0x4c99ad;};'use strict';var _=require(_0x75c3('0x0'));var md5=require(_0x75c3('0x1'));var util=require(_0x75c3('0x2'));var Redis=require(_0x75c3('0x3'));var config=require(_0x75c3('0x4'));config[_0x75c3('0x5')]=_['defaults'](config[_0x75c3('0x5')],{'host':_0x75c3('0x6'),'port':0x18eb});var io=require(_0x75c3('0x7'))(new Redis(config['redis']));function SmsQueue(_0x190aae){this['id']=_0x190aae['id']||0x0;this[_0x75c3('0x8')]=_0x190aae[_0x75c3('0x8')]||'';this[_0x75c3('0x9')]=_0x190aae['timeout']||0xa;this[_0x75c3('0xa')]=_0x190aae['strategy']||'beepall';this[_0x75c3('0xb')]=_0x190aae[_0x75c3('0xb')];this['mapAgentsId']={};this[_0x75c3('0xc')]=0x0;this[_0x75c3('0x1')]='';this[_0x75c3('0xd')]();this[_0x75c3('0xe')]();}SmsQueue[_0x75c3('0xf')][_0x75c3('0xd')]=function(){var _0x536ff4=this['mapAgentsId'][_0x75c3('0x10')];this[_0x75c3('0x11')]=_[_0x75c3('0x12')](this[_0x75c3('0xb')],'id');this[_0x75c3('0x11')]['_rr']=_0x536ff4;};SmsQueue[_0x75c3('0xf')][_0x75c3('0xe')]=function(){this[_0x75c3('0x13')]=0x0;this[_0x75c3('0x14')]=0x0;for(var _0x5a33d1=0x0;_0x5a33d1=0x0?this[_0x75c3('0x18')]:0x0;var _0x2577b8={'id':this['id'],'available':this[_0x75c3('0x18')],'loggedIn':this[_0x75c3('0x13')],'name':this[_0x75c3('0x8')],'paused':this[_0x75c3('0x14')],'waiting':this[_0x75c3('0xc')]};var _0x5421fe=md5(JSON[_0x75c3('0x19')](_0x2577b8));if(this[_0x75c3('0x1')]!==_0x5421fe){this['md5']=_0x5421fe;io['to'](util[_0x75c3('0x1a')]('sms:queue:%s',_0x2577b8[_0x75c3('0x8')]))[_0x75c3('0x1b')](_0x75c3('0x1c'),_0x2577b8);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x9d02=['smsPause','paused','available','name','stringify','md5','format','sms:queue:%s','sms_queue:save','exports','lodash','util','../../../config/environment','defaults','redis','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online'];(function(_0x1f58fa,_0x12591c){var _0xe6b244=function(_0x19ab5f){while(--_0x19ab5f){_0x1f58fa['push'](_0x1f58fa['shift']());}};_0xe6b244(++_0x12591c);}(_0x9d02,0x118));var _0x29d0=function(_0x3d350f,_0x205dbc){_0x3d350f=_0x3d350f-0x0;var _0x510370=_0x9d02[_0x3d350f];return _0x510370;};'use strict';var _=require(_0x29d0('0x0'));var md5=require('md5');var util=require(_0x29d0('0x1'));var Redis=require('ioredis');var config=require(_0x29d0('0x2'));config['redis']=_[_0x29d0('0x3')](config[_0x29d0('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x29d0('0x5'))(new Redis(config[_0x29d0('0x4')]));function SmsQueue(_0x242299){this['id']=_0x242299['id']||0x0;this['name']=_0x242299['name']||'';this['timeout']=_0x242299[_0x29d0('0x6')]||0xa;this[_0x29d0('0x7')]=_0x242299['strategy']||_0x29d0('0x8');this[_0x29d0('0x9')]=_0x242299['Agents'];this[_0x29d0('0xa')]={};this[_0x29d0('0xb')]=0x0;this['md5']='';this[_0x29d0('0xc')]();this[_0x29d0('0xd')]();}SmsQueue[_0x29d0('0xe')][_0x29d0('0xc')]=function(){var _0x5beb4c=this['mapAgentsId'][_0x29d0('0xf')];this[_0x29d0('0xa')]=_[_0x29d0('0x10')](this[_0x29d0('0x9')],'id');this[_0x29d0('0xa')][_0x29d0('0xf')]=_0x5beb4c;};SmsQueue[_0x29d0('0xe')][_0x29d0('0xd')]=function(){this[_0x29d0('0x11')]=0x0;this['paused']=0x0;for(var _0x22903c=0x0;_0x22903c=0x0?this[_0x29d0('0x16')]:0x0;var _0x2b83e7={'id':this['id'],'available':this[_0x29d0('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x29d0('0x17')],'paused':this[_0x29d0('0x15')],'waiting':this[_0x29d0('0xb')]};var _0x18dd1a=md5(JSON[_0x29d0('0x18')](_0x2b83e7));if(this[_0x29d0('0x19')]!==_0x18dd1a){this['md5']=_0x18dd1a;io['to'](util[_0x29d0('0x1a')](_0x29d0('0x1b'),_0x2b83e7[_0x29d0('0x17')]))['emit'](_0x29d0('0x1c'),_0x2b83e7);}};module[_0x29d0('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 20c6932..14d06f6 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 _0xde60=['ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','exports','lodash','md5','util'];(function(_0x392416,_0x5a459c){var _0x2e74f8=function(_0x57a9a3){while(--_0x57a9a3){_0x392416['push'](_0x392416['shift']());}};_0x2e74f8(++_0x5a459c);}(_0xde60,0x131));var _0x0de6=function(_0x58d8d7,_0x108377){_0x58d8d7=_0x58d8d7-0x0;var _0x339d20=_0xde60[_0x58d8d7];return _0x339d20;};'use strict';var _=require(_0x0de6('0x0'));var md5=require(_0x0de6('0x1'));var util=require(_0x0de6('0x2'));var Redis=require(_0x0de6('0x3'));var config=require(_0x0de6('0x4'));config['redis']=_[_0x0de6('0x5')](config[_0x0de6('0x6')],{'host':_0x0de6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0de6('0x6')]));function WhatsappQueue(_0x580322){this['id']=_0x580322['id']||0x0;this['name']=_0x580322[_0x0de6('0x8')]||'';this[_0x0de6('0x9')]=_0x580322[_0x0de6('0x9')]||0xa;this['strategy']=_0x580322[_0x0de6('0xa')]||_0x0de6('0xb');this[_0x0de6('0xc')]=_0x580322['Agents'];this['mapAgentsId']={};this[_0x0de6('0xd')]=0x0;this[_0x0de6('0x1')]='';this[_0x0de6('0xe')]();this[_0x0de6('0xf')]();}WhatsappQueue[_0x0de6('0x10')][_0x0de6('0xe')]=function(){var _0x3cf199=this[_0x0de6('0x11')]['_rr'];this[_0x0de6('0x11')]=_['map'](this[_0x0de6('0xc')],'id');this['mapAgentsId'][_0x0de6('0x12')]=_0x3cf199;};WhatsappQueue[_0x0de6('0x10')][_0x0de6('0xf')]=function(){this[_0x0de6('0x13')]=0x0;this[_0x0de6('0x14')]=0x0;for(var _0x1dd5cf=0x0;_0x1dd5cf=0x0?this[_0x0de6('0x17')]:0x0;var _0x1f83de={'id':this['id'],'available':this[_0x0de6('0x17')],'loggedIn':this[_0x0de6('0x13')],'name':this['name'],'paused':this[_0x0de6('0x14')],'waiting':this['waiting']};var _0x5db080=md5(JSON[_0x0de6('0x18')](_0x1f83de));if(this['md5']!==_0x5db080){this['md5']=_0x5db080;io['to'](util[_0x0de6('0x19')](_0x0de6('0x1a'),_0x1f83de[_0x0de6('0x8')]))['emit']('whatsapp_queue:save',_0x1f83de);}};module[_0x0de6('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0xd461=['mapAgentsId','_rr','map','Agents','loggedIn','paused','length','online','whatsappPause','available','waiting','format','emit','whatsapp_queue:save','exports','md5','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','updateRealtime','prototype','updateRouting'];(function(_0x27929e,_0x75968b){var _0x3125c0=function(_0x3ccad5){while(--_0x3ccad5){_0x27929e['push'](_0x27929e['shift']());}};_0x3125c0(++_0x75968b);}(_0xd461,0x17b));var _0x1d46=function(_0x229c37,_0x5e3cad){_0x229c37=_0x229c37-0x0;var _0x20e9d8=_0xd461[_0x229c37];return _0x20e9d8;};'use strict';var _=require('lodash');var md5=require(_0x1d46('0x0'));var util=require(_0x1d46('0x1'));var Redis=require(_0x1d46('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x1d46('0x3')],{'host':_0x1d46('0x4'),'port':0x18eb});var io=require(_0x1d46('0x5'))(new Redis(config[_0x1d46('0x3')]));function WhatsappQueue(_0x239b74){this['id']=_0x239b74['id']||0x0;this[_0x1d46('0x6')]=_0x239b74[_0x1d46('0x6')]||'';this[_0x1d46('0x7')]=_0x239b74[_0x1d46('0x7')]||0xa;this[_0x1d46('0x8')]=_0x239b74['strategy']||_0x1d46('0x9');this['Agents']=_0x239b74['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0x1d46('0x0')]='';this['updateRouting']();this[_0x1d46('0xa')]();}WhatsappQueue[_0x1d46('0xb')][_0x1d46('0xc')]=function(){var _0x543534=this[_0x1d46('0xd')][_0x1d46('0xe')];this[_0x1d46('0xd')]=_[_0x1d46('0xf')](this[_0x1d46('0x10')],'id');this[_0x1d46('0xd')]['_rr']=_0x543534;};WhatsappQueue[_0x1d46('0xb')]['updateRealtime']=function(){this[_0x1d46('0x11')]=0x0;this[_0x1d46('0x12')]=0x0;for(var _0x5abdda=0x0;_0x5abdda=0x0?this[_0x1d46('0x16')]:0x0;var _0x5d3e7c={'id':this['id'],'available':this[_0x1d46('0x16')],'loggedIn':this[_0x1d46('0x11')],'name':this[_0x1d46('0x6')],'paused':this[_0x1d46('0x12')],'waiting':this[_0x1d46('0x17')]};var _0x5f9a0e=md5(JSON['stringify'](_0x5d3e7c));if(this['md5']!==_0x5f9a0e){this[_0x1d46('0x0')]=_0x5f9a0e;io['to'](util[_0x1d46('0x18')]('whatsapp:queue:%s',_0x5d3e7c[_0x1d46('0x6')]))[_0x1d46('0x19')](_0x1d46('0x1a'),_0x5d3e7c);}};module[_0x1d46('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b944893..ecd64cc 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +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(_0x2a3ac3,_0xb1edc6){var _0x2187a1=function(_0x2a4832){while(--_0x2a4832){_0x2a3ac3['push'](_0x2a3ac3['shift']());}};_0x2187a1(++_0xb1edc6);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xb10b[_0x2f1753];return _0x56a164;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 0d0d69e..c5fb138 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 _0x10cb=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request'];(function(_0x53366c,_0x255a3f){var _0x14ff2e=function(_0x39f810){while(--_0x39f810){_0x53366c['push'](_0x53366c['shift']());}};_0x14ff2e(++_0x255a3f);}(_0x10cb,0x1c5));var _0xb10c=function(_0x9f73d7,_0x4a4eff){_0x9f73d7=_0x9f73d7-0x0;var _0x595280=_0x10cb[_0x9f73d7];return _0x595280;};'use strict';var client=require('../client');exports[_0xb10c('0x0')]=function(_0x4e69e5,_0x4b1a41){return client[_0xb10c('0x1')](_0xb10c('0x2'),{'body':_0x4b1a41,'options':{'where':{'id':_0x4e69e5}},'log':_0xb10c('0x3')});};exports[_0xb10c('0x4')]=function(_0x3e8748,_0x450b6a){return client[_0xb10c('0x1')](_0xb10c('0x5'),{'body':_0x450b6a,'options':{'where':{'id':_0x3e8748}},'log':_0xb10c('0x6')});}; \ No newline at end of file +var _0xc934=['addTagsToChatInteraction','update','UpdateChatInteraction','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc934,0xe1));var _0x4c93=function(_0x3609cc,_0x48b867){_0x3609cc=_0x3609cc-0x0;var _0x4e6472=_0xc934[_0x3609cc];return _0x4e6472;};'use strict';var client=require('../client');exports[_0x4c93('0x0')]=function(_0x2bc806,_0x4fbea5){return client['Request'](_0x4c93('0x1'),{'body':_0x4fbea5,'options':{'where':{'id':_0x2bc806}},'log':_0x4c93('0x2')});};exports[_0x4c93('0x3')]=function(_0x178fd2,_0xbbfec7){return client[_0x4c93('0x4')](_0x4c93('0x5'),{'body':_0xbbfec7,'options':{'where':{'id':_0x178fd2}},'log':_0x4c93('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4c85771..8e12305 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 _0xab39=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0x2cb0fe,_0x23f390){var _0xcf38ab=function(_0x3ee6a5){while(--_0x3ee6a5){_0x2cb0fe['push'](_0x2cb0fe['shift']());}};_0xcf38ab(++_0x23f390);}(_0xab39,0x95));var _0x9ab3=function(_0x21afd5,_0x57b9ba){_0x21afd5=_0x21afd5-0x0;var _0x59b71d=_0xab39[_0x21afd5];return _0x59b71d;};'use strict';var client=require(_0x9ab3('0x0'));exports[_0x9ab3('0x1')]=function(_0x13bfa6){return client[_0x9ab3('0x2')](_0x9ab3('0x3'),{'body':_0x13bfa6,'log':_0x9ab3('0x4')});}; \ No newline at end of file +var _0xa400=['create','createChatMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa400,0x110));var _0x0a40=function(_0x3803d4,_0x130230){_0x3803d4=_0x3803d4-0x0;var _0x51b460=_0xa400[_0x3803d4];return _0x51b460;};'use strict';var client=require(_0x0a40('0x0'));exports[_0x0a40('0x1')]=function(_0x5e8eae){return client['Request']('CreateChatMessage',{'body':_0x5e8eae,'log':_0x0a40('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index bdcc4a8..abfe234 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 _0xb647=['strategy','User','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x297178,_0x3aed64){var _0x734f77=function(_0x4d215d){while(--_0x4d215d){_0x297178['push'](_0x297178['shift']());}};_0x734f77(++_0x3aed64);}(_0xb647,0xdb));var _0x7b64=function(_0x2707b3,_0x3da47a){_0x2707b3=_0x2707b3-0x0;var _0x4d1373=_0xb647[_0x2707b3];return _0x4d1373;};'use strict';var client=require(_0x7b64('0x0'));exports[_0x7b64('0x1')]=function(){return function(){return client[_0x7b64('0x2')](_0x7b64('0x3'),{'options':{'raw':![],'attributes':['id',_0x7b64('0x4'),_0x7b64('0x5'),_0x7b64('0x6')],'include':[{'model':_0x7b64('0x7'),'as':'Agents','attributes':['id',_0x7b64('0x4'),'online',_0x7b64('0x8')]}]},'log':_0x7b64('0x1')});};}; \ No newline at end of file +var _0x5a93=['getChatQueues','GetChatQueue','name','User','Agents','chatPause'];(function(_0xad0af3,_0x1edd00){var _0xd7f91=function(_0x10bbd3){while(--_0x10bbd3){_0xad0af3['push'](_0xad0af3['shift']());}};_0xd7f91(++_0x1edd00);}(_0x5a93,0xf6));var _0x35a9=function(_0x7be78f,_0x3b03f8){_0x7be78f=_0x7be78f-0x0;var _0x33b047=_0x5a93[_0x7be78f];return _0x33b047;};'use strict';var client=require('../client');exports[_0x35a9('0x0')]=function(){return function(){return client['Request'](_0x35a9('0x1'),{'options':{'raw':![],'attributes':['id',_0x35a9('0x2'),'timeout','strategy'],'include':[{'model':_0x35a9('0x3'),'as':_0x35a9('0x4'),'attributes':['id',_0x35a9('0x2'),'online',_0x35a9('0x5')]}]},'log':_0x35a9('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 31b50ee..54b7c80 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 _0xe79f=['Request','UpdateChatQueueReport','../client','CreateChatQueueReport'];(function(_0x32d62a,_0x3c7e0d){var _0x289af8=function(_0x123a92){while(--_0x123a92){_0x32d62a['push'](_0x32d62a['shift']());}};_0x289af8(++_0x3c7e0d);}(_0xe79f,0x13a));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xfe79('0x0'));exports['create']=function(_0x259811){return client['Request'](_0xfe79('0x1'),{'body':_0x259811,'log':'CreateChatQueueReport'});};exports['update']=function(_0x5901ba,_0x243f35){return client[_0xfe79('0x2')](_0xfe79('0x3'),{'body':_0x243f35,'options':{'where':{'uniqueid':_0x5901ba},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xa2ab=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','../client'];(function(_0x4be6e5,_0x536ec1){var _0x5799c1=function(_0x17e9f2){while(--_0x17e9f2){_0x4be6e5['push'](_0x4be6e5['shift']());}};_0x5799c1(++_0x536ec1);}(_0xa2ab,0xa7));var _0xba2a=function(_0x32080b,_0x4cb90d){_0x32080b=_0x32080b-0x0;var _0x18646e=_0xa2ab[_0x32080b];return _0x18646e;};'use strict';var client=require(_0xba2a('0x0'));exports[_0xba2a('0x1')]=function(_0x38e967){return client['Request'](_0xba2a('0x2'),{'body':_0x38e967,'log':_0xba2a('0x2')});};exports[_0xba2a('0x3')]=function(_0x142733,_0x24423b){return client[_0xba2a('0x4')](_0xba2a('0x5'),{'body':_0x24423b,'options':{'where':{'uniqueid':_0x142733},'order':[['id','DESC']],'limit':0x1},'log':_0xba2a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 1a6602b..d23c934 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(_0x333fed,_0x3d2122){var _0x12cac2=function(_0x41d9af){while(--_0x41d9af){_0x333fed['push'](_0x333fed['shift']());}};_0x12cac2(++_0x3d2122);}(_0x7a54,0x106));var _0x47a5=function(_0xe84ec0,_0x3d454b){_0xe84ec0=_0xe84ec0-0x0;var _0x2dc463=_0x7a54[_0xe84ec0];return _0x2dc463;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0x7a54,0x106));var _0x47a5=function(_0x5e2c02,_0x20811a){_0x5e2c02=_0x5e2c02-0x0;var _0x2a32c1=_0x7a54[_0x5e2c02];return _0x2a32c1;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 635a617..98a6bde 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 _0x3c1b=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x172b39,_0x303689){var _0x1ea343=function(_0x14a27e){while(--_0x14a27e){_0x172b39['push'](_0x172b39['shift']());}};_0x1ea343(++_0x303689);}(_0x3c1b,0x1d6));var _0xb3c1=function(_0x390e5d,_0x27f74d){_0x390e5d=_0x390e5d-0x0;var _0x1ea72c=_0x3c1b[_0x390e5d];return _0x1ea72c;};'use strict';var client=require(_0xb3c1('0x0'));exports[_0xb3c1('0x1')]=function(_0x87a52a){return client[_0xb3c1('0x2')](_0xb3c1('0x3'),{'body':_0x87a52a,'log':_0xb3c1('0x4')});}; \ No newline at end of file +var _0xbb47=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xbb47,0xd4));var _0x7bb4=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xbb47[_0x5ad220];return _0xdec77d;};'use strict';var client=require(_0x7bb4('0x0'));exports[_0x7bb4('0x1')]=function(_0x3201c2){return client[_0x7bb4('0x2')](_0x7bb4('0x3'),{'body':_0x3201c2,'log':_0x7bb4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index be12780..d577c04 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 _0xae8d=['../client','getFaxQueues','Request','User','Agents','name'];(function(_0x3dc7e9,_0x1200f1){var _0x365a11=function(_0x4e04e4){while(--_0x4e04e4){_0x3dc7e9['push'](_0x3dc7e9['shift']());}};_0x365a11(++_0x1200f1);}(_0xae8d,0x114));var _0xdae8=function(_0x142531,_0x49f949){_0x142531=_0x142531-0x0;var _0x5073ea=_0xae8d[_0x142531];return _0x5073ea;};'use strict';var client=require(_0xdae8('0x0'));exports[_0xdae8('0x1')]=function(){return function(){return client[_0xdae8('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xdae8('0x3'),'as':_0xdae8('0x4'),'attributes':['id',_0xdae8('0x5'),'online','faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x6f61=['User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy'];(function(_0x460ddd,_0x218998){var _0x4e19bc=function(_0x45d3b0){while(--_0x45d3b0){_0x460ddd['push'](_0x460ddd['shift']());}};_0x4e19bc(++_0x218998);}(_0x6f61,0xf6));var _0x16f6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f61[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x16f6('0x0'));exports[_0x16f6('0x1')]=function(){return function(){return client[_0x16f6('0x2')](_0x16f6('0x3'),{'options':{'raw':![],'attributes':['id',_0x16f6('0x4'),_0x16f6('0x5'),_0x16f6('0x6')],'include':[{'model':_0x16f6('0x7'),'as':_0x16f6('0x8'),'attributes':['id','name',_0x16f6('0x9'),_0x16f6('0xa')]}]},'log':_0x16f6('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 78a0312..b523a96 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 _0x6ce7=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6ce7,0x11d));var _0x76ce=function(_0x2a9692,_0x406f72){_0x2a9692=_0x2a9692-0x0;var _0x1d904b=_0x6ce7[_0x2a9692];return _0x1d904b;};'use strict';var client=require(_0x76ce('0x0'));exports[_0x76ce('0x1')]=function(_0x402922){return client[_0x76ce('0x2')](_0x76ce('0x3'),{'body':_0x402922,'log':_0x76ce('0x3')});};exports[_0x76ce('0x4')]=function(_0xfd04fa,_0x43ccf2){return client[_0x76ce('0x2')](_0x76ce('0x5'),{'body':_0x43ccf2,'options':{'where':{'uniqueid':_0xfd04fa},'order':[['id',_0x76ce('0x6')]],'limit':0x1},'log':_0x76ce('0x5')});}; \ No newline at end of file +var _0x761c=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x37e86f,_0x15df20){var _0x3b4220=function(_0x162a56){while(--_0x162a56){_0x37e86f['push'](_0x37e86f['shift']());}};_0x3b4220(++_0x15df20);}(_0x761c,0xe8));var _0xc761=function(_0x1e68d7,_0x22d0bc){_0x1e68d7=_0x1e68d7-0x0;var _0x104ed5=_0x761c[_0x1e68d7];return _0x104ed5;};'use strict';var client=require(_0xc761('0x0'));exports[_0xc761('0x1')]=function(_0x374eed){return client[_0xc761('0x2')](_0xc761('0x3'),{'body':_0x374eed,'log':_0xc761('0x3')});};exports[_0xc761('0x4')]=function(_0x32ffe0,_0x25d029){return client[_0xc761('0x2')](_0xc761('0x5'),{'body':_0x25d029,'options':{'where':{'uniqueid':_0x32ffe0},'order':[['id',_0xc761('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 08e24b7..d1b3333 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 _0x9bd8=['name','interval','../client','getIntervals','Request','Intervals'];(function(_0x26d51f,_0x1de895){var _0x48305d=function(_0x13652a){while(--_0x13652a){_0x26d51f['push'](_0x26d51f['shift']());}};_0x48305d(++_0x1de895);}(_0x9bd8,0x1ee));var _0x89bd=function(_0x1b6621,_0x105c12){_0x1b6621=_0x1b6621-0x0;var _0x12cad9=_0x9bd8[_0x1b6621];return _0x12cad9;};'use strict';var client=require(_0x89bd('0x0'));exports[_0x89bd('0x1')]=function(){return function(){return client[_0x89bd('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x89bd('0x3'),'attributes':['id',_0x89bd('0x4'),_0x89bd('0x5')]}]},'log':_0x89bd('0x1')});};}; \ No newline at end of file +var _0xed21=['getIntervals','Interval','Intervals','name','../client'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xed21,0x1da));var _0x1ed2=function(_0x3cdadd,_0x152efb){_0x3cdadd=_0x3cdadd-0x0;var _0x378e2b=_0xed21[_0x3cdadd];return _0x378e2b;};'use strict';var client=require(_0x1ed2('0x0'));exports[_0x1ed2('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x1ed2('0x2'),'as':_0x1ed2('0x3'),'attributes':['id',_0x1ed2('0x4'),'interval']}]},'log':_0x1ed2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1cd78b7..97cf92d 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 _0x7096=['AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x3d05f1,_0x10fab4){var _0x38cafd=function(_0x1c1874){while(--_0x1c1874){_0x3d05f1['push'](_0x3d05f1['shift']());}};_0x38cafd(++_0x10fab4);}(_0x7096,0x10c));var _0x6709=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x7096[_0x4baae2];return _0x1a2285;};'use strict';var client=require('../client');exports[_0x6709('0x0')]=function(_0x5035b7,_0x253760){return client['Request'](_0x6709('0x1'),{'body':_0x253760,'options':{'where':{'id':_0x5035b7}},'log':_0x6709('0x2')});};exports[_0x6709('0x3')]=function(_0xccdcb5,_0x3cd087){return client[_0x6709('0x4')](_0x6709('0x5'),{'body':_0x3cd087,'options':{'where':{'id':_0xccdcb5}},'log':_0x6709('0x6')});}; \ No newline at end of file +var _0x1c7c=['update','UpdateMailInteraction','addTags','Request','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x1c7c,0x164));var _0xc1c7=function(_0x3bc843,_0xe89d6e){_0x3bc843=_0x3bc843-0x0;var _0x44db5f=_0x1c7c[_0x3bc843];return _0x44db5f;};'use strict';var client=require(_0xc1c7('0x0'));exports[_0xc1c7('0x1')]=function(_0x38fc99,_0x3a93f0){return client['Request'](_0xc1c7('0x2'),{'body':_0x3a93f0,'options':{'where':{'id':_0x38fc99}},'log':'updateMailInteraction'});};exports[_0xc1c7('0x3')]=function(_0x20dad3,_0xbb9da0){return client[_0xc1c7('0x4')](_0xc1c7('0x5'),{'body':_0xbb9da0,'options':{'where':{'id':_0x20dad3}},'log':_0xc1c7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 8b029cb..6374a49 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 _0x7476=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x7476,0x82));var _0x6747=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0x7476[_0x4d82ea];return _0x257f4a;};'use strict';var client=require(_0x6747('0x0'));exports[_0x6747('0x1')]=function(_0x3b8477){return client[_0x6747('0x2')](_0x6747('0x3'),{'body':_0x3b8477,'log':_0x6747('0x4')});}; \ No newline at end of file +var _0x421b=['createMailMessage','../client','create','Request'];(function(_0x5e2ab4,_0x1daeae){var _0x417106=function(_0x6c4337){while(--_0x6c4337){_0x5e2ab4['push'](_0x5e2ab4['shift']());}};_0x417106(++_0x1daeae);}(_0x421b,0x1a1));var _0xb421=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x421b[_0x126fb9];return _0xc8a3b1;};'use strict';var client=require(_0xb421('0x0'));exports[_0xb421('0x1')]=function(_0xe4d5dd){return client[_0xb421('0x2')]('CreateMailMessage',{'body':_0xe4d5dd,'log':_0xb421('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 90189be..abbaaa3 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 _0x8b26=['Request','GetMailQueue','name','timeout','strategy','User','Agents','mailPause'];(function(_0x12c181,_0x3c8bbf){var _0x10cf19=function(_0x589c66){while(--_0x589c66){_0x12c181['push'](_0x12c181['shift']());}};_0x10cf19(++_0x3c8bbf);}(_0x8b26,0x148));var _0x68b2=function(_0x18ccd6,_0x1098e8){_0x18ccd6=_0x18ccd6-0x0;var _0x587d2c=_0x8b26[_0x18ccd6];return _0x587d2c;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x68b2('0x0')](_0x68b2('0x1'),{'options':{'raw':![],'attributes':['id',_0x68b2('0x2'),_0x68b2('0x3'),_0x68b2('0x4')],'include':[{'model':_0x68b2('0x5'),'as':_0x68b2('0x6'),'attributes':['id',_0x68b2('0x2'),'online',_0x68b2('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x6e0c=['getMailQueues','GetMailQueue','name','strategy','User','Agents','online','mailPause','../client'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6e0c,0x19d));var _0xc6e0=function(_0x34fb19,_0xc493c6){_0x34fb19=_0x34fb19-0x0;var _0x3a1dcd=_0x6e0c[_0x34fb19];return _0x3a1dcd;};'use strict';var client=require(_0xc6e0('0x0'));exports[_0xc6e0('0x1')]=function(){return function(){return client['Request'](_0xc6e0('0x2'),{'options':{'raw':![],'attributes':['id',_0xc6e0('0x3'),'timeout',_0xc6e0('0x4')],'include':[{'model':_0xc6e0('0x5'),'as':_0xc6e0('0x6'),'attributes':['id',_0xc6e0('0x3'),_0xc6e0('0x7'),_0xc6e0('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 2fa0cea..8e66c1c 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 _0x8e3f=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8e3f,0x1dc));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xf8e3('0x0'));exports[_0xf8e3('0x1')]=function(_0x2de50e){return client[_0xf8e3('0x2')](_0xf8e3('0x3'),{'body':_0x2de50e,'log':_0xf8e3('0x3')});};exports[_0xf8e3('0x4')]=function(_0x5d0a53,_0xee0821){return client[_0xf8e3('0x2')](_0xf8e3('0x5'),{'body':_0xee0821,'options':{'where':{'uniqueid':_0x5d0a53},'order':[['id',_0xf8e3('0x6')]],'limit':0x1},'log':_0xf8e3('0x5')});}; \ No newline at end of file +var _0xf85a=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x16ab9c,_0x344a1f){var _0x451813=function(_0x3ddc23){while(--_0x3ddc23){_0x16ab9c['push'](_0x16ab9c['shift']());}};_0x451813(++_0x344a1f);}(_0xf85a,0x158));var _0xaf85=function(_0x52f6e9,_0x48cb13){_0x52f6e9=_0x52f6e9-0x0;var _0x4cd64b=_0xf85a[_0x52f6e9];return _0x4cd64b;};'use strict';var client=require(_0xaf85('0x0'));exports[_0xaf85('0x1')]=function(_0x4c3cb8){return client[_0xaf85('0x2')](_0xaf85('0x3'),{'body':_0x4c3cb8,'log':_0xaf85('0x3')});};exports['update']=function(_0x3c5a04,_0x1e8d62){return client[_0xaf85('0x2')](_0xaf85('0x4'),{'body':_0x1e8d62,'options':{'where':{'uniqueid':_0x3c5a04},'order':[['id',_0xaf85('0x5')]],'limit':0x1},'log':_0xaf85('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index d28d462..7ebce51 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 _0xaec5=['addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xaec5,0x9d));var _0x5aec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaec5[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x5aec('0x0'));exports[_0x5aec('0x1')]=function(_0xb722ee,_0x59b457){return client[_0x5aec('0x2')]('UpdateOpenchannelInteraction',{'body':_0x59b457,'options':{'where':{'id':_0xb722ee}},'log':_0x5aec('0x3')});};exports[_0x5aec('0x4')]=function(_0x47cfbf,_0x59856e){return client[_0x5aec('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x59856e,'options':{'where':{'id':_0x47cfbf}},'log':_0x5aec('0x5')});}; \ No newline at end of file +var _0xf456=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x4f7c44,_0x338475){var _0x345133=function(_0x4ee8df){while(--_0x4ee8df){_0x4f7c44['push'](_0x4f7c44['shift']());}};_0x345133(++_0x338475);}(_0xf456,0x84));var _0x6f45=function(_0x15c187,_0x5729ec){_0x15c187=_0x15c187-0x0;var _0x45e97b=_0xf456[_0x15c187];return _0x45e97b;};'use strict';var client=require(_0x6f45('0x0'));exports[_0x6f45('0x1')]=function(_0x30d3e9,_0x56c124){return client[_0x6f45('0x2')](_0x6f45('0x3'),{'body':_0x56c124,'options':{'where':{'id':_0x30d3e9}},'log':_0x6f45('0x4')});};exports[_0x6f45('0x5')]=function(_0x2a3eb6,_0x281003){return client[_0x6f45('0x2')](_0x6f45('0x6'),{'body':_0x281003,'options':{'where':{'id':_0x2a3eb6}},'log':_0x6f45('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 53eadff..d66bd79 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 _0x74c8=['createOpenchannelMessage','../client','create','CreateOpenchannelMessage'];(function(_0x3fb013,_0x3c7776){var _0x576f69=function(_0x51420e){while(--_0x51420e){_0x3fb013['push'](_0x3fb013['shift']());}};_0x576f69(++_0x3c7776);}(_0x74c8,0x1b1));var _0x874c=function(_0x14f87c,_0x11ea41){_0x14f87c=_0x14f87c-0x0;var _0x4a6981=_0x74c8[_0x14f87c];return _0x4a6981;};'use strict';var client=require(_0x874c('0x0'));exports[_0x874c('0x1')]=function(_0x41b66f){return client['Request'](_0x874c('0x2'),{'body':_0x41b66f,'log':_0x874c('0x3')});}; \ No newline at end of file +var _0x7f01=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x1c6519,_0x4f6384){var _0x4b1860=function(_0x1d82ee){while(--_0x1d82ee){_0x1c6519['push'](_0x1c6519['shift']());}};_0x4b1860(++_0x4f6384);}(_0x7f01,0x7b));var _0x17f0=function(_0x10df2c,_0x27bfb2){_0x10df2c=_0x10df2c-0x0;var _0x268315=_0x7f01[_0x10df2c];return _0x268315;};'use strict';var client=require('../client');exports[_0x17f0('0x0')]=function(_0x58147d){return client[_0x17f0('0x1')](_0x17f0('0x2'),{'body':_0x58147d,'log':_0x17f0('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 183701a..23fe851 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 _0xbfaa=['Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause','../client','getOpenchannelQueues'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0xbfaa,0x9e));var _0xabfa=function(_0x5b92ca,_0x5a5106){_0x5b92ca=_0x5b92ca-0x0;var _0x532089=_0xbfaa[_0x5b92ca];return _0x532089;};'use strict';var client=require(_0xabfa('0x0'));exports[_0xabfa('0x1')]=function(){return function(){return client[_0xabfa('0x2')](_0xabfa('0x3'),{'options':{'raw':![],'attributes':['id',_0xabfa('0x4'),_0xabfa('0x5'),_0xabfa('0x6')],'include':[{'model':'User','as':_0xabfa('0x7'),'attributes':['id','name',_0xabfa('0x8'),_0xabfa('0x9')]}]},'log':_0xabfa('0x1')});};}; \ No newline at end of file +var _0x02f7=['strategy','User','Agents','../client','getOpenchannelQueues','Request','name','timeout'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x02f7,0x1d3));var _0x702f=function(_0x2dc5b5,_0x10d82c){_0x2dc5b5=_0x2dc5b5-0x0;var _0x2a8ccc=_0x02f7[_0x2dc5b5];return _0x2a8ccc;};'use strict';var client=require(_0x702f('0x0'));exports[_0x702f('0x1')]=function(){return function(){return client[_0x702f('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x702f('0x3'),_0x702f('0x4'),_0x702f('0x5')],'include':[{'model':_0x702f('0x6'),'as':_0x702f('0x7'),'attributes':['id',_0x702f('0x3'),'online','openchannelPause']}]},'log':_0x702f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b153da6..f537034 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 _0x1f60=['UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','DESC'];(function(_0x5ddebf,_0x4e0dd9){var _0x3821c4=function(_0x4881ab){while(--_0x4881ab){_0x5ddebf['push'](_0x5ddebf['shift']());}};_0x3821c4(++_0x4e0dd9);}(_0x1f60,0x12d));var _0x01f6=function(_0x3b4838,_0x3ddeaf){_0x3b4838=_0x3b4838-0x0;var _0x4e07fd=_0x1f60[_0x3b4838];return _0x4e07fd;};'use strict';var client=require(_0x01f6('0x0'));exports[_0x01f6('0x1')]=function(_0x2ae726){return client['Request'](_0x01f6('0x2'),{'body':_0x2ae726,'log':_0x01f6('0x2')});};exports['update']=function(_0x182600,_0x957d00){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x957d00,'options':{'where':{'uniqueid':_0x182600},'order':[['id',_0x01f6('0x3')]],'limit':0x1},'log':_0x01f6('0x4')});}; \ No newline at end of file +var _0x004d=['update','UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport'];(function(_0x3f0156,_0x5c3aa5){var _0x3d467c=function(_0x12ba03){while(--_0x12ba03){_0x3f0156['push'](_0x3f0156['shift']());}};_0x3d467c(++_0x5c3aa5);}(_0x004d,0x183));var _0xd004=function(_0x395623,_0x3d6074){_0x395623=_0x395623-0x0;var _0x6e88fb=_0x004d[_0x395623];return _0x6e88fb;};'use strict';var client=require('../client');exports[_0xd004('0x0')]=function(_0x4f0af6){return client[_0xd004('0x1')](_0xd004('0x2'),{'body':_0x4f0af6,'log':_0xd004('0x2')});};exports[_0xd004('0x3')]=function(_0x41f826,_0x5ccc2c){return client[_0xd004('0x1')](_0xd004('0x4'),{'body':_0x5ccc2c,'options':{'where':{'uniqueid':_0x41f826},'order':[['id','DESC']],'limit':0x1},'log':_0xd004('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 4d7f749..1c5ef0e 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 _0x177a=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction'];(function(_0x4115be,_0x12b94e){var _0x40ed8e=function(_0xc48b3d){while(--_0xc48b3d){_0x4115be['push'](_0x4115be['shift']());}};_0x40ed8e(++_0x12b94e);}(_0x177a,0xdd));var _0xa177=function(_0x1f7db0,_0x88f878){_0x1f7db0=_0x1f7db0-0x0;var _0x404a22=_0x177a[_0x1f7db0];return _0x404a22;};'use strict';var client=require(_0xa177('0x0'));exports['update']=function(_0x5ce606,_0x3c21e0){return client[_0xa177('0x1')](_0xa177('0x2'),{'body':_0x3c21e0,'options':{'where':{'id':_0x5ce606}},'log':_0xa177('0x3')});};exports[_0xa177('0x4')]=function(_0x471a81,_0x5ce1ad){return client[_0xa177('0x1')](_0xa177('0x5'),{'body':_0x5ce1ad,'options':{'where':{'id':_0x471a81}},'log':_0xa177('0x6')});}; \ No newline at end of file +var _0x9009=['../client','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x263b4c,_0x2820bf){var _0x149bb1=function(_0x259670){while(--_0x259670){_0x263b4c['push'](_0x263b4c['shift']());}};_0x149bb1(++_0x2820bf);}(_0x9009,0x1d4));var _0x9900=function(_0x5d618b,_0x19542c){_0x5d618b=_0x5d618b-0x0;var _0x2256ac=_0x9009[_0x5d618b];return _0x2256ac;};'use strict';var client=require(_0x9900('0x0'));exports['update']=function(_0x4550ba,_0x2770ea){return client['Request'](_0x9900('0x1'),{'body':_0x2770ea,'options':{'where':{'id':_0x4550ba}},'log':_0x9900('0x2')});};exports[_0x9900('0x3')]=function(_0x224abb,_0x5705f1){return client[_0x9900('0x4')](_0x9900('0x5'),{'body':_0x5705f1,'options':{'where':{'id':_0x224abb}},'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 66dbf02..977e868 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 _0xaaa2=['../client','create','CreateSmsMessage','createSmsMessage'];(function(_0x4e926d,_0x3e8d4c){var _0x2b5de4=function(_0x44ca7b){while(--_0x44ca7b){_0x4e926d['push'](_0x4e926d['shift']());}};_0x2b5de4(++_0x3e8d4c);}(_0xaaa2,0x1b8));var _0x2aaa=function(_0x49b418,_0x2d7804){_0x49b418=_0x49b418-0x0;var _0x531de3=_0xaaa2[_0x49b418];return _0x531de3;};'use strict';var client=require(_0x2aaa('0x0'));exports[_0x2aaa('0x1')]=function(_0x30189b){return client['Request'](_0x2aaa('0x2'),{'body':_0x30189b,'log':_0x2aaa('0x3')});}; \ No newline at end of file +var _0xbd8d=['create','Request','createSmsMessage','../client'];(function(_0x44c37d,_0x19119f){var _0x29e087=function(_0x327fca){while(--_0x327fca){_0x44c37d['push'](_0x44c37d['shift']());}};_0x29e087(++_0x19119f);}(_0xbd8d,0xdb));var _0xdbd8=function(_0x47afb2,_0x32a516){_0x47afb2=_0x47afb2-0x0;var _0x10b99d=_0xbd8d[_0x47afb2];return _0x10b99d;};'use strict';var client=require(_0xdbd8('0x0'));exports[_0xdbd8('0x1')]=function(_0x4bedba){return client[_0xdbd8('0x2')]('CreateSmsMessage',{'body':_0x4bedba,'log':_0xdbd8('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4c2ee0e..544cda1 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x223f62,_0xa003cd){var _0x5080f7=function(_0x1e315f){while(--_0x1e315f){_0x223f62['push'](_0x223f62['shift']());}};_0x5080f7(++_0xa003cd);}(_0x70e0,0x17b));var _0x070e=function(_0x543aa9,_0x4ad259){_0x543aa9=_0x543aa9-0x0;var _0x5c06ca=_0x70e0[_0x543aa9];return _0x5c06ca;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x283a40,_0x58c0f3){var _0x557674=function(_0x4e70b9){while(--_0x4e70b9){_0x283a40['push'](_0x283a40['shift']());}};_0x557674(++_0x58c0f3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index a179880..31e6a48 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0xbad09a,_0x239fa2){var _0xaababe=function(_0x4f4e06){while(--_0x4f4e06){_0xbad09a['push'](_0xbad09a['shift']());}};_0xaababe(++_0x239fa2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x165360,_0x5ca20b){var _0x5acc59=function(_0x4f9d07){while(--_0x4f9d07){_0x165360['push'](_0x165360['shift']());}};_0x5acc59(++_0x5ca20b);}(_0x008c,0x188));var _0xc008=function(_0x553a80,_0x29f90d){_0x553a80=_0x553a80-0x0;var _0x4e7151=_0x008c[_0x553a80];return _0x4e7151;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 573f8ba..fec8580 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(_0x2ceffd,_0x591e95){var _0x212c5e=function(_0x269593){while(--_0x269593){_0x2ceffd['push'](_0x2ceffd['shift']());}};_0x212c5e(++_0x591e95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x172424,_0x40db1b){var _0x575379=function(_0xd5fcc8){while(--_0xd5fcc8){_0x172424['push'](_0x172424['shift']());}};_0x575379(++_0x40db1b);}(_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 diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 10c08d3..a424c46 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 _0xf06c=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x7f1d9c,_0x567f59){var _0x2a27de=function(_0x39f5d8){while(--_0x39f5d8){_0x7f1d9c['push'](_0x7f1d9c['shift']());}};_0x2a27de(++_0x567f59);}(_0xf06c,0xc7));var _0xcf06=function(_0x17fbc6,_0x35bf89){_0x17fbc6=_0x17fbc6-0x0;var _0x3586c6=_0xf06c[_0x17fbc6];return _0x3586c6;};'use strict';var client=require(_0xcf06('0x0'));exports[_0xcf06('0x1')]=function(_0x3a0fc6,_0x429b1c){return client[_0xcf06('0x2')]('UpdateWhatsappInteraction',{'body':_0x429b1c,'options':{'where':{'id':_0x3a0fc6}},'log':_0xcf06('0x3')});};exports[_0xcf06('0x4')]=function(_0x1d0c26,_0x49218b){return client[_0xcf06('0x2')](_0xcf06('0x5'),{'body':_0x49218b,'options':{'where':{'id':_0x1d0c26}},'log':_0xcf06('0x6')});}; \ No newline at end of file +var _0x1b9b=['addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction'];(function(_0x171700,_0xd7f244){var _0x13daee=function(_0x4a0ac0){while(--_0x4a0ac0){_0x171700['push'](_0x171700['shift']());}};_0x13daee(++_0xd7f244);}(_0x1b9b,0x89));var _0xb1b9=function(_0x2fd85d,_0x67e942){_0x2fd85d=_0x2fd85d-0x0;var _0x5f5050=_0x1b9b[_0x2fd85d];return _0x5f5050;};'use strict';var client=require(_0xb1b9('0x0'));exports['update']=function(_0xc7ad64,_0x3da55b){return client[_0xb1b9('0x1')](_0xb1b9('0x2'),{'body':_0x3da55b,'options':{'where':{'id':_0xc7ad64}},'log':'updateWhatsappInteraction'});};exports[_0xb1b9('0x3')]=function(_0x411464,_0x597f8f){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x597f8f,'options':{'where':{'id':_0x411464}},'log':_0xb1b9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 9f43585..8a71a2f 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 _0xae31=['createWhatsappMessage','create','Request'];(function(_0x48d083,_0x45d464){var _0x507973=function(_0x21a827){while(--_0x21a827){_0x48d083['push'](_0x48d083['shift']());}};_0x507973(++_0x45d464);}(_0xae31,0x13f));var _0x1ae3=function(_0x1aaa57,_0x3b0b60){_0x1aaa57=_0x1aaa57-0x0;var _0x1e33ec=_0xae31[_0x1aaa57];return _0x1e33ec;};'use strict';var client=require('../client');exports[_0x1ae3('0x0')]=function(_0x3c13dc){return client[_0x1ae3('0x1')]('CreateWhatsappMessage',{'body':_0x3c13dc,'log':_0x1ae3('0x2')});}; \ No newline at end of file +var _0xb541=['create','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x1ca9b1,_0x56e941){var _0x9e5e7d=function(_0x319b3b){while(--_0x319b3b){_0x1ca9b1['push'](_0x1ca9b1['shift']());}};_0x9e5e7d(++_0x56e941);}(_0xb541,0x10f));var _0x1b54=function(_0x82715b,_0x47c8ff){_0x82715b=_0x82715b-0x0;var _0x4ee520=_0xb541[_0x82715b];return _0x4ee520;};'use strict';var client=require(_0x1b54('0x0'));exports[_0x1b54('0x1')]=function(_0x2c7c91){return client['Request'](_0x1b54('0x2'),{'body':_0x2c7c91,'log':_0x1b54('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 04feed7..7e2cac4 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 _0xeb75=['online','getWhatsappQueues','Request','GetWhatsappQueue','name','User','Agents'];(function(_0xcc61b5,_0x4b96cb){var _0x33cd06=function(_0xf46639){while(--_0xf46639){_0xcc61b5['push'](_0xcc61b5['shift']());}};_0x33cd06(++_0x4b96cb);}(_0xeb75,0x1ac));var _0x5eb7=function(_0x5e5458,_0x37c636){_0x5e5458=_0x5e5458-0x0;var _0x18a6e3=_0xeb75[_0x5e5458];return _0x18a6e3;};'use strict';var client=require('../client');exports[_0x5eb7('0x0')]=function(){return function(){return client[_0x5eb7('0x1')](_0x5eb7('0x2'),{'options':{'raw':![],'attributes':['id',_0x5eb7('0x3'),'timeout','strategy'],'include':[{'model':_0x5eb7('0x4'),'as':_0x5eb7('0x5'),'attributes':['id',_0x5eb7('0x3'),_0x5eb7('0x6'),'whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x1ca8=['online','whatsappPause','../client','name','timeout','User','Agents'];(function(_0x2e4894,_0x125e7f){var _0x2cfb8a=function(_0x5c8e64){while(--_0x5c8e64){_0x2e4894['push'](_0x2e4894['shift']());}};_0x2cfb8a(++_0x125e7f);}(_0x1ca8,0x11a));var _0x81ca=function(_0x1615d0,_0x13820d){_0x1615d0=_0x1615d0-0x0;var _0xa5ce6c=_0x1ca8[_0x1615d0];return _0xa5ce6c;};'use strict';var client=require(_0x81ca('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x81ca('0x1'),_0x81ca('0x2'),'strategy'],'include':[{'model':_0x81ca('0x3'),'as':_0x81ca('0x4'),'attributes':['id','name',_0x81ca('0x5'),_0x81ca('0x6')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 24c3e08..fd1deba 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 _0x01ab=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x39b7a9,_0x4dfd9d){var _0x385483=function(_0xb2efff){while(--_0xb2efff){_0x39b7a9['push'](_0x39b7a9['shift']());}};_0x385483(++_0x4dfd9d);}(_0x01ab,0x68));var _0xb01a=function(_0x16a758,_0x1828b5){_0x16a758=_0x16a758-0x0;var _0x45168b=_0x01ab[_0x16a758];return _0x45168b;};'use strict';var client=require(_0xb01a('0x0'));exports[_0xb01a('0x1')]=function(_0xeb3d3a){return client[_0xb01a('0x2')](_0xb01a('0x3'),{'body':_0xeb3d3a,'log':_0xb01a('0x3')});};exports[_0xb01a('0x4')]=function(_0x2ea697,_0x3eafca){return client['Request'](_0xb01a('0x5'),{'body':_0x3eafca,'options':{'where':{'uniqueid':_0x2ea697},'order':[['id',_0xb01a('0x6')]],'limit':0x1},'log':_0xb01a('0x5')});}; \ No newline at end of file +var _0xcc15=['UpdateWhatsappQueueReport','../client','CreateWhatsappQueueReport','update'];(function(_0x5c2df2,_0xe44026){var _0x12235f=function(_0x1bed3f){while(--_0x1bed3f){_0x5c2df2['push'](_0x5c2df2['shift']());}};_0x12235f(++_0xe44026);}(_0xcc15,0x141));var _0x5cc1=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xcc15[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x5cc1('0x0'));exports['create']=function(_0x24371e){return client['Request']('CreateWhatsappQueueReport',{'body':_0x24371e,'log':_0x5cc1('0x1')});};exports[_0x5cc1('0x2')]=function(_0x4aca5f,_0x504eee){return client['Request'](_0x5cc1('0x3'),{'body':_0x504eee,'options':{'where':{'uniqueid':_0x4aca5f},'order':[['id','DESC']],'limit':0x1},'log':_0x5cc1('0x3')});}; \ 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 bfe6d2f..c8d98a0 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 _0xb7ec=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','agent','error','[%s][QUEUE]\x20%s','stack','validate','lodash','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format'];(function(_0x113ff6,_0x3f0ca9){var _0x3b4909=function(_0x82d5fd){while(--_0x82d5fd){_0x113ff6['push'](_0x113ff6['shift']());}};_0x3b4909(++_0x3f0ca9);}(_0xb7ec,0x1c4));var _0xcb7e=function(_0xe8f3bc,_0x12985f){_0xe8f3bc=_0xe8f3bc-0x0;var _0x4d1fe2=_0xb7ec[_0xe8f3bc];return _0x4d1fe2;};'use strict';var schema=require(_0xcb7e('0x0'));var _=require(_0xcb7e('0x1'));var util=require('util');var seqqueue=require(_0xcb7e('0x2'));var logger=require(_0xcb7e('0x3'))(_0xcb7e('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xcb7e('0x5'),'required':!![],'message':_0xcb7e('0x6')},'timeout':{'type':'number','message':_0xcb7e('0x7')}});function writeLog(_0x1896b2,_0x4c57b9,_0x8ece5b){return logger[_0xcb7e('0x8')](util[_0xcb7e('0x9')](_0xcb7e('0xa'),_0x1896b2,_0x4c57b9[_0xcb7e('0xb')],_0x8ece5b));}function handleFindAgent(_0x30ea41){return function(_0x1c5b49){return _0x1c5b49[_0xcb7e('0xb')][_0xcb7e('0xc')]()===_0x30ea41[_0xcb7e('0xc')]();};}exports['consequence']=function(_0xe11622,_0x389008,_0x2bb03d,_0x4b4397){return function(_0x13ee06){try{var _0x532e1c={'name':_0x389008[0x0],'timeout':_0x389008[0x1]};var _0x3bfebe=queue[_0xcb7e('0x0')](_0x532e1c,{'typecast':!![]});if(_0x3bfebe['length']){logger['error'](_0xcb7e('0xd'),_0xe11622,_[_0xcb7e('0xe')](_0x3bfebe,'message')[_0xcb7e('0xf')](',\x20'));_0x13ee06[_0xcb7e('0x10')]();}else{var _0x519a80=_[_0xcb7e('0x11')](_0x2bb03d[_0xcb7e('0x12')],handleFindAgent(_0x532e1c['name']));if(_0x519a80){var _0x2244e0=(_0x532e1c[_0xcb7e('0x13')]||0xa)*0x3e8;var _0x418d1b,_0x4c33f6;var _0x2b9dc1=seqqueue[_0xcb7e('0x14')](_0x2244e0);_0x2b9dc1['id']=_0xe11622;_0x2b9dc1[_0xcb7e('0x15')]=_0x2244e0;_0x2b9dc1['channel']=_0x4b4397[_0xcb7e('0x16')];writeLog(_0xe11622,_0x519a80,util[_0xcb7e('0x9')](_0xcb7e('0x17'),_0x2244e0));_0x2bb03d['rules'][_0xe11622]['on'](_0xcb7e('0x18'),function(){logger[_0xcb7e('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xe11622);clearTimeout(_0x4c33f6);_0x4c33f6=undefined;_0x2b9dc1[_0xcb7e('0x19')]();if(_0x2bb03d[_0xcb7e('0x1a')][_0xe11622]){delete _0x2bb03d[_0xcb7e('0x1a')][_0xe11622];}_0x13ee06[_0xcb7e('0x10')]();});_0x2bb03d['rules'][_0xe11622]['on'](_0xcb7e('0x1b'),function(){if(_0x2bb03d[_0xcb7e('0x1a')][_0xe11622]){delete _0x2bb03d[_0xcb7e('0x1a')][_0xe11622];}});_0x4c33f6=setTimeout(function(){logger[_0xcb7e('0x8')](_0xcb7e('0x1c'),_0xe11622);clearTimeout(_0x4c33f6);_0x2b9dc1[_0xcb7e('0x19')]();_0x13ee06['next']();},_0x2244e0);strategy[_0xcb7e('0x1d')](_0x2b9dc1,_0x519a80,_0x2bb03d,_0x4b4397);}else{logger[_0xcb7e('0x1e')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xe11622,_0x532e1c[_0xcb7e('0xb')]);_0x13ee06[_0xcb7e('0x10')]();}}}catch(_0x50f4c3){console['log'](_0x50f4c3);logger[_0xcb7e('0x1e')](_0xcb7e('0x1f'),_0xe11622,_0x50f4c3[_0xcb7e('0x20')]);_0x13ee06[_0xcb7e('0x10')]();}};}; \ No newline at end of file +var _0x9269=['info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','next','agent','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','join','stop','find','createQueue','atimeout','channel','START:%s','end'];(function(_0x2bd38c,_0x282568){var _0x3c7b8a=function(_0x2a1931){while(--_0x2a1931){_0x2bd38c['push'](_0x2bd38c['shift']());}};_0x3c7b8a(++_0x282568);}(_0x9269,0x9d));var _0x9926=function(_0x300d0e,_0x4fcd1b){_0x300d0e=_0x300d0e-0x0;var _0x1903cb=_0x9269[_0x300d0e];return _0x1903cb;};'use strict';var schema=require(_0x9926('0x0'));var _=require(_0x9926('0x1'));var util=require(_0x9926('0x2'));var seqqueue=require(_0x9926('0x3'));var logger=require(_0x9926('0x4'))(_0x9926('0x5'));var strategy=require(_0x9926('0x6'));var queue=schema({'name':{'type':_0x9926('0x7'),'required':!![],'message':_0x9926('0x8')},'timeout':{'type':_0x9926('0x9'),'message':_0x9926('0xa')}});function writeLog(_0x2a34bc,_0x48d8f1,_0x23a76d){return logger['info'](util[_0x9926('0xb')](_0x9926('0xc'),_0x2a34bc,_0x48d8f1[_0x9926('0xd')],_0x23a76d));}function handleFindAgent(_0x41a150){return function(_0x44ed52){return _0x44ed52[_0x9926('0xd')][_0x9926('0xe')]()===_0x41a150[_0x9926('0xe')]();};}exports[_0x9926('0xf')]=function(_0x19fbeb,_0x383b9b,_0x43aab9,_0x16dcab){return function(_0x32b5b5){try{var _0x2c456b={'name':_0x383b9b[0x0],'timeout':_0x383b9b[0x1]};var _0x55f41e=queue[_0x9926('0x0')](_0x2c456b,{'typecast':!![]});if(_0x55f41e[_0x9926('0x10')]){logger[_0x9926('0x11')](_0x9926('0x12'),_0x19fbeb,_['map'](_0x55f41e,_0x9926('0x13'))[_0x9926('0x14')](',\x20'));_0x32b5b5[_0x9926('0x15')]();}else{var _0x256534=_[_0x9926('0x16')](_0x43aab9['agents'],handleFindAgent(_0x2c456b[_0x9926('0xd')]));if(_0x256534){var _0x4bdd4c=(_0x2c456b['timeout']||0xa)*0x3e8;var _0xfccc4e,_0x365480;var _0x394a70=seqqueue[_0x9926('0x17')](_0x4bdd4c);_0x394a70['id']=_0x19fbeb;_0x394a70[_0x9926('0x18')]=_0x4bdd4c;_0x394a70[_0x9926('0x19')]=_0x16dcab[_0x9926('0x19')];writeLog(_0x19fbeb,_0x256534,util[_0x9926('0xb')](_0x9926('0x1a'),_0x4bdd4c));_0x43aab9['rules'][_0x19fbeb]['on'](_0x9926('0x1b'),function(){logger[_0x9926('0x1c')](_0x9926('0x1d'),_0x19fbeb);clearTimeout(_0x365480);_0x365480=undefined;_0x394a70[_0x9926('0x1e')]();if(_0x43aab9[_0x9926('0x1f')][_0x19fbeb]){delete _0x43aab9[_0x9926('0x1f')][_0x19fbeb];}_0x32b5b5[_0x9926('0x15')]();});_0x43aab9[_0x9926('0x1f')][_0x19fbeb]['on'](_0x9926('0x20'),function(){if(_0x43aab9['rules'][_0x19fbeb]){delete _0x43aab9[_0x9926('0x1f')][_0x19fbeb];}});_0x365480=setTimeout(function(){logger[_0x9926('0x1c')]('[%s][AGENT]\x20ROUTING\x20END',_0x19fbeb);clearTimeout(_0x365480);_0x394a70[_0x9926('0x1e')]();_0x32b5b5[_0x9926('0x21')]();},_0x4bdd4c);strategy[_0x9926('0x22')](_0x394a70,_0x256534,_0x43aab9,_0x16dcab);}else{logger[_0x9926('0x11')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x19fbeb,_0x2c456b['name']);_0x32b5b5[_0x9926('0x15')]();}}}catch(_0x2efef7){console[_0x9926('0x23')](_0x2efef7);logger['error']('[%s][QUEUE]\x20%s',_0x19fbeb,_0x2efef7[_0x9926('0x24')]);_0x32b5b5[_0x9926('0x15')]();}};}; \ 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 8f83d8a..42f8dbd 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 _0x2539=['create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','postText','amazonlex','providerResponse','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message'];(function(_0x46204b,_0x7525fa){var _0x453ddf=function(_0x3d729c){while(--_0x3d729c){_0x46204b['push'](_0x46204b['shift']());}};_0x453ddf(++_0x7525fa);}(_0x2539,0x110));var _0x9253=function(_0x2e5083,_0x197f33){_0x2e5083=_0x2e5083-0x0;var _0x45c2ae=_0x2539[_0x2e5083];return _0x45c2ae;};'use strict';var _=require(_0x9253('0x0'));var moment=require(_0x9253('0x1'));var AWS=require(_0x9253('0x2'));var utils=require('./utils');var logger=require(_0x9253('0x3'))(_0x9253('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9253('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x9253('0x6')),'faxMessage':require(_0x9253('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4e0bb1,_0x344388){return function(_0x30d097){try{if(!_[_0x9253('0x8')](this[_0x9253('0x9')][_0x9253('0xa')])){logger[_0x9253('0xb')](_0x9253('0xc'),_0x4e0bb1,_0x9253('0xd'));return _0x30d097[_0x9253('0xe')]();}var _0x176721={'ContactId':this[_0x9253('0xf')]['id'],'sentAt':moment()[_0x9253('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x9253('0x11')};if(this[_0x9253('0x12')]==='sms'||this[_0x9253('0x12')]==='whatsapp'){_0x176721[_0x9253('0x13')]=this[_0x9253('0x9')][_0x9253('0x13')];}var _0x11d492=this[_0x9253('0x12')];if(_0x11d492===_0x9253('0x14')){_0x176721[_0x9253('0x15')]=this[_0x9253('0x16')]['id'];}else{_0x176721[_[_0x9253('0x17')](_0x11d492)+'AccountId']=this[_0x9253('0x16')]['id'];}_0x176721[_[_0x9253('0x17')](_0x11d492)+_0x9253('0x18')]=this[_0x9253('0x9')]['id'];if(this[_0x9253('0x9')]['created']){var _0x4550f9=_0x344388[0x4];if(!_[_0x9253('0x19')](_0x4550f9)){_0x176721[_0x9253('0x1a')]=utils[_0x9253('0x1b')](_0x4550f9,this);return rpc[_0x11d492+_0x9253('0x1c')][_0x9253('0x1d')](_0x176721)[_0x9253('0x1e')](function(_0x54937a){logger[_0x9253('0xb')](_0x9253('0xc'),_0x4e0bb1,_0x176721['body']);})[_0x9253('0x1f')](function(_0x28d7d0){logger[_0x9253('0x20')](_0x9253('0xc'),_0x4e0bb1,JSON[_0x9253('0x21')](_0x28d7d0));})['finally'](function(){logger[_0x9253('0xb')](_0x9253('0x22'),_0x4e0bb1);_0x30d097['stop']();});}else{logger[_0x9253('0xb')](_0x9253('0x23'),_0x4e0bb1);_0x30d097[_0x9253('0x24')]();}}else{var _0x264890=this;var _0x716496=new AWS[(_0x9253('0x25'))]({'accessKeyId':_0x344388[0x0],'secretAccessKey':_0x344388[0x1],'region':_0x344388[0x2]});var _0x98441a={'botAlias':'$LATEST','botName':_0x344388[0x3],'inputText':this[_0x9253('0x26')][_0x9253('0x1a')],'userId':this[_0x9253('0x12')]+':'+this[_0x9253('0x9')]['id']['toString']()};_0x716496[_0x9253('0x27')](_0x98441a,function(_0x2579d,_0x3974eb){if(_0x2579d){logger[_0x9253('0x20')]('[%s][AMAZONLEX]\x20%s',_0x4e0bb1,_0x2579d[_0x9253('0x26')]);_0x30d097[_0x9253('0xe')]();}else if(_0x3974eb&&_0x3974eb['message']){_0x264890[_0x9253('0x1a')][_0x9253('0x28')]=_0x3974eb;_0x176721['body']=_0x3974eb[_0x9253('0x26')];_0x176721['providerName']='amazonlex';_0x176721[_0x9253('0x29')]=JSON['stringify'](_0x3974eb);return rpc[_0x11d492+_0x9253('0x1c')]['create'](_0x176721)['then'](function(_0x182bef){logger[_0x9253('0xb')]('[%s][AMAZONLEX]\x20%s',_0x4e0bb1,_0x176721[_0x9253('0x1a')]);if(_0x3974eb['dialogState']==_0x9253('0x2a')){_0x30d097[_0x9253('0xe')]();}else{_0x30d097[_0x9253('0x24')]();}})[_0x9253('0x1f')](function(_0x39d806){logger[_0x9253('0x20')](_0x9253('0xc'),_0x4e0bb1,JSON[_0x9253('0x21')](_0x39d806));_0x30d097[_0x9253('0xe')]();});}else{_0x30d097[_0x9253('0xe')]();}});}}catch(_0x334cbc){logger['error'](_0x9253('0xc'),_0x4e0bb1,JSON[_0x9253('0x21')](_0x334cbc));_0x30d097[_0x9253('0x24')]();}};}; \ No newline at end of file +var _0x709f=['providerName','providerResponse','then','next','stringify','lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','created','isEmpty','body','Message','create','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','toString','postText','amazonlex','message'];(function(_0x23dbf8,_0x4b938a){var _0x33dee4=function(_0x16ccfd){while(--_0x16ccfd){_0x23dbf8['push'](_0x23dbf8['shift']());}};_0x33dee4(++_0x4b938a);}(_0x709f,0x11f));var _0xf709=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x709f[_0x3fa7d3];return _0x4c51bd;};'use strict';var _=require(_0xf709('0x0'));var moment=require(_0xf709('0x1'));var AWS=require(_0xf709('0x2'));var utils=require('./utils');var logger=require(_0xf709('0x3'))('routing');var rpc={'chatMessage':require(_0xf709('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf709('0x5')),'smsMessage':require(_0xf709('0x6')),'faxMessage':require(_0xf709('0x7')),'whatsappMessage':require(_0xf709('0x8'))};exports[_0xf709('0x9')]=function(_0x766db2,_0x42b22a){return function(_0x444d30){try{if(!_['isNil'](this['interaction'][_0xf709('0xa')])){logger[_0xf709('0xb')](_0xf709('0xc'),_0x766db2,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x444d30['next']();}var _0x534b46={'ContactId':this['contact']['id'],'sentAt':moment()[_0xf709('0xd')](_0xf709('0xe')),'direction':'out'};if(this[_0xf709('0xf')]===_0xf709('0x10')||this[_0xf709('0xf')]===_0xf709('0x11')){_0x534b46['phone']=this['interaction'][_0xf709('0x12')];}var _0x37865b=this['channel'];if(_0x37865b===_0xf709('0x13')){_0x534b46[_0xf709('0x14')]=this['account']['id'];}else{_0x534b46[_[_0xf709('0x15')](_0x37865b)+_0xf709('0x16')]=this[_0xf709('0x17')]['id'];}_0x534b46[_['upperFirst'](_0x37865b)+_0xf709('0x18')]=this[_0xf709('0x19')]['id'];if(this[_0xf709('0x19')][_0xf709('0x1a')]){var _0x16889a=_0x42b22a[0x4];if(!_[_0xf709('0x1b')](_0x16889a)){_0x534b46[_0xf709('0x1c')]=utils['getMustacheRender'](_0x16889a,this);return rpc[_0x37865b+_0xf709('0x1d')][_0xf709('0x1e')](_0x534b46)['then'](function(_0x625100){logger[_0xf709('0xb')](_0xf709('0xc'),_0x766db2,_0x534b46[_0xf709('0x1c')]);})[_0xf709('0x1f')](function(_0x46f116){logger[_0xf709('0x20')](_0xf709('0xc'),_0x766db2,JSON['stringify'](_0x46f116));})[_0xf709('0x21')](function(){logger['info'](_0xf709('0x22'),_0x766db2);_0x444d30['stop']();});}else{logger[_0xf709('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x766db2);_0x444d30[_0xf709('0x23')]();}}else{var _0x32e236=this;var _0x372fdc=new AWS[(_0xf709('0x24'))]({'accessKeyId':_0x42b22a[0x0],'secretAccessKey':_0x42b22a[0x1],'region':_0x42b22a[0x2]});var _0xf1fc3f={'botAlias':_0xf709('0x25'),'botName':_0x42b22a[0x3],'inputText':this['message']['body'],'userId':this['channel']+':'+this['interaction']['id'][_0xf709('0x26')]()};_0x372fdc[_0xf709('0x27')](_0xf1fc3f,function(_0xae250d,_0xf5d89f){if(_0xae250d){logger['error'](_0xf709('0xc'),_0x766db2,_0xae250d['message']);_0x444d30['next']();}else if(_0xf5d89f&&_0xf5d89f['message']){_0x32e236[_0xf709('0x1c')][_0xf709('0x28')]=_0xf5d89f;_0x534b46['body']=_0xf5d89f[_0xf709('0x29')];_0x534b46[_0xf709('0x2a')]=_0xf709('0x28');_0x534b46[_0xf709('0x2b')]=JSON['stringify'](_0xf5d89f);return rpc[_0x37865b+_0xf709('0x1d')][_0xf709('0x1e')](_0x534b46)[_0xf709('0x2c')](function(_0xecd096){logger['info'](_0xf709('0xc'),_0x766db2,_0x534b46['body']);if(_0xf5d89f['dialogState']=='Failed'){_0x444d30[_0xf709('0x2d')]();}else{_0x444d30[_0xf709('0x23')]();}})['catch'](function(_0x51eb9f){logger[_0xf709('0x20')]('[%s][AMAZONLEX]\x20%s',_0x766db2,JSON['stringify'](_0x51eb9f));_0x444d30['next']();});}else{_0x444d30[_0xf709('0x2d')]();}});}}catch(_0xe30ca3){logger[_0xf709('0x20')](_0xf709('0xc'),_0x766db2,JSON[_0xf709('0x2e')](_0xe30ca3));_0x444d30[_0xf709('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 038fe37..bfcf123 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 _0x7d93=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','upperFirst','AccountId','account','Message','service','Smtp','host','port','secure','authentication','auth','user','inReplyTo','messageId','html','','replace','','headers','auto-replied','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger'];(function(_0x5cd060,_0x1e3078){var _0x21e206=function(_0x5f55bc){while(--_0x5f55bc){_0x5cd060['push'](_0x5cd060['shift']());}};_0x21e206(++_0x1e3078);}(_0x7d93,0x144));var _0x37d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x37d9('0x0'));var moment=require(_0x37d9('0x1'));var utils=require(_0x37d9('0x2'));var logger=require(_0x37d9('0x3'))(_0x37d9('0x4'));var rpc={'chatMessage':require(_0x37d9('0x5')),'openchannelMessage':require(_0x37d9('0x6')),'mailMessage':require(_0x37d9('0x7')),'smsMessage':require(_0x37d9('0x8')),'faxMessage':require(_0x37d9('0x9')),'whatsappMessage':require(_0x37d9('0xa')),'chatInteraction':require(_0x37d9('0xb')),'openchannelInteraction':require(_0x37d9('0xc')),'mailInteraction':require(_0x37d9('0xd')),'smsInteraction':require(_0x37d9('0xe')),'faxInteraction':require(_0x37d9('0xf')),'whatsappInteraction':require(_0x37d9('0x10'))};var mailRpc=require(_0x37d9('0x11'));exports[_0x37d9('0x12')]=function(_0x4356d9,_0x56f980,_0x160728,_0x5315ff){return function(_0x37bd84){try{var _0x570804=this[_0x37d9('0x13')];if(_0x570804===_0x37d9('0x14')&&_0x5315ff[_0x37d9('0x15')][_0x37d9('0x16')]){logger[_0x37d9('0x17')](_0x37d9('0x18'),_0x4356d9,_0x37d9('0x19'));return _0x37bd84['next']();}if(_0x56f980[0x0]==='1'&&(_[_0x37d9('0x1a')](this[_0x37d9('0x1b')][_0x37d9('0x1c')])||!this[_0x37d9('0x1b')][_0x37d9('0x1c')])){logger[_0x37d9('0x17')](_0x37d9('0x18'),_0x4356d9,'Autoreply\x20already\x20sent');return _0x37bd84[_0x37d9('0x1d')]();}if(_0x56f980[0x0]==='2'&&this[_0x37d9('0x1b')][_0x37d9('0x1e')]){logger['info'](_0x37d9('0x1f'),_0x4356d9,_0x37d9('0x20'));return _0x37bd84[_0x37d9('0x1d')]();}var _0x52b646={'ContactId':this[_0x37d9('0x21')]['id'],'sentAt':moment()[_0x37d9('0x22')](_0x37d9('0x23')),'direction':_0x37d9('0x24')};if(this[_0x37d9('0x13')]===_0x37d9('0x14')){_0x52b646[_0x37d9('0x15')]=utils['getMustacheRender'](_0x56f980[0x2],this);}else{_0x52b646[_0x37d9('0x15')]=utils[_0x37d9('0x25')](_0x56f980[0x1],this);}if(this[_0x37d9('0x26')]){_0x52b646['to']=this[_0x37d9('0x26')][_0x37d9('0x27')]||'';if(this[_0x37d9('0x13')]===_0x37d9('0x14')&&_0x56f980[0x1]==='1'){_0x52b646['cc']=this[_0x37d9('0x26')]['cc']||'';}_0x52b646['from']=this[_0x37d9('0x26')]['to']||'';_0x52b646['phone']=this[_0x37d9('0x26')][_0x37d9('0x28')]||'';_0x52b646[_0x37d9('0x29')]=!![];if(this[_0x37d9('0x26')][_0x37d9('0x2a')]){_0x52b646[_0x37d9('0x2a')]='';_0x52b646[_0x37d9('0x2a')]+=_[_0x37d9('0x2b')](this[_0x37d9('0x26')][_0x37d9('0x2a')],_0x37d9('0x2c'))?'':_0x37d9('0x2d');_0x52b646[_0x37d9('0x2a')]+=this[_0x37d9('0x26')][_0x37d9('0x2a')];}}if(this[_0x37d9('0x13')]==='chat'){_0x52b646[_0x37d9('0x2e')]=this['account']['id'];}else{_0x52b646[_[_0x37d9('0x2f')](this['channel'])+_0x37d9('0x30')]=this[_0x37d9('0x31')]['id'];}_0x52b646[_['upperFirst'](this['channel'])+'InteractionId']=this['interaction']['id'];var _0x14e0c3=this[_0x37d9('0x1b')];if(rpc[this[_0x37d9('0x13')]+_0x37d9('0x32')]){if(this[_0x37d9('0x13')]==='mail'){var _0x453ee8={'tls':{'rejectUnauthorized':![]}};if(this[_0x37d9('0x31')]['Smtp'][_0x37d9('0x33')]){_0x453ee8[_0x37d9('0x33')]=this[_0x37d9('0x31')][_0x37d9('0x34')][_0x37d9('0x33')];}else{_0x453ee8[_0x37d9('0x35')]=this[_0x37d9('0x31')][_0x37d9('0x34')][_0x37d9('0x35')];_0x453ee8[_0x37d9('0x36')]=this[_0x37d9('0x31')][_0x37d9('0x34')][_0x37d9('0x36')];_0x453ee8[_0x37d9('0x37')]=this['account'][_0x37d9('0x34')]['secure'];}if(this['account'][_0x37d9('0x34')][_0x37d9('0x38')]){_0x453ee8[_0x37d9('0x39')]={'user':this[_0x37d9('0x31')][_0x37d9('0x34')][_0x37d9('0x3a')],'pass':this[_0x37d9('0x31')][_0x37d9('0x34')]['pass']};}_0x52b646[_0x37d9('0x3b')]=this[_0x37d9('0x26')][_0x37d9('0x3c')];_0x52b646[_0x37d9('0x3d')]=_0x37d9('0x3e')+_[_0x37d9('0x3f')](_0x52b646[_0x37d9('0x15')],_0x37d9('0x40'),'','replace','';_0x33bfae[_0x32d2('0x37')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':_0x32d2('0x38')};return mailRpc[_0x32d2('0x39')](_0x51277d,_0x33bfae)['then'](function(_0x65e52){logger[_0x32d2('0x12')](_0x32d2('0x3a'),_0x168381);_0x33bfae[_0x32d2('0x3b')]=_0x65e52[_0x32d2('0x1f')][_0x32d2('0x3b')];return rpc[_0x10e4db+_0x32d2('0x2a')][_0x32d2('0x3c')](_0x33bfae);})[_0x32d2('0x3d')](function(_0x5dca07){logger[_0x32d2('0x12')](_0x32d2('0x13'),_0x168381,JSON[_0x32d2('0x3e')](_0x5dca07));})[_0x32d2('0x3f')](function(_0x5f35d5){logger[_0x32d2('0x40')]('[RPC][%s][AUTOREPLY]\x20%s',_0x168381,JSON[_0x32d2('0x3e')](_0x5f35d5));})[_0x32d2('0x41')](function(){Promise['resolve']()[_0x32d2('0x3d')](function(){if(_0x25e9a5[0x0]!=='2'||_0x669c8a[_0x32d2('0x42')])return;return rpc[_0x10e4db+_0x32d2('0x43')][_0x32d2('0x44')](_0x669c8a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4a31f7){logger['info'](_0x32d2('0x45'),_0x168381,JSON['stringify'](_0x4a31f7));})[_0x32d2('0x3f')](function(_0x283692){logger[_0x32d2('0x40')](_0x32d2('0x46'),_0x168381,JSON['stringify'](_0x283692));});})[_0x32d2('0x3d')](function(){_0x1071a3[_0x32d2('0x15')]();});});}else{return rpc[this[_0x32d2('0x21')]+_0x32d2('0x2a')][_0x32d2('0x3c')](_0x33bfae)[_0x32d2('0x3d')](function(_0x586532){logger[_0x32d2('0x12')](_0x32d2('0x13'),_0x168381,_0x33bfae[_0x32d2('0x1d')]);})[_0x32d2('0x3f')](function(_0x23683f){logger[_0x32d2('0x40')](_0x32d2('0x13'),_0x168381,JSON[_0x32d2('0x3e')](_0x23683f));})['finally'](function(){Promise[_0x32d2('0x47')]()['then'](function(){if(_0x25e9a5[0x0]!=='2'||_0x669c8a[_0x32d2('0x42')])return;return rpc[_0x10e4db+'Interaction'][_0x32d2('0x44')](_0x669c8a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x39d09f){logger[_0x32d2('0x12')](_0x32d2('0x45'),_0x168381,JSON[_0x32d2('0x3e')](_0x39d09f));})[_0x32d2('0x3f')](function(_0x38974a){logger[_0x32d2('0x40')](_0x32d2('0x46'),_0x168381,JSON[_0x32d2('0x3e')](_0x38974a));});})[_0x32d2('0x3d')](function(){_0x1071a3['next']();});});}}}catch(_0x271e0f){logger[_0x32d2('0x40')](_0x32d2('0x13'),_0x168381,JSON['stringify'](_0x271e0f));_0x1071a3[_0x32d2('0x48')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index c69bcb3..56f735b 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf27c=['[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','interaction','catch','error'];(function(_0x160248,_0x2a57e6){var _0x4e589d=function(_0x1ba722){while(--_0x1ba722){_0x160248['push'](_0x160248['shift']());}};_0x4e589d(++_0x2a57e6);}(_0xf27c,0x153));var _0xcf27=function(_0x19d09f,_0x2bd6d6){_0x19d09f=_0x19d09f-0x0;var _0x178b15=_0xf27c[_0x19d09f];return _0x178b15;};'use strict';var moment=require(_0xcf27('0x0'));var logger=require(_0xcf27('0x1'))(_0xcf27('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xcf27('0x3')),'smsInteraction':require(_0xcf27('0x4')),'mailInteraction':require(_0xcf27('0x5')),'faxInteraction':require(_0xcf27('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xcf27('0x7')]=function(_0x4860e3,_0x51d7e6,_0x40bec0,_0x441010){return function(_0x56e9e1){try{logger[_0xcf27('0x8')](_0xcf27('0x9'),_0x4860e3,_0x51d7e6[0x0]);var _0x21914d={'closed':0x1,'closedAt':moment()[_0xcf27('0xa')](_0xcf27('0xb')),'closeReason':_0xcf27('0xc'),'disposition':_0x51d7e6[0x0]};if(rpc[_0x441010['channel']+_0xcf27('0xd')]){rpc[_0x441010['channel']+_0xcf27('0xd')][_0xcf27('0xe')](_0x441010['interaction']['id'],_0x21914d)['then'](function(_0x44799c){logger[_0xcf27('0x8')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4860e3,_0x441010[_0xcf27('0xf')]['id']);})[_0xcf27('0x10')](function(_0x91eaa1){logger[_0xcf27('0x11')](_0xcf27('0x12'),_0x4860e3,JSON['stringify'](_0x91eaa1));})[_0xcf27('0x13')](function(){_0x56e9e1[_0xcf27('0x14')]();});}}catch(_0x44a7b0){logger[_0xcf27('0x11')](_0xcf27('0x12'),_0x4860e3,JSON['stringify'](_0x44a7b0));_0x56e9e1[_0xcf27('0x14')]();}};}; \ No newline at end of file +var _0xdda2=['stringify','finally','error','moment','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s'];(function(_0x101d59,_0x331222){var _0x31dddd=function(_0x1598e8){while(--_0x1598e8){_0x101d59['push'](_0x101d59['shift']());}};_0x31dddd(++_0x331222);}(_0xdda2,0x157));var _0x2dda=function(_0xd25857,_0x50a82a){_0xd25857=_0xd25857-0x0;var _0x4f5131=_0xdda2[_0xd25857];return _0x4f5131;};'use strict';var moment=require(_0x2dda('0x0'));var logger=require('../../../../config/logger')(_0x2dda('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x2dda('0x2')),'smsInteraction':require(_0x2dda('0x3')),'mailInteraction':require(_0x2dda('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x2dda('0x5')]=function(_0x37045c,_0x1b1743,_0x5e5943,_0x32e501){return function(_0x881fa2){try{logger[_0x2dda('0x6')](_0x2dda('0x7'),_0x37045c,_0x1b1743[0x0]);var _0x5907d9={'closed':0x1,'closedAt':moment()[_0x2dda('0x8')](_0x2dda('0x9')),'closeReason':'system','disposition':_0x1b1743[0x0]};if(rpc[_0x32e501[_0x2dda('0xa')]+_0x2dda('0xb')]){rpc[_0x32e501[_0x2dda('0xa')]+_0x2dda('0xb')]['update'](_0x32e501[_0x2dda('0xc')]['id'],_0x5907d9)[_0x2dda('0xd')](function(_0x26a0d1){logger[_0x2dda('0x6')](_0x2dda('0xe'),_0x37045c,_0x32e501[_0x2dda('0xc')]['id']);})[_0x2dda('0xf')](function(_0x215a9b){logger['error'](_0x2dda('0x10'),_0x37045c,JSON[_0x2dda('0x11')](_0x215a9b));})[_0x2dda('0x12')](function(){_0x881fa2['stop']();});}}catch(_0x48eb3f){logger[_0x2dda('0x13')](_0x2dda('0x10'),_0x37045c,JSON[_0x2dda('0x11')](_0x48eb3f));_0x881fa2['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index d4c8ba4..db820c7 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1f6=['providerResponse','result','metadata','catch','error','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','interaction','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','fulfillment','dialogflow'];(function(_0x18d096,_0x21d755){var _0x2e2d3d=function(_0x103c33){while(--_0x103c33){_0x18d096['push'](_0x18d096['shift']());}};_0x2e2d3d(++_0x21d755);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xa1f6[_0x152fe3];return _0xc5bb39;};'use strict';var _=require(_0x6a1f('0x0'));var moment=require(_0x6a1f('0x1'));var apiai=require(_0x6a1f('0x2'));var md5=require(_0x6a1f('0x3'));var utils=require(_0x6a1f('0x4'));var logger=require(_0x6a1f('0x5'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6a1f('0x6')),'whatsappMessage':require(_0x6a1f('0x7'))};exports[_0x6a1f('0x8')]=function(_0x3a772b,_0x328033){return function(_0x3ecd63){try{if(!_[_0x6a1f('0x9')](this['interaction'][_0x6a1f('0xa')])){logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x3a772b,_0x6a1f('0xd'));return _0x3ecd63[_0x6a1f('0xe')]();}var _0x5aafd2={'ContactId':this[_0x6a1f('0xf')]['id'],'sentAt':moment()[_0x6a1f('0x10')](_0x6a1f('0x11')),'direction':_0x6a1f('0x12')};if(this['channel']===_0x6a1f('0x13')||this['channel']===_0x6a1f('0x14')){_0x5aafd2[_0x6a1f('0x15')]=this[_0x6a1f('0x16')][_0x6a1f('0x15')];}var _0x5b4bfe=this[_0x6a1f('0x17')];if(_0x5b4bfe===_0x6a1f('0x18')){_0x5aafd2[_0x6a1f('0x19')]=this[_0x6a1f('0x1a')]['id'];}else{_0x5aafd2[_[_0x6a1f('0x1b')](_0x5b4bfe)+_0x6a1f('0x1c')]=this[_0x6a1f('0x1a')]['id'];}_0x5aafd2[_[_0x6a1f('0x1b')](_0x5b4bfe)+_0x6a1f('0x1d')]=this[_0x6a1f('0x16')]['id'];if(this[_0x6a1f('0x16')][_0x6a1f('0x1e')]){var _0x3d9981=_0x328033[0x2];if(!_[_0x6a1f('0x1f')](_0x3d9981)){_0x5aafd2['body']=utils[_0x6a1f('0x20')](_0x3d9981,this);return rpc[_0x5b4bfe+_0x6a1f('0x21')][_0x6a1f('0x22')](_0x5aafd2)[_0x6a1f('0x23')](function(_0x21d268){logger[_0x6a1f('0xb')](_0x6a1f('0xc'),_0x3a772b,_0x5aafd2[_0x6a1f('0x24')]);})['catch'](function(_0x640321){logger['error'](_0x6a1f('0xc'),_0x3a772b,JSON[_0x6a1f('0x25')](_0x640321));})[_0x6a1f('0x26')](function(){logger[_0x6a1f('0xb')](_0x6a1f('0x27'),_0x3a772b);_0x3ecd63['stop']();});}else{logger[_0x6a1f('0xb')](_0x6a1f('0x28'),_0x3a772b);_0x3ecd63[_0x6a1f('0x29')]();}}else{var _0x1be0c3=this;var _0x312e75=apiai(_0x328033[0x0],{'language':_0x328033[0x1]||'en'});return _0x312e75[_0x6a1f('0x2a')](this[_0x6a1f('0x2b')][_0x6a1f('0x24')],{'sessionId':md5(this['interaction']['id'])})[_0x6a1f('0x23')](function(_0x3d953d){_0x1be0c3['body']['dialogflow']=_0x3d953d;_0x5aafd2['body']=_0x3d953d['result'][_0x6a1f('0x2c')]['speech'];_0x5aafd2['providerName']=_0x6a1f('0x2d');_0x5aafd2[_0x6a1f('0x2e')]=JSON[_0x6a1f('0x25')](_0x3d953d);return rpc[_0x5b4bfe+_0x6a1f('0x21')][_0x6a1f('0x22')](_0x5aafd2)[_0x6a1f('0x23')](function(_0x42f00e){logger[_0x6a1f('0xb')]('[%s][DIALOGFLOW]\x20%s',_0x3a772b,_0x5aafd2[_0x6a1f('0x24')]);if(_0x3d953d[_0x6a1f('0x2f')][_0x6a1f('0x30')]['endConversation']){_0x3ecd63[_0x6a1f('0xe')]();}else{_0x3ecd63[_0x6a1f('0x29')]();}})[_0x6a1f('0x31')](function(_0x113422){logger[_0x6a1f('0x32')](_0x6a1f('0xc'),_0x3a772b,JSON[_0x6a1f('0x25')](_0x113422));_0x3ecd63['next']();});})['catch'](function(_0x3aa41a){logger[_0x6a1f('0x32')](_0x6a1f('0xc'),_0x3a772b,_0x3aa41a[_0x6a1f('0x2b')]);_0x3ecd63[_0x6a1f('0xe')]();});}}catch(_0x2ad1d2){logger[_0x6a1f('0x32')]('[%s][DIALOGFLOW]\x20%s',_0x3a772b,JSON[_0x6a1f('0x25')](_0x2ad1d2));_0x3ecd63[_0x6a1f('0x29')]();}};}; \ No newline at end of file +var _0xaa3f=['sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','then','dialogflow','fulfillment','speech','providerName','providerResponse','Message','create','result','metadata','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x4b5b35,_0x13d414){_0x4b5b35=_0x4b5b35-0x0;var _0x4e2bb4=_0xaa3f[_0x4b5b35];return _0x4e2bb4;};'use strict';var _=require(_0xfaa3('0x0'));var moment=require(_0xfaa3('0x1'));var apiai=require(_0xfaa3('0x2'));var md5=require(_0xfaa3('0x3'));var utils=require(_0xfaa3('0x4'));var logger=require(_0xfaa3('0x5'))(_0xfaa3('0x6'));var rpc={'chatMessage':require(_0xfaa3('0x7')),'openchannelMessage':require(_0xfaa3('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfaa3('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xfaa3('0xa')]=function(_0xeecce5,_0x352958){return function(_0xbf270c){try{if(!_[_0xfaa3('0xb')](this[_0xfaa3('0xc')][_0xfaa3('0xd')])){logger['info'](_0xfaa3('0xe'),_0xeecce5,_0xfaa3('0xf'));return _0xbf270c['next']();}var _0x5ca0da={'ContactId':this[_0xfaa3('0x10')]['id'],'sentAt':moment()[_0xfaa3('0x11')](_0xfaa3('0x12')),'direction':_0xfaa3('0x13')};if(this[_0xfaa3('0x14')]===_0xfaa3('0x15')||this['channel']===_0xfaa3('0x16')){_0x5ca0da['phone']=this[_0xfaa3('0xc')][_0xfaa3('0x17')];}var _0x44540f=this['channel'];if(_0x44540f===_0xfaa3('0x18')){_0x5ca0da['ChatWebsiteId']=this[_0xfaa3('0x19')]['id'];}else{_0x5ca0da[_[_0xfaa3('0x1a')](_0x44540f)+_0xfaa3('0x1b')]=this[_0xfaa3('0x19')]['id'];}_0x5ca0da[_[_0xfaa3('0x1a')](_0x44540f)+_0xfaa3('0x1c')]=this['interaction']['id'];if(this['interaction'][_0xfaa3('0x1d')]){var _0xe1a082=_0x352958[0x2];if(!_[_0xfaa3('0x1e')](_0xe1a082)){_0x5ca0da[_0xfaa3('0x1f')]=utils['getMustacheRender'](_0xe1a082,this);return rpc[_0x44540f+'Message']['create'](_0x5ca0da)['then'](function(_0x499148){logger[_0xfaa3('0x20')]('[%s][DIALOGFLOW]\x20%s',_0xeecce5,_0x5ca0da[_0xfaa3('0x1f')]);})[_0xfaa3('0x21')](function(_0x38b978){logger[_0xfaa3('0x22')](_0xfaa3('0xe'),_0xeecce5,JSON[_0xfaa3('0x23')](_0x38b978));})[_0xfaa3('0x24')](function(){logger[_0xfaa3('0x20')](_0xfaa3('0x25'),_0xeecce5);_0xbf270c[_0xfaa3('0x26')]();});}else{logger['info'](_0xfaa3('0x27'),_0xeecce5);_0xbf270c[_0xfaa3('0x26')]();}}else{var _0x26d9ef=this;var _0x42b214=apiai(_0x352958[0x0],{'language':_0x352958[0x1]||'en'});return _0x42b214['textRequest'](this[_0xfaa3('0x28')][_0xfaa3('0x1f')],{'sessionId':md5(this[_0xfaa3('0xc')]['id'])})[_0xfaa3('0x29')](function(_0x16a3e3){_0x26d9ef[_0xfaa3('0x1f')][_0xfaa3('0x2a')]=_0x16a3e3;_0x5ca0da[_0xfaa3('0x1f')]=_0x16a3e3['result'][_0xfaa3('0x2b')][_0xfaa3('0x2c')];_0x5ca0da[_0xfaa3('0x2d')]=_0xfaa3('0x2a');_0x5ca0da[_0xfaa3('0x2e')]=JSON[_0xfaa3('0x23')](_0x16a3e3);return rpc[_0x44540f+_0xfaa3('0x2f')][_0xfaa3('0x30')](_0x5ca0da)[_0xfaa3('0x29')](function(_0x19d319){logger[_0xfaa3('0x20')](_0xfaa3('0xe'),_0xeecce5,_0x5ca0da[_0xfaa3('0x1f')]);if(_0x16a3e3[_0xfaa3('0x31')][_0xfaa3('0x32')]['endConversation']){_0xbf270c[_0xfaa3('0x33')]();}else{_0xbf270c[_0xfaa3('0x26')]();}})[_0xfaa3('0x21')](function(_0x54bc09){logger[_0xfaa3('0x22')]('[%s][DIALOGFLOW]\x20%s',_0xeecce5,JSON[_0xfaa3('0x23')](_0x54bc09));_0xbf270c['next']();});})[_0xfaa3('0x21')](function(_0x1ece24){logger[_0xfaa3('0x22')](_0xfaa3('0xe'),_0xeecce5,_0x1ece24[_0xfaa3('0x28')]);_0xbf270c[_0xfaa3('0x33')]();});}}catch(_0x101772){logger[_0xfaa3('0x22')]('[%s][DIALOGFLOW]\x20%s',_0xeecce5,JSON[_0xfaa3('0x23')](_0x101772));_0xbf270c[_0xfaa3('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 5048762..2ba2526 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56ea=['stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','diagnosticInfo','queryResult','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','end_conversation','name','intent','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','push','fulfillmentText','lodash','dialogflow','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','catch','stringify','isNil','interaction','UserId','[%s][DIALOGFLOWV2]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x56ea,0x12b));var _0xa56e=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0x56ea[_0x5c18ef];return _0x33789d;};'use strict';var _=require(_0xa56e('0x0'));var dialogflow=require(_0xa56e('0x1'));var md5=require(_0xa56e('0x2'));var moment=require('moment');var Promise=require(_0xa56e('0x3'));var logger=require(_0xa56e('0x4'))(_0xa56e('0x5'));var utils=require(_0xa56e('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa56e('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa56e('0x8')),'whatsappMessage':require(_0xa56e('0x9'))};function createMessage(_0xb28304,_0x599e70,_0x1e2b3f,_0x4a2305){return new Promise(function(_0x1ec089,_0x52ef76){var _0x247d92=_[_0xa56e('0xa')](_0x1e2b3f);_0x247d92[_0xa56e('0xb')]=_0x4a2305;return rpc[_0x599e70+_0xa56e('0xc')][_0xa56e('0xd')](_0x247d92)[_0xa56e('0xe')](function(){logger[_0xa56e('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0xb28304,_0x247d92[_0xa56e('0xb')]);_0x1ec089();})[_0xa56e('0x10')](function(_0x48eca9){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0xb28304,JSON[_0xa56e('0x11')](_0x48eca9));_0x52ef76(_0x48eca9);});});}exports['consequence']=function(_0x15415d,_0x2adf4b){return function(_0x3fdbd7){try{if(!_[_0xa56e('0x12')](this[_0xa56e('0x13')][_0xa56e('0x14')])){logger[_0xa56e('0xf')](_0xa56e('0x15'),_0x15415d,_0xa56e('0x16'));return _0x3fdbd7[_0xa56e('0x17')]();}var _0x28346b={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xa56e('0x18')),'direction':_0xa56e('0x19')};if(this['channel']===_0xa56e('0x1a')||this[_0xa56e('0x1b')]===_0xa56e('0x1c')){_0x28346b[_0xa56e('0x1d')]=this[_0xa56e('0x13')][_0xa56e('0x1d')];}var _0x409cc7=this['channel'];if(_0x409cc7===_0xa56e('0x1e')){_0x28346b[_0xa56e('0x1f')]=this[_0xa56e('0x20')]['id'];}else{_0x28346b[_[_0xa56e('0x21')](_0x409cc7)+_0xa56e('0x22')]=this['account']['id'];}_0x28346b[_['upperFirst'](_0x409cc7)+_0xa56e('0x23')]=this['interaction']['id'];if(this[_0xa56e('0x13')][_0xa56e('0x24')]){var _0x23bb13=_0x2adf4b[0x4];if(!_[_0xa56e('0x25')](_0x23bb13)){_0x28346b[_0xa56e('0xb')]=utils[_0xa56e('0x26')](_0x23bb13,this);return rpc[_0x409cc7+_0xa56e('0xc')][_0xa56e('0xd')](_0x28346b)['then'](function(_0x353bd){logger[_0xa56e('0xf')](_0xa56e('0x15'),_0x15415d,_0x28346b[_0xa56e('0xb')]);})[_0xa56e('0x10')](function(_0xfbc1d5){logger[_0xa56e('0x27')](_0xa56e('0x15'),_0x15415d,JSON[_0xa56e('0x11')](_0xfbc1d5));})['finally'](function(){logger['info'](_0xa56e('0x28'),_0x15415d);_0x3fdbd7[_0xa56e('0x29')]();});}else{logger[_0xa56e('0xf')](_0xa56e('0x2a'),_0x15415d);_0x3fdbd7[_0xa56e('0x29')]();}}else{var _0x538d8f=this;var _0x1de48a=_0x2adf4b[0x2]['replace'](/\\n/g,'\x0a');var _0x375393={'credentials':{'private_key':_0x1de48a,'client_email':_0x2adf4b[0x1]}};var _0x3e502e=new dialogflow[(_0xa56e('0x2b'))](_0x375393);var _0x5cd9ee=_0x3e502e[_0xa56e('0x2c')](_0x2adf4b[0x0],md5(_0x538d8f[_0xa56e('0x13')]['id']));var _0x3b4f61={'session':_0x5cd9ee,'queryInput':{'text':{'text':_0x538d8f[_0xa56e('0x2d')][_0xa56e('0xb')],'languageCode':_0x2adf4b[0x3]||'en'}}};return _0x3e502e[_0xa56e('0x2e')](_0x3b4f61)[_0xa56e('0xe')](function(_0x4587bc){if(_0x4587bc&&_0x4587bc[_0xa56e('0x2f')]){_0x538d8f[_0xa56e('0xb')]['dialogflowV2']=_0x4587bc;var _0x51abcd=_0x4587bc[0x0];var _0x5e4a00=_0x51abcd['queryResult'][_0xa56e('0x30')]&&_0x51abcd[_0xa56e('0x31')][_0xa56e('0x30')][_0xa56e('0x32')]?_0x51abcd[_0xa56e('0x31')]['diagnosticInfo']['fields']['end_conversation'][_0xa56e('0x33')]:![];_0x538d8f[_0xa56e('0xb')][_0xa56e('0x34')]=_0x51abcd[_0xa56e('0x31')]['action'];_0x538d8f[_0xa56e('0xb')][_0xa56e('0x35')]=_0x51abcd[_0xa56e('0x31')][_0xa56e('0x36')];_0x538d8f['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x51abcd[_0xa56e('0x31')][_0xa56e('0x30')]&&_0x51abcd[_0xa56e('0x31')][_0xa56e('0x30')][_0xa56e('0x32')]?_0x51abcd[_0xa56e('0x31')][_0xa56e('0x30')][_0xa56e('0x32')][_0xa56e('0x37')][_0xa56e('0x33')]:![];_0x538d8f[_0xa56e('0xb')]['DIALOGFLOWV2_INTENTNAME']=_0x51abcd[_0xa56e('0x31')]['intent'][_0xa56e('0x38')];_0x538d8f[_0xa56e('0xb')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x51abcd['queryResult'][_0xa56e('0x39')]['displayName'];_0x538d8f['body'][_0xa56e('0x3a')]=_0x51abcd[_0xa56e('0x31')][_0xa56e('0x39')][_0xa56e('0x3b')];_0x538d8f[_0xa56e('0xb')][_0xa56e('0x3c')]=_0x51abcd[_0xa56e('0x31')]['languageCode'];_0x538d8f[_0xa56e('0xb')]['DIALOGFLOWV2_QUERYTEXT']=_0x51abcd[_0xa56e('0x31')]['queryText'];_0x538d8f[_0xa56e('0xb')][_0xa56e('0x3d')]=_0x51abcd[_0xa56e('0x31')][_0xa56e('0x3e')];_0x28346b[_0xa56e('0x3f')]=_0xa56e('0x40');_0x28346b[_0xa56e('0x41')]=JSON[_0xa56e('0x11')](_0x4587bc);var _0x40857d=[];for(var _0x48826c=0x0;_0x48826c<_0x4587bc[_0xa56e('0x2f')];_0x48826c++){var _0x7a43d9=_0x4587bc[_0x48826c];if(_0x7a43d9&&_0x7a43d9[_0xa56e('0x31')]&&_0x7a43d9[_0xa56e('0x31')]['fulfillmentText']){_0x40857d[_0xa56e('0x42')](createMessage(_0x15415d,_0x409cc7,_0x28346b,_0x7a43d9['queryResult'][_0xa56e('0x43')]));}}return Promise['all'](_0x40857d)['then'](function(){if(_0x5e4a00){_0x3fdbd7[_0xa56e('0x17')]();}else{_0x3fdbd7['stop']();}})['catch'](function(_0x16bf74){logger[_0xa56e('0x27')](_0xa56e('0x15'),_0x15415d,JSON['stringify'](_0x16bf74));_0x3fdbd7[_0xa56e('0x17')]();});}})['catch'](function(_0x539c32){logger[_0xa56e('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x15415d,_0x539c32[_0xa56e('0x2d')]);_0x3fdbd7[_0xa56e('0x17')]();});}}catch(_0x470778){logger['error'](_0xa56e('0x15'),_0x15415d,JSON['stringify'](_0x470778));_0x3fdbd7[_0xa56e('0x29')]();}};}; \ No newline at end of file +var _0xcb88=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','interaction','account','upperFirst','AccountId','InteractionId','getMustacheRender','body','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','message','lodash','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId'];(function(_0x2af29a,_0x4f44bc){var _0x5ef02f=function(_0x4349ef){while(--_0x4349ef){_0x2af29a['push'](_0x2af29a['shift']());}};_0x5ef02f(++_0x4f44bc);}(_0xcb88,0x14c));var _0x8cb8=function(_0x1a6363,_0x5ee759){_0x1a6363=_0x1a6363-0x0;var _0x45ad68=_0xcb88[_0x1a6363];return _0x45ad68;};'use strict';var _=require(_0x8cb8('0x0'));var dialogflow=require(_0x8cb8('0x1'));var md5=require(_0x8cb8('0x2'));var moment=require(_0x8cb8('0x3'));var Promise=require(_0x8cb8('0x4'));var logger=require('../../../../config/logger')(_0x8cb8('0x5'));var utils=require(_0x8cb8('0x6'));var rpc={'chatMessage':require(_0x8cb8('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8cb8('0x8')),'faxMessage':require(_0x8cb8('0x9')),'whatsappMessage':require(_0x8cb8('0xa'))};function createMessage(_0x2a40d8,_0x4035f1,_0x3eeb7b,_0x10c188){return new Promise(function(_0x47a661,_0xa9fa){var _0x492157=_[_0x8cb8('0xb')](_0x3eeb7b);_0x492157['body']=_0x10c188;return rpc[_0x4035f1+_0x8cb8('0xc')][_0x8cb8('0xd')](_0x492157)[_0x8cb8('0xe')](function(){logger[_0x8cb8('0xf')](_0x8cb8('0x10'),_0x2a40d8,_0x492157['body']);_0x47a661();})[_0x8cb8('0x11')](function(_0xcc21ec){logger[_0x8cb8('0x12')](_0x8cb8('0x10'),_0x2a40d8,JSON[_0x8cb8('0x13')](_0xcc21ec));_0xa9fa(_0xcc21ec);});});}exports[_0x8cb8('0x14')]=function(_0x3e20ec,_0x35c0b1){return function(_0x2fb616){try{if(!_[_0x8cb8('0x15')](this['interaction'][_0x8cb8('0x16')])){logger['info'](_0x8cb8('0x10'),_0x3e20ec,_0x8cb8('0x17'));return _0x2fb616[_0x8cb8('0x18')]();}var _0x3e90c7={'ContactId':this[_0x8cb8('0x19')]['id'],'sentAt':moment()[_0x8cb8('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x8cb8('0x1b')};if(this[_0x8cb8('0x1c')]===_0x8cb8('0x1d')||this[_0x8cb8('0x1c')]===_0x8cb8('0x1e')){_0x3e90c7[_0x8cb8('0x1f')]=this[_0x8cb8('0x20')][_0x8cb8('0x1f')];}var _0x570d08=this[_0x8cb8('0x1c')];if(_0x570d08==='chat'){_0x3e90c7['ChatWebsiteId']=this[_0x8cb8('0x21')]['id'];}else{_0x3e90c7[_[_0x8cb8('0x22')](_0x570d08)+_0x8cb8('0x23')]=this[_0x8cb8('0x21')]['id'];}_0x3e90c7[_[_0x8cb8('0x22')](_0x570d08)+_0x8cb8('0x24')]=this['interaction']['id'];if(this[_0x8cb8('0x20')]['created']){var _0x5058ff=_0x35c0b1[0x4];if(!_['isEmpty'](_0x5058ff)){_0x3e90c7['body']=utils[_0x8cb8('0x25')](_0x5058ff,this);return rpc[_0x570d08+_0x8cb8('0xc')][_0x8cb8('0xd')](_0x3e90c7)[_0x8cb8('0xe')](function(_0x9c2f59){logger[_0x8cb8('0xf')](_0x8cb8('0x10'),_0x3e20ec,_0x3e90c7[_0x8cb8('0x26')]);})[_0x8cb8('0x11')](function(_0x3090e5){logger[_0x8cb8('0x12')](_0x8cb8('0x10'),_0x3e20ec,JSON[_0x8cb8('0x13')](_0x3090e5));})[_0x8cb8('0x27')](function(){logger[_0x8cb8('0xf')](_0x8cb8('0x28'),_0x3e20ec);_0x2fb616[_0x8cb8('0x29')]();});}else{logger[_0x8cb8('0xf')](_0x8cb8('0x2a'),_0x3e20ec);_0x2fb616[_0x8cb8('0x29')]();}}else{var _0x3a0822=this;var _0x447a09=_0x35c0b1[0x2]['replace'](/\\n/g,'\x0a');var _0x367ca2={'credentials':{'private_key':_0x447a09,'client_email':_0x35c0b1[0x1]}};var _0x309b77=new dialogflow[(_0x8cb8('0x2b'))](_0x367ca2);var _0x39c503=_0x309b77[_0x8cb8('0x2c')](_0x35c0b1[0x0],md5(_0x3a0822[_0x8cb8('0x20')]['id']));var _0x17502a={'session':_0x39c503,'queryInput':{'text':{'text':_0x3a0822['message'][_0x8cb8('0x26')],'languageCode':_0x35c0b1[0x3]||'en'}}};return _0x309b77[_0x8cb8('0x2d')](_0x17502a)[_0x8cb8('0xe')](function(_0x85b4e3){if(_0x85b4e3&&_0x85b4e3[_0x8cb8('0x2e')]){_0x3a0822[_0x8cb8('0x26')]['dialogflowV2']=_0x85b4e3;var _0x16fe3b=_0x85b4e3[0x0];var _0x55f13c=_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x30')]&&_0x16fe3b['queryResult']['diagnosticInfo'][_0x8cb8('0x31')]?_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x30')]['fields'][_0x8cb8('0x32')][_0x8cb8('0x33')]:![];_0x3a0822['body']['DIALOGFLOWV2_ACTION']=_0x16fe3b['queryResult'][_0x8cb8('0x34')];_0x3a0822['body'][_0x8cb8('0x35')]=_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x36')];_0x3a0822['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x30')]&&_0x16fe3b['queryResult'][_0x8cb8('0x30')][_0x8cb8('0x31')]?_0x16fe3b['queryResult'][_0x8cb8('0x30')][_0x8cb8('0x31')][_0x8cb8('0x32')][_0x8cb8('0x33')]:![];_0x3a0822['body'][_0x8cb8('0x37')]=_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x38')][_0x8cb8('0x39')];_0x3a0822['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x16fe3b['queryResult'][_0x8cb8('0x38')]['displayName'];_0x3a0822['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x16fe3b[_0x8cb8('0x2f')]['intent']['isFallback'];_0x3a0822['body'][_0x8cb8('0x3a')]=_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x3b')];_0x3a0822[_0x8cb8('0x26')][_0x8cb8('0x3c')]=_0x16fe3b['queryResult'][_0x8cb8('0x3d')];_0x3a0822[_0x8cb8('0x26')][_0x8cb8('0x3e')]=_0x16fe3b[_0x8cb8('0x2f')][_0x8cb8('0x3f')];_0x3e90c7[_0x8cb8('0x40')]=_0x8cb8('0x41');_0x3e90c7[_0x8cb8('0x42')]=JSON[_0x8cb8('0x13')](_0x85b4e3);var _0x2d164c=[];for(var _0x424b0f=0x0;_0x424b0f<_0x85b4e3[_0x8cb8('0x2e')];_0x424b0f++){var _0xf6403a=_0x85b4e3[_0x424b0f];if(_0xf6403a&&_0xf6403a[_0x8cb8('0x2f')]&&_0xf6403a[_0x8cb8('0x2f')][_0x8cb8('0x43')]){_0x2d164c[_0x8cb8('0x44')](createMessage(_0x3e20ec,_0x570d08,_0x3e90c7,_0xf6403a[_0x8cb8('0x2f')][_0x8cb8('0x43')]));}}return Promise[_0x8cb8('0x45')](_0x2d164c)[_0x8cb8('0xe')](function(){if(_0x55f13c){_0x2fb616['next']();}else{_0x2fb616[_0x8cb8('0x29')]();}})[_0x8cb8('0x11')](function(_0x12115c){logger[_0x8cb8('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x3e20ec,JSON[_0x8cb8('0x13')](_0x12115c));_0x2fb616['next']();});}})[_0x8cb8('0x11')](function(_0x2c27ca){logger[_0x8cb8('0x12')](_0x8cb8('0x10'),_0x3e20ec,_0x2c27ca[_0x8cb8('0x46')]);_0x2fb616['next']();});}}catch(_0xe99f7d){logger[_0x8cb8('0x12')](_0x8cb8('0x10'),_0x3e20ec,JSON['stringify'](_0xe99f7d));_0x2fb616[_0x8cb8('0x29')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 019a3f2..c4232a9 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5888=['priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition'];(function(_0x4fc3e0,_0x89cefa){var _0x1e361b=function(_0x44e950){while(--_0x44e950){_0x4fc3e0['push'](_0x4fc3e0['shift']());}};_0x1e361b(++_0x89cefa);}(_0x5888,0x118));var _0x8588=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x5888[_0x68c979];return _0x4f0001;};'use strict';var schema=require(_0x8588('0x0'));var _=require(_0x8588('0x1'));var htmlToText=require(_0x8588('0x2'));var utils=require(_0x8588('0x3'));var logger=require(_0x8588('0x4'))(_0x8588('0x5'));var gotoif=schema({'condition':{'type':_0x8588('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x8588('0x7')},'priorityFalse':{'type':_0x8588('0x8'),'message':_0x8588('0x9')}});exports[_0x8588('0xa')]=function(_0x566082,_0x4993ba){return function(_0x154c38){try{var _0xea8746={'condition':htmlToText[_0x8588('0xb')](utils['getMustacheRender'](_0x4993ba[0x0],this),{'wordwrap':![]})[_0x8588('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4993ba[0x1],'priorityFalse':_0x4993ba[0x2]};var _0x2b42f8=gotoif[_0x8588('0x0')](_0xea8746,{'typecast':!![]});if(_0x2b42f8[_0x8588('0xd')]){logger[_0x8588('0xe')](_0x8588('0xf'),_0x566082,_[_0x8588('0x10')](_0x2b42f8,_0x8588('0x11'))['join'](',\x20'));_0x154c38[_0x8588('0x12')]();}else{try{var _0x30a841=eval('('+_0xea8746[_0x8588('0x13')]+')');var _0x131f03=_0x30a841?_0xea8746[_0x8588('0x14')]:_0xea8746[_0x8588('0x15')];logger[_0x8588('0x16')](_0x8588('0x17'),_0x566082,_0xea8746[_0x8588('0x13')],_0x30a841,_0x131f03||'next');if(_0x131f03){var _0x63d825=_['findIndex'](_0x154c38[_0x8588('0x18')](),{'p':_0x131f03});if(_0x63d825>=0x0){logger[_0x8588('0x16')](_0x8588('0x19'),_0x566082,_0x131f03||_0x8588('0x1a'),_0x63d825);_0x154c38[_0x8588('0x1a')](_0x63d825);}else{logger[_0x8588('0x16')](_0x8588('0x1b'),_0x566082,_0x131f03||'next');_0x154c38[_0x8588('0x12')]();}}else{_0x154c38[_0x8588('0x1a')]();}}catch(_0x3eb5e0){logger[_0x8588('0xe')](_0x8588('0x1c'),_0x566082,_0x3eb5e0[_0x8588('0x11')]);_0x154c38[_0x8588('0x12')]();}}}catch(_0x16204e){logger['error'](_0x8588('0xf'),_0x566082,JSON[_0x8588('0x1d')](_0x16204e));_0x154c38[_0x8588('0x12')]();}};}; \ No newline at end of file +var _0xae8c=['routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger'];(function(_0x39e02a,_0x1183e6){var _0x4b0313=function(_0x516049){while(--_0x516049){_0x39e02a['push'](_0x39e02a['shift']());}};_0x4b0313(++_0x1183e6);}(_0xae8c,0x19f));var _0xcae8=function(_0x399194,_0x57df7b){_0x399194=_0x399194-0x0;var _0x8384ee=_0xae8c[_0x399194];return _0x8384ee;};'use strict';var schema=require(_0xcae8('0x0'));var _=require(_0xcae8('0x1'));var htmlToText=require(_0xcae8('0x2'));var utils=require(_0xcae8('0x3'));var logger=require(_0xcae8('0x4'))(_0xcae8('0x5'));var gotoif=schema({'condition':{'type':_0xcae8('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xcae8('0x7'),'message':_0xcae8('0x8')},'priorityFalse':{'type':_0xcae8('0x7'),'message':_0xcae8('0x9')}});exports[_0xcae8('0xa')]=function(_0x4fbdf9,_0xe5a2c5){return function(_0x238222){try{var _0x5f46be={'condition':htmlToText[_0xcae8('0xb')](utils[_0xcae8('0xc')](_0xe5a2c5[0x0],this),{'wordwrap':![]})[_0xcae8('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xe5a2c5[0x1],'priorityFalse':_0xe5a2c5[0x2]};var _0x376b2a=gotoif[_0xcae8('0x0')](_0x5f46be,{'typecast':!![]});if(_0x376b2a['length']){logger[_0xcae8('0xe')](_0xcae8('0xf'),_0x4fbdf9,_[_0xcae8('0x10')](_0x376b2a,_0xcae8('0x11'))['join'](',\x20'));_0x238222[_0xcae8('0x12')]();}else{try{var _0x935ed2=eval('('+_0x5f46be['condition']+')');var _0x170be0=_0x935ed2?_0x5f46be[_0xcae8('0x13')]:_0x5f46be[_0xcae8('0x14')];logger[_0xcae8('0x15')](_0xcae8('0x16'),_0x4fbdf9,_0x5f46be['condition'],_0x935ed2,_0x170be0||_0xcae8('0x17'));if(_0x170be0){var _0x2dc73a=_[_0xcae8('0x18')](_0x238222[_0xcae8('0x19')](),{'p':_0x170be0});if(_0x2dc73a>=0x0){logger[_0xcae8('0x15')](_0xcae8('0x1a'),_0x4fbdf9,_0x170be0||'next',_0x2dc73a);_0x238222[_0xcae8('0x17')](_0x2dc73a);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4fbdf9,_0x170be0||_0xcae8('0x17'));_0x238222[_0xcae8('0x12')]();}}else{_0x238222[_0xcae8('0x17')]();}}catch(_0x49f238){logger[_0xcae8('0xe')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4fbdf9,_0x49f238[_0xcae8('0x11')]);_0x238222[_0xcae8('0x12')]();}}}catch(_0x4c8fb9){logger[_0xcae8('0xe')](_0xcae8('0xf'),_0x4fbdf9,JSON[_0xcae8('0x1b')](_0x4c8fb9));_0x238222[_0xcae8('0x12')]();}};}; \ 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 c6e5ccb..1a5328b 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 _0x9d9e=['consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'];(function(_0xf2faa3,_0x4a77a7){var _0x34b2fe=function(_0x5c716a){while(--_0x5c716a){_0xf2faa3['push'](_0xf2faa3['shift']());}};_0x34b2fe(++_0x4a77a7);}(_0x9d9e,0xe2));var _0xe9d9=function(_0x99facc,_0x548cd6){_0x99facc=_0x99facc-0x0;var _0xd39ed0=_0x9d9e[_0x99facc];return _0xd39ed0;};'use strict';var schema=require(_0xe9d9('0x0'));var _=require('lodash');var logger=require(_0xe9d9('0x1'))(_0xe9d9('0x2'));var gotop=schema({'priority':{'type':_0xe9d9('0x3'),'required':!![],'message':_0xe9d9('0x4')}});exports[_0xe9d9('0x5')]=function(_0x4894d3,_0x24793b){return function(_0x1b5f8d){try{var _0x37e3dd={'priority':_0x24793b[0x0]};var _0x358970=gotop[_0xe9d9('0x0')](_0x37e3dd,{'typecast':!![]});if(_0x358970[_0xe9d9('0x6')]){logger[_0xe9d9('0x7')](_0xe9d9('0x8'),_0x4894d3,_['map'](_0x358970,_0xe9d9('0x9'))[_0xe9d9('0xa')](',\x20'));_0x1b5f8d[_0xe9d9('0xb')]();}else{logger[_0xe9d9('0xc')](_0xe9d9('0xd'),_0x4894d3,_0x37e3dd[_0xe9d9('0xe')]);if(_0x37e3dd[_0xe9d9('0xe')]){var _0xa254d2=_[_0xe9d9('0xf')](_0x1b5f8d[_0xe9d9('0x10')](),{'p':_0x37e3dd[_0xe9d9('0xe')]});if(_0xa254d2>=0x0){logger[_0xe9d9('0xc')](_0xe9d9('0x11'),_0x4894d3,_0x37e3dd[_0xe9d9('0xe')]||'next',_0xa254d2);_0x1b5f8d['next'](_0xa254d2);}else{logger[_0xe9d9('0xc')](_0xe9d9('0x12'),_0x4894d3,_0x37e3dd[_0xe9d9('0xe')]||'next');_0x1b5f8d['stop']();}}else{_0x1b5f8d[_0xe9d9('0x13')]();}}}catch(_0x1f2bd6){logger['error'](_0xe9d9('0x8'),_0x4894d3,JSON[_0xe9d9('0x14')](_0x1f2bd6));_0x1b5f8d[_0xe9d9('0xb')]();}};}; \ No newline at end of file +var _0x6621=['info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','message','join'];(function(_0x222282,_0x35906f){var _0x51365e=function(_0x5ab778){while(--_0x5ab778){_0x222282['push'](_0x222282['shift']());}};_0x51365e(++_0x35906f);}(_0x6621,0x104));var _0x1662=function(_0x5a5cd0,_0x4f9b44){_0x5a5cd0=_0x5a5cd0-0x0;var _0x52d6a7=_0x6621[_0x5a5cd0];return _0x52d6a7;};'use strict';var schema=require(_0x1662('0x0'));var _=require(_0x1662('0x1'));var logger=require('../../../../config/logger')(_0x1662('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x1662('0x3')}});exports[_0x1662('0x4')]=function(_0x2e12e8,_0x1f5c4f){return function(_0x46f5d7){try{var _0x4a977e={'priority':_0x1f5c4f[0x0]};var _0x1310bc=gotop[_0x1662('0x0')](_0x4a977e,{'typecast':!![]});if(_0x1310bc['length']){logger[_0x1662('0x5')](_0x1662('0x6'),_0x2e12e8,_[_0x1662('0x7')](_0x1310bc,_0x1662('0x8'))[_0x1662('0x9')](',\x20'));_0x46f5d7['stop']();}else{logger[_0x1662('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x2e12e8,_0x4a977e[_0x1662('0xb')]);if(_0x4a977e[_0x1662('0xb')]){var _0x258075=_['findIndex'](_0x46f5d7[_0x1662('0xc')](),{'p':_0x4a977e[_0x1662('0xb')]});if(_0x258075>=0x0){logger[_0x1662('0xa')](_0x1662('0xd'),_0x2e12e8,_0x4a977e['priority']||_0x1662('0xe'),_0x258075);_0x46f5d7['next'](_0x258075);}else{logger['info'](_0x1662('0xf'),_0x2e12e8,_0x4a977e[_0x1662('0xb')]||_0x1662('0xe'));_0x46f5d7[_0x1662('0x10')]();}}else{_0x46f5d7[_0x1662('0xe')]();}}}catch(_0xc4df18){logger['error'](_0x1662('0x6'),_0x2e12e8,JSON[_0x1662('0x11')](_0xc4df18));_0x46f5d7[_0x1662('0x10')]();}};}; \ 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 3d3cf9d..19b92f5 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 _0xfe36=['contact','channel','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','error','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x1bcf97,_0x293ab9){var _0x4d5f2a=function(_0xa50555){while(--_0xa50555){_0x1bcf97['push'](_0x1bcf97['shift']());}};_0x4d5f2a(++_0x293ab9);}(_0xfe36,0x1b6));var _0x6fe3=function(_0x4261e7,_0x12b849){_0x4261e7=_0x4261e7-0x0;var _0x4f2573=_0xfe36[_0x4261e7];return _0x4f2573;};'use strict';var _=require(_0x6fe3('0x0'));var utils=require(_0x6fe3('0x1'));var logger=require('../../../../config/logger')(_0x6fe3('0x2'));var rpc={'chatMessage':require(_0x6fe3('0x3')),'openchannelMessage':require(_0x6fe3('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6fe3('0x5')),'faxMessage':require(_0x6fe3('0x6')),'whatsappMessage':require(_0x6fe3('0x7'))};exports[_0x6fe3('0x8')]=function(_0x2c2024,_0x3a9e88){return function(_0x540c17){try{var _0x5ef797={'body':utils[_0x6fe3('0x9')](_0x3a9e88[0x0],this),'ContactId':this[_0x6fe3('0xa')]['id']};if(this[_0x6fe3('0xb')]==='chat'){_0x5ef797[_0x6fe3('0xc')]=this[_0x6fe3('0xd')]['id'];}else{_0x5ef797[_['upperFirst'](this[_0x6fe3('0xb')])+_0x6fe3('0xe')]=this[_0x6fe3('0xd')]['id'];}_0x5ef797[_[_0x6fe3('0xf')](this[_0x6fe3('0xb')])+_0x6fe3('0x10')]=this[_0x6fe3('0x11')]['id'];if(rpc[this['channel']+_0x6fe3('0x12')]){return rpc[this[_0x6fe3('0xb')]+_0x6fe3('0x12')][_0x6fe3('0x13')](_0x5ef797)[_0x6fe3('0x14')](function(_0x101a67){logger[_0x6fe3('0x15')](_0x6fe3('0x16'),_0x2c2024,_0x5ef797[_0x6fe3('0x17')]);_0x540c17[_0x6fe3('0x18')]();})[_0x6fe3('0x19')](function(_0x4632bf){logger['error']('[%s][MESSAGE]\x20%s',_0x2c2024,JSON[_0x6fe3('0x1a')](_0x4632bf));_0x540c17['stop']();});}}catch(_0x393f54){logger[_0x6fe3('0x1b')](_0x6fe3('0x16'),_0x2c2024,JSON[_0x6fe3('0x1a')](_0x393f54));_0x540c17['stop']();}};}; \ No newline at end of file +var _0x8093=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','error','stop','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x1249a0,_0x1053a4){var _0x16f478=function(_0xe80661){while(--_0xe80661){_0x1249a0['push'](_0x1249a0['shift']());}};_0x16f478(++_0x1053a4);}(_0x8093,0xa9));var _0x3809=function(_0x34620e,_0x582015){_0x34620e=_0x34620e-0x0;var _0x3d33cd=_0x8093[_0x34620e];return _0x3d33cd;};'use strict';var _=require(_0x3809('0x0'));var utils=require(_0x3809('0x1'));var logger=require(_0x3809('0x2'))(_0x3809('0x3'));var rpc={'chatMessage':require(_0x3809('0x4')),'openchannelMessage':require(_0x3809('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3809('0x6')),'faxMessage':require(_0x3809('0x7')),'whatsappMessage':require(_0x3809('0x8'))};exports[_0x3809('0x9')]=function(_0x349776,_0x17ab0b){return function(_0x29d5dc){try{var _0x195cc8={'body':utils[_0x3809('0xa')](_0x17ab0b[0x0],this),'ContactId':this[_0x3809('0xb')]['id']};if(this[_0x3809('0xc')]===_0x3809('0xd')){_0x195cc8['ChatWebsiteId']=this[_0x3809('0xe')]['id'];}else{_0x195cc8[_[_0x3809('0xf')](this[_0x3809('0xc')])+_0x3809('0x10')]=this['account']['id'];}_0x195cc8[_['upperFirst'](this[_0x3809('0xc')])+'InteractionId']=this[_0x3809('0x11')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x3809('0xc')]+_0x3809('0x12')][_0x3809('0x13')](_0x195cc8)['then'](function(_0x334061){logger[_0x3809('0x14')](_0x3809('0x15'),_0x349776,_0x195cc8['body']);_0x29d5dc['next']();})['catch'](function(_0x2018ab){logger[_0x3809('0x16')](_0x3809('0x15'),_0x349776,JSON['stringify'](_0x2018ab));_0x29d5dc[_0x3809('0x17')]();});}}catch(_0x545a71){logger[_0x3809('0x16')](_0x3809('0x15'),_0x349776,JSON[_0x3809('0x18')](_0x545a71));_0x29d5dc[_0x3809('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 8b29fdc..1f6cf07 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 _0x488f=['getMustacheRender','next','error','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x4bbd85,_0x6c7abf){var _0x338869=function(_0x54dfa8){while(--_0x54dfa8){_0x4bbd85['push'](_0x4bbd85['shift']());}};_0x338869(++_0x6c7abf);}(_0x488f,0xe5));var _0xf488=function(_0x4a71d5,_0x370787){_0x4a71d5=_0x4a71d5-0x0;var _0x14b3e2=_0x488f[_0x4a71d5];return _0x14b3e2;};'use strict';var utils=require('./utils');var logger=require(_0xf488('0x0'))(_0xf488('0x1'));exports[_0xf488('0x2')]=function(_0x141b08,_0x41cd45){return function(_0x524a06){try{logger[_0xf488('0x3')](_0xf488('0x4'),_0x141b08,utils[_0xf488('0x5')](_0x41cd45[0x0],this));_0x524a06[_0xf488('0x6')]();}catch(_0x3880bc){logger[_0xf488('0x7')](_0xf488('0x4'),_0x141b08,JSON['stringify'](_0x3880bc));_0x524a06[_0xf488('0x8')]();}};}; \ No newline at end of file +var _0x26c5=['error','stringify','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x26c5,0xc8));var _0x526c=function(_0x2ae488,_0x316e37){_0x2ae488=_0x2ae488-0x0;var _0x548a1f=_0x26c5[_0x2ae488];return _0x548a1f;};'use strict';var utils=require(_0x526c('0x0'));var logger=require(_0x526c('0x1'))(_0x526c('0x2'));exports[_0x526c('0x3')]=function(_0x44b801,_0x53fb2b){return function(_0x3c5458){try{logger[_0x526c('0x4')](_0x526c('0x5'),_0x44b801,utils[_0x526c('0x6')](_0x53fb2b[0x0],this));_0x3c5458['next']();}catch(_0x4130cc){logger[_0x526c('0x7')](_0x526c('0x5'),_0x44b801,JSON[_0x526c('0x8')](_0x4130cc));_0x3c5458['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 2af353a..1eb24ea 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 _0x330c=['update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','stack','lodash','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','pick','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','message','chat','AccountId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','accepted','info'];(function(_0xe4061f,_0x5aaab9){var _0x1843fd=function(_0x9261d4){while(--_0x9261d4){_0xe4061f['push'](_0xe4061f['shift']());}};_0x1843fd(++_0x5aaab9);}(_0x330c,0x14e));var _0xc330=function(_0x4f50a2,_0x539d18){_0x4f50a2=_0x4f50a2-0x0;var _0x3d8af1=_0x330c[_0x4f50a2];return _0x3d8af1;};'use strict';var schema=require('validate');var _=require(_0xc330('0x0'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xc330('0x1'));var Redis=require(_0xc330('0x2'));var config=require(_0xc330('0x3'));var logger=require(_0xc330('0x4'))(_0xc330('0x5'));var strategy=require('./strategy');config[_0xc330('0x6')]=_[_0xc330('0x7')](config[_0xc330('0x6')],{'host':_0xc330('0x8'),'port':0x18eb});var io=require(_0xc330('0x9'))(new Redis(config[_0xc330('0x6')]));var attributes=['id','queue_id',_0xc330('0xa'),_0xc330('0xb'),_0xc330('0xc'),_0xc330('0xd')];function emit(_0x2a3d7b,_0x1de472,_0x1d702b){io['to'](_0x2a3d7b)[_0xc330('0xe')](_0x1de472,_0x1d702b);}function emitChannelQueueInteraction(_0x24ae69,_0x990b40,_0x3200d0,_0x2276e8,_0x227421,_0x503afa,_0xe73058,_0x77554a){var _0x2e5a2f=_[_0xc330('0xf')](_0x3200d0);_0x2e5a2f[_0xc330('0x10')]=_0x77554a;_0x2e5a2f[_0xc330('0xb')]=_0x990b40;_0x2e5a2f['account']=_0x2276e8;_0x2e5a2f['id']=_0x227421;if(_0x503afa){_0xe73058[util[_0xc330('0x11')](_0xc330('0x12'),_0x24ae69)][_0x227421]=_['pick'](_0x2e5a2f,attributes);}else{delete _0xe73058[util[_0xc330('0x11')](_0xc330('0x12'),_0x24ae69)][_0x227421];}emit(util[_0xc330('0x11')](_0xc330('0x13'),_0x24ae69,_0x990b40),util[_0xc330('0x11')]('%s_queue_waiting_interaction:%s',_0x24ae69,_0x503afa?_0xc330('0x14'):_0xc330('0x15')),_[_0xc330('0x16')](_0x2e5a2f,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xc330('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xc330('0x18')),'faxQueueReport':require(_0xc330('0x19')),'whatsappQueueReport':require(_0xc330('0x1a'))};var queue=schema({'name':{'type':_0xc330('0x1b'),'required':!![],'message':_0xc330('0x1c')},'timeout':{'type':_0xc330('0x1d'),'message':_0xc330('0x1e')}});function startRouting(_0x4e237a,_0xfe3066,_0x319e19,_0xcd499f){if(_0x4e237a&&_0xfe3066&&_0x319e19){_0xfe3066['waiting']+=0x1;var _0x2badb1={'uniqueid':_0x4e237a,'from':_0x319e19[_0xc330('0x1f')]?_0x319e19[_0xc330('0x1f')][_0xc330('0xc')]:'','joinAt':moment()[_0xc330('0x11')](_0xc330('0x20')),'ContactId':_0x319e19[_0xc330('0x21')]?_0x319e19[_0xc330('0x21')]['id']:null,'ListId':_0x319e19[_0xc330('0x22')]?_0x319e19['list']['id']:null};_0x2badb1[_['upperFirst'](_0x319e19[_0xc330('0x23')])+_0xc330('0x24')]=_0xfe3066['id']||null;_0x2badb1[_[_0xc330('0x25')](_0x319e19[_0xc330('0x23')])+'InteractionId']=_0x319e19[_0xc330('0x26')]?_0x319e19[_0xc330('0x26')]['id']:null;_0x2badb1[_[_0xc330('0x25')](_0x319e19[_0xc330('0x23')])+'MessageId']=_0x319e19[_0xc330('0x27')]?_0x319e19['message']['id']:null;_0x2badb1[_['upperFirst'](_0x319e19[_0xc330('0x23')])+(_0x319e19['channel']!==_0xc330('0x28')?_0xc330('0x29'):'WebsiteId')]=_0x319e19[_0xc330('0xa')]?_0x319e19[_0xc330('0xa')]['id']:null;logger['info'](util[_0xc330('0x11')](_0xc330('0x2a'),_0x4e237a,_0xfe3066['name']));emitChannelQueueInteraction(_0x319e19[_0xc330('0x23')],_0xfe3066[_0xc330('0x2b')],_0x2badb1,_0x319e19[_0xc330('0xa')][_0xc330('0x2b')],_0x319e19['message']['id'],!![],_0xcd499f,_0xfe3066['id']);if(rpc[_0x319e19[_0xc330('0x23')]+'QueueReport']){return rpc[_0x319e19['channel']+_0xc330('0x2c')]['create'](_0x2badb1)[_0xc330('0x2d')](function(_0x4ebfd5){logger[_0xc330('0x2e')](_0xc330('0x2f'));});}}}function stopRouting(_0x105060,_0x8d74a8,_0x4f50a2,_0x24d40b){if(_0x105060&&_0x8d74a8){_0x8d74a8[_0xc330('0x30')]-=0x1;var _0x4a777b={'leaveAt':moment()[_0xc330('0x11')](_0xc330('0x20')),'acceptAt':moment()[_0xc330('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc330('0x31')};logger[_0xc330('0x32')](util[_0xc330('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x105060,_0x8d74a8['name']));emitChannelQueueInteraction(_0x4f50a2[_0xc330('0x23')],_0x8d74a8['name'],_0x4f50a2['body'],_0x4f50a2[_0xc330('0xa')]['name'],_0x4f50a2[_0xc330('0x27')]['id'],![],_0x24d40b,_0x8d74a8['id']);if(rpc[_0x4f50a2['channel']+_0xc330('0x2c')]){return rpc[_0x4f50a2[_0xc330('0x23')]+'QueueReport'][_0xc330('0x33')](_0x105060,_0x4a777b)[_0xc330('0x2d')](function(_0x51cca1){logger[_0xc330('0x2e')](_0xc330('0x34'));});}}}function endRouting(_0x3b75dd,_0x1050ad,_0x4a7af8,_0x312324){if(_0x3b75dd&&_0x1050ad){_0x1050ad['waiting']-=0x1;var _0x12c3a8={'leaveAt':moment()[_0xc330('0x11')](_0xc330('0x20')),'exitAt':moment()[_0xc330('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc330('0x35')};logger[_0xc330('0x32')](util[_0xc330('0x11')](_0xc330('0x36'),_0x3b75dd,_0x1050ad[_0xc330('0x2b')]));emitChannelQueueInteraction(_0x4a7af8['channel'],_0x1050ad['name'],_0x4a7af8['body'],_0x4a7af8[_0xc330('0xa')]['name'],_0x4a7af8[_0xc330('0x27')]['id'],![],_0x312324);if(rpc[_0x4a7af8[_0xc330('0x23')]+_0xc330('0x2c')]){return rpc[_0x4a7af8['channel']+_0xc330('0x2c')]['update'](_0x3b75dd,_0x12c3a8)[_0xc330('0x2d')](function(_0x466944){logger[_0xc330('0x2e')](_0xc330('0x34'));});}}}function handleFindQueue(_0xf63201){return function(_0xb2a2cb){return _0xb2a2cb['name'][_0xc330('0x37')]()===_0xf63201['toLowerCase']();};}exports[_0xc330('0x38')]=function(_0x37b22d,_0x2dd93c,_0x40ec1e,_0x4d3e39){return function(_0x18ab96){try{var _0x50b9e9={'name':_0x2dd93c[0x0],'timeout':_0x2dd93c[0x1]};var _0x499a12=queue[_0xc330('0x39')](_0x50b9e9,{'typecast':!![]});if(_0x499a12[_0xc330('0x3a')]){logger[_0xc330('0x2e')](_0xc330('0x3b'),_0x37b22d,_[_0xc330('0x3c')](_0x499a12,_0xc330('0x27'))[_0xc330('0x3d')](',\x20'));_0x18ab96[_0xc330('0x3e')]();}else{var _0xd74c4d=_[_0xc330('0x3f')](_0x40ec1e[_0x4d3e39[_0xc330('0x23')]+_0xc330('0x40')],handleFindQueue(_0x50b9e9['name']));if(_0xd74c4d){startRouting(_0x37b22d,_0xd74c4d,_0x4d3e39,_0x40ec1e);var _0x2810c9=(_0xd74c4d[_0xc330('0x35')]||0xa)*0x3e8;var _0x2897f7=(_0x50b9e9[_0xc330('0x35')]||0x14)*0x3e8;var _0x17fd7c,_0x284d9a;if(_0x2810c9>_0x2897f7){_0x2897f7=_0x2810c9;}var _0x1c44e9=seqqueue[_0xc330('0x41')](_0x2810c9);_0x1c44e9['id']=_0x37b22d;_0x1c44e9[_0xc330('0x42')]=_0x2810c9;_0x1c44e9[_0xc330('0x43')]=_0x2897f7;_0x1c44e9[_0xc330('0x23')]=_0x4d3e39[_0xc330('0x23')];_0x40ec1e[_0xc330('0x44')][_0x37b22d]['on'](_0xc330('0x45'),function(){logger[_0xc330('0x32')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x37b22d);stopRouting(_0x37b22d,_0xd74c4d,_0x4d3e39,_0x40ec1e);clearTimeout(_0x17fd7c);_0x17fd7c=undefined;_0x1c44e9[_0xc330('0x46')](!![]);if(_0x40ec1e[_0xc330('0x44')][_0x37b22d]){delete _0x40ec1e[_0xc330('0x44')][_0x37b22d];}_0x18ab96[_0xc330('0x3e')]();});_0x40ec1e[_0xc330('0x44')][_0x37b22d]['on'](_0xc330('0x47'),function(){if(_0x40ec1e['rules'][_0x37b22d]){delete _0x40ec1e[_0xc330('0x44')][_0x37b22d];}});_0x17fd7c=setTimeout(function(){logger[_0xc330('0x32')](_0xc330('0x48'),_0x37b22d);endRouting(_0x37b22d,_0xd74c4d,_0x4d3e39,_0x40ec1e);clearTimeout(_0x17fd7c);_0x1c44e9[_0xc330('0x46')](!![]);_0x18ab96[_0xc330('0x49')]();},_0x2897f7);switch(_0xd74c4d['strategy']){case'rrmemory':strategy[_0xc330('0x4a')](_0x1c44e9,_0xd74c4d,_0x40ec1e,_0x4d3e39);break;default:strategy[_0xc330('0x4b')](_0x1c44e9,_0xd74c4d,_0x40ec1e,_0x4d3e39);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x37b22d,_0x50b9e9['name']);_0x18ab96['stop']();}}}catch(_0x2db9c1){console['log'](_0x2db9c1);logger['error'](_0xc330('0x3b'),_0x37b22d,_0x2db9c1[_0xc330('0x4c')]);_0x18ab96[_0xc330('0x3e')]();}};}; \ No newline at end of file +var _0xd732=['waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','info','name','QueueReport','create','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','log','validate','util','ioredis','../../../../config/environment','./strategy','defaults','redis','account','queue','from','joinAt','emit','clone','queue_id','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number'];(function(_0x52b1dd,_0x324dc3){var _0x406121=function(_0x1fd697){while(--_0x1fd697){_0x52b1dd['push'](_0x52b1dd['shift']());}};_0x406121(++_0x324dc3);}(_0xd732,0x18e));var _0x2d73=function(_0x32427b,_0xee5311){_0x32427b=_0x32427b-0x0;var _0x5397e0=_0xd732[_0x32427b];return _0x5397e0;};'use strict';var schema=require(_0x2d73('0x0'));var _=require('lodash');var util=require(_0x2d73('0x1'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x2d73('0x2'));var config=require(_0x2d73('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x2d73('0x4'));config['redis']=_[_0x2d73('0x5')](config[_0x2d73('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d73('0x6')]));var attributes=['id','queue_id',_0x2d73('0x7'),_0x2d73('0x8'),_0x2d73('0x9'),_0x2d73('0xa')];function emit(_0x56f52d,_0x37f251,_0x471bdc){io['to'](_0x56f52d)[_0x2d73('0xb')](_0x37f251,_0x471bdc);}function emitChannelQueueInteraction(_0x2655b1,_0x5b6b1f,_0x3a8c79,_0xb06fad,_0x260305,_0x441b32,_0x257f26,_0x45008a){var _0x176782=_[_0x2d73('0xc')](_0x3a8c79);_0x176782[_0x2d73('0xd')]=_0x45008a;_0x176782[_0x2d73('0x8')]=_0x5b6b1f;_0x176782[_0x2d73('0x7')]=_0xb06fad;_0x176782['id']=_0x260305;if(_0x441b32){_0x257f26[util[_0x2d73('0xe')]('%sQueuesWaitingInteractions',_0x2655b1)][_0x260305]=_[_0x2d73('0xf')](_0x176782,attributes);}else{delete _0x257f26[util['format'](_0x2d73('0x10'),_0x2655b1)][_0x260305];}emit(util['format'](_0x2d73('0x11'),_0x2655b1,_0x5b6b1f),util[_0x2d73('0xe')](_0x2d73('0x12'),_0x2655b1,_0x441b32?_0x2d73('0x13'):_0x2d73('0x14')),_['pick'](_0x176782,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x2d73('0x15')),'smsQueueReport':require(_0x2d73('0x16')),'faxQueueReport':require(_0x2d73('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x2d73('0x18'),'required':!![],'message':_0x2d73('0x19')},'timeout':{'type':_0x2d73('0x1a'),'message':_0x2d73('0x1b')}});function startRouting(_0x5934e2,_0x53e565,_0xb7dc00,_0x24066c){if(_0x5934e2&&_0x53e565&&_0xb7dc00){_0x53e565[_0x2d73('0x1c')]+=0x1;var _0x350d7d={'uniqueid':_0x5934e2,'from':_0xb7dc00[_0x2d73('0x1d')]?_0xb7dc00[_0x2d73('0x1d')][_0x2d73('0x9')]:'','joinAt':moment()[_0x2d73('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xb7dc00[_0x2d73('0x1e')]?_0xb7dc00[_0x2d73('0x1e')]['id']:null,'ListId':_0xb7dc00[_0x2d73('0x1f')]?_0xb7dc00[_0x2d73('0x1f')]['id']:null};_0x350d7d[_['upperFirst'](_0xb7dc00[_0x2d73('0x20')])+_0x2d73('0x21')]=_0x53e565['id']||null;_0x350d7d[_[_0x2d73('0x22')](_0xb7dc00[_0x2d73('0x20')])+_0x2d73('0x23')]=_0xb7dc00[_0x2d73('0x24')]?_0xb7dc00[_0x2d73('0x24')]['id']:null;_0x350d7d[_[_0x2d73('0x22')](_0xb7dc00[_0x2d73('0x20')])+_0x2d73('0x25')]=_0xb7dc00[_0x2d73('0x26')]?_0xb7dc00[_0x2d73('0x26')]['id']:null;_0x350d7d[_[_0x2d73('0x22')](_0xb7dc00[_0x2d73('0x20')])+(_0xb7dc00[_0x2d73('0x20')]!==_0x2d73('0x27')?_0x2d73('0x28'):'WebsiteId')]=_0xb7dc00[_0x2d73('0x7')]?_0xb7dc00[_0x2d73('0x7')]['id']:null;logger[_0x2d73('0x29')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x5934e2,_0x53e565[_0x2d73('0x2a')]));emitChannelQueueInteraction(_0xb7dc00[_0x2d73('0x20')],_0x53e565['name'],_0x350d7d,_0xb7dc00['account'][_0x2d73('0x2a')],_0xb7dc00[_0x2d73('0x26')]['id'],!![],_0x24066c,_0x53e565['id']);if(rpc[_0xb7dc00[_0x2d73('0x20')]+'QueueReport']){return rpc[_0xb7dc00['channel']+_0x2d73('0x2b')][_0x2d73('0x2c')](_0x350d7d)[_0x2d73('0x2d')](function(_0x4b22b6){logger['error'](_0x2d73('0x2e'));});}}}function stopRouting(_0x5258d8,_0x331fbc,_0x34cb34,_0x376de7){if(_0x5258d8&&_0x331fbc){_0x331fbc[_0x2d73('0x1c')]-=0x1;var _0x2587ec={'leaveAt':moment()[_0x2d73('0xe')](_0x2d73('0x2f')),'acceptAt':moment()[_0x2d73('0xe')](_0x2d73('0x2f')),'reason':_0x2d73('0x30')};logger['info'](util[_0x2d73('0xe')]('[%s][STOP:QUEUE][NAME:%s]',_0x5258d8,_0x331fbc[_0x2d73('0x2a')]));emitChannelQueueInteraction(_0x34cb34['channel'],_0x331fbc[_0x2d73('0x2a')],_0x34cb34[_0x2d73('0x1d')],_0x34cb34[_0x2d73('0x7')][_0x2d73('0x2a')],_0x34cb34[_0x2d73('0x26')]['id'],![],_0x376de7,_0x331fbc['id']);if(rpc[_0x34cb34[_0x2d73('0x20')]+_0x2d73('0x2b')]){return rpc[_0x34cb34[_0x2d73('0x20')]+'QueueReport'][_0x2d73('0x31')](_0x5258d8,_0x2587ec)['catch'](function(_0x3c4c11){logger[_0x2d73('0x32')](_0x2d73('0x33'));});}}}function endRouting(_0x41864e,_0x2d542f,_0x1fcb4f,_0x48c626){if(_0x41864e&&_0x2d542f){_0x2d542f['waiting']-=0x1;var _0x2b2137={'leaveAt':moment()[_0x2d73('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x2d73('0xe')](_0x2d73('0x2f')),'reason':_0x2d73('0x34')};logger['info'](util[_0x2d73('0xe')](_0x2d73('0x35'),_0x41864e,_0x2d542f['name']));emitChannelQueueInteraction(_0x1fcb4f[_0x2d73('0x20')],_0x2d542f[_0x2d73('0x2a')],_0x1fcb4f['body'],_0x1fcb4f[_0x2d73('0x7')]['name'],_0x1fcb4f[_0x2d73('0x26')]['id'],![],_0x48c626);if(rpc[_0x1fcb4f[_0x2d73('0x20')]+_0x2d73('0x2b')]){return rpc[_0x1fcb4f[_0x2d73('0x20')]+_0x2d73('0x2b')][_0x2d73('0x31')](_0x41864e,_0x2b2137)[_0x2d73('0x2d')](function(_0x41cb43){logger[_0x2d73('0x32')](_0x2d73('0x33'));});}}}function handleFindQueue(_0x4c5a37){return function(_0x5cf801){return _0x5cf801['name'][_0x2d73('0x36')]()===_0x4c5a37[_0x2d73('0x36')]();};}exports[_0x2d73('0x37')]=function(_0x547b4d,_0x12f47f,_0x193e3a,_0x11ad78){return function(_0x21f090){try{var _0xa910d5={'name':_0x12f47f[0x0],'timeout':_0x12f47f[0x1]};var _0x5c4877=queue[_0x2d73('0x0')](_0xa910d5,{'typecast':!![]});if(_0x5c4877[_0x2d73('0x38')]){logger[_0x2d73('0x32')](_0x2d73('0x39'),_0x547b4d,_['map'](_0x5c4877,'message')[_0x2d73('0x3a')](',\x20'));_0x21f090[_0x2d73('0x3b')]();}else{var _0x12a728=_[_0x2d73('0x3c')](_0x193e3a[_0x11ad78['channel']+_0x2d73('0x3d')],handleFindQueue(_0xa910d5[_0x2d73('0x2a')]));if(_0x12a728){startRouting(_0x547b4d,_0x12a728,_0x11ad78,_0x193e3a);var _0x2fa363=(_0x12a728[_0x2d73('0x34')]||0xa)*0x3e8;var _0x5dd170=(_0xa910d5[_0x2d73('0x34')]||0x14)*0x3e8;var _0x147d66,_0x337c55;if(_0x2fa363>_0x5dd170){_0x5dd170=_0x2fa363;}var _0x528547=seqqueue['createQueue'](_0x2fa363);_0x528547['id']=_0x547b4d;_0x528547['atimeout']=_0x2fa363;_0x528547[_0x2d73('0x3e')]=_0x5dd170;_0x528547[_0x2d73('0x20')]=_0x11ad78[_0x2d73('0x20')];_0x193e3a[_0x2d73('0x3f')][_0x547b4d]['on']('end',function(){logger[_0x2d73('0x29')](_0x2d73('0x40'),_0x547b4d);stopRouting(_0x547b4d,_0x12a728,_0x11ad78,_0x193e3a);clearTimeout(_0x147d66);_0x147d66=undefined;_0x528547[_0x2d73('0x41')](!![]);if(_0x193e3a['rules'][_0x547b4d]){delete _0x193e3a[_0x2d73('0x3f')][_0x547b4d];}_0x21f090[_0x2d73('0x3b')]();});_0x193e3a['rules'][_0x547b4d]['on'](_0x2d73('0x42'),function(){if(_0x193e3a[_0x2d73('0x3f')][_0x547b4d]){delete _0x193e3a[_0x2d73('0x3f')][_0x547b4d];}});_0x147d66=setTimeout(function(){logger[_0x2d73('0x29')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x547b4d);endRouting(_0x547b4d,_0x12a728,_0x11ad78,_0x193e3a);clearTimeout(_0x147d66);_0x528547[_0x2d73('0x41')](!![]);_0x21f090[_0x2d73('0x43')]();},_0x5dd170);switch(_0x12a728[_0x2d73('0x44')]){case _0x2d73('0x45'):strategy[_0x2d73('0x45')](_0x528547,_0x12a728,_0x193e3a,_0x11ad78);break;default:strategy['beepall'](_0x528547,_0x12a728,_0x193e3a,_0x11ad78);}}else{logger[_0x2d73('0x32')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x547b4d,_0xa910d5['name']);_0x21f090[_0x2d73('0x3b')]();}}}catch(_0x8daa9b){console[_0x2d73('0x46')](_0x8daa9b);logger['error'](_0x2d73('0x39'),_0x547b4d,_0x8daa9b['stack']);_0x21f090['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index daf91e0..acbf858 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 _0xb4e9=['showNotification','writeLog','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','info','forcedOwnership','isAgentAvailable','agents','channel'];(function(_0x3be66f,_0x3ae8b2){var _0x2f64a0=function(_0x592d76){while(--_0x592d76){_0x3be66f['push'](_0x3be66f['shift']());}};_0x2f64a0(++_0x3ae8b2);}(_0xb4e9,0x175));var _0x9b4e=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0xb4e9[_0x46efd7];return _0x5637e4;};'use strict';var _=require('lodash');var uuid=require(_0x9b4e('0x0'));var util=require(_0x9b4e('0x1'));var logger=require(_0x9b4e('0x2'))(_0x9b4e('0x3'));var Agent=function(_0x59be4b,_0x2f461a,_0x2ecc85,_0x24c92e){this[_0x9b4e('0x4')]=uuid['v4']();this[_0x9b4e('0x5')]=_0x59be4b;this['agent']=_0x2f461a;this[_0x9b4e('0x6')]=_0x2ecc85;this[_0x9b4e('0x3')]=_0x24c92e;this[_0x9b4e('0x5')][_0x9b4e('0x7')](this[_0x9b4e('0x8')][_0x9b4e('0x9')](this),this[_0x9b4e('0xa')][_0x9b4e('0x9')](this));this['squeue']['on'](_0x9b4e('0xb'),this[_0x9b4e('0xa')]['bind'](this));this['squeue']['on'](_0x9b4e('0xc'),this['handleDrained']['bind'](this));};Agent[_0x9b4e('0xd')][_0x9b4e('0x7')]=function(){this['squeue'][_0x9b4e('0x7')](this['handleRun']['bind'](this),this[_0x9b4e('0xa')][_0x9b4e('0x9')](this));};Agent['prototype'][_0x9b4e('0xe')]=function(){this[_0x9b4e('0xa')](!![]);};Agent['prototype'][_0x9b4e('0x8')]=function(_0x57c9cc){logger['info'](_0x9b4e('0xf'),this[_0x9b4e('0x5')]['id'],this[_0x9b4e('0x10')]['id']);if(_[_0x9b4e('0x11')](this[_0x9b4e('0x6')]['agents'][this['agent']['id']])){logger[_0x9b4e('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x9b4e('0x10')]['id']);setTimeout(this[_0x9b4e('0x7')]['bind'](this),0x3e8);}else{if(this['routing'][_0x9b4e('0x13')]||util[_0x9b4e('0x14')](this['squeue']['id'],this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']],this[_0x9b4e('0x5')][_0x9b4e('0x16')],![])){this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']]['busy']=!![];this['realtime'][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']]['busyQueue']=undefined;util[_0x9b4e('0x17')](this[_0x9b4e('0x4')],this[_0x9b4e('0x5')]['id'],this[_0x9b4e('0x6')][_0x9b4e('0x15')][this['agent']['id']],null,this[_0x9b4e('0x3')]);util[_0x9b4e('0x18')](this['squeue']['id'],this['realtime'][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']],'RINGING'+(this[_0x9b4e('0x3')][_0x9b4e('0x13')]?':FORCED':''));}else{logger[_0x9b4e('0x12')](_0x9b4e('0x19'),this['squeue']['id'],this[_0x9b4e('0x10')]['id']);setTimeout(this[_0x9b4e('0x7')][_0x9b4e('0x9')](this),0x3e8);}}};Agent[_0x9b4e('0xd')][_0x9b4e('0xa')]=function(_0x15c86a){if(_[_0x9b4e('0x11')](this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']])){return logger[_0x9b4e('0x12')](_0x9b4e('0x1a'),this[_0x9b4e('0x5')]['id'],this[_0x9b4e('0x10')]['id']);}else{logger[_0x9b4e('0x12')](_0x9b4e('0x1b'),this[_0x9b4e('0x5')]['id'],this['agent']['id']);util[_0x9b4e('0x1c')](this['notificationId'],this[_0x9b4e('0x5')]['id'],this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']],null,this[_0x9b4e('0x3')]);this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']][_0x9b4e('0x1d')]=![];this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']]['busyQueue']=undefined;util[_0x9b4e('0x18')](this['squeue']['id'],this[_0x9b4e('0x6')][_0x9b4e('0x15')][this[_0x9b4e('0x10')]['id']],_0x15c86a?_0x9b4e('0x1e'):_0x9b4e('0x1f'));}if(!_0x15c86a){setTimeout(this[_0x9b4e('0x7')][_0x9b4e('0x9')](this),0x3e8);}};function agent(_0x3b7e76,_0x3359da,_0x737d4b,_0x24ca5c){return new Agent(_0x3b7e76,_0x3359da,_0x737d4b,_0x24ca5c);}module[_0x9b4e('0x20')]=agent; \ No newline at end of file +var _0x07dd=['uuid','./util','../../../../../config/logger','routing','squeue','realtime','push','handleRun','bind','handleTimeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','info','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x07dd,0x17f));var _0xd07d=function(_0x15cfb3,_0x56caa1){_0x15cfb3=_0x15cfb3-0x0;var _0x1d1100=_0x07dd[_0x15cfb3];return _0x1d1100;};'use strict';var _=require(_0xd07d('0x0'));var uuid=require(_0xd07d('0x1'));var util=require(_0xd07d('0x2'));var logger=require(_0xd07d('0x3'))(_0xd07d('0x4'));var Agent=function(_0x22e65f,_0x5048ac,_0x29fc06,_0x7f4e1c){this['notificationId']=uuid['v4']();this[_0xd07d('0x5')]=_0x22e65f;this['agent']=_0x5048ac;this[_0xd07d('0x6')]=_0x29fc06;this[_0xd07d('0x4')]=_0x7f4e1c;this[_0xd07d('0x5')][_0xd07d('0x7')](this[_0xd07d('0x8')][_0xd07d('0x9')](this),this[_0xd07d('0xa')][_0xd07d('0x9')](this));this[_0xd07d('0x5')]['on']('timeout',this[_0xd07d('0xa')][_0xd07d('0x9')](this));this['squeue']['on']('drained',this[_0xd07d('0xb')][_0xd07d('0x9')](this));};Agent[_0xd07d('0xc')][_0xd07d('0x7')]=function(){this['squeue']['push'](this[_0xd07d('0x8')][_0xd07d('0x9')](this),this['handleTimeout'][_0xd07d('0x9')](this));};Agent[_0xd07d('0xc')][_0xd07d('0xb')]=function(){this[_0xd07d('0xa')](!![]);};Agent['prototype']['handleRun']=function(_0x2de9d1){logger['info'](_0xd07d('0xd'),this[_0xd07d('0x5')]['id'],this[_0xd07d('0xe')]['id']);if(_[_0xd07d('0xf')](this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']])){logger['info'](_0xd07d('0x11'),this[_0xd07d('0x5')]['id'],this[_0xd07d('0xe')]['id']);setTimeout(this[_0xd07d('0x7')][_0xd07d('0x9')](this),0x3e8);}else{if(this[_0xd07d('0x4')][_0xd07d('0x12')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']],this[_0xd07d('0x5')]['channel'],![])){this['realtime'][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']][_0xd07d('0x13')]=!![];this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']][_0xd07d('0x14')]=undefined;util['showNotification'](this[_0xd07d('0x15')],this['squeue']['id'],this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']],null,this[_0xd07d('0x4')]);util[_0xd07d('0x16')](this['squeue']['id'],this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']],_0xd07d('0x17')+(this[_0xd07d('0x4')][_0xd07d('0x12')]?_0xd07d('0x18'):''));}else{logger['info'](_0xd07d('0x19'),this['squeue']['id'],this[_0xd07d('0xe')]['id']);setTimeout(this[_0xd07d('0x7')][_0xd07d('0x9')](this),0x3e8);}}};Agent['prototype'][_0xd07d('0xa')]=function(_0xefcc10){if(_[_0xd07d('0xf')](this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']])){return logger[_0xd07d('0x1a')](_0xd07d('0x11'),this[_0xd07d('0x5')]['id'],this['agent']['id']);}else{logger['info'](_0xd07d('0x1b'),this[_0xd07d('0x5')]['id'],this[_0xd07d('0xe')]['id']);util[_0xd07d('0x1c')](this['notificationId'],this[_0xd07d('0x5')]['id'],this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']],null,this[_0xd07d('0x4')]);this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']][_0xd07d('0x13')]=![];this[_0xd07d('0x6')][_0xd07d('0x10')][this[_0xd07d('0xe')]['id']][_0xd07d('0x14')]=undefined;util[_0xd07d('0x16')](this[_0xd07d('0x5')]['id'],this[_0xd07d('0x6')][_0xd07d('0x10')][this['agent']['id']],_0xefcc10?_0xd07d('0x1d'):_0xd07d('0x1e'));}if(!_0xefcc10){setTimeout(this[_0xd07d('0x7')]['bind'](this),0x3e8);}};function agent(_0x3ef5da,_0x52d182,_0x392e9d,_0x196ad2){return new Agent(_0x3ef5da,_0x52d182,_0x392e9d,_0x196ad2);}module[_0xd07d('0x1f')]=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 89da8db..21609c6 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 _0x02a7=['handleRun','bind','handleTimeout','drained','handleDrained','prototype','queue','isNil','length','Agents','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','busyQueue','exports','uuid','routing','notificationId','squeue','realtime','push'];(function(_0x4dc166,_0x28c2de){var _0x267359=function(_0x143ed6){while(--_0x143ed6){_0x4dc166['push'](_0x4dc166['shift']());}};_0x267359(++_0x28c2de);}(_0x02a7,0x7a));var _0x702a=function(_0x167f0c,_0x234a87){_0x167f0c=_0x167f0c-0x0;var _0x55692b=_0x02a7[_0x167f0c];return _0x55692b;};'use strict';var _=require('lodash');var uuid=require(_0x702a('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x702a('0x1'));var Beepall=function(_0x30573e,_0x325874,_0xd65b34,_0x4612ca){this[_0x702a('0x2')]=uuid['v4']();this[_0x702a('0x3')]=_0x30573e;this['queue']=_0x325874;this[_0x702a('0x4')]=_0xd65b34;this['routing']=_0x4612ca;this[_0x702a('0x3')][_0x702a('0x5')](this[_0x702a('0x6')][_0x702a('0x7')](this),this[_0x702a('0x8')][_0x702a('0x7')](this));this[_0x702a('0x3')]['on']('timeout',this[_0x702a('0x8')]['bind'](this));this['squeue']['on'](_0x702a('0x9'),this[_0x702a('0xa')][_0x702a('0x7')](this));};Beepall[_0x702a('0xb')]['push']=function(){this[_0x702a('0x3')][_0x702a('0x5')](this[_0x702a('0x6')][_0x702a('0x7')](this),this[_0x702a('0x8')][_0x702a('0x7')](this));};Beepall[_0x702a('0xb')]['handleDrained']=function(_0x51364a){this[_0x702a('0x8')](!![]);};Beepall['prototype']['handleRun']=function(_0x5a387d){var _0x554435=!![];if(!_['isNil'](this[_0x702a('0xc')])&&!_[_0x702a('0xd')](this[_0x702a('0xc')]['Agents'])&&this['queue']['Agents'][_0x702a('0xe')]>0x0){for(var _0x469cb2=0x0,_0x2fd0e0;_0x469cb20x0){for(var _0x4571f5=0x0,_0x184652;_0x4571f50x0&&_0x56b91e[_0x5713e4+_0x2254('0x22')]>=_0x56b91e[_0x5713e4+'Capacity']){writeLog(_0xf88b56,_0x56b91e,_0x5713e4[_0x2254('0x23')]()+_0x2254('0x24'));return![];}}return!![];};exports[_0x2254('0x25')]=function(_0x3aa0bd,_0x19043b,_0x482688,_0x1a8a0d,_0x2a789b){return sendNotification(!![],_0x3aa0bd,_0x19043b,_0x482688,_0x1a8a0d,_0x2a789b);};exports[_0x2254('0x26')]=function(_0x37af8b,_0x13366a,_0x377c41,_0x3214a7,_0x22e791){return sendNotification(![],_0x37af8b,_0x13366a,_0x377c41,_0x3214a7,_0x22e791);};exports[_0x2254('0x27')]=writeLog; \ No newline at end of file +var _0x8f9d=['user:save','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','socket.io-emitter','format','user:%s','name','emit'];(function(_0x1a791f,_0x511710){var _0x3366a3=function(_0x174087){while(--_0x174087){_0x1a791f['push'](_0x1a791f['shift']());}};_0x3366a3(++_0x511710);}(_0x8f9d,0x93));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var utils=require(_0xd8f9('0x1'));var Mustache=require('mustache');var Redis=require(_0xd8f9('0x2'));var config=require(_0xd8f9('0x3'));var logger=require(_0xd8f9('0x4'))(_0xd8f9('0x5'));config[_0xd8f9('0x6')]=_[_0xd8f9('0x7')](config[_0xd8f9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd8f9('0x8'))(new Redis(config[_0xd8f9('0x6')]));function emit(_0x25d417,_0x241aaa,_0xf6105){io['to'](_0x25d417)['emit'](_0x241aaa,_0xf6105);}function sendNotification(_0x46babd,_0x6691e,_0x4957ae,_0x33c31e,_0x4ac0ea,_0x5caee9){io['to'](util[_0xd8f9('0x9')](_0xd8f9('0xa'),_0x33c31e[_0xd8f9('0xb')]))[_0xd8f9('0xc')](_0xd8f9('0xd'),_0x33c31e);var _0x3a1db8=_0x5caee9||{};var _0x14c630=_0x4957ae['split']('.');var _0x3a214b={'uniqueid':_0x6691e,'channel':_0x14c630[0x0],'id':_0x14c630[0x1],'title':_0x14c630[0x0]+'\x20interaction','interactionId':_0x14c630[0x2],'queue':_0x4ac0ea?_0x4ac0ea[_0xd8f9('0xb')]:null,'sound':_0x3a1db8[_0xd8f9('0xe')][_0xd8f9('0xf')],'shake':_0x3a1db8['account'][_0xd8f9('0x10')]};try{if(!_0x3a1db8[_0xd8f9('0x11')]){_0x3a1db8[_0xd8f9('0x11')]={};}if(_0x4ac0ea){_0x3a1db8[_0xd8f9('0x11')]['queue']=_0x4ac0ea;}else if(_0x3a1db8[_0xd8f9('0x11')][_0xd8f9('0x12')]){delete _0x3a1db8[_0xd8f9('0x11')][_0xd8f9('0x12')];}_0x3a214b[_0xd8f9('0x13')]=utils[_0xd8f9('0x14')](_0x3a1db8[_0xd8f9('0xe')]['notificationTemplate'],_0x3a1db8);}catch(_0x5cb08e){_0x3a214b[_0xd8f9('0x13')]=_0xd8f9('0x15');logger['error'](util[_0xd8f9('0x9')]('[%s][QUEUE]\x20%s',_0x6691e,_0x5cb08e[_0xd8f9('0x16')]));}io['to'](util['format']('user:%s',_0x33c31e['name']))[_0xd8f9('0xc')](util['format'](_0xd8f9('0x17'),_0x46babd?_0xd8f9('0x18'):_0xd8f9('0x19')),_0x3a214b);}function writeLog(_0x3204b3,_0x3b141a,_0x45b2e3){return logger['info'](util[_0xd8f9('0x9')](_0xd8f9('0x1a'),_0x3204b3,_0x3b141a[_0xd8f9('0xb')],_0x45b2e3));}exports[_0xd8f9('0x1b')]=function(_0x1bf210,_0x318d6a,_0x4c5808,_0x39fedc){if(_0x318d6a[_0xd8f9('0x1c')]){writeLog(_0x1bf210,_0x318d6a,_0xd8f9('0x1d'));return![];}if(!_0x318d6a[_0xd8f9('0x1e')]){writeLog(_0x1bf210,_0x318d6a,_0xd8f9('0x1f'));return![];}if(_0x318d6a[_0x4c5808+'Pause']){writeLog(_0x1bf210,_0x318d6a,_0xd8f9('0x20'));return![];}if(_0x39fedc&&_0x318d6a[_0xd8f9('0x21')](_0x4c5808+_0xd8f9('0x22'))&&_0x318d6a[_0xd8f9('0x21')](_0x4c5808+_0xd8f9('0x23'))){if(_0x318d6a[_0x4c5808+_0xd8f9('0x22')]>0x0&&_0x318d6a[_0x4c5808+_0xd8f9('0x23')]>=_0x318d6a[_0x4c5808+_0xd8f9('0x22')]){writeLog(_0x1bf210,_0x318d6a,_0x4c5808['toUpperCase']()+_0xd8f9('0x24'));return![];}}return!![];};exports[_0xd8f9('0x25')]=function(_0x3967fb,_0x58a3ca,_0x5bd32e,_0x4c08b0,_0x3f85a2){return sendNotification(!![],_0x3967fb,_0x58a3ca,_0x5bd32e,_0x4c08b0,_0x3f85a2);};exports[_0xd8f9('0x26')]=function(_0x5050a4,_0x2bda39,_0x210cd1,_0x5da878,_0x4b0de7){return sendNotification(![],_0x5050a4,_0x2bda39,_0x210cd1,_0x5da878,_0x4b0de7);};exports[_0xd8f9('0x27')]=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 8eeed06..3cedb62 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 _0xf759=['stringify','validate','shelljs','lodash','./utils','consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject'];(function(_0x5427c6,_0x1240a1){var _0x5144ff=function(_0x426797){while(--_0x426797){_0x5427c6['push'](_0x5427c6['shift']());}};_0x5144ff(++_0x1240a1);}(_0xf759,0x1e1));var _0x9f75=function(_0x4f5b97,_0x37a790){_0x4f5b97=_0x4f5b97-0x0;var _0x514a73=_0xf759[_0x4f5b97];return _0x514a73;};'use strict';var schema=require(_0x9f75('0x0'));var sh=require(_0x9f75('0x1'));var _=require(_0x9f75('0x2'));var utils=require(_0x9f75('0x3'));var logger=require('../../../../config/logger')('routing');var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x9f75('0x4')]=function(_0xf6b09b,_0x48841c){return function(_0x53c0c5){try{var _0x171ef1={'command':_0x48841c[0x0]};var _0x2ed8ce=system[_0x9f75('0x0')](_0x171ef1,{'typecast':!![]});if(_0x2ed8ce[_0x9f75('0x5')]){logger[_0x9f75('0x6')](_0x9f75('0x7'),_0xf6b09b,_[_0x9f75('0x8')](_0x2ed8ce,'message')[_0x9f75('0x9')](',\x20'));logger[_0x9f75('0xa')](_0x9f75('0xb'),_0xf6b09b);_0x53c0c5[_0x9f75('0xc')]();}else{var _0x524779=this;var _0x543ac0=utils[_0x9f75('0xd')](_0x48841c[0x0],this);logger[_0x9f75('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0xf6b09b,_0x543ac0);sh[_0x9f75('0xe')](_[_0x9f75('0xf')](_0x543ac0),function(_0x587154,_0x530497){logger[_0x9f75('0xa')](_0x9f75('0x10'),_0xf6b09b,_0x587154);if(_0x587154==0x0){var _0x433511=_0x530497[_0x9f75('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x48841c[0x1])||_[_0x9f75('0x12')](_0x48841c[0x1])){logger[_0x9f75('0xa')](_0x9f75('0x13'),_0xf6b09b);_0x524779[_0x9f75('0x14')][_0x48841c[0x1]]=_0x433511;}else{logger[_0x9f75('0xa')](_0x9f75('0x15'),_0xf6b09b,_0x48841c[0x1],_0x433511);_0x524779[_0x9f75('0x14')][_0x48841c[0x1]]=_0x433511;}}_0x53c0c5[_0x9f75('0xc')]();});}}catch(_0x217619){logger[_0x9f75('0x6')](_0x9f75('0x7'),_0xf6b09b,_[_0x9f75('0x16')](_0x217619)?JSON[_0x9f75('0x17')](_0x217619):_0x217619);logger['info'](_0x9f75('0xb'),_0xf6b09b);_0x53c0c5['next']();}};}; \ No newline at end of file +var _0xa8fd=['next','info','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','[%s][SYSTEM]\x20%s','isObject','stringify','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0xa8fd,0x17a));var _0xda8f=function(_0x5eac86,_0x4562db){_0x5eac86=_0x5eac86-0x0;var _0x3430e4=_0xa8fd[_0x5eac86];return _0x3430e4;};'use strict';var schema=require('validate');var sh=require(_0xda8f('0x0'));var _=require(_0xda8f('0x1'));var utils=require(_0xda8f('0x2'));var logger=require(_0xda8f('0x3'))(_0xda8f('0x4'));var system=schema({'command':{'type':_0xda8f('0x5'),'required':!![],'message':_0xda8f('0x6')}});exports[_0xda8f('0x7')]=function(_0x5d852c,_0x5cfa68){return function(_0x12f329){try{var _0x34cbe8={'command':_0x5cfa68[0x0]};var _0x3ff34b=system['validate'](_0x34cbe8,{'typecast':!![]});if(_0x3ff34b['length']){logger['error']('[%s][SYSTEM]\x20%s',_0x5d852c,_[_0xda8f('0x8')](_0x3ff34b,_0xda8f('0x9'))[_0xda8f('0xa')](',\x20'));logger['info'](_0xda8f('0xb'),_0x5d852c);_0x12f329[_0xda8f('0xc')]();}else{var _0x770eeb=this;var _0x5e3a1e=utils['getMustacheRender'](_0x5cfa68[0x0],this);logger[_0xda8f('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5d852c,_0x5e3a1e);sh[_0xda8f('0xe')](_[_0xda8f('0xf')](_0x5e3a1e),function(_0x48ac47,_0x175723){logger['info'](_0xda8f('0x10'),_0x5d852c,_0x48ac47);if(_0x48ac47==0x0){var _0x3bc5c2=_0x175723[_0xda8f('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xda8f('0x12')](_0x5cfa68[0x1])||_[_0xda8f('0x13')](_0x5cfa68[0x1])){logger['info'](_0xda8f('0x14'),_0x5d852c);_0x770eeb['body'][_0x5cfa68[0x1]]=_0x3bc5c2;}else{logger[_0xda8f('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x5d852c,_0x5cfa68[0x1],_0x3bc5c2);_0x770eeb[_0xda8f('0x15')][_0x5cfa68[0x1]]=_0x3bc5c2;}}_0x12f329[_0xda8f('0xc')]();});}}catch(_0x43ee2d){logger[_0xda8f('0x16')](_0xda8f('0x17'),_0x5d852c,_[_0xda8f('0x18')](_0x43ee2d)?JSON[_0xda8f('0x19')](_0x43ee2d):_0x43ee2d);logger[_0xda8f('0xd')](_0xda8f('0xb'),_0x5d852c);_0x12f329[_0xda8f('0xc')]();}};}; \ 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 c2e3019..1ae0d91 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 _0x65a8=['map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','stringify','finally','isObject','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','[%s][TAG]\x20%s'];(function(_0x562a73,_0x532162){var _0x4f582b=function(_0x968ffa){while(--_0x968ffa){_0x562a73['push'](_0x562a73['shift']());}};_0x4f582b(++_0x532162);}(_0x65a8,0x196));var _0x865a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x65a8[_0x40a045];return _0x1a687c;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x865a('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x865a('0x1')),'faxInteraction':require(_0x865a('0x2')),'whatsappInteraction':require(_0x865a('0x3'))};var logger=require(_0x865a('0x4'))(_0x865a('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x865a('0x6')}});exports[_0x865a('0x7')]=function(_0x5df205,_0xf3bb3f,_0xf3ceb6,_0x2fd21b){return function(_0xbaa7dc){try{var _0x40ca99={'tag':_0xf3bb3f[0x0]};var _0x597055=tag[_0x865a('0x8')](_0x40ca99,{'typecast':!![]});if(_0x597055['length']){logger['error'](_0x865a('0x9'),_0x5df205,_[_0x865a('0xa')](_0x597055,_0x865a('0xb'))[_0x865a('0xc')](',\x20'));logger[_0x865a('0xd')](_0x865a('0xe'),_0x5df205);_0xbaa7dc[_0x865a('0xf')]();}else{var _0x1e9a34={'ids':[_0xf3bb3f[0x0]]};if(rpc[_0x2fd21b[_0x865a('0x10')]+_0x865a('0x11')]){rpc[_0x2fd21b[_0x865a('0x10')]+_0x865a('0x11')][_0x865a('0x12')](_0x2fd21b['interaction']['id'],_0x1e9a34)[_0x865a('0x13')](function(_0x145eb5){logger[_0x865a('0xd')](_0x865a('0x14'),_0x5df205,_0xf3bb3f[0x1],_0x2fd21b[_0x865a('0x10')],_0x2fd21b['interaction']['id']);})[_0x865a('0x15')](function(_0x16358a){logger[_0x865a('0x16')](_0x865a('0x9'),_0x5df205,JSON[_0x865a('0x17')](_0x16358a));logger[_0x865a('0xd')](_0x865a('0xe'),_0x5df205);})[_0x865a('0x18')](function(){_0xbaa7dc[_0x865a('0xf')]();});}}}catch(_0x9bdaae){logger[_0x865a('0x16')](_0x865a('0x9'),_0x5df205,_[_0x865a('0x19')](_0x9bdaae)?JSON[_0x865a('0x17')](_0x9bdaae):_0x9bdaae);logger[_0x865a('0xd')](_0x865a('0xe'),_0x5df205);_0xbaa7dc[_0x865a('0xf')]();}};}; \ No newline at end of file +var _0x05cc=['stringify','finally','isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/mailInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch'];(function(_0x231103,_0x57b8c0){var _0x3c4718=function(_0x51411c){while(--_0x51411c){_0x231103['push'](_0x231103['shift']());}};_0x3c4718(++_0x57b8c0);}(_0x05cc,0x1a3));var _0xc05c=function(_0x2715d9,_0x4d2846){_0x2715d9=_0x2715d9-0x0;var _0x4d0b12=_0x05cc[_0x2715d9];return _0x4d0b12;};'use strict';var schema=require(_0xc05c('0x0'));var _=require(_0xc05c('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xc05c('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xc05c('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0xc05c('0x4'));var tag=schema({'tag':{'type':_0xc05c('0x5'),'required':!![],'message':_0xc05c('0x6')}});exports[_0xc05c('0x7')]=function(_0x5665d9,_0x4e8d3a,_0x222eb1,_0x1d863){return function(_0x487212){try{var _0x244b49={'tag':_0x4e8d3a[0x0]};var _0x412930=tag[_0xc05c('0x0')](_0x244b49,{'typecast':!![]});if(_0x412930[_0xc05c('0x8')]){logger[_0xc05c('0x9')](_0xc05c('0xa'),_0x5665d9,_[_0xc05c('0xb')](_0x412930,'message')[_0xc05c('0xc')](',\x20'));logger[_0xc05c('0xd')](_0xc05c('0xe'),_0x5665d9);_0x487212[_0xc05c('0xf')]();}else{var _0xf77428={'ids':[_0x4e8d3a[0x0]]};if(rpc[_0x1d863[_0xc05c('0x10')]+_0xc05c('0x11')]){rpc[_0x1d863[_0xc05c('0x10')]+_0xc05c('0x11')][_0xc05c('0x12')](_0x1d863[_0xc05c('0x13')]['id'],_0xf77428)[_0xc05c('0x14')](function(_0x58093b){logger[_0xc05c('0xd')](_0xc05c('0x15'),_0x5665d9,_0x4e8d3a[0x1],_0x1d863['channel'],_0x1d863['interaction']['id']);})[_0xc05c('0x16')](function(_0x21fb74){logger[_0xc05c('0x9')](_0xc05c('0xa'),_0x5665d9,JSON[_0xc05c('0x17')](_0x21fb74));logger[_0xc05c('0xd')](_0xc05c('0xe'),_0x5665d9);})[_0xc05c('0x18')](function(){_0x487212[_0xc05c('0xf')]();});}}}catch(_0x12eff2){logger[_0xc05c('0x9')](_0xc05c('0xa'),_0x5665d9,_[_0xc05c('0x19')](_0x12eff2)?JSON[_0xc05c('0x17')](_0x12eff2):_0x12eff2);logger['info'](_0xc05c('0xe'),_0x5665d9);_0x487212[_0xc05c('0xf')]();}};}; \ 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 624afe5..22e526c 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1e5666,_0x5c1bb4){var _0x36981e=function(_0xb8a0b5){while(--_0xb8a0b5){_0x1e5666['push'](_0x1e5666['shift']());}};_0x36981e(++_0x5c1bb4);}(_0xe706,0xa3));var _0x6e70=function(_0x419912,_0x988212){_0x419912=_0x419912-0x0;var _0x5c0ff3=_0xe706[_0x419912];return _0x5c0ff3;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x405daf,_0x3e7067){var _0x221fc9=function(_0xc4b728){while(--_0xc4b728){_0x405daf['push'](_0x405daf['shift']());}};_0x221fc9(++_0x3e7067);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 1f2dd6a..2025e6c 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 _0x38d6=['%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','message','interaction','isArray','length','applications','existsSync','join','app','.js','autoreply','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','agent','agents','busy','end','QueueReport','UserId','catch','stack','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','mailQueues','available','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format'];(function(_0x322045,_0x291328){var _0x817a33=function(_0x3e5e9b){while(--_0x3e5e9b){_0x322045['push'](_0x322045['shift']());}};_0x817a33(++_0x291328);}(_0x38d6,0xab));var _0x638d=function(_0x2c6fb9,_0xc7d7c0){_0x2c6fb9=_0x2c6fb9-0x0;var _0x49fd5e=_0x38d6[_0x2c6fb9];return _0x49fd5e;};'use strict';var _=require(_0x638d('0x0'));var util=require(_0x638d('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x638d('0x2'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0x638d('0x3'));var logger=require('../../../config/logger')(_0x638d('0x4'));var rpc={'openchannelQueueReport':require(_0x638d('0x5')),'mailQueueReport':require(_0x638d('0x6')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x638d('0x7')),'faxQueueReport':require(_0x638d('0x8')),'whatsappQueueReport':require(_0x638d('0x9'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x4d7733,_0x1c8bcc,_0x2f001f){return util[_0x638d('0xa')](_0x638d('0xb'),_0x4d7733,_0x1c8bcc||0x0,_0x2f001f||0x0);}function getIntervals(_0x112c9b,_0x4f311e){var _0x354047=[];if(!_[_0x638d('0xc')](_0x4f311e[_0x638d('0xd')])&&!_[_0x638d('0xc')](_0x112c9b[_0x4f311e['IntervalId']])&&!_[_0x638d('0xc')](_0x112c9b[_0x4f311e[_0x638d('0xd')]]['Intervals'])){_0x354047=_['map'](_0x112c9b[_0x4f311e['IntervalId']][_0x638d('0xe')],_0x638d('0xf'));}else if(!_['isNil'](_0x4f311e[_0x638d('0xf')])){_0x354047=[_0x4f311e['interval']];}return _0x354047;}exports[_0x638d('0x10')]=function(_0x3ec901){_0x3ec901[_0x638d('0x11')]={};return new BPromise(function(_0x3e0cb,_0x3f9ef5){var _0x57e981={'Start':function(_0x1abf9d){var _0xd70457=this;return new Promise(function(_0x22a309,_0x50aea8){if(_0x1abf9d){try{var _0x3595d5=[];var _0x3d6f36=getId(_0x1abf9d['channel'],_0x1abf9d['message']?_0x1abf9d[_0x638d('0x12')]['id']:0x0,_0x1abf9d['interaction']?_0x1abf9d[_0x638d('0x13')]['id']:0x0);if(_0x1abf9d['applications']&&_[_0x638d('0x14')](_0x1abf9d['applications'])&&_0x1abf9d['applications'][_0x638d('0x15')]){for(var _0x426c6a=0x0;_0x426c6a<_0x1abf9d[_0x638d('0x16')]['length'];_0x426c6a+=0x1){var _0x760046=_0x1abf9d[_0x638d('0x16')][_0x426c6a];if(fs[_0x638d('0x17')](path[_0x638d('0x18')](__dirname,_0x638d('0x16'),_0x760046[_0x638d('0x19')]+_0x638d('0x1a')))){var _0x381bb3=[];switch(_0x760046['app']['toLowerCase']()){case _0x638d('0x1b'):var _0x306760=_0x760046[_0x638d('0x1c')][_0x638d('0x1d')](',');if(_0x1abf9d[_0x638d('0x1e')]===_0x638d('0x1f')){_0x381bb3['push'](_0x306760[0x0]);_0x381bb3[_0x638d('0x20')](_0x306760[0x1]);_0x381bb3[_0x638d('0x20')](_0x306760['slice'](0x2,_0x306760['length'])[_0x638d('0x18')](','));}else{_0x381bb3[_0x638d('0x20')](_0x306760[0x0]);_0x381bb3['push'](_0x306760[_0x638d('0x21')](0x1,_0x306760['length'])[_0x638d('0x18')](','));}break;case _0x638d('0x22'):var _0xdc3043=_0x760046[_0x638d('0x1c')][_0x638d('0x1d')](',');_0x381bb3['push'](_0xdc3043[0x0]);_0x381bb3[_0x638d('0x20')](_0xdc3043[0x1]);_0x381bb3[_0x638d('0x20')](_0xdc3043[_0x638d('0x21')](0x2,_0xdc3043[_0x638d('0x15')])[_0x638d('0x18')](','));break;case _0x638d('0x23'):var _0x147d8a=_0x760046[_0x638d('0x1c')]['split'](',');_0x381bb3[_0x638d('0x20')](_0x147d8a[0x0]);_0x381bb3[_0x638d('0x20')](_0x147d8a[0x1]);_0x381bb3['push'](_0x147d8a[0x2]);_0x381bb3[_0x638d('0x20')](_0x147d8a[0x3]);_0x381bb3[_0x638d('0x20')](_0x147d8a[_0x638d('0x21')](0x4,_0x147d8a['length'])[_0x638d('0x18')](','));break;case _0x638d('0x24'):var _0x189c9b=_0x760046[_0x638d('0x1c')][_0x638d('0x1d')](',');_0x381bb3[_0x638d('0x20')](_0x189c9b[0x0]);_0x381bb3[_0x638d('0x20')](_0x189c9b[0x1]);_0x381bb3[_0x638d('0x20')](_0x189c9b[0x2]);_0x381bb3[_0x638d('0x20')](_0x189c9b[0x3]);_0x381bb3[_0x638d('0x20')](_0x189c9b[_0x638d('0x21')](0x4,_0x189c9b[_0x638d('0x15')])['join'](','));break;case _0x638d('0x12'):_0x381bb3[_0x638d('0x20')](_0x760046[_0x638d('0x1c')]);break;case _0x638d('0x25'):_0x381bb3[_0x638d('0x20')](_0x760046[_0x638d('0x26')]);_0x381bb3[_0x638d('0x20')](_0x760046[_0x638d('0x1c')]);break;default:_0x381bb3=_[_0x638d('0xc')](_0x760046['appdata'])?[]:_0x760046[_0x638d('0x1c')]['split'](',');}var _0x58017e={'id':util['format']('%s:%s:%s',_0x3d6f36,_0x760046['id'],_0x760046[_0x638d('0x19')]),'condition':require('./interval')['condition'](_0x3d6f36,getIntervals(_0x3ec901['intervals'],_0x760046),_0x3ec901),'consequence':require(_0x638d('0x27')+_0x760046[_0x638d('0x19')])[_0x638d('0x28')](_0x3d6f36,_0x381bb3,_0x3ec901,_0x1abf9d),'p':_0x760046[_0x638d('0x29')]||0x0};logger[_0x638d('0x2a')](_0x638d('0x2b'),_0x58017e['id'],_0x638d('0x2c'),getIntervals(_0x3ec901[_0x638d('0x2d')],_0x760046)[_0x638d('0x18')](_0x638d('0x2e')));_0x3595d5['push'](_0x58017e);}else{logger[_0x638d('0x2f')](_0x638d('0x30'),path['join'](__dirname,_0x638d('0x16'),_0x760046[_0x638d('0x19')]+_0x638d('0x1a')));}}_0x3ec901[_0x638d('0x11')][_0x3d6f36]=new RuleEngine(_0x3595d5);_0x3ec901[_0x638d('0x11')][_0x3d6f36]['execute'](_0x1abf9d,function(_0x59d17d){logger[_0x638d('0x2a')](_0x638d('0x31'),JSON[_0x638d('0x32')](_0x59d17d[_0x638d('0x33')]));if(_0x3ec901[_0x638d('0x11')][_0x3d6f36]){_0x3ec901['rules'][_0x3d6f36][_0x638d('0x34')]('complete');}});return _0x22a309({'code':0xc8,'message':_0x1abf9d});}else{logger['info'](_0x638d('0x35'));return _0x22a309({'code':0xc8,'message':_0x1abf9d});}}catch(_0x4a171a){logger[_0x638d('0x2f')](_0x4a171a['stack']);return _0x50aea8(_0xd70457[_0x638d('0x2f')](0x1f4,_0x4a171a));}}return _0x50aea8('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1cbfe4){var _0x4840a9=this;return new Promise(function(_0x501cac,_0x22e701){if(_0x1cbfe4[_0x638d('0x36')]&&_0x1cbfe4[_0x638d('0x36')]['id']){if(_0x3ec901[_0x638d('0x37')][_0x1cbfe4[_0x638d('0x36')]['id']]){_0x3ec901[_0x638d('0x37')][_0x1cbfe4[_0x638d('0x36')]['id']][_0x638d('0x38')]=![];_0x3ec901[_0x638d('0x37')][_0x1cbfe4[_0x638d('0x36')]['id']]['busyQueue']=undefined;}}if(_0x1cbfe4[_0x638d('0x12')]&&_0x1cbfe4['message']['id']){try{var _0x59a6b8=getId(_0x1cbfe4['channel'],_0x1cbfe4[_0x638d('0x12')]?_0x1cbfe4[_0x638d('0x12')]['id']:0x0,_0x1cbfe4['interaction']?_0x1cbfe4[_0x638d('0x13')]['id']:0x0);if(_0x3ec901[_0x638d('0x11')][_0x59a6b8]){_0x3ec901['rules'][_0x59a6b8][_0x638d('0x34')](_0x638d('0x39'));if(rpc[_0x1cbfe4[_0x638d('0x1e')]+'QueueReport']){rpc[_0x1cbfe4[_0x638d('0x1e')]+_0x638d('0x3a')]['update'](_0x59a6b8,{'UserId':_0x1cbfe4[_0x638d('0x12')][_0x638d('0x3b')]})[_0x638d('0x3c')](function(_0x22296d){logger[_0x638d('0x2f')]('error\x20update\x20queue\x20report');});}}return _0x501cac({'code':0xc8,'message':_0x1cbfe4});}catch(_0x16eb93){logger[_0x638d('0x2f')](_0x16eb93[_0x638d('0x3d')]);return _0x22e701(_0x4840a9[_0x638d('0x2f')](0x1f4,_0x16eb93));}}logger['error']('message\x20is\x20empty');return _0x22e701(_0x4840a9['error'](0x1f4,_0x638d('0x3e')));});},'RejectMessage':function(_0x2dffa7){var _0x399a78=this;return new Promise(function(_0x125bf8,_0x353c55){if(_0x2dffa7['agent']&&_0x2dffa7[_0x638d('0x36')]['id']){try{if(_0x3ec901['agents'][_0x2dffa7['agent']['id']]){_0x3ec901[_0x638d('0x37')][_0x2dffa7[_0x638d('0x36')]['id']]['busy']=![];_0x3ec901[_0x638d('0x37')][_0x2dffa7[_0x638d('0x36')]['id']][_0x638d('0x3f')]=undefined;}return _0x125bf8({'code':0xc8,'message':_0x2dffa7});}catch(_0x48570a){logger['error'](_0x48570a[_0x638d('0x3d')]);return _0x353c55(_0x399a78[_0x638d('0x2f')](0x1f4,_0x48570a));}}logger['error'](_0x638d('0x3e'));return _0x353c55(_0x399a78[_0x638d('0x2f')](0x1f4,_0x638d('0x3e')));});},'AbandonInteraction':function(_0x578507){var _0x17db76=this;return new Promise(function(_0x2ea1fc,_0x127727){if(_0x578507['channel']&&_0x578507[_0x638d('0x13')]&&_0x578507[_0x638d('0x13')]['id']){try{var _0x11cff0=getId(_0x578507[_0x638d('0x1e')],_0x578507['message']?_0x578507[_0x638d('0x12')]['id']:0x0,_0x578507[_0x638d('0x13')]?_0x578507[_0x638d('0x13')]['id']:0x0);if(_0x3ec901['rules'][_0x11cff0]){_0x3ec901[_0x638d('0x11')][_0x11cff0][_0x638d('0x34')](_0x638d('0x39'));}return _0x2ea1fc({'code':0xc8,'message':_0x578507});}catch(_0x49397a){logger[_0x638d('0x2f')](_0x49397a[_0x638d('0x3d')]);return _0x127727(_0x17db76[_0x638d('0x2f')](0x1f4,_0x49397a));}}logger['error'](_0x638d('0x3e'));return _0x127727(_0x17db76[_0x638d('0x2f')](0x1f4,_0x638d('0x3e')));});},'AgentCapacity':function(_0x917cce){var _0x22f35f=this;return new Promise(function(_0x91f844,_0x3a260e){if(_0x3ec901['agents'][_0x638d('0x40')](_0x917cce['id'])){for(var _0x2ebe9f in _0x917cce[_0x638d('0x41')]){if(_0x917cce[_0x638d('0x41')][_0x638d('0x40')](_0x2ebe9f)){if(_0x3ec901[_0x638d('0x37')][_0x917cce['id']]['hasOwnProperty'](_0x2ebe9f+_0x638d('0x42'))){_0x3ec901[_0x638d('0x37')][_0x917cce['id']][_0x2ebe9f+_0x638d('0x42')]=parseInt(_0x917cce[_0x638d('0x41')][_0x2ebe9f],0xa);}}}_0x3ec901[_0x638d('0x37')][_0x917cce['id']][_0x638d('0x43')]();return _0x91f844({'code':0xc8,'message':_0x3ec901[_0x638d('0x37')][_0x917cce['id']]});}else{return _0x3a260e(_0x22f35f[_0x638d('0x2f')](0x1f4,_0x638d('0x44')));}});},'Agents':function(_0x2d2497){return new Promise(function(_0x3ecd72,_0x20e8e6){var _0x1001c9=_[_0x638d('0x45')](_0x3ec901[_0x638d('0x37')]);_0x3ecd72({'count':_0x1001c9[_0x638d('0x15')],'rows':_0x1001c9});});},'ChatQueues':function(_0x5e7f0f){return new Promise(function(_0x4ae161,_0x68e163){var _0x54abb5=[];for(var _0x2bede9 in _0x3ec901[_0x638d('0x46')]){if(_0x3ec901['chatQueues'][_0x638d('0x40')](_0x2bede9)){var _0x2e590c=_0x3ec901[_0x638d('0x46')][_0x2bede9];var _0x2b479d={'id':_0x2e590c['id'],'available':_0x2e590c['available'],'loggedIn':_0x2e590c[_0x638d('0x47')],'name':_0x2e590c[_0x638d('0x48')],'paused':_0x2e590c[_0x638d('0x49')],'waiting':_0x2e590c['waiting']};_0x54abb5[_0x638d('0x20')](_0x2b479d);}}_0x4ae161({'count':_0x54abb5[_0x638d('0x15')],'rows':_0x54abb5});});},'MailQueues':function(_0x549c1c){return new Promise(function(_0x280a67,_0x1770fd){var _0x52f44c=[];for(var _0x468655 in _0x3ec901[_0x638d('0x4a')]){if(_0x3ec901['mailQueues']['hasOwnProperty'](_0x468655)){var _0x54e134=_0x3ec901['mailQueues'][_0x468655];var _0x1387ee={'id':_0x54e134['id'],'available':_0x54e134[_0x638d('0x4b')],'loggedIn':_0x54e134['loggedIn'],'name':_0x54e134[_0x638d('0x48')],'paused':_0x54e134[_0x638d('0x49')],'waiting':_0x54e134['waiting']};_0x52f44c[_0x638d('0x20')](_0x1387ee);}}_0x280a67({'count':_0x52f44c['length'],'rows':_0x52f44c});});},'OpenchannelQueues':function(_0x52a37a){return new Promise(function(_0x85c278,_0x321909){var _0x82d430=[];for(var _0x28718e in _0x3ec901[_0x638d('0x4c')]){if(_0x3ec901['openchannelQueues'][_0x638d('0x40')](_0x28718e)){var _0x2caf02=_0x3ec901[_0x638d('0x4c')][_0x28718e];var _0x540f8a={'id':_0x2caf02['id'],'available':_0x2caf02[_0x638d('0x4b')],'loggedIn':_0x2caf02[_0x638d('0x47')],'name':_0x2caf02[_0x638d('0x48')],'paused':_0x2caf02[_0x638d('0x49')],'waiting':_0x2caf02[_0x638d('0x4d')]};_0x82d430[_0x638d('0x20')](_0x540f8a);}}_0x85c278({'count':_0x82d430['length'],'rows':_0x82d430});});},'SmsQueues':function(_0x10c5fd){return new Promise(function(_0x1998bc,_0x3cc3e9){var _0xc36f9a=[];for(var _0x2a0806 in _0x3ec901['smsQueues']){if(_0x3ec901[_0x638d('0x4e')][_0x638d('0x40')](_0x2a0806)){var _0x3aa60d=_0x3ec901[_0x638d('0x4e')][_0x2a0806];var _0x4545e9={'id':_0x3aa60d['id'],'available':_0x3aa60d[_0x638d('0x4b')],'loggedIn':_0x3aa60d[_0x638d('0x47')],'name':_0x3aa60d[_0x638d('0x48')],'paused':_0x3aa60d[_0x638d('0x49')],'waiting':_0x3aa60d[_0x638d('0x4d')]};_0xc36f9a[_0x638d('0x20')](_0x4545e9);}}_0x1998bc({'count':_0xc36f9a[_0x638d('0x15')],'rows':_0xc36f9a});});},'FaxQueues':function(_0x46afc1){return new Promise(function(_0x46e105,_0x8fd1fa){var _0x19d8f4=[];for(var _0x9d5eef in _0x3ec901[_0x638d('0x4f')]){if(_0x3ec901['faxQueues']['hasOwnProperty'](_0x9d5eef)){var _0x9de773=_0x3ec901[_0x638d('0x4f')][_0x9d5eef];var _0x34a7f0={'id':_0x9de773['id'],'available':_0x9de773[_0x638d('0x4b')],'loggedIn':_0x9de773[_0x638d('0x47')],'name':_0x9de773[_0x638d('0x48')],'paused':_0x9de773['paused'],'waiting':_0x9de773['waiting']};_0x19d8f4[_0x638d('0x20')](_0x34a7f0);}}_0x46e105({'count':_0x19d8f4[_0x638d('0x15')],'rows':_0x19d8f4});});},'WhatsappQueues':function(_0x1b7ad6){return new Promise(function(_0x588a82,_0x39f728){var _0xd4cfbd=[];for(var _0x2bc027 in _0x3ec901[_0x638d('0x50')]){if(_0x3ec901['whatsappQueues'][_0x638d('0x40')](_0x2bc027)){var _0x47ca24=_0x3ec901[_0x638d('0x50')][_0x2bc027];var _0x3b4914={'id':_0x47ca24['id'],'available':_0x47ca24[_0x638d('0x4b')],'loggedIn':_0x47ca24[_0x638d('0x47')],'name':_0x47ca24[_0x638d('0x48')],'paused':_0x47ca24[_0x638d('0x49')],'waiting':_0x47ca24[_0x638d('0x4d')]};_0xd4cfbd[_0x638d('0x20')](_0x3b4914);}}_0x588a82({'count':_0xd4cfbd['length'],'rows':_0xd4cfbd});});},'ChatQueuesWaitingInteractions':function(_0x2f867b){return new Promise(function(_0x27b5ac,_0x3508a7){var _0xe58c7e=_[_0x638d('0x45')](_0x3ec901['chatQueuesWaitingInteractions']);_0x27b5ac({'count':_0xe58c7e[_0x638d('0x15')],'rows':_0xe58c7e});});},'MailQueuesWaitingInteractions':function(_0x41adb3){return new Promise(function(_0x3fe3a2,_0x10e6ea){var _0x104151=_[_0x638d('0x45')](_0x3ec901[_0x638d('0x51')]);_0x3fe3a2({'count':_0x104151[_0x638d('0x15')],'rows':_0x104151});});},'OpenchannelQueuesWaitingInteractions':function(_0x2644d2){return new Promise(function(_0x48999e,_0x5b4bca){var _0x248bf5=_[_0x638d('0x45')](_0x3ec901[_0x638d('0x52')]);_0x48999e({'count':_0x248bf5['length'],'rows':_0x248bf5});});},'SmsQueuesWaitingInteractions':function(_0xdf60e3){return new Promise(function(_0x3f8998,_0x274938){var _0x309bac=_[_0x638d('0x45')](_0x3ec901['smsQueuesWaitingInteractions']);_0x3f8998({'count':_0x309bac[_0x638d('0x15')],'rows':_0x309bac});});},'FaxQueuesWaitingInteractions':function(_0x9ba812){return new Promise(function(_0x48c7a4,_0x44453b){var _0x36f43d=_['values'](_0x3ec901[_0x638d('0x53')]);_0x48c7a4({'count':_0x36f43d[_0x638d('0x15')],'rows':_0x36f43d});});},'WhatsappQueuesWaitingInteractions':function(_0x575350){return new Promise(function(_0x41c996,_0x36b423){var _0x51cf37=_[_0x638d('0x45')](_0x3ec901[_0x638d('0x54')]);_0x41c996({'count':_0x51cf37[_0x638d('0x15')],'rows':_0x51cf37});});}};var _0x3c070e=jayson[_0x638d('0x55')](_0x57e981)[_0x638d('0x56')]();_0x3c070e['on'](_0x638d('0x2f'),function(_0xa3650d){logger['error'](JSON['stringify'](_0xa3650d));return _0x3f9ef5(_0xa3650d);});_0x3c070e[_0x638d('0x10')](0x232c,_0x638d('0x57'),function(){console[_0x638d('0x58')](_0x638d('0x59'),0x232c);return _0x3e0cb(_0x638d('0x5a')+0x232c);});});}; \ No newline at end of file +var _0xf77d=['dialogflow','appdata','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','waiting','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','length','app','.js','toLowerCase','autoreply','split','mail','push','slice','join'];(function(_0x67539a,_0x48b223){var _0x2bb1ef=function(_0x22b709){while(--_0x22b709){_0x67539a['push'](_0x67539a['shift']());}};_0x2bb1ef(++_0x48b223);}(_0xf77d,0xf4));var _0xdf77=function(_0xd4ec0c,_0x2afcd2){_0xd4ec0c=_0xd4ec0c-0x0;var _0x580218=_0xf77d[_0xd4ec0c];return _0x580218;};'use strict';var _=require(_0xdf77('0x0'));var util=require(_0xdf77('0x1'));var path=require(_0xdf77('0x2'));var fs=require('fs');var jayson=require(_0xdf77('0x3'));var BPromise=require('bluebird');var uuid=require('uuid');var config=require(_0xdf77('0x4'));var logger=require(_0xdf77('0x5'))(_0xdf77('0x6'));var rpc={'openchannelQueueReport':require(_0xdf77('0x7')),'mailQueueReport':require(_0xdf77('0x8')),'chatQueueReport':require(_0xdf77('0x9')),'smsQueueReport':require(_0xdf77('0xa')),'faxQueueReport':require(_0xdf77('0xb')),'whatsappQueueReport':require(_0xdf77('0xc'))};var RuleEngine=require(_0xdf77('0xd'));function getId(_0x2a96e0,_0x3d3c8d,_0x5107de){return util[_0xdf77('0xe')]('%s.%s.%s',_0x2a96e0,_0x3d3c8d||0x0,_0x5107de||0x0);}function getIntervals(_0xc7281a,_0xfb6a37){var _0x68d35f=[];if(!_[_0xdf77('0xf')](_0xfb6a37[_0xdf77('0x10')])&&!_['isNil'](_0xc7281a[_0xfb6a37[_0xdf77('0x10')]])&&!_[_0xdf77('0xf')](_0xc7281a[_0xfb6a37[_0xdf77('0x10')]][_0xdf77('0x11')])){_0x68d35f=_[_0xdf77('0x12')](_0xc7281a[_0xfb6a37[_0xdf77('0x10')]]['Intervals'],_0xdf77('0x13'));}else if(!_[_0xdf77('0xf')](_0xfb6a37[_0xdf77('0x13')])){_0x68d35f=[_0xfb6a37[_0xdf77('0x13')]];}return _0x68d35f;}exports['listen']=function(_0x2475c2){_0x2475c2[_0xdf77('0x14')]={};return new BPromise(function(_0x473b13,_0x441615){var _0x10fc0a={'Start':function(_0x2159ad){var _0x4bde86=this;return new Promise(function(_0x39c3b7,_0x2d9af7){if(_0x2159ad){try{var _0x5c0f68=[];var _0x199afc=getId(_0x2159ad[_0xdf77('0x15')],_0x2159ad[_0xdf77('0x16')]?_0x2159ad[_0xdf77('0x16')]['id']:0x0,_0x2159ad[_0xdf77('0x17')]?_0x2159ad[_0xdf77('0x17')]['id']:0x0);if(_0x2159ad[_0xdf77('0x18')]&&_['isArray'](_0x2159ad[_0xdf77('0x18')])&&_0x2159ad[_0xdf77('0x18')]['length']){for(var _0x47b09b=0x0;_0x47b09b<_0x2159ad['applications'][_0xdf77('0x19')];_0x47b09b+=0x1){var _0x12104c=_0x2159ad[_0xdf77('0x18')][_0x47b09b];if(fs['existsSync'](path['join'](__dirname,_0xdf77('0x18'),_0x12104c[_0xdf77('0x1a')]+_0xdf77('0x1b')))){var _0xde8ad4=[];switch(_0x12104c[_0xdf77('0x1a')][_0xdf77('0x1c')]()){case _0xdf77('0x1d'):var _0x201d33=_0x12104c['appdata'][_0xdf77('0x1e')](',');if(_0x2159ad[_0xdf77('0x15')]===_0xdf77('0x1f')){_0xde8ad4[_0xdf77('0x20')](_0x201d33[0x0]);_0xde8ad4['push'](_0x201d33[0x1]);_0xde8ad4[_0xdf77('0x20')](_0x201d33[_0xdf77('0x21')](0x2,_0x201d33[_0xdf77('0x19')])[_0xdf77('0x22')](','));}else{_0xde8ad4[_0xdf77('0x20')](_0x201d33[0x0]);_0xde8ad4[_0xdf77('0x20')](_0x201d33[_0xdf77('0x21')](0x1,_0x201d33['length'])[_0xdf77('0x22')](','));}break;case _0xdf77('0x23'):var _0x4ddb5b=_0x12104c[_0xdf77('0x24')][_0xdf77('0x1e')](',');_0xde8ad4[_0xdf77('0x20')](_0x4ddb5b[0x0]);_0xde8ad4[_0xdf77('0x20')](_0x4ddb5b[0x1]);_0xde8ad4[_0xdf77('0x20')](_0x4ddb5b[_0xdf77('0x21')](0x2,_0x4ddb5b['length'])['join'](','));break;case _0xdf77('0x25'):var _0x58950d=_0x12104c[_0xdf77('0x24')][_0xdf77('0x1e')](',');_0xde8ad4[_0xdf77('0x20')](_0x58950d[0x0]);_0xde8ad4['push'](_0x58950d[0x1]);_0xde8ad4['push'](_0x58950d[0x2]);_0xde8ad4[_0xdf77('0x20')](_0x58950d[0x3]);_0xde8ad4['push'](_0x58950d[_0xdf77('0x21')](0x4,_0x58950d[_0xdf77('0x19')])[_0xdf77('0x22')](','));break;case _0xdf77('0x26'):var _0x516c53=_0x12104c['appdata'][_0xdf77('0x1e')](',');_0xde8ad4[_0xdf77('0x20')](_0x516c53[0x0]);_0xde8ad4[_0xdf77('0x20')](_0x516c53[0x1]);_0xde8ad4[_0xdf77('0x20')](_0x516c53[0x2]);_0xde8ad4[_0xdf77('0x20')](_0x516c53[0x3]);_0xde8ad4[_0xdf77('0x20')](_0x516c53[_0xdf77('0x21')](0x4,_0x516c53[_0xdf77('0x19')])[_0xdf77('0x22')](','));break;case'message':_0xde8ad4[_0xdf77('0x20')](_0x12104c[_0xdf77('0x24')]);break;case'tag':_0xde8ad4[_0xdf77('0x20')](_0x12104c[_0xdf77('0x27')]);_0xde8ad4['push'](_0x12104c[_0xdf77('0x24')]);break;default:_0xde8ad4=_[_0xdf77('0xf')](_0x12104c[_0xdf77('0x24')])?[]:_0x12104c['appdata'][_0xdf77('0x1e')](',');}var _0x556da0={'id':util[_0xdf77('0xe')](_0xdf77('0x28'),_0x199afc,_0x12104c['id'],_0x12104c[_0xdf77('0x1a')]),'condition':require(_0xdf77('0x29'))[_0xdf77('0x2a')](_0x199afc,getIntervals(_0x2475c2[_0xdf77('0x2b')],_0x12104c),_0x2475c2),'consequence':require(_0xdf77('0x2c')+_0x12104c['app'])[_0xdf77('0x2d')](_0x199afc,_0xde8ad4,_0x2475c2,_0x2159ad),'p':_0x12104c[_0xdf77('0x2e')]||0x0};logger[_0xdf77('0x2f')](_0xdf77('0x30'),_0x556da0['id'],'on\x20interval',getIntervals(_0x2475c2[_0xdf77('0x2b')],_0x12104c)['join']('\x20|\x20'));_0x5c0f68[_0xdf77('0x20')](_0x556da0);}else{logger[_0xdf77('0x31')](_0xdf77('0x32'),path[_0xdf77('0x22')](__dirname,_0xdf77('0x18'),_0x12104c['app']+_0xdf77('0x1b')));}}_0x2475c2[_0xdf77('0x14')][_0x199afc]=new RuleEngine(_0x5c0f68);_0x2475c2['rules'][_0x199afc]['execute'](_0x2159ad,function(_0x146534){logger['info'](_0xdf77('0x33'),JSON[_0xdf77('0x34')](_0x146534['matchPath']));if(_0x2475c2[_0xdf77('0x14')][_0x199afc]){_0x2475c2[_0xdf77('0x14')][_0x199afc][_0xdf77('0x35')](_0xdf77('0x36'));}});return _0x39c3b7({'code':0xc8,'message':_0x2159ad});}else{logger[_0xdf77('0x2f')](_0xdf77('0x37'));return _0x39c3b7({'code':0xc8,'message':_0x2159ad});}}catch(_0xa7f24a){logger['error'](_0xa7f24a[_0xdf77('0x38')]);return _0x2d9af7(_0x4bde86['error'](0x1f4,_0xa7f24a));}}return _0x2d9af7(_0xdf77('0x39'));});},'AcceptMessage':function(_0x229403){var _0x59357f=this;return new Promise(function(_0x324478,_0x4a0e34){if(_0x229403[_0xdf77('0x3a')]&&_0x229403[_0xdf77('0x3a')]['id']){if(_0x2475c2[_0xdf77('0x3b')][_0x229403[_0xdf77('0x3a')]['id']]){_0x2475c2['agents'][_0x229403[_0xdf77('0x3a')]['id']][_0xdf77('0x3c')]=![];_0x2475c2[_0xdf77('0x3b')][_0x229403[_0xdf77('0x3a')]['id']]['busyQueue']=undefined;}}if(_0x229403[_0xdf77('0x16')]&&_0x229403['message']['id']){try{var _0x1346ac=getId(_0x229403[_0xdf77('0x15')],_0x229403['message']?_0x229403['message']['id']:0x0,_0x229403[_0xdf77('0x17')]?_0x229403[_0xdf77('0x17')]['id']:0x0);if(_0x2475c2[_0xdf77('0x14')][_0x1346ac]){_0x2475c2[_0xdf77('0x14')][_0x1346ac][_0xdf77('0x35')](_0xdf77('0x3d'));if(rpc[_0x229403[_0xdf77('0x15')]+_0xdf77('0x3e')]){rpc[_0x229403[_0xdf77('0x15')]+_0xdf77('0x3e')][_0xdf77('0x3f')](_0x1346ac,{'UserId':_0x229403[_0xdf77('0x16')][_0xdf77('0x40')]})[_0xdf77('0x41')](function(_0x12b942){logger[_0xdf77('0x31')](_0xdf77('0x42'));});}}return _0x324478({'code':0xc8,'message':_0x229403});}catch(_0x2f7b65){logger[_0xdf77('0x31')](_0x2f7b65[_0xdf77('0x38')]);return _0x4a0e34(_0x59357f[_0xdf77('0x31')](0x1f4,_0x2f7b65));}}logger['error'](_0xdf77('0x43'));return _0x4a0e34(_0x59357f[_0xdf77('0x31')](0x1f4,_0xdf77('0x43')));});},'RejectMessage':function(_0x471e9c){var _0x2404e5=this;return new Promise(function(_0xf8d1bd,_0x13489d){if(_0x471e9c['agent']&&_0x471e9c[_0xdf77('0x3a')]['id']){try{if(_0x2475c2[_0xdf77('0x3b')][_0x471e9c[_0xdf77('0x3a')]['id']]){_0x2475c2[_0xdf77('0x3b')][_0x471e9c[_0xdf77('0x3a')]['id']][_0xdf77('0x3c')]=![];_0x2475c2[_0xdf77('0x3b')][_0x471e9c[_0xdf77('0x3a')]['id']][_0xdf77('0x44')]=undefined;}return _0xf8d1bd({'code':0xc8,'message':_0x471e9c});}catch(_0x5420f8){logger[_0xdf77('0x31')](_0x5420f8[_0xdf77('0x38')]);return _0x13489d(_0x2404e5[_0xdf77('0x31')](0x1f4,_0x5420f8));}}logger[_0xdf77('0x31')](_0xdf77('0x43'));return _0x13489d(_0x2404e5['error'](0x1f4,_0xdf77('0x43')));});},'AbandonInteraction':function(_0x105aaf){var _0x321aa9=this;return new Promise(function(_0x4260b5,_0x1d3464){if(_0x105aaf[_0xdf77('0x15')]&&_0x105aaf['interaction']&&_0x105aaf[_0xdf77('0x17')]['id']){try{var _0x5403aa=getId(_0x105aaf[_0xdf77('0x15')],_0x105aaf[_0xdf77('0x16')]?_0x105aaf['message']['id']:0x0,_0x105aaf[_0xdf77('0x17')]?_0x105aaf[_0xdf77('0x17')]['id']:0x0);if(_0x2475c2[_0xdf77('0x14')][_0x5403aa]){_0x2475c2[_0xdf77('0x14')][_0x5403aa]['emit'](_0xdf77('0x3d'));}return _0x4260b5({'code':0xc8,'message':_0x105aaf});}catch(_0x29a537){logger['error'](_0x29a537['stack']);return _0x1d3464(_0x321aa9[_0xdf77('0x31')](0x1f4,_0x29a537));}}logger[_0xdf77('0x31')](_0xdf77('0x43'));return _0x1d3464(_0x321aa9[_0xdf77('0x31')](0x1f4,_0xdf77('0x43')));});},'AgentCapacity':function(_0x27a984){var _0xa8c489=this;return new Promise(function(_0x5c8990,_0x579fa7){if(_0x2475c2[_0xdf77('0x3b')]['hasOwnProperty'](_0x27a984['id'])){for(var _0x5a6bd8 in _0x27a984[_0xdf77('0x45')]){if(_0x27a984[_0xdf77('0x45')][_0xdf77('0x46')](_0x5a6bd8)){if(_0x2475c2['agents'][_0x27a984['id']][_0xdf77('0x46')](_0x5a6bd8+'CurrentCapacity')){_0x2475c2[_0xdf77('0x3b')][_0x27a984['id']][_0x5a6bd8+'CurrentCapacity']=parseInt(_0x27a984[_0xdf77('0x45')][_0x5a6bd8],0xa);}}}_0x2475c2[_0xdf77('0x3b')][_0x27a984['id']][_0xdf77('0x47')]();return _0x5c8990({'code':0xc8,'message':_0x2475c2[_0xdf77('0x3b')][_0x27a984['id']]});}else{return _0x579fa7(_0xa8c489[_0xdf77('0x31')](0x1f4,_0xdf77('0x48')));}});},'Agents':function(_0x53508f){return new Promise(function(_0x1cd369,_0x8925d6){var _0x1bd0eb=_[_0xdf77('0x49')](_0x2475c2['agents']);_0x1cd369({'count':_0x1bd0eb['length'],'rows':_0x1bd0eb});});},'ChatQueues':function(_0x47fea3){return new Promise(function(_0x9309fe,_0x13bd8c){var _0x53d1cb=[];for(var _0x3472cb in _0x2475c2[_0xdf77('0x4a')]){if(_0x2475c2['chatQueues']['hasOwnProperty'](_0x3472cb)){var _0x23f44c=_0x2475c2[_0xdf77('0x4a')][_0x3472cb];var _0xd4fd77={'id':_0x23f44c['id'],'available':_0x23f44c[_0xdf77('0x4b')],'loggedIn':_0x23f44c[_0xdf77('0x4c')],'name':_0x23f44c[_0xdf77('0x4d')],'paused':_0x23f44c[_0xdf77('0x4e')],'waiting':_0x23f44c['waiting']};_0x53d1cb[_0xdf77('0x20')](_0xd4fd77);}}_0x9309fe({'count':_0x53d1cb[_0xdf77('0x19')],'rows':_0x53d1cb});});},'MailQueues':function(_0x1ec248){return new Promise(function(_0x13ed34,_0x12d90f){var _0x46432d=[];for(var _0x13ce1b in _0x2475c2['mailQueues']){if(_0x2475c2[_0xdf77('0x4f')][_0xdf77('0x46')](_0x13ce1b)){var _0x348389=_0x2475c2['mailQueues'][_0x13ce1b];var _0x2ace61={'id':_0x348389['id'],'available':_0x348389[_0xdf77('0x4b')],'loggedIn':_0x348389['loggedIn'],'name':_0x348389[_0xdf77('0x4d')],'paused':_0x348389[_0xdf77('0x4e')],'waiting':_0x348389['waiting']};_0x46432d[_0xdf77('0x20')](_0x2ace61);}}_0x13ed34({'count':_0x46432d[_0xdf77('0x19')],'rows':_0x46432d});});},'OpenchannelQueues':function(_0x2262bf){return new Promise(function(_0x541460,_0x290001){var _0x493e60=[];for(var _0x2d2934 in _0x2475c2[_0xdf77('0x50')]){if(_0x2475c2[_0xdf77('0x50')][_0xdf77('0x46')](_0x2d2934)){var _0x5cf216=_0x2475c2[_0xdf77('0x50')][_0x2d2934];var _0xa4041c={'id':_0x5cf216['id'],'available':_0x5cf216[_0xdf77('0x4b')],'loggedIn':_0x5cf216[_0xdf77('0x4c')],'name':_0x5cf216[_0xdf77('0x4d')],'paused':_0x5cf216[_0xdf77('0x4e')],'waiting':_0x5cf216[_0xdf77('0x51')]};_0x493e60[_0xdf77('0x20')](_0xa4041c);}}_0x541460({'count':_0x493e60[_0xdf77('0x19')],'rows':_0x493e60});});},'SmsQueues':function(_0x5bef2e){return new Promise(function(_0x11723a,_0x18c6e9){var _0x45040f=[];for(var _0x2d2fee in _0x2475c2[_0xdf77('0x52')]){if(_0x2475c2['smsQueues'][_0xdf77('0x46')](_0x2d2fee)){var _0x4cc4f3=_0x2475c2[_0xdf77('0x52')][_0x2d2fee];var _0x276bcf={'id':_0x4cc4f3['id'],'available':_0x4cc4f3[_0xdf77('0x4b')],'loggedIn':_0x4cc4f3[_0xdf77('0x4c')],'name':_0x4cc4f3[_0xdf77('0x4d')],'paused':_0x4cc4f3['paused'],'waiting':_0x4cc4f3['waiting']};_0x45040f[_0xdf77('0x20')](_0x276bcf);}}_0x11723a({'count':_0x45040f[_0xdf77('0x19')],'rows':_0x45040f});});},'FaxQueues':function(_0x3895b8){return new Promise(function(_0x4b12ee,_0x3fab24){var _0x100d2c=[];for(var _0x2203a3 in _0x2475c2[_0xdf77('0x53')]){if(_0x2475c2[_0xdf77('0x53')][_0xdf77('0x46')](_0x2203a3)){var _0x2add2b=_0x2475c2[_0xdf77('0x53')][_0x2203a3];var _0x54bf30={'id':_0x2add2b['id'],'available':_0x2add2b[_0xdf77('0x4b')],'loggedIn':_0x2add2b[_0xdf77('0x4c')],'name':_0x2add2b[_0xdf77('0x4d')],'paused':_0x2add2b[_0xdf77('0x4e')],'waiting':_0x2add2b[_0xdf77('0x51')]};_0x100d2c[_0xdf77('0x20')](_0x54bf30);}}_0x4b12ee({'count':_0x100d2c[_0xdf77('0x19')],'rows':_0x100d2c});});},'WhatsappQueues':function(_0x922bec){return new Promise(function(_0x5276c4,_0x947d8b){var _0x52df0d=[];for(var _0x5d33b4 in _0x2475c2[_0xdf77('0x54')]){if(_0x2475c2[_0xdf77('0x54')][_0xdf77('0x46')](_0x5d33b4)){var _0x296007=_0x2475c2[_0xdf77('0x54')][_0x5d33b4];var _0x2ae17e={'id':_0x296007['id'],'available':_0x296007[_0xdf77('0x4b')],'loggedIn':_0x296007[_0xdf77('0x4c')],'name':_0x296007[_0xdf77('0x4d')],'paused':_0x296007[_0xdf77('0x4e')],'waiting':_0x296007[_0xdf77('0x51')]};_0x52df0d[_0xdf77('0x20')](_0x2ae17e);}}_0x5276c4({'count':_0x52df0d[_0xdf77('0x19')],'rows':_0x52df0d});});},'ChatQueuesWaitingInteractions':function(_0x827f49){return new Promise(function(_0x140245,_0x5cac7c){var _0x120bee=_[_0xdf77('0x49')](_0x2475c2['chatQueuesWaitingInteractions']);_0x140245({'count':_0x120bee[_0xdf77('0x19')],'rows':_0x120bee});});},'MailQueuesWaitingInteractions':function(_0x1cd57b){return new Promise(function(_0x41e988,_0x544e60){var _0xefd361=_[_0xdf77('0x49')](_0x2475c2[_0xdf77('0x55')]);_0x41e988({'count':_0xefd361[_0xdf77('0x19')],'rows':_0xefd361});});},'OpenchannelQueuesWaitingInteractions':function(_0x1935a1){return new Promise(function(_0x1f8d83,_0x43b045){var _0x3763ae=_[_0xdf77('0x49')](_0x2475c2['openchannelQueuesWaitingInteractions']);_0x1f8d83({'count':_0x3763ae[_0xdf77('0x19')],'rows':_0x3763ae});});},'SmsQueuesWaitingInteractions':function(_0x4018b7){return new Promise(function(_0x3720c8,_0x18a22b){var _0x1891f0=_[_0xdf77('0x49')](_0x2475c2[_0xdf77('0x56')]);_0x3720c8({'count':_0x1891f0[_0xdf77('0x19')],'rows':_0x1891f0});});},'FaxQueuesWaitingInteractions':function(_0x17bdc4){return new Promise(function(_0x1d79c2,_0x19ac4e){var _0x131905=_[_0xdf77('0x49')](_0x2475c2['faxQueuesWaitingInteractions']);_0x1d79c2({'count':_0x131905[_0xdf77('0x19')],'rows':_0x131905});});},'WhatsappQueuesWaitingInteractions':function(_0x5da19e){return new Promise(function(_0x59cb34,_0x49759e){var _0x1958a0=_['values'](_0x2475c2[_0xdf77('0x57')]);_0x59cb34({'count':_0x1958a0['length'],'rows':_0x1958a0});});}};var _0x5506e4=jayson[_0xdf77('0x58')](_0x10fc0a)['http']();_0x5506e4['on'](_0xdf77('0x31'),function(_0x5c6154){logger[_0xdf77('0x31')](JSON[_0xdf77('0x34')](_0x5c6154));return _0x441615(_0x5c6154);});_0x5506e4['listen'](0x232c,_0xdf77('0x59'),function(){console[_0xdf77('0x5a')](_0xdf77('0x5b'),0x232c);return _0x473b13(_0xdf77('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 e33de6a..1f3468c 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 _0x06ac=['[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','rules','length','push','Command','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','info'];(function(_0x257124,_0x4276b3){var _0x27f118=function(_0x4ad0a8){while(--_0x4ad0a8){_0x257124['push'](_0x257124['shift']());}};_0x27f118(++_0x4276b3);}(_0x06ac,0x1d8));var _0xc06a=function(_0x438c88,_0x85b0a3){_0x438c88=_0x438c88-0x0;var _0x5e403a=_0x06ac[_0x438c88];return _0x5e403a;};'use strict';var util=require(_0xc06a('0x0'));var BPromise=require('bluebird');var jayson=require(_0xc06a('0x1'));var _=require(_0xc06a('0x2'));var logger=require(_0xc06a('0x3'))(_0xc06a('0x4'));var client=jayson[_0xc06a('0x5')][_0xc06a('0x6')]({'port':0x232a});function request(_0x54cc08,_0x143a9f){return new BPromise(function(_0x251309,_0x8b39f2){return client[_0xc06a('0x7')](_0x54cc08,_0x143a9f)[_0xc06a('0x8')](function(_0x146dad){if(_0x146dad['error']){return _0x8b39f2(_0x146dad[_0xc06a('0x9')][_0xc06a('0xa')]);}else{return _0x251309(_0x146dad[_0xc06a('0xb')]);}})[_0xc06a('0xc')](function(_0x523b74){return _0x8b39f2(_0x523b74);});});}exports['condition']=function(_0xccb60e,_0x8683da,_0x3f5ae7){return function(_0x4cdcf5){if(_0x3f5ae7[_0xc06a('0xd')]&&!_0x3f5ae7[_0xc06a('0xd')][_0xccb60e]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0xccb60e);return _0x4cdcf5['stop']();}var _0x1b1cb2=[];for(var _0x3c2290=0x0;_0x3c2290<_0x8683da[_0xc06a('0xe')];_0x3c2290+=0x1){_0x1b1cb2[_0xc06a('0xf')](request(_0xc06a('0x10'),{'command':util[_0xc06a('0x11')](_0xc06a('0x12'),_0x8683da[_0x3c2290])})['then'](function(_0x3831e3){return _0x3831e3&&_0x3831e3['message']&&_0x3831e3[_0xc06a('0xa')][_0xc06a('0x13')]('true')>=0x0?!![]:![];})[_0xc06a('0xc')](function(_0x30296f){logger[_0xc06a('0x9')](_0xc06a('0x14'),_0xccb60e,_0x8683da[_0x3c2290]);}));}BPromise[_0xc06a('0x15')](_0x1b1cb2)[_0xc06a('0x8')](function(_0x51f556){var _0x427b3f=_[_0xc06a('0x16')](_0x51f556);logger[_0xc06a('0x17')](_0xc06a('0x18'),_0xccb60e,_0x8683da[_0xc06a('0x19')](_0xc06a('0x1a')),_0x427b3f);_0x4cdcf5[_0xc06a('0x1b')](_0x427b3f);})['catch'](function(_0x35e333){console[_0xc06a('0x1c')](_0x35e333);logger[_0xc06a('0x9')](_0xc06a('0x18'),_0xccb60e,_0x8683da['join'](_0xc06a('0x1a')),_0x35e333[_0xc06a('0x1d')]);_0x4cdcf5[_0xc06a('0x1e')]();});};}; \ No newline at end of file +var _0x7ced=['stack','util','jayson/promise','routing','client','http','request','then','error','catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','message','indexOf','true','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when'];(function(_0x184d45,_0x3fcc0b){var _0x24121d=function(_0x18980f){while(--_0x18980f){_0x184d45['push'](_0x184d45['shift']());}};_0x24121d(++_0x3fcc0b);}(_0x7ced,0x1ef));var _0xd7ce=function(_0x25701b,_0x2a6976){_0x25701b=_0x25701b-0x0;var _0x3a8a2c=_0x7ced[_0x25701b];return _0x3a8a2c;};'use strict';var util=require(_0xd7ce('0x0'));var BPromise=require('bluebird');var jayson=require(_0xd7ce('0x1'));var _=require('lodash');var logger=require('../../../config/logger')(_0xd7ce('0x2'));var client=jayson[_0xd7ce('0x3')][_0xd7ce('0x4')]({'port':0x232a});function request(_0x145dbf,_0x19e331){return new BPromise(function(_0x18e9fd,_0x1a42b5){return client[_0xd7ce('0x5')](_0x145dbf,_0x19e331)[_0xd7ce('0x6')](function(_0x49f181){if(_0x49f181['error']){return _0x1a42b5(_0x49f181[_0xd7ce('0x7')]['message']);}else{return _0x18e9fd(_0x49f181['result']);}})[_0xd7ce('0x8')](function(_0x374502){return _0x1a42b5(_0x374502);});});}exports[_0xd7ce('0x9')]=function(_0xe3aee4,_0x162369,_0x114671){return function(_0x28d030){if(_0x114671['rules']&&!_0x114671['rules'][_0xe3aee4]){logger[_0xd7ce('0xa')](_0xd7ce('0xb'),_0xe3aee4);return _0x28d030[_0xd7ce('0xc')]();}var _0x40ea14=[];for(var _0x277ec7=0x0;_0x277ec7<_0x162369[_0xd7ce('0xd')];_0x277ec7+=0x1){_0x40ea14[_0xd7ce('0xe')](request(_0xd7ce('0xf'),{'command':util[_0xd7ce('0x10')]('iftime\x20%s',_0x162369[_0x277ec7])})['then'](function(_0x5c77c7){return _0x5c77c7&&_0x5c77c7[_0xd7ce('0x11')]&&_0x5c77c7[_0xd7ce('0x11')][_0xd7ce('0x12')](_0xd7ce('0x13'))>=0x0?!![]:![];})[_0xd7ce('0x8')](function(_0x4accca){logger[_0xd7ce('0x7')]('[%s][INTERVAL]\x20%s',_0xe3aee4,_0x162369[_0x277ec7]);}));}BPromise['all'](_0x40ea14)[_0xd7ce('0x6')](function(_0x1bba69){var _0x5a6941=_[_0xd7ce('0x14')](_0x1bba69);logger[_0xd7ce('0xa')](_0xd7ce('0x15'),_0xe3aee4,_0x162369[_0xd7ce('0x16')](_0xd7ce('0x17')),_0x5a6941);_0x28d030[_0xd7ce('0x18')](_0x5a6941);})[_0xd7ce('0x8')](function(_0x7f9c7e){console['log'](_0x7f9c7e);logger[_0xd7ce('0x7')]('[%s][INTERVAL]\x20%s\x20%s',_0xe3aee4,_0x162369['join']('\x20|\x20'),_0x7f9c7e[_0xd7ce('0x19')]);_0x28d030['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index fb39adf..3870654 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 _0xb469=['agentringnoanswerAt','timeout','holdtime','ringtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','ATTENDED','transfereeuniqueid','agententerreason','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','splice','diffTime','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','format','uniqueid','channel','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout'];(function(_0x30a109,_0x2e4bd5){var _0x31b40b=function(_0x394997){while(--_0x394997){_0x30a109['push'](_0x30a109['shift']());}};_0x31b40b(++_0x2e4bd5);}(_0xb469,0x13b));var _0x9b46=function(_0x33eeb9,_0x137b25){_0x33eeb9=_0x33eeb9-0x0;var _0x4b05bf=_0xb469[_0x33eeb9];return _0x4b05bf;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var utils=require(_0x9b46('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34f477,_0x1a41e8){utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34f477[_0x9b46('0x5')],_0x34f477[_0x9b46('0x6')],_0x34f477['queue'],_0x34f477[_0x9b46('0x7')],_0x34f477[_0x9b46('0x8')],_0x34f477['calleridnum'],_0x34f477[_0x9b46('0x9')],_0x34f477['lastevent']));if(_0x34f477['queue']){utils[_0x9b46('0xa')](_0x34f477['queue'])[_0x9b46('0xb')](function(_0xb9d1b5){if(_0xb9d1b5){_0x34f477[_0x9b46('0xc')]=_0xb9d1b5['type'];_0x34f477[_0x9b46('0xd')]=_0x34f477['agentcomplete']?_0xb9d1b5[_0x9b46('0xe')]:![];_0x34f477['acwtime']=_0x34f477[_0x9b46('0xd')]?_0xb9d1b5['acwTimeout']:0x0;}utils[_0x9b46('0xf')](_0x9b46('0x10'),_0x34f477);});}else{utils['request'](_0x9b46('0x10'),_0x34f477);}if(_0x1a41e8){delete transfers[_0x34f477[_0x9b46('0x5')]];}else{delete agents[_0x34f477['destuniqueid']];}}exports[_0x9b46('0x11')]=function(_0x2cfb35){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0x2cfb35);agents[_0x2cfb35[_0x9b46('0x14')]]=_0x2cfb35;agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();agents[_0x2cfb35[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x18');agents[_0x2cfb35['destuniqueid']]['connectedlinenum']=null;agents[_0x2cfb35['destuniqueid']][_0x9b46('0x19')]=null;utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2cfb35['uniqueid'],agents[_0x2cfb35[_0x9b46('0x14')]]['membername'],_0x2cfb35['destuniqueid']));}catch(_0xfeb1b9){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x13'),_0x2cfb35[_0x9b46('0x5')]),_0xfeb1b9);}};exports['agentringnoanswer']=function(_0x55aece){try{if(!_[_0x9b46('0x1b')](agents[_0x55aece[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util['format']('[%s][agents][agentringnoanswer]',_0x55aece[_0x9b46('0x5')]),_0x55aece);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x1c'),_0x55aece['uniqueid'],agents[_0x55aece[_0x9b46('0x14')]]['membername'],_0x55aece[_0x9b46('0x14')]));agents[_0x55aece[_0x9b46('0x14')]]['agentringnoanswer']=!![];agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x17')]=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]]['reason']=_0x9b46('0x1e');agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x1f')]=_0x55aece[_0x9b46('0x20')]?parseInt(_0x55aece[_0x9b46('0x20')])/0x3e8:0x0;agents[_0x55aece[_0x9b46('0x14')]][_0x9b46('0x21')]=0x0;unanswered['push'](_0x55aece[_0x9b46('0x14')]);}}catch(_0xee519e){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x22'),_0x55aece[_0x9b46('0x5')]),_0xee519e);}};exports[_0x9b46('0x23')]=function(_0x17ba3d){try{_[_0x9b46('0x24')](agents,function(_0x20090a,_0x2e1c51){if(_0x20090a['uniqueid']==_0x17ba3d[_0x9b46('0x5')]&&!_[_0x9b46('0x25')](unanswered,_0x20090a[_0x9b46('0x14')])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x17ba3d);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x27'),_0x17ba3d[_0x9b46('0x5')],_0x20090a['membername'],_0x20090a[_0x9b46('0x14')]));_0x20090a['agentringnoanswer']=!![];_0x20090a[_0x9b46('0x1d')]=utils[_0x9b46('0x16')]();_0x20090a[_0x9b46('0x17')]='abandoned';_0x20090a[_0x9b46('0x28')]=_0x9b46('0x29');_0x20090a[_0x9b46('0x1f')]=_0x17ba3d[_0x9b46('0x1f')];_0x20090a[_0x9b46('0x21')]=0x0;writeDB(_0x20090a);}});}catch(_0x5cb73f){utils['error'](util[_0x9b46('0x4')](_0x9b46('0x26'),_0x17ba3d[_0x9b46('0x5')]),_0x5cb73f);}};exports[_0x9b46('0x2a')]=function(_0x4fa731){try{if(agents[_0x4fa731[_0x9b46('0x14')]]){utils['debug'](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x4fa731);utils[_0x9b46('0x3')](util['format'](_0x9b46('0x2c'),_0x4fa731['uniqueid'],agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x7')],_0x4fa731[_0x9b46('0x14')]));agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x9')]=_0x4fa731[_0x9b46('0x9')];agents[_0x4fa731[_0x9b46('0x14')]][_0x9b46('0x19')]=_0x4fa731['connectedlinename'];agents[_0x4fa731[_0x9b46('0x14')]]['holdtime']=_0x4fa731[_0x9b46('0x20')];agents[_0x4fa731[_0x9b46('0x14')]]['lastevent']=_0x9b46('0x2e');_['forIn'](agents,function(_0x416538,_0x493b0f){if(_0x416538[_0x9b46('0x14')]!=_0x4fa731[_0x9b46('0x14')]&&_0x416538[_0x9b46('0x5')]==_0x4fa731[_0x9b46('0x5')]){_0x416538[_0x9b46('0x21')]=0x0;_0x416538['holdtime']=_0x4fa731['ringtime'];_0x416538[_0x9b46('0x2f')]=!![];_0x416538['agentringnoanswerAt']=utils['now']();_0x416538['lastevent']='answered_elsewhere';_0x416538[_0x9b46('0x28')]='answered_elsewhere';_0x416538[_0x9b46('0x30')]=_0x4fa731['destuniqueid'];_0x416538[_0x9b46('0x31')]=_0x4fa731[_0x9b46('0x7')];writeDB(_0x416538);}});}}catch(_0x2e92aa){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x2b'),_0x4fa731[_0x9b46('0x5')]),_0x2e92aa);}};exports[_0x9b46('0x32')]=function(_0x148d86){try{if(!_['isNil'](agents[_0x148d86[_0x9b46('0x14')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x148d86);utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x34'),_0x148d86[_0x9b46('0x5')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x7')],_0x148d86[_0x9b46('0x14')]));agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x32')]=!![];agents[_0x148d86['destuniqueid']]['agentcompleteAt']=utils[_0x9b46('0x16')]();agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x21')]=utils['diffTime'](agents[_0x148d86['destuniqueid']][_0x9b46('0x35')],agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x2d')]);agents[_0x148d86[_0x9b46('0x14')]][_0x9b46('0x28')]=_0x148d86[_0x9b46('0x28')];agents[_0x148d86['destuniqueid']][_0x9b46('0x17')]=_0x9b46('0x36');writeDB(agents[_0x148d86[_0x9b46('0x14')]]);}}catch(_0x47a938){utils[_0x9b46('0x1a')](util['format'](_0x9b46('0x33'),_0x148d86[_0x9b46('0x5')]),_0x47a938);}};exports[_0x9b46('0x37')]=function(_0x566bad){try{if(!_[_0x9b46('0x1b')](agents[_0x566bad[_0x9b46('0x38')]])){utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x566bad);utils['info'](util[_0x9b46('0x4')](_0x9b46('0x3a'),_0x566bad[_0x9b46('0x5')],agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x7')],agents[_0x566bad[_0x9b46('0x38')]]['uniqueid']));agents[_0x566bad[_0x9b46('0x38')]]['transfer']=!![];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3b')]=_0x9b46('0x3c');agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3d')]=_0x566bad['extension'];agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x3e')]=agents[_0x566bad[_0x9b46('0x38')]][_0x9b46('0x5')];}}catch(_0x3f6b2f){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x39'),_0x566bad[_0x9b46('0x5')]),_0x3f6b2f);}};exports[_0x9b46('0x3f')]=function(_0x2f411f){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f[_0x9b46('0x40')]),_0x2f411f);if(_0x2f411f['origtransfereruniqueid']==_0x2f411f[_0x9b46('0x41')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x42')]])){utils['info'](util[_0x9b46('0x4')](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x7')]));agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x44')]=!![];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3b')]=_0x9b46('0x45');agents[_0x2f411f[_0x9b46('0x42')]]['transferexten']=_0x2f411f['origtransfererexten'];agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x40')];}if(_0x2f411f[_0x9b46('0x46')]&&agents[_0x2f411f[_0x9b46('0x46')]]){agents[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x47')]=0x1;transfers[_0x2f411f[_0x9b46('0x46')]]=_['clone'](agents[_0x2f411f[_0x9b46('0x46')]]);transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x48')]=agents[_0x2f411f['secondtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x42')]][_0x9b46('0x49')];transfers[_0x2f411f[_0x9b46('0x46')]]['agentcalledAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x2d')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x46')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f['transfereeuniqueid']][_0x9b46('0x47')]=0x2;}}else if(_0x2f411f['secondtransfereruniqueid']==_0x2f411f[_0x9b46('0x4a')]){if(!_['isNil'](agents[_0x2f411f[_0x9b46('0x40')]])){utils[_0x9b46('0x3')](util['format'](_0x9b46('0x43'),_0x2f411f[_0x9b46('0x40')],agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x7')]));agents[_0x2f411f[_0x9b46('0x40')]]['transfer']=!![];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3b')]='ATTENDED';agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x3d')]=_0x2f411f[_0x9b46('0x4b')];agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x3e')]=_0x2f411f[_0x9b46('0x42')];}if(_0x2f411f[_0x9b46('0x4c')]&&agents[_0x2f411f[_0x9b46('0x4c')]]){agents[_0x2f411f[_0x9b46('0x4c')]]['agententerreason']=0x1;transfers[_0x2f411f['transfertargetuniqueid']]=_[_0x9b46('0x4d')](agents[_0x2f411f[_0x9b46('0x4c')]]);transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x48')]=agents[_0x2f411f['origtransfereruniqueid']][_0x9b46('0x48')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x49')]=agents[_0x2f411f[_0x9b46('0x40')]][_0x9b46('0x49')];transfers[_0x2f411f['transfertargetuniqueid']][_0x9b46('0x15')]=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]]['agentconnectAt']=utils[_0x9b46('0x16')]();transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x1f')]=0x0;transfers[_0x2f411f[_0x9b46('0x4c')]][_0x9b46('0x47')]=0x2;}}}catch(_0x4e8756){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x2f411f['origtransfereruniqueid']),_0x4e8756);}};exports[_0x9b46('0x4e')]=function(_0x200607){try{utils[_0x9b46('0x12')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x200607);if(agents[_0x200607[_0x9b46('0x5')]]&&agents[_0x200607[_0x9b46('0x5')]]['reason']===_0x9b46('0x1e')){if(_0x200607[_0x9b46('0x50')]==='21'){agents[_0x200607['uniqueid']][_0x9b46('0x28')]='rejected';agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x51');}utils[_0x9b46('0x3')](util[_0x9b46('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]]['membername'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']]['lastevent']));writeDB(agents[_0x200607['uniqueid']]);var _0x2978aa=unanswered['indexOf'](_0x200607['uniqueid']);if(_0x2978aa>-0x1){unanswered[_0x9b46('0x52')](_0x2978aa,0x1);}}if(transfers[_0x200607[_0x9b46('0x5')]]){transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];transfers[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();transfers[_0x200607[_0x9b46('0x5')]]['talktime']=utils['diffTime'](transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x35')],transfers[_0x200607[_0x9b46('0x5')]]['agentconnectAt']);transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')]='agent';transfers[_0x200607[_0x9b46('0x5')]][_0x9b46('0x17')]=_0x9b46('0x36');utils[_0x9b46('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x200607[_0x9b46('0x5')],transfers[_0x200607['uniqueid']][_0x9b46('0x7')],transfers[_0x200607[_0x9b46('0x5')]]['reason'],transfers[_0x200607['uniqueid']]['lastevent']));writeDB(transfers[_0x200607[_0x9b46('0x5')]],!![]);}if(agents[_0x200607['uniqueid']]&&agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x2d')]){agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x32')]=!![];agents[_0x200607['uniqueid']][_0x9b46('0x35')]=utils[_0x9b46('0x16')]();agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x21')]=utils[_0x9b46('0x53')](agents[_0x200607['uniqueid']][_0x9b46('0x35')],agents[_0x200607['uniqueid']][_0x9b46('0x2d')]);agents[_0x200607[_0x9b46('0x5')]]['reason']=agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x44')]?_0x9b46('0x44'):_0x9b46('0x54');agents[_0x200607['uniqueid']][_0x9b46('0x17')]='complete';utils[_0x9b46('0x3')](util[_0x9b46('0x4')](_0x9b46('0x55'),_0x200607['uniqueid'],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x7')],agents[_0x200607[_0x9b46('0x5')]][_0x9b46('0x28')],agents[_0x200607['uniqueid']][_0x9b46('0x17')]));writeDB(agents[_0x200607['uniqueid']]);}}catch(_0x420d61){utils[_0x9b46('0x1a')](util[_0x9b46('0x4')](_0x9b46('0x4f'),_0x200607[_0x9b46('0x5')]),_0x420d61);}}; \ No newline at end of file +var _0x087b=['calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','diffTime','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentringnoanswer]','agentringnoanswerAt','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','isNil','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone'];(function(_0x31824d,_0x442ea7){var _0x56aa86=function(_0x2b1890){while(--_0x2b1890){_0x31824d['push'](_0x31824d['shift']());}};_0x56aa86(++_0x442ea7);}(_0x087b,0x11a));var _0xb087=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x087b[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5f3606,_0x40e6d6){utils['info'](util[_0xb087('0x2')](_0xb087('0x3'),_0x5f3606[_0xb087('0x4')],_0x5f3606[_0xb087('0x5')],_0x5f3606[_0xb087('0x6')],_0x5f3606[_0xb087('0x7')],_0x5f3606[_0xb087('0x8')],_0x5f3606[_0xb087('0x9')],_0x5f3606[_0xb087('0xa')],_0x5f3606[_0xb087('0xb')]));if(_0x5f3606[_0xb087('0x6')]){utils[_0xb087('0xc')](_0x5f3606[_0xb087('0x6')])[_0xb087('0xd')](function(_0x2f14bc){if(_0x2f14bc){_0x5f3606[_0xb087('0xe')]=_0x2f14bc[_0xb087('0xe')];_0x5f3606['agentacw']=_0x5f3606[_0xb087('0xf')]?_0x2f14bc[_0xb087('0x10')]:![];_0x5f3606[_0xb087('0x11')]=_0x5f3606[_0xb087('0x12')]?_0x2f14bc[_0xb087('0x13')]:0x0;}utils[_0xb087('0x14')](_0xb087('0x15'),_0x5f3606);});}else{utils['request'](_0xb087('0x15'),_0x5f3606);}if(_0x40e6d6){delete transfers[_0x5f3606[_0xb087('0x4')]];}else{delete agents[_0x5f3606[_0xb087('0x16')]];}}exports['agentcalled']=function(_0x3001e3){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3[_0xb087('0x4')]),_0x3001e3);agents[_0x3001e3[_0xb087('0x16')]]=_0x3001e3;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x19')]=utils[_0xb087('0x1a')]();agents[_0x3001e3[_0xb087('0x16')]]['lastevent']=_0xb087('0x1b');agents[_0x3001e3[_0xb087('0x16')]]['connectedlinenum']=null;agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x1c')]=null;utils[_0xb087('0x1d')](util['format'](_0xb087('0x1e'),_0x3001e3[_0xb087('0x4')],agents[_0x3001e3[_0xb087('0x16')]][_0xb087('0x7')],_0x3001e3['destuniqueid']));}catch(_0x13d534){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x18'),_0x3001e3['uniqueid']),_0x13d534);}};exports['agentringnoanswer']=function(_0x5ea3dc){try{if(!_['isNil'](agents[_0x5ea3dc[_0xb087('0x16')]])){utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc[_0xb087('0x4')]),_0x5ea3dc);utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5ea3dc[_0xb087('0x4')],agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x7')],_0x5ea3dc[_0xb087('0x16')]));agents[_0x5ea3dc[_0xb087('0x16')]]['agentringnoanswer']=!![];agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x21')]=utils['now']();agents[_0x5ea3dc['destuniqueid']]['lastevent']='timeout';agents[_0x5ea3dc['destuniqueid']][_0xb087('0x22')]=_0xb087('0x23');agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x24')]=_0x5ea3dc[_0xb087('0x25')]?parseInt(_0x5ea3dc[_0xb087('0x25')])/0x3e8:0x0;agents[_0x5ea3dc[_0xb087('0x16')]][_0xb087('0x26')]=0x0;unanswered[_0xb087('0x27')](_0x5ea3dc[_0xb087('0x16')]);}}catch(_0x18058c){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x20'),_0x5ea3dc['uniqueid']),_0x18058c);}};exports[_0xb087('0x28')]=function(_0x1335d9){try{_[_0xb087('0x29')](agents,function(_0x15c9ac,_0x22d441){if(_0x15c9ac[_0xb087('0x4')]==_0x1335d9[_0xb087('0x4')]&&!_[_0xb087('0x2a')](unanswered,_0x15c9ac['destuniqueid'])){utils['debug'](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9['uniqueid']),_0x1335d9);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x2c'),_0x1335d9[_0xb087('0x4')],_0x15c9ac[_0xb087('0x7')],_0x15c9ac[_0xb087('0x16')]));_0x15c9ac[_0xb087('0x2d')]=!![];_0x15c9ac[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0x15c9ac[_0xb087('0xb')]=_0xb087('0x2e');_0x15c9ac[_0xb087('0x22')]='abandoned';_0x15c9ac[_0xb087('0x24')]=_0x1335d9['holdtime'];_0x15c9ac[_0xb087('0x26')]=0x0;writeDB(_0x15c9ac);}});}catch(_0x296e9b){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x2b'),_0x1335d9[_0xb087('0x4')]),_0x296e9b);}};exports[_0xb087('0x2f')]=function(_0x29df58){try{if(agents[_0x29df58[_0xb087('0x16')]]){utils['debug'](util['format'](_0xb087('0x30'),_0x29df58[_0xb087('0x4')]),_0x29df58);utils[_0xb087('0x1d')](util[_0xb087('0x2')](_0xb087('0x31'),_0x29df58['uniqueid'],agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x7')],_0x29df58['destuniqueid']));agents[_0x29df58['destuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();agents[_0x29df58[_0xb087('0x16')]]['connectedlinenum']=_0x29df58[_0xb087('0xa')];agents[_0x29df58[_0xb087('0x16')]][_0xb087('0x1c')]=_0x29df58[_0xb087('0x1c')];agents[_0x29df58[_0xb087('0x16')]]['holdtime']=_0x29df58[_0xb087('0x25')];agents[_0x29df58['destuniqueid']][_0xb087('0xb')]='connect';_[_0xb087('0x29')](agents,function(_0xc9f9e9,_0x513332){if(_0xc9f9e9[_0xb087('0x16')]!=_0x29df58['destuniqueid']&&_0xc9f9e9[_0xb087('0x4')]==_0x29df58['uniqueid']){_0xc9f9e9[_0xb087('0x26')]=0x0;_0xc9f9e9[_0xb087('0x24')]=_0x29df58[_0xb087('0x25')];_0xc9f9e9[_0xb087('0x2d')]=!![];_0xc9f9e9[_0xb087('0x21')]=utils[_0xb087('0x1a')]();_0xc9f9e9[_0xb087('0xb')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x22')]='answered_elsewhere';_0xc9f9e9[_0xb087('0x33')]=_0x29df58[_0xb087('0x16')];_0xc9f9e9['answeredelsewheremembername']=_0x29df58[_0xb087('0x7')];writeDB(_0xc9f9e9);}});}}catch(_0x45dc6f){utils[_0xb087('0x1f')](util['format'](_0xb087('0x30'),_0x29df58['uniqueid']),_0x45dc6f);}};exports[_0xb087('0xf')]=function(_0x32b9d3){try{if(!_['isNil'](agents[_0x32b9d3[_0xb087('0x16')]])){utils[_0xb087('0x17')](util['format'](_0xb087('0x34'),_0x32b9d3[_0xb087('0x4')]),_0x32b9d3);utils['info'](util[_0xb087('0x2')](_0xb087('0x35'),_0x32b9d3[_0xb087('0x4')],agents[_0x32b9d3[_0xb087('0x16')]]['membername'],_0x32b9d3['destuniqueid']));agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0xf')]=!![];agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x36')]=utils[_0xb087('0x1a')]();agents[_0x32b9d3[_0xb087('0x16')]]['talktime']=utils['diffTime'](agents[_0x32b9d3[_0xb087('0x16')]]['agentcompleteAt'],agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x32')]);agents[_0x32b9d3[_0xb087('0x16')]][_0xb087('0x22')]=_0x32b9d3['reason'];agents[_0x32b9d3[_0xb087('0x16')]]['lastevent']=_0xb087('0x37');writeDB(agents[_0x32b9d3[_0xb087('0x16')]]);}}catch(_0xcb56c7){utils[_0xb087('0x1f')](util[_0xb087('0x2')]('[%s][agents][agentcomplete]',_0x32b9d3[_0xb087('0x4')]),_0xcb56c7);}};exports[_0xb087('0x38')]=function(_0x588d96){try{if(!_['isNil'](agents[_0x588d96[_0xb087('0x39')]])){utils['debug'](util['format'](_0xb087('0x3a'),_0x588d96[_0xb087('0x4')]),_0x588d96);utils['info'](util[_0xb087('0x2')](_0xb087('0x3b'),_0x588d96[_0xb087('0x4')],agents[_0x588d96['transfereruniqueid']]['membername'],agents[_0x588d96[_0xb087('0x39')]]['uniqueid']));agents[_0x588d96['transfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3d')]=_0xb087('0x3e');agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x3f')]=_0x588d96[_0xb087('0x40')];agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x41')]=agents[_0x588d96[_0xb087('0x39')]][_0xb087('0x4')];}}catch(_0x2cfc44){utils['error'](util[_0xb087('0x2')](_0xb087('0x3a'),_0x588d96['uniqueid']),_0x2cfc44);}};exports[_0xb087('0x42')]=function(_0x458301){try{utils[_0xb087('0x17')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x458301);if(_0x458301[_0xb087('0x44')]==_0x458301[_0xb087('0x45')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x47')]])){utils[_0xb087('0x1d')](util['format'](_0xb087('0x48'),_0x458301['origtransfereruniqueid'],agents[_0x458301[_0xb087('0x47')]]['membername']));agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3c')]=!![];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3d')]=_0xb087('0x49');agents[_0x458301[_0xb087('0x47')]][_0xb087('0x3f')]=_0x458301[_0xb087('0x4a')];agents[_0x458301[_0xb087('0x47')]][_0xb087('0x41')]=_0x458301[_0xb087('0x44')];}if(_0x458301[_0xb087('0x4b')]&&agents[_0x458301[_0xb087('0x4b')]]){agents[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x1;transfers[_0x458301[_0xb087('0x4b')]]=_[_0xb087('0x4d')](agents[_0x458301[_0xb087('0x4b')]]);transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x9')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x9')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x47')]][_0xb087('0x4e')];transfers[_0x458301['transfereeuniqueid']][_0xb087('0x19')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfereeuniqueid']][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301[_0xb087('0x4b')]]['holdtime']=0x0;transfers[_0x458301[_0xb087('0x4b')]][_0xb087('0x4c')]=0x2;}}else if(_0x458301[_0xb087('0x47')]==_0x458301[_0xb087('0x4f')]){if(!_[_0xb087('0x46')](agents[_0x458301[_0xb087('0x44')]])){utils[_0xb087('0x1d')](util[_0xb087('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x458301[_0xb087('0x44')],agents[_0x458301[_0xb087('0x44')]][_0xb087('0x7')]));agents[_0x458301['origtransfereruniqueid']][_0xb087('0x3c')]=!![];agents[_0x458301['origtransfereruniqueid']]['transfertype']=_0xb087('0x49');agents[_0x458301[_0xb087('0x44')]]['transferexten']=_0x458301[_0xb087('0x50')];agents[_0x458301['origtransfereruniqueid']][_0xb087('0x41')]=_0x458301[_0xb087('0x47')];}if(_0x458301['transfertargetuniqueid']&&agents[_0x458301['transfertargetuniqueid']]){agents[_0x458301[_0xb087('0x51')]]['agententerreason']=0x1;transfers[_0x458301['transfertargetuniqueid']]=_[_0xb087('0x4d')](agents[_0x458301['transfertargetuniqueid']]);transfers[_0x458301[_0xb087('0x51')]]['calleridnum']=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x9')];transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x4e')]=agents[_0x458301[_0xb087('0x44')]][_0xb087('0x4e')];transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x19')]=utils['now']();transfers[_0x458301[_0xb087('0x51')]][_0xb087('0x32')]=utils[_0xb087('0x1a')]();transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x24')]=0x0;transfers[_0x458301['transfertargetuniqueid']][_0xb087('0x4c')]=0x2;}}}catch(_0x3784f7){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x43'),_0x458301[_0xb087('0x44')]),_0x3784f7);}};exports['hangup']=function(_0x245d68){try{utils[_0xb087('0x17')](util['format'](_0xb087('0x52'),_0x245d68['uniqueid']),_0x245d68);if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]===_0xb087('0x23')){if(_0x245d68[_0xb087('0x53')]==='21'){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x54');agents[_0x245d68['uniqueid']]['lastevent']='rejected';}utils[_0xb087('0x1d')](util['format'](_0xb087('0x55'),_0x245d68['uniqueid'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],agents[_0x245d68['uniqueid']][_0xb087('0xb')]));writeDB(agents[_0x245d68['uniqueid']]);var _0x185102=unanswered[_0xb087('0x56')](_0x245d68[_0xb087('0x4')]);if(_0x185102>-0x1){unanswered[_0xb087('0x57')](_0x185102,0x1);}}if(transfers[_0x245d68['uniqueid']]){transfers[_0x245d68['uniqueid']][_0xb087('0xf')]=!![];transfers[_0x245d68['uniqueid']][_0xb087('0x36')]=utils[_0xb087('0x1a')]();transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils['diffTime'](transfers[_0x245d68['uniqueid']][_0xb087('0x36')],transfers[_0x245d68['uniqueid']][_0xb087('0x32')]);transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=_0xb087('0x58');transfers[_0x245d68[_0xb087('0x4')]]['lastevent']=_0xb087('0x37');utils[_0xb087('0x1d')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x245d68['uniqueid'],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')],transfers[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(transfers[_0x245d68['uniqueid']],!![]);}if(agents[_0x245d68[_0xb087('0x4')]]&&agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x32')]){agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xf')]=!![];agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x36')]=utils['now']();agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x26')]=utils[_0xb087('0x59')](agents[_0x245d68['uniqueid']][_0xb087('0x36')],agents[_0x245d68['uniqueid']][_0xb087('0x32')]);agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x22')]=agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x3c')]?_0xb087('0x3c'):'agent';agents[_0x245d68['uniqueid']][_0xb087('0xb')]=_0xb087('0x37');utils['info'](util[_0xb087('0x2')](_0xb087('0x55'),_0x245d68[_0xb087('0x4')],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0x7')],agents[_0x245d68[_0xb087('0x4')]]['reason'],agents[_0x245d68[_0xb087('0x4')]][_0xb087('0xb')]));writeDB(agents[_0x245d68[_0xb087('0x4')]]);}}catch(_0x3114ce){utils[_0xb087('0x1f')](util[_0xb087('0x2')](_0xb087('0x52'),_0x245d68[_0xb087('0x4')]),_0x3114ce);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index b818c7e..2d4eb72 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 _0x6175=['lastdata','queue','xmd-contactid','ContactId','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','application','appdata','toLowerCase','set','cdr','split','lastIndexOf','includes','noop','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','callerid','cause-txt','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue'];(function(_0x1bf1aa,_0x54c9ed){var _0x2367df=function(_0x9d5eae){while(--_0x9d5eae){_0x1bf1aa['push'](_0x1bf1aa['shift']());}};_0x2367df(++_0x54c9ed);}(_0x6175,0x1b8));var _0x5617=function(_0x3c10ca,_0x586fcd){_0x3c10ca=_0x3c10ca-0x0;var _0x3da31c=_0x6175[_0x3c10ca];return _0x3da31c;};'use strict';var _=require(_0x5617('0x0'));var util=require(_0x5617('0x1'));var utils=require(_0x5617('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x5617('0x3'),'FAILED',_0x5617('0x4'),_0x5617('0x3'),_0x5617('0x3'),_0x5617('0x3'),_0x5617('0x5'),'BUSY','FAILED',_0x5617('0x4'),_0x5617('0x4')];var channels={};function writeDB(_0x4e32cb){var _0x5b9e65;if(transfers[_0x5617('0x6')][_0x4e32cb['uniqueid']]){_0x5b9e65=_0x4e32cb[_0x5617('0x7')];_0x4e32cb['uniqueid']=transfers[_0x5617('0x6')][_0x4e32cb[_0x5617('0x7')]]['transfereeuniqueid'];}utils['info'](util[_0x5617('0x8')](_0x5617('0x9'),_0x4e32cb[_0x5617('0x7')],_0x4e32cb[_0x5617('0xa')],_0x4e32cb['queue'],_0x4e32cb[_0x5617('0xb')],_0x4e32cb[_0x5617('0xc')],_0x4e32cb[_0x5617('0xd')],_0x4e32cb['connectedlinenum'],_0x4e32cb[_0x5617('0xe')]));if(_0x4e32cb[_0x5617('0xf')]){utils[_0x5617('0x10')](_0x4e32cb[_0x5617('0xf')])[_0x5617('0x11')](function(_0x4aa339){if(_0x4aa339){_0x4e32cb[_0x5617('0x12')]=_0x4aa339['id'];}utils[_0x5617('0x13')](_0x5617('0x14'),_0x4e32cb);});}else{utils[_0x5617('0x13')](_0x5617('0x14'),_0x4e32cb);}if(channels[_0x4e32cb[_0x5617('0x7')]]){delete channels[_0x4e32cb[_0x5617('0x7')]];}else if(_0x5b9e65&&channels[_0x5b9e65]){delete transfers['blinds'][_0x5b9e65];delete channels[_0x5b9e65];}}exports[_0x5617('0x15')]=function(_0xe72df6){try{utils[_0x5617('0x16')](util['format']('[%s][calls][newchannel]',_0xe72df6[_0x5617('0x7')]),_0xe72df6);if(_0xe72df6['uniqueid']==_0xe72df6[_0x5617('0x17')]&&_0xe72df6[_0x5617('0xa')]!='OutgoingSpoolFailed'){utils[_0x5617('0x18')](util['format'](_0x5617('0x19'),_0xe72df6[_0x5617('0x7')],_0xe72df6[_0x5617('0x1a')],_0xe72df6[_0x5617('0x1b')]));channels[_0xe72df6[_0x5617('0x7')]]={'uniqueid':_0xe72df6['uniqueid'],'accountcode':_0xe72df6[_0x5617('0xf')],'source':_0xe72df6[_0x5617('0xd')],'destination':_0xe72df6[_0x5617('0x1b')],'destinationcontext':_0xe72df6[_0x5617('0x1a')],'channel':_0xe72df6['channel'],'starttime':utils[_0x5617('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5617('0x3'),'amaflags':_0x5617('0x1d')};}}catch(_0x3bfd44){utils[_0x5617('0x1e')](util['format'](_0x5617('0x1f'),_0xe72df6[_0x5617('0x7')]),_0x3bfd44);}};exports[_0x5617('0x20')]=function(_0x457a33){try{utils[_0x5617('0x16')](util[_0x5617('0x8')](_0x5617('0x21'),_0x457a33[_0x5617('0x7')]),_0x457a33);if(!_['isNil'](channels[_0x457a33[_0x5617('0x7')]])&&_0x457a33['channelstate']==0x6){utils[_0x5617('0x18')](util['format'](_0x5617('0x22'),_0x457a33['uniqueid'],_0x457a33['context'],_0x457a33[_0x5617('0xa')]));if(_[_0x5617('0x23')](channels[_0x457a33[_0x5617('0x7')]][_0x5617('0x24')])){channels[_0x457a33[_0x5617('0x7')]][_0x5617('0x24')]=utils[_0x5617('0x1c')]();}}else if(!_[_0x5617('0x23')](channels[_0x457a33['linkedid']])&&_0x457a33[_0x5617('0x25')]==0x6&&_0x457a33[_0x5617('0x1a')]!=_0x5617('0x26')){utils[_0x5617('0x18')](util[_0x5617('0x8')](_0x5617('0x27'),_0x457a33[_0x5617('0x7')],_0x457a33[_0x5617('0x17')],_0x457a33[_0x5617('0x1a')],_0x457a33[_0x5617('0xa')]));channels[_0x457a33['linkedid']]['accountcode']=_0x457a33[_0x5617('0xf')];channels[_0x457a33['linkedid']][_0x5617('0x28')]=_0x457a33[_0x5617('0xa')];if(_[_0x5617('0x23')](channels[_0x457a33[_0x5617('0x17')]]['answertime'])){channels[_0x457a33[_0x5617('0x17')]][_0x5617('0x29')]=utils[_0x5617('0x1c')]();}channels[_0x457a33[_0x5617('0x17')]][_0x5617('0x2a')]=dispositions[_[_0x5617('0x2b')](_0x457a33[_0x5617('0x25')])]||_0x5617('0x5');}}catch(_0x15d29f){utils[_0x5617('0x1e')](util[_0x5617('0x8')](_0x5617('0x21'),_0x457a33[_0x5617('0x7')]),_0x15d29f);}};exports[_0x5617('0x2c')]=function(_0x42b70f){try{if(!_[_0x5617('0x23')](channels[_0x42b70f[_0x5617('0x7')]])){utils[_0x5617('0x16')](util[_0x5617('0x8')](_0x5617('0x2d'),_0x42b70f[_0x5617('0x7')]),_0x42b70f);if(_[_0x5617('0x23')](channels[_0x42b70f[_0x5617('0x7')]]['callerid'])){channels[_0x42b70f['uniqueid']]['callerid']=_0x42b70f[_0x5617('0x2e')]+'\x20<'+_0x42b70f[_0x5617('0xd')]+'>';}utils[_0x5617('0x18')](util['format'](_0x5617('0x2f'),_0x42b70f[_0x5617('0x7')],channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x30')],_0x42b70f[_0x5617('0x31')]));channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x32')]=utils[_0x5617('0x1c')]();channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x33')]=utils[_0x5617('0x34')](channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x32')],channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x35')]);channels[_0x42b70f[_0x5617('0x7')]]['billableseconds']=channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x29')]?utils[_0x5617('0x34')](channels[_0x42b70f[_0x5617('0x7')]][_0x5617('0x32')],channels[_0x42b70f['uniqueid']][_0x5617('0x29')]):0x0;writeDB(channels[_0x42b70f[_0x5617('0x7')]]);}}catch(_0xa7ed99){utils[_0x5617('0x1e')](util[_0x5617('0x8')](_0x5617('0x2d'),_0x42b70f[_0x5617('0x7')]),_0xa7ed99);}};exports[_0x5617('0x36')]=function(_0x502d5b){try{if(!_['isNil'](channels[_0x502d5b[_0x5617('0x37')]])){utils['debug'](util[_0x5617('0x8')](_0x5617('0x38'),_0x502d5b['origtransfereruniqueid']),_0x502d5b);if(channels[_0x502d5b[_0x5617('0x37')]][_0x5617('0xa')]==_0x502d5b[_0x5617('0x39')]){utils[_0x5617('0x18')](util[_0x5617('0x8')](_0x5617('0x3a'),_0x502d5b[_0x5617('0x3b')],_0x502d5b[_0x5617('0x37')],_0x502d5b[_0x5617('0x3c')]));channels[_0x502d5b[_0x5617('0x37')]][_0x5617('0x28')]=_0x502d5b[_0x5617('0x3c')];channels[_0x502d5b['localtwolinkedid']][_0x5617('0x3d')]=_0x5617('0x3e');}else if(channels[_0x502d5b[_0x5617('0x37')]]['channel']=_0x502d5b['transfertargetchannel']){utils[_0x5617('0x18')](util['format'](_0x5617('0x3a'),_0x502d5b[_0x5617('0x3b')],_0x502d5b['localtwolinkedid'],_0x502d5b[_0x5617('0x3f')]));channels[_0x502d5b[_0x5617('0x37')]]['destinationchannel']=_0x502d5b[_0x5617('0x3f')];channels[_0x502d5b[_0x5617('0x37')]][_0x5617('0x3d')]=_0x5617('0x3e');}}}catch(_0x9b3034){utils['error'](util[_0x5617('0x8')]('[%s][calls][attendedtransfer]',_0x502d5b[_0x5617('0x3b')]),_0x9b3034);}};exports['musiconholdstart']=function(_0x400055){try{if(!_['isNil'](channels[_0x400055[_0x5617('0x7')]])){utils[_0x5617('0x16')](util[_0x5617('0x8')](_0x5617('0x40'),_0x400055[_0x5617('0x7')]),_0x400055);channels[_0x400055[_0x5617('0x7')]][_0x5617('0x41')]=utils[_0x5617('0x1c')]();utils['info'](util[_0x5617('0x8')](_0x5617('0x42'),_0x400055[_0x5617('0x7')],channels[_0x400055['uniqueid']][_0x5617('0x41')]));}}catch(_0x25793d){utils[_0x5617('0x1e')](util[_0x5617('0x8')](_0x5617('0x40'),_0x400055[_0x5617('0x7')]),_0x25793d);}};exports['musiconholdstop']=function(_0x27d581){try{if(!_[_0x5617('0x23')](channels[_0x27d581[_0x5617('0x7')]])){utils[_0x5617('0x16')](util[_0x5617('0x8')]('[%s][calls][musiconholdstop]',_0x27d581[_0x5617('0x7')]),_0x27d581);if(!_[_0x5617('0x23')](channels[_0x27d581['uniqueid']][_0x5617('0x41')])){channels[_0x27d581[_0x5617('0x7')]]['mohtime']+=utils['diffTime'](utils[_0x5617('0x1c')](),channels[_0x27d581[_0x5617('0x7')]][_0x5617('0x41')]);utils['info'](util['format'](_0x5617('0x43'),_0x27d581['uniqueid'],channels[_0x27d581[_0x5617('0x7')]][_0x5617('0x44')]));delete channels[_0x27d581[_0x5617('0x7')]]['musiconholdstartAt'];}}}catch(_0x5385b8){utils[_0x5617('0x1e')](util[_0x5617('0x8')]('[%s][calls][musiconholdstop]',_0x27d581[_0x5617('0x7')]),_0x5385b8);}};exports[_0x5617('0x45')]=function(_0x585ed1){try{if(!_[_0x5617('0x23')](channels[_0x585ed1[_0x5617('0x7')]])){utils[_0x5617('0x16')](util[_0x5617('0x8')](_0x5617('0x46'),_0x585ed1[_0x5617('0x7')]),_0x585ed1);if(!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')][_0x5617('0x48')])){utils['info'](util['format'](_0x5617('0x49'),_0x585ed1[_0x5617('0x7')],_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x4b')]=_0x585ed1[_0x5617('0x4a')];}if(!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')]['xmd-phone'])){utils[_0x5617('0x18')](util[_0x5617('0x8')](_0x5617('0x4c'),_0x585ed1['uniqueid'],_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1['uniqueid']][_0x5617('0x4d')]=_0x585ed1[_0x5617('0x4a')];channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x30')]='\x22'+_0x585ed1[_0x5617('0x4a')]+_0x5617('0x4e')+_0x585ed1[_0x5617('0x4a')]+'>';}if(!_['isNil'](_0x585ed1[_0x5617('0x47')][_0x5617('0x4f')])||!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')]['xmd-callerid'])){utils['info'](util[_0x5617('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x585ed1['uniqueid'],!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')]['xmd-callerid-preview'])?_0x5617('0x4f'):'xmd-callerid',_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]]['callerid']=_0x585ed1[_0x5617('0x4a')];}if(!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')]['xmd-queue'])||!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')][_0x5617('0x50')])){utils[_0x5617('0x18')](util[_0x5617('0x8')](_0x5617('0x51'),_0x585ed1[_0x5617('0x7')],!_[_0x5617('0x23')](_0x585ed1['variable'][_0x5617('0x52')])?_0x5617('0x52'):_0x5617('0x50'),_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x53')]=_0x5617('0x54');channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x55')]=_0x585ed1[_0x5617('0x4a')];channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x56')]=!![];}if(!_[_0x5617('0x23')](_0x585ed1['variable'][_0x5617('0x57')])){utils[_0x5617('0x18')](util[_0x5617('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x585ed1['uniqueid'],_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x58')]=_0x585ed1[_0x5617('0x4a')];}if(!_['isNil'](_0x585ed1[_0x5617('0x47')]['xmd-cdrtype'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x585ed1['uniqueid'],_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x59')]=_0x585ed1['value'];}if(!_[_0x5617('0x23')](_0x585ed1['variable']['outboundrouteid'])){utils[_0x5617('0x18')](util['format'](_0x5617('0x5a'),_0x585ed1['uniqueid'],_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x5b')]=_0x585ed1[_0x5617('0x4a')];}if(!_[_0x5617('0x23')](_0x585ed1[_0x5617('0x47')][_0x5617('0x5c')])){utils[_0x5617('0x18')](util['format'](_0x5617('0x5d'),_0x585ed1[_0x5617('0x7')],_0x585ed1[_0x5617('0x4a')]));channels[_0x585ed1[_0x5617('0x7')]][_0x5617('0x5c')]=_0x585ed1[_0x5617('0x4a')];}}}catch(_0x2dcbd3){utils[_0x5617('0x1e')](util[_0x5617('0x8')](_0x5617('0x46'),_0x585ed1[_0x5617('0x7')]),_0x2dcbd3);}};exports['newexten']=function(_0x35e63a){try{if(!_[_0x5617('0x23')](channels[_0x35e63a[_0x5617('0x7')]])){utils[_0x5617('0x16')](util[_0x5617('0x8')](_0x5617('0x5e'),_0x35e63a[_0x5617('0x7')]),_0x35e63a);utils['info'](util[_0x5617('0x8')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x35e63a[_0x5617('0x7')],_0x35e63a[_0x5617('0x5f')],_0x35e63a[_0x5617('0x60')]));if(_0x35e63a[_0x5617('0x5f')][_0x5617('0x61')]()==_0x5617('0x62')&&_['startsWith'](_0x35e63a[_0x5617('0x60')][_0x5617('0x61')](),_0x5617('0x63'))){var _0x2f3ecb=_0x35e63a[_0x5617('0x60')][_0x5617('0x64')]('=');var _0x104512=_0x2f3ecb[0x0]['substring'](_0x2f3ecb[0x0]['lastIndexOf']('(')+0x1,_0x2f3ecb[0x0][_0x5617('0x65')](')'));var _0x2c6abc=_0x2f3ecb[0x1];channels[_0x35e63a[_0x5617('0x7')]][_0x104512]=_0x2c6abc;}if(!_[_0x5617('0x66')]([_0x5617('0x2c'),_0x5617('0x67'),'execif',_0x5617('0x62'),_0x5617('0x68')],_0x35e63a[_0x5617('0x5f')]['toLowerCase']())){channels[_0x35e63a[_0x5617('0x7')]]['lastapplication']=_0x35e63a[_0x5617('0x5f')];channels[_0x35e63a[_0x5617('0x7')]][_0x5617('0x55')]=_0x35e63a[_0x5617('0x60')];}}}catch(_0xdddda5){utils[_0x5617('0x1e')](util[_0x5617('0x8')](_0x5617('0x5e'),_0x35e63a[_0x5617('0x7')]),_0xdddda5);}}; \ No newline at end of file +var _0xd282=['DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','now','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','duration','diffTime','endtime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-phone','value','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication','lastdata','queue','xmd-contactid','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','cdr','appdata','split','substring','lastIndexOf','noop','execif','gotoif','lodash','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','membername','interface','connectedlinenum','lastevent','getUserByInternal','accountcode','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum'];(function(_0x166468,_0x224c35){var _0x3f87bd=function(_0x211e72){while(--_0x211e72){_0x166468['push'](_0x166468['shift']());}};_0x3f87bd(++_0x224c35);}(_0xd282,0x117));var _0x2d28=function(_0x495e36,_0x3dd100){_0x495e36=_0x495e36-0x0;var _0x33c327=_0xd282[_0x495e36];return _0x33c327;};'use strict';var _=require(_0x2d28('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x2d28('0x1'));var dispositions=[_0x2d28('0x2'),_0x2d28('0x3'),'FAILED',_0x2d28('0x2'),_0x2d28('0x2'),'NO\x20ANSWER',_0x2d28('0x4'),_0x2d28('0x5'),_0x2d28('0x3'),_0x2d28('0x3'),'FAILED'];var channels={};function writeDB(_0xa7e5a7){var _0x2c9c21;if(transfers[_0x2d28('0x6')][_0xa7e5a7[_0x2d28('0x7')]]){_0x2c9c21=_0xa7e5a7['uniqueid'];_0xa7e5a7[_0x2d28('0x7')]=transfers['blinds'][_0xa7e5a7['uniqueid']][_0x2d28('0x8')];}utils[_0x2d28('0x9')](util['format'](_0x2d28('0xa'),_0xa7e5a7[_0x2d28('0x7')],_0xa7e5a7['channel'],_0xa7e5a7['queue'],_0xa7e5a7[_0x2d28('0xb')],_0xa7e5a7[_0x2d28('0xc')],_0xa7e5a7['calleridnum'],_0xa7e5a7[_0x2d28('0xd')],_0xa7e5a7[_0x2d28('0xe')]));if(_0xa7e5a7['accountcode']){utils[_0x2d28('0xf')](_0xa7e5a7[_0x2d28('0x10')])['then'](function(_0xe2020f){if(_0xe2020f){_0xa7e5a7[_0x2d28('0x11')]=_0xe2020f['id'];}utils[_0x2d28('0x12')](_0x2d28('0x13'),_0xa7e5a7);});}else{utils[_0x2d28('0x12')](_0x2d28('0x13'),_0xa7e5a7);}if(channels[_0xa7e5a7[_0x2d28('0x7')]]){delete channels[_0xa7e5a7[_0x2d28('0x7')]];}else if(_0x2c9c21&&channels[_0x2c9c21]){delete transfers[_0x2d28('0x6')][_0x2c9c21];delete channels[_0x2c9c21];}}exports['newchannel']=function(_0x335cf6){try{utils[_0x2d28('0x14')](util['format'](_0x2d28('0x15'),_0x335cf6[_0x2d28('0x7')]),_0x335cf6);if(_0x335cf6[_0x2d28('0x7')]==_0x335cf6[_0x2d28('0x16')]&&_0x335cf6[_0x2d28('0x17')]!=_0x2d28('0x18')){utils[_0x2d28('0x9')](util[_0x2d28('0x19')](_0x2d28('0x1a'),_0x335cf6['uniqueid'],_0x335cf6[_0x2d28('0x1b')],_0x335cf6[_0x2d28('0x1c')]));channels[_0x335cf6['uniqueid']]={'uniqueid':_0x335cf6[_0x2d28('0x7')],'accountcode':_0x335cf6['accountcode'],'source':_0x335cf6[_0x2d28('0x1d')],'destination':_0x335cf6['exten'],'destinationcontext':_0x335cf6[_0x2d28('0x1b')],'channel':_0x335cf6[_0x2d28('0x17')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x2d28('0x2'),'amaflags':_0x2d28('0x1e')};}}catch(_0x4e819c){utils[_0x2d28('0x1f')](util[_0x2d28('0x19')](_0x2d28('0x15'),_0x335cf6[_0x2d28('0x7')]),_0x4e819c);}};exports[_0x2d28('0x20')]=function(_0x444e91){try{utils[_0x2d28('0x14')](util[_0x2d28('0x19')](_0x2d28('0x21'),_0x444e91[_0x2d28('0x7')]),_0x444e91);if(!_[_0x2d28('0x22')](channels[_0x444e91[_0x2d28('0x7')]])&&_0x444e91[_0x2d28('0x23')]==0x6){utils['info'](util[_0x2d28('0x19')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x444e91[_0x2d28('0x7')],_0x444e91[_0x2d28('0x1b')],_0x444e91[_0x2d28('0x17')]));if(_[_0x2d28('0x22')](channels[_0x444e91[_0x2d28('0x7')]][_0x2d28('0x24')])){channels[_0x444e91[_0x2d28('0x7')]][_0x2d28('0x24')]=utils['now']();}}else if(!_[_0x2d28('0x22')](channels[_0x444e91[_0x2d28('0x16')]])&&_0x444e91[_0x2d28('0x23')]==0x6&&_0x444e91['context']!=_0x2d28('0x25')){utils[_0x2d28('0x9')](util[_0x2d28('0x19')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x444e91['uniqueid'],_0x444e91[_0x2d28('0x16')],_0x444e91[_0x2d28('0x1b')],_0x444e91[_0x2d28('0x17')]));channels[_0x444e91['linkedid']]['accountcode']=_0x444e91[_0x2d28('0x10')];channels[_0x444e91[_0x2d28('0x16')]][_0x2d28('0x26')]=_0x444e91['channel'];if(_['isNil'](channels[_0x444e91[_0x2d28('0x16')]]['answertime'])){channels[_0x444e91['linkedid']][_0x2d28('0x27')]=utils[_0x2d28('0x28')]();}channels[_0x444e91[_0x2d28('0x16')]][_0x2d28('0x29')]=dispositions[_[_0x2d28('0x2a')](_0x444e91[_0x2d28('0x23')])]||_0x2d28('0x4');}}catch(_0x17a900){utils[_0x2d28('0x1f')](util[_0x2d28('0x19')]('[%s][calls][newstate]',_0x444e91[_0x2d28('0x7')]),_0x17a900);}};exports[_0x2d28('0x2b')]=function(_0x28f5f3){try{if(!_[_0x2d28('0x22')](channels[_0x28f5f3[_0x2d28('0x7')]])){utils[_0x2d28('0x14')](util['format'](_0x2d28('0x2c'),_0x28f5f3[_0x2d28('0x7')]),_0x28f5f3);if(_['isNil'](channels[_0x28f5f3[_0x2d28('0x7')]][_0x2d28('0x2d')])){channels[_0x28f5f3[_0x2d28('0x7')]][_0x2d28('0x2d')]=_0x28f5f3['calleridname']+'\x20<'+_0x28f5f3[_0x2d28('0x1d')]+'>';}utils[_0x2d28('0x9')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x28f5f3[_0x2d28('0x7')],channels[_0x28f5f3[_0x2d28('0x7')]][_0x2d28('0x2d')],_0x28f5f3['cause-txt']));channels[_0x28f5f3[_0x2d28('0x7')]]['endtime']=utils[_0x2d28('0x28')]();channels[_0x28f5f3['uniqueid']][_0x2d28('0x2e')]=utils[_0x2d28('0x2f')](channels[_0x28f5f3[_0x2d28('0x7')]][_0x2d28('0x30')],channels[_0x28f5f3[_0x2d28('0x7')]]['starttime']);channels[_0x28f5f3[_0x2d28('0x7')]][_0x2d28('0x31')]=channels[_0x28f5f3['uniqueid']][_0x2d28('0x27')]?utils[_0x2d28('0x2f')](channels[_0x28f5f3['uniqueid']][_0x2d28('0x30')],channels[_0x28f5f3[_0x2d28('0x7')]][_0x2d28('0x27')]):0x0;writeDB(channels[_0x28f5f3[_0x2d28('0x7')]]);}}catch(_0x2ed096){utils['error'](util['format'](_0x2d28('0x2c'),_0x28f5f3[_0x2d28('0x7')]),_0x2ed096);}};exports[_0x2d28('0x32')]=function(_0x2c2486){try{if(!_['isNil'](channels[_0x2c2486[_0x2d28('0x33')]])){utils['debug'](util[_0x2d28('0x19')](_0x2d28('0x34'),_0x2c2486[_0x2d28('0x35')]),_0x2c2486);if(channels[_0x2c2486[_0x2d28('0x33')]]['channel']==_0x2c2486['transfereechannel']){utils[_0x2d28('0x9')](util['format'](_0x2d28('0x36'),_0x2c2486[_0x2d28('0x35')],_0x2c2486[_0x2d28('0x33')],_0x2c2486[_0x2d28('0x37')]));channels[_0x2c2486[_0x2d28('0x33')]]['destinationchannel']=_0x2c2486[_0x2d28('0x37')];channels[_0x2c2486[_0x2d28('0x33')]][_0x2d28('0x38')]='_attended';}else if(channels[_0x2c2486['localtwolinkedid']][_0x2d28('0x17')]=_0x2c2486[_0x2d28('0x39')]){utils['info'](util[_0x2d28('0x19')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2c2486[_0x2d28('0x35')],_0x2c2486[_0x2d28('0x33')],_0x2c2486[_0x2d28('0x3a')]));channels[_0x2c2486[_0x2d28('0x33')]][_0x2d28('0x26')]=_0x2c2486['origtransfererchannel'];channels[_0x2c2486[_0x2d28('0x33')]][_0x2d28('0x38')]=_0x2d28('0x3b');}}}catch(_0x4d59a2){utils[_0x2d28('0x1f')](util['format'](_0x2d28('0x34'),_0x2c2486[_0x2d28('0x35')]),_0x4d59a2);}};exports[_0x2d28('0x3c')]=function(_0xe708da){try{if(!_['isNil'](channels[_0xe708da[_0x2d28('0x7')]])){utils[_0x2d28('0x14')](util['format'](_0x2d28('0x3d'),_0xe708da['uniqueid']),_0xe708da);channels[_0xe708da[_0x2d28('0x7')]]['musiconholdstartAt']=utils[_0x2d28('0x28')]();utils[_0x2d28('0x9')](util[_0x2d28('0x19')](_0x2d28('0x3e'),_0xe708da[_0x2d28('0x7')],channels[_0xe708da[_0x2d28('0x7')]]['musiconholdstartAt']));}}catch(_0x256c2d){utils[_0x2d28('0x1f')](util[_0x2d28('0x19')](_0x2d28('0x3d'),_0xe708da[_0x2d28('0x7')]),_0x256c2d);}};exports[_0x2d28('0x3f')]=function(_0xa392f8){try{if(!_['isNil'](channels[_0xa392f8[_0x2d28('0x7')]])){utils['debug'](util[_0x2d28('0x19')]('[%s][calls][musiconholdstop]',_0xa392f8[_0x2d28('0x7')]),_0xa392f8);if(!_[_0x2d28('0x22')](channels[_0xa392f8['uniqueid']][_0x2d28('0x40')])){channels[_0xa392f8['uniqueid']][_0x2d28('0x41')]+=utils[_0x2d28('0x2f')](utils[_0x2d28('0x28')](),channels[_0xa392f8[_0x2d28('0x7')]]['musiconholdstartAt']);utils[_0x2d28('0x9')](util['format'](_0x2d28('0x42'),_0xa392f8[_0x2d28('0x7')],channels[_0xa392f8['uniqueid']]['mohtime']));delete channels[_0xa392f8['uniqueid']][_0x2d28('0x40')];}}}catch(_0x70131d){utils[_0x2d28('0x1f')](util[_0x2d28('0x19')](_0x2d28('0x43'),_0xa392f8[_0x2d28('0x7')]),_0x70131d);}};exports['varset']=function(_0xa3567e){try{if(!_[_0x2d28('0x22')](channels[_0xa3567e[_0x2d28('0x7')]])){utils[_0x2d28('0x14')](util[_0x2d28('0x19')](_0x2d28('0x44'),_0xa3567e[_0x2d28('0x7')]),_0xa3567e);if(!_[_0x2d28('0x22')](_0xa3567e[_0x2d28('0x45')]['xmd-originatecalleridnum'])){utils[_0x2d28('0x9')](util[_0x2d28('0x19')](_0x2d28('0x46'),_0xa3567e[_0x2d28('0x7')],_0xa3567e['value']));channels[_0xa3567e[_0x2d28('0x7')]]['source']=_0xa3567e['value'];}if(!_[_0x2d28('0x22')](_0xa3567e[_0x2d28('0x45')][_0x2d28('0x47')])){utils['info'](util[_0x2d28('0x19')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0xa3567e['uniqueid'],_0xa3567e[_0x2d28('0x48')]));channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x49')]=_0xa3567e['value'];channels[_0xa3567e[_0x2d28('0x7')]]['callerid']='\x22'+_0xa3567e[_0x2d28('0x48')]+_0x2d28('0x4a')+_0xa3567e[_0x2d28('0x48')]+'>';}if(!_['isNil'](_0xa3567e[_0x2d28('0x45')][_0x2d28('0x4b')])||!_['isNil'](_0xa3567e[_0x2d28('0x45')][_0x2d28('0x4c')])){utils[_0x2d28('0x9')](util['format'](_0x2d28('0x4d'),_0xa3567e[_0x2d28('0x7')],!_[_0x2d28('0x22')](_0xa3567e['variable'][_0x2d28('0x4b')])?'xmd-callerid-preview':_0x2d28('0x4c'),_0xa3567e[_0x2d28('0x48')]));channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x2d')]=_0xa3567e[_0x2d28('0x48')];}if(!_[_0x2d28('0x22')](_0xa3567e['variable']['xmd-queue'])||!_['isNil'](_0xa3567e[_0x2d28('0x45')][_0x2d28('0x4e')])){utils['info'](util[_0x2d28('0x19')](_0x2d28('0x4d'),_0xa3567e['uniqueid'],!_[_0x2d28('0x22')](_0xa3567e['variable'][_0x2d28('0x4f')])?_0x2d28('0x4f'):_0x2d28('0x4e'),_0xa3567e['value']));channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x50')]='Queue';channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x51')]=_0xa3567e['value'];channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x52')]=!![];}if(!_[_0x2d28('0x22')](_0xa3567e[_0x2d28('0x45')][_0x2d28('0x53')])){utils[_0x2d28('0x9')](util[_0x2d28('0x19')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0xa3567e[_0x2d28('0x7')],_0xa3567e[_0x2d28('0x48')]));channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x54')]=_0xa3567e['value'];}if(!_[_0x2d28('0x22')](_0xa3567e['variable']['xmd-cdrtype'])){utils[_0x2d28('0x9')](util[_0x2d28('0x19')](_0x2d28('0x55'),_0xa3567e[_0x2d28('0x7')],_0xa3567e['value']));channels[_0xa3567e[_0x2d28('0x7')]]['type']=_0xa3567e['value'];}if(!_['isNil'](_0xa3567e[_0x2d28('0x45')][_0x2d28('0x56')])){utils[_0x2d28('0x9')](util[_0x2d28('0x19')](_0x2d28('0x57'),_0xa3567e[_0x2d28('0x7')],_0xa3567e[_0x2d28('0x48')]));channels[_0xa3567e[_0x2d28('0x7')]][_0x2d28('0x58')]=_0xa3567e[_0x2d28('0x48')];}if(!_['isNil'](_0xa3567e[_0x2d28('0x45')]['sipcallid'])){utils['info'](util[_0x2d28('0x19')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0xa3567e['uniqueid'],_0xa3567e[_0x2d28('0x48')]));channels[_0xa3567e['uniqueid']]['sipcallid']=_0xa3567e[_0x2d28('0x48')];}}}catch(_0x2f269e){utils['error'](util[_0x2d28('0x19')](_0x2d28('0x44'),_0xa3567e[_0x2d28('0x7')]),_0x2f269e);}};exports[_0x2d28('0x59')]=function(_0x239ad1){try{if(!_[_0x2d28('0x22')](channels[_0x239ad1[_0x2d28('0x7')]])){utils['debug'](util[_0x2d28('0x19')](_0x2d28('0x5a'),_0x239ad1[_0x2d28('0x7')]),_0x239ad1);utils[_0x2d28('0x9')](util[_0x2d28('0x19')](_0x2d28('0x5b'),_0x239ad1[_0x2d28('0x7')],_0x239ad1[_0x2d28('0x5c')],_0x239ad1['appdata']));if(_0x239ad1[_0x2d28('0x5c')][_0x2d28('0x5d')]()=='set'&&_[_0x2d28('0x5e')](_0x239ad1['appdata'][_0x2d28('0x5d')](),_0x2d28('0x5f'))){var _0x179476=_0x239ad1[_0x2d28('0x60')][_0x2d28('0x61')]('=');var _0x14f147=_0x179476[0x0][_0x2d28('0x62')](_0x179476[0x0][_0x2d28('0x63')]('(')+0x1,_0x179476[0x0][_0x2d28('0x63')](')'));var _0xad12a4=_0x179476[0x1];channels[_0x239ad1[_0x2d28('0x7')]][_0x14f147]=_0xad12a4;}if(!_['includes']([_0x2d28('0x2b'),_0x2d28('0x64'),_0x2d28('0x65'),'set',_0x2d28('0x66')],_0x239ad1[_0x2d28('0x5c')]['toLowerCase']())){channels[_0x239ad1['uniqueid']][_0x2d28('0x50')]=_0x239ad1[_0x2d28('0x5c')];channels[_0x239ad1[_0x2d28('0x7')]][_0x2d28('0x51')]=_0x239ad1['appdata'];}}}catch(_0x357b23){utils['error'](util['format']('[%s][calls][newexten]',_0x239ad1[_0x2d28('0x7')]),_0x357b23);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a78606a..d462132 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 _0x0c46=['./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent'];(function(_0x186a7f,_0x161b27){var _0xe7fe75=function(_0x24c5a0){while(--_0x24c5a0){_0x186a7f['push'](_0x186a7f['shift']());}};_0xe7fe75(++_0x161b27);}(_0x0c46,0x134));var _0x60c4=function(_0x1ff477,_0x189728){_0x1ff477=_0x1ff477-0x0;var _0x3dac5d=_0x0c46[_0x1ff477];return _0x3dac5d;};'use strict';var utils=require(_0x60c4('0x0'));exports['connect']=function(){utils[_0x60c4('0x1')](_0x60c4('0x2'));};exports[_0x60c4('0x3')]=function(){utils[_0x60c4('0x1')](_0x60c4('0x4'));};exports[_0x60c4('0x5')]=function(){utils[_0x60c4('0x1')]('[core]\x20fullybooted');};exports['error']=function(_0x4d9cdf){utils[_0x60c4('0x6')](_0x60c4('0x7'),_0x4d9cdf);};exports[_0x60c4('0x8')]=function(){utils[_0x60c4('0x1')](_0x60c4('0x9'));};exports[_0x60c4('0xa')]=function(_0x4aa5ce){}; \ No newline at end of file +var _0x4a9b=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected'];(function(_0x127125,_0x25ad37){var _0x20be94=function(_0x78ae53){while(--_0x78ae53){_0x127125['push'](_0x127125['shift']());}};_0x20be94(++_0x25ad37);}(_0x4a9b,0x152));var _0xb4a9=function(_0x47beeb,_0x8b8e6){_0x47beeb=_0x47beeb-0x0;var _0x7ccb0b=_0x4a9b[_0x47beeb];return _0x7ccb0b;};'use strict';var utils=require('./utils');exports[_0xb4a9('0x0')]=function(){utils[_0xb4a9('0x1')](_0xb4a9('0x2'));};exports['shutdown']=function(){utils[_0xb4a9('0x1')](_0xb4a9('0x3'));};exports[_0xb4a9('0x4')]=function(){utils[_0xb4a9('0x1')](_0xb4a9('0x5'));};exports[_0xb4a9('0x6')]=function(_0x1b0d1e){utils[_0xb4a9('0x6')](_0xb4a9('0x7'),_0x1b0d1e);};exports[_0xb4a9('0x8')]=function(){utils[_0xb4a9('0x1')](_0xb4a9('0x9'));};exports[_0xb4a9('0xa')]=function(_0x3ad796){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index d45ecc0..b1ed6eb 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 _0x5e4b=['[%s][dials][hangup]','lodash','util','./utils','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','info','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr(routeid)','appdata','varset','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','holdtime','billableseconds','endtime'];(function(_0x5af565,_0xe531a7){var _0x2a311f=function(_0x59429a){while(--_0x59429a){_0x5af565['push'](_0x5af565['shift']());}};_0x2a311f(++_0xe531a7);}(_0x5e4b,0xd5));var _0xb5e4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5e4b[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xb5e4('0x0'));var util=require(_0xb5e4('0x1'));var utils=require(_0xb5e4('0x2'));var dials={};function writeDB(_0x24b9f3){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x24b9f3['uniqueid'],_0x24b9f3[_0xb5e4('0x3')],_0x24b9f3[_0xb5e4('0x4')],_0x24b9f3[_0xb5e4('0x5')],_0x24b9f3[_0xb5e4('0x6')],_0x24b9f3[_0xb5e4('0x7')]));utils[_0xb5e4('0x8')](_0xb5e4('0x9'),_0x24b9f3);delete dials[_0x24b9f3[_0xb5e4('0xa')]];}exports[_0xb5e4('0xb')]=function(_0x4f7fc6){try{utils[_0xb5e4('0xc')](util['format'](_0xb5e4('0xd'),_0x4f7fc6[_0xb5e4('0xa')]),_0x4f7fc6);utils[_0xb5e4('0xe')](util[_0xb5e4('0xf')](_0xb5e4('0x10'),_0x4f7fc6[_0xb5e4('0xa')],_0x4f7fc6[_0xb5e4('0x11')],_0x4f7fc6['appdata']));if(_0x4f7fc6[_0xb5e4('0x11')][_0xb5e4('0x12')]()==_0xb5e4('0x13')&&_[_0xb5e4('0x14')](_0x4f7fc6['appdata'][_0xb5e4('0x12')](),_0xb5e4('0x15'))){var _0x3903cd=_0x4f7fc6[_0xb5e4('0x16')]['split']('=');dials[_0x4f7fc6[_0xb5e4('0xa')]]={'routeId':_0x3903cd[0x1]};}}catch(_0x2cf365){utils['error'](util[_0xb5e4('0xf')](_0xb5e4('0xd'),_0x4f7fc6[_0xb5e4('0xa')]),_0x2cf365);}};exports[_0xb5e4('0x17')]=function(_0x1d9ede){try{utils[_0xb5e4('0xc')](util[_0xb5e4('0xf')](_0xb5e4('0x18'),_0x1d9ede['uniqueid']),_0x1d9ede);if(!_[_0xb5e4('0x19')](_0x1d9ede[_0xb5e4('0x1a')]['outboundrouteid'])){utils[_0xb5e4('0xe')](util[_0xb5e4('0xf')](_0xb5e4('0x1b'),_0x1d9ede[_0xb5e4('0xa')],_0x1d9ede[_0xb5e4('0x1c')]));dials[_0x1d9ede[_0xb5e4('0xa')]]={'routeId':_0x1d9ede[_0xb5e4('0x1c')]};}}catch(_0x30a9f0){utils[_0xb5e4('0x1d')](util[_0xb5e4('0xf')](_0xb5e4('0x18'),_0x1d9ede[_0xb5e4('0xa')]),_0x30a9f0);}};exports[_0xb5e4('0x1e')]=function(_0x4de05f){try{if(!_[_0xb5e4('0x19')](dials[_0x4de05f[_0xb5e4('0xa')]])){utils[_0xb5e4('0xc')](util[_0xb5e4('0xf')](_0xb5e4('0x1f'),_0x4de05f[_0xb5e4('0xa')]),_0x4de05f);dials[_0x4de05f['uniqueid']]=_[_0xb5e4('0x20')](dials[_0x4de05f[_0xb5e4('0xa')]],_0x4de05f);dials[_0x4de05f[_0xb5e4('0xa')]][_0xb5e4('0x21')]=utils[_0xb5e4('0x22')]();dials[_0x4de05f[_0xb5e4('0xa')]][_0xb5e4('0x23')]=_0xb5e4('0x24');utils[_0xb5e4('0xe')](util[_0xb5e4('0xf')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4de05f[_0xb5e4('0xa')],dials[_0x4de05f['uniqueid']]['starttime']));}}catch(_0x22b817){utils[_0xb5e4('0x1d')](util[_0xb5e4('0xf')](_0xb5e4('0x1f'),_0x4de05f['uniqueid']),_0x22b817);}};exports[_0xb5e4('0x25')]=function(_0x112d7b){try{if(!_[_0xb5e4('0x19')](dials[_0x112d7b[_0xb5e4('0xa')]])){utils['debug'](util[_0xb5e4('0xf')](_0xb5e4('0x26'),_0x112d7b[_0xb5e4('0xa')]),_0x112d7b);dials[_0x112d7b['uniqueid']][_0xb5e4('0x7')]=_0x112d7b['dialstatus'];if(_0x112d7b[_0xb5e4('0x7')]==_0xb5e4('0x27')){dials[_0x112d7b[_0xb5e4('0xa')]]=_[_0xb5e4('0x20')](dials[_0x112d7b[_0xb5e4('0xa')]],_0x112d7b);dials[_0x112d7b[_0xb5e4('0xa')]][_0xb5e4('0x28')]=utils[_0xb5e4('0x22')]();dials[_0x112d7b[_0xb5e4('0xa')]]['lastevent']='connect';utils[_0xb5e4('0xe')](util[_0xb5e4('0xf')](_0xb5e4('0x29'),_0x112d7b[_0xb5e4('0xa')],_0x112d7b[_0xb5e4('0x7')],dials[_0x112d7b[_0xb5e4('0xa')]][_0xb5e4('0x28')]));}else{utils[_0xb5e4('0xe')](util[_0xb5e4('0xf')](_0xb5e4('0x2a'),_0x112d7b[_0xb5e4('0xa')],_0x112d7b[_0xb5e4('0x7')]));}}}catch(_0x338704){utils[_0xb5e4('0x1d')](util['format'](_0xb5e4('0x26'),_0x112d7b['uniqueid']),_0x338704);}};exports[_0xb5e4('0x2b')]=function(_0x4753d2){try{if(!_[_0xb5e4('0x19')](dials[_0x4753d2[_0xb5e4('0xa')]])){utils[_0xb5e4('0xc')](util[_0xb5e4('0xf')]('[%s][dials][hangup]',_0x4753d2[_0xb5e4('0xa')]),_0x4753d2);utils[_0xb5e4('0xe')](util[_0xb5e4('0xf')](_0xb5e4('0x2c'),_0x4753d2[_0xb5e4('0xa')],_0x4753d2[_0xb5e4('0x5')],_0x4753d2[_0xb5e4('0x2d')],_0x4753d2[_0xb5e4('0x2e')]));dials[_0x4753d2['uniqueid']]=_[_0xb5e4('0x20')](dials[_0x4753d2[_0xb5e4('0xa')]],{'endtime':utils[_0xb5e4('0x22')](),'lastevent':'complete'});dials[_0x4753d2['uniqueid']][_0xb5e4('0x2f')]=utils[_0xb5e4('0x30')](dials[_0x4753d2[_0xb5e4('0xa')]]['endtime'],dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x21')]);dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x31')]=utils[_0xb5e4('0x30')](dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x28')]||dials[_0x4753d2[_0xb5e4('0xa')]]['endtime'],dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x21')]);dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x32')]=dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x28')]?utils[_0xb5e4('0x30')](dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x33')],dials[_0x4753d2[_0xb5e4('0xa')]][_0xb5e4('0x28')]):0x0;writeDB(dials[_0x4753d2[_0xb5e4('0xa')]]);}}catch(_0x32696d){utils[_0xb5e4('0x1d')](util[_0xb5e4('0xf')](_0xb5e4('0x34'),_0x4753d2[_0xb5e4('0xa')]),_0x32696d);}}; \ No newline at end of file +var _0x4b2f=['format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','request','CreateVoiceDialReport'];(function(_0x546487,_0x1dccf8){var _0x586821=function(_0x41ddcb){while(--_0x41ddcb){_0x546487['push'](_0x546487['shift']());}};_0x586821(++_0x1dccf8);}(_0x4b2f,0xbd));var _0xf4b2=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x4b2f[_0x121886];return _0x20ca01;};'use strict';var _=require(_0xf4b2('0x0'));var util=require(_0xf4b2('0x1'));var utils=require(_0xf4b2('0x2'));var dials={};function writeDB(_0x1c29d6){utils[_0xf4b2('0x3')](util['format'](_0xf4b2('0x4'),_0x1c29d6[_0xf4b2('0x5')],_0x1c29d6[_0xf4b2('0x6')],_0x1c29d6[_0xf4b2('0x7')],_0x1c29d6[_0xf4b2('0x8')],_0x1c29d6['connectedlinenum'],_0x1c29d6['dialstatus']));utils[_0xf4b2('0x9')](_0xf4b2('0xa'),_0x1c29d6);delete dials[_0x1c29d6['uniqueid']];}exports['newexten']=function(_0x57c994){try{utils['debug'](util[_0xf4b2('0xb')](_0xf4b2('0xc'),_0x57c994[_0xf4b2('0x5')]),_0x57c994);utils['info'](util['format'](_0xf4b2('0xd'),_0x57c994['uniqueid'],_0x57c994[_0xf4b2('0xe')],_0x57c994[_0xf4b2('0xf')]));if(_0x57c994[_0xf4b2('0xe')][_0xf4b2('0x10')]()==_0xf4b2('0x11')&&_[_0xf4b2('0x12')](_0x57c994['appdata']['toLowerCase'](),_0xf4b2('0x13'))){var _0x577b80=_0x57c994['appdata'][_0xf4b2('0x14')]('=');dials[_0x57c994[_0xf4b2('0x5')]]={'routeId':_0x577b80[0x1]};}}catch(_0x5211ab){utils['error'](util[_0xf4b2('0xb')](_0xf4b2('0xc'),_0x57c994[_0xf4b2('0x5')]),_0x5211ab);}};exports[_0xf4b2('0x15')]=function(_0x465ade){try{utils[_0xf4b2('0x16')](util[_0xf4b2('0xb')](_0xf4b2('0x17'),_0x465ade[_0xf4b2('0x5')]),_0x465ade);if(!_[_0xf4b2('0x18')](_0x465ade['variable'][_0xf4b2('0x19')])){utils[_0xf4b2('0x3')](util['format'](_0xf4b2('0x1a'),_0x465ade[_0xf4b2('0x5')],_0x465ade[_0xf4b2('0x1b')]));dials[_0x465ade[_0xf4b2('0x5')]]={'routeId':_0x465ade[_0xf4b2('0x1b')]};}}catch(_0x136c81){utils[_0xf4b2('0x1c')](util[_0xf4b2('0xb')](_0xf4b2('0x17'),_0x465ade['uniqueid']),_0x136c81);}};exports['dialbegin']=function(_0x57efa1){try{if(!_[_0xf4b2('0x18')](dials[_0x57efa1['uniqueid']])){utils['debug'](util[_0xf4b2('0xb')](_0xf4b2('0x1d'),_0x57efa1[_0xf4b2('0x5')]),_0x57efa1);dials[_0x57efa1[_0xf4b2('0x5')]]=_[_0xf4b2('0x1e')](dials[_0x57efa1[_0xf4b2('0x5')]],_0x57efa1);dials[_0x57efa1[_0xf4b2('0x5')]][_0xf4b2('0x1f')]=utils[_0xf4b2('0x20')]();dials[_0x57efa1[_0xf4b2('0x5')]][_0xf4b2('0x21')]='called';utils[_0xf4b2('0x3')](util['format'](_0xf4b2('0x22'),_0x57efa1['uniqueid'],dials[_0x57efa1[_0xf4b2('0x5')]]['starttime']));}}catch(_0x1c0105){utils['error'](util[_0xf4b2('0xb')](_0xf4b2('0x1d'),_0x57efa1[_0xf4b2('0x5')]),_0x1c0105);}};exports[_0xf4b2('0x23')]=function(_0x5bd85d){try{if(!_['isNil'](dials[_0x5bd85d[_0xf4b2('0x5')]])){utils['debug'](util['format'](_0xf4b2('0x24'),_0x5bd85d[_0xf4b2('0x5')]),_0x5bd85d);dials[_0x5bd85d[_0xf4b2('0x5')]][_0xf4b2('0x25')]=_0x5bd85d[_0xf4b2('0x25')];if(_0x5bd85d[_0xf4b2('0x25')]=='ANSWER'){dials[_0x5bd85d[_0xf4b2('0x5')]]=_[_0xf4b2('0x1e')](dials[_0x5bd85d[_0xf4b2('0x5')]],_0x5bd85d);dials[_0x5bd85d[_0xf4b2('0x5')]][_0xf4b2('0x26')]=utils[_0xf4b2('0x20')]();dials[_0x5bd85d[_0xf4b2('0x5')]][_0xf4b2('0x21')]=_0xf4b2('0x27');utils['info'](util[_0xf4b2('0xb')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x5bd85d[_0xf4b2('0x5')],_0x5bd85d[_0xf4b2('0x25')],dials[_0x5bd85d['uniqueid']][_0xf4b2('0x26')]));}else{utils[_0xf4b2('0x3')](util[_0xf4b2('0xb')](_0xf4b2('0x28'),_0x5bd85d[_0xf4b2('0x5')],_0x5bd85d[_0xf4b2('0x25')]));}}}catch(_0x3adebf){utils[_0xf4b2('0x1c')](util[_0xf4b2('0xb')](_0xf4b2('0x24'),_0x5bd85d['uniqueid']),_0x3adebf);}};exports[_0xf4b2('0x29')]=function(_0x47d3de){try{if(!_[_0xf4b2('0x18')](dials[_0x47d3de[_0xf4b2('0x5')]])){utils[_0xf4b2('0x16')](util[_0xf4b2('0xb')](_0xf4b2('0x2a'),_0x47d3de[_0xf4b2('0x5')]),_0x47d3de);utils[_0xf4b2('0x3')](util[_0xf4b2('0xb')](_0xf4b2('0x2b'),_0x47d3de[_0xf4b2('0x5')],_0x47d3de['calleridnum'],_0x47d3de['calleridname'],_0x47d3de[_0xf4b2('0x2c')]));dials[_0x47d3de[_0xf4b2('0x5')]]=_[_0xf4b2('0x1e')](dials[_0x47d3de[_0xf4b2('0x5')]],{'endtime':utils['now'](),'lastevent':_0xf4b2('0x2d')});dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x2e')]=utils[_0xf4b2('0x2f')](dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x30')],dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x1f')]);dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x31')]=utils[_0xf4b2('0x2f')](dials[_0x47d3de['uniqueid']][_0xf4b2('0x26')]||dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x30')],dials[_0x47d3de['uniqueid']][_0xf4b2('0x1f')]);dials[_0x47d3de[_0xf4b2('0x5')]]['billableseconds']=dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x26')]?utils[_0xf4b2('0x2f')](dials[_0x47d3de[_0xf4b2('0x5')]][_0xf4b2('0x30')],dials[_0x47d3de['uniqueid']][_0xf4b2('0x26')]):0x0;writeDB(dials[_0x47d3de[_0xf4b2('0x5')]]);}}catch(_0x19a5b9){utils[_0xf4b2('0x1c')](util[_0xf4b2('0xb')](_0xf4b2('0x2a'),_0x47d3de[_0xf4b2('0x5')]),_0x19a5b9);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b9d64ce..a53f2c0 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 _0x4a9d=['uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','util','port','username','password','keepConnected','xdr','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4a9d,0x116));var _0xd4a9=function(_0x86b468,_0x220e28){_0x86b468=_0x86b468-0x0;var _0x1d4b8e=_0x4a9d[_0x86b468];return _0x1d4b8e;};var AsteriskManager=require(_0xd4a9('0x0'));var config=require('../../config/environment');var utils=require('./utils');var util=require(_0xd4a9('0x1'));var ami=new AsteriskManager(config['asterisk'][_0xd4a9('0x2')],config['asterisk']['ip'],config['asterisk'][_0xd4a9('0x3')],config['asterisk'][_0xd4a9('0x4')],!![]);ami[_0xd4a9('0x5')]();if(config[_0xd4a9('0x6')]&&config[_0xd4a9('0x6')]['disabled']){utils['info'](_0xd4a9('0x7'));}else{var agents=require(_0xd4a9('0x8'));var calls=require(_0xd4a9('0x9'));var queues=require(_0xd4a9('0xa'));var recordings=require(_0xd4a9('0xb'));var members=require('./members.controller');var dials=require(_0xd4a9('0xc'));var transfers=require(_0xd4a9('0xd'));var core=require('./core.controller');ami['on'](_0xd4a9('0xe'),core[_0xd4a9('0xe')]);ami['on'](_0xd4a9('0xf'),core[_0xd4a9('0xf')]);ami['on']('fullybooted',core[_0xd4a9('0x10')]);ami['on'](_0xd4a9('0x11'),core[_0xd4a9('0x11')]);ami['on'](_0xd4a9('0x12'),core[_0xd4a9('0x12')]);ami['on']('managerevent',core[_0xd4a9('0x13')]);ami['on'](_0xd4a9('0x14'),function(_0x134fc6){try{utils['debug'](util[_0xd4a9('0x15')](_0xd4a9('0x16'),_0x134fc6[_0xd4a9('0x17')]),_0x134fc6);members['devicestatechange'](_0x134fc6);}catch(_0x3aa2eb){utils[_0xd4a9('0x11')](util['format'](_0xd4a9('0x16'),_0x134fc6[_0xd4a9('0x17')]),_0x3aa2eb);}});ami['on'](_0xd4a9('0x18'),function(_0x2e6336){try{utils[_0xd4a9('0x19')](util['format'](_0xd4a9('0x1a'),_0x2e6336[_0xd4a9('0x1b')]),_0x2e6336);agents[_0xd4a9('0x18')](_0x2e6336);}catch(_0x1fdfa0){utils['error'](util[_0xd4a9('0x15')](_0xd4a9('0x1a'),_0x2e6336[_0xd4a9('0x1b')]),_0x1fdfa0);}});ami['on'](_0xd4a9('0x1c'),function(_0x5c5fe8){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x1d'),_0x5c5fe8[_0xd4a9('0x1b')]),_0x5c5fe8);agents[_0xd4a9('0x1c')](_0x5c5fe8);}catch(_0x416bcd){utils['error'](util[_0xd4a9('0x15')](_0xd4a9('0x1d'),_0x5c5fe8[_0xd4a9('0x1b')]),_0x416bcd);}});ami['on']('agentconnect',function(_0x4be5c4){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')]('[%s][index][agentconnect]',_0x4be5c4['uniqueid']),_0x4be5c4);agents['agentconnect'](_0x4be5c4);queues['agentconnect'](_0x4be5c4);}catch(_0x103a36){utils['error'](util[_0xd4a9('0x15')](_0xd4a9('0x1e'),_0x4be5c4['uniqueid']),_0x103a36);}});ami['on'](_0xd4a9('0x1f'),function(_0x48d26c){try{utils['debug'](util[_0xd4a9('0x15')](_0xd4a9('0x20'),_0x48d26c[_0xd4a9('0x1b')]),_0x48d26c);agents['agentcomplete'](_0x48d26c);queues[_0xd4a9('0x1f')](_0x48d26c);members[_0xd4a9('0x1f')](_0x48d26c);}catch(_0x4db9da){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x20'),_0x48d26c[_0xd4a9('0x1b')]),_0x4db9da);}});ami['on'](_0xd4a9('0x21'),function(_0x3eba6a){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x22'),_0x3eba6a['uniqueid']),_0x3eba6a);agents['queuecallerabandon'](_0x3eba6a);queues[_0xd4a9('0x21')](_0x3eba6a);}catch(_0x62ac3f){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')]('[%s][index][queuecallerabandon]',_0x3eba6a['uniqueid']),_0x62ac3f);}});ami['on'](_0xd4a9('0x23'),function(_0x3a5a12){try{utils['debug'](util['format'](_0xd4a9('0x24'),_0x3a5a12[_0xd4a9('0x1b')]),_0x3a5a12);queues['queuecallerjoin'](_0x3a5a12);recordings[_0xd4a9('0x23')](_0x3a5a12);}catch(_0x4d1ef8){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x24'),_0x3a5a12['uniqueid']),_0x4d1ef8);}});ami['on'](_0xd4a9('0x25'),function(_0x210edd){try{utils['debug'](util['format'](_0xd4a9('0x26'),_0x210edd['uniqueid']),_0x210edd);queues[_0xd4a9('0x25')](_0x210edd);}catch(_0x451246){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x26'),_0x210edd['uniqueid']),_0x451246);}});ami['on']('musiconholdstart',function(_0x28e409){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x27'),_0x28e409['uniqueid']),_0x28e409);queues[_0xd4a9('0x28')](_0x28e409);calls[_0xd4a9('0x28')](_0x28e409);}catch(_0xa94784){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')]('[%s][index][musiconholdstart]',_0x28e409['uniqueid']),_0xa94784);}});ami['on'](_0xd4a9('0x29'),function(_0x1ae278){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x2a'),_0x1ae278[_0xd4a9('0x1b')]),_0x1ae278);queues[_0xd4a9('0x29')](_0x1ae278);calls[_0xd4a9('0x29')](_0x1ae278);}catch(_0x468cea){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')]('[%s][index][musiconholdstop]',_0x1ae278[_0xd4a9('0x1b')]),_0x468cea);}});ami['on']('newstate',function(_0x2fbeb4){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x2b'),_0x2fbeb4[_0xd4a9('0x1b')]),_0x2fbeb4);calls[_0xd4a9('0x2c')](_0x2fbeb4);recordings['newstate'](_0x2fbeb4);}catch(_0x2c5059){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x2b'),_0x2fbeb4['uniqueid']),_0x2c5059);}});ami['on'](_0xd4a9('0x2d'),function(_0x38df6){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x2e'),_0x38df6[_0xd4a9('0x1b')]),_0x38df6);calls[_0xd4a9('0x2d')](_0x38df6);recordings[_0xd4a9('0x2d')](_0x38df6);dials[_0xd4a9('0x2d')](_0x38df6);agents['hangup'](_0x38df6);queues[_0xd4a9('0x2d')](_0x38df6);}catch(_0x2ba2ab){utils[_0xd4a9('0x11')](util['format'](_0xd4a9('0x2e'),_0x38df6[_0xd4a9('0x1b')]),_0x2ba2ab);}});ami['on'](_0xd4a9('0x2f'),function(_0x475d6c){try{utils['debug'](util['format'](_0xd4a9('0x30'),_0x475d6c[_0xd4a9('0x1b')]),_0x475d6c);members[_0xd4a9('0x2f')](_0x475d6c);}catch(_0x5b559c){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')]('[%s][index][cdr]',_0x475d6c[_0xd4a9('0x1b')]),_0x5b559c);}});ami['on'](_0xd4a9('0x31'),function(_0x8e7a59){try{utils['debug'](util[_0xd4a9('0x15')](_0xd4a9('0x32'),_0x8e7a59['uniqueid']),_0x8e7a59);queues[_0xd4a9('0x31')](_0x8e7a59);agents[_0xd4a9('0x31')](_0x8e7a59);transfers[_0xd4a9('0x31')](_0x8e7a59);}catch(_0x1f1481){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x32'),_0x8e7a59['uniqueid']),_0x1f1481);}});ami['on'](_0xd4a9('0x33'),function(_0x2d51e5){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x34'),_0x2d51e5[_0xd4a9('0x35')]),_0x2d51e5);queues[_0xd4a9('0x33')](_0x2d51e5);transfers[_0xd4a9('0x33')](_0x2d51e5);agents[_0xd4a9('0x33')](_0x2d51e5);calls[_0xd4a9('0x33')](_0x2d51e5);}catch(_0x794abf){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x34'),_0x2d51e5['origtransfereruniqueid']),_0x794abf);}});ami['on'](_0xd4a9('0x36'),function(_0x19c29d){try{utils['debug'](util['format']('[%s][index][varset]',_0x19c29d['uniqueid']),_0x19c29d);queues[_0xd4a9('0x36')](_0x19c29d);recordings['varset'](_0x19c29d);calls[_0xd4a9('0x36')](_0x19c29d);dials[_0xd4a9('0x36')](_0x19c29d);}catch(_0x2e63a9){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x37'),_0x19c29d[_0xd4a9('0x1b')]),_0x2e63a9);}});ami['on'](_0xd4a9('0x38'),function(_0x199100){try{utils['debug'](util['format']('[%s][index][newexten]',_0x199100[_0xd4a9('0x1b')]),_0x199100);calls[_0xd4a9('0x38')](_0x199100);recordings[_0xd4a9('0x38')](_0x199100);dials[_0xd4a9('0x38')](_0x199100);}catch(_0x3a2ba3){utils[_0xd4a9('0x11')](util['format']('[%s][index][newexten]',_0x199100[_0xd4a9('0x1b')]),_0x3a2ba3);}});ami['on'](_0xd4a9('0x39'),function(_0xbe8f85){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')]('[%s][index][newchannel]',_0xbe8f85[_0xd4a9('0x1b')]),_0xbe8f85);calls[_0xd4a9('0x39')](_0xbe8f85);recordings[_0xd4a9('0x39')](_0xbe8f85);}catch(_0x26cd72){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')]('[%s][index][newchannel]',_0xbe8f85[_0xd4a9('0x1b')]),_0x26cd72);}});ami['on']('dialbegin',function(_0xd008e8){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x3a'),_0xd008e8['uniqueid']),_0xd008e8);dials['dialbegin'](_0xd008e8);}catch(_0xc611b5){utils[_0xd4a9('0x11')](util['format']('[%s]dialbegin',_0xd008e8['uniqueid']),_0xc611b5);}});ami['on'](_0xd4a9('0x3b'),function(_0x217520){try{utils[_0xd4a9('0x19')](util[_0xd4a9('0x15')](_0xd4a9('0x3c'),_0x217520[_0xd4a9('0x1b')]),_0x217520);dials[_0xd4a9('0x3b')](_0x217520);}catch(_0x2dcf15){utils[_0xd4a9('0x11')](util[_0xd4a9('0x15')](_0xd4a9('0x3c'),_0x217520[_0xd4a9('0x1b')]),_0x2dcf15);}});} \ No newline at end of file +var _0x556c=['error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','password','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted'];(function(_0x3183bd,_0x12165f){var _0x48d7a4=function(_0x4cb98c){while(--_0x4cb98c){_0x3183bd['push'](_0x3183bd['shift']());}};_0x48d7a4(++_0x12165f);}(_0x556c,0x1ce));var _0xc556=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x556c[_0x20a584];return _0x4b41a8;};var AsteriskManager=require(_0xc556('0x0'));var config=require(_0xc556('0x1'));var utils=require(_0xc556('0x2'));var util=require(_0xc556('0x3'));var ami=new AsteriskManager(config[_0xc556('0x4')][_0xc556('0x5')],config[_0xc556('0x4')]['ip'],config[_0xc556('0x4')][_0xc556('0x6')],config['asterisk'][_0xc556('0x7')],!![]);ami['keepConnected']();if(config[_0xc556('0x8')]&&config['xdr'][_0xc556('0x9')]){utils['info'](_0xc556('0xa'));}else{var agents=require(_0xc556('0xb'));var calls=require(_0xc556('0xc'));var queues=require(_0xc556('0xd'));var recordings=require(_0xc556('0xe'));var members=require(_0xc556('0xf'));var dials=require(_0xc556('0x10'));var transfers=require('./transfers.controller');var core=require(_0xc556('0x11'));ami['on'](_0xc556('0x12'),core['connect']);ami['on'](_0xc556('0x13'),core[_0xc556('0x13')]);ami['on'](_0xc556('0x14'),core[_0xc556('0x14')]);ami['on'](_0xc556('0x15'),core['error']);ami['on'](_0xc556('0x16'),core['close']);ami['on'](_0xc556('0x17'),core['managerevent']);ami['on'](_0xc556('0x18'),function(_0xcefdf4){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x1b'),_0xcefdf4[_0xc556('0x1c')]),_0xcefdf4);members[_0xc556('0x18')](_0xcefdf4);}catch(_0xa160e0){utils[_0xc556('0x15')](util[_0xc556('0x1a')]('[%s][index][devicestatechange]',_0xcefdf4[_0xc556('0x1c')]),_0xa160e0);}});ami['on']('agentcalled',function(_0x47ac0b){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x1d'),_0x47ac0b['uniqueid']),_0x47ac0b);agents[_0xc556('0x1e')](_0x47ac0b);}catch(_0x225da7){utils[_0xc556('0x15')](util['format'](_0xc556('0x1d'),_0x47ac0b[_0xc556('0x1f')]),_0x225da7);}});ami['on'](_0xc556('0x20'),function(_0x4a3f7b){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x21'),_0x4a3f7b[_0xc556('0x1f')]),_0x4a3f7b);agents[_0xc556('0x20')](_0x4a3f7b);}catch(_0x5436ee){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x21'),_0x4a3f7b['uniqueid']),_0x5436ee);}});ami['on'](_0xc556('0x22'),function(_0x800676){try{utils[_0xc556('0x19')](util['format'](_0xc556('0x23'),_0x800676[_0xc556('0x1f')]),_0x800676);agents[_0xc556('0x22')](_0x800676);queues[_0xc556('0x22')](_0x800676);}catch(_0x29a7f4){utils[_0xc556('0x15')](util['format'](_0xc556('0x23'),_0x800676[_0xc556('0x1f')]),_0x29a7f4);}});ami['on'](_0xc556('0x24'),function(_0x39d5a2){try{utils['debug'](util['format'](_0xc556('0x25'),_0x39d5a2[_0xc556('0x1f')]),_0x39d5a2);agents['agentcomplete'](_0x39d5a2);queues[_0xc556('0x24')](_0x39d5a2);members[_0xc556('0x24')](_0x39d5a2);}catch(_0x473516){utils[_0xc556('0x15')](util[_0xc556('0x1a')]('[%s][index][agentcomplete]',_0x39d5a2['uniqueid']),_0x473516);}});ami['on']('queuecallerabandon',function(_0x1b0d58){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x26'),_0x1b0d58['uniqueid']),_0x1b0d58);agents[_0xc556('0x27')](_0x1b0d58);queues[_0xc556('0x27')](_0x1b0d58);}catch(_0x528291){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x26'),_0x1b0d58['uniqueid']),_0x528291);}});ami['on'](_0xc556('0x28'),function(_0x258b31){try{utils[_0xc556('0x19')](util['format'](_0xc556('0x29'),_0x258b31[_0xc556('0x1f')]),_0x258b31);queues['queuecallerjoin'](_0x258b31);recordings['queuecallerjoin'](_0x258b31);}catch(_0x2e6e95){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x29'),_0x258b31[_0xc556('0x1f')]),_0x2e6e95);}});ami['on'](_0xc556('0x2a'),function(_0x2534b6){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x2b'),_0x2534b6[_0xc556('0x1f')]),_0x2534b6);queues[_0xc556('0x2a')](_0x2534b6);}catch(_0x12d837){utils[_0xc556('0x15')](util['format'](_0xc556('0x2b'),_0x2534b6['uniqueid']),_0x12d837);}});ami['on'](_0xc556('0x2c'),function(_0x38b8e9){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x2d'),_0x38b8e9[_0xc556('0x1f')]),_0x38b8e9);queues['musiconholdstart'](_0x38b8e9);calls[_0xc556('0x2c')](_0x38b8e9);}catch(_0x387e3a){utils[_0xc556('0x15')](util['format'](_0xc556('0x2d'),_0x38b8e9['uniqueid']),_0x387e3a);}});ami['on'](_0xc556('0x2e'),function(_0x852eb){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')]('[%s][index][musiconholdstop]',_0x852eb['uniqueid']),_0x852eb);queues[_0xc556('0x2e')](_0x852eb);calls['musiconholdstop'](_0x852eb);}catch(_0x471525){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x2f'),_0x852eb[_0xc556('0x1f')]),_0x471525);}});ami['on'](_0xc556('0x30'),function(_0x2e41b8){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x31'),_0x2e41b8[_0xc556('0x1f')]),_0x2e41b8);calls[_0xc556('0x30')](_0x2e41b8);recordings[_0xc556('0x30')](_0x2e41b8);}catch(_0x599100){utils['error'](util['format'](_0xc556('0x31'),_0x2e41b8[_0xc556('0x1f')]),_0x599100);}});ami['on'](_0xc556('0x32'),function(_0x4ab7c8){try{utils[_0xc556('0x19')](util['format'](_0xc556('0x33'),_0x4ab7c8[_0xc556('0x1f')]),_0x4ab7c8);calls[_0xc556('0x32')](_0x4ab7c8);recordings[_0xc556('0x32')](_0x4ab7c8);dials[_0xc556('0x32')](_0x4ab7c8);agents['hangup'](_0x4ab7c8);queues[_0xc556('0x32')](_0x4ab7c8);}catch(_0x240ddb){utils[_0xc556('0x15')](util[_0xc556('0x1a')]('[%s][index][hangup]',_0x4ab7c8['uniqueid']),_0x240ddb);}});ami['on'](_0xc556('0x34'),function(_0x40c4f1){try{utils[_0xc556('0x19')](util['format'](_0xc556('0x35'),_0x40c4f1['uniqueid']),_0x40c4f1);members[_0xc556('0x34')](_0x40c4f1);}catch(_0x185381){utils['error'](util[_0xc556('0x1a')](_0xc556('0x35'),_0x40c4f1[_0xc556('0x1f')]),_0x185381);}});ami['on'](_0xc556('0x36'),function(_0x36e337){try{utils['debug'](util[_0xc556('0x1a')](_0xc556('0x37'),_0x36e337['uniqueid']),_0x36e337);queues[_0xc556('0x36')](_0x36e337);agents[_0xc556('0x36')](_0x36e337);transfers['blindtransfer'](_0x36e337);}catch(_0x48f616){utils[_0xc556('0x15')](util['format'](_0xc556('0x37'),_0x36e337[_0xc556('0x1f')]),_0x48f616);}});ami['on'](_0xc556('0x38'),function(_0x17dc53){try{utils[_0xc556('0x19')](util['format']('[%s][index][attendedtransfer]',_0x17dc53[_0xc556('0x39')]),_0x17dc53);queues[_0xc556('0x38')](_0x17dc53);transfers[_0xc556('0x38')](_0x17dc53);agents[_0xc556('0x38')](_0x17dc53);calls[_0xc556('0x38')](_0x17dc53);}catch(_0x2bd0cf){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x3a'),_0x17dc53[_0xc556('0x39')]),_0x2bd0cf);}});ami['on'](_0xc556('0x3b'),function(_0x3dc6ec){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x3c'),_0x3dc6ec['uniqueid']),_0x3dc6ec);queues[_0xc556('0x3b')](_0x3dc6ec);recordings[_0xc556('0x3b')](_0x3dc6ec);calls['varset'](_0x3dc6ec);dials[_0xc556('0x3b')](_0x3dc6ec);}catch(_0x194511){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x3c'),_0x3dc6ec[_0xc556('0x1f')]),_0x194511);}});ami['on'](_0xc556('0x3d'),function(_0x803e41){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x3e'),_0x803e41[_0xc556('0x1f')]),_0x803e41);calls[_0xc556('0x3d')](_0x803e41);recordings[_0xc556('0x3d')](_0x803e41);dials['newexten'](_0x803e41);}catch(_0xff1b6c){utils[_0xc556('0x15')](util[_0xc556('0x1a')](_0xc556('0x3e'),_0x803e41[_0xc556('0x1f')]),_0xff1b6c);}});ami['on'](_0xc556('0x3f'),function(_0x14fa14){try{utils[_0xc556('0x19')](util['format'](_0xc556('0x40'),_0x14fa14[_0xc556('0x1f')]),_0x14fa14);calls[_0xc556('0x3f')](_0x14fa14);recordings[_0xc556('0x3f')](_0x14fa14);}catch(_0x1ad8c1){utils['error'](util['format'](_0xc556('0x40'),_0x14fa14[_0xc556('0x1f')]),_0x1ad8c1);}});ami['on']('dialbegin',function(_0x4254d1){try{utils[_0xc556('0x19')](util['format'](_0xc556('0x41'),_0x4254d1[_0xc556('0x1f')]),_0x4254d1);dials[_0xc556('0x42')](_0x4254d1);}catch(_0x161fde){utils[_0xc556('0x15')](util[_0xc556('0x1a')]('[%s]dialbegin',_0x4254d1[_0xc556('0x1f')]),_0x161fde);}});ami['on'](_0xc556('0x43'),function(_0x15c285){try{utils[_0xc556('0x19')](util[_0xc556('0x1a')](_0xc556('0x44'),_0x15c285[_0xc556('0x1f')]),_0x15c285);dials[_0xc556('0x43')](_0x15c285);}catch(_0x29d04f){utils[_0xc556('0x15')](util['format'](_0xc556('0x44'),_0x15c285[_0xc556('0x1f')]),_0x29d04f);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 64fa044..f53bb27 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 _0x8456=['uniqueid','interface','channel','data2','membername','type','internal','request','getUserByName','split','then','CreateMemberReport','catch','[%s][members][writeDB]','some','startsWith','devicestatechange','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','exitAt','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','isNil','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','lodash','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x8456,0xfd));var _0x6845=function(_0x4bccb4,_0x4c2102){_0x4bccb4=_0x4bccb4-0x0;var _0x43c2dd=_0x8456[_0x4bccb4];return _0x43c2dd;};'use strict';var _=require(_0x6845('0x0'));var util=require(_0x6845('0x1'));var utils=require(_0x6845('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x6845('0x3')];function writeDB(_0x4c0037){utils[_0x6845('0x4')](util[_0x6845('0x5')](_0x6845('0x6'),_0x4c0037[_0x6845('0x7')],_0x4c0037[_0x6845('0x8')],_0x4c0037[_0x6845('0x9')],_0x4c0037[_0x6845('0xa')],_0x4c0037[_0x6845('0xb')],_0x4c0037[_0x6845('0xc')]));if(_0x4c0037[_0x6845('0x8')]){utils['getUserByInterface'](_0x4c0037[_0x6845('0x8')])['then'](function(_0x1188df){if(_0x1188df){_0x4c0037[_0x6845('0xb')]=_0x1188df['name'];_0x4c0037[_0x6845('0xd')]=_0x1188df[_0x6845('0xd')];utils[_0x6845('0xe')]('CreateMemberReport',_0x4c0037);}else{utils[_0x6845('0xf')](_0x4c0037[_0x6845('0x8')][_0x6845('0x10')]('/')[0x1])[_0x6845('0x11')](function(_0x2c8557){if(_0x2c8557){_0x4c0037[_0x6845('0xb')]=_0x2c8557['name'];_0x4c0037[_0x6845('0xd')]=_0x2c8557[_0x6845('0xd')];utils[_0x6845('0xe')](_0x6845('0x12'),_0x4c0037);}});}})[_0x6845('0x13')](function(_0x570ee6){utils['error'](util[_0x6845('0x5')](_0x6845('0x14'),_0x4c0037[_0x6845('0x7')]),_0x570ee6);});}delete members[_0x4c0037['interface']];}function startsWith(_0x162425,_0x3ff153){return _[_0x6845('0x15')](_0x162425,function(_0x2396ba){return _[_0x6845('0x16')](_0x3ff153,_0x2396ba);});}exports[_0x6845('0x17')]=function(_0x3d6f07){try{utils['debug'](util[_0x6845('0x5')]('[%s][members][devicestatechange]',members[_0x3d6f07['device']]?members[_0x3d6f07[_0x6845('0x18')]][_0x6845('0x7')]:_0x3d6f07['device']),_0x3d6f07);utils[_0x6845('0x4')](util[_0x6845('0x5')](_0x6845('0x19'),members[_0x3d6f07[_0x6845('0x18')]]?members[_0x3d6f07[_0x6845('0x18')]][_0x6845('0x7')]:_0x3d6f07[_0x6845('0x18')],_0x3d6f07[_0x6845('0x1a')],_0x3d6f07['device']));switch(_0x3d6f07[_0x6845('0x1a')]){case _0x6845('0x1b'):case _0x6845('0x1c'):if(!startsWith(exclude,_0x3d6f07[_0x6845('0x18')])){members[_0x3d6f07['device']]={'channel':'voice','interface':_0x3d6f07['device'],'type':_0x6845('0x1d'),'enterAt':utils[_0x6845('0x1e')](),'role':_0x6845('0x1f')};}break;case _0x6845('0x20'):if(!_['isNil'](members[_0x3d6f07[_0x6845('0x18')]])){members[_0x3d6f07['device']][_0x6845('0x21')]=utils[_0x6845('0x1e')]();members[_0x3d6f07['device']][_0x6845('0x22')]=utils[_0x6845('0x23')](members[_0x3d6f07[_0x6845('0x18')]][_0x6845('0x21')],members[_0x3d6f07[_0x6845('0x18')]][_0x6845('0x24')]);if(members[_0x3d6f07[_0x6845('0x18')]]['uniqueid']){writeDB(members[_0x3d6f07[_0x6845('0x18')]]);}}break;default:break;}}catch(_0x29a61a){utils[_0x6845('0x25')](util['format'](_0x6845('0x26'),members[_0x3d6f07[_0x6845('0x18')]]?members[_0x3d6f07[_0x6845('0x18')]][_0x6845('0x7')]:_0x3d6f07[_0x6845('0x18')]),_0x29a61a);}};exports['agentcomplete']=function(_0x14cd05){try{if(!_[_0x6845('0x27')](members[_0x14cd05['interface']])){utils[_0x6845('0x28')](util[_0x6845('0x5')](_0x6845('0x29'),_0x14cd05['uniqueid']),_0x14cd05);utils['info'](util[_0x6845('0x5')](_0x6845('0x2a'),_0x14cd05[_0x6845('0x7')],_0x14cd05[_0x6845('0x8')],_0x14cd05['queue']));members[_0x14cd05['interface']]=_['assign'](members[_0x14cd05[_0x6845('0x8')]],{'data4':_0x14cd05['queue'],'uniqueid':_0x14cd05[_0x6845('0x7')]});}}catch(_0x478fe1){utils[_0x6845('0x25')](util[_0x6845('0x5')](_0x6845('0x29'),_0x14cd05[_0x6845('0x7')]),_0x478fe1);}};exports[_0x6845('0x2b')]=function(_0xabd895){try{utils[_0x6845('0x28')](util['format'](_0x6845('0x2c'),_0xabd895['uniqueid']),_0xabd895);if(_0xabd895['channel']){var _0x369afe=_0xabd895[_0x6845('0x9')][_0x6845('0x10')]('-')[0x0];if(!_[_0x6845('0x27')](members[_0x369afe])){members[_0x369afe]=_['assign'](members[_0x369afe],{'data1':members[_0x369afe][_0x6845('0x2d')]||_0xabd895[_0x6845('0xc')],'data2':members[_0x369afe][_0x6845('0xa')]||_0xabd895[_0x6845('0x2e')],'data3':members[_0x369afe][_0x6845('0x2f')]||_0xabd895[_0x6845('0x30')],'uniqueid':members[_0x369afe][_0x6845('0x7')]||_0xabd895[_0x6845('0x7')]});utils['info'](util[_0x6845('0x5')](_0x6845('0x31'),_0xabd895[_0x6845('0x7')],members[_0x369afe][_0x6845('0x2d')],members[_0x369afe][_0x6845('0xa')],members[_0x369afe][_0x6845('0x2f')]));if(members[_0x369afe][_0x6845('0x21')]){writeDB(members[_0x369afe]);}}}if(_0xabd895[_0x6845('0x32')]){var _0x47249c=_0xabd895[_0x6845('0x32')]['split']('-')[0x0];if(!_[_0x6845('0x27')](members[_0x47249c])){members[_0x47249c]=_[_0x6845('0x33')](members[_0x47249c],{'data1':members[_0x47249c]['data1']||_0xabd895[_0x6845('0xc')],'data2':members[_0x47249c][_0x6845('0xa')]||_0xabd895[_0x6845('0x2e')],'data3':members[_0x47249c][_0x6845('0x2f')]||_0xabd895[_0x6845('0x30')],'uniqueid':members[_0x47249c][_0x6845('0x7')]||_0xabd895[_0x6845('0x7')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xabd895[_0x6845('0x7')],members[_0x47249c][_0x6845('0x2d')],members[_0x47249c][_0x6845('0xa')],members[_0x47249c][_0x6845('0x2f')]));if(members[_0x47249c][_0x6845('0x21')]){writeDB(members[_0x47249c]);}}}}catch(_0x3434d7){utils['error'](util[_0x6845('0x5')](_0x6845('0x2c'),_0xabd895[_0x6845('0x7')]),_0x3434d7);}}; \ No newline at end of file +var _0xd90e=['some','devicestatechange','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','channel','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','membername','catch','error','[%s][members][writeDB]'];(function(_0x3b43f8,_0x54c0a0){var _0x5e50fb=function(_0x3fbc9b){while(--_0x3fbc9b){_0x3b43f8['push'](_0x3b43f8['shift']());}};_0x5e50fb(++_0x54c0a0);}(_0xd90e,0x17c));var _0xed90=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd90e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xed90('0x0'));var util=require('util');var utils=require(_0xed90('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x198cff){utils['info'](util[_0xed90('0x2')](_0xed90('0x3'),_0x198cff[_0xed90('0x4')],_0x198cff[_0xed90('0x5')],_0x198cff['channel'],_0x198cff[_0xed90('0x6')],_0x198cff['membername'],_0x198cff[_0xed90('0x7')]));if(_0x198cff[_0xed90('0x5')]){utils[_0xed90('0x8')](_0x198cff[_0xed90('0x5')])[_0xed90('0x9')](function(_0x547ea3){if(_0x547ea3){_0x198cff['membername']=_0x547ea3[_0xed90('0xa')];_0x198cff['internal']=_0x547ea3[_0xed90('0xb')];utils[_0xed90('0xc')](_0xed90('0xd'),_0x198cff);}else{utils[_0xed90('0xe')](_0x198cff['interface'][_0xed90('0xf')]('/')[0x1])['then'](function(_0x189ad7){if(_0x189ad7){_0x198cff[_0xed90('0x10')]=_0x189ad7['name'];_0x198cff['internal']=_0x189ad7[_0xed90('0xb')];utils[_0xed90('0xc')]('CreateMemberReport',_0x198cff);}});}})[_0xed90('0x11')](function(_0x30e1e4){utils[_0xed90('0x12')](util[_0xed90('0x2')](_0xed90('0x13'),_0x198cff[_0xed90('0x4')]),_0x30e1e4);});}delete members[_0x198cff[_0xed90('0x5')]];}function startsWith(_0x587533,_0xcd392f){return _[_0xed90('0x14')](_0x587533,function(_0x5a4590){return _['startsWith'](_0xcd392f,_0x5a4590);});}exports[_0xed90('0x15')]=function(_0xa87e97){try{utils['debug'](util[_0xed90('0x2')](_0xed90('0x16'),members[_0xa87e97['device']]?members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x4')]:_0xa87e97[_0xed90('0x17')]),_0xa87e97);utils[_0xed90('0x18')](util[_0xed90('0x2')](_0xed90('0x19'),members[_0xa87e97[_0xed90('0x17')]]?members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x4')]:_0xa87e97[_0xed90('0x17')],_0xa87e97[_0xed90('0x1a')],_0xa87e97[_0xed90('0x17')]));switch(_0xa87e97[_0xed90('0x1a')]){case _0xed90('0x1b'):case _0xed90('0x1c'):if(!startsWith(exclude,_0xa87e97[_0xed90('0x17')])){members[_0xa87e97[_0xed90('0x17')]]={'channel':'voice','interface':_0xa87e97[_0xed90('0x17')],'type':_0xed90('0x1d'),'enterAt':utils[_0xed90('0x1e')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xed90('0x1f')](members[_0xa87e97[_0xed90('0x17')]])){members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x20')]=utils[_0xed90('0x1e')]();members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x21')]=utils[_0xed90('0x22')](members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x20')],members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x23')]);if(members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x4')]){writeDB(members[_0xa87e97[_0xed90('0x17')]]);}}break;default:break;}}catch(_0x57ecf6){utils['error'](util['format'](_0xed90('0x16'),members[_0xa87e97[_0xed90('0x17')]]?members[_0xa87e97[_0xed90('0x17')]][_0xed90('0x4')]:_0xa87e97['device']),_0x57ecf6);}};exports[_0xed90('0x24')]=function(_0x351daf){try{if(!_[_0xed90('0x1f')](members[_0x351daf[_0xed90('0x5')]])){utils[_0xed90('0x25')](util[_0xed90('0x2')](_0xed90('0x26'),_0x351daf[_0xed90('0x4')]),_0x351daf);utils['info'](util[_0xed90('0x2')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x351daf[_0xed90('0x4')],_0x351daf['interface'],_0x351daf[_0xed90('0x27')]));members[_0x351daf[_0xed90('0x5')]]=_[_0xed90('0x28')](members[_0x351daf['interface']],{'data4':_0x351daf['queue'],'uniqueid':_0x351daf[_0xed90('0x4')]});}}catch(_0x188bab){utils['error'](util[_0xed90('0x2')]('[%s][members][agentcomplete]',_0x351daf['uniqueid']),_0x188bab);}};exports[_0xed90('0x29')]=function(_0x4879cc){try{utils['debug'](util[_0xed90('0x2')](_0xed90('0x2a'),_0x4879cc[_0xed90('0x4')]),_0x4879cc);if(_0x4879cc[_0xed90('0x2b')]){var _0x1be56c=_0x4879cc[_0xed90('0x2b')]['split']('-')[0x0];if(!_[_0xed90('0x1f')](members[_0x1be56c])){members[_0x1be56c]=_['assign'](members[_0x1be56c],{'data1':members[_0x1be56c][_0xed90('0x2c')]||_0x4879cc[_0xed90('0x7')],'data2':members[_0x1be56c]['data2']||_0x4879cc[_0xed90('0x2d')],'data3':members[_0x1be56c][_0xed90('0x2e')]||_0x4879cc[_0xed90('0x2f')],'uniqueid':members[_0x1be56c][_0xed90('0x4')]||_0x4879cc[_0xed90('0x4')]});utils['info'](util[_0xed90('0x2')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4879cc['uniqueid'],members[_0x1be56c][_0xed90('0x2c')],members[_0x1be56c][_0xed90('0x6')],members[_0x1be56c][_0xed90('0x2e')]));if(members[_0x1be56c][_0xed90('0x20')]){writeDB(members[_0x1be56c]);}}}if(_0x4879cc[_0xed90('0x30')]){var _0x2a28bd=_0x4879cc[_0xed90('0x30')][_0xed90('0xf')]('-')[0x0];if(!_['isNil'](members[_0x2a28bd])){members[_0x2a28bd]=_['assign'](members[_0x2a28bd],{'data1':members[_0x2a28bd]['data1']||_0x4879cc[_0xed90('0x7')],'data2':members[_0x2a28bd][_0xed90('0x6')]||_0x4879cc[_0xed90('0x2d')],'data3':members[_0x2a28bd][_0xed90('0x2e')]||_0x4879cc['destination'],'uniqueid':members[_0x2a28bd][_0xed90('0x4')]||_0x4879cc[_0xed90('0x4')]});utils[_0xed90('0x18')](util['format'](_0xed90('0x31'),_0x4879cc['uniqueid'],members[_0x2a28bd][_0xed90('0x2c')],members[_0x2a28bd][_0xed90('0x6')],members[_0x2a28bd][_0xed90('0x2e')]));if(members[_0x2a28bd][_0xed90('0x20')]){writeDB(members[_0x2a28bd]);}}}}catch(_0x5c2aaf){utils[_0xed90('0x12')](util[_0xed90('0x2')](_0xed90('0x2a'),_0x4879cc['uniqueid']),_0x5c2aaf);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 71a5925..5c7de39 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 _0x7c95=['[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','CONTINUE','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','clone','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','calleridnum','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','debug','[%s][queues][queuecallerjoin]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7c95,0x1a1));var _0x57c9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x7c95[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0x57c9('0x0'));var util=require(_0x57c9('0x1'));var utils=require(_0x57c9('0x2'));var queues={};function writeDB(_0x53b16d){utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x5'),_0x53b16d['uniqueid'],_0x53b16d[_0x57c9('0x6')],_0x53b16d[_0x57c9('0x7')],_0x53b16d[_0x57c9('0x8')],_0x53b16d['calleridnum'],_0x53b16d[_0x57c9('0x9')],_0x53b16d[_0x57c9('0xa')]));if(_0x53b16d['queue']){utils['getVoiceQueueByName'](_0x53b16d[_0x57c9('0x7')])[_0x57c9('0xb')](function(_0x56b9e7){if(_0x56b9e7){_0x53b16d[_0x57c9('0xc')]=_0x56b9e7[_0x57c9('0xc')];}utils['request']('CreateVoiceQueueReport',_0x53b16d);});}else{utils[_0x57c9('0xd')](_0x57c9('0xe'),_0x53b16d);}if(_0x53b16d[_0x57c9('0xf')]){delete queues[_0x53b16d[_0x57c9('0xf')]];}else{delete queues[_0x53b16d[_0x57c9('0x10')]];}}exports['queuecallerjoin']=function(_0x23535a){try{utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x12'),_0x23535a[_0x57c9('0x10')]),_0x23535a);utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x13'),_0x23535a[_0x57c9('0x10')],_0x23535a[_0x57c9('0x7')],_0x23535a[_0x57c9('0x14')]));queues[_0x23535a[_0x57c9('0x10')]]=_[_0x57c9('0x15')](_0x23535a,{'originalposition':_0x23535a[_0x57c9('0x14')],'queuecallerjoinAt':utils[_0x57c9('0x16')](),'mohtime':0x0});}catch(_0x4fbc0d){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x12'),_0x23535a[_0x57c9('0x10')]),_0x4fbc0d);}};exports[_0x57c9('0x18')]=function(_0x3dc6d1){try{if(!_[_0x57c9('0x19')](queues[_0x3dc6d1[_0x57c9('0x10')]])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x1a'),_0x3dc6d1['uniqueid']),_0x3dc6d1);if(queues[_0x3dc6d1['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0x1b')]&&!queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0x1c')]){queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0x1d')]=!![];queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0x1e')]=utils[_0x57c9('0x16')]();queues[_0x3dc6d1['uniqueid']][_0x57c9('0xa')]=_0x57c9('0x1f');}utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x20'),_0x3dc6d1[_0x57c9('0x10')],queues[_0x3dc6d1['uniqueid']][_0x57c9('0x21')],queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0xa')]));writeDB(queues[_0x3dc6d1[_0x57c9('0x10')]]);}else if(queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0xf')]){utils['info'](util[_0x57c9('0x4')](_0x57c9('0x22'),_0x3dc6d1[_0x57c9('0x10')],queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0x21')],queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0xf')]));queues[queues[_0x3dc6d1['uniqueid']][_0x57c9('0xf')]]=queues[_0x3dc6d1[_0x57c9('0x10')]];queues[queues[_0x3dc6d1[_0x57c9('0x10')]][_0x57c9('0xf')]][_0x57c9('0x23')]=0x2;delete queues[_0x3dc6d1['uniqueid']];}}}catch(_0x43d8cf){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x1a'),_0x3dc6d1['uniqueid']),_0x43d8cf);}};exports[_0x57c9('0x24')]=function(_0x3b4c39){try{utils[_0x57c9('0x11')](util['format'](_0x57c9('0x25'),_0x3b4c39['uniqueid']),_0x3b4c39);if(!_[_0x57c9('0x19')](_0x3b4c39[_0x57c9('0x26')][_0x57c9('0x27')])&&_0x3b4c39['value']['toUpperCase']()!==_0x57c9('0x28')){if(!_[_0x57c9('0x19')](queues[_0x3b4c39['uniqueid']])){queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0x1b')]=![];queues[_0x3b4c39[_0x57c9('0x10')]]['queuecallerabandonAt']=null;queues[_0x3b4c39['uniqueid']][_0x57c9('0x1c')]=!![];queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0x29')]=utils['now']();queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0xa')]=_0x3b4c39['value'][_0x57c9('0x2a')]();utils['info'](util['format'](_0x57c9('0x2b'),_0x3b4c39[_0x57c9('0x10')],queues[_0x3b4c39[_0x57c9('0x10')]]['name'],_0x3b4c39[_0x57c9('0x2c')],queues[_0x3b4c39[_0x57c9('0x10')]]['queuecallerexitreason']));writeDB(queues[_0x3b4c39['uniqueid']]);}}else if(!_[_0x57c9('0x19')](_0x3b4c39[_0x57c9('0x26')]['queueposition'])){if(!_['isNil'](queues[_0x3b4c39[_0x57c9('0x10')]])&&!queues[_0x3b4c39['uniqueid']][_0x57c9('0x1b')]){queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0x1b')]=![];queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0x2d')]=null;queues[_0x3b4c39[_0x57c9('0x10')]]['queuecallerexit']=!![];queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0x29')]=utils[_0x57c9('0x16')]();queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0xa')]=_0x57c9('0x2e');utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x2f'),_0x3b4c39[_0x57c9('0x10')],queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0x21')],_0x3b4c39['value'],queues[_0x3b4c39[_0x57c9('0x10')]][_0x57c9('0xa')]));}}}catch(_0x1dabf){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x25'),_0x3b4c39[_0x57c9('0x10')]),_0x1dabf);}};exports[_0x57c9('0x1b')]=function(_0x17ca53){try{if(!_['isNil'](queues[_0x17ca53['uniqueid']])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x30'),_0x17ca53[_0x57c9('0x10')]),_0x17ca53);queues[_0x17ca53[_0x57c9('0x10')]][_0x57c9('0x1c')]=![];queues[_0x17ca53['uniqueid']][_0x57c9('0x29')]=null;queues[_0x17ca53[_0x57c9('0x10')]][_0x57c9('0x1b')]=!![];queues[_0x17ca53[_0x57c9('0x10')]][_0x57c9('0x2d')]=utils[_0x57c9('0x16')]();queues[_0x17ca53['uniqueid']][_0x57c9('0xa')]=_0x57c9('0x31');utils[_0x57c9('0x3')](util['format'](_0x57c9('0x32'),_0x17ca53[_0x57c9('0x10')],queues[_0x17ca53[_0x57c9('0x10')]][_0x57c9('0x21')],queues[_0x17ca53[_0x57c9('0x10')]][_0x57c9('0xa')]));}}catch(_0x2a802c){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x30'),_0x17ca53[_0x57c9('0x10')]),_0x2a802c);}};exports['queuecallerleave']=function(_0x263717){try{if(!_[_0x57c9('0x19')](queues[_0x263717['uniqueid']])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')]('[%s][queues][queuecallerleave]',_0x263717['uniqueid']),_0x263717);utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x33'),_0x263717['uniqueid'],queues[_0x263717[_0x57c9('0x10')]]['name'],_0x263717[_0x57c9('0x34')],_0x263717[_0x57c9('0x35')]));queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x36')]=!![];queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x37')]=utils[_0x57c9('0x16')]();queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x38')]=utils[_0x57c9('0x39')](queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x37')],queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x3a')]);queues[_0x263717['uniqueid']][_0x57c9('0x14')]=_0x263717[_0x57c9('0x14')];queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x3b')]=_0x263717[_0x57c9('0x3b')];queues[_0x263717[_0x57c9('0x10')]][_0x57c9('0x34')]=_0x263717[_0x57c9('0x34')];queues[_0x263717['uniqueid']][_0x57c9('0x35')]=_0x263717[_0x57c9('0x35')];}}catch(_0x4a7891){utils['error'](util[_0x57c9('0x4')](_0x57c9('0x3c'),_0x263717[_0x57c9('0x10')]),_0x4a7891);}};exports['agentconnect']=function(_0xf5a312){try{if(!_[_0x57c9('0x19')](queues[_0xf5a312[_0x57c9('0x10')]])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x3d'),_0xf5a312[_0x57c9('0x10')]),_0xf5a312);utils[_0x57c9('0x3')](util['format'](_0x57c9('0x3e'),_0xf5a312['uniqueid'],queues[_0xf5a312[_0x57c9('0x10')]]['name'],_0xf5a312[_0x57c9('0x3f')],_0xf5a312[_0x57c9('0x40')]));queues[_0xf5a312['uniqueid']][_0x57c9('0x1b')]=![];queues[_0xf5a312[_0x57c9('0x10')]][_0x57c9('0x1b')]=![];queues[_0xf5a312['uniqueid']]['queuecallerabandonAt']=null;queues[_0xf5a312['uniqueid']]['queuecallerexit']=![];queues[_0xf5a312['uniqueid']][_0x57c9('0xa')]=null;queues[_0xf5a312[_0x57c9('0x10')]]['queuecallerexitAt']=null;queues[_0xf5a312[_0x57c9('0x10')]][_0x57c9('0x41')]=!![];queues[_0xf5a312['uniqueid']][_0x57c9('0x9')]=_0xf5a312[_0x57c9('0x40')];queues[_0xf5a312[_0x57c9('0x10')]][_0x57c9('0x8')]=_0xf5a312[_0x57c9('0x3f')];}}catch(_0xe1c86c){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x3d'),_0xf5a312[_0x57c9('0x10')]),_0xe1c86c);}};exports[_0x57c9('0x42')]=function(_0xbaca2d){try{if(!_[_0x57c9('0x19')](queues[_0xbaca2d['uniqueid']])){if(queues[_0xbaca2d[_0x57c9('0x10')]]['queuecallerleaveAt']){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x43'),_0xbaca2d[_0x57c9('0x10')]),_0xbaca2d);queues[_0xbaca2d['uniqueid']]['queuecallerabandon']=![];queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x1b')]=![];queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x2d')]=null;queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x1c')]=![];queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x29')]=null;queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x41')]=!![];queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x8')]=_0xbaca2d[_0x57c9('0x3f')];queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x1d')]=!![];queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x1e')]=utils[_0x57c9('0x16')]();if(_0xbaca2d[_0x57c9('0x44')]==_0x57c9('0x45')){if(!queues[_0xbaca2d['uniqueid']]['transfer']){queues[_0xbaca2d['uniqueid']]['queuecallerexitreason']=_0x57c9('0x46');}}else{queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0xa')]=_0x57c9('0x47')+_0xbaca2d['reason'][_0x57c9('0x2a')]();}utils['info'](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xbaca2d[_0x57c9('0x10')],queues[_0xbaca2d[_0x57c9('0x10')]][_0x57c9('0x21')],_0xbaca2d[_0x57c9('0x3f')],queues[_0xbaca2d['uniqueid']][_0x57c9('0xa')]));writeDB(queues[_0xbaca2d[_0x57c9('0x10')]]);}}}catch(_0x56d27e){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x43'),_0xbaca2d[_0x57c9('0x10')]),_0x56d27e);}};exports['blindtransfer']=function(_0x24427a){try{if(!_['isNil'](queues[_0x24427a['transfereeuniqueid']])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x48'),_0x24427a['uniqueid']),_0x24427a);queues[_0x24427a[_0x57c9('0x49')]]['transfer']=!![];queues[_0x24427a['transfereeuniqueid']][_0x57c9('0x4a')]='BLIND';queues[_0x24427a[_0x57c9('0x49')]][_0x57c9('0x4b')]=_0x24427a[_0x57c9('0x4c')];queues[_0x24427a['transfereeuniqueid']][_0x57c9('0x4d')]=_0x24427a[_0x57c9('0x49')];queues[_0x24427a[_0x57c9('0x49')]]['queuecallerexitreason']=_0x57c9('0x4e');utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x4f'),_0x24427a[_0x57c9('0x10')],queues[_0x24427a['transfereeuniqueid']][_0x57c9('0x21')],_0x24427a[_0x57c9('0x49')],_0x24427a[_0x57c9('0x4c')]));}}catch(_0x360a9c){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x48'),_0x24427a['uniqueid']),_0x360a9c);}};exports[_0x57c9('0x50')]=function(_0x1c06c4){try{utils[_0x57c9('0x11')](util['format'](_0x57c9('0x51'),_0x1c06c4[_0x57c9('0x52')]),_0x1c06c4);if(_0x1c06c4[_0x57c9('0x52')]==_0x1c06c4[_0x57c9('0x53')]){if(!_[_0x57c9('0x19')](queues[_0x1c06c4[_0x57c9('0x54')]])){utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x55'),_0x1c06c4['origtransfereruniqueid'],queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0x21')],_0x1c06c4[_0x57c9('0x56')]));queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0x45')]=!![];queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0x4a')]=_0x57c9('0x57');queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0x4b')]=_0x1c06c4[_0x57c9('0x56')];queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0x4d')]=_0x1c06c4[_0x57c9('0x52')];queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0xa')]=_0x57c9('0x58');}if(!_[_0x57c9('0x19')](queues[_0x1c06c4[_0x57c9('0x53')]])){if(_0x1c06c4['transfereelinkedid']&&queues[_0x1c06c4['transfereelinkedid']]){queues[_0x1c06c4['transfereelinkedid']][_0x57c9('0x23')]=0x1;queues[_0x1c06c4['transfereeuniqueid']]=_[_0x57c9('0x59')](queues[_0x1c06c4[_0x57c9('0x5a')]]);queues[_0x1c06c4['transfereeuniqueid']][_0x57c9('0xf')]=_0x1c06c4[_0x57c9('0x5b')];queues[_0x1c06c4['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x1c06c4[_0x57c9('0x49')]]['calleridnum']=queues[_0x1c06c4['secondtransfererlinkedid']]['calleridnum'];queues[_0x1c06c4[_0x57c9('0x49')]][_0x57c9('0x5c')]=queues[_0x1c06c4['secondtransfererlinkedid']][_0x57c9('0x5c')];queues[_0x1c06c4[_0x57c9('0x49')]][_0x57c9('0x3a')]=utils[_0x57c9('0x16')]();queues[_0x1c06c4[_0x57c9('0x49')]]['queuecallerleaveAt']=utils['now']();queues[_0x1c06c4[_0x57c9('0x49')]]['holdtime']=0x0;queues[_0x1c06c4[_0x57c9('0x49')]][_0x57c9('0x5d')]=0x0;utils['info'](util[_0x57c9('0x4')](_0x57c9('0x5e'),_0x1c06c4[_0x57c9('0x52')],queues[_0x1c06c4[_0x57c9('0x49')]][_0x57c9('0x21')],queues[_0x1c06c4[_0x57c9('0x49')]]['calleridnum'],queues[_0x1c06c4[_0x57c9('0x49')]][_0x57c9('0x5c')]));}else{utils[_0x57c9('0x3')](util[_0x57c9('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1c06c4['origtransfereruniqueid'],queues[_0x1c06c4[_0x57c9('0x53')]][_0x57c9('0x21')],_0x1c06c4[_0x57c9('0x54')]));queues[_0x1c06c4[_0x57c9('0x53')]][_0x57c9('0xf')]=_0x1c06c4[_0x57c9('0x54')];}}}else if(_0x1c06c4['secondtransfereruniqueid']==_0x1c06c4[_0x57c9('0x54')]){if(!_['isNil'](queues[_0x1c06c4[_0x57c9('0x53')]])){utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x5f'),_0x1c06c4['origtransfereruniqueid'],queues[_0x1c06c4[_0x57c9('0x53')]][_0x57c9('0x21')],_0x1c06c4[_0x57c9('0x60')],_0x1c06c4[_0x57c9('0x61')]));queues[_0x1c06c4[_0x57c9('0x53')]][_0x57c9('0x45')]=!![];queues[_0x1c06c4['origtransfererlinkedid']][_0x57c9('0x4a')]='ATTENDED';queues[_0x1c06c4['origtransfererlinkedid']][_0x57c9('0x4b')]=_0x1c06c4[_0x57c9('0x61')];queues[_0x1c06c4['origtransfererlinkedid']]['transferuniqueid']=_0x1c06c4[_0x57c9('0x60')];queues[_0x1c06c4['origtransfererlinkedid']]['queuecallerexitreason']=_0x57c9('0x58');}if(!_[_0x57c9('0x19')](queues[_0x1c06c4[_0x57c9('0x54')]])){if(_0x1c06c4[_0x57c9('0x62')]&&queues[_0x1c06c4[_0x57c9('0x62')]]){queues[_0x1c06c4['transfertargetlinkedid']][_0x57c9('0x23')]=0x1;queues[_0x1c06c4[_0x57c9('0x5b')]]=_[_0x57c9('0x59')](queues[_0x1c06c4[_0x57c9('0x62')]]);queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0xf')]=_0x1c06c4[_0x57c9('0x5b')];queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0x23')]=0x2;queues[_0x1c06c4['transfertargetuniqueid']][_0x57c9('0x63')]=queues[_0x1c06c4['origtransfererlinkedid']][_0x57c9('0x63')];queues[_0x1c06c4[_0x57c9('0x5b')]]['calleridname']=queues[_0x1c06c4[_0x57c9('0x53')]][_0x57c9('0x5c')];queues[_0x1c06c4['transfertargetuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0x37')]=utils[_0x57c9('0x16')]();queues[_0x1c06c4['transfertargetuniqueid']][_0x57c9('0x38')]=0x0;queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0x5d')]=0x0;utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x64'),_0x1c06c4[_0x57c9('0x52')],queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0x21')],queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0xf')],queues[_0x1c06c4[_0x57c9('0x5b')]][_0x57c9('0x63')],queues[_0x1c06c4['transfertargetuniqueid']][_0x57c9('0x5c')]));}else{utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x65'),_0x1c06c4[_0x57c9('0x52')],queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0x21')],_0x1c06c4[_0x57c9('0x53')]));queues[_0x1c06c4[_0x57c9('0x54')]][_0x57c9('0xf')]=_0x1c06c4[_0x57c9('0x53')];}}}}catch(_0x561820){utils[_0x57c9('0x17')](util[_0x57c9('0x4')]('[%s][queues][attendedtransfer]',_0x1c06c4['origtransfereruniqueid']),_0x561820);}};exports[_0x57c9('0x66')]=function(_0x3eae67){try{if(!_[_0x57c9('0x19')](queues[_0x3eae67[_0x57c9('0x10')]])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x67'),_0x3eae67[_0x57c9('0x10')]),_0x3eae67);queues[_0x3eae67['uniqueid']][_0x57c9('0x68')]=utils[_0x57c9('0x16')]();utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x69'),_0x3eae67['uniqueid'],queues[_0x3eae67[_0x57c9('0x10')]]['name'],queues[_0x3eae67['uniqueid']][_0x57c9('0x68')]));}}catch(_0x370059){utils[_0x57c9('0x17')](util[_0x57c9('0x4')](_0x57c9('0x67'),_0x3eae67['uniqueid']),_0x370059);}};exports[_0x57c9('0x6a')]=function(_0x5b4c84){try{if(!_[_0x57c9('0x19')](queues[_0x5b4c84[_0x57c9('0x10')]])){if(!_[_0x57c9('0x19')](queues[_0x5b4c84[_0x57c9('0x10')]][_0x57c9('0x68')])){utils[_0x57c9('0x11')](util[_0x57c9('0x4')](_0x57c9('0x6b'),_0x5b4c84[_0x57c9('0x10')]),_0x5b4c84);queues[_0x5b4c84[_0x57c9('0x10')]][_0x57c9('0x5d')]+=utils[_0x57c9('0x39')](utils[_0x57c9('0x16')](),queues[_0x5b4c84[_0x57c9('0x10')]][_0x57c9('0x68')]);utils[_0x57c9('0x3')](util[_0x57c9('0x4')](_0x57c9('0x6c'),_0x5b4c84[_0x57c9('0x10')],queues[_0x5b4c84[_0x57c9('0x10')]][_0x57c9('0x21')],queues[_0x5b4c84[_0x57c9('0x10')]][_0x57c9('0x5d')]));delete queues[_0x5b4c84['uniqueid']][_0x57c9('0x68')];}}}catch(_0x5a97b2){utils['error'](util[_0x57c9('0x4')](_0x57c9('0x6b'),_0x5b4c84['uniqueid']),_0x5a97b2);}}; \ No newline at end of file +var _0x4f0f=['transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','now','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','[%s][queues][hangup]','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][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','position','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','queuecallercomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED'];(function(_0x5d611d,_0x454b4b){var _0x280733=function(_0x1fc51d){while(--_0x1fc51d){_0x5d611d['push'](_0x5d611d['shift']());}};_0x280733(++_0x454b4b);}(_0x4f0f,0x1c1));var _0xf4f0=function(_0x564974,_0x56c496){_0x564974=_0x564974-0x0;var _0x48c751=_0x4f0f[_0x564974];return _0x48c751;};'use strict';var _=require(_0xf4f0('0x0'));var util=require(_0xf4f0('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1ecb0f){utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x4'),_0x1ecb0f[_0xf4f0('0x5')],_0x1ecb0f[_0xf4f0('0x6')],_0x1ecb0f[_0xf4f0('0x7')],_0x1ecb0f[_0xf4f0('0x8')],_0x1ecb0f[_0xf4f0('0x9')],_0x1ecb0f[_0xf4f0('0xa')],_0x1ecb0f[_0xf4f0('0xb')]));if(_0x1ecb0f[_0xf4f0('0x7')]){utils['getVoiceQueueByName'](_0x1ecb0f['queue'])[_0xf4f0('0xc')](function(_0x42c5c2){if(_0x42c5c2){_0x1ecb0f['type']=_0x42c5c2[_0xf4f0('0xd')];}utils['request'](_0xf4f0('0xe'),_0x1ecb0f);});}else{utils['request'](_0xf4f0('0xe'),_0x1ecb0f);}if(_0x1ecb0f['transfereduniqueid']){delete queues[_0x1ecb0f[_0xf4f0('0xf')]];}else{delete queues[_0x1ecb0f[_0xf4f0('0x5')]];}}exports['queuecallerjoin']=function(_0x194616){try{utils[_0xf4f0('0x10')](util[_0xf4f0('0x3')](_0xf4f0('0x11'),_0x194616[_0xf4f0('0x5')]),_0x194616);utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x12'),_0x194616[_0xf4f0('0x5')],_0x194616[_0xf4f0('0x7')],_0x194616['position']));queues[_0x194616[_0xf4f0('0x5')]]=_[_0xf4f0('0x13')](_0x194616,{'originalposition':_0x194616['position'],'queuecallerjoinAt':utils[_0xf4f0('0x14')](),'mohtime':0x0});}catch(_0x2d12f4){utils['error'](util[_0xf4f0('0x3')]('[%s][queues][queuecallerjoin]',_0x194616[_0xf4f0('0x5')]),_0x2d12f4);}};exports['hangup']=function(_0x3dc51b){try{if(!_[_0xf4f0('0x15')](queues[_0x3dc51b['uniqueid']])){utils['debug'](util[_0xf4f0('0x3')]('[%s][queues][hangup]',_0x3dc51b['uniqueid']),_0x3dc51b);if(queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0x16')]){if(!queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0x17')]&&!queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0x18')]){queues[_0x3dc51b[_0xf4f0('0x5')]]['queuecallercomplete']=!![];queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0x19')]=utils['now']();queues[_0x3dc51b[_0xf4f0('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x1a'),_0x3dc51b[_0xf4f0('0x5')],queues[_0x3dc51b['uniqueid']][_0xf4f0('0x1b')],queues[_0x3dc51b['uniqueid']][_0xf4f0('0xb')]));writeDB(queues[_0x3dc51b[_0xf4f0('0x5')]]);}else if(queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0xf')]){utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x1c'),_0x3dc51b['uniqueid'],queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0x1b')],queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0xf')]));queues[queues[_0x3dc51b[_0xf4f0('0x5')]]['transfereduniqueid']]=queues[_0x3dc51b['uniqueid']];queues[queues[_0x3dc51b[_0xf4f0('0x5')]][_0xf4f0('0xf')]][_0xf4f0('0x1d')]=0x2;delete queues[_0x3dc51b[_0xf4f0('0x5')]];}}}catch(_0x59b370){utils[_0xf4f0('0x1e')](util['format'](_0xf4f0('0x1f'),_0x3dc51b[_0xf4f0('0x5')]),_0x59b370);}};exports[_0xf4f0('0x20')]=function(_0xa7617f){try{utils[_0xf4f0('0x10')](util[_0xf4f0('0x3')]('[%s][queues][varset]',_0xa7617f['uniqueid']),_0xa7617f);if(!_[_0xf4f0('0x15')](_0xa7617f['variable'][_0xf4f0('0x21')])&&_0xa7617f[_0xf4f0('0x22')][_0xf4f0('0x23')]()!==_0xf4f0('0x24')){if(!_[_0xf4f0('0x15')](queues[_0xa7617f[_0xf4f0('0x5')]])){queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0x17')]=![];queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0x25')]=null;queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0x18')]=!![];queues[_0xa7617f['uniqueid']][_0xf4f0('0x26')]=utils[_0xf4f0('0x14')]();queues[_0xa7617f[_0xf4f0('0x5')]]['queuecallerexitreason']=_0xa7617f[_0xf4f0('0x22')]['toUpperCase']();utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x27'),_0xa7617f['uniqueid'],queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0x1b')],_0xa7617f[_0xf4f0('0x22')],queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0xb')]));writeDB(queues[_0xa7617f[_0xf4f0('0x5')]]);}}else if(!_['isNil'](_0xa7617f[_0xf4f0('0x28')][_0xf4f0('0x29')])){if(!_[_0xf4f0('0x15')](queues[_0xa7617f[_0xf4f0('0x5')]])&&!queues[_0xa7617f['uniqueid']][_0xf4f0('0x17')]){queues[_0xa7617f['uniqueid']][_0xf4f0('0x17')]=![];queues[_0xa7617f['uniqueid']][_0xf4f0('0x25')]=null;queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0x18')]=!![];queues[_0xa7617f['uniqueid']][_0xf4f0('0x26')]=utils[_0xf4f0('0x14')]();queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0xb')]=_0xf4f0('0x2a');utils[_0xf4f0('0x2')](util['format'](_0xf4f0('0x2b'),_0xa7617f['uniqueid'],queues[_0xa7617f['uniqueid']]['name'],_0xa7617f[_0xf4f0('0x22')],queues[_0xa7617f[_0xf4f0('0x5')]][_0xf4f0('0xb')]));}}}catch(_0x483eca){utils['error'](util[_0xf4f0('0x3')](_0xf4f0('0x2c'),_0xa7617f[_0xf4f0('0x5')]),_0x483eca);}};exports['queuecallerabandon']=function(_0xc2d60b){try{if(!_[_0xf4f0('0x15')](queues[_0xc2d60b[_0xf4f0('0x5')]])){utils['debug'](util[_0xf4f0('0x3')]('[%s][queues][queuecallerabandon]',_0xc2d60b[_0xf4f0('0x5')]),_0xc2d60b);queues[_0xc2d60b[_0xf4f0('0x5')]][_0xf4f0('0x18')]=![];queues[_0xc2d60b[_0xf4f0('0x5')]][_0xf4f0('0x26')]=null;queues[_0xc2d60b[_0xf4f0('0x5')]][_0xf4f0('0x17')]=!![];queues[_0xc2d60b[_0xf4f0('0x5')]]['queuecallerabandonAt']=utils['now']();queues[_0xc2d60b['uniqueid']][_0xf4f0('0xb')]=_0xf4f0('0x2d');utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x2e'),_0xc2d60b['uniqueid'],queues[_0xc2d60b[_0xf4f0('0x5')]][_0xf4f0('0x1b')],queues[_0xc2d60b[_0xf4f0('0x5')]][_0xf4f0('0xb')]));}}catch(_0x106039){utils['error'](util[_0xf4f0('0x3')](_0xf4f0('0x2f'),_0xc2d60b[_0xf4f0('0x5')]),_0x106039);}};exports[_0xf4f0('0x30')]=function(_0x200b79){try{if(!_[_0xf4f0('0x15')](queues[_0x200b79[_0xf4f0('0x5')]])){utils[_0xf4f0('0x10')](util[_0xf4f0('0x3')](_0xf4f0('0x31'),_0x200b79[_0xf4f0('0x5')]),_0x200b79);utils['info'](util[_0xf4f0('0x3')](_0xf4f0('0x32'),_0x200b79[_0xf4f0('0x5')],queues[_0x200b79[_0xf4f0('0x5')]]['name'],_0x200b79[_0xf4f0('0x33')],_0x200b79[_0xf4f0('0x34')]));queues[_0x200b79[_0xf4f0('0x5')]][_0xf4f0('0x30')]=!![];queues[_0x200b79[_0xf4f0('0x5')]][_0xf4f0('0x16')]=utils[_0xf4f0('0x14')]();queues[_0x200b79[_0xf4f0('0x5')]][_0xf4f0('0x35')]=utils['diffTime'](queues[_0x200b79[_0xf4f0('0x5')]][_0xf4f0('0x16')],queues[_0x200b79[_0xf4f0('0x5')]][_0xf4f0('0x36')]);queues[_0x200b79['uniqueid']][_0xf4f0('0x37')]=_0x200b79[_0xf4f0('0x37')];queues[_0x200b79[_0xf4f0('0x5')]]['count']=_0x200b79[_0xf4f0('0x38')];queues[_0x200b79['uniqueid']][_0xf4f0('0x33')]=_0x200b79[_0xf4f0('0x33')];queues[_0x200b79['uniqueid']]['connectedlinename']=_0x200b79['connectedlinename'];}}catch(_0x2d5632){utils[_0xf4f0('0x1e')](util[_0xf4f0('0x3')](_0xf4f0('0x31'),_0x200b79['uniqueid']),_0x2d5632);}};exports[_0xf4f0('0x39')]=function(_0x42c2e5){try{if(!_['isNil'](queues[_0x42c2e5[_0xf4f0('0x5')]])){utils[_0xf4f0('0x10')](util['format']('[%s][queues][agentconnect]',_0x42c2e5[_0xf4f0('0x5')]),_0x42c2e5);utils['info'](util[_0xf4f0('0x3')](_0xf4f0('0x3a'),_0x42c2e5[_0xf4f0('0x5')],queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0x1b')],_0x42c2e5[_0xf4f0('0x3b')],_0x42c2e5[_0xf4f0('0x3c')]));queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0x17')]=![];queues[_0x42c2e5['uniqueid']][_0xf4f0('0x17')]=![];queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0x25')]=null;queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0x18')]=![];queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0xb')]=null;queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0x26')]=null;queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0x3d')]=!![];queues[_0x42c2e5[_0xf4f0('0x5')]][_0xf4f0('0xa')]=_0x42c2e5[_0xf4f0('0x3c')];queues[_0x42c2e5['uniqueid']]['lastAssignedTo']=_0x42c2e5[_0xf4f0('0x3b')];}}catch(_0x3c7ef8){utils['error'](util['format'](_0xf4f0('0x3e'),_0x42c2e5[_0xf4f0('0x5')]),_0x3c7ef8);}};exports[_0xf4f0('0x3f')]=function(_0x336164){try{if(!_[_0xf4f0('0x15')](queues[_0x336164[_0xf4f0('0x5')]])){if(queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x16')]){utils['debug'](util['format']('[%s][queues][agentcomplete]',_0x336164[_0xf4f0('0x5')]),_0x336164);queues[_0x336164[_0xf4f0('0x5')]]['queuecallerabandon']=![];queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x17')]=![];queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x25')]=null;queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x18')]=![];queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x26')]=null;queues[_0x336164[_0xf4f0('0x5')]]['assigned']=!![];queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x8')]=_0x336164[_0xf4f0('0x3b')];queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x40')]=!![];queues[_0x336164['uniqueid']][_0xf4f0('0x19')]=utils[_0xf4f0('0x14')]();if(_0x336164[_0xf4f0('0x41')]==_0xf4f0('0x42')){if(!queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x42')]){queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0xb')]='TRANSFER';}}else{queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0xb')]=_0xf4f0('0x43')+_0x336164[_0xf4f0('0x41')][_0xf4f0('0x23')]();}utils['info'](util[_0xf4f0('0x3')](_0xf4f0('0x44'),_0x336164['uniqueid'],queues[_0x336164[_0xf4f0('0x5')]][_0xf4f0('0x1b')],_0x336164[_0xf4f0('0x3b')],queues[_0x336164[_0xf4f0('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x336164[_0xf4f0('0x5')]]);}}}catch(_0x2fe596){utils[_0xf4f0('0x1e')](util[_0xf4f0('0x3')](_0xf4f0('0x45'),_0x336164[_0xf4f0('0x5')]),_0x2fe596);}};exports[_0xf4f0('0x46')]=function(_0x4f1a6a){try{if(!_[_0xf4f0('0x15')](queues[_0x4f1a6a[_0xf4f0('0x47')]])){utils[_0xf4f0('0x10')](util['format'](_0xf4f0('0x48'),_0x4f1a6a[_0xf4f0('0x5')]),_0x4f1a6a);queues[_0x4f1a6a[_0xf4f0('0x47')]]['transfer']=!![];queues[_0x4f1a6a[_0xf4f0('0x47')]][_0xf4f0('0x49')]=_0xf4f0('0x4a');queues[_0x4f1a6a[_0xf4f0('0x47')]]['transferexten']=_0x4f1a6a['extension'];queues[_0x4f1a6a[_0xf4f0('0x47')]]['transferuniqueid']=_0x4f1a6a[_0xf4f0('0x47')];queues[_0x4f1a6a[_0xf4f0('0x47')]][_0xf4f0('0xb')]=_0xf4f0('0x4b');utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x4c'),_0x4f1a6a['uniqueid'],queues[_0x4f1a6a['transfereeuniqueid']][_0xf4f0('0x1b')],_0x4f1a6a['transfereeuniqueid'],_0x4f1a6a[_0xf4f0('0x4d')]));}}catch(_0x283e43){utils[_0xf4f0('0x1e')](util[_0xf4f0('0x3')]('[%s][queues][blindtransfer]',_0x4f1a6a[_0xf4f0('0x5')]),_0x283e43);}};exports[_0xf4f0('0x4e')]=function(_0x115730){try{utils[_0xf4f0('0x10')](util[_0xf4f0('0x3')](_0xf4f0('0x4f'),_0x115730['origtransfereruniqueid']),_0x115730);if(_0x115730[_0xf4f0('0x50')]==_0x115730[_0xf4f0('0x51')]){if(!_['isNil'](queues[_0x115730[_0xf4f0('0x52')]])){utils[_0xf4f0('0x2')](util['format'](_0xf4f0('0x53'),_0x115730['origtransfereruniqueid'],queues[_0x115730[_0xf4f0('0x52')]]['name'],_0x115730[_0xf4f0('0x54')]));queues[_0x115730[_0xf4f0('0x52')]][_0xf4f0('0x42')]=!![];queues[_0x115730[_0xf4f0('0x52')]][_0xf4f0('0x49')]=_0xf4f0('0x55');queues[_0x115730[_0xf4f0('0x52')]][_0xf4f0('0x56')]=_0x115730['origtransfererexten'];queues[_0x115730['secondtransfererlinkedid']][_0xf4f0('0x57')]=_0x115730['origtransfereruniqueid'];queues[_0x115730[_0xf4f0('0x52')]]['queuecallerexitreason']=_0xf4f0('0x58');}if(!_[_0xf4f0('0x15')](queues[_0x115730[_0xf4f0('0x51')]])){if(_0x115730[_0xf4f0('0x59')]&&queues[_0x115730['transfereelinkedid']]){queues[_0x115730[_0xf4f0('0x59')]][_0xf4f0('0x1d')]=0x1;queues[_0x115730[_0xf4f0('0x47')]]=_[_0xf4f0('0x5a')](queues[_0x115730[_0xf4f0('0x59')]]);queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0xf')]=_0x115730[_0xf4f0('0x5b')];queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x1d')]=0x2;queues[_0x115730['transfereeuniqueid']][_0xf4f0('0x9')]=queues[_0x115730[_0xf4f0('0x52')]][_0xf4f0('0x9')];queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x5c')]=queues[_0x115730['secondtransfererlinkedid']][_0xf4f0('0x5c')];queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x36')]=utils[_0xf4f0('0x14')]();queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x16')]=utils[_0xf4f0('0x14')]();queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x35')]=0x0;queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x5d')]=0x0;utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x5e'),_0x115730['origtransfereruniqueid'],queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x1b')],queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x9')],queues[_0x115730[_0xf4f0('0x47')]][_0xf4f0('0x5c')]));}else{utils['info'](util['format'](_0xf4f0('0x5f'),_0x115730[_0xf4f0('0x50')],queues[_0x115730['origtransfererlinkedid']][_0xf4f0('0x1b')],_0x115730[_0xf4f0('0x52')]));queues[_0x115730[_0xf4f0('0x51')]][_0xf4f0('0xf')]=_0x115730[_0xf4f0('0x52')];}}}else if(_0x115730[_0xf4f0('0x60')]==_0x115730[_0xf4f0('0x52')]){if(!_[_0xf4f0('0x15')](queues[_0x115730[_0xf4f0('0x51')]])){utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x115730[_0xf4f0('0x50')],queues[_0x115730['origtransfererlinkedid']][_0xf4f0('0x1b')],_0x115730[_0xf4f0('0x60')],_0x115730['secondtransfererexten']));queues[_0x115730[_0xf4f0('0x51')]]['transfer']=!![];queues[_0x115730[_0xf4f0('0x51')]][_0xf4f0('0x49')]=_0xf4f0('0x55');queues[_0x115730[_0xf4f0('0x51')]]['transferexten']=_0x115730[_0xf4f0('0x61')];queues[_0x115730['origtransfererlinkedid']]['transferuniqueid']=_0x115730[_0xf4f0('0x60')];queues[_0x115730[_0xf4f0('0x51')]][_0xf4f0('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xf4f0('0x15')](queues[_0x115730[_0xf4f0('0x52')]])){if(_0x115730[_0xf4f0('0x62')]&&queues[_0x115730[_0xf4f0('0x62')]]){queues[_0x115730[_0xf4f0('0x62')]][_0xf4f0('0x1d')]=0x1;queues[_0x115730[_0xf4f0('0x5b')]]=_[_0xf4f0('0x5a')](queues[_0x115730[_0xf4f0('0x62')]]);queues[_0x115730[_0xf4f0('0x5b')]][_0xf4f0('0xf')]=_0x115730[_0xf4f0('0x5b')];queues[_0x115730['transfertargetuniqueid']][_0xf4f0('0x1d')]=0x2;queues[_0x115730[_0xf4f0('0x5b')]][_0xf4f0('0x9')]=queues[_0x115730['origtransfererlinkedid']][_0xf4f0('0x9')];queues[_0x115730['transfertargetuniqueid']][_0xf4f0('0x5c')]=queues[_0x115730[_0xf4f0('0x51')]]['calleridname'];queues[_0x115730[_0xf4f0('0x5b')]][_0xf4f0('0x36')]=utils[_0xf4f0('0x14')]();queues[_0x115730['transfertargetuniqueid']][_0xf4f0('0x16')]=utils[_0xf4f0('0x14')]();queues[_0x115730['transfertargetuniqueid']][_0xf4f0('0x35')]=0x0;queues[_0x115730['transfertargetuniqueid']][_0xf4f0('0x5d')]=0x0;utils['info'](util[_0xf4f0('0x3')](_0xf4f0('0x63'),_0x115730[_0xf4f0('0x50')],queues[_0x115730[_0xf4f0('0x5b')]][_0xf4f0('0x1b')],queues[_0x115730[_0xf4f0('0x5b')]]['transfereduniqueid'],queues[_0x115730[_0xf4f0('0x5b')]][_0xf4f0('0x9')],queues[_0x115730[_0xf4f0('0x5b')]][_0xf4f0('0x5c')]));}else{utils[_0xf4f0('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x115730['origtransfereruniqueid'],queues[_0x115730[_0xf4f0('0x52')]][_0xf4f0('0x1b')],_0x115730[_0xf4f0('0x51')]));queues[_0x115730[_0xf4f0('0x52')]]['transfereduniqueid']=_0x115730[_0xf4f0('0x51')];}}}}catch(_0x2dc38d){utils[_0xf4f0('0x1e')](util['format']('[%s][queues][attendedtransfer]',_0x115730[_0xf4f0('0x50')]),_0x2dc38d);}};exports[_0xf4f0('0x64')]=function(_0x576a21){try{if(!_[_0xf4f0('0x15')](queues[_0x576a21[_0xf4f0('0x5')]])){utils[_0xf4f0('0x10')](util[_0xf4f0('0x3')](_0xf4f0('0x65'),_0x576a21['uniqueid']),_0x576a21);queues[_0x576a21[_0xf4f0('0x5')]][_0xf4f0('0x66')]=utils['now']();utils[_0xf4f0('0x2')](util[_0xf4f0('0x3')](_0xf4f0('0x67'),_0x576a21[_0xf4f0('0x5')],queues[_0x576a21[_0xf4f0('0x5')]][_0xf4f0('0x1b')],queues[_0x576a21['uniqueid']][_0xf4f0('0x66')]));}}catch(_0x441122){utils[_0xf4f0('0x1e')](util[_0xf4f0('0x3')](_0xf4f0('0x65'),_0x576a21[_0xf4f0('0x5')]),_0x441122);}};exports[_0xf4f0('0x68')]=function(_0x4ba79b){try{if(!_[_0xf4f0('0x15')](queues[_0x4ba79b[_0xf4f0('0x5')]])){if(!_['isNil'](queues[_0x4ba79b[_0xf4f0('0x5')]][_0xf4f0('0x66')])){utils[_0xf4f0('0x10')](util[_0xf4f0('0x3')](_0xf4f0('0x69'),_0x4ba79b['uniqueid']),_0x4ba79b);queues[_0x4ba79b[_0xf4f0('0x5')]][_0xf4f0('0x5d')]+=utils[_0xf4f0('0x6a')](utils[_0xf4f0('0x14')](),queues[_0x4ba79b[_0xf4f0('0x5')]][_0xf4f0('0x66')]);utils['info'](util[_0xf4f0('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x4ba79b[_0xf4f0('0x5')],queues[_0x4ba79b[_0xf4f0('0x5')]][_0xf4f0('0x1b')],queues[_0x4ba79b['uniqueid']][_0xf4f0('0x5d')]));delete queues[_0x4ba79b[_0xf4f0('0x5')]][_0xf4f0('0x66')];}}}catch(_0x3be4aa){utils[_0xf4f0('0x1e')](util[_0xf4f0('0x3')]('[%s][queues][musiconholdstop]',_0x4ba79b[_0xf4f0('0x5')]),_0x3be4aa);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 8279715..9a0bf7b 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 _0x5295=['[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','format','[%s][recordings][writeDB]','accountcode','membername','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x5295,0x19d));var _0x5529=function(_0x543aad,_0x540c83){_0x543aad=_0x543aad-0x0;var _0x3a9c97=_0x5295[_0x543aad];return _0x3a9c97;};'use strict';var _=require(_0x5529('0x0'));var util=require(_0x5529('0x1'));var utils=require(_0x5529('0x2'));var recordings={};function writeDB(_0x2b2d1e){utils['info'](util[_0x5529('0x3')](_0x5529('0x4'),_0x2b2d1e['uniqueid']));if(_0x2b2d1e[_0x5529('0x5')]){utils['getUserByInternal'](_0x2b2d1e[_0x5529('0x5')])['then'](function(_0x2975f2){if(_0x2975f2){_0x2b2d1e[_0x5529('0x6')]=_0x2975f2['name'];_0x2b2d1e[_0x5529('0x7')]=_0x2975f2['id'];}utils[_0x5529('0x8')](_0x5529('0x9'),_0x2b2d1e);});}else{utils[_0x5529('0x8')](_0x5529('0x9'),_0x2b2d1e);}}exports[_0x5529('0xa')]=function(_0x6e5e96){try{utils[_0x5529('0xb')](util[_0x5529('0x3')](_0x5529('0xc'),_0x6e5e96[_0x5529('0xd')]),_0x6e5e96);if(_0x6e5e96[_0x5529('0xd')]==_0x6e5e96[_0x5529('0xe')]){utils[_0x5529('0xf')](util[_0x5529('0x3')](_0x5529('0x10'),_0x6e5e96['uniqueid'],_0x6e5e96[_0x5529('0x11')],_0x6e5e96[_0x5529('0x12')]));recordings[_0x6e5e96[_0x5529('0xd')]]={'uniqueid':_0x6e5e96[_0x5529('0xd')],'accountcode':_0x6e5e96[_0x5529('0x5')],'exten':_0x6e5e96['exten'],'context':_0x6e5e96['context'],'channel':_0x6e5e96['channel'],'monitors':[]};}}catch(_0x4c4970){utils[_0x5529('0x13')](util['format'](_0x5529('0xc'),_0x6e5e96['uniqueid']),_0x4c4970);}};exports[_0x5529('0x14')]=function(_0x555cff){try{utils[_0x5529('0xb')](util[_0x5529('0x3')](_0x5529('0x15'),_0x555cff['uniqueid']),_0x555cff);if(!_[_0x5529('0x16')](recordings[_0x555cff[_0x5529('0xd')]])&&_0x555cff[_0x5529('0x17')]==0x6){utils[_0x5529('0xf')](util[_0x5529('0x3')](_0x5529('0x18'),_0x555cff['uniqueid'],_0x555cff[_0x5529('0x11')],_0x555cff[_0x5529('0x19')]));}else if(!_[_0x5529('0x16')](recordings[_0x555cff[_0x5529('0xe')]])&&_0x555cff[_0x5529('0x17')]==0x6&&_0x555cff[_0x5529('0x11')]!=_0x5529('0x1a')){utils['info'](util[_0x5529('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x555cff[_0x5529('0xd')],_0x555cff['linkedid'],_0x555cff['context'],_0x555cff[_0x5529('0x19')]));recordings[_0x555cff[_0x5529('0xe')]][_0x5529('0x5')]=_0x555cff[_0x5529('0x5')];}}catch(_0x24c5c3){utils[_0x5529('0x13')](util[_0x5529('0x3')](_0x5529('0x15'),_0x555cff['uniqueid']),_0x24c5c3);}};exports[_0x5529('0x1b')]=function(_0x83a7f1){try{if(!_[_0x5529('0x16')](_0x83a7f1[_0x5529('0x1c')])&&!_[_0x5529('0x16')](_0x83a7f1[_0x5529('0x1c')][_0x5529('0x1d')])){utils[_0x5529('0xb')](util[_0x5529('0x3')](_0x5529('0x1e'),_0x83a7f1[_0x5529('0xd')]),_0x83a7f1);utils[_0x5529('0xf')](util[_0x5529('0x3')](_0x5529('0x1f'),_0x83a7f1[_0x5529('0xd')],_0x83a7f1['variable'],_0x83a7f1[_0x5529('0x20')]));if(_[_0x5529('0x21')](_0x83a7f1['value'],_0x5529('0x22'))){_0x83a7f1['value']=_0x83a7f1[_0x5529('0x20')]['replace'](_0x5529('0x22'),_0x5529('0x23'));}if(recordings[_0x83a7f1['linkedid']]){var _0xfba81=_['find'](recordings[_0x83a7f1[_0x5529('0xe')]][_0x5529('0x24')],{'value':_0x83a7f1[_0x5529('0x20')]});if(_[_0x5529('0x16')](_0xfba81)){recordings[_0x83a7f1[_0x5529('0xe')]][_0x5529('0x24')][_0x5529('0x25')]({'value':_0x83a7f1[_0x5529('0x20')]});}}}}catch(_0x5eb7e0){utils['error'](util[_0x5529('0x3')]('[%s][recordings][varset]',_0x83a7f1[_0x5529('0xd')]),_0x5eb7e0);}};exports[_0x5529('0x26')]=function(_0x3ec41d){try{if(!_[_0x5529('0x16')](recordings[_0x3ec41d[_0x5529('0xd')]])){utils['debug'](util[_0x5529('0x3')]('[%s][recordings][hangup]',_0x3ec41d[_0x5529('0xd')]),_0x3ec41d);utils[_0x5529('0xf')](util[_0x5529('0x3')](_0x5529('0x27'),_0x3ec41d[_0x5529('0xd')],_0x3ec41d[_0x5529('0x28')],_0x3ec41d['calleridname'],_0x3ec41d[_0x5529('0x29')]));recordings[_0x3ec41d[_0x5529('0xd')]]['calleridnum']=_0x3ec41d['calleridnum'];recordings[_0x3ec41d['uniqueid']]['calleridname']=_0x3ec41d['calleridname'];recordings[_0x3ec41d['uniqueid']][_0x5529('0x2a')]=_0x3ec41d[_0x5529('0x2a')];recordings[_0x3ec41d[_0x5529('0xd')]][_0x5529('0x2b')]=_0x3ec41d[_0x5529('0x2b')];if(recordings[_0x3ec41d[_0x5529('0xd')]][_0x5529('0x2c')]==_0x5529('0x2d')&&recordings[_0x3ec41d[_0x5529('0xd')]][_0x5529('0x5')]){recordings[_0x3ec41d[_0x5529('0xd')]]['connectedlinenum']=recordings[_0x3ec41d[_0x5529('0xd')]]['accountcode'];recordings[_0x3ec41d[_0x5529('0xd')]][_0x5529('0x2b')]='';}recordings[_0x3ec41d[_0x5529('0xd')]][_0x5529('0x24')][_0x5529('0x2e')](function(_0x807003){var _0x577b73=_[_0x5529('0x2f')](recordings[_0x3ec41d[_0x5529('0xd')]]);_0x577b73[_0x5529('0x20')]=_0x807003['value'];writeDB(_0x577b73);});delete recordings[_0x3ec41d[_0x5529('0xd')]];}}catch(_0x3d56c5){utils[_0x5529('0x13')](util[_0x5529('0x3')](_0x5529('0x30'),_0x3ec41d[_0x5529('0xd')]),_0x3d56c5);}};exports['newexten']=function(_0x33bcc2){try{if(!_['isNil'](recordings[_0x33bcc2['uniqueid']])){utils[_0x5529('0xb')](util[_0x5529('0x3')](_0x5529('0x31'),_0x33bcc2[_0x5529('0xd')]),_0x33bcc2);utils[_0x5529('0xf')](util[_0x5529('0x3')](_0x5529('0x32'),_0x33bcc2[_0x5529('0xd')],_0x33bcc2[_0x5529('0x33')],_0x33bcc2[_0x5529('0x34')]));if(_0x33bcc2[_0x5529('0x33')][_0x5529('0x35')]()=='set'&&_[_0x5529('0x36')](_0x33bcc2['appdata'][_0x5529('0x35')](),_0x5529('0x37'))){var _0x3871b7=_0x33bcc2['appdata'][_0x5529('0x38')]('=');var _0x14e6f9=_0x3871b7[0x0][_0x5529('0x39')](_0x3871b7[0x0]['lastIndexOf']('(')+0x1,_0x3871b7[0x0]['lastIndexOf'](')'));var _0x1b79d6=_0x3871b7[0x1];recordings[_0x33bcc2['uniqueid']][_0x14e6f9]=_0x1b79d6;}}}catch(_0x486f51){utils[_0x5529('0x13')](util[_0x5529('0x3')](_0x5529('0x31'),_0x33bcc2[_0x5529('0xd')]),_0x486f51);}};exports[_0x5529('0x3a')]=function(_0x119cc0){try{if(!_[_0x5529('0x16')](recordings[_0x119cc0['uniqueid']])){utils[_0x5529('0xb')](util[_0x5529('0x3')](_0x5529('0x3b'),_0x119cc0[_0x5529('0xd')]),_0x119cc0);utils[_0x5529('0xf')](util[_0x5529('0x3')](_0x5529('0x3c'),_0x119cc0['uniqueid'],_0x119cc0[_0x5529('0x3d')]));recordings[_0x119cc0[_0x5529('0xd')]][_0x5529('0x3d')]=_0x119cc0[_0x5529('0x3d')];}}catch(_0x14546f){utils[_0x5529('0x13')](util[_0x5529('0x3')](_0x5529('0x3b'),_0x119cc0['uniqueid']),_0x14546f);}}; \ No newline at end of file +var _0xc997=['accountcode','then','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','transfer','channel','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','value','.wav49','.WAV','find','monitors','push','hangup','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','getUserByInternal'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0xc997,0x1b2));var _0x7c99=function(_0x47bde5,_0x1ecb35){_0x47bde5=_0x47bde5-0x0;var _0x2c06c7=_0xc997[_0x47bde5];return _0x2c06c7;};'use strict';var _=require(_0x7c99('0x0'));var util=require(_0x7c99('0x1'));var utils=require(_0x7c99('0x2'));var recordings={};function writeDB(_0x28505d){utils[_0x7c99('0x3')](util[_0x7c99('0x4')](_0x7c99('0x5'),_0x28505d['uniqueid']));if(_0x28505d['accountcode']){utils[_0x7c99('0x6')](_0x28505d[_0x7c99('0x7')])[_0x7c99('0x8')](function(_0x418e2e){if(_0x418e2e){_0x28505d[_0x7c99('0x9')]=_0x418e2e[_0x7c99('0xa')];_0x28505d['UserId']=_0x418e2e['id'];}utils[_0x7c99('0xb')](_0x7c99('0xc'),_0x28505d);});}else{utils[_0x7c99('0xb')]('CreateVoiceRecording',_0x28505d);}}exports[_0x7c99('0xd')]=function(_0x369e35){try{utils[_0x7c99('0xe')](util[_0x7c99('0x4')](_0x7c99('0xf'),_0x369e35[_0x7c99('0x10')]),_0x369e35);if(_0x369e35[_0x7c99('0x10')]==_0x369e35[_0x7c99('0x11')]){utils[_0x7c99('0x3')](util[_0x7c99('0x4')](_0x7c99('0x12'),_0x369e35[_0x7c99('0x10')],_0x369e35['context'],_0x369e35['exten']));recordings[_0x369e35[_0x7c99('0x10')]]={'uniqueid':_0x369e35[_0x7c99('0x10')],'accountcode':_0x369e35['accountcode'],'exten':_0x369e35[_0x7c99('0x13')],'context':_0x369e35['context'],'channel':_0x369e35['channel'],'monitors':[]};}}catch(_0x5cfccc){utils[_0x7c99('0x14')](util['format']('[%s][recordings][newchannel]',_0x369e35[_0x7c99('0x10')]),_0x5cfccc);}};exports[_0x7c99('0x15')]=function(_0x490526){try{utils[_0x7c99('0xe')](util['format'](_0x7c99('0x16'),_0x490526['uniqueid']),_0x490526);if(!_[_0x7c99('0x17')](recordings[_0x490526['uniqueid']])&&_0x490526[_0x7c99('0x18')]==0x6){utils['info'](util[_0x7c99('0x4')](_0x7c99('0x19'),_0x490526['uniqueid'],_0x490526[_0x7c99('0x1a')],_0x490526['channel']));}else if(!_['isNil'](recordings[_0x490526[_0x7c99('0x11')]])&&_0x490526[_0x7c99('0x18')]==0x6&&_0x490526[_0x7c99('0x1a')]!=_0x7c99('0x1b')){utils['info'](util[_0x7c99('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x490526['uniqueid'],_0x490526[_0x7c99('0x11')],_0x490526[_0x7c99('0x1a')],_0x490526[_0x7c99('0x1c')]));recordings[_0x490526[_0x7c99('0x11')]][_0x7c99('0x7')]=_0x490526[_0x7c99('0x7')];}}catch(_0x2b8fed){utils[_0x7c99('0x14')](util['format']('[%s][recordings][newstate]',_0x490526[_0x7c99('0x10')]),_0x2b8fed);}};exports['varset']=function(_0x1e57ce){try{if(!_['isNil'](_0x1e57ce[_0x7c99('0x1d')])&&!_[_0x7c99('0x17')](_0x1e57ce['variable'][_0x7c99('0x1e')])){utils[_0x7c99('0xe')](util[_0x7c99('0x4')](_0x7c99('0x1f'),_0x1e57ce[_0x7c99('0x10')]),_0x1e57ce);utils[_0x7c99('0x3')](util[_0x7c99('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1e57ce[_0x7c99('0x10')],_0x1e57ce[_0x7c99('0x1d')],_0x1e57ce['value']));if(_[_0x7c99('0x20')](_0x1e57ce[_0x7c99('0x21')],'.wav49')){_0x1e57ce[_0x7c99('0x21')]=_0x1e57ce[_0x7c99('0x21')]['replace'](_0x7c99('0x22'),_0x7c99('0x23'));}if(recordings[_0x1e57ce[_0x7c99('0x11')]]){var _0x1e6adf=_[_0x7c99('0x24')](recordings[_0x1e57ce['linkedid']][_0x7c99('0x25')],{'value':_0x1e57ce['value']});if(_[_0x7c99('0x17')](_0x1e6adf)){recordings[_0x1e57ce['linkedid']][_0x7c99('0x25')][_0x7c99('0x26')]({'value':_0x1e57ce[_0x7c99('0x21')]});}}}}catch(_0xdc793b){utils[_0x7c99('0x14')](util[_0x7c99('0x4')](_0x7c99('0x1f'),_0x1e57ce[_0x7c99('0x10')]),_0xdc793b);}};exports[_0x7c99('0x27')]=function(_0x39d63c){try{if(!_[_0x7c99('0x17')](recordings[_0x39d63c['uniqueid']])){utils[_0x7c99('0xe')](util[_0x7c99('0x4')]('[%s][recordings][hangup]',_0x39d63c[_0x7c99('0x10')]),_0x39d63c);utils[_0x7c99('0x3')](util[_0x7c99('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x39d63c['uniqueid'],_0x39d63c['calleridnum'],_0x39d63c['calleridname'],_0x39d63c[_0x7c99('0x28')]));recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x29')]=_0x39d63c['calleridnum'];recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x2a')]=_0x39d63c[_0x7c99('0x2a')];recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x2b')]=_0x39d63c['connectedlinenum'];recordings[_0x39d63c[_0x7c99('0x10')]]['connectedlinename']=_0x39d63c[_0x7c99('0x2c')];if(recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x2d')]=='outbound'&&recordings[_0x39d63c['uniqueid']][_0x7c99('0x7')]){recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x2b')]=recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x7')];recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x2c')]='';}recordings[_0x39d63c[_0x7c99('0x10')]][_0x7c99('0x25')][_0x7c99('0x2e')](function(_0x1192b7){var _0x2c6e40=_[_0x7c99('0x2f')](recordings[_0x39d63c[_0x7c99('0x10')]]);_0x2c6e40[_0x7c99('0x21')]=_0x1192b7[_0x7c99('0x21')];writeDB(_0x2c6e40);});delete recordings[_0x39d63c[_0x7c99('0x10')]];}}catch(_0x53a6d0){utils[_0x7c99('0x14')](util[_0x7c99('0x4')](_0x7c99('0x30'),_0x39d63c[_0x7c99('0x10')]),_0x53a6d0);}};exports[_0x7c99('0x31')]=function(_0x3861f3){try{if(!_[_0x7c99('0x17')](recordings[_0x3861f3[_0x7c99('0x10')]])){utils[_0x7c99('0xe')](util[_0x7c99('0x4')](_0x7c99('0x32'),_0x3861f3['uniqueid']),_0x3861f3);utils[_0x7c99('0x3')](util[_0x7c99('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x3861f3[_0x7c99('0x10')],_0x3861f3[_0x7c99('0x33')],_0x3861f3[_0x7c99('0x34')]));if(_0x3861f3[_0x7c99('0x33')][_0x7c99('0x35')]()==_0x7c99('0x36')&&_[_0x7c99('0x37')](_0x3861f3[_0x7c99('0x34')][_0x7c99('0x35')](),_0x7c99('0x38'))){var _0x5383ab=_0x3861f3[_0x7c99('0x34')][_0x7c99('0x39')]('=');var _0x4520c5=_0x5383ab[0x0][_0x7c99('0x3a')](_0x5383ab[0x0][_0x7c99('0x3b')]('(')+0x1,_0x5383ab[0x0][_0x7c99('0x3b')](')'));var _0x57dce7=_0x5383ab[0x1];recordings[_0x3861f3[_0x7c99('0x10')]][_0x4520c5]=_0x57dce7;}}}catch(_0x25ed8d){utils['error'](util[_0x7c99('0x4')](_0x7c99('0x32'),_0x3861f3[_0x7c99('0x10')]),_0x25ed8d);}};exports['queuecallerjoin']=function(_0x55fbf3){try{if(!_[_0x7c99('0x17')](recordings[_0x55fbf3[_0x7c99('0x10')]])){utils[_0x7c99('0xe')](util[_0x7c99('0x4')](_0x7c99('0x3c'),_0x55fbf3[_0x7c99('0x10')]),_0x55fbf3);utils[_0x7c99('0x3')](util[_0x7c99('0x4')](_0x7c99('0x3d'),_0x55fbf3[_0x7c99('0x10')],_0x55fbf3[_0x7c99('0x3e')]));recordings[_0x55fbf3[_0x7c99('0x10')]]['queue']=_0x55fbf3[_0x7c99('0x3e')];}}catch(_0x2cae53){utils[_0x7c99('0x14')](util[_0x7c99('0x4')](_0x7c99('0x3c'),_0x55fbf3[_0x7c99('0x10')]),_0x2cae53);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 384ac3d..43df40a 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 _0x70a6=['[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','util','info','format'];(function(_0x18fd03,_0x1abe83){var _0x4ffb7f=function(_0x5881af){while(--_0x5881af){_0x18fd03['push'](_0x18fd03['shift']());}};_0x4ffb7f(++_0x1abe83);}(_0x70a6,0x1b9));var _0x670a=function(_0x1209fd,_0x15e051){_0x1209fd=_0x1209fd-0x0;var _0x82ec5f=_0x70a6[_0x1209fd];return _0x82ec5f;};'use strict';var _=require('lodash');var util=require(_0x670a('0x0'));var utils=require('./utils');function writeDB(_0x3379a1){utils[_0x670a('0x1')](util[_0x670a('0x2')](_0x670a('0x3'),_0x3379a1[_0x670a('0x4')]===_0x670a('0x5')?_0x3379a1[_0x670a('0x6')]:_0x3379a1[_0x670a('0x7')],_0x3379a1['type']));utils[_0x670a('0x8')](_0x670a('0x9'),_0x3379a1);}exports['blinds']={};exports[_0x670a('0xa')]=function(_0x4c576a){try{utils['debug'](util[_0x670a('0x2')]('[%s][transfers][blindtransfer]',_0x4c576a['uniqueid']),_0x4c576a);utils[_0x670a('0x1')](util['format'](_0x670a('0xb'),_0x4c576a[_0x670a('0x7')],_0x4c576a[_0x670a('0xc')],_0x4c576a['transferercalleridname'],_0x4c576a[_0x670a('0xd')],_0x4c576a[_0x670a('0xe')]));_0x4c576a[_0x670a('0x4')]='blind';exports['blinds'][_0x4c576a[_0x670a('0xf')]]=_0x4c576a;writeDB(_0x4c576a);}catch(_0x18386a){utils[_0x670a('0x10')](util[_0x670a('0x2')]('[%s][transfers][blindtransfer]',_0x4c576a[_0x670a('0x7')]),_0x18386a);}};exports['attendedtransfer']=function(_0x12f257){try{utils[_0x670a('0x11')](util[_0x670a('0x2')](_0x670a('0x12'),_0x12f257[_0x670a('0x6')]),_0x12f257);utils[_0x670a('0x1')](util[_0x670a('0x2')](_0x670a('0x13'),_0x12f257[_0x670a('0x6')],_0x12f257[_0x670a('0x14')],_0x12f257[_0x670a('0x15')],_0x12f257[_0x670a('0x16')],_0x12f257[_0x670a('0x17')]));_0x12f257=_['assign'](_0x12f257,{'transfererchannel':_0x12f257['origtransfererchannel'],'transferercalleridnum':_0x12f257[_0x670a('0x14')],'transferercalleridname':_0x12f257['origtransferercalleridname'],'transfererconnectedlinenum':_0x12f257[_0x670a('0x18')],'transfererconnectedlinename':_0x12f257['secondtransfererconnectedlinename'],'transfereraccountcode':_0x12f257[_0x670a('0x19')],'transferercontext':_0x12f257[_0x670a('0x1a')],'transfererexten':_0x12f257['secondtransfererexten'],'transfererlinkedid':_0x12f257[_0x670a('0x1b')],'context':_0x12f257[_0x670a('0x1c')],'extension':_0x12f257['origtransfererexten'],'type':_0x670a('0x5')});if(_[_0x670a('0x1d')](_0x12f257[_0x670a('0x1e')])){_0x12f257=_[_0x670a('0x1f')](_0x12f257,{'transfereechannel':_0x12f257[_0x670a('0x20')],'transfereecalleridnum':_0x12f257[_0x670a('0x16')],'transfereecalleridname':_0x12f257[_0x670a('0x17')],'transfereeconnectedlinenum':_0x12f257[_0x670a('0x21')],'transfereeconnectedlinename':_0x12f257[_0x670a('0x22')],'transfereeaccountcode':_0x12f257['transfertargetaccountcode'],'transfereecontext':_0x12f257['transfertargetcontext'],'transfereeexten':_0x12f257[_0x670a('0x23')],'transfereelinkedid':_0x12f257[_0x670a('0x24')]});}writeDB(_0x12f257);}catch(_0x12518d){utils[_0x670a('0x10')](util['format'](_0x670a('0x12'),_0x12f257[_0x670a('0x6')]),_0x12518d);}}; \ No newline at end of file +var _0x974e=['lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x4654e3,_0x5c6b2b){var _0x55b7e2=function(_0xd7bced){while(--_0xd7bced){_0x4654e3['push'](_0x4654e3['shift']());}};_0x55b7e2(++_0x5c6b2b);}(_0x974e,0x87));var _0xe974=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x974e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe974('0x0'));var util=require(_0xe974('0x1'));var utils=require(_0xe974('0x2'));function writeDB(_0x33683d){utils['info'](util[_0xe974('0x3')](_0xe974('0x4'),_0x33683d[_0xe974('0x5')]===_0xe974('0x6')?_0x33683d['origtransfereruniqueid']:_0x33683d[_0xe974('0x7')],_0x33683d[_0xe974('0x5')]));utils[_0xe974('0x8')](_0xe974('0x9'),_0x33683d);}exports['blinds']={};exports[_0xe974('0xa')]=function(_0x109356){try{utils[_0xe974('0xb')](util[_0xe974('0x3')](_0xe974('0xc'),_0x109356[_0xe974('0x7')]),_0x109356);utils[_0xe974('0xd')](util[_0xe974('0x3')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x109356[_0xe974('0x7')],_0x109356[_0xe974('0xe')],_0x109356[_0xe974('0xf')],_0x109356[_0xe974('0x10')],_0x109356[_0xe974('0x11')]));_0x109356['type']=_0xe974('0x12');exports[_0xe974('0x13')][_0x109356[_0xe974('0x14')]]=_0x109356;writeDB(_0x109356);}catch(_0x32d808){utils[_0xe974('0x15')](util[_0xe974('0x3')](_0xe974('0xc'),_0x109356[_0xe974('0x7')]),_0x32d808);}};exports[_0xe974('0x16')]=function(_0x547c2e){try{utils[_0xe974('0xb')](util[_0xe974('0x3')](_0xe974('0x17'),_0x547c2e[_0xe974('0x18')]),_0x547c2e);utils['info'](util[_0xe974('0x3')](_0xe974('0x19'),_0x547c2e[_0xe974('0x18')],_0x547c2e[_0xe974('0x1a')],_0x547c2e[_0xe974('0x1b')],_0x547c2e['transfertargetcalleridnum'],_0x547c2e[_0xe974('0x1c')]));_0x547c2e=_[_0xe974('0x1d')](_0x547c2e,{'transfererchannel':_0x547c2e['origtransfererchannel'],'transferercalleridnum':_0x547c2e[_0xe974('0x1a')],'transferercalleridname':_0x547c2e[_0xe974('0x1b')],'transfererconnectedlinenum':_0x547c2e[_0xe974('0x1e')],'transfererconnectedlinename':_0x547c2e[_0xe974('0x1f')],'transfereraccountcode':_0x547c2e[_0xe974('0x20')],'transferercontext':_0x547c2e['secondtransferercontext'],'transfererexten':_0x547c2e['secondtransfererexten'],'transfererlinkedid':_0x547c2e[_0xe974('0x21')],'context':_0x547c2e[_0xe974('0x22')],'extension':_0x547c2e[_0xe974('0x23')],'type':_0xe974('0x6')});if(_[_0xe974('0x24')](_0x547c2e[_0xe974('0x25')])){_0x547c2e=_[_0xe974('0x1d')](_0x547c2e,{'transfereechannel':_0x547c2e[_0xe974('0x26')],'transfereecalleridnum':_0x547c2e[_0xe974('0x27')],'transfereecalleridname':_0x547c2e[_0xe974('0x1c')],'transfereeconnectedlinenum':_0x547c2e['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x547c2e[_0xe974('0x28')],'transfereeaccountcode':_0x547c2e[_0xe974('0x29')],'transfereecontext':_0x547c2e[_0xe974('0x2a')],'transfereeexten':_0x547c2e[_0xe974('0x2b')],'transfereelinkedid':_0x547c2e[_0xe974('0x2c')]});}writeDB(_0x547c2e);}catch(_0x44741d){utils[_0xe974('0x15')](util[_0xe974('0x3')](_0xe974('0x17'),_0x547c2e[_0xe974('0x18')]),_0x44741d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 9f33d6f..267ccf7 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 _0x59d5=['length','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','debug','[utils][getUser]\x20where:%s','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','acwTimeout'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x59d5,0x130));var _0x559d=function(_0x5565c2,_0x55d424){_0x5565c2=_0x5565c2-0x0;var _0x4f5eb1=_0x59d5[_0x5565c2];return _0x4f5eb1;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x559d('0x0'));var moment=require(_0x559d('0x1'));var util=require(_0x559d('0x2'));var client=jayson[_0x559d('0x3')][_0x559d('0x4')]({'port':0x2329});var logger=require(_0x559d('0x5'))('xdr');exports['info']=function(_0x2394c7,_0x24293e){logger[_0x559d('0x6')](_0x2394c7,_0x24293e?util[_0x559d('0x7')](_0x24293e,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x5284d3,_0x1576fc){logger['debug'](_0x5284d3,_0x1576fc?util['inspect'](_0x1576fc,{'showHidden':![],'depth':null}):'');};exports[_0x559d('0x8')]=function(_0x9575af,_0x57777b){logger[_0x559d('0x8')](_0x9575af,_0x57777b?util[_0x559d('0x7')](_0x57777b,{'showHidden':![],'depth':null}):'');};exports[_0x559d('0x9')]=function(_0x3417d5,_0xe7c64c){return client[_0x559d('0x9')](_0x3417d5,{'body':_0xe7c64c})[_0x559d('0xa')](function(_0x2e27b6){logger['debug'](_0x559d('0xb'),_0x3417d5,_0x2e27b6?util['inspect'](_0x2e27b6,{'showHidden':![],'depth':null}):'');})[_0x559d('0xc')](function(_0x1fd7a2){logger[_0x559d('0x8')](_0x559d('0xb'),_0x3417d5,_0x1fd7a2?util[_0x559d('0x7')](_0x1fd7a2,{'showHidden':![],'depth':null}):'');});};function getUser(_0x310b46){return client[_0x559d('0x9')](_0x559d('0xd'),{'options':{'raw':!![],'attributes':['id',_0x559d('0xe'),_0x559d('0xf'),_0x559d('0x10')],'where':_0x310b46,'limit':0x1}})[_0x559d('0xa')](function(_0x48b3b4){logger[_0x559d('0x11')](_0x559d('0x12'),JSON['stringify'](_0x310b46),_0x48b3b4?util['inspect'](_0x48b3b4,{'showHidden':![],'depth':null}):'');return _0x48b3b4[_0x559d('0x13')]['length']?_0x48b3b4[_0x559d('0x13')][0x0]:null;});}exports[_0x559d('0x14')]=function(_0x114272){return new BPromise(function(_0x5c614d,_0x5079a8){if(_0x114272){return getUser({'internal':_0x114272})[_0x559d('0xa')](function(_0xd244b8){logger[_0x559d('0x6')](_0x559d('0x15'),_0x114272,_0xd244b8?_0x559d('0x16'):'notfound');return _0x5c614d(_0xd244b8);})['catch'](function(_0x4e0270){logger[_0x559d('0x8')](_0x559d('0x17'),_0x4e0270?util[_0x559d('0x7')](_0x4e0270,{'showHidden':![],'depth':null}):'');return _0x5c614d(null);});}return _0x5c614d(null);});};exports[_0x559d('0x18')]=function(_0x2a070e){return new BPromise(function(_0x2f9519,_0x47efb3){if(_0x2a070e){return getUser({'interface':_0x2a070e})[_0x559d('0xa')](function(_0x3f923d){logger[_0x559d('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x2a070e,_0x3f923d?_0x559d('0x16'):_0x559d('0x19'));return _0x2f9519(_0x3f923d);})[_0x559d('0xc')](function(_0x38ffc4){logger[_0x559d('0x8')](_0x559d('0x1a'),_0x38ffc4?util[_0x559d('0x7')](_0x38ffc4,{'showHidden':![],'depth':null}):'');return _0x2f9519(null);});}return _0x2f9519(null);});};exports[_0x559d('0x1b')]=function(_0x33f819){return new BPromise(function(_0x10c3b5,_0x11f500){if(_0x33f819){return getUser({'name':_0x33f819})[_0x559d('0xa')](function(_0x529219){logger[_0x559d('0x6')](_0x559d('0x1c'),_0x33f819,_0x529219?'found':'notfound');return _0x10c3b5(_0x529219);})[_0x559d('0xc')](function(_0x161abe){logger[_0x559d('0x8')](_0x559d('0x1d'),_0x161abe?util[_0x559d('0x7')](_0x161abe,{'showHidden':![],'depth':null}):'');return _0x10c3b5(null);});}return _0x10c3b5(null);});};exports['getVoiceQueueByName']=function(_0x316b7e){return new BPromise(function(_0x85f595,_0x498024){if(_0x316b7e){return client[_0x559d('0x9')](_0x559d('0x1e'),{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x559d('0x1f')],'where':{'name':_0x316b7e},'limit':0x1}})[_0x559d('0xa')](function(_0x1f59cc){logger[_0x559d('0x11')]('[utils][getVoiceQueueByName]\x20name:%s',_0x316b7e,_0x1f59cc?util[_0x559d('0x7')](_0x1f59cc,{'showHidden':![],'depth':null}):'');logger[_0x559d('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x316b7e,_0x1f59cc?'found':_0x559d('0x19'));return _0x85f595(_0x1f59cc[_0x559d('0x13')][_0x559d('0x20')]?_0x1f59cc['result'][0x0]:null);})[_0x559d('0xc')](function(_0x2856ea){logger[_0x559d('0x8')]('[utils][getVoiceQueueByName]',_0x2856ea?util[_0x559d('0x7')](_0x2856ea,{'showHidden':![],'depth':null}):'');return _0x85f595(null);});}return _0x85f595(null);});};exports['addTime']=function(_0x40351d,_0x87cbc3){return moment(_0x40351d)[_0x559d('0x21')](_0x87cbc3,_0x559d('0x22'))[_0x559d('0x23')](_0x559d('0x24'));};exports['subtractTime']=function(_0x1af59f,_0x5b1048){return moment(_0x1af59f)[_0x559d('0x25')](_0x5b1048,'seconds')[_0x559d('0x23')](_0x559d('0x24'));};exports[_0x559d('0x26')]=function(_0x528c3f,_0x73207c){return moment(_0x528c3f)['diff'](moment(_0x73207c),_0x559d('0x22'));};exports['sumTime']=function(_0x56ba9e,_0x55dadf){return parseInt(_0x56ba9e,0xa)+parseInt(_0x55dadf,0xa);};exports[_0x559d('0x27')]=function(){return moment()[_0x559d('0x23')](_0x559d('0x24'));};exports[_0x559d('0x28')]=function(_0x164b41,_0x291b90){if(_0x291b90){return moment(_0x164b41)['isAfter'](_0x291b90);}return!![];};exports[_0x559d('0x29')]=function(_0x5518b0,_0x6acdaf){if(_0x6acdaf){return moment(_0x5518b0)[_0x559d('0x29')](_0x6acdaf);}else if(_0x5518b0){return!![];}return![];}; \ No newline at end of file +var _0x3935=['length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','getUserByInterface','info','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','debug','inspect','error','request','then','[utils][request]\x20name:%s','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x3935,0x1e1));var _0x5393=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0x3935[_0x54c10d];return _0x1fa703;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x5393('0x0'));var moment=require(_0x5393('0x1'));var util=require(_0x5393('0x2'));var client=jayson[_0x5393('0x3')][_0x5393('0x4')]({'port':0x2329});var logger=require(_0x5393('0x5'))(_0x5393('0x6'));exports['info']=function(_0x4a1fb9,_0x3c0431){logger['info'](_0x4a1fb9,_0x3c0431?util['inspect'](_0x3c0431,{'showHidden':![],'depth':null}):'');};exports[_0x5393('0x7')]=function(_0x5b01d6,_0x50536d){logger['debug'](_0x5b01d6,_0x50536d?util[_0x5393('0x8')](_0x50536d,{'showHidden':![],'depth':null}):'');};exports[_0x5393('0x9')]=function(_0x2e4252,_0x14ad79){logger[_0x5393('0x9')](_0x2e4252,_0x14ad79?util[_0x5393('0x8')](_0x14ad79,{'showHidden':![],'depth':null}):'');};exports[_0x5393('0xa')]=function(_0x12b916,_0x435949){return client[_0x5393('0xa')](_0x12b916,{'body':_0x435949})[_0x5393('0xb')](function(_0x4268fb){logger['debug']('[utils][request]\x20name:%s',_0x12b916,_0x4268fb?util[_0x5393('0x8')](_0x4268fb,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x2f0bf5){logger[_0x5393('0x9')](_0x5393('0xc'),_0x12b916,_0x2f0bf5?util[_0x5393('0x8')](_0x2f0bf5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2d4a95){return client[_0x5393('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5393('0xd'),_0x5393('0xe'),_0x5393('0xf')],'where':_0x2d4a95,'limit':0x1}})[_0x5393('0xb')](function(_0xdd62f3){logger[_0x5393('0x7')](_0x5393('0x10'),JSON[_0x5393('0x11')](_0x2d4a95),_0xdd62f3?util[_0x5393('0x8')](_0xdd62f3,{'showHidden':![],'depth':null}):'');return _0xdd62f3[_0x5393('0x12')][_0x5393('0x13')]?_0xdd62f3[_0x5393('0x12')][0x0]:null;});}exports[_0x5393('0x14')]=function(_0x30e12a){return new BPromise(function(_0x4e096b,_0x23ebe6){if(_0x30e12a){return getUser({'internal':_0x30e12a})['then'](function(_0x594b17){logger['info'](_0x5393('0x15'),_0x30e12a,_0x594b17?_0x5393('0x16'):'notfound');return _0x4e096b(_0x594b17);})[_0x5393('0x17')](function(_0x47aa0b){logger[_0x5393('0x9')]('[utils][getUserByInternal]',_0x47aa0b?util[_0x5393('0x8')](_0x47aa0b,{'showHidden':![],'depth':null}):'');return _0x4e096b(null);});}return _0x4e096b(null);});};exports[_0x5393('0x18')]=function(_0x57c4d4){return new BPromise(function(_0x3bb502,_0x35a83e){if(_0x57c4d4){return getUser({'interface':_0x57c4d4})[_0x5393('0xb')](function(_0x15f9a0){logger[_0x5393('0x19')](_0x5393('0x1a'),_0x57c4d4,_0x15f9a0?_0x5393('0x16'):'notfound');return _0x3bb502(_0x15f9a0);})['catch'](function(_0x19fd60){logger[_0x5393('0x9')](_0x5393('0x1b'),_0x19fd60?util['inspect'](_0x19fd60,{'showHidden':![],'depth':null}):'');return _0x3bb502(null);});}return _0x3bb502(null);});};exports[_0x5393('0x1c')]=function(_0x466b5d){return new BPromise(function(_0x21260a,_0x1ed2fe){if(_0x466b5d){return getUser({'name':_0x466b5d})['then'](function(_0x57af9b){logger[_0x5393('0x19')](_0x5393('0x1d'),_0x466b5d,_0x57af9b?'found':_0x5393('0x1e'));return _0x21260a(_0x57af9b);})[_0x5393('0x17')](function(_0x4abc7){logger[_0x5393('0x9')](_0x5393('0x1f'),_0x4abc7?util[_0x5393('0x8')](_0x4abc7,{'showHidden':![],'depth':null}):'');return _0x21260a(null);});}return _0x21260a(null);});};exports[_0x5393('0x20')]=function(_0x1ee8aa){return new BPromise(function(_0x5cd7d5,_0x57706f){if(_0x1ee8aa){return client[_0x5393('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x5393('0xe'),_0x5393('0x21'),_0x5393('0x22'),_0x5393('0x23')],'where':{'name':_0x1ee8aa},'limit':0x1}})[_0x5393('0xb')](function(_0x11f8db){logger[_0x5393('0x7')](_0x5393('0x24'),_0x1ee8aa,_0x11f8db?util[_0x5393('0x8')](_0x11f8db,{'showHidden':![],'depth':null}):'');logger[_0x5393('0x19')](_0x5393('0x25'),_0x1ee8aa,_0x11f8db?'found':_0x5393('0x1e'));return _0x5cd7d5(_0x11f8db[_0x5393('0x12')]['length']?_0x11f8db[_0x5393('0x12')][0x0]:null);})[_0x5393('0x17')](function(_0x2152fa){logger[_0x5393('0x9')](_0x5393('0x26'),_0x2152fa?util['inspect'](_0x2152fa,{'showHidden':![],'depth':null}):'');return _0x5cd7d5(null);});}return _0x5cd7d5(null);});};exports[_0x5393('0x27')]=function(_0x440ebc,_0x1ece14){return moment(_0x440ebc)['add'](_0x1ece14,_0x5393('0x28'))[_0x5393('0x29')](_0x5393('0x2a'));};exports[_0x5393('0x2b')]=function(_0x2e76a5,_0x4c31a0){return moment(_0x2e76a5)['subtract'](_0x4c31a0,_0x5393('0x28'))[_0x5393('0x29')](_0x5393('0x2a'));};exports[_0x5393('0x2c')]=function(_0x13de8c,_0x72a212){return moment(_0x13de8c)[_0x5393('0x2d')](moment(_0x72a212),_0x5393('0x28'));};exports[_0x5393('0x2e')]=function(_0x524c94,_0x728031){return parseInt(_0x524c94,0xa)+parseInt(_0x728031,0xa);};exports[_0x5393('0x2f')]=function(){return moment()['format'](_0x5393('0x2a'));};exports[_0x5393('0x30')]=function(_0x322208,_0x10368c){if(_0x10368c){return moment(_0x322208)[_0x5393('0x30')](_0x10368c);}return!![];};exports[_0x5393('0x31')]=function(_0x1d15d8,_0xb7df6b){if(_0xb7df6b){return moment(_0x1d15d8)[_0x5393('0x31')](_0xb7df6b);}else if(_0x1d15d8){return!![];}return![];}; \ No newline at end of file